From 2f1fc7c50d47442cc848c939deb5f767185c82f8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 Oct 2009 11:42:27 +0200 Subject: [PATCH 0001/1192] import of libtomcrypt out of lt_tree.tar.bz2 checksums of lt_tree.tar.bz2 MD5: 3c36e1ca95518f4d00a76dc9b7049952 SHA1: 4f31d1aa8cd1b9d7452b777cd52f8280dc7ebcbc --- makefile | 14 +- makefile.icc | 14 +- makefile.msvc | 14 +- makefile.shared | 14 +- makefile.unix | 14 +- src/ciphers/camellia.c | 710 ++++++++++++++++++++++++++++++++ src/encauth/ccm/ccm_memory_ex.c | 383 +++++++++++++++++ src/headers/tomcrypt_cipher.h | 20 + src/headers/tomcrypt_custom.h | 2 + src/headers/tomcrypt_mac.h | 13 + src/misc/crypt/crypt.c | 6 + testprof/x86_prof.c | 3 + 12 files changed, 1172 insertions(+), 35 deletions(-) create mode 100644 src/ciphers/camellia.c create mode 100644 src/encauth/ccm/ccm_memory_ex.c diff --git a/makefile b/makefile index f650ea159..49f420231 100644 --- a/makefile +++ b/makefile @@ -109,12 +109,12 @@ endif #List of objects to compile. #START_INS OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ -src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o src/ciphers/kseed.o \ -src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o \ -src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ +src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ +src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ @@ -391,5 +391,5 @@ zipup: no_oops docs # $Source: /cvs/libtom/libtomcrypt/makefile,v $ -# $Revision: 1.150 $ -# $Date: 2007/02/16 16:36:25 $ +# $Revision: 1.151 $ +# $Date: 2007/06/20 13:14:31 $ diff --git a/makefile.icc b/makefile.icc index c1ff1630a..0dbd7ce5b 100644 --- a/makefile.icc +++ b/makefile.icc @@ -95,12 +95,12 @@ endif #List of objects to compile. #START_INS OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ -src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o src/ciphers/kseed.o \ -src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o \ -src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ +src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ +src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ @@ -290,6 +290,6 @@ install: library install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) # $Source: /cvs/libtom/libtomcrypt/makefile.icc,v $ -# $Revision: 1.76 $ -# $Date: 2007/02/16 16:36:25 $ +# $Revision: 1.77 $ +# $Date: 2007/06/20 13:14:31 $ diff --git a/makefile.msvc b/makefile.msvc index 7f41ad998..c329ff1e4 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -5,12 +5,12 @@ CFLAGS = /Isrc/headers/ /Itestprof/ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ $(CF) #START_INS OBJECTS=src/ciphers/aes/aes_enc.obj src/ciphers/aes/aes.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \ -src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj src/ciphers/kseed.obj \ -src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj src/ciphers/rc6.obj \ -src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/safer/safer_tab.obj \ +src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \ +src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \ +src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/safer/safer_tab.obj \ src/ciphers/skipjack.obj src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_memory.obj \ -src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj src/encauth/eax/eax_decrypt.obj \ -src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ +src/encauth/ccm/ccm_memory_ex.obj src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj \ +src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ src/encauth/eax/eax_encrypt_authenticate_memory.obj src/encauth/eax/eax_encrypt.obj \ src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \ src/encauth/gcm/gcm_add_iv.obj src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj \ @@ -148,5 +148,5 @@ timing: demos/timing.c library cl $(CFLAGS) demos/timing.c testprof/tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) # $Source: /cvs/libtom/libtomcrypt/makefile.msvc,v $ -# $Revision: 1.54 $ -# $Date: 2007/02/16 16:36:25 $ +# $Revision: 1.55 $ +# $Date: 2007/06/20 13:14:31 $ diff --git a/makefile.shared b/makefile.shared index dd575d949..2bce4efc3 100644 --- a/makefile.shared +++ b/makefile.shared @@ -100,12 +100,12 @@ endif #List of objects to compile. #START_INS OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ -src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o src/ciphers/kseed.o \ -src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o \ -src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ +src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ +src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ @@ -278,5 +278,5 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) gcc -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS) # $Source: /cvs/libtom/libtomcrypt/makefile.shared,v $ -# $Revision: 1.80 $ -# $Date: 2007/02/16 16:36:25 $ +# $Revision: 1.81 $ +# $Date: 2007/06/20 13:14:31 $ diff --git a/makefile.unix b/makefile.unix index bb8f29c3a..993921b0b 100644 --- a/makefile.unix +++ b/makefile.unix @@ -41,12 +41,12 @@ GROUP=wheel #List of objects to compile. #START_INS OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ -src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o src/ciphers/kseed.o \ -src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o \ -src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ +src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ +src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ @@ -238,5 +238,5 @@ install_test: testprof/$(LIBTEST) install -g $(GROUP) -o $(USER) testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) # $Source: /cvs/libtom/libtomcrypt/makefile.unix,v $ -# $Revision: 1.7 $ -# $Date: 2007/02/16 16:36:25 $ +# $Revision: 1.8 $ +# $Date: 2007/06/20 13:14:31 $ diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c new file mode 100644 index 000000000..48d5fb215 --- /dev/null +++ b/src/ciphers/camellia.c @@ -0,0 +1,710 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file camellia.ca + Implementation by Tom St Denis of Elliptic Semiconductor +*/ + +#include "tomcrypt.h" + +#ifdef LTC_CAMELLIA + +const struct ltc_cipher_descriptor camellia_desc = { + "camellia", + 23, + 16, 32, 16, 18, + &camellia_setup, + &camellia_ecb_encrypt, + &camellia_ecb_decrypt, + &camellia_test, + &camellia_done, + &camellia_keysize, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; + +static const ulong32 SP1110[] = { +0x70707000, 0x82828200, 0x2c2c2c00, 0xececec00, 0xb3b3b300, 0x27272700, 0xc0c0c000, 0xe5e5e500, +0xe4e4e400, 0x85858500, 0x57575700, 0x35353500, 0xeaeaea00, 0x0c0c0c00, 0xaeaeae00, 0x41414100, +0x23232300, 0xefefef00, 0x6b6b6b00, 0x93939300, 0x45454500, 0x19191900, 0xa5a5a500, 0x21212100, +0xededed00, 0x0e0e0e00, 0x4f4f4f00, 0x4e4e4e00, 0x1d1d1d00, 0x65656500, 0x92929200, 0xbdbdbd00, +0x86868600, 0xb8b8b800, 0xafafaf00, 0x8f8f8f00, 0x7c7c7c00, 0xebebeb00, 0x1f1f1f00, 0xcecece00, +0x3e3e3e00, 0x30303000, 0xdcdcdc00, 0x5f5f5f00, 0x5e5e5e00, 0xc5c5c500, 0x0b0b0b00, 0x1a1a1a00, +0xa6a6a600, 0xe1e1e100, 0x39393900, 0xcacaca00, 0xd5d5d500, 0x47474700, 0x5d5d5d00, 0x3d3d3d00, +0xd9d9d900, 0x01010100, 0x5a5a5a00, 0xd6d6d600, 0x51515100, 0x56565600, 0x6c6c6c00, 0x4d4d4d00, +0x8b8b8b00, 0x0d0d0d00, 0x9a9a9a00, 0x66666600, 0xfbfbfb00, 0xcccccc00, 0xb0b0b000, 0x2d2d2d00, +0x74747400, 0x12121200, 0x2b2b2b00, 0x20202000, 0xf0f0f000, 0xb1b1b100, 0x84848400, 0x99999900, +0xdfdfdf00, 0x4c4c4c00, 0xcbcbcb00, 0xc2c2c200, 0x34343400, 0x7e7e7e00, 0x76767600, 0x05050500, +0x6d6d6d00, 0xb7b7b700, 0xa9a9a900, 0x31313100, 0xd1d1d100, 0x17171700, 0x04040400, 0xd7d7d700, +0x14141400, 0x58585800, 0x3a3a3a00, 0x61616100, 0xdedede00, 0x1b1b1b00, 0x11111100, 0x1c1c1c00, +0x32323200, 0x0f0f0f00, 0x9c9c9c00, 0x16161600, 0x53535300, 0x18181800, 0xf2f2f200, 0x22222200, +0xfefefe00, 0x44444400, 0xcfcfcf00, 0xb2b2b200, 0xc3c3c300, 0xb5b5b500, 0x7a7a7a00, 0x91919100, +0x24242400, 0x08080800, 0xe8e8e800, 0xa8a8a800, 0x60606000, 0xfcfcfc00, 0x69696900, 0x50505000, +0xaaaaaa00, 0xd0d0d000, 0xa0a0a000, 0x7d7d7d00, 0xa1a1a100, 0x89898900, 0x62626200, 0x97979700, +0x54545400, 0x5b5b5b00, 0x1e1e1e00, 0x95959500, 0xe0e0e000, 0xffffff00, 0x64646400, 0xd2d2d200, +0x10101000, 0xc4c4c400, 0x00000000, 0x48484800, 0xa3a3a300, 0xf7f7f700, 0x75757500, 0xdbdbdb00, +0x8a8a8a00, 0x03030300, 0xe6e6e600, 0xdadada00, 0x09090900, 0x3f3f3f00, 0xdddddd00, 0x94949400, +0x87878700, 0x5c5c5c00, 0x83838300, 0x02020200, 0xcdcdcd00, 0x4a4a4a00, 0x90909000, 0x33333300, +0x73737300, 0x67676700, 0xf6f6f600, 0xf3f3f300, 0x9d9d9d00, 0x7f7f7f00, 0xbfbfbf00, 0xe2e2e200, +0x52525200, 0x9b9b9b00, 0xd8d8d800, 0x26262600, 0xc8c8c800, 0x37373700, 0xc6c6c600, 0x3b3b3b00, +0x81818100, 0x96969600, 0x6f6f6f00, 0x4b4b4b00, 0x13131300, 0xbebebe00, 0x63636300, 0x2e2e2e00, +0xe9e9e900, 0x79797900, 0xa7a7a700, 0x8c8c8c00, 0x9f9f9f00, 0x6e6e6e00, 0xbcbcbc00, 0x8e8e8e00, +0x29292900, 0xf5f5f500, 0xf9f9f900, 0xb6b6b600, 0x2f2f2f00, 0xfdfdfd00, 0xb4b4b400, 0x59595900, +0x78787800, 0x98989800, 0x06060600, 0x6a6a6a00, 0xe7e7e700, 0x46464600, 0x71717100, 0xbababa00, +0xd4d4d400, 0x25252500, 0xababab00, 0x42424200, 0x88888800, 0xa2a2a200, 0x8d8d8d00, 0xfafafa00, +0x72727200, 0x07070700, 0xb9b9b900, 0x55555500, 0xf8f8f800, 0xeeeeee00, 0xacacac00, 0x0a0a0a00, +0x36363600, 0x49494900, 0x2a2a2a00, 0x68686800, 0x3c3c3c00, 0x38383800, 0xf1f1f100, 0xa4a4a400, +0x40404000, 0x28282800, 0xd3d3d300, 0x7b7b7b00, 0xbbbbbb00, 0xc9c9c900, 0x43434300, 0xc1c1c100, +0x15151500, 0xe3e3e300, 0xadadad00, 0xf4f4f400, 0x77777700, 0xc7c7c700, 0x80808000, 0x9e9e9e00, +}; + +static const ulong32 SP0222[] = { +0x00e0e0e0, 0x00050505, 0x00585858, 0x00d9d9d9, 0x00676767, 0x004e4e4e, 0x00818181, 0x00cbcbcb, +0x00c9c9c9, 0x000b0b0b, 0x00aeaeae, 0x006a6a6a, 0x00d5d5d5, 0x00181818, 0x005d5d5d, 0x00828282, +0x00464646, 0x00dfdfdf, 0x00d6d6d6, 0x00272727, 0x008a8a8a, 0x00323232, 0x004b4b4b, 0x00424242, +0x00dbdbdb, 0x001c1c1c, 0x009e9e9e, 0x009c9c9c, 0x003a3a3a, 0x00cacaca, 0x00252525, 0x007b7b7b, +0x000d0d0d, 0x00717171, 0x005f5f5f, 0x001f1f1f, 0x00f8f8f8, 0x00d7d7d7, 0x003e3e3e, 0x009d9d9d, +0x007c7c7c, 0x00606060, 0x00b9b9b9, 0x00bebebe, 0x00bcbcbc, 0x008b8b8b, 0x00161616, 0x00343434, +0x004d4d4d, 0x00c3c3c3, 0x00727272, 0x00959595, 0x00ababab, 0x008e8e8e, 0x00bababa, 0x007a7a7a, +0x00b3b3b3, 0x00020202, 0x00b4b4b4, 0x00adadad, 0x00a2a2a2, 0x00acacac, 0x00d8d8d8, 0x009a9a9a, +0x00171717, 0x001a1a1a, 0x00353535, 0x00cccccc, 0x00f7f7f7, 0x00999999, 0x00616161, 0x005a5a5a, +0x00e8e8e8, 0x00242424, 0x00565656, 0x00404040, 0x00e1e1e1, 0x00636363, 0x00090909, 0x00333333, +0x00bfbfbf, 0x00989898, 0x00979797, 0x00858585, 0x00686868, 0x00fcfcfc, 0x00ececec, 0x000a0a0a, +0x00dadada, 0x006f6f6f, 0x00535353, 0x00626262, 0x00a3a3a3, 0x002e2e2e, 0x00080808, 0x00afafaf, +0x00282828, 0x00b0b0b0, 0x00747474, 0x00c2c2c2, 0x00bdbdbd, 0x00363636, 0x00222222, 0x00383838, +0x00646464, 0x001e1e1e, 0x00393939, 0x002c2c2c, 0x00a6a6a6, 0x00303030, 0x00e5e5e5, 0x00444444, +0x00fdfdfd, 0x00888888, 0x009f9f9f, 0x00656565, 0x00878787, 0x006b6b6b, 0x00f4f4f4, 0x00232323, +0x00484848, 0x00101010, 0x00d1d1d1, 0x00515151, 0x00c0c0c0, 0x00f9f9f9, 0x00d2d2d2, 0x00a0a0a0, +0x00555555, 0x00a1a1a1, 0x00414141, 0x00fafafa, 0x00434343, 0x00131313, 0x00c4c4c4, 0x002f2f2f, +0x00a8a8a8, 0x00b6b6b6, 0x003c3c3c, 0x002b2b2b, 0x00c1c1c1, 0x00ffffff, 0x00c8c8c8, 0x00a5a5a5, +0x00202020, 0x00898989, 0x00000000, 0x00909090, 0x00474747, 0x00efefef, 0x00eaeaea, 0x00b7b7b7, +0x00151515, 0x00060606, 0x00cdcdcd, 0x00b5b5b5, 0x00121212, 0x007e7e7e, 0x00bbbbbb, 0x00292929, +0x000f0f0f, 0x00b8b8b8, 0x00070707, 0x00040404, 0x009b9b9b, 0x00949494, 0x00212121, 0x00666666, +0x00e6e6e6, 0x00cecece, 0x00ededed, 0x00e7e7e7, 0x003b3b3b, 0x00fefefe, 0x007f7f7f, 0x00c5c5c5, +0x00a4a4a4, 0x00373737, 0x00b1b1b1, 0x004c4c4c, 0x00919191, 0x006e6e6e, 0x008d8d8d, 0x00767676, +0x00030303, 0x002d2d2d, 0x00dedede, 0x00969696, 0x00262626, 0x007d7d7d, 0x00c6c6c6, 0x005c5c5c, +0x00d3d3d3, 0x00f2f2f2, 0x004f4f4f, 0x00191919, 0x003f3f3f, 0x00dcdcdc, 0x00797979, 0x001d1d1d, +0x00525252, 0x00ebebeb, 0x00f3f3f3, 0x006d6d6d, 0x005e5e5e, 0x00fbfbfb, 0x00696969, 0x00b2b2b2, +0x00f0f0f0, 0x00313131, 0x000c0c0c, 0x00d4d4d4, 0x00cfcfcf, 0x008c8c8c, 0x00e2e2e2, 0x00757575, +0x00a9a9a9, 0x004a4a4a, 0x00575757, 0x00848484, 0x00111111, 0x00454545, 0x001b1b1b, 0x00f5f5f5, +0x00e4e4e4, 0x000e0e0e, 0x00737373, 0x00aaaaaa, 0x00f1f1f1, 0x00dddddd, 0x00595959, 0x00141414, +0x006c6c6c, 0x00929292, 0x00545454, 0x00d0d0d0, 0x00787878, 0x00707070, 0x00e3e3e3, 0x00494949, +0x00808080, 0x00505050, 0x00a7a7a7, 0x00f6f6f6, 0x00777777, 0x00939393, 0x00868686, 0x00838383, +0x002a2a2a, 0x00c7c7c7, 0x005b5b5b, 0x00e9e9e9, 0x00eeeeee, 0x008f8f8f, 0x00010101, 0x003d3d3d, +}; + +static const ulong32 SP3033[] = { +0x38003838, 0x41004141, 0x16001616, 0x76007676, 0xd900d9d9, 0x93009393, 0x60006060, 0xf200f2f2, +0x72007272, 0xc200c2c2, 0xab00abab, 0x9a009a9a, 0x75007575, 0x06000606, 0x57005757, 0xa000a0a0, +0x91009191, 0xf700f7f7, 0xb500b5b5, 0xc900c9c9, 0xa200a2a2, 0x8c008c8c, 0xd200d2d2, 0x90009090, +0xf600f6f6, 0x07000707, 0xa700a7a7, 0x27002727, 0x8e008e8e, 0xb200b2b2, 0x49004949, 0xde00dede, +0x43004343, 0x5c005c5c, 0xd700d7d7, 0xc700c7c7, 0x3e003e3e, 0xf500f5f5, 0x8f008f8f, 0x67006767, +0x1f001f1f, 0x18001818, 0x6e006e6e, 0xaf00afaf, 0x2f002f2f, 0xe200e2e2, 0x85008585, 0x0d000d0d, +0x53005353, 0xf000f0f0, 0x9c009c9c, 0x65006565, 0xea00eaea, 0xa300a3a3, 0xae00aeae, 0x9e009e9e, +0xec00ecec, 0x80008080, 0x2d002d2d, 0x6b006b6b, 0xa800a8a8, 0x2b002b2b, 0x36003636, 0xa600a6a6, +0xc500c5c5, 0x86008686, 0x4d004d4d, 0x33003333, 0xfd00fdfd, 0x66006666, 0x58005858, 0x96009696, +0x3a003a3a, 0x09000909, 0x95009595, 0x10001010, 0x78007878, 0xd800d8d8, 0x42004242, 0xcc00cccc, +0xef00efef, 0x26002626, 0xe500e5e5, 0x61006161, 0x1a001a1a, 0x3f003f3f, 0x3b003b3b, 0x82008282, +0xb600b6b6, 0xdb00dbdb, 0xd400d4d4, 0x98009898, 0xe800e8e8, 0x8b008b8b, 0x02000202, 0xeb00ebeb, +0x0a000a0a, 0x2c002c2c, 0x1d001d1d, 0xb000b0b0, 0x6f006f6f, 0x8d008d8d, 0x88008888, 0x0e000e0e, +0x19001919, 0x87008787, 0x4e004e4e, 0x0b000b0b, 0xa900a9a9, 0x0c000c0c, 0x79007979, 0x11001111, +0x7f007f7f, 0x22002222, 0xe700e7e7, 0x59005959, 0xe100e1e1, 0xda00dada, 0x3d003d3d, 0xc800c8c8, +0x12001212, 0x04000404, 0x74007474, 0x54005454, 0x30003030, 0x7e007e7e, 0xb400b4b4, 0x28002828, +0x55005555, 0x68006868, 0x50005050, 0xbe00bebe, 0xd000d0d0, 0xc400c4c4, 0x31003131, 0xcb00cbcb, +0x2a002a2a, 0xad00adad, 0x0f000f0f, 0xca00caca, 0x70007070, 0xff00ffff, 0x32003232, 0x69006969, +0x08000808, 0x62006262, 0x00000000, 0x24002424, 0xd100d1d1, 0xfb00fbfb, 0xba00baba, 0xed00eded, +0x45004545, 0x81008181, 0x73007373, 0x6d006d6d, 0x84008484, 0x9f009f9f, 0xee00eeee, 0x4a004a4a, +0xc300c3c3, 0x2e002e2e, 0xc100c1c1, 0x01000101, 0xe600e6e6, 0x25002525, 0x48004848, 0x99009999, +0xb900b9b9, 0xb300b3b3, 0x7b007b7b, 0xf900f9f9, 0xce00cece, 0xbf00bfbf, 0xdf00dfdf, 0x71007171, +0x29002929, 0xcd00cdcd, 0x6c006c6c, 0x13001313, 0x64006464, 0x9b009b9b, 0x63006363, 0x9d009d9d, +0xc000c0c0, 0x4b004b4b, 0xb700b7b7, 0xa500a5a5, 0x89008989, 0x5f005f5f, 0xb100b1b1, 0x17001717, +0xf400f4f4, 0xbc00bcbc, 0xd300d3d3, 0x46004646, 0xcf00cfcf, 0x37003737, 0x5e005e5e, 0x47004747, +0x94009494, 0xfa00fafa, 0xfc00fcfc, 0x5b005b5b, 0x97009797, 0xfe00fefe, 0x5a005a5a, 0xac00acac, +0x3c003c3c, 0x4c004c4c, 0x03000303, 0x35003535, 0xf300f3f3, 0x23002323, 0xb800b8b8, 0x5d005d5d, +0x6a006a6a, 0x92009292, 0xd500d5d5, 0x21002121, 0x44004444, 0x51005151, 0xc600c6c6, 0x7d007d7d, +0x39003939, 0x83008383, 0xdc00dcdc, 0xaa00aaaa, 0x7c007c7c, 0x77007777, 0x56005656, 0x05000505, +0x1b001b1b, 0xa400a4a4, 0x15001515, 0x34003434, 0x1e001e1e, 0x1c001c1c, 0xf800f8f8, 0x52005252, +0x20002020, 0x14001414, 0xe900e9e9, 0xbd00bdbd, 0xdd00dddd, 0xe400e4e4, 0xa100a1a1, 0xe000e0e0, +0x8a008a8a, 0xf100f1f1, 0xd600d6d6, 0x7a007a7a, 0xbb00bbbb, 0xe300e3e3, 0x40004040, 0x4f004f4f, +}; + +static const ulong32 SP4404[] = { +0x70700070, 0x2c2c002c, 0xb3b300b3, 0xc0c000c0, 0xe4e400e4, 0x57570057, 0xeaea00ea, 0xaeae00ae, +0x23230023, 0x6b6b006b, 0x45450045, 0xa5a500a5, 0xeded00ed, 0x4f4f004f, 0x1d1d001d, 0x92920092, +0x86860086, 0xafaf00af, 0x7c7c007c, 0x1f1f001f, 0x3e3e003e, 0xdcdc00dc, 0x5e5e005e, 0x0b0b000b, +0xa6a600a6, 0x39390039, 0xd5d500d5, 0x5d5d005d, 0xd9d900d9, 0x5a5a005a, 0x51510051, 0x6c6c006c, +0x8b8b008b, 0x9a9a009a, 0xfbfb00fb, 0xb0b000b0, 0x74740074, 0x2b2b002b, 0xf0f000f0, 0x84840084, +0xdfdf00df, 0xcbcb00cb, 0x34340034, 0x76760076, 0x6d6d006d, 0xa9a900a9, 0xd1d100d1, 0x04040004, +0x14140014, 0x3a3a003a, 0xdede00de, 0x11110011, 0x32320032, 0x9c9c009c, 0x53530053, 0xf2f200f2, +0xfefe00fe, 0xcfcf00cf, 0xc3c300c3, 0x7a7a007a, 0x24240024, 0xe8e800e8, 0x60600060, 0x69690069, +0xaaaa00aa, 0xa0a000a0, 0xa1a100a1, 0x62620062, 0x54540054, 0x1e1e001e, 0xe0e000e0, 0x64640064, +0x10100010, 0x00000000, 0xa3a300a3, 0x75750075, 0x8a8a008a, 0xe6e600e6, 0x09090009, 0xdddd00dd, +0x87870087, 0x83830083, 0xcdcd00cd, 0x90900090, 0x73730073, 0xf6f600f6, 0x9d9d009d, 0xbfbf00bf, +0x52520052, 0xd8d800d8, 0xc8c800c8, 0xc6c600c6, 0x81810081, 0x6f6f006f, 0x13130013, 0x63630063, +0xe9e900e9, 0xa7a700a7, 0x9f9f009f, 0xbcbc00bc, 0x29290029, 0xf9f900f9, 0x2f2f002f, 0xb4b400b4, +0x78780078, 0x06060006, 0xe7e700e7, 0x71710071, 0xd4d400d4, 0xabab00ab, 0x88880088, 0x8d8d008d, +0x72720072, 0xb9b900b9, 0xf8f800f8, 0xacac00ac, 0x36360036, 0x2a2a002a, 0x3c3c003c, 0xf1f100f1, +0x40400040, 0xd3d300d3, 0xbbbb00bb, 0x43430043, 0x15150015, 0xadad00ad, 0x77770077, 0x80800080, +0x82820082, 0xecec00ec, 0x27270027, 0xe5e500e5, 0x85850085, 0x35350035, 0x0c0c000c, 0x41410041, +0xefef00ef, 0x93930093, 0x19190019, 0x21210021, 0x0e0e000e, 0x4e4e004e, 0x65650065, 0xbdbd00bd, +0xb8b800b8, 0x8f8f008f, 0xebeb00eb, 0xcece00ce, 0x30300030, 0x5f5f005f, 0xc5c500c5, 0x1a1a001a, +0xe1e100e1, 0xcaca00ca, 0x47470047, 0x3d3d003d, 0x01010001, 0xd6d600d6, 0x56560056, 0x4d4d004d, +0x0d0d000d, 0x66660066, 0xcccc00cc, 0x2d2d002d, 0x12120012, 0x20200020, 0xb1b100b1, 0x99990099, +0x4c4c004c, 0xc2c200c2, 0x7e7e007e, 0x05050005, 0xb7b700b7, 0x31310031, 0x17170017, 0xd7d700d7, +0x58580058, 0x61610061, 0x1b1b001b, 0x1c1c001c, 0x0f0f000f, 0x16160016, 0x18180018, 0x22220022, +0x44440044, 0xb2b200b2, 0xb5b500b5, 0x91910091, 0x08080008, 0xa8a800a8, 0xfcfc00fc, 0x50500050, +0xd0d000d0, 0x7d7d007d, 0x89890089, 0x97970097, 0x5b5b005b, 0x95950095, 0xffff00ff, 0xd2d200d2, +0xc4c400c4, 0x48480048, 0xf7f700f7, 0xdbdb00db, 0x03030003, 0xdada00da, 0x3f3f003f, 0x94940094, +0x5c5c005c, 0x02020002, 0x4a4a004a, 0x33330033, 0x67670067, 0xf3f300f3, 0x7f7f007f, 0xe2e200e2, +0x9b9b009b, 0x26260026, 0x37370037, 0x3b3b003b, 0x96960096, 0x4b4b004b, 0xbebe00be, 0x2e2e002e, +0x79790079, 0x8c8c008c, 0x6e6e006e, 0x8e8e008e, 0xf5f500f5, 0xb6b600b6, 0xfdfd00fd, 0x59590059, +0x98980098, 0x6a6a006a, 0x46460046, 0xbaba00ba, 0x25250025, 0x42420042, 0xa2a200a2, 0xfafa00fa, +0x07070007, 0x55550055, 0xeeee00ee, 0x0a0a000a, 0x49490049, 0x68680068, 0x38380038, 0xa4a400a4, +0x28280028, 0x7b7b007b, 0xc9c900c9, 0xc1c100c1, 0xe3e300e3, 0xf4f400f4, 0xc7c700c7, 0x9e9e009e, +}; + +static ulong64 key_sigma[] = { + CONST64(0xA09E667F3BCC908B), + CONST64(0xB67AE8584CAA73B2), + CONST64(0xC6EF372FE94F82BE), + CONST64(0x54FF53A5F1D36F1C), + CONST64(0x10E527FADE682D1D), + CONST64(0xB05688C2B3E6C1FD) +}; + +static ulong64 F(ulong64 x) +{ + ulong32 D, U; + +#define loc(i) ((8-i)*8) + + D = SP1110[(x >> loc(8)) & 0xFF] ^ SP0222[(x >> loc(5)) & 0xFF] ^ SP3033[(x >> loc(6)) & 0xFF] ^ SP4404[(x >> loc(7)) & 0xFF]; + U = SP1110[(x >> loc(1)) & 0xFF] ^ SP0222[(x >> loc(2)) & 0xFF] ^ SP3033[(x >> loc(3)) & 0xFF] ^ SP4404[(x >> loc(4)) & 0xFF]; + + D ^= U; + U = D ^ ROR(U, (const int)8); + + return ((ulong64)U) | (((ulong64)D) << 32ULL); +} + +static void rot_128(unsigned char *in, unsigned count, unsigned char *out) +{ + unsigned x, w, b; + + w = count >> 3; + b = count & 7; + + for (x = 0; x < 16; x++) { + out[x] = (in[(x+w)&15] << b) | (in[(x+w+1)&15] >> (8 - b)); + } +} + +int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) +{ + unsigned char T[48], kA[16], kB[16], kR[16], kL[16]; + int x; + ulong64 A, B; + +// LTC_ARGCHK(key != NULL); +// LTC_ARGCHK(skey != NULL); + + /* Valid sizes (in bytes) are 16, 24, 32 */ + if (keylen != 16 && keylen != 24 && keylen != 32) { + return CRYPT_INVALID_KEYSIZE; + } + + /* number of rounds */ + skey->camellia.R = (keylen == 16) ? 18 : 24; + + if (num_rounds != 0 && num_rounds != skey->camellia.R) { + return CRYPT_INVALID_ROUNDS; + } + + /* expand key */ + if (keylen == 16) { + for (x = 0; x < 16; x++) { + T[x] = key[x]; + T[x + 16] = 0; + } + } else if (keylen == 24) { + for (x = 0; x < 24; x++) { + T[x] = key[x]; + } + for (x = 24; x < 32; x++) { + T[x] = key[x-8] ^ 0xFF; + } + } else { + for (x = 0; x < 32; x++) { + T[x] = key[x]; + } + } + + for (x = 0; x < 16; x++) { + kL[x] = T[x]; + kR[x] = T[x + 16]; + } + + for (x = 32; x < 48; x++) { + T[x] = T[x - 32] ^ T[x - 16]; + } + + /* first two rounds */ + LOAD64H(A, T+32); LOAD64H(B, T+40); + B ^= F(A ^ key_sigma[0]); + A ^= F(B ^ key_sigma[1]); + STORE64H(A, T+32); STORE64H(B, T+40); + + /* xor kL in */ + for (x = 0; x < 16; x++) { T[x+32] ^= kL[x]; } + + /* next two rounds */ + LOAD64H(A, T+32); LOAD64H(B, T+40); + B ^= F(A ^ key_sigma[2]); + A ^= F(B ^ key_sigma[3]); + STORE64H(A, T+32); STORE64H(B, T+40); + + /* grab KA */ + for (x = 0; x < 16; x++) { kA[x] = T[x+32]; } + + /* xor kR in */ + for (x = 0; x < 16; x++) { T[x+32] ^= kR[x]; } + + if (keylen == 16) { + /* grab whitening keys kw1 and kw2 */ + LOAD64H(skey->camellia.kw[0], kL); + LOAD64H(skey->camellia.kw[1], kL+8); + + /* k1-k2 */ + LOAD64H(skey->camellia.k[0], kA); + LOAD64H(skey->camellia.k[1], kA+8); + + /* rotate kL by 15, k3/k4 */ + rot_128(kL, 15, T+32); + LOAD64H(skey->camellia.k[2], T+32); + LOAD64H(skey->camellia.k[3], T+40); + + /* rotate kA by 15, k5/k6 */ + rot_128(kA, 15, T+32); + LOAD64H(skey->camellia.k[4], T+32); + LOAD64H(skey->camellia.k[5], T+40); + + /* rotate kA by 30, kl1, kl2 */ + rot_128(kA, 30, T+32); + LOAD64H(skey->camellia.kl[0], T+32); + LOAD64H(skey->camellia.kl[1], T+40); + + /* rotate kL by 45, k7/k8 */ + rot_128(kL, 45, T+32); + LOAD64H(skey->camellia.k[6], T+32); + LOAD64H(skey->camellia.k[7], T+40); + + /* rotate kA by 45, k9/k10 */ + rot_128(kA, 45, T+32); + LOAD64H(skey->camellia.k[8], T+32); + rot_128(kL, 60, T+32); + LOAD64H(skey->camellia.k[9], T+40); + + /* rotate kA by 60, k11/k12 */ + rot_128(kA, 60, T+32); + LOAD64H(skey->camellia.k[10], T+32); + LOAD64H(skey->camellia.k[11], T+40); + + /* rotate kL by 77, kl3, kl4 */ + rot_128(kL, 77, T+32); + LOAD64H(skey->camellia.kl[2], T+32); + LOAD64H(skey->camellia.kl[3], T+40); + + /* rotate kL by 94, k13/k14 */ + rot_128(kL, 94, T+32); + LOAD64H(skey->camellia.k[12], T+32); + LOAD64H(skey->camellia.k[13], T+40); + + /* rotate kA by 94, k15/k16 */ + rot_128(kA, 94, T+32); + LOAD64H(skey->camellia.k[14], T+32); + LOAD64H(skey->camellia.k[15], T+40); + + /* rotate kL by 111, k17/k18 */ + rot_128(kL, 111, T+32); + LOAD64H(skey->camellia.k[16], T+32); + LOAD64H(skey->camellia.k[17], T+40); + + /* rotate kA by 111, kw3/kw4 */ + rot_128(kA, 111, T+32); + LOAD64H(skey->camellia.kw[2], T+32); + LOAD64H(skey->camellia.kw[3], T+40); + } else { + /* last two rounds */ + LOAD64H(A, T+32); LOAD64H(B, T+40); + B ^= F(A ^ key_sigma[4]); + A ^= F(B ^ key_sigma[5]); + STORE64H(A, T+32); STORE64H(B, T+40); + + /* grab kB */ + for (x = 0; x < 16; x++) { kB[x] = T[x+32]; } + + /* kw1/2 from kL*/ + LOAD64H(skey->camellia.kw[0], kL); + LOAD64H(skey->camellia.kw[1], kL+8); + + /* k1/k2 = kB */ + LOAD64H(skey->camellia.k[0], kB); + LOAD64H(skey->camellia.k[1], kB+8); + + /* k3/k4 = kR by 15 */ + rot_128(kR, 15, T+32); + LOAD64H(skey->camellia.k[2], T+32); + LOAD64H(skey->camellia.k[3], T+40); + + /* k5/k7 = kA by 15 */ + rot_128(kA, 15, T+32); + LOAD64H(skey->camellia.k[4], T+32); + LOAD64H(skey->camellia.k[5], T+40); + + /* kl1/2 = kR by 30 */ + rot_128(kR, 30, T+32); + LOAD64H(skey->camellia.kl[0], T+32); + LOAD64H(skey->camellia.kl[1], T+40); + + /* k7/k8 = kB by 30 */ + rot_128(kB, 30, T+32); + LOAD64H(skey->camellia.k[6], T+32); + LOAD64H(skey->camellia.k[7], T+40); + + /* k9/k10 = kL by 45 */ + rot_128(kL, 45, T+32); + LOAD64H(skey->camellia.k[8], T+32); + LOAD64H(skey->camellia.k[9], T+40); + + /* k11/k12 = kA by 45 */ + rot_128(kA, 45, T+32); + LOAD64H(skey->camellia.k[10], T+32); + LOAD64H(skey->camellia.k[11], T+40); + + /* kl3/4 = kL by 60 */ + rot_128(kL, 60, T+32); + LOAD64H(skey->camellia.kl[2], T+32); + LOAD64H(skey->camellia.kl[3], T+40); + + /* k13/k14 = kR by 60 */ + rot_128(kR, 60, T+32); + LOAD64H(skey->camellia.k[12], T+32); + LOAD64H(skey->camellia.k[13], T+40); + + /* k15/k16 = kB by 15 */ + rot_128(kB, 60, T+32); + LOAD64H(skey->camellia.k[14], T+32); + LOAD64H(skey->camellia.k[15], T+40); + + /* k17/k18 = kL by 77 */ + rot_128(kL, 77, T+32); + LOAD64H(skey->camellia.k[16], T+32); + LOAD64H(skey->camellia.k[17], T+40); + + /* kl5/6 = kA by 77 */ + rot_128(kA, 77, T+32); + LOAD64H(skey->camellia.kl[4], T+32); + LOAD64H(skey->camellia.kl[5], T+40); + + /* k19/k20 = kR by 94 */ + rot_128(kR, 94, T+32); + LOAD64H(skey->camellia.k[18], T+32); + LOAD64H(skey->camellia.k[19], T+40); + + /* k21/k22 = kA by 94 */ + rot_128(kA, 94, T+32); + LOAD64H(skey->camellia.k[20], T+32); + LOAD64H(skey->camellia.k[21], T+40); + + /* k23/k24 = kL by 111 */ + rot_128(kL, 111, T+32); + LOAD64H(skey->camellia.k[22], T+32); + LOAD64H(skey->camellia.k[23], T+40); + + /* kw2/kw3 = kB by 111 */ + rot_128(kB, 111, T+32); + LOAD64H(skey->camellia.kw[2], T+32); + LOAD64H(skey->camellia.kw[3], T+40); + } + + return CRYPT_OK; +} + +int camellia_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) +{ + ulong64 L, R; + ulong32 a, b; + + LOAD64H(L, pt+0); LOAD64H(R, pt+8); + L ^= skey->camellia.kw[0]; + R ^= skey->camellia.kw[1]; + + /* first 6 rounds */ + R ^= F(L ^ skey->camellia.k[0]); + L ^= F(R ^ skey->camellia.k[1]); + R ^= F(L ^ skey->camellia.k[2]); + L ^= F(R ^ skey->camellia.k[3]); + R ^= F(L ^ skey->camellia.k[4]); + L ^= F(R ^ skey->camellia.k[5]); + + /* FL */ + a = L >> 32; + b = L & 0xFFFFFFFFUL; + b ^= ROL((a & (skey->camellia.kl[0] >> 32)), 1); + a ^= b | (skey->camellia.kl[0] & 0xFFFFFFFFU); + L = (((ulong64)a) << 32) | b; + + /* FL^-1 */ + a = R >> 32; + b = R & 0xFFFFFFFFUL; + a ^= b | (skey->camellia.kl[1] & 0xFFFFFFFFU); + b ^= ROL((a & (skey->camellia.kl[1] >> 32)), 1); + R = (((ulong64)a) << 32) | b; + + /* second 6 rounds */ + R ^= F(L ^ skey->camellia.k[6]); + L ^= F(R ^ skey->camellia.k[7]); + R ^= F(L ^ skey->camellia.k[8]); + L ^= F(R ^ skey->camellia.k[9]); + R ^= F(L ^ skey->camellia.k[10]); + L ^= F(R ^ skey->camellia.k[11]); + + /* FL */ + a = L >> 32; + b = L & 0xFFFFFFFFUL; + b ^= ROL((a & (skey->camellia.kl[2] >> 32)), 1); + a ^= b | (skey->camellia.kl[2] & 0xFFFFFFFFU); + L = (((ulong64)a) << 32) | b; + + /* FL^-1 */ + a = R >> 32; + b = R & 0xFFFFFFFFUL; + a ^= b | (skey->camellia.kl[3] & 0xFFFFFFFFU); + b ^= ROL((a & (skey->camellia.kl[3] >> 32)), 1); + R = (((ulong64)a) << 32) | b; + + /* third 6 rounds */ + R ^= F(L ^ skey->camellia.k[12]); + L ^= F(R ^ skey->camellia.k[13]); + R ^= F(L ^ skey->camellia.k[14]); + L ^= F(R ^ skey->camellia.k[15]); + R ^= F(L ^ skey->camellia.k[16]); + L ^= F(R ^ skey->camellia.k[17]); + + /* next FL */ + if (skey->camellia.R == 24) { + /* FL */ + a = L >> 32; + b = L & 0xFFFFFFFFUL; + b ^= ROL((a & (skey->camellia.kl[4] >> 32)), 1); + a ^= b | (skey->camellia.kl[4] & 0xFFFFFFFFU); + L = (((ulong64)a) << 32) | b; + + /* FL^-1 */ + a = R >> 32; + b = R & 0xFFFFFFFFUL; + a ^= b | (skey->camellia.kl[5] & 0xFFFFFFFFU); + b ^= ROL((a & (skey->camellia.kl[5] >> 32)), 1); + R = (((ulong64)a) << 32) | b; + + /* fourth 6 rounds */ + R ^= F(L ^ skey->camellia.k[18]); + L ^= F(R ^ skey->camellia.k[19]); + R ^= F(L ^ skey->camellia.k[20]); + L ^= F(R ^ skey->camellia.k[21]); + R ^= F(L ^ skey->camellia.k[22]); + L ^= F(R ^ skey->camellia.k[23]); + } + + L ^= skey->camellia.kw[3]; + R ^= skey->camellia.kw[2]; + + STORE64H(R, ct+0); STORE64H(L, ct+8); + + return CRYPT_OK; +} + +int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) +{ + ulong64 L, R; + ulong32 a, b; + + LOAD64H(R, ct+0); LOAD64H(L, ct+8); + L ^= skey->camellia.kw[3]; + R ^= skey->camellia.kw[2]; + + /* next FL */ + if (skey->camellia.R == 24) { + /* fourth 6 rounds */ + L ^= F(R ^ skey->camellia.k[23]); + R ^= F(L ^ skey->camellia.k[22]); + L ^= F(R ^ skey->camellia.k[21]); + R ^= F(L ^ skey->camellia.k[20]); + L ^= F(R ^ skey->camellia.k[19]); + R ^= F(L ^ skey->camellia.k[18]); + + /* FL */ + a = L >> 32; + b = L & 0xFFFFFFFFUL; + a ^= b | (skey->camellia.kl[4] & 0xFFFFFFFFU); + b ^= ROL((a & (skey->camellia.kl[4] >> 32)), 1); + L = (((ulong64)a) << 32) | b; + + /* FL^-1 */ + a = R >> 32; + b = R & 0xFFFFFFFFUL; + b ^= ROL((a & (skey->camellia.kl[5] >> 32)), 1); + a ^= b | (skey->camellia.kl[5] & 0xFFFFFFFFU); + R = (((ulong64)a) << 32) | b; + + } + + /* third 6 rounds */ + L ^= F(R ^ skey->camellia.k[17]); + R ^= F(L ^ skey->camellia.k[16]); + L ^= F(R ^ skey->camellia.k[15]); + R ^= F(L ^ skey->camellia.k[14]); + L ^= F(R ^ skey->camellia.k[13]); + R ^= F(L ^ skey->camellia.k[12]); + + /* FL */ + a = L >> 32; + b = L & 0xFFFFFFFFUL; + a ^= b | (skey->camellia.kl[2] & 0xFFFFFFFFU); + b ^= ROL((a & (skey->camellia.kl[2] >> 32)), 1); + L = (((ulong64)a) << 32) | b; + + /* FL^-1 */ + a = R >> 32; + b = R & 0xFFFFFFFFUL; + b ^= ROL((a & (skey->camellia.kl[3] >> 32)), 1); + a ^= b | (skey->camellia.kl[3] & 0xFFFFFFFFU); + R = (((ulong64)a) << 32) | b; + + /* second 6 rounds */ + L ^= F(R ^ skey->camellia.k[11]); + R ^= F(L ^ skey->camellia.k[10]); + L ^= F(R ^ skey->camellia.k[9]); + R ^= F(L ^ skey->camellia.k[8]); + L ^= F(R ^ skey->camellia.k[7]); + R ^= F(L ^ skey->camellia.k[6]); + + /* FL */ + a = L >> 32; + b = L & 0xFFFFFFFFUL; + a ^= b | (skey->camellia.kl[0] & 0xFFFFFFFFU); + b ^= ROL((a & (skey->camellia.kl[0] >> 32)), 1); + L = (((ulong64)a) << 32) | b; + + /* FL^-1 */ + a = R >> 32; + b = R & 0xFFFFFFFFUL; + b ^= ROL((a & (skey->camellia.kl[1] >> 32)), 1); + a ^= b | (skey->camellia.kl[1] & 0xFFFFFFFFU); + R = (((ulong64)a) << 32) | b; + + /* first 6 rounds */ + L ^= F(R ^ skey->camellia.k[5]); + R ^= F(L ^ skey->camellia.k[4]); + L ^= F(R ^ skey->camellia.k[3]); + R ^= F(L ^ skey->camellia.k[2]); + L ^= F(R ^ skey->camellia.k[1]); + R ^= F(L ^ skey->camellia.k[0]); + + L ^= skey->camellia.kw[1]; + R ^= skey->camellia.kw[0]; + + STORE64H(R, pt+0); STORE64H(L, pt+8); + + return CRYPT_OK; +} + +int camellia_test(void) +{ + static const struct { + int keylen; + unsigned char key[32], pt[16], ct[16]; + } tests[] = { + +{ + 16, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, + { 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73, + 0x08, 0x57, 0x06, 0x56, 0x48, 0xea, 0xbe, 0x43 } +}, + +{ + 24, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, + 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, + { 0xb4, 0x99, 0x34, 0x01, 0xb3, 0xe9, 0x96, 0xf8, + 0x4e, 0xe5, 0xce, 0xe7, 0xd7, 0x9b, 0x09, 0xb9 } +}, + + +{ + 32, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, + 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, + { 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c, + 0x20, 0xef, 0x7c, 0x91, 0x9e, 0x3a, 0x75, 0x09 } +} +}; + unsigned char buf[2][16]; + symmetric_key skey; + int err, x; + + for (x = 0; x < 3; x++) { + if ((err = camellia_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { + return err; + } + if ((err = camellia_ecb_encrypt(tests[x].pt, buf[0], &skey)) != CRYPT_OK) { + camellia_done(&skey); + return err; + } + if ((err = camellia_ecb_decrypt(tests[x].ct, buf[1], &skey)) != CRYPT_OK) { + camellia_done(&skey); + return err; + } + camellia_done(&skey); + if (XMEMCMP(tests[x].ct, buf[0], 16) || XMEMCMP(tests[x].pt, buf[1], 16)) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; +} + +void camellia_done(symmetric_key *skey) {} + +int camellia_keysize(int *keysize) +{ + if (*keysize > 32) { *keysize = 32; } + else if (*keysize > 24) { *keysize = 24; } + else if (*keysize > 16) { *keysize = 16; } + else return CRYPT_INVALID_KEYSIZE; + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/ciphers/camellia.c,v $ */ +/* $Revision: 1.1 $ */ +/* $Date: 2007/06/20 13:14:52 $ */ diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c new file mode 100644 index 000000000..90518a4ad --- /dev/null +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -0,0 +1,383 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file ccm_memory.c + CCM support, process a block of memory, Tom St Denis +*/ + +#ifdef CCM_MODE + +/** + CCM encrypt/decrypt and produce an authentication tag + @param cipher The index of the cipher desired + @param key The secret key to use + @param keylen The length of the secret key (octets) + @param uskey A previously scheduled key [optional can be NULL] + @param nonce The session nonce [use once] + @param noncelen The length of the nonce + @param header The header for the session + @param headerlen The length of the header (octets) + @param pt [out] The plaintext + @param ptlen The length of the plaintext (octets) + @param ct [out] The ciphertext + @param tag [out] The destination tag + @param taglen [in/out] The max size and resulting size of the authentication tag + @param direction Encrypt or Decrypt direction (0 or 1) + @return CRYPT_OK if successful +*/ +int ccm_memory_ex(int cipher, + const unsigned char *key, unsigned long keylen, + symmetric_key *uskey, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *header, unsigned long headerlen, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen, + int direction, + const unsigned char *B0, + const unsigned char *CTR, + int ctrwidth) +{ + unsigned char PAD[16], ctr[16], CTRPAD[16], ctrcopy[16], b; + symmetric_key *skey; + int err; + unsigned long len, L, x, y, z, CTRlen; + + if (uskey == NULL) { + LTC_ARGCHK(key != NULL); + } + LTC_ARGCHK(nonce != NULL); + if (headerlen > 0) { + LTC_ARGCHK(header != NULL); + } + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(tag != NULL); + LTC_ARGCHK(taglen != NULL); + +#ifdef LTC_FAST + if (16 % sizeof(LTC_FAST_TYPE)) { + return CRYPT_INVALID_ARG; + } +#endif + + /* check cipher input */ + if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { + return err; + } + if (cipher_descriptor[cipher].block_length != 16) { + return CRYPT_INVALID_CIPHER; + } + + /* make sure the taglen is even and <= 16 */ + *taglen &= ~1; + if (*taglen > 16) { + *taglen = 16; + } + + /* can't use < 4 */ + if (*taglen < 4) { + return CRYPT_INVALID_ARG; + } + + /* is there an accelerator? */ + if (cipher_descriptor[cipher].accel_ccm_memory != NULL) { + return cipher_descriptor[cipher].accel_ccm_memory( + key, keylen, + uskey, + nonce, noncelen, + header, headerlen, + pt, ptlen, + ct, + tag, taglen, + direction); + } + + /* let's get the L value */ + len = ptlen; + L = 0; + while (len) { + ++L; + len >>= 8; + } + if (L <= 1) { + L = 2; + } + + /* increase L to match the nonce len */ + noncelen = (noncelen > 13) ? 13 : noncelen; + if ((15 - noncelen) > L) { + L = 15 - noncelen; + } + + /* decrease noncelen to match L */ + if ((noncelen + L) > 15) { + noncelen = 15 - L; + } + + /* allocate mem for the symmetric key */ + if (uskey == NULL) { + skey = XMALLOC(sizeof(*skey)); + if (skey == NULL) { + return CRYPT_MEM; + } + + /* initialize the cipher */ + if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, skey)) != CRYPT_OK) { + XFREE(skey); + return err; + } + } else { + skey = uskey; + } + + /* form B_0 == flags | Nonce N | l(m) */ + x = 0; + +if (B0 == NULL) { + PAD[x++] = (unsigned char)(((headerlen > 0) ? (1<<6) : 0) | + (((*taglen - 2)>>1)<<3) | + (L-1)); + + /* nonce */ + for (y = 0; y < (16 - (L + 1)); y++) { + PAD[x++] = nonce[y]; + } + + /* store len */ + len = ptlen; + + /* shift len so the upper bytes of len are the contents of the length */ + for (y = L; y < 4; y++) { + len <<= 8; + } + + /* store l(m) (only store 32-bits) */ + for (y = 0; L > 4 && (L-y)>4; y++) { + PAD[x++] = 0; + } + for (; y < L; y++) { + PAD[x++] = (unsigned char)((len >> 24) & 255); + len <<= 8; + } + +} else { + // B0 != NULL + XMEMCPY(PAD, B0, 16); +} + + /* encrypt PAD */ + if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { + goto error; + } + + /* handle header */ + if (headerlen > 0) { + x = 0; + +#if 0 + /* store length */ + if (headerlen < ((1UL<<16) - (1UL<<8))) { + PAD[x++] ^= (headerlen>>8) & 255; + PAD[x++] ^= headerlen & 255; + } else { + PAD[x++] ^= 0xFF; + PAD[x++] ^= 0xFE; + PAD[x++] ^= (headerlen>>24) & 255; + PAD[x++] ^= (headerlen>>16) & 255; + PAD[x++] ^= (headerlen>>8) & 255; + PAD[x++] ^= headerlen & 255; + } +#endif + + /* now add the data */ + for (y = 0; y < headerlen; y++) { + if (x == 16) { + /* full block so let's encrypt it */ + if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { + goto error; + } + x = 0; + } + PAD[x++] ^= header[y]; + } + + /* remainder? */ + if (x != 0) { + if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { + goto error; + } + } + } + + /* setup the ctr counter */ +if (CTR == NULL) { + x = 0; + + /* flags */ + ctr[x++] = (unsigned char)L-1; + + /* nonce */ + for (y = 0; y < (16 - (L+1)); ++y) { + ctr[x++] = nonce[y]; + } + /* offset */ + while (x < 16) { + ctr[x++] = 0; + } +} else { + XMEMCPY(ctr, CTR, 16); +} + + x = 0; + CTRlen = 16; + + /* now handle the PT */ + if (ptlen > 0) { + y = 0; +#ifdef LTC_FAST2 + if (ptlen & ~15) { + if (direction == CCM_ENCRYPT) { + for (; y < (ptlen & ~15); y += 16) { + /* increment the ctr? */ + for (z = 15; z > 15-ctrwidth; z--) { + ctr[z] = (ctr[z] + 1) & 255; + if (ctr[z]) break; + } + if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { + goto error; + } + + /* xor the PT against the pad first */ + for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { + *((LTC_FAST_TYPE*)(&PAD[z])) ^= *((LTC_FAST_TYPE*)(&pt[y+z])); + *((LTC_FAST_TYPE*)(&ct[y+z])) = *((LTC_FAST_TYPE*)(&pt[y+z])) ^ *((LTC_FAST_TYPE*)(&CTRPAD[z])); + } + if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { + goto error; + } + } + } else { + for (; y < (ptlen & ~15); y += 16) { + /* increment the ctr? */ + for (z = 15; z > 15-ctrwidth; z--) { + ctr[z] = (ctr[z] + 1) & 255; + if (ctr[z]) break; + } + if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { + goto error; + } + + /* xor the PT against the pad last */ + for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { + *((LTC_FAST_TYPE*)(&pt[y+z])) = *((LTC_FAST_TYPE*)(&ct[y+z])) ^ *((LTC_FAST_TYPE*)(&CTRPAD[z])); + *((LTC_FAST_TYPE*)(&PAD[z])) ^= *((LTC_FAST_TYPE*)(&pt[y+z])); + } + if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { + goto error; + } + } + } + } +#endif + + for (; y < ptlen; y++) { + /* increment the ctr? */ + if (CTRlen == 16) { + for (z = 15; z > 15-ctrwidth; z--) { + ctr[z] = (ctr[z] + 1) & 255; + if (ctr[z]) break; + } + if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { + goto error; + } + CTRlen = 0; + } + + /* if we encrypt we add the bytes to the MAC first */ + if (direction == CCM_ENCRYPT) { + b = pt[y]; + ct[y] = b ^ CTRPAD[CTRlen++]; + } else { + b = ct[y] ^ CTRPAD[CTRlen++]; + pt[y] = b; + } + + if (x == 16) { + if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { + goto error; + } + x = 0; + } + PAD[x++] ^= b; + } + + if (x != 0) { + if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { + goto error; + } + } + } + +// grab the CTR +memcpy(ctrcopy, ctr, 16); + + /* setup CTR for the TAG (zero the count) */ +if (CTR == NULL) { + for (y = 15; y > 15 - L; y--) { + ctr[y] = 0x00; + } +} else { + XMEMCPY(ctr, CTR, 16); +} + + if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { + goto error; + } + + if (skey != uskey) { + cipher_descriptor[cipher].done(skey); + } + + /* store the TAG */ + for (x = 0; x < 16 && x < *taglen; x++) { + tag[x] = PAD[x] ^ CTRPAD[x]; + } + *taglen = x; + +if (CTR != NULL) { + for (z = 15; z > 15-ctrwidth; z--) { + ctrcopy[z] = (ctrcopy[z] + 1) & 255; + if (ctrcopy[z]) break; + } + memcpy(CTR, ctrcopy, 16); +} + +#ifdef LTC_CLEAN_STACK + zeromem(skey, sizeof(*skey)); + zeromem(PAD, sizeof(PAD)); + zeromem(CTRPAD, sizeof(CTRPAD)); +#endif +error: + if (skey != uskey) { + XFREE(skey); + } + + return err; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/encauth/ccm/ccm_memory.c,v $ */ +/* $Revision: 1.19 $ */ +/* $Date: 2006/12/28 01:27:23 $ */ diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index f23fd977c..398c734f7 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -138,6 +138,13 @@ struct multi2_key { }; #endif +#ifdef LTC_CAMELLIA +struct camellia_key { + int R; + ulong64 kw[4], k[24], kl[6]; +}; +#endif + typedef union Symmetric_key { #ifdef LTC_DES struct des_key des; @@ -193,6 +200,9 @@ typedef union Symmetric_key { #endif #ifdef LTC_MULTI2 struct multi2_key multi2; +#endif +#ifdef LTC_CAMELLIA + struct camellia_key camellia; #endif void *data; } symmetric_key; @@ -756,6 +766,16 @@ int multi2_keysize(int *keysize); extern const struct ltc_cipher_descriptor multi2_desc; #endif +#ifdef LTC_CAMELLIA +int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int camellia_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int camellia_test(void); +void camellia_done(symmetric_key *skey); +int camellia_keysize(int *keysize); +extern const struct ltc_cipher_descriptor camellia_desc; +#endif + #ifdef LTC_ECB_MODE int ecb_start(int cipher, const unsigned char *key, int keylen, int num_rounds, symmetric_ECB *ecb); diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 0243c6ce1..d1e140d80 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -156,6 +156,8 @@ #define LTC_ANUBIS_TWEAK #define LTC_KSEED #define LTC_KASUMI +#define LTC_MULTI2 +#define LTC_CAMELLIA #endif /* LTC_NO_CIPHERS */ diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index d030d734b..97686cebb 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -208,6 +208,19 @@ int ccm_memory(int cipher, unsigned char *tag, unsigned long *taglen, int direction); +int ccm_memory_ex(int cipher, + const unsigned char *key, unsigned long keylen, + symmetric_key *uskey, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *header, unsigned long headerlen, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen, + int direction, + const unsigned char *B0, + const unsigned char *CTR, + int ctrwidth); + int ccm_test(void); #endif /* LTC_CCM_MODE */ diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 3d485727c..129839796 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -116,6 +116,12 @@ const char *crypt_build_settings = #if defined(LTC_KASUMI) " KASUMI\n" #endif +#if defined(LTC_MULTI2) + " MULTI2\n" +#endif +#if defined(LTC_CAMELLIA) + " Camellia\n" +#endif "\nHashes built-in:\n" #if defined(LTC_SHA512) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index a9a898598..aa25d33e7 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -182,6 +182,9 @@ void reg_algs(void) #ifdef LTC_MULTI2 register_cipher (&multi2_desc); #endif +#ifdef LTC_CAMELLIA + register_cipher (&camellia_desc); +#endif #ifdef LTC_TIGER register_hash (&tiger_desc); From fcd5faf9471c5ec7d713f3291402cee57823e372 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 Oct 2009 11:55:13 +0200 Subject: [PATCH 0002/1192] added gitignore to suppress .o and .a files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..418bd3d41 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# suppress compiler/linker output +*.[oa] From 6816ac3f3fae776adb1372dbffd0441062006109 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 Oct 2009 11:58:04 +0200 Subject: [PATCH 0003/1192] modification to suppress compiler warning when LTC_FAST is not defined --- src/mac/omac/omac_process.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/mac/omac/omac_process.c b/src/mac/omac/omac_process.c index a70b179b5..9d0eb26ce 100644 --- a/src/mac/omac/omac_process.c +++ b/src/mac/omac/omac_process.c @@ -27,7 +27,7 @@ */ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen) { - unsigned long n, x, blklen; + unsigned long n, x; int err; LTC_ARGCHK(omac != NULL); @@ -42,20 +42,24 @@ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen) } #ifdef LTC_FAST - blklen = cipher_descriptor[omac->cipher_idx].block_length; - if (omac->buflen == 0 && inlen > blklen) { - unsigned long y; - for (x = 0; x < (inlen - blklen); x += blklen) { - for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y])); + { + unsigned long blklen; + + blklen = cipher_descriptor[omac->cipher_idx].block_length; + if (omac->buflen == 0 && inlen > blklen) { + unsigned long y; + for (x = 0; x < (inlen - blklen); x += blklen) { + for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) { + *((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y])); + } + in += blklen; + if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) { + return err; + } } - in += blklen; - if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) { - return err; - } - } - inlen -= x; - } + inlen -= x; + } + } #endif while (inlen != 0) { From 0a432b6b08d046dd96d09a77fd83135f0550a799 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 Oct 2009 12:24:45 +0200 Subject: [PATCH 0004/1192] adjusted file dependant functions when LTC_NO_FILE is defined, the functions hash_filehandle() and hash_file() won't be available at all instead of returning CRYPT_NOP --- src/hashes/helper/hash_file.c | 6 ++---- src/hashes/helper/hash_filehandle.c | 6 ++---- src/headers/tomcrypt_hash.h | 3 +++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/hashes/helper/hash_file.c b/src/hashes/helper/hash_file.c index c9714a058..4c184d830 100644 --- a/src/hashes/helper/hash_file.c +++ b/src/hashes/helper/hash_file.c @@ -10,6 +10,7 @@ */ #include "tomcrypt.h" +#ifndef LTC_NO_FILE /** @file hash_file.c Hash a file, Tom St Denis @@ -24,9 +25,6 @@ */ int hash_file(int hash, const char *fname, unsigned char *out, unsigned long *outlen) { -#ifdef LTC_NO_FILE - return CRYPT_NOP; -#else FILE *in; int err; LTC_ARGCHK(fname != NULL); @@ -48,8 +46,8 @@ int hash_file(int hash, const char *fname, unsigned char *out, unsigned long *ou } return err; -#endif } +#endif /* #ifndef LTC_NO_FILE */ /* $Source$ */ diff --git a/src/hashes/helper/hash_filehandle.c b/src/hashes/helper/hash_filehandle.c index 3eb6f0ce4..6a6052f72 100644 --- a/src/hashes/helper/hash_filehandle.c +++ b/src/hashes/helper/hash_filehandle.c @@ -10,6 +10,7 @@ */ #include "tomcrypt.h" +#ifndef LTC_NO_FILE /** @file hash_filehandle.c Hash open files, Tom St Denis @@ -25,9 +26,6 @@ */ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outlen) { -#ifdef LTC_NO_FILE - return CRYPT_NOP; -#else hash_state md; unsigned char buf[512]; size_t x; @@ -62,8 +60,8 @@ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outle zeromem(buf, sizeof(buf)); #endif return err; -#endif } +#endif /* #ifndef LTC_NO_FILE */ /* $Source$ */ diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 56b272ad9..a29a69f5a 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -334,8 +334,11 @@ int hash_memory(int hash, unsigned char *out, unsigned long *outlen); int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...); + +#ifndef LTC_NO_FILE int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outlen); int hash_file(int hash, const char *fname, unsigned char *out, unsigned long *outlen); +#endif /* a simple macro for making hash "process" functions */ #define HASH_PROCESS(func_name, compress_name, state_var, block_size) \ From 3522c754aab9db6c155844122710708604c6ce96 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 Oct 2009 14:00:58 +0200 Subject: [PATCH 0005/1192] changed LTC_LTC_PKCS_1_* enum members to LTC_PKCS_1_* --- src/headers/tomcrypt_pk.h | 8 ++++---- src/headers/tomcrypt_pkcs.h | 10 +++++----- src/pk/pkcs1/pkcs_1_v1_5_decode.c | 2 +- src/pk/pkcs1/pkcs_1_v1_5_encode.c | 12 ++++++------ src/pk/rsa/rsa_decrypt_key.c | 12 ++++++------ src/pk/rsa/rsa_encrypt_key.c | 12 ++++++------ src/pk/rsa/rsa_sign_hash.c | 10 +++++----- src/pk/rsa/rsa_verify_hash.c | 12 ++++++------ testprof/rsa_test.c | 10 +++++----- 9 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index cc05f6cb2..33d8f024b 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -46,16 +46,16 @@ void rsa_free(rsa_key *key); /* These use LTC_PKCS #1 v2.0 padding */ #define rsa_encrypt_key(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _prng, _prng_idx, _hash_idx, _key) \ - rsa_encrypt_key_ex(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _prng, _prng_idx, _hash_idx, LTC_LTC_PKCS_1_OAEP, _key) + rsa_encrypt_key_ex(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _prng, _prng_idx, _hash_idx, LTC_PKCS_1_OAEP, _key) #define rsa_decrypt_key(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _hash_idx, _stat, _key) \ - rsa_decrypt_key_ex(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _hash_idx, LTC_LTC_PKCS_1_OAEP, _stat, _key) + rsa_decrypt_key_ex(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _hash_idx, LTC_PKCS_1_OAEP, _stat, _key) #define rsa_sign_hash(_in, _inlen, _out, _outlen, _prng, _prng_idx, _hash_idx, _saltlen, _key) \ - rsa_sign_hash_ex(_in, _inlen, _out, _outlen, LTC_LTC_PKCS_1_PSS, _prng, _prng_idx, _hash_idx, _saltlen, _key) + rsa_sign_hash_ex(_in, _inlen, _out, _outlen, LTC_PKCS_1_PSS, _prng, _prng_idx, _hash_idx, _saltlen, _key) #define rsa_verify_hash(_sig, _siglen, _hash, _hashlen, _hash_idx, _saltlen, _stat, _key) \ - rsa_verify_hash_ex(_sig, _siglen, _hash, _hashlen, LTC_LTC_PKCS_1_PSS, _hash_idx, _saltlen, _stat, _key) + rsa_verify_hash_ex(_sig, _siglen, _hash, _hashlen, LTC_PKCS_1_PSS, _hash_idx, _saltlen, _stat, _key) /* These can be switched between LTC_PKCS #1 v2.x and LTC_PKCS #1 v1.5 paddings */ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index 8c8c7e438..a39eeebd3 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -5,15 +5,15 @@ enum ltc_pkcs_1_v1_5_blocks { - LTC_LTC_PKCS_1_EMSA = 1, /* Block type 1 (LTC_PKCS #1 v1.5 signature padding) */ - LTC_LTC_PKCS_1_EME = 2 /* Block type 2 (LTC_PKCS #1 v1.5 encryption padding) */ + LTC_PKCS_1_EMSA = 1, /* Block type 1 (LTC_PKCS #1 v1.5 signature padding) */ + LTC_PKCS_1_EME = 2 /* Block type 2 (LTC_PKCS #1 v1.5 encryption padding) */ }; enum ltc_pkcs_1_paddings { - LTC_LTC_PKCS_1_V1_5 = 1, /* LTC_PKCS #1 v1.5 padding (\sa ltc_pkcs_1_v1_5_blocks) */ - LTC_LTC_PKCS_1_OAEP = 2, /* LTC_PKCS #1 v2.0 encryption padding */ - LTC_LTC_PKCS_1_PSS = 3 /* LTC_PKCS #1 v2.1 signature padding */ + LTC_PKCS_1_V1_5 = 1, /* LTC_PKCS #1 v1.5 padding (\sa ltc_pkcs_1_v1_5_blocks) */ + LTC_PKCS_1_OAEP = 2, /* LTC_PKCS #1 v2.0 encryption padding */ + LTC_PKCS_1_PSS = 3 /* LTC_PKCS #1 v2.1 signature padding */ }; int pkcs_1_mgf1( int hash_idx, diff --git a/src/pk/pkcs1/pkcs_1_v1_5_decode.c b/src/pk/pkcs1/pkcs_1_v1_5_decode.c index 83456017d..2e7bf0c47 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_decode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_decode.c @@ -58,7 +58,7 @@ int pkcs_1_v1_5_decode(const unsigned char *msg, goto bail; } - if (block_type == LTC_LTC_PKCS_1_EME) { + if (block_type == LTC_PKCS_1_EME) { for (i = 2; i < modulus_len; i++) { /* separator */ if (msg[i] == 0x00) { break; } diff --git a/src/pk/pkcs1/pkcs_1_v1_5_encode.c b/src/pk/pkcs1/pkcs_1_v1_5_encode.c index 1c3506966..9917167bf 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_encode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_encode.c @@ -23,8 +23,8 @@ * \param msglen The length of the data to encode (octets) * \param block_type Block type to use in padding (\sa ltc_pkcs_1_v1_5_blocks) * \param modulus_bitlen The bit length of the RSA modulus - * \param prng An active PRNG state (only for LTC_LTC_PKCS_1_EME) - * \param prng_idx The index of the PRNG desired (only for LTC_LTC_PKCS_1_EME) + * \param prng An active PRNG state (only for LTC_PKCS_1_EME) + * \param prng_idx The index of the PRNG desired (only for LTC_PKCS_1_EME) * \param out [out] The destination for the encoded data * \param outlen [in/out] The max size and resulting size of the encoded data * @@ -44,12 +44,12 @@ int pkcs_1_v1_5_encode(const unsigned char *msg, int result; /* valid block_type? */ - if ((block_type != LTC_LTC_PKCS_1_EMSA) && - (block_type != LTC_LTC_PKCS_1_EME)) { + if ((block_type != LTC_PKCS_1_EMSA) && + (block_type != LTC_PKCS_1_EME)) { return CRYPT_PK_INVALID_PADDING; } - if (block_type == LTC_LTC_PKCS_1_EME) { /* encryption padding, we need a valid PRNG */ + if (block_type == LTC_PKCS_1_EME) { /* encryption padding, we need a valid PRNG */ if ((result = prng_is_valid(prng_idx)) != CRYPT_OK) { return result; } @@ -72,7 +72,7 @@ int pkcs_1_v1_5_encode(const unsigned char *msg, ps = &out[2]; ps_len = modulus_len - msglen - 3; - if (block_type == LTC_LTC_PKCS_1_EME) { + if (block_type == LTC_PKCS_1_EME) { /* now choose a random ps */ if (prng_descriptor[prng_idx].read(ps, ps_len, prng) != ps_len) { result = CRYPT_ERROR_READPRNG; diff --git a/src/pk/rsa/rsa_decrypt_key.c b/src/pk/rsa/rsa_decrypt_key.c index 31d841fe5..10f1c227b 100644 --- a/src/pk/rsa/rsa_decrypt_key.c +++ b/src/pk/rsa/rsa_decrypt_key.c @@ -26,7 +26,7 @@ @param lparam The system "lparam" value @param lparamlen The length of the lparam value (octets) @param hash_idx The index of the hash desired - @param padding Type of padding (LTC_LTC_PKCS_1_OAEP or LTC_LTC_PKCS_1_V1_5) + @param padding Type of padding (LTC_PKCS_1_OAEP or LTC_PKCS_1_V1_5) @param stat [out] Result of the decryption, 1==valid, 0==invalid @param key The corresponding private RSA key @return CRYPT_OK if succcessul (even if invalid) @@ -51,12 +51,12 @@ int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen, /* valid padding? */ - if ((padding != LTC_LTC_PKCS_1_V1_5) && - (padding != LTC_LTC_PKCS_1_OAEP)) { + if ((padding != LTC_PKCS_1_V1_5) && + (padding != LTC_PKCS_1_OAEP)) { return CRYPT_PK_INVALID_PADDING; } - if (padding == LTC_LTC_PKCS_1_OAEP) { + if (padding == LTC_PKCS_1_OAEP) { /* valid hash ? */ if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; @@ -85,13 +85,13 @@ int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen, return err; } - if (padding == LTC_LTC_PKCS_1_OAEP) { + if (padding == LTC_PKCS_1_OAEP) { /* now OAEP decode the packet */ err = pkcs_1_oaep_decode(tmp, x, lparam, lparamlen, modulus_bitlen, hash_idx, out, outlen, stat); } else { /* now LTC_PKCS #1 v1.5 depad the packet */ - err = pkcs_1_v1_5_decode(tmp, x, LTC_LTC_PKCS_1_EME, modulus_bitlen, out, outlen, stat); + err = pkcs_1_v1_5_decode(tmp, x, LTC_PKCS_1_EME, modulus_bitlen, out, outlen, stat); } XFREE(tmp); diff --git a/src/pk/rsa/rsa_encrypt_key.c b/src/pk/rsa/rsa_encrypt_key.c index edb7e6567..027a5f281 100644 --- a/src/pk/rsa/rsa_encrypt_key.c +++ b/src/pk/rsa/rsa_encrypt_key.c @@ -28,7 +28,7 @@ @param prng An active PRNG @param prng_idx The index of the desired prng @param hash_idx The index of the desired hash - @param padding Type of padding (LTC_LTC_PKCS_1_OAEP or LTC_LTC_PKCS_1_V1_5) + @param padding Type of padding (LTC_PKCS_1_OAEP or LTC_PKCS_1_V1_5) @param key The RSA key to encrypt to @return CRYPT_OK if successful */ @@ -46,8 +46,8 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, LTC_ARGCHK(key != NULL); /* valid padding? */ - if ((padding != LTC_LTC_PKCS_1_V1_5) && - (padding != LTC_LTC_PKCS_1_OAEP)) { + if ((padding != LTC_PKCS_1_V1_5) && + (padding != LTC_PKCS_1_OAEP)) { return CRYPT_PK_INVALID_PADDING; } @@ -56,7 +56,7 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, return err; } - if (padding == LTC_LTC_PKCS_1_OAEP) { + if (padding == LTC_PKCS_1_OAEP) { /* valid hash? */ if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; @@ -73,7 +73,7 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, return CRYPT_BUFFER_OVERFLOW; } - if (padding == LTC_LTC_PKCS_1_OAEP) { + if (padding == LTC_PKCS_1_OAEP) { /* OAEP pad the key */ x = *outlen; if ((err = pkcs_1_oaep_encode(in, inlen, lparam, @@ -84,7 +84,7 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, } else { /* LTC_PKCS #1 v1.5 pad the key */ x = *outlen; - if ((err = pkcs_1_v1_5_encode(in, inlen, LTC_LTC_PKCS_1_EME, + if ((err = pkcs_1_v1_5_encode(in, inlen, LTC_PKCS_1_EME, modulus_bitlen, prng, prng_idx, out, &x)) != CRYPT_OK) { return err; diff --git a/src/pk/rsa/rsa_sign_hash.c b/src/pk/rsa/rsa_sign_hash.c index 3b64095a3..5e0398163 100644 --- a/src/pk/rsa/rsa_sign_hash.c +++ b/src/pk/rsa/rsa_sign_hash.c @@ -23,7 +23,7 @@ @param inlen The length of the hash to sign (octets) @param out [out] The signature @param outlen [in/out] The max size and resulting size of the signature - @param padding Type of padding (LTC_LTC_PKCS_1_PSS or LTC_LTC_PKCS_1_V1_5) + @param padding Type of padding (LTC_PKCS_1_PSS or LTC_PKCS_1_V1_5) @param prng An active PRNG state @param prng_idx The index of the PRNG desired @param hash_idx The index of the hash desired @@ -47,11 +47,11 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, LTC_ARGCHK(key != NULL); /* valid padding? */ - if ((padding != LTC_LTC_PKCS_1_V1_5) && (padding != LTC_LTC_PKCS_1_PSS)) { + if ((padding != LTC_PKCS_1_V1_5) && (padding != LTC_PKCS_1_PSS)) { return CRYPT_PK_INVALID_PADDING; } - if (padding == LTC_LTC_PKCS_1_PSS) { + if (padding == LTC_PKCS_1_PSS) { /* valid prng and hash ? */ if ((err = prng_is_valid(prng_idx)) != CRYPT_OK) { return err; @@ -71,7 +71,7 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, return CRYPT_BUFFER_OVERFLOW; } - if (padding == LTC_LTC_PKCS_1_PSS) { + if (padding == LTC_PKCS_1_PSS) { /* PSS pad the key */ x = *outlen; if ((err = pkcs_1_pss_encode(in, inlen, saltlen, prng, prng_idx, @@ -114,7 +114,7 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, } x = *outlen; - if ((err = pkcs_1_v1_5_encode(tmpin, y, LTC_LTC_PKCS_1_EMSA, + if ((err = pkcs_1_v1_5_encode(tmpin, y, LTC_PKCS_1_EMSA, modulus_bitlen, NULL, 0, out, &x)) != CRYPT_OK) { XFREE(tmpin); diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index fe836901c..98dd442ca 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -23,7 +23,7 @@ @param siglen The length of the signature data (octets) @param hash The hash of the message that was signed @param hashlen The length of the hash of the message that was signed (octets) - @param padding Type of padding (LTC_LTC_PKCS_1_PSS or LTC_LTC_PKCS_1_V1_5) + @param padding Type of padding (LTC_PKCS_1_PSS or LTC_PKCS_1_V1_5) @param hash_idx The index of the desired hash @param saltlen The length of the salt used during signature @param stat [out] The result of the signature comparison, 1==valid, 0==invalid @@ -50,12 +50,12 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, /* valid padding? */ - if ((padding != LTC_LTC_PKCS_1_V1_5) && - (padding != LTC_LTC_PKCS_1_PSS)) { + if ((padding != LTC_PKCS_1_V1_5) && + (padding != LTC_PKCS_1_PSS)) { return CRYPT_PK_INVALID_PADDING; } - if (padding == LTC_LTC_PKCS_1_PSS) { + if (padding == LTC_PKCS_1_PSS) { /* valid hash ? */ if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; @@ -90,7 +90,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, return CRYPT_INVALID_PACKET; } - if (padding == LTC_LTC_PKCS_1_PSS) { + if (padding == LTC_PKCS_1_PSS) { /* PSS decode and verify it */ err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat); } else { @@ -114,7 +114,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, goto bail_2; } - if ((err = pkcs_1_v1_5_decode(tmpbuf, x, LTC_LTC_PKCS_1_EMSA, modulus_bitlen, out, &outlen, &decoded)) != CRYPT_OK) { + if ((err = pkcs_1_v1_5_decode(tmpbuf, x, LTC_PKCS_1_EMSA, modulus_bitlen, out, &outlen, &decoded)) != CRYPT_OK) { XFREE(out); goto bail_2; } diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 2d5c063e7..dcd25e33f 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -261,10 +261,10 @@ for (cnt = 0; cnt < len; ) { for (rsa_msgsize = 1; rsa_msgsize <= 117; rsa_msgsize++) { len = sizeof(out); len2 = rsa_msgsize; - DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_LTC_PKCS_1_V1_5, &key)); + DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_PKCS_1_V1_5, &key)); len2 = rsa_msgsize; - DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_LTC_PKCS_1_V1_5, &stat, &key)); + DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_PKCS_1_V1_5, &stat, &key)); if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_decrypt_key_ex failed, %d, %d", stat, stat2); return 1; @@ -351,11 +351,11 @@ for (cnt = 0; cnt < len; ) { /* sign a message with LTC_PKCS #1 v1.5 */ len = sizeof(out); - DO(rsa_sign_hash_ex(in, 20, out, &len, LTC_LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); - DO(rsa_verify_hash_ex(out, len, in, 20, LTC_LTC_PKCS_1_V1_5, hash_idx, 8, &stat, &pubKey)); + DO(rsa_sign_hash_ex(in, 20, out, &len, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); + DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat, &pubKey)); /* change a byte */ in[0] ^= 1; - DO(rsa_verify_hash_ex(out, len, in, 20, LTC_LTC_PKCS_1_V1_5, hash_idx, 8, &stat2, &pubKey)); + DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat2, &pubKey)); if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_verify_hash_ex failed, %d, %d", stat, stat2); From e960ff887cb50b9070d49016db6cfcc5bae3bd58 Mon Sep 17 00:00:00 2001 From: Daniel Akesson Date: Sat, 24 Oct 2009 20:11:17 +0200 Subject: [PATCH 0006/1192] Added project and solution files for Visual Studio 2005 and Visual Studio 2008. --- libtomcrypt_VS2005.sln | 20 + libtomcrypt_VS2005.vcproj | 7181 ++++++++++++++++++++++++++++++++++++ libtomcrypt_VS2008.sln | 20 + libtomcrypt_VS2008.vcproj | 7183 +++++++++++++++++++++++++++++++++++++ 4 files changed, 14404 insertions(+) create mode 100644 libtomcrypt_VS2005.sln create mode 100644 libtomcrypt_VS2005.vcproj create mode 100644 libtomcrypt_VS2008.sln create mode 100644 libtomcrypt_VS2008.vcproj diff --git a/libtomcrypt_VS2005.sln b/libtomcrypt_VS2005.sln new file mode 100644 index 000000000..527c06020 --- /dev/null +++ b/libtomcrypt_VS2005.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtomcrypt", "libtomcrypt_VS2005.vcproj", "{3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}.Debug|Win32.ActiveCfg = Debug|Win32 + {3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}.Debug|Win32.Build.0 = Debug|Win32 + {3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}.Release|Win32.ActiveCfg = Release|Win32 + {3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj new file mode 100644 index 000000000..4af31c65d --- /dev/null +++ b/libtomcrypt_VS2005.vcproj @@ -0,0 +1,7181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libtomcrypt_VS2008.sln b/libtomcrypt_VS2008.sln new file mode 100644 index 000000000..2424d8858 --- /dev/null +++ b/libtomcrypt_VS2008.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtomcrypt", "libtomcrypt_VS2008.vcproj", "{E3802982-DCB6-4D85-A2BD-6B08F0657E79}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|Win32.ActiveCfg = Debug|Win32 + {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|Win32.Build.0 = Debug|Win32 + {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|Win32.ActiveCfg = Release|Win32 + {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj new file mode 100644 index 000000000..93f5d7d2c --- /dev/null +++ b/libtomcrypt_VS2008.vcproj @@ -0,0 +1,7183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 59f9c00f9855ed3ad693db096fa8429f28bd783d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 2 Jun 2010 15:26:47 +0200 Subject: [PATCH 0007/1192] removed IAR compiler warnings --- src/ciphers/twofish/twofish.c | 10 ++-------- src/pk/asn1/der/sequence/der_decode_sequence_ex.c | 4 ++-- src/pk/asn1/der/sequence/der_length_sequence.c | 3 +-- src/pk/ecc/ltc_ecc_mul2add.c | 4 ++-- src/prngs/fortuna.c | 13 ++++++++----- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index e96bf67ab..65a8c2baf 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -42,14 +42,6 @@ const struct ltc_cipher_descriptor twofish_desc = #define MDS_POLY 0x169 #define RS_POLY 0x14D -/* The 4x4 MDS Linear Transform */ -static const unsigned char MDS[4][4] = { - { 0x01, 0xEF, 0x5B, 0x5B }, - { 0x5B, 0xEF, 0xEF, 0x01 }, - { 0xEF, 0x5B, 0x01, 0xEF }, - { 0xEF, 0x01, 0xEF, 0x5B } -}; - /* The 4x8 RS Linear Transform */ static const unsigned char RS[4][8] = { { 0x01, 0xA4, 0x55, 0x87, 0x5A, 0x58, 0xDB, 0x9E }, @@ -58,6 +50,7 @@ static const unsigned char RS[4][8] = { { 0XA4, 0X55, 0X87, 0X5A, 0X58, 0XDB, 0X9E, 0X03 } }; +#ifdef LTC_TWOFISH_SMALL /* sbox usage orderings */ static const unsigned char qord[4][5] = { { 1, 1, 0, 0, 1 }, @@ -65,6 +58,7 @@ static const unsigned char qord[4][5] = { { 0, 0, 0, 1, 1 }, { 1, 0, 1, 1, 0 } }; +#endif /* LTC_TWOFISH_SMALL */ #ifdef LTC_TWOFISH_TABLES diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 5042b18b4..b5f8da548 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -31,8 +31,8 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, ltc_asn1_list *list, unsigned long outlen, int ordered) { - int err, type; - unsigned long size, x, y, z, i, blksize; + int err, type, i; + unsigned long size, x, y, z, blksize; void *data; LTC_ARGCHK(in != NULL); diff --git a/src/pk/asn1/der/sequence/der_length_sequence.c b/src/pk/asn1/der/sequence/der_length_sequence.c index 7221f9970..bd7b9387f 100644 --- a/src/pk/asn1/der/sequence/der_length_sequence.c +++ b/src/pk/asn1/der/sequence/der_length_sequence.c @@ -28,7 +28,7 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, unsigned long *outlen) { int err, type; - unsigned long size, x, y, z, i; + unsigned long size, x, y, i; void *data; LTC_ARGCHK(list != NULL); @@ -137,7 +137,6 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, } /* calc header size */ - z = y; if (y < 128) { y += 2; } else if (y < 256) { diff --git a/src/pk/ecc/ltc_ecc_mul2add.c b/src/pk/ecc/ltc_ecc_mul2add.c index a6d1aab8a..e5174a4c6 100644 --- a/src/pk/ecc/ltc_ecc_mul2add.c +++ b/src/pk/ecc/ltc_ecc_mul2add.c @@ -40,9 +40,9 @@ int ltc_ecc_mul2add(ecc_point *A, void *kA, void *modulus) { ecc_point *precomp[16]; - unsigned bitbufA, bitbufB, lenA, lenB, len, x, y, nA, nB, nibble; + unsigned bitbufA, bitbufB, lenA, lenB, len, y, nA, nB, nibble; unsigned char *tA, *tB; - int err, first; + int err, first, x; void *mp, *mu; /* argchks */ diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index d262a0be2..51a1c7d09 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -226,7 +226,6 @@ int fortuna_ready(prng_state *prng) unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state *prng) { unsigned char tmp[16]; - int err; unsigned long tlen; LTC_ARGCHK(out != NULL); @@ -236,7 +235,7 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state /* do we have to reseed? */ if (++prng->fortuna.wd == LTC_FORTUNA_WD || prng->fortuna.pool0_len >= 64) { - if ((err = fortuna_reseed(prng)) != CRYPT_OK) { + if (fortuna_reseed(prng) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); return 0; } @@ -262,9 +261,13 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state } /* generate new key */ - rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K , &prng->fortuna.skey); fortuna_update_iv(prng); - rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K+16, &prng->fortuna.skey); fortuna_update_iv(prng); - if ((err = rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey)) != CRYPT_OK) { + rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K , &prng->fortuna.skey); + fortuna_update_iv(prng); + + rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K+16, &prng->fortuna.skey); + fortuna_update_iv(prng); + + if (rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); return 0; } From c3018d69d0a96769924208357af1cd2cedd3b24d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 14 Jun 2010 15:16:08 +0200 Subject: [PATCH 0008/1192] removed gcc compiler warnings --- src/pk/asn1/der/sequence/der_decode_sequence_ex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index b5f8da548..67ca2a05d 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -76,13 +76,13 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } /* mark all as unused */ - for (i = 0; i < outlen; i++) { + for (i = 0; i < (int)outlen; i++) { list[i].used = 0; } /* ok read data */ inlen = blksize; - for (i = 0; i < outlen; i++) { + for (i = 0; i < (int)outlen; i++) { z = 0; type = list[i].type; size = list[i].size; @@ -268,7 +268,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } } - for (i = 0; i < outlen; i++) { + for (i = 0; i < (int)outlen; i++) { if (list[i].used == 0) { err = CRYPT_INVALID_PACKET; goto LBL_ERR; From e7ce129e9b89159aa51f02f345768a3c9782b84d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jun 2010 16:36:36 +0200 Subject: [PATCH 0009/1192] flushed content of CVS/SVN tags --- src/ciphers/camellia.c | 6 +++--- src/encauth/ccm/ccm_memory_ex.c | 6 +++--- testme.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 48d5fb215..06510125c 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -705,6 +705,6 @@ int camellia_keysize(int *keysize) #endif -/* $Source: /cvs/libtom/libtomcrypt/src/ciphers/camellia.c,v $ */ -/* $Revision: 1.1 $ */ -/* $Date: 2007/06/20 13:14:52 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c index 90518a4ad..9d0b28c99 100644 --- a/src/encauth/ccm/ccm_memory_ex.c +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -378,6 +378,6 @@ if (CTR != NULL) { #endif -/* $Source: /cvs/libtom/libtomcrypt/src/encauth/ccm/ccm_memory.c,v $ */ -/* $Revision: 1.19 $ */ -/* $Date: 2006/12/28 01:27:23 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/testme.sh b/testme.sh index b62fda8dc..ff98d23a0 100644 --- a/testme.sh +++ b/testme.sh @@ -53,6 +53,6 @@ bash testbuild.sh "NOTEST" "-DLTC_NO_TEST" "$1" "$2" "$3" || exit 1 # test build with no file routines bash testbuild.sh "NOFILE" "-DLTC_NO_FILE" "$1" "$2" "$3" || exit 1 -# $Source: /cvs/libtom/libtomcrypt/testme.sh,v $ -# $Revision: 1.20 $ -# $Date: 2006/01/26 14:49:43 $ +# $Source$ +# $Revision$ +# $Date$ From 77e31fb6a980212e90b9a50f116dc5a7bd91e527 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Oct 2010 16:02:34 +0200 Subject: [PATCH 0010/1192] Re-licensed all code under WTFPL, c.f. http://sam.zoy.org/wtfpl/ --- LICENSE | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 5d678c5f4..39a257d0f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,13 @@ -LibTomCrypt is public domain. As should all quality software be. + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 -Tom St Denis + Copyright (C) 2004 Sam Hocevar + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. From 5039e6520f8f814a7c6fac404ccbc8a9e031f0e5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 18 Jan 2011 19:42:38 +0100 Subject: [PATCH 0011/1192] fixed tests and testvectors --- demos/tv_gen.c | 22 +++++++++++----------- notes/pmac_tv.txt | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 4518ebd4b..8e09e3b95 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -238,12 +238,12 @@ void hmac_gen(void) out = fopen("hmac_tv.txt", "w"); fprintf(out, -"LTC_HMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are LTC_HMACed. The initial key is\n" -"of the same format (the same length as the HASH output size). The LTC_HMAC key in step N+1 is the LTC_HMAC output of\n" +"HMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are HMACed. The initial key is\n" +"of the same format (the same length as the HASH output size). The HMAC key in step N+1 is the HMAC output of\n" "step N.\n\n"); for (x = 0; hash_descriptor[x].name != NULL; x++) { - fprintf(out, "LTC_HMAC-%s\n", hash_descriptor[x].name); + fprintf(out, "HMAC-%s\n", hash_descriptor[x].name); /* initial key */ for (y = 0; y < (int)hash_descriptor[x].hashsize; y++) { @@ -290,8 +290,8 @@ void omac_gen(void) out = fopen("omac_tv.txt", "w"); fprintf(out, -"LTC_OMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are LTC_OMAC'ed. The initial key is\n" -"of the same format (length specified per cipher). The LTC_OMAC key in step N+1 is the LTC_OMAC output of\n" +"OMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are OMAC'ed. The initial key is\n" +"of the same format (length specified per cipher). The OMAC key in step N+1 is the OMAC output of\n" "step N (repeated as required to fill the array).\n\n"); for (x = 0; cipher_descriptor[x].name != NULL; x++) { @@ -303,7 +303,7 @@ void omac_gen(void) if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) { kl = cipher_descriptor[x].max_key_length; } - fprintf(out, "LTC_OMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl); + fprintf(out, "OMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl); /* initial key/block */ for (y = 0; y < kl; y++) { @@ -345,8 +345,8 @@ void pmac_gen(void) out = fopen("pmac_tv.txt", "w"); fprintf(out, -"PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are LTC_OMAC'ed. The initial key is\n" -"of the same format (length specified per cipher). The LTC_OMAC key in step N+1 is the LTC_OMAC output of\n" +"PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are PMAC'ed. The initial key is\n" +"of the same format (length specified per cipher). The PMAC key in step N+1 is the PMAC output of\n" "step N (repeated as required to fill the array).\n\n"); for (x = 0; cipher_descriptor[x].name != NULL; x++) { @@ -767,14 +767,14 @@ int main(void) reg_algs(); printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n"); printf("Generating cipher vectors..."); fflush(stdout); cipher_gen(); printf("done\n"); - printf("Generating LTC_HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n"); - printf("Generating LTC_OMAC vectors..."); fflush(stdout); omac_gen(); printf("done\n"); + printf("Generating HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n"); + printf("Generating OMAC vectors..."); fflush(stdout); omac_gen(); printf("done\n"); printf("Generating PMAC vectors..."); fflush(stdout); pmac_gen(); printf("done\n"); printf("Generating EAX vectors..."); fflush(stdout); eax_gen(); printf("done\n"); printf("Generating OCB vectors..."); fflush(stdout); ocb_gen(); printf("done\n"); printf("Generating CCM vectors..."); fflush(stdout); ccm_gen(); printf("done\n"); printf("Generating GCM vectors..."); fflush(stdout); gcm_gen(); printf("done\n"); - printf("Generating LTC_BASE64 vectors..."); fflush(stdout); base64_gen(); printf("done\n"); + printf("Generating BASE64 vectors..."); fflush(stdout); base64_gen(); printf("done\n"); printf("Generating MATH vectors..."); fflush(stdout); math_gen(); printf("done\n"); printf("Generating ECC vectors..."); fflush(stdout); ecc_gen(); printf("done\n"); printf("Generating LRW vectors..."); fflush(stdout); lrw_gen(); printf("done\n"); diff --git a/notes/pmac_tv.txt b/notes/pmac_tv.txt index e0a19006e..38ed68334 100644 --- a/notes/pmac_tv.txt +++ b/notes/pmac_tv.txt @@ -1,5 +1,5 @@ -PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are OMAC'ed. The initial key is -of the same format (length specified per cipher). The OMAC key in step N+1 is the OMAC output of +PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are PMAC'ed. The initial key is +of the same format (length specified per cipher). The PMAC key in step N+1 is the PMAC output of step N (repeated as required to fill the array). PMAC-aes (16 byte key) From 6fecec107db6fe8fc9b8d6621318a7792b489a12 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 18 Jan 2011 20:06:03 +0100 Subject: [PATCH 0012/1192] rejoined diffie hellman code from ltc 1.05, thanks to Alexander Kurpiers --- crypt.tex | 224 +++++++++++++ demos/test.c | 1 + makefile | 1 + src/headers/tomcrypt_custom.h | 20 ++ src/headers/tomcrypt_math.h | 20 ++ src/headers/tomcrypt_pk.h | 43 +++ src/math/gmp_desc.c | 24 ++ src/math/ltm_desc.c | 20 ++ src/math/tfm_desc.c | 20 ++ src/pk/dh/dh.c | 606 ++++++++++++++++++++++++++++++++++ src/pk/dh/dh_sys.c | 491 +++++++++++++++++++++++++++ testprof/dh_test.c | 122 +++++++ testprof/makefile | 2 +- testprof/tomcrypt_test.h | 1 + 14 files changed, 1594 insertions(+), 1 deletion(-) create mode 100644 src/pk/dh/dh.c create mode 100644 src/pk/dh/dh_sys.c create mode 100644 testprof/dh_test.c diff --git a/crypt.tex b/crypt.tex index 31bf399b9..bb1dbd7af 100644 --- a/crypt.tex +++ b/crypt.tex @@ -3675,6 +3675,230 @@ \subsection{RSA Key Import} import the key, strip off the additional data (it's the preferred hash) and fill in the rsa\_key structure as if it were a native RSAPublicKey. Note that there is no function provided to export in this format. + +\chapter{Diffie-Hellman Key Exchange} + +\section{Background} + +Diffie-Hellman was the original public key system proposed. The system is based upon the group structure +of finite fields. For Diffie-Hellman a prime $p$ is chosen and a ``base'' $b$ such that $b^x\mbox{ }(\mbox{mod }p)$ +generates a large sub-group of prime order (for unique values of $x$). + +A secret key is an exponent $x$ and a public key is the value of $y \equiv g^x\mbox{ }(\mbox{mod }p)$. The term +``discrete logarithm'' denotes the action of finding $x$ given only $y$, $g$ and $p$. The key exchange part of +Diffie-Hellman arises from the fact that two users A and B with keys $(A_x, A_y)$ and $(B_x, B_y)$ can exchange +a shared key $K \equiv B_y^{A_x} \equiv A_y^{B_x} \equiv g^{A_xB_x}\mbox{ }(\mbox{mod }p)$. + +From this public encryption and signatures can be developed. The trivial way to encrypt (for example) using a public key +$y$ is to perform the key exchange offline. The sender invents a key $k$ and its public copy +$k' \equiv g^k\mbox{ }(\mbox{mod }p)$ and uses $K \equiv k'^{A_x}\mbox{ }(\mbox{mod }p)$ as a key to encrypt +the message with. Typically $K$ would be sent to a one-way hash and the message digested used as a key in a +symmetric cipher. + +It is important that the order of the sub-group that $g$ generates not only be large but also prime. There are +discrete logarithm algorithms that take $\sqrt r$ time given the order $r$. The discrete logarithm can be computed +modulo each prime factor of $r$ and the results combined using the Chinese Remainder Theorem. In the cases where +$r$ is ``B-Smooth'' (e.g. all small factors or powers of small prime factors) the solution is trivial to find. + +To thwart such attacks the primes and bases in the library have been designed and fixed. Given a prime $p$ the order of + the sub-group generated is a large prime namely ${p - 1} \over 2$. Such primes are known as ``strong primes'' and the +smaller prime (e.g. the order of the base) are known as Sophie-Germaine primes. + +\section{Core Functions} + +This library also provides core Diffie-Hellman functions so you can negotiate keys over insecure mediums. The routines +provided are relatively easy to use and only take two function calls to negotiate a shared key. There is a structure +called ``dh\_key'' which stores the Diffie-Hellman key in a format these routines can use. The first routine is to +make a Diffie-Hellman private key pair: +\index{dh\_make\_key()} +\begin{verbatim} +int dh_make_key(prng_state *prng, int wprng, + int keysize, dh_key *key); +\end{verbatim} +The ``keysize'' is the size of the modulus you want in bytes. Currently support sizes are 96 to 512 bytes which correspond +to key sizes of 768 to 4096 bits. The smaller the key the faster it is to use however it will be less secure. When +specifying a size not explicitly supported by the library it will round {\em up} to the next key size. If the size is +above 512 it will return an error. So if you pass ``keysize == 32'' it will use a 768 bit key but if you pass +``keysize == 20000'' it will return an error. The primes and generators used are built-into the library and were designed +to meet very specific goals. The primes are strong primes which means that if $p$ is the prime then +$p-1$ is equal to $2r$ where $r$ is a large prime. The bases are chosen to generate a group of order $r$ to prevent +leaking a bit of the key. This means the bases generate a very large prime order group which is good to make cryptanalysis +hard. + +The next two routines are for exporting/importing Diffie-Hellman keys in a binary format. This is useful for transport +over communication mediums. + +\index{dh\_export()} \index{dh\_import()} +\begin{verbatim} +int dh_export(unsigned char *out, unsigned long *outlen, + int type, dh_key *key); + +int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); +\end{verbatim} + +These two functions work just like the ``rsa\_export()'' and ``rsa\_import()'' functions except these work with +Diffie-Hellman keys. Its important to note you do not have to free the ram for a ``dh\_key'' if an import fails. You can free a +``dh\_key'' using: +\begin{verbatim} +void dh_free(dh_key *key); +\end{verbatim} +After you have exported a copy of your public key (using {\bf PK\_PUBLIC} as ``type'') you can now create a shared secret +with the other user using: +\index{dh\_shared\_secret()} +\begin{verbatim} +int dh_shared_secret(dh_key *private_key, + dh_key *public_key, + unsigned char *out, unsigned long *outlen); +\end{verbatim} + +Where ``private\_key'' is the key you made and ``public\_key'' is the copy of the public key the other user sent you. The result goes +into ``out'' and the length into ``outlen''. If all went correctly the data in ``out'' should be identical for both parties. It is important to +note that the two keys have to be the same size in order for this to work. There is a function to get the size of a +key: +\index{dh\_get\_size()} +\begin{verbatim} +int dh_get_size(dh_key *key); +\end{verbatim} +This returns the size in bytes of the modulus chosen for that key. + +\subsection{Remarks on Usage} +Its important that you hash the shared key before trying to use it as a key for a symmetric cipher or something. An +example program that communicates over sockets, using MD5 and 1024-bit DH keys is\footnote{This function is a small example. It is suggested that proper packaging be used. For example, if the public key sent is truncated these routines will not detect that.}: +\newpage +\begin{small} +\begin{verbatim} +int establish_secure_socket(int sock, int mode, unsigned char *key, + prng_state *prng, int wprng) +{ + unsigned char buf[4096], buf2[4096]; + unsigned long x, len; + int res, err, inlen; + dh_key mykey, theirkey; + + /* make up our private key */ + if ((err = dh_make_key(prng, wprng, 128, &mykey)) != CRYPT_OK) { + return err; + } + + /* export our key as public */ + x = sizeof(buf); + if ((err = dh_export(buf, &x, PK_PUBLIC, &mykey)) != CRYPT_OK) { + res = err; + goto done2; + } + + if (mode == 0) { + /* mode 0 so we send first */ + if (send(sock, buf, x, 0) != x) { + res = CRYPT_ERROR; + goto done2; + } + + /* get their key */ + if ((inlen = recv(sock, buf2, sizeof(buf2), 0)) <= 0) { + res = CRYPT_ERROR; + goto done2; + } + } else { + /* mode >0 so we send second */ + if ((inlen = recv(sock, buf2, sizeof(buf2), 0)) <= 0) { + res = CRYPT_ERROR; + goto done2; + } + + if (send(sock, buf, x, 0) != x) { + res = CRYPT_ERROR; + goto done2; + } + } + + if ((err = dh_import(buf2, inlen, &theirkey)) != CRYPT_OK) { + res = err; + goto done2; + } + + /* make shared secret */ + x = sizeof(buf); + if ((err = dh_shared_secret(&mykey, &theirkey, buf, &x)) != CRYPT_OK) { + res = err; + goto done; + } + + /* hash it */ + len = 16; /* default is MD5 so "key" must be at least 16 bytes long */ + if ((err = hash_memory(find_hash("md5"), buf, x, key, &len)) != CRYPT_OK) { + res = err; + goto done; + } + + /* clean up and return */ + res = CRYPT_OK; +done: + dh_free(&theirkey); +done2: + dh_free(&mykey); + zeromem(buf, sizeof(buf)); + zeromem(buf2, sizeof(buf2)); + return res; +} +\end{verbatim} +\end{small} +\newpage +\subsection{Remarks on The Snippet} +When the above code snippet is done (assuming all went well) their will be a shared 128-bit key in the ``key'' array +passed to ``establish\_secure\_socket()''. + +\section{Other Diffie-Hellman Functions} +In order to test the Diffie-Hellman function internal workings (e.g. the primes and bases) their is a test function made +available: +\index{dh\_test()} +\begin{verbatim} +int dh_test(void); +\end{verbatim} + +This function returns {\bf CRYPT\_OK} if the bases and primes in the library are correct. There is one last helper +function: +\index{dh\_sizes()} +\begin{verbatim} +void dh_sizes(int *low, int *high); +\end{verbatim} +Which stores the smallest and largest key sizes support into the two variables. + +\section{DH Packet} +Similar to the RSA related functions there are functions to encrypt or decrypt symmetric keys using the DH public key +algorithms. +\index{dh\_encrypt\_key()} \index{dh\_decrypt\_key()} +\begin{verbatim} +int dh_encrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *len, + prng_state *prng, int wprng, int hash, + dh_key *key); + +int dh_decrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + dh_key *key); +\end{verbatim} +Where ``in'' is an input symmetric key of no more than 32 bytes. Essentially these routines created a random public key +and find the hash of the shared secret. The message digest is than XOR'ed against the symmetric key. All of the +required data is placed in ``out'' by ``dh\_encrypt\_key()''. The hash must produce a message digest at least as large +as the symmetric key you are trying to share. + +Similar to the RSA system you can sign and verify a hash of a message. +\index{dh\_sign\_hash()} \index{dh\_verify\_hash()} +\begin{verbatim} +int dh_sign_hash(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, dh_key *key); + +int dh_verify_hash(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, dh_key *key); +\end{verbatim} + +The ``dh\_sign\_hash'' function signs the message hash in ``in'' of length ``inlen'' and forms a DH packet in ``out''. +The ``dh\_verify\_hash'' function verifies the DH signature in ``sig'' against the hash in ``hash''. It sets ``stat'' +to non-zero if the signature passes or zero if it fails. + \chapter{Elliptic Curve Cryptography} \mysection{Background} diff --git a/demos/test.c b/demos/test.c index 54de8901e..abfd22aab 100644 --- a/demos/test.c +++ b/demos/test.c @@ -24,6 +24,7 @@ int main(void) printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\ndh_test......."); fflush(stdout); x = dh_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ndsa_test......"); fflush(stdout); x = dsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nkatja_test...."); fflush(stdout); x = katja_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); diff --git a/makefile b/makefile index 49f420231..15b99fedd 100644 --- a/makefile +++ b/makefile @@ -208,6 +208,7 @@ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/e src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ +src/pk/dh/dh.o \ src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index d1e140d80..cfd4a79c5 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -302,6 +302,26 @@ /* Include RSA support */ #define LTC_MRSA +/* Include Diffie-Hellman support */ +#ifndef GPM_DESC +/* is_prime fails for GPM */ +#define MDH +/* Supported Key Sizes */ +#define DH768 +#define DH1024 +#define DH1280 +#define DH1536 +#define DH1792 +#define DH2048 + +#ifndef TFM_DESC +/* tfm has a problem in fp_isprime for larger key sizes */ +#define DH2560 +#define DH3072 +#define DH4096 +#endif +#endif + /* Include Katja (a Rabin variant like RSA) */ /* #define MKAT */ diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index aee61053e..8b58f2e46 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -258,6 +258,24 @@ typedef struct { */ int (*lcm)(void *a, void *b, void *c); + /** Modular addition + @param a The first source + @param b The second source + @param c The modulus + @param d The destination (a + b mod c) + @return CRYPT_OK on success + */ + int (*addmod)(void *a, void *b, void *c, void *d); + + /** Modular substraction + @param a The first source + @param b The second source + @param c The modulus + @param d The destination (a - b mod c) + @return CRYPT_OK on success + */ + int (*submod)(void *a, void *b, void *c, void *d); + /** Modular multiplication @param a The first source @param b The second source @@ -475,6 +493,8 @@ extern const ltc_math_descriptor gmp_desc; #define mp_gcd(a, b, c) ltc_mp.gcd(a, b, c) #define mp_lcm(a, b, c) ltc_mp.lcm(a, b, c) +#define mp_addmod(a, b, c, d) ltc_mp.addmod(a, b, c, d) +#define mp_submod(a, b, c, d) ltc_mp.submod(a, b, c, d) #define mp_mulmod(a, b, c, d) ltc_mp.mulmod(a, b, c, d) #define mp_sqrmod(a, b, c) ltc_mp.sqrmod(a, b, c) #define mp_invmod(a, b, c) ltc_mp.invmod(a, b, c) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 33d8f024b..83757fbc8 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -143,6 +143,49 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key); #endif +/* ---- DH Routines ---- */ +#ifdef MDH + +typedef struct Dh_key { + int idx, type; + void *x; + void *y; +} dh_key; + +int dh_compat_test(void); +void dh_sizes(int *low, int *high); +int dh_get_size(dh_key *key); + +int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key); +void dh_free(dh_key *key); + +int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key); +int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); + +int dh_shared_secret(dh_key *private_key, dh_key *public_key, + unsigned char *out, unsigned long *outlen); + +int dh_encrypt_key(const unsigned char *in, unsigned long keylen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, + dh_key *key); + +int dh_decrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + dh_key *key); + +int dh_sign_hash(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, dh_key *key); + +int dh_verify_hash(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, dh_key *key); + + +#endif + + /* ---- ECC Routines ---- */ #ifdef LTC_MECC diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index c61bafe1e..3450e803f 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -305,6 +305,28 @@ static int lcm(void *a, void *b, void *c) return CRYPT_OK; } +static int addmod(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(d != NULL); + mpz_add(d, a, b); + mpz_mod(d, d, c); + return CRYPT_OK; +} + +static int submod(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(d != NULL); + mpz_sub(d, a, b); + mpz_mod(d, d, c); + return CRYPT_OK; +} + static int mulmod(void *a, void *b, void *c, void *d) { LTC_ARGCHK(a != NULL); @@ -427,6 +449,8 @@ const ltc_math_descriptor gmp_desc = { &gcd, &lcm, + &addmod, + &submod, &mulmod, &sqrmod, &invmod, diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index de0d89844..bc5a142a9 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -308,6 +308,24 @@ static int lcm(void *a, void *b, void *c) return mpi_to_ltc_error(mp_lcm(a, b, c)); } +static int addmod(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(d != NULL); + return mpi_to_ltc_error(mp_addmod(a,b,c,d)); +} + +static int submod(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(d != NULL); + return mpi_to_ltc_error(mp_submod(a,b,c,d)); +} + static int mulmod(void *a, void *b, void *c, void *d) { LTC_ARGCHK(a != NULL); @@ -433,6 +451,8 @@ const ltc_math_descriptor ltm_desc = { &gcd, &lcm, + &addmod, + &submod, &mulmod, &sqrmod, &invmod, diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index f5680446d..111d1227d 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -319,6 +319,24 @@ static int lcm(void *a, void *b, void *c) return CRYPT_OK; } +static int addmod(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(d != NULL); + return tfm_to_ltc_error(fp_addmod(a,b,c,d)); +} + +static int submod(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(d != NULL); + return tfm_to_ltc_error(fp_submod(a,b,c,d)); +} + static int mulmod(void *a, void *b, void *c, void *d) { LTC_ARGCHK(a != NULL); @@ -721,6 +739,8 @@ const ltc_math_descriptor tfm_desc = { &gcd, &lcm, + &addmod, + &submod, &mulmod, &sqrmod, &invmod, diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c new file mode 100644 index 000000000..d9b76469f --- /dev/null +++ b/src/pk/dh/dh.c @@ -0,0 +1,606 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org + */ +#include "tomcrypt.h" + +/** + @file dh.c + DH crypto, Tom St Denis +*/ + +#ifdef MDH + + /* size of a packet header in bytes */ + #define PACKET_SIZE 4 + + /* Section tags */ + #define PACKET_SECT_DH 1 + + /* Subsection Tags for the first three sections */ + #define PACKET_SUB_KEY 0 + #define PACKET_SUB_ENCRYPTED 1 + #define PACKET_SUB_SIGNED 2 + #define PACKET_SUB_ENC_KEY 3 + +#define OUTPUT_BIGNUM(num, out, y, z) \ +{ \ + if ((y + 4) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ + z = (unsigned long)mp_unsigned_bin_size(num); \ + STORE32L(z, out+y); \ + y += 4; \ + if ((y + z) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ + if ((err = mp_to_unsigned_bin(num, out+y)) != CRYPT_OK) { return err; } \ + y += z; \ +} + +#define INPUT_BIGNUM(num, in, x, y, inlen) \ +{ \ + /* load value */ \ + if ((y + 4) > inlen) { \ + err = CRYPT_INVALID_PACKET; \ + goto error; \ + } \ + LOAD32L(x, in+y); \ + y += 4; \ + \ + /* sanity check... */ \ + if ((x+y) > inlen) { \ + err = CRYPT_INVALID_PACKET; \ + goto error; \ + } \ + \ + /* load it */ \ + if ((err = mp_read_unsigned_bin(num, (unsigned char *)in+y, (int)x)) != CRYPT_OK) {\ + goto error; \ + } \ + y += x; \ +} + +static void packet_store_header(unsigned char *dst, int section, int subsection) +{ + LTC_ARGCHK(dst != NULL); + + /* store version number */ + dst[0] = (unsigned char)(CRYPT&255); + dst[1] = (unsigned char)((CRYPT>>8)&255); + + /* store section and subsection */ + dst[2] = (unsigned char)(section & 255); + dst[3] = (unsigned char)(subsection & 255); + +} + +static int packet_valid_header(unsigned char *src, int section, int subsection) +{ + unsigned long ver; + + LTC_ARGCHK(src != NULL); + + /* check version */ + ver = ((unsigned long)src[0]) | ((unsigned long)src[1] << 8U); + if (CRYPT < ver) { + return CRYPT_INVALID_PACKET; + } + + /* check section and subsection */ + if (section != (int)src[2] || subsection != (int)src[3]) { + return CRYPT_INVALID_PACKET; + } + + return CRYPT_OK; +} + + +/* max export size we'll encounter (smaller than this but lets round up a bit) */ +#define DH_BUF_SIZE 1200 + +/* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ +static const struct { + int size; + char *name, *base, *prime; +} sets[] = { +#ifdef DH768 +{ + 96, + "DH-768", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "//////m3wvV" +}, +#endif +#ifdef DH1024 +{ + 128, + "DH-1024", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////m3C47" +}, +#endif +#ifdef DH1280 +{ + 160, + "DH-1280", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "//////////////////////////////m4kSN" +}, +#endif +#ifdef DH1536 +{ + 192, + "DH-1536", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////m5uqd" +}, +#endif +#ifdef DH1792 +{ + 224, + "DH-1792", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "//////////////////////////////////////////////////////mT/sd" +}, +#endif +#ifdef DH2048 +{ + 256, + "DH-2048", + "4", + "3///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "/////////////////////////////////////////m8MPh" +}, +#endif +#ifdef DH2560 +{ + 320, + "DH-2560", + "4", + "3///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "/////mKFpF" +}, +#endif +#ifdef DH3072 +{ + 384, + "DH-3072", + "4", + "3///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "/////////////////////////////m32nN" +}, +#endif +#ifdef DH4096 +{ + 512, + "DH-4096", + "4", + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "/////////////////////m8pOF" +}, +#endif +{ + 0, + NULL, + NULL, + NULL +} +}; + +static int is_valid_idx(int n) +{ + int x; + + for (x = 0; sets[x].size; x++); + if ((n < 0) || (n >= x)) { + return 0; + } + return 1; +} + +/** + Test the DH sub-system (can take a while) + @return CRYPT_OK if successful +*/ +int dh_compat_test(void) +{ + void *p, *g, *tmp; + int x, err, primality; + + if ((err = mp_init_multi(&p, &g, &tmp, NULL)) != CRYPT_OK) { goto error; } + + for (x = 0; sets[x].size != 0; x++) { +#if 0 + printf("dh_test():testing size %d-bits\n", sets[x].size * 8); +#endif + if ((err = mp_read_radix(g,(char *)sets[x].base, 64)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p,(char *)sets[x].prime, 64)) != CRYPT_OK) { goto error; } + + /* ensure p is prime */ + if ((err = mp_prime_is_prime(p, 8, &primality)) != CRYPT_OK) { goto done; } + if (primality != LTC_MP_YES ) { + err = CRYPT_FAIL_TESTVECTOR; + goto done; + } + + if ((err = mp_sub_d(p, 1, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_div_2(tmp, tmp)) != CRYPT_OK) { goto error; } + + /* ensure (p-1)/2 is prime */ + if ((err = mp_prime_is_prime(tmp, 8, &primality)) != CRYPT_OK) { goto done; } + if (primality == 0) { + err = CRYPT_FAIL_TESTVECTOR; + goto done; + } + + /* now see if g^((p-1)/2) mod p is in fact 1 */ + if ((err = mp_exptmod(g, tmp, p, tmp)) != CRYPT_OK) { goto error; } + if (mp_cmp_d(tmp, 1)) { + err = CRYPT_FAIL_TESTVECTOR; + goto done; + } + } + err = CRYPT_OK; +error: +done: + mp_clear_multi(tmp, g, p, NULL); + return err; +} + +/** + Get the min and max DH key sizes (octets) + @param low [out] The smallest key size supported + @param high [out] The largest key size supported +*/ +void dh_sizes(int *low, int *high) +{ + int x; + LTC_ARGCHK(low != NULL); + LTC_ARGCHK(high != NULL); + *low = INT_MAX; + *high = 0; + for (x = 0; sets[x].size != 0; x++) { + if (*low > sets[x].size) *low = sets[x].size; + if (*high < sets[x].size) *high = sets[x].size; + } +} + +/** + Returns the key size of a given DH key (octets) + @param key The DH key to get the size of + @return The size if valid or INT_MAX if not +*/ +int dh_get_size(dh_key *key) +{ + LTC_ARGCHK(key != NULL); + if (is_valid_idx(key->idx) == 1) { + return sets[key->idx].size; + } else { + return INT_MAX; /* large value that would cause dh_make_key() to fail */ + } +} + +/** + Make a DH key [private key pair] + @param prng An active PRNG state + @param wprng The index for the PRNG you desire to use + @param keysize The key size (octets) desired + @param key [out] Where the newly created DH key will be stored + @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. +*/ +int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) +{ + unsigned char *buf; + unsigned long x; + void *p, *g; + int err; + + LTC_ARGCHK(key != NULL); + + /* good prng? */ + if ((err = prng_is_valid(wprng)) != CRYPT_OK) { + return err; + } + + /* find key size */ + for (x = 0; (keysize > sets[x].size) && (sets[x].size != 0); x++); +#ifdef FAST_PK + keysize = MIN(sets[x].size, 32); +#else + keysize = sets[x].size; +#endif + if (sets[x].size == 0) { + return CRYPT_INVALID_KEYSIZE; + } + key->idx = x; + + /* allocate buffer */ + buf = XMALLOC(keysize); + if (buf == NULL) { + return CRYPT_MEM; + } + + /* make up random string */ + if ( rng_make_prng( keysize, wprng, prng, NULL) != CRYPT_OK) { + err = CRYPT_ERROR_READPRNG; + goto error2; + } + + if (prng_descriptor[wprng].read(buf, keysize, prng) != (unsigned long)keysize) { + err = CRYPT_ERROR_READPRNG; + goto error2; + } + + /* init parameters */ + if ((err = mp_init_multi(&g, &p, &key->x, &key->y, NULL)) != CRYPT_OK) { + goto error; + } + + if ((err = mp_read_radix(g, sets[key->idx].base, 64)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, sets[key->idx].prime, 64)) != CRYPT_OK) { goto error; } + + /* load the x value */ + if ((err = mp_read_unsigned_bin(key->x, buf, keysize)) != CRYPT_OK) { goto error; } + if ((err = mp_exptmod(g, key->x, p, key->y)) != CRYPT_OK) { goto error; } + key->type = PK_PRIVATE; + + /* free up ram */ + err = CRYPT_OK; + goto done; +error: + mp_clear_multi(key->x, key->y, NULL); +done: + mp_clear_multi(p, g, NULL); +error2: +#ifdef LTC_CLEAN_STACK + zeromem(buf, keysize); +#endif + XFREE(buf); + return err; +} + +/** + Free the allocated ram for a DH key + @param key The key which you wish to free +*/ +void dh_free(dh_key *key) +{ + LTC_ARGCHK(key != NULL); + if ( key->x ) { + mp_clear( key->x ); + key->x = NULL; + } + if ( key->y ) { + mp_clear( key->y ); + key->y = NULL; + } +} + +/** + Export a DH key to a binary packet + @param out [out] The destination for the key + @param outlen [in/out] The max size and resulting size of the DH key + @param type Which type of key (PK_PRIVATE or PK_PUBLIC) + @param key The key you wish to export + @return CRYPT_OK if successful +*/ +int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key) +{ + unsigned long y, z; + int err; + + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + + /* can we store the static header? */ + if (*outlen < (PACKET_SIZE + 2)) { + return CRYPT_BUFFER_OVERFLOW; + } + + if (type == PK_PRIVATE && key->type != PK_PRIVATE) { + return CRYPT_PK_NOT_PRIVATE; + } + + /* header */ + y = PACKET_SIZE; + + /* header */ + out[y++] = type; + out[y++] = (unsigned char)(sets[key->idx].size / 8); + + /* export y */ + OUTPUT_BIGNUM(key->y, out, y, z); + + if (type == PK_PRIVATE) { + /* export x */ + OUTPUT_BIGNUM(key->x, out, y, z); + } + + /* store header */ + packet_store_header(out, PACKET_SECT_DH, PACKET_SUB_KEY); + + /* store len */ + *outlen = y; + return CRYPT_OK; +} + +/** + Import a DH key from a binary packet + @param in The packet to read + @param inlen The length of the input packet + @param key [out] Where to import the key to + @return CRYPT_OK if successful, on error all allocated memory is freed automatically +*/ +int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) +{ + unsigned long x, y, s; + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(key != NULL); + + /* make sure valid length */ + if ((2+PACKET_SIZE) > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* check type byte */ + if ((err = packet_valid_header((unsigned char *)in, PACKET_SECT_DH, PACKET_SUB_KEY)) != CRYPT_OK) { + return err; + } + + /* init */ + if ((err = mp_init_multi(&key->x, &key->y, NULL)) != CRYPT_OK) { + return err; + } + + /* advance past packet header */ + y = PACKET_SIZE; + + /* key type, e.g. private, public */ + key->type = (int)in[y++]; + + /* key size in bytes */ + s = (unsigned long)in[y++] * 8; + + for (x = 0; (s > (unsigned long)sets[x].size) && (sets[x].size != 0); x++); + if (sets[x].size == 0) { + err = CRYPT_INVALID_KEYSIZE; + goto error; + } + key->idx = (int)x; + + /* type check both values */ + if ((key->type != PK_PUBLIC) && (key->type != PK_PRIVATE)) { + err = CRYPT_PK_TYPE_MISMATCH; + goto error; + } + + /* is the key idx valid? */ + if (is_valid_idx(key->idx) != 1) { + err = CRYPT_PK_TYPE_MISMATCH; + goto error; + } + + /* load public value g^x mod p*/ + INPUT_BIGNUM(key->y, in, x, y, inlen); + + if (key->type == PK_PRIVATE) { + INPUT_BIGNUM(key->x, in, x, y, inlen); + } + + /* eliminate private key if public */ + if (key->type == PK_PUBLIC) { + mp_clear(key->x); + key->x = NULL; + } + + return CRYPT_OK; +error: + mp_clear_multi(key->y, key->x, NULL); + return err; +} + +/** + Create a DH shared secret. + @param private_key The private DH key in the pair + @param public_key The public DH key in the pair + @param out [out] The destination of the shared data + @param outlen [in/out] The max size and resulting size of the shared data. + @return CRYPT_OK if successful +*/ +int dh_shared_secret(dh_key *private_key, dh_key *public_key, + unsigned char *out, unsigned long *outlen) +{ + void *tmp, *p; + unsigned long x; + int err; + + LTC_ARGCHK(private_key != NULL); + LTC_ARGCHK(public_key != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* types valid? */ + if (private_key->type != PK_PRIVATE) { + return CRYPT_PK_NOT_PRIVATE; + } + + /* same idx? */ + if (private_key->idx != public_key->idx) { + return CRYPT_PK_TYPE_MISMATCH; + } + + /* compute y^x mod p */ + if ((err = mp_init_multi(&tmp, &p, NULL)) != CRYPT_OK) { + return err; + } + + if ((err = mp_read_radix(p, (char *)sets[private_key->idx].prime, 64)) != CRYPT_OK) { goto error; } + if ((err = mp_exptmod(public_key->y, private_key->x, p, tmp)) != CRYPT_OK) { goto error; } + + /* enough space for output? */ + x = (unsigned long)mp_unsigned_bin_size(tmp); + if (*outlen < x) { + err = CRYPT_BUFFER_OVERFLOW; + goto done; + } + if ((err = mp_to_unsigned_bin(tmp, out)) != CRYPT_OK) { goto error; } + *outlen = x; + err = CRYPT_OK; + goto done; +error: +done: + mp_clear_multi(p, tmp, NULL); + return err; +} + +#include "dh_sys.c" + +#endif diff --git a/src/pk/dh/dh_sys.c b/src/pk/dh/dh_sys.c new file mode 100644 index 000000000..e2db2424a --- /dev/null +++ b/src/pk/dh/dh_sys.c @@ -0,0 +1,491 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org + */ + +/** + @file dh_sys.c + DH Crypto, Tom St Denis +*/ + +/** + Encrypt a short symmetric key with a public DH key + @param in The symmetric key to encrypt + @param inlen The length of the key (octets) + @param out [out] The ciphertext + @param outlen [in/out] The max size and resulting size of the ciphertext + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param hash The index of the hash desired (must produce a digest of size >= the size of the plaintext) + @param key The public key you wish to encrypt with. + @return CRYPT_OK if successful +*/ +int dh_encrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, + dh_key *key) +{ + unsigned char *pub_expt, *dh_shared, *skey; + dh_key pubkey; + unsigned long x, y, z, hashsize, pubkeysize; + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + + /* check that wprng/hash are not invalid */ + if ((err = prng_is_valid(wprng)) != CRYPT_OK) { + return err; + } + + if ((err = hash_is_valid(hash)) != CRYPT_OK) { + return err; + } + + if (inlen > hash_descriptor[hash].hashsize) { + return CRYPT_INVALID_HASH; + } + + /* allocate memory */ + pub_expt = XMALLOC(DH_BUF_SIZE); + dh_shared = XMALLOC(DH_BUF_SIZE); + skey = XMALLOC(MAXBLOCKSIZE); + if (pub_expt == NULL || dh_shared == NULL || skey == NULL) { + if (pub_expt != NULL) { + XFREE(pub_expt); + } + if (dh_shared != NULL) { + XFREE(dh_shared); + } + if (skey != NULL) { + XFREE(skey); + } + return CRYPT_MEM; + } + + /* make a random key and export the public copy */ + if ((err = dh_make_key(prng, wprng, dh_get_size(key), &pubkey)) != CRYPT_OK) { + goto LBL_ERR; + } + + pubkeysize = DH_BUF_SIZE; + if ((err = dh_export(pub_expt, &pubkeysize, PK_PUBLIC, &pubkey)) != CRYPT_OK) { + dh_free(&pubkey); + goto LBL_ERR; + } + + /* now check if the out buffer is big enough */ + if (*outlen < (1 + 4 + 4 + PACKET_SIZE + pubkeysize + inlen)) { + dh_free(&pubkey); + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_ERR; + } + + /* make random key */ + hashsize = hash_descriptor[hash].hashsize; + + x = DH_BUF_SIZE; + if ((err = dh_shared_secret(&pubkey, key, dh_shared, &x)) != CRYPT_OK) { + dh_free(&pubkey); + goto LBL_ERR; + } + dh_free(&pubkey); + + z = MAXBLOCKSIZE; + if ((err = hash_memory(hash, dh_shared, x, skey, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* store header */ + packet_store_header(out, PACKET_SECT_DH, PACKET_SUB_ENC_KEY); + + /* output header */ + y = PACKET_SIZE; + + /* size of hash name and the name itself */ + out[y++] = hash_descriptor[hash].ID; + + /* length of DH pubkey and the key itself */ + STORE32L(pubkeysize, out+y); + y += 4; + for (x = 0; x < pubkeysize; x++, y++) { + out[y] = pub_expt[x]; + } + + /* Store the encrypted key */ + STORE32L(inlen, out+y); + y += 4; + + for (x = 0; x < inlen; x++, y++) { + out[y] = skey[x] ^ in[x]; + } + *outlen = y; + + err = CRYPT_OK; +LBL_ERR: +#ifdef LTC_CLEAN_STACK + /* clean up */ + zeromem(pub_expt, DH_BUF_SIZE); + zeromem(dh_shared, DH_BUF_SIZE); + zeromem(skey, MAXBLOCKSIZE); +#endif + XFREE(skey); + XFREE(dh_shared); + XFREE(pub_expt); + + return err; +} + +/** + Decrypt a DH encrypted symmetric key + @param in The DH encrypted packet + @param inlen The length of the DH encrypted packet + @param out The plaintext + @param outlen [in/out] The max size and resulting size of the plaintext + @param key The private DH key corresponding to the public key that encrypted the plaintext + @return CRYPT_OK if successful +*/ +int dh_decrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + dh_key *key) +{ + unsigned char *shared_secret, *skey; + unsigned long x, y, z, hashsize, keysize; + int hash, err; + dh_key pubkey; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + + /* right key type? */ + if (key->type != PK_PRIVATE) { + return CRYPT_PK_NOT_PRIVATE; + } + + /* allocate ram */ + shared_secret = XMALLOC(DH_BUF_SIZE); + skey = XMALLOC(MAXBLOCKSIZE); + if (shared_secret == NULL || skey == NULL) { + if (shared_secret != NULL) { + XFREE(shared_secret); + } + if (skey != NULL) { + XFREE(skey); + } + return CRYPT_MEM; + } + + /* check if initial header should fit */ + if (inlen < PACKET_SIZE+1+4+4) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } else { + inlen -= PACKET_SIZE+1+4+4; + } + + /* is header correct? */ + if ((err = packet_valid_header((unsigned char *)in, PACKET_SECT_DH, PACKET_SUB_ENC_KEY)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* now lets get the hash name */ + y = PACKET_SIZE; + hash = find_hash_id(in[y++]); + if (hash == -1) { + err = CRYPT_INVALID_HASH; + goto LBL_ERR; + } + + /* common values */ + hashsize = hash_descriptor[hash].hashsize; + + /* get public key */ + LOAD32L(x, in+y); + + /* now check if the imported key will fit */ + if (inlen < x) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } else { + inlen -= x; + } + + y += 4; + if ((err = dh_import(in+y, x, &pubkey)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + + /* make shared key */ + x = DH_BUF_SIZE; + if ((err = dh_shared_secret(key, &pubkey, shared_secret, &x)) != CRYPT_OK) { + dh_free(&pubkey); + goto LBL_ERR; + } + dh_free(&pubkey); + + z = MAXBLOCKSIZE; + if ((err = hash_memory(hash, shared_secret, x, skey, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* load in the encrypted key */ + LOAD32L(keysize, in+y); + + /* will the out fit as part of the input */ + if (inlen < keysize) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } else { + inlen -= keysize; + } + + if (keysize > *outlen) { + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_ERR; + } + y += 4; + + *outlen = keysize; + + for (x = 0; x < keysize; x++, y++) { + out[x] = skey[x] ^ in[y]; + } + + err = CRYPT_OK; +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(shared_secret, DH_BUF_SIZE); + zeromem(skey, MAXBLOCKSIZE); +#endif + + XFREE(skey); + XFREE(shared_secret); + + return err; +} + +/* perform an ElGamal Signature of a hash + * + * The math works as follows. x is the private key, M is the message to sign + + 1. pick a random k + 2. compute a = g^k mod p + 3. compute b = (M - xa)/k mod p + 4. Send (a,b) + + Now to verify with y=g^x mod p, a and b + + 1. compute y^a * a^b = g^(xa) * g^(k*(M-xa)/k) + = g^(xa + (M - xa)) + = g^M [all mod p] + + 2. Compare against g^M mod p [based on input hash]. + 3. If result of #2 == result of #1 then signature valid +*/ + +/** + Sign a message digest using a DH private key + @param in The data to sign + @param inlen The length of the input (octets) + @param out [out] The destination of the signature + @param outlen [in/out] The max size and resulting size of the output + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param key A private DH key + @return CRYPT_OK if successful +*/ +int dh_sign_hash(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, dh_key *key) +{ + void *a, *b, *k, *m, *g, *p, *p1, *tmp; + unsigned char *buf; + unsigned long x, y; + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + + /* check parameters */ + if (key->type != PK_PRIVATE) { + return CRYPT_PK_NOT_PRIVATE; + } + + if ((err = prng_is_valid(wprng)) != CRYPT_OK) { + return err; + } + + /* is the IDX valid ? */ + if (is_valid_idx(key->idx) != 1) { + return CRYPT_PK_INVALID_TYPE; + } + + /* allocate ram for buf */ + buf = XMALLOC(520); + + /* make up a random value k, + * since the order of the group is prime + * we need not check if gcd(k, r) is 1 + */ + if (prng_descriptor[wprng].read(buf, sets[key->idx].size, prng) != + (unsigned long)(sets[key->idx].size)) { + err = CRYPT_ERROR_READPRNG; + goto LBL_ERR; + } + + /* init bignums */ + if ((err = mp_init_multi(&a, &b, &k, &m, &p, &g, &p1, &tmp, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* load k and m */ + if ((err = mp_read_unsigned_bin(m, (unsigned char *)in, inlen)) != CRYPT_OK) { goto error; } + if ((err = mp_read_unsigned_bin(k, buf, sets[key->idx].size)) != CRYPT_OK) { goto error; } + + /* load g, p and p1 */ + if ((err = mp_read_radix(g, sets[key->idx].base, 64)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, sets[key->idx].prime, 64)) != CRYPT_OK) { goto error; } + if ((err = mp_sub_d(p, 1, p1)) != CRYPT_OK) { goto error; } + if ((err = mp_div_2(p1, p1)) != CRYPT_OK) { goto error; } /* p1 = (p-1)/2 */ + + /* now get a = g^k mod p */ + if ((err = mp_exptmod(g, k, p, a)) != CRYPT_OK) { goto error; } + + /* now find M = xa + kb mod p1 or just b = (M - xa)/k mod p1 */ + if ((err = mp_invmod(k, p1, k)) != CRYPT_OK) { goto error; } /* k = 1/k mod p1 */ + if ((err = mp_mulmod(a, key->x, p1, tmp)) != CRYPT_OK) { goto error; } /* tmp = xa */ + if ((err = mp_submod(m, tmp, p1, tmp)) != CRYPT_OK) { goto error; } /* tmp = M - xa */ + if ((err = mp_mulmod(k, tmp, p1, b)) != CRYPT_OK) { goto error; } /* b = (M - xa)/k */ + + /* check for overflow */ + if ((unsigned long)(PACKET_SIZE + 4 + 4 + mp_unsigned_bin_size(a) + mp_unsigned_bin_size(b)) > *outlen) { + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_ERR; + } + + /* store header */ + y = PACKET_SIZE; + + /* now store them both (a,b) */ + x = (unsigned long)mp_unsigned_bin_size(a); + STORE32L(x, out+y); y += 4; + if ((err = mp_to_unsigned_bin(a, out+y)) != CRYPT_OK) { goto error; } + y += x; + + x = (unsigned long)mp_unsigned_bin_size(b); + STORE32L(x, out+y); y += 4; + if ((err = mp_to_unsigned_bin(b, out+y)) != CRYPT_OK) { goto error; } + y += x; + + /* check if size too big */ + if (*outlen < y) { + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_ERR; + } + + /* store header */ + packet_store_header(out, PACKET_SECT_DH, PACKET_SUB_SIGNED); + *outlen = y; + + err = CRYPT_OK; + goto LBL_ERR; +error: +LBL_ERR: + mp_clear_multi(tmp, p1, g, p, m, k, b, a, NULL); + + XFREE(buf); + + return err; +} + + +/** + Verify the signature given + @param sig The signature + @param siglen The length of the signature (octets) + @param hash The hash that was signed + @param hashlen The length of the hash (octets) + @param stat [out] Result of signature comparison, 1==valid, 0==invalid + @param key The public DH key that signed the hash + @return CRYPT_OK if succsessful (even if signature is invalid) +*/ +int dh_verify_hash(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, dh_key *key) +{ + void *a, *b, *p, *g, *m, *tmp; + unsigned long x, y; + int err; + + LTC_ARGCHK(sig != NULL); + LTC_ARGCHK(hash != NULL); + LTC_ARGCHK(stat != NULL); + LTC_ARGCHK(key != NULL); + + /* default to invalid */ + *stat = 0; + + /* check initial input length */ + if (siglen < PACKET_SIZE+4+4) { + return CRYPT_INVALID_PACKET; + } + + /* header ok? */ + if ((err = packet_valid_header((unsigned char *)sig, PACKET_SECT_DH, PACKET_SUB_SIGNED)) != CRYPT_OK) { + return err; + } + + /* get hash out of packet */ + y = PACKET_SIZE; + + /* init all bignums */ + if ((err = mp_init_multi(&a, &p, &b, &g, &m, &tmp, NULL)) != CRYPT_OK) { + return err; + } + + /* load a and b */ + INPUT_BIGNUM(a, sig, x, y, siglen); + INPUT_BIGNUM(b, sig, x, y, siglen); + + /* load p and g */ + if ((err = mp_read_radix(p, sets[key->idx].prime, 64)) != CRYPT_OK) { goto error1; } + if ((err = mp_read_radix(g, sets[key->idx].base, 64)) != CRYPT_OK) { goto error1; } + + /* load m */ + if ((err = mp_read_unsigned_bin(m, (unsigned char *)hash, hashlen)) != CRYPT_OK) { goto error1; } + + /* find g^m mod p */ + if ((err = mp_exptmod(g, m, p, m)) != CRYPT_OK) { goto error1; } /* m = g^m mod p */ + + /* find y^a * a^b */ + if ((err = mp_exptmod(key->y, a, p, tmp)) != CRYPT_OK) { goto error1; } /* tmp = y^a mod p */ + if ((err = mp_exptmod(a, b, p, a)) != CRYPT_OK) { goto error1; } /* a = a^b mod p */ + if ((err = mp_mulmod(a, tmp, p, a)) != CRYPT_OK) { goto error1; } /* a = y^a * a^b mod p */ + + /* y^a * a^b == g^m ??? */ + if (mp_cmp(a, m) == 0) { + *stat = 1; + } + + /* clean up */ + err = CRYPT_OK; + goto done; +error1: +error: +done: + mp_clear_multi(tmp, m, g, p, b, a, NULL); + return err; +} diff --git a/testprof/dh_test.c b/testprof/dh_test.c new file mode 100644 index 000000000..3428ef064 --- /dev/null +++ b/testprof/dh_test.c @@ -0,0 +1,122 @@ +#include + +#ifdef MDH + +#ifdef DH4096 +#define KEYSIZE 4096 +#else +#define KEYSIZE 2048 +#endif + +int dh_test (void) +{ + unsigned char buf[3][4096]; + unsigned long x, y, z; + int stat, stat2; + dh_key usera, userb; + prng_state yarrow_prng; + + if (register_prng(&yarrow_desc) == -1) { + printf("Error registering yarrow PRNG\n"); + exit(-1); + } + if (register_hash(&md5_desc) == -1) { + printf("Error registering md5 hash\n"); + exit(-1); + } + + DO(dh_compat_test()); + + + /* make up two keys */ + DO(dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &usera)); + DO(dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &userb)); + + /* make the shared secret */ + x = KEYSIZE; + DO(dh_shared_secret (&usera, &userb, buf[0], &x)); + + y = KEYSIZE; + DO(dh_shared_secret (&userb, &usera, buf[1], &y)); + if (y != x) { + fprintf(stderr, "DH Shared keys are not same size.\n"); + dh_free (&usera); + dh_free (&userb); + return 1; + } + if (memcmp (buf[0], buf[1], x)) { + fprintf(stderr, "DH Shared keys not same contents.\n"); + dh_free (&usera); + dh_free (&userb); + return 1; + } + + /* now export userb */ + y = KEYSIZE; + DO(dh_export (buf[1], &y, PK_PUBLIC, &userb)); + dh_free (&userb); + + /* import and make the shared secret again */ + DO(dh_import (buf[1], y, &userb)); + z = KEYSIZE; + DO(dh_shared_secret (&usera, &userb, buf[2], &z)); + + dh_free (&usera); + dh_free (&userb); + + if (z != x) { + fprintf(stderr, "failed. Size don't match?\n"); + return 1; + } + if (memcmp (buf[0], buf[2], x)) { + fprintf(stderr, "Failed. Content didn't match.\n"); + return 1; + } + +/* test encrypt_key */ + dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &usera); + for (x = 0; x < 16; x++) { + buf[0][x] = x; + } + y = sizeof (buf[1]); + DO(dh_encrypt_key (buf[0], 16, buf[1], &y, &yarrow_prng, find_prng ("yarrow"), find_hash ("md5"), &usera)); + zeromem (buf[0], sizeof (buf[0])); + x = sizeof (buf[0]); + DO(dh_decrypt_key (buf[1], y, buf[0], &x, &usera)); + if (x != 16) { + fprintf(stderr, "Failed (length)\n"); + dh_free (&usera); + return 1; + } + for (x = 0; x < 16; x++) + if (buf[0][x] != x) { + fprintf(stderr, "Failed (contents)\n"); + dh_free (&usera); + return 1; + } + +/* test sign_hash */ + for (x = 0; x < 16; x++) { + buf[0][x] = x; + } + x = sizeof (buf[1]); + DO(dh_sign_hash (buf[0], 16, buf[1], &x, &yarrow_prng, find_prng ("yarrow"), &usera)); + DO(dh_verify_hash (buf[1], x, buf[0], 16, &stat, &usera)); + buf[0][0] ^= 1; + DO(dh_verify_hash (buf[1], x, buf[0], 16, &stat2, &usera)); + dh_free (&usera); + if (!(stat == 1 && stat2 == 0)) { + fprintf(stderr, "dh_sign/verify_hash %d %d", stat, stat2); + return 1; + } + return 0; +} +#else + +int dh_test(void) +{ + fprintf(stderr, "NOP"); + return 0; +} + +#endif diff --git a/testprof/makefile b/testprof/makefile index 4cc70ff59..c52fe7bd7 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -7,7 +7,7 @@ endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o ifndef LIBTEST_S LIBTEST_S=libtomcrypt_prof.a diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 4ac0a97dd..cb2ad0114 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -32,6 +32,7 @@ int mac_test(void); int pkcs_1_test(void); int store_test(void); int rsa_test(void); +int dh_test(void); int katja_test(void); int ecc_tests(void); int dsa_test(void); From edf11c62c06da27bc8689efa8edf7a2075c054ff Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 18 Jan 2011 21:16:11 +0100 Subject: [PATCH 0013/1192] Diffie-Hellman/Math: introduced the proposed changes by Alexander Kurpiers addmod and submod are moved to the end of the math descriptor, in order to be able to run existing software against a new version of ltc without need to rebuild the software. --- src/headers/tomcrypt_math.h | 38 +++++++++++++++++++------------------ src/math/gmp_desc.c | 6 +++--- src/math/ltm_desc.c | 7 ++++--- src/math/tfm_desc.c | 6 +++--- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 8b58f2e46..caf6b5273 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -258,24 +258,6 @@ typedef struct { */ int (*lcm)(void *a, void *b, void *c); - /** Modular addition - @param a The first source - @param b The second source - @param c The modulus - @param d The destination (a + b mod c) - @return CRYPT_OK on success - */ - int (*addmod)(void *a, void *b, void *c, void *d); - - /** Modular substraction - @param a The first source - @param b The second source - @param c The modulus - @param d The destination (a - b mod c) - @return CRYPT_OK on success - */ - int (*submod)(void *a, void *b, void *c, void *d); - /** Modular multiplication @param a The first source @param b The second source @@ -429,6 +411,26 @@ typedef struct { int (*rsa_me)(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, int which, rsa_key *key); + +/* ---- basic math continued ---- */ + + /** Modular addition + @param a The first source + @param b The second source + @param c The modulus + @param d The destination (a + b mod c) + @return CRYPT_OK on success + */ + int (*addmod)(void *a, void *b, void *c, void *d); + + /** Modular substraction + @param a The first source + @param b The second source + @param c The modulus + @param d The destination (a - b mod c) + @return CRYPT_OK on success + */ + int (*submod)(void *a, void *b, void *c, void *d); } ltc_math_descriptor; extern ltc_math_descriptor ltc_mp; diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 3450e803f..beab976c6 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -449,8 +449,6 @@ const ltc_math_descriptor gmp_desc = { &gcd, &lcm, - &addmod, - &submod, &mulmod, &sqrmod, &invmod, @@ -489,8 +487,10 @@ const ltc_math_descriptor gmp_desc = { &rsa_make_key, &rsa_exptmod, #else - NULL, NULL + NULL, NULL, #endif + &addmod, + &submod, }; diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index bc5a142a9..8d61af4a8 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -451,8 +451,6 @@ const ltc_math_descriptor ltm_desc = { &gcd, &lcm, - &addmod, - &submod, &mulmod, &sqrmod, &invmod, @@ -491,8 +489,11 @@ const ltc_math_descriptor ltm_desc = { &rsa_make_key, &rsa_exptmod, #else - NULL, NULL + NULL, NULL, #endif + &addmod, + &submod, + }; diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index 111d1227d..82a735306 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -739,8 +739,6 @@ const ltc_math_descriptor tfm_desc = { &gcd, &lcm, - &addmod, - &submod, &mulmod, &sqrmod, &invmod, @@ -784,8 +782,10 @@ const ltc_math_descriptor tfm_desc = { &rsa_make_key, &rsa_exptmod, #else - NULL, NULL + NULL, NULL, #endif + &addmod, + &submod, }; From 4a8927d5c0792e97a20fdde4108ade8a7a9dc9d7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 19 Jan 2011 09:21:19 +0100 Subject: [PATCH 0014/1192] updated gitignore to ignore files generated when executing build.sh --- .gitignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index 418bd3d41..8865d0215 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,15 @@ # suppress compiler/linker output *.[oa] + +# suppress output of build process +gcc_[12].txt +testok.txt +test_*.txt +tv.txt +*_tv.txt + +# *nix/windows test executables +test +test.exe +tv_gen +tv_gen.exe From 412b2ee1fccc3a0df58f93f372c90d6d0f93bfc9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 19 Jan 2011 10:18:15 +0100 Subject: [PATCH 0015/1192] after multiple objections of libtom users [1], we decided to change licensing to a dual licensing model. [1] https://groups.google.com/group/libtom/browse_thread/thread/d7b67bc6410250b3 --- LICENSE | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/LICENSE b/LICENSE index 39a257d0f..c4afbc6b5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,17 @@ +LibTomCrypt is licensed under DUAL licensing terms. + +Choose and use the license of your needs. + +[LICENSE #1] + +LibTomCrypt is public domain. As should all quality software be. + +Tom St Denis + +[/LICENSE #1] + +[LICENSE #2] + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 @@ -11,3 +25,5 @@ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. + +[/LICENSE #2] From 5b1c0108c9c969d97093a711dfbeb0911a4c0e46 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 24 Jan 2011 10:41:30 +0100 Subject: [PATCH 0016/1192] updated gitignore and VS2008 project file --- .gitignore | 14 ++++++++++++++ libtomcrypt_VS2008.vcproj | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/.gitignore b/.gitignore index 8865d0215..4717323b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # suppress compiler/linker output *.[oa] +*.obj +[Dd]ebug/ # suppress output of build process gcc_[12].txt @@ -13,3 +15,15 @@ test test.exe tv_gen tv_gen.exe +timing +timing.exe + +# Visual Studio special files +# ignore user specific settings +*.user +*.suo +# ignore non-compressed browse file (holds information for ClassView, IntelliSense and WizardBar) +*.ncb +# ignore VS intermediate and program database files +*.idb +*.pdb diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 93f5d7d2c..b51b634ae 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -216,6 +216,10 @@ /> + + @@ -681,6 +685,10 @@ /> + + @@ -6938,6 +6946,14 @@ + + + + Date: Tue, 25 Jan 2011 11:27:28 +0100 Subject: [PATCH 0017/1192] updated gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4717323b4..88308fb82 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.[oa] *.obj [Dd]ebug/ +[Rr]elease/ # suppress output of build process gcc_[12].txt From ed6897d90f0f11d36ffa0917cbaba2f4a239b021 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 21 Mar 2011 08:26:27 +0100 Subject: [PATCH 0018/1192] DSA private keys are being exported to a compatible with OpenSSL and GnuTLS format. --- src/pk/dsa/dsa_export.c | 10 ++++++++-- src/pk/dsa/dsa_import.c | 30 ++++++++++++++---------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/pk/dsa/dsa_export.c b/src/pk/dsa/dsa_export.c index e4c450887..330683736 100644 --- a/src/pk/dsa/dsa_export.c +++ b/src/pk/dsa/dsa_export.c @@ -28,6 +28,7 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key) { unsigned char flags[1]; + unsigned long zero=0; LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); @@ -44,12 +45,17 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key flags[0] = (type != PK_PUBLIC) ? 1 : 0; + /* This encoding is different from the one in original + * libtomcrypt. It uses a compatible encoding with gnutls + * and openssl + */ + if (type == PK_PRIVATE) { return der_encode_sequence_multi(out, outlen, - LTC_ASN1_BIT_STRING, 1UL, flags, - LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_SHORT_INTEGER, 1UL, &zero, LTC_ASN1_INTEGER, 1UL, key->p, LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->g, LTC_ASN1_INTEGER, 1UL, key->y, LTC_ASN1_INTEGER, 1UL, key->x, LTC_ASN1_EOL, 0UL, NULL); diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 47a68ca07..d3e672f33 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -28,6 +28,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) { unsigned char flags[1]; int err; + unsigned long zero = 0; LTC_ARGCHK(in != NULL); LTC_ARGCHK(key != NULL); @@ -42,22 +43,19 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto error; - } - - if (flags[0] == 1) { - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_BIT_STRING, 1UL, flags, - LTC_ASN1_INTEGER, 1UL, key->g, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, - LTC_ASN1_INTEGER, 1UL, key->y, - LTC_ASN1_INTEGER, 1UL, key->x, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto error; - } - key->type = PK_PRIVATE; - } else { + /* private key */ + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &zero, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_INTEGER, 1UL, key->y, + LTC_ASN1_INTEGER, 1UL, key->x, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto error; + } + key->type = PK_PRIVATE; + } else { /* public */ if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_INTEGER, 1UL, key->g, From 8c2850f8d9217ee0c897a0d4c2244b0733399362 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 21 Mar 2011 08:26:41 +0100 Subject: [PATCH 0019/1192] Added RSA blinding (requires mp_rand()). --- src/pk/rsa/rsa_exptmod.c | 43 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 101a7660b..a05df6d36 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -7,6 +7,8 @@ * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + * + * Added RSA blinding --nmav */ #include "tomcrypt.h" @@ -31,7 +33,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, int which, rsa_key *key) { - void *tmp, *tmpa, *tmpb; + void *tmp, *tmpa, *tmpb, *rnd, *rndi /* inverse of rnd */; unsigned long x; int err; @@ -51,8 +53,11 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, } /* init and copy into tmp */ - if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, NULL)) != CRYPT_OK) { return err; } - if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto error; } + if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, &rnd, &rndi, NULL)) != CRYPT_OK) + { return err; } + if ((err = mp_read_unsigned_bin(&tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) + { goto error; } + /* sanity check on the input */ if (mp_cmp(key->N, tmp) == LTC_MP_LT) { @@ -62,6 +67,30 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, /* are we using the private exponent and is the key optimized? */ if (which == PK_PRIVATE) { + /* do blinding */ + err = mp_rand(rnd, mp_count_bits(key->N)); + if (err != CRYPT_OK) { + goto error; + } + + /* rndi = 1/rnd mod N */ + err = mp_invmod(rnd, key->N, rndi); + if (err != CRYPT_OK) { + goto error; + } + + /* rnd = rnd^e */ + err = mp_exptmod( rnd, key->e, key->N, rnd); + if (err != CRYPT_OK) { + goto error; + } + + /* tmp = tmp*rnd mod N */ + err = mp_mulmod( tmp, rnd, key->N, tmp); + if (err != CRYPT_OK) { + goto error; + } + /* tmpa = tmp^dP mod p */ if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto error; } @@ -75,6 +104,12 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, /* tmp = tmpb + q * tmp */ if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { goto error; } if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { goto error; } + + /* unblind */ + err = mp_mulmod( tmp, rndi, key->N, tmp); + if (err != CRYPT_OK) { + goto error; + } } else { /* exptmod it */ if ((err = mp_exptmod(tmp, key->e, key->N, tmp)) != CRYPT_OK) { goto error; } @@ -102,7 +137,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, /* clean up and return */ err = CRYPT_OK; error: - mp_clear_multi(tmp, tmpa, tmpb, NULL); + mp_clear_multi(tmp, tmpa, tmpb, rnd, rndi, NULL); return err; } From fa22e791d4b0bda5f68b45f51d5f781b43ee81a4 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 21 Mar 2011 19:24:10 +0100 Subject: [PATCH 0020/1192] RSA and DSA public keys are stored using the SubjectPublicKeyInfo format. --- makefile | 4 + src/headers/tomcrypt_pk.h | 29 ++++- src/misc/pk_get_oid.c | 39 +++++++ .../asn1/der/bit/der_decode_raw_bit_string.c | 106 ++++++++++++++++++ .../asn1/der/bit/der_encode_raw_bit_string.c | 92 +++++++++++++++ .../der/sequence/der_decode_sequence_ex.c | 12 ++ .../der_decode_subject_public_key_info.c | 95 ++++++++++++++++ .../der/sequence/der_encode_sequence_ex.c | 10 ++ .../der_encode_subject_public_key_info.c | 69 ++++++++++++ src/pk/dsa/dsa_export.c | 40 +++++-- src/pk/dsa/dsa_import.c | 48 +++++--- src/pk/rsa/rsa_export.c | 26 ++++- src/pk/rsa/rsa_import.c | 42 ++----- 13 files changed, 551 insertions(+), 61 deletions(-) create mode 100644 src/misc/pk_get_oid.c create mode 100644 src/pk/asn1/der/bit/der_decode_raw_bit_string.c create mode 100644 src/pk/asn1/der/bit/der_encode_raw_bit_string.c create mode 100644 src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c create mode 100644 src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c diff --git a/makefile b/makefile index 15b99fedd..901a3ef23 100644 --- a/makefile +++ b/makefile @@ -143,6 +143,7 @@ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ +src/misc/pk_get_oid.o \ src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ @@ -173,6 +174,7 @@ src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o src/modes/xts/xts_test.o \ src/pk/asn1/der/bit/der_decode_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ src/pk/asn1/der/bit/der_length_bit_string.o src/pk/asn1/der/boolean/der_decode_boolean.o \ +src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_raw_bit_string.o \ src/pk/asn1/der/boolean/der_encode_boolean.o src/pk/asn1/der/boolean/der_length_boolean.o \ src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \ src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \ @@ -186,6 +188,8 @@ src/pk/asn1/der/octet/der_length_octet_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ +src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 83757fbc8..69f867f67 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -7,6 +7,19 @@ enum { int rand_prime(void *N, long len, prng_state *prng, int wprng); +enum { + PKA_RSA, + PKA_DSA +}; + +typedef struct Oid { + unsigned long OID[16]; + /** Length of DER encoding */ + unsigned long OIDlen; +} oid_st; + +int pk_get_oid(int pk, oid_st *st); + /* ---- RSA ---- */ #ifdef LTC_MRSA @@ -429,7 +442,8 @@ enum { LTC_ASN1_CHOICE, LTC_ASN1_SEQUENCE, LTC_ASN1_SET, - LTC_ASN1_SETOF + LTC_ASN1_SETOF, + LTC_ASN1_RAW_BIT_STRING, }; /** A LTC ASN.1 list type */ @@ -470,6 +484,15 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, unsigned long *outlen); +/* SUBJECT PUBLIC KEY INFO */ +int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen, + unsigned int algorithm, void* public_key, unsigned long public_key_len, + unsigned long parameters_type, void* parameters, unsigned long parameters_len); + +int der_decode_subject_public_key_info(const unsigned char *in, unsigned long inlen, + unsigned int algorithm, void* public_key, unsigned long* public_key_len, + unsigned long parameters_type, ltc_asn1_list* parameters, unsigned long parameters_len); + /* SET */ #define der_decode_set(in, inlen, list, outlen) der_decode_sequence_ex(in, inlen, list, outlen, 0) #define der_length_set der_length_sequence @@ -509,6 +532,10 @@ int der_encode_bit_string(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); int der_decode_bit_string(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); +int der_encode_raw_bit_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); int der_length_bit_string(unsigned long nbits, unsigned long *outlen); /* OCTET STRING */ diff --git a/src/misc/pk_get_oid.c b/src/misc/pk_get_oid.c new file mode 100644 index 000000000..d13266eb1 --- /dev/null +++ b/src/misc/pk_get_oid.c @@ -0,0 +1,39 @@ +/* LibTomCrypt, modular cryptographic library + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + */ +#include "tomcrypt.h" + +static const oid_st rsa_oid = { + .OIDlen = 7, + .OID = { 1, 2, 840, 113549, 1, 1, 1 }, +}; + +static const oid_st dsa_oid = { + .OIDlen = 6, + .OID = { 1, 2, 840, 10040, 4, 1 }, +}; + +/* + Returns the OID of the public key algorithm. + @return CRYPT_OK if valid +*/ +int pk_get_oid(int pk, oid_st *st) +{ + switch (pk) { + case PKA_RSA: + memcpy(st, &rsa_oid, sizeof(*st)); + break; + case PKA_DSA: + memcpy(st, &dsa_oid, sizeof(*st)); + break; + default: + return CRYPT_INVALID_ARG; + } + return CRYPT_OK; +} diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c new file mode 100644 index 000000000..80103c70c --- /dev/null +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -0,0 +1,106 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file der_decode_bit_string.c + ASN.1 DER, encode a BIT STRING, Tom St Denis +*/ + + +#ifdef LTC_DER + +#define setbit(v, n) (v=((unsigned char)(v) | (1U << (unsigned char)(n)))) + +/** + Store a BIT STRING + @param in The DER encoded BIT STRING + @param inlen The size of the DER BIT STRING + @param out [out] The array of bits stored (8 per char) + @param outlen [in/out] The number of bits stored + @return CRYPT_OK if successful +*/ +int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + unsigned long dlen, blen, x, y; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* packet must be at least 4 bytes */ + if (inlen < 4) { + return CRYPT_INVALID_ARG; + } + + /* check for 0x03 */ + if ((in[0]&0x1F) != 0x03) { + return CRYPT_INVALID_PACKET; + } + + /* offset in the data */ + x = 1; + + /* get the length of the data */ + if (in[x] & 0x80) { + /* long format get number of length bytes */ + y = in[x++] & 0x7F; + + /* invalid if 0 or > 2 */ + if (y == 0 || y > 2) { + return CRYPT_INVALID_PACKET; + } + + /* read the data len */ + dlen = 0; + while (y--) { + dlen = (dlen << 8) | (unsigned long)in[x++]; + } + } else { + /* short format */ + dlen = in[x++] & 0x7F; + } + + /* is the data len too long or too short? */ + if ((dlen == 0) || (dlen + x > inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* get padding count */ + blen = ((dlen - 1) << 3) - (in[x++] & 7); + + /* too many bits? */ + if (blen > *outlen) { + *outlen = blen; + return CRYPT_BUFFER_OVERFLOW; + } + + /* decode/store the bits */ + for (y = 0; y < blen; y++) { + if (in[x] & (1 << (7 - (y & 7)))) { + setbit(out[y/8], 7-(y%8)); + } + if ((y & 7) == 7) { + ++x; + } + } + + /* we done */ + *outlen = blen; + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/bit/der_decode_bit_string.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c new file mode 100644 index 000000000..1fafc12c8 --- /dev/null +++ b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c @@ -0,0 +1,92 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file der_encode_bit_string.c + ASN.1 DER, encode a BIT STRING, Tom St Denis +*/ + + +#ifdef LTC_DER + +#define getbit(n, k) (((n) & ( 1 << (k) )) >> (k)) + +/** + Store a BIT STRING + @param in The array of bits to store (8 per char) + @param inlen The number of bits tostore + @param out [out] The destination for the DER encoded BIT STRING + @param outlen [in/out] The max size and resulting size of the DER BIT STRING + @return CRYPT_OK if successful +*/ +int der_encode_raw_bit_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + unsigned long len, x, y; + unsigned char buf; + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* avoid overflows */ + if ((err = der_length_bit_string(inlen, &len)) != CRYPT_OK) { + return err; + } + + if (len > *outlen) { + *outlen = len; + return CRYPT_BUFFER_OVERFLOW; + } + + /* store header (include bit padding count in length) */ + x = 0; + y = (inlen >> 3) + ((inlen&7) ? 1 : 0) + 1; + + out[x++] = 0x03; + if (y < 128) { + out[x++] = (unsigned char)y; + } else if (y < 256) { + out[x++] = 0x81; + out[x++] = (unsigned char)y; + } else if (y < 65536) { + out[x++] = 0x82; + out[x++] = (unsigned char)((y>>8)&255); + out[x++] = (unsigned char)(y&255); + } + + /* store number of zero padding bits */ + out[x++] = (unsigned char)((8 - inlen) & 7); + + /* store the bits in big endian format */ + for (y = buf = 0; y < inlen; y++) { + buf |= (getbit(in[y/8],7-y%8)?1:0) << (7 - (y & 7)); + if ((y & 7) == 7) { + out[x++] = buf; + buf = 0; + } + } + /* store last byte */ + if (inlen & 7) { + out[x++] = buf; + } + + *outlen = x; + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/bit/der_encode_bit_string.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 67ca2a05d..8dd29ab88 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -139,6 +139,18 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } break; + case LTC_ASN1_RAW_BIT_STRING: + z = inlen; + if ((err = der_decode_raw_bit_string(in + x, z, data, &size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + list[i].size = size; + if ((err = der_length_bit_string(size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + case LTC_ASN1_OCTET_STRING: z = inlen; if ((err = der_decode_octet_string(in + x, z, data, &size)) != CRYPT_OK) { diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c new file mode 100644 index 000000000..16c98979a --- /dev/null +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -0,0 +1,95 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + */ +#include "tomcrypt.h" +/** + @file der_encode_sequence_multi.c + ASN.1 DER, encode a Subject Public Key structure --nmav +*/ + +#ifdef LTC_DER + +/* AlgorithmIdentifier := SEQUENCE { + * algorithm OBJECT IDENTIFIER, + * parameters ANY DEFINED BY algorithm + * } + * + * SubjectPublicKeyInfo := SEQUENCE { + * algorithm AlgorithmIdentifier, + * subjectPublicKey BIT STRING + * } + */ +/** + Encode a SEQUENCE type using a VA list + @param out [out] Destination for data + @param outlen [in/out] Length of buffer and resulting length of output + @remark <...> is of the form (int, unsigned long, void*) + @return CRYPT_OK on success +*/ +int der_decode_subject_public_key_info(const unsigned char *in, unsigned long inlen, + unsigned int algorithm, void* public_key, unsigned long* public_key_len, + unsigned long parameters_type, ltc_asn1_list* parameters, unsigned long parameters_len) +{ + int err, len; + oid_st oid; + unsigned char *tmpbuf; + unsigned long tmpoid[16]; + ltc_asn1_list alg_id[2]; + ltc_asn1_list subject_pubkey[2]; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen != 0); + + err = pk_get_oid(algorithm, &oid); + if (err != CRYPT_OK) { + return err; + } + + /* see if the OpenSSL DER format RSA public key will work */ + tmpbuf = XCALLOC(1, MAX_RSA_SIZE*8); + if (tmpbuf == NULL) { + err = CRYPT_MEM; + goto LBL_ERR; + } + + /* this includes the internal hash ID and optional params (NULL in this case) */ + LTC_SET_ASN1(alg_id, 0, LTC_ASN1_OBJECT_IDENTIFIER, tmpoid, sizeof(tmpoid)/sizeof(tmpoid[0])); + LTC_SET_ASN1(alg_id, 1, parameters_type, parameters, parameters_len); + + /* the actual format of the SSL DER key is odd, it stores a RSAPublicKey in a **BIT** string ... so we have to extract it + then proceed to convert bit to octet + */ + LTC_SET_ASN1(subject_pubkey, 0, LTC_ASN1_SEQUENCE, alg_id, 2); + LTC_SET_ASN1(subject_pubkey, 1, LTC_ASN1_RAW_BIT_STRING, tmpbuf, MAX_RSA_SIZE*8); + + err=der_decode_sequence(in, inlen, subject_pubkey, 2UL); + if (err != CRYPT_OK) { + goto LBL_ERR; + } + + len = subject_pubkey[1].size/8; + if (*public_key_len > len) { + memcpy(public_key, subject_pubkey[1].data, len); + *public_key_len = len; + } else { + *public_key_len = len; + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_ERR; + } + + err = CRYPT_OK; + +LBL_ERR: + + XFREE(tmpbuf); + + return err; +} + +#endif diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index e92f7c310..9c34053f4 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -73,6 +73,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, break; case LTC_ASN1_BIT_STRING: + case LTC_ASN1_RAW_BIT_STRING: if ((err = der_length_bit_string(size, &x)) != CRYPT_OK) { goto LBL_ERR; } @@ -233,6 +234,15 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, *outlen -= z; break; + case LTC_ASN1_RAW_BIT_STRING: + z = *outlen; + if ((err = der_encode_raw_bit_string(data, size, out + x, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + x += z; + *outlen -= z; + break; + case LTC_ASN1_OCTET_STRING: z = *outlen; if ((err = der_encode_octet_string(data, size, out + x, &z)) != CRYPT_OK) { diff --git a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c new file mode 100644 index 000000000..6c1442f18 --- /dev/null +++ b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c @@ -0,0 +1,69 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + */ +#include "tomcrypt.h" + +/** + @file der_encode_sequence_multi.c + ASN.1 DER, encode a Subject Public Key structure --nmav +*/ + +#ifdef LTC_DER + +/* AlgorithmIdentifier := SEQUENCE { + * algorithm OBJECT IDENTIFIER, + * parameters ANY DEFINED BY algorithm + * } + * + * SubjectPublicKeyInfo := SEQUENCE { + * algorithm AlgorithmIdentifier, + * subjectPublicKey BIT STRING + * } + */ +/** + Encode a SEQUENCE type using a VA list + @param out [out] Destination for data + @param outlen [in/out] Length of buffer and resulting length of output + @remark <...> is of the form (int, unsigned long, void*) + @return CRYPT_OK on success +*/ +int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen, + unsigned int algorithm, void* public_key, unsigned long public_key_len, + unsigned long parameters_type, void* parameters, unsigned long parameters_len) +{ + int err; + ltc_asn1_list alg_id[2]; + oid_st oid; + + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + err = pk_get_oid(algorithm, &oid); + if (err != CRYPT_OK) { + return err; + } + + alg_id[0].data = oid.OID; + alg_id[0].size = oid.OIDlen; + alg_id[0].type = LTC_ASN1_OBJECT_IDENTIFIER; + + alg_id[1].data = parameters; + alg_id[1].size = parameters_len; + alg_id[1].type = parameters_type; + + return der_encode_sequence_multi(out, outlen, + LTC_ASN1_SEQUENCE, (unsigned long)sizeof(alg_id)/sizeof(alg_id[0]), alg_id, + LTC_ASN1_RAW_BIT_STRING, (unsigned long)(public_key_len*8), public_key, + LTC_ASN1_EOL, 0UL, NULL); + +} + +#endif + + diff --git a/src/pk/dsa/dsa_export.c b/src/pk/dsa/dsa_export.c index 330683736..582e63bb7 100644 --- a/src/pk/dsa/dsa_export.c +++ b/src/pk/dsa/dsa_export.c @@ -29,6 +29,7 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key { unsigned char flags[1]; unsigned long zero=0; + int err; LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); @@ -43,8 +44,6 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key return CRYPT_INVALID_ARG; } - flags[0] = (type != PK_PUBLIC) ? 1 : 0; - /* This encoding is different from the one in original * libtomcrypt. It uses a compatible encoding with gnutls * and openssl @@ -60,13 +59,36 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key LTC_ASN1_INTEGER, 1UL, key->x, LTC_ASN1_EOL, 0UL, NULL); } else { - return der_encode_sequence_multi(out, outlen, - LTC_ASN1_BIT_STRING, 1UL, flags, - LTC_ASN1_INTEGER, 1UL, key->g, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, - LTC_ASN1_INTEGER, 1UL, key->y, - LTC_ASN1_EOL, 0UL, NULL); + unsigned long tmplen = (mp_count_bits(key->y)/8)+8; + unsigned char* tmp = XMALLOC(tmplen); + ltc_asn1_list int_list[3]; + + if (tmp == NULL) { + return CRYPT_MEM; + } + + err = der_encode_integer(key->y, tmp, &tmplen); + if (err != CRYPT_OK) { + goto error; + } + + int_list[0].data = key->p; + int_list[0].size = 1UL; + int_list[0].type = LTC_ASN1_INTEGER; + int_list[1].data = key->q; + int_list[1].size = 1UL; + int_list[1].type = LTC_ASN1_INTEGER; + int_list[2].data = key->g; + int_list[2].size = 1UL; + int_list[2].type = LTC_ASN1_INTEGER; + + err = der_encode_subject_public_key_info(out, outlen, + PKA_DSA, tmp, tmplen, + LTC_ASN1_SEQUENCE, int_list, sizeof(int_list)/sizeof(int_list[0])); + +error: + XFREE(tmp); + return err; } } diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index d3e672f33..c43c40a84 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -26,9 +26,9 @@ */ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) { - unsigned char flags[1]; int err; unsigned long zero = 0; + unsigned char* tmpbuf = NULL; LTC_ARGCHK(in != NULL); LTC_ARGCHK(key != NULL); @@ -41,30 +41,41 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) /* get key type */ if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_BIT_STRING, 1UL, flags, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - /* private key */ - if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_SHORT_INTEGER, 1UL, &zero, LTC_ASN1_INTEGER, 1UL, key->p, LTC_ASN1_INTEGER, 1UL, key->q, LTC_ASN1_INTEGER, 1UL, key->g, LTC_ASN1_INTEGER, 1UL, key->y, LTC_ASN1_INTEGER, 1UL, key->x, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto error; - } + LTC_ASN1_EOL, 0UL, NULL)) == CRYPT_OK) { + key->type = PK_PRIVATE; } else { /* public */ - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_BIT_STRING, 1UL, flags, - LTC_ASN1_INTEGER, 1UL, key->g, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, - LTC_ASN1_INTEGER, 1UL, key->y, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto error; + ltc_asn1_list params[3]; + unsigned long tmpbuf_len = MAX_RSA_SIZE*8; + + LTC_SET_ASN1(params, 0, LTC_ASN1_INTEGER, key->p, 1UL); + LTC_SET_ASN1(params, 1, LTC_ASN1_INTEGER, key->q, 1UL); + LTC_SET_ASN1(params, 2, LTC_ASN1_INTEGER, key->g, 1UL); + + tmpbuf = XCALLOC(1, tmpbuf_len); + if (tmpbuf == NULL) { + err = CRYPT_MEM; + goto LBL_ERR; + } + + err = der_decode_subject_public_key_info(in, inlen, + PKA_DSA, tmpbuf, &tmpbuf_len, + LTC_ASN1_SEQUENCE, params, 3); + if (err != CRYPT_OK) { + goto LBL_ERR; + } + + if ((err=der_decode_integer(tmpbuf, tmpbuf_len, key->y)) != CRYPT_OK) { + goto LBL_ERR; } + + XFREE(tmpbuf); key->type = PK_PUBLIC; } key->qord = mp_unsigned_bin_size(key->q); @@ -72,11 +83,12 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { err = CRYPT_INVALID_PACKET; - goto error; + goto LBL_ERR; } return CRYPT_OK; -error: +LBL_ERR: + XFREE(tmpbuf); mp_clear_multi(key->p, key->g, key->q, key->x, key->y, NULL); return err; } diff --git a/src/pk/rsa/rsa_export.c b/src/pk/rsa/rsa_export.c index 40cb06608..f7a1ce387 100644 --- a/src/pk/rsa/rsa_export.c +++ b/src/pk/rsa/rsa_export.c @@ -28,6 +28,7 @@ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key) { unsigned long zero=0; + int err; LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); @@ -55,10 +56,29 @@ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key LTC_ASN1_EOL, 0UL, NULL); } else { /* public key */ - return der_encode_sequence_multi(out, outlen, - LTC_ASN1_INTEGER, 1UL, key->N, - LTC_ASN1_INTEGER, 1UL, key->e, + unsigned long tmplen = (mp_count_bits(key->N)/8)*2+8; + unsigned char* tmp = XMALLOC(tmplen); + + if (tmp == NULL) { + return CRYPT_MEM; + } + + err = der_encode_sequence_multi(tmp, &tmplen, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->e, LTC_ASN1_EOL, 0UL, NULL); + + if (err != CRYPT_OK) { + goto error; + } + + err = der_encode_subject_public_key_info(out, outlen, + PKA_RSA, tmp, tmplen, LTC_ASN1_NULL, NULL, 0); + +error: + XFREE(tmp); + return err; + } } diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index 85c676ba3..9e3928b13 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -28,10 +28,8 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) { int err; void *zero; - unsigned char *tmpbuf; - unsigned long t, x, y, z, tmpoid[16]; - ltc_asn1_list ssl_pubkey_hashoid[2]; - ltc_asn1_list ssl_pubkey[2]; + unsigned char *tmpbuf=NULL; + unsigned long tmpbuf_len; LTC_ARGCHK(in != NULL); LTC_ARGCHK(key != NULL); @@ -44,41 +42,24 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) } /* see if the OpenSSL DER format RSA public key will work */ - tmpbuf = XCALLOC(1, MAX_RSA_SIZE*8); + tmpbuf_len = MAX_RSA_SIZE * 8; + tmpbuf = XCALLOC(1, tmpbuf_len); if (tmpbuf == NULL) { err = CRYPT_MEM; goto LBL_ERR; } - /* this includes the internal hash ID and optional params (NULL in this case) */ - LTC_SET_ASN1(ssl_pubkey_hashoid, 0, LTC_ASN1_OBJECT_IDENTIFIER, tmpoid, sizeof(tmpoid)/sizeof(tmpoid[0])); - LTC_SET_ASN1(ssl_pubkey_hashoid, 1, LTC_ASN1_NULL, NULL, 0); + err = der_decode_subject_public_key_info(in, inlen, + PKA_RSA, tmpbuf, &tmpbuf_len, + LTC_ASN1_NULL, NULL, 0); - /* the actual format of the SSL DER key is odd, it stores a RSAPublicKey in a **BIT** string ... so we have to extract it - then proceed to convert bit to octet - */ - LTC_SET_ASN1(ssl_pubkey, 0, LTC_ASN1_SEQUENCE, &ssl_pubkey_hashoid, 2); - LTC_SET_ASN1(ssl_pubkey, 1, LTC_ASN1_BIT_STRING, tmpbuf, MAX_RSA_SIZE*8); - - if (der_decode_sequence(in, inlen, - ssl_pubkey, 2UL) == CRYPT_OK) { - - /* ok now we have to reassemble the BIT STRING to an OCTET STRING. Thanks OpenSSL... */ - for (t = y = z = x = 0; x < ssl_pubkey[1].size; x++) { - y = (y << 1) | tmpbuf[x]; - if (++z == 8) { - tmpbuf[t++] = (unsigned char)y; - y = 0; - z = 0; - } - } + if (err == CRYPT_OK) { /* SubjectPublicKeyInfo format */ /* now it should be SEQUENCE { INTEGER, INTEGER } */ - if ((err = der_decode_sequence_multi(tmpbuf, t, - LTC_ASN1_INTEGER, 1UL, key->N, - LTC_ASN1_INTEGER, 1UL, key->e, + if ((err = der_decode_sequence_multi(tmpbuf, tmpbuf_len, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->e, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - XFREE(tmpbuf); goto LBL_ERR; } XFREE(tmpbuf); @@ -131,6 +112,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) } return CRYPT_OK; LBL_ERR: + XFREE(tmpbuf); mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); return err; } From 43c6b5ab89ec5b71c333e4abf66f2a31c0ca83b5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 21 Mar 2011 21:10:23 +0100 Subject: [PATCH 0021/1192] make build.sh less verbose when test fails --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index a04867042..0a012f5a4 100644 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ echo -n "building..." CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j4 -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt || (echo "build $1 failed see gcc_2.txt for more information" && cat gcc_2.txt && exit 1) echo -n "testing..." if [ -a test ] && [ -f test ] && [ -x test ]; then - ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed" && cat test_err.txt && exit 1) + ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1) if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then for f in *_tv.txt; do if (diff --ignore-case $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done fi From 25bd5c1275ee51bca83b5ef7d507cd037283b070 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 21 Mar 2011 21:12:46 +0100 Subject: [PATCH 0022/1192] added missing handling of new type LTC_ASN1_RAW_BIT_STRING in der_encode_sequence_multi() --- src/pk/asn1/der/sequence/der_encode_sequence_multi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index 659f029a3..635384821 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -64,6 +64,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) case LTC_ASN1_SEQUENCE: case LTC_ASN1_SET: case LTC_ASN1_SETOF: + case LTC_ASN1_RAW_BIT_STRING: ++x; break; @@ -111,6 +112,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) case LTC_ASN1_SEQUENCE: case LTC_ASN1_SET: case LTC_ASN1_SETOF: + case LTC_ASN1_RAW_BIT_STRING: list[x].type = type; list[x].size = size; list[x++].data = data; From 496453f28920c6f5d657173ed8028d3a73fd5115 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 21 Mar 2011 21:17:31 +0100 Subject: [PATCH 0023/1192] removed testing of "stripped" rsa key --- testprof/rsa_test.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index dcd25e33f..2ffcd3316 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -61,18 +61,6 @@ static const unsigned char openssl_public_rsa[] = { 0x60, 0x3f, 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x94, 0xa4, 0x44, 0xfd, 0x02, 0x03, 0x01, 0x00, 0x01, }; -/* same key but with extra headers stripped */ -static const unsigned char openssl_public_rsa_stripped[] = { - 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xcf, 0x9a, 0xde, - 0x64, 0x8a, 0xda, 0xc8, 0x33, 0x20, 0xa9, 0xd7, 0x83, 0x31, 0x19, 0x54, 0xb2, 0x9a, 0x85, 0xa7, - 0xa1, 0xb7, 0x75, 0x33, 0xb6, 0xa9, 0xac, 0x84, 0x24, 0xb3, 0xde, 0xdb, 0x7d, 0x85, 0x2d, 0x96, - 0x65, 0xe5, 0x3f, 0x72, 0x95, 0x24, 0x9f, 0x28, 0x68, 0xca, 0x4f, 0xdb, 0x44, 0x1c, 0x3e, 0x60, - 0x12, 0x8a, 0xdd, 0x26, 0xa5, 0xeb, 0xff, 0x0b, 0x5e, 0xd4, 0x88, 0x38, 0x49, 0x2a, 0x6e, 0x5b, - 0xbf, 0x12, 0x37, 0x47, 0xbd, 0x05, 0x6b, 0xbc, 0xdb, 0xf3, 0xee, 0xe4, 0x11, 0x8e, 0x41, 0x68, - 0x7c, 0x61, 0x13, 0xd7, 0x42, 0xc8, 0x80, 0xbe, 0x36, 0x8f, 0xdc, 0x08, 0x8b, 0x4f, 0xac, 0xa4, - 0xe2, 0x76, 0x0c, 0xc9, 0x63, 0x6c, 0x49, 0x58, 0x93, 0xed, 0xcc, 0xaa, 0xdc, 0x25, 0x3b, 0x0a, - 0x60, 0x3f, 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x94, 0xa4, 0x44, 0xfd, 0x02, 0x03, 0x01, - 0x00, 0x01, }; static int rsa_compat_test(void) { @@ -93,27 +81,17 @@ static int rsa_compat_test(void) len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { + if (len != sizeof(openssl_public_rsa) || memcmp(buf, openssl_public_rsa, len)) { fprintf(stderr, "RSA(private) public export failed to match OpenSSL output\n"); return 1; } rsa_free(&key); - /* try reading the public key */ - DO(rsa_import(openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), &key)); - len = sizeof(buf); - DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { - fprintf(stderr, "RSA(public) stripped public import failed to match OpenSSL output\n"); - return 1; - } - rsa_free(&key); - /* try reading the public key */ DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { + if (len != sizeof(openssl_public_rsa) || memcmp(buf, openssl_public_rsa, len)) { fprintf(stderr, "RSA(public) SSL public import failed to match OpenSSL output\n"); return 1; } From 380693edd909e5e01a6fcb27f62f6d3970b5457c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 21 Mar 2011 21:17:59 +0100 Subject: [PATCH 0024/1192] fixed error causing segmentation fault --- src/pk/rsa/rsa_exptmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index a05df6d36..f1233985b 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -55,7 +55,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, /* init and copy into tmp */ if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, &rnd, &rndi, NULL)) != CRYPT_OK) { return err; } - if ((err = mp_read_unsigned_bin(&tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) + if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto error; } From 8dc8a2d55188325573ef72e51ca282d943712d3c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 21 Mar 2011 22:50:49 +0100 Subject: [PATCH 0025/1192] Added define LTC_RSA_BLINDING to be able to disable rsa blinding --- src/headers/tomcrypt_custom.h | 12 ++++++-- src/headers/tomcrypt_math.h | 11 +++++++ src/math/gmp_desc.c | 9 ++++++ src/math/ltm_desc.c | 10 ++++++- src/math/tfm_desc.c | 2 ++ src/pk/rsa/rsa_exptmod.c | 55 ++++++++++++++++++++++------------- 6 files changed, 75 insertions(+), 24 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index cfd4a79c5..362403bc1 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -289,10 +289,10 @@ #ifndef LTC_NO_MATH /* LibTomMath */ -/* #define LTM_LTC_DESC */ +/* #define LTM_DESC */ /* TomsFastMath */ -/* #define TFM_LTC_DESC */ +/* #define TFM_DESC */ #endif /* LTC_NO_MATH */ @@ -302,6 +302,9 @@ /* Include RSA support */ #define LTC_MRSA +/* Enable RSA blinding when doing private key operations? */ +/* #define LTC_RSA_BLINDING */ + /* Include Diffie-Hellman support */ #ifndef GPM_DESC /* is_prime fails for GPM */ @@ -382,6 +385,11 @@ #define LTC_PKCS_1 #endif +#if defined(TFM_DESC) && defined(LTC_RSA_BLINDING) + #warning RSA blinding currently not supported in combination with TFM + #undef LTC_RSA_BLINDING +#endif + #if defined(LTC_DER) && !defined(MPI) #error ASN.1 DER requires MPI functionality #endif diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index caf6b5273..3158c4ae8 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -431,6 +431,15 @@ typedef struct { @return CRYPT_OK on success */ int (*submod)(void *a, void *b, void *c, void *d); + +/* ---- misc stuff ---- */ + /** Make a pseudo-random mpi + @param a The mpi to make random + @param size The desired length + @return CRYPT_OK on success + */ + int (*rand)(void *a, int size); + } ltc_math_descriptor; extern ltc_math_descriptor ltc_mp; @@ -515,6 +524,8 @@ extern const ltc_math_descriptor gmp_desc; #define mp_tohex(a, b) mp_toradix(a, b, 16) +#define mp_rand(a, b) ltc_mp.rand(a, b) + #endif /* $Source$ */ diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index beab976c6..9d7ff0729 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -409,6 +409,13 @@ static int isprime(void *a, int *b) return CRYPT_OK; } +static int set_rand(void *a, int size) +{ + LTC_ARGCHK(a != NULL); + mpz_random(a, size); + return CRYPT_OK; +} + const ltc_math_descriptor gmp_desc = { "GNU MP", sizeof(mp_limb_t) * CHAR_BIT - GMP_NAIL_BITS, @@ -492,6 +499,8 @@ const ltc_math_descriptor gmp_desc = { &addmod, &submod, + &set_rand, + }; diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index 8d61af4a8..2945a4749 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -408,7 +408,13 @@ static int isprime(void *a, int *b) err = mpi_to_ltc_error(mp_prime_is_prime(a, 8, b)); *b = (*b == MP_YES) ? LTC_MP_YES : LTC_MP_NO; return err; -} +} + +static int set_rand(void *a, int size) +{ + LTC_ARGCHK(a != NULL); + return mpi_to_ltc_error(mp_rand(a, size)); +} const ltc_math_descriptor ltm_desc = { @@ -494,6 +500,8 @@ const ltc_math_descriptor ltm_desc = { &addmod, &submod, + &set_rand, + }; diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index 82a735306..821802472 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -787,6 +787,8 @@ const ltc_math_descriptor tfm_desc = { &addmod, &submod, + NULL, + }; diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index f1233985b..45068b2ee 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -15,25 +15,28 @@ /** @file rsa_exptmod.c RSA LTC_PKCS exptmod, Tom St Denis -*/ +*/ #ifdef LTC_MRSA -/** - Compute an RSA modular exponentiation +/** + Compute an RSA modular exponentiation @param in The input data to send into RSA @param inlen The length of the input (octets) - @param out [out] The destination + @param out [out] The destination @param outlen [in/out] The max size and resulting size of the output @param which Which exponent to use, e.g. PK_PRIVATE or PK_PUBLIC - @param key The RSA key to use + @param key The RSA key to use @return CRYPT_OK if successful -*/ +*/ int rsa_exptmod(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, int which, rsa_key *key) { - void *tmp, *tmpa, *tmpb, *rnd, *rndi /* inverse of rnd */; + void *tmp, *tmpa, *tmpb; + #ifdef LTC_RSA_BLINDING + void *rnd = NULL, *rndi = NULL /* inverse of rnd */; + #endif unsigned long x; int err; @@ -41,7 +44,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); - + /* is the key of the right type for the operation? */ if (which == PK_PRIVATE && (key->type != PK_PRIVATE)) { return CRYPT_PK_NOT_PRIVATE; @@ -53,7 +56,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, } /* init and copy into tmp */ - if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, &rnd, &rndi, NULL)) != CRYPT_OK) + if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, NULL)) != CRYPT_OK) { return err; } if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto error; } @@ -67,49 +70,55 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, /* are we using the private exponent and is the key optimized? */ if (which == PK_PRIVATE) { + #ifdef LTC_RSA_BLINDING + if ((err = mp_init_multi(&rnd, &rndi, NULL)) != CRYPT_OK) + { goto error; } /* do blinding */ err = mp_rand(rnd, mp_count_bits(key->N)); if (err != CRYPT_OK) { - goto error; + goto error_blind; } /* rndi = 1/rnd mod N */ err = mp_invmod(rnd, key->N, rndi); if (err != CRYPT_OK) { - goto error; + goto error_blind; } /* rnd = rnd^e */ err = mp_exptmod( rnd, key->e, key->N, rnd); if (err != CRYPT_OK) { - goto error; + goto error_blind; } /* tmp = tmp*rnd mod N */ err = mp_mulmod( tmp, rnd, key->N, tmp); if (err != CRYPT_OK) { - goto error; + goto error_blind; } + #endif /* LTC_RSA_BLINDING */ /* tmpa = tmp^dP mod p */ - if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto error; } + if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto error_blind; } /* tmpb = tmp^dQ mod q */ - if ((err = mp_exptmod(tmp, key->dQ, key->q, tmpb)) != CRYPT_OK) { goto error; } + if ((err = mp_exptmod(tmp, key->dQ, key->q, tmpb)) != CRYPT_OK) { goto error_blind; } /* tmp = (tmpa - tmpb) * qInv (mod p) */ - if ((err = mp_sub(tmpa, tmpb, tmp)) != CRYPT_OK) { goto error; } - if ((err = mp_mulmod(tmp, key->qP, key->p, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_sub(tmpa, tmpb, tmp)) != CRYPT_OK) { goto error_blind; } + if ((err = mp_mulmod(tmp, key->qP, key->p, tmp)) != CRYPT_OK) { goto error_blind; } /* tmp = tmpb + q * tmp */ - if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { goto error; } - if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { goto error_blind; } + if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { goto error_blind; } + #ifdef LTC_RSA_BLINDING /* unblind */ err = mp_mulmod( tmp, rndi, key->N, tmp); if (err != CRYPT_OK) { - goto error; + goto error_blind; } + #endif } else { /* exptmod it */ if ((err = mp_exptmod(tmp, key->e, key->N, tmp)) != CRYPT_OK) { goto error; } @@ -136,8 +145,12 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, /* clean up and return */ err = CRYPT_OK; +error_blind: + #ifdef LTC_RSA_BLINDING + mp_clear_multi(rnd, rndi, NULL); + #endif error: - mp_clear_multi(tmp, tmpa, tmpb, rnd, rndi, NULL); + mp_clear_multi(tmp, tmpa, tmpb, NULL); return err; } From 5ec1e53e027d47201aa09425b96a3554e31a32c7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 21 Mar 2011 22:59:59 +0100 Subject: [PATCH 0026/1192] updated gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 88308fb82..08e456b55 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # suppress compiler/linker output *.[oa] *.obj +*.gcno [Dd]ebug/ [Rr]elease/ From 2b0ce25778d9c38f623880585224483e0f819f16 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 20 May 2011 09:41:57 +0200 Subject: [PATCH 0027/1192] testme.sh: added parameter checking --- testme.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testme.sh b/testme.sh index ff98d23a0..c2909736e 100644 --- a/testme.sh +++ b/testme.sh @@ -1,5 +1,12 @@ #!/bin/bash +if [ $# -lt 3 ] +then + echo "usage is: ${0##*/} " + echo "e.g. \"${0##*/} makefile \"-DUSE_LTM -DLTM_DESC -I/path/to/libtommath\" /path/to/libtommath/libtommath.a\"" + exit -1 +fi + # date echo "date="`date` From 8859f6e73d1361c065ac11d938a2100bdc6ee45d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 23 Dec 2010 19:57:56 +0100 Subject: [PATCH 0028/1192] fixed wrong return value interpretation of register_crypt/hash/prng function calls --- src/misc/crypt/crypt_fsa.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/misc/crypt/crypt_fsa.c b/src/misc/crypt/crypt_fsa.c index 3d6d86d2a..9960ec9a9 100644 --- a/src/misc/crypt/crypt_fsa.c +++ b/src/misc/crypt/crypt_fsa.c @@ -19,7 +19,6 @@ /* format is ltc_mp, cipher_desc, [cipher_desc], NULL, hash_desc, [hash_desc], NULL, prng_desc, [prng_desc], NULL */ int crypt_fsa(void *mp, ...) { - int err; va_list args; void *p; @@ -29,23 +28,23 @@ int crypt_fsa(void *mp, ...) } while ((p = va_arg(args, void*)) != NULL) { - if ((err = register_cipher(p)) != CRYPT_OK) { + if (register_cipher(p) == -1) { va_end(args); - return err; + return CRYPT_INVALID_CIPHER; } } while ((p = va_arg(args, void*)) != NULL) { - if ((err = register_hash(p)) != CRYPT_OK) { + if (register_hash(p) == -1) { va_end(args); - return err; + return CRYPT_INVALID_HASH; } } while ((p = va_arg(args, void*)) != NULL) { - if ((err = register_prng(p)) != CRYPT_OK) { + if (register_prng(p) == -1) { va_end(args); - return err; + return CRYPT_INVALID_PRNG; } } From 1346ccdee8bdc31d9b67c3602c5bd4a9348c3d8d Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Tue, 12 Jul 2011 05:56:48 -0700 Subject: [PATCH 0029/1192] replaced free(in) by XFREE(in) at line 56 --- src/pk/asn1/der/sequence/der_sequence_free.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/sequence/der_sequence_free.c b/src/pk/asn1/der/sequence/der_sequence_free.c index c933f5893..56ecce7fb 100644 --- a/src/pk/asn1/der/sequence/der_sequence_free.c +++ b/src/pk/asn1/der/sequence/der_sequence_free.c @@ -53,7 +53,7 @@ void der_sequence_free(ltc_asn1_list *in) /* move to next and free current */ l = in->next; - free(in); + XFREE(in); in = l; } } From 2cd666f2849d62b11469fc876f51e07f327cee3b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 24 Apr 2012 18:08:13 +0200 Subject: [PATCH 0030/1192] rsa_import: prevent double-free --- src/pk/rsa/rsa_import.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index 9e3928b13..607da6173 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -62,11 +62,10 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto LBL_ERR; } - XFREE(tmpbuf); key->type = PK_PUBLIC; - return CRYPT_OK; + err = CRYPT_OK; + goto LBL_FREE; } - XFREE(tmpbuf); /* not SSL public key, try to match against LTC_PKCS #1 standards */ if ((err = der_decode_sequence_multi(in, inlen, @@ -110,10 +109,16 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) } key->type = PK_PUBLIC; } - return CRYPT_OK; + err = CRYPT_OK; + goto LBL_FREE; + LBL_ERR: - XFREE(tmpbuf); mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + +LBL_FREE: + if (tmpbuf != NULL) + XFREE(tmpbuf); + return err; } From 9c4fc762fcf00daf2facc91528a76c405e8616fc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 4 May 2012 01:00:25 +0200 Subject: [PATCH 0031/1192] yarrow: trim trailing spaces --- src/prngs/yarrow.c | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/prngs/yarrow.c b/src/prngs/yarrow.c index c94671ffd..b5cced38f 100644 --- a/src/prngs/yarrow.c +++ b/src/prngs/yarrow.c @@ -13,7 +13,7 @@ /** @file yarrow.c Yarrow PRNG, Tom St Denis -*/ +*/ #ifdef LTC_YARROW @@ -34,11 +34,11 @@ const struct ltc_prng_descriptor yarrow_desc = Start the PRNG @param prng [out] The PRNG state to initialize @return CRYPT_OK if successful -*/ +*/ int yarrow_start(prng_state *prng) { int err; - + LTC_ARGCHK(prng != NULL); /* these are the default hash/cipher combo used */ @@ -64,13 +64,13 @@ int yarrow_start(prng_state *prng) prng->yarrow.cipher = register_cipher(&saferp_desc); #elif defined(LTC_RC2) prng->yarrow.cipher = register_cipher(&rc2_desc); -#elif defined(LTC_NOEKEON) +#elif defined(LTC_NOEKEON) prng->yarrow.cipher = register_cipher(&noekeon_desc); -#elif defined(LTC_ANUBIS) +#elif defined(LTC_ANUBIS) prng->yarrow.cipher = register_cipher(&anubis_desc); -#elif defined(LTC_KSEED) +#elif defined(LTC_KSEED) prng->yarrow.cipher = register_cipher(&kseed_desc); -#elif defined(LTC_KHAZAD) +#elif defined(LTC_KHAZAD) prng->yarrow.cipher = register_cipher(&khazad_desc); #elif defined(LTC_CAST5) prng->yarrow.cipher = register_cipher(&cast5_desc); @@ -131,7 +131,7 @@ int yarrow_start(prng_state *prng) @param inlen Length of the data to add @param prng PRNG state to update @return CRYPT_OK if successful -*/ +*/ int yarrow_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { hash_state md; @@ -139,9 +139,9 @@ int yarrow_add_entropy(const unsigned char *in, unsigned long inlen, prng_state LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); - + LTC_MUTEX_LOCK(&prng->yarrow.prng_lock); - + if ((err = hash_is_valid(prng->yarrow.hash)) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); return err; @@ -150,11 +150,11 @@ int yarrow_add_entropy(const unsigned char *in, unsigned long inlen, prng_state /* start the hash */ if ((err = hash_descriptor[prng->yarrow.hash].init(&md)) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + return err; } /* hash the current pool */ - if ((err = hash_descriptor[prng->yarrow.hash].process(&md, prng->yarrow.pool, + if ((err = hash_descriptor[prng->yarrow.hash].process(&md, prng->yarrow.pool, hash_descriptor[prng->yarrow.hash].hashsize)) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); return err; @@ -180,7 +180,7 @@ int yarrow_add_entropy(const unsigned char *in, unsigned long inlen, prng_state Make the PRNG ready to read from @param prng The PRNG to make active @return CRYPT_OK if successful -*/ +*/ int yarrow_ready(prng_state *prng) { int ks, err; @@ -192,7 +192,7 @@ int yarrow_ready(prng_state *prng) LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); return err; } - + if ((err = cipher_is_valid(prng->yarrow.cipher)) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); return err; @@ -224,7 +224,7 @@ int yarrow_ready(prng_state *prng) @param outlen Length of output @param prng The active PRNG to read from @return Number of octets read -*/ +*/ unsigned long yarrow_read(unsigned char *out, unsigned long outlen, prng_state *prng) { LTC_ARGCHK(out != NULL); @@ -234,7 +234,7 @@ unsigned long yarrow_read(unsigned char *out, unsigned long outlen, prng_state * /* put out in predictable state first */ zeromem(out, outlen); - + /* now randomize it */ if (ctr_encrypt(out, out, outlen, &prng->yarrow.ctr) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); @@ -248,7 +248,7 @@ unsigned long yarrow_read(unsigned char *out, unsigned long outlen, prng_state * Terminate the PRNG @param prng The PRNG to terminate @return CRYPT_OK if successful -*/ +*/ int yarrow_done(prng_state *prng) { int err; @@ -260,7 +260,7 @@ int yarrow_done(prng_state *prng) /* we invented one */ err = ctr_done(&prng->yarrow.ctr); - + LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); return err; } @@ -271,7 +271,7 @@ int yarrow_done(prng_state *prng) @param outlen [in/out] Max size and resulting size of the state @param prng The PRNG to export @return CRYPT_OK if successful -*/ +*/ int yarrow_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { LTC_ARGCHK(out != NULL); @@ -295,21 +295,21 @@ int yarrow_export(unsigned char *out, unsigned long *outlen, prng_state *prng) return CRYPT_OK; } - + /** Import a PRNG state @param in The PRNG state @param inlen Size of the state @param prng The PRNG to import @return CRYPT_OK if successful -*/ +*/ int yarrow_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { int err; LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); - + LTC_MUTEX_LOCK(&prng->yarrow.prng_lock); if (inlen != 64) { @@ -329,7 +329,7 @@ int yarrow_import(const unsigned char *in, unsigned long inlen, prng_state *prng /** PRNG self-test @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled -*/ +*/ int yarrow_test(void) { #ifndef LTC_TEST @@ -341,7 +341,7 @@ int yarrow_test(void) if ((err = yarrow_start(&prng)) != CRYPT_OK) { return err; } - + /* now let's test the hash/cipher that was chosen */ if ((err = cipher_descriptor[prng.yarrow.cipher].test()) != CRYPT_OK) { return err; From 77860ba866882a6ec65f57378ca64419d14de72e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 4 May 2012 01:01:24 +0200 Subject: [PATCH 0032/1192] yarrow: prevent access to NULL pointer --- src/prngs/yarrow.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/prngs/yarrow.c b/src/prngs/yarrow.c index b5cced38f..d6566e6e5 100644 --- a/src/prngs/yarrow.c +++ b/src/prngs/yarrow.c @@ -343,11 +343,13 @@ int yarrow_test(void) } /* now let's test the hash/cipher that was chosen */ - if ((err = cipher_descriptor[prng.yarrow.cipher].test()) != CRYPT_OK) { - return err; + if (cipher_descriptor[prng.yarrow.cipher].test && + ((err = cipher_descriptor[prng.yarrow.cipher].test()) != CRYPT_OK)) { + return err; } - if ((err = hash_descriptor[prng.yarrow.hash].test()) != CRYPT_OK) { - return err; + if (hash_descriptor[prng.yarrow.hash].test && + ((err = hash_descriptor[prng.yarrow.hash].test()) != CRYPT_OK)) { + return err; } return CRYPT_OK; From bd7933cc2b43ebe7c4349614c6cf1271251ebee4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 8 Oct 2012 10:20:21 +0200 Subject: [PATCH 0033/1192] add check for defines of math provider --- testprof/tomcrypt_test.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index cb2ad0114..237eee32d 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -4,6 +4,25 @@ #include +#ifdef USE_LTM +/* Use libtommath as MPI provider */ +#elif defined(USE_TFM) +/* Use tomsfastmath as MPI provider */ +#elif defined(USE_GMP) +/* Use GNU Multiple Precision Arithmetic Library as MPI provider */ +#else +/* The user must define his own MPI provider! */ +#ifndef EXT_MATH_LIB +/* + * Yes, you're right, you could also name your instance of the MPI provider + * "EXT_MATH_LIB" and you wouldn't need to define it, but most users won't do + * this and so it's treated as an error and you have to comment out the + * following statement :) + */ +#error EXT_MATH_LIB is required to be defined +#endif +#endif + /* enable stack testing */ /* #define STACK_TEST */ From 233f207c178642c5a1bc7184d0f4165f63b554cf Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 25 Sep 2011 17:24:52 -0700 Subject: [PATCH 0034/1192] Use "GMP_DESC" instead of "GPM_DESC" This seemed to be the only place in the code that was using this particular transposition. And, indeed, when compiling with "GMP_DESC", it looks like it is necessary to disable Diffie-Hellman. (Otherwise, the test fails for me.) --- src/headers/tomcrypt_custom.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 362403bc1..97de5de84 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -306,8 +306,8 @@ /* #define LTC_RSA_BLINDING */ /* Include Diffie-Hellman support */ -#ifndef GPM_DESC -/* is_prime fails for GPM */ +#ifndef GMP_DESC +/* is_prime fails for GMP */ #define MDH /* Supported Key Sizes */ #define DH768 From d61c537a2aa365f8e1587eceb2bb6b06ab609cfd Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Mon, 26 Sep 2011 00:29:57 -0700 Subject: [PATCH 0035/1192] missing a comma --- src/math/gmp_desc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 9d7ff0729..403211ba3 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -487,7 +487,7 @@ const ltc_math_descriptor gmp_desc = { NULL, #endif /* LTC_ECC_SHAMIR */ #else - NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, #endif /* LTC_MECC */ #ifdef LTC_MRSA From 4a2b54a446baac1f760a0f9c2fe2e44fb71a1219 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 25 Sep 2011 18:33:31 -0700 Subject: [PATCH 0036/1192] Changed "make clean" to not delete crypt.lof (which is checked into git) This line: rm -f `find . -type f | grep "[.]lo" | xargs` was deleting crypt.lof, which seemed undesirable. One solution would be to end the grep expression with "$", but it seemed more straightforward just to pass "-name" to "find", rather than piping through grep. --- makefile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/makefile b/makefile index 901a3ef23..70316a4ac 100644 --- a/makefile +++ b/makefile @@ -329,19 +329,19 @@ profile: #This rule cleans the source tree of all compiled code, not including the pdf #documentation. clean: - rm -f `find . -type f | grep "[.]o" | xargs` - rm -f `find . -type f | grep "[.]lo" | xargs` - rm -f `find . -type f | grep "[.]a" | xargs` - rm -f `find . -type f | grep "[.]la" | xargs` - rm -f `find . -type f | grep "[.]obj" | xargs` - rm -f `find . -type f | grep "[.]lib" | xargs` - rm -f `find . -type f | grep "[.]exe" | xargs` - rm -f `find . -type f | grep "[.]gcda" | xargs` - rm -f `find . -type f | grep "[.]gcno" | xargs` - rm -f `find . -type f | grep "[.]il" | xargs` - rm -f `find . -type f | grep "[.]dyn" | xargs` - rm -f `find . -type f | grep "[.]dpi" | xargs` - rm -rf `find . -type d | grep "[.]libs" | xargs` + rm -f `find . -type f -name "*.o" | xargs` + rm -f `find . -type f -name "*.lo" | xargs` + rm -f `find . -type f -name "*.a" | xargs` + rm -f `find . -type f -name "*.la" | xargs` + rm -f `find . -type f -name "*.obj" | xargs` + rm -f `find . -type f -name "*.lib" | xargs` + rm -f `find . -type f -name "*.exe" | xargs` + rm -f `find . -type f -name "*.gcda" | xargs` + rm -f `find . -type f -name "*.gcno" | xargs` + rm -f `find . -type f -name "*.il" | xargs` + rm -f `find . -type f -name "*.dyn" | xargs` + rm -f `find . -type f -name "*.dpi" | xargs` + rm -rf `find . -type d -name "*.libs" | xargs` rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc rm -f $(TV) $(PROF) $(SMALL) $(CRYPT) $(HASHSUM) $(MULTI) $(TIMING) $(TEST) rm -rf doc/doxygen From 9228cbbd1e0e88e23c73b0caca4587aed5dd9c91 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 25 Sep 2011 18:40:52 -0700 Subject: [PATCH 0037/1192] don't delete doc/crypt.pdf in "make clean" "make clean" was deleting "doc/*.pdf", despite the fact that there were two comments (one above and one below) stating that it did not. Since doc/crypt.pdf is checked into git, running "make clean" made my git state dirty, which seems undesirable. I took sort of a compromise position and had "make clean" continue to delete any other .pdf files in doc (such as refman.pdf), but explicitly not delete crypt.pdf. --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 70316a4ac..53f80f45e 100644 --- a/makefile +++ b/makefile @@ -345,7 +345,7 @@ clean: rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc rm -f $(TV) $(PROF) $(SMALL) $(CRYPT) $(HASHSUM) $(MULTI) $(TIMING) $(TEST) rm -rf doc/doxygen - rm -f doc/*.pdf + rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` rm -f *.txt #build the doxy files (requires Doxygen, tetex and patience) From cecbbb88fc585e5fd5691b741c8dc0d29655f96c Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 25 Sep 2011 18:04:05 -0700 Subject: [PATCH 0038/1192] When a test fails, print the algorithm that it failed on. As near as I can tell, LibTomCrypt doesn't provide any way to tell which cipher failed when it reports a cipher test failure. For example, I was getting: Algorithm failed test vectors. (5) cipher_hash_test.c:14:cipher_descriptor[x].test() But there's no way to tell what value x has, and even if there was, it would take a bit of digging to determine which algorithm that corresponds to. So, I added a variant of the DO() macro, DOX(), which takes an additional string argument which is displayed on failure. So now I get: Algorithm failed test vectors. (5) - camellia cipher_hash_test.c:14:cipher_descriptor[x].test() --- testprof/cipher_hash_test.c | 18 +++++++++--------- testprof/test_driver.c | 7 +++++-- testprof/tomcrypt_test.h | 8 +++++--- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index 666d9139f..dba7d9adc 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -11,25 +11,25 @@ int cipher_hash_test(void) /* test ciphers */ for (x = 0; cipher_descriptor[x].name != NULL; x++) { - DO(cipher_descriptor[x].test()); + DOX(cipher_descriptor[x].test(), cipher_descriptor[x].name); } /* test hashes */ for (x = 0; hash_descriptor[x].name != NULL; x++) { - DO(hash_descriptor[x].test()); + DOX(hash_descriptor[x].test(), hash_descriptor[x].name); } /* test prngs (test, import/export */ for (x = 0; prng_descriptor[x].name != NULL; x++) { - DO(prng_descriptor[x].test()); - DO(prng_descriptor[x].start(&nprng)); - DO(prng_descriptor[x].add_entropy((unsigned char *)"helloworld12", 12, &nprng)); - DO(prng_descriptor[x].ready(&nprng)); + DOX(prng_descriptor[x].test(), prng_descriptor[x].name); + DOX(prng_descriptor[x].start(&nprng), prng_descriptor[x].name); + DOX(prng_descriptor[x].add_entropy((unsigned char *)"helloworld12", 12, &nprng), prng_descriptor[x].name); + DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); n = sizeof(buf); - DO(prng_descriptor[x].pexport(buf, &n, &nprng)); + DOX(prng_descriptor[x].pexport(buf, &n, &nprng), prng_descriptor[x].name); prng_descriptor[x].done(&nprng); - DO(prng_descriptor[x].pimport(buf, n, &nprng)); - DO(prng_descriptor[x].ready(&nprng)); + DOX(prng_descriptor[x].pimport(buf, n, &nprng), prng_descriptor[x].name); + DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); if (prng_descriptor[x].read(buf, 100, &nprng) != 100) { fprintf(stderr, "Error reading from imported PRNG!\n"); exit(EXIT_FAILURE); diff --git a/testprof/test_driver.c b/testprof/test_driver.c index 6e5466844..b728f911f 100644 --- a/testprof/test_driver.c +++ b/testprof/test_driver.c @@ -1,9 +1,12 @@ #include -void run_cmd(int res, int line, char *file, char *cmd) +void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm) { if (res != CRYPT_OK) { - fprintf(stderr, "%s (%d)\n%s:%d:%s\n", error_to_string(res), res, file, line, cmd); + fprintf(stderr, "%s (%d)%s%s\n%s:%d:%s\n", + error_to_string(res), res, + (algorithm ? " - " : ""), (algorithm ? algorithm : ""), + file, line, cmd); if (res != CRYPT_NOP) { exit(EXIT_FAILURE); } diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 237eee32d..84e173c61 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -36,12 +36,14 @@ typedef struct { extern prng_state yarrow_prng; -void run_cmd(int res, int line, char *file, char *cmd); +void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); #ifdef LTC_VERBOSE -#define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x); } while (0); +#define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0); +#define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0); #else -#define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x); } while (0); +#define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0); +#define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0); #endif /* TESTS */ From ee7c031ddf27bc6a2a4b4a78b8a183b8630e7691 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 25 Sep 2011 17:39:04 -0700 Subject: [PATCH 0039/1192] Added some code (commented out) to print details about Camellia test failure (and ditto for SEED) This is modeled after similar commented-out code in sober128_test(), but slightly fancier. --- src/ciphers/camellia.c | 15 +++++++++++++++ src/ciphers/kseed.c | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 06510125c..e7b172f04 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -686,6 +686,21 @@ int camellia_test(void) } camellia_done(&skey); if (XMEMCMP(tests[x].ct, buf[0], 16) || XMEMCMP(tests[x].pt, buf[1], 16)) { +#if 0 + int i, j; + printf ("\n\nLTC_CAMELLIA failed for x=%d, I got:\n", x); + for (i = 0; i < 2; i++) { + const unsigned char *expected, *actual; + expected = (i ? tests[x].pt : tests[x].ct); + actual = buf[i]; + printf ("expected actual (%s)\n", (i ? "plaintext" : "ciphertext")); + for (j = 0; j < 16; j++) { + const char *eq = (expected[j] == actual[j] ? "==" : "!="); + printf (" %02x %s %02x\n", expected[j], eq, actual[j]); + } + printf ("\n"); + } +#endif return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/ciphers/kseed.c b/src/ciphers/kseed.c index a163c9543..1065d8ca4 100644 --- a/src/ciphers/kseed.c +++ b/src/ciphers/kseed.c @@ -346,6 +346,21 @@ int kseed_test(void) kseed_ecb_encrypt(tests[x].pt, buf[0], &skey); kseed_ecb_decrypt(buf[0], buf[1], &skey); if (XMEMCMP(buf[0], tests[x].ct, 16) || XMEMCMP(buf[1], tests[x].pt, 16)) { +#if 0 + int i, j; + printf ("\n\nLTC_KSEED failed for x=%d, I got:\n", x); + for (i = 0; i < 2; i++) { + const unsigned char *expected, *actual; + expected = (i ? tests[x].pt : tests[x].ct); + actual = buf[i]; + printf ("expected actual (%s)\n", (i ? "plaintext" : "ciphertext")); + for (j = 0; j < 16; j++) { + const char *eq = (expected[j] == actual[j] ? "==" : "!="); + printf (" %02x %s %02x\n", expected[j], eq, actual[j]); + } + printf ("\n"); + } +#endif return CRYPT_FAIL_TESTVECTOR; } } From cefff85550786ec869b39c0cb4a5904e88c84319 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 25 Sep 2011 17:11:25 -0700 Subject: [PATCH 0040/1192] Add "memory" as a clobber for bswap inline assembly. This had been causing Camellia (the only cipher that uses these macros) to fail when compiling "out-of-the-box" with gcc version "4.3.3-5ubuntu4". I think because the compiler had no idea any memory access was going on in these macros. Adding "memory" as a clobber solves the problem, but is probably overkill. I suspect that if we specify the constraint for y differently, we could get rid of both "memory" and __volatile__, which would allow the compiler to optimize much more. Also, in gcc versions that support it, we should probably use the bswap builtins instead. --- src/headers/tomcrypt_macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 6e4d757af..52a17191a 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -105,13 +105,13 @@ asm __volatile__ ( \ "bswapq %0 \n\t" \ "movq %0,(%1)\n\t" \ "bswapq %0 \n\t" \ - ::"r"(x), "r"(y)); + ::"r"(x), "r"(y): "memory"); #define LOAD64H(x, y) \ asm __volatile__ ( \ "movq (%1),%0\n\t" \ "bswapq %0\n\t" \ - :"=r"(x): "r"(y)); + :"=r"(x): "r"(y): "memory"); #else From ad566e1b00fe6a83b4ef024e9945d24177f9310e Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 25 Sep 2011 20:18:26 -0700 Subject: [PATCH 0041/1192] Use __builtin_bswap64 if it is available This produces slightly better performance than the inline assembly, and has the added benefit that it should be portable to other systems that use gcc, not just x86-64. Here are the results on my "AMD Athlon(tm) 7450 Dual-Core Processor" with "gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3": with portable 64H macros: camellia : Schedule at 1659 camellia [ 23]: Encrypt at 431, Decrypt at 434 whirlpool : Process at 55 with inline assembly (with "memory clobber" for correctness): camellia : Schedule at 1380 camellia [ 23]: Encrypt at 406, Decrypt at 403 whirlpool : Process at 50 with __builtin_bswap64: camellia : Schedule at 1352 camellia [ 23]: Encrypt at 396, Decrypt at 391 whirlpool : Process at 46 --- src/headers/tomcrypt_macros.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 52a17191a..732ec3cf6 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -96,9 +96,20 @@ asm __volatile__ ( \ #endif +/* gcc 4.3 and up has a bswap builtin */ +#if !defined(LTC_NO_BSWAP) && \ + (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) + +#define STORE64H(x, y) \ + { ulong64 __t = __builtin_bswap64 ((x)); \ + XMEMCPY ((y), &__t, 8); } + +#define LOAD64H(x, y) \ + { XMEMCPY (&(x), (y), 8); \ + (x) = __builtin_bswap64 ((x)); } /* x86_64 processor */ -#if !defined(LTC_NO_BSWAP) && (defined(__GNUC__) && defined(__x86_64__)) +#elif !defined(LTC_NO_BSWAP) && (defined(__GNUC__) && defined(__x86_64__)) #define STORE64H(x, y) \ asm __volatile__ ( \ From 382c9d4d85ba226e18d5254a2dc95ed4e4be3a0e Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Mon, 26 Sep 2011 00:39:19 -0700 Subject: [PATCH 0042/1192] Some fixes necessary to support the Clang compiler First of all, it had a failure in SEED: LTC_KSEED failed for x=0, I got: expected actual (ciphertext) 5e == 5e ba == ba c6 == c6 e0 == e0 05 != 00 4e != 00 16 != 00 68 != 00 19 == 19 af == af f1 == f1 cc == cc 6d != 00 34 != 00 6c != 00 db != 00 Since SEED uses the 32H macros, this is really analogous to the problem I saw with the 64H macros in Camellia with gcc. Not sure why gcc only had a problem with 64H and not 32H, but since this is an interaction with the optimizer, it's not going to happen every time the macro is used (hence why the store tests pass; only when you get into the complexity of a real cipher do you start having problems) and it makes sense it will vary from compiler to compiler. Anyway, I went ahead and added the ability to use __builtin_bswap32, in addition to __builtin_bswap64, which I already did in a previous commit. This solves the problem for clang, although I had to add new logic to detect the bswap builtins in clang, since it has a different way to detect them than gcc (see the comments in the code). The detection logic was complicated enough, and applied to both the 32H and 64H macros, so I factored out the detection logic into tomcrypt_cfg.h. --- src/headers/tomcrypt_cfg.h | 16 ++++++++++++++++ src/headers/tomcrypt_macros.h | 16 ++++++++++++---- src/misc/crypt/crypt.c | 4 +++- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index f7ad3cc0c..cc3b6dff5 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -128,6 +128,22 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define ENDIAN_NEUTRAL #endif +/* gcc 4.3 and up has a bswap builtin; detect it by gcc version. + * clang also supports the bswap builtin, and although clang pretends + * to be gcc (macro-wise, anyway), clang pretends to be a version + * prior to gcc 4.3, so we can't detect bswap that way. Instead, + * clang has a __has_builtin mechanism that can be used to check + * for builtins: + * http://clang.llvm.org/docs/LanguageExtensions.html#feature_check */ +#ifndef __has_builtin + #define __has_builtin(x) 0 +#endif +#if !defined(LTC_NO_BSWAP) && defined(__GNUC__) && \ + ((__GNUC__ * 100 + __GNUC_MINOR__ >= 403) || \ + (__has_builtin(__builtin_bswap32) && __has_builtin(__builtin_bswap64))) + #define LTC_HAVE_BSWAP_BUILTIN +#endif + #endif diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 732ec3cf6..86156ccef 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -67,7 +67,17 @@ #ifdef ENDIAN_LITTLE -#if !defined(LTC_NO_BSWAP) && (defined(INTEL_CC) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__) || defined(__x86_64__)))) +#ifdef LTC_HAVE_BSWAP_BUILTIN + +#define STORE32H(x, y) \ + { ulong32 __t = __builtin_bswap32 ((x)); \ + XMEMCPY ((y), &__t, 4); } + +#define LOAD32H(x, y) \ + { XMEMCPY (&(x), (y), 4); \ + (x) = __builtin_bswap32 ((x)); } + +#elif !defined(LTC_NO_BSWAP) && (defined(INTEL_CC) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__) || defined(__x86_64__)))) #define STORE32H(x, y) \ asm __volatile__ ( \ @@ -96,9 +106,7 @@ asm __volatile__ ( \ #endif -/* gcc 4.3 and up has a bswap builtin */ -#if !defined(LTC_NO_BSWAP) && \ - (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) +#ifdef LTC_HAVE_BSWAP_BUILTIN #define STORE64H(x, y) \ { ulong64 __t = __builtin_bswap64 ((x)); \ diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 129839796..e1b1ce038 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -286,7 +286,9 @@ const char *crypt_build_settings = #if defined(_MSC_VER) " MSVC compiler detected.\n" #endif -#if defined(__GNUC__) +#if defined(__clang_version__) + " Clang compiler " __clang_version__ ".\n" +#elif defined(__GNUC__) /* clang also defines __GNUC__ */ " GCC compiler detected.\n" #endif #if defined(INTEL_CC) From 3fbccfcb5c0d7c29c37132e894034ec04ab46199 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Wed, 5 Oct 2011 01:12:08 -0700 Subject: [PATCH 0043/1192] support base 64 for GMP --- src/math/gmp_desc.c | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 403211ba3..b09aab32b 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -138,13 +138,49 @@ static int twoexpt(void *a, int n) /* ---- conversions ---- */ +static const char rmap[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; + /* read ascii string */ static int read_radix(void *a, const char *b, int radix) { + int ret; LTC_ARGCHK(a != NULL); LTC_ARGCHK(b != NULL); - mpz_set_str(a, b, radix); - return CRYPT_OK; + if (radix == 64) { + /* Sadly, GMP only supports radixes up to 62, but we need 64. + * So, although this is not the most elegant or efficient way, + * let's just convert the base 64 string (6 bits per digit) to + * an octal string (3 bits per digit) that's twice as long. */ + char c, *tmp, *q; + const char *p; + int i; + tmp = XMALLOC (1 + 2 * strlen (b)); + if (tmp == NULL) { + return CRYPT_MEM; + } + p = b; + q = tmp; + while ((c = *p++) != 0) { + for (i = 0; i < 64; i++) { + if (c == rmap[i]) + break; + } + if (i == 64) { + XFREE (tmp); + // printf ("c = '%c'\n", c); + return CRYPT_ERROR; + } + *q++ = '0' + (i / 8); + *q++ = '0' + (i % 8); + } + *q = 0; + ret = mpz_set_str(a, tmp, 8); + // printf ("ret = %d for '%s'\n", ret, tmp); + XFREE (tmp); + } else { + ret = mpz_set_str(a, b, radix); + } + return (ret == 0 ? CRYPT_OK : CRYPT_ERROR); } /* write one */ From e3acd4cabe0268ed1e89b081ba3cc0956acf51c2 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Wed, 5 Oct 2011 01:24:23 -0700 Subject: [PATCH 0044/1192] Make GMP use uppercase to match LibTomMath. --- src/math/gmp_desc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index b09aab32b..464cd934c 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -188,6 +188,11 @@ static int write_radix(void *a, char *b, int radix) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(b != NULL); + if (radix >= 11 && radix <= 36) + /* If radix is positive, GMP uses lowercase, and if negative, uppercase. + * We want it to use uppercase, to match the test vectors (presumably + * generated with LibTomMath). */ + radix = -radix; mpz_get_str(b, radix, a); return CRYPT_OK; } From 65254f65bf3af41b2eff14ed48384c98fe98b63f Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Wed, 5 Oct 2011 01:34:41 -0700 Subject: [PATCH 0045/1192] Fix camellia_keysize() to not change the keysize if it is correct. It was rounding 32 down to 24, 24 down to 16, and claiming 16 was invalid. --- src/ciphers/camellia.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index e7b172f04..488998b98 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -711,9 +711,9 @@ void camellia_done(symmetric_key *skey) {} int camellia_keysize(int *keysize) { - if (*keysize > 32) { *keysize = 32; } - else if (*keysize > 24) { *keysize = 24; } - else if (*keysize > 16) { *keysize = 16; } + if (*keysize >= 32) { *keysize = 32; } + else if (*keysize >= 24) { *keysize = 24; } + else if (*keysize >= 16) { *keysize = 16; } else return CRYPT_INVALID_KEYSIZE; return CRYPT_OK; } From 5708adb6c15c79505bf3ce1b31f26007283315d1 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Wed, 5 Oct 2011 01:37:19 -0700 Subject: [PATCH 0046/1192] Add Camellia to the test vectors. --- demos/tv_gen.c | 3 + notes/ccm_tv.txt | 35 ++++++++++ notes/cipher_tv.txt | 158 ++++++++++++++++++++++++++++++++++++++++++++ notes/eax_tv.txt | 35 ++++++++++ notes/gcm_tv.txt | 35 ++++++++++ notes/ocb_tv.txt | 35 ++++++++++ notes/omac_tv.txt | 35 ++++++++++ notes/pmac_tv.txt | 35 ++++++++++ 8 files changed, 371 insertions(+) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 8e09e3b95..fe7acdc67 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -53,6 +53,9 @@ void reg_algs(void) #ifdef LTC_KHAZAD register_cipher (&khazad_desc); #endif +#ifdef LTC_CAMELLIA + register_cipher (&camellia_desc); +#endif #ifdef LTC_TIGER register_hash (&tiger_desc); diff --git a/notes/ccm_tv.txt b/notes/ccm_tv.txt index 3ff4b77a5..57969aab4 100644 --- a/notes/ccm_tv.txt +++ b/notes/ccm_tv.txt @@ -212,3 +212,38 @@ CCM-anubis (16 byte key) 31: B8176469E6A0D5797ED6421A871FEECDE48ACF011E394981C43AC917E8FFD5, E9B01383DB1A32E6126BD802A6C6F47E 32: AB6A0AA29B687D05735167D78DB697BA2478BD14ECD059AE9D1239E7F2AB48FD, A560A30FD87CF28BA66F5B2638567E4B +CCM-camellia (16 byte key) + 0: , 3B53D5CC8B26A5FFC78D2E974E45A661 + 1: 5B, ED7741D8C258D56A29392A7A65CF147D + 2: 9396, AEC9E6690624A94E9ED39A0507C32277 + 3: 7D7DDB, E7D4B50F856F78EAFCCD6B91CA985AFE + 4: 1DE036A3, 4F519237C8534508140174DD3F5D5E10 + 5: 9BD3C8B888, 760CADF4D2722C52BE28D89F9F1BEAAC + 6: CA4252105A3D, 675B4D6953136E0691C3FE174381C231 + 7: EFF8ABC8F5CFA0, DDECDDF8FAE2BCAE971003D05A86024C + 8: D155E0590C4DC889, 08EFED0B6FA5C0EB64B7900229EA41DC + 9: 50AC40B4A083BEBF21, 14DABECF5CDBBB8F0AF3E7DDC034DAC6 + 10: 1C5442AF9F2D491BE911, FD19818919D55FD80BCC9EBA0A108920 + 11: 85A748561995A968CC9124, 69F769B8EA2BE927DADD209300752181 + 12: 2F0838A1C593A629C1AE9032, 4C8AB614BCF4F7988EB4B93E1DC48EE2 + 13: F19EE633F8B5E323904469D5C3, F82B28464B4BF73C39B332814E1672EF + 14: D6DBE7D82D4C99830FA1A6245125, 94D9EDF12A4A4EE357B647184EACC01B + 15: E8D02CBECEAD690DDFC1E48EE16B1F, 2D1355394CD62544D8840302715862D8 + 16: 74C395F0C833ECB858F6D09C097192C4, 9079E949C4081B348259080AA0AAD85B + 17: ECB27927C303ABE439BCD9F9D4E87D5674, 726E8E755398A30E930F2159B510DD8B + 18: 86593B1148EF7D5B446AA3AD22001CB66CB5, 63B0D269B586B9C887584498FF61D8BA + 19: 0373123872929AAF354B085FCEAB74DD2D28E4, 5FE2491F2603E474D15500DB2E32481D + 20: 3EA3D8DC013F2A6E42BFCCEE51BBFCEDD194BA40, 5667BD5212E31F02C8D8B94FAB5A9DEF + 21: 5ACC89A28DB162595FD55D63ED2C5B48976E0BA0E9, A52EDC5A3AB7B070B755DBB008D99787 + 22: 381266462C783DF3B5F3F3570611D6E0A61ABDFF7BA5, C79D371D81511D85D7B54B686AADFAFD + 23: 8819DDC964172B3BE049CCBABCF5AA7EDB50BD90E871F4, 45561AD598EB2DB8F7825878786B2CED + 24: F514E9F64E90197728E2D061443ED006F2CF2236EC2E65CF, 0C47214A73F6CEAEC1C96FE859C519E1 + 25: 3B965F16101777CF84C85AD864701BCDD617681B92944386AD, ECBE6B6BA145D10FE0D5042A5F04BB68 + 26: B573EB75A48CB8F56163A55DFB870017E06940D799ECCECE7C2C, 63A7C16D33F6ECA72B2B33C6FFF4F13D + 27: 47A3A96928BC9B28E22C3AF1999A30E271806BD3E6C8FAA4D82D62, 25E319011BA2F72BF7447C8EB36BBD01 + 28: 0E873D38B34A0857FB82BF278AE07AEF9A4B378A8300CDD96C5BDE34, 6045114D75AE7681C91E5BC508E2398B + 29: FF33B9683538014DCF4F7D78CF7126FB43448BF9883D69B824019B05FB, 28AD47D363A7F9A4653C6685F90C2971 + 30: 58005BF96E194411DF808DB3A6D405CA241986486160313AD092026A0A54, 7D8A8C8E8AB6ACE7312D82146219F37B + 31: 20C3DFE512F4EC1F17973BBB164E9F1B77CC3EB37B486119614764F4C7D0E2, 57CEB0625D34AD40935B03C54A1B8779 + 32: 913F8D366D4C2AC10ACB3196CCBDB5F436CFA92377045EB3A1C066F6ED7DE0E9, F48C8BB647E719049DB38C39EF779CE2 + diff --git a/notes/cipher_tv.txt b/notes/cipher_tv.txt index c649d26a0..01c302331 100644 --- a/notes/cipher_tv.txt +++ b/notes/cipher_tv.txt @@ -1965,3 +1965,161 @@ Key Size: 16 bytes 49: 0133E1745856C44C +Cipher: camellia +Key Size: 16 bytes + 0: ED18D83F3153160C5A6D01AC3717515C + 1: 1012886CCDF3FFD25E588BA10D6CE363 + 2: D25562F6943EBE3A7E0EF28D33CF091E + 3: C26FDC4539DD1E6D0330B5836AB24420 + 4: E14A50CE727B74B8CEBEB284FEF3C810 + 5: AABFD72D334F594344C617EF8E8F5741 + 6: E8D941419ABE88060835E9BD375455BB + 7: ED863784E1590139A2CA50D77450300A + 8: 545FCF42030BD764724C3EF5C139B038 + 9: 08C194E007FAA99997D855A759D10743 +10: 3899D3731500C79D2945AFC2980B4C17 +11: 2720FA4B402AB7F1B019AF6248702369 +12: 3FF6C3C90AB4141DEE5FF30EA2047F73 +13: BB5BAF7545AA774C7AA5A58568F96832 +14: 66349C52709EDE0EE34AB6501B420C7C +15: E1E93D923504A5421BAEA5F1D61D4C9A +16: 3C07DFD64B2407BB7575A905F3F31E83 +17: 0FC569AC89ED790F69BBD1E998700C97 +18: 6B6F390AFA1052BD2E8DB0DC261E4D26 +19: CBEA83ED55DA9DED95B87F2BBBEAC37D +20: CE005DECECB98F5937D5ED26FD83154E +21: 738301D76316EC4173F124A9C9D6577A +22: D00A1E40CFB5F2B8FD2C0714580FAD50 +23: 7EBF497C78B72E646EB72A326F1D5C4B +24: 7E0023900F6000D00737242DA8F2E1B1 +25: 0F7737E715BEF0DEA503E355394540A9 +26: 15452DD70DEBF45BEF39782CDB8BB086 +27: E7464917B3AF060BC763D8959DDF90C1 +28: CBE4B90FF8C66672122D53585198773B +29: B7262E6CAA2C14B18EE374DF922CDB98 +30: 01E695E3CD87A2FD4B9C49D08D032DAD +31: AA1686BA0B5C5688D0F370C6E2BFA43C +32: 9448BA348E8E904992C3F4233C226B22 +33: A1DCD1CB810DFB46BDCE6FBE3A192560 +34: 4345D200A309FA8C5A0CE9EC60EE506C +35: 54C7F64D9B411BF90B283ED62686D28F +36: E347E882EC2635081547612B1D9589D1 +37: 36D44CC101B37BB6F6AF68C3FEA3A7B7 +38: F38C2D5B921965D2AFFDBF4EC5BCEC19 +39: F7ED6BF85782F0526301BD1CD1624E67 +40: 7959C134BFC85CA176550EA689F81054 +41: A8FC96504C437F0EFD0BDF6CCEF516D2 +42: 6B88D1A06D7C8C74379FEFE2D6A7C895 +43: 39C21AA165F4A71A161971D89CA5DC32 +44: CC123C40071BF02D282DC83D2AC18226 +45: 0780A63741AE47CD03FA99A74C320E33 +46: DFB0831BA27AA0750701439603B8A805 +47: 0C783CBA4ECD9EEE1F91838259831187 +48: 1456624438B22555B08D59CA50D6E95D +49: D5F463D983A9A6FE9A0B47C245596D40 + +Key Size: 24 bytes + 0: 1D1DAF85EA5CAE19F5F5EA1DC61E5B83 + 1: DDAC7FCF2C2F275C7041E7821AAC84A3 + 2: 591091C3755816AAEB9170D5DF77A0B3 + 3: C4BC965CDC20E6FC039F07DA2CD10BE3 + 4: CD8DA54FC48524EDCFEF985C0C39C961 + 5: 14FA12F39AC3D701A958765B4499FFAC + 6: 2BBEA5F3AA140CFFED9F1EB2BC969D56 + 7: 5F73CA8BF641770D6833A43947D9A5C3 + 8: 3E872D303B882284AB02393D43137450 + 9: 01EF55D4CE182FA03216A83A5128F761 +10: 915C2F5793692A6D118D865783317C58 +11: 4368A442B61D6F12D5447F1CB8854714 +12: 3477ECB27ECFF2D7108ED1297DE80F86 +13: 89C875CB55C1CE80FF2D430921FADB05 +14: C5AAFE7A4588D4D9039E4552B3FC9B02 +15: BF1E7509405AB219B540BDD0D3DE7528 +16: 7E5CC85B6563099B902638B7E0D09728 +17: FF04D2350647F117F81DA037A9E11946 +18: EA294A53395A20B391B11AB9F97262F3 +19: 448C801307E9405F740623BA55A45639 +20: 62032AE6EB01322233FB321B2D6A8C38 +21: 79A54FFB9CA25AE315BA0E7B6E59EA99 +22: EDE7E634C396926876A49DB3C0E261E1 +23: E9DA5106B8BD33391C28407E9B3758BD +24: D8EAF9F744E060695AD1F55F85AF3D76 +25: F1E61F0F467C0785B6053332129114EA +26: 3119CACB24B012F3B96EFAD3FB856AFB +27: 97753ACDAFD6224E5D289BF76673A73A +28: 8D5912FFFD628736C64B3DE01DF1E674 +29: 8951CEDB758DF5EA5D2A78B2A08480EE +30: 3C0FC9DFD8CF79A5F9F75CC43B1A9247 +31: 4C7047481FE0849EA0416BDC00A52321 +32: 97034388AE8553570366EDFB9F6D618F +33: F16BCC0FB2B77CCBDC5EF7AB2233599D +34: 6D94D041196F43F0224B1DAC84165E7C +35: 313C6BA0AD767259860DCF8003F2F5A2 +36: C5F835DCF63D1C40E56DBAC7ADCE7F3C +37: DAFAFF6BB46EA9280562E5DDFA793BA8 +38: 5C8C0570B06C595E296DD4A9FB864FCE +39: 72B433F78D7CA638C2ADA09D99CFB769 +40: B6D7A6C47339743E9739D35D0F08A25D +41: 6CFD73F9E9781FFCE53C69AD2EF11E03 +42: B7F0BA994EF90642B80FDD798666D752 +43: DD49766125316ED4F546B246A2CFA23A +44: 8ED53D6CEF3CFB9DB0147F02656EDA35 +45: 95690401D61C84A013EC6D25CCAC5CD1 +46: 7693648B4A6CA804B6F01AE67816746C +47: F08C5898CE7970C41A5F8C05882CAB8B +48: 91EC0EC1CF839B58009E6CAAB3FD67A0 +49: 853DFA14A029EB8FB8D693B0A65306A1 + +Key Size: 32 bytes + 0: 5F77DC44E5E6701E8755C1FA176E2434 + 1: 5C1F70FC144C66D82D8F21DD2A0BA54E + 2: A98317BC656475F83E83062A69A17EF6 + 3: D5B8C0DB1095E65D49CEC82D78FD4C7E + 4: 37A537292409ABE5B922DD97EC0F6CA4 + 5: C7FD40883DE6BBC6059327DA586AD96E + 6: F4D19C443A2195B66085DACA7EFFDADF + 7: 6F12FD74B4D25C9F2856CAA1BA32461E + 8: DFC00046F41BC27684321B980BF68F6E + 9: 4A8BECB6A8D57002FCC6FE08B6D31118 +10: 859562FB3727E535BD4A914907822545 +11: EBA65EA3BD622DC044CA5384E568C65F +12: 79C16A751FBE22340F30462600724324 +13: 8F4FB71B5B3E0C1DB870B4BC81E995D0 +14: 4B82E7E8D64D8EF9D78DA944B292CED9 +15: D873F8D7125A63EBB04473F7331B1975 +16: 2FA25AF9E8D5A4DC82CAD98505E5DA60 +17: C80C24625096E6E9852A6F9EE12735BB +18: 10D4434CB795DC06E926CFA3B43D2368 +19: 070795AEA2765A443213F9CA909DF6C4 +20: 7184D2F5644306FB6DD55F1C90C111CA +21: F4FAEDF12FB40DE7CE7B08121A340557 +22: 86CE014AA863FD3030A26E6F8C178673 +23: 5A46BF2B3F14D5FEA884C3361EA87ED3 +24: 456584515D983D17ED4F3AE944BFB2C4 +25: E1E8F394691C2A9123023A8EE3FCBBEF +26: AC73E8BD1758850DEDAA3817B01E6353 +27: 15AE5395CBC3371F81A6F5B05C52671F +28: F15AA72D34C4E0EEF8DDDDA90D9A9539 +29: 3325E709043735898EA242E94D169112 +30: 044AB447754DADD4E2709FEE08D5CEA2 +31: E02DD5E86D32B3A6CC7F0016375AEC5F +32: 790278BD19E2860618E24DC69993F92B +33: F776D24FD90A43A78D000CFC1189E56A +34: A3EE4A3D121280750F7C70E55DD40FF4 +35: 32928BBBF98DF4B9E107599DFB30364F +36: B3E9296B529118B656D27AFF0F4D1A55 +37: 4668FD77100255C3406281EC813719AE +38: 16F9FF27B26F13300DB8DEE2EDD023AA +39: 9295F8435D688D12BE631A31B2531482 +40: D86917DF41ED4342C0ABF10628DBD1B4 +41: 1F5215B987C3F079769292E65D04B823 +42: F68B98BD2F12AACEBE78666AA83CA7D0 +43: 09BB635B67279F5A6B1D5C5D880A1357 +44: AE4ABBCC1D35CD8C4C254111D5F27158 +45: 5552B3E39DE67F759799A686222EE4EC +46: 1CA439434B9FD2F24561A32A0A2A79C5 +47: 0E33BE7CE3B9A5CFF00A73BD27DFE9EF +48: 6B7056FDC97983173D6B3D5BFC9B09B8 +49: DA293A4CB96FE3608CFFD89B927C9ED6 + + diff --git a/notes/eax_tv.txt b/notes/eax_tv.txt index 95cd7c1ab..40135dc8f 100644 --- a/notes/eax_tv.txt +++ b/notes/eax_tv.txt @@ -459,3 +459,38 @@ EAX-khazad (16 byte key) 15: 14DA751E5AF7E01F35B3CE74EE1ACF, 3C76AB64E1724DCE 16: A13BBC7E408D2C550634CBC64690B8FE, 3D4BBC0C76536730 +EAX-camellia (16 byte key) + 0: , 9E8CDB7237166EF9FD0605A0AD3E4070 + 1: 8A, 23F462AC7E22EB9078DAC34CB1CFFB08 + 2: EC9D, EBA9E2E3112C18CC2991FFF97EF77E6F + 3: D2A9CF, 913472F45F6D6B087D8AEB34B0FF9494 + 4: 360A7ECC, 6382103D53AB8C9263977AFB1A96AAC4 + 5: 80B52AAFE6, F855787CD6CCA56CD656A0DBC663CAD1 + 6: 0915D546F5F0, EBE17981CAB5D59E6376CFE30DE66936 + 7: 086B525B082B71, 182D76F2DE42F5D0AC252F25E7BC34CA + 8: 438DA1E9E78B9D2E, 36BA12456C3AC5ED3A0BDF851A651E82 + 9: 0F9C9890152D6AD5EC, 06F3A96F40D794552CA799006E76AE7A + 10: 7754241DCD040CC449EB, B576881B5E542A73717A6AC24E516079 + 11: BB536F70C1111BFAC4D149, DDC6043F2B5DF96418799DD13BD04726 + 12: 4B530B4F67376C4B7EC1CB29, 43A36C14092F19F168ADF0FD9F557424 + 13: 55D5D285DC88451148C7B2B143, 7C2CB43BD19808EB90F045E6D6EB70D0 + 14: B321948117659CB06E6B364D00A7, 1B30A37234E3A13A335EFE6A07B070DC + 15: BDCCAC5E956953E6D5C43D9436D453, 98F924C659F4112B1D9DAFFF711FB2F6 + 16: E0A2F28186D79A9494700E5A30351542, C604F7F47C3F18F236DDB289D287BE91 + 17: 750D6EF87E1C9E1023920D3F355B2BEED8, 96FEEAC4DA36FD36129F67C3EADA75EF + 18: E7F91687119D70793B9BB0114C7B588D32F0, A75052978F26EE6FE5D802BD4C06004D + 19: 56D7420981DC556AE0137DB0F1BD1CEC0BC945, CC024D30F19EAA3CDF66E51246FC3225 + 20: F2D61A0E214472663F5F41C9D66EDEEC2F7C824A, 9706F273AF680AE2537D02BE41A2C980 + 21: 30F76A83CF8010DF0F49F73C06435E0C5D85EDC6E3, 1F18354A73BF506D229369836855EFD5 + 22: DB9688FB58EB83AF06A579CE56FBC75D93412790924C, C9DD5350751CFF0AB1A8910AC1898E08 + 23: CBD64BAB16852F40FB00D9FEEF5365C773CA14B77EF5E2, D6A02105B1BD018A5BCF47A69803248D + 24: BDCE2AA8092D4790041750DC922F2D6AA12DB3F41A547C7E, 3DF09D758306DAE21C3AAAB3FC51623E + 25: FDFF0AFA4D94CB3019AB27234259ED225B1B3B0F2BDC32CDD0, D64E69725D638D9F0F90C44C6BF51722 + 26: A9D2CC4F7FB98D54A78293C64C2A41CA19CC1F7B9970F3437AE9, BDFC6B10DD012BA057CCCD40AE14569B + 27: 81FE813C4A6A47D34F146DD943092940ECEA77F85339A219B6134D, 5F44590AE8CDF89E13AE2BE4D32AB7DB + 28: F618779FC6E6F5B7EE3FB4E937097E6A122B979E3DF837F72A8FA3B9, 00F0A3B4C67F68590AAA0BEF2D399D1F + 29: 0A8AB66D218268C9181DB8C6EF542AA4B42E53E4623E3385723024CC3A, F28D7D86317D2F509561DD3392F3EF3C + 30: 9CD50C94ED5391BED5C8CE2A07F8955744B275B6C5E5B6F453A5E6185C03, 048E889FF70729C55582003ED6169E0C + 31: 1CFD6D8EF6F44265703544AFEB2BBA2A067BE8DAB412E071B66B70E357238A, 0A5BB055E00D42F4291CAB3813FC2946 + 32: 8E6E6433E4FF879155E0612F17EFC00AA8D5236EFAB5D9D6A912898F3124B588, EDF81BB73FF9288F315B988413432823 + diff --git a/notes/gcm_tv.txt b/notes/gcm_tv.txt index 79d3b8d67..d7d46d987 100644 --- a/notes/gcm_tv.txt +++ b/notes/gcm_tv.txt @@ -212,3 +212,38 @@ GCM-anubis (16 byte key) 31: 72DFB9E91A78EAFE758B4542206A4A957B4523A58428398C11BCF2AEAE1938, 307D0B876130E82804C1167E03B69B2F 32: 7275C6EBDC2680DFCB73326A987D2FBCE83E40A9AEFE6351CFDA7251A6FE10A6, 895E6EEAA9BD88594903325A063CA45F +GCM-camellia (16 byte key) + 0: , 477650012AA6284033E1B85321EEF770 + 1: E1, 2E95EDCCAF3264B5178CD6ED0F2EDEEA + 2: 314B, B11392D89769FCEEE4B8170F8ED1F98A + 3: C7CF73, D79DF351C70A7DDA124355490EAF71D2 + 4: 3C369E92, B9345C0A6E509B10A1245F42BAC2070C + 5: 6F5634E263, D781B8F61B104158D822CD04A9FE7998 + 6: 299A167791D4, F1707A7EF00815631F79AEF3F3CF2599 + 7: 61C5184DE525F1, 615524D1CB7DDA84EE5B91647449AC8E + 8: C724705EF011DCC7, 5F78479065F8EE14C07C909F12AB9289 + 9: E1466E81002EF30043, 143651985FB01E9882D923615DA0587F + 10: E252A74713C90B153C30, 6166F77FBF04809553936EFF256593C1 + 11: FAB8BC72140D01EAF5F015, 1756C4D44B412F078B0476DAD3711DA5 + 12: 774DA96F528D758DC098157F, D169FD2BDE61020499B482786BF14046 + 13: C15708A21A56963D342CCEE9D0, 9C3416DE3CCBB7BFDEB4CCB0A0B767D2 + 14: 52EDEAE7AFC4D3C77E7ACB31B1AE, FA98CD47050F12F7A95AF55EA29BB57E + 15: 48ACDD91D755D9F8602DB17F41C1F9, 5A0CC2D372501E38ED3EC44BDE185E0B + 16: 9385B12D8EB0F0507BA643958F4EF377, 8FE23300220D1D2A8DEFF7BA69CC28E9 + 17: C31A9198E85864D8BC020B5F61FE1ED596, 9865C80843631D26B02A0369B5FCDF8D + 18: 4D159E1705839309E31C95E12A5BEA81277C, 0A8907002FEC82725530B4FC2BBC2B82 + 19: AB6B471DD358000FA8C489B06F448508AA7051, C87EEA614DEC03B4EE2724F6E1CB70A8 + 20: BFB0EA4F27CEC231815F07ED50E3AE8156172BAC, 09244CB698982CDE8C9030FC309409A9 + 21: 259FF16BCC807B01FE4870161CD0F06A92DBE886FE, 86A9D502C6BA9804D26EC4B8CA419090 + 22: 01FCE8F5DBCC4B2351A3319EC1737A84E8D3C959CE42, F337E99A62357057BB508398443E1960 + 23: 114602337E1655C3965EDB3E7BC4428F7DAD1485D5FF05, 67287E94DEB5D255D512E89508E85B47 + 24: B0B95F745C9433B741F8EB6EE36117C979CA65E6B9D8E595, BB75BABB42D9C73C4CCF8F9E1F9CCE1D + 25: 4DE486D47096B3EB1AD2C6A6F9248DA1FA2623B339E787DCAA, 7BED5402F5B5AC690488C6830D484FD8 + 26: 40C5770A6B0A5C14AD168C262BBB3BD512E12654F6F57B13280E, 3E123FB667B2187D2DEA581C1E1EAF3E + 27: CF20B534737142322FD08B2AC9602F4C447BDD91BD00FD820ADE78, EA8D30E6CA004F31CFCCCB47F0BF7A62 + 28: A61AAC29A28EAF0192E3B4646E0421D254B12C3D11F491909D18712B, 92B39BFF07D93AEDBA3AECB974859A17 + 29: 6782FAA7F0D18AC1989FAD68C5C2258742EC691ABE47F744E6E795FF74, C63AA120F2889C6996636DDFB15450A0 + 30: 79CB100D91BC41C73473723F5069B5D38C7208848B885E729A9604BB053C, 195D327AECF7F6D2BB1CFE019A0C2C0C + 31: 7753C753224B63EB00E2773D5CBA726F2B2AE54097E13A2CAAFBAFE7F53791, D344D335666E06DC87E8E30E6C141DCF + 32: F8BDD6BD3B27237424BB4E7871F9D893D204D8A4843E8AAE155B844716E2BDD7, 40806139E1038B68346931AFAAEEF1F4 + diff --git a/notes/ocb_tv.txt b/notes/ocb_tv.txt index 6429228f9..78195e80e 100644 --- a/notes/ocb_tv.txt +++ b/notes/ocb_tv.txt @@ -459,3 +459,38 @@ OCB-khazad (16 byte key) 15: D870479780CC5B3B13A7A39029A56F, 003D3FCD31D497B5 16: A47BF1218AC86A60F6002CE004AF5E50, B4EC27091D5DCD58 +OCB-camellia (16 byte key) + 0: , 6972CC27A9711EAE6654851AB8E0C53F + 1: A2, 208D783961FD532E14376B4EE904FE52 + 2: 1177, C7CC74015F7EDD9A72F7435494D8A050 + 3: 0F8502, F1A708AA0F485A554E2E76592CD9D7F4 + 4: 9986180B, D47186A8B539F890824DEBA223861ACD + 5: C0FF4519C3, 4430A9453016E4974CFB5380A1F3E95F + 6: 2AC54E3E6A0B, 6E320BE8DAF4BA0462A57BECC574740F + 7: 846053E1A37A6A, 5B91B680B92517781DC362C2F3E144E4 + 8: CCB09ECFF76EEE2C, F91E7E245F4C8A404F3ECC7DE49261C3 + 9: E049E2AA271388106E, 8C6981A160D831F4DC57FACE5ACCF006 + 10: 761782341D52BA8AD12F, 672DC4B06DBBCED80381CE4845757F0B + 11: 92AD781DEC4549940265C6, DB04CAABC54E71FE1A9C41DF1ED5C52E + 12: D507B77EEE9BE07EAD700143, B3EFCC0B27DC85166E04E7BC39E45C58 + 13: 5AA1AD6B9CAE3001D4C1CC4048, 424D8A22F7B9ADA30AAC0C1D3D4E77F9 + 14: C69E96F7A4B9A6F0F2C7EFA72C26, 678144F802AE9DD83D11877779B48972 + 15: E2596B3FE48EF6EC50D857C8B4E3F4, DDB3BD2B8AB2FA71C7F56C8E57AFF2C2 + 16: D81664A002E03A75E08CF16EE7670E97, B56A0B0955E15E62C557C6E66782AF4C + 17: A8F2696A972A87C784FDC775439470D822, 36E3AD03CB18002A17D49E466CE64814 + 18: C2B537D807BD1ACA734AA072D9C2B836F588, 449B05D145666D1E5A92E204FC3507D7 + 19: D5418F1288BFA7D39D23B3C6ECF797397D3D44, B0CFBA612544B8AB159E9D4AD1FFB3D4 + 20: 2F9522460182291C6F264308E0363B9FE312E517, 1EE4CB38075B67463FB9DE26DF9D581C + 21: DF2881568BECA504A66E4B15BEA58AE6E99D0270E6, 3283D46803FC33098BB262FC1D2B2157 + 22: 4B0083A4CF7E166C8466A5B991AD0CDF71F9DF010EE7, 7C91D9A5DF6C76CB02D83D8C7F3D8D07 + 23: AC0457474B4193647D62906BD08D8C8EB32BE151555B68, 0A448FF3C468D7CDC945724172CEB66F + 24: E6E7786EBECDC296F072CD66C89141C700DE2A8B5DBF6549, 68ACCB5FEC04717FB21FF3B46A34BC74 + 25: 860865770047A9798D90C9365E9C9F8210CB804D785D65E2C0, A58F22FFC4CBFE3BBA451BE4B3B95723 + 26: F157588B4F98D798E6850D8F04ABF9905C1BBB2D055ADE1EA424, D6960C1EA6DAF225366374333D38EBDB + 27: DE3431977821BC861CD88E4236BCAAAFFE3C894607498FB8D68746, A3D23729464BD38338F4AC5B4D9F5C81 + 28: 3F2F0AB546E118B76B937D539806DC02D02A5D42D64926A9E1101D66, 3C0D2D23F5DAF7D36DDC0F87B4163F42 + 29: 3F9FFAE1D7BC62BB80A2FA2728FC33FF02E26CB9F52EA8D03FFE95A49A, 96B45B3F946E629ED974EFA7B66F5DDF + 30: A398B66C8425CE9E8A6BF5AB900CEA1EAE811E06AC7BC0D69A53FB2015BB, F83411C72B7DB201B254565D1DD8D1BF + 31: 9C760ED6C10A80C52F092ED20AB1D03A52427B6235F3C7FE7541033AACDD74, 8AB98FCA89D1245B177E0AC06E083024 + 32: C38F260587B3BA9919601BD0A56909FB36ABCEB8968D08DD6B74F1EF5ED7065C, E357D0D56124276790DACA38D95792BB + diff --git a/notes/omac_tv.txt b/notes/omac_tv.txt index 56d8da6fb..9f8f337d6 100644 --- a/notes/omac_tv.txt +++ b/notes/omac_tv.txt @@ -459,3 +459,38 @@ OMAC-khazad (16 byte key) 15: BCAB623CAB7AAA23 16: 9BCEAB857596E478 +OMAC-camellia (16 byte key) + 0: B5664C5148FFB45297703BCC46C19E4E + 1: 126EC31A554E8B3B635DE4617092ECE8 + 2: FD57148685F4AA85AF48017AFD72B410 + 3: 1427607464A408C1775B4036509E9659 + 4: D8F5A7112CC8A9DF28B331FE7184BF08 + 5: 0E29B0F09409DABECF645F05C4A5717C + 6: C4155442FDC29685028AF4AADEDCC266 + 7: 92356ACB98AE2EDAABE0D3ED0C90772B + 8: AA3C828618F72258D91BC391876776C3 + 9: 189458BA4D98E85802E7028E5C57A25F + 10: EE652D70328DA00D63B42A5E85D70E63 + 11: F9D1E5F8E1539F2D657A047755CD232E + 12: 56FF5979FD3DEAD90EAAAF79A9AF1DCD + 13: 7E8B39D459D5AB449A8C5917B0CD0C4E + 14: 822D9B9C434C6FF7F0E5A25281740A91 + 15: 654909D2836CCB06501CB359C717C1B9 + 16: E8996FC89D47C91543B7BA3DC1C34B73 + 17: DC29D51B2372DD7564CF56AF8702924F + 18: AD74D081197644DFE2723CABC991B1AC + 19: 26145C6DF074CA53125F6F386FBEA373 + 20: 72C6C760A70FE410FAD113D8BE711D75 + 21: 099D3B5802D7FB699B6B8F031BE10B3F + 22: A9D5DD3988A18AA7BC6F9C050BDBE8D2 + 23: F7E99E4C3C7D127FF04FF325F7B06997 + 24: E99A2F7547B5C6EDF3BC2EC2B8F05198 + 25: 46C42FF49FCCFC49FBC99FEB08FEF10A + 26: DC349D600A754F73ACE6A7D2D00D3551 + 27: FC2E5434ABBA44ABD9D724A9BB6CA2A6 + 28: BA923927BF0074AD73BA8A6914194297 + 29: 7DAB39F8D7E5CB93265568E6713C7CCD + 30: 9F60259B759B68E1C8F89CC36C7E170E + 31: 7D611F8BFEF0491CED8815C0E3D4CAFF + 32: 31E04DE5F9D1403C660E39891DE0D8DE + diff --git a/notes/pmac_tv.txt b/notes/pmac_tv.txt index 38ed68334..a7b148a01 100644 --- a/notes/pmac_tv.txt +++ b/notes/pmac_tv.txt @@ -459,3 +459,38 @@ PMAC-khazad (16 byte key) 15: 93098DA8A180AA35 16: BACE2F4DA8A89E32 +PMAC-camellia (16 byte key) + 0: 33C03F6AA205F3816A17DA92BEE0BAD2 + 1: AD1EC293DD032511579235B2F29CC909 + 2: E71363EAF5A311DCFB035C69BBCE5DC0 + 3: 22661D6CD3496FB5C9B3D89FC62E3981 + 4: B142A96AF9C481B61E55B7B5896847C4 + 5: A286C0769989120F8A31A8DAD7574F22 + 6: 09E711382FDB6B938C802D11A66EF657 + 7: DF9ABA4F5CF5B0647F045C3AA631BB62 + 8: 499A8F68DAEC7FE56E64DB59B0993741 + 9: AFFDA4F40A1BDF673EE9123CAE321F16 + 10: B6F2E39D0126AA85D9152C4457365235 + 11: 2922AAC2FF4F0B77DEE4B3E28EF5094F + 12: 369D18F985D18B5ADDFFFC1151DE6BBA + 13: 1B7641D1A38C4114EE829B7D25BF0EFF + 14: DEF9092BA185FD5238A25C6FCF410C52 + 15: D59FEE8047D64032329318DC7A2277B8 + 16: B4561A4A092E031F8FE998FAC87F9BFB + 17: F27EF7D0823B056F692BA369D1B2E7B4 + 18: F62C4F7B749CF31A6F5485BFDED7EEBD + 19: 22BD3AB334BE6E04C84D6197FF69CAE3 + 20: E617D108BED8E9ACBA55FAF60863F8C3 + 21: 0DB60AE0725D37855F3AF1DDF78E98EB + 22: C76DD5A075AB30AB66FC448BD19B6588 + 23: 60231366598BEB2D16D33A1A8019B9A1 + 24: 247E925C96064801490A1D062A0C1F18 + 25: 1C1081E20DE3BE26FF24BEC3DFBA9BF2 + 26: 3B16562B3CD862C00A03B7ADC99E46C5 + 27: C1E8BA560851254640D523A0CEE846AF + 28: C36E8CF324A0A4EBC6C76EA01CDFD158 + 29: EAED84E721777F5E30184E496DA2C0FA + 30: 6655CA0D8741440212AA0DB218E5C7FE + 31: D5C0143E1BA233BA5F862EE6E11A8F58 + 32: C8DAF08BD68F4AE401C6663393C257CB + From 6dc089015adfc4f66679b6b680476422bd6b6c01 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Thu, 6 Oct 2011 22:43:42 -0700 Subject: [PATCH 0047/1192] Fix LTC's bug in PI1/PI2 of Noekeon. Add vectors from BouncyCastle. --- src/ciphers/noekeon.c | 53 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index bdbcb2a89..02869a787 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -59,10 +59,10 @@ static const ulong32 RC[] = { a ^= c&b; #define PI1(a, b, c, d) \ - a = ROLc(a, 1); c = ROLc(c, 5); d = ROLc(d, 2); + b = ROLc(b, 1); c = ROLc(c, 5); d = ROLc(d, 2); #define PI2(a, b, c, d) \ - a = RORc(a, 1); c = RORc(c, 5); d = RORc(d, 2); + b = RORc(b, 1); c = RORc(c, 5); d = RORc(d, 2); /** Initialize the Noekeon block cipher @@ -224,10 +224,51 @@ int noekeon_test(void) } tests[] = { { 16, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - { 0x18, 0xa6, 0xec, 0xe5, 0x28, 0xaa, 0x79, 0x73, - 0x28, 0xb2, 0xc0, 0x91, 0xa0, 0x2f, 0x54, 0xc5} + { 0xAA, 0x3C, 0x8C, 0x86, 0xD9, 0x8B, 0xF8, 0xBE, 0x21, 0xE0, 0x36, 0x09, 0x78, 0xFB, 0xE4, 0x90 }, + { 0xE4, 0x96, 0x6C, 0xD3, 0x13, 0xA0, 0x6C, 0xAF, 0xD0, 0x23, 0xC9, 0xFD, 0x45, 0x32, 0x23, 0x16 }, + { 0xA6, 0xEC, 0xB8, 0xA8, 0x61, 0xFD, 0x62, 0xD9, 0x13, 0x02, 0xFE, 0x9E,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 0xD0, 0x42, 0x14, 0x08, 0x60, 0x34, 0x8D, 0x37, 0x2F, 0x01, 0xF0, 0x46, 0xBE }, + { 0x66, 0xAC, 0x0B, 0x62, 0x1D, 0x68, 0x11, 0xF5, 0x27, 0xB1, 0x13, 0x5D, 0xF3, 0x2A, 0xE9, 0x18 } + }, + { + 16, + { 0xCA, 0xA4, 0x16, 0xB7, 0x1C, 0x92, 0x2E, 0xAD, 0xEB, 0xA7, 0xDB, 0x69, 0x92, 0xCB, 0x35, 0xEF }, + { 0x81, 0x6F, 0x8E, 0x4D, 0x96, 0xC6, 0xB3, 0x67, 0x83, 0xF5, 0x63, 0xC7, 0x20, 0x6D, 0x40, 0x23 }, + { 0x44, 0xF7, 0x63, 0x62, 0xF0, 0x43, 0xBB, 0x67, 0x4A, 0x75, 0x12, 0x42, 0x46, 0x29, 0x28, 0x19 } + }, + { + 16, + { 0x6B, 0xCF, 0x22, 0x2F, 0xE0, 0x1B, 0xB0, 0xAA, 0xD8, 0x3C, 0x91, 0x99, 0x18, 0xB2, 0x28, 0xE8 }, + { 0x7C, 0x37, 0xC7, 0xD0, 0xAC, 0x92, 0x29, 0xF1, 0x60, 0x82, 0x93, 0x89, 0xAA, 0x61, 0xAA, 0xA9 }, + { 0xE5, 0x89, 0x1B, 0xB3, 0xFE, 0x8B, 0x0C, 0xA1, 0xA6, 0xC7, 0xBE, 0x12, 0x73, 0x0F, 0xC1, 0x19 } + }, + { + 16, + { 0xE6, 0xD0, 0xF1, 0x03, 0x2E, 0xDE, 0x70, 0x8D, 0xD8, 0x9E, 0x36, 0x5C, 0x05, 0x52, 0xE7, 0x0D }, + { 0xE2, 0x42, 0xE7, 0x92, 0x0E, 0xF7, 0x82, 0xA2, 0xB8, 0x21, 0x8D, 0x26, 0xBA, 0x2D, 0xE6, 0x32 }, + { 0x1E, 0xDD, 0x75, 0x22, 0xB9, 0x36, 0x8A, 0x0F, 0x32, 0xFD, 0xD4, 0x48, 0x65, 0x12, 0x5A, 0x2F } } }; symmetric_key key; From 0e143a5cfecd5bca791beb6b299bfc3bde9114a9 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sat, 8 Oct 2011 03:03:01 -0700 Subject: [PATCH 0048/1192] EAX-noekeon vectors from BouncyCastle --- notes/eax_tv.txt | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/notes/eax_tv.txt b/notes/eax_tv.txt index 40135dc8f..02df11631 100644 --- a/notes/eax_tv.txt +++ b/notes/eax_tv.txt @@ -352,39 +352,39 @@ EAX-cast5 (8 byte key) 16: 70CABBA983179106AE7FCD5F1F31D5C3, BF7F9168F4F82F56 EAX-noekeon (16 byte key) - 0: , 556805EEA595CFB9A30FAD196103D7FD - 1: F5, 0A7DAEDFB656526CEF4DDBA8087A227A - 2: 7B8C, 249895D79962D5B4D18FE07366281B72 - 3: ACFF15, DCC489D24832EB106F576AE6B6EB957A - 4: 08ADE7DB, 0D3215999E9960EDAB29B78744C7F139 - 5: 66139213F6, 505E1E7141D043E903C26EE0959EEECD - 6: 078B79F880A8, 35B7EB326A55E50332866EEDB682EC20 - 7: 2809E34D9667D4, FFDEC555F68524A09A6ABACA372077D9 - 8: 93D267DE1EC635D3, 4FF3561990A56E4B374618722EF850FF - 9: F377A4D93FF32F4A51, 91D4070423A90FC54D305169C03F49ED - 10: 6244B717E082993EB7A1, 2E3A8A354AFA9473667ED7FDD46BE9FC - 11: E917559625D25E6E5F2EDA, 19295C37A70314CC9A1D11FDE8D23C92 - 12: 1E6DF2EE112A893AB14DFA92, 12C4A89D4CD65F8116A03A135AFD3701 - 13: 47B18CD762E011770E203CF605, 434909A97E118B20D3AEDC79AFE33A9E - 14: 72D9A1A7DA6F33D5E0B927F9F32C, 779C23714FCAA2B2321EC7FB5B03E222 - 15: DA8B830FFCB3DB274807F780D33240, EDC2F1C8A401F328A53392597730B007 - 16: B53DD2BB840AD933D36A7B5FFDCCFBBB, 4EC0E6D1F916BF633869239B672B37A1 - 17: 42936BB9A936C30408660855F4F47F3314, F0DAA6DDA15585E1697ABBB4790B15B5 - 18: 00372E47F5BA016F1B2A1E680B76AB02052A, CDBF3D241BF7FF96D3DFBEDDB872E901 - 19: 8AA236B0C8BEF6F67A97C2DF90628F6E5838FF, 731DCD61F7F26004C03519F9500EA824 - 20: 55338647812FC9D86CBDDCED7120268A4D43F8BA, 0E61B3C835CAD95FD49FEF002C014E72 - 21: 435820B28E52154B47A04D5E635D8FE37FA47FC985, F6A96DCE4917E8D7C610923627E80970 - 22: 0D30C15B6FEB4A48B14DD15D41A4B25D442AA677B25C, 28E15CCB74AE992C68BDDC8D87802050 - 23: D9D701F9AD6B0E13D2CDDA15A5194E7CE8BD2C02137391, 2DB9A15884E9C996C3D6B5BDA44B9598 - 24: E2390AC5CE10CCFBC72106A52C7F180CB477E3C193CBACA8, 22D3F7DCD6947EA4E78DF57A8E1A9A59 - 25: ADEFB7D9500658D34996AF6BE6336CD78891064EA1DB8E9785, F239D67D039A15C620A7CD4BE4796B3F - 26: 89964C90ABF54A6DF9F13C3681E70C702D80A17BE79F8160F30E, 6336F729ECE1ED7368669D75B7E2DCBA - 27: 576B2813CECDA4F905BD5D58349EF070FF41B7EB6BB2B01B061B0B, 125324CBF2ACF1011A44A99A11EC8AFC - 28: 430B957481748519A60494F0B5F698F34B1A8235B00AC0D1F0A4442E, 1E80A7FCEBBB8E1E12D6831906154485 - 29: E781BFE5FCDE0BFC056CC86C4A0B9DD3B815BE8CA678204CF47289B5B5, 190D5AAA9EC1CB4CC86FACE53BF1201B - 30: 78BFAC07A9B7B2AE9329BF9F9BF18A1A49DD9587001EFCA00E9AD9752764, 4FB5ECBEEB0995C150EBC66508FA19C1 - 31: 7D6C20694109DE21F7955855A8FF832347518DD496C2A114DF142C68ACDEAA, B25D4BB34056DC091A7A3950D46C32EC - 32: 3E1E4395DEC1AFEA9212B95F37E679B6E2D14DF23C5DE49018C2C8038CC4AD45, 9A6DE7BD41A21918AD504490EF4E581D + 0: , 5CB584CC68025F830B42371B9CCE99EB + 1: 65, 69D866C00E11E4311ADCD50AE2F91D03 + 2: 80D2, DA0499598F478A7FF53324908EB4DC74 + 3: 86EFB4, 7DC1556C65F9E7CF2E3A357B38E326D1 + 4: 87387A77, 7B58F421766918A179A999520A6E3781 + 5: D18B9788C6, 924A2FF178FD06BF292A605FCB27BDD9 + 6: 0075EC03ECD1, 78F553564A25A574E6A4857778A2DB43 + 7: 5BF96EC79C2E88, C49CBD1C4F631B35D5A3B764251870D2 + 8: 70DF3B35F6D9B822, 42351BF5C947AF7A0E1F852199B5840C + 9: 2E53748525AF367861, 4986BC390AA0DA1E4E78CB2148A2C513 + 10: 05DE8BAD8C975ACECF87, 1C0F1C18FB8682D76AF9E48D3547D88E + 11: 8B2B1D70F6A74059503F42, 839EE120ADC8BF08CD9A7DF6393D1E51 + 12: 9D7F92F08953B5B300A7410E, 603A43432DAB26882797BB5AA7A75D28 + 13: 4CA551DDB4BBCFA45BF71C49DA, D2743508826E3E39151F21C0AD81C8DC + 14: BAE72091E78013369AF5D0294AC6, 3F0D391BF01C3BA116A9CAF50DC28307 + 15: B037AFB65588B95BC86E1430E0746A, 2399A4C31F55310AE2C4A2FE3379C74F + 16: 842F0B29888C43999545D29CFEFA58DD, 9B6E4FED2A6BE59DC2DFAB407D2FD124 + 17: 86F7DA57E5C9DE9C88EFC1ED0CA61F76A4, E7278F365289FD0C484A166FA9EDB801 + 18: CB94AD60C1FBDC9868DDE0D4674251A644B5, D857CE47FB963DFBE7983D183695803B + 19: 5A0B24FF167EB133808A3FBF89D9895F30BE1C, 488362E61725BE723CE892F550AF028A + 20: 60D43A8C29F1714588672847FA00DE771F2C3D36, 25D7CEF55A2A33953D9B7739F9C98C12 + 21: CC47C891FAB841800F0AC0F746A257062BE9AF49F3, 220A3EE618FB735B9E801F9B3708D4FE + 22: C8E0F9AF7A7C62B6C297B16025DA55BAF5BA13F6ABA7, FA16192047892BC2472AF1DBD95E0D6F + 23: 731BDA5BEFCBA427E715839C21E4A176D0E28F042C3089, 4CBE4BB916EEE773B9299FE2FF0BBD81 + 24: 62C5CD4F7EF81EA4E58847F3F715FA9E9EFB32059D70BA88, 090E92CEED8FB5D472CCDA11363FC904 + 25: F7FD159377B130633F93B4D18BE68B0872905BDB205025E4FB, 6F335AB81AC8507D5F4018F86FB0230E + 26: DC374E5B40E8F4614C2BE685539C97825C7A972CA2BEFF338208, 719F6C042DB09A08C36D92810FCC29FD + 27: 1050C71D491237EF77F4F043D7EDCBD41DA0BC155F1CB65EAA1D5E, 44E7CD8CEB27584340270F3CADE1A083 + 28: 8AE94A4FF500DC889436866D90B8E150B63EDE74074912029FF9C3A0, 3C96328BE53423BEB32FFE0D05F9B71A + 29: A801D1571411396C0727B132AEFE114D7BD486DA74C549E7661F2D8B87, DD6A443497AFC9EB14FE6EE9069AD580 + 30: C79DFE19B0199768EFDD29026863C644A0ADBD14A3F3866DE74EE7AA2E0C, CCB313FE30CD4F04BB3548808FEBAE6E + 31: F658ECDD95F960D7C68D03F9BBADF066F8B9CE8108867C7DEA305FF4124AF2, 8AE64618E77A2806B53E239927787ACB + 32: C92EF301771E89D5BD3B901B380EBE18BD2A193B5989092006E7AC15345AFD34, B450AC584DF13D9C8BDD32DA686A1AF9 EAX-skipjack (10 byte key) 0: , 85F74B6AFFB10ACD From e7b4705fca17321317f4ffbf1e1adf838b8d22ab Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sat, 8 Oct 2011 03:05:29 -0700 Subject: [PATCH 0049/1192] corrected Noekeon vectors --- notes/ccm_tv.txt | 66 ++++++++++++++--------------- notes/cipher_tv.txt | 100 ++++++++++++++++++++++---------------------- notes/gcm_tv.txt | 66 ++++++++++++++--------------- notes/ocb_tv.txt | 66 ++++++++++++++--------------- notes/omac_tv.txt | 66 ++++++++++++++--------------- notes/pmac_tv.txt | 66 ++++++++++++++--------------- 6 files changed, 215 insertions(+), 215 deletions(-) diff --git a/notes/ccm_tv.txt b/notes/ccm_tv.txt index 57969aab4..aa8f9e6de 100644 --- a/notes/ccm_tv.txt +++ b/notes/ccm_tv.txt @@ -143,39 +143,39 @@ CCM-twofish (16 byte key) 32: 839A9BFA1D3CA37924BC6648DED2291FC61736A3638906D9C5DA28A66AA684AC, CD07B83C8E0C3E6FB4115A149BDF6FDA CCM-noekeon (16 byte key) - 0: , FF73C6775C61DB36D9B5EEC812091FF7 - 1: 5F, 7D2AEA62A5202E3C4FBE05F33EBE4CC5 - 2: 0EA5, 312ED15FDDAB6EEEAC6AF9BE9CE698FA - 3: 968F95, FA1AD58B85B93B5A4B5096C881F773C3 - 4: 9A8F4069, 8911063ADDF79E27D9DCEFF3F440E6D7 - 5: A5C0376E27, 9553F44B0BA8039527F8E05CD70AD8B0 - 6: 5B097736F3DA, 405B7EC685FC94903B36AC8E700558B8 - 7: 616810AE303B2C, 64C95A2DF5263F7BE6D1F9F3CF88EADE - 8: C8D69A2E1170532C, 073A7E426266237FD73D8109F55AE5D3 - 9: 3E42CDB7DA4A72F2E0, 48675EA4302CA6BFE5992DE96CE43BB3 - 10: 88532CC1F3E321F66D64, 528B3516C6D9A4B5390DD32C2A2E6C19 - 11: 9216A8FC9A961E7F602F7D, B03047186B783844F5B6757057576B38 - 12: 89B0858D4FDE6795EDE19CCC, F4530A2DCA823307AEDE5AF34E5C4191 - 13: A676E20BB0A5E84FD0B9149BF7, 11B823B315DA93B0E15780851526D4BD - 14: 903AD5C108C43A80436FE2117EF0, EB1C79C7DF20CE2967A99783EA8D6EF8 - 15: 81774C36F46F67159B7FFC24C080D7, 2E9E4812D9A92977EC34922782B6420D - 16: 63FD1C3F692D64B2DA3982FCD474A5D4, 04171AE84857713A9BABBD4564875D33 - 17: B1BF6AD99F83C9173C6C021ACA74C5431C, 38D17D4F6AA3C24B8F3B465EAACE0A1E - 18: 0948D1ED59F07DE44A96A76E05B0B6F7C309, 1848D886FCFF35E85B0DC3CBE5BEE7FA - 19: 3458E5911222F9C555A1054C7D9748876DA39A, 584AFAE72FB6065A74BE016CF39D2E86 - 20: 641F3867185D0605E9D666AB605187E75A1299EF, 6F9332E6FB5EA0CE811E3345593CD163 - 21: 0676622D07733EF31A765AAB1E713FCE329277FB16, 88547474050FFC986930CC04BA8A03F0 - 22: 79861EC2FD2BCC5C12B69F30A1575FC66AC1405281BB, FC68EEAC8F39ED69D312AEABF8000084 - 23: CB2731835A576F7F8F2C2786D786FB6186E2F85D89DA3B, 3ED9E95BC51CF6368E6EF63667B35BD8 - 24: 3CB1C02FADB6DD5483BC5D3C03D944102CFCEDF82B913402, 1C3F60C989A6FBF41A7AF4F29115C334 - 25: E69FAEA5E3D0B76EF9E70F99C5918D934D0E9836F248DB9EEE, 7F1916B2CF7C9A5E3F5581D365ADBD31 - 26: 36779AD755A9DF2DC3C5824DC2F7DD4FFE038628A4E1A1C33AE7, 2BDED3703468D267F8AB7EC0AF8F1E65 - 27: E9D325646A41EE5AA7DABCDE98DE83440A7DC02714BA0AEE017E22, 972F4D7832F3371C60DCD04A6DEDEA15 - 28: 0FAAE3F6028A28A80BBFE71FA7AA9042E538B41A0D514D6EB4EE6029, F7B3925495E260249ACC6E1CBE956BC5 - 29: A9CC39EFFEE354C0E0579256AA85CBAA7B10E670DD3828A7A05DA0F49D, 28D9D20187AFE70AD9DD16759F0EFEB5 - 30: 032F4BBB4EBF2E65758C541FDAFF2107DDBED399739849F8EBB41AF9711F, A3436981ED637CE5EEE01B380C46ACAD - 31: 7B321ED831CE96A603668E3E74BBC7453749A03D04A1B38E95966E6CC488F0, 88D1DADF2C1EE0BA579D0A8A90C1E62A - 32: D862B0BD0E2178AE05AEFB14F34C791547C5956F1F3B5BD525926578DE383A94, BF32CFE059F27222DC55D3E7CE7C5F10 + 0: , AB924F56DFA05F4E8628C14111272E5C + 1: 08, 8A76DCADA7CE53A0F4577E67B0B958D7 + 2: B602, E0BEAC0B1E95C4570A823295E7517C25 + 3: 50E4B1, F874F8B5F2806F64AE0AED151821C638 + 4: 990F28F6, 9AE2D6D5576D1C4722E2E3C11F5D98FF + 5: 297104DD8D, 7A245E5F5E0F4C3466E16D5EF2B96D80 + 6: 7B6E9776EF05, 6B540166DE5E154D7A3A34EEA3FAD5F3 + 7: 67EB1922FAB0E1, 549F39F7C3CB17F0EA6EA9C75899BD55 + 8: 343E752F0F956C7F, 19CBB59CC4117DE6EB9924AB0CE2C9B9 + 9: 98A25FBBD87D8C1829, 6E3D4F0ED0C5B9161EB11AE9600003F6 + 10: AAA54C273F69638CFB54, 1192FCD1F9F543889F3607CD6B623AA6 + 11: 51B3F33EF8B1F38438618B, 8A704F5B003A21E4033ABFCC6C53577A + 12: C7E5167D81B23F47AE90DFC8, E218F7DD222CE31642CB06C329911CD9 + 13: B065DFE10B9C32F1B028AACE4F, 5EC4DE45C29C78D1CDDF2A6AC05BD53F + 14: B5AAF0ADCA03812F251C8A2BE745, AA353E20F65237279643D4CCC06150A8 + 15: 88AF734661B83CBA42FF983C260B63, 8F20A5190A218B8D392ABA1295CBF905 + 16: 6663AE30F79A110747D6678784330BF6, 142196DDD26668E08D196BCE0989AE01 + 17: 8153816C6E9C449B0439AD7892DF8C0492, 58B376CF240C37A08337C7794736838D + 18: 1611C22134C06CF8F43625017CCC65B6E305, C0443028C8DC5FB78F9350C4A8D1D32D + 19: FD2EEDDF2B20F7623D854FF4E987DB4196AB2E, 8B2CD7C72438F3EB071A33A7C65610B3 + 20: 641256A9C543D0860E609F1AABC36EAB515E29C1, 0E1A0FE82BB18BFBB3D13BEB84BA185D + 21: 437719619E96C3AD2080470809F7CDDEC3011EB6E9, E31934C5F0C2E4A04A4ED533A98C795C + 22: CF2B11E8660CC6E650EDDB2146B11F864E01B4C99DDD, 8647759347E7A4FD2CE8AC17AF4186C9 + 23: F339314695B539B715A7E5FB4799029CC133CEE26A2E86, 136274C51D9797986E92F9E540A80EB1 + 24: 38F843B9DA155D57166D310D85406E72FB382604C2EA4CE3, D1D7C6397599ACC2EB5CF1E06975B423 + 25: 29E497528D72C2BEBB12663F71B3981705BEF60A5451FAE4F4, 50F6C796CC00FE590E5E975206045702 + 26: F16F583E1FEBC78F5AB0FA61B5BC389D3C16B62ECA7C6A86BC98, B3643EA448ECA0511312895B63193516 + 27: 80347C7148FE1A5B078A27B3821DDFD93341F0351F4323EFEA6632, 8AF133E83EB316E615F1BC9DF241E23F + 28: 96939F79855C211B23E45771DDA2C3AB81C2672F94B87A7FFE46FC84, 4E7DEF91D1A102667BF55922B2531E6A + 29: 4789028961FDB78E8821A1FD9AF93BDB3CAC5C75566613E148B4439E90, 470DC4389C466AE79051A62F8122A1BD + 30: 7D2030ACE87827B785D3EFA3AE5CCB3DBF3A06DE4BED2D4FAB31DBE90F58, 55437514620E6B499C4FC01445FD2828 + 31: 276940205F5B869E40BBB064BB0DEF9D86D520DFCFE531A77A55AA78DE8709, F291F6A4D7EFF52E5EE47CC3ED7902B3 + 32: A75FCDC9F4E38C02E70D885353F5E3E7E13A14237D75EFA0D53B0C808EAF10AE, CABDB90052202C4EC777936B6097320F CCM-anubis (16 byte key) 0: , C85F41475E06F25682F855C3D45A6523 diff --git a/notes/cipher_tv.txt b/notes/cipher_tv.txt index 01c302331..bc76ea4b5 100644 --- a/notes/cipher_tv.txt +++ b/notes/cipher_tv.txt @@ -1647,56 +1647,56 @@ Key Size: 16 bytes Cipher: noekeon Key Size: 16 bytes - 0: 18A6ECE528AA797328B2C091A02F54C5 - 1: 2A570E89CD8B7EEEE2C0249C8B68682E - 2: 828F4F6E3F3CB82EEEF26F37B26AEA78 - 3: A3CA71833499F244BF26F487620266A4 - 4: 333ACCE84B0A9DE91A22D1407F9DA83C - 5: 224285F3DB3D0D184D53F8FFDC8008D0 - 6: DE39E2973025FE9EC1ACDE8F06985F91 - 7: 2F00F45A01B1B0AA979E164DC5CCFE10 - 8: 43775F3CBEE629EF6A9BA77CA36171D9 - 9: 1E6A67ABF1B6ACF59FB484866AC15A86 -10: 70490989E2CD2145730921CCC37F0A17 -11: 67B0DD0EA903486B1CB56591FCF42678 -12: 774AAB71FF28E49A30E1E718D98114E8 -13: DF4797990E1C65C9F6735BD967164D45 -14: DE2779DF26FC1B99F576ED4CFBAE76CB -15: A13AD17440641B3460A01175E3274AB9 -16: 1166499165F2A1196CA2DB831F264E77 -17: 35D24A385416CF2A44AB97A4AEC45E14 -18: D3D0E0DC962B1AD1AED92F57129088B2 -19: 00EF3E246B32634ABAF8BEE31D5C592A -20: 79BBF3F807675B9F264BABC67DF4C2AB -21: F391F2D58F0998F24BC9E5FA75DB9E99 -22: 066EF13C2617E97E6015B86BA1E059B2 -23: 5B0E2D7AE1E2734B9D5734C87F7BE272 -24: CDF7020212B7CF21F4817829386A6F8E -25: 24873E1A0EF4908DF85114ED9BDB0168 -26: 99904360C843472F71AB86B26DC78A00 -27: BEE70B3735A67268578FF107C328940B -28: 97DBB283536BC8AE8DBF56F3474C7740 -29: 2F4C903975EF709E004D24DC132A8A51 -30: 3EF0859A281782F905198C607FBE5C43 -31: 2D9CD48BC6A99E86468CBDD2A55C7D5F -32: 5518D3ED18D5E5A62752CDF0846D0C77 -33: F751E9CAF107BAD8A1F1F9C374277A6A -34: C5BA4DE907C41221FBABC5EC43710D0C -35: 5CA48836330870365A10E7B676695C9D -36: 937A964E0EA4D246E97293375B167EFD -37: C0A876CB6957717541A90CCCB034BFB8 -38: A57C93A09F9160A28D3D4DEDC987746C -39: 1FFA1E0B5EE0F0A18425F62717254419 -40: 8411C87262AE482CFC43C3092BEAFD90 -41: 0B9BB379FB3587A9ACEEED4771D8DC20 -42: 3B32EDBF9557E1DFBCEEC269B51FA494 -43: D1104E2888679A9EF6A13AE00ED7E1FB -44: 0EC9849BAD58A279B42B5BA629B0045B -45: CF206E8D3399918E75DE4765DD743060 -46: 55CCEB28E27D4DC7CE2546454FFD2C33 -47: 6E2339281583420B76E1750D35296C12 -48: 7800EC3D8C344BE7F2D2812F5AFF3DA4 -49: B80F4B0BDAA54A04D5A26BCA185F4EA2 + 0: 22C082F55D7F6D861B11C36911BE694F + 1: 0485388F24B147918116347E942BCF4A + 2: 47388A4B060617B21134D3B4EB1CABCA + 3: AA8866CFB9D7507CC67A7F271AEF11E0 + 4: F6A078AEF1BDF8B621A76CB732804FF3 + 5: 8301F76E39A4E8C8AC38A7751B26DD31 + 6: 5BE06821E7B23277B808143F36BABDE0 + 7: E326A3A32F4F0D8A4FA94877997DA11B + 8: 2BA7773B55F90B5399C11EA80D6CADEF + 9: E64776D92B81770E51E4E2F44688A59D +10: E987ED52D4C33B2668BB9DCF0889D5AB +11: 351F5BC075D06BC6977D31A442CCC2B6 +12: 645468E2497FA5EB913C04032457C1DF +13: 10CFDBEC689B01FB969AA2C760F76CCB +14: 0BC5B171A3B727B9594238EC522F72F0 +15: 887D105D54D8EAABABC892F04F3455C0 +16: 53CC30B5F16713AC77205B0F194FED59 +17: CD63AD99CC0D5F34D67C363F99F7CF1E +18: 59BE7B22114383FE8491304FB291D2BC +19: 4B107C8D37CD46EF1DB68ECF4588FEF3 +20: 46034C755D278E368305D1133BA6B4FA +21: E2472AC6D4048AB59E126930F6476D06 +22: 821014CDA5084A85058F1D556854D33D +23: F67C3FB5CB1271B454810FEE632F7EE8 +24: 57705CB352AF1A8B342E1E555C9DAEAA +25: 72AB36C1A8D3C2111330D0EF78726227 +26: 1931783D7E3DD6A33962BAD6962D8A33 +27: 06029A07CA801027D97BFAFF4719FB89 +28: D78B7E4E3083A60610C42BFC03810590 +29: 3CA3B14C5741A43F1FF5AF2179684DBA +30: D1BCC52AE476999E25391E7FFDC59C81 +31: 1E102DBAA4224ED5E32515A59A07EDAA +32: 81BE227D2663DBB733F9CB5018AED67C +33: 92C5A77D5D62A16C031DA0BD968FBAC0 +34: 9EC8E61B543BE73AAD711A9F58C86790 +35: B6A1FD059A7D8D73C143C17D97E4C177 +36: 0316ED78EA520EE98BB568413A390E44 +37: BEFEE68550E2FAFC4AECBE309031BEFD +38: D394CBCC38A47482B2B6900BD68D6540 +39: C58F2EE6C493BD1EB41DEB88A169D240 +40: 0A45FFA6D6E888B1F6E95E388818C6AE +41: 8A9CAD2C511F284CE1D77167E5D23456 +42: 577CB9155A69CA34213FFD15E03D54F4 +43: 2AB7DD760EB7DDDD3883A6966B9D44D2 +44: 4564DC5318B0A940CBBC3C1607804B70 +45: 0E9F42D9C2AC03694CC2E82BA3C4BBBF +46: A49089D9FD9E13DF35B0490E59A9B7C9 +47: D58B3008003D6C8D556D7D76180691FF +48: 1FBC6D5F3F1B0E599DED48FF7A63CB76 +49: 077533478FABE8AD5DC2B9E96E7CC6CB Cipher: skipjack diff --git a/notes/gcm_tv.txt b/notes/gcm_tv.txt index d7d46d987..b5191f8fb 100644 --- a/notes/gcm_tv.txt +++ b/notes/gcm_tv.txt @@ -143,39 +143,39 @@ GCM-twofish (16 byte key) 32: 4D0F751B55DA3A2E0B28DE59E9680669FCB5984E9C0DB942DBAACDDEF0879731, 62F96CFE31D3D6AAA0B9F5130ED1B21B GCM-noekeon (16 byte key) - 0: , EB5A8E30D5C16311864E2D8D32859ACB - 1: 88, EAB88DE1EB7BC784A706B2D7946798D7 - 2: BA1F, DC3CEC6AA324AC7D053EFF7A99AD3069 - 3: 9A1457, 4AB65831DE378DFF71C20249C7BEC05E - 4: 2F9496D6, 800745CF95EAE3A698EDF9EC949D92B7 - 5: 84153177A2, F6A05B654435ABDF5F696C0E0588CB5C - 6: F80B7865C766, 2334D0061FD488D15A6AC8E44EA1F4B9 - 7: 872EA486B4EA9D, 3A49671DE347F675AD7904DDF4255F3D - 8: A4EE5750507FC831, 956D09F7C5FE812C6FB982E1DDBE864A - 9: B5874AC964FBFC1A97, 90FBC75F45BFF58B3A1100393955D0C2 - 10: 92FF5FCF1EC675E02E71, 983C96A7BD4A0DB5D3B877911CE8A6B3 - 11: F7BCA69A9C7033D84A2BA0, D4ECE5BB9FFCBB331A646D9CE8078634 - 12: 5E1041B4554C8CDD14AAF16D, 1EF777F307CB96788B9120FFF8A8BC2F - 13: 7BB7289FCAD209D7992EB7AEDC, E8AEFB830DBAED2B4A790FFEF940A20B - 14: 12776A7C937A648F0A8628AD8C5C, F070283852AC030819EA67BF82C719AA - 15: 7293476D9E935EAE9DEB66F697F662, D6322603671153A1EC1453CDA5978E15 - 16: DC12A86C85E7358919BABB15A3BF5FD7, BBBFA467EBA8124DFEC82DB0137D56B9 - 17: 0CC1DAD00A987F9C57E3660D9417F226E5, BB8AF5A0B5BC79BD11C5D41CA80CDE2C - 18: D0049115D6EB5495FB391CDC494022AEAA48, 682FF357B2BC059765C29AE6CA668D0C - 19: 48FC54A401B4C06CE8567AD298B672191C7E84, 493A4AF4C2A8828FED8442C4EFF877F6 - 20: 90779795821CB1B7DBD97028E29DC1CE7D0CFAE0, E126F485F73B6F7B3894B4CF7E1C5DDE - 21: 8CA5C246C8B7C04BD7171CAE2D1A892D66302433F8, 5D73149A3635A86B3C34DEA5B95CCBCB - 22: DF082B665F7A952B2604C04554B81393FCC7C0B816C8, D3569ED7D431176B286EF22414E4CBA8 - 23: 761908530C9069E189649ED24B6A68A89B067C31E9868C, A258BCD83D3FBC7AE2AEF7516025AB36 - 24: 717048F5A31F3C89D3704F90069AC5D5174118770C65BDA1, 067EBF18F7E3DF4EA13F9ABAC682C2A2 - 25: 08C6FCC5D3099347C3FEBA3858A6C22C51298CB591DDB77827, B57BFBA40BE99DF5031918A1A4E2CA80 - 26: 2CC53EF7EB954234E64CD4D60FB1D7157A489ABABC10900FFCDB, 236E769611D16EB7F463B7578770F886 - 27: 2556B46F2E831223D632F2691329A874F517687AF81B8322AC55D7, E213A90DBC31DC261A45A9AE41CFEEC3 - 28: 71241792728594D69791B80AD6DBC6417D1D14D222DF5E6F834B82C8, 601F97617708B1945BCDA8A82496EFB1 - 29: 5003DC2EAAA23F9E2221CCBB9E20116692CCC99B3CFBD0DDD3A8491E7C, 3743155B792012845550205C8949B73E - 30: D0589675357E850333F854FBA160688F06D122DEC00CC2620DA0B2770765, 20E085752FC4D37791C22501ED1DB6AD - 31: 645B46D2D114EE7329F14AC1D94E6817EB385EB80C61F014F90530749079EC, 8A18DE86F9555A1070D0BFEDAC15B14F - 32: 068389206D37BF5A41C58075FC98901C3B42E6F2F13C09F4E92524021BB1C1C8, 370B86914D63CFEE8303D538A6BEA0E7 + 0: , 24FBBB850691F47A085EB57AE00304CC + 1: B3, 8BCF7A69E538ABB7E8FEECBED90C34CF + 2: 6E74, 393546FF18FE3921BE4755E993FE669F + 3: 523837, 2B89AACC9117430488FCBD3E05C15F65 + 4: A0805168, 2430C64F2683BBB56F5092D4796473E2 + 5: 947FD3FC56, 9976BB989B3054991ED2741CB68A8F83 + 6: 8209DCFD76D0, 2A57678E78AA81509F5F88F448225F5E + 7: E08CB4FC1169B8, 694904F451A25A52022B5DF85BE76AB9 + 8: E1F64D7205D070B8, 42E272E75AF762BDD98243A3083DC250 + 9: D209B87AB1D069C946, AA6E2B0265C342968631D7D0DD7FB722 + 10: EB294F813FAF31A56731, 1946AFF788D597D545CE01339F1344CA + 11: C3623DFC818CFB5DAA7F11, A141D7654E5C5FF853365DF19626E295 + 12: 6C6ECFF070BACB61B625BB46, 176A894AD6F9C4ABBFE33704B4D0A5BF + 13: D9984A7F164345EF6D9E920944, DDABDA0CA76A3D98059DF8288D607C56 + 14: 9D271AB343D8FD4B7B9CAE828FEE, 3AA2FF2B08283ADDBD8DA9D825DD5DDE + 15: 1BEAD524FFA2812526C66E6AA262C5, AB586F0DA87D813A4E5DF5589D0EDD77 + 16: FF2CCDC2F7DCAD46B0557E265B849CED, 61D2163972EB0521F1AEFF5B157CE226 + 17: 8B39921ACBE0603970F5AED3430D8C7733, 2C4D0DA0E3A87B20255B849DED865C03 + 18: 6716B5F4169F0E609DE1BDC62E34967030C5, 3115A1F7E06D2585115CA39BE13D8F02 + 19: 0E59D5EE86573648C06A47D11DBFE1D504BB51, B080AC131829D9B9F004E672506D17D2 + 20: 74BCEDA70D4B870C2F3C1FA07BB4314D32D5814A, 1AAEF188554ED4B5FD0508474DC06046 + 21: 92575752FD1A2EE03615F71F09A776770EF817975D, 766061C717348F33E1398C8BCDC014B3 + 22: 5D6C261BFF784690911177CA62DA928D35742663C484, 227A7468C3F133FD26056F781AA0DABC + 23: D9901B1E1A1F077C93B9BB5929B76A0FD00540056032EE, 343997846C6FB089E833B15AAB16F28D + 24: 18C64411F459E87F96ADFD94ED8C6CC787C37AB9D02FC709, 7D4F5CBC141C31D44DA558D8AFD6F9B2 + 25: 2B5617D866AD278CBB3B3601E3F924C209857DBABF487C36E6, 481FF0E5F97F65FBEF74C4FE84895B08 + 26: AF03196009787A666CF901DB67CF45AAB6E870D530930964A7CE, C314771BB93E0A3ACC03EE18AC7A2739 + 27: EC721BB4A2822D39869A1981DB66C303116676E5CB3FEDACB1F970, BBA561C9B5912E84365E8258A34BA9EA + 28: 12898BDA4009B40ADDF41B495A3A1A1B0064B9F69FD7BC13F8A14BA0, B2869D73F73E32F912E73AD6C02A0768 + 29: 329B540E422F21AD3B09CF8CFE482B606149230196E429F5666DF206B2, 72CBD361E003F7A9A87E089373C768FD + 30: 497F13387271C869AE9A54A6F78116958951773A85CA804E149B27F68F4F, 68703910888C9304D7B1170258F6B841 + 31: ED63106B3E692A69C0C03BFD303BF4EB2FDB0D9562B9FE39612352DED01DBF, 451E328ACAF0A8196736D88A1D46CBD5 + 32: 1A46B990A8BDFCAEBF9C81D21C5A70A1D865F621AC9470E379F783D0A5150A13, 9571772CE2E0B947F9FE7B148163DD71 GCM-anubis (16 byte key) 0: , A0061C2F3B2295BFA33BC74C037EA8DA diff --git a/notes/ocb_tv.txt b/notes/ocb_tv.txt index 78195e80e..229fa4b02 100644 --- a/notes/ocb_tv.txt +++ b/notes/ocb_tv.txt @@ -352,39 +352,39 @@ OCB-cast5 (8 byte key) 16: 6A9424B6A873BB7155C01DC87E23EC52, 82C5047655952B01 OCB-noekeon (16 byte key) - 0: , 72751E743D0B7A07EFB23444F1492DDC - 1: 61, 41BDE9478A47B2B612A23752B5A42915 - 2: F4EB, 90EF542D89F867CDFB1A0807F8AA3CC6 - 3: F5A59B, 1BED873B613096546D4C201347CC3858 - 4: F454610B, FB4035F28AA75221F599668ABBE21782 - 5: 382FC932F1, B40270E2084E8DCEB14C6603D080D7C2 - 6: 18F921441119, 47F1F889B307298150750E81E94AB360 - 7: EF01C70C9D1810, AE0439DBB3825F27CF846B43E4C3AA80 - 8: 89863EDCAD471C3A, F4E8AF73BFC4CB79AECBBB3774DAF8C2 - 9: A6F494092E066A70F6, F73D3B04752B7D913420C17E656C7F86 - 10: 342459682E0A8D53AF4F, 61E7CF14E9878E0726C64B1E8CA08BFF - 11: 65E520D5A99825DE2441D1, 7A2AA740D786EB7015C61B31959E55D9 - 12: 2F96D0BB72E37DA202410302, 1A313242527FB522289094B9AFDB5F7B - 13: 3E8F8A1FCEE3F866EC29128BA0, B8065DA2DABF04129E5AE28ECC11A15B - 14: C2C15976D3C2499ACB9454878131, 372CAD486E104098EB1AA78A2922A1BE - 15: 1F12CADABAEE80E448B7EDCB42F8FE, 86A38DE5363787F55B16462C684E08DC - 16: 3B9ABB3304E75BF5B63E7F5B5A3F3980, 1FBD6B93E457B9779E2D12D78301EFA9 - 17: DC0CD805E43675A4317452E378AD48AC4C, 40AE4AFA4B3E580EFDB4AD0AF5BC4E4A - 18: E9DD52EA7264C6C7BBA39B761B6E87B65687, 4061DD65D5E7FFFE8D3D4261494D4F8C - 19: 80A9735CA1175072823828123413CCE772D521, D3378A12E79C49A37378DF527A460AB2 - 20: 09AD495AFFBF7CB8841262E7E5E8952878D4391A, C25D7A98C6F260B5FBCA3B8B5F7F33C1 - 21: 3925615707CC40C351D4A49794778545BC1F683175, 97622437A7208383A4A8D276D5551876 - 22: 5BB0D41ECD7BD2CF0B12A933255D95A3FE35E4C896BB, 4B8AD84EEA3156765A46AC19C68B6F88 - 23: 1EE71FE23CBFD5683AB1B391FC12B4E5952E4E6AA3D189, B0FD75996F28E071EB6C86BD7102BAA5 - 24: 0AA3D8C98AADEEE1867B13B017DD263BD16E960DA64FD071, 5204780963A62C2F4F7B3555BFF73836 - 25: 3A88B6F2AE321B226DA90B98E04A6A1589411BEDBE994632D5, 5638AF04EACF1EB986AC0702B4373A22 - 26: C2731661AC634A4DC0345F040DA7AEE507A3B9D019B5958543BA, 4C67D3FE37ABEE928B3BB812E7346823 - 27: D3E7651AA6DA035D05D599EFB806E8FD45177224593B5974758419, 5814E84258E1B9BD56A188AAE6F25138 - 28: 17818E7102B8C123230C5D64F18BE94C3159B85C8F7B64A7D4712CDA, FAA905B587A93DCF600BA8589A985432 - 29: BCA4335C6C29D978032C216114D39C01C6F161BF69D5A1CE55FBA8C575, BE24424A162E43A19755E2EFD274DBED - 30: 24C33CEE022F8A633DE9DFD009F535B52BCF64F390D2375E5BED65B70D08, 138F21D54B6B7E34628397DCDE0D33BF - 31: 838FE950C8165ADBBD6B61E9732F9A727CA7AE74376981382F0C531C331915, 0742E769CCBA2D1CAC7CAD4E0F012810 - 32: 57CD778DAD477271794FBF763662D97F8A10B17D70A69FDCB974FFE67E558519, 942C7D1C200C3845748F8131DF71AE26 + 0: , C810FFEC70BB008FD7C314A732B226E6 + 1: D0, 3C48A2C7E0CE9B9099221EF2CEC56767 + 2: 5542, 518EDB8174B067CBF2568C6911378137 + 3: 65E8A4, 3E4EFF5F6FBC99EF3B71B11F566A20FB + 4: 3D0EF863, A366D5CE05F564B5E676EC78938CCC85 + 5: 89B17BA512, 0E83095D771F654CBD630AC114501A0F + 6: E9AF5FCFEFED, 3A283F7FF02274DD4B48C2CD7E36182D + 7: F7A001CEC51C30, 8392CC274521BB452134713153F36268 + 8: D796E3F23E31D4F2, 351C7B0304E127287A9A1DE38BB3167A + 9: C4E2BBF6B4827E1A84, 275907279D0764CF80D7E6626D81F994 + 10: 6C61226E61F70408A61A, 941AD1718D272BFCB8C5ACE08F90B2D1 + 11: 3C195850E7FD63EFC11F7C, 348A975B60908445230D4D56A0CAB008 + 12: EE5FF5362DA3744C9EAD274B, 875C2167BFAEB65F5601F2DB9035444C + 13: 7DB5392ED1933ED858EC0C52F5, BE6507D8AC743805A872658C680A4D06 + 14: FEDEAE2EC2059D22B960813B5E7D, A559933509C47854176CEEDEC12EB8B4 + 15: 64C81F2169F7CEFBF51E68D4186A36, FFE84A9B49F0E77A9799EDEC7D76B987 + 16: 66532B678D23130714E088FE874C4743, AF95ADA553A68319DBEBDA4172E18A22 + 17: 53E56845C091A1E2372F3FC772017C9804, 9A6AB7CEB632429F2B31FB91C141B6F0 + 18: DAF6832520591B886E2E962ACF5B9D0A38E9, 73FFEBA8997E0C55CB0B4ABE59C86BF6 + 19: 108F04FEFCB5EE68033E57346012CDEB348D14, E08E90976E0F7868994B017D7A007AB8 + 20: 101682160DEB9667FB073F96ED1D9C063ABCE668, FB79A4BEBCA9A7832C72116AD9B98D41 + 21: E10AB0D22A6C4C253D818AB6AF1A3FF5811C6CEF24, 174CD350B069A239F9EB80A7BCADE8B7 + 22: 9F62A79B25D4F5532D78228A50516F97ACB7A2C5DF13, DD25DD14174B5667B0AD70732323C8C4 + 23: 2A0AA96147E74A3B881D62BA692EE27927A9EAB351C6DB, 9CE03AACF9318770BF7E095F90B470DB + 24: 29E38605973D0218AA8BAF2FBAB7722DB242C4775E453372, 72D6038E8927EDDE469F98B84C74A8A3 + 25: 8DBF8C2B5477DBA6E07B269293713D60D60BE29E677CA35C33, 83100BBC1401C890B36890A3FD0CD4EE + 26: 13DE9776093827F254DBF500EEBE0C65DC602A5FDF6AEFFC34D9, D142F6CE9E43633CBE94A2BDCC9AC5A8 + 27: 4A25370043862CF7A12A00A5A278623F9BF8DE33212D35661591EC, 62064DD74F9F6D77682B43D9B44E26B8 + 28: 37C6C6C40DA0581BF041770E330A40185E90426A1A4AC9BCDBC5CA7D, E77EE99F62EB1A38CCD1E90CED6EB5C7 + 29: 6B9047158068957CBF77F35988E5C926C7B262A8EBA9D33638A15B1505, 913DC491D3B2AFF172053CC4D1271F46 + 30: 949E5F05396F60722877EDBAA5D7437DDB24B3E25651458C266992D0854E, 87D4396BBC24646659F10179823066B2 + 31: D48489C360F6EB2BF4155FFD7CCAFA4793B8870BFA4A95C9BEDD372F51C04E, 173EEB238E6186D5A93AC6072A22B772 + 32: ACB6F91E8BDB4CFFE1F2A5F6C712D16177EE06842E4CF27F61C8F68D44C842FF, A1E5F2560183B0AFE466243EF3921E4D OCB-skipjack (10 byte key) 0: , 90EAAB5131AEB43B diff --git a/notes/omac_tv.txt b/notes/omac_tv.txt index 9f8f337d6..8d8729c47 100644 --- a/notes/omac_tv.txt +++ b/notes/omac_tv.txt @@ -352,39 +352,39 @@ OMAC-cast5 (8 byte key) 16: E8B0B219D4CB699B OMAC-noekeon (16 byte key) - 0: EC61647B281C47C1B43F9815064BF953 - 1: B100B1B6CD96DCED8F47A77E70670A92 - 2: A96CDE3C48831A6B0A5ADFECA6399BDB - 3: 14E75E7CAD840208834918B29A5D4430 - 4: 9577083713AE6E44EEC987C77C93C072 - 5: 2A738C02841E461238C02F5CFC8E66A6 - 6: A901327E451BE0D2D9DEC83DEEA9A022 - 7: 5ED7EE1BE04A64A689D15F6970A821A6 - 8: BA053E24FCFD02C731A8CFCA19EE66A0 - 9: 57139CA8C91072555B29F85A19E2C84D - 10: 4585EAC7EFB84869FD96EE7A5FDD350B - 11: 62AF6C415CA73E54E82EA306254C1BDE - 12: 75304F9724BD364F84371EE154F5210E - 13: 7FE5DBCEE826760434745D417453182B - 14: EC98DA2A580E9131218D1CDE835423D4 - 15: 631BD9EAFD1AE445F2C1C35E2B4416ED - 16: CA2D902A1D83388FE35BAB7C29F359BA - 17: 0DBF0AF7FCBEEE21FB6159C0A2FFCD4C - 18: BD7CD2C49241032DA33B1975EE2EE982 - 19: B30B090EE8626D77D310EDB957552D46 - 20: 64F608AC5707C381AC6878AA38345144 - 21: 28513CA7795B23A02B37DC3732413D23 - 22: 9F440700094517847E9E013C8915C433 - 23: 8CA483F313D20BFE7E0C089DAA4145BD - 24: FA44872743E20E5E0A069B3C4578DB50 - 25: F6DE8FFBECD52CC1F213CD9E406DF3BC - 26: B9702B7E846735A3DCC0724255F88FEC - 27: A1DDAFED2B1732C7BA89C2F194AF039E - 28: 2549C5F0E30F8F4002431D2C098805B8 - 29: 52E3836181BF5C9B09A507D5330CD14F - 30: 01C55DCBCCFD9D7A4D27BDE2A89AA8EF - 31: 3CF721A0CF006702CDA91F2FF3E4D5E3 - 32: 6D264B9065BE98C170E68E9D2A4DE86E + 0: A9F50A6567FAD338AB5727B3B94DEB82 + 1: C9EC17EF3656C9056E64E692A449AD24 + 2: 7D1F6A3373BF20D4E65804B745D40855 + 3: FE3484F11C338721F3FCB4DCC608BD6E + 4: C45670D31D48CE9AD70BADE9F7A6A5B3 + 5: 6AF86480F1AE638DCAC40939B864D4DE + 6: CBBAFED3A5891A7BD8692055E4C59444 + 7: B23439FC6D1CF0E3B04BE5201CAF9283 + 8: 385D2C64F55B3FE976E660155FAC4C90 + 9: 239D4B8F663248076E64CF743AC14EC0 + 10: B942C5E06C6E68866440EB10747643B6 + 11: 9B591FA2FD9A20C367FB03366150D1E7 + 12: F90183F872D062AB4642DCDCED399970 + 13: 86003C2F260EAFC81BC45A0614F88381 + 14: C80F88A148FF906D42E6D75A50049468 + 15: 0A81478238ED815D7CB04C0DC5A4A4D5 + 16: DFE74730DB9CF4F994084C88923A8931 + 17: 91194DAAAB458B5B34E991EF534D4BD8 + 18: DAA1CCA0B644AB9F8B4D889D7F1268FB + 19: A93AE4F41DFB6CA311FAAA148A9D53D9 + 20: 6FFD47B80A991A6C09775060E4A4B13E + 21: 4BE3101511BCA3251559ED6D3BFCC304 + 22: 3C1AA3485241175A9A17F440A1F2FF5F + 23: 11D2C5E4FC75639CC61C8FE66C2F5135 + 24: 3EDBF9F32259650ABC2C835301FA6556 + 25: 56FA9AA43C01CA5BA798780D3BF40FA1 + 26: 40AE1F352003026C6D4C5F44430DD5ED + 27: 264E11C88266029588A1B8369F0C5B73 + 28: 60CE0E6D2C2C74D122DBDE57B3EA44AB + 29: 5E4078E7CEFA94886E9CF0D083C4B468 + 30: CEC169560600ECEED6E5C8F06C76E702 + 31: B4209736F08EAAE6D5B4923D83EB3EE2 + 32: 5DC8D45C9954B82864F1C2388858D97B OMAC-skipjack (10 byte key) 0: 84EDFA769040603C diff --git a/notes/pmac_tv.txt b/notes/pmac_tv.txt index a7b148a01..af87a2038 100644 --- a/notes/pmac_tv.txt +++ b/notes/pmac_tv.txt @@ -352,39 +352,39 @@ PMAC-cast5 (8 byte key) 16: 87D907CACA80A138 PMAC-noekeon (16 byte key) - 0: A1E4C84B5958726557DF0855B37AA551 - 1: 5DE20299CA919D3365B493D3D4895F92 - 2: AF7E70C336571A857F62A18649EDB197 - 3: C5F55CFE1AA119C352B64252AD246CBD - 4: FEF68A0CE08E8BA315B73B62F861824F - 5: 8321C2958DE4903DC12C42A8845ECC20 - 6: 370466D1324AECF1F5B42E0E01381613 - 7: 5CB900190F5CACBACFE5EAB0CC289D87 - 8: A13C043E6CAAA1E34601A93C497446A4 - 9: 865E11622A4CC8A9E1408E00F56C4543 - 10: 9DC42C26868374649BD17D69D025CA1B - 11: 37D33C11B433C91DA09925CA9E86757A - 12: 1373D769C270E7137C953AC0F8F37941 - 13: 7E81DEC583348B1E2F6267ECF82CB994 - 14: 505B6329338556518FF364CAA730F5E8 - 15: 0C085AEEB315968B0BDE904E8BBC6FD0 - 16: 5FED63259364BE7E5133FF0507DD2D4C - 17: F7EE5C80A99AAEADB49E7CC69BFFF679 - 18: 4388FA5E763A641130940EB705BEFD08 - 19: 1BC31CA79EBE1674CEBE01BC9988267B - 20: BE88961637EFFE2D6905D104FEDD51A4 - 21: 9C341004FB22AFCC496094E3207CA761 - 22: B9DAA3620E38FFC7C5D5E7D2D8FE3DE4 - 23: A38D2E571F037061B4400F1131FDBDEA - 24: 61DB71AE77A6EB47F2E9E14E8CBF2F4B - 25: 9903A072274CC048EF2C51493266D9ED - 26: 1EBEA421DD08859C17DDF39B20A82102 - 27: F425858618E1A86F4912E4714EFB9E75 - 28: 3B3D4EA07F7FE6DDFDD02D624ACDFC9F - 29: CEEE256591D701514EB17DF73B08A970 - 30: 5CC56D5D46120C530A23B6C511C685FC - 31: 68E484CE18BE28EADD0BBF23291B8237 - 32: ABD58A9CDF8AA68168A1A402074CF520 + 0: 276019CC8E43A1B3F300C47B55B7AA22 + 1: B93E353A2CC21CEAD81C91EC2FCD348E + 2: E8B9737CAD705C499F246744DCFE9641 + 3: EF36B0FFB5439FF8668F35FD1822D0EA + 4: B7F5AD89538FC3F03923E98ADF95D0CC + 5: 558FCA30F602B4BC6697F44053875204 + 6: 6B2D6D5A1CF670BE80E4BBB945CD3871 + 7: 9CFA28FCA22EA12A13AC1093EF5D5EB9 + 8: 04EDA6C71B9F1177F4A5368684FBBAFB + 9: 43C56B31D440EBECE4C74B90750A4653 + 10: 23D5FA9AFFB2DC3DD372F22690487BAC + 11: FD61731F27CF8E791535AAB579A018B4 + 12: 502D3A64FDED3CA2A2C8A5E986B27E03 + 13: 1EABBC65B0A08F6CB15218E7153A6003 + 14: B05DBC66CF92B045FC99395E9D405C4F + 15: EE841A0BF2C91C1E2078F06D022F2E6C + 16: EA749FBAC6BA9F672796C9D58A8C3294 + 17: BBEF3CDFB93E5F462773579986F08374 + 18: B17F7645F80BF5A2817C228987B43C03 + 19: C995A102DFBB38FA397A4E508B85093D + 20: 9011CA395AC3FCD8594C13E67C22E95B + 21: 364BF53974D68B8BCF53CAADC5469DEC + 22: 5BAD7041372F28DE28BAAAC1A89C10A8 + 23: 77874E908BFCE6F5E36888A484A754C0 + 24: 9BDA525416A3129C55886134B79BAEDE + 25: 84E3201FA7958223B302D1BC2AC57D55 + 26: 2B8FA1A95DADB4DC2F7A308D8E3D8C81 + 27: F74EBF0ACCC187569BDE549F5FC96C36 + 28: 7023D209F1965EC32253D11835CDFFA5 + 29: C3C6397D9B0A1D741335882ACDFAC20D + 30: 7BC92905F2AF6754256BE087CC4F54DB + 31: 0BBA0A507767530F26C3A465DAB11359 + 32: D2891C8EA1F574A6B2AB091057E0FB2C PMAC-skipjack (10 byte key) 0: 9CD94B75BC43B647 From 80ef95f3c13d5f8eb5586347c733e6955f22c4c4 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 12 Feb 2012 16:12:50 -0800 Subject: [PATCH 0050/1192] Checked in program which generates Noekeon vectors using BouncyCastle. --- notes/etc/NoekeonVects.java | 249 ++++++++++++++++++++++++++++++++++++ 1 file changed, 249 insertions(+) create mode 100644 notes/etc/NoekeonVects.java diff --git a/notes/etc/NoekeonVects.java b/notes/etc/NoekeonVects.java new file mode 100644 index 000000000..8ec542aad --- /dev/null +++ b/notes/etc/NoekeonVects.java @@ -0,0 +1,249 @@ +/* + NoekeonVects.java - Generate Noekeon test vectors using BouncyCastle. + + Written in 2011 by Patrick Pelletier + + To the extent possible under law, the author(s) have dedicated all + copyright and related and neighboring rights to this software to + the public domain worldwide. This software is distributed without + any warranty. + + This file is dedicated to the public domain with the CC0 Public Domain + Dedication: http://creativecommons.org/publicdomain/zero/1.0/legalcode.txt + + You may also consider this file to be covered by the WTFPL, as contained + in the LibTomCrypt LICENSE file, if that makes you happier for some reason. + + ---------------------------------------------------------------------- + + This program was inspired by the comment in Botan 1.10.1's + doc/examples/eax_test.cpp: + + // Noekeon: unknown cause, though LTC's lone test vector does not + // match Botan + + So, I investigated the discrepancy by comparing them with a third + implementation, BouncyCastle: http://www.bouncycastle.org/java.html + + I determined that there are two reasons why LibTomCrypt's Noekeon does + not match Botan: + + 1) Botan uses "indirect Noekeon" (with a key schedule), while + LibTomCrypt and BouncyCastle both use "direct Noekeon" (without + a key schedule). See slide 14 of + http://gro.noekeon.org/Noekeon-slides.pdf + + 2) However, LibTomCrypt's direct Noekeon still does not match + BouncyCastle's direct Noekeon. This is because of a bug in + LibTomCrypt's PI1 and PI2 functions: + https://github.com/libtom/libtomcrypt/issues/5 + + This program uses BouncyCastle to produce test vectors which are + suitable for Botan (by explicitly scheduling the key, thus + building indirect Noekeon out of BouncyCastle's direct Noekeon), + and also produces test vectors which would be suitable for + LibTomCrypt (direct Noekeon) once its PI1 and PI2 functions are + fixed to match the Noekeon specification. + + Although this program uses a PRNG from BouncyCastle to generate + data for the test vectors, it uses a fixed seed and thus will + produce the same output every time it is run. +*/ + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Locale; +import org.bouncycastle.crypto.digests.RIPEMD128Digest; +import org.bouncycastle.crypto.engines.NoekeonEngine; +import org.bouncycastle.crypto.modes.EAXBlockCipher; +import org.bouncycastle.crypto.params.AEADParameters; +import org.bouncycastle.crypto.params.KeyParameter; +import org.bouncycastle.crypto.prng.DigestRandomGenerator; +import org.bouncycastle.util.encoders.HexEncoder; + +public class NoekeonVects +{ + private final DigestRandomGenerator r = + new DigestRandomGenerator(new RIPEMD128Digest()); + + private final HexEncoder h = new HexEncoder(); + + private final NoekeonEngine noekeon = new NoekeonEngine(); + + private final KeyParameter null_key = new KeyParameter(new byte[16]); + + private final boolean schedule_key; + + private final boolean botan_format; + + private byte[] randomBytes(int n) + { + byte[] b = new byte[n]; + r.nextBytes(b); + return b; + } + + private void hexOut(byte[] b) throws IOException + { + // HexEncoder uses lowercase, and Botan's test vectors must + // be in uppercase, so... + ByteArrayOutputStream os = new ByteArrayOutputStream(); + h.encode(b, 0, b.length, os); + String s = os.toString("US-ASCII"); + System.out.print(s.toUpperCase(Locale.US)); + } + + private void printCArray(byte[] a) throws IOException + { + byte[] b = new byte[1]; + for (int i = 0; i < a.length; i++) + { + if (i > 0) + System.out.print(", "); + System.out.print("0x"); + b[0] = a[i]; + hexOut(b); + } + } + + private void printVector(byte[] key, byte[] plaintext, byte[] ciphertext) + throws IOException + { + if (botan_format) + { + hexOut(plaintext); + System.out.print(":"); + hexOut(ciphertext); + System.out.println(":\\"); + hexOut(key); + System.out.println(); + } + else + { + System.out.println(" {"); + System.out.println(" 16,"); + System.out.print(" { "); + printCArray (key); + System.out.println(" },"); + System.out.print(" { "); + printCArray (plaintext); + System.out.println(" },"); + System.out.print(" { "); + printCArray (ciphertext); + System.out.println(" }"); + System.out.println(" },"); + } + } + + private KeyParameter maybe_schedule_key(byte[] key) + { + if (schedule_key) + { + noekeon.init(true, null_key); + byte[] scheduled = new byte[16]; + noekeon.processBlock(key, 0, scheduled, 0); + return new KeyParameter(scheduled); + } + else + return new KeyParameter(key); + } + + private byte[] encrypt(byte[] plaintext, byte[] key) + { + KeyParameter kp = maybe_schedule_key(key); + noekeon.init(true, kp); + byte[] ciphertext = new byte[16]; + noekeon.processBlock(plaintext, 0, ciphertext, 0); + return ciphertext; + } + + public NoekeonVects(long seed, boolean schedule_key, boolean botan_format) + { + this.schedule_key = schedule_key; + this.botan_format = botan_format; + r.addSeedMaterial(seed); + } + + public void ecb_vectors() throws IOException + { + for (int i = 0; i < 8; i++) + { + byte[] key = randomBytes(16); + byte[] plaintext = randomBytes(16); + byte[] ciphertext = encrypt(plaintext, key); + printVector(key, plaintext, ciphertext); + } + } + + public void eax_vectors() throws Exception + { + System.out.println("EAX-noekeon (16 byte key)"); + EAXBlockCipher eax = new EAXBlockCipher(new NoekeonEngine()); + byte[] output = new byte[48]; + byte[] tag = new byte[16]; + + for (int j = 0; j < 16; j++) + tag[j] = (byte) j; + + for (int i = 0; i <= 32; i++) + { + byte[] header_nonce_plaintext = new byte[i]; + for (int j = 0; j < i; j++) + header_nonce_plaintext[j] = (byte) j; + AEADParameters params = + new AEADParameters(maybe_schedule_key(tag), + 128, + header_nonce_plaintext, + header_nonce_plaintext); + eax.init(true, params); + int off = eax.processBytes(header_nonce_plaintext, 0, i, + output, 0); + off += eax.doFinal(output, off); + if (off != i + 16) + throw new RuntimeException("didn't expect that"); + byte[] ciphertext = new byte[i]; + for (int j = 0; j < i; j++) + ciphertext[j] = output[j]; + for (int j = 0; j < 16; j++) + tag[j] = output[i + j]; + System.out.print(i < 10 ? " " : " "); + System.out.print(i); + System.out.print(": "); + hexOut(ciphertext); + System.out.print(", "); + hexOut(tag); + System.out.println(); + } + } + + public static void main(String[] argv) throws Exception + { + NoekeonVects bot = new NoekeonVects(0xdefacedbadfacadeL, true, true); + NoekeonVects tom = new NoekeonVects(0xdefacedbadfacadeL, false, false); + System.out.println("# ECB vectors for indirect Noekeon, in Botan's"); + System.out.println("# test vector format, suitable for insertion"); + System.out.println("# into Botan's file checks/validate.dat"); + System.out.println("# Block cipher format is plaintext:ciphertext:key"); + bot.ecb_vectors(); + System.out.println(); + System.out.println("/* ECB vectors for direct Noekeon, as C arrays"); + System.out.println(" * suitable for insertion into LibTomCrypt's"); + System.out.println(" * noekeon_test() in src/ciphers/noekeon.c,"); + System.out.println(" * once LTC's PI1/PI2 bug is fixed. */"); + tom.ecb_vectors(); + System.out.println(); + System.out.println("# EAX vectors for indirect Noekeon, in the format"); + System.out.println("# generated by LTC's demos/tv_gen.c and consumed"); + System.out.println("# by Botan's doc/examples/eax_test.cpp, suitable"); + System.out.println("# for insertion in Botan's doc/examples/eax.vec"); + bot.eax_vectors(); + System.out.println(); + System.out.println("# EAX vectors for direct Noekeon, in the format"); + System.out.println("# generated by LTC's demos/tv_gen.c and consumed"); + System.out.println("# by Botan's doc/examples/eax_test.cpp, which"); + System.out.println("# should match LTC's notes/eax_tv.txt, once"); + System.out.println("# LTC's PI1/PI2 bug is fixed."); + tom.eax_vectors(); + System.out.flush(); + } +} From 5b662d6ed8c6e0b320573724a415dd10dd9b8364 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sun, 12 Feb 2012 15:22:26 -0800 Subject: [PATCH 0051/1192] Fix some small typos in documentation --- crypt.tex | 2 +- notes/tech0003.txt | 2 +- src/ciphers/camellia.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypt.tex b/crypt.tex index bb1dbd7af..d28f3ccb9 100644 --- a/crypt.tex +++ b/crypt.tex @@ -4988,7 +4988,7 @@ \subsection{ASN.1 Flexi Decoder} An invalid decoding will terminate the process, and free the allocated memory automatically. -\textbf{Note:} the list decoded by this function is \textbf{NOT} in the correct form for der\_encode\_sequence() to use directly. You will have to first +\textbf{Note:} the list decoded by this function is \textbf{NOT} in the correct form for der\_encode\_sequence() to use directly. You will first have to convert the list by first storing all of the siblings in an array then storing all the children as sub-lists of a sequence using the \textit{.data} pointer. Currently no function in LibTomCrypt provides this ability. diff --git a/notes/tech0003.txt b/notes/tech0003.txt index 1a21867c9..471378aae 100644 --- a/notes/tech0003.txt +++ b/notes/tech0003.txt @@ -47,6 +47,6 @@ as a hash) CAST5 is perhaps a "runner-up" choice. CAST5 has been around longer fairly fast as well. You can easily accomplish this via the "config.pl" script. Simply answer "n" to all of the ciphers except the one you want -and then rebuild the library. [or you can hand edit mycrypt_custom.h] +and then rebuild the library. [or you can hand edit tomcrypt_custom.h] diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 488998b98..b419a76c5 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -10,7 +10,7 @@ */ /** - @file camellia.ca + @file camellia.c Implementation by Tom St Denis of Elliptic Semiconductor */ From 8cda684a0eb7a40ecb7100b50b6b43953efaeef6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 18 Nov 2012 18:41:46 +0100 Subject: [PATCH 0052/1192] improved multi2_test() --- src/ciphers/multi2.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index db0b3bafb..feea28796 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -270,6 +270,23 @@ int multi2_test(void) } } + for (x = 128; x < 256; ++x) { + unsigned char ct[8]; + + if ((err = multi2_setup(tests[0].key, 40, x, &skey)) != CRYPT_OK) { + return err; + } + if ((err = multi2_ecb_encrypt(tests[0].pt, ct, &skey)) != CRYPT_OK) { + return err; + } + if ((err = multi2_ecb_decrypt(ct, buf, &skey)) != CRYPT_OK) { + return err; + } + if (XMEMCMP(buf, tests[0].pt, 8)) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; } From 21ddcf35681916c091ae91e7e8e5bd6bdf8ab51d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 18 Nov 2012 18:44:14 +0100 Subject: [PATCH 0053/1192] fix multi2 as proposed by kmx --- src/ciphers/multi2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index feea28796..78a3eac72 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -94,8 +94,8 @@ static void encrypt(ulong32 *p, int N, ulong32 *uk) static void decrypt(ulong32 *p, int N, ulong32 *uk) { int n, t; - for (t = 4*((N&1)^1), n = N; ; ) { - switch (n >= 4 ? 4 : 0) { + for (t = 4*(((N-1)>>2)&1), n = N; ; ) { + switch (n<=4 ? n : ((n-1)%4)+1) { case 4: pi4(p, uk+t); --n; case 3: pi3(p, uk+t); --n; case 2: pi2(p, uk+t); --n; From f32e52d5ac5a6fbd84cbd06454a4153689940bfa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Nov 2012 00:47:08 +0100 Subject: [PATCH 0054/1192] mark scripts as executable --- build.sh | 0 filter.pl | 0 fixupind.pl | 0 genlist.sh | 0 mess.sh | 0 parsenames.pl | 0 run.sh | 0 testbuild.sh | 0 testme.sh | 0 updatemakes.sh | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build.sh mode change 100644 => 100755 filter.pl mode change 100644 => 100755 fixupind.pl mode change 100644 => 100755 genlist.sh mode change 100644 => 100755 mess.sh mode change 100644 => 100755 parsenames.pl mode change 100644 => 100755 run.sh mode change 100644 => 100755 testbuild.sh mode change 100644 => 100755 testme.sh mode change 100644 => 100755 updatemakes.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 diff --git a/filter.pl b/filter.pl old mode 100644 new mode 100755 diff --git a/fixupind.pl b/fixupind.pl old mode 100644 new mode 100755 diff --git a/genlist.sh b/genlist.sh old mode 100644 new mode 100755 diff --git a/mess.sh b/mess.sh old mode 100644 new mode 100755 diff --git a/parsenames.pl b/parsenames.pl old mode 100644 new mode 100755 diff --git a/run.sh b/run.sh old mode 100644 new mode 100755 diff --git a/testbuild.sh b/testbuild.sh old mode 100644 new mode 100755 diff --git a/testme.sh b/testme.sh old mode 100644 new mode 100755 diff --git a/updatemakes.sh b/updatemakes.sh old mode 100644 new mode 100755 From 7050bdb7c8512e3c6e40d239466d0698de406789 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Nov 2012 00:53:54 +0100 Subject: [PATCH 0055/1192] use corrected version of zeromem() from @dtrebbien --- src/headers/tomcrypt_misc.h | 2 +- src/misc/zeromem.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 239ad775b..42c6ec547 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -8,7 +8,7 @@ int base64_decode(const unsigned char *in, unsigned long len, #endif /* ---- MEM routines ---- */ -void zeromem(void *dst, size_t len); +void zeromem(volatile void *dst, size_t len); void burn_stack(unsigned long len); const char *error_to_string(int err); diff --git a/src/misc/zeromem.c b/src/misc/zeromem.c index 9dff602ab..3564cc1c0 100644 --- a/src/misc/zeromem.c +++ b/src/misc/zeromem.c @@ -20,12 +20,12 @@ @param out The destination of the area to zero @param outlen The length of the area to zero (octets) */ -void zeromem(void *out, size_t outlen) +void zeromem(volatile void *out, size_t outlen) { - unsigned char *mem = out; + volatile char *mem = out; LTC_ARGCHKVD(out != NULL); while (outlen-- > 0) { - *mem++ = 0; + *mem++ = '\0'; } } From 2cb8c441131585ca67a2133dce264f777d9e1f9d Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Thu, 24 Jan 2013 11:14:05 -0800 Subject: [PATCH 0056/1192] der fixes and additions --- libtomcrypt_VS2005.vcproj | 158 +++++++++++++ libtomcrypt_VS2008.vcproj | 34 ++- src/headers/tomcrypt_pk.h | 12 +- src/misc/pk_get_oid.c | 8 +- src/pk/asn1/der/boolean/der_decode_boolean.c | 2 +- .../der/sequence/der_decode_sequence_flexi.c | 40 +++- .../der_decode_subject_public_key_info.c | 3 +- src/pk/asn1/der/sequence/der_sequence_free.c | 2 + .../der_decode_teletex_string.c | 95 ++++++++ .../der_length_teletex_string.c | 210 ++++++++++++++++++ 10 files changed, 551 insertions(+), 13 deletions(-) create mode 100644 src/pk/asn1/der/teletex_string/der_decode_teletex_string.c create mode 100644 src/pk/asn1/der/teletex_string/der_length_teletex_string.c diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index 4af31c65d..6a93fa2f8 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -2910,6 +2910,28 @@ /> + + + + + + + + @@ -4731,6 +4753,28 @@ /> + + + + + + + + @@ -4753,6 +4797,28 @@ /> + + + + + + + + @@ -5290,6 +5356,28 @@ PreprocessorDefinitions="" /> + + + + + + + + + + + + + + + + @@ -5498,6 +5608,54 @@ + + + + + + + + + + + + + + + + + + diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index b51b634ae..a854068ad 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -1,7 +1,7 @@ + + @@ -4741,6 +4745,10 @@ /> + + @@ -4763,6 +4771,10 @@ /> + + @@ -5301,6 +5313,10 @@ /> + + @@ -5345,6 +5361,10 @@ /> + + @@ -5648,6 +5668,18 @@ + + + + + + next; } - /* now switch on type */ + if ((isConstructed = ((type & 0xE0) == 0xA0 ? 1 : 0))) { + /* constructed, use the 'used' field to store the original tag number */ + l->used = (type & 0x1F); + /* treat constructed elements like SETs */ + type = 0x31; + } + + /* now switch on type */ switch (type) { case 0x01: /* BOOLEAN */ l->type = LTC_ASN1_BOOLEAN; @@ -259,6 +267,26 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc } break; + case 0x14: /* TELETEXT */ + + /* init field */ + l->type = LTC_ASN1_TELETEX_STRING; + l->size = len; + + if ((l->data = XCALLOC(1, l->size)) == NULL) { + err = CRYPT_MEM; + goto error; + } + + if ((err = der_decode_teletex_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_teletex_string(l->data, l->size, &len)) != CRYPT_OK) { + goto error; + } + break; + case 0x16: /* IA5 */ /* init field */ @@ -304,7 +332,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc case 0x31: /* SET */ /* init field */ - l->type = (type == 0x30) ? LTC_ASN1_SEQUENCE : LTC_ASN1_SET; + l->type = (isConstructed ? LTC_ASN1_CONSTRUCTED : ((type == 0x30) ? LTC_ASN1_SEQUENCE : LTC_ASN1_SET)); /* we have to decode the SEQUENCE header and get it's length */ @@ -343,9 +371,11 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc default: /* invalid byte ... this is a soft error */ /* remove link */ - l = l->prev; - XFREE(l->next); - l->next = NULL; + if (l->prev) { + l = l->prev; + XFREE(l->next); + l->next = NULL; + } goto outside; } diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 16c98979a..74522f72a 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -36,7 +36,8 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in unsigned int algorithm, void* public_key, unsigned long* public_key_len, unsigned long parameters_type, ltc_asn1_list* parameters, unsigned long parameters_len) { - int err, len; + int err; + unsigned long len; oid_st oid; unsigned char *tmpbuf; unsigned long tmpoid[16]; diff --git a/src/pk/asn1/der/sequence/der_sequence_free.c b/src/pk/asn1/der/sequence/der_sequence_free.c index 56ecce7fb..77e263a83 100644 --- a/src/pk/asn1/der/sequence/der_sequence_free.c +++ b/src/pk/asn1/der/sequence/der_sequence_free.c @@ -24,6 +24,8 @@ void der_sequence_free(ltc_asn1_list *in) { ltc_asn1_list *l; + + if (!in) return; /* walk to the start of the chain */ while (in->prev != NULL || in->parent != NULL) { diff --git a/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c b/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c new file mode 100644 index 000000000..2dfc5c7c4 --- /dev/null +++ b/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c @@ -0,0 +1,95 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file der_decode_teletex_string.c + ASN.1 DER, encode a teletex STRING +*/ + +#ifdef LTC_DER + +/** + Store a teletex STRING + @param in The DER encoded teletex STRING + @param inlen The size of the DER teletex STRING + @param out [out] The array of octets stored (one per char) + @param outlen [in/out] The number of octets stored + @return CRYPT_OK if successful +*/ +int der_decode_teletex_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + unsigned long x, y, len; + int t; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* must have header at least */ + if (inlen < 2) { + return CRYPT_INVALID_PACKET; + } + + /* check for 0x13 */ + if ((in[0] & 0x1F) != 0x14) { + return CRYPT_INVALID_PACKET; + } + x = 1; + + /* decode the length */ + if (in[x] & 0x80) { + /* valid # of bytes in length are 1,2,3 */ + y = in[x] & 0x7F; + if ((y == 0) || (y > 3) || ((x + y) > inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* read the length in */ + len = 0; + ++x; + while (y--) { + len = (len << 8) | in[x++]; + } + } else { + len = in[x++] & 0x7F; + } + + /* is it too long? */ + if (len > *outlen) { + *outlen = len; + return CRYPT_BUFFER_OVERFLOW; + } + + if (len + x > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* read the data */ + for (y = 0; y < len; y++) { + t = der_teletex_value_decode(in[x++]); + if (t == -1) { + return CRYPT_INVALID_ARG; + } + out[y] = t; + } + + *outlen = y; + + return CRYPT_OK; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/pk/asn1/der/teletex_string/der_length_teletex_string.c b/src/pk/asn1/der/teletex_string/der_length_teletex_string.c new file mode 100644 index 000000000..85cd1a487 --- /dev/null +++ b/src/pk/asn1/der/teletex_string/der_length_teletex_string.c @@ -0,0 +1,210 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file der_length_teletex_string.c + ASN.1 DER, get length of teletex STRING +*/ + +#ifdef LTC_DER + +static const struct { + int code, value; +} teletex_table[] = { +{ '\0', 0 }, +{ '\a', 7 }, +{ '\b', 8 }, +{ '\t', 9 }, +{ '\n', 10 }, +{ '\v', 11 }, +{ '\f', 12 }, +{ '\r', 13 }, +{ ' ', 32 }, +{ '!', 33 }, +{ '"', 34 }, +{ '%', 37 }, +{ '&', 38 }, +{ '\'', 39 }, +{ '(', 40 }, +{ ')', 41 }, +{ '+', 43 }, +{ ',', 44 }, +{ '-', 45 }, +{ '.', 46 }, +{ '/', 47 }, +{ '0', 48 }, +{ '1', 49 }, +{ '2', 50 }, +{ '3', 51 }, +{ '4', 52 }, +{ '5', 53 }, +{ '6', 54 }, +{ '7', 55 }, +{ '8', 56 }, +{ '9', 57 }, +{ ':', 58 }, +{ ';', 59 }, +{ '<', 60 }, +{ '=', 61 }, +{ '>', 62 }, +{ '?', 63 }, +{ '@', 64 }, +{ 'A', 65 }, +{ 'B', 66 }, +{ 'C', 67 }, +{ 'D', 68 }, +{ 'E', 69 }, +{ 'F', 70 }, +{ 'G', 71 }, +{ 'H', 72 }, +{ 'I', 73 }, +{ 'J', 74 }, +{ 'K', 75 }, +{ 'L', 76 }, +{ 'M', 77 }, +{ 'N', 78 }, +{ 'O', 79 }, +{ 'P', 80 }, +{ 'Q', 81 }, +{ 'R', 82 }, +{ 'S', 83 }, +{ 'T', 84 }, +{ 'U', 85 }, +{ 'V', 86 }, +{ 'W', 87 }, +{ 'X', 88 }, +{ 'Y', 89 }, +{ 'Z', 90 }, +{ '[', 91 }, +{ ']', 93 }, +{ '_', 95 }, +{ 'a', 97 }, +{ 'b', 98 }, +{ 'c', 99 }, +{ 'd', 100 }, +{ 'e', 101 }, +{ 'f', 102 }, +{ 'g', 103 }, +{ 'h', 104 }, +{ 'i', 105 }, +{ 'j', 106 }, +{ 'k', 107 }, +{ 'l', 108 }, +{ 'm', 109 }, +{ 'n', 110 }, +{ 'o', 111 }, +{ 'p', 112 }, +{ 'q', 113 }, +{ 'r', 114 }, +{ 's', 115 }, +{ 't', 116 }, +{ 'u', 117 }, +{ 'v', 118 }, +{ 'w', 119 }, +{ 'x', 120 }, +{ 'y', 121 }, +{ 'z', 122 }, +{ '|', 124 }, +{ ' ', 160 }, +{ 0xa1, 161 }, +{ 0xa2, 162 }, +{ 0xa3, 163 }, +{ '$', 164 }, +{ 0xa5, 165 }, +{ '#', 166 }, +{ 0xa7, 167 }, +{ 0xa4, 168 }, +{ 0xab, 171 }, +{ 0xb0, 176 }, +{ 0xb1, 177 }, +{ 0xb2, 178 }, +{ 0xb3, 179 }, +{ 0xd7, 180 }, +{ 0xb5, 181 }, +{ 0xb6, 182 }, +{ 0xb7, 183 }, +{ 0xf7, 184 }, +{ 0xbb, 187 }, +{ 0xbc, 188 }, +{ 0xbd, 189 }, +{ 0xbe, 190 }, +{ 0xbf, 191 }, +}; + +int der_teletex_char_encode(int c) +{ + int x; + for (x = 0; x < (int)(sizeof(teletex_table)/sizeof(teletex_table[0])); x++) { + if (teletex_table[x].code == c) { + return teletex_table[x].value; + } + } + return -1; +} + +int der_teletex_value_decode(int v) +{ + int x; + for (x = 0; x < (int)(sizeof(teletex_table)/sizeof(teletex_table[0])); x++) { + if (teletex_table[x].value == v) { + return teletex_table[x].code; + } + } + return -1; +} + +/** + Gets length of DER encoding of teletex STRING + @param octets The values you want to encode + @param noctets The number of octets in the string to encode + @param outlen [out] The length of the DER encoding for the given string + @return CRYPT_OK if successful +*/ +int der_length_teletex_string(const unsigned char *octets, unsigned long noctets, unsigned long *outlen) +{ + unsigned long x; + + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(octets != NULL); + + /* scan string for validity */ + for (x = 0; x < noctets; x++) { + if (der_teletex_char_encode(octets[x]) == -1) { + return CRYPT_INVALID_ARG; + } + } + + if (noctets < 128) { + /* 16 LL DD DD DD ... */ + *outlen = 2 + noctets; + } else if (noctets < 256) { + /* 16 81 LL DD DD DD ... */ + *outlen = 3 + noctets; + } else if (noctets < 65536UL) { + /* 16 82 LL LL DD DD DD ... */ + *outlen = 4 + noctets; + } else if (noctets < 16777216UL) { + /* 16 83 LL LL LL DD DD DD ... */ + *outlen = 5 + noctets; + } else { + return CRYPT_INVALID_ARG; + } + + return CRYPT_OK; +} + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From 9953c694551738067144f549078ed040bdf60729 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Fri, 8 Feb 2013 12:24:17 -0800 Subject: [PATCH 0057/1192] update makefiles --- makefile | 2 ++ makefile.icc | 2 ++ makefile.msvc | 2 ++ makefile.shared | 2 ++ makefile.unix | 2 ++ 5 files changed, 10 insertions(+) diff --git a/makefile b/makefile index 53f80f45e..f2d54a9ed 100644 --- a/makefile +++ b/makefile @@ -185,6 +185,8 @@ src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ src/pk/asn1/der/octet/der_length_octet_string.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ diff --git a/makefile.icc b/makefile.icc index 0dbd7ce5b..35be3d66a 100644 --- a/makefile.icc +++ b/makefile.icc @@ -169,6 +169,8 @@ src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ src/pk/asn1/der/octet/der_length_octet_string.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ diff --git a/makefile.msvc b/makefile.msvc index c329ff1e4..8b4892a1d 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -79,6 +79,8 @@ src/pk/asn1/der/object_identifier/der_encode_object_identifier.obj \ src/pk/asn1/der/object_identifier/der_length_object_identifier.obj \ src/pk/asn1/der/octet/der_decode_octet_string.obj src/pk/asn1/der/octet/der_encode_octet_string.obj \ src/pk/asn1/der/octet/der_length_octet_string.obj \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.obj \ src/pk/asn1/der/printable_string/der_encode_printable_string.obj \ src/pk/asn1/der/printable_string/der_length_printable_string.obj \ diff --git a/makefile.shared b/makefile.shared index 2bce4efc3..97012ee41 100644 --- a/makefile.shared +++ b/makefile.shared @@ -174,6 +174,8 @@ src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ src/pk/asn1/der/octet/der_length_octet_string.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ diff --git a/makefile.unix b/makefile.unix index 993921b0b..792c1f316 100644 --- a/makefile.unix +++ b/makefile.unix @@ -115,6 +115,8 @@ src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ src/pk/asn1/der/octet/der_length_octet_string.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ From eb9bad79bfb4e4ae35a254b2089087ffdf3f619b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 13 Feb 2013 11:33:39 +0100 Subject: [PATCH 0058/1192] udpate testme to display correct version when run out of repository --- testme.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testme.sh b/testme.sh index c2909736e..959f4d230 100755 --- a/testme.sh +++ b/testme.sh @@ -11,7 +11,12 @@ fi echo "date="`date` # output version -echo "Testing verion" `grep "^VERSION=" makefile | sed "s/.*=//"` +version=$(git describe --tags --always --dirty 2>/dev/null) +if [ ! -e ".git" ] || [ -z $version ] +then + version=$(grep "^VERSION=" makefile | sed "s/.*=//") +fi +echo "Testing version:" $version #grep "VERSION=" makefile | perl -e "@a = split('=', <>); print @a[1];"` # get uname From 8a53674b18efd9b0453027be9fc4363cf5423745 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 13 Feb 2013 11:38:25 +0100 Subject: [PATCH 0059/1192] updated README --- README | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README b/README index 1e1bd859f..ff2f59ef7 100644 --- a/README +++ b/README @@ -1,3 +1,11 @@ -See doc/crypt.pdf +libtomcrypt +========== + +See doc/crypt.pdf for a detailed documentation + +Submitting patches +------------------ + +Please branch off from develop if you want to submit a patch. From 2b2f5de743b028d1235cdb94010f875d7696f4a1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 13 Feb 2013 11:42:19 +0100 Subject: [PATCH 0060/1192] rename README --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From d84af284a39b4041295ed7fb2c4113cc37feb735 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 15 Mar 2013 11:08:54 +0100 Subject: [PATCH 0061/1192] build/testme: remove -j4 parameter --- build.sh | 2 +- testme.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 0a012f5a4..c5f37c3d2 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ echo "$1 ($2, $3)..." make clean 1>/dev/null 2>/dev/null echo -n "building..." -CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j4 -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt || (echo "build $1 failed see gcc_2.txt for more information" && cat gcc_2.txt && exit 1) +CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt || (echo "build $1 failed see gcc_2.txt for more information" && cat gcc_2.txt && exit 1) echo -n "testing..." if [ -a test ] && [ -f test ] && [ -x test ]; then ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1) diff --git a/testme.sh b/testme.sh index 959f4d230..750b0d780 100755 --- a/testme.sh +++ b/testme.sh @@ -2,8 +2,8 @@ if [ $# -lt 3 ] then - echo "usage is: ${0##*/} " - echo "e.g. \"${0##*/} makefile \"-DUSE_LTM -DLTM_DESC -I/path/to/libtommath\" /path/to/libtommath/libtommath.a\"" + echo "usage is: ${0##*/} " + echo "e.g. \"${0##*/} \"makefile -j3\" \"-DUSE_LTM -DLTM_DESC -I/path/to/libtommath\" /path/to/libtommath/libtommath.a\"" exit -1 fi From c98857a47e55b8dc6e6bc2b883587a37f3c97a2d Mon Sep 17 00:00:00 2001 From: RyanC Date: Sun, 11 Nov 2012 15:00:19 -0800 Subject: [PATCH 0062/1192] add hkdf impl --- libtomcrypt.dsp | 5 ++ libtomcrypt_VS2005.vcproj | 22 +++++++ libtomcrypt_VS2008.vcproj | 22 +++++++ makefile | 3 +- makefile.icc | 3 +- makefile.msvc | 3 +- makefile.shared | 3 +- makefile.unix | 3 +- src/headers/tomcrypt.h | 1 + src/headers/tomcrypt_custom.h | 7 +++ src/headers/tomcrypt_hkdf.h | 26 ++++++++ src/misc/hkdf/hkdf.c | 113 ++++++++++++++++++++++++++++++++++ 12 files changed, 206 insertions(+), 5 deletions(-) create mode 100644 src/headers/tomcrypt_hkdf.h create mode 100644 src/misc/hkdf/hkdf.c diff --git a/libtomcrypt.dsp b/libtomcrypt.dsp index a6dbe7a35..83b4af9c1 100644 --- a/libtomcrypt.dsp +++ b/libtomcrypt.dsp @@ -825,6 +825,11 @@ SOURCE=.\src\misc\error_to_string.c SOURCE=.\src\misc\zeromem.c # End Source File # End Group +# Begin Source File + +SOURCE=.\src\misc\hkdf\hkdf.c +# End Source File +# End Group # Begin Group "modes" # PROP Default_Filter "" diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index 6a93fa2f8..9eeb4f888 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -2954,6 +2954,28 @@ /> + + + + + + + + diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index a854068ad..3e1e8516c 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2946,6 +2946,28 @@ /> + + + + + + + + diff --git a/makefile b/makefile index f2d54a9ed..e9ef4e63e 100644 --- a/makefile +++ b/makefile @@ -156,7 +156,8 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \ diff --git a/makefile.icc b/makefile.icc index 35be3d66a..71bb112d8 100644 --- a/makefile.icc +++ b/makefile.icc @@ -141,7 +141,8 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \ diff --git a/makefile.msvc b/makefile.msvc index 8b4892a1d..a0ffe6a2a 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -51,7 +51,8 @@ src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/pkcs5/pkcs_5_1.obj \ -src/misc/pkcs5/pkcs_5_2.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj src/modes/cbc/cbc_done.obj \ +src/misc/pkcs5/pkcs_5_2.obj src/misc/zeromem.obj src/misc/hkdf/hkdf.obj \ +src/modes/cbc/cbc_decrypt.obj src/modes/cbc/cbc_done.obj \ src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj src/modes/cbc/cbc_setiv.obj \ src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj src/modes/cfb/cfb_done.obj \ src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj src/modes/cfb/cfb_setiv.obj \ diff --git a/makefile.shared b/makefile.shared index 97012ee41..2848c36aa 100644 --- a/makefile.shared +++ b/makefile.shared @@ -146,7 +146,8 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \ diff --git a/makefile.unix b/makefile.unix index 792c1f316..53882e2c3 100644 --- a/makefile.unix +++ b/makefile.unix @@ -87,7 +87,8 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \ diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index ad27eec4e..da5e4f9ac 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -74,6 +74,7 @@ enum { #include #include #include +#include #ifdef __cplusplus } diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 97de5de84..4f25ba7ef 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -360,6 +360,13 @@ #endif /* LTC_NO_PKCS */ +/* LTC_HKDF Key Derivation/Expansion stuff */ +#ifndef LTC_NO_HKDF + +#define LTC_HKDF + +#endif /* LTC_NO_HKDF */ + /* cleanup */ #ifdef LTC_MECC diff --git a/src/headers/tomcrypt_hkdf.h b/src/headers/tomcrypt_hkdf.h new file mode 100644 index 000000000..882fc8322 --- /dev/null +++ b/src/headers/tomcrypt_hkdf.h @@ -0,0 +1,26 @@ +/* LTC_HKDF Header Info */ + +/* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ +#ifdef LTC_HKDF + +int hkdf_extract(int hash_idx, + const unsigned char *salt, unsigned long saltlen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + +int hkdf_expand(int hash_idx, + const unsigned char *info, unsigned long infolen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long outlen); + +int hkdf(int hash_idx, + const unsigned char *salt, unsigned long saltlen, + const unsigned char *info, unsigned long infolen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long outlen); + +#endif /* LTC_HKDF */ + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c new file mode 100644 index 000000000..b067663f0 --- /dev/null +++ b/src/misc/hkdf/hkdf.c @@ -0,0 +1,113 @@ +#include +#include +#include + +#include + +#ifndef MIN +#define MIN(a,b) ((a)<(b))?(a):(b) +#endif + +/* This is mostly just a wrapper around hmac_memory */ +int hkdf_extract(int hash_idx, const unsigned char *salt, unsigned long saltlen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + /* libtomcrypt chokes on a zero length HMAC key, so we need to check for + that. HMAC specifies that keys shorter than the hash's blocksize are + 0 padded to the block size. HKDF specifies that a NULL salt is to be + substituted with a salt comprised of hashLen 0 bytes. HMAC's padding + means that in either case the HMAC is actually using a blocksize long + zero filled key. Unless blocksize < hashLen (which wouldn't make any + sense), we can use a single 0 byte as the HMAC key and still generate + valid results for HKDF. */ + if (salt == NULL || saltlen == 0) { + return hmac_memory(hash_idx, "", 1, in, inlen, out, outlen); + } else { + return hmac_memory(hash_idx, salt, saltlen, in, inlen, out, outlen); + } +} + +int hkdf_expand(int hash_idx, const unsigned char *info, unsigned long infolen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long outlen) +{ + const unsigned long hashsize = hash_descriptor[hash_idx].hashsize; + int err; + unsigned char N; + unsigned long Noutlen, outoff; + + unsigned char *T, *dat; + unsigned long Tlen, datlen; + + /* RFC5869 parameter restrictions */ + if (inlen < hashsize || outlen > hashsize * 255) + return CRYPT_INVALID_ARG; + if (info == NULL && infolen != 0) + return CRYPT_INVALID_ARG; + assert(out != NULL); + + Tlen = hashsize + infolen + 1; + T = XMALLOC(Tlen); /* Replace with static buffer? */ + if (T == NULL) { + return CRYPT_MEM; + } + XMEMCPY(T + hashsize, info, infolen); + + /* HMAC data T(1) doesn't include a previous hash value */ + dat = T + hashsize; + datlen = Tlen - hashsize; + + N = 0; + outoff = 0; /* offset in out to write to */ + while (1) { /* an exit condition breaks mid-loop */ + Noutlen = MIN(hashsize, outlen - outoff); + T[Tlen - 1] = ++N; + if ((err = hmac_memory(hash_idx, in, inlen, dat, datlen, + out + outoff, &Noutlen)) != CRYPT_OK) { + zeromem(T, Tlen); + XFREE(T); + return err; + } + outoff += Noutlen; + + if (outoff >= outlen) /* loop exit condition */ + break; + + /* All subsequent HMAC data T(N) DOES include the previous hash value */ + XMEMCPY(T, out + hashsize * (N-1), hashsize); + if (N == 1) { + dat = T; + datlen = Tlen; + } + } + zeromem(T, Tlen); + XFREE(T); + return CRYPT_OK; +} + +/* all in one step */ +int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, + const unsigned char *info, unsigned long infolen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long outlen) +{ + unsigned long hashsize = hash_descriptor[hash_idx].hashsize; + int err; + unsigned char *extracted = XMALLOC(hashsize); /* replace with static buffer? */ + if (extracted == NULL) { + return CRYPT_MEM; + } + if ((err = hkdf_extract(hash_idx, salt, saltlen, in, inlen, extracted, &hashsize)) != 0) { + zeromem(extracted, hashsize); + XFREE(extracted); + return err; + } + err = hkdf_expand(hash_idx, extracted, hashsize, info, infolen, out, outlen); + zeromem(extracted, hashsize); + XFREE(extracted); + return err; +} + + +/* vim: set ts=2 sw=2 et ai si: */ From d7a1480f9e78a36939eec3840b233c20298baed0 Mon Sep 17 00:00:00 2001 From: RyanC Date: Tue, 13 Nov 2012 09:30:26 -0800 Subject: [PATCH 0063/1192] docs for HKDF --- crypt.tex | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/crypt.tex b/crypt.tex index d28f3ccb9..83e10a4c6 100644 --- a/crypt.tex +++ b/crypt.tex @@ -5148,6 +5148,82 @@ \subsection{Algorithm Two} } \end{verbatim} +\mysection{Key Derviation Functions} +\subsection{HKDF} +\index{HKDF} +A key derivation function (KDF) is a basic and essential component of cryptographic systems. Its goal is to take some source of initial +keying material and derive from it one or more cryptographically strong secret keys. + +HKDF follows the "extract-then-expand" paradigm, where the KDF logically consists of two modules. The first stage takes the input +keying material and "extracts" from it a fixed-length pseudorandom key K. The second stage "expands" the key K into several additional +pseudorandom keys (the output of the KDF). + +In many applications, the input keying material is not necessarily distributed uniformly, and the attacker may have some partial +knowledge about it (for example, a Diffie-Hellman value computed by a key exchange protocol) or even partial control of it (as in some +entropy-gathering applications). Thus, the goal of the "extract" stage is to "concentrate" the possibly dispersed entropy of the input +keying material into a short, but cryptographically strong, pseudorandom key. In some applications, the input may already be a +good pseudorandom key; in these cases, the "extract" stage is not necessary, and the "expand" part can be used alone. + +The second stage "expands" the pseudorandom key to the desired length; the number and lengths of the output keys depend on the +specific cryptographic algorithms for which the keys are needed. + +\subsection{HKDF Extract} +To perform the extraction phase, use the following function: + +\index{hkdf\_extract()} +\begin{alltt} +int hkdf_extract( int hash_idx, + const unsigned char *salt, + unsigned long saltlen, + const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned long *outlen); +\end{alltt} +The \textit{hash_idx} parameter is the index into the descriptor table of the hash you want to use. +The \textit{salt} parameter is a pointer to the array of octets of length \textit{saltlen} containing the salt or a NULL pointer if a salt is not being used (in that case set saltlen to 0). +\textit{in} is a pointer to an array of octets of length \textit{inlen} containing the source entropy. The extracted output is stored in the location pointed to by \textit{out}. +You must set \textit{outlen} to the size of the destination buffer before calling this function. It is updated to the length of the extracted output. If \textit{outlen} is too small the extracted output will be truncated. + +While the salt is optional, using one improves HKDF's security. If used, the salt should be randomly chosen, but does not need to be secret and may be re-used. Please see RFC5869 section 3.1 for more details. + +\subsection{HKDF Expand} +To perform the expansion phase, use the following function: + +\index{hkdf\_expand()} +\begin{alltt} +int hkdf_expand( int hash_idx, + const unsigned char *info, + unsigned long infolen, + const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned long outlen); +\end{alltt} + +The \textit{hash_idx} parameter is the index into the descriptor table of the hash you want to use. +The \textit{info} parameter, an array of octets of length \textit{infolen}, is an optional parameter (set \textit{info} to NULL and \textit{infolen} to 0 if not using it) which +may be used to bind the derived keys to some application and context specific information. This prevents the same keying material from being generated in different contexts. Please see RFC5869 section 3.2 for more information. +The extracted keying material is passed as octet array \textit{in} of length \textit{inlen}. Expanded output of length \textit{outlen} is generated and stored in octet arrat \textit{out}. + +\subection{HKDF Extract-and-Expand} +To perform both phases together, use the following function: + +\index{hkdf()} +\begin{alltt} +int hkdf( int hash_idx, + const unsigned char *salt, + unsigned long saltlen, + const unsigned char *info, + unsigned long infolen, + const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned long outlen); +\end{alltt} + +Parameters are as in \textit{hkdf\_extract()} and \textit{hkdf\_expand()}. + \chapter{Miscellaneous} \mysection{Base64 Encoding and Decoding} The library provides functions to encode and decode a RFC 1521 base--64 coding scheme. The characters used in the mappings are: From abeddd6c4b310c6ce7c80e7e9075924db5eecc29 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Nov 2012 03:02:50 +0100 Subject: [PATCH 0064/1192] add hkdf_test() --- makefile | 2 +- src/headers/tomcrypt_hkdf.h | 2 + src/misc/hkdf/hkdf_test.c | 148 ++++++++++++++++++++++++++++++++++++ 3 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 src/misc/hkdf/hkdf_test.c diff --git a/makefile b/makefile index e9ef4e63e..6278a2014 100644 --- a/makefile +++ b/makefile @@ -156,7 +156,7 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o \ src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ diff --git a/src/headers/tomcrypt_hkdf.h b/src/headers/tomcrypt_hkdf.h index 882fc8322..f6a0228db 100644 --- a/src/headers/tomcrypt_hkdf.h +++ b/src/headers/tomcrypt_hkdf.h @@ -3,6 +3,8 @@ /* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ #ifdef LTC_HKDF +int hkdf_test(void); + int hkdf_extract(int hash_idx, const unsigned char *salt, unsigned long saltlen, const unsigned char *in, unsigned long inlen, diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c new file mode 100644 index 000000000..d6445062b --- /dev/null +++ b/src/misc/hkdf/hkdf_test.c @@ -0,0 +1,148 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include "tomcrypt.h" + +/** + @file hkdf_test.c + LTC_HKDF support, self-test, Steffen Jaeckel +*/ + +#ifdef LTC_HKDF + +/* + TEST CASES SOURCE: + +Internet Engineering Task Force (IETF) H. Krawczyk +Request for Comments: 5869 IBM Research +Category: Informational P. Eronen +ISSN: 2070-1721 Nokia + May 2010 +Appendix A. Test Vectors +*/ + +/** + LTC_HKDF self-test + @return CRYPT_OK if successful, CRYPT_NOP if tests have been disabled. +*/ +int hkdf_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + unsigned char OKM[82]; + int i; + + static const struct hkdf_test_case { + char* Hash; + unsigned char IKM[80]; + unsigned long IKM_l; + unsigned char salt[80]; + unsigned long salt_l; + unsigned char info[80]; + unsigned long info_l; + unsigned long L; + unsigned char PRK[32]; + unsigned char OKM[82]; + } cases[] = { +#ifdef LTC_SHA256 + /* + Basic test case with SHA-256 + + Hash = SHA-256 + IKM = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b (22 octets) + salt = 0x000102030405060708090a0b0c (13 octets) + info = 0xf0f1f2f3f4f5f6f7f8f9 (10 octets) + L = 42 + + PRK = 0x077709362c2e32df0ddc3f0dc47bba63 + 90b6c73bb50f9c3122ec844ad7c2b3e5 (32 octets) + OKM = 0x3cb25f25faacd57a90434f64d0362f2a + 2d2d0a90cf1a5a4c5db02d56ecc4c5bf + 34007208d5b887185865 (42 octets) + */ + + { "sha256", + {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 22, + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c}, 13, + {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9}, 10, + 42, + {0x07, 0x77, 0x09, 0x36, 0x2c, 0x2e, 0x32, 0xdf, + 0x0d, 0xdc, 0x3f, 0x0d, 0xc4, 0x7b, 0xba, 0x63, + 0x90, 0xb6, 0xc7, 0x3b, 0xb5, 0x0f, 0x9c, 0x31, + 0x22, 0xec, 0x84, 0x4a, 0xd7, 0xc2, 0xb3, 0xe5}, + {0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, + 0x90, 0x43, 0x4f, 0x64, 0xd0, 0x36, 0x2f, 0x2a, + 0x2d, 0x2d, 0x0a, 0x90, 0xcf, 0x1a, 0x5a, 0x4c, + 0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4, 0xc5, 0xbf, + 0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18, + 0x58, 0x65} } +#endif /* LTC_SHA256 */ + }; + + int err; + int tested=0,failed=0; + for(i=0; i < (int)(sizeof(cases) / sizeof(cases[0])); i++) { + int hash = find_hash(cases[i].Hash); + if (hash == -1) continue; + ++tested; + if((err = hkdf(hash, cases[i].salt, cases[i].salt_l, + cases[i].info, cases[i].info_l, + cases[i].IKM, cases[i].IKM_l, + OKM, cases[i].L)) != CRYPT_OK) { +#if 0 + printf("LTC_HKDF-%s test #%d, %s\n", cases[i].Hash, i, error_to_string(err)); +#endif + return err; + } + + if(XMEMCMP(OKM, cases[i].OKM, (size_t)cases[i].L) != 0) { + failed++; +#if 0 + { + unsigned int j; + printf("\LTC_HKDF-%s test #%d:\n", cases[i].Hash, i); + printf( "Result: 0x"); + for(j=0; j < cases[i].L; j++) { + printf("%02x ", OKM[j]); + } + printf("\nCorrect: 0x"); + for(j=0; j < cases[i].L; j++) { + printf("%02x ", cases[i].OKM[j]); + } + printf("\n"); + return CRYPT_ERROR; + } +#endif +#if 0 + } else { + printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, i); +#endif + } + } + + if (failed != 0) { + return CRYPT_FAIL_TESTVECTOR; + } else if (tested == 0) { + return CRYPT_NOP; + } else { + return CRYPT_OK; + } + #endif +} + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From 13c42a00f6c56e54cbfff399ea61256d94c7ed8b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Nov 2012 03:03:19 +0100 Subject: [PATCH 0065/1192] hkdf: fix compiler warning --- src/misc/hkdf/hkdf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index b067663f0..ee65c619a 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -22,7 +22,7 @@ int hkdf_extract(int hash_idx, const unsigned char *salt, unsigned long saltlen sense), we can use a single 0 byte as the HMAC key and still generate valid results for HKDF. */ if (salt == NULL || saltlen == 0) { - return hmac_memory(hash_idx, "", 1, in, inlen, out, outlen); + return hmac_memory(hash_idx, (const unsigned char *)"", 1, in, inlen, out, outlen); } else { return hmac_memory(hash_idx, salt, saltlen, in, inlen, out, outlen); } From c1243feef24d5e0a910ea9b4881d4657a67ad166 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Nov 2012 03:03:54 +0100 Subject: [PATCH 0066/1192] hkdf: improve argument validation --- src/misc/hkdf/hkdf.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index ee65c619a..80ea2abd5 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -32,7 +32,7 @@ int hkdf_expand(int hash_idx, const unsigned char *info, unsigned long infolen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long outlen) { - const unsigned long hashsize = hash_descriptor[hash_idx].hashsize; + unsigned long hashsize; int err; unsigned char N; unsigned long Noutlen, outoff; @@ -40,12 +40,19 @@ int hkdf_expand(int hash_idx, const unsigned char *info, unsigned long infolen, unsigned char *T, *dat; unsigned long Tlen, datlen; + /* make sure hash descriptor is valid */ + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + return err; + } + + hashsize = hash_descriptor[hash_idx].hashsize; + /* RFC5869 parameter restrictions */ if (inlen < hashsize || outlen > hashsize * 255) return CRYPT_INVALID_ARG; if (info == NULL && infolen != 0) return CRYPT_INVALID_ARG; - assert(out != NULL); + LTC_ARGCHK(out != NULL); Tlen = hashsize + infolen + 1; T = XMALLOC(Tlen); /* Replace with static buffer? */ @@ -92,9 +99,18 @@ int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long outlen) { - unsigned long hashsize = hash_descriptor[hash_idx].hashsize; + unsigned long hashsize; int err; - unsigned char *extracted = XMALLOC(hashsize); /* replace with static buffer? */ + unsigned char *extracted; + + /* make sure hash descriptor is valid */ + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + return err; + } + + hashsize = hash_descriptor[hash_idx].hashsize; + + extracted = XMALLOC(hashsize); /* replace with static buffer? */ if (extracted == NULL) { return CRYPT_MEM; } From e81ac102bdf575e1d003b2d3ab3e822f4c584d6c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Nov 2012 03:04:50 +0100 Subject: [PATCH 0067/1192] add misc_test() --- demos/test.c | 3 ++- testprof/makefile | 2 +- testprof/misc_test.c | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 testprof/misc_test.c diff --git a/demos/test.c b/demos/test.c index abfd22aab..0d26b957b 100644 --- a/demos/test.c +++ b/demos/test.c @@ -18,6 +18,7 @@ int main(void) printf("build == \n%s\n", crypt_build_settings); printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\nmisc_test...."); fflush(stdout); x = misc_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nmodes_test...."); fflush(stdout); x = modes_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nder_test......"); fflush(stdout); x = der_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); @@ -25,7 +26,7 @@ int main(void) printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ndh_test......."); fflush(stdout); x = dh_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ndsa_test......"); fflush(stdout); x = dsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nkatja_test...."); fflush(stdout); x = katja_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\n"); diff --git a/testprof/makefile b/testprof/makefile index c52fe7bd7..f3ce3db12 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -6,7 +6,7 @@ ifndef RANLIB endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ -dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ +dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o ifndef LIBTEST_S diff --git a/testprof/misc_test.c b/testprof/misc_test.c new file mode 100644 index 000000000..40f4b444b --- /dev/null +++ b/testprof/misc_test.c @@ -0,0 +1,13 @@ +#include + +int misc_test(void) +{ +#ifdef LTC_HKDF + DO(hkdf_test()); +#endif + return 0; +} + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From 8fcd408a98b1ddfcd343934aafbcceda9386d277 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 14 Mar 2013 23:25:17 +0100 Subject: [PATCH 0068/1192] fixed latex compile errors --- crypt.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypt.tex b/crypt.tex index 83e10a4c6..4a5d59b8c 100644 --- a/crypt.tex +++ b/crypt.tex @@ -5180,7 +5180,7 @@ \subsection{HKDF Extract} unsigned char *out, unsigned long *outlen); \end{alltt} -The \textit{hash_idx} parameter is the index into the descriptor table of the hash you want to use. +The \textit{hash\_idx} parameter is the index into the descriptor table of the hash you want to use. The \textit{salt} parameter is a pointer to the array of octets of length \textit{saltlen} containing the salt or a NULL pointer if a salt is not being used (in that case set saltlen to 0). \textit{in} is a pointer to an array of octets of length \textit{inlen} containing the source entropy. The extracted output is stored in the location pointed to by \textit{out}. You must set \textit{outlen} to the size of the destination buffer before calling this function. It is updated to the length of the extracted output. If \textit{outlen} is too small the extracted output will be truncated. @@ -5201,12 +5201,12 @@ \subsection{HKDF Expand} unsigned long outlen); \end{alltt} -The \textit{hash_idx} parameter is the index into the descriptor table of the hash you want to use. +The \textit{hash\_idx} parameter is the index into the descriptor table of the hash you want to use. The \textit{info} parameter, an array of octets of length \textit{infolen}, is an optional parameter (set \textit{info} to NULL and \textit{infolen} to 0 if not using it) which may be used to bind the derived keys to some application and context specific information. This prevents the same keying material from being generated in different contexts. Please see RFC5869 section 3.2 for more information. The extracted keying material is passed as octet array \textit{in} of length \textit{inlen}. Expanded output of length \textit{outlen} is generated and stored in octet arrat \textit{out}. -\subection{HKDF Extract-and-Expand} +\subsection{HKDF Extract-and-Expand} To perform both phases together, use the following function: \index{hkdf()} From 1c779b88f16d8ec47533d65c255c6a617d168d9c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 14 Mar 2013 23:47:50 +0100 Subject: [PATCH 0069/1192] moar debug output --- src/misc/hkdf/hkdf.c | 12 ++++++++++++ src/misc/hkdf/hkdf_test.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index 80ea2abd5..cec3daa72 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -119,6 +119,18 @@ int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, XFREE(extracted); return err; } +#if 0 + { + int j; + printf("\nPRK: 0x"); + for(j=0; j < hashsize; j++) { + printf("%02x ", extracted[j]); + } + for(j=0; j < hashsize; j++) { + printf("%02x ", extracted[j]); + } + } +#endif err = hkdf_expand(hash_idx, extracted, hashsize, info, infolen, out, outlen); zeromem(extracted, hashsize); XFREE(extracted); diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index d6445062b..a93633687 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -110,7 +110,7 @@ int hkdf_test(void) #if 0 { unsigned int j; - printf("\LTC_HKDF-%s test #%d:\n", cases[i].Hash, i); + printf("\nLTC_HKDF-%s test #%d:\n", cases[i].Hash, i); printf( "Result: 0x"); for(j=0; j < cases[i].L; j++) { printf("%02x ", OKM[j]); From 11f50bfb3c09cb4d322546fd2a866fec832cb227 Mon Sep 17 00:00:00 2001 From: RyanC Date: Thu, 14 Mar 2013 20:44:53 -0700 Subject: [PATCH 0070/1192] fix hkdf_expand arguments --- src/misc/hkdf/hkdf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index cec3daa72..279c8eda1 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -131,7 +131,7 @@ int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, } } #endif - err = hkdf_expand(hash_idx, extracted, hashsize, info, infolen, out, outlen); + err = hkdf_expand(hash_idx, info, infolen, extracted, hashsize, out, outlen); zeromem(extracted, hashsize); XFREE(extracted); return err; From fe18c95e76b8aac6333df5326281a670ac139cf4 Mon Sep 17 00:00:00 2001 From: RyanC Date: Thu, 14 Mar 2013 21:30:36 -0700 Subject: [PATCH 0071/1192] add the rest of the hkdf test cases --- src/misc/hkdf/hkdf_test.c | 186 +++++++++++++++++++++++++++++++++++--- 1 file changed, 174 insertions(+), 12 deletions(-) diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index a93633687..70bb0082e 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -39,6 +39,7 @@ int hkdf_test(void) int i; static const struct hkdf_test_case { + int num; char* Hash; unsigned char IKM[80]; unsigned long IKM_l; @@ -46,9 +47,10 @@ int hkdf_test(void) unsigned long salt_l; unsigned char info[80]; unsigned long info_l; - unsigned long L; unsigned char PRK[32]; + unsigned long PRK_l; unsigned char OKM[82]; + unsigned long OKM_l; } cases[] = { #ifdef LTC_SHA256 /* @@ -66,8 +68,7 @@ int hkdf_test(void) 2d2d0a90cf1a5a4c5db02d56ecc4c5bf 34007208d5b887185865 (42 octets) */ - - { "sha256", + {1, "sha256", {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 22, @@ -75,18 +76,179 @@ int hkdf_test(void) 0x08, 0x09, 0x0a, 0x0b, 0x0c}, 13, {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9}, 10, - 42, {0x07, 0x77, 0x09, 0x36, 0x2c, 0x2e, 0x32, 0xdf, 0x0d, 0xdc, 0x3f, 0x0d, 0xc4, 0x7b, 0xba, 0x63, 0x90, 0xb6, 0xc7, 0x3b, 0xb5, 0x0f, 0x9c, 0x31, - 0x22, 0xec, 0x84, 0x4a, 0xd7, 0xc2, 0xb3, 0xe5}, + 0x22, 0xec, 0x84, 0x4a, 0xd7, 0xc2, 0xb3, 0xe5}, 32, {0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, 0x90, 0x43, 0x4f, 0x64, 0xd0, 0x36, 0x2f, 0x2a, 0x2d, 0x2d, 0x0a, 0x90, 0xcf, 0x1a, 0x5a, 0x4c, 0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4, 0xc5, 0xbf, 0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18, - 0x58, 0x65} } + 0x58, 0x65}, 42}, + /* Test with SHA-256 and longer inputs/outputs */ + {2, "sha256", + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22,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xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}, 80, + {0x06, 0xa6, 0xb8, 0x8c, 0x58, 0x53, 0x36, 0x1a, + 0x06, 0x10, 0x4c, 0x9c, 0xeb, 0x35, 0xb4, 0x5c, + 0xef, 0x76, 0x00, 0x14, 0x90, 0x46, 0x71, 0x01, + 0x4a, 0x19, 0x3f, 0x40, 0xc1, 0x5f, 0xc2, 0x44}, 32, + {0xb1, 0x1e, 0x39, 0x8d, 0xc8, 0x03, 0x27, 0xa1, + 0xc8, 0xe7, 0xf7, 0x8c, 0x59, 0x6a, 0x49, 0x34, + 0x4f, 0x01, 0x2e, 0xda, 0x2d, 0x4e, 0xfa, 0xd8, + 0xa0, 0x50, 0xcc, 0x4c, 0x19, 0xaf, 0xa9, 0x7c, + 0x59, 0x04, 0x5a, 0x99, 0xca, 0xc7, 0x82, 0x72, + 0x71, 0xcb, 0x41, 0xc6, 0x5e, 0x59, 0x0e, 0x09, + 0xda, 0x32, 0x75, 0x60, 0x0c, 0x2f, 0x09, 0xb8, + 0x36, 0x77, 0x93, 0xa9, 0xac, 0xa3, 0xdb, 0x71, + 0xcc, 0x30, 0xc5, 0x81, 0x79, 0xec, 0x3e, 0x87, + 0xc1, 0x4c, 0x01, 0xd5, 0xc1, 0xf3, 0x43, 0x4f, + 0x1d, 0x87}, 82}, + /* Test with SHA-256 and zero length salt/info */ + {3, "sha256", + {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 22, + {0}, 0, + {0}, 0, + {0x19, 0xef, 0x24, 0xa3, 0x2c, 0x71, 0x7b, 0x16, + 0x7f, 0x33, 0xa9, 0x1d, 0x6f, 0x64, 0x8b, 0xdf, + 0x96, 0x59, 0x67, 0x76, 0xaf, 0xdb, 0x63, 0x77, + 0xac, 0x43, 0x4c, 0x1c, 0x29, 0x3c, 0xcb, 0x04}, 32, + {0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, + 0x71, 0x5f, 0x80, 0x2a, 0x06, 0x3c, 0x5a, 0x31, + 0xb8, 0xa1, 0x1f, 0x5c, 0x5e, 0xe1, 0x87, 0x9e, + 0xc3, 0x45, 0x4e, 0x5f, 0x3c, 0x73, 0x8d, 0x2d, + 0x9d, 0x20, 0x13, 0x95, 0xfa, 0xa4, 0xb6, 0x1a, + 0x96, 0xc8}, 42}, #endif /* LTC_SHA256 */ +#ifdef LTC_SHA1 + /* Basic test case with SHA-1 */ + {4, "sha1", + {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b}, 11, + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c}, 13, + {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9}, 10, + {0x9b, 0x6c, 0x18, 0xc4, 0x32, 0xa7, 0xbf, 0x8f, + 0x0e, 0x71, 0xc8, 0xeb, 0x88, 0xf4, 0xb3, 0x0b, + 0xaa, 0x2b, 0xa2, 0x43}, 20, + {0x08, 0x5a, 0x01, 0xea, 0x1b, 0x10, 0xf3, 0x69, + 0x33, 0x06, 0x8b, 0x56, 0xef, 0xa5, 0xad, 0x81, + 0xa4, 0xf1, 0x4b, 0x82, 0x2f, 0x5b, 0x09, 0x15, + 0x68, 0xa9, 0xcd, 0xd4, 0xf1, 0x55, 0xfd, 0xa2, + 0xc2, 0x2e, 0x42, 0x24, 0x78, 0xd3, 0x05, 0xf3, + 0xf8, 0x96}, 42}, + /* Test with SHA-1 and longer inputs/outputs */ + {5, "sha1", + {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f}, 80, + {0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf}, 80, + {0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}, 80, + {0x8a, 0xda, 0xe0, 0x9a, 0x2a, 0x30, 0x70, 0x59, + 0x47, 0x8d, 0x30, 0x9b, 0x26, 0xc4, 0x11, 0x5a, + 0x22, 0x4c, 0xfa, 0xf6}, 20, + {0x0b, 0xd7, 0x70, 0xa7, 0x4d, 0x11, 0x60, 0xf7, + 0xc9, 0xf1, 0x2c, 0xd5, 0x91, 0x2a, 0x06, 0xeb, + 0xff, 0x6a, 0xdc, 0xae, 0x89, 0x9d, 0x92, 0x19, + 0x1f, 0xe4, 0x30, 0x56, 0x73, 0xba, 0x2f, 0xfe, + 0x8f, 0xa3, 0xf1, 0xa4, 0xe5, 0xad, 0x79, 0xf3, + 0xf3, 0x34, 0xb3, 0xb2, 0x02, 0xb2, 0x17, 0x3c, + 0x48, 0x6e, 0xa3, 0x7c, 0xe3, 0xd3, 0x97, 0xed, + 0x03, 0x4c, 0x7f, 0x9d, 0xfe, 0xb1, 0x5c, 0x5e, + 0x92, 0x73, 0x36, 0xd0, 0x44, 0x1f, 0x4c, 0x43, + 0x00, 0xe2, 0xcf, 0xf0, 0xd0, 0x90, 0x0b, 0x52, + 0xd3, 0xb4}, 82}, + /* Test with SHA-1 and zero-length salt/info */ + {6, "sha1", + {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 22, + {0}, 0, + {0}, 0, + {0xda, 0x8c, 0x8a, 0x73, 0xc7, 0xfa, 0x77, 0x28, + 0x8e, 0xc6, 0xf5, 0xe7, 0xc2, 0x97, 0x78, 0x6a, + 0xa0, 0xd3, 0x2d, 0x01}, 20, + {0x0a, 0xc1, 0xaf, 0x70, 0x02, 0xb3, 0xd7, 0x61, + 0xd1, 0xe5, 0x52, 0x98, 0xda, 0x9d, 0x05, 0x06, + 0xb9, 0xae, 0x52, 0x05, 0x72, 0x20, 0xa3, 0x06, + 0xe0, 0x7b, 0x6b, 0x87, 0xe8, 0xdf, 0x21, 0xd0, + 0xea, 0x00, 0x03, 0x3d, 0xe0, 0x39, 0x84, 0xd3, + 0x49, 0x18}, 42}, + /* Test with SHA-1, salt not provided (defaults to HashLen zero octets), + zero-length info */ + {7, "sha1", + {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, 22, + {0}, 0, /* pass a null pointer */ + {0}, 0, + {0x2a, 0xdc, 0xca, 0xda, 0x18, 0x77, 0x9e, 0x7c, + 0x20, 0x77, 0xad, 0x2e, 0xb1, 0x9d, 0x3f, 0x3e, + 0x73, 0x13, 0x85, 0xdd}, 20, + {0x2c, 0x91, 0x11, 0x72, 0x04, 0xd7, 0x45, 0xf3, + 0x50, 0x0d, 0x63, 0x6a, 0x62, 0xf6, 0x4f, 0x0a, + 0xb3, 0xba, 0xe5, 0x48, 0xaa, 0x53, 0xd4, 0x23, + 0xb0, 0xd1, 0xf2, 0x7e, 0xbb, 0xa6, 0xf5, 0xe5, + 0x67, 0x3a, 0x08, 0x1d, 0x70, 0xcc, 0xe7, 0xac, + 0xfc, 0x48}, 42}, +#endif /* LTC_SHA1 */ }; int err; @@ -98,25 +260,25 @@ int hkdf_test(void) if((err = hkdf(hash, cases[i].salt, cases[i].salt_l, cases[i].info, cases[i].info_l, cases[i].IKM, cases[i].IKM_l, - OKM, cases[i].L)) != CRYPT_OK) { + OKM, cases[i].OKM_l)) != CRYPT_OK) { #if 0 printf("LTC_HKDF-%s test #%d, %s\n", cases[i].Hash, i, error_to_string(err)); #endif return err; } - if(XMEMCMP(OKM, cases[i].OKM, (size_t)cases[i].L) != 0) { + if(XMEMCMP(OKM, cases[i].OKM, (size_t)cases[i].OKM_l) != 0) { failed++; #if 0 { unsigned int j; - printf("\nLTC_HKDF-%s test #%d:\n", cases[i].Hash, i); + printf("\nLTC_HKDF-%s test #%d:\n", cases[i].Hash, cases[i].num); printf( "Result: 0x"); - for(j=0; j < cases[i].L; j++) { + for(j=0; j < cases[i].OKM_l; j++) { printf("%02x ", OKM[j]); } printf("\nCorrect: 0x"); - for(j=0; j < cases[i].L; j++) { + for(j=0; j < cases[i].OKM_l; j++) { printf("%02x ", cases[i].OKM[j]); } printf("\n"); @@ -125,7 +287,7 @@ int hkdf_test(void) #endif #if 0 } else { - printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, i); + printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, cases[i].num); #endif } } From 7efe74427b005b658d8adf4db2ae7ad5565c4fc0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Mar 2013 19:42:55 +0100 Subject: [PATCH 0072/1192] update gitignore --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 08e456b55..3054fb5d0 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,12 @@ timing.exe # ignore VS intermediate and program database files *.idb *.pdb + +# oops ;) but we don't want them to appear in the repository... +*.stackdump + +# misc +*.rej +*.patch +*.diff +*.orig From 8e22b17a8ef0bb682722f86cea6a9e03be25b5e1 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Wed, 6 Mar 2013 19:52:22 +0100 Subject: [PATCH 0073/1192] fix define LTC_YARROW_AES --- src/headers/tomcrypt_custom.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 4f25ba7ef..e34adfb52 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -256,7 +256,11 @@ #define LTC_YARROW /* which descriptor of AES to use? */ /* 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] */ -#define LTC_YARROW_AES 0 +#ifdef ENCRYPT_ONLY + #define LTC_YARROW_AES 0 +#else + #define LTC_YARROW_AES 2 +#endif #if defined(LTC_YARROW) && !defined(LTC_CTR_MODE) #error LTC_YARROW requires LTC_CTR_MODE chaining mode to be defined! From abab7089a3585a8b9b48fe340bca225f21c8978a Mon Sep 17 00:00:00 2001 From: karel-m Date: Sun, 5 Aug 2012 01:21:13 +0200 Subject: [PATCH 0074/1192] OCBv3 according http://tools.ietf.org/html/draft-krovetz-ocb-03 --- demos/tv_gen.c | 63 +++++ src/encauth/ocb3/ocb3_add_aad.c | 81 ++++++ src/encauth/ocb3/ocb3_decrypt.c | 86 ++++++ src/encauth/ocb3/ocb3_decrypt_last.c | 106 ++++++++ src/encauth/ocb3/ocb3_decrypt_verify_memory.c | 112 ++++++++ src/encauth/ocb3/ocb3_done.c | 92 +++++++ src/encauth/ocb3/ocb3_encrypt.c | 86 ++++++ .../ocb3/ocb3_encrypt_authenticate_memory.c | 87 +++++++ src/encauth/ocb3/ocb3_encrypt_last.c | 108 ++++++++ src/encauth/ocb3/ocb3_init.c | 134 ++++++++++ src/encauth/ocb3/ocb3_int_aad_add_block.c | 49 ++++ src/encauth/ocb3/ocb3_int_calc_offset_zero.c | 72 +++++ src/encauth/ocb3/ocb3_int_ntz.c | 41 +++ src/encauth/ocb3/ocb3_int_xor_blocks.c | 40 +++ src/encauth/ocb3/ocb3_test.c | 246 ++++++++++++++++++ src/headers/tomcrypt_custom.h | 1 + src/headers/tomcrypt_mac.h | 61 +++++ src/misc/crypt/crypt.c | 3 + testprof/mac_test.c | 3 + testprof/x86_prof.c | 16 ++ 20 files changed, 1487 insertions(+) create mode 100644 src/encauth/ocb3/ocb3_add_aad.c create mode 100644 src/encauth/ocb3/ocb3_decrypt.c create mode 100644 src/encauth/ocb3/ocb3_decrypt_last.c create mode 100644 src/encauth/ocb3/ocb3_decrypt_verify_memory.c create mode 100644 src/encauth/ocb3/ocb3_done.c create mode 100644 src/encauth/ocb3/ocb3_encrypt.c create mode 100644 src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c create mode 100644 src/encauth/ocb3/ocb3_encrypt_last.c create mode 100644 src/encauth/ocb3/ocb3_init.c create mode 100644 src/encauth/ocb3/ocb3_int_aad_add_block.c create mode 100644 src/encauth/ocb3/ocb3_int_calc_offset_zero.c create mode 100644 src/encauth/ocb3/ocb3_int_ntz.c create mode 100644 src/encauth/ocb3/ocb3_int_xor_blocks.c create mode 100644 src/encauth/ocb3/ocb3_test.c diff --git a/demos/tv_gen.c b/demos/tv_gen.c index fe7acdc67..b00a5c473 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -516,6 +516,68 @@ void ocb_gen(void) fclose(out); } +void ocb3_gen(void) +{ + int err, kl, x, y1, z; + FILE *out; + unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], + plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE]; + unsigned long len; + + out = fopen("ocb3_tv.txt", "w"); + fprintf(out, "OCB3 Test Vectors. Uses the 00010203...NN-1 pattern for nonce/plaintext/key. The outputs\n" + "are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous\n" + "step repeated sufficiently. The nonce is fixed throughout. AAD is fixed to 3 bytes (ASCII) 'AAD'.\n\n"); + + for (x = 0; cipher_descriptor[x].name != NULL; x++) { + kl = cipher_descriptor[x].block_length; + + /* skip ciphers which do not have 64 or 128 bit block sizes */ + if (kl != 8 && kl != 16) continue; + + if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) { + kl = cipher_descriptor[x].max_key_length; + } + fprintf(out, "OCB-%s (%d byte key)\n", cipher_descriptor[x].name, kl); + + /* the key */ + for (z = 0; z < kl; z++) { + key[z] = (z & 255); + } + + /* fixed nonce */ + for (z = 0; z < cipher_descriptor[x].block_length; z++) { + nonce[z] = z; + } + + for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){ + for (z = 0; z < y1; z++) { + plaintext[z] = (unsigned char)(z & 255); + } + len = sizeof(tag); + if ((err = ocb3_encrypt_authenticate_memory(x, key, kl, nonce, cipher_descriptor[x].block_length, "AAD", 3, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) { + printf("Error OCB'ing: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + fprintf(out, "%3d: ", y1); + for (z = 0; z < y1; z++) { + fprintf(out, "%02X", plaintext[z]); + } + fprintf(out, ", "); + for (z = 0; z <(int)len; z++) { + fprintf(out, "%02X", tag[z]); + } + fprintf(out, "\n"); + + /* forward the key */ + for (z = 0; z < kl; z++) { + key[z] = tag[z % len]; + } + } + fprintf(out, "\n"); + } + fclose(out); +} void ccm_gen(void) { @@ -775,6 +837,7 @@ int main(void) printf("Generating PMAC vectors..."); fflush(stdout); pmac_gen(); printf("done\n"); printf("Generating EAX vectors..."); fflush(stdout); eax_gen(); printf("done\n"); printf("Generating OCB vectors..."); fflush(stdout); ocb_gen(); printf("done\n"); + printf("Generating OCB3 vectors..."); fflush(stdout); ocb3_gen(); printf("done\n"); printf("Generating CCM vectors..."); fflush(stdout); ccm_gen(); printf("done\n"); printf("Generating GCM vectors..."); fflush(stdout); gcm_gen(); printf("done\n"); printf("Generating BASE64 vectors..."); fflush(stdout); base64_gen(); printf("done\n"); diff --git a/src/encauth/ocb3/ocb3_add_aad.c b/src/encauth/ocb3/ocb3_add_aad.c new file mode 100644 index 000000000..460867051 --- /dev/null +++ b/src/encauth/ocb3/ocb3_add_aad.c @@ -0,0 +1,81 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/** + @file ocb3_add_aad.c + OCB implementation, add AAD data, by Karel Miko +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Add AAD - additional associated data + @param ocb The OCB state + @param aad The AAD data + @param aadlen The size of AAD data (octets) + @return CRYPT_OK if successful +*/ +int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen) +{ + int err, x, full_blocks, full_blocks_len, last_block_len; + unsigned char *data; + unsigned long datalen, l; + + LTC_ARGCHK(ocb != NULL); + LTC_ARGCHK(aad != NULL); + + if (aadlen == 0) return CRYPT_OK; + + if (ocb->adata_buffer_bytes > 0) { + l = ocb->block_len - ocb->adata_buffer_bytes; + if (l > aadlen) l = aadlen; + XMEMCPY(ocb->adata_buffer+ocb->adata_buffer_bytes, aad, l); + ocb->adata_buffer_bytes += l; + + if (ocb->adata_buffer_bytes == ocb->block_len) { + if ((err = ocb3_int_aad_add_block(ocb, ocb->adata_buffer)) != CRYPT_OK) { + return err; + } + ocb->adata_buffer_bytes = 0; + } + + data = (unsigned char *)aad + l; + datalen = aadlen - l; + } + else { + data = (unsigned char *)aad; + datalen = aadlen; + } + + if (datalen <= 0) return CRYPT_OK; + + full_blocks = datalen/ocb->block_len; + full_blocks_len = full_blocks * ocb->block_len; + last_block_len = datalen - full_blocks_len; + + for (x=0; xblock_len)) != CRYPT_OK) { + return err; + } + } + + if (last_block_len>0) { + XMEMCPY(ocb->adata_buffer, data+full_blocks_len, last_block_len); + ocb->adata_buffer_bytes = last_block_len; + } + + return CRYPT_OK; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_decrypt.c b/src/encauth/ocb3/ocb3_decrypt.c new file mode 100644 index 000000000..24d6ad159 --- /dev/null +++ b/src/encauth/ocb3/ocb3_decrypt.c @@ -0,0 +1,86 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file ocb3_decrypt.c + OCB implementation, decrypt data, by Tom St Denis +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Decrypt blocks of ciphertext with OCB + @param ocb The OCB state + @param ct The ciphertext (length multiple of the block size of the block cipher) + @param ctlen The length of the input (octets) + @param pt [out] The plaintext (length of ct) + @return CRYPT_OK if successful +*/ +int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt) +{ + unsigned char tmp[MAXBLOCKSIZE]; + int err, i, full_blocks; + unsigned char *pt_b, *ct_b; + + LTC_ARGCHK(ocb != NULL); + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { + return err; + } + if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) { + return CRYPT_INVALID_ARG; + } + + if (ctlen % ocb->block_len) { /* ctlen has to bu multiple of block_len */ + return CRYPT_INVALID_ARG; + } + + full_blocks = ctlen/ocb->block_len; + for(i=0; iblock_len; + ct_b = (unsigned char *)ct+i*ocb->block_len; + + /* ocb->Offset_current[] = ocb->Offset_current[] ^ Offset_{ntz(block_index)} */ + ocb3_int_xor_blocks(ocb->Offset_current, ocb->Offset_current, ocb->L_[ocb3_int_ntz(ocb->block_index)], ocb->block_len); + + /* tmp[] = ct[] XOR ocb->Offset_current[] */ + ocb3_int_xor_blocks(tmp, ct_b, ocb->Offset_current, ocb->block_len); + + /* decrypt */ + if ((err = cipher_descriptor[ocb->cipher].ecb_decrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* pt[] = tmp[] XOR ocb->Offset_current[] */ + ocb3_int_xor_blocks(pt_b, tmp, ocb->Offset_current, ocb->block_len); + + /* ocb->checksum[] = ocb->checksum[] XOR pt[] */ + ocb3_int_xor_blocks(ocb->checksum, ocb->checksum, pt_b, ocb->block_len); + + ocb->block_index++; + } + + err = CRYPT_OK; + +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(tmp, sizeof(tmp)); +#endif + return err; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_decrypt_last.c b/src/encauth/ocb3/ocb3_decrypt_last.c new file mode 100644 index 000000000..35ba864c4 --- /dev/null +++ b/src/encauth/ocb3/ocb3_decrypt_last.c @@ -0,0 +1,106 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/** + @file ocb3_decrypt_last.c + OCB implementation, internal helper, by Karel Miko +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Finish an OCB (decryption) stream + @param ocb The OCB state + @param ct The remaining ciphertext + @param ctlen The length of the ciphertext (octets) + @param pt [out] The output buffer + @return CRYPT_OK if successful +*/ +int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt) +{ + unsigned char iOffset_star[MAXBLOCKSIZE]; + unsigned char iPad[MAXBLOCKSIZE]; + int err, x, full_blocks, full_blocks_len, last_block_len; + + LTC_ARGCHK(ocb != NULL); + LTC_ARGCHK(ct != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { + goto LBL_ERR; + } + + full_blocks = ctlen/ocb->block_len; + full_blocks_len = full_blocks * ocb->block_len; + last_block_len = ctlen - full_blocks_len; + + /* process full blocks first */ + if (full_blocks>0) { + if ((err = ocb3_decrypt(ocb, ct, full_blocks_len, pt)) != CRYPT_OK) { + goto LBL_ERR; + } + } + + if (last_block_len>0) { + /* Offset_* = Offset_m xor L_* */ + ocb3_int_xor_blocks(iOffset_star, ocb->Offset_current, ocb->L_star, ocb->block_len); + + /* Pad = ENCIPHER(K, Offset_*) */ + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(iOffset_star, iPad, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* P_* = C_* xor Pad[1..bitlen(C_*)] */ + ocb3_int_xor_blocks(pt+full_blocks_len, (unsigned char *)ct+full_blocks_len, iPad, last_block_len); + + /* Checksum_* = Checksum_m xor (P_* || 1 || zeros(127-bitlen(P_*))) */ + ocb3_int_xor_blocks(ocb->checksum, ocb->checksum, pt+full_blocks_len, last_block_len); + for(x=last_block_len; xblock_len; x++) { + if (x == last_block_len) + ocb->checksum[x] ^= 0x80; + else + ocb->checksum[x] ^= 0x00; + } + + /* Tag = ENCIPHER(K, Checksum_* xor Offset_* xor L_$) xor HASH(K,A) */ + /* at this point we calculate only: Tag_part = ENCIPHER(K, Checksum_* xor Offset_* xor L_$) */ + for(x=0; xblock_len; x++) { + ocb->tag_part[x] = (ocb->checksum[x] ^ iOffset_star[x]) ^ ocb->L_dollar[x]; + } + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(ocb->tag_part, ocb->tag_part, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + } + else { + /* Tag = ENCIPHER(K, Checksum_m xor Offset_m xor L_$) xor HASH(K,A) */ + /* at this point we calculate only: Tag_part = ENCIPHER(K, Checksum_m xor Offset_m xor L_$) */ + for(x=0; xblock_len; x++) { + ocb->tag_part[x] = (ocb->checksum[x] ^ ocb->Offset_current[x]) ^ ocb->L_dollar[x]; + } + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(ocb->tag_part, ocb->tag_part, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + } + + err = CRYPT_OK; + +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(iOffset_star, MAXBLOCKSIZE); + zeromem(iPad, MAXBLOCKSIZE); + zeromem(ocb, sizeof(*ocb)); +#endif + + return err; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c new file mode 100644 index 000000000..ce8fe9ce9 --- /dev/null +++ b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c @@ -0,0 +1,112 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file ocb3_decrypt_verify_memory.c + OCB implementation, helper to decrypt block of memory, by Tom St Denis +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Decrypt and compare the tag with OCB + @param cipher The index of the cipher desired + @param key The secret key + @param keylen The length of the secret key (octets) + @param nonce The session nonce (length of the block size of the block cipher) + @param noncelen The length of the nonce (octets) + @param adata The AAD - additional associated data + @param adatalen The length of AAD (octets) + @param ct The ciphertext + @param ctlen The length of the ciphertext (octets) + @param pt [out] The plaintext + @param tag The tag to compare against + @param taglen The length of the tag (octets) + @param stat [out] The result of the tag comparison (1==valid, 0==invalid) + @return CRYPT_OK if successful regardless of the tag comparison +*/ +int ocb3_decrypt_verify_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *adata, unsigned long adatalen, + const unsigned char *ct, unsigned long ctlen, + unsigned char *pt, + const unsigned char *tag, unsigned long taglen, + int *stat) +{ + int err; + ocb3_state *ocb; + unsigned char *buf; + unsigned long buflen; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(nonce != NULL); + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(tag != NULL); + LTC_ARGCHK(stat != NULL); + + /* default to zero */ + *stat = 0; + + /* allocate memory */ + buf = XMALLOC(taglen); + ocb = XMALLOC(sizeof(ocb3_state)); + if (ocb == NULL || buf == NULL) { + if (ocb != NULL) { + XFREE(ocb); + } + if (buf != NULL) { + XFREE(buf); + } + return CRYPT_MEM; + } + + if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen)) != CRYPT_OK) { + goto LBL_ERR; + } + + if ((err = ocb3_add_aad(ocb, adata, adatalen)) != CRYPT_OK) { + goto LBL_ERR; + } + + if ((err = ocb3_decrypt_last(ocb, ct, ctlen, pt)) != CRYPT_OK) { + goto LBL_ERR; + } + + buflen = taglen; + if ((err = ocb3_done(ocb, buf, &buflen)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* compare tags */ + if (buflen >= taglen && XMEMCMP(buf, tag, taglen) == 0) { + *stat = 1; + } + + err = CRYPT_OK; + +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(ocb, sizeof(ocb3_state)); +#endif + + XFREE(ocb); + XFREE(buf); + return err; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_done.c b/src/encauth/ocb3/ocb3_done.c new file mode 100644 index 000000000..4102d9c1a --- /dev/null +++ b/src/encauth/ocb3/ocb3_done.c @@ -0,0 +1,92 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file ocb3_done.c + OCB implementation, INTERNAL ONLY helper, by Tom St Denis +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Finish OCB processing and compute the tag + @param ocb The OCB state + @param tag [out] The destination for the authentication tag + @param taglen [in/out] The max size and resulting size of the authentication tag + @return CRYPT_OK if successful +*/ +int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen) +{ + unsigned char tmp[MAXBLOCKSIZE]; + int err, x; + + LTC_ARGCHK(ocb != NULL); + LTC_ARGCHK(tag != NULL); + LTC_ARGCHK(taglen != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* finalize AAD processing */ + + if (ocb->adata_buffer_bytes>0) { + /* Offset_* = Offset_m xor L_* */ + ocb3_int_xor_blocks(ocb->aOffset_current, ocb->aOffset_current, ocb->L_star, ocb->block_len); + + /* CipherInput = (A_* || 1 || zeros(127-bitlen(A_*))) xor Offset_* */ + ocb3_int_xor_blocks(tmp, ocb->adata_buffer, ocb->aOffset_current, ocb->adata_buffer_bytes); + for(x=ocb->adata_buffer_bytes; xblock_len; x++) { + if (x == ocb->adata_buffer_bytes) { + tmp[x] = 0x80 ^ ocb->aOffset_current[x]; + } + else { + tmp[x] = 0x00 ^ ocb->aOffset_current[x]; + } + } + + /* Sum = Sum_m xor ENCIPHER(K, CipherInput) */ + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); + } + + /* finalize TAG computing */ + + /* at this point ocb->aSum_current = HASH(K, A) */ + /* tag = tag ^ HASH(K, A) */ + ocb3_int_xor_blocks(tmp, ocb->tag_part, ocb->aSum_current, ocb->block_len); + + /* fix taglen if needed */ + if ((int)*taglen > ocb->block_len) { + *taglen = (unsigned long)ocb->block_len; + } + + /* copy tag bytes */ + for(x=0; x<(int)*taglen; x++) tag[x] = tmp[x]; + + err = CRYPT_OK; + +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(tmp, MAXBLOCKSIZE); + zeromem(ocb, sizeof(*ocb)); +#endif + + return err; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_encrypt.c b/src/encauth/ocb3/ocb3_encrypt.c new file mode 100644 index 000000000..145047824 --- /dev/null +++ b/src/encauth/ocb3/ocb3_encrypt.c @@ -0,0 +1,86 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file ocb3_encrypt.c + OCB implementation, encrypt data, by Tom St Denis +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Encrypt blocks of data with OCB + @param ocb The OCB state + @param pt The plaintext (length multiple of the block size of the block cipher) + @param ptlen The length of the input (octets) + @param ct [out] The ciphertext (same size as the pt) + @return CRYPT_OK if successful +*/ +int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct) +{ + unsigned char tmp[MAXBLOCKSIZE]; + int err, i, full_blocks; + unsigned char *pt_b, *ct_b; + + LTC_ARGCHK(ocb != NULL); + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { + return err; + } + if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) { + return CRYPT_INVALID_ARG; + } + + if (ptlen % ocb->block_len) { /* ptlen has to bu multiple of block_len */ + return CRYPT_INVALID_ARG; + } + + full_blocks = ptlen/ocb->block_len; + for(i=0; iblock_len; + ct_b = (unsigned char *)ct+i*ocb->block_len; + + /* ocb->Offset_current[] = ocb->Offset_current[] ^ Offset_{ntz(block_index)} */ + ocb3_int_xor_blocks(ocb->Offset_current, ocb->Offset_current, ocb->L_[ocb3_int_ntz(ocb->block_index)], ocb->block_len); + + /* tmp[] = pt[] XOR ocb->Offset_current[] */ + ocb3_int_xor_blocks(tmp, pt_b, ocb->Offset_current, ocb->block_len); + + /* encrypt */ + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* ct[] = tmp[] XOR ocb->Offset_current[] */ + ocb3_int_xor_blocks(ct_b, tmp, ocb->Offset_current, ocb->block_len); + + /* ocb->checksum[] = ocb->checksum[] XOR pt[] */ + ocb3_int_xor_blocks(ocb->checksum, ocb->checksum, pt_b, ocb->block_len); + + ocb->block_index++; + } + + err = CRYPT_OK; + +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(tmp, sizeof(tmp)); +#endif + return err; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c new file mode 100644 index 000000000..60264a2c8 --- /dev/null +++ b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c @@ -0,0 +1,87 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file ocb3_encrypt_authenticate_memory.c + OCB implementation, encrypt block of memory, by Tom St Denis +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Encrypt and generate an authentication code for a buffer of memory + @param cipher The index of the cipher desired + @param key The secret key + @param keylen The length of the secret key (octets) + @param nonce The session nonce (length of the block ciphers block size) + @param noncelen The length of the nonce (octets) + @param adata The AAD - additional associated data + @param adatalen The length of AAD (octets) + @param pt The plaintext + @param ptlen The length of the plaintext (octets) + @param ct [out] The ciphertext + @param tag [out] The authentication tag + @param taglen [in/out] The max size and resulting size of the authentication tag + @return CRYPT_OK if successful +*/ +int ocb3_encrypt_authenticate_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *adata, unsigned long adatalen, + const unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen) +{ + int err; + ocb3_state *ocb; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(nonce != NULL); + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(tag != NULL); + LTC_ARGCHK(taglen != NULL); + + /* allocate memory */ + ocb = XMALLOC(sizeof(ocb3_state)); + if (ocb == NULL) { + return CRYPT_MEM; + } + + if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen)) != CRYPT_OK) { + goto LBL_ERR; + } + + if ((err = ocb3_add_aad(ocb, adata, adatalen)) != CRYPT_OK) { + goto LBL_ERR; + } + + if ((err = ocb3_encrypt_last(ocb, pt, ptlen, ct)) != CRYPT_OK) { + goto LBL_ERR; + } + + err = ocb3_done(ocb, tag, taglen); + +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(ocb, sizeof(ocb3_state)); +#endif + + XFREE(ocb); + return err; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_encrypt_last.c b/src/encauth/ocb3/ocb3_encrypt_last.c new file mode 100644 index 000000000..788a25756 --- /dev/null +++ b/src/encauth/ocb3/ocb3_encrypt_last.c @@ -0,0 +1,108 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/** + @file ocb3_encrypt_last.c + OCB implementation, internal helper, by Karel Miko +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Finish an OCB (encryption) stream + @param ocb The OCB state + @param pt The remaining plaintext + @param ptlen The length of the plaintext (octets) + @param ct [out] The output buffer + @return CRYPT_OK if successful +*/ +int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct) +{ + unsigned char iOffset_star[MAXBLOCKSIZE]; + unsigned char iPad[MAXBLOCKSIZE]; + int err, x, full_blocks, full_blocks_len, last_block_len; + + LTC_ARGCHK(ocb != NULL); + LTC_ARGCHK(pt != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { + goto LBL_ERR; + } + + full_blocks = ptlen/ocb->block_len; + full_blocks_len = full_blocks * ocb->block_len; + last_block_len = ptlen - full_blocks_len; + + /* process full blocks first */ + if (full_blocks>0) { + if ((err = ocb3_encrypt(ocb, pt, full_blocks_len, ct)) != CRYPT_OK) { + goto LBL_ERR; + } + } + + /* at this point: m = ocb->block_index (last block index), Offset_m = ocb->Offset_current */ + + if (last_block_len>0) { + /* Offset_* = Offset_m xor L_* */ + ocb3_int_xor_blocks(iOffset_star, ocb->Offset_current, ocb->L_star, ocb->block_len); + + /* Pad = ENCIPHER(K, Offset_*) */ + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(iOffset_star, iPad, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* C_* = P_* xor Pad[1..bitlen(P_*)] */ + ocb3_int_xor_blocks(ct+full_blocks_len, pt+full_blocks_len, iPad, last_block_len); + + /* Checksum_* = Checksum_m xor (P_* || 1 || zeros(127-bitlen(P_*))) */ + ocb3_int_xor_blocks(ocb->checksum, ocb->checksum, pt+full_blocks_len, last_block_len); + for(x=last_block_len; xblock_len; x++) { + if (x == last_block_len) + ocb->checksum[x] ^= 0x80; + else + ocb->checksum[x] ^= 0x00; + } + + /* Tag = ENCIPHER(K, Checksum_* xor Offset_* xor L_$) xor HASH(K,A) */ + /* at this point we calculate only: Tag_part = ENCIPHER(K, Checksum_* xor Offset_* xor L_$) */ + for(x=0; xblock_len; x++) { + ocb->tag_part[x] = (ocb->checksum[x] ^ iOffset_star[x]) ^ ocb->L_dollar[x]; + } + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(ocb->tag_part, ocb->tag_part, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + } + else { + /* Tag = ENCIPHER(K, Checksum_m xor Offset_m xor L_$) xor HASH(K,A) */ + /* at this point we calculate only: Tag_part = ENCIPHER(K, Checksum_m xor Offset_m xor L_$) */ + for(x=0; xblock_len; x++) { + ocb->tag_part[x] = (ocb->checksum[x] ^ ocb->Offset_current[x]) ^ ocb->L_dollar[x]; + } + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(ocb->tag_part, ocb->tag_part, &ocb->key)) != CRYPT_OK) { + goto LBL_ERR; + } + } + + err = CRYPT_OK; + +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(iOffset_star, MAXBLOCKSIZE); + zeromem(iPad, MAXBLOCKSIZE); + zeromem(ocb, sizeof(*ocb)); +#endif + + return err; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c new file mode 100644 index 000000000..3817c320d --- /dev/null +++ b/src/encauth/ocb3/ocb3_init.c @@ -0,0 +1,134 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file ocb3_init.c + OCB implementation, initialize state, by Tom St Denis +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +static const struct { + int len; + unsigned char poly_div[MAXBLOCKSIZE], + poly_mul[MAXBLOCKSIZE]; +} polys[] = { +{ + 8, + { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B } +}, { + 16, + { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87 } +} +}; + +/** + Initialize an OCB context + @param ocb [out] The destination of the OCB state + @param cipher The index of the desired cipher + @param key The secret key + @param keylen The length of the secret key (octets) + @param nonce The session nonce + @param noncelen The length of the session nonce (octets) + @return CRYPT_OK if successful +*/ +int ocb3_init(ocb3_state *ocb, int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen) +{ + int poly, x, y, m, err; + unsigned char *previous, *current; + + LTC_ARGCHK(ocb != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(nonce != NULL); + + /* valid cipher? */ + if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { + return err; + } + ocb->cipher = cipher; + + /* determine which polys to use */ + ocb->block_len = cipher_descriptor[cipher].block_length; + for (poly = 0; poly < (int)(sizeof(polys)/sizeof(polys[0])); poly++) { + if (polys[poly].len == ocb->block_len) { + break; + } + } + if (polys[poly].len != ocb->block_len) { + return CRYPT_INVALID_ARG; + } + + /* schedule the key */ + if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &ocb->key)) != CRYPT_OK) { + return err; + } + + /* L_* = ENCIPHER(K, zeros(128)) */ + zeromem(ocb->L_star, ocb->block_len); + if ((err = cipher_descriptor[cipher].ecb_encrypt(ocb->L_star, ocb->L_star, &ocb->key)) != CRYPT_OK) { + return err; + } + + /* compute L_$, L_0, L_1, ... */ + for (x = -1; x < 32; x++) { + if (x == -1) { /* gonna compute: L_$ = double(L_*) */ + current = ocb->L_dollar; + previous = ocb->L_star; + } + else if (x == 0) { /* gonna compute: L_0 = double(L_$) */ + current = ocb->L_[0]; + previous = ocb->L_dollar; + } + else { /* gonna compute: L_i = double(L_{i-1}) for every integer i > 0 */ + current = ocb->L_[x]; + previous = ocb->L_[x-1]; + } + m = previous[0] >> 7; + for (y = 0; y < ocb->block_len-1; y++) { + current[y] = ((previous[y] << 1) | (previous[y+1] >> 7)) & 255; + } + current[ocb->block_len-1] = (previous[ocb->block_len-1] << 1) & 255; + if (m == 1) { + /* current[] = current[] XOR polys[poly].poly_mul[]*/ + ocb3_int_xor_blocks(current, current, polys[poly].poly_mul, ocb->block_len); + } + } + + /* initialize ocb->Offset_current = Offset_0 */ + ocb3_int_calc_offset_zero(ocb, nonce, noncelen); + + /* initialize checksum to all zeros */ + zeromem(ocb->checksum, ocb->block_len); + + /* set block index */ + ocb->block_index = 1; + + /* initialize AAD related stuff */ + ocb->ablock_index = 1; + ocb->adata_buffer_bytes = 0; + zeromem(ocb->aOffset_current, ocb->block_len); + zeromem(ocb->aSum_current, ocb->block_len); + + return CRYPT_OK; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_int_aad_add_block.c b/src/encauth/ocb3/ocb3_int_aad_add_block.c new file mode 100644 index 000000000..0b7d8f7a6 --- /dev/null +++ b/src/encauth/ocb3/ocb3_int_aad_add_block.c @@ -0,0 +1,49 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/** + @file ocb3_int_aad_add_block.c + OCB implementation, INTERNALL ONLY helper, by Karel Miko +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Add one block of AAD data (internal function) + @param ocb The OCB state + @param aad_block [in] AAD data (block_len size) + @return CRYPT_OK if successful +*/ +int ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block) +{ + unsigned char tmp[MAXBLOCKSIZE]; + int err; + + /* Offset_i = Offset_{i-1} xor L_{ntz(i)} */ + ocb3_int_xor_blocks(ocb->aOffset_current, ocb->aOffset_current, ocb->L_[ocb3_int_ntz(ocb->ablock_index)], ocb->block_len); + + /* Sum_i = Sum_{i-1} xor ENCIPHER(K, A_i xor Offset_i) */ + ocb3_int_xor_blocks(tmp, aad_block, ocb->aOffset_current, ocb->block_len); + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { + return err; + } + ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); + + ocb->ablock_index++; + + return CRYPT_OK; +} + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_int_calc_offset_zero.c b/src/encauth/ocb3/ocb3_int_calc_offset_zero.c new file mode 100644 index 000000000..93b171f45 --- /dev/null +++ b/src/encauth/ocb3/ocb3_int_calc_offset_zero.c @@ -0,0 +1,72 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/** + @file ocb3_int_calc_offset_zero.c + OCB implementation, INTERNAL ONLY helper, by Karel Miko +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Sets 'ocb->Offset_current' to 'Offset_0' value (internal function) + @param ocb The OCB state + @param nonce The session nonce + @param noncelen The length of the session nonce (octets) +*/ +void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen) +{ + int x, y, bottom; + int idx, shift; + unsigned char iNonce[MAXBLOCKSIZE]; + unsigned char iKtop[MAXBLOCKSIZE]; + unsigned char iStretch[MAXBLOCKSIZE+8]; + + /* Nonce = zeros(127-bitlen(N)) || 1 || N */ + zeromem(iNonce, sizeof(iNonce)); + for (x = ocb->block_len-1, y=0; y<(int)noncelen; x--, y++) { + iNonce[x] = nonce[noncelen-y-1]; + } + iNonce[x] = 0x01; + + /* bottom = str2num(Nonce[123..128]) */ + bottom = iNonce[ocb->block_len-1] & 0x3F; + + /* Ktop = ENCIPHER(K, Nonce[1..122] || zeros(6)) */ + iNonce[ocb->block_len-1] = iNonce[ocb->block_len-1] & 0xC0; + if ((cipher_descriptor[ocb->cipher].ecb_encrypt(iNonce, iKtop, &ocb->key)) != CRYPT_OK) { + zeromem(ocb->Offset_current, ocb->block_len); + return; + } + + /* Stretch = Ktop || (Ktop[1..64] xor Ktop[9..72]) */ + for (x = 0; x < ocb->block_len; x++) { + iStretch[x] = iKtop[x]; + } + for (y = 0; y < 8; y++) { + iStretch[x+y] = iKtop[y] ^ iKtop[y+1]; + } + + /* Offset_0 = Stretch[1+bottom..128+bottom] */ + idx = bottom / 8; + shift = (bottom % 8); + for (x = 0; x < ocb->block_len; x++) { + ocb->Offset_current[x] = iStretch[idx+x] << shift; + if (shift > 0) { + ocb->Offset_current[x] |= iStretch[idx+x+1] >> (8-shift); + } + } +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_int_ntz.c b/src/encauth/ocb3/ocb3_int_ntz.c new file mode 100644 index 000000000..48239fe76 --- /dev/null +++ b/src/encauth/ocb3/ocb3_int_ntz.c @@ -0,0 +1,41 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file ocb3_int_ntz.c + OCB implementation, INTERNAL ONLY helper, by Tom St Denis +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Returns the number of leading zero bits [from lsb up] (internal function) + @param x The 32-bit value to observe + @return The number of bits [from the lsb up] that are zero +*/ +int ocb3_int_ntz(unsigned long x) +{ + int c; + x &= 0xFFFFFFFFUL; + c = 0; + while ((x & 1) == 0) { + ++c; + x >>= 1; + } + return c; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_int_xor_blocks.c b/src/encauth/ocb3/ocb3_int_xor_blocks.c new file mode 100644 index 000000000..92eb293f2 --- /dev/null +++ b/src/encauth/ocb3/ocb3_int_xor_blocks.c @@ -0,0 +1,40 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/** + @file ocb3_int_xor_blocks.c + OCB implementation, INTERNAL ONLY helper, by Karel Miko +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Compute xor for two blocks of bytes 'out = block_a XOR block_b' (internal function) + @param out The block of bytes (output) + @param block_a The block of bytes (input) + @param block_b The block of bytes (input) + @param block_len The size of block_a, block_b, out +*/ +void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len) +{ + int x; + if (out == block_a) { + for (x = 0; x < (int)block_len; x++) out[x] ^= block_b[x]; + } + else { + for (x = 0; x < (int)block_len; x++) out[x] = block_a[x] ^ block_b[x]; + } +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c new file mode 100644 index 000000000..ae0069c33 --- /dev/null +++ b/src/encauth/ocb3/ocb3_test.c @@ -0,0 +1,246 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/** + @file ocb3_test.c + OCB implementation, self-test by Tom St Denis +*/ +#include "tomcrypt.h" + +#ifdef LTC_OCB3_MODE + +/** + Test the OCB protocol + @return CRYPT_OK if successful +*/ +int ocb3_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + /* test vectors from: http://tools.ietf.org/html/draft-krovetz-ocb-03 */ + unsigned char key[16] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F }; + unsigned char nonce[12] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B }; + static const struct { + int ptlen; + int aadlen; + unsigned char pt[64], aad[64], ct[64], tag[16]; + } tests[] = { + + { /* index:0 */ + 0, /* PLAINTEXT length */ + 0, /* AAD length */ + { }, /* PLAINTEXT */ + { }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x19,0x7b,0x9c,0x3c,0x44,0x1d,0x3c,0x83,0xea,0xfb,0x2b,0xef,0x63,0x3b,0x91,0x82 }, /* TAG */ + }, + { /* index:1 */ + 8, /* PLAINTEXT length */ + 8, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* AAD */ + { 0x92,0xb6,0x57,0x13,0x0a,0x74,0xb8,0x5a }, /* CIPHERTEXT */ + { 0x16,0xdc,0x76,0xa4,0x6d,0x47,0xe1,0xea,0xd5,0x37,0x20,0x9e,0x8a,0x96,0xd1,0x4e }, /* TAG */ + }, + { /* index:2 */ + 0, /* PLAINTEXT length */ + 8, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x98,0xb9,0x15,0x52,0xc8,0xc0,0x09,0x18,0x50,0x44,0xe3,0x0a,0x6e,0xb2,0xfe,0x21 }, /* TAG */ + }, + { /* index:3 */ + 8, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* PLAINTEXT */ + { }, /* AAD */ + { 0x92,0xb6,0x57,0x13,0x0a,0x74,0xb8,0x5a }, /* CIPHERTEXT */ + { 0x97,0x1e,0xff,0xca,0xe1,0x9a,0xd4,0x71,0x6f,0x88,0xe8,0x7b,0x87,0x1f,0xbe,0xed }, /* TAG */ + }, + { /* index:4 */ + 16, /* PLAINTEXT length */ + 16, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22 }, /* CIPHERTEXT */ + { 0x77,0x6c,0x99,0x24,0xd6,0x72,0x3a,0x1f,0xc4,0x52,0x45,0x32,0xac,0x3e,0x5b,0xeb }, /* TAG */ + }, + { /* index:5 */ + 0, /* PLAINTEXT length */ + 16, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x7d,0xdb,0x8e,0x6c,0xea,0x68,0x14,0x86,0x62,0x12,0x50,0x96,0x19,0xb1,0x9c,0xc6 }, /* TAG */ + }, + { /* index:6 */ + 16, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* PLAINTEXT */ + { }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22 }, /* CIPHERTEXT */ + { 0x13,0xcc,0x8b,0x74,0x78,0x07,0x12,0x1a,0x4c,0xbb,0x3e,0x4b,0xd6,0xb4,0x56,0xaf }, /* TAG */ + }, + { /* index:7 */ + 24, /* PLAINTEXT length */ + 24, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xfc,0xfc,0xee,0x7a,0x2a,0x8d,0x4d,0x48 }, /* CIPHERTEXT */ + { 0x5f,0xa9,0x4f,0xc3,0xf3,0x88,0x20,0xf1,0xdc,0x3f,0x3d,0x1f,0xd4,0xe5,0x5e,0x1c }, /* TAG */ + }, + { /* index:8 */ + 0, /* PLAINTEXT length */ + 24, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x28,0x20,0x26,0xda,0x30,0x68,0xbc,0x9f,0xa1,0x18,0x68,0x1d,0x55,0x9f,0x10,0xf6 }, /* TAG */ + }, + { /* index:9 */ + 24, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* PLAINTEXT */ + { }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xfc,0xfc,0xee,0x7a,0x2a,0x8d,0x4d,0x48 }, /* CIPHERTEXT */ + { 0x6e,0xf2,0xf5,0x25,0x87,0xfd,0xa0,0xed,0x97,0xdc,0x7e,0xed,0xe2,0x41,0xdf,0x68 }, /* TAG */ + }, + { /* index:10 */ + 32, /* PLAINTEXT length */ + 32, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb }, /* CIPHERTEXT */ + { 0xb2,0xa0,0x40,0xdd,0x3b,0xd5,0x16,0x43,0x72,0xd7,0x6d,0x7b,0xb6,0x82,0x42,0x40 }, /* TAG */ + }, + { /* index:11 */ + 0, /* PLAINTEXT length */ + 32, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0xe1,0xe0,0x72,0x63,0x3b,0xad,0xe5,0x1a,0x60,0xe8,0x59,0x51,0xd9,0xc4,0x2a,0x1b }, /* TAG */ + }, + { /* index:12 */ + 32, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* PLAINTEXT */ + { }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb }, /* CIPHERTEXT */ + { 0x4a,0x3b,0xae,0x82,0x44,0x65,0xcf,0xda,0xf8,0xc4,0x1f,0xc5,0x0c,0x7d,0xf9,0xd9 }, /* TAG */ + }, + { /* index:13 */ + 40, /* PLAINTEXT length */ + 40, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb,0x68,0xc6,0x57,0x78,0xb0,0x58,0xa6,0x35 }, /* CIPHERTEXT */ + { 0x65,0x9c,0x62,0x32,0x11,0xde,0xea,0x0d,0xe3,0x0d,0x2c,0x38,0x18,0x79,0xf4,0xc8 }, /* TAG */ + }, + { /* index:14 */ + 0, /* PLAINTEXT length */ + 40, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x7a,0xeb,0x7a,0x69,0xa1,0x68,0x7d,0xd0,0x82,0xca,0x27,0xb0,0xd9,0xa3,0x70,0x96 }, /* TAG */ + }, + { /* index:15 */ + 40, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* PLAINTEXT */ + { }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb,0x68,0xc6,0x57,0x78,0xb0,0x58,0xa6,0x35 }, /* CIPHERTEXT */ + { 0x06,0x0c,0x84,0x67,0xf4,0xab,0xab,0x5e,0x8b,0x3c,0x20,0x67,0xa2,0xe1,0x15,0xdc }, /* TAG */ + }, + +}; + + int err, x, idx, res; + unsigned long len; + unsigned char outct[MAXBLOCKSIZE], outtag[MAXBLOCKSIZE]; + + /* AES can be under rijndael or aes... try to find it */ + if ((idx = find_cipher("aes")) == -1) { + if ((idx = find_cipher("rijndael")) == -1) { + return CRYPT_NOP; + } + } + + for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { + len = sizeof(outtag); + if ((err = ocb3_encrypt_authenticate_memory(idx, + key, sizeof(key), + nonce, sizeof(nonce), + tests[x].aad, tests[x].aadlen, + tests[x].pt, tests[x].ptlen, + outct, outtag, &len)) != CRYPT_OK) { + return err; + } + + if (XMEMCMP(outtag, tests[x].tag, len) || XMEMCMP(outct, tests[x].ct, tests[x].ptlen)) { +#if 0 + unsigned long y; + printf("\n\nFailure: \nCT:\n"); + for (y = 0; y < (unsigned long)tests[x].ptlen; ) { + printf("0x%02x", outct[y]); + if (y < (unsigned long)(tests[x].ptlen-1)) printf(", "); + if (!(++y % 8)) printf("\n"); + } + printf("\nTAG:\n"); + for (y = 0; y < len; ) { + printf("0x%02x", outtag[y]); + if (y < len-1) printf(", "); + if (!(++y % 8)) printf("\n"); + } +#endif + return CRYPT_FAIL_TESTVECTOR; + } + + if ((err = ocb3_decrypt_verify_memory(idx, + key, sizeof(key), + nonce, sizeof(nonce), + tests[x].aad, tests[x].aadlen, + outct, tests[x].ptlen, + outct, tests[x].tag, len, &res)) != CRYPT_OK) { + return err; + } + if ((res != 1) || XMEMCMP(tests[x].pt, outct, tests[x].ptlen)) { +#if 0 + unsigned long y; + printf("\n\nFailure-decrypt: \nPT:\n"); + for (y = 0; y < (unsigned long)tests[x].ptlen; ) { + printf("0x%02x", outct[y]); + if (y < (unsigned long)(tests[x].ptlen-1)) printf(", "); + if (!(++y % 8)) printf("\n"); + } + printf("\nres = %d\n\n", res); +#endif + } + } + return CRYPT_OK; +#endif /* LTC_TEST */ +} + +#endif /* LTC_OCB3_MODE */ + +/* some comments + + -- it's hard to seek + -- hard to stream [you can't emit ciphertext until full block] + -- The setup is somewhat complicated... +*/ + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index e34adfb52..2e4774497 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -231,6 +231,7 @@ #endif #define LTC_OCB_MODE +#define LTC_OCB3_MODE #define LTC_CCM_MODE #define LTC_GCM_MODE diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 97686cebb..2cd3ef05e 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -193,6 +193,67 @@ int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, #endif /* LTC_OCB_MODE */ +#ifdef LTC_OCB3_MODE +typedef struct { + unsigned char Offset_0[MAXBLOCKSIZE], /* Offset_0 value */ + Offset_current[MAXBLOCKSIZE], /* Offset_{current_block_index} value */ + L_dollar[MAXBLOCKSIZE], /* L_$ value */ + L_star[MAXBLOCKSIZE], /* L_* value */ + L_[32][MAXBLOCKSIZE], /* L_{i} values */ + tag_part[MAXBLOCKSIZE], /* intermediate result of tag calculation */ + checksum[MAXBLOCKSIZE]; /* current checksum */ + + /* AAD related members */ + unsigned char aSum_current[MAXBLOCKSIZE], /* AAD related helper variable */ + aOffset_current[MAXBLOCKSIZE], /* AAD related helper variable */ + adata_buffer[MAXBLOCKSIZE]; /* AAD buffer */ + int adata_buffer_bytes; /* bytes in AAD buffer */ + unsigned long ablock_index; /* index # for current adata (AAD) block */ + + symmetric_key key; /* scheduled key for cipher */ + unsigned long block_index; /* index # for current data block */ + int cipher, /* cipher idx */ + block_len; /* length of block */ +} ocb3_state; + +int ocb3_init(ocb3_state *ocb, int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen); + +int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct); +int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt); +int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct); +int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt); +int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen); +int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen); + +int ocb3_encrypt_authenticate_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *adata, unsigned long adatalen, + const unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen); + +int ocb3_decrypt_verify_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *adata, unsigned long adatalen, + const unsigned char *ct, unsigned long ctlen, + unsigned char *pt, + const unsigned char *tag, unsigned long taglen, + int *stat); + +int ocb3_test(void); + +/* internal helper functions */ +int ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block); +void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen); +int ocb3_int_ntz(unsigned long x); +void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len); + +#endif /* LTC_OCB3_MODE */ + #ifdef LTC_CCM_MODE #define CCM_ENCRYPT 0 diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index e1b1ce038..28d6c746a 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -231,6 +231,9 @@ const char *crypt_build_settings = #if defined(LTC_OCB_MODE) " LTC_OCB_MODE\n" #endif +#if defined(LTC_OCB3_MODE) + " LTC_OCB3_MODE\n" +#endif #if defined(LTC_CCM_MODE) " LTC_CCM_MODE\n" #endif diff --git a/testprof/mac_test.c b/testprof/mac_test.c index c09bb1d5e..f2fa9da36 100644 --- a/testprof/mac_test.c +++ b/testprof/mac_test.c @@ -24,6 +24,9 @@ int mac_test(void) #ifdef LTC_OCB_MODE DO(ocb_test()); #endif +#ifdef LTC_OCB3_MODE + DO(ocb3_test()); +#endif #ifdef LTC_CCM_MODE DO(ccm_test()); #endif diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index aa25d33e7..cf9f3567b 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -1339,6 +1339,22 @@ void time_encmacs_(unsigned long MAC_SIZE) fprintf(stderr, "OCB \t\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); #endif +#ifdef LTC_OCB3_MODE + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = ocb3_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 16, "", 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\nOCB3 error... %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "OCB3 \t\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); +#endif + #ifdef LTC_CCM_MODE t2 = -1; for (x = 0; x < 10000; x++) { From 9c2193b72288797a6ee8b223928e9749e3ccdf98 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 4 Sep 2012 15:43:55 +0200 Subject: [PATCH 0075/1192] ocb3_init fix (preventing index overflow) --- src/encauth/ocb3/ocb3_init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index 3817c320d..926288b76 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -64,11 +64,15 @@ int ocb3_init(ocb3_state *ocb, int cipher, /* determine which polys to use */ ocb->block_len = cipher_descriptor[cipher].block_length; - for (poly = 0; poly < (int)(sizeof(polys)/sizeof(polys[0])); poly++) { + x = (int)(sizeof(polys)/sizeof(polys[0])); + for (poly = 0; poly < x; poly++) { if (polys[poly].len == ocb->block_len) { break; } } + if (poly == x) { + return CRYPT_INVALID_ARG; /* block_len not found in polys */ + } if (polys[poly].len != ocb->block_len) { return CRYPT_INVALID_ARG; } From c5c067fd128c3a284c0ad6a3d39c7345a9a6bd0d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 4 Sep 2012 15:44:32 +0200 Subject: [PATCH 0076/1192] ocb_init fix (preventing index overflow) --- src/encauth/ocb/ocb_init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/encauth/ocb/ocb_init.c b/src/encauth/ocb/ocb_init.c index 604ae0e8c..22b2f4653 100644 --- a/src/encauth/ocb/ocb_init.c +++ b/src/encauth/ocb/ocb_init.c @@ -60,11 +60,15 @@ int ocb_init(ocb_state *ocb, int cipher, /* determine which polys to use */ ocb->block_len = cipher_descriptor[cipher].block_length; - for (poly = 0; poly < (int)(sizeof(polys)/sizeof(polys[0])); poly++) { + x = (int)(sizeof(polys)/sizeof(polys[0])); + for (poly = 0; poly < x; poly++) { if (polys[poly].len == ocb->block_len) { break; } } + if (poly == x) { + return CRYPT_INVALID_ARG; /* block_len not found in polys */ + } if (polys[poly].len != ocb->block_len) { return CRYPT_INVALID_ARG; } From faaa17aec2e59b6df713e85bc9b6ffd2fcfc8b7f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 15 Mar 2013 17:46:45 +0200 Subject: [PATCH 0077/1192] add OCBv3 testvectors --- notes/ocb3_tv.txt | 496 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 496 insertions(+) create mode 100644 notes/ocb3_tv.txt diff --git a/notes/ocb3_tv.txt b/notes/ocb3_tv.txt new file mode 100644 index 000000000..046f624c8 --- /dev/null +++ b/notes/ocb3_tv.txt @@ -0,0 +1,496 @@ +OCB3 Test Vectors. Uses the 00010203...NN-1 pattern for nonce/plaintext/key. The outputs +are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous +step repeated sufficiently. The nonce is fixed throughout. AAD is fixed to 3 bytes (ASCII) 'AAD'. + +OCB-aes (16 byte key) + 0: , CDE5AA0562BC4D474EFBB4120E4C5BFF + 1: 9E, B60840CA7005A169C1240E3BFB401AB8 + 2: 75DF, C606FAD65B2CD087774CD0EB341AD265 + 3: 78309B, 26179C93AB865167FC583166E6AFD275 + 4: 0DA474F6, A55358F6EBF78F63C45AEFA5C63FAF17 + 5: 2BE7DEDEA2, 95E6590B2A19D85F25E4A76861F7CDB3 + 6: BE808ABA55FC, 6C9E74B2BA0D628834A2C2FD8AF9CF39 + 7: 7B20C2D42F94E5, 5B293A423119EF044A5E5E5E70FC87DD + 8: B7CE5AFA00FC9843, D5AC1CF000137D8E0710DC63457E5F73 + 9: E8EF6A913D905BEAEC, A96A005A2A0F08BCEFA7169D69E347E2 + 10: A15B41ED2FE26F90C0B7, D8453A7F07D90AA3E48BBE792DEFBC84 + 11: 5CCED9699C5524623AEF4A, D7450C6465DF3AD2513B799521995821 + 12: AE70D6492673FC870675AAE2, 697EB5B96673EB7FE48A07A1F2C1E957 + 13: 23C3E43575A9D80938BE58D6F1, 2CAFDB3ADABFBE0EE48FB1DD31D67ABA + 14: 235E50ED798584EEB7CE7F31490F, C26DA5513F19D6C9345EEE2D9B24EE30 + 15: 99BECD55D0CA96718E5F9DDDD127BF, E1A4FAF9F68CD80C997EB59FA8B6A38A + 16: 8EDDAE4DE1D32CA64D741A8D0371745C, 603603E91FB7EBA3F9247420C3AB36FD + 17: 52F17D54375D514A518EFA8A1081990846, 7B5C4EBB3B1AA523288770151550B97D + 18: EFC039545414A9D26B58934BBAE30D587082, FA4CFB8B873933154A24C58A1F469146 + 19: E4756B6C55FE1973E4CD1ED5CD15AAC1FAEFD3, F32D28D2559EFF18B2F00F344DA975BA + 20: 8F47FC80A73ADDE004F69BCABFBAFAAC7EE38D50, D80913FBFAADF1C5C3FA8734C74DEBBD + 21: CBC47AE59B62F9A5AC8B1A0B27A54EA98DF1FEFE29, C34597A3E452216F9D8B53FB32E11B86 + 22: FFECFCE641E2F16F656A47157248D39C78A928378831, E8D7ED60F3BD44DCD676F06C43BF18CF + 23: 8B4C8A02A2D2CA06691A29AB7E856C058946A404DFB78E, A8F44E1BDF86BDC4CC80BE55B2A8906D + 24: 97D0A8D76D8CEA8E378B66E94B498127997C60A9EB0E1D03, AFB2B208164DBE1408694BFE8E87A5B9 + 25: 81BB7CC0A206760A631EF633BF5897B407BD27A20C28DE334A, ED82026689CD89BD4E777A74DAC791DB + 26: AB69BF543CB1E731CAEADA9C8F09AB81720D446BDA453AF87D1E, FC588E24304E8CB47ACDCF1AF111DA99 + 27: C5FC023E000F16C42CE63AB26C3FA4FFD8373E4EEC97AB8EC0A9CB, 99598DBDE114FCFED0B5EC710A61B99A + 28: AA200F54FDDFEEF3AFA3447149F5996643E4E63ADD57339129F83BCD, 1C6645CC83112B031F156E9D191BE806 + 29: 3E75A6B5DA18FE0F918094CDE11F0109BD206D68C570E4DCD7C0BA6E05, 669779DE7B8E1A657DE51C4FBD8FA8FA + 30: 79EA616591785C8EA654E90E819920E20A53CB420147527FA9D2F92B9835, CBC3557ECB9D850CA17ADB726EB020FF + 31: 35709AAA8B6C28254C1A75FE6CF13E7D90EDF1AEA677FB1057FB6C0ACCAB98, 491E0662C259D03C2E72A58736B6F709 + 32: 59459AD454CCECF40D4FF30E748CD1BA17314C9EF158D223AE2A736ADF7E2397, 2C3240DDD2FA281A567D38C4FA598ECE + +OCB-blowfish (8 byte key) + 0: , 33332FA5A79E3645 + 1: 38, 66779E3613C5540F + 2: 3443, 48D3E25F4007A1E3 + 3: D1ED65, 486767AAD7B4DCCF + 4: 6FC4D34A, 50706E35463CE200 + 5: 7F05718FCB, 4AFB55795A94172B + 6: 9AAA6E72BC1B, E060FA18168A31FC + 7: AE90EE07B41CBF, F47C611E9C02D095 + 8: D4D67E11C84600BF, 9DACA76000861745 + 9: C4DBBD53B65A321CC8, 9E5A12890282120C + 10: 74C14E2DE4BEC704CF1D, F1D432FBF8B17265 + 11: A57514B6A91B733A1467C2, 6E54A6A9F56D8459 + 12: 9CAB77627D8EFA9438451F3C, 4925FF74D2CDB33F + 13: 2E5BC3A020EC249DA94E8DB4E8, 30739AD56648C917 + 14: 807B29C5AF9AF93906CFE876B081, 97901FE44444A99F + 15: 6BD70492F763A704CD5351E691BF07, 2459A0B9332CF14A + 16: 1F4919EB6CAD8D19B755157FD1A2E89A, F7EAE8DB5F5FA9B1 + +OCB-xtea (16 byte key) + 0: , 311A7010FB045BEE + 1: F8, E65BD38F1C4E7BFF + 2: 7AE4, 5B78197CE29D8FD4 + 3: 36A39F, 98FEA390BC03F915 + 4: 9AE3921C, 76F6EEBC194DEFE4 + 5: E925968C09, 105E0FBF3B664875 + 6: 537DE3B6AADF, B2C57709CEDBBA10 + 7: 4525D6927B4343, D83CB96C7ADA6241 + 8: 807A0E8382A91CE9, F6DF1EAA4929EEEE + 9: 59C09E427C56CDF015, 885813D7F4D4CB40 + 10: F785DAB910D186761A82, 46346AB52983186D + 11: F11CE4DAAEBCC204B318F2, 67E95CA14FB4FD3D + 12: 4A7FD586015561801115981F, 70DAC17D50DB4E5C + 13: CF03722B78DE7AE951B5E6442A, F40D80E40690378E + 14: B17224FE335A8CC17425D0AA3382, 2BEEC3D3828EA9E8 + 15: 5B333EE0CC163F8C22E5E0747AE7F6, 29BCD90905505D05 + 16: 7FC2C0D4E865D082174AE033E71DD3A9, E34E60A7D43F8EDB + +OCB-rc5 (8 byte key) + 0: , 4287F61BB46382B2 + 1: B9, 753F79A4BB0CC986 + 2: 4FC1, 77132F07D73B20C4 + 3: F1009F, D0113ABB5CD465FB + 4: D68B146D, 5CFA18D483741043 + 5: 3EE7237B8F, 0AAF3E6746AC93E4 + 6: D6C5D714B773, E1C3A97890A4B86B + 7: CF1ABC07E56F1A, 96215C8CC5471BBF + 8: 9783988AE164F9E1, 0680B375E3A0D562 + 9: 9ACCEC35CF126304F6, F74653152A177CE9 + 10: D94C215F59ED195DDB5D, A5AD88DFFAA297F7 + 11: 911BCE3E464282F3F67A3C, 561F90837B05F0EE + 12: 48F8A06D30CA2C53D2B7176C, 5BA9AEA8003B2DD7 + 13: B66F45A34FFA2CE7086D63E1EB, 0C8D09F2F4C46C79 + 14: 15EFFA2ED88EDBE91FBBAED12128, AFCD680C7DCDBE27 + 15: 5B54DEDCB7D14FD48373C1B93CF084, 226A5920A2E712D9 + 16: DDDACAEAE7BAB3029B1D841502F3F8F1, 98527F33CD759F1E + +OCB-rc6 (16 byte key) + 0: , 3BB834902D39E5E91D89B0DC0DDF65EF + 1: 2E, 9B9135C04DA988AD3D2A71B8330EA0C7 + 2: D7CC, A4D984EC457906AC76D633086DDA5FBB + 3: 394491, 35413A2E1936F2C5347BC3F11DE5C5E6 + 4: CDB4E8BC, C92E3FB50FDA7292D8889CAF1239C669 + 5: E073807488, 293B4362693F5CB7F87B499B5DE802FB + 6: C423B1D2250B, 4C1C672BF015B68FFC5496C1E4845038 + 7: 0A9221803183AC, CB7E94F239CDAFAA2E85C8F6F84D291C + 8: B11DF4E8DFE0DDF5, 388330327A540AA342FCCE9DA8722974 + 9: 4F22BE632E97EAC40A, 52A80B5BABAD91063F005A90366F5D03 + 10: C078544308477C436C1A, B71ECF0393B5EDAC6A6885E589B8495F + 11: 70D055E1DD32D2968F27E9, CC203EB94EA969ADA6AC66E38114AC15 + 12: 444A3B67B3DFBEBF25CF1EB8, 0D46A4E88E25DE2B876B53D6221BC155 + 13: 82DFFC0FF3AA208EAEC9AFFC95, 90EB11D825B92AF732659F5E3A57AB3F + 14: AED1A39332ECFF633DB4DD4F53D4, BB14AB91B3CCE190F780BA05D94B4FF1 + 15: E98CDF3BAA07AF91F30D984D1B31D0, B74AA68488959CEB0434D0DF258E6206 + 16: C6EA56068EC393603313926A54E79808, 8D7EC011133F2E419AE27DB99265BB51 + 17: F28D6DC79AC812B4E14925AABC7A18800B, F125CFFDA992F6336D88E3D6CD5DC739 + 18: 419AB005309458BF84572AF5EED46DC0D90F, B0A5A2D13EC928BF3DD2434079A20528 + 19: 64D64C8F3ECDF0DD43B6BEFA045FAE72D79D0D, 9FB86FB186B57602E609F08E76FDD8D0 + 20: A8EFCDA63D38273404E91241C40992A82DB63F23, AF116B5369C3B6C5A8709252537DDDDA + 21: 39A5A5EF3CD91B27138BBB784CBE027B57A81603DE, ECDF09F22FB185D110F6997C891F8569 + 22: 464381184976612C15D1589DC1AAC2C922D69F3FFD31, C18416F51FA8502C06AAEABDBE5AB22E + 23: 21F0118E17188E09D5E5C6E53DB97BA2585A122FECD6E9, DD7B583A17B07967917D7603D453301C + 24: 109AE231C1810250AB181BB094099D4B21B08B948A9F7934, BA3BD871DCEC2A0D75C1B54F3C5AE870 + 25: 080BA8AAFB8056A102BFB37864FF0533278F2AB3A23D42F719, 4566DED8A3B4E9CA441B87EC18BD5E4A + 26: B7531B5B0E7401491248451B6833F738F4700B9F7FA13C262125, 9F6B4E956A338907E34BB91EFA5D2A26 + 27: 7473E5550DB57A75C1E63859580DBB7E0E4704E4360EF4AA0FB3DF, 0E1C543C18F93E853143C8B21CDF6327 + 28: 8D8CB57288A98D1A3CC315045DDAE1388C90F6C6EBD9704E91F9657A, 9FF33BCB85A5AE936244B7C24C2F7909 + 29: D4951C16BE95E67C9FA9579465AB44187C1777B0C4050D3878FA82B7A9, C9F3EF7588B041DF17E5333EB397D015 + 30: E28CAEB88F590D3D7D0FB6F7DD7EAA88C091D67B72E67B297E280F048C68, CB855FF11691C31A423A88525F7941EC + 31: A043763CAB64783E8637382E5DCA023356DC8FC02F7A9F314B448DC7C2A4AA, D35E089232C405B0928A99149555C406 + 32: DB2F18A11D7726DC6EFAFFDB160846968EDE06A251E03CB92ACE0F435E6DD698, 7FBF8E2F2047216C0062B6B070FC39C5 + +OCB-safer+ (16 byte key) + 0: , 818F824701DF2D6F384E39A6B33C8C7B + 1: BD, D1BA735E4601B977CEE4C846DF801030 + 2: 97E3, 4ACAA433A1F4BE2459D8FB5A46C83D97 + 3: 54A32B, 837526FBF9334EEE32444898D72A6FAF + 4: 550BF0B6, 66993BCE9CEEBB0E42E734EE72F71F6A + 5: B9DBB41DDA, 5BF83E90030911DEC1F706A0CA3EAEF8 + 6: CFFF407F7559, C3F9471E5B38384FB1882D4B0FCD4164 + 7: 27AACCF405075B, 16E59258A2639EBB74A622FE58B10D50 + 8: 6E0E5FCE730A1E0F, 74F51050BAC882A782DD1D66A83367AA + 9: F4A70127DDD496C035, BD93EAFFD5A2C36A354950DC3548925F + 10: D6C82811BF1493C3065E, 9252733A1C829D9328E810D8E1A68AC2 + 11: 6AC43EB973A878E80ADF13, 9EE33A4F9F9FE039A7BC0B3395AABC24 + 12: E54F88B6A05961399FD4A842, 11354D65DB61A2F42683E3ABE65C1518 + 13: 2771576E1EC6533061395C206C, 1BC2281E33BB360A7EB488A87FD3422A + 14: 59FACB5C29A24EA7B2ACFF73C3D5, 1D1E65A92DCE815BFC61C067F919C9D5 + 15: CEB8B9CD33CBB8638BB3AA463DCAFC, 4B6307B67D62F0C9C2A17407E6A6D37C + 16: 1E9BF87DB8A50018945D20F1711939E8, D21689B5C7AA20421E1B0543C44CDBF8 + 17: CF466CFF02460FDFEDDD55D32E7B81F7DE, 34853E04F800B867FD81101337396B5C + 18: 7825EC997E35D69B7807EF09520FE262D9ED, 0C56E50B01DDB6F79C0796F644566365 + 19: 0DE8DC870E440E81E884FBD240F135C0C51904, BFA98A06FC10F61ACA04A3EB83F4E4C9 + 20: D7B6238F58DFA34AFB01F7E863A6239A643EF85D, 72D58FFFCB8EDD2B212E384499556655 + 21: 0C39A6472C20069C81B86D017C29996D332A7934B6, 00200B481BD27D3E7F3B5A93B01E8CD8 + 22: AFD445996544CADF9DB1095A8ABD1B85139C49ECE807, AFA537A91C7B5B461285C1916587C5BC + 23: F5971CA871AC2AD43E5FD3B7F135F8F114E1CB8475CE3F, D2AEEFCC904BCC19BF1746D4F4C12B2F + 24: 0E501E14E1D90A21882A39AD8BF30415A5A19F45F930C9B4, 994BEFD4A19281466D6DA15A136AE7B3 + 25: 91DE86170B63B8A3429DE5A9686CC7033A76ABAACD196E1AC6, 1D19585EB7F4215499C3E5E95E6D9B3B + 26: C32E3723685B361A29A931AEA09029A3ADF4DB5E6FE03ABA1374, B7E237316BE981CF1BB7EA2C0AAB4FE2 + 27: A7C3BEA3BB8590EA4533EE86CF6A98F555E4C75C31648F7539FBA2, 4FED5804515A9C83A1CD7E0FF18EA714 + 28: 4B801BE2237D8E46B2989A4CB914929B9DED959F14DB78006ED1BEC5, 6A8315F87E69535EA157E1F7C46772F6 + 29: 868A2EB898BD7AF43846C7792BD0C30BAF0B278796BD8CF74BC5BF0BC2, 600A8C9D4DAA2907DA94F0F6C5ECE1F2 + 30: 8F9C5C2BF2C5BFB33535E5A7793D18341B9B6D5A788765196068843B0E49, 6EDC9F4E8BD16E030E6F63ECBAC407B6 + 31: 626D32D56088410B8B0E106ABCFB6B80A3F51C68A6FA648C45B93B5FA79A1B, A1C9660396698CDE92C48E5C79C95FB4 + 32: 23735C7C0AE0FF5FCAC7D16377090DCA9FD0E679248E04EAC56752BD0AA790F3, 7C8EE978EEF3E9BC9F5E18902CADFA94 + +OCB-twofish (16 byte key) + 0: , 594164A8DAEA1C847BCD04E06EB69AA1 + 1: 82, D86AD044B55DC09DC6302700B728C9F2 + 2: CAC8, 910C748DABA8A3CEE24C888295E15BF7 + 3: AA0A64, CDF692384CB4A1F2B9355F7DA2CF6D82 + 4: 8558D35A, 4F542602753901709C33D1B3FDFBDBFD + 5: E3AE8A5EDE, 8196572296F1D18D5AAAE6EB7B3DE383 + 6: E602A86B84F4, 2F6FE22A3A5506BA8FABA92CF153B53D + 7: D9FDAC7CFC1C7F, 735A47BA7F9F8242AF59B65555A89D8E + 8: D1ECDD40593FC01A, E98A3D894F217A645C5576EABBD0DEAE + 9: 0A085D49B094924621, B50611A43EEBA79B129A4A7CDE1D6933 + 10: D28C9B15530A73167396, AE4BDA212228FF92044359A8BD49FDCF + 11: 4ACC04003B2DB52BF6AC9E, 14436E44AEAD95DB04151409AE0554E9 + 12: DF4A0500653E45E0C9B0955B, 5D1F14392C117752D25C608B88D27FE4 + 13: 779E1F3875A3DD5957585119CE, 09CA0CE358A026F4A0587AACA17D6483 + 14: CFFC6F342044C9FE27A77DE2F08C, 86E1A306D08BF4DBF1E9C0B8109F542F + 15: F512032FCE7598AF164F8BDC979F4C, D9923D9B1434A1C7E8A705B28EFFFF44 + 16: 8F81FCF56B506E0848C49D252053F86B, 1DF7C9EE369191347758689A06E725F7 + 17: BFF875AE91FD5334B7BF7C0A589F86A27C, DF7FE649DFE3101D3EF0FA54D89D33FE + 18: 4659BEA017C75E61588021CF8937D7C2C6A5, CFCD5D0F8122361909138E92B6C03134 + 19: 9484B68F9F02BEF42A8E861435026112C5CFF0, 3FC907A83E8DA1AF5FFCB2691FADAEB1 + 20: E13ABD911540BABA4F7F86A40DACD095C0DA2A3B, 2553A726A8E320D4A42B670933304075 + 21: 2F412FC9B166B8F4069245324946E9D2C70BC893DD, 2E434FE6C1C71F390BA463263EB49EB3 + 22: 1B4FC8CFC047959880F22A36ABB1E825260EDFEBE84D, 455666419750CF6012659EB68EA93706 + 23: 86DE014441AE5E868C335AC480A227507304F416AA1DB0, 4861EB2C1860B5FE68FD844C93F957D7 + 24: 98DB0F92C96A6A4A76FD8388852E30EE9D4B397DD36DCA23, A6A5136EF28DD468B8C9BA27D0423E08 + 25: 012701CDF2BC3F72A6DDBFA8ABE102D44531AB30693F3C92D9, 7A0AF791A2AA53FFA3C17867B9B39FB9 + 26: 3B6A8D60F5A580EC5676D3F656E98BFDF4A3F1C38F63B51A0A0B, 74CF48B317AB5966856CD1F84C1C53A5 + 27: B5DA5A540BD8C1FE05DF994A780E8FC54D0C84F9979515E4EF60B6, C1CB0C8D114C218D4C7650BB9F2F9732 + 28: AFD1259572B60A5ED77B8CDF9E8C31CFDA25FFAD45A6CDD614F83500, BF4F4E01D34B69F7460361C0B653137A + 29: 1CDF78F6CF70428A19C87EFC9F2A861AB35CB03638003F701C57F5A108, B005D9CB01E35A08329ED34EEDB51C2B + 30: 97A60FD030DCFB8E8DA4FAC24682C8A7901168504E6D494431EDC44BD2EB, 9958A0B0908DD27D3377268EDDFF8196 + 31: AD36ED716E5C956BC6766EA376E18EC1456258DF590E3425235493ECBAE133, F31D35D8D6E24C90E47C12E35F300826 + 32: EFABA1D19F94A4C288E3EF8353A919F06EC1AFD2ED802C82BA6806F26B93B581, D599015BC0A240AB62E85D3284E111BC + +OCB-safer-k64 (8 byte key) + 0: , ADC114C0D077300D + 1: A9, F24A07BC00CAAA0C + 2: 75A7, DAD101DA4CB6D700 + 3: 0EFFA0, 9A098D97F685CE48 + 4: 16438C72, 739EE029D575F395 + 5: 303FABFBF8, 00C4C2494022E52C + 6: B1209255BE6C, D068FBF0EA49BAEB + 7: F784608D57ED05, F3395D67FFDAD746 + 8: 7AF185590214412E, DC524433F8A75A16 + 9: 44FE566F96CF0B8A37, 71846BF7025901E7 + 10: 1618A09FAC353DDB5685, BBDA87FF67B5DF14 + 11: 7F1907238DFBD66679FC63, 48F1009DD129B0B7 + 12: 40B3AD0A9C2B65670C0FD968, BA95C8A250D6EC75 + 13: A64662338728218AE4A9D387D9, DF0079004B48083E + 14: CBDCDB3E912682AD5990ECCA0453, 102A70C169347128 + 15: 3A924FAFAAE941784360E30D0757AC, 16B8BED72BEC1950 + 16: FB1E63659F958EA320BD015599A3551F, 5AFE10D792095AFD + +OCB-safer-sk64 (8 byte key) + 0: , 52BD1FFF50351BCE + 1: F7, 4274F3D1A0CF5BA1 + 2: 28B3, 4BD97A9EBA18E5FA + 3: 1EA215, B6D28CD00E7B1098 + 4: 93129898, 7A9F3FF172C91AE5 + 5: 36BC2888B7, E6A37037F50199F7 + 6: 1A24F1C9D32D, 3A0472F6372EDDE9 + 7: 1A799D9CE0C2CD, E3BFF559234C265D + 8: 1C43DDAA18FC9A97, 851499FD6C0313C5 + 9: 08AD38225230BDE500, 5B9558370016257E + 10: 3E00DA672753F931226B, 47901E285CA2AD82 + 11: 892F0D4C2302EDEC2C3587, 1D4C71FB290104E9 + 12: 124E7EBE7D643EB6B2426644, 0DA9ECE397151EFB + 13: AB1BFEA636E3E4189677433CAF, FEF2E8389207857D + 14: 79A206C4B23DBBD7422432A32093, 04FE9BD236AAAEB2 + 15: D8997D69B89058F0AE974A241DB76F, F395D15E6F18E555 + 16: CE7B2A79A46AB5F0FC5B55A0F751245F, D6E1523F75489CC9 + +OCB-safer-k128 (16 byte key) + 0: , 233F1509E202E728 + 1: E5, 47D8BEBAF965745E + 2: 754D, 290AF209DF1FAACB + 3: 76EE38, 2B2077CD08A9F56A + 4: 54B277EF, 8498AE1104DB117F + 5: 549B360B06, 8B6B990840CFD666 + 6: 4687E79DAD45, A72CC518980419E2 + 7: 00A89236339443, 1BD4A6F472218B05 + 8: 2898F27243B4DC08, B0CF6DE09DF4F6EB + 9: C0FD319C9AD18A842F, AD6526380D323480 + 10: BC924B95E3CA0EF2EF51, 262F667D40D4EDE5 + 11: 0255999B9317DE741F3C73, C148B4E3C0D7D6E3 + 12: F4DAAE53F04D5E977CD98015, BB254770D37F80CB + 13: ADE0774EE8F303A96FA110DE09, 9547EEFE854DD99C + 14: 0824C8FF6D62C849A8EAEFD06B4C, 613B264BDCD0DF4D + 15: 6C69F69F3F4A28798E141003E7A9DD, 1BBB5B912118AE95 + 16: 4727E3139B38396F294CC2D532BE5FA5, CE8039B0BF3D7247 + +OCB-safer-sk128 (16 byte key) + 0: , 6B06914D0E070584 + 1: 33, 6E16F49996CED793 + 2: 2C9D, 9001E62BEB613A8F + 3: BA9381, 791EE199D5BFD651 + 4: F7A81D0C, D128ACC4FAB2941E + 5: 66D1DC880E, 08D3EB7D405F26E0 + 6: 90F8FCEC0067, 23CD39807B169E1F + 7: 7D559F904AC0E3, A9C685E5657F4A34 + 8: F317A68CAE96032A, 9654658AF84528E0 + 9: 3FC34820F421D931B9, B480CAE6B6D61FFF + 10: 173ADC60BCCBCFB18966, 1392B2FBB86EA6EE + 11: E1EDC19C2E4AE5A20668EC, 17A2A7FB18440B50 + 12: 0F346BDD0C5F1685B281493C, 8169618CFBBC84A6 + 13: 74597EA4DB09F6A38565316AA0, 192F1B3F863B20BD + 14: E5470A157BB18E7456A79C5E40AC, F49954A039514F1E + 15: F055944B9C518AE9D44AB407C32F35, 0A45830C1175B3A0 + 16: DADA8AEBF57928C9D13EABC840B335A4, 67AE540EAC0129DA + +OCB-rc2 (8 byte key) + 0: , CB28E7BD706EFF65 + 1: C8, 7E3F5A176F71601E + 2: B632, C91680B7A52A3DFC + 3: 41435E, A97F1A5EDA202127 + 4: 81BC4015, CDE53BAE0F178F51 + 5: 97628A29F6, 5CFD18FF1112E76F + 6: 6218ED3F0875, 10F80C337AC529B0 + 7: 797E08DE799E97, A3E5BB262953E00F + 8: 5ECFED1D31A7207E, 559893E2748E3982 + 9: 91BB1BDF184D3733E7, 9EC128ADD1B550DD + 10: B31DC920C7EEE1F29E72, F37AE3B755C95181 + 11: 9061478D7846AE093557D6, 9515937DAD0C3859 + 12: 56918DD08F7D60502FDD9CB5, 24B6903992B8107A + 13: 3F1D1C1F745EAB05459B2DB86E, B4475B5A5ACB91E5 + 14: E00B385EC963602982A0BBDC3182, CA06E1DD1CB9637C + 15: 40BB2FBC9DD133E3958D5073DF9FF9, 2E5ECB03309630F4 + 16: 0AEE1927D6439C8BFCE6984DEEF2E6E9, 398561F898EE36E5 + +OCB-des (8 byte key) + 0: , E5E4D924A3DDA7CE + 1: BA, 2AEDAEF9CA1A9C7B + 2: 0F37, A8FF952EBCB5C27C + 3: 2AAC55, 9D7CD4AEEDAEFBC3 + 4: 9D1A16A0, 5064135780E6BFC9 + 5: E1B26204F1, 1F1D5449C214F528 + 6: 6A0D8B244E3E, 78DAD555E2977E74 + 7: 08CAA94D23DE55, A1A1B7972E3B5413 + 8: C1EAB716F806D038, 906CD254EAD1F9D2 + 9: F4E8F83B0B48250236, 12D96AD38BF22277 + 10: 4FACF4CA8F9D9C1CB61D, 6448284C9D8A6B38 + 11: 8AAD13A87B869AF1FD5CBB, 5C44F3C0642313B4 + 12: E50E78A36CF3AAD27A962F82, B796C10A692F72E4 + 13: CBB785CDA5263F8B45915942FA, D7D18C57408D00C8 + 14: 39EDAA0F16DF4BE3E1F4CC9B93F5, 5A78D4D529E658A2 + 15: 1D8B9D2A0779F31AF61A172E563E21, DD9D78D160903970 + 16: 4F5AFE126EA161ED8EDFA6AD9640B9DC, BE20EEFB088C1BC2 + +OCB-3des (24 byte key) + 0: , 30D1F1D526BCDE16 + 1: CA, 737A0D73F465DEC6 + 2: CB98, 3F772C5AC706F24F + 3: 0C764C, BC80B99A6ED9FBF5 + 4: 01525168, 6DE48387E0F56E2F + 5: D7463F67FA, 90018E688367A3E7 + 6: BF3DD0750CFE, 6E1965C24DA3E913 + 7: 8EFCACB99A8D0A, 0727B907696F8FAD + 8: F8E92EF758BA48CB, F863DC4B8E73339C + 9: 5E9DA0FBDDCD0DD3EF, BE6482A44DC7E537 + 10: 5A5466EA4BB3CAE7B020, FBED57DA0D91AF2F + 11: 78F1B76EDAE923B875E1A0, B6C4FEB194193A65 + 12: 5CA677153C30E14C457807BA, 7F0FCE7505AF14D4 + 13: E748CE1E7F9FFAB9C9983D16E2, 01D3ABECE0DEA2A2 + 14: CAD89FC73FE93E17D2AB4D8B36E8, D682B9F5F39513C0 + 15: D3B5BDDE86E988628357B3EC622357, 12180A98DBEA8D4B + 16: C9962CDA2141ECF9F8E5178307E526F7, 105CF6D040987D93 + +OCB-cast5 (8 byte key) + 0: , 53EB91E57923FE43 + 1: 53, AC15D2C444C5E407 + 2: F3B4, 448E3405E97FF5F4 + 3: EA2BF7, 23A7798222027AFC + 4: 2EE3166D, 0BA3E584C8B6C7C7 + 5: 3A8EFA1923, 088B5F14925C1054 + 6: D4C03D32CCBA, 7A19BF98BBE14AF3 + 7: A2CD3D4233DAB8, C44AEB4C39572364 + 8: A0EB1F16AA4E2F82, FB7CC3CB4EC595C0 + 9: DD3A71458B8DAD91CE, 1565FF64BCC0094B + 10: 399948E91E4EE7D2E0CC, 03BA85E452E52DE8 + 11: 8B589B04321BC35F591499, 14E0DBB700E7BE85 + 12: D2C1A33EBE900EFB656797C8, 13498FF76B676EED + 13: 534C1BA008EC89D2AF43B21725, EEE64FC92802CCEF + 14: 5368EB18C2157B667D098B8580BE, AF8BCAAC5AFDB0B8 + 15: 6BD7F55DE1A4718A6B3B6EA4D43031, 1C6BEAC4FE0D480E + 16: FA1E5410E622051400CAD151211916A7, 3EC52677421255D2 + +OCB-noekeon (16 byte key) + 0: , 7F0EEED1FD7FFECEE2CAC95477884E58 + 1: 74, 97B25EB4C8A4A01BD8F4F4CA2AC26B13 + 2: 20FF, B6D315A991297456529355CBAB74B231 + 3: 8FD23D, 6DEC092FBEA42213EE4B795E52A91484 + 4: 868F9D8B, 7A4E1EFD87F0A4D82571E025DC8976DA + 5: EF59D700F0, A7D7A4CA5AEAA4F193C4CC7A6A311C86 + 6: BCD16ED4DE78, 8C661423A4EBE84AA863BC62894D2FDE + 7: D1996ECF096D77, C99D7F79307F08986E151F44A9B3409E + 8: 88BADF7ED86D024C, A39E95FDE8C15D3F0B4D439A3E9512CA + 9: 2DB1F66EC64B3A3309, B85B0530B581FF599F04E285B0DBD562 + 10: 6627C3586AB1A43777AA, DCD0B6E4749D0D983B777947B2E7DF94 + 11: D47B10151EA15496D68D0A, 5462DBDB94D194DB01D03CB5719799C4 + 12: D997EF4B4782C959D7FEF298, 00E39632CE89CBF5892D8A55BABD66CD + 13: C3684D24C78AF4542E088949D3, 302FD96F20FA01F841DF8E3FF634EA65 + 14: C0FF61350FFC8FA4CEA857E69770, 1EA083FEEA89B019044A56176D47A209 + 15: 35896DB08FA2B837AE7F73F563F1A5, 5A1DCAA52F051A78552AE4BECDEB5EBD + 16: C44C28E2EF2B145B57030B5D403300AD, 615F4D3C2342397C323D91BFB6F35537 + 17: 925BFCFD598EE2167823204E531C09D744, 769A60612D34E0D76C65812E437B366B + 18: 56FF27AF89F9A438EDA0F00D83C864A58C90, 4122513495F866E7A154FFBB49ADE999 + 19: BB9C0633EB07E5053E3BD64B7ADC2D15C497B9, 42074FDF7C3D5919769C3168FC0DA9B7 + 20: E77E666D6B6C206274E8AA6BC21E615399B10B60, 15DE064D9EF7F61518FBC130AFD27633 + 21: 26835663DB363A54E5B5DF6C080579E007A3936979, F4D635FE378D957143EF215FEFF1964F + 22: 20F33C26AA97C924FAA320D147703A2E44A0CD2DE9D0, 8BF2C8D6A46F938146FD964C272315C4 + 23: ED3EB5440B984DD5DD81136AA7BFF25A51329EEF01FE59, 7A07644AFD20B4AEE7612A8B365CBBFF + 24: 51086917EFC1EAF5DF11811573ACB5977FCF090E2A287223, EAC6812D7218A315D6859BB7A71899B9 + 25: ABFB3BA3588D0B04ECFAC7A43B8801C5C309AEE607E5EDBE24, AFCC1659F0D6CA1B9FA37ADC5B13E6C3 + 26: 77381C4A7E18FF7FD5F3ED5710B924C7935A9CDC0B8EA761FD68, CBC15B38DCB4549514F49650EA47E4F4 + 27: 91AD26366BDC121CC316BCFF1C73B97D73F4D267F1501967C9724C, 9D4A729FB78ED0A38E741FC380D62323 + 28: E3B7762DEECAA467384D25304A8C20887C3424230D84DA976F6C3316, CC2C5112C9208CFE165DB913FCB8A331 + 29: 7AE2A23472737F9587065CC5254DD64074C6C8D64E7E6198927FA30788, 9F4542664F18DBD85286D59EE8E33D7F + 30: 67AFAD81B4283C81131D0C7E411872D937A6D657D780FA23D62624B62154, 6B2DBA7CDC032A51D9FBAE63EACA43B7 + 31: 1424442606ECB6ABCA1CDA3CF492357AB7EB828537A9B8E1057644663CBB03, 4B4A8B2C2BEEE927161080570B7E7A8E + 32: A26EA76C18D7145F8569335458BA0919A7E70BB9EBF328D2C22D07B2CFA6B38E, 0AA05190DA1D44EADC609CED2368737A + +OCB-skipjack (10 byte key) + 0: , 509609FAF6B2A760 + 1: 1C, D19D4AD11B65B435 + 2: 328A, 252CB779130397D6 + 3: 6DA4D8, D67C555D873050DB + 4: 31D7BF8B, C92EF449E99E4689 + 5: AE263BC571, 4D840A59C00B4462 + 6: D3BFDC4AB208, A28415ACC9B0110A + 7: A5B72B226A5DDD, B414058C98FD853B + 8: CAA29B280DDD3C15, 4D26BF4D0C89E38E + 9: 5254ABED0835B8EB8D, 606061B9A2E80198 + 10: 2EF661B59DD3F2EF31EF, 9185BD6F1AB894B1 + 11: 65124843D1E57AF3F68BD8, 8B3D629B42A7083E + 12: EEB3427A492FEA461196E2FD, 5B02BB30264C4773 + 13: BDF601AE59455530E8CD5D4733, 42CCC4F51CDD9AD1 + 14: 8563FEEB2847AEA38D940953882C, E233C6110A0E77F8 + 15: 766A8BD4C655ECC0589BD0A3EE65A5, 1374E4A3F96D13F8 + 16: 85BB8A319C9FAC34E3FD694727747DE3, ED65F930AE6DE12A + +OCB-anubis (16 byte key) + 0: , E8D6A3FB8D3E664DA78571CA8BFCB95B + 1: EA, 03E38265C85DE60108B7098A51B5E341 + 2: 670D, EEC6A709FD9A74551467CE9F330D9032 + 3: 42A726, 1E45B0C7F9B143FE17904412B8F88DA0 + 4: 7AA61A9D, A89163D9B707F3B83082BDCA2CC00712 + 5: C3D7E3EB14, 0DE7F3A68788E854603CEF766A25B63C + 6: A160A9CCE0C9, 6DC1504CD1368E83BDBC113EB95DD895 + 7: 18415CDBFB78CF, EF372363366B5868AC287F1B43CCD739 + 8: E40D6DD638AA2C9C, CB3B89CAA74ADAD76CD6ACC7C2CEF3B1 + 9: 7AEA37ABB7582721D6, E01A28646610DEB22E7539CBB6696BF4 + 10: 03F16C187F6DEB996299, 74F6018D51DE37D77A30021583F07658 + 11: 9E080BBD30A520A3B47AC5, 0457907DA3AD8467B3F0CA41B82E584F + 12: E673042F50FD247F04734C59, C7917428BCC7D932DE373CB03954A7C7 + 13: 0A0F2CFB5D4F3F7EAD1B0E3C57, 2717CAA7A3AEE7873969971F884E70FB + 14: 8DD2128500F515F917862726FCB8, 3313A88FA208776F305F1BB344748E85 + 15: 625D855CFA0097B136B47E41AB21A8, 8B7FB512341B339AAA45F9345B16B66C + 16: 6DC9BF9F13D8ACED3C07DFE183C4C21D, 1E8B9686F5D564448AE06B5C6408D2BF + 17: 6193393E9CE9087EF765574FEFCBD599BA, A2C14ED8BDDFDC988AF9CF2C71CF6277 + 18: 3F06E79CEB0FF301A0C6D8076D4241F549E5, E1838748BF36D2D37D477B89E7327338 + 19: 15963F7AD2C5DA43D46523880E0329F70527ED, 6471F1CFAB79ED06BDCFEBDF0AD3C98B + 20: 3632F3B578836AFC8B9456DEBD853564602AEFD5, 4FE167E3AF7AC854D02758F68DBFFD08 + 21: 576EBD9F85575741C7FB50AB8DC1C9E8762FEAB590, ACB4386F6EA5F1C30C10C1D032A32CF7 + 22: 8DE26C7278A29F8721EBA3B66FC8900242EC213C047E, 46F25D10117CBCDDC5FB2CE2044342E9 + 23: EC5781849EF2B46A02F9624CD225A4FED1E6F876B10437, 014680D2681AA27B55EADF71E198B091 + 24: C7FE74EAC6C697C2878132D127541BC4CCFF6C6EE0AF9926, 9BB9C5AFC2321FE0B771C99B1A4CF273 + 25: 232091C00F1CF16D2A7D05A403412A13A0070491370E86DD53, 5F7AB245670B2D2FF8B70B520ABC4070 + 26: 6D3A0812C0EDF89E4A9EADE407C4E7CBCB068F0BD8463B67B0D9, 96E638BD35F910653098D36EE011A8E1 + 27: BCC775956A49BF8914E37A59D32DB49D334B40133ED0D72692D7D3, 4F9B0FBEEF6DDD17A7D30392E2B14C77 + 28: BFA70C11B18D1E9E74A2C91C967E5F0F9B5A43001ECF7C8F286DFFAE, 0D71543408255921DE67189D999D2A18 + 29: 4FDCE50EF26DCB4106A81554B2F97166C6D9A018E340FDE9E2B7FD350E, 6A73C694FA85CB83272C0EA856B83E0B + 30: D0C9F3D92BADF1A874DD47B1926B509191AF06D720D4C05F4BB6F314D6DC, 2F54556E01233BE6B309FBD11D2B9289 + 31: CB9F54B5936B90530B68A11A50CA4568AC2423A137066AAE38C2C5420DCBAB, 58277F655B1F71939B61E49200E8DC3B + 32: 08015545AC92A9F77C8B1ABB42CF3EF2C48C5A1E40C5F0980684A21D8E03F445, 54FA9E6195A3ECE7AF469FC179C36739 + +OCB-khazad (16 byte key) + 0: , 2D528A56D24DA0B1 + 1: DD, 195FF8AA3642FCBF + 2: 8081, F96BF0542DBABB49 + 3: A3BDB4, 53B2301ADA9F2471 + 4: B65B1104, BC470E5528C50AA0 + 5: E3020368BE, 36911628972321F4 + 6: F6D17AFCA3E8, 2BBA5E3BEA80D17F + 7: CBF398ECFCA361, D79987D6D0751DC8 + 8: D625BD23AC106E16, 91CEEEE861A07568 + 9: E28B40E0D810AB8B28, EC2AB51CB46F101C + 10: A831B14C2E0F1C583F5E, 17AB8A4B822A4D9C + 11: 1CA32A525BA0A8A141E852, 7E2A30A9FE7BCA18 + 12: 9B7F20DBEE7E7735FE7BB8A0, E881254902FFB81A + 13: DEA8DB05EEBD550B9A36B5043C, F7DE10A41ED5450E + 14: B6681197883BCC1EF3F880D15CC8, 7CC43F7E2D10C161 + 15: B5F13633767C37E2A5BE44B95AC80D, C66A029513179FAF + 16: BBAB31F93B165465FE5E2133810E46C2, 146A3AA6A6A68E2A + +OCB-camellia (16 byte key) + 0: , 3F877FAB2796D87C990AE311F952ABD1 + 1: 00, DD1FC339F770744F39B1A41A3A82CAEA + 2: 2676, D350A1789213678BDCF07F1C42856456 + 3: F2BF5D, 012AD9BAA22496920EAC7ED7747C261E + 4: 7C421EA6, 1187E883BE6BD6D6A67F175B187F276C + 5: E709524F55, 36B849B052B8C5BA55AD9526333C0FF2 + 6: F49A3BEDA44C, CBCDE03DD9C5EBC7591329C5023F4F7C + 7: 6BC6BA030C3E8A, 726E39A65F92ED22728ED4351DEECCFA + 8: EBFCF5FED85EEACC, 5E390FA62857DAC97225368029263E00 + 9: 3DD92B177D039DF76F, 224D361D1A7D660485A9B3FD11DE370A + 10: C90774C14A42828E7EDB, E6A48823F8F004EE5A178C37B87BA06A + 11: 39089E93DC6E76B827B701, C2AAC46E4D1DE7F319B1E2592F9A29B9 + 12: 0C0C8ED5B3DD2C0A67606172, 2EA84EE1736B4F6F0C0A133C345B328E + 13: AF6770413CDF0DCE68F447F76D, AB462C2F2524940FAB9A57A17FA2783B + 14: C210E4CBBB5FD339B3FF90A722BD, 05A92BEFBFFEDA7F5FEB9BBC6E7BC363 + 15: 90FC04748C52CAA59BF6C92FF11F1B, 991C959C9E3B58D783120FAFF45C29E6 + 16: AB86F4DC4EDD4556F168A98249235F02, 92585560E23DFCF81B8551AA94135BB2 + 17: A160C9534C3E2185013F6D5D76E0218E7D, 9A3CDDFB67DB71D8E5BC4BE4D8EFDC4B + 18: C08635F10D090C6A5DF4DC43DD9B58D50EC5, CC8A076D653B3FBC2AE34A8A0FF42609 + 19: 24C18B9EED5029BFAE91D440608BE46F9798AA, 9A56608D45081C2E5A8C9CC163A307DE + 20: 5946CFA51DD90646F09CE74F96D4603CFB20B7A2, 1CD0CE9985AC99F2600B5D762BF46EC0 + 21: 08D8BB0667DC8106E365D7D685392DB987EFA5D3DF, C969DB2859DB494DDD57E9F93CF2C279 + 22: 4AF8331829032CD8BCFEF44CFB2DBC8F0931E055B7A2, 623C86EC7059B580124530CA201740F0 + 23: 45A7C23FD71657BEDA626937C187038D9E1872FBE029D8, 32E954062276603C2F588852C6A17B6F + 24: 2EACBAD372A281A6AC79D6A13EF4D8F5FB0AA15224C7DBEF, 059A4622EB369FFD2A50565351202907 + 25: 405576484E48609F1BB950DEBE5F3915660A80E632E033DB4C, CAEAAB99D713B860F29E03AF719B5FC6 + 26: CC701CFF33D7CD69D6E9C20E15FC629B5375A3C9F8A9CCBB194A, B5F1CCD9E6C6DA25766CC11FFF313040 + 27: 1FD00A679D2F29518B5663A10CEBB83975C1D3183FD9F9617BBCB8, 03FCE87FFFEE68464DBCF9181280C0EB + 28: B92D0C160F1A13504B55D9969CF9A51A3F0DFCB4911F7A4712D0E8FC, 8B858E49BFEE49A17F2D7E9A83CF2143 + 29: 5EC88A34A42C155A1F59947BBFD90B3FC8699EC8294EDEBEA75D8416CE, 1B8A62889CDCFAAB60FE80D8E9B764CE + 30: 1A2D76510AA8AEC8ADCC71458E13592DDEC46CB2C92D551CDF4DA3C190F4, AD08510F3F1A2CBC608634D6431BECD5 + 31: 19ECDC6B7F8EC795F9E6D7E0E02F410228F9EBDA404BF3D998F99D938D3009, 58AF4CAFE7DDE4E99EC617D3A2AE600D + 32: 6FCB93EBC43D6EE05E3EF20109328DFABE6D9D814BFCB7180AE36BBA1B96ECC8, 36032D6860317FF56E7033DCD8161FDC + From 05b050b94398b497589897cabf218efb3b778a91 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 15 Mar 2013 17:46:58 +0200 Subject: [PATCH 0078/1192] update makefiles --- makefile | 148 +++++++++++++++++++++++++----------------------- makefile.icc | 143 ++++++++++++++++++++++++---------------------- makefile.msvc | 143 ++++++++++++++++++++++++---------------------- makefile.shared | 143 ++++++++++++++++++++++++---------------------- makefile.unix | 143 ++++++++++++++++++++++++---------------------- 5 files changed, 380 insertions(+), 340 deletions(-) diff --git a/makefile b/makefile index 6278a2014..a9e3fa92d 100644 --- a/makefile +++ b/makefile @@ -111,27 +111,32 @@ endif OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ +src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ +src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ +src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ +src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -143,79 +148,78 @@ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/pk_get_oid.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ -src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ -src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ -src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ -src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ -src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \ -src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o \ -src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o \ -src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o \ -src/modes/ecb/ecb_encrypt.o src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o \ -src/modes/f8/f8_encrypt.o src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o \ -src/modes/f8/f8_test_mode.o src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o \ -src/modes/lrw/lrw_encrypt.o src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o \ -src/modes/lrw/lrw_setiv.o src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o \ -src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o src/modes/ofb/ofb_encrypt.o \ -src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o src/modes/ofb/ofb_start.o \ -src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o src/modes/xts/xts_encrypt.o \ -src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o src/modes/xts/xts_test.o \ -src/pk/asn1/der/bit/der_decode_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ -src/pk/asn1/der/bit/der_length_bit_string.o src/pk/asn1/der/boolean/der_decode_boolean.o \ -src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_raw_bit_string.o \ -src/pk/asn1/der/boolean/der_encode_boolean.o src/pk/asn1/der/boolean/der_length_boolean.o \ -src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \ -src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \ -src/pk/asn1/der/integer/der_decode_integer.o src/pk/asn1/der/integer/der_encode_integer.o \ -src/pk/asn1/der/integer/der_length_integer.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ +src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ +src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ +src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ +src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ +src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ +src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ +src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ +src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ +src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ +src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ +src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ +src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ +src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ +src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ +src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ +src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ src/pk/asn1/der/octet/der_length_octet_string.o \ -src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ -src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ -src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ -src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_encode_sequence_multi.o src/pk/asn1/der/sequence/der_length_sequence.o \ -src/pk/asn1/der/sequence/der_sequence_free.o src/pk/asn1/der/set/der_encode_set.o \ -src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ +src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ +src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ -src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/asn1/der/utctime/der_decode_utctime.o \ -src/pk/asn1/der/utctime/der_encode_utctime.o src/pk/asn1/der/utctime/der_length_utctime.o \ -src/pk/asn1/der/utf8/der_decode_utf8_string.o src/pk/asn1/der/utf8/der_encode_utf8_string.o \ -src/pk/asn1/der/utf8/der_length_utf8_string.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/asn1/der/short_integer/der_length_short_integer.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ +src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ +src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ +src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ +src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ +src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/dh/dh.o \ src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ @@ -227,11 +231,11 @@ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash. src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ src/prngs/sprng.o src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ +src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.icc b/makefile.icc index 71bb112d8..879cceccf 100644 --- a/makefile.icc +++ b/makefile.icc @@ -97,27 +97,32 @@ endif OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ +src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ +src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ +src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ +src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -129,68 +134,72 @@ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ -src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ -src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ -src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ -src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ -src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \ -src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o \ -src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o \ -src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o \ -src/modes/ecb/ecb_encrypt.o src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o \ -src/modes/f8/f8_encrypt.o src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o \ -src/modes/f8/f8_test_mode.o src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o \ -src/modes/lrw/lrw_encrypt.o src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o \ -src/modes/lrw/lrw_setiv.o src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o \ -src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o src/modes/ofb/ofb_encrypt.o \ -src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o src/modes/ofb/ofb_start.o \ -src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o src/modes/xts/xts_encrypt.o \ -src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o src/modes/xts/xts_test.o \ -src/pk/asn1/der/bit/der_decode_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ -src/pk/asn1/der/bit/der_length_bit_string.o src/pk/asn1/der/boolean/der_decode_boolean.o \ -src/pk/asn1/der/boolean/der_encode_boolean.o src/pk/asn1/der/boolean/der_length_boolean.o \ -src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \ -src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \ -src/pk/asn1/der/integer/der_decode_integer.o src/pk/asn1/der/integer/der_encode_integer.o \ -src/pk/asn1/der/integer/der_length_integer.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ +src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ +src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ +src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ +src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ +src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ +src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ +src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ +src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ +src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ +src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ +src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ +src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ +src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ +src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ +src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ +src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ src/pk/asn1/der/octet/der_length_octet_string.o \ -src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ -src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_encode_sequence_multi.o src/pk/asn1/der/sequence/der_length_sequence.o \ -src/pk/asn1/der/sequence/der_sequence_free.o src/pk/asn1/der/set/der_encode_set.o \ -src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ +src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ +src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ -src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/asn1/der/utctime/der_decode_utctime.o \ -src/pk/asn1/der/utctime/der_encode_utctime.o src/pk/asn1/der/utctime/der_length_utctime.o \ -src/pk/asn1/der/utf8/der_decode_utf8_string.o src/pk/asn1/der/utf8/der_encode_utf8_string.o \ -src/pk/asn1/der/utf8/der_length_utf8_string.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/asn1/der/short_integer/der_length_short_integer.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ +src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ +src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ +src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ +src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ +src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ @@ -208,11 +217,11 @@ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash. src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ src/prngs/sprng.o src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ +src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.msvc b/makefile.msvc index a0ffe6a2a..85a33b599 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -7,27 +7,32 @@ CFLAGS = /Isrc/headers/ /Itestprof/ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ $(CF) OBJECTS=src/ciphers/aes/aes_enc.obj src/ciphers/aes/aes.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \ src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \ src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \ -src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/safer/safer_tab.obj \ +src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/safer_tab.obj src/ciphers/safer/saferp.obj \ src/ciphers/skipjack.obj src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_memory.obj \ src/encauth/ccm/ccm_memory_ex.obj src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj \ src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ -src/encauth/eax/eax_encrypt_authenticate_memory.obj src/encauth/eax/eax_encrypt.obj \ +src/encauth/eax/eax_encrypt.obj src/encauth/eax/eax_encrypt_authenticate_memory.obj \ src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \ src/encauth/gcm/gcm_add_iv.obj src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj \ src/encauth/gcm/gcm_init.obj src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj \ src/encauth/gcm/gcm_process.obj src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj \ src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \ -src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_encrypt.obj \ -src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj src/encauth/ocb/ocb_shift_xor.obj \ -src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj src/hashes/chc/chc.obj \ -src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \ -src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \ -src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \ -src/hashes/sha2/sha256.obj src/hashes/sha2/sha512.obj src/hashes/tiger.obj src/hashes/whirl/whirl.obj \ -src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj \ -src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj \ -src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj \ +src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj \ +src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj \ +src/encauth/ocb3/ocb3_add_aad.obj src/encauth/ocb3/ocb3_decrypt.obj src/encauth/ocb3/ocb3_decrypt_last.obj \ +src/encauth/ocb3/ocb3_decrypt_verify_memory.obj src/encauth/ocb3/ocb3_done.obj \ +src/encauth/ocb3/ocb3_encrypt.obj src/encauth/ocb3/ocb3_encrypt_authenticate_memory.obj \ +src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj \ +src/encauth/ocb3/ocb3_int_aad_add_block.obj src/encauth/ocb3/ocb3_int_calc_offset_zero.obj \ +src/encauth/ocb3/ocb3_int_ntz.obj src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj \ +src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj \ +src/hashes/helper/hash_memory.obj src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj \ +src/hashes/md5.obj src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj \ +src/hashes/sha1.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha512.obj src/hashes/tiger.obj \ +src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj \ +src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj \ +src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj \ src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj \ src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj \ src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj \ @@ -39,68 +44,72 @@ src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \ src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/base64/base64_decode.obj \ -src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crypt/crypt_argchk.obj \ -src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \ -src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher.obj \ -src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash_any.obj \ -src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_id.obj \ -src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ -src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ -src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \ -src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_register_cipher.obj \ -src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj \ -src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ -src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/pkcs5/pkcs_5_1.obj \ -src/misc/pkcs5/pkcs_5_2.obj src/misc/zeromem.obj src/misc/hkdf/hkdf.obj \ -src/modes/cbc/cbc_decrypt.obj src/modes/cbc/cbc_done.obj \ -src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj src/modes/cbc/cbc_setiv.obj \ -src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj src/modes/cfb/cfb_done.obj \ -src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj src/modes/cfb/cfb_setiv.obj \ -src/modes/cfb/cfb_start.obj src/modes/ctr/ctr_decrypt.obj src/modes/ctr/ctr_done.obj \ -src/modes/ctr/ctr_encrypt.obj src/modes/ctr/ctr_getiv.obj src/modes/ctr/ctr_setiv.obj \ -src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj src/modes/ecb/ecb_decrypt.obj src/modes/ecb/ecb_done.obj \ -src/modes/ecb/ecb_encrypt.obj src/modes/ecb/ecb_start.obj src/modes/f8/f8_decrypt.obj src/modes/f8/f8_done.obj \ -src/modes/f8/f8_encrypt.obj src/modes/f8/f8_getiv.obj src/modes/f8/f8_setiv.obj src/modes/f8/f8_start.obj \ -src/modes/f8/f8_test_mode.obj src/modes/lrw/lrw_decrypt.obj src/modes/lrw/lrw_done.obj \ -src/modes/lrw/lrw_encrypt.obj src/modes/lrw/lrw_getiv.obj src/modes/lrw/lrw_process.obj \ -src/modes/lrw/lrw_setiv.obj src/modes/lrw/lrw_start.obj src/modes/lrw/lrw_test.obj \ -src/modes/ofb/ofb_decrypt.obj src/modes/ofb/ofb_done.obj src/modes/ofb/ofb_encrypt.obj \ -src/modes/ofb/ofb_getiv.obj src/modes/ofb/ofb_setiv.obj src/modes/ofb/ofb_start.obj \ -src/modes/xts/xts_decrypt.obj src/modes/xts/xts_done.obj src/modes/xts/xts_encrypt.obj \ -src/modes/xts/xts_init.obj src/modes/xts/xts_mult_x.obj src/modes/xts/xts_test.obj \ -src/pk/asn1/der/bit/der_decode_bit_string.obj src/pk/asn1/der/bit/der_encode_bit_string.obj \ -src/pk/asn1/der/bit/der_length_bit_string.obj src/pk/asn1/der/boolean/der_decode_boolean.obj \ -src/pk/asn1/der/boolean/der_encode_boolean.obj src/pk/asn1/der/boolean/der_length_boolean.obj \ -src/pk/asn1/der/choice/der_decode_choice.obj src/pk/asn1/der/ia5/der_decode_ia5_string.obj \ -src/pk/asn1/der/ia5/der_encode_ia5_string.obj src/pk/asn1/der/ia5/der_length_ia5_string.obj \ -src/pk/asn1/der/integer/der_decode_integer.obj src/pk/asn1/der/integer/der_encode_integer.obj \ -src/pk/asn1/der/integer/der_length_integer.obj \ +src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crypt/crypt.obj \ +src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt_cipher_descriptor.obj \ +src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_find_cipher.obj \ +src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher_id.obj \ +src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_any.obj \ +src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ +src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ +src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ +src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ +src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ +src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_unregister_cipher.obj \ +src/misc/crypt/crypt_unregister_hash.obj src/misc/crypt/crypt_unregister_prng.obj \ +src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj src/misc/hkdf/hkdf_test.obj src/misc/pk_get_oid.obj \ +src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \ +src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj \ +src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj \ +src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj \ +src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj src/modes/ctr/ctr_decrypt.obj \ +src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj src/modes/ctr/ctr_getiv.obj \ +src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \ +src/modes/ecb/ecb_decrypt.obj src/modes/ecb/ecb_done.obj src/modes/ecb/ecb_encrypt.obj \ +src/modes/ecb/ecb_start.obj src/modes/f8/f8_decrypt.obj src/modes/f8/f8_done.obj src/modes/f8/f8_encrypt.obj \ +src/modes/f8/f8_getiv.obj src/modes/f8/f8_setiv.obj src/modes/f8/f8_start.obj src/modes/f8/f8_test_mode.obj \ +src/modes/lrw/lrw_decrypt.obj src/modes/lrw/lrw_done.obj src/modes/lrw/lrw_encrypt.obj \ +src/modes/lrw/lrw_getiv.obj src/modes/lrw/lrw_process.obj src/modes/lrw/lrw_setiv.obj \ +src/modes/lrw/lrw_start.obj src/modes/lrw/lrw_test.obj src/modes/ofb/ofb_decrypt.obj src/modes/ofb/ofb_done.obj \ +src/modes/ofb/ofb_encrypt.obj src/modes/ofb/ofb_getiv.obj src/modes/ofb/ofb_setiv.obj \ +src/modes/ofb/ofb_start.obj src/modes/xts/xts_decrypt.obj src/modes/xts/xts_done.obj \ +src/modes/xts/xts_encrypt.obj src/modes/xts/xts_init.obj src/modes/xts/xts_mult_x.obj \ +src/modes/xts/xts_test.obj src/pk/asn1/der/bit/der_decode_bit_string.obj \ +src/pk/asn1/der/bit/der_decode_raw_bit_string.obj src/pk/asn1/der/bit/der_encode_bit_string.obj \ +src/pk/asn1/der/bit/der_encode_raw_bit_string.obj src/pk/asn1/der/bit/der_length_bit_string.obj \ +src/pk/asn1/der/boolean/der_decode_boolean.obj src/pk/asn1/der/boolean/der_encode_boolean.obj \ +src/pk/asn1/der/boolean/der_length_boolean.obj src/pk/asn1/der/choice/der_decode_choice.obj \ +src/pk/asn1/der/ia5/der_decode_ia5_string.obj src/pk/asn1/der/ia5/der_encode_ia5_string.obj \ +src/pk/asn1/der/ia5/der_length_ia5_string.obj src/pk/asn1/der/integer/der_decode_integer.obj \ +src/pk/asn1/der/integer/der_encode_integer.obj src/pk/asn1/der/integer/der_length_integer.obj \ src/pk/asn1/der/object_identifier/der_decode_object_identifier.obj \ src/pk/asn1/der/object_identifier/der_encode_object_identifier.obj \ src/pk/asn1/der/object_identifier/der_length_object_identifier.obj \ src/pk/asn1/der/octet/der_decode_octet_string.obj src/pk/asn1/der/octet/der_encode_octet_string.obj \ src/pk/asn1/der/octet/der_length_octet_string.obj \ -src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ -src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.obj \ src/pk/asn1/der/printable_string/der_encode_printable_string.obj \ src/pk/asn1/der/printable_string/der_length_printable_string.obj \ src/pk/asn1/der/sequence/der_decode_sequence_ex.obj \ src/pk/asn1/der/sequence/der_decode_sequence_flexi.obj \ src/pk/asn1/der/sequence/der_decode_sequence_multi.obj \ +src/pk/asn1/der/sequence/der_decode_subject_public_key_info.obj \ src/pk/asn1/der/sequence/der_encode_sequence_ex.obj \ -src/pk/asn1/der/sequence/der_encode_sequence_multi.obj src/pk/asn1/der/sequence/der_length_sequence.obj \ -src/pk/asn1/der/sequence/der_sequence_free.obj src/pk/asn1/der/set/der_encode_set.obj \ -src/pk/asn1/der/set/der_encode_setof.obj src/pk/asn1/der/short_integer/der_decode_short_integer.obj \ +src/pk/asn1/der/sequence/der_encode_sequence_multi.obj \ +src/pk/asn1/der/sequence/der_encode_subject_public_key_info.obj \ +src/pk/asn1/der/sequence/der_length_sequence.obj src/pk/asn1/der/sequence/der_sequence_free.obj \ +src/pk/asn1/der/set/der_encode_set.obj src/pk/asn1/der/set/der_encode_setof.obj \ +src/pk/asn1/der/short_integer/der_decode_short_integer.obj \ src/pk/asn1/der/short_integer/der_encode_short_integer.obj \ -src/pk/asn1/der/short_integer/der_length_short_integer.obj src/pk/asn1/der/utctime/der_decode_utctime.obj \ -src/pk/asn1/der/utctime/der_encode_utctime.obj src/pk/asn1/der/utctime/der_length_utctime.obj \ -src/pk/asn1/der/utf8/der_decode_utf8_string.obj src/pk/asn1/der/utf8/der_encode_utf8_string.obj \ -src/pk/asn1/der/utf8/der_length_utf8_string.obj src/pk/dsa/dsa_decrypt_key.obj \ -src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \ -src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \ -src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc_ansi_x963_export.obj \ -src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc.obj src/pk/ecc/ecc_decrypt_key.obj \ +src/pk/asn1/der/short_integer/der_length_short_integer.obj \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.obj \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.obj \ +src/pk/asn1/der/utctime/der_decode_utctime.obj src/pk/asn1/der/utctime/der_encode_utctime.obj \ +src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_utf8_string.obj \ +src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \ +src/pk/dh/dh.obj src/pk/dsa/dsa_decrypt_key.obj src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj \ +src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj \ +src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ +src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ src/pk/ecc/ecc_sign_hash.obj src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \ @@ -118,11 +127,11 @@ src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_verify_h src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj \ src/prngs/sprng.obj src/prngs/yarrow.obj -HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ +src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.shared b/makefile.shared index 2848c36aa..49de3b044 100644 --- a/makefile.shared +++ b/makefile.shared @@ -102,27 +102,32 @@ endif OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ +src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ +src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ +src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ +src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -134,68 +139,72 @@ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ -src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ -src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ -src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ -src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ -src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \ -src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o \ -src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o \ -src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o \ -src/modes/ecb/ecb_encrypt.o src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o \ -src/modes/f8/f8_encrypt.o src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o \ -src/modes/f8/f8_test_mode.o src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o \ -src/modes/lrw/lrw_encrypt.o src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o \ -src/modes/lrw/lrw_setiv.o src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o \ -src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o src/modes/ofb/ofb_encrypt.o \ -src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o src/modes/ofb/ofb_start.o \ -src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o src/modes/xts/xts_encrypt.o \ -src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o src/modes/xts/xts_test.o \ -src/pk/asn1/der/bit/der_decode_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ -src/pk/asn1/der/bit/der_length_bit_string.o src/pk/asn1/der/boolean/der_decode_boolean.o \ -src/pk/asn1/der/boolean/der_encode_boolean.o src/pk/asn1/der/boolean/der_length_boolean.o \ -src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \ -src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \ -src/pk/asn1/der/integer/der_decode_integer.o src/pk/asn1/der/integer/der_encode_integer.o \ -src/pk/asn1/der/integer/der_length_integer.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ +src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ +src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ +src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ +src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ +src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ +src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ +src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ +src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ +src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ +src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ +src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ +src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ +src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ +src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ +src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ +src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ src/pk/asn1/der/octet/der_length_octet_string.o \ -src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ -src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_encode_sequence_multi.o src/pk/asn1/der/sequence/der_length_sequence.o \ -src/pk/asn1/der/sequence/der_sequence_free.o src/pk/asn1/der/set/der_encode_set.o \ -src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ +src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ +src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ -src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/asn1/der/utctime/der_decode_utctime.o \ -src/pk/asn1/der/utctime/der_encode_utctime.o src/pk/asn1/der/utctime/der_length_utctime.o \ -src/pk/asn1/der/utf8/der_decode_utf8_string.o src/pk/asn1/der/utf8/der_encode_utf8_string.o \ -src/pk/asn1/der/utf8/der_length_utf8_string.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/asn1/der/short_integer/der_length_short_integer.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ +src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ +src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ +src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ +src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ +src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ @@ -213,11 +222,11 @@ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash. src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ src/prngs/sprng.o src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ +src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.unix b/makefile.unix index 53882e2c3..bda4d7f48 100644 --- a/makefile.unix +++ b/makefile.unix @@ -43,27 +43,32 @@ GROUP=wheel OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/safer/safer_tab.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ +src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ +src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ +src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ +src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -75,68 +80,72 @@ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o \ -src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ -src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/misc/hkdf/hkdf.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o \ -src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o \ -src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o \ -src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o \ -src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o \ -src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o \ -src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o \ -src/modes/ecb/ecb_encrypt.o src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o \ -src/modes/f8/f8_encrypt.o src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o \ -src/modes/f8/f8_test_mode.o src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o \ -src/modes/lrw/lrw_encrypt.o src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o \ -src/modes/lrw/lrw_setiv.o src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o \ -src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o src/modes/ofb/ofb_encrypt.o \ -src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o src/modes/ofb/ofb_start.o \ -src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o src/modes/xts/xts_encrypt.o \ -src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o src/modes/xts/xts_test.o \ -src/pk/asn1/der/bit/der_decode_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ -src/pk/asn1/der/bit/der_length_bit_string.o src/pk/asn1/der/boolean/der_decode_boolean.o \ -src/pk/asn1/der/boolean/der_encode_boolean.o src/pk/asn1/der/boolean/der_length_boolean.o \ -src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \ -src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \ -src/pk/asn1/der/integer/der_decode_integer.o src/pk/asn1/der/integer/der_encode_integer.o \ -src/pk/asn1/der/integer/der_length_integer.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ +src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ +src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ +src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ +src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ +src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ +src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ +src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ +src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ +src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ +src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ +src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ +src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ +src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ +src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ +src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ +src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ src/pk/asn1/der/octet/der_length_octet_string.o \ -src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ -src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/printable_string/der_decode_printable_string.o \ src/pk/asn1/der/printable_string/der_encode_printable_string.o \ src/pk/asn1/der/printable_string/der_length_printable_string.o \ src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_encode_sequence_multi.o src/pk/asn1/der/sequence/der_length_sequence.o \ -src/pk/asn1/der/sequence/der_sequence_free.o src/pk/asn1/der/set/der_encode_set.o \ -src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ +src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ +src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ -src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/asn1/der/utctime/der_decode_utctime.o \ -src/pk/asn1/der/utctime/der_encode_utctime.o src/pk/asn1/der/utctime/der_length_utctime.o \ -src/pk/asn1/der/utf8/der_decode_utf8_string.o src/pk/asn1/der/utf8/der_encode_utf8_string.o \ -src/pk/asn1/der/utf8/der_length_utf8_string.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/asn1/der/short_integer/der_length_short_integer.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ +src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ +src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ +src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ +src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ +src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ @@ -154,11 +163,11 @@ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash. src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ src/prngs/sprng.o src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ +src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS From 6b5b35e6cc60e54adfdda18af73efb03ede4bf50 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Mar 2013 18:10:51 +0200 Subject: [PATCH 0079/1192] ocb3: don't zero ocb3 context in ocb3_{de,en}crypt_last --- src/encauth/ocb3/ocb3_decrypt_last.c | 1 - src/encauth/ocb3/ocb3_encrypt_last.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/encauth/ocb3/ocb3_decrypt_last.c b/src/encauth/ocb3/ocb3_decrypt_last.c index 35ba864c4..a932d537a 100644 --- a/src/encauth/ocb3/ocb3_decrypt_last.c +++ b/src/encauth/ocb3/ocb3_decrypt_last.c @@ -93,7 +93,6 @@ int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ct #ifdef LTC_CLEAN_STACK zeromem(iOffset_star, MAXBLOCKSIZE); zeromem(iPad, MAXBLOCKSIZE); - zeromem(ocb, sizeof(*ocb)); #endif return err; diff --git a/src/encauth/ocb3/ocb3_encrypt_last.c b/src/encauth/ocb3/ocb3_encrypt_last.c index 788a25756..b21cfae4c 100644 --- a/src/encauth/ocb3/ocb3_encrypt_last.c +++ b/src/encauth/ocb3/ocb3_encrypt_last.c @@ -95,7 +95,6 @@ int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long pt #ifdef LTC_CLEAN_STACK zeromem(iOffset_star, MAXBLOCKSIZE); zeromem(iPad, MAXBLOCKSIZE); - zeromem(ocb, sizeof(*ocb)); #endif return err; From f107e6e465d286255daf9b65dc974404b14179be Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Mar 2013 18:34:00 +0200 Subject: [PATCH 0080/1192] demos: trim trailing spaces --- demos/encrypt.c | 28 ++++++++++---------- demos/tv_gen.c | 70 ++++++++++++++++++++++++------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/demos/encrypt.c b/demos/encrypt.c index 12b234652..f650429de 100644 --- a/demos/encrypt.c +++ b/demos/encrypt.c @@ -11,7 +11,7 @@ int errno; -int usage(char *name) +int usage(char *name) { int x; @@ -25,7 +25,7 @@ int usage(char *name) void register_algs(void) { int x; - + #ifdef LTC_RIJNDAEL register_cipher (&aes_desc); #endif @@ -79,7 +79,7 @@ void register_algs(void) if (register_hash(&sha256_desc) == -1) { printf("Error registering LTC_SHA256\n"); exit(-1); - } + } if (register_prng(&yarrow_desc) == -1) { printf("Error registering yarrow PRNG\n"); @@ -92,7 +92,7 @@ void register_algs(void) } } -int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { unsigned char plaintext[512],ciphertext[512]; unsigned char tmpkey[512], key[MAXBLOCKSIZE], IV[MAXBLOCKSIZE]; @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) cipher = argv[1]; infile = argv[2]; outfile = argv[3]; - } + } /* file handles setup */ fdin = fopen(infile,"rb"); @@ -131,11 +131,11 @@ int main(int argc, char *argv[]) } fdout = fopen(outfile,"wb"); - if (fdout == NULL) { + if (fdout == NULL) { perror("Can't open output for writing"); exit(-1); } - + cipher_idx = find_cipher(cipher); if (cipher_idx == -1) { printf("Invalid cipher entered on command line.\n"); @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) ivsize = cipher_descriptor[cipher_idx].block_length; ks = hash_descriptor[hash_idx].hashsize; - if (cipher_descriptor[cipher_idx].keysize(&ks) != CRYPT_OK) { + if (cipher_descriptor[cipher_idx].keysize(&ks) != CRYPT_OK) { printf("Invalid keysize???\n"); exit(-1); } @@ -162,14 +162,14 @@ int main(int argc, char *argv[]) printf("Error hashing key: %s\n", error_to_string(errno)); exit(-1); } - + if (decrypt) { /* Need to read in IV */ if (fread(IV,1,ivsize,fdin) != ivsize) { printf("Error reading IV from input.\n"); exit(-1); } - + if ((errno = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) { printf("ctr_start error: %s\n",error_to_string(errno)); exit(-1); @@ -194,10 +194,10 @@ int main(int argc, char *argv[]) } else { /* encrypt */ /* Setup yarrow for random bytes for IV */ - + if ((errno = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) != CRYPT_OK) { printf("Error setting up PRNG, %s\n", error_to_string(errno)); - } + } /* You can use rng_get_bytes on platforms that support it */ /* x = rng_get_bytes(IV,ivsize,NULL);*/ @@ -206,7 +206,7 @@ int main(int argc, char *argv[]) printf("Error reading PRNG for IV required.\n"); exit(-1); } - + if (fwrite(IV,1,ivsize,fdout) != ivsize) { printf("Error writing IV to output.\n"); exit(-1); @@ -229,7 +229,7 @@ int main(int argc, char *argv[]) printf("Error writing to output.\n"); exit(-1); } - } while (y == sizeof(inbuf)); + } while (y == sizeof(inbuf)); fclose(fdout); fclose(fdin); } diff --git a/demos/tv_gen.c b/demos/tv_gen.c index b00a5c473..ab4df0f68 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -121,12 +121,12 @@ void hash_gen(void) unsigned long outlen, x, y, z; FILE *out; int err; - + out = fopen("hash_tv.txt", "w"); if (out == NULL) { perror("can't open hash_tv"); } - + fprintf(out, "Hash Test Vectors:\n\nThese are the hashes of nn bytes '00 01 02 03 .. (nn-1)'\n\n"); for (x = 0; hash_descriptor[x].name != NULL; x++) { buf = XMALLOC(2 * hash_descriptor[x].blocksize + 1); @@ -163,16 +163,16 @@ void cipher_gen(void) int err, kl, lastkl; FILE *out; symmetric_key skey; - + out = fopen("cipher_tv.txt", "w"); - - fprintf(out, + + fprintf(out, "Cipher Test Vectors\n\nThese are test encryptions with key of nn bytes '00 01 02 03 .. (nn-1)' and original PT of the same style.\n" "The output of step N is used as the key and plaintext for step N+1 (key bytes repeated as required to fill the key)\n\n"); - + for (x = 0; cipher_descriptor[x].name != NULL; x++) { fprintf(out, "Cipher: %s\n", cipher_descriptor[x].name); - + /* three modes, smallest, medium, large keys */ lastkl = 10000; for (y = 0; y < 3; y++) { @@ -202,7 +202,7 @@ void cipher_gen(void) printf("setup error: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - + for (z = 0; (int)z < cipher_descriptor[x].block_length; z++) { pt[z] = (unsigned char)z; } @@ -229,7 +229,7 @@ void cipher_gen(void) fprintf(out, "\n"); } fclose(out); -} +} void hmac_gen(void) { @@ -237,17 +237,17 @@ void hmac_gen(void) int x, y, z, err; FILE *out; unsigned long len; - + out = fopen("hmac_tv.txt", "w"); - fprintf(out, + fprintf(out, "HMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are HMACed. The initial key is\n" "of the same format (the same length as the HASH output size). The HMAC key in step N+1 is the HMAC output of\n" "step N.\n\n"); for (x = 0; hash_descriptor[x].name != NULL; x++) { fprintf(out, "HMAC-%s\n", hash_descriptor[x].name); - + /* initial key */ for (y = 0; y < (int)hash_descriptor[x].hashsize; y++) { key[y] = (y&255); @@ -258,7 +258,7 @@ void hmac_gen(void) perror("Can't malloc memory"); exit(EXIT_FAILURE); } - + for (y = 0; y <= (int)(hash_descriptor[x].blocksize * 2); y++) { for (z = 0; z < y; z++) { input[z] = (unsigned char)(z & 255); @@ -282,17 +282,17 @@ void hmac_gen(void) } fclose(out); } - + void omac_gen(void) { unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], input[MAXBLOCKSIZE*2+2]; int err, x, y, z, kl; FILE *out; unsigned long len; - + out = fopen("omac_tv.txt", "w"); - fprintf(out, + fprintf(out, "OMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are OMAC'ed. The initial key is\n" "of the same format (length specified per cipher). The OMAC key in step N+1 is the OMAC output of\n" "step N (repeated as required to fill the array).\n\n"); @@ -307,12 +307,12 @@ void omac_gen(void) kl = cipher_descriptor[x].max_key_length; } fprintf(out, "OMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl); - + /* initial key/block */ for (y = 0; y < kl; y++) { key[y] = (y & 255); } - + for (y = 0; y <= (int)(cipher_descriptor[x].block_length*2); y++) { for (z = 0; z < y; z++) { input[z] = (unsigned char)(z & 255); @@ -344,10 +344,10 @@ void pmac_gen(void) int err, x, y, z, kl; FILE *out; unsigned long len; - + out = fopen("pmac_tv.txt", "w"); - fprintf(out, + fprintf(out, "PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are PMAC'ed. The initial key is\n" "of the same format (length specified per cipher). The PMAC key in step N+1 is the PMAC output of\n" "step N (repeated as required to fill the array).\n\n"); @@ -362,12 +362,12 @@ void pmac_gen(void) kl = cipher_descriptor[x].max_key_length; } fprintf(out, "PMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl); - + /* initial key/block */ for (y = 0; y < kl; y++) { key[y] = (y & 255); } - + for (y = 0; y <= (int)(cipher_descriptor[x].block_length*2); y++) { for (z = 0; z < y; z++) { input[z] = (unsigned char)(z & 255); @@ -397,7 +397,7 @@ void eax_gen(void) { int err, kl, x, y1, z; FILE *out; - unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], header[MAXBLOCKSIZE*2], + unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], header[MAXBLOCKSIZE*2], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE]; unsigned long len; @@ -421,7 +421,7 @@ void eax_gen(void) for (z = 0; z < kl; z++) { key[z] = (z & 255); } - + for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){ for (z = 0; z < y1; z++) { plaintext[z] = (unsigned char)(z & 255); @@ -457,7 +457,7 @@ void ocb_gen(void) { int err, kl, x, y1, z; FILE *out; - unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], + unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE]; unsigned long len; @@ -486,7 +486,7 @@ void ocb_gen(void) for (z = 0; z < cipher_descriptor[x].block_length; z++) { nonce[z] = z; } - + for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){ for (z = 0; z < y1; z++) { plaintext[z] = (unsigned char)(z & 255); @@ -520,7 +520,7 @@ void ocb3_gen(void) { int err, kl, x, y1, z; FILE *out; - unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], + unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE]; unsigned long len; @@ -549,7 +549,7 @@ void ocb3_gen(void) for (z = 0; z < cipher_descriptor[x].block_length; z++) { nonce[z] = z; } - + for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){ for (z = 0; z < y1; z++) { plaintext[z] = (unsigned char)(z & 255); @@ -583,7 +583,7 @@ void ccm_gen(void) { int err, kl, x, y1, z; FILE *out; - unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], + unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE]; unsigned long len; @@ -612,7 +612,7 @@ void ccm_gen(void) for (z = 0; z < cipher_descriptor[x].block_length; z++) { nonce[z] = z; } - + for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){ for (z = 0; z < y1; z++) { plaintext[z] = (unsigned char)(z & 255); @@ -669,7 +669,7 @@ void gcm_gen(void) for (z = 0; z < kl; z++) { key[z] = (z & 255); } - + for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){ for (z = 0; z < y1; z++) { plaintext[z] = (unsigned char)(z & 255); @@ -704,7 +704,7 @@ void base64_gen(void) FILE *out; unsigned char dst[256], src[32]; unsigned long x, y, len; - + out = fopen("base64_tv.txt", "w"); fprintf(out, "Base64 vectors. These are the base64 encodings of the strings 00,01,02...NN-1\n\n"); for (x = 0; x <= 32; x++) { @@ -746,7 +746,7 @@ void ecc_gen(void) mp_read_radix(modulus, (char *)ltc_ecc_sets[x].prime, 16); mp_read_radix(G->x, (char *)ltc_ecc_sets[x].Gx, 16); mp_read_radix(G->y, (char *)ltc_ecc_sets[x].Gy, 16); - mp_set(G->z, 1); + mp_set(G->z, 1); while (mp_cmp(k, order) == LTC_MP_LT) { ltc_mp.ecc_ptmul(k, G, R, modulus, 1); @@ -768,7 +768,7 @@ void lrw_gen(void) unsigned char tweak[16], key[16], iv[16], buf[1024]; int x, y, err; symmetric_LRW lrw; - + /* initialize default key and tweak */ for (x = 0; x < 16; x++) { tweak[x] = key[x] = iv[x] = x; @@ -825,7 +825,7 @@ void lrw_gen(void) lrw_done(&lrw); } fclose(out); -} +} int main(void) { From ee4a9477eca4e3dffe8217154facce6f02e4fc49 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Mar 2013 18:34:16 +0200 Subject: [PATCH 0081/1192] update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3054fb5d0..a194dcc29 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ timing.exe # oops ;) but we don't want them to appear in the repository... *.stackdump +*.core # misc *.rej From 57ea144874dfdfd967be2ede453ebd917c3e6f5f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Mar 2013 17:47:23 +0100 Subject: [PATCH 0082/1192] README: add section 'Branches' --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ff2f59ef7..a4f0d5fdd 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,10 @@ Submitting patches Please branch off from develop if you want to submit a patch. +Branches +-------- + +Please be aware, that all branches besides _master_ and _develop_ __can__ and __will be__ force-pushed, rebased and/or removed! + +If you want to rely on such an _unstable_ branch, create your own fork of this repository to make sure nothing breaks for you. From 2addbcf31562b380c388689ffbf8270bf8babeea Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 22 Mar 2013 11:31:41 +0200 Subject: [PATCH 0083/1192] noekeon: fix compiler warning --- src/ciphers/noekeon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index 02869a787..f7ca741fb 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -152,7 +152,7 @@ int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_ke { int err = _noekeon_ecb_encrypt(pt, ct, skey); burn_stack(sizeof(ulong32) * 5 + sizeof(int)); - return CRYPT_OK; + return err; } #endif From 92034727896e3e3e786f9812b08619855e832157 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 22 Mar 2013 13:42:06 +0200 Subject: [PATCH 0084/1192] dsa: fix compiler warning --- src/pk/dsa/dsa_export.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pk/dsa/dsa_export.c b/src/pk/dsa/dsa_export.c index 582e63bb7..7bb355852 100644 --- a/src/pk/dsa/dsa_export.c +++ b/src/pk/dsa/dsa_export.c @@ -27,7 +27,6 @@ */ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key) { - unsigned char flags[1]; unsigned long zero=0; int err; From 14b3a5290e07c8cb4422bfed83ac7b768cf76786 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 22 Mar 2013 13:42:29 +0200 Subject: [PATCH 0085/1192] include stddef.h per default --- src/headers/tomcrypt.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index da5e4f9ac..3b4232bf1 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include From e531af7add5fbab8686c47c3501eb36a65b26174 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 22 Mar 2013 13:45:36 +0200 Subject: [PATCH 0086/1192] ecc: fix compiler warnings --- src/pk/ecc/ltc_ecc_mul2add.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/ecc/ltc_ecc_mul2add.c b/src/pk/ecc/ltc_ecc_mul2add.c index e5174a4c6..a6d1aab8a 100644 --- a/src/pk/ecc/ltc_ecc_mul2add.c +++ b/src/pk/ecc/ltc_ecc_mul2add.c @@ -40,9 +40,9 @@ int ltc_ecc_mul2add(ecc_point *A, void *kA, void *modulus) { ecc_point *precomp[16]; - unsigned bitbufA, bitbufB, lenA, lenB, len, y, nA, nB, nibble; + unsigned bitbufA, bitbufB, lenA, lenB, len, x, y, nA, nB, nibble; unsigned char *tA, *tB; - int err, first, x; + int err, first; void *mp, *mu; /* argchks */ From fa7051c21e5e90e6fa800e3a32877469229fa5c0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 2 Jul 2012 12:05:48 +0200 Subject: [PATCH 0087/1192] xtea: trim trailing spaces --- src/ciphers/xtea.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index d907e54e3..358df5ae7 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -34,7 +34,7 @@ const struct ltc_cipher_descriptor xtea_desc = int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) { unsigned long x, sum, K[4]; - + LTC_ARGCHK(key != NULL); LTC_ARGCHK(skey != NULL); @@ -52,17 +52,17 @@ int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_k LOAD32L(K[1], key+4); LOAD32L(K[2], key+8); LOAD32L(K[3], key+12); - + for (x = sum = 0; x < 32; x++) { skey->xtea.A[x] = (sum + K[sum&3]) & 0xFFFFFFFFUL; sum = (sum + 0x9E3779B9UL) & 0xFFFFFFFFUL; skey->xtea.B[x] = (sum + K[(sum>>11)&3]) & 0xFFFFFFFFUL; } - + #ifdef LTC_CLEAN_STACK zeromem(&K, sizeof(K)); -#endif - +#endif + return CRYPT_OK; } @@ -106,7 +106,7 @@ int xtea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key * Decrypts a block of text with LTC_XTEA @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ int xtea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -146,13 +146,13 @@ int xtea_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else - static const unsigned char key[16] = + #else + static const unsigned char key[16] = { 0x78, 0x56, 0x34, 0x12, 0xf0, 0xcd, 0xcb, 0x9a, 0x48, 0x37, 0x26, 0x15, 0xc0, 0xbf, 0xae, 0x9d }; - static const unsigned char pt[8] = + static const unsigned char pt[8] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; - static const unsigned char ct[8] = + static const unsigned char ct[8] = { 0x75, 0xd7, 0xc5, 0xbf, 0xcf, 0x58, 0xc9, 0x3f }; unsigned char tmp[2][8]; symmetric_key skey; @@ -164,7 +164,7 @@ int xtea_test(void) xtea_ecb_encrypt(pt, tmp[0], &skey); xtea_ecb_decrypt(tmp[0], tmp[1], &skey); - if (XMEMCMP(tmp[0], ct, 8) != 0 || XMEMCMP(tmp[1], pt, 8) != 0) { + if (XMEMCMP(tmp[0], ct, 8) != 0 || XMEMCMP(tmp[1], pt, 8) != 0) { return CRYPT_FAIL_TESTVECTOR; } @@ -178,7 +178,7 @@ int xtea_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void xtea_done(symmetric_key *skey) @@ -194,7 +194,7 @@ int xtea_keysize(int *keysize) { LTC_ARGCHK(keysize != NULL); if (*keysize < 16) { - return CRYPT_INVALID_KEYSIZE; + return CRYPT_INVALID_KEYSIZE; } *keysize = 16; return CRYPT_OK; From 1050ecea4a8ab346add433dc86cd8beefc6181e1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 2 Jul 2012 14:17:53 +0200 Subject: [PATCH 0088/1192] demos/encrypt.c: add possibility to use parameter -t for testing a cipher --- demos/encrypt.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/demos/encrypt.c b/demos/encrypt.c index f650429de..f52c9d834 100644 --- a/demos/encrypt.c +++ b/demos/encrypt.c @@ -15,7 +15,9 @@ int usage(char *name) { int x; - printf("Usage: %s [-d](ecrypt) cipher infile outfile\nCiphers:\n", name); + printf("Usage encrypt: %s cipher infile outfile\n", name); + printf("Usage decrypt: %s -d cipher infile outfile\n", name); + printf("Usage test: %s -t cipher\nCiphers:\n", name); for (x = 0; cipher_descriptor[x].name != NULL; x++) { printf("%s\n",cipher_descriptor[x].name); } @@ -108,6 +110,27 @@ int main(int argc, char *argv[]) register_algs(); if (argc < 4) { + if ((argc > 2) && (!strcmp(argv[1], "-t"))) { + cipher = argv[2]; + cipher_idx = find_cipher(cipher); + if (cipher_idx == -1) { + printf("Invalid cipher %s entered on command line.\n", cipher); + exit(-1); + } /* if */ + if (cipher_descriptor[cipher_idx].test) + { + if (cipher_descriptor[cipher_idx].test() != CRYPT_OK) + { + printf("Error when testing cipher %s.\n", cipher); + exit(-1); + } + else + { + printf("Testing cipher %s succeeded.\n", cipher); + exit(0); + } /* if ... else */ + } /* if */ + } return usage(argv[0]); } From 0f0b182610ebcb6e29b15e489623ddb15bf6ccf2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 2 Jul 2012 15:10:55 +0200 Subject: [PATCH 0089/1192] xtea: add new testvectors --- src/ciphers/xtea.c | 102 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 84 insertions(+), 18 deletions(-) diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index 358df5ae7..761d65774 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -147,32 +147,98 @@ int xtea_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - static const unsigned char key[16] = - { 0x78, 0x56, 0x34, 0x12, 0xf0, 0xcd, 0xcb, 0x9a, - 0x48, 0x37, 0x26, 0x15, 0xc0, 0xbf, 0xae, 0x9d }; - static const unsigned char pt[8] = - { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; - static const unsigned char ct[8] = - { 0x75, 0xd7, 0xc5, 0xbf, 0xcf, 0x58, 0xc9, 0x3f }; + static const struct { + unsigned char key[16], pt[8], ct[8]; + } tests[] = { + { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xde, 0xe9, 0xd4, 0xd8, 0xf7, 0x13, 0x1e, 0xd9 } + }, { + { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xa5, 0x97, 0xab, 0x41, 0x76, 0x01, 0x4d, 0x72 } + }, { + { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06 }, + { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02 }, + { 0xb1, 0xfd, 0x5d, 0xa9, 0xcc, 0x6d, 0xc9, 0xdc } + }, { + { 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f, + 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, + { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, + { 0x70, 0x4b, 0x31, 0x34, 0x47, 0x44, 0xdf, 0xab } + }, { + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 }, + { 0x49, 0x7d, 0xf3, 0xd0, 0x72, 0x61, 0x2c, 0xb5 } + }, { + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }, + { 0xe7, 0x8f, 0x2d, 0x13, 0x74, 0x43, 0x41, 0xd8 } + }, { + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + { 0x5a, 0x5b, 0x6e, 0x27, 0x89, 0x48, 0xd7, 0x7f }, + { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 } + }, { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 }, + { 0xa0, 0x39, 0x05, 0x89, 0xf8, 0xb8, 0xef, 0xa5 } + }, { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }, + { 0xed, 0x23, 0x37, 0x5a, 0x82, 0x1a, 0x8c, 0x2d } + }, { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x70, 0xe1, 0x22, 0x5d, 0x6e, 0x4e, 0x76, 0x55 }, + { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 } + } + }; unsigned char tmp[2][8]; symmetric_key skey; - int err, y; - - if ((err = xtea_setup(key, 16, 0, &skey)) != CRYPT_OK) { - return err; - } - xtea_ecb_encrypt(pt, tmp[0], &skey); - xtea_ecb_decrypt(tmp[0], tmp[1], &skey); - - if (XMEMCMP(tmp[0], ct, 8) != 0 || XMEMCMP(tmp[1], pt, 8) != 0) { - return CRYPT_FAIL_TESTVECTOR; - } + int i, err, y; + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { + zeromem(&skey, sizeof(skey)); + if ((err = xtea_setup(tests[i].key, 16, 0, &skey)) != CRYPT_OK) { + return err; + } + xtea_ecb_encrypt(tests[i].pt, tmp[0], &skey); + xtea_ecb_decrypt(tmp[0], tmp[1], &skey); + + if (XMEMCMP(tmp[0], tests[i].ct, 8) != 0 || XMEMCMP(tmp[1], tests[i].pt, 8) != 0) { +#if 0 + printf("\n\nTest %d failed\n", i); + if (XMEMCMP(tmp[0], tests[i].ct, 8)) { + printf("CT: "); + for (i = 0; i < 8; i++) { + printf("%02x ", tmp[0][i]); + } + printf("\n"); + } else { + printf("PT: "); + for (i = 0; i < 8; i++) { + printf("%02x ", tmp[1][i]); + } + printf("\n"); + } +#endif + return CRYPT_FAIL_TESTVECTOR; + } /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ for (y = 0; y < 8; y++) tmp[0][y] = 0; for (y = 0; y < 1000; y++) xtea_ecb_encrypt(tmp[0], tmp[0], &skey); for (y = 0; y < 1000; y++) xtea_ecb_decrypt(tmp[0], tmp[0], &skey); for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; + } /* for */ return CRYPT_OK; #endif From 2526d5df8f9a228cf20ba90982aed4a5e951ac5f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 2 Jul 2012 15:11:30 +0200 Subject: [PATCH 0090/1192] xtea: use correct load and store macros --- src/ciphers/xtea.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index 761d65774..915589210 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -48,10 +48,10 @@ int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_k } /* load key */ - LOAD32L(K[0], key+0); - LOAD32L(K[1], key+4); - LOAD32L(K[2], key+8); - LOAD32L(K[3], key+12); + LOAD32H(K[0], key+0); + LOAD32H(K[1], key+4); + LOAD32H(K[2], key+8); + LOAD32H(K[3], key+12); for (x = sum = 0; x < 32; x++) { skey->xtea.A[x] = (sum + K[sum&3]) & 0xFFFFFFFFUL; @@ -82,8 +82,8 @@ int xtea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key * LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - LOAD32L(y, &pt[0]); - LOAD32L(z, &pt[4]); + LOAD32H(y, &pt[0]); + LOAD32H(z, &pt[4]); for (r = 0; r < 32; r += 4) { y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r])) & 0xFFFFFFFFUL; z = (z + ((((y<<4)^(y>>5)) + y) ^ skey->xtea.B[r])) & 0xFFFFFFFFUL; @@ -97,8 +97,8 @@ int xtea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key * y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r+3])) & 0xFFFFFFFFUL; z = (z + ((((y<<4)^(y>>5)) + y) ^ skey->xtea.B[r+3])) & 0xFFFFFFFFUL; } - STORE32L(y, &ct[0]); - STORE32L(z, &ct[4]); + STORE32H(y, &ct[0]); + STORE32H(z, &ct[4]); return CRYPT_OK; } @@ -118,8 +118,8 @@ int xtea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key * LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - LOAD32L(y, &ct[0]); - LOAD32L(z, &ct[4]); + LOAD32H(y, &ct[0]); + LOAD32H(z, &ct[4]); for (r = 31; r >= 0; r -= 4) { z = (z - ((((y<<4)^(y>>5)) + y) ^ skey->xtea.B[r])) & 0xFFFFFFFFUL; y = (y - ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r])) & 0xFFFFFFFFUL; @@ -133,8 +133,8 @@ int xtea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key * z = (z - ((((y<<4)^(y>>5)) + y) ^ skey->xtea.B[r-3])) & 0xFFFFFFFFUL; y = (y - ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r-3])) & 0xFFFFFFFFUL; } - STORE32L(y, &pt[0]); - STORE32L(z, &pt[4]); + STORE32H(y, &pt[0]); + STORE32H(z, &pt[4]); return CRYPT_OK; } From bfcf1eb200759332ada65478edac809e81acfce8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 26 Jul 2012 14:43:15 +0200 Subject: [PATCH 0091/1192] trim trailing spaces in header files --- src/headers/tomcrypt_argchk.h | 2 +- src/headers/tomcrypt_cfg.h | 6 +- src/headers/tomcrypt_cipher.h | 136 +++++++++++++++++----------------- src/headers/tomcrypt_custom.h | 32 ++++---- src/headers/tomcrypt_hash.h | 8 +- src/headers/tomcrypt_mac.h | 66 ++++++++--------- src/headers/tomcrypt_macros.h | 10 +-- src/headers/tomcrypt_math.h | 90 +++++++++++----------- src/headers/tomcrypt_misc.h | 4 +- src/headers/tomcrypt_pk.h | 98 ++++++++++++------------ src/headers/tomcrypt_pkcs.h | 18 ++--- src/headers/tomcrypt_prng.h | 14 ++-- 12 files changed, 242 insertions(+), 242 deletions(-) diff --git a/src/headers/tomcrypt_argchk.h b/src/headers/tomcrypt_argchk.h index c4014b8f0..f0994e40a 100644 --- a/src/headers/tomcrypt_argchk.h +++ b/src/headers/tomcrypt_argchk.h @@ -22,7 +22,7 @@ void crypt_argchk(char *v, char *s, int d); #elif ARGTYPE == 3 -#define LTC_ARGCHK(x) +#define LTC_ARGCHK(x) #define LTC_ARGCHKVD(x) LTC_ARGCHK(x) #elif ARGTYPE == 4 diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index cc3b6dff5..4533ada5c 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -48,8 +48,8 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define ARGTYPE 0 #endif -/* Controls endianess and size of registers. Leave uncommented to get platform neutral [slower] code - * +/* Controls endianess and size of registers. Leave uncommented to get platform neutral [slower] code + * * Note: in order to use the optimized macros your platform must support unaligned 32 and 64 bit read/writes. * The x86 platforms allow this but some others [ARM for instance] do not. On those platforms you **MUST** * use the portable [slower] macros. @@ -83,7 +83,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define ENDIAN_32BITWORD #define LTC_FAST #define LTC_FAST_TYPE unsigned long -#endif +#endif /* detect sparc and sparc64 */ #if defined(__sparc__) diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index 398c734f7..f19ec866b 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -1,6 +1,6 @@ /* ---- SYMMETRIC KEY STUFF ----- * - * We put each of the ciphers scheduled keys in their own structs then we put all of + * We put each of the ciphers scheduled keys in their own structs then we put all of * the key formats in one union. This makes the function prototypes easier to use. */ #ifdef LTC_BLOWFISH @@ -109,7 +109,7 @@ struct noekeon_key { }; #endif -#ifdef LTC_SKIPJACK +#ifdef LTC_SKIPJACK struct skipjack_key { unsigned char key[10]; }; @@ -117,18 +117,18 @@ struct skipjack_key { #ifdef LTC_KHAZAD struct khazad_key { - ulong64 roundKeyEnc[8 + 1]; - ulong64 roundKeyDec[8 + 1]; + ulong64 roundKeyEnc[8 + 1]; + ulong64 roundKeyDec[8 + 1]; }; #endif #ifdef LTC_ANUBIS -struct anubis_key { - int keyBits; - int R; - ulong32 roundKeyEnc[18 + 1][4]; - ulong32 roundKeyDec[18 + 1][4]; -}; +struct anubis_key { + int keyBits; + int R; + ulong32 roundKeyEnc[18 + 1][4]; + ulong32 roundKeyDec[18 + 1][4]; +}; #endif #ifdef LTC_MULTI2 @@ -182,7 +182,7 @@ typedef union Symmetric_key { #endif #ifdef LTC_NOEKEON struct noekeon_key noekeon; -#endif +#endif #ifdef LTC_SKIPJACK struct skipjack_key skipjack; #endif @@ -197,7 +197,7 @@ typedef union Symmetric_key { #endif #ifdef LTC_KASUMI struct kasumi_key kasumi; -#endif +#endif #ifdef LTC_MULTI2 struct multi2_key multi2; #endif @@ -211,10 +211,10 @@ typedef union Symmetric_key { /** A block cipher ECB structure */ typedef struct { /** The index of the cipher chosen */ - int cipher, + int cipher, /** The block size of the given cipher */ blocklen; - /** The scheduled key */ + /** The scheduled key */ symmetric_key key; } symmetric_ECB; #endif @@ -223,14 +223,14 @@ typedef struct { /** A block cipher CFB structure */ typedef struct { /** The index of the cipher chosen */ - int cipher, - /** The block size of the given cipher */ - blocklen, + int cipher, + /** The block size of the given cipher */ + blocklen, /** The padding offset */ padlen; /** The current IV */ - unsigned char IV[MAXBLOCKSIZE], - /** The pad used to encrypt/decrypt */ + unsigned char IV[MAXBLOCKSIZE], + /** The pad used to encrypt/decrypt */ pad[MAXBLOCKSIZE]; /** The scheduled key */ symmetric_key key; @@ -241,9 +241,9 @@ typedef struct { /** A block cipher OFB structure */ typedef struct { /** The index of the cipher chosen */ - int cipher, - /** The block size of the given cipher */ - blocklen, + int cipher, + /** The block size of the given cipher */ + blocklen, /** The padding offset */ padlen; /** The current IV */ @@ -257,8 +257,8 @@ typedef struct { /** A block cipher CBC structure */ typedef struct { /** The index of the cipher chosen */ - int cipher, - /** The block size of the given cipher */ + int cipher, + /** The block size of the given cipher */ blocklen; /** The current IV */ unsigned char IV[MAXBLOCKSIZE]; @@ -273,18 +273,18 @@ typedef struct { typedef struct { /** The index of the cipher chosen */ int cipher, - /** The block size of the given cipher */ - blocklen, + /** The block size of the given cipher */ + blocklen, /** The padding offset */ - padlen, + padlen, /** The mode (endianess) of the CTR, 0==little, 1==big */ mode, /** counter width */ ctrlen; - /** The counter */ - unsigned char ctr[MAXBLOCKSIZE], - /** The pad used to encrypt/decrypt */ + /** The counter */ + unsigned char ctr[MAXBLOCKSIZE], + /** The pad used to encrypt/decrypt */ pad[MAXBLOCKSIZE]; /** The scheduled key */ symmetric_key key; @@ -300,7 +300,7 @@ typedef struct { /** The current IV */ unsigned char IV[16], - + /** the tweak key */ tweak[16], @@ -321,9 +321,9 @@ typedef struct { /** A block cipher F8 structure */ typedef struct { /** The index of the cipher chosen */ - int cipher, - /** The block size of the given cipher */ - blocklen, + int cipher, + /** The block size of the given cipher */ + blocklen, /** The padding offset */ padlen; /** The current IV */ @@ -344,14 +344,14 @@ extern struct ltc_cipher_descriptor { /** internal ID */ unsigned char ID; /** min keysize (octets) */ - int min_key_length, + int min_key_length, /** max keysize (octets) */ - max_key_length, + max_key_length, /** block size (octets) */ - block_length, + block_length, /** default number of rounds */ default_rounds; - /** Setup the cipher + /** Setup the cipher @param key The input symmetric key @param keylen The length of the input key (octets) @param num_rounds The requested number of rounds (0==default) @@ -378,10 +378,10 @@ extern struct ltc_cipher_descriptor { */ int (*test)(void); - /** Terminate the context + /** Terminate the context @param skey The scheduled key */ - void (*done)(symmetric_key *skey); + void (*done)(symmetric_key *skey); /** Determine a key size @param keysize [in/out] The size of the key desired and the suggested size @@ -390,7 +390,7 @@ extern struct ltc_cipher_descriptor { int (*keysize)(int *keysize); /** Accelerators **/ - /** Accelerated ECB encryption + /** Accelerated ECB encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -399,7 +399,7 @@ extern struct ltc_cipher_descriptor { */ int (*accel_ecb_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, symmetric_key *skey); - /** Accelerated ECB decryption + /** Accelerated ECB decryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -408,7 +408,7 @@ extern struct ltc_cipher_descriptor { */ int (*accel_ecb_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, symmetric_key *skey); - /** Accelerated CBC encryption + /** Accelerated CBC encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -418,7 +418,7 @@ extern struct ltc_cipher_descriptor { */ int (*accel_cbc_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, symmetric_key *skey); - /** Accelerated CBC decryption + /** Accelerated CBC decryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -428,7 +428,7 @@ extern struct ltc_cipher_descriptor { */ int (*accel_cbc_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, unsigned char *IV, symmetric_key *skey); - /** Accelerated CTR encryption + /** Accelerated CTR encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -439,7 +439,7 @@ extern struct ltc_cipher_descriptor { */ int (*accel_ctr_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, int mode, symmetric_key *skey); - /** Accelerated LRW + /** Accelerated LRW @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -450,7 +450,7 @@ extern struct ltc_cipher_descriptor { */ int (*accel_lrw_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, const unsigned char *tweak, symmetric_key *skey); - /** Accelerated LRW + /** Accelerated LRW @param ct Ciphertext @param pt Plaintext @param blocks The number of complete blocks to process @@ -490,7 +490,7 @@ extern struct ltc_cipher_descriptor { /** Accelerated GCM packet (one shot) @param key The secret key @param keylen The length of the secret key - @param IV The initial vector + @param IV The initial vector @param IVlen The length of the initial vector @param adata The additional authentication data (header) @param adatalen The length of the adata @@ -507,14 +507,14 @@ extern struct ltc_cipher_descriptor { const unsigned char *IV, unsigned long IVlen, const unsigned char *adata, unsigned long adatalen, unsigned char *pt, unsigned long ptlen, - unsigned char *ct, + unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction); - /** Accelerated one shot LTC_OMAC + /** Accelerated one shot LTC_OMAC @param key The secret key - @param keylen The key length (octets) - @param in The message + @param keylen The key length (octets) + @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @@ -525,10 +525,10 @@ extern struct ltc_cipher_descriptor { const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); - /** Accelerated one shot XCBC + /** Accelerated one shot XCBC @param key The secret key - @param keylen The key length (octets) - @param in The message + @param keylen The key length (octets) + @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @@ -539,10 +539,10 @@ extern struct ltc_cipher_descriptor { const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); - /** Accelerated one shot F9 + /** Accelerated one shot F9 @param key The secret key - @param keylen The key length (octets) - @param in The message + @param keylen The key length (octets) + @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @@ -777,7 +777,7 @@ extern const struct ltc_cipher_descriptor camellia_desc; #endif #ifdef LTC_ECB_MODE -int ecb_start(int cipher, const unsigned char *key, +int ecb_start(int cipher, const unsigned char *key, int keylen, int num_rounds, symmetric_ECB *ecb); int ecb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_ECB *ecb); int ecb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_ECB *ecb); @@ -785,7 +785,7 @@ int ecb_done(symmetric_ECB *ecb); #endif #ifdef LTC_CFB_MODE -int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, +int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, int keylen, int num_rounds, symmetric_CFB *cfb); int cfb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CFB *cfb); int cfb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CFB *cfb); @@ -795,7 +795,7 @@ int cfb_done(symmetric_CFB *cfb); #endif #ifdef LTC_OFB_MODE -int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, +int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, int keylen, int num_rounds, symmetric_OFB *ofb); int ofb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_OFB *ofb); int ofb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_OFB *ofb); @@ -842,7 +842,7 @@ int lrw_start( int cipher, const unsigned char *IV, const unsigned char *key, int keylen, const unsigned char *tweak, - int num_rounds, + int num_rounds, symmetric_LRW *lrw); int lrw_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_LRW *lrw); int lrw_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_LRW *lrw); @@ -853,11 +853,11 @@ int lrw_test(void); /* don't call */ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, int mode, symmetric_LRW *lrw); -#endif +#endif #ifdef LTC_F8_MODE -int f8_start( int cipher, const unsigned char *IV, - const unsigned char *key, int keylen, +int f8_start( int cipher, const unsigned char *IV, + const unsigned char *key, int keylen, const unsigned char *salt_key, int skeylen, int num_rounds, symmetric_F8 *f8); int f8_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_F8 *f8); @@ -875,10 +875,10 @@ typedef struct { } symmetric_xts; int xts_start( int cipher, - const unsigned char *key1, - const unsigned char *key2, + const unsigned char *key1, + const unsigned char *key2, unsigned long keylen, - int num_rounds, + int num_rounds, symmetric_xts *xts); int xts_encrypt( diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 2e4774497..1401f95ef 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -3,19 +3,19 @@ /* macros for various libc functions you can change for embedded targets */ #ifndef XMALLOC - #ifdef malloc + #ifdef malloc #define LTC_NO_PROTOTYPES #endif #define XMALLOC malloc #endif #ifndef XREALLOC - #ifdef realloc + #ifdef realloc #define LTC_NO_PROTOTYPES #endif #define XREALLOC realloc #endif #ifndef XCALLOC - #ifdef calloc + #ifdef calloc #define LTC_NO_PROTOTYPES #endif #define XCALLOC calloc @@ -40,7 +40,7 @@ #define XMEMCPY memcpy #endif #ifndef XMEMCMP - #ifdef memcmp + #ifdef memcmp #define LTC_NO_PROTOTYPES #endif #define XMEMCMP memcmp @@ -73,19 +73,19 @@ #define LTC_BLOWFISH #define LTC_DES #define LTC_CAST5 - + #define LTC_NO_MODES #define LTC_ECB_MODE #define LTC_CBC_MODE #define LTC_CTR_MODE - + #define LTC_NO_HASHES #define LTC_SHA1 #define LTC_SHA512 #define LTC_SHA384 #define LTC_SHA256 #define LTC_SHA224 - + #define LTC_NO_MACS #define LTC_HMAC #define LTC_OMAC @@ -96,11 +96,11 @@ #define LTC_YARROW #define LTC_DEVRANDOM #define TRY_URANDOM_FIRST - + #define LTC_NO_PK #define LTC_MRSA #define LTC_MECC -#endif +#endif /* Use small code where possible */ /* #define LTC_SMALL_CODE */ @@ -178,7 +178,7 @@ #define LTC_LRW_MODE #ifndef LTC_NO_TABLES /* like GCM mode this will enable 16 8x128 tables [64KB] that make - * seeking very fast. + * seeking very fast. */ #define LRW_TABLES #endif @@ -189,7 +189,7 @@ #endif /* LTC_NO_MODES */ /* ---> One-Way Hash Functions <--- */ -#ifndef LTC_NO_HASHES +#ifndef LTC_NO_HASHES #define LTC_CHC_HASH #define LTC_WHIRLPOOL @@ -237,7 +237,7 @@ /* Use 64KiB tables */ #ifndef LTC_NO_TABLES - #define LTC_GCM_TABLES + #define LTC_GCM_TABLES #endif /* USE SSE2? requires GCC works on x86_32 and x86_64*/ @@ -331,7 +331,7 @@ #endif /* Include Katja (a Rabin variant like RSA) */ -/* #define MKAT */ +/* #define MKAT */ /* Digital Signature Algorithm */ #define LTC_MDSA @@ -344,7 +344,7 @@ #if defined(TFM_LTC_DESC) && defined(LTC_MECC) #define LTC_MECC_ACCEL -#endif +#endif /* do we want fixed point ECC */ /* #define LTC_MECC_FP */ @@ -395,14 +395,14 @@ #ifdef LTC_MRSA #define LTC_PKCS_1 -#endif +#endif #if defined(TFM_DESC) && defined(LTC_RSA_BLINDING) #warning RSA blinding currently not supported in combination with TFM #undef LTC_RSA_BLINDING #endif -#if defined(LTC_DER) && !defined(MPI) +#if defined(LTC_DER) && !defined(MPI) #error ASN.1 DER requires MPI functionality #endif diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index a29a69f5a..146dcbcf2 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -166,7 +166,7 @@ extern struct ltc_hash_descriptor { @return CRYPT_OK if successful */ int (*init)(hash_state *hash); - /** Process a block of data + /** Process a block of data @param hash The hash state @param in The data to hash @param inlen The length of the data (octets) @@ -186,7 +186,7 @@ extern struct ltc_hash_descriptor { /* accelerated hmac callback: if you need to-do multiple packets just use the generic hmac_memory and provide a hash callback */ int (*hmac_block)(const unsigned char *key, unsigned long keylen, - const unsigned char *in, unsigned long inlen, + const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); } hash_descriptor[]; @@ -329,8 +329,8 @@ int hash_is_valid(int idx); LTC_MUTEX_PROTO(ltc_hash_mutex) -int hash_memory(int hash, - const unsigned char *in, unsigned long inlen, +int hash_memory(int hash, + const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...); diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 2cd3ef05e..7ec662a0e 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -10,23 +10,23 @@ int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned lon int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen); int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen); int hmac_test(void); -int hmac_memory(int hash, +int hmac_memory(int hash, const unsigned char *key, unsigned long keylen, - const unsigned char *in, unsigned long inlen, + const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); -int hmac_memory_multi(int hash, +int hmac_memory_multi(int hash, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...); int hmac_file(int hash, const char *fname, const unsigned char *key, - unsigned long keylen, + unsigned long keylen, unsigned char *dst, unsigned long *dstlen); #endif #ifdef LTC_OMAC typedef struct { - int cipher_idx, + int cipher_idx, buflen, blklen; unsigned char block[MAXBLOCKSIZE], @@ -38,17 +38,17 @@ typedef struct { int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen); int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen); int omac_done(omac_state *omac, unsigned char *out, unsigned long *outlen); -int omac_memory(int cipher, +int omac_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); -int omac_memory_multi(int cipher, +int omac_memory_multi(int cipher, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...); -int omac_file(int cipher, +int omac_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen); int omac_test(void); #endif /* LTC_OMAC */ @@ -73,19 +73,19 @@ int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned l int pmac_process(pmac_state *pmac, const unsigned char *in, unsigned long inlen); int pmac_done(pmac_state *pmac, unsigned char *out, unsigned long *outlen); -int pmac_memory(int cipher, +int pmac_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *msg, unsigned long msglen, unsigned char *out, unsigned long *outlen); -int pmac_memory_multi(int cipher, +int pmac_memory_multi(int cipher, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...); -int pmac_file(int cipher, +int pmac_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen); int pmac_test(void); @@ -152,32 +152,32 @@ typedef struct { block_len; /* length of block */ } ocb_state; -int ocb_init(ocb_state *ocb, int cipher, +int ocb_init(ocb_state *ocb, int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *nonce); int ocb_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned char *ct); int ocb_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned char *pt); -int ocb_done_encrypt(ocb_state *ocb, +int ocb_done_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, - unsigned char *ct, + unsigned char *ct, unsigned char *tag, unsigned long *taglen); -int ocb_done_decrypt(ocb_state *ocb, +int ocb_done_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned long ctlen, - unsigned char *pt, + unsigned char *pt, const unsigned char *tag, unsigned long taglen, int *stat); int ocb_encrypt_authenticate_memory(int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, + const unsigned char *nonce, const unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tag, unsigned long *taglen); int ocb_decrypt_verify_memory(int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, + const unsigned char *nonce, const unsigned char *ct, unsigned long ctlen, unsigned char *pt, const unsigned char *tag, unsigned long taglen, @@ -305,7 +305,7 @@ extern const unsigned char gcm_shift_table[]; #define LTC_GCM_MODE_AAD 1 #define LTC_GCM_MODE_TEXT 2 -typedef struct { +typedef struct { symmetric_key K; unsigned char H[16], /* multiplier */ X[16], /* accumulator */ @@ -327,7 +327,7 @@ typedef struct { __attribute__ ((aligned (16))) #endif ; -#endif +#endif } gcm_state; void gcm_mult_h(gcm_state *gcm, unsigned char *I); @@ -337,7 +337,7 @@ int gcm_init(gcm_state *gcm, int cipher, int gcm_reset(gcm_state *gcm); -int gcm_add_iv(gcm_state *gcm, +int gcm_add_iv(gcm_state *gcm, const unsigned char *IV, unsigned long IVlen); int gcm_add_aad(gcm_state *gcm, @@ -348,7 +348,7 @@ int gcm_process(gcm_state *gcm, unsigned char *ct, int direction); -int gcm_done(gcm_state *gcm, +int gcm_done(gcm_state *gcm, unsigned char *tag, unsigned long *taglen); int gcm_memory( int cipher, @@ -356,7 +356,7 @@ int gcm_memory( int cipher, const unsigned char *IV, unsigned long IVlen, const unsigned char *adata, unsigned long adatalen, unsigned char *pt, unsigned long ptlen, - unsigned char *ct, + unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction); int gcm_test(void); @@ -402,17 +402,17 @@ typedef struct { int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen); int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen); int xcbc_done(xcbc_state *xcbc, unsigned char *out, unsigned long *outlen); -int xcbc_memory(int cipher, +int xcbc_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); -int xcbc_memory_multi(int cipher, +int xcbc_memory_multi(int cipher, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...); -int xcbc_file(int cipher, +int xcbc_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen); int xcbc_test(void); @@ -436,17 +436,17 @@ typedef struct { int f9_init(f9_state *f9, int cipher, const unsigned char *key, unsigned long keylen); int f9_process(f9_state *f9, const unsigned char *in, unsigned long inlen); int f9_done(f9_state *f9, unsigned char *out, unsigned long *outlen); -int f9_memory(int cipher, +int f9_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); -int f9_memory_multi(int cipher, +int f9_memory_multi(int cipher, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...); -int f9_file(int cipher, +int f9_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen); int f9_test(void); diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 86156ccef..d56764fcf 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -7,8 +7,8 @@ typedef unsigned long long ulong64; #endif -/* this is the "32-bit at least" data type - * Re-define it to suit your platform but it must be at least 32-bits +/* this is the "32-bit at least" data type + * Re-define it to suit your platform but it must be at least 32-bits */ #if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) typedef unsigned ulong32; @@ -148,7 +148,7 @@ asm __volatile__ ( \ #endif -#ifdef ENDIAN_32BITWORD +#ifdef ENDIAN_32BITWORD #define STORE32L(x, y) \ { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } @@ -209,7 +209,7 @@ asm __volatile__ ( \ (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16) | \ (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } -#ifdef ENDIAN_32BITWORD +#ifdef ENDIAN_32BITWORD #define STORE32H(x, y) \ { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } @@ -436,7 +436,7 @@ static inline unsigned long ROR64c(unsigned long word, const int i) #define byte(x, n) ((unsigned char)((x) >> (8 * (n)))) #else #define byte(x, n) (((x) >> (8 * (n))) & 255) -#endif +#endif /* $Source$ */ /* $Revision$ */ diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 3158c4ae8..bd0782170 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -30,15 +30,15 @@ typedef struct { @return CRYPT_OK on success */ int (*init)(void **a); - - /** init copy + + /** init copy @param dst The number to initialize and write to @param src The number to copy from @return CRYPT_OK on success */ int (*init_copy)(void **dst, void *src); - /** deinit + /** deinit @param a The number to free @return CRYPT_OK on success */ @@ -52,30 +52,30 @@ typedef struct { @return CRYPT_OK on success */ int (*neg)(void *src, void *dst); - - /** copy + + /** copy @param src The number to copy from - @param dst The number to write to + @param dst The number to write to @return CRYPT_OK on success */ int (*copy)(void *src, void *dst); /* ---- trivial low level functions ---- */ - /** set small constant + /** set small constant @param a Number to write to - @param n Source upto bits_per_digit (actually meant for very small constants) + @param n Source upto bits_per_digit (actually meant for very small constants) @return CRYPT_OK on succcess */ int (*set_int)(void *a, unsigned long n); - /** get small constant + /** get small constant @param a Number to read, only fetches upto bits_per_digit from the number @return The lower bits_per_digit of the integer (unsigned) */ unsigned long (*get_int)(void *a); - /** get digit n + /** get digit n @param a The number to read from @param n The number of the digit to fetch @return The bits_per_digit sized n'th digit of a @@ -95,7 +95,7 @@ typedef struct { */ int (*compare)(void *a, void *b); - /** compare against int + /** compare against int @param a The left side integer @param b The right side integer (upto bits_per_digit) @return LTC_MP_LT if a < b, LTC_MP_GT if a > b and LTC_MP_EQ otherwise. (signed comparison) @@ -108,7 +108,7 @@ typedef struct { */ int (*count_bits)(void * a); - /** Count the number of LSB bits which are zero + /** Count the number of LSB bits which are zero @param a The integer to count @return The number of contiguous zero LSB bits */ @@ -122,8 +122,8 @@ typedef struct { int (*twoexpt)(void *a , int n); /* ---- radix conversions ---- */ - - /** read ascii string + + /** read ascii string @param a The integer to store into @param str The string to read @param radix The radix the integer has been represented in (2-64) @@ -139,13 +139,13 @@ typedef struct { */ int (*write_radix)(void *a, char *str, int radix); - /** get size as unsigned char string + /** get size as unsigned char string @param a The integer to get the size (when stored in array of octets) @return The length of the integer */ unsigned long (*unsigned_size)(void *a); - /** store an integer as an array of octets + /** store an integer as an array of octets @param src The integer to store @param dst The buffer to store the integer in @return CRYPT_OK on success @@ -154,15 +154,15 @@ typedef struct { /** read an array of octets and store as integer @param dst The integer to load - @param src The array of octets - @param len The number of octets + @param src The array of octets + @param len The number of octets @return CRYPT_OK on success */ int (*unsigned_read)(void *dst, unsigned char *src, unsigned long len); /* ---- basic math ---- */ - /** add two integers + /** add two integers @param a The first source integer @param b The second source integer @param c The destination of "a + b" @@ -171,7 +171,7 @@ typedef struct { int (*add)(void *a, void *b, void *c); - /** add two integers + /** add two integers @param a The first source integer @param b The second source integer (single digit of upto bits_per_digit in length) @param c The destination of "a + b" @@ -179,7 +179,7 @@ typedef struct { */ int (*addi)(void *a, unsigned long b, void *c); - /** subtract two integers + /** subtract two integers @param a The first source integer @param b The second source integer @param c The destination of "a - b" @@ -187,7 +187,7 @@ typedef struct { */ int (*sub)(void *a, void *b, void *c); - /** subtract two integers + /** subtract two integers @param a The first source integer @param b The second source integer (single digit of upto bits_per_digit in length) @param c The destination of "a - b" @@ -195,7 +195,7 @@ typedef struct { */ int (*subi)(void *a, unsigned long b, void *c); - /** multiply two integers + /** multiply two integers @param a The first source integer @param b The second source integer (single digit of upto bits_per_digit in length) @param c The destination of "a * b" @@ -203,7 +203,7 @@ typedef struct { */ int (*mul)(void *a, void *b, void *c); - /** multiply two integers + /** multiply two integers @param a The first source integer @param b The second source integer (single digit of upto bits_per_digit in length) @param c The destination of "a * b" @@ -227,9 +227,9 @@ typedef struct { */ int (*mpdiv)(void *a, void *b, void *c, void *d); - /** divide by two + /** divide by two @param a The integer to divide (shift right) - @param b The destination + @param b The destination @return CRYPT_OK on success */ int (*div_2)(void *a, void *b); @@ -242,7 +242,7 @@ typedef struct { */ int (*modi)(void *a, unsigned long b, unsigned long *c); - /** gcd + /** gcd @param a The first integer @param b The second integer @param c The destination for (a, b) @@ -250,7 +250,7 @@ typedef struct { */ int (*gcd)(void *a, void *b, void *c); - /** lcm + /** lcm @param a The first integer @param b The second integer @param c The destination for [a, b] @@ -260,7 +260,7 @@ typedef struct { /** Modular multiplication @param a The first source - @param b The second source + @param b The second source @param c The modulus @param d The destination (a*b mod c) @return CRYPT_OK on success @@ -277,7 +277,7 @@ typedef struct { /** Modular inversion @param a The value to invert - @param b The modulus + @param b The modulus @param c The destination (1/a mod b) @return CRYPT_OK on success */ @@ -286,13 +286,13 @@ typedef struct { /* ---- reduction ---- */ /** setup montgomery - @param a The modulus - @param b The destination for the reduction digit + @param a The modulus + @param b The destination for the reduction digit @return CRYPT_OK on success */ int (*montgomery_setup)(void *a, void **b); - /** get normalization value + /** get normalization value @param a The destination for the normalization value @param b The modulus @return CRYPT_OK on success @@ -310,7 +310,7 @@ typedef struct { /** clean up (frees memory) @param a The value "b" from montgomery_setup() @return CRYPT_OK on success - */ + */ void (*montgomery_deinit)(void *a); /* ---- exponentiation ---- */ @@ -336,14 +336,14 @@ typedef struct { /** ECC GF(p) point multiplication (from the NIST curves) @param k The integer to multiply the point by @param G The point to multiply - @param R The destination for kG + @param R The destination for kG @param modulus The modulus for the field @param map Boolean indicated whether to map back to affine or not (can be ignored if you work in affine only) @return CRYPT_OK on success */ int (*ecc_ptmul)(void *k, ecc_point *G, ecc_point *R, void *modulus, int map); - /** ECC GF(p) point addition + /** ECC GF(p) point addition @param P The first point @param Q The second point @param R The destination of P + Q @@ -353,7 +353,7 @@ typedef struct { */ int (*ecc_ptadd)(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp); - /** ECC GF(p) point double + /** ECC GF(p) point double @param P The first point @param R The destination of 2P @param modulus The modulus @@ -367,7 +367,7 @@ typedef struct { @param modulus The modulus @param mp The "b" value from montgomery_setup() @return CRYPT_OK on success - @remark The mapping can be different but keep in mind a ecc_point only has three + @remark The mapping can be different but keep in mind a ecc_point only has three integers (x,y,z) so if you use a different mapping you have to make it fit. */ int (*ecc_map)(ecc_point *P, void *modulus, void *mp); @@ -378,9 +378,9 @@ typedef struct { @param B Second point to multiply @param kB What to multiple B by @param C [out] Destination point (can overlap with A or B - @param modulus Modulus for curve + @param modulus Modulus for curve @return CRYPT_OK on success - */ + */ int (*ecc_mul2add)(ecc_point *A, void *kA, ecc_point *B, void *kB, ecc_point *C, @@ -388,7 +388,7 @@ typedef struct { /* ---- (optional) rsa optimized math (for internal CRT) ---- */ - /** RSA Key Generation + /** RSA Key Generation @param prng An active PRNG state @param wprng The index of the PRNG desired @param size The size of the modulus (key size) desired (octets) @@ -397,7 +397,7 @@ typedef struct { @return CRYPT_OK if successful, upon error all allocated ram is freed */ int (*rsa_keygen)(prng_state *prng, int wprng, int size, long e, rsa_key *key); - + /** RSA exponentiation @param in The octet array representing the base @@ -405,7 +405,7 @@ typedef struct { @param out The destination (to be stored in an octet array format) @param outlen The length of the output buffer and the resulting size (zero padded to the size of the modulus) @param which PK_PUBLIC for public RSA and PK_PRIVATE for private RSA - @param key The RSA key to use + @param key The RSA key to use @return CRYPT_OK on success */ int (*rsa_me)(const unsigned char *in, unsigned long inlen, @@ -416,7 +416,7 @@ typedef struct { /** Modular addition @param a The first source - @param b The second source + @param b The second source @param c The modulus @param d The destination (a + b mod c) @return CRYPT_OK on success @@ -425,7 +425,7 @@ typedef struct { /** Modular substraction @param a The first source - @param b The second source + @param b The second source @param c The modulus @param d The destination (a - b mod c) @return CRYPT_OK on success diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 42c6ec547..11eb8cdca 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -1,9 +1,9 @@ /* ---- LTC_BASE64 Routines ---- */ #ifdef LTC_BASE64 -int base64_encode(const unsigned char *in, unsigned long len, +int base64_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); -int base64_decode(const unsigned char *in, unsigned long len, +int base64_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); #endif diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 038c6ba2a..c6540ca38 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -32,19 +32,19 @@ typedef struct Rsa_key { /** Type of key, PK_PRIVATE or PK_PUBLIC */ int type; /** The public exponent */ - void *e; + void *e; /** The private exponent */ - void *d; + void *d; /** The modulus */ - void *N; + void *N; /** The p factor of N */ - void *p; + void *p; /** The q factor of N */ - void *q; + void *q; /** The 1/q mod p CRT param */ - void *qP; + void *qP; /** The d mod (p - 1) CRT param */ - void *dP; + void *dP; /** The d mod (q - 1) CRT param */ void *dQ; } rsa_key; @@ -98,7 +98,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, /* LTC_PKCS #1 import/export */ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key); int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); - + #endif /* ---- Katja ---- */ @@ -113,17 +113,17 @@ typedef struct KAT_key { /** Type of key, PK_PRIVATE or PK_PUBLIC */ int type; /** The private exponent */ - void *d; + void *d; /** The modulus */ - void *N; + void *N; /** The p factor of N */ - void *p; + void *p; /** The q factor of N */ - void *q; + void *q; /** The 1/q mod p CRT param */ - void *qP; + void *qP; /** The d mod (p - 1) CRT param */ - void *dP; + void *dP; /** The d mod (q - 1) CRT param */ void *dQ; /** The pq param */ @@ -143,9 +143,9 @@ int katja_encrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, const unsigned char *lparam, unsigned long lparamlen, prng_state *prng, int prng_idx, int hash_idx, katja_key *key); - + int katja_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, + unsigned char *out, unsigned long *outlen, const unsigned char *lparam, unsigned long lparamlen, int hash_idx, int *stat, katja_key *key); @@ -153,11 +153,11 @@ int katja_decrypt_key(const unsigned char *in, unsigned long inlen, /* LTC_PKCS #1 import/export */ int katja_export(unsigned char *out, unsigned long *outlen, int type, katja_key *key); int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key); - + #endif /* ---- DH Routines ---- */ -#ifdef MDH +#ifdef MDH typedef struct Dh_key { int idx, type; @@ -179,12 +179,12 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, unsigned char *out, unsigned long *outlen); int dh_encrypt_key(const unsigned char *in, unsigned long keylen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, int hash, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, dh_key *key); -int dh_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, +int dh_decrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, dh_key *key); int dh_sign_hash(const unsigned char *in, unsigned long inlen, @@ -192,7 +192,7 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, prng_state *prng, int wprng, dh_key *key); int dh_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, + const unsigned char *hash, unsigned long hashlen, int *stat, dh_key *key); @@ -214,7 +214,7 @@ typedef struct { int size; /** name of curve */ - char *name; + char *name; /** The prime that defines the field the curve is in (encoded in hex) */ char *prime; @@ -224,10 +224,10 @@ typedef struct { /** The order of the curve (hex) */ char *order; - + /** The x co-ordinate of the base point on the curve (hex) */ char *Gx; - + /** The y co-ordinate of the base point on the curve (hex) */ char *Gy; } ltc_ecc_set_type; @@ -281,24 +281,24 @@ int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen int ecc_ansi_x963_import(const unsigned char *in, unsigned long inlen, ecc_key *key); int ecc_ansi_x963_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, ltc_ecc_set_type *dp); -int ecc_shared_secret(ecc_key *private_key, ecc_key *public_key, +int ecc_shared_secret(ecc_key *private_key, ecc_key *public_key, unsigned char *out, unsigned long *outlen); int ecc_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, int hash, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, ecc_key *key); int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, + unsigned char *out, unsigned long *outlen, ecc_key *key); -int ecc_sign_hash(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, +int ecc_sign_hash(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, prng_state *prng, int wprng, ecc_key *key); int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, + const unsigned char *hash, unsigned long hashlen, int *stat, ecc_key *key); /* low level functions */ @@ -365,7 +365,7 @@ int ltc_ecc_map(ecc_point *P, void *modulus, void *mp); /** DSA key structure */ typedef struct { /** The key type, PK_PRIVATE or PK_PUBLIC */ - int type; + int type; /** The order of the sub-group used in octets */ int qord; @@ -398,22 +398,22 @@ int dsa_sign_hash(const unsigned char *in, unsigned long inlen, prng_state *prng, int wprng, dsa_key *key); int dsa_verify_hash_raw( void *r, void *s, - const unsigned char *hash, unsigned long hashlen, + const unsigned char *hash, unsigned long hashlen, int *stat, dsa_key *key); int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, + const unsigned char *hash, unsigned long hashlen, int *stat, dsa_key *key); int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, int hash, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, dsa_key *key); - + int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, + unsigned char *out, unsigned long *outlen, dsa_key *key); - + int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_verify_key(dsa_key *key, int *stat); @@ -475,12 +475,12 @@ typedef struct ltc_asn1_list_ { /* SEQUENCE */ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, unsigned char *out, unsigned long *outlen, int type_of); - -#define der_encode_sequence(list, inlen, out, outlen) der_encode_sequence_ex(list, inlen, out, outlen, LTC_ASN1_SEQUENCE) + +#define der_encode_sequence(list, inlen, out, outlen) der_encode_sequence_ex(list, inlen, out, outlen, LTC_ASN1_SEQUENCE) int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, ltc_asn1_list *list, unsigned long outlen, int ordered); - + #define der_decode_sequence(in, inlen, list, outlen) der_decode_sequence_ex(in, inlen, list, outlen, 1) int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, @@ -503,7 +503,7 @@ int der_encode_set(ltc_asn1_list *list, unsigned long inlen, int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, unsigned char *out, unsigned long *outlen); - + /* VA list handy helpers with triplets of */ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...); int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...); @@ -515,10 +515,10 @@ void der_sequence_free(ltc_asn1_list *in); /* BOOLEAN */ int der_length_boolean(unsigned long *outlen); -int der_encode_boolean(int in, +int der_encode_boolean(int in, unsigned char *out, unsigned long *outlen); int der_decode_boolean(const unsigned char *in, unsigned long inlen, - int *out); + int *out); /* INTEGER */ int der_encode_integer(void *num, unsigned char *out, unsigned long *outlen); int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num); @@ -584,7 +584,7 @@ int der_printable_char_encode(int c); int der_printable_value_decode(int v); /* UTF-8 */ -#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined (__WCHAR_TYPE__)) && !defined(LTC_NO_WCHAR) +#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined (__WCHAR_TYPE__)) && !defined(LTC_NO_WCHAR) #include #else typedef ulong32 wchar_t; @@ -616,7 +616,7 @@ typedef struct { off_mm; /* timezone offset minutes */ } ltc_utctime; -int der_encode_utctime(ltc_utctime *utctime, +int der_encode_utctime(ltc_utctime *utctime, unsigned char *out, unsigned long *outlen); int der_decode_utctime(const unsigned char *in, unsigned long *inlen, diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index a39eeebd3..ee47dd39f 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -24,20 +24,20 @@ int pkcs_1_i2osp(void *n, unsigned long modulus_len, unsigned char *out); int pkcs_1_os2ip(void *n, unsigned char *in, unsigned long inlen); /* *** v1.5 padding */ -int pkcs_1_v1_5_encode(const unsigned char *msg, +int pkcs_1_v1_5_encode(const unsigned char *msg, unsigned long msglen, int block_type, unsigned long modulus_bitlen, - prng_state *prng, + prng_state *prng, int prng_idx, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int pkcs_1_v1_5_decode(const unsigned char *msg, +int pkcs_1_v1_5_decode(const unsigned char *msg, unsigned long msglen, int block_type, unsigned long modulus_bitlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, int *is_valid); @@ -55,7 +55,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, int *res); int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, - unsigned long saltlen, prng_state *prng, + unsigned long saltlen, prng_state *prng, int prng_idx, int hash_idx, unsigned long modulus_bitlen, unsigned char *out, unsigned long *outlen); @@ -71,13 +71,13 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, #ifdef LTC_PKCS_5 /* Algorithm #1 (old) */ -int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, - const unsigned char *salt, +int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, + const unsigned char *salt, int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen); /* Algorithm #2 (new) */ -int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, +int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, const unsigned char *salt, unsigned long salt_len, int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen); diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 508159d20..4880b0531 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -23,10 +23,10 @@ struct fortuna_prng { unsigned char K[32], /* the current key */ IV[16]; /* IV for CTR mode */ - + unsigned long pool_idx, /* current pool we will add to */ pool0_len, /* length of 0'th pool */ - wd; + wd; ulong64 reset_cnt; /* number of times we have reset */ LTC_MUTEX_TYPE(prng_lock) @@ -36,14 +36,14 @@ struct fortuna_prng { #ifdef LTC_SOBER128 struct sober128_prng { ulong32 R[17], /* Working storage for the shift register */ - initR[17], /* saved register contents */ + initR[17], /* saved register contents */ konst, /* key dependent constant */ sbuf; /* partial word encryption buffer */ int nbuf, /* number of part-word stream bits buffered */ flag, /* first add_entropy call or not? */ set; /* did we call add_entropy to set key? */ - + }; #endif @@ -98,7 +98,7 @@ extern struct ltc_prng_descriptor { @return CRYPT_OK if successful */ int (*done)(prng_state *prng); - /** Export a PRNG state + /** Export a PRNG state @param out [out] The destination for the state @param outlen [in/out] The max size and resulting size of the PRNG state @param prng The PRNG to export @@ -187,8 +187,8 @@ LTC_MUTEX_PROTO(ltc_prng_mutex) /* Slow RNG you **might** be able to use to seed a PRNG with. Be careful as this * might not work on all platforms as planned */ -unsigned long rng_get_bytes(unsigned char *out, - unsigned long outlen, +unsigned long rng_get_bytes(unsigned char *out, + unsigned long outlen, void (*callback)(void)); int rng_make_prng(int bits, int wprng, prng_state *prng, void (*callback)(void)); From 9e88fcb9b16cb2f512cd297b5aef49fd23d7c157 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 26 Jul 2012 14:49:15 +0200 Subject: [PATCH 0092/1192] remove unused variable in demos/encrypt.c --- demos/encrypt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/demos/encrypt.c b/demos/encrypt.c index f52c9d834..e5817225b 100644 --- a/demos/encrypt.c +++ b/demos/encrypt.c @@ -26,8 +26,6 @@ int usage(char *name) void register_algs(void) { - int x; - #ifdef LTC_RIJNDAEL register_cipher (&aes_desc); #endif From d2e7b0c38f5b31e35e13fc43b0d111e1994d2f03 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 22 Mar 2013 13:50:56 +0200 Subject: [PATCH 0093/1192] fixed 'golden' XTEA testvectors that are used when running testme.sh --- notes/cipher_tv.txt | 100 ++++++++++++++++++++++---------------------- notes/eax_tv.txt | 34 +++++++-------- notes/ocb3_tv.txt | 34 +++++++-------- notes/ocb_tv.txt | 34 +++++++-------- notes/omac_tv.txt | 34 +++++++-------- notes/pmac_tv.txt | 34 +++++++-------- 6 files changed, 135 insertions(+), 135 deletions(-) diff --git a/notes/cipher_tv.txt b/notes/cipher_tv.txt index bc76ea4b5..d8ddb2981 100644 --- a/notes/cipher_tv.txt +++ b/notes/cipher_tv.txt @@ -321,56 +321,56 @@ Key Size: 56 bytes Cipher: xtea Key Size: 16 bytes - 0: 256004E1F55BC0C7 - 1: 2D385C151A691C42 - 2: F93BFEA758A7DDB4 - 3: 2A905D97C0CA3E48 - 4: 12C7C2787B913AE6 - 5: FB24B1F32549EF59 - 6: 2A8BFF867FB4FF73 - 7: 5692243526C6BA77 - 8: 4CD423ADFCDD1B6C - 9: 9B99AFC35EB2FED0 -10: 416B4AA4E07DA7F4 -11: 4DBC9052ABFF9510 -12: 8AF9457F8E599216 -13: BC3CA2B1C7267395 -14: E4BE31DF42282F7A -15: B344CA8AA57E9E40 -16: 57A1F94CD2F4576D -17: 96177FCD28BFF1BB -18: 78A1F63A0EBAAC33 -19: 5F3FCBCD7442B617 -20: D6F7CD5ECA688967 -21: D92EDF70CBDE703F -22: E2E2C2EE5D18E58E -23: 4BF00478CB7833C3 -24: F9936D550815FE8F -25: 19A3B07B3E47D7D8 -26: ACA441F099A7E30C -27: F70183F199988E3F -28: 0A41FC22F369310A -29: ABFAF40853A4A38C -30: 6B5D29DB1155D96B -31: 0DD0C08A27561D66 -32: 4C56E22292F17AA3 -33: 3F925ED65613DF4A -34: 521B4C97081DC901 -35: 2B1EC3E1C8CF84EC -36: 2A412556F42A48F6 -37: 0A57B8A527DFE507 -38: EB55C9C157E3C922 -39: 6E6D6E9AB925ED92 -40: A4C5C90A0D4A8F16 -41: 7F9F9F658C427D55 -42: 9A5139994FF04C3F -43: 9054771F027E29BC -44: 90543E7BAED313BD -45: 5DEC1EBE6A617D36 -46: 19AB6A708CDB9B2D -47: BABB97BB5CF9D4E4 -48: 2C2ADC05AF255861 -49: 52266710153E3F7E + 0: FFC52D10A010010B + 1: 9CFB2B659387BC37 + 2: 7067D153B259E0D6 + 3: 0A1769C085DD67A9 + 4: A9D781A1A7B4B292 + 5: 6FEF8300DF395062 + 6: A67B66CA99B9121C + 7: 006E657E1DAD46D3 + 8: 2D63322467438A5B + 9: 4F67A826126BE01D +10: 852C6FD597EBAB00 +11: F8DD14F59FF44A20 +12: CD4DC4E92B5CD40B +13: 802B89A3EFB75810 +14: CCA7D920F69A5491 +15: 0DFF98CA4F71CA0E +16: 80118F2AE4E83DE8 +17: CD6935285D45D83C +18: 47B4613483889187 +19: 87F3F1975B8618E3 +20: 49BF15EF40C72DBA +21: F850822AD58AD1CC +22: 9701AD2EF51FD705 +23: 705AE7F6FD60420B +24: E885CC84A9866B28 +25: 93E0D712D27E4E22 +26: 8C9CE43E517D3324 +27: 31004841AF51FB0E +28: B250BEBF0E58457C +29: 78290B6D83D442E9 +30: 3EC72388709CC6E2 +31: 099FB875AB5CA6EA +32: B15E20B58F5E8DD0 +33: A41511E198E0B1E7 +34: B8B5CDD9607B6B40 +35: BEF9624E922DB8AC +36: AF198FCD314D8DD4 +37: 1A37E433C261EF9D +38: AB7895A2E9D41EE4 +39: 4C95BE8D34A7D75B +40: 0D90A8EB03F2852E +41: 9AAD1D630D835C67 +42: 6AD88003661B2C5E +43: 4FA7E2CC53EBA728 +44: 862245D794441522 +45: FAB262C13D245B3E +46: C0A29AA315A5721E +47: F98617BBEFA6AD6A +48: 6F84EAB462F10F36 +49: 30850051303CDB96 Cipher: rc5 diff --git a/notes/eax_tv.txt b/notes/eax_tv.txt index 02df11631..3bedbc126 100644 --- a/notes/eax_tv.txt +++ b/notes/eax_tv.txt @@ -57,23 +57,23 @@ EAX-blowfish (8 byte key) 16: 60A315193F58144F5701D547C79FEEED, 912FDBDB05467DF5 EAX-xtea (16 byte key) - 0: , 86881D824E3BC561 - 1: EE, 4C3505F04611D9C2 - 2: 80C8, 6A3428BEEAD60738 - 3: BF88E7, 04F1E99E9F5906C2 - 4: E06574B7, 33B0153AAEF9776F - 5: 42D950AF63, 4A0F415640322FDF - 6: C30F6AD46EC9, 9646FE909D2B95CB - 7: A0049FCA856A14, A0257289C6BBF278 - 8: 2814B0C1358440E0, C4B0A2354925E887 - 9: BF4F062B52C1E489CF, B56442A3CA57A041 - 10: 63DF433956831B8780FC, ADF9ED0B46DCA19E - 11: C317FD079817F50E0E8A16, 2EA0EC993FC603AE - 12: 2BD12FDDD81EB11660346D2A, FBC6F69125BBA88D - 13: 85D356536FE2843C6BBE60EDBC, BB2FEFD04F230E79 - 14: 22493009DB01B4746F4927A8C4FB, 64CC08471D93C9AC - 15: C0F3C0DB08DC93FBA725D1E02DE084, 77B762213DDCCFFE - 16: 568B66D3112556BD98FF9339E9C002E5, C8355F508219FE0C + 0: , A04FAC8D0416F081 + 1: 5E, F95DAA99F8FE28E9 + 2: B6A7, E2A05E1F1E6D17B5 + 3: 27D698, CCC0CC54F40DA243 + 4: C2E81CCC, 283AB8F109D287ED + 5: 51B99DF694, A9637DB356B4BC0C + 6: C2ED3E79A4F2, 413D3A65FFE803BA + 7: 40E35BE6CA019C, 1B68833B90E4E026 + 8: C246C2B5ACEBEB08, 50CFEB01DEC3BB1F + 9: 35E2F7AAB57842D50F, 617804483BFFCA9D + 10: 2F855AB7A4664958300D, 6F054767FE484664 + 11: 2824A5486D1B621D0F992A, 238566B9F56ECAB1 + 12: BF5C121A6144AA0CC05A380E, 63F4DA4B898FB2A8 + 13: 2EB53E8A4698EDEBB990FC65E6, 7DFFE0E43187D10C + 14: 85F77FD150C6649F5826AD45D50D, AA660F37975768FC + 15: 8B4EB3750814EE7E8FC6B97B3ED1ED, F79545FB1F1C389B + 16: 980EB7FCEEE37558BEDA0E938325F608, 2FAA9235BFA3EA30 EAX-rc5 (8 byte key) 0: , 169C7954341EF44D diff --git a/notes/ocb3_tv.txt b/notes/ocb3_tv.txt index 046f624c8..c923fa324 100644 --- a/notes/ocb3_tv.txt +++ b/notes/ocb3_tv.txt @@ -57,23 +57,23 @@ OCB-blowfish (8 byte key) 16: 1F4919EB6CAD8D19B755157FD1A2E89A, F7EAE8DB5F5FA9B1 OCB-xtea (16 byte key) - 0: , 311A7010FB045BEE - 1: F8, E65BD38F1C4E7BFF - 2: 7AE4, 5B78197CE29D8FD4 - 3: 36A39F, 98FEA390BC03F915 - 4: 9AE3921C, 76F6EEBC194DEFE4 - 5: E925968C09, 105E0FBF3B664875 - 6: 537DE3B6AADF, B2C57709CEDBBA10 - 7: 4525D6927B4343, D83CB96C7ADA6241 - 8: 807A0E8382A91CE9, F6DF1EAA4929EEEE - 9: 59C09E427C56CDF015, 885813D7F4D4CB40 - 10: F785DAB910D186761A82, 46346AB52983186D - 11: F11CE4DAAEBCC204B318F2, 67E95CA14FB4FD3D - 12: 4A7FD586015561801115981F, 70DAC17D50DB4E5C - 13: CF03722B78DE7AE951B5E6442A, F40D80E40690378E - 14: B17224FE335A8CC17425D0AA3382, 2BEEC3D3828EA9E8 - 15: 5B333EE0CC163F8C22E5E0747AE7F6, 29BCD90905505D05 - 16: 7FC2C0D4E865D082174AE033E71DD3A9, E34E60A7D43F8EDB + 0: , 5F751041CDB0C2B5 + 1: A5, C48C22CADB797CF7 + 2: A3E9, CBB821F70FBAEA3A + 3: 7CA3C5, 686647FF8466C56A + 4: 318C2DA8, 65C58584A3E9118A + 5: A7C02B6438, F87A48C547971C30 + 6: 314FBFEE9BDE, E62DC6E65FD35E8B + 7: 87481270584EB8, C582AC684B8D02A0 + 8: 1E5E0DD030860CBC, A19FF0144005994E + 9: F0BDCCA3C2463850A5, 15420E4C10821445 + 10: B6D1C598C7046F921299, EE9C28659EE2927E + 11: B1376A4D9B3EF59B873917, 0DD3005E47CE72DB + 12: BC9D026F374A89B8A45E55D0, 09DA1DDFDC3A5463 + 13: CC8DF93BE2D71601CDC52124A7, 9623D92C2FD9D62C + 14: 90854B2161951CEA934AAB4E2B6C, E80632AB9F2CE421 + 15: 7ADE7A19FD0BAF71BE1C6DA601F6D3, 90612EEA15A64111 + 16: FA21FE68977D60D51ED897915945E5C4, 1A9344DD8E25D45C OCB-rc5 (8 byte key) 0: , 4287F61BB46382B2 diff --git a/notes/ocb_tv.txt b/notes/ocb_tv.txt index 229fa4b02..b93d7e297 100644 --- a/notes/ocb_tv.txt +++ b/notes/ocb_tv.txt @@ -57,23 +57,23 @@ OCB-blowfish (8 byte key) 16: 3EDC4A0FA95BD8F944BCE4F252B6470C, 87B54BBEA86A5B5C OCB-xtea (16 byte key) - 0: , 56722ECFE6ED1300 - 1: CA, DF53479333DB86AA - 2: 9529, D0B5A859106FCC9B - 3: DDBAB2, 3B31FFDA57CF51C8 - 4: 22EB7DD4, 2BB34D04FFF810CB - 5: 108693761A, 7AFF6F52574A019A - 6: 391FB7C61E76, 616C5E66297F2CCE - 7: 3E22E4A4A0BD13, E84C385ABE25C8D8 - 8: 94FA11D5243EE34F, 8F017DE96049D0F9 - 9: DADB6B5D27049240A7, CA69E14047C6BBA7 - 10: F79C8EA83C69DE914DAC, 1EF042DA68106C64 - 11: C5B6E04AB8B9491E6A99F8, 143515779A55C972 - 12: 33F493AB7AE62DADA38C5B24, 531BF7799A778620 - 13: 6DAA66BF02E66DF8C0B6C1CC24, 6CDF72786C5EC761 - 14: 4940E22F083A0F3EC01B3D468928, 185EE9CD2D7521AB - 15: 5D100BF55708147A9537C7DB6E42A6, 78984C682124E904 - 16: 744033532DDB372BA4AFADEA1959251E, 438EB9F6B939844C + 0: , F996E5CC593FD6E9 + 1: 88, 64636E3C48940F8D + 2: 223D, 230D7718A8BCB965 + 3: 32531B, 37FEA4728FAE474D + 4: BDCF3E96, A9F30B4187CD174C + 5: 7B0CCDE546, E7328648817987FE + 6: 824BD771B724, 0BDF80C14EDB758B + 7: 8F0E73B1280717, 2DEDBF2C87180CC4 + 8: 6F7EFA44AF774B1F, 1A9C5509D54A7185 + 9: 9749BCF684F68755AC, E46941DBE948BDD5 + 10: DCD32D91FE2D5590355D, E17DFA54A5B60E07 + 11: 3CBBF6464D438AB95B3ACF, C207876D030362EC + 12: 1C804A611F6CE4CFD2657366, B957F48EA00C428C + 13: 5A2F6927951D8F60C754893790, EB3A27A9E5B8928F + 14: C710D28CD02726002596D9196021, C6C9EBF090A20C07 + 15: 298FFCE0CD42BC329697AEB5F53A56, BB2F0C415317928C + 16: 59F6395260ECEAB2E3511991EEEF9656, 278A218A720F8E05 OCB-rc5 (8 byte key) 0: , E7462C3C0C95A73E diff --git a/notes/omac_tv.txt b/notes/omac_tv.txt index 8d8729c47..c98baca22 100644 --- a/notes/omac_tv.txt +++ b/notes/omac_tv.txt @@ -57,23 +57,23 @@ OMAC-blowfish (8 byte key) 16: 8E6831D5370678EF OMAC-xtea (16 byte key) - 0: 4A0B6160602E6C69 - 1: 1B797D5E14237F21 - 2: 938300C83B99D0AC - 3: F989B99B3DE563C6 - 4: F65DEA2A6AD45D1E - 5: 1DB329F0239E162E - 6: C0C148C4EE8B4E1F - 7: D82B387D5DFFE1FB - 8: 1D027A4493898DF2 - 9: 196369F6B0AF971A - 10: 2A37A2655191D10A - 11: BD514BE32718EB4A - 12: B4DBC978F8EE74ED - 13: 8ACCAD35C3D436AE - 14: 73ABDC1956630C9B - 15: 73410D3D169373CE - 16: 23D797B3C7919374 + 0: A821403929958A1A + 1: 68C4A02D47C2E7C0 + 2: 7D37358141506DC1 + 3: 9BEA3AAE55B75F52 + 4: 884D053D05CC8DE4 + 5: E953747483FF4E0D + 6: B6E77E72C9738E4F + 7: 8AB67D2B24E3D512 + 8: 329C0B9D504A0D41 + 9: 50323DA8ACEF4164 + 10: FA3239C668C34DA3 + 11: B5A12FC81FC24084 + 12: 71A01A3ED3936934 + 13: F29B630CEB6AEDDB + 14: F8802F0D4504D55E + 15: F844B92162038F99 + 16: 99AECD7CA69F0465 OMAC-rc5 (8 byte key) 0: E374E40562C3CB23 diff --git a/notes/pmac_tv.txt b/notes/pmac_tv.txt index af87a2038..2f9d17533 100644 --- a/notes/pmac_tv.txt +++ b/notes/pmac_tv.txt @@ -57,23 +57,23 @@ PMAC-blowfish (8 byte key) 16: BDFE0C7F0254BAD5 PMAC-xtea (16 byte key) - 0: A7EF6BB667216DDA - 1: B039E53812C4ABDC - 2: 87D2F8EA5FB6864D - 3: F85E3F4C1D9F5EFC - 4: 4EB749D982FB5FE2 - 5: 0BFA0F172027441A - 6: FF82D01F36A6EC91 - 7: 3BC2AA2028EBBD7A - 8: 15AA03A97A971E2A - 9: C974691F5D66B835 - 10: 4FC7AA8F399A79ED - 11: 2633DA9E94673BAE - 12: 82A9FD48C5B60902 - 13: 31BF6DA9EE0CE7E4 - 14: 26B2538601B7620E - 15: D103F3C0B4579BE5 - 16: 031346BA20CD87BC + 0: F5E28630DFDE34E0 + 1: FFCC52D905DA5198 + 2: 25198AB18B2B290D + 3: 18914E50791161E9 + 4: 200F832212AD6747 + 5: A9D09C41D734DDF7 + 6: 32D7CCA3F4BD8215 + 7: 91A1AA9389CD5D02 + 8: 35CB1F77D7C25E2F + 9: D91EEE6D0A3874F3 + 10: A42872686A8FF6F2 + 11: 7568908634A79CBD + 12: 5B91A633D919BC34 + 13: 32DCD17176896F1D + 14: 2BBBA64F30E672B6 + 15: AFEB07DBC636AEED + 16: 7A417347CA03C598 PMAC-rc5 (8 byte key) 0: C6B48F8DEC631F7C From 1748cc616baa0ea2c29620a844282f88989d668a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 18 Apr 2013 11:22:25 +0200 Subject: [PATCH 0094/1192] der_tests: trim trailing spaces --- testprof/der_tests.c | 188 +++++++++++++++++++++---------------------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 2778d508c..a99f7c0d5 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -23,46 +23,46 @@ static void der_set_test(void) unsigned char strs[10][10], outbuf[128]; unsigned long x, val, outlen; int err; - + /* make structure and encode it */ LTC_SET_ASN1(list, 0, LTC_ASN1_OCTET_STRING, oct_str, sizeof(oct_str)); LTC_SET_ASN1(list, 1, LTC_ASN1_BIT_STRING, bin_str, sizeof(bin_str)); LTC_SET_ASN1(list, 2, LTC_ASN1_SHORT_INTEGER, &int_val, 1); - + /* encode it */ outlen = sizeof(outbuf); if ((err = der_encode_set(list, 3, outbuf, &outlen)) != CRYPT_OK) { fprintf(stderr, "error encoding set: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - - + + /* first let's test the set_decoder out of order to see what happens, we should get all the fields we expect even though they're in a diff order */ LTC_SET_ASN1(list, 0, LTC_ASN1_BIT_STRING, strs[1], sizeof(strs[1])); LTC_SET_ASN1(list, 1, LTC_ASN1_SHORT_INTEGER, &val, 1); LTC_SET_ASN1(list, 2, LTC_ASN1_OCTET_STRING, strs[0], sizeof(strs[0])); - + if ((err = der_decode_set(outbuf, outlen, list, 3)) != CRYPT_OK) { fprintf(stderr, "error decoding set using der_decode_set: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - + /* now compare the items */ if (memcmp(strs[0], oct_str, sizeof(oct_str))) { fprintf(stderr, "error decoding set using der_decode_set (oct_str is wrong):\n"); exit(EXIT_FAILURE); } - + if (memcmp(strs[1], bin_str, sizeof(bin_str))) { fprintf(stderr, "error decoding set using der_decode_set (bin_str is wrong):\n"); exit(EXIT_FAILURE); } - + if (val != int_val) { fprintf(stderr, "error decoding set using der_decode_set (int_val is wrong):\n"); exit(EXIT_FAILURE); } - + strcpy((char*)strs[0], "one"); strcpy((char*)strs[1], "one2"); strcpy((char*)strs[2], "two"); @@ -73,39 +73,39 @@ static void der_set_test(void) strcpy((char*)strs[7], "bbb"); strcpy((char*)strs[8], "bbba"); strcpy((char*)strs[9], "bbbb"); - + for (x = 0; x < 10; x++) { LTC_SET_ASN1(list, x, LTC_ASN1_PRINTABLE_STRING, strs[x], strlen((char*)strs[x])); } - + outlen = sizeof(outbuf); - if ((err = der_encode_setof(list, 10, outbuf, &outlen)) != CRYPT_OK) { + if ((err = der_encode_setof(list, 10, outbuf, &outlen)) != CRYPT_OK) { fprintf(stderr, "error encoding SET OF: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - + for (x = 0; x < 10; x++) { LTC_SET_ASN1(list, x, LTC_ASN1_PRINTABLE_STRING, strs[x], sizeof(strs[x]) - 1); } XMEMSET(strs, 0, sizeof(strs)); - + if ((err = der_decode_set(outbuf, outlen, list, 10)) != CRYPT_OK) { fprintf(stderr, "error decoding SET OF: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - + /* now compare */ for (x = 1; x < 10; x++) { if (!(strlen((char*)strs[x-1]) <= strlen((char*)strs[x])) && strcmp((char*)strs[x-1], (char*)strs[x]) >= 0) { fprintf(stderr, "error SET OF order at %lu is wrong\n", x); exit(EXIT_FAILURE); } - } - + } + } -/* we are encoding +/* we are encoding SEQUENCE { PRINTABLE "printable" @@ -125,9 +125,9 @@ static void der_set_test(void) } } } - } + } -*/ +*/ static void der_flexi_test(void) { @@ -140,18 +140,18 @@ static void der_flexi_test(void) static const unsigned char oct_str[] = { 1, 2, 3, 4 }; static const unsigned char bit_str[] = { 1, 0, 0, 1 }; static const unsigned long oid_str[] = { 1, 2, 840, 113549 }; - + unsigned char encode_buf[192]; unsigned long encode_buf_len, decode_len; int err; - + ltc_asn1_list static_list[5][3], *decoded_list, *l; - + /* build list */ LTC_SET_ASN1(static_list[0], 0, LTC_ASN1_PRINTABLE_STRING, (void *)printable_str, strlen(printable_str)); LTC_SET_ASN1(static_list[0], 1, LTC_ASN1_IA5_STRING, (void *)ia5_str, strlen(ia5_str)); LTC_SET_ASN1(static_list[0], 2, LTC_ASN1_SEQUENCE, static_list[1], 3); - + LTC_SET_ASN1(static_list[1], 0, LTC_ASN1_SHORT_INTEGER, (void *)&int_val, 1); LTC_SET_ASN1(static_list[1], 1, LTC_ASN1_UTCTIME, (void *)&utctime, 1); LTC_SET_ASN1(static_list[1], 2, LTC_ASN1_SEQUENCE, static_list[2], 3); @@ -173,197 +173,197 @@ static void der_flexi_test(void) fprintf(stderr, "Encoding static_list: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - + #if 0 { FILE *f; f = fopen("t.bin", "wb"); fwrite(encode_buf, 1, encode_buf_len, f); fclose(f); - } -#endif - + } +#endif + /* decode with flexi */ decode_len = encode_buf_len; if ((err = der_decode_sequence_flexi(encode_buf, &decode_len, &decoded_list)) != CRYPT_OK) { fprintf(stderr, "decoding static_list: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - + if (decode_len != encode_buf_len) { fprintf(stderr, "Decode len of %lu does not match encode len of %lu \n", decode_len, encode_buf_len); exit(EXIT_FAILURE); } - + /* we expect l->next to be NULL and l->child to not be */ l = decoded_list; if (l->next != NULL || l->child == NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* we expect a SEQUENCE */ if (l->type != LTC_ASN1_SEQUENCE) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } l = l->child; - + /* PRINTABLE STRING */ /* we expect printable_str */ if (l->next == NULL || l->child != NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_PRINTABLE_STRING) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->size != strlen(printable_str) || memcmp(printable_str, l->data, l->size)) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; - - /* IA5 STRING */ + + /* IA5 STRING */ /* we expect ia5_str */ if (l->next == NULL || l->child != NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_IA5_STRING) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->size != strlen(ia5_str) || memcmp(ia5_str, l->data, l->size)) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; - + /* expect child anve move down */ - + if (l->next != NULL || l->child == NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_SEQUENCE) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } l = l->child; - + /* INTEGER */ - + if (l->next == NULL || l->child != NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_INTEGER) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (mp_cmp_d(l->data, 12345678UL) != LTC_MP_EQ) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; - + /* UTCTIME */ - + if (l->next == NULL || l->child != NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_UTCTIME) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (memcmp(l->data, &utctime, sizeof(utctime))) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; - + /* expect child anve move down */ - + if (l->next != NULL || l->child == NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_SEQUENCE) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } l = l->child; - - - /* OCTET STRING */ + + + /* OCTET STRING */ /* we expect oct_str */ if (l->next == NULL || l->child != NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_OCTET_STRING) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->size != sizeof(oct_str) || memcmp(oct_str, l->data, l->size)) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; - /* BIT STRING */ + /* BIT STRING */ /* we expect oct_str */ if (l->next == NULL || l->child != NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_BIT_STRING) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->size != sizeof(bit_str) || memcmp(bit_str, l->data, l->size)) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; /* expect child anve move down */ - + if (l->next != NULL || l->child == NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_SEQUENCE) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); @@ -371,65 +371,65 @@ static void der_flexi_test(void) l = l->child; - /* OID STRING */ + /* OID STRING */ /* we expect oid_str */ if (l->next == NULL || l->child != NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_OBJECT_IDENTIFIER) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->size != sizeof(oid_str)/sizeof(oid_str[0]) || memcmp(oid_str, l->data, l->size*sizeof(oid_str[0]))) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; - + /* NULL */ if (l->type != LTC_ASN1_NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; - + /* expect child anve move down */ if (l->next != NULL || l->child == NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_SET) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } l = l->child; - + /* PRINTABLE STRING */ /* we expect printable_str */ if (l->next == NULL || l->child != NULL) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->type != LTC_ASN1_PRINTABLE_STRING) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - -/* note we compare set2_str FIRST because the SET OF is sorted and "222" comes before "333" */ + +/* note we compare set2_str FIRST because the SET OF is sorted and "222" comes before "333" */ if (l->size != strlen(set2_str) || memcmp(set2_str, l->data, l->size)) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + /* move to next */ l = l->next; @@ -439,12 +439,12 @@ static void der_flexi_test(void) fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + if (l->size != strlen(set1_str) || memcmp(set1_str, l->data, l->size)) { fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); exit(EXIT_FAILURE); } - + der_sequence_free(l); @@ -483,7 +483,7 @@ static int der_choice_test(void) LTC_SET_ASN1(host, 0, LTC_ASN1_CHOICE, types, 7); - + /* encode */ outlen = sizeof(outbuf); DO(der_encode_sequence(&types[x>6?x-7:x], 1, outbuf, &outlen)); @@ -506,7 +506,7 @@ static int der_choice_test(void) mp_clear(mpinteger); return 0; } - + int der_tests(void) { @@ -522,7 +522,7 @@ int der_tests(void) 0x40, 0x72, 0x73, 0x61, 0x2e, 0x63, 0x6f, 0x6d }; static const unsigned char rsa_printable[] = "Test User 1"; - static const unsigned char rsa_printable_der[] = { 0x13, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x20, 0x55, + static const unsigned char rsa_printable_der[] = { 0x13, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x20, 0x55, 0x73, 0x65, 0x72, 0x20, 0x31 }; static const ltc_utctime rsa_time1 = { 91, 5, 6, 16, 45, 40, 1, 7, 0 }; @@ -600,10 +600,10 @@ int der_tests(void) return 1; } } - } + } mp_clear_multi(a, b, c, d, e, f, g, NULL); - + /* Test bit string */ for (zz = 1; zz < 1536; zz++) { yarrow_read(buf[0], zz, &yarrow_prng); @@ -613,7 +613,7 @@ int der_tests(void) x = sizeof(buf[1]); DO(der_encode_bit_string(buf[0], zz, buf[1], &x)); DO(der_length_bit_string(zz, &y)); - if (y != x) { + if (y != x) { fprintf(stderr, "\nDER BIT STRING length of encoded not match expected : %lu, %lu, %lu\n", z, x, y); return 1; } @@ -632,7 +632,7 @@ int der_tests(void) x = sizeof(buf[1]); DO(der_encode_octet_string(buf[0], zz, buf[1], &x)); DO(der_length_octet_string(zz, &y)); - if (y != x) { + if (y != x) { fprintf(stderr, "\nDER OCTET STRING length of encoded not match expected : %lu, %lu, %lu\n", z, x, y); return 1; } @@ -669,7 +669,7 @@ int der_tests(void) yarrow_read(buf[0], 4, &yarrow_prng); LOAD32L(z, buf[0]); z = 2 + (z % ((sizeof(oid[0])/sizeof(oid[0][0])) - 2)); - + /* fill them in */ oid[0][0] = buf[0][0] % 3; oid[0][1] = buf[0][1] % 40; @@ -688,7 +688,7 @@ int der_tests(void) for (x = 0; x < z; x++) fprintf(stderr, "%lu\n", oid[0][x]); return 1; } - + /* decode it */ y = sizeof(oid[0])/sizeof(oid[0][0]); DO(der_decode_object_identifier(buf[0], x, oid[1], &y)); @@ -760,7 +760,7 @@ for (y = 0; y < x; y++) fprintf(stderr, "%02x ", buf[0][y]); printf("\n"); DO(der_decode_utctime(buf[0], &y, &tmp_time)); if (y != x || memcmp(&rsa_time1, &tmp_time, sizeof(ltc_utctime))) { fprintf(stderr, "UTCTIME decode failed for rsa_time1: %lu %lu\n", x, y); -fprintf(stderr, "\n\n%u %u %u %u %u %u %u %u %u\n\n", +fprintf(stderr, "\n\n%u %u %u %u %u %u %u %u %u\n\n", tmp_time.YY, tmp_time.MM, tmp_time.DD, @@ -790,7 +790,7 @@ for (y = 0; y < x; y++) fprintf(stderr, "%02x ", buf[0][y]); printf("\n"); DO(der_decode_utctime(buf[0], &y, &tmp_time)); if (y != x || memcmp(&rsa_time2, &tmp_time, sizeof(ltc_utctime))) { fprintf(stderr, "UTCTIME decode failed for rsa_time2: %lu %lu\n", x, y); -fprintf(stderr, "\n\n%u %u %u %u %u %u %u %u %u\n\n", +fprintf(stderr, "\n\n%u %u %u %u %u %u %u %u %u\n\n", tmp_time.YY, tmp_time.MM, tmp_time.DD, From be96ed3ba913c33eeeecd00c44d96b9077f7c01b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 29 May 2013 12:52:00 +0200 Subject: [PATCH 0095/1192] add travis-ci configuration --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..1a6564502 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: c +compiler: + - gcc +script: ./testme.sh "makefile" "-DUSE_LTM -DLTM_DESC -DLTC_NO_ASM -I/usr/include" /usr/lib/libtommath.a +branches: + only: + - develop +before_script: + - sudo apt-get install libtommath-dev +after_script: + - cat gcc_2.txt From 50ad0b863906fcb5758528b3ba1bd96dd0d5cf28 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 29 May 2013 12:58:15 +0200 Subject: [PATCH 0096/1192] fix makefiles --- makefile | 8 ++++---- makefile.icc | 8 ++++---- makefile.msvc | 8 ++++---- makefile.shared | 8 ++++---- makefile.unix | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/makefile b/makefile index a9e3fa92d..6cb8d0bfe 100644 --- a/makefile +++ b/makefile @@ -232,10 +232,10 @@ src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/so src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ -src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.icc b/makefile.icc index 879cceccf..e87e0a3c8 100644 --- a/makefile.icc +++ b/makefile.icc @@ -218,10 +218,10 @@ src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/so src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ -src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.msvc b/makefile.msvc index 85a33b599..2af2a69a5 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -128,10 +128,10 @@ src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/pr src/prngs/sprng.obj src/prngs/yarrow.obj HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ -src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.shared b/makefile.shared index 49de3b044..05bee2f07 100644 --- a/makefile.shared +++ b/makefile.shared @@ -223,10 +223,10 @@ src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/so src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ -src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.unix b/makefile.unix index bda4d7f48..20e64247a 100644 --- a/makefile.unix +++ b/makefile.unix @@ -164,10 +164,10 @@ src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/so src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_custom.h.orig \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h \ -src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS From e5e8cc2e50e7eb03192bd4a26c672355a39ecd62 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 29 May 2013 14:30:47 +0300 Subject: [PATCH 0097/1192] Update README.md add Build status --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a4f0d5fdd..e82fdb200 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,11 @@ libtomcrypt See doc/crypt.pdf for a detailed documentation +Build Status +------------ + +develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop) + Submitting patches ------------------ From d0a83df7f8538065a86fece1b87ebb98bfd343c0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 18 Apr 2013 16:41:32 +0200 Subject: [PATCH 0098/1192] update makefile to be able to define a target platform prefix --- makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index 6cb8d0bfe..c75dd2c02 100644 --- a/makefile +++ b/makefile @@ -9,8 +9,13 @@ VERSION=1.17 PLATFORM := $(shell uname | sed -e 's/_.*//') # Compiler and Linker Names -#CC=gcc -#LD=ld +ifndef PREFIX + PREFIX= +endif + +CC=$(PREFIX)gcc +LD=$(PREFIX)ld +AR=$(PREFIX)ar # Archiver [makes .a files] #AR=ar @@ -23,9 +28,9 @@ endif # ranlib tools ifndef RANLIB ifeq ($(PLATFORM), Darwin) -RANLIB=ranlib -c +RANLIB=$(PREFIX)ranlib -c else -RANLIB=ranlib +RANLIB=$(PREFIX)ranlib endif endif @@ -274,7 +279,7 @@ library: $(LIBNAME) $(OBJECTS): $(HEADERS) testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE) + cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE) $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) From c0b8774cc1c37f52edb3c244a3dce7a20efa5b10 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 14 Aug 2013 15:47:07 +0200 Subject: [PATCH 0099/1192] move hkdf to misc --- src/headers/tomcrypt.h | 1 - src/headers/tomcrypt_custom.h | 12 +++++++++--- src/headers/tomcrypt_hkdf.h | 28 ---------------------------- src/headers/tomcrypt_misc.h | 23 +++++++++++++++++++++++ 4 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 src/headers/tomcrypt_hkdf.h diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 3b4232bf1..51299af29 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -75,7 +75,6 @@ enum { #include #include #include -#include #ifdef __cplusplus } diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 1401f95ef..9e9a5bd38 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -365,13 +365,19 @@ #endif /* LTC_NO_PKCS */ -/* LTC_HKDF Key Derivation/Expansion stuff */ -#ifndef LTC_NO_HKDF +/* misc stuff */ +#ifndef LTC_NO_MISC -#define LTC_HKDF +/* Keep LTC_NO_HKDF for compatibility reasons + * superseeded by LTC_NO_MISC*/ +#ifndef LTC_NO_HKDF +/* LTC_HKDF Key Derivation/Expansion stuff */ +#define LTC_HKDF #endif /* LTC_NO_HKDF */ +#endif /* LTC_NO_MISC */ + /* cleanup */ #ifdef LTC_MECC diff --git a/src/headers/tomcrypt_hkdf.h b/src/headers/tomcrypt_hkdf.h deleted file mode 100644 index f6a0228db..000000000 --- a/src/headers/tomcrypt_hkdf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* LTC_HKDF Header Info */ - -/* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ -#ifdef LTC_HKDF - -int hkdf_test(void); - -int hkdf_extract(int hash_idx, - const unsigned char *salt, unsigned long saltlen, - const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen); - -int hkdf_expand(int hash_idx, - const unsigned char *info, unsigned long infolen, - const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long outlen); - -int hkdf(int hash_idx, - const unsigned char *salt, unsigned long saltlen, - const unsigned char *info, unsigned long infolen, - const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long outlen); - -#endif /* LTC_HKDF */ - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 11eb8cdca..1d43c91cd 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -7,6 +7,29 @@ int base64_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); #endif +/* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ +#ifdef LTC_HKDF + +int hkdf_test(void); + +int hkdf_extract(int hash_idx, + const unsigned char *salt, unsigned long saltlen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + +int hkdf_expand(int hash_idx, + const unsigned char *info, unsigned long infolen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long outlen); + +int hkdf(int hash_idx, + const unsigned char *salt, unsigned long saltlen, + const unsigned char *info, unsigned long infolen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long outlen); + +#endif /* LTC_HKDF */ + /* ---- MEM routines ---- */ void zeromem(volatile void *dst, size_t len); void burn_stack(unsigned long len); From 10511d329ccb60a5410d19501150b30cfb5021d7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 14 Aug 2013 15:56:10 +0200 Subject: [PATCH 0100/1192] update makefiles --- makefile | 6 +++--- makefile.icc | 6 +++--- makefile.msvc | 6 +++--- makefile.shared | 6 +++--- makefile.unix | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/makefile b/makefile index c75dd2c02..0ea8137ea 100644 --- a/makefile +++ b/makefile @@ -238,9 +238,9 @@ src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ -src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.icc b/makefile.icc index e87e0a3c8..c6971b1bd 100644 --- a/makefile.icc +++ b/makefile.icc @@ -219,9 +219,9 @@ src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ -src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.msvc b/makefile.msvc index 2af2a69a5..97388872e 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -129,9 +129,9 @@ src/prngs/sprng.obj src/prngs/yarrow.obj HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ -src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.shared b/makefile.shared index 05bee2f07..f112b5983 100644 --- a/makefile.shared +++ b/makefile.shared @@ -224,9 +224,9 @@ src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ -src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.unix b/makefile.unix index 20e64247a..4d9667884 100644 --- a/makefile.unix +++ b/makefile.unix @@ -165,9 +165,9 @@ src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ -src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS From 031e551c5795564235a90b14bc055059ceea596f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 14 Aug 2013 16:12:56 +0200 Subject: [PATCH 0101/1192] tomcrypt_custom.h: improve and clean-up Add the possibility to define LTC_NOTHING that disables everything Remove LTC_NO_MATH as it didn't do anything at all Enable RSA blinding by default --- src/headers/tomcrypt_custom.h | 53 ++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 9e9a5bd38..7e58adf1c 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -66,6 +66,18 @@ #define XQSORT qsort #endif +/* shortcut to disable automatic inclusion */ +#if defined LTC_NOTHING && !defined LTC_EASY + #define LTC_NO_CIPHERS + #define LTC_NO_MODES + #define LTC_NO_HASHES + #define LTC_NO_MACS + #define LTC_NO_PRNGS + #define LTC_NO_PK + #define LTC_NO_PKCS + #define LTC_NO_MISC +#endif /* LTC_NOTHING */ + /* Easy button? */ #ifdef LTC_EASY #define LTC_NO_CIPHERS @@ -100,16 +112,19 @@ #define LTC_NO_PK #define LTC_MRSA #define LTC_MECC -#endif -/* Use small code where possible */ -/* #define LTC_SMALL_CODE */ + #define LTC_NO_MISC + #define LTC_BASE64 +#endif /* Enable self-test test vector checking */ #ifndef LTC_NO_TEST #define LTC_TEST #endif +/* Use small code where possible */ +/* #define LTC_SMALL_CODE */ + /* clean the stack of functions which put private information on stack */ /* #define LTC_CLEAN_STACK */ @@ -125,6 +140,16 @@ /* disable BSWAP on x86 */ /* #define LTC_NO_BSWAP */ +/* ---> math provider? <--- */ +/* LibTomMath */ +/* #define LTM_DESC */ + +/* TomsFastMath */ +/* #define TFM_DESC */ + +/* GNU Multiple Precision Arithmetic Library */ +/* #define GMP_DESC */ + /* ---> Symmetric Block Ciphers <--- */ #ifndef LTC_NO_CIPHERS @@ -247,9 +272,6 @@ #endif /* LTC_NO_MACS */ -/* Various tidbits of modern neatoness */ -#define LTC_BASE64 - /* --> Pseudo Random Number Generators <--- */ #ifndef LTC_NO_PRNGS @@ -290,25 +312,16 @@ #endif /* LTC_NO_PRNGS */ -/* ---> math provider? <--- */ -#ifndef LTC_NO_MATH - -/* LibTomMath */ -/* #define LTM_DESC */ - -/* TomsFastMath */ -/* #define TFM_DESC */ - -#endif /* LTC_NO_MATH */ - /* ---> Public Key Crypto <--- */ #ifndef LTC_NO_PK /* Include RSA support */ #define LTC_MRSA -/* Enable RSA blinding when doing private key operations? */ -/* #define LTC_RSA_BLINDING */ +#ifndef LTC_NO_RSA_BLINDING +/* Enable RSA blinding when doing private key operations by default */ +#define LTC_RSA_BLINDING +#endif /* LTC_NO_RSA_BLINDING */ /* Include Diffie-Hellman support */ #ifndef GMP_DESC @@ -368,6 +381,8 @@ /* misc stuff */ #ifndef LTC_NO_MISC +/* Various tidbits of modern neatoness */ +#define LTC_BASE64 /* Keep LTC_NO_HKDF for compatibility reasons * superseeded by LTC_NO_MISC*/ From c02097e74be447f8b992b08e58d2e31ea081cdb9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 14 Aug 2013 16:58:14 +0200 Subject: [PATCH 0102/1192] Readme: fix link to travis-ci --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e82fdb200..e671a42d4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ See doc/crypt.pdf for a detailed documentation Build Status ------------ -develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop) +develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://travis-ci.org/libtom/libtomcrypt) Submitting patches ------------------ From ab07d6a28336981b8e464e32efb82624a554a2ec Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Sep 2013 14:25:50 +0200 Subject: [PATCH 0103/1192] updatemakes.sh: trim trailing spaces --- updatemakes.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/updatemakes.sh b/updatemakes.sh index 9b6cbde9a..8539e1eb5 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -3,19 +3,23 @@ bash genlist.sh > tmplist perl filter.pl makefile tmplist -mv -f tmp.delme makefile +sed -e 's/ *$//' < tmp.delme > makefile +rm -f tmp.delme perl filter.pl makefile.icc tmplist -mv -f tmp.delme makefile.icc +sed -e 's/ *$//' < tmp.delme > makefile.icc +rm -f tmp.delme perl filter.pl makefile.shared tmplist -mv -f tmp.delme makefile.shared +sed -e 's/ *$//' < tmp.delme > makefile.shared +rm -f tmp.delme perl filter.pl makefile.unix tmplist -mv -f tmp.delme makefile.unix +sed -e 's/ *$//' < tmp.delme > makefile.unix +rm -f tmp.delme perl filter.pl makefile.msvc tmplist -sed -e 's/\.o /.obj /g' < tmp.delme > makefile.msvc +sed -e 's/\.o /.obj /g' -e 's/ *$//' < tmp.delme > makefile.msvc +rm -f tmp.delme rm -f tmplist -rm -f tmp.delme From 61a3206f06b09ba81a87248180425a09f28e5a4a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Sep 2013 14:27:32 +0200 Subject: [PATCH 0104/1192] clean-up makefiles --- makefile | 18 +++++++++--------- makefile.icc | 23 +++++++++++------------ makefile.msvc | 10 +++++----- makefile.shared | 22 +++++++++++----------- makefile.unix | 14 +++++++------- 5 files changed, 43 insertions(+), 44 deletions(-) diff --git a/makefile b/makefile index 0ea8137ea..c5138cb15 100644 --- a/makefile +++ b/makefile @@ -40,7 +40,7 @@ CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wn # additional warnings (newer GCC 3.4 and higher) ifdef GCC_34 CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wmissing-prototypes \ - -Wmissing-declarations -Wpointer-arith + -Wmissing-declarations -Wpointer-arith endif ifndef IGNORE_SPEED @@ -234,7 +234,7 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o +src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ @@ -262,7 +262,7 @@ COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip #The default rule for make builds the libtomcrypt library. default:library -#ciphers come in two flavours... enc+dec and enc +#ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o @@ -278,11 +278,11 @@ library: $(LIBNAME) $(OBJECTS): $(HEADERS) -testprof/$(LIBTEST): +testprof/$(LIBTEST): cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE) $(LIBNAME): $(OBJECTS) - $(AR) $(ARFLAGS) $@ $(OBJECTS) + $(AR) $(ARFLAGS) $@ $(OBJECTS) $(RANLIB) $@ #This rule makes the hash program included with libtomcrypt @@ -393,7 +393,7 @@ docdvi: crypt.tex #zipup the project (take that!) no_oops: clean - cd .. ; cvs commit + cd .. ; cvs commit echo Scanning for scratch/dirty files find . -type f | grep -v CVS | xargs -n 1 bash mess.sh @@ -407,6 +407,6 @@ zipup: no_oops docs mv -fv crypt* ~ ; rm -rf libtomcrypt-$(VERSION) -# $Source: /cvs/libtom/libtomcrypt/makefile,v $ -# $Revision: 1.151 $ -# $Date: 2007/06/20 13:14:31 $ +# $Source$ +# $Revision$ +# $Date$ diff --git a/makefile.icc b/makefile.icc index c6971b1bd..03c557c7d 100644 --- a/makefile.icc +++ b/makefile.icc @@ -4,10 +4,10 @@ # # Be aware that ICC isn't quite as stable as GCC and several optimization switches # seem to break the code (that GCC and MSVC compile just fine). In particular -# "-ip" and "-x*" seem to break the code (ROL/ROR macro problems). As the makefile +# "-ip" and "-x*" seem to break the code (ROL/ROR macro problems). As the makefile # is shipped the code will build and execute properly. # -# Also note that ICC often makes code that is slower than GCC. This is probably due to +# Also note that ICC often makes code that is slower than GCC. This is probably due to # a mix of not being able to use "-ip" and just having fewer optimization algos than GCC. # # Tom St Denis @@ -38,7 +38,7 @@ default:library # -ax? specifies make code specifically for ? but compatible with IA-32 # -x? specifies compile solely for ? [not specifically IA-32 compatible] # -# where ? is +# where ? is # K - PIII # W - first P4 [Williamette] # N - P4 Northwood @@ -51,7 +51,7 @@ CFLAGS += -O2 -xP -ip endif ifndef IGNORE_SPEED -CFLAGS += -O3 -xP -ip +CFLAGS += -O3 -xP -ip endif # want to see stuff? @@ -215,7 +215,7 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o +src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ @@ -238,7 +238,7 @@ else GROUP=wheel endif -#ciphers come in two flavours... enc+dec and enc +#ciphers come in two flavours... enc+dec and enc aes_enc.o: aes.c aes_tab.c $(CC) $(CFLAGS) -DENCRYPT_ONLY -c aes.c -o aes_enc.o @@ -249,7 +249,7 @@ TVS=demos/tv_gen.o TIMINGS=demos/timing.o TESTS=demos/test.o -#ciphers come in two flavours... enc+dec and enc +#ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o @@ -290,7 +290,7 @@ timing: library $(TIMINGS) testprof/$(LIBTEST) test: library $(TESTS) testprof/$(LIBTEST) $(CC) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) - + #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. @@ -301,7 +301,6 @@ install: library install -g $(GROUP) -o $(USER) $(LIBTEST) $(DESTDIR)$(LIBPATH) install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) -# $Source: /cvs/libtom/libtomcrypt/makefile.icc,v $ -# $Revision: 1.77 $ -# $Date: 2007/06/20 13:14:31 $ - +# $Source$ +# $Revision$ +# $Date$ diff --git a/makefile.msvc b/makefile.msvc index 97388872e..54513748b 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -125,7 +125,7 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rs src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_import.obj \ src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj \ src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj \ -src/prngs/sprng.obj src/prngs/yarrow.obj +src/prngs/sprng.obj src/prngs/yarrow.obj HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ @@ -143,7 +143,7 @@ src/ciphers/aes/aes_enc.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c library: $(OBJECTS) lib /out:tomcrypt.lib $(OBJECTS) - cd testprof + cd testprof nmake -f makefile.msvc cd .. @@ -159,6 +159,6 @@ test: demos/test.c library timing: demos/timing.c library cl $(CFLAGS) demos/timing.c testprof/tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) -# $Source: /cvs/libtom/libtomcrypt/makefile.msvc,v $ -# $Revision: 1.55 $ -# $Date: 2007/06/20 13:14:31 $ +# $Source$ +# $Revision$ +# $Date$ diff --git a/makefile.shared b/makefile.shared index f112b5983..7bc9b8efa 100644 --- a/makefile.shared +++ b/makefile.shared @@ -2,14 +2,14 @@ # # This makefile produces a shared object and requires libtool to be installed. # -# Thanks to Zed Shaw for helping debug this on BSD/OSX. +# Thanks to Zed Shaw for helping debug this on BSD/OSX. # Tom St Denis # The version VERSION=0:117 # Compiler and Linker Names -CC=libtool --mode=compile --tag=CC gcc +CC=libtool --mode=compile --tag=CC gcc # ranlib tools ifndef RANLIB @@ -22,7 +22,7 @@ CFLAGS += -c -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -DLTC_SOURCE # additional warnings (newer GCC 3.4 and higher) ifdef GCC_34 CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wmissing-prototypes \ - -Wmissing-declarations -Wpointer-arith + -Wmissing-declarations -Wpointer-arith endif @@ -92,9 +92,9 @@ USER=root endif ifdef INSTALL_GROUP -GROUP=$(INSTALL_GROUP) +GROUP=$(INSTALL_GROUP) else -GROUP=wheel +GROUP=wheel endif #List of objects to compile. @@ -220,7 +220,7 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o +src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ @@ -241,7 +241,7 @@ TIMINGS=demos/timing.o #The default rule for make builds the libtomcrypt library. default:library -#ciphers come in two flavours... enc+dec and enc +#ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o @@ -276,7 +276,7 @@ hashsum: library gcc -o hashsum hashsum.o -ltomcrypt $(EXTRALIBS) #makes the crypt program -crypt: library +crypt: library gcc $(CFLAGS) demos/encrypt.c -o encrypt.o gcc -o crypt encrypt.o -ltomcrypt $(EXTRALIBS) @@ -289,6 +289,6 @@ test: library testprof/$(LIBTEST) $(TESTS) timing: library testprof/$(LIBTEST) $(TIMINGS) gcc -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS) -# $Source: /cvs/libtom/libtomcrypt/makefile.shared,v $ -# $Revision: 1.81 $ -# $Date: 2007/06/20 13:14:31 $ +# $Source$ +# $Revision$ +# $Date$ diff --git a/makefile.unix b/makefile.unix index 4d9667884..d5d2479bc 100644 --- a/makefile.unix +++ b/makefile.unix @@ -161,7 +161,7 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o +src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ @@ -189,7 +189,7 @@ COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip #The default rule for make builds the libtomcrypt library. default:library -#ciphers come in two flavours... enc+dec and enc +#ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o @@ -203,8 +203,8 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) -testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE) +testprof/$(LIBTEST): + cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE) $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) @@ -249,6 +249,6 @@ install_test: testprof/$(LIBTEST) install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) install -g $(GROUP) -o $(USER) testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) -# $Source: /cvs/libtom/libtomcrypt/makefile.unix,v $ -# $Revision: 1.8 $ -# $Date: 2007/06/20 13:14:31 $ +# $Source$ +# $Revision$ +# $Date$ From 3eae4b42fb18ef9f13581430e993b4cae0344074 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 1 Oct 2013 23:08:30 +0200 Subject: [PATCH 0105/1192] makefile: allow CC to be replaced this allows building with clang by doing: CC=clang PREFIX=llvm- make --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index c5138cb15..ec33e5a15 100644 --- a/makefile +++ b/makefile @@ -13,7 +13,7 @@ ifndef PREFIX PREFIX= endif -CC=$(PREFIX)gcc +CC?=$(PREFIX)gcc LD=$(PREFIX)ld AR=$(PREFIX)ar From a667a93d52756118da2fb21d38a5b881d6447743 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 2 Oct 2013 01:02:58 +0200 Subject: [PATCH 0106/1192] trim trailing spaces --- .../der/sequence/der_decode_sequence_ex.c | 28 ++++++------ src/pk/dh/dh_sys.c | 44 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 8dd29ab88..2b8bff0a4 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -37,7 +37,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, LTC_ARGCHK(in != NULL); LTC_ARGCHK(list != NULL); - + /* get blk size */ if (inlen < 2) { return CRYPT_INVALID_PACKET; @@ -78,7 +78,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, /* mark all as unused */ for (i = 0; i < (int)outlen; i++) { list[i].used = 0; - } + } /* ok read data */ inlen = blksize; @@ -89,7 +89,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, data = list[i].data; if (!ordered && list[i].used == 1) { continue; } - if (type == LTC_ASN1_EOL) { + if (type == LTC_ASN1_EOL) { break; } @@ -103,7 +103,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, goto LBL_ERR; } break; - + case LTC_ASN1_INTEGER: z = inlen; if ((err = der_decode_integer(in + x, z, data)) != CRYPT_OK) { @@ -124,7 +124,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, if ((err = der_length_short_integer(((unsigned long*)data)[0], &z)) != CRYPT_OK) { goto LBL_ERR; } - + break; case LTC_ASN1_BIT_STRING: @@ -171,7 +171,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } z = 2; break; - + case LTC_ASN1_OBJECT_IDENTIFIER: z = inlen; if ((err = der_decode_object_identifier(in + x, z, data, &size)) != CRYPT_OK) { @@ -239,7 +239,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, goto LBL_ERR; } break; - + case LTC_ASN1_SETOF: case LTC_ASN1_SEQUENCE: /* detect if we have the right type */ @@ -274,24 +274,24 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, x += z; inlen -= z; list[i].used = 1; - if (!ordered) { + if (!ordered) { /* restart the decoder */ i = -1; - } + } } - + for (i = 0; i < (int)outlen; i++) { if (list[i].used == 0) { err = CRYPT_INVALID_PACKET; goto LBL_ERR; } - } - err = CRYPT_OK; + } + err = CRYPT_OK; LBL_ERR: return err; -} - +} + #endif /* $Source$ */ diff --git a/src/pk/dh/dh_sys.c b/src/pk/dh/dh_sys.c index e2db2424a..a68754604 100644 --- a/src/pk/dh/dh_sys.c +++ b/src/pk/dh/dh_sys.c @@ -13,7 +13,7 @@ @file dh_sys.c DH Crypto, Tom St Denis */ - + /** Encrypt a short symmetric key with a public DH key @param in The symmetric key to encrypt @@ -154,7 +154,7 @@ int dh_encrypt_key(const unsigned char *in, unsigned long inlen, @return CRYPT_OK if successful */ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, + unsigned char *out, unsigned long *outlen, dh_key *key) { unsigned char *shared_secret, *skey; @@ -211,7 +211,7 @@ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, /* get public key */ LOAD32L(x, in+y); - + /* now check if the imported key will fit */ if (inlen < x) { err = CRYPT_INVALID_PACKET; @@ -219,7 +219,7 @@ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, } else { inlen -= x; } - + y += 4; if ((err = dh_import(in+y, x, &pubkey)) != CRYPT_OK) { goto LBL_ERR; @@ -241,7 +241,7 @@ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, /* load in the encrypted key */ LOAD32L(keysize, in+y); - + /* will the out fit as part of the input */ if (inlen < keysize) { err = CRYPT_INVALID_PACKET; @@ -249,7 +249,7 @@ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, } else { inlen -= keysize; } - + if (keysize > *outlen) { err = CRYPT_BUFFER_OVERFLOW; goto LBL_ERR; @@ -275,27 +275,27 @@ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, return err; } -/* perform an ElGamal Signature of a hash +/* perform an ElGamal Signature of a hash * * The math works as follows. x is the private key, M is the message to sign - + 1. pick a random k 2. compute a = g^k mod p 3. compute b = (M - xa)/k mod p 4. Send (a,b) - + Now to verify with y=g^x mod p, a and b - + 1. compute y^a * a^b = g^(xa) * g^(k*(M-xa)/k) = g^(xa + (M - xa)) = g^M [all mod p] - + 2. Compare against g^M mod p [based on input hash]. - 3. If result of #2 == result of #1 then signature valid + 3. If result of #2 == result of #1 then signature valid */ /** - Sign a message digest using a DH private key + Sign a message digest using a DH private key @param in The data to sign @param inlen The length of the input (octets) @param out [out] The destination of the signature @@ -338,16 +338,16 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, /* make up a random value k, * since the order of the group is prime - * we need not check if gcd(k, r) is 1 + * we need not check if gcd(k, r) is 1 */ - if (prng_descriptor[wprng].read(buf, sets[key->idx].size, prng) != + if (prng_descriptor[wprng].read(buf, sets[key->idx].size, prng) != (unsigned long)(sets[key->idx].size)) { err = CRYPT_ERROR_READPRNG; goto LBL_ERR; } /* init bignums */ - if ((err = mp_init_multi(&a, &b, &k, &m, &p, &g, &p1, &tmp, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&a, &b, &k, &m, &p, &g, &p1, &tmp, NULL)) != CRYPT_OK) { goto LBL_ERR; } @@ -369,13 +369,13 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, if ((err = mp_mulmod(a, key->x, p1, tmp)) != CRYPT_OK) { goto error; } /* tmp = xa */ if ((err = mp_submod(m, tmp, p1, tmp)) != CRYPT_OK) { goto error; } /* tmp = M - xa */ if ((err = mp_mulmod(k, tmp, p1, b)) != CRYPT_OK) { goto error; } /* b = (M - xa)/k */ - + /* check for overflow */ if ((unsigned long)(PACKET_SIZE + 4 + 4 + mp_unsigned_bin_size(a) + mp_unsigned_bin_size(b)) > *outlen) { err = CRYPT_BUFFER_OVERFLOW; goto LBL_ERR; } - + /* store header */ y = PACKET_SIZE; @@ -423,7 +423,7 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, @return CRYPT_OK if succsessful (even if signature is invalid) */ int dh_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, + const unsigned char *hash, unsigned long hashlen, int *stat, dh_key *key) { void *a, *b, *p, *g, *m, *tmp; @@ -441,18 +441,18 @@ int dh_verify_hash(const unsigned char *sig, unsigned long siglen, /* check initial input length */ if (siglen < PACKET_SIZE+4+4) { return CRYPT_INVALID_PACKET; - } + } /* header ok? */ if ((err = packet_valid_header((unsigned char *)sig, PACKET_SECT_DH, PACKET_SUB_SIGNED)) != CRYPT_OK) { return err; } - + /* get hash out of packet */ y = PACKET_SIZE; /* init all bignums */ - if ((err = mp_init_multi(&a, &p, &b, &g, &m, &tmp, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&a, &p, &b, &g, &m, &tmp, NULL)) != CRYPT_OK) { return err; } From fb65cd0772633bbd856feb76bb487e507a1e4847 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 2 Oct 2013 01:03:40 +0200 Subject: [PATCH 0107/1192] fix clang compiler warnings --- .../der/sequence/der_decode_sequence_ex.c | 5 ++- src/pk/dh/dh_sys.c | 31 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 2b8bff0a4..27d66141d 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -50,9 +50,12 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } ++x; + /* check if the msb is set, which signals that the + * 7 lsb bits represent the number of bytes of the length + */ if (in[x] < 128) { blksize = in[x++]; - } else if (in[x] & 0x80) { + } else { if (in[x] < 0x81 || in[x] > 0x83) { return CRYPT_INVALID_PACKET; } diff --git a/src/pk/dh/dh_sys.c b/src/pk/dh/dh_sys.c index a68754604..e46468664 100644 --- a/src/pk/dh/dh_sys.c +++ b/src/pk/dh/dh_sys.c @@ -343,7 +343,7 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, if (prng_descriptor[wprng].read(buf, sets[key->idx].size, prng) != (unsigned long)(sets[key->idx].size)) { err = CRYPT_ERROR_READPRNG; - goto LBL_ERR; + goto LBL_ERR_1; } /* init bignums */ @@ -352,23 +352,23 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, } /* load k and m */ - if ((err = mp_read_unsigned_bin(m, (unsigned char *)in, inlen)) != CRYPT_OK) { goto error; } - if ((err = mp_read_unsigned_bin(k, buf, sets[key->idx].size)) != CRYPT_OK) { goto error; } + if ((err = mp_read_unsigned_bin(m, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(k, buf, sets[key->idx].size)) != CRYPT_OK) { goto LBL_ERR; } /* load g, p and p1 */ - if ((err = mp_read_radix(g, sets[key->idx].base, 64)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p, sets[key->idx].prime, 64)) != CRYPT_OK) { goto error; } - if ((err = mp_sub_d(p, 1, p1)) != CRYPT_OK) { goto error; } - if ((err = mp_div_2(p1, p1)) != CRYPT_OK) { goto error; } /* p1 = (p-1)/2 */ + if ((err = mp_read_radix(g, sets[key->idx].base, 64)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(p, sets[key->idx].prime, 64)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_sub_d(p, 1, p1)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_div_2(p1, p1)) != CRYPT_OK) { goto LBL_ERR; } /* p1 = (p-1)/2 */ /* now get a = g^k mod p */ - if ((err = mp_exptmod(g, k, p, a)) != CRYPT_OK) { goto error; } + if ((err = mp_exptmod(g, k, p, a)) != CRYPT_OK) { goto LBL_ERR; } /* now find M = xa + kb mod p1 or just b = (M - xa)/k mod p1 */ - if ((err = mp_invmod(k, p1, k)) != CRYPT_OK) { goto error; } /* k = 1/k mod p1 */ - if ((err = mp_mulmod(a, key->x, p1, tmp)) != CRYPT_OK) { goto error; } /* tmp = xa */ - if ((err = mp_submod(m, tmp, p1, tmp)) != CRYPT_OK) { goto error; } /* tmp = M - xa */ - if ((err = mp_mulmod(k, tmp, p1, b)) != CRYPT_OK) { goto error; } /* b = (M - xa)/k */ + if ((err = mp_invmod(k, p1, k)) != CRYPT_OK) { goto LBL_ERR; } /* k = 1/k mod p1 */ + if ((err = mp_mulmod(a, key->x, p1, tmp)) != CRYPT_OK) { goto LBL_ERR; } /* tmp = xa */ + if ((err = mp_submod(m, tmp, p1, tmp)) != CRYPT_OK) { goto LBL_ERR; } /* tmp = M - xa */ + if ((err = mp_mulmod(k, tmp, p1, b)) != CRYPT_OK) { goto LBL_ERR; } /* b = (M - xa)/k */ /* check for overflow */ if ((unsigned long)(PACKET_SIZE + 4 + 4 + mp_unsigned_bin_size(a) + mp_unsigned_bin_size(b)) > *outlen) { @@ -382,12 +382,12 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, /* now store them both (a,b) */ x = (unsigned long)mp_unsigned_bin_size(a); STORE32L(x, out+y); y += 4; - if ((err = mp_to_unsigned_bin(a, out+y)) != CRYPT_OK) { goto error; } + if ((err = mp_to_unsigned_bin(a, out+y)) != CRYPT_OK) { goto LBL_ERR; } y += x; x = (unsigned long)mp_unsigned_bin_size(b); STORE32L(x, out+y); y += 4; - if ((err = mp_to_unsigned_bin(b, out+y)) != CRYPT_OK) { goto error; } + if ((err = mp_to_unsigned_bin(b, out+y)) != CRYPT_OK) { goto LBL_ERR; } y += x; /* check if size too big */ @@ -401,10 +401,9 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, *outlen = y; err = CRYPT_OK; - goto LBL_ERR; -error: LBL_ERR: mp_clear_multi(tmp, p1, g, p, m, k, b, a, NULL); +LBL_ERR_1: XFREE(buf); From 73c201da1f51ee2a6a0c438a867e89b9001c987d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Sep 2013 14:24:14 +0200 Subject: [PATCH 0108/1192] add rsa_get_size() --- src/headers/tomcrypt_pk.h | 2 ++ src/pk/rsa/rsa_get_size.c | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/pk/rsa/rsa_get_size.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index c6540ca38..5d17f2909 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -51,6 +51,8 @@ typedef struct Rsa_key { int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key); +int rsa_get_size(rsa_key *key); + int rsa_exptmod(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, int which, rsa_key *key); diff --git a/src/pk/rsa/rsa_get_size.c b/src/pk/rsa/rsa_get_size.c new file mode 100644 index 000000000..79556fe8b --- /dev/null +++ b/src/pk/rsa/rsa_get_size.c @@ -0,0 +1,42 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file rsa_get_size.c + Retrieve the size of an RSA key, Steffen Jaeckel. +*/ + +#ifdef LTC_MRSA + +/** + Retrieve the size in bytes of an RSA key. + @param key The RSA key + @return The size in bytes of the RSA key or INT_MAX on error. +*/ +int rsa_get_size(rsa_key *key) +{ + int ret = INT_MAX; + LTC_ARGCHKVD(key != NULL); + + if (key) + { + ret = mp_unsigned_bin_size(key->N); + } /* if */ + + return ret; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From aacfec441eb88aced0b8204b6ad779d9ee54f5d8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Sep 2013 14:25:00 +0200 Subject: [PATCH 0109/1192] add rsa_sign_saltlen_get_max_ex() --- src/headers/tomcrypt_pk.h | 5 ++++ src/pk/rsa/rsa_sign_saltlen_get.c | 49 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/pk/rsa/rsa_sign_saltlen_get.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 5d17f2909..98c6ce82d 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -72,6 +72,9 @@ void rsa_free(rsa_key *key); #define rsa_verify_hash(_sig, _siglen, _hash, _hashlen, _hash_idx, _saltlen, _stat, _key) \ rsa_verify_hash_ex(_sig, _siglen, _hash, _hashlen, LTC_PKCS_1_PSS, _hash_idx, _saltlen, _stat, _key) +#define rsa_sign_saltlen_get_max(_hash_idx, _key) \ + rsa_sign_saltlen_get_max_ex(LTC_PKCS_1_PSS, _hash_idx, _key) + /* These can be switched between LTC_PKCS #1 v2.x and LTC_PKCS #1 v1.5 paddings */ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, @@ -97,6 +100,8 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, int hash_idx, unsigned long saltlen, int *stat, rsa_key *key); +int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key); + /* LTC_PKCS #1 import/export */ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key); int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); diff --git a/src/pk/rsa/rsa_sign_saltlen_get.c b/src/pk/rsa/rsa_sign_saltlen_get.c new file mode 100644 index 000000000..83dfcf915 --- /dev/null +++ b/src/pk/rsa/rsa_sign_saltlen_get.c @@ -0,0 +1,49 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file rsa_sign_saltlen_get_ex.c + Retrieve the maximum size of the salt, Steffen Jaeckel. +*/ + +#ifdef LTC_MRSA + +/** + Retrieve the maximum possible size of the salt when creating a PKCS#1 PSS signature. + @param padding Type of padding (LTC_PKCS_1_PSS only) + @param hash_idx The index of the desired hash + @param key The RSA key + @return The maximum salt length in bytes or INT_MAX on error. +*/ +int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key) +{ + int ret = INT_MAX; + LTC_ARGCHKVD(key != NULL); + + if (hash_is_valid(hash_idx) && + (padding == LTC_PKCS_1_PSS)) + { + ret = rsa_get_size(key); + if (ret < INT_MAX) + { + ret -= (hash_descriptor[hash_idx].hashsize + 2); + } /* if */ + } /* if */ + + return ret; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From 25f4817d48cc89804b8bf999ad1f977066be97c8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Sep 2013 14:27:58 +0200 Subject: [PATCH 0110/1192] update makefiles --- makefile | 9 +++++---- makefile.icc | 9 +++++---- makefile.msvc | 9 +++++---- makefile.shared | 9 +++++---- makefile.unix | 9 +++++---- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/makefile b/makefile index ec33e5a15..36e0da544 100644 --- a/makefile +++ b/makefile @@ -231,10 +231,11 @@ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mg src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ -src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.icc b/makefile.icc index 03c557c7d..7a8f9af56 100644 --- a/makefile.icc +++ b/makefile.icc @@ -212,10 +212,11 @@ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mg src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ -src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.msvc b/makefile.msvc index 54513748b..73f20fc19 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -122,10 +122,11 @@ src/pk/katja/katja_make_key.obj src/pk/pkcs1/pkcs_1_i2osp.obj src/pk/pkcs1/pkcs_ src/pk/pkcs1/pkcs_1_oaep_decode.obj src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/pkcs1/pkcs_1_os2ip.obj \ src/pk/pkcs1/pkcs_1_pss_decode.obj src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj \ src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj \ -src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_import.obj \ -src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj \ -src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj \ -src/prngs/sprng.obj src/prngs/yarrow.obj +src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj \ +src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj \ +src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj src/prngs/rc4.obj \ +src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ +src/prngs/yarrow.obj HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.shared b/makefile.shared index 7bc9b8efa..67aa41ea8 100644 --- a/makefile.shared +++ b/makefile.shared @@ -217,10 +217,11 @@ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mg src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ -src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.unix b/makefile.unix index d5d2479bc..319368722 100644 --- a/makefile.unix +++ b/makefile.unix @@ -158,10 +158,11 @@ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mg src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ -src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ From bf1ccb629b3c806879488d7232ab70c697aa071d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 4 Sep 2013 22:45:29 +0200 Subject: [PATCH 0111/1192] fix rsa_sign_saltlen_get_max_ex() --- src/pk/rsa/rsa_sign_saltlen_get.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_sign_saltlen_get.c b/src/pk/rsa/rsa_sign_saltlen_get.c index 83dfcf915..5f0e68eb6 100644 --- a/src/pk/rsa/rsa_sign_saltlen_get.c +++ b/src/pk/rsa/rsa_sign_saltlen_get.c @@ -29,7 +29,7 @@ int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key) int ret = INT_MAX; LTC_ARGCHKVD(key != NULL); - if (hash_is_valid(hash_idx) && + if ((hash_is_valid(hash_idx) == CRYPT_OK) && (padding == LTC_PKCS_1_PSS)) { ret = rsa_get_size(key); From b1b15910ed9ea6fbed245f220195486253ef4cd7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Oct 2013 10:17:17 +0200 Subject: [PATCH 0112/1192] fix rng_get_bytes() when compiling with mingw-gcc --- src/prngs/rng_get_bytes.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index b8cc6f560..9193787c1 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -87,12 +87,16 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, #endif /* Try the Microsoft CSP */ -#if defined(WIN32) || defined(WINCE) -#define _WIN32_WINNT 0x0400 +#if defined(WIN32) || defined(_WIN32) || defined(WINCE) +#ifndef _WIN32_WINNT + #define _WIN32_WINNT 0x0400 +#endif #ifdef WINCE #define UNDER_CE #define ARM #endif + +#define WIN32_LEAN_AND_MEAN #include #include @@ -134,7 +138,7 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, #if defined(LTC_DEVRANDOM) x = rng_nix(out, outlen, callback); if (x != 0) { return x; } #endif -#ifdef WIN32 +#if defined(_WIN32) || defined(_WIN32) || defined(WINCE) x = rng_win32(out, outlen, callback); if (x != 0) { return x; } #endif #ifdef ANSI_RNG From 4f86ad7dcf3c507790baaf7bd1efb993fe22c73b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Oct 2013 10:17:53 +0200 Subject: [PATCH 0113/1192] hkdf: don't compile if not requested --- src/misc/hkdf/hkdf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index 279c8eda1..b6f24a066 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -4,6 +4,8 @@ #include +#ifdef LTC_HKDF + #ifndef MIN #define MIN(a,b) ((a)<(b))?(a):(b) #endif @@ -136,6 +138,7 @@ int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, XFREE(extracted); return err; } +#endif /* LTC_HKDF */ /* vim: set ts=2 sw=2 et ai si: */ From 947fe41bbb1580568fd64dc6bf545a5ca0302655 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 27 Oct 2013 21:49:26 +0200 Subject: [PATCH 0114/1192] Add URL safe base64 de-/encoding --- src/headers/tomcrypt_misc.h | 6 +++ src/misc/base64/base64_decode.c | 68 +++++++++++++++++++++++++++------ src/misc/base64/base64_encode.c | 57 ++++++++++++++++++++------- 3 files changed, 107 insertions(+), 24 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 1d43c91cd..47985ba47 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -7,6 +7,12 @@ int base64_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); #endif +int base64url_encode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); + +int base64url_decode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); + /* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ #ifdef LTC_HKDF diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 6fd0ba2af..726a76139 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -13,12 +13,13 @@ /** @file base64_decode.c Compliant base64 code donated by Wayne Scott (wscott@bitmover.com) + base64 URL Safe variant (RFC 4648 section 5) by Karel Miko */ #ifdef LTC_BASE64 -static const unsigned char map[256] = { +static const unsigned char map_base64[256] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -42,16 +43,33 @@ static const unsigned char map[256] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; -/** - base64 decode a block of memory - @param in The base64 data to decode - @param inlen The length of the base64 data - @param out [out] The destination of the binary decoded data - @param outlen [in/out] The max size and resulting size of the decoded data - @return CRYPT_OK if successful -*/ -int base64_decode(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen) +static const unsigned char map_base64url[256] = { +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, +255, 254, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 63, +255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255 }; + +int base64_decode_internal(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + const unsigned char *map) { unsigned long t, x, y, z; unsigned char c; @@ -96,6 +114,34 @@ int base64_decode(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } +/** + base64 decode a block of memory + @param in The base64 data to decode + @param inlen The length of the base64 data + @param out [out] The destination of the binary decoded data + @param outlen [in/out] The max size and resulting size of the decoded data + @return CRYPT_OK if successful +*/ +int base64_decode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + return base64_decode_internal(in, inlen, out, outlen, map_base64); +} + +/** + base64 (URL Safe, RFC 4648 section 5) decode a block of memory + @param in The base64 data to decode + @param inlen The length of the base64 data + @param out [out] The destination of the binary decoded data + @param outlen [in/out] The max size and resulting size of the decoded data + @return CRYPT_OK if successful +*/ +int base64url_decode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + return base64_decode_internal(in, inlen, out, outlen, map_base64url); +} + #endif diff --git a/src/misc/base64/base64_encode.c b/src/misc/base64/base64_encode.c index 58a82df47..a33276189 100644 --- a/src/misc/base64/base64_encode.c +++ b/src/misc/base64/base64_encode.c @@ -13,24 +13,21 @@ /** @file base64_encode.c Compliant base64 encoder donated by Wayne Scott (wscott@bitmover.com) + base64 URL Safe variant (RFC 4648 section 5) by Karel Miko */ #ifdef LTC_BASE64 -static const char *codes = +static const char *codes_base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -/** - base64 Encode a buffer (NUL terminated) - @param in The input buffer to encode - @param inlen The length of the input buffer - @param out [out] The destination of the base64 encoded data - @param outlen [in/out] The max size and resulting size - @return CRYPT_OK if successful -*/ -int base64_encode(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen) +static const char *codes_base64url = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + +int base64_encode_internal(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + const char *codes, int pad) { unsigned long i, len2, leven; unsigned char *p; @@ -61,8 +58,13 @@ int base64_encode(const unsigned char *in, unsigned long inlen, *p++ = codes[(a >> 2) & 0x3F]; *p++ = codes[(((a & 3) << 4) + (b >> 4)) & 0x3F]; - *p++ = (i+1 < inlen) ? codes[(((b & 0xf) << 2)) & 0x3F] : '='; - *p++ = '='; + if (pad) { + *p++ = (i+1 < inlen) ? codes[(((b & 0xf) << 2)) & 0x3F] : '='; + *p++ = '='; + } + else { + if (i+1 < inlen) *p++ = codes[(((b & 0xf) << 2)) & 0x3F]; + } } /* append a NULL byte */ @@ -73,6 +75,35 @@ int base64_encode(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } +/** + base64 Encode a buffer (NUL terminated) + @param in The input buffer to encode + @param inlen The length of the input buffer + @param out [out] The destination of the base64 encoded data + @param outlen [in/out] The max size and resulting size + @return CRYPT_OK if successful +*/ +int base64_encode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + return base64_encode_internal(in, inlen, out, outlen, codes_base64, 1); +} + + +/** + base64 (URL Safe, RFC 4648 section 5) Encode a buffer (NUL terminated) + @param in The input buffer to encode + @param inlen The length of the input buffer + @param out [out] The destination of the base64 encoded data + @param outlen [in/out] The max size and resulting size + @return CRYPT_OK if successful +*/ +int base64url_encode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + return base64_encode_internal(in, inlen, out, outlen, codes_base64url, 0); +} + #endif From d78aa37c10fe82208c3b153238c1d759be692ec4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 24 Nov 2013 22:11:44 +0100 Subject: [PATCH 0115/1192] base64: add define LTC_BASE64_URL, make _internal functions static --- src/headers/tomcrypt_custom.h | 2 ++ src/headers/tomcrypt_misc.h | 2 ++ src/misc/base64/base64_decode.c | 24 ++++++++++++++++-------- src/misc/base64/base64_encode.c | 16 ++++++++++++---- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 7e58adf1c..107ae1ac9 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -383,6 +383,8 @@ /* Various tidbits of modern neatoness */ #define LTC_BASE64 +/* ... and it's URL safe version */ +#define LTC_BASE64_URL /* Keep LTC_NO_HKDF for compatibility reasons * superseeded by LTC_NO_MISC*/ diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 47985ba47..e1e4457bb 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -7,11 +7,13 @@ int base64_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); #endif +#ifdef LTC_BASE64_URL int base64url_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); int base64url_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); +#endif /* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ #ifdef LTC_HKDF diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 726a76139..423dc435d 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -17,8 +17,9 @@ */ -#ifdef LTC_BASE64 +#if defined(LTC_BASE64) || defined (LTC_BASE64_URL) +#if defined(LTC_BASE64) static const unsigned char map_base64[256] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -42,7 +43,9 @@ static const unsigned char map_base64[256] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; +#endif /* LTC_BASE64 */ +#if defined(LTC_BASE64_URL) static const unsigned char map_base64url[256] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -66,8 +69,9 @@ static const unsigned char map_base64url[256] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; +#endif /* LTC_BASE64_URL */ -int base64_decode_internal(const unsigned char *in, unsigned long inlen, +static int _base64_decode_internal(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, const unsigned char *map) { @@ -84,8 +88,8 @@ int base64_decode_internal(const unsigned char *in, unsigned long inlen, c = map[in[x]&0xFF]; if (c == 255) continue; /* the final = symbols are read and used to trim the remaining bytes */ - if (c == 254) { - c = 0; + if (c == 254) { + c = 0; /* prevent g < 0 which would potentially allow an overflow later */ if (--g < 0) { return CRYPT_INVALID_PACKET; @@ -98,8 +102,8 @@ int base64_decode_internal(const unsigned char *in, unsigned long inlen, t = (t<<6)|c; if (++y == 4) { - if (z + g > *outlen) { - return CRYPT_BUFFER_OVERFLOW; + if (z + g > *outlen) { + return CRYPT_BUFFER_OVERFLOW; } out[z++] = (unsigned char)((t>>16)&255); if (g > 1) out[z++] = (unsigned char)((t>>8)&255); @@ -114,6 +118,7 @@ int base64_decode_internal(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } +#if defined(LTC_BASE64) /** base64 decode a block of memory @param in The base64 data to decode @@ -125,9 +130,11 @@ int base64_decode_internal(const unsigned char *in, unsigned long inlen, int base64_decode(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) { - return base64_decode_internal(in, inlen, out, outlen, map_base64); + return _base64_decode_internal(in, inlen, out, outlen, map_base64); } +#endif /* LTC_BASE64 */ +#if defined(LTC_BASE64_URL) /** base64 (URL Safe, RFC 4648 section 5) decode a block of memory @param in The base64 data to decode @@ -139,8 +146,9 @@ int base64_decode(const unsigned char *in, unsigned long inlen, int base64url_decode(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) { - return base64_decode_internal(in, inlen, out, outlen, map_base64url); + return _base64_decode_internal(in, inlen, out, outlen, map_base64url); } +#endif /* LTC_BASE64_URL */ #endif diff --git a/src/misc/base64/base64_encode.c b/src/misc/base64/base64_encode.c index a33276189..0e1a7c132 100644 --- a/src/misc/base64/base64_encode.c +++ b/src/misc/base64/base64_encode.c @@ -17,15 +17,19 @@ */ -#ifdef LTC_BASE64 +#if defined(LTC_BASE64) || defined (LTC_BASE64_URL) +#if defined(LTC_BASE64) static const char *codes_base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +#endif /* LTC_BASE64 */ +#if defined(LTC_BASE64_URL) static const char *codes_base64url = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; +#endif /* LTC_BASE64_URL */ -int base64_encode_internal(const unsigned char *in, unsigned long inlen, +static int _base64_encode_internal(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, const char *codes, int pad) { @@ -75,6 +79,7 @@ int base64_encode_internal(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } +#if defined(LTC_BASE64) /** base64 Encode a buffer (NUL terminated) @param in The input buffer to encode @@ -86,10 +91,12 @@ int base64_encode_internal(const unsigned char *in, unsigned long inlen, int base64_encode(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) { - return base64_encode_internal(in, inlen, out, outlen, codes_base64, 1); + return _base64_encode_internal(in, inlen, out, outlen, codes_base64, 1); } +#endif /* LTC_BASE64 */ +#if defined(LTC_BASE64_URL) /** base64 (URL Safe, RFC 4648 section 5) Encode a buffer (NUL terminated) @param in The input buffer to encode @@ -101,8 +108,9 @@ int base64_encode(const unsigned char *in, unsigned long inlen, int base64url_encode(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) { - return base64_encode_internal(in, inlen, out, outlen, codes_base64url, 0); + return _base64_encode_internal(in, inlen, out, outlen, codes_base64url, 0); } +#endif /* LTC_BASE64_URL */ #endif From 8e7777b5545e46ab545bd51f7fcde7957134ade2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 3 Jan 2014 15:16:59 +0100 Subject: [PATCH 0116/1192] trim trailing spaces/clean up --- src/ciphers/aes/aes.c | 104 +- src/ciphers/aes/aes_tab.c | 498 ++++----- src/ciphers/camellia.c | 338 +++--- src/ciphers/safer/safer.c | 16 +- src/ciphers/safer/safer_tab.c | 58 +- src/ciphers/safer/saferp.c | 98 +- src/ciphers/twofish/twofish.c | 56 +- src/ciphers/twofish/twofish_tab.c | 800 +++++++------- src/encauth/ccm/ccm_memory.c | 8 +- src/encauth/ccm/ccm_memory_ex.c | 22 +- src/encauth/gcm/gcm_add_aad.c | 4 +- src/encauth/gcm/gcm_add_iv.c | 6 +- src/encauth/gcm/gcm_mult_h.c | 4 +- src/encauth/gcm/gcm_process.c | 16 +- src/hashes/sha2/sha224.c | 6 +- src/hashes/sha2/sha384.c | 6 +- src/hashes/whirl/whirl.c | 28 +- src/hashes/whirl/whirltab.c | 1010 +++++++++--------- src/headers/tomcrypt_cfg.h | 2 +- src/headers/tomcrypt_custom.h | 4 +- src/headers/tomcrypt_pk.h | 14 +- src/headers/tomcrypt_pkcs.h | 16 +- src/mac/f9/f9_process.c | 2 +- src/mac/hmac/hmac_done.c | 20 +- src/mac/hmac/hmac_file.c | 16 +- src/mac/hmac/hmac_init.c | 12 +- src/mac/hmac/hmac_memory.c | 20 +- src/mac/hmac/hmac_memory_multi.c | 22 +- src/mac/hmac/hmac_process.c | 10 +- src/mac/hmac/hmac_test.c | 92 +- src/mac/omac/omac_done.c | 10 +- src/mac/omac/omac_file.c | 12 +- src/mac/omac/omac_init.c | 10 +- src/mac/omac/omac_memory.c | 14 +- src/mac/omac/omac_memory_multi.c | 18 +- src/mac/omac/omac_process.c | 46 +- src/mac/omac/omac_test.c | 36 +- src/mac/pelican/pelican.c | 14 +- src/mac/pmac/pmac_process.c | 6 +- src/mac/xcbc/xcbc_process.c | 2 +- src/misc/crypt/crypt_argchk.c | 2 +- src/misc/pkcs5/pkcs_5_1.c | 18 +- src/misc/pkcs5/pkcs_5_2.c | 14 +- src/modes/cbc/cbc_decrypt.c | 14 +- src/modes/cbc/cbc_encrypt.c | 12 +- src/modes/ctr/ctr_encrypt.c | 6 +- src/modes/f8/f8_encrypt.c | 6 +- src/modes/lrw/lrw_process.c | 8 +- src/modes/lrw/lrw_setiv.c | 4 +- src/pk/asn1/der/integer/der_length_integer.c | 6 +- src/pk/asn1/der/set/der_encode_setof.c | 56 +- src/pk/dh/dh.c | 12 +- src/pk/ecc/ltc_ecc_mulmod.c | 6 +- src/pk/katja/katja_decrypt_key.c | 12 +- src/pk/katja/katja_encrypt_key.c | 20 +- src/pk/katja/katja_export.c | 32 +- src/pk/katja/katja_exptmod.c | 16 +- src/pk/katja/katja_import.c | 30 +- src/pk/pkcs1/pkcs_1_i2osp.c | 6 +- src/pk/pkcs1/pkcs_1_mgf1.c | 10 +- src/pk/pkcs1/pkcs_1_oaep_decode.c | 22 +- src/pk/pkcs1/pkcs_1_oaep_encode.c | 12 +- src/pk/pkcs1/pkcs_1_pss_decode.c | 18 +- src/pk/pkcs1/pkcs_1_pss_encode.c | 16 +- src/pk/pkcs1/pkcs_1_v1_5_decode.c | 8 +- src/pk/pkcs1/pkcs_1_v1_5_encode.c | 10 +- src/pk/rsa/rsa_decrypt_key.c | 6 +- src/pk/rsa/rsa_encrypt_key.c | 8 +- src/pk/rsa/rsa_export.c | 26 +- src/pk/rsa/rsa_exptmod.c | 2 +- src/pk/rsa/rsa_import.c | 38 +- src/pk/rsa/rsa_sign_hash.c | 6 +- src/pk/rsa/rsa_verify_hash.c | 8 +- src/prngs/rng_get_bytes.c | 28 +- src/prngs/sober128.c | 42 +- src/prngs/sober128tab.c | 6 +- testprof/dh_test.c | 7 +- testprof/pkcs_1_test.c | 8 +- testprof/rsa_test.c | 114 +- testprof/tomcrypt_test.h | 1 + 80 files changed, 2074 insertions(+), 2078 deletions(-) diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index bea512502..af538c5ec 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -12,8 +12,8 @@ /* AES implementation by Tom St Denis * * Derived from the Public Domain source code by - ---- + +--- * rijndael-alg-fst.c * * @version 3.0 (December 2000) @@ -28,13 +28,13 @@ /** @file aes.c Implementation of AES -*/ +*/ #include "tomcrypt.h" #ifdef LTC_RIJNDAEL -#ifndef ENCRYPT_ONLY +#ifndef ENCRYPT_ONLY #define SETUP rijndael_setup #define ECB_ENC rijndael_ecb_encrypt @@ -124,20 +124,20 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s ulong32 temp, *rk; #ifndef ENCRYPT_ONLY ulong32 *rrk; -#endif +#endif LTC_ARGCHK(key != NULL); LTC_ARGCHK(skey != NULL); - + if (keylen != 16 && keylen != 24 && keylen != 32) { return CRYPT_INVALID_KEYSIZE; } - + if (num_rounds != 0 && num_rounds != (10 + ((keylen/8)-2)*2)) { return CRYPT_INVALID_ROUNDS; } - + skey->rijndael.Nr = 10 + ((keylen/8)-2)*2; - + /* setup the forward key */ i = 0; rk = skey->rijndael.eK; @@ -159,12 +159,12 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s rk += 4; } } else if (keylen == 24) { - j = 52; + j = 52; LOAD32H(rk[4], key + 16); LOAD32H(rk[5], key + 20); for (;;) { #ifdef _MSC_VER - temp = skey->rijndael.eK[rk - skey->rijndael.eK + 5]; + temp = skey->rijndael.eK[rk - skey->rijndael.eK + 5]; #else temp = rk[5]; #endif @@ -187,7 +187,7 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s LOAD32H(rk[7], key + 28); for (;;) { #ifdef _MSC_VER - temp = skey->rijndael.eK[rk - skey->rijndael.eK + 7]; + temp = skey->rijndael.eK[rk - skey->rijndael.eK + 7]; #else temp = rk[7]; #endif @@ -210,11 +210,11 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s return CRYPT_ERROR; } -#ifndef ENCRYPT_ONLY +#ifndef ENCRYPT_ONLY /* setup the inverse key now */ rk = skey->rijndael.dK; - rrk = skey->rijndael.eK + j - 4; - + rrk = skey->rijndael.eK + j - 4; + /* apply the inverse MixColumn transform to all round keys but the first and the last: */ /* copy first */ *rk++ = *rrk++; @@ -222,11 +222,11 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s *rk++ = *rrk++; *rk = *rrk; rk -= 3; rrk -= 3; - + for (i = 1; i < skey->rijndael.Nr; i++) { rrk -= 4; rk += 4; - #ifdef LTC_SMALL_CODE + #ifdef LTC_SMALL_CODE temp = rrk[0]; rk[0] = setup_mix2(temp); temp = rrk[1]; @@ -260,8 +260,8 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s Tks1[byte(temp, 2)] ^ Tks2[byte(temp, 1)] ^ Tks3[byte(temp, 0)]; - #endif - + #endif + } /* copy last */ @@ -273,7 +273,7 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s *rk = *rrk; #endif /* ENCRYPT_ONLY */ - return CRYPT_OK; + return CRYPT_OK; } /** @@ -284,21 +284,21 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s @return CRYPT_OK if successful */ #ifdef LTC_CLEAN_STACK -static int _rijndael_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) +static int _rijndael_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) #else int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) #endif { ulong32 s0, s1, s2, s3, t0, t1, t2, t3, *rk; int Nr, r; - + LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - + Nr = skey->rijndael.Nr; rk = skey->rijndael.eK; - + /* * map byte array block to cipher state * and add initial round key: @@ -336,7 +336,7 @@ int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) Te2(byte(s1, 1)) ^ Te3(byte(s2, 0)) ^ rk[3]; - if (r == Nr-2) { + if (r == Nr-2) { break; } s0 = t0; s1 = t1; s2 = t2; s3 = t3; @@ -437,7 +437,7 @@ int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) (Te4_3[byte(t3, 3)]) ^ (Te4_2[byte(t0, 2)]) ^ (Te4_1[byte(t1, 1)]) ^ - (Te4_0[byte(t2, 0)]) ^ + (Te4_0[byte(t2, 0)]) ^ rk[3]; STORE32H(s3, ct+12); @@ -445,7 +445,7 @@ int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) } #ifdef LTC_CLEAN_STACK -int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) +int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) { int err = _rijndael_ecb_encrypt(pt, ct, skey); burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2); @@ -453,17 +453,17 @@ int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) } #endif -#ifndef ENCRYPT_ONLY +#ifndef ENCRYPT_ONLY /** Decrypts a block of text with AES @param ct The input ciphertext (16 bytes) @param pt The output plaintext (16 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ #ifdef LTC_CLEAN_STACK -static int _rijndael_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) +static int _rijndael_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) #else int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) #endif @@ -474,7 +474,7 @@ int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - + Nr = skey->rijndael.Nr; rk = skey->rijndael.dK; @@ -515,13 +515,13 @@ int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) Td3(byte(s0, 0)) ^ rk[3]; if (r == Nr-2) { - break; + break; } s0 = t0; s1 = t1; s2 = t2; s3 = t3; } rk += 4; -#else +#else /* * Nr - 1 full rounds: @@ -625,7 +625,7 @@ int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) #ifdef LTC_CLEAN_STACK -int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) +int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) { int err = _rijndael_ecb_decrypt(ct, pt, skey); burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2); @@ -641,54 +641,54 @@ int ECB_TEST(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else int err; static const struct { int keylen; unsigned char key[32], pt[16], ct[16]; } tests[] = { { 16, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, - { 0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30, + { 0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30, 0xd8, 0xcd, 0xb7, 0x80, 0x70, 0xb4, 0xc5, 0x5a } - }, { + }, { 24, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }, { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, - { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0, + { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0, 0x6e, 0xaf, 0x70, 0xa0, 0xec, 0x0d, 0x71, 0x91 } }, { 32, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, - { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf, + { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf, 0xea, 0xfc, 0x49, 0x90, 0x4b, 0x49, 0x60, 0x89 } } }; - + symmetric_key key; unsigned char tmp[2][16]; int i, y; - + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { zeromem(&key, sizeof(key)); - if ((err = rijndael_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) { + if ((err = rijndael_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) { return err; } - + rijndael_ecb_encrypt(tests[i].pt, tmp[0], &key); rijndael_ecb_decrypt(tmp[0], tmp[1], &key); - if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { + if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { #if 0 printf("\n\nTest %d failed\n", i); if (XMEMCMP(tmp[0], tests[i].ct, 16)) { @@ -704,7 +704,7 @@ int ECB_TEST(void) } printf("\n"); } -#endif +#endif return CRYPT_FAIL_TESTVECTOR; } @@ -713,7 +713,7 @@ int ECB_TEST(void) for (y = 0; y < 1000; y++) rijndael_ecb_encrypt(tmp[0], tmp[0], &key); for (y = 0; y < 1000; y++) rijndael_ecb_decrypt(tmp[0], tmp[0], &key); for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; - } + } return CRYPT_OK; #endif } @@ -721,7 +721,7 @@ int ECB_TEST(void) #endif /* ENCRYPT_ONLY */ -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void ECB_DONE(symmetric_key *skey) diff --git a/src/ciphers/aes/aes_tab.c b/src/ciphers/aes/aes_tab.c index ca7008d59..1c3de7051 100644 --- a/src/ciphers/aes/aes_tab.c +++ b/src/ciphers/aes/aes_tab.c @@ -26,7 +26,7 @@ Td4[x] = Si[x].[01, 01, 01, 01]; /** @file aes_tab.c AES tables -*/ +*/ static const ulong32 TE0[256] = { 0xc66363a5UL, 0xf87c7c84UL, 0xee777799UL, 0xf67b7b8dUL, 0xfff2f20dUL, 0xd66b6bbdUL, 0xde6f6fb1UL, 0x91c5c554UL, @@ -532,142 +532,142 @@ static const ulong32 TE3[256] = { #ifndef PELI_TAB static const ulong32 Te4_0[] = { -0x00000063UL, 0x0000007cUL, 0x00000077UL, 0x0000007bUL, 0x000000f2UL, 0x0000006bUL, 0x0000006fUL, 0x000000c5UL, -0x00000030UL, 0x00000001UL, 0x00000067UL, 0x0000002bUL, 0x000000feUL, 0x000000d7UL, 0x000000abUL, 0x00000076UL, -0x000000caUL, 0x00000082UL, 0x000000c9UL, 0x0000007dUL, 0x000000faUL, 0x00000059UL, 0x00000047UL, 0x000000f0UL, -0x000000adUL, 0x000000d4UL, 0x000000a2UL, 0x000000afUL, 0x0000009cUL, 0x000000a4UL, 0x00000072UL, 0x000000c0UL, -0x000000b7UL, 0x000000fdUL, 0x00000093UL, 0x00000026UL, 0x00000036UL, 0x0000003fUL, 0x000000f7UL, 0x000000ccUL, -0x00000034UL, 0x000000a5UL, 0x000000e5UL, 0x000000f1UL, 0x00000071UL, 0x000000d8UL, 0x00000031UL, 0x00000015UL, -0x00000004UL, 0x000000c7UL, 0x00000023UL, 0x000000c3UL, 0x00000018UL, 0x00000096UL, 0x00000005UL, 0x0000009aUL, -0x00000007UL, 0x00000012UL, 0x00000080UL, 0x000000e2UL, 0x000000ebUL, 0x00000027UL, 0x000000b2UL, 0x00000075UL, -0x00000009UL, 0x00000083UL, 0x0000002cUL, 0x0000001aUL, 0x0000001bUL, 0x0000006eUL, 0x0000005aUL, 0x000000a0UL, -0x00000052UL, 0x0000003bUL, 0x000000d6UL, 0x000000b3UL, 0x00000029UL, 0x000000e3UL, 0x0000002fUL, 0x00000084UL, -0x00000053UL, 0x000000d1UL, 0x00000000UL, 0x000000edUL, 0x00000020UL, 0x000000fcUL, 0x000000b1UL, 0x0000005bUL, -0x0000006aUL, 0x000000cbUL, 0x000000beUL, 0x00000039UL, 0x0000004aUL, 0x0000004cUL, 0x00000058UL, 0x000000cfUL, -0x000000d0UL, 0x000000efUL, 0x000000aaUL, 0x000000fbUL, 0x00000043UL, 0x0000004dUL, 0x00000033UL, 0x00000085UL, -0x00000045UL, 0x000000f9UL, 0x00000002UL, 0x0000007fUL, 0x00000050UL, 0x0000003cUL, 0x0000009fUL, 0x000000a8UL, -0x00000051UL, 0x000000a3UL, 0x00000040UL, 0x0000008fUL, 0x00000092UL, 0x0000009dUL, 0x00000038UL, 0x000000f5UL, -0x000000bcUL, 0x000000b6UL, 0x000000daUL, 0x00000021UL, 0x00000010UL, 0x000000ffUL, 0x000000f3UL, 0x000000d2UL, -0x000000cdUL, 0x0000000cUL, 0x00000013UL, 0x000000ecUL, 0x0000005fUL, 0x00000097UL, 0x00000044UL, 0x00000017UL, -0x000000c4UL, 0x000000a7UL, 0x0000007eUL, 0x0000003dUL, 0x00000064UL, 0x0000005dUL, 0x00000019UL, 0x00000073UL, -0x00000060UL, 0x00000081UL, 0x0000004fUL, 0x000000dcUL, 0x00000022UL, 0x0000002aUL, 0x00000090UL, 0x00000088UL, -0x00000046UL, 0x000000eeUL, 0x000000b8UL, 0x00000014UL, 0x000000deUL, 0x0000005eUL, 0x0000000bUL, 0x000000dbUL, -0x000000e0UL, 0x00000032UL, 0x0000003aUL, 0x0000000aUL, 0x00000049UL, 0x00000006UL, 0x00000024UL, 0x0000005cUL, -0x000000c2UL, 0x000000d3UL, 0x000000acUL, 0x00000062UL, 0x00000091UL, 0x00000095UL, 0x000000e4UL, 0x00000079UL, -0x000000e7UL, 0x000000c8UL, 0x00000037UL, 0x0000006dUL, 0x0000008dUL, 0x000000d5UL, 0x0000004eUL, 0x000000a9UL, -0x0000006cUL, 0x00000056UL, 0x000000f4UL, 0x000000eaUL, 0x00000065UL, 0x0000007aUL, 0x000000aeUL, 0x00000008UL, -0x000000baUL, 0x00000078UL, 0x00000025UL, 0x0000002eUL, 0x0000001cUL, 0x000000a6UL, 0x000000b4UL, 0x000000c6UL, -0x000000e8UL, 0x000000ddUL, 0x00000074UL, 0x0000001fUL, 0x0000004bUL, 0x000000bdUL, 0x0000008bUL, 0x0000008aUL, -0x00000070UL, 0x0000003eUL, 0x000000b5UL, 0x00000066UL, 0x00000048UL, 0x00000003UL, 0x000000f6UL, 0x0000000eUL, -0x00000061UL, 0x00000035UL, 0x00000057UL, 0x000000b9UL, 0x00000086UL, 0x000000c1UL, 0x0000001dUL, 0x0000009eUL, -0x000000e1UL, 0x000000f8UL, 0x00000098UL, 0x00000011UL, 0x00000069UL, 0x000000d9UL, 0x0000008eUL, 0x00000094UL, -0x0000009bUL, 0x0000001eUL, 0x00000087UL, 0x000000e9UL, 0x000000ceUL, 0x00000055UL, 0x00000028UL, 0x000000dfUL, -0x0000008cUL, 0x000000a1UL, 0x00000089UL, 0x0000000dUL, 0x000000bfUL, 0x000000e6UL, 0x00000042UL, 0x00000068UL, +0x00000063UL, 0x0000007cUL, 0x00000077UL, 0x0000007bUL, 0x000000f2UL, 0x0000006bUL, 0x0000006fUL, 0x000000c5UL, +0x00000030UL, 0x00000001UL, 0x00000067UL, 0x0000002bUL, 0x000000feUL, 0x000000d7UL, 0x000000abUL, 0x00000076UL, +0x000000caUL, 0x00000082UL, 0x000000c9UL, 0x0000007dUL, 0x000000faUL, 0x00000059UL, 0x00000047UL, 0x000000f0UL, +0x000000adUL, 0x000000d4UL, 0x000000a2UL, 0x000000afUL, 0x0000009cUL, 0x000000a4UL, 0x00000072UL, 0x000000c0UL, +0x000000b7UL, 0x000000fdUL, 0x00000093UL, 0x00000026UL, 0x00000036UL, 0x0000003fUL, 0x000000f7UL, 0x000000ccUL, +0x00000034UL, 0x000000a5UL, 0x000000e5UL, 0x000000f1UL, 0x00000071UL, 0x000000d8UL, 0x00000031UL, 0x00000015UL, +0x00000004UL, 0x000000c7UL, 0x00000023UL, 0x000000c3UL, 0x00000018UL, 0x00000096UL, 0x00000005UL, 0x0000009aUL, +0x00000007UL, 0x00000012UL, 0x00000080UL, 0x000000e2UL, 0x000000ebUL, 0x00000027UL, 0x000000b2UL, 0x00000075UL, +0x00000009UL, 0x00000083UL, 0x0000002cUL, 0x0000001aUL, 0x0000001bUL, 0x0000006eUL, 0x0000005aUL, 0x000000a0UL, +0x00000052UL, 0x0000003bUL, 0x000000d6UL, 0x000000b3UL, 0x00000029UL, 0x000000e3UL, 0x0000002fUL, 0x00000084UL, +0x00000053UL, 0x000000d1UL, 0x00000000UL, 0x000000edUL, 0x00000020UL, 0x000000fcUL, 0x000000b1UL, 0x0000005bUL, +0x0000006aUL, 0x000000cbUL, 0x000000beUL, 0x00000039UL, 0x0000004aUL, 0x0000004cUL, 0x00000058UL, 0x000000cfUL, +0x000000d0UL, 0x000000efUL, 0x000000aaUL, 0x000000fbUL, 0x00000043UL, 0x0000004dUL, 0x00000033UL, 0x00000085UL, +0x00000045UL, 0x000000f9UL, 0x00000002UL, 0x0000007fUL, 0x00000050UL, 0x0000003cUL, 0x0000009fUL, 0x000000a8UL, +0x00000051UL, 0x000000a3UL, 0x00000040UL, 0x0000008fUL, 0x00000092UL, 0x0000009dUL, 0x00000038UL, 0x000000f5UL, +0x000000bcUL, 0x000000b6UL, 0x000000daUL, 0x00000021UL, 0x00000010UL, 0x000000ffUL, 0x000000f3UL, 0x000000d2UL, +0x000000cdUL, 0x0000000cUL, 0x00000013UL, 0x000000ecUL, 0x0000005fUL, 0x00000097UL, 0x00000044UL, 0x00000017UL, +0x000000c4UL, 0x000000a7UL, 0x0000007eUL, 0x0000003dUL, 0x00000064UL, 0x0000005dUL, 0x00000019UL, 0x00000073UL, +0x00000060UL, 0x00000081UL, 0x0000004fUL, 0x000000dcUL, 0x00000022UL, 0x0000002aUL, 0x00000090UL, 0x00000088UL, +0x00000046UL, 0x000000eeUL, 0x000000b8UL, 0x00000014UL, 0x000000deUL, 0x0000005eUL, 0x0000000bUL, 0x000000dbUL, +0x000000e0UL, 0x00000032UL, 0x0000003aUL, 0x0000000aUL, 0x00000049UL, 0x00000006UL, 0x00000024UL, 0x0000005cUL, +0x000000c2UL, 0x000000d3UL, 0x000000acUL, 0x00000062UL, 0x00000091UL, 0x00000095UL, 0x000000e4UL, 0x00000079UL, +0x000000e7UL, 0x000000c8UL, 0x00000037UL, 0x0000006dUL, 0x0000008dUL, 0x000000d5UL, 0x0000004eUL, 0x000000a9UL, +0x0000006cUL, 0x00000056UL, 0x000000f4UL, 0x000000eaUL, 0x00000065UL, 0x0000007aUL, 0x000000aeUL, 0x00000008UL, +0x000000baUL, 0x00000078UL, 0x00000025UL, 0x0000002eUL, 0x0000001cUL, 0x000000a6UL, 0x000000b4UL, 0x000000c6UL, +0x000000e8UL, 0x000000ddUL, 0x00000074UL, 0x0000001fUL, 0x0000004bUL, 0x000000bdUL, 0x0000008bUL, 0x0000008aUL, +0x00000070UL, 0x0000003eUL, 0x000000b5UL, 0x00000066UL, 0x00000048UL, 0x00000003UL, 0x000000f6UL, 0x0000000eUL, +0x00000061UL, 0x00000035UL, 0x00000057UL, 0x000000b9UL, 0x00000086UL, 0x000000c1UL, 0x0000001dUL, 0x0000009eUL, +0x000000e1UL, 0x000000f8UL, 0x00000098UL, 0x00000011UL, 0x00000069UL, 0x000000d9UL, 0x0000008eUL, 0x00000094UL, +0x0000009bUL, 0x0000001eUL, 0x00000087UL, 0x000000e9UL, 0x000000ceUL, 0x00000055UL, 0x00000028UL, 0x000000dfUL, +0x0000008cUL, 0x000000a1UL, 0x00000089UL, 0x0000000dUL, 0x000000bfUL, 0x000000e6UL, 0x00000042UL, 0x00000068UL, 0x00000041UL, 0x00000099UL, 0x0000002dUL, 0x0000000fUL, 0x000000b0UL, 0x00000054UL, 0x000000bbUL, 0x00000016UL }; static const ulong32 Te4_1[] = { -0x00006300UL, 0x00007c00UL, 0x00007700UL, 0x00007b00UL, 0x0000f200UL, 0x00006b00UL, 0x00006f00UL, 0x0000c500UL, -0x00003000UL, 0x00000100UL, 0x00006700UL, 0x00002b00UL, 0x0000fe00UL, 0x0000d700UL, 0x0000ab00UL, 0x00007600UL, -0x0000ca00UL, 0x00008200UL, 0x0000c900UL, 0x00007d00UL, 0x0000fa00UL, 0x00005900UL, 0x00004700UL, 0x0000f000UL, -0x0000ad00UL, 0x0000d400UL, 0x0000a200UL, 0x0000af00UL, 0x00009c00UL, 0x0000a400UL, 0x00007200UL, 0x0000c000UL, -0x0000b700UL, 0x0000fd00UL, 0x00009300UL, 0x00002600UL, 0x00003600UL, 0x00003f00UL, 0x0000f700UL, 0x0000cc00UL, -0x00003400UL, 0x0000a500UL, 0x0000e500UL, 0x0000f100UL, 0x00007100UL, 0x0000d800UL, 0x00003100UL, 0x00001500UL, -0x00000400UL, 0x0000c700UL, 0x00002300UL, 0x0000c300UL, 0x00001800UL, 0x00009600UL, 0x00000500UL, 0x00009a00UL, -0x00000700UL, 0x00001200UL, 0x00008000UL, 0x0000e200UL, 0x0000eb00UL, 0x00002700UL, 0x0000b200UL, 0x00007500UL, -0x00000900UL, 0x00008300UL, 0x00002c00UL, 0x00001a00UL, 0x00001b00UL, 0x00006e00UL, 0x00005a00UL, 0x0000a000UL, -0x00005200UL, 0x00003b00UL, 0x0000d600UL, 0x0000b300UL, 0x00002900UL, 0x0000e300UL, 0x00002f00UL, 0x00008400UL, -0x00005300UL, 0x0000d100UL, 0x00000000UL, 0x0000ed00UL, 0x00002000UL, 0x0000fc00UL, 0x0000b100UL, 0x00005b00UL, -0x00006a00UL, 0x0000cb00UL, 0x0000be00UL, 0x00003900UL, 0x00004a00UL, 0x00004c00UL, 0x00005800UL, 0x0000cf00UL, -0x0000d000UL, 0x0000ef00UL, 0x0000aa00UL, 0x0000fb00UL, 0x00004300UL, 0x00004d00UL, 0x00003300UL, 0x00008500UL, -0x00004500UL, 0x0000f900UL, 0x00000200UL, 0x00007f00UL, 0x00005000UL, 0x00003c00UL, 0x00009f00UL, 0x0000a800UL, -0x00005100UL, 0x0000a300UL, 0x00004000UL, 0x00008f00UL, 0x00009200UL, 0x00009d00UL, 0x00003800UL, 0x0000f500UL, -0x0000bc00UL, 0x0000b600UL, 0x0000da00UL, 0x00002100UL, 0x00001000UL, 0x0000ff00UL, 0x0000f300UL, 0x0000d200UL, -0x0000cd00UL, 0x00000c00UL, 0x00001300UL, 0x0000ec00UL, 0x00005f00UL, 0x00009700UL, 0x00004400UL, 0x00001700UL, -0x0000c400UL, 0x0000a700UL, 0x00007e00UL, 0x00003d00UL, 0x00006400UL, 0x00005d00UL, 0x00001900UL, 0x00007300UL, -0x00006000UL, 0x00008100UL, 0x00004f00UL, 0x0000dc00UL, 0x00002200UL, 0x00002a00UL, 0x00009000UL, 0x00008800UL, -0x00004600UL, 0x0000ee00UL, 0x0000b800UL, 0x00001400UL, 0x0000de00UL, 0x00005e00UL, 0x00000b00UL, 0x0000db00UL, -0x0000e000UL, 0x00003200UL, 0x00003a00UL, 0x00000a00UL, 0x00004900UL, 0x00000600UL, 0x00002400UL, 0x00005c00UL, -0x0000c200UL, 0x0000d300UL, 0x0000ac00UL, 0x00006200UL, 0x00009100UL, 0x00009500UL, 0x0000e400UL, 0x00007900UL, -0x0000e700UL, 0x0000c800UL, 0x00003700UL, 0x00006d00UL, 0x00008d00UL, 0x0000d500UL, 0x00004e00UL, 0x0000a900UL, -0x00006c00UL, 0x00005600UL, 0x0000f400UL, 0x0000ea00UL, 0x00006500UL, 0x00007a00UL, 0x0000ae00UL, 0x00000800UL, -0x0000ba00UL, 0x00007800UL, 0x00002500UL, 0x00002e00UL, 0x00001c00UL, 0x0000a600UL, 0x0000b400UL, 0x0000c600UL, -0x0000e800UL, 0x0000dd00UL, 0x00007400UL, 0x00001f00UL, 0x00004b00UL, 0x0000bd00UL, 0x00008b00UL, 0x00008a00UL, -0x00007000UL, 0x00003e00UL, 0x0000b500UL, 0x00006600UL, 0x00004800UL, 0x00000300UL, 0x0000f600UL, 0x00000e00UL, -0x00006100UL, 0x00003500UL, 0x00005700UL, 0x0000b900UL, 0x00008600UL, 0x0000c100UL, 0x00001d00UL, 0x00009e00UL, -0x0000e100UL, 0x0000f800UL, 0x00009800UL, 0x00001100UL, 0x00006900UL, 0x0000d900UL, 0x00008e00UL, 0x00009400UL, -0x00009b00UL, 0x00001e00UL, 0x00008700UL, 0x0000e900UL, 0x0000ce00UL, 0x00005500UL, 0x00002800UL, 0x0000df00UL, -0x00008c00UL, 0x0000a100UL, 0x00008900UL, 0x00000d00UL, 0x0000bf00UL, 0x0000e600UL, 0x00004200UL, 0x00006800UL, +0x00006300UL, 0x00007c00UL, 0x00007700UL, 0x00007b00UL, 0x0000f200UL, 0x00006b00UL, 0x00006f00UL, 0x0000c500UL, +0x00003000UL, 0x00000100UL, 0x00006700UL, 0x00002b00UL, 0x0000fe00UL, 0x0000d700UL, 0x0000ab00UL, 0x00007600UL, +0x0000ca00UL, 0x00008200UL, 0x0000c900UL, 0x00007d00UL, 0x0000fa00UL, 0x00005900UL, 0x00004700UL, 0x0000f000UL, +0x0000ad00UL, 0x0000d400UL, 0x0000a200UL, 0x0000af00UL, 0x00009c00UL, 0x0000a400UL, 0x00007200UL, 0x0000c000UL, +0x0000b700UL, 0x0000fd00UL, 0x00009300UL, 0x00002600UL, 0x00003600UL, 0x00003f00UL, 0x0000f700UL, 0x0000cc00UL, +0x00003400UL, 0x0000a500UL, 0x0000e500UL, 0x0000f100UL, 0x00007100UL, 0x0000d800UL, 0x00003100UL, 0x00001500UL, +0x00000400UL, 0x0000c700UL, 0x00002300UL, 0x0000c300UL, 0x00001800UL, 0x00009600UL, 0x00000500UL, 0x00009a00UL, +0x00000700UL, 0x00001200UL, 0x00008000UL, 0x0000e200UL, 0x0000eb00UL, 0x00002700UL, 0x0000b200UL, 0x00007500UL, +0x00000900UL, 0x00008300UL, 0x00002c00UL, 0x00001a00UL, 0x00001b00UL, 0x00006e00UL, 0x00005a00UL, 0x0000a000UL, +0x00005200UL, 0x00003b00UL, 0x0000d600UL, 0x0000b300UL, 0x00002900UL, 0x0000e300UL, 0x00002f00UL, 0x00008400UL, +0x00005300UL, 0x0000d100UL, 0x00000000UL, 0x0000ed00UL, 0x00002000UL, 0x0000fc00UL, 0x0000b100UL, 0x00005b00UL, +0x00006a00UL, 0x0000cb00UL, 0x0000be00UL, 0x00003900UL, 0x00004a00UL, 0x00004c00UL, 0x00005800UL, 0x0000cf00UL, +0x0000d000UL, 0x0000ef00UL, 0x0000aa00UL, 0x0000fb00UL, 0x00004300UL, 0x00004d00UL, 0x00003300UL, 0x00008500UL, +0x00004500UL, 0x0000f900UL, 0x00000200UL, 0x00007f00UL, 0x00005000UL, 0x00003c00UL, 0x00009f00UL, 0x0000a800UL, +0x00005100UL, 0x0000a300UL, 0x00004000UL, 0x00008f00UL, 0x00009200UL, 0x00009d00UL, 0x00003800UL, 0x0000f500UL, +0x0000bc00UL, 0x0000b600UL, 0x0000da00UL, 0x00002100UL, 0x00001000UL, 0x0000ff00UL, 0x0000f300UL, 0x0000d200UL, +0x0000cd00UL, 0x00000c00UL, 0x00001300UL, 0x0000ec00UL, 0x00005f00UL, 0x00009700UL, 0x00004400UL, 0x00001700UL, +0x0000c400UL, 0x0000a700UL, 0x00007e00UL, 0x00003d00UL, 0x00006400UL, 0x00005d00UL, 0x00001900UL, 0x00007300UL, +0x00006000UL, 0x00008100UL, 0x00004f00UL, 0x0000dc00UL, 0x00002200UL, 0x00002a00UL, 0x00009000UL, 0x00008800UL, +0x00004600UL, 0x0000ee00UL, 0x0000b800UL, 0x00001400UL, 0x0000de00UL, 0x00005e00UL, 0x00000b00UL, 0x0000db00UL, +0x0000e000UL, 0x00003200UL, 0x00003a00UL, 0x00000a00UL, 0x00004900UL, 0x00000600UL, 0x00002400UL, 0x00005c00UL, +0x0000c200UL, 0x0000d300UL, 0x0000ac00UL, 0x00006200UL, 0x00009100UL, 0x00009500UL, 0x0000e400UL, 0x00007900UL, +0x0000e700UL, 0x0000c800UL, 0x00003700UL, 0x00006d00UL, 0x00008d00UL, 0x0000d500UL, 0x00004e00UL, 0x0000a900UL, +0x00006c00UL, 0x00005600UL, 0x0000f400UL, 0x0000ea00UL, 0x00006500UL, 0x00007a00UL, 0x0000ae00UL, 0x00000800UL, +0x0000ba00UL, 0x00007800UL, 0x00002500UL, 0x00002e00UL, 0x00001c00UL, 0x0000a600UL, 0x0000b400UL, 0x0000c600UL, +0x0000e800UL, 0x0000dd00UL, 0x00007400UL, 0x00001f00UL, 0x00004b00UL, 0x0000bd00UL, 0x00008b00UL, 0x00008a00UL, +0x00007000UL, 0x00003e00UL, 0x0000b500UL, 0x00006600UL, 0x00004800UL, 0x00000300UL, 0x0000f600UL, 0x00000e00UL, +0x00006100UL, 0x00003500UL, 0x00005700UL, 0x0000b900UL, 0x00008600UL, 0x0000c100UL, 0x00001d00UL, 0x00009e00UL, +0x0000e100UL, 0x0000f800UL, 0x00009800UL, 0x00001100UL, 0x00006900UL, 0x0000d900UL, 0x00008e00UL, 0x00009400UL, +0x00009b00UL, 0x00001e00UL, 0x00008700UL, 0x0000e900UL, 0x0000ce00UL, 0x00005500UL, 0x00002800UL, 0x0000df00UL, +0x00008c00UL, 0x0000a100UL, 0x00008900UL, 0x00000d00UL, 0x0000bf00UL, 0x0000e600UL, 0x00004200UL, 0x00006800UL, 0x00004100UL, 0x00009900UL, 0x00002d00UL, 0x00000f00UL, 0x0000b000UL, 0x00005400UL, 0x0000bb00UL, 0x00001600UL }; static const ulong32 Te4_2[] = { -0x00630000UL, 0x007c0000UL, 0x00770000UL, 0x007b0000UL, 0x00f20000UL, 0x006b0000UL, 0x006f0000UL, 0x00c50000UL, -0x00300000UL, 0x00010000UL, 0x00670000UL, 0x002b0000UL, 0x00fe0000UL, 0x00d70000UL, 0x00ab0000UL, 0x00760000UL, -0x00ca0000UL, 0x00820000UL, 0x00c90000UL, 0x007d0000UL, 0x00fa0000UL, 0x00590000UL, 0x00470000UL, 0x00f00000UL, -0x00ad0000UL, 0x00d40000UL, 0x00a20000UL, 0x00af0000UL, 0x009c0000UL, 0x00a40000UL, 0x00720000UL, 0x00c00000UL, -0x00b70000UL, 0x00fd0000UL, 0x00930000UL, 0x00260000UL, 0x00360000UL, 0x003f0000UL, 0x00f70000UL, 0x00cc0000UL, -0x00340000UL, 0x00a50000UL, 0x00e50000UL, 0x00f10000UL, 0x00710000UL, 0x00d80000UL, 0x00310000UL, 0x00150000UL, -0x00040000UL, 0x00c70000UL, 0x00230000UL, 0x00c30000UL, 0x00180000UL, 0x00960000UL, 0x00050000UL, 0x009a0000UL, -0x00070000UL, 0x00120000UL, 0x00800000UL, 0x00e20000UL, 0x00eb0000UL, 0x00270000UL, 0x00b20000UL, 0x00750000UL, -0x00090000UL, 0x00830000UL, 0x002c0000UL, 0x001a0000UL, 0x001b0000UL, 0x006e0000UL, 0x005a0000UL, 0x00a00000UL, -0x00520000UL, 0x003b0000UL, 0x00d60000UL, 0x00b30000UL, 0x00290000UL, 0x00e30000UL, 0x002f0000UL, 0x00840000UL, -0x00530000UL, 0x00d10000UL, 0x00000000UL, 0x00ed0000UL, 0x00200000UL, 0x00fc0000UL, 0x00b10000UL, 0x005b0000UL, -0x006a0000UL, 0x00cb0000UL, 0x00be0000UL, 0x00390000UL, 0x004a0000UL, 0x004c0000UL, 0x00580000UL, 0x00cf0000UL, -0x00d00000UL, 0x00ef0000UL, 0x00aa0000UL, 0x00fb0000UL, 0x00430000UL, 0x004d0000UL, 0x00330000UL, 0x00850000UL, -0x00450000UL, 0x00f90000UL, 0x00020000UL, 0x007f0000UL, 0x00500000UL, 0x003c0000UL, 0x009f0000UL, 0x00a80000UL, -0x00510000UL, 0x00a30000UL, 0x00400000UL, 0x008f0000UL, 0x00920000UL, 0x009d0000UL, 0x00380000UL, 0x00f50000UL, -0x00bc0000UL, 0x00b60000UL, 0x00da0000UL, 0x00210000UL, 0x00100000UL, 0x00ff0000UL, 0x00f30000UL, 0x00d20000UL, -0x00cd0000UL, 0x000c0000UL, 0x00130000UL, 0x00ec0000UL, 0x005f0000UL, 0x00970000UL, 0x00440000UL, 0x00170000UL, -0x00c40000UL, 0x00a70000UL, 0x007e0000UL, 0x003d0000UL, 0x00640000UL, 0x005d0000UL, 0x00190000UL, 0x00730000UL, -0x00600000UL, 0x00810000UL, 0x004f0000UL, 0x00dc0000UL, 0x00220000UL, 0x002a0000UL, 0x00900000UL, 0x00880000UL, -0x00460000UL, 0x00ee0000UL, 0x00b80000UL, 0x00140000UL, 0x00de0000UL, 0x005e0000UL, 0x000b0000UL, 0x00db0000UL, -0x00e00000UL, 0x00320000UL, 0x003a0000UL, 0x000a0000UL, 0x00490000UL, 0x00060000UL, 0x00240000UL, 0x005c0000UL, -0x00c20000UL, 0x00d30000UL, 0x00ac0000UL, 0x00620000UL, 0x00910000UL, 0x00950000UL, 0x00e40000UL, 0x00790000UL, -0x00e70000UL, 0x00c80000UL, 0x00370000UL, 0x006d0000UL, 0x008d0000UL, 0x00d50000UL, 0x004e0000UL, 0x00a90000UL, -0x006c0000UL, 0x00560000UL, 0x00f40000UL, 0x00ea0000UL, 0x00650000UL, 0x007a0000UL, 0x00ae0000UL, 0x00080000UL, -0x00ba0000UL, 0x00780000UL, 0x00250000UL, 0x002e0000UL, 0x001c0000UL, 0x00a60000UL, 0x00b40000UL, 0x00c60000UL, -0x00e80000UL, 0x00dd0000UL, 0x00740000UL, 0x001f0000UL, 0x004b0000UL, 0x00bd0000UL, 0x008b0000UL, 0x008a0000UL, -0x00700000UL, 0x003e0000UL, 0x00b50000UL, 0x00660000UL, 0x00480000UL, 0x00030000UL, 0x00f60000UL, 0x000e0000UL, -0x00610000UL, 0x00350000UL, 0x00570000UL, 0x00b90000UL, 0x00860000UL, 0x00c10000UL, 0x001d0000UL, 0x009e0000UL, -0x00e10000UL, 0x00f80000UL, 0x00980000UL, 0x00110000UL, 0x00690000UL, 0x00d90000UL, 0x008e0000UL, 0x00940000UL, -0x009b0000UL, 0x001e0000UL, 0x00870000UL, 0x00e90000UL, 0x00ce0000UL, 0x00550000UL, 0x00280000UL, 0x00df0000UL, -0x008c0000UL, 0x00a10000UL, 0x00890000UL, 0x000d0000UL, 0x00bf0000UL, 0x00e60000UL, 0x00420000UL, 0x00680000UL, +0x00630000UL, 0x007c0000UL, 0x00770000UL, 0x007b0000UL, 0x00f20000UL, 0x006b0000UL, 0x006f0000UL, 0x00c50000UL, +0x00300000UL, 0x00010000UL, 0x00670000UL, 0x002b0000UL, 0x00fe0000UL, 0x00d70000UL, 0x00ab0000UL, 0x00760000UL, +0x00ca0000UL, 0x00820000UL, 0x00c90000UL, 0x007d0000UL, 0x00fa0000UL, 0x00590000UL, 0x00470000UL, 0x00f00000UL, +0x00ad0000UL, 0x00d40000UL, 0x00a20000UL, 0x00af0000UL, 0x009c0000UL, 0x00a40000UL, 0x00720000UL, 0x00c00000UL, +0x00b70000UL, 0x00fd0000UL, 0x00930000UL, 0x00260000UL, 0x00360000UL, 0x003f0000UL, 0x00f70000UL, 0x00cc0000UL, +0x00340000UL, 0x00a50000UL, 0x00e50000UL, 0x00f10000UL, 0x00710000UL, 0x00d80000UL, 0x00310000UL, 0x00150000UL, +0x00040000UL, 0x00c70000UL, 0x00230000UL, 0x00c30000UL, 0x00180000UL, 0x00960000UL, 0x00050000UL, 0x009a0000UL, +0x00070000UL, 0x00120000UL, 0x00800000UL, 0x00e20000UL, 0x00eb0000UL, 0x00270000UL, 0x00b20000UL, 0x00750000UL, +0x00090000UL, 0x00830000UL, 0x002c0000UL, 0x001a0000UL, 0x001b0000UL, 0x006e0000UL, 0x005a0000UL, 0x00a00000UL, +0x00520000UL, 0x003b0000UL, 0x00d60000UL, 0x00b30000UL, 0x00290000UL, 0x00e30000UL, 0x002f0000UL, 0x00840000UL, +0x00530000UL, 0x00d10000UL, 0x00000000UL, 0x00ed0000UL, 0x00200000UL, 0x00fc0000UL, 0x00b10000UL, 0x005b0000UL, +0x006a0000UL, 0x00cb0000UL, 0x00be0000UL, 0x00390000UL, 0x004a0000UL, 0x004c0000UL, 0x00580000UL, 0x00cf0000UL, +0x00d00000UL, 0x00ef0000UL, 0x00aa0000UL, 0x00fb0000UL, 0x00430000UL, 0x004d0000UL, 0x00330000UL, 0x00850000UL, +0x00450000UL, 0x00f90000UL, 0x00020000UL, 0x007f0000UL, 0x00500000UL, 0x003c0000UL, 0x009f0000UL, 0x00a80000UL, +0x00510000UL, 0x00a30000UL, 0x00400000UL, 0x008f0000UL, 0x00920000UL, 0x009d0000UL, 0x00380000UL, 0x00f50000UL, +0x00bc0000UL, 0x00b60000UL, 0x00da0000UL, 0x00210000UL, 0x00100000UL, 0x00ff0000UL, 0x00f30000UL, 0x00d20000UL, +0x00cd0000UL, 0x000c0000UL, 0x00130000UL, 0x00ec0000UL, 0x005f0000UL, 0x00970000UL, 0x00440000UL, 0x00170000UL, +0x00c40000UL, 0x00a70000UL, 0x007e0000UL, 0x003d0000UL, 0x00640000UL, 0x005d0000UL, 0x00190000UL, 0x00730000UL, +0x00600000UL, 0x00810000UL, 0x004f0000UL, 0x00dc0000UL, 0x00220000UL, 0x002a0000UL, 0x00900000UL, 0x00880000UL, +0x00460000UL, 0x00ee0000UL, 0x00b80000UL, 0x00140000UL, 0x00de0000UL, 0x005e0000UL, 0x000b0000UL, 0x00db0000UL, +0x00e00000UL, 0x00320000UL, 0x003a0000UL, 0x000a0000UL, 0x00490000UL, 0x00060000UL, 0x00240000UL, 0x005c0000UL, +0x00c20000UL, 0x00d30000UL, 0x00ac0000UL, 0x00620000UL, 0x00910000UL, 0x00950000UL, 0x00e40000UL, 0x00790000UL, +0x00e70000UL, 0x00c80000UL, 0x00370000UL, 0x006d0000UL, 0x008d0000UL, 0x00d50000UL, 0x004e0000UL, 0x00a90000UL, +0x006c0000UL, 0x00560000UL, 0x00f40000UL, 0x00ea0000UL, 0x00650000UL, 0x007a0000UL, 0x00ae0000UL, 0x00080000UL, +0x00ba0000UL, 0x00780000UL, 0x00250000UL, 0x002e0000UL, 0x001c0000UL, 0x00a60000UL, 0x00b40000UL, 0x00c60000UL, +0x00e80000UL, 0x00dd0000UL, 0x00740000UL, 0x001f0000UL, 0x004b0000UL, 0x00bd0000UL, 0x008b0000UL, 0x008a0000UL, +0x00700000UL, 0x003e0000UL, 0x00b50000UL, 0x00660000UL, 0x00480000UL, 0x00030000UL, 0x00f60000UL, 0x000e0000UL, +0x00610000UL, 0x00350000UL, 0x00570000UL, 0x00b90000UL, 0x00860000UL, 0x00c10000UL, 0x001d0000UL, 0x009e0000UL, +0x00e10000UL, 0x00f80000UL, 0x00980000UL, 0x00110000UL, 0x00690000UL, 0x00d90000UL, 0x008e0000UL, 0x00940000UL, +0x009b0000UL, 0x001e0000UL, 0x00870000UL, 0x00e90000UL, 0x00ce0000UL, 0x00550000UL, 0x00280000UL, 0x00df0000UL, +0x008c0000UL, 0x00a10000UL, 0x00890000UL, 0x000d0000UL, 0x00bf0000UL, 0x00e60000UL, 0x00420000UL, 0x00680000UL, 0x00410000UL, 0x00990000UL, 0x002d0000UL, 0x000f0000UL, 0x00b00000UL, 0x00540000UL, 0x00bb0000UL, 0x00160000UL }; static const ulong32 Te4_3[] = { -0x63000000UL, 0x7c000000UL, 0x77000000UL, 0x7b000000UL, 0xf2000000UL, 0x6b000000UL, 0x6f000000UL, 0xc5000000UL, -0x30000000UL, 0x01000000UL, 0x67000000UL, 0x2b000000UL, 0xfe000000UL, 0xd7000000UL, 0xab000000UL, 0x76000000UL, -0xca000000UL, 0x82000000UL, 0xc9000000UL, 0x7d000000UL, 0xfa000000UL, 0x59000000UL, 0x47000000UL, 0xf0000000UL, -0xad000000UL, 0xd4000000UL, 0xa2000000UL, 0xaf000000UL, 0x9c000000UL, 0xa4000000UL, 0x72000000UL, 0xc0000000UL, -0xb7000000UL, 0xfd000000UL, 0x93000000UL, 0x26000000UL, 0x36000000UL, 0x3f000000UL, 0xf7000000UL, 0xcc000000UL, -0x34000000UL, 0xa5000000UL, 0xe5000000UL, 0xf1000000UL, 0x71000000UL, 0xd8000000UL, 0x31000000UL, 0x15000000UL, -0x04000000UL, 0xc7000000UL, 0x23000000UL, 0xc3000000UL, 0x18000000UL, 0x96000000UL, 0x05000000UL, 0x9a000000UL, -0x07000000UL, 0x12000000UL, 0x80000000UL, 0xe2000000UL, 0xeb000000UL, 0x27000000UL, 0xb2000000UL, 0x75000000UL, -0x09000000UL, 0x83000000UL, 0x2c000000UL, 0x1a000000UL, 0x1b000000UL, 0x6e000000UL, 0x5a000000UL, 0xa0000000UL, -0x52000000UL, 0x3b000000UL, 0xd6000000UL, 0xb3000000UL, 0x29000000UL, 0xe3000000UL, 0x2f000000UL, 0x84000000UL, -0x53000000UL, 0xd1000000UL, 0x00000000UL, 0xed000000UL, 0x20000000UL, 0xfc000000UL, 0xb1000000UL, 0x5b000000UL, -0x6a000000UL, 0xcb000000UL, 0xbe000000UL, 0x39000000UL, 0x4a000000UL, 0x4c000000UL, 0x58000000UL, 0xcf000000UL, -0xd0000000UL, 0xef000000UL, 0xaa000000UL, 0xfb000000UL, 0x43000000UL, 0x4d000000UL, 0x33000000UL, 0x85000000UL, -0x45000000UL, 0xf9000000UL, 0x02000000UL, 0x7f000000UL, 0x50000000UL, 0x3c000000UL, 0x9f000000UL, 0xa8000000UL, -0x51000000UL, 0xa3000000UL, 0x40000000UL, 0x8f000000UL, 0x92000000UL, 0x9d000000UL, 0x38000000UL, 0xf5000000UL, -0xbc000000UL, 0xb6000000UL, 0xda000000UL, 0x21000000UL, 0x10000000UL, 0xff000000UL, 0xf3000000UL, 0xd2000000UL, -0xcd000000UL, 0x0c000000UL, 0x13000000UL, 0xec000000UL, 0x5f000000UL, 0x97000000UL, 0x44000000UL, 0x17000000UL, -0xc4000000UL, 0xa7000000UL, 0x7e000000UL, 0x3d000000UL, 0x64000000UL, 0x5d000000UL, 0x19000000UL, 0x73000000UL, -0x60000000UL, 0x81000000UL, 0x4f000000UL, 0xdc000000UL, 0x22000000UL, 0x2a000000UL, 0x90000000UL, 0x88000000UL, -0x46000000UL, 0xee000000UL, 0xb8000000UL, 0x14000000UL, 0xde000000UL, 0x5e000000UL, 0x0b000000UL, 0xdb000000UL, -0xe0000000UL, 0x32000000UL, 0x3a000000UL, 0x0a000000UL, 0x49000000UL, 0x06000000UL, 0x24000000UL, 0x5c000000UL, -0xc2000000UL, 0xd3000000UL, 0xac000000UL, 0x62000000UL, 0x91000000UL, 0x95000000UL, 0xe4000000UL, 0x79000000UL, -0xe7000000UL, 0xc8000000UL, 0x37000000UL, 0x6d000000UL, 0x8d000000UL, 0xd5000000UL, 0x4e000000UL, 0xa9000000UL, -0x6c000000UL, 0x56000000UL, 0xf4000000UL, 0xea000000UL, 0x65000000UL, 0x7a000000UL, 0xae000000UL, 0x08000000UL, -0xba000000UL, 0x78000000UL, 0x25000000UL, 0x2e000000UL, 0x1c000000UL, 0xa6000000UL, 0xb4000000UL, 0xc6000000UL, -0xe8000000UL, 0xdd000000UL, 0x74000000UL, 0x1f000000UL, 0x4b000000UL, 0xbd000000UL, 0x8b000000UL, 0x8a000000UL, -0x70000000UL, 0x3e000000UL, 0xb5000000UL, 0x66000000UL, 0x48000000UL, 0x03000000UL, 0xf6000000UL, 0x0e000000UL, -0x61000000UL, 0x35000000UL, 0x57000000UL, 0xb9000000UL, 0x86000000UL, 0xc1000000UL, 0x1d000000UL, 0x9e000000UL, -0xe1000000UL, 0xf8000000UL, 0x98000000UL, 0x11000000UL, 0x69000000UL, 0xd9000000UL, 0x8e000000UL, 0x94000000UL, -0x9b000000UL, 0x1e000000UL, 0x87000000UL, 0xe9000000UL, 0xce000000UL, 0x55000000UL, 0x28000000UL, 0xdf000000UL, -0x8c000000UL, 0xa1000000UL, 0x89000000UL, 0x0d000000UL, 0xbf000000UL, 0xe6000000UL, 0x42000000UL, 0x68000000UL, +0x63000000UL, 0x7c000000UL, 0x77000000UL, 0x7b000000UL, 0xf2000000UL, 0x6b000000UL, 0x6f000000UL, 0xc5000000UL, +0x30000000UL, 0x01000000UL, 0x67000000UL, 0x2b000000UL, 0xfe000000UL, 0xd7000000UL, 0xab000000UL, 0x76000000UL, +0xca000000UL, 0x82000000UL, 0xc9000000UL, 0x7d000000UL, 0xfa000000UL, 0x59000000UL, 0x47000000UL, 0xf0000000UL, +0xad000000UL, 0xd4000000UL, 0xa2000000UL, 0xaf000000UL, 0x9c000000UL, 0xa4000000UL, 0x72000000UL, 0xc0000000UL, +0xb7000000UL, 0xfd000000UL, 0x93000000UL, 0x26000000UL, 0x36000000UL, 0x3f000000UL, 0xf7000000UL, 0xcc000000UL, +0x34000000UL, 0xa5000000UL, 0xe5000000UL, 0xf1000000UL, 0x71000000UL, 0xd8000000UL, 0x31000000UL, 0x15000000UL, +0x04000000UL, 0xc7000000UL, 0x23000000UL, 0xc3000000UL, 0x18000000UL, 0x96000000UL, 0x05000000UL, 0x9a000000UL, +0x07000000UL, 0x12000000UL, 0x80000000UL, 0xe2000000UL, 0xeb000000UL, 0x27000000UL, 0xb2000000UL, 0x75000000UL, +0x09000000UL, 0x83000000UL, 0x2c000000UL, 0x1a000000UL, 0x1b000000UL, 0x6e000000UL, 0x5a000000UL, 0xa0000000UL, +0x52000000UL, 0x3b000000UL, 0xd6000000UL, 0xb3000000UL, 0x29000000UL, 0xe3000000UL, 0x2f000000UL, 0x84000000UL, +0x53000000UL, 0xd1000000UL, 0x00000000UL, 0xed000000UL, 0x20000000UL, 0xfc000000UL, 0xb1000000UL, 0x5b000000UL, +0x6a000000UL, 0xcb000000UL, 0xbe000000UL, 0x39000000UL, 0x4a000000UL, 0x4c000000UL, 0x58000000UL, 0xcf000000UL, +0xd0000000UL, 0xef000000UL, 0xaa000000UL, 0xfb000000UL, 0x43000000UL, 0x4d000000UL, 0x33000000UL, 0x85000000UL, +0x45000000UL, 0xf9000000UL, 0x02000000UL, 0x7f000000UL, 0x50000000UL, 0x3c000000UL, 0x9f000000UL, 0xa8000000UL, +0x51000000UL, 0xa3000000UL, 0x40000000UL, 0x8f000000UL, 0x92000000UL, 0x9d000000UL, 0x38000000UL, 0xf5000000UL, +0xbc000000UL, 0xb6000000UL, 0xda000000UL, 0x21000000UL, 0x10000000UL, 0xff000000UL, 0xf3000000UL, 0xd2000000UL, +0xcd000000UL, 0x0c000000UL, 0x13000000UL, 0xec000000UL, 0x5f000000UL, 0x97000000UL, 0x44000000UL, 0x17000000UL, +0xc4000000UL, 0xa7000000UL, 0x7e000000UL, 0x3d000000UL, 0x64000000UL, 0x5d000000UL, 0x19000000UL, 0x73000000UL, +0x60000000UL, 0x81000000UL, 0x4f000000UL, 0xdc000000UL, 0x22000000UL, 0x2a000000UL, 0x90000000UL, 0x88000000UL, +0x46000000UL, 0xee000000UL, 0xb8000000UL, 0x14000000UL, 0xde000000UL, 0x5e000000UL, 0x0b000000UL, 0xdb000000UL, +0xe0000000UL, 0x32000000UL, 0x3a000000UL, 0x0a000000UL, 0x49000000UL, 0x06000000UL, 0x24000000UL, 0x5c000000UL, +0xc2000000UL, 0xd3000000UL, 0xac000000UL, 0x62000000UL, 0x91000000UL, 0x95000000UL, 0xe4000000UL, 0x79000000UL, +0xe7000000UL, 0xc8000000UL, 0x37000000UL, 0x6d000000UL, 0x8d000000UL, 0xd5000000UL, 0x4e000000UL, 0xa9000000UL, +0x6c000000UL, 0x56000000UL, 0xf4000000UL, 0xea000000UL, 0x65000000UL, 0x7a000000UL, 0xae000000UL, 0x08000000UL, +0xba000000UL, 0x78000000UL, 0x25000000UL, 0x2e000000UL, 0x1c000000UL, 0xa6000000UL, 0xb4000000UL, 0xc6000000UL, +0xe8000000UL, 0xdd000000UL, 0x74000000UL, 0x1f000000UL, 0x4b000000UL, 0xbd000000UL, 0x8b000000UL, 0x8a000000UL, +0x70000000UL, 0x3e000000UL, 0xb5000000UL, 0x66000000UL, 0x48000000UL, 0x03000000UL, 0xf6000000UL, 0x0e000000UL, +0x61000000UL, 0x35000000UL, 0x57000000UL, 0xb9000000UL, 0x86000000UL, 0xc1000000UL, 0x1d000000UL, 0x9e000000UL, +0xe1000000UL, 0xf8000000UL, 0x98000000UL, 0x11000000UL, 0x69000000UL, 0xd9000000UL, 0x8e000000UL, 0x94000000UL, +0x9b000000UL, 0x1e000000UL, 0x87000000UL, 0xe9000000UL, 0xce000000UL, 0x55000000UL, 0x28000000UL, 0xdf000000UL, +0x8c000000UL, 0xa1000000UL, 0x89000000UL, 0x0d000000UL, 0xbf000000UL, 0xe6000000UL, 0x42000000UL, 0x68000000UL, 0x41000000UL, 0x99000000UL, 0x2d000000UL, 0x0f000000UL, 0xb0000000UL, 0x54000000UL, 0xbb000000UL, 0x16000000UL }; #endif /* pelimac */ @@ -874,142 +874,142 @@ static const ulong32 TD3[256] = { }; static const ulong32 Tks0[] = { -0x00000000UL, 0x0e090d0bUL, 0x1c121a16UL, 0x121b171dUL, 0x3824342cUL, 0x362d3927UL, 0x24362e3aUL, 0x2a3f2331UL, -0x70486858UL, 0x7e416553UL, 0x6c5a724eUL, 0x62537f45UL, 0x486c5c74UL, 0x4665517fUL, 0x547e4662UL, 0x5a774b69UL, -0xe090d0b0UL, 0xee99ddbbUL, 0xfc82caa6UL, 0xf28bc7adUL, 0xd8b4e49cUL, 0xd6bde997UL, 0xc4a6fe8aUL, 0xcaaff381UL, -0x90d8b8e8UL, 0x9ed1b5e3UL, 0x8ccaa2feUL, 0x82c3aff5UL, 0xa8fc8cc4UL, 0xa6f581cfUL, 0xb4ee96d2UL, 0xbae79bd9UL, -0xdb3bbb7bUL, 0xd532b670UL, 0xc729a16dUL, 0xc920ac66UL, 0xe31f8f57UL, 0xed16825cUL, 0xff0d9541UL, 0xf104984aUL, -0xab73d323UL, 0xa57ade28UL, 0xb761c935UL, 0xb968c43eUL, 0x9357e70fUL, 0x9d5eea04UL, 0x8f45fd19UL, 0x814cf012UL, -0x3bab6bcbUL, 0x35a266c0UL, 0x27b971ddUL, 0x29b07cd6UL, 0x038f5fe7UL, 0x0d8652ecUL, 0x1f9d45f1UL, 0x119448faUL, -0x4be30393UL, 0x45ea0e98UL, 0x57f11985UL, 0x59f8148eUL, 0x73c737bfUL, 0x7dce3ab4UL, 0x6fd52da9UL, 0x61dc20a2UL, -0xad766df6UL, 0xa37f60fdUL, 0xb16477e0UL, 0xbf6d7aebUL, 0x955259daUL, 0x9b5b54d1UL, 0x894043ccUL, 0x87494ec7UL, -0xdd3e05aeUL, 0xd33708a5UL, 0xc12c1fb8UL, 0xcf2512b3UL, 0xe51a3182UL, 0xeb133c89UL, 0xf9082b94UL, 0xf701269fUL, -0x4de6bd46UL, 0x43efb04dUL, 0x51f4a750UL, 0x5ffdaa5bUL, 0x75c2896aUL, 0x7bcb8461UL, 0x69d0937cUL, 0x67d99e77UL, -0x3daed51eUL, 0x33a7d815UL, 0x21bccf08UL, 0x2fb5c203UL, 0x058ae132UL, 0x0b83ec39UL, 0x1998fb24UL, 0x1791f62fUL, -0x764dd68dUL, 0x7844db86UL, 0x6a5fcc9bUL, 0x6456c190UL, 0x4e69e2a1UL, 0x4060efaaUL, 0x527bf8b7UL, 0x5c72f5bcUL, -0x0605bed5UL, 0x080cb3deUL, 0x1a17a4c3UL, 0x141ea9c8UL, 0x3e218af9UL, 0x302887f2UL, 0x223390efUL, 0x2c3a9de4UL, -0x96dd063dUL, 0x98d40b36UL, 0x8acf1c2bUL, 0x84c61120UL, 0xaef93211UL, 0xa0f03f1aUL, 0xb2eb2807UL, 0xbce2250cUL, -0xe6956e65UL, 0xe89c636eUL, 0xfa877473UL, 0xf48e7978UL, 0xdeb15a49UL, 0xd0b85742UL, 0xc2a3405fUL, 0xccaa4d54UL, -0x41ecdaf7UL, 0x4fe5d7fcUL, 0x5dfec0e1UL, 0x53f7cdeaUL, 0x79c8eedbUL, 0x77c1e3d0UL, 0x65daf4cdUL, 0x6bd3f9c6UL, -0x31a4b2afUL, 0x3fadbfa4UL, 0x2db6a8b9UL, 0x23bfa5b2UL, 0x09808683UL, 0x07898b88UL, 0x15929c95UL, 0x1b9b919eUL, -0xa17c0a47UL, 0xaf75074cUL, 0xbd6e1051UL, 0xb3671d5aUL, 0x99583e6bUL, 0x97513360UL, 0x854a247dUL, 0x8b432976UL, -0xd134621fUL, 0xdf3d6f14UL, 0xcd267809UL, 0xc32f7502UL, 0xe9105633UL, 0xe7195b38UL, 0xf5024c25UL, 0xfb0b412eUL, -0x9ad7618cUL, 0x94de6c87UL, 0x86c57b9aUL, 0x88cc7691UL, 0xa2f355a0UL, 0xacfa58abUL, 0xbee14fb6UL, 0xb0e842bdUL, -0xea9f09d4UL, 0xe49604dfUL, 0xf68d13c2UL, 0xf8841ec9UL, 0xd2bb3df8UL, 0xdcb230f3UL, 0xcea927eeUL, 0xc0a02ae5UL, -0x7a47b13cUL, 0x744ebc37UL, 0x6655ab2aUL, 0x685ca621UL, 0x42638510UL, 0x4c6a881bUL, 0x5e719f06UL, 0x5078920dUL, -0x0a0fd964UL, 0x0406d46fUL, 0x161dc372UL, 0x1814ce79UL, 0x322bed48UL, 0x3c22e043UL, 0x2e39f75eUL, 0x2030fa55UL, -0xec9ab701UL, 0xe293ba0aUL, 0xf088ad17UL, 0xfe81a01cUL, 0xd4be832dUL, 0xdab78e26UL, 0xc8ac993bUL, 0xc6a59430UL, -0x9cd2df59UL, 0x92dbd252UL, 0x80c0c54fUL, 0x8ec9c844UL, 0xa4f6eb75UL, 0xaaffe67eUL, 0xb8e4f163UL, 0xb6edfc68UL, -0x0c0a67b1UL, 0x02036abaUL, 0x10187da7UL, 0x1e1170acUL, 0x342e539dUL, 0x3a275e96UL, 0x283c498bUL, 0x26354480UL, -0x7c420fe9UL, 0x724b02e2UL, 0x605015ffUL, 0x6e5918f4UL, 0x44663bc5UL, 0x4a6f36ceUL, 0x587421d3UL, 0x567d2cd8UL, -0x37a10c7aUL, 0x39a80171UL, 0x2bb3166cUL, 0x25ba1b67UL, 0x0f853856UL, 0x018c355dUL, 0x13972240UL, 0x1d9e2f4bUL, -0x47e96422UL, 0x49e06929UL, 0x5bfb7e34UL, 0x55f2733fUL, 0x7fcd500eUL, 0x71c45d05UL, 0x63df4a18UL, 0x6dd64713UL, -0xd731dccaUL, 0xd938d1c1UL, 0xcb23c6dcUL, 0xc52acbd7UL, 0xef15e8e6UL, 0xe11ce5edUL, 0xf307f2f0UL, 0xfd0efffbUL, +0x00000000UL, 0x0e090d0bUL, 0x1c121a16UL, 0x121b171dUL, 0x3824342cUL, 0x362d3927UL, 0x24362e3aUL, 0x2a3f2331UL, +0x70486858UL, 0x7e416553UL, 0x6c5a724eUL, 0x62537f45UL, 0x486c5c74UL, 0x4665517fUL, 0x547e4662UL, 0x5a774b69UL, +0xe090d0b0UL, 0xee99ddbbUL, 0xfc82caa6UL, 0xf28bc7adUL, 0xd8b4e49cUL, 0xd6bde997UL, 0xc4a6fe8aUL, 0xcaaff381UL, +0x90d8b8e8UL, 0x9ed1b5e3UL, 0x8ccaa2feUL, 0x82c3aff5UL, 0xa8fc8cc4UL, 0xa6f581cfUL, 0xb4ee96d2UL, 0xbae79bd9UL, +0xdb3bbb7bUL, 0xd532b670UL, 0xc729a16dUL, 0xc920ac66UL, 0xe31f8f57UL, 0xed16825cUL, 0xff0d9541UL, 0xf104984aUL, +0xab73d323UL, 0xa57ade28UL, 0xb761c935UL, 0xb968c43eUL, 0x9357e70fUL, 0x9d5eea04UL, 0x8f45fd19UL, 0x814cf012UL, +0x3bab6bcbUL, 0x35a266c0UL, 0x27b971ddUL, 0x29b07cd6UL, 0x038f5fe7UL, 0x0d8652ecUL, 0x1f9d45f1UL, 0x119448faUL, +0x4be30393UL, 0x45ea0e98UL, 0x57f11985UL, 0x59f8148eUL, 0x73c737bfUL, 0x7dce3ab4UL, 0x6fd52da9UL, 0x61dc20a2UL, +0xad766df6UL, 0xa37f60fdUL, 0xb16477e0UL, 0xbf6d7aebUL, 0x955259daUL, 0x9b5b54d1UL, 0x894043ccUL, 0x87494ec7UL, +0xdd3e05aeUL, 0xd33708a5UL, 0xc12c1fb8UL, 0xcf2512b3UL, 0xe51a3182UL, 0xeb133c89UL, 0xf9082b94UL, 0xf701269fUL, +0x4de6bd46UL, 0x43efb04dUL, 0x51f4a750UL, 0x5ffdaa5bUL, 0x75c2896aUL, 0x7bcb8461UL, 0x69d0937cUL, 0x67d99e77UL, +0x3daed51eUL, 0x33a7d815UL, 0x21bccf08UL, 0x2fb5c203UL, 0x058ae132UL, 0x0b83ec39UL, 0x1998fb24UL, 0x1791f62fUL, +0x764dd68dUL, 0x7844db86UL, 0x6a5fcc9bUL, 0x6456c190UL, 0x4e69e2a1UL, 0x4060efaaUL, 0x527bf8b7UL, 0x5c72f5bcUL, +0x0605bed5UL, 0x080cb3deUL, 0x1a17a4c3UL, 0x141ea9c8UL, 0x3e218af9UL, 0x302887f2UL, 0x223390efUL, 0x2c3a9de4UL, +0x96dd063dUL, 0x98d40b36UL, 0x8acf1c2bUL, 0x84c61120UL, 0xaef93211UL, 0xa0f03f1aUL, 0xb2eb2807UL, 0xbce2250cUL, +0xe6956e65UL, 0xe89c636eUL, 0xfa877473UL, 0xf48e7978UL, 0xdeb15a49UL, 0xd0b85742UL, 0xc2a3405fUL, 0xccaa4d54UL, +0x41ecdaf7UL, 0x4fe5d7fcUL, 0x5dfec0e1UL, 0x53f7cdeaUL, 0x79c8eedbUL, 0x77c1e3d0UL, 0x65daf4cdUL, 0x6bd3f9c6UL, +0x31a4b2afUL, 0x3fadbfa4UL, 0x2db6a8b9UL, 0x23bfa5b2UL, 0x09808683UL, 0x07898b88UL, 0x15929c95UL, 0x1b9b919eUL, +0xa17c0a47UL, 0xaf75074cUL, 0xbd6e1051UL, 0xb3671d5aUL, 0x99583e6bUL, 0x97513360UL, 0x854a247dUL, 0x8b432976UL, +0xd134621fUL, 0xdf3d6f14UL, 0xcd267809UL, 0xc32f7502UL, 0xe9105633UL, 0xe7195b38UL, 0xf5024c25UL, 0xfb0b412eUL, +0x9ad7618cUL, 0x94de6c87UL, 0x86c57b9aUL, 0x88cc7691UL, 0xa2f355a0UL, 0xacfa58abUL, 0xbee14fb6UL, 0xb0e842bdUL, +0xea9f09d4UL, 0xe49604dfUL, 0xf68d13c2UL, 0xf8841ec9UL, 0xd2bb3df8UL, 0xdcb230f3UL, 0xcea927eeUL, 0xc0a02ae5UL, +0x7a47b13cUL, 0x744ebc37UL, 0x6655ab2aUL, 0x685ca621UL, 0x42638510UL, 0x4c6a881bUL, 0x5e719f06UL, 0x5078920dUL, +0x0a0fd964UL, 0x0406d46fUL, 0x161dc372UL, 0x1814ce79UL, 0x322bed48UL, 0x3c22e043UL, 0x2e39f75eUL, 0x2030fa55UL, +0xec9ab701UL, 0xe293ba0aUL, 0xf088ad17UL, 0xfe81a01cUL, 0xd4be832dUL, 0xdab78e26UL, 0xc8ac993bUL, 0xc6a59430UL, +0x9cd2df59UL, 0x92dbd252UL, 0x80c0c54fUL, 0x8ec9c844UL, 0xa4f6eb75UL, 0xaaffe67eUL, 0xb8e4f163UL, 0xb6edfc68UL, +0x0c0a67b1UL, 0x02036abaUL, 0x10187da7UL, 0x1e1170acUL, 0x342e539dUL, 0x3a275e96UL, 0x283c498bUL, 0x26354480UL, +0x7c420fe9UL, 0x724b02e2UL, 0x605015ffUL, 0x6e5918f4UL, 0x44663bc5UL, 0x4a6f36ceUL, 0x587421d3UL, 0x567d2cd8UL, +0x37a10c7aUL, 0x39a80171UL, 0x2bb3166cUL, 0x25ba1b67UL, 0x0f853856UL, 0x018c355dUL, 0x13972240UL, 0x1d9e2f4bUL, +0x47e96422UL, 0x49e06929UL, 0x5bfb7e34UL, 0x55f2733fUL, 0x7fcd500eUL, 0x71c45d05UL, 0x63df4a18UL, 0x6dd64713UL, +0xd731dccaUL, 0xd938d1c1UL, 0xcb23c6dcUL, 0xc52acbd7UL, 0xef15e8e6UL, 0xe11ce5edUL, 0xf307f2f0UL, 0xfd0efffbUL, 0xa779b492UL, 0xa970b999UL, 0xbb6bae84UL, 0xb562a38fUL, 0x9f5d80beUL, 0x91548db5UL, 0x834f9aa8UL, 0x8d4697a3UL }; static const ulong32 Tks1[] = { -0x00000000UL, 0x0b0e090dUL, 0x161c121aUL, 0x1d121b17UL, 0x2c382434UL, 0x27362d39UL, 0x3a24362eUL, 0x312a3f23UL, -0x58704868UL, 0x537e4165UL, 0x4e6c5a72UL, 0x4562537fUL, 0x74486c5cUL, 0x7f466551UL, 0x62547e46UL, 0x695a774bUL, -0xb0e090d0UL, 0xbbee99ddUL, 0xa6fc82caUL, 0xadf28bc7UL, 0x9cd8b4e4UL, 0x97d6bde9UL, 0x8ac4a6feUL, 0x81caaff3UL, -0xe890d8b8UL, 0xe39ed1b5UL, 0xfe8ccaa2UL, 0xf582c3afUL, 0xc4a8fc8cUL, 0xcfa6f581UL, 0xd2b4ee96UL, 0xd9bae79bUL, -0x7bdb3bbbUL, 0x70d532b6UL, 0x6dc729a1UL, 0x66c920acUL, 0x57e31f8fUL, 0x5ced1682UL, 0x41ff0d95UL, 0x4af10498UL, -0x23ab73d3UL, 0x28a57adeUL, 0x35b761c9UL, 0x3eb968c4UL, 0x0f9357e7UL, 0x049d5eeaUL, 0x198f45fdUL, 0x12814cf0UL, -0xcb3bab6bUL, 0xc035a266UL, 0xdd27b971UL, 0xd629b07cUL, 0xe7038f5fUL, 0xec0d8652UL, 0xf11f9d45UL, 0xfa119448UL, -0x934be303UL, 0x9845ea0eUL, 0x8557f119UL, 0x8e59f814UL, 0xbf73c737UL, 0xb47dce3aUL, 0xa96fd52dUL, 0xa261dc20UL, -0xf6ad766dUL, 0xfda37f60UL, 0xe0b16477UL, 0xebbf6d7aUL, 0xda955259UL, 0xd19b5b54UL, 0xcc894043UL, 0xc787494eUL, -0xaedd3e05UL, 0xa5d33708UL, 0xb8c12c1fUL, 0xb3cf2512UL, 0x82e51a31UL, 0x89eb133cUL, 0x94f9082bUL, 0x9ff70126UL, -0x464de6bdUL, 0x4d43efb0UL, 0x5051f4a7UL, 0x5b5ffdaaUL, 0x6a75c289UL, 0x617bcb84UL, 0x7c69d093UL, 0x7767d99eUL, -0x1e3daed5UL, 0x1533a7d8UL, 0x0821bccfUL, 0x032fb5c2UL, 0x32058ae1UL, 0x390b83ecUL, 0x241998fbUL, 0x2f1791f6UL, -0x8d764dd6UL, 0x867844dbUL, 0x9b6a5fccUL, 0x906456c1UL, 0xa14e69e2UL, 0xaa4060efUL, 0xb7527bf8UL, 0xbc5c72f5UL, -0xd50605beUL, 0xde080cb3UL, 0xc31a17a4UL, 0xc8141ea9UL, 0xf93e218aUL, 0xf2302887UL, 0xef223390UL, 0xe42c3a9dUL, -0x3d96dd06UL, 0x3698d40bUL, 0x2b8acf1cUL, 0x2084c611UL, 0x11aef932UL, 0x1aa0f03fUL, 0x07b2eb28UL, 0x0cbce225UL, -0x65e6956eUL, 0x6ee89c63UL, 0x73fa8774UL, 0x78f48e79UL, 0x49deb15aUL, 0x42d0b857UL, 0x5fc2a340UL, 0x54ccaa4dUL, -0xf741ecdaUL, 0xfc4fe5d7UL, 0xe15dfec0UL, 0xea53f7cdUL, 0xdb79c8eeUL, 0xd077c1e3UL, 0xcd65daf4UL, 0xc66bd3f9UL, -0xaf31a4b2UL, 0xa43fadbfUL, 0xb92db6a8UL, 0xb223bfa5UL, 0x83098086UL, 0x8807898bUL, 0x9515929cUL, 0x9e1b9b91UL, -0x47a17c0aUL, 0x4caf7507UL, 0x51bd6e10UL, 0x5ab3671dUL, 0x6b99583eUL, 0x60975133UL, 0x7d854a24UL, 0x768b4329UL, -0x1fd13462UL, 0x14df3d6fUL, 0x09cd2678UL, 0x02c32f75UL, 0x33e91056UL, 0x38e7195bUL, 0x25f5024cUL, 0x2efb0b41UL, -0x8c9ad761UL, 0x8794de6cUL, 0x9a86c57bUL, 0x9188cc76UL, 0xa0a2f355UL, 0xabacfa58UL, 0xb6bee14fUL, 0xbdb0e842UL, -0xd4ea9f09UL, 0xdfe49604UL, 0xc2f68d13UL, 0xc9f8841eUL, 0xf8d2bb3dUL, 0xf3dcb230UL, 0xeecea927UL, 0xe5c0a02aUL, -0x3c7a47b1UL, 0x37744ebcUL, 0x2a6655abUL, 0x21685ca6UL, 0x10426385UL, 0x1b4c6a88UL, 0x065e719fUL, 0x0d507892UL, -0x640a0fd9UL, 0x6f0406d4UL, 0x72161dc3UL, 0x791814ceUL, 0x48322bedUL, 0x433c22e0UL, 0x5e2e39f7UL, 0x552030faUL, -0x01ec9ab7UL, 0x0ae293baUL, 0x17f088adUL, 0x1cfe81a0UL, 0x2dd4be83UL, 0x26dab78eUL, 0x3bc8ac99UL, 0x30c6a594UL, -0x599cd2dfUL, 0x5292dbd2UL, 0x4f80c0c5UL, 0x448ec9c8UL, 0x75a4f6ebUL, 0x7eaaffe6UL, 0x63b8e4f1UL, 0x68b6edfcUL, -0xb10c0a67UL, 0xba02036aUL, 0xa710187dUL, 0xac1e1170UL, 0x9d342e53UL, 0x963a275eUL, 0x8b283c49UL, 0x80263544UL, -0xe97c420fUL, 0xe2724b02UL, 0xff605015UL, 0xf46e5918UL, 0xc544663bUL, 0xce4a6f36UL, 0xd3587421UL, 0xd8567d2cUL, -0x7a37a10cUL, 0x7139a801UL, 0x6c2bb316UL, 0x6725ba1bUL, 0x560f8538UL, 0x5d018c35UL, 0x40139722UL, 0x4b1d9e2fUL, -0x2247e964UL, 0x2949e069UL, 0x345bfb7eUL, 0x3f55f273UL, 0x0e7fcd50UL, 0x0571c45dUL, 0x1863df4aUL, 0x136dd647UL, -0xcad731dcUL, 0xc1d938d1UL, 0xdccb23c6UL, 0xd7c52acbUL, 0xe6ef15e8UL, 0xede11ce5UL, 0xf0f307f2UL, 0xfbfd0effUL, +0x00000000UL, 0x0b0e090dUL, 0x161c121aUL, 0x1d121b17UL, 0x2c382434UL, 0x27362d39UL, 0x3a24362eUL, 0x312a3f23UL, +0x58704868UL, 0x537e4165UL, 0x4e6c5a72UL, 0x4562537fUL, 0x74486c5cUL, 0x7f466551UL, 0x62547e46UL, 0x695a774bUL, +0xb0e090d0UL, 0xbbee99ddUL, 0xa6fc82caUL, 0xadf28bc7UL, 0x9cd8b4e4UL, 0x97d6bde9UL, 0x8ac4a6feUL, 0x81caaff3UL, +0xe890d8b8UL, 0xe39ed1b5UL, 0xfe8ccaa2UL, 0xf582c3afUL, 0xc4a8fc8cUL, 0xcfa6f581UL, 0xd2b4ee96UL, 0xd9bae79bUL, +0x7bdb3bbbUL, 0x70d532b6UL, 0x6dc729a1UL, 0x66c920acUL, 0x57e31f8fUL, 0x5ced1682UL, 0x41ff0d95UL, 0x4af10498UL, +0x23ab73d3UL, 0x28a57adeUL, 0x35b761c9UL, 0x3eb968c4UL, 0x0f9357e7UL, 0x049d5eeaUL, 0x198f45fdUL, 0x12814cf0UL, +0xcb3bab6bUL, 0xc035a266UL, 0xdd27b971UL, 0xd629b07cUL, 0xe7038f5fUL, 0xec0d8652UL, 0xf11f9d45UL, 0xfa119448UL, +0x934be303UL, 0x9845ea0eUL, 0x8557f119UL, 0x8e59f814UL, 0xbf73c737UL, 0xb47dce3aUL, 0xa96fd52dUL, 0xa261dc20UL, +0xf6ad766dUL, 0xfda37f60UL, 0xe0b16477UL, 0xebbf6d7aUL, 0xda955259UL, 0xd19b5b54UL, 0xcc894043UL, 0xc787494eUL, +0xaedd3e05UL, 0xa5d33708UL, 0xb8c12c1fUL, 0xb3cf2512UL, 0x82e51a31UL, 0x89eb133cUL, 0x94f9082bUL, 0x9ff70126UL, +0x464de6bdUL, 0x4d43efb0UL, 0x5051f4a7UL, 0x5b5ffdaaUL, 0x6a75c289UL, 0x617bcb84UL, 0x7c69d093UL, 0x7767d99eUL, +0x1e3daed5UL, 0x1533a7d8UL, 0x0821bccfUL, 0x032fb5c2UL, 0x32058ae1UL, 0x390b83ecUL, 0x241998fbUL, 0x2f1791f6UL, +0x8d764dd6UL, 0x867844dbUL, 0x9b6a5fccUL, 0x906456c1UL, 0xa14e69e2UL, 0xaa4060efUL, 0xb7527bf8UL, 0xbc5c72f5UL, +0xd50605beUL, 0xde080cb3UL, 0xc31a17a4UL, 0xc8141ea9UL, 0xf93e218aUL, 0xf2302887UL, 0xef223390UL, 0xe42c3a9dUL, +0x3d96dd06UL, 0x3698d40bUL, 0x2b8acf1cUL, 0x2084c611UL, 0x11aef932UL, 0x1aa0f03fUL, 0x07b2eb28UL, 0x0cbce225UL, +0x65e6956eUL, 0x6ee89c63UL, 0x73fa8774UL, 0x78f48e79UL, 0x49deb15aUL, 0x42d0b857UL, 0x5fc2a340UL, 0x54ccaa4dUL, +0xf741ecdaUL, 0xfc4fe5d7UL, 0xe15dfec0UL, 0xea53f7cdUL, 0xdb79c8eeUL, 0xd077c1e3UL, 0xcd65daf4UL, 0xc66bd3f9UL, +0xaf31a4b2UL, 0xa43fadbfUL, 0xb92db6a8UL, 0xb223bfa5UL, 0x83098086UL, 0x8807898bUL, 0x9515929cUL, 0x9e1b9b91UL, +0x47a17c0aUL, 0x4caf7507UL, 0x51bd6e10UL, 0x5ab3671dUL, 0x6b99583eUL, 0x60975133UL, 0x7d854a24UL, 0x768b4329UL, +0x1fd13462UL, 0x14df3d6fUL, 0x09cd2678UL, 0x02c32f75UL, 0x33e91056UL, 0x38e7195bUL, 0x25f5024cUL, 0x2efb0b41UL, +0x8c9ad761UL, 0x8794de6cUL, 0x9a86c57bUL, 0x9188cc76UL, 0xa0a2f355UL, 0xabacfa58UL, 0xb6bee14fUL, 0xbdb0e842UL, +0xd4ea9f09UL, 0xdfe49604UL, 0xc2f68d13UL, 0xc9f8841eUL, 0xf8d2bb3dUL, 0xf3dcb230UL, 0xeecea927UL, 0xe5c0a02aUL, +0x3c7a47b1UL, 0x37744ebcUL, 0x2a6655abUL, 0x21685ca6UL, 0x10426385UL, 0x1b4c6a88UL, 0x065e719fUL, 0x0d507892UL, +0x640a0fd9UL, 0x6f0406d4UL, 0x72161dc3UL, 0x791814ceUL, 0x48322bedUL, 0x433c22e0UL, 0x5e2e39f7UL, 0x552030faUL, +0x01ec9ab7UL, 0x0ae293baUL, 0x17f088adUL, 0x1cfe81a0UL, 0x2dd4be83UL, 0x26dab78eUL, 0x3bc8ac99UL, 0x30c6a594UL, +0x599cd2dfUL, 0x5292dbd2UL, 0x4f80c0c5UL, 0x448ec9c8UL, 0x75a4f6ebUL, 0x7eaaffe6UL, 0x63b8e4f1UL, 0x68b6edfcUL, +0xb10c0a67UL, 0xba02036aUL, 0xa710187dUL, 0xac1e1170UL, 0x9d342e53UL, 0x963a275eUL, 0x8b283c49UL, 0x80263544UL, +0xe97c420fUL, 0xe2724b02UL, 0xff605015UL, 0xf46e5918UL, 0xc544663bUL, 0xce4a6f36UL, 0xd3587421UL, 0xd8567d2cUL, +0x7a37a10cUL, 0x7139a801UL, 0x6c2bb316UL, 0x6725ba1bUL, 0x560f8538UL, 0x5d018c35UL, 0x40139722UL, 0x4b1d9e2fUL, +0x2247e964UL, 0x2949e069UL, 0x345bfb7eUL, 0x3f55f273UL, 0x0e7fcd50UL, 0x0571c45dUL, 0x1863df4aUL, 0x136dd647UL, +0xcad731dcUL, 0xc1d938d1UL, 0xdccb23c6UL, 0xd7c52acbUL, 0xe6ef15e8UL, 0xede11ce5UL, 0xf0f307f2UL, 0xfbfd0effUL, 0x92a779b4UL, 0x99a970b9UL, 0x84bb6baeUL, 0x8fb562a3UL, 0xbe9f5d80UL, 0xb591548dUL, 0xa8834f9aUL, 0xa38d4697UL }; static const ulong32 Tks2[] = { -0x00000000UL, 0x0d0b0e09UL, 0x1a161c12UL, 0x171d121bUL, 0x342c3824UL, 0x3927362dUL, 0x2e3a2436UL, 0x23312a3fUL, -0x68587048UL, 0x65537e41UL, 0x724e6c5aUL, 0x7f456253UL, 0x5c74486cUL, 0x517f4665UL, 0x4662547eUL, 0x4b695a77UL, -0xd0b0e090UL, 0xddbbee99UL, 0xcaa6fc82UL, 0xc7adf28bUL, 0xe49cd8b4UL, 0xe997d6bdUL, 0xfe8ac4a6UL, 0xf381caafUL, -0xb8e890d8UL, 0xb5e39ed1UL, 0xa2fe8ccaUL, 0xaff582c3UL, 0x8cc4a8fcUL, 0x81cfa6f5UL, 0x96d2b4eeUL, 0x9bd9bae7UL, -0xbb7bdb3bUL, 0xb670d532UL, 0xa16dc729UL, 0xac66c920UL, 0x8f57e31fUL, 0x825ced16UL, 0x9541ff0dUL, 0x984af104UL, -0xd323ab73UL, 0xde28a57aUL, 0xc935b761UL, 0xc43eb968UL, 0xe70f9357UL, 0xea049d5eUL, 0xfd198f45UL, 0xf012814cUL, -0x6bcb3babUL, 0x66c035a2UL, 0x71dd27b9UL, 0x7cd629b0UL, 0x5fe7038fUL, 0x52ec0d86UL, 0x45f11f9dUL, 0x48fa1194UL, -0x03934be3UL, 0x0e9845eaUL, 0x198557f1UL, 0x148e59f8UL, 0x37bf73c7UL, 0x3ab47dceUL, 0x2da96fd5UL, 0x20a261dcUL, -0x6df6ad76UL, 0x60fda37fUL, 0x77e0b164UL, 0x7aebbf6dUL, 0x59da9552UL, 0x54d19b5bUL, 0x43cc8940UL, 0x4ec78749UL, -0x05aedd3eUL, 0x08a5d337UL, 0x1fb8c12cUL, 0x12b3cf25UL, 0x3182e51aUL, 0x3c89eb13UL, 0x2b94f908UL, 0x269ff701UL, -0xbd464de6UL, 0xb04d43efUL, 0xa75051f4UL, 0xaa5b5ffdUL, 0x896a75c2UL, 0x84617bcbUL, 0x937c69d0UL, 0x9e7767d9UL, -0xd51e3daeUL, 0xd81533a7UL, 0xcf0821bcUL, 0xc2032fb5UL, 0xe132058aUL, 0xec390b83UL, 0xfb241998UL, 0xf62f1791UL, -0xd68d764dUL, 0xdb867844UL, 0xcc9b6a5fUL, 0xc1906456UL, 0xe2a14e69UL, 0xefaa4060UL, 0xf8b7527bUL, 0xf5bc5c72UL, -0xbed50605UL, 0xb3de080cUL, 0xa4c31a17UL, 0xa9c8141eUL, 0x8af93e21UL, 0x87f23028UL, 0x90ef2233UL, 0x9de42c3aUL, -0x063d96ddUL, 0x0b3698d4UL, 0x1c2b8acfUL, 0x112084c6UL, 0x3211aef9UL, 0x3f1aa0f0UL, 0x2807b2ebUL, 0x250cbce2UL, -0x6e65e695UL, 0x636ee89cUL, 0x7473fa87UL, 0x7978f48eUL, 0x5a49deb1UL, 0x5742d0b8UL, 0x405fc2a3UL, 0x4d54ccaaUL, -0xdaf741ecUL, 0xd7fc4fe5UL, 0xc0e15dfeUL, 0xcdea53f7UL, 0xeedb79c8UL, 0xe3d077c1UL, 0xf4cd65daUL, 0xf9c66bd3UL, -0xb2af31a4UL, 0xbfa43fadUL, 0xa8b92db6UL, 0xa5b223bfUL, 0x86830980UL, 0x8b880789UL, 0x9c951592UL, 0x919e1b9bUL, -0x0a47a17cUL, 0x074caf75UL, 0x1051bd6eUL, 0x1d5ab367UL, 0x3e6b9958UL, 0x33609751UL, 0x247d854aUL, 0x29768b43UL, -0x621fd134UL, 0x6f14df3dUL, 0x7809cd26UL, 0x7502c32fUL, 0x5633e910UL, 0x5b38e719UL, 0x4c25f502UL, 0x412efb0bUL, -0x618c9ad7UL, 0x6c8794deUL, 0x7b9a86c5UL, 0x769188ccUL, 0x55a0a2f3UL, 0x58abacfaUL, 0x4fb6bee1UL, 0x42bdb0e8UL, -0x09d4ea9fUL, 0x04dfe496UL, 0x13c2f68dUL, 0x1ec9f884UL, 0x3df8d2bbUL, 0x30f3dcb2UL, 0x27eecea9UL, 0x2ae5c0a0UL, -0xb13c7a47UL, 0xbc37744eUL, 0xab2a6655UL, 0xa621685cUL, 0x85104263UL, 0x881b4c6aUL, 0x9f065e71UL, 0x920d5078UL, -0xd9640a0fUL, 0xd46f0406UL, 0xc372161dUL, 0xce791814UL, 0xed48322bUL, 0xe0433c22UL, 0xf75e2e39UL, 0xfa552030UL, -0xb701ec9aUL, 0xba0ae293UL, 0xad17f088UL, 0xa01cfe81UL, 0x832dd4beUL, 0x8e26dab7UL, 0x993bc8acUL, 0x9430c6a5UL, -0xdf599cd2UL, 0xd25292dbUL, 0xc54f80c0UL, 0xc8448ec9UL, 0xeb75a4f6UL, 0xe67eaaffUL, 0xf163b8e4UL, 0xfc68b6edUL, -0x67b10c0aUL, 0x6aba0203UL, 0x7da71018UL, 0x70ac1e11UL, 0x539d342eUL, 0x5e963a27UL, 0x498b283cUL, 0x44802635UL, -0x0fe97c42UL, 0x02e2724bUL, 0x15ff6050UL, 0x18f46e59UL, 0x3bc54466UL, 0x36ce4a6fUL, 0x21d35874UL, 0x2cd8567dUL, -0x0c7a37a1UL, 0x017139a8UL, 0x166c2bb3UL, 0x1b6725baUL, 0x38560f85UL, 0x355d018cUL, 0x22401397UL, 0x2f4b1d9eUL, -0x642247e9UL, 0x692949e0UL, 0x7e345bfbUL, 0x733f55f2UL, 0x500e7fcdUL, 0x5d0571c4UL, 0x4a1863dfUL, 0x47136dd6UL, -0xdccad731UL, 0xd1c1d938UL, 0xc6dccb23UL, 0xcbd7c52aUL, 0xe8e6ef15UL, 0xe5ede11cUL, 0xf2f0f307UL, 0xfffbfd0eUL, +0x00000000UL, 0x0d0b0e09UL, 0x1a161c12UL, 0x171d121bUL, 0x342c3824UL, 0x3927362dUL, 0x2e3a2436UL, 0x23312a3fUL, +0x68587048UL, 0x65537e41UL, 0x724e6c5aUL, 0x7f456253UL, 0x5c74486cUL, 0x517f4665UL, 0x4662547eUL, 0x4b695a77UL, +0xd0b0e090UL, 0xddbbee99UL, 0xcaa6fc82UL, 0xc7adf28bUL, 0xe49cd8b4UL, 0xe997d6bdUL, 0xfe8ac4a6UL, 0xf381caafUL, +0xb8e890d8UL, 0xb5e39ed1UL, 0xa2fe8ccaUL, 0xaff582c3UL, 0x8cc4a8fcUL, 0x81cfa6f5UL, 0x96d2b4eeUL, 0x9bd9bae7UL, +0xbb7bdb3bUL, 0xb670d532UL, 0xa16dc729UL, 0xac66c920UL, 0x8f57e31fUL, 0x825ced16UL, 0x9541ff0dUL, 0x984af104UL, +0xd323ab73UL, 0xde28a57aUL, 0xc935b761UL, 0xc43eb968UL, 0xe70f9357UL, 0xea049d5eUL, 0xfd198f45UL, 0xf012814cUL, +0x6bcb3babUL, 0x66c035a2UL, 0x71dd27b9UL, 0x7cd629b0UL, 0x5fe7038fUL, 0x52ec0d86UL, 0x45f11f9dUL, 0x48fa1194UL, +0x03934be3UL, 0x0e9845eaUL, 0x198557f1UL, 0x148e59f8UL, 0x37bf73c7UL, 0x3ab47dceUL, 0x2da96fd5UL, 0x20a261dcUL, +0x6df6ad76UL, 0x60fda37fUL, 0x77e0b164UL, 0x7aebbf6dUL, 0x59da9552UL, 0x54d19b5bUL, 0x43cc8940UL, 0x4ec78749UL, +0x05aedd3eUL, 0x08a5d337UL, 0x1fb8c12cUL, 0x12b3cf25UL, 0x3182e51aUL, 0x3c89eb13UL, 0x2b94f908UL, 0x269ff701UL, +0xbd464de6UL, 0xb04d43efUL, 0xa75051f4UL, 0xaa5b5ffdUL, 0x896a75c2UL, 0x84617bcbUL, 0x937c69d0UL, 0x9e7767d9UL, +0xd51e3daeUL, 0xd81533a7UL, 0xcf0821bcUL, 0xc2032fb5UL, 0xe132058aUL, 0xec390b83UL, 0xfb241998UL, 0xf62f1791UL, +0xd68d764dUL, 0xdb867844UL, 0xcc9b6a5fUL, 0xc1906456UL, 0xe2a14e69UL, 0xefaa4060UL, 0xf8b7527bUL, 0xf5bc5c72UL, +0xbed50605UL, 0xb3de080cUL, 0xa4c31a17UL, 0xa9c8141eUL, 0x8af93e21UL, 0x87f23028UL, 0x90ef2233UL, 0x9de42c3aUL, +0x063d96ddUL, 0x0b3698d4UL, 0x1c2b8acfUL, 0x112084c6UL, 0x3211aef9UL, 0x3f1aa0f0UL, 0x2807b2ebUL, 0x250cbce2UL, +0x6e65e695UL, 0x636ee89cUL, 0x7473fa87UL, 0x7978f48eUL, 0x5a49deb1UL, 0x5742d0b8UL, 0x405fc2a3UL, 0x4d54ccaaUL, +0xdaf741ecUL, 0xd7fc4fe5UL, 0xc0e15dfeUL, 0xcdea53f7UL, 0xeedb79c8UL, 0xe3d077c1UL, 0xf4cd65daUL, 0xf9c66bd3UL, +0xb2af31a4UL, 0xbfa43fadUL, 0xa8b92db6UL, 0xa5b223bfUL, 0x86830980UL, 0x8b880789UL, 0x9c951592UL, 0x919e1b9bUL, +0x0a47a17cUL, 0x074caf75UL, 0x1051bd6eUL, 0x1d5ab367UL, 0x3e6b9958UL, 0x33609751UL, 0x247d854aUL, 0x29768b43UL, +0x621fd134UL, 0x6f14df3dUL, 0x7809cd26UL, 0x7502c32fUL, 0x5633e910UL, 0x5b38e719UL, 0x4c25f502UL, 0x412efb0bUL, +0x618c9ad7UL, 0x6c8794deUL, 0x7b9a86c5UL, 0x769188ccUL, 0x55a0a2f3UL, 0x58abacfaUL, 0x4fb6bee1UL, 0x42bdb0e8UL, +0x09d4ea9fUL, 0x04dfe496UL, 0x13c2f68dUL, 0x1ec9f884UL, 0x3df8d2bbUL, 0x30f3dcb2UL, 0x27eecea9UL, 0x2ae5c0a0UL, +0xb13c7a47UL, 0xbc37744eUL, 0xab2a6655UL, 0xa621685cUL, 0x85104263UL, 0x881b4c6aUL, 0x9f065e71UL, 0x920d5078UL, +0xd9640a0fUL, 0xd46f0406UL, 0xc372161dUL, 0xce791814UL, 0xed48322bUL, 0xe0433c22UL, 0xf75e2e39UL, 0xfa552030UL, +0xb701ec9aUL, 0xba0ae293UL, 0xad17f088UL, 0xa01cfe81UL, 0x832dd4beUL, 0x8e26dab7UL, 0x993bc8acUL, 0x9430c6a5UL, +0xdf599cd2UL, 0xd25292dbUL, 0xc54f80c0UL, 0xc8448ec9UL, 0xeb75a4f6UL, 0xe67eaaffUL, 0xf163b8e4UL, 0xfc68b6edUL, +0x67b10c0aUL, 0x6aba0203UL, 0x7da71018UL, 0x70ac1e11UL, 0x539d342eUL, 0x5e963a27UL, 0x498b283cUL, 0x44802635UL, +0x0fe97c42UL, 0x02e2724bUL, 0x15ff6050UL, 0x18f46e59UL, 0x3bc54466UL, 0x36ce4a6fUL, 0x21d35874UL, 0x2cd8567dUL, +0x0c7a37a1UL, 0x017139a8UL, 0x166c2bb3UL, 0x1b6725baUL, 0x38560f85UL, 0x355d018cUL, 0x22401397UL, 0x2f4b1d9eUL, +0x642247e9UL, 0x692949e0UL, 0x7e345bfbUL, 0x733f55f2UL, 0x500e7fcdUL, 0x5d0571c4UL, 0x4a1863dfUL, 0x47136dd6UL, +0xdccad731UL, 0xd1c1d938UL, 0xc6dccb23UL, 0xcbd7c52aUL, 0xe8e6ef15UL, 0xe5ede11cUL, 0xf2f0f307UL, 0xfffbfd0eUL, 0xb492a779UL, 0xb999a970UL, 0xae84bb6bUL, 0xa38fb562UL, 0x80be9f5dUL, 0x8db59154UL, 0x9aa8834fUL, 0x97a38d46UL }; static const ulong32 Tks3[] = { -0x00000000UL, 0x090d0b0eUL, 0x121a161cUL, 0x1b171d12UL, 0x24342c38UL, 0x2d392736UL, 0x362e3a24UL, 0x3f23312aUL, -0x48685870UL, 0x4165537eUL, 0x5a724e6cUL, 0x537f4562UL, 0x6c5c7448UL, 0x65517f46UL, 0x7e466254UL, 0x774b695aUL, -0x90d0b0e0UL, 0x99ddbbeeUL, 0x82caa6fcUL, 0x8bc7adf2UL, 0xb4e49cd8UL, 0xbde997d6UL, 0xa6fe8ac4UL, 0xaff381caUL, -0xd8b8e890UL, 0xd1b5e39eUL, 0xcaa2fe8cUL, 0xc3aff582UL, 0xfc8cc4a8UL, 0xf581cfa6UL, 0xee96d2b4UL, 0xe79bd9baUL, -0x3bbb7bdbUL, 0x32b670d5UL, 0x29a16dc7UL, 0x20ac66c9UL, 0x1f8f57e3UL, 0x16825cedUL, 0x0d9541ffUL, 0x04984af1UL, -0x73d323abUL, 0x7ade28a5UL, 0x61c935b7UL, 0x68c43eb9UL, 0x57e70f93UL, 0x5eea049dUL, 0x45fd198fUL, 0x4cf01281UL, -0xab6bcb3bUL, 0xa266c035UL, 0xb971dd27UL, 0xb07cd629UL, 0x8f5fe703UL, 0x8652ec0dUL, 0x9d45f11fUL, 0x9448fa11UL, -0xe303934bUL, 0xea0e9845UL, 0xf1198557UL, 0xf8148e59UL, 0xc737bf73UL, 0xce3ab47dUL, 0xd52da96fUL, 0xdc20a261UL, -0x766df6adUL, 0x7f60fda3UL, 0x6477e0b1UL, 0x6d7aebbfUL, 0x5259da95UL, 0x5b54d19bUL, 0x4043cc89UL, 0x494ec787UL, -0x3e05aeddUL, 0x3708a5d3UL, 0x2c1fb8c1UL, 0x2512b3cfUL, 0x1a3182e5UL, 0x133c89ebUL, 0x082b94f9UL, 0x01269ff7UL, -0xe6bd464dUL, 0xefb04d43UL, 0xf4a75051UL, 0xfdaa5b5fUL, 0xc2896a75UL, 0xcb84617bUL, 0xd0937c69UL, 0xd99e7767UL, -0xaed51e3dUL, 0xa7d81533UL, 0xbccf0821UL, 0xb5c2032fUL, 0x8ae13205UL, 0x83ec390bUL, 0x98fb2419UL, 0x91f62f17UL, -0x4dd68d76UL, 0x44db8678UL, 0x5fcc9b6aUL, 0x56c19064UL, 0x69e2a14eUL, 0x60efaa40UL, 0x7bf8b752UL, 0x72f5bc5cUL, -0x05bed506UL, 0x0cb3de08UL, 0x17a4c31aUL, 0x1ea9c814UL, 0x218af93eUL, 0x2887f230UL, 0x3390ef22UL, 0x3a9de42cUL, -0xdd063d96UL, 0xd40b3698UL, 0xcf1c2b8aUL, 0xc6112084UL, 0xf93211aeUL, 0xf03f1aa0UL, 0xeb2807b2UL, 0xe2250cbcUL, -0x956e65e6UL, 0x9c636ee8UL, 0x877473faUL, 0x8e7978f4UL, 0xb15a49deUL, 0xb85742d0UL, 0xa3405fc2UL, 0xaa4d54ccUL, -0xecdaf741UL, 0xe5d7fc4fUL, 0xfec0e15dUL, 0xf7cdea53UL, 0xc8eedb79UL, 0xc1e3d077UL, 0xdaf4cd65UL, 0xd3f9c66bUL, -0xa4b2af31UL, 0xadbfa43fUL, 0xb6a8b92dUL, 0xbfa5b223UL, 0x80868309UL, 0x898b8807UL, 0x929c9515UL, 0x9b919e1bUL, -0x7c0a47a1UL, 0x75074cafUL, 0x6e1051bdUL, 0x671d5ab3UL, 0x583e6b99UL, 0x51336097UL, 0x4a247d85UL, 0x4329768bUL, -0x34621fd1UL, 0x3d6f14dfUL, 0x267809cdUL, 0x2f7502c3UL, 0x105633e9UL, 0x195b38e7UL, 0x024c25f5UL, 0x0b412efbUL, -0xd7618c9aUL, 0xde6c8794UL, 0xc57b9a86UL, 0xcc769188UL, 0xf355a0a2UL, 0xfa58abacUL, 0xe14fb6beUL, 0xe842bdb0UL, -0x9f09d4eaUL, 0x9604dfe4UL, 0x8d13c2f6UL, 0x841ec9f8UL, 0xbb3df8d2UL, 0xb230f3dcUL, 0xa927eeceUL, 0xa02ae5c0UL, -0x47b13c7aUL, 0x4ebc3774UL, 0x55ab2a66UL, 0x5ca62168UL, 0x63851042UL, 0x6a881b4cUL, 0x719f065eUL, 0x78920d50UL, -0x0fd9640aUL, 0x06d46f04UL, 0x1dc37216UL, 0x14ce7918UL, 0x2bed4832UL, 0x22e0433cUL, 0x39f75e2eUL, 0x30fa5520UL, -0x9ab701ecUL, 0x93ba0ae2UL, 0x88ad17f0UL, 0x81a01cfeUL, 0xbe832dd4UL, 0xb78e26daUL, 0xac993bc8UL, 0xa59430c6UL, -0xd2df599cUL, 0xdbd25292UL, 0xc0c54f80UL, 0xc9c8448eUL, 0xf6eb75a4UL, 0xffe67eaaUL, 0xe4f163b8UL, 0xedfc68b6UL, -0x0a67b10cUL, 0x036aba02UL, 0x187da710UL, 0x1170ac1eUL, 0x2e539d34UL, 0x275e963aUL, 0x3c498b28UL, 0x35448026UL, -0x420fe97cUL, 0x4b02e272UL, 0x5015ff60UL, 0x5918f46eUL, 0x663bc544UL, 0x6f36ce4aUL, 0x7421d358UL, 0x7d2cd856UL, -0xa10c7a37UL, 0xa8017139UL, 0xb3166c2bUL, 0xba1b6725UL, 0x8538560fUL, 0x8c355d01UL, 0x97224013UL, 0x9e2f4b1dUL, -0xe9642247UL, 0xe0692949UL, 0xfb7e345bUL, 0xf2733f55UL, 0xcd500e7fUL, 0xc45d0571UL, 0xdf4a1863UL, 0xd647136dUL, -0x31dccad7UL, 0x38d1c1d9UL, 0x23c6dccbUL, 0x2acbd7c5UL, 0x15e8e6efUL, 0x1ce5ede1UL, 0x07f2f0f3UL, 0x0efffbfdUL, +0x00000000UL, 0x090d0b0eUL, 0x121a161cUL, 0x1b171d12UL, 0x24342c38UL, 0x2d392736UL, 0x362e3a24UL, 0x3f23312aUL, +0x48685870UL, 0x4165537eUL, 0x5a724e6cUL, 0x537f4562UL, 0x6c5c7448UL, 0x65517f46UL, 0x7e466254UL, 0x774b695aUL, +0x90d0b0e0UL, 0x99ddbbeeUL, 0x82caa6fcUL, 0x8bc7adf2UL, 0xb4e49cd8UL, 0xbde997d6UL, 0xa6fe8ac4UL, 0xaff381caUL, +0xd8b8e890UL, 0xd1b5e39eUL, 0xcaa2fe8cUL, 0xc3aff582UL, 0xfc8cc4a8UL, 0xf581cfa6UL, 0xee96d2b4UL, 0xe79bd9baUL, +0x3bbb7bdbUL, 0x32b670d5UL, 0x29a16dc7UL, 0x20ac66c9UL, 0x1f8f57e3UL, 0x16825cedUL, 0x0d9541ffUL, 0x04984af1UL, +0x73d323abUL, 0x7ade28a5UL, 0x61c935b7UL, 0x68c43eb9UL, 0x57e70f93UL, 0x5eea049dUL, 0x45fd198fUL, 0x4cf01281UL, +0xab6bcb3bUL, 0xa266c035UL, 0xb971dd27UL, 0xb07cd629UL, 0x8f5fe703UL, 0x8652ec0dUL, 0x9d45f11fUL, 0x9448fa11UL, +0xe303934bUL, 0xea0e9845UL, 0xf1198557UL, 0xf8148e59UL, 0xc737bf73UL, 0xce3ab47dUL, 0xd52da96fUL, 0xdc20a261UL, +0x766df6adUL, 0x7f60fda3UL, 0x6477e0b1UL, 0x6d7aebbfUL, 0x5259da95UL, 0x5b54d19bUL, 0x4043cc89UL, 0x494ec787UL, +0x3e05aeddUL, 0x3708a5d3UL, 0x2c1fb8c1UL, 0x2512b3cfUL, 0x1a3182e5UL, 0x133c89ebUL, 0x082b94f9UL, 0x01269ff7UL, +0xe6bd464dUL, 0xefb04d43UL, 0xf4a75051UL, 0xfdaa5b5fUL, 0xc2896a75UL, 0xcb84617bUL, 0xd0937c69UL, 0xd99e7767UL, +0xaed51e3dUL, 0xa7d81533UL, 0xbccf0821UL, 0xb5c2032fUL, 0x8ae13205UL, 0x83ec390bUL, 0x98fb2419UL, 0x91f62f17UL, +0x4dd68d76UL, 0x44db8678UL, 0x5fcc9b6aUL, 0x56c19064UL, 0x69e2a14eUL, 0x60efaa40UL, 0x7bf8b752UL, 0x72f5bc5cUL, +0x05bed506UL, 0x0cb3de08UL, 0x17a4c31aUL, 0x1ea9c814UL, 0x218af93eUL, 0x2887f230UL, 0x3390ef22UL, 0x3a9de42cUL, +0xdd063d96UL, 0xd40b3698UL, 0xcf1c2b8aUL, 0xc6112084UL, 0xf93211aeUL, 0xf03f1aa0UL, 0xeb2807b2UL, 0xe2250cbcUL, +0x956e65e6UL, 0x9c636ee8UL, 0x877473faUL, 0x8e7978f4UL, 0xb15a49deUL, 0xb85742d0UL, 0xa3405fc2UL, 0xaa4d54ccUL, +0xecdaf741UL, 0xe5d7fc4fUL, 0xfec0e15dUL, 0xf7cdea53UL, 0xc8eedb79UL, 0xc1e3d077UL, 0xdaf4cd65UL, 0xd3f9c66bUL, +0xa4b2af31UL, 0xadbfa43fUL, 0xb6a8b92dUL, 0xbfa5b223UL, 0x80868309UL, 0x898b8807UL, 0x929c9515UL, 0x9b919e1bUL, +0x7c0a47a1UL, 0x75074cafUL, 0x6e1051bdUL, 0x671d5ab3UL, 0x583e6b99UL, 0x51336097UL, 0x4a247d85UL, 0x4329768bUL, +0x34621fd1UL, 0x3d6f14dfUL, 0x267809cdUL, 0x2f7502c3UL, 0x105633e9UL, 0x195b38e7UL, 0x024c25f5UL, 0x0b412efbUL, +0xd7618c9aUL, 0xde6c8794UL, 0xc57b9a86UL, 0xcc769188UL, 0xf355a0a2UL, 0xfa58abacUL, 0xe14fb6beUL, 0xe842bdb0UL, +0x9f09d4eaUL, 0x9604dfe4UL, 0x8d13c2f6UL, 0x841ec9f8UL, 0xbb3df8d2UL, 0xb230f3dcUL, 0xa927eeceUL, 0xa02ae5c0UL, +0x47b13c7aUL, 0x4ebc3774UL, 0x55ab2a66UL, 0x5ca62168UL, 0x63851042UL, 0x6a881b4cUL, 0x719f065eUL, 0x78920d50UL, +0x0fd9640aUL, 0x06d46f04UL, 0x1dc37216UL, 0x14ce7918UL, 0x2bed4832UL, 0x22e0433cUL, 0x39f75e2eUL, 0x30fa5520UL, +0x9ab701ecUL, 0x93ba0ae2UL, 0x88ad17f0UL, 0x81a01cfeUL, 0xbe832dd4UL, 0xb78e26daUL, 0xac993bc8UL, 0xa59430c6UL, +0xd2df599cUL, 0xdbd25292UL, 0xc0c54f80UL, 0xc9c8448eUL, 0xf6eb75a4UL, 0xffe67eaaUL, 0xe4f163b8UL, 0xedfc68b6UL, +0x0a67b10cUL, 0x036aba02UL, 0x187da710UL, 0x1170ac1eUL, 0x2e539d34UL, 0x275e963aUL, 0x3c498b28UL, 0x35448026UL, +0x420fe97cUL, 0x4b02e272UL, 0x5015ff60UL, 0x5918f46eUL, 0x663bc544UL, 0x6f36ce4aUL, 0x7421d358UL, 0x7d2cd856UL, +0xa10c7a37UL, 0xa8017139UL, 0xb3166c2bUL, 0xba1b6725UL, 0x8538560fUL, 0x8c355d01UL, 0x97224013UL, 0x9e2f4b1dUL, +0xe9642247UL, 0xe0692949UL, 0xfb7e345bUL, 0xf2733f55UL, 0xcd500e7fUL, 0xc45d0571UL, 0xdf4a1863UL, 0xd647136dUL, +0x31dccad7UL, 0x38d1c1d9UL, 0x23c6dccbUL, 0x2acbd7c5UL, 0x15e8e6efUL, 0x1ce5ede1UL, 0x07f2f0f3UL, 0x0efffbfdUL, 0x79b492a7UL, 0x70b999a9UL, 0x6bae84bbUL, 0x62a38fb5UL, 0x5d80be9fUL, 0x548db591UL, 0x4f9aa883UL, 0x4697a38dUL }; diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index b419a76c5..529fd45b8 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -32,143 +32,143 @@ const struct ltc_cipher_descriptor camellia_desc = { }; static const ulong32 SP1110[] = { -0x70707000, 0x82828200, 0x2c2c2c00, 0xececec00, 0xb3b3b300, 0x27272700, 0xc0c0c000, 0xe5e5e500, -0xe4e4e400, 0x85858500, 0x57575700, 0x35353500, 0xeaeaea00, 0x0c0c0c00, 0xaeaeae00, 0x41414100, -0x23232300, 0xefefef00, 0x6b6b6b00, 0x93939300, 0x45454500, 0x19191900, 0xa5a5a500, 0x21212100, -0xededed00, 0x0e0e0e00, 0x4f4f4f00, 0x4e4e4e00, 0x1d1d1d00, 0x65656500, 0x92929200, 0xbdbdbd00, -0x86868600, 0xb8b8b800, 0xafafaf00, 0x8f8f8f00, 0x7c7c7c00, 0xebebeb00, 0x1f1f1f00, 0xcecece00, -0x3e3e3e00, 0x30303000, 0xdcdcdc00, 0x5f5f5f00, 0x5e5e5e00, 0xc5c5c500, 0x0b0b0b00, 0x1a1a1a00, -0xa6a6a600, 0xe1e1e100, 0x39393900, 0xcacaca00, 0xd5d5d500, 0x47474700, 0x5d5d5d00, 0x3d3d3d00, -0xd9d9d900, 0x01010100, 0x5a5a5a00, 0xd6d6d600, 0x51515100, 0x56565600, 0x6c6c6c00, 0x4d4d4d00, -0x8b8b8b00, 0x0d0d0d00, 0x9a9a9a00, 0x66666600, 0xfbfbfb00, 0xcccccc00, 0xb0b0b000, 0x2d2d2d00, -0x74747400, 0x12121200, 0x2b2b2b00, 0x20202000, 0xf0f0f000, 0xb1b1b100, 0x84848400, 0x99999900, -0xdfdfdf00, 0x4c4c4c00, 0xcbcbcb00, 0xc2c2c200, 0x34343400, 0x7e7e7e00, 0x76767600, 0x05050500, -0x6d6d6d00, 0xb7b7b700, 0xa9a9a900, 0x31313100, 0xd1d1d100, 0x17171700, 0x04040400, 0xd7d7d700, -0x14141400, 0x58585800, 0x3a3a3a00, 0x61616100, 0xdedede00, 0x1b1b1b00, 0x11111100, 0x1c1c1c00, -0x32323200, 0x0f0f0f00, 0x9c9c9c00, 0x16161600, 0x53535300, 0x18181800, 0xf2f2f200, 0x22222200, -0xfefefe00, 0x44444400, 0xcfcfcf00, 0xb2b2b200, 0xc3c3c300, 0xb5b5b500, 0x7a7a7a00, 0x91919100, -0x24242400, 0x08080800, 0xe8e8e800, 0xa8a8a800, 0x60606000, 0xfcfcfc00, 0x69696900, 0x50505000, -0xaaaaaa00, 0xd0d0d000, 0xa0a0a000, 0x7d7d7d00, 0xa1a1a100, 0x89898900, 0x62626200, 0x97979700, -0x54545400, 0x5b5b5b00, 0x1e1e1e00, 0x95959500, 0xe0e0e000, 0xffffff00, 0x64646400, 0xd2d2d200, -0x10101000, 0xc4c4c400, 0x00000000, 0x48484800, 0xa3a3a300, 0xf7f7f700, 0x75757500, 0xdbdbdb00, -0x8a8a8a00, 0x03030300, 0xe6e6e600, 0xdadada00, 0x09090900, 0x3f3f3f00, 0xdddddd00, 0x94949400, -0x87878700, 0x5c5c5c00, 0x83838300, 0x02020200, 0xcdcdcd00, 0x4a4a4a00, 0x90909000, 0x33333300, -0x73737300, 0x67676700, 0xf6f6f600, 0xf3f3f300, 0x9d9d9d00, 0x7f7f7f00, 0xbfbfbf00, 0xe2e2e200, -0x52525200, 0x9b9b9b00, 0xd8d8d800, 0x26262600, 0xc8c8c800, 0x37373700, 0xc6c6c600, 0x3b3b3b00, -0x81818100, 0x96969600, 0x6f6f6f00, 0x4b4b4b00, 0x13131300, 0xbebebe00, 0x63636300, 0x2e2e2e00, -0xe9e9e900, 0x79797900, 0xa7a7a700, 0x8c8c8c00, 0x9f9f9f00, 0x6e6e6e00, 0xbcbcbc00, 0x8e8e8e00, -0x29292900, 0xf5f5f500, 0xf9f9f900, 0xb6b6b600, 0x2f2f2f00, 0xfdfdfd00, 0xb4b4b400, 0x59595900, -0x78787800, 0x98989800, 0x06060600, 0x6a6a6a00, 0xe7e7e700, 0x46464600, 0x71717100, 0xbababa00, -0xd4d4d400, 0x25252500, 0xababab00, 0x42424200, 0x88888800, 0xa2a2a200, 0x8d8d8d00, 0xfafafa00, -0x72727200, 0x07070700, 0xb9b9b900, 0x55555500, 0xf8f8f800, 0xeeeeee00, 0xacacac00, 0x0a0a0a00, -0x36363600, 0x49494900, 0x2a2a2a00, 0x68686800, 0x3c3c3c00, 0x38383800, 0xf1f1f100, 0xa4a4a400, -0x40404000, 0x28282800, 0xd3d3d300, 0x7b7b7b00, 0xbbbbbb00, 0xc9c9c900, 0x43434300, 0xc1c1c100, -0x15151500, 0xe3e3e300, 0xadadad00, 0xf4f4f400, 0x77777700, 0xc7c7c700, 0x80808000, 0x9e9e9e00, +0x70707000, 0x82828200, 0x2c2c2c00, 0xececec00, 0xb3b3b300, 0x27272700, 0xc0c0c000, 0xe5e5e500, +0xe4e4e400, 0x85858500, 0x57575700, 0x35353500, 0xeaeaea00, 0x0c0c0c00, 0xaeaeae00, 0x41414100, +0x23232300, 0xefefef00, 0x6b6b6b00, 0x93939300, 0x45454500, 0x19191900, 0xa5a5a500, 0x21212100, +0xededed00, 0x0e0e0e00, 0x4f4f4f00, 0x4e4e4e00, 0x1d1d1d00, 0x65656500, 0x92929200, 0xbdbdbd00, +0x86868600, 0xb8b8b800, 0xafafaf00, 0x8f8f8f00, 0x7c7c7c00, 0xebebeb00, 0x1f1f1f00, 0xcecece00, +0x3e3e3e00, 0x30303000, 0xdcdcdc00, 0x5f5f5f00, 0x5e5e5e00, 0xc5c5c500, 0x0b0b0b00, 0x1a1a1a00, +0xa6a6a600, 0xe1e1e100, 0x39393900, 0xcacaca00, 0xd5d5d500, 0x47474700, 0x5d5d5d00, 0x3d3d3d00, +0xd9d9d900, 0x01010100, 0x5a5a5a00, 0xd6d6d600, 0x51515100, 0x56565600, 0x6c6c6c00, 0x4d4d4d00, +0x8b8b8b00, 0x0d0d0d00, 0x9a9a9a00, 0x66666600, 0xfbfbfb00, 0xcccccc00, 0xb0b0b000, 0x2d2d2d00, +0x74747400, 0x12121200, 0x2b2b2b00, 0x20202000, 0xf0f0f000, 0xb1b1b100, 0x84848400, 0x99999900, +0xdfdfdf00, 0x4c4c4c00, 0xcbcbcb00, 0xc2c2c200, 0x34343400, 0x7e7e7e00, 0x76767600, 0x05050500, +0x6d6d6d00, 0xb7b7b700, 0xa9a9a900, 0x31313100, 0xd1d1d100, 0x17171700, 0x04040400, 0xd7d7d700, +0x14141400, 0x58585800, 0x3a3a3a00, 0x61616100, 0xdedede00, 0x1b1b1b00, 0x11111100, 0x1c1c1c00, +0x32323200, 0x0f0f0f00, 0x9c9c9c00, 0x16161600, 0x53535300, 0x18181800, 0xf2f2f200, 0x22222200, +0xfefefe00, 0x44444400, 0xcfcfcf00, 0xb2b2b200, 0xc3c3c300, 0xb5b5b500, 0x7a7a7a00, 0x91919100, +0x24242400, 0x08080800, 0xe8e8e800, 0xa8a8a800, 0x60606000, 0xfcfcfc00, 0x69696900, 0x50505000, +0xaaaaaa00, 0xd0d0d000, 0xa0a0a000, 0x7d7d7d00, 0xa1a1a100, 0x89898900, 0x62626200, 0x97979700, +0x54545400, 0x5b5b5b00, 0x1e1e1e00, 0x95959500, 0xe0e0e000, 0xffffff00, 0x64646400, 0xd2d2d200, +0x10101000, 0xc4c4c400, 0x00000000, 0x48484800, 0xa3a3a300, 0xf7f7f700, 0x75757500, 0xdbdbdb00, +0x8a8a8a00, 0x03030300, 0xe6e6e600, 0xdadada00, 0x09090900, 0x3f3f3f00, 0xdddddd00, 0x94949400, +0x87878700, 0x5c5c5c00, 0x83838300, 0x02020200, 0xcdcdcd00, 0x4a4a4a00, 0x90909000, 0x33333300, +0x73737300, 0x67676700, 0xf6f6f600, 0xf3f3f300, 0x9d9d9d00, 0x7f7f7f00, 0xbfbfbf00, 0xe2e2e200, +0x52525200, 0x9b9b9b00, 0xd8d8d800, 0x26262600, 0xc8c8c800, 0x37373700, 0xc6c6c600, 0x3b3b3b00, +0x81818100, 0x96969600, 0x6f6f6f00, 0x4b4b4b00, 0x13131300, 0xbebebe00, 0x63636300, 0x2e2e2e00, +0xe9e9e900, 0x79797900, 0xa7a7a700, 0x8c8c8c00, 0x9f9f9f00, 0x6e6e6e00, 0xbcbcbc00, 0x8e8e8e00, +0x29292900, 0xf5f5f500, 0xf9f9f900, 0xb6b6b600, 0x2f2f2f00, 0xfdfdfd00, 0xb4b4b400, 0x59595900, +0x78787800, 0x98989800, 0x06060600, 0x6a6a6a00, 0xe7e7e700, 0x46464600, 0x71717100, 0xbababa00, +0xd4d4d400, 0x25252500, 0xababab00, 0x42424200, 0x88888800, 0xa2a2a200, 0x8d8d8d00, 0xfafafa00, +0x72727200, 0x07070700, 0xb9b9b900, 0x55555500, 0xf8f8f800, 0xeeeeee00, 0xacacac00, 0x0a0a0a00, +0x36363600, 0x49494900, 0x2a2a2a00, 0x68686800, 0x3c3c3c00, 0x38383800, 0xf1f1f100, 0xa4a4a400, +0x40404000, 0x28282800, 0xd3d3d300, 0x7b7b7b00, 0xbbbbbb00, 0xc9c9c900, 0x43434300, 0xc1c1c100, +0x15151500, 0xe3e3e300, 0xadadad00, 0xf4f4f400, 0x77777700, 0xc7c7c700, 0x80808000, 0x9e9e9e00, }; static const ulong32 SP0222[] = { -0x00e0e0e0, 0x00050505, 0x00585858, 0x00d9d9d9, 0x00676767, 0x004e4e4e, 0x00818181, 0x00cbcbcb, -0x00c9c9c9, 0x000b0b0b, 0x00aeaeae, 0x006a6a6a, 0x00d5d5d5, 0x00181818, 0x005d5d5d, 0x00828282, -0x00464646, 0x00dfdfdf, 0x00d6d6d6, 0x00272727, 0x008a8a8a, 0x00323232, 0x004b4b4b, 0x00424242, -0x00dbdbdb, 0x001c1c1c, 0x009e9e9e, 0x009c9c9c, 0x003a3a3a, 0x00cacaca, 0x00252525, 0x007b7b7b, -0x000d0d0d, 0x00717171, 0x005f5f5f, 0x001f1f1f, 0x00f8f8f8, 0x00d7d7d7, 0x003e3e3e, 0x009d9d9d, -0x007c7c7c, 0x00606060, 0x00b9b9b9, 0x00bebebe, 0x00bcbcbc, 0x008b8b8b, 0x00161616, 0x00343434, -0x004d4d4d, 0x00c3c3c3, 0x00727272, 0x00959595, 0x00ababab, 0x008e8e8e, 0x00bababa, 0x007a7a7a, -0x00b3b3b3, 0x00020202, 0x00b4b4b4, 0x00adadad, 0x00a2a2a2, 0x00acacac, 0x00d8d8d8, 0x009a9a9a, -0x00171717, 0x001a1a1a, 0x00353535, 0x00cccccc, 0x00f7f7f7, 0x00999999, 0x00616161, 0x005a5a5a, -0x00e8e8e8, 0x00242424, 0x00565656, 0x00404040, 0x00e1e1e1, 0x00636363, 0x00090909, 0x00333333, -0x00bfbfbf, 0x00989898, 0x00979797, 0x00858585, 0x00686868, 0x00fcfcfc, 0x00ececec, 0x000a0a0a, -0x00dadada, 0x006f6f6f, 0x00535353, 0x00626262, 0x00a3a3a3, 0x002e2e2e, 0x00080808, 0x00afafaf, -0x00282828, 0x00b0b0b0, 0x00747474, 0x00c2c2c2, 0x00bdbdbd, 0x00363636, 0x00222222, 0x00383838, -0x00646464, 0x001e1e1e, 0x00393939, 0x002c2c2c, 0x00a6a6a6, 0x00303030, 0x00e5e5e5, 0x00444444, -0x00fdfdfd, 0x00888888, 0x009f9f9f, 0x00656565, 0x00878787, 0x006b6b6b, 0x00f4f4f4, 0x00232323, -0x00484848, 0x00101010, 0x00d1d1d1, 0x00515151, 0x00c0c0c0, 0x00f9f9f9, 0x00d2d2d2, 0x00a0a0a0, -0x00555555, 0x00a1a1a1, 0x00414141, 0x00fafafa, 0x00434343, 0x00131313, 0x00c4c4c4, 0x002f2f2f, -0x00a8a8a8, 0x00b6b6b6, 0x003c3c3c, 0x002b2b2b, 0x00c1c1c1, 0x00ffffff, 0x00c8c8c8, 0x00a5a5a5, -0x00202020, 0x00898989, 0x00000000, 0x00909090, 0x00474747, 0x00efefef, 0x00eaeaea, 0x00b7b7b7, -0x00151515, 0x00060606, 0x00cdcdcd, 0x00b5b5b5, 0x00121212, 0x007e7e7e, 0x00bbbbbb, 0x00292929, -0x000f0f0f, 0x00b8b8b8, 0x00070707, 0x00040404, 0x009b9b9b, 0x00949494, 0x00212121, 0x00666666, -0x00e6e6e6, 0x00cecece, 0x00ededed, 0x00e7e7e7, 0x003b3b3b, 0x00fefefe, 0x007f7f7f, 0x00c5c5c5, -0x00a4a4a4, 0x00373737, 0x00b1b1b1, 0x004c4c4c, 0x00919191, 0x006e6e6e, 0x008d8d8d, 0x00767676, -0x00030303, 0x002d2d2d, 0x00dedede, 0x00969696, 0x00262626, 0x007d7d7d, 0x00c6c6c6, 0x005c5c5c, -0x00d3d3d3, 0x00f2f2f2, 0x004f4f4f, 0x00191919, 0x003f3f3f, 0x00dcdcdc, 0x00797979, 0x001d1d1d, -0x00525252, 0x00ebebeb, 0x00f3f3f3, 0x006d6d6d, 0x005e5e5e, 0x00fbfbfb, 0x00696969, 0x00b2b2b2, -0x00f0f0f0, 0x00313131, 0x000c0c0c, 0x00d4d4d4, 0x00cfcfcf, 0x008c8c8c, 0x00e2e2e2, 0x00757575, -0x00a9a9a9, 0x004a4a4a, 0x00575757, 0x00848484, 0x00111111, 0x00454545, 0x001b1b1b, 0x00f5f5f5, -0x00e4e4e4, 0x000e0e0e, 0x00737373, 0x00aaaaaa, 0x00f1f1f1, 0x00dddddd, 0x00595959, 0x00141414, -0x006c6c6c, 0x00929292, 0x00545454, 0x00d0d0d0, 0x00787878, 0x00707070, 0x00e3e3e3, 0x00494949, -0x00808080, 0x00505050, 0x00a7a7a7, 0x00f6f6f6, 0x00777777, 0x00939393, 0x00868686, 0x00838383, -0x002a2a2a, 0x00c7c7c7, 0x005b5b5b, 0x00e9e9e9, 0x00eeeeee, 0x008f8f8f, 0x00010101, 0x003d3d3d, +0x00e0e0e0, 0x00050505, 0x00585858, 0x00d9d9d9, 0x00676767, 0x004e4e4e, 0x00818181, 0x00cbcbcb, +0x00c9c9c9, 0x000b0b0b, 0x00aeaeae, 0x006a6a6a, 0x00d5d5d5, 0x00181818, 0x005d5d5d, 0x00828282, +0x00464646, 0x00dfdfdf, 0x00d6d6d6, 0x00272727, 0x008a8a8a, 0x00323232, 0x004b4b4b, 0x00424242, +0x00dbdbdb, 0x001c1c1c, 0x009e9e9e, 0x009c9c9c, 0x003a3a3a, 0x00cacaca, 0x00252525, 0x007b7b7b, +0x000d0d0d, 0x00717171, 0x005f5f5f, 0x001f1f1f, 0x00f8f8f8, 0x00d7d7d7, 0x003e3e3e, 0x009d9d9d, +0x007c7c7c, 0x00606060, 0x00b9b9b9, 0x00bebebe, 0x00bcbcbc, 0x008b8b8b, 0x00161616, 0x00343434, +0x004d4d4d, 0x00c3c3c3, 0x00727272, 0x00959595, 0x00ababab, 0x008e8e8e, 0x00bababa, 0x007a7a7a, +0x00b3b3b3, 0x00020202, 0x00b4b4b4, 0x00adadad, 0x00a2a2a2, 0x00acacac, 0x00d8d8d8, 0x009a9a9a, +0x00171717, 0x001a1a1a, 0x00353535, 0x00cccccc, 0x00f7f7f7, 0x00999999, 0x00616161, 0x005a5a5a, +0x00e8e8e8, 0x00242424, 0x00565656, 0x00404040, 0x00e1e1e1, 0x00636363, 0x00090909, 0x00333333, +0x00bfbfbf, 0x00989898, 0x00979797, 0x00858585, 0x00686868, 0x00fcfcfc, 0x00ececec, 0x000a0a0a, +0x00dadada, 0x006f6f6f, 0x00535353, 0x00626262, 0x00a3a3a3, 0x002e2e2e, 0x00080808, 0x00afafaf, +0x00282828, 0x00b0b0b0, 0x00747474, 0x00c2c2c2, 0x00bdbdbd, 0x00363636, 0x00222222, 0x00383838, +0x00646464, 0x001e1e1e, 0x00393939, 0x002c2c2c, 0x00a6a6a6, 0x00303030, 0x00e5e5e5, 0x00444444, +0x00fdfdfd, 0x00888888, 0x009f9f9f, 0x00656565, 0x00878787, 0x006b6b6b, 0x00f4f4f4, 0x00232323, +0x00484848, 0x00101010, 0x00d1d1d1, 0x00515151, 0x00c0c0c0, 0x00f9f9f9, 0x00d2d2d2, 0x00a0a0a0, +0x00555555, 0x00a1a1a1, 0x00414141, 0x00fafafa, 0x00434343, 0x00131313, 0x00c4c4c4, 0x002f2f2f, +0x00a8a8a8, 0x00b6b6b6, 0x003c3c3c, 0x002b2b2b, 0x00c1c1c1, 0x00ffffff, 0x00c8c8c8, 0x00a5a5a5, +0x00202020, 0x00898989, 0x00000000, 0x00909090, 0x00474747, 0x00efefef, 0x00eaeaea, 0x00b7b7b7, +0x00151515, 0x00060606, 0x00cdcdcd, 0x00b5b5b5, 0x00121212, 0x007e7e7e, 0x00bbbbbb, 0x00292929, +0x000f0f0f, 0x00b8b8b8, 0x00070707, 0x00040404, 0x009b9b9b, 0x00949494, 0x00212121, 0x00666666, +0x00e6e6e6, 0x00cecece, 0x00ededed, 0x00e7e7e7, 0x003b3b3b, 0x00fefefe, 0x007f7f7f, 0x00c5c5c5, +0x00a4a4a4, 0x00373737, 0x00b1b1b1, 0x004c4c4c, 0x00919191, 0x006e6e6e, 0x008d8d8d, 0x00767676, +0x00030303, 0x002d2d2d, 0x00dedede, 0x00969696, 0x00262626, 0x007d7d7d, 0x00c6c6c6, 0x005c5c5c, +0x00d3d3d3, 0x00f2f2f2, 0x004f4f4f, 0x00191919, 0x003f3f3f, 0x00dcdcdc, 0x00797979, 0x001d1d1d, +0x00525252, 0x00ebebeb, 0x00f3f3f3, 0x006d6d6d, 0x005e5e5e, 0x00fbfbfb, 0x00696969, 0x00b2b2b2, +0x00f0f0f0, 0x00313131, 0x000c0c0c, 0x00d4d4d4, 0x00cfcfcf, 0x008c8c8c, 0x00e2e2e2, 0x00757575, +0x00a9a9a9, 0x004a4a4a, 0x00575757, 0x00848484, 0x00111111, 0x00454545, 0x001b1b1b, 0x00f5f5f5, +0x00e4e4e4, 0x000e0e0e, 0x00737373, 0x00aaaaaa, 0x00f1f1f1, 0x00dddddd, 0x00595959, 0x00141414, +0x006c6c6c, 0x00929292, 0x00545454, 0x00d0d0d0, 0x00787878, 0x00707070, 0x00e3e3e3, 0x00494949, +0x00808080, 0x00505050, 0x00a7a7a7, 0x00f6f6f6, 0x00777777, 0x00939393, 0x00868686, 0x00838383, +0x002a2a2a, 0x00c7c7c7, 0x005b5b5b, 0x00e9e9e9, 0x00eeeeee, 0x008f8f8f, 0x00010101, 0x003d3d3d, }; static const ulong32 SP3033[] = { -0x38003838, 0x41004141, 0x16001616, 0x76007676, 0xd900d9d9, 0x93009393, 0x60006060, 0xf200f2f2, -0x72007272, 0xc200c2c2, 0xab00abab, 0x9a009a9a, 0x75007575, 0x06000606, 0x57005757, 0xa000a0a0, -0x91009191, 0xf700f7f7, 0xb500b5b5, 0xc900c9c9, 0xa200a2a2, 0x8c008c8c, 0xd200d2d2, 0x90009090, -0xf600f6f6, 0x07000707, 0xa700a7a7, 0x27002727, 0x8e008e8e, 0xb200b2b2, 0x49004949, 0xde00dede, -0x43004343, 0x5c005c5c, 0xd700d7d7, 0xc700c7c7, 0x3e003e3e, 0xf500f5f5, 0x8f008f8f, 0x67006767, -0x1f001f1f, 0x18001818, 0x6e006e6e, 0xaf00afaf, 0x2f002f2f, 0xe200e2e2, 0x85008585, 0x0d000d0d, -0x53005353, 0xf000f0f0, 0x9c009c9c, 0x65006565, 0xea00eaea, 0xa300a3a3, 0xae00aeae, 0x9e009e9e, -0xec00ecec, 0x80008080, 0x2d002d2d, 0x6b006b6b, 0xa800a8a8, 0x2b002b2b, 0x36003636, 0xa600a6a6, -0xc500c5c5, 0x86008686, 0x4d004d4d, 0x33003333, 0xfd00fdfd, 0x66006666, 0x58005858, 0x96009696, -0x3a003a3a, 0x09000909, 0x95009595, 0x10001010, 0x78007878, 0xd800d8d8, 0x42004242, 0xcc00cccc, -0xef00efef, 0x26002626, 0xe500e5e5, 0x61006161, 0x1a001a1a, 0x3f003f3f, 0x3b003b3b, 0x82008282, -0xb600b6b6, 0xdb00dbdb, 0xd400d4d4, 0x98009898, 0xe800e8e8, 0x8b008b8b, 0x02000202, 0xeb00ebeb, -0x0a000a0a, 0x2c002c2c, 0x1d001d1d, 0xb000b0b0, 0x6f006f6f, 0x8d008d8d, 0x88008888, 0x0e000e0e, -0x19001919, 0x87008787, 0x4e004e4e, 0x0b000b0b, 0xa900a9a9, 0x0c000c0c, 0x79007979, 0x11001111, -0x7f007f7f, 0x22002222, 0xe700e7e7, 0x59005959, 0xe100e1e1, 0xda00dada, 0x3d003d3d, 0xc800c8c8, -0x12001212, 0x04000404, 0x74007474, 0x54005454, 0x30003030, 0x7e007e7e, 0xb400b4b4, 0x28002828, -0x55005555, 0x68006868, 0x50005050, 0xbe00bebe, 0xd000d0d0, 0xc400c4c4, 0x31003131, 0xcb00cbcb, -0x2a002a2a, 0xad00adad, 0x0f000f0f, 0xca00caca, 0x70007070, 0xff00ffff, 0x32003232, 0x69006969, -0x08000808, 0x62006262, 0x00000000, 0x24002424, 0xd100d1d1, 0xfb00fbfb, 0xba00baba, 0xed00eded, -0x45004545, 0x81008181, 0x73007373, 0x6d006d6d, 0x84008484, 0x9f009f9f, 0xee00eeee, 0x4a004a4a, -0xc300c3c3, 0x2e002e2e, 0xc100c1c1, 0x01000101, 0xe600e6e6, 0x25002525, 0x48004848, 0x99009999, -0xb900b9b9, 0xb300b3b3, 0x7b007b7b, 0xf900f9f9, 0xce00cece, 0xbf00bfbf, 0xdf00dfdf, 0x71007171, -0x29002929, 0xcd00cdcd, 0x6c006c6c, 0x13001313, 0x64006464, 0x9b009b9b, 0x63006363, 0x9d009d9d, -0xc000c0c0, 0x4b004b4b, 0xb700b7b7, 0xa500a5a5, 0x89008989, 0x5f005f5f, 0xb100b1b1, 0x17001717, -0xf400f4f4, 0xbc00bcbc, 0xd300d3d3, 0x46004646, 0xcf00cfcf, 0x37003737, 0x5e005e5e, 0x47004747, -0x94009494, 0xfa00fafa, 0xfc00fcfc, 0x5b005b5b, 0x97009797, 0xfe00fefe, 0x5a005a5a, 0xac00acac, -0x3c003c3c, 0x4c004c4c, 0x03000303, 0x35003535, 0xf300f3f3, 0x23002323, 0xb800b8b8, 0x5d005d5d, -0x6a006a6a, 0x92009292, 0xd500d5d5, 0x21002121, 0x44004444, 0x51005151, 0xc600c6c6, 0x7d007d7d, -0x39003939, 0x83008383, 0xdc00dcdc, 0xaa00aaaa, 0x7c007c7c, 0x77007777, 0x56005656, 0x05000505, -0x1b001b1b, 0xa400a4a4, 0x15001515, 0x34003434, 0x1e001e1e, 0x1c001c1c, 0xf800f8f8, 0x52005252, -0x20002020, 0x14001414, 0xe900e9e9, 0xbd00bdbd, 0xdd00dddd, 0xe400e4e4, 0xa100a1a1, 0xe000e0e0, -0x8a008a8a, 0xf100f1f1, 0xd600d6d6, 0x7a007a7a, 0xbb00bbbb, 0xe300e3e3, 0x40004040, 0x4f004f4f, +0x38003838, 0x41004141, 0x16001616, 0x76007676, 0xd900d9d9, 0x93009393, 0x60006060, 0xf200f2f2, +0x72007272, 0xc200c2c2, 0xab00abab, 0x9a009a9a, 0x75007575, 0x06000606, 0x57005757, 0xa000a0a0, +0x91009191, 0xf700f7f7, 0xb500b5b5, 0xc900c9c9, 0xa200a2a2, 0x8c008c8c, 0xd200d2d2, 0x90009090, +0xf600f6f6, 0x07000707, 0xa700a7a7, 0x27002727, 0x8e008e8e, 0xb200b2b2, 0x49004949, 0xde00dede, +0x43004343, 0x5c005c5c, 0xd700d7d7, 0xc700c7c7, 0x3e003e3e, 0xf500f5f5, 0x8f008f8f, 0x67006767, +0x1f001f1f, 0x18001818, 0x6e006e6e, 0xaf00afaf, 0x2f002f2f, 0xe200e2e2, 0x85008585, 0x0d000d0d, +0x53005353, 0xf000f0f0, 0x9c009c9c, 0x65006565, 0xea00eaea, 0xa300a3a3, 0xae00aeae, 0x9e009e9e, +0xec00ecec, 0x80008080, 0x2d002d2d, 0x6b006b6b, 0xa800a8a8, 0x2b002b2b, 0x36003636, 0xa600a6a6, +0xc500c5c5, 0x86008686, 0x4d004d4d, 0x33003333, 0xfd00fdfd, 0x66006666, 0x58005858, 0x96009696, +0x3a003a3a, 0x09000909, 0x95009595, 0x10001010, 0x78007878, 0xd800d8d8, 0x42004242, 0xcc00cccc, +0xef00efef, 0x26002626, 0xe500e5e5, 0x61006161, 0x1a001a1a, 0x3f003f3f, 0x3b003b3b, 0x82008282, +0xb600b6b6, 0xdb00dbdb, 0xd400d4d4, 0x98009898, 0xe800e8e8, 0x8b008b8b, 0x02000202, 0xeb00ebeb, +0x0a000a0a, 0x2c002c2c, 0x1d001d1d, 0xb000b0b0, 0x6f006f6f, 0x8d008d8d, 0x88008888, 0x0e000e0e, +0x19001919, 0x87008787, 0x4e004e4e, 0x0b000b0b, 0xa900a9a9, 0x0c000c0c, 0x79007979, 0x11001111, +0x7f007f7f, 0x22002222, 0xe700e7e7, 0x59005959, 0xe100e1e1, 0xda00dada, 0x3d003d3d, 0xc800c8c8, +0x12001212, 0x04000404, 0x74007474, 0x54005454, 0x30003030, 0x7e007e7e, 0xb400b4b4, 0x28002828, +0x55005555, 0x68006868, 0x50005050, 0xbe00bebe, 0xd000d0d0, 0xc400c4c4, 0x31003131, 0xcb00cbcb, +0x2a002a2a, 0xad00adad, 0x0f000f0f, 0xca00caca, 0x70007070, 0xff00ffff, 0x32003232, 0x69006969, +0x08000808, 0x62006262, 0x00000000, 0x24002424, 0xd100d1d1, 0xfb00fbfb, 0xba00baba, 0xed00eded, +0x45004545, 0x81008181, 0x73007373, 0x6d006d6d, 0x84008484, 0x9f009f9f, 0xee00eeee, 0x4a004a4a, +0xc300c3c3, 0x2e002e2e, 0xc100c1c1, 0x01000101, 0xe600e6e6, 0x25002525, 0x48004848, 0x99009999, +0xb900b9b9, 0xb300b3b3, 0x7b007b7b, 0xf900f9f9, 0xce00cece, 0xbf00bfbf, 0xdf00dfdf, 0x71007171, +0x29002929, 0xcd00cdcd, 0x6c006c6c, 0x13001313, 0x64006464, 0x9b009b9b, 0x63006363, 0x9d009d9d, +0xc000c0c0, 0x4b004b4b, 0xb700b7b7, 0xa500a5a5, 0x89008989, 0x5f005f5f, 0xb100b1b1, 0x17001717, +0xf400f4f4, 0xbc00bcbc, 0xd300d3d3, 0x46004646, 0xcf00cfcf, 0x37003737, 0x5e005e5e, 0x47004747, +0x94009494, 0xfa00fafa, 0xfc00fcfc, 0x5b005b5b, 0x97009797, 0xfe00fefe, 0x5a005a5a, 0xac00acac, +0x3c003c3c, 0x4c004c4c, 0x03000303, 0x35003535, 0xf300f3f3, 0x23002323, 0xb800b8b8, 0x5d005d5d, +0x6a006a6a, 0x92009292, 0xd500d5d5, 0x21002121, 0x44004444, 0x51005151, 0xc600c6c6, 0x7d007d7d, +0x39003939, 0x83008383, 0xdc00dcdc, 0xaa00aaaa, 0x7c007c7c, 0x77007777, 0x56005656, 0x05000505, +0x1b001b1b, 0xa400a4a4, 0x15001515, 0x34003434, 0x1e001e1e, 0x1c001c1c, 0xf800f8f8, 0x52005252, +0x20002020, 0x14001414, 0xe900e9e9, 0xbd00bdbd, 0xdd00dddd, 0xe400e4e4, 0xa100a1a1, 0xe000e0e0, +0x8a008a8a, 0xf100f1f1, 0xd600d6d6, 0x7a007a7a, 0xbb00bbbb, 0xe300e3e3, 0x40004040, 0x4f004f4f, }; static const ulong32 SP4404[] = { -0x70700070, 0x2c2c002c, 0xb3b300b3, 0xc0c000c0, 0xe4e400e4, 0x57570057, 0xeaea00ea, 0xaeae00ae, -0x23230023, 0x6b6b006b, 0x45450045, 0xa5a500a5, 0xeded00ed, 0x4f4f004f, 0x1d1d001d, 0x92920092, -0x86860086, 0xafaf00af, 0x7c7c007c, 0x1f1f001f, 0x3e3e003e, 0xdcdc00dc, 0x5e5e005e, 0x0b0b000b, -0xa6a600a6, 0x39390039, 0xd5d500d5, 0x5d5d005d, 0xd9d900d9, 0x5a5a005a, 0x51510051, 0x6c6c006c, -0x8b8b008b, 0x9a9a009a, 0xfbfb00fb, 0xb0b000b0, 0x74740074, 0x2b2b002b, 0xf0f000f0, 0x84840084, -0xdfdf00df, 0xcbcb00cb, 0x34340034, 0x76760076, 0x6d6d006d, 0xa9a900a9, 0xd1d100d1, 0x04040004, -0x14140014, 0x3a3a003a, 0xdede00de, 0x11110011, 0x32320032, 0x9c9c009c, 0x53530053, 0xf2f200f2, -0xfefe00fe, 0xcfcf00cf, 0xc3c300c3, 0x7a7a007a, 0x24240024, 0xe8e800e8, 0x60600060, 0x69690069, -0xaaaa00aa, 0xa0a000a0, 0xa1a100a1, 0x62620062, 0x54540054, 0x1e1e001e, 0xe0e000e0, 0x64640064, -0x10100010, 0x00000000, 0xa3a300a3, 0x75750075, 0x8a8a008a, 0xe6e600e6, 0x09090009, 0xdddd00dd, -0x87870087, 0x83830083, 0xcdcd00cd, 0x90900090, 0x73730073, 0xf6f600f6, 0x9d9d009d, 0xbfbf00bf, -0x52520052, 0xd8d800d8, 0xc8c800c8, 0xc6c600c6, 0x81810081, 0x6f6f006f, 0x13130013, 0x63630063, -0xe9e900e9, 0xa7a700a7, 0x9f9f009f, 0xbcbc00bc, 0x29290029, 0xf9f900f9, 0x2f2f002f, 0xb4b400b4, -0x78780078, 0x06060006, 0xe7e700e7, 0x71710071, 0xd4d400d4, 0xabab00ab, 0x88880088, 0x8d8d008d, -0x72720072, 0xb9b900b9, 0xf8f800f8, 0xacac00ac, 0x36360036, 0x2a2a002a, 0x3c3c003c, 0xf1f100f1, -0x40400040, 0xd3d300d3, 0xbbbb00bb, 0x43430043, 0x15150015, 0xadad00ad, 0x77770077, 0x80800080, -0x82820082, 0xecec00ec, 0x27270027, 0xe5e500e5, 0x85850085, 0x35350035, 0x0c0c000c, 0x41410041, -0xefef00ef, 0x93930093, 0x19190019, 0x21210021, 0x0e0e000e, 0x4e4e004e, 0x65650065, 0xbdbd00bd, -0xb8b800b8, 0x8f8f008f, 0xebeb00eb, 0xcece00ce, 0x30300030, 0x5f5f005f, 0xc5c500c5, 0x1a1a001a, -0xe1e100e1, 0xcaca00ca, 0x47470047, 0x3d3d003d, 0x01010001, 0xd6d600d6, 0x56560056, 0x4d4d004d, -0x0d0d000d, 0x66660066, 0xcccc00cc, 0x2d2d002d, 0x12120012, 0x20200020, 0xb1b100b1, 0x99990099, -0x4c4c004c, 0xc2c200c2, 0x7e7e007e, 0x05050005, 0xb7b700b7, 0x31310031, 0x17170017, 0xd7d700d7, -0x58580058, 0x61610061, 0x1b1b001b, 0x1c1c001c, 0x0f0f000f, 0x16160016, 0x18180018, 0x22220022, -0x44440044, 0xb2b200b2, 0xb5b500b5, 0x91910091, 0x08080008, 0xa8a800a8, 0xfcfc00fc, 0x50500050, -0xd0d000d0, 0x7d7d007d, 0x89890089, 0x97970097, 0x5b5b005b, 0x95950095, 0xffff00ff, 0xd2d200d2, -0xc4c400c4, 0x48480048, 0xf7f700f7, 0xdbdb00db, 0x03030003, 0xdada00da, 0x3f3f003f, 0x94940094, -0x5c5c005c, 0x02020002, 0x4a4a004a, 0x33330033, 0x67670067, 0xf3f300f3, 0x7f7f007f, 0xe2e200e2, -0x9b9b009b, 0x26260026, 0x37370037, 0x3b3b003b, 0x96960096, 0x4b4b004b, 0xbebe00be, 0x2e2e002e, -0x79790079, 0x8c8c008c, 0x6e6e006e, 0x8e8e008e, 0xf5f500f5, 0xb6b600b6, 0xfdfd00fd, 0x59590059, -0x98980098, 0x6a6a006a, 0x46460046, 0xbaba00ba, 0x25250025, 0x42420042, 0xa2a200a2, 0xfafa00fa, -0x07070007, 0x55550055, 0xeeee00ee, 0x0a0a000a, 0x49490049, 0x68680068, 0x38380038, 0xa4a400a4, -0x28280028, 0x7b7b007b, 0xc9c900c9, 0xc1c100c1, 0xe3e300e3, 0xf4f400f4, 0xc7c700c7, 0x9e9e009e, +0x70700070, 0x2c2c002c, 0xb3b300b3, 0xc0c000c0, 0xe4e400e4, 0x57570057, 0xeaea00ea, 0xaeae00ae, +0x23230023, 0x6b6b006b, 0x45450045, 0xa5a500a5, 0xeded00ed, 0x4f4f004f, 0x1d1d001d, 0x92920092, +0x86860086, 0xafaf00af, 0x7c7c007c, 0x1f1f001f, 0x3e3e003e, 0xdcdc00dc, 0x5e5e005e, 0x0b0b000b, +0xa6a600a6, 0x39390039, 0xd5d500d5, 0x5d5d005d, 0xd9d900d9, 0x5a5a005a, 0x51510051, 0x6c6c006c, +0x8b8b008b, 0x9a9a009a, 0xfbfb00fb, 0xb0b000b0, 0x74740074, 0x2b2b002b, 0xf0f000f0, 0x84840084, +0xdfdf00df, 0xcbcb00cb, 0x34340034, 0x76760076, 0x6d6d006d, 0xa9a900a9, 0xd1d100d1, 0x04040004, +0x14140014, 0x3a3a003a, 0xdede00de, 0x11110011, 0x32320032, 0x9c9c009c, 0x53530053, 0xf2f200f2, +0xfefe00fe, 0xcfcf00cf, 0xc3c300c3, 0x7a7a007a, 0x24240024, 0xe8e800e8, 0x60600060, 0x69690069, +0xaaaa00aa, 0xa0a000a0, 0xa1a100a1, 0x62620062, 0x54540054, 0x1e1e001e, 0xe0e000e0, 0x64640064, +0x10100010, 0x00000000, 0xa3a300a3, 0x75750075, 0x8a8a008a, 0xe6e600e6, 0x09090009, 0xdddd00dd, +0x87870087, 0x83830083, 0xcdcd00cd, 0x90900090, 0x73730073, 0xf6f600f6, 0x9d9d009d, 0xbfbf00bf, +0x52520052, 0xd8d800d8, 0xc8c800c8, 0xc6c600c6, 0x81810081, 0x6f6f006f, 0x13130013, 0x63630063, +0xe9e900e9, 0xa7a700a7, 0x9f9f009f, 0xbcbc00bc, 0x29290029, 0xf9f900f9, 0x2f2f002f, 0xb4b400b4, +0x78780078, 0x06060006, 0xe7e700e7, 0x71710071, 0xd4d400d4, 0xabab00ab, 0x88880088, 0x8d8d008d, +0x72720072, 0xb9b900b9, 0xf8f800f8, 0xacac00ac, 0x36360036, 0x2a2a002a, 0x3c3c003c, 0xf1f100f1, +0x40400040, 0xd3d300d3, 0xbbbb00bb, 0x43430043, 0x15150015, 0xadad00ad, 0x77770077, 0x80800080, +0x82820082, 0xecec00ec, 0x27270027, 0xe5e500e5, 0x85850085, 0x35350035, 0x0c0c000c, 0x41410041, +0xefef00ef, 0x93930093, 0x19190019, 0x21210021, 0x0e0e000e, 0x4e4e004e, 0x65650065, 0xbdbd00bd, +0xb8b800b8, 0x8f8f008f, 0xebeb00eb, 0xcece00ce, 0x30300030, 0x5f5f005f, 0xc5c500c5, 0x1a1a001a, +0xe1e100e1, 0xcaca00ca, 0x47470047, 0x3d3d003d, 0x01010001, 0xd6d600d6, 0x56560056, 0x4d4d004d, +0x0d0d000d, 0x66660066, 0xcccc00cc, 0x2d2d002d, 0x12120012, 0x20200020, 0xb1b100b1, 0x99990099, +0x4c4c004c, 0xc2c200c2, 0x7e7e007e, 0x05050005, 0xb7b700b7, 0x31310031, 0x17170017, 0xd7d700d7, +0x58580058, 0x61610061, 0x1b1b001b, 0x1c1c001c, 0x0f0f000f, 0x16160016, 0x18180018, 0x22220022, +0x44440044, 0xb2b200b2, 0xb5b500b5, 0x91910091, 0x08080008, 0xa8a800a8, 0xfcfc00fc, 0x50500050, +0xd0d000d0, 0x7d7d007d, 0x89890089, 0x97970097, 0x5b5b005b, 0x95950095, 0xffff00ff, 0xd2d200d2, +0xc4c400c4, 0x48480048, 0xf7f700f7, 0xdbdb00db, 0x03030003, 0xdada00da, 0x3f3f003f, 0x94940094, +0x5c5c005c, 0x02020002, 0x4a4a004a, 0x33330033, 0x67670067, 0xf3f300f3, 0x7f7f007f, 0xe2e200e2, +0x9b9b009b, 0x26260026, 0x37370037, 0x3b3b003b, 0x96960096, 0x4b4b004b, 0xbebe00be, 0x2e2e002e, +0x79790079, 0x8c8c008c, 0x6e6e006e, 0x8e8e008e, 0xf5f500f5, 0xb6b600b6, 0xfdfd00fd, 0x59590059, +0x98980098, 0x6a6a006a, 0x46460046, 0xbaba00ba, 0x25250025, 0x42420042, 0xa2a200a2, 0xfafa00fa, +0x07070007, 0x55550055, 0xeeee00ee, 0x0a0a000a, 0x49490049, 0x68680068, 0x38380038, 0xa4a400a4, +0x28280028, 0x7b7b007b, 0xc9c900c9, 0xc1c100c1, 0xe3e300e3, 0xf4f400f4, 0xc7c700c7, 0x9e9e009e, }; static ulong64 key_sigma[] = { @@ -198,10 +198,10 @@ static ulong64 F(ulong64 x) static void rot_128(unsigned char *in, unsigned count, unsigned char *out) { unsigned x, w, b; - - w = count >> 3; + + w = count >> 3; b = count & 7; - + for (x = 0; x < 16; x++) { out[x] = (in[(x+w)&15] << b) | (in[(x+w+1)&15] >> (8 - b)); } @@ -212,7 +212,7 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr unsigned char T[48], kA[16], kB[16], kR[16], kL[16]; int x; ulong64 A, B; - + // LTC_ARGCHK(key != NULL); // LTC_ARGCHK(skey != NULL); @@ -227,27 +227,27 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr if (num_rounds != 0 && num_rounds != skey->camellia.R) { return CRYPT_INVALID_ROUNDS; } - + /* expand key */ if (keylen == 16) { - for (x = 0; x < 16; x++) { - T[x] = key[x]; + for (x = 0; x < 16; x++) { + T[x] = key[x]; T[x + 16] = 0; } } else if (keylen == 24) { - for (x = 0; x < 24; x++) { - T[x] = key[x]; + for (x = 0; x < 24; x++) { + T[x] = key[x]; } - for (x = 24; x < 32; x++) { - T[x] = key[x-8] ^ 0xFF; + for (x = 24; x < 32; x++) { + T[x] = key[x-8] ^ 0xFF; } } else { - for (x = 0; x < 32; x++) { - T[x] = key[x]; + for (x = 0; x < 32; x++) { + T[x] = key[x]; } } - for (x = 0; x < 16; x++) { + for (x = 0; x < 16; x++) { kL[x] = T[x]; kR[x] = T[x + 16]; } @@ -258,8 +258,8 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr /* first two rounds */ LOAD64H(A, T+32); LOAD64H(B, T+40); - B ^= F(A ^ key_sigma[0]); - A ^= F(B ^ key_sigma[1]); + B ^= F(A ^ key_sigma[0]); + A ^= F(B ^ key_sigma[1]); STORE64H(A, T+32); STORE64H(B, T+40); /* xor kL in */ @@ -267,8 +267,8 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr /* next two rounds */ LOAD64H(A, T+32); LOAD64H(B, T+40); - B ^= F(A ^ key_sigma[2]); - A ^= F(B ^ key_sigma[3]); + B ^= F(A ^ key_sigma[2]); + A ^= F(B ^ key_sigma[3]); STORE64H(A, T+32); STORE64H(B, T+40); /* grab KA */ @@ -284,7 +284,7 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr /* k1-k2 */ LOAD64H(skey->camellia.k[0], kA); - LOAD64H(skey->camellia.k[1], kA+8); + LOAD64H(skey->camellia.k[1], kA+8); /* rotate kL by 15, k3/k4 */ rot_128(kL, 15, T+32); @@ -316,7 +316,7 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr rot_128(kA, 60, T+32); LOAD64H(skey->camellia.k[10], T+32); LOAD64H(skey->camellia.k[11], T+40); - + /* rotate kL by 77, kl3, kl4 */ rot_128(kL, 77, T+32); LOAD64H(skey->camellia.kl[2], T+32); @@ -344,8 +344,8 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr } else { /* last two rounds */ LOAD64H(A, T+32); LOAD64H(B, T+40); - B ^= F(A ^ key_sigma[4]); - A ^= F(B ^ key_sigma[5]); + B ^= F(A ^ key_sigma[4]); + A ^= F(B ^ key_sigma[5]); STORE64H(A, T+32); STORE64H(B, T+40); /* grab kB */ @@ -438,12 +438,12 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr return CRYPT_OK; } -int camellia_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) +int camellia_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) { ulong64 L, R; ulong32 a, b; - LOAD64H(L, pt+0); LOAD64H(R, pt+8); + LOAD64H(L, pt+0); LOAD64H(R, pt+8); L ^= skey->camellia.kw[0]; R ^= skey->camellia.kw[1]; @@ -537,7 +537,7 @@ int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_k ulong64 L, R; ulong32 a, b; - LOAD64H(R, ct+0); LOAD64H(L, ct+8); + LOAD64H(R, ct+0); LOAD64H(L, ct+8); L ^= skey->camellia.kw[3]; R ^= skey->camellia.kw[2]; @@ -627,44 +627,44 @@ int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_k return CRYPT_OK; } -int camellia_test(void) +int camellia_test(void) { - static const struct { - int keylen; + static const struct { + int keylen; unsigned char key[32], pt[16], ct[16]; } tests[] = { { - 16, - { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 16, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, - { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, - { 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73, + { 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73, 0x08, 0x57, 0x06, 0x56, 0x48, 0xea, 0xbe, 0x43 } }, { - 24, - { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 24, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }, - { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, - { 0xb4, 0x99, 0x34, 0x01, 0xb3, 0xe9, 0x96, 0xf8, + { 0xb4, 0x99, 0x34, 0x01, 0xb3, 0xe9, 0x96, 0xf8, 0x4e, 0xe5, 0xce, 0xe7, 0xd7, 0x9b, 0x09, 0xb9 } }, { - 32, - { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 32, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, - { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, - { 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c, + { 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c, 0x20, 0xef, 0x7c, 0x91, 0x9e, 0x3a, 0x75, 0x09 } } }; @@ -673,7 +673,7 @@ int camellia_test(void) int err, x; for (x = 0; x < 3; x++) { - if ((err = camellia_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { + if ((err = camellia_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { return err; } if ((err = camellia_ecb_encrypt(tests[x].pt, buf[0], &skey)) != CRYPT_OK) { diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index 5189c2fdb..dcfd65515 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -32,9 +32,9 @@ #ifdef LTC_SAFER -const struct ltc_cipher_descriptor +const struct ltc_cipher_descriptor safer_k64_desc = { - "safer-k64", + "safer-k64", 8, 8, 8, 8, LTC_SAFER_K64_DEFAULT_NOF_ROUNDS, &safer_k64_setup, &safer_ecb_encrypt, @@ -158,7 +158,7 @@ static void Safer_Expand_Userkey(const unsigned char *userkey_1, } } } - + #ifdef LTC_CLEAN_STACK zeromem(ka, sizeof(ka)); zeromem(kb, sizeof(kb)); @@ -193,7 +193,7 @@ int safer_k64_setup(const unsigned char *key, int keylen, int numrounds, symmetr Safer_Expand_Userkey(key, key, (unsigned int)(numrounds != 0 ?numrounds:LTC_SAFER_K64_DEFAULT_NOF_ROUNDS), 0, skey->safer.key); return CRYPT_OK; } - + int safer_sk64_setup(const unsigned char *key, int keylen, int numrounds, symmetric_key *skey) { LTC_ARGCHK(key != NULL); @@ -380,7 +380,7 @@ int safer_k64_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const unsigned char k64_pt[] = { 1, 2, 3, 4, 5, 6, 7, 8 }, k64_key[] = { 8, 7, 6, 5, 4, 3, 2, 1 }, k64_ct[] = { 200, 242, 156, 221, 135, 120, 62, 217 }; @@ -409,7 +409,7 @@ int safer_sk64_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const unsigned char sk64_pt[] = { 1, 2, 3, 4, 5, 6, 7, 8 }, sk64_key[] = { 1, 2, 3, 4, 5, 6, 7, 8 }, sk64_ct[] = { 95, 206, 155, 162, 5, 132, 56, 199 }; @@ -440,7 +440,7 @@ int safer_sk64_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void safer_done(symmetric_key *skey) @@ -451,7 +451,7 @@ int safer_sk128_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const unsigned char sk128_pt[] = { 1, 2, 3, 4, 5, 6, 7, 8 }, sk128_key[] = { 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0 }, diff --git a/src/ciphers/safer/safer_tab.c b/src/ciphers/safer/safer_tab.c index 9a515ff51..4740caaf0 100644 --- a/src/ciphers/safer/safer_tab.c +++ b/src/ciphers/safer/safer_tab.c @@ -12,30 +12,30 @@ /** @file safer_tab.c Tables for LTC_SAFER block ciphers -*/ - +*/ + #include "tomcrypt.h" #if defined(LTC_SAFERP) || defined(LTC_SAFER) -/* This is the box defined by ebox[x] = 45^x mod 257. +/* This is the box defined by ebox[x] = 45^x mod 257. * Its assumed that the value "256" corresponds to zero. */ const unsigned char safer_ebox[256] = { - 1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63, - 8, 103, 9, 148, 235, 38, 168, 107, 189, 24, 52, 27, 187, 191, 114, 247, - 64, 53, 72, 156, 81, 47, 59, 85, 227, 192, 159, 216, 211, 243, 141, 177, -255, 167, 62, 220, 134, 119, 215, 166, 17, 251, 244, 186, 146, 145, 100, 131, -241, 51, 239, 218, 44, 181, 178, 43, 136, 209, 153, 203, 140, 132, 29, 20, -129, 151, 113, 202, 95, 163, 139, 87, 60, 130, 196, 82, 92, 28, 232, 160, - 4, 180, 133, 74, 246, 19, 84, 182, 223, 12, 26, 142, 222, 224, 57, 252, - 32, 155, 36, 78, 169, 152, 158, 171, 242, 96, 208, 108, 234, 250, 199, 217, - 0, 212, 31, 110, 67, 188, 236, 83, 137, 254, 122, 93, 73, 201, 50, 194, -249, 154, 248, 109, 22, 219, 89, 150, 68, 233, 205, 230, 70, 66, 143, 10, -193, 204, 185, 101, 176, 210, 198, 172, 30, 65, 98, 41, 46, 14, 116, 80, - 2, 90, 195, 37, 123, 138, 42, 91, 240, 6, 13, 71, 111, 112, 157, 126, - 16, 206, 18, 39, 213, 76, 79, 214, 121, 48, 104, 54, 117, 125, 228, 237, -128, 106, 144, 55, 162, 94, 118, 170, 197, 127, 61, 175, 165, 229, 25, 97, -253, 77, 124, 183, 11, 238, 173, 75, 34, 245, 231, 115, 35, 33, 200, 5, + 1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63, + 8, 103, 9, 148, 235, 38, 168, 107, 189, 24, 52, 27, 187, 191, 114, 247, + 64, 53, 72, 156, 81, 47, 59, 85, 227, 192, 159, 216, 211, 243, 141, 177, +255, 167, 62, 220, 134, 119, 215, 166, 17, 251, 244, 186, 146, 145, 100, 131, +241, 51, 239, 218, 44, 181, 178, 43, 136, 209, 153, 203, 140, 132, 29, 20, +129, 151, 113, 202, 95, 163, 139, 87, 60, 130, 196, 82, 92, 28, 232, 160, + 4, 180, 133, 74, 246, 19, 84, 182, 223, 12, 26, 142, 222, 224, 57, 252, + 32, 155, 36, 78, 169, 152, 158, 171, 242, 96, 208, 108, 234, 250, 199, 217, + 0, 212, 31, 110, 67, 188, 236, 83, 137, 254, 122, 93, 73, 201, 50, 194, +249, 154, 248, 109, 22, 219, 89, 150, 68, 233, 205, 230, 70, 66, 143, 10, +193, 204, 185, 101, 176, 210, 198, 172, 30, 65, 98, 41, 46, 14, 116, 80, + 2, 90, 195, 37, 123, 138, 42, 91, 240, 6, 13, 71, 111, 112, 157, 126, + 16, 206, 18, 39, 213, 76, 79, 214, 121, 48, 104, 54, 117, 125, 228, 237, +128, 106, 144, 55, 162, 94, 118, 170, 197, 127, 61, 175, 165, 229, 25, 97, +253, 77, 124, 183, 11, 238, 173, 75, 34, 245, 231, 115, 35, 33, 200, 5, 225, 102, 221, 179, 88, 105, 99, 86, 15, 161, 49, 149, 23, 7, 58, 40 }; @@ -43,19 +43,19 @@ const unsigned char safer_ebox[256] = { const unsigned char safer_lbox[256] = { 128, 0, 176, 9, 96, 239, 185, 253, 16, 18, 159, 228, 105, 186, 173, 248, 192, 56, 194, 101, 79, 6, 148, 252, 25, 222, 106, 27, 93, 78, 168, 130, -112, 237, 232, 236, 114, 179, 21, 195, 255, 171, 182, 71, 68, 1, 172, 37, -201, 250, 142, 65, 26, 33, 203, 211, 13, 110, 254, 38, 88, 218, 50, 15, - 32, 169, 157, 132, 152, 5, 156, 187, 34, 140, 99, 231, 197, 225, 115, 198, -175, 36, 91, 135, 102, 39, 247, 87, 244, 150, 177, 183, 92, 139, 213, 84, -121, 223, 170, 246, 62, 163, 241, 17, 202, 245, 209, 23, 123, 147, 131, 188, +112, 237, 232, 236, 114, 179, 21, 195, 255, 171, 182, 71, 68, 1, 172, 37, +201, 250, 142, 65, 26, 33, 203, 211, 13, 110, 254, 38, 88, 218, 50, 15, + 32, 169, 157, 132, 152, 5, 156, 187, 34, 140, 99, 231, 197, 225, 115, 198, +175, 36, 91, 135, 102, 39, 247, 87, 244, 150, 177, 183, 92, 139, 213, 84, +121, 223, 170, 246, 62, 163, 241, 17, 202, 245, 209, 23, 123, 147, 131, 188, 189, 82, 30, 235, 174, 204, 214, 53, 8, 200, 138, 180, 226, 205, 191, 217, -208, 80, 89, 63, 77, 98, 52, 10, 72, 136, 181, 86, 76, 46, 107, 158, -210, 61, 60, 3, 19, 251, 151, 81, 117, 74, 145, 113, 35, 190, 118, 42, +208, 80, 89, 63, 77, 98, 52, 10, 72, 136, 181, 86, 76, 46, 107, 158, +210, 61, 60, 3, 19, 251, 151, 81, 117, 74, 145, 113, 35, 190, 118, 42, 95, 249, 212, 85, 11, 220, 55, 49, 22, 116, 215, 119, 167, 230, 7, 219, -164, 47, 70, 243, 97, 69, 103, 227, 12, 162, 59, 28, 133, 24, 4, 29, - 41, 160, 143, 178, 90, 216, 166, 126, 238, 141, 83, 75, 161, 154, 193, 14, -122, 73, 165, 44, 129, 196, 199, 54, 43, 127, 67, 149, 51, 242, 108, 104, -109, 240, 2, 40, 206, 221, 155, 234, 94, 153, 124, 20, 134, 207, 229, 66, +164, 47, 70, 243, 97, 69, 103, 227, 12, 162, 59, 28, 133, 24, 4, 29, + 41, 160, 143, 178, 90, 216, 166, 126, 238, 141, 83, 75, 161, 154, 193, 14, +122, 73, 165, 44, 129, 196, 199, 54, 43, 127, 67, 149, 51, 242, 108, 104, +109, 240, 2, 40, 206, 221, 155, 234, 94, 153, 124, 20, 134, 207, 229, 66, 184, 64, 120, 45, 58, 233, 100, 31, 146, 144, 125, 57, 111, 224, 137, 48 }; diff --git a/src/ciphers/safer/saferp.c b/src/ciphers/safer/saferp.c index 8cecab05c..a9e9980a5 100644 --- a/src/ciphers/safer/saferp.c +++ b/src/ciphers/safer/saferp.c @@ -9,9 +9,9 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file saferp.c - LTC_SAFER+ Implementation by Tom St Denis + LTC_SAFER+ Implementation by Tom St Denis */ #include "tomcrypt.h" @@ -31,14 +31,14 @@ const struct ltc_cipher_descriptor saferp_desc = NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -/* ROUND(b,i) +/* ROUND(b,i) * - * This is one forward key application. Note the basic form is - * key addition, substitution, key addition. The safer_ebox and safer_lbox - * are the exponentiation box and logarithm boxes respectively. - * The value of 'i' is the current round number which allows this - * function to be unrolled massively. Most of LTC_SAFER+'s speed - * comes from not having to compute indirect accesses into the + * This is one forward key application. Note the basic form is + * key addition, substitution, key addition. The safer_ebox and safer_lbox + * are the exponentiation box and logarithm boxes respectively. + * The value of 'i' is the current round number which allows this + * function to be unrolled massively. Most of LTC_SAFER+'s speed + * comes from not having to compute indirect accesses into the * array of 16 bytes b[0..15] which is the block of data */ @@ -60,7 +60,7 @@ extern const unsigned char safer_ebox[], safer_lbox[]; b[12] = (safer_ebox[(b[12] ^ skey->saferp.K[i][12]) & 255] + skey->saferp.K[i+1][12]) & 255; \ b[13] = safer_lbox[(b[13] + skey->saferp.K[i][13]) & 255] ^ skey->saferp.K[i+1][13]; \ b[14] = safer_lbox[(b[14] + skey->saferp.K[i][14]) & 255] ^ skey->saferp.K[i+1][14]; \ - b[15] = (safer_ebox[(b[15] ^ skey->saferp.K[i][15]) & 255] + skey->saferp.K[i+1][15]) & 255; + b[15] = (safer_ebox[(b[15] ^ skey->saferp.K[i][15]) & 255] + skey->saferp.K[i+1][15]) & 255; /* This is one inverse key application */ #define iROUND(b, i) \ @@ -90,7 +90,7 @@ extern const unsigned char safer_ebox[], safer_lbox[]; b[8] = (b[8] + (b[9] = (b[9] + b[8]) & 255)) & 255; \ b[10] = (b[10] + (b[11] = (b[11] + b[10]) & 255)) & 255; \ b[12] = (b[12] + (b[13] = (b[13] + b[12]) & 255)) & 255; \ - b[14] = (b[14] + (b[15] = (b[15] + b[14]) & 255)) & 255; + b[14] = (b[14] + (b[15] = (b[15] + b[14]) & 255)) & 255; /* This is an inverse single layer PHT transform */ #define iPHT(b) \ @@ -117,15 +117,15 @@ extern const unsigned char safer_ebox[], safer_lbox[]; b2[8] = b[0]; b2[9] = b[9]; b2[10] = b[8]; b2[11] = b[1]; \ b2[12] = b[2]; b2[13] = b[11]; b2[14] = b[10]; b2[15] = b[3]; -/* The complete forward Linear Transform layer. - * Note that alternating usage of b and b2. - * Each round of LT starts in 'b' and ends in 'b2'. +/* The complete forward Linear Transform layer. + * Note that alternating usage of b and b2. + * Each round of LT starts in 'b' and ends in 'b2'. */ #define LT(b, b2) \ PHT(b); SHUF(b, b2); \ PHT(b2); SHUF(b2, b); \ PHT(b); SHUF(b, b2); \ - PHT(b2); + PHT(b2); /* This is the inverse linear transform layer. */ #define iLT(b, b2) \ @@ -133,10 +133,10 @@ extern const unsigned char safer_ebox[], safer_lbox[]; iSHUF(b, b2); iPHT(b2); \ iSHUF(b2, b); iPHT(b); \ iSHUF(b, b2); iPHT(b2); - -#ifdef LTC_SMALL_CODE -static void _round(unsigned char *b, int i, symmetric_key *skey) +#ifdef LTC_SMALL_CODE + +static void _round(unsigned char *b, int i, symmetric_key *skey) { ROUND(b, i); } @@ -154,7 +154,7 @@ static void _lt(unsigned char *b, unsigned char *b2) static void _ilt(unsigned char *b, unsigned char *b2) { iLT(b, b2); -} +} #undef ROUND #define ROUND(b, i) _round(b, i, skey) @@ -228,7 +228,7 @@ int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric } /* Is the number of rounds valid? Either use zero for default or - * 8,12,16 rounds for 16,24,32 byte keys + * 8,12,16 rounds for 16,24,32 byte keys */ if (num_rounds != 0 && num_rounds != rounds[(keylen/8)-2]) { return CRYPT_INVALID_ROUNDS; @@ -237,9 +237,9 @@ int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric /* 128 bit key version */ if (keylen == 16) { /* copy key into t */ - for (x = y = 0; x < 16; x++) { - t[x] = key[x]; - y ^= key[x]; + for (x = y = 0; x < 16; x++) { + t[x] = key[x]; + y ^= key[x]; } t[16] = y; @@ -265,9 +265,9 @@ int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric skey->saferp.rounds = 8; } else if (keylen == 24) { /* copy key into t */ - for (x = y = 0; x < 24; x++) { - t[x] = key[x]; - y ^= key[x]; + for (x = y = 0; x < 24; x++) { + t[x] = key[x]; + y ^= key[x]; } t[24] = y; @@ -284,7 +284,7 @@ int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric /* select and add */ z = x; - for (y = 0; y < 16; y++) { + for (y = 0; y < 16; y++) { skey->saferp.K[x][y] = (t[z] + safer_bias[x-1][y]) & 255; if (++z == 25) { z = 0; } } @@ -292,14 +292,14 @@ int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric skey->saferp.rounds = 12; } else { /* copy key into t */ - for (x = y = 0; x < 32; x++) { - t[x] = key[x]; - y ^= key[x]; + for (x = y = 0; x < 32; x++) { + t[x] = key[x]; + y ^= key[x]; } t[32] = y; /* make round keys */ - for (x = 0; x < 16; x++) { + for (x = 0; x < 16; x++) { skey->saferp.K[0][x] = t[x]; } @@ -308,7 +308,7 @@ int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric for (y = 0; y < 33; y++) { t[y] = ((t[y]<<3)|(t[y]>>5)) & 255; } - + /* select and add */ z = x; for (y = 0; y < 16; y++) { @@ -392,7 +392,7 @@ int saferp_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key Decrypts a block of text with LTC_SAFER+ @param ct The input ciphertext (16 bytes) @param pt The output plaintext (16 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ int saferp_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -460,40 +460,40 @@ int saferp_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { int keylen; unsigned char key[32], pt[16], ct[16]; } tests[] = { { 16, - { 41, 35, 190, 132, 225, 108, 214, 174, + { 41, 35, 190, 132, 225, 108, 214, 174, 82, 144, 73, 241, 241, 187, 233, 235 }, - { 179, 166, 219, 60, 135, 12, 62, 153, + { 179, 166, 219, 60, 135, 12, 62, 153, 36, 94, 13, 28, 6, 183, 71, 222 }, - { 224, 31, 182, 10, 12, 255, 84, 70, + { 224, 31, 182, 10, 12, 255, 84, 70, 127, 13, 89, 249, 9, 57, 165, 220 } }, { 24, - { 72, 211, 143, 117, 230, 217, 29, 42, - 229, 192, 247, 43, 120, 129, 135, 68, + { 72, 211, 143, 117, 230, 217, 29, 42, + 229, 192, 247, 43, 120, 129, 135, 68, 14, 95, 80, 0, 212, 97, 141, 190 }, - { 123, 5, 21, 7, 59, 51, 130, 31, + { 123, 5, 21, 7, 59, 51, 130, 31, 24, 112, 146, 218, 100, 84, 206, 177 }, - { 92, 136, 4, 63, 57, 95, 100, 0, + { 92, 136, 4, 63, 57, 95, 100, 0, 150, 130, 130, 16, 193, 111, 219, 133 } }, { 32, - { 243, 168, 141, 254, 190, 242, 235, 113, + { 243, 168, 141, 254, 190, 242, 235, 113, 255, 160, 208, 59, 117, 6, 140, 126, - 135, 120, 115, 77, 208, 190, 130, 190, + 135, 120, 115, 77, 208, 190, 130, 190, 219, 194, 70, 65, 43, 140, 250, 48 }, - { 127, 112, 240, 167, 84, 134, 50, 149, + { 127, 112, 240, 167, 84, 134, 50, 149, 170, 91, 104, 19, 11, 230, 252, 245 }, - { 88, 11, 25, 36, 172, 229, 202, 213, + { 88, 11, 25, 36, 172, 229, 202, 213, 170, 65, 105, 153, 220, 104, 153, 138 } } - }; + }; unsigned char tmp[2][16]; symmetric_key skey; @@ -507,7 +507,7 @@ int saferp_test(void) saferp_ecb_decrypt(tmp[0], tmp[1], &skey); /* compare */ - if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { + if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { return CRYPT_FAIL_TESTVECTOR; } @@ -522,7 +522,7 @@ int saferp_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void saferp_done(symmetric_key *skey) @@ -537,7 +537,7 @@ void saferp_done(symmetric_key *skey) int saferp_keysize(int *keysize) { LTC_ARGCHK(keysize != NULL); - + if (*keysize < 16) return CRYPT_INVALID_KEYSIZE; if (*keysize < 24) { diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index 65a8c2baf..44b4b6b47 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -9,9 +9,9 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ - /** + /** @file twofish.c - Implementation of Twofish by Tom St Denis + Implementation of Twofish by Tom St Denis */ #include "tomcrypt.h" @@ -146,14 +146,14 @@ static ulong32 gf_mult(ulong32 a, ulong32 b, ulong32 p) result = P[0] = B[0] = 0; /* unrolled branchless GF multiplier */ - result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); - result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); - result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); - result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); - result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); - result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); - result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); - result ^= B[a&1]; + result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); + result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); + result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); + result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); + result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); + result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); + result ^= B[a&1]; a >>= 1; B[1] = P[B[1]>>7] ^ (B[1] << 1); + result ^= B[a&1]; return result; } @@ -437,7 +437,7 @@ int twofish_setup(const unsigned char *key, int keylen, int num_rounds, symmetri /* small ram variant */ switch (k) { case 4 : skey->twofish.start = 0; break; - case 3 : skey->twofish.start = 1; break; + case 3 : skey->twofish.start = 1; break; default: skey->twofish.start = 2; break; } #endif @@ -471,18 +471,18 @@ int twofish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_ke int r; #if !defined(LTC_TWOFISH_SMALL) && !defined(__GNUC__) ulong32 *S1, *S2, *S3, *S4; -#endif +#endif LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - + #if !defined(LTC_TWOFISH_SMALL) && !defined(__GNUC__) S1 = skey->twofish.S[0]; S2 = skey->twofish.S[1]; S3 = skey->twofish.S[2]; S4 = skey->twofish.S[3]; -#endif +#endif LOAD32L(a,&pt[0]); LOAD32L(b,&pt[4]); LOAD32L(c,&pt[8]); LOAD32L(d,&pt[12]); @@ -490,14 +490,14 @@ int twofish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_ke b ^= skey->twofish.K[1]; c ^= skey->twofish.K[2]; d ^= skey->twofish.K[3]; - + k = skey->twofish.K + 8; for (r = 8; r != 0; --r) { t2 = g1_func(b, skey); t1 = g_func(a, skey) + t2; c = RORc(c ^ (t1 + k[0]), 1); d = ROLc(d, 1) ^ (t2 + t1 + k[1]); - + t2 = g1_func(d, skey); t1 = g_func(c, skey) + t2; a = RORc(a ^ (t1 + k[2]), 1); @@ -531,7 +531,7 @@ int twofish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_ke Decrypts a block of text with Twofish @param ct The input ciphertext (16 bytes) @param pt The output plaintext (16 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ #ifdef LTC_CLEAN_STACK @@ -544,18 +544,18 @@ int twofish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_ke int r; #if !defined(LTC_TWOFISH_SMALL) && !defined(__GNUC__) ulong32 *S1, *S2, *S3, *S4; -#endif +#endif LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - + #if !defined(LTC_TWOFISH_SMALL) && !defined(__GNUC__) S1 = skey->twofish.S[0]; S2 = skey->twofish.S[1]; S3 = skey->twofish.S[2]; S4 = skey->twofish.S[3]; -#endif +#endif /* load input */ LOAD32L(ta,&ct[0]); LOAD32L(tb,&ct[4]); @@ -586,7 +586,7 @@ int twofish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_ke b ^= skey->twofish.K[1]; c ^= skey->twofish.K[2]; d ^= skey->twofish.K[3]; - + /* store */ STORE32L(a, &pt[0]); STORE32L(b, &pt[4]); STORE32L(c, &pt[8]); STORE32L(d, &pt[12]); @@ -610,8 +610,8 @@ int twofish_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else - static const struct { + #else + static const struct { int keylen; unsigned char key[32], pt[16], ct[16]; } tests[] = { @@ -631,7 +631,7 @@ int twofish_test(void) 0x85, 0xB6, 0xDC, 0x07, 0x3C, 0xA3, 0x41, 0xB2 }, { 0x18, 0x2B, 0x02, 0xD8, 0x14, 0x97, 0xEA, 0x45, 0xF9, 0xDA, 0xAC, 0xDC, 0x29, 0x19, 0x3A, 0x65 } - }, { + }, { 32, { 0xD4, 0x3B, 0xB7, 0x55, 0x6E, 0xA3, 0x2E, 0x46, 0xF2, 0xA2, 0x82, 0xB7, 0xD4, 0x5B, 0x4E, 0x0D, @@ -648,7 +648,7 @@ int twofish_test(void) symmetric_key key; unsigned char tmp[2][16]; int err, i, y; - + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { if ((err = twofish_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) { return err; @@ -666,12 +666,12 @@ int twofish_test(void) for (y = 0; y < 1000; y++) twofish_ecb_encrypt(tmp[0], tmp[0], &key); for (y = 0; y < 1000; y++) twofish_ecb_decrypt(tmp[0], tmp[0], &key); for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; - } + } return CRYPT_OK; -#endif +#endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void twofish_done(symmetric_key *skey) diff --git a/src/ciphers/twofish/twofish_tab.c b/src/ciphers/twofish/twofish_tab.c index ea3eb21b4..9f46006af 100644 --- a/src/ciphers/twofish/twofish_tab.c +++ b/src/ciphers/twofish/twofish_tab.c @@ -18,197 +18,197 @@ /* pre generated 8x8 tables from the four 4x4s */ static const unsigned char SBOX[2][256] = { { - 0xa9, 0x67, 0xb3, 0xe8, 0x04, 0xfd, 0xa3, 0x76, 0x9a, 0x92, - 0x80, 0x78, 0xe4, 0xdd, 0xd1, 0x38, 0x0d, 0xc6, 0x35, 0x98, - 0x18, 0xf7, 0xec, 0x6c, 0x43, 0x75, 0x37, 0x26, 0xfa, 0x13, - 0x94, 0x48, 0xf2, 0xd0, 0x8b, 0x30, 0x84, 0x54, 0xdf, 0x23, - 0x19, 0x5b, 0x3d, 0x59, 0xf3, 0xae, 0xa2, 0x82, 0x63, 0x01, - 0x83, 0x2e, 0xd9, 0x51, 0x9b, 0x7c, 0xa6, 0xeb, 0xa5, 0xbe, - 0x16, 0x0c, 0xe3, 0x61, 0xc0, 0x8c, 0x3a, 0xf5, 0x73, 0x2c, - 0x25, 0x0b, 0xbb, 0x4e, 0x89, 0x6b, 0x53, 0x6a, 0xb4, 0xf1, + 0xa9, 0x67, 0xb3, 0xe8, 0x04, 0xfd, 0xa3, 0x76, 0x9a, 0x92, + 0x80, 0x78, 0xe4, 0xdd, 0xd1, 0x38, 0x0d, 0xc6, 0x35, 0x98, + 0x18, 0xf7, 0xec, 0x6c, 0x43, 0x75, 0x37, 0x26, 0xfa, 0x13, + 0x94, 0x48, 0xf2, 0xd0, 0x8b, 0x30, 0x84, 0x54, 0xdf, 0x23, + 0x19, 0x5b, 0x3d, 0x59, 0xf3, 0xae, 0xa2, 0x82, 0x63, 0x01, + 0x83, 0x2e, 0xd9, 0x51, 0x9b, 0x7c, 0xa6, 0xeb, 0xa5, 0xbe, + 0x16, 0x0c, 0xe3, 0x61, 0xc0, 0x8c, 0x3a, 0xf5, 0x73, 0x2c, + 0x25, 0x0b, 0xbb, 0x4e, 0x89, 0x6b, 0x53, 0x6a, 0xb4, 0xf1, 0xe1, 0xe6, 0xbd, 0x45, 0xe2, 0xf4, 0xb6, 0x66, 0xc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 0xae, 0x5b, 0x8a, 0x00, 0xbc, 0x9d, - 0x6d, 0xc1, 0xb1, 0x0e, 0x80, 0x5d, 0xd2, 0xd5, 0xa0, 0x84, - 0x07, 0x14, 0xb5, 0x90, 0x2c, 0xa3, 0xb2, 0x73, 0x4c, 0x54, - 0x92, 0x74, 0x36, 0x51, 0x38, 0xb0, 0xbd, 0x5a, 0xfc, 0x60, - 0x62, 0x96, 0x6c, 0x42, 0xf7, 0x10, 0x7c, 0x28, 0x27, 0x8c, - 0x13, 0x95, 0x9c, 0xc7, 0x24, 0x46, 0x3b, 0x70, 0xca, 0xe3, + 0x6d, 0xc1, 0xb1, 0x0e, 0x80, 0x5d, 0xd2, 0xd5, 0xa0, 0x84, + 0x07, 0x14, 0xb5, 0x90, 0x2c, 0xa3, 0xb2, 0x73, 0x4c, 0x54, + 0x92, 0x74, 0x36, 0x51, 0x38, 0xb0, 0xbd, 0x5a, 0xfc, 0x60, + 0x62, 0x96, 0x6c, 0x42, 0xf7, 0x10, 0x7c, 0x28, 0x27, 0x8c, + 0x13, 0x95, 0x9c, 0xc7, 0x24, 0x46, 0x3b, 0x70, 0xca, 0xe3, 0x85, 0xcb, 0x11, 0xd0, 0x93, 0xb8, 0xa6, 0x83, 0x20, 0xff, - 0x9f, 0x77, 0xc3, 0xcc, 0x03, 0x6f, 0x08, 0xbf, 0x40, 0xe7, - 0x2b, 0xe2, 0x79, 0x0c, 0xaa, 0x82, 0x41, 0x3a, 0xea, 0xb9, - 0xe4, 0x9a, 0xa4, 0x97, 0x7e, 0xda, 0x7a, 0x17, 0x66, 0x94, - 0xa1, 0x1d, 0x3d, 0xf0, 0xde, 0xb3, 0x0b, 0x72, 0xa7, 0x1c, - 0xef, 0xd1, 0x53, 0x3e, 0x8f, 0x33, 0x26, 0x5f, 0xec, 0x76, - 0x2a, 0x49, 0x81, 0x88, 0xee, 0x21, 0xc4, 0x1a, 0xeb, 0xd9, - 0xc5, 0x39, 0x99, 0xcd, 0xad, 0x31, 0x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, 0x3c, 0xa5, + 0xce, 0xe9, 0x68, 0x44, 0xe0, 0x4d, 0x43, 0x69, 0x29, 0x2e, + 0xac, 0x15, 0x59, 0xa8, 0x0a, 0x9e, 0x6e, 0x47, 0xdf, 0x34, + 0x35, 0x6a, 0xcf, 0xdc, 0x22, 0xc9, 0xc0, 0x9b, 0x89, 0xd4, + 0xed, 0xab, 0x12, 0xa2, 0x0d, 0x52, 0xbb, 0x02, 0x2f, 0xa9, + 0xd7, 0x61, 0x1e, 0xb4, 0x50, 0x04, 0xf6, 0xc2, 0x16, 0x25, 0x86, 0x56, 0x55, 0x09, 0xbe, 0x91} }; /* the 4x4 MDS in a nicer format */ static const ulong32 mds_tab[4][256] = { { -0x00000000UL, 0xefef5b01UL, 0xb7b7b602UL, 0x5858ed03UL, 0x07070504UL, 0xe8e85e05UL, 0xb0b0b306UL, 0x5f5fe807UL, -0x0e0e0a08UL, 0xe1e15109UL, 0xb9b9bc0aUL, 0x5656e70bUL, 0x09090f0cUL, 0xe6e6540dUL, 0xbebeb90eUL, 0x5151e20fUL, -0x1c1c1410UL, 0xf3f34f11UL, 0xababa212UL, 0x4444f913UL, 0x1b1b1114UL, 0xf4f44a15UL, 0xacaca716UL, 0x4343fc17UL, -0x12121e18UL, 0xfdfd4519UL, 0xa5a5a81aUL, 0x4a4af31bUL, 0x15151b1cUL, 0xfafa401dUL, 0xa2a2ad1eUL, 0x4d4df61fUL, -0x38382820UL, 0xd7d77321UL, 0x8f8f9e22UL, 0x6060c523UL, 0x3f3f2d24UL, 0xd0d07625UL, 0x88889b26UL, 0x6767c027UL, -0x36362228UL, 0xd9d97929UL, 0x8181942aUL, 0x6e6ecf2bUL, 0x3131272cUL, 0xdede7c2dUL, 0x8686912eUL, 0x6969ca2fUL, -0x24243c30UL, 0xcbcb6731UL, 0x93938a32UL, 0x7c7cd133UL, 0x23233934UL, 0xcccc6235UL, 0x94948f36UL, 0x7b7bd437UL, -0x2a2a3638UL, 0xc5c56d39UL, 0x9d9d803aUL, 0x7272db3bUL, 0x2d2d333cUL, 0xc2c2683dUL, 0x9a9a853eUL, 0x7575de3fUL, +0x00000000UL, 0xefef5b01UL, 0xb7b7b602UL, 0x5858ed03UL, 0x07070504UL, 0xe8e85e05UL, 0xb0b0b306UL, 0x5f5fe807UL, +0x0e0e0a08UL, 0xe1e15109UL, 0xb9b9bc0aUL, 0x5656e70bUL, 0x09090f0cUL, 0xe6e6540dUL, 0xbebeb90eUL, 0x5151e20fUL, +0x1c1c1410UL, 0xf3f34f11UL, 0xababa212UL, 0x4444f913UL, 0x1b1b1114UL, 0xf4f44a15UL, 0xacaca716UL, 0x4343fc17UL, +0x12121e18UL, 0xfdfd4519UL, 0xa5a5a81aUL, 0x4a4af31bUL, 0x15151b1cUL, 0xfafa401dUL, 0xa2a2ad1eUL, 0x4d4df61fUL, +0x38382820UL, 0xd7d77321UL, 0x8f8f9e22UL, 0x6060c523UL, 0x3f3f2d24UL, 0xd0d07625UL, 0x88889b26UL, 0x6767c027UL, +0x36362228UL, 0xd9d97929UL, 0x8181942aUL, 0x6e6ecf2bUL, 0x3131272cUL, 0xdede7c2dUL, 0x8686912eUL, 0x6969ca2fUL, +0x24243c30UL, 0xcbcb6731UL, 0x93938a32UL, 0x7c7cd133UL, 0x23233934UL, 0xcccc6235UL, 0x94948f36UL, 0x7b7bd437UL, +0x2a2a3638UL, 0xc5c56d39UL, 0x9d9d803aUL, 0x7272db3bUL, 0x2d2d333cUL, 0xc2c2683dUL, 0x9a9a853eUL, 0x7575de3fUL, 0x70705040UL, 0x9f9f0b41UL, 0xc7c7e642UL, 0x2828bd43UL, 0x77775544UL, 0x98980e45UL, 0xc0c0e346UL, 0x2f2fb847UL, -0x7e7e5a48UL, 0x91910149UL, 0xc9c9ec4aUL, 0x2626b74bUL, 0x79795f4cUL, 0x9696044dUL, 0xcecee94eUL, 0x2121b24fUL, -0x6c6c4450UL, 0x83831f51UL, 0xdbdbf252UL, 0x3434a953UL, 0x6b6b4154UL, 0x84841a55UL, 0xdcdcf756UL, 0x3333ac57UL, -0x62624e58UL, 0x8d8d1559UL, 0xd5d5f85aUL, 0x3a3aa35bUL, 0x65654b5cUL, 0x8a8a105dUL, 0xd2d2fd5eUL, 0x3d3da65fUL, -0x48487860UL, 0xa7a72361UL, 0xffffce62UL, 0x10109563UL, 0x4f4f7d64UL, 0xa0a02665UL, 0xf8f8cb66UL, 0x17179067UL, +0x7e7e5a48UL, 0x91910149UL, 0xc9c9ec4aUL, 0x2626b74bUL, 0x79795f4cUL, 0x9696044dUL, 0xcecee94eUL, 0x2121b24fUL, +0x6c6c4450UL, 0x83831f51UL, 0xdbdbf252UL, 0x3434a953UL, 0x6b6b4154UL, 0x84841a55UL, 0xdcdcf756UL, 0x3333ac57UL, +0x62624e58UL, 0x8d8d1559UL, 0xd5d5f85aUL, 0x3a3aa35bUL, 0x65654b5cUL, 0x8a8a105dUL, 0xd2d2fd5eUL, 0x3d3da65fUL, +0x48487860UL, 0xa7a72361UL, 0xffffce62UL, 0x10109563UL, 0x4f4f7d64UL, 0xa0a02665UL, 0xf8f8cb66UL, 0x17179067UL, 0x46467268UL, 0xa9a92969UL, 0xf1f1c46aUL, 0x1e1e9f6bUL, 0x4141776cUL, 0xaeae2c6dUL, 0xf6f6c16eUL, 0x19199a6fUL, -0x54546c70UL, 0xbbbb3771UL, 0xe3e3da72UL, 0x0c0c8173UL, 0x53536974UL, 0xbcbc3275UL, 0xe4e4df76UL, 0x0b0b8477UL, -0x5a5a6678UL, 0xb5b53d79UL, 0xededd07aUL, 0x02028b7bUL, 0x5d5d637cUL, 0xb2b2387dUL, 0xeaead57eUL, 0x05058e7fUL, -0xe0e0a080UL, 0x0f0ffb81UL, 0x57571682UL, 0xb8b84d83UL, 0xe7e7a584UL, 0x0808fe85UL, 0x50501386UL, 0xbfbf4887UL, -0xeeeeaa88UL, 0x0101f189UL, 0x59591c8aUL, 0xb6b6478bUL, 0xe9e9af8cUL, 0x0606f48dUL, 0x5e5e198eUL, 0xb1b1428fUL, -0xfcfcb490UL, 0x1313ef91UL, 0x4b4b0292UL, 0xa4a45993UL, 0xfbfbb194UL, 0x1414ea95UL, 0x4c4c0796UL, 0xa3a35c97UL, -0xf2f2be98UL, 0x1d1de599UL, 0x4545089aUL, 0xaaaa539bUL, 0xf5f5bb9cUL, 0x1a1ae09dUL, 0x42420d9eUL, 0xadad569fUL, -0xd8d888a0UL, 0x3737d3a1UL, 0x6f6f3ea2UL, 0x808065a3UL, 0xdfdf8da4UL, 0x3030d6a5UL, 0x68683ba6UL, 0x878760a7UL, -0xd6d682a8UL, 0x3939d9a9UL, 0x616134aaUL, 0x8e8e6fabUL, 0xd1d187acUL, 0x3e3edcadUL, 0x666631aeUL, 0x89896aafUL, -0xc4c49cb0UL, 0x2b2bc7b1UL, 0x73732ab2UL, 0x9c9c71b3UL, 0xc3c399b4UL, 0x2c2cc2b5UL, 0x74742fb6UL, 0x9b9b74b7UL, -0xcaca96b8UL, 0x2525cdb9UL, 0x7d7d20baUL, 0x92927bbbUL, 0xcdcd93bcUL, 0x2222c8bdUL, 0x7a7a25beUL, 0x95957ebfUL, -0x9090f0c0UL, 0x7f7fabc1UL, 0x272746c2UL, 0xc8c81dc3UL, 0x9797f5c4UL, 0x7878aec5UL, 0x202043c6UL, 0xcfcf18c7UL, -0x9e9efac8UL, 0x7171a1c9UL, 0x29294ccaUL, 0xc6c617cbUL, 0x9999ffccUL, 0x7676a4cdUL, 0x2e2e49ceUL, 0xc1c112cfUL, -0x8c8ce4d0UL, 0x6363bfd1UL, 0x3b3b52d2UL, 0xd4d409d3UL, 0x8b8be1d4UL, 0x6464bad5UL, 0x3c3c57d6UL, 0xd3d30cd7UL, -0x8282eed8UL, 0x6d6db5d9UL, 0x353558daUL, 0xdada03dbUL, 0x8585ebdcUL, 0x6a6ab0ddUL, 0x32325ddeUL, 0xdddd06dfUL, +0x54546c70UL, 0xbbbb3771UL, 0xe3e3da72UL, 0x0c0c8173UL, 0x53536974UL, 0xbcbc3275UL, 0xe4e4df76UL, 0x0b0b8477UL, +0x5a5a6678UL, 0xb5b53d79UL, 0xededd07aUL, 0x02028b7bUL, 0x5d5d637cUL, 0xb2b2387dUL, 0xeaead57eUL, 0x05058e7fUL, +0xe0e0a080UL, 0x0f0ffb81UL, 0x57571682UL, 0xb8b84d83UL, 0xe7e7a584UL, 0x0808fe85UL, 0x50501386UL, 0xbfbf4887UL, +0xeeeeaa88UL, 0x0101f189UL, 0x59591c8aUL, 0xb6b6478bUL, 0xe9e9af8cUL, 0x0606f48dUL, 0x5e5e198eUL, 0xb1b1428fUL, +0xfcfcb490UL, 0x1313ef91UL, 0x4b4b0292UL, 0xa4a45993UL, 0xfbfbb194UL, 0x1414ea95UL, 0x4c4c0796UL, 0xa3a35c97UL, +0xf2f2be98UL, 0x1d1de599UL, 0x4545089aUL, 0xaaaa539bUL, 0xf5f5bb9cUL, 0x1a1ae09dUL, 0x42420d9eUL, 0xadad569fUL, +0xd8d888a0UL, 0x3737d3a1UL, 0x6f6f3ea2UL, 0x808065a3UL, 0xdfdf8da4UL, 0x3030d6a5UL, 0x68683ba6UL, 0x878760a7UL, +0xd6d682a8UL, 0x3939d9a9UL, 0x616134aaUL, 0x8e8e6fabUL, 0xd1d187acUL, 0x3e3edcadUL, 0x666631aeUL, 0x89896aafUL, +0xc4c49cb0UL, 0x2b2bc7b1UL, 0x73732ab2UL, 0x9c9c71b3UL, 0xc3c399b4UL, 0x2c2cc2b5UL, 0x74742fb6UL, 0x9b9b74b7UL, +0xcaca96b8UL, 0x2525cdb9UL, 0x7d7d20baUL, 0x92927bbbUL, 0xcdcd93bcUL, 0x2222c8bdUL, 0x7a7a25beUL, 0x95957ebfUL, +0x9090f0c0UL, 0x7f7fabc1UL, 0x272746c2UL, 0xc8c81dc3UL, 0x9797f5c4UL, 0x7878aec5UL, 0x202043c6UL, 0xcfcf18c7UL, +0x9e9efac8UL, 0x7171a1c9UL, 0x29294ccaUL, 0xc6c617cbUL, 0x9999ffccUL, 0x7676a4cdUL, 0x2e2e49ceUL, 0xc1c112cfUL, +0x8c8ce4d0UL, 0x6363bfd1UL, 0x3b3b52d2UL, 0xd4d409d3UL, 0x8b8be1d4UL, 0x6464bad5UL, 0x3c3c57d6UL, 0xd3d30cd7UL, +0x8282eed8UL, 0x6d6db5d9UL, 0x353558daUL, 0xdada03dbUL, 0x8585ebdcUL, 0x6a6ab0ddUL, 0x32325ddeUL, 0xdddd06dfUL, 0xa8a8d8e0UL, 0x474783e1UL, 0x1f1f6ee2UL, 0xf0f035e3UL, 0xafafdde4UL, 0x404086e5UL, 0x18186be6UL, 0xf7f730e7UL, 0xa6a6d2e8UL, 0x494989e9UL, 0x111164eaUL, 0xfefe3febUL, 0xa1a1d7ecUL, 0x4e4e8cedUL, 0x161661eeUL, 0xf9f93aefUL, -0xb4b4ccf0UL, 0x5b5b97f1UL, 0x03037af2UL, 0xecec21f3UL, 0xb3b3c9f4UL, 0x5c5c92f5UL, 0x04047ff6UL, 0xebeb24f7UL, +0xb4b4ccf0UL, 0x5b5b97f1UL, 0x03037af2UL, 0xecec21f3UL, 0xb3b3c9f4UL, 0x5c5c92f5UL, 0x04047ff6UL, 0xebeb24f7UL, 0xbabac6f8UL, 0x55559df9UL, 0x0d0d70faUL, 0xe2e22bfbUL, 0xbdbdc3fcUL, 0x525298fdUL, 0x0a0a75feUL, 0xe5e52effUL -}, +}, { -0x00000000UL, 0x015befefUL, 0x02b6b7b7UL, 0x03ed5858UL, 0x04050707UL, 0x055ee8e8UL, 0x06b3b0b0UL, 0x07e85f5fUL, -0x080a0e0eUL, 0x0951e1e1UL, 0x0abcb9b9UL, 0x0be75656UL, 0x0c0f0909UL, 0x0d54e6e6UL, 0x0eb9bebeUL, 0x0fe25151UL, -0x10141c1cUL, 0x114ff3f3UL, 0x12a2ababUL, 0x13f94444UL, 0x14111b1bUL, 0x154af4f4UL, 0x16a7acacUL, 0x17fc4343UL, -0x181e1212UL, 0x1945fdfdUL, 0x1aa8a5a5UL, 0x1bf34a4aUL, 0x1c1b1515UL, 0x1d40fafaUL, 0x1eada2a2UL, 0x1ff64d4dUL, -0x20283838UL, 0x2173d7d7UL, 0x229e8f8fUL, 0x23c56060UL, 0x242d3f3fUL, 0x2576d0d0UL, 0x269b8888UL, 0x27c06767UL, -0x28223636UL, 0x2979d9d9UL, 0x2a948181UL, 0x2bcf6e6eUL, 0x2c273131UL, 0x2d7cdedeUL, 0x2e918686UL, 0x2fca6969UL, -0x303c2424UL, 0x3167cbcbUL, 0x328a9393UL, 0x33d17c7cUL, 0x34392323UL, 0x3562ccccUL, 0x368f9494UL, 0x37d47b7bUL, -0x38362a2aUL, 0x396dc5c5UL, 0x3a809d9dUL, 0x3bdb7272UL, 0x3c332d2dUL, 0x3d68c2c2UL, 0x3e859a9aUL, 0x3fde7575UL, -0x40507070UL, 0x410b9f9fUL, 0x42e6c7c7UL, 0x43bd2828UL, 0x44557777UL, 0x450e9898UL, 0x46e3c0c0UL, 0x47b82f2fUL, -0x485a7e7eUL, 0x49019191UL, 0x4aecc9c9UL, 0x4bb72626UL, 0x4c5f7979UL, 0x4d049696UL, 0x4ee9ceceUL, 0x4fb22121UL, -0x50446c6cUL, 0x511f8383UL, 0x52f2dbdbUL, 0x53a93434UL, 0x54416b6bUL, 0x551a8484UL, 0x56f7dcdcUL, 0x57ac3333UL, +0x00000000UL, 0x015befefUL, 0x02b6b7b7UL, 0x03ed5858UL, 0x04050707UL, 0x055ee8e8UL, 0x06b3b0b0UL, 0x07e85f5fUL, +0x080a0e0eUL, 0x0951e1e1UL, 0x0abcb9b9UL, 0x0be75656UL, 0x0c0f0909UL, 0x0d54e6e6UL, 0x0eb9bebeUL, 0x0fe25151UL, +0x10141c1cUL, 0x114ff3f3UL, 0x12a2ababUL, 0x13f94444UL, 0x14111b1bUL, 0x154af4f4UL, 0x16a7acacUL, 0x17fc4343UL, +0x181e1212UL, 0x1945fdfdUL, 0x1aa8a5a5UL, 0x1bf34a4aUL, 0x1c1b1515UL, 0x1d40fafaUL, 0x1eada2a2UL, 0x1ff64d4dUL, +0x20283838UL, 0x2173d7d7UL, 0x229e8f8fUL, 0x23c56060UL, 0x242d3f3fUL, 0x2576d0d0UL, 0x269b8888UL, 0x27c06767UL, +0x28223636UL, 0x2979d9d9UL, 0x2a948181UL, 0x2bcf6e6eUL, 0x2c273131UL, 0x2d7cdedeUL, 0x2e918686UL, 0x2fca6969UL, +0x303c2424UL, 0x3167cbcbUL, 0x328a9393UL, 0x33d17c7cUL, 0x34392323UL, 0x3562ccccUL, 0x368f9494UL, 0x37d47b7bUL, +0x38362a2aUL, 0x396dc5c5UL, 0x3a809d9dUL, 0x3bdb7272UL, 0x3c332d2dUL, 0x3d68c2c2UL, 0x3e859a9aUL, 0x3fde7575UL, +0x40507070UL, 0x410b9f9fUL, 0x42e6c7c7UL, 0x43bd2828UL, 0x44557777UL, 0x450e9898UL, 0x46e3c0c0UL, 0x47b82f2fUL, +0x485a7e7eUL, 0x49019191UL, 0x4aecc9c9UL, 0x4bb72626UL, 0x4c5f7979UL, 0x4d049696UL, 0x4ee9ceceUL, 0x4fb22121UL, +0x50446c6cUL, 0x511f8383UL, 0x52f2dbdbUL, 0x53a93434UL, 0x54416b6bUL, 0x551a8484UL, 0x56f7dcdcUL, 0x57ac3333UL, 0x584e6262UL, 0x59158d8dUL, 0x5af8d5d5UL, 0x5ba33a3aUL, 0x5c4b6565UL, 0x5d108a8aUL, 0x5efdd2d2UL, 0x5fa63d3dUL, -0x60784848UL, 0x6123a7a7UL, 0x62ceffffUL, 0x63951010UL, 0x647d4f4fUL, 0x6526a0a0UL, 0x66cbf8f8UL, 0x67901717UL, -0x68724646UL, 0x6929a9a9UL, 0x6ac4f1f1UL, 0x6b9f1e1eUL, 0x6c774141UL, 0x6d2caeaeUL, 0x6ec1f6f6UL, 0x6f9a1919UL, -0x706c5454UL, 0x7137bbbbUL, 0x72dae3e3UL, 0x73810c0cUL, 0x74695353UL, 0x7532bcbcUL, 0x76dfe4e4UL, 0x77840b0bUL, -0x78665a5aUL, 0x793db5b5UL, 0x7ad0ededUL, 0x7b8b0202UL, 0x7c635d5dUL, 0x7d38b2b2UL, 0x7ed5eaeaUL, 0x7f8e0505UL, -0x80a0e0e0UL, 0x81fb0f0fUL, 0x82165757UL, 0x834db8b8UL, 0x84a5e7e7UL, 0x85fe0808UL, 0x86135050UL, 0x8748bfbfUL, -0x88aaeeeeUL, 0x89f10101UL, 0x8a1c5959UL, 0x8b47b6b6UL, 0x8cafe9e9UL, 0x8df40606UL, 0x8e195e5eUL, 0x8f42b1b1UL, -0x90b4fcfcUL, 0x91ef1313UL, 0x92024b4bUL, 0x9359a4a4UL, 0x94b1fbfbUL, 0x95ea1414UL, 0x96074c4cUL, 0x975ca3a3UL, +0x60784848UL, 0x6123a7a7UL, 0x62ceffffUL, 0x63951010UL, 0x647d4f4fUL, 0x6526a0a0UL, 0x66cbf8f8UL, 0x67901717UL, +0x68724646UL, 0x6929a9a9UL, 0x6ac4f1f1UL, 0x6b9f1e1eUL, 0x6c774141UL, 0x6d2caeaeUL, 0x6ec1f6f6UL, 0x6f9a1919UL, +0x706c5454UL, 0x7137bbbbUL, 0x72dae3e3UL, 0x73810c0cUL, 0x74695353UL, 0x7532bcbcUL, 0x76dfe4e4UL, 0x77840b0bUL, +0x78665a5aUL, 0x793db5b5UL, 0x7ad0ededUL, 0x7b8b0202UL, 0x7c635d5dUL, 0x7d38b2b2UL, 0x7ed5eaeaUL, 0x7f8e0505UL, +0x80a0e0e0UL, 0x81fb0f0fUL, 0x82165757UL, 0x834db8b8UL, 0x84a5e7e7UL, 0x85fe0808UL, 0x86135050UL, 0x8748bfbfUL, +0x88aaeeeeUL, 0x89f10101UL, 0x8a1c5959UL, 0x8b47b6b6UL, 0x8cafe9e9UL, 0x8df40606UL, 0x8e195e5eUL, 0x8f42b1b1UL, +0x90b4fcfcUL, 0x91ef1313UL, 0x92024b4bUL, 0x9359a4a4UL, 0x94b1fbfbUL, 0x95ea1414UL, 0x96074c4cUL, 0x975ca3a3UL, 0x98bef2f2UL, 0x99e51d1dUL, 0x9a084545UL, 0x9b53aaaaUL, 0x9cbbf5f5UL, 0x9de01a1aUL, 0x9e0d4242UL, 0x9f56adadUL, -0xa088d8d8UL, 0xa1d33737UL, 0xa23e6f6fUL, 0xa3658080UL, 0xa48ddfdfUL, 0xa5d63030UL, 0xa63b6868UL, 0xa7608787UL, -0xa882d6d6UL, 0xa9d93939UL, 0xaa346161UL, 0xab6f8e8eUL, 0xac87d1d1UL, 0xaddc3e3eUL, 0xae316666UL, 0xaf6a8989UL, -0xb09cc4c4UL, 0xb1c72b2bUL, 0xb22a7373UL, 0xb3719c9cUL, 0xb499c3c3UL, 0xb5c22c2cUL, 0xb62f7474UL, 0xb7749b9bUL, -0xb896cacaUL, 0xb9cd2525UL, 0xba207d7dUL, 0xbb7b9292UL, 0xbc93cdcdUL, 0xbdc82222UL, 0xbe257a7aUL, 0xbf7e9595UL, -0xc0f09090UL, 0xc1ab7f7fUL, 0xc2462727UL, 0xc31dc8c8UL, 0xc4f59797UL, 0xc5ae7878UL, 0xc6432020UL, 0xc718cfcfUL, -0xc8fa9e9eUL, 0xc9a17171UL, 0xca4c2929UL, 0xcb17c6c6UL, 0xccff9999UL, 0xcda47676UL, 0xce492e2eUL, 0xcf12c1c1UL, -0xd0e48c8cUL, 0xd1bf6363UL, 0xd2523b3bUL, 0xd309d4d4UL, 0xd4e18b8bUL, 0xd5ba6464UL, 0xd6573c3cUL, 0xd70cd3d3UL, -0xd8ee8282UL, 0xd9b56d6dUL, 0xda583535UL, 0xdb03dadaUL, 0xdceb8585UL, 0xddb06a6aUL, 0xde5d3232UL, 0xdf06ddddUL, -0xe0d8a8a8UL, 0xe1834747UL, 0xe26e1f1fUL, 0xe335f0f0UL, 0xe4ddafafUL, 0xe5864040UL, 0xe66b1818UL, 0xe730f7f7UL, -0xe8d2a6a6UL, 0xe9894949UL, 0xea641111UL, 0xeb3ffefeUL, 0xecd7a1a1UL, 0xed8c4e4eUL, 0xee611616UL, 0xef3af9f9UL, -0xf0ccb4b4UL, 0xf1975b5bUL, 0xf27a0303UL, 0xf321ececUL, 0xf4c9b3b3UL, 0xf5925c5cUL, 0xf67f0404UL, 0xf724ebebUL, +0xa088d8d8UL, 0xa1d33737UL, 0xa23e6f6fUL, 0xa3658080UL, 0xa48ddfdfUL, 0xa5d63030UL, 0xa63b6868UL, 0xa7608787UL, +0xa882d6d6UL, 0xa9d93939UL, 0xaa346161UL, 0xab6f8e8eUL, 0xac87d1d1UL, 0xaddc3e3eUL, 0xae316666UL, 0xaf6a8989UL, +0xb09cc4c4UL, 0xb1c72b2bUL, 0xb22a7373UL, 0xb3719c9cUL, 0xb499c3c3UL, 0xb5c22c2cUL, 0xb62f7474UL, 0xb7749b9bUL, +0xb896cacaUL, 0xb9cd2525UL, 0xba207d7dUL, 0xbb7b9292UL, 0xbc93cdcdUL, 0xbdc82222UL, 0xbe257a7aUL, 0xbf7e9595UL, +0xc0f09090UL, 0xc1ab7f7fUL, 0xc2462727UL, 0xc31dc8c8UL, 0xc4f59797UL, 0xc5ae7878UL, 0xc6432020UL, 0xc718cfcfUL, +0xc8fa9e9eUL, 0xc9a17171UL, 0xca4c2929UL, 0xcb17c6c6UL, 0xccff9999UL, 0xcda47676UL, 0xce492e2eUL, 0xcf12c1c1UL, +0xd0e48c8cUL, 0xd1bf6363UL, 0xd2523b3bUL, 0xd309d4d4UL, 0xd4e18b8bUL, 0xd5ba6464UL, 0xd6573c3cUL, 0xd70cd3d3UL, +0xd8ee8282UL, 0xd9b56d6dUL, 0xda583535UL, 0xdb03dadaUL, 0xdceb8585UL, 0xddb06a6aUL, 0xde5d3232UL, 0xdf06ddddUL, +0xe0d8a8a8UL, 0xe1834747UL, 0xe26e1f1fUL, 0xe335f0f0UL, 0xe4ddafafUL, 0xe5864040UL, 0xe66b1818UL, 0xe730f7f7UL, +0xe8d2a6a6UL, 0xe9894949UL, 0xea641111UL, 0xeb3ffefeUL, 0xecd7a1a1UL, 0xed8c4e4eUL, 0xee611616UL, 0xef3af9f9UL, +0xf0ccb4b4UL, 0xf1975b5bUL, 0xf27a0303UL, 0xf321ececUL, 0xf4c9b3b3UL, 0xf5925c5cUL, 0xf67f0404UL, 0xf724ebebUL, 0xf8c6babaUL, 0xf99d5555UL, 0xfa700d0dUL, 0xfb2be2e2UL, 0xfcc3bdbdUL, 0xfd985252UL, 0xfe750a0aUL, 0xff2ee5e5UL -}, +}, { -0x00000000UL, 0xef01ef5bUL, 0xb702b7b6UL, 0x580358edUL, 0x07040705UL, 0xe805e85eUL, 0xb006b0b3UL, 0x5f075fe8UL, +0x00000000UL, 0xef01ef5bUL, 0xb702b7b6UL, 0x580358edUL, 0x07040705UL, 0xe805e85eUL, 0xb006b0b3UL, 0x5f075fe8UL, 0x0e080e0aUL, 0xe109e151UL, 0xb90ab9bcUL, 0x560b56e7UL, 0x090c090fUL, 0xe60de654UL, 0xbe0ebeb9UL, 0x510f51e2UL, -0x1c101c14UL, 0xf311f34fUL, 0xab12aba2UL, 0x441344f9UL, 0x1b141b11UL, 0xf415f44aUL, 0xac16aca7UL, 0x431743fcUL, -0x1218121eUL, 0xfd19fd45UL, 0xa51aa5a8UL, 0x4a1b4af3UL, 0x151c151bUL, 0xfa1dfa40UL, 0xa21ea2adUL, 0x4d1f4df6UL, -0x38203828UL, 0xd721d773UL, 0x8f228f9eUL, 0x602360c5UL, 0x3f243f2dUL, 0xd025d076UL, 0x8826889bUL, 0x672767c0UL, -0x36283622UL, 0xd929d979UL, 0x812a8194UL, 0x6e2b6ecfUL, 0x312c3127UL, 0xde2dde7cUL, 0x862e8691UL, 0x692f69caUL, -0x2430243cUL, 0xcb31cb67UL, 0x9332938aUL, 0x7c337cd1UL, 0x23342339UL, 0xcc35cc62UL, 0x9436948fUL, 0x7b377bd4UL, +0x1c101c14UL, 0xf311f34fUL, 0xab12aba2UL, 0x441344f9UL, 0x1b141b11UL, 0xf415f44aUL, 0xac16aca7UL, 0x431743fcUL, +0x1218121eUL, 0xfd19fd45UL, 0xa51aa5a8UL, 0x4a1b4af3UL, 0x151c151bUL, 0xfa1dfa40UL, 0xa21ea2adUL, 0x4d1f4df6UL, +0x38203828UL, 0xd721d773UL, 0x8f228f9eUL, 0x602360c5UL, 0x3f243f2dUL, 0xd025d076UL, 0x8826889bUL, 0x672767c0UL, +0x36283622UL, 0xd929d979UL, 0x812a8194UL, 0x6e2b6ecfUL, 0x312c3127UL, 0xde2dde7cUL, 0x862e8691UL, 0x692f69caUL, +0x2430243cUL, 0xcb31cb67UL, 0x9332938aUL, 0x7c337cd1UL, 0x23342339UL, 0xcc35cc62UL, 0x9436948fUL, 0x7b377bd4UL, 0x2a382a36UL, 0xc539c56dUL, 0x9d3a9d80UL, 0x723b72dbUL, 0x2d3c2d33UL, 0xc23dc268UL, 0x9a3e9a85UL, 0x753f75deUL, -0x70407050UL, 0x9f419f0bUL, 0xc742c7e6UL, 0x284328bdUL, 0x77447755UL, 0x9845980eUL, 0xc046c0e3UL, 0x2f472fb8UL, -0x7e487e5aUL, 0x91499101UL, 0xc94ac9ecUL, 0x264b26b7UL, 0x794c795fUL, 0x964d9604UL, 0xce4ecee9UL, 0x214f21b2UL, +0x70407050UL, 0x9f419f0bUL, 0xc742c7e6UL, 0x284328bdUL, 0x77447755UL, 0x9845980eUL, 0xc046c0e3UL, 0x2f472fb8UL, +0x7e487e5aUL, 0x91499101UL, 0xc94ac9ecUL, 0x264b26b7UL, 0x794c795fUL, 0x964d9604UL, 0xce4ecee9UL, 0x214f21b2UL, 0x6c506c44UL, 0x8351831fUL, 0xdb52dbf2UL, 0x345334a9UL, 0x6b546b41UL, 0x8455841aUL, 0xdc56dcf7UL, 0x335733acUL, -0x6258624eUL, 0x8d598d15UL, 0xd55ad5f8UL, 0x3a5b3aa3UL, 0x655c654bUL, 0x8a5d8a10UL, 0xd25ed2fdUL, 0x3d5f3da6UL, -0x48604878UL, 0xa761a723UL, 0xff62ffceUL, 0x10631095UL, 0x4f644f7dUL, 0xa065a026UL, 0xf866f8cbUL, 0x17671790UL, -0x46684672UL, 0xa969a929UL, 0xf16af1c4UL, 0x1e6b1e9fUL, 0x416c4177UL, 0xae6dae2cUL, 0xf66ef6c1UL, 0x196f199aUL, +0x6258624eUL, 0x8d598d15UL, 0xd55ad5f8UL, 0x3a5b3aa3UL, 0x655c654bUL, 0x8a5d8a10UL, 0xd25ed2fdUL, 0x3d5f3da6UL, +0x48604878UL, 0xa761a723UL, 0xff62ffceUL, 0x10631095UL, 0x4f644f7dUL, 0xa065a026UL, 0xf866f8cbUL, 0x17671790UL, +0x46684672UL, 0xa969a929UL, 0xf16af1c4UL, 0x1e6b1e9fUL, 0x416c4177UL, 0xae6dae2cUL, 0xf66ef6c1UL, 0x196f199aUL, 0x5470546cUL, 0xbb71bb37UL, 0xe372e3daUL, 0x0c730c81UL, 0x53745369UL, 0xbc75bc32UL, 0xe476e4dfUL, 0x0b770b84UL, -0x5a785a66UL, 0xb579b53dUL, 0xed7aedd0UL, 0x027b028bUL, 0x5d7c5d63UL, 0xb27db238UL, 0xea7eead5UL, 0x057f058eUL, +0x5a785a66UL, 0xb579b53dUL, 0xed7aedd0UL, 0x027b028bUL, 0x5d7c5d63UL, 0xb27db238UL, 0xea7eead5UL, 0x057f058eUL, 0xe080e0a0UL, 0x0f810ffbUL, 0x57825716UL, 0xb883b84dUL, 0xe784e7a5UL, 0x088508feUL, 0x50865013UL, 0xbf87bf48UL, 0xee88eeaaUL, 0x018901f1UL, 0x598a591cUL, 0xb68bb647UL, 0xe98ce9afUL, 0x068d06f4UL, 0x5e8e5e19UL, 0xb18fb142UL, -0xfc90fcb4UL, 0x139113efUL, 0x4b924b02UL, 0xa493a459UL, 0xfb94fbb1UL, 0x149514eaUL, 0x4c964c07UL, 0xa397a35cUL, -0xf298f2beUL, 0x1d991de5UL, 0x459a4508UL, 0xaa9baa53UL, 0xf59cf5bbUL, 0x1a9d1ae0UL, 0x429e420dUL, 0xad9fad56UL, -0xd8a0d888UL, 0x37a137d3UL, 0x6fa26f3eUL, 0x80a38065UL, 0xdfa4df8dUL, 0x30a530d6UL, 0x68a6683bUL, 0x87a78760UL, -0xd6a8d682UL, 0x39a939d9UL, 0x61aa6134UL, 0x8eab8e6fUL, 0xd1acd187UL, 0x3ead3edcUL, 0x66ae6631UL, 0x89af896aUL, -0xc4b0c49cUL, 0x2bb12bc7UL, 0x73b2732aUL, 0x9cb39c71UL, 0xc3b4c399UL, 0x2cb52cc2UL, 0x74b6742fUL, 0x9bb79b74UL, -0xcab8ca96UL, 0x25b925cdUL, 0x7dba7d20UL, 0x92bb927bUL, 0xcdbccd93UL, 0x22bd22c8UL, 0x7abe7a25UL, 0x95bf957eUL, -0x90c090f0UL, 0x7fc17fabUL, 0x27c22746UL, 0xc8c3c81dUL, 0x97c497f5UL, 0x78c578aeUL, 0x20c62043UL, 0xcfc7cf18UL, -0x9ec89efaUL, 0x71c971a1UL, 0x29ca294cUL, 0xc6cbc617UL, 0x99cc99ffUL, 0x76cd76a4UL, 0x2ece2e49UL, 0xc1cfc112UL, -0x8cd08ce4UL, 0x63d163bfUL, 0x3bd23b52UL, 0xd4d3d409UL, 0x8bd48be1UL, 0x64d564baUL, 0x3cd63c57UL, 0xd3d7d30cUL, -0x82d882eeUL, 0x6dd96db5UL, 0x35da3558UL, 0xdadbda03UL, 0x85dc85ebUL, 0x6add6ab0UL, 0x32de325dUL, 0xdddfdd06UL, -0xa8e0a8d8UL, 0x47e14783UL, 0x1fe21f6eUL, 0xf0e3f035UL, 0xafe4afddUL, 0x40e54086UL, 0x18e6186bUL, 0xf7e7f730UL, -0xa6e8a6d2UL, 0x49e94989UL, 0x11ea1164UL, 0xfeebfe3fUL, 0xa1eca1d7UL, 0x4eed4e8cUL, 0x16ee1661UL, 0xf9eff93aUL, -0xb4f0b4ccUL, 0x5bf15b97UL, 0x03f2037aUL, 0xecf3ec21UL, 0xb3f4b3c9UL, 0x5cf55c92UL, 0x04f6047fUL, 0xebf7eb24UL, +0xfc90fcb4UL, 0x139113efUL, 0x4b924b02UL, 0xa493a459UL, 0xfb94fbb1UL, 0x149514eaUL, 0x4c964c07UL, 0xa397a35cUL, +0xf298f2beUL, 0x1d991de5UL, 0x459a4508UL, 0xaa9baa53UL, 0xf59cf5bbUL, 0x1a9d1ae0UL, 0x429e420dUL, 0xad9fad56UL, +0xd8a0d888UL, 0x37a137d3UL, 0x6fa26f3eUL, 0x80a38065UL, 0xdfa4df8dUL, 0x30a530d6UL, 0x68a6683bUL, 0x87a78760UL, +0xd6a8d682UL, 0x39a939d9UL, 0x61aa6134UL, 0x8eab8e6fUL, 0xd1acd187UL, 0x3ead3edcUL, 0x66ae6631UL, 0x89af896aUL, +0xc4b0c49cUL, 0x2bb12bc7UL, 0x73b2732aUL, 0x9cb39c71UL, 0xc3b4c399UL, 0x2cb52cc2UL, 0x74b6742fUL, 0x9bb79b74UL, +0xcab8ca96UL, 0x25b925cdUL, 0x7dba7d20UL, 0x92bb927bUL, 0xcdbccd93UL, 0x22bd22c8UL, 0x7abe7a25UL, 0x95bf957eUL, +0x90c090f0UL, 0x7fc17fabUL, 0x27c22746UL, 0xc8c3c81dUL, 0x97c497f5UL, 0x78c578aeUL, 0x20c62043UL, 0xcfc7cf18UL, +0x9ec89efaUL, 0x71c971a1UL, 0x29ca294cUL, 0xc6cbc617UL, 0x99cc99ffUL, 0x76cd76a4UL, 0x2ece2e49UL, 0xc1cfc112UL, +0x8cd08ce4UL, 0x63d163bfUL, 0x3bd23b52UL, 0xd4d3d409UL, 0x8bd48be1UL, 0x64d564baUL, 0x3cd63c57UL, 0xd3d7d30cUL, +0x82d882eeUL, 0x6dd96db5UL, 0x35da3558UL, 0xdadbda03UL, 0x85dc85ebUL, 0x6add6ab0UL, 0x32de325dUL, 0xdddfdd06UL, +0xa8e0a8d8UL, 0x47e14783UL, 0x1fe21f6eUL, 0xf0e3f035UL, 0xafe4afddUL, 0x40e54086UL, 0x18e6186bUL, 0xf7e7f730UL, +0xa6e8a6d2UL, 0x49e94989UL, 0x11ea1164UL, 0xfeebfe3fUL, 0xa1eca1d7UL, 0x4eed4e8cUL, 0x16ee1661UL, 0xf9eff93aUL, +0xb4f0b4ccUL, 0x5bf15b97UL, 0x03f2037aUL, 0xecf3ec21UL, 0xb3f4b3c9UL, 0x5cf55c92UL, 0x04f6047fUL, 0xebf7eb24UL, 0xbaf8bac6UL, 0x55f9559dUL, 0x0dfa0d70UL, 0xe2fbe22bUL, 0xbdfcbdc3UL, 0x52fd5298UL, 0x0afe0a75UL, 0xe5ffe52eUL -}, +}, { -0x00000000UL, 0x5bef015bUL, 0xb6b702b6UL, 0xed5803edUL, 0x05070405UL, 0x5ee8055eUL, 0xb3b006b3UL, 0xe85f07e8UL, -0x0a0e080aUL, 0x51e10951UL, 0xbcb90abcUL, 0xe7560be7UL, 0x0f090c0fUL, 0x54e60d54UL, 0xb9be0eb9UL, 0xe2510fe2UL, -0x141c1014UL, 0x4ff3114fUL, 0xa2ab12a2UL, 0xf94413f9UL, 0x111b1411UL, 0x4af4154aUL, 0xa7ac16a7UL, 0xfc4317fcUL, -0x1e12181eUL, 0x45fd1945UL, 0xa8a51aa8UL, 0xf34a1bf3UL, 0x1b151c1bUL, 0x40fa1d40UL, 0xada21eadUL, 0xf64d1ff6UL, -0x28382028UL, 0x73d72173UL, 0x9e8f229eUL, 0xc56023c5UL, 0x2d3f242dUL, 0x76d02576UL, 0x9b88269bUL, 0xc06727c0UL, -0x22362822UL, 0x79d92979UL, 0x94812a94UL, 0xcf6e2bcfUL, 0x27312c27UL, 0x7cde2d7cUL, 0x91862e91UL, 0xca692fcaUL, -0x3c24303cUL, 0x67cb3167UL, 0x8a93328aUL, 0xd17c33d1UL, 0x39233439UL, 0x62cc3562UL, 0x8f94368fUL, 0xd47b37d4UL, +0x00000000UL, 0x5bef015bUL, 0xb6b702b6UL, 0xed5803edUL, 0x05070405UL, 0x5ee8055eUL, 0xb3b006b3UL, 0xe85f07e8UL, +0x0a0e080aUL, 0x51e10951UL, 0xbcb90abcUL, 0xe7560be7UL, 0x0f090c0fUL, 0x54e60d54UL, 0xb9be0eb9UL, 0xe2510fe2UL, +0x141c1014UL, 0x4ff3114fUL, 0xa2ab12a2UL, 0xf94413f9UL, 0x111b1411UL, 0x4af4154aUL, 0xa7ac16a7UL, 0xfc4317fcUL, +0x1e12181eUL, 0x45fd1945UL, 0xa8a51aa8UL, 0xf34a1bf3UL, 0x1b151c1bUL, 0x40fa1d40UL, 0xada21eadUL, 0xf64d1ff6UL, +0x28382028UL, 0x73d72173UL, 0x9e8f229eUL, 0xc56023c5UL, 0x2d3f242dUL, 0x76d02576UL, 0x9b88269bUL, 0xc06727c0UL, +0x22362822UL, 0x79d92979UL, 0x94812a94UL, 0xcf6e2bcfUL, 0x27312c27UL, 0x7cde2d7cUL, 0x91862e91UL, 0xca692fcaUL, +0x3c24303cUL, 0x67cb3167UL, 0x8a93328aUL, 0xd17c33d1UL, 0x39233439UL, 0x62cc3562UL, 0x8f94368fUL, 0xd47b37d4UL, 0x362a3836UL, 0x6dc5396dUL, 0x809d3a80UL, 0xdb723bdbUL, 0x332d3c33UL, 0x68c23d68UL, 0x859a3e85UL, 0xde753fdeUL, -0x50704050UL, 0x0b9f410bUL, 0xe6c742e6UL, 0xbd2843bdUL, 0x55774455UL, 0x0e98450eUL, 0xe3c046e3UL, 0xb82f47b8UL, -0x5a7e485aUL, 0x01914901UL, 0xecc94aecUL, 0xb7264bb7UL, 0x5f794c5fUL, 0x04964d04UL, 0xe9ce4ee9UL, 0xb2214fb2UL, -0x446c5044UL, 0x1f83511fUL, 0xf2db52f2UL, 0xa93453a9UL, 0x416b5441UL, 0x1a84551aUL, 0xf7dc56f7UL, 0xac3357acUL, -0x4e62584eUL, 0x158d5915UL, 0xf8d55af8UL, 0xa33a5ba3UL, 0x4b655c4bUL, 0x108a5d10UL, 0xfdd25efdUL, 0xa63d5fa6UL, -0x78486078UL, 0x23a76123UL, 0xceff62ceUL, 0x95106395UL, 0x7d4f647dUL, 0x26a06526UL, 0xcbf866cbUL, 0x90176790UL, -0x72466872UL, 0x29a96929UL, 0xc4f16ac4UL, 0x9f1e6b9fUL, 0x77416c77UL, 0x2cae6d2cUL, 0xc1f66ec1UL, 0x9a196f9aUL, -0x6c54706cUL, 0x37bb7137UL, 0xdae372daUL, 0x810c7381UL, 0x69537469UL, 0x32bc7532UL, 0xdfe476dfUL, 0x840b7784UL, -0x665a7866UL, 0x3db5793dUL, 0xd0ed7ad0UL, 0x8b027b8bUL, 0x635d7c63UL, 0x38b27d38UL, 0xd5ea7ed5UL, 0x8e057f8eUL, -0xa0e080a0UL, 0xfb0f81fbUL, 0x16578216UL, 0x4db8834dUL, 0xa5e784a5UL, 0xfe0885feUL, 0x13508613UL, 0x48bf8748UL, +0x50704050UL, 0x0b9f410bUL, 0xe6c742e6UL, 0xbd2843bdUL, 0x55774455UL, 0x0e98450eUL, 0xe3c046e3UL, 0xb82f47b8UL, +0x5a7e485aUL, 0x01914901UL, 0xecc94aecUL, 0xb7264bb7UL, 0x5f794c5fUL, 0x04964d04UL, 0xe9ce4ee9UL, 0xb2214fb2UL, +0x446c5044UL, 0x1f83511fUL, 0xf2db52f2UL, 0xa93453a9UL, 0x416b5441UL, 0x1a84551aUL, 0xf7dc56f7UL, 0xac3357acUL, +0x4e62584eUL, 0x158d5915UL, 0xf8d55af8UL, 0xa33a5ba3UL, 0x4b655c4bUL, 0x108a5d10UL, 0xfdd25efdUL, 0xa63d5fa6UL, +0x78486078UL, 0x23a76123UL, 0xceff62ceUL, 0x95106395UL, 0x7d4f647dUL, 0x26a06526UL, 0xcbf866cbUL, 0x90176790UL, +0x72466872UL, 0x29a96929UL, 0xc4f16ac4UL, 0x9f1e6b9fUL, 0x77416c77UL, 0x2cae6d2cUL, 0xc1f66ec1UL, 0x9a196f9aUL, +0x6c54706cUL, 0x37bb7137UL, 0xdae372daUL, 0x810c7381UL, 0x69537469UL, 0x32bc7532UL, 0xdfe476dfUL, 0x840b7784UL, +0x665a7866UL, 0x3db5793dUL, 0xd0ed7ad0UL, 0x8b027b8bUL, 0x635d7c63UL, 0x38b27d38UL, 0xd5ea7ed5UL, 0x8e057f8eUL, +0xa0e080a0UL, 0xfb0f81fbUL, 0x16578216UL, 0x4db8834dUL, 0xa5e784a5UL, 0xfe0885feUL, 0x13508613UL, 0x48bf8748UL, 0xaaee88aaUL, 0xf10189f1UL, 0x1c598a1cUL, 0x47b68b47UL, 0xafe98cafUL, 0xf4068df4UL, 0x195e8e19UL, 0x42b18f42UL, -0xb4fc90b4UL, 0xef1391efUL, 0x024b9202UL, 0x59a49359UL, 0xb1fb94b1UL, 0xea1495eaUL, 0x074c9607UL, 0x5ca3975cUL, -0xbef298beUL, 0xe51d99e5UL, 0x08459a08UL, 0x53aa9b53UL, 0xbbf59cbbUL, 0xe01a9de0UL, 0x0d429e0dUL, 0x56ad9f56UL, -0x88d8a088UL, 0xd337a1d3UL, 0x3e6fa23eUL, 0x6580a365UL, 0x8ddfa48dUL, 0xd630a5d6UL, 0x3b68a63bUL, 0x6087a760UL, -0x82d6a882UL, 0xd939a9d9UL, 0x3461aa34UL, 0x6f8eab6fUL, 0x87d1ac87UL, 0xdc3eaddcUL, 0x3166ae31UL, 0x6a89af6aUL, -0x9cc4b09cUL, 0xc72bb1c7UL, 0x2a73b22aUL, 0x719cb371UL, 0x99c3b499UL, 0xc22cb5c2UL, 0x2f74b62fUL, 0x749bb774UL, +0xb4fc90b4UL, 0xef1391efUL, 0x024b9202UL, 0x59a49359UL, 0xb1fb94b1UL, 0xea1495eaUL, 0x074c9607UL, 0x5ca3975cUL, +0xbef298beUL, 0xe51d99e5UL, 0x08459a08UL, 0x53aa9b53UL, 0xbbf59cbbUL, 0xe01a9de0UL, 0x0d429e0dUL, 0x56ad9f56UL, +0x88d8a088UL, 0xd337a1d3UL, 0x3e6fa23eUL, 0x6580a365UL, 0x8ddfa48dUL, 0xd630a5d6UL, 0x3b68a63bUL, 0x6087a760UL, +0x82d6a882UL, 0xd939a9d9UL, 0x3461aa34UL, 0x6f8eab6fUL, 0x87d1ac87UL, 0xdc3eaddcUL, 0x3166ae31UL, 0x6a89af6aUL, +0x9cc4b09cUL, 0xc72bb1c7UL, 0x2a73b22aUL, 0x719cb371UL, 0x99c3b499UL, 0xc22cb5c2UL, 0x2f74b62fUL, 0x749bb774UL, 0x96cab896UL, 0xcd25b9cdUL, 0x207dba20UL, 0x7b92bb7bUL, 0x93cdbc93UL, 0xc822bdc8UL, 0x257abe25UL, 0x7e95bf7eUL, -0xf090c0f0UL, 0xab7fc1abUL, 0x4627c246UL, 0x1dc8c31dUL, 0xf597c4f5UL, 0xae78c5aeUL, 0x4320c643UL, 0x18cfc718UL, -0xfa9ec8faUL, 0xa171c9a1UL, 0x4c29ca4cUL, 0x17c6cb17UL, 0xff99ccffUL, 0xa476cda4UL, 0x492ece49UL, 0x12c1cf12UL, -0xe48cd0e4UL, 0xbf63d1bfUL, 0x523bd252UL, 0x09d4d309UL, 0xe18bd4e1UL, 0xba64d5baUL, 0x573cd657UL, 0x0cd3d70cUL, -0xee82d8eeUL, 0xb56dd9b5UL, 0x5835da58UL, 0x03dadb03UL, 0xeb85dcebUL, 0xb06addb0UL, 0x5d32de5dUL, 0x06dddf06UL, -0xd8a8e0d8UL, 0x8347e183UL, 0x6e1fe26eUL, 0x35f0e335UL, 0xddafe4ddUL, 0x8640e586UL, 0x6b18e66bUL, 0x30f7e730UL, +0xf090c0f0UL, 0xab7fc1abUL, 0x4627c246UL, 0x1dc8c31dUL, 0xf597c4f5UL, 0xae78c5aeUL, 0x4320c643UL, 0x18cfc718UL, +0xfa9ec8faUL, 0xa171c9a1UL, 0x4c29ca4cUL, 0x17c6cb17UL, 0xff99ccffUL, 0xa476cda4UL, 0x492ece49UL, 0x12c1cf12UL, +0xe48cd0e4UL, 0xbf63d1bfUL, 0x523bd252UL, 0x09d4d309UL, 0xe18bd4e1UL, 0xba64d5baUL, 0x573cd657UL, 0x0cd3d70cUL, +0xee82d8eeUL, 0xb56dd9b5UL, 0x5835da58UL, 0x03dadb03UL, 0xeb85dcebUL, 0xb06addb0UL, 0x5d32de5dUL, 0x06dddf06UL, +0xd8a8e0d8UL, 0x8347e183UL, 0x6e1fe26eUL, 0x35f0e335UL, 0xddafe4ddUL, 0x8640e586UL, 0x6b18e66bUL, 0x30f7e730UL, 0xd2a6e8d2UL, 0x8949e989UL, 0x6411ea64UL, 0x3ffeeb3fUL, 0xd7a1ecd7UL, 0x8c4eed8cUL, 0x6116ee61UL, 0x3af9ef3aUL, -0xccb4f0ccUL, 0x975bf197UL, 0x7a03f27aUL, 0x21ecf321UL, 0xc9b3f4c9UL, 0x925cf592UL, 0x7f04f67fUL, 0x24ebf724UL, +0xccb4f0ccUL, 0x975bf197UL, 0x7a03f27aUL, 0x21ecf321UL, 0xc9b3f4c9UL, 0x925cf592UL, 0x7f04f67fUL, 0x24ebf724UL, 0xc6baf8c6UL, 0x9d55f99dUL, 0x700dfa70UL, 0x2be2fb2bUL, 0xc3bdfcc3UL, 0x9852fd98UL, 0x750afe75UL, 0x2ee5ff2eUL }}; @@ -216,275 +216,275 @@ static const ulong32 mds_tab[4][256] = { /* the 4x8 RS transform */ static const ulong32 rs_tab0[256] = { -0x00000000LU, 0xa402a401LU, 0x05040502LU, 0xa106a103LU, 0x0a080a04LU, 0xae0aae05LU, 0x0f0c0f06LU, 0xab0eab07LU, -0x14101408LU, 0xb012b009LU, 0x1114110aLU, 0xb516b50bLU, 0x1e181e0cLU, 0xba1aba0dLU, 0x1b1c1b0eLU, 0xbf1ebf0fLU, -0x28202810LU, 0x8c228c11LU, 0x2d242d12LU, 0x89268913LU, 0x22282214LU, 0x862a8615LU, 0x272c2716LU, 0x832e8317LU, -0x3c303c18LU, 0x98329819LU, 0x3934391aLU, 0x9d369d1bLU, 0x3638361cLU, 0x923a921dLU, 0x333c331eLU, 0x973e971fLU, -0x50405020LU, 0xf442f421LU, 0x55445522LU, 0xf146f123LU, 0x5a485a24LU, 0xfe4afe25LU, 0x5f4c5f26LU, 0xfb4efb27LU, -0x44504428LU, 0xe052e029LU, 0x4154412aLU, 0xe556e52bLU, 0x4e584e2cLU, 0xea5aea2dLU, 0x4b5c4b2eLU, 0xef5eef2fLU, -0x78607830LU, 0xdc62dc31LU, 0x7d647d32LU, 0xd966d933LU, 0x72687234LU, 0xd66ad635LU, 0x776c7736LU, 0xd36ed337LU, -0x6c706c38LU, 0xc872c839LU, 0x6974693aLU, 0xcd76cd3bLU, 0x6678663cLU, 0xc27ac23dLU, 0x637c633eLU, 0xc77ec73fLU, -0xa080a040LU, 0x04820441LU, 0xa584a542LU, 0x01860143LU, 0xaa88aa44LU, 0x0e8a0e45LU, 0xaf8caf46LU, 0x0b8e0b47LU, -0xb490b448LU, 0x10921049LU, 0xb194b14aLU, 0x1596154bLU, 0xbe98be4cLU, 0x1a9a1a4dLU, 0xbb9cbb4eLU, 0x1f9e1f4fLU, -0x88a08850LU, 0x2ca22c51LU, 0x8da48d52LU, 0x29a62953LU, 0x82a88254LU, 0x26aa2655LU, 0x87ac8756LU, 0x23ae2357LU, -0x9cb09c58LU, 0x38b23859LU, 0x99b4995aLU, 0x3db63d5bLU, 0x96b8965cLU, 0x32ba325dLU, 0x93bc935eLU, 0x37be375fLU, -0xf0c0f060LU, 0x54c25461LU, 0xf5c4f562LU, 0x51c65163LU, 0xfac8fa64LU, 0x5eca5e65LU, 0xffccff66LU, 0x5bce5b67LU, -0xe4d0e468LU, 0x40d24069LU, 0xe1d4e16aLU, 0x45d6456bLU, 0xeed8ee6cLU, 0x4ada4a6dLU, 0xebdceb6eLU, 0x4fde4f6fLU, -0xd8e0d870LU, 0x7ce27c71LU, 0xdde4dd72LU, 0x79e67973LU, 0xd2e8d274LU, 0x76ea7675LU, 0xd7ecd776LU, 0x73ee7377LU, -0xccf0cc78LU, 0x68f26879LU, 0xc9f4c97aLU, 0x6df66d7bLU, 0xc6f8c67cLU, 0x62fa627dLU, 0xc3fcc37eLU, 0x67fe677fLU, -0x0d4d0d80LU, 0xa94fa981LU, 0x08490882LU, 0xac4bac83LU, 0x07450784LU, 0xa347a385LU, 0x02410286LU, 0xa643a687LU, -0x195d1988LU, 0xbd5fbd89LU, 0x1c591c8aLU, 0xb85bb88bLU, 0x1355138cLU, 0xb757b78dLU, 0x1651168eLU, 0xb253b28fLU, -0x256d2590LU, 0x816f8191LU, 0x20692092LU, 0x846b8493LU, 0x2f652f94LU, 0x8b678b95LU, 0x2a612a96LU, 0x8e638e97LU, -0x317d3198LU, 0x957f9599LU, 0x3479349aLU, 0x907b909bLU, 0x3b753b9cLU, 0x9f779f9dLU, 0x3e713e9eLU, 0x9a739a9fLU, -0x5d0d5da0LU, 0xf90ff9a1LU, 0x580958a2LU, 0xfc0bfca3LU, 0x570557a4LU, 0xf307f3a5LU, 0x520152a6LU, 0xf603f6a7LU, -0x491d49a8LU, 0xed1feda9LU, 0x4c194caaLU, 0xe81be8abLU, 0x431543acLU, 0xe717e7adLU, 0x461146aeLU, 0xe213e2afLU, -0x752d75b0LU, 0xd12fd1b1LU, 0x702970b2LU, 0xd42bd4b3LU, 0x7f257fb4LU, 0xdb27dbb5LU, 0x7a217ab6LU, 0xde23deb7LU, -0x613d61b8LU, 0xc53fc5b9LU, 0x643964baLU, 0xc03bc0bbLU, 0x6b356bbcLU, 0xcf37cfbdLU, 0x6e316ebeLU, 0xca33cabfLU, -0xadcdadc0LU, 0x09cf09c1LU, 0xa8c9a8c2LU, 0x0ccb0cc3LU, 0xa7c5a7c4LU, 0x03c703c5LU, 0xa2c1a2c6LU, 0x06c306c7LU, -0xb9ddb9c8LU, 0x1ddf1dc9LU, 0xbcd9bccaLU, 0x18db18cbLU, 0xb3d5b3ccLU, 0x17d717cdLU, 0xb6d1b6ceLU, 0x12d312cfLU, -0x85ed85d0LU, 0x21ef21d1LU, 0x80e980d2LU, 0x24eb24d3LU, 0x8fe58fd4LU, 0x2be72bd5LU, 0x8ae18ad6LU, 0x2ee32ed7LU, -0x91fd91d8LU, 0x35ff35d9LU, 0x94f994daLU, 0x30fb30dbLU, 0x9bf59bdcLU, 0x3ff73fddLU, 0x9ef19edeLU, 0x3af33adfLU, -0xfd8dfde0LU, 0x598f59e1LU, 0xf889f8e2LU, 0x5c8b5ce3LU, 0xf785f7e4LU, 0x538753e5LU, 0xf281f2e6LU, 0x568356e7LU, -0xe99de9e8LU, 0x4d9f4de9LU, 0xec99eceaLU, 0x489b48ebLU, 0xe395e3ecLU, 0x479747edLU, 0xe691e6eeLU, 0x429342efLU, -0xd5add5f0LU, 0x71af71f1LU, 0xd0a9d0f2LU, 0x74ab74f3LU, 0xdfa5dff4LU, 0x7ba77bf5LU, 0xdaa1daf6LU, 0x7ea37ef7LU, -0xc1bdc1f8LU, 0x65bf65f9LU, 0xc4b9c4faLU, 0x60bb60fbLU, 0xcbb5cbfcLU, 0x6fb76ffdLU, 0xceb1cefeLU, 0x6ab36affLU }; +0x00000000LU, 0xa402a401LU, 0x05040502LU, 0xa106a103LU, 0x0a080a04LU, 0xae0aae05LU, 0x0f0c0f06LU, 0xab0eab07LU, +0x14101408LU, 0xb012b009LU, 0x1114110aLU, 0xb516b50bLU, 0x1e181e0cLU, 0xba1aba0dLU, 0x1b1c1b0eLU, 0xbf1ebf0fLU, +0x28202810LU, 0x8c228c11LU, 0x2d242d12LU, 0x89268913LU, 0x22282214LU, 0x862a8615LU, 0x272c2716LU, 0x832e8317LU, +0x3c303c18LU, 0x98329819LU, 0x3934391aLU, 0x9d369d1bLU, 0x3638361cLU, 0x923a921dLU, 0x333c331eLU, 0x973e971fLU, +0x50405020LU, 0xf442f421LU, 0x55445522LU, 0xf146f123LU, 0x5a485a24LU, 0xfe4afe25LU, 0x5f4c5f26LU, 0xfb4efb27LU, +0x44504428LU, 0xe052e029LU, 0x4154412aLU, 0xe556e52bLU, 0x4e584e2cLU, 0xea5aea2dLU, 0x4b5c4b2eLU, 0xef5eef2fLU, +0x78607830LU, 0xdc62dc31LU, 0x7d647d32LU, 0xd966d933LU, 0x72687234LU, 0xd66ad635LU, 0x776c7736LU, 0xd36ed337LU, +0x6c706c38LU, 0xc872c839LU, 0x6974693aLU, 0xcd76cd3bLU, 0x6678663cLU, 0xc27ac23dLU, 0x637c633eLU, 0xc77ec73fLU, +0xa080a040LU, 0x04820441LU, 0xa584a542LU, 0x01860143LU, 0xaa88aa44LU, 0x0e8a0e45LU, 0xaf8caf46LU, 0x0b8e0b47LU, +0xb490b448LU, 0x10921049LU, 0xb194b14aLU, 0x1596154bLU, 0xbe98be4cLU, 0x1a9a1a4dLU, 0xbb9cbb4eLU, 0x1f9e1f4fLU, +0x88a08850LU, 0x2ca22c51LU, 0x8da48d52LU, 0x29a62953LU, 0x82a88254LU, 0x26aa2655LU, 0x87ac8756LU, 0x23ae2357LU, +0x9cb09c58LU, 0x38b23859LU, 0x99b4995aLU, 0x3db63d5bLU, 0x96b8965cLU, 0x32ba325dLU, 0x93bc935eLU, 0x37be375fLU, +0xf0c0f060LU, 0x54c25461LU, 0xf5c4f562LU, 0x51c65163LU, 0xfac8fa64LU, 0x5eca5e65LU, 0xffccff66LU, 0x5bce5b67LU, +0xe4d0e468LU, 0x40d24069LU, 0xe1d4e16aLU, 0x45d6456bLU, 0xeed8ee6cLU, 0x4ada4a6dLU, 0xebdceb6eLU, 0x4fde4f6fLU, +0xd8e0d870LU, 0x7ce27c71LU, 0xdde4dd72LU, 0x79e67973LU, 0xd2e8d274LU, 0x76ea7675LU, 0xd7ecd776LU, 0x73ee7377LU, +0xccf0cc78LU, 0x68f26879LU, 0xc9f4c97aLU, 0x6df66d7bLU, 0xc6f8c67cLU, 0x62fa627dLU, 0xc3fcc37eLU, 0x67fe677fLU, +0x0d4d0d80LU, 0xa94fa981LU, 0x08490882LU, 0xac4bac83LU, 0x07450784LU, 0xa347a385LU, 0x02410286LU, 0xa643a687LU, +0x195d1988LU, 0xbd5fbd89LU, 0x1c591c8aLU, 0xb85bb88bLU, 0x1355138cLU, 0xb757b78dLU, 0x1651168eLU, 0xb253b28fLU, +0x256d2590LU, 0x816f8191LU, 0x20692092LU, 0x846b8493LU, 0x2f652f94LU, 0x8b678b95LU, 0x2a612a96LU, 0x8e638e97LU, +0x317d3198LU, 0x957f9599LU, 0x3479349aLU, 0x907b909bLU, 0x3b753b9cLU, 0x9f779f9dLU, 0x3e713e9eLU, 0x9a739a9fLU, +0x5d0d5da0LU, 0xf90ff9a1LU, 0x580958a2LU, 0xfc0bfca3LU, 0x570557a4LU, 0xf307f3a5LU, 0x520152a6LU, 0xf603f6a7LU, +0x491d49a8LU, 0xed1feda9LU, 0x4c194caaLU, 0xe81be8abLU, 0x431543acLU, 0xe717e7adLU, 0x461146aeLU, 0xe213e2afLU, +0x752d75b0LU, 0xd12fd1b1LU, 0x702970b2LU, 0xd42bd4b3LU, 0x7f257fb4LU, 0xdb27dbb5LU, 0x7a217ab6LU, 0xde23deb7LU, +0x613d61b8LU, 0xc53fc5b9LU, 0x643964baLU, 0xc03bc0bbLU, 0x6b356bbcLU, 0xcf37cfbdLU, 0x6e316ebeLU, 0xca33cabfLU, +0xadcdadc0LU, 0x09cf09c1LU, 0xa8c9a8c2LU, 0x0ccb0cc3LU, 0xa7c5a7c4LU, 0x03c703c5LU, 0xa2c1a2c6LU, 0x06c306c7LU, +0xb9ddb9c8LU, 0x1ddf1dc9LU, 0xbcd9bccaLU, 0x18db18cbLU, 0xb3d5b3ccLU, 0x17d717cdLU, 0xb6d1b6ceLU, 0x12d312cfLU, +0x85ed85d0LU, 0x21ef21d1LU, 0x80e980d2LU, 0x24eb24d3LU, 0x8fe58fd4LU, 0x2be72bd5LU, 0x8ae18ad6LU, 0x2ee32ed7LU, +0x91fd91d8LU, 0x35ff35d9LU, 0x94f994daLU, 0x30fb30dbLU, 0x9bf59bdcLU, 0x3ff73fddLU, 0x9ef19edeLU, 0x3af33adfLU, +0xfd8dfde0LU, 0x598f59e1LU, 0xf889f8e2LU, 0x5c8b5ce3LU, 0xf785f7e4LU, 0x538753e5LU, 0xf281f2e6LU, 0x568356e7LU, +0xe99de9e8LU, 0x4d9f4de9LU, 0xec99eceaLU, 0x489b48ebLU, 0xe395e3ecLU, 0x479747edLU, 0xe691e6eeLU, 0x429342efLU, +0xd5add5f0LU, 0x71af71f1LU, 0xd0a9d0f2LU, 0x74ab74f3LU, 0xdfa5dff4LU, 0x7ba77bf5LU, 0xdaa1daf6LU, 0x7ea37ef7LU, +0xc1bdc1f8LU, 0x65bf65f9LU, 0xc4b9c4faLU, 0x60bb60fbLU, 0xcbb5cbfcLU, 0x6fb76ffdLU, 0xceb1cefeLU, 0x6ab36affLU }; static const ulong32 rs_tab1[256] = { -0x00000000LU, 0x55a156a4LU, 0xaa0fac05LU, 0xffaefaa1LU, 0x191e150aLU, 0x4cbf43aeLU, 0xb311b90fLU, 0xe6b0efabLU, -0x323c2a14LU, 0x679d7cb0LU, 0x98338611LU, 0xcd92d0b5LU, 0x2b223f1eLU, 0x7e8369baLU, 0x812d931bLU, 0xd48cc5bfLU, -0x64785428LU, 0x31d9028cLU, 0xce77f82dLU, 0x9bd6ae89LU, 0x7d664122LU, 0x28c71786LU, 0xd769ed27LU, 0x82c8bb83LU, -0x56447e3cLU, 0x03e52898LU, 0xfc4bd239LU, 0xa9ea849dLU, 0x4f5a6b36LU, 0x1afb3d92LU, 0xe555c733LU, 0xb0f49197LU, -0xc8f0a850LU, 0x9d51fef4LU, 0x62ff0455LU, 0x375e52f1LU, 0xd1eebd5aLU, 0x844febfeLU, 0x7be1115fLU, 0x2e4047fbLU, -0xfacc8244LU, 0xaf6dd4e0LU, 0x50c32e41LU, 0x056278e5LU, 0xe3d2974eLU, 0xb673c1eaLU, 0x49dd3b4bLU, 0x1c7c6defLU, -0xac88fc78LU, 0xf929aadcLU, 0x0687507dLU, 0x532606d9LU, 0xb596e972LU, 0xe037bfd6LU, 0x1f994577LU, 0x4a3813d3LU, -0x9eb4d66cLU, 0xcb1580c8LU, 0x34bb7a69LU, 0x611a2ccdLU, 0x87aac366LU, 0xd20b95c2LU, 0x2da56f63LU, 0x780439c7LU, -0xddad1da0LU, 0x880c4b04LU, 0x77a2b1a5LU, 0x2203e701LU, 0xc4b308aaLU, 0x91125e0eLU, 0x6ebca4afLU, 0x3b1df20bLU, -0xef9137b4LU, 0xba306110LU, 0x459e9bb1LU, 0x103fcd15LU, 0xf68f22beLU, 0xa32e741aLU, 0x5c808ebbLU, 0x0921d81fLU, -0xb9d54988LU, 0xec741f2cLU, 0x13dae58dLU, 0x467bb329LU, 0xa0cb5c82LU, 0xf56a0a26LU, 0x0ac4f087LU, 0x5f65a623LU, -0x8be9639cLU, 0xde483538LU, 0x21e6cf99LU, 0x7447993dLU, 0x92f77696LU, 0xc7562032LU, 0x38f8da93LU, 0x6d598c37LU, -0x155db5f0LU, 0x40fce354LU, 0xbf5219f5LU, 0xeaf34f51LU, 0x0c43a0faLU, 0x59e2f65eLU, 0xa64c0cffLU, 0xf3ed5a5bLU, -0x27619fe4LU, 0x72c0c940LU, 0x8d6e33e1LU, 0xd8cf6545LU, 0x3e7f8aeeLU, 0x6bdedc4aLU, 0x947026ebLU, 0xc1d1704fLU, -0x7125e1d8LU, 0x2484b77cLU, 0xdb2a4dddLU, 0x8e8b1b79LU, 0x683bf4d2LU, 0x3d9aa276LU, 0xc23458d7LU, 0x97950e73LU, +0x00000000LU, 0x55a156a4LU, 0xaa0fac05LU, 0xffaefaa1LU, 0x191e150aLU, 0x4cbf43aeLU, 0xb311b90fLU, 0xe6b0efabLU, +0x323c2a14LU, 0x679d7cb0LU, 0x98338611LU, 0xcd92d0b5LU, 0x2b223f1eLU, 0x7e8369baLU, 0x812d931bLU, 0xd48cc5bfLU, +0x64785428LU, 0x31d9028cLU, 0xce77f82dLU, 0x9bd6ae89LU, 0x7d664122LU, 0x28c71786LU, 0xd769ed27LU, 0x82c8bb83LU, +0x56447e3cLU, 0x03e52898LU, 0xfc4bd239LU, 0xa9ea849dLU, 0x4f5a6b36LU, 0x1afb3d92LU, 0xe555c733LU, 0xb0f49197LU, +0xc8f0a850LU, 0x9d51fef4LU, 0x62ff0455LU, 0x375e52f1LU, 0xd1eebd5aLU, 0x844febfeLU, 0x7be1115fLU, 0x2e4047fbLU, +0xfacc8244LU, 0xaf6dd4e0LU, 0x50c32e41LU, 0x056278e5LU, 0xe3d2974eLU, 0xb673c1eaLU, 0x49dd3b4bLU, 0x1c7c6defLU, +0xac88fc78LU, 0xf929aadcLU, 0x0687507dLU, 0x532606d9LU, 0xb596e972LU, 0xe037bfd6LU, 0x1f994577LU, 0x4a3813d3LU, +0x9eb4d66cLU, 0xcb1580c8LU, 0x34bb7a69LU, 0x611a2ccdLU, 0x87aac366LU, 0xd20b95c2LU, 0x2da56f63LU, 0x780439c7LU, +0xddad1da0LU, 0x880c4b04LU, 0x77a2b1a5LU, 0x2203e701LU, 0xc4b308aaLU, 0x91125e0eLU, 0x6ebca4afLU, 0x3b1df20bLU, +0xef9137b4LU, 0xba306110LU, 0x459e9bb1LU, 0x103fcd15LU, 0xf68f22beLU, 0xa32e741aLU, 0x5c808ebbLU, 0x0921d81fLU, +0xb9d54988LU, 0xec741f2cLU, 0x13dae58dLU, 0x467bb329LU, 0xa0cb5c82LU, 0xf56a0a26LU, 0x0ac4f087LU, 0x5f65a623LU, +0x8be9639cLU, 0xde483538LU, 0x21e6cf99LU, 0x7447993dLU, 0x92f77696LU, 0xc7562032LU, 0x38f8da93LU, 0x6d598c37LU, +0x155db5f0LU, 0x40fce354LU, 0xbf5219f5LU, 0xeaf34f51LU, 0x0c43a0faLU, 0x59e2f65eLU, 0xa64c0cffLU, 0xf3ed5a5bLU, +0x27619fe4LU, 0x72c0c940LU, 0x8d6e33e1LU, 0xd8cf6545LU, 0x3e7f8aeeLU, 0x6bdedc4aLU, 0x947026ebLU, 0xc1d1704fLU, +0x7125e1d8LU, 0x2484b77cLU, 0xdb2a4dddLU, 0x8e8b1b79LU, 0x683bf4d2LU, 0x3d9aa276LU, 0xc23458d7LU, 0x97950e73LU, 0x4319cbccLU, 0x16b89d68LU, 0xe91667c9LU, 0xbcb7316dLU, 0x5a07dec6LU, 0x0fa68862LU, 0xf00872c3LU, 0xa5a92467LU, -0xf7173a0dLU, 0xa2b66ca9LU, 0x5d189608LU, 0x08b9c0acLU, 0xee092f07LU, 0xbba879a3LU, 0x44068302LU, 0x11a7d5a6LU, -0xc52b1019LU, 0x908a46bdLU, 0x6f24bc1cLU, 0x3a85eab8LU, 0xdc350513LU, 0x899453b7LU, 0x763aa916LU, 0x239bffb2LU, -0x936f6e25LU, 0xc6ce3881LU, 0x3960c220LU, 0x6cc19484LU, 0x8a717b2fLU, 0xdfd02d8bLU, 0x207ed72aLU, 0x75df818eLU, +0xf7173a0dLU, 0xa2b66ca9LU, 0x5d189608LU, 0x08b9c0acLU, 0xee092f07LU, 0xbba879a3LU, 0x44068302LU, 0x11a7d5a6LU, +0xc52b1019LU, 0x908a46bdLU, 0x6f24bc1cLU, 0x3a85eab8LU, 0xdc350513LU, 0x899453b7LU, 0x763aa916LU, 0x239bffb2LU, +0x936f6e25LU, 0xc6ce3881LU, 0x3960c220LU, 0x6cc19484LU, 0x8a717b2fLU, 0xdfd02d8bLU, 0x207ed72aLU, 0x75df818eLU, 0xa1534431LU, 0xf4f21295LU, 0x0b5ce834LU, 0x5efdbe90LU, 0xb84d513bLU, 0xedec079fLU, 0x1242fd3eLU, 0x47e3ab9aLU, -0x3fe7925dLU, 0x6a46c4f9LU, 0x95e83e58LU, 0xc04968fcLU, 0x26f98757LU, 0x7358d1f3LU, 0x8cf62b52LU, 0xd9577df6LU, +0x3fe7925dLU, 0x6a46c4f9LU, 0x95e83e58LU, 0xc04968fcLU, 0x26f98757LU, 0x7358d1f3LU, 0x8cf62b52LU, 0xd9577df6LU, 0x0ddbb849LU, 0x587aeeedLU, 0xa7d4144cLU, 0xf27542e8LU, 0x14c5ad43LU, 0x4164fbe7LU, 0xbeca0146LU, 0xeb6b57e2LU, -0x5b9fc675LU, 0x0e3e90d1LU, 0xf1906a70LU, 0xa4313cd4LU, 0x4281d37fLU, 0x172085dbLU, 0xe88e7f7aLU, 0xbd2f29deLU, -0x69a3ec61LU, 0x3c02bac5LU, 0xc3ac4064LU, 0x960d16c0LU, 0x70bdf96bLU, 0x251cafcfLU, 0xdab2556eLU, 0x8f1303caLU, -0x2aba27adLU, 0x7f1b7109LU, 0x80b58ba8LU, 0xd514dd0cLU, 0x33a432a7LU, 0x66056403LU, 0x99ab9ea2LU, 0xcc0ac806LU, -0x18860db9LU, 0x4d275b1dLU, 0xb289a1bcLU, 0xe728f718LU, 0x019818b3LU, 0x54394e17LU, 0xab97b4b6LU, 0xfe36e212LU, -0x4ec27385LU, 0x1b632521LU, 0xe4cddf80LU, 0xb16c8924LU, 0x57dc668fLU, 0x027d302bLU, 0xfdd3ca8aLU, 0xa8729c2eLU, -0x7cfe5991LU, 0x295f0f35LU, 0xd6f1f594LU, 0x8350a330LU, 0x65e04c9bLU, 0x30411a3fLU, 0xcfefe09eLU, 0x9a4eb63aLU, -0xe24a8ffdLU, 0xb7ebd959LU, 0x484523f8LU, 0x1de4755cLU, 0xfb549af7LU, 0xaef5cc53LU, 0x515b36f2LU, 0x04fa6056LU, -0xd076a5e9LU, 0x85d7f34dLU, 0x7a7909ecLU, 0x2fd85f48LU, 0xc968b0e3LU, 0x9cc9e647LU, 0x63671ce6LU, 0x36c64a42LU, -0x8632dbd5LU, 0xd3938d71LU, 0x2c3d77d0LU, 0x799c2174LU, 0x9f2ccedfLU, 0xca8d987bLU, 0x352362daLU, 0x6082347eLU, -0xb40ef1c1LU, 0xe1afa765LU, 0x1e015dc4LU, 0x4ba00b60LU, 0xad10e4cbLU, 0xf8b1b26fLU, 0x071f48ceLU, 0x52be1e6aLU }; +0x5b9fc675LU, 0x0e3e90d1LU, 0xf1906a70LU, 0xa4313cd4LU, 0x4281d37fLU, 0x172085dbLU, 0xe88e7f7aLU, 0xbd2f29deLU, +0x69a3ec61LU, 0x3c02bac5LU, 0xc3ac4064LU, 0x960d16c0LU, 0x70bdf96bLU, 0x251cafcfLU, 0xdab2556eLU, 0x8f1303caLU, +0x2aba27adLU, 0x7f1b7109LU, 0x80b58ba8LU, 0xd514dd0cLU, 0x33a432a7LU, 0x66056403LU, 0x99ab9ea2LU, 0xcc0ac806LU, +0x18860db9LU, 0x4d275b1dLU, 0xb289a1bcLU, 0xe728f718LU, 0x019818b3LU, 0x54394e17LU, 0xab97b4b6LU, 0xfe36e212LU, +0x4ec27385LU, 0x1b632521LU, 0xe4cddf80LU, 0xb16c8924LU, 0x57dc668fLU, 0x027d302bLU, 0xfdd3ca8aLU, 0xa8729c2eLU, +0x7cfe5991LU, 0x295f0f35LU, 0xd6f1f594LU, 0x8350a330LU, 0x65e04c9bLU, 0x30411a3fLU, 0xcfefe09eLU, 0x9a4eb63aLU, +0xe24a8ffdLU, 0xb7ebd959LU, 0x484523f8LU, 0x1de4755cLU, 0xfb549af7LU, 0xaef5cc53LU, 0x515b36f2LU, 0x04fa6056LU, +0xd076a5e9LU, 0x85d7f34dLU, 0x7a7909ecLU, 0x2fd85f48LU, 0xc968b0e3LU, 0x9cc9e647LU, 0x63671ce6LU, 0x36c64a42LU, +0x8632dbd5LU, 0xd3938d71LU, 0x2c3d77d0LU, 0x799c2174LU, 0x9f2ccedfLU, 0xca8d987bLU, 0x352362daLU, 0x6082347eLU, +0xb40ef1c1LU, 0xe1afa765LU, 0x1e015dc4LU, 0x4ba00b60LU, 0xad10e4cbLU, 0xf8b1b26fLU, 0x071f48ceLU, 0x52be1e6aLU }; static const ulong32 rs_tab2[256] = { -0x00000000LU, 0x87fc8255LU, 0x43b549aaLU, 0xc449cbffLU, 0x86279219LU, 0x01db104cLU, 0xc592dbb3LU, 0x426e59e6LU, -0x414e6932LU, 0xc6b2eb67LU, 0x02fb2098LU, 0x8507a2cdLU, 0xc769fb2bLU, 0x4095797eLU, 0x84dcb281LU, 0x032030d4LU, -0x829cd264LU, 0x05605031LU, 0xc1299bceLU, 0x46d5199bLU, 0x04bb407dLU, 0x8347c228LU, 0x470e09d7LU, 0xc0f28b82LU, -0xc3d2bb56LU, 0x442e3903LU, 0x8067f2fcLU, 0x079b70a9LU, 0x45f5294fLU, 0xc209ab1aLU, 0x064060e5LU, 0x81bce2b0LU, -0x4975e9c8LU, 0xce896b9dLU, 0x0ac0a062LU, 0x8d3c2237LU, 0xcf527bd1LU, 0x48aef984LU, 0x8ce7327bLU, 0x0b1bb02eLU, -0x083b80faLU, 0x8fc702afLU, 0x4b8ec950LU, 0xcc724b05LU, 0x8e1c12e3LU, 0x09e090b6LU, 0xcda95b49LU, 0x4a55d91cLU, -0xcbe93bacLU, 0x4c15b9f9LU, 0x885c7206LU, 0x0fa0f053LU, 0x4dcea9b5LU, 0xca322be0LU, 0x0e7be01fLU, 0x8987624aLU, -0x8aa7529eLU, 0x0d5bd0cbLU, 0xc9121b34LU, 0x4eee9961LU, 0x0c80c087LU, 0x8b7c42d2LU, 0x4f35892dLU, 0xc8c90b78LU, -0x92ea9fddLU, 0x15161d88LU, 0xd15fd677LU, 0x56a35422LU, 0x14cd0dc4LU, 0x93318f91LU, 0x5778446eLU, 0xd084c63bLU, -0xd3a4f6efLU, 0x545874baLU, 0x9011bf45LU, 0x17ed3d10LU, 0x558364f6LU, 0xd27fe6a3LU, 0x16362d5cLU, 0x91caaf09LU, -0x10764db9LU, 0x978acfecLU, 0x53c30413LU, 0xd43f8646LU, 0x9651dfa0LU, 0x11ad5df5LU, 0xd5e4960aLU, 0x5218145fLU, -0x5138248bLU, 0xd6c4a6deLU, 0x128d6d21LU, 0x9571ef74LU, 0xd71fb692LU, 0x50e334c7LU, 0x94aaff38LU, 0x13567d6dLU, -0xdb9f7615LU, 0x5c63f440LU, 0x982a3fbfLU, 0x1fd6bdeaLU, 0x5db8e40cLU, 0xda446659LU, 0x1e0dada6LU, 0x99f12ff3LU, -0x9ad11f27LU, 0x1d2d9d72LU, 0xd964568dLU, 0x5e98d4d8LU, 0x1cf68d3eLU, 0x9b0a0f6bLU, 0x5f43c494LU, 0xd8bf46c1LU, -0x5903a471LU, 0xdeff2624LU, 0x1ab6eddbLU, 0x9d4a6f8eLU, 0xdf243668LU, 0x58d8b43dLU, 0x9c917fc2LU, 0x1b6dfd97LU, -0x184dcd43LU, 0x9fb14f16LU, 0x5bf884e9LU, 0xdc0406bcLU, 0x9e6a5f5aLU, 0x1996dd0fLU, 0xdddf16f0LU, 0x5a2394a5LU, -0x699973f7LU, 0xee65f1a2LU, 0x2a2c3a5dLU, 0xadd0b808LU, 0xefbee1eeLU, 0x684263bbLU, 0xac0ba844LU, 0x2bf72a11LU, -0x28d71ac5LU, 0xaf2b9890LU, 0x6b62536fLU, 0xec9ed13aLU, 0xaef088dcLU, 0x290c0a89LU, 0xed45c176LU, 0x6ab94323LU, -0xeb05a193LU, 0x6cf923c6LU, 0xa8b0e839LU, 0x2f4c6a6cLU, 0x6d22338aLU, 0xeadeb1dfLU, 0x2e977a20LU, 0xa96bf875LU, -0xaa4bc8a1LU, 0x2db74af4LU, 0xe9fe810bLU, 0x6e02035eLU, 0x2c6c5ab8LU, 0xab90d8edLU, 0x6fd91312LU, 0xe8259147LU, -0x20ec9a3fLU, 0xa710186aLU, 0x6359d395LU, 0xe4a551c0LU, 0xa6cb0826LU, 0x21378a73LU, 0xe57e418cLU, 0x6282c3d9LU, -0x61a2f30dLU, 0xe65e7158LU, 0x2217baa7LU, 0xa5eb38f2LU, 0xe7856114LU, 0x6079e341LU, 0xa43028beLU, 0x23ccaaebLU, -0xa270485bLU, 0x258cca0eLU, 0xe1c501f1LU, 0x663983a4LU, 0x2457da42LU, 0xa3ab5817LU, 0x67e293e8LU, 0xe01e11bdLU, -0xe33e2169LU, 0x64c2a33cLU, 0xa08b68c3LU, 0x2777ea96LU, 0x6519b370LU, 0xe2e53125LU, 0x26acfadaLU, 0xa150788fLU, -0xfb73ec2aLU, 0x7c8f6e7fLU, 0xb8c6a580LU, 0x3f3a27d5LU, 0x7d547e33LU, 0xfaa8fc66LU, 0x3ee13799LU, 0xb91db5ccLU, -0xba3d8518LU, 0x3dc1074dLU, 0xf988ccb2LU, 0x7e744ee7LU, 0x3c1a1701LU, 0xbbe69554LU, 0x7faf5eabLU, 0xf853dcfeLU, -0x79ef3e4eLU, 0xfe13bc1bLU, 0x3a5a77e4LU, 0xbda6f5b1LU, 0xffc8ac57LU, 0x78342e02LU, 0xbc7de5fdLU, 0x3b8167a8LU, -0x38a1577cLU, 0xbf5dd529LU, 0x7b141ed6LU, 0xfce89c83LU, 0xbe86c565LU, 0x397a4730LU, 0xfd338ccfLU, 0x7acf0e9aLU, -0xb20605e2LU, 0x35fa87b7LU, 0xf1b34c48LU, 0x764fce1dLU, 0x342197fbLU, 0xb3dd15aeLU, 0x7794de51LU, 0xf0685c04LU, -0xf3486cd0LU, 0x74b4ee85LU, 0xb0fd257aLU, 0x3701a72fLU, 0x756ffec9LU, 0xf2937c9cLU, 0x36dab763LU, 0xb1263536LU, -0x309ad786LU, 0xb76655d3LU, 0x732f9e2cLU, 0xf4d31c79LU, 0xb6bd459fLU, 0x3141c7caLU, 0xf5080c35LU, 0x72f48e60LU, -0x71d4beb4LU, 0xf6283ce1LU, 0x3261f71eLU, 0xb59d754bLU, 0xf7f32cadLU, 0x700faef8LU, 0xb4466507LU, 0x33bae752LU }; +0x00000000LU, 0x87fc8255LU, 0x43b549aaLU, 0xc449cbffLU, 0x86279219LU, 0x01db104cLU, 0xc592dbb3LU, 0x426e59e6LU, +0x414e6932LU, 0xc6b2eb67LU, 0x02fb2098LU, 0x8507a2cdLU, 0xc769fb2bLU, 0x4095797eLU, 0x84dcb281LU, 0x032030d4LU, +0x829cd264LU, 0x05605031LU, 0xc1299bceLU, 0x46d5199bLU, 0x04bb407dLU, 0x8347c228LU, 0x470e09d7LU, 0xc0f28b82LU, +0xc3d2bb56LU, 0x442e3903LU, 0x8067f2fcLU, 0x079b70a9LU, 0x45f5294fLU, 0xc209ab1aLU, 0x064060e5LU, 0x81bce2b0LU, +0x4975e9c8LU, 0xce896b9dLU, 0x0ac0a062LU, 0x8d3c2237LU, 0xcf527bd1LU, 0x48aef984LU, 0x8ce7327bLU, 0x0b1bb02eLU, +0x083b80faLU, 0x8fc702afLU, 0x4b8ec950LU, 0xcc724b05LU, 0x8e1c12e3LU, 0x09e090b6LU, 0xcda95b49LU, 0x4a55d91cLU, +0xcbe93bacLU, 0x4c15b9f9LU, 0x885c7206LU, 0x0fa0f053LU, 0x4dcea9b5LU, 0xca322be0LU, 0x0e7be01fLU, 0x8987624aLU, +0x8aa7529eLU, 0x0d5bd0cbLU, 0xc9121b34LU, 0x4eee9961LU, 0x0c80c087LU, 0x8b7c42d2LU, 0x4f35892dLU, 0xc8c90b78LU, +0x92ea9fddLU, 0x15161d88LU, 0xd15fd677LU, 0x56a35422LU, 0x14cd0dc4LU, 0x93318f91LU, 0x5778446eLU, 0xd084c63bLU, +0xd3a4f6efLU, 0x545874baLU, 0x9011bf45LU, 0x17ed3d10LU, 0x558364f6LU, 0xd27fe6a3LU, 0x16362d5cLU, 0x91caaf09LU, +0x10764db9LU, 0x978acfecLU, 0x53c30413LU, 0xd43f8646LU, 0x9651dfa0LU, 0x11ad5df5LU, 0xd5e4960aLU, 0x5218145fLU, +0x5138248bLU, 0xd6c4a6deLU, 0x128d6d21LU, 0x9571ef74LU, 0xd71fb692LU, 0x50e334c7LU, 0x94aaff38LU, 0x13567d6dLU, +0xdb9f7615LU, 0x5c63f440LU, 0x982a3fbfLU, 0x1fd6bdeaLU, 0x5db8e40cLU, 0xda446659LU, 0x1e0dada6LU, 0x99f12ff3LU, +0x9ad11f27LU, 0x1d2d9d72LU, 0xd964568dLU, 0x5e98d4d8LU, 0x1cf68d3eLU, 0x9b0a0f6bLU, 0x5f43c494LU, 0xd8bf46c1LU, +0x5903a471LU, 0xdeff2624LU, 0x1ab6eddbLU, 0x9d4a6f8eLU, 0xdf243668LU, 0x58d8b43dLU, 0x9c917fc2LU, 0x1b6dfd97LU, +0x184dcd43LU, 0x9fb14f16LU, 0x5bf884e9LU, 0xdc0406bcLU, 0x9e6a5f5aLU, 0x1996dd0fLU, 0xdddf16f0LU, 0x5a2394a5LU, +0x699973f7LU, 0xee65f1a2LU, 0x2a2c3a5dLU, 0xadd0b808LU, 0xefbee1eeLU, 0x684263bbLU, 0xac0ba844LU, 0x2bf72a11LU, +0x28d71ac5LU, 0xaf2b9890LU, 0x6b62536fLU, 0xec9ed13aLU, 0xaef088dcLU, 0x290c0a89LU, 0xed45c176LU, 0x6ab94323LU, +0xeb05a193LU, 0x6cf923c6LU, 0xa8b0e839LU, 0x2f4c6a6cLU, 0x6d22338aLU, 0xeadeb1dfLU, 0x2e977a20LU, 0xa96bf875LU, +0xaa4bc8a1LU, 0x2db74af4LU, 0xe9fe810bLU, 0x6e02035eLU, 0x2c6c5ab8LU, 0xab90d8edLU, 0x6fd91312LU, 0xe8259147LU, +0x20ec9a3fLU, 0xa710186aLU, 0x6359d395LU, 0xe4a551c0LU, 0xa6cb0826LU, 0x21378a73LU, 0xe57e418cLU, 0x6282c3d9LU, +0x61a2f30dLU, 0xe65e7158LU, 0x2217baa7LU, 0xa5eb38f2LU, 0xe7856114LU, 0x6079e341LU, 0xa43028beLU, 0x23ccaaebLU, +0xa270485bLU, 0x258cca0eLU, 0xe1c501f1LU, 0x663983a4LU, 0x2457da42LU, 0xa3ab5817LU, 0x67e293e8LU, 0xe01e11bdLU, +0xe33e2169LU, 0x64c2a33cLU, 0xa08b68c3LU, 0x2777ea96LU, 0x6519b370LU, 0xe2e53125LU, 0x26acfadaLU, 0xa150788fLU, +0xfb73ec2aLU, 0x7c8f6e7fLU, 0xb8c6a580LU, 0x3f3a27d5LU, 0x7d547e33LU, 0xfaa8fc66LU, 0x3ee13799LU, 0xb91db5ccLU, +0xba3d8518LU, 0x3dc1074dLU, 0xf988ccb2LU, 0x7e744ee7LU, 0x3c1a1701LU, 0xbbe69554LU, 0x7faf5eabLU, 0xf853dcfeLU, +0x79ef3e4eLU, 0xfe13bc1bLU, 0x3a5a77e4LU, 0xbda6f5b1LU, 0xffc8ac57LU, 0x78342e02LU, 0xbc7de5fdLU, 0x3b8167a8LU, +0x38a1577cLU, 0xbf5dd529LU, 0x7b141ed6LU, 0xfce89c83LU, 0xbe86c565LU, 0x397a4730LU, 0xfd338ccfLU, 0x7acf0e9aLU, +0xb20605e2LU, 0x35fa87b7LU, 0xf1b34c48LU, 0x764fce1dLU, 0x342197fbLU, 0xb3dd15aeLU, 0x7794de51LU, 0xf0685c04LU, +0xf3486cd0LU, 0x74b4ee85LU, 0xb0fd257aLU, 0x3701a72fLU, 0x756ffec9LU, 0xf2937c9cLU, 0x36dab763LU, 0xb1263536LU, +0x309ad786LU, 0xb76655d3LU, 0x732f9e2cLU, 0xf4d31c79LU, 0xb6bd459fLU, 0x3141c7caLU, 0xf5080c35LU, 0x72f48e60LU, +0x71d4beb4LU, 0xf6283ce1LU, 0x3261f71eLU, 0xb59d754bLU, 0xf7f32cadLU, 0x700faef8LU, 0xb4466507LU, 0x33bae752LU }; static const ulong32 rs_tab3[256] = { -0x00000000LU, 0x5ac1f387LU, 0xb4cfab43LU, 0xee0e58c4LU, 0x25d31b86LU, 0x7f12e801LU, 0x911cb0c5LU, 0xcbdd4342LU, -0x4aeb3641LU, 0x102ac5c6LU, 0xfe249d02LU, 0xa4e56e85LU, 0x6f382dc7LU, 0x35f9de40LU, 0xdbf78684LU, 0x81367503LU, -0x949b6c82LU, 0xce5a9f05LU, 0x2054c7c1LU, 0x7a953446LU, 0xb1487704LU, 0xeb898483LU, 0x0587dc47LU, 0x5f462fc0LU, +0x00000000LU, 0x5ac1f387LU, 0xb4cfab43LU, 0xee0e58c4LU, 0x25d31b86LU, 0x7f12e801LU, 0x911cb0c5LU, 0xcbdd4342LU, +0x4aeb3641LU, 0x102ac5c6LU, 0xfe249d02LU, 0xa4e56e85LU, 0x6f382dc7LU, 0x35f9de40LU, 0xdbf78684LU, 0x81367503LU, +0x949b6c82LU, 0xce5a9f05LU, 0x2054c7c1LU, 0x7a953446LU, 0xb1487704LU, 0xeb898483LU, 0x0587dc47LU, 0x5f462fc0LU, 0xde705ac3LU, 0x84b1a944LU, 0x6abff180LU, 0x307e0207LU, 0xfba34145LU, 0xa162b2c2LU, 0x4f6cea06LU, 0x15ad1981LU, -0x657bd849LU, 0x3fba2bceLU, 0xd1b4730aLU, 0x8b75808dLU, 0x40a8c3cfLU, 0x1a693048LU, 0xf467688cLU, 0xaea69b0bLU, -0x2f90ee08LU, 0x75511d8fLU, 0x9b5f454bLU, 0xc19eb6ccLU, 0x0a43f58eLU, 0x50820609LU, 0xbe8c5ecdLU, 0xe44dad4aLU, -0xf1e0b4cbLU, 0xab21474cLU, 0x452f1f88LU, 0x1feeec0fLU, 0xd433af4dLU, 0x8ef25ccaLU, 0x60fc040eLU, 0x3a3df789LU, -0xbb0b828aLU, 0xe1ca710dLU, 0x0fc429c9LU, 0x5505da4eLU, 0x9ed8990cLU, 0xc4196a8bLU, 0x2a17324fLU, 0x70d6c1c8LU, -0xcaf6fd92LU, 0x90370e15LU, 0x7e3956d1LU, 0x24f8a556LU, 0xef25e614LU, 0xb5e41593LU, 0x5bea4d57LU, 0x012bbed0LU, +0x657bd849LU, 0x3fba2bceLU, 0xd1b4730aLU, 0x8b75808dLU, 0x40a8c3cfLU, 0x1a693048LU, 0xf467688cLU, 0xaea69b0bLU, +0x2f90ee08LU, 0x75511d8fLU, 0x9b5f454bLU, 0xc19eb6ccLU, 0x0a43f58eLU, 0x50820609LU, 0xbe8c5ecdLU, 0xe44dad4aLU, +0xf1e0b4cbLU, 0xab21474cLU, 0x452f1f88LU, 0x1feeec0fLU, 0xd433af4dLU, 0x8ef25ccaLU, 0x60fc040eLU, 0x3a3df789LU, +0xbb0b828aLU, 0xe1ca710dLU, 0x0fc429c9LU, 0x5505da4eLU, 0x9ed8990cLU, 0xc4196a8bLU, 0x2a17324fLU, 0x70d6c1c8LU, +0xcaf6fd92LU, 0x90370e15LU, 0x7e3956d1LU, 0x24f8a556LU, 0xef25e614LU, 0xb5e41593LU, 0x5bea4d57LU, 0x012bbed0LU, 0x801dcbd3LU, 0xdadc3854LU, 0x34d26090LU, 0x6e139317LU, 0xa5ced055LU, 0xff0f23d2LU, 0x11017b16LU, 0x4bc08891LU, -0x5e6d9110LU, 0x04ac6297LU, 0xeaa23a53LU, 0xb063c9d4LU, 0x7bbe8a96LU, 0x217f7911LU, 0xcf7121d5LU, 0x95b0d252LU, -0x1486a751LU, 0x4e4754d6LU, 0xa0490c12LU, 0xfa88ff95LU, 0x3155bcd7LU, 0x6b944f50LU, 0x859a1794LU, 0xdf5be413LU, +0x5e6d9110LU, 0x04ac6297LU, 0xeaa23a53LU, 0xb063c9d4LU, 0x7bbe8a96LU, 0x217f7911LU, 0xcf7121d5LU, 0x95b0d252LU, +0x1486a751LU, 0x4e4754d6LU, 0xa0490c12LU, 0xfa88ff95LU, 0x3155bcd7LU, 0x6b944f50LU, 0x859a1794LU, 0xdf5be413LU, 0xaf8d25dbLU, 0xf54cd65cLU, 0x1b428e98LU, 0x41837d1fLU, 0x8a5e3e5dLU, 0xd09fcddaLU, 0x3e91951eLU, 0x64506699LU, -0xe566139aLU, 0xbfa7e01dLU, 0x51a9b8d9LU, 0x0b684b5eLU, 0xc0b5081cLU, 0x9a74fb9bLU, 0x747aa35fLU, 0x2ebb50d8LU, -0x3b164959LU, 0x61d7badeLU, 0x8fd9e21aLU, 0xd518119dLU, 0x1ec552dfLU, 0x4404a158LU, 0xaa0af99cLU, 0xf0cb0a1bLU, -0x71fd7f18LU, 0x2b3c8c9fLU, 0xc532d45bLU, 0x9ff327dcLU, 0x542e649eLU, 0x0eef9719LU, 0xe0e1cfddLU, 0xba203c5aLU, -0xd9a1b769LU, 0x836044eeLU, 0x6d6e1c2aLU, 0x37afefadLU, 0xfc72acefLU, 0xa6b35f68LU, 0x48bd07acLU, 0x127cf42bLU, -0x934a8128LU, 0xc98b72afLU, 0x27852a6bLU, 0x7d44d9ecLU, 0xb6999aaeLU, 0xec586929LU, 0x025631edLU, 0x5897c26aLU, -0x4d3adbebLU, 0x17fb286cLU, 0xf9f570a8LU, 0xa334832fLU, 0x68e9c06dLU, 0x322833eaLU, 0xdc266b2eLU, 0x86e798a9LU, -0x07d1edaaLU, 0x5d101e2dLU, 0xb31e46e9LU, 0xe9dfb56eLU, 0x2202f62cLU, 0x78c305abLU, 0x96cd5d6fLU, 0xcc0caee8LU, -0xbcda6f20LU, 0xe61b9ca7LU, 0x0815c463LU, 0x52d437e4LU, 0x990974a6LU, 0xc3c88721LU, 0x2dc6dfe5LU, 0x77072c62LU, -0xf6315961LU, 0xacf0aae6LU, 0x42fef222LU, 0x183f01a5LU, 0xd3e242e7LU, 0x8923b160LU, 0x672de9a4LU, 0x3dec1a23LU, -0x284103a2LU, 0x7280f025LU, 0x9c8ea8e1LU, 0xc64f5b66LU, 0x0d921824LU, 0x5753eba3LU, 0xb95db367LU, 0xe39c40e0LU, -0x62aa35e3LU, 0x386bc664LU, 0xd6659ea0LU, 0x8ca46d27LU, 0x47792e65LU, 0x1db8dde2LU, 0xf3b68526LU, 0xa97776a1LU, -0x13574afbLU, 0x4996b97cLU, 0xa798e1b8LU, 0xfd59123fLU, 0x3684517dLU, 0x6c45a2faLU, 0x824bfa3eLU, 0xd88a09b9LU, -0x59bc7cbaLU, 0x037d8f3dLU, 0xed73d7f9LU, 0xb7b2247eLU, 0x7c6f673cLU, 0x26ae94bbLU, 0xc8a0cc7fLU, 0x92613ff8LU, -0x87cc2679LU, 0xdd0dd5feLU, 0x33038d3aLU, 0x69c27ebdLU, 0xa21f3dffLU, 0xf8dece78LU, 0x16d096bcLU, 0x4c11653bLU, -0xcd271038LU, 0x97e6e3bfLU, 0x79e8bb7bLU, 0x232948fcLU, 0xe8f40bbeLU, 0xb235f839LU, 0x5c3ba0fdLU, 0x06fa537aLU, -0x762c92b2LU, 0x2ced6135LU, 0xc2e339f1LU, 0x9822ca76LU, 0x53ff8934LU, 0x093e7ab3LU, 0xe7302277LU, 0xbdf1d1f0LU, -0x3cc7a4f3LU, 0x66065774LU, 0x88080fb0LU, 0xd2c9fc37LU, 0x1914bf75LU, 0x43d54cf2LU, 0xaddb1436LU, 0xf71ae7b1LU, -0xe2b7fe30LU, 0xb8760db7LU, 0x56785573LU, 0x0cb9a6f4LU, 0xc764e5b6LU, 0x9da51631LU, 0x73ab4ef5LU, 0x296abd72LU, -0xa85cc871LU, 0xf29d3bf6LU, 0x1c936332LU, 0x465290b5LU, 0x8d8fd3f7LU, 0xd74e2070LU, 0x394078b4LU, 0x63818b33LU }; +0xe566139aLU, 0xbfa7e01dLU, 0x51a9b8d9LU, 0x0b684b5eLU, 0xc0b5081cLU, 0x9a74fb9bLU, 0x747aa35fLU, 0x2ebb50d8LU, +0x3b164959LU, 0x61d7badeLU, 0x8fd9e21aLU, 0xd518119dLU, 0x1ec552dfLU, 0x4404a158LU, 0xaa0af99cLU, 0xf0cb0a1bLU, +0x71fd7f18LU, 0x2b3c8c9fLU, 0xc532d45bLU, 0x9ff327dcLU, 0x542e649eLU, 0x0eef9719LU, 0xe0e1cfddLU, 0xba203c5aLU, +0xd9a1b769LU, 0x836044eeLU, 0x6d6e1c2aLU, 0x37afefadLU, 0xfc72acefLU, 0xa6b35f68LU, 0x48bd07acLU, 0x127cf42bLU, +0x934a8128LU, 0xc98b72afLU, 0x27852a6bLU, 0x7d44d9ecLU, 0xb6999aaeLU, 0xec586929LU, 0x025631edLU, 0x5897c26aLU, +0x4d3adbebLU, 0x17fb286cLU, 0xf9f570a8LU, 0xa334832fLU, 0x68e9c06dLU, 0x322833eaLU, 0xdc266b2eLU, 0x86e798a9LU, +0x07d1edaaLU, 0x5d101e2dLU, 0xb31e46e9LU, 0xe9dfb56eLU, 0x2202f62cLU, 0x78c305abLU, 0x96cd5d6fLU, 0xcc0caee8LU, +0xbcda6f20LU, 0xe61b9ca7LU, 0x0815c463LU, 0x52d437e4LU, 0x990974a6LU, 0xc3c88721LU, 0x2dc6dfe5LU, 0x77072c62LU, +0xf6315961LU, 0xacf0aae6LU, 0x42fef222LU, 0x183f01a5LU, 0xd3e242e7LU, 0x8923b160LU, 0x672de9a4LU, 0x3dec1a23LU, +0x284103a2LU, 0x7280f025LU, 0x9c8ea8e1LU, 0xc64f5b66LU, 0x0d921824LU, 0x5753eba3LU, 0xb95db367LU, 0xe39c40e0LU, +0x62aa35e3LU, 0x386bc664LU, 0xd6659ea0LU, 0x8ca46d27LU, 0x47792e65LU, 0x1db8dde2LU, 0xf3b68526LU, 0xa97776a1LU, +0x13574afbLU, 0x4996b97cLU, 0xa798e1b8LU, 0xfd59123fLU, 0x3684517dLU, 0x6c45a2faLU, 0x824bfa3eLU, 0xd88a09b9LU, +0x59bc7cbaLU, 0x037d8f3dLU, 0xed73d7f9LU, 0xb7b2247eLU, 0x7c6f673cLU, 0x26ae94bbLU, 0xc8a0cc7fLU, 0x92613ff8LU, +0x87cc2679LU, 0xdd0dd5feLU, 0x33038d3aLU, 0x69c27ebdLU, 0xa21f3dffLU, 0xf8dece78LU, 0x16d096bcLU, 0x4c11653bLU, +0xcd271038LU, 0x97e6e3bfLU, 0x79e8bb7bLU, 0x232948fcLU, 0xe8f40bbeLU, 0xb235f839LU, 0x5c3ba0fdLU, 0x06fa537aLU, +0x762c92b2LU, 0x2ced6135LU, 0xc2e339f1LU, 0x9822ca76LU, 0x53ff8934LU, 0x093e7ab3LU, 0xe7302277LU, 0xbdf1d1f0LU, +0x3cc7a4f3LU, 0x66065774LU, 0x88080fb0LU, 0xd2c9fc37LU, 0x1914bf75LU, 0x43d54cf2LU, 0xaddb1436LU, 0xf71ae7b1LU, +0xe2b7fe30LU, 0xb8760db7LU, 0x56785573LU, 0x0cb9a6f4LU, 0xc764e5b6LU, 0x9da51631LU, 0x73ab4ef5LU, 0x296abd72LU, +0xa85cc871LU, 0xf29d3bf6LU, 0x1c936332LU, 0x465290b5LU, 0x8d8fd3f7LU, 0xd74e2070LU, 0x394078b4LU, 0x63818b33LU }; static const ulong32 rs_tab4[256] = { -0x00000000LU, 0x58471e5aLU, 0xb08e3cb4LU, 0xe8c922eeLU, 0x2d517825LU, 0x7516667fLU, 0x9ddf4491LU, 0xc5985acbLU, -0x5aa2f04aLU, 0x02e5ee10LU, 0xea2cccfeLU, 0xb26bd2a4LU, 0x77f3886fLU, 0x2fb49635LU, 0xc77db4dbLU, 0x9f3aaa81LU, -0xb409ad94LU, 0xec4eb3ceLU, 0x04879120LU, 0x5cc08f7aLU, 0x9958d5b1LU, 0xc11fcbebLU, 0x29d6e905LU, 0x7191f75fLU, -0xeeab5ddeLU, 0xb6ec4384LU, 0x5e25616aLU, 0x06627f30LU, 0xc3fa25fbLU, 0x9bbd3ba1LU, 0x7374194fLU, 0x2b330715LU, -0x25121765LU, 0x7d55093fLU, 0x959c2bd1LU, 0xcddb358bLU, 0x08436f40LU, 0x5004711aLU, 0xb8cd53f4LU, 0xe08a4daeLU, -0x7fb0e72fLU, 0x27f7f975LU, 0xcf3edb9bLU, 0x9779c5c1LU, 0x52e19f0aLU, 0x0aa68150LU, 0xe26fa3beLU, 0xba28bde4LU, -0x911bbaf1LU, 0xc95ca4abLU, 0x21958645LU, 0x79d2981fLU, 0xbc4ac2d4LU, 0xe40ddc8eLU, 0x0cc4fe60LU, 0x5483e03aLU, -0xcbb94abbLU, 0x93fe54e1LU, 0x7b37760fLU, 0x23706855LU, 0xe6e8329eLU, 0xbeaf2cc4LU, 0x56660e2aLU, 0x0e211070LU, -0x4a242ecaLU, 0x12633090LU, 0xfaaa127eLU, 0xa2ed0c24LU, 0x677556efLU, 0x3f3248b5LU, 0xd7fb6a5bLU, 0x8fbc7401LU, -0x1086de80LU, 0x48c1c0daLU, 0xa008e234LU, 0xf84ffc6eLU, 0x3dd7a6a5LU, 0x6590b8ffLU, 0x8d599a11LU, 0xd51e844bLU, -0xfe2d835eLU, 0xa66a9d04LU, 0x4ea3bfeaLU, 0x16e4a1b0LU, 0xd37cfb7bLU, 0x8b3be521LU, 0x63f2c7cfLU, 0x3bb5d995LU, -0xa48f7314LU, 0xfcc86d4eLU, 0x14014fa0LU, 0x4c4651faLU, 0x89de0b31LU, 0xd199156bLU, 0x39503785LU, 0x611729dfLU, -0x6f3639afLU, 0x377127f5LU, 0xdfb8051bLU, 0x87ff1b41LU, 0x4267418aLU, 0x1a205fd0LU, 0xf2e97d3eLU, 0xaaae6364LU, -0x3594c9e5LU, 0x6dd3d7bfLU, 0x851af551LU, 0xdd5deb0bLU, 0x18c5b1c0LU, 0x4082af9aLU, 0xa84b8d74LU, 0xf00c932eLU, -0xdb3f943bLU, 0x83788a61LU, 0x6bb1a88fLU, 0x33f6b6d5LU, 0xf66eec1eLU, 0xae29f244LU, 0x46e0d0aaLU, 0x1ea7cef0LU, -0x819d6471LU, 0xd9da7a2bLU, 0x311358c5LU, 0x6954469fLU, 0xaccc1c54LU, 0xf48b020eLU, 0x1c4220e0LU, 0x44053ebaLU, -0x94485cd9LU, 0xcc0f4283LU, 0x24c6606dLU, 0x7c817e37LU, 0xb91924fcLU, 0xe15e3aa6LU, 0x09971848LU, 0x51d00612LU, -0xceeaac93LU, 0x96adb2c9LU, 0x7e649027LU, 0x26238e7dLU, 0xe3bbd4b6LU, 0xbbfccaecLU, 0x5335e802LU, 0x0b72f658LU, -0x2041f14dLU, 0x7806ef17LU, 0x90cfcdf9LU, 0xc888d3a3LU, 0x0d108968LU, 0x55579732LU, 0xbd9eb5dcLU, 0xe5d9ab86LU, -0x7ae30107LU, 0x22a41f5dLU, 0xca6d3db3LU, 0x922a23e9LU, 0x57b27922LU, 0x0ff56778LU, 0xe73c4596LU, 0xbf7b5bccLU, -0xb15a4bbcLU, 0xe91d55e6LU, 0x01d47708LU, 0x59936952LU, 0x9c0b3399LU, 0xc44c2dc3LU, 0x2c850f2dLU, 0x74c21177LU, -0xebf8bbf6LU, 0xb3bfa5acLU, 0x5b768742LU, 0x03319918LU, 0xc6a9c3d3LU, 0x9eeedd89LU, 0x7627ff67LU, 0x2e60e13dLU, -0x0553e628LU, 0x5d14f872LU, 0xb5ddda9cLU, 0xed9ac4c6LU, 0x28029e0dLU, 0x70458057LU, 0x988ca2b9LU, 0xc0cbbce3LU, -0x5ff11662LU, 0x07b60838LU, 0xef7f2ad6LU, 0xb738348cLU, 0x72a06e47LU, 0x2ae7701dLU, 0xc22e52f3LU, 0x9a694ca9LU, -0xde6c7213LU, 0x862b6c49LU, 0x6ee24ea7LU, 0x36a550fdLU, 0xf33d0a36LU, 0xab7a146cLU, 0x43b33682LU, 0x1bf428d8LU, +0x00000000LU, 0x58471e5aLU, 0xb08e3cb4LU, 0xe8c922eeLU, 0x2d517825LU, 0x7516667fLU, 0x9ddf4491LU, 0xc5985acbLU, +0x5aa2f04aLU, 0x02e5ee10LU, 0xea2cccfeLU, 0xb26bd2a4LU, 0x77f3886fLU, 0x2fb49635LU, 0xc77db4dbLU, 0x9f3aaa81LU, +0xb409ad94LU, 0xec4eb3ceLU, 0x04879120LU, 0x5cc08f7aLU, 0x9958d5b1LU, 0xc11fcbebLU, 0x29d6e905LU, 0x7191f75fLU, +0xeeab5ddeLU, 0xb6ec4384LU, 0x5e25616aLU, 0x06627f30LU, 0xc3fa25fbLU, 0x9bbd3ba1LU, 0x7374194fLU, 0x2b330715LU, +0x25121765LU, 0x7d55093fLU, 0x959c2bd1LU, 0xcddb358bLU, 0x08436f40LU, 0x5004711aLU, 0xb8cd53f4LU, 0xe08a4daeLU, +0x7fb0e72fLU, 0x27f7f975LU, 0xcf3edb9bLU, 0x9779c5c1LU, 0x52e19f0aLU, 0x0aa68150LU, 0xe26fa3beLU, 0xba28bde4LU, +0x911bbaf1LU, 0xc95ca4abLU, 0x21958645LU, 0x79d2981fLU, 0xbc4ac2d4LU, 0xe40ddc8eLU, 0x0cc4fe60LU, 0x5483e03aLU, +0xcbb94abbLU, 0x93fe54e1LU, 0x7b37760fLU, 0x23706855LU, 0xe6e8329eLU, 0xbeaf2cc4LU, 0x56660e2aLU, 0x0e211070LU, +0x4a242ecaLU, 0x12633090LU, 0xfaaa127eLU, 0xa2ed0c24LU, 0x677556efLU, 0x3f3248b5LU, 0xd7fb6a5bLU, 0x8fbc7401LU, +0x1086de80LU, 0x48c1c0daLU, 0xa008e234LU, 0xf84ffc6eLU, 0x3dd7a6a5LU, 0x6590b8ffLU, 0x8d599a11LU, 0xd51e844bLU, +0xfe2d835eLU, 0xa66a9d04LU, 0x4ea3bfeaLU, 0x16e4a1b0LU, 0xd37cfb7bLU, 0x8b3be521LU, 0x63f2c7cfLU, 0x3bb5d995LU, +0xa48f7314LU, 0xfcc86d4eLU, 0x14014fa0LU, 0x4c4651faLU, 0x89de0b31LU, 0xd199156bLU, 0x39503785LU, 0x611729dfLU, +0x6f3639afLU, 0x377127f5LU, 0xdfb8051bLU, 0x87ff1b41LU, 0x4267418aLU, 0x1a205fd0LU, 0xf2e97d3eLU, 0xaaae6364LU, +0x3594c9e5LU, 0x6dd3d7bfLU, 0x851af551LU, 0xdd5deb0bLU, 0x18c5b1c0LU, 0x4082af9aLU, 0xa84b8d74LU, 0xf00c932eLU, +0xdb3f943bLU, 0x83788a61LU, 0x6bb1a88fLU, 0x33f6b6d5LU, 0xf66eec1eLU, 0xae29f244LU, 0x46e0d0aaLU, 0x1ea7cef0LU, +0x819d6471LU, 0xd9da7a2bLU, 0x311358c5LU, 0x6954469fLU, 0xaccc1c54LU, 0xf48b020eLU, 0x1c4220e0LU, 0x44053ebaLU, +0x94485cd9LU, 0xcc0f4283LU, 0x24c6606dLU, 0x7c817e37LU, 0xb91924fcLU, 0xe15e3aa6LU, 0x09971848LU, 0x51d00612LU, +0xceeaac93LU, 0x96adb2c9LU, 0x7e649027LU, 0x26238e7dLU, 0xe3bbd4b6LU, 0xbbfccaecLU, 0x5335e802LU, 0x0b72f658LU, +0x2041f14dLU, 0x7806ef17LU, 0x90cfcdf9LU, 0xc888d3a3LU, 0x0d108968LU, 0x55579732LU, 0xbd9eb5dcLU, 0xe5d9ab86LU, +0x7ae30107LU, 0x22a41f5dLU, 0xca6d3db3LU, 0x922a23e9LU, 0x57b27922LU, 0x0ff56778LU, 0xe73c4596LU, 0xbf7b5bccLU, +0xb15a4bbcLU, 0xe91d55e6LU, 0x01d47708LU, 0x59936952LU, 0x9c0b3399LU, 0xc44c2dc3LU, 0x2c850f2dLU, 0x74c21177LU, +0xebf8bbf6LU, 0xb3bfa5acLU, 0x5b768742LU, 0x03319918LU, 0xc6a9c3d3LU, 0x9eeedd89LU, 0x7627ff67LU, 0x2e60e13dLU, +0x0553e628LU, 0x5d14f872LU, 0xb5ddda9cLU, 0xed9ac4c6LU, 0x28029e0dLU, 0x70458057LU, 0x988ca2b9LU, 0xc0cbbce3LU, +0x5ff11662LU, 0x07b60838LU, 0xef7f2ad6LU, 0xb738348cLU, 0x72a06e47LU, 0x2ae7701dLU, 0xc22e52f3LU, 0x9a694ca9LU, +0xde6c7213LU, 0x862b6c49LU, 0x6ee24ea7LU, 0x36a550fdLU, 0xf33d0a36LU, 0xab7a146cLU, 0x43b33682LU, 0x1bf428d8LU, 0x84ce8259LU, 0xdc899c03LU, 0x3440beedLU, 0x6c07a0b7LU, 0xa99ffa7cLU, 0xf1d8e426LU, 0x1911c6c8LU, 0x4156d892LU, -0x6a65df87LU, 0x3222c1ddLU, 0xdaebe333LU, 0x82acfd69LU, 0x4734a7a2LU, 0x1f73b9f8LU, 0xf7ba9b16LU, 0xaffd854cLU, -0x30c72fcdLU, 0x68803197LU, 0x80491379LU, 0xd80e0d23LU, 0x1d9657e8LU, 0x45d149b2LU, 0xad186b5cLU, 0xf55f7506LU, -0xfb7e6576LU, 0xa3397b2cLU, 0x4bf059c2LU, 0x13b74798LU, 0xd62f1d53LU, 0x8e680309LU, 0x66a121e7LU, 0x3ee63fbdLU, -0xa1dc953cLU, 0xf99b8b66LU, 0x1152a988LU, 0x4915b7d2LU, 0x8c8ded19LU, 0xd4caf343LU, 0x3c03d1adLU, 0x6444cff7LU, -0x4f77c8e2LU, 0x1730d6b8LU, 0xfff9f456LU, 0xa7beea0cLU, 0x6226b0c7LU, 0x3a61ae9dLU, 0xd2a88c73LU, 0x8aef9229LU, +0x6a65df87LU, 0x3222c1ddLU, 0xdaebe333LU, 0x82acfd69LU, 0x4734a7a2LU, 0x1f73b9f8LU, 0xf7ba9b16LU, 0xaffd854cLU, +0x30c72fcdLU, 0x68803197LU, 0x80491379LU, 0xd80e0d23LU, 0x1d9657e8LU, 0x45d149b2LU, 0xad186b5cLU, 0xf55f7506LU, +0xfb7e6576LU, 0xa3397b2cLU, 0x4bf059c2LU, 0x13b74798LU, 0xd62f1d53LU, 0x8e680309LU, 0x66a121e7LU, 0x3ee63fbdLU, +0xa1dc953cLU, 0xf99b8b66LU, 0x1152a988LU, 0x4915b7d2LU, 0x8c8ded19LU, 0xd4caf343LU, 0x3c03d1adLU, 0x6444cff7LU, +0x4f77c8e2LU, 0x1730d6b8LU, 0xfff9f456LU, 0xa7beea0cLU, 0x6226b0c7LU, 0x3a61ae9dLU, 0xd2a88c73LU, 0x8aef9229LU, 0x15d538a8LU, 0x4d9226f2LU, 0xa55b041cLU, 0xfd1c1a46LU, 0x3884408dLU, 0x60c35ed7LU, 0x880a7c39LU, 0xd04d6263LU }; static const ulong32 rs_tab5[256] = { -0x00000000LU, 0xdbaec658LU, 0xfb11c1b0LU, 0x20bf07e8LU, 0xbb22cf2dLU, 0x608c0975LU, 0x40330e9dLU, 0x9b9dc8c5LU, -0x3b44d35aLU, 0xe0ea1502LU, 0xc05512eaLU, 0x1bfbd4b2LU, 0x80661c77LU, 0x5bc8da2fLU, 0x7b77ddc7LU, 0xa0d91b9fLU, -0x7688ebb4LU, 0xad262decLU, 0x8d992a04LU, 0x5637ec5cLU, 0xcdaa2499LU, 0x1604e2c1LU, 0x36bbe529LU, 0xed152371LU, -0x4dcc38eeLU, 0x9662feb6LU, 0xb6ddf95eLU, 0x6d733f06LU, 0xf6eef7c3LU, 0x2d40319bLU, 0x0dff3673LU, 0xd651f02bLU, -0xec5d9b25LU, 0x37f35d7dLU, 0x174c5a95LU, 0xcce29ccdLU, 0x577f5408LU, 0x8cd19250LU, 0xac6e95b8LU, 0x77c053e0LU, -0xd719487fLU, 0x0cb78e27LU, 0x2c0889cfLU, 0xf7a64f97LU, 0x6c3b8752LU, 0xb795410aLU, 0x972a46e2LU, 0x4c8480baLU, -0x9ad57091LU, 0x417bb6c9LU, 0x61c4b121LU, 0xba6a7779LU, 0x21f7bfbcLU, 0xfa5979e4LU, 0xdae67e0cLU, 0x0148b854LU, -0xa191a3cbLU, 0x7a3f6593LU, 0x5a80627bLU, 0x812ea423LU, 0x1ab36ce6LU, 0xc11daabeLU, 0xe1a2ad56LU, 0x3a0c6b0eLU, -0x95ba7b4aLU, 0x4e14bd12LU, 0x6eabbafaLU, 0xb5057ca2LU, 0x2e98b467LU, 0xf536723fLU, 0xd58975d7LU, 0x0e27b38fLU, -0xaefea810LU, 0x75506e48LU, 0x55ef69a0LU, 0x8e41aff8LU, 0x15dc673dLU, 0xce72a165LU, 0xeecda68dLU, 0x356360d5LU, -0xe33290feLU, 0x389c56a6LU, 0x1823514eLU, 0xc38d9716LU, 0x58105fd3LU, 0x83be998bLU, 0xa3019e63LU, 0x78af583bLU, -0xd87643a4LU, 0x03d885fcLU, 0x23678214LU, 0xf8c9444cLU, 0x63548c89LU, 0xb8fa4ad1LU, 0x98454d39LU, 0x43eb8b61LU, -0x79e7e06fLU, 0xa2492637LU, 0x82f621dfLU, 0x5958e787LU, 0xc2c52f42LU, 0x196be91aLU, 0x39d4eef2LU, 0xe27a28aaLU, -0x42a33335LU, 0x990df56dLU, 0xb9b2f285LU, 0x621c34ddLU, 0xf981fc18LU, 0x222f3a40LU, 0x02903da8LU, 0xd93efbf0LU, -0x0f6f0bdbLU, 0xd4c1cd83LU, 0xf47eca6bLU, 0x2fd00c33LU, 0xb44dc4f6LU, 0x6fe302aeLU, 0x4f5c0546LU, 0x94f2c31eLU, -0x342bd881LU, 0xef851ed9LU, 0xcf3a1931LU, 0x1494df69LU, 0x8f0917acLU, 0x54a7d1f4LU, 0x7418d61cLU, 0xafb61044LU, -0x6739f694LU, 0xbc9730ccLU, 0x9c283724LU, 0x4786f17cLU, 0xdc1b39b9LU, 0x07b5ffe1LU, 0x270af809LU, 0xfca43e51LU, -0x5c7d25ceLU, 0x87d3e396LU, 0xa76ce47eLU, 0x7cc22226LU, 0xe75feae3LU, 0x3cf12cbbLU, 0x1c4e2b53LU, 0xc7e0ed0bLU, -0x11b11d20LU, 0xca1fdb78LU, 0xeaa0dc90LU, 0x310e1ac8LU, 0xaa93d20dLU, 0x713d1455LU, 0x518213bdLU, 0x8a2cd5e5LU, -0x2af5ce7aLU, 0xf15b0822LU, 0xd1e40fcaLU, 0x0a4ac992LU, 0x91d70157LU, 0x4a79c70fLU, 0x6ac6c0e7LU, 0xb16806bfLU, -0x8b646db1LU, 0x50caabe9LU, 0x7075ac01LU, 0xabdb6a59LU, 0x3046a29cLU, 0xebe864c4LU, 0xcb57632cLU, 0x10f9a574LU, -0xb020beebLU, 0x6b8e78b3LU, 0x4b317f5bLU, 0x909fb903LU, 0x0b0271c6LU, 0xd0acb79eLU, 0xf013b076LU, 0x2bbd762eLU, -0xfdec8605LU, 0x2642405dLU, 0x06fd47b5LU, 0xdd5381edLU, 0x46ce4928LU, 0x9d608f70LU, 0xbddf8898LU, 0x66714ec0LU, -0xc6a8555fLU, 0x1d069307LU, 0x3db994efLU, 0xe61752b7LU, 0x7d8a9a72LU, 0xa6245c2aLU, 0x869b5bc2LU, 0x5d359d9aLU, -0xf2838ddeLU, 0x292d4b86LU, 0x09924c6eLU, 0xd23c8a36LU, 0x49a142f3LU, 0x920f84abLU, 0xb2b08343LU, 0x691e451bLU, -0xc9c75e84LU, 0x126998dcLU, 0x32d69f34LU, 0xe978596cLU, 0x72e591a9LU, 0xa94b57f1LU, 0x89f45019LU, 0x525a9641LU, -0x840b666aLU, 0x5fa5a032LU, 0x7f1aa7daLU, 0xa4b46182LU, 0x3f29a947LU, 0xe4876f1fLU, 0xc43868f7LU, 0x1f96aeafLU, -0xbf4fb530LU, 0x64e17368LU, 0x445e7480LU, 0x9ff0b2d8LU, 0x046d7a1dLU, 0xdfc3bc45LU, 0xff7cbbadLU, 0x24d27df5LU, -0x1ede16fbLU, 0xc570d0a3LU, 0xe5cfd74bLU, 0x3e611113LU, 0xa5fcd9d6LU, 0x7e521f8eLU, 0x5eed1866LU, 0x8543de3eLU, -0x259ac5a1LU, 0xfe3403f9LU, 0xde8b0411LU, 0x0525c249LU, 0x9eb80a8cLU, 0x4516ccd4LU, 0x65a9cb3cLU, 0xbe070d64LU, -0x6856fd4fLU, 0xb3f83b17LU, 0x93473cffLU, 0x48e9faa7LU, 0xd3743262LU, 0x08daf43aLU, 0x2865f3d2LU, 0xf3cb358aLU, -0x53122e15LU, 0x88bce84dLU, 0xa803efa5LU, 0x73ad29fdLU, 0xe830e138LU, 0x339e2760LU, 0x13212088LU, 0xc88fe6d0LU }; +0x00000000LU, 0xdbaec658LU, 0xfb11c1b0LU, 0x20bf07e8LU, 0xbb22cf2dLU, 0x608c0975LU, 0x40330e9dLU, 0x9b9dc8c5LU, +0x3b44d35aLU, 0xe0ea1502LU, 0xc05512eaLU, 0x1bfbd4b2LU, 0x80661c77LU, 0x5bc8da2fLU, 0x7b77ddc7LU, 0xa0d91b9fLU, +0x7688ebb4LU, 0xad262decLU, 0x8d992a04LU, 0x5637ec5cLU, 0xcdaa2499LU, 0x1604e2c1LU, 0x36bbe529LU, 0xed152371LU, +0x4dcc38eeLU, 0x9662feb6LU, 0xb6ddf95eLU, 0x6d733f06LU, 0xf6eef7c3LU, 0x2d40319bLU, 0x0dff3673LU, 0xd651f02bLU, +0xec5d9b25LU, 0x37f35d7dLU, 0x174c5a95LU, 0xcce29ccdLU, 0x577f5408LU, 0x8cd19250LU, 0xac6e95b8LU, 0x77c053e0LU, +0xd719487fLU, 0x0cb78e27LU, 0x2c0889cfLU, 0xf7a64f97LU, 0x6c3b8752LU, 0xb795410aLU, 0x972a46e2LU, 0x4c8480baLU, +0x9ad57091LU, 0x417bb6c9LU, 0x61c4b121LU, 0xba6a7779LU, 0x21f7bfbcLU, 0xfa5979e4LU, 0xdae67e0cLU, 0x0148b854LU, +0xa191a3cbLU, 0x7a3f6593LU, 0x5a80627bLU, 0x812ea423LU, 0x1ab36ce6LU, 0xc11daabeLU, 0xe1a2ad56LU, 0x3a0c6b0eLU, +0x95ba7b4aLU, 0x4e14bd12LU, 0x6eabbafaLU, 0xb5057ca2LU, 0x2e98b467LU, 0xf536723fLU, 0xd58975d7LU, 0x0e27b38fLU, +0xaefea810LU, 0x75506e48LU, 0x55ef69a0LU, 0x8e41aff8LU, 0x15dc673dLU, 0xce72a165LU, 0xeecda68dLU, 0x356360d5LU, +0xe33290feLU, 0x389c56a6LU, 0x1823514eLU, 0xc38d9716LU, 0x58105fd3LU, 0x83be998bLU, 0xa3019e63LU, 0x78af583bLU, +0xd87643a4LU, 0x03d885fcLU, 0x23678214LU, 0xf8c9444cLU, 0x63548c89LU, 0xb8fa4ad1LU, 0x98454d39LU, 0x43eb8b61LU, +0x79e7e06fLU, 0xa2492637LU, 0x82f621dfLU, 0x5958e787LU, 0xc2c52f42LU, 0x196be91aLU, 0x39d4eef2LU, 0xe27a28aaLU, +0x42a33335LU, 0x990df56dLU, 0xb9b2f285LU, 0x621c34ddLU, 0xf981fc18LU, 0x222f3a40LU, 0x02903da8LU, 0xd93efbf0LU, +0x0f6f0bdbLU, 0xd4c1cd83LU, 0xf47eca6bLU, 0x2fd00c33LU, 0xb44dc4f6LU, 0x6fe302aeLU, 0x4f5c0546LU, 0x94f2c31eLU, +0x342bd881LU, 0xef851ed9LU, 0xcf3a1931LU, 0x1494df69LU, 0x8f0917acLU, 0x54a7d1f4LU, 0x7418d61cLU, 0xafb61044LU, +0x6739f694LU, 0xbc9730ccLU, 0x9c283724LU, 0x4786f17cLU, 0xdc1b39b9LU, 0x07b5ffe1LU, 0x270af809LU, 0xfca43e51LU, +0x5c7d25ceLU, 0x87d3e396LU, 0xa76ce47eLU, 0x7cc22226LU, 0xe75feae3LU, 0x3cf12cbbLU, 0x1c4e2b53LU, 0xc7e0ed0bLU, +0x11b11d20LU, 0xca1fdb78LU, 0xeaa0dc90LU, 0x310e1ac8LU, 0xaa93d20dLU, 0x713d1455LU, 0x518213bdLU, 0x8a2cd5e5LU, +0x2af5ce7aLU, 0xf15b0822LU, 0xd1e40fcaLU, 0x0a4ac992LU, 0x91d70157LU, 0x4a79c70fLU, 0x6ac6c0e7LU, 0xb16806bfLU, +0x8b646db1LU, 0x50caabe9LU, 0x7075ac01LU, 0xabdb6a59LU, 0x3046a29cLU, 0xebe864c4LU, 0xcb57632cLU, 0x10f9a574LU, +0xb020beebLU, 0x6b8e78b3LU, 0x4b317f5bLU, 0x909fb903LU, 0x0b0271c6LU, 0xd0acb79eLU, 0xf013b076LU, 0x2bbd762eLU, +0xfdec8605LU, 0x2642405dLU, 0x06fd47b5LU, 0xdd5381edLU, 0x46ce4928LU, 0x9d608f70LU, 0xbddf8898LU, 0x66714ec0LU, +0xc6a8555fLU, 0x1d069307LU, 0x3db994efLU, 0xe61752b7LU, 0x7d8a9a72LU, 0xa6245c2aLU, 0x869b5bc2LU, 0x5d359d9aLU, +0xf2838ddeLU, 0x292d4b86LU, 0x09924c6eLU, 0xd23c8a36LU, 0x49a142f3LU, 0x920f84abLU, 0xb2b08343LU, 0x691e451bLU, +0xc9c75e84LU, 0x126998dcLU, 0x32d69f34LU, 0xe978596cLU, 0x72e591a9LU, 0xa94b57f1LU, 0x89f45019LU, 0x525a9641LU, +0x840b666aLU, 0x5fa5a032LU, 0x7f1aa7daLU, 0xa4b46182LU, 0x3f29a947LU, 0xe4876f1fLU, 0xc43868f7LU, 0x1f96aeafLU, +0xbf4fb530LU, 0x64e17368LU, 0x445e7480LU, 0x9ff0b2d8LU, 0x046d7a1dLU, 0xdfc3bc45LU, 0xff7cbbadLU, 0x24d27df5LU, +0x1ede16fbLU, 0xc570d0a3LU, 0xe5cfd74bLU, 0x3e611113LU, 0xa5fcd9d6LU, 0x7e521f8eLU, 0x5eed1866LU, 0x8543de3eLU, +0x259ac5a1LU, 0xfe3403f9LU, 0xde8b0411LU, 0x0525c249LU, 0x9eb80a8cLU, 0x4516ccd4LU, 0x65a9cb3cLU, 0xbe070d64LU, +0x6856fd4fLU, 0xb3f83b17LU, 0x93473cffLU, 0x48e9faa7LU, 0xd3743262LU, 0x08daf43aLU, 0x2865f3d2LU, 0xf3cb358aLU, +0x53122e15LU, 0x88bce84dLU, 0xa803efa5LU, 0x73ad29fdLU, 0xe830e138LU, 0x339e2760LU, 0x13212088LU, 0xc88fe6d0LU }; static const ulong32 rs_tab6[256] = { -0x00000000LU, 0x9e3d68dbLU, 0x717ad0fbLU, 0xef47b820LU, 0xe2f4edbbLU, 0x7cc98560LU, 0x938e3d40LU, 0x0db3559bLU, -0x89a5973bLU, 0x1798ffe0LU, 0xf8df47c0LU, 0x66e22f1bLU, 0x6b517a80LU, 0xf56c125bLU, 0x1a2baa7bLU, 0x8416c2a0LU, -0x5f076376LU, 0xc13a0badLU, 0x2e7db38dLU, 0xb040db56LU, 0xbdf38ecdLU, 0x23cee616LU, 0xcc895e36LU, 0x52b436edLU, -0xd6a2f44dLU, 0x489f9c96LU, 0xa7d824b6LU, 0x39e54c6dLU, 0x345619f6LU, 0xaa6b712dLU, 0x452cc90dLU, 0xdb11a1d6LU, -0xbe0ec6ecLU, 0x2033ae37LU, 0xcf741617LU, 0x51497eccLU, 0x5cfa2b57LU, 0xc2c7438cLU, 0x2d80fbacLU, 0xb3bd9377LU, -0x37ab51d7LU, 0xa996390cLU, 0x46d1812cLU, 0xd8ece9f7LU, 0xd55fbc6cLU, 0x4b62d4b7LU, 0xa4256c97LU, 0x3a18044cLU, -0xe109a59aLU, 0x7f34cd41LU, 0x90737561LU, 0x0e4e1dbaLU, 0x03fd4821LU, 0x9dc020faLU, 0x728798daLU, 0xecbaf001LU, -0x68ac32a1LU, 0xf6915a7aLU, 0x19d6e25aLU, 0x87eb8a81LU, 0x8a58df1aLU, 0x1465b7c1LU, 0xfb220fe1LU, 0x651f673aLU, -0x311cc195LU, 0xaf21a94eLU, 0x4066116eLU, 0xde5b79b5LU, 0xd3e82c2eLU, 0x4dd544f5LU, 0xa292fcd5LU, 0x3caf940eLU, -0xb8b956aeLU, 0x26843e75LU, 0xc9c38655LU, 0x57feee8eLU, 0x5a4dbb15LU, 0xc470d3ceLU, 0x2b376beeLU, 0xb50a0335LU, -0x6e1ba2e3LU, 0xf026ca38LU, 0x1f617218LU, 0x815c1ac3LU, 0x8cef4f58LU, 0x12d22783LU, 0xfd959fa3LU, 0x63a8f778LU, -0xe7be35d8LU, 0x79835d03LU, 0x96c4e523LU, 0x08f98df8LU, 0x054ad863LU, 0x9b77b0b8LU, 0x74300898LU, 0xea0d6043LU, -0x8f120779LU, 0x112f6fa2LU, 0xfe68d782LU, 0x6055bf59LU, 0x6de6eac2LU, 0xf3db8219LU, 0x1c9c3a39LU, 0x82a152e2LU, +0x00000000LU, 0x9e3d68dbLU, 0x717ad0fbLU, 0xef47b820LU, 0xe2f4edbbLU, 0x7cc98560LU, 0x938e3d40LU, 0x0db3559bLU, +0x89a5973bLU, 0x1798ffe0LU, 0xf8df47c0LU, 0x66e22f1bLU, 0x6b517a80LU, 0xf56c125bLU, 0x1a2baa7bLU, 0x8416c2a0LU, +0x5f076376LU, 0xc13a0badLU, 0x2e7db38dLU, 0xb040db56LU, 0xbdf38ecdLU, 0x23cee616LU, 0xcc895e36LU, 0x52b436edLU, +0xd6a2f44dLU, 0x489f9c96LU, 0xa7d824b6LU, 0x39e54c6dLU, 0x345619f6LU, 0xaa6b712dLU, 0x452cc90dLU, 0xdb11a1d6LU, +0xbe0ec6ecLU, 0x2033ae37LU, 0xcf741617LU, 0x51497eccLU, 0x5cfa2b57LU, 0xc2c7438cLU, 0x2d80fbacLU, 0xb3bd9377LU, +0x37ab51d7LU, 0xa996390cLU, 0x46d1812cLU, 0xd8ece9f7LU, 0xd55fbc6cLU, 0x4b62d4b7LU, 0xa4256c97LU, 0x3a18044cLU, +0xe109a59aLU, 0x7f34cd41LU, 0x90737561LU, 0x0e4e1dbaLU, 0x03fd4821LU, 0x9dc020faLU, 0x728798daLU, 0xecbaf001LU, +0x68ac32a1LU, 0xf6915a7aLU, 0x19d6e25aLU, 0x87eb8a81LU, 0x8a58df1aLU, 0x1465b7c1LU, 0xfb220fe1LU, 0x651f673aLU, +0x311cc195LU, 0xaf21a94eLU, 0x4066116eLU, 0xde5b79b5LU, 0xd3e82c2eLU, 0x4dd544f5LU, 0xa292fcd5LU, 0x3caf940eLU, +0xb8b956aeLU, 0x26843e75LU, 0xc9c38655LU, 0x57feee8eLU, 0x5a4dbb15LU, 0xc470d3ceLU, 0x2b376beeLU, 0xb50a0335LU, +0x6e1ba2e3LU, 0xf026ca38LU, 0x1f617218LU, 0x815c1ac3LU, 0x8cef4f58LU, 0x12d22783LU, 0xfd959fa3LU, 0x63a8f778LU, +0xe7be35d8LU, 0x79835d03LU, 0x96c4e523LU, 0x08f98df8LU, 0x054ad863LU, 0x9b77b0b8LU, 0x74300898LU, 0xea0d6043LU, +0x8f120779LU, 0x112f6fa2LU, 0xfe68d782LU, 0x6055bf59LU, 0x6de6eac2LU, 0xf3db8219LU, 0x1c9c3a39LU, 0x82a152e2LU, 0x06b79042LU, 0x988af899LU, 0x77cd40b9LU, 0xe9f02862LU, 0xe4437df9LU, 0x7a7e1522LU, 0x9539ad02LU, 0x0b04c5d9LU, -0xd015640fLU, 0x4e280cd4LU, 0xa16fb4f4LU, 0x3f52dc2fLU, 0x32e189b4LU, 0xacdce16fLU, 0x439b594fLU, 0xdda63194LU, -0x59b0f334LU, 0xc78d9befLU, 0x28ca23cfLU, 0xb6f74b14LU, 0xbb441e8fLU, 0x25797654LU, 0xca3ece74LU, 0x5403a6afLU, -0x6238cf67LU, 0xfc05a7bcLU, 0x13421f9cLU, 0x8d7f7747LU, 0x80cc22dcLU, 0x1ef14a07LU, 0xf1b6f227LU, 0x6f8b9afcLU, -0xeb9d585cLU, 0x75a03087LU, 0x9ae788a7LU, 0x04dae07cLU, 0x0969b5e7LU, 0x9754dd3cLU, 0x7813651cLU, 0xe62e0dc7LU, -0x3d3fac11LU, 0xa302c4caLU, 0x4c457ceaLU, 0xd2781431LU, 0xdfcb41aaLU, 0x41f62971LU, 0xaeb19151LU, 0x308cf98aLU, +0xd015640fLU, 0x4e280cd4LU, 0xa16fb4f4LU, 0x3f52dc2fLU, 0x32e189b4LU, 0xacdce16fLU, 0x439b594fLU, 0xdda63194LU, +0x59b0f334LU, 0xc78d9befLU, 0x28ca23cfLU, 0xb6f74b14LU, 0xbb441e8fLU, 0x25797654LU, 0xca3ece74LU, 0x5403a6afLU, +0x6238cf67LU, 0xfc05a7bcLU, 0x13421f9cLU, 0x8d7f7747LU, 0x80cc22dcLU, 0x1ef14a07LU, 0xf1b6f227LU, 0x6f8b9afcLU, +0xeb9d585cLU, 0x75a03087LU, 0x9ae788a7LU, 0x04dae07cLU, 0x0969b5e7LU, 0x9754dd3cLU, 0x7813651cLU, 0xe62e0dc7LU, +0x3d3fac11LU, 0xa302c4caLU, 0x4c457ceaLU, 0xd2781431LU, 0xdfcb41aaLU, 0x41f62971LU, 0xaeb19151LU, 0x308cf98aLU, 0xb49a3b2aLU, 0x2aa753f1LU, 0xc5e0ebd1LU, 0x5bdd830aLU, 0x566ed691LU, 0xc853be4aLU, 0x2714066aLU, 0xb9296eb1LU, -0xdc36098bLU, 0x420b6150LU, 0xad4cd970LU, 0x3371b1abLU, 0x3ec2e430LU, 0xa0ff8cebLU, 0x4fb834cbLU, 0xd1855c10LU, -0x55939eb0LU, 0xcbaef66bLU, 0x24e94e4bLU, 0xbad42690LU, 0xb767730bLU, 0x295a1bd0LU, 0xc61da3f0LU, 0x5820cb2bLU, -0x83316afdLU, 0x1d0c0226LU, 0xf24bba06LU, 0x6c76d2ddLU, 0x61c58746LU, 0xfff8ef9dLU, 0x10bf57bdLU, 0x8e823f66LU, -0x0a94fdc6LU, 0x94a9951dLU, 0x7bee2d3dLU, 0xe5d345e6LU, 0xe860107dLU, 0x765d78a6LU, 0x991ac086LU, 0x0727a85dLU, -0x53240ef2LU, 0xcd196629LU, 0x225ede09LU, 0xbc63b6d2LU, 0xb1d0e349LU, 0x2fed8b92LU, 0xc0aa33b2LU, 0x5e975b69LU, -0xda8199c9LU, 0x44bcf112LU, 0xabfb4932LU, 0x35c621e9LU, 0x38757472LU, 0xa6481ca9LU, 0x490fa489LU, 0xd732cc52LU, -0x0c236d84LU, 0x921e055fLU, 0x7d59bd7fLU, 0xe364d5a4LU, 0xeed7803fLU, 0x70eae8e4LU, 0x9fad50c4LU, 0x0190381fLU, -0x8586fabfLU, 0x1bbb9264LU, 0xf4fc2a44LU, 0x6ac1429fLU, 0x67721704LU, 0xf94f7fdfLU, 0x1608c7ffLU, 0x8835af24LU, -0xed2ac81eLU, 0x7317a0c5LU, 0x9c5018e5LU, 0x026d703eLU, 0x0fde25a5LU, 0x91e34d7eLU, 0x7ea4f55eLU, 0xe0999d85LU, -0x648f5f25LU, 0xfab237feLU, 0x15f58fdeLU, 0x8bc8e705LU, 0x867bb29eLU, 0x1846da45LU, 0xf7016265LU, 0x693c0abeLU, -0xb22dab68LU, 0x2c10c3b3LU, 0xc3577b93LU, 0x5d6a1348LU, 0x50d946d3LU, 0xcee42e08LU, 0x21a39628LU, 0xbf9efef3LU, -0x3b883c53LU, 0xa5b55488LU, 0x4af2eca8LU, 0xd4cf8473LU, 0xd97cd1e8LU, 0x4741b933LU, 0xa8060113LU, 0x363b69c8LU }; +0xdc36098bLU, 0x420b6150LU, 0xad4cd970LU, 0x3371b1abLU, 0x3ec2e430LU, 0xa0ff8cebLU, 0x4fb834cbLU, 0xd1855c10LU, +0x55939eb0LU, 0xcbaef66bLU, 0x24e94e4bLU, 0xbad42690LU, 0xb767730bLU, 0x295a1bd0LU, 0xc61da3f0LU, 0x5820cb2bLU, +0x83316afdLU, 0x1d0c0226LU, 0xf24bba06LU, 0x6c76d2ddLU, 0x61c58746LU, 0xfff8ef9dLU, 0x10bf57bdLU, 0x8e823f66LU, +0x0a94fdc6LU, 0x94a9951dLU, 0x7bee2d3dLU, 0xe5d345e6LU, 0xe860107dLU, 0x765d78a6LU, 0x991ac086LU, 0x0727a85dLU, +0x53240ef2LU, 0xcd196629LU, 0x225ede09LU, 0xbc63b6d2LU, 0xb1d0e349LU, 0x2fed8b92LU, 0xc0aa33b2LU, 0x5e975b69LU, +0xda8199c9LU, 0x44bcf112LU, 0xabfb4932LU, 0x35c621e9LU, 0x38757472LU, 0xa6481ca9LU, 0x490fa489LU, 0xd732cc52LU, +0x0c236d84LU, 0x921e055fLU, 0x7d59bd7fLU, 0xe364d5a4LU, 0xeed7803fLU, 0x70eae8e4LU, 0x9fad50c4LU, 0x0190381fLU, +0x8586fabfLU, 0x1bbb9264LU, 0xf4fc2a44LU, 0x6ac1429fLU, 0x67721704LU, 0xf94f7fdfLU, 0x1608c7ffLU, 0x8835af24LU, +0xed2ac81eLU, 0x7317a0c5LU, 0x9c5018e5LU, 0x026d703eLU, 0x0fde25a5LU, 0x91e34d7eLU, 0x7ea4f55eLU, 0xe0999d85LU, +0x648f5f25LU, 0xfab237feLU, 0x15f58fdeLU, 0x8bc8e705LU, 0x867bb29eLU, 0x1846da45LU, 0xf7016265LU, 0x693c0abeLU, +0xb22dab68LU, 0x2c10c3b3LU, 0xc3577b93LU, 0x5d6a1348LU, 0x50d946d3LU, 0xcee42e08LU, 0x21a39628LU, 0xbf9efef3LU, +0x3b883c53LU, 0xa5b55488LU, 0x4af2eca8LU, 0xd4cf8473LU, 0xd97cd1e8LU, 0x4741b933LU, 0xa8060113LU, 0x363b69c8LU }; static const ulong32 rs_tab7[256] = { -0x00000000LU, 0x0319e59eLU, 0x06328771LU, 0x052b62efLU, 0x0c6443e2LU, 0x0f7da67cLU, 0x0a56c493LU, 0x094f210dLU, -0x18c88689LU, 0x1bd16317LU, 0x1efa01f8LU, 0x1de3e466LU, 0x14acc56bLU, 0x17b520f5LU, 0x129e421aLU, 0x1187a784LU, -0x30dd415fLU, 0x33c4a4c1LU, 0x36efc62eLU, 0x35f623b0LU, 0x3cb902bdLU, 0x3fa0e723LU, 0x3a8b85ccLU, 0x39926052LU, -0x2815c7d6LU, 0x2b0c2248LU, 0x2e2740a7LU, 0x2d3ea539LU, 0x24718434LU, 0x276861aaLU, 0x22430345LU, 0x215ae6dbLU, -0x60f782beLU, 0x63ee6720LU, 0x66c505cfLU, 0x65dce051LU, 0x6c93c15cLU, 0x6f8a24c2LU, 0x6aa1462dLU, 0x69b8a3b3LU, -0x783f0437LU, 0x7b26e1a9LU, 0x7e0d8346LU, 0x7d1466d8LU, 0x745b47d5LU, 0x7742a24bLU, 0x7269c0a4LU, 0x7170253aLU, -0x502ac3e1LU, 0x5333267fLU, 0x56184490LU, 0x5501a10eLU, 0x5c4e8003LU, 0x5f57659dLU, 0x5a7c0772LU, 0x5965e2ecLU, -0x48e24568LU, 0x4bfba0f6LU, 0x4ed0c219LU, 0x4dc92787LU, 0x4486068aLU, 0x479fe314LU, 0x42b481fbLU, 0x41ad6465LU, -0xc0a34931LU, 0xc3baacafLU, 0xc691ce40LU, 0xc5882bdeLU, 0xccc70ad3LU, 0xcfdeef4dLU, 0xcaf58da2LU, 0xc9ec683cLU, -0xd86bcfb8LU, 0xdb722a26LU, 0xde5948c9LU, 0xdd40ad57LU, 0xd40f8c5aLU, 0xd71669c4LU, 0xd23d0b2bLU, 0xd124eeb5LU, -0xf07e086eLU, 0xf367edf0LU, 0xf64c8f1fLU, 0xf5556a81LU, 0xfc1a4b8cLU, 0xff03ae12LU, 0xfa28ccfdLU, 0xf9312963LU, -0xe8b68ee7LU, 0xebaf6b79LU, 0xee840996LU, 0xed9dec08LU, 0xe4d2cd05LU, 0xe7cb289bLU, 0xe2e04a74LU, 0xe1f9afeaLU, -0xa054cb8fLU, 0xa34d2e11LU, 0xa6664cfeLU, 0xa57fa960LU, 0xac30886dLU, 0xaf296df3LU, 0xaa020f1cLU, 0xa91bea82LU, -0xb89c4d06LU, 0xbb85a898LU, 0xbeaeca77LU, 0xbdb72fe9LU, 0xb4f80ee4LU, 0xb7e1eb7aLU, 0xb2ca8995LU, 0xb1d36c0bLU, -0x90898ad0LU, 0x93906f4eLU, 0x96bb0da1LU, 0x95a2e83fLU, 0x9cedc932LU, 0x9ff42cacLU, 0x9adf4e43LU, 0x99c6abddLU, -0x88410c59LU, 0x8b58e9c7LU, 0x8e738b28LU, 0x8d6a6eb6LU, 0x84254fbbLU, 0x873caa25LU, 0x8217c8caLU, 0x810e2d54LU, -0xcd0b9262LU, 0xce1277fcLU, 0xcb391513LU, 0xc820f08dLU, 0xc16fd180LU, 0xc276341eLU, 0xc75d56f1LU, 0xc444b36fLU, -0xd5c314ebLU, 0xd6daf175LU, 0xd3f1939aLU, 0xd0e87604LU, 0xd9a75709LU, 0xdabeb297LU, 0xdf95d078LU, 0xdc8c35e6LU, -0xfdd6d33dLU, 0xfecf36a3LU, 0xfbe4544cLU, 0xf8fdb1d2LU, 0xf1b290dfLU, 0xf2ab7541LU, 0xf78017aeLU, 0xf499f230LU, -0xe51e55b4LU, 0xe607b02aLU, 0xe32cd2c5LU, 0xe035375bLU, 0xe97a1656LU, 0xea63f3c8LU, 0xef489127LU, 0xec5174b9LU, -0xadfc10dcLU, 0xaee5f542LU, 0xabce97adLU, 0xa8d77233LU, 0xa198533eLU, 0xa281b6a0LU, 0xa7aad44fLU, 0xa4b331d1LU, -0xb5349655LU, 0xb62d73cbLU, 0xb3061124LU, 0xb01ff4baLU, 0xb950d5b7LU, 0xba493029LU, 0xbf6252c6LU, 0xbc7bb758LU, -0x9d215183LU, 0x9e38b41dLU, 0x9b13d6f2LU, 0x980a336cLU, 0x91451261LU, 0x925cf7ffLU, 0x97779510LU, 0x946e708eLU, -0x85e9d70aLU, 0x86f03294LU, 0x83db507bLU, 0x80c2b5e5LU, 0x898d94e8LU, 0x8a947176LU, 0x8fbf1399LU, 0x8ca6f607LU, -0x0da8db53LU, 0x0eb13ecdLU, 0x0b9a5c22LU, 0x0883b9bcLU, 0x01cc98b1LU, 0x02d57d2fLU, 0x07fe1fc0LU, 0x04e7fa5eLU, -0x15605ddaLU, 0x1679b844LU, 0x1352daabLU, 0x104b3f35LU, 0x19041e38LU, 0x1a1dfba6LU, 0x1f369949LU, 0x1c2f7cd7LU, -0x3d759a0cLU, 0x3e6c7f92LU, 0x3b471d7dLU, 0x385ef8e3LU, 0x3111d9eeLU, 0x32083c70LU, 0x37235e9fLU, 0x343abb01LU, -0x25bd1c85LU, 0x26a4f91bLU, 0x238f9bf4LU, 0x20967e6aLU, 0x29d95f67LU, 0x2ac0baf9LU, 0x2febd816LU, 0x2cf23d88LU, -0x6d5f59edLU, 0x6e46bc73LU, 0x6b6dde9cLU, 0x68743b02LU, 0x613b1a0fLU, 0x6222ff91LU, 0x67099d7eLU, 0x641078e0LU, -0x7597df64LU, 0x768e3afaLU, 0x73a55815LU, 0x70bcbd8bLU, 0x79f39c86LU, 0x7aea7918LU, 0x7fc11bf7LU, 0x7cd8fe69LU, -0x5d8218b2LU, 0x5e9bfd2cLU, 0x5bb09fc3LU, 0x58a97a5dLU, 0x51e65b50LU, 0x52ffbeceLU, 0x57d4dc21LU, 0x54cd39bfLU, +0x00000000LU, 0x0319e59eLU, 0x06328771LU, 0x052b62efLU, 0x0c6443e2LU, 0x0f7da67cLU, 0x0a56c493LU, 0x094f210dLU, +0x18c88689LU, 0x1bd16317LU, 0x1efa01f8LU, 0x1de3e466LU, 0x14acc56bLU, 0x17b520f5LU, 0x129e421aLU, 0x1187a784LU, +0x30dd415fLU, 0x33c4a4c1LU, 0x36efc62eLU, 0x35f623b0LU, 0x3cb902bdLU, 0x3fa0e723LU, 0x3a8b85ccLU, 0x39926052LU, +0x2815c7d6LU, 0x2b0c2248LU, 0x2e2740a7LU, 0x2d3ea539LU, 0x24718434LU, 0x276861aaLU, 0x22430345LU, 0x215ae6dbLU, +0x60f782beLU, 0x63ee6720LU, 0x66c505cfLU, 0x65dce051LU, 0x6c93c15cLU, 0x6f8a24c2LU, 0x6aa1462dLU, 0x69b8a3b3LU, +0x783f0437LU, 0x7b26e1a9LU, 0x7e0d8346LU, 0x7d1466d8LU, 0x745b47d5LU, 0x7742a24bLU, 0x7269c0a4LU, 0x7170253aLU, +0x502ac3e1LU, 0x5333267fLU, 0x56184490LU, 0x5501a10eLU, 0x5c4e8003LU, 0x5f57659dLU, 0x5a7c0772LU, 0x5965e2ecLU, +0x48e24568LU, 0x4bfba0f6LU, 0x4ed0c219LU, 0x4dc92787LU, 0x4486068aLU, 0x479fe314LU, 0x42b481fbLU, 0x41ad6465LU, +0xc0a34931LU, 0xc3baacafLU, 0xc691ce40LU, 0xc5882bdeLU, 0xccc70ad3LU, 0xcfdeef4dLU, 0xcaf58da2LU, 0xc9ec683cLU, +0xd86bcfb8LU, 0xdb722a26LU, 0xde5948c9LU, 0xdd40ad57LU, 0xd40f8c5aLU, 0xd71669c4LU, 0xd23d0b2bLU, 0xd124eeb5LU, +0xf07e086eLU, 0xf367edf0LU, 0xf64c8f1fLU, 0xf5556a81LU, 0xfc1a4b8cLU, 0xff03ae12LU, 0xfa28ccfdLU, 0xf9312963LU, +0xe8b68ee7LU, 0xebaf6b79LU, 0xee840996LU, 0xed9dec08LU, 0xe4d2cd05LU, 0xe7cb289bLU, 0xe2e04a74LU, 0xe1f9afeaLU, +0xa054cb8fLU, 0xa34d2e11LU, 0xa6664cfeLU, 0xa57fa960LU, 0xac30886dLU, 0xaf296df3LU, 0xaa020f1cLU, 0xa91bea82LU, +0xb89c4d06LU, 0xbb85a898LU, 0xbeaeca77LU, 0xbdb72fe9LU, 0xb4f80ee4LU, 0xb7e1eb7aLU, 0xb2ca8995LU, 0xb1d36c0bLU, +0x90898ad0LU, 0x93906f4eLU, 0x96bb0da1LU, 0x95a2e83fLU, 0x9cedc932LU, 0x9ff42cacLU, 0x9adf4e43LU, 0x99c6abddLU, +0x88410c59LU, 0x8b58e9c7LU, 0x8e738b28LU, 0x8d6a6eb6LU, 0x84254fbbLU, 0x873caa25LU, 0x8217c8caLU, 0x810e2d54LU, +0xcd0b9262LU, 0xce1277fcLU, 0xcb391513LU, 0xc820f08dLU, 0xc16fd180LU, 0xc276341eLU, 0xc75d56f1LU, 0xc444b36fLU, +0xd5c314ebLU, 0xd6daf175LU, 0xd3f1939aLU, 0xd0e87604LU, 0xd9a75709LU, 0xdabeb297LU, 0xdf95d078LU, 0xdc8c35e6LU, +0xfdd6d33dLU, 0xfecf36a3LU, 0xfbe4544cLU, 0xf8fdb1d2LU, 0xf1b290dfLU, 0xf2ab7541LU, 0xf78017aeLU, 0xf499f230LU, +0xe51e55b4LU, 0xe607b02aLU, 0xe32cd2c5LU, 0xe035375bLU, 0xe97a1656LU, 0xea63f3c8LU, 0xef489127LU, 0xec5174b9LU, +0xadfc10dcLU, 0xaee5f542LU, 0xabce97adLU, 0xa8d77233LU, 0xa198533eLU, 0xa281b6a0LU, 0xa7aad44fLU, 0xa4b331d1LU, +0xb5349655LU, 0xb62d73cbLU, 0xb3061124LU, 0xb01ff4baLU, 0xb950d5b7LU, 0xba493029LU, 0xbf6252c6LU, 0xbc7bb758LU, +0x9d215183LU, 0x9e38b41dLU, 0x9b13d6f2LU, 0x980a336cLU, 0x91451261LU, 0x925cf7ffLU, 0x97779510LU, 0x946e708eLU, +0x85e9d70aLU, 0x86f03294LU, 0x83db507bLU, 0x80c2b5e5LU, 0x898d94e8LU, 0x8a947176LU, 0x8fbf1399LU, 0x8ca6f607LU, +0x0da8db53LU, 0x0eb13ecdLU, 0x0b9a5c22LU, 0x0883b9bcLU, 0x01cc98b1LU, 0x02d57d2fLU, 0x07fe1fc0LU, 0x04e7fa5eLU, +0x15605ddaLU, 0x1679b844LU, 0x1352daabLU, 0x104b3f35LU, 0x19041e38LU, 0x1a1dfba6LU, 0x1f369949LU, 0x1c2f7cd7LU, +0x3d759a0cLU, 0x3e6c7f92LU, 0x3b471d7dLU, 0x385ef8e3LU, 0x3111d9eeLU, 0x32083c70LU, 0x37235e9fLU, 0x343abb01LU, +0x25bd1c85LU, 0x26a4f91bLU, 0x238f9bf4LU, 0x20967e6aLU, 0x29d95f67LU, 0x2ac0baf9LU, 0x2febd816LU, 0x2cf23d88LU, +0x6d5f59edLU, 0x6e46bc73LU, 0x6b6dde9cLU, 0x68743b02LU, 0x613b1a0fLU, 0x6222ff91LU, 0x67099d7eLU, 0x641078e0LU, +0x7597df64LU, 0x768e3afaLU, 0x73a55815LU, 0x70bcbd8bLU, 0x79f39c86LU, 0x7aea7918LU, 0x7fc11bf7LU, 0x7cd8fe69LU, +0x5d8218b2LU, 0x5e9bfd2cLU, 0x5bb09fc3LU, 0x58a97a5dLU, 0x51e65b50LU, 0x52ffbeceLU, 0x57d4dc21LU, 0x54cd39bfLU, 0x454a9e3bLU, 0x46537ba5LU, 0x4378194aLU, 0x4061fcd4LU, 0x492eddd9LU, 0x4a373847LU, 0x4f1c5aa8LU, 0x4c05bf36LU }; #endif /* LTC_TWOFISH_ALL_TABLES */ diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index abd8653cb..b19e94a55 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -95,7 +95,7 @@ int ccm_memory(int cipher, nonce, noncelen, header, headerlen, pt, ptlen, - ct, + ct, tag, taglen, direction); } @@ -174,7 +174,7 @@ int ccm_memory(int cipher, /* handle header */ if (headerlen > 0) { x = 0; - + /* store length */ if (headerlen < ((1UL<<16) - (1UL<<8))) { PAD[x++] ^= (headerlen>>8) & 255; @@ -213,7 +213,7 @@ int ccm_memory(int cipher, /* flags */ ctr[x++] = (unsigned char)L-1; - + /* nonce */ for (y = 0; y < (16 - (L+1)); ++y) { ctr[x++] = nonce[y]; @@ -305,7 +305,7 @@ int ccm_memory(int cipher, } PAD[x++] ^= b; } - + if (x != 0) { if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { goto error; diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c index 9d0b28c99..e2facdb85 100644 --- a/src/encauth/ccm/ccm_memory_ex.c +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -15,7 +15,7 @@ CCM support, process a block of memory, Tom St Denis */ -#ifdef CCM_MODE +#ifdef LTC_CCM_MODE /** CCM encrypt/decrypt and produce an authentication tag @@ -98,7 +98,7 @@ int ccm_memory_ex(int cipher, nonce, noncelen, header, headerlen, pt, ptlen, - ct, + ct, tag, taglen, direction); } @@ -184,7 +184,7 @@ if (B0 == NULL) { /* handle header */ if (headerlen > 0) { x = 0; - + #if 0 /* store length */ if (headerlen < ((1UL<<16) - (1UL<<8))) { @@ -221,12 +221,12 @@ if (B0 == NULL) { } /* setup the ctr counter */ -if (CTR == NULL) { +if (CTR == NULL) { x = 0; /* flags */ ctr[x++] = (unsigned char)L-1; - + /* nonce */ for (y = 0; y < (16 - (L+1)); ++y) { ctr[x++] = nonce[y]; @@ -250,7 +250,7 @@ if (CTR == NULL) { if (direction == CCM_ENCRYPT) { for (; y < (ptlen & ~15); y += 16) { /* increment the ctr? */ - for (z = 15; z > 15-ctrwidth; z--) { + for (z = 15; (int)z > (int)(15-ctrwidth); z--) { ctr[z] = (ctr[z] + 1) & 255; if (ctr[z]) break; } @@ -270,7 +270,7 @@ if (CTR == NULL) { } else { for (; y < (ptlen & ~15); y += 16) { /* increment the ctr? */ - for (z = 15; z > 15-ctrwidth; z--) { + for (z = 15; (int)z > (int)(15-ctrwidth); z--) { ctr[z] = (ctr[z] + 1) & 255; if (ctr[z]) break; } @@ -294,7 +294,7 @@ if (CTR == NULL) { for (; y < ptlen; y++) { /* increment the ctr? */ if (CTRlen == 16) { - for (z = 15; z > 15-ctrwidth; z--) { + for (z = 15; (int)z > (int)(15-ctrwidth); z--) { ctr[z] = (ctr[z] + 1) & 255; if (ctr[z]) break; } @@ -321,7 +321,7 @@ if (CTR == NULL) { } PAD[x++] ^= b; } - + if (x != 0) { if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { goto error; @@ -329,7 +329,7 @@ if (CTR == NULL) { } } -// grab the CTR +// grab the CTR memcpy(ctrcopy, ctr, 16); /* setup CTR for the TAG (zero the count) */ @@ -356,7 +356,7 @@ if (CTR == NULL) { *taglen = x; if (CTR != NULL) { - for (z = 15; z > 15-ctrwidth; z--) { + for (z = 15; (int)z > (int)(15-ctrwidth); z--) { ctrcopy[z] = (ctrcopy[z] + 1) & 255; if (ctrcopy[z]) break; } diff --git a/src/encauth/gcm/gcm_add_aad.c b/src/encauth/gcm/gcm_add_aad.c index 26e47f647..f538009a0 100644 --- a/src/encauth/gcm/gcm_add_aad.c +++ b/src/encauth/gcm/gcm_add_aad.c @@ -66,7 +66,7 @@ int gcm_add_aad(gcm_state *gcm, } gcm_mult_h(gcm, gcm->X); - /* copy counter out */ + /* copy counter out */ XMEMCPY(gcm->Y, gcm->X, 16); zeromem(gcm->X, 16); } else { @@ -117,7 +117,7 @@ int gcm_add_aad(gcm_state *gcm, return CRYPT_OK; } #endif - + /* $Source$ */ /* $Revision$ */ diff --git a/src/encauth/gcm/gcm_add_iv.c b/src/encauth/gcm/gcm_add_iv.c index 0ac79b6be..7464f9a7c 100644 --- a/src/encauth/gcm/gcm_add_iv.c +++ b/src/encauth/gcm/gcm_add_iv.c @@ -24,7 +24,7 @@ @param IVlen The length of the IV @return CRYPT_OK on success */ -int gcm_add_iv(gcm_state *gcm, +int gcm_add_iv(gcm_state *gcm, const unsigned char *IV, unsigned long IVlen) { unsigned long x, y; @@ -39,7 +39,7 @@ int gcm_add_iv(gcm_state *gcm, if (gcm->mode != LTC_GCM_MODE_IV) { return CRYPT_INVALID_ARG; } - + if (gcm->buflen >= 16 || gcm->buflen < 0) { return CRYPT_INVALID_ARG; } @@ -87,7 +87,7 @@ int gcm_add_iv(gcm_state *gcm, } #endif - + /* $Source$ */ /* $Revision$ */ diff --git a/src/encauth/gcm/gcm_mult_h.c b/src/encauth/gcm/gcm_mult_h.c index 2cda6a4bf..871cd519f 100644 --- a/src/encauth/gcm/gcm_mult_h.c +++ b/src/encauth/gcm/gcm_mult_h.c @@ -46,8 +46,8 @@ void gcm_mult_h(gcm_state *gcm, unsigned char *I) #endif /* LTC_FAST */ } #endif /* LTC_GCM_TABLES_SSE2 */ -#else - gcm_gf_mult(gcm->H, I, T); +#else + gcm_gf_mult(gcm->H, I, T); #endif XMEMCPY(I, T, 16); } diff --git a/src/encauth/gcm/gcm_process.c b/src/encauth/gcm/gcm_process.c index af0444d0c..08921dbce 100644 --- a/src/encauth/gcm/gcm_process.c +++ b/src/encauth/gcm/gcm_process.c @@ -17,9 +17,9 @@ #ifdef LTC_GCM_MODE -/** +/** Process plaintext/ciphertext through GCM - @param gcm The GCM state + @param gcm The GCM state @param pt The plaintext @param ptlen The plaintext length (ciphertext length is the same) @param ct The ciphertext @@ -44,7 +44,7 @@ int gcm_process(gcm_state *gcm, if (gcm->buflen > 16 || gcm->buflen < 0) { return CRYPT_INVALID_ARG; } - + if ((err = cipher_is_valid(gcm->cipher)) != CRYPT_OK) { return err; } @@ -77,7 +77,7 @@ int gcm_process(gcm_state *gcm, x = 0; #ifdef LTC_FAST if (gcm->buflen == 0) { - if (direction == GCM_ENCRYPT) { + if (direction == GCM_ENCRYPT) { for (x = 0; x < (ptlen & ~15); x += 16) { /* ctr encrypt */ for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { @@ -115,14 +115,14 @@ int gcm_process(gcm_state *gcm, } } } -#endif +#endif /* process text */ for (; x < ptlen; x++) { if (gcm->buflen == 16) { gcm->pttotlen += 128; gcm_mult_h(gcm, gcm->X); - + /* increment counter */ for (y = 15; y >= 12; y--) { if (++gcm->Y[y] & 255) { break; } @@ -134,12 +134,12 @@ int gcm_process(gcm_state *gcm, } if (direction == GCM_ENCRYPT) { - b = ct[x] = pt[x] ^ gcm->buf[gcm->buflen]; + b = ct[x] = pt[x] ^ gcm->buf[gcm->buflen]; } else { b = ct[x]; pt[x] = ct[x] ^ gcm->buf[gcm->buflen]; } - gcm->X[gcm->buflen++] ^= b; + gcm->X[gcm->buflen++] ^= b; } return CRYPT_OK; diff --git a/src/hashes/sha2/sha224.c b/src/hashes/sha2/sha224.c index 5d7dfb230..c0bfdcb8a 100644 --- a/src/hashes/sha2/sha224.c +++ b/src/hashes/sha2/sha224.c @@ -72,19 +72,19 @@ int sha224_done(hash_state * md, unsigned char *out) XMEMCPY(out, buf, 28); #ifdef LTC_CLEAN_STACK zeromem(buf, sizeof(buf)); -#endif +#endif return err; } /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int sha224_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { char *msg; unsigned char hash[28]; diff --git a/src/hashes/sha2/sha384.c b/src/hashes/sha2/sha384.c index cf4d7dc37..3e3ce5754 100644 --- a/src/hashes/sha2/sha384.c +++ b/src/hashes/sha2/sha384.c @@ -8,7 +8,7 @@ * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @param sha384.c LTC_SHA384 hash included in sha512.c, Tom St Denis */ @@ -81,12 +81,12 @@ int sha384_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int sha384_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { char *msg; unsigned char hash[48]; diff --git a/src/hashes/whirl/whirl.c b/src/hashes/whirl/whirl.c index 102d6f168..1ae716fc3 100644 --- a/src/hashes/whirl/whirl.c +++ b/src/hashes/whirl/whirl.c @@ -9,9 +9,9 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file whirl.c - LTC_WHIRLPOOL (using their new sbox) hash function by Tom St Denis + LTC_WHIRLPOOL (using their new sbox) hash function by Tom St Denis */ #include "tomcrypt.h" @@ -61,7 +61,7 @@ static int whirlpool_compress(hash_state *md, unsigned char *buf) { ulong64 K[2][8], T[3][8]; int x, y; - + /* load the block/state */ for (x = 0; x < 8; x++) { K[0][x] = md->whirlpool.state[x]; @@ -70,7 +70,7 @@ static int whirlpool_compress(hash_state *md, unsigned char *buf) T[2][x] = T[0][x]; T[0][x] ^= K[0][x]; } - + /* do rounds 1..10 */ for (x = 0; x < 10; x += 2) { /* odd round */ @@ -80,7 +80,7 @@ static int whirlpool_compress(hash_state *md, unsigned char *buf) } /* xor the constant */ K[1][0] ^= cont[x]; - + /* apply main transform to T[0] into T[1] */ for (y = 0; y < 8; y++) { T[1][y] = theta_pi_gamma(T[0], y) ^ K[1][y]; @@ -93,13 +93,13 @@ static int whirlpool_compress(hash_state *md, unsigned char *buf) } /* xor the constant */ K[0][0] ^= cont[x+1]; - + /* apply main transform to T[1] into T[0] */ for (y = 0; y < 8; y++) { T[0][y] = theta_pi_gamma(T[1], y) ^ K[0][y]; } } - + /* store state */ for (x = 0; x < 8; x++) { md->whirlpool.state[x] ^= T[0][x] ^ T[2][x]; @@ -198,20 +198,20 @@ int whirlpool_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int whirlpool_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { int len; unsigned char msg[128], hash[64]; } tests[] = { - + /* NULL Message */ { - 0, + 0, { 0x00 }, { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66, 0x9B, 0x44, 0xE3, 0x9C, 0x1D, 0x2E, 0x17, 0x26, 0xC5, 0x30, 0x23, 0x21, 0x30, 0xD4, 0x07, 0xF8, 0x9A, 0xFE, 0xE0, 0x96, 0x49, 0x97, 0xF7, 0xA7, @@ -279,7 +279,7 @@ int whirlpool_test(void) 0x06, 0xDB, 0x4F, 0xF7, 0x08, 0xA3, 0xA2, 0x8B, 0xC3, 0x7A, 0x92, 0x1E, 0xEE, 0x11, 0xED, 0x7B, 0x6A, 0x53, 0x79, 0x32, 0xCC, 0x5E, 0x94, 0xEE, 0x1E, 0xA6, 0x57, 0x60, 0x7E, 0x36, 0xC9, 0xF7 } }, - + }; int i; @@ -291,13 +291,13 @@ int whirlpool_test(void) whirlpool_process(&md, (unsigned char *)tests[i].msg, tests[i].len); whirlpool_done(&md, tmp); if (XMEMCMP(tmp, tests[i].hash, 64) != 0) { -#if 0 +#if 0 printf("\nFailed test %d\n", i); for (i = 0; i < 64; ) { printf("%02x ", tmp[i]); if (!(++i & 15)) printf("\n"); } -#endif +#endif return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/whirl/whirltab.c b/src/hashes/whirl/whirltab.c index 85ba31221..ff5c77293 100644 --- a/src/hashes/whirl/whirltab.c +++ b/src/hashes/whirl/whirltab.c @@ -1,71 +1,71 @@ /** @file whirltab.c LTC_WHIRLPOOL tables, Tom St Denis -*/ +*/ static const ulong64 sbox0[] = { -CONST64(0x18186018c07830d8), CONST64(0x23238c2305af4626), CONST64(0xc6c63fc67ef991b8), CONST64(0xe8e887e8136fcdfb), -CONST64(0x878726874ca113cb), CONST64(0xb8b8dab8a9626d11), CONST64(0x0101040108050209), CONST64(0x4f4f214f426e9e0d), -CONST64(0x3636d836adee6c9b), CONST64(0xa6a6a2a6590451ff), CONST64(0xd2d26fd2debdb90c), CONST64(0xf5f5f3f5fb06f70e), -CONST64(0x7979f979ef80f296), CONST64(0x6f6fa16f5fcede30), CONST64(0x91917e91fcef3f6d), CONST64(0x52525552aa07a4f8), -CONST64(0x60609d6027fdc047), CONST64(0xbcbccabc89766535), CONST64(0x9b9b569baccd2b37), CONST64(0x8e8e028e048c018a), -CONST64(0xa3a3b6a371155bd2), CONST64(0x0c0c300c603c186c), CONST64(0x7b7bf17bff8af684), CONST64(0x3535d435b5e16a80), -CONST64(0x1d1d741de8693af5), CONST64(0xe0e0a7e05347ddb3), CONST64(0xd7d77bd7f6acb321), CONST64(0xc2c22fc25eed999c), -CONST64(0x2e2eb82e6d965c43), CONST64(0x4b4b314b627a9629), CONST64(0xfefedffea321e15d), CONST64(0x575741578216aed5), -CONST64(0x15155415a8412abd), CONST64(0x7777c1779fb6eee8), CONST64(0x3737dc37a5eb6e92), CONST64(0xe5e5b3e57b56d79e), -CONST64(0x9f9f469f8cd92313), CONST64(0xf0f0e7f0d317fd23), CONST64(0x4a4a354a6a7f9420), CONST64(0xdada4fda9e95a944), -CONST64(0x58587d58fa25b0a2), CONST64(0xc9c903c906ca8fcf), CONST64(0x2929a429558d527c), CONST64(0x0a0a280a5022145a), -CONST64(0xb1b1feb1e14f7f50), CONST64(0xa0a0baa0691a5dc9), CONST64(0x6b6bb16b7fdad614), CONST64(0x85852e855cab17d9), -CONST64(0xbdbdcebd8173673c), CONST64(0x5d5d695dd234ba8f), CONST64(0x1010401080502090), CONST64(0xf4f4f7f4f303f507), -CONST64(0xcbcb0bcb16c08bdd), CONST64(0x3e3ef83eedc67cd3), CONST64(0x0505140528110a2d), CONST64(0x676781671fe6ce78), -CONST64(0xe4e4b7e47353d597), CONST64(0x27279c2725bb4e02), CONST64(0x4141194132588273), CONST64(0x8b8b168b2c9d0ba7), -CONST64(0xa7a7a6a7510153f6), CONST64(0x7d7de97dcf94fab2), CONST64(0x95956e95dcfb3749), CONST64(0xd8d847d88e9fad56), -CONST64(0xfbfbcbfb8b30eb70), CONST64(0xeeee9fee2371c1cd), CONST64(0x7c7ced7cc791f8bb), CONST64(0x6666856617e3cc71), -CONST64(0xdddd53dda68ea77b), CONST64(0x17175c17b84b2eaf), CONST64(0x4747014702468e45), CONST64(0x9e9e429e84dc211a), -CONST64(0xcaca0fca1ec589d4), CONST64(0x2d2db42d75995a58), CONST64(0xbfbfc6bf9179632e), CONST64(0x07071c07381b0e3f), -CONST64(0xadad8ead012347ac), CONST64(0x5a5a755aea2fb4b0), CONST64(0x838336836cb51bef), CONST64(0x3333cc3385ff66b6), -CONST64(0x636391633ff2c65c), CONST64(0x02020802100a0412), CONST64(0xaaaa92aa39384993), CONST64(0x7171d971afa8e2de), -CONST64(0xc8c807c80ecf8dc6), CONST64(0x19196419c87d32d1), CONST64(0x494939497270923b), CONST64(0xd9d943d9869aaf5f), -CONST64(0xf2f2eff2c31df931), CONST64(0xe3e3abe34b48dba8), CONST64(0x5b5b715be22ab6b9), CONST64(0x88881a8834920dbc), -CONST64(0x9a9a529aa4c8293e), CONST64(0x262698262dbe4c0b), CONST64(0x3232c8328dfa64bf), CONST64(0xb0b0fab0e94a7d59), -CONST64(0xe9e983e91b6acff2), CONST64(0x0f0f3c0f78331e77), CONST64(0xd5d573d5e6a6b733), CONST64(0x80803a8074ba1df4), -CONST64(0xbebec2be997c6127), CONST64(0xcdcd13cd26de87eb), CONST64(0x3434d034bde46889), CONST64(0x48483d487a759032), -CONST64(0xffffdbffab24e354), CONST64(0x7a7af57af78ff48d), CONST64(0x90907a90f4ea3d64), CONST64(0x5f5f615fc23ebe9d), -CONST64(0x202080201da0403d), CONST64(0x6868bd6867d5d00f), CONST64(0x1a1a681ad07234ca), CONST64(0xaeae82ae192c41b7), -CONST64(0xb4b4eab4c95e757d), CONST64(0x54544d549a19a8ce), CONST64(0x93937693ece53b7f), CONST64(0x222288220daa442f), -CONST64(0x64648d6407e9c863), CONST64(0xf1f1e3f1db12ff2a), CONST64(0x7373d173bfa2e6cc), CONST64(0x12124812905a2482), -CONST64(0x40401d403a5d807a), CONST64(0x0808200840281048), CONST64(0xc3c32bc356e89b95), CONST64(0xecec97ec337bc5df), -CONST64(0xdbdb4bdb9690ab4d), CONST64(0xa1a1bea1611f5fc0), CONST64(0x8d8d0e8d1c830791), CONST64(0x3d3df43df5c97ac8), -CONST64(0x97976697ccf1335b), CONST64(0x0000000000000000), CONST64(0xcfcf1bcf36d483f9), CONST64(0x2b2bac2b4587566e), -CONST64(0x7676c57697b3ece1), CONST64(0x8282328264b019e6), CONST64(0xd6d67fd6fea9b128), CONST64(0x1b1b6c1bd87736c3), -CONST64(0xb5b5eeb5c15b7774), CONST64(0xafaf86af112943be), CONST64(0x6a6ab56a77dfd41d), CONST64(0x50505d50ba0da0ea), -CONST64(0x45450945124c8a57), CONST64(0xf3f3ebf3cb18fb38), CONST64(0x3030c0309df060ad), CONST64(0xefef9bef2b74c3c4), -CONST64(0x3f3ffc3fe5c37eda), CONST64(0x55554955921caac7), CONST64(0xa2a2b2a2791059db), CONST64(0xeaea8fea0365c9e9), -CONST64(0x656589650fecca6a), CONST64(0xbabad2bab9686903), CONST64(0x2f2fbc2f65935e4a), CONST64(0xc0c027c04ee79d8e), -CONST64(0xdede5fdebe81a160), CONST64(0x1c1c701ce06c38fc), CONST64(0xfdfdd3fdbb2ee746), CONST64(0x4d4d294d52649a1f), -CONST64(0x92927292e4e03976), CONST64(0x7575c9758fbceafa), CONST64(0x06061806301e0c36), CONST64(0x8a8a128a249809ae), -CONST64(0xb2b2f2b2f940794b), CONST64(0xe6e6bfe66359d185), CONST64(0x0e0e380e70361c7e), CONST64(0x1f1f7c1ff8633ee7), -CONST64(0x6262956237f7c455), CONST64(0xd4d477d4eea3b53a), CONST64(0xa8a89aa829324d81), CONST64(0x96966296c4f43152), -CONST64(0xf9f9c3f99b3aef62), CONST64(0xc5c533c566f697a3), CONST64(0x2525942535b14a10), CONST64(0x59597959f220b2ab), -CONST64(0x84842a8454ae15d0), CONST64(0x7272d572b7a7e4c5), CONST64(0x3939e439d5dd72ec), CONST64(0x4c4c2d4c5a619816), -CONST64(0x5e5e655eca3bbc94), CONST64(0x7878fd78e785f09f), CONST64(0x3838e038ddd870e5), CONST64(0x8c8c0a8c14860598), -CONST64(0xd1d163d1c6b2bf17), CONST64(0xa5a5aea5410b57e4), CONST64(0xe2e2afe2434dd9a1), CONST64(0x616199612ff8c24e), -CONST64(0xb3b3f6b3f1457b42), CONST64(0x2121842115a54234), CONST64(0x9c9c4a9c94d62508), CONST64(0x1e1e781ef0663cee), -CONST64(0x4343114322528661), CONST64(0xc7c73bc776fc93b1), CONST64(0xfcfcd7fcb32be54f), CONST64(0x0404100420140824), -CONST64(0x51515951b208a2e3), CONST64(0x99995e99bcc72f25), CONST64(0x6d6da96d4fc4da22), CONST64(0x0d0d340d68391a65), -CONST64(0xfafacffa8335e979), CONST64(0xdfdf5bdfb684a369), CONST64(0x7e7ee57ed79bfca9), CONST64(0x242490243db44819), -CONST64(0x3b3bec3bc5d776fe), CONST64(0xabab96ab313d4b9a), CONST64(0xcece1fce3ed181f0), CONST64(0x1111441188552299), -CONST64(0x8f8f068f0c890383), CONST64(0x4e4e254e4a6b9c04), CONST64(0xb7b7e6b7d1517366), CONST64(0xebeb8beb0b60cbe0), -CONST64(0x3c3cf03cfdcc78c1), CONST64(0x81813e817cbf1ffd), CONST64(0x94946a94d4fe3540), CONST64(0xf7f7fbf7eb0cf31c), -CONST64(0xb9b9deb9a1676f18), CONST64(0x13134c13985f268b), CONST64(0x2c2cb02c7d9c5851), CONST64(0xd3d36bd3d6b8bb05), -CONST64(0xe7e7bbe76b5cd38c), CONST64(0x6e6ea56e57cbdc39), CONST64(0xc4c437c46ef395aa), CONST64(0x03030c03180f061b), -CONST64(0x565645568a13acdc), CONST64(0x44440d441a49885e), CONST64(0x7f7fe17fdf9efea0), CONST64(0xa9a99ea921374f88), -CONST64(0x2a2aa82a4d825467), CONST64(0xbbbbd6bbb16d6b0a), CONST64(0xc1c123c146e29f87), CONST64(0x53535153a202a6f1), -CONST64(0xdcdc57dcae8ba572), CONST64(0x0b0b2c0b58271653), CONST64(0x9d9d4e9d9cd32701), CONST64(0x6c6cad6c47c1d82b), -CONST64(0x3131c43195f562a4), CONST64(0x7474cd7487b9e8f3), CONST64(0xf6f6fff6e309f115), CONST64(0x464605460a438c4c), -CONST64(0xacac8aac092645a5), CONST64(0x89891e893c970fb5), CONST64(0x14145014a04428b4), CONST64(0xe1e1a3e15b42dfba), -CONST64(0x16165816b04e2ca6), CONST64(0x3a3ae83acdd274f7), CONST64(0x6969b9696fd0d206), CONST64(0x09092409482d1241), -CONST64(0x7070dd70a7ade0d7), CONST64(0xb6b6e2b6d954716f), CONST64(0xd0d067d0ceb7bd1e), CONST64(0xeded93ed3b7ec7d6), -CONST64(0xcccc17cc2edb85e2), CONST64(0x424215422a578468), CONST64(0x98985a98b4c22d2c), CONST64(0xa4a4aaa4490e55ed), +CONST64(0x18186018c07830d8), CONST64(0x23238c2305af4626), CONST64(0xc6c63fc67ef991b8), CONST64(0xe8e887e8136fcdfb), +CONST64(0x878726874ca113cb), CONST64(0xb8b8dab8a9626d11), CONST64(0x0101040108050209), CONST64(0x4f4f214f426e9e0d), +CONST64(0x3636d836adee6c9b), CONST64(0xa6a6a2a6590451ff), CONST64(0xd2d26fd2debdb90c), CONST64(0xf5f5f3f5fb06f70e), +CONST64(0x7979f979ef80f296), CONST64(0x6f6fa16f5fcede30), CONST64(0x91917e91fcef3f6d), CONST64(0x52525552aa07a4f8), +CONST64(0x60609d6027fdc047), CONST64(0xbcbccabc89766535), CONST64(0x9b9b569baccd2b37), CONST64(0x8e8e028e048c018a), +CONST64(0xa3a3b6a371155bd2), CONST64(0x0c0c300c603c186c), CONST64(0x7b7bf17bff8af684), CONST64(0x3535d435b5e16a80), +CONST64(0x1d1d741de8693af5), CONST64(0xe0e0a7e05347ddb3), CONST64(0xd7d77bd7f6acb321), CONST64(0xc2c22fc25eed999c), +CONST64(0x2e2eb82e6d965c43), CONST64(0x4b4b314b627a9629), CONST64(0xfefedffea321e15d), CONST64(0x575741578216aed5), +CONST64(0x15155415a8412abd), CONST64(0x7777c1779fb6eee8), CONST64(0x3737dc37a5eb6e92), CONST64(0xe5e5b3e57b56d79e), +CONST64(0x9f9f469f8cd92313), CONST64(0xf0f0e7f0d317fd23), CONST64(0x4a4a354a6a7f9420), CONST64(0xdada4fda9e95a944), +CONST64(0x58587d58fa25b0a2), CONST64(0xc9c903c906ca8fcf), CONST64(0x2929a429558d527c), CONST64(0x0a0a280a5022145a), +CONST64(0xb1b1feb1e14f7f50), CONST64(0xa0a0baa0691a5dc9), CONST64(0x6b6bb16b7fdad614), CONST64(0x85852e855cab17d9), +CONST64(0xbdbdcebd8173673c), CONST64(0x5d5d695dd234ba8f), CONST64(0x1010401080502090), CONST64(0xf4f4f7f4f303f507), +CONST64(0xcbcb0bcb16c08bdd), CONST64(0x3e3ef83eedc67cd3), CONST64(0x0505140528110a2d), CONST64(0x676781671fe6ce78), +CONST64(0xe4e4b7e47353d597), CONST64(0x27279c2725bb4e02), CONST64(0x4141194132588273), CONST64(0x8b8b168b2c9d0ba7), +CONST64(0xa7a7a6a7510153f6), CONST64(0x7d7de97dcf94fab2), CONST64(0x95956e95dcfb3749), CONST64(0xd8d847d88e9fad56), +CONST64(0xfbfbcbfb8b30eb70), CONST64(0xeeee9fee2371c1cd), CONST64(0x7c7ced7cc791f8bb), CONST64(0x6666856617e3cc71), +CONST64(0xdddd53dda68ea77b), CONST64(0x17175c17b84b2eaf), CONST64(0x4747014702468e45), CONST64(0x9e9e429e84dc211a), +CONST64(0xcaca0fca1ec589d4), CONST64(0x2d2db42d75995a58), CONST64(0xbfbfc6bf9179632e), CONST64(0x07071c07381b0e3f), +CONST64(0xadad8ead012347ac), CONST64(0x5a5a755aea2fb4b0), CONST64(0x838336836cb51bef), CONST64(0x3333cc3385ff66b6), +CONST64(0x636391633ff2c65c), CONST64(0x02020802100a0412), CONST64(0xaaaa92aa39384993), CONST64(0x7171d971afa8e2de), +CONST64(0xc8c807c80ecf8dc6), CONST64(0x19196419c87d32d1), CONST64(0x494939497270923b), CONST64(0xd9d943d9869aaf5f), +CONST64(0xf2f2eff2c31df931), CONST64(0xe3e3abe34b48dba8), CONST64(0x5b5b715be22ab6b9), CONST64(0x88881a8834920dbc), +CONST64(0x9a9a529aa4c8293e), CONST64(0x262698262dbe4c0b), CONST64(0x3232c8328dfa64bf), CONST64(0xb0b0fab0e94a7d59), +CONST64(0xe9e983e91b6acff2), CONST64(0x0f0f3c0f78331e77), CONST64(0xd5d573d5e6a6b733), CONST64(0x80803a8074ba1df4), +CONST64(0xbebec2be997c6127), CONST64(0xcdcd13cd26de87eb), CONST64(0x3434d034bde46889), CONST64(0x48483d487a759032), +CONST64(0xffffdbffab24e354), CONST64(0x7a7af57af78ff48d), CONST64(0x90907a90f4ea3d64), CONST64(0x5f5f615fc23ebe9d), +CONST64(0x202080201da0403d), CONST64(0x6868bd6867d5d00f), CONST64(0x1a1a681ad07234ca), CONST64(0xaeae82ae192c41b7), +CONST64(0xb4b4eab4c95e757d), CONST64(0x54544d549a19a8ce), CONST64(0x93937693ece53b7f), CONST64(0x222288220daa442f), +CONST64(0x64648d6407e9c863), CONST64(0xf1f1e3f1db12ff2a), CONST64(0x7373d173bfa2e6cc), CONST64(0x12124812905a2482), +CONST64(0x40401d403a5d807a), CONST64(0x0808200840281048), CONST64(0xc3c32bc356e89b95), CONST64(0xecec97ec337bc5df), +CONST64(0xdbdb4bdb9690ab4d), CONST64(0xa1a1bea1611f5fc0), CONST64(0x8d8d0e8d1c830791), CONST64(0x3d3df43df5c97ac8), +CONST64(0x97976697ccf1335b), CONST64(0x0000000000000000), CONST64(0xcfcf1bcf36d483f9), CONST64(0x2b2bac2b4587566e), +CONST64(0x7676c57697b3ece1), CONST64(0x8282328264b019e6), CONST64(0xd6d67fd6fea9b128), CONST64(0x1b1b6c1bd87736c3), +CONST64(0xb5b5eeb5c15b7774), CONST64(0xafaf86af112943be), CONST64(0x6a6ab56a77dfd41d), CONST64(0x50505d50ba0da0ea), +CONST64(0x45450945124c8a57), CONST64(0xf3f3ebf3cb18fb38), CONST64(0x3030c0309df060ad), CONST64(0xefef9bef2b74c3c4), +CONST64(0x3f3ffc3fe5c37eda), CONST64(0x55554955921caac7), CONST64(0xa2a2b2a2791059db), CONST64(0xeaea8fea0365c9e9), +CONST64(0x656589650fecca6a), CONST64(0xbabad2bab9686903), CONST64(0x2f2fbc2f65935e4a), CONST64(0xc0c027c04ee79d8e), +CONST64(0xdede5fdebe81a160), CONST64(0x1c1c701ce06c38fc), CONST64(0xfdfdd3fdbb2ee746), CONST64(0x4d4d294d52649a1f), +CONST64(0x92927292e4e03976), CONST64(0x7575c9758fbceafa), CONST64(0x06061806301e0c36), CONST64(0x8a8a128a249809ae), +CONST64(0xb2b2f2b2f940794b), CONST64(0xe6e6bfe66359d185), CONST64(0x0e0e380e70361c7e), CONST64(0x1f1f7c1ff8633ee7), +CONST64(0x6262956237f7c455), CONST64(0xd4d477d4eea3b53a), CONST64(0xa8a89aa829324d81), CONST64(0x96966296c4f43152), +CONST64(0xf9f9c3f99b3aef62), CONST64(0xc5c533c566f697a3), CONST64(0x2525942535b14a10), CONST64(0x59597959f220b2ab), +CONST64(0x84842a8454ae15d0), CONST64(0x7272d572b7a7e4c5), CONST64(0x3939e439d5dd72ec), CONST64(0x4c4c2d4c5a619816), +CONST64(0x5e5e655eca3bbc94), CONST64(0x7878fd78e785f09f), CONST64(0x3838e038ddd870e5), CONST64(0x8c8c0a8c14860598), +CONST64(0xd1d163d1c6b2bf17), CONST64(0xa5a5aea5410b57e4), CONST64(0xe2e2afe2434dd9a1), CONST64(0x616199612ff8c24e), +CONST64(0xb3b3f6b3f1457b42), CONST64(0x2121842115a54234), CONST64(0x9c9c4a9c94d62508), CONST64(0x1e1e781ef0663cee), +CONST64(0x4343114322528661), CONST64(0xc7c73bc776fc93b1), CONST64(0xfcfcd7fcb32be54f), CONST64(0x0404100420140824), +CONST64(0x51515951b208a2e3), CONST64(0x99995e99bcc72f25), CONST64(0x6d6da96d4fc4da22), CONST64(0x0d0d340d68391a65), +CONST64(0xfafacffa8335e979), CONST64(0xdfdf5bdfb684a369), CONST64(0x7e7ee57ed79bfca9), CONST64(0x242490243db44819), +CONST64(0x3b3bec3bc5d776fe), CONST64(0xabab96ab313d4b9a), CONST64(0xcece1fce3ed181f0), CONST64(0x1111441188552299), +CONST64(0x8f8f068f0c890383), CONST64(0x4e4e254e4a6b9c04), CONST64(0xb7b7e6b7d1517366), CONST64(0xebeb8beb0b60cbe0), +CONST64(0x3c3cf03cfdcc78c1), CONST64(0x81813e817cbf1ffd), CONST64(0x94946a94d4fe3540), CONST64(0xf7f7fbf7eb0cf31c), +CONST64(0xb9b9deb9a1676f18), CONST64(0x13134c13985f268b), CONST64(0x2c2cb02c7d9c5851), CONST64(0xd3d36bd3d6b8bb05), +CONST64(0xe7e7bbe76b5cd38c), CONST64(0x6e6ea56e57cbdc39), CONST64(0xc4c437c46ef395aa), CONST64(0x03030c03180f061b), +CONST64(0x565645568a13acdc), CONST64(0x44440d441a49885e), CONST64(0x7f7fe17fdf9efea0), CONST64(0xa9a99ea921374f88), +CONST64(0x2a2aa82a4d825467), CONST64(0xbbbbd6bbb16d6b0a), CONST64(0xc1c123c146e29f87), CONST64(0x53535153a202a6f1), +CONST64(0xdcdc57dcae8ba572), CONST64(0x0b0b2c0b58271653), CONST64(0x9d9d4e9d9cd32701), CONST64(0x6c6cad6c47c1d82b), +CONST64(0x3131c43195f562a4), CONST64(0x7474cd7487b9e8f3), CONST64(0xf6f6fff6e309f115), CONST64(0x464605460a438c4c), +CONST64(0xacac8aac092645a5), CONST64(0x89891e893c970fb5), CONST64(0x14145014a04428b4), CONST64(0xe1e1a3e15b42dfba), +CONST64(0x16165816b04e2ca6), CONST64(0x3a3ae83acdd274f7), CONST64(0x6969b9696fd0d206), CONST64(0x09092409482d1241), +CONST64(0x7070dd70a7ade0d7), CONST64(0xb6b6e2b6d954716f), CONST64(0xd0d067d0ceb7bd1e), CONST64(0xeded93ed3b7ec7d6), +CONST64(0xcccc17cc2edb85e2), CONST64(0x424215422a578468), CONST64(0x98985a98b4c22d2c), CONST64(0xa4a4aaa4490e55ed), CONST64(0x2828a0285d885075), CONST64(0x5c5c6d5cda31b886), CONST64(0xf8f8c7f8933fed6b), CONST64(0x8686228644a411c2) }; @@ -93,471 +93,471 @@ CONST64(0x2828a0285d885075), CONST64(0x5c5c6d5cda31b886), CONST64(0xf8f8c7f8933f static const ulong64 sbox1[] = { -CONST64(0xd818186018c07830), CONST64(0x2623238c2305af46), CONST64(0xb8c6c63fc67ef991), CONST64(0xfbe8e887e8136fcd), -CONST64(0xcb878726874ca113), CONST64(0x11b8b8dab8a9626d), CONST64(0x0901010401080502), CONST64(0x0d4f4f214f426e9e), -CONST64(0x9b3636d836adee6c), CONST64(0xffa6a6a2a6590451), CONST64(0x0cd2d26fd2debdb9), CONST64(0x0ef5f5f3f5fb06f7), -CONST64(0x967979f979ef80f2), CONST64(0x306f6fa16f5fcede), CONST64(0x6d91917e91fcef3f), CONST64(0xf852525552aa07a4), -CONST64(0x4760609d6027fdc0), CONST64(0x35bcbccabc897665), CONST64(0x379b9b569baccd2b), CONST64(0x8a8e8e028e048c01), -CONST64(0xd2a3a3b6a371155b), CONST64(0x6c0c0c300c603c18), CONST64(0x847b7bf17bff8af6), CONST64(0x803535d435b5e16a), -CONST64(0xf51d1d741de8693a), CONST64(0xb3e0e0a7e05347dd), CONST64(0x21d7d77bd7f6acb3), CONST64(0x9cc2c22fc25eed99), -CONST64(0x432e2eb82e6d965c), CONST64(0x294b4b314b627a96), CONST64(0x5dfefedffea321e1), CONST64(0xd5575741578216ae), -CONST64(0xbd15155415a8412a), CONST64(0xe87777c1779fb6ee), CONST64(0x923737dc37a5eb6e), CONST64(0x9ee5e5b3e57b56d7), -CONST64(0x139f9f469f8cd923), CONST64(0x23f0f0e7f0d317fd), CONST64(0x204a4a354a6a7f94), CONST64(0x44dada4fda9e95a9), -CONST64(0xa258587d58fa25b0), CONST64(0xcfc9c903c906ca8f), CONST64(0x7c2929a429558d52), CONST64(0x5a0a0a280a502214), -CONST64(0x50b1b1feb1e14f7f), CONST64(0xc9a0a0baa0691a5d), CONST64(0x146b6bb16b7fdad6), CONST64(0xd985852e855cab17), -CONST64(0x3cbdbdcebd817367), CONST64(0x8f5d5d695dd234ba), CONST64(0x9010104010805020), CONST64(0x07f4f4f7f4f303f5), -CONST64(0xddcbcb0bcb16c08b), CONST64(0xd33e3ef83eedc67c), CONST64(0x2d0505140528110a), CONST64(0x78676781671fe6ce), -CONST64(0x97e4e4b7e47353d5), CONST64(0x0227279c2725bb4e), CONST64(0x7341411941325882), CONST64(0xa78b8b168b2c9d0b), -CONST64(0xf6a7a7a6a7510153), CONST64(0xb27d7de97dcf94fa), CONST64(0x4995956e95dcfb37), CONST64(0x56d8d847d88e9fad), -CONST64(0x70fbfbcbfb8b30eb), CONST64(0xcdeeee9fee2371c1), CONST64(0xbb7c7ced7cc791f8), CONST64(0x716666856617e3cc), -CONST64(0x7bdddd53dda68ea7), CONST64(0xaf17175c17b84b2e), CONST64(0x454747014702468e), CONST64(0x1a9e9e429e84dc21), -CONST64(0xd4caca0fca1ec589), CONST64(0x582d2db42d75995a), CONST64(0x2ebfbfc6bf917963), CONST64(0x3f07071c07381b0e), -CONST64(0xacadad8ead012347), CONST64(0xb05a5a755aea2fb4), CONST64(0xef838336836cb51b), CONST64(0xb63333cc3385ff66), -CONST64(0x5c636391633ff2c6), CONST64(0x1202020802100a04), CONST64(0x93aaaa92aa393849), CONST64(0xde7171d971afa8e2), -CONST64(0xc6c8c807c80ecf8d), CONST64(0xd119196419c87d32), CONST64(0x3b49493949727092), CONST64(0x5fd9d943d9869aaf), -CONST64(0x31f2f2eff2c31df9), CONST64(0xa8e3e3abe34b48db), CONST64(0xb95b5b715be22ab6), CONST64(0xbc88881a8834920d), -CONST64(0x3e9a9a529aa4c829), CONST64(0x0b262698262dbe4c), CONST64(0xbf3232c8328dfa64), CONST64(0x59b0b0fab0e94a7d), -CONST64(0xf2e9e983e91b6acf), CONST64(0x770f0f3c0f78331e), CONST64(0x33d5d573d5e6a6b7), CONST64(0xf480803a8074ba1d), -CONST64(0x27bebec2be997c61), CONST64(0xebcdcd13cd26de87), CONST64(0x893434d034bde468), CONST64(0x3248483d487a7590), -CONST64(0x54ffffdbffab24e3), CONST64(0x8d7a7af57af78ff4), CONST64(0x6490907a90f4ea3d), CONST64(0x9d5f5f615fc23ebe), -CONST64(0x3d202080201da040), CONST64(0x0f6868bd6867d5d0), CONST64(0xca1a1a681ad07234), CONST64(0xb7aeae82ae192c41), -CONST64(0x7db4b4eab4c95e75), CONST64(0xce54544d549a19a8), CONST64(0x7f93937693ece53b), CONST64(0x2f222288220daa44), -CONST64(0x6364648d6407e9c8), CONST64(0x2af1f1e3f1db12ff), CONST64(0xcc7373d173bfa2e6), CONST64(0x8212124812905a24), -CONST64(0x7a40401d403a5d80), CONST64(0x4808082008402810), CONST64(0x95c3c32bc356e89b), CONST64(0xdfecec97ec337bc5), -CONST64(0x4ddbdb4bdb9690ab), CONST64(0xc0a1a1bea1611f5f), CONST64(0x918d8d0e8d1c8307), CONST64(0xc83d3df43df5c97a), -CONST64(0x5b97976697ccf133), CONST64(0x0000000000000000), CONST64(0xf9cfcf1bcf36d483), CONST64(0x6e2b2bac2b458756), -CONST64(0xe17676c57697b3ec), CONST64(0xe68282328264b019), CONST64(0x28d6d67fd6fea9b1), CONST64(0xc31b1b6c1bd87736), -CONST64(0x74b5b5eeb5c15b77), CONST64(0xbeafaf86af112943), CONST64(0x1d6a6ab56a77dfd4), CONST64(0xea50505d50ba0da0), -CONST64(0x5745450945124c8a), CONST64(0x38f3f3ebf3cb18fb), CONST64(0xad3030c0309df060), CONST64(0xc4efef9bef2b74c3), -CONST64(0xda3f3ffc3fe5c37e), CONST64(0xc755554955921caa), CONST64(0xdba2a2b2a2791059), CONST64(0xe9eaea8fea0365c9), -CONST64(0x6a656589650fecca), CONST64(0x03babad2bab96869), CONST64(0x4a2f2fbc2f65935e), CONST64(0x8ec0c027c04ee79d), -CONST64(0x60dede5fdebe81a1), CONST64(0xfc1c1c701ce06c38), CONST64(0x46fdfdd3fdbb2ee7), CONST64(0x1f4d4d294d52649a), -CONST64(0x7692927292e4e039), CONST64(0xfa7575c9758fbcea), CONST64(0x3606061806301e0c), CONST64(0xae8a8a128a249809), -CONST64(0x4bb2b2f2b2f94079), CONST64(0x85e6e6bfe66359d1), CONST64(0x7e0e0e380e70361c), CONST64(0xe71f1f7c1ff8633e), -CONST64(0x556262956237f7c4), CONST64(0x3ad4d477d4eea3b5), CONST64(0x81a8a89aa829324d), CONST64(0x5296966296c4f431), -CONST64(0x62f9f9c3f99b3aef), CONST64(0xa3c5c533c566f697), CONST64(0x102525942535b14a), CONST64(0xab59597959f220b2), -CONST64(0xd084842a8454ae15), CONST64(0xc57272d572b7a7e4), CONST64(0xec3939e439d5dd72), CONST64(0x164c4c2d4c5a6198), -CONST64(0x945e5e655eca3bbc), CONST64(0x9f7878fd78e785f0), CONST64(0xe53838e038ddd870), CONST64(0x988c8c0a8c148605), -CONST64(0x17d1d163d1c6b2bf), CONST64(0xe4a5a5aea5410b57), CONST64(0xa1e2e2afe2434dd9), CONST64(0x4e616199612ff8c2), -CONST64(0x42b3b3f6b3f1457b), CONST64(0x342121842115a542), CONST64(0x089c9c4a9c94d625), CONST64(0xee1e1e781ef0663c), -CONST64(0x6143431143225286), CONST64(0xb1c7c73bc776fc93), CONST64(0x4ffcfcd7fcb32be5), CONST64(0x2404041004201408), -CONST64(0xe351515951b208a2), CONST64(0x2599995e99bcc72f), CONST64(0x226d6da96d4fc4da), CONST64(0x650d0d340d68391a), -CONST64(0x79fafacffa8335e9), CONST64(0x69dfdf5bdfb684a3), CONST64(0xa97e7ee57ed79bfc), CONST64(0x19242490243db448), -CONST64(0xfe3b3bec3bc5d776), CONST64(0x9aabab96ab313d4b), CONST64(0xf0cece1fce3ed181), CONST64(0x9911114411885522), -CONST64(0x838f8f068f0c8903), CONST64(0x044e4e254e4a6b9c), CONST64(0x66b7b7e6b7d15173), CONST64(0xe0ebeb8beb0b60cb), -CONST64(0xc13c3cf03cfdcc78), CONST64(0xfd81813e817cbf1f), CONST64(0x4094946a94d4fe35), CONST64(0x1cf7f7fbf7eb0cf3), -CONST64(0x18b9b9deb9a1676f), CONST64(0x8b13134c13985f26), CONST64(0x512c2cb02c7d9c58), CONST64(0x05d3d36bd3d6b8bb), -CONST64(0x8ce7e7bbe76b5cd3), CONST64(0x396e6ea56e57cbdc), CONST64(0xaac4c437c46ef395), CONST64(0x1b03030c03180f06), -CONST64(0xdc565645568a13ac), CONST64(0x5e44440d441a4988), CONST64(0xa07f7fe17fdf9efe), CONST64(0x88a9a99ea921374f), -CONST64(0x672a2aa82a4d8254), CONST64(0x0abbbbd6bbb16d6b), CONST64(0x87c1c123c146e29f), CONST64(0xf153535153a202a6), -CONST64(0x72dcdc57dcae8ba5), CONST64(0x530b0b2c0b582716), CONST64(0x019d9d4e9d9cd327), CONST64(0x2b6c6cad6c47c1d8), -CONST64(0xa43131c43195f562), CONST64(0xf37474cd7487b9e8), CONST64(0x15f6f6fff6e309f1), CONST64(0x4c464605460a438c), -CONST64(0xa5acac8aac092645), CONST64(0xb589891e893c970f), CONST64(0xb414145014a04428), CONST64(0xbae1e1a3e15b42df), -CONST64(0xa616165816b04e2c), CONST64(0xf73a3ae83acdd274), CONST64(0x066969b9696fd0d2), CONST64(0x4109092409482d12), -CONST64(0xd77070dd70a7ade0), CONST64(0x6fb6b6e2b6d95471), CONST64(0x1ed0d067d0ceb7bd), CONST64(0xd6eded93ed3b7ec7), -CONST64(0xe2cccc17cc2edb85), CONST64(0x68424215422a5784), CONST64(0x2c98985a98b4c22d), CONST64(0xeda4a4aaa4490e55), +CONST64(0xd818186018c07830), CONST64(0x2623238c2305af46), CONST64(0xb8c6c63fc67ef991), CONST64(0xfbe8e887e8136fcd), +CONST64(0xcb878726874ca113), CONST64(0x11b8b8dab8a9626d), CONST64(0x0901010401080502), CONST64(0x0d4f4f214f426e9e), +CONST64(0x9b3636d836adee6c), CONST64(0xffa6a6a2a6590451), CONST64(0x0cd2d26fd2debdb9), CONST64(0x0ef5f5f3f5fb06f7), +CONST64(0x967979f979ef80f2), CONST64(0x306f6fa16f5fcede), CONST64(0x6d91917e91fcef3f), CONST64(0xf852525552aa07a4), +CONST64(0x4760609d6027fdc0), CONST64(0x35bcbccabc897665), CONST64(0x379b9b569baccd2b), CONST64(0x8a8e8e028e048c01), +CONST64(0xd2a3a3b6a371155b), CONST64(0x6c0c0c300c603c18), CONST64(0x847b7bf17bff8af6), CONST64(0x803535d435b5e16a), +CONST64(0xf51d1d741de8693a), CONST64(0xb3e0e0a7e05347dd), CONST64(0x21d7d77bd7f6acb3), CONST64(0x9cc2c22fc25eed99), +CONST64(0x432e2eb82e6d965c), CONST64(0x294b4b314b627a96), CONST64(0x5dfefedffea321e1), CONST64(0xd5575741578216ae), +CONST64(0xbd15155415a8412a), CONST64(0xe87777c1779fb6ee), CONST64(0x923737dc37a5eb6e), CONST64(0x9ee5e5b3e57b56d7), +CONST64(0x139f9f469f8cd923), CONST64(0x23f0f0e7f0d317fd), CONST64(0x204a4a354a6a7f94), CONST64(0x44dada4fda9e95a9), +CONST64(0xa258587d58fa25b0), CONST64(0xcfc9c903c906ca8f), CONST64(0x7c2929a429558d52), CONST64(0x5a0a0a280a502214), +CONST64(0x50b1b1feb1e14f7f), CONST64(0xc9a0a0baa0691a5d), CONST64(0x146b6bb16b7fdad6), CONST64(0xd985852e855cab17), +CONST64(0x3cbdbdcebd817367), CONST64(0x8f5d5d695dd234ba), CONST64(0x9010104010805020), CONST64(0x07f4f4f7f4f303f5), +CONST64(0xddcbcb0bcb16c08b), CONST64(0xd33e3ef83eedc67c), CONST64(0x2d0505140528110a), CONST64(0x78676781671fe6ce), +CONST64(0x97e4e4b7e47353d5), CONST64(0x0227279c2725bb4e), CONST64(0x7341411941325882), CONST64(0xa78b8b168b2c9d0b), +CONST64(0xf6a7a7a6a7510153), CONST64(0xb27d7de97dcf94fa), CONST64(0x4995956e95dcfb37), CONST64(0x56d8d847d88e9fad), +CONST64(0x70fbfbcbfb8b30eb), CONST64(0xcdeeee9fee2371c1), CONST64(0xbb7c7ced7cc791f8), CONST64(0x716666856617e3cc), +CONST64(0x7bdddd53dda68ea7), CONST64(0xaf17175c17b84b2e), CONST64(0x454747014702468e), CONST64(0x1a9e9e429e84dc21), +CONST64(0xd4caca0fca1ec589), CONST64(0x582d2db42d75995a), CONST64(0x2ebfbfc6bf917963), CONST64(0x3f07071c07381b0e), +CONST64(0xacadad8ead012347), CONST64(0xb05a5a755aea2fb4), CONST64(0xef838336836cb51b), CONST64(0xb63333cc3385ff66), +CONST64(0x5c636391633ff2c6), CONST64(0x1202020802100a04), CONST64(0x93aaaa92aa393849), CONST64(0xde7171d971afa8e2), +CONST64(0xc6c8c807c80ecf8d), CONST64(0xd119196419c87d32), CONST64(0x3b49493949727092), CONST64(0x5fd9d943d9869aaf), +CONST64(0x31f2f2eff2c31df9), CONST64(0xa8e3e3abe34b48db), CONST64(0xb95b5b715be22ab6), CONST64(0xbc88881a8834920d), +CONST64(0x3e9a9a529aa4c829), CONST64(0x0b262698262dbe4c), CONST64(0xbf3232c8328dfa64), CONST64(0x59b0b0fab0e94a7d), +CONST64(0xf2e9e983e91b6acf), CONST64(0x770f0f3c0f78331e), CONST64(0x33d5d573d5e6a6b7), CONST64(0xf480803a8074ba1d), +CONST64(0x27bebec2be997c61), CONST64(0xebcdcd13cd26de87), CONST64(0x893434d034bde468), CONST64(0x3248483d487a7590), +CONST64(0x54ffffdbffab24e3), CONST64(0x8d7a7af57af78ff4), CONST64(0x6490907a90f4ea3d), CONST64(0x9d5f5f615fc23ebe), +CONST64(0x3d202080201da040), CONST64(0x0f6868bd6867d5d0), CONST64(0xca1a1a681ad07234), CONST64(0xb7aeae82ae192c41), +CONST64(0x7db4b4eab4c95e75), CONST64(0xce54544d549a19a8), CONST64(0x7f93937693ece53b), CONST64(0x2f222288220daa44), +CONST64(0x6364648d6407e9c8), CONST64(0x2af1f1e3f1db12ff), CONST64(0xcc7373d173bfa2e6), CONST64(0x8212124812905a24), +CONST64(0x7a40401d403a5d80), CONST64(0x4808082008402810), CONST64(0x95c3c32bc356e89b), CONST64(0xdfecec97ec337bc5), +CONST64(0x4ddbdb4bdb9690ab), CONST64(0xc0a1a1bea1611f5f), CONST64(0x918d8d0e8d1c8307), CONST64(0xc83d3df43df5c97a), +CONST64(0x5b97976697ccf133), CONST64(0x0000000000000000), CONST64(0xf9cfcf1bcf36d483), CONST64(0x6e2b2bac2b458756), +CONST64(0xe17676c57697b3ec), CONST64(0xe68282328264b019), CONST64(0x28d6d67fd6fea9b1), CONST64(0xc31b1b6c1bd87736), +CONST64(0x74b5b5eeb5c15b77), CONST64(0xbeafaf86af112943), CONST64(0x1d6a6ab56a77dfd4), CONST64(0xea50505d50ba0da0), +CONST64(0x5745450945124c8a), CONST64(0x38f3f3ebf3cb18fb), CONST64(0xad3030c0309df060), CONST64(0xc4efef9bef2b74c3), +CONST64(0xda3f3ffc3fe5c37e), CONST64(0xc755554955921caa), CONST64(0xdba2a2b2a2791059), CONST64(0xe9eaea8fea0365c9), +CONST64(0x6a656589650fecca), CONST64(0x03babad2bab96869), CONST64(0x4a2f2fbc2f65935e), CONST64(0x8ec0c027c04ee79d), +CONST64(0x60dede5fdebe81a1), CONST64(0xfc1c1c701ce06c38), CONST64(0x46fdfdd3fdbb2ee7), CONST64(0x1f4d4d294d52649a), +CONST64(0x7692927292e4e039), CONST64(0xfa7575c9758fbcea), CONST64(0x3606061806301e0c), CONST64(0xae8a8a128a249809), +CONST64(0x4bb2b2f2b2f94079), CONST64(0x85e6e6bfe66359d1), CONST64(0x7e0e0e380e70361c), CONST64(0xe71f1f7c1ff8633e), +CONST64(0x556262956237f7c4), CONST64(0x3ad4d477d4eea3b5), CONST64(0x81a8a89aa829324d), CONST64(0x5296966296c4f431), +CONST64(0x62f9f9c3f99b3aef), CONST64(0xa3c5c533c566f697), CONST64(0x102525942535b14a), CONST64(0xab59597959f220b2), +CONST64(0xd084842a8454ae15), CONST64(0xc57272d572b7a7e4), CONST64(0xec3939e439d5dd72), CONST64(0x164c4c2d4c5a6198), +CONST64(0x945e5e655eca3bbc), CONST64(0x9f7878fd78e785f0), CONST64(0xe53838e038ddd870), CONST64(0x988c8c0a8c148605), +CONST64(0x17d1d163d1c6b2bf), CONST64(0xe4a5a5aea5410b57), CONST64(0xa1e2e2afe2434dd9), CONST64(0x4e616199612ff8c2), +CONST64(0x42b3b3f6b3f1457b), CONST64(0x342121842115a542), CONST64(0x089c9c4a9c94d625), CONST64(0xee1e1e781ef0663c), +CONST64(0x6143431143225286), CONST64(0xb1c7c73bc776fc93), CONST64(0x4ffcfcd7fcb32be5), CONST64(0x2404041004201408), +CONST64(0xe351515951b208a2), CONST64(0x2599995e99bcc72f), CONST64(0x226d6da96d4fc4da), CONST64(0x650d0d340d68391a), +CONST64(0x79fafacffa8335e9), CONST64(0x69dfdf5bdfb684a3), CONST64(0xa97e7ee57ed79bfc), CONST64(0x19242490243db448), +CONST64(0xfe3b3bec3bc5d776), CONST64(0x9aabab96ab313d4b), CONST64(0xf0cece1fce3ed181), CONST64(0x9911114411885522), +CONST64(0x838f8f068f0c8903), CONST64(0x044e4e254e4a6b9c), CONST64(0x66b7b7e6b7d15173), CONST64(0xe0ebeb8beb0b60cb), +CONST64(0xc13c3cf03cfdcc78), CONST64(0xfd81813e817cbf1f), CONST64(0x4094946a94d4fe35), CONST64(0x1cf7f7fbf7eb0cf3), +CONST64(0x18b9b9deb9a1676f), CONST64(0x8b13134c13985f26), CONST64(0x512c2cb02c7d9c58), CONST64(0x05d3d36bd3d6b8bb), +CONST64(0x8ce7e7bbe76b5cd3), CONST64(0x396e6ea56e57cbdc), CONST64(0xaac4c437c46ef395), CONST64(0x1b03030c03180f06), +CONST64(0xdc565645568a13ac), CONST64(0x5e44440d441a4988), CONST64(0xa07f7fe17fdf9efe), CONST64(0x88a9a99ea921374f), +CONST64(0x672a2aa82a4d8254), CONST64(0x0abbbbd6bbb16d6b), CONST64(0x87c1c123c146e29f), CONST64(0xf153535153a202a6), +CONST64(0x72dcdc57dcae8ba5), CONST64(0x530b0b2c0b582716), CONST64(0x019d9d4e9d9cd327), CONST64(0x2b6c6cad6c47c1d8), +CONST64(0xa43131c43195f562), CONST64(0xf37474cd7487b9e8), CONST64(0x15f6f6fff6e309f1), CONST64(0x4c464605460a438c), +CONST64(0xa5acac8aac092645), CONST64(0xb589891e893c970f), CONST64(0xb414145014a04428), CONST64(0xbae1e1a3e15b42df), +CONST64(0xa616165816b04e2c), CONST64(0xf73a3ae83acdd274), CONST64(0x066969b9696fd0d2), CONST64(0x4109092409482d12), +CONST64(0xd77070dd70a7ade0), CONST64(0x6fb6b6e2b6d95471), CONST64(0x1ed0d067d0ceb7bd), CONST64(0xd6eded93ed3b7ec7), +CONST64(0xe2cccc17cc2edb85), CONST64(0x68424215422a5784), CONST64(0x2c98985a98b4c22d), CONST64(0xeda4a4aaa4490e55), CONST64(0x752828a0285d8850), CONST64(0x865c5c6d5cda31b8), CONST64(0x6bf8f8c7f8933fed), CONST64(0xc28686228644a411) }; static const ulong64 sbox2[] = { -CONST64(0x30d818186018c078), CONST64(0x462623238c2305af), CONST64(0x91b8c6c63fc67ef9), CONST64(0xcdfbe8e887e8136f), -CONST64(0x13cb878726874ca1), CONST64(0x6d11b8b8dab8a962), CONST64(0x0209010104010805), CONST64(0x9e0d4f4f214f426e), -CONST64(0x6c9b3636d836adee), CONST64(0x51ffa6a6a2a65904), CONST64(0xb90cd2d26fd2debd), CONST64(0xf70ef5f5f3f5fb06), -CONST64(0xf2967979f979ef80), CONST64(0xde306f6fa16f5fce), CONST64(0x3f6d91917e91fcef), CONST64(0xa4f852525552aa07), -CONST64(0xc04760609d6027fd), CONST64(0x6535bcbccabc8976), CONST64(0x2b379b9b569baccd), CONST64(0x018a8e8e028e048c), -CONST64(0x5bd2a3a3b6a37115), CONST64(0x186c0c0c300c603c), CONST64(0xf6847b7bf17bff8a), CONST64(0x6a803535d435b5e1), -CONST64(0x3af51d1d741de869), CONST64(0xddb3e0e0a7e05347), CONST64(0xb321d7d77bd7f6ac), CONST64(0x999cc2c22fc25eed), -CONST64(0x5c432e2eb82e6d96), CONST64(0x96294b4b314b627a), CONST64(0xe15dfefedffea321), CONST64(0xaed5575741578216), -CONST64(0x2abd15155415a841), CONST64(0xeee87777c1779fb6), CONST64(0x6e923737dc37a5eb), CONST64(0xd79ee5e5b3e57b56), -CONST64(0x23139f9f469f8cd9), CONST64(0xfd23f0f0e7f0d317), CONST64(0x94204a4a354a6a7f), CONST64(0xa944dada4fda9e95), -CONST64(0xb0a258587d58fa25), CONST64(0x8fcfc9c903c906ca), CONST64(0x527c2929a429558d), CONST64(0x145a0a0a280a5022), -CONST64(0x7f50b1b1feb1e14f), CONST64(0x5dc9a0a0baa0691a), CONST64(0xd6146b6bb16b7fda), CONST64(0x17d985852e855cab), -CONST64(0x673cbdbdcebd8173), CONST64(0xba8f5d5d695dd234), CONST64(0x2090101040108050), CONST64(0xf507f4f4f7f4f303), -CONST64(0x8bddcbcb0bcb16c0), CONST64(0x7cd33e3ef83eedc6), CONST64(0x0a2d050514052811), CONST64(0xce78676781671fe6), -CONST64(0xd597e4e4b7e47353), CONST64(0x4e0227279c2725bb), CONST64(0x8273414119413258), CONST64(0x0ba78b8b168b2c9d), -CONST64(0x53f6a7a7a6a75101), CONST64(0xfab27d7de97dcf94), CONST64(0x374995956e95dcfb), CONST64(0xad56d8d847d88e9f), -CONST64(0xeb70fbfbcbfb8b30), CONST64(0xc1cdeeee9fee2371), CONST64(0xf8bb7c7ced7cc791), CONST64(0xcc716666856617e3), -CONST64(0xa77bdddd53dda68e), CONST64(0x2eaf17175c17b84b), CONST64(0x8e45474701470246), CONST64(0x211a9e9e429e84dc), -CONST64(0x89d4caca0fca1ec5), CONST64(0x5a582d2db42d7599), CONST64(0x632ebfbfc6bf9179), CONST64(0x0e3f07071c07381b), -CONST64(0x47acadad8ead0123), CONST64(0xb4b05a5a755aea2f), CONST64(0x1bef838336836cb5), CONST64(0x66b63333cc3385ff), -CONST64(0xc65c636391633ff2), CONST64(0x041202020802100a), CONST64(0x4993aaaa92aa3938), CONST64(0xe2de7171d971afa8), -CONST64(0x8dc6c8c807c80ecf), CONST64(0x32d119196419c87d), CONST64(0x923b494939497270), CONST64(0xaf5fd9d943d9869a), -CONST64(0xf931f2f2eff2c31d), CONST64(0xdba8e3e3abe34b48), CONST64(0xb6b95b5b715be22a), CONST64(0x0dbc88881a883492), -CONST64(0x293e9a9a529aa4c8), CONST64(0x4c0b262698262dbe), CONST64(0x64bf3232c8328dfa), CONST64(0x7d59b0b0fab0e94a), -CONST64(0xcff2e9e983e91b6a), CONST64(0x1e770f0f3c0f7833), CONST64(0xb733d5d573d5e6a6), CONST64(0x1df480803a8074ba), -CONST64(0x6127bebec2be997c), CONST64(0x87ebcdcd13cd26de), CONST64(0x68893434d034bde4), CONST64(0x903248483d487a75), -CONST64(0xe354ffffdbffab24), CONST64(0xf48d7a7af57af78f), CONST64(0x3d6490907a90f4ea), CONST64(0xbe9d5f5f615fc23e), -CONST64(0x403d202080201da0), CONST64(0xd00f6868bd6867d5), CONST64(0x34ca1a1a681ad072), CONST64(0x41b7aeae82ae192c), -CONST64(0x757db4b4eab4c95e), CONST64(0xa8ce54544d549a19), CONST64(0x3b7f93937693ece5), CONST64(0x442f222288220daa), -CONST64(0xc86364648d6407e9), CONST64(0xff2af1f1e3f1db12), CONST64(0xe6cc7373d173bfa2), CONST64(0x248212124812905a), -CONST64(0x807a40401d403a5d), CONST64(0x1048080820084028), CONST64(0x9b95c3c32bc356e8), CONST64(0xc5dfecec97ec337b), -CONST64(0xab4ddbdb4bdb9690), CONST64(0x5fc0a1a1bea1611f), CONST64(0x07918d8d0e8d1c83), CONST64(0x7ac83d3df43df5c9), -CONST64(0x335b97976697ccf1), CONST64(0x0000000000000000), CONST64(0x83f9cfcf1bcf36d4), CONST64(0x566e2b2bac2b4587), -CONST64(0xece17676c57697b3), CONST64(0x19e68282328264b0), CONST64(0xb128d6d67fd6fea9), CONST64(0x36c31b1b6c1bd877), -CONST64(0x7774b5b5eeb5c15b), CONST64(0x43beafaf86af1129), CONST64(0xd41d6a6ab56a77df), CONST64(0xa0ea50505d50ba0d), -CONST64(0x8a5745450945124c), CONST64(0xfb38f3f3ebf3cb18), CONST64(0x60ad3030c0309df0), CONST64(0xc3c4efef9bef2b74), -CONST64(0x7eda3f3ffc3fe5c3), CONST64(0xaac755554955921c), CONST64(0x59dba2a2b2a27910), CONST64(0xc9e9eaea8fea0365), -CONST64(0xca6a656589650fec), CONST64(0x6903babad2bab968), CONST64(0x5e4a2f2fbc2f6593), CONST64(0x9d8ec0c027c04ee7), -CONST64(0xa160dede5fdebe81), CONST64(0x38fc1c1c701ce06c), CONST64(0xe746fdfdd3fdbb2e), CONST64(0x9a1f4d4d294d5264), -CONST64(0x397692927292e4e0), CONST64(0xeafa7575c9758fbc), CONST64(0x0c3606061806301e), CONST64(0x09ae8a8a128a2498), -CONST64(0x794bb2b2f2b2f940), CONST64(0xd185e6e6bfe66359), CONST64(0x1c7e0e0e380e7036), CONST64(0x3ee71f1f7c1ff863), -CONST64(0xc4556262956237f7), CONST64(0xb53ad4d477d4eea3), CONST64(0x4d81a8a89aa82932), CONST64(0x315296966296c4f4), -CONST64(0xef62f9f9c3f99b3a), CONST64(0x97a3c5c533c566f6), CONST64(0x4a102525942535b1), CONST64(0xb2ab59597959f220), -CONST64(0x15d084842a8454ae), CONST64(0xe4c57272d572b7a7), CONST64(0x72ec3939e439d5dd), CONST64(0x98164c4c2d4c5a61), -CONST64(0xbc945e5e655eca3b), CONST64(0xf09f7878fd78e785), CONST64(0x70e53838e038ddd8), CONST64(0x05988c8c0a8c1486), -CONST64(0xbf17d1d163d1c6b2), CONST64(0x57e4a5a5aea5410b), CONST64(0xd9a1e2e2afe2434d), CONST64(0xc24e616199612ff8), -CONST64(0x7b42b3b3f6b3f145), CONST64(0x42342121842115a5), CONST64(0x25089c9c4a9c94d6), CONST64(0x3cee1e1e781ef066), -CONST64(0x8661434311432252), CONST64(0x93b1c7c73bc776fc), CONST64(0xe54ffcfcd7fcb32b), CONST64(0x0824040410042014), -CONST64(0xa2e351515951b208), CONST64(0x2f2599995e99bcc7), CONST64(0xda226d6da96d4fc4), CONST64(0x1a650d0d340d6839), -CONST64(0xe979fafacffa8335), CONST64(0xa369dfdf5bdfb684), CONST64(0xfca97e7ee57ed79b), CONST64(0x4819242490243db4), -CONST64(0x76fe3b3bec3bc5d7), CONST64(0x4b9aabab96ab313d), CONST64(0x81f0cece1fce3ed1), CONST64(0x2299111144118855), -CONST64(0x03838f8f068f0c89), CONST64(0x9c044e4e254e4a6b), CONST64(0x7366b7b7e6b7d151), CONST64(0xcbe0ebeb8beb0b60), -CONST64(0x78c13c3cf03cfdcc), CONST64(0x1ffd81813e817cbf), CONST64(0x354094946a94d4fe), CONST64(0xf31cf7f7fbf7eb0c), -CONST64(0x6f18b9b9deb9a167), CONST64(0x268b13134c13985f), CONST64(0x58512c2cb02c7d9c), CONST64(0xbb05d3d36bd3d6b8), -CONST64(0xd38ce7e7bbe76b5c), CONST64(0xdc396e6ea56e57cb), CONST64(0x95aac4c437c46ef3), CONST64(0x061b03030c03180f), -CONST64(0xacdc565645568a13), CONST64(0x885e44440d441a49), CONST64(0xfea07f7fe17fdf9e), CONST64(0x4f88a9a99ea92137), -CONST64(0x54672a2aa82a4d82), CONST64(0x6b0abbbbd6bbb16d), CONST64(0x9f87c1c123c146e2), CONST64(0xa6f153535153a202), -CONST64(0xa572dcdc57dcae8b), CONST64(0x16530b0b2c0b5827), CONST64(0x27019d9d4e9d9cd3), CONST64(0xd82b6c6cad6c47c1), -CONST64(0x62a43131c43195f5), CONST64(0xe8f37474cd7487b9), CONST64(0xf115f6f6fff6e309), CONST64(0x8c4c464605460a43), -CONST64(0x45a5acac8aac0926), CONST64(0x0fb589891e893c97), CONST64(0x28b414145014a044), CONST64(0xdfbae1e1a3e15b42), -CONST64(0x2ca616165816b04e), CONST64(0x74f73a3ae83acdd2), CONST64(0xd2066969b9696fd0), CONST64(0x124109092409482d), -CONST64(0xe0d77070dd70a7ad), CONST64(0x716fb6b6e2b6d954), CONST64(0xbd1ed0d067d0ceb7), CONST64(0xc7d6eded93ed3b7e), -CONST64(0x85e2cccc17cc2edb), CONST64(0x8468424215422a57), CONST64(0x2d2c98985a98b4c2), CONST64(0x55eda4a4aaa4490e), +CONST64(0x30d818186018c078), CONST64(0x462623238c2305af), CONST64(0x91b8c6c63fc67ef9), CONST64(0xcdfbe8e887e8136f), +CONST64(0x13cb878726874ca1), CONST64(0x6d11b8b8dab8a962), CONST64(0x0209010104010805), CONST64(0x9e0d4f4f214f426e), +CONST64(0x6c9b3636d836adee), CONST64(0x51ffa6a6a2a65904), CONST64(0xb90cd2d26fd2debd), CONST64(0xf70ef5f5f3f5fb06), +CONST64(0xf2967979f979ef80), CONST64(0xde306f6fa16f5fce), CONST64(0x3f6d91917e91fcef), CONST64(0xa4f852525552aa07), +CONST64(0xc04760609d6027fd), CONST64(0x6535bcbccabc8976), CONST64(0x2b379b9b569baccd), CONST64(0x018a8e8e028e048c), +CONST64(0x5bd2a3a3b6a37115), CONST64(0x186c0c0c300c603c), CONST64(0xf6847b7bf17bff8a), CONST64(0x6a803535d435b5e1), +CONST64(0x3af51d1d741de869), CONST64(0xddb3e0e0a7e05347), CONST64(0xb321d7d77bd7f6ac), CONST64(0x999cc2c22fc25eed), +CONST64(0x5c432e2eb82e6d96), CONST64(0x96294b4b314b627a), CONST64(0xe15dfefedffea321), CONST64(0xaed5575741578216), +CONST64(0x2abd15155415a841), CONST64(0xeee87777c1779fb6), CONST64(0x6e923737dc37a5eb), CONST64(0xd79ee5e5b3e57b56), +CONST64(0x23139f9f469f8cd9), CONST64(0xfd23f0f0e7f0d317), CONST64(0x94204a4a354a6a7f), CONST64(0xa944dada4fda9e95), +CONST64(0xb0a258587d58fa25), CONST64(0x8fcfc9c903c906ca), CONST64(0x527c2929a429558d), CONST64(0x145a0a0a280a5022), +CONST64(0x7f50b1b1feb1e14f), CONST64(0x5dc9a0a0baa0691a), CONST64(0xd6146b6bb16b7fda), CONST64(0x17d985852e855cab), +CONST64(0x673cbdbdcebd8173), CONST64(0xba8f5d5d695dd234), CONST64(0x2090101040108050), CONST64(0xf507f4f4f7f4f303), +CONST64(0x8bddcbcb0bcb16c0), CONST64(0x7cd33e3ef83eedc6), CONST64(0x0a2d050514052811), CONST64(0xce78676781671fe6), +CONST64(0xd597e4e4b7e47353), CONST64(0x4e0227279c2725bb), CONST64(0x8273414119413258), CONST64(0x0ba78b8b168b2c9d), +CONST64(0x53f6a7a7a6a75101), CONST64(0xfab27d7de97dcf94), CONST64(0x374995956e95dcfb), CONST64(0xad56d8d847d88e9f), +CONST64(0xeb70fbfbcbfb8b30), CONST64(0xc1cdeeee9fee2371), CONST64(0xf8bb7c7ced7cc791), CONST64(0xcc716666856617e3), +CONST64(0xa77bdddd53dda68e), CONST64(0x2eaf17175c17b84b), CONST64(0x8e45474701470246), CONST64(0x211a9e9e429e84dc), +CONST64(0x89d4caca0fca1ec5), CONST64(0x5a582d2db42d7599), CONST64(0x632ebfbfc6bf9179), CONST64(0x0e3f07071c07381b), +CONST64(0x47acadad8ead0123), CONST64(0xb4b05a5a755aea2f), CONST64(0x1bef838336836cb5), CONST64(0x66b63333cc3385ff), +CONST64(0xc65c636391633ff2), CONST64(0x041202020802100a), CONST64(0x4993aaaa92aa3938), CONST64(0xe2de7171d971afa8), +CONST64(0x8dc6c8c807c80ecf), CONST64(0x32d119196419c87d), CONST64(0x923b494939497270), CONST64(0xaf5fd9d943d9869a), +CONST64(0xf931f2f2eff2c31d), CONST64(0xdba8e3e3abe34b48), CONST64(0xb6b95b5b715be22a), CONST64(0x0dbc88881a883492), +CONST64(0x293e9a9a529aa4c8), CONST64(0x4c0b262698262dbe), CONST64(0x64bf3232c8328dfa), CONST64(0x7d59b0b0fab0e94a), +CONST64(0xcff2e9e983e91b6a), CONST64(0x1e770f0f3c0f7833), CONST64(0xb733d5d573d5e6a6), CONST64(0x1df480803a8074ba), +CONST64(0x6127bebec2be997c), CONST64(0x87ebcdcd13cd26de), CONST64(0x68893434d034bde4), CONST64(0x903248483d487a75), +CONST64(0xe354ffffdbffab24), CONST64(0xf48d7a7af57af78f), CONST64(0x3d6490907a90f4ea), CONST64(0xbe9d5f5f615fc23e), +CONST64(0x403d202080201da0), CONST64(0xd00f6868bd6867d5), CONST64(0x34ca1a1a681ad072), CONST64(0x41b7aeae82ae192c), +CONST64(0x757db4b4eab4c95e), CONST64(0xa8ce54544d549a19), CONST64(0x3b7f93937693ece5), CONST64(0x442f222288220daa), +CONST64(0xc86364648d6407e9), CONST64(0xff2af1f1e3f1db12), CONST64(0xe6cc7373d173bfa2), CONST64(0x248212124812905a), +CONST64(0x807a40401d403a5d), CONST64(0x1048080820084028), CONST64(0x9b95c3c32bc356e8), CONST64(0xc5dfecec97ec337b), +CONST64(0xab4ddbdb4bdb9690), CONST64(0x5fc0a1a1bea1611f), CONST64(0x07918d8d0e8d1c83), CONST64(0x7ac83d3df43df5c9), +CONST64(0x335b97976697ccf1), CONST64(0x0000000000000000), CONST64(0x83f9cfcf1bcf36d4), CONST64(0x566e2b2bac2b4587), +CONST64(0xece17676c57697b3), CONST64(0x19e68282328264b0), CONST64(0xb128d6d67fd6fea9), CONST64(0x36c31b1b6c1bd877), +CONST64(0x7774b5b5eeb5c15b), CONST64(0x43beafaf86af1129), CONST64(0xd41d6a6ab56a77df), CONST64(0xa0ea50505d50ba0d), +CONST64(0x8a5745450945124c), CONST64(0xfb38f3f3ebf3cb18), CONST64(0x60ad3030c0309df0), CONST64(0xc3c4efef9bef2b74), +CONST64(0x7eda3f3ffc3fe5c3), CONST64(0xaac755554955921c), CONST64(0x59dba2a2b2a27910), CONST64(0xc9e9eaea8fea0365), +CONST64(0xca6a656589650fec), CONST64(0x6903babad2bab968), CONST64(0x5e4a2f2fbc2f6593), CONST64(0x9d8ec0c027c04ee7), +CONST64(0xa160dede5fdebe81), CONST64(0x38fc1c1c701ce06c), CONST64(0xe746fdfdd3fdbb2e), CONST64(0x9a1f4d4d294d5264), +CONST64(0x397692927292e4e0), CONST64(0xeafa7575c9758fbc), CONST64(0x0c3606061806301e), CONST64(0x09ae8a8a128a2498), +CONST64(0x794bb2b2f2b2f940), CONST64(0xd185e6e6bfe66359), CONST64(0x1c7e0e0e380e7036), CONST64(0x3ee71f1f7c1ff863), +CONST64(0xc4556262956237f7), CONST64(0xb53ad4d477d4eea3), CONST64(0x4d81a8a89aa82932), CONST64(0x315296966296c4f4), +CONST64(0xef62f9f9c3f99b3a), CONST64(0x97a3c5c533c566f6), CONST64(0x4a102525942535b1), CONST64(0xb2ab59597959f220), +CONST64(0x15d084842a8454ae), CONST64(0xe4c57272d572b7a7), CONST64(0x72ec3939e439d5dd), CONST64(0x98164c4c2d4c5a61), +CONST64(0xbc945e5e655eca3b), CONST64(0xf09f7878fd78e785), CONST64(0x70e53838e038ddd8), CONST64(0x05988c8c0a8c1486), +CONST64(0xbf17d1d163d1c6b2), CONST64(0x57e4a5a5aea5410b), CONST64(0xd9a1e2e2afe2434d), CONST64(0xc24e616199612ff8), +CONST64(0x7b42b3b3f6b3f145), CONST64(0x42342121842115a5), CONST64(0x25089c9c4a9c94d6), CONST64(0x3cee1e1e781ef066), +CONST64(0x8661434311432252), CONST64(0x93b1c7c73bc776fc), CONST64(0xe54ffcfcd7fcb32b), CONST64(0x0824040410042014), +CONST64(0xa2e351515951b208), CONST64(0x2f2599995e99bcc7), CONST64(0xda226d6da96d4fc4), CONST64(0x1a650d0d340d6839), +CONST64(0xe979fafacffa8335), CONST64(0xa369dfdf5bdfb684), CONST64(0xfca97e7ee57ed79b), CONST64(0x4819242490243db4), +CONST64(0x76fe3b3bec3bc5d7), CONST64(0x4b9aabab96ab313d), CONST64(0x81f0cece1fce3ed1), CONST64(0x2299111144118855), +CONST64(0x03838f8f068f0c89), CONST64(0x9c044e4e254e4a6b), CONST64(0x7366b7b7e6b7d151), CONST64(0xcbe0ebeb8beb0b60), +CONST64(0x78c13c3cf03cfdcc), CONST64(0x1ffd81813e817cbf), CONST64(0x354094946a94d4fe), CONST64(0xf31cf7f7fbf7eb0c), +CONST64(0x6f18b9b9deb9a167), CONST64(0x268b13134c13985f), CONST64(0x58512c2cb02c7d9c), CONST64(0xbb05d3d36bd3d6b8), +CONST64(0xd38ce7e7bbe76b5c), CONST64(0xdc396e6ea56e57cb), CONST64(0x95aac4c437c46ef3), CONST64(0x061b03030c03180f), +CONST64(0xacdc565645568a13), CONST64(0x885e44440d441a49), CONST64(0xfea07f7fe17fdf9e), CONST64(0x4f88a9a99ea92137), +CONST64(0x54672a2aa82a4d82), CONST64(0x6b0abbbbd6bbb16d), CONST64(0x9f87c1c123c146e2), CONST64(0xa6f153535153a202), +CONST64(0xa572dcdc57dcae8b), CONST64(0x16530b0b2c0b5827), CONST64(0x27019d9d4e9d9cd3), CONST64(0xd82b6c6cad6c47c1), +CONST64(0x62a43131c43195f5), CONST64(0xe8f37474cd7487b9), CONST64(0xf115f6f6fff6e309), CONST64(0x8c4c464605460a43), +CONST64(0x45a5acac8aac0926), CONST64(0x0fb589891e893c97), CONST64(0x28b414145014a044), CONST64(0xdfbae1e1a3e15b42), +CONST64(0x2ca616165816b04e), CONST64(0x74f73a3ae83acdd2), CONST64(0xd2066969b9696fd0), CONST64(0x124109092409482d), +CONST64(0xe0d77070dd70a7ad), CONST64(0x716fb6b6e2b6d954), CONST64(0xbd1ed0d067d0ceb7), CONST64(0xc7d6eded93ed3b7e), +CONST64(0x85e2cccc17cc2edb), CONST64(0x8468424215422a57), CONST64(0x2d2c98985a98b4c2), CONST64(0x55eda4a4aaa4490e), CONST64(0x50752828a0285d88), CONST64(0xb8865c5c6d5cda31), CONST64(0xed6bf8f8c7f8933f), CONST64(0x11c28686228644a4) }; static const ulong64 sbox3[] = { -CONST64(0x7830d818186018c0), CONST64(0xaf462623238c2305), CONST64(0xf991b8c6c63fc67e), CONST64(0x6fcdfbe8e887e813), -CONST64(0xa113cb878726874c), CONST64(0x626d11b8b8dab8a9), CONST64(0x0502090101040108), CONST64(0x6e9e0d4f4f214f42), -CONST64(0xee6c9b3636d836ad), CONST64(0x0451ffa6a6a2a659), CONST64(0xbdb90cd2d26fd2de), CONST64(0x06f70ef5f5f3f5fb), -CONST64(0x80f2967979f979ef), CONST64(0xcede306f6fa16f5f), CONST64(0xef3f6d91917e91fc), CONST64(0x07a4f852525552aa), -CONST64(0xfdc04760609d6027), CONST64(0x766535bcbccabc89), CONST64(0xcd2b379b9b569bac), CONST64(0x8c018a8e8e028e04), -CONST64(0x155bd2a3a3b6a371), CONST64(0x3c186c0c0c300c60), CONST64(0x8af6847b7bf17bff), CONST64(0xe16a803535d435b5), -CONST64(0x693af51d1d741de8), CONST64(0x47ddb3e0e0a7e053), CONST64(0xacb321d7d77bd7f6), CONST64(0xed999cc2c22fc25e), -CONST64(0x965c432e2eb82e6d), CONST64(0x7a96294b4b314b62), CONST64(0x21e15dfefedffea3), CONST64(0x16aed55757415782), -CONST64(0x412abd15155415a8), CONST64(0xb6eee87777c1779f), CONST64(0xeb6e923737dc37a5), CONST64(0x56d79ee5e5b3e57b), -CONST64(0xd923139f9f469f8c), CONST64(0x17fd23f0f0e7f0d3), CONST64(0x7f94204a4a354a6a), CONST64(0x95a944dada4fda9e), -CONST64(0x25b0a258587d58fa), CONST64(0xca8fcfc9c903c906), CONST64(0x8d527c2929a42955), CONST64(0x22145a0a0a280a50), -CONST64(0x4f7f50b1b1feb1e1), CONST64(0x1a5dc9a0a0baa069), CONST64(0xdad6146b6bb16b7f), CONST64(0xab17d985852e855c), -CONST64(0x73673cbdbdcebd81), CONST64(0x34ba8f5d5d695dd2), CONST64(0x5020901010401080), CONST64(0x03f507f4f4f7f4f3), -CONST64(0xc08bddcbcb0bcb16), CONST64(0xc67cd33e3ef83eed), CONST64(0x110a2d0505140528), CONST64(0xe6ce78676781671f), -CONST64(0x53d597e4e4b7e473), CONST64(0xbb4e0227279c2725), CONST64(0x5882734141194132), CONST64(0x9d0ba78b8b168b2c), -CONST64(0x0153f6a7a7a6a751), CONST64(0x94fab27d7de97dcf), CONST64(0xfb374995956e95dc), CONST64(0x9fad56d8d847d88e), -CONST64(0x30eb70fbfbcbfb8b), CONST64(0x71c1cdeeee9fee23), CONST64(0x91f8bb7c7ced7cc7), CONST64(0xe3cc716666856617), -CONST64(0x8ea77bdddd53dda6), CONST64(0x4b2eaf17175c17b8), CONST64(0x468e454747014702), CONST64(0xdc211a9e9e429e84), -CONST64(0xc589d4caca0fca1e), CONST64(0x995a582d2db42d75), CONST64(0x79632ebfbfc6bf91), CONST64(0x1b0e3f07071c0738), -CONST64(0x2347acadad8ead01), CONST64(0x2fb4b05a5a755aea), CONST64(0xb51bef838336836c), CONST64(0xff66b63333cc3385), -CONST64(0xf2c65c636391633f), CONST64(0x0a04120202080210), CONST64(0x384993aaaa92aa39), CONST64(0xa8e2de7171d971af), -CONST64(0xcf8dc6c8c807c80e), CONST64(0x7d32d119196419c8), CONST64(0x70923b4949394972), CONST64(0x9aaf5fd9d943d986), -CONST64(0x1df931f2f2eff2c3), CONST64(0x48dba8e3e3abe34b), CONST64(0x2ab6b95b5b715be2), CONST64(0x920dbc88881a8834), -CONST64(0xc8293e9a9a529aa4), CONST64(0xbe4c0b262698262d), CONST64(0xfa64bf3232c8328d), CONST64(0x4a7d59b0b0fab0e9), -CONST64(0x6acff2e9e983e91b), CONST64(0x331e770f0f3c0f78), CONST64(0xa6b733d5d573d5e6), CONST64(0xba1df480803a8074), -CONST64(0x7c6127bebec2be99), CONST64(0xde87ebcdcd13cd26), CONST64(0xe468893434d034bd), CONST64(0x75903248483d487a), -CONST64(0x24e354ffffdbffab), CONST64(0x8ff48d7a7af57af7), CONST64(0xea3d6490907a90f4), CONST64(0x3ebe9d5f5f615fc2), -CONST64(0xa0403d202080201d), CONST64(0xd5d00f6868bd6867), CONST64(0x7234ca1a1a681ad0), CONST64(0x2c41b7aeae82ae19), -CONST64(0x5e757db4b4eab4c9), CONST64(0x19a8ce54544d549a), CONST64(0xe53b7f93937693ec), CONST64(0xaa442f222288220d), -CONST64(0xe9c86364648d6407), CONST64(0x12ff2af1f1e3f1db), CONST64(0xa2e6cc7373d173bf), CONST64(0x5a24821212481290), -CONST64(0x5d807a40401d403a), CONST64(0x2810480808200840), CONST64(0xe89b95c3c32bc356), CONST64(0x7bc5dfecec97ec33), -CONST64(0x90ab4ddbdb4bdb96), CONST64(0x1f5fc0a1a1bea161), CONST64(0x8307918d8d0e8d1c), CONST64(0xc97ac83d3df43df5), -CONST64(0xf1335b97976697cc), CONST64(0x0000000000000000), CONST64(0xd483f9cfcf1bcf36), CONST64(0x87566e2b2bac2b45), -CONST64(0xb3ece17676c57697), CONST64(0xb019e68282328264), CONST64(0xa9b128d6d67fd6fe), CONST64(0x7736c31b1b6c1bd8), -CONST64(0x5b7774b5b5eeb5c1), CONST64(0x2943beafaf86af11), CONST64(0xdfd41d6a6ab56a77), CONST64(0x0da0ea50505d50ba), -CONST64(0x4c8a574545094512), CONST64(0x18fb38f3f3ebf3cb), CONST64(0xf060ad3030c0309d), CONST64(0x74c3c4efef9bef2b), -CONST64(0xc37eda3f3ffc3fe5), CONST64(0x1caac75555495592), CONST64(0x1059dba2a2b2a279), CONST64(0x65c9e9eaea8fea03), -CONST64(0xecca6a656589650f), CONST64(0x686903babad2bab9), CONST64(0x935e4a2f2fbc2f65), CONST64(0xe79d8ec0c027c04e), -CONST64(0x81a160dede5fdebe), CONST64(0x6c38fc1c1c701ce0), CONST64(0x2ee746fdfdd3fdbb), CONST64(0x649a1f4d4d294d52), -CONST64(0xe0397692927292e4), CONST64(0xbceafa7575c9758f), CONST64(0x1e0c360606180630), CONST64(0x9809ae8a8a128a24), -CONST64(0x40794bb2b2f2b2f9), CONST64(0x59d185e6e6bfe663), CONST64(0x361c7e0e0e380e70), CONST64(0x633ee71f1f7c1ff8), -CONST64(0xf7c4556262956237), CONST64(0xa3b53ad4d477d4ee), CONST64(0x324d81a8a89aa829), CONST64(0xf4315296966296c4), -CONST64(0x3aef62f9f9c3f99b), CONST64(0xf697a3c5c533c566), CONST64(0xb14a102525942535), CONST64(0x20b2ab59597959f2), -CONST64(0xae15d084842a8454), CONST64(0xa7e4c57272d572b7), CONST64(0xdd72ec3939e439d5), CONST64(0x6198164c4c2d4c5a), -CONST64(0x3bbc945e5e655eca), CONST64(0x85f09f7878fd78e7), CONST64(0xd870e53838e038dd), CONST64(0x8605988c8c0a8c14), -CONST64(0xb2bf17d1d163d1c6), CONST64(0x0b57e4a5a5aea541), CONST64(0x4dd9a1e2e2afe243), CONST64(0xf8c24e616199612f), -CONST64(0x457b42b3b3f6b3f1), CONST64(0xa542342121842115), CONST64(0xd625089c9c4a9c94), CONST64(0x663cee1e1e781ef0), -CONST64(0x5286614343114322), CONST64(0xfc93b1c7c73bc776), CONST64(0x2be54ffcfcd7fcb3), CONST64(0x1408240404100420), -CONST64(0x08a2e351515951b2), CONST64(0xc72f2599995e99bc), CONST64(0xc4da226d6da96d4f), CONST64(0x391a650d0d340d68), -CONST64(0x35e979fafacffa83), CONST64(0x84a369dfdf5bdfb6), CONST64(0x9bfca97e7ee57ed7), CONST64(0xb44819242490243d), -CONST64(0xd776fe3b3bec3bc5), CONST64(0x3d4b9aabab96ab31), CONST64(0xd181f0cece1fce3e), CONST64(0x5522991111441188), -CONST64(0x8903838f8f068f0c), CONST64(0x6b9c044e4e254e4a), CONST64(0x517366b7b7e6b7d1), CONST64(0x60cbe0ebeb8beb0b), -CONST64(0xcc78c13c3cf03cfd), CONST64(0xbf1ffd81813e817c), CONST64(0xfe354094946a94d4), CONST64(0x0cf31cf7f7fbf7eb), -CONST64(0x676f18b9b9deb9a1), CONST64(0x5f268b13134c1398), CONST64(0x9c58512c2cb02c7d), CONST64(0xb8bb05d3d36bd3d6), -CONST64(0x5cd38ce7e7bbe76b), CONST64(0xcbdc396e6ea56e57), CONST64(0xf395aac4c437c46e), CONST64(0x0f061b03030c0318), -CONST64(0x13acdc565645568a), CONST64(0x49885e44440d441a), CONST64(0x9efea07f7fe17fdf), CONST64(0x374f88a9a99ea921), -CONST64(0x8254672a2aa82a4d), CONST64(0x6d6b0abbbbd6bbb1), CONST64(0xe29f87c1c123c146), CONST64(0x02a6f153535153a2), -CONST64(0x8ba572dcdc57dcae), CONST64(0x2716530b0b2c0b58), CONST64(0xd327019d9d4e9d9c), CONST64(0xc1d82b6c6cad6c47), -CONST64(0xf562a43131c43195), CONST64(0xb9e8f37474cd7487), CONST64(0x09f115f6f6fff6e3), CONST64(0x438c4c464605460a), -CONST64(0x2645a5acac8aac09), CONST64(0x970fb589891e893c), CONST64(0x4428b414145014a0), CONST64(0x42dfbae1e1a3e15b), -CONST64(0x4e2ca616165816b0), CONST64(0xd274f73a3ae83acd), CONST64(0xd0d2066969b9696f), CONST64(0x2d12410909240948), -CONST64(0xade0d77070dd70a7), CONST64(0x54716fb6b6e2b6d9), CONST64(0xb7bd1ed0d067d0ce), CONST64(0x7ec7d6eded93ed3b), -CONST64(0xdb85e2cccc17cc2e), CONST64(0x578468424215422a), CONST64(0xc22d2c98985a98b4), CONST64(0x0e55eda4a4aaa449), +CONST64(0x7830d818186018c0), CONST64(0xaf462623238c2305), CONST64(0xf991b8c6c63fc67e), CONST64(0x6fcdfbe8e887e813), +CONST64(0xa113cb878726874c), CONST64(0x626d11b8b8dab8a9), CONST64(0x0502090101040108), CONST64(0x6e9e0d4f4f214f42), +CONST64(0xee6c9b3636d836ad), CONST64(0x0451ffa6a6a2a659), CONST64(0xbdb90cd2d26fd2de), CONST64(0x06f70ef5f5f3f5fb), +CONST64(0x80f2967979f979ef), CONST64(0xcede306f6fa16f5f), CONST64(0xef3f6d91917e91fc), CONST64(0x07a4f852525552aa), +CONST64(0xfdc04760609d6027), CONST64(0x766535bcbccabc89), CONST64(0xcd2b379b9b569bac), CONST64(0x8c018a8e8e028e04), +CONST64(0x155bd2a3a3b6a371), CONST64(0x3c186c0c0c300c60), CONST64(0x8af6847b7bf17bff), CONST64(0xe16a803535d435b5), +CONST64(0x693af51d1d741de8), CONST64(0x47ddb3e0e0a7e053), CONST64(0xacb321d7d77bd7f6), CONST64(0xed999cc2c22fc25e), +CONST64(0x965c432e2eb82e6d), CONST64(0x7a96294b4b314b62), CONST64(0x21e15dfefedffea3), CONST64(0x16aed55757415782), +CONST64(0x412abd15155415a8), CONST64(0xb6eee87777c1779f), CONST64(0xeb6e923737dc37a5), CONST64(0x56d79ee5e5b3e57b), +CONST64(0xd923139f9f469f8c), CONST64(0x17fd23f0f0e7f0d3), CONST64(0x7f94204a4a354a6a), CONST64(0x95a944dada4fda9e), +CONST64(0x25b0a258587d58fa), CONST64(0xca8fcfc9c903c906), CONST64(0x8d527c2929a42955), CONST64(0x22145a0a0a280a50), +CONST64(0x4f7f50b1b1feb1e1), CONST64(0x1a5dc9a0a0baa069), CONST64(0xdad6146b6bb16b7f), CONST64(0xab17d985852e855c), +CONST64(0x73673cbdbdcebd81), CONST64(0x34ba8f5d5d695dd2), CONST64(0x5020901010401080), CONST64(0x03f507f4f4f7f4f3), +CONST64(0xc08bddcbcb0bcb16), CONST64(0xc67cd33e3ef83eed), CONST64(0x110a2d0505140528), CONST64(0xe6ce78676781671f), +CONST64(0x53d597e4e4b7e473), CONST64(0xbb4e0227279c2725), CONST64(0x5882734141194132), CONST64(0x9d0ba78b8b168b2c), +CONST64(0x0153f6a7a7a6a751), CONST64(0x94fab27d7de97dcf), CONST64(0xfb374995956e95dc), CONST64(0x9fad56d8d847d88e), +CONST64(0x30eb70fbfbcbfb8b), CONST64(0x71c1cdeeee9fee23), CONST64(0x91f8bb7c7ced7cc7), CONST64(0xe3cc716666856617), +CONST64(0x8ea77bdddd53dda6), CONST64(0x4b2eaf17175c17b8), CONST64(0x468e454747014702), CONST64(0xdc211a9e9e429e84), +CONST64(0xc589d4caca0fca1e), CONST64(0x995a582d2db42d75), CONST64(0x79632ebfbfc6bf91), CONST64(0x1b0e3f07071c0738), +CONST64(0x2347acadad8ead01), CONST64(0x2fb4b05a5a755aea), CONST64(0xb51bef838336836c), CONST64(0xff66b63333cc3385), +CONST64(0xf2c65c636391633f), CONST64(0x0a04120202080210), CONST64(0x384993aaaa92aa39), CONST64(0xa8e2de7171d971af), +CONST64(0xcf8dc6c8c807c80e), CONST64(0x7d32d119196419c8), CONST64(0x70923b4949394972), CONST64(0x9aaf5fd9d943d986), +CONST64(0x1df931f2f2eff2c3), CONST64(0x48dba8e3e3abe34b), CONST64(0x2ab6b95b5b715be2), CONST64(0x920dbc88881a8834), +CONST64(0xc8293e9a9a529aa4), CONST64(0xbe4c0b262698262d), CONST64(0xfa64bf3232c8328d), CONST64(0x4a7d59b0b0fab0e9), +CONST64(0x6acff2e9e983e91b), CONST64(0x331e770f0f3c0f78), CONST64(0xa6b733d5d573d5e6), CONST64(0xba1df480803a8074), +CONST64(0x7c6127bebec2be99), CONST64(0xde87ebcdcd13cd26), CONST64(0xe468893434d034bd), CONST64(0x75903248483d487a), +CONST64(0x24e354ffffdbffab), CONST64(0x8ff48d7a7af57af7), CONST64(0xea3d6490907a90f4), CONST64(0x3ebe9d5f5f615fc2), +CONST64(0xa0403d202080201d), CONST64(0xd5d00f6868bd6867), CONST64(0x7234ca1a1a681ad0), CONST64(0x2c41b7aeae82ae19), +CONST64(0x5e757db4b4eab4c9), CONST64(0x19a8ce54544d549a), CONST64(0xe53b7f93937693ec), CONST64(0xaa442f222288220d), +CONST64(0xe9c86364648d6407), CONST64(0x12ff2af1f1e3f1db), CONST64(0xa2e6cc7373d173bf), CONST64(0x5a24821212481290), +CONST64(0x5d807a40401d403a), CONST64(0x2810480808200840), CONST64(0xe89b95c3c32bc356), CONST64(0x7bc5dfecec97ec33), +CONST64(0x90ab4ddbdb4bdb96), CONST64(0x1f5fc0a1a1bea161), CONST64(0x8307918d8d0e8d1c), CONST64(0xc97ac83d3df43df5), +CONST64(0xf1335b97976697cc), CONST64(0x0000000000000000), CONST64(0xd483f9cfcf1bcf36), CONST64(0x87566e2b2bac2b45), +CONST64(0xb3ece17676c57697), CONST64(0xb019e68282328264), CONST64(0xa9b128d6d67fd6fe), CONST64(0x7736c31b1b6c1bd8), +CONST64(0x5b7774b5b5eeb5c1), CONST64(0x2943beafaf86af11), CONST64(0xdfd41d6a6ab56a77), CONST64(0x0da0ea50505d50ba), +CONST64(0x4c8a574545094512), CONST64(0x18fb38f3f3ebf3cb), CONST64(0xf060ad3030c0309d), CONST64(0x74c3c4efef9bef2b), +CONST64(0xc37eda3f3ffc3fe5), CONST64(0x1caac75555495592), CONST64(0x1059dba2a2b2a279), CONST64(0x65c9e9eaea8fea03), +CONST64(0xecca6a656589650f), CONST64(0x686903babad2bab9), CONST64(0x935e4a2f2fbc2f65), CONST64(0xe79d8ec0c027c04e), +CONST64(0x81a160dede5fdebe), CONST64(0x6c38fc1c1c701ce0), CONST64(0x2ee746fdfdd3fdbb), CONST64(0x649a1f4d4d294d52), +CONST64(0xe0397692927292e4), CONST64(0xbceafa7575c9758f), CONST64(0x1e0c360606180630), CONST64(0x9809ae8a8a128a24), +CONST64(0x40794bb2b2f2b2f9), CONST64(0x59d185e6e6bfe663), CONST64(0x361c7e0e0e380e70), CONST64(0x633ee71f1f7c1ff8), +CONST64(0xf7c4556262956237), CONST64(0xa3b53ad4d477d4ee), CONST64(0x324d81a8a89aa829), CONST64(0xf4315296966296c4), +CONST64(0x3aef62f9f9c3f99b), CONST64(0xf697a3c5c533c566), CONST64(0xb14a102525942535), CONST64(0x20b2ab59597959f2), +CONST64(0xae15d084842a8454), CONST64(0xa7e4c57272d572b7), CONST64(0xdd72ec3939e439d5), CONST64(0x6198164c4c2d4c5a), +CONST64(0x3bbc945e5e655eca), CONST64(0x85f09f7878fd78e7), CONST64(0xd870e53838e038dd), CONST64(0x8605988c8c0a8c14), +CONST64(0xb2bf17d1d163d1c6), CONST64(0x0b57e4a5a5aea541), CONST64(0x4dd9a1e2e2afe243), CONST64(0xf8c24e616199612f), +CONST64(0x457b42b3b3f6b3f1), CONST64(0xa542342121842115), CONST64(0xd625089c9c4a9c94), CONST64(0x663cee1e1e781ef0), +CONST64(0x5286614343114322), CONST64(0xfc93b1c7c73bc776), CONST64(0x2be54ffcfcd7fcb3), CONST64(0x1408240404100420), +CONST64(0x08a2e351515951b2), CONST64(0xc72f2599995e99bc), CONST64(0xc4da226d6da96d4f), CONST64(0x391a650d0d340d68), +CONST64(0x35e979fafacffa83), CONST64(0x84a369dfdf5bdfb6), CONST64(0x9bfca97e7ee57ed7), CONST64(0xb44819242490243d), +CONST64(0xd776fe3b3bec3bc5), CONST64(0x3d4b9aabab96ab31), CONST64(0xd181f0cece1fce3e), CONST64(0x5522991111441188), +CONST64(0x8903838f8f068f0c), CONST64(0x6b9c044e4e254e4a), CONST64(0x517366b7b7e6b7d1), CONST64(0x60cbe0ebeb8beb0b), +CONST64(0xcc78c13c3cf03cfd), CONST64(0xbf1ffd81813e817c), CONST64(0xfe354094946a94d4), CONST64(0x0cf31cf7f7fbf7eb), +CONST64(0x676f18b9b9deb9a1), CONST64(0x5f268b13134c1398), CONST64(0x9c58512c2cb02c7d), CONST64(0xb8bb05d3d36bd3d6), +CONST64(0x5cd38ce7e7bbe76b), CONST64(0xcbdc396e6ea56e57), CONST64(0xf395aac4c437c46e), CONST64(0x0f061b03030c0318), +CONST64(0x13acdc565645568a), CONST64(0x49885e44440d441a), CONST64(0x9efea07f7fe17fdf), CONST64(0x374f88a9a99ea921), +CONST64(0x8254672a2aa82a4d), CONST64(0x6d6b0abbbbd6bbb1), CONST64(0xe29f87c1c123c146), CONST64(0x02a6f153535153a2), +CONST64(0x8ba572dcdc57dcae), CONST64(0x2716530b0b2c0b58), CONST64(0xd327019d9d4e9d9c), CONST64(0xc1d82b6c6cad6c47), +CONST64(0xf562a43131c43195), CONST64(0xb9e8f37474cd7487), CONST64(0x09f115f6f6fff6e3), CONST64(0x438c4c464605460a), +CONST64(0x2645a5acac8aac09), CONST64(0x970fb589891e893c), CONST64(0x4428b414145014a0), CONST64(0x42dfbae1e1a3e15b), +CONST64(0x4e2ca616165816b0), CONST64(0xd274f73a3ae83acd), CONST64(0xd0d2066969b9696f), CONST64(0x2d12410909240948), +CONST64(0xade0d77070dd70a7), CONST64(0x54716fb6b6e2b6d9), CONST64(0xb7bd1ed0d067d0ce), CONST64(0x7ec7d6eded93ed3b), +CONST64(0xdb85e2cccc17cc2e), CONST64(0x578468424215422a), CONST64(0xc22d2c98985a98b4), CONST64(0x0e55eda4a4aaa449), CONST64(0x8850752828a0285d), CONST64(0x31b8865c5c6d5cda), CONST64(0x3fed6bf8f8c7f893), CONST64(0xa411c28686228644) }; static const ulong64 sbox4[] = { -CONST64(0xc07830d818186018), CONST64(0x05af462623238c23), CONST64(0x7ef991b8c6c63fc6), CONST64(0x136fcdfbe8e887e8), -CONST64(0x4ca113cb87872687), CONST64(0xa9626d11b8b8dab8), CONST64(0x0805020901010401), CONST64(0x426e9e0d4f4f214f), -CONST64(0xadee6c9b3636d836), CONST64(0x590451ffa6a6a2a6), CONST64(0xdebdb90cd2d26fd2), CONST64(0xfb06f70ef5f5f3f5), -CONST64(0xef80f2967979f979), CONST64(0x5fcede306f6fa16f), CONST64(0xfcef3f6d91917e91), CONST64(0xaa07a4f852525552), -CONST64(0x27fdc04760609d60), CONST64(0x89766535bcbccabc), CONST64(0xaccd2b379b9b569b), CONST64(0x048c018a8e8e028e), -CONST64(0x71155bd2a3a3b6a3), CONST64(0x603c186c0c0c300c), CONST64(0xff8af6847b7bf17b), CONST64(0xb5e16a803535d435), -CONST64(0xe8693af51d1d741d), CONST64(0x5347ddb3e0e0a7e0), CONST64(0xf6acb321d7d77bd7), CONST64(0x5eed999cc2c22fc2), -CONST64(0x6d965c432e2eb82e), CONST64(0x627a96294b4b314b), CONST64(0xa321e15dfefedffe), CONST64(0x8216aed557574157), -CONST64(0xa8412abd15155415), CONST64(0x9fb6eee87777c177), CONST64(0xa5eb6e923737dc37), CONST64(0x7b56d79ee5e5b3e5), -CONST64(0x8cd923139f9f469f), CONST64(0xd317fd23f0f0e7f0), CONST64(0x6a7f94204a4a354a), CONST64(0x9e95a944dada4fda), -CONST64(0xfa25b0a258587d58), CONST64(0x06ca8fcfc9c903c9), CONST64(0x558d527c2929a429), CONST64(0x5022145a0a0a280a), -CONST64(0xe14f7f50b1b1feb1), CONST64(0x691a5dc9a0a0baa0), CONST64(0x7fdad6146b6bb16b), CONST64(0x5cab17d985852e85), -CONST64(0x8173673cbdbdcebd), CONST64(0xd234ba8f5d5d695d), CONST64(0x8050209010104010), CONST64(0xf303f507f4f4f7f4), -CONST64(0x16c08bddcbcb0bcb), CONST64(0xedc67cd33e3ef83e), CONST64(0x28110a2d05051405), CONST64(0x1fe6ce7867678167), -CONST64(0x7353d597e4e4b7e4), CONST64(0x25bb4e0227279c27), CONST64(0x3258827341411941), CONST64(0x2c9d0ba78b8b168b), -CONST64(0x510153f6a7a7a6a7), CONST64(0xcf94fab27d7de97d), CONST64(0xdcfb374995956e95), CONST64(0x8e9fad56d8d847d8), -CONST64(0x8b30eb70fbfbcbfb), CONST64(0x2371c1cdeeee9fee), CONST64(0xc791f8bb7c7ced7c), CONST64(0x17e3cc7166668566), -CONST64(0xa68ea77bdddd53dd), CONST64(0xb84b2eaf17175c17), CONST64(0x02468e4547470147), CONST64(0x84dc211a9e9e429e), -CONST64(0x1ec589d4caca0fca), CONST64(0x75995a582d2db42d), CONST64(0x9179632ebfbfc6bf), CONST64(0x381b0e3f07071c07), -CONST64(0x012347acadad8ead), CONST64(0xea2fb4b05a5a755a), CONST64(0x6cb51bef83833683), CONST64(0x85ff66b63333cc33), -CONST64(0x3ff2c65c63639163), CONST64(0x100a041202020802), CONST64(0x39384993aaaa92aa), CONST64(0xafa8e2de7171d971), -CONST64(0x0ecf8dc6c8c807c8), CONST64(0xc87d32d119196419), CONST64(0x7270923b49493949), CONST64(0x869aaf5fd9d943d9), -CONST64(0xc31df931f2f2eff2), CONST64(0x4b48dba8e3e3abe3), CONST64(0xe22ab6b95b5b715b), CONST64(0x34920dbc88881a88), -CONST64(0xa4c8293e9a9a529a), CONST64(0x2dbe4c0b26269826), CONST64(0x8dfa64bf3232c832), CONST64(0xe94a7d59b0b0fab0), -CONST64(0x1b6acff2e9e983e9), CONST64(0x78331e770f0f3c0f), CONST64(0xe6a6b733d5d573d5), CONST64(0x74ba1df480803a80), -CONST64(0x997c6127bebec2be), CONST64(0x26de87ebcdcd13cd), CONST64(0xbde468893434d034), CONST64(0x7a75903248483d48), -CONST64(0xab24e354ffffdbff), CONST64(0xf78ff48d7a7af57a), CONST64(0xf4ea3d6490907a90), CONST64(0xc23ebe9d5f5f615f), -CONST64(0x1da0403d20208020), CONST64(0x67d5d00f6868bd68), CONST64(0xd07234ca1a1a681a), CONST64(0x192c41b7aeae82ae), -CONST64(0xc95e757db4b4eab4), CONST64(0x9a19a8ce54544d54), CONST64(0xece53b7f93937693), CONST64(0x0daa442f22228822), -CONST64(0x07e9c86364648d64), CONST64(0xdb12ff2af1f1e3f1), CONST64(0xbfa2e6cc7373d173), CONST64(0x905a248212124812), -CONST64(0x3a5d807a40401d40), CONST64(0x4028104808082008), CONST64(0x56e89b95c3c32bc3), CONST64(0x337bc5dfecec97ec), -CONST64(0x9690ab4ddbdb4bdb), CONST64(0x611f5fc0a1a1bea1), CONST64(0x1c8307918d8d0e8d), CONST64(0xf5c97ac83d3df43d), -CONST64(0xccf1335b97976697), CONST64(0x0000000000000000), CONST64(0x36d483f9cfcf1bcf), CONST64(0x4587566e2b2bac2b), -CONST64(0x97b3ece17676c576), CONST64(0x64b019e682823282), CONST64(0xfea9b128d6d67fd6), CONST64(0xd87736c31b1b6c1b), -CONST64(0xc15b7774b5b5eeb5), CONST64(0x112943beafaf86af), CONST64(0x77dfd41d6a6ab56a), CONST64(0xba0da0ea50505d50), -CONST64(0x124c8a5745450945), CONST64(0xcb18fb38f3f3ebf3), CONST64(0x9df060ad3030c030), CONST64(0x2b74c3c4efef9bef), -CONST64(0xe5c37eda3f3ffc3f), CONST64(0x921caac755554955), CONST64(0x791059dba2a2b2a2), CONST64(0x0365c9e9eaea8fea), -CONST64(0x0fecca6a65658965), CONST64(0xb9686903babad2ba), CONST64(0x65935e4a2f2fbc2f), CONST64(0x4ee79d8ec0c027c0), -CONST64(0xbe81a160dede5fde), CONST64(0xe06c38fc1c1c701c), CONST64(0xbb2ee746fdfdd3fd), CONST64(0x52649a1f4d4d294d), -CONST64(0xe4e0397692927292), CONST64(0x8fbceafa7575c975), CONST64(0x301e0c3606061806), CONST64(0x249809ae8a8a128a), -CONST64(0xf940794bb2b2f2b2), CONST64(0x6359d185e6e6bfe6), CONST64(0x70361c7e0e0e380e), CONST64(0xf8633ee71f1f7c1f), -CONST64(0x37f7c45562629562), CONST64(0xeea3b53ad4d477d4), CONST64(0x29324d81a8a89aa8), CONST64(0xc4f4315296966296), -CONST64(0x9b3aef62f9f9c3f9), CONST64(0x66f697a3c5c533c5), CONST64(0x35b14a1025259425), CONST64(0xf220b2ab59597959), -CONST64(0x54ae15d084842a84), CONST64(0xb7a7e4c57272d572), CONST64(0xd5dd72ec3939e439), CONST64(0x5a6198164c4c2d4c), -CONST64(0xca3bbc945e5e655e), CONST64(0xe785f09f7878fd78), CONST64(0xddd870e53838e038), CONST64(0x148605988c8c0a8c), -CONST64(0xc6b2bf17d1d163d1), CONST64(0x410b57e4a5a5aea5), CONST64(0x434dd9a1e2e2afe2), CONST64(0x2ff8c24e61619961), -CONST64(0xf1457b42b3b3f6b3), CONST64(0x15a5423421218421), CONST64(0x94d625089c9c4a9c), CONST64(0xf0663cee1e1e781e), -CONST64(0x2252866143431143), CONST64(0x76fc93b1c7c73bc7), CONST64(0xb32be54ffcfcd7fc), CONST64(0x2014082404041004), -CONST64(0xb208a2e351515951), CONST64(0xbcc72f2599995e99), CONST64(0x4fc4da226d6da96d), CONST64(0x68391a650d0d340d), -CONST64(0x8335e979fafacffa), CONST64(0xb684a369dfdf5bdf), CONST64(0xd79bfca97e7ee57e), CONST64(0x3db4481924249024), -CONST64(0xc5d776fe3b3bec3b), CONST64(0x313d4b9aabab96ab), CONST64(0x3ed181f0cece1fce), CONST64(0x8855229911114411), -CONST64(0x0c8903838f8f068f), CONST64(0x4a6b9c044e4e254e), CONST64(0xd1517366b7b7e6b7), CONST64(0x0b60cbe0ebeb8beb), -CONST64(0xfdcc78c13c3cf03c), CONST64(0x7cbf1ffd81813e81), CONST64(0xd4fe354094946a94), CONST64(0xeb0cf31cf7f7fbf7), -CONST64(0xa1676f18b9b9deb9), CONST64(0x985f268b13134c13), CONST64(0x7d9c58512c2cb02c), CONST64(0xd6b8bb05d3d36bd3), -CONST64(0x6b5cd38ce7e7bbe7), CONST64(0x57cbdc396e6ea56e), CONST64(0x6ef395aac4c437c4), CONST64(0x180f061b03030c03), -CONST64(0x8a13acdc56564556), CONST64(0x1a49885e44440d44), CONST64(0xdf9efea07f7fe17f), CONST64(0x21374f88a9a99ea9), -CONST64(0x4d8254672a2aa82a), CONST64(0xb16d6b0abbbbd6bb), CONST64(0x46e29f87c1c123c1), CONST64(0xa202a6f153535153), -CONST64(0xae8ba572dcdc57dc), CONST64(0x582716530b0b2c0b), CONST64(0x9cd327019d9d4e9d), CONST64(0x47c1d82b6c6cad6c), -CONST64(0x95f562a43131c431), CONST64(0x87b9e8f37474cd74), CONST64(0xe309f115f6f6fff6), CONST64(0x0a438c4c46460546), -CONST64(0x092645a5acac8aac), CONST64(0x3c970fb589891e89), CONST64(0xa04428b414145014), CONST64(0x5b42dfbae1e1a3e1), -CONST64(0xb04e2ca616165816), CONST64(0xcdd274f73a3ae83a), CONST64(0x6fd0d2066969b969), CONST64(0x482d124109092409), -CONST64(0xa7ade0d77070dd70), CONST64(0xd954716fb6b6e2b6), CONST64(0xceb7bd1ed0d067d0), CONST64(0x3b7ec7d6eded93ed), -CONST64(0x2edb85e2cccc17cc), CONST64(0x2a57846842421542), CONST64(0xb4c22d2c98985a98), CONST64(0x490e55eda4a4aaa4), +CONST64(0xc07830d818186018), CONST64(0x05af462623238c23), CONST64(0x7ef991b8c6c63fc6), CONST64(0x136fcdfbe8e887e8), +CONST64(0x4ca113cb87872687), CONST64(0xa9626d11b8b8dab8), CONST64(0x0805020901010401), CONST64(0x426e9e0d4f4f214f), +CONST64(0xadee6c9b3636d836), CONST64(0x590451ffa6a6a2a6), CONST64(0xdebdb90cd2d26fd2), CONST64(0xfb06f70ef5f5f3f5), +CONST64(0xef80f2967979f979), CONST64(0x5fcede306f6fa16f), CONST64(0xfcef3f6d91917e91), CONST64(0xaa07a4f852525552), +CONST64(0x27fdc04760609d60), CONST64(0x89766535bcbccabc), CONST64(0xaccd2b379b9b569b), CONST64(0x048c018a8e8e028e), +CONST64(0x71155bd2a3a3b6a3), CONST64(0x603c186c0c0c300c), CONST64(0xff8af6847b7bf17b), CONST64(0xb5e16a803535d435), +CONST64(0xe8693af51d1d741d), CONST64(0x5347ddb3e0e0a7e0), CONST64(0xf6acb321d7d77bd7), CONST64(0x5eed999cc2c22fc2), +CONST64(0x6d965c432e2eb82e), CONST64(0x627a96294b4b314b), CONST64(0xa321e15dfefedffe), CONST64(0x8216aed557574157), +CONST64(0xa8412abd15155415), CONST64(0x9fb6eee87777c177), CONST64(0xa5eb6e923737dc37), CONST64(0x7b56d79ee5e5b3e5), +CONST64(0x8cd923139f9f469f), CONST64(0xd317fd23f0f0e7f0), CONST64(0x6a7f94204a4a354a), CONST64(0x9e95a944dada4fda), +CONST64(0xfa25b0a258587d58), CONST64(0x06ca8fcfc9c903c9), CONST64(0x558d527c2929a429), CONST64(0x5022145a0a0a280a), +CONST64(0xe14f7f50b1b1feb1), CONST64(0x691a5dc9a0a0baa0), CONST64(0x7fdad6146b6bb16b), CONST64(0x5cab17d985852e85), +CONST64(0x8173673cbdbdcebd), CONST64(0xd234ba8f5d5d695d), CONST64(0x8050209010104010), CONST64(0xf303f507f4f4f7f4), +CONST64(0x16c08bddcbcb0bcb), CONST64(0xedc67cd33e3ef83e), CONST64(0x28110a2d05051405), CONST64(0x1fe6ce7867678167), +CONST64(0x7353d597e4e4b7e4), CONST64(0x25bb4e0227279c27), CONST64(0x3258827341411941), CONST64(0x2c9d0ba78b8b168b), +CONST64(0x510153f6a7a7a6a7), CONST64(0xcf94fab27d7de97d), CONST64(0xdcfb374995956e95), CONST64(0x8e9fad56d8d847d8), +CONST64(0x8b30eb70fbfbcbfb), CONST64(0x2371c1cdeeee9fee), CONST64(0xc791f8bb7c7ced7c), CONST64(0x17e3cc7166668566), +CONST64(0xa68ea77bdddd53dd), CONST64(0xb84b2eaf17175c17), CONST64(0x02468e4547470147), CONST64(0x84dc211a9e9e429e), +CONST64(0x1ec589d4caca0fca), CONST64(0x75995a582d2db42d), CONST64(0x9179632ebfbfc6bf), CONST64(0x381b0e3f07071c07), +CONST64(0x012347acadad8ead), CONST64(0xea2fb4b05a5a755a), CONST64(0x6cb51bef83833683), CONST64(0x85ff66b63333cc33), +CONST64(0x3ff2c65c63639163), CONST64(0x100a041202020802), CONST64(0x39384993aaaa92aa), CONST64(0xafa8e2de7171d971), +CONST64(0x0ecf8dc6c8c807c8), CONST64(0xc87d32d119196419), CONST64(0x7270923b49493949), CONST64(0x869aaf5fd9d943d9), +CONST64(0xc31df931f2f2eff2), CONST64(0x4b48dba8e3e3abe3), CONST64(0xe22ab6b95b5b715b), CONST64(0x34920dbc88881a88), +CONST64(0xa4c8293e9a9a529a), CONST64(0x2dbe4c0b26269826), CONST64(0x8dfa64bf3232c832), CONST64(0xe94a7d59b0b0fab0), +CONST64(0x1b6acff2e9e983e9), CONST64(0x78331e770f0f3c0f), CONST64(0xe6a6b733d5d573d5), CONST64(0x74ba1df480803a80), +CONST64(0x997c6127bebec2be), CONST64(0x26de87ebcdcd13cd), CONST64(0xbde468893434d034), CONST64(0x7a75903248483d48), +CONST64(0xab24e354ffffdbff), CONST64(0xf78ff48d7a7af57a), CONST64(0xf4ea3d6490907a90), CONST64(0xc23ebe9d5f5f615f), +CONST64(0x1da0403d20208020), CONST64(0x67d5d00f6868bd68), CONST64(0xd07234ca1a1a681a), CONST64(0x192c41b7aeae82ae), +CONST64(0xc95e757db4b4eab4), CONST64(0x9a19a8ce54544d54), CONST64(0xece53b7f93937693), CONST64(0x0daa442f22228822), +CONST64(0x07e9c86364648d64), CONST64(0xdb12ff2af1f1e3f1), CONST64(0xbfa2e6cc7373d173), CONST64(0x905a248212124812), +CONST64(0x3a5d807a40401d40), CONST64(0x4028104808082008), CONST64(0x56e89b95c3c32bc3), CONST64(0x337bc5dfecec97ec), +CONST64(0x9690ab4ddbdb4bdb), CONST64(0x611f5fc0a1a1bea1), CONST64(0x1c8307918d8d0e8d), CONST64(0xf5c97ac83d3df43d), +CONST64(0xccf1335b97976697), CONST64(0x0000000000000000), CONST64(0x36d483f9cfcf1bcf), CONST64(0x4587566e2b2bac2b), +CONST64(0x97b3ece17676c576), CONST64(0x64b019e682823282), CONST64(0xfea9b128d6d67fd6), CONST64(0xd87736c31b1b6c1b), +CONST64(0xc15b7774b5b5eeb5), CONST64(0x112943beafaf86af), CONST64(0x77dfd41d6a6ab56a), CONST64(0xba0da0ea50505d50), +CONST64(0x124c8a5745450945), CONST64(0xcb18fb38f3f3ebf3), CONST64(0x9df060ad3030c030), CONST64(0x2b74c3c4efef9bef), +CONST64(0xe5c37eda3f3ffc3f), CONST64(0x921caac755554955), CONST64(0x791059dba2a2b2a2), CONST64(0x0365c9e9eaea8fea), +CONST64(0x0fecca6a65658965), CONST64(0xb9686903babad2ba), CONST64(0x65935e4a2f2fbc2f), CONST64(0x4ee79d8ec0c027c0), +CONST64(0xbe81a160dede5fde), CONST64(0xe06c38fc1c1c701c), CONST64(0xbb2ee746fdfdd3fd), CONST64(0x52649a1f4d4d294d), +CONST64(0xe4e0397692927292), CONST64(0x8fbceafa7575c975), CONST64(0x301e0c3606061806), CONST64(0x249809ae8a8a128a), +CONST64(0xf940794bb2b2f2b2), CONST64(0x6359d185e6e6bfe6), CONST64(0x70361c7e0e0e380e), CONST64(0xf8633ee71f1f7c1f), +CONST64(0x37f7c45562629562), CONST64(0xeea3b53ad4d477d4), CONST64(0x29324d81a8a89aa8), CONST64(0xc4f4315296966296), +CONST64(0x9b3aef62f9f9c3f9), CONST64(0x66f697a3c5c533c5), CONST64(0x35b14a1025259425), CONST64(0xf220b2ab59597959), +CONST64(0x54ae15d084842a84), CONST64(0xb7a7e4c57272d572), CONST64(0xd5dd72ec3939e439), CONST64(0x5a6198164c4c2d4c), +CONST64(0xca3bbc945e5e655e), CONST64(0xe785f09f7878fd78), CONST64(0xddd870e53838e038), CONST64(0x148605988c8c0a8c), +CONST64(0xc6b2bf17d1d163d1), CONST64(0x410b57e4a5a5aea5), CONST64(0x434dd9a1e2e2afe2), CONST64(0x2ff8c24e61619961), +CONST64(0xf1457b42b3b3f6b3), CONST64(0x15a5423421218421), CONST64(0x94d625089c9c4a9c), CONST64(0xf0663cee1e1e781e), +CONST64(0x2252866143431143), CONST64(0x76fc93b1c7c73bc7), CONST64(0xb32be54ffcfcd7fc), CONST64(0x2014082404041004), +CONST64(0xb208a2e351515951), CONST64(0xbcc72f2599995e99), CONST64(0x4fc4da226d6da96d), CONST64(0x68391a650d0d340d), +CONST64(0x8335e979fafacffa), CONST64(0xb684a369dfdf5bdf), CONST64(0xd79bfca97e7ee57e), CONST64(0x3db4481924249024), +CONST64(0xc5d776fe3b3bec3b), CONST64(0x313d4b9aabab96ab), CONST64(0x3ed181f0cece1fce), CONST64(0x8855229911114411), +CONST64(0x0c8903838f8f068f), CONST64(0x4a6b9c044e4e254e), CONST64(0xd1517366b7b7e6b7), CONST64(0x0b60cbe0ebeb8beb), +CONST64(0xfdcc78c13c3cf03c), CONST64(0x7cbf1ffd81813e81), CONST64(0xd4fe354094946a94), CONST64(0xeb0cf31cf7f7fbf7), +CONST64(0xa1676f18b9b9deb9), CONST64(0x985f268b13134c13), CONST64(0x7d9c58512c2cb02c), CONST64(0xd6b8bb05d3d36bd3), +CONST64(0x6b5cd38ce7e7bbe7), CONST64(0x57cbdc396e6ea56e), CONST64(0x6ef395aac4c437c4), CONST64(0x180f061b03030c03), +CONST64(0x8a13acdc56564556), CONST64(0x1a49885e44440d44), CONST64(0xdf9efea07f7fe17f), CONST64(0x21374f88a9a99ea9), +CONST64(0x4d8254672a2aa82a), CONST64(0xb16d6b0abbbbd6bb), CONST64(0x46e29f87c1c123c1), CONST64(0xa202a6f153535153), +CONST64(0xae8ba572dcdc57dc), CONST64(0x582716530b0b2c0b), CONST64(0x9cd327019d9d4e9d), CONST64(0x47c1d82b6c6cad6c), +CONST64(0x95f562a43131c431), CONST64(0x87b9e8f37474cd74), CONST64(0xe309f115f6f6fff6), CONST64(0x0a438c4c46460546), +CONST64(0x092645a5acac8aac), CONST64(0x3c970fb589891e89), CONST64(0xa04428b414145014), CONST64(0x5b42dfbae1e1a3e1), +CONST64(0xb04e2ca616165816), CONST64(0xcdd274f73a3ae83a), CONST64(0x6fd0d2066969b969), CONST64(0x482d124109092409), +CONST64(0xa7ade0d77070dd70), CONST64(0xd954716fb6b6e2b6), CONST64(0xceb7bd1ed0d067d0), CONST64(0x3b7ec7d6eded93ed), +CONST64(0x2edb85e2cccc17cc), CONST64(0x2a57846842421542), CONST64(0xb4c22d2c98985a98), CONST64(0x490e55eda4a4aaa4), CONST64(0x5d8850752828a028), CONST64(0xda31b8865c5c6d5c), CONST64(0x933fed6bf8f8c7f8), CONST64(0x44a411c286862286) }; static const ulong64 sbox5[] = { -CONST64(0x18c07830d8181860), CONST64(0x2305af462623238c), CONST64(0xc67ef991b8c6c63f), CONST64(0xe8136fcdfbe8e887), -CONST64(0x874ca113cb878726), CONST64(0xb8a9626d11b8b8da), CONST64(0x0108050209010104), CONST64(0x4f426e9e0d4f4f21), -CONST64(0x36adee6c9b3636d8), CONST64(0xa6590451ffa6a6a2), CONST64(0xd2debdb90cd2d26f), CONST64(0xf5fb06f70ef5f5f3), -CONST64(0x79ef80f2967979f9), CONST64(0x6f5fcede306f6fa1), CONST64(0x91fcef3f6d91917e), CONST64(0x52aa07a4f8525255), -CONST64(0x6027fdc04760609d), CONST64(0xbc89766535bcbcca), CONST64(0x9baccd2b379b9b56), CONST64(0x8e048c018a8e8e02), -CONST64(0xa371155bd2a3a3b6), CONST64(0x0c603c186c0c0c30), CONST64(0x7bff8af6847b7bf1), CONST64(0x35b5e16a803535d4), -CONST64(0x1de8693af51d1d74), CONST64(0xe05347ddb3e0e0a7), CONST64(0xd7f6acb321d7d77b), CONST64(0xc25eed999cc2c22f), -CONST64(0x2e6d965c432e2eb8), CONST64(0x4b627a96294b4b31), CONST64(0xfea321e15dfefedf), CONST64(0x578216aed5575741), -CONST64(0x15a8412abd151554), CONST64(0x779fb6eee87777c1), CONST64(0x37a5eb6e923737dc), CONST64(0xe57b56d79ee5e5b3), -CONST64(0x9f8cd923139f9f46), CONST64(0xf0d317fd23f0f0e7), CONST64(0x4a6a7f94204a4a35), CONST64(0xda9e95a944dada4f), -CONST64(0x58fa25b0a258587d), CONST64(0xc906ca8fcfc9c903), CONST64(0x29558d527c2929a4), CONST64(0x0a5022145a0a0a28), -CONST64(0xb1e14f7f50b1b1fe), CONST64(0xa0691a5dc9a0a0ba), CONST64(0x6b7fdad6146b6bb1), CONST64(0x855cab17d985852e), -CONST64(0xbd8173673cbdbdce), CONST64(0x5dd234ba8f5d5d69), CONST64(0x1080502090101040), CONST64(0xf4f303f507f4f4f7), -CONST64(0xcb16c08bddcbcb0b), CONST64(0x3eedc67cd33e3ef8), CONST64(0x0528110a2d050514), CONST64(0x671fe6ce78676781), -CONST64(0xe47353d597e4e4b7), CONST64(0x2725bb4e0227279c), CONST64(0x4132588273414119), CONST64(0x8b2c9d0ba78b8b16), -CONST64(0xa7510153f6a7a7a6), CONST64(0x7dcf94fab27d7de9), CONST64(0x95dcfb374995956e), CONST64(0xd88e9fad56d8d847), -CONST64(0xfb8b30eb70fbfbcb), CONST64(0xee2371c1cdeeee9f), CONST64(0x7cc791f8bb7c7ced), CONST64(0x6617e3cc71666685), -CONST64(0xdda68ea77bdddd53), CONST64(0x17b84b2eaf17175c), CONST64(0x4702468e45474701), CONST64(0x9e84dc211a9e9e42), -CONST64(0xca1ec589d4caca0f), CONST64(0x2d75995a582d2db4), CONST64(0xbf9179632ebfbfc6), CONST64(0x07381b0e3f07071c), -CONST64(0xad012347acadad8e), CONST64(0x5aea2fb4b05a5a75), CONST64(0x836cb51bef838336), CONST64(0x3385ff66b63333cc), -CONST64(0x633ff2c65c636391), CONST64(0x02100a0412020208), CONST64(0xaa39384993aaaa92), CONST64(0x71afa8e2de7171d9), -CONST64(0xc80ecf8dc6c8c807), CONST64(0x19c87d32d1191964), CONST64(0x497270923b494939), CONST64(0xd9869aaf5fd9d943), -CONST64(0xf2c31df931f2f2ef), CONST64(0xe34b48dba8e3e3ab), CONST64(0x5be22ab6b95b5b71), CONST64(0x8834920dbc88881a), -CONST64(0x9aa4c8293e9a9a52), CONST64(0x262dbe4c0b262698), CONST64(0x328dfa64bf3232c8), CONST64(0xb0e94a7d59b0b0fa), -CONST64(0xe91b6acff2e9e983), CONST64(0x0f78331e770f0f3c), CONST64(0xd5e6a6b733d5d573), CONST64(0x8074ba1df480803a), -CONST64(0xbe997c6127bebec2), CONST64(0xcd26de87ebcdcd13), CONST64(0x34bde468893434d0), CONST64(0x487a75903248483d), -CONST64(0xffab24e354ffffdb), CONST64(0x7af78ff48d7a7af5), CONST64(0x90f4ea3d6490907a), CONST64(0x5fc23ebe9d5f5f61), -CONST64(0x201da0403d202080), CONST64(0x6867d5d00f6868bd), CONST64(0x1ad07234ca1a1a68), CONST64(0xae192c41b7aeae82), -CONST64(0xb4c95e757db4b4ea), CONST64(0x549a19a8ce54544d), CONST64(0x93ece53b7f939376), CONST64(0x220daa442f222288), -CONST64(0x6407e9c86364648d), CONST64(0xf1db12ff2af1f1e3), CONST64(0x73bfa2e6cc7373d1), CONST64(0x12905a2482121248), -CONST64(0x403a5d807a40401d), CONST64(0x0840281048080820), CONST64(0xc356e89b95c3c32b), CONST64(0xec337bc5dfecec97), -CONST64(0xdb9690ab4ddbdb4b), CONST64(0xa1611f5fc0a1a1be), CONST64(0x8d1c8307918d8d0e), CONST64(0x3df5c97ac83d3df4), -CONST64(0x97ccf1335b979766), CONST64(0x0000000000000000), CONST64(0xcf36d483f9cfcf1b), CONST64(0x2b4587566e2b2bac), -CONST64(0x7697b3ece17676c5), CONST64(0x8264b019e6828232), CONST64(0xd6fea9b128d6d67f), CONST64(0x1bd87736c31b1b6c), -CONST64(0xb5c15b7774b5b5ee), CONST64(0xaf112943beafaf86), CONST64(0x6a77dfd41d6a6ab5), CONST64(0x50ba0da0ea50505d), -CONST64(0x45124c8a57454509), CONST64(0xf3cb18fb38f3f3eb), CONST64(0x309df060ad3030c0), CONST64(0xef2b74c3c4efef9b), -CONST64(0x3fe5c37eda3f3ffc), CONST64(0x55921caac7555549), CONST64(0xa2791059dba2a2b2), CONST64(0xea0365c9e9eaea8f), -CONST64(0x650fecca6a656589), CONST64(0xbab9686903babad2), CONST64(0x2f65935e4a2f2fbc), CONST64(0xc04ee79d8ec0c027), -CONST64(0xdebe81a160dede5f), CONST64(0x1ce06c38fc1c1c70), CONST64(0xfdbb2ee746fdfdd3), CONST64(0x4d52649a1f4d4d29), -CONST64(0x92e4e03976929272), CONST64(0x758fbceafa7575c9), CONST64(0x06301e0c36060618), CONST64(0x8a249809ae8a8a12), -CONST64(0xb2f940794bb2b2f2), CONST64(0xe66359d185e6e6bf), CONST64(0x0e70361c7e0e0e38), CONST64(0x1ff8633ee71f1f7c), -CONST64(0x6237f7c455626295), CONST64(0xd4eea3b53ad4d477), CONST64(0xa829324d81a8a89a), CONST64(0x96c4f43152969662), -CONST64(0xf99b3aef62f9f9c3), CONST64(0xc566f697a3c5c533), CONST64(0x2535b14a10252594), CONST64(0x59f220b2ab595979), -CONST64(0x8454ae15d084842a), CONST64(0x72b7a7e4c57272d5), CONST64(0x39d5dd72ec3939e4), CONST64(0x4c5a6198164c4c2d), -CONST64(0x5eca3bbc945e5e65), CONST64(0x78e785f09f7878fd), CONST64(0x38ddd870e53838e0), CONST64(0x8c148605988c8c0a), -CONST64(0xd1c6b2bf17d1d163), CONST64(0xa5410b57e4a5a5ae), CONST64(0xe2434dd9a1e2e2af), CONST64(0x612ff8c24e616199), -CONST64(0xb3f1457b42b3b3f6), CONST64(0x2115a54234212184), CONST64(0x9c94d625089c9c4a), CONST64(0x1ef0663cee1e1e78), -CONST64(0x4322528661434311), CONST64(0xc776fc93b1c7c73b), CONST64(0xfcb32be54ffcfcd7), CONST64(0x0420140824040410), -CONST64(0x51b208a2e3515159), CONST64(0x99bcc72f2599995e), CONST64(0x6d4fc4da226d6da9), CONST64(0x0d68391a650d0d34), -CONST64(0xfa8335e979fafacf), CONST64(0xdfb684a369dfdf5b), CONST64(0x7ed79bfca97e7ee5), CONST64(0x243db44819242490), -CONST64(0x3bc5d776fe3b3bec), CONST64(0xab313d4b9aabab96), CONST64(0xce3ed181f0cece1f), CONST64(0x1188552299111144), -CONST64(0x8f0c8903838f8f06), CONST64(0x4e4a6b9c044e4e25), CONST64(0xb7d1517366b7b7e6), CONST64(0xeb0b60cbe0ebeb8b), -CONST64(0x3cfdcc78c13c3cf0), CONST64(0x817cbf1ffd81813e), CONST64(0x94d4fe354094946a), CONST64(0xf7eb0cf31cf7f7fb), -CONST64(0xb9a1676f18b9b9de), CONST64(0x13985f268b13134c), CONST64(0x2c7d9c58512c2cb0), CONST64(0xd3d6b8bb05d3d36b), -CONST64(0xe76b5cd38ce7e7bb), CONST64(0x6e57cbdc396e6ea5), CONST64(0xc46ef395aac4c437), CONST64(0x03180f061b03030c), -CONST64(0x568a13acdc565645), CONST64(0x441a49885e44440d), CONST64(0x7fdf9efea07f7fe1), CONST64(0xa921374f88a9a99e), -CONST64(0x2a4d8254672a2aa8), CONST64(0xbbb16d6b0abbbbd6), CONST64(0xc146e29f87c1c123), CONST64(0x53a202a6f1535351), -CONST64(0xdcae8ba572dcdc57), CONST64(0x0b582716530b0b2c), CONST64(0x9d9cd327019d9d4e), CONST64(0x6c47c1d82b6c6cad), -CONST64(0x3195f562a43131c4), CONST64(0x7487b9e8f37474cd), CONST64(0xf6e309f115f6f6ff), CONST64(0x460a438c4c464605), -CONST64(0xac092645a5acac8a), CONST64(0x893c970fb589891e), CONST64(0x14a04428b4141450), CONST64(0xe15b42dfbae1e1a3), -CONST64(0x16b04e2ca6161658), CONST64(0x3acdd274f73a3ae8), CONST64(0x696fd0d2066969b9), CONST64(0x09482d1241090924), -CONST64(0x70a7ade0d77070dd), CONST64(0xb6d954716fb6b6e2), CONST64(0xd0ceb7bd1ed0d067), CONST64(0xed3b7ec7d6eded93), -CONST64(0xcc2edb85e2cccc17), CONST64(0x422a578468424215), CONST64(0x98b4c22d2c98985a), CONST64(0xa4490e55eda4a4aa), +CONST64(0x18c07830d8181860), CONST64(0x2305af462623238c), CONST64(0xc67ef991b8c6c63f), CONST64(0xe8136fcdfbe8e887), +CONST64(0x874ca113cb878726), CONST64(0xb8a9626d11b8b8da), CONST64(0x0108050209010104), CONST64(0x4f426e9e0d4f4f21), +CONST64(0x36adee6c9b3636d8), CONST64(0xa6590451ffa6a6a2), CONST64(0xd2debdb90cd2d26f), CONST64(0xf5fb06f70ef5f5f3), +CONST64(0x79ef80f2967979f9), CONST64(0x6f5fcede306f6fa1), CONST64(0x91fcef3f6d91917e), CONST64(0x52aa07a4f8525255), +CONST64(0x6027fdc04760609d), CONST64(0xbc89766535bcbcca), CONST64(0x9baccd2b379b9b56), CONST64(0x8e048c018a8e8e02), +CONST64(0xa371155bd2a3a3b6), CONST64(0x0c603c186c0c0c30), CONST64(0x7bff8af6847b7bf1), CONST64(0x35b5e16a803535d4), +CONST64(0x1de8693af51d1d74), CONST64(0xe05347ddb3e0e0a7), CONST64(0xd7f6acb321d7d77b), CONST64(0xc25eed999cc2c22f), +CONST64(0x2e6d965c432e2eb8), CONST64(0x4b627a96294b4b31), CONST64(0xfea321e15dfefedf), CONST64(0x578216aed5575741), +CONST64(0x15a8412abd151554), CONST64(0x779fb6eee87777c1), CONST64(0x37a5eb6e923737dc), CONST64(0xe57b56d79ee5e5b3), +CONST64(0x9f8cd923139f9f46), CONST64(0xf0d317fd23f0f0e7), CONST64(0x4a6a7f94204a4a35), CONST64(0xda9e95a944dada4f), +CONST64(0x58fa25b0a258587d), CONST64(0xc906ca8fcfc9c903), CONST64(0x29558d527c2929a4), CONST64(0x0a5022145a0a0a28), +CONST64(0xb1e14f7f50b1b1fe), CONST64(0xa0691a5dc9a0a0ba), CONST64(0x6b7fdad6146b6bb1), CONST64(0x855cab17d985852e), +CONST64(0xbd8173673cbdbdce), CONST64(0x5dd234ba8f5d5d69), CONST64(0x1080502090101040), CONST64(0xf4f303f507f4f4f7), +CONST64(0xcb16c08bddcbcb0b), CONST64(0x3eedc67cd33e3ef8), CONST64(0x0528110a2d050514), CONST64(0x671fe6ce78676781), +CONST64(0xe47353d597e4e4b7), CONST64(0x2725bb4e0227279c), CONST64(0x4132588273414119), CONST64(0x8b2c9d0ba78b8b16), +CONST64(0xa7510153f6a7a7a6), CONST64(0x7dcf94fab27d7de9), CONST64(0x95dcfb374995956e), CONST64(0xd88e9fad56d8d847), +CONST64(0xfb8b30eb70fbfbcb), CONST64(0xee2371c1cdeeee9f), CONST64(0x7cc791f8bb7c7ced), CONST64(0x6617e3cc71666685), +CONST64(0xdda68ea77bdddd53), CONST64(0x17b84b2eaf17175c), CONST64(0x4702468e45474701), CONST64(0x9e84dc211a9e9e42), +CONST64(0xca1ec589d4caca0f), CONST64(0x2d75995a582d2db4), CONST64(0xbf9179632ebfbfc6), CONST64(0x07381b0e3f07071c), +CONST64(0xad012347acadad8e), CONST64(0x5aea2fb4b05a5a75), CONST64(0x836cb51bef838336), CONST64(0x3385ff66b63333cc), +CONST64(0x633ff2c65c636391), CONST64(0x02100a0412020208), CONST64(0xaa39384993aaaa92), CONST64(0x71afa8e2de7171d9), +CONST64(0xc80ecf8dc6c8c807), CONST64(0x19c87d32d1191964), CONST64(0x497270923b494939), CONST64(0xd9869aaf5fd9d943), +CONST64(0xf2c31df931f2f2ef), CONST64(0xe34b48dba8e3e3ab), CONST64(0x5be22ab6b95b5b71), CONST64(0x8834920dbc88881a), +CONST64(0x9aa4c8293e9a9a52), CONST64(0x262dbe4c0b262698), CONST64(0x328dfa64bf3232c8), CONST64(0xb0e94a7d59b0b0fa), +CONST64(0xe91b6acff2e9e983), CONST64(0x0f78331e770f0f3c), CONST64(0xd5e6a6b733d5d573), CONST64(0x8074ba1df480803a), +CONST64(0xbe997c6127bebec2), CONST64(0xcd26de87ebcdcd13), CONST64(0x34bde468893434d0), CONST64(0x487a75903248483d), +CONST64(0xffab24e354ffffdb), CONST64(0x7af78ff48d7a7af5), CONST64(0x90f4ea3d6490907a), CONST64(0x5fc23ebe9d5f5f61), +CONST64(0x201da0403d202080), CONST64(0x6867d5d00f6868bd), CONST64(0x1ad07234ca1a1a68), CONST64(0xae192c41b7aeae82), +CONST64(0xb4c95e757db4b4ea), CONST64(0x549a19a8ce54544d), CONST64(0x93ece53b7f939376), CONST64(0x220daa442f222288), +CONST64(0x6407e9c86364648d), CONST64(0xf1db12ff2af1f1e3), CONST64(0x73bfa2e6cc7373d1), CONST64(0x12905a2482121248), +CONST64(0x403a5d807a40401d), CONST64(0x0840281048080820), CONST64(0xc356e89b95c3c32b), CONST64(0xec337bc5dfecec97), +CONST64(0xdb9690ab4ddbdb4b), CONST64(0xa1611f5fc0a1a1be), CONST64(0x8d1c8307918d8d0e), CONST64(0x3df5c97ac83d3df4), +CONST64(0x97ccf1335b979766), CONST64(0x0000000000000000), CONST64(0xcf36d483f9cfcf1b), CONST64(0x2b4587566e2b2bac), +CONST64(0x7697b3ece17676c5), CONST64(0x8264b019e6828232), CONST64(0xd6fea9b128d6d67f), CONST64(0x1bd87736c31b1b6c), +CONST64(0xb5c15b7774b5b5ee), CONST64(0xaf112943beafaf86), CONST64(0x6a77dfd41d6a6ab5), CONST64(0x50ba0da0ea50505d), +CONST64(0x45124c8a57454509), CONST64(0xf3cb18fb38f3f3eb), CONST64(0x309df060ad3030c0), CONST64(0xef2b74c3c4efef9b), +CONST64(0x3fe5c37eda3f3ffc), CONST64(0x55921caac7555549), CONST64(0xa2791059dba2a2b2), CONST64(0xea0365c9e9eaea8f), +CONST64(0x650fecca6a656589), CONST64(0xbab9686903babad2), CONST64(0x2f65935e4a2f2fbc), CONST64(0xc04ee79d8ec0c027), +CONST64(0xdebe81a160dede5f), CONST64(0x1ce06c38fc1c1c70), CONST64(0xfdbb2ee746fdfdd3), CONST64(0x4d52649a1f4d4d29), +CONST64(0x92e4e03976929272), CONST64(0x758fbceafa7575c9), CONST64(0x06301e0c36060618), CONST64(0x8a249809ae8a8a12), +CONST64(0xb2f940794bb2b2f2), CONST64(0xe66359d185e6e6bf), CONST64(0x0e70361c7e0e0e38), CONST64(0x1ff8633ee71f1f7c), +CONST64(0x6237f7c455626295), CONST64(0xd4eea3b53ad4d477), CONST64(0xa829324d81a8a89a), CONST64(0x96c4f43152969662), +CONST64(0xf99b3aef62f9f9c3), CONST64(0xc566f697a3c5c533), CONST64(0x2535b14a10252594), CONST64(0x59f220b2ab595979), +CONST64(0x8454ae15d084842a), CONST64(0x72b7a7e4c57272d5), CONST64(0x39d5dd72ec3939e4), CONST64(0x4c5a6198164c4c2d), +CONST64(0x5eca3bbc945e5e65), CONST64(0x78e785f09f7878fd), CONST64(0x38ddd870e53838e0), CONST64(0x8c148605988c8c0a), +CONST64(0xd1c6b2bf17d1d163), CONST64(0xa5410b57e4a5a5ae), CONST64(0xe2434dd9a1e2e2af), CONST64(0x612ff8c24e616199), +CONST64(0xb3f1457b42b3b3f6), CONST64(0x2115a54234212184), CONST64(0x9c94d625089c9c4a), CONST64(0x1ef0663cee1e1e78), +CONST64(0x4322528661434311), CONST64(0xc776fc93b1c7c73b), CONST64(0xfcb32be54ffcfcd7), CONST64(0x0420140824040410), +CONST64(0x51b208a2e3515159), CONST64(0x99bcc72f2599995e), CONST64(0x6d4fc4da226d6da9), CONST64(0x0d68391a650d0d34), +CONST64(0xfa8335e979fafacf), CONST64(0xdfb684a369dfdf5b), CONST64(0x7ed79bfca97e7ee5), CONST64(0x243db44819242490), +CONST64(0x3bc5d776fe3b3bec), CONST64(0xab313d4b9aabab96), CONST64(0xce3ed181f0cece1f), CONST64(0x1188552299111144), +CONST64(0x8f0c8903838f8f06), CONST64(0x4e4a6b9c044e4e25), CONST64(0xb7d1517366b7b7e6), CONST64(0xeb0b60cbe0ebeb8b), +CONST64(0x3cfdcc78c13c3cf0), CONST64(0x817cbf1ffd81813e), CONST64(0x94d4fe354094946a), CONST64(0xf7eb0cf31cf7f7fb), +CONST64(0xb9a1676f18b9b9de), CONST64(0x13985f268b13134c), CONST64(0x2c7d9c58512c2cb0), CONST64(0xd3d6b8bb05d3d36b), +CONST64(0xe76b5cd38ce7e7bb), CONST64(0x6e57cbdc396e6ea5), CONST64(0xc46ef395aac4c437), CONST64(0x03180f061b03030c), +CONST64(0x568a13acdc565645), CONST64(0x441a49885e44440d), CONST64(0x7fdf9efea07f7fe1), CONST64(0xa921374f88a9a99e), +CONST64(0x2a4d8254672a2aa8), CONST64(0xbbb16d6b0abbbbd6), CONST64(0xc146e29f87c1c123), CONST64(0x53a202a6f1535351), +CONST64(0xdcae8ba572dcdc57), CONST64(0x0b582716530b0b2c), CONST64(0x9d9cd327019d9d4e), CONST64(0x6c47c1d82b6c6cad), +CONST64(0x3195f562a43131c4), CONST64(0x7487b9e8f37474cd), CONST64(0xf6e309f115f6f6ff), CONST64(0x460a438c4c464605), +CONST64(0xac092645a5acac8a), CONST64(0x893c970fb589891e), CONST64(0x14a04428b4141450), CONST64(0xe15b42dfbae1e1a3), +CONST64(0x16b04e2ca6161658), CONST64(0x3acdd274f73a3ae8), CONST64(0x696fd0d2066969b9), CONST64(0x09482d1241090924), +CONST64(0x70a7ade0d77070dd), CONST64(0xb6d954716fb6b6e2), CONST64(0xd0ceb7bd1ed0d067), CONST64(0xed3b7ec7d6eded93), +CONST64(0xcc2edb85e2cccc17), CONST64(0x422a578468424215), CONST64(0x98b4c22d2c98985a), CONST64(0xa4490e55eda4a4aa), CONST64(0x285d8850752828a0), CONST64(0x5cda31b8865c5c6d), CONST64(0xf8933fed6bf8f8c7), CONST64(0x8644a411c2868622) }; static const ulong64 sbox6[] = { -CONST64(0x6018c07830d81818), CONST64(0x8c2305af46262323), CONST64(0x3fc67ef991b8c6c6), CONST64(0x87e8136fcdfbe8e8), -CONST64(0x26874ca113cb8787), CONST64(0xdab8a9626d11b8b8), CONST64(0x0401080502090101), CONST64(0x214f426e9e0d4f4f), -CONST64(0xd836adee6c9b3636), CONST64(0xa2a6590451ffa6a6), CONST64(0x6fd2debdb90cd2d2), CONST64(0xf3f5fb06f70ef5f5), -CONST64(0xf979ef80f2967979), CONST64(0xa16f5fcede306f6f), CONST64(0x7e91fcef3f6d9191), CONST64(0x5552aa07a4f85252), -CONST64(0x9d6027fdc0476060), CONST64(0xcabc89766535bcbc), CONST64(0x569baccd2b379b9b), CONST64(0x028e048c018a8e8e), -CONST64(0xb6a371155bd2a3a3), CONST64(0x300c603c186c0c0c), CONST64(0xf17bff8af6847b7b), CONST64(0xd435b5e16a803535), -CONST64(0x741de8693af51d1d), CONST64(0xa7e05347ddb3e0e0), CONST64(0x7bd7f6acb321d7d7), CONST64(0x2fc25eed999cc2c2), -CONST64(0xb82e6d965c432e2e), CONST64(0x314b627a96294b4b), CONST64(0xdffea321e15dfefe), CONST64(0x41578216aed55757), -CONST64(0x5415a8412abd1515), CONST64(0xc1779fb6eee87777), CONST64(0xdc37a5eb6e923737), CONST64(0xb3e57b56d79ee5e5), -CONST64(0x469f8cd923139f9f), CONST64(0xe7f0d317fd23f0f0), CONST64(0x354a6a7f94204a4a), CONST64(0x4fda9e95a944dada), -CONST64(0x7d58fa25b0a25858), CONST64(0x03c906ca8fcfc9c9), CONST64(0xa429558d527c2929), CONST64(0x280a5022145a0a0a), -CONST64(0xfeb1e14f7f50b1b1), CONST64(0xbaa0691a5dc9a0a0), CONST64(0xb16b7fdad6146b6b), CONST64(0x2e855cab17d98585), -CONST64(0xcebd8173673cbdbd), CONST64(0x695dd234ba8f5d5d), CONST64(0x4010805020901010), CONST64(0xf7f4f303f507f4f4), -CONST64(0x0bcb16c08bddcbcb), CONST64(0xf83eedc67cd33e3e), CONST64(0x140528110a2d0505), CONST64(0x81671fe6ce786767), -CONST64(0xb7e47353d597e4e4), CONST64(0x9c2725bb4e022727), CONST64(0x1941325882734141), CONST64(0x168b2c9d0ba78b8b), -CONST64(0xa6a7510153f6a7a7), CONST64(0xe97dcf94fab27d7d), CONST64(0x6e95dcfb37499595), CONST64(0x47d88e9fad56d8d8), -CONST64(0xcbfb8b30eb70fbfb), CONST64(0x9fee2371c1cdeeee), CONST64(0xed7cc791f8bb7c7c), CONST64(0x856617e3cc716666), -CONST64(0x53dda68ea77bdddd), CONST64(0x5c17b84b2eaf1717), CONST64(0x014702468e454747), CONST64(0x429e84dc211a9e9e), -CONST64(0x0fca1ec589d4caca), CONST64(0xb42d75995a582d2d), CONST64(0xc6bf9179632ebfbf), CONST64(0x1c07381b0e3f0707), -CONST64(0x8ead012347acadad), CONST64(0x755aea2fb4b05a5a), CONST64(0x36836cb51bef8383), CONST64(0xcc3385ff66b63333), -CONST64(0x91633ff2c65c6363), CONST64(0x0802100a04120202), CONST64(0x92aa39384993aaaa), CONST64(0xd971afa8e2de7171), -CONST64(0x07c80ecf8dc6c8c8), CONST64(0x6419c87d32d11919), CONST64(0x39497270923b4949), CONST64(0x43d9869aaf5fd9d9), -CONST64(0xeff2c31df931f2f2), CONST64(0xabe34b48dba8e3e3), CONST64(0x715be22ab6b95b5b), CONST64(0x1a8834920dbc8888), -CONST64(0x529aa4c8293e9a9a), CONST64(0x98262dbe4c0b2626), CONST64(0xc8328dfa64bf3232), CONST64(0xfab0e94a7d59b0b0), -CONST64(0x83e91b6acff2e9e9), CONST64(0x3c0f78331e770f0f), CONST64(0x73d5e6a6b733d5d5), CONST64(0x3a8074ba1df48080), -CONST64(0xc2be997c6127bebe), CONST64(0x13cd26de87ebcdcd), CONST64(0xd034bde468893434), CONST64(0x3d487a7590324848), -CONST64(0xdbffab24e354ffff), CONST64(0xf57af78ff48d7a7a), CONST64(0x7a90f4ea3d649090), CONST64(0x615fc23ebe9d5f5f), -CONST64(0x80201da0403d2020), CONST64(0xbd6867d5d00f6868), CONST64(0x681ad07234ca1a1a), CONST64(0x82ae192c41b7aeae), -CONST64(0xeab4c95e757db4b4), CONST64(0x4d549a19a8ce5454), CONST64(0x7693ece53b7f9393), CONST64(0x88220daa442f2222), -CONST64(0x8d6407e9c8636464), CONST64(0xe3f1db12ff2af1f1), CONST64(0xd173bfa2e6cc7373), CONST64(0x4812905a24821212), -CONST64(0x1d403a5d807a4040), CONST64(0x2008402810480808), CONST64(0x2bc356e89b95c3c3), CONST64(0x97ec337bc5dfecec), -CONST64(0x4bdb9690ab4ddbdb), CONST64(0xbea1611f5fc0a1a1), CONST64(0x0e8d1c8307918d8d), CONST64(0xf43df5c97ac83d3d), -CONST64(0x6697ccf1335b9797), CONST64(0x0000000000000000), CONST64(0x1bcf36d483f9cfcf), CONST64(0xac2b4587566e2b2b), -CONST64(0xc57697b3ece17676), CONST64(0x328264b019e68282), CONST64(0x7fd6fea9b128d6d6), CONST64(0x6c1bd87736c31b1b), -CONST64(0xeeb5c15b7774b5b5), CONST64(0x86af112943beafaf), CONST64(0xb56a77dfd41d6a6a), CONST64(0x5d50ba0da0ea5050), -CONST64(0x0945124c8a574545), CONST64(0xebf3cb18fb38f3f3), CONST64(0xc0309df060ad3030), CONST64(0x9bef2b74c3c4efef), -CONST64(0xfc3fe5c37eda3f3f), CONST64(0x4955921caac75555), CONST64(0xb2a2791059dba2a2), CONST64(0x8fea0365c9e9eaea), -CONST64(0x89650fecca6a6565), CONST64(0xd2bab9686903baba), CONST64(0xbc2f65935e4a2f2f), CONST64(0x27c04ee79d8ec0c0), -CONST64(0x5fdebe81a160dede), CONST64(0x701ce06c38fc1c1c), CONST64(0xd3fdbb2ee746fdfd), CONST64(0x294d52649a1f4d4d), -CONST64(0x7292e4e039769292), CONST64(0xc9758fbceafa7575), CONST64(0x1806301e0c360606), CONST64(0x128a249809ae8a8a), -CONST64(0xf2b2f940794bb2b2), CONST64(0xbfe66359d185e6e6), CONST64(0x380e70361c7e0e0e), CONST64(0x7c1ff8633ee71f1f), -CONST64(0x956237f7c4556262), CONST64(0x77d4eea3b53ad4d4), CONST64(0x9aa829324d81a8a8), CONST64(0x6296c4f431529696), -CONST64(0xc3f99b3aef62f9f9), CONST64(0x33c566f697a3c5c5), CONST64(0x942535b14a102525), CONST64(0x7959f220b2ab5959), -CONST64(0x2a8454ae15d08484), CONST64(0xd572b7a7e4c57272), CONST64(0xe439d5dd72ec3939), CONST64(0x2d4c5a6198164c4c), -CONST64(0x655eca3bbc945e5e), CONST64(0xfd78e785f09f7878), CONST64(0xe038ddd870e53838), CONST64(0x0a8c148605988c8c), -CONST64(0x63d1c6b2bf17d1d1), CONST64(0xaea5410b57e4a5a5), CONST64(0xafe2434dd9a1e2e2), CONST64(0x99612ff8c24e6161), -CONST64(0xf6b3f1457b42b3b3), CONST64(0x842115a542342121), CONST64(0x4a9c94d625089c9c), CONST64(0x781ef0663cee1e1e), -CONST64(0x1143225286614343), CONST64(0x3bc776fc93b1c7c7), CONST64(0xd7fcb32be54ffcfc), CONST64(0x1004201408240404), -CONST64(0x5951b208a2e35151), CONST64(0x5e99bcc72f259999), CONST64(0xa96d4fc4da226d6d), CONST64(0x340d68391a650d0d), -CONST64(0xcffa8335e979fafa), CONST64(0x5bdfb684a369dfdf), CONST64(0xe57ed79bfca97e7e), CONST64(0x90243db448192424), -CONST64(0xec3bc5d776fe3b3b), CONST64(0x96ab313d4b9aabab), CONST64(0x1fce3ed181f0cece), CONST64(0x4411885522991111), -CONST64(0x068f0c8903838f8f), CONST64(0x254e4a6b9c044e4e), CONST64(0xe6b7d1517366b7b7), CONST64(0x8beb0b60cbe0ebeb), -CONST64(0xf03cfdcc78c13c3c), CONST64(0x3e817cbf1ffd8181), CONST64(0x6a94d4fe35409494), CONST64(0xfbf7eb0cf31cf7f7), -CONST64(0xdeb9a1676f18b9b9), CONST64(0x4c13985f268b1313), CONST64(0xb02c7d9c58512c2c), CONST64(0x6bd3d6b8bb05d3d3), -CONST64(0xbbe76b5cd38ce7e7), CONST64(0xa56e57cbdc396e6e), CONST64(0x37c46ef395aac4c4), CONST64(0x0c03180f061b0303), -CONST64(0x45568a13acdc5656), CONST64(0x0d441a49885e4444), CONST64(0xe17fdf9efea07f7f), CONST64(0x9ea921374f88a9a9), -CONST64(0xa82a4d8254672a2a), CONST64(0xd6bbb16d6b0abbbb), CONST64(0x23c146e29f87c1c1), CONST64(0x5153a202a6f15353), -CONST64(0x57dcae8ba572dcdc), CONST64(0x2c0b582716530b0b), CONST64(0x4e9d9cd327019d9d), CONST64(0xad6c47c1d82b6c6c), -CONST64(0xc43195f562a43131), CONST64(0xcd7487b9e8f37474), CONST64(0xfff6e309f115f6f6), CONST64(0x05460a438c4c4646), -CONST64(0x8aac092645a5acac), CONST64(0x1e893c970fb58989), CONST64(0x5014a04428b41414), CONST64(0xa3e15b42dfbae1e1), -CONST64(0x5816b04e2ca61616), CONST64(0xe83acdd274f73a3a), CONST64(0xb9696fd0d2066969), CONST64(0x2409482d12410909), -CONST64(0xdd70a7ade0d77070), CONST64(0xe2b6d954716fb6b6), CONST64(0x67d0ceb7bd1ed0d0), CONST64(0x93ed3b7ec7d6eded), -CONST64(0x17cc2edb85e2cccc), CONST64(0x15422a5784684242), CONST64(0x5a98b4c22d2c9898), CONST64(0xaaa4490e55eda4a4), +CONST64(0x6018c07830d81818), CONST64(0x8c2305af46262323), CONST64(0x3fc67ef991b8c6c6), CONST64(0x87e8136fcdfbe8e8), +CONST64(0x26874ca113cb8787), CONST64(0xdab8a9626d11b8b8), CONST64(0x0401080502090101), CONST64(0x214f426e9e0d4f4f), +CONST64(0xd836adee6c9b3636), CONST64(0xa2a6590451ffa6a6), CONST64(0x6fd2debdb90cd2d2), CONST64(0xf3f5fb06f70ef5f5), +CONST64(0xf979ef80f2967979), CONST64(0xa16f5fcede306f6f), CONST64(0x7e91fcef3f6d9191), CONST64(0x5552aa07a4f85252), +CONST64(0x9d6027fdc0476060), CONST64(0xcabc89766535bcbc), CONST64(0x569baccd2b379b9b), CONST64(0x028e048c018a8e8e), +CONST64(0xb6a371155bd2a3a3), CONST64(0x300c603c186c0c0c), CONST64(0xf17bff8af6847b7b), CONST64(0xd435b5e16a803535), +CONST64(0x741de8693af51d1d), CONST64(0xa7e05347ddb3e0e0), CONST64(0x7bd7f6acb321d7d7), CONST64(0x2fc25eed999cc2c2), +CONST64(0xb82e6d965c432e2e), CONST64(0x314b627a96294b4b), CONST64(0xdffea321e15dfefe), CONST64(0x41578216aed55757), +CONST64(0x5415a8412abd1515), CONST64(0xc1779fb6eee87777), CONST64(0xdc37a5eb6e923737), CONST64(0xb3e57b56d79ee5e5), +CONST64(0x469f8cd923139f9f), CONST64(0xe7f0d317fd23f0f0), CONST64(0x354a6a7f94204a4a), CONST64(0x4fda9e95a944dada), +CONST64(0x7d58fa25b0a25858), CONST64(0x03c906ca8fcfc9c9), CONST64(0xa429558d527c2929), CONST64(0x280a5022145a0a0a), +CONST64(0xfeb1e14f7f50b1b1), CONST64(0xbaa0691a5dc9a0a0), CONST64(0xb16b7fdad6146b6b), CONST64(0x2e855cab17d98585), +CONST64(0xcebd8173673cbdbd), CONST64(0x695dd234ba8f5d5d), CONST64(0x4010805020901010), CONST64(0xf7f4f303f507f4f4), +CONST64(0x0bcb16c08bddcbcb), CONST64(0xf83eedc67cd33e3e), CONST64(0x140528110a2d0505), CONST64(0x81671fe6ce786767), +CONST64(0xb7e47353d597e4e4), CONST64(0x9c2725bb4e022727), CONST64(0x1941325882734141), CONST64(0x168b2c9d0ba78b8b), +CONST64(0xa6a7510153f6a7a7), CONST64(0xe97dcf94fab27d7d), CONST64(0x6e95dcfb37499595), CONST64(0x47d88e9fad56d8d8), +CONST64(0xcbfb8b30eb70fbfb), CONST64(0x9fee2371c1cdeeee), CONST64(0xed7cc791f8bb7c7c), CONST64(0x856617e3cc716666), +CONST64(0x53dda68ea77bdddd), CONST64(0x5c17b84b2eaf1717), CONST64(0x014702468e454747), CONST64(0x429e84dc211a9e9e), +CONST64(0x0fca1ec589d4caca), CONST64(0xb42d75995a582d2d), CONST64(0xc6bf9179632ebfbf), CONST64(0x1c07381b0e3f0707), +CONST64(0x8ead012347acadad), CONST64(0x755aea2fb4b05a5a), CONST64(0x36836cb51bef8383), CONST64(0xcc3385ff66b63333), +CONST64(0x91633ff2c65c6363), CONST64(0x0802100a04120202), CONST64(0x92aa39384993aaaa), CONST64(0xd971afa8e2de7171), +CONST64(0x07c80ecf8dc6c8c8), CONST64(0x6419c87d32d11919), CONST64(0x39497270923b4949), CONST64(0x43d9869aaf5fd9d9), +CONST64(0xeff2c31df931f2f2), CONST64(0xabe34b48dba8e3e3), CONST64(0x715be22ab6b95b5b), CONST64(0x1a8834920dbc8888), +CONST64(0x529aa4c8293e9a9a), CONST64(0x98262dbe4c0b2626), CONST64(0xc8328dfa64bf3232), CONST64(0xfab0e94a7d59b0b0), +CONST64(0x83e91b6acff2e9e9), CONST64(0x3c0f78331e770f0f), CONST64(0x73d5e6a6b733d5d5), CONST64(0x3a8074ba1df48080), +CONST64(0xc2be997c6127bebe), CONST64(0x13cd26de87ebcdcd), CONST64(0xd034bde468893434), CONST64(0x3d487a7590324848), +CONST64(0xdbffab24e354ffff), CONST64(0xf57af78ff48d7a7a), CONST64(0x7a90f4ea3d649090), CONST64(0x615fc23ebe9d5f5f), +CONST64(0x80201da0403d2020), CONST64(0xbd6867d5d00f6868), CONST64(0x681ad07234ca1a1a), CONST64(0x82ae192c41b7aeae), +CONST64(0xeab4c95e757db4b4), CONST64(0x4d549a19a8ce5454), CONST64(0x7693ece53b7f9393), CONST64(0x88220daa442f2222), +CONST64(0x8d6407e9c8636464), CONST64(0xe3f1db12ff2af1f1), CONST64(0xd173bfa2e6cc7373), CONST64(0x4812905a24821212), +CONST64(0x1d403a5d807a4040), CONST64(0x2008402810480808), CONST64(0x2bc356e89b95c3c3), CONST64(0x97ec337bc5dfecec), +CONST64(0x4bdb9690ab4ddbdb), CONST64(0xbea1611f5fc0a1a1), CONST64(0x0e8d1c8307918d8d), CONST64(0xf43df5c97ac83d3d), +CONST64(0x6697ccf1335b9797), CONST64(0x0000000000000000), CONST64(0x1bcf36d483f9cfcf), CONST64(0xac2b4587566e2b2b), +CONST64(0xc57697b3ece17676), CONST64(0x328264b019e68282), CONST64(0x7fd6fea9b128d6d6), CONST64(0x6c1bd87736c31b1b), +CONST64(0xeeb5c15b7774b5b5), CONST64(0x86af112943beafaf), CONST64(0xb56a77dfd41d6a6a), CONST64(0x5d50ba0da0ea5050), +CONST64(0x0945124c8a574545), CONST64(0xebf3cb18fb38f3f3), CONST64(0xc0309df060ad3030), CONST64(0x9bef2b74c3c4efef), +CONST64(0xfc3fe5c37eda3f3f), CONST64(0x4955921caac75555), CONST64(0xb2a2791059dba2a2), CONST64(0x8fea0365c9e9eaea), +CONST64(0x89650fecca6a6565), CONST64(0xd2bab9686903baba), CONST64(0xbc2f65935e4a2f2f), CONST64(0x27c04ee79d8ec0c0), +CONST64(0x5fdebe81a160dede), CONST64(0x701ce06c38fc1c1c), CONST64(0xd3fdbb2ee746fdfd), CONST64(0x294d52649a1f4d4d), +CONST64(0x7292e4e039769292), CONST64(0xc9758fbceafa7575), CONST64(0x1806301e0c360606), CONST64(0x128a249809ae8a8a), +CONST64(0xf2b2f940794bb2b2), CONST64(0xbfe66359d185e6e6), CONST64(0x380e70361c7e0e0e), CONST64(0x7c1ff8633ee71f1f), +CONST64(0x956237f7c4556262), CONST64(0x77d4eea3b53ad4d4), CONST64(0x9aa829324d81a8a8), CONST64(0x6296c4f431529696), +CONST64(0xc3f99b3aef62f9f9), CONST64(0x33c566f697a3c5c5), CONST64(0x942535b14a102525), CONST64(0x7959f220b2ab5959), +CONST64(0x2a8454ae15d08484), CONST64(0xd572b7a7e4c57272), CONST64(0xe439d5dd72ec3939), CONST64(0x2d4c5a6198164c4c), +CONST64(0x655eca3bbc945e5e), CONST64(0xfd78e785f09f7878), CONST64(0xe038ddd870e53838), CONST64(0x0a8c148605988c8c), +CONST64(0x63d1c6b2bf17d1d1), CONST64(0xaea5410b57e4a5a5), CONST64(0xafe2434dd9a1e2e2), CONST64(0x99612ff8c24e6161), +CONST64(0xf6b3f1457b42b3b3), CONST64(0x842115a542342121), CONST64(0x4a9c94d625089c9c), CONST64(0x781ef0663cee1e1e), +CONST64(0x1143225286614343), CONST64(0x3bc776fc93b1c7c7), CONST64(0xd7fcb32be54ffcfc), CONST64(0x1004201408240404), +CONST64(0x5951b208a2e35151), CONST64(0x5e99bcc72f259999), CONST64(0xa96d4fc4da226d6d), CONST64(0x340d68391a650d0d), +CONST64(0xcffa8335e979fafa), CONST64(0x5bdfb684a369dfdf), CONST64(0xe57ed79bfca97e7e), CONST64(0x90243db448192424), +CONST64(0xec3bc5d776fe3b3b), CONST64(0x96ab313d4b9aabab), CONST64(0x1fce3ed181f0cece), CONST64(0x4411885522991111), +CONST64(0x068f0c8903838f8f), CONST64(0x254e4a6b9c044e4e), CONST64(0xe6b7d1517366b7b7), CONST64(0x8beb0b60cbe0ebeb), +CONST64(0xf03cfdcc78c13c3c), CONST64(0x3e817cbf1ffd8181), CONST64(0x6a94d4fe35409494), CONST64(0xfbf7eb0cf31cf7f7), +CONST64(0xdeb9a1676f18b9b9), CONST64(0x4c13985f268b1313), CONST64(0xb02c7d9c58512c2c), CONST64(0x6bd3d6b8bb05d3d3), +CONST64(0xbbe76b5cd38ce7e7), CONST64(0xa56e57cbdc396e6e), CONST64(0x37c46ef395aac4c4), CONST64(0x0c03180f061b0303), +CONST64(0x45568a13acdc5656), CONST64(0x0d441a49885e4444), CONST64(0xe17fdf9efea07f7f), CONST64(0x9ea921374f88a9a9), +CONST64(0xa82a4d8254672a2a), CONST64(0xd6bbb16d6b0abbbb), CONST64(0x23c146e29f87c1c1), CONST64(0x5153a202a6f15353), +CONST64(0x57dcae8ba572dcdc), CONST64(0x2c0b582716530b0b), CONST64(0x4e9d9cd327019d9d), CONST64(0xad6c47c1d82b6c6c), +CONST64(0xc43195f562a43131), CONST64(0xcd7487b9e8f37474), CONST64(0xfff6e309f115f6f6), CONST64(0x05460a438c4c4646), +CONST64(0x8aac092645a5acac), CONST64(0x1e893c970fb58989), CONST64(0x5014a04428b41414), CONST64(0xa3e15b42dfbae1e1), +CONST64(0x5816b04e2ca61616), CONST64(0xe83acdd274f73a3a), CONST64(0xb9696fd0d2066969), CONST64(0x2409482d12410909), +CONST64(0xdd70a7ade0d77070), CONST64(0xe2b6d954716fb6b6), CONST64(0x67d0ceb7bd1ed0d0), CONST64(0x93ed3b7ec7d6eded), +CONST64(0x17cc2edb85e2cccc), CONST64(0x15422a5784684242), CONST64(0x5a98b4c22d2c9898), CONST64(0xaaa4490e55eda4a4), CONST64(0xa0285d8850752828), CONST64(0x6d5cda31b8865c5c), CONST64(0xc7f8933fed6bf8f8), CONST64(0x228644a411c28686) }; static const ulong64 sbox7[] = { -CONST64(0x186018c07830d818), CONST64(0x238c2305af462623), CONST64(0xc63fc67ef991b8c6), CONST64(0xe887e8136fcdfbe8), -CONST64(0x8726874ca113cb87), CONST64(0xb8dab8a9626d11b8), CONST64(0x0104010805020901), CONST64(0x4f214f426e9e0d4f), -CONST64(0x36d836adee6c9b36), CONST64(0xa6a2a6590451ffa6), CONST64(0xd26fd2debdb90cd2), CONST64(0xf5f3f5fb06f70ef5), -CONST64(0x79f979ef80f29679), CONST64(0x6fa16f5fcede306f), CONST64(0x917e91fcef3f6d91), CONST64(0x525552aa07a4f852), -CONST64(0x609d6027fdc04760), CONST64(0xbccabc89766535bc), CONST64(0x9b569baccd2b379b), CONST64(0x8e028e048c018a8e), -CONST64(0xa3b6a371155bd2a3), CONST64(0x0c300c603c186c0c), CONST64(0x7bf17bff8af6847b), CONST64(0x35d435b5e16a8035), -CONST64(0x1d741de8693af51d), CONST64(0xe0a7e05347ddb3e0), CONST64(0xd77bd7f6acb321d7), CONST64(0xc22fc25eed999cc2), -CONST64(0x2eb82e6d965c432e), CONST64(0x4b314b627a96294b), CONST64(0xfedffea321e15dfe), CONST64(0x5741578216aed557), -CONST64(0x155415a8412abd15), CONST64(0x77c1779fb6eee877), CONST64(0x37dc37a5eb6e9237), CONST64(0xe5b3e57b56d79ee5), -CONST64(0x9f469f8cd923139f), CONST64(0xf0e7f0d317fd23f0), CONST64(0x4a354a6a7f94204a), CONST64(0xda4fda9e95a944da), -CONST64(0x587d58fa25b0a258), CONST64(0xc903c906ca8fcfc9), CONST64(0x29a429558d527c29), CONST64(0x0a280a5022145a0a), -CONST64(0xb1feb1e14f7f50b1), CONST64(0xa0baa0691a5dc9a0), CONST64(0x6bb16b7fdad6146b), CONST64(0x852e855cab17d985), -CONST64(0xbdcebd8173673cbd), CONST64(0x5d695dd234ba8f5d), CONST64(0x1040108050209010), CONST64(0xf4f7f4f303f507f4), -CONST64(0xcb0bcb16c08bddcb), CONST64(0x3ef83eedc67cd33e), CONST64(0x05140528110a2d05), CONST64(0x6781671fe6ce7867), -CONST64(0xe4b7e47353d597e4), CONST64(0x279c2725bb4e0227), CONST64(0x4119413258827341), CONST64(0x8b168b2c9d0ba78b), -CONST64(0xa7a6a7510153f6a7), CONST64(0x7de97dcf94fab27d), CONST64(0x956e95dcfb374995), CONST64(0xd847d88e9fad56d8), -CONST64(0xfbcbfb8b30eb70fb), CONST64(0xee9fee2371c1cdee), CONST64(0x7ced7cc791f8bb7c), CONST64(0x66856617e3cc7166), -CONST64(0xdd53dda68ea77bdd), CONST64(0x175c17b84b2eaf17), CONST64(0x47014702468e4547), CONST64(0x9e429e84dc211a9e), -CONST64(0xca0fca1ec589d4ca), CONST64(0x2db42d75995a582d), CONST64(0xbfc6bf9179632ebf), CONST64(0x071c07381b0e3f07), -CONST64(0xad8ead012347acad), CONST64(0x5a755aea2fb4b05a), CONST64(0x8336836cb51bef83), CONST64(0x33cc3385ff66b633), -CONST64(0x6391633ff2c65c63), CONST64(0x020802100a041202), CONST64(0xaa92aa39384993aa), CONST64(0x71d971afa8e2de71), -CONST64(0xc807c80ecf8dc6c8), CONST64(0x196419c87d32d119), CONST64(0x4939497270923b49), CONST64(0xd943d9869aaf5fd9), -CONST64(0xf2eff2c31df931f2), CONST64(0xe3abe34b48dba8e3), CONST64(0x5b715be22ab6b95b), CONST64(0x881a8834920dbc88), -CONST64(0x9a529aa4c8293e9a), CONST64(0x2698262dbe4c0b26), CONST64(0x32c8328dfa64bf32), CONST64(0xb0fab0e94a7d59b0), -CONST64(0xe983e91b6acff2e9), CONST64(0x0f3c0f78331e770f), CONST64(0xd573d5e6a6b733d5), CONST64(0x803a8074ba1df480), -CONST64(0xbec2be997c6127be), CONST64(0xcd13cd26de87ebcd), CONST64(0x34d034bde4688934), CONST64(0x483d487a75903248), -CONST64(0xffdbffab24e354ff), CONST64(0x7af57af78ff48d7a), CONST64(0x907a90f4ea3d6490), CONST64(0x5f615fc23ebe9d5f), -CONST64(0x2080201da0403d20), CONST64(0x68bd6867d5d00f68), CONST64(0x1a681ad07234ca1a), CONST64(0xae82ae192c41b7ae), -CONST64(0xb4eab4c95e757db4), CONST64(0x544d549a19a8ce54), CONST64(0x937693ece53b7f93), CONST64(0x2288220daa442f22), -CONST64(0x648d6407e9c86364), CONST64(0xf1e3f1db12ff2af1), CONST64(0x73d173bfa2e6cc73), CONST64(0x124812905a248212), -CONST64(0x401d403a5d807a40), CONST64(0x0820084028104808), CONST64(0xc32bc356e89b95c3), CONST64(0xec97ec337bc5dfec), -CONST64(0xdb4bdb9690ab4ddb), CONST64(0xa1bea1611f5fc0a1), CONST64(0x8d0e8d1c8307918d), CONST64(0x3df43df5c97ac83d), -CONST64(0x976697ccf1335b97), CONST64(0x0000000000000000), CONST64(0xcf1bcf36d483f9cf), CONST64(0x2bac2b4587566e2b), -CONST64(0x76c57697b3ece176), CONST64(0x82328264b019e682), CONST64(0xd67fd6fea9b128d6), CONST64(0x1b6c1bd87736c31b), -CONST64(0xb5eeb5c15b7774b5), CONST64(0xaf86af112943beaf), CONST64(0x6ab56a77dfd41d6a), CONST64(0x505d50ba0da0ea50), -CONST64(0x450945124c8a5745), CONST64(0xf3ebf3cb18fb38f3), CONST64(0x30c0309df060ad30), CONST64(0xef9bef2b74c3c4ef), -CONST64(0x3ffc3fe5c37eda3f), CONST64(0x554955921caac755), CONST64(0xa2b2a2791059dba2), CONST64(0xea8fea0365c9e9ea), -CONST64(0x6589650fecca6a65), CONST64(0xbad2bab9686903ba), CONST64(0x2fbc2f65935e4a2f), CONST64(0xc027c04ee79d8ec0), -CONST64(0xde5fdebe81a160de), CONST64(0x1c701ce06c38fc1c), CONST64(0xfdd3fdbb2ee746fd), CONST64(0x4d294d52649a1f4d), -CONST64(0x927292e4e0397692), CONST64(0x75c9758fbceafa75), CONST64(0x061806301e0c3606), CONST64(0x8a128a249809ae8a), -CONST64(0xb2f2b2f940794bb2), CONST64(0xe6bfe66359d185e6), CONST64(0x0e380e70361c7e0e), CONST64(0x1f7c1ff8633ee71f), -CONST64(0x62956237f7c45562), CONST64(0xd477d4eea3b53ad4), CONST64(0xa89aa829324d81a8), CONST64(0x966296c4f4315296), -CONST64(0xf9c3f99b3aef62f9), CONST64(0xc533c566f697a3c5), CONST64(0x25942535b14a1025), CONST64(0x597959f220b2ab59), -CONST64(0x842a8454ae15d084), CONST64(0x72d572b7a7e4c572), CONST64(0x39e439d5dd72ec39), CONST64(0x4c2d4c5a6198164c), -CONST64(0x5e655eca3bbc945e), CONST64(0x78fd78e785f09f78), CONST64(0x38e038ddd870e538), CONST64(0x8c0a8c148605988c), -CONST64(0xd163d1c6b2bf17d1), CONST64(0xa5aea5410b57e4a5), CONST64(0xe2afe2434dd9a1e2), CONST64(0x6199612ff8c24e61), -CONST64(0xb3f6b3f1457b42b3), CONST64(0x21842115a5423421), CONST64(0x9c4a9c94d625089c), CONST64(0x1e781ef0663cee1e), -CONST64(0x4311432252866143), CONST64(0xc73bc776fc93b1c7), CONST64(0xfcd7fcb32be54ffc), CONST64(0x0410042014082404), -CONST64(0x515951b208a2e351), CONST64(0x995e99bcc72f2599), CONST64(0x6da96d4fc4da226d), CONST64(0x0d340d68391a650d), -CONST64(0xfacffa8335e979fa), CONST64(0xdf5bdfb684a369df), CONST64(0x7ee57ed79bfca97e), CONST64(0x2490243db4481924), -CONST64(0x3bec3bc5d776fe3b), CONST64(0xab96ab313d4b9aab), CONST64(0xce1fce3ed181f0ce), CONST64(0x1144118855229911), -CONST64(0x8f068f0c8903838f), CONST64(0x4e254e4a6b9c044e), CONST64(0xb7e6b7d1517366b7), CONST64(0xeb8beb0b60cbe0eb), -CONST64(0x3cf03cfdcc78c13c), CONST64(0x813e817cbf1ffd81), CONST64(0x946a94d4fe354094), CONST64(0xf7fbf7eb0cf31cf7), -CONST64(0xb9deb9a1676f18b9), CONST64(0x134c13985f268b13), CONST64(0x2cb02c7d9c58512c), CONST64(0xd36bd3d6b8bb05d3), -CONST64(0xe7bbe76b5cd38ce7), CONST64(0x6ea56e57cbdc396e), CONST64(0xc437c46ef395aac4), CONST64(0x030c03180f061b03), -CONST64(0x5645568a13acdc56), CONST64(0x440d441a49885e44), CONST64(0x7fe17fdf9efea07f), CONST64(0xa99ea921374f88a9), -CONST64(0x2aa82a4d8254672a), CONST64(0xbbd6bbb16d6b0abb), CONST64(0xc123c146e29f87c1), CONST64(0x535153a202a6f153), -CONST64(0xdc57dcae8ba572dc), CONST64(0x0b2c0b582716530b), CONST64(0x9d4e9d9cd327019d), CONST64(0x6cad6c47c1d82b6c), -CONST64(0x31c43195f562a431), CONST64(0x74cd7487b9e8f374), CONST64(0xf6fff6e309f115f6), CONST64(0x4605460a438c4c46), -CONST64(0xac8aac092645a5ac), CONST64(0x891e893c970fb589), CONST64(0x145014a04428b414), CONST64(0xe1a3e15b42dfbae1), -CONST64(0x165816b04e2ca616), CONST64(0x3ae83acdd274f73a), CONST64(0x69b9696fd0d20669), CONST64(0x092409482d124109), -CONST64(0x70dd70a7ade0d770), CONST64(0xb6e2b6d954716fb6), CONST64(0xd067d0ceb7bd1ed0), CONST64(0xed93ed3b7ec7d6ed), -CONST64(0xcc17cc2edb85e2cc), CONST64(0x4215422a57846842), CONST64(0x985a98b4c22d2c98), CONST64(0xa4aaa4490e55eda4), +CONST64(0x186018c07830d818), CONST64(0x238c2305af462623), CONST64(0xc63fc67ef991b8c6), CONST64(0xe887e8136fcdfbe8), +CONST64(0x8726874ca113cb87), CONST64(0xb8dab8a9626d11b8), CONST64(0x0104010805020901), CONST64(0x4f214f426e9e0d4f), +CONST64(0x36d836adee6c9b36), CONST64(0xa6a2a6590451ffa6), CONST64(0xd26fd2debdb90cd2), CONST64(0xf5f3f5fb06f70ef5), +CONST64(0x79f979ef80f29679), CONST64(0x6fa16f5fcede306f), CONST64(0x917e91fcef3f6d91), CONST64(0x525552aa07a4f852), +CONST64(0x609d6027fdc04760), CONST64(0xbccabc89766535bc), CONST64(0x9b569baccd2b379b), CONST64(0x8e028e048c018a8e), +CONST64(0xa3b6a371155bd2a3), CONST64(0x0c300c603c186c0c), CONST64(0x7bf17bff8af6847b), CONST64(0x35d435b5e16a8035), +CONST64(0x1d741de8693af51d), CONST64(0xe0a7e05347ddb3e0), CONST64(0xd77bd7f6acb321d7), CONST64(0xc22fc25eed999cc2), +CONST64(0x2eb82e6d965c432e), CONST64(0x4b314b627a96294b), CONST64(0xfedffea321e15dfe), CONST64(0x5741578216aed557), +CONST64(0x155415a8412abd15), CONST64(0x77c1779fb6eee877), CONST64(0x37dc37a5eb6e9237), CONST64(0xe5b3e57b56d79ee5), +CONST64(0x9f469f8cd923139f), CONST64(0xf0e7f0d317fd23f0), CONST64(0x4a354a6a7f94204a), CONST64(0xda4fda9e95a944da), +CONST64(0x587d58fa25b0a258), CONST64(0xc903c906ca8fcfc9), CONST64(0x29a429558d527c29), CONST64(0x0a280a5022145a0a), +CONST64(0xb1feb1e14f7f50b1), CONST64(0xa0baa0691a5dc9a0), CONST64(0x6bb16b7fdad6146b), CONST64(0x852e855cab17d985), +CONST64(0xbdcebd8173673cbd), CONST64(0x5d695dd234ba8f5d), CONST64(0x1040108050209010), CONST64(0xf4f7f4f303f507f4), +CONST64(0xcb0bcb16c08bddcb), CONST64(0x3ef83eedc67cd33e), CONST64(0x05140528110a2d05), CONST64(0x6781671fe6ce7867), +CONST64(0xe4b7e47353d597e4), CONST64(0x279c2725bb4e0227), CONST64(0x4119413258827341), CONST64(0x8b168b2c9d0ba78b), +CONST64(0xa7a6a7510153f6a7), CONST64(0x7de97dcf94fab27d), CONST64(0x956e95dcfb374995), CONST64(0xd847d88e9fad56d8), +CONST64(0xfbcbfb8b30eb70fb), CONST64(0xee9fee2371c1cdee), CONST64(0x7ced7cc791f8bb7c), CONST64(0x66856617e3cc7166), +CONST64(0xdd53dda68ea77bdd), CONST64(0x175c17b84b2eaf17), CONST64(0x47014702468e4547), CONST64(0x9e429e84dc211a9e), +CONST64(0xca0fca1ec589d4ca), CONST64(0x2db42d75995a582d), CONST64(0xbfc6bf9179632ebf), CONST64(0x071c07381b0e3f07), +CONST64(0xad8ead012347acad), CONST64(0x5a755aea2fb4b05a), CONST64(0x8336836cb51bef83), CONST64(0x33cc3385ff66b633), +CONST64(0x6391633ff2c65c63), CONST64(0x020802100a041202), CONST64(0xaa92aa39384993aa), CONST64(0x71d971afa8e2de71), +CONST64(0xc807c80ecf8dc6c8), CONST64(0x196419c87d32d119), CONST64(0x4939497270923b49), CONST64(0xd943d9869aaf5fd9), +CONST64(0xf2eff2c31df931f2), CONST64(0xe3abe34b48dba8e3), CONST64(0x5b715be22ab6b95b), CONST64(0x881a8834920dbc88), +CONST64(0x9a529aa4c8293e9a), CONST64(0x2698262dbe4c0b26), CONST64(0x32c8328dfa64bf32), CONST64(0xb0fab0e94a7d59b0), +CONST64(0xe983e91b6acff2e9), CONST64(0x0f3c0f78331e770f), CONST64(0xd573d5e6a6b733d5), CONST64(0x803a8074ba1df480), +CONST64(0xbec2be997c6127be), CONST64(0xcd13cd26de87ebcd), CONST64(0x34d034bde4688934), CONST64(0x483d487a75903248), +CONST64(0xffdbffab24e354ff), CONST64(0x7af57af78ff48d7a), CONST64(0x907a90f4ea3d6490), CONST64(0x5f615fc23ebe9d5f), +CONST64(0x2080201da0403d20), CONST64(0x68bd6867d5d00f68), CONST64(0x1a681ad07234ca1a), CONST64(0xae82ae192c41b7ae), +CONST64(0xb4eab4c95e757db4), CONST64(0x544d549a19a8ce54), CONST64(0x937693ece53b7f93), CONST64(0x2288220daa442f22), +CONST64(0x648d6407e9c86364), CONST64(0xf1e3f1db12ff2af1), CONST64(0x73d173bfa2e6cc73), CONST64(0x124812905a248212), +CONST64(0x401d403a5d807a40), CONST64(0x0820084028104808), CONST64(0xc32bc356e89b95c3), CONST64(0xec97ec337bc5dfec), +CONST64(0xdb4bdb9690ab4ddb), CONST64(0xa1bea1611f5fc0a1), CONST64(0x8d0e8d1c8307918d), CONST64(0x3df43df5c97ac83d), +CONST64(0x976697ccf1335b97), CONST64(0x0000000000000000), CONST64(0xcf1bcf36d483f9cf), CONST64(0x2bac2b4587566e2b), +CONST64(0x76c57697b3ece176), CONST64(0x82328264b019e682), CONST64(0xd67fd6fea9b128d6), CONST64(0x1b6c1bd87736c31b), +CONST64(0xb5eeb5c15b7774b5), CONST64(0xaf86af112943beaf), CONST64(0x6ab56a77dfd41d6a), CONST64(0x505d50ba0da0ea50), +CONST64(0x450945124c8a5745), CONST64(0xf3ebf3cb18fb38f3), CONST64(0x30c0309df060ad30), CONST64(0xef9bef2b74c3c4ef), +CONST64(0x3ffc3fe5c37eda3f), CONST64(0x554955921caac755), CONST64(0xa2b2a2791059dba2), CONST64(0xea8fea0365c9e9ea), +CONST64(0x6589650fecca6a65), CONST64(0xbad2bab9686903ba), CONST64(0x2fbc2f65935e4a2f), CONST64(0xc027c04ee79d8ec0), +CONST64(0xde5fdebe81a160de), CONST64(0x1c701ce06c38fc1c), CONST64(0xfdd3fdbb2ee746fd), CONST64(0x4d294d52649a1f4d), +CONST64(0x927292e4e0397692), CONST64(0x75c9758fbceafa75), CONST64(0x061806301e0c3606), CONST64(0x8a128a249809ae8a), +CONST64(0xb2f2b2f940794bb2), CONST64(0xe6bfe66359d185e6), CONST64(0x0e380e70361c7e0e), CONST64(0x1f7c1ff8633ee71f), +CONST64(0x62956237f7c45562), CONST64(0xd477d4eea3b53ad4), CONST64(0xa89aa829324d81a8), CONST64(0x966296c4f4315296), +CONST64(0xf9c3f99b3aef62f9), CONST64(0xc533c566f697a3c5), CONST64(0x25942535b14a1025), CONST64(0x597959f220b2ab59), +CONST64(0x842a8454ae15d084), CONST64(0x72d572b7a7e4c572), CONST64(0x39e439d5dd72ec39), CONST64(0x4c2d4c5a6198164c), +CONST64(0x5e655eca3bbc945e), CONST64(0x78fd78e785f09f78), CONST64(0x38e038ddd870e538), CONST64(0x8c0a8c148605988c), +CONST64(0xd163d1c6b2bf17d1), CONST64(0xa5aea5410b57e4a5), CONST64(0xe2afe2434dd9a1e2), CONST64(0x6199612ff8c24e61), +CONST64(0xb3f6b3f1457b42b3), CONST64(0x21842115a5423421), CONST64(0x9c4a9c94d625089c), CONST64(0x1e781ef0663cee1e), +CONST64(0x4311432252866143), CONST64(0xc73bc776fc93b1c7), CONST64(0xfcd7fcb32be54ffc), CONST64(0x0410042014082404), +CONST64(0x515951b208a2e351), CONST64(0x995e99bcc72f2599), CONST64(0x6da96d4fc4da226d), CONST64(0x0d340d68391a650d), +CONST64(0xfacffa8335e979fa), CONST64(0xdf5bdfb684a369df), CONST64(0x7ee57ed79bfca97e), CONST64(0x2490243db4481924), +CONST64(0x3bec3bc5d776fe3b), CONST64(0xab96ab313d4b9aab), CONST64(0xce1fce3ed181f0ce), CONST64(0x1144118855229911), +CONST64(0x8f068f0c8903838f), CONST64(0x4e254e4a6b9c044e), CONST64(0xb7e6b7d1517366b7), CONST64(0xeb8beb0b60cbe0eb), +CONST64(0x3cf03cfdcc78c13c), CONST64(0x813e817cbf1ffd81), CONST64(0x946a94d4fe354094), CONST64(0xf7fbf7eb0cf31cf7), +CONST64(0xb9deb9a1676f18b9), CONST64(0x134c13985f268b13), CONST64(0x2cb02c7d9c58512c), CONST64(0xd36bd3d6b8bb05d3), +CONST64(0xe7bbe76b5cd38ce7), CONST64(0x6ea56e57cbdc396e), CONST64(0xc437c46ef395aac4), CONST64(0x030c03180f061b03), +CONST64(0x5645568a13acdc56), CONST64(0x440d441a49885e44), CONST64(0x7fe17fdf9efea07f), CONST64(0xa99ea921374f88a9), +CONST64(0x2aa82a4d8254672a), CONST64(0xbbd6bbb16d6b0abb), CONST64(0xc123c146e29f87c1), CONST64(0x535153a202a6f153), +CONST64(0xdc57dcae8ba572dc), CONST64(0x0b2c0b582716530b), CONST64(0x9d4e9d9cd327019d), CONST64(0x6cad6c47c1d82b6c), +CONST64(0x31c43195f562a431), CONST64(0x74cd7487b9e8f374), CONST64(0xf6fff6e309f115f6), CONST64(0x4605460a438c4c46), +CONST64(0xac8aac092645a5ac), CONST64(0x891e893c970fb589), CONST64(0x145014a04428b414), CONST64(0xe1a3e15b42dfbae1), +CONST64(0x165816b04e2ca616), CONST64(0x3ae83acdd274f73a), CONST64(0x69b9696fd0d20669), CONST64(0x092409482d124109), +CONST64(0x70dd70a7ade0d770), CONST64(0xb6e2b6d954716fb6), CONST64(0xd067d0ceb7bd1ed0), CONST64(0xed93ed3b7ec7d6ed), +CONST64(0xcc17cc2edb85e2cc), CONST64(0x4215422a57846842), CONST64(0x985a98b4c22d2c98), CONST64(0xa4aaa4490e55eda4), CONST64(0x28a0285d88507528), CONST64(0x5c6d5cda31b8865c), CONST64(0xf8c7f8933fed6bf8), CONST64(0x86228644a411c286) }; diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 4533ada5c..c797cf819 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -111,7 +111,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #undef LTC_FAST #undef LTC_FAST_TYPE #define LTC_NO_ROLC - #define LTC_NO_BSWAP + #define LTC_NO_BSWAP #endif /* #define ENDIAN_LITTLE */ diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 107ae1ac9..9a60f401e 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -326,7 +326,7 @@ /* Include Diffie-Hellman support */ #ifndef GMP_DESC /* is_prime fails for GMP */ -#define MDH +#define LTC_MDH /* Supported Key Sizes */ #define DH768 #define DH1024 @@ -367,7 +367,7 @@ #endif /* LTC_NO_PK */ -/* LTC_PKCS #1 (RSA) and #5 (Password Handling) stuff */ +/* PKCS #1 (RSA) and #5 (Password Handling) stuff */ #ifndef LTC_NO_PKCS #define LTC_PKCS_1 diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 98c6ce82d..131188657 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -27,7 +27,7 @@ int pk_get_oid(int pk, oid_st *st); #define MIN_RSA_SIZE 1024 #define MAX_RSA_SIZE 4096 -/** RSA LTC_PKCS style key */ +/** RSA PKCS style key */ typedef struct Rsa_key { /** Type of key, PK_PRIVATE or PK_PUBLIC */ int type; @@ -59,7 +59,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, void rsa_free(rsa_key *key); -/* These use LTC_PKCS #1 v2.0 padding */ +/* These use PKCS #1 v2.0 padding */ #define rsa_encrypt_key(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _prng, _prng_idx, _hash_idx, _key) \ rsa_encrypt_key_ex(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _prng, _prng_idx, _hash_idx, LTC_PKCS_1_OAEP, _key) @@ -75,7 +75,7 @@ void rsa_free(rsa_key *key); #define rsa_sign_saltlen_get_max(_hash_idx, _key) \ rsa_sign_saltlen_get_max_ex(LTC_PKCS_1_PSS, _hash_idx, _key) -/* These can be switched between LTC_PKCS #1 v2.x and LTC_PKCS #1 v1.5 paddings */ +/* These can be switched between PKCS #1 v2.x and PKCS #1 v1.5 paddings */ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, const unsigned char *lparam, unsigned long lparamlen, @@ -102,7 +102,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key); -/* LTC_PKCS #1 import/export */ +/* PKCS #1 import/export */ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key); int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); @@ -115,7 +115,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); #define MIN_KAT_SIZE 1024 #define MAX_KAT_SIZE 4096 -/** Katja LTC_PKCS style key */ +/** Katja PKCS style key */ typedef struct KAT_key { /** Type of key, PK_PRIVATE or PK_PUBLIC */ int type; @@ -145,7 +145,7 @@ int katja_exptmod(const unsigned char *in, unsigned long inlen, void katja_free(katja_key *key); -/* These use LTC_PKCS #1 v2.0 padding */ +/* These use PKCS #1 v2.0 padding */ int katja_encrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, const unsigned char *lparam, unsigned long lparamlen, @@ -157,7 +157,7 @@ int katja_decrypt_key(const unsigned char *in, unsigned long inlen, int hash_idx, int *stat, katja_key *key); -/* LTC_PKCS #1 import/export */ +/* PKCS #1 import/export */ int katja_export(unsigned char *out, unsigned long *outlen, int type, katja_key *key); int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key); diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index ee47dd39f..e3b7beabf 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -1,19 +1,19 @@ -/* LTC_PKCS Header Info */ +/* PKCS Header Info */ -/* ===> LTC_PKCS #1 -- RSA Cryptography <=== */ +/* ===> PKCS #1 -- RSA Cryptography <=== */ #ifdef LTC_PKCS_1 enum ltc_pkcs_1_v1_5_blocks { - LTC_PKCS_1_EMSA = 1, /* Block type 1 (LTC_PKCS #1 v1.5 signature padding) */ - LTC_PKCS_1_EME = 2 /* Block type 2 (LTC_PKCS #1 v1.5 encryption padding) */ + LTC_PKCS_1_EMSA = 1, /* Block type 1 (PKCS #1 v1.5 signature padding) */ + LTC_PKCS_1_EME = 2 /* Block type 2 (PKCS #1 v1.5 encryption padding) */ }; enum ltc_pkcs_1_paddings { - LTC_PKCS_1_V1_5 = 1, /* LTC_PKCS #1 v1.5 padding (\sa ltc_pkcs_1_v1_5_blocks) */ - LTC_PKCS_1_OAEP = 2, /* LTC_PKCS #1 v2.0 encryption padding */ - LTC_PKCS_1_PSS = 3 /* LTC_PKCS #1 v2.1 signature padding */ + LTC_PKCS_1_V1_5 = 1, /* PKCS #1 v1.5 padding (\sa ltc_pkcs_1_v1_5_blocks) */ + LTC_PKCS_1_OAEP = 2, /* PKCS #1 v2.0 encryption padding */ + LTC_PKCS_1_PSS = 3 /* PKCS #1 v2.1 signature padding */ }; int pkcs_1_mgf1( int hash_idx, @@ -67,7 +67,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, #endif /* LTC_PKCS_1 */ -/* ===> LTC_PKCS #5 -- Password Based Cryptography <=== */ +/* ===> PKCS #5 -- Password Based Cryptography <=== */ #ifdef LTC_PKCS_5 /* Algorithm #1 (old) */ diff --git a/src/mac/f9/f9_process.c b/src/mac/f9/f9_process.c index bf54d715c..b7a99f919 100644 --- a/src/mac/f9/f9_process.c +++ b/src/mac/f9/f9_process.c @@ -67,7 +67,7 @@ int f9_process(f9_state *f9, const unsigned char *in, unsigned long inlen) f9->IV[f9->buflen++] ^= *in++; --inlen; } - return CRYPT_OK; + return CRYPT_OK; } #endif diff --git a/src/mac/hmac/hmac_done.c b/src/mac/hmac/hmac_done.c index da5f31a91..15baa0c55 100644 --- a/src/mac/hmac/hmac_done.c +++ b/src/mac/hmac/hmac_done.c @@ -12,7 +12,7 @@ /** @file hmac_done.c - LTC_HMAC support, terminate stream, Tom St Denis/Dobes Vandermeer + HMAC support, terminate stream, Tom St Denis/Dobes Vandermeer */ #ifdef LTC_HMAC @@ -20,10 +20,10 @@ #define LTC_HMAC_BLOCKSIZE hash_descriptor[hash].blocksize /** - Terminate an LTC_HMAC session - @param hmac The LTC_HMAC state - @param out [out] The destination of the LTC_HMAC authentication tag - @param outlen [in/out] The max size and resulting size of the LTC_HMAC authentication tag + Terminate an HMAC session + @param hmac The HMAC state + @param out [out] The destination of the HMAC authentication tag + @param outlen [in/out] The max size and resulting size of the HMAC authentication tag @return CRYPT_OK if successful */ int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen) @@ -47,22 +47,22 @@ int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen) /* allocate buffers */ buf = XMALLOC(LTC_HMAC_BLOCKSIZE); isha = XMALLOC(hashsize); - if (buf == NULL || isha == NULL) { + if (buf == NULL || isha == NULL) { if (buf != NULL) { XFREE(buf); - } + } if (isha != NULL) { XFREE(isha); - } + } return CRYPT_MEM; } - /* Get the hash of the first LTC_HMAC vector plus the data */ + /* Get the hash of the first HMAC vector plus the data */ if ((err = hash_descriptor[hash].done(&hmac->md, isha)) != CRYPT_OK) { goto LBL_ERR; } - /* Create the second LTC_HMAC vector vector for step (3) */ + /* Create the second HMAC vector vector for step (3) */ for(i=0; i < LTC_HMAC_BLOCKSIZE; i++) { buf[i] = hmac->key[i] ^ 0x5C; } diff --git a/src/mac/hmac/hmac_file.c b/src/mac/hmac/hmac_file.c index b1d94389d..8558c2ac6 100644 --- a/src/mac/hmac/hmac_file.c +++ b/src/mac/hmac/hmac_file.c @@ -12,23 +12,23 @@ /** @file hmac_file.c - LTC_HMAC support, process a file, Tom St Denis/Dobes Vandermeer + HMAC support, process a file, Tom St Denis/Dobes Vandermeer */ #ifdef LTC_HMAC /** - LTC_HMAC a file + HMAC a file @param hash The index of the hash you wish to use - @param fname The name of the file you wish to LTC_HMAC + @param fname The name of the file you wish to HMAC @param key The secret key @param keylen The length of the secret key - @param out [out] The LTC_HMAC authentication tag + @param out [out] The HMAC authentication tag @param outlen [in/out] The max size and resulting size of the authentication tag @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled */ -int hmac_file(int hash, const char *fname, - const unsigned char *key, unsigned long keylen, +int hmac_file(int hash, const char *fname, + const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE @@ -44,7 +44,7 @@ int hmac_file(int hash, const char *fname, LTC_ARGCHK(key != NULL); LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); - + if((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } @@ -80,7 +80,7 @@ int hmac_file(int hash, const char *fname, #ifdef LTC_CLEAN_STACK /* clear memory */ zeromem(buf, sizeof(buf)); -#endif +#endif return CRYPT_OK; #endif } diff --git a/src/mac/hmac/hmac_init.c b/src/mac/hmac/hmac_init.c index 684fb2851..e43df24b4 100644 --- a/src/mac/hmac/hmac_init.c +++ b/src/mac/hmac/hmac_init.c @@ -12,7 +12,7 @@ /** @file hmac_init.c - LTC_HMAC support, initialize state, Tom St Denis/Dobes Vandermeer + HMAC support, initialize state, Tom St Denis/Dobes Vandermeer */ #ifdef LTC_HMAC @@ -20,9 +20,9 @@ #define LTC_HMAC_BLOCKSIZE hash_descriptor[hash].blocksize /** - Initialize an LTC_HMAC context. - @param hmac The LTC_HMAC state - @param hash The index of the hash you want to use + Initialize an HMAC context. + @param hmac The HMAC state + @param hash The index of the hash you want to use @param key The secret key @param keylen The length of the secret key (octets) @return CRYPT_OK if successful @@ -100,9 +100,9 @@ int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned lon #ifdef LTC_CLEAN_STACK zeromem(buf, LTC_HMAC_BLOCKSIZE); #endif - + XFREE(buf); - return err; + return err; } #endif diff --git a/src/mac/hmac/hmac_memory.c b/src/mac/hmac/hmac_memory.c index 9df80eaa3..c32f13aa5 100644 --- a/src/mac/hmac/hmac_memory.c +++ b/src/mac/hmac/hmac_memory.c @@ -12,25 +12,25 @@ /** @file hmac_memory.c - LTC_HMAC support, process a block of memory, Tom St Denis/Dobes Vandermeer + HMAC support, process a block of memory, Tom St Denis/Dobes Vandermeer */ #ifdef LTC_HMAC /** - LTC_HMAC a block of memory to produce the authentication tag - @param hash The index of the hash to use - @param key The secret key + HMAC a block of memory to produce the authentication tag + @param hash The index of the hash to use + @param key The secret key @param keylen The length of the secret key (octets) - @param in The data to LTC_HMAC - @param inlen The length of the data to LTC_HMAC (octets) + @param in The data to HMAC + @param inlen The length of the data to HMAC (octets) @param out [out] Destination of the authentication tag @param outlen [in/out] Max size and resulting size of authentication tag @return CRYPT_OK if successful */ -int hmac_memory(int hash, +int hmac_memory(int hash, const unsigned char *key, unsigned long keylen, - const unsigned char *in, unsigned long inlen, + const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) { hmac_state *hmac; @@ -38,7 +38,7 @@ int hmac_memory(int hash, LTC_ARGCHK(key != NULL); LTC_ARGCHK(in != NULL); - LTC_ARGCHK(out != NULL); + LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); /* make sure hash descriptor is valid */ @@ -77,7 +77,7 @@ int hmac_memory(int hash, #endif XFREE(hmac); - return err; + return err; } #endif diff --git a/src/mac/hmac/hmac_memory_multi.c b/src/mac/hmac/hmac_memory_multi.c index c3d461b82..f9d85878c 100644 --- a/src/mac/hmac/hmac_memory_multi.c +++ b/src/mac/hmac/hmac_memory_multi.c @@ -13,24 +13,24 @@ /** @file hmac_memory_multi.c - LTC_HMAC support, process multiple blocks of memory, Tom St Denis/Dobes Vandermeer + HMAC support, process multiple blocks of memory, Tom St Denis/Dobes Vandermeer */ #ifdef LTC_HMAC /** - LTC_HMAC multiple blocks of memory to produce the authentication tag - @param hash The index of the hash to use - @param key The secret key + HMAC multiple blocks of memory to produce the authentication tag + @param hash The index of the hash to use + @param key The secret key @param keylen The length of the secret key (octets) @param out [out] Destination of the authentication tag @param outlen [in/out] Max size and resulting size of authentication tag - @param in The data to LTC_HMAC - @param inlen The length of the data to LTC_HMAC (octets) - @param ... tuples of (data,len) pairs to LTC_HMAC, terminated with a (NULL,x) (x=don't care) + @param in The data to HMAC + @param inlen The length of the data to HMAC (octets) + @param ... tuples of (data,len) pairs to HMAC, terminated with a (NULL,x) (x=don't care) @return CRYPT_OK if successful */ -int hmac_memory_multi(int hash, +int hmac_memory_multi(int hash, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...) @@ -44,7 +44,7 @@ int hmac_memory_multi(int hash, LTC_ARGCHK(key != NULL); LTC_ARGCHK(in != NULL); - LTC_ARGCHK(out != NULL); + LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); /* allocate ram for hmac state */ @@ -58,7 +58,7 @@ int hmac_memory_multi(int hash, } va_start(args, inlen); - curptr = in; + curptr = in; curlen = inlen; for (;;) { /* process buf */ @@ -81,7 +81,7 @@ int hmac_memory_multi(int hash, #endif XFREE(hmac); va_end(args); - return err; + return err; } #endif diff --git a/src/mac/hmac/hmac_process.c b/src/mac/hmac/hmac_process.c index 802de1fb5..f1931c8de 100644 --- a/src/mac/hmac/hmac_process.c +++ b/src/mac/hmac/hmac_process.c @@ -12,16 +12,16 @@ /** @file hmac_process.c - LTC_HMAC support, process data, Tom St Denis/Dobes Vandermeer + HMAC support, process data, Tom St Denis/Dobes Vandermeer */ #ifdef LTC_HMAC -/** - Process data through LTC_HMAC +/** + Process data through HMAC @param hmac The hmac state - @param in The data to send through LTC_HMAC - @param inlen The length of the data to LTC_HMAC (octets) + @param in The data to send through HMAC + @param inlen The length of the data to HMAC (octets) @return CRYPT_OK if successful */ int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen) diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index af43da6ae..e63eff29d 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -12,7 +12,7 @@ /** @file hmac_test.c - LTC_HMAC support, self-test, Tom St Denis/Dobes Vandermeer + HMAC support, self-test, Tom St Denis/Dobes Vandermeer */ #ifdef LTC_HMAC @@ -27,18 +27,18 @@ Request for Comments: 2202 IBM Category: Informational R. Glenn NIST September 1997 - Test Cases for LTC_HMAC-LTC_MD5 and LTC_HMAC-LTC_SHA-1 + Test Cases for HMAC-MD5 and HMAC-SHA-1 */ /** - LTC_HMAC self-test + HMAC self-test @return CRYPT_OK if successful, CRYPT_NOP if tests have been disabled. */ int hmac_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else unsigned char digest[MAXBLOCKSIZE]; int i; @@ -52,7 +52,7 @@ int hmac_test(void) unsigned char digest[MAXBLOCKSIZE]; } cases[] = { /* - 3. Test Cases for LTC_HMAC-LTC_SHA-1 + 3. Test Cases for HMAC-SHA-1 test_case = 1 key = 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c @@ -62,8 +62,8 @@ int hmac_test(void) digest-96 = 0x4c1a03424b55e07fe7f27be1 */ { 5, "sha1", - {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, - 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, + {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, 20, "Test With Truncation", 20, {0x4c, 0x1a, 0x03, 0x42, 0x4b, 0x55, 0xe0, 0x7f, 0xe7, 0xf2, @@ -78,19 +78,19 @@ int hmac_test(void) digest = 0xaa4ae5e15272d00e95705637ce8a3b55ed402112 */ { 6, "sha1", - {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, 80, "Test Using Larger Than Block-Size Key - Hash Key First", 54, {0xaa, 0x4a, 0xe5, 0xe1, 0x52, 0x72, 0xd0, 0x0e, - 0x95, 0x70, 0x56, 0x37, 0xce, 0x8a, 0x3b, 0x55, + 0x95, 0x70, 0x56, 0x37, 0xce, 0x8a, 0x3b, 0x55, 0xed, 0x40, 0x21, 0x12} }, /* @@ -118,26 +118,26 @@ int hmac_test(void) 0x6b, 0xba, 0xa7, 0x96, 0x5c, 0x78, 0x08, 0xbb, 0xff, 0x1a, 0x91} }, /* - 2. Test Cases for LTC_HMAC-LTC_MD5 + 2. Test Cases for HMAC-MD5 test_case = 1 - key = 0x0b 0b 0b 0b + key = 0x0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b key_len = 16 data = "Hi There" data_len = 8 - digest = 0x92 94 72 7a - 36 38 bb 1c - 13 f4 8e f8 + digest = 0x92 94 72 7a + 36 38 bb 1c + 13 f4 8e f8 15 8b fc 9d */ { 1, "md5", - {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 16, "Hi There", 8, - {0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c, + {0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c, 0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d} }, /* test_case = 2 @@ -150,7 +150,7 @@ int hmac_test(void) { 2, "md5", "Jefe", 4, "what do ya want for nothing?", 28, - {0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03, + {0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03, 0xea, 0xa8, 0x6e, 0x31, 0x0a, 0x5d, 0xb7, 0x38} }, /* @@ -162,7 +162,7 @@ int hmac_test(void) digest = 0x56be34521d144c88dbb8c733f0e8b3f6 */ { 3, "md5", - {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, 16, {0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, @@ -189,12 +189,12 @@ int hmac_test(void) 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd}, 50, - {0x69, 0x7e, 0xaf, 0x0a, 0xca, 0x3a, 0x3a, 0xea, + {0x69, 0x7e, 0xaf, 0x0a, 0xca, 0x3a, 0x3a, 0xea, 0x3a, 0x75, 0x16, 0x47, 0x46, 0xff, 0xaa, 0x79} }, /* - + test_case = 5 key = 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c key_len = 16 @@ -204,10 +204,10 @@ int hmac_test(void) digest-96 0x56461ef2342edc00f9bab995 */ { 5, "md5", - {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, + {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, 16, "Test With Truncation", 20, - {0x56, 0x46, 0x1e, 0xf2, 0x34, 0x2e, 0xdc, 0x00, + {0x56, 0x46, 0x1e, 0xf2, 0x34, 0x2e, 0xdc, 0x00, 0xf9, 0xba, 0xb9, 0x95, 0x69, 0x0e, 0xfd, 0x4c} }, /* @@ -215,25 +215,25 @@ int hmac_test(void) test_case = 6 key = 0xaa repeated 80 times key_len = 80 - data = "Test Using Larger Than Block-Size Key - Hash + data = "Test Using Larger Than Block-Size Key - Hash Key First" data_len = 54 digest = 0x6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd */ { 6, "md5", - {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 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0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, 80, @@ -272,7 +272,7 @@ Key First" outlen = sizeof(digest); if((err = hmac_memory(hash, cases[i].key, cases[i].keylen, cases[i].data, cases[i].datalen, digest, &outlen)) != CRYPT_OK) { #if 0 - printf("LTC_HMAC-%s test #%d, %s\n", cases[i].algo, cases[i].num, error_to_string(err)); + printf("HMAC-%s test #%d, %s\n", cases[i].algo, cases[i].num, error_to_string(err)); #endif return err; } @@ -294,7 +294,7 @@ Key First" return CRYPT_ERROR; #endif } else { - /* printf("LTC_HMAC-%s test #%d: Passed\n", cases[i].algo, cases[i].num); */ + /* printf("HMAC-%s test #%d: Passed\n", cases[i].algo, cases[i].num); */ } } diff --git a/src/mac/omac/omac_done.c b/src/mac/omac/omac_done.c index 796bdf9b2..18fa25cc0 100644 --- a/src/mac/omac/omac_done.c +++ b/src/mac/omac/omac_done.c @@ -10,16 +10,16 @@ */ #include "tomcrypt.h" -/** +/** @file omac_done.c - LTC_OMAC1 support, terminate a stream, Tom St Denis + OMAC1 support, terminate a stream, Tom St Denis */ #ifdef LTC_OMAC /** - Terminate an LTC_OMAC stream - @param omac The LTC_OMAC state + Terminate an OMAC stream + @param omac The OMAC state @param out [out] Destination for the authentication tag @param outlen [in/out] The max size and resulting size of the authentication tag @return CRYPT_OK if successful @@ -65,7 +65,7 @@ int omac_done(omac_state *omac, unsigned char *out, unsigned long *outlen) return err; } cipher_descriptor[omac->cipher_idx].done(&omac->key); - + /* output it */ for (x = 0; x < (unsigned)omac->blklen && x < *outlen; x++) { out[x] = omac->block[x]; diff --git a/src/mac/omac/omac_file.c b/src/mac/omac/omac_file.c index 54871e0b2..d36871e82 100644 --- a/src/mac/omac/omac_file.c +++ b/src/mac/omac/omac_file.c @@ -10,26 +10,26 @@ */ #include "tomcrypt.h" -/** +/** @file omac_file.c - LTC_OMAC1 support, process a file, Tom St Denis + OMAC1 support, process a file, Tom St Denis */ #ifdef LTC_OMAC /** - LTC_OMAC a file + OMAC a file @param cipher The index of the cipher desired @param key The secret key @param keylen The length of the secret key (octets) - @param filename The name of the file you wish to LTC_OMAC + @param filename The name of the file you wish to OMAC @param out [out] Where the authentication tag is to be stored @param outlen [in/out] The max size and resulting size of the authentication tag @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled */ -int omac_file(int cipher, +int omac_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE diff --git a/src/mac/omac/omac_init.c b/src/mac/omac/omac_init.c index 36a4a3d9a..3bee70fce 100644 --- a/src/mac/omac/omac_init.c +++ b/src/mac/omac/omac_init.c @@ -10,17 +10,17 @@ */ #include "tomcrypt.h" -/** +/** @file omac_init.c - LTC_OMAC1 support, initialize state, by Tom St Denis + OMAC1 support, initialize state, by Tom St Denis */ #ifdef LTC_OMAC /** - Initialize an LTC_OMAC state - @param omac The LTC_OMAC state to initialize + Initialize an OMAC state + @param omac The OMAC state to initialize @param cipher The index of the desired cipher @param key The secret key @param keylen The length of the secret key (octets) @@ -77,7 +77,7 @@ int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned l omac->Lu[x][y] = ((omac->Lu[x][y] << 1) | (omac->Lu[x][y+1] >> 7)) & 255; } omac->Lu[x][len - 1] = ((omac->Lu[x][len - 1] << 1) ^ (msb ? mask : 0)) & 255; - + /* copy up as require */ if (x == 0) { XMEMCPY(omac->Lu[1], omac->Lu[0], sizeof(omac->Lu[0])); diff --git a/src/mac/omac/omac_memory.c b/src/mac/omac/omac_memory.c index c9f339295..dde7e7633 100644 --- a/src/mac/omac/omac_memory.c +++ b/src/mac/omac/omac_memory.c @@ -10,25 +10,25 @@ */ #include "tomcrypt.h" -/** +/** @file omac_memory.c - LTC_OMAC1 support, process a block of memory, Tom St Denis + OMAC1 support, process a block of memory, Tom St Denis */ #ifdef LTC_OMAC /** - LTC_OMAC a block of memory + OMAC a block of memory @param cipher The index of the desired cipher @param key The secret key @param keylen The length of the secret key (octets) - @param in The data to send through LTC_OMAC - @param inlen The length of the data to send through LTC_OMAC (octets) + @param in The data to send through OMAC + @param inlen The length of the data to send through OMAC (octets) @param out [out] The destination of the authentication tag @param outlen [in/out] The max size and resulting size of the authentication tag (octets) @return CRYPT_OK if successful */ -int omac_memory(int cipher, +int omac_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) @@ -75,7 +75,7 @@ int omac_memory(int cipher, #endif XFREE(omac); - return err; + return err; } #endif diff --git a/src/mac/omac/omac_memory_multi.c b/src/mac/omac/omac_memory_multi.c index 3db827041..afaf8cb45 100644 --- a/src/mac/omac/omac_memory_multi.c +++ b/src/mac/omac/omac_memory_multi.c @@ -11,26 +11,26 @@ #include "tomcrypt.h" #include -/** +/** @file omac_memory_multi.c - LTC_OMAC1 support, process multiple blocks of memory, Tom St Denis + OMAC1 support, process multiple blocks of memory, Tom St Denis */ #ifdef LTC_OMAC /** - LTC_OMAC multiple blocks of memory + OMAC multiple blocks of memory @param cipher The index of the desired cipher @param key The secret key @param keylen The length of the secret key (octets) @param out [out] The destination of the authentication tag @param outlen [in/out] The max size and resulting size of the authentication tag (octets) - @param in The data to send through LTC_OMAC - @param inlen The length of the data to send through LTC_OMAC (octets) - @param ... tuples of (data,len) pairs to LTC_OMAC, terminated with a (NULL,x) (x=don't care) + @param in The data to send through OMAC + @param inlen The length of the data to send through OMAC (octets) + @param ... tuples of (data,len) pairs to OMAC, terminated with a (NULL,x) (x=don't care) @return CRYPT_OK if successful */ -int omac_memory_multi(int cipher, +int omac_memory_multi(int cipher, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...) @@ -57,7 +57,7 @@ int omac_memory_multi(int cipher, goto LBL_ERR; } va_start(args, inlen); - curptr = in; + curptr = in; curlen = inlen; for (;;) { /* process buf */ @@ -80,7 +80,7 @@ int omac_memory_multi(int cipher, #endif XFREE(omac); va_end(args); - return err; + return err; } #endif diff --git a/src/mac/omac/omac_process.c b/src/mac/omac/omac_process.c index 9d0eb26ce..2bd08a9f5 100644 --- a/src/mac/omac/omac_process.c +++ b/src/mac/omac/omac_process.c @@ -10,24 +10,24 @@ */ #include "tomcrypt.h" -/** +/** @file omac_process.c - LTC_OMAC1 support, process data, Tom St Denis + OMAC1 support, process data, Tom St Denis */ #ifdef LTC_OMAC -/** - Process data through LTC_OMAC - @param omac The LTC_OMAC state - @param in The input data to send through LTC_OMAC +/** + Process data through OMAC + @param omac The OMAC state + @param in The input data to send through OMAC @param inlen The length of the input (octets) @return CRYPT_OK if successful */ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen) { - unsigned long n, x; + unsigned long n, x, blklen; int err; LTC_ARGCHK(omac != NULL); @@ -42,27 +42,23 @@ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen) } #ifdef LTC_FAST - { - unsigned long blklen; - - blklen = cipher_descriptor[omac->cipher_idx].block_length; - if (omac->buflen == 0 && inlen > blklen) { - unsigned long y; - for (x = 0; x < (inlen - blklen); x += blklen) { - for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y])); - } - in += blklen; - if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) { - return err; - } + blklen = cipher_descriptor[omac->cipher_idx].block_length; + if (omac->buflen == 0 && inlen > blklen) { + unsigned long y; + for (x = 0; x < (inlen - blklen); x += blklen) { + for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) { + *((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y])); } - inlen -= x; - } - } + in += blklen; + if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) { + return err; + } + } + inlen -= x; + } #endif - while (inlen != 0) { + while (inlen != 0) { /* ok if the block is full we xor in prev, encrypt and replace prev */ if (omac->buflen == omac->blklen) { for (x = 0; x < (unsigned long)omac->blklen; x++) { diff --git a/src/mac/omac/omac_test.c b/src/mac/omac/omac_test.c index 10f572563..502ad081e 100644 --- a/src/mac/omac/omac_test.c +++ b/src/mac/omac/omac_test.c @@ -10,15 +10,15 @@ */ #include "tomcrypt.h" -/** +/** @file omac_test.c - LTC_OMAC1 support, self-test, by Tom St Denis + OMAC1 support, self-test, by Tom St Denis */ #ifdef LTC_OMAC /** - Test the LTC_OMAC setup + Test the OMAC setup @return CRYPT_OK if successful, CRYPT_NOP if tests have been disabled */ int omac_test(void) @@ -26,48 +26,48 @@ int omac_test(void) #if !defined(LTC_TEST) return CRYPT_NOP; #else - static const struct { + static const struct { int keylen, msglen; unsigned char key[16], msg[64], tag[16]; } tests[] = { { 16, 0, - { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }, { 0x00 }, { 0xbb, 0x1d, 0x69, 0x29, 0xe9, 0x59, 0x37, 0x28, 0x7f, 0xa3, 0x7d, 0x12, 0x9b, 0x75, 0x67, 0x46 } }, - { 16, 16, - { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + { 16, 16, + { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }, { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a }, - { 0x07, 0x0a, 0x16, 0xb4, 0x6b, 0x4d, 0x41, 0x44, + { 0x07, 0x0a, 0x16, 0xb4, 0x6b, 0x4d, 0x41, 0x44, 0xf7, 0x9b, 0xdd, 0x9d, 0xd0, 0x4a, 0x28, 0x7c } }, - { 16, 40, - { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + { 16, 40, + { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }, { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, + 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11 }, { 0xdf, 0xa6, 0x67, 0x47, 0xde, 0x9a, 0xe6, 0x30, 0x30, 0xca, 0x32, 0x61, 0x14, 0x97, 0xc8, 0x27 } }, - { 16, 64, - { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, + { 16, 64, + { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }, { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, - 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, + 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 }, - { 0x51, 0xf0, 0xbe, 0xbf, 0x7e, 0x3b, 0x9d, 0x92, + { 0x51, 0xf0, 0xbe, 0xbf, 0x7e, 0x3b, 0x9d, 0x92, 0xfc, 0x49, 0x74, 0x17, 0x79, 0x36, 0x3c, 0xfe } } @@ -77,7 +77,7 @@ int omac_test(void) unsigned long len; - /* AES can be under rijndael or aes... try to find it */ + /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { if ((idx = find_cipher("rijndael")) == -1) { return CRYPT_NOP; @@ -85,7 +85,7 @@ int omac_test(void) } for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { - len = sizeof(out); + len = sizeof(out); if ((err = omac_memory(idx, tests[x].key, tests[x].keylen, tests[x].msg, tests[x].msglen, out, &len)) != CRYPT_OK) { return err; } @@ -101,7 +101,7 @@ int omac_test(void) } return CRYPT_OK; #endif -} +} #endif diff --git a/src/mac/pelican/pelican.c b/src/mac/pelican/pelican.c index 47640a335..ecdb9aeaa 100644 --- a/src/mac/pelican/pelican.c +++ b/src/mac/pelican/pelican.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pelican.c - Pelican MAC, initialize state, by Tom St Denis + Pelican MAC, initialize state, by Tom St Denis */ #ifdef LTC_PELICAN @@ -24,14 +24,14 @@ /** Initialize a Pelican state @param pelmac The Pelican state to initialize - @param key The secret key + @param key The secret key @param keylen The length of the secret key (octets) @return CRYPT_OK if successful */ int pelican_init(pelican_state *pelmac, const unsigned char *key, unsigned long keylen) { int err; - + LTC_ARGCHK(pelmac != NULL); LTC_ARGCHK(key != NULL); @@ -49,7 +49,7 @@ int pelican_init(pelican_state *pelmac, const unsigned char *key, unsigned long aes_ecb_encrypt(pelmac->state, pelmac->state, &pelmac->K); pelmac->buflen = 0; - return CRYPT_OK; + return CRYPT_OK; } static void four_rounds(pelican_state *pelmac) @@ -90,7 +90,7 @@ static void four_rounds(pelican_state *pelmac) STORE32H(s3, pelmac->state + 12); } -/** +/** Process a block of text through Pelican @param pelmac The Pelican MAC state @param in The input @@ -156,7 +156,7 @@ int pelican_done(pelican_state *pelmac, unsigned char *out) aes_ecb_encrypt(pelmac->state, out, &pelmac->K); aes_done(&pelmac->K); return CRYPT_OK; -} +} #endif diff --git a/src/mac/pmac/pmac_process.c b/src/mac/pmac/pmac_process.c index e32e65f21..78100630c 100644 --- a/src/mac/pmac/pmac_process.c +++ b/src/mac/pmac/pmac_process.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pmac_process.c - PMAC implementation, process data, by Tom St Denis + PMAC implementation, process data, by Tom St Denis */ @@ -62,7 +62,7 @@ int pmac_process(pmac_state *pmac, const unsigned char *in, unsigned long inlen) } #endif - while (inlen != 0) { + while (inlen != 0) { /* ok if the block is full we xor in prev, encrypt and replace prev */ if (pmac->buflen == pmac->block_len) { pmac_shift_xor(pmac); diff --git a/src/mac/xcbc/xcbc_process.c b/src/mac/xcbc/xcbc_process.c index 46ab4a075..df5b741a8 100644 --- a/src/mac/xcbc/xcbc_process.c +++ b/src/mac/xcbc/xcbc_process.c @@ -64,7 +64,7 @@ int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen) xcbc->IV[xcbc->buflen++] ^= *in++; --inlen; } - return CRYPT_OK; + return CRYPT_OK; } #endif diff --git a/src/misc/crypt/crypt_argchk.c b/src/misc/crypt/crypt_argchk.c index c86f08625..2301c2959 100644 --- a/src/misc/crypt/crypt_argchk.c +++ b/src/misc/crypt/crypt_argchk.c @@ -9,7 +9,6 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" -#include /** @file crypt_argchk.c @@ -17,6 +16,7 @@ */ #if (ARGTYPE == 0) +#include void crypt_argchk(char *v, char *s, int d) { fprintf(stderr, "LTC_ARGCHK '%s' failure on line %d of file %s\n", diff --git a/src/misc/pkcs5/pkcs_5_1.c b/src/misc/pkcs5/pkcs_5_1.c index 519e7aa1b..d225447e4 100644 --- a/src/misc/pkcs5/pkcs_5_1.c +++ b/src/misc/pkcs5/pkcs_5_1.c @@ -10,24 +10,24 @@ */ #include -/** +/** @file pkcs_5_1.c - LTC_PKCS #5, Algorithm #1, Tom St Denis + PKCS #5, Algorithm #1, Tom St Denis */ #ifdef LTC_PKCS_5 /** - Execute LTC_PKCS #5 v1 + Execute PKCS #5 v1 @param password The password (or key) @param password_len The length of the password (octet) @param salt The salt (or nonce) which is 8 octets long - @param iteration_count The LTC_PKCS #5 v1 iteration count + @param iteration_count The PKCS #5 v1 iteration count @param hash_idx The index of the hash desired @param out [out] The destination for this algorithm @param outlen [in/out] The max size and resulting size of the algorithm output @return CRYPT_OK if successful */ -int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, - const unsigned char *salt, +int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, + const unsigned char *salt, int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen) { @@ -53,11 +53,11 @@ int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, if (md != NULL) { XFREE(md); } - if (buf != NULL) { + if (buf != NULL) { XFREE(buf); } return CRYPT_MEM; - } + } /* hash initial password + salt */ if ((err = hash_descriptor[hash_idx].init(md)) != CRYPT_OK) { @@ -88,7 +88,7 @@ int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, *outlen = x; err = CRYPT_OK; LBL_ERR: -#ifdef LTC_CLEAN_STACK +#ifdef LTC_CLEAN_STACK zeromem(buf, MAXBLOCKSIZE); zeromem(md, sizeof(hash_state)); #endif diff --git a/src/misc/pkcs5/pkcs_5_2.c b/src/misc/pkcs5/pkcs_5_2.c index 0d76d6295..9b9b78a64 100644 --- a/src/misc/pkcs5/pkcs_5_2.c +++ b/src/misc/pkcs5/pkcs_5_2.c @@ -10,25 +10,25 @@ */ #include -/** +/** @file pkcs_5_2.c - LTC_PKCS #5, Algorithm #2, Tom St Denis + PKCS #5, Algorithm #2, Tom St Denis */ #ifdef LTC_PKCS_5 /** - Execute LTC_PKCS #5 v2 + Execute PKCS #5 v2 @param password The input password (or key) @param password_len The length of the password (octets) @param salt The salt (or nonce) @param salt_len The length of the salt (octets) - @param iteration_count # of iterations desired for LTC_PKCS #5 v2 [read specs for more] + @param iteration_count # of iterations desired for PKCS #5 v2 [read specs for more] @param hash_idx The index of the hash desired @param out [out] The destination for this algorithm @param outlen [in/out] The max size and resulting size of the algorithm output @return CRYPT_OK if successful */ -int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, +int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, const unsigned char *salt, unsigned long salt_len, int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen) @@ -69,13 +69,13 @@ int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, while (left != 0) { /* process block number blkno */ zeromem(buf[0], MAXBLOCKSIZE*2); - + /* store current block number and increment for next pass */ STORE32H(blkno, buf[1]); ++blkno; /* get PRF(P, S||int(blkno)) */ - if ((err = hmac_init(hmac, hash_idx, password, password_len)) != CRYPT_OK) { + if ((err = hmac_init(hmac, hash_idx, password, password_len)) != CRYPT_OK) { goto LBL_ERR; } if ((err = hmac_process(hmac, salt, salt_len)) != CRYPT_OK) { diff --git a/src/modes/cbc/cbc_decrypt.c b/src/modes/cbc/cbc_decrypt.c index 3751f140e..d0766ed75 100644 --- a/src/modes/cbc/cbc_decrypt.c +++ b/src/modes/cbc/cbc_decrypt.c @@ -34,7 +34,7 @@ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s LTC_FAST_TYPE tmpy; #else unsigned char tmpy; -#endif +#endif LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); @@ -43,21 +43,21 @@ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s if ((err = cipher_is_valid(cbc->cipher)) != CRYPT_OK) { return err; } - + /* is blocklen valid? */ if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV)) { return CRYPT_INVALID_ARG; - } + } if (len % cbc->blocklen) { return CRYPT_INVALID_ARG; } #ifdef LTC_FAST - if (cbc->blocklen % sizeof(LTC_FAST_TYPE)) { + if (cbc->blocklen % sizeof(LTC_FAST_TYPE)) { return CRYPT_INVALID_ARG; } #endif - + if (cipher_descriptor[cbc->cipher].accel_cbc_decrypt != NULL) { return cipher_descriptor[cbc->cipher].accel_cbc_decrypt(ct, pt, len / cbc->blocklen, cbc->IV, &cbc->key); } else { @@ -74,14 +74,14 @@ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); *((LTC_FAST_TYPE*)((unsigned char *)pt + x)) = tmpy; } - #else + #else for (x = 0; x < cbc->blocklen; x++) { tmpy = tmp[x] ^ cbc->IV[x]; cbc->IV[x] = ct[x]; pt[x] = tmpy; } #endif - + ct += cbc->blocklen; pt += cbc->blocklen; len -= cbc->blocklen; diff --git a/src/modes/cbc/cbc_encrypt.c b/src/modes/cbc/cbc_encrypt.c index 1f282040a..f9c3941c6 100644 --- a/src/modes/cbc/cbc_encrypt.c +++ b/src/modes/cbc/cbc_encrypt.c @@ -37,17 +37,17 @@ int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s if ((err = cipher_is_valid(cbc->cipher)) != CRYPT_OK) { return err; } - + /* is blocklen valid? */ if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV)) { return CRYPT_INVALID_ARG; - } + } if (len % cbc->blocklen) { return CRYPT_INVALID_ARG; } #ifdef LTC_FAST - if (cbc->blocklen % sizeof(LTC_FAST_TYPE)) { + if (cbc->blocklen % sizeof(LTC_FAST_TYPE)) { return CRYPT_INVALID_ARG; } #endif @@ -61,7 +61,7 @@ int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) ^= *((LTC_FAST_TYPE*)((unsigned char *)pt + x)); } - #else + #else for (x = 0; x < cbc->blocklen; x++) { cbc->IV[x] ^= pt[x]; } @@ -77,12 +77,12 @@ int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); } - #else + #else for (x = 0; x < cbc->blocklen; x++) { cbc->IV[x] = ct[x]; } #endif - + ct += cbc->blocklen; pt += cbc->blocklen; len -= cbc->blocklen; diff --git a/src/modes/ctr/ctr_encrypt.c b/src/modes/ctr/ctr_encrypt.c index 0b08359d6..56eb9ce26 100644 --- a/src/modes/ctr/ctr_encrypt.c +++ b/src/modes/ctr/ctr_encrypt.c @@ -37,7 +37,7 @@ int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s if ((err = cipher_is_valid(ctr->cipher)) != CRYPT_OK) { return err; } - + /* is blocklen/padlen valid? */ if (ctr->blocklen < 1 || ctr->blocklen > (int)sizeof(ctr->ctr) || ctr->padlen < 0 || ctr->padlen > (int)sizeof(ctr->pad)) { @@ -49,7 +49,7 @@ int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s return CRYPT_INVALID_ARG; } #endif - + /* handle acceleration only if pad is empty, accelerator is present and length is >= a block size */ if ((ctr->padlen == ctr->blocklen) && cipher_descriptor[ctr->cipher].accel_ctr_encrypt != NULL && (len >= (unsigned long)ctr->blocklen)) { if ((err = cipher_descriptor[ctr->cipher].accel_ctr_encrypt(pt, ct, len/ctr->blocklen, ctr->ctr, ctr->mode, &ctr->key)) != CRYPT_OK) { @@ -98,7 +98,7 @@ int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s ctr->padlen = ctr->blocklen; continue; } -#endif +#endif *ct++ = *pt++ ^ ctr->pad[ctr->padlen++]; --len; } diff --git a/src/modes/f8/f8_encrypt.c b/src/modes/f8/f8_encrypt.c index d1a96df06..e510e6766 100644 --- a/src/modes/f8/f8_encrypt.c +++ b/src/modes/f8/f8_encrypt.c @@ -35,13 +35,13 @@ int f8_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, sy if ((err = cipher_is_valid(f8->cipher)) != CRYPT_OK) { return err; } - + /* is blocklen/padlen valid? */ if (f8->blocklen < 0 || f8->blocklen > (int)sizeof(f8->IV) || f8->padlen < 0 || f8->padlen > (int)sizeof(f8->IV)) { return CRYPT_INVALID_ARG; } - + zeromem(buf, sizeof(buf)); /* make sure the pad is empty */ @@ -75,7 +75,7 @@ int f8_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, sy ct += x; } } -#endif +#endif while (len > 0) { if (f8->padlen == f8->blocklen) { diff --git a/src/modes/lrw/lrw_process.c b/src/modes/lrw/lrw_process.c index 25661e7d8..e7b567bad 100644 --- a/src/modes/lrw/lrw_process.c +++ b/src/modes/lrw/lrw_process.c @@ -49,7 +49,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i /* increment IV */ for (x = 15; x >= 0; x--) { lrw->IV[x] = (lrw->IV[x] + 1) & 255; - if (lrw->IV[x]) { + if (lrw->IV[x]) { break; } } @@ -92,7 +92,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i if ((err = cipher_descriptor[lrw->cipher].ecb_decrypt(ct, ct, &lrw->key)) != CRYPT_OK) { return err; } - } + } /* xor prod */ #ifdef LTC_FAST @@ -104,7 +104,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i ct[x] = ct[x] ^ prod[x]; } #endif - + /* move to next */ pt += 16; ct += 16; @@ -113,7 +113,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i return CRYPT_OK; } - + #endif /* $Source$ */ /* $Revision$ */ diff --git a/src/modes/lrw/lrw_setiv.c b/src/modes/lrw/lrw_setiv.c index 2ff9a8062..8a2ff9a6f 100644 --- a/src/modes/lrw/lrw_setiv.c +++ b/src/modes/lrw/lrw_setiv.c @@ -65,8 +65,8 @@ int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw) #endif } XMEMCPY(lrw->pad, T, 16); -#else - gcm_gf_mult(lrw->tweak, IV, lrw->pad); +#else + gcm_gf_mult(lrw->tweak, IV, lrw->pad); #endif return CRYPT_OK; diff --git a/src/pk/asn1/der/integer/der_length_integer.c b/src/pk/asn1/der/integer/der_length_integer.c index 9d4968392..b8ff463a3 100644 --- a/src/pk/asn1/der/integer/der_length_integer.c +++ b/src/pk/asn1/der/integer/der_length_integer.c @@ -18,8 +18,8 @@ #ifdef LTC_DER /** - Gets length of DER encoding of num - @param num The int to get the size of + Gets length of DER encoding of num + @param num The int to get the size of @param outlen [out] The length of the DER encoding for the given integer @return CRYPT_OK if successful */ @@ -71,7 +71,7 @@ int der_length_integer(void *num, unsigned long *outlen) ++len; /* return length */ - *outlen = len; + *outlen = len; return CRYPT_OK; } diff --git a/src/pk/asn1/der/set/der_encode_setof.c b/src/pk/asn1/der/set/der_encode_setof.c index 8e87f84a6..938a30900 100644 --- a/src/pk/asn1/der/set/der_encode_setof.c +++ b/src/pk/asn1/der/set/der_encode_setof.c @@ -27,10 +27,10 @@ static int qsort_helper(const void *a, const void *b) struct edge *A = (struct edge *)a, *B = (struct edge *)b; int r; unsigned long x; - + /* compare min length */ r = XMEMCMP(A->start, B->start, MIN(A->size, B->size)); - + if (r == 0 && A->size != B->size) { if (A->size > B->size) { for (x = B->size; x < A->size; x++) { @@ -44,20 +44,20 @@ static int qsort_helper(const void *a, const void *b) return -1; } } - } + } } - - return r; + + return r; } /** Encode a SETOF stucture @param list The list of items to encode @param inlen The number of items in the list - @param out [out] The destination + @param out [out] The destination @param outlen [in/out] The size of the output @return CRYPT_OK on success -*/ +*/ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, unsigned char *out, unsigned long *outlen) { @@ -65,7 +65,7 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, int err; struct edge *edges; unsigned char *ptr, *buf; - + /* check that they're all the same type */ for (x = 1; x < inlen; x++) { if (list[x].type != list[x-1].type) { @@ -77,21 +77,21 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, buf = XCALLOC(1, *outlen); if (buf == NULL) { return CRYPT_MEM; - } - + } + /* encode list */ if ((err = der_encode_sequence_ex(list, inlen, buf, outlen, LTC_ASN1_SETOF)) != CRYPT_OK) { XFREE(buf); return err; } - + /* allocate edges */ edges = XCALLOC(inlen, sizeof(*edges)); if (edges == NULL) { XFREE(buf); return CRYPT_MEM; - } - + } + /* skip header */ ptr = buf + 1; @@ -100,20 +100,20 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, if (x >= 0x80) { ptr += (x & 0x7F); } - + /* get the size of the static header */ hdrlen = ((unsigned long)ptr) - ((unsigned long)buf); - - + + /* scan for edges */ x = 0; while (ptr < (buf + *outlen)) { /* store start */ edges[x].start = ptr; - + /* skip type */ z = 1; - + /* parse length */ y = ptr[z++]; if (y < 128) { @@ -125,33 +125,33 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, edges[x].size = (edges[x].size << 8) | ((unsigned long)ptr[z++]); } } - + /* skip content */ edges[x].size += z; ptr += edges[x].size; ++x; - } - + } + /* sort based on contents (using edges) */ XQSORT(edges, inlen, sizeof(*edges), &qsort_helper); - + /* copy static header */ XMEMCPY(out, buf, hdrlen); - + /* copy+sort using edges+indecies to output from buffer */ for (y = hdrlen, x = 0; x < inlen; x++) { XMEMCPY(out+y, edges[x].start, edges[x].size); y += edges[x].size; - } - + } + #ifdef LTC_CLEAN_STACK zeromem(buf, *outlen); -#endif - +#endif + /* free buffers */ XFREE(edges); XFREE(buf); - + return CRYPT_OK; } diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index d9b76469f..7ad003df8 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -14,7 +14,7 @@ @file dh.c DH crypto, Tom St Denis */ - + #ifdef MDH /* size of a packet header in bytes */ @@ -367,12 +367,12 @@ int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) /* make up random string */ if ( rng_make_prng( keysize, wprng, prng, NULL) != CRYPT_OK) { - err = CRYPT_ERROR_READPRNG; + err = CRYPT_ERROR_READPRNG; goto error2; } if (prng_descriptor[wprng].read(buf, keysize, prng) != (unsigned long)keysize) { - err = CRYPT_ERROR_READPRNG; + err = CRYPT_ERROR_READPRNG; goto error2; } @@ -407,7 +407,7 @@ int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) /** Free the allocated ram for a DH key @param key The key which you wish to free -*/ +*/ void dh_free(dh_key *key) { LTC_ARGCHK(key != NULL); @@ -442,7 +442,7 @@ int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key) if (*outlen < (PACKET_SIZE + 2)) { return CRYPT_BUFFER_OVERFLOW; } - + if (type == PK_PRIVATE && key->type != PK_PRIVATE) { return CRYPT_PK_NOT_PRIVATE; } @@ -550,7 +550,7 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) /** Create a DH shared secret. @param private_key The private DH key in the pair - @param public_key The public DH key in the pair + @param public_key The public DH key in the pair @param out [out] The destination of the shared data @param outlen [in/out] The max size and resulting size of the shared data. @return CRYPT_OK if successful diff --git a/src/pk/ecc/ltc_ecc_mulmod.c b/src/pk/ecc/ltc_ecc_mulmod.c index 4b11392ea..28eebdcfb 100644 --- a/src/pk/ecc/ltc_ecc_mulmod.c +++ b/src/pk/ecc/ltc_ecc_mulmod.c @@ -19,7 +19,7 @@ /** @file ltc_ecc_mulmod.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC #ifndef LTC_ECC_TIMING_RESISTANT @@ -28,7 +28,7 @@ #define WINSIZE 4 /** - Perform a point multiplication + Perform a point multiplication @param k The scalar to multiply by @param G The base point @param R [out] Destination for kG @@ -85,7 +85,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) if ((err = mp_copy(G->x, tG->x)) != CRYPT_OK) { goto done; } if ((err = mp_copy(G->y, tG->y)) != CRYPT_OK) { goto done; } if ((err = mp_copy(G->z, tG->z)) != CRYPT_OK) { goto done; } - } else { + } else { if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } diff --git a/src/pk/katja/katja_decrypt_key.c b/src/pk/katja/katja_decrypt_key.c index e8819d94b..4a3355878 100644 --- a/src/pk/katja/katja_decrypt_key.c +++ b/src/pk/katja/katja_decrypt_key.c @@ -12,13 +12,13 @@ /** @file katja_decrypt_key.c - Katja LTC_PKCS #1 OAEP Decryption, Tom St Denis -*/ + Katja PKCS #1 OAEP Decryption, Tom St Denis +*/ #ifdef MKAT /** - (LTC_PKCS #1 v2.0) decrypt then OAEP depad + (PKCS #1 v2.0) decrypt then OAEP depad @param in The ciphertext @param inlen The length of the ciphertext (octets) @param out [out] The plaintext @@ -31,7 +31,7 @@ @return CRYPT_OK if succcessul (even if invalid) */ int katja_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, + unsigned char *out, unsigned long *outlen, const unsigned char *lparam, unsigned long lparamlen, int hash_idx, int *stat, katja_key *key) @@ -39,7 +39,7 @@ int katja_decrypt_key(const unsigned char *in, unsigned long inlen, unsigned long modulus_bitlen, modulus_bytelen, x; int err; unsigned char *tmp; - + LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); @@ -52,7 +52,7 @@ int katja_decrypt_key(const unsigned char *in, unsigned long inlen, if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; } - + /* get modulus len in bits */ modulus_bitlen = mp_count_bits( (key->N)); diff --git a/src/pk/katja/katja_encrypt_key.c b/src/pk/katja/katja_encrypt_key.c index ef59e92e2..08635ebbd 100644 --- a/src/pk/katja/katja_encrypt_key.c +++ b/src/pk/katja/katja_encrypt_key.c @@ -12,13 +12,13 @@ /** @file katja_encrypt_key.c - Katja LTC_PKCS-style OAEP encryption, Tom St Denis -*/ + Katja PKCS-style OAEP encryption, Tom St Denis +*/ #ifdef MKAT /** - (LTC_PKCS #1 v2.0) OAEP pad then encrypt + (PKCS #1 v2.0) OAEP pad then encrypt @param in The plaintext @param inlen The length of the plaintext (octets) @param out [out] The ciphertext @@ -30,7 +30,7 @@ @param hash_idx The index of the desired hash @param key The Katja key to encrypt to @return CRYPT_OK if successful -*/ +*/ int katja_encrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, const unsigned char *lparam, unsigned long lparamlen, @@ -38,12 +38,12 @@ int katja_encrypt_key(const unsigned char *in, unsigned long inlen, { unsigned long modulus_bitlen, modulus_bytelen, x; int err; - + LTC_ARGCHK(in != NULL); LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); - + /* valid prng and hash ? */ if ((err = prng_is_valid(prng_idx)) != CRYPT_OK) { return err; @@ -51,7 +51,7 @@ int katja_encrypt_key(const unsigned char *in, unsigned long inlen, if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; } - + /* get modulus len in bits */ modulus_bitlen = mp_count_bits((key->N)); @@ -70,11 +70,11 @@ int katja_encrypt_key(const unsigned char *in, unsigned long inlen, /* OAEP pad the key */ x = *outlen; - if ((err = pkcs_1_oaep_encode(in, inlen, lparam, - lparamlen, modulus_bitlen, prng, prng_idx, hash_idx, + if ((err = pkcs_1_oaep_encode(in, inlen, lparam, + lparamlen, modulus_bitlen, prng, prng_idx, hash_idx, out, &x)) != CRYPT_OK) { return err; - } + } /* Katja exptmod the OAEP pad */ return katja_exptmod(out, x, out, outlen, PK_PUBLIC, key); diff --git a/src/pk/katja/katja_export.c b/src/pk/katja/katja_export.c index 5f4d32727..97c63aa4b 100644 --- a/src/pk/katja/katja_export.c +++ b/src/pk/katja/katja_export.c @@ -12,8 +12,8 @@ /** @file katja_export.c - Export Katja LTC_PKCS-style keys, Tom St Denis -*/ + Export Katja PKCS-style keys, Tom St Denis +*/ #ifdef MKAT @@ -24,7 +24,7 @@ @param type The type of exported key (PK_PRIVATE or PK_PUBLIC) @param key The Katja key to export @return CRYPT_OK if successful -*/ +*/ int katja_export(unsigned char *out, unsigned long *outlen, int type, katja_key *key) { int err; @@ -41,29 +41,29 @@ int katja_export(unsigned char *out, unsigned long *outlen, int type, katja_key if (type == PK_PRIVATE) { /* private key */ - /* output is + /* output is Version, n, d, p, q, d mod (p-1), d mod (q - 1), 1/q mod p, pq */ - if ((err = der_encode_sequence_multi(out, outlen, - LTC_ASN1_SHORT_INTEGER, 1UL, &zero, - LTC_ASN1_INTEGER, 1UL, key->N, - LTC_ASN1_INTEGER, 1UL, key->d, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, + if ((err = der_encode_sequence_multi(out, outlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &zero, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->d, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, LTC_ASN1_INTEGER, 1UL, key->dP, - LTC_ASN1_INTEGER, 1UL, key->dQ, - LTC_ASN1_INTEGER, 1UL, key->qP, - LTC_ASN1_INTEGER, 1UL, key->pq, + LTC_ASN1_INTEGER, 1UL, key->dQ, + LTC_ASN1_INTEGER, 1UL, key->qP, + LTC_ASN1_INTEGER, 1UL, key->pq, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { return err; } - + /* clear zero and return */ return CRYPT_OK; } else { /* public key */ - return der_encode_sequence_multi(out, outlen, - LTC_ASN1_INTEGER, 1UL, key->N, + return der_encode_sequence_multi(out, outlen, + LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_EOL, 0UL, NULL); } } diff --git a/src/pk/katja/katja_exptmod.c b/src/pk/katja/katja_exptmod.c index 5df89082d..7cf56043f 100644 --- a/src/pk/katja/katja_exptmod.c +++ b/src/pk/katja/katja_exptmod.c @@ -12,21 +12,21 @@ /** @file katja_exptmod.c - Katja LTC_PKCS-style exptmod, Tom St Denis -*/ + Katja PKCS-style exptmod, Tom St Denis +*/ #ifdef MKAT -/** - Compute an RSA modular exponentiation +/** + Compute an RSA modular exponentiation @param in The input data to send into RSA @param inlen The length of the input (octets) - @param out [out] The destination + @param out [out] The destination @param outlen [in/out] The max size and resulting size of the output @param which Which exponent to use, e.g. PK_PRIVATE or PK_PUBLIC - @param key The RSA key to use + @param key The RSA key to use @return CRYPT_OK if successful -*/ +*/ int katja_exptmod(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, int which, katja_key *key) @@ -39,7 +39,7 @@ int katja_exptmod(const unsigned char *in, unsigned long inlen, LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); - + /* is the key of the right type for the operation? */ if (which == PK_PRIVATE && (key->type != PK_PRIVATE)) { return CRYPT_PK_NOT_PRIVATE; diff --git a/src/pk/katja/katja_import.c b/src/pk/katja/katja_import.c index 425f49819..3ea606250 100644 --- a/src/pk/katja/katja_import.c +++ b/src/pk/katja/katja_import.c @@ -12,13 +12,13 @@ /** @file katja_import.c - Import a LTC_PKCS-style Katja key, Tom St Denis -*/ + Import a PKCS-style Katja key, Tom St Denis +*/ #ifdef MKAT /** - Import an KatjaPublicKey or KatjaPrivateKey [two-prime only, only support >= 1024-bit keys, defined in LTC_PKCS #1 v2.1] + Import an KatjaPublicKey or KatjaPrivateKey [two-prime only, only support >= 1024-bit keys, defined in PKCS #1 v2.1] @param in The packet to import from @param inlen It's length (octets) @param key [out] Destination for newly imported key @@ -34,29 +34,29 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key) LTC_ARGCHK(ltc_mp.name != NULL); /* init key */ - if ((err = mp_init_multi(&zero, &key->d, &key->N, &key->dQ, + if ((err = mp_init_multi(&zero, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, &key->pq, NULL)) != CRYPT_OK) { return err; } - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_INTEGER, 1UL, key->N, + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto LBL_ERR; } if (mp_cmp_d(key->N, 0) == LTC_MP_EQ) { /* it's a private key */ - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_INTEGER, 1UL, zero, - LTC_ASN1_INTEGER, 1UL, key->N, - LTC_ASN1_INTEGER, 1UL, key->d, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_INTEGER, 1UL, zero, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->d, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, LTC_ASN1_INTEGER, 1UL, key->dP, - LTC_ASN1_INTEGER, 1UL, key->dQ, - LTC_ASN1_INTEGER, 1UL, key->qP, - LTC_ASN1_INTEGER, 1UL, key->pq, + LTC_ASN1_INTEGER, 1UL, key->dQ, + LTC_ASN1_INTEGER, 1UL, key->qP, + LTC_ASN1_INTEGER, 1UL, key->pq, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/pk/pkcs1/pkcs_1_i2osp.c b/src/pk/pkcs1/pkcs_1_i2osp.c index 2d9df7569..b4cb4feff 100644 --- a/src/pk/pkcs1/pkcs_1_i2osp.c +++ b/src/pk/pkcs1/pkcs_1_i2osp.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pkcs_1_i2osp.c - Integer to Octet I2OSP, Tom St Denis + Integer to Octet I2OSP, Tom St Denis */ #ifdef LTC_PKCS_1 @@ -22,7 +22,7 @@ */ /** - LTC_PKCS #1 Integer to binary + PKCS #1 Integer to binary @param n The integer to store @param modulus_len The length of the RSA modulus @param out [out] The destination for the integer diff --git a/src/pk/pkcs1/pkcs_1_mgf1.c b/src/pk/pkcs1/pkcs_1_mgf1.c index af8f7e215..c7c2b5bc6 100644 --- a/src/pk/pkcs1/pkcs_1_mgf1.c +++ b/src/pk/pkcs1/pkcs_1_mgf1.c @@ -10,15 +10,15 @@ */ #include "tomcrypt.h" -/** +/** @file pkcs_1_mgf1.c - The Mask Generation Function (MGF1) for LTC_PKCS #1, Tom St Denis + The Mask Generation Function (MGF1) for PKCS #1, Tom St Denis */ #ifdef LTC_PKCS_1 /** - Perform LTC_PKCS #1 MGF1 (internal) + Perform PKCS #1 MGF1 (internal) @param seed The seed for MGF1 @param seedlen The length of the seed @param hash_idx The index of the hash desired @@ -35,12 +35,12 @@ int pkcs_1_mgf1(int hash_idx, int err; hash_state *md; unsigned char *buf; - + LTC_ARGCHK(seed != NULL); LTC_ARGCHK(mask != NULL); /* ensure valid hash */ - if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; } diff --git a/src/pk/pkcs1/pkcs_1_oaep_decode.c b/src/pk/pkcs1/pkcs_1_oaep_decode.c index 9ac9976e9..3a87efe64 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -10,15 +10,15 @@ */ #include "tomcrypt.h" -/** +/** @file pkcs_1_oaep_decode.c - OAEP Padding for LTC_PKCS #1, Tom St Denis + OAEP Padding for PKCS #1, Tom St Denis */ #ifdef LTC_PKCS_1 /** - LTC_PKCS #1 v2.00 OAEP decode + PKCS #1 v2.00 OAEP decode @param msg The encoded data to decode @param msglen The length of the encoded data (octets) @param lparam The session or system data (can be NULL) @@ -47,9 +47,9 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, /* default to invalid packet */ *res = 0; - + /* test valid hash */ - if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; } hLen = hash_descriptor[hash_idx].hashsize; @@ -78,11 +78,11 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, } /* ok so it's now in the form - - 0x00 || maskedseed || maskedDB - + + 0x00 || maskedseed || maskedDB + 1 || hLen || modulus_len - hLen - 1 - + */ /* must have leading 0x00 byte */ @@ -100,7 +100,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, XMEMCPY(DB, msg + x, modulus_len - hLen - 1); x += modulus_len - hLen - 1; - /* compute MGF1 of maskedDB (hLen) */ + /* compute MGF1 of maskedDB (hLen) */ if ((err = pkcs_1_mgf1(hash_idx, DB, modulus_len - hLen - 1, mask, hLen)) != CRYPT_OK) { goto LBL_ERR; } @@ -117,7 +117,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, /* xor against DB */ for (y = 0; y < (modulus_len - hLen - 1); y++) { - DB[y] ^= mask[y]; + DB[y] ^= mask[y]; } /* now DB == lhash || PS || 0x01 || M, PS == k - mlen - 2hlen - 2 zeroes */ diff --git a/src/pk/pkcs1/pkcs_1_oaep_encode.c b/src/pk/pkcs1/pkcs_1_oaep_encode.c index 4403477b9..fb215a175 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_encode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_encode.c @@ -12,13 +12,13 @@ /** @file pkcs_1_oaep_encode.c - OAEP Padding for LTC_PKCS #1, Tom St Denis + OAEP Padding for PKCS #1, Tom St Denis */ #ifdef LTC_PKCS_1 /** - LTC_PKCS #1 v2.00 OAEP encode + PKCS #1 v2.00 OAEP encode @param msg The data to encode @param msglen The length of the data to encode (octets) @param lparam A session or system parameter (can be NULL) @@ -46,7 +46,7 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, LTC_ARGCHK(outlen != NULL); /* test valid hash */ - if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; } @@ -120,10 +120,10 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, /* xor against DB */ for (y = 0; y < (modulus_len - hLen - 1); y++) { - DB[y] ^= mask[y]; + DB[y] ^= mask[y]; } - /* compute MGF1 of maskedDB (hLen) */ + /* compute MGF1 of maskedDB (hLen) */ if ((err = pkcs_1_mgf1(hash_idx, DB, modulus_len - hLen - 1, mask, hLen)) != CRYPT_OK) { goto LBL_ERR; } @@ -149,7 +149,7 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, x += modulus_len - hLen - 1; *outlen = x; - + err = CRYPT_OK; LBL_ERR: #ifdef LTC_CLEAN_STACK diff --git a/src/pk/pkcs1/pkcs_1_pss_decode.c b/src/pk/pkcs1/pkcs_1_pss_decode.c index 222048c44..64de79292 100644 --- a/src/pk/pkcs1/pkcs_1_pss_decode.c +++ b/src/pk/pkcs1/pkcs_1_pss_decode.c @@ -10,15 +10,15 @@ */ #include "tomcrypt.h" -/** +/** @file pkcs_1_pss_decode.c - LTC_PKCS #1 PSS Signature Padding, Tom St Denis + PKCS #1 PSS Signature Padding, Tom St Denis */ #ifdef LTC_PKCS_1 /** - LTC_PKCS #1 v2.00 PSS decode + PKCS #1 v2.00 PSS decode @param msghash The hash to verify @param msghashlen The length of the hash (octets) @param sig The signature data (encoded data) @@ -54,7 +54,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, modulus_len = (modulus_bitlen>>3) + (modulus_bitlen & 7 ? 1 : 0); /* check sizes */ - if ((saltlen > modulus_len) || + if ((saltlen > modulus_len) || (modulus_len < hLen + saltlen + 2) || (siglen != modulus_len)) { return CRYPT_PK_INVALID_SIZE; } @@ -110,7 +110,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, for (y = 0; y < (modulus_len - hLen - 1); y++) { DB[y] ^= mask[y]; } - + /* now clear the first byte [make sure smaller than modulus] */ DB[0] &= 0xFF >> ((modulus_len<<3) - (modulus_bitlen-1)); @@ -156,10 +156,10 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, err = CRYPT_OK; LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(DB, modulus_len); - zeromem(mask, modulus_len); - zeromem(salt, modulus_len); - zeromem(hash, modulus_len); + zeromem(DB, modulus_len); + zeromem(mask, modulus_len); + zeromem(salt, modulus_len); + zeromem(hash, modulus_len); #endif XFREE(hash); diff --git a/src/pk/pkcs1/pkcs_1_pss_encode.c b/src/pk/pkcs1/pkcs_1_pss_encode.c index b22a99f1f..94e7bb567 100644 --- a/src/pk/pkcs1/pkcs_1_pss_encode.c +++ b/src/pk/pkcs1/pkcs_1_pss_encode.c @@ -10,15 +10,15 @@ */ #include "tomcrypt.h" -/** +/** @file pkcs_1_pss_encode.c - LTC_PKCS #1 PSS Signature Padding, Tom St Denis + PKCS #1 PSS Signature Padding, Tom St Denis */ #ifdef LTC_PKCS_1 /** - LTC_PKCS #1 v2.00 Signature Encoding + PKCS #1 v2.00 Signature Encoding @param msghash The hash to encode @param msghashlen The length of the hash (octets) @param saltlen The length of the salt desired (octets) @@ -31,7 +31,7 @@ @return CRYPT_OK if successful */ int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, - unsigned long saltlen, prng_state *prng, + unsigned long saltlen, prng_state *prng, int prng_idx, int hash_idx, unsigned long modulus_bitlen, unsigned char *out, unsigned long *outlen) @@ -154,10 +154,10 @@ int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, err = CRYPT_OK; LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(DB, modulus_len); - zeromem(mask, modulus_len); - zeromem(salt, modulus_len); - zeromem(hash, modulus_len); + zeromem(DB, modulus_len); + zeromem(mask, modulus_len); + zeromem(salt, modulus_len); + zeromem(hash, modulus_len); #endif XFREE(hash); diff --git a/src/pk/pkcs1/pkcs_1_v1_5_decode.c b/src/pk/pkcs1/pkcs_1_v1_5_decode.c index 2e7bf0c47..a073da98c 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_decode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_decode.c @@ -12,12 +12,12 @@ /** @file pkcs_1_v1_5_decode.c * - * LTC_PKCS #1 v1.5 Padding. (Andreas Lange) + * PKCS #1 v1.5 Padding. (Andreas Lange) */ #ifdef LTC_PKCS_1 -/** @brief LTC_PKCS #1 v1.5 decode. +/** @brief PKCS #1 v1.5 decode. * * @param msg The encoded data to decode * @param msglen The length of the encoded data (octets) @@ -29,11 +29,11 @@ * * @return CRYPT_OK if successful (even if invalid) */ -int pkcs_1_v1_5_decode(const unsigned char *msg, +int pkcs_1_v1_5_decode(const unsigned char *msg, unsigned long msglen, int block_type, unsigned long modulus_bitlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, int *is_valid) { diff --git a/src/pk/pkcs1/pkcs_1_v1_5_encode.c b/src/pk/pkcs1/pkcs_1_v1_5_encode.c index 9917167bf..ec932c3ef 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_encode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_encode.c @@ -12,12 +12,12 @@ /*! \file pkcs_1_v1_5_encode.c * - * LTC_PKCS #1 v1.5 Padding (Andreas Lange) + * PKCS #1 v1.5 Padding (Andreas Lange) */ #ifdef LTC_PKCS_1 -/*! \brief LTC_PKCS #1 v1.5 encode. +/*! \brief PKCS #1 v1.5 encode. * * \param msg The data to encode * \param msglen The length of the data to encode (octets) @@ -30,13 +30,13 @@ * * \return CRYPT_OK if successful */ -int pkcs_1_v1_5_encode(const unsigned char *msg, +int pkcs_1_v1_5_encode(const unsigned char *msg, unsigned long msglen, int block_type, unsigned long modulus_bitlen, - prng_state *prng, + prng_state *prng, int prng_idx, - unsigned char *out, + unsigned char *out, unsigned long *outlen) { unsigned long modulus_len, ps_len, i; diff --git a/src/pk/rsa/rsa_decrypt_key.c b/src/pk/rsa/rsa_decrypt_key.c index 10f1c227b..1f322ca53 100644 --- a/src/pk/rsa/rsa_decrypt_key.c +++ b/src/pk/rsa/rsa_decrypt_key.c @@ -12,13 +12,13 @@ /** @file rsa_decrypt_key.c - RSA LTC_PKCS #1 Decryption, Tom St Denis and Andreas Lange + RSA PKCS #1 Decryption, Tom St Denis and Andreas Lange */ #ifdef LTC_MRSA /** - LTC_PKCS #1 decrypt then v1.5 or OAEP depad + PKCS #1 decrypt then v1.5 or OAEP depad @param in The ciphertext @param inlen The length of the ciphertext (octets) @param out [out] The plaintext @@ -90,7 +90,7 @@ int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen, err = pkcs_1_oaep_decode(tmp, x, lparam, lparamlen, modulus_bitlen, hash_idx, out, outlen, stat); } else { - /* now LTC_PKCS #1 v1.5 depad the packet */ + /* now PKCS #1 v1.5 depad the packet */ err = pkcs_1_v1_5_decode(tmp, x, LTC_PKCS_1_EME, modulus_bitlen, out, outlen, stat); } diff --git a/src/pk/rsa/rsa_encrypt_key.c b/src/pk/rsa/rsa_encrypt_key.c index 027a5f281..4d6c24bdd 100644 --- a/src/pk/rsa/rsa_encrypt_key.c +++ b/src/pk/rsa/rsa_encrypt_key.c @@ -12,13 +12,13 @@ /** @file rsa_encrypt_key.c - RSA LTC_PKCS #1 encryption, Tom St Denis and Andreas Lange + RSA PKCS #1 encryption, Tom St Denis and Andreas Lange */ #ifdef LTC_MRSA /** - (LTC_PKCS #1 v2.0) OAEP pad then encrypt + (PKCS #1 v2.0) OAEP pad then encrypt @param in The plaintext @param inlen The length of the plaintext (octets) @param out [out] The ciphertext @@ -82,7 +82,7 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, return err; } } else { - /* LTC_PKCS #1 v1.5 pad the key */ + /* PKCS #1 v1.5 pad the key */ x = *outlen; if ((err = pkcs_1_v1_5_encode(in, inlen, LTC_PKCS_1_EME, modulus_bitlen, prng, prng_idx, @@ -91,7 +91,7 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, } } - /* rsa exptmod the OAEP or LTC_PKCS #1 v1.5 pad */ + /* rsa exptmod the OAEP or PKCS #1 v1.5 pad */ return ltc_mp.rsa_me(out, x, out, outlen, PK_PUBLIC, key); } diff --git a/src/pk/rsa/rsa_export.c b/src/pk/rsa/rsa_export.c index f7a1ce387..6d1cdf27f 100644 --- a/src/pk/rsa/rsa_export.c +++ b/src/pk/rsa/rsa_export.c @@ -12,19 +12,19 @@ /** @file rsa_export.c - Export RSA LTC_PKCS keys, Tom St Denis -*/ + Export RSA PKCS keys, Tom St Denis +*/ #ifdef LTC_MRSA /** - This will export either an RSAPublicKey or RSAPrivateKey [defined in LTC_PKCS #1 v2.1] + This will export either an RSAPublicKey or RSAPrivateKey [defined in PKCS #1 v2.1] @param out [out] Destination of the packet @param outlen [in/out] The max size and resulting size of the packet @param type The type of exported key (PK_PRIVATE or PK_PUBLIC) @param key The RSA key to export @return CRYPT_OK if successful -*/ +*/ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key) { unsigned long zero=0; @@ -40,19 +40,19 @@ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key if (type == PK_PRIVATE) { /* private key */ - /* output is + /* output is Version, n, e, d, p, q, d mod (p-1), d mod (q - 1), 1/q mod p */ - return der_encode_sequence_multi(out, outlen, - LTC_ASN1_SHORT_INTEGER, 1UL, &zero, - LTC_ASN1_INTEGER, 1UL, key->N, + return der_encode_sequence_multi(out, outlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &zero, + LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_INTEGER, 1UL, key->e, - LTC_ASN1_INTEGER, 1UL, key->d, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->d, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, LTC_ASN1_INTEGER, 1UL, key->dP, - LTC_ASN1_INTEGER, 1UL, key->dQ, - LTC_ASN1_INTEGER, 1UL, key->qP, + LTC_ASN1_INTEGER, 1UL, key->dQ, + LTC_ASN1_INTEGER, 1UL, key->qP, LTC_ASN1_EOL, 0UL, NULL); } else { /* public key */ diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 45068b2ee..5b80774b5 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -14,7 +14,7 @@ /** @file rsa_exptmod.c - RSA LTC_PKCS exptmod, Tom St Denis + RSA PKCS exptmod, Tom St Denis */ #ifdef LTC_MRSA diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index 607da6173..efd5afbfb 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -12,13 +12,13 @@ /** @file rsa_import.c - Import a LTC_PKCS RSA key, Tom St Denis -*/ + Import a PKCS RSA key, Tom St Denis +*/ #ifdef LTC_MRSA /** - Import an RSAPublicKey or RSAPrivateKey [two-prime only, only support >= 1024-bit keys, defined in LTC_PKCS #1 v2.1] + Import an RSAPublicKey or RSAPrivateKey [two-prime only, only support >= 1024-bit keys, defined in PKCS #1 v2.1] @param in The packet to import from @param inlen It's length (octets) @param key [out] Destination for newly imported key @@ -36,7 +36,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) LTC_ARGCHK(ltc_mp.name != NULL); /* init key */ - if ((err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, + if ((err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL)) != CRYPT_OK) { return err; } @@ -67,28 +67,28 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) goto LBL_FREE; } - /* not SSL public key, try to match against LTC_PKCS #1 standards */ - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_INTEGER, 1UL, key->N, + /* not SSL public key, try to match against PKCS #1 standards */ + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto LBL_ERR; } if (mp_cmp_d(key->N, 0) == LTC_MP_EQ) { - if ((err = mp_init(&zero)) != CRYPT_OK) { + if ((err = mp_init(&zero)) != CRYPT_OK) { goto LBL_ERR; } /* it's a private key */ - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_INTEGER, 1UL, zero, - LTC_ASN1_INTEGER, 1UL, key->N, + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_INTEGER, 1UL, zero, + LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_INTEGER, 1UL, key->e, - LTC_ASN1_INTEGER, 1UL, key->d, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->d, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, LTC_ASN1_INTEGER, 1UL, key->dP, - LTC_ASN1_INTEGER, 1UL, key->dQ, - LTC_ASN1_INTEGER, 1UL, key->qP, + LTC_ASN1_INTEGER, 1UL, key->dQ, + LTC_ASN1_INTEGER, 1UL, key->qP, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { mp_clear(zero); goto LBL_ERR; @@ -101,9 +101,9 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) goto LBL_ERR; } else { /* it's a public key and we lack e */ - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_INTEGER, 1UL, key->N, - LTC_ASN1_INTEGER, 1UL, key->e, + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->e, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/pk/rsa/rsa_sign_hash.c b/src/pk/rsa/rsa_sign_hash.c index 5e0398163..f66b9f46a 100644 --- a/src/pk/rsa/rsa_sign_hash.c +++ b/src/pk/rsa/rsa_sign_hash.c @@ -12,13 +12,13 @@ /** @file rsa_sign_hash.c - RSA LTC_PKCS #1 v1.5 and v2 PSS sign hash, Tom St Denis and Andreas Lange + RSA PKCS #1 v1.5 and v2 PSS sign hash, Tom St Denis and Andreas Lange */ #ifdef LTC_MRSA /** - LTC_PKCS #1 pad then sign + PKCS #1 pad then sign @param in The hash to sign @param inlen The length of the hash to sign (octets) @param out [out] The signature @@ -79,7 +79,7 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, return err; } } else { - /* LTC_PKCS #1 v1.5 pad the hash */ + /* PKCS #1 v1.5 pad the hash */ unsigned char *tmpin; ltc_asn1_list digestinfo[2], siginfo[2]; diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 98dd442ca..654d00ddc 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -12,13 +12,13 @@ /** @file rsa_verify_hash.c - RSA LTC_PKCS #1 v1.5 or v2 PSS signature verification, Tom St Denis and Andreas Lange + RSA PKCS #1 v1.5 or v2 PSS signature verification, Tom St Denis and Andreas Lange */ #ifdef LTC_MRSA /** - LTC_PKCS #1 de-sign then v1.5 or PSS depad + PKCS #1 de-sign then v1.5 or PSS depad @param sig The signature data @param siglen The length of the signature data (octets) @param hash The hash of the message that was signed @@ -94,7 +94,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, /* PSS decode and verify it */ err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat); } else { - /* LTC_PKCS #1 v1.5 decode it */ + /* PKCS #1 v1.5 decode it */ unsigned char *out; unsigned long outlen, loid[16]; int decoded; @@ -115,7 +115,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, } if ((err = pkcs_1_v1_5_decode(tmpbuf, x, LTC_PKCS_1_EMSA, modulus_bitlen, out, &outlen, &decoded)) != CRYPT_OK) { - XFREE(out); + XFREE(out); goto bail_2; } diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 9193787c1..b36d1a99b 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -10,14 +10,14 @@ */ #include "tomcrypt.h" -/** +/** @file rng_get_bytes.c portable way to get secure random bits to feed a PRNG (Tom St Denis) */ #ifdef LTC_DEVRANDOM /* on *NIX read /dev/random */ -static unsigned long rng_nix(unsigned char *buf, unsigned long len, +static unsigned long rng_nix(unsigned char *buf, unsigned long len, void (*callback)(void)) { #ifdef LTC_NO_FILE @@ -34,13 +34,13 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len, if (f == NULL) { return 0; } - + /* disable buffering */ if (setvbuf(f, NULL, _IONBF, 0) != 0) { fclose(f); return 0; - } - + } + x = (unsigned long)fread(buf, 1, (size_t)len, f); fclose(f); return x; @@ -54,7 +54,7 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len, #define ANSI_RNG -static unsigned long rng_ansic(unsigned char *buf, unsigned long len, +static unsigned long rng_ansic(unsigned char *buf, unsigned long len, void (*callback)(void)) { clock_t t1; @@ -76,7 +76,7 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, } while (a == b); acc = (acc << 1) | a; } - *buf++ = acc; + *buf++ = acc; acc = 0; bits = 8; } @@ -84,7 +84,7 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, return l; } -#endif +#endif /* Try the Microsoft CSP */ #if defined(WIN32) || defined(_WIN32) || defined(WINCE) @@ -100,13 +100,13 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, #include #include -static unsigned long rng_win32(unsigned char *buf, unsigned long len, +static unsigned long rng_win32(unsigned char *buf, unsigned long len, void (*callback)(void)) { HCRYPTPROV hProv = 0; - if (!CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, - (CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET)) && - !CryptAcquireContext (&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, + if (!CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, + (CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET)) && + !CryptAcquireContext (&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET | CRYPT_NEWKEYSET)) return 0; @@ -127,8 +127,8 @@ static unsigned long rng_win32(unsigned char *buf, unsigned long len, @param outlen Length desired (octets) @param callback Pointer to void function to act as "callback" when RNG is slow. This can be NULL @return Number of octets read -*/ -unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, +*/ +unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, void (*callback)(void)) { unsigned long x; diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index 9bc7727c9..1d5b267a7 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -20,7 +20,7 @@ #include "sober128tab.c" -const struct ltc_prng_descriptor sober128_desc = +const struct ltc_prng_descriptor sober128_desc = { "sober128", 64, &sober128_start, @@ -105,7 +105,7 @@ static ulong32 nltap(struct sober128_prng *c) Start the PRNG @param prng [out] The PRNG state to initialize @return CRYPT_OK if successful -*/ +*/ int sober128_start(prng_state *prng) { int i; @@ -114,7 +114,7 @@ int sober128_start(prng_state *prng) LTC_ARGCHK(prng != NULL); c = &(prng->sober128); - + /* Register initialised to Fibonacci numbers */ c->R[0] = 1; c->R[1] = 1; @@ -173,7 +173,7 @@ static void s128_genkonst(struct sober128_prng *c) c->R[FOLDP] ^= (nl); /* nonlinear diffusion of register for key */ -#define DROUND(z) STEP(c->R,z); NLFUNC(c,(z+1)); c->R[OFF((z+1),FOLDP)] ^= t; +#define DROUND(z) STEP(c->R,z); NLFUNC(c,(z+1)); c->R[OFF((z+1),FOLDP)] ^= t; static void s128_diffuse(struct sober128_prng *c) { ulong32 t; @@ -203,7 +203,7 @@ static void s128_diffuse(struct sober128_prng *c) @param inlen Length of the data to add @param prng PRNG state to update @return CRYPT_OK if successful -*/ +*/ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { struct sober128_prng *c; @@ -219,7 +219,7 @@ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_stat if ((inlen & 3) != 0) { return CRYPT_INVALID_KEYSIZE; } - + for (i = 0; i < inlen; i += 4) { k = BYTE2WORD((unsigned char *)&in[i]); ADDKEY(k); @@ -236,7 +236,7 @@ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_stat s128_genkonst(c); s128_savestate(c); c->nbuf = 0; - c->flag = 0; + c->flag = 0; c->set = 1; } else { /* ok we are adding an IV then... */ @@ -246,7 +246,7 @@ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_stat if ((inlen & 3) != 0) { return CRYPT_INVALID_KEYSIZE; } - + for (i = 0; i < inlen; i += 4) { k = BYTE2WORD((unsigned char *)&in[i]); ADDKEY(k); @@ -269,7 +269,7 @@ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_stat Make the PRNG ready to read from @param prng The PRNG to make active @return CRYPT_OK if successful -*/ +*/ int sober128_ready(prng_state *prng) { return prng->sober128.set == 1 ? CRYPT_OK : CRYPT_ERROR; @@ -285,7 +285,7 @@ int sober128_ready(prng_state *prng) @param outlen Length of output @param prng The active PRNG to read from @return Number of octets read -*/ +*/ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state *prng) { struct sober128_prng *c; @@ -301,7 +301,7 @@ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state c = &(prng->sober128); t = 0; tlen = outlen; - + /* handle any previously buffered bytes */ while (c->nbuf != 0 && outlen != 0) { *out++ ^= c->sbuf & 0xFF; @@ -364,7 +364,7 @@ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state Terminate the PRNG @param prng The PRNG to terminate @return CRYPT_OK if successful -*/ +*/ int sober128_done(prng_state *prng) { LTC_ARGCHK(prng != NULL); @@ -377,7 +377,7 @@ int sober128_done(prng_state *prng) @param outlen [in/out] Max size and resulting size of the state @param prng The PRNG to export @return CRYPT_OK if successful -*/ +*/ int sober128_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { LTC_ARGCHK(outlen != NULL); @@ -396,14 +396,14 @@ int sober128_export(unsigned char *out, unsigned long *outlen, prng_state *prng) return CRYPT_OK; } - + /** Import a PRNG state @param in The PRNG state @param inlen Size of the state @param prng The PRNG to import @return CRYPT_OK if successful -*/ +*/ int sober128_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { int err; @@ -413,7 +413,7 @@ int sober128_import(const unsigned char *in, unsigned long inlen, prng_state *pr if (inlen != 64) { return CRYPT_INVALID_ARG; } - + if ((err = sober128_start(prng)) != CRYPT_OK) { return err; } @@ -426,13 +426,13 @@ int sober128_import(const unsigned char *in, unsigned long inlen, prng_state *pr /** PRNG self-test @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled -*/ +*/ int sober128_test(void) { #ifndef LTC_TEST return CRYPT_NOP; #else - static const struct { + static const struct { int keylen, ivlen, len; unsigned char key[16], iv[4], out[20]; } tests[] = { @@ -441,7 +441,7 @@ int sober128_test(void) 16, 4, 20, /* key */ - { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6b, 0x65, 0x79, + { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x31, 0x32, 0x38, 0x62, 0x69, 0x74, 0x73 }, /* IV */ @@ -449,7 +449,7 @@ int sober128_test(void) /* expected output */ { 0x43, 0x50, 0x0c, 0xcf, 0x89, 0x91, 0x9f, 0x1d, - 0xaa, 0x37, 0x74, 0x95, 0xf4, 0xb4, 0x58, 0xc2, + 0xaa, 0x37, 0x74, 0x95, 0xf4, 0xb4, 0x58, 0xc2, 0x40, 0x37, 0x8b, 0xbb } } @@ -481,7 +481,7 @@ int sober128_test(void) sober128_done(&prng); if (XMEMCMP(dst, tests[x].out, tests[x].len)) { #if 0 - printf("\n\nLTC_SOBER128 failed, I got:\n"); + printf("\n\nLTC_SOBER128 failed, I got:\n"); for (y = 0; y < tests[x].len; y++) printf("%02x ", dst[y]); printf("\n"); #endif diff --git a/src/prngs/sober128tab.c b/src/prngs/sober128tab.c index a5754c727..674a35530 100644 --- a/src/prngs/sober128tab.c +++ b/src/prngs/sober128tab.c @@ -1,7 +1,7 @@ -/** +/** @file sober128tab.c SOBER-128 Tables -*/ +*/ /* $ID$ */ /* @(#)TuringMultab.h 1.3 (QUALCOMM) 02/09/03 */ /* Multiplication table for Turing using 0xD02B4367 */ @@ -82,7 +82,7 @@ static const ulong32 Multab[256] = { * "On the Design of 8*32 S-boxes". Unpublished report, by the * Information Systems Research Centre, * Queensland University of Technology, 1999. - * + * * The most significant 8 bits are the Skipjack "F table", which can be * found at http://csrc.nist.gov/CryptoToolkit/skipjack/skipjack.pdf . * In this optimised table, though, the intent is to XOR the word from diff --git a/testprof/dh_test.c b/testprof/dh_test.c index 3428ef064..8801c4f6e 100644 --- a/testprof/dh_test.c +++ b/testprof/dh_test.c @@ -1,6 +1,6 @@ #include -#ifdef MDH +#ifdef MDH #ifdef DH4096 #define KEYSIZE 4096 @@ -14,7 +14,6 @@ int dh_test (void) unsigned long x, y, z; int stat, stat2; dh_key usera, userb; - prng_state yarrow_prng; if (register_prng(&yarrow_desc) == -1) { printf("Error registering yarrow PRNG\n"); @@ -24,7 +23,7 @@ int dh_test (void) printf("Error registering md5 hash\n"); exit(-1); } - + DO(dh_compat_test()); @@ -105,7 +104,7 @@ int dh_test (void) buf[0][0] ^= 1; DO(dh_verify_hash (buf[1], x, buf[0], 16, &stat2, &usera)); dh_free (&usera); - if (!(stat == 1 && stat2 == 0)) { + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "dh_sign/verify_hash %d %d", stat, stat2); return 1; } diff --git a/testprof/pkcs_1_test.c b/testprof/pkcs_1_test.c index 6f59ce9ab..d0a368f7e 100644 --- a/testprof/pkcs_1_test.c +++ b/testprof/pkcs_1_test.c @@ -12,11 +12,11 @@ int pkcs_1_test(void) /* get hash/prng */ hash_idx = find_hash("sha1"); prng_idx = find_prng("yarrow"); - + if (hash_idx == -1 || prng_idx == -1) { fprintf(stderr, "pkcs_1 tests require sha1/yarrow"); return 1; - } + } srand(time(NULL)); /* do many tests */ @@ -33,7 +33,7 @@ int pkcs_1_test(void) /* pick a random saltlen 0..16 */ saltlen = abs(rand()) % 17; - /* LTC_PKCS #1 v2.0 supports modlens not multiple of 8 */ + /* PKCS #1 v2.0 supports modlens not multiple of 8 */ modlen = 800 + (abs(rand()) % 224); /* encode it */ @@ -62,7 +62,7 @@ int pkcs_1_test(void) l1 = sizeof(buf[1]); DO(pkcs_1_pss_encode(buf[0], l3, saltlen, &yarrow_prng, prng_idx, hash_idx, modlen, buf[1], &l1)); DO(pkcs_1_pss_decode(buf[0], l3, buf[1], l1, saltlen, hash_idx, modlen, &res1)); - + buf[0][i1 = abs(rand()) % l3] ^= 1; DO(pkcs_1_pss_decode(buf[0], l3, buf[1], l1, saltlen, hash_idx, modlen, &res2)); diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 2ffcd3316..c842b25ce 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -1,49 +1,49 @@ #include -#ifdef LTC_MRSA +#ifdef LTC_MRSA #define RSA_MSGSIZE 78 /* These are test keys [see file test.key] that I use to test my import/export against */ static const unsigned char openssl_private_rsa[] = { - 0x30, 0x82, 0x02, 0x5e, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xcf, 0x9a, 0xde, 0x64, 0x8a, - 0xda, 0xc8, 0x33, 0x20, 0xa9, 0xd7, 0x83, 0x31, 0x19, 0x54, 0xb2, 0x9a, 0x85, 0xa7, 0xa1, 0xb7, - 0x75, 0x33, 0xb6, 0xa9, 0xac, 0x84, 0x24, 0xb3, 0xde, 0xdb, 0x7d, 0x85, 0x2d, 0x96, 0x65, 0xe5, - 0x3f, 0x72, 0x95, 0x24, 0x9f, 0x28, 0x68, 0xca, 0x4f, 0xdb, 0x44, 0x1c, 0x3e, 0x60, 0x12, 0x8a, - 0xdd, 0x26, 0xa5, 0xeb, 0xff, 0x0b, 0x5e, 0xd4, 0x88, 0x38, 0x49, 0x2a, 0x6e, 0x5b, 0xbf, 0x12, - 0x37, 0x47, 0xbd, 0x05, 0x6b, 0xbc, 0xdb, 0xf3, 0xee, 0xe4, 0x11, 0x8e, 0x41, 0x68, 0x7c, 0x61, - 0x13, 0xd7, 0x42, 0xc8, 0x80, 0xbe, 0x36, 0x8f, 0xdc, 0x08, 0x8b, 0x4f, 0xac, 0xa4, 0xe2, 0x76, - 0x0c, 0xc9, 0x63, 0x6c, 0x49, 0x58, 0x93, 0xed, 0xcc, 0xaa, 0xdc, 0x25, 0x3b, 0x0a, 0x60, 0x3f, - 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x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, 0x42, - 0xeb, 0xb8, 0xf1, 0xf3, 0x0a, 0x05, 0xe3, 0x94, 0xd1, 0x55, 0x78, 0x35, 0xa0, 0x36, 0xa0, 0x9b, - 0x7c, 0x92, 0x84, 0x6c, 0xdd, 0xdc, 0x4d, 0x02, 0x41, 0x00, 0xd6, 0x86, 0x0e, 0x85, 0x42, 0x0b, - 0x04, 0x08, 0x84, 0x21, 0x60, 0xf0, 0x0e, 0x0d, 0x88, 0xfd, 0x1e, 0x36, 0x10, 0x65, 0x4f, 0x1e, - 0x53, 0xb4, 0x08, 0x72, 0x80, 0x5c, 0x3f, 0x59, 0x66, 0x17, 0xe6, 0x98, 0xf2, 0xe9, 0x6c, 0x7a, - 0x06, 0x4c, 0xac, 0x76, 0x3d, 0xed, 0x8c, 0xa1, 0xce, 0xad, 0x1b, 0xbd, 0xb4, 0x7d, 0x28, 0xbc, - 0xe3, 0x0e, 0x38, 0x8d, 0x99, 0xd8, 0x05, 0xb5, 0xa3, 0x71, 0x02, 0x40, 0x6d, 0xeb, 0xc3, 0x2d, - 0x2e, 0xf0, 0x5e, 0xa4, 0x88, 0x31, 0x05, 0x29, 0x00, 0x8a, 0xd1, 0x95, 0x29, 0x9b, 0x83, 0xcf, - 0x75, 0xdb, 0x31, 0xe3, 0x7a, 0x27, 0xde, 0x3a, 0x74, 0x30, 0x0c, 0x76, 0x4c, 0xd4, 0x50, 0x2a, - 0x40, 0x2d, 0x39, 0xd9, 0x99, 0x63, 0xa9, 0x5d, 0x80, 0xae, 0x53, 0xca, 0x94, 0x3f, 0x05, 0x23, - 0x1e, 0xf8, 0x05, 0x04, 0xe1, 0xb8, 0x35, 0xf2, 0x17, 0xb3, 0xa0, 0x89, 0x02, 0x41, 0x00, 0xab, - 0x90, 0x88, 0xfa, 0x60, 0x08, 0x29, 0x50, 0x9a, 0x43, 0x8b, 0xa0, 0x50, 0xcc, 0xd8, 0x5a, 0xfe, - 0x97, 0x64, 0x63, 0x71, 0x74, 0x22, 0xa3, 0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 0xd4, 0x50, 0x2a, + 0x40, 0x2d, 0x39, 0xd9, 0x99, 0x63, 0xa9, 0x5d, 0x80, 0xae, 0x53, 0xca, 0x94, 0x3f, 0x05, 0x23, + 0x1e, 0xf8, 0x05, 0x04, 0xe1, 0xb8, 0x35, 0xf2, 0x17, 0xb3, 0xa0, 0x89, 0x02, 0x41, 0x00, 0xab, + 0x90, 0x88, 0xfa, 0x60, 0x08, 0x29, 0x50, 0x9a, 0x43, 0x8b, 0xa0, 0x50, 0xcc, 0xd8, 0x5a, 0xfe, + 0x97, 0x64, 0x63, 0x71, 0x74, 0x22, 0xa3, 0x20, 0x02, 0x5a, 0xcf, 0xeb, 0xc6, 0x16, 0x95, 0x54, + 0xd1, 0xcb, 0xab, 0x8d, 0x1a, 0xc6, 0x00, 0xfa, 0x08, 0x92, 0x9c, 0x71, 0xd5, 0x52, 0x52, 0x35, + 0x96, 0x71, 0x4b, 0x8b, 0x92, 0x0c, 0xd0, 0xe9, 0xbf, 0xad, 0x63, 0x0b, 0xa5, 0xe9, 0xb1, 0x02, + 0x41, 0x00, 0xdc, 0xcc, 0x27, 0xc8, 0xe4, 0xdc, 0x62, 0x48, 0xd5, 0x9b, 0xaf, 0xf5, 0xab, 0x60, + 0xf6, 0x21, 0xfd, 0x53, 0xe2, 0xb7, 0x5d, 0x09, 0xc9, 0x1a, 0xa1, 0x04, 0xa9, 0xfc, 0x61, 0x2c, + 0x5d, 0x04, 0x58, 0x3a, 0x5a, 0x39, 0xf1, 0x4a, 0x21, 0x56, 0x67, 0xfd, 0xcc, 0x20, 0xa3, 0x8f, + 0x78, 0x18, 0x5a, 0x79, 0x3d, 0x2e, 0x8e, 0x7e, 0x86, 0x0a, 0xe6, 0xa8, 0x33, 0xc1, 0x04, 0x17, 0x4a, 0x9f, }; @@ -98,7 +98,7 @@ static int rsa_compat_test(void) rsa_free(&key); return 0; -} +} int rsa_test(void) { @@ -111,14 +111,14 @@ int rsa_test(void) if (rsa_compat_test() != 0) { return 1; } - + hash_idx = find_hash("sha1"); prng_idx = find_prng("yarrow"); if (hash_idx == -1 || prng_idx == -1) { fprintf(stderr, "rsa_test requires LTC_SHA1 and yarrow"); return 1; } - + /* make 10 random key */ for (cnt = 0; cnt < 10; cnt++) { DO(rsa_make_key(&yarrow_prng, prng_idx, 1024/8, 65537, &key)); @@ -157,7 +157,7 @@ for (cnt = 0; cnt < len; ) { rsa_free(&key); } } - + /* encrypt the key (without lparam) */ for (cnt = 0; cnt < 4; cnt++) { for (rsa_msgsize = 1; rsa_msgsize <= 86; rsa_msgsize++) { @@ -166,7 +166,7 @@ for (cnt = 0; cnt < len; ) { len = sizeof(out); len2 = rsa_msgsize; - + DO(rsa_encrypt_key(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, hash_idx, &key)); /* change a byte */ out[8] ^= 1; @@ -187,7 +187,7 @@ for (cnt = 0; cnt < len; ) { if (len2 != rsa_msgsize || memcmp(tmp, in, rsa_msgsize)) { unsigned long x; fprintf(stderr, "\nrsa_decrypt_key mismatch, len %lu (second decrypt)\n", len2); - fprintf(stderr, "Original contents: \n"); + fprintf(stderr, "Original contents: \n"); for (x = 0; x < rsa_msgsize; ) { fprintf(stderr, "%02x ", in[x]); if (!(++x % 16)) { @@ -195,13 +195,13 @@ for (cnt = 0; cnt < len; ) { } } fprintf(stderr, "\n"); - fprintf(stderr, "Output contents: \n"); + fprintf(stderr, "Output contents: \n"); for (x = 0; x < rsa_msgsize; ) { fprintf(stderr, "%02x ", out[x]); if (!(++x % 16)) { fprintf(stderr, "\n"); } - } + } fprintf(stderr, "\n"); return 1; } @@ -235,7 +235,7 @@ for (cnt = 0; cnt < len; ) { } } - /* encrypt the key LTC_PKCS #1 v1.5 (payload from 1 to 117 bytes) */ + /* encrypt the key PKCS #1 v1.5 (payload from 1 to 117 bytes) */ for (rsa_msgsize = 1; rsa_msgsize <= 117; rsa_msgsize++) { len = sizeof(out); len2 = rsa_msgsize; @@ -259,8 +259,8 @@ for (cnt = 0; cnt < len; ) { /* export key and import as both private and public */ len2 = sizeof(tmp); - DO(rsa_export(tmp, &len2, PK_PRIVATE, &key)); - DO(rsa_import(tmp, len2, &privKey)); + DO(rsa_export(tmp, &len2, PK_PRIVATE, &key)); + DO(rsa_import(tmp, len2, &privKey)); len2 = sizeof(tmp); DO(rsa_export(tmp, &len2, PK_PUBLIC, &key)); DO(rsa_import(tmp, len2, &pubKey)); @@ -270,7 +270,7 @@ for (cnt = 0; cnt < len; ) { /* change a byte */ in[0] ^= 1; DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &key)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_verify_hash (unsalted, origKey) failed, %d, %d", stat, stat2); rsa_free(&key); @@ -286,7 +286,7 @@ for (cnt = 0; cnt < len; ) { /* change a byte */ in[0] ^= 1; DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &privKey)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_verify_hash (unsalted, privKey) failed, %d, %d", stat, stat2); rsa_free(&key); @@ -302,7 +302,7 @@ for (cnt = 0; cnt < len; ) { /* change a byte */ in[0] ^= 1; DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &pubKey)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_verify_hash (unsalted, pubkey) failed, %d, %d", stat, stat2); rsa_free(&key); @@ -318,7 +318,7 @@ for (cnt = 0; cnt < len; ) { /* change a byte */ in[0] ^= 1; DO(rsa_verify_hash(out, len, in, 20, hash_idx, 8, &stat2, &pubKey)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_verify_hash (salted) failed, %d, %d", stat, stat2); rsa_free(&key); @@ -326,15 +326,15 @@ for (cnt = 0; cnt < len; ) { rsa_free(&privKey); return 1; } - - /* sign a message with LTC_PKCS #1 v1.5 */ + + /* sign a message with PKCS #1 v1.5 */ len = sizeof(out); DO(rsa_sign_hash_ex(in, 20, out, &len, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat, &pubKey)); /* change a byte */ in[0] ^= 1; DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat2, &pubKey)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_verify_hash_ex failed, %d, %d", stat, stat2); rsa_free(&key); diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 84e173c61..131e49edc 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -58,6 +58,7 @@ int katja_test(void); int ecc_tests(void); int dsa_test(void); int der_tests(void); +int misc_test(void); /* timing */ #define KTIMES 25 From 3da9adc366b3263b25d3bad6b84d43dfa8c9a3ce Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 3 Jan 2014 15:50:21 +0100 Subject: [PATCH 0117/1192] aes: remove compiler warning when compiled with ENCRYPT_ONLY --- src/ciphers/aes/aes.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index af538c5ec..4ff1d24f5 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -120,7 +120,7 @@ static ulong32 setup_mix2(ulong32 temp) */ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) { - int i, j; + int i; ulong32 temp, *rk; #ifndef ENCRYPT_ONLY ulong32 *rrk; @@ -146,7 +146,6 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s LOAD32H(rk[2], key + 8); LOAD32H(rk[3], key + 12); if (keylen == 16) { - j = 44; for (;;) { temp = rk[3]; rk[4] = rk[0] ^ setup_mix(temp) ^ rcon[i]; @@ -159,7 +158,6 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s rk += 4; } } else if (keylen == 24) { - j = 52; LOAD32H(rk[4], key + 16); LOAD32H(rk[5], key + 20); for (;;) { @@ -180,7 +178,6 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s rk += 6; } } else if (keylen == 32) { - j = 60; LOAD32H(rk[4], key + 16); LOAD32H(rk[5], key + 20); LOAD32H(rk[6], key + 24); @@ -213,7 +210,7 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s #ifndef ENCRYPT_ONLY /* setup the inverse key now */ rk = skey->rijndael.dK; - rrk = skey->rijndael.eK + j - 4; + rrk = skey->rijndael.eK + (28 + keylen) - 4; /* apply the inverse MixColumn transform to all round keys but the first and the last: */ /* copy first */ From f3789b31b60c672d00e6d80de9971dad044bad46 Mon Sep 17 00:00:00 2001 From: karel-m Date: Fri, 14 Jun 2013 21:10:14 +0200 Subject: [PATCH 0118/1192] fixing warnings when compiling camellia.c with 64bit MS compiler --- src/ciphers/camellia.c | 74 +++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 529fd45b8..6a4c813b3 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -192,7 +192,7 @@ static ulong64 F(ulong64 x) D ^= U; U = D ^ ROR(U, (const int)8); - return ((ulong64)U) | (((ulong64)D) << 32ULL); + return ((ulong64)U) | (((ulong64)D) << CONST64(32)); } static void rot_128(unsigned char *in, unsigned count, unsigned char *out) @@ -456,17 +456,17 @@ int camellia_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_k L ^= F(R ^ skey->camellia.k[5]); /* FL */ - a = L >> 32; - b = L & 0xFFFFFFFFUL; - b ^= ROL((a & (skey->camellia.kl[0] >> 32)), 1); + a = (ulong32)(L >> 32); + b = (ulong32)(L & 0xFFFFFFFFUL); + b ^= ROL((a & (ulong32)(skey->camellia.kl[0] >> 32)), 1); a ^= b | (skey->camellia.kl[0] & 0xFFFFFFFFU); L = (((ulong64)a) << 32) | b; /* FL^-1 */ - a = R >> 32; - b = R & 0xFFFFFFFFUL; + a = (ulong32)(R >> 32); + b = (ulong32)(R & 0xFFFFFFFFUL); a ^= b | (skey->camellia.kl[1] & 0xFFFFFFFFU); - b ^= ROL((a & (skey->camellia.kl[1] >> 32)), 1); + b ^= ROL((a & (ulong32)(skey->camellia.kl[1] >> 32)), 1); R = (((ulong64)a) << 32) | b; /* second 6 rounds */ @@ -478,17 +478,17 @@ int camellia_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_k L ^= F(R ^ skey->camellia.k[11]); /* FL */ - a = L >> 32; - b = L & 0xFFFFFFFFUL; - b ^= ROL((a & (skey->camellia.kl[2] >> 32)), 1); + a = (ulong32)(L >> 32); + b = (ulong32)(L & 0xFFFFFFFFUL); + b ^= ROL((a & (ulong32)(skey->camellia.kl[2] >> 32)), 1); a ^= b | (skey->camellia.kl[2] & 0xFFFFFFFFU); L = (((ulong64)a) << 32) | b; /* FL^-1 */ - a = R >> 32; - b = R & 0xFFFFFFFFUL; + a = (ulong32)(R >> 32); + b = (ulong32)(R & 0xFFFFFFFFUL); a ^= b | (skey->camellia.kl[3] & 0xFFFFFFFFU); - b ^= ROL((a & (skey->camellia.kl[3] >> 32)), 1); + b ^= ROL((a & (ulong32)(skey->camellia.kl[3] >> 32)), 1); R = (((ulong64)a) << 32) | b; /* third 6 rounds */ @@ -502,17 +502,17 @@ int camellia_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_k /* next FL */ if (skey->camellia.R == 24) { /* FL */ - a = L >> 32; - b = L & 0xFFFFFFFFUL; - b ^= ROL((a & (skey->camellia.kl[4] >> 32)), 1); + a = (ulong32)(L >> 32); + b = (ulong32)(L & 0xFFFFFFFFUL); + b ^= ROL((a & (ulong32)(skey->camellia.kl[4] >> 32)), 1); a ^= b | (skey->camellia.kl[4] & 0xFFFFFFFFU); L = (((ulong64)a) << 32) | b; /* FL^-1 */ - a = R >> 32; - b = R & 0xFFFFFFFFUL; + a = (ulong32)(R >> 32); + b = (ulong32)(R & 0xFFFFFFFFUL); a ^= b | (skey->camellia.kl[5] & 0xFFFFFFFFU); - b ^= ROL((a & (skey->camellia.kl[5] >> 32)), 1); + b ^= ROL((a & (ulong32)(skey->camellia.kl[5] >> 32)), 1); R = (((ulong64)a) << 32) | b; /* fourth 6 rounds */ @@ -552,16 +552,16 @@ int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_k R ^= F(L ^ skey->camellia.k[18]); /* FL */ - a = L >> 32; - b = L & 0xFFFFFFFFUL; + a = (ulong32)(L >> 32); + b = (ulong32)(L & 0xFFFFFFFFUL); a ^= b | (skey->camellia.kl[4] & 0xFFFFFFFFU); - b ^= ROL((a & (skey->camellia.kl[4] >> 32)), 1); + b ^= ROL((a & (ulong32)(skey->camellia.kl[4] >> 32)), 1); L = (((ulong64)a) << 32) | b; /* FL^-1 */ - a = R >> 32; - b = R & 0xFFFFFFFFUL; - b ^= ROL((a & (skey->camellia.kl[5] >> 32)), 1); + a = (ulong32)(R >> 32); + b = (ulong32)(R & 0xFFFFFFFFUL); + b ^= ROL((a & (ulong32)(skey->camellia.kl[5] >> 32)), 1); a ^= b | (skey->camellia.kl[5] & 0xFFFFFFFFU); R = (((ulong64)a) << 32) | b; @@ -576,16 +576,16 @@ int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_k R ^= F(L ^ skey->camellia.k[12]); /* FL */ - a = L >> 32; - b = L & 0xFFFFFFFFUL; + a = (ulong32)(L >> 32); + b = (ulong32)(L & 0xFFFFFFFFUL); a ^= b | (skey->camellia.kl[2] & 0xFFFFFFFFU); - b ^= ROL((a & (skey->camellia.kl[2] >> 32)), 1); + b ^= ROL((a & (ulong32)(skey->camellia.kl[2] >> 32)), 1); L = (((ulong64)a) << 32) | b; /* FL^-1 */ - a = R >> 32; - b = R & 0xFFFFFFFFUL; - b ^= ROL((a & (skey->camellia.kl[3] >> 32)), 1); + a = (ulong32)(R >> 32); + b = (ulong32)(R & 0xFFFFFFFFUL); + b ^= ROL((a & (ulong32)(skey->camellia.kl[3] >> 32)), 1); a ^= b | (skey->camellia.kl[3] & 0xFFFFFFFFU); R = (((ulong64)a) << 32) | b; @@ -598,16 +598,16 @@ int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_k R ^= F(L ^ skey->camellia.k[6]); /* FL */ - a = L >> 32; - b = L & 0xFFFFFFFFUL; + a = (ulong32)(L >> 32); + b = (ulong32)(L & 0xFFFFFFFFUL); a ^= b | (skey->camellia.kl[0] & 0xFFFFFFFFU); - b ^= ROL((a & (skey->camellia.kl[0] >> 32)), 1); + b ^= ROL((a & (ulong32)(skey->camellia.kl[0] >> 32)), 1); L = (((ulong64)a) << 32) | b; /* FL^-1 */ - a = R >> 32; - b = R & 0xFFFFFFFFUL; - b ^= ROL((a & (skey->camellia.kl[1] >> 32)), 1); + a = (ulong32)(R >> 32); + b = (ulong32)(R & 0xFFFFFFFFUL); + b ^= ROL((a & (ulong32)(skey->camellia.kl[1] >> 32)), 1); a ^= b | (skey->camellia.kl[1] & 0xFFFFFFFFU); R = (((ulong64)a) << 32) | b; From d2c1329f77b5b6dc7856f6c3789b3dde5ec7abb1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 3 Jan 2014 20:20:42 +0100 Subject: [PATCH 0119/1192] camellia: add new testvector --- src/ciphers/camellia.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 6a4c813b3..a00fa6aa0 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -666,13 +666,27 @@ int camellia_test(void) 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, { 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c, 0x20, 0xef, 0x7c, 0x91, 0x9e, 0x3a, 0x75, 0x09 } +}, + +{ + 32, + { 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, + 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, + 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, + 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 }, + { 0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B, 0x17, + 0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10 }, + { 0x79, 0x60, 0x10, 0x9F, 0xB6, 0xDC, 0x42, 0x94, + 0x7F, 0xCF, 0xE5, 0x9E, 0xA3, 0xC5, 0xEB, 0x6B } } }; unsigned char buf[2][16]; symmetric_key skey; - int err, x; + int err; + unsigned int x; - for (x = 0; x < 3; x++) { + for (x = 0; x < sizeof(tests)/sizeof(tests[0]); x++) { + zeromem(&skey, sizeof(skey)); if ((err = camellia_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { return err; } From 45dcbc654d5867bb5ee475b9b1be0b2c3959d0de Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 20 Oct 2013 23:01:24 +0200 Subject: [PATCH 0120/1192] fixing broken camellia --- src/ciphers/camellia.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index a00fa6aa0..41deb408b 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -619,10 +619,10 @@ int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_k L ^= F(R ^ skey->camellia.k[1]); R ^= F(L ^ skey->camellia.k[0]); - L ^= skey->camellia.kw[1]; - R ^= skey->camellia.kw[0]; + R ^= skey->camellia.kw[1]; + L ^= skey->camellia.kw[0]; - STORE64H(R, pt+0); STORE64H(L, pt+8); + STORE64H(R, pt+8); STORE64H(L, pt+0); return CRYPT_OK; } From e48838559b0392dcedcf4ceab80cdc65b942741d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 18 Apr 2013 16:45:23 +0200 Subject: [PATCH 0121/1192] der_encode_setof: fix compiler warning when compiling for windows 64bit --- src/pk/asn1/der/set/der_encode_setof.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pk/asn1/der/set/der_encode_setof.c b/src/pk/asn1/der/set/der_encode_setof.c index 938a30900..022aca3ef 100644 --- a/src/pk/asn1/der/set/der_encode_setof.c +++ b/src/pk/asn1/der/set/der_encode_setof.c @@ -61,7 +61,8 @@ static int qsort_helper(const void *a, const void *b) int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, unsigned char *out, unsigned long *outlen) { - unsigned long x, y, z, hdrlen; + unsigned long x, y, z; + ptrdiff_t hdrlen; int err; struct edge *edges; unsigned char *ptr, *buf; @@ -102,7 +103,7 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, } /* get the size of the static header */ - hdrlen = ((unsigned long)ptr) - ((unsigned long)buf); + hdrlen = ptr - buf; /* scan for edges */ From 2adca46735f5b493e215680c0b35a5dd48362db5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 3 Jan 2014 22:04:50 +0100 Subject: [PATCH 0122/1192] pkcs#5: add tests for 'algo 2' --- src/headers/tomcrypt_pkcs.h | 1 + src/misc/pkcs5/pkcs_5_test.c | 185 +++++++++++++++++++++++++++++++++++ testprof/misc_test.c | 3 + 3 files changed, 189 insertions(+) create mode 100644 src/misc/pkcs5/pkcs_5_test.c diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index e3b7beabf..31344a12e 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -82,6 +82,7 @@ int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen); +int pkcs_5_test (void); #endif /* LTC_PKCS_5 */ /* $Source$ */ diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c new file mode 100644 index 000000000..21f4b58b0 --- /dev/null +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -0,0 +1,185 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include "tomcrypt.h" + +/** + @file hkdf_test.c + PKCS #5 support, self-test, Steffen Jaeckel +*/ + +#ifdef LTC_PKCS_5 + +/* + TEST CASES SOURCE: + +Internet Engineering Task Force (IETF) S. Josefsson +Request for Comments: 6070 SJD AB +Category: Informational January 2011 +ISSN: 2070-1721 +*/ + +/** + PKCS #5 self-test + @return CRYPT_OK if successful, CRYPT_NOP if tests have been disabled. +*/ +int pkcs_5_test (void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + + static const struct { + char* P; + unsigned long P_len; + char* S; + unsigned long S_len; + int c; + unsigned long dkLen; + unsigned char DK[25]; + } cases_5_2[] = { + { + "password", + 8, + "salt", + 4, + 1, + 20, + { 0x0c, 0x60, 0xc8, 0x0f, 0x96, 0x1f, 0x0e, 0x71, + 0xf3, 0xa9, 0xb5, 0x24, 0xaf, 0x60, 0x12, 0x06, + 0x2f, 0xe0, 0x37, 0xa6 } + }, + { + "password", + 8, + "salt", + 4, + 2, + 20, + { 0xea, 0x6c, 0x01, 0x4d, 0xc7, 0x2d, 0x6f, 0x8c, + 0xcd, 0x1e, 0xd9, 0x2a, 0xce, 0x1d, 0x41, 0xf0, + 0xd8, 0xde, 0x89, 0x57 } + }, + { + "password", + 8, + "salt", + 4, + 4096, + 20, + { 0x4b, 0x00, 0x79, 0x01, 0xb7, 0x65, 0x48, 0x9a, + 0xbe, 0xad, 0x49, 0xd9, 0x26, 0xf7, 0x21, 0xd0, + 0x65, 0xa4, 0x29, 0xc1 } + }, + { + "password", + 8, + "salt", + 4, + 16777216, + 20, + { 0xee, 0xfe, 0x3d, 0x61, 0xcd, 0x4d, 0xa4, 0xe4, + 0xe9, 0x94, 0x5b, 0x3d, 0x6b, 0xa2, 0x15, 0x8c, + 0x26, 0x34, 0xe9, 0x84 } + }, + { + "passwordPASSWORDpassword", + 25, + "saltSALTsaltSALTsaltSALTsaltSALTsalt", + 36, + 4096, + 25, + { 0x3d, 0x2e, 0xec, 0x4f, 0xe4, 0x1c, 0x84, 0x9b, + 0x80, 0xc8, 0xd8, 0x36, 0x62, 0xc0, 0xe4, 0x4a, + 0x8b, 0x29, 0x1a, 0x96, 0x4c, 0xf2, 0xf0, 0x70, + 0x38 } + }, + { + "pass\0word", + 9, + "sa\0lt", + 5, + 4096, + 16, + { 0x56, 0xfa, 0x6a, 0xa7, 0x55, 0x48, 0x09, 0x9d, + 0xcc, 0x37, 0xd7, 0xf0, 0x34, 0x25, 0xe0, 0xc3 } + }, + }; + + unsigned char DK[25]; + unsigned long dkLen; + int i, err; + int tested=0, failed=0; + int hash = find_hash("sha1"); + if (hash == -1) + { +#ifdef LTC_PKCS_5_TEST_DBG + printf("PKCS#5 test: 'sha1' hash not found\n"); +#endif + return CRYPT_ERROR; + } + for(i=0; i < (int)(sizeof(cases_5_2) / sizeof(cases_5_2[0])); i++) { + ++tested; + dkLen = cases_5_2[i].dkLen; + if((err = pkcs_5_alg2((unsigned char*)cases_5_2[i].P, cases_5_2[i].P_len, + (unsigned char*)cases_5_2[i].S, cases_5_2[i].S_len, + cases_5_2[i].c, hash, + DK, &dkLen)) != CRYPT_OK) { +#ifdef LTC_PKCS_5_TEST_DBG + printf("PKCS#5 test #%d: %s\n", i, error_to_string(err)); +#endif + return err; + } + + if (dkLen != cases_5_2[i].dkLen) + { +#ifdef LTC_PKCS_5_TEST_DBG + printf("PKCS#5 test #%d: %lu != %lu\n", i, dkLen, cases_5_2[i].dkLen); +#endif + return CRYPT_FAIL_TESTVECTOR; + } + + if(XMEMCMP(DK, cases_5_2[i].DK, (size_t)cases_5_2[i].dkLen) != 0) { + ++failed; +#ifdef LTC_PKCS_5_TEST_DBG + { + unsigned int j; + printf("\nPKCS#5 test #%d:\n", i); + printf( "Result: 0x"); + for(j=0; j < cases_5_2[i].dkLen; j++) { + printf("%02x ", DK[j]); + } + printf("\nCorrect: 0x"); + for(j=0; j < cases_5_2[i].dkLen; j++) { + printf("%02x ", cases_5_2[i].DK[j]); + } + printf("\n"); + return CRYPT_FAIL_TESTVECTOR; + } +#endif +#ifdef LTC_PKCS_5_TEST_DBG + } else { + printf("PKCS#5 test #%d: Passed\n", i); +#endif + } + } + + if (failed != 0) { + return CRYPT_FAIL_TESTVECTOR; + } else { + return CRYPT_OK; + } + #endif +} + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/testprof/misc_test.c b/testprof/misc_test.c index 40f4b444b..889ab7946 100644 --- a/testprof/misc_test.c +++ b/testprof/misc_test.c @@ -4,6 +4,9 @@ int misc_test(void) { #ifdef LTC_HKDF DO(hkdf_test()); +#endif +#ifdef LTC_PKCS_5 + DO(pkcs_5_test()); #endif return 0; } From ddb26a42763c1fe079670dc3575b3e42d0e086e9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Jan 2014 16:46:28 +0100 Subject: [PATCH 0123/1192] hmac test: remove comments, prepare for extension --- src/mac/hmac/hmac_test.c | 119 +++++---------------------------------- 1 file changed, 14 insertions(+), 105 deletions(-) diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index e63eff29d..fa657db75 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -43,7 +43,7 @@ int hmac_test(void) int i; static const struct hmac_test_case { - int num; + char *num; char *algo; unsigned char key[128]; unsigned long keylen; @@ -53,15 +53,8 @@ int hmac_test(void) } cases[] = { /* 3. Test Cases for HMAC-SHA-1 - - test_case = 1 - key = 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c - key_len = 20 - data = "Hi Ther 20 - digest = 0x4c1a03424b55e07fe7f27be1d58bb9324a9a5a04 - digest-96 = 0x4c1a03424b55e07fe7f27be1 */ - { 5, "sha1", + { "rfc2202 3.5", "sha1", {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, 20, @@ -69,15 +62,7 @@ int hmac_test(void) {0x4c, 0x1a, 0x03, 0x42, 0x4b, 0x55, 0xe0, 0x7f, 0xe7, 0xf2, 0x7b, 0xe1, 0xd5, 0x8b, 0xb9, 0x32, 0x4a, 0x9a, 0x5a, 0x04} }, - /* - test_case = 6 - key = 0xaa repeated 80 times - key_len = 80 - data = "Test Using Larger Than Block-Size Key - Hash Key First" - data_len = 54 - digest = 0xaa4ae5e15272d00e95705637ce8a3b55ed402112 - */ - { 6, "sha1", + { "rfc2202 3.6", "sha1", {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, @@ -93,16 +78,7 @@ int hmac_test(void) 0x95, 0x70, 0x56, 0x37, 0xce, 0x8a, 0x3b, 0x55, 0xed, 0x40, 0x21, 0x12} }, - /* - test_case = 7 - key = 0xaa repeated 80 times - key_len = 80 - data = "Test Using Larger Than Block-Size Key and Larger - Than One Block-Size Data" - data_len = 73 - digest = 0xe8e99d0f45237d786d6bbaa7965c7808bbff1a91 - */ - { 7, "sha1", + { "rfc2202 3.7", "sha1", {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, @@ -119,49 +95,21 @@ int hmac_test(void) /* 2. Test Cases for HMAC-MD5 - - test_case = 1 - key = 0x0b 0b 0b 0b - 0b 0b 0b 0b - 0b 0b 0b 0b - 0b 0b 0b 0b - key_len = 16 - data = "Hi There" - data_len = 8 - digest = 0x92 94 72 7a - 36 38 bb 1c - 13 f4 8e f8 - 15 8b fc 9d */ - { 1, "md5", + { "rfc2202 2.1", "md5", {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 16, "Hi There", 8, {0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c, 0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d} }, - /* - test_case = 2 - key = "Jefe" - key_len = 4 - data = "what do ya want for nothing?" - data_len = 28 - digest = 0x750c783e6ab0b503eaa86e310a5db738 - */ - { 2, "md5", + + { "rfc2202 2.2", "md5", "Jefe", 4, "what do ya want for nothing?", 28, {0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03, 0xea, 0xa8, 0x6e, 0x31, 0x0a, 0x5d, 0xb7, 0x38} }, - /* - test_case = 3 - key = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - key_len 16 - data = 0xdd repeated 50 times - data_len = 50 - digest = 0x56be34521d144c88dbb8c733f0e8b3f6 - */ - { 3, "md5", + { "rfc2202 2.3", "md5", {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, 16, {0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, @@ -171,16 +119,8 @@ int hmac_test(void) 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd}, 50, {0x56, 0xbe, 0x34, 0x52, 0x1d, 0x14, 0x4c, 0x88, 0xdb, 0xb8, 0xc7, 0x33, 0xf0, 0xe8, 0xb3, 0xf6} }, - /* - test_case = 4 - key = 0x0102030405060708090a0b0c0d0e0f10111213141516171819 - key_len 25 - data = 0xcd repeated 50 times - data_len = 50 - digest = 0x697eaf0aca3a3aea3a75164746ffaa79 - */ - { 4, "md5", + { "rfc2202 2.4", "md5", {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19}, 25, @@ -192,35 +132,14 @@ int hmac_test(void) {0x69, 0x7e, 0xaf, 0x0a, 0xca, 0x3a, 0x3a, 0xea, 0x3a, 0x75, 0x16, 0x47, 0x46, 0xff, 0xaa, 0x79} }, - - /* - - test_case = 5 - key = 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c - key_len = 16 - data = "Test With Truncation" - data_len = 20 - digest = 0x56461ef2342edc00f9bab995690efd4c - digest-96 0x56461ef2342edc00f9bab995 - */ - { 5, "md5", + { "rfc2202 2.5", "md5", {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, 16, "Test With Truncation", 20, {0x56, 0x46, 0x1e, 0xf2, 0x34, 0x2e, 0xdc, 0x00, 0xf9, 0xba, 0xb9, 0x95, 0x69, 0x0e, 0xfd, 0x4c} }, - /* - - test_case = 6 - key = 0xaa repeated 80 times - key_len = 80 - data = "Test Using Larger Than Block-Size Key - Hash -Key First" - data_len = 54 - digest = 0x6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd - */ - { 6, "md5", + { "rfc2202 2.6", "md5", {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, @@ -236,17 +155,7 @@ Key First" {0x6b, 0x1a, 0xb7, 0xfe, 0x4b, 0xd7, 0xbf, 0x8f, 0x0b, 0x62, 0xe6, 0xce, 0x61, 0xb9, 0xd0, 0xcd} }, - /* - - test_case = 7 - key = 0xaa repeated 80 times - key_len = 80 - data = "Test Using Larger Than Block-Size Key and Larger - Than One Block-Size Data" - data_len = 73 - digest = 0x6f630fad67cda0ee1fb1f562db3aa53e - */ - { 7, "md5", + { "rfc2202 2.7", "md5", {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, @@ -272,7 +181,7 @@ Key First" outlen = sizeof(digest); if((err = hmac_memory(hash, cases[i].key, cases[i].keylen, cases[i].data, cases[i].datalen, digest, &outlen)) != CRYPT_OK) { #if 0 - printf("HMAC-%s test #%d, %s\n", cases[i].algo, cases[i].num, error_to_string(err)); + printf("HMAC-%s test %s, %s\n", cases[i].algo, cases[i].num, error_to_string(err)); #endif return err; } @@ -281,7 +190,7 @@ Key First" failed++; #if 0 unsigned int j; - printf("\nLTC_HMAC-%s test #%d:\n", cases[i].algo, cases[i].num); + printf("\nLTC_HMAC-%s test %s:\n", cases[i].algo, cases[i].num); printf( "Result: 0x"); for(j=0; j < hash_descriptor[hash].hashsize; j++) { printf("%2x ", digest[j]); From ed9940175d9526594bac13a42f5daaac5a27040f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Jan 2014 21:46:26 +0100 Subject: [PATCH 0124/1192] hmac test: add some more tests from RFC's --- src/mac/hmac/hmac_test.c | 573 +++++++++++++++++++++++++++++++++------ 1 file changed, 490 insertions(+), 83 deletions(-) diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index fa657db75..3573b5074 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -12,7 +12,7 @@ /** @file hmac_test.c - HMAC support, self-test, Tom St Denis/Dobes Vandermeer + HMAC support, self-test, Tom St Denis/Dobes Vandermeer/Steffen Jaeckel */ #ifdef LTC_HMAC @@ -27,7 +27,25 @@ Request for Comments: 2202 IBM Category: Informational R. Glenn NIST September 1997 + Test Cases for HMAC-MD5 and HMAC-SHA-1 + +******************************************************************************* + +Network Working Group J. Kapp +Request for Comments: 2286 Reaper Technologies +Category: Informational February 1998 + + Test Cases for HMAC-RIPEMD160 and HMAC-RIPEMD128 + +******************************************************************************* + +Network Working Group M. Nystrom +Request for Comments: 4231 RSA Security +Category: Standards Track December 2005 + + Identifiers and Test Vectors for HMAC-SHA-224, HMAC-SHA-256, + HMAC-SHA-384, and HMAC-SHA-512 */ /** @@ -42,133 +60,518 @@ int hmac_test(void) unsigned char digest[MAXBLOCKSIZE]; int i; + static const unsigned char hmac_test_case_keys[][136] = { + { // 1 + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b + }, + { // 2 + 0x4a, 0x65, 0x66, 0x65 + }, + { // 4 + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19 + }, + { // 5 + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c + }, + { // 3, 6, 7 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa + } + }; + + + static const unsigned char hmac_test_case_data[][153] = { + { + "Hi There" + }, + { + "what do ya want for nothing?" + }, + { + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd + }, + { + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd + }, + { + "Test With Truncation" + }, + { + "Test Using Larger Than Block-Size Key - Hash Key First" + }, + { + "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" + }, + { + "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm." + } + }; + static const struct hmac_test_case { char *num; char *algo; - unsigned char key[128]; + const unsigned char *key; unsigned long keylen; - unsigned char data[128]; + const unsigned char *data; unsigned long datalen; unsigned char digest[MAXBLOCKSIZE]; } cases[] = { /* - 3. Test Cases for HMAC-SHA-1 + RFC 2202 3. Test Cases for HMAC-SHA-1 */ + { "rfc2202 3.1", "sha1", + hmac_test_case_keys[0], 20, + hmac_test_case_data[0], 8, + {0xb6, 0x17, 0x31, 0x86, 0x55, 0x05, 0x72, 0x64, + 0xe2, 0x8b, 0xc0, 0xb6, 0xfb, 0x37, 0x8c, 0x8e, + 0xf1, 0x46, 0xbe, 0x00} }, + + { "rfc2202 3.2", "sha1", + hmac_test_case_keys[1], 4, + hmac_test_case_data[1], 28, + {0xef, 0xfc, 0xdf, 0x6a, 0xe5, 0xeb, 0x2f, 0xa2, + 0xd2, 0x74, 0x16, 0xd5, 0xf1, 0x84, 0xdf, 0x9c, + 0x25, 0x9a, 0x7c, 0x79} }, + + { "rfc2202 3.3", "sha1", + hmac_test_case_keys[4], 20, + hmac_test_case_data[2], 50, + {0x12, 0x5d, 0x73, 0x42, 0xb9, 0xac, 0x11, 0xcd, + 0x91, 0xa3, 0x9a, 0xf4, 0x8a, 0xa1, 0x7b, 0x4f, + 0x63, 0xf1, 0x75, 0xd3} }, + + { "rfc2202 3.4", "sha1", + hmac_test_case_keys[2], 25, + hmac_test_case_data[3], 50, + {0x4c, 0x90, 0x07, 0xf4, 0x02, 0x62, 0x50, 0xc6, + 0xbc, 0x84, 0x14, 0xf9, 0xbf, 0x50, 0xc8, 0x6c, + 0x2d, 0x72, 0x35, 0xda} }, + { "rfc2202 3.5", "sha1", - {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, - 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, - 0x0c, 0x0c, 0x0c, 0x0c}, 20, - "Test With Truncation", 20, + hmac_test_case_keys[3], 20, + hmac_test_case_data[4], 20, {0x4c, 0x1a, 0x03, 0x42, 0x4b, 0x55, 0xe0, 0x7f, 0xe7, 0xf2, 0x7b, 0xe1, 0xd5, 0x8b, 0xb9, 0x32, 0x4a, 0x9a, 0x5a, 0x04} }, { "rfc2202 3.6", "sha1", - {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, 80, - "Test Using Larger Than Block-Size Key - Hash Key First", 54, + hmac_test_case_keys[4], 80, + hmac_test_case_data[5], 54, {0xaa, 0x4a, 0xe5, 0xe1, 0x52, 0x72, 0xd0, 0x0e, 0x95, 0x70, 0x56, 0x37, 0xce, 0x8a, 0x3b, 0x55, 0xed, 0x40, 0x21, 0x12} }, { "rfc2202 3.7", "sha1", - {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, 80, - "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73, + hmac_test_case_keys[4], 80, + hmac_test_case_data[6], 73, {0xe8, 0xe9, 0x9d, 0x0f, 0x45, 0x23, 0x7d, 0x78, 0x6d, 0x6b, 0xba, 0xa7, 0x96, 0x5c, 0x78, 0x08, 0xbb, 0xff, 0x1a, 0x91} }, /* - 2. Test Cases for HMAC-MD5 + RFC 2202 2. Test Cases for HMAC-MD5 */ { "rfc2202 2.1", "md5", - {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, - 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 16, - "Hi There", 8, + hmac_test_case_keys[0], 16, + hmac_test_case_data[0], 8, {0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c, 0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d} }, { "rfc2202 2.2", "md5", - "Jefe", 4, - "what do ya want for nothing?", 28, + hmac_test_case_keys[1], 4, + hmac_test_case_data[1], 28, {0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03, 0xea, 0xa8, 0x6e, 0x31, 0x0a, 0x5d, 0xb7, 0x38} }, { "rfc2202 2.3", "md5", - {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, 16, - {0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, - 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd}, 50, + hmac_test_case_keys[4], 16, + hmac_test_case_data[2], 50, {0x56, 0xbe, 0x34, 0x52, 0x1d, 0x14, 0x4c, 0x88, 0xdb, 0xb8, 0xc7, 0x33, 0xf0, 0xe8, 0xb3, 0xf6} }, { "rfc2202 2.4", "md5", - {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, - 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x15, 0x16, 0x17, 0x18, 0x19}, 25, - {0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, - 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, - 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, - 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, - 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd}, 50, + hmac_test_case_keys[2], 25, + hmac_test_case_data[3], 50, {0x69, 0x7e, 0xaf, 0x0a, 0xca, 0x3a, 0x3a, 0xea, 0x3a, 0x75, 0x16, 0x47, 0x46, 0xff, 0xaa, 0x79} }, { "rfc2202 2.5", "md5", - {0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, - 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, 16, - "Test With Truncation", 20, + hmac_test_case_keys[3], 16, + hmac_test_case_data[4], 20, {0x56, 0x46, 0x1e, 0xf2, 0x34, 0x2e, 0xdc, 0x00, 0xf9, 0xba, 0xb9, 0x95, 0x69, 0x0e, 0xfd, 0x4c} }, { "rfc2202 2.6", "md5", - {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0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aa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, 80, - "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", 73, + hmac_test_case_keys[4], 80, + hmac_test_case_data[6], 73, {0x6f, 0x63, 0x0f, 0xad, 0x67, 0xcd, 0xa0, 0xee, - 0x1f, 0xb1, 0xf5, 0x62, 0xdb, 0x3a, 0xa5, 0x3e} } + 0x1f, 0xb1, 0xf5, 0x62, 0xdb, 0x3a, 0xa5, 0x3e} }, + + /* + RFC 2286 2. Test Cases for HMAC-RIPEMD160 + */ + { "rfc2286 2.1", "rmd160", + hmac_test_case_keys[0], 20, + hmac_test_case_data[0], 8, + {0x24, 0xcb, 0x4b, 0xd6, 0x7d, 0x20, 0xfc, 0x1a, + 0x5d, 0x2e, 0xd7, 0x73, 0x2d, 0xcc, 0x39, 0x37, + 0x7f, 0x0a, 0x56, 0x68} }, + + { "rfc2286 2.2", "rmd160", + hmac_test_case_keys[1], 4, + hmac_test_case_data[1], 28, + {0xdd, 0xa6, 0xc0, 0x21, 0x3a, 0x48, 0x5a, 0x9e, + 0x24, 0xf4, 0x74, 0x20, 0x64, 0xa7, 0xf0, 0x33, + 0xb4, 0x3c, 0x40, 0x69} }, + + { "rfc2286 2.3", "rmd160", + hmac_test_case_keys[4], 20, + hmac_test_case_data[2], 50, + {0xb0, 0xb1, 0x05, 0x36, 0x0d, 0xe7, 0x59, 0x96, + 0x0a, 0xb4, 0xf3, 0x52, 0x98, 0xe1, 0x16, 0xe2, + 0x95, 0xd8, 0xe7, 0xc1} }, + + { "rfc2286 2.4", "rmd160", + hmac_test_case_keys[2], 25, + hmac_test_case_data[3], 50, + {0xd5, 0xca, 0x86, 0x2f, 0x4d, 0x21, 0xd5, 0xe6, + 0x10, 0xe1, 0x8b, 0x4c, 0xf1, 0xbe, 0xb9, 0x7a, + 0x43, 0x65, 0xec, 0xf4} }, + + { "rfc2286 2.5", "rmd160", + hmac_test_case_keys[3], 20, + hmac_test_case_data[4], 20, + {0x76, 0x19, 0x69, 0x39, 0x78, 0xf9, 0x1d, 0x90, + 0x53, 0x9a, 0xe7, 0x86, 0x50, 0x0f, 0xf3, 0xd8, + 0xe0, 0x51, 0x8e, 0x39} }, + + { "rfc2286 2.6", "rmd160", + hmac_test_case_keys[4], 80, + hmac_test_case_data[5], 54, + {0x64, 0x66, 0xca, 0x07, 0xac, 0x5e, 0xac, 0x29, + 0xe1, 0xbd, 0x52, 0x3e, 0x5a, 0xda, 0x76, 0x05, + 0xb7, 0x91, 0xfd, 0x8b} }, + + { "rfc2286 2.7", "rmd160", + hmac_test_case_keys[4], 80, + hmac_test_case_data[6], 73, + {0x69, 0xea, 0x60, 0x79, 0x8d, 0x71, 0x61, 0x6c, + 0xce, 0x5f, 0xd0, 0x87, 0x1e, 0x23, 0x75, 0x4c, + 0xd7, 0x5d, 0x5a, 0x0a} }, + + /* + RFC 2286 3. Test Cases for HMAC-RIPEMD128 + */ + { "rfc2286 3.1", "rmd128", + hmac_test_case_keys[0], 16, + hmac_test_case_data[0], 8, + {0xfb, 0xf6, 0x1f, 0x94, 0x92, 0xaa, 0x4b, 0xbf, + 0x81, 0xc1, 0x72, 0xe8, 0x4e, 0x07, 0x34, 0xdb} }, + + { "rfc2286 3.2", "rmd128", + hmac_test_case_keys[1], 4, + hmac_test_case_data[1], 28, + {0x87, 0x5f, 0x82, 0x88, 0x62, 0xb6, 0xb3, 0x34, + 0xb4, 0x27, 0xc5, 0x5f, 0x9f, 0x7f, 0xf0, 0x9b} }, + + { "rfc2286 3.3", "rmd128", + hmac_test_case_keys[4], 16, + hmac_test_case_data[2], 50, + {0x09, 0xf0, 0xb2, 0x84, 0x6d, 0x2f, 0x54, 0x3d, + 0xa3, 0x63, 0xcb, 0xec, 0x8d, 0x62, 0xa3, 0x8d} }, + + { "rfc2286 3.4", "rmd128", + hmac_test_case_keys[2], 25, + hmac_test_case_data[3], 50, + {0xbd, 0xbb, 0xd7, 0xcf, 0x03, 0xe4, 0x4b, 0x5a, + 0xa6, 0x0a, 0xf8, 0x15, 0xbe, 0x4d, 0x22, 0x94} }, + + { "rfc2286 3.5", "rmd128", + hmac_test_case_keys[3], 16, + hmac_test_case_data[4], 20, + {0xe7, 0x98, 0x08, 0xf2, 0x4b, 0x25, 0xfd, 0x03, + 0x1c, 0x15, 0x5f, 0x0d, 0x55, 0x1d, 0x9a, 0x3a} }, + + { "rfc2286 3.6", "rmd128", + hmac_test_case_keys[4], 80, + hmac_test_case_data[5], 54, + {0xdc, 0x73, 0x29, 0x28, 0xde, 0x98, 0x10, 0x4a, + 0x1f, 0x59, 0xd3, 0x73, 0xc1, 0x50, 0xac, 0xbb} }, + + { "rfc2286 3.7", "rmd128", + hmac_test_case_keys[4], 80, + hmac_test_case_data[6], 73, + {0x5c, 0x6b, 0xec, 0x96, 0x79, 0x3e, 0x16, 0xd4, + 0x06, 0x90, 0xc2, 0x37, 0x63, 0x5f, 0x30, 0xc5} }, + + /* + RFC 4231 4. Test Vectors + Ch. 4.6 with truncated output left out to simplify tests + */ + { "rfc4231 4.2", "sha224", + hmac_test_case_keys[0], 20, + hmac_test_case_data[0], 8, + {0x89, 0x6f, 0xb1, 0x12, 0x8a, 0xbb, 0xdf, 0x19, + 0x68, 0x32, 0x10, 0x7c, 0xd4, 0x9d, 0xf3, 0x3f, + 0x47, 0xb4, 0xb1, 0x16, 0x99, 0x12, 0xba, 0x4f, + 0x53, 0x68, 0x4b, 0x22} }, + + { "rfc4231 4.3", "sha224", + hmac_test_case_keys[1], 4, + hmac_test_case_data[1], 28, + {0xa3, 0x0e, 0x01, 0x09, 0x8b, 0xc6, 0xdb, 0xbf, + 0x45, 0x69, 0x0f, 0x3a, 0x7e, 0x9e, 0x6d, 0x0f, + 0x8b, 0xbe, 0xa2, 0xa3, 0x9e, 0x61, 0x48, 0x00, + 0x8f, 0xd0, 0x5e, 0x44} }, + + { "rfc4231 4.4", "sha224", + hmac_test_case_keys[4], 20, + hmac_test_case_data[2], 50, + {0x7f, 0xb3, 0xcb, 0x35, 0x88, 0xc6, 0xc1, 0xf6, + 0xff, 0xa9, 0x69, 0x4d, 0x7d, 0x6a, 0xd2, 0x64, + 0x93, 0x65, 0xb0, 0xc1, 0xf6, 0x5d, 0x69, 0xd1, + 0xec, 0x83, 0x33, 0xea} }, + + { "rfc4231 4.5", "sha224", + hmac_test_case_keys[2], 25, + hmac_test_case_data[3], 50, + {0x6c, 0x11, 0x50, 0x68, 0x74, 0x01, 0x3c, 0xac, + 0x6a, 0x2a, 0xbc, 0x1b, 0xb3, 0x82, 0x62, 0x7c, + 0xec, 0x6a, 0x90, 0xd8, 0x6e, 0xfc, 0x01, 0x2d, + 0xe7, 0xaf, 0xec, 0x5a} }, + + { "rfc4231 4.7", "sha224", + hmac_test_case_keys[4], 131, + hmac_test_case_data[5], 54, + {0x95, 0xe9, 0xa0, 0xdb, 0x96, 0x20, 0x95, 0xad, + 0xae, 0xbe, 0x9b, 0x2d, 0x6f, 0x0d, 0xbc, 0xe2, + 0xd4, 0x99, 0xf1, 0x12, 0xf2, 0xd2, 0xb7, 0x27, + 0x3f, 0xa6, 0x87, 0x0e} }, + + { "rfc4231 4.8", "sha224", + hmac_test_case_keys[4], 131, + hmac_test_case_data[7], 152, + {0x3a, 0x85, 0x41, 0x66, 0xac, 0x5d, 0x9f, 0x02, + 0x3f, 0x54, 0xd5, 0x17, 0xd0, 0xb3, 0x9d, 0xbd, + 0x94, 0x67, 0x70, 0xdb, 0x9c, 0x2b, 0x95, 0xc9, + 0xf6, 0xf5, 0x65, 0xd1} }, + + { "rfc4231 4.2", "sha256", + hmac_test_case_keys[0], 20, + hmac_test_case_data[0], 8, + {0xb0, 0x34, 0x4c, 0x61, 0xd8, 0xdb, 0x38, 0x53, + 0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b, 0xf1, 0x2b, + 0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7, + 0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7} }, + + { "rfc4231 4.3", "sha256", + hmac_test_case_keys[1], 4, + hmac_test_case_data[1], 28, + {0x5b, 0xdc, 0xc1, 0x46, 0xbf, 0x60, 0x75, 0x4e, + 0x6a, 0x04, 0x24, 0x26, 0x08, 0x95, 0x75, 0xc7, + 0x5a, 0x00, 0x3f, 0x08, 0x9d, 0x27, 0x39, 0x83, + 0x9d, 0xec, 0x58, 0xb9, 0x64, 0xec, 0x38, 0x43} }, + + { "rfc4231 4.4", "sha256", + hmac_test_case_keys[4], 20, + hmac_test_case_data[2], 50, + {0x77, 0x3e, 0xa9, 0x1e, 0x36, 0x80, 0x0e, 0x46, + 0x85, 0x4d, 0xb8, 0xeb, 0xd0, 0x91, 0x81, 0xa7, + 0x29, 0x59, 0x09, 0x8b, 0x3e, 0xf8, 0xc1, 0x22, + 0xd9, 0x63, 0x55, 0x14, 0xce, 0xd5, 0x65, 0xfe} }, + + { "rfc4231 4.5", "sha256", + hmac_test_case_keys[2], 25, + hmac_test_case_data[3], 50, + {0x82, 0x55, 0x8a, 0x38, 0x9a, 0x44, 0x3c, 0x0e, + 0xa4, 0xcc, 0x81, 0x98, 0x99, 0xf2, 0x08, 0x3a, + 0x85, 0xf0, 0xfa, 0xa3, 0xe5, 0x78, 0xf8, 0x07, + 0x7a, 0x2e, 0x3f, 0xf4, 0x67, 0x29, 0x66, 0x5b} }, + + { "rfc4231 4.7", "sha256", + hmac_test_case_keys[4], 131, + hmac_test_case_data[5], 54, + {0x60, 0xe4, 0x31, 0x59, 0x1e, 0xe0, 0xb6, 0x7f, + 0x0d, 0x8a, 0x26, 0xaa, 0xcb, 0xf5, 0xb7, 0x7f, + 0x8e, 0x0b, 0xc6, 0x21, 0x37, 0x28, 0xc5, 0x14, + 0x05, 0x46, 0x04, 0x0f, 0x0e, 0xe3, 0x7f, 0x54} }, + + { "rfc4231 4.8", "sha256", + hmac_test_case_keys[4], 131, + hmac_test_case_data[7], 152, + {0x9b, 0x09, 0xff, 0xa7, 0x1b, 0x94, 0x2f, 0xcb, + 0x27, 0x63, 0x5f, 0xbc, 0xd5, 0xb0, 0xe9, 0x44, + 0xbf, 0xdc, 0x63, 0x64, 0x4f, 0x07, 0x13, 0x93, + 0x8a, 0x7f, 0x51, 0x53, 0x5c, 0x3a, 0x35, 0xe2} }, + + { "rfc4231 4.2", "sha384", + hmac_test_case_keys[0], 20, + hmac_test_case_data[0], 8, + {0xaf, 0xd0, 0x39, 0x44, 0xd8, 0x48, 0x95, 0x62, + 0x6b, 0x08, 0x25, 0xf4, 0xab, 0x46, 0x90, 0x7f, + 0x15, 0xf9, 0xda, 0xdb, 0xe4, 0x10, 0x1e, 0xc6, + 0x82, 0xaa, 0x03, 0x4c, 0x7c, 0xeb, 0xc5, 0x9c, + 0xfa, 0xea, 0x9e, 0xa9, 0x07, 0x6e, 0xde, 0x7f, + 0x4a, 0xf1, 0x52, 0xe8, 0xb2, 0xfa, 0x9c, 0xb6} }, + + { "rfc4231 4.3", "sha384", + hmac_test_case_keys[1], 4, + hmac_test_case_data[1], 28, + {0xaf, 0x45, 0xd2, 0xe3, 0x76, 0x48, 0x40, 0x31, + 0x61, 0x7f, 0x78, 0xd2, 0xb5, 0x8a, 0x6b, 0x1b, + 0x9c, 0x7e, 0xf4, 0x64, 0xf5, 0xa0, 0x1b, 0x47, + 0xe4, 0x2e, 0xc3, 0x73, 0x63, 0x22, 0x44, 0x5e, + 0x8e, 0x22, 0x40, 0xca, 0x5e, 0x69, 0xe2, 0xc7, + 0x8b, 0x32, 0x39, 0xec, 0xfa, 0xb2, 0x16, 0x49} }, + + { "rfc4231 4.4", "sha384", + hmac_test_case_keys[4], 20, + hmac_test_case_data[2], 50, + {0x88, 0x06, 0x26, 0x08, 0xd3, 0xe6, 0xad, 0x8a, + 0x0a, 0xa2, 0xac, 0xe0, 0x14, 0xc8, 0xa8, 0x6f, + 0x0a, 0xa6, 0x35, 0xd9, 0x47, 0xac, 0x9f, 0xeb, + 0xe8, 0x3e, 0xf4, 0xe5, 0x59, 0x66, 0x14, 0x4b, + 0x2a, 0x5a, 0xb3, 0x9d, 0xc1, 0x38, 0x14, 0xb9, + 0x4e, 0x3a, 0xb6, 0xe1, 0x01, 0xa3, 0x4f, 0x27} }, + + { "rfc4231 4.5", "sha384", + hmac_test_case_keys[2], 25, + hmac_test_case_data[3], 50, + {0x3e, 0x8a, 0x69, 0xb7, 0x78, 0x3c, 0x25, 0x85, + 0x19, 0x33, 0xab, 0x62, 0x90, 0xaf, 0x6c, 0xa7, + 0x7a, 0x99, 0x81, 0x48, 0x08, 0x50, 0x00, 0x9c, + 0xc5, 0x57, 0x7c, 0x6e, 0x1f, 0x57, 0x3b, 0x4e, + 0x68, 0x01, 0xdd, 0x23, 0xc4, 0xa7, 0xd6, 0x79, + 0xcc, 0xf8, 0xa3, 0x86, 0xc6, 0x74, 0xcf, 0xfb} }, + + { "rfc4231 4.7", "sha384", + hmac_test_case_keys[4], 131, + hmac_test_case_data[5], 54, + {0x4e, 0xce, 0x08, 0x44, 0x85, 0x81, 0x3e, 0x90, + 0x88, 0xd2, 0xc6, 0x3a, 0x04, 0x1b, 0xc5, 0xb4, + 0x4f, 0x9e, 0xf1, 0x01, 0x2a, 0x2b, 0x58, 0x8f, + 0x3c, 0xd1, 0x1f, 0x05, 0x03, 0x3a, 0xc4, 0xc6, + 0x0c, 0x2e, 0xf6, 0xab, 0x40, 0x30, 0xfe, 0x82, + 0x96, 0x24, 0x8d, 0xf1, 0x63, 0xf4, 0x49, 0x52} }, + + { "rfc4231 4.8", "sha384", + hmac_test_case_keys[4], 131, + hmac_test_case_data[7], 152, + {0x66, 0x17, 0x17, 0x8e, 0x94, 0x1f, 0x02, 0x0d, + 0x35, 0x1e, 0x2f, 0x25, 0x4e, 0x8f, 0xd3, 0x2c, + 0x60, 0x24, 0x20, 0xfe, 0xb0, 0xb8, 0xfb, 0x9a, + 0xdc, 0xce, 0xbb, 0x82, 0x46, 0x1e, 0x99, 0xc5, + 0xa6, 0x78, 0xcc, 0x31, 0xe7, 0x99, 0x17, 0x6d, + 0x38, 0x60, 0xe6, 0x11, 0x0c, 0x46, 0x52, 0x3e} }, + + { "rfc4231 4.2", "sha512", + hmac_test_case_keys[0], 20, + hmac_test_case_data[0], 8, + {0x87, 0xaa, 0x7c, 0xde, 0xa5, 0xef, 0x61, 0x9d, + 0x4f, 0xf0, 0xb4, 0x24, 0x1a, 0x1d, 0x6c, 0xb0, + 0x23, 0x79, 0xf4, 0xe2, 0xce, 0x4e, 0xc2, 0x78, + 0x7a, 0xd0, 0xb3, 0x05, 0x45, 0xe1, 0x7c, 0xde, + 0xda, 0xa8, 0x33, 0xb7, 0xd6, 0xb8, 0xa7, 0x02, + 0x03, 0x8b, 0x27, 0x4e, 0xae, 0xa3, 0xf4, 0xe4, + 0xbe, 0x9d, 0x91, 0x4e, 0xeb, 0x61, 0xf1, 0x70, + 0x2e, 0x69, 0x6c, 0x20, 0x3a, 0x12, 0x68, 0x54} }, + + { "rfc4231 4.3", "sha512", + hmac_test_case_keys[1], 4, + hmac_test_case_data[1], 28, + {0x16, 0x4b, 0x7a, 0x7b, 0xfc, 0xf8, 0x19, 0xe2, + 0xe3, 0x95, 0xfb, 0xe7, 0x3b, 0x56, 0xe0, 0xa3, + 0x87, 0xbd, 0x64, 0x22, 0x2e, 0x83, 0x1f, 0xd6, + 0x10, 0x27, 0x0c, 0xd7, 0xea, 0x25, 0x05, 0x54, + 0x97, 0x58, 0xbf, 0x75, 0xc0, 0x5a, 0x99, 0x4a, + 0x6d, 0x03, 0x4f, 0x65, 0xf8, 0xf0, 0xe6, 0xfd, + 0xca, 0xea, 0xb1, 0xa3, 0x4d, 0x4a, 0x6b, 0x4b, + 0x63, 0x6e, 0x07, 0x0a, 0x38, 0xbc, 0xe7, 0x37} }, + + { "rfc4231 4.4", "sha512", + hmac_test_case_keys[4], 20, + hmac_test_case_data[2], 50, + {0xfa, 0x73, 0xb0, 0x08, 0x9d, 0x56, 0xa2, 0x84, + 0xef, 0xb0, 0xf0, 0x75, 0x6c, 0x89, 0x0b, 0xe9, + 0xb1, 0xb5, 0xdb, 0xdd, 0x8e, 0xe8, 0x1a, 0x36, + 0x55, 0xf8, 0x3e, 0x33, 0xb2, 0x27, 0x9d, 0x39, + 0xbf, 0x3e, 0x84, 0x82, 0x79, 0xa7, 0x22, 0xc8, + 0x06, 0xb4, 0x85, 0xa4, 0x7e, 0x67, 0xc8, 0x07, + 0xb9, 0x46, 0xa3, 0x37, 0xbe, 0xe8, 0x94, 0x26, + 0x74, 0x27, 0x88, 0x59, 0xe1, 0x32, 0x92, 0xfb} }, + + { "rfc4231 4.5", "sha512", + hmac_test_case_keys[2], 25, + hmac_test_case_data[3], 50, + {0xb0, 0xba, 0x46, 0x56, 0x37, 0x45, 0x8c, 0x69, + 0x90, 0xe5, 0xa8, 0xc5, 0xf6, 0x1d, 0x4a, 0xf7, + 0xe5, 0x76, 0xd9, 0x7f, 0xf9, 0x4b, 0x87, 0x2d, + 0xe7, 0x6f, 0x80, 0x50, 0x36, 0x1e, 0xe3, 0xdb, + 0xa9, 0x1c, 0xa5, 0xc1, 0x1a, 0xa2, 0x5e, 0xb4, + 0xd6, 0x79, 0x27, 0x5c, 0xc5, 0x78, 0x80, 0x63, + 0xa5, 0xf1, 0x97, 0x41, 0x12, 0x0c, 0x4f, 0x2d, + 0xe2, 0xad, 0xeb, 0xeb, 0x10, 0xa2, 0x98, 0xdd} }, + + { "rfc4231 4.7", "sha512", + hmac_test_case_keys[4], 131, + hmac_test_case_data[5], 54, + {0x80, 0xb2, 0x42, 0x63, 0xc7, 0xc1, 0xa3, 0xeb, + 0xb7, 0x14, 0x93, 0xc1, 0xdd, 0x7b, 0xe8, 0xb4, + 0x9b, 0x46, 0xd1, 0xf4, 0x1b, 0x4a, 0xee, 0xc1, + 0x12, 0x1b, 0x01, 0x37, 0x83, 0xf8, 0xf3, 0x52, + 0x6b, 0x56, 0xd0, 0x37, 0xe0, 0x5f, 0x25, 0x98, + 0xbd, 0x0f, 0xd2, 0x21, 0x5d, 0x6a, 0x1e, 0x52, + 0x95, 0xe6, 0x4f, 0x73, 0xf6, 0x3f, 0x0a, 0xec, + 0x8b, 0x91, 0x5a, 0x98, 0x5d, 0x78, 0x65, 0x98} }, + + { "rfc4231 4.8", "sha512", + hmac_test_case_keys[4], 131, + hmac_test_case_data[7], 152, + {0xe3, 0x7b, 0x6a, 0x77, 0x5d, 0xc8, 0x7d, 0xba, + 0xa4, 0xdf, 0xa9, 0xf9, 0x6e, 0x5e, 0x3f, 0xfd, + 0xde, 0xbd, 0x71, 0xf8, 0x86, 0x72, 0x89, 0x86, + 0x5d, 0xf5, 0xa3, 0x2d, 0x20, 0xcd, 0xc9, 0x44, + 0xb6, 0x02, 0x2c, 0xac, 0x3c, 0x49, 0x82, 0xb1, + 0x0d, 0x5e, 0xeb, 0x55, 0xc3, 0xe4, 0xde, 0x15, + 0x13, 0x46, 0x76, 0xfb, 0x6d, 0xe0, 0x44, 0x60, + 0x65, 0xc9, 0x74, 0x40, 0xfa, 0x8c, 0x6a, 0x58} }, + }; unsigned long outlen; @@ -180,7 +583,7 @@ int hmac_test(void) ++tested; outlen = sizeof(digest); if((err = hmac_memory(hash, cases[i].key, cases[i].keylen, cases[i].data, cases[i].datalen, digest, &outlen)) != CRYPT_OK) { -#if 0 +#ifdef LTC_HMAC_TEST_DBG printf("HMAC-%s test %s, %s\n", cases[i].algo, cases[i].num, error_to_string(err)); #endif return err; @@ -188,9 +591,10 @@ int hmac_test(void) if(XMEMCMP(digest, cases[i].digest, (size_t)hash_descriptor[hash].hashsize) != 0) { failed++; -#if 0 +#ifdef LTC_HMAC_TEST_DBG + { unsigned int j; - printf("\nLTC_HMAC-%s test %s:\n", cases[i].algo, cases[i].num); + printf("\nHMAC-%s test %s:\n", cases[i].algo, cases[i].num); printf( "Result: 0x"); for(j=0; j < hash_descriptor[hash].hashsize; j++) { printf("%2x ", digest[j]); @@ -200,10 +604,13 @@ int hmac_test(void) printf("%2x ", cases[i].digest[j]); } printf("\n"); - return CRYPT_ERROR; + return CRYPT_FAIL_TESTVECTOR; + } #endif +#ifdef LTC_HMAC_TEST_DBG } else { - /* printf("HMAC-%s test #%d: Passed\n", cases[i].algo, cases[i].num); */ + printf("HMAC-%s test %s: Passed\n", cases[i].algo, cases[i].num); +#endif } } From 4ab63ccd3a6ed5e11fa616fafc9915ef694e8775 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 16:30:49 +0100 Subject: [PATCH 0125/1192] deterministically build crypt.pdf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This entails: • Using pdflatex to influence the modification/creation timestamp in the resulting PDF • Replacing the unique ID with 0/0 • Using the timestamp from crypt.tex instead of the current date/time See also http://superuser.com/a/130804 This change is necessary because for Multi-Arch Debian packages, non-arch-dependent files need to have the same checksum, which is not guaranteed without this commit. See http://bugs.debian.org/734109 --- makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 36e0da544..f322ebf33 100644 --- a/makefile +++ b/makefile @@ -373,14 +373,24 @@ doxy: #delete it if we are rebuilding it. docs: crypt.tex rm -f doc/crypt.pdf $(LEFTOVERS) + cp crypt.tex crypt.bak + touch --reference=crypt.tex crypt.bak + (echo "\\def\\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex + echo "\\pdfinfo{" >> crypt-deterministic.tex + echo "/CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex + echo "/ModDate (\fixedpdfdate) }" >> crypt-deterministic.tex + cat crypt.tex >> crypt-deterministic.tex + mv crypt-deterministic.tex crypt.tex + touch --reference=crypt.bak crypt.tex echo "hello" > crypt.ind latex crypt > /dev/null latex crypt > /dev/null makeindex crypt.idx > /dev/null perl fixupind.pl - latex crypt > /dev/null - dvipdf crypt + pdflatex crypt + sed -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf mv -ivf crypt.pdf doc/crypt.pdf + mv crypt.bak crypt.tex rm -f $(LEFTOVERS) docdvi: crypt.tex From a3811e200014c662d2cc013ebfd002fc45f56b89 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Jan 2014 16:25:54 +0100 Subject: [PATCH 0126/1192] add -b flag to sed that enables binary processing (required on windows) --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index f322ebf33..9247e8656 100644 --- a/makefile +++ b/makefile @@ -388,7 +388,7 @@ docs: crypt.tex makeindex crypt.idx > /dev/null perl fixupind.pl pdflatex crypt - sed -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf + sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf mv -ivf crypt.pdf doc/crypt.pdf mv crypt.bak crypt.tex rm -f $(LEFTOVERS) From 460bcfe31b77a6a6667cdd3b62f5874e85b05280 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Jan 2014 16:26:17 +0100 Subject: [PATCH 0127/1192] remove crypt.lof from the repository --- crypt.lof | 24 ------------------------ makefile | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 crypt.lof diff --git a/crypt.lof b/crypt.lof deleted file mode 100644 index ba16c2d8d..000000000 --- a/crypt.lof +++ /dev/null @@ -1,24 +0,0 @@ -\addvspace {10\p@ } -\addvspace {10\p@ } -\contentsline {figure}{\numberline {2.1}{\ignorespaces Load And Store Macros}}{9}{figure.2.1} -\contentsline {figure}{\numberline {2.2}{\ignorespaces Rotate Macros}}{9}{figure.2.2} -\addvspace {10\p@ } -\contentsline {figure}{\numberline {3.1}{\ignorespaces Built--In Software Ciphers}}{19}{figure.3.1} -\contentsline {figure}{\numberline {3.2}{\ignorespaces Twofish Build Options}}{21}{figure.3.2} -\addvspace {10\p@ } -\contentsline {figure}{\numberline {4.1}{\ignorespaces Built--In Software Hashes}}{59}{figure.4.1} -\addvspace {10\p@ } -\addvspace {10\p@ } -\contentsline {figure}{\numberline {6.1}{\ignorespaces List of Provided PRNGs}}{84}{figure.6.1} -\addvspace {10\p@ } -\addvspace {10\p@ } -\addvspace {10\p@ } -\contentsline {figure}{\numberline {9.1}{\ignorespaces DSA Key Sizes}}{121}{figure.9.1} -\addvspace {10\p@ } -\contentsline {figure}{\numberline {10.1}{\ignorespaces List of ASN.1 Supported Types}}{129}{figure.10.1} -\addvspace {10\p@ } -\addvspace {10\p@ } -\contentsline {figure}{\numberline {12.1}{\ignorespaces RSA/DH Key Strength}}{151}{figure.12.1} -\contentsline {figure}{\numberline {12.2}{\ignorespaces ECC Key Strength}}{151}{figure.12.2} -\addvspace {10\p@ } -\addvspace {10\p@ } diff --git a/makefile b/makefile index 9247e8656..fc28c9a21 100644 --- a/makefile +++ b/makefile @@ -255,7 +255,7 @@ TIMINGS=demos/timing.o TESTS=demos/test.o #Files left over from making the crypt.pdf. -LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out +LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof #Compressed filenames COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip From 8b24397f8455146525f53dde87a273c1614de67d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 18 Feb 2014 15:23:23 +0100 Subject: [PATCH 0128/1192] update makefiles --- makefile | 14 +++++++------- makefile.icc | 14 +++++++------- makefile.msvc | 14 +++++++------- makefile.shared | 14 +++++++------- makefile.unix | 14 +++++++------- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/makefile b/makefile index fc28c9a21..551a040a1 100644 --- a/makefile +++ b/makefile @@ -166,13 +166,13 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ -src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ -src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ -src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ -src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ -src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ -src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ +src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ +src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ +src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ +src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ +src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.icc b/makefile.icc index 7a8f9af56..7d4fd314e 100644 --- a/makefile.icc +++ b/makefile.icc @@ -147,13 +147,13 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ -src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ -src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ -src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ -src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ -src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ -src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ +src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ +src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ +src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ +src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ +src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.msvc b/makefile.msvc index 73f20fc19..dac8f2e79 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -57,13 +57,13 @@ src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_unregister_cipher.obj \ src/misc/crypt/crypt_unregister_hash.obj src/misc/crypt/crypt_unregister_prng.obj \ src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj src/misc/hkdf/hkdf_test.obj src/misc/pk_get_oid.obj \ -src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \ -src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj \ -src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj \ -src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj \ -src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj src/modes/ctr/ctr_decrypt.obj \ -src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj src/modes/ctr/ctr_getiv.obj \ -src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \ +src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj src/misc/pkcs5/pkcs_5_test.obj src/misc/zeromem.obj \ +src/modes/cbc/cbc_decrypt.obj src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj \ +src/modes/cbc/cbc_getiv.obj src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj \ +src/modes/cfb/cfb_decrypt.obj src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj \ +src/modes/cfb/cfb_getiv.obj src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj \ +src/modes/ctr/ctr_decrypt.obj src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj \ +src/modes/ctr/ctr_getiv.obj src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \ src/modes/ecb/ecb_decrypt.obj src/modes/ecb/ecb_done.obj src/modes/ecb/ecb_encrypt.obj \ src/modes/ecb/ecb_start.obj src/modes/f8/f8_decrypt.obj src/modes/f8/f8_done.obj src/modes/f8/f8_encrypt.obj \ src/modes/f8/f8_getiv.obj src/modes/f8/f8_setiv.obj src/modes/f8/f8_start.obj src/modes/f8/f8_test_mode.obj \ diff --git a/makefile.shared b/makefile.shared index 67aa41ea8..7b8288a67 100644 --- a/makefile.shared +++ b/makefile.shared @@ -152,13 +152,13 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ -src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ -src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ -src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ -src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ -src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ -src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ +src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ +src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ +src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ +src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ +src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.unix b/makefile.unix index 319368722..a035133b4 100644 --- a/makefile.unix +++ b/makefile.unix @@ -93,13 +93,13 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ -src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ -src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ -src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ -src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ -src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ -src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ +src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ +src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ +src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ +src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ +src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ From 77cca4175fd8e2a7b1184442cb872372ce1deffa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 18 Feb 2014 16:07:24 +0100 Subject: [PATCH 0129/1192] ccm_memory_ex: disable until documented and fixed --- src/encauth/ccm/ccm_memory_ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c index e2facdb85..af44f2fb8 100644 --- a/src/encauth/ccm/ccm_memory_ex.c +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -15,7 +15,7 @@ CCM support, process a block of memory, Tom St Denis */ -#ifdef LTC_CCM_MODE +#if defined LTC_CCM_MODE && 0 /** CCM encrypt/decrypt and produce an authentication tag From 65fd19c1fb8252b1ede3873cd9200f60e3194f1c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 25 Feb 2014 09:59:21 +0100 Subject: [PATCH 0130/1192] dh: fix renamed macro --- src/headers/tomcrypt_pk.h | 2 +- src/pk/dh/dh.c | 2 +- testprof/dh_test.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 131188657..e1a915219 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -164,7 +164,7 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key); #endif /* ---- DH Routines ---- */ -#ifdef MDH +#ifdef LTC_MDH typedef struct Dh_key { int idx, type; diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index 7ad003df8..6781fd44a 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -15,7 +15,7 @@ DH crypto, Tom St Denis */ -#ifdef MDH +#ifdef LTC_MDH /* size of a packet header in bytes */ #define PACKET_SIZE 4 diff --git a/testprof/dh_test.c b/testprof/dh_test.c index 8801c4f6e..ee3736fd3 100644 --- a/testprof/dh_test.c +++ b/testprof/dh_test.c @@ -1,6 +1,6 @@ #include -#ifdef MDH +#ifdef LTC_MDH #ifdef DH4096 #define KEYSIZE 4096 From feaa31968e528bbdeacaae8ae477e304ec344c6b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Jan 2014 14:07:28 +0100 Subject: [PATCH 0131/1192] travis: add IRC notifications --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1a6564502..f4c368340 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,3 +9,5 @@ before_script: - sudo apt-get install libtommath-dev after_script: - cat gcc_2.txt +notifications: + irc: "chat.freenode.net#libtom" From c5b57cfee463c64cff6cf3eab370e7c5f43ac1a9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 16 Feb 2014 18:40:01 +0100 Subject: [PATCH 0132/1192] travis: use build matrix instead of testme script --- .travis.yml | 19 ++++++++++++++++++- printinfo.sh | 16 ++++++++++++++++ testme.sh | 15 +-------------- 3 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 printinfo.sh diff --git a/.travis.yml b/.travis.yml index f4c368340..36ff1233d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,24 @@ language: c compiler: - gcc -script: ./testme.sh "makefile" "-DUSE_LTM -DLTM_DESC -DLTC_NO_ASM -I/usr/include" /usr/lib/libtommath.a +script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a" +env: + - BUILDSCRIPT="printinfo.sh" BUILDNAME="" BUILDOPTIONS="" + - BUILDSCRIPT="run.sh" BUILDNAME="STOCK" BUILDOPTIONS=" " + - BUILDSCRIPT="run.sh" BUILDNAME="SMALL" BUILDOPTIONS="-DLTC_SMALL_CODE" + - BUILDSCRIPT="run.sh" BUILDNAME="NOTABLES" BUILDOPTIONS="-DLTC_NO_TABLES" + - BUILDSCRIPT="run.sh" BUILDNAME="SMALL+NOTABLES" BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_NO_TABLES" + - BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK" BUILDOPTIONS="-DLTC_CLEAN_STACK" + - BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK+SMALL" BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_CLEAN_STACK" + - BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK+NOTABLES" BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK" + - BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK+NOTABLES+SMALL" BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK -DLTC_SMALL_CODE" + - BUILDSCRIPT="run.sh" BUILDNAME="NO_FAST" BUILDOPTIONS="-DLTC_NO_FAST" + - BUILDSCRIPT="run.sh" BUILDNAME="NO_FAST+NOTABLES" BUILDOPTIONS="-DLTC_NO_FAST -DLTC_NO_TABLES" + - BUILDSCRIPT="run.sh" BUILDNAME="NO_ASM" BUILDOPTIONS="-DLTC_NO_ASM" + - BUILDSCRIPT="testbuild.sh" BUILDNAME="NOTEST" BUILDOPTIONS="-DLTC_NO_TEST" + - BUILDSCRIPT="testbuild.sh" BUILDNAME="NOFILE" BUILDOPTIONS="-DLTC_NO_TEST" +matrix: + fast_finish: true branches: only: - develop diff --git a/printinfo.sh b/printinfo.sh new file mode 100644 index 000000000..ba40a0a2c --- /dev/null +++ b/printinfo.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +version=$(git describe --tags --always --dirty 2>/dev/null) +if [ ! -e ".git" ] || [ -z $version ] +then + version=$(grep "^VERSION=" makefile | sed "s/.*=//") +fi +echo "Testing version:" $version +#grep "VERSION=" makefile | perl -e "@a = split('=', <>); print @a[1];"` + +# get uname +echo "uname="`uname -a` + +# get gcc name +echo "gcc="`gcc -dumpversion` +echo diff --git a/testme.sh b/testme.sh index 750b0d780..4275bc2a3 100755 --- a/testme.sh +++ b/testme.sh @@ -11,20 +11,7 @@ fi echo "date="`date` # output version -version=$(git describe --tags --always --dirty 2>/dev/null) -if [ ! -e ".git" ] || [ -z $version ] -then - version=$(grep "^VERSION=" makefile | sed "s/.*=//") -fi -echo "Testing version:" $version -#grep "VERSION=" makefile | perl -e "@a = split('=', <>); print @a[1];"` - -# get uname -echo "uname="`uname -a` - -# get gcc name -echo "gcc="`gcc -dumpversion` -echo +bash printinfo.sh # stock build bash run.sh "STOCK" " " "$1" "$2" "$3" || exit 1 From e97d921c8df8c8b82b57f31d628e251eec58f9f8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 25 Feb 2014 10:31:13 +0100 Subject: [PATCH 0133/1192] travis: print version information in build scripts --- .travis.yml | 1 - run.sh | 4 ++++ testbuild.sh | 4 ++++ testme.sh | 3 --- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36ff1233d..5f6fe2b48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ compiler: - gcc script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a" env: - - BUILDSCRIPT="printinfo.sh" BUILDNAME="" BUILDOPTIONS="" - BUILDSCRIPT="run.sh" BUILDNAME="STOCK" BUILDOPTIONS=" " - BUILDSCRIPT="run.sh" BUILDNAME="SMALL" BUILDOPTIONS="-DLTC_SMALL_CODE" - BUILDSCRIPT="run.sh" BUILDNAME="NOTABLES" BUILDOPTIONS="-DLTC_NO_TABLES" diff --git a/run.sh b/run.sh index dd982e987..8d56f5ad4 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,8 @@ #!/bin/bash + +# output version +bash printinfo.sh + bash build.sh " $1" "$2 -O2" "$3 IGNORE_SPEED=1" "$4" "$5" if [ -a testok.txt ] && [ -f testok.txt ]; then echo diff --git a/testbuild.sh b/testbuild.sh index 6a9e3e6f4..c4caa4838 100755 --- a/testbuild.sh +++ b/testbuild.sh @@ -1,4 +1,8 @@ #!/bin/bash + +# output version +bash printinfo.sh + echo "$1 (Build Only, $2, $3)..." make clean 1>/dev/null 2>/dev/null echo -n "building..." diff --git a/testme.sh b/testme.sh index 4275bc2a3..fd049537b 100755 --- a/testme.sh +++ b/testme.sh @@ -10,9 +10,6 @@ fi # date echo "date="`date` -# output version -bash printinfo.sh - # stock build bash run.sh "STOCK" " " "$1" "$2" "$3" || exit 1 From 8d7e3d8216fdf54fb86072bcfe589da49a9bb8c8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 2 Jan 2014 06:33:16 +0100 Subject: [PATCH 0134/1192] fix typo: s/Endianess/Endianness/ --- crypt.tex | 2 +- src/misc/crypt/crypt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypt.tex b/crypt.tex index 4a5d59b8c..486eb957e 100644 --- a/crypt.tex +++ b/crypt.tex @@ -5580,7 +5580,7 @@ \subsubsection{ARGTYPE} if you handle signals on your own. When set to 3, it will resolve to a empty macro and no error checking will be performed. Finally, when set to 4, it will return CRYPT\_INVALID\_ARG to the caller. -\subsubsection{Endianess} +\subsubsection{Endianness} There are five macros related to endianess issues. For little endian platforms define, \textbf{ENDIAN\_LITTLE}. For big endian platforms define \textbf{ENDIAN\_BIG}. Similarly when the default word size of an \textit{unsigned long} is 32-bits define \textbf{ENDIAN\_32BITWORD} or define \textbf{ENDIAN\_64BITWORD} when its 64-bits. If you do not define any of them the library will automatically use \textbf{ENDIAN\_NEUTRAL} diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 28d6c746a..6a183a9ba 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -19,7 +19,7 @@ const char *crypt_build_settings = "LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n" "LibTomCrypt is public domain software.\n" "Built on " __DATE__ " at " __TIME__ "\n\n\n" - "Endianess: " + "Endianness: " #if defined(ENDIAN_NEUTRAL) "neutral\n" #elif defined(ENDIAN_LITTLE) From 30022b114cd3e100dcc21b0f79fde526e7a9d281 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 2 Jan 2014 06:22:29 +0100 Subject: [PATCH 0135/1192] add and install pkgconfig file for the shared library --- libtomcrypt.pc | 10 ++++++++++ makefile.shared | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 libtomcrypt.pc diff --git a/libtomcrypt.pc b/libtomcrypt.pc new file mode 100644 index 000000000..b8ff548e4 --- /dev/null +++ b/libtomcrypt.pc @@ -0,0 +1,10 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: LibTomCrypt +Description: public domain open source cryptographic toolkit +Version: 1.17 +Libs: -L${libdir} -ltomcrypt +Cflags: -I${includedir} diff --git a/makefile.shared b/makefile.shared index 7b8288a67..4c7921e8a 100644 --- a/makefile.shared +++ b/makefile.shared @@ -270,6 +270,8 @@ install: $(LIBNAME) libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) + install -d $(DESTDIR)$(LIBPATH)/pkgconfig + install -m 0644 -g $(GROUP) -o $(USER) libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc #This rule makes the hash program included with libtomcrypt hashsum: library From 90928d6dfd3c1e8a35530b55757e568c08845ccc Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 2 Jan 2014 07:09:24 +0100 Subject: [PATCH 0136/1192] pkgconfig: set libdir= to $LIBPATH (for multi-arch) --- libtomcrypt.pc => libtomcrypt.pc.in | 2 +- makefile.shared | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename libtomcrypt.pc => libtomcrypt.pc.in (88%) diff --git a/libtomcrypt.pc b/libtomcrypt.pc.in similarity index 88% rename from libtomcrypt.pc rename to libtomcrypt.pc.in index b8ff548e4..a0e889f7a 100644 --- a/libtomcrypt.pc +++ b/libtomcrypt.pc.in @@ -1,6 +1,6 @@ prefix=/usr exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=@LIBDIR@ includedir=${prefix}/include Name: LibTomCrypt diff --git a/makefile.shared b/makefile.shared index 4c7921e8a..d032a8c7b 100644 --- a/makefile.shared +++ b/makefile.shared @@ -271,6 +271,7 @@ install: $(LIBNAME) install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) install -d $(DESTDIR)$(LIBPATH)/pkgconfig + sed 's,@LIBDIR@,$(LIBPATH),g' libtomcrypt.pc.in > libtomcrypt.pc install -m 0644 -g $(GROUP) -o $(USER) libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc #This rule makes the hash program included with libtomcrypt From ed2743d5243a86aa6d870dc6ff96655657b50c95 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 2 Jan 2014 07:19:07 +0100 Subject: [PATCH 0137/1192] makefile.shared: respect LDFLAGS when linking --- makefile.shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile.shared b/makefile.shared index d032a8c7b..827575668 100644 --- a/makefile.shared +++ b/makefile.shared @@ -262,7 +262,7 @@ testprof/$(LIBTEST): objs: $(OBJECTS) $(LIBNAME): $(OBJECTS) testprof/$(LIBTEST) - libtool --silent --mode=link gcc $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) + libtool --silent --mode=link gcc $(LDFLAGS) $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) install: $(LIBNAME) install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) From 1d52f3b49b5bab0b99f0771c4735226fd90a59cd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 18:03:14 +0100 Subject: [PATCH 0138/1192] tomcrypt_custom.h: move dependency checks together --- src/headers/tomcrypt_custom.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 9a60f401e..113e44316 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -244,16 +244,9 @@ #define LTC_F9_MODE #define LTC_PELICAN -#if defined(LTC_PELICAN) && !defined(LTC_RIJNDAEL) - #error Pelican-MAC requires LTC_RIJNDAEL -#endif - /* ---> Encrypt + Authenticate Modes <--- */ #define LTC_EAX_MODE -#if defined(LTC_EAX_MODE) && !(defined(LTC_CTR_MODE) && defined(LTC_OMAC)) - #error LTC_EAX_MODE requires CTR and LTC_OMAC mode -#endif #define LTC_OCB_MODE #define LTC_OCB3_MODE @@ -285,10 +278,6 @@ #define LTC_YARROW_AES 2 #endif -#if defined(LTC_YARROW) && !defined(LTC_CTR_MODE) - #error LTC_YARROW requires LTC_CTR_MODE chaining mode to be defined! -#endif - /* a PRNG that simply reads from an available system source */ #define LTC_SPRNG @@ -425,6 +414,18 @@ #undef LTC_RSA_BLINDING #endif +#if defined(LTC_PELICAN) && !defined(LTC_RIJNDAEL) + #error Pelican-MAC requires LTC_RIJNDAEL +#endif + +#if defined(LTC_EAX_MODE) && !(defined(LTC_CTR_MODE) && defined(LTC_OMAC)) + #error LTC_EAX_MODE requires CTR and LTC_OMAC mode +#endif + +#if defined(LTC_YARROW) && !defined(LTC_CTR_MODE) + #error LTC_YARROW requires LTC_CTR_MODE chaining mode to be defined! +#endif + #if defined(LTC_DER) && !defined(MPI) #error ASN.1 DER requires MPI functionality #endif From 621a75ab280c2b04b5bb66c95763e18cce6ee14d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 18:04:29 +0100 Subject: [PATCH 0139/1192] base64: add and most important - execute tests --- testprof/base64_test.c | 45 +++++++++++++++++++++++++++++++++++++++--- testprof/misc_test.c | 3 +++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 5ce55dd5f..04381b8d2 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -3,8 +3,47 @@ int base64_test(void) { unsigned char in[64], out[256], tmp[64]; - unsigned long x, l1, l2; - + unsigned long x, l1, l2, slen1; + + /* + TEST CASES SOURCE: + + Network Working Group S. Josefsson + Request for Comments: 4648 SJD + Obsoletes: 3548 October 2006 + Category: Standards Track + */ + const struct { + const char* s; + const char* b64; + } cases[] = { + {"", "" }, + {"f", "Zg==" }, + {"fo", "Zm8=" }, + {"foo", "Zm9v" }, + {"foob", "Zm9vYg==" }, + {"fooba", "Zm9vYmE=" }, + {"foobar", "Zm9vYmFy"} + }; + + for (x = 0; x < sizeof(cases)/sizeof(cases[0]); ++x) { + slen1 = strlen(cases[x].s); + l1 = sizeof(out); + DO(base64_encode(cases[x].s, slen1, out, &l1)); + l2 = sizeof(tmp); + DO(base64_decode(out, l1, tmp, &l2)); + if (l2 != slen1 || l1 != strlen(cases[x].b64) || memcmp(tmp, cases[x].s, l2) || memcmp(out, cases[x].b64, l1)) { + fprintf(stderr, "\nbase64 failed case %lu", x); + fprintf(stderr, "\nbase64 should: %s", cases[x].b64); + out[sizeof(out)-1] = '\0'; + fprintf(stderr, "\nbase64 is: %s", out); + fprintf(stderr, "\nplain should: %s", cases[x].s); + tmp[sizeof(tmp)-1] = '\0'; + fprintf(stderr, "\nplain is: %s\n", tmp); + return 1; + } + } + for (x = 0; x < 64; x++) { yarrow_read(in, x, &yarrow_prng); l1 = sizeof(out); @@ -12,7 +51,7 @@ int base64_test(void) l2 = sizeof(tmp); DO(base64_decode(out, l1, tmp, &l2)); if (l2 != x || memcmp(tmp, in, x)) { - fprintf(stderr, "base64 failed %lu %lu %lu", x, l1, l2); + fprintf(stderr, "base64 failed %lu %lu %lu", x, l1, l2); return 1; } } diff --git a/testprof/misc_test.c b/testprof/misc_test.c index 889ab7946..242bb0132 100644 --- a/testprof/misc_test.c +++ b/testprof/misc_test.c @@ -7,6 +7,9 @@ int misc_test(void) #endif #ifdef LTC_PKCS_5 DO(pkcs_5_test()); +#endif +#ifdef LTC_BASE64 + DO(base64_test()); #endif return 0; } From 84298440f4c09008c745402183d7874affbb2741 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 21:28:16 +0100 Subject: [PATCH 0140/1192] trim trailing spaces --- src/misc/crypt/crypt.c | 10 +++++----- src/pk/ecc/ltc_ecc_projective_add_point.c | 10 +++++----- src/pk/ecc/ltc_ecc_projective_dbl_point.c | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 6a183a9ba..7bb392f49 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -13,7 +13,7 @@ /** @file crypt.c Build strings, Tom St Denis -*/ +*/ const char *crypt_build_settings = "LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n" @@ -199,7 +199,7 @@ const char *crypt_build_settings = #endif #if defined(LTC_F8_MODE) " F8 MODE\n" -#endif +#endif #if defined(LTC_XTS_MODE) " LTC_XTS_MODE\n" #endif @@ -274,7 +274,7 @@ const char *crypt_build_settings = #endif #if defined(MKAT) " Katja\n" -#endif +#endif "\nCompiler:\n" #if defined(WIN32) @@ -302,7 +302,7 @@ const char *crypt_build_settings = #endif #if defined(LTC_PPC32) " LTC_PPC32 defined \n" -#endif +#endif "\nVarious others: " #if defined(LTC_BASE64) @@ -367,7 +367,7 @@ const char *crypt_build_settings = #endif #if defined(LTC_EASY) " (easy) " -#endif +#endif #if defined(LTC_MECC_FP) " LTC_MECC_FP " #endif diff --git a/src/pk/ecc/ltc_ecc_projective_add_point.c b/src/pk/ecc/ltc_ecc_projective_add_point.c index c45a47b50..33f48574a 100644 --- a/src/pk/ecc/ltc_ecc_projective_add_point.c +++ b/src/pk/ecc/ltc_ecc_projective_add_point.c @@ -19,7 +19,7 @@ /** @file ltc_ecc_projective_add_point.c ECC Crypto, Tom St Denis -*/ +*/ #if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC)) @@ -46,11 +46,11 @@ int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void if ((err = mp_init_multi(&t1, &t2, &x, &y, &z, NULL)) != CRYPT_OK) { return err; } - + /* should we dbl instead? */ if ((err = mp_sub(modulus, Q->y, t1)) != CRYPT_OK) { goto done; } - if ( (mp_cmp(P->x, Q->x) == LTC_MP_EQ) && + if ( (mp_cmp(P->x, Q->x) == LTC_MP_EQ) && (Q->z != NULL && mp_cmp(P->z, Q->z) == LTC_MP_EQ) && (mp_cmp(P->y, Q->y) == LTC_MP_EQ || mp_cmp(P->y, t1) == LTC_MP_EQ)) { mp_clear_multi(t1, t2, x, y, z, NULL); @@ -144,7 +144,7 @@ int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void /* T1 = T1 * X */ if ((err = mp_mul(t1, x, t1)) != CRYPT_OK) { goto done; } if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } - + /* X = Y*Y */ if ((err = mp_sqr(y, x)) != CRYPT_OK) { goto done; } if ((err = mp_montgomery_reduce(x, modulus, mp)) != CRYPT_OK) { goto done; } @@ -158,7 +158,7 @@ int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void if ((err = mp_sub(t2, x, t2)) != CRYPT_OK) { goto done; } if (mp_cmp_d(t2, 0) == LTC_MP_LT) { if ((err = mp_add(t2, modulus, t2)) != CRYPT_OK) { goto done; } - } + } /* T2 = T2 - X */ if ((err = mp_sub(t2, x, t2)) != CRYPT_OK) { goto done; } if (mp_cmp_d(t2, 0) == LTC_MP_LT) { diff --git a/src/pk/ecc/ltc_ecc_projective_dbl_point.c b/src/pk/ecc/ltc_ecc_projective_dbl_point.c index ce31ccc28..a09e85bc2 100644 --- a/src/pk/ecc/ltc_ecc_projective_dbl_point.c +++ b/src/pk/ecc/ltc_ecc_projective_dbl_point.c @@ -19,7 +19,7 @@ /** @file ltc_ecc_projective_dbl_point.c ECC Crypto, Tom St Denis -*/ +*/ #if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC)) @@ -62,7 +62,7 @@ int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void if (mp_cmp(R->z, modulus) != LTC_MP_LT) { if ((err = mp_sub(R->z, modulus, R->z)) != CRYPT_OK) { goto done; } } - + /* T2 = X - T1 */ if ((err = mp_sub(R->x, t1, t2)) != CRYPT_OK) { goto done; } if (mp_cmp_d(t2, 0) == LTC_MP_LT) { @@ -121,7 +121,7 @@ int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void if ((err = mp_add(R->x, modulus, R->x)) != CRYPT_OK) { goto done; } } - /* Y = Y - X */ + /* Y = Y - X */ if ((err = mp_sub(R->y, R->x, R->y)) != CRYPT_OK) { goto done; } if (mp_cmp_d(R->y, 0) == LTC_MP_LT) { if ((err = mp_add(R->y, modulus, R->y)) != CRYPT_OK) { goto done; } @@ -134,7 +134,7 @@ int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void if (mp_cmp_d(R->y, 0) == LTC_MP_LT) { if ((err = mp_add(R->y, modulus, R->y)) != CRYPT_OK) { goto done; } } - + err = CRYPT_OK; done: mp_clear_multi(t1, t2, NULL); From 0aee5f3217f475f1418ec636d552133285bc1f57 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 21:29:40 +0100 Subject: [PATCH 0141/1192] fix wrong spelled macros --- src/headers/tomcrypt_custom.h | 2 +- src/headers/tomcrypt_pk.h | 2 +- src/misc/crypt/crypt.c | 6 +++--- src/pk/ecc/ltc_ecc_projective_add_point.c | 2 +- src/pk/ecc/ltc_ecc_projective_dbl_point.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 113e44316..6518b2a8d 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -344,7 +344,7 @@ /* use Shamir's trick for point mul (speeds up signature verification) */ #define LTC_ECC_SHAMIR -#if defined(TFM_LTC_DESC) && defined(LTC_MECC) +#if defined(TFM_DESC) && defined(LTC_MECC) #define LTC_MECC_ACCEL #endif diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index e1a915219..f8dd6c6db 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -314,7 +314,7 @@ void ltc_ecc_del_point(ecc_point *p); int ltc_ecc_is_valid_idx(int n); /* point ops (mp == montgomery digit) */ -#if !defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC) || defined(GMP_LTC_DESC) +#if !defined(LTC_MECC_ACCEL) || defined(LTM_DESC) || defined(GMP_DESC) /* R = 2P */ int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *mp); diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 7bb392f49..fdfe13ee4 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -353,16 +353,16 @@ const char *crypt_build_settings = #if defined(LTC_PTHREAD) " LTC_PTHREAD " #endif -#if defined(LTM_LTC_DESC) +#if defined(LTM_DESC) " LTM_DESC " #endif -#if defined(TFM_LTC_DESC) +#if defined(TFM_DESC) " TFM_DESC " #endif #if defined(LTC_MECC_ACCEL) " LTC_MECC_ACCEL " #endif -#if defined(GMP_LTC_DESC) +#if defined(GMP_DESC) " GMP_DESC " #endif #if defined(LTC_EASY) diff --git a/src/pk/ecc/ltc_ecc_projective_add_point.c b/src/pk/ecc/ltc_ecc_projective_add_point.c index 33f48574a..aa257db83 100644 --- a/src/pk/ecc/ltc_ecc_projective_add_point.c +++ b/src/pk/ecc/ltc_ecc_projective_add_point.c @@ -21,7 +21,7 @@ ECC Crypto, Tom St Denis */ -#if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC)) +#if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_DESC)) /** Add two ECC points diff --git a/src/pk/ecc/ltc_ecc_projective_dbl_point.c b/src/pk/ecc/ltc_ecc_projective_dbl_point.c index a09e85bc2..c4920705a 100644 --- a/src/pk/ecc/ltc_ecc_projective_dbl_point.c +++ b/src/pk/ecc/ltc_ecc_projective_dbl_point.c @@ -21,7 +21,7 @@ ECC Crypto, Tom St Denis */ -#if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC)) +#if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_DESC)) /** Double an ECC point From 561fe83532aa2a1e612c49ccca890d4db5180b7a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 21:42:29 +0100 Subject: [PATCH 0142/1192] fix strict-aliasing compiler warnings --- src/headers/tomcrypt_cfg.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index c797cf819..d573580a2 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -60,7 +60,6 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define ENDIAN_LITTLE #define ENDIAN_32BITWORD #define LTC_FAST - #define LTC_FAST_TYPE unsigned long #endif /* detects MIPS R5900 processors (PS2) */ @@ -74,7 +73,6 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define ENDIAN_LITTLE #define ENDIAN_64BITWORD #define LTC_FAST - #define LTC_FAST_TYPE unsigned long #endif /* detect PPC32 */ @@ -82,9 +80,16 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define ENDIAN_BIG #define ENDIAN_32BITWORD #define LTC_FAST - #define LTC_FAST_TYPE unsigned long #endif +#ifdef LTC_FAST +#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc */ +#error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway +#else +typedef unsigned int __attribute__((__may_alias__)) LTC_FAST_TYPE; +#endif +#endif /* LTC_FAST */ + /* detect sparc and sparc64 */ #if defined(__sparc__) #define ENDIAN_BIG From e027dda26f5ad71d3d033e23e844f542d26fde71 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 12 Mar 2014 10:53:23 +0200 Subject: [PATCH 0143/1192] travis: add "after_failure" section --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5f6fe2b48..3ac670b5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,9 @@ branches: - develop before_script: - sudo apt-get install libtommath-dev +after_failure: + - cat test_std.txt + - cat test_err.txt after_script: - cat gcc_2.txt notifications: From 1f7cf9dc0b0128147337529ee345f9dbe9047326 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Apr 2014 15:05:56 +0200 Subject: [PATCH 0144/1192] move typedefs from tomcrypt_macros.h to tomcrypt_cfg.h --- src/headers/tomcrypt_cfg.h | 18 ++++++++++++++++++ src/headers/tomcrypt_macros.h | 17 ----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index d573580a2..82be01bf8 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -90,6 +90,24 @@ typedef unsigned int __attribute__((__may_alias__)) LTC_FAST_TYPE; #endif #endif /* LTC_FAST */ +/* fix for MSVC ...evil! */ +#ifdef _MSC_VER + #define CONST64(n) n ## ui64 + typedef unsigned __int64 ulong64; +#else + #define CONST64(n) n ## ULL + typedef unsigned long long ulong64; +#endif + +/* this is the "32-bit at least" data type + * Re-define it to suit your platform but it must be at least 32-bits + */ +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) + typedef unsigned ulong32; +#else + typedef unsigned long ulong32; +#endif + /* detect sparc and sparc64 */ #if defined(__sparc__) #define ENDIAN_BIG diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index d56764fcf..deea16cdb 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -1,20 +1,3 @@ -/* fix for MSVC ...evil! */ -#ifdef _MSC_VER - #define CONST64(n) n ## ui64 - typedef unsigned __int64 ulong64; -#else - #define CONST64(n) n ## ULL - typedef unsigned long long ulong64; -#endif - -/* this is the "32-bit at least" data type - * Re-define it to suit your platform but it must be at least 32-bits - */ -#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) - typedef unsigned ulong32; -#else - typedef unsigned long ulong32; -#endif /* ---- HELPER MACROS ---- */ #ifdef ENDIAN_NEUTRAL From 53f04b8e6b9cee1fbc213433f42d1c9e288cb65e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Apr 2014 15:06:56 +0200 Subject: [PATCH 0145/1192] only use ulong32 or ulong64 in the macros --- src/headers/tomcrypt_macros.h | 64 +++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index deea16cdb..5a5f51323 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -7,10 +7,10 @@ (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } #define LOAD32L(x, y) \ - { x = ((unsigned long)((y)[3] & 255)<<24) | \ - ((unsigned long)((y)[2] & 255)<<16) | \ - ((unsigned long)((y)[1] & 255)<<8) | \ - ((unsigned long)((y)[0] & 255)); } + { x = ((ulong32)((y)[3] & 255)<<24) | \ + ((ulong32)((y)[2] & 255)<<16) | \ + ((ulong32)((y)[1] & 255)<<8) | \ + ((ulong32)((y)[0] & 255)); } #define STORE64L(x, y) \ { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ @@ -29,10 +29,10 @@ (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } #define LOAD32H(x, y) \ - { x = ((unsigned long)((y)[0] & 255)<<24) | \ - ((unsigned long)((y)[1] & 255)<<16) | \ - ((unsigned long)((y)[2] & 255)<<8) | \ - ((unsigned long)((y)[3] & 255)); } + { x = ((ulong32)((y)[0] & 255)<<24) | \ + ((ulong32)((y)[1] & 255)<<16) | \ + ((ulong32)((y)[2] & 255)<<8) | \ + ((ulong32)((y)[3] & 255)); } #define STORE64H(x, y) \ { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ @@ -82,10 +82,10 @@ asm __volatile__ ( \ (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } #define LOAD32H(x, y) \ - { x = ((unsigned long)((y)[0] & 255)<<24) | \ - ((unsigned long)((y)[1] & 255)<<16) | \ - ((unsigned long)((y)[2] & 255)<<8) | \ - ((unsigned long)((y)[3] & 255)); } + { x = ((ulong32)((y)[0] & 255)<<24) | \ + ((ulong32)((y)[1] & 255)<<16) | \ + ((ulong32)((y)[2] & 255)<<8) | \ + ((ulong32)((y)[3] & 255)); } #endif @@ -175,10 +175,10 @@ asm __volatile__ ( \ (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } #define LOAD32L(x, y) \ - { x = ((unsigned long)((y)[3] & 255)<<24) | \ - ((unsigned long)((y)[2] & 255)<<16) | \ - ((unsigned long)((y)[1] & 255)<<8) | \ - ((unsigned long)((y)[0] & 255)); } + { x = ((ulong32)((y)[3] & 255)<<24) | \ + ((ulong32)((y)[2] & 255)<<16) | \ + ((ulong32)((y)[1] & 255)<<8) | \ + ((ulong32)((y)[0] & 255)); } #define STORE64L(x, y) \ { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ @@ -246,7 +246,7 @@ asm __volatile__ ( \ #elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM) -static inline unsigned ROL(unsigned word, int i) +static inline ulong32 ROL(ulong32 word, int i) { asm ("roll %%cl,%0" :"=r" (word) @@ -254,7 +254,7 @@ static inline unsigned ROL(unsigned word, int i) return word; } -static inline unsigned ROR(unsigned word, int i) +static inline ulong32 ROR(ulong32 word, int i) { asm ("rorl %%cl,%0" :"=r" (word) @@ -264,7 +264,7 @@ static inline unsigned ROR(unsigned word, int i) #ifndef LTC_NO_ROLC -static inline unsigned ROLc(unsigned word, const int i) +static inline ulong32 ROLc(ulong32 word, const int i) { asm ("roll %2,%0" :"=r" (word) @@ -272,7 +272,7 @@ static inline unsigned ROLc(unsigned word, const int i) return word; } -static inline unsigned RORc(unsigned word, const int i) +static inline ulong32 RORc(ulong32 word, const int i) { asm ("rorl %2,%0" :"=r" (word) @@ -289,7 +289,7 @@ static inline unsigned RORc(unsigned word, const int i) #elif !defined(__STRICT_ANSI__) && defined(LTC_PPC32) -static inline unsigned ROL(unsigned word, int i) +static inline ulong32 ROL(ulong32 word, int i) { asm ("rotlw %0,%0,%2" :"=r" (word) @@ -297,7 +297,7 @@ static inline unsigned ROL(unsigned word, int i) return word; } -static inline unsigned ROR(unsigned word, int i) +static inline ulong32 ROR(ulong32 word, int i) { asm ("rotlw %0,%0,%2" :"=r" (word) @@ -307,7 +307,7 @@ static inline unsigned ROR(unsigned word, int i) #ifndef LTC_NO_ROLC -static inline unsigned ROLc(unsigned word, const int i) +static inline ulong32 ROLc(ulong32 word, const int i) { asm ("rotlwi %0,%0,%2" :"=r" (word) @@ -315,7 +315,7 @@ static inline unsigned ROLc(unsigned word, const int i) return word; } -static inline unsigned RORc(unsigned word, const int i) +static inline ulong32 RORc(ulong32 word, const int i) { asm ("rotrwi %0,%0,%2" :"=r" (word) @@ -334,10 +334,10 @@ static inline unsigned RORc(unsigned word, const int i) #else /* rotates the hard way */ -#define ROL(x, y) ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) -#define ROR(x, y) ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) -#define ROLc(x, y) ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) -#define RORc(x, y) ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) +#define ROL(x, y) ( (((ulong32)(x)<<(ulong32)((y)&31)) | (((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)(32-((y)&31)))) & 0xFFFFFFFFUL) +#define ROR(x, y) ( ((((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((y)&31)) | ((ulong32)(x)<<(ulong32)(32-((y)&31)))) & 0xFFFFFFFFUL) +#define ROLc(x, y) ( (((ulong32)(x)<<(ulong32)((y)&31)) | (((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)(32-((y)&31)))) & 0xFFFFFFFFUL) +#define RORc(x, y) ( ((((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((y)&31)) | ((ulong32)(x)<<(ulong32)(32-((y)&31)))) & 0xFFFFFFFFUL) #endif @@ -345,7 +345,7 @@ static inline unsigned RORc(unsigned word, const int i) /* 64-bit Rotates */ #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM) -static inline unsigned long ROL64(unsigned long word, int i) +static inline ulong64 ROL64(ulong64 word, int i) { asm("rolq %%cl,%0" :"=r" (word) @@ -353,7 +353,7 @@ static inline unsigned long ROL64(unsigned long word, int i) return word; } -static inline unsigned long ROR64(unsigned long word, int i) +static inline ulong64 ROR64(ulong64 word, int i) { asm("rorq %%cl,%0" :"=r" (word) @@ -363,7 +363,7 @@ static inline unsigned long ROR64(unsigned long word, int i) #ifndef LTC_NO_ROLC -static inline unsigned long ROL64c(unsigned long word, const int i) +static inline ulong64 ROL64c(ulong64 word, const int i) { asm("rolq %2,%0" :"=r" (word) @@ -371,7 +371,7 @@ static inline unsigned long ROL64c(unsigned long word, const int i) return word; } -static inline unsigned long ROR64c(unsigned long word, const int i) +static inline ulong64 ROR64c(ulong64 word, const int i) { asm("rorq %2,%0" :"=r" (word) From 68bfdd0fac9a48c080cca3e4efab328360d47e2c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Apr 2014 15:08:17 +0200 Subject: [PATCH 0146/1192] move mac_test() before modes_test() since lrw uses gcm it makes sense to fail already at gcm --- demos/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/test.c b/demos/test.c index 0d26b957b..e9c9a9073 100644 --- a/demos/test.c +++ b/demos/test.c @@ -20,9 +20,9 @@ int main(void) printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nmisc_test...."); fflush(stdout); x = misc_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nmodes_test...."); fflush(stdout); x = modes_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nder_test......"); fflush(stdout); x = der_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ndh_test......."); fflush(stdout); x = dh_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); From ffeb70b48a13ef5b669ab5b5b6238392efcb5bd2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Apr 2014 22:22:01 +0200 Subject: [PATCH 0147/1192] fix typedef of LTC_FAST_TYPE on x86_64 --- src/headers/tomcrypt_cfg.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 82be01bf8..8b06b1402 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -82,14 +82,6 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define LTC_FAST #endif -#ifdef LTC_FAST -#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc */ -#error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway -#else -typedef unsigned int __attribute__((__may_alias__)) LTC_FAST_TYPE; -#endif -#endif /* LTC_FAST */ - /* fix for MSVC ...evil! */ #ifdef _MSC_VER #define CONST64(n) n ## ui64 @@ -108,6 +100,18 @@ typedef unsigned int __attribute__((__may_alias__)) LTC_FAST_TYPE; typedef unsigned long ulong32; #endif +#ifdef LTC_FAST +#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc */ +#error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway +#else +#ifdef ENDIAN_64BITWORD +typedef ulong64 __attribute__((__may_alias__)) LTC_FAST_TYPE; +#else +typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; +#endif +#endif +#endif /* LTC_FAST */ + /* detect sparc and sparc64 */ #if defined(__sparc__) #define ENDIAN_BIG From cbd59421bd50b4e665386be72e38472525687baf Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 19:18:52 +0100 Subject: [PATCH 0148/1192] protect all tables by an ifdef; adjust safer to the same concept --- src/ciphers/aes/aes.c | 1 + src/ciphers/aes/aes_tab.c | 4 ++++ src/ciphers/safer/safer.c | 4 +++- src/ciphers/safer/safer_tab.c | 10 ++++------ src/ciphers/safer/saferp.c | 5 +++-- src/ciphers/twofish/twofish.c | 1 + src/ciphers/twofish/twofish_tab.c | 2 ++ src/hashes/whirl/whirl.c | 1 + src/hashes/whirl/whirltab.c | 4 ++++ src/mac/pelican/pelican.c | 1 + src/prngs/sober128.c | 1 + src/prngs/sober128tab.c | 5 +++++ 12 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index 4ff1d24f5..29d7ed2e0 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -88,6 +88,7 @@ const struct ltc_cipher_descriptor aes_enc_desc = #endif +#define __LTC_AES_TAB_C__ #include "aes_tab.c" static ulong32 setup_mix(ulong32 temp) diff --git a/src/ciphers/aes/aes_tab.c b/src/ciphers/aes/aes_tab.c index 1c3de7051..9c902e88d 100644 --- a/src/ciphers/aes/aes_tab.c +++ b/src/ciphers/aes/aes_tab.c @@ -23,6 +23,8 @@ Td3[x] = Si[x].[09, 0d, 0b, 0e]; Td4[x] = Si[x].[01, 01, 01, 01]; */ +#ifdef __LTC_AES_TAB_C__ + /** @file aes_tab.c AES tables @@ -1023,6 +1025,8 @@ static const ulong32 rcon[] = { 0x1B000000UL, 0x36000000UL, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ }; +#endif /* __LTC_AES_TAB_C__ */ + /* $Source$ */ /* $Revision$ */ /* $Date$ */ diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index dcfd65515..94435de8b 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -32,6 +32,9 @@ #ifdef LTC_SAFER +#define __LTC_SAFER_TAB_C__ +#include "safer_tab.c" + const struct ltc_cipher_descriptor safer_k64_desc = { "safer-k64", @@ -95,7 +98,6 @@ const struct ltc_cipher_descriptor #define IPHT(x, y) { x -= y; y -= x; } /******************* Types ****************************************************/ -extern const unsigned char safer_ebox[], safer_lbox[]; #ifdef LTC_CLEAN_STACK static void _Safer_Expand_Userkey(const unsigned char *userkey_1, diff --git a/src/ciphers/safer/safer_tab.c b/src/ciphers/safer/safer_tab.c index 4740caaf0..308fe55be 100644 --- a/src/ciphers/safer/safer_tab.c +++ b/src/ciphers/safer/safer_tab.c @@ -14,13 +14,11 @@ Tables for LTC_SAFER block ciphers */ -#include "tomcrypt.h" - -#if defined(LTC_SAFERP) || defined(LTC_SAFER) +#ifdef __LTC_SAFER_TAB_C__ /* This is the box defined by ebox[x] = 45^x mod 257. * Its assumed that the value "256" corresponds to zero. */ -const unsigned char safer_ebox[256] = { +static const unsigned char safer_ebox[256] = { 1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63, 8, 103, 9, 148, 235, 38, 168, 107, 189, 24, 52, 27, 187, 191, 114, 247, 64, 53, 72, 156, 81, 47, 59, 85, 227, 192, 159, 216, 211, 243, 141, 177, @@ -40,7 +38,7 @@ const unsigned char safer_ebox[256] = { }; /* This is the inverse of ebox or the base 45 logarithm */ -const unsigned char safer_lbox[256] = { +static const unsigned char safer_lbox[256] = { 128, 0, 176, 9, 96, 239, 185, 253, 16, 18, 159, 228, 105, 186, 173, 248, 192, 56, 194, 101, 79, 6, 148, 252, 25, 222, 106, 27, 93, 78, 168, 130, 112, 237, 232, 236, 114, 179, 21, 195, 255, 171, 182, 71, 68, 1, 172, 37, @@ -59,7 +57,7 @@ const unsigned char safer_lbox[256] = { 184, 64, 120, 45, 58, 233, 100, 31, 146, 144, 125, 57, 111, 224, 137, 48 }; -#endif +#endif /* __LTC_SAFER_TAB_C__ */ diff --git a/src/ciphers/safer/saferp.c b/src/ciphers/safer/saferp.c index a9e9980a5..9d384da75 100644 --- a/src/ciphers/safer/saferp.c +++ b/src/ciphers/safer/saferp.c @@ -17,6 +17,9 @@ #ifdef LTC_SAFERP +#define __LTC_SAFER_TAB_C__ +#include "safer_tab.c" + const struct ltc_cipher_descriptor saferp_desc = { "safer+", @@ -42,8 +45,6 @@ const struct ltc_cipher_descriptor saferp_desc = * array of 16 bytes b[0..15] which is the block of data */ -extern const unsigned char safer_ebox[], safer_lbox[]; - #define ROUND(b, i) \ b[0] = (safer_ebox[(b[0] ^ skey->saferp.K[i][0]) & 255] + skey->saferp.K[i+1][0]) & 255; \ b[1] = safer_lbox[(b[1] + skey->saferp.K[i][1]) & 255] ^ skey->saferp.K[i+1][1]; \ diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index 44b4b6b47..6fc2c8ec9 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -62,6 +62,7 @@ static const unsigned char qord[4][5] = { #ifdef LTC_TWOFISH_TABLES +#define __LTC_TWOFISH_TAB_C__ #include "twofish_tab.c" #define sbox(i, x) ((ulong32)SBOX[i][(x)&255]) diff --git a/src/ciphers/twofish/twofish_tab.c b/src/ciphers/twofish/twofish_tab.c index 9f46006af..7ea858661 100644 --- a/src/ciphers/twofish/twofish_tab.c +++ b/src/ciphers/twofish/twofish_tab.c @@ -14,6 +14,7 @@ Twofish tables, Tom St Denis */ #ifdef LTC_TWOFISH_TABLES +#ifdef __LTC_TWOFISH_TAB_C__ /* pre generated 8x8 tables from the four 4x4s */ static const unsigned char SBOX[2][256] = { @@ -489,6 +490,7 @@ static const ulong32 rs_tab7[256] = { #endif /* LTC_TWOFISH_ALL_TABLES */ +#endif /* __LTC_TWOFISH_TAB_C__ */ #endif /* $Source$ */ diff --git a/src/hashes/whirl/whirl.c b/src/hashes/whirl/whirl.c index 1ae716fc3..af5625a7e 100644 --- a/src/hashes/whirl/whirl.c +++ b/src/hashes/whirl/whirl.c @@ -37,6 +37,7 @@ const struct ltc_hash_descriptor whirlpool_desc = }; /* the sboxes */ +#define __LTC_WHIRLTAB_C__ #include "whirltab.c" /* get a_{i,j} */ diff --git a/src/hashes/whirl/whirltab.c b/src/hashes/whirl/whirltab.c index ff5c77293..bb4b77ab2 100644 --- a/src/hashes/whirl/whirltab.c +++ b/src/hashes/whirl/whirltab.c @@ -2,6 +2,9 @@ @file whirltab.c LTC_WHIRLPOOL tables, Tom St Denis */ + +#ifdef __LTC_WHIRLTAB_C__ + static const ulong64 sbox0[] = { CONST64(0x18186018c07830d8), CONST64(0x23238c2305af4626), CONST64(0xc6c63fc67ef991b8), CONST64(0xe8e887e8136fcdfb), CONST64(0x878726874ca113cb), CONST64(0xb8b8dab8a9626d11), CONST64(0x0101040108050209), CONST64(0x4f4f214f426e9e0d), @@ -577,6 +580,7 @@ CONST64(0xca2dbf07ad5a8333), CONST64(0x6302aa71c81949d9), }; +#endif /* __LTC_WHIRLTAB_C__ */ /* $Source$ */ /* $Revision$ */ diff --git a/src/mac/pelican/pelican.c b/src/mac/pelican/pelican.c index ecdb9aeaa..8622f55f1 100644 --- a/src/mac/pelican/pelican.c +++ b/src/mac/pelican/pelican.c @@ -17,6 +17,7 @@ #ifdef LTC_PELICAN +#define __LTC_AES_TAB_C__ #define ENCRYPT_ONLY #define PELI_TAB #include "../../ciphers/aes/aes_tab.c" diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index 1d5b267a7..7a45e1b5e 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -18,6 +18,7 @@ #ifdef LTC_SOBER128 +#define __LTC_SOBER128TAB_C__ #include "sober128tab.c" const struct ltc_prng_descriptor sober128_desc = diff --git a/src/prngs/sober128tab.c b/src/prngs/sober128tab.c index 674a35530..74e4f8808 100644 --- a/src/prngs/sober128tab.c +++ b/src/prngs/sober128tab.c @@ -2,6 +2,9 @@ @file sober128tab.c SOBER-128 Tables */ + +#ifdef __LTC_SOBER128TAB_C__ + /* $ID$ */ /* @(#)TuringMultab.h 1.3 (QUALCOMM) 02/09/03 */ /* Multiplication table for Turing using 0xD02B4367 */ @@ -157,6 +160,8 @@ static const ulong32 Sbox[256] = { 0xf9e6053f, 0xa4b0d300, 0xd499cbcc, 0xb95e3d40, }; +#endif /* __LTC_SOBER128TAB_C__ */ + /* $Source$ */ /* $Revision$ */ /* $Date$ */ From f3cdac05ec6b6e265d87987850af2dd166c6b625 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 20:38:42 +0100 Subject: [PATCH 0149/1192] sha2: remove including of c-files --- src/hashes/sha2/sha224.c | 6 ++++++ src/hashes/sha2/sha256.c | 4 ---- src/hashes/sha2/sha384.c | 9 +++++---- src/hashes/sha2/sha512.c | 4 ---- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/hashes/sha2/sha224.c b/src/hashes/sha2/sha224.c index c0bfdcb8a..2240aaf73 100644 --- a/src/hashes/sha2/sha224.c +++ b/src/hashes/sha2/sha224.c @@ -13,6 +13,10 @@ LTC_SHA-224 new NIST standard based off of LTC_SHA-256 truncated to 224 bits (Tom St Denis) */ +#include "tomcrypt.h" + +#if defined(LTC_SHA224) && defined(LTC_SHA256) + const struct ltc_hash_descriptor sha224_desc = { "sha224", @@ -119,6 +123,8 @@ int sha224_test(void) #endif } +#endif /* defined(LTC_SHA224) && defined(LTC_SHA256) */ + /* $Source$ */ /* $Revision$ */ diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index ad1386a55..251ee6d52 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -327,10 +327,6 @@ int sha256_test(void) #endif } -#ifdef LTC_SHA224 -#include "sha224.c" -#endif - #endif diff --git a/src/hashes/sha2/sha384.c b/src/hashes/sha2/sha384.c index 3e3ce5754..483784b02 100644 --- a/src/hashes/sha2/sha384.c +++ b/src/hashes/sha2/sha384.c @@ -13,6 +13,10 @@ LTC_SHA384 hash included in sha512.c, Tom St Denis */ +#include "tomcrypt.h" + +#if defined(LTC_SHA384) && defined(LTC_SHA512) + const struct ltc_hash_descriptor sha384_desc = { "sha384", @@ -125,10 +129,7 @@ int sha384_test(void) #endif } - - - - +#endif /* defined(LTC_SHA384) && defined(LTC_SHA512) */ /* $Source$ */ /* $Revision$ */ diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index 4b7e7612f..2d6841624 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -305,10 +305,6 @@ int sha512_test(void) #endif } -#ifdef LTC_SHA384 - #include "sha384.c" -#endif - #endif From 71ccad06bd0b221e4e8506eca6ef54ed61025773 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 21:04:34 +0100 Subject: [PATCH 0150/1192] dh: remove unused variables --- src/pk/dh/dh_sys.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pk/dh/dh_sys.c b/src/pk/dh/dh_sys.c index e46468664..8c718d95a 100644 --- a/src/pk/dh/dh_sys.c +++ b/src/pk/dh/dh_sys.c @@ -33,7 +33,7 @@ int dh_encrypt_key(const unsigned char *in, unsigned long inlen, { unsigned char *pub_expt, *dh_shared, *skey; dh_key pubkey; - unsigned long x, y, z, hashsize, pubkeysize; + unsigned long x, y, z, pubkeysize; int err; LTC_ARGCHK(in != NULL); @@ -89,9 +89,6 @@ int dh_encrypt_key(const unsigned char *in, unsigned long inlen, goto LBL_ERR; } - /* make random key */ - hashsize = hash_descriptor[hash].hashsize; - x = DH_BUF_SIZE; if ((err = dh_shared_secret(&pubkey, key, dh_shared, &x)) != CRYPT_OK) { dh_free(&pubkey); @@ -158,7 +155,7 @@ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, dh_key *key) { unsigned char *shared_secret, *skey; - unsigned long x, y, z, hashsize, keysize; + unsigned long x, y, z, keysize; int hash, err; dh_key pubkey; @@ -206,9 +203,6 @@ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, goto LBL_ERR; } - /* common values */ - hashsize = hash_descriptor[hash].hashsize; - /* get public key */ LOAD32L(x, in+y); From 2bdebb3932a0ddae543febdefb5c052eaf97c5cb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 21:43:33 +0100 Subject: [PATCH 0151/1192] dh: remove including of c-files --- src/pk/dh/dh.c | 233 +----------------------------------------- src/pk/dh/dh_static.c | 163 +++++++++++++++++++++++++++++ src/pk/dh/dh_static.h | 125 ++++++++++++++++++++++ src/pk/dh/dh_sys.c | 10 +- 4 files changed, 301 insertions(+), 230 deletions(-) create mode 100644 src/pk/dh/dh_static.c create mode 100644 src/pk/dh/dh_static.h diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index 6781fd44a..d2b970bea 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -17,231 +17,8 @@ #ifdef LTC_MDH - /* size of a packet header in bytes */ - #define PACKET_SIZE 4 - - /* Section tags */ - #define PACKET_SECT_DH 1 - - /* Subsection Tags for the first three sections */ - #define PACKET_SUB_KEY 0 - #define PACKET_SUB_ENCRYPTED 1 - #define PACKET_SUB_SIGNED 2 - #define PACKET_SUB_ENC_KEY 3 - -#define OUTPUT_BIGNUM(num, out, y, z) \ -{ \ - if ((y + 4) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ - z = (unsigned long)mp_unsigned_bin_size(num); \ - STORE32L(z, out+y); \ - y += 4; \ - if ((y + z) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ - if ((err = mp_to_unsigned_bin(num, out+y)) != CRYPT_OK) { return err; } \ - y += z; \ -} - -#define INPUT_BIGNUM(num, in, x, y, inlen) \ -{ \ - /* load value */ \ - if ((y + 4) > inlen) { \ - err = CRYPT_INVALID_PACKET; \ - goto error; \ - } \ - LOAD32L(x, in+y); \ - y += 4; \ - \ - /* sanity check... */ \ - if ((x+y) > inlen) { \ - err = CRYPT_INVALID_PACKET; \ - goto error; \ - } \ - \ - /* load it */ \ - if ((err = mp_read_unsigned_bin(num, (unsigned char *)in+y, (int)x)) != CRYPT_OK) {\ - goto error; \ - } \ - y += x; \ -} - -static void packet_store_header(unsigned char *dst, int section, int subsection) -{ - LTC_ARGCHK(dst != NULL); - - /* store version number */ - dst[0] = (unsigned char)(CRYPT&255); - dst[1] = (unsigned char)((CRYPT>>8)&255); - - /* store section and subsection */ - dst[2] = (unsigned char)(section & 255); - dst[3] = (unsigned char)(subsection & 255); - -} - -static int packet_valid_header(unsigned char *src, int section, int subsection) -{ - unsigned long ver; - - LTC_ARGCHK(src != NULL); - - /* check version */ - ver = ((unsigned long)src[0]) | ((unsigned long)src[1] << 8U); - if (CRYPT < ver) { - return CRYPT_INVALID_PACKET; - } - /* check section and subsection */ - if (section != (int)src[2] || subsection != (int)src[3]) { - return CRYPT_INVALID_PACKET; - } - - return CRYPT_OK; -} - - -/* max export size we'll encounter (smaller than this but lets round up a bit) */ -#define DH_BUF_SIZE 1200 - -/* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ -static const struct { - int size; - char *name, *base, *prime; -} sets[] = { -#ifdef DH768 -{ - 96, - "DH-768", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "//////m3wvV" -}, -#endif -#ifdef DH1024 -{ - 128, - "DH-1024", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////m3C47" -}, -#endif -#ifdef DH1280 -{ - 160, - "DH-1280", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "//////////////////////////////m4kSN" -}, -#endif -#ifdef DH1536 -{ - 192, - "DH-1536", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////m5uqd" -}, -#endif -#ifdef DH1792 -{ - 224, - "DH-1792", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "//////////////////////////////////////////////////////mT/sd" -}, -#endif -#ifdef DH2048 -{ - 256, - "DH-2048", - "4", - "3///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "/////////////////////////////////////////m8MPh" -}, -#endif -#ifdef DH2560 -{ - 320, - "DH-2560", - "4", - "3///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "/////mKFpF" -}, -#endif -#ifdef DH3072 -{ - 384, - "DH-3072", - "4", - "3///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "/////////////////////////////m32nN" -}, -#endif -#ifdef DH4096 -{ - 512, - "DH-4096", - "4", - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "/////////////////////m8pOF" -}, -#endif -{ - 0, - NULL, - NULL, - NULL -} -}; - -static int is_valid_idx(int n) -{ - int x; - - for (x = 0; sets[x].size; x++); - if ((n < 0) || (n >= x)) { - return 0; - } - return 1; -} +#include "dh_static.h" /** Test the DH sub-system (can take a while) @@ -318,7 +95,7 @@ void dh_sizes(int *low, int *high) int dh_get_size(dh_key *key) { LTC_ARGCHK(key != NULL); - if (is_valid_idx(key->idx) == 1) { + if (dh_is_valid_idx(key->idx) == 1) { return sets[key->idx].size; } else { return INT_MAX; /* large value that would cause dh_make_key() to fail */ @@ -523,7 +300,7 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) } /* is the key idx valid? */ - if (is_valid_idx(key->idx) != 1) { + if (dh_is_valid_idx(key->idx) != 1) { err = CRYPT_PK_TYPE_MISMATCH; goto error; } @@ -601,6 +378,4 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, return err; } -#include "dh_sys.c" - -#endif +#endif /* LTC_MDH */ diff --git a/src/pk/dh/dh_static.c b/src/pk/dh/dh_static.c new file mode 100644 index 000000000..043d3b1f6 --- /dev/null +++ b/src/pk/dh/dh_static.c @@ -0,0 +1,163 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org + */ +#include "tomcrypt.h" + +/** + @file dh_static.c + DH crypto, Tom St Denis +*/ + +#ifdef LTC_MDH + +#define __DECL_DH_STATIC_H__ +#include "dh_static.h" + +/* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ +const dh_set sets[] = { +#ifdef DH768 +{ + 96, + "DH-768", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "//////m3wvV" +}, +#endif +#ifdef DH1024 +{ + 128, + "DH-1024", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////m3C47" +}, +#endif +#ifdef DH1280 +{ + 160, + "DH-1280", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "//////////////////////////////m4kSN" +}, +#endif +#ifdef DH1536 +{ + 192, + "DH-1536", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////m5uqd" +}, +#endif +#ifdef DH1792 +{ + 224, + "DH-1792", + "4", + "F///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "//////////////////////////////////////////////////////mT/sd" +}, +#endif +#ifdef DH2048 +{ + 256, + "DH-2048", + "4", + "3///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "/////////////////////////////////////////m8MPh" +}, +#endif +#ifdef DH2560 +{ + 320, + "DH-2560", + "4", + "3///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "/////mKFpF" +}, +#endif +#ifdef DH3072 +{ + 384, + "DH-3072", + "4", + "3///////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "/////////////////////////////m32nN" +}, +#endif +#ifdef DH4096 +{ + 512, + "DH-4096", + "4", + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "////////////////////////////////////////////////////////////" + "/////////////////////m8pOF" +}, +#endif +{ + 0, + NULL, + NULL, + NULL +} +}; + +int dh_is_valid_idx(int n) +{ + int x; + + for (x = 0; sets[x].size; x++); + if ((n < 0) || (n >= x)) { + return 0; + } + return 1; +} + + +#endif /* LTC_MDH */ diff --git a/src/pk/dh/dh_static.h b/src/pk/dh/dh_static.h new file mode 100644 index 000000000..6473c3eb0 --- /dev/null +++ b/src/pk/dh/dh_static.h @@ -0,0 +1,125 @@ +#ifndef __DH_STATIC_H__ +#define __DH_STATIC_H__ +#ifndef __DECL_DH_STATIC_H__ +#define __DECL_DH_STATIC_H__ extern +#endif + +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org + */ +#include "tomcrypt.h" + +/** + @file dh_static.h + DH crypto, Tom St Denis +*/ + +#ifdef LTC_MDH + +/* size of a packet header in bytes */ +#define PACKET_SIZE 4 + +/* Section tags */ +#define PACKET_SECT_DH 1 + +/* Subsection Tags for the first three sections */ +#define PACKET_SUB_KEY 0 +#define PACKET_SUB_ENCRYPTED 1 +#define PACKET_SUB_SIGNED 2 +#define PACKET_SUB_ENC_KEY 3 + +#define OUTPUT_BIGNUM(num, out, y, z) \ +{ \ + if ((y + 4) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ + z = (unsigned long)mp_unsigned_bin_size(num); \ + STORE32L(z, out+y); \ + y += 4; \ + if ((y + z) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ + if ((err = mp_to_unsigned_bin(num, out+y)) != CRYPT_OK) { return err; } \ + y += z; \ +} + +#define INPUT_BIGNUM(num, in, x, y, inlen) \ +{ \ + /* load value */ \ + if ((y + 4) > inlen) { \ + err = CRYPT_INVALID_PACKET; \ + goto error; \ + } \ + LOAD32L(x, in+y); \ + y += 4; \ + \ + /* sanity check... */ \ + if ((x+y) > inlen) { \ + err = CRYPT_INVALID_PACKET; \ + goto error; \ + } \ + \ + /* load it */ \ + if ((err = mp_read_unsigned_bin(num, (unsigned char *)in+y, (int)x)) != CRYPT_OK) {\ + goto error; \ + } \ + y += x; \ +} + +static inline void packet_store_header (unsigned char *dst, int section, int subsection) +{ + LTC_ARGCHK(dst != NULL); + + /* store version number */ + dst[0] = (unsigned char)(CRYPT&255); + dst[1] = (unsigned char)((CRYPT>>8)&255); + + /* store section and subsection */ + dst[2] = (unsigned char)(section & 255); + dst[3] = (unsigned char)(subsection & 255); + +} + +static inline int packet_valid_header (unsigned char *src, int section, int subsection) +{ + unsigned long ver; + + LTC_ARGCHK(src != NULL); + + /* check version */ + ver = ((unsigned long)src[0]) | ((unsigned long)src[1] << 8U); + if (CRYPT < ver) { + return CRYPT_INVALID_PACKET; + } + + /* check section and subsection */ + if (section != (int)src[2] || subsection != (int)src[3]) { + return CRYPT_INVALID_PACKET; + } + + return CRYPT_OK; +} + +#ifndef DH_BUF_SIZE +/* max export size we'll encounter (smaller than this but lets round up a bit) */ +#define DH_BUF_SIZE 1200 +#endif /* DH_BUF_SIZE */ + +typedef struct { + int size; + char *name, *base, *prime; +} dh_set; + +/* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ +__DECL_DH_STATIC_H__ const dh_set sets[]; + + +int dh_is_valid_idx(int n); + + +#endif /* __DH_STATIC_H__ */ + +#endif /* LTC_MDH */ diff --git a/src/pk/dh/dh_sys.c b/src/pk/dh/dh_sys.c index 8c718d95a..5f44c6a15 100644 --- a/src/pk/dh/dh_sys.c +++ b/src/pk/dh/dh_sys.c @@ -9,11 +9,17 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org */ +#include "tomcrypt.h" + +#ifdef LTC_MDH /** @file dh_sys.c DH Crypto, Tom St Denis */ +#include "dh_static.h" + + /** Encrypt a short symmetric key with a public DH key @param in The symmetric key to encrypt @@ -323,7 +329,7 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, } /* is the IDX valid ? */ - if (is_valid_idx(key->idx) != 1) { + if (dh_is_valid_idx(key->idx) != 1) { return CRYPT_PK_INVALID_TYPE; } @@ -482,3 +488,5 @@ int dh_verify_hash(const unsigned char *sig, unsigned long siglen, mp_clear_multi(tmp, m, g, p, b, a, NULL); return err; } + +#endif /* LTC_MDH */ From a15ea906c1b01598ff2e0a1d8d7a28a6a51f0ed1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 21:43:53 +0100 Subject: [PATCH 0152/1192] genlist.sh: update --- genlist.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genlist.sh b/genlist.sh index 03e13b3fc..ad63ba8b2 100755 --- a/genlist.sh +++ b/genlist.sh @@ -1,8 +1,8 @@ #!/bin/bash # aes_tab.o is a pseudo object as it's made from aes.o and MPI is optional -export a=`echo -n "src/ciphers/aes/aes_enc.o " ; find . -type f | sort | grep "[.]/src" | grep "[.]c" | grep -v "sha224" | grep -v "sha384" | grep -v "aes_tab" | grep -v "twofish_tab" | grep -v "whirltab" | grep -v "dh_sys" | grep -v "ecc_sys" | grep -v "mpi[.]c" | grep -v "sober128tab" | sed -e 'sE\./EE' | sed -e 's/\.c/\.o/' | xargs` +export a=`echo -n "src/ciphers/aes/aes_enc.o " ; find ./src -type f -name "*.c" -not -name "*tab.c" | sort | sed -e 'sE\./EE' | sed -e 's/\.c/\.o/' | xargs` perl ./parsenames.pl OBJECTS "$a" -export a=`find . -type f | grep [.]/src | grep [.]h | sed -e 'se\./ee' | xargs` +export a=`find src/headers -type f -name "*.h" | xargs` perl ./parsenames.pl HEADERS "$a" # $Source: /cvs/libtom/libtomcrypt/genlist.sh,v $ From 1ce4e766ffb7a873b97a1a6b52688dfd074b227d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Mar 2014 22:07:29 +0100 Subject: [PATCH 0153/1192] update makefiles --- makefile | 30 ++++++++++++++++-------------- makefile.icc | 30 ++++++++++++++++-------------- makefile.msvc | 30 ++++++++++++++++-------------- makefile.shared | 30 ++++++++++++++++-------------- makefile.unix | 30 ++++++++++++++++-------------- 5 files changed, 80 insertions(+), 70 deletions(-) diff --git a/makefile b/makefile index 551a040a1..424e380b7 100644 --- a/makefile +++ b/makefile @@ -116,8 +116,8 @@ endif OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ -src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ @@ -138,15 +138,16 @@ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encau src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ @@ -215,9 +216,10 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ -src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile.icc b/makefile.icc index 7d4fd314e..45c916696 100644 --- a/makefile.icc +++ b/makefile.icc @@ -97,8 +97,8 @@ endif OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ -src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ @@ -119,15 +119,16 @@ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encau src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ @@ -196,9 +197,10 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ -src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile.msvc b/makefile.msvc index dac8f2e79..fb710ea10 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -7,8 +7,8 @@ CFLAGS = /Isrc/headers/ /Itestprof/ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ $(CF) OBJECTS=src/ciphers/aes/aes_enc.obj src/ciphers/aes/aes.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \ src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \ src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \ -src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/safer_tab.obj src/ciphers/safer/saferp.obj \ -src/ciphers/skipjack.obj src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_memory.obj \ +src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/skipjack.obj \ +src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_memory.obj \ src/encauth/ccm/ccm_memory_ex.obj src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj \ src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ src/encauth/eax/eax_encrypt.obj src/encauth/eax/eax_encrypt_authenticate_memory.obj \ @@ -29,15 +29,16 @@ src/encauth/ocb3/ocb3_int_ntz.obj src/encauth/ocb3/ocb3_int_xor_blocks.obj src/e src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj \ src/hashes/helper/hash_memory.obj src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj \ src/hashes/md5.obj src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj \ -src/hashes/sha1.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha512.obj src/hashes/tiger.obj \ -src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj \ -src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj \ -src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj \ -src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj \ -src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj \ -src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj \ -src/mac/pelican/pelican.obj src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj \ -src/mac/pmac/pmac_done.obj src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ +src/hashes/sha1.obj src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj \ +src/hashes/sha2/sha512.obj src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj \ +src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj \ +src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj \ +src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj \ +src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj \ +src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj \ +src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj \ +src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj \ +src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \ src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj \ src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \ @@ -106,9 +107,10 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.obj \ src/pk/asn1/der/utctime/der_decode_utctime.obj src/pk/asn1/der/utctime/der_encode_utctime.obj \ src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_utf8_string.obj \ src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \ -src/pk/dh/dh.obj src/pk/dsa/dsa_decrypt_key.obj src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj \ -src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj \ -src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ +src/pk/dh/dh.obj src/pk/dh/dh_static.obj src/pk/dh/dh_sys.obj src/pk/dsa/dsa_decrypt_key.obj \ +src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \ +src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \ +src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ diff --git a/makefile.shared b/makefile.shared index 827575668..c3e68e42a 100644 --- a/makefile.shared +++ b/makefile.shared @@ -102,8 +102,8 @@ endif OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ -src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ @@ -124,15 +124,16 @@ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encau src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ @@ -201,9 +202,10 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ -src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile.unix b/makefile.unix index a035133b4..4179b5e92 100644 --- a/makefile.unix +++ b/makefile.unix @@ -43,8 +43,8 @@ GROUP=wheel OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ -src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ @@ -65,15 +65,16 @@ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encau src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ @@ -142,9 +143,10 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ -src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ From ae5cc352980398cc75f8dac9952902b77b93b693 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 4 Apr 2014 01:02:46 +0200 Subject: [PATCH 0154/1192] surround most macros with "do{}while(0)" --- src/headers/tomcrypt_macros.h | 120 +++++++++++++++++----------------- src/headers/tomcrypt_pk.h | 2 +- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 5a5f51323..d87fb4ded 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -3,48 +3,48 @@ #ifdef ENDIAN_NEUTRAL #define STORE32L(x, y) \ - { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ - (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + do { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) #define LOAD32L(x, y) \ - { x = ((ulong32)((y)[3] & 255)<<24) | \ + do { x = ((ulong32)((y)[3] & 255)<<24) | \ ((ulong32)((y)[2] & 255)<<16) | \ ((ulong32)((y)[1] & 255)<<8) | \ - ((ulong32)((y)[0] & 255)); } + ((ulong32)((y)[0] & 255)); } while(0) #define STORE64L(x, y) \ - { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ + do { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ - (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) #define LOAD64L(x, y) \ - { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \ + do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \ (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32)| \ (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16)| \ - (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } + (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } while(0) #define STORE32H(x, y) \ - { (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \ - (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } + do { (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \ + (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } while(0) #define LOAD32H(x, y) \ - { x = ((ulong32)((y)[0] & 255)<<24) | \ + do { x = ((ulong32)((y)[0] & 255)<<24) | \ ((ulong32)((y)[1] & 255)<<16) | \ ((ulong32)((y)[2] & 255)<<8) | \ - ((ulong32)((y)[3] & 255)); } + ((ulong32)((y)[3] & 255)); } while(0) #define STORE64H(x, y) \ - { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ +do { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ - (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } + (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } while(0) #define LOAD64H(x, y) \ - { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ +do { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32) | \ (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16) | \ - (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } + (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } while(0) #endif /* ENDIAN_NEUTRAL */ @@ -53,12 +53,12 @@ #ifdef LTC_HAVE_BSWAP_BUILTIN #define STORE32H(x, y) \ - { ulong32 __t = __builtin_bswap32 ((x)); \ - XMEMCPY ((y), &__t, 4); } +do { ulong32 __t = __builtin_bswap32 ((x)); \ + XMEMCPY ((y), &__t, 4); } while(0) #define LOAD32H(x, y) \ - { XMEMCPY (&(x), (y), 4); \ - (x) = __builtin_bswap32 ((x)); } +do { XMEMCPY (&(x), (y), 4); \ + (x) = __builtin_bswap32 ((x)); } while(0) #elif !defined(LTC_NO_BSWAP) && (defined(INTEL_CC) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__) || defined(__x86_64__)))) @@ -78,26 +78,26 @@ asm __volatile__ ( \ #else #define STORE32H(x, y) \ - { (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \ - (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } + do { (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \ + (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } while(0) #define LOAD32H(x, y) \ - { x = ((ulong32)((y)[0] & 255)<<24) | \ + do { x = ((ulong32)((y)[0] & 255)<<24) | \ ((ulong32)((y)[1] & 255)<<16) | \ ((ulong32)((y)[2] & 255)<<8) | \ - ((ulong32)((y)[3] & 255)); } + ((ulong32)((y)[3] & 255)); } while(0) #endif #ifdef LTC_HAVE_BSWAP_BUILTIN #define STORE64H(x, y) \ - { ulong64 __t = __builtin_bswap64 ((x)); \ - XMEMCPY ((y), &__t, 8); } +do { ulong64 __t = __builtin_bswap64 ((x)); \ + XMEMCPY ((y), &__t, 8); } while(0) #define LOAD64H(x, y) \ - { XMEMCPY (&(x), (y), 8); \ - (x) = __builtin_bswap64 ((x)); } +do { XMEMCPY (&(x), (y), 8); \ + (x) = __builtin_bswap64 ((x)); } while(0) /* x86_64 processor */ #elif !defined(LTC_NO_BSWAP) && (defined(__GNUC__) && defined(__x86_64__)) @@ -118,52 +118,52 @@ asm __volatile__ ( \ #else #define STORE64H(x, y) \ - { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ +do { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ - (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } + (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } while(0) #define LOAD64H(x, y) \ - { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ +do { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32) | \ (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16) | \ - (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } + (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } while(0) #endif #ifdef ENDIAN_32BITWORD #define STORE32L(x, y) \ - { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } + do { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } while(0) #define LOAD32L(x, y) \ - XMEMCPY(&(x), y, 4); + do { XMEMCPY(&(x), y, 4); } while(0) #define STORE64L(x, y) \ - { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ + do { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ - (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) #define LOAD64L(x, y) \ - { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \ + do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \ (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32)| \ (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16)| \ - (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } + (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } while(0) #else /* 64-bit words then */ #define STORE32L(x, y) \ - { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } + do { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } while(0) #define LOAD32L(x, y) \ - { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } + do { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } while(0) #define STORE64L(x, y) \ - { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } + do { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } while(0) #define LOAD64L(x, y) \ - { XMEMCPY(&(x), y, 8); } + do { XMEMCPY(&(x), y, 8); } while(0) #endif /* ENDIAN_64BITWORD */ @@ -171,60 +171,60 @@ asm __volatile__ ( \ #ifdef ENDIAN_BIG #define STORE32L(x, y) \ - { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ - (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + do { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) #define LOAD32L(x, y) \ - { x = ((ulong32)((y)[3] & 255)<<24) | \ + do { x = ((ulong32)((y)[3] & 255)<<24) | \ ((ulong32)((y)[2] & 255)<<16) | \ ((ulong32)((y)[1] & 255)<<8) | \ - ((ulong32)((y)[0] & 255)); } + ((ulong32)((y)[0] & 255)); } while(0) #define STORE64L(x, y) \ - { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ +do { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ - (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) #define LOAD64L(x, y) \ - { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \ +do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \ (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32) | \ (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16) | \ - (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } + (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } while(0) #ifdef ENDIAN_32BITWORD #define STORE32H(x, y) \ - { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } + do { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } while(0) #define LOAD32H(x, y) \ - XMEMCPY(&(x), y, 4); + do { XMEMCPY(&(x), y, 4); } while(0) #define STORE64H(x, y) \ - { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ + do { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ - (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } + (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } while(0) #define LOAD64H(x, y) \ - { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48)| \ + do { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48)| \ (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32)| \ (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16)| \ - (((ulong64)((y)[6] & 255))<<8)| (((ulong64)((y)[7] & 255))); } + (((ulong64)((y)[6] & 255))<<8)| (((ulong64)((y)[7] & 255))); } while(0) #else /* 64-bit words then */ #define STORE32H(x, y) \ - { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } + do { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } while(0) #define LOAD32H(x, y) \ - { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } + do { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } while(0) #define STORE64H(x, y) \ - { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } + do { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } while(0) #define LOAD64H(x, y) \ - { XMEMCPY(&(x), y, 8); } + do { XMEMCPY(&(x), y, 8); } while(0) #endif /* ENDIAN_64BITWORD */ #endif /* ENDIAN_BIG */ diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index f8dd6c6db..0d1e72552 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -477,7 +477,7 @@ typedef struct ltc_asn1_list_ { LTC_MACRO_list[LTC_MACRO_temp].data = (void*)(Data); \ LTC_MACRO_list[LTC_MACRO_temp].size = (Size); \ LTC_MACRO_list[LTC_MACRO_temp].used = 0; \ - } while (0); + } while (0) /* SEQUENCE */ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, From 449d5e718d3bb5ca1e7ba059a083d64b540c1e9c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 4 Apr 2014 01:03:31 +0200 Subject: [PATCH 0155/1192] gitignore: add files that are generated while profiling --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index a194dcc29..4c10b12cd 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ timing.exe *.patch *.diff *.orig +*.out +*.ll +*.gcda From 445dfa67a64dcd30067dab823f6bae31d1019c1e Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Tue, 15 Apr 2014 11:25:18 +0100 Subject: [PATCH 0156/1192] des.c: Add support for two-key Triple-DES Add two-key 3DES support, needed by pycrypto. This commit is based on the one for the bundled libtomcrypt 1.16 code in pycrypto: https://github.com/dlitz/pycrypto/commit/65085f16 --- src/ciphers/des.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ciphers/des.c b/src/ciphers/des.c index af3a4d072..0034c8014 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -1562,17 +1562,27 @@ int des3_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_k return CRYPT_INVALID_ROUNDS; } - if (keylen != 24) { + if (keylen != 24 && keylen != 16) { return CRYPT_INVALID_KEYSIZE; } deskey(key, EN0, skey->des3.ek[0]); deskey(key+8, DE1, skey->des3.ek[1]); - deskey(key+16, EN0, skey->des3.ek[2]); + if (keylen == 24) { + deskey(key+16, EN0, skey->des3.ek[2]); + } else { + /* two-key 3DES: K3=K1 */ + deskey(key, EN0, skey->des3.ek[2]); + } deskey(key, DE1, skey->des3.dk[2]); deskey(key+8, EN0, skey->des3.dk[1]); - deskey(key+16, DE1, skey->des3.dk[0]); + if (keylen == 24) { + deskey(key+16, DE1, skey->des3.dk[0]); + } else { + /* two-key 3DES: K3=K1 */ + deskey(key, DE1, skey->des3.dk[0]); + } return CRYPT_OK; } From e08480f621e11ff6a8d57e9e495f55f33bc3712a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 28 Apr 2014 21:08:56 +0200 Subject: [PATCH 0157/1192] update documentation according to new 3des mode --- crypt.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypt.tex b/crypt.tex index 486eb957e..6151e39ac 100644 --- a/crypt.tex +++ b/crypt.tex @@ -617,7 +617,7 @@ \subsection{Simple Encryption Demonstration} & aes\_enc\_desc & 16 & 16, 24, 32 & 10, 12, 14 \\ \hline Twofish & twofish\_desc & 16 & 16, 24, 32 & 16 \\ \hline DES & des\_desc & 8 & 8 & 16 \\ - \hline 3DES (EDE mode) & des3\_desc & 8 & 24 & 16 \\ + \hline 3DES (EDE mode) & des3\_desc & 8 & 16, 24 & 16 \\ \hline CAST5 (CAST-128) & cast5\_desc & 8 & 5 $\ldots$ 16 & 12, 16 \\ \hline Noekeon & noekeon\_desc & 16 & 16 & 16 \\ \hline Skipjack & skipjack\_desc & 8 & 10 & 32 \\ From 0bda0770d956738c78ef16134f5e5a2279b7f018 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 20 Jan 2014 12:05:58 +0100 Subject: [PATCH 0158/1192] fix for ASM failures on freebsd/netbsd --- src/ciphers/xtea.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index 915589210..13e58c4f7 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -33,7 +33,7 @@ const struct ltc_cipher_descriptor xtea_desc = int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) { - unsigned long x, sum, K[4]; + ulong32 x, sum, K[4]; LTC_ARGCHK(key != NULL); LTC_ARGCHK(skey != NULL); @@ -75,7 +75,7 @@ int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_k */ int xtea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) { - unsigned long y, z; + ulong32 y, z; int r; LTC_ARGCHK(pt != NULL); @@ -111,7 +111,7 @@ int xtea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key * */ int xtea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) { - unsigned long y, z; + ulong32 y, z; int r; LTC_ARGCHK(pt != NULL); From 232f412709700f695ad586ab5e0e8f92d16de6a7 Mon Sep 17 00:00:00 2001 From: karel-m Date: Fri, 14 Jun 2013 22:26:15 +0200 Subject: [PATCH 0159/1192] makefiles for MS Windows gcc compiler --- makefile.mingw | 249 ++++++++++++++++++++++++++++++++++++++++ testprof/makefile.mingw | 18 +++ updatemakes.sh | 3 + 3 files changed, 270 insertions(+) create mode 100644 makefile.mingw create mode 100644 testprof/makefile.mingw diff --git a/makefile.mingw b/makefile.mingw new file mode 100644 index 000000000..aebd82a8b --- /dev/null +++ b/makefile.mingw @@ -0,0 +1,249 @@ +# MAKEFILE for use with MS Windows gcc compiler + GNU make (aka mingw32-make) + +### should work with the following native compilers (not cross-compilers) +# 32bit gcc compiler by mingw.org +# 32bit gcc compiler by mingw-w64.sf.net +# 64bit gcc compiler by mingw-w64.sf.net + +### build instruction (32bit) +# gmake -f makefile.mingw CFLAGS_OPTS="-DUSE_LTM -DLTM_DESC -Iz:\dev_libtom\include" +# gmake -f makefile.mingw CFLAGS_OPTS="-DUSE_LTM -DLTM_DESC -Iz:\dev_libtom\include" INSTPREFIX=z:\dev_libtom install +# gmake -f makefile.mingw CFLAGS_OPTS="-DUSE_LTM -DLTM_DESC -Iz:\dev_libtom\include" EXTRALIBS="-Lz:\dev_libtom\lib -ltommath" test small tv_gen multi timing +# gmake -f makefile.mingw CFLAGS_OPTS="-DUSE_LTM -DLTM_DESC -Iz:\dev_libtom\include" INSTPREFIX=z:\dev_libtom install_test +# gmake -f makefile.mingw clean + +### build instruction (64bit) +# nearly the same as 32bit build +# just use: CFLAGS_OPTS="-DUSE_LTM -DLTM_DESC -DLTC_NO_ASM -Iz:\dev_libtom\include" + +# Compiler and Linker Names +CC=gcc +LD=ld +AR=ar +ARFLAGS=rc +RANLIB=ranlib + +# Compilation flags. Note the += does not write over the user's CFLAGS! +CFLAGS = -c -I./testprof/ -I./src/headers/ -DLTC_SOURCE -O2 ${CFLAGS_OPTS} -o $@ + +LIBNAME=libtomcrypt.a +LIBTEST=libtomcrypt_prof.a + +HASH=hashsum +CRYPT=encrypt +SMALL=small +PROF=x86_prof +TV=tv_gen +MULTI=multi +TIMING=timing +TEST=test + +#LIBPATH-The directory for libtomcrypt to be installed to. +#INCPATH-The directory to install the header files for libtomcrypt. +INSTPREFIX=c:\devel-libtom +LIBPATH=$(INSTPREFIX)\lib +INCPATH=$(INSTPREFIX)\include + +#List of objects to compile. +#START_INS +OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ +src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ +src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ +src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ +src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ +src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ +src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ +src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ +src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ +src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ +src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ +src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ +src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/chc/chc.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ +src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ +src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ +src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ +src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ +src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ +src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ +src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ +src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ +src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ +src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ +src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ +src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ +src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ +src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ +src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ +src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ +src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ +src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ +src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ +src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ +src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ +src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ +src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ +src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ +src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ +src/pk/asn1/der/octet/der_length_octet_string.o \ +src/pk/asn1/der/printable_string/der_decode_printable_string.o \ +src/pk/asn1/der/printable_string/der_encode_printable_string.o \ +src/pk/asn1/der/printable_string/der_length_printable_string.o \ +src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ +src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ +src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ +src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ +src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ +src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/short_integer/der_encode_short_integer.o \ +src/pk/asn1/der/short_integer/der_length_short_integer.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ +src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ +src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ +src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ +src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ +src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ +src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ +src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ +src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ +src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ +src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ +src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ +src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ +src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ +src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ +src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ +src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ +src/prngs/sprng.o src/prngs/yarrow.o + +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h + +#END_INS + +TESTOBJECTS=demos/test.o +HASHOBJECTS=demos/hashsum.o +CRYPTOBJECTS=demos/encrypt.o +SMALLOBJECTS=demos/small.o +TVS=demos/tv_gen.o +MULTIS=demos/multi.o +TIMINGS=demos/timing.o +TESTS=demos/test.o + +#The default rule for make builds the libtomcrypt library. +default:library + +#ciphers come in two flavours... enc+dec and enc +src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c + $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o + +#These are the rules to make certain object files. +src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c +src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c +src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c +src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c +src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c + +#This rule makes the libtomcrypt library. +library: $(LIBNAME) + +testprof/$(LIBTEST): + $(MAKE) -C testprof -f makefile.mingw CFLAGS_OPTS="$(CFLAGS)" LIBTEST_S=$(LIBTEST) CC=$(CC) LD=$(LD) AR=$(AR) ARFLAGS=$(ARFLAGS) RANLIB=$(RANLIB) + +$(LIBNAME): $(OBJECTS) + $(AR) $(ARFLAGS) $@ $(OBJECTS) + $(RANLIB) $@ + +#This rule makes the hash program included with libtomcrypt +hashsum: library $(HASHOBJECTS) + $(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) $(WARN) + +#makes the crypt program +crypt: library $(CRYPTOBJECTS) + $(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) $(WARN) + +#makes the small program +small: library $(SMALLOBJECTS) + $(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) $(WARN) + +tv_gen: library $(TVS) + $(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) + +multi: library $(MULTIS) + $(CC) $(MULTIS) $(LIBNAME) $(EXTRALIBS) -o $(MULTI) + +timing: library testprof/$(LIBTEST) $(TIMINGS) + $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) + +test: library testprof/$(LIBTEST) $(TESTS) + $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) + +install: library + cmd /c if not exist "$(DESTDIR)$(LIBPATH)" mkdir "$(DESTDIR)$(LIBPATH)" + cmd /c if not exist "$(DESTDIR)$(INCPATH)" mkdir "$(DESTDIR)$(INCPATH)" + copy /Y $(LIBNAME) "$(DESTDIR)$(LIBPATH)" + copy /Y src\headers\tomcrypt*.h "$(DESTDIR)$(INCPATH)" + +install_test: testprof/$(LIBTEST) + cmd /c if not exist "$(DESTDIR)$(LIBPATH)" mkdir "$(DESTDIR)$(LIBPATH)" + copy /Y testprof\$(LIBTEST) "$(DESTDIR)$(LIBPATH)" + +clean: + cmd /c del /Q /S *.o *.a *.exe + $(MAKE) -C testprof -f makefile.mingw clean \ No newline at end of file diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw new file mode 100644 index 000000000..73f97e444 --- /dev/null +++ b/testprof/makefile.mingw @@ -0,0 +1,18 @@ +# MAKEFILE for use with MS Windows gcc compiler + GNU make (aka mingw32-make) + +# BEWARE: do not run make from testprof directory, run 'gmake ... test' from libtomcrypt root dir + +CFLAGS = $(CFLAGS_OPTS) -W -I../src/headers -I. -Wall -W + +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ +dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o + +default: $(LIBTEST_S) + +$(LIBTEST_S): $(OBJECTS) + $(AR) $(ARFLAGS) $@ $(OBJECTS) + $(RANLIB) $@ + +clean: + cmd /c del /Q *.o *.a diff --git a/updatemakes.sh b/updatemakes.sh index 8539e1eb5..cf4c60785 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -18,6 +18,9 @@ perl filter.pl makefile.unix tmplist sed -e 's/ *$//' < tmp.delme > makefile.unix rm -f tmp.delme +perl filter.pl makefile.mingw tmplist +mv -f tmp.delme makefile.mingw + perl filter.pl makefile.msvc tmplist sed -e 's/\.o /.obj /g' -e 's/ *$//' < tmp.delme > makefile.msvc rm -f tmp.delme From 8afdb8831de0e7a86fa942bd97a7e71cc4deb74d Mon Sep 17 00:00:00 2001 From: karel-m Date: Mon, 17 Jun 2013 12:04:01 +0200 Subject: [PATCH 0160/1192] ifdefs related to 64bit MS Windows build Conflicts: src/headers/tomcrypt_cfg.h src/prngs/rng_get_bytes.c --- src/headers/tomcrypt_cfg.h | 2 +- src/prngs/rng_get_bytes.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 8b06b1402..e17aa6a78 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -56,7 +56,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); */ /* detect x86-32 machines somewhat */ -#if !defined(__STRICT_ANSI__) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) +#if !defined(__STRICT_ANSI__) && !defined(_WIN64) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) #define ENDIAN_LITTLE #define ENDIAN_32BITWORD #define LTC_FAST diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index b36d1a99b..5604838c0 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -138,7 +138,7 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, #if defined(LTC_DEVRANDOM) x = rng_nix(out, outlen, callback); if (x != 0) { return x; } #endif -#if defined(_WIN32) || defined(_WIN32) || defined(WINCE) +#if defined(WIN32) || defined(_WIN32) || defined(WINCE) x = rng_win32(out, outlen, callback); if (x != 0) { return x; } #endif #ifdef ANSI_RNG From 8a2bd895185bb23f399970c9ca8a9ae6535ae6cd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 18 Apr 2013 16:43:05 +0200 Subject: [PATCH 0161/1192] don't use assembler rotate when compiling for windows 64bit --- src/headers/tomcrypt_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index d87fb4ded..85de9e699 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -343,7 +343,7 @@ static inline ulong32 RORc(ulong32 word, const int i) /* 64-bit Rotates */ -#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM) +#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(_WIN64) && !defined(LTC_NO_ASM) static inline ulong64 ROL64(ulong64 word, int i) { From b10c03aead73ad6b1cd793c5b7f40ba65b340c37 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 29 Apr 2014 21:13:49 +0200 Subject: [PATCH 0162/1192] flush content of CVS/SVN tags --- build.sh | 6 +++--- crypt.tex | 6 +++--- doc/footer.html | 6 +++--- doc/header.html | 6 +++--- genlist.sh | 6 +++--- parsenames.pl | 6 +++--- run.sh | 6 +++--- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 6 +++--- src/pk/asn1/der/bit/der_encode_raw_bit_string.c | 6 +++--- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/build.sh b/build.sh index c5f37c3d2..44ef0bd97 100755 --- a/build.sh +++ b/build.sh @@ -15,6 +15,6 @@ if [ -a testok.txt ] && [ -f testok.txt ]; then fi exit 1 -# $Source: /cvs/libtom/libtomcrypt/build.sh,v $ -# $Revision: 1.9 $ -# $Date: 2006/03/18 14:10:55 $ +# $Source$ +# $Revision$ +# $Date$ diff --git a/crypt.tex b/crypt.tex index 6151e39ac..3a9d69bae 100644 --- a/crypt.tex +++ b/crypt.tex @@ -6863,6 +6863,6 @@ \subsection{RSA Functions} \end{document} -% $Source: /cvs/libtom/libtomcrypt/crypt.tex,v $ -% $Revision: 1.128 $ -% $Date: 2007/03/10 23:59:54 $ +% $Source$ +% $Revision$ +% $Date$ diff --git a/doc/footer.html b/doc/footer.html index 26e169107..cb7e8afa5 100644 --- a/doc/footer.html +++ b/doc/footer.html @@ -4,7 +4,7 @@ diff --git a/doc/header.html b/doc/header.html index 231475d1d..5d8657436 100644 --- a/doc/header.html +++ b/doc/header.html @@ -6,7 +6,7 @@ diff --git a/genlist.sh b/genlist.sh index ad63ba8b2..e3b000682 100755 --- a/genlist.sh +++ b/genlist.sh @@ -5,6 +5,6 @@ perl ./parsenames.pl OBJECTS "$a" export a=`find src/headers -type f -name "*.h" | xargs` perl ./parsenames.pl HEADERS "$a" -# $Source: /cvs/libtom/libtomcrypt/genlist.sh,v $ -# $Revision: 1.4 $ -# $Date: 2005/07/17 23:15:12 $ +# $Source$ +# $Revision$ +# $Date$ diff --git a/parsenames.pl b/parsenames.pl index 761f03622..385e6f2cd 100755 --- a/parsenames.pl +++ b/parsenames.pl @@ -21,6 +21,6 @@ print "\n\n"; -# $Source: /cvs/libtom/libtomcrypt/parsenames.pl,v $ -# $Revision: 1.3 $ -# $Date: 2005/05/05 14:49:27 $ +# $Source$ +# $Revision$ +# $Date$ diff --git a/run.sh b/run.sh index 8d56f5ad4..22a8332ba 100755 --- a/run.sh +++ b/run.sh @@ -34,6 +34,6 @@ fi exit 0 -# $Source: /cvs/libtom/libtomcrypt/run.sh,v $ -# $Revision: 1.15 $ -# $Date: 2005/07/23 14:18:31 $ +# $Source$ +# $Revision$ +# $Date$ diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index 80103c70c..a7f355c95 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -101,6 +101,6 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/bit/der_decode_bit_string.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:27:24 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c index 1fafc12c8..014a037fe 100644 --- a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c @@ -87,6 +87,6 @@ int der_encode_raw_bit_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/bit/der_encode_bit_string.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:27:24 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From b895f134844990d733c3db8fe0921dec913e3c2a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 30 Apr 2014 01:10:22 +0200 Subject: [PATCH 0163/1192] minor changes/clean-up sources --- .gitignore | 9 +-- demos/test.c | 2 +- src/headers/tomcrypt_custom.h | 6 +- src/mac/hmac/hmac_test.c | 20 ++++++ src/misc/crypt/crypt.c | 130 +++++++++++++++++++--------------- src/misc/hkdf/hkdf_test.c | 4 ++ src/misc/pkcs5/pkcs_5_test.c | 2 + 7 files changed, 109 insertions(+), 64 deletions(-) diff --git a/.gitignore b/.gitignore index 4c10b12cd..002a2d971 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ # suppress compiler/linker output *.[oa] *.obj -*.gcno [Dd]ebug/ [Rr]elease/ @@ -39,6 +38,8 @@ timing.exe *.patch *.diff *.orig -*.out -*.ll -*.gcda +*.out +*.ll +*.gcda +*.gcno +*.gcov diff --git a/demos/test.c b/demos/test.c index e9c9a9073..b19b88720 100644 --- a/demos/test.c +++ b/demos/test.c @@ -18,7 +18,7 @@ int main(void) printf("build == \n%s\n", crypt_build_settings); printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\nmisc_test...."); fflush(stdout); x = misc_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\nmisc_test....."); fflush(stdout); x = misc_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nmodes_test...."); fflush(stdout); x = modes_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 6518b2a8d..b87700a50 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -121,6 +121,8 @@ #ifndef LTC_NO_TEST #define LTC_TEST #endif +/* Enable extended self-tests */ +/* #define LTC_TEST_EXT */ /* Use small code where possible */ /* #define LTC_SMALL_CODE */ @@ -170,7 +172,7 @@ #define LTC_TWOFISH_SMALL #endif /* #define LTC_TWOFISH_SMALL */ -/* LTC_DES includes EDE triple-LTC_DES */ +/* LTC_DES includes EDE triple-DES */ #define LTC_DES #define LTC_CAST5 #define LTC_NOEKEON @@ -378,7 +380,7 @@ /* Keep LTC_NO_HKDF for compatibility reasons * superseeded by LTC_NO_MISC*/ #ifndef LTC_NO_HKDF -/* LTC_HKDF Key Derivation/Expansion stuff */ +/* HKDF Key Derivation/Expansion stuff */ #define LTC_HKDF #endif /* LTC_NO_HKDF */ diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index 3573b5074..adec51738 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -66,6 +66,7 @@ int hmac_test(void) 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, +#ifdef LTC_TEST_EXT { // 2 0x4a, 0x65, 0x66, 0x65 }, @@ -101,6 +102,7 @@ int hmac_test(void) 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa } +#endif /* LTC_TEST_EXT */ }; @@ -108,6 +110,7 @@ int hmac_test(void) { "Hi There" }, +#ifdef LTC_TEST_EXT { "what do ya want for nothing?" }, @@ -137,6 +140,7 @@ int hmac_test(void) { "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm." } +#endif /* LTC_TEST_EXT */ }; static const struct hmac_test_case { @@ -158,6 +162,7 @@ int hmac_test(void) 0xe2, 0x8b, 0xc0, 0xb6, 0xfb, 0x37, 0x8c, 0x8e, 0xf1, 0x46, 0xbe, 0x00} }, +#ifdef LTC_TEST_EXT { "rfc2202 3.2", "sha1", hmac_test_case_keys[1], 4, hmac_test_case_data[1], 28, @@ -197,6 +202,7 @@ int hmac_test(void) hmac_test_case_data[6], 73, {0xe8, 0xe9, 0x9d, 0x0f, 0x45, 0x23, 0x7d, 0x78, 0x6d, 0x6b, 0xba, 0xa7, 0x96, 0x5c, 0x78, 0x08, 0xbb, 0xff, 0x1a, 0x91} }, +#endif /* LTC_TEST_EXT */ /* RFC 2202 2. Test Cases for HMAC-MD5 @@ -207,6 +213,7 @@ int hmac_test(void) {0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c, 0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d} }, +#ifdef LTC_TEST_EXT { "rfc2202 2.2", "md5", hmac_test_case_keys[1], 4, hmac_test_case_data[1], 28, @@ -242,6 +249,7 @@ int hmac_test(void) hmac_test_case_data[6], 73, {0x6f, 0x63, 0x0f, 0xad, 0x67, 0xcd, 0xa0, 0xee, 0x1f, 0xb1, 0xf5, 0x62, 0xdb, 0x3a, 0xa5, 0x3e} }, +#endif /* LTC_TEST_EXT */ /* RFC 2286 2. Test Cases for HMAC-RIPEMD160 @@ -253,6 +261,7 @@ int hmac_test(void) 0x5d, 0x2e, 0xd7, 0x73, 0x2d, 0xcc, 0x39, 0x37, 0x7f, 0x0a, 0x56, 0x68} }, +#ifdef LTC_TEST_EXT { "rfc2286 2.2", "rmd160", hmac_test_case_keys[1], 4, hmac_test_case_data[1], 28, @@ -294,6 +303,7 @@ int hmac_test(void) {0x69, 0xea, 0x60, 0x79, 0x8d, 0x71, 0x61, 0x6c, 0xce, 0x5f, 0xd0, 0x87, 0x1e, 0x23, 0x75, 0x4c, 0xd7, 0x5d, 0x5a, 0x0a} }, +#endif /* LTC_TEST_EXT */ /* RFC 2286 3. Test Cases for HMAC-RIPEMD128 @@ -304,6 +314,7 @@ int hmac_test(void) {0xfb, 0xf6, 0x1f, 0x94, 0x92, 0xaa, 0x4b, 0xbf, 0x81, 0xc1, 0x72, 0xe8, 0x4e, 0x07, 0x34, 0xdb} }, +#ifdef LTC_TEST_EXT { "rfc2286 3.2", "rmd128", hmac_test_case_keys[1], 4, hmac_test_case_data[1], 28, @@ -339,6 +350,7 @@ int hmac_test(void) hmac_test_case_data[6], 73, {0x5c, 0x6b, 0xec, 0x96, 0x79, 0x3e, 0x16, 0xd4, 0x06, 0x90, 0xc2, 0x37, 0x63, 0x5f, 0x30, 0xc5} }, +#endif /* LTC_TEST_EXT */ /* RFC 4231 4. Test Vectors @@ -352,6 +364,7 @@ int hmac_test(void) 0x47, 0xb4, 0xb1, 0x16, 0x99, 0x12, 0xba, 0x4f, 0x53, 0x68, 0x4b, 0x22} }, +#ifdef LTC_TEST_EXT { "rfc4231 4.3", "sha224", hmac_test_case_keys[1], 4, hmac_test_case_data[1], 28, @@ -391,6 +404,7 @@ int hmac_test(void) 0x3f, 0x54, 0xd5, 0x17, 0xd0, 0xb3, 0x9d, 0xbd, 0x94, 0x67, 0x70, 0xdb, 0x9c, 0x2b, 0x95, 0xc9, 0xf6, 0xf5, 0x65, 0xd1} }, +#endif /* LTC_TEST_EXT */ { "rfc4231 4.2", "sha256", hmac_test_case_keys[0], 20, @@ -400,6 +414,7 @@ int hmac_test(void) 0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7, 0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7} }, +#ifdef LTC_TEST_EXT { "rfc4231 4.3", "sha256", hmac_test_case_keys[1], 4, hmac_test_case_data[1], 28, @@ -439,6 +454,7 @@ int hmac_test(void) 0x27, 0x63, 0x5f, 0xbc, 0xd5, 0xb0, 0xe9, 0x44, 0xbf, 0xdc, 0x63, 0x64, 0x4f, 0x07, 0x13, 0x93, 0x8a, 0x7f, 0x51, 0x53, 0x5c, 0x3a, 0x35, 0xe2} }, +#endif /* LTC_TEST_EXT */ { "rfc4231 4.2", "sha384", hmac_test_case_keys[0], 20, @@ -450,6 +466,7 @@ int hmac_test(void) 0xfa, 0xea, 0x9e, 0xa9, 0x07, 0x6e, 0xde, 0x7f, 0x4a, 0xf1, 0x52, 0xe8, 0xb2, 0xfa, 0x9c, 0xb6} }, +#ifdef LTC_TEST_EXT { "rfc4231 4.3", "sha384", hmac_test_case_keys[1], 4, hmac_test_case_data[1], 28, @@ -499,6 +516,7 @@ int hmac_test(void) 0xdc, 0xce, 0xbb, 0x82, 0x46, 0x1e, 0x99, 0xc5, 0xa6, 0x78, 0xcc, 0x31, 0xe7, 0x99, 0x17, 0x6d, 0x38, 0x60, 0xe6, 0x11, 0x0c, 0x46, 0x52, 0x3e} }, +#endif /* LTC_TEST_EXT */ { "rfc4231 4.2", "sha512", hmac_test_case_keys[0], 20, @@ -512,6 +530,7 @@ int hmac_test(void) 0xbe, 0x9d, 0x91, 0x4e, 0xeb, 0x61, 0xf1, 0x70, 0x2e, 0x69, 0x6c, 0x20, 0x3a, 0x12, 0x68, 0x54} }, +#ifdef LTC_TEST_EXT { "rfc4231 4.3", "sha512", hmac_test_case_keys[1], 4, hmac_test_case_data[1], 28, @@ -571,6 +590,7 @@ int hmac_test(void) 0x0d, 0x5e, 0xeb, 0x55, 0xc3, 0xe4, 0xde, 0x15, 0x13, 0x46, 0x76, 0xfb, 0x6d, 0xe0, 0x44, 0x60, 0x65, 0xc9, 0x74, 0x40, 0xfa, 0x8c, 0x6a, 0x58} }, +#endif /* LTC_TEST_EXT */ }; diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index fdfe13ee4..e6bbeaa98 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -48,13 +48,13 @@ const char *crypt_build_settings = " Blowfish\n" #endif #if defined(LTC_RC2) - " LTC_RC2\n" + " RC2\n" #endif #if defined(LTC_RC5) - " LTC_RC5\n" + " RC5\n" #endif #if defined(LTC_RC6) - " LTC_RC6\n" + " RC6\n" #endif #if defined(LTC_SAFERP) " Safer+\n" @@ -66,7 +66,7 @@ const char *crypt_build_settings = " Rijndael\n" #endif #if defined(LTC_XTEA) - " LTC_XTEA\n" + " XTEA\n" #endif #if defined(LTC_TWOFISH) " Twofish " @@ -89,10 +89,10 @@ const char *crypt_build_settings = #endif #endif #if defined(LTC_DES) - " LTC_DES\n" + " DES\n" #endif #if defined(LTC_CAST5) - " LTC_CAST5\n" + " CAST5\n" #endif #if defined(LTC_NOEKEON) " Noekeon\n" @@ -111,7 +111,7 @@ const char *crypt_build_settings = #endif "\n" #if defined(LTC_KSEED) - " LTC_KSEED\n" + " KSEED\n" #endif #if defined(LTC_KASUMI) " KASUMI\n" @@ -125,49 +125,49 @@ const char *crypt_build_settings = "\nHashes built-in:\n" #if defined(LTC_SHA512) - " LTC_SHA-512\n" + " SHA-512\n" #endif #if defined(LTC_SHA384) - " LTC_SHA-384\n" + " SHA-384\n" #endif #if defined(LTC_SHA256) - " LTC_SHA-256\n" + " SHA-256\n" #endif #if defined(LTC_SHA224) - " LTC_SHA-224\n" + " SHA-224\n" #endif #if defined(LTC_TIGER) - " LTC_TIGER\n" + " TIGER\n" #endif #if defined(LTC_SHA1) - " LTC_SHA1\n" + " SHA1\n" #endif #if defined(LTC_MD5) - " LTC_MD5\n" + " MD5\n" #endif #if defined(LTC_MD4) - " LTC_MD4\n" + " MD4\n" #endif #if defined(LTC_MD2) - " LTC_MD2\n" + " MD2\n" #endif #if defined(LTC_RIPEMD128) - " LTC_RIPEMD128\n" + " RIPEMD128\n" #endif #if defined(LTC_RIPEMD160) - " LTC_RIPEMD160\n" + " RIPEMD160\n" #endif #if defined(LTC_RIPEMD256) - " LTC_RIPEMD256\n" + " RIPEMD256\n" #endif #if defined(LTC_RIPEMD320) - " LTC_RIPEMD320\n" + " RIPEMD320\n" #endif #if defined(LTC_WHIRLPOOL) - " LTC_WHIRLPOOL\n" + " WHIRLPOOL\n" #endif #if defined(LTC_CHC_HASH) - " LTC_CHC_HASH \n" + " CHC_HASH\n" #endif "\nBlock Chaining Modes:\n" @@ -190,81 +190,91 @@ const char *crypt_build_settings = " (CTR_OLD) " #endif "\n" -#if defined(LRW_MODE) - " LRW_MODE" +#if defined(LTC_LRW_MODE) + " LRW" #if defined(LRW_TABLES) - " (LRW_TABLES) " + " (tables) " #endif "\n" #endif #if defined(LTC_F8_MODE) - " F8 MODE\n" + " F8\n" #endif #if defined(LTC_XTS_MODE) - " LTC_XTS_MODE\n" + " XTS\n" #endif "\nMACs:\n" #if defined(LTC_HMAC) - " LTC_HMAC\n" + " HMAC\n" #endif #if defined(LTC_OMAC) - " LTC_OMAC\n" + " OMAC\n" #endif #if defined(LTC_PMAC) " PMAC\n" #endif #if defined(LTC_PELICAN) - " LTC_PELICAN\n" + " PELICAN\n" #endif #if defined(LTC_XCBC) - " XCBC-MAC\n" + " XCBC\n" #endif #if defined(LTC_F9_MODE) - " F9-MAC\n" + " F9\n" #endif "\nENC + AUTH modes:\n" #if defined(LTC_EAX_MODE) - " LTC_EAX_MODE\n" + " EAX\n" #endif #if defined(LTC_OCB_MODE) - " LTC_OCB_MODE\n" + " OCB\n" #endif #if defined(LTC_OCB3_MODE) - " LTC_OCB3_MODE\n" + " OCB3\n" #endif #if defined(LTC_CCM_MODE) - " LTC_CCM_MODE\n" + " CCM\n" #endif #if defined(LTC_GCM_MODE) - " LTC_GCM_MODE " -#endif + " GCM" #if defined(LTC_GCM_TABLES) - " (LTC_GCM_TABLES) " + " (tables) " +#endif +#if defined(LTC_GCM_TABLES_SSE2) + " (SSE2) " #endif "\n" +#endif "\nPRNG:\n" #if defined(LTC_YARROW) " Yarrow\n" #endif #if defined(LTC_SPRNG) - " LTC_SPRNG\n" + " SPRNG\n" #endif #if defined(LTC_RC4) - " LTC_RC4\n" + " RC4\n" #endif #if defined(LTC_FORTUNA) " Fortuna\n" #endif #if defined(LTC_SOBER128) - " LTC_SOBER128\n" + " SOBER128\n" #endif "\nPK Algs:\n" #if defined(LTC_MRSA) - " RSA \n" + " RSA" +#if defined(LTC_RSA_BLINDING) + " (with blinding)" +#endif + "\n" +#endif +#if defined(LTC_MDH) + " DH\n" #endif #if defined(LTC_MECC) " ECC\n" @@ -301,37 +311,43 @@ const char *crypt_build_settings = " x86-64 detected.\n" #endif #if defined(LTC_PPC32) - " LTC_PPC32 defined \n" + " PPC32 defined \n" #endif "\nVarious others: " #if defined(LTC_BASE64) - " LTC_BASE64 " + " BASE64 " +#endif +#if defined(LTC_BASE64_URL) + " BASE64-URL-SAFE " +#endif +#if defined(LTC_DER) + " DER " +#endif +#if defined(LTC_PKCS_1) + " PKCS#1 " +#endif +#if defined(LTC_PKCS_5) + " PKCS#5 " +#endif +#if defined(LTC_HKDF) + " HKDF " #endif #if defined(MPI) " MPI " #endif -#if defined(TRY_UNRANDOM_FIRST) - " TRY_UNRANDOM_FIRST " +#if defined(TRY_URANDOM_FIRST) + " TRY_URANDOM_FIRST " #endif #if defined(LTC_TEST) " LTC_TEST " #endif -#if defined(LTC_PKCS_1) - " LTC_PKCS#1 " -#endif -#if defined(LTC_PKCS_5) - " LTC_PKCS#5 " -#endif #if defined(LTC_SMALL_CODE) " LTC_SMALL_CODE " #endif #if defined(LTC_NO_FILE) " LTC_NO_FILE " #endif -#if defined(LTC_DER) - " LTC_DER " -#endif #if defined(LTC_FAST) " LTC_FAST " #endif @@ -366,7 +382,7 @@ const char *crypt_build_settings = " GMP_DESC " #endif #if defined(LTC_EASY) - " (easy) " + " LTC_EASY " #endif #if defined(LTC_MECC_FP) " LTC_MECC_FP " diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index 70bb0082e..0447d2867 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -86,6 +86,7 @@ int hkdf_test(void) 0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4, 0xc5, 0xbf, 0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18, 0x58, 0x65}, 42}, +#ifdef LTC_TEST_EXT /* Test with SHA-256 and longer inputs/outputs */ {2, "sha256", {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -150,6 +151,7 @@ int hkdf_test(void) 0xc3, 0x45, 0x4e, 0x5f, 0x3c, 0x73, 0x8d, 0x2d, 0x9d, 0x20, 0x13, 0x95, 0xfa, 0xa4, 0xb6, 0x1a, 0x96, 0xc8}, 42}, +#endif /* LTC_TEST_EXT */ #endif /* LTC_SHA256 */ #ifdef LTC_SHA1 /* Basic test case with SHA-1 */ @@ -169,6 +171,7 @@ int hkdf_test(void) 0x68, 0xa9, 0xcd, 0xd4, 0xf1, 0x55, 0xfd, 0xa2, 0xc2, 0x2e, 0x42, 0x24, 0x78, 0xd3, 0x05, 0xf3, 0xf8, 0x96}, 42}, +#ifdef LTC_TEST_EXT /* Test with SHA-1 and longer inputs/outputs */ {5, "sha1", {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -248,6 +251,7 @@ int hkdf_test(void) 0xb0, 0xd1, 0xf2, 0x7e, 0xbb, 0xa6, 0xf5, 0xe5, 0x67, 0x3a, 0x08, 0x1d, 0x70, 0xcc, 0xe7, 0xac, 0xfc, 0x48}, 42}, +#endif /* LTC_TEST_EXT */ #endif /* LTC_SHA1 */ }; diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index 21f4b58b0..85ccdfa42 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -65,6 +65,7 @@ int pkcs_5_test (void) 0xcd, 0x1e, 0xd9, 0x2a, 0xce, 0x1d, 0x41, 0xf0, 0xd8, 0xde, 0x89, 0x57 } }, +#ifdef LTC_TEST_EXT { "password", 8, @@ -109,6 +110,7 @@ int pkcs_5_test (void) { 0x56, 0xfa, 0x6a, 0xa7, 0x55, 0x48, 0x09, 0x9d, 0xcc, 0x37, 0xd7, 0xf0, 0x34, 0x25, 0xe0, 0xc3 } }, +#endif /* LTC_TEST_EXT */ }; unsigned char DK[25]; From 3b7c6512ac77dd13f53be0905ea972de4ffd5a54 Mon Sep 17 00:00:00 2001 From: mudzot Date: Sun, 17 Nov 2013 09:53:14 +0700 Subject: [PATCH 0164/1192] Add #ifdef to make it easier to embed libtomcrypt with LTC_NOTHING Restore LTC_NO_MATH and make rand_prime.c depend on LTC_NO_MATH & LTC_NO_PRNGS --- src/headers/tomcrypt_custom.h | 5 +++++ src/math/rand_prime.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index b87700a50..e34beb14d 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -68,6 +68,7 @@ /* shortcut to disable automatic inclusion */ #if defined LTC_NOTHING && !defined LTC_EASY + #define LTC_NO_MATH #define LTC_NO_CIPHERS #define LTC_NO_MODES #define LTC_NO_HASHES @@ -143,12 +144,16 @@ /* #define LTC_NO_BSWAP */ /* ---> math provider? <--- */ +#ifndef LTC_NO_MATH + /* LibTomMath */ /* #define LTM_DESC */ /* TomsFastMath */ /* #define TFM_DESC */ +#endif /* LTC_NO_MATH */ + /* GNU Multiple Precision Arithmetic Library */ /* #define GMP_DESC */ diff --git a/src/math/rand_prime.c b/src/math/rand_prime.c index f2284295a..30a03d689 100644 --- a/src/math/rand_prime.c +++ b/src/math/rand_prime.c @@ -10,6 +10,8 @@ */ #include "tomcrypt.h" +#if !defined LTC_NO_MATH && !defined LTC_NO_PRNGS + /** @file rand_prime.c Generate a random prime, Tom St Denis @@ -80,6 +82,7 @@ int rand_prime(void *N, long len, prng_state *prng, int wprng) return CRYPT_OK; } +#endif /* LTC_NO_MATH */ /* $Source$ */ From aa72cfe1d9344a7371e5d7a43854b17cb696e470 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 30 Apr 2014 20:19:11 +0200 Subject: [PATCH 0165/1192] ccm: clarify pt and ct parameters in doc and API description this fixes #42 [skip ci] --- crypt.tex | 8 ++++---- src/encauth/ccm/ccm_memory.c | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/crypt.tex b/crypt.tex index 3a9d69bae..7e854a700 100644 --- a/crypt.tex +++ b/crypt.tex @@ -1579,8 +1579,8 @@ \subsubsection{CCM Example} NULL, /* not prescheduled */ nonce, 12, /* 96-bit nonce */ NULL, 0, /* no header */ - pt, 32, /* 32-byte plaintext */ - ct, /* ciphertext */ + pt, 32, /* [in] 32-byte plaintext */ + ct, /* [out] ciphertext */ tag, &taglen, CCM_ENCRYPT)) != CRYPT_OK) { printf("ccm_memory error %s\n", error_to_string(err)); @@ -1596,8 +1596,8 @@ \subsubsection{CCM Example} NULL, /* not prescheduled */ nonce, 12, /* 96-bit nonce */ NULL, 0, /* no header */ - ct, 32, /* 32-byte ciphertext */ - pt, /* plaintext */ + pt, 32, /* [out] 32-byte plaintext */ + ct, /* [in] ciphertext */ tagcp, &taglen, CCM_DECRYPT)) != CRYPT_OK) { printf("ccm_memory error %s\n", error_to_string(err)); diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index b19e94a55..1b4328d2b 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -19,6 +19,9 @@ /** CCM encrypt/decrypt and produce an authentication tag + + *1 'pt' and 'ct' can both be 'in' or 'out', depending on 'direction' + @param cipher The index of the cipher desired @param key The secret key to use @param keylen The length of the secret key (octets) @@ -27,9 +30,9 @@ @param noncelen The length of the nonce @param header The header for the session @param headerlen The length of the header (octets) - @param pt [out] The plaintext + @param pt [*1] The plaintext @param ptlen The length of the plaintext (octets) - @param ct [out] The ciphertext + @param ct [*1] The ciphertext @param tag [out] The destination tag @param taglen [in/out] The max size and resulting size of the authentication tag @param direction Encrypt or Decrypt direction (0 or 1) From c211ce7f6646d1ed93bed53155ae2812ad9c66b6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 May 2014 15:44:09 +0200 Subject: [PATCH 0166/1192] omac: fix accidentally reverted patch introduced in 6816ac3f3fae776adb1372dbffd0441062006109 reverted in 8e7777b5545e46ab545bd51f7fcde7957134ade2 --- src/mac/omac/omac_process.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/mac/omac/omac_process.c b/src/mac/omac/omac_process.c index 2bd08a9f5..8ecac0db5 100644 --- a/src/mac/omac/omac_process.c +++ b/src/mac/omac/omac_process.c @@ -27,7 +27,7 @@ */ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen) { - unsigned long n, x, blklen; + unsigned long n, x; int err; LTC_ARGCHK(omac != NULL); @@ -42,20 +42,23 @@ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen) } #ifdef LTC_FAST - blklen = cipher_descriptor[omac->cipher_idx].block_length; - if (omac->buflen == 0 && inlen > blklen) { - unsigned long y; - for (x = 0; x < (inlen - blklen); x += blklen) { - for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y])); - } - in += blklen; - if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) { - return err; - } - } - inlen -= x; - } + { + unsigned long blklen = cipher_descriptor[omac->cipher_idx].block_length; + + if (omac->buflen == 0 && inlen > blklen) { + unsigned long y; + for (x = 0; x < (inlen - blklen); x += blklen) { + for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) { + *((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y])); + } + in += blklen; + if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) { + return err; + } + } + inlen -= x; + } + } #endif while (inlen != 0) { From 4929e4e989bd9e10003d53790bf878eb13c3e94a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 May 2014 18:01:13 +0200 Subject: [PATCH 0167/1192] fix warnings in tests --- demos/tv_gen.c | 2 +- testprof/base64_test.c | 2 +- testprof/ecc_test.c | 12 +++--- testprof/pkcs_1_test.c | 2 +- testprof/tomcrypt_test.h | 2 + testprof/x86_prof.c | 86 ++++++++++++++++++++-------------------- 6 files changed, 55 insertions(+), 51 deletions(-) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index ab4df0f68..1a6a6a107 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -555,7 +555,7 @@ void ocb3_gen(void) plaintext[z] = (unsigned char)(z & 255); } len = sizeof(tag); - if ((err = ocb3_encrypt_authenticate_memory(x, key, kl, nonce, cipher_descriptor[x].block_length, "AAD", 3, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) { + if ((err = ocb3_encrypt_authenticate_memory(x, key, kl, nonce, cipher_descriptor[x].block_length, (unsigned char*)"AAD", 3, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) { printf("Error OCB'ing: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 04381b8d2..e62786413 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -29,7 +29,7 @@ int base64_test(void) for (x = 0; x < sizeof(cases)/sizeof(cases[0]); ++x) { slen1 = strlen(cases[x].s); l1 = sizeof(out); - DO(base64_encode(cases[x].s, slen1, out, &l1)); + DO(base64_encode((unsigned char*)cases[x].s, slen1, out, &l1)); l2 = sizeof(tmp); DO(base64_decode(out, l1, tmp, &l2)); if (l2 != slen1 || l1 != strlen(cases[x].b64) || memcmp(tmp, cases[x].s, l2) || memcmp(out, cases[x].b64, l1)) { diff --git a/testprof/ecc_test.c b/testprof/ecc_test.c index d623af3b8..b7c4a8c8f 100644 --- a/testprof/ecc_test.c +++ b/testprof/ecc_test.c @@ -2,7 +2,7 @@ #ifdef LTC_MECC -static int sizes[] = { +static unsigned int sizes[] = { #ifdef ECC112 14, #endif @@ -47,7 +47,7 @@ int ecc_test_shamir(void) for (x = 0; x < (int)(sizeof(sizes)/sizeof(sizes[0])); x++) { /* get the base point */ for (z = 0; ltc_ecc_sets[z].name; z++) { - if (sizes[z] < ltc_ecc_sets[z].size) break; + if (sizes[z] < (unsigned int)ltc_ecc_sets[z].size) break; } LTC_ARGCHK(ltc_ecc_sets[z].name != NULL); @@ -68,7 +68,7 @@ int ecc_test_shamir(void) /* compute rA * G = A */ DO(ltc_mp.ecc_ptmul(rA, G, A, modulus, 1)); - + /* compute rB * G = B */ DO(ltc_mp.ecc_ptmul(rB, G, B, modulus, 1)); @@ -111,7 +111,7 @@ int ecc_tests (void) unsigned long x, y, z, s; int stat, stat2; ecc_key usera, userb, pubKey, privKey; - + DO(ecc_test ()); DO(ecc_test ()); DO(ecc_test ()); @@ -222,11 +222,11 @@ int ecc_tests (void) DO(ecc_verify_hash (buf[1], x, buf[0], 16, &stat, &pubKey)); buf[0][0] ^= 1; DO(ecc_verify_hash (buf[1], x, buf[0], 16, &stat2, &privKey)); - if (!(stat == 1 && stat2 == 0)) { + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "ecc_verify_hash failed %d, %d, ", stat, stat2); return 1; } - ecc_free (&usera); + ecc_free (&usera); ecc_free (&pubKey); ecc_free (&privKey); } diff --git a/testprof/pkcs_1_test.c b/testprof/pkcs_1_test.c index d0a368f7e..8bcfe8cdd 100644 --- a/testprof/pkcs_1_test.c +++ b/testprof/pkcs_1_test.c @@ -5,7 +5,7 @@ int pkcs_1_test(void) { unsigned char buf[3][128]; - int res1, res2, res3, prng_idx, hash_idx, err; + int res1, res2, res3, prng_idx, hash_idx; unsigned long x, y, l1, l2, l3, i1, i2, lparamlen, saltlen, modlen; static const unsigned char lparam[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }; diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 131e49edc..ef662d1fc 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -59,6 +59,7 @@ int ecc_tests(void); int dsa_test(void); int der_tests(void); int misc_test(void); +int base64_test(void); /* timing */ #define KTIMES 25 @@ -85,6 +86,7 @@ int time_keysched(void); int time_cipher(void); int time_cipher2(void); int time_cipher3(void); +int time_cipher4(void); int time_hash(void); void time_mult(void); void time_sqr(void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index cf9f3567b..15d5b543b 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -25,7 +25,7 @@ void tally_results(int type) if (type == 0) { for (x = 0; x < no_results; x++) { fprintf(stderr, "%-20s: Schedule at %6lu\n", cipher_descriptor[results[x].id].name, (unsigned long)results[x].spd1); - } + } } else if (type == 1) { for (x = 0; x < no_results; x++) { printf @@ -48,9 +48,12 @@ ulong64 rdtsc (void) asm ( " rdtsc ":"=A"(a)); return a; #elif defined(__i386__) || defined(__x86_64__) - ulong64 a; - asm __volatile__ ("rdtsc\nmovl %%eax,(%0)\nmovl %%edx,4(%0)\n"::"r"(&a):"%eax","%edx"); - return a; + /* version from http://www.mcs.anl.gov/~kazutomo/rdtsc.html + * the old code always got a warning issued by gcc, clang did not complain... + */ + unsigned hi, lo; + __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); + return ((ulong64)lo)|( ((ulong64)hi)<<32); #elif defined(LTC_PPC32) || defined(TFM_PPC32) unsigned long a, b; __asm__ __volatile__ ("mftbu %1 \nmftb %0\n":"=r"(a), "=r"(b)); @@ -69,9 +72,9 @@ ulong64 rdtsc (void) #else register unsigned long x, y; __asm__ __volatile__ ("rd %%tick, %0; clruw %0, %1; srlx %0, 32, %0" : "=r" (x), "=r" (y) : "0" (x), "1" (y)); - return ((unsigned long long) x << 32) | y; + return ((unsigned long long) x << 32) | y; #endif - #else + #else return XCLOCK(); #endif @@ -104,14 +107,13 @@ ulong64 t_read(void) void init_timer(void) { - ulong64 c1, c2, t1, t2, t3; + ulong64 c1, c2, t1, t2; unsigned long y1; c1 = c2 = (ulong64)-1; for (y1 = 0; y1 < TIMES*100; y1++) { t_start(); t1 = t_read(); - t3 = t_read(); t2 = (t_read() - t1)>>1; c1 = (t1 > c1) ? t1 : c1; @@ -237,7 +239,7 @@ void reg_algs(void) #endif -#ifndef LTC_YARROW +#ifndef LTC_YARROW #error This demo requires Yarrow. #endif register_prng(&yarrow_desc); @@ -255,7 +257,7 @@ register_prng(&sober128_desc); fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - + } int time_keysched(void) @@ -268,7 +270,7 @@ int time_keysched(void) unsigned char key[MAXBLOCKSIZE]; fprintf(stderr, "\n\nKey Schedule Time Trials for the Symmetric Ciphers:\n(Times are cycles per key)\n"); - no_results = 0; + no_results = 0; for (x = 0; cipher_descriptor[x].name != NULL; x++) { #define DO1(k) func(k, kl, 0, &skey); @@ -349,14 +351,14 @@ int time_cipher(void) } a2 = c2 - c1 - skew; ecb_done(&ecb); - + results[no_results].id = x; results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); - + #undef DO2 #undef DO1 } @@ -365,7 +367,7 @@ int time_cipher(void) return 0; } -#ifdef LTC_CBC_MODE +#ifdef LTC_CBC_MODE int time_cipher2(void) { unsigned long x, y1; @@ -421,14 +423,14 @@ int time_cipher2(void) } a2 = c2 - c1 - skew; cbc_done(&cbc); - + results[no_results].id = x; results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); - + #undef DO2 #undef DO1 } @@ -496,14 +498,14 @@ int time_cipher3(void) } a2 = c2 - c1 - skew; ctr_done(&ctr); - + results[no_results].id = x; results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); - + #undef DO2 #undef DO1 } @@ -573,14 +575,14 @@ int time_cipher4(void) a2 = c2 - c1 - skew; lrw_done(&lrw); - + results[no_results].id = x; results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); - + #undef DO2 #undef DO1 } @@ -677,7 +679,7 @@ void time_mult(void) #undef DO1 #undef DO2 -} +} void time_sqr(void) { @@ -712,7 +714,7 @@ void time_sqr(void) void time_mult(void) { fprintf(stderr, "NO MULT\n"); } void time_sqr(void) { fprintf(stderr, "NO SQR\n"); } #endif - + void time_prng(void) { ulong64 t1, t2; @@ -776,7 +778,7 @@ void time_dsa(void) static const struct { int group, modulus; } groups[] = { -{ 20, 96 }, +{ 20, 96 }, { 20, 128 }, { 24, 192 }, { 28, 256 }, @@ -810,7 +812,7 @@ static const struct { #endif -#ifdef LTC_MRSA +#ifdef LTC_MRSA /* time various RSA operations */ void time_rsa(void) { @@ -870,7 +872,7 @@ void time_rsa(void) t_start(); t1 = t_read(); zzz = sizeof(buf[0]); - if ((err = rsa_decrypt_key(buf[1], z, buf[0], &zzz, (const unsigned char *)"testprog", 8, find_hash("sha1"), + if ((err = rsa_decrypt_key(buf[1], z, buf[0], &zzz, (const unsigned char *)"testprog", 8, find_hash("sha1"), &zz, &key)) != CRYPT_OK) { fprintf(stderr, "\n\nrsa_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); @@ -890,7 +892,7 @@ void time_rsa(void) t_start(); t1 = t_read(); z = sizeof(buf[1]); - if ((err = rsa_sign_hash(buf[0], 20, buf[1], &z, &yarrow_prng, + if ((err = rsa_sign_hash(buf[0], 20, buf[1], &z, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), 8, &key)) != CRYPT_OK) { fprintf(stderr, "\n\nrsa_sign_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); @@ -934,7 +936,7 @@ void time_rsa(void) void time_rsa(void) { fprintf(stderr, "NO RSA\n"); } #endif -#ifdef MKAT +#ifdef MKAT /* time various KAT operations */ void time_katja(void) { @@ -985,7 +987,7 @@ void time_katja(void) t_start(); t1 = t_read(); zzz = sizeof(buf[0]); - if ((err = katja_decrypt_key(buf[1], z, buf[0], &zzz, "testprog", 8, find_hash("sha1"), + if ((err = katja_decrypt_key(buf[1], z, buf[0], &zzz, "testprog", 8, find_hash("sha1"), &zz, &key)) != CRYPT_OK) { fprintf(stderr, "\n\nkatja_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); @@ -1015,28 +1017,28 @@ void time_ecc(void) int err, stat; static unsigned long sizes[] = { #ifdef ECC112 -112/8, +112/8, #endif #ifdef ECC128 -128/8, +128/8, #endif #ifdef ECC160 -160/8, +160/8, #endif #ifdef ECC192 -192/8, +192/8, #endif #ifdef ECC224 224/8, #endif #ifdef ECC256 -256/8, +256/8, #endif #ifdef ECC384 -384/8, +384/8, #endif #ifdef ECC521 -521/8, +521/8, #endif 100000}; @@ -1108,7 +1110,7 @@ void time_ecc(void) t_start(); t1 = t_read(); z = sizeof(buf[1]); - if ((err = ecc_sign_hash(buf[0], 20, buf[1], &z, &yarrow_prng, + if ((err = ecc_sign_hash(buf[0], 20, buf[1], &z, &yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) { fprintf(stderr, "\n\necc_sign_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); @@ -1170,7 +1172,7 @@ void time_macs_(unsigned long MAC_SIZE) cipher_idx = find_cipher("aes"); hash_idx = find_hash("sha1"); - + if (cipher_idx == -1 || hash_idx == -1) { fprintf(stderr, "Warning the MAC tests requires AES and LTC_SHA1 to operate... so sorry\n"); return; @@ -1345,7 +1347,7 @@ void time_encmacs_(unsigned long MAC_SIZE) t_start(); t1 = t_read(); z = 16; - if ((err = ocb3_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 16, "", 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { + if ((err = ocb3_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 16, (unsigned char*)"", 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { fprintf(stderr, "\nOCB3 error... %s\n", error_to_string(err)); exit(EXIT_FAILURE); } @@ -1369,7 +1371,7 @@ void time_encmacs_(unsigned long MAC_SIZE) if (t1 < t2) t2 = t1; } fprintf(stderr, "CCM (no-precomp) \t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); - + cipher_descriptor[cipher_idx].setup(key, 16, 0, &skey); t2 = -1; for (x = 0; x < 10000; x++) { @@ -1384,7 +1386,7 @@ void time_encmacs_(unsigned long MAC_SIZE) if (t1 < t2) t2 = t1; } fprintf(stderr, "CCM (precomp) \t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); - cipher_descriptor[cipher_idx].done(&skey); + cipher_descriptor[cipher_idx].done(&skey); #endif #ifdef LTC_GCM_MODE @@ -1431,7 +1433,7 @@ __attribute__ ((aligned (16))) fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); exit(EXIT_FAILURE); } - + if ((err = gcm_done(&gcm, tag, &z)) != CRYPT_OK) { fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); exit(EXIT_FAILURE); @@ -1444,7 +1446,7 @@ __attribute__ ((aligned (16))) #endif -} +} void time_encmacs(void) { From a06e40aa17d996cd5cff2313b230880ee5d744ba Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 May 2014 18:13:21 +0200 Subject: [PATCH 0168/1192] only run tests when build was without warnings --- build.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 44ef0bd97..579012200 100755 --- a/build.sh +++ b/build.sh @@ -1,9 +1,23 @@ #!/bin/bash echo "$1 ($2, $3)..." + make clean 1>/dev/null 2>/dev/null + echo -n "building..." -CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt || (echo "build $1 failed see gcc_2.txt for more information" && cat gcc_2.txt && exit 1) + +CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt +mret=$? +cnt=$(wc -l < gcc_2.txt) +# ignore 2 lines since ar prints to stderr instead of stdout and ar is called for +# $(LIBNAME) and testprof/$(LIBTEST_S) +if [[ $mret -ne 0 ]] || [[ $cnt -gt 2 ]]; then + echo "build $1 failed! printing gcc_2.txt now for convenience" + cat gcc_2.txt + exit 1 +fi + echo -n "testing..." + if [ -a test ] && [ -f test ] && [ -x test ]; then ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1) if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then From d2318d6c2442734e8884ff6550d3daf780f6ad71 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 May 2014 18:31:14 +0200 Subject: [PATCH 0169/1192] travis.yml: fix typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3ac670b5a..0e608ac16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ env: - BUILDSCRIPT="run.sh" BUILDNAME="NO_FAST+NOTABLES" BUILDOPTIONS="-DLTC_NO_FAST -DLTC_NO_TABLES" - BUILDSCRIPT="run.sh" BUILDNAME="NO_ASM" BUILDOPTIONS="-DLTC_NO_ASM" - BUILDSCRIPT="testbuild.sh" BUILDNAME="NOTEST" BUILDOPTIONS="-DLTC_NO_TEST" - - BUILDSCRIPT="testbuild.sh" BUILDNAME="NOFILE" BUILDOPTIONS="-DLTC_NO_TEST" + - BUILDSCRIPT="testbuild.sh" BUILDNAME="NOFILE" BUILDOPTIONS="-DLTC_NO_FILE" matrix: fast_finish: true branches: From ca1a1d18ab690749f6a87ebf9db75e6ffb4e34f1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 May 2014 15:18:51 +0200 Subject: [PATCH 0170/1192] anubis: trim trailing spaces --- src/ciphers/anubis.c | 46 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index 229d5e8da..2533c727b 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -32,14 +32,14 @@ const struct ltc_cipher_descriptor anubis_desc = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -#define MIN_N 4 -#define MAX_N 10 -#define MIN_ROUNDS (8 + MIN_N) -#define MAX_ROUNDS (8 + MAX_N) -#define MIN_KEYSIZEB (4*MIN_N) -#define MAX_KEYSIZEB (4*MAX_N) -#define BLOCKSIZE 128 -#define BLOCKSIZEB (BLOCKSIZE/8) +#define MIN_N 4 +#define MAX_N 10 +#define MIN_ROUNDS (8 + MIN_N) +#define MAX_ROUNDS (8 + MAX_N) +#define MIN_KEYSIZEB (4*MIN_N) +#define MAX_KEYSIZEB (4*MAX_N) +#define BLOCKSIZE 128 +#define BLOCKSIZEB (BLOCKSIZE/8) /* @@ -1034,7 +1034,7 @@ int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetri return err; } #endif - + static void anubis_crypt(const unsigned char *plaintext, unsigned char *ciphertext, ulong32 roundKey[18 + 1][4], int R) { @@ -1149,7 +1149,7 @@ int anubis_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key Decrypts a block of text with Anubis @param ct The input ciphertext (16 bytes) @param pt The output plaintext (16 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ int anubis_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -1181,7 +1181,7 @@ int anubis_test(void) 16, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xF0, 0x68, 0x60, 0xFC, 0x67, 0x30, 0xE8, 0x18, + { 0xF0, 0x68, 0x60, 0xFC, 0x67, 0x30, 0xE8, 0x18, 0xF1, 0x32, 0xC7, 0x8A, 0xF4, 0x13, 0x2A, 0xFE }, { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } @@ -1189,7 +1189,7 @@ int anubis_test(void) 16, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xA8, 0x66, 0x84, 0x80, 0x07, 0x74, 0x5C, 0x89, + { 0xA8, 0x66, 0x84, 0x80, 0x07, 0x74, 0x5C, 0x89, 0xFC, 0x5E, 0xB5, 0xBA, 0xD4, 0xFE, 0x32, 0x6D }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } @@ -1221,7 +1221,7 @@ int anubis_test(void) 24, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x17, 0xAC, 0x57, 0x44, 0x9D, 0x59, 0x61, 0x66, + { 0x17, 0xAC, 0x57, 0x44, 0x9D, 0x59, 0x61, 0x66, 0xD0, 0xC7, 0x9E, 0x04, 0x7C, 0xC7, 0x58, 0xF0 }, { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1230,7 +1230,7 @@ int anubis_test(void) 24, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x71, 0x52, 0xB4, 0xEB, 0x1D, 0xAA, 0x36, 0xFD, + { 0x71, 0x52, 0xB4, 0xEB, 0x1D, 0xAA, 0x36, 0xFD, 0x57, 0x14, 0x5F, 0x57, 0x04, 0x9F, 0x70, 0x74 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1242,7 +1242,7 @@ int anubis_test(void) 28, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xA2, 0xF0, 0xA6, 0xB9, 0x17, 0x93, 0x2A, 0x3B, + { 0xA2, 0xF0, 0xA6, 0xB9, 0x17, 0x93, 0x2A, 0x3B, 0xEF, 0x08, 0xE8, 0x7A, 0x58, 0xD6, 0xF8, 0x53 }, { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1252,7 +1252,7 @@ int anubis_test(void) 28, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xF0, 0xCA, 0xFC, 0x78, 0x8B, 0x4B, 0x4E, 0x53, + { 0xF0, 0xCA, 0xFC, 0x78, 0x8B, 0x4B, 0x4E, 0x53, 0x8B, 0xC4, 0x32, 0x6A, 0xF5, 0xB9, 0x1B, 0x5F }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1265,7 +1265,7 @@ int anubis_test(void) 32, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xE0, 0x86, 0xAC, 0x45, 0x6B, 0x3C, 0xE5, 0x13, + { 0xE0, 0x86, 0xAC, 0x45, 0x6B, 0x3C, 0xE5, 0x13, 0xED, 0xF5, 0xDF, 0xDD, 0xD6, 0x3B, 0x71, 0x93 }, { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1275,7 +1275,7 @@ int anubis_test(void) 32, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x50, 0x01, 0xB9, 0xF5, 0x21, 0xC1, 0xC1, 0x29, + { 0x50, 0x01, 0xB9, 0xF5, 0x21, 0xC1, 0xC1, 0x29, 0x00, 0xD5, 0xEC, 0x98, 0x2B, 0x9E, 0xE8, 0x21 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1288,7 +1288,7 @@ int anubis_test(void) 36, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xE8, 0xF4, 0xAF, 0x2B, 0x21, 0xA0, 0x87, 0x9B, + { 0xE8, 0xF4, 0xAF, 0x2B, 0x21, 0xA0, 0x87, 0x9B, 0x41, 0x95, 0xB9, 0x71, 0x75, 0x79, 0x04, 0x7C }, { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1299,7 +1299,7 @@ int anubis_test(void) 36, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xE6, 0xA6, 0xA5, 0xBC, 0x8B, 0x63, 0x6F, 0xE2, + { 0xE6, 0xA6, 0xA5, 0xBC, 0x8B, 0x63, 0x6F, 0xE2, 0xBD, 0xA7, 0xA7, 0x53, 0xAB, 0x40, 0x22, 0xE0 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1313,7 +1313,7 @@ int anubis_test(void) 40, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x17, 0x04, 0xD7, 0x2C, 0xC6, 0x85, 0x76, 0x02, + { 0x17, 0x04, 0xD7, 0x2C, 0xC6, 0x85, 0x76, 0x02, 0x4B, 0xCC, 0x39, 0x80, 0xD8, 0x22, 0xEA, 0xA4 }, { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1324,7 +1324,7 @@ int anubis_test(void) 40, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x7A, 0x41, 0xE6, 0x7D, 0x4F, 0xD8, 0x64, 0xF0, + { 0x7A, 0x41, 0xE6, 0x7D, 0x4F, 0xD8, 0x64, 0xF0, 0x44, 0xA8, 0x3C, 0x73, 0x81, 0x7E, 0x53, 0xD8 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1515,7 +1515,7 @@ int anubis_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void anubis_done(symmetric_key *skey) From bbf278c779079433818e673d8619dec30ab48238 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 1 May 2014 15:27:20 +0200 Subject: [PATCH 0171/1192] anubis: fix left-shift this has been brought up in #26 --- src/ciphers/anubis.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index 2533c727b..36f480d43 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -931,10 +931,10 @@ int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetri */ for (i = 0, pos = 0; i < N; i++, pos += 4) { kappa[i] = - (key[pos ] << 24) ^ - (key[pos + 1] << 16) ^ - (key[pos + 2] << 8) ^ - (key[pos + 3] ); + (((ulong32)key[pos ]) << 24) ^ + (((ulong32)key[pos + 1]) << 16) ^ + (((ulong32)key[pos + 2]) << 8) ^ + (((ulong32)key[pos + 3]) ); } /* @@ -1048,10 +1048,10 @@ static void anubis_crypt(const unsigned char *plaintext, unsigned char *cipherte */ for (i = 0, pos = 0; i < 4; i++, pos += 4) { state[i] = - (plaintext[pos ] << 24) ^ - (plaintext[pos + 1] << 16) ^ - (plaintext[pos + 2] << 8) ^ - (plaintext[pos + 3] ) ^ + (((ulong32)plaintext[pos ]) << 24) ^ + (((ulong32)plaintext[pos + 1]) << 16) ^ + (((ulong32)plaintext[pos + 2]) << 8) ^ + (((ulong32)plaintext[pos + 3]) ) ^ roundKey[0][i]; } From f9a10412226519aa06bca5ab66cd608ecb7be42b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 5 May 2014 10:49:29 +0200 Subject: [PATCH 0172/1192] printinfo: display version of correct compiler if CC does not point to gcc [skip ci] --- printinfo.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/printinfo.sh b/printinfo.sh index ba40a0a2c..1249e090a 100644 --- a/printinfo.sh +++ b/printinfo.sh @@ -12,5 +12,9 @@ echo "Testing version:" $version echo "uname="`uname -a` # get gcc name -echo "gcc="`gcc -dumpversion` +if [ -z ${CC} ] +then + CC="gcc" +fi +echo "${CC}="`${CC} -dumpversion` echo From 1a44e2d22dd39f4616b9fc4facbee768f049921c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 5 May 2014 11:06:40 +0200 Subject: [PATCH 0173/1192] send coverage results to coveralls --- .travis.yml | 2 ++ coverage.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 coverage.sh diff --git a/.travis.yml b/.travis.yml index 0e608ac16..e46cdc170 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ compiler: - gcc script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a" env: + - BUILDSCRIPT="coverage.sh" BUILDNAME="COVERAGE" BUILDOPTIONS=" " - BUILDSCRIPT="run.sh" BUILDNAME="STOCK" BUILDOPTIONS=" " - BUILDSCRIPT="run.sh" BUILDNAME="SMALL" BUILDOPTIONS="-DLTC_SMALL_CODE" - BUILDSCRIPT="run.sh" BUILDNAME="NOTABLES" BUILDOPTIONS="-DLTC_NO_TABLES" @@ -23,6 +24,7 @@ branches: - develop before_script: - sudo apt-get install libtommath-dev + - sudo pip install cpp-coveralls after_failure: - cat test_std.txt - cat test_err.txt diff --git a/coverage.sh b/coverage.sh new file mode 100755 index 000000000..e3ad797c8 --- /dev/null +++ b/coverage.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ -z "$(echo $CC | grep "gcc")" ]; then + echo "no gcc detected, early exit success" + exit 0 +fi + +# output version +bash printinfo.sh + +bash build.sh " $1" " $2" " $3 " "$4 -fprofile-arcs -ftest-coverage " "$5 -lgcov" +if [ -a testok.txt ] && [ -f testok.txt ]; then + echo +else + echo + echo "Test failed" + exit 1 +fi + +cpp-coveralls + +exit 0 + +# $Source$ +# $Revision$ +# $Date$ From 2b04f3d8ed1b5d8828ecd0813aea19027af7d96e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 7 May 2014 17:03:12 +0200 Subject: [PATCH 0174/1192] Readme: display the coverage status [skip ci] --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e671a42d4..5a520b8ef 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ libtomcrypt See doc/crypt.pdf for a detailed documentation -Build Status ------------- +Project Status +-------------- -develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://travis-ci.org/libtom/libtomcrypt) +develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://travis-ci.org/libtom/libtomcrypt) [![Coverage Status](https://coveralls.io/repos/libtom/libtomcrypt/badge.png?branch=develop)](https://coveralls.io/r/libtom/libtomcrypt) Submitting patches ------------------ From a59e5548ece7d44a006190f178346a0261c7edf2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 7 May 2014 17:36:09 +0200 Subject: [PATCH 0175/1192] tests: unregister ciphers etc. at exit, call error_to_string() --- testprof/x86_prof.c | 132 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 15d5b543b..8ff77cba6 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -123,9 +123,137 @@ void init_timer(void) fprintf(stderr, "Clock Skew: %lu\n", (unsigned long)skew); } +/* + * unregister ciphers, hashes & prngs + */ +static void _unregister_all(void) +{ +#ifdef LTC_RIJNDAEL + unregister_cipher(&aes_desc); +#endif +#ifdef LTC_BLOWFISH + unregister_cipher(&blowfish_desc); +#endif +#ifdef LTC_XTEA + unregister_cipher(&xtea_desc); +#endif +#ifdef LTC_RC5 + unregister_cipher(&rc5_desc); +#endif +#ifdef LTC_RC6 + unregister_cipher(&rc6_desc); +#endif +#ifdef LTC_SAFERP + unregister_cipher(&saferp_desc); +#endif +#ifdef LTC_TWOFISH + unregister_cipher(&twofish_desc); +#endif +#ifdef LTC_SAFER + unregister_cipher(&safer_k64_desc); + unregister_cipher(&safer_sk64_desc); + unregister_cipher(&safer_k128_desc); + unregister_cipher(&safer_sk128_desc); +#endif +#ifdef LTC_RC2 + unregister_cipher(&rc2_desc); +#endif +#ifdef LTC_DES + unregister_cipher(&des_desc); + unregister_cipher(&des3_desc); +#endif +#ifdef LTC_CAST5 + unregister_cipher(&cast5_desc); +#endif +#ifdef LTC_NOEKEON + unregister_cipher(&noekeon_desc); +#endif +#ifdef LTC_SKIPJACK + unregister_cipher(&skipjack_desc); +#endif +#ifdef LTC_KHAZAD + unregister_cipher(&khazad_desc); +#endif +#ifdef LTC_ANUBIS + unregister_cipher(&anubis_desc); +#endif +#ifdef LTC_KSEED + unregister_cipher(&kseed_desc); +#endif +#ifdef LTC_KASUMI + unregister_cipher(&kasumi_desc); +#endif +#ifdef LTC_MULTI2 + unregister_cipher(&multi2_desc); +#endif +#ifdef LTC_CAMELLIA + unregister_cipher(&camellia_desc); +#endif + +#ifdef LTC_TIGER + unregister_hash(&tiger_desc); +#endif +#ifdef LTC_MD2 + unregister_hash(&md2_desc); +#endif +#ifdef LTC_MD4 + unregister_hash(&md4_desc); +#endif +#ifdef LTC_MD5 + unregister_hash(&md5_desc); +#endif +#ifdef LTC_SHA1 + unregister_hash(&sha1_desc); +#endif +#ifdef LTC_SHA224 + unregister_hash(&sha224_desc); +#endif +#ifdef LTC_SHA256 + unregister_hash(&sha256_desc); +#endif +#ifdef LTC_SHA384 + unregister_hash(&sha384_desc); +#endif +#ifdef LTC_SHA512 + unregister_hash(&sha512_desc); +#endif +#ifdef LTC_RIPEMD128 + unregister_hash(&rmd128_desc); +#endif +#ifdef LTC_RIPEMD160 + unregister_hash(&rmd160_desc); +#endif +#ifdef LTC_RIPEMD256 + unregister_hash(&rmd256_desc); +#endif +#ifdef LTC_RIPEMD320 + unregister_hash(&rmd320_desc); +#endif +#ifdef LTC_WHIRLPOOL + unregister_hash(&whirlpool_desc); +#endif +#ifdef LTC_CHC_HASH + unregister_hash(&chc_desc); +#endif + + unregister_prng(&yarrow_desc); +#ifdef LTC_FORTUNA + unregister_prng(&fortuna_desc); +#endif +#ifdef LTC_RC4 + unregister_prng(&rc4_desc); +#endif +#ifdef LTC_SOBER128 + unregister_prng(&sober128_desc); +#endif +} /* _cleanup() */ + void reg_algs(void) { int err; + + atexit(_unregister_all); + #ifdef LTC_RIJNDAEL register_cipher (&aes_desc); #endif @@ -258,6 +386,10 @@ register_prng(&sober128_desc); exit(EXIT_FAILURE); } + if (strcmp("CRYPT_OK", error_to_string(err))) { + exit(EXIT_FAILURE); + } + } int time_keysched(void) From 3dcf2df98853f62592edb182aa1ee0d5d25e04d2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 7 May 2014 17:36:50 +0200 Subject: [PATCH 0176/1192] coverage: exclude some folders --- coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coverage.sh b/coverage.sh index e3ad797c8..7aa7c43e8 100755 --- a/coverage.sh +++ b/coverage.sh @@ -17,7 +17,7 @@ else exit 1 fi -cpp-coveralls +cpp-coveralls -e 'demos/' -e 'testprof/' -e 'notes/' -e 'src/headers/' exit 0 From 26743d0749539fd2f2e1b92401eca23ee3d36709 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 May 2014 13:06:24 +0200 Subject: [PATCH 0177/1192] ecc_mulmod_timing: fix compiler warnings --- src/pk/ecc/ltc_ecc_mulmod_timing.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pk/ecc/ltc_ecc_mulmod_timing.c b/src/pk/ecc/ltc_ecc_mulmod_timing.c index 863ed07c8..9e819c82e 100644 --- a/src/pk/ecc/ltc_ecc_mulmod_timing.c +++ b/src/pk/ecc/ltc_ecc_mulmod_timing.c @@ -19,7 +19,7 @@ /** @file ltc_ecc_mulmod_timing.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC @@ -40,7 +40,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) int i, j, err; void *mu, *mp; unsigned long buf; - int first, bitbuf, bitcpy, bitcnt, mode, digidx; + int bitcnt, mode, digidx; LTC_ARGCHK(k != NULL); LTC_ARGCHK(G != NULL); @@ -84,7 +84,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } mp_clear(mu); mu = NULL; - + /* calc the M tab */ /* M[0] == G */ if ((err = mp_copy(tG->x, M[0]->x)) != CRYPT_OK) { goto done; } @@ -98,8 +98,6 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) bitcnt = 1; buf = 0; digidx = mp_get_digit_count(k) - 1; - bitcpy = bitbuf = 0; - first = 1; /* perform ops */ for (;;) { From c63c0433c1d03b77af2ee341d0e7c3633d34e672 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 May 2014 15:06:42 +0200 Subject: [PATCH 0178/1192] enable timing resistant ECC calculations by default --- src/headers/tomcrypt_custom.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index e34beb14d..0494202ab 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -358,8 +358,10 @@ /* do we want fixed point ECC */ /* #define LTC_MECC_FP */ -/* Timing Resistant? */ -/* #define LTC_ECC_TIMING_RESISTANT */ +#ifndef LTC_NO_ECC_TIMING_RESISTANT +/* Enable ECC timing resistant version by default */ +#define LTC_ECC_TIMING_RESISTANT +#endif #endif /* LTC_NO_PK */ From 3b97738ee97101af7ebd2eeab29312c807055f99 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 May 2014 15:08:31 +0200 Subject: [PATCH 0179/1192] travis.yml: rewrite to be better human-readable; trim trailing spaces --- .travis.yml | 110 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index e46cdc170..46973846f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,76 @@ -language: c -compiler: - - gcc -script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a" -env: - - BUILDSCRIPT="coverage.sh" BUILDNAME="COVERAGE" BUILDOPTIONS=" " - - BUILDSCRIPT="run.sh" BUILDNAME="STOCK" BUILDOPTIONS=" " - - BUILDSCRIPT="run.sh" BUILDNAME="SMALL" BUILDOPTIONS="-DLTC_SMALL_CODE" - - BUILDSCRIPT="run.sh" BUILDNAME="NOTABLES" BUILDOPTIONS="-DLTC_NO_TABLES" - - BUILDSCRIPT="run.sh" BUILDNAME="SMALL+NOTABLES" BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_NO_TABLES" - - BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK" BUILDOPTIONS="-DLTC_CLEAN_STACK" - - BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK+SMALL" BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_CLEAN_STACK" - - BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK+NOTABLES" BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK" - - BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK+NOTABLES+SMALL" BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK -DLTC_SMALL_CODE" - - BUILDSCRIPT="run.sh" BUILDNAME="NO_FAST" BUILDOPTIONS="-DLTC_NO_FAST" - - BUILDSCRIPT="run.sh" BUILDNAME="NO_FAST+NOTABLES" BUILDOPTIONS="-DLTC_NO_FAST -DLTC_NO_TABLES" - - BUILDSCRIPT="run.sh" BUILDNAME="NO_ASM" BUILDOPTIONS="-DLTC_NO_ASM" - - BUILDSCRIPT="testbuild.sh" BUILDNAME="NOTEST" BUILDOPTIONS="-DLTC_NO_TEST" - - BUILDSCRIPT="testbuild.sh" BUILDNAME="NOFILE" BUILDOPTIONS="-DLTC_NO_FILE" -matrix: - fast_finish: true -branches: - only: - - develop -before_script: - - sudo apt-get install libtommath-dev - - sudo pip install cpp-coveralls -after_failure: - - cat test_std.txt - - cat test_err.txt -after_script: - - cat gcc_2.txt -notifications: - irc: "chat.freenode.net#libtom" +language: c +compiler: + - gcc +script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a" +env: + - | + BUILDSCRIPT="coverage.sh" + BUILDNAME="COVERAGE" + BUILDOPTIONS=" " + - | + BUILDSCRIPT="run.sh" + BUILDNAME="STOCK" + BUILDOPTIONS=" " + - | + BUILDSCRIPT="run.sh" + BUILDNAME="SMALL" + BUILDOPTIONS="-DLTC_SMALL_CODE" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="NOTABLES" + BUILDOPTIONS="-DLTC_NO_TABLES" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="SMALL+NOTABLES" + BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_NO_TABLES" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="CLEANSTACK" + BUILDOPTIONS="-DLTC_CLEAN_STACK" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="CLEANSTACK+SMALL" + BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_CLEAN_STACK" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="CLEANSTACK+NOTABLES" + BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="CLEANSTACK+NOTABLES+SMALL" + BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK -DLTC_SMALL_CODE" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="NO_FAST" + BUILDOPTIONS="-DLTC_NO_FAST" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="NO_FAST+NOTABLES" + BUILDOPTIONS="-DLTC_NO_FAST -DLTC_NO_TABLES" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="NO_ASM" + BUILDOPTIONS="-DLTC_NO_ASM" + - | + BUILDSCRIPT="testbuild.sh" + BUILDNAME="NOTEST" + BUILDOPTIONS="-DLTC_NO_TEST" + - | + BUILDSCRIPT="testbuild.sh" + BUILDNAME="NOFILE" + BUILDOPTIONS="-DLTC_NO_FILE" +matrix: + fast_finish: true +branches: + only: + - develop +before_script: + - sudo apt-get install libtommath-dev + - sudo pip install cpp-coveralls +after_failure: + - cat test_std.txt + - cat test_err.txt +after_script: + - cat gcc_2.txt +notifications: + irc: "chat.freenode.net#libtom" From e723d1289f42d518f6464411b49a8b6bc6f1f0b4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 May 2014 15:10:09 +0200 Subject: [PATCH 0180/1192] travis.yml: add test runs without "timing resistance" --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 46973846f..0189968ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,6 +51,14 @@ env: BUILDSCRIPT="run.sh" BUILDNAME="NO_ASM" BUILDOPTIONS="-DLTC_NO_ASM" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="NO_TIMING_RESISTANCE" + BUILDOPTIONS="-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE" + BUILDOPTIONS="-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" - | BUILDSCRIPT="testbuild.sh" BUILDNAME="NOTEST" From 24d03dd82371505b7502c2423760e1a6da8d0f61 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 May 2014 15:11:38 +0200 Subject: [PATCH 0181/1192] testme.sh: add test runs without "timing resistance" --- testme.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testme.sh b/testme.sh index fd049537b..d2e9e74df 100755 --- a/testme.sh +++ b/testme.sh @@ -43,6 +43,12 @@ bash run.sh "NO_FAST+NOTABLES" "-DLTC_NO_FAST -DLTC_NO_TABLES" "$1" "$2" "$3" || # NO_ASM bash run.sh "NO_ASM" "-DLTC_NO_ASM" "$1" "$2" "$3" || exit 1 +# NO_TIMING_RESISTANCE +bash run.sh "NO_TIMING_RESISTANCE" "-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" "$1" "$2" "$3" || exit 1 + +# CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE +bash run.sh "CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE" "-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" "$1" "$2" "$3" || exit 1 + # test build with no testing bash testbuild.sh "NOTEST" "-DLTC_NO_TEST" "$1" "$2" "$3" || exit 1 From 72022edb8dd55e31e8d177c78907955df5a4a81d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 10 Oct 2013 00:53:04 +0200 Subject: [PATCH 0182/1192] dsa_make_key: improved testing x < q --- src/pk/dsa/dsa_make_key.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 1c16d032f..f82934f19 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -29,7 +29,7 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) { void *tmp, *tmp2; - int err, res; + int err, res, q_size; unsigned char *buf; LTC_ARGCHK(key != NULL); @@ -104,13 +104,14 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, /* so now we have our DH structure, generator g, order q, modulus p Now we need a random exponent [mod q] and it's power g^x mod p */ + q_size = mp_unsigned_bin_size(key->q); do { - if (prng_descriptor[wprng].read(buf, group_size, prng) != (unsigned long)group_size) { + if (prng_descriptor[wprng].read(buf, q_size, prng) != (unsigned long)q_size) { err = CRYPT_ERROR_READPRNG; goto error; } - if ((err = mp_read_unsigned_bin(key->x, buf, group_size)) != CRYPT_OK) { goto error; } - } while (mp_cmp_d(key->x, 1) != LTC_MP_GT); + if ((err = mp_read_unsigned_bin(key->x, buf, q_size)) != CRYPT_OK) { goto error; } + } while (mp_cmp_d(key->x, 1) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT); if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto error; } key->type = PK_PRIVATE; From e600ab9d350d0018ffa551cbcb7a6235978b6c96 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 9 Oct 2013 20:34:28 +0200 Subject: [PATCH 0183/1192] dsa_sign_hash: testing k < q --- src/pk/dsa/dsa_sign_hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/dsa/dsa_sign_hash.c b/src/pk/dsa/dsa_sign_hash.c index 3fc7e99d0..ef5479177 100644 --- a/src/pk/dsa/dsa_sign_hash.c +++ b/src/pk/dsa/dsa_sign_hash.c @@ -73,8 +73,8 @@ int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, /* read k */ if ((err = mp_read_unsigned_bin(k, buf, key->qord)) != CRYPT_OK) { goto error; } - /* k > 1 ? */ - if (mp_cmp_d(k, 1) != LTC_MP_GT) { goto retry; } + /* k > 1 and k < q ? */ + if (mp_cmp_d(k, 1) != LTC_MP_GT || mp_cmp(k, key->q) != LTC_MP_LT) { goto retry; } /* test gcd */ if ((err = mp_gcd(k, key->q, tmp)) != CRYPT_OK) { goto error; } From e271b9fdbeae00f234a9ec444df1594ff57557de Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 7 Jan 2014 21:39:25 +0100 Subject: [PATCH 0184/1192] ECC key pair generation according to FIPS-186-4 --- src/headers/tomcrypt_pk.h | 2 ++ src/math/rand_bn.c | 69 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100755 src/math/rand_bn.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 0d1e72552..2a8987b98 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -6,6 +6,8 @@ enum { }; int rand_prime(void *N, long len, prng_state *prng, int wprng); +int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng); +int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng); enum { PKA_RSA, diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c new file mode 100755 index 000000000..c066501be --- /dev/null +++ b/src/math/rand_bn.c @@ -0,0 +1,69 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + */ +#include "tomcrypt.h" + +/** + Generate a random number N with given bitlength (note: MSB can be 0) +*/ + +int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng) +{ + int res, bytes; + unsigned char *buf, mask; + + LTC_ARGCHK(N != NULL); + LTC_ARGCHK(bits > 1); + + /* check PRNG */ + if ((res = prng_is_valid(wprng)) != CRYPT_OK) return res; + + bytes = (bits+7) >> 3; + mask = 0xff << (8 - bits % 8); + + /* allocate buffer */ + if ((buf = XCALLOC(1, bytes)) == NULL) return CRYPT_MEM; + + /* generate random bytes */ + if (prng_descriptor[wprng].read(buf, bytes, prng) != (unsigned long)bytes) { + res = CRYPT_ERROR_READPRNG; + goto cleanup; + } + /* mask bits */ + buf[0] &= ~mask; + /* load value */ + if ((res = mp_read_unsigned_bin(N, buf, bytes)) != CRYPT_OK) goto cleanup; + + res = CRYPT_OK; + +cleanup: +#ifdef LTC_CLEAN_STACK + zeromem(buf, len); +#endif + XFREE(buf); + return res; +} + +/** + Generate a random number N in a range: 0 <= N < limit +*/ +int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng) +{ + int res; + + LTC_ARGCHK(N != NULL); + LTC_ARGCHK(limit != NULL); + + do { + res = rand_bn_bits(N, mp_count_bits(limit), prng, wprng); + if (res != CRYPT_OK) return res; + } while (mp_cmp(N, limit) != LTC_MP_LT); + + return CRYPT_OK; +} From 3908c70d68784f6a2ce1695f0c8b4785cb50908a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 12 Jan 2014 21:50:56 +0100 Subject: [PATCH 0185/1192] tuning DSA key generation --- src/pk/dsa/dsa_make_key.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index f82934f19..fa9805c3c 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -29,7 +29,7 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) { void *tmp, *tmp2; - int err, res, q_size; + int err, res, qbits; unsigned char *buf; LTC_ARGCHK(key != NULL); @@ -104,14 +104,11 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, /* so now we have our DH structure, generator g, order q, modulus p Now we need a random exponent [mod q] and it's power g^x mod p */ - q_size = mp_unsigned_bin_size(key->q); + qbits = mp_count_bits(key->q); do { - if (prng_descriptor[wprng].read(buf, q_size, prng) != (unsigned long)q_size) { - err = CRYPT_ERROR_READPRNG; - goto error; - } - if ((err = mp_read_unsigned_bin(key->x, buf, q_size)) != CRYPT_OK) { goto error; } - } while (mp_cmp_d(key->x, 1) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT); + if ((err = rand_bn_bits(key->x, qbits, prng, wprng)) != CRYPT_OK) { goto error; } + /* private key x should be from range: 1 <= x <= q-1 */ + } while (mp_cmp_d(key->x, 0) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT); if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto error; } key->type = PK_PRIVATE; From 67a547086c45068061d8854a164467b35ea99651 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 13 Jan 2014 12:59:02 +0100 Subject: [PATCH 0186/1192] DSA sign improvement --- src/pk/dsa/dsa_make_key.c | 2 +- src/pk/dsa/dsa_sign_hash.c | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index fa9805c3c..af3a81a64 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -107,7 +107,7 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, qbits = mp_count_bits(key->q); do { if ((err = rand_bn_bits(key->x, qbits, prng, wprng)) != CRYPT_OK) { goto error; } - /* private key x should be from range: 1 <= x <= q-1 */ + /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ } while (mp_cmp_d(key->x, 0) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT); if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto error; } diff --git a/src/pk/dsa/dsa_sign_hash.c b/src/pk/dsa/dsa_sign_hash.c index ef5479177..3ccfcf575 100644 --- a/src/pk/dsa/dsa_sign_hash.c +++ b/src/pk/dsa/dsa_sign_hash.c @@ -34,7 +34,7 @@ int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, { void *k, *kinv, *tmp; unsigned char *buf; - int err; + int err, qbits; LTC_ARGCHK(in != NULL); LTC_ARGCHK(r != NULL); @@ -61,20 +61,15 @@ int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, /* Init our temps */ if ((err = mp_init_multi(&k, &kinv, &tmp, NULL)) != CRYPT_OK) { goto ERRBUF; } + qbits = mp_count_bits(key->q); retry: do { /* gen random k */ - if (prng_descriptor[wprng].read(buf, key->qord, prng) != (unsigned long)key->qord) { - err = CRYPT_ERROR_READPRNG; - goto error; - } + if ((err = rand_bn_bits(k, qbits, prng, wprng)) != CRYPT_OK) { goto error; } - /* read k */ - if ((err = mp_read_unsigned_bin(k, buf, key->qord)) != CRYPT_OK) { goto error; } - - /* k > 1 and k < q ? */ - if (mp_cmp_d(k, 1) != LTC_MP_GT || mp_cmp(k, key->q) != LTC_MP_LT) { goto retry; } + /* k should be from range: 1 <= k <= q-1 (see FIPS 186-4 B.2.2) */ + if (mp_cmp_d(k, 0) != LTC_MP_GT || mp_cmp(k, key->q) != LTC_MP_LT) { goto retry; } /* test gcd */ if ((err = mp_gcd(k, key->q, tmp)) != CRYPT_OK) { goto error; } From 655336f0cb0851c1a5f488dc12ffcba34d166fce Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 15 Jan 2014 21:22:03 +0100 Subject: [PATCH 0187/1192] tuning RSA interoperability + small fixes --- src/pk/dsa/dsa_export.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/pk/dsa/dsa_export.c b/src/pk/dsa/dsa_export.c index 7bb355852..61a28afc6 100644 --- a/src/pk/dsa/dsa_export.c +++ b/src/pk/dsa/dsa_export.c @@ -71,15 +71,9 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key goto error; } - int_list[0].data = key->p; - int_list[0].size = 1UL; - int_list[0].type = LTC_ASN1_INTEGER; - int_list[1].data = key->q; - int_list[1].size = 1UL; - int_list[1].type = LTC_ASN1_INTEGER; - int_list[2].data = key->g; - int_list[2].size = 1UL; - int_list[2].type = LTC_ASN1_INTEGER; + LTC_SET_ASN1(int_list, 0, LTC_ASN1_INTEGER, key->p, 1UL); + LTC_SET_ASN1(int_list, 1, LTC_ASN1_INTEGER, key->q, 1UL); + LTC_SET_ASN1(int_list, 2, LTC_ASN1_INTEGER, key->g, 1UL); err = der_encode_subject_public_key_info(out, outlen, PKA_DSA, tmp, tmplen, From a43bb0fda6c7e288f2e7b13b2c37cafe5ee6de83 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 19 Jan 2014 23:13:20 +0100 Subject: [PATCH 0188/1192] dsa_encrypt_key small correction --- src/pk/dsa/dsa_encrypt_key.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/pk/dsa/dsa_encrypt_key.c b/src/pk/dsa/dsa_encrypt_key.c index a0829699a..92be479d4 100644 --- a/src/pk/dsa/dsa_encrypt_key.c +++ b/src/pk/dsa/dsa_encrypt_key.c @@ -37,7 +37,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *expt, *skey; void *g_pub, *g_priv; unsigned long x, y; - int err; + int err, qbits; LTC_ARGCHK(in != NULL); LTC_ARGCHK(out != NULL); @@ -75,18 +75,15 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, return CRYPT_MEM; } - /* make a random x, g^x pair */ - x = mp_unsigned_bin_size(key->q); - if (prng_descriptor[wprng].read(expt, x, prng) != x) { - err = CRYPT_ERROR_READPRNG; - goto LBL_ERR; - } - - /* load x */ - if ((err = mp_read_unsigned_bin(g_priv, expt, x)) != CRYPT_OK) { - goto LBL_ERR; - } - + /* make a random g_priv, g_pub = g^x pair */ + qbits = mp_count_bits(key->q); + do { + if ((err = rand_bn_bits(g_priv, qbits, prng, wprng)) != CRYPT_OK) { + goto LBL_ERR; + } + /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ + } while (mp_cmp_d(g_priv, 0) != LTC_MP_GT || mp_cmp(g_priv, key->q) != LTC_MP_LT); + /* compute y */ if ((err = mp_exptmod(key->g, g_priv, key->p, g_pub)) != CRYPT_OK) { goto LBL_ERR; From 77b4b160309c4dd810e82a7cd83742b2bd2a4af7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 23 Jan 2014 16:48:32 +0100 Subject: [PATCH 0189/1192] dsa_make_key minor isuue --- src/pk/dsa/dsa_make_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index af3a81a64..02dcac834 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -65,7 +65,7 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, if ((err = mp_add(key->q, key->q, tmp)) != CRYPT_OK) { goto error; } /* now make a random string and multply it against q */ - if (prng_descriptor[wprng].read(buf+1, modulus_size - group_size, prng) != (unsigned long)(modulus_size - group_size)) { + if (prng_descriptor[wprng].read(buf, modulus_size - group_size, prng) != (unsigned long)(modulus_size - group_size)) { err = CRYPT_ERROR_READPRNG; goto error; } From e9a0a2791711d0b5ef40ca9fb53d67886b22bfed Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 27 Jan 2014 21:10:41 +0100 Subject: [PATCH 0190/1192] DSA params+key generation according FIPS-186-4 (part 1) --- src/pk/dsa/dsa_make_key.c | 330 +++++++++++++++++++++++++++----------- 1 file changed, 232 insertions(+), 98 deletions(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 02dcac834..51f953c29 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -18,114 +18,248 @@ #ifdef LTC_MDSA /** - Create a DSA key + Create DSA parameters + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param group_size Size of the multiplicative group (octets) + @param modulus_size Size of the modulus (octets) + @param p [out] bignum where generated 'p' is stored (must be initialized by caller) + @param q [out] bignum where generated 'q' is stored (must be initialized by caller) + @param g [out] bignum where generated 'g' is stored (must be initialized by caller) + @return CRYPT_OK if successful, upon error this function will free all allocated memory +*/ +int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g) +{ + unsigned long L, N, n, outbytes, seedbytes, counter, j, i; + int err, res, mr_tests_q, mr_tests_p, found_p, found_q, hash; + unsigned char *wbuf, *sbuf, digest[MAXBLOCKSIZE]; + void *t2L1, *t2N1, *t2q, *t2seedlen, *U, *W, *X, *c, *h, *e, *seedinc; + + /* check size */ + if (group_size >= LTC_MDSA_MAX_GROUP || group_size < 1 || group_size >= modulus_size) { + return CRYPT_INVALID_ARG; + } + + /* FIPS-186-4 A.1.1.2 Generation of the Probable Primes p and q Using an Approved Hash Function + * + * L = The desired length of the prime p (in bits e.g. L = 1024) + * N = The desired length of the prime q (in bits e.g. N = 160) + * seedlen = The desired bit length of the domain parameter seed; seedlen shallbe equal to or greater than N + * outlen = The bit length of Hash function + * + * 1. Check that the (L, N) + * 2. If (seedlen = 2^(L-1)) { + * Test whether or not p is prime as specified in Appendix C.3. + * If p is determined to be prime, then return VALID and the values of p, qand (optionally) the values of domain_parameter_seed and counter + * } + * offset = offset + n + 1 Comment: Increment offset + * } + */ + + seedbytes = group_size; + L = modulus_size * 8; + N = group_size * 8; + + /* M-R tests (when followed by one Lucas test) according FIPS-186-4 - Appendix C.3 - table C.1 */ + mr_tests_p = (L <= 2048) ? 3 : 2; + if (N <= 160) { mr_tests_q = 19; } + else if (N <= 224) { mr_tests_q = 24; } + else { mr_tests_q = 27; } + + if (N <= 256) { + hash = register_hash(&sha256_desc); + } + else if (N <= 384) { + hash = register_hash(&sha384_desc); + } + else if (N <= 512) { + hash = register_hash(&sha512_desc); + } + else { + return CRYPT_INVALID_ARG; /* group_size too big */ + } + + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } + outbytes = hash_descriptor[hash].hashsize; + + n = ((L + outbytes*8 - 1) / (outbytes*8)) - 1; + + if ((wbuf = XMALLOC((n+1)*outbytes)) == NULL) { err = CRYPT_MEM; goto cleanup3; } + if ((sbuf = XMALLOC(seedbytes)) == NULL) { err = CRYPT_MEM; goto cleanup2; } + + err = mp_init_multi(&t2L1, &t2N1, &t2q, &t2seedlen, &U, &W, &X, &c, &h, &e, &seedinc, NULL); + if (err != CRYPT_OK) { goto cleanup1; }; + + if ((err = mp_2expt(t2L1, L-1)) != CRYPT_OK) { goto cleanup; } + /* t2L1 = 2^(L-1) */ + if ((err = mp_2expt(t2N1, N-1)) != CRYPT_OK) { goto cleanup; } + /* t2N1 = 2^(N-1) */ + if ((err = mp_2expt(t2seedlen, seedbytes*8)) != CRYPT_OK) { goto cleanup; } + /* t2seedlen = 2^seedlen */ + + for(found_p=0; !found_p;) { + /* q */ + for(found_q=0; !found_q;) { + if (prng_descriptor[wprng].read(sbuf, seedbytes, prng) != seedbytes) { err = CRYPT_ERROR_READPRNG; goto cleanup; } + i = outbytes; + if ((err = hash_memory(hash, sbuf, seedbytes, digest, &i)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_read_unsigned_bin(U, digest, outbytes)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_mod(U, t2N1, U)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_add(t2N1, U, q)) != CRYPT_OK) { goto cleanup; } + if (!mp_isodd(q)) mp_add_d(q, 1, q); + if ((err = mp_prime_is_prime(q, mr_tests_q, &res)) != CRYPT_OK) { goto cleanup; } /* XXX-TODO rounds are ignored; no Lucas test */ + if (res == LTC_MP_YES) found_q = 1; + } + + /* p */ + if ((err = mp_read_unsigned_bin(seedinc, sbuf, seedbytes)) != CRYPT_OK) { goto cleanup; } + /* printf("seed="); mp_fwrite(seedinc, 16, stdout); printf("\n"); //XXX-DEBUG */ + if ((err = mp_add(q, q, t2q)) != CRYPT_OK) { goto cleanup; } + for(counter=0; counter < 4*L && !found_p; counter++) { + for(j=0; j<=n; j++) { + if ((err = mp_add_d(seedinc, 1, seedinc)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_mod(seedinc, t2seedlen, seedinc)) != CRYPT_OK) { goto cleanup; } + /* seedinc = (seedinc+1) % 2^seed_bitlen */ + if ((i = mp_unsigned_bin_size(seedinc)) > seedbytes) { err = CRYPT_INVALID_ARG; goto cleanup; } + zeromem(sbuf, seedbytes); + if ((err = mp_to_unsigned_bin(seedinc, sbuf + seedbytes-i)) != CRYPT_OK) { goto cleanup; } + i = outbytes; + err = hash_memory(hash, sbuf, seedbytes, wbuf+(n-j)*outbytes, &i); + if (err != CRYPT_OK) { goto cleanup; } + } + if ((err = mp_read_unsigned_bin(W, wbuf, (n+1)*outbytes)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_mod(W, t2L1, W)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_add(W, t2L1, X)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_mod(X, t2q, c)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_sub_d(c, 1, p)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_sub(X, p, p)) != CRYPT_OK) { goto cleanup; } + if (mp_cmp(p, t2L1) != LTC_MP_LT) { + /* p >= 2^(L-1) */ + if ((err = mp_prime_is_prime(p, mr_tests_p, &res)) != CRYPT_OK) { goto cleanup; } /* XXX-TODO rounds are ignored; no Lucas test */ + if (res == LTC_MP_YES) { + found_p = 1; + } + } + } + } + + /* FIPS-186-4 A.2.1 Unverifiable Generation of the Generator g + * 1. e = (p - 1)/q + * 2. h = any integer satisfying: 1 < h < (p - 1) + * h could be obtained from a random number generator or from a counter that changes after each use + * 3. g = h^e mod p + * 4. if (g == 1), then go to step 2. + * + */ + + if ((err = mp_sub_d(p, 1, e)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_div(e, q, e, c)) != CRYPT_OK) { goto cleanup; } + /* e = (p - 1)/q */ + i = mp_count_bits(p); + do { + do { + if ((err = rand_bn_bits(h, i, prng, wprng)) != CRYPT_OK) { goto cleanup; } + } while (mp_cmp(h, p) != LTC_MP_LT || mp_cmp_d(h, 2) != LTC_MP_GT); + if ((err = mp_sub_d(h, 1, h)) != CRYPT_OK) { goto cleanup; } + /* h is randon and 1 < h < (p-1) */ + if ((err = mp_exptmod(h, e, p, g)) != CRYPT_OK) { goto cleanup; } + } while (mp_cmp_d(g, 1) == LTC_MP_EQ); + + err = CRYPT_OK; +cleanup: + mp_clear_multi(t2L1, t2N1, t2q, t2seedlen, U, W, X, c, h, e, seedinc, NULL); +cleanup1: + XFREE(wbuf); +cleanup2: + XFREE(wbuf); +cleanup3: + return err; +} + +/** + Create a DSA key (with given params) @param prng An active PRNG state @param wprng The index of the PRNG desired @param group_size Size of the multiplicative group (octets) @param modulus_size Size of the modulus (octets) @param key [out] Where to store the created key + @param p_hex Hexadecimal string 'p' + @param q_hex Hexadecimal string 'q' + @param g_hex Hexadecimal string 'g' @return CRYPT_OK if successful, upon error this function will free all allocated memory */ -int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) +int dsa_make_key_ex(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key, char* p_hex, char* q_hex, char* g_hex) { - void *tmp, *tmp2; - int err, res, qbits; - unsigned char *buf; - - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(ltc_mp.name != NULL); - - /* check prng */ - if ((err = prng_is_valid(wprng)) != CRYPT_OK) { - return err; - } - - /* check size */ - if (group_size >= LTC_MDSA_MAX_GROUP || group_size <= 15 || - group_size >= modulus_size || (modulus_size - group_size) >= LTC_MDSA_DELTA) { - return CRYPT_INVALID_ARG; - } - - /* allocate ram */ - buf = XMALLOC(LTC_MDSA_DELTA); - if (buf == NULL) { - return CRYPT_MEM; - } - - /* init mp_ints */ - if ((err = mp_init_multi(&tmp, &tmp2, &key->g, &key->q, &key->p, &key->x, &key->y, NULL)) != CRYPT_OK) { - XFREE(buf); - return err; - } - - /* make our prime q */ - if ((err = rand_prime(key->q, group_size, prng, wprng)) != CRYPT_OK) { goto error; } - - /* double q */ - if ((err = mp_add(key->q, key->q, tmp)) != CRYPT_OK) { goto error; } - - /* now make a random string and multply it against q */ - if (prng_descriptor[wprng].read(buf, modulus_size - group_size, prng) != (unsigned long)(modulus_size - group_size)) { - err = CRYPT_ERROR_READPRNG; - goto error; - } - - /* force magnitude */ - buf[0] |= 0xC0; - - /* force even */ - buf[modulus_size - group_size - 1] &= ~1; - - if ((err = mp_read_unsigned_bin(tmp2, buf, modulus_size - group_size)) != CRYPT_OK) { goto error; } - if ((err = mp_mul(key->q, tmp2, key->p)) != CRYPT_OK) { goto error; } - if ((err = mp_add_d(key->p, 1, key->p)) != CRYPT_OK) { goto error; } - - /* now loop until p is prime */ - for (;;) { - if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { goto error; } - if (res == LTC_MP_YES) break; - - /* add 2q to p and 2 to tmp2 */ - if ((err = mp_add(tmp, key->p, key->p)) != CRYPT_OK) { goto error; } - if ((err = mp_add_d(tmp2, 2, tmp2)) != CRYPT_OK) { goto error; } - } - - /* now p = (q * tmp2) + 1 is prime, find a value g for which g^tmp2 != 1 */ - mp_set(key->g, 1); - - do { - if ((err = mp_add_d(key->g, 1, key->g)) != CRYPT_OK) { goto error; } - if ((err = mp_exptmod(key->g, tmp2, key->p, tmp)) != CRYPT_OK) { goto error; } - } while (mp_cmp_d(tmp, 1) == LTC_MP_EQ); - - /* at this point tmp generates a group of order q mod p */ - mp_exch(tmp, key->g); - - /* so now we have our DH structure, generator g, order q, modulus p - Now we need a random exponent [mod q] and it's power g^x mod p - */ - qbits = mp_count_bits(key->q); - do { - if ((err = rand_bn_bits(key->x, qbits, prng, wprng)) != CRYPT_OK) { goto error; } - /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ - } while (mp_cmp_d(key->x, 0) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT); - if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto error; } - - key->type = PK_PRIVATE; - key->qord = group_size; - -#ifdef LTC_CLEAN_STACK - zeromem(buf, LTC_MDSA_DELTA); -#endif + int err, qbits; + + LTC_ARGCHK(key != NULL); - err = CRYPT_OK; - goto done; -error: - mp_clear_multi(key->g, key->q, key->p, key->x, key->y, NULL); -done: - mp_clear_multi(tmp, tmp2, NULL); - XFREE(buf); + /* init mp_ints */ + if ((err = mp_init_multi(&key->g, &key->q, &key->p, &key->x, &key->y, NULL)) != CRYPT_OK) { return err; + } + + if (p_hex == NULL || q_hex == NULL || g_hex == NULL) { + /* generate params */ + err = dsa_make_params(prng, wprng, group_size, modulus_size, key->p, key->q, key->g); + if (err != CRYPT_OK) { goto cleanup; } + } + else { + /* read params */ + if ((err = mp_read_radix(key->p, p_hex, 16)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_read_radix(key->q, q_hex, 16)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_read_radix(key->g, g_hex, 16)) != CRYPT_OK) { goto cleanup; } + /* XXX-TODO maybe do some validity check for p, q, g */ + } + + /* so now we have our DH structure, generator g, order q, modulus p + Now we need a random exponent [mod q] and it's power g^x mod p + */ + qbits = mp_count_bits(key->q); + do { + if ((err = rand_bn_bits(key->x, qbits, prng, wprng)) != CRYPT_OK) { goto cleanup; } + /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ + } while (mp_cmp_d(key->x, 0) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT); + if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto cleanup; } + key->type = PK_PRIVATE; + key->qord = group_size; + + return CRYPT_OK; + +cleanup: + mp_clear_multi(key->g, key->q, key->p, key->x, key->y, NULL); + return err; +} + +/** + Create a DSA key + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param group_size Size of the multiplicative group (octets) + @param modulus_size Size of the modulus (octets) + @param key [out] Where to store the created key + @return CRYPT_OK if successful, upon error this function will free all allocated memory +*/ +int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) +{ + return dsa_make_key_ex(prng, wprng, group_size, modulus_size, key, NULL, NULL, NULL); } #endif From c9f93f65710d064c9a8112b20a3b638570a40568 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 May 2014 22:43:29 +0200 Subject: [PATCH 0191/1192] dsa_make_key: remove surplus semicolon --- src/pk/dsa/dsa_make_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 51f953c29..69b2708fb 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -105,7 +105,7 @@ int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_siz if ((sbuf = XMALLOC(seedbytes)) == NULL) { err = CRYPT_MEM; goto cleanup2; } err = mp_init_multi(&t2L1, &t2N1, &t2q, &t2seedlen, &U, &W, &X, &c, &h, &e, &seedinc, NULL); - if (err != CRYPT_OK) { goto cleanup1; }; + if (err != CRYPT_OK) { goto cleanup1; } if ((err = mp_2expt(t2L1, L-1)) != CRYPT_OK) { goto cleanup; } /* t2L1 = 2^(L-1) */ From 198ad7ef50795e4167c0f858ff98b82a5ed4aadb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 May 2014 22:43:37 +0200 Subject: [PATCH 0192/1192] update makefiles --- makefile | 78 +++++++++++++++++------------------ makefile.icc | 78 +++++++++++++++++------------------ makefile.mingw | 107 +++++++++++++++++++++++++----------------------- makefile.msvc | 78 +++++++++++++++++------------------ makefile.shared | 78 +++++++++++++++++------------------ makefile.unix | 78 +++++++++++++++++------------------ 6 files changed, 250 insertions(+), 247 deletions(-) diff --git a/makefile b/makefile index 424e380b7..246dae806 100644 --- a/makefile +++ b/makefile @@ -120,45 +120,45 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ -src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ +src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ +src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ +src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ +src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ +src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -166,8 +166,8 @@ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ @@ -219,8 +219,8 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ +src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ @@ -239,11 +239,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.icc b/makefile.icc index 45c916696..c5182d8df 100644 --- a/makefile.icc +++ b/makefile.icc @@ -101,45 +101,45 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ -src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ +src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ +src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ +src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ +src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ +src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -147,8 +147,8 @@ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ @@ -200,8 +200,8 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ +src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ @@ -220,11 +220,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.mingw b/makefile.mingw index aebd82a8b..bae91a5aa 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -49,48 +49,49 @@ INCPATH=$(INSTPREFIX)\include OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o \ -src/ciphers/skipjack.o src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ -src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ +src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/chc/chc.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha256.o src/hashes/sha2/sha512.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ +src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ +src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ +src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -98,14 +99,14 @@ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ -src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ -src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ -src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ -src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ -src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ -src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ +src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ +src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ +src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ +src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ +src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ +src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ @@ -148,10 +149,11 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o \ -src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ +src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ @@ -164,16 +166,17 @@ src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mg src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \ -src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ -src/prngs/sprng.o src/prngs/yarrow.o - -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_hkdf.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_math.h src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h \ -src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o + +HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.msvc b/makefile.msvc index fb710ea10..13e25ebc0 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -11,45 +11,45 @@ src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_memory.obj \ src/encauth/ccm/ccm_memory_ex.obj src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj \ src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ -src/encauth/eax/eax_encrypt.obj src/encauth/eax/eax_encrypt_authenticate_memory.obj \ +src/encauth/eax/eax_encrypt_authenticate_memory.obj src/encauth/eax/eax_encrypt.obj \ src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \ src/encauth/gcm/gcm_add_iv.obj src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj \ src/encauth/gcm/gcm_init.obj src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj \ src/encauth/gcm/gcm_process.obj src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj \ -src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \ -src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj \ -src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj \ src/encauth/ocb3/ocb3_add_aad.obj src/encauth/ocb3/ocb3_decrypt.obj src/encauth/ocb3/ocb3_decrypt_last.obj \ src/encauth/ocb3/ocb3_decrypt_verify_memory.obj src/encauth/ocb3/ocb3_done.obj \ -src/encauth/ocb3/ocb3_encrypt.obj src/encauth/ocb3/ocb3_encrypt_authenticate_memory.obj \ +src/encauth/ocb3/ocb3_encrypt_authenticate_memory.obj src/encauth/ocb3/ocb3_encrypt.obj \ src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj \ src/encauth/ocb3/ocb3_int_aad_add_block.obj src/encauth/ocb3/ocb3_int_calc_offset_zero.obj \ src/encauth/ocb3/ocb3_int_ntz.obj src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj \ -src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj \ -src/hashes/helper/hash_memory.obj src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj \ -src/hashes/md5.obj src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj \ -src/hashes/sha1.obj src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj \ -src/hashes/sha2/sha512.obj src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj \ -src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj \ -src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj \ -src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj \ -src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj \ -src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj \ -src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj \ -src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj \ -src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ -src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \ -src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj \ -src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \ -src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \ -src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ -src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/base64/base64_decode.obj \ -src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crypt/crypt.obj \ -src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt_cipher_descriptor.obj \ -src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_find_cipher.obj \ -src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher_id.obj \ -src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_any.obj \ +src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \ +src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_encrypt.obj \ +src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj src/encauth/ocb/ocb_shift_xor.obj \ +src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj src/hashes/chc/chc.obj \ +src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \ +src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \ +src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \ +src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj src/hashes/sha2/sha512.obj \ +src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj \ +src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj \ +src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj \ +src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj \ +src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj \ +src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj \ +src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj src/mac/pelican/pelican_memory.obj \ +src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj src/mac/pmac/pmac_file.obj \ +src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj src/mac/pmac/pmac_memory_multi.obj \ +src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj src/mac/pmac/pmac_shift_xor.obj \ +src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj \ +src/mac/xcbc/xcbc_memory.obj src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj \ +src/mac/xcbc/xcbc_test.obj src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj \ +src/math/multi.obj src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj \ +src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj \ +src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj \ +src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_find_cipher_any.obj \ +src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_id.obj \ +src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash.obj \ src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ @@ -57,8 +57,8 @@ src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_unregister_cipher.obj \ src/misc/crypt/crypt_unregister_hash.obj src/misc/crypt/crypt_unregister_prng.obj \ -src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj src/misc/hkdf/hkdf_test.obj src/misc/pk_get_oid.obj \ -src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj src/misc/pkcs5/pkcs_5_test.obj src/misc/zeromem.obj \ +src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj src/misc/hkdf/hkdf_test.obj src/misc/pkcs5/pkcs_5_1.obj \ +src/misc/pkcs5/pkcs_5_2.obj src/misc/pkcs5/pkcs_5_test.obj src/misc/pk_get_oid.obj src/misc/zeromem.obj \ src/modes/cbc/cbc_decrypt.obj src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj \ src/modes/cbc/cbc_getiv.obj src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj \ src/modes/cfb/cfb_decrypt.obj src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj \ @@ -110,8 +110,8 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_ src/pk/dh/dh.obj src/pk/dh/dh_static.obj src/pk/dh/dh_sys.obj src/pk/dsa/dsa_decrypt_key.obj \ src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \ src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \ -src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ -src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ +src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc_ansi_x963_export.obj \ +src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc.obj src/pk/ecc/ecc_decrypt_key.obj \ src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ src/pk/ecc/ecc_sign_hash.obj src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \ @@ -130,11 +130,11 @@ src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/for src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ src/prngs/yarrow.obj -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.shared b/makefile.shared index c3e68e42a..e0a86361a 100644 --- a/makefile.shared +++ b/makefile.shared @@ -106,45 +106,45 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ -src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ +src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ +src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ +src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ +src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ +src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -152,8 +152,8 @@ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ @@ -205,8 +205,8 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ +src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ @@ -225,11 +225,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.unix b/makefile.unix index 4179b5e92..eb2f38c5d 100644 --- a/makefile.unix +++ b/makefile.unix @@ -47,45 +47,45 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ -src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ +src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ +src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ +src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ +src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ +src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -93,8 +93,8 @@ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pk_get_oid.o \ -src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o \ +src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ @@ -146,8 +146,8 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ +src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ @@ -166,11 +166,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ +src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ +src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h #END_INS From dc31ca545fda846588261a99e6b1e58c6af230d2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 May 2014 22:55:49 +0200 Subject: [PATCH 0193/1192] dsa_make_key: fix free of wrong pointer resulting in double-free --- src/pk/dsa/dsa_make_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 69b2708fb..44ad2071c 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -186,7 +186,7 @@ int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_siz cleanup: mp_clear_multi(t2L1, t2N1, t2q, t2seedlen, U, W, X, c, h, e, seedinc, NULL); cleanup1: - XFREE(wbuf); + XFREE(sbuf); cleanup2: XFREE(wbuf); cleanup3: From 5d2fe0da8c7e0f6a6a8abe03d04ba9bf43021991 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 May 2014 23:00:00 +0200 Subject: [PATCH 0194/1192] trim trailing spaces --- src/math/gmp_desc.c | 14 +++++++------- src/math/ltm_desc.c | 20 ++++++++++---------- src/math/tfm_desc.c | 34 +++++++++++++++++----------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 464cd934c..9904f304a 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -18,7 +18,7 @@ #include static int init(void **a) -{ +{ LTC_ARGCHK(a != NULL); *a = XCALLOC(1, sizeof(__mpz_struct)); @@ -85,7 +85,7 @@ static int get_digit_count(void *a) LTC_ARGCHK(a != NULL); return mpz_size(a); } - + static int compare(void *a, void *b) { int ret; @@ -234,7 +234,7 @@ static int add(void *a, void *b, void *c) mpz_add(c, a, b); return CRYPT_OK; } - + static int addi(void *a, unsigned long b, void *c) { LTC_ARGCHK(a != NULL); @@ -321,10 +321,10 @@ static int modi(void *a, unsigned long b, unsigned long *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); - + *c = mpz_fdiv_ui(a, b); return CRYPT_OK; -} +} /* gcd */ static int gcd(void *a, void *b, void *c) @@ -440,7 +440,7 @@ static int exptmod(void *a, void *b, void *c, void *d) LTC_ARGCHK(d != NULL); mpz_powm(d, a, b, c); return CRYPT_OK; -} +} static int isprime(void *a, int *b) { @@ -539,7 +539,7 @@ const ltc_math_descriptor gmp_desc = { #endif &addmod, &submod, - + &set_rand, }; diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index 2945a4749..276040902 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -25,7 +25,7 @@ static const struct { }; /** - Convert a MPI error to a LTC error (Possibly the most powerful function ever! Oh wait... no) + Convert a MPI error to a LTC error (Possibly the most powerful function ever! Oh wait... no) @param err The error to convert @return The equivalent LTC error code or CRYPT_ERROR if none found */ @@ -34,7 +34,7 @@ static int mpi_to_ltc_error(int err) int x; for (x = 0; x < (int)(sizeof(mpi_to_ltc_codes)/sizeof(mpi_to_ltc_codes[0])); x++) { - if (err == mpi_to_ltc_codes[x].mpi_code) { + if (err == mpi_to_ltc_codes[x].mpi_code) { return mpi_to_ltc_codes[x].ltc_code; } } @@ -51,7 +51,7 @@ static int init(void **a) if (*a == NULL) { return CRYPT_MEM; } - + if ((err = mpi_to_ltc_error(mp_init(*a))) != CRYPT_OK) { XFREE(*a); } @@ -115,7 +115,7 @@ static int get_digit_count(void *a) A = a; return A->used; } - + static int compare(void *a, void *b) { int ret; @@ -211,7 +211,7 @@ static int add(void *a, void *b, void *c) LTC_ARGCHK(c != NULL); return mpi_to_ltc_error(mp_add(a, b, c)); } - + static int addi(void *a, unsigned long b, void *c) { LTC_ARGCHK(a != NULL); @@ -288,7 +288,7 @@ static int modi(void *a, unsigned long b, unsigned long *c) } *c = tmp; return CRYPT_OK; -} +} /* gcd */ static int gcd(void *a, void *b, void *c) @@ -398,7 +398,7 @@ static int exptmod(void *a, void *b, void *c, void *d) LTC_ARGCHK(c != NULL); LTC_ARGCHK(d != NULL); return mpi_to_ltc_error(mp_exptmod(a,b,c,d)); -} +} static int isprime(void *a, int *b) { @@ -460,7 +460,7 @@ const ltc_math_descriptor ltm_desc = { &mulmod, &sqrmod, &invmod, - + &montgomery_setup, &montgomery_normalization, &montgomery_reduce, @@ -472,7 +472,7 @@ const ltc_math_descriptor ltm_desc = { #ifdef LTC_MECC #ifdef LTC_MECC_FP <c_ecc_fp_mulmod, -#else +#else <c_ecc_mulmod, #endif <c_ecc_projective_add_point, @@ -499,7 +499,7 @@ const ltc_math_descriptor ltm_desc = { #endif &addmod, &submod, - + &set_rand, }; diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index 821802472..f75408d4b 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -25,7 +25,7 @@ static const struct { }; /** - Convert a tfm error to a LTC error (Possibly the most powerful function ever! Oh wait... no) + Convert a tfm error to a LTC error (Possibly the most powerful function ever! Oh wait... no) @param err The error to convert @return The equivalent LTC error code or CRYPT_ERROR if none found */ @@ -34,7 +34,7 @@ static int tfm_to_ltc_error(int err) int x; for (x = 0; x < (int)(sizeof(tfm_to_ltc_codes)/sizeof(tfm_to_ltc_codes[0])); x++) { - if (err == tfm_to_ltc_codes[x].tfm_code) { + if (err == tfm_to_ltc_codes[x].tfm_code) { return tfm_to_ltc_codes[x].ltc_code; } } @@ -114,7 +114,7 @@ static int get_digit_count(void *a) A = a; return A->used; } - + static int compare(void *a, void *b) { int ret; @@ -213,7 +213,7 @@ static int add(void *a, void *b, void *c) fp_add(a, b, c); return CRYPT_OK; } - + static int addi(void *a, unsigned long b, void *c) { LTC_ARGCHK(a != NULL); @@ -246,7 +246,7 @@ static int mul(void *a, void *b, void *c) LTC_ARGCHK(a != NULL); LTC_ARGCHK(b != NULL); LTC_ARGCHK(c != NULL); - fp_mul(a, b, c); + fp_mul(a, b, c); return CRYPT_OK; } @@ -297,7 +297,7 @@ static int modi(void *a, unsigned long b, unsigned long *c) } *c = tmp; return CRYPT_OK; -} +} /* gcd */ static int gcd(void *a, void *b, void *c) @@ -411,7 +411,7 @@ static int exptmod(void *a, void *b, void *c, void *d) LTC_ARGCHK(c != NULL); LTC_ARGCHK(d != NULL); return tfm_to_ltc_error(fp_exptmod(a,b,c,d)); -} +} static int isprime(void *a, int *b) { @@ -455,7 +455,7 @@ static int tfm_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulu if (fp_cmp(R->z, modulus) != FP_LT) { fp_sub(R->z, modulus, R->z); } - + /* &t2 = X - T1 */ fp_sub(R->x, &t1, &t2); if (fp_cmp_d(&t2, 0) == FP_LT) { @@ -514,7 +514,7 @@ static int tfm_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulu fp_add(R->x, modulus, R->x); } - /* Y = Y - X */ + /* Y = Y - X */ fp_sub(R->y, R->x, R->y); if (fp_cmp_d(R->y, 0) == FP_LT) { fp_add(R->y, modulus, R->y); @@ -527,7 +527,7 @@ static int tfm_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulu if (fp_cmp_d(R->y, 0) == FP_LT) { fp_add(R->y, modulus, R->y); } - + return CRYPT_OK; } @@ -543,8 +543,8 @@ static int tfm_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulu static int tfm_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *Mp) { fp_int t1, t2, x, y, z; - fp_digit mp; - + fp_digit mp; + LTC_ARGCHK(P != NULL); LTC_ARGCHK(Q != NULL); LTC_ARGCHK(R != NULL); @@ -561,7 +561,7 @@ static int tfm_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R /* should we dbl instead? */ fp_sub(modulus, Q->y, &t1); - if ( (fp_cmp(P->x, Q->x) == FP_EQ) && + if ( (fp_cmp(P->x, Q->x) == FP_EQ) && (Q->z != NULL && fp_cmp(P->z, Q->z) == FP_EQ) && (fp_cmp(P->y, Q->y) == FP_EQ || fp_cmp(P->y, &t1) == FP_EQ)) { return tfm_ecc_projective_dbl_point(P, R, modulus, Mp); @@ -654,7 +654,7 @@ static int tfm_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R /* T1 = T1 * X */ fp_mul(&t1, &x, &t1); fp_montgomery_reduce(&t1, modulus, mp); - + /* X = Y*Y */ fp_sqr(&y, &x); fp_montgomery_reduce(&x, modulus, mp); @@ -668,7 +668,7 @@ static int tfm_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R fp_sub(&t2, &x, &t2); if (fp_cmp_d(&t2, 0) == FP_LT) { fp_add(&t2, modulus, &t2); - } + } /* T2 = T2 - X */ fp_sub(&t2, &x, &t2); if (fp_cmp_d(&t2, 0) == FP_LT) { @@ -691,7 +691,7 @@ static int tfm_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R fp_copy(&x, R->x); fp_copy(&y, R->y); fp_copy(&z, R->z); - + return CRYPT_OK; } @@ -786,7 +786,7 @@ const ltc_math_descriptor tfm_desc = { #endif &addmod, &submod, - + NULL, }; From ca42862d52b15532fc26b04c8168b02f5e7ff351 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 May 2014 23:00:50 +0200 Subject: [PATCH 0195/1192] math descriptor: add parameter "b" to isprime() --- src/headers/tomcrypt_math.h | 7 ++++--- src/math/gmp_desc.c | 9 ++++++--- src/math/ltm_desc.c | 11 +++++++---- src/math/tfm_desc.c | 7 ++++--- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index bd0782170..7e6e79887 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -326,10 +326,11 @@ typedef struct { /** Primality testing @param a The integer to test - @param b The destination of the result (FP_YES if prime) + @param b The number of tests that shall be executed + @param c The destination of the result (FP_YES if prime) @return CRYPT_OK on success */ - int (*isprime)(void *a, int *b); + int (*isprime)(void *a, int b, int *c); /* ---- (optional) ecc point math ---- */ @@ -516,7 +517,7 @@ extern const ltc_math_descriptor gmp_desc; #define mp_montgomery_free(a) ltc_mp.montgomery_deinit(a) #define mp_exptmod(a,b,c,d) ltc_mp.exptmod(a,b,c,d) -#define mp_prime_is_prime(a, b, c) ltc_mp.isprime(a, c) +#define mp_prime_is_prime(a, b, c) ltc_mp.isprime(a, b, c) #define mp_iszero(a) (mp_cmp_d(a, 0) == LTC_MP_EQ ? LTC_MP_YES : LTC_MP_NO) #define mp_isodd(a) (mp_get_digit_count(a) > 0 ? (mp_get_digit(a, 0) & 1 ? LTC_MP_YES : LTC_MP_NO) : LTC_MP_NO) diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 9904f304a..c6082d263 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -442,11 +442,14 @@ static int exptmod(void *a, void *b, void *c, void *d) return CRYPT_OK; } -static int isprime(void *a, int *b) +static int isprime(void *a, int b, int *c) { LTC_ARGCHK(a != NULL); - LTC_ARGCHK(b != NULL); - *b = mpz_probab_prime_p(a, 8) > 0 ? LTC_MP_YES : LTC_MP_NO; + LTC_ARGCHK(c != NULL); + if (b == 0) { + b = 8; + } /* if */ + *c = mpz_probab_prime_p(a, b) > 0 ? LTC_MP_YES : LTC_MP_NO; return CRYPT_OK; } diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index 276040902..3c00aaf57 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -400,13 +400,16 @@ static int exptmod(void *a, void *b, void *c, void *d) return mpi_to_ltc_error(mp_exptmod(a,b,c,d)); } -static int isprime(void *a, int *b) +static int isprime(void *a, int b, int *c) { int err; LTC_ARGCHK(a != NULL); - LTC_ARGCHK(b != NULL); - err = mpi_to_ltc_error(mp_prime_is_prime(a, 8, b)); - *b = (*b == MP_YES) ? LTC_MP_YES : LTC_MP_NO; + LTC_ARGCHK(c != NULL); + if (b == 0) { + b = 8; + } /* if */ + err = mpi_to_ltc_error(mp_prime_is_prime(a, b, c)); + *c = (*c == MP_YES) ? LTC_MP_YES : LTC_MP_NO; return err; } diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index f75408d4b..693b9261b 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -413,11 +413,12 @@ static int exptmod(void *a, void *b, void *c, void *d) return tfm_to_ltc_error(fp_exptmod(a,b,c,d)); } -static int isprime(void *a, int *b) +static int isprime(void *a, int b, int *c) { LTC_ARGCHK(a != NULL); - LTC_ARGCHK(b != NULL); - *b = (fp_isprime(a) == FP_YES) ? LTC_MP_YES : LTC_MP_NO; + LTC_ARGCHK(c != NULL); + (void)b; + *c = (fp_isprime(a) == FP_YES) ? LTC_MP_YES : LTC_MP_NO; return CRYPT_OK; } From 03385a44198baea6903a561198a08f459708714d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 May 2014 23:29:11 +0200 Subject: [PATCH 0196/1192] rand_bn: fix call to zeromem() --- src/math/rand_bn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c index c066501be..39ff73cf9 100755 --- a/src/math/rand_bn.c +++ b/src/math/rand_bn.c @@ -44,7 +44,7 @@ int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng) cleanup: #ifdef LTC_CLEAN_STACK - zeromem(buf, len); + zeromem(buf, bytes); #endif XFREE(buf); return res; From 2de05c4d3ed0a96df7d4659057b51d08806b057a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 25 May 2014 00:24:05 +0200 Subject: [PATCH 0197/1192] add coverity build and upload script --- coverity.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 coverity.sh diff --git a/coverity.sh b/coverity.sh new file mode 100755 index 000000000..3230f780e --- /dev/null +++ b/coverity.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ $# -lt 3 ] +then + echo "usage is: ${0##*/} " + echo "e.g. \"${0##*/} \"/usr/local/bin/coverity\" \"/path/to/libtommath\" /path/to/libtommath/libtommath.a\"" + exit -1 +fi + +PATH=$PATH:$1/bin + +make clean +CFLAGS=" -O2 -DUSE_LTM -DLTM_DESC -I${2}" EXTRALIBS="${3}" cov-build --dir cov-int make -f makefile -j3 IGNORE_SPEED=1 1>gcc_1.txt + +# zipup everything +tar caf libtomcrypt.lzma cov-int + +mytoken=$(cat .coverity_token) +mymail=$(cat .coverity_mail) +myversion=$(git describe --dirty) + +curl --form project=libtomcrypt \ + --form token=${mytoken} \ + --form email=${mymail} \ + --form file=@libtomcrypt.lzma \ + --form version='"${myversion}"' \ + --form description='"libtomcrypt version ${myversion}"' \ + https://scan.coverity.com/builds?project=libtomcrypt From 389bbf0d0518f3cc3aefa5a57f082a2327dd2afd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 25 May 2014 00:24:53 +0200 Subject: [PATCH 0198/1192] update gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 002a2d971..63c6304d7 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,8 @@ timing.exe *.gcda *.gcno *.gcov + +# coverity intermediate directory etc. +cov-int/ +.coverity_* +libtomcrypt.lzma From f9984d1e24fe19cc1f71f4e0ce3b94fbbf4dc6b8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 25 May 2014 00:25:21 +0200 Subject: [PATCH 0199/1192] add coverity badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a520b8ef..b1858cf2b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ See doc/crypt.pdf for a detailed documentation Project Status -------------- -develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://travis-ci.org/libtom/libtomcrypt) [![Coverage Status](https://coveralls.io/repos/libtom/libtomcrypt/badge.png?branch=develop)](https://coveralls.io/r/libtom/libtomcrypt) +develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://travis-ci.org/libtom/libtomcrypt) [![Coverage Status](https://coveralls.io/repos/libtom/libtomcrypt/badge.png?branch=develop)](https://coveralls.io/r/libtom/libtomcrypt) [![Coverity Scan Build Status](https://scan.coverity.com/projects/487/badge.svg)](https://scan.coverity.com/projects/487) Submitting patches ------------------ From 50d10790e3ea04820c8362c1a523f26c8a4433b0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 25 May 2014 00:26:07 +0200 Subject: [PATCH 0200/1192] trim trailing spaces --- src/mac/pmac/pmac_init.c | 14 +++++++------- src/math/multi.c | 2 +- src/pk/asn1/der/utf8/der_encode_utf8_string.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mac/pmac/pmac_init.c b/src/mac/pmac/pmac_init.c index e4cf57139..6c515fa43 100644 --- a/src/mac/pmac/pmac_init.c +++ b/src/mac/pmac/pmac_init.c @@ -10,16 +10,16 @@ */ #include "tomcrypt.h" -/** +/** @file pmac_init.c - PMAC implementation, initialize state, by Tom St Denis + PMAC implementation, initialize state, by Tom St Denis */ #ifdef LTC_PMAC static const struct { int len; - unsigned char poly_div[MAXBLOCKSIZE], + unsigned char poly_div[MAXBLOCKSIZE], poly_mul[MAXBLOCKSIZE]; } polys[] = { { @@ -27,7 +27,7 @@ static const struct { { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B } }, { - 16, + 16, { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -39,7 +39,7 @@ static const struct { Initialize a PMAC state @param pmac The PMAC state to initialize @param cipher The index of the desired cipher - @param key The secret key + @param key The secret key @param keylen The length of the secret key (octets) @return CRYPT_OK if successful */ @@ -59,7 +59,7 @@ int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned l /* determine which polys to use */ pmac->block_len = cipher_descriptor[cipher].block_length; for (poly = 0; poly < (int)(sizeof(polys)/sizeof(polys[0])); poly++) { - if (polys[poly].len == pmac->block_len) { + if (polys[poly].len == pmac->block_len) { break; } } @@ -78,7 +78,7 @@ int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned l if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &pmac->key)) != CRYPT_OK) { return err; } - + /* allocate L */ L = XMALLOC(pmac->block_len); if (L == NULL) { diff --git a/src/math/multi.c b/src/math/multi.c index 593f3536e..7c40c429e 100644 --- a/src/math/multi.c +++ b/src/math/multi.c @@ -38,7 +38,7 @@ int ltc_init_multi(void **a, ...) cur = va_arg(args, void**); } va_end(args); - return CRYPT_OK; + return CRYPT_OK; } void ltc_deinit_multi(void *a, ...) diff --git a/src/pk/asn1/der/utf8/der_encode_utf8_string.c b/src/pk/asn1/der/utf8/der_encode_utf8_string.c index 847a726e7..ec4f3e755 100644 --- a/src/pk/asn1/der/utf8/der_encode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_encode_utf8_string.c @@ -37,7 +37,7 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, /* get the size */ for (x = len = 0; x < inlen; x++) { - if (in[x] < 0 || in[x] > 0x1FFFF) { + if (in[x] < 0 || in[x] > 0x1FFFF) { return CRYPT_INVALID_ARG; } len += der_utf8_charsize(in[x]); From 4c8949e449e2a8ea99cea2524f9bf073cfc0445f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 25 May 2014 00:26:30 +0200 Subject: [PATCH 0201/1192] aes: calm coverity --- src/ciphers/aes/aes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index 29d7ed2e0..3a165074c 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -205,6 +205,7 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s } } else { /* this can't happen */ + /* coverity[dead_error_line] */ return CRYPT_ERROR; } From ea9b2a858a7960a27e2b985bb42f85f129ddac1a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 25 May 2014 00:26:47 +0200 Subject: [PATCH 0202/1192] der_encode_utf8_string: calm coverity --- src/pk/asn1/der/utf8/der_encode_utf8_string.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pk/asn1/der/utf8/der_encode_utf8_string.c b/src/pk/asn1/der/utf8/der_encode_utf8_string.c index ec4f3e755..7a782f126 100644 --- a/src/pk/asn1/der/utf8/der_encode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_encode_utf8_string.c @@ -79,6 +79,7 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, out[x++] = (unsigned char)((len>>8)&255); out[x++] = (unsigned char)(len&255); } else { + /* coverity[dead_error_line] */ return CRYPT_INVALID_ARG; } From 8652f33f35f5aa6e87a4bdcb0a42f4f491db9121 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 25 May 2014 00:28:51 +0200 Subject: [PATCH 0203/1192] pmac_init: prevent possible out of bounds access of polys[] --- src/mac/pmac/pmac_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mac/pmac/pmac_init.c b/src/mac/pmac/pmac_init.c index 6c515fa43..81b7e851b 100644 --- a/src/mac/pmac/pmac_init.c +++ b/src/mac/pmac/pmac_init.c @@ -63,6 +63,9 @@ int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned l break; } } + if (poly >= (int)(sizeof(polys)/sizeof(polys[0]))) { + return CRYPT_INVALID_ARG; + } if (polys[poly].len != pmac->block_len) { return CRYPT_INVALID_ARG; } From 48f521688f5f314a91a9377c5722e2c6c489e945 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 25 May 2014 00:29:21 +0200 Subject: [PATCH 0204/1192] ltc_init_multi: fix missing call to va_end() --- src/math/multi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/math/multi.c b/src/math/multi.c index 7c40c429e..6c6537cae 100644 --- a/src/math/multi.c +++ b/src/math/multi.c @@ -32,6 +32,7 @@ int ltc_init_multi(void **a, ...) cur = va_arg(clean_list, void**); } va_end(clean_list); + va_end(args); return CRYPT_MEM; } ++np; From 30278d1121ddcd7642237f132623ccddab13b072 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 15 Jun 2014 11:51:38 +0200 Subject: [PATCH 0205/1192] fix possible missing free of rnd and rndi There could have been a 'goto error', which misses the free of rnd and rndi even if they were initialized. This could happen in cases where a private key operation was done and afterwards one of the operations like reading back or conversion, would have failed (which is likely not to happen) This also includes a proposed improvement from the OLPC project to free elements in the reverse order as they were allocated. --- src/pk/rsa/rsa_exptmod.c | 42 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 5b80774b5..63fe3e78f 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -35,7 +35,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, { void *tmp, *tmpa, *tmpb; #ifdef LTC_RSA_BLINDING - void *rnd = NULL, *rndi = NULL /* inverse of rnd */; + void *rnd, *rndi /* inverse of rnd */; #endif unsigned long x; int err; @@ -56,7 +56,11 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, } /* init and copy into tmp */ - if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, NULL)) != CRYPT_OK) + if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, +#ifdef LTC_RSA_BLINDING + &rnd, &rndi, +#endif /* LTC_RSA_BLINDING */ + NULL)) != CRYPT_OK) { return err; } if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto error; } @@ -71,52 +75,50 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, /* are we using the private exponent and is the key optimized? */ if (which == PK_PRIVATE) { #ifdef LTC_RSA_BLINDING - if ((err = mp_init_multi(&rnd, &rndi, NULL)) != CRYPT_OK) - { goto error; } /* do blinding */ err = mp_rand(rnd, mp_count_bits(key->N)); if (err != CRYPT_OK) { - goto error_blind; + goto error; } /* rndi = 1/rnd mod N */ err = mp_invmod(rnd, key->N, rndi); if (err != CRYPT_OK) { - goto error_blind; + goto error; } /* rnd = rnd^e */ err = mp_exptmod( rnd, key->e, key->N, rnd); if (err != CRYPT_OK) { - goto error_blind; + goto error; } /* tmp = tmp*rnd mod N */ err = mp_mulmod( tmp, rnd, key->N, tmp); if (err != CRYPT_OK) { - goto error_blind; + goto error; } #endif /* LTC_RSA_BLINDING */ /* tmpa = tmp^dP mod p */ - if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto error_blind; } + if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto error; } /* tmpb = tmp^dQ mod q */ - if ((err = mp_exptmod(tmp, key->dQ, key->q, tmpb)) != CRYPT_OK) { goto error_blind; } + if ((err = mp_exptmod(tmp, key->dQ, key->q, tmpb)) != CRYPT_OK) { goto error; } /* tmp = (tmpa - tmpb) * qInv (mod p) */ - if ((err = mp_sub(tmpa, tmpb, tmp)) != CRYPT_OK) { goto error_blind; } - if ((err = mp_mulmod(tmp, key->qP, key->p, tmp)) != CRYPT_OK) { goto error_blind; } + if ((err = mp_sub(tmpa, tmpb, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_mulmod(tmp, key->qP, key->p, tmp)) != CRYPT_OK) { goto error; } /* tmp = tmpb + q * tmp */ - if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { goto error_blind; } - if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { goto error_blind; } + if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { goto error; } #ifdef LTC_RSA_BLINDING /* unblind */ err = mp_mulmod( tmp, rndi, key->N, tmp); if (err != CRYPT_OK) { - goto error_blind; + goto error; } #endif } else { @@ -145,12 +147,12 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, /* clean up and return */ err = CRYPT_OK; -error_blind: - #ifdef LTC_RSA_BLINDING - mp_clear_multi(rnd, rndi, NULL); - #endif error: - mp_clear_multi(tmp, tmpa, tmpb, NULL); + mp_clear_multi( +#ifdef LTC_RSA_BLINDING + rndi, rnd, +#endif /* LTC_RSA_BLINDING */ + tmpb, tmpa, tmp, NULL); return err; } From 98893c077bd603d5c1aeb972a88c23ffe59a8ae6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 11 Jul 2014 16:44:43 +0200 Subject: [PATCH 0206/1192] fix possible free of not yet allocated key parameters There would have been a call to mp_clear_multi() of all the key parameters that are not yet allocated, in the case where the calculations of p, q, tmp1 or tmp2 created an error. This also includes a proposed improvement from the OLPC project to free elements in the reverse order as they were allocated. --- src/pk/rsa/rsa_make_key.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/pk/rsa/rsa_make_key.c b/src/pk/rsa/rsa_make_key.c index d62e37e99..454d20b8a 100644 --- a/src/pk/rsa/rsa_make_key.c +++ b/src/pk/rsa/rsa_make_key.c @@ -13,11 +13,11 @@ /** @file rsa_make_key.c RSA key generation, Tom St Denis -*/ +*/ #ifdef LTC_MRSA -/** +/** Create an RSA key @param prng An active PRNG state @param wprng The index of the PRNG desired @@ -51,26 +51,26 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) } /* make primes p and q (optimization provided by Wayne Scott) */ - if ((err = mp_set_int(tmp3, e)) != CRYPT_OK) { goto errkey; } /* tmp3 = e */ + if ((err = mp_set_int(tmp3, e)) != CRYPT_OK) { goto cleanup; } /* tmp3 = e */ /* make prime "p" */ do { - if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } - if ((err = mp_sub_d( p, 1, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = p-1 */ - if ((err = mp_gcd( tmp1, tmp3, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = gcd(p-1, e) */ + if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_sub_d( p, 1, tmp1)) != CRYPT_OK) { goto cleanup; } /* tmp1 = p-1 */ + if ((err = mp_gcd( tmp1, tmp3, tmp2)) != CRYPT_OK) { goto cleanup; } /* tmp2 = gcd(p-1, e) */ } while (mp_cmp_d( tmp2, 1) != 0); /* while e divides p-1 */ /* make prime "q" */ do { - if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } - if ((err = mp_sub_d( q, 1, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = q-1 */ - if ((err = mp_gcd( tmp1, tmp3, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = gcd(q-1, e) */ + if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_sub_d( q, 1, tmp1)) != CRYPT_OK) { goto cleanup; } /* tmp1 = q-1 */ + if ((err = mp_gcd( tmp1, tmp3, tmp2)) != CRYPT_OK) { goto cleanup; } /* tmp2 = gcd(q-1, e) */ } while (mp_cmp_d( tmp2, 1) != 0); /* while e divides q-1 */ /* tmp1 = lcm(p-1, q-1) */ - if ((err = mp_sub_d( p, 1, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = p-1 */ + if ((err = mp_sub_d( p, 1, tmp2)) != CRYPT_OK) { goto cleanup; } /* tmp2 = p-1 */ /* tmp1 = q-1 (previous do/while loop) */ - if ((err = mp_lcm( tmp1, tmp2, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = lcm(p-1, q-1) */ + if ((err = mp_lcm( tmp1, tmp2, tmp1)) != CRYPT_OK) { goto cleanup; } /* tmp1 = lcm(p-1, q-1) */ /* make key */ if ((err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL)) != CRYPT_OK) { @@ -99,9 +99,9 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) err = CRYPT_OK; goto cleanup; errkey: - mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + mp_clear_multi(key->q, key->p, key->qP, key->dP, key->dQ, key->N, key->d, key->e, NULL); cleanup: - mp_clear_multi(tmp3, tmp2, tmp1, p, q, NULL); + mp_clear_multi(tmp3, tmp2, tmp1, q, p, NULL); return err; } From 6ac2d6141d0f8fd2fd94ffbbaab97a9afe8ec15f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 12 Jul 2014 16:18:29 +0200 Subject: [PATCH 0207/1192] update clean target of makefile and testprof/makefile --- makefile | 2 ++ testprof/makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 246dae806..3257eef44 100644 --- a/makefile +++ b/makefile @@ -351,6 +351,7 @@ clean: rm -f `find . -type f -name "*.obj" | xargs` rm -f `find . -type f -name "*.lib" | xargs` rm -f `find . -type f -name "*.exe" | xargs` + rm -f `find . -type f -name "*.gcov" | xargs` rm -f `find . -type f -name "*.gcda" | xargs` rm -f `find . -type f -name "*.gcno" | xargs` rm -f `find . -type f -name "*.il" | xargs` @@ -362,6 +363,7 @@ clean: rm -rf doc/doxygen rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` rm -f *.txt + cd testprof ; $(MAKE) clean #build the doxy files (requires Doxygen, tetex and patience) doxy: diff --git a/testprof/makefile b/testprof/makefile index f3ce3db12..3cf37d20f 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -20,5 +20,5 @@ $(LIBTEST_S): $(OBJECTS) $(RANLIB) $@ clean: - rm -f *.o *.a + rm -f *.o *.a *.gcov *.gcda *.gcno From 79bc7ef2e534390c8716cabee389df0cfa61c358 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 12 Jul 2014 16:19:08 +0200 Subject: [PATCH 0208/1192] testprof: add missing object files to makefiles --- testprof/makefile.icc | 2 +- testprof/makefile.msvc | 3 ++- testprof/makefile.shared | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/testprof/makefile.icc b/testprof/makefile.icc index 60628ce19..126c2afff 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -3,7 +3,7 @@ CC=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o ifndef LIBTEST_S LIBTEST_S = libtomcrypt_prof.a diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index d330f9332..2078b85d9 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -2,7 +2,8 @@ CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ -rsa_test.obj store_test.obj test_driver.obj x86_prof.obj katja_test.obj +rsa_test.obj store_test.obj test_driver.obj x86_prof.obj katja_test.obj \ +dh_test.obj misc_test.obj tomcrypt_prof.lib: $(OBJECTS) lib /out:tomcrypt_prof.lib $(OBJECTS) diff --git a/testprof/makefile.shared b/testprof/makefile.shared index b3abba552..52580fa88 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -9,7 +9,7 @@ endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o ifndef LIBTEST LIBTEST=libtomcrypt_prof.la From 8c488289f05c06fc4cb2641c26fa6042443d5d67 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 12 Jul 2014 16:44:28 +0200 Subject: [PATCH 0209/1192] improve some error and informational output --- src/misc/crypt/crypt.c | 18 +++++++++++------- testprof/rsa_test.c | 5 +++-- testprof/x86_prof.c | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index e6bbeaa98..769f222b0 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -269,7 +269,7 @@ const char *crypt_build_settings = #if defined(LTC_MRSA) " RSA" #if defined(LTC_RSA_BLINDING) - " (with blinding)" + " (with blinding)" #endif "\n" #endif @@ -277,7 +277,11 @@ const char *crypt_build_settings = " DH\n" #endif #if defined(LTC_MECC) - " ECC\n" + " ECC" +#if defined(LTC_ECC_TIMING_RESISTANT) + " (with blinding)" +#endif + "\n" #endif #if defined(LTC_MDSA) " DSA\n" @@ -301,12 +305,12 @@ const char *crypt_build_settings = #endif #if defined(__clang_version__) " Clang compiler " __clang_version__ ".\n" -#elif defined(__GNUC__) /* clang also defines __GNUC__ */ - " GCC compiler detected.\n" -#endif -#if defined(INTEL_CC) - " Intel C Compiler detected.\n" +#elif defined(INTEL_CC) + " Intel C Compiler " __VERSION__ ".\n" +#elif defined(__GNUC__) /* clang and icc also define __GNUC__ */ + " GCC compiler " __VERSION__ ".\n" #endif + #if defined(__x86_64__) " x86-64 detected.\n" #endif diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index c842b25ce..0366dc923 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -181,7 +181,8 @@ for (cnt = 0; cnt < len; ) { len2 = rsa_msgsize; DO(rsa_decrypt_key(out, len, tmp, &len2, NULL, 0, hash_idx, &stat, &key)); if (!(stat == 1 && stat2 == 0)) { - fprintf(stderr, "rsa_decrypt_key failed"); + fprintf(stderr, "rsa_decrypt_key (without lparam) failed (rsa_msgsize = %lu)", rsa_msgsize); + fprintf(stderr, "\n stat: %i stat2: %i", stat, stat2); return 1; } if (len2 != rsa_msgsize || memcmp(tmp, in, rsa_msgsize)) { @@ -226,7 +227,7 @@ for (cnt = 0; cnt < len; ) { len2 = rsa_msgsize; DO(rsa_decrypt_key(out, len, tmp, &len2, lparam, sizeof(lparam), hash_idx, &stat, &key)); if (!(stat == 1 && stat2 == 0)) { - fprintf(stderr, "rsa_decrypt_key failed"); + fprintf(stderr, "rsa_decrypt_key (with lparam) failed (rsa_msgsize = %lu)", rsa_msgsize); return 1; } if (len2 != rsa_msgsize || memcmp(tmp, in, rsa_msgsize)) { diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 8ff77cba6..534a4faa6 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -1306,7 +1306,7 @@ void time_macs_(unsigned long MAC_SIZE) hash_idx = find_hash("sha1"); if (cipher_idx == -1 || hash_idx == -1) { - fprintf(stderr, "Warning the MAC tests requires AES and LTC_SHA1 to operate... so sorry\n"); + fprintf(stderr, "Warning the MAC tests requires AES and SHA1 to operate... so sorry\n"); return; } @@ -1320,13 +1320,13 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read(); z = 16; if ((err = omac_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\nomac error... %s\n", error_to_string(err)); + fprintf(stderr, "\n\nomac-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); exit(EXIT_FAILURE); } t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "LTC_OMAC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "OMAC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_XCBC @@ -1336,7 +1336,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read(); z = 16; if ((err = xcbc_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\nxcbc error... %s\n", error_to_string(err)); + fprintf(stderr, "\n\nxcbc-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); exit(EXIT_FAILURE); } t1 = t_read() - t1; @@ -1352,7 +1352,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read(); z = 16; if ((err = f9_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\nF9 error... %s\n", error_to_string(err)); + fprintf(stderr, "\n\nF9-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); exit(EXIT_FAILURE); } t1 = t_read() - t1; @@ -1368,13 +1368,13 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read(); z = 16; if ((err = pmac_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\npmac error... %s\n", error_to_string(err)); + fprintf(stderr, "\n\npmac-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); exit(EXIT_FAILURE); } t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "PMAC-AES\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "PMAC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_PELICAN @@ -1390,7 +1390,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "LTC_PELICAN \t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "PELICAN \t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_HMAC @@ -1400,13 +1400,13 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read(); z = 16; if ((err = hmac_memory(hash_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\nhmac error... %s\n", error_to_string(err)); + fprintf(stderr, "\n\nhmac-%s error... %s\n", hash_descriptor[hash_idx].name, error_to_string(err)); exit(EXIT_FAILURE); } t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "LTC_HMAC-%s\t\t%9llu\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "HMAC-%s\t\t%9llu\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif XFREE(buf); From 098bc9f06d5262860a9c5cb8ee1083d6e237d2ee Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 12 Jul 2014 16:46:36 +0200 Subject: [PATCH 0210/1192] tests: use the gcc rdtsc() implementation also for intel cc --- testprof/x86_prof.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 534a4faa6..ca9441ca1 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -43,11 +43,7 @@ void tally_results(int type) ulong64 rdtsc (void) { #if defined __GNUC__ && !defined(LTC_NO_ASM) - #ifdef INTEL_CC - ulong64 a; - asm ( " rdtsc ":"=A"(a)); - return a; - #elif defined(__i386__) || defined(__x86_64__) + #if defined(__i386__) || defined(__x86_64__) /* version from http://www.mcs.anl.gov/~kazutomo/rdtsc.html * the old code always got a warning issued by gcc, clang did not complain... */ From 1f96647d70b4e247894ad550bbe0860ec729a1ea Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 12 Jul 2014 17:25:12 +0200 Subject: [PATCH 0211/1192] update icc makefiles to current compiler versions As the current icc can act as a gcc drop-in, I took over all compile flags from the standard makefile. The "-x?" options have been deprecated, so they're updated. The "-xP" has been removed, since it makes no sense in my eyes to define the optimization for a specific architecture in the makefile. --- makefile.icc | 37 +++++++++++++++++++++---------------- testprof/makefile.icc | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/makefile.icc b/makefile.icc index c5182d8df..f18d1d5b0 100644 --- a/makefile.icc +++ b/makefile.icc @@ -18,16 +18,16 @@ CC=icc #LD=ld # Archiver [makes .a files] +# With compile option "-ipo" it can be necessary to archive with 'xiar' #AR=ar #ARFLAGS=r -# Compilation flags. Note the += does not write over the user's CFLAGS! -CFLAGS += -c -Isrc/headers/ -Itestprof/ -DINTEL_CC -DLTC_SOURCE +ifndef MAKE + MAKE=make +endif -#ICC v9 doesn't support LTC_FAST for things like Pelican MAC -#Despite the fact I can't see what's wrong with my code -#Oh well -CFLAGS += -DLTC_NO_FAST +# Compilation flags. Note the += does not write over the user's CFLAGS! +CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE #The default rule for make builds the libtomcrypt library. default:library @@ -35,23 +35,28 @@ default:library # optimize for SPEED # # -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4 -# -ax? specifies make code specifically for ? but compatible with IA-32 -# -x? specifies compile solely for ? [not specifically IA-32 compatible] +# -a? specifies make code specifically for ? but compatible with IA-32 +# -? specifies compile solely for ? [not specifically IA-32 compatible] # # where ? is -# K - PIII -# W - first P4 [Williamette] -# N - P4 Northwood -# P - P4 Prescott -# B - Blend of P4 and PM [mobile] +# mia - PIII; has only option "-mia32", no "-amia32" +# msse2 - first P4 [Willamette]; has only option "-msse2", no "-amsse2" +# xSSE2 - P4 Northwood +# xSSE3 - P4 Prescott +# +# The easiest way - when compiling on one architecture, only for +# this architecture - is to enable the compiler option "-fast", which enables +# "all possible" optimizations for this architecture. +# ICC 14.0.3 20140422 says "-fast" resolves to +# "-xHOST -O3 -ipo -no-prec-div -static" # # Default to just generic max opts ifdef LTC_SMALL -CFLAGS += -O2 -xP -ip +CFLAGS += -O1 endif ifndef IGNORE_SPEED -CFLAGS += -O3 -xP -ip +CFLAGS += -O3 endif # want to see stuff? @@ -267,7 +272,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c library: $(LIBNAME) testprof/$(LIBTEST): - cd testprof ; LIBTEST_S=$(LIBTEST) CFLAGS="$(CFLAGS)" make -f makefile.icc + cd testprof ; LIBTEST_S=$(LIBTEST) CFLAGS="$(CFLAGS)" CC="$(CC)" AR="$(AR)" $(MAKE) -f makefile.icc $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) diff --git a/testprof/makefile.icc b/testprof/makefile.icc index 126c2afff..bbfd72863 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -1,5 +1,5 @@ CFLAGS += -I../src/headers -I./ -CC=icc +CC?=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ From 6dfb08081084908e6ec6d604a1a73c36f7722dcb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 12 Jul 2014 17:26:30 +0200 Subject: [PATCH 0212/1192] spit errors if 32- AND 64-bit wordsize is defined --- src/headers/tomcrypt_cfg.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index e17aa6a78..331fb5b8f 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -155,6 +155,10 @@ typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; #define ENDIAN_NEUTRAL #endif +#if (defined(ENDIAN_32BITWORD) && defined(ENDIAN_64BITWORD)) + #error Can not be 32 and 64 bit words... +#endif + /* gcc 4.3 and up has a bswap builtin; detect it by gcc version. * clang also supports the bswap builtin, and although clang pretends * to be gcc (macro-wise, anyway), clang pretends to be a version From 3c6a80525f7c05f72f502e4de8068455207aa300 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 12 Jul 2014 17:28:54 +0200 Subject: [PATCH 0213/1192] current icc defines the same macros and functionset as gcc as a result the special detection of icc has been removed --- src/headers/tomcrypt_cfg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 331fb5b8f..c34169434 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -56,7 +56,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); */ /* detect x86-32 machines somewhat */ -#if !defined(__STRICT_ANSI__) && !defined(_WIN64) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) +#if !defined(__STRICT_ANSI__) && !defined(_WIN64) && ((defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) #define ENDIAN_LITTLE #define ENDIAN_32BITWORD #define LTC_FAST @@ -101,7 +101,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #endif #ifdef LTC_FAST -#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc */ +#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc nor icc */ #error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway #else #ifdef ENDIAN_64BITWORD From 9e2e7fdfd469e3938c10e2a7cefde81b32f892a4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 12 Jul 2014 17:31:03 +0200 Subject: [PATCH 0214/1192] tests: bring back mult and sqr timing --- testprof/x86_prof.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index ca9441ca1..4dbaa71f7 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -774,8 +774,10 @@ int time_hash(void) return 0; } -#undef MPI /*#warning you need an mp_rand!!!*/ +#ifndef USE_LTM + #undef MPI +#endif #ifdef MPI void time_mult(void) @@ -786,11 +788,11 @@ void time_mult(void) fprintf(stderr, "Timing Multiplying:\n"); mp_init_multi(&a,&b,&c,NULL); - for (x = 128/DIGIT_BIT; x <= 1536/DIGIT_BIT; x += 128/DIGIT_BIT) { - mp_rand(&a, x); - mp_rand(&b, x); + for (x = 128/MP_DIGIT_BIT; x <= (unsigned long)1536/MP_DIGIT_BIT; x += 128/MP_DIGIT_BIT) { + mp_rand(a, x); + mp_rand(b, x); -#define DO1 mp_mul(&a, &b, &c); +#define DO1 mp_mul(a, b, c); #define DO2 DO1; DO1; t2 = -1; @@ -801,9 +803,9 @@ void time_mult(void) t1 = (t_read() - t1)>>1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "%4lu bits: %9llu cycles\n", x*DIGIT_BIT, t2); + fprintf(stderr, "%4lu bits: %9llu cycles\n", x*MP_DIGIT_BIT, t2); } - mp_clear_multi(&a,&b,&c,NULL); + mp_clear_multi(a,b,c,NULL); #undef DO1 #undef DO2 @@ -813,14 +815,14 @@ void time_sqr(void) { ulong64 t1, t2; unsigned long x, y; - mp_int a, b; + void *a, *b; fprintf(stderr, "Timing Squaring:\n"); mp_init_multi(&a,&b,NULL); - for (x = 128/DIGIT_BIT; x <= 1536/DIGIT_BIT; x += 128/DIGIT_BIT) { - mp_rand(&a, x); + for (x = 128/MP_DIGIT_BIT; x <= (unsigned long)1536/MP_DIGIT_BIT; x += 128/MP_DIGIT_BIT) { + mp_rand(a, x); -#define DO1 mp_sqr(&a, &b); +#define DO1 mp_sqr(a, b); #define DO2 DO1; DO1; t2 = -1; @@ -831,9 +833,9 @@ void time_sqr(void) t1 = (t_read() - t1)>>1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "%4lu bits: %9llu cycles\n", x*DIGIT_BIT, t2); + fprintf(stderr, "%4lu bits: %9llu cycles\n", x*MP_DIGIT_BIT, t2); } - mp_clear_multi(&a,&b,NULL); + mp_clear_multi(a,b,NULL); #undef DO1 #undef DO2 From a0d0a17acf6554d927d62d3904763bfd8eae89fa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 13 Jul 2014 14:41:07 +0200 Subject: [PATCH 0215/1192] update gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 63c6304d7..8f8f6d168 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ # suppress compiler/linker output *.[oa] *.obj +*.l[oa] [Dd]ebug/ [Rr]elease/ +.libs/ # suppress output of build process gcc_[12].txt @@ -12,6 +14,12 @@ tv.txt *_tv.txt # *nix/windows test executables +encrypt +encrypt.exe +hashsum +hashsum.exe +small +small.exe test test.exe tv_gen From 4089cc963c032afab3334c8e015c4e51fcdf6f76 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 14 Jul 2014 14:26:41 +0200 Subject: [PATCH 0216/1192] update shared makefiles split up install target in "install" and "install_test" as in standard makefile use libtool to compile and link clean up and bring in sync with standard makefile targets --- makefile.shared | 50 ++++++++++++++++++++++------------------ testprof/makefile.shared | 20 ++++++++-------- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/makefile.shared b/makefile.shared index e0a86361a..d658e0849 100644 --- a/makefile.shared +++ b/makefile.shared @@ -9,15 +9,14 @@ VERSION=0:117 # Compiler and Linker Names -CC=libtool --mode=compile --tag=CC gcc - -# ranlib tools -ifndef RANLIB - RANLIB=ranlib +ifeq ($(CC),cc) + CC = gcc endif +LT ?= libtool +LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) # Compilation flags. Note the += does not write over the user's CFLAGS! -CFLAGS += -c -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -DLTC_SOURCE +CFLAGS += -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE # additional warnings (newer GCC 3.4 and higher) ifdef GCC_34 @@ -233,7 +232,6 @@ src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h #END_INS -TESTOBJECTS=demos/test.o HASHOBJECTS=demos/hashsum.o CRYPTOBJECTS=demos/encrypt.o SMALLOBJECTS=demos/small.o @@ -246,7 +244,7 @@ default:library #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o + $(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o #These are the rules to make certain object files. src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c @@ -259,41 +257,47 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c library: $(LIBNAME) testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) make -f makefile.shared + cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC=$(CC) make -f makefile.shared -objs: $(OBJECTS) +.c.o: + $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< -$(LIBNAME): $(OBJECTS) testprof/$(LIBTEST) - libtool --silent --mode=link gcc $(LDFLAGS) $(CFLAGS) `find . -type f | grep "[.]lo" | grep "src/" | xargs` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) +$(LIBNAME): $(OBJECTS) + $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) install: $(LIBNAME) install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) - cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) make -f makefile.shared install - libtool --silent --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la + $(LT) --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) install -d $(DESTDIR)$(LIBPATH)/pkgconfig sed 's,@LIBDIR@,$(LIBPATH),g' libtomcrypt.pc.in > libtomcrypt.pc install -m 0644 -g $(GROUP) -o $(USER) libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc +install_test: testprof/$(LIBTEST) + install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) + install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) + cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) LT=$(LT) CC=$(CC) make -f makefile.shared install + #This rule makes the hash program included with libtomcrypt -hashsum: library - gcc $(CFLAGS) demos/hashsum.c -o hashsum.o - gcc -o hashsum hashsum.o -ltomcrypt $(EXTRALIBS) +hashsum: library $(HASHOBJECTS) + $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(HASH) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) #makes the crypt program -crypt: library - gcc $(CFLAGS) demos/encrypt.c -o encrypt.o - gcc -o crypt encrypt.o -ltomcrypt $(EXTRALIBS) +crypt: library $(CRYPTOBJECTS) + $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(CRYPT) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) + +small: library $(SMALLOBJECTS) + $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(SMALL) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) tv_gen: library $(TVS) - gcc -o tv_gen $(TVS) -ltomcrypt $(EXTRALIBS) + $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TV) $(TVS) $(LIBNAME) $(EXTRALIBS) test: library testprof/$(LIBTEST) $(TESTS) - gcc -o $(TEST) $(TESTS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS) + $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) timing: library testprof/$(LIBTEST) $(TIMINGS) - gcc -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS) + $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) # $Source$ # $Revision$ diff --git a/testprof/makefile.shared b/testprof/makefile.shared index 52580fa88..cf891851b 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -1,11 +1,10 @@ -CC=libtool --mode=compile gcc - -CFLAGS += -I../src/headers -I./ -Wall -W - -# ranlib tools -ifndef RANLIB - RANLIB=ranlib +ifeq ($(CC),cc) + CC = gcc endif +LT ?= libtool +LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) + +CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ @@ -17,8 +16,11 @@ endif default: $(LIBTEST) +.c.o: + $(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $< + $(LIBTEST): $(OBJECTS) - libtool --silent --mode=link gcc $(CFLAGS) `find . -type f | grep "[.]lo" | xargs` -o $@ -rpath $(LIBPATH) -version-info $(VERSION) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) `find . -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION) install: $(LIBTEST) - libtool --silent --mode=install install -c $(LIBTEST) $(DESTDIR)$(LIBPATH)/$(LIBTEST) + $(LT) --mode=install install -c $(LIBTEST) $(DESTDIR)$(LIBPATH)/$(LIBTEST) From fd140d4535e541f749d4a5b787d57fa75e33c46e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 14 Jul 2014 15:42:32 +0200 Subject: [PATCH 0217/1192] clean up makefile --- makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index 3257eef44..7a055f2fe 100644 --- a/makefile +++ b/makefile @@ -13,7 +13,9 @@ ifndef PREFIX PREFIX= endif -CC?=$(PREFIX)gcc +ifeq ($(CC),cc) + CC = $(PREFIX)gcc +endif LD=$(PREFIX)ld AR=$(PREFIX)ar @@ -75,7 +77,6 @@ LIBTEST_S=$(LIBTEST) HASH=hashsum CRYPT=encrypt SMALL=small -PROF=x86_prof TV=tv_gen MULTI=multi TIMING=timing @@ -247,7 +248,6 @@ src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h #END_INS -TESTOBJECTS=demos/test.o HASHOBJECTS=demos/hashsum.o CRYPTOBJECTS=demos/encrypt.o SMALLOBJECTS=demos/small.o @@ -290,15 +290,15 @@ $(LIBNAME): $(OBJECTS) #This rule makes the hash program included with libtomcrypt hashsum: library $(HASHOBJECTS) - $(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) $(WARN) + $(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) #makes the crypt program crypt: library $(CRYPTOBJECTS) - $(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) $(WARN) + $(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) #makes the small program small: library $(SMALLOBJECTS) - $(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) $(WARN) + $(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) tv_gen: library $(TVS) $(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) @@ -359,7 +359,7 @@ clean: rm -f `find . -type f -name "*.dpi" | xargs` rm -rf `find . -type d -name "*.libs" | xargs` rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc - rm -f $(TV) $(PROF) $(SMALL) $(CRYPT) $(HASHSUM) $(MULTI) $(TIMING) $(TEST) + rm -f $(TV) $(SMALL) $(CRYPT) $(HASH) $(MULTI) $(TIMING) $(TEST) rm -rf doc/doxygen rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` rm -f *.txt From 1b29ce896f9748ee3032cdfd1eca345a7909d558 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Thu, 6 Mar 2014 15:46:01 -0800 Subject: [PATCH 0218/1192] include compiler defines and other minor refinements --- demos/demo_crypt_constants.c | 60 ++++++ demos/demo_crypt_sizes.c | 55 ++++++ makefile | 11 ++ src/misc/crypt/crypt_constants.c | 121 ++++++++++++ src/misc/crypt/crypt_inits.c | 44 +++++ src/misc/crypt/crypt_sizes.c | 305 +++++++++++++++++++++++++++++++ 6 files changed, 596 insertions(+) create mode 100644 demos/demo_crypt_constants.c create mode 100644 demos/demo_crypt_sizes.c create mode 100755 src/misc/crypt/crypt_constants.c create mode 100755 src/misc/crypt/crypt_inits.c create mode 100755 src/misc/crypt/crypt_sizes.c diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c new file mode 100644 index 000000000..5ca6a87d8 --- /dev/null +++ b/demos/demo_crypt_constants.c @@ -0,0 +1,60 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file demo_crypt_constants.c + + Demo how to get various constants to dynamic languages + like Python + + Larry Bugbee, February 2013 +*/ + + +// in lieu of a header file +int crypt_get_constant(const char* namein, int *valueout); +int crypt_list_all_constants(char *names_list, + unsigned long *names_list_size); + + +int main(void) { + int rc; + + printf("\n"); + + // given a specific constant name, get and print its value + char name[] = "CTR_COUNTER_BIG_ENDIAN"; + int value; + + rc = crypt_get_constant(name, &value); + printf(" %s is %d \n", name, value); + printf("\n"); + + // get and print the length of the names (and values) list + char *names_list; + unsigned long names_list_len; + + rc = crypt_list_all_constants(NULL, &names_list_len); + printf(" need to allocate %lu bytes \n", names_list_len); + printf("\n"); + + // get and print the names (and values) list + names_list = malloc(names_list_len); + rc = crypt_list_all_constants(names_list, &names_list_len); + printf(" supported constants: \n%s \n", names_list); + printf("\n"); +} + + +/* $Source: $ */ +/* $Revision: $ */ +/* $Date: $ */ diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c new file mode 100644 index 000000000..f2154e266 --- /dev/null +++ b/demos/demo_crypt_sizes.c @@ -0,0 +1,55 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file demo_crypt_sizes.c + + Demo how to get various sizes to dynamic languages + like Python - Larry Bugbee, February 2013 +*/ + + +// in lieu of a header file +int crypt_get_size(const char* namein, int *sizeout); +int crypt_list_all_sizes(char *names_list, + unsigned long *names_list_size); + + +int main(void) { + int rc; + printf("\n"); + + // given a specific size name, get and print its size + char name[] = "ecc_key_struct_size"; + int size; + rc = crypt_get_size(name, &size); + printf(" %s is %d \n", name, size); + printf("\n"); + + // get and print the length of the names (and sizes) list + char *sizes_list; + unsigned long sizes_list_len; + rc = crypt_list_all_sizes(NULL, &sizes_list_len); + printf(" need to allocate %lu bytes \n", sizes_list_len); + printf("\n"); + + // get and print the names (and sizes) list + sizes_list = malloc(sizes_list_len); + rc = crypt_list_all_sizes(sizes_list, &sizes_list_len); + printf(" supported sizes: %s \n", sizes_list); + printf("\n"); +} + + +/* $Source: $ */ +/* $Revision: $ */ +/* $Date: $ */ diff --git a/makefile b/makefile index 7a055f2fe..2ff2d8223 100644 --- a/makefile +++ b/makefile @@ -81,6 +81,8 @@ TV=tv_gen MULTI=multi TIMING=timing TEST=test +SIZES=sizes +CONSTANTS=constants #LIBPATH-The directory for libtomcrypt to be installed to. #INCPATH-The directory to install the header files for libtomcrypt. @@ -255,6 +257,8 @@ TVS=demos/tv_gen.o MULTIS=demos/multi.o TIMINGS=demos/timing.o TESTS=demos/test.o +CRYPTSIZES=demos/demo_crypt_sizes.o +CRYPTCONSTANTS=demos/demo_crypt_constants.o #Files left over from making the crypt.pdf. LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof @@ -312,6 +316,12 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +sizes: library $(CRYPTSIZES) + $(CC) $(LDFLAGS) $(CRYPTSIZES) $(LIBNAME) $(EXTRALIBS) -o $(SIZES) + +constants: library $(CRYPTCONSTANTS) + $(CC) $(LDFLAGS) $(CRYPTCONSTANTS) $(LIBNAME) $(EXTRALIBS) -o $(CONSTANTS) + #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. @@ -360,6 +370,7 @@ clean: rm -rf `find . -type d -name "*.libs" | xargs` rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc rm -f $(TV) $(SMALL) $(CRYPT) $(HASH) $(MULTI) $(TIMING) $(TEST) + rm -f $(SIZES) $(CONSTANTS) rm -rf doc/doxygen rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` rm -f *.txt diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c new file mode 100755 index 000000000..79b19420c --- /dev/null +++ b/src/misc/crypt/crypt_constants.c @@ -0,0 +1,121 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file crypt_constants.c + + Make various constants available to dynamic languages + like Python - Larry Bugbee, February 2013 + + LB - Dec 2013 - revised to include compiler define options +*/ + +typedef struct { + const char *name; + const long value; +} crypt_constant; + +crypt_constant _crypt_constants[] = { +#ifdef LTC_CTR_MODE + {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, + {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, + {"LTC_CTR_RFC3686", LTC_CTR_RFC3686}, +#endif + + {"PK_PUBLIC", PK_PUBLIC}, + {"PK_PRIVATE", PK_PRIVATE}, +#ifdef LTC_MRSA + {"MIN_RSA_SIZE", MIN_RSA_SIZE}, + {"MAX_RSA_SIZE", MAX_RSA_SIZE}, +#endif + +#ifdef LTC_PKCS_1 + {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, + {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, + {"LTC_PKCS_1_V1_5", LTC_PKCS_1_V1_5}, +#endif +}; + + +/* crypt_get_constant() + * sizeout will be the size (bytes) of the named struct or union + * return -1 if named item not found + */ +int crypt_get_constant(const char* namein, int *valueout) { + int i; + int _crypt_constants_len = sizeof(_crypt_constants) / sizeof(crypt_constant); + for (i=0; i<_crypt_constants_len; i++) { + if (strcmp(_crypt_constants[i].name, namein) == 0) { + *valueout = _crypt_constants[i].value; + return 0; + } + } + return 1; +} + +/* crypt_list_all_constants() + * if names_list is NULL, names_list_size will be the minimum + * size needed to receive the complete names_list + * if names_list is NOT NULL, names_list must be the addr with + * sufficient memory allocated into which the names_list + * is to be written. Also, the value in names_list_size + * sets the upper bound of the number of characters to be + * written. + * a -1 return value signifies insufficient space made available + */ +int crypt_list_all_constants(char *names_list, + unsigned long *names_list_size) { + int i; + unsigned long total_len = 0; + char number[10]; + int number_len; + int count = sizeof(_crypt_constants) / sizeof(crypt_constant); + + /* calculate amount of memory required for the list */ + for (i=0; i *names_list_size) { + return -1; + } + /* build the names list */ + char *ptr = names_list; + for (i=0; i *names_list_size) { + return -1; + } + /* build the names list */ + char *ptr = names_list; + for (i=0; i Date: Thu, 6 Mar 2014 21:25:31 -0800 Subject: [PATCH 0219/1192] added a Python demo --- demos/demo_dynamic.py | 237 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 demos/demo_dynamic.py diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py new file mode 100644 index 000000000..a22e240c7 --- /dev/null +++ b/demos/demo_dynamic.py @@ -0,0 +1,237 @@ + + +""" + demo_dynamic.py v1 + + This program demonstrates Python's use of the dynamic + language support additions to LTC, namely access to LTC + constants, struct and union sizes, and the binding of a + math package to LTC. Also provided are simple code + fragments to illustrate how one might write a Python + wrapper for LTC and how an app might call the wrapper. + This or a similar model should work for Ruby and other + dynamic languages. + + This instance uses Python's ctypes and requires a single + .dylib linking together LTC and one or more math libraries. + Building a single .dylib is needed because LTC wants a + fairly tight relationship between itself and the mathlib. + (ctypes can load multiple .dylibs, but it does not support + this level of coupling between those independent libraries.) + + My .dylib was created on OSX with the following steps: + + 1- compile LTC to a .a static lib: + CFLAGS="-DLTM_DESC -DUSE_LTM -DTFM_DESC -DUSE_TFM \ + -I/usr/local/include" make + + 2- link LTC, LTM and TFM into a single .dylib: + ar2dylib_with_and tomcrypt tommath tfm + where ar2dylib_with_and is a shell script that combines + the .a with .dylibs for LTM and TFM + + Reminder: you don't need to bind in a math library unless + you are going to use LTC functions that depend + on a mathlib. For example, public key crypto + needs a mathlib; hashing and symmetric encryption + does not. + + Larry Bugbee + March 2014 + +""" + + +from ctypes import * +from ctypes.util import find_library + + +#--------------------------------------------------------------- +# load the .dylib + +libname = 'tomcrypt' +libpath = find_library(libname) + +print +print(' demo_dynamic.py') +print +print(' path to library %s: %s' % (libname, libpath)) + +LTC = cdll.LoadLibrary(libpath) +print(' loaded: %s' % LTC) +print + + + +#--------------------------------------------------------------- +# get list of all supported constants followed by a list of all +# supported sizes. One alternative: these lists may be parsed +# and used as needed. + +if 1: + print ' all supported constants and their values:' + + # get size to allocate for constants output list + str_len = c_int(0) + ret = LTC.crypt_list_all_constants(None, byref(str_len)) + print ' need to allocate %d bytes \n' % str_len.value + + # allocate that size and get (name, size) pairs, each pair + # separated by a newline char. + names_sizes = c_buffer(str_len.value) + ret = LTC.crypt_list_all_constants(names_sizes, byref(str_len)) + print names_sizes.value + print + + +if 1: + print ' all supported sizes:' + + # get size to allocate for sizes output list + str_len = c_int(0) + ret = LTC.crypt_list_all_sizes(None, byref(str_len)) + print ' need to allocate %d bytes \n' % str_len.value + + # allocate that size and get (name, size) pairs, each pair + # separated by a newline char. + names_sizes = c_buffer(str_len.value) + ret = LTC.crypt_list_all_sizes(names_sizes, byref(str_len)) + print names_sizes.value + print + + +#--------------------------------------------------------------- +# get individually named constants and sizes + +# print selected constants +if 1: + print '\n selected constants:' + + names = [ + 'PK_PUBLIC', + 'MAX_RSA_SIZE', + 'CTR_COUNTER_BIG_ENDIAN', + ] + for name in names: + const_value = c_int(0) + rc = LTC.crypt_get_constant(name, byref(const_value)) + value = const_value.value + print ' %-25s %d' % (name, value) + +# print selected sizes +if 1: + print '\n selected sizes:' + + names = [ + 'rijndael_key_struct_size', + 'rsa_key_struct_size', + 'symmetric_CTR_struct_size', + 'twofish_key_struct_size', + 'ecc_point_struct_size', + 'gcm_state_struct_size', + 'sha512_state_struct_size', + ] + for name in names: + size_value = c_int(0) + rc = LTC.crypt_get_size(name, byref(size_value)) + value = size_value.value + print ' %-25s %d' % (name, value) + + +#--------------------------------------------------------------- +# init the selected math package, change to another mathlib, +# and change back to the first mathlib + +if 1: + print '\n init the selected math package, change, and change again' + + # show ltm_desc + ptr = c_int.in_dll(LTC, 'ltm_desc') + print ' ltm_desc: ', hex(ptr.value) + # show tfm_desc + ptr = c_int.in_dll(LTC, 'tfm_desc') + print ' tfm_desc: ', hex(ptr.value) + # let's see the initial value of ltc_mp + ptr = c_int.in_dll(LTC, 'ltc_mp') + print ' initial ptr:', hex(ptr.value) + + # init LTM and show ltc_mp + LTC.init_LTM() + ptr = c_int.in_dll(LTC, 'ltc_mp') + print ' ptr to LTM: ', hex(ptr.value) + + # init TFM and show ltc_mp + LTC.init_TFM() + ptr = c_int.in_dll(LTC, 'ltc_mp') + print ' ptr to TFM: ', hex(ptr.value) + + # now change back to LTM + LTC.init_LTM() + ptr = c_int.in_dll(LTC, 'ltc_mp') + print ' ptr to LTM: ', hex(ptr.value) + + + +#--------------------------------------------------------------- +#--------------------------------------------------------------- +# ctypes getting a list of this build's supported algorithms +# and compiler switches + +def get_named_string(lib, name): + return c_char_p.in_dll(lib, name).value + +if 0: + print '\n%s' % ('-'*60) + print 'This is a string compiled into LTC showing compile ' + print 'options and algorithms supported by this build \n' + print get_named_string(LTC, 'crypt_build_settings') + print + + + +#--------------------------------------------------------------- +#--------------------------------------------------------------- +# here is an example of how a wrapper can make Python access +# more Pythonic + +# - - - - - - - - - - - - - +# a wrapper fragment... + +def _get_size(name): + size = c_int(0) + rc = LTC.crypt_get_size(name, byref(size)) + return size.value + +sha256_state_struct_size = _get_size('sha256_state_struct_size') +sha512_state_struct_size = _get_size('sha512_state_struct_size') + +class SHA256(object): + def __init__(self): + self.state = c_buffer(sha256_state_struct_size) + LTC.sha256_init(byref(self.state)) + def update(self, data): + LTC.sha256_process(byref(self.state), data, len(data)) + def digest(self): + md = c_buffer(32) + LTC.sha256_done(byref(self.state), byref(md)) + return md.raw + +# - - - - - - - - - - - - - +# an app fragment... + +# from wrapper import * # uncomment in real life + +data = 'hello world' + +sha256 = SHA256() +sha256.update(data) +md = sha256.digest() + +template = '\n\n the SHA256 digest for "%s" is %s \n' +print template % (data, md.encode('hex')) + + + +#--------------------------------------------------------------- +#--------------------------------------------------------------- +#--------------------------------------------------------------- From 3f9144c9a7e043421e0b90306a4681d49f11365a Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Sat, 8 Mar 2014 12:16:07 -0800 Subject: [PATCH 0220/1192] added signatures to header file --- demos/demo_crypt_constants.c | 7 +------ demos/demo_crypt_sizes.c | 7 +------ src/headers/tomcrypt_misc.h | 9 +++++++++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c index 5ca6a87d8..d15d0e991 100644 --- a/demos/demo_crypt_constants.c +++ b/demos/demo_crypt_constants.c @@ -9,6 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" +#include "tomcrypt_misc.h" /** @file demo_crypt_constants.c @@ -20,12 +21,6 @@ */ -// in lieu of a header file -int crypt_get_constant(const char* namein, int *valueout); -int crypt_list_all_constants(char *names_list, - unsigned long *names_list_size); - - int main(void) { int rc; diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index f2154e266..30f3b8964 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -9,6 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" +#include "tomcrypt_misc.h" /** @file demo_crypt_sizes.c @@ -18,12 +19,6 @@ */ -// in lieu of a header file -int crypt_get_size(const char* namein, int *sizeout); -int crypt_list_all_sizes(char *names_list, - unsigned long *names_list_size); - - int main(void) { int rc; printf("\n"); diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index e1e4457bb..ece5d92eb 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -49,6 +49,15 @@ extern const char *crypt_build_settings; /* ---- HMM ---- */ int crypt_fsa(void *mp, ...); +/* ---- Dynamic language support ---- */ +int crypt_get_constant(const char* namein, int *valueout); +int crypt_list_all_constants(char *names_list, + unsigned long *names_list_size); + +int crypt_get_size(const char* namein, int *sizeout); +int crypt_list_all_sizes(char *names_list, + unsigned long *names_list_size); + /* $Source$ */ /* $Revision$ */ /* $Date$ */ From a543e0caa6126566724dad87a0f31bd238d64eff Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Sat, 8 Mar 2014 12:16:58 -0800 Subject: [PATCH 0221/1192] changed to keep it simple --- demos/demo_dynamic.py | 59 ++++++++++--------------------------------- 1 file changed, 13 insertions(+), 46 deletions(-) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index a22e240c7..be538c0fb 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -13,28 +13,29 @@ dynamic languages. This instance uses Python's ctypes and requires a single - .dylib linking together LTC and one or more math libraries. - Building a single .dylib is needed because LTC wants a - fairly tight relationship between itself and the mathlib. - (ctypes can load multiple .dylibs, but it does not support - this level of coupling between those independent libraries.) + .dylib linking together LTC and a math library. Building + a single .dylib is needed because LTC wants a fairly tight + relationship between itself and the mathlib. (ctypes can + load multiple .dylibs, but it does not support this level + of tight coupling between otherwise independent libraries.) My .dylib was created on OSX with the following steps: 1- compile LTC to a .a static lib: - CFLAGS="-DLTM_DESC -DUSE_LTM -DTFM_DESC -DUSE_TFM \ - -I/usr/local/include" make + CFLAGS="-DLTM_DESC -DUSE_LTM" make - 2- link LTC, LTM and TFM into a single .dylib: - ar2dylib_with_and tomcrypt tommath tfm - where ar2dylib_with_and is a shell script that combines - the .a with .dylibs for LTM and TFM + 2- link LTC and LTM into a single .dylib: + ar2dylib_with tomcrypt tommath + where ar2dylib_with is a shell script that combines + the LTC .a with the LTM .dylib Reminder: you don't need to bind in a math library unless you are going to use LTC functions that depend on a mathlib. For example, public key crypto needs a mathlib; hashing and symmetric encryption - does not. + do not. + + This code was written for Python 2.7. Larry Bugbee March 2014 @@ -138,40 +139,6 @@ print ' %-25s %d' % (name, value) -#--------------------------------------------------------------- -# init the selected math package, change to another mathlib, -# and change back to the first mathlib - -if 1: - print '\n init the selected math package, change, and change again' - - # show ltm_desc - ptr = c_int.in_dll(LTC, 'ltm_desc') - print ' ltm_desc: ', hex(ptr.value) - # show tfm_desc - ptr = c_int.in_dll(LTC, 'tfm_desc') - print ' tfm_desc: ', hex(ptr.value) - # let's see the initial value of ltc_mp - ptr = c_int.in_dll(LTC, 'ltc_mp') - print ' initial ptr:', hex(ptr.value) - - # init LTM and show ltc_mp - LTC.init_LTM() - ptr = c_int.in_dll(LTC, 'ltc_mp') - print ' ptr to LTM: ', hex(ptr.value) - - # init TFM and show ltc_mp - LTC.init_TFM() - ptr = c_int.in_dll(LTC, 'ltc_mp') - print ' ptr to TFM: ', hex(ptr.value) - - # now change back to LTM - LTC.init_LTM() - ptr = c_int.in_dll(LTC, 'ltc_mp') - print ' ptr to LTM: ', hex(ptr.value) - - - #--------------------------------------------------------------- #--------------------------------------------------------------- # ctypes getting a list of this build's supported algorithms From ef1fe79ca597d3f64412c95eca8792901781ae37 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Tue, 11 Mar 2014 22:25:27 -0700 Subject: [PATCH 0222/1192] added missing signatures --- src/headers/tomcrypt_misc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index ece5d92eb..73b0c5ff4 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -58,6 +58,10 @@ int crypt_get_size(const char* namein, int *sizeout); int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size); +void init_LTM(void); +void init_TFM(void); + + /* $Source$ */ /* $Revision$ */ /* $Date$ */ From f07234fd93227f80aedb921120716543a5ac8c6f Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Wed, 12 Mar 2014 01:48:26 -0700 Subject: [PATCH 0223/1192] removed redundant include --- demos/demo_crypt_constants.c | 1 - demos/demo_crypt_sizes.c | 1 - 2 files changed, 2 deletions(-) diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c index d15d0e991..410c13203 100644 --- a/demos/demo_crypt_constants.c +++ b/demos/demo_crypt_constants.c @@ -9,7 +9,6 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" -#include "tomcrypt_misc.h" /** @file demo_crypt_constants.c diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index 30f3b8964..ea566d948 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -9,7 +9,6 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" -#include "tomcrypt_misc.h" /** @file demo_crypt_sizes.c From 46b6e36ea66635c821907c25ed49278a72373d69 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Thu, 13 Mar 2014 21:07:25 -0700 Subject: [PATCH 0224/1192] to know if LTC compiled big/little endian, 32/64-bit word --- demos/demo_dynamic.py | 2 ++ src/misc/crypt/crypt_constants.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index be538c0fb..275a6e878 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -109,6 +109,8 @@ print '\n selected constants:' names = [ + 'ENDIAN_LITTLE', + 'ENDIAN_64BITWORD', 'PK_PUBLIC', 'MAX_RSA_SIZE', 'CTR_COUNTER_BIG_ENDIAN', diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 79b19420c..bc7457821 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -25,6 +25,30 @@ typedef struct { } crypt_constant; crypt_constant _crypt_constants[] = { +#ifdef ENDIAN_LITTLE + {"ENDIAN_LITTLE", 1}, // true +#else + {"ENDIAN_LITTLE", 0}, // false +#endif + +#ifdef ENDIAN_BIG + {"ENDIAN_BIG", 1}, // true +#else + {"ENDIAN_BIG", 0}, // false +#endif + +#ifdef ENDIAN_32BITWORD + {"ENDIAN_32BITWORD", 1}, // true +#else + {"ENDIAN_32BITWORD", 0}, // false +#endif + +#ifdef ENDIAN_64BITWORD + {"ENDIAN_64BITWORD", 1}, // true +#else + {"ENDIAN_64BITWORD", 0}, // false +#endif + #ifdef LTC_CTR_MODE {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, From a6b68849827b4517b3bebfeae593271559d6c51f Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Sun, 16 Mar 2014 00:14:43 -0700 Subject: [PATCH 0225/1192] minor editorial changes --- src/misc/crypt/crypt_constants.c | 46 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index bc7457821..486a3123f 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -17,6 +17,7 @@ like Python - Larry Bugbee, February 2013 LB - Dec 2013 - revised to include compiler define options + LB - Mar 2014 - added endianness and word size */ typedef struct { @@ -25,6 +26,26 @@ typedef struct { } crypt_constant; crypt_constant _crypt_constants[] = { + {"PK_PUBLIC", PK_PUBLIC}, + {"PK_PRIVATE", PK_PRIVATE}, + +#ifdef LTC_CTR_MODE + {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, + {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, + {"LTC_CTR_RFC3686", LTC_CTR_RFC3686}, +#endif + +#ifdef LTC_MRSA + {"MIN_RSA_SIZE", MIN_RSA_SIZE}, + {"MAX_RSA_SIZE", MAX_RSA_SIZE}, +#endif + +#ifdef LTC_PKCS_1 + {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, + {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, + {"LTC_PKCS_1_V1_5", LTC_PKCS_1_V1_5}, +#endif + #ifdef ENDIAN_LITTLE {"ENDIAN_LITTLE", 1}, // true #else @@ -48,30 +69,11 @@ crypt_constant _crypt_constants[] = { #else {"ENDIAN_64BITWORD", 0}, // false #endif - -#ifdef LTC_CTR_MODE - {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, - {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, - {"LTC_CTR_RFC3686", LTC_CTR_RFC3686}, -#endif - - {"PK_PUBLIC", PK_PUBLIC}, - {"PK_PRIVATE", PK_PRIVATE}, -#ifdef LTC_MRSA - {"MIN_RSA_SIZE", MIN_RSA_SIZE}, - {"MAX_RSA_SIZE", MAX_RSA_SIZE}, -#endif - -#ifdef LTC_PKCS_1 - {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, - {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, - {"LTC_PKCS_1_V1_5", LTC_PKCS_1_V1_5}, -#endif }; /* crypt_get_constant() - * sizeout will be the size (bytes) of the named struct or union + * valueout will be the value of the named constant * return -1 if named item not found */ int crypt_get_constant(const char* namein, int *valueout) { @@ -88,8 +90,8 @@ int crypt_get_constant(const char* namein, int *valueout) { /* crypt_list_all_constants() * if names_list is NULL, names_list_size will be the minimum - * size needed to receive the complete names_list - * if names_list is NOT NULL, names_list must be the addr with + * number of bytes needed to receive the complete names_list + * if names_list is NOT NULL, names_list must be the addr of * sufficient memory allocated into which the names_list * is to be written. Also, the value in names_list_size * sets the upper bound of the number of characters to be From e628fb9203caff080d5a9a8de048a1de5b7f485f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 13:58:48 +0200 Subject: [PATCH 0226/1192] clean up/trim trailing spaces --- demos/demo_crypt_constants.c | 48 +++++++++++++------------- demos/demo_crypt_sizes.c | 20 +++++------ src/headers/tomcrypt_misc.h | 6 ++-- src/misc/crypt/crypt_constants.c | 58 ++++++++++++++++---------------- src/misc/crypt/crypt_sizes.c | 40 +++++++++++----------- 5 files changed, 83 insertions(+), 89 deletions(-) diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c index 410c13203..9c41cf764 100644 --- a/demos/demo_crypt_constants.c +++ b/demos/demo_crypt_constants.c @@ -12,43 +12,43 @@ /** @file demo_crypt_constants.c - - Demo how to get various constants to dynamic languages + + Demo how to get various constants to dynamic languages like Python - + Larry Bugbee, February 2013 */ int main(void) { - int rc; - - printf("\n"); - // given a specific constant name, get and print its value char name[] = "CTR_COUNTER_BIG_ENDIAN"; int value; - - rc = crypt_get_constant(name, &value); - printf(" %s is %d \n", name, value); - printf("\n"); - + + if (crypt_get_constant(name, &value) != 0) + exit(EXIT_FAILURE); + printf("\n %s is %d \n\n", name, value); + // get and print the length of the names (and values) list char *names_list; unsigned long names_list_len; - - rc = crypt_list_all_constants(NULL, &names_list_len); - printf(" need to allocate %lu bytes \n", names_list_len); - printf("\n"); - + + if (crypt_list_all_constants(NULL, &names_list_len) != 0) + exit(EXIT_FAILURE); + printf(" need to allocate %lu bytes \n\n", names_list_len); + // get and print the names (and values) list - names_list = malloc(names_list_len); - rc = crypt_list_all_constants(names_list, &names_list_len); - printf(" supported constants: \n%s \n", names_list); - printf("\n"); + if ((names_list = malloc(names_list_len)) == NULL) + exit(EXIT_FAILURE); + if (crypt_list_all_constants(names_list, &names_list_len) != 0) + exit(EXIT_FAILURE); + printf(" supported constants:\n\n%s\n\n", names_list); + free(names_list); + + return 0; } -/* $Source: $ */ -/* $Revision: $ */ -/* $Date: $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index ea566d948..dcd8bb0d8 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -12,35 +12,31 @@ /** @file demo_crypt_sizes.c - - Demo how to get various sizes to dynamic languages + + Demo how to get various sizes to dynamic languages like Python - Larry Bugbee, February 2013 */ int main(void) { int rc; - printf("\n"); - + // given a specific size name, get and print its size char name[] = "ecc_key_struct_size"; int size; rc = crypt_get_size(name, &size); - printf(" %s is %d \n", name, size); - printf("\n"); - + printf("\n size of '%s' is %d \n\n", name, size); + // get and print the length of the names (and sizes) list char *sizes_list; unsigned long sizes_list_len; rc = crypt_list_all_sizes(NULL, &sizes_list_len); - printf(" need to allocate %lu bytes \n", sizes_list_len); - printf("\n"); - + printf(" need to allocate %lu bytes \n\n", sizes_list_len); + // get and print the names (and sizes) list sizes_list = malloc(sizes_list_len); rc = crypt_list_all_sizes(sizes_list, &sizes_list_len); - printf(" supported sizes: %s \n", sizes_list); - printf("\n"); + printf(" supported sizes:\n\n%s\n\n", sizes_list); } diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 73b0c5ff4..18d8b6da7 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -51,12 +51,10 @@ int crypt_fsa(void *mp, ...); /* ---- Dynamic language support ---- */ int crypt_get_constant(const char* namein, int *valueout); -int crypt_list_all_constants(char *names_list, - unsigned long *names_list_size); +int crypt_list_all_constants(char *names_list, unsigned long *names_list_size); int crypt_get_size(const char* namein, int *sizeout); -int crypt_list_all_sizes(char *names_list, - unsigned long *names_list_size); +int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size); void init_LTM(void); void init_TFM(void); diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 486a3123f..eda3b7593 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -12,10 +12,10 @@ /** @file crypt_constants.c - - Make various constants available to dynamic languages + + Make various constants available to dynamic languages like Python - Larry Bugbee, February 2013 - + LB - Dec 2013 - revised to include compiler define options LB - Mar 2014 - added endianness and word size */ @@ -39,7 +39,7 @@ crypt_constant _crypt_constants[] = { {"MIN_RSA_SIZE", MIN_RSA_SIZE}, {"MAX_RSA_SIZE", MAX_RSA_SIZE}, #endif - + #ifdef LTC_PKCS_1 {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, @@ -47,27 +47,27 @@ crypt_constant _crypt_constants[] = { #endif #ifdef ENDIAN_LITTLE - {"ENDIAN_LITTLE", 1}, // true + {"ENDIAN_LITTLE", 1}, #else - {"ENDIAN_LITTLE", 0}, // false + {"ENDIAN_LITTLE", 0}, #endif #ifdef ENDIAN_BIG - {"ENDIAN_BIG", 1}, // true + {"ENDIAN_BIG", 1}, #else - {"ENDIAN_BIG", 0}, // false + {"ENDIAN_BIG", 0}, #endif #ifdef ENDIAN_32BITWORD - {"ENDIAN_32BITWORD", 1}, // true + {"ENDIAN_32BITWORD", 1}, #else - {"ENDIAN_32BITWORD", 0}, // false + {"ENDIAN_32BITWORD", 0}, #endif #ifdef ENDIAN_64BITWORD - {"ENDIAN_64BITWORD", 1}, // true + {"ENDIAN_64BITWORD", 1}, #else - {"ENDIAN_64BITWORD", 0}, // false + {"ENDIAN_64BITWORD", 0}, #endif }; @@ -89,32 +89,31 @@ int crypt_get_constant(const char* namein, int *valueout) { } /* crypt_list_all_constants() - * if names_list is NULL, names_list_size will be the minimum + * if names_list is NULL, names_list_size will be the minimum * number of bytes needed to receive the complete names_list - * if names_list is NOT NULL, names_list must be the addr of - * sufficient memory allocated into which the names_list - * is to be written. Also, the value in names_list_size - * sets the upper bound of the number of characters to be + * if names_list is NOT NULL, names_list must be the addr of + * sufficient memory allocated into which the names_list + * is to be written. Also, the value in names_list_size + * sets the upper bound of the number of characters to be * written. * a -1 return value signifies insufficient space made available */ -int crypt_list_all_constants(char *names_list, - unsigned long *names_list_size) { +int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { int i; unsigned long total_len = 0; char number[10]; int number_len; - int count = sizeof(_crypt_constants) / sizeof(crypt_constant); - + int count = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); + /* calculate amount of memory required for the list */ for (i=0; i Date: Tue, 15 Jul 2014 14:09:50 +0200 Subject: [PATCH 0227/1192] use snprintf() instead of sprintf() --- src/misc/crypt/crypt_constants.c | 13 ++++++++----- src/misc/crypt/crypt_sizes.c | 11 +++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index eda3b7593..065a83281 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -78,7 +78,7 @@ crypt_constant _crypt_constants[] = { */ int crypt_get_constant(const char* namein, int *valueout) { int i; - int _crypt_constants_len = sizeof(_crypt_constants) / sizeof(crypt_constant); + int _crypt_constants_len = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); for (i=0; i<_crypt_constants_len; i++) { if (strcmp(_crypt_constants[i].name, namein) == 0) { *valueout = _crypt_constants[i].value; @@ -101,7 +101,7 @@ int crypt_get_constant(const char* namein, int *valueout) { int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { int i; unsigned long total_len = 0; - char number[10]; + char number[32]; int number_len; int count = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); @@ -109,8 +109,11 @@ int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { for (i=0; i= sizeof(number))) + return -1; + total_len += number_len + 1; /* this last +1 is for newlines (and ending NULL) */ } @@ -128,7 +131,7 @@ int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { strcpy(ptr, ","); ptr += 1; - number_len = sprintf(number,"%lu",_crypt_constants[i].value); + number_len = snprintf(number, sizeof(number), "%ld", _crypt_constants[i].value); strcpy(ptr, number); ptr += number_len; strcpy(ptr, "\n"); diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 514943774..ceaf0fa98 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -236,7 +236,7 @@ crypt_size _crypt_sizes[] = { */ int crypt_get_size(const char* namein, int *sizeout) { int i; - int count = sizeof(_crypt_sizes) / sizeof(crypt_size); + int count = sizeof(_crypt_sizes) / sizeof(_crypt_sizes[0]); for (i=0; i= sizeof(number))) + return -1; total_len += strlen(number) + 1; /* this last +1 is for newlines (and ending NULL) */ } @@ -286,7 +289,7 @@ int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size) { strcpy(ptr, ","); ptr += 1; - number_len = sprintf(number,"%lu",_crypt_sizes[i].size); + number_len = snprintf(number, sizeof(number), "%ld", _crypt_sizes[i].size); strcpy(ptr, number); ptr += number_len; strcpy(ptr, "\n"); From fc7eeac2189e34b0ca48a80b5872cb13b1c6303f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:27:31 +0200 Subject: [PATCH 0228/1192] update/rework constants and sizes --- src/misc/crypt/crypt_constants.c | 107 ++++++++++++++++++++--- src/misc/crypt/crypt_sizes.c | 141 ++++++++++++++++--------------- 2 files changed, 166 insertions(+), 82 deletions(-) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 065a83281..adb683677 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -25,25 +25,100 @@ typedef struct { const long value; } crypt_constant; -crypt_constant _crypt_constants[] = { - {"PK_PUBLIC", PK_PUBLIC}, - {"PK_PRIVATE", PK_PRIVATE}, +#define _C_STRINGIFY(s) { #s, s } -#ifdef LTC_CTR_MODE - {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, - {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, - {"LTC_CTR_RFC3686", LTC_CTR_RFC3686}, +static const crypt_constant _crypt_constants[] = { + _C_STRINGIFY(PK_PUBLIC), + _C_STRINGIFY(PK_PRIVATE), + + _C_STRINGIFY(PKA_RSA), + _C_STRINGIFY(PKA_DSA), + +#ifdef LTC_PKCS_1 + {"LTC_PKCS_1", 1}, + /* Block types */ + _C_STRINGIFY(LTC_PKCS_1_EMSA), + _C_STRINGIFY(LTC_PKCS_1_EME), + + /* Padding types */ + _C_STRINGIFY(LTC_PKCS_1_V1_5), + _C_STRINGIFY(LTC_PKCS_1_OAEP), + _C_STRINGIFY(LTC_PKCS_1_PSS), +#else + {"LTC_PKCS_1", 0}, #endif #ifdef LTC_MRSA - {"MIN_RSA_SIZE", MIN_RSA_SIZE}, - {"MAX_RSA_SIZE", MAX_RSA_SIZE}, + {"LTC_MRSA", 1}, + _C_STRINGIFY(MIN_RSA_SIZE), + _C_STRINGIFY(MAX_RSA_SIZE), +#else + {"LTC_MRSA", 0}, #endif -#ifdef LTC_PKCS_1 - {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, - {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, - {"LTC_PKCS_1_V1_5", LTC_PKCS_1_V1_5}, +#ifdef MKAT + {"MKAT", 1}, + _C_STRINGIFY(MIN_KAT_SIZE), + _C_STRINGIFY(MAX_KAT_SIZE), +#else + {"MKAT", 0}, +#endif + +#ifdef LTC_MECC + {"LTC_MECC", 1}, + _C_STRINGIFY(ECC_BUF_SIZE), + _C_STRINGIFY(ECC_MAXSIZE), +#else + {"LTC_MECC", 0}, +#endif + +#ifdef LTC_MDSA + {"LTC_MDSA", 1}, + _C_STRINGIFY(LTC_MDSA_DELTA), + _C_STRINGIFY(LTC_MDSA_MAX_GROUP), +#else + {"LTC_MDSA", 0}, +#endif + +#ifdef LTC_CTR_MODE + {"LTC_CTR_MODE", 1}, + _C_STRINGIFY(CTR_COUNTER_LITTLE_ENDIAN), + _C_STRINGIFY(CTR_COUNTER_BIG_ENDIAN), + _C_STRINGIFY(LTC_CTR_RFC3686), +#else + {"LTC_CTR_MODE", 0}, +#endif + + _C_STRINGIFY(MAXBLOCKSIZE), + _C_STRINGIFY(TAB_SIZE), + _C_STRINGIFY(ARGTYPE), + +#ifdef LTM_DESC + {"LTM_DESC", 1}, +#else + {"LTM_DESC", 0}, +#endif +#ifdef TFM_DESC + {"TFM_DESC", 1}, +#else + {"TFM_DESC", 0}, +#endif +#ifdef GMP_DESC + {"GMP_DESC", 1}, +#else + {"GMP_DESC", 0}, +#endif + +#ifdef LTC_FAST + {"LTC_FAST", 1}, +#else + {"LTC_FAST", 0}, +#endif + +#ifdef LTC_NO_FILE + {"LTC_NO_FILE", 1}, +#else + {"LTC_NO_FILE", 0}, #endif #ifdef ENDIAN_LITTLE @@ -69,6 +144,12 @@ crypt_constant _crypt_constants[] = { #else {"ENDIAN_64BITWORD", 0}, #endif + +#ifdef ENDIAN_NEUTRAL + {"ENDIAN_NEUTRAL", 1}, +#else + {"ENDIAN_NEUTRAL", 0}, +#endif }; diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index ceaf0fa98..d7b1cb84f 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -25,165 +25,168 @@ typedef struct { const long size; } crypt_size; -crypt_size _crypt_sizes[] = { +#define _SZ_STRINGIFY_S(s) { #s, sizeof(struct s) } +#define _SZ_STRINGIFY_T(s) { #s, sizeof(s) } + +static const crypt_size _crypt_sizes[] = { // hash state sizes - {"hash_descriptor_struct_size", sizeof(struct ltc_hash_descriptor)}, - {"hash_state_union_size", sizeof(hash_state)}, + _SZ_STRINGIFY_S(ltc_hash_descriptor), + _SZ_STRINGIFY_T(hash_state), #ifdef LTC_SHA256 - {"sha256_state_struct_size", sizeof(struct sha256_state)}, + _SZ_STRINGIFY_S(sha256_state), #endif #ifdef LTC_SHA512 - {"sha512_state_struct_size", sizeof(struct sha512_state)}, + _SZ_STRINGIFY_S(sha512_state), #endif #ifdef LTC_WHIRLPOOL - {"whirlpool_state_struct_size", sizeof(struct whirlpool_state)}, + _SZ_STRINGIFY_S(whirlpool_state), #endif #ifdef LTC_MD2 - {"md2_state_struct_size", sizeof(struct md2_state)}, + _SZ_STRINGIFY_S(md2_state), #endif #ifdef LTC_MD4 - {"md4_state_struct_size", sizeof(struct md4_state)}, + _SZ_STRINGIFY_S(md4_state), #endif #ifdef LTC_MD5 - {"md5_state_struct_size", sizeof(struct md5_state)}, + _SZ_STRINGIFY_S(md5_state), #endif #ifdef LTC_RIPEMD128 - {"rmd128_state_struct_size", sizeof(struct rmd128_state)}, + _SZ_STRINGIFY_S(rmd128_state), #endif #ifdef LTC_RIPEMD160 - {"rmd160_state_struct_size", sizeof(struct rmd160_state)}, + _SZ_STRINGIFY_S(rmd160_state), #endif #ifdef LTC_RIPEMD256 - {"rmd256_state_struct_size", sizeof(struct rmd256_state)}, + _SZ_STRINGIFY_S(rmd256_state), #endif #ifdef LTC_RIPEMD320 - {"rmd320_state_struct_size", sizeof(struct rmd320_state)}, + _SZ_STRINGIFY_S(rmd320_state), #endif #ifdef LTC_SHA1 - {"sha1_state_struct_size", sizeof(struct sha1_state)}, + _SZ_STRINGIFY_S(sha1_state), #endif #ifdef LTC_TIGER - {"tiger_state_struct_size", sizeof(struct tiger_state)}, + _SZ_STRINGIFY_S(tiger_state), #endif #ifdef LTC_CHC_HASH - {"chc_state_struct_size", sizeof(struct chc_state)}, + _SZ_STRINGIFY_S(chc_state), #endif // block cipher key sizes - {"cipher_descriptor_struct_size", sizeof(struct ltc_cipher_descriptor)}, - {"symmetric_key_union_size", sizeof(symmetric_key)}, + _SZ_STRINGIFY_S(ltc_cipher_descriptor), + _SZ_STRINGIFY_T(symmetric_key), #ifdef LTC_ANUBIS - {"anubis_key_struct_size", sizeof(struct anubis_key)}, + _SZ_STRINGIFY_S(anubis_key), #endif #ifdef LTC_CAMELLIA - {"camellia_key_struct_size", sizeof(struct camellia_key)}, + _SZ_STRINGIFY_S(camellia_key), #endif #ifdef LTC_BLOWFISH - {"blowfish_key_struct_size", sizeof(struct blowfish_key)}, + _SZ_STRINGIFY_S(blowfish_key), #endif #ifdef LTC_CAST5 - {"cast5_key_struct_size", sizeof(struct cast5_key)}, + _SZ_STRINGIFY_S(cast5_key), #endif #ifdef LTC_DES - {"des_key_struct_size", sizeof(struct des_key)}, - {"des3_key_struct_size", sizeof(struct des3_key)}, + _SZ_STRINGIFY_S(des_key), + _SZ_STRINGIFY_S(des3_key), #endif #ifdef LTC_KASUMI - {"kasumi_key_struct_size", sizeof(struct kasumi_key)}, + _SZ_STRINGIFY_S(kasumi_key), #endif #ifdef LTC_KHAZAD - {"khazad_key_struct_size", sizeof(struct khazad_key)}, + _SZ_STRINGIFY_S(khazad_key), #endif #ifdef LTC_KSEED - {"kseed_key_struct_size", sizeof(struct kseed_key)}, + _SZ_STRINGIFY_S(kseed_key), #endif #ifdef LTC_MULTI2 -// {"multi2_key_struct_size", sizeof(struct multi2_key)}, + _SZ_STRINGIFY_S(multi2_key), #endif #ifdef LTC_NOEKEON - {"noekeon_key_struct_size", sizeof(struct noekeon_key)}, + _SZ_STRINGIFY_S(noekeon_key), #endif #ifdef LTC_RC2 - {"rc2_key_struct_size", sizeof(struct rc2_key)}, + _SZ_STRINGIFY_S(rc2_key), #endif #ifdef LTC_RC5 - {"rc5_key_struct_size", sizeof(struct rc5_key)}, + _SZ_STRINGIFY_S(rc5_key), #endif #ifdef LTC_RC6 - {"rc6_key_struct_size", sizeof(struct rc6_key)}, + _SZ_STRINGIFY_S(rc6_key), #endif #ifdef LTC_SKIPJACK - {"skipjack_key_struct_size", sizeof(struct skipjack_key)}, + _SZ_STRINGIFY_S(skipjack_key), #endif #ifdef LTC_XTEA - {"xtea_key_struct_size", sizeof(struct xtea_key)}, + _SZ_STRINGIFY_S(xtea_key), #endif #ifdef LTC_RIJNDAEL - {"rijndael_key_struct_size", sizeof(struct rijndael_key)}, + _SZ_STRINGIFY_S(rijndael_key), #endif #ifdef LTC_SAFER - {"safer_key_struct_size", sizeof(struct safer_key)}, + _SZ_STRINGIFY_S(safer_key), #endif #ifdef LTC_SAFERP - {"saferp_key_struct_size", sizeof(struct saferp_key)}, + _SZ_STRINGIFY_S(saferp_key), #endif #ifdef LTC_TWOFISH - {"twofish_key_struct_size", sizeof(struct twofish_key)}, + _SZ_STRINGIFY_S(twofish_key), #endif // mode sizes #ifdef LTC_CBC_MODE - {"symmetric_CBC_struct_size", sizeof(symmetric_CBC)}, + _SZ_STRINGIFY_T(symmetric_CBC), #endif #ifdef LTC_CFB_MODE - {"symmetric_CFB_struct_size", sizeof(symmetric_CFB)}, + _SZ_STRINGIFY_T(symmetric_CFB), #endif #ifdef LTC_CTR_MODE - {"symmetric_CTR_struct_size", sizeof(symmetric_CTR)}, + _SZ_STRINGIFY_T(symmetric_CTR), #endif #ifdef LTC_ECB_MODE - {"symmetric_ECB_struct_size", sizeof(symmetric_ECB)}, + _SZ_STRINGIFY_T(symmetric_ECB), #endif #ifdef LTC_F8_MODE - {"symmetric_F8_struct_size", sizeof(symmetric_F8)}, + _SZ_STRINGIFY_T(symmetric_F8), #endif #ifdef LTC_LRW_MODE - {"symmetric_LRW_struct_size", sizeof(symmetric_LRW)}, + _SZ_STRINGIFY_T(symmetric_LRW), #endif #ifdef LTC_OFB_MODE - {"symmetric_OFB_struct_size", sizeof(symmetric_OFB)}, + _SZ_STRINGIFY_T(symmetric_OFB), #endif // MAC sizes -- no states for ccm, lrw #ifdef LTC_F9_MODE - {"f9_state_struct_size", sizeof(f9_state)}, + _SZ_STRINGIFY_T(f9_state), #endif #ifdef LTC_HMAC - {"hmac_state_struct_size", sizeof(hmac_state)}, + _SZ_STRINGIFY_T(hmac_state), #endif #ifdef LTC_OMAC - {"omac_state_struct_size", sizeof(omac_state)}, + _SZ_STRINGIFY_T(omac_state), #endif #ifdef LTC_PELICAN - {"pelican_state_struct_size", sizeof(pelican_state)}, + _SZ_STRINGIFY_T(pelican_state), #endif #ifdef LTC_PMAC - {"pmac_state_struct_size", sizeof(pmac_state)}, + _SZ_STRINGIFY_T(pmac_state), #endif #ifdef LTC_XCBC - {"xcbc_state_struct_size", sizeof(xcbc_state)}, + _SZ_STRINGIFY_T(xcbc_state), #endif #ifdef LTC_OCB_MODE - {"ocb_state_struct_size", sizeof(ocb_state)}, + _SZ_STRINGIFY_T(ocb_state), #endif #ifdef LTC_OCB3_MODE - {"ocb3_state_struct_size", sizeof(ocb3_state)}, + _SZ_STRINGIFY_T(ocb3_state), #endif #ifdef LTC_GCM_MODE - {"gcm_state_struct_size", sizeof(gcm_state)}, + _SZ_STRINGIFY_T(gcm_state), #endif #ifdef LTC_EAX_MODE - {"eax_state_struct_size", sizeof(eax_state)}, + _SZ_STRINGIFY_T(eax_state), #endif #ifdef LTC_CCM_MODE // not defined @@ -194,37 +197,37 @@ crypt_size _crypt_sizes[] = { // asymmetric keys #ifdef LTC_MRSA - {"rsa_key_struct_size", sizeof(rsa_key)}, + _SZ_STRINGIFY_T(rsa_key), #endif #ifdef LTC_MDSA - {"dsa_key_struct_size", sizeof(dsa_key)}, + _SZ_STRINGIFY_T(dsa_key), #endif -#ifdef MDH - {"dh_key_struct_size", sizeof(dh_key)}, +#ifdef LTC_MDH + _SZ_STRINGIFY_T(dh_key), #endif #ifdef LTC_MECC - {"ecc_set_struct_size", sizeof(ltc_ecc_set_type)}, - {"ecc_key_struct_size", sizeof(ecc_key)}, - {"ecc_point_struct_size", sizeof(ecc_point)}, + _SZ_STRINGIFY_T(ltc_ecc_set_type), + _SZ_STRINGIFY_T(ecc_key), + _SZ_STRINGIFY_T(ecc_point), #endif #ifdef MKAT -// {"katja_key_struct_size", sizeof(katja_key)}, + _SZ_STRINGIFY_T(katja_key), #endif // prng state sizes - {"prng_descriptor_struct_size", sizeof(struct ltc_prng_descriptor)}, - {"prng_state_union_size", sizeof(prng_state)}, + _SZ_STRINGIFY_S(ltc_prng_descriptor), + _SZ_STRINGIFY_T(prng_state), #ifdef LTC_FORTUNA - {"fortuna_prng_struct_size", sizeof(struct fortuna_prng)}, + _SZ_STRINGIFY_S(fortuna_prng), #endif #ifdef LTC_RC4 - {"rc4_prng_struct_size", sizeof(struct rc4_prng)}, + _SZ_STRINGIFY_S(rc4_prng), #endif #ifdef LTC_SOBER128 - {"sober128_prng_struct_size", sizeof(struct sober128_prng)}, + _SZ_STRINGIFY_S(sober128_prng), #endif #ifdef LTC_YARROW - {"yarrow_prng_struct_size", sizeof(struct yarrow_prng)}, + _SZ_STRINGIFY_S(yarrow_prng), #endif // sprng has no state as it uses other potentially available sources // like /dev/random. See Developers Guide for more info. From 746fd583c9c0ea29720681076585e476e1ceda0c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:28:29 +0200 Subject: [PATCH 0229/1192] update demos according to changed naming --- demos/demo_crypt_sizes.c | 2 +- demos/demo_dynamic.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 demos/demo_dynamic.py diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index dcd8bb0d8..ea1cef172 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -22,7 +22,7 @@ int main(void) { int rc; // given a specific size name, get and print its size - char name[] = "ecc_key_struct_size"; + char name[] = "ecc_key"; int size; rc = crypt_get_size(name, &size); printf("\n size of '%s' is %d \n\n", name, size); diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py old mode 100644 new mode 100755 index 275a6e878..81f6f8b75 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -126,13 +126,13 @@ print '\n selected sizes:' names = [ - 'rijndael_key_struct_size', - 'rsa_key_struct_size', - 'symmetric_CTR_struct_size', - 'twofish_key_struct_size', - 'ecc_point_struct_size', - 'gcm_state_struct_size', - 'sha512_state_struct_size', + 'rijndael_key', + 'rsa_key', + 'symmetric_CTR', + 'twofish_key', + 'ecc_point', + 'gcm_state', + 'sha512_state', ] for name in names: size_value = c_int(0) @@ -171,8 +171,8 @@ def _get_size(name): rc = LTC.crypt_get_size(name, byref(size)) return size.value -sha256_state_struct_size = _get_size('sha256_state_struct_size') -sha512_state_struct_size = _get_size('sha512_state_struct_size') +sha256_state_struct_size = _get_size('sha256_state') +sha512_state_struct_size = _get_size('sha512_state') class SHA256(object): def __init__(self): From 542ba9995c3fdffc89b6cd4a90d25f3f9abf9ece Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:38:18 +0200 Subject: [PATCH 0230/1192] update math inititializers make math initializer functions dependant on the xxx_DESC macro instead of the USE_xxx macro, which is only relevant when building tests etc. --- src/headers/tomcrypt_misc.h | 9 +++++++++ src/misc/crypt/crypt_inits.c | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 18d8b6da7..503447c38 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -56,8 +56,17 @@ int crypt_list_all_constants(char *names_list, unsigned long *names_list_size); int crypt_get_size(const char* namein, int *sizeout); int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size); +#ifdef LTM_DESC void init_LTM(void); +#endif +#ifdef TFM_DESC void init_TFM(void); +#endif +/* *** use of GMP is untested *** +#ifdef GMP_DESC +void init_GMP(void); +#endif +*/ /* $Source$ */ diff --git a/src/misc/crypt/crypt_inits.c b/src/misc/crypt/crypt_inits.c index 5428cc367..cc92f52fb 100755 --- a/src/misc/crypt/crypt_inits.c +++ b/src/misc/crypt/crypt_inits.c @@ -12,33 +12,33 @@ /** @file crypt_inits.c - - Provide math library functions for dynamic languages + + Provide math library functions for dynamic languages like Python - Larry Bugbee, February 2013 */ -#ifdef USE_LTM +#ifdef LTM_DESC void init_LTM(void) { ltc_mp = ltm_desc; } #endif -#ifdef USE_TFM +#ifdef TFM_DESC void init_TFM(void) { ltc_mp = tfm_desc; } #endif /* *** use of GMP is untested *** - #ifdef USE_GMP - void init_GMP(void) { - ltc_mp = gmp_desc; - } - #endif +#ifdef GMP_DESC +void init_GMP(void) { + ltc_mp = gmp_desc; +} +#endif */ -/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_inits.c,v $ */ -/* $Revision: $ */ -/* $Date: $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From 5fa34ad1714718bf2f8f478e8c9107b998149dd5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:45:33 +0200 Subject: [PATCH 0231/1192] update makefiles --- makefile | 34 ++++++++++++++++++---------------- makefile.icc | 34 ++++++++++++++++++---------------- makefile.mingw | 34 ++++++++++++++++++---------------- makefile.msvc | 34 ++++++++++++++++++---------------- makefile.shared | 34 ++++++++++++++++++---------------- makefile.unix | 34 ++++++++++++++++++---------------- 6 files changed, 108 insertions(+), 96 deletions(-) diff --git a/makefile b/makefile index 2ff2d8223..dea1ea2e3 100644 --- a/makefile +++ b/makefile @@ -159,24 +159,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.icc b/makefile.icc index f18d1d5b0..6d5a4d27a 100644 --- a/makefile.icc +++ b/makefile.icc @@ -142,24 +142,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.mingw b/makefile.mingw index bae91a5aa..888fac269 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -89,24 +89,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.msvc b/makefile.msvc index 13e25ebc0..afb1ad675 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -47,24 +47,26 @@ src/mac/xcbc/xcbc_test.obj src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.o src/math/multi.obj src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj \ src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj \ src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj \ -src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_find_cipher_any.obj \ -src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_id.obj \ -src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash.obj \ -src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ -src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ -src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ +src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_constants.obj \ +src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher.obj \ +src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash_any.obj \ +src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_id.obj \ +src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ +src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ +src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ -src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_unregister_cipher.obj \ -src/misc/crypt/crypt_unregister_hash.obj src/misc/crypt/crypt_unregister_prng.obj \ -src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj src/misc/hkdf/hkdf_test.obj src/misc/pkcs5/pkcs_5_1.obj \ -src/misc/pkcs5/pkcs_5_2.obj src/misc/pkcs5/pkcs_5_test.obj src/misc/pk_get_oid.obj src/misc/zeromem.obj \ -src/modes/cbc/cbc_decrypt.obj src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj \ -src/modes/cbc/cbc_getiv.obj src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj \ -src/modes/cfb/cfb_decrypt.obj src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj \ -src/modes/cfb/cfb_getiv.obj src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj \ -src/modes/ctr/ctr_decrypt.obj src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj \ -src/modes/ctr/ctr_getiv.obj src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \ +src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ +src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ +src/misc/hkdf/hkdf_test.obj src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj \ +src/misc/pkcs5/pkcs_5_test.obj src/misc/pk_get_oid.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \ +src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj \ +src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj \ +src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj \ +src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj src/modes/ctr/ctr_decrypt.obj \ +src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj src/modes/ctr/ctr_getiv.obj \ +src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \ src/modes/ecb/ecb_decrypt.obj src/modes/ecb/ecb_done.obj src/modes/ecb/ecb_encrypt.obj \ src/modes/ecb/ecb_start.obj src/modes/f8/f8_decrypt.obj src/modes/f8/f8_done.obj src/modes/f8/f8_encrypt.obj \ src/modes/f8/f8_getiv.obj src/modes/f8/f8_setiv.obj src/modes/f8/f8_start.obj src/modes/f8/f8_test_mode.obj \ diff --git a/makefile.shared b/makefile.shared index d658e0849..3aa78b40e 100644 --- a/makefile.shared +++ b/makefile.shared @@ -141,24 +141,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.unix b/makefile.unix index eb2f38c5d..9e2a64501 100644 --- a/makefile.unix +++ b/makefile.unix @@ -83,24 +83,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ From 7189998ba1282a003d79b3ab89adc3177ad642c6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:45:39 +0200 Subject: [PATCH 0232/1192] update gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 8f8f6d168..fe67ca53d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,10 +14,14 @@ tv.txt *_tv.txt # *nix/windows test executables +constants +constants.exe encrypt encrypt.exe hashsum hashsum.exe +sizes +sizes.exe small small.exe test From f8c536a349b260d62e1d5967531ae3b44a62580a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 20:25:32 +0200 Subject: [PATCH 0233/1192] add CC tag when linking --- makefile.shared | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/makefile.shared b/makefile.shared index 3aa78b40e..18fe826c7 100644 --- a/makefile.shared +++ b/makefile.shared @@ -265,7 +265,7 @@ testprof/$(LIBTEST): $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< $(LIBNAME): $(OBJECTS) - $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) install: $(LIBNAME) install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) @@ -283,23 +283,23 @@ install_test: testprof/$(LIBTEST) #This rule makes the hash program included with libtomcrypt hashsum: library $(HASHOBJECTS) - $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(HASH) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(HASH) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) #makes the crypt program crypt: library $(CRYPTOBJECTS) - $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(CRYPT) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(CRYPT) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) small: library $(SMALLOBJECTS) - $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(SMALL) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(SMALL) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) tv_gen: library $(TVS) - $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TV) $(TVS) $(LIBNAME) $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TV) $(TVS) $(LIBNAME) $(EXTRALIBS) test: library testprof/$(LIBTEST) $(TESTS) - $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) timing: library testprof/$(LIBTEST) $(TIMINGS) - $(LT) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) # $Source$ # $Revision$ From 97256daeed930002d3ebe52709108bd6a2504dc3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 20:26:40 +0200 Subject: [PATCH 0234/1192] remove surplus ';' --- src/headers/tomcrypt_math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 7e6e79887..f4f397a3a 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -521,7 +521,7 @@ extern const ltc_math_descriptor gmp_desc; #define mp_iszero(a) (mp_cmp_d(a, 0) == LTC_MP_EQ ? LTC_MP_YES : LTC_MP_NO) #define mp_isodd(a) (mp_get_digit_count(a) > 0 ? (mp_get_digit(a, 0) & 1 ? LTC_MP_YES : LTC_MP_NO) : LTC_MP_NO) -#define mp_exch(a, b) do { void *ABC__tmp = a; a = b; b = ABC__tmp; } while(0); +#define mp_exch(a, b) do { void *ABC__tmp = a; a = b; b = ABC__tmp; } while(0) #define mp_tohex(a, b) mp_toradix(a, b, 16) From 1a61b4277540bef5b0175d98a8f7253bc15c8f42 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 16 Jul 2014 15:11:14 +0200 Subject: [PATCH 0235/1192] update output; remove unused define --- src/misc/crypt/crypt.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 769f222b0..f7b83d193 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -184,12 +184,8 @@ const char *crypt_build_settings = " CBC\n" #endif #if defined(LTC_CTR_MODE) - " CTR " + " CTR\n" #endif -#if defined(LTC_CTR_OLD) - " (CTR_OLD) " -#endif - "\n" #if defined(LTC_LRW_MODE) " LRW" #if defined(LRW_TABLES) @@ -291,7 +287,9 @@ const char *crypt_build_settings = #endif "\nCompiler:\n" -#if defined(WIN32) +#if defined(_WIN64) + " WIN64 platform detected.\n" +#elif defined(_WIN32) " WIN32 platform detected.\n" #endif #if defined(__CYGWIN__) @@ -315,7 +313,7 @@ const char *crypt_build_settings = " x86-64 detected.\n" #endif #if defined(LTC_PPC32) - " PPC32 defined \n" + " PPC32 detected.\n" #endif "\nVarious others: " @@ -379,15 +377,15 @@ const char *crypt_build_settings = #if defined(TFM_DESC) " TFM_DESC " #endif -#if defined(LTC_MECC_ACCEL) - " LTC_MECC_ACCEL " -#endif #if defined(GMP_DESC) " GMP_DESC " #endif #if defined(LTC_EASY) " LTC_EASY " #endif +#if defined(LTC_MECC_ACCEL) + " LTC_MECC_ACCEL " +#endif #if defined(LTC_MECC_FP) " LTC_MECC_FP " #endif From 3c76dcdd294e975e9ef38a135abe9d5cdc6c11d0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 16 Jul 2014 15:14:43 +0200 Subject: [PATCH 0236/1192] fix compiler warning when enabling LTC_GCM_TABLES_SSE2 --- src/encauth/gcm/gcm_mult_h.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/encauth/gcm/gcm_mult_h.c b/src/encauth/gcm/gcm_mult_h.c index 871cd519f..c3bff572c 100644 --- a/src/encauth/gcm/gcm_mult_h.c +++ b/src/encauth/gcm/gcm_mult_h.c @@ -25,7 +25,7 @@ void gcm_mult_h(gcm_state *gcm, unsigned char *I) { unsigned char T[16]; #ifdef LTC_GCM_TABLES - int x, y; + int x; #ifdef LTC_GCM_TABLES_SSE2 asm("movdqa (%0),%%xmm0"::"r"(&gcm->PC[0][I[0]][0])); for (x = 1; x < 16; x++) { @@ -33,6 +33,7 @@ void gcm_mult_h(gcm_state *gcm, unsigned char *I) } asm("movdqa %%xmm0,(%0)"::"r"(&T)); #else + int y; XMEMCPY(T, &gcm->PC[0][I[0]][0], 16); for (x = 1; x < 16; x++) { #ifdef LTC_FAST From 155a54ba40f65d3f4e4bcfb5cb93478f7b21eba5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 17 Jul 2014 10:49:05 +0200 Subject: [PATCH 0237/1192] add LTC prefix to most macros --- src/encauth/gcm/gcm_gf_mult.c | 2 +- src/headers/tomcrypt_cipher.h | 2 +- src/headers/tomcrypt_custom.h | 50 ++++++++++++++++---------------- src/headers/tomcrypt_mac.h | 2 +- src/headers/tomcrypt_pk.h | 2 +- src/math/multi.c | 2 +- src/misc/crypt/crypt.c | 8 ++--- src/misc/crypt/crypt_constants.c | 6 ++-- src/misc/crypt/crypt_sizes.c | 2 +- src/modes/lrw/lrw_process.c | 4 +-- src/modes/lrw/lrw_setiv.c | 4 +-- src/modes/lrw/lrw_start.c | 4 +-- src/pk/dh/dh_static.c | 18 ++++++------ src/pk/ecc/ecc.c | 18 ++++++------ src/pk/katja/katja_decrypt_key.c | 2 +- src/pk/katja/katja_encrypt_key.c | 2 +- src/pk/katja/katja_export.c | 2 +- src/pk/katja/katja_exptmod.c | 2 +- src/pk/katja/katja_free.c | 2 +- src/pk/katja/katja_import.c | 2 +- src/pk/katja/katja_make_key.c | 2 +- src/prngs/rng_get_bytes.c | 4 +-- testprof/katja_test.c | 2 +- testprof/x86_prof.c | 4 +-- 24 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/encauth/gcm/gcm_gf_mult.c b/src/encauth/gcm/gcm_gf_mult.c index 72e06244d..37d8a57a4 100644 --- a/src/encauth/gcm/gcm_gf_mult.c +++ b/src/encauth/gcm/gcm_gf_mult.c @@ -15,7 +15,7 @@ */ #include "tomcrypt.h" -#if defined(LTC_GCM_TABLES) || defined(LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST)) +#if defined(LTC_GCM_TABLES) || defined(LTC_LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST)) /* this is x*2^128 mod p(x) ... the results are 16 bytes each stored in a packed format. Since only the * lower 16 bits are not zero'ed I removed the upper 14 bytes */ diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index f19ec866b..a7142a0e0 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -310,7 +310,7 @@ typedef struct { /** The scheduled symmetric key */ symmetric_key key; -#ifdef LRW_TABLES +#ifdef LTC_LRW_TABLES /** The pre-computed multiplication table */ unsigned char PC[16][256][16]; #endif diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 0494202ab..025fb8101 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -108,7 +108,7 @@ #define LTC_SPRNG #define LTC_YARROW #define LTC_DEVRANDOM - #define TRY_URANDOM_FIRST + #define LTC_TRY_URANDOM_FIRST #define LTC_NO_PK #define LTC_MRSA @@ -212,7 +212,7 @@ /* like GCM mode this will enable 16 8x128 tables [64KB] that make * seeking very fast. */ - #define LRW_TABLES + #define LTC_LRW_TABLES #endif /* XTS mode */ @@ -304,7 +304,7 @@ /* the *nix style /dev/random device */ #define LTC_DEVRANDOM /* try /dev/urandom before trying /dev/random */ -#define TRY_URANDOM_FIRST +#define LTC_TRY_URANDOM_FIRST #endif /* LTC_NO_PRNGS */ @@ -324,23 +324,23 @@ /* is_prime fails for GMP */ #define LTC_MDH /* Supported Key Sizes */ -#define DH768 -#define DH1024 -#define DH1280 -#define DH1536 -#define DH1792 -#define DH2048 +#define LTC_DH768 +#define LTC_DH1024 +#define LTC_DH1280 +#define LTC_DH1536 +#define LTC_DH1792 +#define LTC_DH2048 #ifndef TFM_DESC /* tfm has a problem in fp_isprime for larger key sizes */ -#define DH2560 -#define DH3072 -#define DH4096 +#define LTC_DH2560 +#define LTC_DH3072 +#define LTC_DH4096 #endif #endif /* Include Katja (a Rabin variant like RSA) */ -/* #define MKAT */ +/* #define LTC_MKAT */ /* Digital Signature Algorithm */ #define LTC_MDSA @@ -398,20 +398,20 @@ #ifdef LTC_MECC /* Supported ECC Key Sizes */ #ifndef LTC_NO_CURVES - #define ECC112 - #define ECC128 - #define ECC160 - #define ECC192 - #define ECC224 - #define ECC256 - #define ECC384 - #define ECC521 + #define LTC_ECC112 + #define LTC_ECC128 + #define LTC_ECC160 + #define LTC_ECC192 + #define LTC_ECC224 + #define LTC_ECC256 + #define LTC_ECC384 + #define LTC_ECC521 #endif #endif -#if defined(LTC_MECC) || defined(LTC_MRSA) || defined(LTC_MDSA) || defined(MKATJA) +#if defined(LTC_MECC) || defined(LTC_MRSA) || defined(LTC_MDSA) || defined(LTC_MKAT) /* Include the MPI functionality? (required by the PK algorithms) */ - #define MPI + #define LTC_MPI #endif #ifdef LTC_MRSA @@ -435,11 +435,11 @@ #error LTC_YARROW requires LTC_CTR_MODE chaining mode to be defined! #endif -#if defined(LTC_DER) && !defined(MPI) +#if defined(LTC_DER) && !defined(LTC_MPI) #error ASN.1 DER requires MPI functionality #endif -#if (defined(LTC_MDSA) || defined(LTC_MRSA) || defined(LTC_MECC) || defined(MKATJA)) && !defined(LTC_DER) +#if (defined(LTC_MDSA) || defined(LTC_MRSA) || defined(LTC_MECC) || defined(LTC_MKAT)) && !defined(LTC_DER) #error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled #endif diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 7ec662a0e..5d71af61d 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -292,7 +292,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * /* table shared between GCM and LRW */ -#if defined(LTC_GCM_TABLES) || defined(LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST)) +#if defined(LTC_GCM_TABLES) || defined(LTC_LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST)) extern const unsigned char gcm_shift_table[]; #endif diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 2a8987b98..ef0a5f9ff 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -111,7 +111,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); #endif /* ---- Katja ---- */ -#ifdef MKAT +#ifdef LTC_MKAT /* Min and Max KAT key sizes (in bits) */ #define MIN_KAT_SIZE 1024 diff --git a/src/math/multi.c b/src/math/multi.c index 6c6537cae..f85e90030 100644 --- a/src/math/multi.c +++ b/src/math/multi.c @@ -10,7 +10,7 @@ */ #include "tomcrypt.h" -#ifdef MPI +#ifdef LTC_MPI #include int ltc_init_multi(void **a, ...) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index f7b83d193..a5fbbca9c 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -188,7 +188,7 @@ const char *crypt_build_settings = #endif #if defined(LTC_LRW_MODE) " LRW" -#if defined(LRW_TABLES) +#if defined(LTC_LRW_TABLES) " (tables) " #endif "\n" @@ -282,7 +282,7 @@ const char *crypt_build_settings = #if defined(LTC_MDSA) " DSA\n" #endif -#if defined(MKAT) +#if defined(LTC_MKAT) " Katja\n" #endif @@ -338,8 +338,8 @@ const char *crypt_build_settings = #if defined(MPI) " MPI " #endif -#if defined(TRY_URANDOM_FIRST) - " TRY_URANDOM_FIRST " +#if defined(LTC_TRY_URANDOM_FIRST) + " LTC_TRY_URANDOM_FIRST " #endif #if defined(LTC_TEST) " LTC_TEST " diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index adb683677..b0af4ddb3 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -56,12 +56,12 @@ static const crypt_constant _crypt_constants[] = { {"LTC_MRSA", 0}, #endif -#ifdef MKAT - {"MKAT", 1}, +#ifdef LTC_MKAT + {"LTC_MKAT", 1}, _C_STRINGIFY(MIN_KAT_SIZE), _C_STRINGIFY(MAX_KAT_SIZE), #else - {"MKAT", 0}, + {"LTC_MKAT", 0}, #endif #ifdef LTC_MECC diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index d7b1cb84f..c758dbe1a 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -210,7 +210,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(ecc_key), _SZ_STRINGIFY_T(ecc_point), #endif -#ifdef MKAT +#ifdef LTC_MKAT _SZ_STRINGIFY_T(katja_key), #endif diff --git a/src/modes/lrw/lrw_process.c b/src/modes/lrw/lrw_process.c index e7b567bad..8a4fd1a77 100644 --- a/src/modes/lrw/lrw_process.c +++ b/src/modes/lrw/lrw_process.c @@ -30,7 +30,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i { unsigned char prod[16]; int x, err; -#ifdef LRW_TABLES +#ifdef LTC_LRW_TABLES int y; #endif @@ -55,7 +55,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i } /* update pad */ -#ifdef LRW_TABLES +#ifdef LTC_LRW_TABLES /* for each byte changed we undo it's affect on the pad then add the new product */ for (; x < 16; x++) { #ifdef LTC_FAST diff --git a/src/modes/lrw/lrw_setiv.c b/src/modes/lrw/lrw_setiv.c index 8a2ff9a6f..d2e21d368 100644 --- a/src/modes/lrw/lrw_setiv.c +++ b/src/modes/lrw/lrw_setiv.c @@ -27,7 +27,7 @@ int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw) { int err; -#ifdef LRW_TABLES +#ifdef LTC_LRW_TABLES unsigned char T[16]; int x, y; #endif @@ -51,7 +51,7 @@ int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw) return CRYPT_OK; } -#ifdef LRW_TABLES +#ifdef LTC_LRW_TABLES XMEMCPY(T, &lrw->PC[0][IV[0]][0], 16); for (x = 1; x < 16; x++) { #ifdef LTC_FAST diff --git a/src/modes/lrw/lrw_start.c b/src/modes/lrw/lrw_start.c index f378789a4..bf9b27565 100644 --- a/src/modes/lrw/lrw_start.c +++ b/src/modes/lrw/lrw_start.c @@ -36,7 +36,7 @@ int lrw_start( int cipher, symmetric_LRW *lrw) { int err; -#ifdef LRW_TABLES +#ifdef LTC_LRW_TABLES unsigned char B[16]; int x, y, z, t; #endif @@ -69,7 +69,7 @@ int lrw_start( int cipher, /* copy the IV and tweak */ XMEMCPY(lrw->tweak, tweak, 16); -#ifdef LRW_TABLES +#ifdef LTC_LRW_TABLES /* setup tables */ /* generate the first table as it has no shifting (from which we make the other tables) */ zeromem(B, 16); diff --git a/src/pk/dh/dh_static.c b/src/pk/dh/dh_static.c index 043d3b1f6..d15401789 100644 --- a/src/pk/dh/dh_static.c +++ b/src/pk/dh/dh_static.c @@ -22,7 +22,7 @@ /* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ const dh_set sets[] = { -#ifdef DH768 +#ifdef LTC_DH768 { 96, "DH-768", @@ -32,7 +32,7 @@ const dh_set sets[] = { "//////m3wvV" }, #endif -#ifdef DH1024 +#ifdef LTC_DH1024 { 128, "DH-1024", @@ -42,7 +42,7 @@ const dh_set sets[] = { "////////////////////////////////////////////////m3C47" }, #endif -#ifdef DH1280 +#ifdef LTC_DH1280 { 160, "DH-1280", @@ -53,7 +53,7 @@ const dh_set sets[] = { "//////////////////////////////m4kSN" }, #endif -#ifdef DH1536 +#ifdef LTC_DH1536 { 192, "DH-1536", @@ -65,7 +65,7 @@ const dh_set sets[] = { "////////////m5uqd" }, #endif -#ifdef DH1792 +#ifdef LTC_DH1792 { 224, "DH-1792", @@ -77,7 +77,7 @@ const dh_set sets[] = { "//////////////////////////////////////////////////////mT/sd" }, #endif -#ifdef DH2048 +#ifdef LTC_DH2048 { 256, "DH-2048", @@ -90,7 +90,7 @@ const dh_set sets[] = { "/////////////////////////////////////////m8MPh" }, #endif -#ifdef DH2560 +#ifdef LTC_DH2560 { 320, "DH-2560", @@ -105,7 +105,7 @@ const dh_set sets[] = { "/////mKFpF" }, #endif -#ifdef DH3072 +#ifdef LTC_DH3072 { 384, "DH-3072", @@ -121,7 +121,7 @@ const dh_set sets[] = { "/////////////////////////////m32nN" }, #endif -#ifdef DH4096 +#ifdef LTC_DH4096 { 512, "DH-4096", diff --git a/src/pk/ecc/ecc.c b/src/pk/ecc/ecc.c index 56ed526e2..3cef4d309 100644 --- a/src/pk/ecc/ecc.c +++ b/src/pk/ecc/ecc.c @@ -19,13 +19,13 @@ /** @file ecc.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC /* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ const ltc_ecc_set_type ltc_ecc_sets[] = { -#ifdef ECC112 +#ifdef LTC_ECC112 { 14, "SECP112R1", @@ -36,7 +36,7 @@ const ltc_ecc_set_type ltc_ecc_sets[] = { "A89CE5AF8724C0A23E0E0FF77500" }, #endif -#ifdef ECC128 +#ifdef LTC_ECC128 { 16, "SECP128R1", @@ -47,7 +47,7 @@ const ltc_ecc_set_type ltc_ecc_sets[] = { "CF5AC8395BAFEB13C02DA292DDED7A83", }, #endif -#ifdef ECC160 +#ifdef LTC_ECC160 { 20, "SECP160R1", @@ -58,7 +58,7 @@ const ltc_ecc_set_type ltc_ecc_sets[] = { "23A628553168947D59DCC912042351377AC5FB32", }, #endif -#ifdef ECC192 +#ifdef LTC_ECC192 { 24, "ECC-192", @@ -69,7 +69,7 @@ const ltc_ecc_set_type ltc_ecc_sets[] = { "7192B95FFC8DA78631011ED6B24CDD573F977A11E794811", }, #endif -#ifdef ECC224 +#ifdef LTC_ECC224 { 28, "ECC-224", @@ -80,7 +80,7 @@ const ltc_ecc_set_type ltc_ecc_sets[] = { "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34", }, #endif -#ifdef ECC256 +#ifdef LTC_ECC256 { 32, "ECC-256", @@ -91,7 +91,7 @@ const ltc_ecc_set_type ltc_ecc_sets[] = { "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5", }, #endif -#ifdef ECC384 +#ifdef LTC_ECC384 { 48, "ECC-384", @@ -102,7 +102,7 @@ const ltc_ecc_set_type ltc_ecc_sets[] = { "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F", }, #endif -#ifdef ECC521 +#ifdef LTC_ECC521 { 66, "ECC-521", diff --git a/src/pk/katja/katja_decrypt_key.c b/src/pk/katja/katja_decrypt_key.c index 4a3355878..aae323d42 100644 --- a/src/pk/katja/katja_decrypt_key.c +++ b/src/pk/katja/katja_decrypt_key.c @@ -15,7 +15,7 @@ Katja PKCS #1 OAEP Decryption, Tom St Denis */ -#ifdef MKAT +#ifdef LTC_MKAT /** (PKCS #1 v2.0) decrypt then OAEP depad diff --git a/src/pk/katja/katja_encrypt_key.c b/src/pk/katja/katja_encrypt_key.c index 08635ebbd..12ca1e2e6 100644 --- a/src/pk/katja/katja_encrypt_key.c +++ b/src/pk/katja/katja_encrypt_key.c @@ -15,7 +15,7 @@ Katja PKCS-style OAEP encryption, Tom St Denis */ -#ifdef MKAT +#ifdef LTC_MKAT /** (PKCS #1 v2.0) OAEP pad then encrypt diff --git a/src/pk/katja/katja_export.c b/src/pk/katja/katja_export.c index 97c63aa4b..2e0e7d3ae 100644 --- a/src/pk/katja/katja_export.c +++ b/src/pk/katja/katja_export.c @@ -15,7 +15,7 @@ Export Katja PKCS-style keys, Tom St Denis */ -#ifdef MKAT +#ifdef LTC_MKAT /** This will export either an KatjaPublicKey or KatjaPrivateKey diff --git a/src/pk/katja/katja_exptmod.c b/src/pk/katja/katja_exptmod.c index 7cf56043f..c70eec90f 100644 --- a/src/pk/katja/katja_exptmod.c +++ b/src/pk/katja/katja_exptmod.c @@ -15,7 +15,7 @@ Katja PKCS-style exptmod, Tom St Denis */ -#ifdef MKAT +#ifdef LTC_MKAT /** Compute an RSA modular exponentiation diff --git a/src/pk/katja/katja_free.c b/src/pk/katja/katja_free.c index c5a46af81..767486a47 100644 --- a/src/pk/katja/katja_free.c +++ b/src/pk/katja/katja_free.c @@ -15,7 +15,7 @@ Free an Katja key, Tom St Denis */ -#ifdef MKAT +#ifdef LTC_MKAT /** Free an Katja key from memory diff --git a/src/pk/katja/katja_import.c b/src/pk/katja/katja_import.c index 3ea606250..c30686781 100644 --- a/src/pk/katja/katja_import.c +++ b/src/pk/katja/katja_import.c @@ -15,7 +15,7 @@ Import a PKCS-style Katja key, Tom St Denis */ -#ifdef MKAT +#ifdef LTC_MKAT /** Import an KatjaPublicKey or KatjaPrivateKey [two-prime only, only support >= 1024-bit keys, defined in PKCS #1 v2.1] diff --git a/src/pk/katja/katja_make_key.c b/src/pk/katja/katja_make_key.c index eec8e9868..86b4c1a97 100644 --- a/src/pk/katja/katja_make_key.c +++ b/src/pk/katja/katja_make_key.c @@ -15,7 +15,7 @@ Katja key generation, Tom St Denis */ -#ifdef MKAT +#ifdef LTC_MKAT /** Create a Katja key diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 5604838c0..383979492 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -25,10 +25,10 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len, #else FILE *f; unsigned long x; -#ifdef TRY_URANDOM_FIRST +#ifdef LTC_TRY_URANDOM_FIRST f = fopen("/dev/urandom", "rb"); if (f == NULL) -#endif /* TRY_URANDOM_FIRST */ +#endif /* LTC_TRY_URANDOM_FIRST */ f = fopen("/dev/random", "rb"); if (f == NULL) { diff --git a/testprof/katja_test.c b/testprof/katja_test.c index 86fe6b099..a59789251 100644 --- a/testprof/katja_test.c +++ b/testprof/katja_test.c @@ -1,6 +1,6 @@ #include -#ifdef MKAT +#ifdef LTC_MKAT int katja_test(void) { diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 4dbaa71f7..70b130a54 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -776,10 +776,10 @@ int time_hash(void) /*#warning you need an mp_rand!!!*/ #ifndef USE_LTM - #undef MPI + #undef LTC_MPI #endif -#ifdef MPI +#ifdef LTC_MPI void time_mult(void) { ulong64 t1, t2; From 48bd6702aacbb7b2a569902187ce398a06f0f848 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 17 Jul 2014 11:32:52 +0200 Subject: [PATCH 0238/1192] uncomment argchk in camellia_setup() --- src/ciphers/camellia.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 41deb408b..e23852552 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -213,8 +213,8 @@ int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetr int x; ulong64 A, B; -// LTC_ARGCHK(key != NULL); -// LTC_ARGCHK(skey != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(skey != NULL); /* Valid sizes (in bytes) are 16, 24, 32 */ if (keylen != 16 && keylen != 24 && keylen != 32) { From 3cda802deba355183eb8dce1495c359b3beb2da2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 17 Jul 2014 12:08:30 +0200 Subject: [PATCH 0239/1192] fixed ecc_test.c luckily gcc 4.6 of travis CI complained! shame on you gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) --- testprof/ecc_test.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/testprof/ecc_test.c b/testprof/ecc_test.c index b7c4a8c8f..60512afb7 100644 --- a/testprof/ecc_test.c +++ b/testprof/ecc_test.c @@ -3,28 +3,28 @@ #ifdef LTC_MECC static unsigned int sizes[] = { -#ifdef ECC112 +#ifdef LTC_ECC112 14, #endif -#ifdef ECC128 +#ifdef LTC_ECC128 16, #endif -#ifdef ECC160 +#ifdef LTC_ECC160 20, #endif -#ifdef ECC192 +#ifdef LTC_ECC192 24, #endif -#ifdef ECC224 +#ifdef LTC_ECC224 28, #endif -#ifdef ECC256 +#ifdef LTC_ECC256 32, #endif -#ifdef ECC384 +#ifdef LTC_ECC384 48, #endif -#ifdef ECC521 +#ifdef LTC_ECC521 65 #endif }; From a8598b0fafd0c62f0598f25913e99348f4a8bf32 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 17:46:37 +0200 Subject: [PATCH 0240/1192] fix unregister_prng() where always the first prng would have been removed --- src/misc/crypt/crypt_unregister_prng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/crypt/crypt_unregister_prng.c b/src/misc/crypt/crypt_unregister_prng.c index bb34501a7..424131a8b 100644 --- a/src/misc/crypt/crypt_unregister_prng.c +++ b/src/misc/crypt/crypt_unregister_prng.c @@ -25,11 +25,11 @@ int unregister_prng(const struct ltc_prng_descriptor *prng) int x; LTC_ARGCHK(prng != NULL); - + /* is it already registered? */ LTC_MUTEX_LOCK(<c_prng_mutex); for (x = 0; x < TAB_SIZE; x++) { - if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) != 0) { + if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) == 0) { prng_descriptor[x].name = NULL; LTC_MUTEX_UNLOCK(<c_prng_mutex); return CRYPT_OK; From 98e05b10a00a295caee3299f0ee9d3861d87a796 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 23:58:59 +0200 Subject: [PATCH 0241/1192] trim trailing spaces in mingw makefiles --- updatemakes.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/updatemakes.sh b/updatemakes.sh index cf4c60785..cbf174f65 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -19,7 +19,8 @@ sed -e 's/ *$//' < tmp.delme > makefile.unix rm -f tmp.delme perl filter.pl makefile.mingw tmplist -mv -f tmp.delme makefile.mingw +sed -e 's/ *$//' < tmp.delme > makefile.mingw +rm -f tmp.delme perl filter.pl makefile.msvc tmplist sed -e 's/\.o /.obj /g' -e 's/ *$//' < tmp.delme > makefile.msvc From 09a0de69a062524e698f426b45f76a24db285e7e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 15:16:30 +0200 Subject: [PATCH 0242/1192] update makefile.mingw --- makefile.mingw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile.mingw b/makefile.mingw index 888fac269..8fd3a22f4 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -172,7 +172,7 @@ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rs src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ From 757ac982a5f61a0b9a363cf526c2dfa1876e7a81 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 15:14:45 +0200 Subject: [PATCH 0243/1192] if selected, always make targets 'test' and 'testprof/$(LIBTEST)' --- makefile | 2 ++ makefile.icc | 2 ++ makefile.mingw | 4 +++- makefile.msvc | 1 + makefile.shared | 2 ++ makefile.unix | 2 ++ 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index dea1ea2e3..c775d5518 100644 --- a/makefile +++ b/makefile @@ -287,6 +287,7 @@ library: $(LIBNAME) $(OBJECTS): $(HEADERS) +.PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE) @@ -315,6 +316,7 @@ multi: library $(MULTIS) timing: library testprof/$(LIBTEST) $(TIMINGS) $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) +.PHONY: test test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) diff --git a/makefile.icc b/makefile.icc index 6d5a4d27a..23ef4a30f 100644 --- a/makefile.icc +++ b/makefile.icc @@ -273,6 +273,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) +.PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): cd testprof ; LIBTEST_S=$(LIBTEST) CFLAGS="$(CFLAGS)" CC="$(CC)" AR="$(AR)" $(MAKE) -f makefile.icc @@ -298,6 +299,7 @@ tv_gen: library $(TVS) timing: library $(TIMINGS) testprof/$(LIBTEST) $(CC) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) +.PHONY: test test: library $(TESTS) testprof/$(LIBTEST) $(CC) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) diff --git a/makefile.mingw b/makefile.mingw index 8fd3a22f4..2893aa207 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -208,6 +208,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) +.PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): $(MAKE) -C testprof -f makefile.mingw CFLAGS_OPTS="$(CFLAGS)" LIBTEST_S=$(LIBTEST) CC=$(CC) LD=$(LD) AR=$(AR) ARFLAGS=$(ARFLAGS) RANLIB=$(RANLIB) @@ -236,6 +237,7 @@ multi: library $(MULTIS) timing: library testprof/$(LIBTEST) $(TIMINGS) $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) +.PHONY: test test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) @@ -251,4 +253,4 @@ install_test: testprof/$(LIBTEST) clean: cmd /c del /Q /S *.o *.a *.exe - $(MAKE) -C testprof -f makefile.mingw clean \ No newline at end of file + $(MAKE) -C testprof -f makefile.mingw clean diff --git a/makefile.msvc b/makefile.msvc index afb1ad675..aabe8eb6c 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -158,6 +158,7 @@ tv_gen: demos/tv_gen.c library hashsum: demos/hashsum.c library cl $(CFLAGS) demos/hashsum.c tomcrypt.lib advapi32.lib $(EXTRALIBS) +.PHONY: test test: demos/test.c library cl $(CFLAGS) demos/test.c testprof/tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) diff --git a/makefile.shared b/makefile.shared index 18fe826c7..734506cce 100644 --- a/makefile.shared +++ b/makefile.shared @@ -258,6 +258,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) +.PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC=$(CC) make -f makefile.shared @@ -295,6 +296,7 @@ small: library $(SMALLOBJECTS) tv_gen: library $(TVS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TV) $(TVS) $(LIBNAME) $(EXTRALIBS) +.PHONY: test test: library testprof/$(LIBTEST) $(TESTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) diff --git a/makefile.unix b/makefile.unix index 9e2a64501..91af9b1dc 100644 --- a/makefile.unix +++ b/makefile.unix @@ -208,6 +208,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) +.PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE) @@ -236,6 +237,7 @@ multi: library $(MULTIS) timing: library testprof/$(LIBTEST) $(TIMINGS) $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) +.PHONY: test test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) From ff736a61bb39d2f94b9efef5b92b6761d1b06741 Mon Sep 17 00:00:00 2001 From: Jonathan Herzog Date: Sun, 20 Jan 2008 21:57:25 -0800 Subject: [PATCH 0244/1192] Hash functions now check for input-length overflow. Because many of the hash-functions implemented by LTC use the length of the input when padding the input out to a block-length, LTC keeps track of the input length in a 64-bit integer. However, it did not previously test for overflow of this value. Since many of the hash-functions implemented by LTC are defined for inputs of length 2^128 bits or more, this means that LTC was incorrectly implementing these hash functions for extremely long inputs. Also, this might have been a minor security problem: A clever attacker might have been able to take a message with a known hash and find another message (longer by 2^64 bits) that would be hashed to the same value by LTC. Fortunately, LTC uses a pre-processor macro to make the actual code for hashing, and so this problem could be fixed by adding an overflow-check to that macro. --- src/headers/tomcrypt.h | 4 +++- src/headers/tomcrypt_hash.h | 3 +++ src/misc/error_to_string.c | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 51299af29..d38a7c7e8 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -61,7 +61,9 @@ enum { CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */ CRYPT_INVALID_PRIME_SIZE,/* Invalid size of prime requested */ - CRYPT_PK_INVALID_PADDING /* Invalid padding on input */ + CRYPT_PK_INVALID_PADDING, /* Invalid padding on input */ + + CRYPT_HASH_OVERFLOW /* Hash applied to too many bits */ }; #include diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 146dcbcf2..e750cb843 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -351,6 +351,9 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen) if (md-> state_var .curlen > sizeof(md-> state_var .buf)) { \ return CRYPT_INVALID_ARG; \ } \ + if ((md-> state_var .length + inlen) < md-> state_var .length) { \ + return CRYPT_HASH_OVERFLOW; \ + } \ while (inlen > 0) { \ if (md-> state_var .curlen == 0 && inlen >= block_size) { \ if ((err = compress_name (md, (unsigned char *)in)) != CRYPT_OK) { \ diff --git a/src/misc/error_to_string.c b/src/misc/error_to_string.c index 034cd18a1..19f878191 100644 --- a/src/misc/error_to_string.c +++ b/src/misc/error_to_string.c @@ -52,6 +52,9 @@ static const char *err_2_str[] = "Invalid size for prime.", + "Invalid padding.", + + "Hash applied to too many bits.", }; /** From f8449f55d94ad6728d5efc142fa7e39b792698ef Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 7 Aug 2014 01:33:35 +0200 Subject: [PATCH 0245/1192] trim trailing spaces --- src/hashes/chc/chc.c | 16 ++++++++-------- src/pk/rsa/rsa_verify_hash.c | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index 2c061e3c5..a27bb08de 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -35,8 +35,8 @@ const struct ltc_hash_descriptor chc_desc = { }; /** - Initialize the CHC state with a given cipher - @param cipher The index of the cipher you wish to bind + Initialize the CHC state with a given cipher + @param cipher The index of the cipher you wish to bind @return CRYPT_OK if successful */ int chc_register(int cipher) @@ -70,7 +70,7 @@ int chc_register(int cipher) } /* store into descriptor */ - hash_descriptor[idx].hashsize = + hash_descriptor[idx].hashsize = hash_descriptor[idx].blocksize = cipher_descriptor[cipher].block_length; /* store the idx and block size */ @@ -89,7 +89,7 @@ int chc_init(hash_state *md) symmetric_key *key; unsigned char buf[MAXBLOCKSIZE]; int err; - + LTC_ARGCHK(md != NULL); /* is the cipher valid? */ @@ -105,7 +105,7 @@ int chc_init(hash_state *md) return CRYPT_MEM; } - /* zero key and what not */ + /* zero key and what not */ zeromem(buf, cipher_blocksize); if ((err = cipher_descriptor[cipher_idx].setup(buf, cipher_blocksize, 0, key)) != CRYPT_OK) { XFREE(key); @@ -123,7 +123,7 @@ int chc_init(hash_state *md) return CRYPT_OK; } -/* +/* key <= state T0,T1 <= block T0 <= encrypt T0 @@ -248,7 +248,7 @@ int chc_done(hash_state *md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int chc_test(void) { static const struct { @@ -258,7 +258,7 @@ int chc_test(void) } tests[] = { { (unsigned char *)"hello world", - { 0xcf, 0x57, 0x9d, 0xc3, 0x0a, 0x0e, 0xea, 0x61, + { 0xcf, 0x57, 0x9d, 0xc3, 0x0a, 0x0e, 0xea, 0x61, 0x0d, 0x54, 0x47, 0xc4, 0x3c, 0x06, 0xf5, 0x4e }, 16 } diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 654d00ddc..a0f94c796 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -120,19 +120,19 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, } /* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */ - /* construct the SEQUENCE + /* construct the SEQUENCE SEQUENCE { SEQUENCE {hashoid OID blah NULL } - hash OCTET STRING + hash OCTET STRING } */ LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, loid, sizeof(loid)/sizeof(loid[0])); LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); - + if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { XFREE(out); goto bail_2; From 1fb649d3946359670c4785686dd37a688e3c1392 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 7 Aug 2014 01:34:06 +0200 Subject: [PATCH 0246/1192] chc: don't execute tests if LTC_TEST is not defined --- src/hashes/chc/chc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index a27bb08de..332d02580 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -251,6 +251,9 @@ int chc_done(hash_state *md, unsigned char *out) */ int chc_test(void) { +#ifndef LTC_TEST + return CRYPT_NOP; +#else static const struct { unsigned char *msg, md[MAXBLOCKSIZE]; @@ -289,6 +292,7 @@ int chc_test(void) } return CRYPT_OK; +#endif } #endif From 01c34dc236b8a5b91579fa8b500872d1ca07d7b6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 22 Aug 2014 12:41:46 +0200 Subject: [PATCH 0247/1192] trim trailing spaces --- src/ciphers/blowfish.c | 16 +- src/ciphers/cast5.c | 710 +++--- src/ciphers/des.c | 2108 ++++++++--------- src/ciphers/kasumi.c | 2 +- src/ciphers/khazad.c | 22 +- src/ciphers/kseed.c | 6 +- src/ciphers/multi2.c | 24 +- src/ciphers/noekeon.c | 50 +- src/ciphers/rc2.c | 20 +- src/ciphers/rc5.c | 28 +- src/ciphers/rc6.c | 42 +- src/ciphers/skipjack.c | 10 +- src/pk/asn1/der/choice/der_decode_choice.c | 3 +- .../der/sequence/der_decode_sequence_flexi.c | 154 +- .../der/sequence/der_decode_sequence_multi.c | 14 +- .../der/sequence/der_encode_sequence_ex.c | 20 +- .../der/sequence/der_encode_sequence_multi.c | 14 +- src/prngs/sprng.c | 24 +- 18 files changed, 1633 insertions(+), 1634 deletions(-) diff --git a/src/ciphers/blowfish.c b/src/ciphers/blowfish.c index 6a55abc0a..597585843 100644 --- a/src/ciphers/blowfish.c +++ b/src/ciphers/blowfish.c @@ -322,15 +322,15 @@ int blowfish_setup(const unsigned char *key, int keylen, int num_rounds, /* check rounds */ if (num_rounds != 0 && num_rounds != 16) { return CRYPT_INVALID_ROUNDS; - } + } /* load in key bytes (Supplied by David Hopwood) */ for (x = y = 0; x < 18; x++) { A = 0; for (z = 0; z < 4; z++) { A = (A << 8) | ((ulong32)key[y++] & 255); - if (y == (ulong32)keylen) { - y = 0; + if (y == (ulong32)keylen) { + y = 0; } } skey->blowfish.K[x] = ORIG_P[x] ^ A; @@ -347,7 +347,7 @@ int blowfish_setup(const unsigned char *key, int keylen, int num_rounds, for (x = 0; x < 8; x++) { B[x] = 0; } - + for (x = 0; x < 18; x += 2) { /* encrypt it */ blowfish_ecb_encrypt(B, B, skey); @@ -446,7 +446,7 @@ int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_k Decrypts a block of text with Blowfish @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ #ifdef LTC_CLEAN_STACK @@ -464,7 +464,7 @@ int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_k LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - + #ifndef __GNUC__ S1 = skey->blowfish.S[0]; S2 = skey->blowfish.S[1]; @@ -512,7 +512,7 @@ int blowfish_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else int err; symmetric_key key; static const struct { @@ -562,7 +562,7 @@ int blowfish_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void blowfish_done(symmetric_key *skey) diff --git a/src/ciphers/cast5.c b/src/ciphers/cast5.c index ffc2f28a6..01716edfd 100644 --- a/src/ciphers/cast5.c +++ b/src/ciphers/cast5.c @@ -8,10 +8,10 @@ * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ - - /** + + /** @file cast5.c - Implementation of LTC_CAST5 (RFC 2144) by Tom St Denis + Implementation of LTC_CAST5 (RFC 2144) by Tom St Denis */ #include "tomcrypt.h" @@ -31,371 +31,371 @@ const struct ltc_cipher_descriptor cast5_desc = { }; static const ulong32 S1[256] = { -0x30fb40d4UL, 0x9fa0ff0bUL, 0x6beccd2fUL, 0x3f258c7aUL, 0x1e213f2fUL, 0x9c004dd3UL, -0x6003e540UL, 0xcf9fc949UL, 0xbfd4af27UL, 0x88bbbdb5UL, 0xe2034090UL, 0x98d09675UL, -0x6e63a0e0UL, 0x15c361d2UL, 0xc2e7661dUL, 0x22d4ff8eUL, 0x28683b6fUL, 0xc07fd059UL, -0xff2379c8UL, 0x775f50e2UL, 0x43c340d3UL, 0xdf2f8656UL, 0x887ca41aUL, 0xa2d2bd2dUL, -0xa1c9e0d6UL, 0x346c4819UL, 0x61b76d87UL, 0x22540f2fUL, 0x2abe32e1UL, 0xaa54166bUL, -0x22568e3aUL, 0xa2d341d0UL, 0x66db40c8UL, 0xa784392fUL, 0x004dff2fUL, 0x2db9d2deUL, -0x97943facUL, 0x4a97c1d8UL, 0x527644b7UL, 0xb5f437a7UL, 0xb82cbaefUL, 0xd751d159UL, -0x6ff7f0edUL, 0x5a097a1fUL, 0x827b68d0UL, 0x90ecf52eUL, 0x22b0c054UL, 0xbc8e5935UL, -0x4b6d2f7fUL, 0x50bb64a2UL, 0xd2664910UL, 0xbee5812dUL, 0xb7332290UL, 0xe93b159fUL, -0xb48ee411UL, 0x4bff345dUL, 0xfd45c240UL, 0xad31973fUL, 0xc4f6d02eUL, 0x55fc8165UL, -0xd5b1caadUL, 0xa1ac2daeUL, 0xa2d4b76dUL, 0xc19b0c50UL, 0x882240f2UL, 0x0c6e4f38UL, -0xa4e4bfd7UL, 0x4f5ba272UL, 0x564c1d2fUL, 0xc59c5319UL, 0xb949e354UL, 0xb04669feUL, -0xb1b6ab8aUL, 0xc71358ddUL, 0x6385c545UL, 0x110f935dUL, 0x57538ad5UL, 0x6a390493UL, -0xe63d37e0UL, 0x2a54f6b3UL, 0x3a787d5fUL, 0x6276a0b5UL, 0x19a6fcdfUL, 0x7a42206aUL, -0x29f9d4d5UL, 0xf61b1891UL, 0xbb72275eUL, 0xaa508167UL, 0x38901091UL, 0xc6b505ebUL, -0x84c7cb8cUL, 0x2ad75a0fUL, 0x874a1427UL, 0xa2d1936bUL, 0x2ad286afUL, 0xaa56d291UL, -0xd7894360UL, 0x425c750dUL, 0x93b39e26UL, 0x187184c9UL, 0x6c00b32dUL, 0x73e2bb14UL, -0xa0bebc3cUL, 0x54623779UL, 0x64459eabUL, 0x3f328b82UL, 0x7718cf82UL, 0x59a2cea6UL, -0x04ee002eUL, 0x89fe78e6UL, 0x3fab0950UL, 0x325ff6c2UL, 0x81383f05UL, 0x6963c5c8UL, -0x76cb5ad6UL, 0xd49974c9UL, 0xca180dcfUL, 0x380782d5UL, 0xc7fa5cf6UL, 0x8ac31511UL, -0x35e79e13UL, 0x47da91d0UL, 0xf40f9086UL, 0xa7e2419eUL, 0x31366241UL, 0x051ef495UL, -0xaa573b04UL, 0x4a805d8dUL, 0x548300d0UL, 0x00322a3cUL, 0xbf64cddfUL, 0xba57a68eUL, -0x75c6372bUL, 0x50afd341UL, 0xa7c13275UL, 0x915a0bf5UL, 0x6b54bfabUL, 0x2b0b1426UL, -0xab4cc9d7UL, 0x449ccd82UL, 0xf7fbf265UL, 0xab85c5f3UL, 0x1b55db94UL, 0xaad4e324UL, -0xcfa4bd3fUL, 0x2deaa3e2UL, 0x9e204d02UL, 0xc8bd25acUL, 0xeadf55b3UL, 0xd5bd9e98UL, -0xe31231b2UL, 0x2ad5ad6cUL, 0x954329deUL, 0xadbe4528UL, 0xd8710f69UL, 0xaa51c90fUL, -0xaa786bf6UL, 0x22513f1eUL, 0xaa51a79bUL, 0x2ad344ccUL, 0x7b5a41f0UL, 0xd37cfbadUL, -0x1b069505UL, 0x41ece491UL, 0xb4c332e6UL, 0x032268d4UL, 0xc9600accUL, 0xce387e6dUL, -0xbf6bb16cUL, 0x6a70fb78UL, 0x0d03d9c9UL, 0xd4df39deUL, 0xe01063daUL, 0x4736f464UL, -0x5ad328d8UL, 0xb347cc96UL, 0x75bb0fc3UL, 0x98511bfbUL, 0x4ffbcc35UL, 0xb58bcf6aUL, -0xe11f0abcUL, 0xbfc5fe4aUL, 0xa70aec10UL, 0xac39570aUL, 0x3f04442fUL, 0x6188b153UL, -0xe0397a2eUL, 0x5727cb79UL, 0x9ceb418fUL, 0x1cacd68dUL, 0x2ad37c96UL, 0x0175cb9dUL, -0xc69dff09UL, 0xc75b65f0UL, 0xd9db40d8UL, 0xec0e7779UL, 0x4744ead4UL, 0xb11c3274UL, -0xdd24cb9eUL, 0x7e1c54bdUL, 0xf01144f9UL, 0xd2240eb1UL, 0x9675b3fdUL, 0xa3ac3755UL, -0xd47c27afUL, 0x51c85f4dUL, 0x56907596UL, 0xa5bb15e6UL, 0x580304f0UL, 0xca042cf1UL, -0x011a37eaUL, 0x8dbfaadbUL, 0x35ba3e4aUL, 0x3526ffa0UL, 0xc37b4d09UL, 0xbc306ed9UL, -0x98a52666UL, 0x5648f725UL, 0xff5e569dUL, 0x0ced63d0UL, 0x7c63b2cfUL, 0x700b45e1UL, -0xd5ea50f1UL, 0x85a92872UL, 0xaf1fbda7UL, 0xd4234870UL, 0xa7870bf3UL, 0x2d3b4d79UL, -0x42e04198UL, 0x0cd0ede7UL, 0x26470db8UL, 0xf881814cUL, 0x474d6ad7UL, 0x7c0c5e5cUL, -0xd1231959UL, 0x381b7298UL, 0xf5d2f4dbUL, 0xab838653UL, 0x6e2f1e23UL, 0x83719c9eUL, -0xbd91e046UL, 0x9a56456eUL, 0xdc39200cUL, 0x20c8c571UL, 0x962bda1cUL, 0xe1e696ffUL, -0xb141ab08UL, 0x7cca89b9UL, 0x1a69e783UL, 0x02cc4843UL, 0xa2f7c579UL, 0x429ef47dUL, +0x30fb40d4UL, 0x9fa0ff0bUL, 0x6beccd2fUL, 0x3f258c7aUL, 0x1e213f2fUL, 0x9c004dd3UL, +0x6003e540UL, 0xcf9fc949UL, 0xbfd4af27UL, 0x88bbbdb5UL, 0xe2034090UL, 0x98d09675UL, +0x6e63a0e0UL, 0x15c361d2UL, 0xc2e7661dUL, 0x22d4ff8eUL, 0x28683b6fUL, 0xc07fd059UL, +0xff2379c8UL, 0x775f50e2UL, 0x43c340d3UL, 0xdf2f8656UL, 0x887ca41aUL, 0xa2d2bd2dUL, +0xa1c9e0d6UL, 0x346c4819UL, 0x61b76d87UL, 0x22540f2fUL, 0x2abe32e1UL, 0xaa54166bUL, +0x22568e3aUL, 0xa2d341d0UL, 0x66db40c8UL, 0xa784392fUL, 0x004dff2fUL, 0x2db9d2deUL, +0x97943facUL, 0x4a97c1d8UL, 0x527644b7UL, 0xb5f437a7UL, 0xb82cbaefUL, 0xd751d159UL, +0x6ff7f0edUL, 0x5a097a1fUL, 0x827b68d0UL, 0x90ecf52eUL, 0x22b0c054UL, 0xbc8e5935UL, +0x4b6d2f7fUL, 0x50bb64a2UL, 0xd2664910UL, 0xbee5812dUL, 0xb7332290UL, 0xe93b159fUL, +0xb48ee411UL, 0x4bff345dUL, 0xfd45c240UL, 0xad31973fUL, 0xc4f6d02eUL, 0x55fc8165UL, +0xd5b1caadUL, 0xa1ac2daeUL, 0xa2d4b76dUL, 0xc19b0c50UL, 0x882240f2UL, 0x0c6e4f38UL, +0xa4e4bfd7UL, 0x4f5ba272UL, 0x564c1d2fUL, 0xc59c5319UL, 0xb949e354UL, 0xb04669feUL, +0xb1b6ab8aUL, 0xc71358ddUL, 0x6385c545UL, 0x110f935dUL, 0x57538ad5UL, 0x6a390493UL, +0xe63d37e0UL, 0x2a54f6b3UL, 0x3a787d5fUL, 0x6276a0b5UL, 0x19a6fcdfUL, 0x7a42206aUL, +0x29f9d4d5UL, 0xf61b1891UL, 0xbb72275eUL, 0xaa508167UL, 0x38901091UL, 0xc6b505ebUL, +0x84c7cb8cUL, 0x2ad75a0fUL, 0x874a1427UL, 0xa2d1936bUL, 0x2ad286afUL, 0xaa56d291UL, +0xd7894360UL, 0x425c750dUL, 0x93b39e26UL, 0x187184c9UL, 0x6c00b32dUL, 0x73e2bb14UL, +0xa0bebc3cUL, 0x54623779UL, 0x64459eabUL, 0x3f328b82UL, 0x7718cf82UL, 0x59a2cea6UL, +0x04ee002eUL, 0x89fe78e6UL, 0x3fab0950UL, 0x325ff6c2UL, 0x81383f05UL, 0x6963c5c8UL, +0x76cb5ad6UL, 0xd49974c9UL, 0xca180dcfUL, 0x380782d5UL, 0xc7fa5cf6UL, 0x8ac31511UL, +0x35e79e13UL, 0x47da91d0UL, 0xf40f9086UL, 0xa7e2419eUL, 0x31366241UL, 0x051ef495UL, +0xaa573b04UL, 0x4a805d8dUL, 0x548300d0UL, 0x00322a3cUL, 0xbf64cddfUL, 0xba57a68eUL, +0x75c6372bUL, 0x50afd341UL, 0xa7c13275UL, 0x915a0bf5UL, 0x6b54bfabUL, 0x2b0b1426UL, +0xab4cc9d7UL, 0x449ccd82UL, 0xf7fbf265UL, 0xab85c5f3UL, 0x1b55db94UL, 0xaad4e324UL, +0xcfa4bd3fUL, 0x2deaa3e2UL, 0x9e204d02UL, 0xc8bd25acUL, 0xeadf55b3UL, 0xd5bd9e98UL, +0xe31231b2UL, 0x2ad5ad6cUL, 0x954329deUL, 0xadbe4528UL, 0xd8710f69UL, 0xaa51c90fUL, +0xaa786bf6UL, 0x22513f1eUL, 0xaa51a79bUL, 0x2ad344ccUL, 0x7b5a41f0UL, 0xd37cfbadUL, +0x1b069505UL, 0x41ece491UL, 0xb4c332e6UL, 0x032268d4UL, 0xc9600accUL, 0xce387e6dUL, +0xbf6bb16cUL, 0x6a70fb78UL, 0x0d03d9c9UL, 0xd4df39deUL, 0xe01063daUL, 0x4736f464UL, +0x5ad328d8UL, 0xb347cc96UL, 0x75bb0fc3UL, 0x98511bfbUL, 0x4ffbcc35UL, 0xb58bcf6aUL, +0xe11f0abcUL, 0xbfc5fe4aUL, 0xa70aec10UL, 0xac39570aUL, 0x3f04442fUL, 0x6188b153UL, +0xe0397a2eUL, 0x5727cb79UL, 0x9ceb418fUL, 0x1cacd68dUL, 0x2ad37c96UL, 0x0175cb9dUL, +0xc69dff09UL, 0xc75b65f0UL, 0xd9db40d8UL, 0xec0e7779UL, 0x4744ead4UL, 0xb11c3274UL, +0xdd24cb9eUL, 0x7e1c54bdUL, 0xf01144f9UL, 0xd2240eb1UL, 0x9675b3fdUL, 0xa3ac3755UL, +0xd47c27afUL, 0x51c85f4dUL, 0x56907596UL, 0xa5bb15e6UL, 0x580304f0UL, 0xca042cf1UL, +0x011a37eaUL, 0x8dbfaadbUL, 0x35ba3e4aUL, 0x3526ffa0UL, 0xc37b4d09UL, 0xbc306ed9UL, +0x98a52666UL, 0x5648f725UL, 0xff5e569dUL, 0x0ced63d0UL, 0x7c63b2cfUL, 0x700b45e1UL, +0xd5ea50f1UL, 0x85a92872UL, 0xaf1fbda7UL, 0xd4234870UL, 0xa7870bf3UL, 0x2d3b4d79UL, +0x42e04198UL, 0x0cd0ede7UL, 0x26470db8UL, 0xf881814cUL, 0x474d6ad7UL, 0x7c0c5e5cUL, +0xd1231959UL, 0x381b7298UL, 0xf5d2f4dbUL, 0xab838653UL, 0x6e2f1e23UL, 0x83719c9eUL, +0xbd91e046UL, 0x9a56456eUL, 0xdc39200cUL, 0x20c8c571UL, 0x962bda1cUL, 0xe1e696ffUL, +0xb141ab08UL, 0x7cca89b9UL, 0x1a69e783UL, 0x02cc4843UL, 0xa2f7c579UL, 0x429ef47dUL, 0x427b169cUL, 0x5ac9f049UL, 0xdd8f0f00UL, 0x5c8165bfUL}; static const ulong32 S2[256] = { -0x1f201094UL, 0xef0ba75bUL, 0x69e3cf7eUL, 0x393f4380UL, 0xfe61cf7aUL, 0xeec5207aUL, -0x55889c94UL, 0x72fc0651UL, 0xada7ef79UL, 0x4e1d7235UL, 0xd55a63ceUL, 0xde0436baUL, -0x99c430efUL, 0x5f0c0794UL, 0x18dcdb7dUL, 0xa1d6eff3UL, 0xa0b52f7bUL, 0x59e83605UL, -0xee15b094UL, 0xe9ffd909UL, 0xdc440086UL, 0xef944459UL, 0xba83ccb3UL, 0xe0c3cdfbUL, -0xd1da4181UL, 0x3b092ab1UL, 0xf997f1c1UL, 0xa5e6cf7bUL, 0x01420ddbUL, 0xe4e7ef5bUL, -0x25a1ff41UL, 0xe180f806UL, 0x1fc41080UL, 0x179bee7aUL, 0xd37ac6a9UL, 0xfe5830a4UL, -0x98de8b7fUL, 0x77e83f4eUL, 0x79929269UL, 0x24fa9f7bUL, 0xe113c85bUL, 0xacc40083UL, -0xd7503525UL, 0xf7ea615fUL, 0x62143154UL, 0x0d554b63UL, 0x5d681121UL, 0xc866c359UL, -0x3d63cf73UL, 0xcee234c0UL, 0xd4d87e87UL, 0x5c672b21UL, 0x071f6181UL, 0x39f7627fUL, -0x361e3084UL, 0xe4eb573bUL, 0x602f64a4UL, 0xd63acd9cUL, 0x1bbc4635UL, 0x9e81032dUL, -0x2701f50cUL, 0x99847ab4UL, 0xa0e3df79UL, 0xba6cf38cUL, 0x10843094UL, 0x2537a95eUL, -0xf46f6ffeUL, 0xa1ff3b1fUL, 0x208cfb6aUL, 0x8f458c74UL, 0xd9e0a227UL, 0x4ec73a34UL, -0xfc884f69UL, 0x3e4de8dfUL, 0xef0e0088UL, 0x3559648dUL, 0x8a45388cUL, 0x1d804366UL, -0x721d9bfdUL, 0xa58684bbUL, 0xe8256333UL, 0x844e8212UL, 0x128d8098UL, 0xfed33fb4UL, -0xce280ae1UL, 0x27e19ba5UL, 0xd5a6c252UL, 0xe49754bdUL, 0xc5d655ddUL, 0xeb667064UL, -0x77840b4dUL, 0xa1b6a801UL, 0x84db26a9UL, 0xe0b56714UL, 0x21f043b7UL, 0xe5d05860UL, -0x54f03084UL, 0x066ff472UL, 0xa31aa153UL, 0xdadc4755UL, 0xb5625dbfUL, 0x68561be6UL, -0x83ca6b94UL, 0x2d6ed23bUL, 0xeccf01dbUL, 0xa6d3d0baUL, 0xb6803d5cUL, 0xaf77a709UL, -0x33b4a34cUL, 0x397bc8d6UL, 0x5ee22b95UL, 0x5f0e5304UL, 0x81ed6f61UL, 0x20e74364UL, -0xb45e1378UL, 0xde18639bUL, 0x881ca122UL, 0xb96726d1UL, 0x8049a7e8UL, 0x22b7da7bUL, -0x5e552d25UL, 0x5272d237UL, 0x79d2951cUL, 0xc60d894cUL, 0x488cb402UL, 0x1ba4fe5bUL, -0xa4b09f6bUL, 0x1ca815cfUL, 0xa20c3005UL, 0x8871df63UL, 0xb9de2fcbUL, 0x0cc6c9e9UL, -0x0beeff53UL, 0xe3214517UL, 0xb4542835UL, 0x9f63293cUL, 0xee41e729UL, 0x6e1d2d7cUL, -0x50045286UL, 0x1e6685f3UL, 0xf33401c6UL, 0x30a22c95UL, 0x31a70850UL, 0x60930f13UL, -0x73f98417UL, 0xa1269859UL, 0xec645c44UL, 0x52c877a9UL, 0xcdff33a6UL, 0xa02b1741UL, -0x7cbad9a2UL, 0x2180036fUL, 0x50d99c08UL, 0xcb3f4861UL, 0xc26bd765UL, 0x64a3f6abUL, -0x80342676UL, 0x25a75e7bUL, 0xe4e6d1fcUL, 0x20c710e6UL, 0xcdf0b680UL, 0x17844d3bUL, -0x31eef84dUL, 0x7e0824e4UL, 0x2ccb49ebUL, 0x846a3baeUL, 0x8ff77888UL, 0xee5d60f6UL, -0x7af75673UL, 0x2fdd5cdbUL, 0xa11631c1UL, 0x30f66f43UL, 0xb3faec54UL, 0x157fd7faUL, -0xef8579ccUL, 0xd152de58UL, 0xdb2ffd5eUL, 0x8f32ce19UL, 0x306af97aUL, 0x02f03ef8UL, -0x99319ad5UL, 0xc242fa0fUL, 0xa7e3ebb0UL, 0xc68e4906UL, 0xb8da230cUL, 0x80823028UL, -0xdcdef3c8UL, 0xd35fb171UL, 0x088a1bc8UL, 0xbec0c560UL, 0x61a3c9e8UL, 0xbca8f54dUL, -0xc72feffaUL, 0x22822e99UL, 0x82c570b4UL, 0xd8d94e89UL, 0x8b1c34bcUL, 0x301e16e6UL, -0x273be979UL, 0xb0ffeaa6UL, 0x61d9b8c6UL, 0x00b24869UL, 0xb7ffce3fUL, 0x08dc283bUL, -0x43daf65aUL, 0xf7e19798UL, 0x7619b72fUL, 0x8f1c9ba4UL, 0xdc8637a0UL, 0x16a7d3b1UL, -0x9fc393b7UL, 0xa7136eebUL, 0xc6bcc63eUL, 0x1a513742UL, 0xef6828bcUL, 0x520365d6UL, -0x2d6a77abUL, 0x3527ed4bUL, 0x821fd216UL, 0x095c6e2eUL, 0xdb92f2fbUL, 0x5eea29cbUL, -0x145892f5UL, 0x91584f7fUL, 0x5483697bUL, 0x2667a8ccUL, 0x85196048UL, 0x8c4baceaUL, -0x833860d4UL, 0x0d23e0f9UL, 0x6c387e8aUL, 0x0ae6d249UL, 0xb284600cUL, 0xd835731dUL, -0xdcb1c647UL, 0xac4c56eaUL, 0x3ebd81b3UL, 0x230eabb0UL, 0x6438bc87UL, 0xf0b5b1faUL, -0x8f5ea2b3UL, 0xfc184642UL, 0x0a036b7aUL, 0x4fb089bdUL, 0x649da589UL, 0xa345415eUL, -0x5c038323UL, 0x3e5d3bb9UL, 0x43d79572UL, 0x7e6dd07cUL, 0x06dfdf1eUL, 0x6c6cc4efUL, +0x1f201094UL, 0xef0ba75bUL, 0x69e3cf7eUL, 0x393f4380UL, 0xfe61cf7aUL, 0xeec5207aUL, +0x55889c94UL, 0x72fc0651UL, 0xada7ef79UL, 0x4e1d7235UL, 0xd55a63ceUL, 0xde0436baUL, +0x99c430efUL, 0x5f0c0794UL, 0x18dcdb7dUL, 0xa1d6eff3UL, 0xa0b52f7bUL, 0x59e83605UL, +0xee15b094UL, 0xe9ffd909UL, 0xdc440086UL, 0xef944459UL, 0xba83ccb3UL, 0xe0c3cdfbUL, +0xd1da4181UL, 0x3b092ab1UL, 0xf997f1c1UL, 0xa5e6cf7bUL, 0x01420ddbUL, 0xe4e7ef5bUL, +0x25a1ff41UL, 0xe180f806UL, 0x1fc41080UL, 0x179bee7aUL, 0xd37ac6a9UL, 0xfe5830a4UL, +0x98de8b7fUL, 0x77e83f4eUL, 0x79929269UL, 0x24fa9f7bUL, 0xe113c85bUL, 0xacc40083UL, +0xd7503525UL, 0xf7ea615fUL, 0x62143154UL, 0x0d554b63UL, 0x5d681121UL, 0xc866c359UL, +0x3d63cf73UL, 0xcee234c0UL, 0xd4d87e87UL, 0x5c672b21UL, 0x071f6181UL, 0x39f7627fUL, +0x361e3084UL, 0xe4eb573bUL, 0x602f64a4UL, 0xd63acd9cUL, 0x1bbc4635UL, 0x9e81032dUL, +0x2701f50cUL, 0x99847ab4UL, 0xa0e3df79UL, 0xba6cf38cUL, 0x10843094UL, 0x2537a95eUL, +0xf46f6ffeUL, 0xa1ff3b1fUL, 0x208cfb6aUL, 0x8f458c74UL, 0xd9e0a227UL, 0x4ec73a34UL, +0xfc884f69UL, 0x3e4de8dfUL, 0xef0e0088UL, 0x3559648dUL, 0x8a45388cUL, 0x1d804366UL, +0x721d9bfdUL, 0xa58684bbUL, 0xe8256333UL, 0x844e8212UL, 0x128d8098UL, 0xfed33fb4UL, +0xce280ae1UL, 0x27e19ba5UL, 0xd5a6c252UL, 0xe49754bdUL, 0xc5d655ddUL, 0xeb667064UL, +0x77840b4dUL, 0xa1b6a801UL, 0x84db26a9UL, 0xe0b56714UL, 0x21f043b7UL, 0xe5d05860UL, +0x54f03084UL, 0x066ff472UL, 0xa31aa153UL, 0xdadc4755UL, 0xb5625dbfUL, 0x68561be6UL, +0x83ca6b94UL, 0x2d6ed23bUL, 0xeccf01dbUL, 0xa6d3d0baUL, 0xb6803d5cUL, 0xaf77a709UL, +0x33b4a34cUL, 0x397bc8d6UL, 0x5ee22b95UL, 0x5f0e5304UL, 0x81ed6f61UL, 0x20e74364UL, +0xb45e1378UL, 0xde18639bUL, 0x881ca122UL, 0xb96726d1UL, 0x8049a7e8UL, 0x22b7da7bUL, +0x5e552d25UL, 0x5272d237UL, 0x79d2951cUL, 0xc60d894cUL, 0x488cb402UL, 0x1ba4fe5bUL, +0xa4b09f6bUL, 0x1ca815cfUL, 0xa20c3005UL, 0x8871df63UL, 0xb9de2fcbUL, 0x0cc6c9e9UL, +0x0beeff53UL, 0xe3214517UL, 0xb4542835UL, 0x9f63293cUL, 0xee41e729UL, 0x6e1d2d7cUL, +0x50045286UL, 0x1e6685f3UL, 0xf33401c6UL, 0x30a22c95UL, 0x31a70850UL, 0x60930f13UL, +0x73f98417UL, 0xa1269859UL, 0xec645c44UL, 0x52c877a9UL, 0xcdff33a6UL, 0xa02b1741UL, +0x7cbad9a2UL, 0x2180036fUL, 0x50d99c08UL, 0xcb3f4861UL, 0xc26bd765UL, 0x64a3f6abUL, +0x80342676UL, 0x25a75e7bUL, 0xe4e6d1fcUL, 0x20c710e6UL, 0xcdf0b680UL, 0x17844d3bUL, +0x31eef84dUL, 0x7e0824e4UL, 0x2ccb49ebUL, 0x846a3baeUL, 0x8ff77888UL, 0xee5d60f6UL, +0x7af75673UL, 0x2fdd5cdbUL, 0xa11631c1UL, 0x30f66f43UL, 0xb3faec54UL, 0x157fd7faUL, +0xef8579ccUL, 0xd152de58UL, 0xdb2ffd5eUL, 0x8f32ce19UL, 0x306af97aUL, 0x02f03ef8UL, +0x99319ad5UL, 0xc242fa0fUL, 0xa7e3ebb0UL, 0xc68e4906UL, 0xb8da230cUL, 0x80823028UL, +0xdcdef3c8UL, 0xd35fb171UL, 0x088a1bc8UL, 0xbec0c560UL, 0x61a3c9e8UL, 0xbca8f54dUL, +0xc72feffaUL, 0x22822e99UL, 0x82c570b4UL, 0xd8d94e89UL, 0x8b1c34bcUL, 0x301e16e6UL, +0x273be979UL, 0xb0ffeaa6UL, 0x61d9b8c6UL, 0x00b24869UL, 0xb7ffce3fUL, 0x08dc283bUL, +0x43daf65aUL, 0xf7e19798UL, 0x7619b72fUL, 0x8f1c9ba4UL, 0xdc8637a0UL, 0x16a7d3b1UL, +0x9fc393b7UL, 0xa7136eebUL, 0xc6bcc63eUL, 0x1a513742UL, 0xef6828bcUL, 0x520365d6UL, +0x2d6a77abUL, 0x3527ed4bUL, 0x821fd216UL, 0x095c6e2eUL, 0xdb92f2fbUL, 0x5eea29cbUL, +0x145892f5UL, 0x91584f7fUL, 0x5483697bUL, 0x2667a8ccUL, 0x85196048UL, 0x8c4baceaUL, +0x833860d4UL, 0x0d23e0f9UL, 0x6c387e8aUL, 0x0ae6d249UL, 0xb284600cUL, 0xd835731dUL, +0xdcb1c647UL, 0xac4c56eaUL, 0x3ebd81b3UL, 0x230eabb0UL, 0x6438bc87UL, 0xf0b5b1faUL, +0x8f5ea2b3UL, 0xfc184642UL, 0x0a036b7aUL, 0x4fb089bdUL, 0x649da589UL, 0xa345415eUL, +0x5c038323UL, 0x3e5d3bb9UL, 0x43d79572UL, 0x7e6dd07cUL, 0x06dfdf1eUL, 0x6c6cc4efUL, 0x7160a539UL, 0x73bfbe70UL, 0x83877605UL, 0x4523ecf1UL}; static const ulong32 S3[256] = { -0x8defc240UL, 0x25fa5d9fUL, 0xeb903dbfUL, 0xe810c907UL, 0x47607fffUL, 0x369fe44bUL, -0x8c1fc644UL, 0xaececa90UL, 0xbeb1f9bfUL, 0xeefbcaeaUL, 0xe8cf1950UL, 0x51df07aeUL, -0x920e8806UL, 0xf0ad0548UL, 0xe13c8d83UL, 0x927010d5UL, 0x11107d9fUL, 0x07647db9UL, -0xb2e3e4d4UL, 0x3d4f285eUL, 0xb9afa820UL, 0xfade82e0UL, 0xa067268bUL, 0x8272792eUL, -0x553fb2c0UL, 0x489ae22bUL, 0xd4ef9794UL, 0x125e3fbcUL, 0x21fffceeUL, 0x825b1bfdUL, -0x9255c5edUL, 0x1257a240UL, 0x4e1a8302UL, 0xbae07fffUL, 0x528246e7UL, 0x8e57140eUL, -0x3373f7bfUL, 0x8c9f8188UL, 0xa6fc4ee8UL, 0xc982b5a5UL, 0xa8c01db7UL, 0x579fc264UL, -0x67094f31UL, 0xf2bd3f5fUL, 0x40fff7c1UL, 0x1fb78dfcUL, 0x8e6bd2c1UL, 0x437be59bUL, -0x99b03dbfUL, 0xb5dbc64bUL, 0x638dc0e6UL, 0x55819d99UL, 0xa197c81cUL, 0x4a012d6eUL, -0xc5884a28UL, 0xccc36f71UL, 0xb843c213UL, 0x6c0743f1UL, 0x8309893cUL, 0x0feddd5fUL, -0x2f7fe850UL, 0xd7c07f7eUL, 0x02507fbfUL, 0x5afb9a04UL, 0xa747d2d0UL, 0x1651192eUL, -0xaf70bf3eUL, 0x58c31380UL, 0x5f98302eUL, 0x727cc3c4UL, 0x0a0fb402UL, 0x0f7fef82UL, -0x8c96fdadUL, 0x5d2c2aaeUL, 0x8ee99a49UL, 0x50da88b8UL, 0x8427f4a0UL, 0x1eac5790UL, -0x796fb449UL, 0x8252dc15UL, 0xefbd7d9bUL, 0xa672597dUL, 0xada840d8UL, 0x45f54504UL, -0xfa5d7403UL, 0xe83ec305UL, 0x4f91751aUL, 0x925669c2UL, 0x23efe941UL, 0xa903f12eUL, -0x60270df2UL, 0x0276e4b6UL, 0x94fd6574UL, 0x927985b2UL, 0x8276dbcbUL, 0x02778176UL, -0xf8af918dUL, 0x4e48f79eUL, 0x8f616ddfUL, 0xe29d840eUL, 0x842f7d83UL, 0x340ce5c8UL, -0x96bbb682UL, 0x93b4b148UL, 0xef303cabUL, 0x984faf28UL, 0x779faf9bUL, 0x92dc560dUL, -0x224d1e20UL, 0x8437aa88UL, 0x7d29dc96UL, 0x2756d3dcUL, 0x8b907ceeUL, 0xb51fd240UL, -0xe7c07ce3UL, 0xe566b4a1UL, 0xc3e9615eUL, 0x3cf8209dUL, 0x6094d1e3UL, 0xcd9ca341UL, -0x5c76460eUL, 0x00ea983bUL, 0xd4d67881UL, 0xfd47572cUL, 0xf76cedd9UL, 0xbda8229cUL, -0x127dadaaUL, 0x438a074eUL, 0x1f97c090UL, 0x081bdb8aUL, 0x93a07ebeUL, 0xb938ca15UL, -0x97b03cffUL, 0x3dc2c0f8UL, 0x8d1ab2ecUL, 0x64380e51UL, 0x68cc7bfbUL, 0xd90f2788UL, -0x12490181UL, 0x5de5ffd4UL, 0xdd7ef86aUL, 0x76a2e214UL, 0xb9a40368UL, 0x925d958fUL, -0x4b39fffaUL, 0xba39aee9UL, 0xa4ffd30bUL, 0xfaf7933bUL, 0x6d498623UL, 0x193cbcfaUL, -0x27627545UL, 0x825cf47aUL, 0x61bd8ba0UL, 0xd11e42d1UL, 0xcead04f4UL, 0x127ea392UL, -0x10428db7UL, 0x8272a972UL, 0x9270c4a8UL, 0x127de50bUL, 0x285ba1c8UL, 0x3c62f44fUL, -0x35c0eaa5UL, 0xe805d231UL, 0x428929fbUL, 0xb4fcdf82UL, 0x4fb66a53UL, 0x0e7dc15bUL, -0x1f081fabUL, 0x108618aeUL, 0xfcfd086dUL, 0xf9ff2889UL, 0x694bcc11UL, 0x236a5caeUL, -0x12deca4dUL, 0x2c3f8cc5UL, 0xd2d02dfeUL, 0xf8ef5896UL, 0xe4cf52daUL, 0x95155b67UL, -0x494a488cUL, 0xb9b6a80cUL, 0x5c8f82bcUL, 0x89d36b45UL, 0x3a609437UL, 0xec00c9a9UL, -0x44715253UL, 0x0a874b49UL, 0xd773bc40UL, 0x7c34671cUL, 0x02717ef6UL, 0x4feb5536UL, -0xa2d02fffUL, 0xd2bf60c4UL, 0xd43f03c0UL, 0x50b4ef6dUL, 0x07478cd1UL, 0x006e1888UL, -0xa2e53f55UL, 0xb9e6d4bcUL, 0xa2048016UL, 0x97573833UL, 0xd7207d67UL, 0xde0f8f3dUL, -0x72f87b33UL, 0xabcc4f33UL, 0x7688c55dUL, 0x7b00a6b0UL, 0x947b0001UL, 0x570075d2UL, -0xf9bb88f8UL, 0x8942019eUL, 0x4264a5ffUL, 0x856302e0UL, 0x72dbd92bUL, 0xee971b69UL, -0x6ea22fdeUL, 0x5f08ae2bUL, 0xaf7a616dUL, 0xe5c98767UL, 0xcf1febd2UL, 0x61efc8c2UL, -0xf1ac2571UL, 0xcc8239c2UL, 0x67214cb8UL, 0xb1e583d1UL, 0xb7dc3e62UL, 0x7f10bdceUL, -0xf90a5c38UL, 0x0ff0443dUL, 0x606e6dc6UL, 0x60543a49UL, 0x5727c148UL, 0x2be98a1dUL, -0x8ab41738UL, 0x20e1be24UL, 0xaf96da0fUL, 0x68458425UL, 0x99833be5UL, 0x600d457dUL, -0x282f9350UL, 0x8334b362UL, 0xd91d1120UL, 0x2b6d8da0UL, 0x642b1e31UL, 0x9c305a00UL, -0x52bce688UL, 0x1b03588aUL, 0xf7baefd5UL, 0x4142ed9cUL, 0xa4315c11UL, 0x83323ec5UL, +0x8defc240UL, 0x25fa5d9fUL, 0xeb903dbfUL, 0xe810c907UL, 0x47607fffUL, 0x369fe44bUL, +0x8c1fc644UL, 0xaececa90UL, 0xbeb1f9bfUL, 0xeefbcaeaUL, 0xe8cf1950UL, 0x51df07aeUL, +0x920e8806UL, 0xf0ad0548UL, 0xe13c8d83UL, 0x927010d5UL, 0x11107d9fUL, 0x07647db9UL, +0xb2e3e4d4UL, 0x3d4f285eUL, 0xb9afa820UL, 0xfade82e0UL, 0xa067268bUL, 0x8272792eUL, +0x553fb2c0UL, 0x489ae22bUL, 0xd4ef9794UL, 0x125e3fbcUL, 0x21fffceeUL, 0x825b1bfdUL, +0x9255c5edUL, 0x1257a240UL, 0x4e1a8302UL, 0xbae07fffUL, 0x528246e7UL, 0x8e57140eUL, +0x3373f7bfUL, 0x8c9f8188UL, 0xa6fc4ee8UL, 0xc982b5a5UL, 0xa8c01db7UL, 0x579fc264UL, +0x67094f31UL, 0xf2bd3f5fUL, 0x40fff7c1UL, 0x1fb78dfcUL, 0x8e6bd2c1UL, 0x437be59bUL, +0x99b03dbfUL, 0xb5dbc64bUL, 0x638dc0e6UL, 0x55819d99UL, 0xa197c81cUL, 0x4a012d6eUL, +0xc5884a28UL, 0xccc36f71UL, 0xb843c213UL, 0x6c0743f1UL, 0x8309893cUL, 0x0feddd5fUL, +0x2f7fe850UL, 0xd7c07f7eUL, 0x02507fbfUL, 0x5afb9a04UL, 0xa747d2d0UL, 0x1651192eUL, +0xaf70bf3eUL, 0x58c31380UL, 0x5f98302eUL, 0x727cc3c4UL, 0x0a0fb402UL, 0x0f7fef82UL, +0x8c96fdadUL, 0x5d2c2aaeUL, 0x8ee99a49UL, 0x50da88b8UL, 0x8427f4a0UL, 0x1eac5790UL, +0x796fb449UL, 0x8252dc15UL, 0xefbd7d9bUL, 0xa672597dUL, 0xada840d8UL, 0x45f54504UL, +0xfa5d7403UL, 0xe83ec305UL, 0x4f91751aUL, 0x925669c2UL, 0x23efe941UL, 0xa903f12eUL, +0x60270df2UL, 0x0276e4b6UL, 0x94fd6574UL, 0x927985b2UL, 0x8276dbcbUL, 0x02778176UL, +0xf8af918dUL, 0x4e48f79eUL, 0x8f616ddfUL, 0xe29d840eUL, 0x842f7d83UL, 0x340ce5c8UL, +0x96bbb682UL, 0x93b4b148UL, 0xef303cabUL, 0x984faf28UL, 0x779faf9bUL, 0x92dc560dUL, +0x224d1e20UL, 0x8437aa88UL, 0x7d29dc96UL, 0x2756d3dcUL, 0x8b907ceeUL, 0xb51fd240UL, +0xe7c07ce3UL, 0xe566b4a1UL, 0xc3e9615eUL, 0x3cf8209dUL, 0x6094d1e3UL, 0xcd9ca341UL, +0x5c76460eUL, 0x00ea983bUL, 0xd4d67881UL, 0xfd47572cUL, 0xf76cedd9UL, 0xbda8229cUL, +0x127dadaaUL, 0x438a074eUL, 0x1f97c090UL, 0x081bdb8aUL, 0x93a07ebeUL, 0xb938ca15UL, +0x97b03cffUL, 0x3dc2c0f8UL, 0x8d1ab2ecUL, 0x64380e51UL, 0x68cc7bfbUL, 0xd90f2788UL, +0x12490181UL, 0x5de5ffd4UL, 0xdd7ef86aUL, 0x76a2e214UL, 0xb9a40368UL, 0x925d958fUL, +0x4b39fffaUL, 0xba39aee9UL, 0xa4ffd30bUL, 0xfaf7933bUL, 0x6d498623UL, 0x193cbcfaUL, +0x27627545UL, 0x825cf47aUL, 0x61bd8ba0UL, 0xd11e42d1UL, 0xcead04f4UL, 0x127ea392UL, +0x10428db7UL, 0x8272a972UL, 0x9270c4a8UL, 0x127de50bUL, 0x285ba1c8UL, 0x3c62f44fUL, +0x35c0eaa5UL, 0xe805d231UL, 0x428929fbUL, 0xb4fcdf82UL, 0x4fb66a53UL, 0x0e7dc15bUL, +0x1f081fabUL, 0x108618aeUL, 0xfcfd086dUL, 0xf9ff2889UL, 0x694bcc11UL, 0x236a5caeUL, +0x12deca4dUL, 0x2c3f8cc5UL, 0xd2d02dfeUL, 0xf8ef5896UL, 0xe4cf52daUL, 0x95155b67UL, +0x494a488cUL, 0xb9b6a80cUL, 0x5c8f82bcUL, 0x89d36b45UL, 0x3a609437UL, 0xec00c9a9UL, +0x44715253UL, 0x0a874b49UL, 0xd773bc40UL, 0x7c34671cUL, 0x02717ef6UL, 0x4feb5536UL, +0xa2d02fffUL, 0xd2bf60c4UL, 0xd43f03c0UL, 0x50b4ef6dUL, 0x07478cd1UL, 0x006e1888UL, +0xa2e53f55UL, 0xb9e6d4bcUL, 0xa2048016UL, 0x97573833UL, 0xd7207d67UL, 0xde0f8f3dUL, +0x72f87b33UL, 0xabcc4f33UL, 0x7688c55dUL, 0x7b00a6b0UL, 0x947b0001UL, 0x570075d2UL, +0xf9bb88f8UL, 0x8942019eUL, 0x4264a5ffUL, 0x856302e0UL, 0x72dbd92bUL, 0xee971b69UL, +0x6ea22fdeUL, 0x5f08ae2bUL, 0xaf7a616dUL, 0xe5c98767UL, 0xcf1febd2UL, 0x61efc8c2UL, +0xf1ac2571UL, 0xcc8239c2UL, 0x67214cb8UL, 0xb1e583d1UL, 0xb7dc3e62UL, 0x7f10bdceUL, +0xf90a5c38UL, 0x0ff0443dUL, 0x606e6dc6UL, 0x60543a49UL, 0x5727c148UL, 0x2be98a1dUL, +0x8ab41738UL, 0x20e1be24UL, 0xaf96da0fUL, 0x68458425UL, 0x99833be5UL, 0x600d457dUL, +0x282f9350UL, 0x8334b362UL, 0xd91d1120UL, 0x2b6d8da0UL, 0x642b1e31UL, 0x9c305a00UL, +0x52bce688UL, 0x1b03588aUL, 0xf7baefd5UL, 0x4142ed9cUL, 0xa4315c11UL, 0x83323ec5UL, 0xdfef4636UL, 0xa133c501UL, 0xe9d3531cUL, 0xee353783UL}; static const ulong32 S4[256] = { -0x9db30420UL, 0x1fb6e9deUL, 0xa7be7befUL, 0xd273a298UL, 0x4a4f7bdbUL, 0x64ad8c57UL, -0x85510443UL, 0xfa020ed1UL, 0x7e287affUL, 0xe60fb663UL, 0x095f35a1UL, 0x79ebf120UL, -0xfd059d43UL, 0x6497b7b1UL, 0xf3641f63UL, 0x241e4adfUL, 0x28147f5fUL, 0x4fa2b8cdUL, -0xc9430040UL, 0x0cc32220UL, 0xfdd30b30UL, 0xc0a5374fUL, 0x1d2d00d9UL, 0x24147b15UL, -0xee4d111aUL, 0x0fca5167UL, 0x71ff904cUL, 0x2d195ffeUL, 0x1a05645fUL, 0x0c13fefeUL, -0x081b08caUL, 0x05170121UL, 0x80530100UL, 0xe83e5efeUL, 0xac9af4f8UL, 0x7fe72701UL, -0xd2b8ee5fUL, 0x06df4261UL, 0xbb9e9b8aUL, 0x7293ea25UL, 0xce84ffdfUL, 0xf5718801UL, -0x3dd64b04UL, 0xa26f263bUL, 0x7ed48400UL, 0x547eebe6UL, 0x446d4ca0UL, 0x6cf3d6f5UL, -0x2649abdfUL, 0xaea0c7f5UL, 0x36338cc1UL, 0x503f7e93UL, 0xd3772061UL, 0x11b638e1UL, -0x72500e03UL, 0xf80eb2bbUL, 0xabe0502eUL, 0xec8d77deUL, 0x57971e81UL, 0xe14f6746UL, -0xc9335400UL, 0x6920318fUL, 0x081dbb99UL, 0xffc304a5UL, 0x4d351805UL, 0x7f3d5ce3UL, -0xa6c866c6UL, 0x5d5bcca9UL, 0xdaec6feaUL, 0x9f926f91UL, 0x9f46222fUL, 0x3991467dUL, -0xa5bf6d8eUL, 0x1143c44fUL, 0x43958302UL, 0xd0214eebUL, 0x022083b8UL, 0x3fb6180cUL, -0x18f8931eUL, 0x281658e6UL, 0x26486e3eUL, 0x8bd78a70UL, 0x7477e4c1UL, 0xb506e07cUL, -0xf32d0a25UL, 0x79098b02UL, 0xe4eabb81UL, 0x28123b23UL, 0x69dead38UL, 0x1574ca16UL, -0xdf871b62UL, 0x211c40b7UL, 0xa51a9ef9UL, 0x0014377bUL, 0x041e8ac8UL, 0x09114003UL, -0xbd59e4d2UL, 0xe3d156d5UL, 0x4fe876d5UL, 0x2f91a340UL, 0x557be8deUL, 0x00eae4a7UL, -0x0ce5c2ecUL, 0x4db4bba6UL, 0xe756bdffUL, 0xdd3369acUL, 0xec17b035UL, 0x06572327UL, -0x99afc8b0UL, 0x56c8c391UL, 0x6b65811cUL, 0x5e146119UL, 0x6e85cb75UL, 0xbe07c002UL, -0xc2325577UL, 0x893ff4ecUL, 0x5bbfc92dUL, 0xd0ec3b25UL, 0xb7801ab7UL, 0x8d6d3b24UL, -0x20c763efUL, 0xc366a5fcUL, 0x9c382880UL, 0x0ace3205UL, 0xaac9548aUL, 0xeca1d7c7UL, -0x041afa32UL, 0x1d16625aUL, 0x6701902cUL, 0x9b757a54UL, 0x31d477f7UL, 0x9126b031UL, -0x36cc6fdbUL, 0xc70b8b46UL, 0xd9e66a48UL, 0x56e55a79UL, 0x026a4cebUL, 0x52437effUL, -0x2f8f76b4UL, 0x0df980a5UL, 0x8674cde3UL, 0xedda04ebUL, 0x17a9be04UL, 0x2c18f4dfUL, -0xb7747f9dUL, 0xab2af7b4UL, 0xefc34d20UL, 0x2e096b7cUL, 0x1741a254UL, 0xe5b6a035UL, -0x213d42f6UL, 0x2c1c7c26UL, 0x61c2f50fUL, 0x6552daf9UL, 0xd2c231f8UL, 0x25130f69UL, -0xd8167fa2UL, 0x0418f2c8UL, 0x001a96a6UL, 0x0d1526abUL, 0x63315c21UL, 0x5e0a72ecUL, -0x49bafefdUL, 0x187908d9UL, 0x8d0dbd86UL, 0x311170a7UL, 0x3e9b640cUL, 0xcc3e10d7UL, -0xd5cad3b6UL, 0x0caec388UL, 0xf73001e1UL, 0x6c728affUL, 0x71eae2a1UL, 0x1f9af36eUL, -0xcfcbd12fUL, 0xc1de8417UL, 0xac07be6bUL, 0xcb44a1d8UL, 0x8b9b0f56UL, 0x013988c3UL, -0xb1c52fcaUL, 0xb4be31cdUL, 0xd8782806UL, 0x12a3a4e2UL, 0x6f7de532UL, 0x58fd7eb6UL, -0xd01ee900UL, 0x24adffc2UL, 0xf4990fc5UL, 0x9711aac5UL, 0x001d7b95UL, 0x82e5e7d2UL, -0x109873f6UL, 0x00613096UL, 0xc32d9521UL, 0xada121ffUL, 0x29908415UL, 0x7fbb977fUL, -0xaf9eb3dbUL, 0x29c9ed2aUL, 0x5ce2a465UL, 0xa730f32cUL, 0xd0aa3fe8UL, 0x8a5cc091UL, -0xd49e2ce7UL, 0x0ce454a9UL, 0xd60acd86UL, 0x015f1919UL, 0x77079103UL, 0xdea03af6UL, -0x78a8565eUL, 0xdee356dfUL, 0x21f05cbeUL, 0x8b75e387UL, 0xb3c50651UL, 0xb8a5c3efUL, -0xd8eeb6d2UL, 0xe523be77UL, 0xc2154529UL, 0x2f69efdfUL, 0xafe67afbUL, 0xf470c4b2UL, -0xf3e0eb5bUL, 0xd6cc9876UL, 0x39e4460cUL, 0x1fda8538UL, 0x1987832fUL, 0xca007367UL, -0xa99144f8UL, 0x296b299eUL, 0x492fc295UL, 0x9266beabUL, 0xb5676e69UL, 0x9bd3dddaUL, -0xdf7e052fUL, 0xdb25701cUL, 0x1b5e51eeUL, 0xf65324e6UL, 0x6afce36cUL, 0x0316cc04UL, -0x8644213eUL, 0xb7dc59d0UL, 0x7965291fUL, 0xccd6fd43UL, 0x41823979UL, 0x932bcdf6UL, -0xb657c34dUL, 0x4edfd282UL, 0x7ae5290cUL, 0x3cb9536bUL, 0x851e20feUL, 0x9833557eUL, +0x9db30420UL, 0x1fb6e9deUL, 0xa7be7befUL, 0xd273a298UL, 0x4a4f7bdbUL, 0x64ad8c57UL, +0x85510443UL, 0xfa020ed1UL, 0x7e287affUL, 0xe60fb663UL, 0x095f35a1UL, 0x79ebf120UL, +0xfd059d43UL, 0x6497b7b1UL, 0xf3641f63UL, 0x241e4adfUL, 0x28147f5fUL, 0x4fa2b8cdUL, +0xc9430040UL, 0x0cc32220UL, 0xfdd30b30UL, 0xc0a5374fUL, 0x1d2d00d9UL, 0x24147b15UL, +0xee4d111aUL, 0x0fca5167UL, 0x71ff904cUL, 0x2d195ffeUL, 0x1a05645fUL, 0x0c13fefeUL, +0x081b08caUL, 0x05170121UL, 0x80530100UL, 0xe83e5efeUL, 0xac9af4f8UL, 0x7fe72701UL, +0xd2b8ee5fUL, 0x06df4261UL, 0xbb9e9b8aUL, 0x7293ea25UL, 0xce84ffdfUL, 0xf5718801UL, +0x3dd64b04UL, 0xa26f263bUL, 0x7ed48400UL, 0x547eebe6UL, 0x446d4ca0UL, 0x6cf3d6f5UL, +0x2649abdfUL, 0xaea0c7f5UL, 0x36338cc1UL, 0x503f7e93UL, 0xd3772061UL, 0x11b638e1UL, +0x72500e03UL, 0xf80eb2bbUL, 0xabe0502eUL, 0xec8d77deUL, 0x57971e81UL, 0xe14f6746UL, +0xc9335400UL, 0x6920318fUL, 0x081dbb99UL, 0xffc304a5UL, 0x4d351805UL, 0x7f3d5ce3UL, +0xa6c866c6UL, 0x5d5bcca9UL, 0xdaec6feaUL, 0x9f926f91UL, 0x9f46222fUL, 0x3991467dUL, +0xa5bf6d8eUL, 0x1143c44fUL, 0x43958302UL, 0xd0214eebUL, 0x022083b8UL, 0x3fb6180cUL, +0x18f8931eUL, 0x281658e6UL, 0x26486e3eUL, 0x8bd78a70UL, 0x7477e4c1UL, 0xb506e07cUL, +0xf32d0a25UL, 0x79098b02UL, 0xe4eabb81UL, 0x28123b23UL, 0x69dead38UL, 0x1574ca16UL, +0xdf871b62UL, 0x211c40b7UL, 0xa51a9ef9UL, 0x0014377bUL, 0x041e8ac8UL, 0x09114003UL, +0xbd59e4d2UL, 0xe3d156d5UL, 0x4fe876d5UL, 0x2f91a340UL, 0x557be8deUL, 0x00eae4a7UL, +0x0ce5c2ecUL, 0x4db4bba6UL, 0xe756bdffUL, 0xdd3369acUL, 0xec17b035UL, 0x06572327UL, +0x99afc8b0UL, 0x56c8c391UL, 0x6b65811cUL, 0x5e146119UL, 0x6e85cb75UL, 0xbe07c002UL, +0xc2325577UL, 0x893ff4ecUL, 0x5bbfc92dUL, 0xd0ec3b25UL, 0xb7801ab7UL, 0x8d6d3b24UL, +0x20c763efUL, 0xc366a5fcUL, 0x9c382880UL, 0x0ace3205UL, 0xaac9548aUL, 0xeca1d7c7UL, +0x041afa32UL, 0x1d16625aUL, 0x6701902cUL, 0x9b757a54UL, 0x31d477f7UL, 0x9126b031UL, +0x36cc6fdbUL, 0xc70b8b46UL, 0xd9e66a48UL, 0x56e55a79UL, 0x026a4cebUL, 0x52437effUL, +0x2f8f76b4UL, 0x0df980a5UL, 0x8674cde3UL, 0xedda04ebUL, 0x17a9be04UL, 0x2c18f4dfUL, +0xb7747f9dUL, 0xab2af7b4UL, 0xefc34d20UL, 0x2e096b7cUL, 0x1741a254UL, 0xe5b6a035UL, +0x213d42f6UL, 0x2c1c7c26UL, 0x61c2f50fUL, 0x6552daf9UL, 0xd2c231f8UL, 0x25130f69UL, +0xd8167fa2UL, 0x0418f2c8UL, 0x001a96a6UL, 0x0d1526abUL, 0x63315c21UL, 0x5e0a72ecUL, +0x49bafefdUL, 0x187908d9UL, 0x8d0dbd86UL, 0x311170a7UL, 0x3e9b640cUL, 0xcc3e10d7UL, +0xd5cad3b6UL, 0x0caec388UL, 0xf73001e1UL, 0x6c728affUL, 0x71eae2a1UL, 0x1f9af36eUL, +0xcfcbd12fUL, 0xc1de8417UL, 0xac07be6bUL, 0xcb44a1d8UL, 0x8b9b0f56UL, 0x013988c3UL, +0xb1c52fcaUL, 0xb4be31cdUL, 0xd8782806UL, 0x12a3a4e2UL, 0x6f7de532UL, 0x58fd7eb6UL, +0xd01ee900UL, 0x24adffc2UL, 0xf4990fc5UL, 0x9711aac5UL, 0x001d7b95UL, 0x82e5e7d2UL, +0x109873f6UL, 0x00613096UL, 0xc32d9521UL, 0xada121ffUL, 0x29908415UL, 0x7fbb977fUL, +0xaf9eb3dbUL, 0x29c9ed2aUL, 0x5ce2a465UL, 0xa730f32cUL, 0xd0aa3fe8UL, 0x8a5cc091UL, +0xd49e2ce7UL, 0x0ce454a9UL, 0xd60acd86UL, 0x015f1919UL, 0x77079103UL, 0xdea03af6UL, +0x78a8565eUL, 0xdee356dfUL, 0x21f05cbeUL, 0x8b75e387UL, 0xb3c50651UL, 0xb8a5c3efUL, +0xd8eeb6d2UL, 0xe523be77UL, 0xc2154529UL, 0x2f69efdfUL, 0xafe67afbUL, 0xf470c4b2UL, +0xf3e0eb5bUL, 0xd6cc9876UL, 0x39e4460cUL, 0x1fda8538UL, 0x1987832fUL, 0xca007367UL, +0xa99144f8UL, 0x296b299eUL, 0x492fc295UL, 0x9266beabUL, 0xb5676e69UL, 0x9bd3dddaUL, +0xdf7e052fUL, 0xdb25701cUL, 0x1b5e51eeUL, 0xf65324e6UL, 0x6afce36cUL, 0x0316cc04UL, +0x8644213eUL, 0xb7dc59d0UL, 0x7965291fUL, 0xccd6fd43UL, 0x41823979UL, 0x932bcdf6UL, +0xb657c34dUL, 0x4edfd282UL, 0x7ae5290cUL, 0x3cb9536bUL, 0x851e20feUL, 0x9833557eUL, 0x13ecf0b0UL, 0xd3ffb372UL, 0x3f85c5c1UL, 0x0aef7ed2UL}; static const ulong32 S5[256] = { -0x7ec90c04UL, 0x2c6e74b9UL, 0x9b0e66dfUL, 0xa6337911UL, 0xb86a7fffUL, 0x1dd358f5UL, -0x44dd9d44UL, 0x1731167fUL, 0x08fbf1faUL, 0xe7f511ccUL, 0xd2051b00UL, 0x735aba00UL, -0x2ab722d8UL, 0x386381cbUL, 0xacf6243aUL, 0x69befd7aUL, 0xe6a2e77fUL, 0xf0c720cdUL, -0xc4494816UL, 0xccf5c180UL, 0x38851640UL, 0x15b0a848UL, 0xe68b18cbUL, 0x4caadeffUL, -0x5f480a01UL, 0x0412b2aaUL, 0x259814fcUL, 0x41d0efe2UL, 0x4e40b48dUL, 0x248eb6fbUL, -0x8dba1cfeUL, 0x41a99b02UL, 0x1a550a04UL, 0xba8f65cbUL, 0x7251f4e7UL, 0x95a51725UL, -0xc106ecd7UL, 0x97a5980aUL, 0xc539b9aaUL, 0x4d79fe6aUL, 0xf2f3f763UL, 0x68af8040UL, -0xed0c9e56UL, 0x11b4958bUL, 0xe1eb5a88UL, 0x8709e6b0UL, 0xd7e07156UL, 0x4e29fea7UL, -0x6366e52dUL, 0x02d1c000UL, 0xc4ac8e05UL, 0x9377f571UL, 0x0c05372aUL, 0x578535f2UL, -0x2261be02UL, 0xd642a0c9UL, 0xdf13a280UL, 0x74b55bd2UL, 0x682199c0UL, 0xd421e5ecUL, -0x53fb3ce8UL, 0xc8adedb3UL, 0x28a87fc9UL, 0x3d959981UL, 0x5c1ff900UL, 0xfe38d399UL, -0x0c4eff0bUL, 0x062407eaUL, 0xaa2f4fb1UL, 0x4fb96976UL, 0x90c79505UL, 0xb0a8a774UL, -0xef55a1ffUL, 0xe59ca2c2UL, 0xa6b62d27UL, 0xe66a4263UL, 0xdf65001fUL, 0x0ec50966UL, -0xdfdd55bcUL, 0x29de0655UL, 0x911e739aUL, 0x17af8975UL, 0x32c7911cUL, 0x89f89468UL, -0x0d01e980UL, 0x524755f4UL, 0x03b63cc9UL, 0x0cc844b2UL, 0xbcf3f0aaUL, 0x87ac36e9UL, -0xe53a7426UL, 0x01b3d82bUL, 0x1a9e7449UL, 0x64ee2d7eUL, 0xcddbb1daUL, 0x01c94910UL, -0xb868bf80UL, 0x0d26f3fdUL, 0x9342ede7UL, 0x04a5c284UL, 0x636737b6UL, 0x50f5b616UL, -0xf24766e3UL, 0x8eca36c1UL, 0x136e05dbUL, 0xfef18391UL, 0xfb887a37UL, 0xd6e7f7d4UL, -0xc7fb7dc9UL, 0x3063fcdfUL, 0xb6f589deUL, 0xec2941daUL, 0x26e46695UL, 0xb7566419UL, -0xf654efc5UL, 0xd08d58b7UL, 0x48925401UL, 0xc1bacb7fUL, 0xe5ff550fUL, 0xb6083049UL, -0x5bb5d0e8UL, 0x87d72e5aUL, 0xab6a6ee1UL, 0x223a66ceUL, 0xc62bf3cdUL, 0x9e0885f9UL, -0x68cb3e47UL, 0x086c010fUL, 0xa21de820UL, 0xd18b69deUL, 0xf3f65777UL, 0xfa02c3f6UL, -0x407edac3UL, 0xcbb3d550UL, 0x1793084dUL, 0xb0d70ebaUL, 0x0ab378d5UL, 0xd951fb0cUL, -0xded7da56UL, 0x4124bbe4UL, 0x94ca0b56UL, 0x0f5755d1UL, 0xe0e1e56eUL, 0x6184b5beUL, -0x580a249fUL, 0x94f74bc0UL, 0xe327888eUL, 0x9f7b5561UL, 0xc3dc0280UL, 0x05687715UL, -0x646c6bd7UL, 0x44904db3UL, 0x66b4f0a3UL, 0xc0f1648aUL, 0x697ed5afUL, 0x49e92ff6UL, -0x309e374fUL, 0x2cb6356aUL, 0x85808573UL, 0x4991f840UL, 0x76f0ae02UL, 0x083be84dUL, -0x28421c9aUL, 0x44489406UL, 0x736e4cb8UL, 0xc1092910UL, 0x8bc95fc6UL, 0x7d869cf4UL, -0x134f616fUL, 0x2e77118dUL, 0xb31b2be1UL, 0xaa90b472UL, 0x3ca5d717UL, 0x7d161bbaUL, -0x9cad9010UL, 0xaf462ba2UL, 0x9fe459d2UL, 0x45d34559UL, 0xd9f2da13UL, 0xdbc65487UL, -0xf3e4f94eUL, 0x176d486fUL, 0x097c13eaUL, 0x631da5c7UL, 0x445f7382UL, 0x175683f4UL, -0xcdc66a97UL, 0x70be0288UL, 0xb3cdcf72UL, 0x6e5dd2f3UL, 0x20936079UL, 0x459b80a5UL, -0xbe60e2dbUL, 0xa9c23101UL, 0xeba5315cUL, 0x224e42f2UL, 0x1c5c1572UL, 0xf6721b2cUL, -0x1ad2fff3UL, 0x8c25404eUL, 0x324ed72fUL, 0x4067b7fdUL, 0x0523138eUL, 0x5ca3bc78UL, -0xdc0fd66eUL, 0x75922283UL, 0x784d6b17UL, 0x58ebb16eUL, 0x44094f85UL, 0x3f481d87UL, -0xfcfeae7bUL, 0x77b5ff76UL, 0x8c2302bfUL, 0xaaf47556UL, 0x5f46b02aUL, 0x2b092801UL, -0x3d38f5f7UL, 0x0ca81f36UL, 0x52af4a8aUL, 0x66d5e7c0UL, 0xdf3b0874UL, 0x95055110UL, -0x1b5ad7a8UL, 0xf61ed5adUL, 0x6cf6e479UL, 0x20758184UL, 0xd0cefa65UL, 0x88f7be58UL, -0x4a046826UL, 0x0ff6f8f3UL, 0xa09c7f70UL, 0x5346aba0UL, 0x5ce96c28UL, 0xe176eda3UL, -0x6bac307fUL, 0x376829d2UL, 0x85360fa9UL, 0x17e3fe2aUL, 0x24b79767UL, 0xf5a96b20UL, -0xd6cd2595UL, 0x68ff1ebfUL, 0x7555442cUL, 0xf19f06beUL, 0xf9e0659aUL, 0xeeb9491dUL, -0x34010718UL, 0xbb30cab8UL, 0xe822fe15UL, 0x88570983UL, 0x750e6249UL, 0xda627e55UL, +0x7ec90c04UL, 0x2c6e74b9UL, 0x9b0e66dfUL, 0xa6337911UL, 0xb86a7fffUL, 0x1dd358f5UL, +0x44dd9d44UL, 0x1731167fUL, 0x08fbf1faUL, 0xe7f511ccUL, 0xd2051b00UL, 0x735aba00UL, +0x2ab722d8UL, 0x386381cbUL, 0xacf6243aUL, 0x69befd7aUL, 0xe6a2e77fUL, 0xf0c720cdUL, +0xc4494816UL, 0xccf5c180UL, 0x38851640UL, 0x15b0a848UL, 0xe68b18cbUL, 0x4caadeffUL, +0x5f480a01UL, 0x0412b2aaUL, 0x259814fcUL, 0x41d0efe2UL, 0x4e40b48dUL, 0x248eb6fbUL, +0x8dba1cfeUL, 0x41a99b02UL, 0x1a550a04UL, 0xba8f65cbUL, 0x7251f4e7UL, 0x95a51725UL, +0xc106ecd7UL, 0x97a5980aUL, 0xc539b9aaUL, 0x4d79fe6aUL, 0xf2f3f763UL, 0x68af8040UL, +0xed0c9e56UL, 0x11b4958bUL, 0xe1eb5a88UL, 0x8709e6b0UL, 0xd7e07156UL, 0x4e29fea7UL, +0x6366e52dUL, 0x02d1c000UL, 0xc4ac8e05UL, 0x9377f571UL, 0x0c05372aUL, 0x578535f2UL, +0x2261be02UL, 0xd642a0c9UL, 0xdf13a280UL, 0x74b55bd2UL, 0x682199c0UL, 0xd421e5ecUL, +0x53fb3ce8UL, 0xc8adedb3UL, 0x28a87fc9UL, 0x3d959981UL, 0x5c1ff900UL, 0xfe38d399UL, +0x0c4eff0bUL, 0x062407eaUL, 0xaa2f4fb1UL, 0x4fb96976UL, 0x90c79505UL, 0xb0a8a774UL, +0xef55a1ffUL, 0xe59ca2c2UL, 0xa6b62d27UL, 0xe66a4263UL, 0xdf65001fUL, 0x0ec50966UL, +0xdfdd55bcUL, 0x29de0655UL, 0x911e739aUL, 0x17af8975UL, 0x32c7911cUL, 0x89f89468UL, +0x0d01e980UL, 0x524755f4UL, 0x03b63cc9UL, 0x0cc844b2UL, 0xbcf3f0aaUL, 0x87ac36e9UL, +0xe53a7426UL, 0x01b3d82bUL, 0x1a9e7449UL, 0x64ee2d7eUL, 0xcddbb1daUL, 0x01c94910UL, +0xb868bf80UL, 0x0d26f3fdUL, 0x9342ede7UL, 0x04a5c284UL, 0x636737b6UL, 0x50f5b616UL, +0xf24766e3UL, 0x8eca36c1UL, 0x136e05dbUL, 0xfef18391UL, 0xfb887a37UL, 0xd6e7f7d4UL, +0xc7fb7dc9UL, 0x3063fcdfUL, 0xb6f589deUL, 0xec2941daUL, 0x26e46695UL, 0xb7566419UL, +0xf654efc5UL, 0xd08d58b7UL, 0x48925401UL, 0xc1bacb7fUL, 0xe5ff550fUL, 0xb6083049UL, +0x5bb5d0e8UL, 0x87d72e5aUL, 0xab6a6ee1UL, 0x223a66ceUL, 0xc62bf3cdUL, 0x9e0885f9UL, +0x68cb3e47UL, 0x086c010fUL, 0xa21de820UL, 0xd18b69deUL, 0xf3f65777UL, 0xfa02c3f6UL, +0x407edac3UL, 0xcbb3d550UL, 0x1793084dUL, 0xb0d70ebaUL, 0x0ab378d5UL, 0xd951fb0cUL, +0xded7da56UL, 0x4124bbe4UL, 0x94ca0b56UL, 0x0f5755d1UL, 0xe0e1e56eUL, 0x6184b5beUL, +0x580a249fUL, 0x94f74bc0UL, 0xe327888eUL, 0x9f7b5561UL, 0xc3dc0280UL, 0x05687715UL, +0x646c6bd7UL, 0x44904db3UL, 0x66b4f0a3UL, 0xc0f1648aUL, 0x697ed5afUL, 0x49e92ff6UL, +0x309e374fUL, 0x2cb6356aUL, 0x85808573UL, 0x4991f840UL, 0x76f0ae02UL, 0x083be84dUL, +0x28421c9aUL, 0x44489406UL, 0x736e4cb8UL, 0xc1092910UL, 0x8bc95fc6UL, 0x7d869cf4UL, +0x134f616fUL, 0x2e77118dUL, 0xb31b2be1UL, 0xaa90b472UL, 0x3ca5d717UL, 0x7d161bbaUL, +0x9cad9010UL, 0xaf462ba2UL, 0x9fe459d2UL, 0x45d34559UL, 0xd9f2da13UL, 0xdbc65487UL, +0xf3e4f94eUL, 0x176d486fUL, 0x097c13eaUL, 0x631da5c7UL, 0x445f7382UL, 0x175683f4UL, +0xcdc66a97UL, 0x70be0288UL, 0xb3cdcf72UL, 0x6e5dd2f3UL, 0x20936079UL, 0x459b80a5UL, +0xbe60e2dbUL, 0xa9c23101UL, 0xeba5315cUL, 0x224e42f2UL, 0x1c5c1572UL, 0xf6721b2cUL, +0x1ad2fff3UL, 0x8c25404eUL, 0x324ed72fUL, 0x4067b7fdUL, 0x0523138eUL, 0x5ca3bc78UL, +0xdc0fd66eUL, 0x75922283UL, 0x784d6b17UL, 0x58ebb16eUL, 0x44094f85UL, 0x3f481d87UL, +0xfcfeae7bUL, 0x77b5ff76UL, 0x8c2302bfUL, 0xaaf47556UL, 0x5f46b02aUL, 0x2b092801UL, +0x3d38f5f7UL, 0x0ca81f36UL, 0x52af4a8aUL, 0x66d5e7c0UL, 0xdf3b0874UL, 0x95055110UL, +0x1b5ad7a8UL, 0xf61ed5adUL, 0x6cf6e479UL, 0x20758184UL, 0xd0cefa65UL, 0x88f7be58UL, +0x4a046826UL, 0x0ff6f8f3UL, 0xa09c7f70UL, 0x5346aba0UL, 0x5ce96c28UL, 0xe176eda3UL, +0x6bac307fUL, 0x376829d2UL, 0x85360fa9UL, 0x17e3fe2aUL, 0x24b79767UL, 0xf5a96b20UL, +0xd6cd2595UL, 0x68ff1ebfUL, 0x7555442cUL, 0xf19f06beUL, 0xf9e0659aUL, 0xeeb9491dUL, +0x34010718UL, 0xbb30cab8UL, 0xe822fe15UL, 0x88570983UL, 0x750e6249UL, 0xda627e55UL, 0x5e76ffa8UL, 0xb1534546UL, 0x6d47de08UL, 0xefe9e7d4UL}; static const ulong32 S6[256] = { -0xf6fa8f9dUL, 0x2cac6ce1UL, 0x4ca34867UL, 0xe2337f7cUL, 0x95db08e7UL, 0x016843b4UL, -0xeced5cbcUL, 0x325553acUL, 0xbf9f0960UL, 0xdfa1e2edUL, 0x83f0579dUL, 0x63ed86b9UL, -0x1ab6a6b8UL, 0xde5ebe39UL, 0xf38ff732UL, 0x8989b138UL, 0x33f14961UL, 0xc01937bdUL, -0xf506c6daUL, 0xe4625e7eUL, 0xa308ea99UL, 0x4e23e33cUL, 0x79cbd7ccUL, 0x48a14367UL, -0xa3149619UL, 0xfec94bd5UL, 0xa114174aUL, 0xeaa01866UL, 0xa084db2dUL, 0x09a8486fUL, -0xa888614aUL, 0x2900af98UL, 0x01665991UL, 0xe1992863UL, 0xc8f30c60UL, 0x2e78ef3cUL, -0xd0d51932UL, 0xcf0fec14UL, 0xf7ca07d2UL, 0xd0a82072UL, 0xfd41197eUL, 0x9305a6b0UL, -0xe86be3daUL, 0x74bed3cdUL, 0x372da53cUL, 0x4c7f4448UL, 0xdab5d440UL, 0x6dba0ec3UL, -0x083919a7UL, 0x9fbaeed9UL, 0x49dbcfb0UL, 0x4e670c53UL, 0x5c3d9c01UL, 0x64bdb941UL, -0x2c0e636aUL, 0xba7dd9cdUL, 0xea6f7388UL, 0xe70bc762UL, 0x35f29adbUL, 0x5c4cdd8dUL, -0xf0d48d8cUL, 0xb88153e2UL, 0x08a19866UL, 0x1ae2eac8UL, 0x284caf89UL, 0xaa928223UL, -0x9334be53UL, 0x3b3a21bfUL, 0x16434be3UL, 0x9aea3906UL, 0xefe8c36eUL, 0xf890cdd9UL, -0x80226daeUL, 0xc340a4a3UL, 0xdf7e9c09UL, 0xa694a807UL, 0x5b7c5eccUL, 0x221db3a6UL, -0x9a69a02fUL, 0x68818a54UL, 0xceb2296fUL, 0x53c0843aUL, 0xfe893655UL, 0x25bfe68aUL, -0xb4628abcUL, 0xcf222ebfUL, 0x25ac6f48UL, 0xa9a99387UL, 0x53bddb65UL, 0xe76ffbe7UL, -0xe967fd78UL, 0x0ba93563UL, 0x8e342bc1UL, 0xe8a11be9UL, 0x4980740dUL, 0xc8087dfcUL, -0x8de4bf99UL, 0xa11101a0UL, 0x7fd37975UL, 0xda5a26c0UL, 0xe81f994fUL, 0x9528cd89UL, -0xfd339fedUL, 0xb87834bfUL, 0x5f04456dUL, 0x22258698UL, 0xc9c4c83bUL, 0x2dc156beUL, -0x4f628daaUL, 0x57f55ec5UL, 0xe2220abeUL, 0xd2916ebfUL, 0x4ec75b95UL, 0x24f2c3c0UL, -0x42d15d99UL, 0xcd0d7fa0UL, 0x7b6e27ffUL, 0xa8dc8af0UL, 0x7345c106UL, 0xf41e232fUL, -0x35162386UL, 0xe6ea8926UL, 0x3333b094UL, 0x157ec6f2UL, 0x372b74afUL, 0x692573e4UL, -0xe9a9d848UL, 0xf3160289UL, 0x3a62ef1dUL, 0xa787e238UL, 0xf3a5f676UL, 0x74364853UL, -0x20951063UL, 0x4576698dUL, 0xb6fad407UL, 0x592af950UL, 0x36f73523UL, 0x4cfb6e87UL, -0x7da4cec0UL, 0x6c152daaUL, 0xcb0396a8UL, 0xc50dfe5dUL, 0xfcd707abUL, 0x0921c42fUL, -0x89dff0bbUL, 0x5fe2be78UL, 0x448f4f33UL, 0x754613c9UL, 0x2b05d08dUL, 0x48b9d585UL, -0xdc049441UL, 0xc8098f9bUL, 0x7dede786UL, 0xc39a3373UL, 0x42410005UL, 0x6a091751UL, -0x0ef3c8a6UL, 0x890072d6UL, 0x28207682UL, 0xa9a9f7beUL, 0xbf32679dUL, 0xd45b5b75UL, -0xb353fd00UL, 0xcbb0e358UL, 0x830f220aUL, 0x1f8fb214UL, 0xd372cf08UL, 0xcc3c4a13UL, -0x8cf63166UL, 0x061c87beUL, 0x88c98f88UL, 0x6062e397UL, 0x47cf8e7aUL, 0xb6c85283UL, -0x3cc2acfbUL, 0x3fc06976UL, 0x4e8f0252UL, 0x64d8314dUL, 0xda3870e3UL, 0x1e665459UL, -0xc10908f0UL, 0x513021a5UL, 0x6c5b68b7UL, 0x822f8aa0UL, 0x3007cd3eUL, 0x74719eefUL, -0xdc872681UL, 0x073340d4UL, 0x7e432fd9UL, 0x0c5ec241UL, 0x8809286cUL, 0xf592d891UL, -0x08a930f6UL, 0x957ef305UL, 0xb7fbffbdUL, 0xc266e96fUL, 0x6fe4ac98UL, 0xb173ecc0UL, -0xbc60b42aUL, 0x953498daUL, 0xfba1ae12UL, 0x2d4bd736UL, 0x0f25faabUL, 0xa4f3fcebUL, -0xe2969123UL, 0x257f0c3dUL, 0x9348af49UL, 0x361400bcUL, 0xe8816f4aUL, 0x3814f200UL, -0xa3f94043UL, 0x9c7a54c2UL, 0xbc704f57UL, 0xda41e7f9UL, 0xc25ad33aUL, 0x54f4a084UL, -0xb17f5505UL, 0x59357cbeUL, 0xedbd15c8UL, 0x7f97c5abUL, 0xba5ac7b5UL, 0xb6f6deafUL, -0x3a479c3aUL, 0x5302da25UL, 0x653d7e6aUL, 0x54268d49UL, 0x51a477eaUL, 0x5017d55bUL, -0xd7d25d88UL, 0x44136c76UL, 0x0404a8c8UL, 0xb8e5a121UL, 0xb81a928aUL, 0x60ed5869UL, -0x97c55b96UL, 0xeaec991bUL, 0x29935913UL, 0x01fdb7f1UL, 0x088e8dfaUL, 0x9ab6f6f5UL, -0x3b4cbf9fUL, 0x4a5de3abUL, 0xe6051d35UL, 0xa0e1d855UL, 0xd36b4cf1UL, 0xf544edebUL, -0xb0e93524UL, 0xbebb8fbdUL, 0xa2d762cfUL, 0x49c92f54UL, 0x38b5f331UL, 0x7128a454UL, +0xf6fa8f9dUL, 0x2cac6ce1UL, 0x4ca34867UL, 0xe2337f7cUL, 0x95db08e7UL, 0x016843b4UL, +0xeced5cbcUL, 0x325553acUL, 0xbf9f0960UL, 0xdfa1e2edUL, 0x83f0579dUL, 0x63ed86b9UL, +0x1ab6a6b8UL, 0xde5ebe39UL, 0xf38ff732UL, 0x8989b138UL, 0x33f14961UL, 0xc01937bdUL, +0xf506c6daUL, 0xe4625e7eUL, 0xa308ea99UL, 0x4e23e33cUL, 0x79cbd7ccUL, 0x48a14367UL, +0xa3149619UL, 0xfec94bd5UL, 0xa114174aUL, 0xeaa01866UL, 0xa084db2dUL, 0x09a8486fUL, +0xa888614aUL, 0x2900af98UL, 0x01665991UL, 0xe1992863UL, 0xc8f30c60UL, 0x2e78ef3cUL, +0xd0d51932UL, 0xcf0fec14UL, 0xf7ca07d2UL, 0xd0a82072UL, 0xfd41197eUL, 0x9305a6b0UL, +0xe86be3daUL, 0x74bed3cdUL, 0x372da53cUL, 0x4c7f4448UL, 0xdab5d440UL, 0x6dba0ec3UL, +0x083919a7UL, 0x9fbaeed9UL, 0x49dbcfb0UL, 0x4e670c53UL, 0x5c3d9c01UL, 0x64bdb941UL, +0x2c0e636aUL, 0xba7dd9cdUL, 0xea6f7388UL, 0xe70bc762UL, 0x35f29adbUL, 0x5c4cdd8dUL, +0xf0d48d8cUL, 0xb88153e2UL, 0x08a19866UL, 0x1ae2eac8UL, 0x284caf89UL, 0xaa928223UL, +0x9334be53UL, 0x3b3a21bfUL, 0x16434be3UL, 0x9aea3906UL, 0xefe8c36eUL, 0xf890cdd9UL, +0x80226daeUL, 0xc340a4a3UL, 0xdf7e9c09UL, 0xa694a807UL, 0x5b7c5eccUL, 0x221db3a6UL, +0x9a69a02fUL, 0x68818a54UL, 0xceb2296fUL, 0x53c0843aUL, 0xfe893655UL, 0x25bfe68aUL, +0xb4628abcUL, 0xcf222ebfUL, 0x25ac6f48UL, 0xa9a99387UL, 0x53bddb65UL, 0xe76ffbe7UL, +0xe967fd78UL, 0x0ba93563UL, 0x8e342bc1UL, 0xe8a11be9UL, 0x4980740dUL, 0xc8087dfcUL, +0x8de4bf99UL, 0xa11101a0UL, 0x7fd37975UL, 0xda5a26c0UL, 0xe81f994fUL, 0x9528cd89UL, +0xfd339fedUL, 0xb87834bfUL, 0x5f04456dUL, 0x22258698UL, 0xc9c4c83bUL, 0x2dc156beUL, +0x4f628daaUL, 0x57f55ec5UL, 0xe2220abeUL, 0xd2916ebfUL, 0x4ec75b95UL, 0x24f2c3c0UL, +0x42d15d99UL, 0xcd0d7fa0UL, 0x7b6e27ffUL, 0xa8dc8af0UL, 0x7345c106UL, 0xf41e232fUL, +0x35162386UL, 0xe6ea8926UL, 0x3333b094UL, 0x157ec6f2UL, 0x372b74afUL, 0x692573e4UL, +0xe9a9d848UL, 0xf3160289UL, 0x3a62ef1dUL, 0xa787e238UL, 0xf3a5f676UL, 0x74364853UL, +0x20951063UL, 0x4576698dUL, 0xb6fad407UL, 0x592af950UL, 0x36f73523UL, 0x4cfb6e87UL, +0x7da4cec0UL, 0x6c152daaUL, 0xcb0396a8UL, 0xc50dfe5dUL, 0xfcd707abUL, 0x0921c42fUL, +0x89dff0bbUL, 0x5fe2be78UL, 0x448f4f33UL, 0x754613c9UL, 0x2b05d08dUL, 0x48b9d585UL, +0xdc049441UL, 0xc8098f9bUL, 0x7dede786UL, 0xc39a3373UL, 0x42410005UL, 0x6a091751UL, +0x0ef3c8a6UL, 0x890072d6UL, 0x28207682UL, 0xa9a9f7beUL, 0xbf32679dUL, 0xd45b5b75UL, +0xb353fd00UL, 0xcbb0e358UL, 0x830f220aUL, 0x1f8fb214UL, 0xd372cf08UL, 0xcc3c4a13UL, +0x8cf63166UL, 0x061c87beUL, 0x88c98f88UL, 0x6062e397UL, 0x47cf8e7aUL, 0xb6c85283UL, +0x3cc2acfbUL, 0x3fc06976UL, 0x4e8f0252UL, 0x64d8314dUL, 0xda3870e3UL, 0x1e665459UL, +0xc10908f0UL, 0x513021a5UL, 0x6c5b68b7UL, 0x822f8aa0UL, 0x3007cd3eUL, 0x74719eefUL, +0xdc872681UL, 0x073340d4UL, 0x7e432fd9UL, 0x0c5ec241UL, 0x8809286cUL, 0xf592d891UL, +0x08a930f6UL, 0x957ef305UL, 0xb7fbffbdUL, 0xc266e96fUL, 0x6fe4ac98UL, 0xb173ecc0UL, +0xbc60b42aUL, 0x953498daUL, 0xfba1ae12UL, 0x2d4bd736UL, 0x0f25faabUL, 0xa4f3fcebUL, +0xe2969123UL, 0x257f0c3dUL, 0x9348af49UL, 0x361400bcUL, 0xe8816f4aUL, 0x3814f200UL, +0xa3f94043UL, 0x9c7a54c2UL, 0xbc704f57UL, 0xda41e7f9UL, 0xc25ad33aUL, 0x54f4a084UL, +0xb17f5505UL, 0x59357cbeUL, 0xedbd15c8UL, 0x7f97c5abUL, 0xba5ac7b5UL, 0xb6f6deafUL, +0x3a479c3aUL, 0x5302da25UL, 0x653d7e6aUL, 0x54268d49UL, 0x51a477eaUL, 0x5017d55bUL, +0xd7d25d88UL, 0x44136c76UL, 0x0404a8c8UL, 0xb8e5a121UL, 0xb81a928aUL, 0x60ed5869UL, +0x97c55b96UL, 0xeaec991bUL, 0x29935913UL, 0x01fdb7f1UL, 0x088e8dfaUL, 0x9ab6f6f5UL, +0x3b4cbf9fUL, 0x4a5de3abUL, 0xe6051d35UL, 0xa0e1d855UL, 0xd36b4cf1UL, 0xf544edebUL, +0xb0e93524UL, 0xbebb8fbdUL, 0xa2d762cfUL, 0x49c92f54UL, 0x38b5f331UL, 0x7128a454UL, 0x48392905UL, 0xa65b1db8UL, 0x851c97bdUL, 0xd675cf2fUL}; static const ulong32 S7[256] = { -0x85e04019UL, 0x332bf567UL, 0x662dbfffUL, 0xcfc65693UL, 0x2a8d7f6fUL, 0xab9bc912UL, -0xde6008a1UL, 0x2028da1fUL, 0x0227bce7UL, 0x4d642916UL, 0x18fac300UL, 0x50f18b82UL, -0x2cb2cb11UL, 0xb232e75cUL, 0x4b3695f2UL, 0xb28707deUL, 0xa05fbcf6UL, 0xcd4181e9UL, -0xe150210cUL, 0xe24ef1bdUL, 0xb168c381UL, 0xfde4e789UL, 0x5c79b0d8UL, 0x1e8bfd43UL, -0x4d495001UL, 0x38be4341UL, 0x913cee1dUL, 0x92a79c3fUL, 0x089766beUL, 0xbaeeadf4UL, -0x1286becfUL, 0xb6eacb19UL, 0x2660c200UL, 0x7565bde4UL, 0x64241f7aUL, 0x8248dca9UL, -0xc3b3ad66UL, 0x28136086UL, 0x0bd8dfa8UL, 0x356d1cf2UL, 0x107789beUL, 0xb3b2e9ceUL, -0x0502aa8fUL, 0x0bc0351eUL, 0x166bf52aUL, 0xeb12ff82UL, 0xe3486911UL, 0xd34d7516UL, -0x4e7b3affUL, 0x5f43671bUL, 0x9cf6e037UL, 0x4981ac83UL, 0x334266ceUL, 0x8c9341b7UL, -0xd0d854c0UL, 0xcb3a6c88UL, 0x47bc2829UL, 0x4725ba37UL, 0xa66ad22bUL, 0x7ad61f1eUL, -0x0c5cbafaUL, 0x4437f107UL, 0xb6e79962UL, 0x42d2d816UL, 0x0a961288UL, 0xe1a5c06eUL, -0x13749e67UL, 0x72fc081aUL, 0xb1d139f7UL, 0xf9583745UL, 0xcf19df58UL, 0xbec3f756UL, -0xc06eba30UL, 0x07211b24UL, 0x45c28829UL, 0xc95e317fUL, 0xbc8ec511UL, 0x38bc46e9UL, -0xc6e6fa14UL, 0xbae8584aUL, 0xad4ebc46UL, 0x468f508bUL, 0x7829435fUL, 0xf124183bUL, -0x821dba9fUL, 0xaff60ff4UL, 0xea2c4e6dUL, 0x16e39264UL, 0x92544a8bUL, 0x009b4fc3UL, -0xaba68cedUL, 0x9ac96f78UL, 0x06a5b79aUL, 0xb2856e6eUL, 0x1aec3ca9UL, 0xbe838688UL, -0x0e0804e9UL, 0x55f1be56UL, 0xe7e5363bUL, 0xb3a1f25dUL, 0xf7debb85UL, 0x61fe033cUL, -0x16746233UL, 0x3c034c28UL, 0xda6d0c74UL, 0x79aac56cUL, 0x3ce4e1adUL, 0x51f0c802UL, -0x98f8f35aUL, 0x1626a49fUL, 0xeed82b29UL, 0x1d382fe3UL, 0x0c4fb99aUL, 0xbb325778UL, -0x3ec6d97bUL, 0x6e77a6a9UL, 0xcb658b5cUL, 0xd45230c7UL, 0x2bd1408bUL, 0x60c03eb7UL, -0xb9068d78UL, 0xa33754f4UL, 0xf430c87dUL, 0xc8a71302UL, 0xb96d8c32UL, 0xebd4e7beUL, -0xbe8b9d2dUL, 0x7979fb06UL, 0xe7225308UL, 0x8b75cf77UL, 0x11ef8da4UL, 0xe083c858UL, -0x8d6b786fUL, 0x5a6317a6UL, 0xfa5cf7a0UL, 0x5dda0033UL, 0xf28ebfb0UL, 0xf5b9c310UL, -0xa0eac280UL, 0x08b9767aUL, 0xa3d9d2b0UL, 0x79d34217UL, 0x021a718dUL, 0x9ac6336aUL, -0x2711fd60UL, 0x438050e3UL, 0x069908a8UL, 0x3d7fedc4UL, 0x826d2befUL, 0x4eeb8476UL, -0x488dcf25UL, 0x36c9d566UL, 0x28e74e41UL, 0xc2610acaUL, 0x3d49a9cfUL, 0xbae3b9dfUL, -0xb65f8de6UL, 0x92aeaf64UL, 0x3ac7d5e6UL, 0x9ea80509UL, 0xf22b017dUL, 0xa4173f70UL, -0xdd1e16c3UL, 0x15e0d7f9UL, 0x50b1b887UL, 0x2b9f4fd5UL, 0x625aba82UL, 0x6a017962UL, -0x2ec01b9cUL, 0x15488aa9UL, 0xd716e740UL, 0x40055a2cUL, 0x93d29a22UL, 0xe32dbf9aUL, -0x058745b9UL, 0x3453dc1eUL, 0xd699296eUL, 0x496cff6fUL, 0x1c9f4986UL, 0xdfe2ed07UL, -0xb87242d1UL, 0x19de7eaeUL, 0x053e561aUL, 0x15ad6f8cUL, 0x66626c1cUL, 0x7154c24cUL, -0xea082b2aUL, 0x93eb2939UL, 0x17dcb0f0UL, 0x58d4f2aeUL, 0x9ea294fbUL, 0x52cf564cUL, -0x9883fe66UL, 0x2ec40581UL, 0x763953c3UL, 0x01d6692eUL, 0xd3a0c108UL, 0xa1e7160eUL, -0xe4f2dfa6UL, 0x693ed285UL, 0x74904698UL, 0x4c2b0eddUL, 0x4f757656UL, 0x5d393378UL, -0xa132234fUL, 0x3d321c5dUL, 0xc3f5e194UL, 0x4b269301UL, 0xc79f022fUL, 0x3c997e7eUL, -0x5e4f9504UL, 0x3ffafbbdUL, 0x76f7ad0eUL, 0x296693f4UL, 0x3d1fce6fUL, 0xc61e45beUL, -0xd3b5ab34UL, 0xf72bf9b7UL, 0x1b0434c0UL, 0x4e72b567UL, 0x5592a33dUL, 0xb5229301UL, -0xcfd2a87fUL, 0x60aeb767UL, 0x1814386bUL, 0x30bcc33dUL, 0x38a0c07dUL, 0xfd1606f2UL, -0xc363519bUL, 0x589dd390UL, 0x5479f8e6UL, 0x1cb8d647UL, 0x97fd61a9UL, 0xea7759f4UL, -0x2d57539dUL, 0x569a58cfUL, 0xe84e63adUL, 0x462e1b78UL, 0x6580f87eUL, 0xf3817914UL, -0x91da55f4UL, 0x40a230f3UL, 0xd1988f35UL, 0xb6e318d2UL, 0x3ffa50bcUL, 0x3d40f021UL, -0xc3c0bdaeUL, 0x4958c24cUL, 0x518f36b2UL, 0x84b1d370UL, 0x0fedce83UL, 0x878ddadaUL, +0x85e04019UL, 0x332bf567UL, 0x662dbfffUL, 0xcfc65693UL, 0x2a8d7f6fUL, 0xab9bc912UL, +0xde6008a1UL, 0x2028da1fUL, 0x0227bce7UL, 0x4d642916UL, 0x18fac300UL, 0x50f18b82UL, +0x2cb2cb11UL, 0xb232e75cUL, 0x4b3695f2UL, 0xb28707deUL, 0xa05fbcf6UL, 0xcd4181e9UL, +0xe150210cUL, 0xe24ef1bdUL, 0xb168c381UL, 0xfde4e789UL, 0x5c79b0d8UL, 0x1e8bfd43UL, +0x4d495001UL, 0x38be4341UL, 0x913cee1dUL, 0x92a79c3fUL, 0x089766beUL, 0xbaeeadf4UL, +0x1286becfUL, 0xb6eacb19UL, 0x2660c200UL, 0x7565bde4UL, 0x64241f7aUL, 0x8248dca9UL, +0xc3b3ad66UL, 0x28136086UL, 0x0bd8dfa8UL, 0x356d1cf2UL, 0x107789beUL, 0xb3b2e9ceUL, +0x0502aa8fUL, 0x0bc0351eUL, 0x166bf52aUL, 0xeb12ff82UL, 0xe3486911UL, 0xd34d7516UL, +0x4e7b3affUL, 0x5f43671bUL, 0x9cf6e037UL, 0x4981ac83UL, 0x334266ceUL, 0x8c9341b7UL, +0xd0d854c0UL, 0xcb3a6c88UL, 0x47bc2829UL, 0x4725ba37UL, 0xa66ad22bUL, 0x7ad61f1eUL, +0x0c5cbafaUL, 0x4437f107UL, 0xb6e79962UL, 0x42d2d816UL, 0x0a961288UL, 0xe1a5c06eUL, +0x13749e67UL, 0x72fc081aUL, 0xb1d139f7UL, 0xf9583745UL, 0xcf19df58UL, 0xbec3f756UL, +0xc06eba30UL, 0x07211b24UL, 0x45c28829UL, 0xc95e317fUL, 0xbc8ec511UL, 0x38bc46e9UL, +0xc6e6fa14UL, 0xbae8584aUL, 0xad4ebc46UL, 0x468f508bUL, 0x7829435fUL, 0xf124183bUL, +0x821dba9fUL, 0xaff60ff4UL, 0xea2c4e6dUL, 0x16e39264UL, 0x92544a8bUL, 0x009b4fc3UL, +0xaba68cedUL, 0x9ac96f78UL, 0x06a5b79aUL, 0xb2856e6eUL, 0x1aec3ca9UL, 0xbe838688UL, +0x0e0804e9UL, 0x55f1be56UL, 0xe7e5363bUL, 0xb3a1f25dUL, 0xf7debb85UL, 0x61fe033cUL, +0x16746233UL, 0x3c034c28UL, 0xda6d0c74UL, 0x79aac56cUL, 0x3ce4e1adUL, 0x51f0c802UL, +0x98f8f35aUL, 0x1626a49fUL, 0xeed82b29UL, 0x1d382fe3UL, 0x0c4fb99aUL, 0xbb325778UL, +0x3ec6d97bUL, 0x6e77a6a9UL, 0xcb658b5cUL, 0xd45230c7UL, 0x2bd1408bUL, 0x60c03eb7UL, +0xb9068d78UL, 0xa33754f4UL, 0xf430c87dUL, 0xc8a71302UL, 0xb96d8c32UL, 0xebd4e7beUL, +0xbe8b9d2dUL, 0x7979fb06UL, 0xe7225308UL, 0x8b75cf77UL, 0x11ef8da4UL, 0xe083c858UL, +0x8d6b786fUL, 0x5a6317a6UL, 0xfa5cf7a0UL, 0x5dda0033UL, 0xf28ebfb0UL, 0xf5b9c310UL, +0xa0eac280UL, 0x08b9767aUL, 0xa3d9d2b0UL, 0x79d34217UL, 0x021a718dUL, 0x9ac6336aUL, +0x2711fd60UL, 0x438050e3UL, 0x069908a8UL, 0x3d7fedc4UL, 0x826d2befUL, 0x4eeb8476UL, +0x488dcf25UL, 0x36c9d566UL, 0x28e74e41UL, 0xc2610acaUL, 0x3d49a9cfUL, 0xbae3b9dfUL, +0xb65f8de6UL, 0x92aeaf64UL, 0x3ac7d5e6UL, 0x9ea80509UL, 0xf22b017dUL, 0xa4173f70UL, +0xdd1e16c3UL, 0x15e0d7f9UL, 0x50b1b887UL, 0x2b9f4fd5UL, 0x625aba82UL, 0x6a017962UL, +0x2ec01b9cUL, 0x15488aa9UL, 0xd716e740UL, 0x40055a2cUL, 0x93d29a22UL, 0xe32dbf9aUL, +0x058745b9UL, 0x3453dc1eUL, 0xd699296eUL, 0x496cff6fUL, 0x1c9f4986UL, 0xdfe2ed07UL, +0xb87242d1UL, 0x19de7eaeUL, 0x053e561aUL, 0x15ad6f8cUL, 0x66626c1cUL, 0x7154c24cUL, +0xea082b2aUL, 0x93eb2939UL, 0x17dcb0f0UL, 0x58d4f2aeUL, 0x9ea294fbUL, 0x52cf564cUL, +0x9883fe66UL, 0x2ec40581UL, 0x763953c3UL, 0x01d6692eUL, 0xd3a0c108UL, 0xa1e7160eUL, +0xe4f2dfa6UL, 0x693ed285UL, 0x74904698UL, 0x4c2b0eddUL, 0x4f757656UL, 0x5d393378UL, +0xa132234fUL, 0x3d321c5dUL, 0xc3f5e194UL, 0x4b269301UL, 0xc79f022fUL, 0x3c997e7eUL, +0x5e4f9504UL, 0x3ffafbbdUL, 0x76f7ad0eUL, 0x296693f4UL, 0x3d1fce6fUL, 0xc61e45beUL, +0xd3b5ab34UL, 0xf72bf9b7UL, 0x1b0434c0UL, 0x4e72b567UL, 0x5592a33dUL, 0xb5229301UL, +0xcfd2a87fUL, 0x60aeb767UL, 0x1814386bUL, 0x30bcc33dUL, 0x38a0c07dUL, 0xfd1606f2UL, +0xc363519bUL, 0x589dd390UL, 0x5479f8e6UL, 0x1cb8d647UL, 0x97fd61a9UL, 0xea7759f4UL, +0x2d57539dUL, 0x569a58cfUL, 0xe84e63adUL, 0x462e1b78UL, 0x6580f87eUL, 0xf3817914UL, +0x91da55f4UL, 0x40a230f3UL, 0xd1988f35UL, 0xb6e318d2UL, 0x3ffa50bcUL, 0x3d40f021UL, +0xc3c0bdaeUL, 0x4958c24cUL, 0x518f36b2UL, 0x84b1d370UL, 0x0fedce83UL, 0x878ddadaUL, 0xf2a279c7UL, 0x94e01be8UL, 0x90716f4bUL, 0x954b8aa3UL}; static const ulong32 S8[256] = { -0xe216300dUL, 0xbbddfffcUL, 0xa7ebdabdUL, 0x35648095UL, 0x7789f8b7UL, 0xe6c1121bUL, -0x0e241600UL, 0x052ce8b5UL, 0x11a9cfb0UL, 0xe5952f11UL, 0xece7990aUL, 0x9386d174UL, -0x2a42931cUL, 0x76e38111UL, 0xb12def3aUL, 0x37ddddfcUL, 0xde9adeb1UL, 0x0a0cc32cUL, -0xbe197029UL, 0x84a00940UL, 0xbb243a0fUL, 0xb4d137cfUL, 0xb44e79f0UL, 0x049eedfdUL, -0x0b15a15dUL, 0x480d3168UL, 0x8bbbde5aUL, 0x669ded42UL, 0xc7ece831UL, 0x3f8f95e7UL, -0x72df191bUL, 0x7580330dUL, 0x94074251UL, 0x5c7dcdfaUL, 0xabbe6d63UL, 0xaa402164UL, -0xb301d40aUL, 0x02e7d1caUL, 0x53571daeUL, 0x7a3182a2UL, 0x12a8ddecUL, 0xfdaa335dUL, -0x176f43e8UL, 0x71fb46d4UL, 0x38129022UL, 0xce949ad4UL, 0xb84769adUL, 0x965bd862UL, -0x82f3d055UL, 0x66fb9767UL, 0x15b80b4eUL, 0x1d5b47a0UL, 0x4cfde06fUL, 0xc28ec4b8UL, -0x57e8726eUL, 0x647a78fcUL, 0x99865d44UL, 0x608bd593UL, 0x6c200e03UL, 0x39dc5ff6UL, -0x5d0b00a3UL, 0xae63aff2UL, 0x7e8bd632UL, 0x70108c0cUL, 0xbbd35049UL, 0x2998df04UL, -0x980cf42aUL, 0x9b6df491UL, 0x9e7edd53UL, 0x06918548UL, 0x58cb7e07UL, 0x3b74ef2eUL, -0x522fffb1UL, 0xd24708ccUL, 0x1c7e27cdUL, 0xa4eb215bUL, 0x3cf1d2e2UL, 0x19b47a38UL, -0x424f7618UL, 0x35856039UL, 0x9d17dee7UL, 0x27eb35e6UL, 0xc9aff67bUL, 0x36baf5b8UL, -0x09c467cdUL, 0xc18910b1UL, 0xe11dbf7bUL, 0x06cd1af8UL, 0x7170c608UL, 0x2d5e3354UL, -0xd4de495aUL, 0x64c6d006UL, 0xbcc0c62cUL, 0x3dd00db3UL, 0x708f8f34UL, 0x77d51b42UL, -0x264f620fUL, 0x24b8d2bfUL, 0x15c1b79eUL, 0x46a52564UL, 0xf8d7e54eUL, 0x3e378160UL, -0x7895cda5UL, 0x859c15a5UL, 0xe6459788UL, 0xc37bc75fUL, 0xdb07ba0cUL, 0x0676a3abUL, -0x7f229b1eUL, 0x31842e7bUL, 0x24259fd7UL, 0xf8bef472UL, 0x835ffcb8UL, 0x6df4c1f2UL, -0x96f5b195UL, 0xfd0af0fcUL, 0xb0fe134cUL, 0xe2506d3dUL, 0x4f9b12eaUL, 0xf215f225UL, -0xa223736fUL, 0x9fb4c428UL, 0x25d04979UL, 0x34c713f8UL, 0xc4618187UL, 0xea7a6e98UL, -0x7cd16efcUL, 0x1436876cUL, 0xf1544107UL, 0xbedeee14UL, 0x56e9af27UL, 0xa04aa441UL, -0x3cf7c899UL, 0x92ecbae6UL, 0xdd67016dUL, 0x151682ebUL, 0xa842eedfUL, 0xfdba60b4UL, -0xf1907b75UL, 0x20e3030fUL, 0x24d8c29eUL, 0xe139673bUL, 0xefa63fb8UL, 0x71873054UL, -0xb6f2cf3bUL, 0x9f326442UL, 0xcb15a4ccUL, 0xb01a4504UL, 0xf1e47d8dUL, 0x844a1be5UL, -0xbae7dfdcUL, 0x42cbda70UL, 0xcd7dae0aUL, 0x57e85b7aUL, 0xd53f5af6UL, 0x20cf4d8cUL, -0xcea4d428UL, 0x79d130a4UL, 0x3486ebfbUL, 0x33d3cddcUL, 0x77853b53UL, 0x37effcb5UL, -0xc5068778UL, 0xe580b3e6UL, 0x4e68b8f4UL, 0xc5c8b37eUL, 0x0d809ea2UL, 0x398feb7cUL, -0x132a4f94UL, 0x43b7950eUL, 0x2fee7d1cUL, 0x223613bdUL, 0xdd06caa2UL, 0x37df932bUL, -0xc4248289UL, 0xacf3ebc3UL, 0x5715f6b7UL, 0xef3478ddUL, 0xf267616fUL, 0xc148cbe4UL, -0x9052815eUL, 0x5e410fabUL, 0xb48a2465UL, 0x2eda7fa4UL, 0xe87b40e4UL, 0xe98ea084UL, -0x5889e9e1UL, 0xefd390fcUL, 0xdd07d35bUL, 0xdb485694UL, 0x38d7e5b2UL, 0x57720101UL, -0x730edebcUL, 0x5b643113UL, 0x94917e4fUL, 0x503c2fbaUL, 0x646f1282UL, 0x7523d24aUL, -0xe0779695UL, 0xf9c17a8fUL, 0x7a5b2121UL, 0xd187b896UL, 0x29263a4dUL, 0xba510cdfUL, -0x81f47c9fUL, 0xad1163edUL, 0xea7b5965UL, 0x1a00726eUL, 0x11403092UL, 0x00da6d77UL, -0x4a0cdd61UL, 0xad1f4603UL, 0x605bdfb0UL, 0x9eedc364UL, 0x22ebe6a8UL, 0xcee7d28aUL, -0xa0e736a0UL, 0x5564a6b9UL, 0x10853209UL, 0xc7eb8f37UL, 0x2de705caUL, 0x8951570fUL, -0xdf09822bUL, 0xbd691a6cUL, 0xaa12e4f2UL, 0x87451c0fUL, 0xe0f6a27aUL, 0x3ada4819UL, -0x4cf1764fUL, 0x0d771c2bUL, 0x67cdb156UL, 0x350d8384UL, 0x5938fa0fUL, 0x42399ef3UL, -0x36997b07UL, 0x0e84093dUL, 0x4aa93e61UL, 0x8360d87bUL, 0x1fa98b0cUL, 0x1149382cUL, -0xe97625a5UL, 0x0614d1b7UL, 0x0e25244bUL, 0x0c768347UL, 0x589e8d82UL, 0x0d2059d1UL, -0xa466bb1eUL, 0xf8da0a82UL, 0x04f19130UL, 0xba6e4ec0UL, 0x99265164UL, 0x1ee7230dUL, +0xe216300dUL, 0xbbddfffcUL, 0xa7ebdabdUL, 0x35648095UL, 0x7789f8b7UL, 0xe6c1121bUL, +0x0e241600UL, 0x052ce8b5UL, 0x11a9cfb0UL, 0xe5952f11UL, 0xece7990aUL, 0x9386d174UL, +0x2a42931cUL, 0x76e38111UL, 0xb12def3aUL, 0x37ddddfcUL, 0xde9adeb1UL, 0x0a0cc32cUL, +0xbe197029UL, 0x84a00940UL, 0xbb243a0fUL, 0xb4d137cfUL, 0xb44e79f0UL, 0x049eedfdUL, +0x0b15a15dUL, 0x480d3168UL, 0x8bbbde5aUL, 0x669ded42UL, 0xc7ece831UL, 0x3f8f95e7UL, +0x72df191bUL, 0x7580330dUL, 0x94074251UL, 0x5c7dcdfaUL, 0xabbe6d63UL, 0xaa402164UL, +0xb301d40aUL, 0x02e7d1caUL, 0x53571daeUL, 0x7a3182a2UL, 0x12a8ddecUL, 0xfdaa335dUL, +0x176f43e8UL, 0x71fb46d4UL, 0x38129022UL, 0xce949ad4UL, 0xb84769adUL, 0x965bd862UL, +0x82f3d055UL, 0x66fb9767UL, 0x15b80b4eUL, 0x1d5b47a0UL, 0x4cfde06fUL, 0xc28ec4b8UL, +0x57e8726eUL, 0x647a78fcUL, 0x99865d44UL, 0x608bd593UL, 0x6c200e03UL, 0x39dc5ff6UL, +0x5d0b00a3UL, 0xae63aff2UL, 0x7e8bd632UL, 0x70108c0cUL, 0xbbd35049UL, 0x2998df04UL, +0x980cf42aUL, 0x9b6df491UL, 0x9e7edd53UL, 0x06918548UL, 0x58cb7e07UL, 0x3b74ef2eUL, +0x522fffb1UL, 0xd24708ccUL, 0x1c7e27cdUL, 0xa4eb215bUL, 0x3cf1d2e2UL, 0x19b47a38UL, +0x424f7618UL, 0x35856039UL, 0x9d17dee7UL, 0x27eb35e6UL, 0xc9aff67bUL, 0x36baf5b8UL, +0x09c467cdUL, 0xc18910b1UL, 0xe11dbf7bUL, 0x06cd1af8UL, 0x7170c608UL, 0x2d5e3354UL, +0xd4de495aUL, 0x64c6d006UL, 0xbcc0c62cUL, 0x3dd00db3UL, 0x708f8f34UL, 0x77d51b42UL, +0x264f620fUL, 0x24b8d2bfUL, 0x15c1b79eUL, 0x46a52564UL, 0xf8d7e54eUL, 0x3e378160UL, +0x7895cda5UL, 0x859c15a5UL, 0xe6459788UL, 0xc37bc75fUL, 0xdb07ba0cUL, 0x0676a3abUL, +0x7f229b1eUL, 0x31842e7bUL, 0x24259fd7UL, 0xf8bef472UL, 0x835ffcb8UL, 0x6df4c1f2UL, +0x96f5b195UL, 0xfd0af0fcUL, 0xb0fe134cUL, 0xe2506d3dUL, 0x4f9b12eaUL, 0xf215f225UL, +0xa223736fUL, 0x9fb4c428UL, 0x25d04979UL, 0x34c713f8UL, 0xc4618187UL, 0xea7a6e98UL, +0x7cd16efcUL, 0x1436876cUL, 0xf1544107UL, 0xbedeee14UL, 0x56e9af27UL, 0xa04aa441UL, +0x3cf7c899UL, 0x92ecbae6UL, 0xdd67016dUL, 0x151682ebUL, 0xa842eedfUL, 0xfdba60b4UL, +0xf1907b75UL, 0x20e3030fUL, 0x24d8c29eUL, 0xe139673bUL, 0xefa63fb8UL, 0x71873054UL, +0xb6f2cf3bUL, 0x9f326442UL, 0xcb15a4ccUL, 0xb01a4504UL, 0xf1e47d8dUL, 0x844a1be5UL, +0xbae7dfdcUL, 0x42cbda70UL, 0xcd7dae0aUL, 0x57e85b7aUL, 0xd53f5af6UL, 0x20cf4d8cUL, +0xcea4d428UL, 0x79d130a4UL, 0x3486ebfbUL, 0x33d3cddcUL, 0x77853b53UL, 0x37effcb5UL, +0xc5068778UL, 0xe580b3e6UL, 0x4e68b8f4UL, 0xc5c8b37eUL, 0x0d809ea2UL, 0x398feb7cUL, +0x132a4f94UL, 0x43b7950eUL, 0x2fee7d1cUL, 0x223613bdUL, 0xdd06caa2UL, 0x37df932bUL, +0xc4248289UL, 0xacf3ebc3UL, 0x5715f6b7UL, 0xef3478ddUL, 0xf267616fUL, 0xc148cbe4UL, +0x9052815eUL, 0x5e410fabUL, 0xb48a2465UL, 0x2eda7fa4UL, 0xe87b40e4UL, 0xe98ea084UL, +0x5889e9e1UL, 0xefd390fcUL, 0xdd07d35bUL, 0xdb485694UL, 0x38d7e5b2UL, 0x57720101UL, +0x730edebcUL, 0x5b643113UL, 0x94917e4fUL, 0x503c2fbaUL, 0x646f1282UL, 0x7523d24aUL, +0xe0779695UL, 0xf9c17a8fUL, 0x7a5b2121UL, 0xd187b896UL, 0x29263a4dUL, 0xba510cdfUL, +0x81f47c9fUL, 0xad1163edUL, 0xea7b5965UL, 0x1a00726eUL, 0x11403092UL, 0x00da6d77UL, +0x4a0cdd61UL, 0xad1f4603UL, 0x605bdfb0UL, 0x9eedc364UL, 0x22ebe6a8UL, 0xcee7d28aUL, +0xa0e736a0UL, 0x5564a6b9UL, 0x10853209UL, 0xc7eb8f37UL, 0x2de705caUL, 0x8951570fUL, +0xdf09822bUL, 0xbd691a6cUL, 0xaa12e4f2UL, 0x87451c0fUL, 0xe0f6a27aUL, 0x3ada4819UL, +0x4cf1764fUL, 0x0d771c2bUL, 0x67cdb156UL, 0x350d8384UL, 0x5938fa0fUL, 0x42399ef3UL, +0x36997b07UL, 0x0e84093dUL, 0x4aa93e61UL, 0x8360d87bUL, 0x1fa98b0cUL, 0x1149382cUL, +0xe97625a5UL, 0x0614d1b7UL, 0x0e25244bUL, 0x0c768347UL, 0x589e8d82UL, 0x0d2059d1UL, +0xa466bb1eUL, 0xf8da0a82UL, 0x04f19130UL, 0xba6e4ec0UL, 0x99265164UL, 0x1ee7230dUL, 0x50b2ad80UL, 0xeaee6801UL, 0x8db2a283UL, 0xea8bf59eUL}; /* returns the i'th byte of a variable */ #ifdef _MSC_VER #define GB(x, i) ((unsigned char)((x[(15-i)>>2])>>(unsigned)(8*((15-i)&3)))) -#else +#else #define GB(x, i) (((x[(15-i)>>2])>>(unsigned)(8*((15-i)&3)))&255) -#endif +#endif /** Initialize the LTC_CAST5 block cipher @@ -419,9 +419,9 @@ int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ LTC_ARGCHK(skey != NULL); if (num_rounds != 12 && num_rounds != 16 && num_rounds != 0) { - return CRYPT_INVALID_ROUNDS; + return CRYPT_INVALID_ROUNDS; } - + if (num_rounds == 12 && keylen > 10) { return CRYPT_INVALID_ROUNDS; } @@ -484,7 +484,7 @@ int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ zeromem(buf, sizeof(buf)); zeromem(x, sizeof(x)); zeromem(z, sizeof(z)); -#endif +#endif return CRYPT_OK; } @@ -502,9 +502,9 @@ int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ #ifdef _MSC_VER #define INLINE __inline #else - #define INLINE -#endif - + #define INLINE +#endif + INLINE static ulong32 FI(ulong32 R, ulong32 Km, ulong32 Kr) { ulong32 I; @@ -512,7 +512,7 @@ INLINE static ulong32 FI(ulong32 R, ulong32 Km, ulong32 Kr) I = ROL(I, Kr); return ((S1[byte(I, 3)] ^ S2[byte(I,2)]) - S3[byte(I,1)]) + S4[byte(I,0)]; } - + INLINE static ulong32 FII(ulong32 R, ulong32 Km, ulong32 Kr) { ulong32 I; @@ -547,7 +547,7 @@ int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - LOAD32H(L,&pt[0]); + LOAD32H(L,&pt[0]); LOAD32H(R,&pt[4]); L ^= FI(R, skey->cast5.K[0], skey->cast5.K[16]); R ^= FII(L, skey->cast5.K[1], skey->cast5.K[17]); @@ -586,7 +586,7 @@ int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key Decrypts a block of text with LTC_CAST5 @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled */ #ifdef LTC_CLEAN_STACK static int _cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -600,7 +600,7 @@ int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); - LOAD32H(R,&ct[0]); + LOAD32H(R,&ct[0]); LOAD32H(L,&ct[4]); if (skey->cast5.keylen > 10) { R ^= FI(L, skey->cast5.K[15], skey->cast5.K[31]); @@ -643,7 +643,7 @@ int cast5_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { int keylen; unsigned char key[16]; @@ -684,13 +684,13 @@ int cast5_test(void) for (y = 0; y < 1000; y++) cast5_ecb_encrypt(tmp[0], tmp[0], &key); for (y = 0; y < 1000; y++) cast5_ecb_decrypt(tmp[0], tmp[0], &key); for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; - + } return CRYPT_OK; #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void cast5_done(symmetric_key *skey) @@ -711,7 +711,7 @@ int cast5_keysize(int *keysize) *keysize = 16; } return CRYPT_OK; -} +} #endif diff --git a/src/ciphers/des.c b/src/ciphers/des.c index 0034c8014..fa1991e93 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -10,14 +10,14 @@ */ #include "tomcrypt.h" -/** +/** @file des.c - LTC_DES code submitted by Dobes Vandermeer + LTC_DES code submitted by Dobes Vandermeer */ #ifdef LTC_DES -#define EN0 0 +#define EN0 0 #define DE1 1 const struct ltc_cipher_descriptor des_desc = @@ -50,7 +50,7 @@ const struct ltc_cipher_descriptor des3_desc = static const ulong32 bytebit[8] = { - 0200, 0100, 040, 020, 010, 04, 02, 01 + 0200, 0100, 040, 020, 010, 04, 02, 01 }; static const ulong32 bigbyte[24] = @@ -60,22 +60,22 @@ static const ulong32 bigbyte[24] = 0x8000UL, 0x4000UL, 0x2000UL, 0x1000UL, 0x800UL, 0x400UL, 0x200UL, 0x100UL, 0x80UL, 0x40UL, 0x20UL, 0x10UL, - 0x8UL, 0x4UL, 0x2UL, 0x1L + 0x8UL, 0x4UL, 0x2UL, 0x1L }; /* Use the key schedule specific in the standard (ANSI X3.92-1981) */ static const unsigned char pc1[56] = { - 56, 48, 40, 32, 24, 16, 8, 0, 57, 49, 41, 33, 25, 17, - 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, + 56, 48, 40, 32, 24, 16, 8, 0, 57, 49, 41, 33, 25, 17, + 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, - 13, 5, 60, 52, 44, 36, 28, 20, 12, 4, 27, 19, 11, 3 + 13, 5, 60, 52, 44, 36, 28, 20, 12, 4, 27, 19, 11, 3 }; static const unsigned char totrot[16] = { 1, 2, 4, 6, - 8, 10, 12, 14, - 15, 17, 19, 21, + 8, 10, 12, 14, + 15, 17, 19, 21, 23, 25, 27, 28 }; @@ -251,1050 +251,1050 @@ static const ulong32 SP8[64] = static const ulong64 des_ip[8][256] = { -{ CONST64(0x0000000000000000), CONST64(0x0000001000000000), CONST64(0x0000000000000010), CONST64(0x0000001000000010), - CONST64(0x0000100000000000), CONST64(0x0000101000000000), CONST64(0x0000100000000010), CONST64(0x0000101000000010), - CONST64(0x0000000000001000), CONST64(0x0000001000001000), CONST64(0x0000000000001010), CONST64(0x0000001000001010), - CONST64(0x0000100000001000), CONST64(0x0000101000001000), CONST64(0x0000100000001010), CONST64(0x0000101000001010), - CONST64(0x0010000000000000), CONST64(0x0010001000000000), CONST64(0x0010000000000010), CONST64(0x0010001000000010), - CONST64(0x0010100000000000), CONST64(0x0010101000000000), CONST64(0x0010100000000010), CONST64(0x0010101000000010), - CONST64(0x0010000000001000), CONST64(0x0010001000001000), CONST64(0x0010000000001010), CONST64(0x0010001000001010), - CONST64(0x0010100000001000), CONST64(0x0010101000001000), CONST64(0x0010100000001010), CONST64(0x0010101000001010), - CONST64(0x0000000000100000), CONST64(0x0000001000100000), CONST64(0x0000000000100010), CONST64(0x0000001000100010), - CONST64(0x0000100000100000), CONST64(0x0000101000100000), CONST64(0x0000100000100010), CONST64(0x0000101000100010), - CONST64(0x0000000000101000), CONST64(0x0000001000101000), CONST64(0x0000000000101010), CONST64(0x0000001000101010), - CONST64(0x0000100000101000), CONST64(0x0000101000101000), CONST64(0x0000100000101010), CONST64(0x0000101000101010), - CONST64(0x0010000000100000), CONST64(0x0010001000100000), CONST64(0x0010000000100010), CONST64(0x0010001000100010), - CONST64(0x0010100000100000), CONST64(0x0010101000100000), CONST64(0x0010100000100010), CONST64(0x0010101000100010), - CONST64(0x0010000000101000), CONST64(0x0010001000101000), CONST64(0x0010000000101010), CONST64(0x0010001000101010), - CONST64(0x0010100000101000), CONST64(0x0010101000101000), CONST64(0x0010100000101010), CONST64(0x0010101000101010), - CONST64(0x1000000000000000), CONST64(0x1000001000000000), CONST64(0x1000000000000010), CONST64(0x1000001000000010), - CONST64(0x1000100000000000), CONST64(0x1000101000000000), CONST64(0x1000100000000010), CONST64(0x1000101000000010), - CONST64(0x1000000000001000), CONST64(0x1000001000001000), CONST64(0x1000000000001010), CONST64(0x1000001000001010), - CONST64(0x1000100000001000), CONST64(0x1000101000001000), CONST64(0x1000100000001010), CONST64(0x1000101000001010), - CONST64(0x1010000000000000), CONST64(0x1010001000000000), CONST64(0x1010000000000010), CONST64(0x1010001000000010), - CONST64(0x1010100000000000), CONST64(0x1010101000000000), CONST64(0x1010100000000010), CONST64(0x1010101000000010), - CONST64(0x1010000000001000), CONST64(0x1010001000001000), CONST64(0x1010000000001010), CONST64(0x1010001000001010), - CONST64(0x1010100000001000), CONST64(0x1010101000001000), CONST64(0x1010100000001010), CONST64(0x1010101000001010), - CONST64(0x1000000000100000), CONST64(0x1000001000100000), CONST64(0x1000000000100010), CONST64(0x1000001000100010), - CONST64(0x1000100000100000), CONST64(0x1000101000100000), CONST64(0x1000100000100010), CONST64(0x1000101000100010), - CONST64(0x1000000000101000), CONST64(0x1000001000101000), CONST64(0x1000000000101010), CONST64(0x1000001000101010), - CONST64(0x1000100000101000), CONST64(0x1000101000101000), CONST64(0x1000100000101010), CONST64(0x1000101000101010), - CONST64(0x1010000000100000), CONST64(0x1010001000100000), CONST64(0x1010000000100010), CONST64(0x1010001000100010), - CONST64(0x1010100000100000), CONST64(0x1010101000100000), CONST64(0x1010100000100010), CONST64(0x1010101000100010), - CONST64(0x1010000000101000), CONST64(0x1010001000101000), CONST64(0x1010000000101010), CONST64(0x1010001000101010), - CONST64(0x1010100000101000), CONST64(0x1010101000101000), CONST64(0x1010100000101010), CONST64(0x1010101000101010), - CONST64(0x0000000010000000), CONST64(0x0000001010000000), CONST64(0x0000000010000010), CONST64(0x0000001010000010), - CONST64(0x0000100010000000), CONST64(0x0000101010000000), CONST64(0x0000100010000010), CONST64(0x0000101010000010), - CONST64(0x0000000010001000), CONST64(0x0000001010001000), CONST64(0x0000000010001010), CONST64(0x0000001010001010), - CONST64(0x0000100010001000), CONST64(0x0000101010001000), CONST64(0x0000100010001010), CONST64(0x0000101010001010), - CONST64(0x0010000010000000), CONST64(0x0010001010000000), CONST64(0x0010000010000010), CONST64(0x0010001010000010), - CONST64(0x0010100010000000), CONST64(0x0010101010000000), CONST64(0x0010100010000010), CONST64(0x0010101010000010), - CONST64(0x0010000010001000), CONST64(0x0010001010001000), CONST64(0x0010000010001010), CONST64(0x0010001010001010), - CONST64(0x0010100010001000), CONST64(0x0010101010001000), CONST64(0x0010100010001010), CONST64(0x0010101010001010), - CONST64(0x0000000010100000), CONST64(0x0000001010100000), CONST64(0x0000000010100010), CONST64(0x0000001010100010), - CONST64(0x0000100010100000), CONST64(0x0000101010100000), CONST64(0x0000100010100010), CONST64(0x0000101010100010), - CONST64(0x0000000010101000), CONST64(0x0000001010101000), CONST64(0x0000000010101010), CONST64(0x0000001010101010), - CONST64(0x0000100010101000), CONST64(0x0000101010101000), CONST64(0x0000100010101010), CONST64(0x0000101010101010), - CONST64(0x0010000010100000), CONST64(0x0010001010100000), CONST64(0x0010000010100010), CONST64(0x0010001010100010), - CONST64(0x0010100010100000), CONST64(0x0010101010100000), CONST64(0x0010100010100010), CONST64(0x0010101010100010), - CONST64(0x0010000010101000), CONST64(0x0010001010101000), CONST64(0x0010000010101010), CONST64(0x0010001010101010), - CONST64(0x0010100010101000), CONST64(0x0010101010101000), CONST64(0x0010100010101010), CONST64(0x0010101010101010), - CONST64(0x1000000010000000), CONST64(0x1000001010000000), CONST64(0x1000000010000010), CONST64(0x1000001010000010), - CONST64(0x1000100010000000), CONST64(0x1000101010000000), CONST64(0x1000100010000010), CONST64(0x1000101010000010), - CONST64(0x1000000010001000), CONST64(0x1000001010001000), CONST64(0x1000000010001010), CONST64(0x1000001010001010), - CONST64(0x1000100010001000), CONST64(0x1000101010001000), CONST64(0x1000100010001010), CONST64(0x1000101010001010), - CONST64(0x1010000010000000), CONST64(0x1010001010000000), CONST64(0x1010000010000010), CONST64(0x1010001010000010), - CONST64(0x1010100010000000), CONST64(0x1010101010000000), CONST64(0x1010100010000010), CONST64(0x1010101010000010), - CONST64(0x1010000010001000), CONST64(0x1010001010001000), CONST64(0x1010000010001010), CONST64(0x1010001010001010), - CONST64(0x1010100010001000), CONST64(0x1010101010001000), CONST64(0x1010100010001010), CONST64(0x1010101010001010), - CONST64(0x1000000010100000), CONST64(0x1000001010100000), CONST64(0x1000000010100010), CONST64(0x1000001010100010), - CONST64(0x1000100010100000), CONST64(0x1000101010100000), CONST64(0x1000100010100010), CONST64(0x1000101010100010), - CONST64(0x1000000010101000), CONST64(0x1000001010101000), CONST64(0x1000000010101010), CONST64(0x1000001010101010), - CONST64(0x1000100010101000), CONST64(0x1000101010101000), CONST64(0x1000100010101010), CONST64(0x1000101010101010), - CONST64(0x1010000010100000), CONST64(0x1010001010100000), CONST64(0x1010000010100010), CONST64(0x1010001010100010), - CONST64(0x1010100010100000), CONST64(0x1010101010100000), CONST64(0x1010100010100010), CONST64(0x1010101010100010), - CONST64(0x1010000010101000), CONST64(0x1010001010101000), CONST64(0x1010000010101010), CONST64(0x1010001010101010), +{ CONST64(0x0000000000000000), CONST64(0x0000001000000000), CONST64(0x0000000000000010), CONST64(0x0000001000000010), + CONST64(0x0000100000000000), CONST64(0x0000101000000000), CONST64(0x0000100000000010), CONST64(0x0000101000000010), + CONST64(0x0000000000001000), CONST64(0x0000001000001000), CONST64(0x0000000000001010), CONST64(0x0000001000001010), + CONST64(0x0000100000001000), CONST64(0x0000101000001000), CONST64(0x0000100000001010), CONST64(0x0000101000001010), + CONST64(0x0010000000000000), CONST64(0x0010001000000000), CONST64(0x0010000000000010), CONST64(0x0010001000000010), + CONST64(0x0010100000000000), CONST64(0x0010101000000000), CONST64(0x0010100000000010), CONST64(0x0010101000000010), + CONST64(0x0010000000001000), CONST64(0x0010001000001000), CONST64(0x0010000000001010), CONST64(0x0010001000001010), + CONST64(0x0010100000001000), CONST64(0x0010101000001000), CONST64(0x0010100000001010), CONST64(0x0010101000001010), + CONST64(0x0000000000100000), CONST64(0x0000001000100000), CONST64(0x0000000000100010), CONST64(0x0000001000100010), + CONST64(0x0000100000100000), CONST64(0x0000101000100000), CONST64(0x0000100000100010), CONST64(0x0000101000100010), + CONST64(0x0000000000101000), CONST64(0x0000001000101000), CONST64(0x0000000000101010), CONST64(0x0000001000101010), + CONST64(0x0000100000101000), CONST64(0x0000101000101000), CONST64(0x0000100000101010), CONST64(0x0000101000101010), + CONST64(0x0010000000100000), CONST64(0x0010001000100000), CONST64(0x0010000000100010), CONST64(0x0010001000100010), + CONST64(0x0010100000100000), CONST64(0x0010101000100000), CONST64(0x0010100000100010), CONST64(0x0010101000100010), + CONST64(0x0010000000101000), CONST64(0x0010001000101000), CONST64(0x0010000000101010), CONST64(0x0010001000101010), + CONST64(0x0010100000101000), CONST64(0x0010101000101000), CONST64(0x0010100000101010), CONST64(0x0010101000101010), + CONST64(0x1000000000000000), CONST64(0x1000001000000000), CONST64(0x1000000000000010), CONST64(0x1000001000000010), + CONST64(0x1000100000000000), CONST64(0x1000101000000000), CONST64(0x1000100000000010), CONST64(0x1000101000000010), + CONST64(0x1000000000001000), CONST64(0x1000001000001000), CONST64(0x1000000000001010), CONST64(0x1000001000001010), + CONST64(0x1000100000001000), CONST64(0x1000101000001000), CONST64(0x1000100000001010), CONST64(0x1000101000001010), + CONST64(0x1010000000000000), CONST64(0x1010001000000000), CONST64(0x1010000000000010), CONST64(0x1010001000000010), + CONST64(0x1010100000000000), CONST64(0x1010101000000000), CONST64(0x1010100000000010), CONST64(0x1010101000000010), + CONST64(0x1010000000001000), CONST64(0x1010001000001000), CONST64(0x1010000000001010), CONST64(0x1010001000001010), + CONST64(0x1010100000001000), CONST64(0x1010101000001000), CONST64(0x1010100000001010), CONST64(0x1010101000001010), + CONST64(0x1000000000100000), CONST64(0x1000001000100000), CONST64(0x1000000000100010), CONST64(0x1000001000100010), + CONST64(0x1000100000100000), CONST64(0x1000101000100000), CONST64(0x1000100000100010), CONST64(0x1000101000100010), + CONST64(0x1000000000101000), CONST64(0x1000001000101000), CONST64(0x1000000000101010), CONST64(0x1000001000101010), + CONST64(0x1000100000101000), CONST64(0x1000101000101000), CONST64(0x1000100000101010), CONST64(0x1000101000101010), + CONST64(0x1010000000100000), CONST64(0x1010001000100000), CONST64(0x1010000000100010), CONST64(0x1010001000100010), + CONST64(0x1010100000100000), CONST64(0x1010101000100000), CONST64(0x1010100000100010), CONST64(0x1010101000100010), + CONST64(0x1010000000101000), CONST64(0x1010001000101000), CONST64(0x1010000000101010), CONST64(0x1010001000101010), + CONST64(0x1010100000101000), CONST64(0x1010101000101000), CONST64(0x1010100000101010), CONST64(0x1010101000101010), + CONST64(0x0000000010000000), CONST64(0x0000001010000000), CONST64(0x0000000010000010), CONST64(0x0000001010000010), + CONST64(0x0000100010000000), CONST64(0x0000101010000000), CONST64(0x0000100010000010), CONST64(0x0000101010000010), + CONST64(0x0000000010001000), CONST64(0x0000001010001000), CONST64(0x0000000010001010), CONST64(0x0000001010001010), + CONST64(0x0000100010001000), CONST64(0x0000101010001000), CONST64(0x0000100010001010), CONST64(0x0000101010001010), + CONST64(0x0010000010000000), CONST64(0x0010001010000000), CONST64(0x0010000010000010), CONST64(0x0010001010000010), + CONST64(0x0010100010000000), CONST64(0x0010101010000000), CONST64(0x0010100010000010), CONST64(0x0010101010000010), + CONST64(0x0010000010001000), CONST64(0x0010001010001000), CONST64(0x0010000010001010), CONST64(0x0010001010001010), + CONST64(0x0010100010001000), CONST64(0x0010101010001000), CONST64(0x0010100010001010), CONST64(0x0010101010001010), + CONST64(0x0000000010100000), CONST64(0x0000001010100000), CONST64(0x0000000010100010), CONST64(0x0000001010100010), + CONST64(0x0000100010100000), CONST64(0x0000101010100000), CONST64(0x0000100010100010), CONST64(0x0000101010100010), + CONST64(0x0000000010101000), CONST64(0x0000001010101000), CONST64(0x0000000010101010), CONST64(0x0000001010101010), + CONST64(0x0000100010101000), CONST64(0x0000101010101000), CONST64(0x0000100010101010), CONST64(0x0000101010101010), + CONST64(0x0010000010100000), CONST64(0x0010001010100000), CONST64(0x0010000010100010), CONST64(0x0010001010100010), + CONST64(0x0010100010100000), CONST64(0x0010101010100000), CONST64(0x0010100010100010), CONST64(0x0010101010100010), + CONST64(0x0010000010101000), CONST64(0x0010001010101000), CONST64(0x0010000010101010), CONST64(0x0010001010101010), + CONST64(0x0010100010101000), CONST64(0x0010101010101000), CONST64(0x0010100010101010), CONST64(0x0010101010101010), + CONST64(0x1000000010000000), CONST64(0x1000001010000000), CONST64(0x1000000010000010), CONST64(0x1000001010000010), + CONST64(0x1000100010000000), CONST64(0x1000101010000000), CONST64(0x1000100010000010), CONST64(0x1000101010000010), + CONST64(0x1000000010001000), CONST64(0x1000001010001000), CONST64(0x1000000010001010), CONST64(0x1000001010001010), + CONST64(0x1000100010001000), CONST64(0x1000101010001000), CONST64(0x1000100010001010), CONST64(0x1000101010001010), + CONST64(0x1010000010000000), CONST64(0x1010001010000000), CONST64(0x1010000010000010), CONST64(0x1010001010000010), + CONST64(0x1010100010000000), CONST64(0x1010101010000000), CONST64(0x1010100010000010), CONST64(0x1010101010000010), + CONST64(0x1010000010001000), CONST64(0x1010001010001000), CONST64(0x1010000010001010), CONST64(0x1010001010001010), + CONST64(0x1010100010001000), CONST64(0x1010101010001000), CONST64(0x1010100010001010), CONST64(0x1010101010001010), + CONST64(0x1000000010100000), CONST64(0x1000001010100000), CONST64(0x1000000010100010), CONST64(0x1000001010100010), + CONST64(0x1000100010100000), CONST64(0x1000101010100000), CONST64(0x1000100010100010), CONST64(0x1000101010100010), + CONST64(0x1000000010101000), CONST64(0x1000001010101000), CONST64(0x1000000010101010), CONST64(0x1000001010101010), + CONST64(0x1000100010101000), CONST64(0x1000101010101000), CONST64(0x1000100010101010), CONST64(0x1000101010101010), + CONST64(0x1010000010100000), CONST64(0x1010001010100000), CONST64(0x1010000010100010), CONST64(0x1010001010100010), + CONST64(0x1010100010100000), CONST64(0x1010101010100000), CONST64(0x1010100010100010), CONST64(0x1010101010100010), + CONST64(0x1010000010101000), CONST64(0x1010001010101000), CONST64(0x1010000010101010), CONST64(0x1010001010101010), CONST64(0x1010100010101000), CONST64(0x1010101010101000), CONST64(0x1010100010101010), CONST64(0x1010101010101010) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000000800000000), CONST64(0x0000000000000008), CONST64(0x0000000800000008), - CONST64(0x0000080000000000), CONST64(0x0000080800000000), CONST64(0x0000080000000008), CONST64(0x0000080800000008), - CONST64(0x0000000000000800), CONST64(0x0000000800000800), CONST64(0x0000000000000808), CONST64(0x0000000800000808), - CONST64(0x0000080000000800), CONST64(0x0000080800000800), CONST64(0x0000080000000808), CONST64(0x0000080800000808), - CONST64(0x0008000000000000), CONST64(0x0008000800000000), CONST64(0x0008000000000008), CONST64(0x0008000800000008), - CONST64(0x0008080000000000), CONST64(0x0008080800000000), CONST64(0x0008080000000008), CONST64(0x0008080800000008), - CONST64(0x0008000000000800), CONST64(0x0008000800000800), CONST64(0x0008000000000808), CONST64(0x0008000800000808), - CONST64(0x0008080000000800), CONST64(0x0008080800000800), CONST64(0x0008080000000808), CONST64(0x0008080800000808), - CONST64(0x0000000000080000), CONST64(0x0000000800080000), CONST64(0x0000000000080008), CONST64(0x0000000800080008), - CONST64(0x0000080000080000), CONST64(0x0000080800080000), CONST64(0x0000080000080008), CONST64(0x0000080800080008), - CONST64(0x0000000000080800), CONST64(0x0000000800080800), CONST64(0x0000000000080808), CONST64(0x0000000800080808), - CONST64(0x0000080000080800), CONST64(0x0000080800080800), CONST64(0x0000080000080808), CONST64(0x0000080800080808), - CONST64(0x0008000000080000), CONST64(0x0008000800080000), CONST64(0x0008000000080008), CONST64(0x0008000800080008), - CONST64(0x0008080000080000), CONST64(0x0008080800080000), CONST64(0x0008080000080008), CONST64(0x0008080800080008), - CONST64(0x0008000000080800), CONST64(0x0008000800080800), CONST64(0x0008000000080808), CONST64(0x0008000800080808), - CONST64(0x0008080000080800), CONST64(0x0008080800080800), CONST64(0x0008080000080808), CONST64(0x0008080800080808), - CONST64(0x0800000000000000), CONST64(0x0800000800000000), CONST64(0x0800000000000008), CONST64(0x0800000800000008), - CONST64(0x0800080000000000), CONST64(0x0800080800000000), CONST64(0x0800080000000008), CONST64(0x0800080800000008), - CONST64(0x0800000000000800), CONST64(0x0800000800000800), CONST64(0x0800000000000808), CONST64(0x0800000800000808), - CONST64(0x0800080000000800), CONST64(0x0800080800000800), CONST64(0x0800080000000808), CONST64(0x0800080800000808), - CONST64(0x0808000000000000), CONST64(0x0808000800000000), CONST64(0x0808000000000008), CONST64(0x0808000800000008), - CONST64(0x0808080000000000), CONST64(0x0808080800000000), CONST64(0x0808080000000008), CONST64(0x0808080800000008), - CONST64(0x0808000000000800), CONST64(0x0808000800000800), CONST64(0x0808000000000808), CONST64(0x0808000800000808), - CONST64(0x0808080000000800), CONST64(0x0808080800000800), CONST64(0x0808080000000808), CONST64(0x0808080800000808), - CONST64(0x0800000000080000), CONST64(0x0800000800080000), CONST64(0x0800000000080008), CONST64(0x0800000800080008), - CONST64(0x0800080000080000), CONST64(0x0800080800080000), CONST64(0x0800080000080008), CONST64(0x0800080800080008), - CONST64(0x0800000000080800), CONST64(0x0800000800080800), CONST64(0x0800000000080808), CONST64(0x0800000800080808), - CONST64(0x0800080000080800), CONST64(0x0800080800080800), CONST64(0x0800080000080808), CONST64(0x0800080800080808), - CONST64(0x0808000000080000), CONST64(0x0808000800080000), CONST64(0x0808000000080008), CONST64(0x0808000800080008), - CONST64(0x0808080000080000), CONST64(0x0808080800080000), CONST64(0x0808080000080008), CONST64(0x0808080800080008), - CONST64(0x0808000000080800), CONST64(0x0808000800080800), CONST64(0x0808000000080808), CONST64(0x0808000800080808), - CONST64(0x0808080000080800), CONST64(0x0808080800080800), CONST64(0x0808080000080808), CONST64(0x0808080800080808), - CONST64(0x0000000008000000), CONST64(0x0000000808000000), CONST64(0x0000000008000008), CONST64(0x0000000808000008), - CONST64(0x0000080008000000), CONST64(0x0000080808000000), CONST64(0x0000080008000008), CONST64(0x0000080808000008), - CONST64(0x0000000008000800), CONST64(0x0000000808000800), CONST64(0x0000000008000808), CONST64(0x0000000808000808), - CONST64(0x0000080008000800), CONST64(0x0000080808000800), CONST64(0x0000080008000808), CONST64(0x0000080808000808), - CONST64(0x0008000008000000), CONST64(0x0008000808000000), CONST64(0x0008000008000008), CONST64(0x0008000808000008), - CONST64(0x0008080008000000), CONST64(0x0008080808000000), CONST64(0x0008080008000008), CONST64(0x0008080808000008), - CONST64(0x0008000008000800), CONST64(0x0008000808000800), CONST64(0x0008000008000808), CONST64(0x0008000808000808), - CONST64(0x0008080008000800), CONST64(0x0008080808000800), CONST64(0x0008080008000808), CONST64(0x0008080808000808), - CONST64(0x0000000008080000), CONST64(0x0000000808080000), CONST64(0x0000000008080008), CONST64(0x0000000808080008), - CONST64(0x0000080008080000), CONST64(0x0000080808080000), CONST64(0x0000080008080008), CONST64(0x0000080808080008), - CONST64(0x0000000008080800), CONST64(0x0000000808080800), CONST64(0x0000000008080808), CONST64(0x0000000808080808), - CONST64(0x0000080008080800), CONST64(0x0000080808080800), CONST64(0x0000080008080808), CONST64(0x0000080808080808), - CONST64(0x0008000008080000), CONST64(0x0008000808080000), CONST64(0x0008000008080008), CONST64(0x0008000808080008), - CONST64(0x0008080008080000), CONST64(0x0008080808080000), CONST64(0x0008080008080008), CONST64(0x0008080808080008), - CONST64(0x0008000008080800), CONST64(0x0008000808080800), CONST64(0x0008000008080808), CONST64(0x0008000808080808), - CONST64(0x0008080008080800), CONST64(0x0008080808080800), CONST64(0x0008080008080808), CONST64(0x0008080808080808), - CONST64(0x0800000008000000), CONST64(0x0800000808000000), CONST64(0x0800000008000008), CONST64(0x0800000808000008), - CONST64(0x0800080008000000), CONST64(0x0800080808000000), CONST64(0x0800080008000008), CONST64(0x0800080808000008), - CONST64(0x0800000008000800), CONST64(0x0800000808000800), CONST64(0x0800000008000808), CONST64(0x0800000808000808), - CONST64(0x0800080008000800), CONST64(0x0800080808000800), CONST64(0x0800080008000808), CONST64(0x0800080808000808), - CONST64(0x0808000008000000), CONST64(0x0808000808000000), CONST64(0x0808000008000008), CONST64(0x0808000808000008), - CONST64(0x0808080008000000), CONST64(0x0808080808000000), CONST64(0x0808080008000008), CONST64(0x0808080808000008), - CONST64(0x0808000008000800), CONST64(0x0808000808000800), CONST64(0x0808000008000808), CONST64(0x0808000808000808), - CONST64(0x0808080008000800), CONST64(0x0808080808000800), CONST64(0x0808080008000808), CONST64(0x0808080808000808), - CONST64(0x0800000008080000), CONST64(0x0800000808080000), CONST64(0x0800000008080008), CONST64(0x0800000808080008), - CONST64(0x0800080008080000), CONST64(0x0800080808080000), CONST64(0x0800080008080008), CONST64(0x0800080808080008), - CONST64(0x0800000008080800), CONST64(0x0800000808080800), CONST64(0x0800000008080808), CONST64(0x0800000808080808), - CONST64(0x0800080008080800), CONST64(0x0800080808080800), CONST64(0x0800080008080808), CONST64(0x0800080808080808), - CONST64(0x0808000008080000), CONST64(0x0808000808080000), CONST64(0x0808000008080008), CONST64(0x0808000808080008), - CONST64(0x0808080008080000), CONST64(0x0808080808080000), CONST64(0x0808080008080008), CONST64(0x0808080808080008), - CONST64(0x0808000008080800), CONST64(0x0808000808080800), CONST64(0x0808000008080808), CONST64(0x0808000808080808), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000000800000000), CONST64(0x0000000000000008), CONST64(0x0000000800000008), + CONST64(0x0000080000000000), CONST64(0x0000080800000000), CONST64(0x0000080000000008), CONST64(0x0000080800000008), + CONST64(0x0000000000000800), CONST64(0x0000000800000800), CONST64(0x0000000000000808), CONST64(0x0000000800000808), + CONST64(0x0000080000000800), CONST64(0x0000080800000800), CONST64(0x0000080000000808), CONST64(0x0000080800000808), + CONST64(0x0008000000000000), CONST64(0x0008000800000000), CONST64(0x0008000000000008), CONST64(0x0008000800000008), + CONST64(0x0008080000000000), CONST64(0x0008080800000000), CONST64(0x0008080000000008), CONST64(0x0008080800000008), + CONST64(0x0008000000000800), CONST64(0x0008000800000800), CONST64(0x0008000000000808), CONST64(0x0008000800000808), + CONST64(0x0008080000000800), CONST64(0x0008080800000800), CONST64(0x0008080000000808), CONST64(0x0008080800000808), + CONST64(0x0000000000080000), CONST64(0x0000000800080000), CONST64(0x0000000000080008), CONST64(0x0000000800080008), + CONST64(0x0000080000080000), CONST64(0x0000080800080000), CONST64(0x0000080000080008), CONST64(0x0000080800080008), + CONST64(0x0000000000080800), CONST64(0x0000000800080800), CONST64(0x0000000000080808), CONST64(0x0000000800080808), + CONST64(0x0000080000080800), CONST64(0x0000080800080800), CONST64(0x0000080000080808), CONST64(0x0000080800080808), + CONST64(0x0008000000080000), CONST64(0x0008000800080000), CONST64(0x0008000000080008), CONST64(0x0008000800080008), + CONST64(0x0008080000080000), CONST64(0x0008080800080000), CONST64(0x0008080000080008), CONST64(0x0008080800080008), + CONST64(0x0008000000080800), CONST64(0x0008000800080800), CONST64(0x0008000000080808), CONST64(0x0008000800080808), + CONST64(0x0008080000080800), CONST64(0x0008080800080800), CONST64(0x0008080000080808), CONST64(0x0008080800080808), + CONST64(0x0800000000000000), CONST64(0x0800000800000000), CONST64(0x0800000000000008), CONST64(0x0800000800000008), + CONST64(0x0800080000000000), CONST64(0x0800080800000000), CONST64(0x0800080000000008), CONST64(0x0800080800000008), + CONST64(0x0800000000000800), CONST64(0x0800000800000800), CONST64(0x0800000000000808), CONST64(0x0800000800000808), + CONST64(0x0800080000000800), CONST64(0x0800080800000800), CONST64(0x0800080000000808), CONST64(0x0800080800000808), + CONST64(0x0808000000000000), CONST64(0x0808000800000000), CONST64(0x0808000000000008), CONST64(0x0808000800000008), + CONST64(0x0808080000000000), CONST64(0x0808080800000000), CONST64(0x0808080000000008), CONST64(0x0808080800000008), + CONST64(0x0808000000000800), CONST64(0x0808000800000800), CONST64(0x0808000000000808), CONST64(0x0808000800000808), + CONST64(0x0808080000000800), CONST64(0x0808080800000800), CONST64(0x0808080000000808), CONST64(0x0808080800000808), + CONST64(0x0800000000080000), CONST64(0x0800000800080000), CONST64(0x0800000000080008), CONST64(0x0800000800080008), + CONST64(0x0800080000080000), CONST64(0x0800080800080000), CONST64(0x0800080000080008), CONST64(0x0800080800080008), + CONST64(0x0800000000080800), CONST64(0x0800000800080800), CONST64(0x0800000000080808), CONST64(0x0800000800080808), + CONST64(0x0800080000080800), CONST64(0x0800080800080800), CONST64(0x0800080000080808), CONST64(0x0800080800080808), + CONST64(0x0808000000080000), CONST64(0x0808000800080000), CONST64(0x0808000000080008), CONST64(0x0808000800080008), + CONST64(0x0808080000080000), CONST64(0x0808080800080000), CONST64(0x0808080000080008), CONST64(0x0808080800080008), + CONST64(0x0808000000080800), CONST64(0x0808000800080800), CONST64(0x0808000000080808), CONST64(0x0808000800080808), + CONST64(0x0808080000080800), CONST64(0x0808080800080800), CONST64(0x0808080000080808), CONST64(0x0808080800080808), + CONST64(0x0000000008000000), CONST64(0x0000000808000000), CONST64(0x0000000008000008), CONST64(0x0000000808000008), + CONST64(0x0000080008000000), CONST64(0x0000080808000000), CONST64(0x0000080008000008), CONST64(0x0000080808000008), + CONST64(0x0000000008000800), CONST64(0x0000000808000800), CONST64(0x0000000008000808), CONST64(0x0000000808000808), + CONST64(0x0000080008000800), CONST64(0x0000080808000800), CONST64(0x0000080008000808), CONST64(0x0000080808000808), + CONST64(0x0008000008000000), CONST64(0x0008000808000000), CONST64(0x0008000008000008), CONST64(0x0008000808000008), + CONST64(0x0008080008000000), CONST64(0x0008080808000000), CONST64(0x0008080008000008), CONST64(0x0008080808000008), + CONST64(0x0008000008000800), CONST64(0x0008000808000800), CONST64(0x0008000008000808), CONST64(0x0008000808000808), + CONST64(0x0008080008000800), CONST64(0x0008080808000800), CONST64(0x0008080008000808), CONST64(0x0008080808000808), + CONST64(0x0000000008080000), CONST64(0x0000000808080000), CONST64(0x0000000008080008), CONST64(0x0000000808080008), + CONST64(0x0000080008080000), CONST64(0x0000080808080000), CONST64(0x0000080008080008), CONST64(0x0000080808080008), + CONST64(0x0000000008080800), CONST64(0x0000000808080800), CONST64(0x0000000008080808), CONST64(0x0000000808080808), + CONST64(0x0000080008080800), CONST64(0x0000080808080800), CONST64(0x0000080008080808), CONST64(0x0000080808080808), + CONST64(0x0008000008080000), CONST64(0x0008000808080000), CONST64(0x0008000008080008), CONST64(0x0008000808080008), + CONST64(0x0008080008080000), CONST64(0x0008080808080000), CONST64(0x0008080008080008), CONST64(0x0008080808080008), + CONST64(0x0008000008080800), CONST64(0x0008000808080800), CONST64(0x0008000008080808), CONST64(0x0008000808080808), + CONST64(0x0008080008080800), CONST64(0x0008080808080800), CONST64(0x0008080008080808), CONST64(0x0008080808080808), + CONST64(0x0800000008000000), CONST64(0x0800000808000000), CONST64(0x0800000008000008), CONST64(0x0800000808000008), + CONST64(0x0800080008000000), CONST64(0x0800080808000000), CONST64(0x0800080008000008), CONST64(0x0800080808000008), + CONST64(0x0800000008000800), CONST64(0x0800000808000800), CONST64(0x0800000008000808), CONST64(0x0800000808000808), + CONST64(0x0800080008000800), CONST64(0x0800080808000800), CONST64(0x0800080008000808), CONST64(0x0800080808000808), + CONST64(0x0808000008000000), CONST64(0x0808000808000000), CONST64(0x0808000008000008), CONST64(0x0808000808000008), + CONST64(0x0808080008000000), CONST64(0x0808080808000000), CONST64(0x0808080008000008), CONST64(0x0808080808000008), + CONST64(0x0808000008000800), CONST64(0x0808000808000800), CONST64(0x0808000008000808), CONST64(0x0808000808000808), + CONST64(0x0808080008000800), CONST64(0x0808080808000800), CONST64(0x0808080008000808), CONST64(0x0808080808000808), + CONST64(0x0800000008080000), CONST64(0x0800000808080000), CONST64(0x0800000008080008), CONST64(0x0800000808080008), + CONST64(0x0800080008080000), CONST64(0x0800080808080000), CONST64(0x0800080008080008), CONST64(0x0800080808080008), + CONST64(0x0800000008080800), CONST64(0x0800000808080800), CONST64(0x0800000008080808), CONST64(0x0800000808080808), + CONST64(0x0800080008080800), CONST64(0x0800080808080800), CONST64(0x0800080008080808), CONST64(0x0800080808080808), + CONST64(0x0808000008080000), CONST64(0x0808000808080000), CONST64(0x0808000008080008), CONST64(0x0808000808080008), + CONST64(0x0808080008080000), CONST64(0x0808080808080000), CONST64(0x0808080008080008), CONST64(0x0808080808080008), + CONST64(0x0808000008080800), CONST64(0x0808000808080800), CONST64(0x0808000008080808), CONST64(0x0808000808080808), CONST64(0x0808080008080800), CONST64(0x0808080808080800), CONST64(0x0808080008080808), CONST64(0x0808080808080808) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000000400000000), CONST64(0x0000000000000004), CONST64(0x0000000400000004), - CONST64(0x0000040000000000), CONST64(0x0000040400000000), CONST64(0x0000040000000004), CONST64(0x0000040400000004), - CONST64(0x0000000000000400), CONST64(0x0000000400000400), CONST64(0x0000000000000404), CONST64(0x0000000400000404), - CONST64(0x0000040000000400), CONST64(0x0000040400000400), CONST64(0x0000040000000404), CONST64(0x0000040400000404), - CONST64(0x0004000000000000), CONST64(0x0004000400000000), CONST64(0x0004000000000004), CONST64(0x0004000400000004), - CONST64(0x0004040000000000), CONST64(0x0004040400000000), CONST64(0x0004040000000004), CONST64(0x0004040400000004), - CONST64(0x0004000000000400), CONST64(0x0004000400000400), CONST64(0x0004000000000404), CONST64(0x0004000400000404), - CONST64(0x0004040000000400), CONST64(0x0004040400000400), CONST64(0x0004040000000404), CONST64(0x0004040400000404), - CONST64(0x0000000000040000), CONST64(0x0000000400040000), CONST64(0x0000000000040004), CONST64(0x0000000400040004), - CONST64(0x0000040000040000), CONST64(0x0000040400040000), CONST64(0x0000040000040004), CONST64(0x0000040400040004), - CONST64(0x0000000000040400), CONST64(0x0000000400040400), CONST64(0x0000000000040404), CONST64(0x0000000400040404), - CONST64(0x0000040000040400), CONST64(0x0000040400040400), CONST64(0x0000040000040404), CONST64(0x0000040400040404), - CONST64(0x0004000000040000), CONST64(0x0004000400040000), CONST64(0x0004000000040004), CONST64(0x0004000400040004), - CONST64(0x0004040000040000), CONST64(0x0004040400040000), CONST64(0x0004040000040004), CONST64(0x0004040400040004), - CONST64(0x0004000000040400), CONST64(0x0004000400040400), CONST64(0x0004000000040404), CONST64(0x0004000400040404), - CONST64(0x0004040000040400), CONST64(0x0004040400040400), CONST64(0x0004040000040404), CONST64(0x0004040400040404), - CONST64(0x0400000000000000), CONST64(0x0400000400000000), CONST64(0x0400000000000004), CONST64(0x0400000400000004), - CONST64(0x0400040000000000), CONST64(0x0400040400000000), CONST64(0x0400040000000004), CONST64(0x0400040400000004), - CONST64(0x0400000000000400), CONST64(0x0400000400000400), CONST64(0x0400000000000404), CONST64(0x0400000400000404), - CONST64(0x0400040000000400), CONST64(0x0400040400000400), CONST64(0x0400040000000404), CONST64(0x0400040400000404), - CONST64(0x0404000000000000), CONST64(0x0404000400000000), CONST64(0x0404000000000004), CONST64(0x0404000400000004), - CONST64(0x0404040000000000), CONST64(0x0404040400000000), CONST64(0x0404040000000004), CONST64(0x0404040400000004), - CONST64(0x0404000000000400), CONST64(0x0404000400000400), CONST64(0x0404000000000404), CONST64(0x0404000400000404), - CONST64(0x0404040000000400), CONST64(0x0404040400000400), CONST64(0x0404040000000404), CONST64(0x0404040400000404), - CONST64(0x0400000000040000), CONST64(0x0400000400040000), CONST64(0x0400000000040004), CONST64(0x0400000400040004), - CONST64(0x0400040000040000), CONST64(0x0400040400040000), CONST64(0x0400040000040004), CONST64(0x0400040400040004), - CONST64(0x0400000000040400), CONST64(0x0400000400040400), CONST64(0x0400000000040404), CONST64(0x0400000400040404), - CONST64(0x0400040000040400), CONST64(0x0400040400040400), CONST64(0x0400040000040404), CONST64(0x0400040400040404), - CONST64(0x0404000000040000), CONST64(0x0404000400040000), CONST64(0x0404000000040004), CONST64(0x0404000400040004), - CONST64(0x0404040000040000), CONST64(0x0404040400040000), CONST64(0x0404040000040004), CONST64(0x0404040400040004), - CONST64(0x0404000000040400), CONST64(0x0404000400040400), CONST64(0x0404000000040404), CONST64(0x0404000400040404), - CONST64(0x0404040000040400), CONST64(0x0404040400040400), CONST64(0x0404040000040404), CONST64(0x0404040400040404), - CONST64(0x0000000004000000), CONST64(0x0000000404000000), CONST64(0x0000000004000004), CONST64(0x0000000404000004), - CONST64(0x0000040004000000), CONST64(0x0000040404000000), CONST64(0x0000040004000004), CONST64(0x0000040404000004), - CONST64(0x0000000004000400), CONST64(0x0000000404000400), CONST64(0x0000000004000404), CONST64(0x0000000404000404), - CONST64(0x0000040004000400), CONST64(0x0000040404000400), CONST64(0x0000040004000404), CONST64(0x0000040404000404), - CONST64(0x0004000004000000), CONST64(0x0004000404000000), CONST64(0x0004000004000004), CONST64(0x0004000404000004), - CONST64(0x0004040004000000), CONST64(0x0004040404000000), CONST64(0x0004040004000004), CONST64(0x0004040404000004), - CONST64(0x0004000004000400), CONST64(0x0004000404000400), CONST64(0x0004000004000404), CONST64(0x0004000404000404), - CONST64(0x0004040004000400), CONST64(0x0004040404000400), CONST64(0x0004040004000404), CONST64(0x0004040404000404), - CONST64(0x0000000004040000), CONST64(0x0000000404040000), CONST64(0x0000000004040004), CONST64(0x0000000404040004), - CONST64(0x0000040004040000), CONST64(0x0000040404040000), CONST64(0x0000040004040004), CONST64(0x0000040404040004), - CONST64(0x0000000004040400), CONST64(0x0000000404040400), CONST64(0x0000000004040404), CONST64(0x0000000404040404), - CONST64(0x0000040004040400), CONST64(0x0000040404040400), CONST64(0x0000040004040404), CONST64(0x0000040404040404), - CONST64(0x0004000004040000), CONST64(0x0004000404040000), CONST64(0x0004000004040004), CONST64(0x0004000404040004), - CONST64(0x0004040004040000), CONST64(0x0004040404040000), CONST64(0x0004040004040004), CONST64(0x0004040404040004), - CONST64(0x0004000004040400), CONST64(0x0004000404040400), CONST64(0x0004000004040404), CONST64(0x0004000404040404), - CONST64(0x0004040004040400), CONST64(0x0004040404040400), CONST64(0x0004040004040404), CONST64(0x0004040404040404), - CONST64(0x0400000004000000), CONST64(0x0400000404000000), CONST64(0x0400000004000004), CONST64(0x0400000404000004), - CONST64(0x0400040004000000), CONST64(0x0400040404000000), CONST64(0x0400040004000004), CONST64(0x0400040404000004), - CONST64(0x0400000004000400), CONST64(0x0400000404000400), CONST64(0x0400000004000404), CONST64(0x0400000404000404), - CONST64(0x0400040004000400), CONST64(0x0400040404000400), CONST64(0x0400040004000404), CONST64(0x0400040404000404), - CONST64(0x0404000004000000), CONST64(0x0404000404000000), CONST64(0x0404000004000004), CONST64(0x0404000404000004), - CONST64(0x0404040004000000), CONST64(0x0404040404000000), CONST64(0x0404040004000004), CONST64(0x0404040404000004), - CONST64(0x0404000004000400), CONST64(0x0404000404000400), CONST64(0x0404000004000404), CONST64(0x0404000404000404), - CONST64(0x0404040004000400), CONST64(0x0404040404000400), CONST64(0x0404040004000404), CONST64(0x0404040404000404), - CONST64(0x0400000004040000), CONST64(0x0400000404040000), CONST64(0x0400000004040004), CONST64(0x0400000404040004), - CONST64(0x0400040004040000), CONST64(0x0400040404040000), CONST64(0x0400040004040004), CONST64(0x0400040404040004), - CONST64(0x0400000004040400), CONST64(0x0400000404040400), CONST64(0x0400000004040404), CONST64(0x0400000404040404), - CONST64(0x0400040004040400), CONST64(0x0400040404040400), CONST64(0x0400040004040404), CONST64(0x0400040404040404), - CONST64(0x0404000004040000), CONST64(0x0404000404040000), CONST64(0x0404000004040004), CONST64(0x0404000404040004), - CONST64(0x0404040004040000), CONST64(0x0404040404040000), CONST64(0x0404040004040004), CONST64(0x0404040404040004), - CONST64(0x0404000004040400), CONST64(0x0404000404040400), CONST64(0x0404000004040404), CONST64(0x0404000404040404), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000000400000000), CONST64(0x0000000000000004), CONST64(0x0000000400000004), + CONST64(0x0000040000000000), CONST64(0x0000040400000000), CONST64(0x0000040000000004), CONST64(0x0000040400000004), + CONST64(0x0000000000000400), CONST64(0x0000000400000400), CONST64(0x0000000000000404), CONST64(0x0000000400000404), + CONST64(0x0000040000000400), CONST64(0x0000040400000400), CONST64(0x0000040000000404), CONST64(0x0000040400000404), + CONST64(0x0004000000000000), CONST64(0x0004000400000000), CONST64(0x0004000000000004), CONST64(0x0004000400000004), + CONST64(0x0004040000000000), CONST64(0x0004040400000000), CONST64(0x0004040000000004), CONST64(0x0004040400000004), + CONST64(0x0004000000000400), CONST64(0x0004000400000400), CONST64(0x0004000000000404), CONST64(0x0004000400000404), + CONST64(0x0004040000000400), CONST64(0x0004040400000400), CONST64(0x0004040000000404), CONST64(0x0004040400000404), + CONST64(0x0000000000040000), CONST64(0x0000000400040000), CONST64(0x0000000000040004), CONST64(0x0000000400040004), + CONST64(0x0000040000040000), CONST64(0x0000040400040000), CONST64(0x0000040000040004), CONST64(0x0000040400040004), + CONST64(0x0000000000040400), CONST64(0x0000000400040400), CONST64(0x0000000000040404), CONST64(0x0000000400040404), + CONST64(0x0000040000040400), CONST64(0x0000040400040400), CONST64(0x0000040000040404), CONST64(0x0000040400040404), + CONST64(0x0004000000040000), CONST64(0x0004000400040000), CONST64(0x0004000000040004), CONST64(0x0004000400040004), + CONST64(0x0004040000040000), CONST64(0x0004040400040000), CONST64(0x0004040000040004), CONST64(0x0004040400040004), + CONST64(0x0004000000040400), CONST64(0x0004000400040400), CONST64(0x0004000000040404), CONST64(0x0004000400040404), + CONST64(0x0004040000040400), CONST64(0x0004040400040400), CONST64(0x0004040000040404), CONST64(0x0004040400040404), + CONST64(0x0400000000000000), CONST64(0x0400000400000000), CONST64(0x0400000000000004), CONST64(0x0400000400000004), + CONST64(0x0400040000000000), CONST64(0x0400040400000000), CONST64(0x0400040000000004), CONST64(0x0400040400000004), + CONST64(0x0400000000000400), CONST64(0x0400000400000400), CONST64(0x0400000000000404), CONST64(0x0400000400000404), + CONST64(0x0400040000000400), CONST64(0x0400040400000400), CONST64(0x0400040000000404), CONST64(0x0400040400000404), + CONST64(0x0404000000000000), CONST64(0x0404000400000000), CONST64(0x0404000000000004), CONST64(0x0404000400000004), + CONST64(0x0404040000000000), CONST64(0x0404040400000000), CONST64(0x0404040000000004), CONST64(0x0404040400000004), + CONST64(0x0404000000000400), CONST64(0x0404000400000400), CONST64(0x0404000000000404), CONST64(0x0404000400000404), + CONST64(0x0404040000000400), CONST64(0x0404040400000400), CONST64(0x0404040000000404), CONST64(0x0404040400000404), + CONST64(0x0400000000040000), CONST64(0x0400000400040000), CONST64(0x0400000000040004), CONST64(0x0400000400040004), + CONST64(0x0400040000040000), CONST64(0x0400040400040000), CONST64(0x0400040000040004), CONST64(0x0400040400040004), + CONST64(0x0400000000040400), CONST64(0x0400000400040400), CONST64(0x0400000000040404), CONST64(0x0400000400040404), + CONST64(0x0400040000040400), CONST64(0x0400040400040400), CONST64(0x0400040000040404), CONST64(0x0400040400040404), + CONST64(0x0404000000040000), CONST64(0x0404000400040000), CONST64(0x0404000000040004), CONST64(0x0404000400040004), + CONST64(0x0404040000040000), CONST64(0x0404040400040000), CONST64(0x0404040000040004), CONST64(0x0404040400040004), + CONST64(0x0404000000040400), CONST64(0x0404000400040400), CONST64(0x0404000000040404), CONST64(0x0404000400040404), + CONST64(0x0404040000040400), CONST64(0x0404040400040400), CONST64(0x0404040000040404), CONST64(0x0404040400040404), + CONST64(0x0000000004000000), CONST64(0x0000000404000000), CONST64(0x0000000004000004), CONST64(0x0000000404000004), + CONST64(0x0000040004000000), CONST64(0x0000040404000000), CONST64(0x0000040004000004), CONST64(0x0000040404000004), + CONST64(0x0000000004000400), CONST64(0x0000000404000400), CONST64(0x0000000004000404), CONST64(0x0000000404000404), + CONST64(0x0000040004000400), CONST64(0x0000040404000400), CONST64(0x0000040004000404), CONST64(0x0000040404000404), + CONST64(0x0004000004000000), CONST64(0x0004000404000000), CONST64(0x0004000004000004), CONST64(0x0004000404000004), + CONST64(0x0004040004000000), CONST64(0x0004040404000000), CONST64(0x0004040004000004), CONST64(0x0004040404000004), + CONST64(0x0004000004000400), CONST64(0x0004000404000400), CONST64(0x0004000004000404), CONST64(0x0004000404000404), + CONST64(0x0004040004000400), CONST64(0x0004040404000400), CONST64(0x0004040004000404), CONST64(0x0004040404000404), + CONST64(0x0000000004040000), CONST64(0x0000000404040000), CONST64(0x0000000004040004), CONST64(0x0000000404040004), + CONST64(0x0000040004040000), CONST64(0x0000040404040000), CONST64(0x0000040004040004), CONST64(0x0000040404040004), + CONST64(0x0000000004040400), CONST64(0x0000000404040400), CONST64(0x0000000004040404), CONST64(0x0000000404040404), + CONST64(0x0000040004040400), CONST64(0x0000040404040400), CONST64(0x0000040004040404), CONST64(0x0000040404040404), + CONST64(0x0004000004040000), CONST64(0x0004000404040000), CONST64(0x0004000004040004), CONST64(0x0004000404040004), + CONST64(0x0004040004040000), CONST64(0x0004040404040000), CONST64(0x0004040004040004), CONST64(0x0004040404040004), + CONST64(0x0004000004040400), CONST64(0x0004000404040400), CONST64(0x0004000004040404), CONST64(0x0004000404040404), + CONST64(0x0004040004040400), CONST64(0x0004040404040400), CONST64(0x0004040004040404), CONST64(0x0004040404040404), + CONST64(0x0400000004000000), CONST64(0x0400000404000000), CONST64(0x0400000004000004), CONST64(0x0400000404000004), + CONST64(0x0400040004000000), CONST64(0x0400040404000000), CONST64(0x0400040004000004), CONST64(0x0400040404000004), + CONST64(0x0400000004000400), CONST64(0x0400000404000400), CONST64(0x0400000004000404), CONST64(0x0400000404000404), + CONST64(0x0400040004000400), CONST64(0x0400040404000400), CONST64(0x0400040004000404), CONST64(0x0400040404000404), + CONST64(0x0404000004000000), CONST64(0x0404000404000000), CONST64(0x0404000004000004), CONST64(0x0404000404000004), + CONST64(0x0404040004000000), CONST64(0x0404040404000000), CONST64(0x0404040004000004), CONST64(0x0404040404000004), + CONST64(0x0404000004000400), CONST64(0x0404000404000400), CONST64(0x0404000004000404), CONST64(0x0404000404000404), + CONST64(0x0404040004000400), CONST64(0x0404040404000400), CONST64(0x0404040004000404), CONST64(0x0404040404000404), + CONST64(0x0400000004040000), CONST64(0x0400000404040000), CONST64(0x0400000004040004), CONST64(0x0400000404040004), + CONST64(0x0400040004040000), CONST64(0x0400040404040000), CONST64(0x0400040004040004), CONST64(0x0400040404040004), + CONST64(0x0400000004040400), CONST64(0x0400000404040400), CONST64(0x0400000004040404), CONST64(0x0400000404040404), + CONST64(0x0400040004040400), CONST64(0x0400040404040400), CONST64(0x0400040004040404), CONST64(0x0400040404040404), + CONST64(0x0404000004040000), CONST64(0x0404000404040000), CONST64(0x0404000004040004), CONST64(0x0404000404040004), + CONST64(0x0404040004040000), CONST64(0x0404040404040000), CONST64(0x0404040004040004), CONST64(0x0404040404040004), + CONST64(0x0404000004040400), CONST64(0x0404000404040400), CONST64(0x0404000004040404), CONST64(0x0404000404040404), CONST64(0x0404040004040400), CONST64(0x0404040404040400), CONST64(0x0404040004040404), CONST64(0x0404040404040404) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000000200000000), CONST64(0x0000000000000002), CONST64(0x0000000200000002), - CONST64(0x0000020000000000), CONST64(0x0000020200000000), CONST64(0x0000020000000002), CONST64(0x0000020200000002), - CONST64(0x0000000000000200), CONST64(0x0000000200000200), CONST64(0x0000000000000202), CONST64(0x0000000200000202), - CONST64(0x0000020000000200), CONST64(0x0000020200000200), CONST64(0x0000020000000202), CONST64(0x0000020200000202), - CONST64(0x0002000000000000), CONST64(0x0002000200000000), CONST64(0x0002000000000002), CONST64(0x0002000200000002), - CONST64(0x0002020000000000), CONST64(0x0002020200000000), CONST64(0x0002020000000002), CONST64(0x0002020200000002), - CONST64(0x0002000000000200), CONST64(0x0002000200000200), CONST64(0x0002000000000202), CONST64(0x0002000200000202), - CONST64(0x0002020000000200), CONST64(0x0002020200000200), CONST64(0x0002020000000202), CONST64(0x0002020200000202), - CONST64(0x0000000000020000), CONST64(0x0000000200020000), CONST64(0x0000000000020002), CONST64(0x0000000200020002), - CONST64(0x0000020000020000), CONST64(0x0000020200020000), CONST64(0x0000020000020002), CONST64(0x0000020200020002), - CONST64(0x0000000000020200), CONST64(0x0000000200020200), CONST64(0x0000000000020202), CONST64(0x0000000200020202), - CONST64(0x0000020000020200), CONST64(0x0000020200020200), CONST64(0x0000020000020202), CONST64(0x0000020200020202), - CONST64(0x0002000000020000), CONST64(0x0002000200020000), CONST64(0x0002000000020002), CONST64(0x0002000200020002), - CONST64(0x0002020000020000), CONST64(0x0002020200020000), CONST64(0x0002020000020002), CONST64(0x0002020200020002), - CONST64(0x0002000000020200), CONST64(0x0002000200020200), CONST64(0x0002000000020202), CONST64(0x0002000200020202), - CONST64(0x0002020000020200), CONST64(0x0002020200020200), CONST64(0x0002020000020202), CONST64(0x0002020200020202), - CONST64(0x0200000000000000), CONST64(0x0200000200000000), CONST64(0x0200000000000002), CONST64(0x0200000200000002), - CONST64(0x0200020000000000), CONST64(0x0200020200000000), CONST64(0x0200020000000002), CONST64(0x0200020200000002), - CONST64(0x0200000000000200), CONST64(0x0200000200000200), CONST64(0x0200000000000202), CONST64(0x0200000200000202), - CONST64(0x0200020000000200), CONST64(0x0200020200000200), CONST64(0x0200020000000202), CONST64(0x0200020200000202), - CONST64(0x0202000000000000), CONST64(0x0202000200000000), CONST64(0x0202000000000002), CONST64(0x0202000200000002), - CONST64(0x0202020000000000), CONST64(0x0202020200000000), CONST64(0x0202020000000002), CONST64(0x0202020200000002), - CONST64(0x0202000000000200), CONST64(0x0202000200000200), CONST64(0x0202000000000202), CONST64(0x0202000200000202), - CONST64(0x0202020000000200), CONST64(0x0202020200000200), CONST64(0x0202020000000202), CONST64(0x0202020200000202), - CONST64(0x0200000000020000), CONST64(0x0200000200020000), CONST64(0x0200000000020002), CONST64(0x0200000200020002), - CONST64(0x0200020000020000), CONST64(0x0200020200020000), CONST64(0x0200020000020002), CONST64(0x0200020200020002), - CONST64(0x0200000000020200), CONST64(0x0200000200020200), CONST64(0x0200000000020202), CONST64(0x0200000200020202), - CONST64(0x0200020000020200), CONST64(0x0200020200020200), CONST64(0x0200020000020202), CONST64(0x0200020200020202), - CONST64(0x0202000000020000), CONST64(0x0202000200020000), CONST64(0x0202000000020002), CONST64(0x0202000200020002), - CONST64(0x0202020000020000), CONST64(0x0202020200020000), CONST64(0x0202020000020002), CONST64(0x0202020200020002), - CONST64(0x0202000000020200), CONST64(0x0202000200020200), CONST64(0x0202000000020202), CONST64(0x0202000200020202), - CONST64(0x0202020000020200), CONST64(0x0202020200020200), CONST64(0x0202020000020202), CONST64(0x0202020200020202), - CONST64(0x0000000002000000), CONST64(0x0000000202000000), CONST64(0x0000000002000002), CONST64(0x0000000202000002), - CONST64(0x0000020002000000), CONST64(0x0000020202000000), CONST64(0x0000020002000002), CONST64(0x0000020202000002), - CONST64(0x0000000002000200), CONST64(0x0000000202000200), CONST64(0x0000000002000202), CONST64(0x0000000202000202), - CONST64(0x0000020002000200), CONST64(0x0000020202000200), CONST64(0x0000020002000202), CONST64(0x0000020202000202), - CONST64(0x0002000002000000), CONST64(0x0002000202000000), CONST64(0x0002000002000002), CONST64(0x0002000202000002), - CONST64(0x0002020002000000), CONST64(0x0002020202000000), CONST64(0x0002020002000002), CONST64(0x0002020202000002), - CONST64(0x0002000002000200), CONST64(0x0002000202000200), CONST64(0x0002000002000202), CONST64(0x0002000202000202), - CONST64(0x0002020002000200), CONST64(0x0002020202000200), CONST64(0x0002020002000202), CONST64(0x0002020202000202), - CONST64(0x0000000002020000), CONST64(0x0000000202020000), CONST64(0x0000000002020002), CONST64(0x0000000202020002), - CONST64(0x0000020002020000), CONST64(0x0000020202020000), CONST64(0x0000020002020002), CONST64(0x0000020202020002), - CONST64(0x0000000002020200), CONST64(0x0000000202020200), CONST64(0x0000000002020202), CONST64(0x0000000202020202), - CONST64(0x0000020002020200), CONST64(0x0000020202020200), CONST64(0x0000020002020202), CONST64(0x0000020202020202), - CONST64(0x0002000002020000), CONST64(0x0002000202020000), CONST64(0x0002000002020002), CONST64(0x0002000202020002), - CONST64(0x0002020002020000), CONST64(0x0002020202020000), CONST64(0x0002020002020002), CONST64(0x0002020202020002), - CONST64(0x0002000002020200), CONST64(0x0002000202020200), CONST64(0x0002000002020202), CONST64(0x0002000202020202), - CONST64(0x0002020002020200), CONST64(0x0002020202020200), CONST64(0x0002020002020202), CONST64(0x0002020202020202), - CONST64(0x0200000002000000), CONST64(0x0200000202000000), CONST64(0x0200000002000002), CONST64(0x0200000202000002), - CONST64(0x0200020002000000), CONST64(0x0200020202000000), CONST64(0x0200020002000002), CONST64(0x0200020202000002), - CONST64(0x0200000002000200), CONST64(0x0200000202000200), CONST64(0x0200000002000202), CONST64(0x0200000202000202), - CONST64(0x0200020002000200), CONST64(0x0200020202000200), CONST64(0x0200020002000202), CONST64(0x0200020202000202), - CONST64(0x0202000002000000), CONST64(0x0202000202000000), CONST64(0x0202000002000002), CONST64(0x0202000202000002), - CONST64(0x0202020002000000), CONST64(0x0202020202000000), CONST64(0x0202020002000002), CONST64(0x0202020202000002), - CONST64(0x0202000002000200), CONST64(0x0202000202000200), CONST64(0x0202000002000202), CONST64(0x0202000202000202), - CONST64(0x0202020002000200), CONST64(0x0202020202000200), CONST64(0x0202020002000202), CONST64(0x0202020202000202), - CONST64(0x0200000002020000), CONST64(0x0200000202020000), CONST64(0x0200000002020002), CONST64(0x0200000202020002), - CONST64(0x0200020002020000), CONST64(0x0200020202020000), CONST64(0x0200020002020002), CONST64(0x0200020202020002), - CONST64(0x0200000002020200), CONST64(0x0200000202020200), CONST64(0x0200000002020202), CONST64(0x0200000202020202), - CONST64(0x0200020002020200), CONST64(0x0200020202020200), CONST64(0x0200020002020202), CONST64(0x0200020202020202), - CONST64(0x0202000002020000), CONST64(0x0202000202020000), CONST64(0x0202000002020002), CONST64(0x0202000202020002), - CONST64(0x0202020002020000), CONST64(0x0202020202020000), CONST64(0x0202020002020002), CONST64(0x0202020202020002), - CONST64(0x0202000002020200), CONST64(0x0202000202020200), CONST64(0x0202000002020202), CONST64(0x0202000202020202), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000000200000000), CONST64(0x0000000000000002), CONST64(0x0000000200000002), + CONST64(0x0000020000000000), CONST64(0x0000020200000000), CONST64(0x0000020000000002), CONST64(0x0000020200000002), + CONST64(0x0000000000000200), CONST64(0x0000000200000200), CONST64(0x0000000000000202), CONST64(0x0000000200000202), + CONST64(0x0000020000000200), CONST64(0x0000020200000200), CONST64(0x0000020000000202), CONST64(0x0000020200000202), + CONST64(0x0002000000000000), CONST64(0x0002000200000000), CONST64(0x0002000000000002), CONST64(0x0002000200000002), + CONST64(0x0002020000000000), CONST64(0x0002020200000000), CONST64(0x0002020000000002), CONST64(0x0002020200000002), + CONST64(0x0002000000000200), CONST64(0x0002000200000200), CONST64(0x0002000000000202), CONST64(0x0002000200000202), + CONST64(0x0002020000000200), CONST64(0x0002020200000200), CONST64(0x0002020000000202), CONST64(0x0002020200000202), + CONST64(0x0000000000020000), CONST64(0x0000000200020000), CONST64(0x0000000000020002), CONST64(0x0000000200020002), + CONST64(0x0000020000020000), CONST64(0x0000020200020000), CONST64(0x0000020000020002), CONST64(0x0000020200020002), + CONST64(0x0000000000020200), CONST64(0x0000000200020200), CONST64(0x0000000000020202), CONST64(0x0000000200020202), + CONST64(0x0000020000020200), CONST64(0x0000020200020200), CONST64(0x0000020000020202), CONST64(0x0000020200020202), + CONST64(0x0002000000020000), CONST64(0x0002000200020000), CONST64(0x0002000000020002), CONST64(0x0002000200020002), + CONST64(0x0002020000020000), CONST64(0x0002020200020000), CONST64(0x0002020000020002), CONST64(0x0002020200020002), + CONST64(0x0002000000020200), CONST64(0x0002000200020200), CONST64(0x0002000000020202), CONST64(0x0002000200020202), + CONST64(0x0002020000020200), CONST64(0x0002020200020200), CONST64(0x0002020000020202), CONST64(0x0002020200020202), + CONST64(0x0200000000000000), CONST64(0x0200000200000000), CONST64(0x0200000000000002), CONST64(0x0200000200000002), + CONST64(0x0200020000000000), CONST64(0x0200020200000000), CONST64(0x0200020000000002), CONST64(0x0200020200000002), + CONST64(0x0200000000000200), CONST64(0x0200000200000200), CONST64(0x0200000000000202), CONST64(0x0200000200000202), + CONST64(0x0200020000000200), CONST64(0x0200020200000200), CONST64(0x0200020000000202), CONST64(0x0200020200000202), + CONST64(0x0202000000000000), CONST64(0x0202000200000000), CONST64(0x0202000000000002), CONST64(0x0202000200000002), + CONST64(0x0202020000000000), CONST64(0x0202020200000000), CONST64(0x0202020000000002), CONST64(0x0202020200000002), + CONST64(0x0202000000000200), CONST64(0x0202000200000200), CONST64(0x0202000000000202), CONST64(0x0202000200000202), + CONST64(0x0202020000000200), CONST64(0x0202020200000200), CONST64(0x0202020000000202), CONST64(0x0202020200000202), + CONST64(0x0200000000020000), CONST64(0x0200000200020000), CONST64(0x0200000000020002), CONST64(0x0200000200020002), + CONST64(0x0200020000020000), CONST64(0x0200020200020000), CONST64(0x0200020000020002), CONST64(0x0200020200020002), + CONST64(0x0200000000020200), CONST64(0x0200000200020200), CONST64(0x0200000000020202), CONST64(0x0200000200020202), + CONST64(0x0200020000020200), CONST64(0x0200020200020200), CONST64(0x0200020000020202), CONST64(0x0200020200020202), + CONST64(0x0202000000020000), CONST64(0x0202000200020000), CONST64(0x0202000000020002), CONST64(0x0202000200020002), + CONST64(0x0202020000020000), CONST64(0x0202020200020000), CONST64(0x0202020000020002), CONST64(0x0202020200020002), + CONST64(0x0202000000020200), CONST64(0x0202000200020200), CONST64(0x0202000000020202), CONST64(0x0202000200020202), + CONST64(0x0202020000020200), CONST64(0x0202020200020200), CONST64(0x0202020000020202), CONST64(0x0202020200020202), + CONST64(0x0000000002000000), CONST64(0x0000000202000000), CONST64(0x0000000002000002), CONST64(0x0000000202000002), + CONST64(0x0000020002000000), CONST64(0x0000020202000000), CONST64(0x0000020002000002), CONST64(0x0000020202000002), + CONST64(0x0000000002000200), CONST64(0x0000000202000200), CONST64(0x0000000002000202), CONST64(0x0000000202000202), + CONST64(0x0000020002000200), CONST64(0x0000020202000200), CONST64(0x0000020002000202), CONST64(0x0000020202000202), + CONST64(0x0002000002000000), CONST64(0x0002000202000000), CONST64(0x0002000002000002), CONST64(0x0002000202000002), + CONST64(0x0002020002000000), CONST64(0x0002020202000000), CONST64(0x0002020002000002), CONST64(0x0002020202000002), + CONST64(0x0002000002000200), CONST64(0x0002000202000200), CONST64(0x0002000002000202), CONST64(0x0002000202000202), + CONST64(0x0002020002000200), CONST64(0x0002020202000200), CONST64(0x0002020002000202), CONST64(0x0002020202000202), + CONST64(0x0000000002020000), CONST64(0x0000000202020000), CONST64(0x0000000002020002), CONST64(0x0000000202020002), + CONST64(0x0000020002020000), CONST64(0x0000020202020000), CONST64(0x0000020002020002), CONST64(0x0000020202020002), + CONST64(0x0000000002020200), CONST64(0x0000000202020200), CONST64(0x0000000002020202), CONST64(0x0000000202020202), + CONST64(0x0000020002020200), CONST64(0x0000020202020200), CONST64(0x0000020002020202), CONST64(0x0000020202020202), + CONST64(0x0002000002020000), CONST64(0x0002000202020000), CONST64(0x0002000002020002), CONST64(0x0002000202020002), + CONST64(0x0002020002020000), CONST64(0x0002020202020000), CONST64(0x0002020002020002), CONST64(0x0002020202020002), + CONST64(0x0002000002020200), CONST64(0x0002000202020200), CONST64(0x0002000002020202), CONST64(0x0002000202020202), + CONST64(0x0002020002020200), CONST64(0x0002020202020200), CONST64(0x0002020002020202), CONST64(0x0002020202020202), + CONST64(0x0200000002000000), CONST64(0x0200000202000000), CONST64(0x0200000002000002), CONST64(0x0200000202000002), + CONST64(0x0200020002000000), CONST64(0x0200020202000000), CONST64(0x0200020002000002), CONST64(0x0200020202000002), + CONST64(0x0200000002000200), CONST64(0x0200000202000200), CONST64(0x0200000002000202), CONST64(0x0200000202000202), + CONST64(0x0200020002000200), CONST64(0x0200020202000200), CONST64(0x0200020002000202), CONST64(0x0200020202000202), + CONST64(0x0202000002000000), CONST64(0x0202000202000000), CONST64(0x0202000002000002), CONST64(0x0202000202000002), + CONST64(0x0202020002000000), CONST64(0x0202020202000000), CONST64(0x0202020002000002), CONST64(0x0202020202000002), + CONST64(0x0202000002000200), CONST64(0x0202000202000200), CONST64(0x0202000002000202), CONST64(0x0202000202000202), + CONST64(0x0202020002000200), CONST64(0x0202020202000200), CONST64(0x0202020002000202), CONST64(0x0202020202000202), + CONST64(0x0200000002020000), CONST64(0x0200000202020000), CONST64(0x0200000002020002), CONST64(0x0200000202020002), + CONST64(0x0200020002020000), CONST64(0x0200020202020000), CONST64(0x0200020002020002), CONST64(0x0200020202020002), + CONST64(0x0200000002020200), CONST64(0x0200000202020200), CONST64(0x0200000002020202), CONST64(0x0200000202020202), + CONST64(0x0200020002020200), CONST64(0x0200020202020200), CONST64(0x0200020002020202), CONST64(0x0200020202020202), + CONST64(0x0202000002020000), CONST64(0x0202000202020000), CONST64(0x0202000002020002), CONST64(0x0202000202020002), + CONST64(0x0202020002020000), CONST64(0x0202020202020000), CONST64(0x0202020002020002), CONST64(0x0202020202020002), + CONST64(0x0202000002020200), CONST64(0x0202000202020200), CONST64(0x0202000002020202), CONST64(0x0202000202020202), CONST64(0x0202020002020200), CONST64(0x0202020202020200), CONST64(0x0202020002020202), CONST64(0x0202020202020202) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000010000000000), CONST64(0x0000000000000100), CONST64(0x0000010000000100), - CONST64(0x0001000000000000), CONST64(0x0001010000000000), CONST64(0x0001000000000100), CONST64(0x0001010000000100), - CONST64(0x0000000000010000), CONST64(0x0000010000010000), CONST64(0x0000000000010100), CONST64(0x0000010000010100), - CONST64(0x0001000000010000), CONST64(0x0001010000010000), CONST64(0x0001000000010100), CONST64(0x0001010000010100), - CONST64(0x0100000000000000), CONST64(0x0100010000000000), CONST64(0x0100000000000100), CONST64(0x0100010000000100), - CONST64(0x0101000000000000), CONST64(0x0101010000000000), CONST64(0x0101000000000100), CONST64(0x0101010000000100), - CONST64(0x0100000000010000), CONST64(0x0100010000010000), CONST64(0x0100000000010100), CONST64(0x0100010000010100), - CONST64(0x0101000000010000), CONST64(0x0101010000010000), CONST64(0x0101000000010100), CONST64(0x0101010000010100), - CONST64(0x0000000001000000), CONST64(0x0000010001000000), CONST64(0x0000000001000100), CONST64(0x0000010001000100), - CONST64(0x0001000001000000), CONST64(0x0001010001000000), CONST64(0x0001000001000100), CONST64(0x0001010001000100), - CONST64(0x0000000001010000), CONST64(0x0000010001010000), CONST64(0x0000000001010100), CONST64(0x0000010001010100), - CONST64(0x0001000001010000), CONST64(0x0001010001010000), CONST64(0x0001000001010100), CONST64(0x0001010001010100), - CONST64(0x0100000001000000), CONST64(0x0100010001000000), CONST64(0x0100000001000100), CONST64(0x0100010001000100), - CONST64(0x0101000001000000), CONST64(0x0101010001000000), CONST64(0x0101000001000100), CONST64(0x0101010001000100), - CONST64(0x0100000001010000), CONST64(0x0100010001010000), CONST64(0x0100000001010100), CONST64(0x0100010001010100), - CONST64(0x0101000001010000), CONST64(0x0101010001010000), CONST64(0x0101000001010100), CONST64(0x0101010001010100), - CONST64(0x0000000100000000), CONST64(0x0000010100000000), CONST64(0x0000000100000100), CONST64(0x0000010100000100), - CONST64(0x0001000100000000), CONST64(0x0001010100000000), CONST64(0x0001000100000100), CONST64(0x0001010100000100), - CONST64(0x0000000100010000), CONST64(0x0000010100010000), CONST64(0x0000000100010100), CONST64(0x0000010100010100), - CONST64(0x0001000100010000), CONST64(0x0001010100010000), CONST64(0x0001000100010100), CONST64(0x0001010100010100), - CONST64(0x0100000100000000), CONST64(0x0100010100000000), CONST64(0x0100000100000100), CONST64(0x0100010100000100), - CONST64(0x0101000100000000), CONST64(0x0101010100000000), CONST64(0x0101000100000100), CONST64(0x0101010100000100), - CONST64(0x0100000100010000), CONST64(0x0100010100010000), CONST64(0x0100000100010100), CONST64(0x0100010100010100), - CONST64(0x0101000100010000), CONST64(0x0101010100010000), CONST64(0x0101000100010100), CONST64(0x0101010100010100), - CONST64(0x0000000101000000), CONST64(0x0000010101000000), CONST64(0x0000000101000100), CONST64(0x0000010101000100), - CONST64(0x0001000101000000), CONST64(0x0001010101000000), CONST64(0x0001000101000100), CONST64(0x0001010101000100), - CONST64(0x0000000101010000), CONST64(0x0000010101010000), CONST64(0x0000000101010100), CONST64(0x0000010101010100), - CONST64(0x0001000101010000), CONST64(0x0001010101010000), CONST64(0x0001000101010100), CONST64(0x0001010101010100), - CONST64(0x0100000101000000), CONST64(0x0100010101000000), CONST64(0x0100000101000100), CONST64(0x0100010101000100), - CONST64(0x0101000101000000), CONST64(0x0101010101000000), CONST64(0x0101000101000100), CONST64(0x0101010101000100), - CONST64(0x0100000101010000), CONST64(0x0100010101010000), CONST64(0x0100000101010100), CONST64(0x0100010101010100), - CONST64(0x0101000101010000), CONST64(0x0101010101010000), CONST64(0x0101000101010100), CONST64(0x0101010101010100), - CONST64(0x0000000000000001), CONST64(0x0000010000000001), CONST64(0x0000000000000101), CONST64(0x0000010000000101), - CONST64(0x0001000000000001), CONST64(0x0001010000000001), CONST64(0x0001000000000101), CONST64(0x0001010000000101), - CONST64(0x0000000000010001), CONST64(0x0000010000010001), CONST64(0x0000000000010101), CONST64(0x0000010000010101), - CONST64(0x0001000000010001), CONST64(0x0001010000010001), CONST64(0x0001000000010101), CONST64(0x0001010000010101), - CONST64(0x0100000000000001), CONST64(0x0100010000000001), CONST64(0x0100000000000101), CONST64(0x0100010000000101), - CONST64(0x0101000000000001), CONST64(0x0101010000000001), CONST64(0x0101000000000101), CONST64(0x0101010000000101), - CONST64(0x0100000000010001), CONST64(0x0100010000010001), CONST64(0x0100000000010101), CONST64(0x0100010000010101), - CONST64(0x0101000000010001), CONST64(0x0101010000010001), CONST64(0x0101000000010101), CONST64(0x0101010000010101), - CONST64(0x0000000001000001), CONST64(0x0000010001000001), CONST64(0x0000000001000101), CONST64(0x0000010001000101), - CONST64(0x0001000001000001), CONST64(0x0001010001000001), CONST64(0x0001000001000101), CONST64(0x0001010001000101), - CONST64(0x0000000001010001), CONST64(0x0000010001010001), CONST64(0x0000000001010101), CONST64(0x0000010001010101), - CONST64(0x0001000001010001), CONST64(0x0001010001010001), CONST64(0x0001000001010101), CONST64(0x0001010001010101), - CONST64(0x0100000001000001), CONST64(0x0100010001000001), CONST64(0x0100000001000101), CONST64(0x0100010001000101), - CONST64(0x0101000001000001), CONST64(0x0101010001000001), CONST64(0x0101000001000101), CONST64(0x0101010001000101), - CONST64(0x0100000001010001), CONST64(0x0100010001010001), CONST64(0x0100000001010101), CONST64(0x0100010001010101), - CONST64(0x0101000001010001), CONST64(0x0101010001010001), CONST64(0x0101000001010101), CONST64(0x0101010001010101), - CONST64(0x0000000100000001), CONST64(0x0000010100000001), CONST64(0x0000000100000101), CONST64(0x0000010100000101), - CONST64(0x0001000100000001), CONST64(0x0001010100000001), CONST64(0x0001000100000101), CONST64(0x0001010100000101), - CONST64(0x0000000100010001), CONST64(0x0000010100010001), CONST64(0x0000000100010101), CONST64(0x0000010100010101), - CONST64(0x0001000100010001), CONST64(0x0001010100010001), CONST64(0x0001000100010101), CONST64(0x0001010100010101), - CONST64(0x0100000100000001), CONST64(0x0100010100000001), CONST64(0x0100000100000101), CONST64(0x0100010100000101), - CONST64(0x0101000100000001), CONST64(0x0101010100000001), CONST64(0x0101000100000101), CONST64(0x0101010100000101), - CONST64(0x0100000100010001), CONST64(0x0100010100010001), CONST64(0x0100000100010101), CONST64(0x0100010100010101), - CONST64(0x0101000100010001), CONST64(0x0101010100010001), CONST64(0x0101000100010101), CONST64(0x0101010100010101), - CONST64(0x0000000101000001), CONST64(0x0000010101000001), CONST64(0x0000000101000101), CONST64(0x0000010101000101), - CONST64(0x0001000101000001), CONST64(0x0001010101000001), CONST64(0x0001000101000101), CONST64(0x0001010101000101), - CONST64(0x0000000101010001), CONST64(0x0000010101010001), CONST64(0x0000000101010101), CONST64(0x0000010101010101), - CONST64(0x0001000101010001), CONST64(0x0001010101010001), CONST64(0x0001000101010101), CONST64(0x0001010101010101), - CONST64(0x0100000101000001), CONST64(0x0100010101000001), CONST64(0x0100000101000101), CONST64(0x0100010101000101), - CONST64(0x0101000101000001), CONST64(0x0101010101000001), CONST64(0x0101000101000101), CONST64(0x0101010101000101), - CONST64(0x0100000101010001), CONST64(0x0100010101010001), CONST64(0x0100000101010101), CONST64(0x0100010101010101), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000010000000000), CONST64(0x0000000000000100), CONST64(0x0000010000000100), + CONST64(0x0001000000000000), CONST64(0x0001010000000000), CONST64(0x0001000000000100), CONST64(0x0001010000000100), + CONST64(0x0000000000010000), CONST64(0x0000010000010000), CONST64(0x0000000000010100), CONST64(0x0000010000010100), + CONST64(0x0001000000010000), CONST64(0x0001010000010000), CONST64(0x0001000000010100), CONST64(0x0001010000010100), + CONST64(0x0100000000000000), CONST64(0x0100010000000000), CONST64(0x0100000000000100), CONST64(0x0100010000000100), + CONST64(0x0101000000000000), CONST64(0x0101010000000000), CONST64(0x0101000000000100), CONST64(0x0101010000000100), + CONST64(0x0100000000010000), CONST64(0x0100010000010000), CONST64(0x0100000000010100), CONST64(0x0100010000010100), + CONST64(0x0101000000010000), CONST64(0x0101010000010000), CONST64(0x0101000000010100), CONST64(0x0101010000010100), + CONST64(0x0000000001000000), CONST64(0x0000010001000000), CONST64(0x0000000001000100), CONST64(0x0000010001000100), + CONST64(0x0001000001000000), CONST64(0x0001010001000000), CONST64(0x0001000001000100), CONST64(0x0001010001000100), + CONST64(0x0000000001010000), CONST64(0x0000010001010000), CONST64(0x0000000001010100), CONST64(0x0000010001010100), + CONST64(0x0001000001010000), CONST64(0x0001010001010000), CONST64(0x0001000001010100), CONST64(0x0001010001010100), + CONST64(0x0100000001000000), CONST64(0x0100010001000000), CONST64(0x0100000001000100), CONST64(0x0100010001000100), + CONST64(0x0101000001000000), CONST64(0x0101010001000000), CONST64(0x0101000001000100), CONST64(0x0101010001000100), + CONST64(0x0100000001010000), CONST64(0x0100010001010000), CONST64(0x0100000001010100), CONST64(0x0100010001010100), + CONST64(0x0101000001010000), CONST64(0x0101010001010000), CONST64(0x0101000001010100), CONST64(0x0101010001010100), + CONST64(0x0000000100000000), CONST64(0x0000010100000000), CONST64(0x0000000100000100), CONST64(0x0000010100000100), + CONST64(0x0001000100000000), CONST64(0x0001010100000000), CONST64(0x0001000100000100), CONST64(0x0001010100000100), + CONST64(0x0000000100010000), CONST64(0x0000010100010000), CONST64(0x0000000100010100), CONST64(0x0000010100010100), + CONST64(0x0001000100010000), CONST64(0x0001010100010000), CONST64(0x0001000100010100), CONST64(0x0001010100010100), + CONST64(0x0100000100000000), CONST64(0x0100010100000000), CONST64(0x0100000100000100), CONST64(0x0100010100000100), + CONST64(0x0101000100000000), CONST64(0x0101010100000000), CONST64(0x0101000100000100), CONST64(0x0101010100000100), + CONST64(0x0100000100010000), CONST64(0x0100010100010000), CONST64(0x0100000100010100), CONST64(0x0100010100010100), + CONST64(0x0101000100010000), CONST64(0x0101010100010000), CONST64(0x0101000100010100), CONST64(0x0101010100010100), + CONST64(0x0000000101000000), CONST64(0x0000010101000000), CONST64(0x0000000101000100), CONST64(0x0000010101000100), + CONST64(0x0001000101000000), CONST64(0x0001010101000000), CONST64(0x0001000101000100), CONST64(0x0001010101000100), + CONST64(0x0000000101010000), CONST64(0x0000010101010000), CONST64(0x0000000101010100), CONST64(0x0000010101010100), + CONST64(0x0001000101010000), CONST64(0x0001010101010000), CONST64(0x0001000101010100), CONST64(0x0001010101010100), + CONST64(0x0100000101000000), CONST64(0x0100010101000000), CONST64(0x0100000101000100), CONST64(0x0100010101000100), + CONST64(0x0101000101000000), CONST64(0x0101010101000000), CONST64(0x0101000101000100), CONST64(0x0101010101000100), + CONST64(0x0100000101010000), CONST64(0x0100010101010000), CONST64(0x0100000101010100), CONST64(0x0100010101010100), + CONST64(0x0101000101010000), CONST64(0x0101010101010000), CONST64(0x0101000101010100), CONST64(0x0101010101010100), + CONST64(0x0000000000000001), CONST64(0x0000010000000001), CONST64(0x0000000000000101), CONST64(0x0000010000000101), + CONST64(0x0001000000000001), CONST64(0x0001010000000001), CONST64(0x0001000000000101), CONST64(0x0001010000000101), + CONST64(0x0000000000010001), CONST64(0x0000010000010001), CONST64(0x0000000000010101), CONST64(0x0000010000010101), + CONST64(0x0001000000010001), CONST64(0x0001010000010001), CONST64(0x0001000000010101), CONST64(0x0001010000010101), + CONST64(0x0100000000000001), CONST64(0x0100010000000001), CONST64(0x0100000000000101), CONST64(0x0100010000000101), + CONST64(0x0101000000000001), CONST64(0x0101010000000001), CONST64(0x0101000000000101), CONST64(0x0101010000000101), + CONST64(0x0100000000010001), CONST64(0x0100010000010001), CONST64(0x0100000000010101), CONST64(0x0100010000010101), + CONST64(0x0101000000010001), CONST64(0x0101010000010001), CONST64(0x0101000000010101), CONST64(0x0101010000010101), + CONST64(0x0000000001000001), CONST64(0x0000010001000001), CONST64(0x0000000001000101), CONST64(0x0000010001000101), + CONST64(0x0001000001000001), CONST64(0x0001010001000001), CONST64(0x0001000001000101), CONST64(0x0001010001000101), + CONST64(0x0000000001010001), CONST64(0x0000010001010001), CONST64(0x0000000001010101), CONST64(0x0000010001010101), + CONST64(0x0001000001010001), CONST64(0x0001010001010001), CONST64(0x0001000001010101), CONST64(0x0001010001010101), + CONST64(0x0100000001000001), CONST64(0x0100010001000001), CONST64(0x0100000001000101), CONST64(0x0100010001000101), + CONST64(0x0101000001000001), CONST64(0x0101010001000001), CONST64(0x0101000001000101), CONST64(0x0101010001000101), + CONST64(0x0100000001010001), CONST64(0x0100010001010001), CONST64(0x0100000001010101), CONST64(0x0100010001010101), + CONST64(0x0101000001010001), CONST64(0x0101010001010001), CONST64(0x0101000001010101), CONST64(0x0101010001010101), + CONST64(0x0000000100000001), CONST64(0x0000010100000001), CONST64(0x0000000100000101), CONST64(0x0000010100000101), + CONST64(0x0001000100000001), CONST64(0x0001010100000001), CONST64(0x0001000100000101), CONST64(0x0001010100000101), + CONST64(0x0000000100010001), CONST64(0x0000010100010001), CONST64(0x0000000100010101), CONST64(0x0000010100010101), + CONST64(0x0001000100010001), CONST64(0x0001010100010001), CONST64(0x0001000100010101), CONST64(0x0001010100010101), + CONST64(0x0100000100000001), CONST64(0x0100010100000001), CONST64(0x0100000100000101), CONST64(0x0100010100000101), + CONST64(0x0101000100000001), CONST64(0x0101010100000001), CONST64(0x0101000100000101), CONST64(0x0101010100000101), + CONST64(0x0100000100010001), CONST64(0x0100010100010001), CONST64(0x0100000100010101), CONST64(0x0100010100010101), + CONST64(0x0101000100010001), CONST64(0x0101010100010001), CONST64(0x0101000100010101), CONST64(0x0101010100010101), + CONST64(0x0000000101000001), CONST64(0x0000010101000001), CONST64(0x0000000101000101), CONST64(0x0000010101000101), + CONST64(0x0001000101000001), CONST64(0x0001010101000001), CONST64(0x0001000101000101), CONST64(0x0001010101000101), + CONST64(0x0000000101010001), CONST64(0x0000010101010001), CONST64(0x0000000101010101), CONST64(0x0000010101010101), + CONST64(0x0001000101010001), CONST64(0x0001010101010001), CONST64(0x0001000101010101), CONST64(0x0001010101010101), + CONST64(0x0100000101000001), CONST64(0x0100010101000001), CONST64(0x0100000101000101), CONST64(0x0100010101000101), + CONST64(0x0101000101000001), CONST64(0x0101010101000001), CONST64(0x0101000101000101), CONST64(0x0101010101000101), + CONST64(0x0100000101010001), CONST64(0x0100010101010001), CONST64(0x0100000101010101), CONST64(0x0100010101010101), CONST64(0x0101000101010001), CONST64(0x0101010101010001), CONST64(0x0101000101010101), CONST64(0x0101010101010101) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000008000000000), CONST64(0x0000000000000080), CONST64(0x0000008000000080), - CONST64(0x0000800000000000), CONST64(0x0000808000000000), CONST64(0x0000800000000080), CONST64(0x0000808000000080), - CONST64(0x0000000000008000), CONST64(0x0000008000008000), CONST64(0x0000000000008080), CONST64(0x0000008000008080), - CONST64(0x0000800000008000), CONST64(0x0000808000008000), CONST64(0x0000800000008080), CONST64(0x0000808000008080), - CONST64(0x0080000000000000), CONST64(0x0080008000000000), CONST64(0x0080000000000080), CONST64(0x0080008000000080), - CONST64(0x0080800000000000), CONST64(0x0080808000000000), CONST64(0x0080800000000080), CONST64(0x0080808000000080), - CONST64(0x0080000000008000), CONST64(0x0080008000008000), CONST64(0x0080000000008080), CONST64(0x0080008000008080), - CONST64(0x0080800000008000), CONST64(0x0080808000008000), CONST64(0x0080800000008080), CONST64(0x0080808000008080), - CONST64(0x0000000000800000), CONST64(0x0000008000800000), CONST64(0x0000000000800080), CONST64(0x0000008000800080), - CONST64(0x0000800000800000), CONST64(0x0000808000800000), CONST64(0x0000800000800080), CONST64(0x0000808000800080), - CONST64(0x0000000000808000), CONST64(0x0000008000808000), CONST64(0x0000000000808080), CONST64(0x0000008000808080), - CONST64(0x0000800000808000), CONST64(0x0000808000808000), CONST64(0x0000800000808080), CONST64(0x0000808000808080), - CONST64(0x0080000000800000), CONST64(0x0080008000800000), CONST64(0x0080000000800080), CONST64(0x0080008000800080), - CONST64(0x0080800000800000), CONST64(0x0080808000800000), CONST64(0x0080800000800080), CONST64(0x0080808000800080), - CONST64(0x0080000000808000), CONST64(0x0080008000808000), CONST64(0x0080000000808080), CONST64(0x0080008000808080), - CONST64(0x0080800000808000), CONST64(0x0080808000808000), CONST64(0x0080800000808080), CONST64(0x0080808000808080), - CONST64(0x8000000000000000), CONST64(0x8000008000000000), CONST64(0x8000000000000080), CONST64(0x8000008000000080), - CONST64(0x8000800000000000), CONST64(0x8000808000000000), CONST64(0x8000800000000080), CONST64(0x8000808000000080), - CONST64(0x8000000000008000), CONST64(0x8000008000008000), CONST64(0x8000000000008080), CONST64(0x8000008000008080), - CONST64(0x8000800000008000), CONST64(0x8000808000008000), CONST64(0x8000800000008080), CONST64(0x8000808000008080), - CONST64(0x8080000000000000), CONST64(0x8080008000000000), CONST64(0x8080000000000080), CONST64(0x8080008000000080), - CONST64(0x8080800000000000), CONST64(0x8080808000000000), CONST64(0x8080800000000080), CONST64(0x8080808000000080), - CONST64(0x8080000000008000), CONST64(0x8080008000008000), CONST64(0x8080000000008080), CONST64(0x8080008000008080), - CONST64(0x8080800000008000), CONST64(0x8080808000008000), CONST64(0x8080800000008080), CONST64(0x8080808000008080), - CONST64(0x8000000000800000), CONST64(0x8000008000800000), CONST64(0x8000000000800080), CONST64(0x8000008000800080), - CONST64(0x8000800000800000), CONST64(0x8000808000800000), CONST64(0x8000800000800080), CONST64(0x8000808000800080), - CONST64(0x8000000000808000), CONST64(0x8000008000808000), CONST64(0x8000000000808080), CONST64(0x8000008000808080), - CONST64(0x8000800000808000), CONST64(0x8000808000808000), CONST64(0x8000800000808080), CONST64(0x8000808000808080), - CONST64(0x8080000000800000), CONST64(0x8080008000800000), CONST64(0x8080000000800080), CONST64(0x8080008000800080), - CONST64(0x8080800000800000), CONST64(0x8080808000800000), CONST64(0x8080800000800080), CONST64(0x8080808000800080), - CONST64(0x8080000000808000), CONST64(0x8080008000808000), CONST64(0x8080000000808080), CONST64(0x8080008000808080), - CONST64(0x8080800000808000), CONST64(0x8080808000808000), CONST64(0x8080800000808080), CONST64(0x8080808000808080), - CONST64(0x0000000080000000), CONST64(0x0000008080000000), CONST64(0x0000000080000080), CONST64(0x0000008080000080), - CONST64(0x0000800080000000), CONST64(0x0000808080000000), CONST64(0x0000800080000080), CONST64(0x0000808080000080), - CONST64(0x0000000080008000), CONST64(0x0000008080008000), CONST64(0x0000000080008080), CONST64(0x0000008080008080), - CONST64(0x0000800080008000), CONST64(0x0000808080008000), CONST64(0x0000800080008080), CONST64(0x0000808080008080), - CONST64(0x0080000080000000), CONST64(0x0080008080000000), CONST64(0x0080000080000080), CONST64(0x0080008080000080), - CONST64(0x0080800080000000), CONST64(0x0080808080000000), CONST64(0x0080800080000080), CONST64(0x0080808080000080), - CONST64(0x0080000080008000), CONST64(0x0080008080008000), CONST64(0x0080000080008080), CONST64(0x0080008080008080), - CONST64(0x0080800080008000), CONST64(0x0080808080008000), CONST64(0x0080800080008080), CONST64(0x0080808080008080), - CONST64(0x0000000080800000), CONST64(0x0000008080800000), CONST64(0x0000000080800080), CONST64(0x0000008080800080), - CONST64(0x0000800080800000), CONST64(0x0000808080800000), CONST64(0x0000800080800080), CONST64(0x0000808080800080), - CONST64(0x0000000080808000), CONST64(0x0000008080808000), CONST64(0x0000000080808080), CONST64(0x0000008080808080), - CONST64(0x0000800080808000), CONST64(0x0000808080808000), CONST64(0x0000800080808080), CONST64(0x0000808080808080), - CONST64(0x0080000080800000), CONST64(0x0080008080800000), CONST64(0x0080000080800080), CONST64(0x0080008080800080), - CONST64(0x0080800080800000), CONST64(0x0080808080800000), CONST64(0x0080800080800080), CONST64(0x0080808080800080), - CONST64(0x0080000080808000), CONST64(0x0080008080808000), CONST64(0x0080000080808080), CONST64(0x0080008080808080), - CONST64(0x0080800080808000), CONST64(0x0080808080808000), CONST64(0x0080800080808080), CONST64(0x0080808080808080), - CONST64(0x8000000080000000), CONST64(0x8000008080000000), CONST64(0x8000000080000080), CONST64(0x8000008080000080), - CONST64(0x8000800080000000), CONST64(0x8000808080000000), CONST64(0x8000800080000080), CONST64(0x8000808080000080), - CONST64(0x8000000080008000), CONST64(0x8000008080008000), CONST64(0x8000000080008080), CONST64(0x8000008080008080), - CONST64(0x8000800080008000), CONST64(0x8000808080008000), CONST64(0x8000800080008080), CONST64(0x8000808080008080), - CONST64(0x8080000080000000), CONST64(0x8080008080000000), CONST64(0x8080000080000080), CONST64(0x8080008080000080), - CONST64(0x8080800080000000), CONST64(0x8080808080000000), CONST64(0x8080800080000080), CONST64(0x8080808080000080), - CONST64(0x8080000080008000), CONST64(0x8080008080008000), CONST64(0x8080000080008080), CONST64(0x8080008080008080), - CONST64(0x8080800080008000), CONST64(0x8080808080008000), CONST64(0x8080800080008080), CONST64(0x8080808080008080), - CONST64(0x8000000080800000), CONST64(0x8000008080800000), CONST64(0x8000000080800080), CONST64(0x8000008080800080), - CONST64(0x8000800080800000), CONST64(0x8000808080800000), CONST64(0x8000800080800080), CONST64(0x8000808080800080), - CONST64(0x8000000080808000), CONST64(0x8000008080808000), CONST64(0x8000000080808080), CONST64(0x8000008080808080), - CONST64(0x8000800080808000), CONST64(0x8000808080808000), CONST64(0x8000800080808080), CONST64(0x8000808080808080), - CONST64(0x8080000080800000), CONST64(0x8080008080800000), CONST64(0x8080000080800080), CONST64(0x8080008080800080), - CONST64(0x8080800080800000), CONST64(0x8080808080800000), CONST64(0x8080800080800080), CONST64(0x8080808080800080), - CONST64(0x8080000080808000), CONST64(0x8080008080808000), CONST64(0x8080000080808080), CONST64(0x8080008080808080), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000008000000000), CONST64(0x0000000000000080), CONST64(0x0000008000000080), + CONST64(0x0000800000000000), CONST64(0x0000808000000000), CONST64(0x0000800000000080), CONST64(0x0000808000000080), + CONST64(0x0000000000008000), CONST64(0x0000008000008000), CONST64(0x0000000000008080), CONST64(0x0000008000008080), + CONST64(0x0000800000008000), CONST64(0x0000808000008000), CONST64(0x0000800000008080), CONST64(0x0000808000008080), + CONST64(0x0080000000000000), CONST64(0x0080008000000000), CONST64(0x0080000000000080), CONST64(0x0080008000000080), + CONST64(0x0080800000000000), CONST64(0x0080808000000000), CONST64(0x0080800000000080), CONST64(0x0080808000000080), + CONST64(0x0080000000008000), CONST64(0x0080008000008000), CONST64(0x0080000000008080), CONST64(0x0080008000008080), + CONST64(0x0080800000008000), CONST64(0x0080808000008000), CONST64(0x0080800000008080), CONST64(0x0080808000008080), + CONST64(0x0000000000800000), CONST64(0x0000008000800000), CONST64(0x0000000000800080), CONST64(0x0000008000800080), + CONST64(0x0000800000800000), CONST64(0x0000808000800000), CONST64(0x0000800000800080), CONST64(0x0000808000800080), + CONST64(0x0000000000808000), CONST64(0x0000008000808000), CONST64(0x0000000000808080), CONST64(0x0000008000808080), + CONST64(0x0000800000808000), CONST64(0x0000808000808000), CONST64(0x0000800000808080), CONST64(0x0000808000808080), + CONST64(0x0080000000800000), CONST64(0x0080008000800000), CONST64(0x0080000000800080), CONST64(0x0080008000800080), + CONST64(0x0080800000800000), CONST64(0x0080808000800000), CONST64(0x0080800000800080), CONST64(0x0080808000800080), + CONST64(0x0080000000808000), CONST64(0x0080008000808000), CONST64(0x0080000000808080), CONST64(0x0080008000808080), + CONST64(0x0080800000808000), CONST64(0x0080808000808000), CONST64(0x0080800000808080), CONST64(0x0080808000808080), + CONST64(0x8000000000000000), CONST64(0x8000008000000000), CONST64(0x8000000000000080), CONST64(0x8000008000000080), + CONST64(0x8000800000000000), CONST64(0x8000808000000000), CONST64(0x8000800000000080), CONST64(0x8000808000000080), + CONST64(0x8000000000008000), CONST64(0x8000008000008000), CONST64(0x8000000000008080), CONST64(0x8000008000008080), + CONST64(0x8000800000008000), CONST64(0x8000808000008000), CONST64(0x8000800000008080), CONST64(0x8000808000008080), + CONST64(0x8080000000000000), CONST64(0x8080008000000000), CONST64(0x8080000000000080), CONST64(0x8080008000000080), + CONST64(0x8080800000000000), CONST64(0x8080808000000000), CONST64(0x8080800000000080), CONST64(0x8080808000000080), + CONST64(0x8080000000008000), CONST64(0x8080008000008000), CONST64(0x8080000000008080), CONST64(0x8080008000008080), + CONST64(0x8080800000008000), CONST64(0x8080808000008000), CONST64(0x8080800000008080), CONST64(0x8080808000008080), + CONST64(0x8000000000800000), CONST64(0x8000008000800000), CONST64(0x8000000000800080), CONST64(0x8000008000800080), + CONST64(0x8000800000800000), CONST64(0x8000808000800000), CONST64(0x8000800000800080), CONST64(0x8000808000800080), + CONST64(0x8000000000808000), CONST64(0x8000008000808000), CONST64(0x8000000000808080), CONST64(0x8000008000808080), + CONST64(0x8000800000808000), CONST64(0x8000808000808000), CONST64(0x8000800000808080), CONST64(0x8000808000808080), + CONST64(0x8080000000800000), CONST64(0x8080008000800000), CONST64(0x8080000000800080), CONST64(0x8080008000800080), + CONST64(0x8080800000800000), CONST64(0x8080808000800000), CONST64(0x8080800000800080), CONST64(0x8080808000800080), + CONST64(0x8080000000808000), CONST64(0x8080008000808000), CONST64(0x8080000000808080), CONST64(0x8080008000808080), + CONST64(0x8080800000808000), CONST64(0x8080808000808000), CONST64(0x8080800000808080), CONST64(0x8080808000808080), + CONST64(0x0000000080000000), CONST64(0x0000008080000000), CONST64(0x0000000080000080), CONST64(0x0000008080000080), + CONST64(0x0000800080000000), CONST64(0x0000808080000000), CONST64(0x0000800080000080), CONST64(0x0000808080000080), + CONST64(0x0000000080008000), CONST64(0x0000008080008000), CONST64(0x0000000080008080), CONST64(0x0000008080008080), + CONST64(0x0000800080008000), CONST64(0x0000808080008000), CONST64(0x0000800080008080), CONST64(0x0000808080008080), + CONST64(0x0080000080000000), CONST64(0x0080008080000000), CONST64(0x0080000080000080), CONST64(0x0080008080000080), + CONST64(0x0080800080000000), CONST64(0x0080808080000000), CONST64(0x0080800080000080), CONST64(0x0080808080000080), + CONST64(0x0080000080008000), CONST64(0x0080008080008000), CONST64(0x0080000080008080), CONST64(0x0080008080008080), + CONST64(0x0080800080008000), CONST64(0x0080808080008000), CONST64(0x0080800080008080), CONST64(0x0080808080008080), + CONST64(0x0000000080800000), CONST64(0x0000008080800000), CONST64(0x0000000080800080), CONST64(0x0000008080800080), + CONST64(0x0000800080800000), CONST64(0x0000808080800000), CONST64(0x0000800080800080), CONST64(0x0000808080800080), + CONST64(0x0000000080808000), CONST64(0x0000008080808000), CONST64(0x0000000080808080), CONST64(0x0000008080808080), + CONST64(0x0000800080808000), CONST64(0x0000808080808000), CONST64(0x0000800080808080), CONST64(0x0000808080808080), + CONST64(0x0080000080800000), CONST64(0x0080008080800000), CONST64(0x0080000080800080), CONST64(0x0080008080800080), + CONST64(0x0080800080800000), CONST64(0x0080808080800000), CONST64(0x0080800080800080), CONST64(0x0080808080800080), + CONST64(0x0080000080808000), CONST64(0x0080008080808000), CONST64(0x0080000080808080), CONST64(0x0080008080808080), + CONST64(0x0080800080808000), CONST64(0x0080808080808000), CONST64(0x0080800080808080), CONST64(0x0080808080808080), + CONST64(0x8000000080000000), CONST64(0x8000008080000000), CONST64(0x8000000080000080), CONST64(0x8000008080000080), + CONST64(0x8000800080000000), CONST64(0x8000808080000000), CONST64(0x8000800080000080), CONST64(0x8000808080000080), + CONST64(0x8000000080008000), CONST64(0x8000008080008000), CONST64(0x8000000080008080), CONST64(0x8000008080008080), + CONST64(0x8000800080008000), CONST64(0x8000808080008000), CONST64(0x8000800080008080), CONST64(0x8000808080008080), + CONST64(0x8080000080000000), CONST64(0x8080008080000000), CONST64(0x8080000080000080), CONST64(0x8080008080000080), + CONST64(0x8080800080000000), CONST64(0x8080808080000000), CONST64(0x8080800080000080), CONST64(0x8080808080000080), + CONST64(0x8080000080008000), CONST64(0x8080008080008000), CONST64(0x8080000080008080), CONST64(0x8080008080008080), + CONST64(0x8080800080008000), CONST64(0x8080808080008000), CONST64(0x8080800080008080), CONST64(0x8080808080008080), + CONST64(0x8000000080800000), CONST64(0x8000008080800000), CONST64(0x8000000080800080), CONST64(0x8000008080800080), + CONST64(0x8000800080800000), CONST64(0x8000808080800000), CONST64(0x8000800080800080), CONST64(0x8000808080800080), + CONST64(0x8000000080808000), CONST64(0x8000008080808000), CONST64(0x8000000080808080), CONST64(0x8000008080808080), + CONST64(0x8000800080808000), CONST64(0x8000808080808000), CONST64(0x8000800080808080), CONST64(0x8000808080808080), + CONST64(0x8080000080800000), CONST64(0x8080008080800000), CONST64(0x8080000080800080), CONST64(0x8080008080800080), + CONST64(0x8080800080800000), CONST64(0x8080808080800000), CONST64(0x8080800080800080), CONST64(0x8080808080800080), + CONST64(0x8080000080808000), CONST64(0x8080008080808000), CONST64(0x8080000080808080), CONST64(0x8080008080808080), CONST64(0x8080800080808000), CONST64(0x8080808080808000), CONST64(0x8080800080808080), CONST64(0x8080808080808080) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000004000000000), CONST64(0x0000000000000040), CONST64(0x0000004000000040), - CONST64(0x0000400000000000), CONST64(0x0000404000000000), CONST64(0x0000400000000040), CONST64(0x0000404000000040), - CONST64(0x0000000000004000), CONST64(0x0000004000004000), CONST64(0x0000000000004040), CONST64(0x0000004000004040), - CONST64(0x0000400000004000), CONST64(0x0000404000004000), CONST64(0x0000400000004040), CONST64(0x0000404000004040), - CONST64(0x0040000000000000), CONST64(0x0040004000000000), CONST64(0x0040000000000040), CONST64(0x0040004000000040), - CONST64(0x0040400000000000), CONST64(0x0040404000000000), CONST64(0x0040400000000040), CONST64(0x0040404000000040), - CONST64(0x0040000000004000), CONST64(0x0040004000004000), CONST64(0x0040000000004040), CONST64(0x0040004000004040), - CONST64(0x0040400000004000), CONST64(0x0040404000004000), CONST64(0x0040400000004040), CONST64(0x0040404000004040), - CONST64(0x0000000000400000), CONST64(0x0000004000400000), CONST64(0x0000000000400040), CONST64(0x0000004000400040), - CONST64(0x0000400000400000), CONST64(0x0000404000400000), CONST64(0x0000400000400040), CONST64(0x0000404000400040), - CONST64(0x0000000000404000), CONST64(0x0000004000404000), CONST64(0x0000000000404040), CONST64(0x0000004000404040), - CONST64(0x0000400000404000), CONST64(0x0000404000404000), CONST64(0x0000400000404040), CONST64(0x0000404000404040), - CONST64(0x0040000000400000), CONST64(0x0040004000400000), CONST64(0x0040000000400040), CONST64(0x0040004000400040), - CONST64(0x0040400000400000), CONST64(0x0040404000400000), CONST64(0x0040400000400040), CONST64(0x0040404000400040), - CONST64(0x0040000000404000), CONST64(0x0040004000404000), CONST64(0x0040000000404040), CONST64(0x0040004000404040), - CONST64(0x0040400000404000), CONST64(0x0040404000404000), CONST64(0x0040400000404040), CONST64(0x0040404000404040), - CONST64(0x4000000000000000), CONST64(0x4000004000000000), CONST64(0x4000000000000040), CONST64(0x4000004000000040), - CONST64(0x4000400000000000), CONST64(0x4000404000000000), CONST64(0x4000400000000040), CONST64(0x4000404000000040), - CONST64(0x4000000000004000), CONST64(0x4000004000004000), CONST64(0x4000000000004040), CONST64(0x4000004000004040), - CONST64(0x4000400000004000), CONST64(0x4000404000004000), CONST64(0x4000400000004040), CONST64(0x4000404000004040), - CONST64(0x4040000000000000), CONST64(0x4040004000000000), CONST64(0x4040000000000040), CONST64(0x4040004000000040), - CONST64(0x4040400000000000), CONST64(0x4040404000000000), CONST64(0x4040400000000040), CONST64(0x4040404000000040), - CONST64(0x4040000000004000), CONST64(0x4040004000004000), CONST64(0x4040000000004040), CONST64(0x4040004000004040), - CONST64(0x4040400000004000), CONST64(0x4040404000004000), CONST64(0x4040400000004040), CONST64(0x4040404000004040), - CONST64(0x4000000000400000), CONST64(0x4000004000400000), CONST64(0x4000000000400040), CONST64(0x4000004000400040), - CONST64(0x4000400000400000), CONST64(0x4000404000400000), CONST64(0x4000400000400040), CONST64(0x4000404000400040), - CONST64(0x4000000000404000), CONST64(0x4000004000404000), CONST64(0x4000000000404040), CONST64(0x4000004000404040), - CONST64(0x4000400000404000), CONST64(0x4000404000404000), CONST64(0x4000400000404040), CONST64(0x4000404000404040), - CONST64(0x4040000000400000), CONST64(0x4040004000400000), CONST64(0x4040000000400040), CONST64(0x4040004000400040), - CONST64(0x4040400000400000), CONST64(0x4040404000400000), CONST64(0x4040400000400040), CONST64(0x4040404000400040), - CONST64(0x4040000000404000), CONST64(0x4040004000404000), CONST64(0x4040000000404040), CONST64(0x4040004000404040), - CONST64(0x4040400000404000), CONST64(0x4040404000404000), CONST64(0x4040400000404040), CONST64(0x4040404000404040), - CONST64(0x0000000040000000), CONST64(0x0000004040000000), CONST64(0x0000000040000040), CONST64(0x0000004040000040), - CONST64(0x0000400040000000), CONST64(0x0000404040000000), CONST64(0x0000400040000040), CONST64(0x0000404040000040), - CONST64(0x0000000040004000), CONST64(0x0000004040004000), CONST64(0x0000000040004040), CONST64(0x0000004040004040), - CONST64(0x0000400040004000), CONST64(0x0000404040004000), CONST64(0x0000400040004040), CONST64(0x0000404040004040), - CONST64(0x0040000040000000), CONST64(0x0040004040000000), CONST64(0x0040000040000040), CONST64(0x0040004040000040), - CONST64(0x0040400040000000), CONST64(0x0040404040000000), CONST64(0x0040400040000040), CONST64(0x0040404040000040), - CONST64(0x0040000040004000), CONST64(0x0040004040004000), CONST64(0x0040000040004040), CONST64(0x0040004040004040), - CONST64(0x0040400040004000), CONST64(0x0040404040004000), CONST64(0x0040400040004040), CONST64(0x0040404040004040), - CONST64(0x0000000040400000), CONST64(0x0000004040400000), CONST64(0x0000000040400040), CONST64(0x0000004040400040), - CONST64(0x0000400040400000), CONST64(0x0000404040400000), CONST64(0x0000400040400040), CONST64(0x0000404040400040), - CONST64(0x0000000040404000), CONST64(0x0000004040404000), CONST64(0x0000000040404040), CONST64(0x0000004040404040), - CONST64(0x0000400040404000), CONST64(0x0000404040404000), CONST64(0x0000400040404040), CONST64(0x0000404040404040), - CONST64(0x0040000040400000), CONST64(0x0040004040400000), CONST64(0x0040000040400040), CONST64(0x0040004040400040), - CONST64(0x0040400040400000), CONST64(0x0040404040400000), CONST64(0x0040400040400040), CONST64(0x0040404040400040), - CONST64(0x0040000040404000), CONST64(0x0040004040404000), CONST64(0x0040000040404040), CONST64(0x0040004040404040), - CONST64(0x0040400040404000), CONST64(0x0040404040404000), CONST64(0x0040400040404040), CONST64(0x0040404040404040), - CONST64(0x4000000040000000), CONST64(0x4000004040000000), CONST64(0x4000000040000040), CONST64(0x4000004040000040), - CONST64(0x4000400040000000), CONST64(0x4000404040000000), CONST64(0x4000400040000040), CONST64(0x4000404040000040), - CONST64(0x4000000040004000), CONST64(0x4000004040004000), CONST64(0x4000000040004040), CONST64(0x4000004040004040), - CONST64(0x4000400040004000), CONST64(0x4000404040004000), CONST64(0x4000400040004040), CONST64(0x4000404040004040), - CONST64(0x4040000040000000), CONST64(0x4040004040000000), CONST64(0x4040000040000040), CONST64(0x4040004040000040), - CONST64(0x4040400040000000), CONST64(0x4040404040000000), CONST64(0x4040400040000040), CONST64(0x4040404040000040), - CONST64(0x4040000040004000), CONST64(0x4040004040004000), CONST64(0x4040000040004040), CONST64(0x4040004040004040), - CONST64(0x4040400040004000), CONST64(0x4040404040004000), CONST64(0x4040400040004040), CONST64(0x4040404040004040), - CONST64(0x4000000040400000), CONST64(0x4000004040400000), CONST64(0x4000000040400040), CONST64(0x4000004040400040), - CONST64(0x4000400040400000), CONST64(0x4000404040400000), CONST64(0x4000400040400040), CONST64(0x4000404040400040), - CONST64(0x4000000040404000), CONST64(0x4000004040404000), CONST64(0x4000000040404040), CONST64(0x4000004040404040), - CONST64(0x4000400040404000), CONST64(0x4000404040404000), CONST64(0x4000400040404040), CONST64(0x4000404040404040), - CONST64(0x4040000040400000), CONST64(0x4040004040400000), CONST64(0x4040000040400040), CONST64(0x4040004040400040), - CONST64(0x4040400040400000), CONST64(0x4040404040400000), CONST64(0x4040400040400040), CONST64(0x4040404040400040), - CONST64(0x4040000040404000), CONST64(0x4040004040404000), CONST64(0x4040000040404040), CONST64(0x4040004040404040), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000004000000000), CONST64(0x0000000000000040), CONST64(0x0000004000000040), + CONST64(0x0000400000000000), CONST64(0x0000404000000000), CONST64(0x0000400000000040), CONST64(0x0000404000000040), + CONST64(0x0000000000004000), CONST64(0x0000004000004000), CONST64(0x0000000000004040), CONST64(0x0000004000004040), + CONST64(0x0000400000004000), CONST64(0x0000404000004000), CONST64(0x0000400000004040), CONST64(0x0000404000004040), + CONST64(0x0040000000000000), CONST64(0x0040004000000000), CONST64(0x0040000000000040), CONST64(0x0040004000000040), + CONST64(0x0040400000000000), CONST64(0x0040404000000000), CONST64(0x0040400000000040), CONST64(0x0040404000000040), + CONST64(0x0040000000004000), CONST64(0x0040004000004000), CONST64(0x0040000000004040), CONST64(0x0040004000004040), + CONST64(0x0040400000004000), CONST64(0x0040404000004000), CONST64(0x0040400000004040), CONST64(0x0040404000004040), + CONST64(0x0000000000400000), CONST64(0x0000004000400000), CONST64(0x0000000000400040), CONST64(0x0000004000400040), + CONST64(0x0000400000400000), CONST64(0x0000404000400000), CONST64(0x0000400000400040), CONST64(0x0000404000400040), + CONST64(0x0000000000404000), CONST64(0x0000004000404000), CONST64(0x0000000000404040), CONST64(0x0000004000404040), + CONST64(0x0000400000404000), CONST64(0x0000404000404000), CONST64(0x0000400000404040), CONST64(0x0000404000404040), + CONST64(0x0040000000400000), CONST64(0x0040004000400000), CONST64(0x0040000000400040), CONST64(0x0040004000400040), + CONST64(0x0040400000400000), CONST64(0x0040404000400000), CONST64(0x0040400000400040), CONST64(0x0040404000400040), + CONST64(0x0040000000404000), CONST64(0x0040004000404000), CONST64(0x0040000000404040), CONST64(0x0040004000404040), + CONST64(0x0040400000404000), CONST64(0x0040404000404000), CONST64(0x0040400000404040), CONST64(0x0040404000404040), + CONST64(0x4000000000000000), CONST64(0x4000004000000000), CONST64(0x4000000000000040), CONST64(0x4000004000000040), + CONST64(0x4000400000000000), CONST64(0x4000404000000000), CONST64(0x4000400000000040), CONST64(0x4000404000000040), + CONST64(0x4000000000004000), CONST64(0x4000004000004000), CONST64(0x4000000000004040), CONST64(0x4000004000004040), + CONST64(0x4000400000004000), CONST64(0x4000404000004000), CONST64(0x4000400000004040), CONST64(0x4000404000004040), + CONST64(0x4040000000000000), CONST64(0x4040004000000000), CONST64(0x4040000000000040), CONST64(0x4040004000000040), + CONST64(0x4040400000000000), CONST64(0x4040404000000000), CONST64(0x4040400000000040), CONST64(0x4040404000000040), + CONST64(0x4040000000004000), CONST64(0x4040004000004000), CONST64(0x4040000000004040), CONST64(0x4040004000004040), + CONST64(0x4040400000004000), CONST64(0x4040404000004000), CONST64(0x4040400000004040), CONST64(0x4040404000004040), + CONST64(0x4000000000400000), CONST64(0x4000004000400000), CONST64(0x4000000000400040), CONST64(0x4000004000400040), + CONST64(0x4000400000400000), CONST64(0x4000404000400000), CONST64(0x4000400000400040), CONST64(0x4000404000400040), + CONST64(0x4000000000404000), CONST64(0x4000004000404000), CONST64(0x4000000000404040), CONST64(0x4000004000404040), + CONST64(0x4000400000404000), CONST64(0x4000404000404000), CONST64(0x4000400000404040), CONST64(0x4000404000404040), + CONST64(0x4040000000400000), CONST64(0x4040004000400000), CONST64(0x4040000000400040), CONST64(0x4040004000400040), + CONST64(0x4040400000400000), CONST64(0x4040404000400000), CONST64(0x4040400000400040), CONST64(0x4040404000400040), + CONST64(0x4040000000404000), CONST64(0x4040004000404000), CONST64(0x4040000000404040), CONST64(0x4040004000404040), + CONST64(0x4040400000404000), CONST64(0x4040404000404000), CONST64(0x4040400000404040), CONST64(0x4040404000404040), + CONST64(0x0000000040000000), CONST64(0x0000004040000000), CONST64(0x0000000040000040), CONST64(0x0000004040000040), + CONST64(0x0000400040000000), CONST64(0x0000404040000000), CONST64(0x0000400040000040), CONST64(0x0000404040000040), + CONST64(0x0000000040004000), CONST64(0x0000004040004000), CONST64(0x0000000040004040), CONST64(0x0000004040004040), + CONST64(0x0000400040004000), CONST64(0x0000404040004000), CONST64(0x0000400040004040), CONST64(0x0000404040004040), + CONST64(0x0040000040000000), CONST64(0x0040004040000000), CONST64(0x0040000040000040), CONST64(0x0040004040000040), + CONST64(0x0040400040000000), CONST64(0x0040404040000000), CONST64(0x0040400040000040), CONST64(0x0040404040000040), + CONST64(0x0040000040004000), CONST64(0x0040004040004000), CONST64(0x0040000040004040), CONST64(0x0040004040004040), + CONST64(0x0040400040004000), CONST64(0x0040404040004000), CONST64(0x0040400040004040), CONST64(0x0040404040004040), + CONST64(0x0000000040400000), CONST64(0x0000004040400000), CONST64(0x0000000040400040), CONST64(0x0000004040400040), + CONST64(0x0000400040400000), CONST64(0x0000404040400000), CONST64(0x0000400040400040), CONST64(0x0000404040400040), + CONST64(0x0000000040404000), CONST64(0x0000004040404000), CONST64(0x0000000040404040), CONST64(0x0000004040404040), + CONST64(0x0000400040404000), CONST64(0x0000404040404000), CONST64(0x0000400040404040), CONST64(0x0000404040404040), + CONST64(0x0040000040400000), CONST64(0x0040004040400000), CONST64(0x0040000040400040), CONST64(0x0040004040400040), + CONST64(0x0040400040400000), CONST64(0x0040404040400000), CONST64(0x0040400040400040), CONST64(0x0040404040400040), + CONST64(0x0040000040404000), CONST64(0x0040004040404000), CONST64(0x0040000040404040), CONST64(0x0040004040404040), + CONST64(0x0040400040404000), CONST64(0x0040404040404000), CONST64(0x0040400040404040), CONST64(0x0040404040404040), + CONST64(0x4000000040000000), CONST64(0x4000004040000000), CONST64(0x4000000040000040), CONST64(0x4000004040000040), + CONST64(0x4000400040000000), CONST64(0x4000404040000000), CONST64(0x4000400040000040), CONST64(0x4000404040000040), + CONST64(0x4000000040004000), CONST64(0x4000004040004000), CONST64(0x4000000040004040), CONST64(0x4000004040004040), + CONST64(0x4000400040004000), CONST64(0x4000404040004000), CONST64(0x4000400040004040), CONST64(0x4000404040004040), + CONST64(0x4040000040000000), CONST64(0x4040004040000000), CONST64(0x4040000040000040), CONST64(0x4040004040000040), + CONST64(0x4040400040000000), CONST64(0x4040404040000000), CONST64(0x4040400040000040), CONST64(0x4040404040000040), + CONST64(0x4040000040004000), CONST64(0x4040004040004000), CONST64(0x4040000040004040), CONST64(0x4040004040004040), + CONST64(0x4040400040004000), CONST64(0x4040404040004000), CONST64(0x4040400040004040), CONST64(0x4040404040004040), + CONST64(0x4000000040400000), CONST64(0x4000004040400000), CONST64(0x4000000040400040), CONST64(0x4000004040400040), + CONST64(0x4000400040400000), CONST64(0x4000404040400000), CONST64(0x4000400040400040), CONST64(0x4000404040400040), + CONST64(0x4000000040404000), CONST64(0x4000004040404000), CONST64(0x4000000040404040), CONST64(0x4000004040404040), + CONST64(0x4000400040404000), CONST64(0x4000404040404000), CONST64(0x4000400040404040), CONST64(0x4000404040404040), + CONST64(0x4040000040400000), CONST64(0x4040004040400000), CONST64(0x4040000040400040), CONST64(0x4040004040400040), + CONST64(0x4040400040400000), CONST64(0x4040404040400000), CONST64(0x4040400040400040), CONST64(0x4040404040400040), + CONST64(0x4040000040404000), CONST64(0x4040004040404000), CONST64(0x4040000040404040), CONST64(0x4040004040404040), CONST64(0x4040400040404000), CONST64(0x4040404040404000), CONST64(0x4040400040404040), CONST64(0x4040404040404040) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000002000000000), CONST64(0x0000000000000020), CONST64(0x0000002000000020), - CONST64(0x0000200000000000), CONST64(0x0000202000000000), CONST64(0x0000200000000020), CONST64(0x0000202000000020), - CONST64(0x0000000000002000), CONST64(0x0000002000002000), CONST64(0x0000000000002020), CONST64(0x0000002000002020), - CONST64(0x0000200000002000), CONST64(0x0000202000002000), CONST64(0x0000200000002020), CONST64(0x0000202000002020), - CONST64(0x0020000000000000), CONST64(0x0020002000000000), CONST64(0x0020000000000020), CONST64(0x0020002000000020), - CONST64(0x0020200000000000), CONST64(0x0020202000000000), CONST64(0x0020200000000020), CONST64(0x0020202000000020), - CONST64(0x0020000000002000), CONST64(0x0020002000002000), CONST64(0x0020000000002020), CONST64(0x0020002000002020), - CONST64(0x0020200000002000), CONST64(0x0020202000002000), CONST64(0x0020200000002020), CONST64(0x0020202000002020), - CONST64(0x0000000000200000), CONST64(0x0000002000200000), CONST64(0x0000000000200020), CONST64(0x0000002000200020), - CONST64(0x0000200000200000), CONST64(0x0000202000200000), CONST64(0x0000200000200020), CONST64(0x0000202000200020), - CONST64(0x0000000000202000), CONST64(0x0000002000202000), CONST64(0x0000000000202020), CONST64(0x0000002000202020), - CONST64(0x0000200000202000), CONST64(0x0000202000202000), CONST64(0x0000200000202020), CONST64(0x0000202000202020), - CONST64(0x0020000000200000), CONST64(0x0020002000200000), CONST64(0x0020000000200020), CONST64(0x0020002000200020), - CONST64(0x0020200000200000), CONST64(0x0020202000200000), CONST64(0x0020200000200020), CONST64(0x0020202000200020), - CONST64(0x0020000000202000), CONST64(0x0020002000202000), CONST64(0x0020000000202020), CONST64(0x0020002000202020), - CONST64(0x0020200000202000), CONST64(0x0020202000202000), CONST64(0x0020200000202020), CONST64(0x0020202000202020), - CONST64(0x2000000000000000), CONST64(0x2000002000000000), CONST64(0x2000000000000020), CONST64(0x2000002000000020), - CONST64(0x2000200000000000), CONST64(0x2000202000000000), CONST64(0x2000200000000020), CONST64(0x2000202000000020), - CONST64(0x2000000000002000), CONST64(0x2000002000002000), CONST64(0x2000000000002020), CONST64(0x2000002000002020), - CONST64(0x2000200000002000), CONST64(0x2000202000002000), CONST64(0x2000200000002020), CONST64(0x2000202000002020), - CONST64(0x2020000000000000), CONST64(0x2020002000000000), CONST64(0x2020000000000020), CONST64(0x2020002000000020), - CONST64(0x2020200000000000), CONST64(0x2020202000000000), CONST64(0x2020200000000020), CONST64(0x2020202000000020), - CONST64(0x2020000000002000), CONST64(0x2020002000002000), CONST64(0x2020000000002020), CONST64(0x2020002000002020), - CONST64(0x2020200000002000), CONST64(0x2020202000002000), CONST64(0x2020200000002020), CONST64(0x2020202000002020), - CONST64(0x2000000000200000), CONST64(0x2000002000200000), CONST64(0x2000000000200020), CONST64(0x2000002000200020), - CONST64(0x2000200000200000), CONST64(0x2000202000200000), CONST64(0x2000200000200020), CONST64(0x2000202000200020), - CONST64(0x2000000000202000), CONST64(0x2000002000202000), CONST64(0x2000000000202020), CONST64(0x2000002000202020), - CONST64(0x2000200000202000), CONST64(0x2000202000202000), CONST64(0x2000200000202020), CONST64(0x2000202000202020), - CONST64(0x2020000000200000), CONST64(0x2020002000200000), CONST64(0x2020000000200020), CONST64(0x2020002000200020), - CONST64(0x2020200000200000), CONST64(0x2020202000200000), CONST64(0x2020200000200020), CONST64(0x2020202000200020), - CONST64(0x2020000000202000), CONST64(0x2020002000202000), CONST64(0x2020000000202020), CONST64(0x2020002000202020), - CONST64(0x2020200000202000), CONST64(0x2020202000202000), CONST64(0x2020200000202020), CONST64(0x2020202000202020), - CONST64(0x0000000020000000), CONST64(0x0000002020000000), CONST64(0x0000000020000020), CONST64(0x0000002020000020), - CONST64(0x0000200020000000), CONST64(0x0000202020000000), CONST64(0x0000200020000020), CONST64(0x0000202020000020), - CONST64(0x0000000020002000), CONST64(0x0000002020002000), CONST64(0x0000000020002020), CONST64(0x0000002020002020), - CONST64(0x0000200020002000), CONST64(0x0000202020002000), CONST64(0x0000200020002020), CONST64(0x0000202020002020), - CONST64(0x0020000020000000), CONST64(0x0020002020000000), CONST64(0x0020000020000020), CONST64(0x0020002020000020), - CONST64(0x0020200020000000), CONST64(0x0020202020000000), CONST64(0x0020200020000020), CONST64(0x0020202020000020), - CONST64(0x0020000020002000), CONST64(0x0020002020002000), CONST64(0x0020000020002020), CONST64(0x0020002020002020), - CONST64(0x0020200020002000), CONST64(0x0020202020002000), CONST64(0x0020200020002020), CONST64(0x0020202020002020), - CONST64(0x0000000020200000), CONST64(0x0000002020200000), CONST64(0x0000000020200020), CONST64(0x0000002020200020), - CONST64(0x0000200020200000), CONST64(0x0000202020200000), CONST64(0x0000200020200020), CONST64(0x0000202020200020), - CONST64(0x0000000020202000), CONST64(0x0000002020202000), CONST64(0x0000000020202020), CONST64(0x0000002020202020), - CONST64(0x0000200020202000), CONST64(0x0000202020202000), CONST64(0x0000200020202020), CONST64(0x0000202020202020), - CONST64(0x0020000020200000), CONST64(0x0020002020200000), CONST64(0x0020000020200020), CONST64(0x0020002020200020), - CONST64(0x0020200020200000), CONST64(0x0020202020200000), CONST64(0x0020200020200020), CONST64(0x0020202020200020), - CONST64(0x0020000020202000), CONST64(0x0020002020202000), CONST64(0x0020000020202020), CONST64(0x0020002020202020), - CONST64(0x0020200020202000), CONST64(0x0020202020202000), CONST64(0x0020200020202020), CONST64(0x0020202020202020), - CONST64(0x2000000020000000), CONST64(0x2000002020000000), CONST64(0x2000000020000020), CONST64(0x2000002020000020), - CONST64(0x2000200020000000), CONST64(0x2000202020000000), CONST64(0x2000200020000020), CONST64(0x2000202020000020), - CONST64(0x2000000020002000), CONST64(0x2000002020002000), CONST64(0x2000000020002020), CONST64(0x2000002020002020), - CONST64(0x2000200020002000), CONST64(0x2000202020002000), CONST64(0x2000200020002020), CONST64(0x2000202020002020), - CONST64(0x2020000020000000), CONST64(0x2020002020000000), CONST64(0x2020000020000020), CONST64(0x2020002020000020), - CONST64(0x2020200020000000), CONST64(0x2020202020000000), CONST64(0x2020200020000020), CONST64(0x2020202020000020), - CONST64(0x2020000020002000), CONST64(0x2020002020002000), CONST64(0x2020000020002020), CONST64(0x2020002020002020), - CONST64(0x2020200020002000), CONST64(0x2020202020002000), CONST64(0x2020200020002020), CONST64(0x2020202020002020), - CONST64(0x2000000020200000), CONST64(0x2000002020200000), CONST64(0x2000000020200020), CONST64(0x2000002020200020), - CONST64(0x2000200020200000), CONST64(0x2000202020200000), CONST64(0x2000200020200020), CONST64(0x2000202020200020), - CONST64(0x2000000020202000), CONST64(0x2000002020202000), CONST64(0x2000000020202020), CONST64(0x2000002020202020), - CONST64(0x2000200020202000), CONST64(0x2000202020202000), CONST64(0x2000200020202020), CONST64(0x2000202020202020), - CONST64(0x2020000020200000), CONST64(0x2020002020200000), CONST64(0x2020000020200020), CONST64(0x2020002020200020), - CONST64(0x2020200020200000), CONST64(0x2020202020200000), CONST64(0x2020200020200020), CONST64(0x2020202020200020), - CONST64(0x2020000020202000), CONST64(0x2020002020202000), CONST64(0x2020000020202020), CONST64(0x2020002020202020), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000002000000000), CONST64(0x0000000000000020), CONST64(0x0000002000000020), + CONST64(0x0000200000000000), CONST64(0x0000202000000000), CONST64(0x0000200000000020), CONST64(0x0000202000000020), + CONST64(0x0000000000002000), CONST64(0x0000002000002000), CONST64(0x0000000000002020), CONST64(0x0000002000002020), + CONST64(0x0000200000002000), CONST64(0x0000202000002000), CONST64(0x0000200000002020), CONST64(0x0000202000002020), + CONST64(0x0020000000000000), CONST64(0x0020002000000000), CONST64(0x0020000000000020), CONST64(0x0020002000000020), + CONST64(0x0020200000000000), CONST64(0x0020202000000000), CONST64(0x0020200000000020), CONST64(0x0020202000000020), + CONST64(0x0020000000002000), CONST64(0x0020002000002000), CONST64(0x0020000000002020), CONST64(0x0020002000002020), + CONST64(0x0020200000002000), CONST64(0x0020202000002000), CONST64(0x0020200000002020), CONST64(0x0020202000002020), + CONST64(0x0000000000200000), CONST64(0x0000002000200000), CONST64(0x0000000000200020), CONST64(0x0000002000200020), + CONST64(0x0000200000200000), CONST64(0x0000202000200000), CONST64(0x0000200000200020), CONST64(0x0000202000200020), + CONST64(0x0000000000202000), CONST64(0x0000002000202000), CONST64(0x0000000000202020), CONST64(0x0000002000202020), + CONST64(0x0000200000202000), CONST64(0x0000202000202000), CONST64(0x0000200000202020), CONST64(0x0000202000202020), + CONST64(0x0020000000200000), CONST64(0x0020002000200000), CONST64(0x0020000000200020), CONST64(0x0020002000200020), + CONST64(0x0020200000200000), CONST64(0x0020202000200000), CONST64(0x0020200000200020), CONST64(0x0020202000200020), + CONST64(0x0020000000202000), CONST64(0x0020002000202000), CONST64(0x0020000000202020), CONST64(0x0020002000202020), + CONST64(0x0020200000202000), CONST64(0x0020202000202000), CONST64(0x0020200000202020), CONST64(0x0020202000202020), + CONST64(0x2000000000000000), CONST64(0x2000002000000000), CONST64(0x2000000000000020), CONST64(0x2000002000000020), + CONST64(0x2000200000000000), CONST64(0x2000202000000000), CONST64(0x2000200000000020), CONST64(0x2000202000000020), + CONST64(0x2000000000002000), CONST64(0x2000002000002000), CONST64(0x2000000000002020), CONST64(0x2000002000002020), + CONST64(0x2000200000002000), CONST64(0x2000202000002000), CONST64(0x2000200000002020), CONST64(0x2000202000002020), + CONST64(0x2020000000000000), CONST64(0x2020002000000000), CONST64(0x2020000000000020), CONST64(0x2020002000000020), + CONST64(0x2020200000000000), CONST64(0x2020202000000000), CONST64(0x2020200000000020), CONST64(0x2020202000000020), + CONST64(0x2020000000002000), CONST64(0x2020002000002000), CONST64(0x2020000000002020), CONST64(0x2020002000002020), + CONST64(0x2020200000002000), CONST64(0x2020202000002000), CONST64(0x2020200000002020), CONST64(0x2020202000002020), + CONST64(0x2000000000200000), CONST64(0x2000002000200000), CONST64(0x2000000000200020), CONST64(0x2000002000200020), + CONST64(0x2000200000200000), CONST64(0x2000202000200000), CONST64(0x2000200000200020), CONST64(0x2000202000200020), + CONST64(0x2000000000202000), CONST64(0x2000002000202000), CONST64(0x2000000000202020), CONST64(0x2000002000202020), + CONST64(0x2000200000202000), CONST64(0x2000202000202000), CONST64(0x2000200000202020), CONST64(0x2000202000202020), + CONST64(0x2020000000200000), CONST64(0x2020002000200000), CONST64(0x2020000000200020), CONST64(0x2020002000200020), + CONST64(0x2020200000200000), CONST64(0x2020202000200000), CONST64(0x2020200000200020), CONST64(0x2020202000200020), + CONST64(0x2020000000202000), CONST64(0x2020002000202000), CONST64(0x2020000000202020), CONST64(0x2020002000202020), + CONST64(0x2020200000202000), CONST64(0x2020202000202000), CONST64(0x2020200000202020), CONST64(0x2020202000202020), + CONST64(0x0000000020000000), CONST64(0x0000002020000000), CONST64(0x0000000020000020), CONST64(0x0000002020000020), + CONST64(0x0000200020000000), CONST64(0x0000202020000000), CONST64(0x0000200020000020), CONST64(0x0000202020000020), + CONST64(0x0000000020002000), CONST64(0x0000002020002000), CONST64(0x0000000020002020), CONST64(0x0000002020002020), + CONST64(0x0000200020002000), CONST64(0x0000202020002000), CONST64(0x0000200020002020), CONST64(0x0000202020002020), + CONST64(0x0020000020000000), CONST64(0x0020002020000000), CONST64(0x0020000020000020), CONST64(0x0020002020000020), + CONST64(0x0020200020000000), CONST64(0x0020202020000000), CONST64(0x0020200020000020), CONST64(0x0020202020000020), + CONST64(0x0020000020002000), CONST64(0x0020002020002000), CONST64(0x0020000020002020), CONST64(0x0020002020002020), + CONST64(0x0020200020002000), CONST64(0x0020202020002000), CONST64(0x0020200020002020), CONST64(0x0020202020002020), + CONST64(0x0000000020200000), CONST64(0x0000002020200000), CONST64(0x0000000020200020), CONST64(0x0000002020200020), + CONST64(0x0000200020200000), CONST64(0x0000202020200000), CONST64(0x0000200020200020), CONST64(0x0000202020200020), + CONST64(0x0000000020202000), CONST64(0x0000002020202000), CONST64(0x0000000020202020), CONST64(0x0000002020202020), + CONST64(0x0000200020202000), CONST64(0x0000202020202000), CONST64(0x0000200020202020), CONST64(0x0000202020202020), + CONST64(0x0020000020200000), CONST64(0x0020002020200000), CONST64(0x0020000020200020), CONST64(0x0020002020200020), + CONST64(0x0020200020200000), CONST64(0x0020202020200000), CONST64(0x0020200020200020), CONST64(0x0020202020200020), + CONST64(0x0020000020202000), CONST64(0x0020002020202000), CONST64(0x0020000020202020), CONST64(0x0020002020202020), + CONST64(0x0020200020202000), CONST64(0x0020202020202000), CONST64(0x0020200020202020), CONST64(0x0020202020202020), + CONST64(0x2000000020000000), CONST64(0x2000002020000000), CONST64(0x2000000020000020), CONST64(0x2000002020000020), + CONST64(0x2000200020000000), CONST64(0x2000202020000000), CONST64(0x2000200020000020), CONST64(0x2000202020000020), + CONST64(0x2000000020002000), CONST64(0x2000002020002000), CONST64(0x2000000020002020), CONST64(0x2000002020002020), + CONST64(0x2000200020002000), CONST64(0x2000202020002000), CONST64(0x2000200020002020), CONST64(0x2000202020002020), + CONST64(0x2020000020000000), CONST64(0x2020002020000000), CONST64(0x2020000020000020), CONST64(0x2020002020000020), + CONST64(0x2020200020000000), CONST64(0x2020202020000000), CONST64(0x2020200020000020), CONST64(0x2020202020000020), + CONST64(0x2020000020002000), CONST64(0x2020002020002000), CONST64(0x2020000020002020), CONST64(0x2020002020002020), + CONST64(0x2020200020002000), CONST64(0x2020202020002000), CONST64(0x2020200020002020), CONST64(0x2020202020002020), + CONST64(0x2000000020200000), CONST64(0x2000002020200000), CONST64(0x2000000020200020), CONST64(0x2000002020200020), + CONST64(0x2000200020200000), CONST64(0x2000202020200000), CONST64(0x2000200020200020), CONST64(0x2000202020200020), + CONST64(0x2000000020202000), CONST64(0x2000002020202000), CONST64(0x2000000020202020), CONST64(0x2000002020202020), + CONST64(0x2000200020202000), CONST64(0x2000202020202000), CONST64(0x2000200020202020), CONST64(0x2000202020202020), + CONST64(0x2020000020200000), CONST64(0x2020002020200000), CONST64(0x2020000020200020), CONST64(0x2020002020200020), + CONST64(0x2020200020200000), CONST64(0x2020202020200000), CONST64(0x2020200020200020), CONST64(0x2020202020200020), + CONST64(0x2020000020202000), CONST64(0x2020002020202000), CONST64(0x2020000020202020), CONST64(0x2020002020202020), CONST64(0x2020200020202000), CONST64(0x2020202020202000), CONST64(0x2020200020202020), CONST64(0x2020202020202020) }}; - + static const ulong64 des_fp[8][256] = { -{ CONST64(0x0000000000000000), CONST64(0x0000008000000000), CONST64(0x0000000002000000), CONST64(0x0000008002000000), - CONST64(0x0000000000020000), CONST64(0x0000008000020000), CONST64(0x0000000002020000), CONST64(0x0000008002020000), - CONST64(0x0000000000000200), CONST64(0x0000008000000200), CONST64(0x0000000002000200), CONST64(0x0000008002000200), - CONST64(0x0000000000020200), CONST64(0x0000008000020200), CONST64(0x0000000002020200), CONST64(0x0000008002020200), - CONST64(0x0000000000000002), CONST64(0x0000008000000002), CONST64(0x0000000002000002), CONST64(0x0000008002000002), - CONST64(0x0000000000020002), CONST64(0x0000008000020002), CONST64(0x0000000002020002), CONST64(0x0000008002020002), - CONST64(0x0000000000000202), CONST64(0x0000008000000202), CONST64(0x0000000002000202), CONST64(0x0000008002000202), - CONST64(0x0000000000020202), CONST64(0x0000008000020202), CONST64(0x0000000002020202), CONST64(0x0000008002020202), - CONST64(0x0200000000000000), CONST64(0x0200008000000000), CONST64(0x0200000002000000), CONST64(0x0200008002000000), - CONST64(0x0200000000020000), CONST64(0x0200008000020000), CONST64(0x0200000002020000), CONST64(0x0200008002020000), - CONST64(0x0200000000000200), CONST64(0x0200008000000200), CONST64(0x0200000002000200), CONST64(0x0200008002000200), - CONST64(0x0200000000020200), CONST64(0x0200008000020200), CONST64(0x0200000002020200), CONST64(0x0200008002020200), - CONST64(0x0200000000000002), CONST64(0x0200008000000002), CONST64(0x0200000002000002), CONST64(0x0200008002000002), - CONST64(0x0200000000020002), CONST64(0x0200008000020002), CONST64(0x0200000002020002), CONST64(0x0200008002020002), - CONST64(0x0200000000000202), CONST64(0x0200008000000202), CONST64(0x0200000002000202), CONST64(0x0200008002000202), - CONST64(0x0200000000020202), CONST64(0x0200008000020202), CONST64(0x0200000002020202), CONST64(0x0200008002020202), - CONST64(0x0002000000000000), CONST64(0x0002008000000000), CONST64(0x0002000002000000), CONST64(0x0002008002000000), - CONST64(0x0002000000020000), CONST64(0x0002008000020000), CONST64(0x0002000002020000), CONST64(0x0002008002020000), - CONST64(0x0002000000000200), CONST64(0x0002008000000200), CONST64(0x0002000002000200), CONST64(0x0002008002000200), - CONST64(0x0002000000020200), CONST64(0x0002008000020200), CONST64(0x0002000002020200), CONST64(0x0002008002020200), - CONST64(0x0002000000000002), CONST64(0x0002008000000002), CONST64(0x0002000002000002), CONST64(0x0002008002000002), - CONST64(0x0002000000020002), CONST64(0x0002008000020002), CONST64(0x0002000002020002), CONST64(0x0002008002020002), - CONST64(0x0002000000000202), CONST64(0x0002008000000202), CONST64(0x0002000002000202), CONST64(0x0002008002000202), - CONST64(0x0002000000020202), CONST64(0x0002008000020202), CONST64(0x0002000002020202), CONST64(0x0002008002020202), - CONST64(0x0202000000000000), CONST64(0x0202008000000000), CONST64(0x0202000002000000), CONST64(0x0202008002000000), - CONST64(0x0202000000020000), CONST64(0x0202008000020000), CONST64(0x0202000002020000), CONST64(0x0202008002020000), - CONST64(0x0202000000000200), CONST64(0x0202008000000200), CONST64(0x0202000002000200), CONST64(0x0202008002000200), - CONST64(0x0202000000020200), CONST64(0x0202008000020200), CONST64(0x0202000002020200), CONST64(0x0202008002020200), - CONST64(0x0202000000000002), CONST64(0x0202008000000002), CONST64(0x0202000002000002), CONST64(0x0202008002000002), - CONST64(0x0202000000020002), CONST64(0x0202008000020002), CONST64(0x0202000002020002), CONST64(0x0202008002020002), - CONST64(0x0202000000000202), CONST64(0x0202008000000202), CONST64(0x0202000002000202), CONST64(0x0202008002000202), - CONST64(0x0202000000020202), CONST64(0x0202008000020202), CONST64(0x0202000002020202), CONST64(0x0202008002020202), - CONST64(0x0000020000000000), CONST64(0x0000028000000000), CONST64(0x0000020002000000), CONST64(0x0000028002000000), - CONST64(0x0000020000020000), CONST64(0x0000028000020000), CONST64(0x0000020002020000), CONST64(0x0000028002020000), - CONST64(0x0000020000000200), CONST64(0x0000028000000200), CONST64(0x0000020002000200), CONST64(0x0000028002000200), - CONST64(0x0000020000020200), CONST64(0x0000028000020200), CONST64(0x0000020002020200), CONST64(0x0000028002020200), - CONST64(0x0000020000000002), CONST64(0x0000028000000002), CONST64(0x0000020002000002), CONST64(0x0000028002000002), - CONST64(0x0000020000020002), CONST64(0x0000028000020002), CONST64(0x0000020002020002), CONST64(0x0000028002020002), - CONST64(0x0000020000000202), CONST64(0x0000028000000202), CONST64(0x0000020002000202), CONST64(0x0000028002000202), - CONST64(0x0000020000020202), CONST64(0x0000028000020202), CONST64(0x0000020002020202), CONST64(0x0000028002020202), - CONST64(0x0200020000000000), CONST64(0x0200028000000000), CONST64(0x0200020002000000), CONST64(0x0200028002000000), - CONST64(0x0200020000020000), CONST64(0x0200028000020000), CONST64(0x0200020002020000), CONST64(0x0200028002020000), - CONST64(0x0200020000000200), CONST64(0x0200028000000200), CONST64(0x0200020002000200), CONST64(0x0200028002000200), - CONST64(0x0200020000020200), CONST64(0x0200028000020200), CONST64(0x0200020002020200), CONST64(0x0200028002020200), - CONST64(0x0200020000000002), CONST64(0x0200028000000002), CONST64(0x0200020002000002), CONST64(0x0200028002000002), - CONST64(0x0200020000020002), CONST64(0x0200028000020002), CONST64(0x0200020002020002), CONST64(0x0200028002020002), - CONST64(0x0200020000000202), CONST64(0x0200028000000202), CONST64(0x0200020002000202), CONST64(0x0200028002000202), - CONST64(0x0200020000020202), CONST64(0x0200028000020202), CONST64(0x0200020002020202), CONST64(0x0200028002020202), - CONST64(0x0002020000000000), CONST64(0x0002028000000000), CONST64(0x0002020002000000), CONST64(0x0002028002000000), - CONST64(0x0002020000020000), CONST64(0x0002028000020000), CONST64(0x0002020002020000), CONST64(0x0002028002020000), - CONST64(0x0002020000000200), CONST64(0x0002028000000200), CONST64(0x0002020002000200), CONST64(0x0002028002000200), - CONST64(0x0002020000020200), CONST64(0x0002028000020200), CONST64(0x0002020002020200), CONST64(0x0002028002020200), - CONST64(0x0002020000000002), CONST64(0x0002028000000002), CONST64(0x0002020002000002), CONST64(0x0002028002000002), - CONST64(0x0002020000020002), CONST64(0x0002028000020002), CONST64(0x0002020002020002), CONST64(0x0002028002020002), - CONST64(0x0002020000000202), CONST64(0x0002028000000202), CONST64(0x0002020002000202), CONST64(0x0002028002000202), - CONST64(0x0002020000020202), CONST64(0x0002028000020202), CONST64(0x0002020002020202), CONST64(0x0002028002020202), - CONST64(0x0202020000000000), CONST64(0x0202028000000000), CONST64(0x0202020002000000), CONST64(0x0202028002000000), - CONST64(0x0202020000020000), CONST64(0x0202028000020000), CONST64(0x0202020002020000), CONST64(0x0202028002020000), - CONST64(0x0202020000000200), CONST64(0x0202028000000200), CONST64(0x0202020002000200), CONST64(0x0202028002000200), - CONST64(0x0202020000020200), CONST64(0x0202028000020200), CONST64(0x0202020002020200), CONST64(0x0202028002020200), - CONST64(0x0202020000000002), CONST64(0x0202028000000002), CONST64(0x0202020002000002), CONST64(0x0202028002000002), - CONST64(0x0202020000020002), CONST64(0x0202028000020002), CONST64(0x0202020002020002), CONST64(0x0202028002020002), - CONST64(0x0202020000000202), CONST64(0x0202028000000202), CONST64(0x0202020002000202), CONST64(0x0202028002000202), +{ CONST64(0x0000000000000000), CONST64(0x0000008000000000), CONST64(0x0000000002000000), CONST64(0x0000008002000000), + CONST64(0x0000000000020000), CONST64(0x0000008000020000), CONST64(0x0000000002020000), CONST64(0x0000008002020000), + CONST64(0x0000000000000200), CONST64(0x0000008000000200), CONST64(0x0000000002000200), CONST64(0x0000008002000200), + CONST64(0x0000000000020200), CONST64(0x0000008000020200), CONST64(0x0000000002020200), CONST64(0x0000008002020200), + CONST64(0x0000000000000002), CONST64(0x0000008000000002), CONST64(0x0000000002000002), CONST64(0x0000008002000002), + CONST64(0x0000000000020002), CONST64(0x0000008000020002), CONST64(0x0000000002020002), CONST64(0x0000008002020002), + CONST64(0x0000000000000202), CONST64(0x0000008000000202), CONST64(0x0000000002000202), CONST64(0x0000008002000202), + CONST64(0x0000000000020202), CONST64(0x0000008000020202), CONST64(0x0000000002020202), CONST64(0x0000008002020202), + CONST64(0x0200000000000000), CONST64(0x0200008000000000), CONST64(0x0200000002000000), CONST64(0x0200008002000000), + CONST64(0x0200000000020000), CONST64(0x0200008000020000), CONST64(0x0200000002020000), CONST64(0x0200008002020000), + CONST64(0x0200000000000200), CONST64(0x0200008000000200), CONST64(0x0200000002000200), CONST64(0x0200008002000200), + CONST64(0x0200000000020200), CONST64(0x0200008000020200), CONST64(0x0200000002020200), CONST64(0x0200008002020200), + CONST64(0x0200000000000002), CONST64(0x0200008000000002), CONST64(0x0200000002000002), CONST64(0x0200008002000002), + CONST64(0x0200000000020002), CONST64(0x0200008000020002), CONST64(0x0200000002020002), CONST64(0x0200008002020002), + CONST64(0x0200000000000202), CONST64(0x0200008000000202), CONST64(0x0200000002000202), CONST64(0x0200008002000202), + CONST64(0x0200000000020202), CONST64(0x0200008000020202), CONST64(0x0200000002020202), CONST64(0x0200008002020202), + CONST64(0x0002000000000000), CONST64(0x0002008000000000), CONST64(0x0002000002000000), CONST64(0x0002008002000000), + CONST64(0x0002000000020000), CONST64(0x0002008000020000), CONST64(0x0002000002020000), CONST64(0x0002008002020000), + CONST64(0x0002000000000200), CONST64(0x0002008000000200), CONST64(0x0002000002000200), CONST64(0x0002008002000200), + CONST64(0x0002000000020200), CONST64(0x0002008000020200), CONST64(0x0002000002020200), CONST64(0x0002008002020200), + CONST64(0x0002000000000002), CONST64(0x0002008000000002), CONST64(0x0002000002000002), CONST64(0x0002008002000002), + CONST64(0x0002000000020002), CONST64(0x0002008000020002), CONST64(0x0002000002020002), CONST64(0x0002008002020002), + CONST64(0x0002000000000202), CONST64(0x0002008000000202), CONST64(0x0002000002000202), CONST64(0x0002008002000202), + CONST64(0x0002000000020202), CONST64(0x0002008000020202), CONST64(0x0002000002020202), CONST64(0x0002008002020202), + CONST64(0x0202000000000000), CONST64(0x0202008000000000), CONST64(0x0202000002000000), CONST64(0x0202008002000000), + CONST64(0x0202000000020000), CONST64(0x0202008000020000), CONST64(0x0202000002020000), CONST64(0x0202008002020000), + CONST64(0x0202000000000200), CONST64(0x0202008000000200), CONST64(0x0202000002000200), CONST64(0x0202008002000200), + CONST64(0x0202000000020200), CONST64(0x0202008000020200), CONST64(0x0202000002020200), CONST64(0x0202008002020200), + CONST64(0x0202000000000002), CONST64(0x0202008000000002), CONST64(0x0202000002000002), CONST64(0x0202008002000002), + CONST64(0x0202000000020002), CONST64(0x0202008000020002), CONST64(0x0202000002020002), CONST64(0x0202008002020002), + CONST64(0x0202000000000202), CONST64(0x0202008000000202), CONST64(0x0202000002000202), CONST64(0x0202008002000202), + CONST64(0x0202000000020202), CONST64(0x0202008000020202), CONST64(0x0202000002020202), CONST64(0x0202008002020202), + CONST64(0x0000020000000000), CONST64(0x0000028000000000), CONST64(0x0000020002000000), CONST64(0x0000028002000000), + CONST64(0x0000020000020000), CONST64(0x0000028000020000), CONST64(0x0000020002020000), CONST64(0x0000028002020000), + CONST64(0x0000020000000200), CONST64(0x0000028000000200), CONST64(0x0000020002000200), CONST64(0x0000028002000200), + CONST64(0x0000020000020200), CONST64(0x0000028000020200), CONST64(0x0000020002020200), CONST64(0x0000028002020200), + CONST64(0x0000020000000002), CONST64(0x0000028000000002), CONST64(0x0000020002000002), CONST64(0x0000028002000002), + CONST64(0x0000020000020002), CONST64(0x0000028000020002), CONST64(0x0000020002020002), CONST64(0x0000028002020002), + CONST64(0x0000020000000202), CONST64(0x0000028000000202), CONST64(0x0000020002000202), CONST64(0x0000028002000202), + CONST64(0x0000020000020202), CONST64(0x0000028000020202), CONST64(0x0000020002020202), CONST64(0x0000028002020202), + CONST64(0x0200020000000000), CONST64(0x0200028000000000), CONST64(0x0200020002000000), CONST64(0x0200028002000000), + CONST64(0x0200020000020000), CONST64(0x0200028000020000), CONST64(0x0200020002020000), CONST64(0x0200028002020000), + CONST64(0x0200020000000200), CONST64(0x0200028000000200), CONST64(0x0200020002000200), CONST64(0x0200028002000200), + CONST64(0x0200020000020200), CONST64(0x0200028000020200), CONST64(0x0200020002020200), CONST64(0x0200028002020200), + CONST64(0x0200020000000002), CONST64(0x0200028000000002), CONST64(0x0200020002000002), CONST64(0x0200028002000002), + CONST64(0x0200020000020002), CONST64(0x0200028000020002), CONST64(0x0200020002020002), CONST64(0x0200028002020002), + CONST64(0x0200020000000202), CONST64(0x0200028000000202), CONST64(0x0200020002000202), CONST64(0x0200028002000202), + CONST64(0x0200020000020202), CONST64(0x0200028000020202), CONST64(0x0200020002020202), CONST64(0x0200028002020202), + CONST64(0x0002020000000000), CONST64(0x0002028000000000), CONST64(0x0002020002000000), CONST64(0x0002028002000000), + CONST64(0x0002020000020000), CONST64(0x0002028000020000), CONST64(0x0002020002020000), CONST64(0x0002028002020000), + CONST64(0x0002020000000200), CONST64(0x0002028000000200), CONST64(0x0002020002000200), CONST64(0x0002028002000200), + CONST64(0x0002020000020200), CONST64(0x0002028000020200), CONST64(0x0002020002020200), CONST64(0x0002028002020200), + CONST64(0x0002020000000002), CONST64(0x0002028000000002), CONST64(0x0002020002000002), CONST64(0x0002028002000002), + CONST64(0x0002020000020002), CONST64(0x0002028000020002), CONST64(0x0002020002020002), CONST64(0x0002028002020002), + CONST64(0x0002020000000202), CONST64(0x0002028000000202), CONST64(0x0002020002000202), CONST64(0x0002028002000202), + CONST64(0x0002020000020202), CONST64(0x0002028000020202), CONST64(0x0002020002020202), CONST64(0x0002028002020202), + CONST64(0x0202020000000000), CONST64(0x0202028000000000), CONST64(0x0202020002000000), CONST64(0x0202028002000000), + CONST64(0x0202020000020000), CONST64(0x0202028000020000), CONST64(0x0202020002020000), CONST64(0x0202028002020000), + CONST64(0x0202020000000200), CONST64(0x0202028000000200), CONST64(0x0202020002000200), CONST64(0x0202028002000200), + CONST64(0x0202020000020200), CONST64(0x0202028000020200), CONST64(0x0202020002020200), CONST64(0x0202028002020200), + CONST64(0x0202020000000002), CONST64(0x0202028000000002), CONST64(0x0202020002000002), CONST64(0x0202028002000002), + CONST64(0x0202020000020002), CONST64(0x0202028000020002), CONST64(0x0202020002020002), CONST64(0x0202028002020002), + CONST64(0x0202020000000202), CONST64(0x0202028000000202), CONST64(0x0202020002000202), CONST64(0x0202028002000202), CONST64(0x0202020000020202), CONST64(0x0202028000020202), CONST64(0x0202020002020202), CONST64(0x0202028002020202) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000000200000000), CONST64(0x0000000008000000), CONST64(0x0000000208000000), - CONST64(0x0000000000080000), CONST64(0x0000000200080000), CONST64(0x0000000008080000), CONST64(0x0000000208080000), - CONST64(0x0000000000000800), CONST64(0x0000000200000800), CONST64(0x0000000008000800), CONST64(0x0000000208000800), - CONST64(0x0000000000080800), CONST64(0x0000000200080800), CONST64(0x0000000008080800), CONST64(0x0000000208080800), - CONST64(0x0000000000000008), CONST64(0x0000000200000008), CONST64(0x0000000008000008), CONST64(0x0000000208000008), - CONST64(0x0000000000080008), CONST64(0x0000000200080008), CONST64(0x0000000008080008), CONST64(0x0000000208080008), - CONST64(0x0000000000000808), CONST64(0x0000000200000808), CONST64(0x0000000008000808), CONST64(0x0000000208000808), - CONST64(0x0000000000080808), CONST64(0x0000000200080808), CONST64(0x0000000008080808), CONST64(0x0000000208080808), - CONST64(0x0800000000000000), CONST64(0x0800000200000000), CONST64(0x0800000008000000), CONST64(0x0800000208000000), - CONST64(0x0800000000080000), CONST64(0x0800000200080000), CONST64(0x0800000008080000), CONST64(0x0800000208080000), - CONST64(0x0800000000000800), CONST64(0x0800000200000800), CONST64(0x0800000008000800), CONST64(0x0800000208000800), - CONST64(0x0800000000080800), CONST64(0x0800000200080800), CONST64(0x0800000008080800), CONST64(0x0800000208080800), - CONST64(0x0800000000000008), CONST64(0x0800000200000008), CONST64(0x0800000008000008), CONST64(0x0800000208000008), - CONST64(0x0800000000080008), CONST64(0x0800000200080008), CONST64(0x0800000008080008), CONST64(0x0800000208080008), - CONST64(0x0800000000000808), CONST64(0x0800000200000808), CONST64(0x0800000008000808), CONST64(0x0800000208000808), - CONST64(0x0800000000080808), CONST64(0x0800000200080808), CONST64(0x0800000008080808), CONST64(0x0800000208080808), - CONST64(0x0008000000000000), CONST64(0x0008000200000000), CONST64(0x0008000008000000), CONST64(0x0008000208000000), - CONST64(0x0008000000080000), CONST64(0x0008000200080000), CONST64(0x0008000008080000), CONST64(0x0008000208080000), - CONST64(0x0008000000000800), CONST64(0x0008000200000800), CONST64(0x0008000008000800), CONST64(0x0008000208000800), - CONST64(0x0008000000080800), CONST64(0x0008000200080800), CONST64(0x0008000008080800), CONST64(0x0008000208080800), - CONST64(0x0008000000000008), CONST64(0x0008000200000008), CONST64(0x0008000008000008), CONST64(0x0008000208000008), - CONST64(0x0008000000080008), CONST64(0x0008000200080008), CONST64(0x0008000008080008), CONST64(0x0008000208080008), - CONST64(0x0008000000000808), CONST64(0x0008000200000808), CONST64(0x0008000008000808), CONST64(0x0008000208000808), - CONST64(0x0008000000080808), CONST64(0x0008000200080808), CONST64(0x0008000008080808), CONST64(0x0008000208080808), - CONST64(0x0808000000000000), CONST64(0x0808000200000000), CONST64(0x0808000008000000), CONST64(0x0808000208000000), - CONST64(0x0808000000080000), CONST64(0x0808000200080000), CONST64(0x0808000008080000), CONST64(0x0808000208080000), - CONST64(0x0808000000000800), CONST64(0x0808000200000800), CONST64(0x0808000008000800), CONST64(0x0808000208000800), - CONST64(0x0808000000080800), CONST64(0x0808000200080800), CONST64(0x0808000008080800), CONST64(0x0808000208080800), - CONST64(0x0808000000000008), CONST64(0x0808000200000008), CONST64(0x0808000008000008), CONST64(0x0808000208000008), - CONST64(0x0808000000080008), CONST64(0x0808000200080008), CONST64(0x0808000008080008), CONST64(0x0808000208080008), - CONST64(0x0808000000000808), CONST64(0x0808000200000808), CONST64(0x0808000008000808), CONST64(0x0808000208000808), - CONST64(0x0808000000080808), CONST64(0x0808000200080808), CONST64(0x0808000008080808), CONST64(0x0808000208080808), - CONST64(0x0000080000000000), CONST64(0x0000080200000000), CONST64(0x0000080008000000), CONST64(0x0000080208000000), - CONST64(0x0000080000080000), CONST64(0x0000080200080000), CONST64(0x0000080008080000), CONST64(0x0000080208080000), - CONST64(0x0000080000000800), CONST64(0x0000080200000800), CONST64(0x0000080008000800), CONST64(0x0000080208000800), - CONST64(0x0000080000080800), CONST64(0x0000080200080800), CONST64(0x0000080008080800), CONST64(0x0000080208080800), - CONST64(0x0000080000000008), CONST64(0x0000080200000008), CONST64(0x0000080008000008), CONST64(0x0000080208000008), - CONST64(0x0000080000080008), CONST64(0x0000080200080008), CONST64(0x0000080008080008), CONST64(0x0000080208080008), - CONST64(0x0000080000000808), CONST64(0x0000080200000808), CONST64(0x0000080008000808), CONST64(0x0000080208000808), - CONST64(0x0000080000080808), CONST64(0x0000080200080808), CONST64(0x0000080008080808), CONST64(0x0000080208080808), - CONST64(0x0800080000000000), CONST64(0x0800080200000000), CONST64(0x0800080008000000), CONST64(0x0800080208000000), - CONST64(0x0800080000080000), CONST64(0x0800080200080000), CONST64(0x0800080008080000), CONST64(0x0800080208080000), - CONST64(0x0800080000000800), CONST64(0x0800080200000800), CONST64(0x0800080008000800), CONST64(0x0800080208000800), - CONST64(0x0800080000080800), CONST64(0x0800080200080800), CONST64(0x0800080008080800), CONST64(0x0800080208080800), - CONST64(0x0800080000000008), CONST64(0x0800080200000008), CONST64(0x0800080008000008), CONST64(0x0800080208000008), - CONST64(0x0800080000080008), CONST64(0x0800080200080008), CONST64(0x0800080008080008), CONST64(0x0800080208080008), - CONST64(0x0800080000000808), CONST64(0x0800080200000808), CONST64(0x0800080008000808), CONST64(0x0800080208000808), - CONST64(0x0800080000080808), CONST64(0x0800080200080808), CONST64(0x0800080008080808), CONST64(0x0800080208080808), - CONST64(0x0008080000000000), CONST64(0x0008080200000000), CONST64(0x0008080008000000), CONST64(0x0008080208000000), - CONST64(0x0008080000080000), CONST64(0x0008080200080000), CONST64(0x0008080008080000), CONST64(0x0008080208080000), - CONST64(0x0008080000000800), CONST64(0x0008080200000800), CONST64(0x0008080008000800), CONST64(0x0008080208000800), - CONST64(0x0008080000080800), CONST64(0x0008080200080800), CONST64(0x0008080008080800), CONST64(0x0008080208080800), - CONST64(0x0008080000000008), CONST64(0x0008080200000008), CONST64(0x0008080008000008), CONST64(0x0008080208000008), - CONST64(0x0008080000080008), CONST64(0x0008080200080008), CONST64(0x0008080008080008), CONST64(0x0008080208080008), - CONST64(0x0008080000000808), CONST64(0x0008080200000808), CONST64(0x0008080008000808), CONST64(0x0008080208000808), - CONST64(0x0008080000080808), CONST64(0x0008080200080808), CONST64(0x0008080008080808), CONST64(0x0008080208080808), - CONST64(0x0808080000000000), CONST64(0x0808080200000000), CONST64(0x0808080008000000), CONST64(0x0808080208000000), - CONST64(0x0808080000080000), CONST64(0x0808080200080000), CONST64(0x0808080008080000), CONST64(0x0808080208080000), - CONST64(0x0808080000000800), CONST64(0x0808080200000800), CONST64(0x0808080008000800), CONST64(0x0808080208000800), - CONST64(0x0808080000080800), CONST64(0x0808080200080800), CONST64(0x0808080008080800), CONST64(0x0808080208080800), - CONST64(0x0808080000000008), CONST64(0x0808080200000008), CONST64(0x0808080008000008), CONST64(0x0808080208000008), - CONST64(0x0808080000080008), CONST64(0x0808080200080008), CONST64(0x0808080008080008), CONST64(0x0808080208080008), - CONST64(0x0808080000000808), CONST64(0x0808080200000808), CONST64(0x0808080008000808), CONST64(0x0808080208000808), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000000200000000), CONST64(0x0000000008000000), CONST64(0x0000000208000000), + CONST64(0x0000000000080000), CONST64(0x0000000200080000), CONST64(0x0000000008080000), CONST64(0x0000000208080000), + CONST64(0x0000000000000800), CONST64(0x0000000200000800), CONST64(0x0000000008000800), CONST64(0x0000000208000800), + CONST64(0x0000000000080800), CONST64(0x0000000200080800), CONST64(0x0000000008080800), CONST64(0x0000000208080800), + CONST64(0x0000000000000008), CONST64(0x0000000200000008), CONST64(0x0000000008000008), CONST64(0x0000000208000008), + CONST64(0x0000000000080008), CONST64(0x0000000200080008), CONST64(0x0000000008080008), CONST64(0x0000000208080008), + CONST64(0x0000000000000808), CONST64(0x0000000200000808), CONST64(0x0000000008000808), CONST64(0x0000000208000808), + CONST64(0x0000000000080808), CONST64(0x0000000200080808), CONST64(0x0000000008080808), CONST64(0x0000000208080808), + CONST64(0x0800000000000000), CONST64(0x0800000200000000), CONST64(0x0800000008000000), CONST64(0x0800000208000000), + CONST64(0x0800000000080000), CONST64(0x0800000200080000), CONST64(0x0800000008080000), CONST64(0x0800000208080000), + CONST64(0x0800000000000800), CONST64(0x0800000200000800), CONST64(0x0800000008000800), CONST64(0x0800000208000800), + CONST64(0x0800000000080800), CONST64(0x0800000200080800), CONST64(0x0800000008080800), CONST64(0x0800000208080800), + CONST64(0x0800000000000008), CONST64(0x0800000200000008), CONST64(0x0800000008000008), CONST64(0x0800000208000008), + CONST64(0x0800000000080008), CONST64(0x0800000200080008), CONST64(0x0800000008080008), CONST64(0x0800000208080008), + CONST64(0x0800000000000808), CONST64(0x0800000200000808), CONST64(0x0800000008000808), CONST64(0x0800000208000808), + CONST64(0x0800000000080808), CONST64(0x0800000200080808), CONST64(0x0800000008080808), CONST64(0x0800000208080808), + CONST64(0x0008000000000000), CONST64(0x0008000200000000), CONST64(0x0008000008000000), CONST64(0x0008000208000000), + CONST64(0x0008000000080000), CONST64(0x0008000200080000), CONST64(0x0008000008080000), CONST64(0x0008000208080000), + CONST64(0x0008000000000800), CONST64(0x0008000200000800), CONST64(0x0008000008000800), CONST64(0x0008000208000800), + CONST64(0x0008000000080800), CONST64(0x0008000200080800), CONST64(0x0008000008080800), CONST64(0x0008000208080800), + CONST64(0x0008000000000008), CONST64(0x0008000200000008), CONST64(0x0008000008000008), CONST64(0x0008000208000008), + CONST64(0x0008000000080008), CONST64(0x0008000200080008), CONST64(0x0008000008080008), CONST64(0x0008000208080008), + CONST64(0x0008000000000808), CONST64(0x0008000200000808), CONST64(0x0008000008000808), CONST64(0x0008000208000808), + CONST64(0x0008000000080808), CONST64(0x0008000200080808), CONST64(0x0008000008080808), CONST64(0x0008000208080808), + CONST64(0x0808000000000000), CONST64(0x0808000200000000), CONST64(0x0808000008000000), CONST64(0x0808000208000000), + CONST64(0x0808000000080000), CONST64(0x0808000200080000), CONST64(0x0808000008080000), CONST64(0x0808000208080000), + CONST64(0x0808000000000800), CONST64(0x0808000200000800), CONST64(0x0808000008000800), CONST64(0x0808000208000800), + CONST64(0x0808000000080800), CONST64(0x0808000200080800), CONST64(0x0808000008080800), CONST64(0x0808000208080800), + CONST64(0x0808000000000008), CONST64(0x0808000200000008), CONST64(0x0808000008000008), CONST64(0x0808000208000008), + CONST64(0x0808000000080008), CONST64(0x0808000200080008), CONST64(0x0808000008080008), CONST64(0x0808000208080008), + CONST64(0x0808000000000808), CONST64(0x0808000200000808), CONST64(0x0808000008000808), CONST64(0x0808000208000808), + CONST64(0x0808000000080808), CONST64(0x0808000200080808), CONST64(0x0808000008080808), CONST64(0x0808000208080808), + CONST64(0x0000080000000000), CONST64(0x0000080200000000), CONST64(0x0000080008000000), CONST64(0x0000080208000000), + CONST64(0x0000080000080000), CONST64(0x0000080200080000), CONST64(0x0000080008080000), CONST64(0x0000080208080000), + CONST64(0x0000080000000800), CONST64(0x0000080200000800), CONST64(0x0000080008000800), CONST64(0x0000080208000800), + CONST64(0x0000080000080800), CONST64(0x0000080200080800), CONST64(0x0000080008080800), CONST64(0x0000080208080800), + CONST64(0x0000080000000008), CONST64(0x0000080200000008), CONST64(0x0000080008000008), CONST64(0x0000080208000008), + CONST64(0x0000080000080008), CONST64(0x0000080200080008), CONST64(0x0000080008080008), CONST64(0x0000080208080008), + CONST64(0x0000080000000808), CONST64(0x0000080200000808), CONST64(0x0000080008000808), CONST64(0x0000080208000808), + CONST64(0x0000080000080808), CONST64(0x0000080200080808), CONST64(0x0000080008080808), CONST64(0x0000080208080808), + CONST64(0x0800080000000000), CONST64(0x0800080200000000), CONST64(0x0800080008000000), CONST64(0x0800080208000000), + CONST64(0x0800080000080000), CONST64(0x0800080200080000), CONST64(0x0800080008080000), CONST64(0x0800080208080000), + CONST64(0x0800080000000800), CONST64(0x0800080200000800), CONST64(0x0800080008000800), CONST64(0x0800080208000800), + CONST64(0x0800080000080800), CONST64(0x0800080200080800), CONST64(0x0800080008080800), CONST64(0x0800080208080800), + CONST64(0x0800080000000008), CONST64(0x0800080200000008), CONST64(0x0800080008000008), CONST64(0x0800080208000008), + CONST64(0x0800080000080008), CONST64(0x0800080200080008), CONST64(0x0800080008080008), CONST64(0x0800080208080008), + CONST64(0x0800080000000808), CONST64(0x0800080200000808), CONST64(0x0800080008000808), CONST64(0x0800080208000808), + CONST64(0x0800080000080808), CONST64(0x0800080200080808), CONST64(0x0800080008080808), CONST64(0x0800080208080808), + CONST64(0x0008080000000000), CONST64(0x0008080200000000), CONST64(0x0008080008000000), CONST64(0x0008080208000000), + CONST64(0x0008080000080000), CONST64(0x0008080200080000), CONST64(0x0008080008080000), CONST64(0x0008080208080000), + CONST64(0x0008080000000800), CONST64(0x0008080200000800), CONST64(0x0008080008000800), CONST64(0x0008080208000800), + CONST64(0x0008080000080800), CONST64(0x0008080200080800), CONST64(0x0008080008080800), CONST64(0x0008080208080800), + CONST64(0x0008080000000008), CONST64(0x0008080200000008), CONST64(0x0008080008000008), CONST64(0x0008080208000008), + CONST64(0x0008080000080008), CONST64(0x0008080200080008), CONST64(0x0008080008080008), CONST64(0x0008080208080008), + CONST64(0x0008080000000808), CONST64(0x0008080200000808), CONST64(0x0008080008000808), CONST64(0x0008080208000808), + CONST64(0x0008080000080808), CONST64(0x0008080200080808), CONST64(0x0008080008080808), CONST64(0x0008080208080808), + CONST64(0x0808080000000000), CONST64(0x0808080200000000), CONST64(0x0808080008000000), CONST64(0x0808080208000000), + CONST64(0x0808080000080000), CONST64(0x0808080200080000), CONST64(0x0808080008080000), CONST64(0x0808080208080000), + CONST64(0x0808080000000800), CONST64(0x0808080200000800), CONST64(0x0808080008000800), CONST64(0x0808080208000800), + CONST64(0x0808080000080800), CONST64(0x0808080200080800), CONST64(0x0808080008080800), CONST64(0x0808080208080800), + CONST64(0x0808080000000008), CONST64(0x0808080200000008), CONST64(0x0808080008000008), CONST64(0x0808080208000008), + CONST64(0x0808080000080008), CONST64(0x0808080200080008), CONST64(0x0808080008080008), CONST64(0x0808080208080008), + CONST64(0x0808080000000808), CONST64(0x0808080200000808), CONST64(0x0808080008000808), CONST64(0x0808080208000808), CONST64(0x0808080000080808), CONST64(0x0808080200080808), CONST64(0x0808080008080808), CONST64(0x0808080208080808) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000000800000000), CONST64(0x0000000020000000), CONST64(0x0000000820000000), - CONST64(0x0000000000200000), CONST64(0x0000000800200000), CONST64(0x0000000020200000), CONST64(0x0000000820200000), - CONST64(0x0000000000002000), CONST64(0x0000000800002000), CONST64(0x0000000020002000), CONST64(0x0000000820002000), - CONST64(0x0000000000202000), CONST64(0x0000000800202000), CONST64(0x0000000020202000), CONST64(0x0000000820202000), - CONST64(0x0000000000000020), CONST64(0x0000000800000020), CONST64(0x0000000020000020), CONST64(0x0000000820000020), - CONST64(0x0000000000200020), CONST64(0x0000000800200020), CONST64(0x0000000020200020), CONST64(0x0000000820200020), - CONST64(0x0000000000002020), CONST64(0x0000000800002020), CONST64(0x0000000020002020), CONST64(0x0000000820002020), - CONST64(0x0000000000202020), CONST64(0x0000000800202020), CONST64(0x0000000020202020), CONST64(0x0000000820202020), - CONST64(0x2000000000000000), CONST64(0x2000000800000000), CONST64(0x2000000020000000), CONST64(0x2000000820000000), - CONST64(0x2000000000200000), CONST64(0x2000000800200000), CONST64(0x2000000020200000), CONST64(0x2000000820200000), - CONST64(0x2000000000002000), CONST64(0x2000000800002000), CONST64(0x2000000020002000), CONST64(0x2000000820002000), - CONST64(0x2000000000202000), CONST64(0x2000000800202000), CONST64(0x2000000020202000), CONST64(0x2000000820202000), - CONST64(0x2000000000000020), CONST64(0x2000000800000020), CONST64(0x2000000020000020), CONST64(0x2000000820000020), - CONST64(0x2000000000200020), CONST64(0x2000000800200020), CONST64(0x2000000020200020), CONST64(0x2000000820200020), - CONST64(0x2000000000002020), CONST64(0x2000000800002020), CONST64(0x2000000020002020), CONST64(0x2000000820002020), - CONST64(0x2000000000202020), CONST64(0x2000000800202020), CONST64(0x2000000020202020), CONST64(0x2000000820202020), - CONST64(0x0020000000000000), CONST64(0x0020000800000000), CONST64(0x0020000020000000), CONST64(0x0020000820000000), - CONST64(0x0020000000200000), CONST64(0x0020000800200000), CONST64(0x0020000020200000), CONST64(0x0020000820200000), - CONST64(0x0020000000002000), CONST64(0x0020000800002000), CONST64(0x0020000020002000), CONST64(0x0020000820002000), - CONST64(0x0020000000202000), CONST64(0x0020000800202000), CONST64(0x0020000020202000), CONST64(0x0020000820202000), - CONST64(0x0020000000000020), CONST64(0x0020000800000020), CONST64(0x0020000020000020), CONST64(0x0020000820000020), - CONST64(0x0020000000200020), CONST64(0x0020000800200020), CONST64(0x0020000020200020), CONST64(0x0020000820200020), - CONST64(0x0020000000002020), CONST64(0x0020000800002020), CONST64(0x0020000020002020), CONST64(0x0020000820002020), - CONST64(0x0020000000202020), CONST64(0x0020000800202020), CONST64(0x0020000020202020), CONST64(0x0020000820202020), - CONST64(0x2020000000000000), CONST64(0x2020000800000000), CONST64(0x2020000020000000), CONST64(0x2020000820000000), - CONST64(0x2020000000200000), CONST64(0x2020000800200000), CONST64(0x2020000020200000), CONST64(0x2020000820200000), - CONST64(0x2020000000002000), CONST64(0x2020000800002000), CONST64(0x2020000020002000), CONST64(0x2020000820002000), - CONST64(0x2020000000202000), CONST64(0x2020000800202000), CONST64(0x2020000020202000), CONST64(0x2020000820202000), - CONST64(0x2020000000000020), CONST64(0x2020000800000020), CONST64(0x2020000020000020), CONST64(0x2020000820000020), - CONST64(0x2020000000200020), CONST64(0x2020000800200020), CONST64(0x2020000020200020), CONST64(0x2020000820200020), - CONST64(0x2020000000002020), CONST64(0x2020000800002020), CONST64(0x2020000020002020), CONST64(0x2020000820002020), - CONST64(0x2020000000202020), CONST64(0x2020000800202020), CONST64(0x2020000020202020), CONST64(0x2020000820202020), - CONST64(0x0000200000000000), CONST64(0x0000200800000000), CONST64(0x0000200020000000), CONST64(0x0000200820000000), - CONST64(0x0000200000200000), CONST64(0x0000200800200000), CONST64(0x0000200020200000), CONST64(0x0000200820200000), - CONST64(0x0000200000002000), CONST64(0x0000200800002000), CONST64(0x0000200020002000), CONST64(0x0000200820002000), - CONST64(0x0000200000202000), CONST64(0x0000200800202000), CONST64(0x0000200020202000), CONST64(0x0000200820202000), - CONST64(0x0000200000000020), CONST64(0x0000200800000020), CONST64(0x0000200020000020), CONST64(0x0000200820000020), - CONST64(0x0000200000200020), CONST64(0x0000200800200020), CONST64(0x0000200020200020), CONST64(0x0000200820200020), - CONST64(0x0000200000002020), CONST64(0x0000200800002020), CONST64(0x0000200020002020), CONST64(0x0000200820002020), - CONST64(0x0000200000202020), CONST64(0x0000200800202020), CONST64(0x0000200020202020), CONST64(0x0000200820202020), - CONST64(0x2000200000000000), CONST64(0x2000200800000000), CONST64(0x2000200020000000), CONST64(0x2000200820000000), - CONST64(0x2000200000200000), CONST64(0x2000200800200000), CONST64(0x2000200020200000), CONST64(0x2000200820200000), - CONST64(0x2000200000002000), CONST64(0x2000200800002000), CONST64(0x2000200020002000), CONST64(0x2000200820002000), - CONST64(0x2000200000202000), CONST64(0x2000200800202000), CONST64(0x2000200020202000), CONST64(0x2000200820202000), - CONST64(0x2000200000000020), CONST64(0x2000200800000020), CONST64(0x2000200020000020), CONST64(0x2000200820000020), - CONST64(0x2000200000200020), CONST64(0x2000200800200020), CONST64(0x2000200020200020), CONST64(0x2000200820200020), - CONST64(0x2000200000002020), CONST64(0x2000200800002020), CONST64(0x2000200020002020), CONST64(0x2000200820002020), - CONST64(0x2000200000202020), CONST64(0x2000200800202020), CONST64(0x2000200020202020), CONST64(0x2000200820202020), - CONST64(0x0020200000000000), CONST64(0x0020200800000000), CONST64(0x0020200020000000), CONST64(0x0020200820000000), - CONST64(0x0020200000200000), CONST64(0x0020200800200000), CONST64(0x0020200020200000), CONST64(0x0020200820200000), - CONST64(0x0020200000002000), CONST64(0x0020200800002000), CONST64(0x0020200020002000), CONST64(0x0020200820002000), - CONST64(0x0020200000202000), CONST64(0x0020200800202000), CONST64(0x0020200020202000), CONST64(0x0020200820202000), - CONST64(0x0020200000000020), CONST64(0x0020200800000020), CONST64(0x0020200020000020), CONST64(0x0020200820000020), - CONST64(0x0020200000200020), CONST64(0x0020200800200020), CONST64(0x0020200020200020), CONST64(0x0020200820200020), - CONST64(0x0020200000002020), CONST64(0x0020200800002020), CONST64(0x0020200020002020), CONST64(0x0020200820002020), - CONST64(0x0020200000202020), CONST64(0x0020200800202020), CONST64(0x0020200020202020), CONST64(0x0020200820202020), - CONST64(0x2020200000000000), CONST64(0x2020200800000000), CONST64(0x2020200020000000), CONST64(0x2020200820000000), - CONST64(0x2020200000200000), CONST64(0x2020200800200000), CONST64(0x2020200020200000), CONST64(0x2020200820200000), - CONST64(0x2020200000002000), CONST64(0x2020200800002000), CONST64(0x2020200020002000), CONST64(0x2020200820002000), - CONST64(0x2020200000202000), CONST64(0x2020200800202000), CONST64(0x2020200020202000), CONST64(0x2020200820202000), - CONST64(0x2020200000000020), CONST64(0x2020200800000020), CONST64(0x2020200020000020), CONST64(0x2020200820000020), - CONST64(0x2020200000200020), CONST64(0x2020200800200020), CONST64(0x2020200020200020), CONST64(0x2020200820200020), - CONST64(0x2020200000002020), CONST64(0x2020200800002020), CONST64(0x2020200020002020), CONST64(0x2020200820002020), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000000800000000), CONST64(0x0000000020000000), CONST64(0x0000000820000000), + CONST64(0x0000000000200000), CONST64(0x0000000800200000), CONST64(0x0000000020200000), CONST64(0x0000000820200000), + CONST64(0x0000000000002000), CONST64(0x0000000800002000), CONST64(0x0000000020002000), CONST64(0x0000000820002000), + CONST64(0x0000000000202000), CONST64(0x0000000800202000), CONST64(0x0000000020202000), CONST64(0x0000000820202000), + CONST64(0x0000000000000020), CONST64(0x0000000800000020), CONST64(0x0000000020000020), CONST64(0x0000000820000020), + CONST64(0x0000000000200020), CONST64(0x0000000800200020), CONST64(0x0000000020200020), CONST64(0x0000000820200020), + CONST64(0x0000000000002020), CONST64(0x0000000800002020), CONST64(0x0000000020002020), CONST64(0x0000000820002020), + CONST64(0x0000000000202020), CONST64(0x0000000800202020), CONST64(0x0000000020202020), CONST64(0x0000000820202020), + CONST64(0x2000000000000000), CONST64(0x2000000800000000), CONST64(0x2000000020000000), CONST64(0x2000000820000000), + CONST64(0x2000000000200000), CONST64(0x2000000800200000), CONST64(0x2000000020200000), CONST64(0x2000000820200000), + CONST64(0x2000000000002000), CONST64(0x2000000800002000), CONST64(0x2000000020002000), CONST64(0x2000000820002000), + CONST64(0x2000000000202000), CONST64(0x2000000800202000), CONST64(0x2000000020202000), CONST64(0x2000000820202000), + CONST64(0x2000000000000020), CONST64(0x2000000800000020), CONST64(0x2000000020000020), CONST64(0x2000000820000020), + CONST64(0x2000000000200020), CONST64(0x2000000800200020), CONST64(0x2000000020200020), CONST64(0x2000000820200020), + CONST64(0x2000000000002020), CONST64(0x2000000800002020), CONST64(0x2000000020002020), CONST64(0x2000000820002020), + CONST64(0x2000000000202020), CONST64(0x2000000800202020), CONST64(0x2000000020202020), CONST64(0x2000000820202020), + CONST64(0x0020000000000000), CONST64(0x0020000800000000), CONST64(0x0020000020000000), CONST64(0x0020000820000000), + CONST64(0x0020000000200000), CONST64(0x0020000800200000), CONST64(0x0020000020200000), CONST64(0x0020000820200000), + CONST64(0x0020000000002000), CONST64(0x0020000800002000), CONST64(0x0020000020002000), CONST64(0x0020000820002000), + CONST64(0x0020000000202000), CONST64(0x0020000800202000), CONST64(0x0020000020202000), CONST64(0x0020000820202000), + CONST64(0x0020000000000020), CONST64(0x0020000800000020), CONST64(0x0020000020000020), CONST64(0x0020000820000020), + CONST64(0x0020000000200020), CONST64(0x0020000800200020), CONST64(0x0020000020200020), CONST64(0x0020000820200020), + CONST64(0x0020000000002020), CONST64(0x0020000800002020), CONST64(0x0020000020002020), CONST64(0x0020000820002020), + CONST64(0x0020000000202020), CONST64(0x0020000800202020), CONST64(0x0020000020202020), CONST64(0x0020000820202020), + CONST64(0x2020000000000000), CONST64(0x2020000800000000), CONST64(0x2020000020000000), CONST64(0x2020000820000000), + CONST64(0x2020000000200000), CONST64(0x2020000800200000), CONST64(0x2020000020200000), CONST64(0x2020000820200000), + CONST64(0x2020000000002000), CONST64(0x2020000800002000), CONST64(0x2020000020002000), CONST64(0x2020000820002000), + CONST64(0x2020000000202000), CONST64(0x2020000800202000), CONST64(0x2020000020202000), CONST64(0x2020000820202000), + CONST64(0x2020000000000020), CONST64(0x2020000800000020), CONST64(0x2020000020000020), CONST64(0x2020000820000020), + CONST64(0x2020000000200020), CONST64(0x2020000800200020), CONST64(0x2020000020200020), CONST64(0x2020000820200020), + CONST64(0x2020000000002020), CONST64(0x2020000800002020), CONST64(0x2020000020002020), CONST64(0x2020000820002020), + CONST64(0x2020000000202020), CONST64(0x2020000800202020), CONST64(0x2020000020202020), CONST64(0x2020000820202020), + CONST64(0x0000200000000000), CONST64(0x0000200800000000), CONST64(0x0000200020000000), CONST64(0x0000200820000000), + CONST64(0x0000200000200000), CONST64(0x0000200800200000), CONST64(0x0000200020200000), CONST64(0x0000200820200000), + CONST64(0x0000200000002000), CONST64(0x0000200800002000), CONST64(0x0000200020002000), CONST64(0x0000200820002000), + CONST64(0x0000200000202000), CONST64(0x0000200800202000), CONST64(0x0000200020202000), CONST64(0x0000200820202000), + CONST64(0x0000200000000020), CONST64(0x0000200800000020), CONST64(0x0000200020000020), CONST64(0x0000200820000020), + CONST64(0x0000200000200020), CONST64(0x0000200800200020), CONST64(0x0000200020200020), CONST64(0x0000200820200020), + CONST64(0x0000200000002020), CONST64(0x0000200800002020), CONST64(0x0000200020002020), CONST64(0x0000200820002020), + CONST64(0x0000200000202020), CONST64(0x0000200800202020), CONST64(0x0000200020202020), CONST64(0x0000200820202020), + CONST64(0x2000200000000000), CONST64(0x2000200800000000), CONST64(0x2000200020000000), CONST64(0x2000200820000000), + CONST64(0x2000200000200000), CONST64(0x2000200800200000), CONST64(0x2000200020200000), CONST64(0x2000200820200000), + CONST64(0x2000200000002000), CONST64(0x2000200800002000), CONST64(0x2000200020002000), CONST64(0x2000200820002000), + CONST64(0x2000200000202000), CONST64(0x2000200800202000), CONST64(0x2000200020202000), CONST64(0x2000200820202000), + CONST64(0x2000200000000020), CONST64(0x2000200800000020), CONST64(0x2000200020000020), CONST64(0x2000200820000020), + CONST64(0x2000200000200020), CONST64(0x2000200800200020), CONST64(0x2000200020200020), CONST64(0x2000200820200020), + CONST64(0x2000200000002020), CONST64(0x2000200800002020), CONST64(0x2000200020002020), CONST64(0x2000200820002020), + CONST64(0x2000200000202020), CONST64(0x2000200800202020), CONST64(0x2000200020202020), CONST64(0x2000200820202020), + CONST64(0x0020200000000000), CONST64(0x0020200800000000), CONST64(0x0020200020000000), CONST64(0x0020200820000000), + CONST64(0x0020200000200000), CONST64(0x0020200800200000), CONST64(0x0020200020200000), CONST64(0x0020200820200000), + CONST64(0x0020200000002000), CONST64(0x0020200800002000), CONST64(0x0020200020002000), CONST64(0x0020200820002000), + CONST64(0x0020200000202000), CONST64(0x0020200800202000), CONST64(0x0020200020202000), CONST64(0x0020200820202000), + CONST64(0x0020200000000020), CONST64(0x0020200800000020), CONST64(0x0020200020000020), CONST64(0x0020200820000020), + CONST64(0x0020200000200020), CONST64(0x0020200800200020), CONST64(0x0020200020200020), CONST64(0x0020200820200020), + CONST64(0x0020200000002020), CONST64(0x0020200800002020), CONST64(0x0020200020002020), CONST64(0x0020200820002020), + CONST64(0x0020200000202020), CONST64(0x0020200800202020), CONST64(0x0020200020202020), CONST64(0x0020200820202020), + CONST64(0x2020200000000000), CONST64(0x2020200800000000), CONST64(0x2020200020000000), CONST64(0x2020200820000000), + CONST64(0x2020200000200000), CONST64(0x2020200800200000), CONST64(0x2020200020200000), CONST64(0x2020200820200000), + CONST64(0x2020200000002000), CONST64(0x2020200800002000), CONST64(0x2020200020002000), CONST64(0x2020200820002000), + CONST64(0x2020200000202000), CONST64(0x2020200800202000), CONST64(0x2020200020202000), CONST64(0x2020200820202000), + CONST64(0x2020200000000020), CONST64(0x2020200800000020), CONST64(0x2020200020000020), CONST64(0x2020200820000020), + CONST64(0x2020200000200020), CONST64(0x2020200800200020), CONST64(0x2020200020200020), CONST64(0x2020200820200020), + CONST64(0x2020200000002020), CONST64(0x2020200800002020), CONST64(0x2020200020002020), CONST64(0x2020200820002020), CONST64(0x2020200000202020), CONST64(0x2020200800202020), CONST64(0x2020200020202020), CONST64(0x2020200820202020) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000002000000000), CONST64(0x0000000080000000), CONST64(0x0000002080000000), - CONST64(0x0000000000800000), CONST64(0x0000002000800000), CONST64(0x0000000080800000), CONST64(0x0000002080800000), - CONST64(0x0000000000008000), CONST64(0x0000002000008000), CONST64(0x0000000080008000), CONST64(0x0000002080008000), - CONST64(0x0000000000808000), CONST64(0x0000002000808000), CONST64(0x0000000080808000), CONST64(0x0000002080808000), - CONST64(0x0000000000000080), CONST64(0x0000002000000080), CONST64(0x0000000080000080), CONST64(0x0000002080000080), - CONST64(0x0000000000800080), CONST64(0x0000002000800080), CONST64(0x0000000080800080), CONST64(0x0000002080800080), - CONST64(0x0000000000008080), CONST64(0x0000002000008080), CONST64(0x0000000080008080), CONST64(0x0000002080008080), - CONST64(0x0000000000808080), CONST64(0x0000002000808080), CONST64(0x0000000080808080), CONST64(0x0000002080808080), - CONST64(0x8000000000000000), CONST64(0x8000002000000000), CONST64(0x8000000080000000), CONST64(0x8000002080000000), - CONST64(0x8000000000800000), CONST64(0x8000002000800000), CONST64(0x8000000080800000), CONST64(0x8000002080800000), - CONST64(0x8000000000008000), CONST64(0x8000002000008000), CONST64(0x8000000080008000), CONST64(0x8000002080008000), - CONST64(0x8000000000808000), CONST64(0x8000002000808000), CONST64(0x8000000080808000), CONST64(0x8000002080808000), - CONST64(0x8000000000000080), CONST64(0x8000002000000080), CONST64(0x8000000080000080), CONST64(0x8000002080000080), - CONST64(0x8000000000800080), CONST64(0x8000002000800080), CONST64(0x8000000080800080), CONST64(0x8000002080800080), - CONST64(0x8000000000008080), CONST64(0x8000002000008080), CONST64(0x8000000080008080), CONST64(0x8000002080008080), - CONST64(0x8000000000808080), CONST64(0x8000002000808080), CONST64(0x8000000080808080), CONST64(0x8000002080808080), - CONST64(0x0080000000000000), CONST64(0x0080002000000000), CONST64(0x0080000080000000), CONST64(0x0080002080000000), - CONST64(0x0080000000800000), CONST64(0x0080002000800000), CONST64(0x0080000080800000), CONST64(0x0080002080800000), - CONST64(0x0080000000008000), CONST64(0x0080002000008000), CONST64(0x0080000080008000), CONST64(0x0080002080008000), - CONST64(0x0080000000808000), CONST64(0x0080002000808000), CONST64(0x0080000080808000), CONST64(0x0080002080808000), - CONST64(0x0080000000000080), CONST64(0x0080002000000080), CONST64(0x0080000080000080), CONST64(0x0080002080000080), - CONST64(0x0080000000800080), CONST64(0x0080002000800080), CONST64(0x0080000080800080), CONST64(0x0080002080800080), - CONST64(0x0080000000008080), CONST64(0x0080002000008080), CONST64(0x0080000080008080), CONST64(0x0080002080008080), - CONST64(0x0080000000808080), CONST64(0x0080002000808080), CONST64(0x0080000080808080), CONST64(0x0080002080808080), - CONST64(0x8080000000000000), CONST64(0x8080002000000000), CONST64(0x8080000080000000), CONST64(0x8080002080000000), - CONST64(0x8080000000800000), CONST64(0x8080002000800000), CONST64(0x8080000080800000), CONST64(0x8080002080800000), - CONST64(0x8080000000008000), CONST64(0x8080002000008000), CONST64(0x8080000080008000), CONST64(0x8080002080008000), - CONST64(0x8080000000808000), CONST64(0x8080002000808000), CONST64(0x8080000080808000), CONST64(0x8080002080808000), - CONST64(0x8080000000000080), CONST64(0x8080002000000080), CONST64(0x8080000080000080), CONST64(0x8080002080000080), - CONST64(0x8080000000800080), CONST64(0x8080002000800080), CONST64(0x8080000080800080), CONST64(0x8080002080800080), - CONST64(0x8080000000008080), CONST64(0x8080002000008080), CONST64(0x8080000080008080), CONST64(0x8080002080008080), - CONST64(0x8080000000808080), CONST64(0x8080002000808080), CONST64(0x8080000080808080), CONST64(0x8080002080808080), - CONST64(0x0000800000000000), CONST64(0x0000802000000000), CONST64(0x0000800080000000), CONST64(0x0000802080000000), - CONST64(0x0000800000800000), CONST64(0x0000802000800000), CONST64(0x0000800080800000), CONST64(0x0000802080800000), - CONST64(0x0000800000008000), CONST64(0x0000802000008000), CONST64(0x0000800080008000), CONST64(0x0000802080008000), - CONST64(0x0000800000808000), CONST64(0x0000802000808000), CONST64(0x0000800080808000), CONST64(0x0000802080808000), - CONST64(0x0000800000000080), CONST64(0x0000802000000080), CONST64(0x0000800080000080), CONST64(0x0000802080000080), - CONST64(0x0000800000800080), CONST64(0x0000802000800080), CONST64(0x0000800080800080), CONST64(0x0000802080800080), - CONST64(0x0000800000008080), CONST64(0x0000802000008080), CONST64(0x0000800080008080), CONST64(0x0000802080008080), - CONST64(0x0000800000808080), CONST64(0x0000802000808080), CONST64(0x0000800080808080), CONST64(0x0000802080808080), - CONST64(0x8000800000000000), CONST64(0x8000802000000000), CONST64(0x8000800080000000), CONST64(0x8000802080000000), - CONST64(0x8000800000800000), CONST64(0x8000802000800000), CONST64(0x8000800080800000), CONST64(0x8000802080800000), - CONST64(0x8000800000008000), CONST64(0x8000802000008000), CONST64(0x8000800080008000), CONST64(0x8000802080008000), - CONST64(0x8000800000808000), CONST64(0x8000802000808000), CONST64(0x8000800080808000), CONST64(0x8000802080808000), - CONST64(0x8000800000000080), CONST64(0x8000802000000080), CONST64(0x8000800080000080), CONST64(0x8000802080000080), - CONST64(0x8000800000800080), CONST64(0x8000802000800080), CONST64(0x8000800080800080), CONST64(0x8000802080800080), - CONST64(0x8000800000008080), CONST64(0x8000802000008080), CONST64(0x8000800080008080), CONST64(0x8000802080008080), - CONST64(0x8000800000808080), CONST64(0x8000802000808080), CONST64(0x8000800080808080), CONST64(0x8000802080808080), - CONST64(0x0080800000000000), CONST64(0x0080802000000000), CONST64(0x0080800080000000), CONST64(0x0080802080000000), - CONST64(0x0080800000800000), CONST64(0x0080802000800000), CONST64(0x0080800080800000), CONST64(0x0080802080800000), - CONST64(0x0080800000008000), CONST64(0x0080802000008000), CONST64(0x0080800080008000), CONST64(0x0080802080008000), - CONST64(0x0080800000808000), CONST64(0x0080802000808000), CONST64(0x0080800080808000), CONST64(0x0080802080808000), - CONST64(0x0080800000000080), CONST64(0x0080802000000080), CONST64(0x0080800080000080), CONST64(0x0080802080000080), - CONST64(0x0080800000800080), CONST64(0x0080802000800080), CONST64(0x0080800080800080), CONST64(0x0080802080800080), - CONST64(0x0080800000008080), CONST64(0x0080802000008080), CONST64(0x0080800080008080), CONST64(0x0080802080008080), - CONST64(0x0080800000808080), CONST64(0x0080802000808080), CONST64(0x0080800080808080), CONST64(0x0080802080808080), - CONST64(0x8080800000000000), CONST64(0x8080802000000000), CONST64(0x8080800080000000), CONST64(0x8080802080000000), - CONST64(0x8080800000800000), CONST64(0x8080802000800000), CONST64(0x8080800080800000), CONST64(0x8080802080800000), - CONST64(0x8080800000008000), CONST64(0x8080802000008000), CONST64(0x8080800080008000), CONST64(0x8080802080008000), - CONST64(0x8080800000808000), CONST64(0x8080802000808000), CONST64(0x8080800080808000), CONST64(0x8080802080808000), - CONST64(0x8080800000000080), CONST64(0x8080802000000080), CONST64(0x8080800080000080), CONST64(0x8080802080000080), - CONST64(0x8080800000800080), CONST64(0x8080802000800080), CONST64(0x8080800080800080), CONST64(0x8080802080800080), - CONST64(0x8080800000008080), CONST64(0x8080802000008080), CONST64(0x8080800080008080), CONST64(0x8080802080008080), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000002000000000), CONST64(0x0000000080000000), CONST64(0x0000002080000000), + CONST64(0x0000000000800000), CONST64(0x0000002000800000), CONST64(0x0000000080800000), CONST64(0x0000002080800000), + CONST64(0x0000000000008000), CONST64(0x0000002000008000), CONST64(0x0000000080008000), CONST64(0x0000002080008000), + CONST64(0x0000000000808000), CONST64(0x0000002000808000), CONST64(0x0000000080808000), CONST64(0x0000002080808000), + CONST64(0x0000000000000080), CONST64(0x0000002000000080), CONST64(0x0000000080000080), CONST64(0x0000002080000080), + CONST64(0x0000000000800080), CONST64(0x0000002000800080), CONST64(0x0000000080800080), CONST64(0x0000002080800080), + CONST64(0x0000000000008080), CONST64(0x0000002000008080), CONST64(0x0000000080008080), CONST64(0x0000002080008080), + CONST64(0x0000000000808080), CONST64(0x0000002000808080), CONST64(0x0000000080808080), CONST64(0x0000002080808080), + CONST64(0x8000000000000000), CONST64(0x8000002000000000), CONST64(0x8000000080000000), CONST64(0x8000002080000000), + CONST64(0x8000000000800000), CONST64(0x8000002000800000), CONST64(0x8000000080800000), CONST64(0x8000002080800000), + CONST64(0x8000000000008000), CONST64(0x8000002000008000), CONST64(0x8000000080008000), CONST64(0x8000002080008000), + CONST64(0x8000000000808000), CONST64(0x8000002000808000), CONST64(0x8000000080808000), CONST64(0x8000002080808000), + CONST64(0x8000000000000080), CONST64(0x8000002000000080), CONST64(0x8000000080000080), CONST64(0x8000002080000080), + CONST64(0x8000000000800080), CONST64(0x8000002000800080), CONST64(0x8000000080800080), CONST64(0x8000002080800080), + CONST64(0x8000000000008080), CONST64(0x8000002000008080), CONST64(0x8000000080008080), CONST64(0x8000002080008080), + CONST64(0x8000000000808080), CONST64(0x8000002000808080), CONST64(0x8000000080808080), CONST64(0x8000002080808080), + CONST64(0x0080000000000000), CONST64(0x0080002000000000), CONST64(0x0080000080000000), CONST64(0x0080002080000000), + CONST64(0x0080000000800000), CONST64(0x0080002000800000), CONST64(0x0080000080800000), CONST64(0x0080002080800000), + CONST64(0x0080000000008000), CONST64(0x0080002000008000), CONST64(0x0080000080008000), CONST64(0x0080002080008000), + CONST64(0x0080000000808000), CONST64(0x0080002000808000), CONST64(0x0080000080808000), CONST64(0x0080002080808000), + CONST64(0x0080000000000080), CONST64(0x0080002000000080), CONST64(0x0080000080000080), CONST64(0x0080002080000080), + CONST64(0x0080000000800080), CONST64(0x0080002000800080), CONST64(0x0080000080800080), CONST64(0x0080002080800080), + CONST64(0x0080000000008080), CONST64(0x0080002000008080), CONST64(0x0080000080008080), CONST64(0x0080002080008080), + CONST64(0x0080000000808080), CONST64(0x0080002000808080), CONST64(0x0080000080808080), CONST64(0x0080002080808080), + CONST64(0x8080000000000000), CONST64(0x8080002000000000), CONST64(0x8080000080000000), CONST64(0x8080002080000000), + CONST64(0x8080000000800000), CONST64(0x8080002000800000), CONST64(0x8080000080800000), CONST64(0x8080002080800000), + CONST64(0x8080000000008000), CONST64(0x8080002000008000), CONST64(0x8080000080008000), CONST64(0x8080002080008000), + CONST64(0x8080000000808000), CONST64(0x8080002000808000), CONST64(0x8080000080808000), CONST64(0x8080002080808000), + CONST64(0x8080000000000080), CONST64(0x8080002000000080), CONST64(0x8080000080000080), CONST64(0x8080002080000080), + CONST64(0x8080000000800080), CONST64(0x8080002000800080), CONST64(0x8080000080800080), CONST64(0x8080002080800080), + CONST64(0x8080000000008080), CONST64(0x8080002000008080), CONST64(0x8080000080008080), CONST64(0x8080002080008080), + CONST64(0x8080000000808080), CONST64(0x8080002000808080), CONST64(0x8080000080808080), CONST64(0x8080002080808080), + CONST64(0x0000800000000000), CONST64(0x0000802000000000), CONST64(0x0000800080000000), CONST64(0x0000802080000000), + CONST64(0x0000800000800000), CONST64(0x0000802000800000), CONST64(0x0000800080800000), CONST64(0x0000802080800000), + CONST64(0x0000800000008000), CONST64(0x0000802000008000), CONST64(0x0000800080008000), CONST64(0x0000802080008000), + CONST64(0x0000800000808000), CONST64(0x0000802000808000), CONST64(0x0000800080808000), CONST64(0x0000802080808000), + CONST64(0x0000800000000080), CONST64(0x0000802000000080), CONST64(0x0000800080000080), CONST64(0x0000802080000080), + CONST64(0x0000800000800080), CONST64(0x0000802000800080), CONST64(0x0000800080800080), CONST64(0x0000802080800080), + CONST64(0x0000800000008080), CONST64(0x0000802000008080), CONST64(0x0000800080008080), CONST64(0x0000802080008080), + CONST64(0x0000800000808080), CONST64(0x0000802000808080), CONST64(0x0000800080808080), CONST64(0x0000802080808080), + CONST64(0x8000800000000000), CONST64(0x8000802000000000), CONST64(0x8000800080000000), CONST64(0x8000802080000000), + CONST64(0x8000800000800000), CONST64(0x8000802000800000), CONST64(0x8000800080800000), CONST64(0x8000802080800000), + CONST64(0x8000800000008000), CONST64(0x8000802000008000), CONST64(0x8000800080008000), CONST64(0x8000802080008000), + CONST64(0x8000800000808000), CONST64(0x8000802000808000), CONST64(0x8000800080808000), CONST64(0x8000802080808000), + CONST64(0x8000800000000080), CONST64(0x8000802000000080), CONST64(0x8000800080000080), CONST64(0x8000802080000080), + CONST64(0x8000800000800080), CONST64(0x8000802000800080), CONST64(0x8000800080800080), CONST64(0x8000802080800080), + CONST64(0x8000800000008080), CONST64(0x8000802000008080), CONST64(0x8000800080008080), CONST64(0x8000802080008080), + CONST64(0x8000800000808080), CONST64(0x8000802000808080), CONST64(0x8000800080808080), CONST64(0x8000802080808080), + CONST64(0x0080800000000000), CONST64(0x0080802000000000), CONST64(0x0080800080000000), CONST64(0x0080802080000000), + CONST64(0x0080800000800000), CONST64(0x0080802000800000), CONST64(0x0080800080800000), CONST64(0x0080802080800000), + CONST64(0x0080800000008000), CONST64(0x0080802000008000), CONST64(0x0080800080008000), CONST64(0x0080802080008000), + CONST64(0x0080800000808000), CONST64(0x0080802000808000), CONST64(0x0080800080808000), CONST64(0x0080802080808000), + CONST64(0x0080800000000080), CONST64(0x0080802000000080), CONST64(0x0080800080000080), CONST64(0x0080802080000080), + CONST64(0x0080800000800080), CONST64(0x0080802000800080), CONST64(0x0080800080800080), CONST64(0x0080802080800080), + CONST64(0x0080800000008080), CONST64(0x0080802000008080), CONST64(0x0080800080008080), CONST64(0x0080802080008080), + CONST64(0x0080800000808080), CONST64(0x0080802000808080), CONST64(0x0080800080808080), CONST64(0x0080802080808080), + CONST64(0x8080800000000000), CONST64(0x8080802000000000), CONST64(0x8080800080000000), CONST64(0x8080802080000000), + CONST64(0x8080800000800000), CONST64(0x8080802000800000), CONST64(0x8080800080800000), CONST64(0x8080802080800000), + CONST64(0x8080800000008000), CONST64(0x8080802000008000), CONST64(0x8080800080008000), CONST64(0x8080802080008000), + CONST64(0x8080800000808000), CONST64(0x8080802000808000), CONST64(0x8080800080808000), CONST64(0x8080802080808000), + CONST64(0x8080800000000080), CONST64(0x8080802000000080), CONST64(0x8080800080000080), CONST64(0x8080802080000080), + CONST64(0x8080800000800080), CONST64(0x8080802000800080), CONST64(0x8080800080800080), CONST64(0x8080802080800080), + CONST64(0x8080800000008080), CONST64(0x8080802000008080), CONST64(0x8080800080008080), CONST64(0x8080802080008080), CONST64(0x8080800000808080), CONST64(0x8080802000808080), CONST64(0x8080800080808080), CONST64(0x8080802080808080) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000004000000000), CONST64(0x0000000001000000), CONST64(0x0000004001000000), - CONST64(0x0000000000010000), CONST64(0x0000004000010000), CONST64(0x0000000001010000), CONST64(0x0000004001010000), - CONST64(0x0000000000000100), CONST64(0x0000004000000100), CONST64(0x0000000001000100), CONST64(0x0000004001000100), - CONST64(0x0000000000010100), CONST64(0x0000004000010100), CONST64(0x0000000001010100), CONST64(0x0000004001010100), - CONST64(0x0000000000000001), CONST64(0x0000004000000001), CONST64(0x0000000001000001), CONST64(0x0000004001000001), - CONST64(0x0000000000010001), CONST64(0x0000004000010001), CONST64(0x0000000001010001), CONST64(0x0000004001010001), - CONST64(0x0000000000000101), CONST64(0x0000004000000101), CONST64(0x0000000001000101), CONST64(0x0000004001000101), - CONST64(0x0000000000010101), CONST64(0x0000004000010101), CONST64(0x0000000001010101), CONST64(0x0000004001010101), - CONST64(0x0100000000000000), CONST64(0x0100004000000000), CONST64(0x0100000001000000), CONST64(0x0100004001000000), - CONST64(0x0100000000010000), CONST64(0x0100004000010000), CONST64(0x0100000001010000), CONST64(0x0100004001010000), - CONST64(0x0100000000000100), CONST64(0x0100004000000100), CONST64(0x0100000001000100), CONST64(0x0100004001000100), - CONST64(0x0100000000010100), CONST64(0x0100004000010100), CONST64(0x0100000001010100), CONST64(0x0100004001010100), - CONST64(0x0100000000000001), CONST64(0x0100004000000001), CONST64(0x0100000001000001), CONST64(0x0100004001000001), - CONST64(0x0100000000010001), CONST64(0x0100004000010001), CONST64(0x0100000001010001), CONST64(0x0100004001010001), - CONST64(0x0100000000000101), CONST64(0x0100004000000101), CONST64(0x0100000001000101), CONST64(0x0100004001000101), - CONST64(0x0100000000010101), CONST64(0x0100004000010101), CONST64(0x0100000001010101), CONST64(0x0100004001010101), - CONST64(0x0001000000000000), CONST64(0x0001004000000000), CONST64(0x0001000001000000), CONST64(0x0001004001000000), - CONST64(0x0001000000010000), CONST64(0x0001004000010000), CONST64(0x0001000001010000), CONST64(0x0001004001010000), - CONST64(0x0001000000000100), CONST64(0x0001004000000100), CONST64(0x0001000001000100), CONST64(0x0001004001000100), - CONST64(0x0001000000010100), CONST64(0x0001004000010100), CONST64(0x0001000001010100), CONST64(0x0001004001010100), - CONST64(0x0001000000000001), CONST64(0x0001004000000001), CONST64(0x0001000001000001), CONST64(0x0001004001000001), - CONST64(0x0001000000010001), CONST64(0x0001004000010001), CONST64(0x0001000001010001), CONST64(0x0001004001010001), - CONST64(0x0001000000000101), CONST64(0x0001004000000101), CONST64(0x0001000001000101), CONST64(0x0001004001000101), - CONST64(0x0001000000010101), CONST64(0x0001004000010101), CONST64(0x0001000001010101), CONST64(0x0001004001010101), - CONST64(0x0101000000000000), CONST64(0x0101004000000000), CONST64(0x0101000001000000), CONST64(0x0101004001000000), - CONST64(0x0101000000010000), CONST64(0x0101004000010000), CONST64(0x0101000001010000), CONST64(0x0101004001010000), - CONST64(0x0101000000000100), CONST64(0x0101004000000100), CONST64(0x0101000001000100), CONST64(0x0101004001000100), - CONST64(0x0101000000010100), CONST64(0x0101004000010100), CONST64(0x0101000001010100), CONST64(0x0101004001010100), - CONST64(0x0101000000000001), CONST64(0x0101004000000001), CONST64(0x0101000001000001), CONST64(0x0101004001000001), - CONST64(0x0101000000010001), CONST64(0x0101004000010001), CONST64(0x0101000001010001), CONST64(0x0101004001010001), - CONST64(0x0101000000000101), CONST64(0x0101004000000101), CONST64(0x0101000001000101), CONST64(0x0101004001000101), - CONST64(0x0101000000010101), CONST64(0x0101004000010101), CONST64(0x0101000001010101), CONST64(0x0101004001010101), - CONST64(0x0000010000000000), CONST64(0x0000014000000000), CONST64(0x0000010001000000), CONST64(0x0000014001000000), - CONST64(0x0000010000010000), CONST64(0x0000014000010000), CONST64(0x0000010001010000), CONST64(0x0000014001010000), - CONST64(0x0000010000000100), CONST64(0x0000014000000100), CONST64(0x0000010001000100), CONST64(0x0000014001000100), - CONST64(0x0000010000010100), CONST64(0x0000014000010100), CONST64(0x0000010001010100), CONST64(0x0000014001010100), - CONST64(0x0000010000000001), CONST64(0x0000014000000001), CONST64(0x0000010001000001), CONST64(0x0000014001000001), - CONST64(0x0000010000010001), CONST64(0x0000014000010001), CONST64(0x0000010001010001), CONST64(0x0000014001010001), - CONST64(0x0000010000000101), CONST64(0x0000014000000101), CONST64(0x0000010001000101), CONST64(0x0000014001000101), - CONST64(0x0000010000010101), CONST64(0x0000014000010101), CONST64(0x0000010001010101), CONST64(0x0000014001010101), - CONST64(0x0100010000000000), CONST64(0x0100014000000000), CONST64(0x0100010001000000), CONST64(0x0100014001000000), - CONST64(0x0100010000010000), CONST64(0x0100014000010000), CONST64(0x0100010001010000), CONST64(0x0100014001010000), - CONST64(0x0100010000000100), CONST64(0x0100014000000100), CONST64(0x0100010001000100), CONST64(0x0100014001000100), - CONST64(0x0100010000010100), CONST64(0x0100014000010100), CONST64(0x0100010001010100), CONST64(0x0100014001010100), - CONST64(0x0100010000000001), CONST64(0x0100014000000001), CONST64(0x0100010001000001), CONST64(0x0100014001000001), - CONST64(0x0100010000010001), CONST64(0x0100014000010001), CONST64(0x0100010001010001), CONST64(0x0100014001010001), - CONST64(0x0100010000000101), CONST64(0x0100014000000101), CONST64(0x0100010001000101), CONST64(0x0100014001000101), - CONST64(0x0100010000010101), CONST64(0x0100014000010101), CONST64(0x0100010001010101), CONST64(0x0100014001010101), - CONST64(0x0001010000000000), CONST64(0x0001014000000000), CONST64(0x0001010001000000), CONST64(0x0001014001000000), - CONST64(0x0001010000010000), CONST64(0x0001014000010000), CONST64(0x0001010001010000), CONST64(0x0001014001010000), - CONST64(0x0001010000000100), CONST64(0x0001014000000100), CONST64(0x0001010001000100), CONST64(0x0001014001000100), - CONST64(0x0001010000010100), CONST64(0x0001014000010100), CONST64(0x0001010001010100), CONST64(0x0001014001010100), - CONST64(0x0001010000000001), CONST64(0x0001014000000001), CONST64(0x0001010001000001), CONST64(0x0001014001000001), - CONST64(0x0001010000010001), CONST64(0x0001014000010001), CONST64(0x0001010001010001), CONST64(0x0001014001010001), - CONST64(0x0001010000000101), CONST64(0x0001014000000101), CONST64(0x0001010001000101), CONST64(0x0001014001000101), - CONST64(0x0001010000010101), CONST64(0x0001014000010101), CONST64(0x0001010001010101), CONST64(0x0001014001010101), - CONST64(0x0101010000000000), CONST64(0x0101014000000000), CONST64(0x0101010001000000), CONST64(0x0101014001000000), - CONST64(0x0101010000010000), CONST64(0x0101014000010000), CONST64(0x0101010001010000), CONST64(0x0101014001010000), - CONST64(0x0101010000000100), CONST64(0x0101014000000100), CONST64(0x0101010001000100), CONST64(0x0101014001000100), - CONST64(0x0101010000010100), CONST64(0x0101014000010100), CONST64(0x0101010001010100), CONST64(0x0101014001010100), - CONST64(0x0101010000000001), CONST64(0x0101014000000001), CONST64(0x0101010001000001), CONST64(0x0101014001000001), - CONST64(0x0101010000010001), CONST64(0x0101014000010001), CONST64(0x0101010001010001), CONST64(0x0101014001010001), - CONST64(0x0101010000000101), CONST64(0x0101014000000101), CONST64(0x0101010001000101), CONST64(0x0101014001000101), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000004000000000), CONST64(0x0000000001000000), CONST64(0x0000004001000000), + CONST64(0x0000000000010000), CONST64(0x0000004000010000), CONST64(0x0000000001010000), CONST64(0x0000004001010000), + CONST64(0x0000000000000100), CONST64(0x0000004000000100), CONST64(0x0000000001000100), CONST64(0x0000004001000100), + CONST64(0x0000000000010100), CONST64(0x0000004000010100), CONST64(0x0000000001010100), CONST64(0x0000004001010100), + CONST64(0x0000000000000001), CONST64(0x0000004000000001), CONST64(0x0000000001000001), CONST64(0x0000004001000001), + CONST64(0x0000000000010001), CONST64(0x0000004000010001), CONST64(0x0000000001010001), CONST64(0x0000004001010001), + CONST64(0x0000000000000101), CONST64(0x0000004000000101), CONST64(0x0000000001000101), CONST64(0x0000004001000101), + CONST64(0x0000000000010101), CONST64(0x0000004000010101), CONST64(0x0000000001010101), CONST64(0x0000004001010101), + CONST64(0x0100000000000000), CONST64(0x0100004000000000), CONST64(0x0100000001000000), CONST64(0x0100004001000000), + CONST64(0x0100000000010000), CONST64(0x0100004000010000), CONST64(0x0100000001010000), CONST64(0x0100004001010000), + CONST64(0x0100000000000100), CONST64(0x0100004000000100), CONST64(0x0100000001000100), CONST64(0x0100004001000100), + CONST64(0x0100000000010100), CONST64(0x0100004000010100), CONST64(0x0100000001010100), CONST64(0x0100004001010100), + CONST64(0x0100000000000001), CONST64(0x0100004000000001), CONST64(0x0100000001000001), CONST64(0x0100004001000001), + CONST64(0x0100000000010001), CONST64(0x0100004000010001), CONST64(0x0100000001010001), CONST64(0x0100004001010001), + CONST64(0x0100000000000101), CONST64(0x0100004000000101), CONST64(0x0100000001000101), CONST64(0x0100004001000101), + CONST64(0x0100000000010101), CONST64(0x0100004000010101), CONST64(0x0100000001010101), CONST64(0x0100004001010101), + CONST64(0x0001000000000000), CONST64(0x0001004000000000), CONST64(0x0001000001000000), CONST64(0x0001004001000000), + CONST64(0x0001000000010000), CONST64(0x0001004000010000), CONST64(0x0001000001010000), CONST64(0x0001004001010000), + CONST64(0x0001000000000100), CONST64(0x0001004000000100), CONST64(0x0001000001000100), CONST64(0x0001004001000100), + CONST64(0x0001000000010100), CONST64(0x0001004000010100), CONST64(0x0001000001010100), CONST64(0x0001004001010100), + CONST64(0x0001000000000001), CONST64(0x0001004000000001), CONST64(0x0001000001000001), CONST64(0x0001004001000001), + CONST64(0x0001000000010001), CONST64(0x0001004000010001), CONST64(0x0001000001010001), CONST64(0x0001004001010001), + CONST64(0x0001000000000101), CONST64(0x0001004000000101), CONST64(0x0001000001000101), CONST64(0x0001004001000101), + CONST64(0x0001000000010101), CONST64(0x0001004000010101), CONST64(0x0001000001010101), CONST64(0x0001004001010101), + CONST64(0x0101000000000000), CONST64(0x0101004000000000), CONST64(0x0101000001000000), CONST64(0x0101004001000000), + CONST64(0x0101000000010000), CONST64(0x0101004000010000), CONST64(0x0101000001010000), CONST64(0x0101004001010000), + CONST64(0x0101000000000100), CONST64(0x0101004000000100), CONST64(0x0101000001000100), CONST64(0x0101004001000100), + CONST64(0x0101000000010100), CONST64(0x0101004000010100), CONST64(0x0101000001010100), CONST64(0x0101004001010100), + CONST64(0x0101000000000001), CONST64(0x0101004000000001), CONST64(0x0101000001000001), CONST64(0x0101004001000001), + CONST64(0x0101000000010001), CONST64(0x0101004000010001), CONST64(0x0101000001010001), CONST64(0x0101004001010001), + CONST64(0x0101000000000101), CONST64(0x0101004000000101), CONST64(0x0101000001000101), CONST64(0x0101004001000101), + CONST64(0x0101000000010101), CONST64(0x0101004000010101), CONST64(0x0101000001010101), CONST64(0x0101004001010101), + CONST64(0x0000010000000000), CONST64(0x0000014000000000), CONST64(0x0000010001000000), CONST64(0x0000014001000000), + CONST64(0x0000010000010000), CONST64(0x0000014000010000), CONST64(0x0000010001010000), CONST64(0x0000014001010000), + CONST64(0x0000010000000100), CONST64(0x0000014000000100), CONST64(0x0000010001000100), CONST64(0x0000014001000100), + CONST64(0x0000010000010100), CONST64(0x0000014000010100), CONST64(0x0000010001010100), CONST64(0x0000014001010100), + CONST64(0x0000010000000001), CONST64(0x0000014000000001), CONST64(0x0000010001000001), CONST64(0x0000014001000001), + CONST64(0x0000010000010001), CONST64(0x0000014000010001), CONST64(0x0000010001010001), CONST64(0x0000014001010001), + CONST64(0x0000010000000101), CONST64(0x0000014000000101), CONST64(0x0000010001000101), CONST64(0x0000014001000101), + CONST64(0x0000010000010101), CONST64(0x0000014000010101), CONST64(0x0000010001010101), CONST64(0x0000014001010101), + CONST64(0x0100010000000000), CONST64(0x0100014000000000), CONST64(0x0100010001000000), CONST64(0x0100014001000000), + CONST64(0x0100010000010000), CONST64(0x0100014000010000), CONST64(0x0100010001010000), CONST64(0x0100014001010000), + CONST64(0x0100010000000100), CONST64(0x0100014000000100), CONST64(0x0100010001000100), CONST64(0x0100014001000100), + CONST64(0x0100010000010100), CONST64(0x0100014000010100), CONST64(0x0100010001010100), CONST64(0x0100014001010100), + CONST64(0x0100010000000001), CONST64(0x0100014000000001), CONST64(0x0100010001000001), CONST64(0x0100014001000001), + CONST64(0x0100010000010001), CONST64(0x0100014000010001), CONST64(0x0100010001010001), CONST64(0x0100014001010001), + CONST64(0x0100010000000101), CONST64(0x0100014000000101), CONST64(0x0100010001000101), CONST64(0x0100014001000101), + CONST64(0x0100010000010101), CONST64(0x0100014000010101), CONST64(0x0100010001010101), CONST64(0x0100014001010101), + CONST64(0x0001010000000000), CONST64(0x0001014000000000), CONST64(0x0001010001000000), CONST64(0x0001014001000000), + CONST64(0x0001010000010000), CONST64(0x0001014000010000), CONST64(0x0001010001010000), CONST64(0x0001014001010000), + CONST64(0x0001010000000100), CONST64(0x0001014000000100), CONST64(0x0001010001000100), CONST64(0x0001014001000100), + CONST64(0x0001010000010100), CONST64(0x0001014000010100), CONST64(0x0001010001010100), CONST64(0x0001014001010100), + CONST64(0x0001010000000001), CONST64(0x0001014000000001), CONST64(0x0001010001000001), CONST64(0x0001014001000001), + CONST64(0x0001010000010001), CONST64(0x0001014000010001), CONST64(0x0001010001010001), CONST64(0x0001014001010001), + CONST64(0x0001010000000101), CONST64(0x0001014000000101), CONST64(0x0001010001000101), CONST64(0x0001014001000101), + CONST64(0x0001010000010101), CONST64(0x0001014000010101), CONST64(0x0001010001010101), CONST64(0x0001014001010101), + CONST64(0x0101010000000000), CONST64(0x0101014000000000), CONST64(0x0101010001000000), CONST64(0x0101014001000000), + CONST64(0x0101010000010000), CONST64(0x0101014000010000), CONST64(0x0101010001010000), CONST64(0x0101014001010000), + CONST64(0x0101010000000100), CONST64(0x0101014000000100), CONST64(0x0101010001000100), CONST64(0x0101014001000100), + CONST64(0x0101010000010100), CONST64(0x0101014000010100), CONST64(0x0101010001010100), CONST64(0x0101014001010100), + CONST64(0x0101010000000001), CONST64(0x0101014000000001), CONST64(0x0101010001000001), CONST64(0x0101014001000001), + CONST64(0x0101010000010001), CONST64(0x0101014000010001), CONST64(0x0101010001010001), CONST64(0x0101014001010001), + CONST64(0x0101010000000101), CONST64(0x0101014000000101), CONST64(0x0101010001000101), CONST64(0x0101014001000101), CONST64(0x0101010000010101), CONST64(0x0101014000010101), CONST64(0x0101010001010101), CONST64(0x0101014001010101) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000000100000000), CONST64(0x0000000004000000), CONST64(0x0000000104000000), - CONST64(0x0000000000040000), CONST64(0x0000000100040000), CONST64(0x0000000004040000), CONST64(0x0000000104040000), - CONST64(0x0000000000000400), CONST64(0x0000000100000400), CONST64(0x0000000004000400), CONST64(0x0000000104000400), - CONST64(0x0000000000040400), CONST64(0x0000000100040400), CONST64(0x0000000004040400), CONST64(0x0000000104040400), - CONST64(0x0000000000000004), CONST64(0x0000000100000004), CONST64(0x0000000004000004), CONST64(0x0000000104000004), - CONST64(0x0000000000040004), CONST64(0x0000000100040004), CONST64(0x0000000004040004), CONST64(0x0000000104040004), - CONST64(0x0000000000000404), CONST64(0x0000000100000404), CONST64(0x0000000004000404), CONST64(0x0000000104000404), - CONST64(0x0000000000040404), CONST64(0x0000000100040404), CONST64(0x0000000004040404), CONST64(0x0000000104040404), - CONST64(0x0400000000000000), CONST64(0x0400000100000000), CONST64(0x0400000004000000), CONST64(0x0400000104000000), - CONST64(0x0400000000040000), CONST64(0x0400000100040000), CONST64(0x0400000004040000), CONST64(0x0400000104040000), - CONST64(0x0400000000000400), CONST64(0x0400000100000400), CONST64(0x0400000004000400), CONST64(0x0400000104000400), - CONST64(0x0400000000040400), CONST64(0x0400000100040400), CONST64(0x0400000004040400), CONST64(0x0400000104040400), - CONST64(0x0400000000000004), CONST64(0x0400000100000004), CONST64(0x0400000004000004), CONST64(0x0400000104000004), - CONST64(0x0400000000040004), CONST64(0x0400000100040004), CONST64(0x0400000004040004), CONST64(0x0400000104040004), - CONST64(0x0400000000000404), CONST64(0x0400000100000404), CONST64(0x0400000004000404), CONST64(0x0400000104000404), - CONST64(0x0400000000040404), CONST64(0x0400000100040404), CONST64(0x0400000004040404), CONST64(0x0400000104040404), - CONST64(0x0004000000000000), CONST64(0x0004000100000000), CONST64(0x0004000004000000), CONST64(0x0004000104000000), - CONST64(0x0004000000040000), CONST64(0x0004000100040000), CONST64(0x0004000004040000), CONST64(0x0004000104040000), - CONST64(0x0004000000000400), CONST64(0x0004000100000400), CONST64(0x0004000004000400), CONST64(0x0004000104000400), - CONST64(0x0004000000040400), CONST64(0x0004000100040400), CONST64(0x0004000004040400), CONST64(0x0004000104040400), - CONST64(0x0004000000000004), CONST64(0x0004000100000004), CONST64(0x0004000004000004), CONST64(0x0004000104000004), - CONST64(0x0004000000040004), CONST64(0x0004000100040004), CONST64(0x0004000004040004), CONST64(0x0004000104040004), - CONST64(0x0004000000000404), CONST64(0x0004000100000404), CONST64(0x0004000004000404), CONST64(0x0004000104000404), - CONST64(0x0004000000040404), CONST64(0x0004000100040404), CONST64(0x0004000004040404), CONST64(0x0004000104040404), - CONST64(0x0404000000000000), CONST64(0x0404000100000000), CONST64(0x0404000004000000), CONST64(0x0404000104000000), - CONST64(0x0404000000040000), CONST64(0x0404000100040000), CONST64(0x0404000004040000), CONST64(0x0404000104040000), - CONST64(0x0404000000000400), CONST64(0x0404000100000400), CONST64(0x0404000004000400), CONST64(0x0404000104000400), - CONST64(0x0404000000040400), CONST64(0x0404000100040400), CONST64(0x0404000004040400), CONST64(0x0404000104040400), - CONST64(0x0404000000000004), CONST64(0x0404000100000004), CONST64(0x0404000004000004), CONST64(0x0404000104000004), - CONST64(0x0404000000040004), CONST64(0x0404000100040004), CONST64(0x0404000004040004), CONST64(0x0404000104040004), - CONST64(0x0404000000000404), CONST64(0x0404000100000404), CONST64(0x0404000004000404), CONST64(0x0404000104000404), - CONST64(0x0404000000040404), CONST64(0x0404000100040404), CONST64(0x0404000004040404), CONST64(0x0404000104040404), - CONST64(0x0000040000000000), CONST64(0x0000040100000000), CONST64(0x0000040004000000), CONST64(0x0000040104000000), - CONST64(0x0000040000040000), CONST64(0x0000040100040000), CONST64(0x0000040004040000), CONST64(0x0000040104040000), - CONST64(0x0000040000000400), CONST64(0x0000040100000400), CONST64(0x0000040004000400), CONST64(0x0000040104000400), - CONST64(0x0000040000040400), CONST64(0x0000040100040400), CONST64(0x0000040004040400), CONST64(0x0000040104040400), - CONST64(0x0000040000000004), CONST64(0x0000040100000004), CONST64(0x0000040004000004), CONST64(0x0000040104000004), - CONST64(0x0000040000040004), CONST64(0x0000040100040004), CONST64(0x0000040004040004), CONST64(0x0000040104040004), - CONST64(0x0000040000000404), CONST64(0x0000040100000404), CONST64(0x0000040004000404), CONST64(0x0000040104000404), - CONST64(0x0000040000040404), CONST64(0x0000040100040404), CONST64(0x0000040004040404), CONST64(0x0000040104040404), - CONST64(0x0400040000000000), CONST64(0x0400040100000000), CONST64(0x0400040004000000), CONST64(0x0400040104000000), - CONST64(0x0400040000040000), CONST64(0x0400040100040000), CONST64(0x0400040004040000), CONST64(0x0400040104040000), - CONST64(0x0400040000000400), CONST64(0x0400040100000400), CONST64(0x0400040004000400), CONST64(0x0400040104000400), - CONST64(0x0400040000040400), CONST64(0x0400040100040400), CONST64(0x0400040004040400), CONST64(0x0400040104040400), - CONST64(0x0400040000000004), CONST64(0x0400040100000004), CONST64(0x0400040004000004), CONST64(0x0400040104000004), - CONST64(0x0400040000040004), CONST64(0x0400040100040004), CONST64(0x0400040004040004), CONST64(0x0400040104040004), - CONST64(0x0400040000000404), CONST64(0x0400040100000404), CONST64(0x0400040004000404), CONST64(0x0400040104000404), - CONST64(0x0400040000040404), CONST64(0x0400040100040404), CONST64(0x0400040004040404), CONST64(0x0400040104040404), - CONST64(0x0004040000000000), CONST64(0x0004040100000000), CONST64(0x0004040004000000), CONST64(0x0004040104000000), - CONST64(0x0004040000040000), CONST64(0x0004040100040000), CONST64(0x0004040004040000), CONST64(0x0004040104040000), - CONST64(0x0004040000000400), CONST64(0x0004040100000400), CONST64(0x0004040004000400), CONST64(0x0004040104000400), - CONST64(0x0004040000040400), CONST64(0x0004040100040400), CONST64(0x0004040004040400), CONST64(0x0004040104040400), - CONST64(0x0004040000000004), CONST64(0x0004040100000004), CONST64(0x0004040004000004), CONST64(0x0004040104000004), - CONST64(0x0004040000040004), CONST64(0x0004040100040004), CONST64(0x0004040004040004), CONST64(0x0004040104040004), - CONST64(0x0004040000000404), CONST64(0x0004040100000404), CONST64(0x0004040004000404), CONST64(0x0004040104000404), - CONST64(0x0004040000040404), CONST64(0x0004040100040404), CONST64(0x0004040004040404), CONST64(0x0004040104040404), - CONST64(0x0404040000000000), CONST64(0x0404040100000000), CONST64(0x0404040004000000), CONST64(0x0404040104000000), - CONST64(0x0404040000040000), CONST64(0x0404040100040000), CONST64(0x0404040004040000), CONST64(0x0404040104040000), - CONST64(0x0404040000000400), CONST64(0x0404040100000400), CONST64(0x0404040004000400), CONST64(0x0404040104000400), - CONST64(0x0404040000040400), CONST64(0x0404040100040400), CONST64(0x0404040004040400), CONST64(0x0404040104040400), - CONST64(0x0404040000000004), CONST64(0x0404040100000004), CONST64(0x0404040004000004), CONST64(0x0404040104000004), - CONST64(0x0404040000040004), CONST64(0x0404040100040004), CONST64(0x0404040004040004), CONST64(0x0404040104040004), - CONST64(0x0404040000000404), CONST64(0x0404040100000404), CONST64(0x0404040004000404), CONST64(0x0404040104000404), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000000100000000), CONST64(0x0000000004000000), CONST64(0x0000000104000000), + CONST64(0x0000000000040000), CONST64(0x0000000100040000), CONST64(0x0000000004040000), CONST64(0x0000000104040000), + CONST64(0x0000000000000400), CONST64(0x0000000100000400), CONST64(0x0000000004000400), CONST64(0x0000000104000400), + CONST64(0x0000000000040400), CONST64(0x0000000100040400), CONST64(0x0000000004040400), CONST64(0x0000000104040400), + CONST64(0x0000000000000004), CONST64(0x0000000100000004), CONST64(0x0000000004000004), CONST64(0x0000000104000004), + CONST64(0x0000000000040004), CONST64(0x0000000100040004), CONST64(0x0000000004040004), CONST64(0x0000000104040004), + CONST64(0x0000000000000404), CONST64(0x0000000100000404), CONST64(0x0000000004000404), CONST64(0x0000000104000404), + CONST64(0x0000000000040404), CONST64(0x0000000100040404), CONST64(0x0000000004040404), CONST64(0x0000000104040404), + CONST64(0x0400000000000000), CONST64(0x0400000100000000), CONST64(0x0400000004000000), CONST64(0x0400000104000000), + CONST64(0x0400000000040000), CONST64(0x0400000100040000), CONST64(0x0400000004040000), CONST64(0x0400000104040000), + CONST64(0x0400000000000400), CONST64(0x0400000100000400), CONST64(0x0400000004000400), CONST64(0x0400000104000400), + CONST64(0x0400000000040400), CONST64(0x0400000100040400), CONST64(0x0400000004040400), CONST64(0x0400000104040400), + CONST64(0x0400000000000004), CONST64(0x0400000100000004), CONST64(0x0400000004000004), CONST64(0x0400000104000004), + CONST64(0x0400000000040004), CONST64(0x0400000100040004), CONST64(0x0400000004040004), CONST64(0x0400000104040004), + CONST64(0x0400000000000404), CONST64(0x0400000100000404), CONST64(0x0400000004000404), CONST64(0x0400000104000404), + CONST64(0x0400000000040404), CONST64(0x0400000100040404), CONST64(0x0400000004040404), CONST64(0x0400000104040404), + CONST64(0x0004000000000000), CONST64(0x0004000100000000), CONST64(0x0004000004000000), CONST64(0x0004000104000000), + CONST64(0x0004000000040000), CONST64(0x0004000100040000), CONST64(0x0004000004040000), CONST64(0x0004000104040000), + CONST64(0x0004000000000400), CONST64(0x0004000100000400), CONST64(0x0004000004000400), CONST64(0x0004000104000400), + CONST64(0x0004000000040400), CONST64(0x0004000100040400), CONST64(0x0004000004040400), CONST64(0x0004000104040400), + CONST64(0x0004000000000004), CONST64(0x0004000100000004), CONST64(0x0004000004000004), CONST64(0x0004000104000004), + CONST64(0x0004000000040004), CONST64(0x0004000100040004), CONST64(0x0004000004040004), CONST64(0x0004000104040004), + CONST64(0x0004000000000404), CONST64(0x0004000100000404), CONST64(0x0004000004000404), CONST64(0x0004000104000404), + CONST64(0x0004000000040404), CONST64(0x0004000100040404), CONST64(0x0004000004040404), CONST64(0x0004000104040404), + CONST64(0x0404000000000000), CONST64(0x0404000100000000), CONST64(0x0404000004000000), CONST64(0x0404000104000000), + CONST64(0x0404000000040000), CONST64(0x0404000100040000), CONST64(0x0404000004040000), CONST64(0x0404000104040000), + CONST64(0x0404000000000400), CONST64(0x0404000100000400), CONST64(0x0404000004000400), CONST64(0x0404000104000400), + CONST64(0x0404000000040400), CONST64(0x0404000100040400), CONST64(0x0404000004040400), CONST64(0x0404000104040400), + CONST64(0x0404000000000004), CONST64(0x0404000100000004), CONST64(0x0404000004000004), CONST64(0x0404000104000004), + CONST64(0x0404000000040004), CONST64(0x0404000100040004), CONST64(0x0404000004040004), CONST64(0x0404000104040004), + CONST64(0x0404000000000404), CONST64(0x0404000100000404), CONST64(0x0404000004000404), CONST64(0x0404000104000404), + CONST64(0x0404000000040404), CONST64(0x0404000100040404), CONST64(0x0404000004040404), CONST64(0x0404000104040404), + CONST64(0x0000040000000000), CONST64(0x0000040100000000), CONST64(0x0000040004000000), CONST64(0x0000040104000000), + CONST64(0x0000040000040000), CONST64(0x0000040100040000), CONST64(0x0000040004040000), CONST64(0x0000040104040000), + CONST64(0x0000040000000400), CONST64(0x0000040100000400), CONST64(0x0000040004000400), CONST64(0x0000040104000400), + CONST64(0x0000040000040400), CONST64(0x0000040100040400), CONST64(0x0000040004040400), CONST64(0x0000040104040400), + CONST64(0x0000040000000004), CONST64(0x0000040100000004), CONST64(0x0000040004000004), CONST64(0x0000040104000004), + CONST64(0x0000040000040004), CONST64(0x0000040100040004), CONST64(0x0000040004040004), CONST64(0x0000040104040004), + CONST64(0x0000040000000404), CONST64(0x0000040100000404), CONST64(0x0000040004000404), CONST64(0x0000040104000404), + CONST64(0x0000040000040404), CONST64(0x0000040100040404), CONST64(0x0000040004040404), CONST64(0x0000040104040404), + CONST64(0x0400040000000000), CONST64(0x0400040100000000), CONST64(0x0400040004000000), CONST64(0x0400040104000000), + CONST64(0x0400040000040000), CONST64(0x0400040100040000), CONST64(0x0400040004040000), CONST64(0x0400040104040000), + CONST64(0x0400040000000400), CONST64(0x0400040100000400), CONST64(0x0400040004000400), CONST64(0x0400040104000400), + CONST64(0x0400040000040400), CONST64(0x0400040100040400), CONST64(0x0400040004040400), CONST64(0x0400040104040400), + CONST64(0x0400040000000004), CONST64(0x0400040100000004), CONST64(0x0400040004000004), CONST64(0x0400040104000004), + CONST64(0x0400040000040004), CONST64(0x0400040100040004), CONST64(0x0400040004040004), CONST64(0x0400040104040004), + CONST64(0x0400040000000404), CONST64(0x0400040100000404), CONST64(0x0400040004000404), CONST64(0x0400040104000404), + CONST64(0x0400040000040404), CONST64(0x0400040100040404), CONST64(0x0400040004040404), CONST64(0x0400040104040404), + CONST64(0x0004040000000000), CONST64(0x0004040100000000), CONST64(0x0004040004000000), CONST64(0x0004040104000000), + CONST64(0x0004040000040000), CONST64(0x0004040100040000), CONST64(0x0004040004040000), CONST64(0x0004040104040000), + CONST64(0x0004040000000400), CONST64(0x0004040100000400), CONST64(0x0004040004000400), CONST64(0x0004040104000400), + CONST64(0x0004040000040400), CONST64(0x0004040100040400), CONST64(0x0004040004040400), CONST64(0x0004040104040400), + CONST64(0x0004040000000004), CONST64(0x0004040100000004), CONST64(0x0004040004000004), CONST64(0x0004040104000004), + CONST64(0x0004040000040004), CONST64(0x0004040100040004), CONST64(0x0004040004040004), CONST64(0x0004040104040004), + CONST64(0x0004040000000404), CONST64(0x0004040100000404), CONST64(0x0004040004000404), CONST64(0x0004040104000404), + CONST64(0x0004040000040404), CONST64(0x0004040100040404), CONST64(0x0004040004040404), CONST64(0x0004040104040404), + CONST64(0x0404040000000000), CONST64(0x0404040100000000), CONST64(0x0404040004000000), CONST64(0x0404040104000000), + CONST64(0x0404040000040000), CONST64(0x0404040100040000), CONST64(0x0404040004040000), CONST64(0x0404040104040000), + CONST64(0x0404040000000400), CONST64(0x0404040100000400), CONST64(0x0404040004000400), CONST64(0x0404040104000400), + CONST64(0x0404040000040400), CONST64(0x0404040100040400), CONST64(0x0404040004040400), CONST64(0x0404040104040400), + CONST64(0x0404040000000004), CONST64(0x0404040100000004), CONST64(0x0404040004000004), CONST64(0x0404040104000004), + CONST64(0x0404040000040004), CONST64(0x0404040100040004), CONST64(0x0404040004040004), CONST64(0x0404040104040004), + CONST64(0x0404040000000404), CONST64(0x0404040100000404), CONST64(0x0404040004000404), CONST64(0x0404040104000404), CONST64(0x0404040000040404), CONST64(0x0404040100040404), CONST64(0x0404040004040404), CONST64(0x0404040104040404) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000000400000000), CONST64(0x0000000010000000), CONST64(0x0000000410000000), - CONST64(0x0000000000100000), CONST64(0x0000000400100000), CONST64(0x0000000010100000), CONST64(0x0000000410100000), - CONST64(0x0000000000001000), CONST64(0x0000000400001000), CONST64(0x0000000010001000), CONST64(0x0000000410001000), - CONST64(0x0000000000101000), CONST64(0x0000000400101000), CONST64(0x0000000010101000), CONST64(0x0000000410101000), - CONST64(0x0000000000000010), CONST64(0x0000000400000010), CONST64(0x0000000010000010), CONST64(0x0000000410000010), - CONST64(0x0000000000100010), CONST64(0x0000000400100010), CONST64(0x0000000010100010), CONST64(0x0000000410100010), - CONST64(0x0000000000001010), CONST64(0x0000000400001010), CONST64(0x0000000010001010), CONST64(0x0000000410001010), - CONST64(0x0000000000101010), CONST64(0x0000000400101010), CONST64(0x0000000010101010), CONST64(0x0000000410101010), - CONST64(0x1000000000000000), CONST64(0x1000000400000000), CONST64(0x1000000010000000), CONST64(0x1000000410000000), - CONST64(0x1000000000100000), CONST64(0x1000000400100000), CONST64(0x1000000010100000), CONST64(0x1000000410100000), - CONST64(0x1000000000001000), CONST64(0x1000000400001000), CONST64(0x1000000010001000), CONST64(0x1000000410001000), - CONST64(0x1000000000101000), CONST64(0x1000000400101000), CONST64(0x1000000010101000), CONST64(0x1000000410101000), - CONST64(0x1000000000000010), CONST64(0x1000000400000010), CONST64(0x1000000010000010), CONST64(0x1000000410000010), - CONST64(0x1000000000100010), CONST64(0x1000000400100010), CONST64(0x1000000010100010), CONST64(0x1000000410100010), - CONST64(0x1000000000001010), CONST64(0x1000000400001010), CONST64(0x1000000010001010), CONST64(0x1000000410001010), - CONST64(0x1000000000101010), CONST64(0x1000000400101010), CONST64(0x1000000010101010), CONST64(0x1000000410101010), - CONST64(0x0010000000000000), CONST64(0x0010000400000000), CONST64(0x0010000010000000), CONST64(0x0010000410000000), - CONST64(0x0010000000100000), CONST64(0x0010000400100000), CONST64(0x0010000010100000), CONST64(0x0010000410100000), - CONST64(0x0010000000001000), CONST64(0x0010000400001000), CONST64(0x0010000010001000), CONST64(0x0010000410001000), - CONST64(0x0010000000101000), CONST64(0x0010000400101000), CONST64(0x0010000010101000), CONST64(0x0010000410101000), - CONST64(0x0010000000000010), CONST64(0x0010000400000010), CONST64(0x0010000010000010), CONST64(0x0010000410000010), - CONST64(0x0010000000100010), CONST64(0x0010000400100010), CONST64(0x0010000010100010), CONST64(0x0010000410100010), - CONST64(0x0010000000001010), CONST64(0x0010000400001010), CONST64(0x0010000010001010), CONST64(0x0010000410001010), - CONST64(0x0010000000101010), CONST64(0x0010000400101010), CONST64(0x0010000010101010), CONST64(0x0010000410101010), - CONST64(0x1010000000000000), CONST64(0x1010000400000000), CONST64(0x1010000010000000), CONST64(0x1010000410000000), - CONST64(0x1010000000100000), CONST64(0x1010000400100000), CONST64(0x1010000010100000), CONST64(0x1010000410100000), - CONST64(0x1010000000001000), CONST64(0x1010000400001000), CONST64(0x1010000010001000), CONST64(0x1010000410001000), - CONST64(0x1010000000101000), CONST64(0x1010000400101000), CONST64(0x1010000010101000), CONST64(0x1010000410101000), - CONST64(0x1010000000000010), CONST64(0x1010000400000010), CONST64(0x1010000010000010), CONST64(0x1010000410000010), - CONST64(0x1010000000100010), CONST64(0x1010000400100010), CONST64(0x1010000010100010), CONST64(0x1010000410100010), - CONST64(0x1010000000001010), CONST64(0x1010000400001010), CONST64(0x1010000010001010), CONST64(0x1010000410001010), - CONST64(0x1010000000101010), CONST64(0x1010000400101010), CONST64(0x1010000010101010), CONST64(0x1010000410101010), - CONST64(0x0000100000000000), CONST64(0x0000100400000000), CONST64(0x0000100010000000), CONST64(0x0000100410000000), - CONST64(0x0000100000100000), CONST64(0x0000100400100000), CONST64(0x0000100010100000), CONST64(0x0000100410100000), - CONST64(0x0000100000001000), CONST64(0x0000100400001000), CONST64(0x0000100010001000), CONST64(0x0000100410001000), - CONST64(0x0000100000101000), CONST64(0x0000100400101000), CONST64(0x0000100010101000), CONST64(0x0000100410101000), - CONST64(0x0000100000000010), CONST64(0x0000100400000010), CONST64(0x0000100010000010), CONST64(0x0000100410000010), - CONST64(0x0000100000100010), CONST64(0x0000100400100010), CONST64(0x0000100010100010), CONST64(0x0000100410100010), - CONST64(0x0000100000001010), CONST64(0x0000100400001010), CONST64(0x0000100010001010), CONST64(0x0000100410001010), - CONST64(0x0000100000101010), CONST64(0x0000100400101010), CONST64(0x0000100010101010), CONST64(0x0000100410101010), - CONST64(0x1000100000000000), CONST64(0x1000100400000000), CONST64(0x1000100010000000), CONST64(0x1000100410000000), - CONST64(0x1000100000100000), CONST64(0x1000100400100000), CONST64(0x1000100010100000), CONST64(0x1000100410100000), - CONST64(0x1000100000001000), CONST64(0x1000100400001000), CONST64(0x1000100010001000), CONST64(0x1000100410001000), - CONST64(0x1000100000101000), CONST64(0x1000100400101000), CONST64(0x1000100010101000), CONST64(0x1000100410101000), - CONST64(0x1000100000000010), CONST64(0x1000100400000010), CONST64(0x1000100010000010), CONST64(0x1000100410000010), - CONST64(0x1000100000100010), CONST64(0x1000100400100010), CONST64(0x1000100010100010), CONST64(0x1000100410100010), - CONST64(0x1000100000001010), CONST64(0x1000100400001010), CONST64(0x1000100010001010), CONST64(0x1000100410001010), - CONST64(0x1000100000101010), CONST64(0x1000100400101010), CONST64(0x1000100010101010), CONST64(0x1000100410101010), - CONST64(0x0010100000000000), CONST64(0x0010100400000000), CONST64(0x0010100010000000), CONST64(0x0010100410000000), - CONST64(0x0010100000100000), CONST64(0x0010100400100000), CONST64(0x0010100010100000), CONST64(0x0010100410100000), - CONST64(0x0010100000001000), CONST64(0x0010100400001000), CONST64(0x0010100010001000), CONST64(0x0010100410001000), - CONST64(0x0010100000101000), CONST64(0x0010100400101000), CONST64(0x0010100010101000), CONST64(0x0010100410101000), - CONST64(0x0010100000000010), CONST64(0x0010100400000010), CONST64(0x0010100010000010), CONST64(0x0010100410000010), - CONST64(0x0010100000100010), CONST64(0x0010100400100010), CONST64(0x0010100010100010), CONST64(0x0010100410100010), - CONST64(0x0010100000001010), CONST64(0x0010100400001010), CONST64(0x0010100010001010), CONST64(0x0010100410001010), - CONST64(0x0010100000101010), CONST64(0x0010100400101010), CONST64(0x0010100010101010), CONST64(0x0010100410101010), - CONST64(0x1010100000000000), CONST64(0x1010100400000000), CONST64(0x1010100010000000), CONST64(0x1010100410000000), - CONST64(0x1010100000100000), CONST64(0x1010100400100000), CONST64(0x1010100010100000), CONST64(0x1010100410100000), - CONST64(0x1010100000001000), CONST64(0x1010100400001000), CONST64(0x1010100010001000), CONST64(0x1010100410001000), - CONST64(0x1010100000101000), CONST64(0x1010100400101000), CONST64(0x1010100010101000), CONST64(0x1010100410101000), - CONST64(0x1010100000000010), CONST64(0x1010100400000010), CONST64(0x1010100010000010), CONST64(0x1010100410000010), - CONST64(0x1010100000100010), CONST64(0x1010100400100010), CONST64(0x1010100010100010), CONST64(0x1010100410100010), - CONST64(0x1010100000001010), CONST64(0x1010100400001010), CONST64(0x1010100010001010), CONST64(0x1010100410001010), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000000400000000), CONST64(0x0000000010000000), CONST64(0x0000000410000000), + CONST64(0x0000000000100000), CONST64(0x0000000400100000), CONST64(0x0000000010100000), CONST64(0x0000000410100000), + CONST64(0x0000000000001000), CONST64(0x0000000400001000), CONST64(0x0000000010001000), CONST64(0x0000000410001000), + CONST64(0x0000000000101000), CONST64(0x0000000400101000), CONST64(0x0000000010101000), CONST64(0x0000000410101000), + CONST64(0x0000000000000010), CONST64(0x0000000400000010), CONST64(0x0000000010000010), CONST64(0x0000000410000010), + CONST64(0x0000000000100010), CONST64(0x0000000400100010), CONST64(0x0000000010100010), CONST64(0x0000000410100010), + CONST64(0x0000000000001010), CONST64(0x0000000400001010), CONST64(0x0000000010001010), CONST64(0x0000000410001010), + CONST64(0x0000000000101010), CONST64(0x0000000400101010), CONST64(0x0000000010101010), CONST64(0x0000000410101010), + CONST64(0x1000000000000000), CONST64(0x1000000400000000), CONST64(0x1000000010000000), CONST64(0x1000000410000000), + CONST64(0x1000000000100000), CONST64(0x1000000400100000), CONST64(0x1000000010100000), CONST64(0x1000000410100000), + CONST64(0x1000000000001000), CONST64(0x1000000400001000), CONST64(0x1000000010001000), CONST64(0x1000000410001000), + CONST64(0x1000000000101000), CONST64(0x1000000400101000), CONST64(0x1000000010101000), CONST64(0x1000000410101000), + CONST64(0x1000000000000010), CONST64(0x1000000400000010), CONST64(0x1000000010000010), CONST64(0x1000000410000010), + CONST64(0x1000000000100010), CONST64(0x1000000400100010), CONST64(0x1000000010100010), CONST64(0x1000000410100010), + CONST64(0x1000000000001010), CONST64(0x1000000400001010), CONST64(0x1000000010001010), CONST64(0x1000000410001010), + CONST64(0x1000000000101010), CONST64(0x1000000400101010), CONST64(0x1000000010101010), CONST64(0x1000000410101010), + CONST64(0x0010000000000000), CONST64(0x0010000400000000), CONST64(0x0010000010000000), CONST64(0x0010000410000000), + CONST64(0x0010000000100000), CONST64(0x0010000400100000), CONST64(0x0010000010100000), CONST64(0x0010000410100000), + CONST64(0x0010000000001000), CONST64(0x0010000400001000), CONST64(0x0010000010001000), CONST64(0x0010000410001000), + CONST64(0x0010000000101000), CONST64(0x0010000400101000), CONST64(0x0010000010101000), CONST64(0x0010000410101000), + CONST64(0x0010000000000010), CONST64(0x0010000400000010), CONST64(0x0010000010000010), CONST64(0x0010000410000010), + CONST64(0x0010000000100010), CONST64(0x0010000400100010), CONST64(0x0010000010100010), CONST64(0x0010000410100010), + CONST64(0x0010000000001010), CONST64(0x0010000400001010), CONST64(0x0010000010001010), CONST64(0x0010000410001010), + CONST64(0x0010000000101010), CONST64(0x0010000400101010), CONST64(0x0010000010101010), CONST64(0x0010000410101010), + CONST64(0x1010000000000000), CONST64(0x1010000400000000), CONST64(0x1010000010000000), CONST64(0x1010000410000000), + CONST64(0x1010000000100000), CONST64(0x1010000400100000), CONST64(0x1010000010100000), CONST64(0x1010000410100000), + CONST64(0x1010000000001000), CONST64(0x1010000400001000), CONST64(0x1010000010001000), CONST64(0x1010000410001000), + CONST64(0x1010000000101000), CONST64(0x1010000400101000), CONST64(0x1010000010101000), CONST64(0x1010000410101000), + CONST64(0x1010000000000010), CONST64(0x1010000400000010), CONST64(0x1010000010000010), CONST64(0x1010000410000010), + CONST64(0x1010000000100010), CONST64(0x1010000400100010), CONST64(0x1010000010100010), CONST64(0x1010000410100010), + CONST64(0x1010000000001010), CONST64(0x1010000400001010), CONST64(0x1010000010001010), CONST64(0x1010000410001010), + CONST64(0x1010000000101010), CONST64(0x1010000400101010), CONST64(0x1010000010101010), CONST64(0x1010000410101010), + CONST64(0x0000100000000000), CONST64(0x0000100400000000), CONST64(0x0000100010000000), CONST64(0x0000100410000000), + CONST64(0x0000100000100000), CONST64(0x0000100400100000), CONST64(0x0000100010100000), CONST64(0x0000100410100000), + CONST64(0x0000100000001000), CONST64(0x0000100400001000), CONST64(0x0000100010001000), CONST64(0x0000100410001000), + CONST64(0x0000100000101000), CONST64(0x0000100400101000), CONST64(0x0000100010101000), CONST64(0x0000100410101000), + CONST64(0x0000100000000010), CONST64(0x0000100400000010), CONST64(0x0000100010000010), CONST64(0x0000100410000010), + CONST64(0x0000100000100010), CONST64(0x0000100400100010), CONST64(0x0000100010100010), CONST64(0x0000100410100010), + CONST64(0x0000100000001010), CONST64(0x0000100400001010), CONST64(0x0000100010001010), CONST64(0x0000100410001010), + CONST64(0x0000100000101010), CONST64(0x0000100400101010), CONST64(0x0000100010101010), CONST64(0x0000100410101010), + CONST64(0x1000100000000000), CONST64(0x1000100400000000), CONST64(0x1000100010000000), CONST64(0x1000100410000000), + CONST64(0x1000100000100000), CONST64(0x1000100400100000), CONST64(0x1000100010100000), CONST64(0x1000100410100000), + CONST64(0x1000100000001000), CONST64(0x1000100400001000), CONST64(0x1000100010001000), CONST64(0x1000100410001000), + CONST64(0x1000100000101000), CONST64(0x1000100400101000), CONST64(0x1000100010101000), CONST64(0x1000100410101000), + CONST64(0x1000100000000010), CONST64(0x1000100400000010), CONST64(0x1000100010000010), CONST64(0x1000100410000010), + CONST64(0x1000100000100010), CONST64(0x1000100400100010), CONST64(0x1000100010100010), CONST64(0x1000100410100010), + CONST64(0x1000100000001010), CONST64(0x1000100400001010), CONST64(0x1000100010001010), CONST64(0x1000100410001010), + CONST64(0x1000100000101010), CONST64(0x1000100400101010), CONST64(0x1000100010101010), CONST64(0x1000100410101010), + CONST64(0x0010100000000000), CONST64(0x0010100400000000), CONST64(0x0010100010000000), CONST64(0x0010100410000000), + CONST64(0x0010100000100000), CONST64(0x0010100400100000), CONST64(0x0010100010100000), CONST64(0x0010100410100000), + CONST64(0x0010100000001000), CONST64(0x0010100400001000), CONST64(0x0010100010001000), CONST64(0x0010100410001000), + CONST64(0x0010100000101000), CONST64(0x0010100400101000), CONST64(0x0010100010101000), CONST64(0x0010100410101000), + CONST64(0x0010100000000010), CONST64(0x0010100400000010), CONST64(0x0010100010000010), CONST64(0x0010100410000010), + CONST64(0x0010100000100010), CONST64(0x0010100400100010), CONST64(0x0010100010100010), CONST64(0x0010100410100010), + CONST64(0x0010100000001010), CONST64(0x0010100400001010), CONST64(0x0010100010001010), CONST64(0x0010100410001010), + CONST64(0x0010100000101010), CONST64(0x0010100400101010), CONST64(0x0010100010101010), CONST64(0x0010100410101010), + CONST64(0x1010100000000000), CONST64(0x1010100400000000), CONST64(0x1010100010000000), CONST64(0x1010100410000000), + CONST64(0x1010100000100000), CONST64(0x1010100400100000), CONST64(0x1010100010100000), CONST64(0x1010100410100000), + CONST64(0x1010100000001000), CONST64(0x1010100400001000), CONST64(0x1010100010001000), CONST64(0x1010100410001000), + CONST64(0x1010100000101000), CONST64(0x1010100400101000), CONST64(0x1010100010101000), CONST64(0x1010100410101000), + CONST64(0x1010100000000010), CONST64(0x1010100400000010), CONST64(0x1010100010000010), CONST64(0x1010100410000010), + CONST64(0x1010100000100010), CONST64(0x1010100400100010), CONST64(0x1010100010100010), CONST64(0x1010100410100010), + CONST64(0x1010100000001010), CONST64(0x1010100400001010), CONST64(0x1010100010001010), CONST64(0x1010100410001010), CONST64(0x1010100000101010), CONST64(0x1010100400101010), CONST64(0x1010100010101010), CONST64(0x1010100410101010) - }, -{ CONST64(0x0000000000000000), CONST64(0x0000001000000000), CONST64(0x0000000040000000), CONST64(0x0000001040000000), - CONST64(0x0000000000400000), CONST64(0x0000001000400000), CONST64(0x0000000040400000), CONST64(0x0000001040400000), - CONST64(0x0000000000004000), CONST64(0x0000001000004000), CONST64(0x0000000040004000), CONST64(0x0000001040004000), - CONST64(0x0000000000404000), CONST64(0x0000001000404000), CONST64(0x0000000040404000), CONST64(0x0000001040404000), - CONST64(0x0000000000000040), CONST64(0x0000001000000040), CONST64(0x0000000040000040), CONST64(0x0000001040000040), - CONST64(0x0000000000400040), CONST64(0x0000001000400040), CONST64(0x0000000040400040), CONST64(0x0000001040400040), - CONST64(0x0000000000004040), CONST64(0x0000001000004040), CONST64(0x0000000040004040), CONST64(0x0000001040004040), - CONST64(0x0000000000404040), CONST64(0x0000001000404040), CONST64(0x0000000040404040), CONST64(0x0000001040404040), - CONST64(0x4000000000000000), CONST64(0x4000001000000000), CONST64(0x4000000040000000), CONST64(0x4000001040000000), - CONST64(0x4000000000400000), CONST64(0x4000001000400000), CONST64(0x4000000040400000), CONST64(0x4000001040400000), - CONST64(0x4000000000004000), CONST64(0x4000001000004000), CONST64(0x4000000040004000), CONST64(0x4000001040004000), - CONST64(0x4000000000404000), CONST64(0x4000001000404000), CONST64(0x4000000040404000), CONST64(0x4000001040404000), - CONST64(0x4000000000000040), CONST64(0x4000001000000040), CONST64(0x4000000040000040), CONST64(0x4000001040000040), - CONST64(0x4000000000400040), CONST64(0x4000001000400040), CONST64(0x4000000040400040), CONST64(0x4000001040400040), - CONST64(0x4000000000004040), CONST64(0x4000001000004040), CONST64(0x4000000040004040), CONST64(0x4000001040004040), - CONST64(0x4000000000404040), CONST64(0x4000001000404040), CONST64(0x4000000040404040), CONST64(0x4000001040404040), - CONST64(0x0040000000000000), CONST64(0x0040001000000000), CONST64(0x0040000040000000), CONST64(0x0040001040000000), - CONST64(0x0040000000400000), CONST64(0x0040001000400000), CONST64(0x0040000040400000), CONST64(0x0040001040400000), - CONST64(0x0040000000004000), CONST64(0x0040001000004000), CONST64(0x0040000040004000), CONST64(0x0040001040004000), - CONST64(0x0040000000404000), CONST64(0x0040001000404000), CONST64(0x0040000040404000), CONST64(0x0040001040404000), - CONST64(0x0040000000000040), CONST64(0x0040001000000040), CONST64(0x0040000040000040), CONST64(0x0040001040000040), - CONST64(0x0040000000400040), CONST64(0x0040001000400040), CONST64(0x0040000040400040), CONST64(0x0040001040400040), - CONST64(0x0040000000004040), CONST64(0x0040001000004040), CONST64(0x0040000040004040), CONST64(0x0040001040004040), - CONST64(0x0040000000404040), CONST64(0x0040001000404040), CONST64(0x0040000040404040), CONST64(0x0040001040404040), - CONST64(0x4040000000000000), CONST64(0x4040001000000000), CONST64(0x4040000040000000), CONST64(0x4040001040000000), - CONST64(0x4040000000400000), CONST64(0x4040001000400000), CONST64(0x4040000040400000), CONST64(0x4040001040400000), - CONST64(0x4040000000004000), CONST64(0x4040001000004000), CONST64(0x4040000040004000), CONST64(0x4040001040004000), - CONST64(0x4040000000404000), CONST64(0x4040001000404000), CONST64(0x4040000040404000), CONST64(0x4040001040404000), - CONST64(0x4040000000000040), CONST64(0x4040001000000040), CONST64(0x4040000040000040), CONST64(0x4040001040000040), - CONST64(0x4040000000400040), CONST64(0x4040001000400040), CONST64(0x4040000040400040), CONST64(0x4040001040400040), - CONST64(0x4040000000004040), CONST64(0x4040001000004040), CONST64(0x4040000040004040), CONST64(0x4040001040004040), - CONST64(0x4040000000404040), CONST64(0x4040001000404040), CONST64(0x4040000040404040), CONST64(0x4040001040404040), - CONST64(0x0000400000000000), CONST64(0x0000401000000000), CONST64(0x0000400040000000), CONST64(0x0000401040000000), - CONST64(0x0000400000400000), CONST64(0x0000401000400000), CONST64(0x0000400040400000), CONST64(0x0000401040400000), - CONST64(0x0000400000004000), CONST64(0x0000401000004000), CONST64(0x0000400040004000), CONST64(0x0000401040004000), - CONST64(0x0000400000404000), CONST64(0x0000401000404000), CONST64(0x0000400040404000), CONST64(0x0000401040404000), - CONST64(0x0000400000000040), CONST64(0x0000401000000040), CONST64(0x0000400040000040), CONST64(0x0000401040000040), - CONST64(0x0000400000400040), CONST64(0x0000401000400040), CONST64(0x0000400040400040), CONST64(0x0000401040400040), - CONST64(0x0000400000004040), CONST64(0x0000401000004040), CONST64(0x0000400040004040), CONST64(0x0000401040004040), - CONST64(0x0000400000404040), CONST64(0x0000401000404040), CONST64(0x0000400040404040), CONST64(0x0000401040404040), - CONST64(0x4000400000000000), CONST64(0x4000401000000000), CONST64(0x4000400040000000), CONST64(0x4000401040000000), - CONST64(0x4000400000400000), CONST64(0x4000401000400000), CONST64(0x4000400040400000), CONST64(0x4000401040400000), - CONST64(0x4000400000004000), CONST64(0x4000401000004000), CONST64(0x4000400040004000), CONST64(0x4000401040004000), - CONST64(0x4000400000404000), CONST64(0x4000401000404000), CONST64(0x4000400040404000), CONST64(0x4000401040404000), - CONST64(0x4000400000000040), CONST64(0x4000401000000040), CONST64(0x4000400040000040), CONST64(0x4000401040000040), - CONST64(0x4000400000400040), CONST64(0x4000401000400040), CONST64(0x4000400040400040), CONST64(0x4000401040400040), - CONST64(0x4000400000004040), CONST64(0x4000401000004040), CONST64(0x4000400040004040), CONST64(0x4000401040004040), - CONST64(0x4000400000404040), CONST64(0x4000401000404040), CONST64(0x4000400040404040), CONST64(0x4000401040404040), - CONST64(0x0040400000000000), CONST64(0x0040401000000000), CONST64(0x0040400040000000), CONST64(0x0040401040000000), - CONST64(0x0040400000400000), CONST64(0x0040401000400000), CONST64(0x0040400040400000), CONST64(0x0040401040400000), - CONST64(0x0040400000004000), CONST64(0x0040401000004000), CONST64(0x0040400040004000), CONST64(0x0040401040004000), - CONST64(0x0040400000404000), CONST64(0x0040401000404000), CONST64(0x0040400040404000), CONST64(0x0040401040404000), - CONST64(0x0040400000000040), CONST64(0x0040401000000040), CONST64(0x0040400040000040), CONST64(0x0040401040000040), - CONST64(0x0040400000400040), CONST64(0x0040401000400040), CONST64(0x0040400040400040), CONST64(0x0040401040400040), - CONST64(0x0040400000004040), CONST64(0x0040401000004040), CONST64(0x0040400040004040), CONST64(0x0040401040004040), - CONST64(0x0040400000404040), CONST64(0x0040401000404040), CONST64(0x0040400040404040), CONST64(0x0040401040404040), - CONST64(0x4040400000000000), CONST64(0x4040401000000000), CONST64(0x4040400040000000), CONST64(0x4040401040000000), - CONST64(0x4040400000400000), CONST64(0x4040401000400000), CONST64(0x4040400040400000), CONST64(0x4040401040400000), - CONST64(0x4040400000004000), CONST64(0x4040401000004000), CONST64(0x4040400040004000), CONST64(0x4040401040004000), - CONST64(0x4040400000404000), CONST64(0x4040401000404000), CONST64(0x4040400040404000), CONST64(0x4040401040404000), - CONST64(0x4040400000000040), CONST64(0x4040401000000040), CONST64(0x4040400040000040), CONST64(0x4040401040000040), - CONST64(0x4040400000400040), CONST64(0x4040401000400040), CONST64(0x4040400040400040), CONST64(0x4040401040400040), - CONST64(0x4040400000004040), CONST64(0x4040401000004040), CONST64(0x4040400040004040), CONST64(0x4040401040004040), + }, +{ CONST64(0x0000000000000000), CONST64(0x0000001000000000), CONST64(0x0000000040000000), CONST64(0x0000001040000000), + CONST64(0x0000000000400000), CONST64(0x0000001000400000), CONST64(0x0000000040400000), CONST64(0x0000001040400000), + CONST64(0x0000000000004000), CONST64(0x0000001000004000), CONST64(0x0000000040004000), CONST64(0x0000001040004000), + CONST64(0x0000000000404000), CONST64(0x0000001000404000), CONST64(0x0000000040404000), CONST64(0x0000001040404000), + CONST64(0x0000000000000040), CONST64(0x0000001000000040), CONST64(0x0000000040000040), CONST64(0x0000001040000040), + CONST64(0x0000000000400040), CONST64(0x0000001000400040), CONST64(0x0000000040400040), CONST64(0x0000001040400040), + CONST64(0x0000000000004040), CONST64(0x0000001000004040), CONST64(0x0000000040004040), CONST64(0x0000001040004040), + CONST64(0x0000000000404040), CONST64(0x0000001000404040), CONST64(0x0000000040404040), CONST64(0x0000001040404040), + CONST64(0x4000000000000000), CONST64(0x4000001000000000), CONST64(0x4000000040000000), CONST64(0x4000001040000000), + CONST64(0x4000000000400000), CONST64(0x4000001000400000), CONST64(0x4000000040400000), CONST64(0x4000001040400000), + CONST64(0x4000000000004000), CONST64(0x4000001000004000), CONST64(0x4000000040004000), CONST64(0x4000001040004000), + CONST64(0x4000000000404000), CONST64(0x4000001000404000), CONST64(0x4000000040404000), CONST64(0x4000001040404000), + CONST64(0x4000000000000040), CONST64(0x4000001000000040), CONST64(0x4000000040000040), CONST64(0x4000001040000040), + CONST64(0x4000000000400040), CONST64(0x4000001000400040), CONST64(0x4000000040400040), CONST64(0x4000001040400040), + CONST64(0x4000000000004040), CONST64(0x4000001000004040), CONST64(0x4000000040004040), CONST64(0x4000001040004040), + CONST64(0x4000000000404040), CONST64(0x4000001000404040), CONST64(0x4000000040404040), CONST64(0x4000001040404040), + CONST64(0x0040000000000000), CONST64(0x0040001000000000), CONST64(0x0040000040000000), CONST64(0x0040001040000000), + CONST64(0x0040000000400000), CONST64(0x0040001000400000), CONST64(0x0040000040400000), CONST64(0x0040001040400000), + CONST64(0x0040000000004000), CONST64(0x0040001000004000), CONST64(0x0040000040004000), CONST64(0x0040001040004000), + CONST64(0x0040000000404000), CONST64(0x0040001000404000), CONST64(0x0040000040404000), CONST64(0x0040001040404000), + CONST64(0x0040000000000040), CONST64(0x0040001000000040), CONST64(0x0040000040000040), CONST64(0x0040001040000040), + CONST64(0x0040000000400040), CONST64(0x0040001000400040), CONST64(0x0040000040400040), CONST64(0x0040001040400040), + CONST64(0x0040000000004040), CONST64(0x0040001000004040), CONST64(0x0040000040004040), CONST64(0x0040001040004040), + CONST64(0x0040000000404040), CONST64(0x0040001000404040), CONST64(0x0040000040404040), CONST64(0x0040001040404040), + CONST64(0x4040000000000000), CONST64(0x4040001000000000), CONST64(0x4040000040000000), CONST64(0x4040001040000000), + CONST64(0x4040000000400000), CONST64(0x4040001000400000), CONST64(0x4040000040400000), CONST64(0x4040001040400000), + CONST64(0x4040000000004000), CONST64(0x4040001000004000), CONST64(0x4040000040004000), CONST64(0x4040001040004000), + CONST64(0x4040000000404000), CONST64(0x4040001000404000), CONST64(0x4040000040404000), CONST64(0x4040001040404000), + CONST64(0x4040000000000040), CONST64(0x4040001000000040), CONST64(0x4040000040000040), CONST64(0x4040001040000040), + CONST64(0x4040000000400040), CONST64(0x4040001000400040), CONST64(0x4040000040400040), CONST64(0x4040001040400040), + CONST64(0x4040000000004040), CONST64(0x4040001000004040), CONST64(0x4040000040004040), CONST64(0x4040001040004040), + CONST64(0x4040000000404040), CONST64(0x4040001000404040), CONST64(0x4040000040404040), CONST64(0x4040001040404040), + CONST64(0x0000400000000000), CONST64(0x0000401000000000), CONST64(0x0000400040000000), CONST64(0x0000401040000000), + CONST64(0x0000400000400000), CONST64(0x0000401000400000), CONST64(0x0000400040400000), CONST64(0x0000401040400000), + CONST64(0x0000400000004000), CONST64(0x0000401000004000), CONST64(0x0000400040004000), CONST64(0x0000401040004000), + CONST64(0x0000400000404000), CONST64(0x0000401000404000), CONST64(0x0000400040404000), CONST64(0x0000401040404000), + CONST64(0x0000400000000040), CONST64(0x0000401000000040), CONST64(0x0000400040000040), CONST64(0x0000401040000040), + CONST64(0x0000400000400040), CONST64(0x0000401000400040), CONST64(0x0000400040400040), CONST64(0x0000401040400040), + CONST64(0x0000400000004040), CONST64(0x0000401000004040), CONST64(0x0000400040004040), CONST64(0x0000401040004040), + CONST64(0x0000400000404040), CONST64(0x0000401000404040), CONST64(0x0000400040404040), CONST64(0x0000401040404040), + CONST64(0x4000400000000000), CONST64(0x4000401000000000), CONST64(0x4000400040000000), CONST64(0x4000401040000000), + CONST64(0x4000400000400000), CONST64(0x4000401000400000), CONST64(0x4000400040400000), CONST64(0x4000401040400000), + CONST64(0x4000400000004000), CONST64(0x4000401000004000), CONST64(0x4000400040004000), CONST64(0x4000401040004000), + CONST64(0x4000400000404000), CONST64(0x4000401000404000), CONST64(0x4000400040404000), CONST64(0x4000401040404000), + CONST64(0x4000400000000040), CONST64(0x4000401000000040), CONST64(0x4000400040000040), CONST64(0x4000401040000040), + CONST64(0x4000400000400040), CONST64(0x4000401000400040), CONST64(0x4000400040400040), CONST64(0x4000401040400040), + CONST64(0x4000400000004040), CONST64(0x4000401000004040), CONST64(0x4000400040004040), CONST64(0x4000401040004040), + CONST64(0x4000400000404040), CONST64(0x4000401000404040), CONST64(0x4000400040404040), CONST64(0x4000401040404040), + CONST64(0x0040400000000000), CONST64(0x0040401000000000), CONST64(0x0040400040000000), CONST64(0x0040401040000000), + CONST64(0x0040400000400000), CONST64(0x0040401000400000), CONST64(0x0040400040400000), CONST64(0x0040401040400000), + CONST64(0x0040400000004000), CONST64(0x0040401000004000), CONST64(0x0040400040004000), CONST64(0x0040401040004000), + CONST64(0x0040400000404000), CONST64(0x0040401000404000), CONST64(0x0040400040404000), CONST64(0x0040401040404000), + CONST64(0x0040400000000040), CONST64(0x0040401000000040), CONST64(0x0040400040000040), CONST64(0x0040401040000040), + CONST64(0x0040400000400040), CONST64(0x0040401000400040), CONST64(0x0040400040400040), CONST64(0x0040401040400040), + CONST64(0x0040400000004040), CONST64(0x0040401000004040), CONST64(0x0040400040004040), CONST64(0x0040401040004040), + CONST64(0x0040400000404040), CONST64(0x0040401000404040), CONST64(0x0040400040404040), CONST64(0x0040401040404040), + CONST64(0x4040400000000000), CONST64(0x4040401000000000), CONST64(0x4040400040000000), CONST64(0x4040401040000000), + CONST64(0x4040400000400000), CONST64(0x4040401000400000), CONST64(0x4040400040400000), CONST64(0x4040401040400000), + CONST64(0x4040400000004000), CONST64(0x4040401000004000), CONST64(0x4040400040004000), CONST64(0x4040401040004000), + CONST64(0x4040400000404000), CONST64(0x4040401000404000), CONST64(0x4040400040404000), CONST64(0x4040401040404000), + CONST64(0x4040400000000040), CONST64(0x4040401000000040), CONST64(0x4040400040000040), CONST64(0x4040401040000040), + CONST64(0x4040400000400040), CONST64(0x4040401000400040), CONST64(0x4040400040400040), CONST64(0x4040401040400040), + CONST64(0x4040400000004040), CONST64(0x4040401000004040), CONST64(0x4040400040004040), CONST64(0x4040401040004040), CONST64(0x4040400000404040), CONST64(0x4040401000404040), CONST64(0x4040400040404040), CONST64(0x4040401040404040) }}; - + #endif @@ -1427,11 +1427,11 @@ static void _desfunc(ulong32 *block, const ulong32 *keys) right = ROLc(right, 1); work = (leftt ^ right) & 0xaaaaaaaaL; - + leftt ^= work; right ^= work; leftt = ROLc(leftt, 1); -#else +#else { ulong64 tmp; tmp = des_ip[0][byte(leftt, 0)] ^ @@ -1471,7 +1471,7 @@ static void _desfunc(ulong32 *block, const ulong32 *keys) ^ SP2[(work >> 24) & 0x3fL]; } -#ifdef LTC_SMALL_CODE +#ifdef LTC_SMALL_CODE right = RORc(right, 1); work = (leftt ^ right) & 0xaaaaaaaaL; leftt ^= work; @@ -1490,7 +1490,7 @@ static void _desfunc(ulong32 *block, const ulong32 *keys) work = ((right >> 4) ^ leftt) & 0x0f0f0f0fL; leftt ^= work; right ^= (work << 4); -#else +#else { ulong64 tmp; tmp = des_fp[0][byte(leftt, 0)] ^ @@ -1505,7 +1505,7 @@ static void _desfunc(ulong32 *block, const ulong32 *keys) right = (ulong32)(tmp & 0xFFFFFFFFUL); } #endif - + block[0] = right; block[1] = leftt; } @@ -1612,7 +1612,7 @@ int des_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *s Decrypts a block of text with LTC_DES @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ int des_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -1625,7 +1625,7 @@ int des_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *s LOAD32H(work[1], ct+4); desfunc(work, skey->des.dk); STORE32H(work[0],pt+0); - STORE32H(work[1],pt+4); + STORE32H(work[1],pt+4); return CRYPT_OK; } @@ -1639,7 +1639,7 @@ int des_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *s int des3_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) { ulong32 work[2]; - + LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); LTC_ARGCHK(skey != NULL); @@ -1657,7 +1657,7 @@ int des3_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key * Decrypts a block of text with 3LTC_DES-EDE @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ int des3_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -1684,7 +1684,7 @@ int des_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else int err; static const struct des_test_case { int num, mode; /* mode 1 = encrypt */ @@ -1715,7 +1715,7 @@ int des_test(void) { 0x6C, 0xC5, 0xDE, 0xFA, 0xAF, 0x04, 0x51, 0x2F }, { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, { 9, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, - { 0x0D, 0x9F, 0x27, 0x9B, 0xA5, 0xD8, 0x72, 0x60 }, + { 0x0D, 0x9F, 0x27, 0x9B, 0xA5, 0xD8, 0x72, 0x60 }, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, {10, 1, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0xD9, 0x03, 0x1B, 0x02, 0x71, 0xBD, 0x5A, 0x0A }, @@ -1747,7 +1747,7 @@ int des_test(void) { 0x6C, 0xC5, 0xDE, 0xFA, 0xAF, 0x04, 0x51, 0x2F } }, { 9, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x0D, 0x9F, 0x27, 0x9B, 0xA5, 0xD8, 0x72, 0x60 } }, + { 0x0D, 0x9F, 0x27, 0x9B, 0xA5, 0xD8, 0x72, 0x60 } }, {10, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0xD9, 0x03, 0x1B, 0x02, 0x71, 0xBD, 0x5A, 0x0A } } @@ -1802,7 +1802,7 @@ int des_test(void) if ((err = des_setup(cases[i].key, 8, 0, &des)) != CRYPT_OK) { return err; } - if (cases[i].mode != 0) { + if (cases[i].mode != 0) { des_ecb_encrypt(cases[i].txt, tmp, &des); } else { des_ecb_decrypt(cases[i].txt, tmp, &des); @@ -1827,7 +1827,7 @@ int des3_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else unsigned char key[24], pt[8], ct[8], tmp[8]; symmetric_key skey; int x, err; @@ -1839,7 +1839,7 @@ int des3_test(void) for (x = 0; x < 8; x++) { pt[x] = x; } - + for (x = 0; x < 24; x++) { key[x] = x; } @@ -1847,26 +1847,26 @@ int des3_test(void) if ((err = des3_setup(key, 24, 0, &skey)) != CRYPT_OK) { return err; } - + des3_ecb_encrypt(pt, ct, &skey); des3_ecb_decrypt(ct, tmp, &skey); - + if (XMEMCMP(pt, tmp, 8) != 0) { return CRYPT_FAIL_TESTVECTOR; } - + return CRYPT_OK; #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void des_done(symmetric_key *skey) { } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void des3_done(symmetric_key *skey) diff --git a/src/ciphers/kasumi.c b/src/ciphers/kasumi.c index 3b765d0b4..53086074a 100644 --- a/src/ciphers/kasumi.c +++ b/src/ciphers/kasumi.c @@ -150,7 +150,7 @@ int kasumi_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key LOAD32H(left, pt); LOAD32H(right, pt+4); - for (n = 0; n <= 7; ) { + for (n = 0; n <= 7; ) { temp = FL(left, n, skey); temp = FO(temp, n++, skey); right ^= temp; diff --git a/src/ciphers/khazad.c b/src/ciphers/khazad.c index a3c67d57b..edb982363 100644 --- a/src/ciphers/khazad.c +++ b/src/ciphers/khazad.c @@ -31,11 +31,11 @@ const struct ltc_cipher_descriptor khazad_desc = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -#define R 8 -#define KEYSIZE 128 -#define KEYSIZEB (KEYSIZE/8) -#define BLOCKSIZE 64 -#define BLOCKSIZEB (BLOCKSIZE/8) +#define R 8 +#define KEYSIZE 128 +#define KEYSIZEB (KEYSIZE/8) +#define BLOCKSIZE 64 +#define BLOCKSIZEB (BLOCKSIZE/8) static const ulong64 T0[256] = { CONST64(0xbad3d268bbb96a01), CONST64(0x54fc4d19e59a66b1), CONST64(0x2f71bc93e26514cd), CONST64(0x749ccdb925871b51), @@ -756,7 +756,7 @@ int khazad_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key Decrypts a block of text with Khazad @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ int khazad_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -783,22 +783,22 @@ int khazad_test(void) { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x49, 0xA4, 0xCE, 0x32, 0xAC, 0x19, 0x0E, 0x3F }, - { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x64, 0x5D, 0x77, 0x3E, 0x40, 0xAB, 0xDD, 0x53 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } }, { { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x9E, 0x39, 0x98, 0x64, 0xF7, 0x8E, 0xCA, 0x02 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, { 0xA9, 0xDF, 0x3D, 0x2C, 0x64, 0xD3, 0xEA, 0x28 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }; @@ -825,7 +825,7 @@ int khazad_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void khazad_done(symmetric_key *skey) diff --git a/src/ciphers/kseed.c b/src/ciphers/kseed.c index 1065d8ca4..c3d274a08 100644 --- a/src/ciphers/kseed.c +++ b/src/ciphers/kseed.c @@ -207,7 +207,7 @@ int kseed_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ if (keylen != 16) { return CRYPT_INVALID_KEYSIZE; } - + if (num_rounds != 16 && num_rounds != 0) { return CRYPT_INVALID_ROUNDS; } @@ -275,7 +275,7 @@ int kseed_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key Decrypts a block of text with SEED @param ct The input ciphertext (16 bytes) @param pt The output plaintext (16 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ int kseed_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -293,7 +293,7 @@ int kseed_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key return CRYPT_OK; } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void kseed_done(symmetric_key *skey) diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index 78a3eac72..40c88e155 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -58,7 +58,7 @@ static void setup(ulong32 *dk, ulong32 *k, ulong32 *uk) p[0] = dk[0]; p[1] = dk[1]; - t = 4; + t = 4; n = 0; pi1(p); pi2(p, k); @@ -83,13 +83,13 @@ static void encrypt(ulong32 *p, int N, ulong32 *uk) { int n, t; for (t = n = 0; ; ) { - pi1(p); if (++n == N) break; + pi1(p); if (++n == N) break; pi2(p, uk+t); if (++n == N) break; pi3(p, uk+t); if (++n == N) break; pi4(p, uk+t); if (++n == N) break; t ^= 4; } -} +} static void decrypt(ulong32 *p, int N, ulong32 *uk) { @@ -104,7 +104,7 @@ static void decrypt(ulong32 *p, int N, ulong32 *uk) } t ^= 4; } -} +} const struct ltc_cipher_descriptor multi2_desc = { "multi2", @@ -129,7 +129,7 @@ int multi2_setup(const unsigned char *key, int keylen, int num_rounds, symmetri if (keylen != 40) return CRYPT_INVALID_KEYSIZE; if (num_rounds == 0) num_rounds = 128; - + skey->multi2.N = num_rounds; for (x = 0; x < 8; x++) { LOAD32H(sk[x], key + x*4); @@ -159,7 +159,7 @@ int multi2_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key LOAD32H(p[0], pt); LOAD32H(p[1], pt+4); encrypt(p, skey->multi2.N, skey->multi2.uk); - STORE32H(p[0], ct); + STORE32H(p[0], ct); STORE32H(p[1], ct+4); return CRYPT_OK; } @@ -180,7 +180,7 @@ int multi2_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key LOAD32H(p[0], ct); LOAD32H(p[1], ct+4); decrypt(p, skey->multi2.N, skey->multi2.uk); - STORE32H(p[0], pt); + STORE32H(p[0], pt); STORE32H(p[1], pt+4); return CRYPT_OK; } @@ -207,7 +207,7 @@ int multi2_test(void) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF }, @@ -235,7 +235,7 @@ int multi2_test(void) 0xb1, 0x27, 0xb9, 0x06, 0xe7, 0x56, 0x22, 0x38, }, - { + { 0x1f, 0xb4, 0x60, 0x60, 0xd0, 0xb3, 0x4f, 0xa5 }, @@ -261,7 +261,7 @@ int multi2_test(void) if (XMEMCMP(buf, tests[x].ct, 8)) { return CRYPT_FAIL_TESTVECTOR; } - + if ((err = multi2_ecb_decrypt(buf, buf, &skey)) != CRYPT_OK) { return err; } @@ -269,7 +269,7 @@ int multi2_test(void) return CRYPT_FAIL_TESTVECTOR; } } - + for (x = 128; x < 256; ++x) { unsigned char ct[8]; @@ -290,7 +290,7 @@ int multi2_test(void) return CRYPT_OK; } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void multi2_done(symmetric_key *skey) diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index f7ca741fb..2bc29dbc6 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -10,7 +10,7 @@ */ /** @file noekeon.c - Implementation of the Noekeon block cipher by Tom St Denis + Implementation of the Noekeon block cipher by Tom St Denis */ #include "tomcrypt.h" @@ -35,7 +35,7 @@ static const ulong32 RC[] = { 0x000000d8UL, 0x000000abUL, 0x0000004dUL, 0x0000009aUL, 0x0000002fUL, 0x0000005eUL, 0x000000bcUL, 0x00000063UL, 0x000000c6UL, 0x00000097UL, 0x00000035UL, 0x0000006aUL, - 0x000000d4UL + 0x000000d4UL }; #define kTHETA(a, b, c, d) \ @@ -49,7 +49,7 @@ static const ulong32 RC[] = { b ^= temp ^ k[1]; d ^= temp ^ k[3]; \ temp = b^d; temp = temp ^ ROLc(temp, 8) ^ RORc(temp, 8); \ a ^= temp ^ k[0]; c ^= temp ^ k[2]; - + #define GAMMA(a, b, c, d) \ b ^= ~(d|c); \ a ^= c&b; \ @@ -57,13 +57,13 @@ static const ulong32 RC[] = { c ^= a ^ b ^ d; \ b ^= ~(d|c); \ a ^= c&b; - + #define PI1(a, b, c, d) \ b = ROLc(b, 1); c = ROLc(c, 5); d = ROLc(d, 2); - + #define PI2(a, b, c, d) \ b = RORc(b, 1); c = RORc(c, 5); d = RORc(d, 2); - + /** Initialize the Noekeon block cipher @param key The symmetric key you wish to pass @@ -75,23 +75,23 @@ static const ulong32 RC[] = { int noekeon_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) { ulong32 temp; - + LTC_ARGCHK(key != NULL); LTC_ARGCHK(skey != NULL); - + if (keylen != 16) { return CRYPT_INVALID_KEYSIZE; } - + if (num_rounds != 16 && num_rounds != 0) { return CRYPT_INVALID_ROUNDS; } - + LOAD32H(skey->noekeon.K[0],&key[0]); LOAD32H(skey->noekeon.K[1],&key[4]); LOAD32H(skey->noekeon.K[2],&key[8]); LOAD32H(skey->noekeon.K[3],&key[12]); - + LOAD32H(skey->noekeon.dK[0],&key[0]); LOAD32H(skey->noekeon.dK[1],&key[4]); LOAD32H(skey->noekeon.dK[2],&key[8]); @@ -121,10 +121,10 @@ int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_ke LTC_ARGCHK(skey != NULL); LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); - + LOAD32H(a,&pt[0]); LOAD32H(b,&pt[4]); LOAD32H(c,&pt[8]); LOAD32H(d,&pt[12]); - + #define ROUND(i) \ a ^= RC[i]; \ THETA(skey->noekeon.K, a,b,c,d); \ @@ -140,7 +140,7 @@ int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_ke a ^= RC[16]; THETA(skey->noekeon.K, a, b, c, d); - + STORE32H(a,&ct[0]); STORE32H(b,&ct[4]); STORE32H(c,&ct[8]); STORE32H(d,&ct[12]); @@ -160,7 +160,7 @@ int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_ke Decrypts a block of text with Noekeon @param ct The input ciphertext (16 bytes) @param pt The output plaintext (16 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ #ifdef LTC_CLEAN_STACK @@ -175,17 +175,17 @@ int noekeon_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_ke LTC_ARGCHK(skey != NULL); LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); - + LOAD32H(a,&ct[0]); LOAD32H(b,&ct[4]); LOAD32H(c,&ct[8]); LOAD32H(d,&ct[12]); - + #define ROUND(i) \ THETA(skey->noekeon.dK, a,b,c,d); \ a ^= RC[i]; \ PI1(a,b,c,d); \ GAMMA(a,b,c,d); \ - PI2(a,b,c,d); + PI2(a,b,c,d); for (r = 16; r > 0; --r) { ROUND(r); @@ -274,16 +274,16 @@ int noekeon_test(void) symmetric_key key; unsigned char tmp[2][16]; int err, i, y; - + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { zeromem(&key, sizeof(key)); - if ((err = noekeon_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) { + if ((err = noekeon_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) { return err; } - + noekeon_ecb_encrypt(tests[i].pt, tmp[0], &key); noekeon_ecb_decrypt(tmp[0], tmp[1], &key); - if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { + if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { #if 0 printf("\n\nTest %d failed\n", i); if (XMEMCMP(tmp[0], tests[i].ct, 16)) { @@ -299,7 +299,7 @@ int noekeon_test(void) } printf("\n"); } -#endif +#endif return CRYPT_FAIL_TESTVECTOR; } @@ -308,12 +308,12 @@ int noekeon_test(void) for (y = 0; y < 1000; y++) noekeon_ecb_encrypt(tmp[0], tmp[0], &key); for (y = 0; y < 1000; y++) noekeon_ecb_decrypt(tmp[0], tmp[0], &key); for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; - } + } return CRYPT_OK; #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void noekeon_done(symmetric_key *skey) diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 256f07450..06374e478 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -23,7 +23,7 @@ /** @file rc2.c Implementation of LTC_RC2 -*/ +*/ #ifdef LTC_RC2 @@ -95,7 +95,7 @@ int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke tmp[i] = permute[(tmp[i - 1] + tmp[i - keylen]) & 255]; } } - + /* Phase 2 - reduce effective key size to "bits" */ bits = keylen<<3; T8 = (unsigned)(bits+7)>>3; @@ -108,12 +108,12 @@ int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke /* Phase 3 - copy to xkey in little-endian order */ for (i = 0; i < 64; i++) { xkey[i] = (unsigned)tmp[2*i] + ((unsigned)tmp[2*i+1] << 8); - } + } #ifdef LTC_CLEAN_STACK zeromem(tmp, sizeof(tmp)); #endif - + return CRYPT_OK; } @@ -180,7 +180,7 @@ int rc2_ecb_encrypt( const unsigned char *pt, ct[5] = (unsigned char)(x54 >> 8); ct[6] = (unsigned char)x76; ct[7] = (unsigned char)(x76 >> 8); - + return CRYPT_OK; } @@ -202,7 +202,7 @@ int rc2_ecb_encrypt( const unsigned char *pt, Decrypts a block of text with LTC_RC2 @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ #ifdef LTC_CLEAN_STACK @@ -282,7 +282,7 @@ int rc2_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { int keylen; unsigned char key[16], pt[8], ct[8]; @@ -311,10 +311,10 @@ int rc2_test(void) if ((err = rc2_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { return err; } - + rc2_ecb_encrypt(tests[x].pt, tmp[0], &skey); rc2_ecb_decrypt(tmp[0], tmp[1], &skey); - + if (XMEMCMP(tmp[0], tests[x].ct, 8) != 0 || XMEMCMP(tmp[1], tests[x].pt, 8) != 0) { return CRYPT_FAIL_TESTVECTOR; } @@ -329,7 +329,7 @@ int rc2_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void rc2_done(symmetric_key *skey) diff --git a/src/ciphers/rc5.c b/src/ciphers/rc5.c index ac5645117..9514cdeba 100644 --- a/src/ciphers/rc5.c +++ b/src/ciphers/rc5.c @@ -11,7 +11,7 @@ /** @file rc5.c - LTC_RC5 code by Tom St Denis + LTC_RC5 code by Tom St Denis */ #include "tomcrypt.h" @@ -60,13 +60,13 @@ int rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke LTC_ARGCHK(skey != NULL); LTC_ARGCHK(key != NULL); - + /* test parameters */ - if (num_rounds == 0) { + if (num_rounds == 0) { num_rounds = rc5_desc.default_rounds; } - if (num_rounds < 12 || num_rounds > 24) { + if (num_rounds < 12 || num_rounds > 24) { return CRYPT_INVALID_ROUNDS; } @@ -74,12 +74,12 @@ int rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke if (keylen < 8 || keylen > 128) { return CRYPT_INVALID_KEYSIZE; } - + skey->rc5.rounds = num_rounds; S = skey->rc5.K; /* copy the key into the L array */ - for (A = i = j = 0; i < (ulong32)keylen; ) { + for (A = i = j = 0; i < (ulong32)keylen; ) { A = (A << 8) | ((ulong32)(key[i++] & 255)); if ((i & 3) == 0) { L[j++] = BSWAP(A); @@ -87,8 +87,8 @@ int rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke } } - if ((keylen & 3) != 0) { - A <<= (ulong32)((8 * (4 - (keylen&3)))); + if ((keylen & 3) != 0) { + A <<= (ulong32)((8 * (4 - (keylen&3)))); L[j++] = BSWAP(A); } @@ -99,7 +99,7 @@ int rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke /* mix buffer */ s = 3 * MAX(t, j); l = j; - for (A = B = i = j = v = 0; v < s; v++) { + for (A = B = i = j = v = 0; v < s; v++) { A = S[i] = ROLc(S[i] + A + B, 3); B = L[j] = ROL(L[j] + A + B, (A+B)); if (++i == t) { i = 0; } @@ -142,7 +142,7 @@ int rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *s A += skey->rc5.K[0]; B += skey->rc5.K[1]; K = skey->rc5.K + 2; - + if ((skey->rc5.rounds & 1) == 0) { for (r = 0; r < skey->rc5.rounds; r += 2) { A = ROL(A ^ B, B) + K[0]; @@ -177,7 +177,7 @@ int rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *s Decrypts a block of text with LTC_RC5 @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ #ifdef LTC_CLEAN_STACK @@ -195,7 +195,7 @@ int rc5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *s LOAD32L(A, &ct[0]); LOAD32L(B, &ct[4]); K = skey->rc5.K + (skey->rc5.rounds << 1); - + if ((skey->rc5.rounds & 1) == 0) { K -= 2; for (r = skey->rc5.rounds - 1; r >= 0; r -= 2) { @@ -237,7 +237,7 @@ int rc5_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { unsigned char key[16], pt[8], ct[8]; } tests[] = { @@ -289,7 +289,7 @@ int rc5_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void rc5_done(symmetric_key *skey) diff --git a/src/ciphers/rc6.c b/src/ciphers/rc6.c index 88639b8a2..f477e64ba 100644 --- a/src/ciphers/rc6.c +++ b/src/ciphers/rc6.c @@ -11,7 +11,7 @@ /** @file rc6.c - LTC_RC6 code by Tom St Denis + LTC_RC6 code by Tom St Denis */ #include "tomcrypt.h" @@ -59,7 +59,7 @@ int rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke LTC_ARGCHK(skey != NULL); /* test parameters */ - if (num_rounds != 0 && num_rounds != 20) { + if (num_rounds != 0 && num_rounds != 20) { return CRYPT_INVALID_ROUNDS; } @@ -69,7 +69,7 @@ int rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke } /* copy the key into the L array */ - for (A = i = j = 0; i < (ulong32)keylen; ) { + for (A = i = j = 0; i < (ulong32)keylen; ) { A = (A << 8) | ((ulong32)(key[i++] & 255)); if (!(i & 3)) { L[j++] = BSWAP(A); @@ -78,9 +78,9 @@ int rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke } /* handle odd sized keys */ - if (keylen & 3) { - A <<= (8 * (4 - (keylen&3))); - L[j++] = BSWAP(A); + if (keylen & 3) { + A <<= (8 * (4 - (keylen&3))); + L[j++] = BSWAP(A); } /* setup the S array */ @@ -89,15 +89,15 @@ int rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke /* mix buffer */ s = 3 * MAX(44, j); l = j; - for (A = B = i = j = v = 0; v < s; v++) { + for (A = B = i = j = v = 0; v < s; v++) { A = S[i] = ROLc(S[i] + A + B, 3); B = L[j] = ROL(L[j] + A + B, (A+B)); if (++i == 44) { i = 0; } if (++j == l) { j = 0; } } - + /* copy to key */ - for (i = 0; i < 44; i++) { + for (i = 0; i < 44; i++) { skey->rc6.K[i] = S[i]; } return CRYPT_OK; @@ -127,7 +127,7 @@ int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *s { ulong32 a,b,c,d,t,u, *K; int r; - + LTC_ARGCHK(skey != NULL); LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); @@ -140,8 +140,8 @@ int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *s t = (b * (b + b + 1)); t = ROLc(t, 5); \ u = (d * (d + d + 1)); u = ROLc(u, 5); \ a = ROL(a^t,u) + K[0]; \ - c = ROL(c^u,t) + K[1]; K += 2; - + c = ROL(c^u,t) + K[1]; K += 2; + K = skey->rc6.K + 2; for (r = 0; r < 20; r += 4) { RND(a,b,c,d); @@ -149,7 +149,7 @@ int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *s RND(c,d,a,b); RND(d,a,b,c); } - + #undef RND a += skey->rc6.K[42]; @@ -171,7 +171,7 @@ int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *s Decrypts a block of text with LTC_RC6 @param ct The input ciphertext (16 bytes) @param pt The output plaintext (16 bytes) - @param skey The key as scheduled + @param skey The key as scheduled */ #ifdef LTC_CLEAN_STACK static int _rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) @@ -185,26 +185,26 @@ int rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *s LTC_ARGCHK(skey != NULL); LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); - + LOAD32L(a,&ct[0]);LOAD32L(b,&ct[4]);LOAD32L(c,&ct[8]);LOAD32L(d,&ct[12]); a -= skey->rc6.K[42]; c -= skey->rc6.K[43]; - + #define RND(a,b,c,d) \ t = (b * (b + b + 1)); t = ROLc(t, 5); \ u = (d * (d + d + 1)); u = ROLc(u, 5); \ c = ROR(c - K[1], t) ^ u; \ a = ROR(a - K[0], u) ^ t; K -= 2; - + K = skey->rc6.K + 40; - + for (r = 0; r < 20; r += 4) { RND(d,a,b,c); RND(c,d,a,b); RND(b,c,d,a); RND(a,b,c,d); } - + #undef RND b -= skey->rc6.K[0]; @@ -231,7 +231,7 @@ int rc6_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { int keylen; unsigned char key[32], pt[16], ct[16]; @@ -316,7 +316,7 @@ int rc6_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void rc6_done(symmetric_key *skey) diff --git a/src/ciphers/skipjack.c b/src/ciphers/skipjack.c index 89e9a5646..b57714a69 100644 --- a/src/ciphers/skipjack.c +++ b/src/ciphers/skipjack.c @@ -75,7 +75,7 @@ int skipjack_setup(const unsigned char *key, int keylen, int num_rounds, symmetr return CRYPT_INVALID_KEYSIZE; } - if (num_rounds != 32 && num_rounds != 0) { + if (num_rounds != 32 && num_rounds != 0) { return CRYPT_INVALID_ROUNDS; } @@ -201,7 +201,7 @@ int skipjack_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_k Decrypts a block of text with Skipjack @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) - @param skey The key as scheduled + @param skey The key as scheduled @return CRYPT_OK if successful */ #ifdef LTC_CLEAN_STACK @@ -223,7 +223,7 @@ int skipjack_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_k w3 = ((unsigned)ct[4]<<8)|ct[5]; w4 = ((unsigned)ct[6]<<8)|ct[7]; - /* 8 rounds of RULE B^-1 + /* 8 rounds of RULE B^-1 Note the value "kp = 8" comes from "kp = (32 * 4) mod 10" where 32*4 is 128 which mod 10 is 8 */ @@ -273,7 +273,7 @@ int skipjack_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { unsigned char key[10], pt[8], ct[8]; } tests[] = { @@ -313,7 +313,7 @@ int skipjack_test(void) #endif } -/** Terminate the context +/** Terminate the context @param skey The scheduled key */ void skipjack_done(symmetric_key *skey) diff --git a/src/pk/asn1/der/choice/der_decode_choice.c b/src/pk/asn1/der/choice/der_decode_choice.c index 1220b37d6..ebadc5fe3 100644 --- a/src/pk/asn1/der/choice/der_decode_choice.c +++ b/src/pk/asn1/der/choice/der_decode_choice.c @@ -100,7 +100,7 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, return CRYPT_OK; } break; - + case LTC_ASN1_OBJECT_IDENTIFIER: if (der_decode_object_identifier(in, *inlen, data, &size) == CRYPT_OK) { if (der_length_object_identifier(data, size, &z) == CRYPT_OK) { @@ -123,7 +123,6 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, } break; - case LTC_ASN1_PRINTABLE_STRING: if (der_decode_printable_string(in, *inlen, data, &size) == CRYPT_OK) { if (der_length_printable_string(data, size, &z) == CRYPT_OK) { diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index d7c894fc2..057370a9c 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -28,54 +28,54 @@ static unsigned long fetch_length(const unsigned char *in, unsigned long inlen) return 0xFFFFFFFF; } ++in; ++y; - + /* read len */ x = *in++; ++y; - + /* <128 means literal */ if (x < 128) { return x+y; } x &= 0x7F; /* the lower 7 bits are the length of the length */ inlen -= 2; - + /* len means len of len! */ if (x == 0 || x > 4 || x > inlen) { return 0xFFFFFFFF; } - + y += x; z = 0; - while (x--) { + while (x--) { z = (z<<8) | ((unsigned long)*in); ++in; } return z+y; } -/** +/** ASN.1 DER Flexi(ble) decoder will decode arbitrary DER packets and create a linked list of the decoded elements. @param in The input buffer - @param inlen [in/out] The length of the input buffer and on output the amount of decoded data + @param inlen [in/out] The length of the input buffer and on output the amount of decoded data @param out [out] A pointer to the linked list @return CRYPT_OK on success. -*/ +*/ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc_asn1_list **out) { ltc_asn1_list *l; unsigned long err, type, len, totlen, x, y; void *realloc_tmp; int isConstructed; - + LTC_ARGCHK(in != NULL); LTC_ARGCHK(inlen != NULL); LTC_ARGCHK(out != NULL); l = NULL; totlen = 0; - + /* scan the input and and get lengths and what not */ - while (*inlen) { + while (*inlen) { /* read the type byte */ type = *in; @@ -109,18 +109,18 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc /* treat constructed elements like SETs */ type = 0x31; } - + /* now switch on type */ switch (type) { case 0x01: /* BOOLEAN */ l->type = LTC_ASN1_BOOLEAN; l->size = 1; l->data = XCALLOC(1, sizeof(int)); - + if ((err = der_decode_boolean(in, *inlen, l->data)) != CRYPT_OK) { goto error; } - + if ((err = der_length_boolean(&len)) != CRYPT_OK) { goto error; } @@ -133,12 +133,12 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc if ((err = mp_init(&l->data)) != CRYPT_OK) { goto error; } - + /* decode field */ if ((err = der_decode_integer(in, *inlen, l->data)) != CRYPT_OK) { goto error; } - + /* calc length of object */ if ((err = der_length_integer(l->data, &len)) != CRYPT_OK) { goto error; @@ -154,11 +154,11 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc err = CRYPT_MEM; goto error; } - + if ((err = der_decode_bit_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { goto error; } - + if ((err = der_length_bit_string(l->size, &len)) != CRYPT_OK) { goto error; } @@ -174,34 +174,34 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc err = CRYPT_MEM; goto error; } - + if ((err = der_decode_octet_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { goto error; } - + if ((err = der_length_octet_string(l->size, &len)) != CRYPT_OK) { goto error; } break; case 0x05: /* NULL */ - + /* valid NULL is 0x05 0x00 */ if (in[0] != 0x05 || in[1] != 0x00) { err = CRYPT_INVALID_PACKET; goto error; } - + /* simple to store ;-) */ l->type = LTC_ASN1_NULL; l->data = NULL; l->size = 0; len = 2; - + break; - + case 0x06: /* OID */ - + /* init field */ l->type = LTC_ASN1_OBJECT_IDENTIFIER; l->size = len; @@ -210,15 +210,15 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc err = CRYPT_MEM; goto error; } - + if ((err = der_decode_object_identifier(in, *inlen, l->data, &l->size)) != CRYPT_OK) { goto error; } - + if ((err = der_length_object_identifier(l->data, l->size, &len)) != CRYPT_OK) { goto error; } - + /* resize it to save a bunch of mem */ if ((realloc_tmp = XREALLOC(l->data, l->size * sizeof(unsigned long))) == NULL) { /* out of heap but this is not an error */ @@ -226,9 +226,9 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc } l->data = realloc_tmp; break; - + case 0x0C: /* UTF8 */ - + /* init field */ l->type = LTC_ASN1_UTF8_STRING; l->size = len; @@ -237,18 +237,18 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc err = CRYPT_MEM; goto error; } - + if ((err = der_decode_utf8_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { goto error; } - + if ((err = der_length_utf8_string(l->data, l->size, &len)) != CRYPT_OK) { goto error; } break; case 0x13: /* PRINTABLE */ - + /* init field */ l->type = LTC_ASN1_PRINTABLE_STRING; l->size = len; @@ -257,18 +257,18 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc err = CRYPT_MEM; goto error; } - + if ((err = der_decode_printable_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { goto error; } - + if ((err = der_length_printable_string(l->data, l->size, &len)) != CRYPT_OK) { goto error; } break; - + case 0x14: /* TELETEXT */ - + /* init field */ l->type = LTC_ASN1_TELETEX_STRING; l->size = len; @@ -277,18 +277,18 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc err = CRYPT_MEM; goto error; } - + if ((err = der_decode_teletex_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { goto error; } - + if ((err = der_length_teletex_string(l->data, l->size, &len)) != CRYPT_OK) { goto error; } break; - + case 0x16: /* IA5 */ - + /* init field */ l->type = LTC_ASN1_IA5_STRING; l->size = len; @@ -297,18 +297,18 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc err = CRYPT_MEM; goto error; } - + if ((err = der_decode_ia5_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { goto error; } - + if ((err = der_length_ia5_string(l->data, l->size, &len)) != CRYPT_OK) { goto error; } break; - + case 0x17: /* UTC TIME */ - + /* init field */ l->type = LTC_ASN1_UTCTIME; l->size = 1; @@ -317,56 +317,56 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc err = CRYPT_MEM; goto error; } - + len = *inlen; if ((err = der_decode_utctime(in, &len, l->data)) != CRYPT_OK) { goto error; } - + if ((err = der_length_utctime(l->data, &len)) != CRYPT_OK) { goto error; } break; - + case 0x30: /* SEQUENCE */ case 0x31: /* SET */ - + /* init field */ l->type = (isConstructed ? LTC_ASN1_CONSTRUCTED : ((type == 0x30) ? LTC_ASN1_SEQUENCE : LTC_ASN1_SET)); - + /* we have to decode the SEQUENCE header and get it's length */ - - /* move past type */ - ++in; --(*inlen); - - /* read length byte */ - x = *in++; --(*inlen); - - /* smallest SEQUENCE/SET header */ - y = 2; - - /* now if it's > 127 the next bytes are the length of the length */ - if (x > 128) { - x &= 0x7F; - in += x; - *inlen -= x; - - /* update sequence header len */ - y += x; - } - + + /* move past type */ + ++in; --(*inlen); + + /* read length byte */ + x = *in++; --(*inlen); + + /* smallest SEQUENCE/SET header */ + y = 2; + + /* now if it's > 127 the next bytes are the length of the length */ + if (x > 128) { + x &= 0x7F; + in += x; + *inlen -= x; + + /* update sequence header len */ + y += x; + } + /* Sequence elements go as child */ len = len - y; if ((err = der_decode_sequence_flexi(in, &len, &(l->child))) != CRYPT_OK) { goto error; } - + /* len update */ totlen += y; - + /* link them up y0 */ l->child->parent = l; - + break; default: /* invalid byte ... this is a soft error */ @@ -378,14 +378,14 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc } goto outside; } - + /* advance pointers */ totlen += len; in += len; *inlen -= len; } - -outside: + +outside: /* rewind l please */ while (l->prev != NULL || l->parent != NULL) { @@ -395,7 +395,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc l = l->prev; } } - + /* return */ *out = l; *inlen = totlen; diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index 4202eb3b3..da25827fb 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -25,7 +25,7 @@ @param inlen Length of input in octets @remark <...> is of the form (int, unsigned long, void*) @return CRYPT_OK on success -*/ +*/ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) { int err, type; @@ -44,7 +44,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) size = va_arg(args, unsigned long); data = va_arg(args, void*); - if (type == LTC_ASN1_EOL) { + if (type == LTC_ASN1_EOL) { break; } @@ -64,9 +64,9 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_SETOF: case LTC_ASN1_SEQUENCE: case LTC_ASN1_CHOICE: - ++x; + ++x; break; - + default: va_end(args); return CRYPT_INVALID_ARG; @@ -92,7 +92,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) size = va_arg(args, unsigned long); data = va_arg(args, void*); - if (type == LTC_ASN1_EOL) { + if (type == LTC_ASN1_EOL) { break; } @@ -110,13 +110,13 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_UTCTIME: case LTC_ASN1_SEQUENCE: case LTC_ASN1_SET: - case LTC_ASN1_SETOF: + case LTC_ASN1_SETOF: case LTC_ASN1_CHOICE: list[x].type = type; list[x].size = size; list[x++].data = data; break; - + default: va_end(args); err = CRYPT_INVALID_ARG; diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index 9c34053f4..e05484041 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -23,13 +23,13 @@ Encode a SEQUENCE @param list The list of items to encode @param inlen The number of items in the list - @param out [out] The destination + @param out [out] The destination @param outlen [in/out] The size of the output @param type_of LTC_ASN1_SEQUENCE or LTC_ASN1_SET/LTC_ASN1_SETOF @return CRYPT_OK on success */ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, - unsigned char *out, unsigned long *outlen, int type_of) + unsigned char *out, unsigned long *outlen, int type_of) { int err, type; unsigned long size, x, y, z, i; @@ -46,7 +46,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, size = list[i].size; data = list[i].data; - if (type == LTC_ASN1_EOL) { + if (type == LTC_ASN1_EOL) { break; } @@ -134,7 +134,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, } y += x; break; - + default: err = CRYPT_INVALID_ARG; goto LBL_ERR; @@ -169,7 +169,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, /* store header */ x = 0; out[x++] = (type_of == LTC_ASN1_SEQUENCE) ? 0x30 : 0x31; - + if (z < 128) { out[x++] = (unsigned char)z; } else if (z < 256) { @@ -193,7 +193,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, size = list[i].size; data = list[i].data; - if (type == LTC_ASN1_EOL) { + if (type == LTC_ASN1_EOL) { break; } @@ -206,7 +206,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, x += z; *outlen -= z; break; - + case LTC_ASN1_INTEGER: z = *outlen; if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { @@ -275,7 +275,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, x += z; *outlen -= z; break; - + case LTC_ASN1_PRINTABLE_STRING: z = *outlen; if ((err = der_encode_printable_string(data, size, out + x, &z)) != CRYPT_OK) { @@ -329,14 +329,14 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, x += z; *outlen -= z; break; - + default: err = CRYPT_INVALID_ARG; goto LBL_ERR; } } *outlen = x; - err = CRYPT_OK; + err = CRYPT_OK; LBL_ERR: return err; diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index 635384821..abd045706 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -25,7 +25,7 @@ @param outlen [in/out] Length of buffer and resulting length of output @remark <...> is of the form (int, unsigned long, void*) @return CRYPT_OK on success -*/ +*/ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) { int err, type; @@ -45,7 +45,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) size = va_arg(args, unsigned long); data = va_arg(args, void*); - if (type == LTC_ASN1_EOL) { + if (type == LTC_ASN1_EOL) { break; } @@ -65,9 +65,9 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_RAW_BIT_STRING: - ++x; + ++x; break; - + default: va_end(args); return CRYPT_INVALID_ARG; @@ -93,7 +93,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) size = va_arg(args, unsigned long); data = va_arg(args, void*); - if (type == LTC_ASN1_EOL) { + if (type == LTC_ASN1_EOL) { break; } @@ -117,7 +117,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) list[x].size = size; list[x++].data = data; break; - + default: va_end(args); err = CRYPT_INVALID_ARG; @@ -126,7 +126,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) } va_end(args); - err = der_encode_sequence(list, x, out, outlen); + err = der_encode_sequence(list, x, out, outlen); LBL_ERR: XFREE(list); return err; diff --git a/src/prngs/sprng.c b/src/prngs/sprng.c index d86b08113..ae070b145 100644 --- a/src/prngs/sprng.c +++ b/src/prngs/sprng.c @@ -14,7 +14,7 @@ @file sprng.c Secure PRNG, Tom St Denis */ - + /* A secure PRNG using the RNG functions. Basically this is a * wrapper that allows you to use a secure RNG as a PRNG * in the various other functions. @@ -39,10 +39,10 @@ const struct ltc_prng_descriptor sprng_desc = Start the PRNG @param prng [out] The PRNG state to initialize @return CRYPT_OK if successful -*/ +*/ int sprng_start(prng_state *prng) { - return CRYPT_OK; + return CRYPT_OK; } /** @@ -51,7 +51,7 @@ int sprng_start(prng_state *prng) @param inlen Length of the data to add @param prng PRNG state to update @return CRYPT_OK if successful -*/ +*/ int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { return CRYPT_OK; @@ -61,7 +61,7 @@ int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state * Make the PRNG ready to read from @param prng The PRNG to make active @return CRYPT_OK if successful -*/ +*/ int sprng_ready(prng_state *prng) { return CRYPT_OK; @@ -73,7 +73,7 @@ int sprng_ready(prng_state *prng) @param outlen Length of output @param prng The active PRNG to read from @return Number of octets read -*/ +*/ unsigned long sprng_read(unsigned char *out, unsigned long outlen, prng_state *prng) { LTC_ARGCHK(out != NULL); @@ -84,7 +84,7 @@ unsigned long sprng_read(unsigned char *out, unsigned long outlen, prng_state *p Terminate the PRNG @param prng The PRNG to terminate @return CRYPT_OK if successful -*/ +*/ int sprng_done(prng_state *prng) { return CRYPT_OK; @@ -96,7 +96,7 @@ int sprng_done(prng_state *prng) @param outlen [in/out] Max size and resulting size of the state @param prng The PRNG to export @return CRYPT_OK if successful -*/ +*/ int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { LTC_ARGCHK(outlen != NULL); @@ -104,14 +104,14 @@ int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) *outlen = 0; return CRYPT_OK; } - + /** Import a PRNG state @param in The PRNG state @param inlen Size of the state @param prng The PRNG to import @return CRYPT_OK if successful -*/ +*/ int sprng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { return CRYPT_OK; @@ -120,7 +120,7 @@ int sprng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) /** PRNG self-test @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled -*/ +*/ int sprng_test(void) { return CRYPT_OK; @@ -129,7 +129,7 @@ int sprng_test(void) #endif - + /* $Source$ */ /* $Revision$ */ From 473b0319ad0fe860dacb91442d263dd296ec14a9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 24 Aug 2014 18:24:15 +0200 Subject: [PATCH 0248/1192] re-enable "unused-parameters" warning --- makefile | 2 +- src/ciphers/aes/aes.c | 1 + src/ciphers/anubis.c | 1 + src/ciphers/blowfish.c | 1 + src/ciphers/camellia.c | 5 ++++- src/ciphers/cast5.c | 1 + src/ciphers/des.c | 2 ++ src/ciphers/kasumi.c | 1 + src/ciphers/khazad.c | 1 + src/ciphers/kseed.c | 1 + src/ciphers/multi2.c | 1 + src/ciphers/noekeon.c | 1 + src/ciphers/rc2.c | 1 + src/ciphers/rc5.c | 1 + src/ciphers/rc6.c | 1 + src/ciphers/safer/safer.c | 1 + src/ciphers/safer/saferp.c | 1 + src/ciphers/skipjack.c | 1 + src/ciphers/twofish/twofish.c | 1 + src/ciphers/xtea.c | 1 + src/headers/tomcrypt_macros.h | 4 ++++ src/prngs/rng_get_bytes.c | 4 ++++ src/prngs/sprng.c | 12 ++++++++++++ 23 files changed, 44 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index c775d5518..ebfee4eea 100644 --- a/makefile +++ b/makefile @@ -37,7 +37,7 @@ endif endif # Compilation flags. Note the += does not write over the user's CFLAGS! -CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE +CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -DLTC_SOURCE # additional warnings (newer GCC 3.4 and higher) ifdef GCC_34 diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index 3a165074c..aea8e19d1 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -725,6 +725,7 @@ int ECB_TEST(void) */ void ECB_DONE(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index 36f480d43..226a1900f 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -1520,6 +1520,7 @@ int anubis_test(void) */ void anubis_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/blowfish.c b/src/ciphers/blowfish.c index 597585843..cbe694277 100644 --- a/src/ciphers/blowfish.c +++ b/src/ciphers/blowfish.c @@ -567,6 +567,7 @@ int blowfish_test(void) */ void blowfish_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index e23852552..3497cfa82 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -721,7 +721,10 @@ int camellia_test(void) return CRYPT_OK; } -void camellia_done(symmetric_key *skey) {} +void camellia_done(symmetric_key *skey) +{ + LTC_UNUSED_PARAM(skey); +} int camellia_keysize(int *keysize) { diff --git a/src/ciphers/cast5.c b/src/ciphers/cast5.c index 01716edfd..817ec5a06 100644 --- a/src/ciphers/cast5.c +++ b/src/ciphers/cast5.c @@ -695,6 +695,7 @@ int cast5_test(void) */ void cast5_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/des.c b/src/ciphers/des.c index fa1991e93..b706b074b 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -1864,6 +1864,7 @@ int des3_test(void) */ void des_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** Terminate the context @@ -1871,6 +1872,7 @@ void des_done(symmetric_key *skey) */ void des3_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } diff --git a/src/ciphers/kasumi.c b/src/ciphers/kasumi.c index 53086074a..c6113319d 100644 --- a/src/ciphers/kasumi.c +++ b/src/ciphers/kasumi.c @@ -236,6 +236,7 @@ int kasumi_setup(const unsigned char *key, int keylen, int num_rounds, symmetric void kasumi_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } int kasumi_keysize(int *keysize) diff --git a/src/ciphers/khazad.c b/src/ciphers/khazad.c index edb982363..285e8b13e 100644 --- a/src/ciphers/khazad.c +++ b/src/ciphers/khazad.c @@ -830,6 +830,7 @@ int khazad_test(void) */ void khazad_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/kseed.c b/src/ciphers/kseed.c index c3d274a08..e8f0fa891 100644 --- a/src/ciphers/kseed.c +++ b/src/ciphers/kseed.c @@ -298,6 +298,7 @@ int kseed_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key */ void kseed_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index 40c88e155..65249a3ba 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -295,6 +295,7 @@ int multi2_test(void) */ void multi2_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index 2bc29dbc6..40c07116e 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -318,6 +318,7 @@ int noekeon_test(void) */ void noekeon_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 06374e478..87ccb6da8 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -334,6 +334,7 @@ int rc2_test(void) */ void rc2_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/rc5.c b/src/ciphers/rc5.c index 9514cdeba..b267a5a39 100644 --- a/src/ciphers/rc5.c +++ b/src/ciphers/rc5.c @@ -294,6 +294,7 @@ int rc5_test(void) */ void rc5_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/rc6.c b/src/ciphers/rc6.c index f477e64ba..611c00cab 100644 --- a/src/ciphers/rc6.c +++ b/src/ciphers/rc6.c @@ -321,6 +321,7 @@ int rc6_test(void) */ void rc6_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index 94435de8b..434a7db9f 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -447,6 +447,7 @@ int safer_sk64_test(void) */ void safer_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } int safer_sk128_test(void) diff --git a/src/ciphers/safer/saferp.c b/src/ciphers/safer/saferp.c index 9d384da75..6ef6d40f2 100644 --- a/src/ciphers/safer/saferp.c +++ b/src/ciphers/safer/saferp.c @@ -528,6 +528,7 @@ int saferp_test(void) */ void saferp_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/skipjack.c b/src/ciphers/skipjack.c index b57714a69..9b2e10192 100644 --- a/src/ciphers/skipjack.c +++ b/src/ciphers/skipjack.c @@ -318,6 +318,7 @@ int skipjack_test(void) */ void skipjack_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index 6fc2c8ec9..be6c7d546 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -677,6 +677,7 @@ int twofish_test(void) */ void twofish_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index 13e58c4f7..963824d33 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -249,6 +249,7 @@ int xtea_test(void) */ void xtea_done(symmetric_key *skey) { + LTC_UNUSED_PARAM(skey); } /** diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 85de9e699..c2832ab97 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -414,6 +414,10 @@ static inline ulong64 ROR64c(ulong64 word, const int i) #define MIN(x, y) ( ((x)<(y))?(x):(y) ) #endif +#ifndef LTC_UNUSED_PARAM + #define LTC_UNUSED_PARAM(x) (void)(x) +#endif + /* extract a byte portably */ #ifdef _MSC_VER #define byte(x, n) ((unsigned char)((x) >> (8 * (n)))) diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 383979492..90338cb8e 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -20,7 +20,10 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len, void (*callback)(void)) { + LTC_UNUSED_PARAM(callback); #ifdef LTC_NO_FILE + LTC_UNUSED_PARAM(buf); + LTC_UNUSED_PARAM(len); return 0; #else FILE *f; @@ -103,6 +106,7 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, static unsigned long rng_win32(unsigned char *buf, unsigned long len, void (*callback)(void)) { + LTC_UNUSED_PARAM(callback); HCRYPTPROV hProv = 0; if (!CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, (CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET)) && diff --git a/src/prngs/sprng.c b/src/prngs/sprng.c index ae070b145..7b538dd41 100644 --- a/src/prngs/sprng.c +++ b/src/prngs/sprng.c @@ -42,6 +42,7 @@ const struct ltc_prng_descriptor sprng_desc = */ int sprng_start(prng_state *prng) { + LTC_UNUSED_PARAM(prng); return CRYPT_OK; } @@ -54,6 +55,9 @@ int sprng_start(prng_state *prng) */ int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { + LTC_UNUSED_PARAM(in); + LTC_UNUSED_PARAM(inlen); + LTC_UNUSED_PARAM(prng); return CRYPT_OK; } @@ -64,6 +68,7 @@ int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state * */ int sprng_ready(prng_state *prng) { + LTC_UNUSED_PARAM(prng); return CRYPT_OK; } @@ -77,6 +82,7 @@ int sprng_ready(prng_state *prng) unsigned long sprng_read(unsigned char *out, unsigned long outlen, prng_state *prng) { LTC_ARGCHK(out != NULL); + LTC_UNUSED_PARAM(prng); return rng_get_bytes(out, outlen, NULL); } @@ -87,6 +93,7 @@ unsigned long sprng_read(unsigned char *out, unsigned long outlen, prng_state *p */ int sprng_done(prng_state *prng) { + LTC_UNUSED_PARAM(prng); return CRYPT_OK; } @@ -100,6 +107,8 @@ int sprng_done(prng_state *prng) int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { LTC_ARGCHK(outlen != NULL); + LTC_UNUSED_PARAM(out); + LTC_UNUSED_PARAM(prng); *outlen = 0; return CRYPT_OK; @@ -114,6 +123,9 @@ int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) */ int sprng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { + LTC_UNUSED_PARAM(in); + LTC_UNUSED_PARAM(inlen); + LTC_UNUSED_PARAM(prng); return CRYPT_OK; } From 47b8ccc07c0999947ec17c963276d384dcf1f62b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Aug 2014 17:42:10 +0200 Subject: [PATCH 0249/1192] fix hash ID's of ripemd 256 & 320 --- src/hashes/rmd256.c | 2 +- src/hashes/rmd320.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hashes/rmd256.c b/src/hashes/rmd256.c index 0188bf740..cbfadcc28 100644 --- a/src/hashes/rmd256.c +++ b/src/hashes/rmd256.c @@ -20,7 +20,7 @@ const struct ltc_hash_descriptor rmd256_desc = { "rmd256", - 8, + 13, 32, 64, diff --git a/src/hashes/rmd320.c b/src/hashes/rmd320.c index 858d7bbea..26119f98c 100644 --- a/src/hashes/rmd320.c +++ b/src/hashes/rmd320.c @@ -20,11 +20,12 @@ const struct ltc_hash_descriptor rmd320_desc = { "rmd320", - 9, + 14, 40, 64, - /* OID */ + /* OID ... does not exist + * http://oid-info.com/get/1.3.36.3.2 */ { 0 }, 0, From 14272976d0615b546e9e0215ec4e2f01854a2dc9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 27 Aug 2014 18:20:47 +0200 Subject: [PATCH 0250/1192] add release flag to makefile.shared --- makefile.shared | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makefile.shared b/makefile.shared index 734506cce..f54ecb057 100644 --- a/makefile.shared +++ b/makefile.shared @@ -6,7 +6,10 @@ # Tom St Denis # The version +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION=0:117 +# http://www.gnu.org/software/libtool/manual/html_node/Release-numbers.html +RELEASE=1.17 # Compiler and Linker Names ifeq ($(CC),cc) @@ -266,7 +269,7 @@ testprof/$(LIBTEST): $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< $(LIBNAME): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) -release $(RELEASE) install: $(LIBNAME) install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) From 394806cab19f8d746b1aeb8b1fb6fda2eb68c00d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Aug 2014 13:27:52 +0200 Subject: [PATCH 0251/1192] tests: use correct format string parameter for 64bit values on windows --- testprof/tomcrypt_test.h | 6 ++++ testprof/x86_prof.c | 64 ++++++++++++++++++++-------------------- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index ef662d1fc..f4d1c60ae 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -101,6 +101,12 @@ void time_encmacs(void); +#if defined(_WIN32) + #define PRI64 "I64d" +#else + #define PRI64 "ll" +#endif + #endif /* $Source$ */ diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 70b130a54..c60aa8201 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -803,7 +803,7 @@ void time_mult(void) t1 = (t_read() - t1)>>1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "%4lu bits: %9llu cycles\n", x*MP_DIGIT_BIT, t2); + fprintf(stderr, "%4lu bits: %9"PRI64"u cycles\n", x*MP_DIGIT_BIT, t2); } mp_clear_multi(a,b,c,NULL); @@ -833,7 +833,7 @@ void time_sqr(void) t1 = (t_read() - t1)>>1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "%4lu bits: %9llu cycles\n", x*MP_DIGIT_BIT, t2); + fprintf(stderr, "%4lu bits: %9"PRI64"u cycles\n", x*MP_DIGIT_BIT, t2); } mp_clear_multi(a,b,NULL); @@ -877,7 +877,7 @@ void time_prng(void) t1 = (t_read() - t1)>>1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "%20s: %5llu ", prng_descriptor[x].name, t2>>12); + fprintf(stderr, "%20s: %5"PRI64"u ", prng_descriptor[x].name, t2>>12); #undef DO2 #undef DO1 @@ -890,7 +890,7 @@ void time_prng(void) t1 = (t_read() - t1)>>1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "%5llu\n", t2); + fprintf(stderr, "%5"PRI64"u\n", t2); #undef DO2 #undef DO1 @@ -936,7 +936,7 @@ static const struct { } } t2 >>= 2; - fprintf(stderr, "DSA-(%lu, %lu) make_key took %15llu cycles\n", (unsigned long)groups[x].group*8, (unsigned long)groups[x].modulus*8, t2); + fprintf(stderr, "DSA-(%lu, %lu) make_key took %15"PRI64"u cycles\n", (unsigned long)groups[x].group*8, (unsigned long)groups[x].modulus*8, t2); } } #endif @@ -974,7 +974,7 @@ void time_rsa(void) } } t2 >>= 2; - fprintf(stderr, "RSA-%lu make_key took %15llu cycles\n", x, t2); + fprintf(stderr, "RSA-%lu make_key took %15"PRI64"u cycles\n", x, t2); t2 = 0; for (y = 0; y < 16; y++) { @@ -995,7 +995,7 @@ void time_rsa(void) #endif } t2 >>= 4; - fprintf(stderr, "RSA-%lu encrypt_key took %15llu cycles\n", x, t2); + fprintf(stderr, "RSA-%lu encrypt_key took %15"PRI64"u cycles\n", x, t2); t2 = 0; for (y = 0; y < 2048; y++) { @@ -1015,7 +1015,7 @@ void time_rsa(void) #endif } t2 >>= 11; - fprintf(stderr, "RSA-%lu decrypt_key took %15llu cycles\n", x, t2); + fprintf(stderr, "RSA-%lu decrypt_key took %15"PRI64"u cycles\n", x, t2); t2 = 0; for (y = 0; y < 256; y++) { @@ -1035,7 +1035,7 @@ void time_rsa(void) #endif } t2 >>= 8; - fprintf(stderr, "RSA-%lu sign_hash took %15llu cycles\n", x, t2); + fprintf(stderr, "RSA-%lu sign_hash took %15"PRI64"u cycles\n", x, t2); t2 = 0; for (y = 0; y < 2048; y++) { @@ -1057,7 +1057,7 @@ void time_rsa(void) #endif } t2 >>= 11; - fprintf(stderr, "RSA-%lu verify_hash took %15llu cycles\n", x, t2); + fprintf(stderr, "RSA-%lu verify_hash took %15"PRI64"u cycles\n", x, t2); fprintf(stderr, "\n\n"); rsa_free(&key); } @@ -1066,7 +1066,7 @@ void time_rsa(void) void time_rsa(void) { fprintf(stderr, "NO RSA\n"); } #endif -#ifdef MKAT +#ifdef LTC_MKAT /* time various KAT operations */ void time_katja(void) { @@ -1093,7 +1093,7 @@ void time_katja(void) } } t2 >>= 2; - fprintf(stderr, "Katja-%lu make_key took %15llu cycles\n", x, t2); + fprintf(stderr, "Katja-%lu make_key took %15"PRI64"u cycles\n", x, t2); t2 = 0; for (y = 0; y < 16; y++) { @@ -1110,7 +1110,7 @@ void time_katja(void) t2 += t1; } t2 >>= 4; - fprintf(stderr, "Katja-%lu encrypt_key took %15llu cycles\n", x, t2); + fprintf(stderr, "Katja-%lu encrypt_key took %15"PRI64"u cycles\n", x, t2); t2 = 0; for (y = 0; y < 2048; y++) { @@ -1126,7 +1126,7 @@ void time_katja(void) t2 += t1; } t2 >>= 11; - fprintf(stderr, "Katja-%lu decrypt_key took %15llu cycles\n", x, t2); + fprintf(stderr, "Katja-%lu decrypt_key took %15"PRI64"u cycles\n", x, t2); katja_free(&key); @@ -1194,7 +1194,7 @@ void time_ecc(void) } } t2 >>= 8; - fprintf(stderr, "ECC-%lu make_key took %15llu cycles\n", x*8, t2); + fprintf(stderr, "ECC-%lu make_key took %15"PRI64"u cycles\n", x*8, t2); t2 = 0; for (y = 0; y < 256; y++) { @@ -1214,7 +1214,7 @@ void time_ecc(void) #endif } t2 >>= 8; - fprintf(stderr, "ECC-%lu encrypt_key took %15llu cycles\n", x*8, t2); + fprintf(stderr, "ECC-%lu encrypt_key took %15"PRI64"u cycles\n", x*8, t2); t2 = 0; for (y = 0; y < 256; y++) { @@ -1233,7 +1233,7 @@ void time_ecc(void) #endif } t2 >>= 8; - fprintf(stderr, "ECC-%lu decrypt_key took %15llu cycles\n", x*8, t2); + fprintf(stderr, "ECC-%lu decrypt_key took %15"PRI64"u cycles\n", x*8, t2); t2 = 0; for (y = 0; y < 256; y++) { @@ -1253,7 +1253,7 @@ void time_ecc(void) #endif } t2 >>= 8; - fprintf(stderr, "ECC-%lu sign_hash took %15llu cycles\n", x*8, t2); + fprintf(stderr, "ECC-%lu sign_hash took %15"PRI64"u cycles\n", x*8, t2); t2 = 0; for (y = 0; y < 256; y++) { @@ -1275,7 +1275,7 @@ void time_ecc(void) #endif } t2 >>= 8; - fprintf(stderr, "ECC-%lu verify_hash took %15llu cycles\n", x*8, t2); + fprintf(stderr, "ECC-%lu verify_hash took %15"PRI64"u cycles\n", x*8, t2); fprintf(stderr, "\n\n"); ecc_free(&key); @@ -1324,7 +1324,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "OMAC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "OMAC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_XCBC @@ -1340,7 +1340,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "XCBC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "XCBC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_F9_MODE @@ -1356,7 +1356,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "F9-%s\t\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "F9-%s\t\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_PMAC @@ -1372,7 +1372,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "PMAC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "PMAC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_PELICAN @@ -1388,7 +1388,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "PELICAN \t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "PELICAN \t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_HMAC @@ -1404,7 +1404,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "HMAC-%s\t\t%9llu\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "HMAC-%s\t\t%9"PRI64"u\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif XFREE(buf); @@ -1452,7 +1452,7 @@ void time_encmacs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "EAX \t\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "EAX \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_OCB_MODE @@ -1468,7 +1468,7 @@ void time_encmacs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "OCB \t\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "OCB \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_OCB3_MODE @@ -1484,7 +1484,7 @@ void time_encmacs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "OCB3 \t\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "OCB3 \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_CCM_MODE @@ -1500,7 +1500,7 @@ void time_encmacs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "CCM (no-precomp) \t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "CCM (no-precomp) \t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); cipher_descriptor[cipher_idx].setup(key, 16, 0, &skey); t2 = -1; @@ -1515,7 +1515,7 @@ void time_encmacs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "CCM (precomp) \t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "CCM (precomp) \t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); cipher_descriptor[cipher_idx].done(&skey); #endif @@ -1532,7 +1532,7 @@ void time_encmacs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "GCM (no-precomp)\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "GCM (no-precomp)\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); { gcm_state gcm @@ -1571,7 +1571,7 @@ __attribute__ ((aligned (16))) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "GCM (precomp)\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "GCM (precomp)\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); } #endif From b2317279b8140912a95f434bc162fd14eb9cde42 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 4 Aug 2014 16:40:50 +0200 Subject: [PATCH 0252/1192] add original RSA testvector files --- notes/rsa-testvectors/oaep-int.txt | 369 + notes/rsa-testvectors/oaep-vect.txt | 2212 ++++ .../rsa-testvectors/pkcs1v15crypt-vectors.txt | 9708 +++++++++++++++++ .../rsa-testvectors/pkcs1v15sign-vectors.txt | 9049 +++++++++++++++ notes/rsa-testvectors/pss-int.txt | 162 + notes/rsa-testvectors/pss-vect.txt | 2581 +++++ notes/rsa-testvectors/readme.txt | 22 + 7 files changed, 24103 insertions(+) create mode 100755 notes/rsa-testvectors/oaep-int.txt create mode 100755 notes/rsa-testvectors/oaep-vect.txt create mode 100755 notes/rsa-testvectors/pkcs1v15crypt-vectors.txt create mode 100755 notes/rsa-testvectors/pkcs1v15sign-vectors.txt create mode 100755 notes/rsa-testvectors/pss-int.txt create mode 100755 notes/rsa-testvectors/pss-vect.txt create mode 100755 notes/rsa-testvectors/readme.txt diff --git a/notes/rsa-testvectors/oaep-int.txt b/notes/rsa-testvectors/oaep-int.txt new file mode 100755 index 000000000..b76b5dd72 --- /dev/null +++ b/notes/rsa-testvectors/oaep-int.txt @@ -0,0 +1,369 @@ +# ================================= +# WORKED-OUT EXAMPLE FOR RSAES-OAEP +# ================================= +# +# This file gives an example of the process of +# encrypting and decrypting a message with +# RSAES-OAEP as specified in PKCS #1 v2.1. +# +# The message is a bit string of length 128, +# while the size of the modulus in the public +# key is 1024 bits. The second representation +# of the private key is used, which means that +# CRT is applied in the decryption process. +# +# The underlying hash function is SHA-1; the +# mask generation function is MGF1 with SHA-1 +# as specified in PKCS #1 v2.1. +# +# This file also contains a demonstration of +# the RSADP decryption primitive with CRT. +# Finally, DER encodings of the RSA keys are +# given at the end of the file. +# +# +# Integers are represented by strings of octets +# with the leftmost octet being the most +# significant octet. For example, +# +# 9,202,000 = (0x)8c 69 50. +# +# ============================================= + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +bb f8 2f 09 06 82 ce 9c 23 38 ac 2b 9d a8 71 f7 +36 8d 07 ee d4 10 43 a4 40 d6 b6 f0 74 54 f5 1f +b8 df ba af 03 5c 02 ab 61 ea 48 ce eb 6f cd 48 +76 ed 52 0d 60 e1 ec 46 19 71 9d 8a 5b 8b 80 7f +af b8 e0 a3 df c7 37 72 3e e6 b4 b7 d9 3a 25 84 +ee 6a 64 9d 06 09 53 74 88 34 b2 45 45 98 39 4e +e0 aa b1 2d 7b 61 a5 1f 52 7a 9a 41 f6 c1 68 7f +e2 53 72 98 ca 2a 8f 59 46 f8 e5 fd 09 1d bd cb + +# RSA public exponent e: +(0x)11 + +# Prime p: +ee cf ae 81 b1 b9 b3 c9 08 81 0b 10 a1 b5 60 01 +99 eb 9f 44 ae f4 fd a4 93 b8 1a 9e 3d 84 f6 32 +12 4e f0 23 6e 5d 1e 3b 7e 28 fa e7 aa 04 0a 2d +5b 25 21 76 45 9d 1f 39 75 41 ba 2a 58 fb 65 99 + +# Prime q: +c9 7f b1 f0 27 f4 53 f6 34 12 33 ea aa d1 d9 35 +3f 6c 42 d0 88 66 b1 d0 5a 0f 20 35 02 8b 9d 86 +98 40 b4 16 66 b4 2e 92 ea 0d a3 b4 32 04 b5 cf +ce 33 52 52 4d 04 16 a5 a4 41 e7 00 af 46 15 03 + +# p's CRT exponent dP: +54 49 4c a6 3e ba 03 37 e4 e2 40 23 fc d6 9a 5a +eb 07 dd dc 01 83 a4 d0 ac 9b 54 b0 51 f2 b1 3e +d9 49 09 75 ea b7 74 14 ff 59 c1 f7 69 2e 9a 2e +20 2b 38 fc 91 0a 47 41 74 ad c9 3c 1f 67 c9 81 + +# q's CRT exponent dQ: +47 1e 02 90 ff 0a f0 75 03 51 b7 f8 78 86 4c a9 +61 ad bd 3a 8a 7e 99 1c 5c 05 56 a9 4c 31 46 a7 +f9 80 3f 8f 6f 8a e3 42 e9 31 fd 8a e4 7a 22 0d +1b 99 a4 95 84 98 07 fe 39 f9 24 5a 98 36 da 3d + +# CRT coefficient qInv: +b0 6c 4f da bb 63 01 19 8d 26 5b db ae 94 23 b3 +80 f2 71 f7 34 53 88 50 93 07 7f cd 39 e2 11 9f +c9 86 32 15 4f 58 83 b1 67 a9 67 bf 40 2b 4e 9e +2e 0f 96 56 e6 98 ea 36 66 ed fb 25 79 80 39 f7 + +# ---------------------------------- +# Step-by-step RSAES-OAEP Encryption +# ---------------------------------- + +# Message M to be encrypted: +d4 36 e9 95 69 fd 32 a7 c8 a0 5b bc 90 d3 2c 49 + +# Label L: +(the empty string) + +# lHash = Hash(L) +# DB = lHash || Padding || M +# seed = random string of octets +# dbMask = MGF(seed, length(DB)) +# maskedDB = DB xor dbMask +# seedMask = MGF(maskedDB, length(seed)) +# maskedSeed = seed xor seedMask +# EM = 0x00 || maskedSeed || maskedDB + +# lHash: +da 39 a3 ee 5e 6b 4b 0d 32 55 bf ef 95 60 18 90 +af d8 07 09 + +# DB: +da 39 a3 ee 5e 6b 4b 0d 32 55 bf ef 95 60 18 90 +af d8 07 09 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 01 d4 36 e9 95 69 +fd 32 a7 c8 a0 5b bc 90 d3 2c 49 + +# seed: +aa fd 12 f6 59 ca e6 34 89 b4 79 e5 07 6d de c2 +f0 6c b5 8f + +# dbMask: +06 e1 de b2 36 9a a5 a5 c7 07 d8 2c 8e 4e 93 24 +8a c7 83 de e0 b2 c0 46 26 f5 af f9 3e dc fb 25 +c9 c2 b3 ff 8a e1 0e 83 9a 2d db 4c dc fe 4f f4 +77 28 b4 a1 b7 c1 36 2b aa d2 9a b4 8d 28 69 d5 +02 41 21 43 58 11 59 1b e3 92 f9 82 fb 3e 87 d0 +95 ae b4 04 48 db 97 2f 3a c1 4e af f4 9c 8c 3b +7c fc 95 1a 51 ec d1 dd e6 12 64 + +# maskedDB: +dc d8 7d 5c 68 f1 ee a8 f5 52 67 c3 1b 2e 8b b4 +25 1f 84 d7 e0 b2 c0 46 26 f5 af f9 3e dc fb 25 +c9 c2 b3 ff 8a e1 0e 83 9a 2d db 4c dc fe 4f f4 +77 28 b4 a1 b7 c1 36 2b aa d2 9a b4 8d 28 69 d5 +02 41 21 43 58 11 59 1b e3 92 f9 82 fb 3e 87 d0 +95 ae b4 04 48 db 97 2f 3a c1 4f 7b c2 75 19 52 +81 ce 32 d2 f1 b7 6d 4d 35 3e 2d + +# seedMask: +41 87 0b 5a b0 29 e6 57 d9 57 50 b5 4c 28 3c 08 +72 5d be a9 + +# maskedSeed: +eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2 ca +82 31 0b 26 + +# EM = 00 || maskedSeed || maskedDB: +00 eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2 +ca 82 31 0b 26 dc d8 7d 5c 68 f1 ee a8 f5 52 67 +c3 1b 2e 8b b4 25 1f 84 d7 e0 b2 c0 46 26 f5 af +f9 3e dc fb 25 c9 c2 b3 ff 8a e1 0e 83 9a 2d db +4c dc fe 4f f4 77 28 b4 a1 b7 c1 36 2b aa d2 9a +b4 8d 28 69 d5 02 41 21 43 58 11 59 1b e3 92 f9 +82 fb 3e 87 d0 95 ae b4 04 48 db 97 2f 3a c1 4f +7b c2 75 19 52 81 ce 32 d2 f1 b7 6d 4d 35 3e 2d + +# Ciphertext, the RSA encryption of EM: +12 53 e0 4d c0 a5 39 7b b4 4a 7a b8 7e 9b f2 a0 +39 a3 3d 1e 99 6f c8 2a 94 cc d3 00 74 c9 5d f7 +63 72 20 17 06 9e 52 68 da 5d 1c 0b 4f 87 2c f6 +53 c1 1d f8 23 14 a6 79 68 df ea e2 8d ef 04 bb +6d 84 b1 c3 1d 65 4a 19 70 e5 78 3b d6 eb 96 a0 +24 c2 ca 2f 4a 90 fe 9f 2e f5 c9 c1 40 e5 bb 48 +da 95 36 ad 87 00 c8 4f c9 13 0a de a7 4e 55 8d +51 a7 4d df 85 d8 b5 0d e9 68 38 d6 06 3e 09 55 + +# -------------------------------------------- +# Step-by-step RSAES-OAEP Decryption Using CRT +# -------------------------------------------- + +# c = the integer value of C above +# m1 = c^dP mod p = (c mod p)^dP mod p +# m2 = c^dQ mod q = (c mod q)^dQ mod q +# h = (m1-m2)*qInv mod p +# m = m2 + q*h = the integer value of EM above + +# c mod p: +de 63 d4 72 35 66 fa a7 59 bf e4 08 82 1d d5 25 +72 ec 92 85 4d df 87 a2 b6 64 d4 4d aa 37 ca 34 +6a 05 20 3d 82 ff 2d e8 e3 6c ec 1d 34 f9 8e b6 +05 e2 a7 d2 6d e7 af 36 9c e4 ec ae 14 e3 56 33 + +# c mod q: +a2 d9 24 de d9 c3 6d 62 3e d9 a6 5b 5d 86 2c fb +ec 8b 19 9c 64 27 9c 54 14 e6 41 19 6e f1 c9 3c +50 7a 9b 52 13 88 1a ad 05 b4 cc fa 02 8a c1 ec +61 42 09 74 bf 16 25 83 6b 0b 7d 05 fb b7 53 36 + +# m1: +89 6c a2 6c d7 e4 87 1c 7f c9 68 a8 ed ea 11 e2 +71 82 4f 0e 03 65 52 17 94 f1 e9 e9 43 b4 a4 4b +57 c9 e3 95 a1 46 74 78 f5 26 49 6b 4b b9 1f 1c +ba ea 90 0f fc 60 2c f0 c6 63 6e ba 84 fc 9f f7 + +# m2: +4e bb 22 75 85 f0 c1 31 2d ca 19 e0 b5 41 db 14 +99 fb f1 4e 27 0e 69 8e 23 9a 8c 27 a9 6c da 9a +74 09 74 de 93 7b 5c 9c 93 ea d9 46 2c 65 75 02 +1a 23 d4 64 99 dc 9f 6b 35 89 75 59 60 8f 19 be + +# h: +01 2b 2b 24 15 0e 76 e1 59 bd 8d db 42 76 e0 7b +fa c1 88 e0 8d 60 47 cf 0e fb 8a e2 ae bd f2 51 +c4 0e bc 23 dc fd 4a 34 42 43 94 ad a9 2c fc be +1b 2e ff bb 60 fd fb 03 35 9a 95 36 8d 98 09 25 + +# m: +00 eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2 +ca 82 31 0b 26 dc d8 7d 5c 68 f1 ee a8 f5 52 67 +c3 1b 2e 8b b4 25 1f 84 d7 e0 b2 c0 46 26 f5 af +f9 3e dc fb 25 c9 c2 b3 ff 8a e1 0e 83 9a 2d db +4c dc fe 4f f4 77 28 b4 a1 b7 c1 36 2b aa d2 9a +b4 8d 28 69 d5 02 41 21 43 58 11 59 1b e3 92 f9 +82 fb 3e 87 d0 95 ae b4 04 48 db 97 2f 3a c1 4f +7b c2 75 19 52 81 ce 32 d2 f1 b7 6d 4d 35 3e 2d + +# The intermediate values in the remaining +# decryption process are the same as during +# RSAES-OAEP encryption of M. + +# ============================================= + +# ======================== +# DER Encoding of RSA Keys +# ======================== + +# ------------ +# RSAPublicKey +# ------------ +30 81 87 +# modulus + 02 81 81 + 00 bb f8 2f 09 06 82 ce + 9c 23 38 ac 2b 9d a8 71 + f7 36 8d 07 ee d4 10 43 + a4 40 d6 b6 f0 74 54 f5 + 1f b8 df ba af 03 5c 02 + ab 61 ea 48 ce eb 6f cd + 48 76 ed 52 0d 60 e1 ec + 46 19 71 9d 8a 5b 8b 80 + 7f af b8 e0 a3 df c7 37 + 72 3e e6 b4 b7 d9 3a 25 + 84 ee 6a 64 9d 06 09 53 + 74 88 34 b2 45 45 98 39 + 4e e0 aa b1 2d 7b 61 a5 + 1f 52 7a 9a 41 f6 c1 68 + 7f e2 53 72 98 ca 2a 8f + 59 46 f8 e5 fd 09 1d bd + cb +# publicExponent + 02 01 + 11 + +# ------------- +# RSAPrivateKey +# ------------- +30 82 02 5b +# version + 02 01 + 00 +# modulus + 02 81 81 + 00 bb f8 2f 09 06 82 ce + 9c 23 38 ac 2b 9d a8 71 + f7 36 8d 07 ee d4 10 43 + a4 40 d6 b6 f0 74 54 f5 + 1f b8 df ba af 03 5c 02 + ab 61 ea 48 ce eb 6f cd + 48 76 ed 52 0d 60 e1 ec + 46 19 71 9d 8a 5b 8b 80 + 7f af b8 e0 a3 df c7 37 + 72 3e e6 b4 b7 d9 3a 25 + 84 ee 6a 64 9d 06 09 53 + 74 88 34 b2 45 45 98 39 + 4e e0 aa b1 2d 7b 61 a5 + 1f 52 7a 9a 41 f6 c1 68 + 7f e2 53 72 98 ca 2a 8f + 59 46 f8 e5 fd 09 1d bd + cb +# publicExponent + 02 01 + 11 +# privateExponent + 02 81 81 + 00 a5 da fc 53 41 fa f2 + 89 c4 b9 88 db 30 c1 cd + f8 3f 31 25 1e 06 68 b4 + 27 84 81 38 01 57 96 41 + b2 94 10 b3 c7 99 8d 6b + c4 65 74 5e 5c 39 26 69 + d6 87 0d a2 c0 82 a9 39 + e3 7f dc b8 2e c9 3e da + c9 7f f3 ad 59 50 ac cf + bc 11 1c 76 f1 a9 52 94 + 44 e5 6a af 68 c5 6c 09 + 2c d3 8d c3 be f5 d2 0a + 93 99 26 ed 4f 74 a1 3e + dd fb e1 a1 ce cc 48 94 + af 94 28 c2 b7 b8 88 3f + e4 46 3a 4b c8 5b 1c b3 + c1 +# prime1 + 02 41 + 00 ee cf ae 81 b1 b9 b3 + c9 08 81 0b 10 a1 b5 60 + 01 99 eb 9f 44 ae f4 fd + a4 93 b8 1a 9e 3d 84 f6 + 32 12 4e f0 23 6e 5d 1e + 3b 7e 28 fa e7 aa 04 0a + 2d 5b 25 21 76 45 9d 1f + 39 75 41 ba 2a 58 fb 65 + 99 +# prime2 + 02 41 + 00 c9 7f b1 f0 27 f4 53 + f6 34 12 33 ea aa d1 d9 + 35 3f 6c 42 d0 88 66 b1 + d0 5a 0f 20 35 02 8b 9d + 86 98 40 b4 16 66 b4 2e + 92 ea 0d a3 b4 32 04 b5 + cf ce 33 52 52 4d 04 16 + a5 a4 41 e7 00 af 46 15 + 03 +# exponent1 + 02 40 + 54 49 4c a6 3e ba 03 37 + e4 e2 40 23 fc d6 9a 5a + eb 07 dd dc 01 83 a4 d0 + ac 9b 54 b0 51 f2 b1 3e + d9 49 09 75 ea b7 74 14 + ff 59 c1 f7 69 2e 9a 2e + 20 2b 38 fc 91 0a 47 41 + 74 ad c9 3c 1f 67 c9 81 +# exponent2 + 02 40 + 47 1e 02 90 ff 0a f0 75 + 03 51 b7 f8 78 86 4c a9 + 61 ad bd 3a 8a 7e 99 1c + 5c 05 56 a9 4c 31 46 a7 + f9 80 3f 8f 6f 8a e3 42 + e9 31 fd 8a e4 7a 22 0d + 1b 99 a4 95 84 98 07 fe + 39 f9 24 5a 98 36 da 3d +# coefficient + 02 41 + 00 b0 6c 4f da bb 63 01 + 19 8d 26 5b db ae 94 23 + b3 80 f2 71 f7 34 53 88 + 50 93 07 7f cd 39 e2 11 + 9f c9 86 32 15 4f 58 83 + b1 67 a9 67 bf 40 2b 4e + 9e 2e 0f 96 56 e6 98 ea + 36 66 ed fb 25 79 80 39 + f7 + +# ------------------------ +# PrivateKeyInfo (PKCS #8) +# ------------------------ +30 82 02 75 +# version + 02 01 + 00 +# privateKeyAlgorithmIdentifier + 30 0d + 06 09 + 2a 86 48 86 f7 0d 01 01 01 +# parameters + 05 00 +# privateKey = RSAPrivateKey encoding + 04 82 02 5f +# DER encoding of RSAPrivateKey structure + 30 82 02 5b ... 79 80 39 f7 + +# ============================================= diff --git a/notes/rsa-testvectors/oaep-vect.txt b/notes/rsa-testvectors/oaep-vect.txt new file mode 100755 index 000000000..e92120ce5 --- /dev/null +++ b/notes/rsa-testvectors/oaep-vect.txt @@ -0,0 +1,2212 @@ +========================= +TEST VECTORS FOR RSA-OAEP +========================= + +# This file contains test vectors for the +# RSAES-OAEP encryption scheme as defined in +# PKCS #1 v2.1. 10 RSA keys of different sizes +# have been generated. For each key, 6 random +# messages of length between 1 and 64 octets +# have been RSAES-OAEP encrypted via a random +# seed of length 20 octets. +# +# The underlying hash function is SHA-1; the +# mask generation function is MGF1 with SHA-1 +# as specified in PKCS #1 v2.1. +# +# Integers are represented by strings of octets +# with the leftmost octet being the most +# significant octet. For example, +# +# 9,202,000 = (0x)8c 69 50. +# +# Key lengths: +# +# Key 1: 1024 bits +# Key 2: 1025 bits +# Key 3: 1026 bits +# Key 4: 1027 bits +# Key 5: 1028 bits +# Key 6: 1029 bits +# Key 7: 1030 bits +# Key 8: 1031 bits +# Key 9: 1536 bits +# Key 10: 2048 bits +# ============================================= + +# ================================== +# Example 1: A 1024-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +a8 b3 b2 84 af 8e b5 0b 38 70 34 a8 60 f1 46 c4 +91 9f 31 87 63 cd 6c 55 98 c8 ae 48 11 a1 e0 ab +c4 c7 e0 b0 82 d6 93 a5 e7 fc ed 67 5c f4 66 85 +12 77 2c 0c bc 64 a7 42 c6 c6 30 f5 33 c8 cc 72 +f6 2a e8 33 c4 0b f2 58 42 e9 84 bb 78 bd bf 97 +c0 10 7d 55 bd b6 62 f5 c4 e0 fa b9 84 5c b5 14 +8e f7 39 2d d3 aa ff 93 ae 1e 6b 66 7b b3 d4 24 +76 16 d4 f5 ba 10 d4 cf d2 26 de 88 d3 9f 16 fb + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +53 33 9c fd b7 9f c8 46 6a 65 5c 73 16 ac a8 5c +55 fd 8f 6d d8 98 fd af 11 95 17 ef 4f 52 e8 fd +8e 25 8d f9 3f ee 18 0f a0 e4 ab 29 69 3c d8 3b +15 2a 55 3d 4a c4 d1 81 2b 8b 9f a5 af 0e 7f 55 +fe 73 04 df 41 57 09 26 f3 31 1f 15 c4 d6 5a 73 +2c 48 31 16 ee 3d 3d 2d 0a f3 54 9a d9 bf 7c bf +b7 8a d8 84 f8 4d 5b eb 04 72 4d c7 36 9b 31 de +f3 7d 0c f5 39 e9 cf cd d3 de 65 37 29 ea d5 d1 + +# Prime p: +d3 27 37 e7 26 7f fe 13 41 b2 d5 c0 d1 50 a8 1b +58 6f b3 13 2b ed 2f 8d 52 62 86 4a 9c b9 f3 0a +f3 8b e4 48 59 8d 41 3a 17 2e fb 80 2c 21 ac f1 +c1 1c 52 0c 2f 26 a4 71 dc ad 21 2e ac 7c a3 9d + +# Prime q: +cc 88 53 d1 d5 4d a6 30 fa c0 04 f4 71 f2 81 c7 +b8 98 2d 82 24 a4 90 ed be b3 3d 3e 3d 5c c9 3c +47 65 70 3d 1d d7 91 64 2f 1f 11 6a 0d d8 52 be +24 19 b2 af 72 bf e9 a0 30 e8 60 b0 28 8b 5d 77 + +# p's CRT exponent dP: +0e 12 bf 17 18 e9 ce f5 59 9b a1 c3 88 2f e8 04 +6a 90 87 4e ef ce 8f 2c cc 20 e4 f2 74 1f b0 a3 +3a 38 48 ae c9 c9 30 5f be cb d2 d7 68 19 96 7d +46 71 ac c6 43 1e 40 37 96 8d b3 78 78 e6 95 c1 + +# q's CRT exponent dQ: +95 29 7b 0f 95 a2 fa 67 d0 07 07 d6 09 df d4 fc +05 c8 9d af c2 ef 6d 6e a5 5b ec 77 1e a3 33 73 +4d 92 51 e7 90 82 ec da 86 6e fe f1 3c 45 9e 1a +63 13 86 b7 e3 54 c8 99 f5 f1 12 ca 85 d7 15 83 + +# CRT coefficient qInv: +4f 45 6c 50 24 93 bd c0 ed 2a b7 56 a3 a6 ed 4d +67 35 2a 69 7d 42 16 e9 32 12 b1 27 a6 3d 54 11 +ce 6f a9 8d 5d be fd 73 26 3e 37 28 14 27 43 81 +81 66 ed 7d d6 36 87 dd 2a 8c a1 d2 f4 fb d8 e1 + +# --------------------------------- +# RSAES-OAEP Encryption Example 1.1 +# --------------------------------- + +# Message to be encrypted: +66 28 19 4e 12 07 3d b0 3b a9 4c da 9e f9 53 23 +97 d5 0d ba 79 b9 87 00 4a fe fe 34 + +# Seed: +18 b7 76 ea 21 06 9d 69 77 6a 33 e9 6b ad 48 e1 +dd a0 a5 ef + +# Encryption: +35 4f e6 7b 4a 12 6d 5d 35 fe 36 c7 77 79 1a 3f +7b a1 3d ef 48 4e 2d 39 08 af f7 22 fa d4 68 fb +21 69 6d e9 5d 0b e9 11 c2 d3 17 4f 8a fc c2 01 +03 5f 7b 6d 8e 69 40 2d e5 45 16 18 c2 1a 53 5f +a9 d7 bf c5 b8 dd 9f c2 43 f8 cf 92 7d b3 13 22 +d6 e8 81 ea a9 1a 99 61 70 e6 57 a0 5a 26 64 26 +d9 8c 88 00 3f 84 77 c1 22 70 94 a0 d9 fa 1e 8c +40 24 30 9c e1 ec cc b5 21 00 35 d4 7a c7 2e 8a + +# --------------------------------- +# RSAES-OAEP Encryption Example 1.2 +# --------------------------------- + +# Message to be encrypted: +75 0c 40 47 f5 47 e8 e4 14 11 85 65 23 29 8a c9 +ba e2 45 ef af 13 97 fb e5 6f 9d d5 + +# Seed: +0c c7 42 ce 4a 9b 7f 32 f9 51 bc b2 51 ef d9 25 +fe 4f e3 5f + +# Encryption: +64 0d b1 ac c5 8e 05 68 fe 54 07 e5 f9 b7 01 df +f8 c3 c9 1e 71 6c 53 6f c7 fc ec 6c b5 b7 1c 11 +65 98 8d 4a 27 9e 15 77 d7 30 fc 7a 29 93 2e 3f +00 c8 15 15 23 6d 8d 8e 31 01 7a 7a 09 df 43 52 +d9 04 cd eb 79 aa 58 3a dc c3 1e a6 98 a4 c0 52 +83 da ba 90 89 be 54 91 f6 7c 1a 4e e4 8d c7 4b +bb e6 64 3a ef 84 66 79 b4 cb 39 5a 35 2d 5e d1 +15 91 2d f6 96 ff e0 70 29 32 94 6d 71 49 2b 44 + +# --------------------------------- +# RSAES-OAEP Encryption Example 1.3 +# --------------------------------- + +# Message to be encrypted: +d9 4a e0 83 2e 64 45 ce 42 33 1c b0 6d 53 1a 82 +b1 db 4b aa d3 0f 74 6d c9 16 df 24 d4 e3 c2 45 +1f ff 59 a6 42 3e b0 e1 d0 2d 4f e6 46 cf 69 9d +fd 81 8c 6e 97 b0 51 + +# Seed: +25 14 df 46 95 75 5a 67 b2 88 ea f4 90 5c 36 ee +c6 6f d2 fd + +# Encryption: +42 37 36 ed 03 5f 60 26 af 27 6c 35 c0 b3 74 1b +36 5e 5f 76 ca 09 1b 4e 8c 29 e2 f0 be fe e6 03 +59 5a a8 32 2d 60 2d 2e 62 5e 95 eb 81 b2 f1 c9 +72 4e 82 2e ca 76 db 86 18 cf 09 c5 34 35 03 a4 +36 08 35 b5 90 3b c6 37 e3 87 9f b0 5e 0e f3 26 +85 d5 ae c5 06 7c d7 cc 96 fe 4b 26 70 b6 ea c3 +06 6b 1f cf 56 86 b6 85 89 aa fb 7d 62 9b 02 d8 +f8 62 5c a3 83 36 24 d4 80 0f b0 81 b1 cf 94 eb + +# --------------------------------- +# RSAES-OAEP Encryption Example 1.4 +# --------------------------------- + +# Message to be encrypted: +52 e6 50 d9 8e 7f 2a 04 8b 4f 86 85 21 53 b9 7e +01 dd 31 6f 34 6a 19 f6 7a 85 + +# Seed: +c4 43 5a 3e 1a 18 a6 8b 68 20 43 62 90 a3 7c ef +b8 5d b3 fb + +# Encryption: +45 ea d4 ca 55 1e 66 2c 98 00 f1 ac a8 28 3b 05 +25 e6 ab ae 30 be 4b 4a ba 76 2f a4 0f d3 d3 8e +22 ab ef c6 97 94 f6 eb bb c0 5d db b1 12 16 24 +7d 2f 41 2f d0 fb a8 7c 6e 3a cd 88 88 13 64 6f +d0 e4 8e 78 52 04 f9 c3 f7 3d 6d 82 39 56 27 22 +dd dd 87 71 fe c4 8b 83 a3 1e e6 f5 92 c4 cf d4 +bc 88 17 4f 3b 13 a1 12 aa e3 b9 f7 b8 0e 0f c6 +f7 25 5b a8 80 dc 7d 80 21 e2 2a d6 a8 5f 07 55 + +# --------------------------------- +# RSAES-OAEP Encryption Example 1.5 +# --------------------------------- + +# Message to be encrypted: +8d a8 9f d9 e5 f9 74 a2 9f ef fb 46 2b 49 18 0f +6c f9 e8 02 + +# Seed: +b3 18 c4 2d f3 be 0f 83 fe a8 23 f5 a7 b4 7e d5 +e4 25 a3 b5 + +# Encryption: +36 f6 e3 4d 94 a8 d3 4d aa cb a3 3a 21 39 d0 0a +d8 5a 93 45 a8 60 51 e7 30 71 62 00 56 b9 20 e2 +19 00 58 55 a2 13 a0 f2 38 97 cd cd 73 1b 45 25 +7c 77 7f e9 08 20 2b ef dd 0b 58 38 6b 12 44 ea +0c f5 39 a0 5d 5d 10 32 9d a4 4e 13 03 0f d7 60 +dc d6 44 cf ef 20 94 d1 91 0d 3f 43 3e 1c 7c 6d +d1 8b c1 f2 df 7f 64 3d 66 2f b9 dd 37 ea d9 05 +91 90 f4 fa 66 ca 39 e8 69 c4 eb 44 9c bd c4 39 + +# --------------------------------- +# RSAES-OAEP Encryption Example 1.6 +# --------------------------------- + +# Message to be encrypted: +26 52 10 50 84 42 71 + +# Seed: +e4 ec 09 82 c2 33 6f 3a 67 7f 6a 35 61 74 eb 0c +e8 87 ab c2 + +# Encryption: +42 ce e2 61 7b 1e ce a4 db 3f 48 29 38 6f bd 61 +da fb f0 38 e1 80 d8 37 c9 63 66 df 24 c0 97 b4 +ab 0f ac 6b df 59 0d 82 1c 9f 10 64 2e 68 1a d0 +5b 8d 78 b3 78 c0 f4 6c e2 fa d6 3f 74 e0 ad 3d +f0 6b 07 5d 7e b5 f5 63 6f 8d 40 3b 90 59 ca 76 +1b 5c 62 bb 52 aa 45 00 2e a7 0b aa ce 08 de d2 +43 b9 d8 cb d6 2a 68 ad e2 65 83 2b 56 56 4e 43 +a6 fa 42 ed 19 9a 09 97 69 74 2d f1 53 9e 82 55 + +# ============================================= + +# ================================== +# Example 2: A 1025-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +01 94 7c 7f ce 90 42 5f 47 27 9e 70 85 1f 25 d5 +e6 23 16 fe 8a 1d f1 93 71 e3 e6 28 e2 60 54 3e +49 01 ef 60 81 f6 8c 0b 81 41 19 0d 2a e8 da ba +7d 12 50 ec 6d b6 36 e9 44 ec 37 22 87 7c 7c 1d +0a 67 f1 4b 16 94 c5 f0 37 94 51 a4 3e 49 a3 2d +de 83 67 0b 73 da 91 a1 c9 9b c2 3b 43 6a 60 05 +5c 61 0f 0b af 99 c1 a0 79 56 5b 95 a3 f1 52 66 +32 d1 d4 da 60 f2 0e da 25 e6 53 c4 f0 02 76 6f +45 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +08 23 f2 0f ad b5 da 89 08 8a 9d 00 89 3e 21 fa +4a 1b 11 fb c9 3c 64 a3 be 0b aa ea 97 fb 3b 93 +c3 ff 71 37 04 c1 9c 96 3c 1d 10 7a ae 99 05 47 +39 f7 9e 02 e1 86 de 86 f8 7a 6d de fe a6 d8 cc +d1 d3 c8 1a 47 bf a7 25 5b e2 06 01 a4 a4 b2 f0 +8a 16 7b 5e 27 9d 71 5b 1b 45 5b dd 7e ab 24 59 +41 d9 76 8b 9a ce fb 3c cd a5 95 2d a3 ce e7 25 +25 b4 50 16 63 a8 ee 15 c9 e9 92 d9 24 62 fe 39 + +# Prime p: +01 59 db de 04 a3 3e f0 6f b6 08 b8 0b 19 0f 4d +3e 22 bc c1 3a c8 e4 a0 81 03 3a bf a4 16 ed b0 +b3 38 aa 08 b5 73 09 ea 5a 52 40 e7 dc 6e 54 37 +8c 69 41 4c 31 d9 7d db 1f 40 6d b3 76 9c c4 1a +43 + +# Prime q: +01 2b 65 2f 30 40 3b 38 b4 09 95 fd 6f f4 1a 1a +cc 8a da 70 37 32 36 b7 20 2d 39 b2 ee 30 cf b4 +6d b0 95 11 f6 f3 07 cc 61 cc 21 60 6c 18 a7 5b +8a 62 f8 22 df 03 1b a0 df 0d af d5 50 6f 56 8b +d7 + +# p's CRT exponent dP: +43 6e f5 08 de 73 65 19 c2 da 4c 58 0d 98 c8 2c +b7 45 2a 3f b5 ef ad c3 b9 c7 78 9a 1b c6 58 4f +79 5a dd bb d3 24 39 c7 46 86 55 2e cb 6c 2c 30 +7a 4d 3a f7 f5 39 ee c1 57 24 8c 7b 31 f1 a2 55 + +# q's CRT exponent dQ: +01 2b 15 a8 9f 3d fb 2b 39 07 3e 73 f0 2b dd 0c +1a 7b 37 9d d4 35 f0 5c dd e2 ef f9 e4 62 94 8b +7c ec 62 ee 90 50 d5 e0 81 6e 07 85 a8 56 b4 91 +08 dc b7 5f 36 83 87 4d 1c a6 32 9a 19 01 30 66 +ff + +# CRT coefficient qInv: +02 70 db 17 d5 91 4b 01 8d 76 11 8b 24 38 9a 73 +50 ec 83 6b 00 63 a2 17 21 23 6f d8 ed b6 d8 9b +51 e7 ee b8 7b 61 1b 71 32 cb 7e a7 35 6c 23 15 +1c 1e 77 51 50 7c 78 6d 9e e1 79 41 70 a8 c8 e8 + +# --------------------------------- +# RSAES-OAEP Encryption Example 2.1 +# --------------------------------- + +# Message to be encrypted: +8f f0 0c aa 60 5c 70 28 30 63 4d 9a 6c 3d 42 c6 +52 b5 8c f1 d9 2f ec 57 0b ee e7 + +# Seed: +8c 40 7b 5e c2 89 9e 50 99 c5 3e 8c e7 93 bf 94 +e7 1b 17 82 + +# Encryption: +01 81 af 89 22 b9 fc b4 d7 9d 92 eb e1 98 15 99 +2f c0 c1 43 9d 8b cd 49 13 98 a0 f4 ad 3a 32 9a +5b d9 38 55 60 db 53 26 83 c8 b7 da 04 e4 b1 2a +ed 6a ac df 47 1c 34 c9 cd a8 91 ad dc c2 df 34 +56 65 3a a6 38 2e 9a e5 9b 54 45 52 57 eb 09 9d +56 2b be 10 45 3f 2b 6d 13 c5 9c 02 e1 0f 1f 8a +bb 5d a0 d0 57 09 32 da cf 2d 09 01 db 72 9d 0f +ef cc 05 4e 70 96 8e a5 40 c8 1b 04 bc ae fe 72 +0e + +# --------------------------------- +# RSAES-OAEP Encryption Example 2.2 +# --------------------------------- + +# Message to be encrypted: +2d + +# Seed: +b6 00 cf 3c 2e 50 6d 7f 16 77 8c 91 0d 3a 8b 00 +3e ee 61 d5 + +# Encryption: +01 87 59 ff 1d f6 3b 27 92 41 05 62 31 44 16 a8 +ae af 2a c6 34 b4 6f 94 0a b8 2d 64 db f1 65 ee +e3 30 11 da 74 9d 4b ab 6e 2f cd 18 12 9c 9e 49 +27 7d 84 53 11 2b 42 9a 22 2a 84 71 b0 70 99 39 +98 e7 58 86 1c 4d 3f 6d 74 9d 91 c4 29 0d 33 2c +7a 4a b3 f7 ea 35 ff 3a 07 d4 97 c9 55 ff 0f fc +95 00 6b 62 c6 d2 96 81 0d 9b fa b0 24 19 6c 79 +34 01 2c 2d f9 78 ef 29 9a ba 23 99 40 cb a1 02 +45 + +# --------------------------------- +# RSAES-OAEP Encryption Example 2.3 +# --------------------------------- + +# Message to be encrypted: +74 fc 88 c5 1b c9 0f 77 af 9d 5e 9a 4a 70 13 3d +4b 4e 0b 34 da 3c 37 c7 ef 8e + +# Seed: +a7 37 68 ae ea a9 1f 9d 8c 1e d6 f9 d2 b6 34 67 +f0 7c ca e3 + +# Encryption: +01 88 02 ba b0 4c 60 32 5e 81 c4 96 23 11 f2 be +7c 2a dc e9 30 41 a0 07 19 c8 8f 95 75 75 f2 c7 +9f 1b 7b c8 ce d1 15 c7 06 b3 11 c0 8a 2d 98 6c +a3 b6 a9 33 6b 14 7c 29 c6 f2 29 40 9d de c6 51 +bd 1f dd 5a 0b 7f 61 0c 99 37 fd b4 a3 a7 62 36 +4b 8b 32 06 b4 ea 48 5f d0 98 d0 8f 63 d4 aa 8b +b2 69 7d 02 7b 75 0c 32 d7 f7 4e af 51 80 d2 e9 +b6 6b 17 cb 2f a5 55 23 bc 28 0d a1 0d 14 be 20 +53 + +# --------------------------------- +# RSAES-OAEP Encryption Example 2.4 +# --------------------------------- + +# Message to be encrypted: +a7 eb 2a 50 36 93 1d 27 d4 e8 91 32 6d 99 69 2f +fa dd a9 bf 7e fd 3e 34 e6 22 c4 ad c0 85 f7 21 +df e8 85 07 2c 78 a2 03 b1 51 73 9b e5 40 fa 8c +15 3a 10 f0 0a + +# Seed: +9a 7b 3b 0e 70 8b d9 6f 81 90 ec ab 4f b9 b2 b3 +80 5a 81 56 + +# Encryption: +00 a4 57 8c bc 17 63 18 a6 38 fb a7 d0 1d f1 57 +46 af 44 d4 f6 cd 96 d7 e7 c4 95 cb f4 25 b0 9c +64 9d 32 bf 88 6d a4 8f ba f9 89 a2 11 71 87 ca +fb 1f b5 80 31 76 90 e3 cc d4 46 92 0b 7a f8 2b +31 db 58 04 d8 7d 01 51 4a cb fa 91 56 e7 82 f8 +67 f6 be d9 44 9e 0e 9a 2c 09 bc ec c6 aa 08 76 +36 96 5e 34 b3 ec 76 6f 2f e2 e4 30 18 a2 fd de +b1 40 61 6a 0e 9d 82 e5 33 10 24 ee 06 52 fc 76 +41 + +# --------------------------------- +# RSAES-OAEP Encryption Example 2.5 +# --------------------------------- + +# Message to be encrypted: +2e f2 b0 66 f8 54 c3 3f 3b dc bb 59 94 a4 35 e7 +3d 6c 6c + +# Seed: +eb 3c eb bc 4a dc 16 bb 48 e8 8c 8a ec 0e 34 af +7f 42 7f d3 + +# Encryption: +00 eb c5 f5 fd a7 7c fd ad 3c 83 64 1a 90 25 e7 +7d 72 d8 a6 fb 33 a8 10 f5 95 0f 8d 74 c7 3e 8d +93 1e 86 34 d8 6a b1 24 62 56 ae 07 b6 00 5b 71 +b7 f2 fb 98 35 12 18 33 1c e6 9b 8f fb dc 9d a0 +8b bc 9c 70 4f 87 6d eb 9d f9 fc 2e c0 65 ca d8 +7f 90 90 b0 7a cc 17 aa 7f 99 7b 27 ac a4 88 06 +e8 97 f7 71 d9 51 41 fe 45 26 d8 a5 30 1b 67 86 +27 ef ab 70 7f d4 0f be bd 6e 79 2a 25 61 3e 7a +ec + +# --------------------------------- +# RSAES-OAEP Encryption Example 2.6 +# --------------------------------- + +# Message to be encrypted: +8a 7f b3 44 c8 b6 cb 2c f2 ef 1f 64 3f 9a 32 18 +f6 e1 9b ba 89 c0 + +# Seed: +4c 45 cf 4d 57 c9 8e 3d 6d 20 95 ad c5 1c 48 9e +b5 0d ff 84 + +# Encryption: +01 08 39 ec 20 c2 7b 90 52 e5 5b ef b9 b7 7e 6f +c2 6e 90 75 d7 a5 43 78 c6 46 ab df 51 e4 45 bd +57 15 de 81 78 9f 56 f1 80 3d 91 70 76 4a 9e 93 +cb 78 79 86 94 02 3e e7 39 3c e0 4b c5 d8 f8 c5 +a5 2c 17 1d 43 83 7e 3a ca 62 f6 09 eb 0a a5 ff +b0 96 0e f0 41 98 dd 75 4f 57 f7 fb e6 ab f7 65 +cf 11 8b 4c a4 43 b2 3b 5a ab 26 6f 95 23 26 ac +45 81 10 06 44 32 5f 8b 72 1a cd 5d 04 ff 14 ef +3a + +# ============================================= + +# ================================== +# Example 3: A 1026-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +02 b5 8f ec 03 9a 86 07 00 a4 d7 b6 46 2f 93 e6 +cd d4 91 16 1d dd 74 f4 e8 10 b4 0e 3c 16 52 00 +6a 5c 27 7b 27 74 c1 13 05 a4 cb ab 5a 78 ef a5 +7e 17 a8 6d f7 a3 fa 36 fc 4b 1d 22 49 f2 2e c7 +c2 dd 6a 46 32 32 ac ce a9 06 d6 6e be 80 b5 70 +4b 10 72 9d a6 f8 33 23 4a bb 5e fd d4 a2 92 cb +fa d3 3b 4d 33 fa 7a 14 b8 c3 97 b5 6e 3a cd 21 +20 34 28 b7 7c df a3 3a 6d a7 06 b3 d8 b0 fc 43 +e9 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +15 b4 8a 5b 56 83 a9 46 70 e2 3b 57 18 f8 14 fa +0e 13 f8 50 38 f5 07 11 18 2c ba 61 51 05 81 f3 +d2 2c 7e 23 2e f9 37 e2 2e 55 1d 68 b8 6e 2f 8c +b1 aa d8 be 2e 48 8f 5d f7 ef d2 79 e3 f5 68 d4 +ea f3 6f 80 cf 71 41 ac e6 0f cc 91 13 fb 6c 4a +84 1f d5 0b bc 7c 51 2f fc be ff 21 48 7a a8 11 +eb 3c a8 c6 20 05 34 6a 86 de 86 bf a1 d8 a9 48 +fd 3f 34 8c 22 ea ad f3 33 c3 ce 6c e1 32 08 fd + +# Prime p: +01 bf 01 d2 16 d7 35 95 cf 02 70 c2 be b7 8d 40 +a0 d8 44 7d 31 da 91 9a 98 3f 7e ea 78 1b 77 d8 +5f e3 71 b3 e9 37 3e 7b 69 21 7d 31 50 a0 2d 89 +58 de 7f ad 9d 55 51 60 95 8b 44 54 12 7e 0e 7e +af + +# Prime q: +01 8d 33 99 65 81 66 db 38 29 81 6d 7b 29 54 16 +75 9e 9c 91 98 7f 5b 2d 8a ec d6 3b 04 b4 8b d7 +b2 fc f2 29 bb 7f 8a 6d c8 8b a1 3d d2 e3 9a d5 +5b 6d 1a 06 16 07 08 f9 70 0b e8 0b 8f d3 74 4c +e7 + +# p's CRT exponent dP: +06 c0 a2 49 d2 0a 6f 2e e7 5c 88 b4 94 d5 3f 6a +ae 99 aa 42 7c 88 c2 8b 16 3a 76 94 45 e5 f3 90 +cf 40 c2 74 fd 6e a6 32 9a 5c e7 c7 ce 03 a2 15 +83 96 ee 2a 78 45 78 6e 09 e2 88 5a 97 28 e4 e5 + +# q's CRT exponent dQ: +d1 d2 7c 29 fe dd 92 d8 6c 34 8e dd 0c cb fa c1 +4f 74 6e 05 1c e1 d1 81 1d f3 5d 61 f2 ee 1c 97 +d4 bf 28 04 80 2f 64 27 18 7b a8 e9 0a 8a f4 42 +43 b4 07 9b 03 44 5e 60 2e 29 fa 51 93 e6 4f e9 + +# CRT coefficient qInv: +8c b2 f7 56 bd 89 41 b1 d3 b7 70 e5 ad 31 ee 37 +3b 28 ac da 69 ff 9b 6f 40 fe 57 8b 9f 1a fb 85 +83 6f 96 27 d3 7a cf f7 3c 27 79 e6 34 bb 26 01 +1c 2c 8f 7f 33 61 ae 2a 9e a6 5e d6 89 e3 63 9a + +# --------------------------------- +# RSAES-OAEP Encryption Example 3.1 +# --------------------------------- + +# Message to be encrypted: +08 78 20 b5 69 e8 fa 8d + +# Seed: +8c ed 6b 19 62 90 80 57 90 e9 09 07 40 15 e6 a2 +0b 0c 48 94 + +# Encryption: +02 6a 04 85 d9 6a eb d9 6b 43 82 08 50 99 b9 62 +e6 a2 bd ec 3d 90 c8 db 62 5e 14 37 2d e8 5e 2d +5b 7b aa b6 5c 8f af 91 bb 55 04 fb 49 5a fc e5 +c9 88 b3 f6 a5 2e 20 e1 d6 cb d3 56 6c 5c d1 f2 +b8 31 8b b5 42 cc 0e a2 5c 4a ab 99 32 af a2 07 +60 ea dd ec 78 43 96 a0 7e a0 ef 24 d4 e6 f4 d3 +7e 50 52 a7 a3 1e 14 6a a4 80 a1 11 bb e9 26 40 +13 07 e0 0f 41 00 33 84 2b 6d 82 fe 5c e4 df ae +80 + +# --------------------------------- +# RSAES-OAEP Encryption Example 3.2 +# --------------------------------- + +# Message to be encrypted: +46 53 ac af 17 19 60 b0 1f 52 a7 be 63 a3 ab 21 +dc 36 8e c4 3b 50 d8 2e c3 78 1e 04 + +# Seed: +b4 29 1d 65 67 55 08 48 cc 15 69 67 c8 09 ba ab +6c a5 07 f0 + +# Encryption: +02 4d b8 9c 78 02 98 9b e0 78 38 47 86 30 84 94 +1b f2 09 d7 61 98 7e 38 f9 7c b5 f6 f1 bc 88 da +72 a5 0b 73 eb af 11 c8 79 c4 f9 5d f3 7b 85 0b +8f 65 d7 62 2e 25 b1 b8 89 e8 0f e8 0b ac a2 06 +9d 6e 0e 1d 82 99 53 fc 45 90 69 de 98 ea 97 98 +b4 51 e5 57 e9 9a bf 8f e3 d9 cc f9 09 6e bb f3 +e5 25 5d 3b 4e 1c 6d 2e ca df 06 7a 35 9e ea 86 +40 5a cd 47 d5 e1 65 51 7c ca fd 47 d6 db ee 4b +f5 + +# --------------------------------- +# RSAES-OAEP Encryption Example 3.3 +# --------------------------------- + +# Message to be encrypted: +d9 4c d0 e0 8f a4 04 ed 89 + +# Seed: +ce 89 28 f6 05 95 58 25 40 08 ba dd 97 94 fa dc +d2 fd 1f 65 + +# Encryption: +02 39 bc e6 81 03 24 41 52 88 77 d6 d1 c8 bb 28 +aa 3b c9 7f 1d f5 84 56 36 18 99 57 97 68 38 44 +ca 86 66 47 32 f4 be d7 a0 aa b0 83 aa ab fb 72 +38 f5 82 e3 09 58 c2 02 4e 44 e5 70 43 b9 79 50 +fd 54 3d a9 77 c9 0c dd e5 33 7d 61 84 42 f9 9e +60 d7 78 3a b5 9c e6 dd 9d 69 c4 7a d1 e9 62 be +c2 2d 05 89 5c ff 8d 3f 64 ed 52 61 d9 2b 26 78 +51 03 93 48 49 90 ba 3f 7f 06 81 8a e6 ff ce 8a +3a + +# --------------------------------- +# RSAES-OAEP Encryption Example 3.4 +# --------------------------------- + +# Message to be encrypted: +6c c6 41 b6 b6 1e 6f 96 39 74 da d2 3a 90 13 28 +4e f1 + +# Seed: +6e 29 79 f5 2d 68 14 a5 7d 83 b0 90 05 48 88 f1 +19 a5 b9 a3 + +# Encryption: +02 99 4c 62 af d7 6f 49 8b a1 fd 2c f6 42 85 7f +ca 81 f4 37 3c b0 8f 1c ba ee 6f 02 5c 3b 51 2b +42 c3 e8 77 91 13 47 66 48 03 9d be 04 93 f9 24 +62 92 fa c2 89 50 60 0e 7c 0f 32 ed f9 c8 1b 9d +ec 45 c3 bd e0 cc 8d 88 47 59 01 69 90 7b 7d c5 +99 1c eb 29 bb 07 14 d6 13 d9 6d f0 f1 2e c5 d8 +d3 50 7c 8e e7 ae 78 dd 83 f2 16 fa 61 de 10 03 +63 ac a4 8a 7e 91 4a e9 f4 2d df be 94 3b 09 d9 +a0 + +# --------------------------------- +# RSAES-OAEP Encryption Example 3.5 +# --------------------------------- + +# Message to be encrypted: +df 51 51 83 2b 61 f4 f2 58 91 fb 41 72 f3 28 d2 +ed df 83 71 ff cf db e9 97 93 92 95 f3 0e ca 69 +18 01 7c fd a1 15 3b f7 a6 af 87 59 32 23 + +# Seed: +2d 76 0b fe 38 c5 9d e3 4c dc 8b 8c 78 a3 8e 66 +28 4a 2d 27 + +# Encryption: +01 62 04 2f f6 96 95 92 a6 16 70 31 81 1a 23 98 +34 ce 63 8a bf 54 fe c8 b9 94 78 12 2a fe 2e e6 +7f 8c 5b 18 b0 33 98 05 bf db c5 a4 e6 72 0b 37 +c5 9c fb a9 42 46 4c 59 7f f5 32 a1 19 82 15 45 +fd 2e 59 b1 14 e6 1d af 71 82 05 29 f5 02 9c f5 +24 95 43 27 c3 4e c5 e6 f5 ba 7e fc c4 de 94 3a +b8 ad 4e d7 87 b1 45 43 29 f7 0d b7 98 a3 a8 f4 +d9 2f 82 74 e2 b2 94 8a de 62 7c e8 ee 33 e4 3c +60 + +# --------------------------------- +# RSAES-OAEP Encryption Example 3.6 +# --------------------------------- + +# Message to be encrypted: +3c 3b ad 89 3c 54 4a 6d 52 0a b0 22 31 91 88 c8 +d5 04 b7 a7 88 b8 50 90 3b 85 97 2e aa 18 55 2e +11 34 a7 ad 60 98 82 62 54 ff 7a b6 72 b3 d8 eb +31 58 fa c6 d4 cb ae f1 + +# Seed: +f1 74 77 9c 5f d3 cf e0 07 ba dc b7 a3 6c 9b 55 +bf cf bf 0e + +# Encryption: +00 11 20 51 e7 5d 06 49 43 bc 44 78 07 5e 43 48 +2f d5 9c ee 06 79 de 68 93 ee c3 a9 43 da a4 90 +b9 69 1c 93 df c0 46 4b 66 23 b9 f3 db d3 e7 00 +83 26 4f 03 4b 37 4f 74 16 4e 1a 00 76 37 25 e5 +74 74 4b a0 b9 db 83 43 4f 31 df 96 f6 e2 a2 6f +6d 8e ba 34 8b d4 68 6c 22 38 ac 07 c3 7a ac 37 +85 d1 c7 ee a2 f8 19 fd 91 49 17 98 ed 8e 9c ef +5e 43 b7 81 b0 e0 27 6e 37 c4 3f f9 49 2d 00 57 +30 + +# ============================================= + +# ================================== +# Example 4: A 1027-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +05 12 40 b6 cc 00 04 fa 48 d0 13 46 71 c0 78 c7 +c8 de c3 b3 e2 f2 5b c2 56 44 67 33 9d b3 88 53 +d0 6b 85 ee a5 b2 de 35 3b ff 42 ac 2e 46 bc 97 +fa e6 ac 96 18 da 95 37 a5 c8 f5 53 c1 e3 57 62 +59 91 d6 10 8d cd 78 85 fb 3a 25 41 3f 53 ef ca +d9 48 cb 35 cd 9b 9a e9 c1 c6 76 26 d1 13 d5 7d +de 4c 5b ea 76 bb 5b b7 de 96 c0 0d 07 37 2e 96 +85 a6 d7 5c f9 d2 39 fa 14 8d 70 93 1b 5f 3f b0 +39 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +04 11 ff ca 3b 7c a5 e9 e9 be 7f e3 8a 85 10 5e +35 38 96 db 05 c5 79 6a ec d2 a7 25 16 1e b3 65 +1c 86 29 a9 b8 62 b9 04 d7 b0 c7 b3 7f 8c b5 a1 +c2 b5 40 01 01 8a 00 a1 eb 2c af e4 ee 4e 94 92 +c3 48 bc 2b ed ab 4b 9e bb f0 64 e8 ef f3 22 b9 +00 9f 8e ec 65 39 05 f4 0d f8 8a 3c dc 49 d4 56 +7f 75 62 7d 41 ac a6 24 12 9b 46 a0 b7 c6 98 e5 +e6 5f 2b 7b a1 02 c7 49 a1 01 35 b6 54 0d 04 01 + +# Prime p: +02 74 58 c1 9e c1 63 69 19 e7 36 c9 af 25 d6 09 +a5 1b 8f 56 1d 19 c6 bf 69 43 dd 1e e1 ab 8a 4a +3f 23 21 00 bd 40 b8 8d ec c6 ba 23 55 48 b6 ef +79 2a 11 c9 de 82 3d 0a 79 22 c7 09 5b 6e ba 57 +01 + +# Prime q: +02 10 ee 9b 33 ab 61 71 6e 27 d2 51 bd 46 5f 4b +35 a1 a2 32 e2 da 00 90 1c 29 4b f2 23 50 ce 49 +0d 09 9f 64 2b 53 75 61 2d b6 3b a1 f2 03 86 49 +2b f0 4d 34 b3 c2 2b ce b9 09 d1 34 41 b5 3b 51 +39 + +# p's CRT exponent dP: +39 fa 02 8b 82 6e 88 c1 12 1b 75 0a 8b 24 2f a9 +a3 5c 5b 66 bd fd 1f a6 37 d3 cc 48 a8 4a 4f 45 +7a 19 4e 77 27 e4 9f 7b cc 6e 5a 5a 41 26 57 fc +47 0c 73 22 eb c3 74 16 ef 45 8c 30 7a 8c 09 01 + +# q's CRT exponent dQ: +01 5d 99 a8 41 95 94 39 79 fa 9e 1b e2 c3 c1 b6 +9f 43 2f 46 fd 03 e4 7d 5b ef bb bf d6 b1 d1 37 +1d 83 ef b3 30 a3 e0 20 94 2b 2f ed 11 5e 5d 02 +be 24 fd 92 c9 01 9d 1c ec d6 dd 4c f1 e5 4c c8 +99 + +# CRT coefficient qInv: +01 f0 b7 01 51 70 b3 f5 e4 22 23 ba 30 30 1c 41 +a6 d8 7c bb 70 e3 0c b7 d3 c6 7d 25 47 3d b1 f6 +cb f0 3e 3f 91 26 e3 e9 79 68 27 9a 86 5b 2c 2b +42 65 24 cf c5 2a 68 3d 31 ed 30 eb 98 4b e4 12 +ba + +# --------------------------------- +# RSAES-OAEP Encryption Example 4.1 +# --------------------------------- + +# Message to be encrypted: +4a 86 60 95 34 ee 43 4a 6c bc a3 f7 e9 62 e7 6d +45 5e 32 64 c1 9f 60 5f 6e 5f f6 13 7c 65 c5 6d +7f b3 44 cd 52 bc 93 37 4f 3d 16 6c 9f 0c 6f 9c +50 6b ad 19 33 09 72 d2 + +# Seed: +1c ac 19 ce 99 3d ef 55 f9 82 03 f6 85 28 96 c9 +5c cc a1 f3 + +# Encryption: +04 cc e1 96 14 84 5e 09 41 52 a3 fe 18 e5 4e 33 +30 c4 4e 5e fb c6 4a e1 68 86 cb 18 69 01 4c c5 +78 1b 1f 8f 9e 04 53 84 d0 11 2a 13 5c a0 d1 2e +9c 88 a8 e4 06 34 16 de aa e3 84 4f 60 d6 e9 6f +e1 55 14 5f 45 25 b9 a3 44 31 ca 37 66 18 0f 70 +e1 5a 5e 5d 8e 8b 1a 51 6f f8 70 60 9f 13 f8 96 +93 5c ed 18 82 79 a5 8e d1 3d 07 11 42 77 d7 5c +65 68 60 7e 0a b0 92 fd 80 3a 22 3e 4a 8e e0 b1 +a8 + +# --------------------------------- +# RSAES-OAEP Encryption Example 4.2 +# --------------------------------- + +# Message to be encrypted: +b0 ad c4 f3 fe 11 da 59 ce 99 27 73 d9 05 99 43 +c0 30 46 49 7e e9 d9 f9 a0 6d f1 16 6d b4 6d 98 +f5 8d 27 ec 07 4c 02 ee e6 cb e2 44 9c 8b 9f c5 +08 0c 5c 3f 44 33 09 25 12 ec 46 aa 79 37 43 c8 + +# Seed: +f5 45 d5 89 75 85 e3 db 71 aa 0c b8 da 76 c5 1d +03 2a e9 63 + +# Encryption: +00 97 b6 98 c6 16 56 45 b3 03 48 6f bf 5a 2a 44 +79 c0 ee 85 88 9b 54 1a 6f 0b 85 8d 6b 65 97 b1 +3b 85 4e b4 f8 39 af 03 39 9a 80 d7 9b da 65 78 +c8 41 f9 0d 64 57 15 b2 80 d3 71 43 99 2d d1 86 +c8 0b 94 9b 77 5c ae 97 37 0e 4e c9 74 43 13 6c +6d a4 84 e9 70 ff db 13 23 a2 08 47 82 1d 3b 18 +38 1d e1 3b b4 9a ae a6 65 30 c4 a4 b8 27 1f 3e +ae 17 2c d3 66 e0 7e 66 36 f1 01 9d 2a 28 ae d1 +5e + +# --------------------------------- +# RSAES-OAEP Encryption Example 4.3 +# --------------------------------- + +# Message to be encrypted: +bf 6d 42 e7 01 70 7b 1d 02 06 b0 c8 b4 5a 1c 72 +64 1f f1 28 89 21 9a 82 bd ea 96 5b 5e 79 a9 6b +0d 01 63 ed 9d 57 8e c9 ad a2 0f 2f bc f1 ea 3c +40 89 d8 34 19 ba 81 b0 c6 0f 36 06 da 99 + +# Seed: +ad 99 7f ee f7 30 d6 ea 7b e6 0d 0d c5 2e 72 ea +cb fd d2 75 + +# Encryption: +03 01 f9 35 e9 c4 7a bc b4 8a cb be 09 89 5d 9f +59 71 af 14 83 9d a4 ff 95 41 7e e4 53 d1 fd 77 +31 90 72 bb 72 97 e1 b5 5d 75 61 cd 9d 1b b2 4c +1a 9a 37 c6 19 86 43 08 24 28 04 87 9d 86 eb d0 +01 dc e5 18 39 75 e1 50 69 89 b7 0e 5a 83 43 41 +54 d5 cb fd 6a 24 78 7e 60 eb 0c 65 8d 2a c1 93 +30 2d 11 92 c6 e6 22 d4 a1 2a d4 b5 39 23 bc a2 +46 df 31 c6 39 5e 37 70 2c 6a 78 ae 08 1f b9 d0 +65 + +# --------------------------------- +# RSAES-OAEP Encryption Example 4.4 +# --------------------------------- + +# Message to be encrypted: +fb 2e f1 12 f5 e7 66 eb 94 01 92 97 93 47 94 f7 +be 2f 6f c1 c5 8e + +# Seed: +13 64 54 df 57 30 f7 3c 80 7a 7e 40 d8 c1 a3 12 +ac 5b 9d d3 + +# Encryption: +02 d1 10 ad 30 af b7 27 be b6 91 dd 0c f1 7d 0a +f1 a1 e7 fa 0c c0 40 ec 1a 4b a2 6a 42 c5 9d 0a +79 6a 2e 22 c8 f3 57 cc c9 8b 65 19 ac eb 68 2e +94 5e 62 cb 73 46 14 a5 29 40 7c d4 52 be e3 e4 +4f ec e8 42 3c c1 9e 55 54 8b 8b 99 4b 84 9c 7e +cd e4 93 3e 76 03 7e 1d 0c e4 42 75 b0 87 10 c6 +8e 43 01 30 b9 29 73 0e d7 7e 09 b0 15 64 2c 55 +93 f0 4e 4f fb 94 10 79 81 02 a8 e9 6f fd fe 11 +e4 + +# --------------------------------- +# RSAES-OAEP Encryption Example 4.5 +# --------------------------------- + +# Message to be encrypted: +28 cc d4 47 bb 9e 85 16 6d ab b9 e5 b7 d1 ad ad +c4 b9 d3 9f 20 4e 96 d5 e4 40 ce 9a d9 28 bc 1c +22 84 + +# Seed: +bc a8 05 7f 82 4b 2e a2 57 f2 86 14 07 ee f6 3d +33 20 86 81 + +# Encryption: +00 db b8 a7 43 9d 90 ef d9 19 a3 77 c5 4f ae 8f +e1 1e c5 8c 3b 85 83 62 e2 3a d1 b8 a4 43 10 79 +90 66 b9 93 47 aa 52 56 91 d2 ad c5 8d 9b 06 e3 +4f 28 8c 17 03 90 c5 f0 e1 1c 0a a3 64 59 59 f1 +8e e7 9e 8f 2b e8 d7 ac 5c 23 d0 61 f1 8d d7 4b +8c 5f 2a 58 fc b5 eb 0c 54 f9 9f 01 a8 32 47 56 +82 92 53 65 83 34 09 48 d7 a8 c9 7c 4a cd 1e 98 +d1 e2 9d c3 20 e9 7a 26 05 32 a8 aa 7a 75 8a 1e +c2 + +# --------------------------------- +# RSAES-OAEP Encryption Example 4.6 +# --------------------------------- + +# Message to be encrypted: +f2 22 42 75 1e c6 b1 + +# Seed: +2e 7e 1e 17 f6 47 b5 dd d0 33 e1 54 72 f9 0f 68 +12 f3 ac 4e + +# Encryption: +00 a5 ff a4 76 8c 8b be ca ee 2d b7 7e 8f 2e ec +99 59 59 33 54 55 20 83 5e 5b a7 db 94 93 d3 e1 +7c dd ef e6 a5 f5 67 62 44 71 90 8d b4 e2 d8 3a +0f be e6 06 08 fc 84 04 95 03 b2 23 4a 07 dc 83 +b2 7b 22 84 7a d8 92 0f f4 2f 67 4e f7 9b 76 28 +0b 00 23 3d 2b 51 b8 cb 27 03 a9 d4 2b fb c8 25 +0c 96 ec 32 c0 51 e5 7f 1b 4b a5 28 db 89 c3 7e +4c 54 e2 7e 6e 64 ac 69 63 5a e8 87 d9 54 16 19 +a9 + +# ============================================= + +# ================================== +# Example 5: A 1028-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +0a ad f3 f9 c1 25 e5 d8 91 f3 1a c4 48 e9 93 de +fe 58 0f 80 2b 45 f9 d7 f2 2b a5 02 1e 9c 47 57 +6b 5a 1e 68 03 1b a9 db 4e 6d ab e4 d9 6a 1d 6f +3d 26 72 68 cf f4 08 00 5f 11 8e fc ad b9 98 88 +d1 c2 34 46 71 66 b2 a2 b8 49 a0 5a 88 9c 06 0a +c0 da 0c 5f ae 8b 55 f3 09 ba 62 e7 03 74 2f a0 +32 6f 2d 10 b0 11 02 14 89 ff 49 77 70 19 0d 89 +5f d3 9f 52 29 3c 39 ef d7 3a 69 8b da b9 f1 0e +d9 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +02 56 eb 4c ba 70 67 f2 d2 be 54 0d cd ff 45 82 +a3 6b 7d 31 d1 c9 09 9b b2 14 b7 98 48 46 6a 26 +8f 80 f5 8a 49 ac 04 c0 e3 64 89 34 a0 20 6c 04 +53 7c 19 b2 36 64 3a 60 82 73 21 44 df 75 fa 21 +75 88 f7 94 68 2b e8 91 68 27 6d c7 26 c5 c0 cb +db 84 d3 1b bf 26 d0 a4 3a f4 95 71 7f 7d 52 8a +cf ee 34 15 61 f6 ff 3c ae 05 c5 78 f8 47 0d 96 +82 f9 c0 d0 72 f9 f6 06 8b 56 d5 88 0f 68 2b e2 +c5 + +# Prime p: +03 b0 d3 96 2f 6d 17 54 9c bf ca 11 29 43 48 dc +f0 e7 e3 9f 8c 2b c6 82 4f 21 64 b6 06 d6 87 86 +0d ae 1e 63 23 93 cf ed f5 13 22 82 29 06 9e 2f +60 e4 ac d7 e6 33 a4 36 06 3f 82 38 5f 48 99 37 +07 + +# Prime q: +02 e4 c3 2e 2f 51 72 69 b7 07 23 09 f0 0c 0e 31 +36 5f 7c e2 8b 23 6b 82 91 2d f2 39 ab f3 95 72 +cf 0e d6 04 b0 29 82 e5 35 64 c5 2d 6a 05 39 7d +e5 c0 52 a2 fd dc 14 1e f7 18 98 36 34 6a eb 33 +1f + +# p's CRT exponent dP: +01 e8 4b 11 9d 25 16 1f a6 7b 00 25 6a 5b d9 b6 +45 d2 b2 32 ec b0 5b 01 51 80 02 9a 88 62 2a dc +3f 09 b3 ae ac de 61 61 ab 7c de 22 c2 ad 26 e7 +79 7d f5 4e 07 2c bd 3b 26 73 80 0b 3e 43 38 db +d5 + +# q's CRT exponent dQ: +eb 90 aa 1a 40 13 5b 4c ea 07 19 7c ed c8 81 9b +e1 e7 cb ff 25 47 66 21 16 f4 65 a4 a9 f4 87 ab +12 f3 ba 4f ef 13 82 22 65 a6 52 97 d9 8b 7b de +d9 37 2e 3f fe 81 a3 8b 3e 96 00 fe d0 55 75 4f + +# CRT coefficient qInv: +01 2f 7f 81 38 f9 40 40 62 eb 85 a4 29 24 52 0b +38 f5 bb 88 6a 01 96 f4 8b b8 dc ea 60 fd 92 cc +02 7f 18 e7 81 58 a3 4a 5c 5d 5f 86 0a 0f 6c 04 +07 1a 7d 01 31 2c 06 50 62 f1 eb 48 b7 9d 1c 83 +cb + +# --------------------------------- +# RSAES-OAEP Encryption Example 5.1 +# --------------------------------- + +# Message to be encrypted: +af 71 a9 01 e3 a6 1d 31 32 f0 fc 1f db 47 4f 9e +a6 57 92 57 ff c2 4d 16 41 70 14 5b 3d bd e8 + +# Seed: +44 c9 2e 28 3f 77 b9 49 9c 60 3d 96 36 60 c8 7d +2f 93 94 61 + +# Encryption: +03 60 46 a4 a4 7d 9e d3 ba 9a 89 13 9c 10 50 38 +eb 74 92 b0 5a 5d 68 bf d5 3a cc ff 45 97 f7 a6 +86 51 b4 7b 4a 46 27 d9 27 e4 85 ee d7 b4 56 64 +20 e8 b4 09 87 9e 5d 60 6e ae 25 1d 22 a5 df 79 +9f 79 20 bf c1 17 b9 92 57 2a 53 b1 26 31 46 bc +ea 03 38 5c c5 e8 53 c9 a1 01 c8 c3 e1 bd a3 1a +51 98 07 49 6c 6c b5 e5 ef b4 08 82 3a 35 2b 8f +a0 66 1f b6 64 ef ad d5 93 de b9 9f ff 5e d0 00 +e5 + +# --------------------------------- +# RSAES-OAEP Encryption Example 5.2 +# --------------------------------- + +# Message to be encrypted: +a3 b8 44 a0 82 39 a8 ac 41 60 5a f1 7a 6c fd a4 +d3 50 13 65 85 90 3a 41 7a 79 26 87 60 51 9a 4b +4a c3 30 3e c7 3f 0f 87 cf b3 23 99 + +# Seed: +cb 28 f5 86 06 59 fc ee e4 9c 3e ea fc e6 25 a7 +08 03 bd 32 + +# Encryption: +03 d6 eb 65 4e dc e6 15 bc 59 f4 55 26 5e d4 e5 +a1 82 23 cb b9 be 4e 40 69 b4 73 80 4d 5d e9 6f +54 dc aa a6 03 d0 49 c5 d9 4a a1 47 0d fc d2 25 +40 66 b7 c7 b6 1f f1 f6 f6 77 0e 32 15 c5 13 99 +fd 4e 34 ec 50 82 bc 48 f0 89 84 0a d0 43 54 ae +66 dc 0f 1b d1 8e 46 1a 33 cc 12 58 b4 43 a2 83 +7a 6d f2 67 59 aa 23 02 33 49 86 f8 73 80 c9 cc +9d 53 be 9f 99 60 5d 2c 9a 97 da 7b 09 15 a4 a7 +ad + +# --------------------------------- +# RSAES-OAEP Encryption Example 5.3 +# --------------------------------- + +# Message to be encrypted: +30 8b 0e cb d2 c7 6c b7 7f c6 f7 0c 5e dd 23 3f +d2 f2 09 29 d6 29 f0 26 95 3b b6 2a 8f 4a 3a 31 +4b de 19 5d e8 5b 5f 81 6d a2 aa b0 74 d2 6c b6 +ac dd f3 23 ae 3b 9c 67 8a c3 cf 12 fb dd e7 + +# Seed: +22 85 f4 0d 77 04 82 f9 a9 ef a2 c7 2c b3 ac 55 +71 6d c0 ca + +# Encryption: +07 70 95 21 81 64 9f 9f 9f 07 ff 62 6f f3 a2 2c +35 c4 62 44 3d 90 5d 45 6a 9f d0 bf f4 3c ac 2c +a7 a9 f5 54 e9 47 8b 9a cc 3a c8 38 b0 20 40 ff +d3 e1 84 7d e2 e4 25 39 29 f9 dd 9e e4 04 43 25 +a9 b0 5c ab b8 08 b2 ee 84 0d 34 e1 5d 10 5a 3f +1f 7b 27 69 5a 1a 07 a2 d7 3f e0 8e ca aa 3c 9c +9d 4d 5a 89 ff 89 0d 54 72 7d 7a e4 0c 0e c1 a8 +dd 86 16 5d 8e e2 c6 36 81 41 01 6a 48 b5 5b 69 +67 + +# --------------------------------- +# RSAES-OAEP Encryption Example 5.4 +# --------------------------------- + +# Message to be encrypted: +15 c5 b9 ee 11 85 + +# Seed: +49 fa 45 d3 a7 8d d1 0d fd 57 73 99 d1 eb 00 af +7e ed 55 13 + +# Encryption: +08 12 b7 67 68 eb cb 64 2d 04 02 58 e5 f4 44 1a +01 85 21 bd 96 68 7e 6c 5e 89 9f cd 6c 17 58 8f +f5 9a 82 cc 8a e0 3a 4b 45 b3 12 99 af 17 88 c3 +29 f7 dc d2 85 f8 cf 4c ed 82 60 6b 97 61 26 71 +a4 5b ed ca 13 34 42 14 4d 16 17 d1 14 f8 02 85 +7f 0f 9d 73 97 51 c5 7a 3f 9e e4 00 91 2c 61 e2 +e6 99 2b e0 31 a4 3d d4 8f a6 ba 14 ee f7 c4 22 +b5 ed c4 e7 af a0 4f dd 38 f4 02 d1 c8 bb 71 9a +bf + +# --------------------------------- +# RSAES-OAEP Encryption Example 5.5 +# --------------------------------- + +# Message to be encrypted: +21 02 6e 68 00 c7 fa 72 8f ca ab a0 d1 96 ae 28 +d7 a2 ac 4f fd 8a bc e7 94 f0 98 5f 60 c8 a6 73 +72 77 36 5d 3f ea 11 db 89 23 a2 02 9a + +# Seed: +f0 28 74 13 23 4c c5 03 47 24 a0 94 c4 58 6b 87 +af f1 33 fc + +# Encryption: +07 b6 0e 14 ec 95 4b fd 29 e6 0d 00 47 e7 89 f5 +1d 57 18 6c 63 58 99 03 30 67 93 ce d3 f6 82 41 +c7 43 52 9a ba 6a 63 74 f9 2e 19 e0 16 3e fa 33 +69 7e 19 6f 76 61 df aa a4 7a ac 6b de 5e 51 de +b5 07 c7 2c 58 9a 2c a1 69 3d 96 b1 46 03 81 24 +9b 2c db 9e ac 44 76 9f 24 89 c5 d3 d2 f9 9f 0e +e3 c7 ee 5b f6 4a 5a c7 9c 42 bd 43 3f 14 9b e8 +cb 59 54 83 61 64 05 95 51 3c 97 af 7b c2 50 97 +23 + +# --------------------------------- +# RSAES-OAEP Encryption Example 5.6 +# --------------------------------- + +# Message to be encrypted: +54 1e 37 b6 8b 6c 88 72 b8 4c 02 + +# Seed: +d9 fb a4 5c 96 f2 1e 6e 26 d2 9e b2 cd cb 65 85 +be 9c b3 41 + +# Encryption: +08 c3 6d 4d da 33 42 3b 2e d6 83 0d 85 f6 41 1b +a1 dc f4 70 a1 fa e0 eb ef ee 7c 08 9f 25 6c ef +74 cb 96 ea 69 c3 8f 60 f3 9a be e4 41 29 bc b4 +c9 2d e7 f7 97 62 3b 20 07 4e 3d 9c 28 99 70 1e +d9 07 1e 1e fa 0b dd 84 d4 c3 e5 13 03 02 d8 f0 +24 0b ab a4 b8 4a 71 cc 03 2f 22 35 a5 ff 0f ae +27 7c 3e 8f 91 12 be f4 4c 9a e2 0d 17 5f c9 a4 +05 8b fc 93 0b a3 1b 02 e2 e4 f4 44 48 37 10 f2 +4a + +# ============================================= + +# ================================== +# Example 6: A 1029-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +12 b1 7f 6d ad 2e cd 19 ff 46 dc 13 f7 86 0f 09 +e0 e0 cf b6 77 b3 8a 52 59 23 05 ce af 02 2c 16 +6d b9 0d 04 ac 29 e3 3f 7d d1 2d 9f af 66 e0 81 +6b b6 3e ad 26 7c c7 d4 6c 17 c3 7b e2 14 bc a2 +a2 2d 72 3a 64 e4 44 07 43 6b 6f c9 65 72 9a ef +c2 55 4f 37 6c d5 dc ea 68 29 37 80 a6 2b f3 9d +00 29 48 5a 16 0b bb 9e 5d c0 97 2d 21 a5 04 f5 +2e 5e e0 28 aa 41 63 32 f5 10 b2 e9 cf f5 f7 22 +af + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +02 95 ec a3 56 06 18 36 95 59 ce cd 30 3a a9 cf +da fc 1d 9f 06 95 9d f7 5f fe f9 29 aa 89 69 61 +bc d1 90 dc 69 97 ed a7 f5 96 3e 72 4d 07 b4 dc +11 f3 06 5e 5a e9 7d 96 83 51 12 28 0b 90 84 bb +14 f2 a2 1e bd 4e 88 9d 41 b9 c4 13 2e c1 95 6f +ca b8 bb 2f ed 05 75 88 49 36 52 2c 5f f7 d3 32 +61 90 48 24 e7 ca de e4 e0 bb 37 2d 24 57 cf 78 +e2 bd 12 86 22 8f f8 3f 10 73 1c e6 3c 90 cf f3 +f9 + +# Prime p: +04 a6 ce 8b 73 58 df a6 9b dc f7 42 61 70 05 af +b5 38 5f 5f 3a 58 a2 4e f7 4a 22 a8 c0 5c b7 cc +38 eb d4 cc 9d 9a 9d 78 9a 62 cd 0f 60 f0 cb 94 +1d 34 23 c9 69 2e fa 4f e3 ad ff 29 0c 47 49 a3 +8b + +# Prime q: +04 04 c9 a8 03 37 1f ed b4 c5 be 39 f3 c0 0b 00 +9e 5e 08 a6 3b e1 e4 00 35 cd ac a5 01 1c c7 01 +cf 7e eb cb 99 f0 ff e1 7c fd 0a 4b f7 be fd 2d +d5 36 ac 94 6d b7 97 fd bc 4a be 8f 29 34 9b 91 +ed + +# p's CRT exponent dP: +03 96 1c 8f 76 0a a2 bd 51 54 c7 aa fd 77 22 5b +3b ac d0 13 9a e7 b5 94 8e a3 31 1f cc d8 6f b9 +5c 75 af a7 67 28 4b 9b 2d e5 59 57 2f 15 d8 d0 +44 c7 eb 83 a1 be 5f ad f2 cc 37 7c 0d 84 75 29 +4b + +# q's CRT exponent dQ: +02 21 97 e0 66 74 21 96 aa bc 03 fa 2f ee b4 e7 +0b 15 cb 78 7d 61 7a cd 31 bb 75 c7 bc 23 4a d7 +06 f7 c4 8d 21 82 d1 f0 ff 9c 22 8d cf 41 96 7b +6c 0b a6 d2 c0 ad 11 0a 1b 85 78 31 ec 24 5e 2c +b1 + +# CRT coefficient qInv: +04 01 c4 c0 c5 3d 45 db db 5e 9d 96 d0 fe cf 42 +75 df 09 74 bc 4a 07 36 b4 a7 4c 32 69 05 3e fb +68 6a ce 24 06 e2 2c 9e 05 8d db 4a e5 40 62 7a +e2 fd b0 82 61 e8 e7 e4 bc bc 99 4d aa fa 30 5c +45 + +# --------------------------------- +# RSAES-OAEP Encryption Example 6.1 +# --------------------------------- + +# Message to be encrypted: +40 46 ca 8b aa 33 47 ca 27 f4 9e 0d 81 f9 cc 1d +71 be 9b a5 17 d4 + +# Seed: +dd 0f 6c fe 41 5e 88 e5 a4 69 a5 1f bb a6 df d4 +0a db 43 84 + +# Encryption: +06 30 ee bc d2 85 6c 24 f7 98 80 6e 41 f9 e6 73 +45 ed a9 ce da 38 6a cc 9f ac ae a1 ee ed 06 ac +e5 83 70 97 18 d9 d1 69 fa df 41 4d 5c 76 f9 29 +96 83 3e f3 05 b7 5b 1e 4b 95 f6 62 a2 0f ae dc +3b ae 0c 48 27 a8 bf 8a 88 ed bd 57 ec 20 3a 27 +a8 41 f0 2e 43 a6 15 ba b1 a8 ca c0 70 1d e3 4d +eb de f6 2a 08 80 89 b5 5e c3 6e a7 52 2f d3 ec +8d 06 b6 a0 73 e6 df 83 31 53 bc 0a ef d9 3b d1 +a3 + +# --------------------------------- +# RSAES-OAEP Encryption Example 6.2 +# --------------------------------- + +# Message to be encrypted: +5c c7 2c 60 23 1d f0 3b 3d 40 f9 b5 79 31 bc 31 +10 9f 97 25 27 f2 8b 19 e7 48 0c 72 88 cb 3c 92 +b2 25 12 21 4e 4b e6 c9 14 79 2d da bd f5 7f aa +8a a7 + +# Seed: +8d 14 bd 94 6a 13 51 14 8f 5c ae 2e d9 a0 c6 53 +e8 5e bd 85 + +# Encryption: +0e bc 37 37 61 73 a4 fd 2f 89 cc 55 c2 ca 62 b2 +6b 11 d5 1c 3c 7c e4 9e 88 45 f7 4e 76 07 31 7c +43 6b c8 d2 3b 96 67 df eb 9d 08 72 34 b4 7b c6 +83 71 75 ae 5c 05 59 f6 b8 1d 7d 22 41 6d 3e 50 +f4 ac 53 3d 8f 08 12 f2 db 9e 79 1f e9 c7 75 ac +8b 6a d0 f5 35 ad 9c eb 23 a4 a0 20 14 c5 8a b3 +f8 d3 16 14 99 a2 60 f3 93 48 e7 14 ae 2a 1d 34 +43 20 8f d8 b7 22 cc fd fb 39 3e 98 01 1f 99 e6 +3f + +# --------------------------------- +# RSAES-OAEP Encryption Example 6.3 +# --------------------------------- + +# Message to be encrypted: +b2 0e 65 13 03 09 2f 4b cc b4 30 70 c0 f8 6d 23 +04 93 62 ed 96 64 2f c5 63 2c 27 db 4a 52 e3 d8 +31 f2 ab 06 8b 23 b1 49 87 9c 00 2f 6b f3 fe ee +97 59 11 12 56 2c + +# Seed: +6c 07 5b c4 55 20 f1 65 c0 bf 5e a4 c5 df 19 1b +c9 ef 0e 44 + +# Encryption: +0a 98 bf 10 93 61 93 94 43 6c f6 8d 8f 38 e2 f1 +58 fd e8 ea 54 f3 43 5f 23 9b 8d 06 b8 32 18 44 +20 24 76 ae ed 96 00 94 92 48 0c e3 a8 d7 05 49 +8c 4c 8c 68 f0 15 01 dc 81 db 60 8f 60 08 73 50 +c8 c3 b0 bd 2e 9e f6 a8 14 58 b7 c8 01 b8 9f 2e +4f e9 9d 49 00 ba 6a 4b 5e 5a 96 d8 65 dc 67 6c +77 55 92 87 94 13 0d 62 80 a8 16 0a 19 0f 2d f3 +ea 7c f9 aa 02 71 d8 8e 9e 69 05 ec f1 c5 15 2d +65 + +# --------------------------------- +# RSAES-OAEP Encryption Example 6.4 +# --------------------------------- + +# Message to be encrypted: +68 4e 30 38 c5 c0 41 f7 + +# Seed: +3b bc 3b d6 63 7d fe 12 84 69 01 02 9b f5 b0 c0 +71 03 43 9c + +# Encryption: +00 8e 7a 67 ca cf b5 c4 e2 4b ec 7d ee 14 91 17 +f1 95 98 ce 8c 45 80 8f ef 88 c6 08 ff 9c d6 e6 +95 26 3b 9a 3c 0a d4 b8 ba 4c 95 23 8e 96 a8 42 +2b 85 35 62 9c 8d 53 82 37 44 79 ad 13 fa 39 97 +4b 24 2f 9a 75 9e ea f9 c8 3a d5 a8 ca 18 94 0a +01 62 ba 75 58 76 df 26 3f 4b d5 0c 65 25 c5 60 +90 26 7c 1f 0e 09 ce 08 99 a0 cf 35 9e 88 12 0a +bd 9b f8 93 44 5b 3c ae 77 d3 60 73 59 ae 9a 52 +f8 + +# --------------------------------- +# RSAES-OAEP Encryption Example 6.5 +# --------------------------------- + +# Message to be encrypted: +32 48 8c b2 62 d0 41 d6 e4 dd 35 f9 87 bf 3c a6 +96 db 1f 06 ac 29 a4 46 93 + +# Seed: +b4 6b 41 89 3e 8b ef 32 6f 67 59 38 3a 83 07 1d +ae 7f ca bc + +# Encryption: +00 00 34 74 41 6c 7b 68 bd f9 61 c3 85 73 79 44 +d7 f1 f4 0c b3 95 34 3c 69 3c c0 b4 fe 63 b3 1f +ed f1 ea ee ac 9c cc 06 78 b3 1d c3 2e 09 77 48 +95 14 c4 f0 90 85 f6 29 8a 96 53 f0 1a ea 40 45 +ff 58 2e e8 87 be 26 ae 57 5b 73 ee f7 f3 77 49 +21 e3 75 a3 d1 9a dd a0 ca 31 aa 18 49 88 7c 1f +42 ca c9 67 7f 7a 2f 4e 92 3f 6e 5a 86 8b 38 c0 +84 ef 18 75 94 dc 9f 7f 04 8f ea 2e 02 95 53 84 +ab + +# --------------------------------- +# RSAES-OAEP Encryption Example 6.6 +# --------------------------------- + +# Message to be encrypted: +50 ba 14 be 84 62 72 02 79 c3 06 ba + +# Seed: +0a 24 03 31 2a 41 e3 d5 2f 06 0f bc 13 a6 7d e5 +cf 76 09 a7 + +# Encryption: +0a 02 6d da 5f c8 78 5f 7b d9 bf 75 32 7b 63 e8 +5e 2c 0f de e5 da db 65 eb dc ac 9a e1 de 95 c9 +2c 67 2a b4 33 aa 7a 8e 69 ce 6a 6d 88 97 fa c4 +ac 4a 54 de 84 1a e5 e5 bb ce 76 87 87 9d 79 63 +4c ea 7a 30 68 40 65 c7 14 d5 24 09 b9 28 25 6b +bf 53 ea bc d5 23 1e b7 25 95 04 53 73 99 bd 29 +16 4b 72 6d 33 a4 6d a7 01 36 0a 41 68 a0 91 cc +ab 72 d4 4a 62 fe d2 46 c0 ff ea 5b 13 48 ab 54 +70 + +# ============================================= + +# ================================== +# Example 7: A 1030-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +31 11 79 f0 bc fc 9b 9d 3c a3 15 d0 0e f3 0d 7b +dd 3a 2c fa e9 91 1b fe dc b9 48 b3 a4 78 2d 07 +32 b6 ab 44 aa 4b f0 37 41 a6 44 dc 01 be c3 e6 +9b 01 a0 33 e6 75 d8 ac d7 c4 92 5c 6b 1a ec 31 +19 05 1d fd 89 76 2d 21 5d 45 47 5f fc b5 9f 90 +81 48 62 3f 37 17 71 56 f6 ae 86 dd 7a 7c 5f 43 +dc 1e 1f 90 82 54 05 8a 28 4a 5f 06 c0 02 17 93 +a8 7f 1a c5 fe ff 7d ca ee 69 c5 e5 1a 37 89 e3 +73 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +07 0c fc ff 2f eb 82 76 e2 74 32 c4 5d fe e4 8f +49 b7 91 7d 65 30 e1 f0 ca 34 60 f3 2e 02 76 17 +44 87 c5 6e 22 a4 5d 25 00 d7 77 54 95 21 9d 7d +16 5a 9c f3 bd 92 c3 2a f9 a9 8d 8d c9 cc 29 68 +00 ad c9 4a 0a 54 fb 40 f3 42 91 bf 84 ee 8e a1 +2b 6f 10 93 59 c6 d3 54 2a 50 f9 c7 67 f5 cf ff +05 a6 81 c2 e6 56 fb 77 ca aa db 4b e9 46 8d 8a +bc d4 df 98 f5 8e 86 d2 05 3f a1 34 9f 74 8e 21 +b1 + +# Prime p: +07 49 26 2c 11 1c d4 70 ec 25 66 e6 b3 73 2f c0 +93 29 46 9a a1 90 71 d3 b9 c0 19 06 51 4c 6f 1d +26 ba a1 4b ea b0 97 1c 8b 7e 61 1a 4f 79 00 9d +6f ea 77 69 28 ca 25 28 5b 0d e3 64 3d 1a 3f 8c +71 + +# Prime q: +06 bc 1e 50 e9 6c 02 bf 63 6e 9e ea 8b 89 9b be +bf 76 51 de 77 dd 47 4c 3e 9b c2 3b ad 81 82 b6 +19 04 c7 d9 7d fb eb fb 1e 00 10 88 78 b6 e6 7e +41 53 91 d6 79 42 c2 b2 bf 9b 44 35 f8 8b 0c b0 +23 + +# p's CRT exponent dP: +03 bc 7e a7 f0 aa b1 43 ab c6 ce 8b 97 11 86 36 +a3 01 72 e4 cf e0 2c 8f a0 dd a3 b7 ba af 90 f8 +09 29 82 98 55 25 f4 88 bd fc b4 bd 72 6e 22 63 +9a c6 4a 30 92 ab 7f fc bf 1d 53 34 cf a5 0b 5b +f1 + +# q's CRT exponent dQ: +02 62 a6 aa 29 c2 a3 c6 7d c5 34 6c 06 38 1a fd +98 7a a3 cc 93 cf bf ec f5 4f dd 9f 9d 78 7d 7f +59 a5 23 d3 98 97 9d a1 37 a2 f6 38 1f e9 48 01 +f7 c9 4d a2 15 18 dc 34 cb 40 87 0c 46 97 99 4a +d9 + +# CRT coefficient qInv: +64 9d 4c 17 b6 ee 17 21 e7 72 d0 38 9a 55 9c 3d +3c df 95 50 d4 57 c4 6b 03 7b 74 64 1b 1d 52 16 +6a f8 a2 13 c8 39 62 06 cd fb a4 42 2f 18 d6 f6 +1d bc b5 d2 14 c9 71 bf 48 2a eb 97 6a 73 70 c2 + +# --------------------------------- +# RSAES-OAEP Encryption Example 7.1 +# --------------------------------- + +# Message to be encrypted: +47 aa e9 09 + +# Seed: +43 dd 09 a0 7f f4 ca c7 1c aa 46 32 ee 5e 1c 1d +ae e4 cd 8f + +# Encryption: +16 88 e4 ce 77 94 bb a6 cb 70 14 16 9e cd 55 9c +ed e2 a3 0b 56 a5 2b 68 d9 fe 18 cf 19 73 ef 97 +b2 a0 31 53 95 1c 75 5f 62 94 aa 49 ad bd b5 58 +45 ab 68 75 fb 39 86 c9 3e cf 92 79 62 84 0d 28 +2f 9e 54 ce 8b 69 0f 7c 0c b8 bb d7 34 40 d9 57 +1d 1b 16 cd 92 60 f9 ea b4 78 3c c4 82 e5 22 3d +c6 09 73 87 17 83 ec 27 b0 ae 0f d4 77 32 cb c2 +86 a1 73 fc 92 b0 0f b4 ba 68 24 64 7c d9 3c 85 +c1 + +# --------------------------------- +# RSAES-OAEP Encryption Example 7.2 +# --------------------------------- + +# Message to be encrypted: +1d 9b 2e 22 23 d9 bc 13 bf b9 f1 62 ce 73 5d b4 +8b a7 c6 8f 68 22 a0 a1 a7 b6 ae 16 58 34 e7 + +# Seed: +3a 9c 3c ec 7b 84 f9 bd 3a de cb c6 73 ec 99 d5 +4b 22 bc 9b + +# Encryption: +10 52 ed 39 7b 2e 01 e1 d0 ee 1c 50 bf 24 36 3f +95 e5 04 f4 a0 34 34 a0 8f d8 22 57 4e d6 b9 73 +6e db b5 f3 90 db 10 32 14 79 a8 a1 39 35 0e 2b +d4 97 7c 37 78 ef 33 1f 3e 78 ae 11 8b 26 84 51 +f2 0a 2f 01 d4 71 f5 d5 3c 56 69 37 17 1b 2d bc +2d 4b de 45 9a 57 99 f0 37 2d 65 74 23 9b 23 23 +d2 45 d0 bb 81 c2 86 b6 3c 89 a3 61 01 73 37 e4 +90 2f 88 a4 67 f4 c7 f2 44 bf d5 ab 46 43 7f f3 +b6 + +# --------------------------------- +# RSAES-OAEP Encryption Example 7.3 +# --------------------------------- + +# Message to be encrypted: +d9 76 fc + +# Seed: +76 a7 5e 5b 61 57 a5 56 cf 88 84 bb 2e 45 c2 93 +dd 54 5c f5 + +# Encryption: +21 55 cd 84 3f f2 4a 4e e8 ba db 76 94 26 00 28 +a4 90 81 3b a8 b3 69 a4 cb f1 06 ec 14 8e 52 98 +70 7f 59 65 be 7d 10 1c 10 49 ea 85 84 c2 4c d6 +34 55 ad 9c 10 4d 68 62 82 d3 fb 80 3a 4c 11 c1 +c2 e9 b9 1c 71 78 80 1d 1b 66 40 f0 03 f5 72 8d +f0 07 b8 a4 cc c9 2b ce 05 e4 1a 27 27 8d 7c 85 +01 8c 52 41 43 13 a5 07 77 89 00 1d 4f 01 91 0b +72 aa d0 5d 22 0a a1 4a 58 73 3a 74 89 bc 54 55 +6b + +# --------------------------------- +# RSAES-OAEP Encryption Example 7.4 +# --------------------------------- + +# Message to be encrypted: +d4 73 86 23 df 22 3a a4 38 43 df 84 67 53 4c 41 +d0 13 e0 c8 03 c6 24 e2 63 66 6b 23 9b de 40 a5 +f2 9a eb 8d e7 9e 3d aa 61 dd 03 70 f4 9b d4 b0 +13 83 4b 98 21 2a ef 6b 1c 5e e3 73 b3 cb + +# Seed: +78 66 31 4a 6a d6 f2 b2 50 a3 59 41 db 28 f5 86 +4b 58 58 59 + +# Encryption: +0a b1 4c 37 3a eb 7d 43 28 d0 aa ad 8c 09 4d 88 +b9 eb 09 8b 95 f2 10 54 a2 90 82 52 2b e7 c2 7a +31 28 78 b6 37 91 7e 3d 81 9e 6c 3c 56 8d b5 d8 +43 80 2b 06 d5 1d 9e 98 a2 be 0b f4 0c 03 14 23 +b0 0e df bf f8 32 0e fb 91 71 bd 20 44 65 3a 4c +b9 c5 12 2f 6c 65 e8 3c da 2e c3 c1 26 02 7a 9c +1a 56 ba 87 4d 0f ea 23 f3 80 b8 2c f2 40 b8 cf +54 00 04 75 8c 4c 77 d9 34 15 7a 74 f3 fc 12 bf +ac + +# --------------------------------- +# RSAES-OAEP Encryption Example 7.5 +# --------------------------------- + +# Message to be encrypted: +bb 47 23 1c a5 ea 1d 3a d4 6c 99 34 5d 9a 8a 61 + +# Seed: +b2 16 6e d4 72 d5 8d b1 0c ab 2c 6b 00 0c cc f1 +0a 7d c5 09 + +# Encryption: +02 83 87 a3 18 27 74 34 79 8b 4d 97 f4 60 06 8d +f5 29 8f ab a5 04 1b a1 17 61 a1 cb 73 16 b2 41 +84 11 4e c5 00 25 7e 25 89 ed 3b 60 7a 1e bb e9 +7a 6c c2 e0 2b f1 b6 81 f4 23 12 a3 3b 7a 77 d8 +e7 85 5c 4a 6d e0 3e 3c 04 64 3f 78 6b 91 a2 64 +a0 d6 80 5e 2c ea 91 e6 81 77 eb 7a 64 d9 25 5e +4f 27 e7 13 b7 cc ec 00 dc 20 0e bd 21 c2 ea 2b +b8 90 fe ae 49 42 df 94 1d c3 f9 78 90 ed 34 74 +78 + +# --------------------------------- +# RSAES-OAEP Encryption Example 7.6 +# --------------------------------- + +# Message to be encrypted: +21 84 82 70 95 d3 5c 3f 86 f6 00 e8 e5 97 54 01 +32 96 + +# Seed: +52 67 3b de 2c a1 66 c2 aa 46 13 1a c1 dc 80 8d +67 d7 d3 b1 + +# Encryption: +14 c6 78 a9 4a d6 05 25 ef 39 e9 59 b2 f3 ba 5c +09 7a 94 ff 91 2b 67 db ac e8 05 35 c1 87 ab d4 +7d 07 54 20 b1 87 21 52 bb a0 8f 7f c3 1f 31 3b +bf 92 73 c9 12 fc 4c 01 49 a9 b0 cf b7 98 07 e3 +46 eb 33 20 69 61 1b ec 0f f9 bc d1 68 f1 f7 c3 +3e 77 31 3c ea 45 4b 94 e2 54 9e ec f0 02 e2 ac +f7 f6 f2 d2 84 5d 4f e0 aa b2 e5 a9 2d df 68 c4 +80 ae 11 24 79 35 d1 f6 25 74 84 22 16 ae 67 41 +15 + +# ============================================= + +# ================================== +# Example 8: A 1031-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +5b df 0e 30 d3 21 dd a5 14 7f 88 24 08 fa 69 19 +54 80 df 8f 80 d3 f6 e8 bf 58 18 50 4f 36 42 7c +a9 b1 f5 54 0b 9c 65 a8 f6 97 4c f8 44 7a 24 4d +92 80 20 1b b4 9f cb be 63 78 d1 94 4c d2 27 e2 +30 f9 6e 3d 10 f8 19 dc ef 27 6c 64 a0 0b 2a 4b +67 01 e7 d0 1d e5 fa bd e3 b1 e9 a0 df 82 f4 63 +13 59 cd 22 66 96 47 fb b1 71 72 46 13 4e d7 b4 +97 cf ff bd c4 2b 59 c7 3a 96 ed 90 16 62 12 df +f7 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +0f 7d 1e 9e 5a aa 25 fd 13 e4 a0 66 3a e1 44 e0 +d1 5f 5c d1 8b cd b0 9d f2 cc 7e 64 e3 c5 e9 15 +ad 62 64 53 04 16 1d 09 8c 71 5b b7 ab 8b d0 1d +07 ea f3 fe d7 c7 ed 08 af 2a 8a 62 ef 44 ab 16 +b3 20 e1 4a f7 2a 48 f9 6a fe 26 2a 0a e4 cf 65 +e6 35 e9 10 79 0c d4 ee 5c ea 76 8a 4b 26 39 f7 +e6 f6 77 b3 f0 bb 6b e3 2b 75 74 7d 89 09 03 6f +02 64 f5 8d 40 1c db a1 31 71 61 57 a7 5e cf 63 +31 + +# Prime p: +0a 02 ef 84 48 d9 fa d8 bb d0 d0 04 c8 c2 aa 97 +51 ef 97 21 c1 b0 d0 32 36 a5 4b 0d f9 47 cb ae +d5 a2 55 ee 9e 8e 20 d4 91 ea 17 23 fe 09 47 04 +a9 76 2e 88 af d1 6e bb 59 94 41 2c a9 66 dc 4f +9f + +# Prime q: +09 2d 36 2e 7e d3 a0 bf d9 e9 fd 0e 6c 03 01 b6 +df 29 15 9c f5 0c c8 3b 9b 0c f4 d6 ee a7 1a 61 +e0 02 b4 6e 0a e9 f2 de 62 d2 5b 5d 74 52 d4 98 +b8 1c 9a c6 fc 58 59 3d 4c 3f b4 f5 d7 2d fb b0 +a9 + +# p's CRT exponent dP: +07 c7 14 10 af 10 39 62 db 36 74 04 e3 7a e8 50 +ba a4 e9 c2 9d d9 21 45 81 52 94 a6 7c 7d 1c 6d +ed 26 3a a0 30 a9 b6 33 ae 50 30 3e 14 03 5d 1a +f0 14 12 3e ba 68 78 20 30 8d 8e bc 85 b6 95 7d +7d + +# q's CRT exponent dQ: +ae 2c 75 38 0c 02 c0 16 ad 05 89 1b 33 01 de 88 +1f 28 ae 11 71 18 2b 6b 2c 83 be a7 c5 15 ec a9 +ca 29 8c 7b 1c ab 58 17 a5 97 06 8f c8 50 60 de +4d a8 a0 16 37 8a ae 43 c7 f9 67 bc c3 79 04 b9 + +# CRT coefficient qInv: +05 98 d1 05 9e 3a da 4f 63 20 75 2c 09 d8 05 ff +7d 1f 1a e0 d0 17 ae ee e9 ce fa 0d 7d d7 ff 77 +5e 44 b5 78 32 2f 64 05 d6 21 1d a1 95 19 66 6a +a8 7f dc 4c d8 c8 8f 6b 6e 3d 67 e9 61 dc bb a3 +d0 + +# --------------------------------- +# RSAES-OAEP Encryption Example 8.1 +# --------------------------------- + +# Message to be encrypted: +05 0b 75 5e 5e 68 80 f7 b9 e9 d6 92 a7 4c 37 aa +e4 49 b3 1b fe a6 de ff 83 74 7a 89 7f 6c 2c 82 +5b b1 ad bf 85 0a 3c 96 99 4b 5d e5 b3 3c bc 7d +4a 17 91 3a 79 67 + +# Seed: +77 06 ff ca 1e cf b1 eb ee 2a 55 e5 c6 e2 4c d2 +79 7a 41 25 + +# Encryption: +09 b3 68 3d 8a 2e b0 fb 29 5b 62 ed 1f b9 29 0b +71 44 57 b7 82 53 19 f4 64 78 72 af 88 9b 30 40 +94 72 02 0a d1 29 12 bf 19 b1 1d 48 19 f4 96 14 +82 4f fd 84 d0 9c 0a 17 e7 d1 73 09 d1 29 19 79 +04 10 aa 29 95 69 9f 6a 86 db e3 24 2b 5a cc 23 +af 45 69 10 80 d6 b1 ae 81 0f b3 e3 05 70 87 f0 +97 00 92 ce 00 be 95 62 ff 40 53 b6 26 2c e0 ca +a9 3e 13 72 3d 2e 3a 5b a0 75 d4 5f 0d 61 b5 4b +61 + +# --------------------------------- +# RSAES-OAEP Encryption Example 8.2 +# --------------------------------- + +# Message to be encrypted: +4e b6 8d cd 93 ca 9b 19 df 11 1b d4 36 08 f5 57 +02 6f e4 aa 1d 5c fa c2 27 a3 eb 5a b9 54 8c 18 +a0 6d de d2 3f 81 82 59 86 b2 fc d7 11 09 ec ef +7e ff 88 87 3f 07 5c 2a a0 c4 69 f6 9c 92 bc + +# Seed: +a3 71 7d a1 43 b4 dc ff bc 74 26 65 a8 fa 95 05 +85 54 83 43 + +# Encryption: +2e cf 15 c9 7c 5a 15 b1 47 6a e9 86 b3 71 b5 7a +24 28 4f 4a 16 2a 8d 0c 81 82 e7 90 5e 79 22 56 +f1 81 2b a5 f8 3f 1f 7a 13 0e 42 dc c0 22 32 84 +4e dc 14 a3 1a 68 ee 97 ae 56 4a 38 3a 34 11 65 +64 24 c5 f6 2d db 64 60 93 c3 67 be 1f cd a4 26 +cf 00 a0 6d 8a cb 7e 57 77 6f bb d8 55 ac 3d f5 +06 fc 16 b1 d7 c3 f2 11 0f 3d 80 68 e9 1e 18 63 +63 83 1c 84 09 68 0d 8d a9 ec d8 cf 1f a2 0e e3 +9d + +# --------------------------------- +# RSAES-OAEP Encryption Example 8.3 +# --------------------------------- + +# Message to be encrypted: +86 04 ac 56 32 8c 1a b5 ad 91 78 61 + +# Seed: +ee 06 20 90 73 cc a0 26 bb 26 4e 51 85 bf 8c 68 +b7 73 9f 86 + +# Encryption: +4b c8 91 30 a5 b2 da bb 7c 2f cf 90 eb 5d 0e af +9e 68 1b 71 46 a3 8f 31 73 a3 d9 cf ec 52 ea 9e +0a 41 93 2e 64 8a 9d 69 34 4c 50 da 76 3f 51 a0 +3c 95 76 21 31 e8 05 22 54 dc d2 24 8c ba 40 fd +31 66 77 86 ce 05 a2 b7 b5 31 ac 9d ac 9e d5 84 +a5 9b 67 7c 1a 8a ed 8c 5d 15 d6 8c 05 56 9e 2b +e7 80 bf 7d b6 38 fd 2b fd 2a 85 ab 27 68 60 f3 +77 73 38 fc a9 89 ff d7 43 d1 3e e0 8e 0c a9 89 +3f + +# --------------------------------- +# RSAES-OAEP Encryption Example 8.4 +# --------------------------------- + +# Message to be encrypted: +fd da 5f bf 6e c3 61 a9 d9 a4 ac 68 af 21 6a 06 +86 f4 38 b1 e0 e5 c3 6b 95 5f 74 e1 07 f3 9c 0d +dd cc + +# Seed: +99 0a d5 73 dc 48 a9 73 23 5b 6d 82 54 36 18 f2 +e9 55 10 5d + +# Encryption: +2e 45 68 47 d8 fc 36 ff 01 47 d6 99 35 94 b9 39 +72 27 d5 77 75 2c 79 d0 f9 04 fc b0 39 d4 d8 12 +fe a6 05 a7 b5 74 dd 82 ca 78 6f 93 75 23 48 43 +8e e9 f5 b5 45 49 85 d5 f0 e1 69 9e 3e 7a d1 75 +a3 2e 15 f0 3d eb 04 2a b9 fe 1d d9 db 1b b8 6f +8c 08 9c cb 45 e7 ef 0c 5e e7 ca 9b 72 90 ca 6b +15 be d4 70 39 78 8a 8a 93 ff 83 e0 e8 d6 24 4c +71 00 63 62 de ef 69 b6 f4 16 fb 3c 68 43 83 fb +d0 + +# --------------------------------- +# RSAES-OAEP Encryption Example 8.5 +# --------------------------------- + +# Message to be encrypted: +4a 5f 49 14 be e2 5d e3 c6 93 41 de 07 + +# Seed: +ec c6 3b 28 f0 75 6f 22 f5 2a c8 e6 ec 12 51 a6 +ec 30 47 18 + +# Encryption: +1f b9 35 6f d5 c4 b1 79 6d b2 eb f7 d0 d3 93 cc +81 0a df 61 45 de fc 2f ce 71 4f 79 d9 38 00 d5 +e2 ac 21 1e a8 bb ec ca 4b 65 4b 94 c3 b1 8b 30 +dd 57 6c e3 4d c9 54 36 ef 57 a0 94 15 64 59 23 +35 9a 5d 7b 41 71 ef 22 c2 46 70 f1 b2 29 d3 60 +3e 91 f7 66 71 b7 df 97 e7 31 7c 97 73 44 76 d5 +f3 d1 7d 21 cf 82 b5 ba 9f 83 df 2e 58 8d 36 98 +4f d1 b5 84 46 8b d2 3b 2e 87 5f 32 f6 89 53 f7 +b2 + +# --------------------------------- +# RSAES-OAEP Encryption Example 8.6 +# --------------------------------- + +# Message to be encrypted: +8e 07 d6 6f 7b 88 0a 72 56 3a bc d3 f3 50 92 bc +33 40 9f b7 f8 8f 24 72 be + +# Seed: +39 25 c7 1b 36 2d 40 a0 a6 de 42 14 55 79 ba 1e +7d d4 59 fc + +# Encryption: +3a fd 9c 66 00 14 7b 21 79 8d 81 8c 65 5a 0f 4c +92 12 db 26 d0 b0 df dc 2a 75 94 cc b3 d2 2f 5b +f1 d7 c3 e1 12 cd 73 fc 7d 50 9c 7a 8b af dd 3c +27 4d 13 99 00 9f 96 09 ec 4b e6 47 7e 45 3f 07 +5a a3 3d b3 82 87 0c 1c 34 09 ae f3 92 d7 38 6a +e3 a6 96 b9 9a 94 b4 da 05 89 44 7e 95 5d 16 c9 +8b 17 60 2a 59 bd 73 62 79 fc d8 fb 28 0c 44 62 +d5 90 bf a9 bf 13 fe d5 70 ea fd e9 73 30 a2 c2 +10 + +# ============================================= + +# ================================== +# Example 9: A 1536-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +cf 2c d4 1e 34 ca 3a 72 8e a5 cb 8a ff 64 c3 6d +27 bd ef 53 64 e3 36 fd 68 d3 12 3c 5a 19 6a 8c +28 70 13 e8 53 d5 15 6d 58 d1 51 95 45 20 fb 4f +6d 7b 17 ab b6 81 77 65 90 9c 57 61 19 65 9d 90 +2b 19 06 ed 8a 2b 10 c1 55 c2 4d 12 45 28 da b9 +ee ae 37 9b ea c6 6e 4a 41 17 86 dc b8 fd 00 62 +eb c0 30 de 12 19 a0 4c 2a 8c 1b 7d d3 13 1e 4d +6b 6c ae e2 e3 1a 5e d4 1a c1 50 9b 2e f1 ee 2a +b1 83 64 be 56 8c a9 41 c2 5e cc 84 ff 9d 64 3b +5e c1 aa ae 10 2a 20 d7 3f 47 9b 78 0f d6 da 91 +07 52 12 d9 ea c0 3a 06 74 d8 99 eb a2 e4 31 f4 +c4 4b 61 5b 6b a2 23 2b d4 b3 3b ae d7 3d 62 5d + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +19 8c 14 1e 23 71 5a 92 bc cf 6a 11 9a 5b c1 13 +89 46 8d 28 11 f5 48 d7 27 e1 7b 4a b0 eb 98 6d +6f 21 1e fb 53 b7 1f 7c cb ea 87 ee 69 c7 5e e6 +15 00 8c 53 32 de b5 2b f3 90 ab df bf e3 7d 72 +05 36 81 59 b2 63 8c 1d e3 26 e2 1d 22 25 1f 0f +b5 84 8b 3b f1 50 05 d2 a7 43 30 f0 af e9 16 ee +62 cc c1 34 4d 1d 83 a7 09 e6 06 76 27 38 40 f7 +f3 77 42 4a 5e 0a 4d a7 5f 01 b3 1f f7 68 19 cf +9c bf dd 21 52 43 c3 91 7c 03 ef 38 19 93 12 e5 +67 b3 bf 7a ed 3a b4 57 f3 71 ef 8a 14 23 f4 5b +68 c6 e2 82 ec 11 1b ba 28 33 b9 87 fd 69 fa d8 +3b c1 b8 c6 13 c5 e1 ea 16 c1 1e d1 25 ea 7e c1 + +# Prime p: +fc 8d 6c 04 be c4 eb 9a 81 92 ca 79 00 cb e5 36 +e2 e8 b5 19 de cf 33 b2 45 97 98 c6 90 9d f4 f1 +76 db 7d 23 19 0f c7 2b 88 65 a7 18 af 89 5f 1b +cd 91 45 29 80 27 42 3b 60 5e 70 a4 7c f5 83 90 +a8 c3 e8 8f c8 c4 8e 8b 32 e3 da 21 0d fb e3 e8 +81 ea 56 74 b6 a3 48 c2 1e 93 f9 e5 5e a6 5e fd + +# Prime q: +d2 00 d4 5e 78 8a ac ea 60 6a 40 1d 04 60 f8 7d +d5 c1 02 7e 12 dc 1a 0d 75 86 e8 93 9d 9c f7 89 +b4 0f 51 ac 04 42 96 1d e7 d2 1c c2 1e 05 c8 31 +55 c1 f2 aa 91 93 38 7c fd f9 56 cb 48 d1 53 ba +27 04 06 f9 bb ba 53 7d 49 87 d9 e2 f9 94 2d 7a +14 cb ff fe a7 4f ec dd a9 28 d2 3e 25 9f 5e e1 + +# p's CRT exponent dP: +db 16 80 2f 79 a2 f0 d4 5f 35 8d 69 fd 33 e4 4b +81 fa e8 28 62 2e 93 a5 42 53 e9 97 d0 1b 07 43 +75 9d a0 e8 12 b4 aa 4e 6c 8b ea b2 32 8d 54 31 +95 5a 41 8a 67 ff 26 a8 c5 c8 07 a5 da 35 4e 05 +ef 31 cc 8c f7 58 f4 63 73 29 50 b0 3e 26 57 26 +fb 94 e3 9d 6a 57 2a 26 24 4a b0 8d b7 57 52 ad + +# q's CRT exponent dQ: +a0 a3 17 cf e7 df 14 23 f8 7a 6d ee 84 51 f4 e2 +b4 a6 7e 54 97 f2 9b 4f 1e 4e 83 0b 9f ad d9 40 +11 67 02 6f 55 96 e5 a3 9c 97 81 7e 0f 5f 16 e2 +7e 19 ec 99 02 e0 1d 7e a6 fb 9a a3 c7 60 af ee +1e 38 1b 69 de 6a c9 c0 75 85 a0 6a d9 c4 ba 00 +bf 75 c8 ad 2f a8 98 a4 79 e8 0a e2 94 fe d2 a1 + +# CRT coefficient qInv: +0b 21 f3 35 c3 53 34 2e b4 4c 3a a2 44 45 78 0c +2d 65 5b 94 01 74 ca e3 8c 7c 8a 4e 64 93 c0 ba +9f d3 03 74 82 67 b0 83 b9 a7 a6 cb 61 e4 2d b3 +62 b8 c9 89 6d b7 06 4e 02 ad 5a e6 15 87 da 15 +b4 64 9c 90 59 49 09 fe b3 7d bc b6 54 be b7 26 +8e c8 01 e5 a8 b4 aa 39 11 be bd 88 54 2f 05 be + +# --------------------------------- +# RSAES-OAEP Encryption Example 9.1 +# --------------------------------- + +# Message to be encrypted: +f7 35 fd 55 ba 92 59 2c 3b 52 b8 f9 c4 f6 9a aa +1c be f8 fe 88 ad d0 95 59 54 12 46 7f 9c f4 ec +0b 89 6c 59 ed a1 62 10 e7 54 9c 8a bb 10 cd bc +21 a1 2e c9 b6 b5 b8 fd 2f 10 39 9e b6 + +# Seed: +8e c9 65 f1 34 a3 ec 99 31 e9 2a 1c a0 dc 81 69 +d5 ea 70 5c + +# Encryption: +26 7b cd 11 8a ca b1 fc 8b a8 1c 85 d7 30 03 cb +86 10 fa 55 c1 d9 7d a8 d4 8a 7c 7f 06 89 6a 4d +b7 51 aa 28 42 55 b9 d3 6a d6 5f 37 65 3d 82 9f +1b 37 f9 7b 80 01 94 25 45 b2 fc 2c 55 a7 37 6c +a7 a1 be 4b 17 60 c8 e0 5a 33 e5 aa 25 26 b8 d9 +8e 31 70 88 e7 83 4c 75 5b 2a 59 b1 26 31 a1 82 +c0 5d 5d 43 ab 17 79 26 4f 84 56 f5 15 ce 57 df +df 51 2d 54 93 da b7 b7 33 8d c4 b7 d7 8d b9 c0 +91 ac 3b af 53 7a 69 fc 7f 54 9d 97 9f 0e ff 9a +94 fd a4 16 9b d4 d1 d1 9a 69 c9 9e 33 c3 b5 54 +90 d5 01 b3 9b 1e da e1 18 ff 67 93 a1 53 26 15 +84 d3 a5 f3 9f 6e 68 2e 3d 17 c8 cd 12 61 fa 72 + +# --------------------------------- +# RSAES-OAEP Encryption Example 9.2 +# --------------------------------- + +# Message to be encrypted: +81 b9 06 60 50 15 a6 3a ab e4 2d df 11 e1 97 89 +12 f5 40 4c 74 74 b2 6d ce 3e d4 82 bf 96 1e cc +81 8b f4 20 c5 46 59 + +# Seed: +ec b1 b8 b2 5f a5 0c da b0 8e 56 04 28 67 f4 af +58 26 d1 6c + +# Encryption: +93 ac 9f 06 71 ec 29 ac bb 44 4e ff c1 a5 74 13 +51 d6 0f db 0e 39 3f bf 75 4a cf 0d e4 97 61 a1 +48 41 df 77 72 e9 bc 82 77 39 66 a1 58 4c 4d 72 +ba ea 00 11 8f 83 f3 5c ca 6e 53 7c bd 4d 81 1f +55 83 b2 97 83 d8 a6 d9 4c d3 1b e7 0d 6f 52 6c +10 ff 09 c6 fa 7c e0 69 79 5a 3f cd 05 11 fd 5f +cb 56 4b cc 80 ea 9c 78 f3 8b 80 01 25 39 d8 a4 +dd f6 fe 81 e9 cd db 7f 50 db bb bc c7 e5 d8 60 +97 cc f4 ec 49 18 9f b8 bf 31 8b e6 d5 a0 71 5d +51 6b 49 af 19 12 58 cd 32 dc 83 3c e6 eb 46 73 +c0 3a 19 bb ac e8 8c c5 48 95 f6 36 cc 0c 1e c8 +90 96 d1 1c e2 35 a2 65 ca 17 64 23 2a 68 9a e8 + +# --------------------------------- +# RSAES-OAEP Encryption Example 9.3 +# --------------------------------- + +# Message to be encrypted: +fd 32 64 29 df 9b 89 0e 09 b5 4b 18 b8 f3 4f 1e +24 + +# Seed: +e8 9b b0 32 c6 ce 62 2c bd b5 3b c9 46 60 14 ea +77 f7 77 c0 + +# Encryption: +81 eb dd 95 05 4b 0c 82 2e f9 ad 76 93 f5 a8 7a +df b4 b4 c4 ce 70 df 2d f8 4e d4 9c 04 da 58 ba +5f c2 0a 19 e1 a6 e8 b7 a3 90 0b 22 79 6d c4 e8 +69 ee 6b 42 79 2d 15 a8 ec eb 56 c0 9c 69 91 4e +81 3c ea 8f 69 31 e4 b8 ed 6f 42 1a f2 98 d5 95 +c9 7f 47 89 c7 ca a6 12 c7 ef 36 09 84 c2 1b 93 +ed c5 40 10 68 b5 af 4c 78 a8 77 1b 98 4d 53 b8 +ea 8a df 2f 6a 7d 4a 0b a7 6c 75 e1 dd 9f 65 8f +20 de d4 a4 60 71 d4 6d 77 91 b5 68 03 d8 fe a7 +f0 b0 f8 e4 1a e3 f0 93 83 a6 f9 58 5f e7 75 3e +aa ff d2 bf 94 56 31 08 be ec c2 07 bb b5 35 f5 +fc c7 05 f0 dd e9 f7 08 c6 2f 49 a9 c9 03 71 d3 + +# --------------------------------- +# RSAES-OAEP Encryption Example 9.4 +# --------------------------------- + +# Message to be encrypted: +f1 45 9b 5f 0c 92 f0 1a 0f 72 3a 2e 56 62 48 4d +8f 8c 0a 20 fc 29 da d6 ac d4 3b b5 f3 ef fd f4 +e1 b6 3e 07 fd fe 66 28 d0 d7 4c a1 9b f2 d6 9e +4a 0a bf 86 d2 93 92 5a 79 67 72 f8 08 8e + +# Seed: +60 6f 3b 99 c0 b9 cc d7 71 ea a2 9e a0 e4 c8 84 +f3 18 9c cc + +# Encryption: +bc c3 5f 94 cd e6 6c b1 13 66 25 d6 25 b9 44 32 +a3 5b 22 f3 d2 fa 11 a6 13 ff 0f ca 5b d5 7f 87 +b9 02 cc dc 1c d0 ae bc b0 71 5e e8 69 d1 d1 fe +39 5f 67 93 00 3f 5e ca 46 50 59 c8 86 60 d4 46 +ff 5f 08 18 55 20 22 55 7e 38 c0 8a 67 ea d9 91 +26 22 54 f1 06 82 97 5e c5 63 97 76 85 37 f4 97 +7a f6 d5 f6 aa ce b7 fb 25 de c5 93 72 30 23 1f +d8 97 8a f4 91 19 a2 9f 29 e4 24 ab 82 72 b4 75 +62 79 2d 5c 94 f7 74 b8 82 9d 0b 0d 9f 1a 8c 9e +dd f3 75 74 d5 fa 24 8e ef a9 c5 27 1f c5 ec 25 +79 c8 1b dd 61 b4 10 fa 61 fe 36 e4 24 22 1c 11 +3a dd b2 75 66 4c 80 1d 34 ca 8c 63 51 e4 a8 58 + +# --------------------------------- +# RSAES-OAEP Encryption Example 9.5 +# --------------------------------- + +# Message to be encrypted: +53 e6 e8 c7 29 d6 f9 c3 19 dd 31 7e 74 b0 db 8e +4c cc a2 5f 3c 83 05 74 6e 13 7a c6 3a 63 ef 37 +39 e7 b5 95 ab b9 6e 8d 55 e5 4f 7b d4 1a b4 33 +37 8f fb 91 1d + +# Seed: +fc bc 42 14 02 e9 ec ab c6 08 2a fa 40 ba 5f 26 +52 2c 84 0e + +# Encryption: +23 2a fb c9 27 fa 08 c2 f6 a2 7b 87 d4 a5 cb 09 +c0 7d c2 6f ae 73 d7 3a 90 55 88 39 f4 fd 66 d2 +81 b8 7e c7 34 bc e2 37 ba 16 66 98 ed 82 91 06 +a7 de 69 42 cd 6c dc e7 8f ed 8d 2e 4d 81 42 8e +66 49 0d 03 62 64 ce f9 2a f9 41 d3 e3 50 55 fe +39 81 e1 4d 29 cb b9 a4 f6 74 73 06 3b ae c7 9a +11 79 f5 a1 7c 9c 18 32 f2 83 8f d7 d5 e5 9b b9 +65 9d 56 dc e8 a0 19 ed ef 1b b3 ac cc 69 7c c6 +cc 7a 77 8f 60 a0 64 c7 f6 f5 d5 29 c6 21 02 62 +e0 03 de 58 3e 81 e3 16 7b 89 97 1f b8 c0 e1 5d +44 ff fe f8 9b 53 d8 d6 4d d7 97 d1 59 b5 6d 2b +08 ea 53 07 ea 12 c2 41 bd 58 d4 ee 27 8a 1f 2e + +# --------------------------------- +# RSAES-OAEP Encryption Example 9.6 +# --------------------------------- + +# Message to be encrypted: +b6 b2 8e a2 19 8d 0c 10 08 bc 64 + +# Seed: +23 aa de 0e 1e 08 bb 9b 9a 78 d2 30 2a 52 f9 c2 +1b 2e 1b a2 + +# Encryption: +43 8c c7 dc 08 a6 8d a2 49 e4 25 05 f8 57 3b a6 +0e 2c 27 73 d5 b2 90 f4 cf 9d ff 71 8e 84 20 81 +c3 83 e6 70 24 a0 f2 95 94 ea 98 7b 9d 25 e4 b7 +38 f2 85 97 0d 19 5a bb 3a 8c 80 54 e3 d7 9d 6b +9c 9a 83 27 ba 59 6f 12 59 e2 71 26 67 47 66 90 +7d 8d 58 2f f3 a8 47 61 54 92 9a db 1e 6d 12 35 +b2 cc b4 ec 8f 66 3b a9 cc 67 0a 92 be bd 85 3c +8d bf 69 c6 43 6d 01 6f 61 ad d8 36 e9 47 32 45 +04 34 20 7f 9f d4 c4 3d ec 2a 12 a9 58 ef a0 1e +fe 26 69 89 9b 5e 60 4c 25 5c 55 fb 71 66 de 55 +89 e3 69 59 7b b0 91 68 c0 6d d5 db 17 7e 06 a1 +74 0e b2 d5 c8 2f ae ca 6d 92 fc ee 99 31 ba 9f + +# ============================================= + +# =================================== +# Example 10: A 2048-bit RSA Key Pair +# =================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +ae 45 ed 56 01 ce c6 b8 cc 05 f8 03 93 5c 67 4d +db e0 d7 5c 4c 09 fd 79 51 fc 6b 0c ae c3 13 a8 +df 39 97 0c 51 8b ff ba 5e d6 8f 3f 0d 7f 22 a4 +02 9d 41 3f 1a e0 7e 4e be 9e 41 77 ce 23 e7 f5 +40 4b 56 9e 4e e1 bd cf 3c 1f b0 3e f1 13 80 2d +4f 85 5e b9 b5 13 4b 5a 7c 80 85 ad ca e6 fa 2f +a1 41 7e c3 76 3b e1 71 b0 c6 2b 76 0e de 23 c1 +2a d9 2b 98 08 84 c6 41 f5 a8 fa c2 6b da d4 a0 +33 81 a2 2f e1 b7 54 88 50 94 c8 25 06 d4 01 9a +53 5a 28 6a fe b2 71 bb 9b a5 92 de 18 dc f6 00 +c2 ae ea e5 6e 02 f7 cf 79 fc 14 cf 3b dc 7c d8 +4f eb bb f9 50 ca 90 30 4b 22 19 a7 aa 06 3a ef +a2 c3 c1 98 0e 56 0c d6 4a fe 77 95 85 b6 10 76 +57 b9 57 85 7e fd e6 01 09 88 ab 7d e4 17 fc 88 +d8 f3 84 c4 e6 e7 2c 3f 94 3e 0c 31 c0 c4 a5 cc +36 f8 79 d8 a3 ac 9d 7d 59 86 0e aa da 6b 83 bb + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +05 6b 04 21 6f e5 f3 54 ac 77 25 0a 4b 6b 0c 85 +25 a8 5c 59 b0 bd 80 c5 64 50 a2 2d 5f 43 8e 59 +6a 33 3a a8 75 e2 91 dd 43 f4 8c b8 8b 9d 5f c0 +d4 99 f9 fc d1 c3 97 f9 af c0 70 cd 9e 39 8c 8d +19 e6 1d b7 c7 41 0a 6b 26 75 df bf 5d 34 5b 80 +4d 20 1a dd 50 2d 5c e2 df cb 09 1c e9 99 7b be +be 57 30 6f 38 3e 4d 58 81 03 f0 36 f7 e8 5d 19 +34 d1 52 a3 23 e4 a8 db 45 1d 6f 4a 5b 1b 0f 10 +2c c1 50 e0 2f ee e2 b8 8d ea 4a d4 c1 ba cc b2 +4d 84 07 2d 14 e1 d2 4a 67 71 f7 40 8e e3 05 64 +fb 86 d4 39 3a 34 bc f0 b7 88 50 1d 19 33 03 f1 +3a 22 84 b0 01 f0 f6 49 ea f7 93 28 d4 ac 5c 43 +0a b4 41 49 20 a9 46 0e d1 b7 bc 40 ec 65 3e 87 +6d 09 ab c5 09 ae 45 b5 25 19 01 16 a0 c2 61 01 +84 82 98 50 9c 1c 3b f3 a4 83 e7 27 40 54 e1 5e +97 07 50 36 e9 89 f6 09 32 80 7b 52 57 75 1e 79 + +# Prime p: +ec f5 ae cd 1e 55 15 ff fa cb d7 5a 28 16 c6 eb +f4 90 18 cd fb 46 38 e1 85 d6 6a 73 96 b6 f8 09 +0f 80 18 c7 fd 95 cc 34 b8 57 dc 17 f0 cc 65 16 +bb 13 46 ab 4d 58 2c ad ad 7b 41 03 35 23 87 b7 +03 38 d0 84 04 7c 9d 95 39 b6 49 62 04 b3 dd 6e +a4 42 49 92 07 be c0 1f 96 42 87 ff 63 36 c3 98 +46 58 33 68 46 f5 6e 46 86 18 81 c1 02 33 d2 17 +6b f1 5a 5e 96 dd c7 80 bc 86 8a a7 7d 3c e7 69 + +# Prime q: +bc 46 c4 64 fc 6a c4 ca 78 3b 0e b0 8a 3c 84 1b +77 2f 7e 9b 2f 28 ba bd 58 8a e8 85 e1 a0 c6 1e +48 58 a0 fb 25 ac 29 99 90 f3 5b e8 51 64 c2 59 +ba 11 75 cd d7 19 27 07 13 51 84 99 2b 6c 29 b7 +46 dd 0d 2c ab e1 42 83 5f 7d 14 8c c1 61 52 4b +4a 09 94 6d 48 b8 28 47 3f 1c e7 6b 6c b6 88 6c +34 5c 03 e0 5f 41 d5 1b 5c 3a 90 a3 f2 40 73 c7 +d7 4a 4f e2 5d 9c f2 1c 75 96 0f 3f c3 86 31 83 + +# p's CRT exponent dP: +c7 35 64 57 1d 00 fb 15 d0 8a 3d e9 95 7a 50 91 +5d 71 26 e9 44 2d ac f4 2b c8 2e 86 2e 56 73 ff +6a 00 8e d4 d2 e3 74 61 7d f8 9f 17 a1 60 b4 3b +7f da 9c b6 b6 b7 42 18 60 98 15 f7 d4 5c a2 63 +c1 59 aa 32 d2 72 d1 27 fa f4 bc 8c a2 d7 73 78 +e8 ae b1 9b 0a d7 da 3c b3 de 0a e7 31 49 80 f6 +2b 6d 4b 0a 87 5d 1d f0 3c 1b ae 39 cc d8 33 ef +6c d7 e2 d9 52 8b f0 84 d1 f9 69 e7 94 e9 f6 c1 + +# q's CRT exponent dQ: +26 58 b3 7f 6d f9 c1 03 0b e1 db 68 11 7f a9 d8 +7e 39 ea 2b 69 3b 7e 6d 3a 2f 70 94 74 13 ee c6 +14 2e 18 fb 8d fc b6 ac 54 5d 7c 86 a0 ad 48 f8 +45 71 70 f0 ef b2 6b c4 81 26 c5 3e fd 1d 16 92 +01 98 dc 2a 11 07 dc 28 2d b6 a8 0c d3 06 23 60 +ba 3f a1 3f 70 e4 31 2f f1 a6 cd 6b 8f c4 cd 9c +5c 3d b1 7c 6d 6a 57 21 2f 73 ae 29 f6 19 32 7b +ad 59 b1 53 85 85 85 ba 4e 28 b6 0a 62 a4 5e 49 + +# CRT coefficient qInv: +6f 38 52 6b 39 25 08 55 34 ef 3e 41 5a 83 6e de +8b 86 15 8a 2c 7c bf ec cb 0b d8 34 30 4f ec 68 +3b a8 d4 f4 79 c4 33 d4 34 16 e6 32 69 62 3c ea +10 07 76 d8 5a ff 40 1d 3f ff 61 0e e6 54 11 ce +3b 13 63 d6 3a 97 09 ee de 42 64 7c ea 56 14 93 +d5 45 70 a8 79 c1 86 82 cd 97 71 0b 96 20 5e c3 +11 17 d7 3b 5f 36 22 3f ad d6 e8 ba 90 dd 7c 0e +e6 1d 44 e1 63 25 1e 20 c7 f6 6e b3 05 11 7c b8 + +# ---------------------------------- +# RSAES-OAEP Encryption Example 10.1 +# ---------------------------------- + +# Message to be encrypted: +8b ba 6b f8 2a 6c 0f 86 d5 f1 75 6e 97 95 68 70 +b0 89 53 b0 6b 4e b2 05 bc 16 94 ee + +# Seed: +47 e1 ab 71 19 fe e5 6c 95 ee 5e aa d8 6f 40 d0 +aa 63 bd 33 + +# Encryption: +53 ea 5d c0 8c d2 60 fb 3b 85 85 67 28 7f a9 15 +52 c3 0b 2f eb fb a2 13 f0 ae 87 70 2d 06 8d 19 +ba b0 7f e5 74 52 3d fb 42 13 9d 68 c3 c5 af ee +e0 bf e4 cb 79 69 cb f3 82 b8 04 d6 e6 13 96 14 +4e 2d 0e 60 74 1f 89 93 c3 01 4b 58 b9 b1 95 7a +8b ab cd 23 af 85 4f 4c 35 6f b1 66 2a a7 2b fc +c7 e5 86 55 9d c4 28 0d 16 0c 12 67 85 a7 23 eb +ee be ff 71 f1 15 94 44 0a ae f8 7d 10 79 3a 87 +74 a2 39 d4 a0 4c 87 fe 14 67 b9 da f8 52 08 ec +6c 72 55 79 4a 96 cc 29 14 2f 9a 8b d4 18 e3 c1 +fd 67 34 4b 0c d0 82 9d f3 b2 be c6 02 53 19 62 +93 c6 b3 4d 3f 75 d3 2f 21 3d d4 5c 62 73 d5 05 +ad f4 cc ed 10 57 cb 75 8f c2 6a ee fa 44 12 55 +ed 4e 64 c1 99 ee 07 5e 7f 16 64 61 82 fd b4 64 +73 9b 68 ab 5d af f0 e6 3e 95 52 01 68 24 f0 54 +bf 4d 3c 8c 90 a9 7b b6 b6 55 32 84 eb 42 9f cc + +# ---------------------------------- +# RSAES-OAEP Encryption Example 10.2 +# ---------------------------------- + +# Message to be encrypted: +e6 ad 18 1f 05 3b 58 a9 04 f2 45 75 10 37 3e 57 + +# Seed: +6d 17 f5 b4 c1 ff ac 35 1d 19 5b f7 b0 9d 09 f0 +9a 40 79 cf + +# Encryption: +a2 b1 a4 30 a9 d6 57 e2 fa 1c 2b b5 ed 43 ff b2 +5c 05 a3 08 fe 90 93 c0 10 31 79 5f 58 74 40 01 +10 82 8a e5 8f b9 b5 81 ce 9d dd d3 e5 49 ae 04 +a0 98 54 59 bd e6 c6 26 59 4e 7b 05 dc 42 78 b2 +a1 46 5c 13 68 40 88 23 c8 5e 96 dc 66 c3 a3 09 +83 c6 39 66 4f c4 56 9a 37 fe 21 e5 a1 95 b5 77 +6e ed 2d f8 d8 d3 61 af 68 6e 75 02 29 bb d6 63 +f1 61 86 8a 50 61 5e 0c 33 7b ec 0c a3 5f ec 0b +b1 9c 36 eb 2e 0b bc c0 58 2f a1 d9 3a ac db 06 +10 63 f5 9f 2c e1 ee 43 60 5e 5d 89 ec a1 83 d2 +ac df e9 f8 10 11 02 2a d3 b4 3a 3d d4 17 da c9 +4b 4e 11 ea 81 b1 92 96 6e 96 6b 18 20 82 e7 19 +64 60 7b 4f 80 02 f3 62 99 84 4a 11 f2 ae 0f ae +ac 2e ae 70 f8 f4 f9 80 88 ac dc d0 ac 55 6e 9f +cc c5 11 52 19 08 fa d2 6f 04 c6 42 01 45 03 05 +77 87 58 b0 53 8b f8 b5 bb 14 4a 82 8e 62 97 95 + +# ---------------------------------- +# RSAES-OAEP Encryption Example 10.3 +# ---------------------------------- + +# Message to be encrypted: +51 0a 2c f6 0e 86 6f a2 34 05 53 c9 4e a3 9f bc +25 63 11 e8 3e 94 45 4b 41 24 + +# Seed: +38 53 87 51 4d ec cc 7c 74 0d d8 cd f9 da ee 49 +a1 cb fd 54 + +# Encryption: +98 86 c3 e6 76 4a 8b 9a 84 e8 41 48 eb d8 c3 b1 +aa 80 50 38 1a 78 f6 68 71 4c 16 d9 cf d2 a6 ed +c5 69 79 c5 35 d9 de e3 b4 4b 85 c1 8b e8 92 89 +92 37 17 11 47 22 16 d9 5d da 98 d2 ee 83 47 c9 +b1 4d ff df f8 4a a4 8d 25 ac 06 f7 d7 e6 53 98 +ac 96 7b 1c e9 09 25 f6 7d ce 04 9b 7f 81 2d b0 +74 29 97 a7 4d 44 fe 81 db e0 e7 a3 fe af 2e 5c +40 af 88 8d 55 0d db be 3b c2 06 57 a2 95 43 f8 +fc 29 13 b9 bd 1a 61 b2 ab 22 56 ec 40 9b bd 7d +c0 d1 77 17 ea 25 c4 3f 42 ed 27 df 87 38 bf 4a +fc 67 66 ff 7a ff 08 59 55 5e e2 83 92 0f 4c 8a +63 c4 a7 34 0c ba fd dc 33 9e cd b4 b0 51 50 02 +f9 6c 93 2b 5b 79 16 7a f6 99 c0 ad 3f cc fd f0 +f4 4e 85 a7 02 62 bf 2e 18 fe 34 b8 50 58 99 75 +e8 67 ff 96 9d 48 ea bf 21 22 71 54 6c dc 05 a6 +9e cb 52 6e 52 87 0c 83 6f 30 7b d7 98 78 0e de + +# ---------------------------------- +# RSAES-OAEP Encryption Example 10.4 +# ---------------------------------- + +# Message to be encrypted: +bc dd 19 0d a3 b7 d3 00 df 9a 06 e2 2c aa e2 a7 +5f 10 c9 1f f6 67 b7 c1 6b de 8b 53 06 4a 26 49 +a9 40 45 c9 + +# Seed: +5c ac a6 a0 f7 64 16 1a 96 84 f8 5d 92 b6 e0 ef +37 ca 8b 65 + +# Encryption: +63 18 e9 fb 5c 0d 05 e5 30 7e 16 83 43 6e 90 32 +93 ac 46 42 35 8a aa 22 3d 71 63 01 3a ba 87 e2 +df da 8e 60 c6 86 0e 29 a1 e9 26 86 16 3e a0 b9 +17 5f 32 9c a3 b1 31 a1 ed d3 a7 77 59 a8 b9 7b +ad 6a 4f 8f 43 96 f2 8c f6 f3 9c a5 81 12 e4 81 +60 d6 e2 03 da a5 85 6f 3a ca 5f fe d5 77 af 49 +94 08 e3 df d2 33 e3 e6 04 db e3 4a 9c 4c 90 82 +de 65 52 7c ac 63 31 d2 9d c8 0e 05 08 a0 fa 71 +22 e7 f3 29 f6 cc a5 cf a3 4d 4d 1d a4 17 80 54 +57 e0 08 be c5 49 e4 78 ff 9e 12 a7 63 c4 77 d1 +5b bb 78 f5 b6 9b d5 78 30 fc 2c 4e d6 86 d7 9b +c7 2a 95 d8 5f 88 13 4c 6b 0a fe 56 a8 cc fb c8 +55 82 8b b3 39 bd 17 90 9c f1 d7 0d e3 33 5a e0 +70 39 09 3e 60 6d 65 53 65 de 65 50 b8 72 cd 6d +e1 d4 40 ee 03 1b 61 94 5f 62 9a d8 a3 53 b0 d4 +09 39 e9 6a 3c 45 0d 2a 8d 5e ee 9f 67 80 93 c8 + +# ---------------------------------- +# RSAES-OAEP Encryption Example 10.5 +# ---------------------------------- + +# Message to be encrypted: +a7 dd 6c 7d c2 4b 46 f9 dd 5f 1e 91 ad a4 c3 b3 +df 94 7e 87 72 32 a9 + +# Seed: +95 bc a9 e3 85 98 94 b3 dd 86 9f a7 ec d5 bb c6 +40 1b f3 e4 + +# Encryption: +75 29 08 72 cc fd 4a 45 05 66 0d 65 1f 56 da 6d +aa 09 ca 13 01 d8 90 63 2f 6a 99 2f 3d 56 5c ee +46 4a fd ed 40 ed 3b 5b e9 35 67 14 ea 5a a7 65 +5f 4a 13 66 c2 f1 7c 72 8f 6f 2c 5a 5d 1f 8e 28 +42 9b c4 e6 f8 f2 cf f8 da 8d c0 e0 a9 80 8e 45 +fd 09 ea 2f a4 0c b2 b6 ce 6f ff f5 c0 e1 59 d1 +1b 68 d9 0a 85 f7 b8 4e 10 3b 09 e6 82 66 64 80 +c6 57 50 5c 09 29 25 94 68 a3 14 78 6d 74 ea b1 +31 57 3c f2 34 bf 57 db 7d 9e 66 cc 67 48 19 2e +00 2d c0 de ea 93 05 85 f0 83 1f dc d9 bc 33 d5 +1f 79 ed 2f fc 16 bc f4 d5 98 12 fc eb ca a3 f9 +06 9b 0e 44 56 86 d6 44 c2 5c cf 63 b4 56 ee 5f +a6 ff e9 6f 19 cd f7 51 fe d9 ea f3 59 57 75 4d +bf 4b fe a5 21 6a a1 84 4d c5 07 cb 2d 08 0e 72 +2e ba 15 03 08 c2 b5 ff 11 93 62 0f 17 66 ec f4 +48 1b af b9 43 bd 29 28 77 f2 13 6c a4 94 ab a0 + +# ---------------------------------- +# RSAES-OAEP Encryption Example 10.6 +# ---------------------------------- + +# Message to be encrypted: +ea f1 a7 3a 1b 0c 46 09 53 7d e6 9c d9 22 8b bc +fb 9a 8c a8 c6 c3 ef af 05 6f e4 a7 f4 63 4e d0 +0b 7c 39 ec 69 22 d7 b8 ea 2c 04 eb ac + +# Seed: +9f 47 dd f4 2e 97 ee a8 56 a9 bd bc 71 4e b3 ac +22 f6 eb 32 + +# Encryption: +2d 20 7a 73 43 2a 8f b4 c0 30 51 b3 f7 3b 28 a6 +17 64 09 8d fa 34 c4 7a 20 99 5f 81 15 aa 68 16 +67 9b 55 7e 82 db ee 58 49 08 c6 e6 97 82 d7 de +b3 4d bd 65 af 06 3d 57 fc a7 6a 5f d0 69 49 2f +d6 06 8d 99 84 d2 09 35 05 65 a6 2e 5c 77 f2 30 +38 c1 2c b1 0c 66 34 70 9b 54 7c 46 f6 b4 a7 09 +bd 85 ca 12 2d 74 46 5e f9 77 62 c2 97 63 e0 6d +bc 7a 9e 73 8c 78 bf ca 01 02 dc 5e 79 d6 5b 97 +3f 28 24 0c aa b2 e1 61 a7 8b 57 d2 62 45 7e d8 +19 5d 53 e3 c7 ae 9d a0 21 88 3c 6d b7 c2 4a fd +d2 32 2e ac 97 2a d3 c3 54 c5 fc ef 1e 14 6c 3a +02 90 fb 67 ad f0 07 06 6e 00 42 8d 2c ec 18 ce +58 f9 32 86 98 de fe f4 b2 eb 5e c7 69 18 fd e1 +c1 98 cb b3 8b 7a fc 67 62 6a 9a ef ec 43 22 bf +d9 0d 25 63 48 1c 9a 22 1f 78 c8 27 2c 82 d1 b6 +2a b9 14 e1 c6 9f 6a f6 ef 30 ca 52 60 db 4a 46 + +# ============================================= diff --git a/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt b/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt new file mode 100755 index 000000000..412c11892 --- /dev/null +++ b/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt @@ -0,0 +1,9708 @@ +Test vectors for RSA PKCS#1 v1.5 Encryption +=========================================== + +This file contains test vectors for the PKCS#1 v1.5 +encryption scheme. 15 RSA keys of different sizes have +been generated. For each key, 20 random messages of length +between 1 and 64 octets have been PKCS#1 v1.5 encrypted. +As specified in PKCS#1, the block type for this operation is 2. +The seed value of each example provides the pseudo random bytes +to be used for padding. This makes the result predictable. +Note that each example can be used to test encryption and +decryption. + +Key lengths: + +Key 1: 1024 bits +Key 2: 1024 bits +Key 3: 1024 bits +Key 4: 1024 bits +Key 5: 1024 bits +Key 6: 1024 bits +Key 7: 1025 bits +Key 8: 1026 bits +Key 9: 1027 bits +Key 10: 1028 bits +Key 11: 1029 bits +Key 12: 1030 bits +Key 13: 1031 bits +Key 14: 1536 bits +Key 15: 2048 bits + +These test vectors have been derived from the OAEP test vectors. +============================================================================ +# Thirteen RSA keys with bit sizes between 1024 and 1031, one 1536-bit key, +# and one 2048-bit key are generated. + +# For each key, 20 random messages are PKCS#1 v1.5 encrypted with random seeds. + +# Example 1: A 1024-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +a8 b3 b2 84 af 8e b5 0b 38 70 34 a8 60 f1 46 c4 +91 9f 31 87 63 cd 6c 55 98 c8 ae 48 11 a1 e0 ab +c4 c7 e0 b0 82 d6 93 a5 e7 fc ed 67 5c f4 66 85 +12 77 2c 0c bc 64 a7 42 c6 c6 30 f5 33 c8 cc 72 +f6 2a e8 33 c4 0b f2 58 42 e9 84 bb 78 bd bf 97 +c0 10 7d 55 bd b6 62 f5 c4 e0 fa b9 84 5c b5 14 +8e f7 39 2d d3 aa ff 93 ae 1e 6b 66 7b b3 d4 24 +76 16 d4 f5 ba 10 d4 cf d2 26 de 88 d3 9f 16 fb + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +a8 b3 b2 84 af 8e b5 0b 38 70 34 a8 60 f1 46 c4 +91 9f 31 87 63 cd 6c 55 98 c8 ae 48 11 a1 e0 ab +c4 c7 e0 b0 82 d6 93 a5 e7 fc ed 67 5c f4 66 85 +12 77 2c 0c bc 64 a7 42 c6 c6 30 f5 33 c8 cc 72 +f6 2a e8 33 c4 0b f2 58 42 e9 84 bb 78 bd bf 97 +c0 10 7d 55 bd b6 62 f5 c4 e0 fa b9 84 5c b5 14 +8e f7 39 2d d3 aa ff 93 ae 1e 6b 66 7b b3 d4 24 +76 16 d4 f5 ba 10 d4 cf d2 26 de 88 d3 9f 16 fb + +# Public exponent: +01 00 01 + +# Exponent: +53 33 9c fd b7 9f c8 46 6a 65 5c 73 16 ac a8 5c +55 fd 8f 6d d8 98 fd af 11 95 17 ef 4f 52 e8 fd +8e 25 8d f9 3f ee 18 0f a0 e4 ab 29 69 3c d8 3b +15 2a 55 3d 4a c4 d1 81 2b 8b 9f a5 af 0e 7f 55 +fe 73 04 df 41 57 09 26 f3 31 1f 15 c4 d6 5a 73 +2c 48 31 16 ee 3d 3d 2d 0a f3 54 9a d9 bf 7c bf +b7 8a d8 84 f8 4d 5b eb 04 72 4d c7 36 9b 31 de +f3 7d 0c f5 39 e9 cf cd d3 de 65 37 29 ea d5 d1 + +# Prime 1: +d3 27 37 e7 26 7f fe 13 41 b2 d5 c0 d1 50 a8 1b +58 6f b3 13 2b ed 2f 8d 52 62 86 4a 9c b9 f3 0a +f3 8b e4 48 59 8d 41 3a 17 2e fb 80 2c 21 ac f1 +c1 1c 52 0c 2f 26 a4 71 dc ad 21 2e ac 7c a3 9d + +# Prime 2: +cc 88 53 d1 d5 4d a6 30 fa c0 04 f4 71 f2 81 c7 +b8 98 2d 82 24 a4 90 ed be b3 3d 3e 3d 5c c9 3c +47 65 70 3d 1d d7 91 64 2f 1f 11 6a 0d d8 52 be +24 19 b2 af 72 bf e9 a0 30 e8 60 b0 28 8b 5d 77 + +# Prime exponent 1: +0e 12 bf 17 18 e9 ce f5 59 9b a1 c3 88 2f e8 04 +6a 90 87 4e ef ce 8f 2c cc 20 e4 f2 74 1f b0 a3 +3a 38 48 ae c9 c9 30 5f be cb d2 d7 68 19 96 7d +46 71 ac c6 43 1e 40 37 96 8d b3 78 78 e6 95 c1 + +# Prime exponent 2: +95 29 7b 0f 95 a2 fa 67 d0 07 07 d6 09 df d4 fc +05 c8 9d af c2 ef 6d 6e a5 5b ec 77 1e a3 33 73 +4d 92 51 e7 90 82 ec da 86 6e fe f1 3c 45 9e 1a +63 13 86 b7 e3 54 c8 99 f5 f1 12 ca 85 d7 15 83 + +# Coefficient: +4f 45 6c 50 24 93 bd c0 ed 2a b7 56 a3 a6 ed 4d +67 35 2a 69 7d 42 16 e9 32 12 b1 27 a6 3d 54 11 +ce 6f a9 8d 5d be fd 73 26 3e 37 28 14 27 43 81 +81 66 ed 7d d6 36 87 dd 2a 8c a1 d2 f4 fb d8 e1 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# ---------------------------------- + +# Message: +66 28 19 4e 12 07 3d b0 3b a9 4c da 9e f9 53 23 +97 d5 0d ba 79 b9 87 00 4a fe fe 34 + +# Seed: +01 73 41 ae 38 75 d5 f8 71 01 f8 cc 4f a9 b9 bc +15 6b b0 46 28 fc cd b2 f4 f1 1e 90 5b d3 a1 55 +d3 76 f5 93 bd 73 04 21 08 74 eb a0 8a 5e 22 bc +cc b4 c9 d3 88 2a 93 a5 4d b0 22 f5 03 d1 63 38 +b6 b7 ce 16 dc 7f 4b bf 9a 96 b5 97 72 d6 60 6e +97 47 c7 64 9b f9 e0 83 db 98 18 84 a9 54 ab 3c +6f + +# Encryption: +50 b4 c1 41 36 bd 19 8c 2f 3c 3e d2 43 fc e0 36 +e1 68 d5 65 17 98 4a 26 3c d6 64 92 b8 08 04 f1 +69 d2 10 f2 b9 bd fb 48 b1 2f 9e a0 50 09 c7 7d +a2 57 cc 60 0c ce fe 3a 62 83 78 9d 8e a0 e6 07 +ac 58 e2 69 0e c4 eb c1 01 46 e8 cb aa 5e d4 d5 +cc e6 fe 7b 0f f9 ef c1 ea bb 56 4d bf 49 82 85 +f4 49 ee 61 dd 7b 42 ee 5b 58 92 cb 90 60 1f 30 +cd a0 7b f2 64 89 31 0b cd 23 b5 28 ce ab 3c 31 + +# PKCS#1 v1.5 Encryption Example 1.2 +# ---------------------------------- + +# Message: +75 0c 40 47 f5 47 e8 e4 14 11 85 65 23 29 8a c9 +ba e2 45 ef af 13 97 fb e5 6f 9d d5 + +# Seed: +ac 47 28 a8 42 8c 1e 52 24 71 a8 df 73 5a 8e 92 +92 af 0d 55 bc b7 3a 12 ac 32 c2 64 f3 88 1c 7c +8a 71 0f 70 fe b1 04 85 c8 37 0f 78 1f ff d0 21 +81 6f 05 87 39 76 6d a0 a9 c9 db 0e ae 7e 9a 25 +b6 c4 33 18 d0 ca ac 23 65 22 ca 31 0f 17 fc 52 +ad 42 29 c8 3a 24 e9 e5 45 eb 35 e9 82 6d 55 9f +57 + +# Encryption: +68 42 e5 e2 cc 00 41 d6 b0 c8 1a 56 2c 39 a6 17 +37 9a 51 5c ab 74 ab cb 26 19 c7 74 0a 54 1d 95 +55 dd 91 65 97 5b f8 a3 eb d0 d0 45 66 61 df b1 +a6 86 1b a2 33 22 69 93 0e 0d b5 14 fc a0 73 3e +eb 9c 40 57 13 eb 1f 9d 76 80 33 ed 29 3e 1e 08 +1a 12 5f 32 dd b9 ea 52 ed be 27 5c 4a f6 0f 8a +7b f8 32 bd 22 75 61 c2 08 dc 00 31 a8 4b 50 12 +c9 dd 9f 74 45 9d cb 07 0b db e1 3c fa 8c 2d 50 + +# PKCS#1 v1.5 Encryption Example 1.3 +# ---------------------------------- + +# Message: +d9 4a e0 83 2e 64 45 ce 42 33 1c b0 6d 53 1a 82 +b1 db 4b aa d3 0f 74 6d c9 16 df 24 d4 e3 c2 45 +1f ff 59 a6 42 3e b0 e1 d0 2d 4f e6 46 cf 69 9d +fd 81 8c 6e 97 b0 51 + +# Seed: +dd 2d 60 a5 e0 08 eb e1 d0 be 6f 60 db c4 3f 29 +62 ef 50 bf de 54 2b bb e9 8f ed d1 fe ac 05 7e +77 1c f1 5f c6 32 c8 db 27 2e 28 d2 9b 57 93 ea +6a b8 06 21 8c 53 82 39 b9 3a 93 5e 65 d2 44 16 +ec 6c 6e 99 ae 04 + +# Encryption: +70 9c 7d 2d 45 98 c9 60 65 b6 58 8d a2 f8 9f a8 +7f 06 2d 72 41 ef 65 95 89 8f 63 7a da 57 ea e9 +01 73 f0 fb 4b f6 a9 1e bd 96 50 69 07 c8 53 da +cf 20 84 94 be 94 d3 13 a0 41 85 d4 74 a9 07 41 +2e ff c3 e0 24 d0 7e 4d 09 aa 24 5f bc b1 30 21 +9b fa 5d e0 2d 4f 7e 2e c9 e6 2e 8a d3 2d ee 5f +f4 d8 e4 cf ec bc 50 33 a1 c2 c6 1c 52 33 ae 16 +19 2a 48 1d 00 75 bf c7 ce 02 82 12 cd 27 be be + +# PKCS#1 v1.5 Encryption Example 1.4 +# ---------------------------------- + +# Message: +52 e6 50 d9 8e 7f 2a 04 8b 4f 86 85 21 53 b9 7e +01 dd 31 6f 34 6a 19 f6 7a 85 + +# Seed: +26 29 a7 aa c0 c3 90 5e 83 1e b6 02 38 8c 54 5a +f5 54 b9 6b 2a e5 15 32 e9 cc db 89 72 ef 30 b6 +4a 2f 98 c6 95 29 7a 01 c5 81 2a 2c 40 15 82 f3 +7b 14 4a 3e 90 e5 9d 81 b6 90 39 c6 4b 84 4b 02 +8c 10 5c 8e 68 36 15 af b6 58 b6 c4 d9 f3 82 38 +a7 63 01 bb 14 44 91 13 b6 9d e1 26 04 5e 26 f1 +3e e6 d7 + +# Encryption: +54 dd b7 84 26 8e ad b3 95 5b d9 f9 49 88 42 59 +5a d2 9f f8 a6 67 fe b4 1f 6f 53 0c b6 0b c9 26 +ac 6c 71 c7 72 f8 03 d0 22 b4 1c a5 72 04 22 3b +27 ca 79 ec 5b 72 65 2c a9 af bf 40 dc 2f 6a 0e +13 bc d6 0d 37 f7 95 04 b0 ff cc 01 cf 53 42 d6 +d3 4a c6 f1 f2 f9 f2 f4 87 46 25 b9 fd bb 7d da +2e c8 7d f0 cf 87 25 97 98 df 86 a0 6b d5 ae f7 +35 4b 8c b1 cb 13 75 75 f4 cf bc 46 28 1b b3 31 + +# PKCS#1 v1.5 Encryption Example 1.5 +# ---------------------------------- + +# Message: +8d a8 9f d9 e5 f9 74 a2 9f ef fb 46 2b 49 18 0f +6c f9 e8 02 + +# Seed: +c3 ca 84 60 0f 35 c8 65 5f c7 c6 4c 75 c5 87 38 +53 d3 aa 8a 94 26 a5 1b 63 d7 e7 5d cf 6c ae 97 +a4 25 3f ba 87 1d 6f 96 89 97 19 9b f0 1b 6a 4d +34 28 ce 4c 96 d1 c4 87 b2 83 0c b9 e3 5d 64 05 +56 23 69 9a b4 97 9a 02 58 4b 92 e6 ba 39 e7 57 +28 40 79 ab f1 33 a7 da 54 e5 42 52 17 a2 10 f6 +7c 18 26 9b 51 1f 61 f8 c5 + +# Encryption: +a8 55 48 01 3b d0 e2 0e e0 eb d3 6f b7 48 97 7f +98 58 46 d7 61 0e ed 24 c3 6c d8 30 33 dd 2a a4 +58 0b d1 53 35 20 9d cf 78 2e e2 6c 48 c3 06 44 +b0 b5 cc 86 c8 cd 16 5a e2 1e ad f5 78 04 18 67 +76 07 03 18 75 e2 21 ec df 3b 10 57 31 6f 3f 12 +a4 7d 5d a4 0c 41 53 9b 63 64 30 da 2e 54 21 90 +11 9e 42 9c 53 c2 22 6f 95 9b 19 cc f4 8a 3d 24 +02 17 c4 de 70 d7 07 2a 7e 0d 95 b6 16 d1 15 a8 + +# PKCS#1 v1.5 Encryption Example 1.6 +# ---------------------------------- + +# Message: +26 52 10 50 84 42 71 + +# Seed: +3c 6a 04 71 da f0 0b 7c 2e fc 9e e8 80 41 65 4f +87 62 90 07 c1 24 32 22 11 a5 f4 ea 3c 58 23 85 +7b c8 fc 7e 21 c9 45 48 b0 ee bd cf f7 91 60 e1 +12 46 1e 40 50 91 10 cf dc 4f 0f 13 c7 fb 92 1a +ba c8 df aa c2 1a cb 0f 7b 8a 13 a4 b5 cc a5 23 +d5 c7 dd f7 05 23 eb 57 0c 59 b6 c7 ae 97 67 e4 +ec 9a 63 d1 13 6d 10 23 1b 40 1e 20 e7 41 02 84 +83 48 01 7a 16 16 + +# Encryption: +5e 51 43 63 28 7d e9 b3 80 04 8c c4 43 5d 53 29 +4a d5 94 1c 55 1a 97 e1 3c 16 dc 13 98 de 61 0d +c7 33 7b c6 bd e5 78 e9 e9 f5 6a f1 44 54 f2 e8 +31 be ef 32 31 a8 50 68 e8 fe f7 2c 89 e1 df 1c +99 43 0a 60 f6 d9 42 89 cf ba 87 b2 b4 32 a4 0b +88 db 61 da e0 88 f9 ed 4e 28 4a 21 63 af 65 bf +2b 43 55 9a 5d a2 ae c5 bb 8f 43 f9 2c 1b 04 a5 +14 6a 65 b6 e0 19 b4 cd d2 94 0c 35 d9 64 5b 2d + +# PKCS#1 v1.5 Encryption Example 1.7 +# ---------------------------------- + +# Message: +8a 84 7d d9 e2 + +# Seed: +a1 3d ff 8a 48 e8 04 94 ae 66 e6 ba 9f 17 9a 01 +0d 9e 6d 40 31 87 96 7f 99 fd d9 0e f9 0e 0a 94 +07 3f f0 e4 d0 e6 66 4f f3 73 b5 09 95 3e 04 ef +77 83 be 0f b4 6c 8a 9f c0 ed 8c 1f 33 cb 4d 0d +2f 1d 0d 5c db a1 4d ca 50 8c a1 d7 3d 20 80 18 +63 9b c8 e1 65 86 23 de 1e 5b a3 f0 5e d0 91 4d +2f 96 90 2f 25 20 33 2d 84 92 d3 73 4a cd eb bd +f4 3e 50 a4 3e 7a a8 72 + +# Encryption: +82 7a 67 e8 15 78 1c 4d 4e 2b 2e 16 9d 80 ca e9 +36 68 72 a7 92 af bf 3c 0c d5 1c e2 8c 70 e8 6d +41 eb b9 75 2f 3f 92 db a5 1a db b6 85 1b 1f 78 +45 61 a8 f1 97 20 8f de 02 97 0b 38 f2 a9 74 22 +ec 7f 4f c8 a1 06 75 a9 db de 10 9e ed 0c e0 65 +27 70 3e e0 5b 65 7d 34 08 f7 fd db 1e ec cf fa +e1 6b 1d a1 07 30 7a 2c f2 56 fa 60 e8 15 21 72 +de 9f 95 27 fe 92 0a 90 1d 93 c4 f4 d5 7e 54 6e + +# PKCS#1 v1.5 Encryption Example 1.8 +# ---------------------------------- + +# Message: +37 32 36 b7 20 2d 39 b2 ee 30 cf b4 6d b0 95 11 +f6 f3 07 cc 61 cc 21 60 6c 18 a7 5b 8a 62 f8 22 +df 03 1b a0 e0 e8 2d d2 f3 e5 d3 1e 4e a2 57 b1 +5b + +# Seed: +21 99 74 a0 87 f0 a2 81 93 e6 49 a0 4a e9 d8 4c +f2 c8 a9 a4 6c df d8 f1 ac 62 c7 e0 f2 0f 4e 27 +03 0c 72 b2 0a 5d b7 25 b4 a8 68 3d f5 55 6e e7 +94 7f a0 a7 66 1b 6d 99 dc b7 9e 49 4f 46 73 f0 +73 a0 41 dd 90 7c 87 32 4e 86 25 dd + +# Encryption: +1a 6d f5 75 99 84 f2 c4 11 93 55 c5 db 35 c8 a4 +78 16 4d 5e 5e e7 7b 49 91 f1 04 ba 91 b9 87 0f +15 91 be 1f 19 f5 5a 80 51 a6 2c 0e 59 49 3d f6 +f0 0f e5 0e f7 3a 6c f0 c4 35 41 f5 32 0d ab 7b +2f c6 7c 93 22 5c cc d6 d5 03 47 aa 96 9a d8 7b +d3 d8 20 81 45 4f ea d8 10 dc 1a b8 c2 17 81 f7 +61 2e 64 06 72 9b 32 2e 04 b1 62 4f 85 38 98 56 +59 ae 34 d9 93 1e 01 9f 76 2c 79 7d 5c bf a3 2d + +# PKCS#1 v1.5 Encryption Example 1.9 +# ---------------------------------- + +# Message: +97 e0 b6 36 bf dd b8 e1 c8 a9 cf 5b 30 5c ef 3a +8f 47 f9 a8 b3 34 4f 13 55 fa 3d ba b6 7b b9 72 +10 + +# Seed: +c1 f8 9b cd c5 60 40 d5 e6 63 b7 4b fd e2 39 7b +58 46 08 cd f3 2d 5a 58 44 72 4a c7 e5 98 a8 6e +f7 11 4b 1b e0 87 30 cb 10 f6 61 fb fb 86 09 f7 +c6 c3 74 42 a1 b1 1e 04 a6 11 ff 8c a5 ce 9a fc +1e b3 aa a9 2c 9f 28 ba e2 20 44 05 78 99 02 26 +07 83 78 c4 93 41 13 74 c5 3e 3d dc + +# Encryption: +87 3c c4 dc a4 27 97 2b 63 c6 cc 8a c1 1c cc 33 +c9 59 f7 fc fe 4b 45 bb d4 7b 29 d9 c9 88 c0 1a +96 bc 1e ae 0e f9 b1 94 8d ce 2c c9 f0 aa 91 7e +86 a6 c1 1f 8d a3 da 29 df 90 59 01 f1 91 8a 76 +16 8d e1 17 5e 27 35 12 8c 09 72 99 d6 6e a5 cc +f9 b9 5b 36 92 ee bf c6 ea 11 bc 37 09 1b 79 5f +18 80 3d 70 e7 95 58 e1 25 16 23 0f ed 55 15 e5 +1b 45 ae 86 ce fe 47 b9 37 90 e4 99 4d c4 1e 05 + +# PKCS#1 v1.5 Encryption Example 1.10 +# ---------------------------------- + +# Message: +82 b5 07 5b fc 88 f4 00 65 76 aa 80 a0 00 7a 74 +51 18 4d 4f 76 0c f9 24 28 04 22 2b 0e 07 26 f5 +55 03 0e 4e 6b 01 f7 93 b0 97 01 81 27 82 4a 3e +40 24 57 d8 49 5f c0 + +# Seed: +d5 5e 3d 48 97 e9 d8 65 01 4c b1 5d 3e e3 f9 fb +d2 9c 92 e5 c2 37 dc ae 46 67 2a 46 3e aa a4 f7 +dd 09 86 1e 94 6a c6 5b 85 62 50 63 93 b8 51 92 +ad 41 fb 0c 48 c8 c0 52 98 1b dd cd 5f 1f c8 b1 +39 cd 47 ca cf fc + +# Encryption: +2e 83 c3 d2 88 01 5a 5f 50 3d 3e 5d e7 d2 ad 91 +06 54 5e f9 7d 63 e4 d0 6a 5a 0d 9d bc 29 f6 ba +fb 93 a5 17 3f a5 06 3a 69 39 db a6 c7 a4 28 c3 +5e 7d be 6a 95 93 fe 5e c4 c1 98 78 89 3f 31 37 +09 c8 76 02 72 6c b3 25 5b e7 5a dc 7f 2f 27 e6 +db 91 c3 a3 43 ea ff 1c 28 d9 d5 f7 cb 65 74 e6 +31 06 90 03 cd cf a0 77 43 a7 34 0d 58 83 9e 70 +8b f3 6a f6 34 2d b8 df a4 1f ea da fc 69 53 ac + +# PKCS#1 v1.5 Encryption Example 1.11 +# ---------------------------------- + +# Message: +36 48 c3 6f 85 1f 52 f2 32 87 79 09 19 85 a3 c8 +12 e1 8a 70 55 d0 90 bb f0 32 4c 13 79 3b b8 22 +1a 57 + +# Seed: +c1 27 71 85 c3 59 55 ca ed fd f9 de 55 d5 d9 5a +39 8d 58 f5 f3 33 19 1f c0 29 45 ef df ad fb 6d +b0 5e e2 a2 d3 41 83 ed f8 9a 1a 4d cc c4 65 91 +b3 53 2b a7 03 93 62 c7 5d f1 94 ec 10 64 48 af +b7 f6 bf b2 80 7e 38 3e 15 99 54 25 5e 82 7c b9 +da dc 8d 9b 7e 68 a1 aa 09 76 35 + +# Encryption: +88 62 f1 97 3f ef e0 af 02 d9 6c c4 58 33 4d ed +6c 02 d8 d7 ea f5 93 77 9c 5d 38 6c 4e 49 f7 68 +f1 30 b4 87 b3 c9 1e 32 3a 47 7e 4c 11 0a 33 41 +ff 46 ee e3 7c 77 3e 5c 0a c8 39 bc 55 cc 0c 07 +0c ac 01 cd 45 18 3c fe e6 b8 8b fb 82 36 1d 35 +60 19 7c de ab 42 e5 c7 55 d2 37 97 1a 88 da f6 +10 cb 39 52 61 4b 36 40 56 cd 49 14 20 ef fe 3a +0b 8c e3 1f 2e 3e 49 ca d6 f3 b0 64 0f 44 91 de + +# PKCS#1 v1.5 Encryption Example 1.12 +# ---------------------------------- + +# Message: +94 f7 8c f4 5c 53 fc 46 e7 eb 1b 26 61 8a 29 e9 +48 50 12 c1 + +# Seed: +e6 de 9e 9b 90 22 a5 5f 56 12 1d 5a c0 0a a6 df +29 9c 8a 36 94 22 e7 54 29 56 b6 da 2e 0d cd ee +96 8d b0 7d 99 5a 7b b8 76 f7 f8 cd 66 b2 f5 42 +c0 53 08 f7 49 83 a3 f8 36 0c 6b 89 47 f8 7d 60 +8b 03 1a 2c 68 dd e1 47 1a e4 96 ae 9b 16 e2 a8 +11 81 eb 6f c2 f6 5b aa ad da 64 22 a9 34 31 f6 +f3 b0 7b 5b 46 a3 cf 89 48 + +# Encryption: +3c 6d 3b 43 d2 3a db 79 d6 97 23 38 08 b0 74 48 +76 97 f3 35 fd 99 cd e8 65 41 1f b1 82 28 92 56 +1f dc 24 a8 b8 bb 2c 4f 65 3c 4d 15 6c 77 a7 5d +e3 16 00 b5 70 9e 8d 50 6e 98 e1 d3 73 cb da 01 +f4 d9 fe b0 29 71 98 ca d0 ca 2a 7e 3b 1e 63 90 +3b 10 43 ce 79 49 4c 57 54 f7 f9 0f c1 f0 73 a6 +19 92 9e f1 26 39 4b 06 24 f3 b8 ba 6d 56 45 e9 +90 e7 c0 13 2c e2 12 31 46 fd 9c ad f7 45 ec 61 + +# PKCS#1 v1.5 Encryption Example 1.13 +# ---------------------------------- + +# Message: +77 9d 1e b8 4f a2 84 c3 7d 29 d5 e1 79 d0 03 06 +b4 13 c4 4a 80 0a 07 7e 59 85 3f 63 05 f9 2e 59 +fb 7f 81 + +# Seed: +c3 e6 d1 8b da 97 78 2c a7 81 fa 76 d9 7a 6c 94 +d8 54 d1 41 99 b4 ea 7d 82 c5 bc bb e6 cd aa b5 +25 57 47 44 3c 59 bf 8c 77 ec da a6 4a e7 ce 61 +e2 c7 30 01 32 b7 54 e9 16 2f 7c de 75 8f 48 0a +e5 88 cf d4 4a 94 6d 64 e2 72 0a 2d 17 52 55 45 +22 04 84 83 81 18 ad 6e 6b 54 + +# Encryption: +72 2c a9 25 66 c7 3c c8 5d 19 ce 3f aa 14 cb 2e +79 84 9f 20 50 92 d1 58 92 82 31 3c 04 27 f0 67 +79 8a fa e3 e3 f0 a5 61 f3 99 34 6e 9d 10 7d a0 +4a f4 4b 0c 6f 04 4a de fe 09 7a 0c d1 4a 47 a9 +9c d9 81 9a 98 41 37 06 30 7c bd 0d a0 16 97 46 +9e ff 71 d3 14 41 63 94 93 fb ed 8e ee 1b a3 9f +dd 07 fc 0e a0 82 30 18 61 79 f9 0e 7e f1 3c 61 +ee 56 f1 67 fc 2f 6b 15 79 3e 1a 32 24 ff a2 9e + +# PKCS#1 v1.5 Encryption Example 1.14 +# ---------------------------------- + +# Message: +88 + +# Seed: +c0 16 9d 76 e4 ea 45 45 41 0d df 66 46 c1 ba 7d +d2 72 d7 c3 49 8b a6 b0 80 4b 42 61 30 a8 0f bf +ff 4b b7 b5 f5 59 b0 a9 09 0e 4a d9 b9 f4 16 a6 +df dc 15 01 b1 ba 46 87 7b 1a 96 fa 84 91 dc fd +de 50 eb ee d2 4d 3f 98 96 24 13 34 6e d4 a3 39 +3e 23 5b 77 bc 1e d6 74 68 ec e2 79 2a 2f d3 a8 +34 8f c5 50 9b 59 06 f2 88 56 15 df 8c 14 61 37 +7a 74 1d 59 52 fb 36 ea c0 20 1e 27 + +# Encryption: +4e d7 d1 29 1a 03 36 65 4d 5c a2 b1 f9 d2 0c b2 +da 72 26 f7 11 6b 93 09 88 43 9b 44 63 98 11 04 +bd 63 c2 ce 2b 77 d6 26 b3 10 9c 93 14 03 ac 5b +49 b4 24 7c 4f 69 67 b8 c0 db 06 3c 99 95 af 9d +36 54 06 50 93 8b 01 f9 39 06 f9 83 89 07 ed 59 +36 ab b3 43 b0 e2 55 09 a1 d2 d4 c5 c8 b9 58 06 +50 da 2c e1 1f a3 cf 3e 64 07 23 ea cb ee 87 fa +d3 ee 35 95 8b 45 07 5d f7 81 c4 13 46 6a f1 39 + +# PKCS#1 v1.5 Encryption Example 1.15 +# ---------------------------------- + +# Message: +a2 dc 08 77 78 d5 43 40 8e 89 73 f1 36 31 59 ed +b8 f0 78 3c 45 70 89 07 2d ce 66 d3 10 2b b4 fa +e6 0a a6 0e 41 93 3c 48 a1 be 39 53 ec 2f 80 4c +0c c9 6c + +# Seed: +18 11 20 14 06 53 29 d0 4b fb 0c f5 44 dd 38 d7 +be f1 54 9b 4a 49 a1 67 76 dd a7 4d 0a 7e dc 49 +67 b4 24 0c 37 14 2f a3 f6 63 9c 26 96 cd 7d 4b +18 a1 1e 2f b5 40 81 f2 de 5b d7 bd 15 cd da 92 +c9 4c 3a 47 18 7b 5f f4 3b 53 + +# Encryption: +71 15 19 0a 21 04 88 f0 4f a0 c0 0c 93 a4 68 a8 +03 0b 7b 9f c1 00 20 d8 31 0b cb 01 a5 c8 dd a1 +d0 6c e2 41 dc 77 5b 43 e6 f1 3b 19 ab fc bf 36 +16 e8 4f 10 7c 9e d8 0d 1b 86 bf 87 c9 8c 2b 62 +9f fa da a6 ec 01 f4 e6 75 55 8e f5 26 06 ea f1 +26 06 8f a7 53 4d d1 3b 92 0d 23 81 69 5a d7 75 +ff f0 bb 7c ec 46 90 90 1d 6f 1e 17 36 b8 2c fe +3a 0c 22 4d 18 f1 29 15 fd c9 5c 18 39 7c 35 70 + +# PKCS#1 v1.5 Encryption Example 1.16 +# ---------------------------------- + +# Message: +11 0b f2 b1 d0 dd 81 2f 2a 5a 21 f3 40 4f a2 f2 +c4 54 c4 43 2f df a7 0f 1b 0f 23 ec 69 c1 02 37 +73 a7 3a ba + +# Seed: +17 b8 5f 76 53 ff 0e f5 de 7f 25 69 6c d4 90 23 +ad 8e ac 94 8a 83 e2 24 58 ec d5 d1 0a 43 86 6d +c7 91 55 5e 64 f0 78 c3 8c 75 2b 6e 9c 6e ee b3 +39 ee c9 10 16 d2 58 88 6d 01 27 75 ad 64 36 02 +a0 f0 d1 79 34 54 a0 60 94 71 16 22 88 22 39 50 +82 6e d8 e2 02 5d a9 a4 e9 + +# Encryption: +5d 0f 2f d8 5e 6f 9d 9e 43 2f ad 86 0f dc 49 96 +96 24 ff 4f a0 71 5d 36 1e 9f 00 b0 5b 3a a0 ba +9e b2 7b ae 61 0e fd e1 14 3c bc 93 3b 52 de a7 +01 87 60 bb 25 1b e0 e1 e3 0c d1 c5 99 1a ef 74 +4d b8 2f 16 6b 90 63 ef b7 e3 38 40 a2 56 90 05 +65 4b 14 0e 11 5f a5 6c 30 40 6e 45 65 6e 81 99 +af 39 4f 63 86 34 6d 5f 1a 30 0b 95 ba 48 fc 08 +73 d6 18 d6 92 bb 02 5b f1 5e 9d 23 2c 64 1a da + +# PKCS#1 v1.5 Encryption Example 1.17 +# ---------------------------------- + +# Message: +d9 d9 37 13 1f f1 94 0a 86 bf 71 39 b4 81 14 36 +41 95 b4 00 52 22 a8 bb bc 26 1a 7f 2e 21 2b 8d +d0 35 e5 3f 91 44 f5 61 0b 4c ec 32 ea 01 bd a9 +d3 c8 0c f2 94 64 f8 0f 5f 56 56 c8 + +# Seed: +33 05 e1 da 60 e5 86 73 fc 46 cd 33 be 2a 66 d3 +a1 02 c3 db 16 1e f4 8c 0d 60 ef 25 03 1b 40 14 +16 78 26 24 6a a5 28 a3 a3 e5 b0 ab 95 07 8d 84 +01 d9 29 03 59 5a fc 1a a8 54 e6 04 4e 5e b5 f5 +be + +# Encryption: +0e 12 16 74 89 f0 ba ef ca d6 39 34 bc 15 9f 1b +bd 9e 9b 28 7e 50 0f 49 09 23 c1 6a 85 56 4a 1d +a6 36 59 37 5f 22 af 7b a4 97 98 e1 57 8c f3 15 +fa e3 e9 ed 56 99 c6 91 e3 c1 d0 bb 46 da 49 2d +01 34 9e 93 29 59 3d 43 81 d0 74 a0 a5 31 df 92 +1b 31 31 6f 7e 2b 4f e9 15 34 72 83 24 23 35 f0 +b0 b2 31 92 c7 21 02 f2 c6 36 24 b1 e7 89 65 45 +0e 82 30 d4 87 7e 46 17 b0 3d 44 83 13 98 dd bf + +# PKCS#1 v1.5 Encryption Example 1.18 +# ---------------------------------- + +# Message: +81 b3 4a eb 8a fb 8a 3f + +# Seed: +02 f7 48 34 2d 01 0f b5 6a 6f 69 f2 1f 8c 6a 63 +16 79 c8 c4 b8 f6 fe b5 25 cf 8e 72 fd a8 ef 8d +f6 62 31 28 c0 fe 74 bc 59 0c aa 34 f1 ee d1 ad +2d 61 42 dc c5 bc ae 84 ef 31 37 62 f2 e4 e7 03 +03 d2 09 c8 d9 57 7a 7c 84 3d 2b 91 72 ed 4e fe +2a d6 29 61 4b 99 a9 1a 4c c8 32 5b a3 24 11 6e +cf 0c 5e 29 09 49 38 ae 49 89 84 f4 f4 cb b1 62 +38 86 e0 39 73 + +# Encryption: +43 b2 76 c7 d3 68 ea 21 c6 80 71 16 cd e8 60 82 +98 f2 40 02 07 2d 77 6e 56 e6 2c 35 72 bf b9 9d +a4 c5 6e 93 8a 47 dc 07 5f a1 ff 7a 61 8f b5 fa +ed 3e e3 7b 91 df c3 91 53 49 5a eb a9 df 6d 45 +df 94 b0 e8 a8 ad 2d b3 7a 9f e4 6d 0f df 15 42 +31 fd 6f 32 21 47 4e 8f 5c 19 1f db 85 38 e1 a6 +03 e5 98 97 e1 50 fa f9 5b 65 da 14 06 67 ed b1 +98 09 eb 4a 16 ac d0 1e cc 60 4b da 57 f2 0e f2 + +# PKCS#1 v1.5 Encryption Example 1.19 +# ---------------------------------- + +# Message: +7b f9 fa d8 89 de 73 ed 87 3d + +# Seed: +fa 5d ad 45 a4 bb 5e 74 c4 cf 2e 21 3e d4 0a a9 +61 75 98 d1 1d 49 ae 1c 32 d7 94 e0 9c d0 e5 c7 +aa ae 81 b9 55 4d de 31 08 d6 0a 9a 82 f4 2c c6 +c2 a6 89 f4 60 ff 1d 53 ad 85 bf 83 83 11 e7 58 +9e 19 67 95 7b 51 56 7a a0 d3 3a fa 37 52 cd e6 +c5 66 1d 4f 27 ae d3 df 52 90 5f 1c f2 25 33 04 +61 8e 07 86 04 1e 70 b4 dc ba c8 c1 08 ba 34 ac +39 39 f4 + +# Encryption: +61 c2 55 0e 0b 36 a6 79 7f f8 64 93 80 1b 11 46 +d8 90 59 49 83 52 e4 c2 62 27 5b 14 04 b1 33 15 +e9 56 bb 3d 31 21 85 b5 21 b3 c7 08 e9 d9 54 02 +17 19 a0 59 d9 84 72 4c 53 c0 4f 5a d2 74 be f9 +ff 0a 79 50 b2 fd ec c5 29 0c d5 f3 bc 26 52 4c +d1 34 20 48 18 4b 0e 2c df 94 06 a4 53 a2 ef 9f +3b b2 3c 4e 7c 1c 8b 29 52 a0 20 2b cc 23 82 47 +ea 32 7b 8c 07 00 c8 00 3f d6 34 ec 1e d9 bf 30 + +# PKCS#1 v1.5 Encryption Example 1.20 +# ---------------------------------- + +# Message: +b6 a3 50 9b b3 b9 b0 b5 7c d5 8d e4 09 d9 53 20 +1a 04 2f 94 92 dc 1d 7e 34 a7 d0 94 1a 1a 1b + +# Seed: +3a 9e 15 06 57 86 b3 e0 1d 82 6b 86 2a 8f 70 2b +5c ac 8c 16 62 ee 7d 15 ff 32 3c df e7 1e bf 4a +d1 b1 f3 a6 bc bd d4 b0 01 08 77 ec ac 09 1f 61 +59 08 e2 be 40 0b b0 c4 98 e3 55 d5 71 fd 10 89 +5b 8e e9 c3 a9 c3 1e 4b 11 03 89 c3 d5 c4 6e bf +76 b3 b3 5a d1 f4 79 1b 6d 20 97 f1 09 f2 + +# Encryption: +6b 4b 6d 7b ab fe 4d 64 17 ac ad fb 78 57 2e 7c +87 e3 fe 1b d5 8e ef b0 d4 b1 27 9c 7b 7c 83 26 +a6 8b b2 87 95 e0 9f 9b 1c e2 e2 4a 53 9f 4b 0d +93 b2 92 74 ce cf 7c d9 f0 b7 32 ae be da 91 11 +bd fe 25 e2 68 a8 8e 34 22 e2 9b 52 bd 4b 7a 05 +47 db 8f e1 2a 6f cf 1a 3c 06 a0 02 bf 87 0a 2f +ab b7 c4 57 e4 bb ce 3e 31 6f 72 32 44 9f 87 a9 +d7 02 b1 2d 19 bd e7 f9 59 0f 94 67 b0 6b d5 8a + +# ============================================= + +# Example 2: A 1024-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +98 b7 05 82 ca 80 8f d1 d3 50 95 62 a0 ef 30 5a +f6 d9 87 54 43 b3 5b df 24 d5 36 35 3e 3f 12 28 +dc d1 2a 78 56 83 56 c6 ff 32 3a bf 72 ac 1c db +fe 71 2f b4 9f e5 94 a5 a2 17 5d 48 b6 73 25 38 +d8 df 37 cb 97 0b e4 a5 b5 62 c3 f2 98 db 9d df +75 60 78 77 91 8c ce d1 d0 d1 f3 77 33 8c 0d 3d +32 07 79 7e 86 2c 65 d1 14 39 e5 88 17 75 27 a7 +de d9 19 71 ad cf 91 e2 e8 34 e3 7f 05 a7 36 55 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +98 b7 05 82 ca 80 8f d1 d3 50 95 62 a0 ef 30 5a +f6 d9 87 54 43 b3 5b df 24 d5 36 35 3e 3f 12 28 +dc d1 2a 78 56 83 56 c6 ff 32 3a bf 72 ac 1c db +fe 71 2f b4 9f e5 94 a5 a2 17 5d 48 b6 73 25 38 +d8 df 37 cb 97 0b e4 a5 b5 62 c3 f2 98 db 9d df +75 60 78 77 91 8c ce d1 d0 d1 f3 77 33 8c 0d 3d +32 07 79 7e 86 2c 65 d1 14 39 e5 88 17 75 27 a7 +de d9 19 71 ad cf 91 e2 e8 34 e3 7f 05 a7 36 55 + +# Public exponent: +01 00 01 + +# Exponent: +06 14 a7 86 05 2d 28 4c d9 06 a8 e4 13 f7 62 2c +05 0f 35 49 c0 26 58 9e a2 77 50 e0 be d9 41 0e +5a 78 83 a1 e6 03 f5 c5 17 ad 36 d4 9f aa c5 bd +66 bc b8 03 0f a8 d3 09 e3 51 dd d7 82 d8 43 df +97 56 80 ae 73 ee a9 aa b2 89 b7 57 20 5d ad b8 +fd fb 98 9e c8 db 8e 70 95 f5 1f 24 52 9f 56 37 +aa 66 93 31 e2 56 9f 8b 85 4a be ce c9 9a a2 64 +c3 da 7c c6 86 6f 0c 0e 1f b8 46 98 48 58 1c 73 + +# Prime 1: +cb 61 a8 8c 8c 30 5a d9 a8 fb ec 2b a4 c8 6c cc +c2 02 80 24 aa 16 90 c2 9b c8 26 4d 2f eb e8 7e +4f 86 e9 12 ef 0f 5c 18 53 d7 1c bc 9b 14 ba ed +3c 37 ce f6 c7 a3 59 8b 6f be 06 48 10 90 5b 57 + +# Prime 2: +c0 39 9f 0b 93 80 fa ba 38 ff 80 d2 ff f6 ed e7 +9c fd ab f6 58 97 20 77 a5 e2 b2 95 69 3e a5 10 +72 26 8b 91 74 6e ea 9b e0 4a d6 61 00 eb ed 73 +3d b4 cd 01 47 a1 8d 6d e8 c0 cd 8f bf 24 9c 33 + +# Prime exponent 1: +94 4c 3a 65 79 57 4c f7 87 33 62 ab 14 35 9c b7 +d5 03 93 c2 a8 4f 59 f0 bd 3c bd 48 ed 17 7c 68 +95 be 8e b6 e2 9f f5 8c 3b 9e 0f f3 2a b5 7b f3 +be 44 07 62 84 81 84 aa 9a a9 19 d5 74 56 7e 73 + +# Prime exponent 2: +45 eb ef d5 87 27 30 8c d2 b4 e6 08 5a 81 58 d2 +9a 41 8f ee c1 14 e0 03 85 bc eb 96 fb bc 84 d0 +71 a5 61 b9 5c 30 08 79 00 e2 58 0e db 05 f6 ce +a7 90 7f cd ca 5f 92 91 7b 4b be ba 5e 1e 14 0f + +# Coefficient: +c5 24 68 c8 fd 15 e5 da 2f 6c 8e ba 4e 97 ba eb +e9 95 b6 7a 1a 7a d7 19 dd 9f ff 36 6b 18 4d 5a +b4 55 07 59 09 29 20 44 ec b3 45 cf 2c dd 26 22 +8e 21 f8 51 83 25 5f 4a 9e 69 f4 c7 15 2e bb 0f + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 2.1 +# ---------------------------------- + +# Message: +e9 a7 71 e0 a6 5f 28 70 8e 83 d5 e6 cc 89 8a 41 +d7 + +# Seed: +16 8e 3e b5 80 9b 08 70 e1 f2 48 7e 1b e7 7a 17 +6b 34 71 6d e1 41 ba 4c 90 59 da 90 e5 e5 1a 36 +94 e8 58 fe d1 0b 92 6c 02 52 39 80 a8 90 9d a9 +96 c6 43 33 ea 67 67 87 bc e6 77 f1 1f da 77 db +b1 a9 51 6e dd a9 b1 29 4f c2 e4 50 52 22 88 e9 +30 be 7f a7 29 b2 50 e3 aa c5 20 51 1e 95 16 aa +86 3a f6 bc 07 5c bd bf f4 30 46 70 + +# Encryption: +71 c2 b8 fb 38 19 f1 34 c2 24 7c 6b ab b4 cf be +17 d7 b2 64 3f 87 ac e5 c5 71 27 7b e1 90 8e f3 +a5 28 8e 34 38 4e 46 0a 70 38 6e 7e a1 d1 9d 3d +ca 1c e1 5b a9 32 39 a8 cd da 18 e3 17 fe 07 96 +80 ce 7e 6a c6 d9 bd af 86 cb 9a eb f1 cf 46 cd +10 ef 6a 68 8b 0c b2 ce 76 5d d0 b3 25 20 42 39 +66 ee e1 aa 05 c6 c2 8c 6f 35 24 fb 68 6b 5f b1 +58 53 65 9e 58 3a c4 37 21 9d ef 8e dc 58 be 2d + +# PKCS#1 v1.5 Encryption Example 2.2 +# ---------------------------------- + +# Message: +66 4b f0 5d 61 2b af 61 52 4c 60 8e da 36 fc 6e +a2 c9 3c 14 31 53 22 1b cf d6 ba 0c fb bd 6b 64 +14 47 e4 78 8b 0a 46 2c b5 b3 f9 fa fc 9a 75 + +# Seed: +e7 f0 a2 79 18 ca d9 15 da 28 11 36 59 ff b5 df +a0 b5 1b 24 d5 a7 1c 20 27 f8 e4 d9 40 9e 8c 64 +72 f0 c5 4b 5c 08 85 8d a6 3d 4b 81 72 b0 7d cf +8c 5a 7e 8f 9e 90 f0 17 c2 4b 44 d1 6b 67 0b dc +96 03 0c 83 53 a2 83 9b a4 c0 75 d2 4c 20 + +# Encryption: +06 86 90 18 13 db 05 3a c7 08 e3 fc ec 6b ae 03 +60 08 8f d3 44 e9 d7 ea 11 8b b3 f5 37 53 14 25 +1e 60 67 37 f5 82 4b 36 28 f6 65 03 48 f6 ab 55 +3b 27 7d a0 15 44 d0 56 73 ba ed f4 55 cc 03 32 +f6 13 f6 54 78 fc fe 06 67 34 c4 65 58 bc 23 3b +4b 6f 52 41 e4 f4 ac 53 fc 18 c5 53 84 c8 fd 96 +18 3f 0b b5 51 5e 89 31 14 f9 c6 1c cc 11 fc 19 +83 de 74 46 92 64 db db b0 c7 49 17 4e cd fb e3 + +# PKCS#1 v1.5 Encryption Example 2.3 +# ---------------------------------- + +# Message: +5e 76 e6 6e d5 75 41 fc 23 d3 59 f4 ad bf 3f 56 +82 01 d3 c6 f0 e0 26 aa a5 67 63 56 cc 98 66 f1 +75 5d e9 8c b3 9f 23 6d af a9 e6 bc 79 4b 74 43 +b5 3a 2d 85 + +# Seed: +5c 65 68 b6 e3 3b c1 3a d2 dc d6 01 2d 17 da 81 +b1 3d bd 62 aa e4 0a 64 af 97 e2 19 e7 5d c1 81 +12 60 77 d1 20 dd a1 9d 63 12 cf 1e 98 71 c1 15 +f0 86 7f e6 62 d7 8a 40 31 97 6b dd ef 68 f5 2b +68 99 58 67 cd 80 95 05 dd + +# Encryption: +19 e7 99 66 ff 1f bc 10 07 3d e7 3d f3 a5 31 63 +78 74 e4 7d f6 39 25 6c 51 d0 bb a9 35 61 0b 46 +34 f9 e5 b4 68 9b d9 21 73 5b 32 23 6e fc c6 e7 +cc 49 a9 e0 6a 25 ac 96 59 b7 fe 82 9c b3 e8 b0 +1f 10 31 79 42 23 65 74 1b 76 c8 34 21 49 ce dc +76 eb 0a d0 18 ed 42 35 fb d5 24 fd 87 c9 54 9a +b3 3f f2 3e e4 f8 20 0e fa 33 02 7e 9d ee c6 0f +ac 01 3d 1e 56 e6 e3 33 d4 93 a4 a9 46 0f e5 8a + +# PKCS#1 v1.5 Encryption Example 2.4 +# ---------------------------------- + +# Message: +5b 19 50 48 eb 90 eb 47 93 + +# Seed: +bb bd 49 55 0e d1 ea 1b 6b c7 20 6c e0 b0 03 a6 +32 a5 2b 0b ac 5f 32 71 0b 39 fa 64 b3 55 6a d6 +f6 c8 2b d9 d5 31 b3 07 46 9e 86 3f 54 b5 fe 21 +83 05 69 54 f2 a9 67 e4 dc 2b 32 6e 41 dd df 74 +3a 76 4f 7e 82 88 68 29 a8 fa b2 77 2a 34 97 70 +6b 95 38 a9 f8 42 96 c8 2d 9b af c2 9c 39 d4 68 +4f 75 ff 6b b1 c1 2e 39 bb 80 56 af 2d 24 34 4b +2c ae 46 29 + +# Encryption: +42 c9 cb 68 21 b5 5d ae 30 d9 00 25 75 31 12 e6 +ee 02 f4 ad 6f 0f 5b 3c c4 95 2a 12 7c 8a 16 f6 +64 79 b8 14 4f 3c f2 9d 84 e4 3d 67 d6 77 12 c7 +f5 b7 6d a2 c6 6b a0 e9 0c d4 b1 fc 1c 1b 3f 17 +a3 92 e7 04 08 28 8a f6 9b 50 fe 8a 50 b3 29 6a +0d ab d7 c8 dc 39 84 a1 94 06 88 be 70 98 25 16 +20 25 6c c2 1b 7c 76 ed 29 d8 6f f7 c0 1e c2 87 +df 47 38 be 34 69 b3 0a 3f 8f b7 be 83 d9 36 1a + +# PKCS#1 v1.5 Encryption Example 2.5 +# ---------------------------------- + +# Message: +66 0b bd 40 06 9c c6 7b ad e4 1a 09 ec f4 3c c4 +51 3f 7c 7c c0 2d de 97 2d 2b 1f 29 29 5e 09 b9 +91 0c 59 ed ba 0e d2 dd f1 1a 6d 41 69 35 1f 97 +24 07 33 52 8f 91 b2 68 fa a7 af 90 6e + +# Seed: +30 7f 61 b1 83 a8 dc f9 15 5a b2 35 e6 1f b5 6b +a2 b8 79 5d c4 23 53 85 e8 ac f3 66 d2 52 33 b4 +70 e0 5d 70 11 b6 fc 53 2f 0a 65 8a d1 3a fd 29 +0c 6f 30 e2 79 5e e3 d3 9d bd c8 0f 56 0e ce 2f + +# Encryption: +04 9b 26 05 0a 3a be f8 3e c2 77 61 11 e3 b7 2f +b9 a2 d6 a8 01 05 5d 6b 5e 0d a4 e9 5c cf 2e bd +0a 78 6a 97 21 aa 79 25 bf 15 be b6 27 13 a3 13 +87 7d d8 5d 26 58 b2 08 e8 8e 64 45 fc 35 01 9b +0c ad 6b f4 d0 6e 2c a5 f1 19 49 ee ee 7e e4 7f +1d 5b 4c 88 24 1f 50 e4 d6 ed f0 18 3d 4f a3 5a +37 1f c4 07 36 4f 2d ca a4 cd ae ce fc ea 6d fa +c1 d5 13 f9 05 e7 47 94 47 44 bb 64 57 6b a1 c8 + +# PKCS#1 v1.5 Encryption Example 2.6 +# ---------------------------------- + +# Message: +81 cb 0a 97 69 8f 82 3b 56 b4 5f + +# Seed: +93 8c 8d fd a0 8b 89 05 5b 68 af 01 1f 24 6c ec +1f 93 a2 77 1d a9 7d ba 20 95 4c 90 09 12 28 5e +5d b1 87 b2 9e 32 72 e9 9e 69 4e 12 14 17 25 28 +45 30 84 06 4e 5c 60 f0 1e 78 6f c5 d0 d9 af 06 +39 a4 98 c5 7a de 93 77 60 ae 51 74 84 af d7 02 +5e a0 d5 5a 62 b1 1f 9a ab 7f a5 dd d0 93 e5 ea +ba d6 1b 67 a2 95 a7 75 be 96 c6 b7 6e c3 fe 47 +29 50 + +# Encryption: +7f b8 f3 35 ee dc 4a f6 af 44 07 3d a1 96 45 7d +04 61 45 03 01 47 f8 42 0f c7 9b d5 89 77 4a 73 +0a 6d 94 fb 7e fa dc 5a ee a7 c0 70 f1 89 24 91 +25 e1 66 c6 d3 01 29 ec f2 c4 82 2a 50 49 6b c2 +f2 1e 79 ac 57 db fb dd 71 a6 8b 58 d9 05 1b 48 +0b f4 77 48 a1 3d fb 67 3e ae d7 71 0a 46 8f e7 +2f 7d 74 e6 f4 a2 89 44 04 3a 52 d9 30 de 68 db +cb 6e e7 fb 8b 69 64 05 41 e3 ed 5b 75 4e 65 fe + +# PKCS#1 v1.5 Encryption Example 2.7 +# ---------------------------------- + +# Message: +05 f7 83 56 23 c8 cf aa e4 82 a9 10 85 b9 7f 6b +95 92 8b b9 74 ac ad 02 36 4a af 13 17 ed 53 c9 +db 2f fb c8 a3 cb 3a 00 f4 4d ac ef 78 + +# Seed: +80 c8 3d 25 47 be 41 ba f2 32 1b d3 0a 9a b7 74 +9c 5e eb b5 a1 ff f0 b3 1d 6b db 0a d1 6d d0 c0 +fb 3e c1 57 e7 8b 09 86 60 20 41 cd e8 89 57 a5 +53 29 e3 e2 cf e8 5a 59 44 74 94 5e fa 33 35 85 +ff fd 41 eb b8 e7 c5 18 c3 c9 25 9a ea 8d e6 35 + +# Encryption: +87 f9 ce 05 f0 ac 9c 05 e4 5f b7 bb 55 5a 7a 18 +a9 cd c5 5f 54 4a 54 21 01 e9 a7 1c d2 03 66 82 +0e 7f f6 dc a3 46 75 22 9d 86 e4 fb 58 71 f9 31 +0b 12 bb 74 e2 86 18 d6 d6 58 65 87 f6 6a cc 89 +68 a8 3c d8 07 f4 d2 12 97 73 1d 7c 22 c1 45 99 +e7 57 19 fd 23 05 2b 8a a6 5b 7e 9c 5c 02 00 38 +2d 35 d5 60 f2 d3 3d d0 49 e0 6a c8 27 cb dd 9a +f5 81 a6 b2 6d b6 1d 43 d7 12 4b 34 72 1d f1 42 + +# PKCS#1 v1.5 Encryption Example 2.8 +# ---------------------------------- + +# Message: +e2 e0 f6 b3 28 d9 bb e9 fd 66 cd 87 98 7c 11 60 +ed 23 7b 1c 7c 65 6a 89 fb 1f 21 d7 09 40 3b 04 +10 f8 e4 e1 2e b9 69 0a eb eb 38 07 31 9a 93 65 +64 f6 67 17 a7 1c 48 62 cc c5 6e + +# Seed: +cf 18 e6 08 b1 56 14 5c 44 de 31 49 66 cb cc 66 +74 a4 5a e0 df 90 04 06 e4 0d 3d fc 32 2f 39 40 +4c ee b6 dc 58 f8 01 bb f2 ac 4f 47 84 1a bd 79 +61 79 d0 82 4f 3b f5 51 8d 78 cc 66 ad 8d fb ed +b1 17 + +# Encryption: +14 01 aa 21 ec 6e ba a7 e3 a9 f7 13 c8 6b 50 8e +37 5f 6c 12 5b 29 62 6e bd 34 9f 64 e2 0f a4 8a +1b 06 84 79 ff f3 30 22 f6 6f 86 e9 7d 9c 5e dd +90 26 e3 18 3c e0 86 41 57 06 59 35 2f 87 a6 18 +91 f3 d8 6a 3d 24 5f 02 45 e3 9d 99 89 2c 67 fa +2b ed 8e 37 54 8d e2 3d ef dd 1e 43 d5 d7 e3 d9 +a3 c2 2c e6 a3 68 d8 4c 5a fa 1c c5 bf 49 b6 8f +e5 c2 5a 32 6b 0e ec 5e 44 c5 e2 ff 5a 35 9d d1 + +# PKCS#1 v1.5 Encryption Example 2.9 +# ---------------------------------- + +# Message: +c6 95 78 ea 03 e2 69 b1 b9 16 33 a7 2f 9f b4 d1 +0c + +# Seed: +e0 a1 a9 ba e3 0a 7a c6 6c ab 3d 86 43 3c 1c a5 +e8 ac 2b 74 e4 83 ca 7f 34 59 77 16 ee 16 18 90 +6c 97 77 2f 28 86 f4 6d 78 31 21 b7 fe 1b 8f a5 +fb ec 09 c0 68 e5 63 5c 89 e6 a0 a9 ac cf 2b 12 +c6 47 06 b6 ae 9a 5a 74 ab b8 3f 64 e1 3a 8c 53 +f9 26 76 04 66 b6 45 e2 8e 9a d6 46 1a e7 b8 9d +5e fc cf 7d 89 14 9a a2 e6 9f 0d 25 + +# Encryption: +78 f8 7d 6b 06 76 1b d7 e7 17 e0 c5 eb 40 e1 fb +80 89 9c 7b e4 01 7c 2e fb 07 59 78 ee 38 d0 f9 +5e 98 03 dc d4 0f ee 97 92 c6 1d 4a 2d 85 da bd +ea 96 ca 29 f3 ca 1e 8b cf 81 76 55 d0 c0 94 74 +d9 80 94 eb 6a 7e f0 33 3d 69 71 c9 38 36 fe 02 +32 f7 18 46 3d c9 54 18 53 46 3b c1 cf 03 67 7e +78 6e e5 2e 72 71 c3 c1 1a c0 05 53 c6 75 27 07 +e0 df 92 80 c4 f2 b7 d1 9f d6 f3 d8 bb cc 7b e6 + +# PKCS#1 v1.5 Encryption Example 2.10 +# ---------------------------------- + +# Message: +76 72 cf c2 7a 41 d5 01 aa 4c 41 ba ab f4 52 5a +7c 45 5f c8 + +# Seed: +4c ee a1 a8 94 64 a5 d2 f8 9e 07 89 53 ca f7 76 +36 58 98 a5 bd 5e 8e 44 8c 65 da 26 ff 98 90 0c +d0 80 61 ef 44 6c 69 b4 8d c4 60 9e d8 65 4a 64 +6d 70 82 62 cb 84 09 ac 27 c4 a4 9a df ed 47 a8 +5a d4 29 ed 75 07 75 78 e4 c2 73 c6 1e 2c 3b 46 +be b4 72 f0 a3 45 a0 5d 61 a7 ea aa d8 a6 3e 0b +3d 49 52 f2 7c 40 81 32 9e + +# Encryption: +25 2b 14 13 3f 1d b2 50 13 29 35 01 e3 56 53 4f +26 af e3 34 68 8e 68 d7 91 83 3a 0d 82 56 05 70 +bb b3 ce 2b 16 d8 b5 f7 f8 9e 7e bc 7c f9 c2 94 +ab 34 16 b7 c2 11 87 70 7f e5 e7 99 2e 72 0f f9 +58 da a4 0f 5a d4 5b c7 47 47 96 39 a5 37 fe 0a +4a 75 fc fb 45 a5 3f 01 73 af c0 f3 cc 91 0b 86 +ae 31 37 62 8d 90 ff 67 5a e1 ae 31 e1 64 05 37 +ea 1a 7c cc fb 73 f8 be 5a ec a0 3b ab 19 3b b0 + +# PKCS#1 v1.5 Encryption Example 2.11 +# ---------------------------------- + +# Message: +a1 6a d8 f2 e0 93 23 42 ed 21 e1 37 77 f4 65 2a +35 50 dd b4 36 8b 5e a7 1c 66 db c3 bb fe b7 db + +# Seed: +55 88 4c 83 0d 4a 80 b7 9f 08 9d a7 4d c2 5a e0 +c4 82 46 21 45 e1 d0 95 23 da 3c 93 44 bb 97 b0 +52 fb dc 15 43 df b5 3c f2 37 82 59 68 7c 7b 1b +35 ca f2 f9 19 99 ed 4a ce 39 af 10 d6 be d0 fa +22 44 4c 12 9d 90 74 1c fc da 90 19 8e 27 82 fb +03 bd cc 7c fa fd 89 db 6f b0 fe d2 24 + +# Encryption: +08 32 6a ff 6d 03 cc 4e 26 10 dd 53 6a f7 f2 1d +76 22 7d 82 7d 52 80 d8 b8 3a b9 eb 30 e0 76 9c +fa 02 b5 c1 35 2b f4 d1 70 ce b6 6f 8b e6 98 78 +4e 1a 6c 20 3f a5 ab 90 07 a6 f7 fc 20 65 20 4b +98 2f a5 61 fb b3 61 af 2b 8e ea 42 ab 3f ec 0e +d0 86 22 e5 f2 89 80 52 75 38 0b 69 34 2a 96 f7 +6a 99 04 87 68 90 d9 2f 24 00 20 32 35 1d 8a 1c +bc 3d 27 b2 46 48 21 bb fb fb b9 a6 78 51 96 10 + +# PKCS#1 v1.5 Encryption Example 2.12 +# ---------------------------------- + +# Message: +4a + +# Seed: +8a a0 ce d1 7f 09 ad ae 61 0a 46 03 0d ad 40 31 +1b f1 46 9c 27 37 41 1e 40 f9 23 96 75 1d d5 66 +37 c9 58 db c5 8a 17 fd bd dd db bf 79 75 18 78 +98 be 1a a6 3c 5e ee 5f 9a 19 02 98 0f 59 51 84 +b9 b5 b4 65 b9 2e 20 f7 ae 8b 5a 5c ee 7f 3b 57 +d9 97 a0 6a 70 2d 23 83 50 a9 26 98 ef 27 5d ff +52 77 bd 2c 99 96 47 40 5a db e4 fb 3f 1b e7 5e +15 9a 4c 43 83 13 b7 fd 8a ca 9d ea + +# Encryption: +4c 4e 5a b6 2d 0c 96 7a b8 29 21 42 9f fe 50 d2 +24 0e 7e 0a 18 75 48 87 55 bb 7f f6 15 a8 c9 9a +bc 37 b2 e4 71 47 a9 27 d7 b9 8c 30 db 24 da 8c +d3 5e 13 d7 b7 14 14 d0 32 bd 0c 3c e3 8b 89 b1 +1b 2c 3f 9d 83 08 16 71 6a 2e 8c cd 8c 79 e9 c7 +49 31 a7 b8 a8 db 13 12 8c e4 0b 21 59 e4 98 da +98 f2 aa 35 2f 23 85 31 06 b6 61 d8 8e d0 6f f6 +6a 56 e7 56 59 72 20 bd 10 15 81 53 ce 5c 02 63 + +# PKCS#1 v1.5 Encryption Example 2.13 +# ---------------------------------- + +# Message: +bf fc 42 08 73 f5 af 5d d2 3b b0 + +# Seed: +dd 31 cc d4 7d 4e 31 02 df 0f c5 9b 1b 84 77 af +3a 78 c2 fa 9c 8e cb 4f 0b 3b de 23 50 04 36 55 +03 64 66 5f 81 c0 35 6a bc 0b 78 e9 73 19 11 14 +02 75 c8 66 f7 5a d0 cb bc 88 ad 6b 5d 4d a5 2d +08 e2 2e e5 39 b5 8e 92 c6 19 63 87 e2 21 a0 87 +39 6c be 57 ec 56 03 f6 16 26 27 98 3e ff 82 de +04 8b dc 1b 5e db b5 d4 ea 84 f5 02 24 bd 88 a9 +05 da + +# Encryption: +0d a2 d6 f7 bc b5 0a 47 2e da 24 60 9d a6 77 28 +e5 3c 98 80 aa 5f b6 fb e6 0d 83 c1 1e 6b b3 cf +db 17 d1 4d bc e8 ec 55 c7 3a b0 14 3e 9b 27 56 +bb 69 68 e5 af 1a ed cf 6a 80 c2 6d 49 0e 47 18 +7e a5 d8 cd 2f ac b8 1c e6 4a 72 3c 40 f0 ba 4c +69 3e 1b 11 43 df 15 a4 20 91 70 9a b4 c7 cd 9d +47 07 9e cd 68 f6 a1 96 44 8a 44 67 9a 04 14 10 +41 8f 11 a1 e1 bc e7 8e 77 26 04 a2 f2 77 81 95 + +# PKCS#1 v1.5 Encryption Example 2.14 +# ---------------------------------- + +# Message: +1a 9b 87 29 21 0a 84 71 fc 5c d7 09 f2 ed d3 24 +01 50 24 4b ec 96 a9 2f f8 07 e3 b3 0d 29 5d 3c +34 5c 04 4f 2e 95 60 37 + +# Seed: +58 78 c9 1b 16 6e 90 c3 4e 6e 66 56 8c 15 1f 4d +44 43 40 b5 f1 d7 30 52 cc 56 33 ea 2e 47 ac ed +7b 17 8a 64 fb 09 a5 ad 08 46 ae e4 11 6d 67 80 +ee 75 eb 20 85 16 68 82 0c de c0 f2 c4 96 e4 c2 +88 d8 27 9c 1c 5d 4e c0 0d 98 0c 27 2e 87 05 18 +48 6d ca ea 85 + +# Encryption: +37 00 ac 36 2c f6 0e 16 39 47 a1 98 d0 0f 3b 3b +26 e0 3e e2 fb 78 2b 42 88 b8 c1 de 76 e9 e8 99 +46 c9 80 7c 56 e0 9c 7b 52 be 00 78 ac f6 92 96 +4a cb 97 d1 fa 5c eb 57 76 a1 d5 56 b4 bc 9d b0 +0b da 25 23 7a 75 1b 7c 22 9b 6b 57 f7 ff 75 1c +12 d1 f2 2a 4f b0 e9 0b 63 d0 42 d9 49 9e 0f 7e +fe ad d3 c5 88 f2 c7 43 a1 2c 56 7c 81 57 8d be +eb fd 37 74 da 34 ad 09 ee be 90 17 89 02 14 b5 + +# PKCS#1 v1.5 Encryption Example 2.15 +# ---------------------------------- + +# Message: +a6 d0 e8 c1 ea 4a b4 ec c8 95 7d 62 28 15 79 67 +5a 64 8d 62 b7 f2 2b 2b 08 d1 31 3f 40 6f 13 7e +99 42 67 35 cd b9 37 2f ec a1 ee 78 46 3f a5 de +9c dd 84 75 6c 68 bd 1d 92 ba 96 5f 50 64 10 b1 + +# Seed: +1c 25 c9 b8 32 16 9a 1f db 6c 14 8e 47 e6 6c 3c +c8 21 41 e6 11 a6 f3 0c c9 0c 50 49 e8 c5 02 b3 +1c ad c7 62 39 b7 bd af 93 fa 97 34 3e 7e e5 51 +bc 52 fd b5 ec 9e 40 0a f0 5d be ac da + +# Encryption: +00 e8 b2 fc 76 df b4 a6 cc 43 64 de 8f 68 3c 3f +cd 0a 9e cf bd 4a 5a 72 24 f4 9a e9 b4 f3 b5 cd +c7 1c bb 8c 66 fd 35 f3 d1 8e ca 98 96 7b d4 00 +5d f7 91 52 41 6f d4 7e 56 2c 55 ed c6 d6 12 12 +28 6e f9 75 bc c8 02 69 25 92 65 39 00 97 3c 72 +e0 1a 69 3b 05 fc 2d 58 56 ea ef 7a c0 8f f5 ec +d5 31 e2 c2 ce 92 77 45 a1 16 5a 51 aa 66 98 a1 +ff cb 87 f8 1e f6 51 0b ca f9 cb 76 1e 9e 1f 0f + +# PKCS#1 v1.5 Encryption Example 2.16 +# ---------------------------------- + +# Message: +f3 40 5b 21 8f 3e c6 03 a9 80 69 00 99 c2 cf 5c +be 0b 2b 05 96 79 c4 6b 7e 48 f6 fd c4 da 40 92 +d8 31 c8 b5 2b 2c c7 9b d2 bb f6 e9 f5 7b 4e 8c +aa 94 b5 81 f9 f2 31 26 1f 0e 2b bb f5 3d bb + +# Seed: +f4 70 7f 58 64 2b 54 cb f8 0a 9b 50 48 a6 ec 0b +d3 5d 09 57 16 db 12 06 0c bf 50 58 5f b9 23 79 +81 05 2f 7b b1 58 3c d8 7b c8 bf b5 5b 73 3e 89 +0e b9 c0 8e f0 e8 80 e9 ba 0d 50 ec 95 41 + +# Encryption: +6d 9d 39 19 8b 5f cb 13 2d 93 15 11 49 d7 59 91 +02 4a c2 2e b6 eb 2d c7 c6 05 8f 64 87 56 45 10 +2b 95 25 4e 25 e9 f0 ae 45 06 d4 3c 60 1c 18 8a +31 4f 4b b4 e0 38 c8 15 39 41 6e 10 5e 80 97 fb +69 5a ab 36 fe f5 16 e6 a3 3f 36 f7 f9 5a d1 ff +15 88 90 25 b1 b2 e8 1e 1b f3 b2 de 5b a9 18 7c +a9 6c eb a9 fc ec ef 9c 53 e4 94 34 86 18 59 67 +cf 7a 64 77 c3 29 f0 0e a6 95 52 5b ca 99 f2 c7 + +# PKCS#1 v1.5 Encryption Example 2.17 +# ---------------------------------- + +# Message: +6a fa db e3 da 68 d9 02 85 bb 8f 1e 21 29 ff eb +b1 c6 5b 95 88 d6 c2 c0 40 24 c2 38 b2 0c 65 d2 +ac a5 e3 82 76 00 0a 0e 6a 0d 05 37 ef ee f6 d3 +e3 d9 4f b9 + +# Seed: +ee 17 6e a3 cf d4 90 b6 c0 49 d2 e7 4c 90 c0 ee +74 68 52 03 49 b8 51 65 3d b0 58 a1 c3 e9 56 e0 +88 5f 26 1b 6e 71 cf 1e 62 3d 3b 9d 1d 56 fa 13 +67 e4 7f f3 74 ad 39 30 9f fa 2e 67 11 28 d5 ab +b4 a6 1a 5b 0d c2 db 2c 08 + +# Encryption: +67 2f e9 51 59 a9 89 3f 34 98 b6 16 c1 7b 59 da +71 da 80 2f eb f7 cd 38 11 06 14 a1 b2 5d 96 aa +8a 74 aa aa 2a 0f 00 0e f8 ac a3 b4 1a d1 61 b6 +26 33 f2 41 31 9c 33 e4 ec b7 70 6a b3 ad c6 a3 +ef ea 22 43 0f 3f 5c 9c 4c e5 40 4e b8 e7 5a 10 +93 69 c0 aa 0b 7d d7 13 bd 8b 77 cc a5 f7 4b ca +5b c5 55 69 6b 68 e1 17 2d b4 02 50 1d cd 26 49 +68 5d b0 fd 88 c8 83 60 da cc 65 09 ff a8 df c2 + +# PKCS#1 v1.5 Encryption Example 2.18 +# ---------------------------------- + +# Message: +6d 9f 9b 4b b1 23 ba 90 95 53 a7 57 3a 97 1f 64 +b7 25 24 cf eb 04 2d e3 92 15 f6 50 db 61 2d 66 +d7 ae 86 05 d0 44 19 54 62 5f a9 81 22 33 0e 92 + +# Seed: +7f f8 68 5a ec f3 40 26 13 90 ad 07 42 73 0c b6 +39 28 30 14 ab 37 73 55 6c 69 7f 97 ef 62 1a 4d +cb f8 ec 6e de c5 0d 8e c9 59 0a db af 23 51 dd +fa 0e 52 ea 6e d1 8e b6 c3 78 f3 80 85 ae 5e e4 +cc 48 c1 89 1b a4 7b 20 10 d5 d4 35 39 + +# Encryption: +8d 30 65 5c f1 5b f1 0a 46 97 87 c6 a1 0e 79 25 +4f f0 bd 11 93 8b c6 0a 81 a7 58 d9 3c f2 a0 30 +24 59 fc 2f 0d 77 00 b8 6d d6 ed 61 83 83 b4 4b +45 87 04 ca 11 92 8e 50 4f 02 8e fe 50 37 17 2c +3e 51 b8 37 be 61 56 de 6a 09 c5 55 97 be 74 c9 +7c aa 1d eb f3 14 cd 94 b9 1b 9f 94 cb f7 64 0f +86 c2 6d 1d 6a 0b 10 46 28 b5 87 11 4a a3 1d 99 +f6 9c f9 57 37 93 2c 0c b5 33 33 74 de a0 7f ac + +# PKCS#1 v1.5 Encryption Example 2.19 +# ---------------------------------- + +# Message: +33 cc cb 59 7d e9 5c ed b8 b6 57 fc d8 f8 88 86 +da 04 c7 57 93 53 14 + +# Seed: +53 42 f4 68 43 91 cd 74 f5 28 2d b8 31 41 ff f6 +78 f2 3a 3e a6 52 e0 d4 27 fb 6a d9 76 c5 a7 10 +a6 37 95 77 71 89 47 ac 72 7b 4d 58 a0 b0 bd 20 +7a e3 73 a8 b9 9a c8 e2 51 eb 02 45 8a 9e dc 39 +52 fb 28 42 6d 18 fd a1 8a 80 2b bf 0a 0b 8b 2c +f2 5c a3 a0 22 f7 78 c7 f4 7f c5 30 d0 b7 a5 bc +84 6e ea 91 80 f2 + +# Encryption: +8c 4a 63 d0 73 1e 2e 71 eb 46 15 18 9a 96 8b 3e +4a 24 28 56 b2 09 02 45 23 8b 66 45 97 8f 1e e8 +d7 98 11 06 2e bd 2d 1f 3d 52 3a e6 00 e0 e5 a6 +e4 05 c4 e4 b5 a1 6e 8d fb 49 24 30 4b 0d 1f f4 +d6 41 bf 98 7f c6 d4 1d 3e b7 cd c5 31 34 d0 06 +9c db 5a fe f7 f8 f9 ca c0 ee 52 30 b6 f8 86 22 +a8 4d e5 2a d6 f7 50 47 84 37 06 ca 96 97 42 c5 +8d a7 72 62 ff 1f 12 8a 66 4e 51 cd 63 5e 71 15 + +# PKCS#1 v1.5 Encryption Example 2.20 +# ---------------------------------- + +# Message: +19 d6 + +# Seed: +ea ac b5 78 ae ab f6 9d 4e ae eb 36 d0 4c d8 a2 +2e 8f d7 a2 5f 04 43 a1 1e 4e 08 b3 ff ac 1e 05 +42 1a 87 6c ca 91 31 82 50 be fa ff ef 9b 27 49 +dc 40 2f ad 4f db 7c 1b 66 aa 5e 08 9f f9 9f 8b +30 0c dc 46 f4 8f 56 48 c9 40 8b 5f 8b 3f 5a 12 +e6 50 50 dc bc 0d 53 43 d6 3d 58 08 19 21 65 2d +5b c8 2d d3 d7 0e 07 5d 32 d8 02 c2 97 64 78 fc +9f 09 93 dd 08 59 c9 0e 22 8e 87 + +# Encryption: +61 3b ba 5c 19 0a d7 72 e0 8c 29 07 6e 2e 9e 5f +12 ef c9 29 2e 3b 5c ee 52 c2 69 7f b7 b6 07 dc +72 e8 25 78 e8 b7 53 ba ca df 23 b4 77 25 21 3d +b8 9f 88 73 fa 79 b9 14 a4 b5 16 1e fd 9e 15 cf +a8 dd 1e ff e8 9f 89 47 a6 f3 82 6d c6 bf 53 be +ca 36 5b 93 81 18 45 62 a7 9e 21 ca 0e 68 eb f0 +ab 82 ae 76 2b 28 c1 43 65 15 2a e0 f5 4f 2e 9d +14 43 9a 84 6b 38 3f 5e 2c 55 ef a7 00 85 97 b5 + +# ============================================= + +# Example 3: A 1024-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +b9 30 96 d0 26 1e fe 00 0b 3d 17 04 f5 04 31 60 +ab d3 eb 56 6c 61 e5 3c 76 c4 01 e2 b6 55 21 bc +12 d4 81 21 51 83 e8 f4 6c 2c a8 d0 0a da 5d fd +04 dc f7 cf 36 cc 58 11 05 d9 9d 2a 7d d9 4b 56 +76 0a 65 64 fe e5 e8 aa eb 06 07 e1 45 19 62 10 +a3 1b 7e d8 dd 2a f3 2d 29 d2 ba d6 f1 5f fa 5a +11 dc 73 5c c3 62 19 02 1e e8 d1 ee ed 34 63 9b +5a 91 ac 6a 92 67 4e 18 39 70 c5 9d 5b 19 6d 4b + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +b9 30 96 d0 26 1e fe 00 0b 3d 17 04 f5 04 31 60 +ab d3 eb 56 6c 61 e5 3c 76 c4 01 e2 b6 55 21 bc +12 d4 81 21 51 83 e8 f4 6c 2c a8 d0 0a da 5d fd +04 dc f7 cf 36 cc 58 11 05 d9 9d 2a 7d d9 4b 56 +76 0a 65 64 fe e5 e8 aa eb 06 07 e1 45 19 62 10 +a3 1b 7e d8 dd 2a f3 2d 29 d2 ba d6 f1 5f fa 5a +11 dc 73 5c c3 62 19 02 1e e8 d1 ee ed 34 63 9b +5a 91 ac 6a 92 67 4e 18 39 70 c5 9d 5b 19 6d 4b + +# Public exponent: +01 00 01 + +# Exponent: +01 07 ea 61 ad ec a5 e9 00 7c 59 13 4a 7d 38 fc +7a f3 10 3a d2 c4 a2 be e3 97 08 be fc 83 dc 79 +b7 0d c9 75 92 db 6d f7 0f b3 c4 9c 25 35 fc fd +9f c2 ce 7b 05 53 92 e3 ee b3 e7 97 93 cc 1b 60 +15 3f 4a 0b ff 26 be 66 7b bc db bf 6e 32 af a6 +fd 14 83 7f 3c 79 be 44 cb 1c 63 8f fa 5c 6b 17 +70 9a 96 e1 27 03 0b b1 11 6d ec fd e5 2b b0 40 +84 2a 94 d2 e6 74 f1 17 51 ec b9 03 ee 10 48 45 + +# Prime 1: +e7 fe c4 74 e0 eb 31 2d 1d 76 cb b2 72 2e fa 42 +10 68 b1 91 e2 33 b6 4e 46 08 7f dd 45 76 d3 85 +55 07 19 35 2e 10 9f e4 33 ac 4e 35 8e 7c 28 59 +eb a7 e4 3a 04 ee 85 9a 46 35 2c 12 43 a1 cc 6f + +# Prime 2: +cc 5a 02 f9 55 7a 63 5c f5 e6 9b 0f 2b 3f 2e 61 +2e 1f 0a bb d4 bc f1 69 ca c0 84 dc f4 b9 b4 34 +43 a7 85 23 90 f8 19 41 9e c1 a8 38 7e f0 4d d2 +db 7d 60 b4 0a 21 f9 4f 46 d2 27 87 4b 3e 52 e5 + +# Prime exponent 1: +ab 92 8b 10 35 57 3b 23 36 6b 28 f2 6b e7 ba 45 +29 85 83 ed 73 f0 f2 9e a8 c4 98 6b b8 77 cc af +0a d7 19 19 6f 5b f4 23 fc e3 2d 64 06 60 64 27 +3c 55 0a 40 ae 6d 08 79 b3 fa 97 01 5a eb 4a 19 + +# Prime exponent 2: +8c 7d 55 8e 15 36 0f 19 d9 f4 b0 a5 bd 15 b2 cd +1c e8 3a 78 e7 c8 fe 2f bd 34 9e 23 4a 1c 61 c7 +8c bb 9e cc d4 dd bc 7f 60 a5 c3 01 14 44 21 3c +d5 a9 5c d2 6a 24 f1 41 8f 6e eb be 17 fc c1 + +# Coefficient: +b0 b1 b9 cb 23 ac 2a 8a 56 36 66 69 9a 52 40 54 +be f3 81 aa bd 75 55 31 a1 df a8 85 dc 8f 98 86 +a5 5a f0 e3 68 63 91 c7 97 68 1a 8f ef cf 24 db +d8 1e 03 13 16 99 8f 5d 81 8d 24 76 da d0 6d e8 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 3.1 +# ---------------------------------- + +# Message: +44 e5 6a a7 7b d9 35 ac 59 a9 bd 32 37 83 e1 27 +42 + +# Seed: +92 ee f6 19 f0 4f 52 02 8f 4c c3 e5 24 1f 0a a0 +92 1b 4d 18 3c 1f 5b d6 8d 86 fb e9 e7 b7 d0 bb +10 4e d1 ca e0 7a c7 d8 0b fd 9c 1c ef f8 dc da +1d cc 69 30 f4 c5 51 37 34 6b fd 68 c1 9d 87 97 +2f 7f 34 cb ae 56 63 26 0f eb 79 f7 60 22 1c d6 +7b e0 66 d5 af 0f 07 3c 0f 2c 43 9e 8b cb 74 63 +ed e4 4c 8b 15 0e ba f3 29 87 26 c3 + +# Encryption: +15 91 d1 ce 0f ad 66 d8 6f d4 2e fd b3 1e 9a 02 +8a 31 57 fb 09 14 b2 47 eb 3d 22 d7 6f 97 69 b0 +e1 9f 6c 06 4c a1 b9 89 06 39 ee 6e 37 b7 09 22 +4d 6b 58 eb b6 55 ae 4b 69 ed 4c d7 5d 81 29 21 +17 c0 69 30 d4 2a c4 d4 2e a7 35 14 21 8f 49 ea +07 ca 97 43 67 09 68 3d 67 a8 e9 e8 08 da 69 a5 +0b 73 9c 42 eb 0d eb 94 a3 49 8f c5 45 0e b6 9a +ce 23 76 76 61 fe df 34 18 3a 1b 6f 42 5d d6 a0 + +# PKCS#1 v1.5 Encryption Example 3.2 +# ---------------------------------- + +# Message: +a7 57 38 29 1f ad 54 13 95 7f a3 b9 f3 b2 ca ac +9f 5a + +# Seed: +3a 19 1a af 45 ed 4c 25 89 20 5d 9c f6 a3 0f 07 +70 0e 38 be 06 25 62 43 01 8d 23 c6 84 da ec e7 +e8 67 e3 9d 76 c6 b6 f0 35 43 fc 15 af 81 bf 84 +f9 64 ea f3 a9 5a 4b 80 86 28 fd 51 55 38 99 f8 +11 c0 8c 62 60 9c 51 4c fa 1d bb 78 d5 a5 b3 3c +c0 b8 57 fc b1 ee cc 53 1b 13 26 34 43 90 59 f5 +5a 73 3e 14 6e 1c a1 eb 5a 97 f4 + +# Encryption: +70 aa f7 24 39 6c 1a c5 0e db bf e8 34 1b 08 7b +a0 ff e2 87 60 5a 8c 3a 8c cf 85 ab 2e d2 fe 22 +15 9d 62 aa 02 74 76 eb bf 07 70 02 6d 2d 3b 0c +0d 77 34 fa aa a8 d1 5e 2c e5 1c 85 53 5c 26 b4 +15 0a d6 34 6e 3b fd 38 db 5d ac f7 52 e7 5d 75 +31 40 54 d1 67 a9 6d 81 9f 34 38 a7 be c4 46 7f +c5 60 a6 94 46 94 85 e8 e7 8e 47 e4 e8 27 7c a7 +d3 fd 2a d9 4a 30 46 4c 24 57 85 47 25 c6 16 15 + +# PKCS#1 v1.5 Encryption Example 3.3 +# ---------------------------------- + +# Message: +87 31 2f 78 7d e0 65 97 50 d6 02 ac 11 02 + +# Seed: +a2 29 e3 e8 ef 1c aa 66 ca f0 d8 ac d8 d6 6b 9e +41 cc 77 1f 26 e2 0f 12 ec c6 e2 aa 38 45 51 3d +d1 34 f7 c6 e5 74 f4 1b 21 5d 1d 11 17 56 da f9 +71 cc f3 9c cd ce 78 16 19 d7 97 20 df 91 8d 33 +9c 82 6d c0 49 b3 90 91 7c 17 ba 0f b1 30 2f ff +11 0a 14 dd 23 84 90 27 41 f9 12 b2 6a 1a db e0 +ed 1e 8f d9 89 71 0b 40 3d 27 c4 e0 18 fb 9b + +# Encryption: +03 38 46 d7 66 4c 8f 92 62 57 c7 fd 32 64 48 47 +92 ac 7f 9b c8 75 8a 7a 16 ab b8 9f a3 cc c4 d1 +3a 1e ed 88 af 73 23 bc 3c 74 e2 3f da b5 03 81 +89 4c 86 26 df d0 ac 85 89 d4 62 34 d3 c3 5f 18 +99 81 79 44 84 31 dc 81 6f b6 3e 55 cf 26 d7 4a +9d 2a 09 32 67 3c b4 be b8 29 cd 7d 49 50 88 48 +c6 d0 c0 0d 5c 70 f7 fb 47 67 70 e4 03 19 23 7c +78 6b f4 e2 6c 48 d2 cf d9 6e e3 62 bf 29 28 25 + +# PKCS#1 v1.5 Encryption Example 3.4 +# ---------------------------------- + +# Message: +9a 2b ca 75 e3 26 49 77 7b 9f 13 ec 30 fe 16 bb +8a b4 6d 6d 5e 0c 64 63 a7 3d 8c 36 63 ad ab c7 +23 bd e7 2a 50 76 5e 7b 30 0e f6 b5 61 de e8 84 +84 88 0e 4d 61 2c + +# Seed: +8b fa e9 22 2f 75 a0 69 98 ed 6d 9b 14 9e 89 05 +cf c8 db 05 5a 0e 32 ac ed f8 24 d2 f6 b5 b4 2b +3a ea c6 a7 10 4e 14 4d 5e 48 34 28 0e 36 44 5a +b8 50 f3 a6 de 16 4c 2c 79 0f e7 d9 d7 bc 7f 9b +db e2 52 17 da 2d ed + +# Encryption: +6e c5 f5 59 c8 a3 20 d9 0d 1e b5 ef 09 1c 4d 12 +55 a2 4a 69 19 41 0e b1 df 65 a9 7b 30 cd d7 fa +e1 8e 65 12 a0 27 e9 76 70 4b 4f a0 44 37 43 93 +d5 01 e2 ba 46 18 62 00 ef 0d dd f1 9c 75 77 58 +e4 67 94 30 bc d9 fd 11 9e a2 43 b3 49 dc f8 1c +34 32 d3 1f ba 91 1e c6 fc 68 6e aa df f6 b9 fd +f5 3a a4 c8 5a 49 a2 2a 05 1c 5f 18 07 f3 08 3b +1b 3e 61 17 b4 ef 12 08 de 0a 80 01 dc 29 1c 4e + +# PKCS#1 v1.5 Encryption Example 3.5 +# ---------------------------------- + +# Message: +df d6 3e 6e c6 1e 07 27 5b 8e 37 cc 63 69 e1 f3 +ec 0b fc 57 a2 98 b9 05 ae 5d 07 74 e0 f5 22 e6 +75 9c 7d 11 6f 8e 8e fe 69 45 0f a7 a8 38 9f 81 + +# Seed: +c4 22 37 7b 89 86 4b 0d f3 8b 4f 9c 15 f9 8a 05 +96 55 e1 c9 b0 c7 09 63 5c a6 06 49 d8 d2 47 5e +e1 6c b1 27 f6 76 39 12 96 4e 19 84 d6 da ad 4d +6a bd 04 b0 46 18 b3 2e 53 25 ba 95 eb 5e 76 db +d4 6d 9f b5 9d f0 7a 08 1e 95 6c b0 73 + +# Encryption: +9e 06 cd 91 a4 4a 9a de a6 a7 98 03 d3 e6 bb ab +17 db 10 62 b6 51 0b ed 40 07 55 66 74 95 44 c0 +3d 7a 78 b1 37 b0 dc 1e 66 26 32 1f ed af c2 0d +cd bf 70 80 f7 f5 bd d5 67 44 ce 99 9f 76 70 5c +4f 5e 6f a1 5f 46 c5 ae 50 80 90 db bc 85 fb 86 +89 9c 95 78 60 8d fd 77 8a a4 a7 9d 3d 73 63 54 +cc fb fa 2c 86 f2 9a 7a 58 45 3d 75 7f d5 22 f7 +84 08 d9 91 6b 1b d0 65 4b ff e6 e0 66 ba eb 50 + +# PKCS#1 v1.5 Encryption Example 3.6 +# ---------------------------------- + +# Message: +5d 91 fb c1 a7 ba 79 93 9b 89 a2 40 8c ce 8e d4 +bb 26 66 dd fe 09 d9 19 21 a0 aa 69 09 6a 95 69 +92 c2 1c + +# Seed: +af 07 fe a3 21 ea a2 67 af 7f 09 80 6f 9e a8 b4 +cf 13 5e d6 f1 43 2d 51 b2 8f 92 44 87 09 c2 ee +8a ed 7f 73 b6 28 2c bf d3 7f 82 db a8 72 3e 5e +5e 0a 81 f5 90 f8 2e 2f a8 4c 3b c0 0c 9b 9f 91 +aa 55 3b 8b 2c 07 4b fe ca c2 f5 52 37 f4 cb 70 +54 3a ba 49 94 68 cf 68 44 c3 + +# Encryption: +76 05 0e 22 64 22 0e 10 05 2c 49 b9 6c c8 41 1e +39 6a 7a 6e 4a ed b0 6b 48 fd b0 71 de 83 9b 40 +1c ac 0c 46 8d e8 d1 ed 0b 56 8c e6 90 e8 03 7a +f5 de f6 b3 d2 db c7 b5 f2 fa de 35 6c 26 cf fc +dd 33 40 33 ea 2c 99 77 92 d9 30 a7 26 46 12 5c +0e e8 6a 4d d8 43 c8 24 c7 a5 2a c9 88 c9 2e 6c +69 b5 80 76 1c 49 88 1f 29 dd 8a 76 da 79 3f 43 +2e 7d 5d c7 31 a2 5e 5b b5 02 58 d0 27 39 5f bd + +# PKCS#1 v1.5 Encryption Example 3.7 +# ---------------------------------- + +# Message: +04 ed d8 3c 65 65 6a 01 + +# Seed: +88 f9 a2 71 97 f9 f2 57 fa 81 c0 e3 05 90 b7 3e +9e 11 c7 6b c8 9e 08 53 6b 4b 64 a2 50 6a eb 33 +b4 50 74 73 08 09 a0 5c 45 b9 bc 95 71 73 69 cf +92 c1 bf 98 6e 53 ba 11 23 83 30 fd c4 e0 5e a1 +07 33 4a b3 11 06 ae bd 9c 6c 29 e5 01 a5 7d 99 +7c 01 bb c1 01 0b d5 2f 05 38 b9 51 59 f3 91 32 +0d e6 db 23 d8 16 2c f1 46 58 4c 6e 07 6c 4e ae +86 20 72 eb 5b + +# Encryption: +79 1b 37 91 48 a8 3a 03 4d 31 2a 82 bb b3 7b 11 +1b 40 bc f6 a3 37 fd e2 89 b0 8e 07 2e 44 03 19 +73 ff 9d 0c 27 f7 0d 64 a8 ea fc 6e b5 f8 eb 4e +52 e2 c4 19 7e cf a5 45 ed 63 ae 9a 12 83 79 d3 +f5 62 a1 8f e3 ad 14 05 27 67 f0 54 1b 90 16 81 +85 cb b7 8d b6 03 81 c0 92 bc 23 e1 aa 05 b4 08 +92 f9 a1 16 e6 25 cb 14 8b 56 07 42 cc 12 78 c4 +d2 1a 4a 7d 37 f6 98 2a ee 27 f2 a4 c0 c5 73 d2 + +# PKCS#1 v1.5 Encryption Example 3.8 +# ---------------------------------- + +# Message: +3f 7e ea 78 1b 77 d8 5f e3 71 b3 e9 37 3e 7b 69 +21 7d 31 50 a0 2d 89 58 de + +# Seed: +49 99 c6 4c bf a3 85 24 ad ca b6 6f 64 45 4d 36 +fb fc b2 98 6e 1f a4 75 3a 0e 03 88 9f f0 6e e1 +60 0e ee 23 be 53 a9 74 42 b4 2c 69 62 18 66 63 +2e 4a 6b 6a 1c 71 05 73 26 1d 71 f3 8a bf 9e 52 +49 dd c8 e1 b7 7b 3f 12 6b a0 88 15 c4 fe 63 31 +4f 9b 9e 8e 7a 40 c7 fc 72 86 25 20 ed 49 d4 12 +59 ab 2e 0c + +# Encryption: +74 fd 8b 98 56 d7 57 6e 0f 12 87 e0 e9 08 5a 38 +01 e6 b6 77 4d b7 33 54 1d eb d3 9e 72 cf a8 29 +1f ec 27 01 8c 9f 53 05 a4 4c cb 5a 3c b5 91 fe +d2 e6 a1 d1 d8 5c aa a7 4d c2 37 59 d6 66 5a 45 +70 a6 37 f3 ab 30 4b 76 61 31 3b 96 71 3c 7b 7e +49 77 31 33 dd 5d 4e f9 d2 9a 1a f7 12 00 15 02 +8d aa b3 df 04 2c 56 26 20 aa 49 d2 c0 14 41 4d +fb 15 77 d7 19 a9 58 82 64 71 2d e3 bf 4a 76 79 + +# PKCS#1 v1.5 Encryption Example 3.9 +# ---------------------------------- + +# Message: +a3 85 08 d9 46 0c 63 f4 15 81 a8 86 9a 75 82 4b +14 f5 c6 50 32 29 99 dc 41 13 50 d0 d4 e8 62 4f +f0 9c eb 00 d3 be dc 5d 76 2a 40 c9 39 80 04 + +# Seed: +6a 0a 28 8a 1e 67 43 0c 66 6a eb ea 44 b5 82 a9 +09 69 cc 01 e9 0a ae 10 53 ce 55 ee b9 87 9b cc +62 25 39 15 e9 22 f1 09 66 67 bd a0 2a 14 e7 07 +47 b3 59 35 24 c2 84 85 47 d2 11 4d 1d 0c dc b9 +7e b4 df 45 5b ba c9 b0 cc 29 08 39 b7 3a + +# Encryption: +a6 77 57 80 8f 5a bd c8 1e db 7f 69 2f 9f b8 52 +f1 a1 66 1c 4a 00 98 05 c4 4b 21 6c d3 b1 32 2b +bb 25 d1 45 8e 31 b0 f0 7d 65 50 57 59 c4 b4 14 +7f 23 cb ee 2a f4 a1 a5 93 8a 06 8c e9 c5 32 3f +f5 3f 4b 39 2e 12 50 d0 37 b3 1e 62 81 dc df b9 +6b f4 bf ea a1 47 f0 96 c7 84 c9 2f 4a c5 70 91 +12 28 02 50 29 c3 b5 23 30 3f e8 22 7e 8b 2c c0 +ef 15 70 14 cb 67 31 aa c0 9b fe 6f fa 18 ea f6 + +# PKCS#1 v1.5 Encryption Example 3.10 +# ---------------------------------- + +# Message: +f7 84 05 23 6a 9e b5 57 aa ce c6 00 7d bc 4c 0e +de 78 ed 12 b0 4c 82 88 8a 82 c2 13 + +# Seed: +86 f0 72 3b 31 68 e2 ae ac e9 ec 2e 95 fd a6 e6 +d6 fc 8d 62 94 55 65 66 39 9d 73 11 e7 99 fa a9 +b1 ee 1f 03 2a b2 e5 34 a9 1f bc d0 7c 8a 7d 04 +a9 b4 85 f3 1e 07 23 fd 29 eb 21 88 06 9d 9b bd +76 29 dc 6e 3f c8 9b e6 04 bc f0 0c 52 fa 8e 1d +6c 62 55 5f d1 f6 0c ec 02 d4 d9 61 d8 28 da bc +4a + +# Encryption: +6e 8d 2f b0 b2 ee f8 2f c1 10 ce e0 a9 d3 84 2f +2a 05 8a 24 40 7f a1 1b a9 05 d1 aa 50 e8 cc 12 +de cc 07 3d bd 08 a8 c7 05 18 ef 25 db 96 fd a2 +41 1c ca 08 72 87 88 95 6f 73 df a1 20 e0 ea 60 +5b ff c9 3b 43 a4 41 a4 3d 0e aa 3f f0 73 e6 98 +2e ef 52 96 39 06 07 e2 5a 58 8a 39 82 55 ba 00 +5a 48 5e 6e 73 2e 3a 19 20 cd 43 a3 90 fb 66 d5 +42 8d fd 62 89 74 b8 af f2 f0 60 2d a5 78 d6 25 + +# PKCS#1 v1.5 Encryption Example 3.11 +# ---------------------------------- + +# Message: +56 1d 27 c1 d3 f6 d5 d1 a6 43 aa 47 e5 5d 78 eb +00 f3 2d 42 89 6a 34 e0 c1 d7 1b c3 a5 45 7c 92 +05 be d1 3b 98 4c 52 59 + +# Seed: +98 17 6e 1d 67 a2 46 2f 5d c1 bf a6 e0 75 95 42 +10 4a c1 48 11 d3 18 79 38 25 04 55 c6 5e 4a aa +76 32 bd 2d 1d 75 2e 1f 34 c5 3c ab 26 76 76 a7 +8c 10 c9 98 e7 73 fd 8f fe 35 c8 67 c4 43 be f7 +98 65 aa 2d a2 91 5a 85 c7 02 63 23 69 3e 45 4d +8a b3 2a 77 15 + +# Encryption: +0b c0 47 83 c6 92 44 7a 3d e6 1f 53 b7 2f 7a a4 +10 31 6d d5 09 a6 f4 9e 3a ba 56 ad 1f f8 6e be +9e 63 66 e1 7e 51 45 00 76 be a3 71 d4 c6 89 cd +61 49 5c d8 fa 29 c0 e8 7b 6d bf a8 e3 86 c2 e8 +20 e4 c7 42 a4 87 e8 9b 27 5a 21 86 e2 38 40 be +9c 02 52 7b a7 17 e9 e6 0b 5b f4 17 71 1d f3 4d +7b 8e 2d 12 bc eb 85 93 85 fa 00 1d 4b 4b ff bb +c0 ed ef bd 40 02 41 84 68 c5 66 fd f6 b8 35 09 + +# PKCS#1 v1.5 Encryption Example 3.12 +# ---------------------------------- + +# Message: +eb 5f 8c 0d c9 d9 01 06 1b 82 ae ff 8d 67 d8 bf +fc 0c 04 7e cc 4a a3 46 b2 3b db a6 2a 87 e9 dc +77 0b 11 69 5f bf 19 02 f2 4b 66 ce ab + +# Seed: +74 82 77 0f 3c f5 7e db 81 40 eb c3 3a 02 82 45 +ee 06 48 52 06 89 a5 0e 33 f5 f4 67 f6 d1 e4 32 +4e 1c 50 c8 99 e5 ad 2c 46 c9 7f 81 20 d1 c7 22 +39 d6 a8 2d 8f 8e bc 80 b9 73 ee a8 c5 45 69 29 +50 45 14 b4 b1 56 62 84 4f 29 50 62 f2 1e bd 92 + +# Encryption: +b8 40 43 54 a3 81 b7 c2 ab e5 f7 28 25 f3 d3 15 +bd ac e6 c3 cf bd 88 b8 97 68 61 20 05 19 7c 61 +66 38 83 f2 c2 57 4f 99 5e a6 f9 4e b3 4f 27 68 +62 b3 3f 58 a8 83 92 23 70 6b e1 c1 ff 47 23 05 +f1 1b a9 56 2a 0e b0 12 f1 aa f8 5c 22 e8 8f 2f +df ea ff 86 33 d3 cf eb 5f 76 4f 42 28 92 0d e3 +0c 6b de 2c b4 e8 f0 3d 90 ed 54 8f 64 85 00 35 +1a 5f 41 df 74 ad 65 e8 c3 be e9 50 5a 7d 70 e1 + +# PKCS#1 v1.5 Encryption Example 3.13 +# ---------------------------------- + +# Message: +5a 7f 0e ae ba e4 9c f5 7c 47 5a 6d a6 79 43 a7 +d3 04 6e 3f 7c 7d 50 b0 9a 80 98 b5 44 69 39 68 +93 cf c0 b2 f0 8f 6c 2b ff 23 50 51 57 5e 6e 56 + +# Seed: +fb 08 48 86 db 37 98 d2 b5 bb 35 a3 b1 d3 af 4f +df c0 45 6c bc 79 7b 96 40 d8 c4 4a 0e 03 4e 40 +37 2b 34 fc 7c 1e 8b 66 01 1b 4e cd fa ec 6e e4 +cd c8 28 cb 1a b4 91 27 4a c1 e3 9f 67 58 7a 55 +47 67 09 b4 02 3f c5 69 cb e8 b4 fd 4b + +# Encryption: +07 78 4e cb 8c c5 ba 02 d2 07 ba b0 55 c0 e5 5d +10 a9 b9 42 70 cc a2 50 ee 75 fa 1b 5a e1 90 b3 +3b 96 96 eb 2e c9 72 b2 6a 0e 94 23 af 16 aa 37 +89 17 62 76 06 0a 76 40 03 21 11 74 82 96 34 03 +4f 97 12 c9 17 10 17 f2 fb 21 3f 25 c1 46 c2 65 +1f 89 44 0c a5 36 e5 33 e3 05 cc 6b 01 13 39 8f +61 b4 63 b0 73 e1 be 05 07 3e 9d 64 bc ae ea 54 +44 b8 20 c6 ab f3 46 54 30 ff 4d e4 a8 bc 0e 75 + +# PKCS#1 v1.5 Encryption Example 3.14 +# ---------------------------------- + +# Message: +f9 1c 71 af 5a ea ca e1 79 e1 6e 87 c9 02 3b a9 +4d 84 d7 51 6c ec 6c 39 89 80 1f b3 e7 ad d0 64 +bd df 92 8b 50 00 94 0b bd e5 39 d6 23 37 9c + +# Seed: +de b2 60 25 8b e2 c8 53 35 21 57 b0 65 26 b1 43 +ba 13 3c 4f 49 bf 3d f2 c0 50 ec b2 c9 ca 32 53 +11 b3 c3 e3 d8 8d f6 c2 4a 89 4e ab 63 74 5b 62 +53 e3 c4 6b ca 17 1a 26 a4 f2 fc 0a b6 2b 8a 2e +63 a0 18 eb 47 01 8c ab 95 1f 59 f0 20 3a + +# Encryption: +0d ff ff 51 97 10 c9 ea dc 53 3b 10 8a 4c 29 74 +fe 53 18 91 a3 41 07 a6 74 27 93 5b a7 20 cd c6 +f6 ee 02 9a 1b 03 68 61 db 14 04 c5 86 49 90 54 +1f a2 42 13 01 a7 b2 48 cb 11 f3 65 b6 a4 aa 94 +6f 22 31 cb b1 47 32 b0 1a a4 a6 0b cb e5 20 ec +6c 38 53 a6 95 8a 93 c5 b6 8b 85 d4 bc 3d 84 15 +ef 8b 1d 4f 63 03 8f 4d 94 2c a6 bc 7a 38 25 1f +15 a4 e3 3b 18 9c 25 0b cf bc 03 15 6e 4f 92 11 + +# PKCS#1 v1.5 Encryption Example 3.15 +# ---------------------------------- + +# Message: +07 90 c0 81 f3 61 c9 5b 59 d5 27 d3 cb 50 71 0e +66 e2 72 59 50 10 25 ed 3f 20 f3 0c + +# Seed: +fc fc 2d 56 cb 92 6d 90 5d b3 6e 1e 2e ff 1f bb +75 d6 53 51 7f 59 e8 6f 71 bc 4b c5 57 26 f0 88 +b8 21 62 44 83 b3 e2 9a c2 1a 49 bd 85 91 34 90 +8e 6c 0e c1 a0 dc 80 79 93 01 44 12 0d 1f 6b f9 +3b c6 27 b9 99 69 b2 af e2 1a 7d e1 0d 96 f6 ef +43 c5 67 b5 e2 38 38 5c c1 1a 5a 2a 13 e1 78 55 +8b + +# Encryption: +7f 0e 6b 34 2d 6a 13 54 66 be 41 73 38 1a c0 4a +ba ab 7e 14 fd cf 51 01 89 87 e9 69 67 16 9a ea +97 78 03 eb b3 24 2a e9 ad b4 6f f5 11 20 93 4b +39 21 46 31 b0 3f 5a f5 bd ea 1c ac d3 28 ad dc +d4 0a 3a 29 96 6b f9 8b d7 c8 c6 fd 0f 4e 8b 97 +2e 2d a1 0c 6c c5 52 05 86 7f 39 04 ed 60 f5 b5 +be df 7c 3b 3c 7d d5 f3 87 54 8f 40 05 67 02 ea +72 01 76 dc e2 06 d4 13 d7 42 3f 94 3f cd f6 39 + +# PKCS#1 v1.5 Encryption Example 3.16 +# ---------------------------------- + +# Message: +93 c4 1a 1a dd a8 f6 93 60 f4 1a 58 ec a0 b5 5e +cb 37 a6 a9 00 fb c7 da cd 9c a3 99 c2 3d 31 72 +61 53 77 ac 0c c6 b0 ed 43 bf 59 7f 21 cd 25 9d +8f 80 88 7b 15 9d 96 d6 61 61 d5 58 9b 95 f1 fe + +# Seed: +99 1a 2a 7c 06 1c 23 a8 eb c9 48 9a bc 1b 4a 64 +a5 d4 e8 38 d9 fc ba 42 88 c0 1f ea d6 6d 59 f4 +96 36 e4 a8 d7 52 4c b8 9d 7a dc 7a f3 f6 1a e6 +b3 9b 58 8f b7 7e b7 02 23 62 ff d2 6b + +# Encryption: +7e 54 a4 32 f5 25 c5 23 33 ab e3 bb 45 48 7e 03 +9a f9 4d d3 ef c3 58 44 dd 8e 83 5e e1 00 61 78 +e2 4d cd 19 fc 07 66 7b 4a 34 f3 bd 77 1d 09 a7 +e2 9f 8c a1 7e 88 d0 29 b9 0d db 5f 28 13 be 99 +00 0d 59 f5 43 2c 46 6a 84 28 75 77 20 4b f7 65 +97 39 27 69 98 30 57 47 66 7f af d8 02 9c dc bb +59 18 39 3c 2c fc e4 d8 4a 92 20 ea 3e 38 19 72 +53 36 f2 5f ee 8e 08 5d eb ed 33 32 d5 dd f1 ee + +# PKCS#1 v1.5 Encryption Example 3.17 +# ---------------------------------- + +# Message: +9e 2a 7b 37 74 b1 1e 62 b6 49 0b 56 51 a0 c1 8e +09 2e 9f ab 8b 22 84 ae 46 43 be c3 6b 26 5e 5b +a3 c5 1a c3 85 b2 c7 3d 22 0b 2d c2 e1 0b 0d 69 +0f 67 94 5a 0c 42 b3 bd 09 d0 a8 a7 + +# Seed: +a1 8b fb 74 f6 de bc ed cf b4 7c 7d 5d bf 10 6e +77 4d 7e f6 63 8e c3 82 18 69 cd 2e d6 2d d5 32 +5f 4e 57 33 b8 bf d5 fa fc 43 e4 16 4e 78 d4 38 +99 4d 85 33 7d 7f 0d 38 f0 ea 3b a3 7f 4f 41 b6 +a7 + +# Encryption: +18 c8 8a ee 25 36 d9 42 f7 62 2a 64 4f ad 6f ec +d3 32 28 c7 ae a0 ca da 0e 53 1f 4c cb f1 c1 f2 +69 cc 95 86 29 a4 3b 97 52 fc af 2b f9 53 ec 9f +7e f4 bb 0e 62 d1 28 e0 cf 4b ab e9 2c 6d 92 84 +9e 98 38 dd 88 e2 b4 68 bd ce fc 04 a9 e4 cb 55 +e2 a5 18 ca 25 9f 9e 81 a4 9f 28 df 34 76 1f 9d +ea 2e 70 59 56 62 62 6c f9 6a c0 5a 7c 8b 10 33 +33 e9 06 e1 32 63 9b 65 a7 66 f4 09 2c 8c a0 78 + +# PKCS#1 v1.5 Encryption Example 3.18 +# ---------------------------------- + +# Message: +0a c5 2d 40 01 f2 5c 2c 9d b9 1c e5 0b dd f0 d5 +91 9e 19 96 2e 83 b0 7c b7 9a db 00 43 6e 13 66 +b0 aa 8f 3f d1 ee 79 6b 23 c8 bc 56 0c cf a4 bc +bd b1 f8 40 4d d6 f7 55 15 20 d7 d9 e2 + +# Seed: +22 ff dc fe c6 f0 6b 1b bd 14 53 97 70 43 a3 4e +dd f8 59 4d a0 22 13 09 14 97 55 42 f2 f0 0e 98 +f3 1e 0d d0 c4 8f 7e e5 f0 9d 6a 52 71 21 ad 23 +37 1c 6c d0 e0 79 0e b7 30 8b bb 08 96 dd 59 0d + +# Encryption: +b2 69 57 c5 62 29 4d e1 f3 93 24 b1 cd 80 3c fc +39 fc ee 2d 3c 9d 13 79 f8 a1 12 07 9d 69 43 68 +f5 55 03 c2 09 4d 98 8a 8a 5b 5a c5 49 be 1c f5 +53 16 04 5d f5 b6 f6 33 a4 ef 1e 1f 01 9b a1 b5 +42 bf 0a 87 fa 3e 5c a3 f6 b6 1c c8 56 61 28 a0 +fa 41 8b 08 25 c9 0e c2 f1 ec 74 e5 87 cd 80 57 +d9 52 96 7a c4 52 1c cd bf 63 26 f3 50 93 00 93 +82 6d 2e fa 05 8e d6 44 15 37 4d b3 20 48 85 ca + +# PKCS#1 v1.5 Encryption Example 3.19 +# ---------------------------------- + +# Message: +a8 00 34 62 f8 06 b7 f6 61 fb 66 46 32 + +# Seed: +c7 43 f4 a6 da 03 ab 2d e5 a7 31 cb 88 d8 ca 9b +61 c7 31 9a 5f 8b f9 d2 37 87 7a 05 d0 f3 68 c3 +60 8a 05 2a c6 ce 13 73 17 95 47 55 42 ea 16 a8 +62 91 3d 04 32 f0 8b d8 c8 b6 ff 81 95 69 1f ee +5e d1 42 fb 9e ca 94 67 52 4b d3 b5 fa 5a 4a c6 +14 3b 0d 38 25 0a e6 21 d4 39 90 9c be 3a 6b 5c +01 fb ea 2d 7a 3f 1a e4 1d 61 fd d6 47 64 14 9f + +# Encryption: +b7 38 e1 c4 29 f8 fc 06 82 fa ad c8 ca 87 ed 8f +16 df 93 0f af 43 b1 99 1a ac 71 d8 8f 26 4c 0d +82 9a c0 3d 23 c2 5f c5 f3 e8 5d d3 02 cb 7b 15 +33 e6 8c 24 16 c5 1a 79 bb cc 7c 29 b0 7e 2e 0e +23 c6 f2 df 0d 07 81 91 7e ba 1a 57 08 62 8e ed +8a 15 b3 b1 84 af 70 0d 0d ab b1 4d f6 0b 09 ba +d2 12 7d f1 80 f4 d6 f7 29 65 87 60 d6 33 c7 77 +5a 7b 59 6d 09 d9 03 49 1f 21 09 6c 34 c3 95 3b + +# PKCS#1 v1.5 Encryption Example 3.20 +# ---------------------------------- + +# Message: +ef 32 + +# Seed: +43 99 cb 04 4a 60 07 6d 18 cc b3 4e 8b 07 8c 81 +8e a7 7f 63 b0 a4 3a bd ec c5 77 81 93 a8 bb ba +5d 56 d0 fc 4e 82 a2 11 51 6b bd ef 44 e7 f4 e7 +fe bb e1 e1 92 3c 99 9a 7e 96 1c d6 ee 1c 41 6a +85 96 e2 4b 63 83 a4 69 93 5f 33 d1 56 fd 5b cf +db d4 27 46 0d 48 66 83 06 1e 41 05 f3 5b 5e 75 +23 20 15 5c 7f 69 ad 8e b4 02 cc 11 06 e0 28 9a +9b 49 65 82 3e 7a 51 cf e4 d2 6d + +# Encryption: +13 1b 62 5e 86 e6 cd 1e 08 ac f1 95 d9 3c d3 a0 +dc 8b a9 e2 dc d6 fc 99 6b e2 17 24 af 17 90 b6 +88 d7 9d 3e a9 a9 50 98 ca bb e8 a5 d4 85 92 e4 +74 6b 0e d2 af 7c af 89 b7 b6 15 2e 38 24 d9 15 +89 ee ec 33 75 c7 1a 89 97 48 70 3a cc 1e 8d 1d +e4 71 ea 75 28 04 0b 79 5f 29 9e 66 8c ec 9f 5a +f3 eb 48 f9 8c 0d 85 20 67 77 3e 10 1f a2 4a eb +6b 40 4d af b4 2e 7a 63 b0 4a 66 bd 0e 9f 9c 94 + +# ============================================= + +# Example 4: A 1024-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +e9 f2 5e 48 14 0b 5d cf 46 99 e3 03 7f a8 34 f0 +c7 8b 16 73 5f f7 9f 6b 18 ae 60 b5 18 48 d3 06 +99 ec 64 6d 85 7f 15 77 0e 2c 7a 0c 0c 90 0f b6 +04 0b 5f 34 48 4e 9c f5 ce da 23 d5 b2 50 ef 93 +28 6f 01 1e 9a 5b f9 e5 42 e5 c9 f4 42 de 54 58 +e2 3e 41 d1 d9 cd 9f 0c e1 cf 20 08 d3 ea 4d 80 +32 e8 54 cf fc df 5f 69 8d 13 16 e0 29 c4 88 fc +bb 2b e2 9a 4e 7b fb 8e 6e 81 d3 42 12 3e e7 5b + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +e9 f2 5e 48 14 0b 5d cf 46 99 e3 03 7f a8 34 f0 +c7 8b 16 73 5f f7 9f 6b 18 ae 60 b5 18 48 d3 06 +99 ec 64 6d 85 7f 15 77 0e 2c 7a 0c 0c 90 0f b6 +04 0b 5f 34 48 4e 9c f5 ce da 23 d5 b2 50 ef 93 +28 6f 01 1e 9a 5b f9 e5 42 e5 c9 f4 42 de 54 58 +e2 3e 41 d1 d9 cd 9f 0c e1 cf 20 08 d3 ea 4d 80 +32 e8 54 cf fc df 5f 69 8d 13 16 e0 29 c4 88 fc +bb 2b e2 9a 4e 7b fb 8e 6e 81 d3 42 12 3e e7 5b + +# Public exponent: +01 00 01 + +# Exponent: +45 45 88 68 44 53 27 48 60 49 e1 bf df f5 61 13 +a8 aa 45 10 0d ab 07 4f d1 63 94 ec 1a 90 39 b8 +1b 2c b5 81 fe 84 e6 48 b5 f0 32 85 4d d4 fc 69 +f3 61 a0 a3 9d 03 76 13 8c d7 e7 c3 77 84 e2 a2 +f9 d4 f2 66 84 cc 5c c9 f5 12 ba 62 15 eb d2 32 +f9 aa 3d a4 69 db 43 da 1c 06 46 e7 5b 33 aa c5 +70 08 1b 5b 2e 96 ea b7 54 6a cf 93 17 85 aa 2f +d1 82 4c be 2c 5f 9b f5 63 34 ec 15 66 d1 cf 45 + +# Prime 1: +fc df 1c 49 35 8a 1a ac 93 88 c4 6c aa 04 72 fa +35 b2 1b df 99 a2 7b c2 ac 65 46 7b 88 d0 16 1f +bc 70 f3 f4 fa 13 a5 f3 a9 8b 59 c0 67 ea bf 19 +62 16 a1 b8 9e 20 af b2 e5 e5 ed de ae 8e e1 ef + +# Prime 2: +ec d7 51 d3 d3 f3 b2 08 bd 71 8a e4 35 5d 23 f9 +16 fa 8f f6 7d f0 36 61 6b fd a7 cb c8 7a eb ef +aa 7e da 69 1f b9 8f bb 03 8a 02 07 22 01 3c a8 +ee 3d 04 8f 97 ba d2 a2 93 0b e4 b9 6f b7 4d 55 + +# Prime exponent 1: +1d 2f 73 08 50 11 9c 7a 86 9c a6 6f 14 40 67 34 +d1 b5 b8 d9 d9 d5 93 0b 28 f2 97 6b f2 a2 71 ab +40 08 99 5f 90 ed 6b 9d ef d7 91 88 4f 76 1c 90 +45 6d ef 44 6b 9b c2 2b 97 b5 2d fb 21 92 84 29 + +# Prime exponent 2: +4d 50 95 03 c3 83 20 31 3e 36 9c 92 96 e1 0a e7 +3b 9b 1b f7 e9 70 cb 2f ce 63 05 ad be 8a 72 0e +d0 e7 8c 41 18 fc 28 71 72 5c 51 01 27 16 a4 48 +b9 4c ed fa 3a 1b e0 ba f5 a9 c2 46 ce b3 55 e9 + +# Coefficient: +bc 15 f4 7c 0b b6 de 6a 7a 3a 1f e9 28 89 80 9b +4a 3c 0c fa 65 0c 2f ec 36 b8 92 85 14 65 47 a5 +7d 2b 15 71 ac b9 d3 0a a7 91 ec 97 fd 51 fd e1 +ec 26 f5 6b 32 63 da ec 9e 29 2e 9c 17 37 36 4b + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 4.1 +# ---------------------------------- + +# Message: +ca 24 72 1c 88 e0 47 74 f4 15 b4 c4 6c a0 fc 26 +d5 bb 53 aa fb 19 92 f6 de 78 5c 76 3a + +# Seed: +fc 7f 85 c1 38 6d c4 3c 3a 28 46 e4 da e4 d9 54 +80 54 45 9d a2 31 82 f9 84 07 9b 07 1f db 5e 6d +9d 0f a0 b2 2e 3d e6 36 ee 5b 25 3a 42 f9 5e ed +44 22 95 6c 70 f4 8d fe cf 0e 55 5b 05 15 7b 15 +6a 55 c8 bc 65 8c d3 b5 39 7f ab 78 d7 11 56 4e +89 c7 e6 24 8a a0 6a d1 05 c4 0c 31 c4 b1 99 7d + +# Encryption: +e3 95 ff 1f a5 52 fc 2e 79 c4 a5 35 58 df 14 00 +f8 70 4e b3 6c f7 cb 05 1b ab 93 15 0a c6 39 6a +dd 63 66 9b 04 24 8b 9d b3 6a 9c 94 f5 19 8c 6e +5d 9a 17 d4 74 ed b2 03 45 fd 6a 78 b5 1d e8 16 +6e 98 ca b5 b6 d1 65 68 b4 1a 8e 93 e4 83 88 65 +d4 bd 9c 51 cd e8 df be ee a5 88 2b 09 dc 70 bc +9f e7 49 b5 d2 4b b7 ca 51 1d b2 c2 b8 29 a7 c9 +14 6c 77 4e b0 bd 7a af dc 5c 38 d3 d7 cd 58 27 + +# PKCS#1 v1.5 Encryption Example 4.2 +# ---------------------------------- + +# Message: +25 c7 bc 4c b2 43 ac 1f 07 40 86 9c d2 6b a8 26 +f3 55 d4 77 c4 aa 6c be 54 3a dd ea 84 44 44 f4 +1c 35 92 bb 3d a7 d4 21 + +# Seed: +27 2b e3 fb cc 76 14 99 6f 1a c0 e0 a5 e2 69 06 +23 bb 0b 69 70 fc de 0b 6f 45 58 ee 62 34 26 fa +60 ad d6 c5 a8 a1 0d 4a 37 51 50 15 36 fe 8a 45 +c5 42 f6 27 f4 22 9f a1 24 57 c1 13 31 13 72 05 +55 2b 01 4c 91 b1 c4 e0 9e 45 96 78 34 0a 74 c2 +85 e2 6a ef b9 + +# Encryption: +76 50 d6 f8 1a ef 5c 0e 32 0e c7 7f c8 9b 7c 3e +61 83 85 0d 10 c9 8a d7 e9 fe ea 47 e3 8c fb 37 +a0 25 db 42 1f b6 d0 05 80 9e 38 bb 3c 51 95 1d +a9 d9 43 3b a7 ef b1 7d e7 d8 fe 3e 9b 9c e4 55 +53 74 ea 66 3a 1b 5d a4 a0 92 29 4c e9 66 98 56 +55 e2 dd d2 0d 7d e3 aa 35 37 05 8c fd 7e 7a 7b +97 fc dd 98 53 79 2b a8 3f cc 89 07 4a 8d 0f 3c +ef df 98 5b 9e 78 ae bf b0 59 67 36 4f 24 11 cd + +# PKCS#1 v1.5 Encryption Example 4.3 +# ---------------------------------- + +# Message: +cf 00 7e bd 23 da 06 97 1a f7 9a a6 34 d5 d2 55 +05 bd 52 29 + +# Seed: +9c f7 23 7e 28 a8 6e 41 8d 66 4f e3 be 7a e3 0e +eb 95 5a 3f 71 02 b2 7d 5f a0 96 74 9c 7f c2 06 +4c 88 0b f3 d3 0e aa 98 1f ce 39 86 a9 10 fe ea +e1 84 c0 10 25 04 8b a6 79 48 96 fc cf f7 4a 59 +42 f9 62 f3 e3 63 71 f6 b3 55 18 29 43 4a d8 d0 +0a 2c 59 7c f6 d4 51 ea ce 88 86 85 38 a4 80 f6 +8c e6 8f c6 85 6e bb 57 dc + +# Encryption: +b6 32 52 af 2e 8e a2 71 e7 06 fd 68 3d 0f 8c 10 +b3 f4 a3 45 c4 f5 b6 78 5b a9 32 9f 44 62 43 c6 +f3 69 e3 0e a8 fb 11 08 4d b9 79 88 e9 c3 87 4b +34 d6 fd 08 71 7d 9e 81 0e 9c 22 43 60 34 6b ec +cd 3e 0e 53 d1 0b 1e d4 58 e6 4f 3f b0 92 f4 8c +b6 6a e0 3b 64 f6 aa 9c 63 bd 27 9f ae 4c 33 f4 +2a 9d 73 bb 39 11 8e b8 7d 25 12 b9 d9 36 a2 7e +d2 e4 49 60 7d bf 0e 3e 22 3a 53 95 26 35 59 9c + +# PKCS#1 v1.5 Encryption Example 4.4 +# ---------------------------------- + +# Message: +ef da 79 e9 c3 36 c2 34 ff 37 b4 f5 8f db d3 1a +f3 67 5b 3d 2b 10 5e af be ad 4b bb ff f5 4e 68 +6a b5 + +# Seed: +30 c2 09 43 f1 bf c4 23 61 d4 d2 2f 51 a8 d7 86 +cb 2d 0d d5 ff 7d 70 5b 30 28 60 18 11 29 3d be +5d 72 c3 55 97 10 ce 0a e9 5d 2f 16 b2 39 a4 ac +84 45 53 7d 48 8e 3e 6d 2c f5 b7 a6 4c 06 c3 75 +6e 11 60 67 63 63 3e db dd bf 26 be e6 51 18 42 +d2 75 2d cd 88 89 6c b8 55 8a 87 + +# Encryption: +bb 91 b2 f6 f4 33 1d 64 d0 73 6a 2e a6 03 29 aa +16 c2 ed 7a 4d 5c a8 d7 84 e6 30 4c e4 84 4c 71 +58 f8 22 d2 af 29 c8 90 97 7d 75 a9 35 e4 3d 93 +b5 be 10 c1 d4 4f a0 0c e2 8e 75 f5 27 bd 84 a3 +be 5a f5 be e9 45 67 c5 5e 15 ee 3e 93 42 6a d8 +d5 0f 06 4c 57 93 ca 38 c4 3a 70 c5 f5 60 74 0b +16 ee a1 6b 7f 13 41 5f 75 1b 3f db 87 7a 88 29 +33 21 f5 0f ff a6 f1 24 94 96 c2 b0 27 a2 18 ed + +# PKCS#1 v1.5 Encryption Example 4.5 +# ---------------------------------- + +# Message: +4a 01 fc 13 c1 d8 6f e7 b2 fd c7 92 f5 28 0f 87 +5a dc 5a e9 9f f9 11 d0 2c 8c 00 3d 39 bb ee 54 +b8 51 ef a3 4b 41 31 be 52 0d 81 00 ef 62 c2 5a +4b 51 7e 9b + +# Seed: +be 6b a5 d1 1d f1 bf cb 2b 84 67 71 b6 c9 df c9 +33 4d a8 6c 4b 7c 25 43 93 18 e8 ba 8e 47 49 2b +cd 51 1b d4 ca e1 67 7d 31 2c a2 2a 94 57 cc 81 +d9 0e 4d 52 4b a2 26 5f 0f bc a1 8e 3c 3f 48 2d +ca a7 88 33 22 39 34 6d 6f + +# Encryption: +16 bf cf b4 2d 28 b9 d1 62 70 cd 13 8d c3 ca 64 +42 95 6a 41 82 5e d0 23 0b 71 09 16 13 33 3a 9e +7c 52 ce 8c c4 b0 bf 29 10 79 41 a0 d7 2c c3 4a +fd 00 48 bb f4 c7 16 c7 3a a9 b0 c7 8d 37 c1 93 +71 9e be 03 a9 31 74 53 b5 53 d4 f5 b3 85 d1 41 +fc 3b 0e d1 9b 96 dc 35 0d fd 4d 12 e3 dd 03 ff +18 39 d4 78 2c 6d fd 5f df 59 71 f3 dd b0 e3 12 +a9 16 06 f3 13 73 02 0d b3 a7 6d 04 fd 6d 65 d6 + +# PKCS#1 v1.5 Encryption Example 4.6 +# ---------------------------------- + +# Message: +7a b0 6e 19 69 22 c0 + +# Seed: +de 0d 60 33 c1 e9 6b 5f d8 31 21 4f 30 d8 1b 8f +d9 a2 69 3e 5e 8a 36 ea ff d0 39 e7 47 3c 28 ee +43 a3 91 6c 78 c9 a1 12 95 8a 94 ce 67 1c cc 40 +d9 7e d4 18 7a 3f ff a0 dc 12 9d 88 a8 b8 c4 96 +6e a3 94 a9 10 89 61 25 f5 4d af bb 3b 17 b9 fa +10 c4 82 20 09 64 90 c6 f7 5b e2 51 83 e9 98 4d +f5 e4 d7 eb f9 47 5d 11 ea 39 33 5a c7 2f 93 d3 +33 bd 74 22 19 42 + +# Encryption: +54 18 23 f9 05 57 6d a1 42 e2 65 d8 90 45 ab 66 +20 fd 1a 74 c9 53 3a da 4b c7 b4 3d 95 62 9a 31 +18 6f 4e 89 89 20 83 d2 54 9b 0e 63 8b df c0 d2 +7e 14 ec 18 c4 5c a3 58 61 df e6 12 a3 a1 ed aa +fc 72 fb 46 81 a9 9e a6 e6 48 be 89 62 f1 56 1e +75 0d 14 49 f2 3f 43 0a f9 30 72 25 54 4d 8a 8b +89 65 af 5d d1 8c b7 89 53 ce 6d 16 d8 5e b2 11 +af 0c 64 68 a2 af 9f 72 e7 86 61 b0 fc aa 48 15 + +# PKCS#1 v1.5 Encryption Example 4.7 +# ---------------------------------- + +# Message: +9a da 9c 10 b8 ae 22 + +# Seed: +cc 23 43 72 4a c5 0e e5 47 08 fc 5f d0 3f 09 a1 +cc 12 22 a4 4b cd 44 03 87 7c 6b de 86 bf 43 e4 +2c 10 84 f6 ef ff 20 fa c0 ac c3 1e ca 17 c7 38 +d4 68 68 73 65 52 fd 2f 7e 93 b8 22 25 61 05 4e +6d ad c3 15 60 4e af 8f 77 f0 5d d8 58 3a 93 bf +03 cb 9c c2 13 9b c4 19 bb 10 e9 b2 01 b2 a7 e1 +8b 03 79 0c c8 3e d6 05 d6 d5 66 33 05 34 71 39 +c7 5e 1a e2 a5 6a + +# Encryption: +9f 54 d0 de a0 5a 5d 00 72 23 5b c4 67 93 cf c4 +7b 00 6d aa ac 02 41 c7 e6 6d 33 3e 23 c3 cf 97 +63 b6 1d 9e ea dd d8 3f 5d 7f 0a a9 7d 16 c7 69 +92 55 cf 7e 48 72 b6 a0 07 95 62 d2 60 7d 64 40 +d7 ed 37 c6 71 3c e9 66 43 a4 41 f8 39 55 64 d2 +6a de a5 82 3a 49 42 da 4a b8 e4 7b ed 58 81 b9 +d1 84 05 79 57 df 65 39 e4 36 da 35 e3 0a 25 3a +f1 2d 54 1d 4b 0e f8 3c 5e f3 c1 35 ab 95 94 9a + +# PKCS#1 v1.5 Encryption Example 4.8 +# ---------------------------------- + +# Message: +d8 12 6f 4a 88 78 97 82 93 11 76 51 b3 0e 79 22 +d1 4a cf + +# Seed: +ad f9 b0 a9 15 2f 0e 6e c6 f4 39 59 71 ad 40 3f +02 e7 fa 98 f8 15 56 0a fa ff a7 ca d5 b4 47 4b +6e ce 65 ed ab e2 7e c2 4a 0a a4 73 ed 75 a6 1f +5c 24 90 a5 36 b1 a4 df 7b 03 41 77 37 c5 34 e1 +d4 5b f7 26 94 38 6b ee 82 0c 48 db d1 83 17 bd +61 7c 04 b6 a4 17 e3 0e ed 79 58 8d c2 3f d4 db +a1 37 44 b4 b2 aa 5a f8 0a 8a + +# Encryption: +3b 2b 85 ed fc d7 c7 c2 7b de de e1 c2 8a b6 18 +7a bf 1c 96 d9 45 30 07 92 cf 8a f1 97 c2 f9 a3 +91 b4 8b 83 32 cf de 7e 4c 7d c3 4c 42 30 29 56 +92 ce fd a5 ef b2 57 35 49 2b 9f f7 84 c7 ba e7 +35 11 c6 18 e3 aa 7b c8 7b c3 13 f2 67 09 a8 ea +4a d7 3a 34 9a b9 e5 ad 82 6c 96 ad 0e ca 97 e3 +13 28 6b cc bf 8e 33 c9 1f 03 68 39 b9 94 8b 4e +b0 c3 8e 21 3e f4 7f 77 66 1a 27 f8 cf e4 99 03 + +# PKCS#1 v1.5 Encryption Example 4.9 +# ---------------------------------- + +# Message: +f5 df 01 af e6 a9 22 51 8b 3f 4b 80 cd 4f ca 73 +b9 7b ab 61 71 6e 27 d2 51 bd 46 5f 4b 35 a1 a2 +32 e2 da 00 90 1c 29 4b f2 23 50 ce 49 0d 09 9f +64 2b 53 75 61 2d b6 3b a1 f2 + +# Seed: +6b f2 81 0d b8 fb 26 93 98 41 2d bb 88 06 02 82 +d4 5f be 96 27 33 7e 54 34 26 1a 5d bc 19 3a d6 +18 c1 1f 7b de c1 de 25 05 f8 60 37 fc 18 51 bf +6f b4 9d 23 60 62 73 47 49 9e fc 98 e2 92 05 da +90 6d 32 + +# Encryption: +40 12 fc c5 cf b9 78 de f8 8f b8 f8 17 4a a5 b4 +a3 07 75 ac 45 59 f0 b2 f3 d3 b4 38 9b 82 8a 79 +d1 40 25 10 c9 a0 33 7d 48 9d 11 82 ab 31 c8 38 +ac 7c 80 b7 48 60 9a 2a a5 37 da 7a cc 3a 4a 7a +31 d2 ad 25 2b fd 59 28 0b 3d 18 13 a2 6f 93 c5 +9e e8 c5 ee 68 87 18 f4 27 83 93 fe ce 32 3a 9d +ff 83 37 55 e8 9a c8 ee 1f a2 90 4b f2 4c df 4f +01 e6 ea ed b6 a8 ef 01 f4 07 be f3 30 9f 03 39 + +# PKCS#1 v1.5 Encryption Example 4.10 +# ---------------------------------- + +# Message: +a3 82 3f af + +# Seed: +94 f6 70 fd 82 f6 91 32 75 ee a4 c6 71 16 ca aa +bd 33 57 8c f8 4d 22 63 64 38 a6 fd 7e cf ee fc +0b 18 7d ec f7 93 89 1c 6e 4c fc 52 b5 67 d8 72 +bf fb ee 0a 67 47 2a 1a 48 c0 f1 ba 59 8a d8 25 +89 01 c5 6a 55 92 f1 41 14 7e 81 33 9d 74 7e 06 +32 de f0 0d 3d be e9 5c 4e 43 21 cc 25 b5 31 14 +47 a3 02 c5 34 92 9c f7 e5 34 f9 ae 67 f4 1e 01 +e2 2a 3d 7c e4 1b 3b 31 35 + +# Encryption: +7b 60 25 42 b6 4f 0a 1e 0e c2 aa 01 cb ed 37 7e +33 1e a3 ff 86 f3 56 fb 7a 58 83 76 4b e4 cb f7 +d0 75 4c 58 29 64 31 36 f2 57 23 36 a2 3f 15 41 +1d 83 85 14 a1 43 87 24 ad 74 09 e8 ec 8f e2 63 +41 ae ea 56 68 34 5d 0d 82 3f b5 c2 1d f4 59 e8 +bf 7c 15 b8 0b 07 2e 5f 8a 84 65 a4 4a a9 d0 9d +82 5c 03 15 a0 ec d2 d6 49 70 2b 10 9b e8 fe 35 +eb 22 84 3a 20 e7 fd 87 4f 1c 6b 46 a8 0b 68 df + +# PKCS#1 v1.5 Encryption Example 4.11 +# ---------------------------------- + +# Message: +75 b9 a4 a0 bb 2d 46 43 e4 78 f6 54 f2 cc 1a 8c +1b b4 67 19 76 0d 45 41 a8 a7 33 f3 3b 71 3d 32 +c6 0b fd 35 f1 61 74 83 48 47 e8 81 2c bd 7f 06 +ce 72 89 f3 72 c5 82 30 f2 b0 01 45 9b 5d + +# Seed: +49 a7 3d eb 93 e3 f1 be aa ad 3a 19 9a 70 56 9e +09 9a fa ca f7 a7 5f c4 ce 64 8f a8 2e af 2a 0f +e4 11 d2 64 fe 45 f7 45 25 c9 1f 3c 75 10 17 f8 +0a 02 ba bf f3 57 99 62 6f 2b 8d db 9f 36 91 + +# Encryption: +e5 ae e7 0d e8 62 72 3c 51 73 df fb f6 92 6c 3d +33 16 d5 90 9c f5 a1 d6 63 e6 80 ab 2b b5 76 e3 +5b 93 fd 43 27 43 a1 8e 8d b4 fa a3 32 f4 46 68 +a3 d1 9e 5e 69 57 32 f8 4b bd 86 d0 dd ed 76 65 +b7 0b 97 63 2e ab e2 36 4c af ef 7b 74 dc d1 bf +bd 62 5e 2b bb f6 65 4c c0 26 61 81 ac 0a 75 7c +3f ba bd 43 0a e8 63 71 eb 56 af 61 0f 77 cf 2f +ff 6e 24 8f 8c 57 91 60 b9 1d ce cc 0d 20 2b 50 + +# PKCS#1 v1.5 Encryption Example 4.12 +# ---------------------------------- + +# Message: +15 06 eb 34 91 78 5a a7 21 06 bf 6c 85 d0 10 02 +04 6d 1c 16 d4 35 dd 4e 7c 4b 7e 8e 90 dd df 16 +33 2f 94 f4 b8 35 d0 e4 ad 55 d8 3a 81 b3 5c 54 +b6 79 d3 cf + +# Seed: +f6 6e 6a 84 75 84 40 86 e2 84 77 22 97 46 80 1d +43 50 d9 ad 07 68 f3 c3 d8 fa a8 10 7d 95 fb 20 +5e 4b a8 c6 4b 73 8e 54 e5 ac 0d fe ab 99 6d 61 +12 5c 26 79 80 72 59 bc 9e 47 d8 bd d2 c0 40 95 +05 44 8b bf 87 2b f6 64 7a + +# Encryption: +d1 fa 39 52 cc 61 45 ff 77 1b 6c 5a 68 27 5b bc +22 d0 03 92 03 66 17 37 5f 0c 2b ec 3e 28 85 83 +ec fd c6 df 6a 82 8d e3 7f 77 c5 56 a8 cb c4 d4 +43 36 e8 d2 e3 05 87 e3 31 58 73 17 e9 7b 05 a3 +fd 78 02 5b 2d 49 6b 3b be eb 6c 72 5d 9e a5 61 +a7 32 28 82 33 d6 8b 79 49 7f b0 b6 fe e0 a6 b6 +8a c3 13 66 1b 4b 65 47 39 f9 18 f6 fd 3b ff c1 +7c 1d f4 1f 01 44 95 d5 5f 95 90 14 7b 82 d1 5d + +# PKCS#1 v1.5 Encryption Example 4.13 +# ---------------------------------- + +# Message: +9e 3e + +# Seed: +9b 3d df 17 cd 74 e7 6c 69 b5 ca 3a 01 0a 0e 0f +bd 17 05 d6 9c 30 74 35 3b e7 d3 c0 c2 05 f0 99 +c7 a8 10 b7 a1 ad e0 9f 5a 03 6b b7 69 ef f5 3a +53 d4 c6 f8 71 52 92 2d 9a 7b 86 ed eb a3 72 37 +d7 f1 73 4d 9d 97 39 38 3f 48 80 af 3a d6 88 87 +e0 fe 7c 87 a1 74 fb 32 38 b1 e5 1e ad 2a 84 34 +40 c2 b2 7f 22 dd a4 22 8d ce 70 f9 1c 98 d4 71 +a8 74 4d 27 65 55 79 58 81 02 44 + +# Encryption: +42 12 6b 49 2a 1e 7c c0 33 95 b2 ac 70 33 cf 6a +67 36 b1 2e 76 82 5a 17 3b 9e 01 1a e8 bf ed 44 +fe cb 8d 9f 58 cc e1 99 11 fe 42 d4 55 e2 49 20 +09 32 a9 b6 8f e2 e4 19 bc 63 9c 11 78 d1 1f fb +db d9 95 5d 45 9f 5e cf e0 90 20 09 8e 29 7b 8e +91 48 5e 94 bf 11 e7 bf 77 ed f5 a2 70 11 c8 2b +92 73 65 a1 2c 9c 77 c7 e4 9b b7 fe 2f 61 33 39 +de 3f 51 20 87 79 53 86 ca 58 5a 70 24 78 27 90 + +# PKCS#1 v1.5 Encryption Example 4.14 +# ---------------------------------- + +# Message: +70 aa 78 a4 d3 7f 74 c1 81 aa 27 40 7f 2f 9f e6 +63 a9 1b 16 be 9b ea 6f c6 12 88 7f + +# Seed: +d0 fd 16 c0 f0 d7 90 9a 38 86 17 08 11 e4 4f 24 +fa df 94 ff 17 03 9a 56 84 a0 9b 24 e1 93 3f a0 +c4 71 51 63 5d 75 7b 73 c2 3f f3 91 01 cb e2 52 +9a 63 a7 f3 a0 19 5b 6e 47 51 07 11 de 17 1a 16 +56 c9 ea b3 cf 82 d1 c6 52 26 b5 8f d0 fe 58 ec +31 96 24 7f 34 b1 a0 55 27 02 dc 03 75 12 c6 81 +04 + +# Encryption: +95 36 d4 7e 1d 68 7f 1f 24 99 6c b4 6c e9 46 ae +54 d4 a1 49 b3 4b 5b c3 44 43 a2 01 51 83 87 f4 +b6 38 18 37 cb 7e 4b 0a 44 75 13 70 42 f1 44 8c +1e a4 15 15 ef 31 c2 fc bf 62 e7 e9 58 67 b6 74 +ac 23 0a ed 9c 7d 8d 61 c5 27 52 b2 fc 2a 0b ba +fc 77 b3 1c 51 49 30 de 98 23 b4 38 b6 fa aa 40 +d2 55 31 03 3c 66 48 3f a0 02 3a f2 1d a6 4f cc +8b b8 c5 d5 2d 3f 6c 43 80 f1 d6 08 d8 c0 11 8f + +# PKCS#1 v1.5 Encryption Example 4.15 +# ---------------------------------- + +# Message: +01 16 a4 61 77 73 b6 dd b2 19 16 1c 4f d0 71 93 +7b bb 07 15 cc 62 7c 17 b8 e7 52 80 d9 9c dd 41 +6e a5 cd fa 09 06 b9 af 0a 20 cd 47 7f dc ad 14 +15 a1 9a 9d 1b 96 fd c3 c0 ed b9 + +# Seed: +86 b1 58 60 9b fa 08 a8 ed e4 ef 3f 23 e1 2e b5 +0d 24 55 74 26 4d 76 4d 87 12 67 db 8a 95 24 ea +3f a2 e3 84 5f fc 29 1b da 98 99 89 bf 71 5a a2 +b0 8c 49 79 8a 81 9f 68 58 d9 fa 35 f9 4d f3 c7 +e0 86 + +# Encryption: +74 a3 df 38 5d 20 87 7b ca 9d bc eb ca 2e 53 2c +6a be 95 62 d6 81 7b e1 6e 11 8a 60 f4 ab 0a 1a +c0 a8 46 66 53 a8 f8 17 0e 35 fc e1 4b 44 9c d5 +9f 55 8e 02 0a 89 88 94 bd 2a 71 75 58 e6 65 0f +3a 12 85 70 d8 c1 69 a7 74 66 63 c1 d7 ef 62 14 +5f 4b 75 c5 fe b6 38 6f db 85 33 94 c6 59 a9 1a +a2 aa e0 3b ef 91 13 dd 49 28 ff 28 b3 80 92 7a +d1 ba 4e 8a 37 ed d1 72 ef e8 e9 ea bb 61 4d 83 + +# PKCS#1 v1.5 Encryption Example 4.16 +# ---------------------------------- + +# Message: +15 c5 fc c7 54 7d 63 76 1f 6a f1 f2 6e ed 9b e8 +13 4f 9f 92 12 7e 76 b0 3a 33 a9 7b 9b e3 f7 8b +2e 22 fc 7c 85 06 99 a1 5c 0e 0e ce be 2a 71 80 +5f 02 4b 93 88 a3 bd b2 b3 60 d6 9c 5c 0c 46 + +# Seed: +5b 4f 17 a9 de 91 73 7a 7f e8 54 e8 a1 76 be 5a +0a 16 fc 10 42 cb 87 0c c0 18 92 fc d3 8e a7 5b +07 3c 0f fa 01 4f 96 a3 58 e3 aa 5e 73 ea f8 a9 +1f ce 75 47 0b de 64 e8 7a b8 91 ba 3b f2 + +# Encryption: +73 62 d7 39 8d 0c 25 1f 83 58 17 e4 79 37 a9 25 +58 36 ca 02 30 45 7f f6 08 b0 78 d5 09 31 a8 80 +33 ea 76 50 81 12 65 f8 e2 68 b5 33 15 d8 43 8e +52 a6 a4 b1 b3 89 5d 30 c3 da e1 1a 3b 8e a8 c3 +0f 05 e9 d7 1d ef 46 d4 51 11 92 a1 0f 54 21 8d +39 36 cb 17 98 3a 1e 7a ff 18 18 89 39 b9 46 92 +76 49 b0 fc 4f 7b bf cb fc 14 e1 c0 ec a0 7d 00 +c9 03 db 78 16 9c 50 ef 0a 38 f1 da 19 ae 44 59 + +# PKCS#1 v1.5 Encryption Example 4.17 +# ---------------------------------- + +# Message: +7c ad 18 f1 75 13 87 42 28 5e 90 35 d1 3a d4 1f +c3 a8 52 10 e1 54 4e 24 de a3 fc fe 66 + +# Seed: +9a 06 ca 10 fc c6 61 0e 77 df f9 0d d1 76 f8 2e +3f 96 e4 a9 d7 ab 87 2c 74 8e d4 22 f3 4b 33 48 +61 94 40 f0 aa a2 2a 66 98 51 da c8 89 4a 8e fa +34 ea 2c 2d a5 e9 58 69 e0 ad c0 05 a4 9b a4 58 +18 ca a4 74 11 5c 34 49 96 6a 85 c4 18 fc aa 8f +45 63 0e fe 0b 1b 4d 3d 69 be 1b c0 06 8a a7 99 + +# Encryption: +1e fa d4 14 46 b9 1f da dd 8b 80 61 9f 68 27 36 +68 b7 58 5f d9 1f 34 49 ec 85 c2 42 d0 84 9e 4a +53 a5 97 7b 61 aa 40 d1 2c c4 85 ec 7e 4f f2 0f +98 86 91 cb 9d 73 af 46 ea 37 6a fc 69 ba 22 33 +86 e9 f1 5d 03 26 97 da 75 e2 f9 52 be 2a f0 62 +e8 24 6c f7 49 b8 9c 4c bc d6 4e 23 f8 82 bb 55 +3c 3c e3 05 20 36 22 b5 a7 39 77 35 a6 34 aa b0 +d1 7e f9 b5 55 9d dd 34 f4 87 2b 56 e7 98 6e fc + +# PKCS#1 v1.5 Encryption Example 4.18 +# ---------------------------------- + +# Message: +fd 98 c3 8b e3 19 30 70 b5 c4 33 4b 11 c2 5b 33 +4a 44 + +# Seed: +f3 57 91 11 03 e9 87 d1 a9 f1 5c c2 e5 2f 42 39 +0e 0f aa 50 02 c4 f1 7d 40 a4 af 50 f3 1a 23 17 +50 e7 af 61 d9 af df 9c aa 38 61 a2 0d c7 21 89 +58 61 fb 11 8e 08 8d 32 18 e6 fb 35 56 b1 62 d6 +bd 67 91 1d bc 94 21 98 42 65 82 72 a5 d4 9b f5 +ab b4 a0 87 94 95 c5 e6 e6 86 28 59 29 a5 5a 36 +8f 52 4c 14 a4 0b 0c 61 38 0d 0e + +# Encryption: +de ae 18 3b 56 c3 fb 38 41 ea 57 42 34 ac d3 0a +ff 00 d0 05 1f 57 80 37 58 a4 71 4a bc be dc da +8b d1 a4 8a 98 01 53 df 89 6b 13 76 aa 4b 45 95 +80 13 d6 19 be 7e af f6 c1 a6 75 e2 92 ef c3 f4 +39 3d db de ab 47 e8 90 a7 8c ef 69 00 24 49 57 +87 48 90 6c 10 21 b8 91 b9 43 d8 18 d3 a6 1e 67 +a3 15 61 2d 4c b1 cf 19 7c e5 df ab ef da eb 59 +0b 8e 8c 73 68 5e 74 7e 59 a3 95 c8 45 c5 d0 c3 + +# PKCS#1 v1.5 Encryption Example 4.19 +# ---------------------------------- + +# Message: +96 53 d7 94 69 f0 5d 40 19 65 a9 5c e8 74 fa 22 +5e c4 79 74 e8 d0 68 41 c1 3b 47 85 e0 0d 54 7f +9d 31 44 c3 87 9e 6c cd af 78 7a ef c2 f8 45 2a +4a 3c 88 4e 38 ee + +# Seed: +85 5d 6d 15 12 e5 43 a4 5d 3a 9a a9 68 5d 5d fd +a7 04 79 ba 39 52 63 64 14 1b b6 36 27 45 89 85 +71 20 01 22 f4 bc 82 c6 22 43 45 c6 9d 3e f5 42 +f1 23 bd e3 01 5b 60 c4 c0 ff b9 8d 63 01 31 ae +e8 1f e4 a0 b0 15 38 + +# Encryption: +69 ca 62 e2 9a 5b db 4b 04 e2 40 16 21 2c 25 91 +40 a6 0c fa 81 eb 66 93 bf fa fc 9f 60 0d ce 10 +82 2a 00 7b 6a de 93 fa cd a1 b2 b1 65 b5 57 76 +0f 0a 67 5a c9 bc b2 06 b9 64 fb 90 cf 6a 2c f9 +9f 18 6b 36 d2 eb 99 1d 82 53 a0 75 4f 9c c2 d7 +2d e5 49 ab ae 90 94 f5 a8 6c e1 db 49 4d bb 6e +51 62 86 71 5b 3d d4 05 59 b3 10 7b 95 24 b7 29 +ac 65 4c fb 40 f9 ab 35 d0 34 e0 27 19 7c bc 36 + +# PKCS#1 v1.5 Encryption Example 4.20 +# ---------------------------------- + +# Message: +0b df 3f ce 8e 48 7d b2 2d 07 60 ab 71 15 86 ca +8e 45 9c 39 4f f8 b1 a1 86 70 67 a9 31 51 99 a8 +01 24 74 b0 f9 0d cc 87 cb + +# Seed: +c9 b7 8d ce 9d fd 7f 04 04 ff 98 2e 06 b5 96 50 +ba fe 31 ea 19 bc 1f 2e 1f 39 89 f4 ce fc e4 6f +c6 52 42 3d b3 c9 9d 92 a8 fb 58 f3 ee 39 3d 55 +5b 76 84 88 9a 4b f8 15 a1 3e 3b 9b f2 43 71 40 +66 b9 07 58 90 67 50 47 f1 7e 93 5b dc f0 e6 6f +cf e3 9b cf + +# Encryption: +43 ad 3e 62 5f b1 72 15 57 8b ef 2f 46 5f aa 72 +ae 69 43 83 36 9f f7 aa 15 12 01 a3 f2 59 c8 d8 +ce 8c 16 bd 25 52 21 49 f6 66 e8 d6 92 a0 79 5e +a7 15 69 d2 88 1f 97 07 08 5d 3f 59 bd fa 28 73 +66 d7 f5 a3 f7 6e a5 dc 10 9f cb 03 30 2d a0 b7 +86 99 71 3e 0d 30 09 58 4f 97 17 6c 1b 9b a6 3e +80 cf a8 fd 4c 01 3d 74 b5 fa de 84 72 d5 2c 11 +e2 e9 36 81 ba 19 d3 53 d3 1c e6 fa 3c 0a b6 0d + +# ============================================= + +# Example 5: A 1024-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +ab 29 d4 9c dc 92 5c 69 ca e7 52 92 fc 03 62 03 +73 c6 fb 36 d3 c2 49 dd 5b b5 0f 88 1a 4c 93 89 +af e7 3e 8c 56 b8 d6 67 a5 ea f2 b5 71 4a da f4 +ca a0 06 a4 9a c4 bd 4b 91 d5 45 cf 3c 10 00 9d +31 8a 9d e0 f3 bb d8 38 4e 8c 7e 96 ca 15 95 e3 +2a 70 41 d1 68 ca a7 34 43 b8 85 bf 7f 61 4a e1 +21 2e 3b 5a dd a2 9d fa d5 01 b8 b1 a8 1c 3f 48 +a4 56 e1 33 ad 52 da 2a bc e5 d6 e7 82 f2 75 c9 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +ab 29 d4 9c dc 92 5c 69 ca e7 52 92 fc 03 62 03 +73 c6 fb 36 d3 c2 49 dd 5b b5 0f 88 1a 4c 93 89 +af e7 3e 8c 56 b8 d6 67 a5 ea f2 b5 71 4a da f4 +ca a0 06 a4 9a c4 bd 4b 91 d5 45 cf 3c 10 00 9d +31 8a 9d e0 f3 bb d8 38 4e 8c 7e 96 ca 15 95 e3 +2a 70 41 d1 68 ca a7 34 43 b8 85 bf 7f 61 4a e1 +21 2e 3b 5a dd a2 9d fa d5 01 b8 b1 a8 1c 3f 48 +a4 56 e1 33 ad 52 da 2a bc e5 d6 e7 82 f2 75 c9 + +# Public exponent: +01 00 01 + +# Exponent: +07 7b b2 73 32 34 86 ec 4c 25 ed 67 06 34 1a a8 +a6 7a ec 58 43 0d 53 3f e5 86 c6 b9 4f 57 0a 3b +42 90 c4 5c 0b dd 94 68 1f 29 a4 b7 58 8e ea 80 +39 cc a1 c5 b8 0b 82 70 27 9d d0 a9 c5 09 39 11 +93 e3 d5 c2 5c 10 75 c4 a1 d3 dc 32 74 06 6d ab +81 7f b5 1b 16 bc 26 7e d9 a9 98 0f fb c0 92 85 +d9 7f 11 2f 15 26 95 e6 e0 9c ae 72 bb 55 06 6c +b9 db d0 98 a7 5c eb 47 b4 62 72 00 5c 6b d2 15 + +# Prime 1: +e9 4e a6 b6 19 be c3 e4 78 87 8e 87 8c f1 23 b7 +a9 f1 2c ab b1 95 e0 aa e0 22 f3 17 73 46 69 31 +38 b1 1a 86 fa 5c b7 55 5a 10 b8 e4 62 2c e9 52 +0c 57 2b ef 29 1d f7 0a 16 d8 85 f5 97 e5 90 4d + +# Prime 2: +bb cf cc 5a 60 95 34 ee 43 4a 6c bc a3 f7 e9 62 +e7 6d 45 5e 32 64 c1 9f 60 5f 6e 5f f6 13 7c 65 +c5 6d 7f b3 44 cd 52 bc 93 37 4f 3d 16 6c 9f 0c +6f 9c 50 6b ad 19 33 09 72 d2 1c ac 19 ce 99 6d + +# Prime exponent 1: +e8 a6 0d 88 39 54 09 73 a2 dd 4a 3b d1 48 05 1d +f8 d1 0e 82 87 ab b5 45 b0 0c 29 ec 90 7e fe 16 +9f 39 bc 02 2d 56 97 5a fd 5c ff 82 7e 83 da 86 +7e d7 ce 6f c6 c8 a2 b7 e4 e0 35 75 19 eb 49 61 + +# Prime exponent 2: +8f f2 e2 27 37 35 c5 5f 05 56 6a e7 5f 29 a9 c9 +33 a6 2d ef d7 e2 20 01 7f 05 45 fc e9 07 e0 65 +c4 9f 7b ac 34 84 c6 f0 60 49 99 43 32 07 c9 13 +e8 0b c0 1b f7 8d 83 ef af 00 da 17 12 a4 a6 35 + +# Coefficient: +5f 1f f9 6a 8a 90 19 78 4f 92 26 e2 5c 9b fe 25 +08 02 39 43 73 90 25 dd 6b ab 03 7f f4 7d c6 42 +49 85 15 c2 f9 e6 ff 60 60 c5 b7 d2 34 30 d8 d5 +0f 1c 0f 6d 50 c1 80 b4 ae a8 a4 a8 2f cd 2b 74 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 5.1 +# ---------------------------------- + +# Message: +5d c9 f8 b1 2d c8 12 a0 9a a4 b0 6d fc b5 7e 1d +2e 8d 1c 7d 2c 07 6b 25 d5 c1 8e db c0 46 bd 63 +c7 ca 4a 59 9f 18 de 26 f3 be 73 8c c2 8d 16 67 +2c 00 6e 4d 9c + +# Seed: +43 d6 05 a5 74 0a 97 0b 32 37 27 af 35 2a 1b d4 +8d e6 9d 95 05 e2 2c 2f ad 03 0c 3b 84 b6 de a2 +d2 2f 91 64 06 a7 69 3c f5 06 c2 d2 51 88 6f 02 +20 3e 3f 76 55 a3 0a 68 37 af 8a 8c be c7 b5 c9 +2f c0 4c 8c 18 df e9 d3 + +# Encryption: +21 5a 35 f4 c0 43 5b 07 ed 5d 2c 4b 68 65 bc 28 +1c ea 70 50 cf ea 7a 7e 86 e0 3f 8a cb 28 b5 8d +be e6 54 58 91 9c ea a5 a3 3e dd 98 20 1e a6 e7 +63 2d 76 22 d5 a5 1d 35 a3 5f ed e8 6e f2 03 ee +f6 eb 34 75 ec 8f 19 e6 9c 0e d5 2c 05 dd 7d 59 +e3 53 f5 2b 67 10 af 40 26 65 55 04 10 7d db 86 +f9 57 e6 c0 6b a6 7b 1f 4f c9 f1 21 e1 5f 82 73 +67 09 d2 de 8d 77 43 2d f0 8d cc d2 a0 cc 77 04 + +# PKCS#1 v1.5 Encryption Example 5.2 +# ---------------------------------- + +# Message: +d7 74 07 d8 f6 9f 80 dc 08 eb a5 f4 26 28 2d e7 + +# Seed: +b8 29 c7 89 be 38 1c d5 9d e2 14 89 db a1 41 e0 +bd 1f a8 a3 c3 82 6d 59 c6 d1 10 e7 df 72 42 ba +98 c4 7a 43 92 c7 f2 ac 1c 6e 9d ae 22 b9 eb 74 +a7 64 36 08 8b d0 ba 6e 19 91 e1 9e 3a f7 9c f3 +f7 de fb 6a 11 61 80 25 34 ba 0e 7e d1 65 34 93 +88 72 ec a6 77 05 8a c7 34 67 d4 9e d1 12 5b 50 +df e5 d6 d6 5a 5d 24 53 99 b6 bf 1b f1 + +# Encryption: +2d 48 06 cf af e4 af 36 bd 02 f6 2d 6a 43 b0 0b +41 6f 70 8e 96 85 b1 7a c8 e3 a4 d8 c2 91 80 93 +05 76 9d 78 98 f6 fc 85 91 7b a2 fd 8e 58 9f f7 +a8 bb 84 bb 7c 12 20 2e d2 79 e0 64 09 a5 c0 a7 +d3 24 bc 46 ae 4f 92 82 c9 02 3d 3d fb 3a 79 15 +de fc 16 4b 3f 08 26 6a cf 12 41 f8 26 24 98 15 +07 41 4e 56 29 78 35 1d c8 b7 a7 9e f5 31 40 21 +01 a8 d3 d3 ea a3 53 9b bf 62 aa d9 9a 3b b1 1e + +# PKCS#1 v1.5 Encryption Example 5.3 +# ---------------------------------- + +# Message: +23 8a + +# Seed: +a5 88 1a cf f3 52 9f 25 1b 1b 9c 61 9c e9 f9 df +91 e0 a0 3d d8 89 16 36 46 87 1a 62 72 07 ee f1 +47 68 0c 32 f4 50 a7 76 e1 9f 54 ec 05 5d c6 8b +04 bd 4d 89 37 6d f3 ea fa 6f ca f6 0e b8 31 84 +39 10 b6 25 b6 4f 25 d9 29 9a fc 30 6a 23 76 53 +80 45 51 94 b7 5d c0 13 5d 27 c3 b7 d7 2d f9 08 +77 5c 7e 90 be fc 0c 5a df 74 a1 69 ed 58 68 f3 +d6 34 32 7a 05 78 18 92 54 45 43 + +# Encryption: +77 10 ee a8 65 7d fd 15 65 16 65 62 df 0e 2e 84 +0e c3 e3 de dc 0b 80 2b b0 21 3e 47 a5 ce 97 f4 +b8 5b a9 ba 14 19 77 36 3d 8f 54 b0 6d 57 8d 5b +2a 96 e9 69 cf a9 15 df 21 9f 00 2a 85 d0 32 57 +04 7b 31 16 a1 c4 dd af 79 1d 93 98 2d 1b 9f fa +24 31 86 e9 e2 b1 9e f0 74 1c e9 8d e2 a4 a1 58 +6e 50 12 c4 81 de 23 a0 ef f8 82 fd 62 38 38 d2 +01 1f 4f 63 73 8a ff d7 ef b8 c5 0f 46 a6 c2 0e + +# PKCS#1 v1.5 Encryption Example 5.4 +# ---------------------------------- + +# Message: +25 a2 7e b1 b2 1f 10 cf 9d 57 1c 33 05 61 0b 97 +f0 da ee 39 90 5c 65 94 bf bf 45 2a 9a 00 d9 e8 +2b + +# Seed: +25 04 61 80 11 c6 73 db 3c 41 22 79 dc 8a d1 65 +ab 7b 64 73 ae 19 5e 8d 6d 41 21 49 18 19 8b 34 +51 a6 50 8d 61 38 ce dc 51 8d 80 12 ba 0e c7 9b +38 6a f8 fa 40 b0 34 78 bb f2 ba 06 5e 58 2d 61 +95 cc be 15 8f 11 78 1e ae b1 b1 72 0b 72 d9 b5 +21 27 de b9 55 17 11 e8 87 db d0 b8 + +# Encryption: +35 72 bd ea 23 05 e1 78 5c 75 4d e7 44 c4 fa 3f +a2 cb 75 71 60 e5 cb 39 a3 14 97 e1 48 5b bd 7c +08 99 c5 35 85 b2 bb bb d9 90 81 b4 16 ef c6 85 +78 db 78 e0 ec d0 8d a7 a3 95 3e 38 6b b2 5c 12 +bb b8 7c 78 94 42 83 a8 c8 01 87 b4 50 8d ab bc +76 97 f4 3a 8a e7 8a 33 fe bb 15 f3 cd 58 1c 80 +d4 9b 97 1b cb d4 8e 44 14 2f 58 c2 c9 1a db 1a +e1 45 aa 9a 83 b3 c5 81 5a a1 a8 ff 8d d2 31 fe + +# PKCS#1 v1.5 Encryption Example 5.5 +# ---------------------------------- + +# Message: +59 cf 0b 6b 50 ea + +# Seed: +2b f1 91 60 df 69 88 93 5b d2 46 10 6b 89 09 dd +7b b3 e5 16 90 df 84 d7 6e 4d 31 ac 82 10 44 56 +34 6b 4c 3c 9b a7 b5 e9 e6 8e e2 08 6c 84 73 c6 +83 02 e2 59 9a bf 6b 31 ce b3 f7 81 ad 6b 56 89 +86 f2 1c d6 d7 55 32 8f b8 3a fd 55 48 50 1d 07 +0a c2 dd 8f 5c df b6 2c ef 54 5e 81 5f e3 82 bc +0c 67 b6 76 e5 45 6e bb 9a b6 7d f4 77 40 c6 a4 +3d e3 f9 a2 47 7a 9b + +# Encryption: +2e d5 91 fd 4b 35 7e 94 f4 81 ba 84 ff 4e be 7a +e4 31 05 4e 5c d9 8a 99 58 96 48 e6 16 cd 68 e0 +d4 72 4f a8 a6 c5 99 68 6b fe e1 74 7a d0 77 db +ed ad 45 f1 24 4d 7f 8e 00 da 3a 3a 06 d2 31 32 +d3 17 1d 74 4e f1 4e 1e 97 cd da 10 9b d2 e5 56 +a5 fc 7b bc 60 9a 7f f2 4c fa be f4 b5 6c bb b7 +0e 05 06 53 b6 98 48 d7 11 30 75 a5 de be 7a 46 +82 15 f8 dc 08 e7 ef 84 fd 55 77 8c d5 b5 96 e5 + +# PKCS#1 v1.5 Encryption Example 5.6 +# ---------------------------------- + +# Message: +e9 44 52 f5 0a 5e db e6 75 73 ab 22 30 9f a2 1b +ab c6 d2 25 20 e6 e8 3b f7 2e 7a fa 6d 71 e2 02 +96 da ea f5 4a 60 c8 03 63 04 87 9a 21 31 d1 78 +78 0e 34 8e e0 12 0b 99 7c + +# Seed: +c5 30 44 3a 16 ef d8 d6 d7 2a b4 44 3f 8d b2 44 +91 de 99 d5 aa be 51 88 b3 f6 1d c0 48 3b 7e e0 +0b 1c 13 25 9b 8a e2 40 9f 1a e6 2d 99 30 c1 1a +4d de f3 e8 35 82 93 88 93 f9 ac 66 8f 79 c6 4c +7f 5d 79 6d + +# Encryption: +0e ee 90 c7 08 18 22 1a e2 70 4b be 38 d6 8f 8e +15 4c 6e e7 ad e5 3e 2a 1f 4d 1d ba ac 98 c5 75 +91 eb b6 c6 38 bc b6 8e 18 14 35 b7 00 01 ba d1 +80 19 2b fd a0 57 32 c0 5e 7f b5 af 22 aa 89 d2 +a8 ff 80 cf 9f 08 62 f0 4c 05 ca ca 3d 2a 3a 5b +07 79 94 6c 6d df a0 4c d7 9f a1 64 d6 02 f1 b7 +de 5c 95 be 85 e9 60 84 67 e2 5c 29 d0 35 c4 66 +09 06 26 9f 6d c0 0a 47 2b 04 46 ea 56 e7 2a 59 + +# PKCS#1 v1.5 Encryption Example 5.7 +# ---------------------------------- + +# Message: +1c bf a0 e7 b1 a1 0c 13 d7 50 77 b1 cb d8 03 10 +cd 24 10 34 0d 5f 53 72 93 46 4a 67 81 a9 cc 30 +2c b5 38 0e d9 26 7b 3e b2 3c db 13 + +# Seed: +d3 6b 7e 17 99 05 9d 1e d1 34 7b 0b f8 24 7c 6b +e5 18 7d 8f 15 21 9e 3c b6 6e c6 2e 1a c4 1f f7 +ed 35 7e d7 ca 03 84 e3 1d 39 94 85 61 fc 16 cb +d9 6b 7e 70 42 79 e5 72 bf 56 4e 06 c3 a3 40 1a +27 14 dd 51 d7 21 5b eb a1 c6 61 54 f6 0d d0 cd +4d + +# Encryption: +9c 03 dc 01 33 a6 e6 aa ba 92 05 9b df 5a 6c c1 +b1 44 b9 0d 2a 94 a4 8e 7b 3c b9 0b 0b b6 f6 24 +c7 b1 d1 72 33 1e 43 23 d0 8d 2e 8e 09 95 32 dc +b3 b2 a8 7c a4 20 74 9f c6 34 5c 0d 86 e9 ab ca +71 af 09 a0 92 9e de ee de 83 e7 22 44 20 3b 2b +f4 5c eb 18 7e 9d b3 c7 d3 ad 05 b2 3b 59 62 4c +24 66 96 cf c7 58 06 39 14 02 e4 44 e3 97 49 69 +88 e1 e1 f4 2c 6a de d3 0c dc 93 79 37 f3 00 54 + +# PKCS#1 v1.5 Encryption Example 5.8 +# ---------------------------------- + +# Message: +e1 72 a6 b8 b4 96 f0 77 73 8b 74 f6 d8 b2 92 dd +a6 07 f2 ad bf b3 72 be 37 ee 00 08 88 be a3 1f +99 cb a1 cf 39 32 e4 be 37 17 c9 e1 68 90 1a 32 +d1 b8 20 be 4f b0 13 75 27 a2 48 18 77 fe 01 ee + +# Seed: +84 0c e1 3b bc 96 17 dc 9f 3f 26 b1 47 30 1a 6f +46 30 0d 77 81 a5 d9 81 16 2f 86 92 87 37 1f 1d +59 58 76 4f b0 0b 05 53 70 ec 71 1b ba 52 83 fc +b0 0b 83 bc 02 17 5e a1 01 7b cc 83 53 + +# Encryption: +99 3e 39 6f b5 7b 2e a6 a1 a3 fc ed 9a 69 d3 61 +cb b6 26 5b 26 50 3c 17 5f 84 c6 1a 41 ea 3e 1c +e4 fb b6 2e 01 d6 42 0e 22 fe f1 d9 e2 8a 58 83 +e2 ea c8 2e 05 f3 58 ea 75 f7 7d a4 89 7b 6b 64 +9a a4 74 28 39 41 93 dd ec 64 8c 3a 7f b8 1c fc +f4 b5 1c e3 eb ba 78 ae dc a7 bb 91 7b 35 b3 e2 +2a eb 20 1c ea 96 59 2e 50 e0 d2 84 1e 7d 2c e0 +d6 9f f3 03 9d c0 1e 96 4a 97 7a 01 76 83 b3 87 + +# PKCS#1 v1.5 Encryption Example 5.9 +# ---------------------------------- + +# Message: +c8 f0 ea 23 e0 66 11 e4 fd 27 b6 1d b7 92 0c 55 +f3 c0 a2 22 12 88 38 e4 cd b0 62 e1 76 b2 1f c2 +32 53 55 8c 5d 40 de 2d fd 62 0f b7 cd f1 39 9c +2a f8 fc 77 ca 33 35 + +# Seed: +16 4d 77 b5 d2 6a e6 d7 ab e7 ca ed 62 5d 87 c2 +11 cc 50 9a d0 17 2c 20 83 3d 8f 98 ca e3 8a 2c +37 0e f2 1d 40 96 da 84 1d be ee 94 8e c6 34 03 +ca bd 4a 5f 71 ac e4 93 64 aa 7d e2 0f 32 c9 88 +33 7a 11 5f 83 46 + +# Encryption: +7a 8f 15 ee f5 10 ad e8 d5 c3 17 f9 06 4a d7 da +e6 c9 3e 7c f1 56 a7 37 22 02 32 58 f8 b5 74 47 +34 70 00 34 a3 de 6f 13 7a f6 e9 00 46 d8 6e 9b +90 59 0f a5 a6 50 ce f4 fd b4 d3 36 02 33 af 86 +f4 a7 a2 3c 24 3d 19 51 c6 66 b6 73 c3 3c 7d ec +4f 51 ac e3 4b 80 5c 0a 9e 67 e2 09 cc 7f 9e d6 +9b 8f 5e b5 c5 53 e0 f1 5c 10 30 4b f5 6d 7b e1 +71 f3 1c ce 88 f3 7d 1f b4 a2 a0 04 18 89 75 76 + +# PKCS#1 v1.5 Encryption Example 5.10 +# ---------------------------------- + +# Message: +19 db 24 22 05 c0 3d 7f a9 93 5d 9e 04 fa 6e cf +38 a5 1e a9 98 ac 8e 4b ac a6 cd fd 6a 0a ce 1d +f3 67 e7 3d 23 c2 40 af 76 b6 2e 9f e9 21 5f e9 +43 + +# Seed: +be 49 52 05 55 69 56 fa e2 a2 2e a7 0c e1 02 de +06 6c 9e 58 95 96 06 21 74 84 a5 b1 50 36 ff a1 +d4 61 23 9d d4 7b 4f 38 1c ea 71 51 6e 2d b0 fc +36 9d 72 b4 40 69 65 12 a9 72 88 f0 6f c0 bc eb +96 82 86 e9 95 e0 2d 21 8d 9c 26 62 + +# Encryption: +55 12 b3 99 9b 30 c9 c1 44 0e 59 75 93 1d 55 f2 +1e 9e b4 22 b6 2d af cd ab 5d 50 03 a7 5e b1 24 +81 99 86 36 19 13 36 1d fc 46 ac 29 aa ba 8e 1a +a0 2e 1b a4 44 67 16 2d 20 f6 3a d1 70 fe 0d 87 +a5 3d 93 c6 4e 02 6b 12 be 6b c2 b8 eb 0e 57 c0 +39 eb 60 f3 2c 4b 52 70 35 f7 03 a7 a8 37 4b d7 +fa a7 b5 40 4a 3c 5a ad b7 92 e2 5f f9 28 76 b2 +3d d3 a7 42 2c 45 26 6c 6d 98 6e ec 53 34 b9 ba + +# PKCS#1 v1.5 Encryption Example 5.11 +# ---------------------------------- + +# Message: +49 a7 61 f8 c1 8e f9 23 62 d6 ab b2 4c 07 fc 72 +82 55 84 24 53 69 4e 17 60 58 99 f4 37 b3 1a c9 +8d b5 16 + +# Seed: +d8 cd 85 ed fa 0a 84 d0 76 a9 f8 b2 f9 3d aa eb +a9 ae 37 43 81 ea 4f 8c ea bc 14 f6 2a 4e d7 63 +8c 1e 39 67 57 de 3a e2 b7 ef a3 a1 7c 9a 55 86 +da 84 a5 e5 0e cd ed 61 08 7f a6 f0 ce 93 82 87 +99 8a c1 b9 bc 33 21 a7 ed 16 0d 28 67 04 e0 52 +6e ce 7b 30 b4 68 14 64 9f ec + +# Encryption: +9b 47 82 68 40 62 12 ca 05 30 f4 31 bd b2 63 72 +61 50 84 ca 48 8d a4 34 51 d2 5a 22 b3 5a c6 fc +61 e3 70 74 a5 c2 2b c1 c7 01 db 19 32 b8 c5 57 +b8 48 7c ea 56 60 50 e4 8a d6 e0 37 6f 8d b4 19 +8c 4d 27 db 2e 6b 28 c2 5a ed 83 7e f4 77 42 d5 +eb 8e b1 d8 b4 32 c9 d5 73 cd 4b 86 fd f3 2c 52 +a3 d0 f6 cf 92 cf 3c d9 51 96 77 a5 8b 1d 1d 99 +4f c1 c9 05 7a c1 06 e8 16 04 59 26 b4 5b 00 e5 + +# PKCS#1 v1.5 Encryption Example 5.12 +# ---------------------------------- + +# Message: +84 e8 28 f7 15 f2 28 a6 02 65 + +# Seed: +f7 f2 75 a8 53 d4 e1 26 d7 d0 c3 8e f7 03 f3 fb +da 7a 95 20 78 8d 7a 81 a3 1b 05 30 d4 3f e6 c9 +4b 1b 1b b1 08 51 20 9d b2 6a c4 b8 88 ae ce ea +77 13 82 4c 29 38 b4 c6 43 1b 2b 03 c6 93 ab 7b +54 63 15 41 54 6a c4 03 94 79 85 48 fb ba 95 88 +2d 91 a1 7c 27 e7 dd 53 02 6c 96 79 1e e5 5f 24 +7d 7f 89 8f ea b3 70 9a 13 2a 78 26 66 a1 4d 0d +f1 a8 4e + +# Encryption: +4e 3f e9 6e 8f 96 e5 b3 c6 11 ca db 96 ed 51 04 +20 98 ec c5 47 be 7b 88 f8 de a7 65 ae 14 e8 35 +0c fe 39 dc b1 c1 d6 e4 17 9c a4 04 d5 38 4d 87 +b0 66 50 75 ee d7 da 7a af 71 00 8e 24 67 d7 0b +ff f6 23 b4 59 4b 6d ff f9 0e 3d 84 85 f9 41 89 +48 6c a0 ca 9e 72 2b 2a 77 7e 25 b5 82 f7 ad 4e +c5 10 3a d7 67 85 9a c5 9a 1b 8c 5c 19 71 30 17 +48 fc c2 64 f6 c9 29 36 4a 8d 9a f4 22 55 c0 f6 + +# PKCS#1 v1.5 Encryption Example 5.13 +# ---------------------------------- + +# Message: +c4 79 7e 8a 6f 26 9b f2 5d 4c b4 ec 3f a4 6f 8f +11 e6 b3 69 fb da ec 1e 51 97 83 58 d4 6f 3c f3 +b8 42 91 7d 96 7a a9 d3 0b 18 34 53 93 7a 68 26 +56 b2 7b + +# Seed: +17 77 42 19 7f 04 11 44 3b d8 7e 28 ea 88 d5 4b +4f 2c 7a b1 dc ae d8 1a 56 f8 d7 87 91 12 44 54 +02 85 04 d3 22 e1 de 34 60 47 a4 93 93 3e 87 62 +8c e0 8b 06 c0 17 08 2d cc d3 8b 48 94 65 14 ea +37 7c 2d fc 75 2a dc 24 fb 57 + +# Encryption: +79 84 c3 ba d8 6a 54 79 90 e0 47 5a 48 4f 8d ba +5d 4d ce b0 d3 e3 fc e0 71 d6 f8 71 76 b7 cb e6 +f8 11 2d 81 d7 cd aa d7 7e d0 d5 78 8e 65 f8 bf +5f 0c 2a d0 df 07 cc df 54 b2 da ce fc 19 ba 65 +20 1c cf d3 61 d1 86 b7 d9 e2 69 aa 1e 6a d2 c7 +2b d2 3f 58 08 4f db c3 bc 60 e1 7a 33 e3 c5 5a +95 eb 0c 38 a0 81 bc 0d 39 81 db 26 a7 21 2d 6f +69 1b 33 6d ac 46 b6 4a e2 25 38 a7 b0 08 7f 25 + +# PKCS#1 v1.5 Encryption Example 5.14 +# ---------------------------------- + +# Message: +a5 e9 de b1 c2 0f 98 2d 5b 7d 4b 87 d7 99 46 1f +05 3d 91 9e + +# Seed: +59 75 9c f5 f8 38 d9 52 49 3d 0f 42 81 e3 ea 0f +e2 16 97 1c 0a 2e 24 54 b9 6c 8a 11 b4 c6 91 27 +15 90 24 db 6e c5 c3 36 40 d1 20 29 58 99 f6 66 +6c 94 17 b2 02 a8 6c 26 ef d7 c6 13 4c 92 fd 86 +b8 32 3d 17 4a 62 53 48 81 38 2d 7c 6c 9e 1b 8c +1e 95 da f2 10 c3 e9 ba 43 e5 88 79 f3 4f 2f a7 +1e f6 ae 4b 68 d6 41 47 be + +# Encryption: +70 ac 10 2d 07 1e 3d 90 22 81 83 62 16 e0 81 29 +0b b5 df cd 56 68 d1 1d ae fa 0a b0 64 59 9d 0f +91 4b 47 29 61 37 5b bf 5f 2a 66 6f ae 0f 6a 25 +ba fd 44 f6 65 c1 7c 14 4d c4 d4 cc 0a 5d 5b a5 +5c 47 a4 cd e9 59 b3 2b aa 52 32 a0 7f bf 93 78 +c9 c5 3c a2 b3 77 81 c9 3a 1c c8 d6 52 94 78 a1 +c6 73 03 4d da 7f f3 35 60 78 6a 46 4f 5b 4a 55 +9c 62 6a e2 95 bc 91 d0 ee d9 37 5f 49 e3 e4 aa + +# PKCS#1 v1.5 Encryption Example 5.15 +# ---------------------------------- + +# Message: +73 9f a7 6d bd 12 73 03 b7 ab f9 3e 1d 7b a7 29 +75 5d 6c 81 1b 5e 93 35 5e 0c 01 1f 74 46 4c 7d +b4 79 19 3c 3f b7 38 0a 62 a0 c0 06 a2 d1 dc 49 +a7 66 af 63 fb a4 52 7c d1 57 50 6d 62 c2 1a + +# Seed: +a0 b4 da ff 3e 26 ce bb 3e 4e 3a 43 db 36 c4 66 +fb 8c e6 05 b2 5a f4 c9 da 74 4b 62 d4 1f 9e 62 +c2 28 5c 39 0d 60 d1 8e 3d 7e 67 5b 4a c3 19 67 +24 45 19 46 bc 1c cf 2a 9b 56 2c 45 33 c9 + +# Encryption: +2b 79 80 91 b3 a3 91 53 3d 62 dc 0e 41 7b a6 de +da 00 5b fc 30 ab 7d c8 2e 8f 9b cc 74 17 bc b0 +04 34 8c 6d 00 e5 37 d2 72 2b 84 38 61 48 92 45 +ab 0d 51 f2 11 44 7d ac 33 a3 f9 dd 6f 3c a6 6b +bf a0 d1 ad f9 8b c9 09 95 15 92 69 76 b9 25 8a +ab 63 20 4a d8 91 65 c8 7b be fd 8d 98 85 34 b3 +74 07 df 7d 43 ad 39 1e ed 99 82 47 28 ef c3 a5 +33 b7 89 b4 7e 8a a7 12 16 17 47 4f 33 25 c5 1a + +# PKCS#1 v1.5 Encryption Example 5.16 +# ---------------------------------- + +# Message: +5a 44 b5 47 bd a1 9e cc a1 dc 7b c0 45 50 20 5f +66 c5 de 0a cb + +# Seed: +2f 54 85 d2 5f e5 ce 40 ae 62 a1 12 97 6c b4 a5 +39 b7 4d 96 ef 8b e8 73 32 5e 20 4b b3 f8 66 07 +a1 6a 2c 2a b5 0f 69 78 09 ed 03 01 72 70 ef 20 +a1 02 c4 3a 2c 4c 3b e6 ab 7a 8a e2 dc b5 69 84 +d5 e0 65 52 45 93 eb 70 70 83 4c e5 53 f1 75 69 +20 bb cb be 4f b2 6d 35 d4 ad cb 59 df 52 46 35 +6f f1 2e 7a a9 ee 6d ef + +# Encryption: +62 d1 48 9a 40 3a 90 fa ac 67 7a bc 17 4a a7 24 +3b c7 51 a9 64 69 5f 6c 32 b3 9d e0 18 fe 46 43 +44 20 ea 76 59 be 2c 41 0b c5 6c 4e 3e 7a 1b 16 +77 fd f4 ad fb 23 24 f0 41 ed d5 79 0c 4c df ab +36 55 e0 7e 41 fe 9d 73 29 21 51 b0 dd 5b 96 fc +84 a6 b2 0f 6f 3b c0 f6 0e ae a8 d8 29 17 b2 10 +83 05 59 40 fc 02 ee 3e 17 c3 78 bd 4d 85 06 d0 +8e c4 5f 33 de 57 80 f0 1b d3 18 a9 a1 67 87 ad + +# PKCS#1 v1.5 Encryption Example 5.17 +# ---------------------------------- + +# Message: +16 80 2d 80 3c + +# Seed: +02 f0 e7 62 c3 39 17 bf 6a 4d f1 1f a2 84 73 54 +7a 5a b0 76 7d d3 a6 1a 8d 05 cc 1e 6f 98 34 5a +f1 a0 0e 42 f6 2b d8 ec ca cb d3 7f 4c cb 80 9e +9e 05 5f 73 d3 37 5a 60 41 d9 78 2c cd 85 d5 9d +14 f4 3e 5c 94 10 25 7b 90 6e 41 cc 8b 97 35 47 +d0 62 2b d2 1d b2 9a 91 38 d3 b1 be de 38 ce 5c +94 c4 e1 d2 a0 a8 40 0b 45 ba cd 42 69 79 7c 38 +5a a3 06 6e 65 80 72 99 + +# Encryption: +75 3b 9c ee 70 d4 18 1f 95 63 87 80 db 7a 04 f9 +b1 2e a3 8e 5d ae e4 f2 89 4c 02 67 3a 53 f4 85 +30 74 6f f2 85 8b 78 7e fc b4 2d 45 e5 31 be a1 +c8 da e9 48 77 15 3b 95 6a c7 b2 87 46 ee 21 c6 +31 bf 9a 3b a7 9d 2b a8 13 21 b7 96 03 b1 d0 1a +4e 90 9e d5 a2 7c bf 27 c9 57 78 3d 3f 79 50 e0 +1d d8 f4 47 f1 0e ce d3 6f 2d 19 35 86 f5 cc 17 +fb 62 2a 05 fa a1 fb 5c d2 aa 06 4c 08 67 b1 ca + +# PKCS#1 v1.5 Encryption Example 5.18 +# ---------------------------------- + +# Message: +d6 d0 f6 03 85 97 9c a5 06 fc 83 34 21 bc d2 2d +a6 a0 6a 8f 37 0a 7f 02 fe f4 7c 1c b2 19 9f 26 +45 c7 54 90 fb f7 89 ad 52 47 04 da 8a 27 66 c6 + +# Seed: +a0 3c 05 67 2e fe 23 b4 4b 26 c7 93 e7 05 3a 77 +04 8b a2 db b4 b5 3a e9 75 18 54 e7 ad d7 d6 7c +12 cb d1 6c 0b 19 34 d2 c2 3e 77 cd cc 89 ce 1d +45 c7 61 15 8a a8 61 31 71 a7 39 01 ac 1f 61 c6 +57 05 53 3d 3e 63 9b 57 a2 48 92 91 79 + +# Encryption: +00 78 dc 48 a6 61 58 99 2a aa 68 fc 3c cc 62 8f +92 a7 08 d0 b1 d4 38 37 20 8d 53 4b c3 f9 be 1c +14 12 ed 0f 9f 7b ef 49 43 0d c9 e9 98 f7 52 e0 +74 77 68 b4 ae 38 14 46 96 c0 03 d6 d2 5e a1 a6 +ca 6a ec 92 4a 9f 4d 9b 57 5a 8f 13 6b ba 29 bf +31 c1 3b 70 50 bd 55 d1 00 0d 43 3d aa 6c f1 0b +49 11 6c 80 63 10 7f d3 a5 bd f6 15 45 c5 d8 63 +f6 a7 88 81 78 6c c8 dc 37 6d 36 c9 11 36 82 25 + +# PKCS#1 v1.5 Encryption Example 5.19 +# ---------------------------------- + +# Message: +b0 38 1c ac 04 f3 10 15 04 96 8f 26 d6 55 47 45 +38 3b d1 71 d3 61 56 dd 36 80 b3 db 6f ad 7f 77 +1f 7d + +# Seed: +cc 54 8a 67 77 cd e9 53 c1 5a 71 fc 49 7c 0c 36 +17 b1 bb 05 6b 03 28 8d 9a 54 8b 69 3b b4 30 8b +67 c1 da c3 8b b9 b8 c9 cc 89 6a c2 44 a9 e3 0d +13 24 30 f4 ce ae 57 90 34 3d bc e3 8d 05 6f 27 +b8 6b dd 9d 32 a8 17 1f 3b 3c c2 fd 14 22 65 ac +9a 68 dc 35 36 27 33 9c d8 83 03 + +# Encryption: +45 6f 7c 3e 3b e8 5f f7 bd d6 b5 b2 50 bf b8 1c +d6 fb b1 86 d2 5e 0c 1c 52 59 d6 78 87 93 c5 41 +ed ac b4 ec de db 8a 89 29 01 34 a6 06 f4 6a 81 +99 1c 13 b1 20 e3 30 56 bc 0f c7 e9 7b 34 2d 0f +20 05 18 13 dd e4 5e 0b 59 6a 7d cd 69 04 90 3b +8f c0 76 a6 e2 4b 3a d8 01 34 16 d9 fd 18 48 30 +55 4a d5 4d 55 48 bc ad da f5 92 0a 02 49 55 88 +78 25 dd 37 1a e4 ef 90 06 9a 4f 31 1c 5a 17 29 + +# PKCS#1 v1.5 Encryption Example 5.20 +# ---------------------------------- + +# Message: +e5 + +# Seed: +fe 0b c7 ac b5 6c e1 4b 4e 2f 55 fb a0 e2 b1 71 +54 90 7b e9 4c e4 85 c6 98 4d 61 f6 7c 04 a7 40 +a2 8d 60 94 ae ae 33 b3 ea 0d 58 18 3e 1e c7 f6 +01 b2 ab 82 0f b8 a7 ff ac 0b 4f 96 0e 1b 4a cb +e5 7c dc 35 b2 25 c4 97 fc ac a0 30 19 a2 95 b3 +e6 6d a9 6f 53 79 cc d1 da 44 47 9a 4f 21 35 e1 +06 3d 71 a2 82 c1 e6 6f db d5 d9 53 f5 71 8c 25 +39 d0 0c e4 9b 45 18 20 45 4d 2d 49 + +# Encryption: +5c 53 36 77 a1 dc b3 63 95 da 9a 6d 34 77 bf bf +71 51 2c 6a 93 3d 04 1c a3 13 44 e1 cb e1 e5 55 +88 a1 14 6e 3d ec 46 10 ef ac 41 b5 f8 02 66 02 +66 52 b3 d7 aa 59 42 74 d9 d9 20 d3 3a a0 ad 9b +4e c5 9a a8 80 71 2a 1d 1c 36 8a 45 7f 35 c7 43 +88 b0 42 f2 49 8e 9f 4b d4 5a 26 f3 21 dd 9e b3 +33 ef 80 af e3 af 9f 72 9c a1 8f 42 c8 8a 71 73 +85 8c 54 20 66 f8 a2 52 cc f0 fe af e6 b5 a9 24 + +# ============================================= + +# Example 6: A 1024-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +dd ca d6 a3 8b 37 04 cb e0 6b b1 b5 1d 11 62 58 +49 78 a4 29 1f b6 73 b4 ea 30 ed 8b 51 a4 bf 26 +1d c9 f0 f4 69 ce 99 88 a0 89 f0 84 36 64 64 a1 +80 cf d7 17 10 69 a6 f6 36 d7 5f 23 40 1b 30 cf +43 ad cf 87 0e cd 24 58 2f 4d a2 95 22 91 51 dd +cf c7 c9 91 86 b2 45 88 5c b6 31 96 c4 a5 72 6f +20 7e e3 60 af 3a d8 c4 83 85 a4 e0 84 1d 7d 85 +1d 54 54 5d e7 67 d8 f9 99 dc 17 eb 0c 57 11 89 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +dd ca d6 a3 8b 37 04 cb e0 6b b1 b5 1d 11 62 58 +49 78 a4 29 1f b6 73 b4 ea 30 ed 8b 51 a4 bf 26 +1d c9 f0 f4 69 ce 99 88 a0 89 f0 84 36 64 64 a1 +80 cf d7 17 10 69 a6 f6 36 d7 5f 23 40 1b 30 cf +43 ad cf 87 0e cd 24 58 2f 4d a2 95 22 91 51 dd +cf c7 c9 91 86 b2 45 88 5c b6 31 96 c4 a5 72 6f +20 7e e3 60 af 3a d8 c4 83 85 a4 e0 84 1d 7d 85 +1d 54 54 5d e7 67 d8 f9 99 dc 17 eb 0c 57 11 89 + +# Public exponent: +01 00 01 + +# Exponent: +5e 48 e0 3d dd ec a1 a9 59 d9 ee 4d a3 f1 c3 f0 +ec 2a d0 fe 7a 70 c1 77 63 27 31 94 4c 3c d0 d5 +8f 4c 4d 96 59 74 6e 68 5a 76 c9 3c 2b 33 3a 64 +3d b2 1d 29 bc dc 6d 11 b5 f6 90 87 17 b5 77 65 +99 ff 30 88 b2 01 4f fc 51 f1 8d 93 22 24 f1 05 +9b 22 39 ea 56 44 e8 06 9a 5c c4 31 ae f6 07 38 +0a a9 24 c1 58 ab cb dd 97 51 f5 4e 67 79 c4 ec +23 21 68 b0 01 4f 4c 8b 49 7b e9 49 ae e6 57 51 + +# Prime 1: +f9 47 1f 2d 22 13 a9 2c f0 a7 c3 84 04 d4 0e 32 +2f 14 f4 39 61 f0 1e 92 33 63 cf 66 53 e8 98 4f +b6 e6 8d 66 e6 f1 59 80 3a 44 bc dd 09 e0 56 19 +6d a4 00 7a e2 a3 7f 40 57 bf 7e 3b 5e 4a 80 23 + +# Prime 2: +e3 c5 f8 cb fd 51 c6 c2 66 b1 a3 2f b2 f6 fa 48 +9b 97 54 b2 27 c7 7f 53 59 c5 5d fa 03 80 fe 9a +02 b4 d3 95 05 f3 ab 36 95 7c eb fa d5 34 d7 f9 +a2 67 eb ee 19 af e5 c6 24 04 3e 30 19 d0 ac 63 + +# Prime exponent 1: +2c f4 79 97 df 1c 62 97 1b 33 76 1c 19 ee d0 3c +96 a7 15 c0 3f 7c 59 57 0e 73 82 94 b6 af 2c c0 +bb 80 6a a1 d3 26 55 78 bd 89 65 f2 0a f4 ed 32 +1a c6 c7 db 61 82 10 d1 de c1 47 17 97 d2 a1 b7 + +# Prime exponent 2: +a6 c0 29 bb d5 91 c7 cc 4c 78 61 fa aa af 8b 5e +1a a2 78 7c 11 09 49 5a d1 0e e0 15 07 f9 a8 eb +41 6d f6 b4 53 ee 26 fb 48 07 73 8f 68 05 4e d4 +50 24 7a a2 0e a6 2a b6 9b 69 8b c9 95 2c a2 f7 + +# Coefficient: +aa d0 60 de 5e db 35 81 8b d6 3e 85 d4 2e ee 55 +e4 cf 8f a4 2d 4e a5 92 83 ce f9 6a ca ad 55 5d +47 8d 2f d7 c3 8f a9 31 fa 1a eb 6d e5 66 55 3d +08 f1 cb c0 6a 51 0f c2 e5 69 b5 a8 22 67 ac 91 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 6.1 +# ---------------------------------- + +# Message: +a3 e1 52 75 fb 33 ae c3 7b d3 dd 58 2e 19 f5 d3 +8b 9d 0d + +# Seed: +78 da a6 1c 07 f9 41 b4 b4 40 e7 38 33 8d 06 cc +15 7a 01 57 4a 72 fa 78 d3 63 dc e9 94 09 04 22 +0a 71 32 35 69 96 f0 7c 01 d5 4e e5 4f a3 2c 5f +aa 1b 90 d2 43 0c 80 a2 32 17 e0 6b b1 c8 04 3d +61 ff a1 8a a1 d1 8e 15 e4 30 aa 12 1c df f4 3f +ab 2b b0 de bf 73 e3 d5 a7 5b 46 f9 0d f7 3d 65 +6b b0 66 ac 1c 76 8f a3 83 e4 + +# Encryption: +9b f1 dc fc 65 4c a7 a2 3d 80 a1 2c 09 c2 59 d0 +4b ae 07 e8 31 f6 09 e9 f0 35 d3 56 41 4e d1 06 +f9 b4 62 35 fa 3d a9 1a 32 b8 fd c8 fb 88 30 c9 +65 23 dc aa 9b 25 38 fc 01 02 dc 0f 7a 5f ae 86 +35 b3 b1 23 14 c3 90 55 fa ac fb e0 0a 15 16 34 +24 14 8c c9 e0 f0 ab 42 df 09 02 3c 05 2a 46 ae +3f 86 a1 8d cc 53 80 ce 39 06 2e 36 23 75 d3 a5 +f9 e3 b3 4a 5d a2 5c f0 de 9c c1 9c 4d 04 f6 3f + +# PKCS#1 v1.5 Encryption Example 6.2 +# ---------------------------------- + +# Message: +44 3a b0 3c 46 04 db d8 bf 80 06 ae cc 2a a8 de +64 a1 55 b4 f9 0c db 08 59 98 6d 5c a3 60 66 03 +59 80 8c 59 bd 9c 2d e7 75 fc 18 52 02 24 b6 69 +c3 25 + +# Seed: +3a 6a 60 89 f7 27 dd 16 92 97 a5 79 fc af 8e a7 +f8 e1 2d 54 27 f1 f7 90 1a 90 22 a2 1e 2d 82 d2 +f0 8e 63 ba ca 26 7b 65 3a af 89 de 23 2b a3 d3 +92 d1 cb 49 dd 76 b3 88 b2 da df b0 09 4f da 97 +18 f1 78 37 38 d1 8f a7 aa a6 29 + +# Encryption: +5a 0a e0 de 28 fd 33 cc 98 01 bf 4d d3 06 71 23 +74 53 63 ca ce 4d d8 b7 b8 b8 11 d6 48 2f 59 12 +0c 0d 65 3e ee 86 a6 1a 01 2a 18 0e c5 d1 7e 99 +14 6d 0c ca 0a 58 7c 85 cf 01 dc 7a dd 84 23 0d +91 80 bd df 5a 77 19 f6 9d 1f c4 81 af 6f 47 db +8c bd 4e e1 87 1a 57 3f c8 76 7c e8 be ed b5 c7 +3f a9 3f 0c 53 80 4a fe 2e 76 cc eb b8 7c ba 00 +cd ac 94 de 40 e2 b0 be aa 8e 2e 41 58 c7 78 50 + +# PKCS#1 v1.5 Encryption Example 6.3 +# ---------------------------------- + +# Message: +d1 ba 30 e8 8c dd a3 3d 2b 41 89 6f 43 df 08 1e +ef 20 ca f7 8d 7c 1b 97 0c 6a 61 72 e8 38 39 dc +43 d4 be 29 f9 a7 72 ba 41 59 73 8b c6 13 29 68 +61 8d c7 19 7c 0e dc 57 a1 + +# Seed: +9b b6 2b f9 a7 51 fe 41 81 66 43 68 98 ed e8 35 +cf ae e2 f5 0e fc ad 60 94 2f 2f b2 da 1a 20 38 +03 f0 be 80 be b1 7f fa d0 da b2 18 b1 28 02 7f +34 97 a4 f8 d4 1a b9 a1 be 26 4e 96 b4 45 48 76 +7b e8 d4 a7 + +# Encryption: +81 19 1c 54 75 27 3d e6 6a 41 bf 56 04 f3 2b 58 +b7 59 a1 4e 74 26 c7 46 de 4b 53 ba f7 80 bb a4 +2b 42 e9 27 8a a9 45 27 f0 ee bf 85 5f 46 2d 6f +bb 29 78 a4 65 30 37 d8 b4 48 e1 b8 07 a1 83 1d +bc 53 22 d0 66 98 4e ec 28 11 4f b7 20 1c 79 6b +57 3a dc c5 cc 92 7f 3a 58 97 b2 00 55 64 ef 1a +2c 01 67 f5 43 65 51 18 34 ac 6f 49 58 b8 31 8d +09 e6 78 54 d6 31 ca 52 80 76 86 ab 70 5d 71 a3 + +# PKCS#1 v1.5 Encryption Example 6.4 +# ---------------------------------- + +# Message: +a5 4b c2 27 8b 56 76 85 c9 b5 68 54 e4 c1 c4 06 +d9 16 17 47 c6 81 34 80 16 3e e3 af 23 b2 1e d1 +99 83 e0 f4 2b fc 93 25 cb 5c 82 e1 a4 7b 8f + +# Seed: +cc ba 5f a5 c9 4e 79 83 2a b0 46 c9 77 74 95 b1 +63 bd 3a f2 17 59 0f ec 5a c4 8c 62 78 6a 27 f3 +70 d2 85 99 55 e4 5a fb 2b 79 f1 2d e4 16 11 45 +be 62 ac 13 a0 3b f4 81 95 fb 9e 5a 18 b8 2d eb +bf 3d df c8 08 25 d5 93 fc d4 02 e7 4e ef + +# Encryption: +3d e4 c3 e0 59 35 7b 8a 54 83 7e a1 59 62 cf e2 +00 7c 5e a8 98 5c 93 51 91 64 a6 89 b7 55 b6 1c +8b d2 73 96 9d 33 3c 4b cd 9b 06 03 53 c3 7b af +13 eb 42 2f 1c b9 77 56 e6 b4 94 6a df e1 af 75 +e9 fe 2d 95 b4 b1 3d a1 73 2b d8 b8 be 11 97 02 +79 19 53 0c 34 7f 3d d1 03 9e 34 8a 53 b1 16 f9 +f8 fe 89 36 a8 4a cc 39 f2 e0 69 56 b6 78 d2 0f +df 95 17 07 2e 02 f5 70 78 fd c0 46 59 40 0c 5c + +# PKCS#1 v1.5 Encryption Example 6.5 +# ---------------------------------- + +# Message: +f3 c0 0b 00 9e 5e 08 a6 3b e1 e4 00 35 cd ac a5 +01 1c c7 01 cf 7e eb cb 99 f0 ff e1 7c fd 0a 4b +f7 be fd 2d d5 36 ac 94 6d b7 97 fd bc 67 9c be +68 f1 a2 f3 62 59 c5 58 f0 4d + +# Seed: +e2 2d 5e 43 b1 eb a1 ac 0c e6 5c 32 70 51 0e 0f +13 c9 4e 96 24 ee 52 56 59 ef 4d 57 37 88 20 c9 +35 22 9b 30 99 aa 2b 23 50 61 4f 8c c4 29 58 15 +a2 c9 ed b2 d9 c5 9c 73 d1 aa 90 0c 21 34 c0 a7 +d0 90 9c + +# Encryption: +53 3e 67 a2 bc 5b 3f 01 34 2d 8c b8 d9 25 d7 3b +4d b3 4c b6 75 da 90 39 22 6a 98 e4 d8 13 c6 20 +11 09 90 a8 e6 ac ba 50 fd 04 f3 30 7d eb af 20 +d4 f3 74 cf 6d e0 d9 b2 1d 86 e2 66 07 9c f2 f1 +8b 45 03 20 8a 21 5d e2 b1 1c ca 9e 34 64 fc 5a +c1 dd 7e 96 b2 fc 04 09 e4 2f 46 a5 06 12 a6 b2 +06 1e d1 61 9a 7f e4 67 96 ed 8f 52 06 9a 5b fc +84 08 d5 58 f5 2a 03 33 2e e8 ed de f8 f7 45 d9 + +# PKCS#1 v1.5 Encryption Example 6.6 +# ---------------------------------- + +# Message: +aa fe 5b 27 11 11 ef b8 79 2f 5a a9 23 83 07 29 +76 b7 2a 0a 27 2f 90 c5 24 61 f8 8a fb 1b b6 b7 +ec 26 38 1c 65 76 a4 10 87 a0 39 80 9d 14 f6 11 +60 67 59 4e bb + +# Seed: +75 0e f0 86 9f 8c 75 7e f4 31 57 8b 45 a6 e7 41 +bd 1d 96 0e fc 37 89 b1 0d 2b de 27 38 18 07 4e +bf e5 fa ae 10 ac 24 4f 89 f6 c0 2d e5 d1 ad ae +fc 7a 8f d2 4d 7b c3 76 fd 65 d3 5e 39 50 8c 42 +36 ac be 2d 5c a7 69 4b + +# Encryption: +34 4d 43 37 61 2b 22 dd 40 2b e3 79 e6 b2 65 0b +51 9e f3 7b 7a b4 85 81 94 52 d1 67 c1 b2 15 db +d3 fb 24 f9 b2 f9 29 86 69 cb 1a ee 14 1a 7d 89 +01 64 20 43 11 1f c3 8b 3f 40 ef 0b 7f fd 7d f7 +6c 2d 92 e3 29 41 1c 75 e0 f1 72 85 bb 6b b8 26 +88 12 8e d9 bb 95 1c ae dd 7d 06 7e dd 0b 13 e8 +27 5a c8 86 25 d9 7c e8 d2 0b 69 b3 57 38 b2 f4 +72 6e 29 84 b8 df a8 66 95 aa e8 8d 9e 17 6d f6 + +# PKCS#1 v1.5 Encryption Example 6.7 +# ---------------------------------- + +# Message: +a1 22 4d f9 aa b6 58 78 45 b2 a3 93 a5 a8 76 c1 +7d 95 9d 53 5b 54 19 d4 12 a9 a5 31 bb 43 7e 1d +ac 1b 54 6d 62 + +# Seed: +76 1d c4 f5 1b c8 51 8d 62 7c 45 b3 e9 81 8b 85 +42 a0 6f fe 17 2b e3 af 5c e7 a9 05 3f e5 4e 69 +70 12 49 73 37 4d fc c1 f4 9f cf fe 95 7a ae 8c +9c 3b 13 0f 46 05 d2 c3 ef a2 93 2a d0 83 de c5 +8e 70 d4 f6 92 6c 80 b5 d4 89 1a 1a 55 9e db 0c +af fa ca d7 5e b2 64 83 + +# Encryption: +78 5f 6a aa b4 d2 f3 18 d4 af 37 b6 e0 07 4e d5 +a4 19 4f a6 05 a7 ec 87 d0 5a 07 f3 34 9b 5b 92 +f5 fc 47 90 ea b1 37 86 cb f0 35 c7 8f fc f1 34 +4d 1f 3e cd aa e0 16 72 22 2e 6d 4a 96 55 59 e2 +c0 82 91 cb 1d 4c 2d 4e 68 ff 8e e7 15 23 f6 dd +ae c5 0a 4a b2 2e dc a2 47 36 4c 92 d8 73 99 e8 +a7 1d f7 43 6b 62 d8 ba 8a d2 02 94 cb c6 0d ca +e0 30 5c 79 73 f7 fc b4 a5 cb ed 15 71 3a 7a 16 + +# PKCS#1 v1.5 Encryption Example 6.8 +# ---------------------------------- + +# Message: +1e 0e 3f 65 0c 32 db b2 f6 91 6f 36 f1 35 bc ae +88 1d 54 55 07 40 2d 6a fd 3d 5b 3b d8 38 5a 50 +b4 fa d6 f7 89 49 fd e6 21 64 ed 76 89 e5 f9 a4 + +# Seed: +ee a9 0a 54 d0 16 da 7e 8f 08 76 a7 33 b0 f2 a0 +6f 90 a7 3c 1a 3c d6 39 b6 cf a9 06 ce 08 ef 78 +8b b6 fe a7 4f 22 eb 91 a6 ab 32 84 cd fc 1e 72 +e6 3e 78 d1 8a 64 d6 7f 9d 1a 29 19 49 ed 2e 32 +3e 91 dc 03 38 76 ee eb 09 ff a7 1f 59 + +# Encryption: +6b bd ae 20 f9 89 bf aa 5d 65 da dc d6 1a 86 b6 +63 07 a0 60 2f b5 51 a7 38 06 12 2d b1 88 ec 1d +41 e8 4d aa 2c c7 d6 be 54 1e 12 28 88 09 a1 7e +08 5f 2c af a8 ae 13 67 0e 0f 33 65 a1 47 1c b3 +15 7c 06 e0 f6 3b 82 00 f3 16 0c 16 3f de 7c 90 +1e f3 26 e5 70 0c 9f 5e 07 fe 01 98 81 0f a8 0c +8c 5d c5 3a 50 bc e2 54 f7 d1 99 01 cf 6c bb 60 +34 13 e4 1f 90 30 e7 39 c8 ba 96 49 97 84 74 99 + +# PKCS#1 v1.5 Encryption Example 6.9 +# ---------------------------------- + +# Message: +73 dd f0 a1 4d 57 ba 65 b4 f6 93 ac 76 1e 20 2b +1e 5b 85 7c 8b 34 04 e1 41 85 df a8 aa f0 49 89 + +# Seed: +fd 43 3d 7b 01 76 b7 31 d7 80 dd 6c 58 51 b8 2f +17 6d 62 b8 0d 96 ae b6 31 d7 fb 8a c5 be 55 ac +21 7f 4e 08 bc 7e cf 81 f8 e3 f5 dd aa cd c6 c2 +17 8d f7 81 88 23 97 53 3a 63 8e 62 f0 74 ac 48 +8f 4c 12 aa 57 be 2e ce 5b b6 e9 09 6c d9 22 59 +a4 5b 0b 03 2f 10 14 31 a2 8b 86 40 fb + +# Encryption: +ae 97 ff 43 4e 9a 5e e4 87 76 1d b3 56 90 0b 06 +37 37 46 5b e5 05 8d c0 3a 28 a3 22 e5 c0 e0 91 +b7 99 bf 65 94 55 cf be 05 42 7a c4 d0 44 05 e5 +6e e0 4e 06 3a 23 73 db cb 9b 4f a1 6e 43 07 94 +6a 49 b3 56 34 52 0d 41 6f 65 c3 c3 22 ed c5 46 +71 56 91 28 a2 a1 52 a7 6f e4 44 c4 30 aa 6f 03 +c4 12 9c 6e 21 31 75 5d 76 4c ec 4a 14 86 a8 1b +a8 a3 16 8d 16 e7 4d ca 8e 77 bb fd 67 ea 37 2b + +# PKCS#1 v1.5 Encryption Example 6.10 +# ---------------------------------- + +# Message: +ef 3e 76 98 e7 d9 cc 86 3b 46 6b b2 88 55 6e 4a +c2 52 82 e0 94 fb 5b 57 c1 76 17 bb 98 + +# Seed: +db 90 a7 58 0d 8d 42 9e 22 bd 7e a5 c7 b4 cd 0c +65 ad 0e 2e 27 f5 33 41 bc 23 a8 b1 35 8a 76 a0 +b5 e9 4f c5 b4 2a 9f 75 6c c6 3b 9d 62 3f 55 17 +67 fb c6 f7 11 4e 40 ba 73 61 fd 32 d6 f8 d7 72 +34 37 43 6d f7 24 b1 32 7a ae f7 b9 57 56 27 68 +f8 fa dd 57 86 2b a0 b3 14 09 6a 3b 38 77 0e 31 + +# Encryption: +43 f8 cc ce a8 12 d3 38 5f 43 fa 83 7c b5 e6 fa +59 0f 1a ff b8 62 d2 ca cc c6 d8 e8 bb 5d 5c 0d +50 ff b9 f8 f8 09 89 00 c1 2e 77 2a 84 7b 37 81 +57 78 2b 0a 90 40 f7 a6 16 c2 eb 05 8e 44 d4 a7 +e2 0b 48 5a c2 9f 40 d6 8e 03 c3 9d dc 8d ae 7e +7e 09 e2 8f 9d d2 19 0f 3a 9f 35 74 b2 f6 34 00 +15 44 36 3c 86 1f e2 7f 7a 39 23 66 92 fe 35 82 +14 0b 21 72 ce 64 7e ed 41 76 85 c6 e1 db 85 6c + +# PKCS#1 v1.5 Encryption Example 6.11 +# ---------------------------------- + +# Message: +f8 69 18 47 4f 88 16 97 11 1b dd dc 1f 00 61 3e +b2 c3 d9 c1 78 76 68 35 3e bb 02 b3 20 a3 26 + +# Seed: +cb 7d 99 da 9b 11 ea 57 f6 40 55 43 44 7d d1 5f +b5 cc a0 a1 0f 3b 69 b4 d2 33 09 ef f2 75 0c 48 +6c a6 55 32 5b 55 a3 27 ff e8 bd 6d ca 99 bc 8e +fb 5b c2 94 2e c0 39 e2 84 25 e4 a5 6a 07 d3 80 +12 f1 0d 21 5a 22 d6 37 68 59 43 d3 64 72 53 01 +dd 40 e2 17 22 8a b7 91 59 89 98 83 6b bf + +# Encryption: +2a 40 87 80 ad 51 4e 56 71 fe 1d fc 36 7d 7a a4 +65 fc 34 69 f1 c1 52 ae e1 81 45 e0 f5 f0 75 9f +44 69 b4 3d 55 12 3f 5d c9 ff c6 17 f2 3f a4 9b +78 96 02 19 66 0e c6 22 74 d6 c5 9b a3 14 60 bd +10 94 1e bb 5e 05 69 41 51 c5 7b 5b 95 88 ca f0 +9f 45 50 20 a5 4e 97 7c 3c c0 27 da e3 1f 2c e4 +42 17 02 3e 10 ad b6 f2 d8 aa 0f 80 84 fc 45 86 +05 80 3f d4 4b 21 ab c2 7b db 8d 4c 56 17 84 cf + +# PKCS#1 v1.5 Encryption Example 6.12 +# ---------------------------------- + +# Message: +6a 40 bb 60 70 8c 5a 99 2e cf dc 7e e5 3f 54 08 +4d 19 af fd 4d 21 + +# Seed: +c3 f4 fa ca 56 c1 ff 07 d1 ad 10 37 07 d1 b6 68 +20 47 b4 d9 d6 24 6c 2e 5c 4b 0c e6 55 3d 55 31 +3f 8f 38 ae e5 e4 d8 07 3a 55 d2 4a d7 96 c4 b7 +61 26 c8 aa 61 c4 6a 4e e8 5f a9 05 7a 52 6c d0 +aa 24 5e 58 28 f2 18 1b 4a 64 79 86 87 48 e7 47 +9f 40 34 53 3c 0f 3e 1e b4 35 fa 47 d5 3b 58 e4 +2c 96 17 bf 7e 77 7e + +# Encryption: +c4 64 11 c7 11 6f e6 f4 6f 1c a0 f7 4c 60 81 a5 +5d f4 1d 2c 0b 8f c5 d3 8f aa 34 0b 5e cf 71 83 +f8 5f 88 c4 fb 28 ac 5f b1 f1 8a eb fc fc 10 bf +dd 3a 19 00 2c 6b 52 24 14 92 70 4b 6f e6 3d 61 +a7 30 10 c1 49 ff 63 03 28 3e 99 78 cd 84 54 04 +fa 06 b8 c6 98 aa ea 8f 86 13 61 d8 86 b2 c0 f0 +1b 47 a1 a9 a3 dd 90 3f 8a 58 ae d6 6a fc 85 e9 +b7 1e fc 3f 55 a1 21 66 74 16 a3 00 00 13 13 e8 + +# PKCS#1 v1.5 Encryption Example 6.13 +# ---------------------------------- + +# Message: +32 52 fe 99 62 09 74 e0 77 d6 eb 55 75 + +# Seed: +bf 06 9b 4b cf 15 44 8b c3 9e 45 f4 42 6a ad 0d +5d 82 b7 4e 93 ae 1c dd 71 f7 1b b9 be b9 b2 3d +59 73 2f 9c 8b c6 34 3d 13 02 31 de 18 f7 c8 9f +c2 f4 22 18 9c d9 27 e5 09 b1 31 97 aa 56 d8 1a +73 76 f8 33 3e 47 42 44 8c c8 92 de 40 44 97 2c +7f 67 dc be 85 44 a9 0e ec 59 e7 95 ae 59 64 08 +39 2a f5 77 6d a0 d6 cb 29 c7 e0 a7 86 81 30 a7 + +# Encryption: +76 53 cb ff 58 68 92 cd d2 58 bf e6 ba eb d9 91 +45 eb 1b 22 89 4e 1a 76 4d 02 b2 ba 99 59 52 a0 +12 58 20 8d e1 a0 1d 8e 8c bb 5c da f0 d6 03 69 +4f 88 25 5e 80 90 97 b7 0e 9d 79 e6 2b d5 c0 d8 +36 dc c2 9d d1 9b 05 a1 60 26 90 42 05 b6 0c 45 +03 d4 fb e9 93 38 55 e8 68 02 c7 54 28 d9 a6 34 +73 03 16 76 32 d3 3c 5d 9e cc 8a e2 49 3b 58 c3 +6b 2a 65 53 a7 b9 e2 b1 35 8a e2 8d ad 50 28 0d + +# PKCS#1 v1.5 Encryption Example 6.14 +# ---------------------------------- + +# Message: +dc 94 + +# Seed: +05 e8 05 bf fb d1 b7 4d 1a 5a 83 8d 85 71 67 b4 +c7 d4 0a 6c d3 e6 8f 31 be 46 93 b9 8c ec 6d 75 +89 49 19 ab 18 57 2c 75 82 2e 75 e9 de d7 2d a0 +67 97 83 a7 72 18 14 e1 99 16 0b 75 07 f6 7f 4e +de 58 7c 88 be 76 81 5c 50 b2 61 df 30 8b 31 43 +23 73 0c 1e 07 3a a7 29 98 cc 2f 8e 0a 8a 5b d6 +5b f9 34 ac a8 a6 48 59 e2 5f 02 c5 a2 71 39 41 +c8 c8 e6 27 20 84 6d fb 51 c2 ff + +# Encryption: +6a dd e2 44 f0 63 8c 5a b7 45 ff ba b5 ab e1 fe +80 0b 0e ee 15 35 50 c4 8c 36 f4 24 9f 9d 5d 36 +b4 7b 28 cc da 71 a7 dd 83 2e 64 35 ad 0e b8 5e +f7 55 6b b8 4b f9 5a 59 cc c9 c2 07 51 ed 3e 1a +d0 de 10 29 94 a7 12 c5 14 01 46 92 a6 7f 1d 87 +ca 2e 4f ef 29 ec 83 e0 1e 29 ad 0c 97 8a cc a4 +d5 c5 02 74 5a 6c 50 0d f2 00 04 bc 9b f1 6f 5f +cc 69 bf 52 70 9e 31 cf 6a 2b 9f e6 24 d9 a3 64 + +# PKCS#1 v1.5 Encryption Example 6.15 +# ---------------------------------- + +# Message: +4f ae 6c f3 7e 9d 5f 59 + +# Seed: +e7 f9 ed 4a 0c 3a 64 66 69 03 9b d0 1f 24 9f 32 +be a1 e6 57 6c 21 d4 51 89 d0 f8 91 cf 4a fd 62 +32 08 3a 32 1e d2 d3 4d 07 09 84 f5 e9 45 78 39 +b2 eb c1 e0 3a 2c 0d 8d d7 09 73 1e 95 b2 e6 94 +1c a0 90 71 87 af fd cf 5a 87 f5 cb ea d2 f9 05 +2c 38 d0 ee 54 e1 f1 28 ff c3 37 de 45 66 a5 92 +5e 1e 94 7a ef 50 88 1c bd ae d9 9b 1b bc 1a f5 +13 23 2c 0f f4 + +# Encryption: +46 e6 70 5e b1 25 2d eb f8 ec 67 2c 4f de af 69 +88 26 84 59 f9 95 89 bb d3 05 41 33 d4 83 ab e1 +e2 7c aa b0 a7 f0 22 1b 1b 67 a1 4e bf 45 12 6e +60 13 48 b0 43 44 06 da 3a 8c 76 d4 f1 e3 f1 a0 +e0 6d 0d b8 23 da 51 17 b9 2a 40 b6 f3 9f 57 e4 +83 a7 da 36 e9 9b 67 7b b3 f7 6e 6c 5d b0 3f 3c +e4 45 04 eb d4 5e 9f 14 fe 0f 61 3a 2e b7 95 47 +ab 57 8c 58 6d 3b 65 4a 06 fe 1e f3 7a 22 10 66 + +# PKCS#1 v1.5 Encryption Example 6.16 +# ---------------------------------- + +# Message: +cd fd fd aa bc a3 76 7e 70 bb c5 e9 ab f6 + +# Seed: +ac 77 7f 67 29 9d e4 c1 c4 c5 74 f3 1f 67 4f 6f +aa bd e0 31 f8 ec 33 e8 26 76 eb 32 a9 3f 65 79 +aa c3 e9 59 35 9f c5 73 ee 5c 0e 3e 07 76 53 ef +f9 d5 f8 db 4b 1e 7a ca db 05 99 71 53 1f 49 b0 +7c 93 eb 9f de dc f0 90 3a 7d 50 b4 79 67 6f cd +e8 74 0a fb d7 d3 7c 3a 21 02 41 2b de 1d 3a 82 +44 15 6a d8 08 9d 45 df dc 91 cd e6 c3 a1 59 + +# Encryption: +51 3c 76 1e b1 92 9a ff 79 77 a9 ff 0e 61 b7 a1 +d5 11 c8 cb 25 39 24 33 24 25 56 9a 07 e2 29 cb +39 01 71 53 90 f7 de 37 bd 36 2c 96 fc 0b 0d 79 +81 0c 1e 8b 15 e1 3b 00 32 73 47 78 cf 96 4e 6f +6d 17 fc 41 c7 86 76 72 b2 54 0f 56 9d 0a 46 0a +80 fa d5 6b 5f 05 4a b8 e4 9e 40 9e 9e 0b 86 13 +cb 3d a2 0c 35 c3 e1 bb 99 b7 ec ab 7a 00 fc 1f +c2 37 0f 9c 80 85 67 df 89 be 2e dd bd b6 b1 10 + +# PKCS#1 v1.5 Encryption Example 6.17 +# ---------------------------------- + +# Message: +b8 20 c3 2e 73 7d aa 23 4f 29 ba 90 64 7f c3 bf +0a 8e + +# Seed: +f5 ca f8 fe b4 2d f7 b6 b3 89 f5 05 99 a4 ec 20 +e6 19 ca 22 d2 bf c9 1b c7 f1 4a e9 f1 22 9e 07 +c8 88 ed 57 aa 6a d3 c1 04 10 44 c5 1a fb 55 21 +7b 0c aa 23 34 ad 79 f4 7a bb f9 b4 20 83 33 b7 +2b 4b a4 bb 5f d0 37 98 1d d8 01 70 c8 03 60 c1 +4d 5a f5 1e 5f 82 ab f5 1f d3 6f 02 18 67 a6 ec +09 7b c3 39 22 ac ea d9 e3 35 58 + +# Encryption: +3e 23 25 18 41 db 2e 20 7a 27 10 1f 13 29 19 1a +b7 fa 6a 70 1a 52 62 61 48 23 53 a1 a2 21 ef a9 +d3 a9 d4 59 cd 2a 2d 86 68 90 8b 78 3b b0 9c 87 +9a 21 7f 1e 40 0f 95 b2 17 b0 40 a5 3e 34 1c 17 +b9 3d 3c 3d 65 46 0c 5c 7f 2b 4d 79 a3 4b 5a 96 +11 7a a3 67 51 d9 ea f2 33 b0 3f 68 db a6 a4 57 +1b 90 71 77 f8 28 33 6e 82 5a 92 26 1b 62 36 39 +be c9 8d 3a 09 f8 72 c2 ec 59 1b 4c 38 3a 69 c7 + +# PKCS#1 v1.5 Encryption Example 6.18 +# ---------------------------------- + +# Message: +60 6b bd 61 37 15 dd cd 92 c7 b6 df 04 b3 60 72 +f0 11 62 d0 08 76 63 12 ca 69 77 dd 3a 06 eb 95 +e1 ba c7 bc 1b c6 60 2c 9e e6 44 + +# Seed: +51 3a 5c 95 68 e8 9b 9a 53 d5 af 71 6e 55 fb 34 +0f 8a 39 23 70 e8 88 a8 0c ae da 50 2e 7f 9d fc +17 51 95 a5 0e 47 07 13 96 d6 ec 55 4e b7 2f 18 +3b e1 8f 3b f4 ec 73 b3 05 92 fa ef 2f b5 14 de +be fc c6 5c 8d 23 c4 ad 25 94 56 c1 e8 0b 36 0a +d4 59 + +# Encryption: +47 21 a2 39 40 18 87 30 f5 de ac 85 00 2e 38 31 +b1 49 ae 57 af c6 97 35 a0 45 ee 3f c3 53 64 72 +fc 83 3c 27 c8 7e ab 6f c9 05 e3 67 96 1b 31 24 +98 63 6b e6 c7 7a a8 0b 8d a2 f5 d9 48 aa a7 7b +5f ab 72 4b bf 64 ee 89 d2 81 ee d4 7b 21 2c 32 +95 26 65 77 f4 fd 93 a2 22 39 de e5 40 c9 40 0f +e5 6d 7a ef 51 df 36 a8 9a e9 2f 92 6f 55 83 31 +e4 1b fd fe fe 35 75 8b 93 ce 11 40 ac 9b 6a 54 + +# PKCS#1 v1.5 Encryption Example 6.19 +# ---------------------------------- + +# Message: +1d 82 de f8 c5 92 87 50 08 a5 f8 9e 7e b6 4e 25 +2e dd e9 dd b8 81 d3 73 62 31 7f 6e 6e 6e 99 3c +60 23 3b 0f + +# Seed: +87 5e 07 5e f1 b0 54 b5 84 1e 08 45 0d 78 eb 54 +a5 5c 88 b6 d0 18 13 c1 07 a0 9b 74 54 3b 3f 9f +e1 b7 c9 02 11 c6 2e a7 33 81 20 d4 ae 0f 73 ba +82 c0 1d 28 f8 19 4b 3a 39 6b df 50 f9 41 3a 7f +b0 3b e2 25 fe 05 45 db 80 cd f0 f6 10 a9 5f d9 +03 76 e0 39 e3 83 1f f9 9e + +# Encryption: +8f b5 46 26 3c 1d 18 75 c7 43 f5 2f 02 67 b2 f2 +fe 68 8d 25 42 02 10 49 f5 34 89 ce 7c 35 91 30 +f8 e1 1e 3c 46 1c 5e 86 3e 4d c1 9f 07 a1 3a 4c +1a 88 22 4b 26 c5 c0 cb e2 02 02 45 d9 1e 1b 83 +42 42 52 52 f5 3f c4 0e 4b 14 fa 02 bb d7 47 37 +d4 02 2c c5 4f e3 8f 0d 27 d8 fe a5 0f 2f dd 84 +65 d4 f3 2f 8a c0 3e e0 06 be 62 33 e4 d1 a3 c1 +6e b1 44 b5 d8 be 72 9a d3 04 f8 23 61 e0 7c fb + +# PKCS#1 v1.5 Encryption Example 6.20 +# ---------------------------------- + +# Message: +8a 8a 3e ab dc a7 ca b0 cc 29 6a 29 1e a8 a9 3d +a4 d2 d2 a1 96 ff 2f 8d 18 1f ee 1f + +# Seed: +2e 47 36 e4 29 6a b4 66 18 b1 ef 34 da 26 77 6e +92 ef 66 f7 cd 17 4e f9 47 69 72 42 23 a7 65 b4 +eb ef 08 a8 8f ed be 27 05 60 e5 f6 74 37 cf 49 +d5 7e a6 62 0a ca 59 89 8a fd 52 cd ef 30 a8 b0 +d9 85 5e 5d fb e3 47 de 77 c4 c0 28 0b 0f 1f d4 +4d 4f e6 89 06 be 8a 4f 12 c5 33 08 7b f5 bc ea +fb + +# Encryption: +03 f3 e4 ba 03 48 31 a0 e3 0a 4a 33 44 ce ad 61 +b2 8b 43 be 31 53 2c 2d 76 37 53 9b 90 13 83 7e +dc b1 f2 16 d3 2f df ae 73 32 36 74 a2 81 45 65 +db f2 9e 71 2d 18 c4 37 39 64 df 60 c9 39 9f da +54 14 a0 eb 45 bd e8 66 1a 89 09 12 95 a1 ef 71 +61 6a 3c d1 45 e9 b3 18 b6 51 af 17 5d 4e c3 50 +1d 5e b7 63 e8 d3 5a 2b 72 74 6e 02 0b 4b a5 99 +73 83 4b 21 50 02 6b 43 2b 17 9a 9a e8 17 2b 7b + +# ============================================= + +# Example 7: A 1025-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +01 70 93 41 d2 ec 08 04 a7 40 34 e8 fa 72 86 42 +98 3d 16 50 d7 46 e4 49 c9 ee 40 79 aa 15 e5 1f +1f c1 34 24 2e 52 4b 0d 3d 0d bf 5a 51 21 93 9b +12 5f cc 86 3e 51 41 60 b6 34 e3 7a a6 98 94 77 +6c 7d 33 e1 e7 c6 19 52 1d e4 82 a0 ae a4 5c 3c +6a bc 3f 33 e2 5d 86 ff a1 39 33 25 65 9b f2 d4 +09 8d f1 69 b4 07 21 87 66 0e 27 77 00 19 9b 7a +3e 34 84 b3 84 5f 6f bf 31 98 65 7d f8 cb f3 a8 +1b + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +01 70 93 41 d2 ec 08 04 a7 40 34 e8 fa 72 86 42 +98 3d 16 50 d7 46 e4 49 c9 ee 40 79 aa 15 e5 1f +1f c1 34 24 2e 52 4b 0d 3d 0d bf 5a 51 21 93 9b +12 5f cc 86 3e 51 41 60 b6 34 e3 7a a6 98 94 77 +6c 7d 33 e1 e7 c6 19 52 1d e4 82 a0 ae a4 5c 3c +6a bc 3f 33 e2 5d 86 ff a1 39 33 25 65 9b f2 d4 +09 8d f1 69 b4 07 21 87 66 0e 27 77 00 19 9b 7a +3e 34 84 b3 84 5f 6f bf 31 98 65 7d f8 cb f3 a8 +1b + +# Public exponent: +01 00 01 + +# Exponent: +6f eb f7 98 12 1e 99 33 24 97 2c 8c 28 cc c6 5a +2e 6a a1 5f cd e2 32 da 03 e4 46 4d b4 da 5f aa +27 e4 2a 7c 7a 76 d9 ed 49 48 6b 27 a9 d7 85 c6 +7d 9a c0 c5 19 ad 8d ad a6 bf d1 15 d7 cd 75 b9 +9c 4b 59 c7 69 83 a7 01 5b 0d a6 97 3c 69 fa 95 +08 10 ae 27 68 d9 75 88 90 05 62 e8 6a 6d f7 c7 +14 b8 44 b1 e0 46 68 6a 5a fc 66 7b 13 57 3a 55 +be 9b 5b 38 b9 9b d3 cf 54 e4 34 4a 2f 2d 0e 21 + +# Prime 1: +01 40 ef 5b 50 70 54 d5 a6 94 46 4e f4 7e 49 86 +8c b3 3c 97 e0 e3 ed d7 7b f4 5a 52 5e 60 8d 7e +21 5f 91 33 48 a9 b8 27 c8 39 73 7a 42 b6 ad fb +b2 bb 49 7e 14 78 92 2f 71 88 97 d9 fe ed 27 7a +6b + +# Prime 2: +01 26 00 4b be 2d f7 6b 6f 38 ae a1 64 b1 fd 0f +97 61 2b 2d b9 6c ed e2 8a 3a 91 ce 0d 74 25 3b +b3 f9 55 9b 89 f4 81 33 75 65 2a 50 70 06 ce 99 +95 a9 8f 0e 6e f3 bc 22 e5 51 9b 61 3b fb cd 55 +11 + +# Prime exponent 1: +98 14 d4 e0 b9 5a 7a 24 05 ff 8b 4a b0 cd 86 c5 +05 ea a0 ce 21 34 83 f8 69 42 a3 e5 b5 3b 57 99 +d8 ff a5 9d b9 4f 5b 0a b6 ae d2 30 eb 00 67 55 +bb 0a 88 84 8a de 3b 3d 41 cd 33 b0 6a 11 5b 21 + +# Prime exponent 2: +1c 4b 1c fe f1 67 85 34 4f ed 26 65 0d 68 00 2f +1e 4f cc 77 b2 ce f5 e5 3d 9b b8 8b bc e8 b4 65 +2e 92 99 84 5e 3e 6c d8 58 63 09 18 ae df 05 12 +cd 1d 92 53 05 2b ce e3 e8 c5 9e 46 ea 85 a9 31 + +# Coefficient: +fd c5 10 c4 d9 79 07 30 b0 fd 47 d3 13 ab d4 08 +58 c7 df d5 8f 4b 37 91 5f 7a 4b 1d b3 d7 d8 ab +d0 6d 3d a0 02 de 98 4a 76 09 cc 18 a9 44 86 46 +0a 61 74 6c 7e a6 31 17 a6 8a a2 82 59 74 4f 49 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 7.1 +# ---------------------------------- + +# Message: +da 50 9d ce 45 e2 47 00 37 9b fe 5a a1 a8 1c 24 +70 6c 18 42 d9 b1 3e 7a 2e 0a 15 d3 a4 af 8e 6d +08 61 2d ca a1 5d 46 0e ce 87 29 88 e3 e9 0f b2 +7e 5c a5 c1 0f a1 fa cd cb 0e + +# Seed: +80 8c 20 46 fb 50 5c 37 69 5c 8d c3 5c 38 f9 f9 +90 5a b4 8a 2b 8a 14 6e 8e 8e da 33 85 ce d9 5a +31 3b 2d c6 eb 41 83 67 fe ef f7 9a 02 ad 74 64 +6d f7 a5 d8 70 54 ac dd af 34 ea fd 5c 1d b5 8e +5d ec 04 81 + +# Encryption: +00 fc 3d 0a aa f2 6c df 25 a1 a8 df cb 71 70 0f +b6 5e 2a b5 55 1a e5 f4 19 b2 d2 f9 4c ef 01 73 +02 b0 0a bd 9e 6c 6e fa e9 44 74 d1 8e 68 da 0a +7c 17 ef 2c 5f cc 89 07 1d 3b 07 12 1b 9c 01 e3 +0f f0 53 66 3f 61 f8 9f db c4 9b dc f8 e6 71 66 +94 43 91 9d 41 34 28 45 e3 e9 9e 46 a8 a3 b4 8e +23 98 a8 8e 5b 45 d9 9a 17 dd 1f 21 2e da bc bc +d3 00 a8 4d 39 8e f5 79 35 bd ae 95 9e 60 54 e7 +3a + +# PKCS#1 v1.5 Encryption Example 7.2 +# ---------------------------------- + +# Message: +ce 0a 79 47 49 87 41 60 e5 d2 e4 ff + +# Seed: +f4 b2 c9 f3 11 c1 fd 41 d4 79 44 b5 0e 17 55 d4 +ea c5 ee 65 08 7c 9f c6 d2 f0 75 b7 38 c6 49 26 +ea f7 d4 31 6b cd b6 36 54 d5 42 0d a6 1e 02 45 +f1 95 b9 e8 24 aa 0b 06 c8 87 99 b1 27 fe 9b 03 +6d f3 61 75 c0 a6 bd 80 e4 e0 af 6e bc 2f 42 70 +b0 4c e3 0b 9f a2 7f 04 35 86 0f cc f4 0b 3d c7 +ea ef fd ba b9 e1 76 66 19 bb 01 6c 17 90 26 63 +cb 24 + +# Encryption: +01 0c f7 4b eb c2 63 6d 2c 49 d9 c6 22 bd 76 cc +0b 1d 02 eb b5 2f df ae c0 1c 4a c1 e7 56 07 1a +8e f7 6e 12 2a 4c 62 c6 ba 32 65 fa 4c 90 56 26 +d1 13 d5 9d b7 9a d6 5f 86 40 b3 c4 34 4d 73 40 +c1 6e 38 de b1 89 e3 a1 b1 1e aa b0 b2 60 6a 7f +82 f5 94 6d 41 9a ce bb bb 3a 93 7d 41 e2 9b 33 +ed d3 ad 15 f1 e7 77 0f cf c3 0a e0 6a a0 1b cd +03 d5 df b1 62 f8 7a 18 39 67 55 3c 25 02 cb 5f +fe + +# PKCS#1 v1.5 Encryption Example 7.3 +# ---------------------------------- + +# Message: +41 d6 + +# Seed: +55 6e 59 b2 c1 89 58 75 08 e2 08 92 fa 56 02 d2 +49 fb fb 71 a1 09 05 ed 5a f7 b7 9b e8 71 11 a0 +c6 9a dd b1 9e ef 31 6d 7c 0b 21 81 79 90 dc 3e +d8 c7 6c b2 3e 83 0e 17 c0 f4 38 73 15 9f ab 7c +5c 4a 6c f2 19 cb 1d c5 c5 da 45 53 a3 e0 bf 18 +3b 8e 11 2b 61 f6 92 a7 dd f0 04 bd bf dc c8 d6 +65 9c 3d d8 0c b2 3a ab e8 c6 fd f2 67 5d 07 3b +66 23 12 e4 ac cd e9 1c 12 25 e6 d1 + +# Encryption: +00 2a 10 04 95 59 66 55 30 4b dd f9 09 7f 78 d9 +dd b5 eb 42 9b 66 63 5a 58 a2 98 f1 92 8e ed 61 +53 4f 80 b4 ea 05 ee 39 b0 2a 64 56 6f 6c 45 6e +3b 58 6e 7c b4 3a 88 94 0e e1 29 34 0f 57 8e 56 +e7 2d 8b 27 83 36 10 06 d9 71 29 ab ef 02 cf 1c +19 12 e1 7f 0c d1 d7 1c 0b 32 8d 0b 48 a4 ac 7a +ec e3 c0 05 a6 19 0e ac 22 c1 99 10 41 15 9a 2a +d1 db 08 96 01 5c 4f f1 d7 b3 54 47 cf c1 0a 24 +be + +# PKCS#1 v1.5 Encryption Example 7.4 +# ---------------------------------- + +# Message: +0b b4 ab c7 dc 6c a4 23 5c 29 ed 0a 2c b6 3f d1 +41 34 1e 2c 4c 90 1e 6d c9 5d a9 f0 01 0f a2 e0 +22 cc fe 8a df db 6e cf 4d 89 f5 79 a1 0a 51 70 +be 18 c4 6a 24 1c a7 ee d1 07 ca fe 4a 9d + +# Seed: +bb 80 be 78 02 dd 8b f5 fb 5b 1b 86 39 66 54 f4 +73 9f 5d 43 51 f1 9c e3 1b 72 c2 10 ae a1 a2 ed +21 42 d8 d6 f7 ae 37 4f 06 13 3a 31 5c 62 64 da +65 ce f2 33 ed 3d cc 81 59 d7 6c 3a 17 f3 6d 0c + +# Encryption: +00 6f 1b 6c 1f b3 7a e5 c8 c0 24 44 9a bc 38 40 +e8 e5 09 71 43 ee d1 6b ea f6 7b 6c 7a 48 24 ac +38 b6 f8 c3 53 b6 45 c8 ce a4 fa b0 9c 02 fa 6c +32 5a 50 74 38 b9 64 5e c8 23 00 86 b3 15 e3 4e +7a 56 ad b0 ec d8 9f d0 7b 98 73 9c 24 db 6f e1 +1f f2 e5 ad 38 31 8e c3 1d f2 ed 25 08 de bc a7 +a6 7e 24 01 96 aa 9a cd 80 32 9f 4c 43 43 c1 0b +72 69 9f 9d 6b 5b c2 43 99 5b 09 c4 6d d3 d8 03 +ce + +# PKCS#1 v1.5 Encryption Example 7.5 +# ---------------------------------- + +# Message: +ed 26 ec 20 2d 5e 69 74 0d a3 48 84 06 bb bd + +# Seed: +f2 fd 08 cc 0d b9 a5 5a bf eb d9 2e 2a 9d 75 87 +2a b7 df fb 0b 4d a1 36 06 e1 52 75 9f 86 6f 22 +eb 87 29 fb 8c 9a 5c 45 ba 2f 4a ca e4 31 59 a7 +ad 3c f7 8e 81 fd 09 54 90 9b 1f 0e 70 89 ca 86 +a4 58 8d 8c 87 a1 a6 1f 1a 48 39 82 36 de f9 b4 +97 5e 25 49 57 3f 60 ad b5 e8 61 b7 c3 b2 df eb +81 0d 13 e2 97 a6 cd 3f 2a fe cb 0e 4f 14 7c + +# Encryption: +00 93 3c 58 a5 0c 70 15 0d a0 82 3a 7c 1e 36 7d +36 e5 21 3f 66 a3 00 50 fd ed 72 d5 75 5b 5f 9c +24 05 0b 41 14 f5 35 09 98 8b 62 54 20 cf d0 0a +c1 c8 cd 84 48 9c a2 6b 74 3f b4 7d 1b 64 d0 a8 +80 8e e3 21 27 c7 71 22 4a 0d d5 a5 64 e6 36 ad +d7 3b cf f7 b4 73 e9 a1 2b 7d 46 4d 7d d4 a7 52 +04 86 61 a8 b0 74 b9 fa 15 06 fe f6 03 dd 96 d1 +19 96 a7 d9 e7 48 79 f9 9b b2 d9 1c 37 aa b1 35 +72 + +# PKCS#1 v1.5 Encryption Example 7.6 +# ---------------------------------- + +# Message: +dc 28 5a 26 39 59 39 e7 99 72 04 c7 1a 93 2f 79 +5b 4d e4 01 e9 6f 34 e1 89 36 32 37 e9 cf da dc +61 + +# Seed: +d8 0b fc c2 91 ce 51 8c e0 bb 6a e9 34 df d8 56 +58 b2 39 fb 45 39 cb e0 5d a1 26 a8 98 b7 f3 64 +88 7c 0d df b1 ea ea 1d 5a 90 de 76 95 66 5c 55 +82 2a 11 72 cb 5b e8 a1 12 d2 8c 86 02 c5 13 be +48 c2 92 f0 59 72 e6 71 1a 44 cb c7 28 17 15 09 +4b 49 0f de 29 16 5a 6b 6b 7d 99 db ed + +# Encryption: +01 57 e7 b5 4a 34 1b 8d f8 bd 9b 99 fc 2e 6c 58 +d8 86 fc 79 e7 44 2a 9e 76 d0 d6 7e 48 58 c4 ab +f0 ed 25 c3 3d f6 2e 2a ad a3 99 df ea dc 7f f6 +89 28 e6 b9 00 71 02 dd f8 09 f5 90 8e ef c1 0f +2a 73 71 06 09 23 1f 5d 45 e0 0a dd a1 34 b6 02 +dd 0e ee 0f 67 22 49 4b 7e 4f 7b 40 57 72 c8 31 +b6 37 29 be 0f 1c 4b 6d 2a 54 2c 15 65 c7 df 23 +1d 9e 89 2e 58 6a 18 ec 54 37 73 76 db 77 f8 13 +84 + +# PKCS#1 v1.5 Encryption Example 7.7 +# ---------------------------------- + +# Message: +46 47 d8 41 c5 a0 b9 97 3a 91 45 4d d1 a0 5e c0 +e5 75 03 ed 99 67 2a c0 02 df ee 77 7f 7f a5 06 +fb 41 b2 ec 8b 8d 2c db 9b ef 01 33 bd 5e 3a 7d +0c 43 44 b2 8f a8 db + +# Seed: +f5 27 a1 4e 2e 06 e7 3f 1c 24 5d 19 0d 02 cc ed +01 1e 46 84 87 ac fa 5e 0b ce 39 78 6b 46 a9 a8 +c7 51 a8 b4 40 6c cf a1 fc 5b 7a b9 ba da 7b 4a +d4 52 46 7e 50 b7 fc 41 31 8e dc 73 dc 2d 84 a2 +8a 08 1f a1 79 05 bc + +# Encryption: +00 4e 03 ca a9 48 1d 7f 96 78 20 7c 17 b6 82 2a +5f 69 17 ed 01 eb 40 2e 7f 23 01 35 a1 23 cd 9b +6d e3 be c3 b9 bf 33 8a de f8 07 6f b7 65 2f c7 +e3 a3 73 fc 16 22 f1 dc 67 9d 41 5c 32 00 02 6d +8a 8a 50 f8 db 6a 58 3f 66 69 29 d0 31 8e bf 91 +d9 59 12 fc 06 10 2d 9b e8 75 25 a7 36 b5 af 21 +e1 6d e3 ef aa 66 e9 cf 41 ca 73 48 23 23 dd e8 +0e ec 30 85 81 a4 4c a3 aa bf 76 dd 48 1d e6 52 +9a + +# PKCS#1 v1.5 Encryption Example 7.8 +# ---------------------------------- + +# Message: +ba 10 d4 7a 9f 62 42 81 + +# Seed: +37 9f dc fa 5d 8c 61 37 c3 6b ad 14 3f d9 b1 f7 +e8 94 fa 0e 9a c0 fb 9c ec 60 e8 6c 82 53 97 5d +8e 78 74 21 08 49 5e 59 4a d0 89 8f d0 4c 91 e4 +01 e7 c8 80 89 a8 7b 4a 4a 82 e8 34 cd 37 77 a7 +d3 f8 0e 64 86 81 2d 4a b0 d3 37 23 16 2b cb c7 +e0 81 a9 9d 3f 9b 5c 3b a4 4b 19 bd f8 84 a4 62 +6f d7 de f7 67 40 57 be a0 82 e0 0d b4 b7 61 ad +75 3a b5 98 5a 94 + +# Encryption: +00 c4 96 5e 29 63 d7 bc 5b 10 44 d8 fc 75 eb 33 +82 ce dd 99 07 41 97 92 ef c8 8c 92 b1 d5 c3 90 +fa b1 90 01 1c 51 8a c9 ce 45 c1 b8 e7 27 6b ff +c7 c7 e0 5c 25 37 08 91 37 a9 8d f6 e0 c6 92 02 +0e d6 54 af 83 33 9b ab 11 92 71 77 f2 f5 23 22 +6b 4f e6 4b 99 c1 72 9f 6c 92 29 06 bc 16 d3 1f +0c 94 dc 2e a4 13 81 0d 55 94 0c 97 af dd 48 29 +fb f1 61 8a 8c 9d e8 9d c2 40 06 e7 e4 21 a5 8d +38 + +# PKCS#1 v1.5 Encryption Example 7.9 +# ---------------------------------- + +# Message: +ef c7 48 9f ec 77 9e 05 2e 37 9c 1a d9 04 59 03 +b6 84 2a 9c a4 1b 48 bd dc e5 80 80 a5 ed ec 63 +f3 6e e1 15 60 fd + +# Seed: +c8 ec ba 62 72 14 c4 14 d7 c3 fd d3 16 c2 d8 2a +98 53 57 28 b9 a9 37 6f 69 a9 53 d7 cd 1c ea d7 +10 53 db e0 14 0c 7f 02 bd 71 e0 13 7f ea 29 cd +4c 21 a5 8b de c6 66 40 99 0d 28 c1 0b 70 17 59 +3c 1d 11 fe 9a be bd 71 24 e1 d9 85 63 1e 94 e9 +e5 12 41 26 0f 9e f1 f1 + +# Encryption: +00 32 18 4e f2 88 fa 0a aa 0c 2c 1a 19 e7 c2 9f +81 c7 01 2f 45 29 eb 9e eb 53 68 1f 62 47 f8 d4 +35 69 13 45 a5 14 8a 2c 87 7b 2b 18 92 6b ae 9d +e5 b3 17 ba c0 e9 02 c9 60 25 ee c2 f9 ea bd 0f +9e 88 86 ef 95 19 c8 24 9f eb 83 46 65 c1 01 0d +b7 62 4f 48 7e 16 1f 89 f6 ae 00 18 c1 f4 e0 ab +54 72 f7 f0 99 35 61 cd 59 85 f3 83 d0 49 dd 83 +2b 82 c8 37 48 b2 28 1b fb 99 d9 d5 00 8d c8 07 +de + +# PKCS#1 v1.5 Encryption Example 7.10 +# ---------------------------------- + +# Message: +5b 26 4f f8 8d ef d3 c2 99 99 3d 81 12 9a 6e 5d +d2 b5 7b + +# Seed: +0b e7 ab 5b 29 70 48 43 c1 c0 d7 e4 ef 5e 93 f3 +ba 71 7d b7 81 5a f5 72 e3 a9 ab 3f 99 b1 ac 9a +22 b9 2d 9b 43 da 2b 99 65 c7 97 70 57 17 3c 03 +57 3f 32 48 0a 92 70 19 af ff 0e 0e 34 e4 09 5e +4a 4d 39 2d cd 1b d9 f2 7d 32 fd e7 15 9f 02 3c +83 08 9e 88 a7 1f 24 33 64 8e f8 c8 40 45 b9 c3 +6d 8e 5f 6e ff 03 4b 91 b7 02 34 + +# Encryption: +00 4c 65 29 35 56 f2 fd 15 ab 90 eb 22 e0 75 33 +b3 dc 17 33 4f 5e ed 27 a3 99 31 80 c5 6c 8e 3d +8f 51 ee b2 75 95 f8 78 d2 36 65 ba 3a b0 e7 28 +a5 ae f7 23 4f 60 36 b0 23 f8 71 c2 d6 55 2a 18 +ad 5a 25 be c5 5b c7 6b ee 63 83 46 12 81 d3 9a +30 f6 d6 60 92 e0 cf f6 92 32 68 fc 04 3c df 74 +7e 8d 54 89 50 4e 7d b3 0a 7b d9 1a 2b fc 6c 1b +34 14 40 57 01 75 3d 5b 85 ff 73 52 01 2d 55 e9 +23 + +# PKCS#1 v1.5 Encryption Example 7.11 +# ---------------------------------- + +# Message: +72 e2 09 00 e5 bc c2 3c f8 79 ed 35 31 88 9a 1e +d5 aa 3d 5c 79 2e 34 e3 b1 26 90 d9 ac 24 03 d0 +f6 f7 8f 59 23 + +# Seed: +11 62 75 e9 be 1b d4 e6 f2 03 ff e4 f0 ab 9a 32 +73 84 10 e9 23 e8 39 71 ee 9a 6b 99 2c 65 0a 03 +1f 94 0f 6e f3 3d 61 50 df f8 b3 9d cf 22 50 d5 +66 5c 04 27 3b 2b e2 de c9 97 12 bb c0 12 f7 5a +31 b3 0b a0 6f f9 eb e3 b8 9f 58 a6 8f 26 85 e3 +38 ff 6c b8 d4 18 1a 8a 14 + +# Encryption: +00 21 4a 83 be 45 3a 75 bc da 94 33 a7 b9 51 43 +34 39 98 30 72 07 1c c8 21 12 b7 77 42 be 0c 38 +22 6c a3 c6 f3 8d 55 b9 ca 3f 08 c8 79 37 89 79 +6e 6c de 67 37 6d 67 3f 5e c5 7d ac c3 74 c4 c3 +17 34 44 dd 8a 63 76 de 8f 9d dc 31 a4 c0 60 d7 +72 f0 2e b7 49 51 2d cd 04 02 31 17 5d 0b 69 42 +a9 47 b2 c8 2f 7c 19 e2 ce 87 50 00 af 84 27 4c +be 2a db f2 fb fb 53 7c cb e2 fb d0 72 87 13 78 +75 + +# PKCS#1 v1.5 Encryption Example 7.12 +# ---------------------------------- + +# Message: +16 b1 10 e2 90 9b 11 b0 cf 36 b0 52 c6 f3 93 6a +2c a1 3f c3 a5 + +# Seed: +c2 bf 9e 4f b1 ed 70 ca 21 2d 15 ee 8e b3 cd 66 +0e b6 5c 52 78 e0 3a 3b 10 eb 12 b2 53 34 a4 72 +8b 94 99 20 12 2f b9 92 bf 2c e4 30 10 3d 74 ab +74 e6 d6 e7 62 b8 5d 6e f9 be b7 d7 25 98 f2 93 +a4 35 62 e9 06 89 54 11 11 51 1d 31 4a 9c 46 02 +23 76 ad 05 5d 54 ce d6 ac 1f 36 e9 8c 2b 25 a0 +ac de 64 dc f6 52 2c 3d 22 + +# Encryption: +01 6a a9 5a 08 23 82 c1 0c 04 53 10 fe fe cc 8d +17 db f2 16 d8 ed c0 4b da cd 4f 52 4d e4 85 b7 +fe 8a 26 f1 4c ab d2 97 e7 f0 3b 3c 85 08 6a 16 +14 7d 5f 61 93 91 9b b9 5a 53 c1 46 c7 84 c0 0b +53 32 e0 18 f6 43 cf 95 87 24 cd 08 07 5e b6 4c +a5 68 0c 27 c7 05 d4 0d 88 b9 d7 f4 26 b7 36 e3 +c5 f6 39 4e a6 83 b6 5c 23 73 a6 fc eb 14 f2 ea +85 1c a8 e0 00 e2 4d c8 f7 e7 c8 1b 1d 4e 72 0c +36 + +# PKCS#1 v1.5 Encryption Example 7.13 +# ---------------------------------- + +# Message: +3c 86 0a 28 fa e8 da 2a c0 d9 a3 39 89 97 7f fa +04 + +# Seed: +7c 96 99 90 6c 9f 16 65 12 5c 0b 10 67 3f 3d ad +98 c9 1a 4f f0 fa aa 64 7d b5 54 fd 62 27 ef 50 +90 9c 97 b7 06 09 2b e2 10 db 2c 24 ba 9e 8e 6a +87 f9 dd d9 f3 f4 91 29 10 29 ac 6e e4 6e 08 d0 +d7 a5 3c 46 2d b4 f0 fd 1c c2 3e c8 f5 5e da 07 +f4 ca 0d 3e 3c d3 76 22 85 5b 4d b0 8f 64 be 3e +26 c3 e9 78 75 17 12 94 ea df 86 fc d6 + +# Encryption: +01 0c 1e 04 a8 58 c6 15 ee 96 95 f6 4a b2 db 99 +80 6d a4 82 d2 b4 60 29 3c 46 dc 7b 71 7a 59 76 +a3 c7 e3 6d 8d 47 a8 4a 34 d6 3c df ca 2c 1e 38 +45 25 73 ed 44 c3 a0 40 40 5e cf 3f bf 36 83 41 +c4 a1 fc 90 83 a8 f5 52 93 67 b9 9c b8 9f c5 a0 +8b 8f 34 75 a0 d5 5e 3e 42 cc cb eb 20 d0 4a 19 +97 ee da 4e 3c c9 e9 92 d2 37 ec 7d 32 fe 25 84 +5a b0 24 d5 88 28 05 ed 52 f1 0e d7 d2 5d 62 d0 +af + +# PKCS#1 v1.5 Encryption Example 7.14 +# ---------------------------------- + +# Message: +4e df 4a d3 44 0f 17 b1 0d 26 af cd f4 e4 44 d2 +aa 61 a1 97 55 a6 21 07 98 3f 01 22 fb 2a + +# Seed: +e0 20 09 39 39 b4 18 9e 93 4c b6 2d 27 ca 5e 97 +19 65 2c 13 7f c4 9e 72 1c 4a b9 e9 f3 98 b0 a6 +12 de 8a 8a 89 99 af 0d bc 1c ea 0b 61 63 da 42 +61 23 28 14 ed 92 eb 21 60 cf 4b 26 d0 55 1b 1b +dd 91 9d 49 47 93 78 6e 1b 86 f7 9d 64 16 61 2a +28 22 61 36 3d 6c 9b 7a 0d 92 ad 17 58 ea ad 51 + +# Encryption: +00 8c f9 b3 f3 e7 60 90 d1 01 17 4e cd 97 d1 0b +ff 6d e4 d4 64 40 00 3f c0 d4 28 f1 9b 85 58 f3 +13 74 a5 fa 28 3d 03 d4 dd 43 f9 3a 4d 9f 14 ca +00 68 dc 2c f3 e2 54 37 b0 5a b1 d4 06 21 ee bd +84 16 f5 82 8a e7 c6 cf d2 97 b4 51 8f 79 94 2b +91 43 23 28 4e 29 76 a5 4d 3c d9 11 63 3a 30 7e +da f1 ed b6 74 98 46 6b 3e 98 91 6f 99 04 f4 a0 +ea 9b 87 a9 83 44 f0 73 83 3e df 9b 2b 53 94 cf +d7 + +# PKCS#1 v1.5 Encryption Example 7.15 +# ---------------------------------- + +# Message: +8a 6d 53 b0 ad a1 85 4e 23 13 69 1a ab 23 06 3d +e1 31 bc 36 c7 64 + +# Seed: +26 85 45 8a eb fb d6 07 4e be b0 fc 0c c4 92 1c +27 3e 8c 0a 88 15 51 50 2e 4c 29 9f 33 4d d5 67 +f5 16 75 b0 ff 30 f2 c4 82 63 20 03 64 99 66 99 +f9 b1 72 af fe c0 e7 9e 5c 52 3d 1e 77 9e c0 6d +ec d4 76 a5 74 30 78 1e 2d c8 1f 25 d6 0d 3a 73 +97 65 79 a2 f0 1f 07 58 4c f8 e5 fb 3e bd 8d 5a +93 2d 57 aa 8a 18 0a aa + +# Encryption: +01 3a 3d 32 ee c7 35 eb da 13 f8 be 76 02 a0 47 +5c f3 cf 28 5b 42 86 ad 93 d6 12 c3 ad 91 72 48 +80 9d 1c 4c 18 0b 36 70 15 cc 66 c4 d8 e7 86 73 +84 16 8c f4 cb 71 9b d5 93 35 53 55 cd d7 d7 53 +0c 80 c8 67 74 5f 96 61 c6 c3 3b cb 97 f2 cf 75 +a4 c2 7c 3c bb db be 7e af 4f 82 34 f2 12 e3 05 +82 56 d4 43 9a 9f 97 81 df 48 ef db 02 35 68 f9 +4a e4 59 46 54 a0 f9 ba f6 ea 30 b7 d8 d9 48 0a +d3 + +# PKCS#1 v1.5 Encryption Example 7.16 +# ---------------------------------- + +# Message: +20 f0 20 44 e6 3a c9 2e b9 fa f1 a0 ce 35 ba 72 +09 + +# Seed: +2d e1 fc c1 17 f8 21 f1 de a7 94 b5 ee b3 13 f4 +29 e0 0b 97 6b 53 41 9d 3d 03 ec aa 1b 50 76 88 +77 e8 b7 fb d6 c3 63 04 7e 15 c2 55 79 3b 3c be +0f 58 84 f0 a5 11 25 4d 31 bf b2 37 41 02 3c 1f +88 1f e0 16 a1 2e ef 1b 8a f2 2b 93 68 20 7e 7b +16 39 f7 27 1d eb e3 c8 df 52 93 ee c3 a0 32 f1 +ce 55 9c 0a 04 77 1b bf 88 98 94 7c a4 + +# Encryption: +01 70 06 e8 6f 6c 58 58 fe 5a de 0d cb fa 9c cd +11 c0 2d 4e 7d 0d e6 c1 58 ad f9 ee f1 01 07 e7 +a4 c3 6b d3 d9 29 ea 6a 47 6e cf a0 b6 ec d0 51 +49 b5 12 15 95 48 93 a1 ab 26 69 c0 42 da 83 e8 +c8 18 b0 0a e7 34 de 5f 9e 0b 97 ba 1f e3 e9 c4 +6a e9 81 6b 63 b1 5c 2d cc 61 cb 3b 8b 2c 23 dd +b9 9f cd 54 e9 55 60 91 8b 9a 0f a3 c4 b6 27 3d +1b 28 a2 13 e1 20 b4 f2 42 86 96 5e be e9 4f f8 +96 + +# PKCS#1 v1.5 Encryption Example 7.17 +# ---------------------------------- + +# Message: +d3 88 3b + +# Seed: +5c a3 bb f9 92 d7 ae 35 94 c6 05 c3 9c 3e 97 90 +25 cc b0 a3 5c 6e f0 fa 57 4a 98 be 05 ef 7c 32 +8a 19 a2 77 5b a0 6f 2d d1 e0 ff 6f 0f 1f 6a 3b +20 fb da 21 62 d0 92 4f f5 5b 70 eb fe 2b 16 d4 +ff 6a ef 8d 47 eb e5 96 38 e5 81 0f fd b5 8d b0 +5f 4d 9b 4a 3a 42 3f 96 7f e5 79 f8 73 78 36 9d +5c 5c 07 e5 e3 cb 5d dd f3 89 62 11 80 27 0a 21 +e0 10 78 c8 9a fb ab 18 9e 87 f7 + +# Encryption: +01 6f 55 05 f7 4f f1 10 4d a1 f8 a5 2e 50 bf e2 +9c 99 87 10 c5 7d e4 40 98 a9 57 9e 7a 33 13 b6 +29 60 31 02 f0 8d 2d 91 1f 91 7a 9c 96 62 60 8c +97 a1 ea 37 17 34 f6 7c bf 70 03 d9 3c 4c 31 4c +3a 0e 77 f3 65 8f a4 d0 72 25 62 c4 e1 3e 85 a7 +c8 d0 d9 d4 fb f7 12 58 84 ba 62 ad 28 59 b4 d9 +61 36 f7 a2 45 54 69 ce b6 0b 63 ba 84 74 e6 16 +0c 83 17 92 1a 07 b4 b6 43 6f 37 6c 5f 98 25 7b +17 + +# PKCS#1 v1.5 Encryption Example 7.18 +# ---------------------------------- + +# Message: +06 a2 ae 82 a4 85 32 07 c9 f9 75 + +# Seed: +e2 c3 36 33 d5 47 54 ad dd 24 c8 5c 32 d2 8a d8 +70 f1 60 3d 44 44 60 a0 3a ac ad 7d cb 80 96 01 +56 bb b2 59 ca d3 46 be 90 c0 d4 f3 fb 18 ac 6e +9d 5a 9a e2 a5 ab 98 a1 f8 4b 8e 70 c7 1d 0c cc +0a 1a 2a a3 99 70 d9 c8 3b 4b 0c 25 ae a4 3a 5a +5d ea df 9d c6 11 b9 6d 11 33 4e f9 43 09 03 89 +a8 d3 c6 6c f3 18 77 aa 2c df f1 11 99 43 27 8a +dd ff 5e + +# Encryption: +01 22 41 0e 76 5b 2c 9e 90 bd ac bc ff 1b ca 8a +e6 4b e9 9c f0 13 29 74 85 72 17 68 37 0c 36 f8 +c0 d9 db 8d 79 37 62 54 b9 c6 91 52 72 0e 05 ca +ef d4 ce 7e ae 08 b3 df e3 ea a9 1c 46 02 ef f3 +8e 4d 81 bc d3 78 7a 14 d6 22 db b7 9c e8 64 4c +4f d1 d2 e4 1f 7c 1c 97 27 96 11 74 0f c5 00 00 +31 78 b3 7b bd 81 c5 a5 82 9b 5c 14 bf 45 9c 42 +38 b0 3b ee f7 3e 49 8f 86 5f 6c a7 9a 9e d6 0f +65 + +# PKCS#1 v1.5 Encryption Example 7.19 +# ---------------------------------- + +# Message: +ad 8b 11 a9 27 de + +# Seed: +5e ca cf f6 3a 79 38 e9 98 06 8a 2f 4b a6 bc c1 +02 0e 1f 28 c7 34 e4 34 e8 86 3c 48 e6 df fa e2 +8d 18 52 72 7f fa 7f 2e fa 3d e7 01 3b 81 2a 02 +b2 17 1a 0f 94 0b 36 d9 28 db db 96 0a 6b 22 03 +0c 89 37 89 cb fd ea 97 35 e9 ad 10 94 a6 84 61 +c2 eb 6f 71 8b e4 74 d9 3a 51 93 0e 3c da 02 c2 +1f 63 63 91 4e 7e da 54 84 03 7a 76 ad c5 33 12 +eb 9d bb e4 5e 23 a1 4b + +# Encryption: +01 1f a4 3f 5f 4f bb 98 30 11 81 4d 4a f5 45 52 +1d f0 b5 9e 9b 6f fd 71 33 3b 8f 9b ba aa 0f cd +c1 42 1c e4 bf 31 bf 99 59 fd c6 b0 9b 4f 42 51 +dd ee e8 21 0f c3 a5 2f e7 c7 1a 87 6e 6d de 1d +fb 59 a4 da b2 7d 34 fd ce 5b bf c6 ed 62 3e 89 +96 7f b6 fe 73 16 20 15 28 2c 5f 45 01 38 f2 50 +4a b6 1c 1f 12 d2 64 9d 81 5d 6e 81 38 43 8f 8a +80 46 c4 e8 40 cb 71 85 98 e1 e4 a9 fc 25 a9 45 +64 + +# PKCS#1 v1.5 Encryption Example 7.20 +# ---------------------------------- + +# Message: +be e2 94 36 c2 a0 de 16 f6 60 42 91 70 07 fb 51 +30 f3 c1 aa 7d f2 c7 c3 bd 99 fb c1 b4 13 af 4f +96 a6 5b 0e 54 3e c6 a5 0b e8 3a 9f + +# Seed: +23 91 a6 84 25 dd 8f 0b 83 c9 b3 61 24 67 a7 79 +cf 92 f5 ff 96 11 c0 14 93 bc be f8 65 e1 5b ba +5e 8f cf 74 be b9 ea 25 73 a9 fc e5 41 64 d0 6b +aa 8b 6d f3 67 cc 4c 6a 11 4a a0 34 6c 45 4a 2a +9e 60 53 59 18 d3 66 0c 66 48 4e d9 53 72 7a 9c +9a 25 + +# Encryption: +00 98 9d db d2 8d 60 95 ad a6 88 1e 28 34 1c e7 +a0 a1 ca 6b f7 f3 1f 77 2f 91 04 93 af db a2 d6 +35 9d 50 b9 83 3f 83 d0 ab 87 13 ab e8 e2 10 2a +27 ab 2a 60 1f b7 7b 9a 25 d6 a0 af f4 0c fd cf +9e 12 c4 28 43 eb ad 32 83 24 a7 19 f2 9e 8d 79 +ea 9e 5d 0d 98 86 95 73 60 34 db 5f ea 73 dd 36 +00 13 6f 57 a3 98 fe 35 2b 27 8c 60 cb 74 ec 98 +ad 57 a3 e1 d8 c4 47 8c a6 17 9f 4d 04 26 f0 f4 +20 + +# ============================================= + +# Example 8: A 1026-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +02 52 e9 5b b1 1b a1 e1 c7 c9 5b 68 53 f8 de 0b +fe 2b 64 03 ac 1b de 81 9d 91 89 07 74 7b 01 99 +fa db 80 59 c2 5a af 1a c5 65 a7 49 29 d0 15 a2 +01 f8 97 a9 ba fe 75 41 68 95 5b 35 5b b0 09 ce +16 14 93 12 28 3c 39 ce e2 20 d0 f0 85 8b 13 81 +2e 86 a7 d4 e5 38 8b 7e ae 5a ca 7c 88 6a 76 d3 +b1 e6 dd 67 92 68 a8 23 11 e2 82 03 18 cb 8f 0f +7e 85 f0 e6 69 2e b0 de df 30 88 1c af 73 15 d2 +7d + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +02 52 e9 5b b1 1b a1 e1 c7 c9 5b 68 53 f8 de 0b +fe 2b 64 03 ac 1b de 81 9d 91 89 07 74 7b 01 99 +fa db 80 59 c2 5a af 1a c5 65 a7 49 29 d0 15 a2 +01 f8 97 a9 ba fe 75 41 68 95 5b 35 5b b0 09 ce +16 14 93 12 28 3c 39 ce e2 20 d0 f0 85 8b 13 81 +2e 86 a7 d4 e5 38 8b 7e ae 5a ca 7c 88 6a 76 d3 +b1 e6 dd 67 92 68 a8 23 11 e2 82 03 18 cb 8f 0f +7e 85 f0 e6 69 2e b0 de df 30 88 1c af 73 15 d2 +7d + +# Public exponent: +01 00 01 + +# Exponent: +01 04 c8 5f d5 d8 d7 93 2a 29 85 c4 cb 7e 9e 13 +a2 c4 f1 90 3c 8b 70 f3 df 97 12 fa ee 20 17 b9 +20 82 c5 16 53 c0 bd de 9d e6 6c 39 01 b7 c2 2b +e4 f2 4c c5 6d ff aa 75 d4 3b 18 a2 e0 c0 df e3 +72 6b 19 8c aa 0c 96 65 26 3a 93 79 6a 27 d3 29 +84 46 5f 4b 4a ff ca 0d 92 f4 e5 1a 37 e4 1a b1 +55 07 66 d5 ca 7e 90 d4 de 90 9b bd 79 4e 8b c5 +2b 74 99 a7 3e 46 8a b4 42 13 cb 3a 3b 54 52 d2 +ff + +# Prime 1: +01 93 3f 8f 85 82 b8 ff f3 e6 bd 30 42 81 97 f0 +ac ec 63 e6 91 f7 9b 91 fb d4 d4 c4 94 2b 8a e9 +13 a4 01 f0 e1 7b a7 66 d0 a8 ee ec 4c b0 e3 da +17 b6 d9 1f 1a 74 24 88 09 20 1e 37 30 15 18 61 +8f + +# Prime 2: +01 79 ad 28 3c ac 68 af 21 6a 06 86 f4 38 b1 e0 +e5 c3 6b 95 5f 74 e1 07 f3 9c 0d dd cc 99 0a d5 +73 dc 48 a9 73 23 5b 6d 82 54 36 18 f2 e9 55 10 +5d 8c 4a 5f 49 14 be e2 5d e3 c6 93 41 de 07 ed +33 + +# Prime exponent 1: +01 6e f5 3d 6f 3a d9 8d 9a 6f d4 a4 71 31 2b 8a +8a 62 88 3a cf 84 6b 5e fa b3 e0 77 8f 7a dc 6b +64 43 30 bc fb 04 a2 ff 0e 4d 5d 37 4e 46 fe e2 +7e 08 18 27 94 d4 32 56 55 2f 94 2f 96 a2 eb d0 +03 + +# Prime exponent 2: +e6 c6 e6 25 5c fc 82 b7 1a 40 6e ca 60 b2 60 c8 +45 07 42 39 18 04 41 85 9c 3f e4 de 16 4e 46 6c +0b 98 e2 e2 16 22 d1 e1 a7 6f 7f 03 3f 8c d8 f9 +30 b6 69 4f 10 bc 2b 3a 4f ea 91 24 d8 75 63 7d + +# Coefficient: +35 42 45 2e 83 2c 16 ac f9 c3 f4 13 49 23 5e dd +d2 75 c7 05 3c 55 3b f8 9e 1a 84 57 12 48 33 3a +ad 52 0e 3a 34 46 c4 c5 e3 fd d9 ba ec d9 29 48 +0e b5 b8 fb ef 8e 03 ad e9 e3 9a 28 fd 8e 75 6c + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 8.1 +# ---------------------------------- + +# Message: +f7 26 37 ae c2 8d 2b 6e bf 8f 73 d7 48 75 df 01 +cd 12 24 8f 00 20 60 8e 61 c7 3d 1a 01 f9 72 f7 +4d ee + +# Seed: +cc 20 77 a2 40 01 f3 e3 86 96 94 e4 fe 27 72 bf +93 8f 76 27 66 7b 62 d5 90 f9 ee 4f cf ff bb b4 +7a fd 5f ed 6a 18 08 44 a9 12 1a 32 ed 7c bc 56 +cd 28 70 a2 d6 96 b9 43 d6 fd e9 76 7c 1b 96 48 +61 6c 32 ed 6c 40 0d 42 3d d4 ab 72 16 af ad a0 +28 40 2e b2 a1 c3 eb cc 24 5a fc 7f + +# Encryption: +00 72 57 5d 3b 11 c5 ff d6 ae 24 f3 53 ff 74 99 +27 b4 ae 5d f4 63 f7 0c 5f 3e f5 49 6b 0d 14 5e +b2 b8 a5 3c 28 d5 3e fe 8b f9 f2 7b 2e f4 ce ea +48 31 05 77 c3 d2 b4 b9 49 a1 2e 3d f3 f5 67 76 +82 88 18 45 2d 81 bd 45 af 15 8c 87 bb 57 74 5b +8a 10 fc 1a 92 a0 ea 55 c8 51 39 f8 42 f7 3f 1d +61 3b 9a 96 4a f8 ed 72 0d 0e 08 47 f7 ae 5b 30 +5c 05 f1 2c bc 4c 9c 16 84 ac f9 02 97 0d 82 09 +49 + +# PKCS#1 v1.5 Encryption Example 8.2 +# ---------------------------------- + +# Message: +2a 8e 3e e7 ea c6 b2 2e c6 58 ad 44 d6 66 c8 cd +3f 57 ec ea 29 9b 5c b7 bf 9a 37 3d fa 66 97 2f +13 e5 f3 a3 00 e8 0e 6d bf 74 15 68 0d 0d 24 90 +1a d6 b1 40 b0 00 aa b8 53 51 f9 2f + +# Seed: +fb 19 20 9d 8a 29 af af bc 05 3a c1 f3 20 ba 60 +fc 1f e1 04 aa 78 39 c8 4c 9b 3e aa 18 a8 f9 43 +bb 21 9f 59 cc 16 7a 38 4b ac 7b d3 65 82 4e 10 +36 31 b9 7b b9 a6 d1 18 f4 f0 a9 51 fa 47 8a 05 +ea 09 + +# Encryption: +02 1b 54 64 65 71 a9 a9 3f 0b 0a 03 82 e5 40 a8 +c3 97 4c b3 1c 87 eb f1 7b 3b a6 2a 1c 95 21 c5 +0d 7f 90 70 2e 13 ae 0e 22 26 38 34 e7 64 60 35 +15 94 45 a0 87 7d 9a 4f 5b 16 17 7f 7f e0 52 bb +d0 23 d0 81 89 4f 2d 97 ca c2 45 20 76 ca 11 91 +a1 71 a4 8f a1 cb bb c3 f0 f6 f3 bc 1a 44 78 40 +3a 5a 48 8f eb b3 a4 13 80 16 3d 94 2c 97 7b b8 +ec d2 86 6c 5f 5d 91 9e d2 0c 0d b3 ee 31 ef 2f +51 + +# PKCS#1 v1.5 Encryption Example 8.3 +# ---------------------------------- + +# Message: +d9 9b 4f 10 d9 f3 2e 12 ec fa e2 63 0b 22 ac 02 +6a f9 64 b9 c7 15 d2 07 + +# Seed: +e0 af 8b 7e ab 36 a6 ee 31 6d 78 13 67 f0 9e a1 +1e 31 fd c1 ef 2c f9 c9 7c 37 9e aa cf 68 72 a8 +21 3c be 4c e2 e2 9c 77 8b 35 95 40 10 06 3f 17 +76 ab 5b 17 2d a6 24 b4 06 a1 c5 8e 0b 57 4a 03 +b1 b1 b2 cd 7d 3a 9e 50 35 a9 a9 73 05 8f 04 97 +65 2d 2f 73 b1 dc 8f 48 7c 09 cf e7 1d 8f f8 f1 +45 8c 79 0e e0 c5 + +# Encryption: +01 02 3b be 85 57 c2 63 0a 26 22 46 db 7a bc 54 +03 43 88 70 38 f6 4c 64 1f d7 4e e8 74 ae 96 70 +fb 28 62 d4 24 70 3d a2 0b e4 f4 8b 23 9c d0 60 +43 81 9d 8f 61 51 44 e2 b1 f0 0c 8f 88 49 2e 62 +f6 e0 73 16 f8 49 05 35 3b 0b 18 80 ed 77 da 2b +62 d3 a9 3b b7 0f f6 a5 00 79 38 b9 73 b4 cd 5a +bf ee 0c f1 3f 5d 4a b2 16 01 02 68 5c ac 80 81 +83 4f 95 55 80 6b b3 22 d0 dc 5b 8a 2b f1 28 45 +62 + +# PKCS#1 v1.5 Encryption Example 8.4 +# ---------------------------------- + +# Message: +ca ec a8 e5 9b 81 0c f7 51 12 f7 ed 04 7a 46 69 +2c a0 b7 a8 6e 18 41 d7 19 + +# Seed: +76 1f 68 64 dc eb c9 5a 77 9b c0 b1 6a 95 86 6c +33 dc 8d ca ce 61 cd 7b f9 01 72 d9 9a a4 57 db +6d 90 88 7d 84 c4 73 8d 25 cd f0 e8 95 69 ae 47 +d3 07 3e c4 46 ee ed d5 2d 57 20 8b db 69 45 57 +03 46 57 a7 03 78 49 37 ba 69 4d 42 51 21 38 53 +2b 8a d1 d9 86 fe 47 31 8b 28 23 de 82 ce 27 6f +a6 f0 d3 c8 ef + +# Encryption: +01 1c 0c 03 f7 b6 e1 c1 a8 41 17 40 a6 e5 b4 73 +c2 8d 62 21 17 6c 9d 4f 68 02 4c a5 7c da 27 3a +f5 54 74 03 60 99 0a 1b 74 de 34 bc ea 10 3c 2d +0c 36 57 60 02 08 0b 30 bd 28 f0 76 fb 75 fc 9b +eb 9e 05 d1 98 9a 31 1d 12 c1 f2 8f d6 93 92 ad +4b e5 2c e3 89 de c1 1e ba 94 6b e0 59 91 da 7f +d8 87 a8 d8 76 8d e7 36 b9 05 bf 4b db e8 8b 85 +df c3 b2 5a ea 30 fe 90 df 1d 22 d8 a8 d6 15 65 +1c + +# PKCS#1 v1.5 Encryption Example 8.5 +# ---------------------------------- + +# Message: +10 12 12 85 6e 60 cd 27 2f b1 69 cf 62 cf 47 f1 +bc 50 ef 9f 1f cf d2 14 81 6c 80 7f 18 4a 90 3f +16 f0 e8 09 ac f5 e0 + +# Seed: +60 43 c8 df 6a 7f 4a b8 3e 31 97 e8 cd 02 25 dc +38 66 b5 d8 e6 99 3c 2c c5 b8 76 35 1e e3 3c 71 +c1 a4 cc dc e4 5f 3e 9d c7 b7 e5 1b 52 ee be 0e +27 0e 71 62 07 ca 14 03 e1 3e 72 3c e7 3f 10 45 +5e db de 85 b0 82 90 52 ed af e5 6e 9a 22 02 4d +40 68 37 1d 36 c9 1f + +# Encryption: +00 05 c5 cf f8 9b 93 3d 8b 65 23 b3 59 06 bb 3a +71 1a 0f 7f 50 3f 92 14 74 66 59 85 03 91 27 30 +3b 00 11 e7 a4 2b 41 c3 3b d2 0d b3 1b 15 60 c9 +b5 22 20 89 cd cf 53 b8 2c 95 f8 c1 ad cd 8b 78 +3f d4 b4 8a 45 40 20 66 8e 0b 62 52 0e 52 58 52 +09 db 52 9f 38 70 86 49 d8 e0 64 89 0b 22 8f b3 +c1 98 1b 2a ef 3a 54 65 ce b1 30 21 eb e0 8d 02 +e3 3a a2 dc 3c 39 28 4e f7 a8 58 dc ce b2 8f fa +28 + +# PKCS#1 v1.5 Encryption Example 8.6 +# ---------------------------------- + +# Message: +6f 03 b5 72 52 30 de 7f 99 63 69 8e db 79 75 ec +e8 + +# Seed: +a3 0e e5 ae ab 59 31 03 3e fb 70 af bc 2d 3d 11 +a6 33 84 cb 8c b3 3a 8f ca e6 14 66 84 e6 3f 0c +c3 2e 89 a7 e4 ea 43 32 7b f0 35 66 95 43 19 28 +86 de c3 fb 4e 2d 08 11 ef a9 ae c5 10 9e 31 b6 +a0 56 e5 3e 31 7f 6a 90 4b 13 a7 35 6f 5e 7a e6 +0b 97 21 5e d1 48 17 d2 8f 74 b1 64 0b 1f 2e 42 +ef 0d 38 ca 35 a3 54 a0 af ef a8 03 a4 + +# Encryption: +00 10 bd 2b 35 6f 9e ab c2 2f 7e 68 f7 2f 61 75 +f9 ab 9d ed a9 64 23 b7 4b 11 de 82 c6 07 a1 38 +86 3e 17 96 6c 07 f5 6c de 9e d6 bc 42 2e d9 fe +aa 1f 65 36 7c cf 91 cd 4c 91 58 a7 49 57 1a 0e +9f 96 07 cb 48 cd 00 a4 48 de 03 64 91 06 ce 0c +24 06 aa 50 aa 12 17 17 8c db 06 80 1c 70 a8 9a +7a 1a 83 06 8e 68 db 95 d2 4c a3 db 33 a7 e5 e4 +3a 68 15 22 74 bb bf 40 06 d9 fb 69 f0 51 4c c9 +e2 + +# PKCS#1 v1.5 Encryption Example 8.7 +# ---------------------------------- + +# Message: +87 99 13 04 54 61 bc 0e ac + +# Seed: +c3 c6 a2 4a c3 40 a4 a3 ff 3b 2c 30 2b 56 eb 83 +91 bb d9 5f af b6 64 78 38 44 38 ab d8 b4 5d 13 +2b 26 99 09 b1 87 84 0a 68 44 ad 39 9f a8 13 72 +05 e0 2c ca e7 77 5c e6 66 21 20 e1 54 b7 bf d3 +0e 8e a4 d3 4a 7d b6 a2 34 88 a5 da ea 38 08 5b +ed 56 78 0c ff 87 27 12 5f 1a d5 f9 d5 a0 bc 3b +e5 80 bc 4f a0 68 26 7b 27 de 38 3c 55 c7 fc 17 +64 c8 6a c2 1a + +# Encryption: +01 d2 1e ce 33 f4 40 c7 2a 11 1d 62 ef 48 6c 77 +c6 c8 90 cd 81 a4 eb 05 32 ad 2c 0e c7 68 dd 1d +e5 b2 11 2f df 04 e2 87 a9 5b 95 0b 1f ca 5a e6 +93 cf 0e 8a cc 93 6f 37 47 14 de 74 95 90 8c 29 +15 a7 07 21 3a c3 db da ba d8 1b 4b a1 cb 50 b9 +5f 93 14 53 1f ec 83 3f 08 21 c0 4b 57 40 d7 3b +8c f1 f9 e3 d7 ab c9 74 49 26 13 8f b0 15 c0 f0 +56 cc 4b a2 f3 16 37 34 db 44 3e bd 68 85 8c 4f +a6 + +# PKCS#1 v1.5 Encryption Example 8.8 +# ---------------------------------- + +# Message: +5b + +# Seed: +42 b9 99 fb 16 3a 6f fa 67 a9 bc 4e 6b a1 2f 81 +b1 d5 6e 54 bf 08 66 39 7f d3 14 eb 0c f9 7f 13 +b7 80 4f 76 8f ba 54 06 21 f0 5c d3 72 64 d8 e8 +f5 82 28 fb 6a b3 0e f5 4e 30 fa 8c fc b5 a8 7e +14 8f ba bf 85 88 6a b1 f0 d5 25 49 2f 56 c6 47 +f7 22 9b 2b f3 94 a0 ce ab bd 37 c9 3e 6d a8 09 +7e 82 72 7b 3d 53 e8 c2 ad 1f 77 13 e3 4e d1 3b +a5 9e 0a 91 4d b0 6f aa e4 9c b3 79 96 + +# Encryption: +00 90 e5 35 59 47 90 2b c3 fb 58 0a 84 77 09 03 +a3 95 5b 3d d7 19 1c 92 8f 74 07 ba 74 72 65 dc +8c bc 1d 22 f9 37 72 72 b1 a8 c3 5c 23 8f 04 a1 +19 37 d1 b4 35 4f 64 37 95 e9 86 de e2 e4 0a 40 +67 41 b0 21 fd f0 5c 4b a1 15 62 e8 3e 9f 28 59 +2e 0a 79 14 fe 88 b2 c0 fe 7a 5e ea f5 00 f7 e9 +8a 5b a9 54 f7 50 77 bc 8f 65 9f 21 bb 22 03 31 +4b e0 d6 d2 1e 63 20 c0 5e 6e 2d 55 79 79 22 6b +80 + +# PKCS#1 v1.5 Encryption Example 8.9 +# ---------------------------------- + +# Message: +f6 35 29 90 13 24 a2 0f e5 e9 25 8a da 2f 95 37 +b0 1f 58 39 b4 45 97 e3 29 3a 12 25 ca 3a 2a df +68 4a 72 a7 93 c6 9c 56 af 2d 34 98 d3 2a 09 2e +91 4b + +# Seed: +7b fa 85 97 a4 34 cd ad fe 15 63 14 44 95 13 d7 +6c 10 5d f1 bf c4 8c 4d 07 6a bf c0 5b 5d da 72 +e0 dd 15 f9 fe 82 a9 95 5b d5 6d 33 43 e7 c6 f2 +5a 60 74 12 07 e7 3a 2d 10 bb 95 d1 d7 29 a2 27 +93 e6 c4 55 e9 16 23 5a 81 16 94 db + +# Encryption: +00 ad f4 78 74 67 ea c2 ea 61 fe 7e f8 2f d8 7c +2d a5 89 9f 30 30 2b bc 11 27 86 d2 fb 11 c1 42 +f3 f1 d8 cf 37 16 0d 2e 4a 43 98 3f fb d3 93 a4 +1b 59 9e e6 a2 7e 24 64 25 50 2d 46 90 20 2f e5 +f8 ee 1b c6 c1 d5 d1 6b e2 3b 97 3a ed f7 f9 11 +1b d8 b1 42 84 42 65 fd 93 57 7a 43 c3 ac c6 e2 +af 20 89 d9 d2 f3 f3 1a 5c 24 7a 7b 68 31 5b ae +25 d5 ae 81 40 a5 1f fc 00 97 10 7e c1 62 0a b3 +b5 + +# PKCS#1 v1.5 Encryption Example 8.10 +# ---------------------------------- + +# Message: +c6 d1 4b 04 71 45 f3 17 78 1d d7 38 2d c0 a9 72 +57 d5 54 bb 53 53 9e e9 a2 92 e7 da 5c b6 42 6f + +# Seed: +01 ff 38 d5 de d6 c4 3d c1 dc 5c 27 a7 e4 81 3f +44 8f 45 c9 6e df 4b d9 3e 96 fa da 9b c8 ec 5b +43 4f 06 19 a3 8e 04 35 6e 06 27 85 51 40 7b 7f +37 e4 2d 91 45 62 0a 81 98 18 50 a4 9e 28 51 17 +2d 23 0b 37 82 41 10 f8 ff db 84 77 94 63 9d 26 +50 cb ed 36 26 01 05 f1 f1 29 6e 52 a7 d4 + +# Encryption: +00 5e dc 93 97 89 cf bf aa ff 28 2b af 97 01 d6 +1f 9d be e6 f2 d2 06 cf ab 77 57 61 f4 2c b2 74 +ec ba 31 c7 cd 2f e6 03 1a ba 0b 84 d4 62 7d 30 +37 e3 1c e7 e1 56 23 ba 7c b7 69 02 51 c0 63 27 +a4 31 37 12 98 df 29 21 95 b6 45 11 62 d2 da 92 +a7 07 8e 2d 07 c9 f5 6a 07 06 8a 9a 3e 17 3e 4a +ae 25 a5 d1 c6 8e 68 20 8c b5 25 3a 0a 53 aa 6e +2e f6 c2 95 d1 51 65 69 b8 62 cb 92 ca 82 3c cb +ab + +# PKCS#1 v1.5 Encryption Example 8.11 +# ---------------------------------- + +# Message: +c1 16 53 e8 10 b5 3e 65 11 f1 33 23 fe 52 26 a1 +70 c2 1f 6d aa 44 29 d9 68 ef da 05 29 d7 b6 e1 +0d ce d8 0c 6b 63 01 de d2 2f 52 91 1c 0f 7f f4 +53 5b d5 e2 0f f5 35 88 cd 3d e6 64 8a c0 2d + +# Seed: +85 fa 7c 6c e9 6d 0a 8a 1f ba 75 04 71 7c cb e1 +37 13 80 93 95 6e ff 06 3f c2 ef d4 a4 6d 7d c7 +4e 90 f1 da 9e 43 db a9 12 9f 14 ec 55 9a 4d 2d +6c 5a 19 cb f3 a6 8c 62 d0 98 34 52 a9 ee 0c + +# Encryption: +01 b0 8d 49 83 13 a7 d7 4a 05 53 14 eb 43 15 ba +02 87 60 da d4 11 14 d5 94 2d 63 bf 8d 27 be 3f +49 cc d9 4a cf 9d 3a a2 2d 09 b9 9b f9 74 09 bc +f3 32 13 c0 99 67 07 86 82 03 a9 ab 27 70 8d 3f +ff 69 b8 9d 02 e3 6e 01 21 a1 19 b8 d4 d9 bf d4 +fe 8b 16 8f d7 c1 2a 24 3f 7a 00 0b 39 bf 8d 56 +48 17 24 20 80 23 bb 60 7b 30 50 5d d1 74 2f 87 +9f 16 c1 0c e4 90 d3 4a 68 0d 27 ac 39 60 7d a2 +4e + +# PKCS#1 v1.5 Encryption Example 8.12 +# ---------------------------------- + +# Message: +09 5b 77 c9 4d c1 b1 87 88 e4 00 e6 91 6a 4b 4c +fd 73 ac e0 df 9a 3a c1 31 bd f9 ad 0a 12 db 76 +6d eb 22 53 59 d9 01 cd 56 ed 88 cd a3 d3 28 56 +54 02 + +# Seed: +a3 4a 68 05 55 71 09 c2 61 dd df 5f 85 d3 71 ae +65 20 f4 5a df 46 96 01 b5 c3 59 fe c7 44 cb 2a +ae 80 98 3c 73 2d b6 c5 45 df 55 e0 20 8a cf bb +f1 c2 c5 e7 99 88 f3 4e cd 6e 5b b4 b5 25 c1 b8 +bc b0 70 d0 d8 42 48 b1 f8 e7 48 0e + +# Encryption: +00 39 56 36 a8 26 67 dc f0 0d 5d bd d8 54 12 06 +94 8d 49 36 89 17 ec 0e 00 fd 7a c5 ca 8b f4 4e +c5 83 78 38 6e 59 4b c0 65 a9 a6 3c f2 a3 55 a6 +08 b6 f0 ba cb a5 60 08 bb a4 72 2a 7c 47 05 45 +a2 0f 38 78 53 d4 60 31 3b 2e 86 4e 17 b2 33 e5 +96 35 41 32 af 17 3b 4d 04 49 26 47 79 02 62 d3 +a4 3f 84 27 37 88 37 46 6b 06 73 a8 15 27 e6 be +10 45 80 32 6f ec 84 ba 37 1e a6 10 91 fa 40 33 +a4 + +# PKCS#1 v1.5 Encryption Example 8.13 +# ---------------------------------- + +# Message: +38 + +# Seed: +54 7c 91 75 19 05 d5 a2 84 ac 3f e4 32 cb e0 30 +55 b2 85 06 58 96 11 0e a3 6d 05 a1 40 08 3c e3 +95 5f a8 28 41 ea f6 db 4a 50 d1 2c 07 4f 45 a6 +88 b5 57 6d 6e 61 68 07 54 0a c1 17 58 5c 5b c3 +be 52 60 72 7c df 12 3c 77 4d b4 0c ff 29 70 88 +62 48 53 e4 69 51 36 b9 31 16 15 17 a7 b9 b5 dd +cd 9d 32 de 3d fe 3e e2 ea 68 8c f7 bf 88 2c cf +7b 9c 48 d5 e1 9e ff a6 50 4a 42 62 0b + +# Encryption: +00 89 e3 9d cf df 91 69 3d ef e3 9d 12 bb 25 f8 +0a 76 8d 44 1b 48 1d 6a 75 48 69 50 42 48 0c d4 +a0 ba 97 83 d5 c5 bd 38 89 6d ce 06 ac b1 77 a4 +ac 59 68 e6 55 a7 aa f5 0d 69 4a 64 97 13 b7 a4 +bd d1 4c 81 9f 83 b2 04 7d e2 19 5f 73 03 66 54 +53 a8 a1 11 5e 5b 48 ac 0e 9a 65 ed db 31 89 51 +7b 04 6f cb c2 d1 43 81 77 6a 77 fb 46 8e 11 29 +3c 78 c8 37 4c 8f 46 60 35 1a c2 b2 c7 84 5a 25 +fe + +# PKCS#1 v1.5 Encryption Example 8.14 +# ---------------------------------- + +# Message: +80 64 6b 3c 4d f0 eb 79 1b da 0c cc 4d 97 d8 1e +a8 f6 f7 4e b2 45 e2 c7 c3 48 fd 7f b9 90 16 a9 +d4 0a 60 5a c7 42 b2 7a d2 48 + +# Seed: +11 b8 e7 98 d7 a1 42 d0 82 e0 59 8a 8c b4 f8 c2 +aa 87 5d 5b 65 17 8c 4e e6 7a 5c b8 41 d1 cd a3 +04 31 d0 20 df 28 80 d7 93 58 15 d5 9d 91 b9 99 +3e 53 ac 34 1c 97 28 61 ea a2 66 97 cf 10 ca 8b +27 94 b4 53 03 be 03 48 9e be 07 4d 8f 23 98 54 +c3 a6 06 fb + +# Encryption: +01 f1 e5 a3 db d8 24 75 2d 2f ba 3c 32 42 e9 d9 +96 e6 27 43 0d 49 3e 1b 44 6a 2d bc d8 6a 48 09 +3e 37 a2 e1 28 b2 8c 49 d2 d1 72 bf 5a 97 7c 36 +9b aa 9f fb 83 9b d2 fd f0 0b d3 0f f5 22 8b 57 +6b 94 e6 d8 ec f9 44 24 7a da d0 19 f2 1d 06 fb +e4 18 d3 a6 d5 4c df 11 3e 8d 14 f6 ea 06 d8 db +79 64 93 bc b1 89 6f c4 f3 f3 03 86 c5 c8 ba b7 +03 7c 87 9a fe a4 7c 8f b7 a3 c5 b5 0b 29 18 66 +b9 + +# PKCS#1 v1.5 Encryption Example 8.15 +# ---------------------------------- + +# Message: +6b 63 1c 7c 35 ea 75 a1 b0 + +# Seed: +3e 42 40 c3 e0 9e a7 83 55 35 8c da 61 29 53 47 +30 f4 8a 9c 9a 1a 52 13 28 4b fd 07 71 21 6a d4 +ca 23 3d 99 3e e6 35 7f 4b 1b 12 a6 ba a1 77 43 +13 4a 85 7f d7 69 a8 bc 78 d6 1f b1 4f ea 05 22 +1d cf 5a eb 1a ff d4 0d 8b c6 94 5c 30 10 45 b6 +86 c6 11 fa 43 7e 30 ca 0f ab 5a 4c de f5 20 5b +af 99 26 c6 07 be 96 37 b1 50 7f 50 83 e9 40 cc +fa 2f b3 86 19 + +# Encryption: +00 47 cb 9a 91 98 d9 83 b3 22 24 cf 27 fc 72 99 +bb d4 ae 07 78 a8 3f c5 9c 47 45 fa 99 e9 17 bb +74 f8 bd 4e f1 3f 14 0c a9 b7 2e 2a a1 74 ce ea +26 48 94 e2 15 f4 1c 36 d4 e6 f3 46 f6 9b 4f 85 +50 5c 54 cd 46 25 9c 71 2e 30 c4 92 94 ba db 1c +47 16 85 1f 2b 75 e3 96 12 cd 54 66 ba 56 e3 f3 +15 99 c2 dc e2 3d 04 c9 3a 64 40 22 27 df 40 b5 +14 c7 4d 0a a3 6e 1e 86 58 e2 92 77 b3 05 af 35 +15 + +# PKCS#1 v1.5 Encryption Example 8.16 +# ---------------------------------- + +# Message: +40 08 55 da 54 a6 d1 fe 5f b5 8a 73 d2 a5 e5 58 +38 70 fb d5 25 d2 f5 72 ad b5 96 30 06 d0 a1 33 +9b ea 88 9d 6d 46 a4 37 62 f5 13 bb 7c c0 36 22 +bf 85 92 44 d6 + +# Seed: +49 6e 50 ba b5 ef 18 f2 2c 3f 62 b9 21 14 8d 36 +c1 01 ad 0a 9a 20 38 67 58 08 ce 8b 62 f8 a6 a0 +ba 8d 91 05 f9 2e d8 a0 2b 31 2f 32 4f 3f d3 91 +92 bd 41 53 78 4f b5 59 05 c3 b6 69 30 7b ad a8 +27 af a1 b5 cb 3d c1 1d c4 + +# Encryption: +00 d3 a8 5d ec 97 d3 44 88 ee 33 c6 58 ba 18 8e +64 cb 57 83 7d 2e dd bc ba 8e e5 2f 13 f1 e4 fe +9b ec 2f 92 e7 21 09 87 e1 c3 fe 34 5d 40 19 77 +0b 07 74 94 51 b0 4d 67 30 d5 3a 91 01 5b 25 7e +81 0d ae 0a 0c 11 6a 4f 22 45 14 ed bd 39 b2 c6 +5e 15 2d 3b 97 89 dd a4 f0 d4 5b f9 83 2d 27 9d +34 31 06 2b 4d e1 b0 67 7e f5 9c 6c 33 27 68 ec +da 3a a6 bc d1 0f 70 bd 06 03 0a 76 65 ed 3f 20 +79 + +# PKCS#1 v1.5 Encryption Example 8.17 +# ---------------------------------- + +# Message: +b8 7e db 45 5a 7e 85 53 9f 92 8e da e9 09 fb f8 +f7 a1 99 c0 3a 94 a9 a4 5a ca b2 5e fa ee cc 26 +29 74 ca e0 bb 72 24 3a 99 c6 47 20 79 f1 97 38 + +# Seed: +03 5e 31 59 4a 56 65 60 5b 84 fe c9 3a df 92 58 +50 85 1d f7 b3 94 e9 bb ec be 4d 72 c9 2f 27 03 +b6 d6 08 96 e0 05 4c 59 ca fa 5e 0d 28 6c 81 2b +23 e5 37 88 5e 4c 34 38 a7 72 a1 61 0a e9 fa e9 +18 e3 4d 49 92 c7 f2 63 f3 e8 e2 f9 80 b8 + +# Encryption: +02 1c 8c 95 9a ec 47 29 68 87 68 93 0d 67 e2 02 +99 dd 47 90 2d b0 79 f2 39 b8 c2 88 b0 a7 04 47 +c7 19 6b 84 91 2e aa 5b c3 af f6 ba 63 0c 2e aa +3f cb b2 4b e4 63 83 65 31 25 0b d4 c4 f2 a1 da +68 c8 bf 4f 40 cf 5c 98 b6 85 eb ec a4 d0 3e 76 +b3 34 af 0b 1b 34 48 8b 58 2e 29 35 25 35 72 f7 +fc fa a8 35 44 e7 fd 52 ef 45 8a cc cb 19 30 1a +4d dd 50 51 6f 16 a5 fb 78 f3 95 99 00 db cc a1 +f2 + +# PKCS#1 v1.5 Encryption Example 8.18 +# ---------------------------------- + +# Message: +30 2a c8 0e 30 c6 55 3e 93 59 df 85 b1 e2 4a 16 +c8 62 a2 0f f4 fd 9d 5f 14 6b e2 81 dc 30 66 ae +b8 fa 00 b5 2a 99 + +# Seed: +32 6c 99 35 8c 4e 5f a4 d2 c0 43 f0 2f 92 70 5f +79 1c f7 12 bc 01 04 5b 4c f3 49 b4 2a e5 ac fa +c3 78 38 11 bb f0 7f 34 bd 6c 85 19 55 cb a4 a8 +b2 a7 d1 39 a7 8b c4 d8 8e 3a 88 e6 c4 cf 49 4e +6a 4a 52 35 41 45 e1 18 83 cb 5c 78 b5 72 f3 0a +51 ed 23 f2 56 4b 69 60 + +# Encryption: +02 03 29 87 cc f7 5a 63 86 24 17 80 64 db a4 b7 +2b e5 39 e0 7e cd f5 30 03 56 cc 43 d7 29 fe 34 +fb 35 bb bf 5a 32 17 2c e3 9e a1 fb 47 d3 8e 49 +7a 03 b6 01 ee af da af 99 a3 4f d7 21 18 4a f2 +e1 8e 83 d0 50 a4 10 8b 15 e5 e3 a2 7e 0e 63 6d +f8 d9 4f 98 16 58 eb de cd ab 0d ef cc 0d af 3a +c9 a2 7b 3f 22 a0 54 1d 35 00 27 52 e9 cc 4f b2 +58 2f ae 25 11 a1 32 ec 5c 22 8a 88 72 bd ba d6 +87 + +# PKCS#1 v1.5 Encryption Example 8.19 +# ---------------------------------- + +# Message: +00 b3 82 01 74 6d ca f4 03 48 af 57 ba d7 25 70 +ca f5 a2 85 5f ec 6c 42 ee 22 dc fe 64 c9 97 ec +62 a5 c9 75 62 4b bd 1f 8e c9 16 + +# Seed: +93 91 05 c0 04 c0 1a a9 f4 74 46 d3 cc f5 30 e9 +b2 17 4c 50 ae bc a0 a9 5c b7 a4 d8 39 54 ef b8 +03 9e 59 1c 19 71 d7 76 ce c7 61 12 92 06 db 7a +d3 dd 87 16 68 25 5a 55 50 ac 4e 94 8b e0 5c 16 +22 20 dc ef ec 13 ff 1f d8 a5 a7 f7 8b f7 15 b4 +9d 03 ba + +# Encryption: +01 2b a8 7d c0 3a 1a 38 bf ed f1 21 ed 87 22 82 +7b d9 7d d6 3f dd fd d5 90 50 c5 3c 5e 7b 49 fb +7a e6 03 84 87 82 0e fd 5f b9 71 43 81 ce 8d ae +b5 6d 13 50 bf c6 7d f0 91 be a2 ac df fd e9 29 +2a b1 29 1c c9 75 1d 9e 39 a8 26 f0 54 ad 1f 33 +a2 b7 94 da 50 ef 80 67 29 17 e0 b3 81 40 45 d2 +3d f4 5d ba 3f dc 6f 09 ab 0a 01 8b 06 0a a9 fa +fc 3a 5d 19 d5 eb 64 31 0b d6 02 a9 91 1d cb 7f +24 + +# PKCS#1 v1.5 Encryption Example 8.20 +# ---------------------------------- + +# Message: +ba 28 33 66 04 76 d8 73 15 07 66 9f 50 29 8c 2c +68 d4 4c 53 e3 d0 a8 03 78 6e + +# Seed: +86 ce 8e 92 ad 88 b1 46 2a 17 1a f2 8b 4e 99 08 +8c 04 98 a2 9b 4c a5 e6 6f 64 f8 6a de c7 f9 64 +e8 eb 82 57 c5 c0 1c da 16 5e 0f 75 11 db 14 7c +10 bc 07 51 5f 04 f0 5f 52 d2 bc 89 22 83 57 c6 +61 b4 3f 43 d5 42 db e7 78 34 09 1c 7c e7 0b 18 +2e 19 bc 93 6c 30 68 4a 83 1e 2c 3b 8a 4a 74 46 +3f 0c 9f 1b + +# Encryption: +01 12 ac 28 98 a2 5c 13 28 79 1f c9 6a 82 b7 29 +18 b5 1a 66 8c 54 0b cf fc 8e 0b 3a af e2 05 ee +87 1f 5e b7 6a d1 16 d3 04 cc 04 42 bd b1 af 5b +9a 63 45 82 7e 67 8e 40 e3 3f c8 58 ef 6c 45 6b +e4 36 52 bb 2e bc 39 64 b4 bf 4a 93 a8 ee ef 84 +04 ae f1 a0 44 41 5a 15 6f 7c fd 79 95 ac 25 e7 +b0 30 26 69 8e 14 48 9e fc c1 ae 92 96 58 bb 66 +3d e0 ac 44 a7 a5 5c aa 0b 0b 20 34 c2 aa ec 13 +4e + +# ============================================= + +# Example 9: A 1027-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +06 8e f0 b2 74 15 7d 7b 5e c7 29 03 86 59 56 18 +3e 0e 34 62 ec d2 21 14 ca d4 c7 ba ac 94 c7 c2 +c5 e6 cb df a2 ab fe af 8d 23 18 2e 9c 08 81 5d +10 0d 8e 8f 62 1d 3c d4 af bb 99 85 96 6f d6 a4 +18 2b 59 90 88 a3 5d 77 fe 01 78 ac f7 53 1c 70 +d8 96 ff 78 8e dc 82 06 05 40 ef ef d9 f3 c2 4d +5b e6 9a f7 f2 f4 44 85 b1 91 18 a4 68 81 4f c5 +13 e3 a1 ce d6 77 91 f9 03 6e ee 56 fa 9e 20 60 +2b + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +06 8e f0 b2 74 15 7d 7b 5e c7 29 03 86 59 56 18 +3e 0e 34 62 ec d2 21 14 ca d4 c7 ba ac 94 c7 c2 +c5 e6 cb df a2 ab fe af 8d 23 18 2e 9c 08 81 5d +10 0d 8e 8f 62 1d 3c d4 af bb 99 85 96 6f d6 a4 +18 2b 59 90 88 a3 5d 77 fe 01 78 ac f7 53 1c 70 +d8 96 ff 78 8e dc 82 06 05 40 ef ef d9 f3 c2 4d +5b e6 9a f7 f2 f4 44 85 b1 91 18 a4 68 81 4f c5 +13 e3 a1 ce d6 77 91 f9 03 6e ee 56 fa 9e 20 60 +2b + +# Public exponent: +01 00 01 + +# Exponent: +71 94 0b e6 79 7b b3 28 5e bd c2 0c c9 27 5f 5d +77 55 88 e9 af 6f 68 7a 2e 39 d2 c1 91 11 10 76 +95 dd ed e3 91 d2 19 6b 29 58 1d f3 15 4a 37 12 +fa 6f cd f8 5b b4 fd 48 64 1f 07 1f fd b1 de 08 +a1 d5 92 1c a1 0e 68 dc 04 13 13 c9 bb cb 80 81 +bd b5 d4 60 42 27 cb e5 78 07 41 65 74 d1 a3 8d +a0 b2 34 4b b2 15 b4 18 2b 10 6b 2b 53 4a 8d 32 +06 f2 d7 d3 03 b8 dd 5b ce 29 2a bf 75 cd 76 49 + +# Prime 1: +02 95 10 b9 33 b7 c8 4e 41 ff cc 72 2e 32 38 60 +c9 b2 d0 88 3c 68 33 62 4b a5 bb b8 97 53 d7 60 +3a 7d cf 26 6c c8 f4 bb 07 48 48 26 0f 68 dd 82 +6b 63 8a 8d d2 ef af 68 aa ee 26 5a e8 98 39 b1 +63 + +# Prime 2: +02 8a 2d 03 34 49 44 62 f6 11 f3 60 3e 0d 37 4f +3e 32 d2 fa b5 e9 d6 97 2d fd 70 79 64 46 a4 8b +c3 03 ee 25 8b 75 a1 b7 ac e7 0d 48 58 51 79 4e +42 84 f2 dc 51 d3 97 8d 55 53 7b ea 22 55 11 f4 +99 + +# Prime exponent 1: +01 b9 55 0d df da 3d 6f 09 9e e5 f6 00 a3 64 82 +31 86 20 b4 23 68 09 8e 01 24 e7 5b 88 23 e0 31 +0d 3b ba d5 53 61 22 09 cf 05 d1 ad 1f 32 8a 57 +ac ac 2a ef 1e 39 08 69 1f 5c 98 dc ae 56 1a 86 +33 + +# Prime exponent 2: +e8 ff a4 8c 52 4d 5d a1 8d 61 48 76 34 4a 43 ed +a8 4d 0f 67 ad bb 27 46 65 f2 ae ae 0e da dc f3 +30 2f 61 e9 0e 68 bb e8 0c 8d 28 05 ee 7c a8 5d +12 43 ee 4c ac a5 3d 12 fc ee 05 43 f4 74 90 d1 + +# Coefficient: +01 98 4a 81 5c db 46 ad 81 cd 82 10 aa 07 22 70 +0c 59 90 9d dc 9c 4a 49 f1 9b e1 5d a6 04 47 8c +21 88 81 d5 43 a7 54 6b f7 75 69 4c 2b d1 3d da +69 2c d0 bc 24 39 ef 22 ef b6 7f fc 5d 46 95 21 +b2 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 9.1 +# ---------------------------------- + +# Message: +96 ad 3b a4 d2 9b dd 35 25 bb c5 d0 2e 88 c0 13 +3f fd ea 40 94 74 db 34 df 73 3c a5 9c 3a 23 2f +6a 64 c2 14 3c a1 31 a7 f1 8d 00 5b b3 aa 6c a1 +ea be aa 13 6b ec 37 db 11 1d 4d 8f 61 + +# Seed: +10 e9 f5 09 3c ec 87 2e db 16 16 2b 6b bd 52 12 +f6 10 1a 71 d5 1d c1 42 0c ad d1 d5 50 fa f9 af +40 f5 73 d3 e3 ab 68 91 d8 a8 82 ef 06 56 bc 30 +06 2a 05 b1 cc 27 7a 11 c9 ba 2e fd 51 03 c5 6e +23 + +# Encryption: +04 de c0 1b bf 8e 0c 22 96 d9 f5 bc 2d 2b a8 95 +34 3e c3 0e c5 44 13 57 6d 80 84 b9 31 43 cf a2 +d2 03 3b f4 c2 c2 e0 3f 5b 02 59 ed f1 4a 8f 3e +11 69 85 77 65 2a 2a b9 f5 1a b0 18 7c c7 51 75 +c8 6d fc 9a 45 b1 e4 eb 8b 54 47 a9 4a b9 b5 17 +7a 04 04 ba 49 e5 7f 83 c9 3f 7f e2 de 24 18 45 +f5 81 f6 42 12 43 7e 0c 04 ff 34 ea 1d ee 6d d2 +8f 6f f3 36 72 35 44 13 74 f0 f2 ef 71 a9 cd ae +9e + +# PKCS#1 v1.5 Encryption Example 9.2 +# ---------------------------------- + +# Message: +7f 92 ab b6 e5 2e d5 d4 20 84 9e d6 cc ab 36 c3 +d0 84 92 55 43 1e 19 3d 67 bd 94 4b 6c 0f ce fb +77 29 cf 5a 31 + +# Seed: +ce a9 68 be 78 ab 5f aa c2 27 dc 3c 6f c9 ce d4 +9f 85 1e d5 8b 08 d5 ca 37 54 28 48 9a fb ef 3b +f5 ed 83 74 6d 95 9a 0a 56 e9 ac 66 ff 2e 7c 8b +8c 3a da 97 fa 15 dd 7f 99 13 41 74 70 70 cc ad +65 42 bd 7f 4b 33 f5 56 04 45 8b 91 03 ae 13 dc +89 b4 e6 2c cb f8 4f f7 3b + +# Encryption: +02 5a 1e 65 eb 37 f4 b3 28 cc 31 b0 17 24 f8 3c +26 ed 8d 18 a6 51 65 21 3b a0 ef f7 ae 76 7e e6 +0b 99 27 76 1a 06 94 b5 c3 bb 64 b7 e0 39 96 a3 +56 8d 6f d1 ac 6b 7a 8b 71 97 5b b0 71 6d 94 5c +02 d4 73 68 96 6f ff b1 d4 49 fc 6e d7 3e 2d 19 +83 1b 86 d1 87 67 51 29 36 69 e7 7d 6e 12 a0 f0 +c9 62 df cd 40 0f b8 3c e8 26 07 16 31 7a d5 fd +e2 18 49 aa 6f 68 e7 0c e0 b5 b3 11 42 89 8a d1 +a2 + +# PKCS#1 v1.5 Encryption Example 9.3 +# ---------------------------------- + +# Message: +f5 b5 35 b6 3d 53 5e 21 37 73 2c 30 13 37 c9 53 +ea 2e dd 58 a7 8c 20 25 83 2d ca 9d 6b cd ad 87 +c9 97 c9 06 83 6b 2b f9 5c 83 f0 3f 7a fa 29 01 +34 6d 67 4a a6 9a 1b 47 f6 b9 16 fd 4b + +# Seed: +c8 9e fd b2 34 e0 1a 2f 07 76 29 57 e8 c0 a4 f9 +1a ba e6 d4 f3 60 e8 9a 7c 48 6c 55 49 f3 d0 ad +75 77 7f 0c cd 97 a0 97 5e 98 44 d9 86 87 02 76 +c9 82 5f 5d 1e ef 3d 1b 48 7a bc d1 9b 51 2d 08 +be + +# Encryption: +03 9a 1c e8 c0 91 62 51 a0 1e 5f b6 61 5d 2e 11 +98 2f 4f ae 7d 46 df 21 da a2 98 f2 c7 46 11 b5 +58 16 cc 27 fa 37 27 9a af 59 02 ec b6 c8 39 fa +90 0c f3 af 86 ff 40 a4 47 dc 40 22 35 f9 06 67 +91 23 f3 cd 38 19 04 f3 3e ee 35 3a c9 0d 5f 7f +20 3a 6e a8 91 35 1a db 11 60 1b d9 d6 b0 a0 24 +33 3a 24 55 be 1c a6 2e d8 2c f3 7c f8 de 4e 23 +92 dd 54 e7 75 03 3c 56 99 0b ae 5c 43 91 b6 65 +3a + +# PKCS#1 v1.5 Encryption Example 9.4 +# ---------------------------------- + +# Message: +a7 cf 29 82 03 47 a5 2a b9 cc 42 04 bb 6a c1 bd +7f d9 0a 75 8a 15 6d fa 9c e7 19 27 e7 4e e2 15 +98 70 8c f6 9c fd 79 85 74 2f 50 27 ff a7 10 + +# Seed: +10 9f 0d 6c a0 e1 3f 50 4c 07 d8 4a 5b be 43 ed +6a 94 ac ba fa b0 48 89 36 05 d3 41 c5 d2 8d 85 +44 c3 fd 28 43 50 f2 c2 2d 1f 36 7d fb 9b 6a 67 +51 d0 6a ae b1 7c 3c 0a 10 11 ae 38 fb a4 e4 6d +4e 44 c4 82 87 9e ba 06 44 37 48 71 b5 c5 3b + +# Encryption: +04 48 c3 9c c4 57 d6 cc c3 0b 0d 76 ff 5a 13 2e +00 c7 5d 53 36 46 b8 44 0b 13 ce 73 0e 1b 7a d8 +3b b2 ba 4a 08 2b b5 a3 3c f4 14 66 e0 67 fc f1 +6c 6a 29 f1 87 9f 77 e9 b0 db f3 ec 08 05 75 be +ba c0 c5 67 6b ae e0 02 d5 73 d1 bc c8 a7 0f ed +2a b6 79 43 ef c9 bc 13 13 9e 5d 8d de 2c b3 0e +1b 93 4f 50 cf 6c 45 73 92 3f 73 98 de 66 70 cc +26 34 1f 3e 35 a4 19 36 1e 59 f6 08 98 f2 69 2b +94 + +# PKCS#1 v1.5 Encryption Example 9.5 +# ---------------------------------- + +# Message: +b8 03 c7 ef 5f 9a 9b d5 84 01 + +# Seed: +8e 77 58 ed 4d 1b a4 dc e0 88 92 6c 10 b2 f3 d4 +c1 e2 67 1a e7 2e 65 9f 72 1f f7 be 6f c0 35 e3 +85 d5 12 d0 7a 38 dc ca 1e b8 31 fe f9 06 10 04 +44 ee 99 5c b0 7b c2 6a 5d c9 2b 27 2a 74 a9 2d +21 49 73 25 22 d5 39 43 4f a4 d0 3b 07 cf 96 99 +95 8c 19 89 1d 1d 59 06 aa 36 d0 a8 d0 6c 6f c8 +7a 45 51 bf 18 58 bd fe d5 f8 86 cc 8d 31 ee 4c +16 4e 98 1d + +# Encryption: +04 b6 2d 4d 4b 9c 1c 3e 05 13 09 79 5c 69 24 8a +ed 38 9d e2 4a 6c 79 53 8a 2d 51 d5 d0 37 19 a8 +a5 28 75 0d 5d 25 4a 1b 91 40 96 db 96 d8 3d 2d +9a aa 2a 16 5b b1 34 6e 44 c3 57 27 56 c3 8d 52 +f8 d3 07 c0 4e 1e fe e5 84 78 22 31 7a b4 69 34 +5b 86 c7 b8 5b 54 15 41 c9 92 ab ea 98 d1 08 a7 +df c7 09 1c 30 c6 68 5a f0 e3 3d 04 66 ac e4 cc +cc b3 4e 5b 26 6d 3d 6b 94 7b c7 c0 ae 34 d5 e2 +64 + +# PKCS#1 v1.5 Encryption Example 9.6 +# ---------------------------------- + +# Message: +61 7e a9 e4 a5 6c 4e c1 d3 d7 fd 7f 32 81 ae 7f +a9 32 b2 a0 a6 cf 55 eb 60 48 14 56 81 b3 58 8e +df 70 12 69 f8 9f e6 4a a1 4a d8 df 0d 46 79 61 +31 + +# Seed: +64 d7 eb d0 48 50 eb 6f 7a e1 af 48 12 0a 80 13 +0f 32 ed b5 03 69 64 0b 22 2b 8d 63 ef f6 57 12 +70 dc ab 31 76 d0 24 72 28 dc d1 c3 f3 cf d5 13 +31 b7 56 a8 65 2a 14 dd aa b9 93 96 b9 19 9a 73 +87 50 d6 9e fc d3 77 f1 84 ae 19 b5 a9 + +# Encryption: +02 df e7 29 58 59 58 81 d8 07 56 6d 3e 36 07 c0 +22 e4 61 fe 1d be d3 cc 6d 63 de dc b7 19 0f 06 +c7 d2 4b 4f 03 26 4c af bb 74 82 ec 28 b9 ba 48 +9d 03 11 5a f5 8f de 47 5e da 58 bf 01 55 cd f1 +af 16 df 20 6b cd 12 57 04 c3 e3 15 ad 3d 95 44 +b9 e2 c2 fe a8 10 ce 48 45 56 d2 9e 07 ad bf 0f +f4 61 cc bc f6 62 bd 74 95 9a 43 7d 4c 80 11 ce +ad a5 50 2a f7 67 6d 9a 15 21 e3 18 9d af de 00 +dd + +# PKCS#1 v1.5 Encryption Example 9.7 +# ---------------------------------- + +# Message: +c9 1f 2c 98 c7 5b 2f d4 cd 8d 5c 7f f2 e7 69 b1 +2f 28 f3 13 fb ac b5 1b 5e 50 14 df ce 9d 63 5e +7c 6b 2d 88 af 5e ac 30 d1 62 b8 dd c2 2e d8 bc +7b ee 50 6b fb f3 1e 51 ba 48 f4 26 + +# Seed: +6c 44 59 61 f8 6f a2 98 d7 64 7c 22 24 d9 5b c1 +27 da fc bd 5b 90 21 ec 7e 9e bd e9 6f 5d 7a 76 +f4 ee d0 ac 92 2a 6e 93 eb 3b 4c 3c 43 f8 a5 7e +18 29 4e 1a 51 73 b0 f7 e2 dd 2c 4e 57 7a 4b ec +e7 14 + +# Encryption: +03 a8 85 aa f7 b7 d9 4f da e3 4b 41 c3 74 17 66 +a4 09 c1 ee 02 32 b1 c5 3e 5f 6c 5a a5 4a c1 ef +0e 5b f9 9b 9f 7d f3 e9 b0 0c ed 94 76 ee 1a db +8f c5 71 68 91 f5 4d 45 ce da 70 b9 db 3b 8f ad +25 e7 77 95 af 14 81 ec 49 21 84 c4 9e 9d f8 23 +ee 64 66 41 0f 65 01 3c e3 c5 79 16 63 5d a8 30 +67 7f 93 2b da ba b5 c0 a2 08 d7 f4 36 7a 7e ab +a7 5b 04 5d 25 ac fd b4 15 fe e0 52 19 a5 84 23 +7a + +# PKCS#1 v1.5 Encryption Example 9.8 +# ---------------------------------- + +# Message: +7b 1c 31 51 a3 8d 32 ec 7b 82 c4 8c 00 0a a4 81 +de 41 8e 80 3b 67 3d 2e 9a 0f c3 d5 e9 74 ad cd +ce bd 3c 2a 8f 41 14 21 18 a5 5e 87 d0 4b ba d5 +b3 64 25 + +# Seed: +b0 f5 be 9b 3f 23 7c c5 af ca 5a 99 fc cb 77 b6 +ef d8 68 94 7f 98 55 4f be ce ac fa 88 4c 15 15 +39 d7 cf 42 3e 72 60 31 bf eb 8d d2 d4 f3 01 da +6b df ca d6 e5 81 65 82 ad dc e1 0d 85 d5 ee 1d +04 46 f3 73 b9 5e e1 60 bc f0 35 + +# Encryption: +06 6c 30 09 dc 6c ba c7 b8 bd 51 41 c5 5c f8 6a +3d 79 69 d5 85 45 2e 3a 66 54 0f 94 02 db a2 15 +e3 fb 3a 27 7f 0d 33 96 c8 c0 08 af 19 91 3e 3d +91 e4 0f 86 76 06 b5 bf 54 30 4c 04 71 da dd 64 +04 b6 7a 48 57 bf 52 24 6c 0d 60 18 23 dd 03 80 +c6 60 9d ac b9 2d b6 02 e5 57 64 ae 46 50 df 1a +db b4 b9 5f a5 af 4b cd 11 21 f1 3c 0a 73 23 ad +a8 c6 0d e3 d0 81 72 9d 19 7f 9c f8 e2 7c de 80 +b1 + +# PKCS#1 v1.5 Encryption Example 9.9 +# ---------------------------------- + +# Message: +b2 93 c6 f6 d0 5d 1f 38 b5 61 ea 3d 0d 0a d6 a2 +af 83 09 bb 9a de fa 77 8f d6 bb 9f ff 3e 01 0c +40 4c 53 39 97 cc fe d7 e1 91 7a 66 92 61 cf cc +a4 e3 70 29 99 1d 2d e9 b2 99 + +# Seed: +87 bd 2f 6b b4 82 45 59 1d 65 f0 23 a6 5b 63 bb +ba 84 19 79 2c 01 41 09 2b 1d b1 be 53 e8 c9 b4 +df 95 f0 ad 55 b9 6e 5e 57 61 5d 21 4b 49 77 87 +0a 27 2f 72 31 66 c6 20 45 76 5e 6b 4a 73 a7 c9 +eb e1 1d 24 + +# Encryption: +03 10 4e c6 c4 ab 9d ac ae 42 7f b1 06 99 bc ae +00 3d a5 6f 6d 07 50 95 87 14 5b 73 3e db 53 23 +9a 6f 42 22 86 83 9c ac 06 4a df ee e5 dc 89 78 +0c dd ad cc 80 72 19 d6 a9 7b 85 c1 3f 27 93 7d +70 32 7f 82 cc 36 a5 da 8e 45 63 77 fc a2 3a ee +51 4e 04 4a bf 1f 66 c3 e7 bd eb c2 cf f6 28 bd +52 4a 09 66 e2 63 8d 28 33 bf a3 43 eb c7 41 f7 +6b 5b 70 a1 13 6f 4a bc 60 28 64 a2 ad 43 a7 91 +bd + +# PKCS#1 v1.5 Encryption Example 9.10 +# ---------------------------------- + +# Message: +08 38 f4 a5 92 + +# Seed: +89 c5 89 8c 6c 3d c6 cb db 1a cb 28 05 df 53 98 +f0 b3 35 8a 18 e5 e6 3c 14 d2 0c 98 d2 1d 9f d8 +b2 ec c9 a0 e8 3d af 0c 06 92 68 bb e8 6f ee a5 +1c 93 79 1b 68 e5 d9 3b 74 5f ea f6 ad c4 2b 83 +c3 09 c9 cd 3d fe 1c 06 15 3a b8 80 85 56 18 98 +90 be 05 3a 92 54 88 d0 29 fe 50 40 e3 e7 d5 d5 +31 b3 2e b9 d2 f4 ee a2 21 11 b3 8a 65 53 f0 0e +dd 23 65 57 5b b9 49 f3 63 + +# Encryption: +01 4f 27 97 dd e8 d4 60 18 ff 23 d8 9b e2 e3 ae +04 6e ed 31 97 c8 79 c6 0e 26 f3 d2 40 08 66 eb +50 d7 b4 5f 6b 01 ae 9c a0 06 84 7e fb e9 ab cc +9b c3 e3 56 90 07 2b 68 db 9e cd 92 6d 94 5f 78 +7b 27 c3 75 3b f9 6b 2d 49 98 30 84 14 2c 42 a1 +26 1a ff 7b 17 ff 4b 20 de 9b ff a5 86 24 ab 37 +1d 4c e2 f9 64 69 a8 e1 03 8d 57 20 b8 1c f0 42 +dc 78 bf da 9a 3c cb 61 60 81 2d de a1 58 bd 2f +5c + +# PKCS#1 v1.5 Encryption Example 9.11 +# ---------------------------------- + +# Message: +12 38 0c 5e 80 bb 95 bb c8 85 73 57 fe fd 17 bf +9e 50 96 27 d2 8c df cd 12 bb 13 16 61 b3 42 df +a6 ca 67 2e 13 a8 85 1f ce 19 b1 a8 ca f0 e3 3c +d6 ef 53 8a 05 fa 54 26 9a 13 78 e7 + +# Seed: +88 03 31 eb e9 1a b6 ce 16 84 d9 af 5d 97 7e b4 +26 ca 71 56 e0 b6 f4 33 6c 6e 09 33 d6 fa 48 78 +2c 0a c9 69 f3 dd e6 1d 8f d7 4c 47 fe 9e 30 61 +71 0d 24 5b 1d 38 11 04 28 60 c1 f4 8d 2b 8f fd +80 9e + +# Encryption: +04 6c 54 5f f4 96 c2 1f 69 01 27 24 54 18 cc 5f +b1 8f 09 10 2e 7a ca 87 e2 6e 20 82 fc 16 f6 2f +e9 f4 2a 72 22 71 a7 9e ae e9 62 5a 7e 63 2c 19 +36 40 4c ec 62 11 d8 23 86 3b a0 2c 6b 0a 83 19 +58 b4 ed 8f c6 25 a2 e5 2a 05 4f 8f 18 1f 13 0f +8b c4 b1 df bd 44 b7 0a 35 b3 5e 9c 7f 4a c5 5e +e5 e2 cb 06 8b 75 86 39 b2 cd 64 3d bf a8 2e 2d +97 20 e4 89 f5 c8 21 d8 eb dc 13 68 a9 d3 46 8a +37 + +# PKCS#1 v1.5 Encryption Example 9.12 +# ---------------------------------- + +# Message: +ee e1 e4 5d 18 b1 47 c2 69 a6 0a 9c 64 20 18 ed +6c d1 15 7c d0 ce 2b 29 68 df a4 b4 97 fc 40 b2 +24 bd 86 1e 25 35 12 2b + +# Seed: +5c 51 3e 51 44 52 b1 4a ee 33 b6 17 60 b8 58 c5 +35 7c 7d 7f 20 e4 a3 7c 7e ef e4 19 ca e3 fd 16 +f9 d8 3e 5e cd e1 9e e6 32 85 dd ce 66 80 ee 94 +64 fe 83 75 6e 90 31 d6 37 9e 6a 6b 38 4c e2 77 +bc 64 2c ed 83 b2 9c f7 4b 72 ce ff f5 30 71 04 +e1 83 de 2c e6 a1 + +# Encryption: +03 a8 64 83 cb b7 2c 15 f5 a6 93 2b 01 2f 40 c4 +b1 73 33 3b 26 86 f4 98 4b a6 6e 24 c7 cf 44 41 +23 ba 2e a6 66 a1 75 5d 09 35 7b ee a4 37 9c e3 +cd b0 a7 7a 6e e3 b7 ca 60 db 68 24 17 f7 16 3d +7d 3a c7 35 28 11 bb 94 c5 b7 71 f3 d3 fd a7 73 +e5 ce bc 8b c6 60 11 55 b3 f4 e4 b4 ca 85 d9 ba +b8 ec 25 8c ec ff 44 33 c9 2e 8f 86 3d 96 fc c7 +94 29 49 8a 9e 17 90 33 0b c4 87 c0 10 d7 99 24 +5d + +# PKCS#1 v1.5 Encryption Example 9.13 +# ---------------------------------- + +# Message: +55 09 a5 c1 ac 54 89 dc b7 65 f3 7c eb be 7d 81 +cf 02 76 b1 f2 cf f9 5d 27 4b bd 04 + +# Seed: +76 e8 1a 51 37 1f b5 07 41 14 1d cb 31 d5 1d 1c +46 1f cc 02 6a ea 85 20 15 d4 68 74 0b 45 23 40 +5f 95 ba 87 9b 08 69 bf 03 1a 60 65 4f c4 e5 68 +c1 95 7c e4 e4 2a 35 0a 95 bf 8c b2 a8 b5 fd e6 +dc fd 25 05 c0 37 a2 9e de 68 9c 53 d8 32 19 e7 +3e 64 08 17 bf 8a fc 9a b0 04 ec ae c8 43 e4 fe +4e 38 + +# Encryption: +02 55 de 28 0b 71 af ef af a2 0f 24 1e 08 1b 7e +c6 c1 62 dd da 18 84 fa 9f 82 5c 4c e7 63 6e fb +c1 1b 84 a6 eb ea 35 89 25 71 ac 9e 6b 1a d8 47 +3f a5 73 c8 83 c9 f2 15 a1 95 80 c3 ea 30 2f 88 +f4 4f 48 e4 d9 5c 34 40 d4 93 1f 17 66 a1 fe 7e +79 0e 5d 38 e8 5d 1f 63 85 0a 3c 70 7a d8 97 7b +88 c3 8c b9 ed 98 34 5c d3 50 c3 dd 45 30 9f c8 +1c b4 62 76 e4 ad 64 7f a8 4c 14 12 5e fd 67 d8 +ba + +# PKCS#1 v1.5 Encryption Example 9.14 +# ---------------------------------- + +# Message: +02 53 81 a5 5c 8e 48 7d 7f 4f f7 c3 6c fb 37 50 +07 d1 9f 93 71 13 6e 2b 3d f4 42 5e ee ee 5d 79 +c3 52 61 fb b4 ea 68 bd 91 e8 ed ab a2 32 9e 29 +31 53 06 c7 d7 18 33 15 5b 88 + +# Seed: +aa 31 0f 62 da 90 da 4a 20 28 b3 81 39 9c b7 e0 +ed 3b b5 10 57 5c 9b d0 f6 38 21 5b af 78 08 e3 +24 5e af 38 b7 6e 26 52 29 0b 7c c6 20 90 7c da +0c b7 af 07 3c 12 2f f8 3d aa e1 98 6b 43 ec 1a +14 82 db a6 + +# Encryption: +04 9b fa c6 41 0b 77 80 39 7a 49 fb 88 93 b2 4d +90 3b 36 00 f3 3c 78 2c 14 75 b5 d2 4b 4f 4e 88 +fd 11 24 ef 06 45 f3 d3 91 ed 31 00 6d d1 b7 c2 +64 12 8d 0d b9 aa 0d 65 a0 9f fb e2 9a 94 cc a3 +58 da 64 bd 1b 72 ff 55 88 88 08 10 5b e0 91 ae +23 ea 3f 34 75 05 17 9e cc b2 41 0d 89 de cb 62 +33 0f 36 c7 44 26 2e b2 b0 78 b4 25 4b cd ce ce +21 1c f0 57 4a 24 68 e2 a1 e0 18 bc 31 f5 02 22 +35 + +# PKCS#1 v1.5 Encryption Example 9.15 +# ---------------------------------- + +# Message: +07 3c 43 67 ba fd 48 10 d7 70 44 60 c7 83 d3 50 +f7 cc d0 99 47 2f 79 f7 fd f2 3e f0 cf aa cc ab +95 71 df 53 fd e4 + +# Seed: +f9 5a 39 96 de f1 ca fc 1a 4a 0b 34 14 6b 73 de +6b 5a 92 cb 81 2e 20 b2 0c 12 2a 25 1e 6b 22 e0 +46 9c 98 db 12 8d 43 ce fc dd 80 c7 ff 36 99 80 +16 a8 92 a8 b6 34 b3 6b 9b 0c e8 7e a8 0b 5d d9 +fd 7a 08 29 14 e7 3b 83 a3 84 1d e5 1b 71 b1 a6 +b7 ef 7d e4 e4 b8 8e dc + +# Encryption: +02 de e4 8b 0f 99 53 ee 12 c7 18 b3 03 b0 c8 9d +61 50 eb be 83 ad 62 4e 11 7e 3f 27 04 a0 b1 7a +2e be e8 38 52 56 f0 e6 42 80 fb 06 c3 b1 46 c0 +99 af 23 a9 f2 47 93 39 37 81 a5 55 ac 4e a2 d8 +8d 78 5d 8c db 6e 7a 2f 89 52 d2 50 3c cf 90 1f +12 39 f6 f7 b1 ac d4 41 21 c3 65 fd ae 37 07 46 +de 45 26 e7 c6 56 0f 87 54 6e d5 77 cf 97 98 be +f4 7e 49 20 65 50 9c 49 21 2d 37 0d ea 05 22 d7 +94 + +# PKCS#1 v1.5 Encryption Example 9.16 +# ---------------------------------- + +# Message: +ba b2 0b 9a 6a 53 2e 6f 8a f0 78 b3 a1 85 e0 aa +86 e6 16 81 bd 1b d7 75 04 4a 2c 95 8d 61 ed c2 +51 60 7c d9 f3 11 48 f5 a9 11 + +# Seed: +37 6c f0 18 14 3b 0c e6 70 21 68 4c bb 36 e4 af +e2 ff 9d e1 8b c7 f0 2b ed 86 3b f1 bc 34 66 31 +9e 72 0f ee f1 9d 38 e2 6b ca 7e 99 d4 09 6a 9e +ed 8d e5 bf 20 3f c7 dd 9c 84 85 df a5 b6 90 75 +ef 0c c0 37 fc df b5 5a 0c 92 8c da c0 cb a0 49 +7e b6 0e 3f + +# Encryption: +04 8d d7 50 99 18 43 0e da bc 01 46 8d b7 e2 87 +a7 38 1e 42 8b 5f c9 3c e8 de fd 7f 49 d5 e9 34 +15 30 43 d1 37 ac a9 f7 b9 75 77 b7 0d c0 16 80 +f2 db a9 1e 93 2b 53 ac f2 a7 f3 34 8f 56 54 b2 +cf cf e7 5d 48 f0 fa 45 00 d1 ba 5d 29 24 7f f1 +42 d6 b9 80 e1 1b 9d ba 68 83 f7 3b b8 55 a2 4c +c4 eb 90 68 23 6d aa 0f 2f 93 45 8d 72 72 6c 2d +8e 31 25 9a cd 3a 7f de b6 fe b5 c6 d2 ed 17 8d +db + +# PKCS#1 v1.5 Encryption Example 9.17 +# ---------------------------------- + +# Message: +19 b1 f4 cd 3d bd f0 5b 3d 5f 16 80 85 6c 5a 74 +4f 51 62 b5 20 bf cd fc 98 87 dd 92 be 9d 8c b6 +25 c7 25 ad 75 f4 f2 ca a5 ef 51 fa ca 71 b5 e6 +6f 84 f2 fc 6f 67 8a ce 80 9d 76 b8 42 ea fe + +# Seed: +78 a7 18 82 85 3d 85 af 16 5c c0 b2 2f fd c8 87 +3d f4 9e 2d 6c c0 ad 0b 0a 99 5b 4a 25 9c 86 7d +c1 aa b6 42 8a 5b 8e 9f 3b e8 7d 87 f9 e6 ea c5 +50 f4 df 11 36 8e 7f 6c fd 7d 0e 47 6a 45 9b + +# Encryption: +06 2a 78 db 5c a6 9a 30 48 10 78 94 93 db 8c d6 +44 fb 29 4e 17 fd 36 45 32 b8 ec 17 ce 3f da 70 +47 64 65 62 4a 60 a6 ec db d5 d9 72 40 c8 d8 9d +ea c1 1d c3 0d 7b 85 14 41 40 8e dd 64 28 81 a0 +11 2b 62 f8 cf de 34 d9 c1 13 85 c2 91 89 bf 38 +93 a6 ab ac e0 4a 10 aa 68 0c d3 a6 ee 00 2c 30 +70 35 d2 39 9a 2a 60 b5 a7 f1 ca af 05 84 d1 0f +d0 6d 6e fd 56 11 4c 05 e4 3d 42 d8 34 f0 3e 3f +e9 + +# PKCS#1 v1.5 Encryption Example 9.18 +# ---------------------------------- + +# Message: +8c b7 3b c4 78 50 c1 7f eb d3 4f f4 b7 32 3b 50 +53 03 0b 96 22 14 03 cd ef 45 de c6 5b a6 0e a3 + +# Seed: +ed 64 78 61 48 81 eb e3 fd d6 d9 ee 05 f2 76 5f +c8 a3 ea a5 80 31 23 5a f9 6f 86 e7 f2 c8 13 ec +04 80 66 1d 1c 2b 4d ef 74 2b 2e 41 41 9d f2 88 +3e d5 86 79 cb 9a da e4 de c4 cf 77 f8 bc 29 41 +d0 33 f8 87 7a 90 6d dc 88 d6 dd 3c 53 96 ad aa +c0 3e b2 a7 09 4c 0f df 0a 44 a6 b9 23 ab + +# Encryption: +03 97 8d 4e ff c6 d6 2f 23 2b f4 6b 42 90 c5 01 +1d 73 28 0a b0 e8 0a b9 d6 05 0a 85 2a 66 79 e0 +17 e1 70 d9 e7 15 6c 8d cb d4 6c de da 70 ff 9a +55 16 8b 9f dc 03 65 b8 aa bb 90 9a ad 40 d5 95 +c9 0b 9f 00 c1 e0 0a d6 f0 1d 54 43 07 b2 54 ea +f4 25 5d e6 2b fd 8a 5f 7e 79 dc fc 74 45 ce c6 +3d f0 c2 bd 0a d9 6c b7 02 42 b3 0b 32 42 07 88 +16 b5 8b 0a 9f fa 16 f1 d8 63 15 f8 a1 cb 2f 8f +6b + +# PKCS#1 v1.5 Encryption Example 9.19 +# ---------------------------------- + +# Message: +8e a5 56 43 df e7 cb e0 75 c1 7b 93 c6 ba 6b 5a +74 ea 8d 1a ba b9 c7 28 ae 5b 00 86 6c 62 88 0d +3c 00 05 20 37 cf 80 2d 2c f2 a8 e1 be a5 8c 7b +a6 04 77 4d 4f 80 bc 04 + +# Seed: +af 9d 9d 31 2e 22 57 0f bc 4b c8 5a 44 5e d8 d8 +99 66 0e d2 4c f0 30 15 33 94 6e 5c b9 47 1a 27 +c5 10 cd 17 55 91 d2 3d 36 3d c4 e3 e6 9c 7b b4 +65 51 7a 4c d1 d1 ce 41 3e 10 16 ae af d5 5d 2c +b9 de bc fe 4b 1d + +# Encryption: +05 87 11 19 16 bb 42 f8 47 57 69 1e fe de 7e b7 +79 6a 5c f8 87 c3 7c a9 f6 1b 45 1f b1 ba de 38 +9c fc 5f dc 21 98 41 bb 41 da 82 74 52 72 5f c8 +2b 4d 1a de 56 9c ee c8 05 79 ed b1 b4 b1 5b 46 +ad 7d 45 b2 45 98 80 23 ea 0d fc b3 74 4a 69 2e +b9 ac a8 5f 21 10 10 af b1 e9 89 4f 85 4a 5e 34 +fe 89 aa 05 19 68 a3 b2 36 2c 15 0c 6d 97 0e dd +82 b9 e2 d1 3b 38 c3 c2 95 6d 91 50 08 86 41 d5 +30 + +# PKCS#1 v1.5 Encryption Example 9.20 +# ---------------------------------- + +# Message: +52 5c ff a3 + +# Seed: +0c 99 30 4c c6 26 3d 1e e2 44 6e 24 8c 27 11 2c +8f 96 da 82 51 5f 06 f8 12 39 8a 88 81 1f 39 fb +05 62 05 c4 4d 6b d4 85 5a 62 c2 1c 60 1b 88 f8 +02 34 e2 32 41 f7 16 32 2d 80 54 a8 4a 1f c3 c8 +46 de fb 61 76 7c c4 d8 16 fa 7b 37 47 f8 72 9b +f3 37 2a c2 c2 29 d0 52 f4 5b c4 2f c3 80 50 dc +a3 f2 63 2e 60 07 b6 08 53 b7 e0 cc b3 da a4 94 +e5 53 35 fd 04 f1 3d 5f ad a7 + +# Encryption: +06 3e 45 08 e5 31 2b 5c 38 69 4d e8 2a 71 ed a3 +12 e9 ae d0 5b c1 43 d3 38 f7 f2 28 12 d9 3c 28 +65 12 6a 9b 3a 42 c3 ca 19 ed b3 46 01 c0 b2 8a +75 66 3b 18 f2 39 f5 ad ca a4 e9 fa 9f 61 18 04 +72 6f a1 29 62 bb a3 23 0c b8 86 d6 67 82 a4 7e +a9 50 2a 83 71 e7 57 3b b6 b0 26 6c 33 64 6b df +53 f8 de 36 8e f2 05 b1 1a 85 ba f2 1d af 3c e7 +a2 59 9f 00 8b 99 45 ee b1 86 ec 19 2c 54 0a c2 +3c + +# ============================================= + +# Example 10: A 1028-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +0b 52 cb 6b 5c 3b 9e c5 aa ad 89 4e 51 77 f7 f4 +5b 8d 33 dc bb e9 6a 5b 26 f3 00 72 bf 15 73 a6 +c4 1f b0 a9 7a e1 e5 2e d8 c2 5c 62 b9 8b f5 9d +e7 b6 8a b9 8c 2d 8b 93 c4 94 27 23 cc 4b ae d2 +b3 93 c0 7b 2b 11 90 9c 73 2d f7 c1 dc bb 43 3a +83 9d 46 f4 28 e9 dd c8 d3 5f d3 3e ed 29 81 80 +f7 5f 2d 5c 9f e8 53 4f 03 47 f8 68 5c 28 c4 37 +ea 5b 81 1a 28 6e 81 0c 69 7a 88 cd 7e 45 36 4c +1f + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +0b 52 cb 6b 5c 3b 9e c5 aa ad 89 4e 51 77 f7 f4 +5b 8d 33 dc bb e9 6a 5b 26 f3 00 72 bf 15 73 a6 +c4 1f b0 a9 7a e1 e5 2e d8 c2 5c 62 b9 8b f5 9d +e7 b6 8a b9 8c 2d 8b 93 c4 94 27 23 cc 4b ae d2 +b3 93 c0 7b 2b 11 90 9c 73 2d f7 c1 dc bb 43 3a +83 9d 46 f4 28 e9 dd c8 d3 5f d3 3e ed 29 81 80 +f7 5f 2d 5c 9f e8 53 4f 03 47 f8 68 5c 28 c4 37 +ea 5b 81 1a 28 6e 81 0c 69 7a 88 cd 7e 45 36 4c +1f + +# Public exponent: +01 00 01 + +# Exponent: +45 cc 14 17 b2 6f ce 3e 9f d3 10 89 b1 a3 cc c4 +6f 8f f2 1e ac 2e 1d 67 c0 ae 20 15 2d c5 0d 1c +e7 ce 6f 26 40 4e 2e 64 95 b9 77 bf 13 f9 a4 05 +b2 45 80 d6 39 3a 85 22 54 96 e4 ab c4 9e be ff +de 70 cf 26 76 68 66 f2 76 e1 5b 49 2a f8 03 3f +1b ac 7f 66 b7 1a 3b af 57 1f fc cc 03 8a 48 86 +93 94 cc a3 fa 00 49 85 b4 34 a5 15 17 87 7e ae +97 a3 84 94 7f 01 a7 2c f4 b2 01 93 dd 27 64 81 + +# Prime 1: +03 5f ed ee 7e 64 fd 68 65 79 31 a9 df 9d 55 62 +28 df c6 33 a7 50 02 76 8f 65 d7 15 f0 44 f2 3b +3f e7 88 bb 17 86 4d 61 df 57 9e 68 df 80 de a3 +a6 31 90 62 9d ac 7d e6 29 ef 9a b8 f4 df 0b 27 +7f + +# Prime 2: +03 5a f8 e6 fe 2f 84 61 fc 89 a6 45 00 f8 19 9c +cb d3 f4 69 07 85 96 15 56 03 d3 f0 88 08 33 c3 +77 db 07 8e 43 7e 35 60 00 4a d1 d6 f8 d3 47 88 +3f 3e b0 1d 18 9d 52 ef f6 e2 60 e5 2f ba a6 2b +61 + +# Prime exponent 1: +b2 43 b3 49 8b 67 2a aa 7d 96 7c d9 f2 6a 12 e6 +22 3e 90 9b fe 8b 73 91 65 4f 3b 6c a7 9d 60 12 +70 a1 2b 11 d0 99 99 0f 6f d1 f5 0b e1 58 8f 66 +14 a6 19 63 35 9b 88 e9 b0 52 39 c5 f5 5c 24 db + +# Prime exponent 2: +01 35 25 ad e5 3f ee d2 61 54 9d 3d ea 8a 60 95 +79 1a 90 b5 98 5a 70 d8 be fb 63 b5 07 10 84 a8 +ce 23 4b 85 dd 2e b8 41 13 f9 d9 aa 18 25 da 71 +e3 e9 48 f3 3f df a7 70 ec 17 2f ae 6c ce 2d 6e +21 + +# Coefficient: +1c 52 92 93 3c 58 d0 22 59 2f c0 03 38 bf 22 ed +fc ba 33 16 16 b7 9f 8d 2e fd 1f a2 4c 64 f5 dc +fa d9 aa 52 ba a4 6e 86 59 dd a9 ea b3 a7 86 3e +61 37 4a c0 da e0 18 5f b5 8e cb 0b 74 65 ee 07 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 10.1 +# ---------------------------------- + +# Message: +59 22 d0 9f df 65 22 80 2f bc f7 a2 8e c3 d9 fa +df 60 72 03 a3 1b d0 da 96 3a a0 31 5f 35 e1 a0 +a3 74 d4 87 dd 08 62 a6 f6 be c9 32 b7 db + +# Seed: +61 39 5a 0f a1 2e 1e c2 ff ea 2a 88 90 65 3e 8f +37 8d c4 6c e2 b8 aa 4a 0a 1c 56 7b 30 e5 9c 3a +33 a6 68 98 97 14 fc 3d 45 ac 88 63 27 e3 6c 34 +5d a8 58 f9 03 d1 e6 06 74 03 14 cb 80 8d 86 ab +c3 1b 49 b3 5b 3f 20 e3 79 29 dc c8 59 d5 91 41 + +# Encryption: +04 39 e7 dd 09 af 61 c0 ee 25 f3 e5 c2 95 1d a4 +9d 3f d7 08 b2 97 a3 05 5f f9 98 3a 9e a5 38 b8 +3d 59 da bd b8 5d af 82 ae 7b b1 97 8e 7d a2 a6 +dc 05 87 ef 9c 73 2e e6 88 37 3f bc bf a2 da cf +f9 b3 c1 2f 70 4e e1 4f 83 24 bd 4c c6 bf 9d cd +3f 05 33 c3 b1 1a 0d 38 db cc 7b b7 ef 9a 72 29 +6b 6c 13 dc 42 d7 ec 17 f8 51 a5 16 12 c7 49 4c +63 68 a7 fb ec 93 d2 2e 8f 9b 72 bd c0 44 9f b4 +30 + +# PKCS#1 v1.5 Encryption Example 10.2 +# ---------------------------------- + +# Message: +5f ba d4 3a 91 0a 29 0e 50 55 d5 14 e7 1c 8e ab +f1 f9 33 20 eb d0 da 8f 90 d1 46 a8 f3 dd 5c 1a +2c 72 0b 93 21 1e 48 29 34 14 9f 1d 21 b9 78 f4 +8a 0b b8 e4 cc a3 f5 d4 5d 3f 3e 3b a8 e1 + +# Seed: +21 04 52 61 80 4b f7 54 bc b8 bf 34 98 b1 ad 10 +af f3 3d a1 f2 25 ed a5 64 65 90 45 8b 20 70 9f +c8 d0 b4 98 90 7a 83 64 ce 1c 43 6b 6b 1e 73 18 +1c 86 c6 77 af 45 c1 7f 9e 4a f3 75 9c ad 24 87 + +# Encryption: +02 9f 64 ac 33 01 34 00 7f 77 f7 2c 37 f4 17 7c +24 d6 60 be 4e ba c1 86 8a d1 1f 9e 30 51 b8 cd +77 c4 69 11 99 ac 49 19 db 2e d3 63 74 0d 2d de +32 91 f1 0d 92 68 e7 c7 de 37 ea 42 1e bb 1f ad +65 29 f2 92 19 2a 96 80 ba 96 3e da 93 74 03 7a +b9 52 9a 48 6f 35 cb d2 9e 09 ea 98 a5 04 5d 9e +16 bb 87 70 15 5d 70 af d2 17 a1 46 86 27 49 ec +1a d1 59 cf 6e 6a 63 df 14 2b 82 46 d8 44 a7 37 +2d + +# PKCS#1 v1.5 Encryption Example 10.3 +# ---------------------------------- + +# Message: +22 bb c6 16 ec 6e f3 57 31 56 b4 17 61 ac 3b db +57 bd 9b 70 36 ed c9 a6 97 88 75 e2 a6 14 cd e3 +ef ed af d3 88 9a 5d bd cc 5f ad 9e 9b ec f8 a8 +bb 80 33 ff 91 df ed 60 4b f8 c6 e9 bb c7 + +# Seed: +3b 47 d2 ca 95 54 b3 4f 94 29 57 8d 4f de c5 d9 +6e ca 89 b6 81 72 d1 db 13 56 b3 da 7a 69 f1 58 +4d 4c 84 6b 18 43 2f 02 f2 59 ca dc 24 e1 54 ff +15 f8 06 f2 53 43 50 0e 13 b5 be 43 c7 b5 ae 7e + +# Encryption: +00 c4 e6 c1 0c 25 5e 4b eb 2b 31 c1 65 68 46 b9 +7c a2 3a 3b a3 2a b1 9c 64 85 20 11 3d 70 34 df +a4 6b 0c d2 3d 73 99 a9 3c b0 2f 1e ba 94 83 18 +e3 79 1c 30 6a 2e b9 c0 c5 6d 8f 7e 83 25 0f 83 +ad 49 2f ad f7 83 17 69 f0 2e 18 24 34 74 45 d0 +41 9b 98 b8 e7 95 45 65 32 30 0b 92 d6 e4 55 b5 +a4 eb a8 53 d6 f7 45 92 90 ab 02 31 99 48 53 a8 +c0 7e 54 f5 9c 62 45 37 08 02 89 f9 31 43 eb c6 +61 + +# PKCS#1 v1.5 Encryption Example 10.4 +# ---------------------------------- + +# Message: +31 6c c4 45 0a 53 70 3c 05 8c 90 1f 50 7d 7a d0 +cb 63 96 c5 51 d4 f0 61 82 ab d3 a4 3a ac ba bb +31 59 c0 26 b3 e7 db c1 60 f4 19 53 31 7e 0f 20 +80 8c + +# Seed: +c1 ec b1 16 4b 3e 66 23 f0 d9 b9 c5 eb f9 9e 78 +8b 7b d9 4e b7 43 74 f6 1e d3 14 30 4c af 46 f8 +4a 3f ea 1b a0 e4 7f c8 be 41 97 d1 d2 cd 41 41 +cb 9a 61 5d 89 c4 bd 91 10 ca 6a c9 a5 60 f0 76 +eb e6 9b 74 a1 0f e9 cc db 76 da bd + +# Encryption: +06 16 b8 bc 77 2c 55 64 d4 51 b1 28 d9 b1 36 4c +9e 33 b6 e5 58 ec 67 f2 10 5c 98 00 11 7d 0b 73 +cc ab 9d b5 1d 96 7a 9d 66 32 2c bc 5a 01 74 6e +47 31 dd 7d 04 e6 36 e6 4d 35 f2 c8 6c a3 9d 26 +14 92 17 6b 8d ab db 13 4b e9 4b e5 1b 6c 02 3a +0d 55 fc c1 f0 4c 94 c8 6d 47 7d b4 03 b0 4f b6 +c0 28 50 57 24 79 38 40 cb f4 68 aa aa 91 bc 54 +e0 d6 47 7c e6 48 ce dd 12 76 f2 ad 2d 4d 42 3b +6c + +# PKCS#1 v1.5 Encryption Example 10.5 +# ---------------------------------- + +# Message: +d5 4e a3 7c bf bd b8 18 3b 3b 54 7f 6d f2 d5 d6 +3c 41 5b 1c 44 ed 63 93 c6 97 b4 d9 3a 97 fa 0d +2f 4d 30 0a 68 e9 8f 7f d0 46 07 01 d1 57 9d 96 +83 61 2b + +# Seed: +d1 ce b0 c0 72 d6 88 8f a9 1a 75 7c bf 50 d6 69 +76 bb b7 2e 61 94 62 61 4d 5d ec 0f c0 bb ca bb +07 07 89 c2 b0 89 50 91 b8 fa 9c 7e 75 ab 20 b8 +97 58 f9 7f d0 47 bc 44 a5 68 a2 61 2d 0d 50 1d +15 d4 fb 82 e7 75 28 79 69 49 f3 + +# Encryption: +03 c1 38 c7 91 99 b0 b1 70 0b ab 2e 63 e1 d2 a0 +03 1e f6 02 f7 dd f1 ed 3a 16 1a 5e 70 f1 64 51 +da a1 01 f7 4c dd 65 47 a7 c6 52 c7 32 9b b1 73 +7f b1 4c 1c c0 c0 c3 e7 61 2a e2 0e e0 21 ab 21 +d7 0b f9 51 7b 4d 33 a9 d8 09 61 2e 7f 42 68 85 +b7 9b 31 2e 26 6e 42 b2 02 b5 71 c6 6f 9a 10 7b +8f d7 c5 6c 05 0a 8e 1e b1 89 56 db 06 a0 20 9d +d1 6e f2 d9 05 24 db 87 91 7f 34 00 6b e6 b1 5a +13 + +# PKCS#1 v1.5 Encryption Example 10.6 +# ---------------------------------- + +# Message: +f6 4b 25 11 cb e3 cc 65 81 + +# Seed: +da ca 19 63 cb 3d e5 24 57 79 e9 64 77 ff da 27 +7f 4b 92 3f a9 a8 d9 38 5d 52 31 69 23 3f 58 79 +a3 c9 fc 7a 38 e1 b2 08 c3 2d e4 0b be 1d a0 77 +47 1e 61 c8 b9 b7 09 3c 41 b0 a6 5c 99 64 32 d6 +45 52 11 84 a6 6a fc b9 6f 07 a8 f8 ee bb 6e f8 +17 e0 27 ee 2f 37 95 45 23 9e f6 f9 c1 d0 d8 60 +e8 21 44 ec 71 59 7f 24 6a 83 cc f6 60 ea 4c 70 +ee 1d f0 14 ef + +# Encryption: +05 08 ed 84 5c 96 23 8e 3a 07 e8 ec 02 7f 7b 09 +8a 83 f0 3e ac 1f ec 42 6f 4d 60 05 b6 0d 07 35 +db 05 37 08 2f 23 b7 50 f6 db 54 88 21 41 81 e1 +14 cf 1f 72 07 41 9c a2 93 75 0a a7 66 fa 7a 5b +9b e0 0e 37 29 2c 23 23 1c 6a b3 be 2d ed ee d3 +21 b0 f9 cd 83 2c 5e db 41 67 7c 1a b9 83 e7 e3 +eb c8 b5 19 93 82 1d 76 df 2a c2 29 8d 8b 80 ab +17 c3 8b 38 53 f1 8f e3 09 cc 7b f7 c4 a2 c2 7d +63 + +# PKCS#1 v1.5 Encryption Example 10.7 +# ---------------------------------- + +# Message: +85 26 49 01 52 06 e2 a4 09 78 76 f8 ab b9 b8 46 + +# Seed: +03 4f e3 4e 20 e6 06 a8 dc 7c bc d0 d6 ab 3e 07 +97 c5 dc 4e d7 86 8e dc 79 59 89 3e 58 13 7d 26 +32 b2 c5 a2 9a 81 35 c2 4a f6 99 b5 9d 68 10 3a +1f 42 33 93 e3 88 6e 3f a8 54 e3 97 21 50 19 41 +3a f0 b0 d4 fb 1b d6 9b d4 93 4d 4d 1e 2e 9f 3b +9e 7c 46 d4 98 4f e9 e7 a3 7a b2 f1 c7 8b 0b 8d +9c d8 fa bb 3d 18 d4 c5 06 e2 fd 3f 85 ae + +# Encryption: +01 6f bf 2a 7d 36 80 71 cc 7b e5 94 49 35 4b 9d +e0 5a 85 e1 bb 97 b2 51 4b 52 b8 d1 f3 e2 69 94 +e1 2c fe da 59 e0 58 a2 f3 c8 79 23 50 c0 68 41 +7f 99 44 1b fe 74 17 e0 b5 31 6e 16 3b a8 d1 f9 +e3 2c 59 a4 44 98 82 f4 7a d9 b2 4f 68 76 d4 78 +d3 f5 b7 d2 75 35 73 e3 f6 97 bf 64 c7 b3 ac 22 +28 ce 69 e7 5e 8e 14 ab 93 f2 19 78 05 9a 14 3b +87 7c 6d d4 21 b6 e2 0b 07 35 a5 36 05 55 2a b0 +a8 + +# PKCS#1 v1.5 Encryption Example 10.8 +# ---------------------------------- + +# Message: +f4 fb 50 be ab ec ba 77 e7 1d d8 d1 6c 97 5a 86 +f6 19 ea 7d bf 41 96 9a 24 ba e2 b8 42 c2 69 e0 +b4 d6 a2 9e 82 9d be 2e 49 79 9c 9e d9 71 a3 03 +35 e6 ed 9b f3 9d 12 4b e0 f8 + +# Seed: +9d bd 92 da ee b8 2b de 81 6c 59 3f 70 6b 15 92 +56 85 22 bc a0 79 7f 9e 81 1d d9 dc 0e 89 6e 98 +4a 4a 9a ce 77 de f5 a9 25 0d b7 95 81 af 33 fb +6d e2 42 7d 1a f6 a5 f6 92 9f a8 b6 7b ad 02 3f +04 b3 ff d2 + +# Encryption: +02 92 ed fb ac 38 e2 22 45 45 af 82 86 23 27 63 +bc b1 8b ae 13 70 97 99 e3 50 77 58 d0 14 1a c2 +97 6f 30 b8 54 67 d7 83 ab f6 fc 71 df 61 9e 1a +59 e6 23 4f 27 b6 32 fe aa bf d9 85 33 77 35 4d +93 3e f4 ec 59 94 c0 d5 0d 95 2e 0e ce 0b e1 be +4d 38 f1 1f 66 e7 c3 da 88 c8 3b 4b ed cc 06 2e +09 f9 af 95 ea ca c0 09 9c 52 5f 24 1e a7 d5 65 +e1 b7 68 cb 97 08 f3 bc d5 91 77 b6 76 6a 37 34 +88 + +# PKCS#1 v1.5 Encryption Example 10.9 +# ---------------------------------- + +# Message: +76 91 3e 84 8f b7 b9 fa ca 91 ba f4 f4 42 01 06 +a9 4d 6c e2 5d 14 97 fc 4e 7f 85 96 54 79 5d 7f +24 39 9f 3a 12 08 af 02 8e 61 67 8a 6d 19 a1 86 +40 b4 d5 0f 75 55 86 00 + +# Seed: +9c ee aa 26 09 ba 90 eb 61 e4 f7 49 c4 cd a0 1a +ea 23 68 81 76 2d fc 15 0d 97 c1 1e b6 44 0c b0 +57 e5 3c 3f d9 b3 9e 56 0a 46 e9 d3 fa 3a f3 fe +e5 ee 2d 02 fa 42 49 af 99 98 f5 3e d0 4d b0 10 +e9 6d 8a 01 ff 6b + +# Encryption: +01 96 30 89 c3 43 ed 88 b5 6d 6a cf ef bc 65 5a +37 cc fd 96 20 3f 21 87 64 69 5a d3 10 c0 b2 66 +65 ee 74 5e b0 10 fc 83 be 8c 20 64 5c 43 47 dc +d9 44 65 5d 9f e6 cd 98 77 dc 70 e5 c1 88 cf c9 +a6 6e 71 da 74 5c d3 e1 a7 b7 f5 a1 b2 5b 4f c1 +47 0a df bf 7d 8e 45 fb 10 7c 5a eb 50 ea 8b 56 +e0 4c a5 5b 9b 65 2a d8 34 d9 c9 65 77 b6 42 ef +33 f1 64 d4 93 1f b8 9e 0c 8c 6b f9 17 08 fd a6 +db + +# PKCS#1 v1.5 Encryption Example 10.10 +# ---------------------------------- + +# Message: +c3 39 f8 57 e4 d0 23 1f a3 7c 06 f0 95 6b 4d 53 +a6 c5 8e 06 10 d8 da 43 17 dc 84 11 d3 a0 f8 98 +49 b9 4e 8d 7c cd b0 c7 d5 33 0c 25 + +# Seed: +24 90 81 6a c9 69 76 ca 72 5e b4 98 e2 ff 04 0a +fe 3d 64 17 d3 2e 4f fb d9 fc 9e 3f a6 8c e8 49 +c8 81 be 37 9f 17 50 4b 97 e1 e0 d2 2d 32 ff 8d +fe 76 bb 45 49 f7 13 b5 b8 d8 70 ed 36 59 dd d3 +98 4b 6f b3 9f 6e bd dc 11 77 ad 69 8d 90 44 39 +68 ab + +# Encryption: +00 b5 fb 7b 1e 9d 71 df 8b 16 c6 3a 1a 49 6e 6f +7b f7 72 86 4c b4 11 55 2b 50 e0 b7 f1 5e 45 97 +16 f5 64 62 43 68 76 33 a9 10 6c 34 6c 8c 6b 7c +fa c7 50 b4 56 6b 1b 88 aa c0 ac b9 16 c0 7a 78 +0b e0 6d f7 97 5c cd 8b 72 60 78 68 7a 8e a5 d3 +90 3e 04 ab 1d 23 dc 9b 1e d3 60 00 c9 bb c3 dc +81 61 e9 48 3a 18 ab b8 64 1e bb 1f dd 02 66 c0 +84 bf 0b d0 9c c9 4e eb b9 28 3c 5a 5f 74 e3 60 +13 + +# PKCS#1 v1.5 Encryption Example 10.11 +# ---------------------------------- + +# Message: +47 58 65 a5 7b db 91 ad df 77 7c c9 d0 a1 7a 71 +a9 f9 71 0a 93 1b d0 c3 14 9b 23 91 a3 53 + +# Seed: +56 2f 79 70 94 6a c4 cf 05 ed fb 26 34 16 7e 14 +d6 65 8d 24 cd ae f7 5b 40 7c 90 04 81 8e fa 75 +d1 64 5e 81 52 d1 fc 80 d6 99 df e9 9a 27 a7 df +99 7a 8a 66 47 5a af ce 41 95 98 e2 a1 91 99 fc +20 53 e3 ac dd 07 fe c8 ba 61 f2 b0 3e fc 7d ee +d8 15 cd a8 95 2e 21 e3 c0 b9 a9 35 2a b3 6f 5e + +# Encryption: +03 e2 68 d7 d1 80 d0 3c 7c bc 85 07 ed 1f 83 0e +d3 7a 79 95 71 2d 7d 91 57 32 24 3d e6 85 d5 bd +99 a1 4a 8e 86 a6 7c dd 60 dc d9 0c 33 92 10 83 +5a 46 ce ac 19 36 ab 3a a9 c3 81 88 2d 76 94 a8 +38 3d 68 98 e2 73 44 bd 15 6f e9 28 2c 71 32 26 +25 d6 8d 30 70 ef f0 1a c8 d5 95 f6 48 6d 79 b7 +88 e3 69 12 fd 3c cf 28 4e dd 5f ce e2 40 9d ca +7d 4f 29 cc 18 2a 78 47 8b d3 ea 23 62 11 25 10 +a5 + +# PKCS#1 v1.5 Encryption Example 10.12 +# ---------------------------------- + +# Message: +9e 1e 53 f9 86 59 9d a8 98 d5 6d c1 c7 55 6f ef +ca a3 39 5d 84 50 d5 2b 3b a7 + +# Seed: +0b 17 63 cc 34 0e 6e 39 78 62 6a 06 d6 ef c4 0d +ed 73 db 53 5a 82 2e c0 4c 99 24 d9 ec 40 d3 85 +20 15 d7 e1 02 9c 13 93 ad cf 01 50 30 8a cb 27 +3c 36 35 68 28 a4 77 fc f9 a2 9a ca b9 09 35 70 +42 50 26 da c1 4d a6 cd 30 4c da a5 4c 9a 4c 5a +99 4e d6 8a 5c ea c7 e0 81 de c4 64 6e 23 7e 47 +1e 52 5e f8 + +# Encryption: +06 d5 19 a7 30 ea 5f 54 9f e1 9e 30 1b a5 15 2d +10 3a 3e ad 3f 89 ab 35 16 ff 7b 34 4c 4f 72 a1 +c2 6a a9 0d 5a 01 a2 a6 51 93 d3 cf 63 41 e5 9a +31 fd 2d 7d fe 43 5c 09 84 d1 bb e8 11 32 01 0f +43 58 ee bf e8 3f af 24 1e 7f 35 af 98 b7 c7 ab +91 e4 f0 e8 a3 2a 2f 57 f0 7f 49 d5 c2 1f 1e 13 +80 ba 0e 17 9a 38 d3 a2 ca 46 4f c1 4d 2b 74 a0 +3a 88 84 aa 85 7b 66 01 47 02 b1 bc 4e 7c c5 e1 +eb + +# PKCS#1 v1.5 Encryption Example 10.13 +# ---------------------------------- + +# Message: +1a e3 1e 0c be 44 97 ba 43 c5 d1 5f 53 5f e0 18 +84 1c 73 14 57 67 a6 a4 c8 + +# Seed: +8f f0 fa a7 a2 b4 ff 55 3c cb b2 0f f3 10 ac 5e +0e a9 28 18 56 2e c9 a0 60 64 f5 de 79 86 b4 f6 +c9 ae a2 b9 f0 11 42 38 e5 a4 99 a8 ae 20 ea e4 +02 1f cd d8 f0 60 c9 93 a9 bf 64 2d a0 25 67 39 +33 48 08 e3 88 e1 da 82 37 27 8b f4 f4 7e 05 01 +5a 8b 88 c5 42 0c eb c8 bb 37 ee 43 52 83 7a f7 +64 70 18 41 97 + +# Encryption: +04 a2 10 f7 6c 0f 84 93 99 09 53 58 98 86 f6 2c +1c 48 25 01 2a f4 4b dc f2 c9 9b 32 a7 0a 17 f7 +64 a3 a9 7b 2b 04 7e 39 d8 0c de 15 4e be d5 d2 +81 3e e8 4a c9 c8 d6 ec 6a 96 f4 02 db b3 26 d5 +a6 e9 c0 f7 87 c1 5e 98 23 c5 08 b3 23 5f 3a 00 +8d dd cd db 07 9e 80 ff 50 fe 37 25 4a 0c c4 68 +29 7e e3 32 53 a7 4c 1e 03 70 26 05 69 58 ad 07 +78 e0 aa 12 50 df 1c 14 85 7c b0 d7 1a a6 93 7e +31 + +# PKCS#1 v1.5 Encryption Example 10.14 +# ---------------------------------- + +# Message: +a6 e3 d1 07 03 21 d8 ff 76 b8 5c 70 93 fa a0 42 +83 + +# Seed: +d1 60 b1 2c 76 62 2c 3d 34 d8 55 87 e6 e8 1c f0 +54 61 8a 34 6b 67 52 d5 36 9a 71 c4 92 35 7a 13 +4b 7f 67 f3 34 a4 f3 b3 28 ba a9 f0 07 18 47 d0 +da fd ac 22 5d 7b 7f 07 16 18 ea 86 81 fc d2 d2 +30 5c 2f 64 63 1e 62 31 85 fc 09 96 e6 1c 84 f4 +18 0c 63 7b f6 ea 2d 06 03 75 f1 6a 65 e5 b1 e2 +b8 65 28 5d a3 d8 fb 1b 6a 60 ea 36 e1 + +# Encryption: +0a 70 03 b5 86 1a 85 a8 f7 2f 19 9d c6 5c 17 fc +58 a9 24 bc c4 08 19 e2 8c 95 83 e8 21 03 8c 00 +05 36 5e 90 9e ee 4f 32 66 f5 9a 84 e3 25 b1 be +a9 d2 81 b4 82 3f 2f ce 44 15 3f 03 17 0f ad cb +16 a2 79 b2 c9 58 7f 6b 79 ef fc 55 a3 c4 34 e0 +bc 5d af e9 d4 03 26 48 aa e7 e4 ed 1d 7f 14 1b +fe 72 26 83 fa 32 c8 9d dd 67 3c 3f 0c 03 c8 54 +59 89 0a b7 fb c1 d9 a8 14 bf e9 b0 d1 2a b1 7f +51 + +# PKCS#1 v1.5 Encryption Example 10.15 +# ---------------------------------- + +# Message: +d0 bc 89 03 9b a1 9e e5 0a 73 82 98 4e 42 8a ed +88 61 4f 78 98 13 01 89 16 e2 e7 eb 0d b8 3d a2 +8e c2 3c 04 a0 c2 f7 6a + +# Seed: +c6 4d 10 a4 b5 2f 49 0a b6 2a 60 38 b3 2b 23 c6 +3a 1c 85 97 0d 93 45 14 83 94 cd 35 cf d6 f6 b1 +59 0f ce 8c 67 5b ee f8 7c d0 34 5e 5c ad e8 95 +09 45 56 54 26 b6 b2 83 03 b0 b0 39 32 98 cd d9 +5c 88 1f a0 65 33 ca 9d 2d 27 14 d0 f1 37 85 a6 +1b 3a 17 a7 81 40 + +# Encryption: +00 8b 19 75 58 ca 4c e5 90 14 58 ab d8 e8 fd 52 +d9 89 96 0f 01 c2 16 ef b5 81 f8 61 14 8d 1a 2b +44 eb 0b 7c 15 dd c3 45 dc 83 f9 03 7d db 8f e2 +ea a2 cb ed 9b 1c 1e ee ae b8 65 bd 29 f4 4e e1 +47 8c 95 e9 fb f4 44 82 8e ed cb c0 17 02 00 de +35 49 b2 2c 11 e4 b4 33 79 8b 9d 63 bb 49 f0 b0 +2d af 56 58 ce ed ea a9 3c 0f ae b9 44 65 38 ba +92 eb 17 c8 5d b5 ee a2 04 ba 2f 49 c3 ce 65 bf +13 + +# PKCS#1 v1.5 Encryption Example 10.16 +# ---------------------------------- + +# Message: +ce 0a 4a 59 39 f6 aa 26 3b bf 8e 1e 5e 94 31 03 +56 ab a5 75 59 c4 1b 39 44 27 70 b6 1f 6b 3c 9b +5f e7 27 f3 19 52 28 08 d5 80 19 + +# Seed: +27 cc e2 d4 3c 71 31 8e d4 fc 8c 0b db 9b 79 13 +53 19 9f 3d 89 fc 12 ac 47 fd b6 d8 8b 44 c6 54 +5e 9e ee d9 f4 c6 85 15 d4 f5 30 b8 13 7d 77 45 +71 3b ad 0e bb 70 52 23 1f 6b 4c ed 18 7a ec d1 +e7 a1 69 d8 6c bd 13 d5 0b 78 be 27 c6 54 5d 81 +92 e0 ec + +# Encryption: +0a d3 ae 7e 5a 98 65 2c 1b f3 45 c4 91 90 3f 55 +17 c6 11 ac 31 00 05 87 7f a9 1a bc ee 64 85 f2 +77 8a bf 0a 6c 73 87 87 37 63 9b 26 72 fd d0 0a +39 65 d7 d3 d8 d7 68 8e 77 b5 45 9e 14 5e ce 64 +a9 a5 2c 37 97 f3 61 07 c9 36 8b df 79 90 f3 fb +6c 5c ff 59 f4 f8 a3 d4 90 93 df fe 74 06 c9 10 +aa 57 23 22 8d ae 5a 9b 29 a4 cc 47 69 af 8b d5 +fd 6e ce 88 58 a2 9d b1 b1 9c 08 1b f0 d6 b0 dc +78 + +# PKCS#1 v1.5 Encryption Example 10.17 +# ---------------------------------- + +# Message: +03 bf b2 59 bd 92 46 de 3f 71 c3 13 9c 72 85 74 +b4 4d 97 ad 57 bb dd 67 01 94 95 c2 a2 00 41 39 +26 34 e3 1a ad 63 f6 3b + +# Seed: +5f a4 bb b7 0e 1f 9e cb 5e b2 14 7b f4 59 d1 d0 +64 43 f0 25 c0 8e 36 4c cc 1b 16 0c 16 41 6f b1 +74 b4 4b 95 36 38 a9 68 8c 5e a2 d0 60 17 1f 30 +54 f3 ca 3f e0 13 b9 e3 18 8e e3 9d a9 1f 80 16 +d4 b7 33 18 79 35 1f 32 2a e5 29 86 4d 90 74 09 +8a a2 51 6b 44 ca + +# Encryption: +01 78 e3 a0 17 ed 2f c1 18 bb 2e 03 28 be b2 8a +98 c8 53 b9 e5 a5 f8 30 80 c0 f1 01 7f dc a8 37 +92 07 72 2c 25 73 7a 89 15 e0 eb 72 c5 22 85 e8 +8f 61 30 a1 cf 56 ad 1d 96 ca 2c e4 b7 1e c3 68 +94 7b d0 71 f8 36 59 10 c7 92 57 5b 8c d6 fd 27 +e5 23 e8 59 65 dd a9 22 82 d5 df d1 c0 64 ea ab +6a be ac 65 e1 6a e0 4f 0d 40 b3 bb 68 41 0b 92 +74 df ee a3 2a 43 f9 40 83 c1 07 80 35 3f 43 e4 +3c + +# PKCS#1 v1.5 Encryption Example 10.18 +# ---------------------------------- + +# Message: +16 2c ca 9e d4 70 8d d1 03 40 e1 94 c3 5c 0a 5f +a4 9a 5c 3b 5b 24 71 71 20 3c a4 8a 79 e5 2d ff +40 f2 bc a9 9a + +# Seed: +4d 73 ff cd c2 69 43 a8 70 78 23 47 8d a3 1a ac +01 27 4b 17 17 c5 0c 6a d0 c6 2e e2 bc d5 57 95 +2e f1 3f 15 ff af 66 bb 4f 45 39 99 11 c6 d6 5a +d1 87 57 2b c1 eb a0 d2 86 cc 45 aa 49 32 e7 3e +47 0c 5d c8 29 39 04 02 5c 86 3f bc 96 22 37 04 +90 c9 1c 87 40 b0 94 d8 f0 + +# Encryption: +04 2b ce 0d fc ec a9 ff 05 a6 e3 f7 4a 6a 70 cd +cb e0 de c8 1e dd c8 8e 46 7f 47 bb 76 0d a4 4c +79 4d 3c dc ab 93 92 49 f8 49 d1 d4 39 56 64 1b +0b 79 c6 86 1c 5f 71 5b 9d 8d 8b e9 f0 76 6a db +3f 18 af 7d b3 6a d9 5f fc d7 e0 fa c1 62 85 23 +e8 f6 9a de b7 ff 50 94 a2 b5 bf 92 b9 d0 ef b1 +11 8b 85 39 26 25 fd 56 f8 8f aa 0a 16 d5 47 30 +fb c5 ca f1 66 82 e9 e4 1b 7e 79 d2 02 2f 7c cf +96 + +# PKCS#1 v1.5 Encryption Example 10.19 +# ---------------------------------- + +# Message: +8e 1b 52 cb 4e 00 77 27 c4 b5 f6 5d 78 47 f3 49 +16 89 1e f9 c7 3a d1 8c f2 71 f8 9f 18 2c 69 3e +52 89 dc 31 da bc 34 cf 7f 44 fb de 57 9e 64 51 +69 ec ba 6e 4e 87 7f 7d ef 44 + +# Seed: +ba 14 74 8e 6d a7 b6 ac 18 33 32 32 95 ad b5 42 +2d bd 19 e2 ec 72 df d0 aa fd 7b d0 7b fb 97 e7 +db 10 8a 3e aa dc ff 67 b6 7e c7 e4 c6 70 04 c1 +78 34 6a 12 5d d3 b6 ca 55 23 70 59 4f 7f 42 cb +33 4b 44 85 + +# Encryption: +09 4b 40 30 e3 0c 8b 46 2e ca 00 f1 6b b1 70 19 +d1 ea 31 25 f1 c6 4c 67 1c b0 0d 46 e3 ad 87 84 +28 52 b2 01 49 6e e2 b3 d5 42 28 93 a8 0c 66 a3 +0d a2 c9 f1 a3 2a d4 d4 e7 73 77 43 ca 1b 78 ef +7d 4a 63 c5 e1 e0 be 7e 51 88 cc e9 42 95 69 74 +ff d4 81 e6 47 83 44 23 0c 37 da 5b 25 f6 b5 99 +a5 9a 05 80 f1 a0 00 c2 59 54 f3 a4 63 f2 89 5f +32 b0 5c c0 88 21 b1 a0 23 60 9f 18 ca 7d 44 9c +b4 + +# PKCS#1 v1.5 Encryption Example 10.20 +# ---------------------------------- + +# Message: +82 ff 62 af fa d8 00 30 94 cc 65 35 + +# Seed: +1c 7f 21 fd 02 09 79 07 40 5e aa 77 ae 72 88 65 +72 1d 93 86 f5 aa bc 2e 0a 95 f3 ed b0 5d 46 e2 +33 79 3b a1 a3 88 e4 b0 dd a0 0c c3 2b 94 8a c2 +65 ae 6a 2b f2 c3 90 a4 dc ce 11 0d 5e 86 64 47 +28 f5 37 81 36 47 6c f7 1d c7 ba ac 50 cc 41 c2 +01 48 dd 37 d5 f7 0a 81 2a 29 4e 24 2d e8 03 b4 +8b 63 40 f4 28 d3 c9 bc a9 6f 76 6f c4 f4 41 67 +e0 4a + +# Encryption: +00 30 3c 35 2e 1f dd 2a f8 a8 e3 a1 69 b5 da c5 +43 45 ca a3 35 a7 1a 37 e9 38 bf 98 47 08 86 56 +84 18 ae 98 d0 aa df e7 9d 0c 65 1b 3f 51 6e 70 +f1 01 74 fe 63 22 cd 37 6d a0 2f 22 6d 15 b3 6a +bf 6d 1c bd ab 6d d5 65 4d 99 25 f7 25 3c e9 91 +51 2a 44 e9 fa 15 27 12 d7 b8 db 7f 18 33 75 80 +fe 51 dc 32 a0 58 2c e2 60 53 f1 b9 49 28 69 b9 +c4 7d f9 28 39 c0 50 2f 2d b4 cc 4d 0b 20 4f 6f +d1 + +# ============================================= + +# Example 11: A 1029-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +11 65 47 94 f4 64 9a 97 ac 87 ef 67 94 f6 a6 ff +b5 cd ab 87 02 c2 32 54 fd e0 34 f3 12 9a ad 82 +5c f3 c0 cc 38 80 a9 6f b6 4e 48 d7 59 5e de 06 +c3 1d 0a cb d1 f8 ef 9c d1 f9 f6 f0 0b 24 ba 53 +45 ab a1 46 d4 1c 56 3b ae ce 3b 25 23 df 6a 9f +43 01 8a 5f 08 69 b6 ec 99 34 69 88 6b 5d 23 17 +d5 9c ff d4 ed e9 46 6a 03 f6 df ec 17 5c ad 5a +85 44 30 95 c7 30 b9 8b bf a0 48 9b 91 bb 27 39 +9d + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +11 65 47 94 f4 64 9a 97 ac 87 ef 67 94 f6 a6 ff +b5 cd ab 87 02 c2 32 54 fd e0 34 f3 12 9a ad 82 +5c f3 c0 cc 38 80 a9 6f b6 4e 48 d7 59 5e de 06 +c3 1d 0a cb d1 f8 ef 9c d1 f9 f6 f0 0b 24 ba 53 +45 ab a1 46 d4 1c 56 3b ae ce 3b 25 23 df 6a 9f +43 01 8a 5f 08 69 b6 ec 99 34 69 88 6b 5d 23 17 +d5 9c ff d4 ed e9 46 6a 03 f6 df ec 17 5c ad 5a +85 44 30 95 c7 30 b9 8b bf a0 48 9b 91 bb 27 39 +9d + +# Public exponent: +01 00 01 + +# Exponent: +1d 4c 4c 6e 13 da b2 84 6c e6 85 d0 c4 93 52 5b +b0 ad 35 62 59 6d b9 ad 16 94 5d 44 5c e6 7c 54 +e9 38 f6 54 54 2b 09 34 48 02 91 ac 21 ae d0 98 +e8 5a d6 fe c6 d0 fe 15 4c 3c 34 2b 16 99 9a 8c +ec e7 fa f9 90 b7 c8 ce 87 b6 6f e3 27 fb 35 2e +d0 11 32 3d 2b 81 9a 36 ca be cc 5a ae 72 30 d3 +f8 e0 02 45 af 35 af 80 88 62 e5 4d 92 56 07 ee +8b 58 e6 a9 f3 ad 8f a7 28 fc e2 68 56 c3 67 b1 + +# Prime 1: +04 41 0a b5 54 60 2d 7e fb 0c ce 92 71 a5 22 20 +f2 52 50 02 34 b3 82 02 fa fc 94 aa 26 b4 fb 04 +e5 f5 08 74 9a 44 ef b8 9b 75 78 db 00 7e 03 06 +23 89 48 69 12 80 f7 3c 12 7a 49 30 b4 63 39 ba +d9 + +# Prime 2: +04 16 d3 fd ed 8f 9e 7b 01 9f 67 12 32 0e ec 11 +d8 cc 83 81 ea 86 26 6e e0 3f 00 72 e9 a2 fc dd +80 81 ae 74 fe 27 88 70 f4 fd a2 a0 00 6c 4f 54 +23 9e 24 a1 5d 1a eb c6 7d 90 d8 18 4d 29 5f 52 +65 + +# Prime exponent 1: +04 06 7b 98 7b 5f 8a 8d 56 06 97 4d 11 06 1d 96 +29 55 63 e9 c2 6e 7d 3e 4e ba 43 fe 01 24 4d 46 +24 46 49 1a f4 82 f8 86 a9 6b 6d d1 64 d4 d8 0d +ae 00 90 29 04 5e 4e 13 64 b4 9b 9e df 81 e8 b5 +79 + +# Prime exponent 2: +e1 38 72 e5 6d 84 d7 4a 1e 15 7a e0 b2 3d 30 09 +c8 d6 72 59 16 cb a6 07 31 06 d3 b2 58 92 b6 c5 +33 21 69 a2 54 b7 12 36 63 6b 5d a9 39 a4 47 a1 +f2 20 47 67 54 a7 6d 69 0e 84 af 95 ca 54 eb d1 + +# Coefficient: +02 51 37 ae 5d 25 fe 1d af 9b 38 32 f8 07 56 b8 +6d b5 ca 0e 37 2e 51 63 03 4e a3 39 1f 5e 54 58 +2a 1d d0 47 58 b9 92 a5 a8 e4 6e e1 6f 8a d3 8c +a6 52 27 45 aa 7d f5 1d f8 9f c2 21 08 01 0e 00 +4e + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 11.1 +# ---------------------------------- + +# Message: +4e a8 df da 3a 9c 26 70 ca 9b 80 fa 89 71 0a + +# Seed: +96 06 42 1b 97 3a b4 ba 2a e2 2f f5 38 70 7d 7d +4e 56 3e 8f 05 f2 0b c3 38 1f f4 5b 0c 29 19 a1 +b3 46 b0 76 03 5a e7 74 b3 2a f8 ee 56 6c 73 e2 +09 49 68 4e 44 74 80 df a3 4d bb 0c 22 66 61 50 +90 9a 59 e1 bb 22 d0 95 ab e5 02 5a 76 d6 0e c1 +01 c7 80 e8 3a 0f f1 59 46 5c 3e 7a c0 21 2b b3 +8b 2f 1e 0e 6e 0b 54 d3 5f 4c 76 04 c2 d0 93 + +# Encryption: +09 bb cd 8b 63 b2 9c e9 52 26 ec 1d 51 91 2a f3 +97 89 fc e5 e7 7e 7b e6 78 96 c2 c4 e4 c4 37 6f +a4 28 ec 5d 8a 49 7a cc a9 e0 82 1e 1f 6d e1 06 +78 19 c4 8a 51 6f 06 91 cb ea cb b1 9d 1b a5 09 +f0 4f c0 13 36 d9 0f 73 96 b4 3a a2 f2 b5 15 0c +28 a4 5f 35 a9 de 1a 29 73 ea 10 28 67 94 94 0a +b7 9f 12 9e 31 8c f9 7a 5f d7 2b 04 5b 46 6d 66 +6e 5d e0 b7 14 f2 12 a0 b9 05 2a 0c 91 44 8e 52 +0d + +# PKCS#1 v1.5 Encryption Example 11.2 +# ---------------------------------- + +# Message: +c6 e2 57 f3 a1 b3 5b bd c5 cf 42 0b d7 65 4c 52 +b2 52 df 32 c5 70 d4 28 e6 3e a2 + +# Seed: +77 bb d7 2b 7b 8f d2 85 02 ec f7 9f d1 c8 af 8e +bf e2 44 32 70 93 b8 24 79 5e 95 c0 b4 36 eb 41 +e5 f0 f2 ae c4 33 63 aa 2c 08 fc 33 f2 87 e6 53 +80 40 e4 28 0d ba 47 23 e5 32 92 e0 a6 7b 21 ef +77 70 79 85 b7 2b 2e ca de 28 0a 61 fa 73 d7 3d +bb 2f db 17 f7 75 f4 5f a1 75 b7 7c b1 06 7d 6f +93 a4 37 + +# Encryption: +0d 21 49 5c 49 28 c2 6a 92 c1 6a 90 7f 08 33 35 +ad e8 eb 0c 20 b0 b4 5f e0 e0 8e f3 9a e2 4e c0 +b5 05 7e 60 78 dd 7a 1b 9d 10 2c 24 81 85 57 e9 +0b 83 ff da 14 f3 cc 37 3c 84 c1 05 ce ee 71 bc +73 1a 7f 35 71 bd 7b bb a1 d4 f2 3f f4 df 0a 84 +f3 12 99 0f f7 71 ff 11 8f 05 bc fa 22 2f 11 c1 +ea 01 f6 a4 68 ca 5a 87 50 80 40 98 f8 46 a8 64 +30 ea 23 e9 f0 7e 23 48 46 1e f0 0b a6 25 34 fc +e7 + +# PKCS#1 v1.5 Encryption Example 11.3 +# ---------------------------------- + +# Message: +2d 30 7f 44 dd ff 9c 45 35 a0 6e da 01 4a 19 13 +04 fb 3f a8 e3 a2 be 88 bb 3b 7b e9 9f 94 d1 33 +9c 21 9a 51 ff 5c ad da 93 + +# Seed: +5f ab 24 2d d9 f2 92 4b 20 d3 78 a8 87 b5 de 21 +d1 95 76 9c 3b 53 71 c0 0f 4c 3f 1b 63 26 8b 01 +0c 31 f3 2b b8 7c 9a 52 29 e0 d9 30 5f 5f c8 3b +89 34 b9 98 d8 ce df 91 6f 7a 4d 72 68 fe 3b e5 +12 35 f8 be ac 80 0d 4f ff ca 6f fd db 29 da 4f +a1 c7 76 9d 51 + +# Encryption: +0f af b6 1c 37 16 c7 96 69 fc d1 64 52 46 a0 d3 +b0 75 b2 8b 73 82 20 15 a8 ca dc 88 a2 2b 7d a5 +39 43 e2 54 4d e3 96 be ee d3 b0 a9 89 ad 20 a7 +3d dc d1 91 e8 aa 5c ae b6 e9 08 8a 4a 3a e8 40 +67 f9 19 8e 92 4a 9c fe 14 50 b0 18 a6 b6 9d d2 +37 58 e9 25 1c 76 cc ea e8 40 da 2c c6 25 17 39 +e2 3b 9a 42 b6 34 46 ec a0 d6 15 99 a1 46 b7 41 +fd 43 51 1c 73 66 3a 92 3e 37 57 f1 8a 17 1c 3b +12 + +# PKCS#1 v1.5 Encryption Example 11.4 +# ---------------------------------- + +# Message: +1f 03 33 88 55 4b eb fa a0 1c + +# Seed: +9d 81 57 56 74 66 3b 3d 87 7d 4b 0a a4 fd c6 05 +47 0a bc 55 0b 53 52 72 c8 23 70 18 86 7c 50 22 +ca fe 6a 4a c8 37 37 e9 9c 6e ba fe 69 ca a7 fd +ca 70 27 c8 fb c4 37 ec 52 32 ce 2e 25 29 a0 f7 +03 e2 01 f7 e5 10 32 35 ba 65 a6 47 94 f1 90 ef +42 54 93 b6 48 ed 24 a2 19 7d 0a b0 4d 81 c7 b3 +35 a2 da fd 6b 59 c9 43 a0 9b 48 ea c3 5e 35 59 +62 91 f5 f7 + +# Encryption: +00 1b df 33 93 34 2c 38 13 ee 3b 87 07 ea f5 46 +47 ba de 4c 71 8a 4b 64 54 78 12 e0 10 c2 b7 46 +c8 8c da fd c3 16 f0 36 9a 6c 43 0a e7 e6 c5 0f +05 d5 45 c3 f7 98 de b1 d9 a5 bb 69 c5 91 39 33 +c2 d7 79 2f ae 9d 42 ad 76 49 4d c9 a3 e2 7c 21 +1d b4 ef 19 85 18 7a 6c 4d 28 1c 47 72 17 74 a7 +a1 1c 12 18 d4 dd 26 7b 57 48 58 77 aa 75 1f 6c +28 19 f8 1b 50 54 a2 8a 26 a5 3d f3 ea 34 82 b3 +40 + +# PKCS#1 v1.5 Encryption Example 11.5 +# ---------------------------------- + +# Message: +f7 1b c7 37 4b d5 9c 37 77 59 76 f3 35 24 4a 36 +84 3c 59 e7 48 9a d2 8b 1a 82 2d 2d 7d 0b 9a 6f +e9 ac 5b f4 36 82 d6 3d 63 6e f6 + +# Seed: +a1 ff 98 44 a7 3e c4 b3 be fb 1a 86 03 52 cf 9b +75 fc 66 ff 47 9a 2d ed 59 98 84 5a 79 77 3a 8c +62 06 a3 64 36 c8 80 a5 5e 18 71 18 35 45 6d 91 +45 4b 5b a1 32 07 8f 20 37 fb da 72 86 25 1b ad +d1 2d 0a 97 81 af 3f 58 97 cd 94 7b 1e 14 25 f9 +70 55 09 + +# Encryption: +09 3f b6 85 26 ce ad 01 0a 54 d1 16 cd 7d 60 35 +09 9b f1 ab ff e9 33 1d e3 64 86 f0 53 a8 02 98 +e4 ab fa b4 0d 3b 03 a3 e7 e9 25 59 73 38 f1 70 +3b 04 53 5a 9c 87 c6 58 36 f1 61 11 aa e8 89 e6 +c8 d9 0a 24 07 d4 41 a1 c2 a3 11 cb d9 46 11 a4 +2e 93 c7 3a 3d 21 48 3f ad b8 f4 e2 46 d0 89 f1 +cf d7 08 52 b4 dc 77 8a 60 d1 52 d3 fc a7 5f d6 +06 67 04 e9 33 bf 99 f5 bb 77 af c9 a9 cb 3b 8c +b5 + +# PKCS#1 v1.5 Encryption Example 11.6 +# ---------------------------------- + +# Message: +46 87 83 d4 ea c8 81 34 32 04 85 47 ce 24 1f 72 +db 1c 85 ce 4a db e3 ee 2c + +# Seed: +c6 e3 26 30 ed 90 d0 af b1 68 c0 8b 75 22 59 ef +4b 9e 81 17 62 f7 cf 4c 53 5c b4 a0 a0 4b 1d 43 +65 4e d4 fa df c7 dd bc 3a ad 03 14 07 8b 22 6c +4f 3e 97 84 45 7c 91 c7 76 8c 5c 37 b7 60 08 93 +2e 8d 04 57 85 05 73 ce 6b 41 a4 3c dd a9 70 03 +18 36 84 0e 4e 60 a3 48 7b 47 a1 85 c8 6f 8a 16 +f6 f2 21 d0 a0 + +# Encryption: +01 71 a1 2b 00 cf d1 09 67 4e 5b f7 f8 43 47 fd +a3 fe 4a 8e a2 f4 8e 0d 6b 6d 94 b4 9f d7 bd fb +26 e3 24 00 a7 12 51 ab 84 22 06 92 1d 83 72 3a +89 ea 09 93 00 25 92 0e 3e f8 a8 87 d2 bc 24 15 +a7 f1 ed 37 ba 8a 5d 03 ef 92 6a ce f6 11 90 00 +1c 5e a0 f8 cd 92 02 0c d8 96 67 e9 ea 5f 7f 2b +15 37 8a 21 0b 8a e9 14 81 90 98 da 1c be c9 c5 +43 a2 63 30 0f 99 4f b0 b4 92 85 71 40 1c 20 2b +d6 + +# PKCS#1 v1.5 Encryption Example 11.7 +# ---------------------------------- + +# Message: +af 63 1d 76 c9 7f d9 95 e4 94 aa 9b 4b d7 58 c5 +c6 72 c5 e4 15 8f 3a af 87 4b + +# Seed: +40 6e 1e 23 f9 92 bb 07 62 12 5c a4 63 bd 0f 2e +fd f1 bf cb 08 2a 8d f5 06 af 5f 72 70 c3 9f de +01 d9 ee d3 22 66 61 db 22 a9 c4 04 b7 d7 65 fa +38 4f 9a d4 f5 1b 93 69 d7 4b 0e 37 70 66 31 bc +65 36 f6 55 5e c7 fd eb d3 48 ef 3c f5 f8 a8 77 +f6 06 43 7c 27 8c b8 16 3a d3 49 38 4b aa e3 2f +31 b6 86 e0 + +# Encryption: +01 ff 8f e7 9a f3 18 d7 56 f2 84 08 3b 51 b4 3b +66 aa e8 3c 6a a9 1a 99 93 4b 4d e8 4b d5 fd 24 +fa 8d 07 c7 55 14 74 66 5e 62 36 0a 65 98 4e 67 +a4 85 6c 3d bd 2c 75 f2 46 e2 22 22 e9 f4 b9 69 +51 67 26 ed 28 7f 42 3a 67 47 82 1f bb b7 fa 17 +62 35 c8 50 a8 61 f2 99 f7 39 4c 2c 43 07 b1 02 +59 09 40 fe d1 20 6a d5 9b 9d d6 44 4e 1e 19 6e +94 73 25 22 4f fa ca 06 9e 9c df 8c 62 02 69 07 +7d + +# PKCS#1 v1.5 Encryption Example 11.8 +# ---------------------------------- + +# Message: +73 cb 53 90 82 fb 06 dc ae 3c 20 68 e9 89 e7 c0 +d8 ff f0 fb 34 0b 6d e8 0d 0b a5 d1 e0 06 4f 22 +13 92 8a 4b af 20 a8 03 48 af 3c de 9d e6 3f 88 +6d 63 e5 6a 3e 32 cd 8e + +# Seed: +28 e2 a9 7c 7e 9e 03 3b 49 aa dc ee 8f dc 07 ed +fd fd b9 50 35 4b 70 8c e5 df 84 8d 1b 51 aa 2f +4a ff 99 74 16 01 81 42 29 47 b1 33 76 4c 5a 40 +06 57 04 6a 49 36 3f fd f1 f9 3c a4 8b 3e 52 93 +7e 1f 38 fb 50 fb + +# Encryption: +0c 72 e6 95 48 c3 4e ca f2 48 b2 dc 6b b6 43 87 +f4 f3 35 0f 66 8e 59 01 35 60 80 8c 41 3f a8 35 +fd 36 0e 04 e4 74 7a 00 31 c8 a6 4a 9d 7a 07 b3 +63 fa d2 93 b7 03 a7 dc 99 0f 80 6f b9 0e 39 12 +21 a1 16 df 10 8f 54 6e ae 51 71 6b a0 45 01 ab +77 7b 0c 2a 17 71 2f 71 e4 06 27 5f 01 73 77 cf +24 88 c4 35 ef 6c 6e 7c 45 cd b9 8f 24 47 7c ed +18 0e b3 ef c8 70 3e 96 38 26 bf b3 44 f1 6e b4 +a1 + +# PKCS#1 v1.5 Encryption Example 11.9 +# ---------------------------------- + +# Message: +f2 f9 85 b8 03 12 73 cb 5f c8 9a 31 dd eb 4c 67 +a4 e4 f3 8c 09 d3 02 87 42 09 b3 9c 69 b7 1f 84 +95 88 86 8f a5 f8 + +# Seed: +c1 20 44 6f 5b dd a0 6c 63 73 8f 18 15 55 95 f6 +2b c2 65 67 28 4c 35 03 65 91 cd 5d 75 3e 4e f7 +90 0d ff 33 bf dd 3b 10 8c 10 2d 08 98 80 c7 b6 +9d 86 e9 ce 3d 68 8c da 15 6f d6 a9 92 31 05 8c +c3 18 33 96 38 09 46 e8 a9 69 a7 fc be 9e dc 95 +9a 0e 50 45 32 ba b8 ea + +# Encryption: +10 e0 bc 14 ba 16 01 26 98 cc 76 cb 82 04 5e 2b +fd bc b2 b1 18 f1 83 06 79 59 d7 13 7f d5 0f a8 +8f e4 f9 ce cf 66 31 a9 9c cc ab 76 cd b7 74 4b +ab d0 6b 2b ed fb ca 77 24 da fd 91 e6 df a8 8b +ea 2b 44 a8 cb b0 62 19 b1 5c 2a e7 68 72 fa d2 +88 e8 43 8a cd 39 5c e5 cb e2 8a 71 2b 67 f5 61 +a1 78 6d 75 34 3e d9 ad 0d 0a 5e b6 fa ed 07 b0 +6a ef 03 31 8f f1 af e4 72 db 4e e3 e2 1e c1 29 +33 + +# PKCS#1 v1.5 Encryption Example 11.10 +# ---------------------------------- + +# Message: +39 87 2c fd 6c f7 4b 4c cc 1a 70 d9 73 b3 18 99 +a6 7a ee de e5 d6 71 e0 5b d6 01 12 e6 45 12 bb +e4 3b b8 40 + +# Seed: +68 ac 3f 96 97 b7 50 75 4f a7 53 2e 41 61 c1 20 +18 e0 33 a6 02 51 c8 dc a8 38 78 16 f4 23 79 ab +97 8e 15 57 8a e2 e9 4c 17 76 48 8b 0c fd ff 18 +6f a6 d7 98 88 f8 16 9e e4 49 ea dd c8 e7 f5 a6 +58 d0 99 7a 93 4f 58 6e 31 f7 47 30 be 60 3f 1e +e6 2f a6 c0 8b 0b ff ae 6b 88 + +# Encryption: +09 b7 70 07 f1 5d 65 9e fc ca ca 66 c1 e7 d9 62 +e0 47 a1 e1 49 e5 2d cc 0e 1a dc 9e 18 3b f7 3b +5f 23 48 d3 43 28 24 1b 40 7f 61 82 2f 6d 57 e1 +ab b3 22 d3 02 f4 53 0d 2c b9 a4 1a 27 70 23 8a +1b df 87 5e dd 79 78 10 d9 04 e9 7a 4d 7c 51 51 +32 d6 ab bf 3a 4a 40 74 86 dd 00 4e a3 8a ff 8d +4e d3 82 5f e1 31 42 f1 36 fd 1d 71 3e 80 e0 cf +22 57 69 b4 19 cc a5 4c 15 6e 54 66 8b 30 6b 5f +2a + +# PKCS#1 v1.5 Encryption Example 11.11 +# ---------------------------------- + +# Message: +74 d5 6b f8 d9 c1 80 dc 09 93 71 a5 af 72 + +# Seed: +33 78 70 f0 47 9c f1 28 3a 0c 87 c9 c4 af 54 ba +8f 85 06 44 d5 9a 20 25 26 3d 2b dc 49 bf a6 63 +6e 75 18 f9 4b 6a b1 8f 85 b1 93 21 20 9b 76 9f +0c 19 75 d1 d5 ad a0 6f d2 a7 6c 82 45 0e 4e 09 +cd ad b7 83 2f fb 8a e7 dc b4 74 10 b2 87 80 4d +dd c7 49 3d 61 0a 81 39 9b 6d f6 df 5e f1 52 09 +29 84 fe 27 76 a4 f9 30 54 6b e1 dc 18 31 3c 14 + +# Encryption: +07 61 eb aa d8 ff 1c 3d be 71 0f 60 e3 be 9f 28 +9f b2 7a 6b 53 77 75 5b 71 fb 38 4c 5f ac b1 60 +3c 95 3e 1e 2c a1 1e 78 43 25 ae 42 f3 21 ae 5c +58 64 8c 84 f5 24 df 9d e9 f9 3f b4 b0 c2 e0 97 +97 ff 2d 11 40 70 73 b9 5a 78 6d f5 1a 43 f7 99 +82 d8 6c 49 fb 9e 50 14 b1 b7 68 76 0a 51 30 26 +6d 06 99 30 6a 90 4e d2 df e2 01 38 d5 31 c5 dc +4b bf 4d cc f1 02 49 a6 e2 b3 55 f7 cc b3 26 a4 +8a + +# PKCS#1 v1.5 Encryption Example 11.12 +# ---------------------------------- + +# Message: +61 10 63 b5 da 12 3c e2 12 96 17 df 38 59 95 57 +b9 5d 1b 05 e6 b6 6b cd 49 af e9 83 1a 04 21 a5 +be 4e 48 + +# Seed: +10 f9 df 30 ec 97 77 fc ab 5a 92 4d ed 36 fd fd +6e 1f 38 14 49 ad 99 d2 0a ea 0e 39 72 ea 60 4e +a2 27 50 d0 60 1d 10 a3 77 da d1 a9 4f 9b 02 73 +40 94 81 23 82 73 98 bb 22 b1 44 5f 71 c5 05 c6 +23 aa f5 16 cd 9f b3 e9 77 f7 78 cf dd 3a 5d 28 +c2 29 9e 4b 2a bd 9f 98 c4 35 5a + +# Encryption: +07 f2 d5 8b c4 16 39 94 d7 6f 49 1e dd 69 74 3c +45 dd a0 c3 8c cb 07 69 de 9c f9 f4 fd 00 55 d3 +0a 0c f0 02 80 0d 76 ed 8c 12 cb d3 6a f0 51 a9 +d7 33 7b 29 bc 77 4d c3 c4 01 2b f5 c2 8a ea d8 +c3 e0 36 aa 41 39 8a 8b 0f e9 91 c0 bf 66 b5 34 +1c 99 d9 37 7d 94 70 4a d4 90 a9 f8 74 6f c5 ce +f7 26 e1 96 f3 41 f9 3a 1f 1e ae 2c 13 e0 0c fd +22 06 2f 8e b3 da 9d af b9 5a 1e 7b 81 b1 fd b6 +56 + +# PKCS#1 v1.5 Encryption Example 11.13 +# ---------------------------------- + +# Message: +80 76 4f 78 5f d4 17 6e 16 41 e1 29 a3 5a 9b 31 +b3 a8 9a 75 67 ad 6c 1f 0d 65 ec 8a f9 5f c1 6e +15 28 14 09 + +# Seed: +20 36 d0 98 a6 e9 35 f9 a4 11 20 1d 2b cb 62 9f +79 0a 94 db 2e c6 98 67 43 3b 17 61 d7 c6 95 4b +e9 1a 9f c7 19 19 0e 10 86 13 cd 58 4c bb 97 76 +87 04 69 24 bc a6 b2 fe 1a 54 bf 76 ac f7 7b 36 +8c 39 65 0f 6d 0a 49 8d bd ed ae 3f 4c 21 04 0a +8a ed 63 4d e4 ed 8a f1 34 6e + +# Encryption: +04 9c 61 44 4e 92 47 72 f9 4a 79 5c cd 99 eb 2f +e4 30 99 7b 91 b4 2d e6 16 36 29 ab 98 d2 5a 71 +e7 f9 68 86 a5 7e 97 9d 9c 94 c9 62 20 9c 1f 71 +2c 70 57 1a 81 f3 77 ea f7 4e 80 e7 07 22 e1 be +3d 13 37 c5 04 5f 79 7b d5 7d f2 f5 ae 5e f3 3a +e5 79 e9 3b 38 fb 25 0d f0 c2 bc 59 b3 3a 74 86 +7b 8f 3d fe 5b a7 85 d7 28 b8 9d 96 b3 00 2b c0 +05 4d b5 bb 0d 84 fd a4 5d b4 a1 f2 62 8a b1 12 +30 + +# PKCS#1 v1.5 Encryption Example 11.14 +# ---------------------------------- + +# Message: +0a bc 2b c5 fc d0 40 18 9f 84 22 f1 ca 04 50 21 +da 95 + +# Seed: +e4 73 2e 49 90 69 9f d7 47 40 c8 52 ae 8d 4d 70 +7f bd 79 46 0f 88 74 09 84 ae 53 ff b9 fc 39 62 +68 3e ad 0d 14 04 f5 31 51 d1 ae e8 0f cd 6a 1f +f6 5f c8 8e f0 8f d7 6d 9f dc a8 f9 e3 ac 7d 8d +82 b8 2e ce 78 9c 66 c5 40 22 80 b3 e5 68 10 1c +e2 a2 a7 b2 b2 f1 e9 65 19 cf b4 1e 60 49 3d 76 +8e b5 b9 6c cc 49 bb 0f 6e c7 11 fd + +# Encryption: +03 d8 ae 60 4f 92 95 31 73 c7 7a 01 ff a0 90 aa +0e 37 a3 8a 47 c9 72 19 c0 b9 f8 64 d3 48 74 6a +f7 f4 a6 32 11 29 c6 04 6a 99 4c ed 1c cf 33 24 +da 93 71 53 88 8d d6 c6 70 19 a7 ca a7 65 5a 36 +42 83 8e df a0 e2 ed 8d c2 5c 14 bf f8 bf f5 65 +c7 18 f8 b6 c9 20 56 c9 bb e8 d9 30 83 70 c7 cd +75 a0 4e 11 b6 e2 5a a6 c3 c2 cd dd 17 2a 4b 6a +ee f0 4f b8 35 b6 86 37 cf 0c a0 b9 a9 11 b8 b8 +74 + +# PKCS#1 v1.5 Encryption Example 11.15 +# ---------------------------------- + +# Message: +8f 98 35 ef b6 9c ca 8c 07 bf ef 4d 8f 53 5d 0c +bd a5 36 7b bd 41 08 0a + +# Seed: +32 d4 be 07 e6 c7 fb 81 d5 20 8c 25 01 c5 df 7c +56 d1 98 6d c6 d6 31 10 ad 21 d8 1e 57 ce 11 3f +3d bb fe be 0f 80 c0 16 b7 19 e9 d5 c3 d9 a3 bb +bb 2f 35 be 95 d4 56 22 2b 51 c3 d6 5b 38 8e 7a +da f6 b9 ce ae 1f d4 6a 6e 05 ca 1b b1 99 c2 7b +ac dc 8b 5f d1 4f 03 51 ae b3 fd d6 dc 1d 93 f3 +b5 31 56 ef a3 c6 + +# Encryption: +0e 47 ad 4d 92 d1 9a 1e bc ac bf 87 5d 80 19 27 +d4 fe 5a fa f6 6e d8 01 5c 55 9b 56 6a 9f 3c bf +0a be 8a 76 fe 73 24 f6 28 c2 e4 f3 45 84 a5 0f +f7 7e 82 2a 54 11 8e fa 9b ae 9d 0f a5 02 94 c6 +18 0b af 3a 8b 0c 7e 45 3a 74 37 ab 1a 19 cc 00 +30 7a 8c 6a ed 95 c3 15 b2 4b 47 90 07 24 56 c9 +44 60 99 5d bb 1f e5 a1 2b 4c f4 45 42 96 f7 40 +02 83 ce fd ce 6b 00 cc 80 49 dd 5d d8 cb 2a f3 +6f + +# PKCS#1 v1.5 Encryption Example 11.16 +# ---------------------------------- + +# Message: +6d fb d9 3b 00 78 d4 9a e4 fe 1e 24 cc a9 7d 0a +9a ff d7 be e0 62 ae d2 9d ef 0b 1c 0b 3a ef ad +81 1d 6e 7a ce 8b 49 d7 24 2a 9f e6 e2 3c 22 + +# Seed: +31 9f 9c da 2c 93 38 8e be 1a 50 e7 6c 93 97 55 +9d ca f1 4f e1 03 52 aa 51 1d c5 ba a6 4d c1 52 +fc c7 9c bb 23 d4 e6 9b 12 b9 f2 7a 79 09 15 98 +87 bb 04 12 9a d6 35 16 81 33 86 37 4f 31 89 2d +4c dc 4f e6 39 69 b5 bf dd c6 67 f9 46 89 7d + +# Encryption: +01 c5 ce 83 6b e2 20 8a 3d 81 4e 7e 60 c2 76 74 +ac b7 cd 3e 31 c0 24 d9 d3 8f c2 29 53 aa fe 73 +af 52 40 43 4d cf 54 a3 88 99 2e ac 36 ec 84 64 +d9 a0 42 ac 58 d1 8a 70 39 8b 8a 77 3e 66 69 bb +3d 76 ee ac df 1f d1 52 47 40 99 bf a6 62 a4 81 +db ab 4c a4 67 14 95 87 45 e2 b7 83 2a 59 cc b0 +05 36 49 b7 e0 95 07 43 33 3f 5f cd 6f 65 19 7d +dc b4 e1 bc 12 a6 6e 8e 92 a8 65 9f ae e5 71 31 +e2 + +# PKCS#1 v1.5 Encryption Example 11.17 +# ---------------------------------- + +# Message: +e5 87 9f fc e0 b6 29 b8 85 7c 19 5c f5 d0 9f 7b +93 bf f1 f7 a9 f2 d8 a4 5a 56 3b bb e9 e6 2d + +# Seed: +ba ce 2c ea 0b fe c2 5a 2d 34 d7 29 92 c2 b8 ea +0a ea 17 b7 a3 a8 be d6 0d 1b b5 10 13 34 7b 2d +03 6a 75 a4 ec 3e b2 c1 78 8d 44 a9 e1 c5 c8 8d +04 1e 82 af 87 81 55 dd c7 d8 1b 3e 27 cd dd 20 +40 9d bd da 4a 64 bf 83 11 a7 b7 eb 77 29 93 12 +66 1a 6e 37 df 35 02 f8 6a 22 49 2b ef ac f4 + +# Encryption: +01 e4 fa eb ca b8 9d 7b aa 3e 03 93 f7 16 84 b0 +ae 53 df 8e b9 87 3e 65 a7 16 ec 2f 41 74 1f 8b +78 16 d2 e1 97 d9 76 fd 53 a8 ee 7f 92 4b f4 bf +d4 10 42 e1 64 45 e9 06 0b 55 a0 b6 dc 16 aa f3 +06 44 91 d1 89 28 22 39 50 39 33 28 c1 47 db d0 +35 31 ec 01 2d 8c 52 75 02 e7 eb 3d ca 50 9b 7d +e1 69 95 92 46 07 c8 b2 8a 2b da 9b cb 2c 77 81 +46 1c 76 66 3b 88 7b 96 43 e2 31 7f 0e a1 d1 bb +14 + +# PKCS#1 v1.5 Encryption Example 11.18 +# ---------------------------------- + +# Message: +0a 2e 24 13 0e 8a 9d 28 df cb 9d f9 76 5f 46 83 +e9 da 78 42 5a 28 19 98 06 a9 3b 32 2e fa 88 49 +3a c3 72 52 c2 9a 26 4f 3e 85 ae 56 53 8e 80 8d +c5 56 42 a4 88 5f 05 46 40 f6 9c 89 81 fe + +# Seed: +20 43 1e f3 1f ce 19 93 9d a5 45 a0 85 30 11 2d +b0 fa 07 13 8d d8 6d b1 cc 65 e2 b0 3f c2 be 60 +7c 3e 60 38 eb b7 89 17 55 b2 31 29 fb 96 9a 7f +e1 06 10 f2 eb c3 f0 77 b2 c8 f4 60 1e 09 ab 4c + +# Encryption: +0c 14 b7 d3 2d 3d 4c e2 b0 8e e4 4f 51 6a ee 29 +90 b6 30 52 40 b2 5d 23 34 aa 31 75 2a ef 28 02 +16 39 f7 6a 4c 47 19 56 9b 30 05 2d 4b d0 8b 3a +07 f2 3b e6 86 23 7e 48 1e 67 bf 3f 5a 01 ad d7 +56 da 77 2c 7d c1 3d 32 29 8b 9b bc 3d 33 e6 df +82 d8 5c 08 9d 34 76 00 49 7a 8b 8e a4 de 68 ab +b9 0e 5c 6a eb 26 9a 97 be 42 6c ef ac de bb cc +0c 1f 2c 40 9b bc 7c 72 d9 0b db 42 6b 13 cc c1 +9a + +# PKCS#1 v1.5 Encryption Example 11.19 +# ---------------------------------- + +# Message: +7e fc 62 7b a5 fa 28 25 aa e0 ca 94 03 0e 70 47 +08 d3 5f 92 23 98 26 b4 2e 2d 4d bb e4 02 ab 7d +19 6a 7f 54 88 0c f2 c5 a4 d0 fc e5 3a 20 a3 2b +68 30 e6 2d cd 00 db cb f3 3b 5c 0c 70 44 01 + +# Seed: +f0 49 79 19 c1 42 f3 a9 8e f5 5b cd 59 88 23 4f +dc 8a eb f7 36 d4 7a f9 70 90 a7 a9 dd e0 a7 35 +09 f9 cd 41 36 26 bb 8b a7 67 c9 d6 38 49 1c 28 +6e 67 bf 22 d6 70 d5 6b 24 c1 5b ad 70 35 1e + +# Encryption: +01 db ce 3b 3f 84 b2 da 06 b1 67 e2 06 64 9d 42 +4a 42 b8 e9 ea 54 53 a1 6b 5f c6 c2 e9 cb 17 ed +a1 ef fe 4e 78 36 a5 e5 8f 99 e5 31 53 0b 40 17 +1e 4b 51 fc 0b 92 de 30 31 30 09 36 d2 59 5e 39 +10 09 e2 e5 3c 32 f7 59 60 4a 6d ba d9 c9 70 90 +0f a6 e4 1a 35 08 3f 78 7b 9b f3 be bc ea a1 a7 +71 84 1b 5e 6e 4c 8b 50 96 29 00 7b 46 7e 3c ec +8a 1d 03 23 c3 c5 db c3 4d 8d 41 25 a3 98 c9 d5 +3d + +# PKCS#1 v1.5 Encryption Example 11.20 +# ---------------------------------- + +# Message: +59 3d 3f cd 05 ac ee 30 29 81 5e 1e 76 a8 90 + +# Seed: +12 35 ee 3e 7a 9d f5 96 7f e9 8d 97 10 ff dd 5f +7e b2 2d c0 71 47 af 43 6f e2 0a a5 26 bf 0b 94 +19 0c ab b5 21 3d e9 8a 23 f5 ef 27 50 22 a2 f7 +3e 60 e9 ef e2 c0 34 c5 5c eb 26 aa 80 6c de d6 +73 9d db 2c bd 3e c3 b5 55 20 4a 79 84 65 c3 7c +67 57 19 56 86 a3 ea 3c 56 57 c3 60 a0 15 8d 99 +2d 4f eb fa 04 29 ee b7 c9 2a 46 84 34 c5 b7 + +# Encryption: +0f 69 98 81 a1 52 46 18 bc 25 d4 e5 14 e2 07 30 +68 ea 7d 35 38 4b af d4 6f c2 82 e1 d8 55 11 9e +e9 69 f2 11 c7 18 4a 07 03 06 47 fc 40 99 0e cf +2e a4 05 22 86 5d 91 77 8a 62 7e ca 8e 50 c2 bb +97 60 b0 45 da af 12 77 a4 fa 98 35 76 ca 8c fa +d7 60 83 29 c1 88 15 88 01 7d 63 72 2b 70 e9 8b +e5 24 e0 03 39 95 98 25 73 d3 38 70 78 c8 b7 c1 +c5 f9 ae f2 64 a0 48 46 84 b3 42 66 43 73 7d 34 +bb + +# ============================================= + +# Example 12: A 1030-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +26 1f e0 28 44 59 c2 fa 6f 05 54 6b ed 58 5e 1e +e0 a1 30 b7 1c 2b 8a 6f bb 3b dc 75 78 7b 26 55 +d0 ed 4e 32 5b 54 c7 b3 71 a6 fc f2 b6 78 82 77 +a5 0d 47 05 ba 23 c5 96 28 5d a7 e3 c9 30 4a 41 +e7 cc 48 8b 44 92 2f 7b e2 b4 7c 16 31 9e 33 74 +51 17 3d 40 b1 ea 48 1d 1a 9c 11 29 b1 fe b7 d0 +9f 67 49 7a eb 98 94 8f 1a bf 3b 77 86 bd 3b 87 +04 71 87 c8 f3 70 15 68 2b 3f 2d e5 0e 07 8e 8d +0f + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +26 1f e0 28 44 59 c2 fa 6f 05 54 6b ed 58 5e 1e +e0 a1 30 b7 1c 2b 8a 6f bb 3b dc 75 78 7b 26 55 +d0 ed 4e 32 5b 54 c7 b3 71 a6 fc f2 b6 78 82 77 +a5 0d 47 05 ba 23 c5 96 28 5d a7 e3 c9 30 4a 41 +e7 cc 48 8b 44 92 2f 7b e2 b4 7c 16 31 9e 33 74 +51 17 3d 40 b1 ea 48 1d 1a 9c 11 29 b1 fe b7 d0 +9f 67 49 7a eb 98 94 8f 1a bf 3b 77 86 bd 3b 87 +04 71 87 c8 f3 70 15 68 2b 3f 2d e5 0e 07 8e 8d +0f + +# Public exponent: +01 00 01 + +# Exponent: +05 df 76 83 72 cc 0a 64 d3 c2 14 18 30 24 23 13 +9f 47 95 73 e5 0b 5c 09 b6 e3 be 23 fb c9 aa 1a +76 d3 27 99 a0 47 76 1f fc 21 07 94 48 17 01 04 +cc a5 e2 a1 4c e4 57 d0 0d 80 7d 42 c7 6a 55 f6 +16 87 4b a7 f7 ea a1 ce 63 cb f1 32 de b0 81 aa +d2 fd 80 d1 24 c4 da 86 ec 6c 02 0e 8c a8 2d cd +cd 35 54 e6 9b b1 98 72 26 2a 50 31 ab 5d b7 cc +8c 92 59 a1 46 d5 8b 1d b9 4c c7 e7 56 25 3d 5a +a1 + +# Prime 1: +06 77 25 ab 55 34 18 e1 eb 8a 41 f4 fd 92 d2 80 +b6 9f 85 b0 8c b4 02 f0 1a a4 96 92 c7 20 9b 36 +42 98 ee f4 e3 3d c4 22 bb a3 35 03 d1 1a 12 7d +d2 86 43 f7 e7 75 58 97 e2 eb 96 c4 dd bb 91 12 +f1 + +# Prime 2: +05 e5 8c eb d4 7d 87 b1 e7 8d a2 fe ee 6d c5 f9 +bf a2 20 c3 55 e8 20 c8 fb aa 88 46 df 11 00 36 +2c d1 69 1f 5c bf 5c 78 68 c4 72 d0 28 2a be 01 +03 16 1f 4d 8c 62 af f3 5b b1 fb 7c c6 99 d9 9f +ff + +# Prime exponent 1: +01 6c c9 14 95 d6 c1 95 29 40 73 80 f7 52 20 aa +d5 95 1a f5 ea 4c d2 48 f0 d6 4d 89 53 f1 cf c3 +89 b2 03 18 5d ed 03 09 54 a9 87 c9 ab 90 3f 7b +13 a7 1b db cb 5b 85 87 14 30 30 2e 7b 60 17 7d +41 + +# Prime exponent 2: +f9 cc 89 15 ff b3 dd c7 c0 93 71 76 49 2a 12 bb +18 7c 2d 76 e0 d3 d4 0e 79 58 d5 c9 82 09 b3 ed +54 b5 fd 9f 9e 77 11 e1 dc 68 57 73 de 26 d5 0a +0a b6 21 62 12 ce a5 09 ce 79 1c 5b cd 07 cb 47 + +# Coefficient: +05 fe 93 3b 87 3f 1d 68 f6 be 2d 4d 5a a2 2d 96 +8f 2b 7a f5 41 a2 dc d6 4e 09 c0 30 b1 50 35 8a +98 02 ae 86 59 95 d7 6a 50 03 7d 19 8d 7e 70 4d +26 84 7a da 8a e3 d3 85 c2 96 5f b1 7f cf 15 2f +77 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# ---------------------------------- + +# PKCS#1 v1.5 Encryption Example 12.1 +# Message: +7d e6 9c d9 22 8b bc fb 9a 8c a8 c6 c3 ef af 05 +6f e4 a7 f4 + +# Seed: +33 d6 2c d6 67 82 3f bf 13 d5 92 ae 4d 02 a2 37 +0d 1d 99 db 06 c7 25 42 5e 0d 12 fc b4 83 4e f9 +e5 49 9d 60 7e 8a ae fe ba 81 96 49 fb 3d 61 c7 +05 f5 e9 a3 a2 f8 96 27 61 89 a3 20 0d 2f af f7 +76 79 e0 56 34 9a 5b 9b 7b 44 49 b6 75 cd 48 b6 +98 09 32 c2 cf c4 6b f8 9a 77 34 f6 8d d9 f4 fe +77 e1 d9 cf 1f 31 b2 1c 4c 61 + +# Encryption: +04 ca ef fc d5 1c 3f c9 23 63 46 77 4d a0 cf a7 +7e 9e 64 65 f6 43 7f f4 6d 9f a4 58 b3 62 34 12 +c3 10 30 09 fb fe 20 31 96 df 72 96 26 e0 ee 3a +fb 6b 10 a5 ac d7 2e 84 28 1d 9d 9b cb a3 e0 ef +77 dd 84 f3 db 19 2d 31 b5 b6 66 f7 6c 93 81 06 +81 37 3b aa 58 e6 da db 01 fa 5c 65 ec 89 fa 51 +cc 24 74 61 1b 9a 7c b0 0e 86 2f d3 d4 9b 1c d3 +1a fc 2d b4 49 e0 9d ae 2d 0a 7d 4d f0 bc 32 0b +5a + +# PKCS#1 v1.5 Encryption Example 12.2 +# ---------------------------------- + +# Message: +97 ee a8 56 a9 bd bc 71 4e b3 ac 22 f6 eb 32 71 +96 69 c4 2f 94 30 c5 89 50 c6 4c 0d ab ff 3a 9e +20 43 41 6c 67 ca aa ab 7c 68 cc b3 ca 99 a3 + +# Seed: +9f 14 12 61 ce c4 f2 c5 2f 96 91 25 a3 6f 14 10 +27 08 82 50 d3 6b 17 42 1c d0 96 14 76 19 06 46 +8a fa b7 62 2c 0d 02 19 36 91 74 47 91 e0 d3 5b +6b c9 f3 37 7e 10 b2 85 6c 8e d9 19 9c 89 f4 a4 +16 13 d3 c4 0c ca 37 3a 7c c6 3c 52 60 fe 5a + +# Encryption: +0d 26 a0 5d e9 3b 70 7b 85 40 fd c1 98 89 d2 d1 +e7 93 71 57 d3 2d 30 3c 52 8d e3 5e 55 3f 94 20 +28 74 4a f6 a0 40 2e ca 0f cf 5a 85 26 1a d4 75 +d8 71 0c c9 f8 b1 1b a2 c6 da f1 d6 72 69 0c 68 +ed 11 e0 35 e9 c6 60 ec e1 d8 0c da b8 00 ea d3 +c6 e0 78 61 7a 1b 0d 27 3d ed d8 d6 57 49 16 6b +d0 77 74 fb 4c 14 86 aa 8a 0a df 59 5d bc 3d 10 +ff ae f1 83 84 98 a6 75 55 c7 7b 6e d9 83 d5 b9 +de + +# PKCS#1 v1.5 Encryption Example 12.3 +# ---------------------------------- + +# Message: +8e 3e 77 2f 39 + +# Seed: +9e b7 31 fa 6d 8d 5b 75 81 f8 fa d2 c8 22 5b c9 +68 34 af 61 db 3d 40 9d d5 63 04 ae 23 ea 62 69 +63 a4 d8 04 40 c2 4e 43 1e 41 97 60 90 3a c4 4b +fe 41 a7 50 81 a5 46 2b ae 65 47 c0 e7 a0 6e 91 +60 df 9c 01 fa 6c 53 54 c8 33 18 db 65 6d ee 0a +43 77 87 fa 46 39 4e 55 2e a5 33 15 59 b4 01 7b +b6 a0 e1 d6 fc 8a 65 b4 5d a0 c4 5d 88 95 48 61 +cd 6e 7a 41 7e 03 7b 1b 05 + +# Encryption: +24 4a 86 34 51 9a f4 9f 56 9b 69 86 ab 47 79 64 +a6 b2 92 0d 84 3a 1d 97 ef d7 fe f8 3e 81 ba da +4c 4b 56 29 61 ef 4e 1f c3 33 46 4b 92 6b d7 4b +07 ad 50 c6 5b 68 16 83 d3 89 fe 41 d6 d2 13 b6 +46 9f 18 2b 14 b4 62 d7 2c 1c e3 92 8c a8 06 d9 +66 b5 2d 42 d0 bf d6 0c 9d 04 91 4d 50 83 7c da +e0 9b 33 0e 37 27 44 dc e1 7f 18 e9 4d 71 1c 8b +58 ea 44 9f 14 49 d3 69 fa ef 51 46 83 d3 01 60 +79 + +# PKCS#1 v1.5 Encryption Example 12.4 +# ---------------------------------- + +# Message: +dc fa e7 71 8c 24 7c 40 f9 a2 a3 c3 53 5c 50 92 +80 c8 73 c3 + +# Seed: +b9 3b be a6 c1 85 3f 15 3b 5e 01 e7 e4 e5 d0 c6 +3d 9d fb 24 5f c6 cf 64 04 3d 7a 92 20 b0 b8 1a +c2 af 65 6b 99 71 4b a4 30 e0 a3 96 95 d2 5f f2 +69 b0 b9 b8 65 fc 4d 4e ee 5e 07 a5 b5 be 35 43 +82 aa a4 14 bc 62 08 54 5c 86 ce 02 38 8c 07 b3 +76 fb 02 98 c3 7d 1a c3 9e a1 89 b0 ad f7 80 f6 +e8 30 bc e9 17 b5 0a db 7a 31 + +# Encryption: +0c 41 20 52 d4 ef 4a b5 1b 2f 62 37 05 f0 7f 41 +fa d6 4d af fd ba 62 44 ef d4 7f 51 9d e2 e7 1a +01 a6 c5 7d 1f 28 b6 bf 7b 5c 8d bb 9f e7 b1 49 +b0 eb aa 53 59 61 99 37 6d f4 90 32 3d 25 c2 17 +bc 71 be 37 f1 81 03 5c f4 57 eb 5c 06 d6 a3 de +d3 d6 6d 5b 35 f0 61 81 bf 94 d0 ec 13 ec 44 7c +70 82 33 49 1c 55 4f 9e 99 1f 6b cb 8b 78 d3 3c +9c 36 95 5b 8d ce 51 79 ff 8b c5 92 44 f6 67 90 +87 + +# PKCS#1 v1.5 Encryption Example 12.5 +# ---------------------------------- + +# Message: +d7 1d d8 7a 13 99 1a 0d a2 c7 4a 58 b0 48 56 34 +b3 e0 4f ec 9e 3f 1c f2 60 4a 93 be d7 96 96 fa +63 78 eb 1b a0 e5 d2 04 70 a4 + +# Seed: +09 90 59 92 58 e9 7a 2e bf be 10 97 72 25 c4 16 +76 2e 95 d2 55 3a 80 1f 72 6c c2 49 bc df 32 21 +32 58 57 19 fc 12 39 9a cd 72 54 ae 77 da 34 3f +e2 a9 a3 ac b1 1c 14 e2 14 e2 d8 5a 76 70 8c 3e +72 17 3d a5 d9 90 58 e0 c8 70 9e df 28 c3 69 38 +76 9f 1f 22 + +# Encryption: +0f f9 cc e7 b6 9d 7f ca 48 d7 c4 f6 cc ff 24 8c +3d b8 8b f1 b7 85 2c d9 d8 52 5c 3b 41 e4 4a 9b +54 0f 20 8f fb b8 c8 5b fa 89 0a c0 2e 99 49 59 +d6 b0 7f 64 81 40 78 55 6f 8e c6 0d b3 57 ac ea +f8 39 11 5f ad 41 f8 91 8d 69 c2 1a 3a ff ef 6e +b1 4a 5d 2c d0 64 5c d7 06 b5 81 43 39 4a 27 35 +36 82 e3 ba a1 98 00 2e 16 80 f2 8f 34 be 08 9a +57 84 ac e5 ca 6b 11 08 99 df b9 58 2f 2e 4b 2a +40 + +# PKCS#1 v1.5 Encryption Example 12.6 +# ---------------------------------- + +# Message: +5e 4b 15 8f 8d cb cd d7 e3 08 38 5b 40 19 0f 5d +ef 8c f3 30 5f c4 9d e6 3c 9e 35 b4 02 36 ae e1 +f4 56 20 5a 52 67 a2 aa 7d 88 cb 2c 11 af 7f 28 +99 d0 1d a1 b2 c7 46 6f fe f7 + +# Seed: +a5 22 f9 80 8d 9c 01 d8 ff 79 77 5f 7b 22 09 8f +c5 fe 32 54 e1 b0 4e b1 cb 85 0e 10 e2 c5 06 5e +23 27 4d c0 a0 55 87 43 6d a3 75 59 33 5f e7 09 +3f a5 e7 a2 a9 c9 a4 dc af 23 51 79 d0 e9 8f a3 +3e 34 b6 16 + +# Encryption: +1c 0e 86 a6 36 6b eb 1e 12 d6 bc fa 6a d4 94 06 +c8 b7 e4 8d 1d 5b e4 5c bd 83 19 49 87 49 6f aa +3e 21 92 7e c6 62 f5 02 ac 3f 91 a4 b4 b9 1d 16 +0c 19 86 a5 ed 09 27 66 88 3b 85 55 e3 c9 31 4b +44 ba 33 83 db 28 74 23 af 91 b4 13 91 8c 08 02 +c7 77 8e 46 c2 96 dc 9f 04 cd b8 b0 6a dc 7c 53 +d8 59 f4 42 cc bd 5f fa b5 af 75 2b 97 9b f5 23 +a4 0a 1d 08 d7 60 63 ff b3 d5 cf c8 2f 15 eb d6 +d4 + +# PKCS#1 v1.5 Encryption Example 12.7 +# ---------------------------------- + +# Message: +35 9b a5 07 56 a8 03 30 40 9d 3f 23 6a 34 0b 90 +f4 2f 73 2a 87 71 1f e2 23 52 d4 c8 25 0d 45 47 +5e 32 b9 58 83 e1 60 97 55 a1 3c df c1 bf 39 4c +5c 67 36 9e ca 1f 9a 33 e8 ba + +# Seed: +f9 eb dd ac 9d e1 70 9a 06 bf 6b bd df 58 94 e2 +3b 96 2b a0 c0 64 bf cd 7c c5 76 60 3b 0a 1a 1f +f3 5d 64 5e e8 7a c6 f8 21 a6 a1 51 e6 bb b0 5b +f3 e0 5c d9 a6 e2 cd 9c 6c f5 53 bf b0 7b d2 fd +a0 40 df b6 + +# Encryption: +08 33 60 e6 49 05 9d 00 65 8d ba 21 f2 df 28 a2 +76 4c 45 89 f7 a7 7d 5a f9 95 79 a8 ab 44 80 c8 +26 a7 7c 2f b7 95 4f 4f 31 fe 1d 9e b1 bf 40 e8 +09 57 7f 39 30 1a d3 ab 95 b3 81 6c 90 ec 3f 1c +d6 29 c4 39 61 74 be d9 fe 1e 0f 47 68 23 e5 3b +41 d1 35 b4 9a 02 b0 0e ff c7 61 ec 90 94 23 af +15 85 52 37 b7 7e e0 7d f2 5a b4 e8 58 46 7d 4c +cf e8 08 43 24 1b bf 88 eb 4f 85 3e f4 b4 3b a3 +ac + +# PKCS#1 v1.5 Encryption Example 12.8 +# ---------------------------------- + +# Message: +a9 f3 9f 8b a0 64 66 25 0c 26 5d f0 ca 46 57 0a +16 01 12 cf 38 fd 74 59 99 + +# Seed: +88 b3 c2 8b d3 99 9a 86 0b 8d e7 75 93 5b 8e d7 +8f a2 f2 7c 26 8b 24 3a 02 45 af 86 72 25 47 19 +f2 3a 4b 7f ed c0 0d 54 e1 2e 9d 70 1f 64 69 94 +24 b6 b8 7d 14 d9 67 6e fa 95 9b e2 1a 04 b6 43 +5d 25 10 03 dd 15 3d 7d 08 ff 28 d9 3a 93 20 dc +1b bc 3d b3 97 a5 48 94 f2 05 79 f9 3e 4e ad 65 +c3 1a 40 7e b4 + +# Encryption: +19 83 96 50 b9 25 f1 f9 6d 61 1e 4d bb 91 49 93 +54 5c 67 39 0c 32 93 5f bf 82 25 9d ad 10 f2 37 +30 eb 48 f3 42 00 46 5a 20 38 72 77 e2 b9 61 e0 +83 18 d2 07 74 47 c9 10 92 71 e4 de d8 ff 3d c4 +f3 79 ee e4 55 ae 96 08 1a 1a e2 4b 96 ca 73 0a +62 f7 ac c5 a5 ea 52 28 e3 a4 8e a6 74 1c b3 0e +82 9d 55 09 cc c6 c2 87 c7 29 1f 3a 1d 89 d6 26 +bc 98 15 77 de 52 a1 1f 12 ae 21 43 d3 b0 b5 2f +86 + +# PKCS#1 v1.5 Encryption Example 12.9 +# ---------------------------------- + +# Message: +68 + +# Seed: +53 8b 09 5e 4f 2a d6 77 30 68 74 21 91 52 42 25 +1d 07 f6 61 ed ac 7f e7 9e 31 d6 c3 45 af f5 9d +f3 88 c7 18 2f ff 0c 04 27 b5 99 35 c6 91 da b8 +bc 42 be 47 d7 69 11 88 0d 91 7b 86 27 18 b4 c1 +c1 88 8d 42 20 b9 f8 23 1a cd f1 2d 9b 85 18 6b +e0 95 0c 1a ff 84 cd 0f e3 65 86 a5 0e 7e 04 b1 +72 ca 9c 85 9e 2d ed 6b 8e a5 79 dd 5e 6e ee 77 +2c ca a6 b4 a5 d8 ab 17 31 a8 35 d6 a8 + +# Encryption: +1e 86 8a db 0e 65 32 80 60 4e 8d 3b c4 d9 69 84 +a2 0a a0 9d 48 0b 4d ff ac 62 ba 78 cb b7 ee d0 +64 5a 6d 94 d9 d2 f2 d1 e9 17 c1 46 b4 1f aa 3d +1d 2c 19 01 05 36 8f b4 84 06 a1 d2 42 6a f3 dc +c8 5b d0 2d 5c 26 c8 97 cc b2 2e 57 59 12 64 1a +18 8e f4 ac 47 a0 a9 fe 9a a2 70 6d 8e 10 61 f5 +d9 30 63 f4 90 17 00 3b 23 09 ca 7d 8d 36 70 3b +fd da 3f 7f 43 df 15 8a 15 bb 22 13 9a ae 15 10 +77 + +# PKCS#1 v1.5 Encryption Example 12.10 +# ---------------------------------- + +# Message: +35 65 87 e6 c6 c0 b4 6c 24 45 e0 18 63 52 76 ab +84 5f d1 07 6d 10 7f + +# Seed: +e5 d3 3e 4d 93 c7 08 44 ee 4a 01 65 56 24 2d 08 +e8 e6 2f 1a 7f 79 47 79 e2 23 ee 9d fb 23 1c 3a +52 0f 29 7e 50 73 e4 f9 2f 53 5c f1 44 55 7f 94 +ee 1e 1e 5c c6 bf 4c 0c 0c 8e 5e d4 0d 06 63 56 +06 f7 54 cc 2d d8 3f e0 2c 57 6c cd 2b 83 5f d0 +f5 3a 99 08 3f 4d 15 bf e9 26 88 99 ef 09 ff 5f +2f 3c ec 9f 9b 8a 7e + +# Encryption: +15 d3 64 a4 49 9b 30 a5 f7 8b 6d 7d 4f 66 7a 1f +76 d7 15 15 8f 28 01 19 b0 55 e1 f2 66 3f c7 96 +e3 3c 0e b6 4e 34 a8 da da 5c 81 75 42 57 a8 bd +f0 ed 81 15 f6 07 b7 c9 cc a4 81 f7 45 20 b6 d9 +ac 98 f5 e7 2c 2b af 3c bb 6b d9 ba ea 5d 75 86 +0c bd ae 34 03 fd 5c 37 96 4a ae 64 36 6a b0 9b +c9 c6 72 76 95 14 48 19 3b b4 b1 af a2 70 79 c3 +41 70 a2 69 56 51 0d 44 27 64 22 99 08 42 0f e8 +0a + +# PKCS#1 v1.5 Encryption Example 12.11 +# ---------------------------------- + +# Message: +e1 53 27 6a 68 79 67 8f ee 19 89 48 28 d6 26 2e +a3 9a d0 54 c8 9e dc b2 3f 72 dc da 1b 00 73 c2 +87 62 02 18 d9 2d 0e b3 0c 62 af bf 2b 45 df 62 +d0 66 65 f8 05 25 b6 72 7f 95 e3 42 29 e6 82 a8 + +# Seed: +2a d7 14 2f cf a3 bd be b7 55 b2 c5 b5 cf 13 e6 +96 9e b7 3b 7a 06 bc 29 bc ad 7e 75 30 a5 90 23 +0f 6a 43 fc 03 d6 c3 a9 c6 41 e5 3a 41 77 d5 75 +02 91 ec 6d 4b 33 f8 71 66 8a d8 56 90 77 + +# Encryption: +17 8e 49 77 0a 4c 8f fb 7f 65 f3 82 cd b5 76 e6 +08 e9 75 c4 37 13 39 10 2b 95 2a 1e 71 cb cb 91 +fd cd 0c 0e d5 a8 5f bd 26 3d a6 a7 4e 49 1f b0 +4b 60 a5 96 1d 8e 6a c7 24 ec 8a 81 61 c2 2a e3 +10 40 7f 59 f7 e6 02 da 48 aa 2d ad 68 3e 88 db +1d 84 29 5e 0f ba 5f f2 f6 73 df 32 85 4d 01 b7 +1a 89 46 0f f0 e6 e1 be 98 ae bf a2 27 e3 97 ea +cc 8b 23 17 41 47 c4 4e 16 20 1e c6 ba bd 16 5b +a4 + +# PKCS#1 v1.5 Encryption Example 12.12 +# ---------------------------------- + +# Message: +fa 4e b9 31 a7 e2 09 0f 31 ed b1 ff 7d 83 61 + +# Seed: +43 7f a1 51 f4 34 05 db 22 42 2c b3 5d 1c 57 61 +16 1c b9 a7 8a bc b6 f0 6d c4 e7 a8 69 48 1f 40 +b2 1a e1 d3 3e 07 5c 48 5c d8 50 1a 3c aa 60 18 +32 5b 7f 85 0d 4d 8f 6d cf d2 af fe 19 d3 e6 c7 +08 74 e7 10 11 14 f0 fb b9 82 25 81 ba e6 ba 2b +a1 e7 49 88 81 a5 dc 5b b8 85 27 38 a8 2f b0 6d +15 27 b4 33 44 87 b3 24 01 3e 32 bc f1 7b ab + +# Encryption: +22 6d 77 67 00 c5 e1 dd b9 99 4b 32 91 f1 d3 34 +b6 9d d8 63 06 5f a8 34 21 e0 1d 52 06 ec 2c db +89 90 cf 78 97 31 09 dc 9f 12 6b 60 33 d6 d5 d6 +91 8e c8 50 d6 9c 71 3c b5 bb e3 2e e5 9e 44 5b +cb 4e 50 c6 f1 64 43 4d 2a 6c a6 39 69 a2 9b 25 +03 64 15 b0 f7 cb 21 b4 f8 b3 4a 8d 9b 74 65 3f +ff 4f 5d b9 d1 a6 b5 15 2a 64 48 36 b6 8b 8e de +9d c5 a1 69 dc 60 dc 5f ac 46 8f 24 27 84 58 10 +62 + +# PKCS#1 v1.5 Encryption Example 12.13 +# ---------------------------------- + +# Message: +58 81 15 e5 37 09 eb 15 a3 37 4c 25 32 9e 88 38 +26 e3 21 3f 37 a1 b7 a6 5d e1 2d f2 31 72 f1 7f +a4 96 ff 49 2b 09 17 3b a0 c6 f5 8c 29 3d 47 f1 +48 + +# Seed: +07 81 85 e0 83 cb b0 6f e1 a7 49 74 35 15 f3 a0 +b4 b2 6f 85 3b 10 e5 68 e8 70 82 ce 44 41 2c a6 +7e 59 88 8c cc 0f 50 31 01 52 1a ca bf d9 8f b7 +b5 c1 1d 8a 94 1b a0 3c 49 5a a0 3e 13 52 2f 48 +7f 6e 16 16 be c2 07 2b 39 96 fa ee 29 + +# Encryption: +0e 7e 50 a7 b2 47 b0 29 7d ec 65 c9 52 3f 67 ca +b6 b5 2a 02 5f 53 32 0e 94 86 cd 20 74 10 ca dc +74 e4 b0 3f c0 6b be d5 98 b0 22 b6 3b 37 76 2a +65 fd 35 1c b2 72 7f 3d 80 35 a4 cd ba 9c 6a 31 +e4 ed 6b eb 4f ed 31 34 eb 63 df ce ab 4f 5f 24 +59 e5 9f ca 01 74 75 8a ab 37 53 b5 c1 93 c8 1e +11 49 0f 97 b6 22 b7 3f a7 3f 8e ae 7d a8 39 34 +84 b8 29 79 71 a3 e9 23 12 9c e4 35 7b 64 5c c6 +38 + +# PKCS#1 v1.5 Encryption Example 12.14 +# ---------------------------------- + +# Message: +20 f1 cf aa 63 67 c7 c3 9b 54 a0 + +# Seed: +4a 1c 7b 70 f7 83 ba 0d 5a 26 d4 64 5c f0 5f a6 +10 f5 be 01 77 fd de 9f 2c 34 50 57 db 42 44 57 +fa a4 30 c9 42 4a 54 f7 e5 5f cf ee 6f ae a4 24 +4c 03 97 74 81 ed fc bb 28 88 37 c6 a4 8d bd 72 +96 67 7a 24 e0 6c c9 d8 5e 68 8c 14 09 0f a2 83 +0f f4 96 79 33 ea f0 db 69 4b 6a e4 02 ca f9 c2 +be ff 04 a5 2a 2f 84 7f e4 0f 4f fb df 3d 58 b7 +c4 fd a8 + +# Encryption: +1e 52 84 20 bc bb a7 d5 9c 6c 40 d4 46 d1 aa 95 +6a ff 03 05 36 5b 4d 7c e9 81 0f 22 c3 4f 09 a5 +55 e5 ff be 51 75 03 7f 90 3e aa 6c 40 56 36 36 +d3 81 f4 53 25 b5 e6 1a 2c 70 51 12 55 64 02 a7 +dc be 86 cf a5 4a 6e 6a 50 37 8d 05 e2 1c 95 cc +6c 45 ff dd 05 17 f7 7a 36 b2 24 d1 70 0a 1f 3e +bb 81 d3 67 8a 66 e1 45 34 a8 0a 59 8b d7 17 26 +fe 32 2e 73 9c 17 eb a5 08 da 8a 03 1a 27 f6 bb +28 + +# PKCS#1 v1.5 Encryption Example 12.15 +# ---------------------------------- + +# Message: +73 60 cd b6 c1 59 96 b0 60 33 1e 9f 2a 36 89 95 +c0 64 ad da 56 55 95 27 78 2c 17 0c 69 1b b3 bd +3b + +# Seed: +58 dd 80 f4 fd c5 c9 5d d9 eb 56 ac 80 a0 2d 53 +e8 cc 2e fb 3c ba c6 72 7d 75 b1 e7 b3 5e 05 42 +19 43 3a f5 aa e1 98 fd 62 f2 ec d2 ab 8e 26 38 +77 b5 c9 1e d5 13 e2 35 49 7a 63 19 2d b9 a9 bc +b3 bc a9 7a e9 bf ce df 93 56 44 b2 d3 bc 20 e0 +2a e5 e7 42 4e 81 2a 29 49 61 6b 82 01 + +# Encryption: +20 3b cd e1 b4 12 e3 ce a2 5b 86 30 b2 08 f9 78 +ab 22 c1 da 81 25 07 6e 10 ff 91 d7 bc fa ef d7 +dc d8 39 16 55 c8 86 e8 a9 45 a7 f5 7a 74 ce 2d +c0 e8 ec 7f db 17 cf 19 57 80 d3 ce 80 e0 dd e7 +63 9c 67 72 05 b8 f9 ec ea 11 54 68 97 7b de a3 +50 0b 23 9f ce 0d 7a 94 be 6d e3 33 ea 7e cc 22 +c0 7e 65 d0 eb d6 5a 39 0a 18 5f 18 17 89 e7 ca +8c 1a c2 fc a8 28 bb 8d 28 22 7e 38 c9 88 9c e0 +08 + +# PKCS#1 v1.5 Encryption Example 12.16 +# ---------------------------------- + +# Message: +31 9b 82 94 bd f0 7c d4 06 85 e8 80 09 fa 7b 3f +12 90 16 0e f3 30 67 ad d5 ef 4d 80 fd + +# Seed: +4e 07 d7 f9 63 be 24 ee 6d 8b d4 dd 95 e9 e3 33 +49 30 e0 3e 65 8d 29 6b b7 95 48 6d 72 4e 07 41 +dd 50 73 47 a5 b5 7b 79 c9 0d 3c 90 c1 ae a7 16 +19 09 1a cc 81 98 b5 51 22 da 50 99 58 2e 0d b7 +da 3c bd 3c fd 85 29 8f 31 55 4e 29 cb cb a1 19 +9c e4 70 16 3c a0 33 7c c4 14 ad 32 76 70 81 11 +d6 + +# Encryption: +04 fc 7b b6 fb 64 19 61 2b 6e f5 4b 3c a0 0a 87 +46 51 95 c3 7f 7f 94 0c 23 3e cb 1d 4a 50 5d 3c +56 ed 23 e0 9e 03 f1 45 4f 04 b5 6f 6d a2 5d 0a +6f ca b0 c4 00 87 4a e9 80 6e e1 87 80 b7 5c 6c +a5 66 29 e5 77 e8 e7 b5 d2 fc 2c 44 0b 98 00 19 +5b 58 51 1b c3 a7 95 44 12 c8 f2 73 cc 0e 9d 97 +1a bb dd d7 02 8e 6f 84 87 6a 30 58 a4 54 fe 2f +33 c7 5e 3d d0 62 f1 19 cd 3e ca 81 06 b6 bf be +a4 + +# PKCS#1 v1.5 Encryption Example 12.17 +# ---------------------------------- + +# Message: +79 c6 82 a2 b9 79 fe 5c 96 32 af 18 31 c2 aa cf +0c 6b f5 66 88 5b f5 25 62 50 + +# Seed: +5c 2a 95 6d 4b 5f 06 f7 50 83 5a b8 b2 9c f7 c6 +41 d7 93 c5 56 e1 2a ab a9 56 df de 46 32 d5 e5 +02 d5 90 41 78 3a fd 1d a7 b2 e2 d2 4e 22 d6 44 +78 35 bf 6d 77 c6 ee bc 0d 2d 64 e7 ed 2c 14 17 +18 ad 86 87 c5 97 b7 71 8f 38 bf 1a 33 16 ed ef +f6 b7 2e 28 51 82 88 07 bc ff a9 b8 e1 a8 52 f3 +fa a8 07 f6 + +# Encryption: +25 1d 48 56 b7 a7 58 0d 53 88 01 62 28 1b b4 e4 +1b de b2 a8 7d db d5 ae 1b 30 7d 44 48 be 1f 11 +69 5f f7 22 c4 32 41 5d 0c 74 ba a3 fc 0d d5 11 +66 ac 86 5b 31 0c 4f 5c 87 07 98 62 54 c8 96 04 +cc da bc e6 c6 92 44 66 21 89 8b 4f 5a 08 bc df +64 62 e5 18 ee 3a eb 75 e2 6d 8f 63 a0 6f cb b3 +df 09 8c ee bb 0f d2 f6 37 e3 a7 93 7f 4d 19 e3 +a1 92 4c 16 08 2e dc 33 3c b6 de 37 63 72 46 e4 +98 + +# PKCS#1 v1.5 Encryption Example 12.18 +# ---------------------------------- + +# Message: +1e 0d 18 07 a2 bd 49 6b b0 cb a8 41 c7 71 58 bf +a5 f8 aa 77 d0 56 75 c6 4a 5e b1 85 65 91 d3 48 +54 f8 65 92 5b 37 1b 68 6a aa b4 45 98 b4 a1 6a +b6 b7 93 44 d3 c2 3f 7d 5b f1 73 b8 42 d7 8c + +# Seed: +db af a5 33 2f 0b 55 27 96 63 6d 8a 09 28 b7 d8 +7d 9c ee 3d 4b e6 a3 1c 77 e1 4e 0e 5d fd d4 03 +ef b9 8f a3 38 81 6e 12 62 c0 64 96 fd e9 d5 57 +c0 0c c0 dd 35 fc 33 ac cd 79 a3 15 06 90 eb + +# Encryption: +1b 2e ce a5 fa 90 03 fa b6 55 98 57 c6 d9 4f 95 +70 03 f4 e4 1c 09 45 64 80 4f e6 96 39 e5 40 b6 +8f 26 3f aa ec a1 99 69 7a 48 85 8b 8a 0f ce a4 +91 05 7d f2 fb 8b 35 d0 93 d8 94 ae c1 7c 5c de +5d fd 8f 33 51 2b cc 66 cd e7 6d a0 73 36 98 5a +97 43 5b 6e fe e4 ee 09 d3 a2 8a ff 34 ce 6a e8 +75 0d a4 1e 16 ca 47 e9 38 81 8e 44 a9 b4 1f e9 +1a 6a 80 1d 35 5e e8 d6 60 e2 7e 4f e2 ce 7f 32 +5b + +# PKCS#1 v1.5 Encryption Example 12.19 +# ---------------------------------- + +# Message: +1c 10 5d 5e be a3 66 46 a9 72 84 c1 7a 86 c4 + +# Seed: +c6 f8 03 40 a6 55 7e 07 53 a9 57 3f e4 f5 21 49 +77 ef db 08 2a 50 eb 5d 5c 51 7d 46 72 9f d2 a3 +4a f7 ce e1 aa 46 b7 9d 47 e2 5d 83 09 0a eb 4f +50 22 98 c0 31 37 24 fa b5 4e 54 be bb 48 d6 cd +9b eb dd cb ee 0f 07 53 77 27 d6 5c 50 e7 d4 cc +0c 6d 19 fc 48 0b a5 78 67 26 2c f2 ee dd 9c fa +ba 60 7d 65 82 87 eb a4 2b 46 99 44 cc b6 12 + +# Encryption: +05 b2 3d c0 c6 2d 90 c1 77 1e ba 37 8e 43 17 9d +7c a6 af 51 5e 26 19 ae 4d 7c 8f c8 bd a3 78 cb +f7 a1 db ba 1a 14 f4 94 c4 e0 d7 13 38 79 7c 7e +e0 6e 1a 79 e9 ff 28 56 fb f7 4f e6 f1 a7 ca 6e +5b 9c a2 83 c4 c9 7e 61 cf 9f 40 73 e0 32 ca 27 +d6 9b 1b 4e eb ea 77 cc 95 a9 28 1f 26 b6 4a 05 +a9 39 44 c8 2c 5a 13 42 8e ce 21 fb 44 01 ad 42 +6e 7a c1 f0 5b ff 84 b3 47 cd c4 db e5 2e 67 8a +ed + +# PKCS#1 v1.5 Encryption Example 12.20 +# ---------------------------------- + +# Message: +f1 04 02 f0 02 05 c5 27 57 ed 6e 9d + +# Seed: +e2 ae e7 fc f4 3c ed e0 75 52 a2 df e5 b5 a9 ef +80 82 76 d8 f1 0e b3 f9 bc 50 f1 bd 94 0a aa e6 +34 c9 d8 a0 78 8d 44 d4 1e 8a 5c 60 36 49 ef ea +83 03 32 31 51 6c 69 d3 3e 12 f1 f5 d3 f0 ac 1f +c2 3a 9b 3f 5d a4 e0 ef 6e 45 50 cb 43 fd ff 02 +b2 5d ac 86 27 2d 66 db 59 cd d6 35 f9 c0 dd 0d +aa 08 57 91 0c 15 88 1b 16 0d 70 ea 53 40 5a a9 +59 f4 + +# Encryption: +0b 96 56 31 78 32 a9 40 c7 95 bb a5 8d aa 15 9a +4f 73 3e 82 6c e5 5a 4e c5 64 33 c5 16 84 44 4c +78 e2 e2 fc b3 7f 85 ad 87 79 16 52 2d 8a 35 a4 +3f 53 c5 95 17 a8 18 e5 21 e1 98 2a 50 91 bf 2c +68 b0 0e e4 9a bd 90 dd 77 6c 02 f6 4f 34 f6 80 +a8 8e ee 05 ec 08 88 92 bc 0a 95 55 b3 f2 0c 8b +ee 57 9c 0d dd e1 51 1a 18 af 98 bc 1d 9c f9 0b +81 bf 13 2a bd 58 97 0b 3e 84 d8 14 e2 7d 02 5b +73 + +# ============================================= + +# Example 13: A 1031-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +55 5d c2 ba f0 41 b7 f0 9a 04 78 42 3a eb cb 5f +49 b9 5d be 15 70 e9 a5 42 12 8d 33 22 87 86 6a +c4 cc 63 e7 6f 8e 3a ef 22 c9 75 3a 54 51 99 94 +24 52 41 8a 67 d1 a2 23 0d db 6f 42 22 c6 63 d3 +8e 80 05 0e eb 67 95 6e c5 f5 49 94 a0 be a6 95 +fa 59 fa df 2d cf e7 ac b5 4e d9 da 3d 0b eb 12 +2c 8a 69 1b 0b b5 1a e6 5a 77 4d 75 b1 b3 49 cb +68 c5 17 cb d3 86 ae 48 2f 05 ee 46 03 ec f2 95 +5d + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +55 5d c2 ba f0 41 b7 f0 9a 04 78 42 3a eb cb 5f +49 b9 5d be 15 70 e9 a5 42 12 8d 33 22 87 86 6a +c4 cc 63 e7 6f 8e 3a ef 22 c9 75 3a 54 51 99 94 +24 52 41 8a 67 d1 a2 23 0d db 6f 42 22 c6 63 d3 +8e 80 05 0e eb 67 95 6e c5 f5 49 94 a0 be a6 95 +fa 59 fa df 2d cf e7 ac b5 4e d9 da 3d 0b eb 12 +2c 8a 69 1b 0b b5 1a e6 5a 77 4d 75 b1 b3 49 cb +68 c5 17 cb d3 86 ae 48 2f 05 ee 46 03 ec f2 95 +5d + +# Public exponent: +01 00 01 + +# Exponent: +05 97 87 bb 01 23 fc ed 98 d9 34 1b 7a 8a 99 9e +db 50 76 30 8e 6d 00 11 20 3b e0 dd f9 a4 11 0d +0b 69 2c 1e 2b f3 90 2e bc 03 a0 57 3a d0 c1 93 +af b1 67 b3 ae 4b 50 28 a5 ae bb 22 04 ef 23 f8 +e5 83 60 be 94 84 95 1e 34 71 11 76 06 2e 53 e3 +f6 38 74 fc 9e 35 91 a9 d9 06 8a a5 e6 c8 c7 a9 +ab 08 e9 79 24 70 06 6d 71 a0 7c 34 33 dd 70 3a +42 a6 b3 a9 b1 bf fb 31 49 49 8d cf f8 b3 57 56 +ed + +# Prime 1: +0a 7d bd 7e e6 de f3 87 5b 4c 55 9f 56 69 30 7d +17 6b c1 25 b0 9f 5e b8 26 01 b8 13 48 57 6c 1c +a7 dc f4 c2 bd 7f 2b 42 a2 c5 46 00 02 fc e0 a9 +a2 1d ac 5a 97 97 db 23 3d 9d 4a 92 93 ad d3 df +73 + +# Prime 2: +08 23 0f cf 26 fd c5 75 11 9c f9 05 78 d3 66 56 +4c fd a8 65 a2 82 0f 38 bc d6 3e ca a0 95 57 65 +77 2a 88 32 fb 31 69 7f d0 dd 45 bb ec c0 4d d6 +a5 9e c1 1c 1d 5c 6e 87 7c 6b 9d 77 c6 a2 76 e3 +ef + +# Prime exponent 1: +08 d1 c7 d9 c4 d0 2c bd df 7c 7e 86 62 a8 2f 41 +19 cd 56 24 0f 25 0b 05 97 bd de 37 27 9b 86 a1 +58 64 a1 c6 8c 73 39 b4 dd 0d 26 59 a0 29 61 dc +79 12 a4 ef cb 7c b7 96 1a 97 fe 36 d6 bb 4c e0 +0d + +# Prime exponent 2: +01 d4 91 3b d1 d3 87 d5 3b af 09 bd 17 5e c6 48 +67 6d 2f b2 1d 0a 10 8e 7c bb dc c8 0b b3 4c 43 +80 b8 ca 86 5d 46 d2 2a 74 3b 31 f2 81 e1 08 21 +5e 84 05 80 63 82 65 42 88 d4 54 49 9b 1e f4 8b +75 + +# Coefficient: +08 7b 2e f2 11 44 8e 5c 96 1c 9f 6d fe e6 aa 26 +8e e8 97 7e 31 1c 07 cc 8d b4 72 da 6c 49 86 3f +aa f3 3b f5 05 dc fd 81 f5 3a 53 be 12 1e 44 5e +89 d7 e0 38 ef 27 f3 72 7b 51 2a 2b 80 94 41 20 +ea + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 13.1 +# ---------------------------------- + +# Message: +7b c8 1d 81 46 e3 59 + +# Seed: +76 65 5e 4a d8 fb 99 34 d1 84 7c c9 0c 02 47 3c +57 2b 5f df d1 64 a9 70 a3 cd 96 bc 8c d7 96 ac +80 2c 50 28 22 90 ea d4 c7 7a a5 cc 2a 7e 34 34 +18 c9 df 47 ef b8 87 86 af 4c c8 d1 82 1c 50 07 +39 09 e8 4f 7b 45 1a f4 a3 2a ee 6c 7c c8 97 ee +f7 66 0e 1c 4c 53 5d 10 03 9d 3a a2 03 5c 98 51 +01 25 ec 5f 2a 2e 9d ac 63 95 89 ff 8b b3 9f 07 +43 8d ef b7 d1 33 77 + +# Encryption: +14 6d 65 12 df df fb c0 2d 5d 54 bf f3 e0 36 a3 +5b 4c 2a a9 44 d6 f6 72 47 93 30 65 37 08 1b d1 +1e e5 68 a4 e9 71 9f 1e 31 f2 d1 4e 18 c2 da 62 +44 70 c5 b0 ff ab 39 7f 92 31 b6 ef 46 34 f6 3a +18 28 5d f3 41 45 17 a5 1f 93 58 6d 66 b0 3c ab +1e 78 a4 eb 94 1b 9d 3d 7f 92 03 b5 9e 1c b3 bb +48 64 b6 46 dc 17 a0 64 11 eb d5 ff 03 37 20 58 +88 1b 4a 24 b2 4f 4c 2d cd 5c b4 4c 2e ea be 6f +72 + +# PKCS#1 v1.5 Encryption Example 13.2 +# ---------------------------------- + +# Message: +68 6a 81 0a 03 1d 80 61 e4 1a 77 6a 7d fb db 3a +f6 26 fe 97 69 de ee a4 60 ba 28 67 ac f0 3d 9f +92 4d 32 1e 8a 8f 42 5c 28 51 92 98 67 a3 26 ae +27 5b 49 d2 + +# Seed: +f7 9b 49 f6 a6 be 3e 68 88 4c 80 df e1 e8 50 1e +54 4c a7 82 23 88 43 d4 19 76 41 12 25 0e dc 1b +69 c7 d1 c3 58 7f dc 75 98 7c 62 cb 4c 33 bb 81 +20 2f 72 db a7 ee e2 4b fc f8 9d 4d ae 15 0c 07 +27 24 58 fb 01 b6 cd 27 09 25 + +# Encryption: +08 8a 47 f1 1c b1 34 de c4 b5 08 77 25 e8 a5 bd +04 f7 fe 58 2a 69 91 4f 68 3e e6 de 7c 32 4f ed +7e 07 f5 70 05 c0 e0 df 75 00 e3 70 a4 2e fd 6f +e5 b2 90 19 95 19 b1 98 06 b6 e6 91 69 8a fd 95 +17 d7 80 da 0b eb f7 0a 26 d6 5c 5b 64 e3 40 a6 +40 5e 88 95 55 df a0 a9 2c 42 9a e9 c3 ec 88 e8 +88 ee da 04 5e 41 0e 3a 9e 61 99 ab 39 eb 1a c8 +64 e2 28 c2 cc 1b 64 e3 36 16 95 b5 aa 11 3d c5 +a7 + +# PKCS#1 v1.5 Encryption Example 13.3 +# ---------------------------------- + +# Message: +18 54 4a ad 24 ab 07 5d 3a + +# Seed: +23 20 4b 8a d9 45 75 f6 e2 f4 6c 79 7b b8 73 aa +3f 46 1a cd 05 e7 db 78 46 a2 31 57 59 2d 52 e9 +a9 a7 04 38 19 c4 88 96 27 5e d9 df 0b 1e 54 04 +93 c0 77 ea 15 41 9a fa 87 dc 35 f9 fd f7 ab 8a +af 47 ee e1 d3 3e cc 28 95 06 45 f1 b6 91 38 2d +87 54 1e d0 64 06 93 0c 7e e1 10 9a a5 ca 75 a4 +90 93 4e a8 d3 b2 a0 4b a1 52 1b e0 92 c8 68 f7 +ea 5b e3 78 ea + +# Encryption: +34 d6 e5 46 d6 9e 27 06 cd fc 6d 9e 74 18 f8 be +03 e4 57 56 a8 b1 9b 60 c2 1d 27 34 20 aa 7d 5e +bb bf 46 0e f4 c8 4f 6d 47 77 e6 bf 20 3f f9 18 +5f d5 7d c7 23 b5 8f 35 c1 e9 b5 ff f4 7c f9 5a +e5 69 a5 cb 64 dd 9c b8 d6 40 7c 0b a5 ef d1 48 +f1 8b 56 96 b0 47 da aa a2 77 ed 8d 45 28 61 4e +e3 da 52 38 71 32 b7 a9 cc fe 07 3b e5 03 32 c9 +e2 83 73 53 c6 7d aa 0f df ef c3 b6 52 cf 7d 79 +fd + +# PKCS#1 v1.5 Encryption Example 13.4 +# ---------------------------------- + +# Message: +d9 0f a3 8f + +# Seed: +3e 09 f6 50 6f 7f 71 91 47 ae 21 e3 94 53 ae 0b +41 60 98 da 10 3a f8 4c 0f 7c ef ae 50 01 99 c9 +85 59 67 a8 30 0a 1a 7f 8d 2c c1 3b 91 72 7e eb +d9 3c f7 7d 3f ac b1 9e 83 a8 40 eb 58 3b ce a6 +c6 11 3a 9c 6f 6f 1f b5 a0 b3 32 55 9a 6b 43 15 +47 45 7c da 1d 3d ce e3 41 d1 71 c6 2e 95 e7 ea +ae 16 ae 0e af 1c 1f e8 10 fb b0 b7 13 8c fa 3d +66 c6 38 50 f3 81 e4 9a 2d ad + +# Encryption: +27 13 3f 43 79 1b 39 22 7c 8e 95 4e 1c aa 83 0f +a6 59 95 f8 a9 f8 8e 0d 1f 75 67 85 ed 5c 8c 78 +54 fb 1a 9d c4 a9 5f a4 4d bd f0 f2 85 99 c4 72 +84 93 79 75 0a 6a 1b cb 42 ca fb 5b bf e0 8c 65 +10 6d c8 40 cb ec 8e e2 cb 5a 20 6c 81 18 aa 06 +1d a4 d2 1d 1b 5c 46 11 7f 77 c8 96 bc 71 ce e2 +f8 75 7a ff 5c b2 b3 c3 47 74 55 8e 8b 82 ed b4 +ef 9b f2 d4 f2 ca 4f c5 97 fa b4 0a 2d 74 e5 23 +3a + +# PKCS#1 v1.5 Encryption Example 13.5 +# ---------------------------------- + +# Message: +fc bd d0 24 8d f8 57 af 17 5b 43 96 87 5c 00 6d +51 14 cc 11 16 42 80 04 38 08 aa 79 88 6c 4c aa +29 11 7b f3 ce 45 a9 be 55 07 c6 b8 bf 0d 30 + +# Seed: +2c 9d 14 57 ba 44 50 df 40 21 e4 e5 11 83 f7 95 +d0 91 c0 7f 6a e0 dd 96 2d 57 28 c5 4b 7f c3 c7 +72 d7 9d 7b ec e1 bb 0c 99 6c 9a c0 7f 99 54 dd +a7 68 7b ec 86 bc db 31 40 b2 45 bb 5e 01 27 5b +38 d1 f2 52 33 5e 36 c6 8c 0e 58 f4 ce 11 7e + +# Encryption: +2c ed de f2 02 69 1a ae 42 71 85 2a 89 83 de 7c +21 4c ee 00 db e1 a1 58 84 f4 c3 c1 de 7a 3e a0 +1e cc f4 7a e8 6c 26 93 24 ae 52 37 73 37 b6 ca +82 e8 5d 55 3f bb 2e e5 f9 77 dc 66 4e 14 2f 1b +54 53 8f af 85 ca c2 7c 29 f2 ed 0c 40 42 67 33 +5d 48 ea 40 e8 a3 dd d8 96 bb b3 e0 ed f0 e1 6f +9e 89 44 68 3b 8c fb aa b5 ea f2 25 30 f1 58 c4 +88 0b c3 e4 60 c0 6a 24 03 42 21 0a a8 7b 79 09 +68 + +# PKCS#1 v1.5 Encryption Example 13.6 +# ---------------------------------- + +# Message: +25 f2 a3 06 ea be 6e 3a 18 30 dc 93 6b fa 41 cd +eb b8 80 05 17 5d f4 a3 c9 c4 64 23 01 45 61 11 +5a a8 + +# Seed: +cb 8e 0f f4 1b ab 01 a1 42 f9 6e 7d 7c d3 92 82 +0a 82 a1 73 66 74 b9 21 35 ef 33 08 96 88 dd 30 +b2 c2 f7 ba 11 1a f7 8d 3f 76 a3 7f 66 7d b3 97 +5f ce 64 ec 9a fb 09 68 50 7f 7b 31 09 7e aa e4 +88 1b 36 24 06 56 16 ca 09 0c 20 4c 1f a4 be 13 +48 50 ea 5e 90 fe cd c8 45 b9 d8 39 + +# Encryption: +4c 7a c8 12 45 e7 d4 de 3c 4d bf b3 15 c4 68 34 +1c bf 22 87 57 35 c5 f8 05 90 50 58 53 06 8d 6b +e7 03 9b 1c ee 6d 07 ec b7 66 9c 42 f6 b9 2f 2a +71 f6 45 f7 2c ba ff 76 34 16 37 d2 f1 d6 b1 fe +ce b0 7f 21 e1 4c 70 fb 77 bc 7f 87 b0 31 c2 c8 +f2 ad a4 ec 43 e9 12 68 2c 2f 49 63 9e 75 71 57 +18 77 fc 48 1c bf 26 98 b3 73 15 bd 4b 93 07 83 +f4 79 45 64 2b 7d 81 5e 04 32 d4 5d d1 d0 d3 b2 +a5 + +# PKCS#1 v1.5 Encryption Example 13.7 +# ---------------------------------- + +# Message: +a0 da ab 4f 9f e0 4a 2a 51 bf 08 32 70 11 5d 0d +06 dc 29 21 cf 8d d1 3f 5c ff 26 04 bc 55 1e fd +98 3d 9b 25 b7 27 4f 3c cb 0a dc c1 1b 1a 39 54 +ab 9d b4 + +# Seed: +c8 1d 1c 02 f0 6e 7f fd 6e 03 b8 1b 71 93 aa bd +ac 56 63 ab 14 25 a6 7d 1a 29 50 88 5f 5d 1c 4b +72 5e 20 9d cb ce 9f 7b f2 96 75 23 42 f1 84 fe +a0 6a 7d 6c b2 bd 39 b2 a3 18 07 51 64 a2 e7 61 +b7 02 70 2b 01 92 46 c1 e5 0e 6e + +# Encryption: +06 c0 6c 97 5f c6 b9 c2 60 d3 d8 81 3b 57 14 24 +8b eb 39 9b 7d 68 fc ac 25 03 38 ca c5 4c 40 72 +95 9f 62 03 84 44 e9 e6 66 ba b5 f9 36 06 70 47 +bc af 4b a4 ed 68 c6 c8 18 57 46 29 32 56 e7 c7 +24 16 65 81 54 de c0 67 f4 25 0d c6 b2 9b ba c1 +8e 82 1e 49 a4 c9 b1 63 83 1f 7b b3 83 92 32 6c +6b 46 85 46 4f e4 f0 26 c9 ae 4d bc 58 49 47 7b +4c 26 0a a4 ac 02 d2 1a 26 40 20 f1 0c a1 1b 4b +0e + +# PKCS#1 v1.5 Encryption Example 13.8 +# ---------------------------------- + +# Message: +74 3c dd b3 61 c0 bb 32 47 64 95 ad 5d c6 3a 2b +ce 5f ba c1 c8 c2 03 93 69 32 67 d8 43 f2 8b 8c +f3 ea 13 e3 74 e0 9d 0a a3 f7 ae 5d 8f 72 d8 e6 +cb 9d bd + +# Seed: +f7 2e d2 d0 69 b8 ae 50 27 04 6e 03 27 b9 87 84 +58 09 b4 e8 16 c8 86 58 24 fc 4a 23 01 b4 56 80 +2b 18 9c bb 43 f0 48 32 ac 25 c8 48 d7 4f be 1d +62 5a a9 8a e0 5e b6 25 47 76 1c 78 b8 17 61 c3 +03 f9 3d f3 fc 0f ea 3c 5a 7b b1 + +# Encryption: +38 3e bb f1 59 e1 d0 a2 1c 74 eb 61 e3 64 3c b6 +31 be 18 c7 a2 a5 4e 24 89 33 58 7d 34 5e 99 52 +72 46 6d c1 bd 61 3a dd b4 cd 7b a5 01 92 fc 2d +89 4d 7f da f7 83 63 b0 79 d9 98 01 9f 16 42 31 +cc 2d 75 2d b7 6a 9f 9d 0c 52 04 bf b0 f9 93 05 +53 09 6b 5b 76 80 b0 89 4f b9 9c 11 42 5c 67 d6 +5d 96 5e 35 12 8e 15 47 46 b3 fe d8 d0 16 99 30 +70 a7 0e 07 eb eb e0 6f 2f 4e 97 6c 9a 63 fb e3 +20 + +# PKCS#1 v1.5 Encryption Example 13.9 +# ---------------------------------- + +# Message: +e5 31 92 fe bc d3 69 58 bd 08 03 f2 ea 0a fd bf +df 99 3b 58 a9 e4 ee 70 df 95 b0 6d 4e 7d 74 b6 +74 5b 87 f5 81 f3 42 f8 ae f9 ae 4c 31 82 c4 19 +9b 65 51 fe 18 f8 d3 b9 ff e4 + +# Seed: +ad 98 2f a7 29 f2 7f ce 8a 67 49 03 ec ac 69 4d +d3 34 13 c7 8e 34 28 ae ed 46 9f 84 d9 57 5c 6d +a2 75 29 f2 c1 4b 53 b7 58 d2 0f b6 b2 47 c8 29 +c5 fb 1a 16 af 55 07 9a 70 73 cc a0 56 25 96 2b +6d 1a 6b ef + +# Encryption: +22 1d 88 a8 6c 9e d3 7a a0 9c f5 72 54 97 82 e5 +8c a8 d4 85 1f 01 6a cf 28 9e e8 bf 23 79 0b 1a +8f 14 8c 16 55 08 bc 3f db 1e f9 c9 01 16 27 42 +7c 5f 32 e5 ca b8 50 cb 6b c0 bc 04 a1 1d a2 f0 +18 13 f3 41 41 7b 3e 63 2b ca e0 02 97 7d 64 ff +c9 62 c7 fa 75 72 f5 6d 26 17 e2 a5 2d 3e f9 17 +c4 4a 33 b7 15 82 af f1 39 0b 7c 77 4d 60 7c 8d +57 8f 7b c9 0b 35 80 d7 7b 03 73 19 14 77 bc 14 +26 + +# PKCS#1 v1.5 Encryption Example 13.10 +# ---------------------------------- + +# Message: +d0 eb 48 0e 27 45 77 9c 8a 30 fe 82 0a ef 56 d4 +ce 39 ef 84 ea 40 c7 df 0c + +# Seed: +46 5f 91 e3 f0 7c b7 22 83 bc 2b be 52 8b 9a b3 +68 16 54 fe 20 b6 1a 33 f1 23 ad e5 2e 83 2f fa +8a 1b 74 a4 44 3c c8 92 95 a2 1a 2a ac 98 74 da +0a 56 79 d1 8c b5 c4 cd 69 0b d0 a2 0c bd 9e 9a +a0 72 aa 87 13 44 8f 95 e5 d6 a6 e6 24 d5 b9 08 +5c fc ec b7 99 2f 10 ea 2d a6 d6 26 eb e5 43 d8 +70 22 36 ee 6c + +# Encryption: +06 f3 f8 c7 0d 0f c4 e7 44 73 e6 8f d2 3c c9 df +1e dd 42 35 b4 28 b7 72 a0 83 b4 1c 34 51 62 5a +6f 15 de a4 bf 31 3b f4 f0 3f dc 4f e9 f6 a2 07 +1a c6 9a a3 f0 fc 41 57 ef c6 21 f9 59 40 61 f6 +c1 98 06 bd 5d 75 9a d0 23 ca d1 48 e4 47 d2 59 +b6 2b f7 34 25 91 be 83 ba ec 77 71 4c fe 2b 90 +1f 36 9a ea 68 02 48 ba bf 06 87 10 cb b9 70 48 +4f 32 4a 23 52 53 a3 1e 02 25 34 ab ec 7b 39 96 +06 + +# PKCS#1 v1.5 Encryption Example 13.11 +# ---------------------------------- + +# Message: +1c 42 97 f6 df c0 7f fe 57 59 aa 1e aa 5b 79 37 +8a fc dd 1a 9a 33 a2 13 3a 39 ac + +# Seed: +a7 af 2a 86 01 e4 08 c3 18 fd 1e 0f 82 44 5b 50 +95 44 d5 ec 97 a7 95 8f 59 4b 20 54 c5 09 f7 ef +fd d4 16 30 6b 2b 2c 91 b5 a6 37 a1 56 82 0d 60 +1a 23 ff db 31 fb 35 d3 05 aa 93 74 57 8e ef b8 +10 2e 8b 72 44 19 1f 4e c7 4a a2 6a 0b 7d b3 6c +ab 44 99 9c 81 b3 61 57 01 6b 55 89 06 e5 d7 08 +8d 51 32 + +# Encryption: +3c df 2d c6 7a 4a a5 31 cf a1 42 80 08 bd 05 44 +ab bd 03 29 22 dc c2 43 6d a0 b5 d7 ef 9a 70 17 +e6 19 3a 8b af 38 c5 8e 91 96 2d 65 a3 75 f0 8c +1d 55 57 9c f9 4a 79 5c 9c 70 b6 e4 2e 16 43 ce +f5 40 dc e1 e9 86 dd 99 88 87 b6 95 52 44 4b 6d +e9 3b a7 d5 f7 64 83 54 bf cb 70 21 39 ed 39 54 +94 7d 7b 18 0b 6c 02 bc ad 82 43 a0 ab 27 ca 66 +52 76 29 1b 46 cc 31 8d a9 b5 f6 0a 04 af fe bc +b0 + +# PKCS#1 v1.5 Encryption Example 13.12 +# ---------------------------------- + +# Message: +00 92 7f ca 7f 5e c7 6f 54 8d d4 82 63 e3 39 be + +# Seed: +de bc 2c 1f 22 d9 32 ff cb 89 7c f1 0a e6 2c 3e +05 1e 3f 78 46 3a e6 7d 95 61 cf 1a 73 d5 5c 4b +14 ac a6 c2 1d 83 ba f9 76 cd 8b f2 46 c2 29 78 +61 a6 b1 e9 c9 ef 30 81 c5 1c 4b 68 7c 67 b5 dd +0f e0 f7 55 3f 73 8c 2c 8a 5f 81 d1 26 8a 0c 2d +4a 46 1d 63 5b 0e 59 d2 3b a4 17 ab b8 04 5e 9c +10 d6 6b 0e c8 92 f9 53 c6 f2 11 f0 2f f0 + +# Encryption: +49 b9 20 89 b5 2a b7 8c 33 b5 bb 30 32 cf 70 24 +94 4a c6 8e 13 9d 2d 56 06 8c 7a 26 2a 53 e7 80 +9f b5 b0 15 65 cc 65 61 d7 13 30 46 87 52 30 ac +21 75 64 72 96 cf 2b 48 47 e1 2b 73 63 19 72 53 +21 be a2 64 75 7d e0 eb 49 88 72 d8 9a 4d 7c e4 +a1 bd b7 33 5d ae a7 8b a1 96 fd 50 d9 03 82 e6 +d6 2f 8d f7 ae 68 5a 1d fc 84 9e 11 99 7d ee 88 +60 d1 0f 70 7b 0d 35 36 5a 81 24 30 73 1e 7a 50 +8d + +# PKCS#1 v1.5 Encryption Example 13.13 +# ---------------------------------- + +# Message: +8b 6d f2 d6 da 63 1a c8 d5 55 6a 26 97 54 28 fc +4d 20 ef 5b 4a 1f 06 8e d2 e5 + +# Seed: +ff 2c 06 98 85 2d 1b 0a e3 c5 c5 c9 be 26 e8 3c +90 44 84 2c 16 07 f5 f4 08 6a 6d 6c f1 08 ad ca +61 ea f6 65 40 0d 7c ff 2a 3a da df af d8 0c 64 +95 6d a2 d7 d7 c1 35 ab f5 a0 d1 76 06 25 56 eb +4d 8b 75 b9 5c d1 1e a9 c0 44 2f 84 6f 03 7d a8 +77 29 02 bf fc de 65 59 e1 b5 9e 60 c6 d0 f9 89 +6b a5 c3 c4 + +# Encryption: +41 52 76 69 80 33 39 eb d8 f2 d1 cc 18 6c 7e 8e +bb 80 cf 4b 94 9d 8a 28 43 65 32 9f 3c e4 6e bd +ac 0a 96 9f 67 61 90 0c fe 34 2b c8 4c 7d 69 51 +ac cf 45 28 0b af 24 a0 cb b2 42 a9 42 18 ef 9f +d3 71 b1 e0 08 24 62 62 07 0b f5 54 ed 57 00 7b +97 39 79 16 35 86 1d 86 c6 5b 1a 82 56 f4 25 f9 +f3 ae 51 9e 1b 1b dc 58 75 b8 78 dd cf c1 47 0f +ee f2 ae eb 01 4b 7e 33 ef b9 f4 dd 07 83 d1 71 +23 + +# PKCS#1 v1.5 Encryption Example 13.14 +# ---------------------------------- + +# Message: +ea 03 96 69 bc d7 a8 cd ce ab 58 55 91 b5 63 61 +e9 0b da 0e a4 40 10 49 64 e8 89 ec e1 8a eb 04 +ce 0a b5 b1 cc b2 30 ae 03 25 5a 39 + +# Seed: +20 4f ae b3 13 96 5c c1 a1 8f af 10 39 fd de 68 +1b c4 3b 22 3e 28 bc 47 1c 50 42 3d a0 bd 79 7d +6a 8c 73 8c 54 03 3c 8e 55 9e a2 d1 0c 3b 79 b8 +0e 2e fd ec fe 89 1c ea 2e cb 34 51 a1 a8 e2 ec +2f 44 7b 79 8d 7d e5 64 1b da 4a a9 90 b3 01 e1 +dd e7 + +# Encryption: +4c a1 c8 5c e3 c6 20 d4 29 91 cf 41 73 3e ad 26 +a0 93 11 18 5f ff e5 8f 41 28 8f 6d 0b b6 84 5b +2d 5a cf 1a a0 6c 78 d7 1f 76 93 96 a9 43 42 03 +e3 8b b0 1f d8 8e b2 3e 6b c5 1b a0 c5 f3 ee b3 +27 13 ca d4 d0 87 80 50 61 ab 47 3a 15 67 e7 9b +bf 4e ae 49 36 f1 8d 02 05 b3 74 6a 17 e0 64 8c +52 22 3d d9 f9 99 72 81 b5 35 ab 2f b3 cf f0 3c +a8 90 f7 10 aa 88 fd 2d 0f 39 2f f4 a8 8d 31 1a +a1 + +# PKCS#1 v1.5 Encryption Example 13.15 +# ---------------------------------- + +# Message: +0f 46 2b eb c6 + +# Seed: +4e ae 5d 54 92 d9 44 ff db 04 2a d9 50 16 81 ad +b3 eb 6a b5 28 b6 e8 13 53 55 b6 23 ab 55 a7 40 +87 b1 9f c5 9b 85 34 da 9a 88 da 29 f6 6f 71 f9 +45 2a ed e0 e3 e9 39 07 70 9c 34 49 56 72 85 74 +b6 6f b9 a6 f3 38 3d 58 a0 13 6f 94 c4 ed 86 ca +9d d3 8b ff 07 0f cc 2d ef 29 bd d6 fc 98 59 70 +96 7f 02 fd 6f 93 01 cd 56 d0 48 a4 42 d7 02 40 +9a 98 a1 32 ab 6b ed d4 fe + +# Encryption: +29 36 9e b0 0a 3f 87 84 38 c9 38 f9 d7 bd a3 85 +6c 45 a6 d7 7c 17 88 51 1b 98 2c 58 f6 3d be a3 +3e 63 ae 1d 45 c2 df 6b a8 0f 0d e9 97 59 2e 1f +8a 3b 3a 09 ed 76 06 51 45 3e 10 99 78 cf de 3a +60 0a 74 fa a8 a9 1b 7c 72 4f 97 3c b8 0b 96 83 +5f 05 0b 7d c0 9d 2f 15 74 76 c5 b7 05 1f 94 d9 +c0 f3 17 e1 f1 88 e3 09 80 79 5b 09 6c f9 bb ce +b5 63 6b 3d b9 87 05 4a 56 08 75 22 75 96 29 97 +e7 + +# PKCS#1 v1.5 Encryption Example 13.16 +# ---------------------------------- + +# Message: +51 4d 3b 38 00 22 b3 78 2e 8a 77 d7 7b f2 4a fd +f9 2f 33 97 47 4d ae 0d 4b d6 e4 fa 31 ca 60 83 +df 49 6b 36 62 6e 7f 8e 1c 91 9f 9f 2e + +# Seed: +d4 d3 a9 e8 fb eb 1d c6 07 b4 dd 78 87 ba 25 c3 +d0 bd 81 34 84 bd 53 76 dc 83 ef b5 8e c5 b2 56 +2c b4 4f 98 5e 59 f5 0b 9a de 3c 66 71 6c c6 f4 +2e 51 c6 0a 2f 4d 8d 75 bf b9 b8 24 10 5d 1e e1 +58 35 f5 f5 f2 54 fc 6f 68 0e ee 0b 85 af 54 7c +17 + +# Encryption: +19 fb 39 1a 31 00 87 bc 3d 08 79 1f d5 99 94 be +80 12 df fd 76 a0 2a db d4 79 cc 0c 15 56 60 5d +4d a2 a3 46 1c 7c 71 a8 5e d8 cf 85 e0 8f 45 da +de 51 8c 00 af 09 f4 93 ee 8a 55 46 ff be fb 05 +3c ca 2e ef 06 84 76 3c f7 80 f2 e0 97 bd 8e 5c +2e a8 4c b1 a8 b8 f8 49 6c c9 18 16 7f 65 6c dc +9e 1d 3b 2a 23 38 b6 4c 61 e9 0e cc 27 4a 12 10 +e3 db 57 83 ae 3c 00 ab d3 74 8a 81 0f d9 14 91 +14 + +# PKCS#1 v1.5 Encryption Example 13.17 +# ---------------------------------- + +# Message: +fb a1 63 17 b0 93 08 3e 37 20 aa 06 48 17 e7 4c +a7 51 a5 17 87 4b 69 26 50 c4 14 7f 11 9f 68 90 +70 2c f8 b1 4f 0c 18 82 21 2d 72 40 6c 3a 45 d7 +d9 ff a4 31 24 10 a6 + +# Seed: +9c c9 a4 bf 8c c2 75 a6 b9 b1 35 10 31 91 10 91 +7a d8 53 24 c5 a4 34 5e 58 f1 fa 47 27 5e e5 92 +15 69 dc bc bd 72 36 70 cf 4a 24 eb cd 57 f5 7e +99 8c 4b bd 4a 95 67 9d 60 ba a0 ab e8 79 66 8a +2c b6 ed 0f b9 4e 4a + +# Encryption: +4c 41 b9 cb cc 6f a8 7f 23 f1 7a 36 d0 51 e7 78 +0a 07 06 56 ca e7 be ba 14 fa 91 c5 55 b8 58 8e +88 09 e7 d3 35 4e 7e f5 e0 fa ef e1 cf 39 2e 6f +da d4 04 4a ef 08 e3 3e 6f c2 01 c5 47 fd bd f7 +c7 3d 3b e0 96 ed 25 3f 9d f4 af 52 e1 3b 9a 19 +25 aa 73 93 a6 42 95 30 20 92 01 e5 5b 20 e5 1d +50 05 d0 6b 58 35 3b fa fc ee c3 7d 60 e1 ca 0d +9d dd d8 68 0b d0 a5 d6 92 e7 4f 2d bd fc e2 66 +02 + +# PKCS#1 v1.5 Encryption Example 13.18 +# ---------------------------------- + +# Message: +5f fe 82 e0 33 54 42 45 b8 49 62 d3 92 7c 2f a5 +99 72 ef 59 c2 37 a3 86 a5 1b d0 ba 1f 2c 1f 8e +45 b4 6a 05 ad 97 db 49 d3 ac c6 34 4f 1e da df +65 64 c2 8c e1 + +# Seed: +cc 23 59 bf d0 d5 7b ce bf 07 5b 87 a5 85 a9 bd +e6 59 3e b2 49 61 ef f1 98 7e 73 56 05 d4 e3 0e +97 19 37 f6 f3 f5 be 52 78 fd 47 6d c6 60 ee 07 +30 cd 07 e5 d1 f4 20 09 a3 33 31 2d 93 28 f3 b0 +08 5c 40 75 bc 70 9a 10 f1 + +# Encryption: +05 8b 50 e0 bc a6 b9 34 c0 1b f7 c3 3b b6 15 b7 +22 ea 41 80 7a 7d 2c 7c b3 d4 38 e2 8d be 33 3e +d6 d8 37 47 7a f8 4b b0 06 bb b1 0b 36 94 4f 15 +d4 f6 d2 8b 5e d2 49 d5 69 0c 08 37 a1 6e 15 7b +a8 80 22 74 10 1c d4 4e 7f ed 72 a7 59 81 c9 75 +66 bc 70 e5 55 97 02 bf 5b 62 fb 09 b2 13 60 56 +73 aa eb b7 fe 9b 1a e6 d8 04 03 a2 01 33 80 3e +1e d2 35 0b 8e 15 ff 01 9a 70 0f 2a be 87 d6 e7 +33 + +# PKCS#1 v1.5 Encryption Example 13.19 +# ---------------------------------- + +# Message: +22 63 3c c3 fe 7a 7b 4f 00 fa 99 9c 4f e0 d8 82 +c3 1b dc 0d 67 0c 0c c3 d2 88 96 1f be 63 72 e0 +e5 32 46 42 c7 b1 fa 85 2e 1b 4f 69 6f 12 f5 58 +66 + +# Seed: +3e df ca f4 88 71 d2 91 d5 b7 f7 72 3d 92 d9 51 +51 52 b6 bf 52 b8 23 69 9c 58 8f 75 f3 4e 37 95 +55 0d 07 81 18 e2 86 c9 6e 90 07 ae e1 54 f5 7c +e7 f1 d4 60 39 47 3a 4a 37 a9 b5 90 a3 7e ea 59 +94 7f e8 58 7c 95 69 88 bc b1 74 e9 7c + +# Encryption: +3d eb bc 6c fb 0e ed 87 16 6b cc d5 4c 75 97 ad +36 ca 0a c9 6c f1 66 76 e1 87 4b f5 f1 0a 0e c6 +9c 3b e2 25 96 78 ee a6 3a 18 08 d9 06 65 ff ce +9a f0 82 7e e6 29 ed d6 59 43 43 7f 8c a0 a6 71 +17 2c 52 1c c0 d1 dd 01 e2 2f 20 a6 c7 9c 42 7a +da 88 56 00 0c 4e 03 5d 9c 5e f2 e1 05 f2 c9 f6 +45 7d 9e e9 5b 43 bc 4b e3 29 4a 0e e1 d5 c8 33 +ae 91 07 8a ed 09 e7 92 bb 42 c2 5e 00 b0 87 e5 +61 + +# PKCS#1 v1.5 Encryption Example 13.20 +# ---------------------------------- + +# Message: +55 2b 38 4c 5e 51 74 f5 1f 38 0d 8b 53 e3 c8 97 +b4 8c 66 9a 9c 2d 11 98 5b 86 54 de 7f 76 d9 62 +39 6a 37 b9 53 41 f9 9d ec e4 af d7 1d 3c 84 e1 +28 7b 0f 0f 86 ee ff cf d9 7b a1 88 e3 79 9e + +# Seed: +2e 2f 3e 3f 46 d4 74 0c b2 6c bc 65 aa e2 af e4 +9d 0b e6 66 39 d0 db 10 df d6 af 60 64 46 f3 b7 +de 98 21 2f 86 17 4b df a5 b2 e2 35 85 07 45 3c +20 ad a6 9a 4f fe 0a 35 e1 2e fb ab 3b b4 4c + +# Encryption: +14 92 91 ee b5 36 fc 07 03 f7 bd f1 f0 31 a4 30 +cc 83 ad c4 3e 09 68 64 91 26 69 34 ef 37 ea ea +b1 1b c7 f3 91 49 ab 33 43 66 94 59 36 73 cc c6 +39 0b 52 9e 64 d3 42 e9 f2 1d 17 6d a2 1f a6 5a +bd 57 ee c6 0d de c7 d1 a0 93 db a3 76 44 5f 1b +cf e5 a6 aa ce 9f 13 42 af 39 db 8a d4 85 ba 22 +2d 39 12 62 28 fa ee b4 9b b3 b2 71 fd 38 e1 15 +25 d8 03 15 4e 74 08 4b 75 c3 db cd ff 2e 3d 10 +42 + +# ============================================= + +# Example 14: A 1536-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +be 0c a0 1f 9c 17 21 66 f9 12 39 1e 5d 58 dd c3 +0d 5d d0 27 9a 49 bb 31 2a 31 e4 c8 a6 6a 52 fb +4e 8b 67 42 fa ac b2 24 c3 03 9f 1e 19 8f 33 23 +b8 88 ba 0e 35 bb 94 c5 11 bd 22 b8 86 40 5a 71 +5e 40 9d e3 bc eb 4f c9 91 1b 0e 9c 3b 1e 42 e2 +57 d5 bb ea 07 22 b5 d5 dd 35 37 56 9d c7 56 06 +46 a7 50 b8 7e aa 6f 3a 40 5a 94 bf 2a da 72 b5 +0a 4b 01 87 bb 9d 00 ec 45 1d 50 a6 a9 1a 1e 2a +91 19 2a 7f d7 56 b9 00 14 1f e8 8f 96 e2 08 0d +fd d8 01 66 a7 bf 67 e3 71 44 d0 9e 3a f8 99 74 +e5 7c 72 b0 3a 2b 88 fd 29 95 25 2a ce 4f 30 e2 +e4 7c 28 18 05 72 40 53 6b 58 db 42 07 50 9e 59 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +be 0c a0 1f 9c 17 21 66 f9 12 39 1e 5d 58 dd c3 +0d 5d d0 27 9a 49 bb 31 2a 31 e4 c8 a6 6a 52 fb +4e 8b 67 42 fa ac b2 24 c3 03 9f 1e 19 8f 33 23 +b8 88 ba 0e 35 bb 94 c5 11 bd 22 b8 86 40 5a 71 +5e 40 9d e3 bc eb 4f c9 91 1b 0e 9c 3b 1e 42 e2 +57 d5 bb ea 07 22 b5 d5 dd 35 37 56 9d c7 56 06 +46 a7 50 b8 7e aa 6f 3a 40 5a 94 bf 2a da 72 b5 +0a 4b 01 87 bb 9d 00 ec 45 1d 50 a6 a9 1a 1e 2a +91 19 2a 7f d7 56 b9 00 14 1f e8 8f 96 e2 08 0d +fd d8 01 66 a7 bf 67 e3 71 44 d0 9e 3a f8 99 74 +e5 7c 72 b0 3a 2b 88 fd 29 95 25 2a ce 4f 30 e2 +e4 7c 28 18 05 72 40 53 6b 58 db 42 07 50 9e 59 + +# Public exponent: +01 00 01 + +# Exponent: +f3 7d 28 d6 1f 28 99 a5 c0 e0 a0 74 9d 13 89 38 +7c 64 c8 c3 58 a9 71 da d1 3c ff 85 c5 9a 62 dd +a7 bb c0 f7 e5 bd c6 5d ff 9d e9 c7 45 40 46 31 +75 81 48 16 8d fe 6a c0 a2 87 6a 56 05 3b ab 2a +2a 9f f2 72 79 4d d5 d8 13 9e ed 10 bc fb 4d f3 +30 20 d5 9e 30 48 fd 2f 0c 43 14 26 14 5e 36 a1 +d0 a6 bf ce 44 43 ef 3c 7e 31 d4 a9 2f b8 51 7a +49 f7 88 c3 b4 e1 37 39 5a 4b ee ea 63 e0 e0 ad +c3 22 4f 98 09 25 03 7d f6 f5 b2 6c 00 72 39 b4 +f0 1f 8a 9a 61 ea 0b 51 19 bc 9d 54 96 a9 5b 60 +ea 76 6c cb ad e0 37 e3 40 32 4f 25 f0 2e 72 45 +c2 36 ea e4 36 7a 64 68 a7 a0 93 8d 85 c0 a1 + +# Prime 1: +df cc 92 74 2c 48 d3 34 c6 6f ca a6 d8 a7 e4 22 +54 43 0f 80 a8 35 9e a2 3b 9a 83 b2 41 e4 7f 39 +9b 3f fe 3d ab 3f 15 be 8f a5 c9 e6 46 df f9 7c +cf 9b 43 17 61 07 80 ad 44 cb 1f bc ef bd 6e ba +05 5d 96 94 3c 02 47 e0 c8 76 78 eb 0b f7 6c 88 +76 c3 ab b9 ef 72 cf 01 8f 58 11 a6 be e0 4f 09 + +# Prime 2: +d9 64 e9 6e a6 fa 43 70 b5 91 ee 79 e7 e7 2e cc +21 81 53 78 7a 60 e2 f7 ae 94 fa 95 b9 bd 68 69 +d2 81 ac 3c cf b6 57 24 7c 58 3e af dc 13 d4 d7 +a7 d7 76 5e 44 67 df 76 b5 28 bf 94 bd 03 a3 ea +73 b8 1b e2 6c ca d9 89 b9 f0 77 28 da d5 3b 38 +ef 7f e9 eb e9 11 40 cb ad 17 dc 7e cb 1d 58 d1 + +# Prime exponent 1: +9e 79 f6 9b 5d 60 94 6f 22 b5 b7 03 3f 18 64 6c +0a cf 12 03 41 19 f7 23 5a a1 a7 f0 6a c8 ab 6e +d7 89 11 38 0a 33 b9 ea 1f 3e 7f 22 19 be 30 a5 +39 3d f0 dc 75 51 22 c5 8f 99 66 f8 1b ac 40 e4 +69 38 44 90 e3 8d 99 e8 8b 0b 99 c4 97 cc b5 86 +4c d3 72 9f 4f f8 34 ae 1e 1b 77 24 64 b5 e2 41 + +# Prime exponent 2: +3a 05 e9 18 13 91 30 76 e0 bf 76 7b 2b 1e 55 2b +3e b6 19 e5 4a 24 99 ef a9 b5 31 bc cc ba 75 27 +e9 7b 9a d1 10 4f 86 aa c2 55 7b 45 cc e3 ae 27 +71 30 dc f3 04 27 05 49 d5 c8 6e 79 f0 89 0c 33 +03 77 dc 59 6e d8 25 7f d1 15 11 78 e2 0f 8f a2 +fe a9 91 71 d9 df 35 00 27 ce fa 97 0c f7 64 41 + +# Coefficient: +18 b1 0d d7 3b 14 7d 86 b6 0c f7 fe bf 46 35 93 +c0 bd d6 bc 83 a8 39 57 3b 4b 3f e6 5c 0b 13 e7 +b6 94 b8 1a 56 57 21 0b e9 47 01 1d 8d 49 29 c1 +27 fd 2f 3e 31 06 c2 53 38 3b e6 35 41 d1 23 5b +d7 9c 57 2e 92 e2 36 34 28 20 98 be e9 4d 48 bd +62 8a 0e b2 1e d2 61 cf a3 5b 69 b9 77 70 e2 93 + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 14.1 +# ---------------------------------- + +# Message: +2b d6 e3 c1 de fd dd 5a 43 + +# Seed: +e7 84 d5 25 03 e6 29 1f 25 8e 44 2d b5 77 f9 91 +63 82 a0 d1 4c 7b 9d cc bd b6 07 af 01 f0 25 8f +dc 97 23 97 da 12 39 d4 44 9a 58 28 6e ce 20 08 +f7 18 f6 90 ce e7 3a 02 7f ab f8 4b df 7a ce 45 +f7 ed 2d 77 32 4c be e9 0e cc 6f 1e 7b 86 cc 29 +35 a4 7b a1 56 65 0b 42 fc 71 aa d0 70 99 a2 7e +97 fe 5a 3f 25 fe 13 48 e4 42 39 12 12 a5 cf 1b +44 5a 1e 70 19 1f fa 8f ca de 63 5d 2e 44 65 f5 +f9 13 c5 3e 33 b5 91 52 cd 8a 14 97 84 f2 7d 83 +18 28 af 2d 66 6a 5c 30 9b 56 d0 71 9c fd 80 73 +40 69 a2 3e 09 2d 83 15 39 9f 95 c4 0a d7 fd 0b +b5 f9 43 77 + +# Encryption: +85 ef 3e 47 76 77 bf 76 07 1a 27 bb c7 39 57 15 +cb 35 07 96 e4 4f 1b 52 a0 8e 90 5e 08 ff 12 56 +70 5a 9b f0 15 2e 87 2b dc 74 bb 1f 2f c8 63 1e +f8 81 2d 16 94 6a 30 b5 8f 44 64 d6 e7 b2 45 0b +e4 5b 48 cc ff 5d 8e cf 7a 00 b1 b7 8f c8 fa 54 +71 3d d6 96 a1 4a cb 68 00 c0 d3 b6 9a 0b 44 43 +77 fa 30 3a 7d 66 db 49 27 91 8a 4b fb 0f d4 93 +bf aa 01 6a eb ff 99 53 30 a6 dc b6 21 5d d3 bd +b3 5d 7c d6 1c cf 0e 9c cc bf 51 e9 ea 65 8e a3 +1d 12 43 44 4c 4b 72 ff f0 1a c9 3f 28 eb 7f 67 +c1 83 2e 56 8e d7 2f d9 57 d5 b4 fd 2f 00 b6 02 +31 71 b8 5a b0 ca a1 03 0e d3 e3 ed c9 50 31 45 + +# PKCS#1 v1.5 Encryption Example 14.2 +# ---------------------------------- + +# Message: +10 47 35 d9 ad 72 60 46 47 3d f4 b1 3b 2f 5f a2 +85 c3 d2 33 ec d4 61 70 58 2d d2 28 cd ee 46 4d +a5 09 5e 20 8c f8 fb ca 05 38 8b + +# Seed: +dc 6a 63 1e 29 75 45 d2 f6 fe 9c 69 a5 d3 06 a1 +09 16 d7 e7 ef 0d c9 53 f2 1b 6a 04 14 31 ec 8b +a5 ce 1c 13 87 43 fa ac 54 97 d6 99 f2 ff 1d 4a +44 a3 e0 63 7c c5 e5 e6 38 cd 73 67 7d 09 af ee +3e c9 fe 80 52 94 7a 73 33 4c 32 70 47 28 56 f3 +07 24 3a c5 8b f8 63 80 74 66 7d 7f 7c 18 e3 ab +32 7e a3 fc 78 91 f1 c5 8a b4 7e 4f fa 6e 7d 90 +11 a3 3d 9b 40 a2 d7 89 ee 42 21 25 62 30 ca 8a +61 81 1b 09 72 cf d9 86 01 75 26 18 1d 24 ee bb +32 cc + +# Encryption: +92 1d 2b 02 6d 6b 7e 22 20 1d e7 7f bf 67 99 90 +f9 af f4 ea 7f e7 ce 45 02 21 5f 9e 7a a4 18 b8 +5f 72 ea db 6b 69 42 bb 08 a0 8b e7 da 66 19 aa +5f 1d 2f f9 61 c9 dc 2c 34 1a e3 2a 25 4f de ab +a2 f6 45 0a c4 47 4b 62 74 f0 c3 46 f2 6d a4 ed +55 5a 8c 95 11 89 dc 83 69 f3 4d 76 d8 37 d6 f3 +8a 95 18 a6 27 1c 5b 56 34 62 25 a5 ab 8d a6 03 +2a 59 30 fd 5b 77 72 9d e6 32 e1 75 2f c7 2a 0c +34 ae ce 25 65 7b 28 1b e8 93 2c 56 50 c9 82 fa +14 5f de 0b cd d4 8a 73 aa 02 88 b4 de 46 11 33 +f2 7d 51 e3 86 01 6a 72 72 6a 9e de 1d 32 df c7 +e6 f9 78 0c 04 eb 70 ff ff c2 68 82 95 66 73 33 + +# PKCS#1 v1.5 Encryption Example 14.3 +# ---------------------------------- + +# Message: +31 7e 6f 5e 17 50 0f e9 4f df f2 84 bb e5 03 01 +04 4d 14 22 d3 ca 70 05 98 + +# Seed: +46 6d 53 c8 d0 bb 9e d4 60 ca a6 3d 79 bf b8 77 +bc 4e a3 45 ca b4 35 7e 63 9a 95 dc ae 37 9d dc +ea 5d 64 fe e9 9f b6 f7 5f f2 4e b7 4d 44 03 44 +d1 47 e4 33 14 a0 f8 9f 8b 96 14 82 15 36 8e b8 +65 1f 6d 3c a0 d0 8d 0b 4c 73 e6 d1 a7 68 40 98 +26 d4 3c 2f 81 f3 08 40 60 5c 43 d0 fe 67 1d 3f +02 4c 70 d0 b8 99 23 cf 90 4e 39 97 99 62 cd 51 +5c 16 74 29 2a a3 0d ac 70 0d b4 eb 7e 63 d5 6f +df 08 c2 24 70 f2 43 86 19 45 d0 0f a4 e2 79 90 +21 2c fe d4 28 5d f1 ed da 4b 0a ec 91 35 59 f5 +9d 12 55 90 + +# Encryption: +14 1f ca 68 dd 2e 4d 1d e5 08 6d bb 78 5f f4 7d +81 e3 9c 31 1d 91 7a 99 39 a6 ff 5b 13 43 9c a9 +56 c9 74 2b cf e4 50 b5 bd 03 5b 54 1f ab 30 7f +24 fb fb 3f 8b 90 21 5b 56 04 67 6e 56 96 f3 ba +95 fd b8 d0 90 a6 c2 4a 29 d9 90 fb ff 1d a2 02 +81 42 55 8f 0a d7 53 43 c7 2f 38 82 3d b7 66 7b +05 e1 6b 51 92 b9 33 60 07 f7 58 10 6c 32 8b d4 +76 11 8d f8 2a d0 75 48 a7 26 92 1f b2 e1 92 b4 +3c 8c 30 cc 9b 84 34 63 0e 27 fd 8b 23 ef 8d 8f +22 be 7f 73 ae cd cb 2b 1e c5 53 9d 5f bb 2c ff +9e d5 e7 f1 9b 49 18 3d 22 1d fd 53 7d 4f 37 03 +2e f3 2f 63 b6 ff 74 ee 24 a0 96 cf 45 59 27 09 + +# PKCS#1 v1.5 Encryption Example 14.4 +# ---------------------------------- + +# Message: +90 96 3d da b3 78 91 e7 28 8b 53 be 5d 9d c5 67 +b1 a0 7a 15 66 c2 af dd d7 72 73 24 ba + +# Seed: +a4 9f 12 15 17 5b a0 4c 27 4a bc 05 1f 0c 17 a0 +8a 63 64 89 43 db 2e 8c 76 22 bc bb 1d cc 56 7e +be 6a dd 8c 44 48 16 c9 d4 36 ee 93 ce fe 23 ec +41 dd fc b0 a4 03 bb 6d bf f0 ae 5d 6f cd d7 64 +da c1 a7 2a 48 4f 36 47 1f 4f 3b d7 25 b2 db 5a +fa 6a cf 53 0e 4e 4e 86 b4 fd a8 78 20 47 87 1c +b0 55 ad 68 c8 41 de 54 5a 55 40 c8 cc 12 e7 e3 +f1 58 14 a0 03 9a 81 03 4b de 9c 68 ae 22 85 e6 +16 b7 b5 55 5f 98 c6 13 ce 2e f6 66 a0 22 46 5c +63 67 d0 bd a4 0c 12 e9 41 f6 99 8a 14 a2 b5 e3 + +# Encryption: +8a d5 bf 78 23 2a a3 6f b7 83 58 3e 71 bc 13 93 +03 7d 13 e7 74 54 a9 dc 11 11 43 4e 75 dd 80 20 +46 ba b4 20 25 42 0c 63 96 1e a0 06 26 57 ca 50 +65 de b6 53 ac 78 eb 64 98 cf 14 d1 70 4c ec 59 +11 69 60 8d b0 1f c9 3d 0d 68 e6 28 01 b4 65 a3 +87 a9 c7 2f 7e b3 5b 0b a5 3a 5e fa 98 c9 f0 cb +7c 7c ba 18 04 cd 70 1d 02 97 b6 60 05 ae 25 ec +3b 6c d4 cf 31 94 a3 fa 65 d9 8c 4b 95 33 30 79 +0e fd e7 4f a2 75 d2 a7 9d 33 10 a5 bc c2 c8 1c +91 fc 25 56 2c a9 39 f8 d9 c1 75 ed f4 b0 76 73 +d5 39 24 e2 7b 15 52 88 1c 10 83 19 23 71 5d 14 +9f 1f 31 9e 38 e9 1d fa 56 6c 54 53 ba cc 14 8b + +# PKCS#1 v1.5 Encryption Example 14.5 +# ---------------------------------- + +# Message: +3d 81 02 1f f6 47 33 37 e0 4b 92 + +# Seed: +9b 70 29 73 13 77 e8 26 97 fa 56 b0 86 ce 49 d3 +c4 b1 54 9d e8 1e 3e 99 e1 6c d9 72 29 7a 56 0f +f4 83 f2 ef 5b 71 b0 0f c6 84 74 4f 22 4e 85 7e +6d 72 39 f1 56 d7 b6 10 2f 23 04 f8 a5 50 50 b3 +75 6c 54 8f 6e a2 6e a6 f7 39 4d 2b b3 79 33 35 +84 e3 b4 81 d0 73 c0 a5 8a 0a d7 87 ad b4 80 e1 +f2 0a 1a 59 0e 03 1e 6b 2b b7 f3 6a 93 61 0d df +70 83 a5 07 68 c9 98 62 3f 6e 64 37 6a 29 b4 a4 +18 03 2d 27 39 bd 4e 74 7d df c7 7f e3 cf 27 93 +a2 9b c7 67 bf ac c7 13 e5 f1 0e 53 1b 4c 71 89 +97 b9 bb 6b 65 15 e0 71 13 28 89 74 7e 54 6b 13 +46 8d + +# Encryption: +1b 88 4b 06 7d 0b b1 59 7f 5f ab 93 30 95 75 5a +53 0d 9d 04 e2 75 4a 57 97 ff ff 5e f9 ce f1 89 +54 99 98 23 00 50 3b 3f eb cb aa 09 d3 6b 7d ac +c3 0d f3 c8 68 f0 1a 5f 17 ed 4a 72 a8 5b 6a dc +80 a2 6a 1b 81 97 6b 39 3c ba 9b 0c 82 cb 1e 2c +58 3a b6 f3 14 ed a2 9a 43 32 21 b6 e3 ed 53 51 +53 74 bb cd 2b 96 f5 cb 5b d5 81 5d 1a 5d cb f0 +80 d2 d3 7c b9 6c 4d 96 1d c4 7e 13 0d b7 b8 d0 +18 2e 33 69 de f4 c0 f6 c4 2c 6c 20 53 1a f1 a1 +90 36 de f0 8d 4b ac a7 1b 99 af 3c 4e 1e d5 27 +d5 1f 37 d0 ee 1e a2 c8 b8 eb f4 fd 52 79 85 1d +c3 20 e7 42 00 8e 04 04 4d 0d a0 64 36 61 3d 1b + +# PKCS#1 v1.5 Encryption Example 14.6 +# ---------------------------------- + +# Message: +5c 74 5d d4 a8 c5 92 93 4e d1 5e 22 fa 9d ec 4a +4d c2 0a 9f + +# Seed: +0e 6a bb 82 9a 3b 16 d0 8b 0b d4 3e b9 5c 79 1a +f2 a3 39 12 ea 83 3e e6 89 3e d5 ad 3e e7 44 c8 +b2 dd 28 fc ee 80 8d 3f 01 49 58 25 be 0f e6 37 +32 07 a8 78 d4 a5 25 ea 72 cf b0 bb 58 a2 67 76 +fb 39 ee bd 33 5f 04 cf 71 86 be 61 c5 63 5d 95 +e5 60 ed df d4 5d d8 6a 4e 67 0d 33 56 8d 83 d2 +ca 20 3e d2 8d 90 e4 8b 06 4d 09 a7 5f 82 8d ea +cd 5b 37 ef cf 78 4f b1 1b 17 d6 d9 f2 31 52 24 +f8 e7 63 79 1b ac 6c f4 6e 1c 23 b0 b0 25 2c 19 +ed f0 40 d3 5f 59 25 53 26 5b 88 6b 29 ca 56 eb +c5 38 63 71 41 4d 82 a3 40 + +# Encryption: +2b 0a 43 b3 cd c9 9d 6c fc 74 da 2a 86 ec d7 d5 +76 24 75 d1 43 e5 48 6f a9 cb eb bf 27 d8 e4 14 +1e f7 2b 6d 4f 13 f6 64 b3 d2 e9 ec 32 22 7c 1a +d5 b7 6c 0d 1b ef bd 65 89 68 c7 db 14 95 23 82 +49 bc d9 5e 75 40 25 4e 65 74 98 23 b8 a3 4b f6 +a1 41 07 21 df 34 f3 c8 d5 79 f3 6a ed 9e 0b ac +23 1e 54 c2 7f 76 73 19 7d 19 f5 1c e6 ac bb cb +7b 1a 55 e3 8e de be ed 34 61 07 3e 80 c7 9a 4f +c3 09 31 30 69 6b ff f2 bb cb 74 90 5f 2d 34 44 +33 80 57 fd fa cb c4 db 81 93 5b 29 e9 9e 55 cc +c1 d4 8d 89 e9 dc 4a 63 a0 11 a6 23 32 cf 57 02 +62 a0 63 59 cc 36 c0 5a 6f e1 8a fb 78 32 b3 2e + +# PKCS#1 v1.5 Encryption Example 14.7 +# ---------------------------------- + +# Message: +b0 e7 7f 42 c1 a1 e3 f4 15 57 23 a9 0d b8 8e b1 +53 cb 3d 3a 28 ed df 25 9c 47 05 6a 47 0c 91 5e +c9 55 f8 31 89 f7 1a ea cd d5 5c 33 5f + +# Seed: +fb 36 01 10 5c aa 9a 2f dd 6d d6 c5 74 6f 4f ca +fe f4 41 bc b0 fb 8a 2c c0 3d 0b 57 34 9f 93 21 +af 9d 99 84 e6 4e 2e c4 85 c9 ad 75 5f 14 0c 0b +66 db 1c fc 26 69 1c 26 77 31 d1 a3 af e6 87 20 +2a 96 77 e4 2e 84 4d 47 7b 75 bc bb 8c 97 d9 9f +cf 72 b3 fb 6d 34 9f a9 c4 76 61 91 47 21 7a 04 +dc 06 aa 3c 3c 17 64 95 38 0c b9 2c 0a 7e 09 7b +4b 4c 5f fe 04 63 1a b1 d1 bf ea 03 67 86 50 c8 +5c 17 0f a4 a1 d6 4a 4c 13 5e 61 48 14 90 b6 2b + +# Encryption: +a4 bd d4 92 fe c7 9c 3a 79 09 3a 44 33 42 72 d9 +d1 7f 54 3d 02 02 c3 9e 40 8b fb 39 36 6b e2 de +61 df 50 ac 45 8c ae dd ef fb 69 e2 13 ca 92 b7 +49 53 66 34 7e de 73 3f f3 99 ae c7 96 c3 c3 b1 +df 34 9f 01 1d a0 1f ee 7d 21 c1 c2 61 84 3d e8 +82 08 56 0c 0e 89 84 b9 52 23 ea 37 31 db 91 c5 +93 7a 79 b0 db 93 87 59 1c e3 2e c7 f5 83 e6 00 +f5 24 44 df a7 67 1c e8 27 38 98 fb bc a3 a4 aa +68 32 cb b3 54 3a be 96 47 e5 f8 c1 37 72 82 52 +ce 54 40 fc e1 0e 4d 4e f7 5d 56 b8 14 d5 19 64 +44 41 41 1c 10 a2 a1 4c 35 04 72 82 7c 99 ea 3e +e5 fd a3 88 0f 34 1d ca 8d 3d 3a 4e 5e 05 ba 42 + +# PKCS#1 v1.5 Encryption Example 14.8 +# ---------------------------------- + +# Message: +b8 7f 04 b3 35 0e 12 63 da a3 f9 40 5e 6f d3 d2 +5d 8e fa 13 25 56 a4 95 71 f5 70 8a 42 52 7a f3 +1d b0 1e df 79 82 0f 93 26 64 5f b1 + +# Seed: +ec 8d 01 4d 6e b8 d0 23 9a 97 73 bd d3 20 bf b3 +f2 ee 8f c2 7d 5f dd 91 f3 f3 90 5d c8 a4 c5 ff +13 52 9a ee e4 61 85 4c cc d4 e0 9b 62 4a fa 64 +7a 7c 04 81 4e b1 e5 7b a1 4d f4 c7 95 b4 2e 84 +c4 d0 86 29 24 5d ac bb ed 27 39 9a 72 5a 94 8f +3b a2 f8 b6 4d 26 02 dd 0d 5f 55 cb 23 ea af fb +3a 66 50 8e 4a 68 9a d9 ee e6 44 e6 a2 6d 43 8f +36 63 fe a9 bd 03 12 bb 0e 7e 5a 6d ee 04 bb e8 +a0 74 5a 73 d5 ac 89 fa a0 96 a5 2e d3 04 6d 77 +de + +# Encryption: +77 5d c3 24 fe 9d 5e 05 ad 01 50 13 d6 5f 0e ba +0d cd 52 ff 9d fc 17 95 ea 93 d0 f4 33 57 98 96 +86 fe 3f 8b 04 62 23 bb a5 c7 84 9a ca c3 12 35 +43 43 26 16 c3 10 3a c2 ba 8d b0 a1 d2 99 40 bb +a2 62 47 0e 5e 53 be 60 e0 eb 72 4d 07 cd 91 2a +ef bb 87 fb 51 98 0e 9e 1a c1 94 da 31 92 95 41 +ca 43 22 4b 15 2b e6 f2 df 6c 5f 04 42 b4 f4 d2 +cc 2f b0 27 39 d4 85 a0 11 62 bc 8d bb ad 14 76 +eb 06 e2 45 ab 36 c4 c7 2d 3f 36 07 d0 50 84 a0 +f6 b7 2d c8 ba c3 46 bd 19 09 1b 02 f5 98 2c 91 +45 7c 7b 10 f4 47 2b 57 18 45 24 21 4b 23 82 5b +59 f4 34 cc 48 a2 b8 54 ca b5 0f f7 9e 59 09 1c + +# PKCS#1 v1.5 Encryption Example 14.9 +# ---------------------------------- + +# Message: +e1 95 a0 36 a5 30 e1 c2 a9 d7 a1 03 35 8d c2 bd +25 b1 01 bf 70 44 50 ab 8e 50 62 cb 63 df 56 10 +35 + +# Seed: +0e f8 81 de fc 45 ad 3f 3e 58 b1 10 5e 49 b4 23 +ab 89 12 4a 65 b5 2c fd 81 cf d5 42 b9 1e 7c 4c +1a 60 71 a2 cf 12 b4 82 7e d5 d1 9c ba f8 fe ea +54 bb 3d 73 85 7e e8 7c 71 5c 71 b9 ed 1c 07 c3 +af d9 0f ce 40 44 8b b5 7e 35 24 d0 38 80 98 39 +e3 6a 4f 55 44 c3 e1 81 e8 c2 e2 93 cd 57 54 c8 +65 74 ad e6 df ce 0a b3 4a 80 b4 d4 8a 9d 42 e7 +11 5d 8c bc b1 fa 28 c8 a2 65 01 db 7d 0b b4 96 +d0 1d d6 92 65 a0 26 e1 a9 7e 9d 3a 1a 65 a8 aa +8e c2 df 06 34 e6 f2 65 1e f4 35 40 + +# Encryption: +1a d7 7a 00 7c a4 37 ab d0 15 9e d4 b0 b6 81 54 +16 f9 f0 9d 1b 12 15 fb 7c ff 11 52 97 60 1a 88 +30 f2 09 17 86 35 63 85 3e d7 8e 9c 3d 7b a4 c9 +7a 05 cf 19 dd 32 92 48 47 1a 47 03 a4 65 17 8b +85 d4 ec d5 42 24 12 98 c2 fe cd 41 3e 23 a7 0c +8a 5d 47 c2 0e 31 c2 da be 3c 82 a9 54 50 27 27 +49 ae 2e bb 89 98 5d 00 b6 3d ed d9 59 6d 05 16 +d1 2a 78 c3 74 b7 ed dc 7d ce e8 e4 fd d1 6c 1d +fa bf f7 ff d4 c1 fd 61 ce 04 be 8e 49 75 c5 cd +71 e2 cb 0e 54 1b 84 61 bb 81 fb 28 cc e7 73 65 +3e 8b 16 b2 8a 8c 20 74 28 89 5f 28 53 55 87 a5 +c9 9d 46 ba 4d f9 ae 08 50 18 51 3d 69 ab a3 f6 + +# PKCS#1 v1.5 Encryption Example 14.10 +# ---------------------------------- + +# Message: +04 2a 39 22 aa 87 1e ea 0d 78 42 2c e7 85 66 ab +bb 5b 08 c2 dd f1 ee 30 cf + +# Seed: +5a e8 51 14 b0 02 7a 23 c7 2b db 46 ae 7b b8 87 +be c5 ba d7 a9 88 4e 93 f6 f4 fd 0b c9 38 bc 72 +41 0c ce 96 a1 4f 4d e1 99 19 77 35 05 1e fc dc +c1 96 f3 ad bf aa 06 3c b3 f7 a2 34 c6 cf 99 d7 +0f bb 7e 35 b6 ae c6 64 14 66 93 91 e3 cb e7 21 +ec 99 1a 1e 5d fb b0 38 f2 70 36 85 93 74 9b 20 +8d 08 9a ae e2 ef 35 c3 da f6 23 8b 5f e4 2d 13 +dd e4 07 df 14 f2 d6 18 c9 79 c9 7d 2d e0 29 33 +b5 7f e8 81 22 04 86 2b 2f 1d ee 98 3f 24 c2 c5 +96 ea 66 8e 63 7d 0a 6a e6 dc 52 65 27 69 94 e7 +e4 f0 2b 6e + +# Encryption: +12 44 de 88 0e 0f 78 52 e9 96 95 9d 76 2f ca d9 +15 65 a4 d0 ad 3b c5 27 50 d4 a0 44 0f 0b 5c 65 +1a a0 e6 f4 92 06 1b 2c 86 24 c5 2e de 68 58 fa +25 18 ae 8e 8b 11 65 58 b2 c8 07 6c 17 ae 78 3d +8d b2 5f 0d 8f b1 f2 75 8a 82 ab 97 1f a7 28 3e +f0 74 9a 37 be 28 93 f8 94 37 fb 8e a9 00 72 b5 +85 5a 26 08 fc 54 2f 5d 2e 0c b5 43 f4 fa c5 28 +f9 43 52 d0 16 40 fc 2c 53 1b 79 81 0c 00 77 7b +c9 e1 0d d9 ea 99 96 e7 40 87 fa dc b7 1a a1 43 +00 67 65 71 61 48 82 94 3f 4a 56 14 12 c0 54 67 +dc a6 6c a4 9f 82 29 35 18 23 db 8a 6b 9f 80 3d +70 9c 11 87 ed 74 10 cf 91 00 15 59 5c ea b6 3e + +# PKCS#1 v1.5 Encryption Example 14.11 +# ---------------------------------- + +# Message: +f3 1d 3d 0c 30 fd 65 d7 b9 8b 70 99 44 78 2e 20 +52 5c a7 c1 f4 2d 5d 03 a0 f6 d2 75 9d f1 91 9e +ea 82 f8 0f 10 00 fd 5c f8 59 df 59 87 1b ac 82 +dd 90 76 cf + +# Seed: +04 4b c3 77 e8 58 9f a5 af 1c 17 34 7d 50 e0 cb +bf 90 15 76 f2 41 de 69 0c 88 16 c1 29 cd 9f 2f +b0 83 1a 01 7b ec 30 b8 2b 68 f6 98 31 1a f6 e0 +77 72 bc d8 98 fa 0c 27 f6 2a fd e8 95 89 77 84 +46 25 55 2d 9b cb 5a 81 aa 3d 74 15 b2 42 a0 3b +12 fc 1d 3f e2 d2 ce 6e 5f 71 c4 a4 a4 c7 ca 83 +e0 65 6f 50 02 ac 36 d8 d0 2b 69 ae 65 73 44 98 +f1 31 95 2c ea 48 1f a2 c2 96 5b 6e f0 51 7e de +50 dd b0 9b 3e a7 02 6d 06 + +# Encryption: +86 f6 6f 0c 25 05 85 06 59 43 de 2f 71 1f ae 4f +f2 62 70 0e 0d 33 06 a2 4c 94 30 f8 7c fd 93 de +f4 c3 44 7c c7 21 0f d9 4a 14 33 62 f4 f9 45 c6 +db e2 80 bd ef 5d 14 f7 5e b7 bb 31 32 0b cb d0 +d8 8f 0c cf 2c 95 a7 4c b4 58 c6 27 2b 58 bf 74 +30 93 c4 bb a2 d7 be e9 ea 2d d3 0c f7 2f e2 93 +c9 0c 97 43 0a 04 7b 17 26 63 91 c5 1f 5c 39 8b +a3 df 8c b7 4b a3 e3 72 f9 55 5c cc 97 d6 db 76 +14 ea 06 d5 c4 8c 1c 60 06 13 3d 0e 9d 69 95 79 +93 85 92 0a d8 af c3 de ad f6 31 ce cc 55 9c af +f4 95 b0 8d 68 3f b2 2a a6 97 d7 1c 69 6e 46 b1 +bf 4f d7 6b 8d 0b 39 f1 79 bf 66 84 1b bb 97 07 + +# PKCS#1 v1.5 Encryption Example 14.12 +# ---------------------------------- + +# Message: +6a 35 55 57 9d ad 03 94 35 43 ff 74 e1 74 7c 25 +7a 83 d3 52 94 c2 53 93 83 e2 35 de 69 + +# Seed: +5d 92 43 4e db d4 f5 bd 27 19 71 71 f8 53 ce b7 +26 30 30 83 ad 45 67 a1 d7 c6 10 4d 19 2b 9b cc +df d0 da ed a2 74 e5 cd fb 3d 0c 5d 19 c9 68 25 +81 ec 7a dc 1a 87 e0 81 51 41 5d 5a 9a dc 1a f4 +50 b1 ba 88 d0 ef 32 ac 2d 1f 8a e3 45 95 28 14 +75 3a f3 8e 12 63 5c ff 8c 09 21 59 b4 e7 5d ee +a1 98 3e d3 d2 d9 ec 2f e7 b9 a2 e1 6a 14 1e 81 +8b 84 cd 9b 71 c1 29 a8 b3 c6 db 62 02 32 dc 03 +a2 40 1f 73 1f f8 a6 3d a4 58 a7 d8 78 90 56 25 +ae e1 fc 09 4d fb 07 b4 57 5a 7f 0a ad 23 3e 82 + +# Encryption: +93 10 27 2d 12 4b c5 cd b7 21 88 98 40 aa 77 15 +e7 67 32 17 00 cb 39 b2 b8 a5 a8 2a e3 f0 2e b9 +67 e8 db 46 84 3b c1 bf 62 ed 8b d2 ab e8 14 34 +49 7f 99 00 64 02 53 98 2d 37 2b 2b f7 c1 b0 9b +d5 01 96 74 a8 34 fb bd ff 35 68 a2 82 4a ed 4a +80 48 d2 b8 61 36 27 75 bd 5f 0d 63 b3 48 36 3d +13 78 69 1f 5d d1 d7 96 10 74 ed 95 fc 90 07 bd +5f 5c 29 23 c1 7c 42 90 4e 2b f9 d2 48 77 9f df +b2 03 97 38 41 a1 12 90 c7 e9 e9 35 6d 4e ab 17 +0e 43 1b fe 45 4a 88 01 0d 9a ff 33 70 0c ee 55 +c7 04 c8 2a 7f fb 15 e2 53 ef 84 f4 01 9e 12 43 +8f 7c 73 86 dc 53 5b 19 ca 86 af 71 d4 77 60 8e + +# PKCS#1 v1.5 Encryption Example 14.13 +# ---------------------------------- + +# Message: +cb 79 af 5a ea fd f2 ba d2 1d fe 62 92 66 42 cb +a8 04 ec 7f d0 ea 5d 54 08 ac e9 ed ff 28 e7 e8 +df ff 6d f3 83 af 14 40 21 46 04 76 c0 c8 2c + +# Seed: +5f ce a2 57 cf a9 2c 84 f0 b8 93 7d 17 3f ae cf +75 03 ab 16 2e 0b ae ef 7e 4c 51 1f 3e 32 a3 24 +ed 40 e2 42 a8 52 ba 57 89 5b 7c fe 4d 61 79 61 +e0 36 f6 63 e0 22 8a 29 cd 1a 95 ac ac 08 a2 55 +26 d1 eb ff 0a b3 f0 33 ed bf 1a e2 76 a8 d2 36 +73 6c c7 af 51 b5 d2 bd c8 3d cc 7d 7d 3b f5 b8 +22 af 2e ff ed 7e fc b6 17 e0 83 e5 1b e9 94 ae +d6 56 9b 23 83 b9 41 ae e5 94 c7 b0 12 e6 75 1c +37 b7 a5 4e 2a 19 18 24 a1 30 d5 5c f8 45 + +# Encryption: +11 fa 81 9d 3a 63 88 04 ee f1 d9 56 0a 11 f5 23 +0a 0b ad fd 66 eb 68 4e 7d 69 df a2 89 8c 8e 0b +6e 04 af 8e fc 70 61 08 1e c5 9e 45 85 76 42 e8 +b2 00 41 af 50 8d 9d 4e 28 82 20 f9 fd 38 9d e8 +b2 91 24 ce 74 7e b6 8e 2e aa 8c 8f 6f b4 93 f6 +11 ac 09 b7 23 09 5d 07 ee d9 24 f6 ab 8e 09 ff +93 c5 51 6d 1f 0e bf 62 c5 f0 22 f5 bb 4f 4c b5 +b8 f5 d4 87 a1 7d f7 d0 12 d7 04 35 7a bf 17 48 +67 ce 40 cd c5 50 11 b0 71 39 be a4 5c a0 e5 81 +78 0d e6 54 17 cc 83 5f f2 69 84 fd 0f eb a1 87 +69 c3 94 a2 e4 85 02 3e 31 d3 b0 a8 88 a7 b1 4c +78 1d d8 5b ab 40 86 74 f5 f5 7e 4b 76 3d 84 35 + +# PKCS#1 v1.5 Encryption Example 14.14 +# ---------------------------------- + +# Message: +d1 62 33 fc 77 5c 31 9f 15 7a a2 00 47 6c d6 ed +64 a1 ea + +# Seed: +bb 33 b2 2b 5f 46 79 4b e8 3e 6a ff 34 a0 e4 11 +d1 f3 f4 b8 da f9 b5 85 87 24 ef fd b9 69 c9 55 +25 c6 2d c4 4b b2 b0 83 38 60 03 05 4b bd 36 66 +b7 82 82 60 6f e6 ea 17 27 31 be e1 16 72 d6 01 +de 32 42 3d 83 f4 63 cc 29 30 f5 fb 79 da 15 34 +c4 15 c9 65 82 75 65 94 a9 99 b2 26 35 42 48 a0 +9f 14 1c ae cf 88 83 90 78 f7 7f 40 bd 48 51 34 +9c 1f c7 5e 1e ce 6f d6 96 6b c9 c9 d5 ec 12 09 +6e d5 04 35 46 85 9e 4f 95 7d 31 88 e1 d9 06 0b +59 c1 f7 f6 2e fb fe 82 5d da 45 35 3e 6f d4 fa +ba c9 83 f9 44 f4 c2 c7 9c bb + +# Encryption: +10 c2 0c 0c 71 b1 1b be ce 14 c8 14 83 dc fa 73 +0c 23 d4 dd 61 b8 75 5b 39 94 9d fd 4a 3c 50 33 +21 60 ee c6 f7 71 0e 09 c7 a9 7a f9 3f 70 44 b9 +2f 41 d0 9f a3 e6 c6 ce 1f 64 11 48 4e d4 75 40 +a1 b5 9e 23 c1 93 34 b6 6d 68 20 c2 d4 4d b0 f6 +aa f8 5a a2 7f 53 a4 1f 85 6b f6 a5 91 36 59 86 +9b a4 ab dd ec be 87 41 3a c9 5b e6 40 09 59 3b +5c a2 d0 78 3a 16 f6 08 66 57 55 24 53 93 fc 14 +4f e3 ea 5e 9a ac 9f 1f 99 1a 92 85 38 b4 69 97 +d3 06 3c c1 a6 9a dc 19 2a 40 c7 6f 92 d4 7a 05 +80 e3 c0 21 20 02 3e ce 70 32 80 7b 7c 09 13 43 +aa 87 3f 6a 4d dd e4 3f b2 dc c3 79 ae ee f6 54 + +# PKCS#1 v1.5 Encryption Example 14.15 +# ---------------------------------- + +# Message: +d2 f3 c2 e6 f4 3b 0f c9 fc 22 93 b8 45 88 e6 61 +15 + +# Seed: +b9 81 64 89 52 5c d0 26 15 6f b4 e8 a4 a8 f3 4a +ea 8a 3a a1 a6 34 cc cb 32 58 91 8f e8 5c b8 d4 +aa 02 a5 28 52 a8 94 1d 3e a6 c0 48 b5 8c c6 c7 +56 85 67 56 25 e5 e4 dd 7d f9 3b 8a ce c0 79 67 +0b 49 f3 dc 6e 07 63 ed 4c 8e 2d 0e e9 b5 ca 5b +b6 2d e0 06 91 98 38 e4 b6 9b a1 05 d4 c5 a4 cc +6d ca 67 b1 21 93 a0 32 b6 92 73 96 44 cc cf 72 +3f 9f 69 e4 8b 94 c0 bd ce 5a a3 5f 75 dc 53 92 +7b 81 e3 42 ce 72 c6 b6 5c f7 5e ae ca c5 fe 0d +ea 93 88 5b a4 20 af 99 32 d8 4c a4 b5 0e 07 e3 +28 ec 5f 81 6d 2d 86 96 b2 0d f7 5f + +# Encryption: +80 f1 df 25 f3 6f 31 4b 98 2c 9c 8a af c0 b8 a1 +a2 f1 74 ab b2 98 08 69 c2 9d 19 be 1d 2d 93 b4 +fb 42 99 90 6c 35 7f dd 40 e8 9a 19 54 92 a9 79 +76 61 f0 5d 38 71 d1 bd 0a 5c 45 d8 f9 b0 fe e5 +65 b0 00 4f f5 af c5 a6 f8 9a d6 03 e8 22 83 57 +0b db 4c 6e 0c fc 31 3e 4e 66 5a 94 34 b3 2f cc +77 3d 6e da bc e8 5f e7 c8 0f 03 30 2a 84 e2 08 +b5 bd 0a ad 91 ce 62 fb 8c 2b f5 4b a6 6f 7e 8d +00 21 92 16 29 20 a4 6e 36 de a5 66 1f dd 75 81 +53 56 40 74 b8 55 9f 88 93 62 42 fc 09 98 14 8f +19 eb 50 fc 11 fb 24 a7 ed 8c 83 49 65 8f e9 d3 +1e 62 74 d4 5d 6f 2b 60 9b b5 cc d1 7e 28 4c 99 + +# PKCS#1 v1.5 Encryption Example 14.16 +# ---------------------------------- + +# Message: +21 ee 58 12 e3 24 6d ab 9c 3c 25 9b 21 37 d6 5f +98 a0 5e 57 40 46 5c a2 2c 69 34 97 00 a4 2c be +4f fb 39 3f e2 81 99 33 9c 51 03 1c d3 b2 2f 2f +0a 83 + +# Seed: +e9 de 5b d3 55 e6 af f1 9f a1 1a 2d 0d 3e dc 3f +64 69 bd 3c 75 72 06 d6 6b 3f 09 90 8f f6 18 af +48 01 ac 77 b5 2c de 03 d4 ae 74 9d 02 15 5e 5c +70 fc 99 5f 48 76 72 d2 80 63 58 55 db 4b 64 a2 +26 09 b0 c1 60 67 16 3c 51 90 42 05 7c b3 67 12 +c7 c2 fe fe d1 1f 73 c2 8b db 9d 25 f0 63 6a 4c +aa 11 26 9e 5f e6 5a 2b 17 56 86 a1 5f 1e 48 d2 +8d 34 5d d9 a1 b2 90 0a 24 f9 dd da 3d f3 a6 9f +fb 9c f5 04 5a c4 a1 93 ae 90 2f + +# Encryption: +7d 8c 53 1d 4d 35 49 e0 bd 2e e1 62 b6 82 53 9d +a6 17 22 b8 8e cf 8c 7d f6 d6 b8 1f ef 50 18 bc +4e a1 0a 7e 1a 4e aa 02 15 d9 b3 cd f4 13 47 92 +9e ac 27 48 eb d7 79 94 5c 9b c4 61 dc 51 f4 8d +f6 52 75 53 f0 70 37 e5 33 ce b1 34 8a 46 a7 ea +79 7d 85 a2 6a 9f 44 c5 88 69 99 6e f1 14 69 bc +c1 0b 75 6c 02 d5 c0 e6 18 83 68 5c c3 7d 75 8d +fd e4 c9 b7 35 4e 3b 4f 31 6c a7 f7 fd e6 59 c3 +fd 5e 33 2e 1b 63 92 a2 92 9e 13 17 66 ce 9b a1 +d9 71 ad 24 6f 3d f0 22 43 38 63 8b b6 53 45 8c +d4 b5 26 d9 61 74 4d af ec d5 99 8a d7 2a ed 3c +34 59 9f 7a 40 98 e3 d2 df 9d 13 a2 1c e2 37 0c + +# PKCS#1 v1.5 Encryption Example 14.17 +# ---------------------------------- + +# Message: +a0 34 a6 c1 66 cf 0b 25 d2 dd e5 3a f4 b8 33 b4 +78 c6 b0 d2 fb 0c ef 13 7f bf 5c 27 12 70 64 91 +23 7f 7b 28 6d 12 11 d5 73 10 f8 a7 62 b1 b3 bf +e1 9c 9a 4b 16 d3 e0 a8 + +# Seed: +d8 44 17 97 22 87 13 0a 24 a6 06 f5 83 29 7a c9 +11 52 8a dc db bd 7d e1 4a 5b 48 9b 67 86 f9 f6 +f7 e0 b7 3b ab 53 8e b6 c4 5f f3 4b d5 dc 43 ea +e8 d8 c4 3f 71 65 16 a6 0d a2 47 53 6f 63 4b e0 +65 d9 4e 7f 92 ad f5 2a 96 7e e0 5f d9 af d7 32 +33 3f 99 ad 05 82 97 b2 8f 8e c6 fe ff 80 28 44 +a0 09 7d f9 1a 97 70 2c 48 3a a1 c7 89 2c 7d 43 +b6 b9 1c d4 d8 5d 3e d2 f1 e9 55 39 57 06 c3 b3 +39 ba f2 a0 e0 + +# Encryption: +90 4e 04 07 23 ab 97 88 a5 ed 03 52 eb 96 c7 f3 +d7 07 cf 0d bc 25 8c 51 dc f6 24 34 06 f0 c7 42 +c6 cd f2 07 67 13 2c 09 5e 6c 82 a5 02 5b e7 b4 +13 4d 8f a4 de 18 7f 8e cf 12 fd d3 be ab db 06 +15 8a ef 46 c3 fe d2 d1 83 34 06 ec a7 a6 9e b2 +d2 08 a2 f6 f4 40 d5 4f 6b e5 dd 56 47 09 ed a8 +12 ac 06 29 a9 4c 7f 8a ee 78 be af 9e 93 78 c8 +dd 9c 62 03 74 bb ac a3 94 18 59 dd 70 2f 6f 7b +25 a2 38 45 9e e8 97 59 de 94 22 b5 bb 6d 28 57 +16 6c a2 12 0e 63 47 74 a0 d1 d4 2e b8 d9 48 15 +a1 04 4b ea 8b fb 02 da 58 62 cd 9a 74 5f 15 92 +47 8c 6f 57 bf d1 3a 5f df 4b 8f aa e8 a4 bf c4 + +# PKCS#1 v1.5 Encryption Example 14.18 +# ---------------------------------- + +# Message: +8f c6 39 4c d6 e1 75 33 d1 ff 8e bb f3 e1 ae ae +a3 30 ed 9f 5a 6e 1e fb 83 45 42 94 c6 ce 24 f6 +90 4a 0e + +# Seed: +be 1c 18 02 db 44 68 2e 58 c6 1f e3 87 57 ea 0e +38 4e ba dd 79 59 48 4b 38 bb 23 57 55 c4 61 77 +e6 71 76 9f 36 57 3d 7c b0 ee 7e 82 08 7b 58 4b +58 bb 30 05 30 33 68 c6 59 0a d9 f2 88 2c fa 74 +0d 51 dc 55 eb 0c 79 0f 5b b6 b6 a3 bd 71 f8 b2 +14 6b b9 e8 03 4c 35 b7 ca bc be 10 93 6f fc 5f +0a 8d 7b 30 47 6a b9 16 85 ae d8 fa 95 8e 73 c1 +ee a3 04 4c 56 b4 b8 70 da 89 37 1a 93 b8 96 52 +79 b5 5b b9 2c c3 16 c2 3e f0 97 53 51 c7 49 81 +7d b5 dc d8 6b 94 ad f6 03 bd + +# Encryption: +b8 3c 71 8c e5 c6 ab 1e 40 ff a5 67 0a c1 66 66 +4d 3a 68 33 cb 3b de f4 62 79 4a 25 d5 3e 17 04 +60 06 85 8e 63 f8 8a b9 5d 04 f4 fb 67 74 f7 00 +5d bb 2e 22 d5 19 36 0d 5e 13 38 ad 15 30 8f 6c +64 12 54 95 67 00 7e 02 1c b2 37 ed 4a f5 ee f3 +bc f9 b7 31 59 9f 72 53 ce ba 83 04 f4 ee 8c 34 +33 39 d0 a0 64 eb 77 f1 e9 3f d1 cc 7b a5 fc 3b +b8 18 4c ed 0e 86 97 ac 47 b7 46 20 c4 94 ea b5 +86 ed 9f e7 6e 07 e4 bd 2a 2d 1b 95 59 5b 69 c6 +46 77 a8 83 5d 56 ac 63 9d f8 f6 43 24 1b 3e 2c +46 88 d2 ad f2 28 de 2d a9 bb 0a 36 34 38 e7 51 +b5 25 0d ea e3 05 a3 90 5e 7e 07 7a 4e 8c 74 66 + +# PKCS#1 v1.5 Encryption Example 14.19 +# ---------------------------------- + +# Message: +89 a1 2d 22 bf 87 7d 44 0a 2e 03 ae a9 32 eb 51 +83 37 9b 3c 8b 90 be e8 fe d6 fc 6d af b0 cf 05 +27 + +# Seed: +60 72 89 5e 47 80 c8 f7 7e 0b 19 5f c9 f5 db 78 +33 f7 b6 f5 c8 1c 1d 30 cb e9 e8 0c cb 38 66 06 +9f 8d b6 96 3a d4 6d 52 94 2a 5a 73 f6 a3 27 a9 +4e d1 19 df ce 4c 37 65 84 37 13 b6 19 f9 c4 38 +32 03 d5 5e 2a b6 1d a8 96 1a 81 03 7f 11 18 a7 +82 97 eb 36 6a 1c 51 d9 f9 46 6b 71 5b b6 29 99 +e0 a9 d6 e0 25 01 d4 7f 97 db 40 9e 38 86 e1 36 +6c 3e ff 2b a7 90 e2 62 43 22 7a a1 58 80 82 bc +e6 d5 cd e3 ea 7e fb f1 5c 6c 7d fa 54 54 72 fa +9e 93 95 6a 45 51 d5 a7 7c a0 0e 26 + +# Encryption: +b7 ac bb cf f0 fa 9f ca 6f 0b bd e5 a2 f0 a1 e6 +a0 ab ad b3 2c 89 e3 17 25 5b d1 8d 12 e1 a6 0b +3e 00 2c 1d 69 35 64 48 32 9a 49 b5 bd 24 19 10 +fa 0c e0 3b 3e 68 a5 90 50 75 99 39 1e d1 53 97 +92 29 3f ef 13 17 4d ac ea 6d 2a 05 b3 9f 68 48 +28 a5 d6 d2 17 f8 4b 78 2c 8f c9 84 3c af 6a eb +17 8f 0e 2c 6b d2 a0 e6 f7 b8 09 29 61 17 cc 8a +6b f7 37 35 84 64 24 ad eb a1 ab 31 14 5f ca 3b +8a f7 68 c9 d0 a2 8e 09 d5 8a d4 96 42 31 08 f0 +8c aa c1 74 ac d1 f3 ac 43 48 69 61 c5 c9 0e 1e +fb 89 bd db 7b b3 9f 4c a3 af 57 12 f5 53 af 59 +4c d5 d3 64 13 29 14 26 10 07 aa 1d 5f 21 6b 8e + +# PKCS#1 v1.5 Encryption Example 14.20 +# ---------------------------------- + +# Message: +09 d6 94 8c e1 c1 f2 4c 6d 52 9c bc 5d 6d 6c 1b +ea ab 56 95 b3 0c aa b7 44 96 9b f7 f9 db d2 83 +33 5e 98 a9 bc d6 5d ad 2b 4f 0e 3c ec 89 0b 05 +e6 7f e9 78 23 d4 + +# Seed: +ed ed 62 a6 50 f7 de 3b 12 80 22 9d 5f b1 c4 40 +8e 82 df e0 31 7e 64 30 fc f4 71 b1 e2 8d a8 cf +6b 4b f4 c5 d0 31 e3 ee 68 8b 64 07 72 aa 50 08 +e5 86 3c 70 7a 40 22 c3 29 a6 66 4e 71 10 12 06 +b5 4d b5 40 6e 7f a9 c8 22 6f 42 93 11 19 62 0c +a3 0d e7 d0 3b e1 43 94 0c bb 4d 1a 9c 86 e9 86 +3c 98 7b ff 07 02 3d e1 98 64 f7 33 da 0c 89 bd +03 9f 19 f4 d8 ed 61 6f 7c 6e 94 94 18 5b 60 4a +1a 7b f7 49 0f d0 d8 + +# Encryption: +7a dd b0 5c bf 0b 17 aa 50 8a 0b 17 0c 4c 5a ee +84 ce 06 65 0d 08 c9 96 6d 95 d3 07 1a 9a 8f 3a +93 f9 6a 87 53 99 b4 78 c2 56 d0 41 5e 74 84 95 +98 21 1f 9f 9d 0b 89 36 7b aa af 17 4b 7f 13 d8 +49 0b aa a7 40 96 1f 52 d7 e3 53 c5 04 81 8a 00 +0b 03 67 4d 9c e4 93 dc 3a 4e e9 16 13 01 f6 1d +e5 21 ae f3 f6 d4 1d 82 e1 c5 dc e0 2e 63 6e 77 +40 a1 83 f8 02 3a d2 61 49 41 d9 b1 61 cd bd f4 +8f 8a 56 2c 8f fe 44 f5 7a 74 6f 26 39 e5 e8 3b +cf d3 92 d2 3e 1f b4 a8 d8 5e 3b a5 e1 cb 9c 0e +53 f0 d9 1b 01 ce c0 f0 ef 9d fe 3f 2b 30 65 bd +55 b7 2f b1 70 60 ab e8 83 0a ca 00 44 64 fe 7d + +# ============================================= + +# Example 15: A 2048-bit RSA key pair +# --------------------------------------------------- + + +# Public key +# ---------- + +# Modulus: +dc fa 10 ff a7 46 65 ae ef 87 09 74 ea 99 b2 ce +54 54 7c 67 f4 2a aa 6d d0 1a 2e d3 1f d2 c2 42 +af 5d 96 0b 1f 89 6e fb a3 54 3d 65 54 b7 b1 26 +87 a5 c6 88 56 8f 32 e0 26 c5 32 d2 59 93 b9 7a +7c 28 42 ec 2b 8e 12 35 ee e2 41 4d 25 80 6c 6f +ba e4 38 95 4e ba 9d 27 55 df fe eb 1b 47 70 09 +57 81 5a 8a 23 3f 97 b1 a2 c7 14 b3 e2 be 2e 42 +d8 be 30 b1 96 15 82 ea 99 48 91 0e 0c 79 7c 50 +fc 4b b4 55 f0 fc 45 e5 e3 4e 63 96 ac 5b 2d 46 +23 93 65 c7 f3 da af 09 09 40 0d 61 cf 9e 0c a8 +08 3e af 33 5a 6f ce b6 86 3c 1c c0 cf 5a 17 1a +ff 35 d9 7e cb 60 ef 25 1c 7e c2 c8 a5 88 36 1d +c4 12 66 a4 b7 ed 38 b0 26 ce 0d 53 78 64 49 db +b1 1a 06 ea 33 cc f1 ec a5 75 20 1e d1 aa 47 3e +d1 18 7e c1 d8 a7 44 ea 34 5b ed 7e a0 0e e4 e8 +1b ba 46 48 60 1d d5 37 dc 91 01 5d 31 f0 c2 c1 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +dc fa 10 ff a7 46 65 ae ef 87 09 74 ea 99 b2 ce +54 54 7c 67 f4 2a aa 6d d0 1a 2e d3 1f d2 c2 42 +af 5d 96 0b 1f 89 6e fb a3 54 3d 65 54 b7 b1 26 +87 a5 c6 88 56 8f 32 e0 26 c5 32 d2 59 93 b9 7a +7c 28 42 ec 2b 8e 12 35 ee e2 41 4d 25 80 6c 6f +ba e4 38 95 4e ba 9d 27 55 df fe eb 1b 47 70 09 +57 81 5a 8a 23 3f 97 b1 a2 c7 14 b3 e2 be 2e 42 +d8 be 30 b1 96 15 82 ea 99 48 91 0e 0c 79 7c 50 +fc 4b b4 55 f0 fc 45 e5 e3 4e 63 96 ac 5b 2d 46 +23 93 65 c7 f3 da af 09 09 40 0d 61 cf 9e 0c a8 +08 3e af 33 5a 6f ce b6 86 3c 1c c0 cf 5a 17 1a +ff 35 d9 7e cb 60 ef 25 1c 7e c2 c8 a5 88 36 1d +c4 12 66 a4 b7 ed 38 b0 26 ce 0d 53 78 64 49 db +b1 1a 06 ea 33 cc f1 ec a5 75 20 1e d1 aa 47 3e +d1 18 7e c1 d8 a7 44 ea 34 5b ed 7e a0 0e e4 e8 +1b ba 46 48 60 1d d5 37 dc 91 01 5d 31 f0 c2 c1 + +# Public exponent: +01 00 01 + +# Exponent: +21 95 08 51 cd f2 53 20 31 8b 30 5a fa 0f 37 1f +07 ae 5a 44 b3 14 eb d7 29 f5 dc b1 5d a7 fa 39 +47 ac dd 91 5d ae d5 74 bd 16 df 88 bf 85 f6 10 +60 b3 87 17 2f ae 6e 01 26 2b 38 64 c2 d3 c2 2f +94 e0 4a 81 59 42 2b 4e d2 79 c4 8a 4c 9d 76 7d +49 66 07 1a 5b bf 5d 04 3e 16 ff 46 ec 1b a0 71 +6f 00 bb c9 7b ff 5d 56 93 e2 14 e9 9c 97 21 f1 +2b 3e c6 28 2a e2 a4 85 72 1b 96 dd cf 74 03 fa +03 7d 0c 57 ab 46 3c 44 8d e5 cc 12 26 5a dd 88 +6d 31 1e a8 d8 a5 90 3f a5 6c 5f 1c 9c f2 eb 11 +cb 65 7a 1a 7d 3e 41 35 2d c3 e6 86 89 8c 4c e4 +30 5e 8b 63 8e 1b 08 a2 a8 6c c9 eb 98 66 f3 49 +9a c7 7b 61 36 b8 1c b2 76 d6 14 cf eb 7b 6e d3 +f3 bc 77 5e 46 c0 00 66 eb ee e2 cf f7 16 6b 57 +52 05 98 94 7f f6 21 03 20 b2 88 fb 4f 2c 3f 8f +e9 7b 27 94 14 eb f7 20 30 00 a1 9f c0 42 48 75 + +# Prime 1: +f1 23 bf e5 3d e9 7a 56 9d 91 ad cf 55 6f a6 25 +ad 30 f3 fd 3d 81 1f 9e 91 e6 af 44 b6 e7 80 cb +0f 32 78 29 fb 21 19 0a e2 80 66 46 d7 28 cd 9b +65 31 13 2b 1e bf ef 12 72 99 30 60 f1 ce 70 b1 +24 39 30 91 ee 85 93 b7 27 36 7e db ba 00 9e c5 +be 17 c4 ac ee 12 0c 84 12 67 d4 76 31 a1 6c 36 +a6 d1 c9 99 73 c1 b0 b5 a8 35 bf 39 fe af e8 f6 +42 1f d9 c2 a9 0b c2 79 76 65 9e 67 bc 83 12 4d + +# Prime 2: +ea 98 39 b7 e3 7e a8 9b bd a2 7e 4c 93 47 1c b4 +fd 92 18 9a 0a 96 bc b4 d7 56 93 f1 8a 5c 2f 74 +2a f9 e3 6f de 67 9f bd 9e ae 34 5f a2 69 52 7b +69 65 02 1c 4b df 54 d6 85 bf 08 96 0c c9 76 f6 +8d ca 21 ce bf 44 f2 68 a5 9d ab 8d 1a 25 e5 19 +f5 14 7e 1f 45 fe 28 7d 74 cf 72 5b ec 13 26 d3 +42 12 c5 6c f4 ff fa 20 2f 57 b6 8e e8 cc a9 43 +f3 c1 38 c4 cd e3 3b df 2c 94 40 df 65 32 24 45 + +# Prime exponent 1: +ca 0c 9b 60 b8 e4 a6 06 67 56 c6 5d 20 88 41 9d +f6 25 3b 7b 68 8a 85 f4 f6 e9 64 d8 5d ad 52 a4 +52 62 86 7f 1e 96 18 06 9f cc d8 65 e9 28 9e 46 +e3 9e 20 22 94 4c 5c 44 87 d3 45 cf 25 2d 46 0d +97 7d 77 ed fe fe db cb ae 46 a2 3a f7 fa 47 0f +07 7d a0 e5 09 42 04 4c b1 a3 60 49 7c c2 76 0a +c0 f2 ad 4a 2f cd 0e 84 d7 a1 d9 4d fd d2 65 8f +d9 ce 18 47 5c 1f a7 5e e0 ce ba d0 cf 0a c0 4d + +# Prime exponent 2: +52 81 71 23 3c 4e 4a 6c 63 b8 67 64 f5 13 38 84 +6a fd db cb 29 58 34 4c 01 c4 00 4a 1d d8 28 14 +5a 1d 02 a1 50 7d ef 4f 58 24 7a 64 fc 10 c0 a2 +88 c1 ae 89 57 21 d7 8b 8f 04 4d b7 c0 0d 86 da +55 a9 b6 54 29 2e cd 76 82 70 be 69 e4 bd 59 22 +d4 ef fd 1f 70 95 5f 96 27 e3 e1 9b 74 9e 93 b4 +0e f3 dd 1d 61 d9 39 15 e2 b0 9d 93 0b 4b 17 68 +bf ac c0 13 6f 39 b0 cf df b4 d0 50 01 1e 2e 65 + +# Coefficient: +df 2e b2 32 2c c2 da ab f4 d1 46 55 08 f4 15 21 +cd a7 ce ff 23 eb e6 1d 00 d4 41 ee 72 8d da 5d +16 c7 bf 92 0c d9 5f 34 be b4 fe 32 ee 81 7e f3 +36 2e 0b cd 1d 12 45 f7 b0 77 93 ea a1 90 dc 5a +37 fd af 4c 68 e2 ca 13 97 2d 7f 51 48 b7 96 b6 +fb 6d 7a dd a0 7b d2 cd 13 be 98 ce be d1 ed c6 +ca 41 2e 39 53 50 c5 9a 1d 84 2b c4 aa 2f 3c 0b +24 3f de 7d fd 95 35 6f 24 39 25 1a 11 72 c4 5e + +# PKCS#1 v1.5 encryption of 20 random messages with random seeds +# --------------------------------------------------------------------------- + +# PKCS#1 v1.5 Encryption Example 15.1 +# ---------------------------------- + +# Message: +2a ac ec 86 f4 23 dd 92 5e c1 58 82 2a 74 8c be +6c 31 a0 + +# Seed: +cc 4b 87 f6 74 49 7b b0 e3 3d 9e 2a 4a 80 70 b7 +d7 8b 5f d2 c4 b4 f6 eb ac cd 4e e5 05 b7 1f ca +fe 21 56 33 7d df 27 b4 75 af 33 f6 c3 40 5b 8e +3c 0c 20 6e c2 81 29 22 fc d8 a3 66 1b 86 19 bb +c1 82 f8 07 f3 a1 07 2e 62 ca 2b f1 fa 8b 94 4e +58 a0 e2 03 db b7 53 f9 f1 b6 ef 62 7e be e5 98 +96 7b 38 7a 5f 96 36 d8 b6 41 b3 89 84 b1 ca 03 +7e 3a ae aa 17 10 f5 16 25 ea 85 f8 fb 9a 6e 02 +9e 64 57 58 14 d5 30 fc 14 6b 34 45 ac 42 01 b4 +e4 08 ad f6 55 f6 78 43 d8 87 1c ac e5 d9 06 d7 +fc 03 8f ea 88 5b 96 fb 8e b1 a7 21 c6 c1 4a bb +eb 78 fb 4c 79 8a 19 58 99 59 89 84 55 a3 16 84 +3c 6c d9 9e f5 8c 2b 0b 49 b8 ab 41 91 b4 02 a5 +4c 92 97 31 0c d2 24 b1 7f 21 41 67 72 5c 48 fc +c6 1b c4 7c fa cc f1 5e b3 b0 + +# Encryption: +60 42 e7 45 58 9a f0 3a f8 75 20 f9 3c 45 d8 c3 +59 85 ad a1 16 1a 37 d8 22 e9 f9 46 0f c7 5f cf +01 79 d8 49 1b 8f 5d 1e 4d e8 ce b3 1e 07 c4 86 +5c 5a 3e fd bb b6 9a 88 03 b8 9e e6 5a 43 0a 58 +09 c7 07 56 91 50 b5 80 bb 68 6a 94 c5 54 1c 46 +ad cd 82 79 60 ce 24 4f f6 88 38 7d 16 16 e8 5b +4d 17 80 c6 48 36 06 cf 92 4b 54 f0 80 cf 41 54 +e6 68 29 bf 6e 53 24 81 04 8e c4 1f ad c0 7d 75 +5b b3 4b b2 81 45 21 9c b3 0d 47 d0 d6 18 70 91 +80 e9 03 03 ff 9e f0 90 18 be d3 da 75 76 1d a7 +94 81 1f 96 bc 9e 8d 7c 4b a1 b5 94 6b da 0b d3 +13 fa ec 4c 99 3e d2 74 8e ed 8c ce 4b db 52 0b +a7 db 16 5f 9f e5 6a a8 45 4d 6f f3 38 74 fe ee +bf 29 de 2d f5 b7 f0 0a a1 d9 fb 07 3f c4 06 7b +58 dc 50 62 4e 12 7f 71 1d de 2c c2 cf da b4 91 +9c cf 28 c8 36 60 df c2 27 b0 f5 00 ec 1f 90 4f + +# PKCS#1 v1.5 Encryption Example 15.2 +# ---------------------------------- + +# Message: +5c 8b f2 ac ab 08 bf fe fa 64 80 95 2b 24 da a5 +01 9d 12 5f ee + +# Seed: +5e 16 30 70 ef dd b7 9f 47 64 f8 a8 1d 44 46 0b +5c 40 0b ec 70 37 52 29 20 f7 72 95 9f d4 cf 3a +ef 2f 14 45 4d cd 9e 86 25 12 ca 69 db 83 68 a4 +cd 8d 1a 44 da 59 5d 6b 43 93 91 c9 31 46 b1 23 +f1 86 08 3c 4b 64 47 bf 7e 20 81 51 46 ac 75 49 +ef b6 74 60 e8 ff 1b 2b ba 5c 95 a5 1e f8 13 d5 +dc 4e 6c 38 92 bc 4f 43 9c 99 11 7e d0 6c 14 a6 +c5 40 fd 4c 65 d1 95 d8 c6 1e a7 79 68 38 e5 a5 +df af 11 d0 71 3c 19 1e 8a 0b 80 80 f7 a7 7e 70 +3a b3 66 22 f1 c6 48 b7 65 43 5b 90 27 97 18 11 +b1 15 2d 97 2f b7 6a a8 92 05 03 3d 95 78 18 7a +e6 34 88 fd a3 c8 6b 2f 28 e7 79 ac 4c 89 cd 25 +20 17 d1 a9 95 8a 52 c5 b8 7e c1 bf 9c bd f7 de +0e 97 c5 8b a1 1b a3 a3 37 05 f3 f4 99 58 9a 3a +72 e2 c0 fc 5b 16 fc a2 + +# Encryption: +44 e6 71 e0 3b b6 67 80 ec 05 86 d5 6f 8f 6a 49 +41 5a d4 bb ce 22 6d 75 d7 0f 06 ce 29 de ea 7d +a1 af a8 28 7e 44 36 3c 51 0f 34 eb 8b f3 1c a2 +47 29 59 26 9c 18 df 09 36 ff 12 c6 16 6f 4f 45 +96 cb 1c ae c4 1d ed a8 c5 09 99 bf 4c 94 4d 21 +37 5b 36 75 31 91 b4 cb 7c aa 1b 43 e9 11 6c bf +1d a8 b2 01 d2 97 a4 d0 8b b0 e5 bd c8 95 32 70 +f7 c2 80 96 78 c4 4b ea 75 e8 1f ac 22 d2 71 06 +30 2b b6 9d a0 74 b6 ef a6 68 8c f8 35 c8 0b f5 +e4 55 35 28 ec e0 b7 c1 b7 7b 66 6e a3 45 23 ec +1f cb 3e 25 05 4e 0b b8 e4 ba 02 7e 5c 21 bf 7a +51 43 bf 04 1c e9 cc bc fa fa 87 80 82 fe 41 f7 +8c 70 bf 4e 53 cf 48 7c 1a ad b0 19 15 ce dd e8 +cd 9f b8 4e fd 98 1a c9 8c d5 7a 82 56 d4 e9 e2 +d0 86 2d ab 04 54 d3 ff 4f b9 85 26 4a 46 99 5a +b0 68 a7 4e dc 7e d8 ae ff 5f a3 0f 3a 7d 75 94 + +# PKCS#1 v1.5 Encryption Example 15.3 +# ---------------------------------- + +# Message: +e2 00 4b 31 07 39 98 2c fa 9e 95 45 3a + +# Seed: +e9 3e 64 12 33 7a b7 b0 f1 b5 69 80 1a 3c 16 4a +6f 23 e3 c2 7c 7c 55 a8 c5 ac 9e af 31 88 55 f8 +32 8b 5d 7a b4 cb 86 19 a0 0e 99 41 cc aa 94 85 +70 52 71 82 61 74 43 c1 d2 1e 4a 6e 21 b3 f6 d4 +f6 98 a6 1a e0 29 17 2c f4 da 03 9d 91 58 5a 87 +da d1 28 c2 fa c5 53 1b 2f 45 dc ef 9b 9f c3 31 +c8 04 48 85 28 84 7c 90 87 5d 19 07 5f ff b0 05 +76 3d 88 e0 81 47 66 92 28 a9 aa d0 16 25 bc 61 +11 2c c7 b7 72 f3 21 d4 33 d4 f2 69 78 20 9d 0e +79 67 6a f3 b8 a7 4b 97 3f 52 ab 91 90 85 f3 52 +35 5f 85 6a a4 0f fa bc e5 43 d4 e7 6d 45 48 92 +98 9c b3 83 f3 e6 6b bb 0e 8f ee bf f7 c6 a5 4e +f2 62 5f c4 05 0e 6f 87 a3 23 13 2a 4e 67 12 68 +fb 83 cf f2 d8 22 51 b7 9c be 32 da a8 e5 53 20 +2f e8 87 22 61 f6 0d 5b b5 11 f2 fa 2f 14 21 a3 + +# Encryption: +2b bf 6b 0c 5c f2 0e f2 f6 c5 a0 aa 48 45 4f 85 +0a a5 f6 bb eb 03 0d b4 e2 be c1 1f b2 00 f0 1e +4e ae f0 44 d8 14 33 33 33 8e 5e 66 38 00 87 66 +0e d0 17 3a 76 82 12 85 67 7e 37 1f 28 ec 45 00 +f4 d5 9f ab ab 20 73 e7 34 36 5f c6 b0 94 ee 0a +db ce ac cf e2 49 88 ce 61 5d 60 5f c3 40 8c 03 +be 22 1c 99 3f 61 aa 72 4f c8 71 4a 8a 4a 18 15 +f9 e9 a9 98 82 aa 46 88 3e 70 47 4e 33 29 b9 91 +e6 d5 3d c6 b5 00 86 19 92 34 3a 6d a8 9a 8b d6 +f3 7f 34 e5 de ee f8 0e 7d 56 b9 3a 45 17 60 66 +36 50 fa 45 5d 55 41 89 9a 76 aa d1 c6 27 5e c8 +2c 46 07 12 26 59 b5 08 cb 5d c0 26 ac f9 3f a0 +1a 5f ca 3d 81 c1 bb 20 a5 a5 cf 35 7a 23 c9 56 +88 ea 42 eb 1e f2 c9 d4 6a e3 7f 8c be 61 5c 20 +84 d9 89 b8 92 f0 16 7b 23 be 33 62 fa ce 80 8d +6a 5e b8 96 19 44 08 db 7c 01 63 9c 58 62 30 4c + +# PKCS#1 v1.5 Encryption Example 15.4 +# ---------------------------------- + +# Message: +db 6a f1 29 23 05 27 8c 5b 33 83 f8 a4 1d 6c 83 +52 21 14 c9 88 85 50 74 06 5b 23 f9 fe ae 8e a4 +31 fd 5d a3 6f 9b ab f9 dc 61 df 2e 39 23 47 83 +04 73 38 ec 4f + +# Seed: +cb 85 1f b2 76 a7 49 1c d3 ef e4 d3 39 50 16 c1 +ec 2b 15 09 4a 1e c6 d9 30 d4 ca 21 b4 20 f8 47 +ff 68 68 f0 14 d2 09 ff 80 7e 8b 1f 71 67 0b 32 +50 94 c0 f6 e3 2f 84 f7 68 22 22 02 b2 1b e3 6a +28 6b 30 e0 82 ef 3b ba 64 7c eb ee af e3 10 69 +44 18 d7 0a 67 9e b2 01 07 80 dd 0e 96 55 3c 43 +cb c6 d0 0e ac 22 aa 71 f2 48 21 c4 d6 c1 77 8e +78 6c d8 c7 bf 2c bb f2 14 e2 03 e2 ef 2f 33 35 +78 cf 1a 94 7e 27 e5 99 96 29 0c bc d6 ca 3f 8f +96 ba 67 e0 e3 41 30 cf df 86 ef 48 e6 7c 90 b8 +b7 2e 6f 42 55 01 7d a2 d1 f3 ae dd 7f b1 d9 de +42 ef c0 37 ab e6 61 6e bd a8 d0 b4 0b d7 80 cb +db 68 ce 54 31 8f da fd + +# Encryption: +c9 9a 9a b6 7c ad 0c 41 ec 84 7b c2 74 67 fd f5 +bf 61 ed 6d 04 c6 5f 7d 9d d8 bb 70 07 a8 a9 b8 +3a 3c 38 a9 cb 92 5e 3e 7b 3c 40 7d 64 66 93 15 +b3 54 49 e7 54 28 ae 96 19 14 b0 b9 10 23 e7 83 +19 1f 95 41 b6 78 65 97 1c 95 b0 be 18 93 1e b1 +c8 47 c2 6a 29 83 c0 58 4e b2 17 c9 9c 70 5f 5a +d8 cb b0 9f 99 b0 6b df 7b d1 26 28 ae 36 67 c1 +2c 72 27 d9 6f f9 c1 08 dc e3 22 51 06 f6 2f 9a +4a 3a 81 17 a9 92 f2 88 c3 b5 97 91 09 87 8f cd +59 c6 79 6b 19 98 48 2e a8 2f 30 1c 93 91 83 b2 +dd 47 88 04 48 67 8a cb a1 2d 7b c8 a5 52 eb 32 +76 34 e9 2d 0c dc f7 1e ff b6 66 ad 90 2d 9e 26 +ad 18 60 e2 92 81 d0 2f b0 c5 49 3b f7 4a c0 2c +94 40 43 6e 0d 75 32 28 92 77 7d 32 5e c8 45 2d +e7 58 cc 6a 5c bb 02 d3 41 f4 5c 9a c8 ed f1 50 +da d7 15 82 dc 77 95 8a 85 44 b0 b5 58 ee 2a 0b + +# PKCS#1 v1.5 Encryption Example 15.5 +# ---------------------------------- + +# Message: +e7 99 e4 eb c8 69 31 9e e2 25 80 + +# Seed: +3a 07 57 cb 49 a3 fe 6a e8 0d 37 42 06 8b 5c 80 +68 b8 c5 88 54 20 01 10 93 c2 20 99 ed aa db 49 +1f 22 6f 85 60 66 16 3a b5 10 5e 78 79 c7 49 1c +18 35 98 5d c4 94 21 0e f7 8b ad 48 16 d9 b6 94 +c9 c8 be 46 6a 4d 17 8a 7d de cb ce 53 65 40 0d +68 21 b6 e9 ae 0e 03 bb 69 ad c4 ec 73 4a fd cd +ea 6d c0 c4 85 96 c4 8b 27 35 ef 70 f3 73 4c 18 +6d 03 18 37 8d 2b f8 09 96 88 67 2f a3 85 91 da +4a e6 fc 11 2b 72 7e c8 19 84 df 7b 56 c9 84 4e +25 b0 fc d8 1d 2b e7 d1 8d 01 64 6a 6d 9f e2 25 +d3 69 7c 34 ed 2e 33 6c c0 37 3d aa 28 d8 82 e4 +97 75 7b 0a 65 10 86 2e ac 10 d3 b2 4a db 25 2f +30 d4 34 e3 0a 63 76 46 9d 80 b9 57 11 16 17 78 +df 35 88 9b 3a cf b1 f6 53 ea 63 07 2f 35 a3 c8 +9f 6b a5 2a fb bd c2 8f 23 d3 8f 4d 4e 79 fc 39 +7c 10 + +# Encryption: +3a 3e 72 5c 6e 4b b0 06 12 69 61 8c bb 8a 62 67 +d9 55 83 ab aa 03 d8 df 85 a4 f6 a5 cc 35 9b f1 +15 26 0d db 70 ae 7c 66 bb 8d 87 d6 33 1f f1 b0 +b5 4b e5 64 8e 83 e8 3a 91 c5 4c f3 71 49 6e e5 +ca 02 73 b1 9f 70 03 70 c2 c8 cd f4 28 13 38 a6 +e7 2f 66 32 41 68 ea 8c db c6 4c 60 9b a9 67 91 +c7 91 b5 ac 84 00 99 2a 8c 66 fb 09 f4 e3 13 07 +49 12 af 0c b7 41 5f b2 15 eb 97 fa eb be f1 a4 +47 23 9a 91 db 4a 34 fc a4 d8 43 46 25 9e e0 a1 +da dd 10 b7 f0 1f c8 c5 3e 42 0f 88 cd fa 0c bc +f6 2b e4 4b 8a 79 40 86 4f f8 13 7e db 12 2a c2 +da e5 41 0a 47 cf 07 62 e2 0f 20 86 cb f6 6f f4 +d1 a9 f7 27 0f 00 9c b2 e0 7d 90 20 b4 8a 76 d2 +41 08 e9 98 9b f9 04 e4 a7 1d db 91 74 0a d7 e5 +d1 b6 8e c6 4e 3e 66 cd 0e 89 7d cc 66 57 39 eb +ac 45 19 93 f0 2c c5 bf c6 3a 60 2f 55 83 81 da + +# PKCS#1 v1.5 Encryption Example 15.6 +# ---------------------------------- + +# Message: +09 97 12 b8 26 ba 67 cf 92 92 25 bd 61 2e c0 65 +d4 51 ed e2 31 c8 d5 c2 04 04 d4 70 e7 9a 7a 1f +24 6e 3e ec dc c7 5f 08 53 29 f8 f1 7b 81 d1 30 +30 0f c3 b9 f0 93 a2 + +# Seed: +81 cd 64 c8 4d 77 65 fc 60 e4 de 3b a9 b4 dd 21 +dd fb 74 fe 2d fb 7c f6 19 db a4 cb cc 17 6e d9 +4e 6f 37 ed 1a 97 e3 bf d3 63 65 d2 64 4d 3b 6e +e6 c7 71 09 fa 18 41 2e e7 cd dd 3b e8 d4 bd ee +94 c0 96 f0 72 ca b6 f1 88 6e 3a 84 a7 fd b5 af +f3 dd 83 f7 e5 c5 b4 9b b1 b3 8f 8f aa 75 25 31 +d8 9c 88 39 3e 9e b8 f5 7e dc 5b 9f e6 ed 2b c9 +5d 27 2c a9 95 f7 e2 59 b0 08 32 d9 8b 87 23 12 +cb ef 8a 04 8f 6e b7 91 97 84 ae d3 d3 1e b4 b1 +2f d8 07 60 a1 34 c9 d6 c3 34 c2 dd 3d fd f4 97 +5c f1 b5 1e 87 12 2b 97 33 33 44 96 08 ff bb 2c +f3 0a 02 bc 46 ea 24 7b 45 39 b1 86 07 bd 47 d3 +cd f0 87 72 14 ba + +# Encryption: +78 6b 3f 59 9d 1b 74 3e 23 58 26 24 fa 2c 94 a3 +6f b6 bd 33 fd dd 57 64 08 cc 85 4a d7 cf 66 7f +17 38 0a f2 0b 0b 73 0c 6b e9 8c 01 80 76 b9 b5 +04 1d af 2e eb 02 54 69 30 0a a4 36 43 35 be 26 +7d 33 b0 6b 4a 7a 79 7a 3c 0a a5 fd 3f 91 6a 55 +dc 27 4c 0a 24 87 f1 25 f9 da 82 59 6f 43 4c 7f +ba c7 ec e2 ef 6c 83 e0 34 8b f4 f2 c0 83 05 07 +55 b5 6a 9c 63 47 f3 9c 76 b0 e0 ee dc 61 54 10 +25 c2 3a a1 85 5c 0b 22 b4 46 fe 1e c5 f1 11 2c +5a 7f c2 85 ef dc 84 20 ec 01 a3 a7 c3 3f 73 5b +45 55 09 2a 9e 8d e1 6f 3f 7d 46 9f 88 cd 75 c0 +1c 7f 2e 7d 54 6a 1b 9e 7f 49 84 fa 29 a2 cc 80 +d3 10 f9 d7 81 8d f6 d9 ad 6c c2 05 37 4d 52 e8 +e1 73 90 bd e7 2f 25 b7 12 a4 26 9f 23 ae b2 41 +a6 66 e9 64 96 cd 84 b8 33 fb 53 d0 57 1f 7a c2 +d1 96 4b 8f 2a 7e 13 33 6d 9a 7e 03 04 1d cf cb + +# PKCS#1 v1.5 Encryption Example 15.7 +# ---------------------------------- + +# Message: +5f 2a 5c 7f 93 e7 14 ee ca b3 a5 5a 69 c7 9a 3c +bc 15 bd 19 df 27 98 9a 9b ab 59 fb be a9 ff cc +66 3b f8 e1 e7 40 7d c2 73 + +# Seed: +e0 19 60 82 6d 1a 69 f6 84 c9 c0 b8 5d 84 dc a5 +81 1c 89 a2 c0 74 2f 33 a2 ad 19 9f b6 57 a1 aa +98 13 60 1d 29 93 6a 43 d9 b9 eb 4d 32 89 cd 7d +37 06 ab 86 b4 d6 6a da a7 e0 a1 34 51 b2 ed b2 +bc 77 10 91 11 0c da dd 7e e2 e6 aa ea 2b 35 cf +ae 4c e3 b1 da 18 16 68 4c 89 c0 b3 fb 2f 87 79 +b2 5c e0 c1 2d 42 b1 d3 d3 0b 8f 20 be b8 99 91 +6e 4f d0 a1 58 86 37 19 2e 05 28 ce 6e a5 4c 8e +b7 54 fd 7f f0 03 25 81 a9 50 59 98 e6 9e 14 f0 +72 bf 95 df ef f0 14 df 99 ed 78 53 b9 82 e8 89 +41 29 a1 d2 7c 53 ea aa 23 4c 8d 14 a7 ff c5 f5 +e2 18 7c ef 79 eb f5 2b 3d 6c 06 65 89 5b fb 87 +e4 bd 61 0e 35 8f 35 26 da 05 92 c9 e5 02 b7 2b +76 e4 65 66 + +# Encryption: +77 d9 07 18 1c c3 b1 bb 19 81 e8 cb 22 f7 ad 75 +f8 82 e2 6a fd 28 1b 64 db 70 c8 4c 6a 50 fe 74 +24 9e 22 fb ee 90 e3 0d 0b 70 ae 2f 7e 12 ac dd +f6 78 f0 0d 22 7e 53 61 54 26 62 43 02 69 fe ea +34 12 47 92 af b3 f8 7b 30 f9 50 f4 ed f2 2c 44 +04 c9 68 8d ec 38 ea 0b 99 cb 3d c3 84 bd 88 fa +31 83 d7 e0 7a 20 54 d7 3e a5 1d 42 86 bb 39 da +e3 ae 6d 0b 96 51 f1 ea 48 8f 80 5f 2a 21 6e a2 +1a 56 76 b9 7d 1b 11 d3 b4 03 6c e1 67 fe f6 4e +0e ba 41 9a f6 73 98 3f c6 ee 01 c6 37 b1 64 e5 +aa ac c9 9a de e9 f4 7d 21 92 54 69 6c 8f ce ec +6c 74 ac 4e 39 05 1e 15 26 94 01 73 82 64 f0 ca +5b f1 22 c5 5c 9e 5d d8 47 b1 d5 77 4e 74 08 c3 +68 4a a9 74 b0 ba af 40 ed c2 2a 03 57 af 72 c8 +16 cf 73 1f cb 63 96 53 60 69 9f 26 99 97 b8 48 +0f 30 a6 b5 d5 7e 12 a5 cc 54 ec 0c 80 5f dc f6 + +# PKCS#1 v1.5 Encryption Example 15.8 +# ---------------------------------- + +# Message: +55 61 39 59 3e ee 8b 6e 87 + +# Seed: +2d e2 a5 72 24 f5 f5 b1 2e 22 3e b5 f8 2b 9f 47 +24 9d 25 55 93 79 13 6e af 18 e2 f6 c8 33 e3 f0 +1b de ea 9c 30 3b d9 67 7c 2a 85 71 7d 59 3a 28 +02 ae cb c6 b3 b7 1f 2c 79 03 ff 69 0e 3f 3c 49 +57 dd 74 cc 9c 2a 68 dc 1d 31 9c 1e 17 87 bb b7 +f0 e6 e5 1e 39 a5 ba db ba 9f d4 67 66 19 74 31 +2b 55 7a f1 89 52 54 9f 6e ba 9d f4 9f 70 ea b3 +68 9f 9f a8 fb ea 1c 97 e1 bb 2f 09 3e 6a ca 9c +38 0e dc 54 6a 19 c4 4f 91 f6 dc aa 28 9b d1 14 +fe a1 b0 36 f9 9b 1a 57 f8 61 43 d8 67 5b d0 7d +4d ea bc 9d 51 0c 61 70 99 44 9c cc ed 5c 45 07 +b7 9e 85 1e fe b1 8d 06 b1 99 81 0b b6 b3 cb e4 +12 73 ba a7 35 16 02 e5 f9 52 13 f9 69 55 ad 5f +dd 3a 20 52 db c7 5f cf 60 aa 22 47 f2 d4 e6 03 +da 45 37 0d e1 c1 da 68 7e 26 8e e4 46 67 f9 4d +ad 13 bc 9b + +# Encryption: +4a ce 54 a7 52 f5 56 e3 6e ab b1 19 48 95 84 12 +14 0c 80 c3 1b 61 dc 40 f8 1a 6b 12 17 a0 1c e0 +67 ab 37 f5 3d f4 c7 7d 9e a9 c2 d7 95 0c 8c d4 +97 00 b8 cd 24 d4 e7 8f 7f a3 46 29 62 cb fd e6 +d0 2f b0 e5 03 65 64 93 25 05 ae 1c 85 1a a6 d1 +d8 4e fd 04 d5 78 ad 68 27 3a 36 a8 ae 23 d1 45 +2f 94 a9 37 88 17 71 3e 76 4a 09 17 45 26 29 b5 +dc 75 b5 7b 0d 5e 6a 72 8c 83 69 11 72 d2 cd 95 +f8 ba d0 7d b4 68 eb f5 45 b7 f3 f2 c8 63 b6 e2 +0c 67 c4 76 9d ed 03 91 a3 36 f3 a5 d8 7e 24 fc +f9 1a af 77 4b ee 77 a7 89 a5 90 80 09 c7 a5 5e +ac 92 af 4c 3d 46 1e 7b 40 61 6c e8 06 19 4b fc +20 74 c3 f4 f1 35 59 70 0b 27 08 a0 b7 55 78 96 +70 a3 62 6a 14 63 88 11 bb 18 e1 5b 10 25 c3 b9 +be f1 11 17 6b c1 f2 46 9e a9 9a ad 20 86 05 73 +d6 c6 a1 fe 40 db 51 e3 6f e3 38 00 10 1b da 20 + +# PKCS#1 v1.5 Encryption Example 15.9 +# ---------------------------------- + +# Message: +9a 13 96 62 2d 06 6c 10 56 08 58 c2 c4 cd 5c 04 +44 9e 2b 95 50 c5 bc 92 93 76 1a 91 04 41 1d a1 +8a 57 d9 b6 a9 97 33 3c db ce 77 e9 fd be 6b b8 +31 + +# Seed: +f1 78 61 ac ff b2 4c ac ed 90 ba 38 aa 7e a0 f2 +e5 4e ea a6 2a e6 64 98 f3 c2 8f 99 6b ce e2 53 +be e8 19 9e 3e b8 0d 62 7f ee b6 e0 b3 94 90 ed +f7 6d 16 a2 a0 bc 20 09 32 52 a9 d7 f1 f9 38 8b +06 19 44 85 2a fb e7 3c e4 13 a3 fc a5 21 b9 47 +4e 67 81 29 46 4d 91 b8 2b ca a5 9f 56 ec fb 12 +4f 61 f5 04 67 13 01 05 b2 cb c6 94 3b 95 36 95 +cf cd 20 c9 b6 ef 53 f3 f2 10 33 1d 39 32 dc 01 +0c 73 59 29 09 6b 2e 68 ff 16 66 4b 0b 90 a0 fa +1b e4 60 57 85 92 b0 cb 4d 6c a4 5e a0 6b de 3e +8a 1e bf ef 70 d8 3e f7 9b 3a 74 db 06 0f c0 20 +3b 74 80 7f 40 70 01 f4 b4 d9 9e c5 15 8e 8e 7e +4b 10 2a 51 5d e9 5d 2b 70 fe 1f b4 + +# Encryption: +10 0e ce 63 45 25 d4 67 f6 d4 a6 b6 6e de 1c c2 +37 f6 1f b2 b6 70 23 a8 3d c4 56 b9 2c da 18 3e +d6 62 0f e5 7d 5a 67 33 2c 77 23 3a c1 e8 72 5b +36 f8 e1 b1 08 41 2c a6 fb 35 dc d4 d8 16 77 a2 +b3 0d 5e af 25 e0 b9 19 1b 38 f7 ee f8 3f 91 21 +a8 08 43 8c 92 ab 03 f5 20 80 7b c9 a8 94 70 5e +af 4e ed 06 68 23 a6 7a a2 a5 59 9c d9 5e 58 da +7c 09 48 36 d2 af eb a3 9d d0 09 a6 4a de 03 05 +33 76 f0 29 36 cf 3f 56 bf 64 c1 f3 bd c0 7c 45 +a9 5b 9f cd 93 96 cd 9a 8d 41 bc c5 64 24 93 7a +13 71 b3 84 7c 90 5b 9a b5 84 02 39 3d 40 46 e4 +a0 15 c1 47 08 f7 4c e7 79 0e ba 8a f7 92 07 24 +40 bc af b1 4c 0f 81 08 97 11 87 c8 0f 46 3a 1f +ff 25 86 46 ea 16 e5 1c 6e e3 61 b6 61 a1 4f 07 +cd 4f 5a 82 c7 09 f4 94 f1 df 0f 80 3b 6f 64 a7 +2f b9 c4 50 ff e2 68 fc ab 48 7d 4d 63 01 3e 41 + +# PKCS#1 v1.5 Encryption Example 15.10 +# ---------------------------------- + +# Message: +b3 82 4f b5 45 a8 3f 82 ef 82 23 11 82 84 c5 45 +6b ab 60 0a df 79 f5 07 33 b6 66 8f bc 51 5d a5 +96 31 62 a6 d7 d7 e9 6f f9 1a ff 12 eb 3e 93 11 +e2 21 e7 0b c0 + +# Seed: +b8 26 8e 4b ce 7e 53 f2 e8 be 98 b1 92 d6 3a d0 +65 44 a8 0d 6e 62 d6 32 48 6e 15 e5 75 ba 70 6e +3e 76 89 30 dc 8e 41 1f 8e eb 0b 6e 8f 06 06 29 +da 8a 24 23 68 e4 79 cc b3 31 69 70 70 b4 b3 52 +4e 69 16 92 76 ba b0 a9 45 14 cc d6 60 70 25 28 +ed 20 b5 d1 df 07 77 9a 62 c6 56 86 e7 d6 68 46 +6f fc 74 8e b3 43 44 ca 6f 30 5c da 3d c3 e8 f0 +1c 43 ea 91 79 da 46 21 47 f4 d3 ec 92 f8 88 b7 +ee aa 41 0e 12 c8 6d 89 42 c7 d0 12 f4 5c 61 ff +a6 e2 b7 8f 84 3e 9a 75 d9 67 32 14 d5 58 ca f0 +1b 45 f9 36 86 ee da 54 79 db 80 52 79 25 59 cc +23 6a 4a 1e e6 5d 3c a6 0e 09 a3 c1 84 d4 b3 95 +d7 0b 8e f8 8d 78 09 1a + +# Encryption: +c0 e9 8d 50 89 4a da 84 9f ce 89 83 f6 f8 95 74 +03 4d 6c f3 b8 35 2b fc 50 72 4a 70 3d d4 f4 2f +40 06 ae 00 8a d9 72 33 ce f6 f1 6c e1 b4 23 f5 +2c 6b 67 7e f0 05 13 1b a9 87 f9 8c 72 2f aa 49 +42 ec ce 2c 99 66 37 40 a1 a1 e9 81 20 fa ed 97 +fd 03 ff 36 fe 73 75 8e 70 df 17 f3 1f 1f 39 41 +81 2d 34 ca e6 c3 9d e7 87 ef 57 04 bc 39 c9 20 +ea 5b 0e b1 83 3e 83 b4 57 94 fd e0 ff 00 05 c6 +27 33 c7 0a 29 6c a0 bd 47 f0 65 50 3d dc e2 d6 +49 de 1c 32 8d df 60 32 a3 3f ad 46 ba 04 1d c0 +a9 94 bf 0f 56 a4 65 f1 62 5f cb 81 ce 01 fa 29 +9f c2 b3 c8 09 39 eb e6 a6 73 82 6e 2b 2f 12 ec +dd a5 03 5c 95 09 31 2d d1 9f 10 c3 5c 8a 8b 0d +a6 3c 08 51 97 00 6a 9b e2 36 10 8e b9 87 91 b2 +6e 28 08 b5 cc d5 ac ec 73 8b ca 02 5b 24 18 2e +f4 ab 9c cc b1 71 a6 9f b4 23 a4 6e 03 7a 4d 0a + +# PKCS#1 v1.5 Encryption Example 15.11 +# ---------------------------------- + +# Message: +a3 a7 da 1b ed b2 ca 99 fc de b7 a4 6d 63 3e ca +35 06 2d f2 89 6b 69 59 07 a7 f9 71 d2 cc 50 b6 +e3 d2 a3 67 d1 6e 72 7f 56 97 c0 + +# Seed: +f0 18 a9 b1 3f be 56 0b fe 95 52 ed 8a 86 06 be +ea 90 05 5e d3 f6 2b b2 af 07 f6 92 cb 60 ac fb +6d 59 07 d6 0e 0a 59 7a 54 ca ea f8 44 91 1c dc +87 4f af 95 69 53 a2 7d 30 0e 9b 71 5b 10 4d f3 +c2 32 c3 c9 63 82 cf 5b 5f 3d 07 b2 30 b5 25 bb +33 0e 31 9d 1a 7c 82 d1 53 af 81 7e f1 1c f7 2e +76 dd 50 b0 d7 e5 56 22 65 c8 34 5d a8 29 f5 60 +d6 a5 4e 6f 1e 28 8a 3d c2 17 6d 19 a6 8a 0b 1c +5c 92 b1 6b 8b b2 9e 4d 01 df bd 0b 18 07 9b d4 +0c fc d5 23 35 b3 a1 8b c4 ee 92 44 76 0e b4 94 +f5 be 5b 19 71 88 6c a2 be ec e0 a3 94 4f ff 8b +e6 b4 2d 96 e1 c2 c7 2e 4e 90 f8 7e d1 36 15 46 +7c fc 91 c2 6e b3 8a 7a f9 f5 66 86 93 1a 47 26 +da 04 + +# Encryption: +25 17 7b fe 12 61 9b 44 f4 a4 fe 7c b7 6d e9 3d +4e d4 a0 5a 31 e5 be 8c c4 e5 60 66 1d e9 a3 4a +e3 17 cc 02 ff 63 10 67 08 32 8b d3 f7 87 63 ab +3e 57 65 2c 63 f1 05 f7 97 1d 2d 8d 70 1e 62 97 +a7 9c 78 7b 7c cd 62 a5 3b 39 d9 c0 39 46 e6 6f +48 8a 92 e8 e1 7d c6 ec b0 f6 5b f0 1e 3a ff ee +99 76 87 31 1b e0 e9 45 ad d6 3f a3 f4 00 38 2c +b8 ff d8 91 57 54 01 8c c7 5e 82 82 26 b5 03 9c +d9 c5 7f c6 d9 9c be 8e a4 a3 d2 9c bd 09 d5 4d +95 cc 07 34 c2 35 44 f8 e1 fb c7 49 3e 06 d1 6c +0a 0a c1 53 0d 21 f0 33 7e 26 2f d9 d2 7f cc 4a +fe b5 74 d6 68 66 d4 ca 84 cf d6 e0 af 2b b9 77 +a5 d9 9a 5b 0b 37 44 04 2d 33 2b 93 6b bd d8 69 +e5 f2 c8 83 b4 00 ac 8b c0 68 3e 67 90 63 42 9d +98 d4 94 f3 18 04 d6 5b b3 c9 74 aa 72 e6 65 7d +4c 16 38 c6 79 c8 1a 16 45 3f 6b 0b aa 3f 05 17 + +# PKCS#1 v1.5 Encryption Example 15.12 +# ---------------------------------- + +# Message: +49 f6 f8 a4 a8 6a 8a a0 97 63 aa c8 55 72 b0 e7 +ee 77 6a ef f8 a8 29 00 07 76 ff a6 + +# Seed: +6d b6 a8 27 ac 2a 5e 06 16 c0 f4 43 b2 34 58 e1 +75 ac f9 a3 b2 55 f5 c8 52 5e 72 53 42 4f aa 91 +38 05 4c 3d ba a4 71 f2 7f e8 55 c1 c0 ce c3 62 +59 7a 1a 1e 6e b4 f2 98 ac 3e b7 34 d3 1f f0 ef +10 08 c0 e0 2b 9b 06 e2 93 15 fc 09 4a 7e d2 6b +11 ea 55 27 0a 3d cb 67 06 f4 6a 94 50 bf 83 12 +88 10 65 13 02 48 d2 64 47 66 a7 99 66 ef da db +aa f5 75 ef 4d d3 5a 93 7f f0 bf bf 3d 95 61 c7 +54 40 9b e7 b8 84 7a 60 8d 79 1f b9 87 ee d4 6a +fe b0 db 1c a9 75 c0 5f 61 57 0d d0 70 98 5f 13 +e4 e0 ed 7a 8c b3 91 ce 4d 42 08 32 b4 5a 8b 7e +9f 90 88 4e 61 18 98 f4 72 a0 ac 46 c5 7a a7 f8 +46 8a a1 9d 9c 7b 31 2f 13 43 22 99 03 93 88 1d +32 aa 14 68 f6 e5 f8 eb 85 a2 c3 c2 da ed 92 b9 +3c + +# Encryption: +0f f9 5f 4a 2a 07 18 d6 73 f9 20 2c 80 9f 10 45 +10 1f 52 b9 db a7 72 88 fe 28 8c b2 77 c4 db aa +35 db 93 27 ec ee c3 76 5a e0 33 e0 b6 b7 77 b2 +2c a6 be 66 20 03 ea fa 2b fb da 60 6f d8 ce e7 +ee e0 6c 6a 00 c9 45 a6 55 6c 60 b0 08 69 f9 99 +97 1a 8c 57 af e1 dd ee 7a 75 77 04 7a 0d b9 0f +62 cd 24 7a 88 7f 32 27 ef 6d a9 07 a7 5b cf f1 +9a a3 0c 90 8f 58 35 ef 10 10 0a dc 7f 6a d6 fb +31 99 79 0b 3f 4d 6a d1 9a 0d f5 02 7f db 8f 84 +66 04 e0 2d af 33 55 d9 56 40 77 79 af 15 5a cf +a5 a3 2e 6d 61 74 dc 90 13 1d bd 7a be 58 5d d7 +59 fa 3c b7 e9 f7 21 45 3f 3e 35 4f e7 be 0b 11 +8e f5 b8 79 42 b5 fe d4 c3 0d 7a 08 fe 24 64 eb +79 a3 de ba b3 7b 6d 3a 0a b3 15 77 de 7e 93 22 +9b 49 d1 e8 fd 56 32 d0 26 d8 3e e0 6a a7 85 34 +ce e3 08 1b 22 2e c4 cd 94 88 cc de 4e 15 29 05 + +# PKCS#1 v1.5 Encryption Example 15.13 +# ---------------------------------- + +# Message: +12 97 5d b7 3d + +# Seed: +6a 4b 4f b8 05 80 72 72 96 5b ff 2f 4c 80 0f 96 +4f a3 ae b9 fb 43 3b 40 c8 ac c5 98 b4 84 02 98 +93 a2 19 c9 53 21 34 c0 6a c8 42 5c 28 a5 f0 63 +c2 84 20 0a 04 56 43 48 97 16 51 6a 98 7b f8 1b +a1 86 f4 ce b8 d8 d9 dc 1d 73 f2 26 7f d1 98 8d +6a 2f fd 68 cd 36 69 de 2b 04 70 09 43 d0 d4 44 +ae 3d a8 f0 59 4e 62 61 e5 ff f6 07 f0 4d f3 1e +3d 9c 91 22 d7 6f b9 0f 3f 82 c3 93 25 3b 75 20 +16 5b d1 f3 19 ab 3b 87 5e cc 6a b3 ed 02 47 d0 +37 70 f8 d6 47 1d 69 cd 13 ee 25 7c 1f c8 b3 0f +19 b9 3f e4 f2 fc 9c 21 49 28 13 d1 fc 85 2a f7 +0c dc 63 84 d2 ae 55 b9 1e 39 ae 6c 3b 19 fd 1a +7d ea f7 18 c0 5d 57 80 95 96 a2 88 fc 9a ef b8 +15 ae a2 9f af 67 83 c0 05 35 fd 71 d6 25 49 40 +b7 62 f5 07 26 1f 20 9b c8 ba 94 79 bb 3f 5d 64 +64 23 19 cc 31 86 85 9c + +# Encryption: +27 15 d6 eb 53 ae e6 d4 bd dd 3b e9 b6 63 14 4a +41 0d 03 81 77 9f 79 9d ca 88 07 92 ab 43 1a f9 +98 9d eb 17 36 9d c6 74 38 ad d8 2b df 0a 59 dd +3b c2 78 01 02 58 c7 df 87 69 84 ff 52 76 78 bf +9b 34 c0 77 43 b5 d2 2f 4f 30 cb 5d 7d 8a 6c fd +50 58 24 f2 e0 94 02 4f b0 43 30 f6 6d a7 cb c0 +1d 5e cc 8d fc a1 ca 9e 50 91 b9 d9 c8 e3 8d 0a +c3 93 1d e5 d1 fd c8 33 73 84 82 a7 fd 15 2c 1d +24 e6 9e a0 1d d3 e1 fa 77 23 54 a6 07 d6 2c 60 +b5 61 dc 5c cb 01 2b 71 2f 5c 2d a1 89 2c 31 20 +ef 99 0d 74 61 1d dd 35 66 af 1a cd 8b 48 50 06 +1c 91 28 f8 2a d1 12 da 9f 68 ac 88 39 3f 9a 5c +2c 10 20 aa 77 e9 b6 2e 2d 1e 98 5f ef 86 4c c1 +ae b4 51 ac 83 9c 72 0c b9 73 e7 b5 df 24 a9 8c +cb 6e 67 72 66 29 a3 66 fe a3 f9 a9 52 1d aa 19 +b0 44 30 e8 10 f2 c4 5a 57 d4 25 3b ed b9 1d a0 + +# PKCS#1 v1.5 Encryption Example 15.14 +# ---------------------------------- + +# Message: +8d e0 f5 a4 13 a7 f7 86 39 6f 09 a4 5e 5e 77 4f +3c 60 9c e6 f1 b4 90 dd e2 22 b3 22 d5 34 0e 9b +10 55 81 f4 c5 be 44 ea bb 3d 1b 23 f8 45 + +# Seed: +f8 71 a8 97 ae e8 45 c3 bb 82 69 90 b7 31 d2 77 +7c f4 76 b5 cf c5 59 6d f3 a5 23 ba 69 79 c7 a4 +51 79 da 5f d6 0f 81 0b f4 14 c5 4e 18 2f 26 01 +72 0f fe 8a 50 d7 d9 d1 1e 56 43 18 e9 02 6f 07 +c5 aa a1 3e f8 91 28 3a 96 63 c1 e3 d2 7b 93 81 +7d 01 a5 6f ce 33 d5 16 9b fe a6 2a 8e e6 c3 70 +a3 aa 8c 71 94 d9 d3 53 d0 98 16 61 fe 85 81 62 +50 e0 32 4e ae 1b 84 7f c7 32 91 91 60 d0 1e 11 +92 ac 16 be 0e b8 e9 95 e4 86 40 27 6a 2d b7 b8 +7f 84 b3 fa c0 4c e8 62 f0 22 38 62 3f 62 b9 2a +2e 32 7b 01 b8 c7 b9 e5 ec 87 05 5c 6c b7 b5 56 +51 ab 5a c9 89 83 3b 03 4f 8b e0 11 6f 28 b1 e8 +86 a2 ce d1 23 29 8e b0 04 07 5a 6b 5b 71 b1 + +# Encryption: +d3 67 ac a8 d4 f1 74 14 e9 bf 09 ad 81 1d 78 db +0e 85 0c 45 c8 f9 d7 02 44 75 d3 e5 6e 3c bf be +6e e8 ab bf d7 74 58 26 41 7c c8 ed 52 f5 4e 00 +a9 2f 81 7e f9 83 e9 8d 10 0a 1f 99 0d b1 e2 90 +a8 51 6d 60 9b b3 2e 50 2a 77 e1 1f 76 20 0b 00 +25 76 5e 9b d2 85 9b a9 4a 69 63 33 a5 eb e2 eb +25 ba 9d 19 00 7f 64 36 0c c0 75 ca d7 f0 99 50 +e4 b7 af cb ac 36 e6 ec b0 17 cf 4a 1f 25 a4 d2 +b9 51 bb 85 e8 1c b2 b4 eb 6f 45 cd d4 00 d2 ac +4e 21 69 89 6d 94 15 82 44 9c e3 0f 69 c1 7c b4 +49 32 1f 65 e4 4d f3 03 87 86 27 62 13 51 f5 2e +5a 07 52 e3 b5 eb 12 63 61 69 7f 53 cf 24 66 16 +5c 3f bd 66 2b 83 75 80 b7 6d 45 9f f0 44 97 e5 +fe 1b 3c d1 8c 4d 58 ff ed ab dd 04 a8 c1 08 d8 +59 b6 52 98 63 9c 3a f8 0c d9 4e 23 87 a8 69 44 +09 ef 9e 0b 78 b6 f4 67 39 0b e1 08 57 9c 9b 2c + +# PKCS#1 v1.5 Encryption Example 15.15 +# ---------------------------------- + +# Message: +9e 78 c8 2b fd 0f 23 d3 91 e7 60 01 64 01 9a ad +28 f5 9b 14 15 44 04 d9 e9 66 13 3c 10 3f c3 7c + +# Seed: +bb 42 24 7d b2 40 ba ca cb cb e8 c6 8c b0 f7 0e +46 0a 49 73 da e6 56 99 35 8f ef 82 70 d6 5c 3d +0c 45 5a 37 9c 56 3c 59 7b 28 f4 ff a0 70 e0 ec +1e bb 9e d4 27 fe 89 ab cd 47 93 c4 22 c3 38 87 +8c 8b 14 5b 46 c4 f7 13 78 a0 fd 7d 50 53 b8 67 +98 bc 02 d9 32 93 fe d8 47 f1 8f e0 61 59 07 4a +c1 89 d9 56 23 20 74 db 6d dc f9 94 1a 70 f2 8b +60 e4 83 39 5a 2d 21 01 54 b6 2a ba b8 75 0f 5a +eb f1 ac ef e2 05 6f 5a bd 2f 0e 0e c4 94 af a8 +2f c5 9b b3 57 f1 16 a9 4e c1 cd 06 03 b5 2f e5 +6d 31 a4 3b 87 aa 63 77 88 c7 24 cb 6f 88 37 3c +92 f6 07 11 bf 3f 35 94 e2 3d ee 2f ec ed fe 6f +5f c8 86 e9 6a ee 7c 74 68 22 e5 6c ba 7e bd aa +2a 92 10 ea 81 98 e4 c2 2d e9 29 89 45 + +# Encryption: +81 8d cb ba 98 c3 46 79 3c 79 d4 bb 78 5a a6 40 +19 1b 05 f8 83 5f f7 39 74 44 3b ce 35 7a 26 9d +44 64 6e 8c 79 10 2d ce 22 92 39 78 a3 94 1e bc +b9 90 4f c1 bb 1f b4 3f 11 27 5e 71 eb 7a 84 d2 +74 be 10 4b 00 af 92 25 e2 a4 f7 f5 a0 48 ab b6 +6c ba b6 52 5d 1b 11 5d a8 c0 bb 08 de ea ec 7f +80 eb 6c 39 50 4d c4 eb 38 15 4c e4 b6 91 b4 06 +93 19 b2 93 c2 5d c3 0b 8f b3 8b ca 15 3e 2f a6 +1b 33 76 dd c3 c5 3a 57 93 21 d9 10 a1 71 fc 42 +aa f1 70 50 ed 6d 31 1a 7d f5 b9 a5 cf 3a 98 fd +69 aa 85 ac 23 46 c1 6f a0 3b 1e 53 d1 03 d6 f5 +a0 4b 0d 9d 3f 18 83 53 1e 2f 63 41 fd 91 bd 63 +a5 aa 99 3b 6e db 99 92 e5 db 17 a7 be 55 5e af +a3 bb ab 32 08 6e 92 b8 b7 91 06 69 68 e0 0f 8a +17 71 61 44 0c e5 38 57 97 89 c2 91 2e bd 7a d0 +19 be 29 37 6c ad ee c2 99 21 07 c9 db 07 60 49 + +# PKCS#1 v1.5 Encryption Example 15.16 +# ---------------------------------- + +# Message: +6d 72 08 b2 ff b0 1a d2 36 0c 46 09 f3 ba d3 15 +79 c8 d4 00 5c c9 60 14 2e 2b 69 6b 26 e9 4f 2d +99 98 0b ad 38 41 05 b1 89 95 57 af 89 05 25 + +# Seed: +72 ae 49 97 18 28 ba 54 23 ab 96 3c db 18 f4 bd +fd bc 74 73 cf 70 fb 77 21 34 41 f1 d4 46 ae 48 +10 93 03 a2 60 c0 91 ab 51 99 d9 64 e6 21 63 c2 +46 57 24 71 73 cb 05 11 b9 cb b1 63 45 9c 95 6f +9c 0b 18 83 b6 91 b5 e4 ea e0 4f 0a f2 4e a3 28 +c6 de 88 2c eb c4 f8 9a 56 37 32 82 d6 0a f2 ba +96 7e 25 7a c4 01 a3 7f 94 41 c1 1f 2e 0e 42 1b +2d 15 1e b2 43 a9 7e ae 5a aa 86 cd 38 df 43 c2 +6a 1d 6e 3b 12 c1 3f a3 59 7b 85 bb aa 13 09 45 +2c 7e 9b 32 5d 8c 73 fa 79 9c 57 56 52 73 7b 92 +a2 47 d2 3c 4c 70 12 40 c5 3d cf e2 ea 69 7a f6 +1c 07 2f a7 6b db 05 2a 58 c9 19 e6 9e c5 7b 39 +a2 a6 c4 7d 77 0e de 67 10 fc 7b dd e6 01 + +# Encryption: +4b 56 dc d3 04 bd c7 f0 cc b7 0d 2c 58 6f 52 74 +60 1e e6 05 36 bb 21 80 61 67 13 50 d6 d3 ae 2e +28 4f 07 b5 ed 63 01 79 26 94 13 12 2b 98 37 60 +90 f7 a4 a4 f6 43 4a f7 3a c4 0c 7a f4 b6 d7 a3 +e3 14 70 2a b9 b8 5e 08 73 1d a0 d1 2e d3 f0 07 +0b 0d 20 95 05 3b 3f 0d 09 d6 c2 cd 8f 98 ba de +d9 11 48 c3 5b 7b 33 c5 43 65 3c cc 32 d8 36 f5 +f7 f2 ee 39 ca bd 0b d8 9d d9 a4 a9 4e 91 2b 4c +a9 7f 18 51 d0 17 45 1f 60 96 ac bf 20 a6 5e c5 +a2 9f 08 f8 13 5c 73 18 a2 21 6d 1b 7d 10 37 95 +c7 ec 8e e5 7a 79 28 0f 9a 84 4b d6 ab 71 28 82 +0e 1f b5 e8 25 54 fe c0 2a 78 aa 8d 3f d6 a1 3e +0f ad 0e ce e7 ab 61 1d e4 b0 a0 48 1f 42 b8 d0 +b5 5c b8 81 3d 1c a6 e2 61 5c f5 ae 8a e8 6d 0b +5d 46 95 50 75 49 f7 a3 73 66 a4 45 fb 55 b7 c4 +b6 b5 8e a6 99 db e5 dd c8 19 3e 2b f3 d5 b8 40 + +# PKCS#1 v1.5 Encryption Example 15.17 +# ---------------------------------- + +# Message: +7d eb 6d 40 41 48 23 2c 48 21 63 4d 3d f9 bc + +# Seed: +e6 f8 3c 8c 99 3e 60 15 af 43 04 09 68 4e 62 7f +3d 9b 84 ad 05 55 c6 a6 c0 91 13 a7 12 47 2a bb +36 f6 11 92 32 6c f8 40 82 aa bd 1e c9 5f 4d 1a +92 d9 10 7e 30 61 0c 8d 27 59 55 6d 5d 61 47 5c +a3 f3 cb d9 49 fa c2 20 3c 42 3d 56 c2 75 58 e6 +11 8f aa 0f 6f 68 4a da 13 c3 15 3f 6d 25 53 38 +bf f7 34 e9 5f 60 ad 29 19 ab f2 88 15 d3 cc 0b +1e fd 38 5d 0d 45 81 b0 ee 84 94 f2 bb e2 99 59 +91 ac 1e a8 15 40 cb 7e 88 56 68 e5 a5 2e ca 90 +57 ed 9a 1f b2 3f df 83 b5 75 51 35 8c 23 cd 43 +ce 0e 7a 33 c7 25 66 b8 8f e5 93 43 f1 87 24 46 +d3 2c 44 b3 99 0a a4 db 3e e5 93 42 4c 8e 09 46 +d2 61 e3 27 0e f4 07 6b b3 5d f3 c3 c6 da 4b be +42 3f 59 1b 5c 93 ba 56 c5 cf 01 d4 f0 a9 40 96 +71 09 d3 9b 93 9d f2 82 53 2e 54 83 10 8b + +# Encryption: +aa 6e 6e 4a f6 89 26 4d 61 bf a8 f5 08 6d 82 79 +dd c2 28 9c 55 41 af 45 35 19 c4 4b 95 ea e6 a1 +5e 7e 7b d1 5f d3 1a 4f ad 5f 7c 85 90 5e fc a2 +26 93 0d 67 da f5 58 b7 15 b2 1f 36 28 f6 1a 3b +04 2c 1a 38 f9 af 3a da 82 ec 44 88 c8 ad e5 f1 +da 81 e1 a8 ab 90 e1 b3 12 dc da 83 5f 9e 92 5f +2e 72 46 3f a8 33 a0 8b 93 25 3f df e8 cf 4e 5f +3c fa 91 10 77 19 a6 a9 46 9a cd 71 25 ae 67 b2 +bd 75 85 7c 59 be 0a be 98 40 74 e2 95 47 8a f2 +74 0e 25 89 4e 56 a6 25 0e f7 36 21 94 13 81 03 +74 3c a9 54 47 33 d2 50 55 71 be e0 0f 17 8a 2c +fa 38 e1 f8 f2 2f b2 39 30 d6 a7 5d d1 7c 68 9a +47 6d 87 15 31 85 95 10 8f cc e8 95 e3 44 9e ca +97 a7 dd ba e3 e6 d6 f0 e3 5e 66 6d 6f bd 78 78 +48 f8 68 13 37 b1 d4 c5 23 8b 1c 24 de 77 a7 e6 +75 e7 ae d8 dc 13 dd 9e b1 06 87 98 51 7c 0b 6e + +# PKCS#1 v1.5 Encryption Example 15.18 +# ---------------------------------- + +# Message: +03 1f c3 a3 ea a4 2b 0d 9f 6d 7d d5 99 3d 61 89 +cb b2 e0 e9 6f aa 33 d6 1f 31 7b 6b 3c 00 + +# Seed: +16 ab 64 85 ca c0 39 71 14 88 0e 6f 72 bc 1f 1e +f3 4b a2 7d 1c 43 3d 77 f3 37 2b 1f d5 b2 1b a5 +7a 50 5c d8 f3 5b 75 24 2c f1 b7 6d 38 1c 68 34 +24 01 ee ef c8 42 53 a2 de 1a 19 13 e4 38 77 3b +7b cb 31 cb ab 25 8f 72 6a c9 34 a8 71 26 96 9a +db 7f 76 8c 1b ab 87 54 a1 3a 3c cb ba 6f 3d d8 +d0 ec 6a 7c 6d 68 7d 04 95 b6 e2 2c 9a e7 67 af +c9 d9 4f 2e 45 a1 06 13 3c 42 c7 9b 52 c2 6a d4 +b6 7b d8 ec e5 5e 84 32 5c a6 f4 9c 8e 95 31 f5 +f6 b9 ca c3 5c 93 3e eb e3 b9 a1 1b 9b b1 c9 ea +8c e6 d2 28 5d a9 08 e5 91 97 82 b5 b3 08 fe 47 +8d 98 e4 9a ea 54 3b f8 ca 1b 22 ed f4 3f db f6 +af 31 cc 8c d4 fb 7d e2 d8 19 af a5 48 3e ac dd +56 d7 78 7b c8 bb 16 22 38 40 49 bc 30 9a 66 + +# Encryption: +61 c7 54 76 30 43 b5 84 e4 a8 54 6b 79 f0 a3 e2 +e0 f3 b3 e2 db 6c 94 ad 81 7e 92 81 f4 85 c0 82 +08 fe d4 f4 d7 d0 a7 8c 6c 31 1a 07 c7 5b 9b be +85 04 f4 b7 a6 92 99 02 16 de 12 58 5c 00 9a e5 +8c 26 f0 85 07 1f 39 5e 5a f8 92 5f 39 33 f6 d9 +f4 12 d4 25 54 64 54 e8 00 b7 e3 aa c7 8b 7a 08 +b9 2e 79 8b b8 34 eb ea dc 4b 4a 63 56 af 1c a0 +9b f5 86 74 5f 61 6d 51 74 8c c7 a3 7b 48 cb 10 +97 7e 30 3b be 10 bf 27 c6 9b df f0 ba 5c ab 8f +62 d0 58 7a 09 d6 e0 22 82 32 33 c8 c7 aa 41 87 +22 23 ed 15 a7 4a cc b0 f1 f8 22 f2 4d 75 94 ed +99 25 a1 c6 c0 c0 f9 ad 0e 07 1e b6 b5 eb e1 ba +b6 ba 3b 6d 99 a3 16 52 04 7f 46 92 60 be e8 71 +0e 37 0f 04 ed 70 75 93 93 7a 08 dd 82 26 49 92 +31 1f 4a f9 88 4c f8 ad 34 af b9 f6 75 99 3c 8a +bf 41 51 98 39 f7 6f a1 e9 31 bd ae 1d 08 a6 34 + +# PKCS#1 v1.5 Encryption Example 15.19 +# ---------------------------------- + +# Message: +c9 c9 3a fe a9 97 b1 ee 36 fa 72 72 03 54 c7 04 +64 9b c6 ef 44 f5 18 7c 6c 28 54 2b 9a e9 55 a7 +19 3f ff ec 86 7b b6 2e 21 9e 68 + +# Seed: +52 d4 c3 bf 0c 77 2c 02 d3 bb 71 1d 7f 14 6d 8c +49 76 f8 30 81 be 49 53 d4 af eb 07 8e 54 12 a3 +2c 3d c7 37 b5 9b c4 54 c3 de 93 a1 ae d0 7c 1b +a6 4d 1d e4 36 80 14 d0 4f 64 40 55 6a 4a 16 97 +9d 08 03 cc 29 22 da 97 ed 67 61 90 12 f8 f7 d3 +b1 a4 55 84 b0 94 6a f6 db d4 a0 85 7d 4c 2d b9 +9a 17 bb d2 7a cd 9a 62 e6 7f 88 79 db ef 27 f1 +04 6a 86 7e 69 95 16 2b 2a 1a 1c cc dc ea f4 5b +e1 33 7e 5f a8 f8 5e da ad f7 50 8d 58 f3 26 aa +7c f3 01 f4 41 ba 55 8b 60 e0 fa c6 e0 d1 99 20 +61 a0 a4 69 be 02 16 26 89 0e e8 7e 68 13 9b d5 +19 ae 77 3e 3e c4 81 b7 f2 b3 77 33 1f 52 f2 e3 +86 88 4f 76 57 23 e2 6c d4 a8 d9 68 61 4c 9c 33 +dc db + +# Encryption: +d0 68 67 02 2a 0f af 57 3d 62 cc 24 a6 e0 6a 44 +cd 3d 83 ea c5 d0 80 9e bf 91 30 45 68 cb 1b 27 +56 1b b2 92 e8 77 6e 21 6d 1d 02 3e 75 3c 12 4b +51 86 7b 94 dc 60 89 4d 62 c7 da e5 fa 1a 9f af +03 76 e1 75 8c b6 ad c7 14 17 e8 31 02 52 8f 23 +f4 c5 e5 b5 03 62 a3 9e 2a a9 76 8b 10 62 08 6f +a8 c5 3f f1 c3 9a 0e e0 3d 38 3d 24 bf 49 07 22 +b7 86 da ec 90 8c d7 15 1e 18 5d dd 17 88 26 78 +02 7e 36 8b 05 12 cf 98 41 3f 3e 59 6f a3 db 4e +c1 96 ae 5f f5 24 a8 26 6d 76 0e 00 51 43 3d 18 +98 ff c2 30 e9 6a 2f 0b fd f2 b2 44 29 ad fa 91 +8a ba 1a 45 0f 76 78 34 72 30 12 93 84 8b d8 2d +5a 33 84 31 d6 cb 1c 10 6d c7 41 d2 34 bf 5a 80 +db d3 25 da 64 a3 94 a0 06 5f 22 02 8d 0f dc 5a +df 0d 0d e2 9f 22 fb 8c 2a 41 33 1f e1 fc b6 15 +89 e0 ec 75 00 ed 84 42 d6 18 46 df 6c ca 46 cc + +# PKCS#1 v1.5 Encryption Example 15.20 +# ---------------------------------- + +# Message: +69 b7 64 48 55 f9 1d 1c 61 c8 49 8e 4b a1 ba 4d +84 5b a8 82 b1 73 + +# Seed: +b2 2f c7 de 85 c5 f7 5a 2f 32 af 1b fb cd 57 89 +71 56 87 de 06 e6 6d 06 4a e3 eb 8d fb 07 a2 57 +5b e0 e9 e6 f2 9f 50 d7 39 6d 07 8b 36 ef 80 2f +75 1a 77 cc 92 d7 61 4c 91 dd 27 99 31 fc e0 07 +eb f9 15 a0 f1 4e 31 2c e9 1f e5 aa 6f b3 74 51 +61 4f e3 7c 73 fc 6f 6d 6f 8e 52 78 9b 5d 88 e8 +6b eb 16 33 f5 dd d5 c0 70 f1 4f d3 cf ee 97 dd +4a 64 3d 35 d4 5d d9 bf 34 df 8c 31 0b 48 59 2e +94 68 31 b3 4e f3 c0 b9 16 f1 7c b0 ac b2 cf c1 +c2 5d 03 09 ac c1 12 4f 26 5c 1a 83 ed 88 5c 87 +fa 82 6f da 57 10 b5 4e 16 ec 0f 44 8c db 7e e0 +58 0f f7 38 65 30 ea 46 1e 04 2a 0b 77 42 c4 61 +97 6b b5 a3 80 ad bc b0 01 06 f2 67 1b 6c ce 4f +72 67 75 2f 80 66 80 42 78 35 0b 01 75 3e 31 b3 +8e cc fb e9 05 69 f6 + +# Encryption: +ab 42 67 97 2c 77 96 83 93 88 d4 ad 87 de d7 4b +b6 53 e9 a7 05 0e 28 2e 82 19 28 75 68 9f 70 ee +1d a1 8a 1f 73 22 09 2c d2 9f d0 01 19 92 2a 6d +e1 26 01 98 0a a9 fa 6e 61 9e 27 75 e8 7a da e3 +16 95 c1 30 4e 77 f5 2c ce 01 66 65 f2 26 7c 20 +76 26 43 c6 00 3c 01 6d 84 80 44 3c 70 1d f6 c1 +d8 d6 55 54 96 00 ee 45 5b 70 e4 73 31 9b 0d 44 +45 e0 b7 55 2a 1f 80 8e 88 f3 26 48 42 73 5a e6 +1d f0 32 5e d0 36 90 d6 d5 d6 93 ad 1f ed 22 66 +84 50 37 9d b5 32 3d c0 1c 89 af fa e3 69 b9 c3 +01 c3 19 c3 7d df 51 ed f4 6e 09 b2 1e 5d e9 14 +83 e8 e3 cb 21 ee b7 05 7b c2 eb dc 3a aa 3d 65 +00 c9 2f 99 b1 7b 31 80 bb a0 47 d7 60 73 77 63 +36 b1 5d 05 4d 79 a4 40 cc 5e 98 5e a5 43 fc aa +25 db 1d d8 92 b7 1b b7 4a 5c f6 82 63 d8 fd 58 +f1 a4 8e 6c 2f cb 8c 0b 71 a2 51 cf c1 a2 01 57 + +# ============================================= diff --git a/notes/rsa-testvectors/pkcs1v15sign-vectors.txt b/notes/rsa-testvectors/pkcs1v15sign-vectors.txt new file mode 100755 index 000000000..178dd23c5 --- /dev/null +++ b/notes/rsa-testvectors/pkcs1v15sign-vectors.txt @@ -0,0 +1,9049 @@ +Test vectors for RSA PKCS#1 v1.5 Signature +========================================== + +This file contains test vectors for the PKCS#1 v1.5 signature +scheme with appendix. 15 RSA keys of different sizes have +been generated. For each key, 20 random messages of length +between 1 and 256 octets have been PKCS#1 v1.5 signed. +As specified in PKCS#1, the block type for this operation +is 1. The digest algorithm is SHA-1; i.e. the given message +must be hashed and the SHA-1 hash must be encapsulated in a +DigestInfo structure as specified in PKCS#1 v1.5. + +Key lengths: + +Key 1: 1024 bits +Key 2: 1024 bits +Key 3: 1024 bits +Key 4: 1024 bits +Key 5: 1024 bits +Key 6: 1024 bits +Key 7: 1025 bits +Key 8: 1026 bits +Key 9: 1027 bits +Key 10: 1028 bits +Key 11: 1029 bits +Key 12: 1030 bits +Key 13: 1031 bits +Key 14: 1536 bits +Key 15: 2048 bits + +These test vectors have been derived from the PSS test vectors. +============================================================================ +# Thirteen RSA keys with bit sizes between 1024 and 1031, one 1536-bit key, +# and one 2048-bit key are generated. + +# For each key, 20 random messages are PKCS#1 v1.5 signed. + +# Example 1: A 1024-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +a5 6e 4a 0e 70 10 17 58 9a 51 87 dc 7e a8 41 d1 +56 f2 ec 0e 36 ad 52 a4 4d fe b1 e6 1f 7a d9 91 +d8 c5 10 56 ff ed b1 62 b4 c0 f2 83 a1 2a 88 a3 +94 df f5 26 ab 72 91 cb b3 07 ce ab fc e0 b1 df +d5 cd 95 08 09 6d 5b 2b 8b 6d f5 d6 71 ef 63 77 +c0 92 1c b2 3c 27 0a 70 e2 59 8e 6f f8 9d 19 f1 +05 ac c2 d3 f0 cb 35 f2 92 80 e1 38 6b 6f 64 c4 +ef 22 e1 e1 f2 0d 0c e8 cf fb 22 49 bd 9a 21 37 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +a5 6e 4a 0e 70 10 17 58 9a 51 87 dc 7e a8 41 d1 +56 f2 ec 0e 36 ad 52 a4 4d fe b1 e6 1f 7a d9 91 +d8 c5 10 56 ff ed b1 62 b4 c0 f2 83 a1 2a 88 a3 +94 df f5 26 ab 72 91 cb b3 07 ce ab fc e0 b1 df +d5 cd 95 08 09 6d 5b 2b 8b 6d f5 d6 71 ef 63 77 +c0 92 1c b2 3c 27 0a 70 e2 59 8e 6f f8 9d 19 f1 +05 ac c2 d3 f0 cb 35 f2 92 80 e1 38 6b 6f 64 c4 +ef 22 e1 e1 f2 0d 0c e8 cf fb 22 49 bd 9a 21 37 + +# Public exponent: +01 00 01 + +# Exponent: +33 a5 04 2a 90 b2 7d 4f 54 51 ca 9b bb d0 b4 47 +71 a1 01 af 88 43 40 ae f9 88 5f 2a 4b be 92 e8 +94 a7 24 ac 3c 56 8c 8f 97 85 3a d0 7c 02 66 c8 +c6 a3 ca 09 29 f1 e8 f1 12 31 88 44 29 fc 4d 9a +e5 5f ee 89 6a 10 ce 70 7c 3e d7 e7 34 e4 47 27 +a3 95 74 50 1a 53 26 83 10 9c 2a ba ca ba 28 3c +31 b4 bd 2f 53 c3 ee 37 e3 52 ce e3 4f 9e 50 3b +d8 0c 06 22 ad 79 c6 dc ee 88 35 47 c6 a3 b3 25 + +# Prime 1: +e7 e8 94 27 20 a8 77 51 72 73 a3 56 05 3e a2 a1 +bc 0c 94 aa 72 d5 5c 6e 86 29 6b 2d fc 96 79 48 +c0 a7 2c bc cc a7 ea cb 35 70 6e 09 a1 df 55 a1 +53 5b d9 b3 cc 34 16 0b 3b 6d cd 3e da 8e 64 43 + +# Prime 2: +b6 9d ca 1c f7 d4 d7 ec 81 e7 5b 90 fc ca 87 4a +bc de 12 3f d2 70 01 80 aa 90 47 9b 6e 48 de 8d +67 ed 24 f9 f1 9d 85 ba 27 58 74 f5 42 cd 20 dc +72 3e 69 63 36 4a 1f 94 25 45 2b 26 9a 67 99 fd + +# Prime exponent 1: +28 fa 13 93 86 55 be 1f 8a 15 9c ba ca 5a 72 ea +19 0c 30 08 9e 19 cd 27 4a 55 6f 36 c4 f6 e1 9f +55 4b 34 c0 77 79 04 27 bb dd 8d d3 ed e2 44 83 +28 f3 85 d8 1b 30 e8 e4 3b 2f ff a0 27 86 19 79 + +# Prime exponent 2: +1a 8b 38 f3 98 fa 71 20 49 89 8d 7f b7 9e e0 a7 +76 68 79 12 99 cd fa 09 ef c0 e5 07 ac b2 1e d7 +43 01 ef 5b fd 48 be 45 5e ae b6 e1 67 82 55 82 +75 80 a8 e4 e8 e1 41 51 d1 51 0a 82 a3 f2 e7 29 + +# Coefficient: +27 15 6a ba 41 26 d2 4a 81 f3 a5 28 cb fb 27 f5 +68 86 f8 40 a9 f6 e8 6e 17 a4 4b 94 fe 93 19 58 +4b 8e 22 fd de 1e 5a 2e 3b d8 aa 5b a8 d8 58 41 +94 eb 21 90 ac f8 32 b8 47 f1 3a 3d 24 a7 9f 4d + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 1.1 + +# ----------------- + +# Message to be signed: +cd c8 7d a2 23 d7 86 df 3b 45 e0 bb bc 72 13 26 +d1 ee 2a f8 06 cc 31 54 75 cc 6f 0d 9c 66 e1 b6 +23 71 d4 5c e2 39 2e 1a c9 28 44 c3 10 10 2f 15 +6a 0d 8d 52 c1 f4 c4 0b a3 aa 65 09 57 86 cb 76 +97 57 a6 56 3b a9 58 fe d0 bc c9 84 e8 b5 17 a3 +d5 f5 15 b2 3b 8a 41 e7 4a a8 67 69 3f 90 df b0 +61 a6 e8 6d fa ae e6 44 72 c0 0e 5f 20 94 57 29 +cb eb e7 7f 06 ce 78 e0 8f 40 98 fb a4 1f 9d 61 +93 c0 31 7e 8b 60 d4 b6 08 4a cb 42 d2 9e 38 08 +a3 bc 37 2d 85 e3 31 17 0f cb f7 cc 72 d0 b7 1c +29 66 48 b3 a4 d1 0f 41 62 95 d0 80 7a a6 25 ca +b2 74 4f d9 ea 8f d2 23 c4 25 37 02 98 28 bd 16 +be 02 54 6f 13 0f d2 e3 3b 93 6d 26 76 e0 8a ed +1b 73 31 8b 75 0a 01 67 d0 + +# Signature: +6b c3 a0 66 56 84 29 30 a2 47 e3 0d 58 64 b4 d8 +19 23 6b a7 c6 89 65 86 2a d7 db c4 e2 4a f2 8e +86 bb 53 1f 03 35 8b e5 fb 74 77 7c 60 86 f8 50 +ca ef 89 3f 0d 6f cc 2d 0c 91 ec 01 36 93 b4 ea +00 b8 0c d4 9a ac 4e cb 5f 89 11 af e5 39 ad a4 +a8 f3 82 3d 1d 13 e4 72 d1 49 05 47 c6 59 c7 61 +7f 3d 24 08 7d db 6f 2b 72 09 61 67 fc 09 7c ab +18 e9 a4 58 fc b6 34 cd ce 8e e3 58 94 c4 84 d7 + +# PKCS#1 v1.5 Signature Example 1.2 + +# ----------------- + +# Message to be signed: +85 13 84 cd fe 81 9c 22 ed 6c 4c cb 30 da eb 5c +f0 59 bc 8e 11 66 b7 e3 53 0c 4c 23 3e 2b 5f 8f +71 a1 cc a5 82 d4 3e cc 72 b1 bc a1 6d fc 70 13 +22 6b 9e + +# Signature: +84 fd 2c e7 34 ec 1d a8 28 d0 f1 5b f4 9a 87 07 +c1 5d 05 94 81 36 de 53 7a 3d b4 21 38 41 67 c8 +6f ae 02 25 87 ee 9e 13 7d ae e7 54 73 82 62 93 +2d 27 1c 74 4c 6d 3a 18 9a d4 31 1b db 02 04 92 +e3 22 fb dd c4 04 06 ea 86 0d 4e 8e a2 a4 08 4a +a9 8b 96 22 a4 46 75 6f db 74 0d db 3d 91 db 76 +70 e2 11 66 1b bf 87 09 b1 1c 08 a7 07 71 42 2d +1a 12 de f2 9f 06 88 a1 92 ae bd 89 e0 f8 96 f8 + +# PKCS#1 v1.5 Signature Example 1.3 + +# ----------------- + +# Message to be signed: +a4 b1 59 94 17 61 c4 0c 6a 82 f2 b8 0d 1b 94 f5 +aa 26 54 fd 17 e1 2d 58 88 64 67 9b 54 cd 04 ef +8b d0 30 12 be 8d c3 7f 4b 83 af 79 63 fa ff 0d +fa 22 54 77 43 7c 48 01 7f f2 be 81 91 cf 39 55 +fc 07 35 6e ab 3f 32 2f 7f 62 0e 21 d2 54 e5 db +43 24 27 9f e0 67 e0 91 0e 2e 81 ca 2c ab 31 c7 +45 e6 7a 54 05 8e b5 0d 99 3c db 9e d0 b4 d0 29 +c0 6d 21 a9 4c a6 61 c3 ce 27 fa e1 d6 cb 20 f4 +56 4d 66 ce 47 67 58 3d 0e 5f 06 02 15 b5 90 17 +be 85 ea 84 89 39 12 7b d8 c9 c4 d4 7b 51 05 6c +03 1c f3 36 f1 7c 99 80 f3 b8 f5 b9 b6 87 8e 8b +79 7a a4 3b 88 26 84 33 3e 17 89 3f e9 ca a6 aa +29 9f 7e d1 a1 8e e2 c5 48 64 b7 b2 b9 9b 72 61 +8f b0 25 74 d1 39 ef 50 f0 19 c9 ee f4 16 97 13 +38 e7 d4 70 + +# Signature: +0b 1f 2e 51 80 e5 c7 b4 b5 e6 72 92 9f 66 4c 48 +96 e5 0c 35 13 4b 6d e4 d5 a9 34 25 2a 3a 24 5f +f4 83 40 92 0e 10 34 b7 d5 a5 b5 24 eb 0e 1c f1 +2b ef ef 49 b2 7b 73 2d 2c 19 e1 c4 32 17 d6 e1 +41 73 81 11 1a 1d 36 de 63 75 cf 45 5b 3c 98 12 +63 9d bc 27 60 0c 75 19 94 fb 61 79 9e cf 7d a6 +bc f5 15 40 af d0 17 4d b4 03 31 88 55 66 75 b1 +d7 63 36 0a f4 6f ee ca 5b 60 f8 82 82 9e e7 b2 + +# PKCS#1 v1.5 Signature Example 1.4 + +# ----------------- + +# Message to be signed: +bc 65 67 47 fa 9e af b3 f0 + +# Signature: +45 60 7a d6 11 cf 57 47 a4 1a c9 4d 0f fe c8 78 +bd af 63 f6 b5 7a 4b 08 8b f3 6e 34 e1 09 f8 40 +f2 4b 74 2a da 16 10 2d ab f9 51 cb c4 4f 89 82 +e9 4e d4 cd 09 44 8d 20 ec 0e fa 73 54 5f 80 b6 +54 06 be d6 19 4a 61 c3 40 b4 ad 15 68 cb b7 58 +51 04 9f 11 af 17 34 96 40 76 e0 20 29 ae e2 00 +e4 0e 80 be 0f 43 61 f6 98 41 c4 f9 2a 44 50 a2 +28 6d 43 28 9b 40 55 54 c5 4d 25 c6 ec b5 84 f4 + +# PKCS#1 v1.5 Signature Example 1.5 + +# ----------------- + +# Message to be signed: +b4 55 81 54 7e 54 27 77 0c 76 8e 8b 82 b7 55 64 +e0 ea 4e 9c 32 59 4d 6b ff 70 65 44 de 0a 87 76 +c7 a8 0b 45 76 55 0e ee 1b 2a ca bc 7e 8b 7d 3e +f7 bb 5b 03 e4 62 c1 10 47 ea dd 00 62 9a e5 75 +48 0a c1 47 0f e0 46 f1 3a 2b f5 af 17 92 1d c4 +b0 aa 8b 02 be e6 33 49 11 65 1d 7f 85 25 d1 0f +32 b5 1d 33 be 52 0d 3d df 5a 70 99 55 a3 df e7 +82 83 b9 e0 ab 54 04 6d 15 0c 17 7f 03 7f dc cc +5b e4 ea 5f 68 b5 e5 a3 8c 9d 7e dc cc c4 97 5f +45 5a 69 09 b4 + +# Signature: +54 be 9d 90 87 75 15 f4 50 27 9c 15 b5 f6 1a d6 +f1 5e cc 95 f1 8c be d8 2b 65 b1 66 7a 57 58 09 +58 79 94 66 80 44 f3 bc 2a e7 f8 84 50 1f 64 f0 +b4 3f 58 8c fa 20 5a 6a b7 04 32 8c 2d 4a b9 2a +7a e1 34 40 61 4d 3e 08 5f 40 1d a9 ad 28 e2 10 +5e 4a 0e db 68 1a 64 24 df 04 73 88 ce 05 1e e9 +df 7b c2 16 3f e3 47 52 0a d5 1c cd 51 80 64 38 +3e 74 1a ca d3 cb dc 2c b5 a7 c6 8e 86 84 64 c2 + +# PKCS#1 v1.5 Signature Example 1.6 + +# ----------------- + +# Message to be signed: +10 aa e9 a0 ab 0b 59 5d 08 41 20 7b 70 0d 48 d7 +5f ae dd e3 b7 75 cd 6b 4c c8 8a e0 6e 46 94 ec +74 ba 18 f8 52 0d 4f 5e a6 9c bb e7 cc 2b eb a4 +3e fd c1 02 15 ac 4e b3 2d c3 02 a1 f5 3d c6 c4 +35 22 67 e7 93 6c fe bf 7c 8d 67 03 57 84 a3 90 +9f a8 59 c7 b7 b5 9b 8e 39 c5 c2 34 9f 18 86 b7 +05 a3 02 67 d4 02 f7 48 6a b4 f5 8c ad 5d 69 ad +b1 7a b8 cd 0c e1 ca f5 02 5a f4 ae 24 b1 fb 87 +94 c6 07 0c c0 9a 51 e2 f9 91 13 11 e3 87 7d 00 +44 c7 1c 57 a9 93 39 50 08 80 6b 72 3a c3 83 73 +d3 95 48 18 18 52 8c 1e 70 53 73 92 82 05 35 29 +51 0e 93 5c d0 fa 77 b8 fa 53 cc 2d 47 4b d4 fb +3c c5 c6 72 d6 ff dc 90 a0 0f 98 48 71 2c 4b cf +e4 6c 60 57 36 59 b1 1e 64 57 e8 61 f0 f6 04 b6 +13 8d 14 4f 8c e4 e2 da 73 + +# Signature: +0e 6f f6 3a 85 6b 9c bd 5d be 42 31 83 12 20 47 +dd 39 d6 f7 6d 1b 23 10 e5 46 fe 9e e7 3b 33 ef +a7 c7 8f 94 74 45 5c 9e 5b 88 cb 38 3a af c3 69 +86 68 e7 b7 a5 9a 9c bb 5b 08 97 b6 c5 af b7 f8 +ba c4 b9 24 e9 8d 76 0a 15 fc 43 d2 81 4a b2 d5 +18 7f 79 be d9 91 5a 93 39 7e bc 22 a7 67 75 06 +a0 2e 07 6d 3f fd c0 44 1d bd 4d b0 04 53 dc 28 +d8 30 e0 57 3f 77 b8 17 b5 05 c3 8b 4a 4b b5 d0 + +# PKCS#1 v1.5 Signature Example 1.7 + +# ----------------- + +# Message to be signed: +ef b5 da 1b 4d 1e 6d 9a 5d ff 92 d0 18 4d a7 e3 +1f 87 7d 12 81 dd da 62 56 64 86 9e 83 79 e6 7a +d3 b7 5e ae 74 a5 80 e9 82 7a bd 6e b7 a0 02 cb +54 11 f5 26 67 97 76 8f b8 e9 5a e4 0e 3e 8b 34 +66 f5 ab 15 d6 95 53 95 29 39 ec 23 e6 1d 58 49 +7f ac 76 aa 1c 0b b5 a3 cb 4a 54 38 35 87 c7 bb +78 d1 3e ef da 20 54 43 e6 ce 43 65 80 2d f5 5c +64 71 34 97 98 4e 7c a9 67 22 b3 ed f8 4d 56 + +# Signature: +83 85 d5 85 33 a9 95 f7 2d f2 62 b7 0f 40 b3 91 +dd f5 15 f4 64 b9 d2 cc 2d 66 39 8f c0 56 89 d8 +11 63 29 46 d6 2e ab dc a7 a3 1f cf 6c d6 c9 81 +d2 8b bc 29 08 3e 4a 6d 5b 2b 37 8c a4 e5 40 f0 +60 b9 6d 53 ad 26 93 f8 21 78 b9 4e 2e 2f 86 b9 +ac cf a0 20 25 10 7e 06 2a b7 08 01 75 68 45 01 +02 8f 67 64 61 d8 1c 00 8f e4 75 06 71 64 99 70 +87 8f c1 75 cf 98 e9 6b 2e cb f6 87 4d 77 da cb + +# PKCS#1 v1.5 Signature Example 1.8 + +# ----------------- + +# Message to be signed: +53 bb 58 ce 42 f1 98 49 40 55 26 57 23 3b 14 96 +9a f3 65 c0 a5 61 a4 13 2a f1 8a f3 94 32 28 0e +3e 43 70 82 43 4b 19 23 18 37 18 4f 02 cf 2b 2e +72 6b eb f7 4d 7a e3 25 6d 8b 72 f3 ea fd b1 34 +d3 3d e0 6f 29 91 d2 99 d5 9f 54 68 d4 3b 99 58 +d6 a9 68 f5 96 9e db bc 6e 71 85 cb c7 16 c7 c9 +45 da fa 9c c7 1d df aa a0 10 94 a4 52 dd f5 e2 +40 73 20 40 0b f0 5e a9 72 9c af bf 06 00 e7 88 +07 ef 94 62 e3 fd e3 2e d7 d9 81 a5 6f 47 51 ef +64 fb 45 49 91 0e cc 91 1d 72 80 53 b3 99 43 00 +47 40 e6 f5 82 1f e8 d7 5c 06 17 bf 2c 6b 24 bb +fc 34 01 3f c9 5f 0d ed f5 ba 29 7f 50 4f b8 33 +da 2a 43 6d 1d 8f f1 cc 51 93 e2 a6 43 89 fc ed +91 8e 7f eb 67 16 33 0f 66 80 1d b9 49 75 49 cf +1d 3b d9 7c f1 bc 62 55 + +# Signature: +8e 1f 3d 26 ec 7c 6b bb 8c 54 c5 d2 5f 31 20 58 +78 03 af 6d 3c 2b 99 a3 7c ed 6a 36 57 d4 ae 54 +26 6f 63 ff fd e6 60 c8 66 d6 5d 0a b0 58 9e 1d +12 d9 ce 60 54 b0 5c 86 68 ae 12 71 71 cc aa e7 +f1 cd 40 96 77 f5 21 57 b6 12 3a b2 27 f2 7a 00 +96 6d 14 39 b4 2a 32 16 9d 10 70 39 40 26 fc 8b +c9 35 45 b1 ac 25 2d 0f 7d a7 51 c0 2e 33 a4 78 +31 fb d7 15 14 c2 bb bd 3a db 67 40 c0 fd 68 ad + +# PKCS#1 v1.5 Signature Example 1.9 + +# ----------------- + +# Message to be signed: +27 ca dc 69 84 50 94 5f 20 4e c3 cf 8c 6c bd 8c +eb 4c c0 cb e3 12 27 4f a9 6b 04 de ac 85 51 60 +c0 e0 4e 4a c5 d3 82 10 c2 7c + +# Signature: +7b 63 f9 22 33 56 f3 5f 61 17 f6 8c 8f 82 20 03 +4f c2 38 4a b5 dc 69 04 14 1f 13 93 14 d6 ee 89 +f5 4e c6 ff d1 8c 41 3a 23 c5 93 1c 7f bb 13 c5 +55 cc fd 59 0e 0e aa 85 3c 8c 94 d2 52 0c d4 25 +0d 9a 05 a1 93 b6 5d c7 49 b8 24 78 af 01 56 ee +1d e5 5d da d3 3e c1 f0 09 9c ad 6c 89 1a 36 17 +c7 39 3d 05 fb fb bb 00 52 8a 00 1d f0 b2 04 eb +df 1a 34 10 90 de a8 9f 87 0a 87 74 58 42 7f 7b + +# PKCS#1 v1.5 Signature Example 1.10 + +# ----------------- + +# Message to be signed: +71 64 07 e9 01 b9 ef 92 d7 61 b0 13 fd 13 eb 7a +d7 2a ed + +# Signature: +2a 22 db e3 77 4d 5b 29 72 01 b5 5a 0f 17 f4 2d +ce 63 b7 84 5c b3 25 cf e9 51 d0 ba db 5c 5a 14 +47 21 43 d8 96 c8 6c c3 39 f8 36 71 16 42 15 ab +c9 78 62 f2 15 16 54 e7 5a 3b 35 7c 37 31 1b 3d +72 68 ca b5 40 20 2e 23 be e5 27 36 f2 cd 86 cc +e0 c7 db de 95 e1 c6 00 a4 73 95 dc 5e b0 a4 72 +15 3f bc 4f b2 1b 64 3e 0c 04 ae 14 dd 37 e9 7e +61 7a 75 67 c8 96 52 21 97 81 00 1b a6 f8 32 98 + +# PKCS#1 v1.5 Signature Example 1.11 + +# ----------------- + +# Message to be signed: +46 c2 4e 41 03 00 16 29 c7 12 dd 4c e8 d7 47 ee +59 5d 6c 74 4c cc 4f 71 34 7d 9b 8a bf 49 d1 b8 +fb 2e f9 1b 95 dc 89 9d 4c 0e 3d 29 97 e6 38 f4 +cf 3f 68 e0 49 8d e5 aa bd 13 f0 df e0 2f f2 6b +a4 37 91 04 e7 8f fa 95 ff bd 15 06 7e f8 cb d7 +eb 78 60 fe cc 71 ab e1 3d 5c 72 0a 66 85 1f 2d +ef d4 e7 95 05 4d 7b ec 02 4b b4 22 a4 6a 73 68 +b5 6d 95 b4 7a eb af be ad d6 12 81 25 93 a7 0d +b9 f9 6d 45 1e e1 5e db 29 93 08 d7 77 f4 bb 68 +ed 33 77 c3 21 56 b4 1b 7a 9c 92 a1 4c 8b 81 14 +43 99 c5 6a 5a 43 2f 4f 77 0a a9 7d a8 41 5d 0b +da 2e 81 32 06 03 1e 70 62 00 31 c8 81 d6 16 bf +fd 5f 03 bf 14 7c 1e 73 76 6c 26 24 62 08 + +# Signature: +12 23 5b 0b 40 61 26 d9 d2 60 d4 47 e9 23 a1 10 +51 fb 24 30 79 f4 46 fd 73 a7 01 81 d5 36 34 d7 +a0 96 8e 4e e2 77 77 ed a6 3f 6e 4a 3a 91 ad 59 +85 99 8a 48 48 da 59 ce 69 7b 24 bb 33 2f a2 ad +9c e4 62 ca 4a ff dc 21 da b9 08 e8 ce 15 af 6e +b9 10 5b 1a bc f3 91 42 aa 17 b3 4c 4c 09 23 86 +a7 ab bf e0 28 af db eb c1 4f 2c e2 6f be e5 ed +ec a1 15 02 d3 9a 6b 74 03 15 48 43 d9 8a 62 a7 + +# PKCS#1 v1.5 Signature Example 1.12 + +# ----------------- + +# Message to be signed: +bc 99 a9 32 aa 16 d6 22 bf ff 79 c5 0b 4c 42 35 +86 73 26 11 29 e2 8d 6a 91 8f f1 b0 f1 c4 f4 6a +d8 af a9 8b 0c a0 f5 6f 96 79 75 b0 a2 9b e8 82 +e9 3b 6c d3 fc 33 e1 fa ef 72 e5 2b 2a e0 a3 f1 +20 24 50 6e 25 69 0e 90 2e 78 29 82 14 55 56 53 +22 84 cf 50 57 89 73 8f 4d a3 1f a1 33 3d 3a f8 +62 b2 ba 6b 6c e7 ab 4c ce 6a ba + +# Signature: +87 2e c5 ad 4f 18 46 25 6f 17 e9 93 6a c5 0e 43 +e9 96 3e a8 c1 e7 6f 15 87 9b 78 74 d7 7d 12 2a +60 9d c8 c5 61 14 5b 94 bf 4f fd ff de b1 7e 6e +76 ff c6 c1 0c 07 47 f5 e3 7a 9f 43 4f 56 09 e7 +9d a5 25 02 15 a4 57 af df 12 c6 50 7c c1 55 1f +54 a2 80 10 59 58 26 a2 c9 b9 7f a0 aa 85 1c c6 +8b 70 5d 7a 06 d7 20 ba 02 7e 4a 1c 0b 01 95 00 +fb 63 b7 80 71 68 4d cf a9 77 27 00 b9 82 dc 66 + +# PKCS#1 v1.5 Signature Example 1.13 + +# ----------------- + +# Message to be signed: +73 1e 17 2a c0 63 99 2c 5b 11 ba 17 0d fb 23 bb +00 0d 47 ba 19 53 29 cf 27 80 61 03 73 81 51 4c +14 60 64 c5 28 5d b1 30 dd 5b ae 98 b7 72 22 59 +50 ea b0 5d 3e a9 96 f6 ff fb 9a 8c 86 22 91 3f +27 99 14 c8 9a da 4f 3d d7 76 66 a8 68 bf cb ff +2b 95 b7 da f4 53 d4 e2 c9 d7 5b ee e7 f8 e7 09 +05 e4 06 6a 4f 73 ae cc 67 f9 56 aa 5a 32 92 b8 +48 8c 91 7d 31 7c fd c8 62 53 e6 90 38 1e 15 ab + +# Signature: +76 20 4e ac c1 d6 3e c1 d6 ad 5b d0 69 2e 1a 2f +68 6d f6 e6 4c a9 45 c7 7a 82 4d e2 12 ef a6 d9 +78 2d 81 b4 59 14 03 ff 40 20 62 02 98 c0 7e bd +3a 8a 61 c5 bf 4d ad 62 cb fc 4a e6 a0 39 37 be +4b 49 a2 16 d5 70 fc 6e 81 87 29 37 87 6e 27 bd +19 cf 60 1e ff c3 0d dc a5 73 c9 d5 6c d4 56 9b +db 48 51 c4 50 c4 2c b2 1e 73 8c dd 61 02 7b 8b +e5 e9 b4 10 fc 46 aa 3f 29 e4 be 9e 64 45 13 46 + +# PKCS#1 v1.5 Signature Example 1.14 + +# ----------------- + +# Message to be signed: +02 11 38 26 83 a7 4d 8d 2a 2c b6 a0 65 50 56 3b +e1 c2 6c a6 28 21 e4 ff 16 3b 72 04 64 fc 3a 28 +d9 1b ed dd c6 27 49 a5 53 8e af 41 fb e0 c8 2a +77 e0 6a d9 93 83 c9 e9 85 ff b8 a9 3f d4 d7 c5 +8d b5 1a d9 1b a4 61 d6 9a 8f d7 dd ab e2 49 67 +57 a0 c4 91 22 c1 a7 9a 85 cc 05 53 e8 21 4d 03 +6d fe 01 85 ef a0 d0 58 60 c6 12 fa 08 82 c8 2d +24 6e 58 30 a6 73 55 df f1 8a 2c 36 b7 32 f9 88 +cf ed c5 62 26 4c 62 54 b4 0f ca bb 97 b7 60 94 +75 68 dc d6 a1 7c da 6e e8 85 5b dd ba b9 37 02 +47 1a a0 cf b1 be d2 e1 31 18 eb a1 17 5b 73 c9 +62 53 c1 08 d0 b2 ab a0 5a b8 e1 7e 84 39 2e 20 +08 5f 47 40 4d 83 65 52 7d c3 fb 8f 2b b4 8a 50 +03 8e 71 36 1c cf 97 34 07 + +# Signature: +52 55 00 91 83 31 f1 04 2e ae 0c 5c 20 54 aa 7f +92 de b2 69 91 b5 79 66 34 f2 29 da f9 b4 9e b2 +05 4d 87 31 9f 3c fa 9b 46 6b d0 75 ef 66 99 ae +a4 bd 4a 19 5a 1c 52 96 8b 5e 2b 75 e0 92 d8 46 +ea 1b 5c c2 79 05 a8 e1 d5 e5 de 0e df db 21 39 +1e bb 95 18 64 eb d9 f0 b0 ec 35 b6 54 28 71 36 +0a 31 7b 7e f1 3a e0 6a f6 84 e3 8e 21 b1 e1 9b +c7 29 8e 5d 6f e0 01 3a 16 4b fa 25 d3 e7 31 3d + +# PKCS#1 v1.5 Signature Example 1.15 + +# ----------------- + +# Message to be signed: +fc 6b 70 0d 22 58 33 88 ab 2f 8d af ca f1 a0 56 +20 69 80 20 da 4b ae 44 da fb d0 87 7b 50 12 50 +6d c3 18 1d 5c 66 bf 02 3f 34 8b 41 fd 9f 94 79 +5a b9 64 52 a4 21 9f 2d 39 d7 2a f3 59 cf 19 56 +51 c7 + +# Signature: +44 52 a6 cc 26 26 b0 1e 95 ab 30 6d f0 d0 cc 74 +84 fb ab 3c 22 e9 70 32 83 56 7f 66 ea dc 24 8d +bd a5 8f ce 7d d0 c7 0c ce 3f 15 0f ca 4b 36 9d +ff 3b 62 37 e2 b1 62 81 ab 55 b5 3f b1 30 89 c8 +5c d2 65 05 6b 3d 62 a8 8b fc 21 35 b1 67 91 f7 +fb ca b9 fd 2d c3 3b ec b6 17 be 41 9d 2c 04 61 +42 a4 d4 7b 33 83 14 55 2e dd 4b 6f e9 ce 11 04 +ec ec 4a 99 58 d7 33 1e 93 0f c0 9b f0 8a 6e 64 + +# PKCS#1 v1.5 Signature Example 1.16 + +# ----------------- + +# Message to be signed: +13 ba 08 6d 70 9c fa 5f ed aa 55 7a 89 18 1a 61 +40 f2 30 0e d6 d7 c3 fe bb 6c f6 8a be bc bc 67 +8f 2b ca 3d c2 33 02 95 ee c4 5b b1 c4 07 5f 3a +da 98 7e ae 88 b3 9c 51 60 6c b8 04 29 e6 49 d9 +8a cc 84 41 b1 f8 89 7d b8 6c 5a 4c e0 ab f2 8b +1b 81 dc a3 66 76 97 b8 50 69 6b 74 a5 eb d8 5d +ec 56 c9 0f 8a be 51 3e fa 85 78 53 72 0b e3 19 +60 79 21 bc a9 47 52 2c d8 fa c8 ca ce 5b 82 7c +3e 5a 12 9e 7e e5 7f 6b 84 93 2f 14 14 1a c4 27 +4e 8c bb 46 e6 91 2b 0d 3e 21 77 d4 99 d1 84 0c +d4 7d 4d 7a e0 b4 cd c4 d3 + +# Signature: +1f 3b 5a 87 db 72 a2 c9 7b b3 ef f2 a6 5a 30 12 +68 ea cd 89 f4 2a bc 10 98 c1 f2 de 77 b0 83 2a +65 d7 81 5f eb 35 07 00 63 f2 21 bb 34 53 bd 43 +43 86 c9 a3 fd e1 8e 3c a1 68 7f b6 49 e8 6c 51 +d6 58 61 9d de 5d eb b8 6f e1 54 91 ff 77 ab 74 +83 73 f1 be 50 88 80 d6 6e a8 1e 87 0e 91 cd f1 +70 48 75 c1 7f 0b 10 10 31 88 bc 64 ee f5 a3 55 +1b 41 4c 73 36 70 21 5b 1a 22 70 25 62 58 1a b1 + +# PKCS#1 v1.5 Signature Example 1.17 + +# ----------------- + +# Message to be signed: +eb 1e 59 35 + +# Signature: +37 0c b9 83 9a e6 07 4f 84 b2 ac d6 e6 f6 b7 92 +1b 4b 52 34 63 75 7f 64 46 71 61 40 c4 e6 c0 e7 +5b ec 6a d0 19 7e bf a8 6b f4 6d 09 4f 5f 6c d3 +6d ca 3a 5c c7 3c 8b bb 70 e2 c7 c9 ab 5d 96 4e +c8 e3 df de 48 1b 4a 1b ef fd 01 b4 ad 15 b3 1a +e7 ae bb 9b 70 34 4a 94 11 08 31 65 fd f9 c3 75 +4b bb 8b 94 dd 34 bd 48 13 df ad a1 f6 93 7d e4 +26 7d 55 97 ca 09 a3 1e 83 d7 f1 a7 9d d1 9b 5e + +# PKCS#1 v1.5 Signature Example 1.18 + +# ----------------- + +# Message to be signed: +63 46 b1 53 e8 89 c8 22 82 09 63 00 71 c8 a5 77 +83 f3 68 76 0b 8e b9 08 cf c2 b2 76 + +# Signature: +24 79 c9 75 c5 b1 ae 4c 4e 94 0f 47 3a 90 45 b8 +bf 5b 0b fc a7 8e c2 9a 38 df be dc 8a 74 9b 7a +26 92 f7 c5 2d 5b c7 c8 31 c7 23 23 72 a0 0f ed +3b 6b 49 e7 60 ec 99 e0 74 ff 2e ea d5 13 4e 83 +05 72 5d fa 39 21 2b 84 bd 4b 8d 80 bc 8b c1 7a +51 28 23 a3 be b1 8f c0 8e 45 ed 19 c2 6c 81 77 +07 d6 7f b0 58 32 ef 1f 12 a3 3e 90 cd 93 b8 a7 +80 31 9e 29 63 ca 25 a2 af 7b 09 ad 8f 59 5c 21 + +# PKCS#1 v1.5 Signature Example 1.19 + +# ----------------- + +# Message to be signed: +64 70 2d b9 f8 25 a0 f3 ab c3 61 97 46 59 f5 e9 +d3 0c 3a a4 f5 6f ea c6 90 50 c7 29 05 e7 7f e0 +c2 2f 88 a3 78 c2 1f cf 45 fe 8a 5c 71 73 02 09 +39 29 + +# Signature: +15 2f 34 51 c8 58 d6 95 94 e6 56 7d fb 31 29 1c +1e e7 86 0b 9d 15 eb d5 a5 ed d2 76 ac 3e 6f 7a +8d 14 80 e4 2b 33 81 d2 be 02 3a cf 7e bb db 28 +de 3d 21 63 ae 44 25 9c 6d f9 8c 33 5d 04 5b 61 +da c9 db a9 db bb 4e 6a b4 a0 83 cd 76 b5 80 cb +e4 72 20 6a 1a 9f d6 06 80 ce ea 1a 57 0a 29 b0 +88 1c 77 5e ae f5 52 5d 6d 2f 34 4c 28 83 7d 0a +ca 42 2b bb 0f 1a ba 8f 68 61 ae 18 bd 73 fe 44 + +# PKCS#1 v1.5 Signature Example 1.20 + +# ----------------- + +# Message to be signed: +94 19 21 de 4a 1c 9c 16 18 d6 f3 ca 3c 17 9f 6e +29 ba e6 dd f9 a6 a5 64 f9 29 e3 ce 82 cf 32 65 +d7 83 7d 5e 69 2b e8 dc c9 e8 6c + +# Signature: +70 76 c2 87 fc 6f ff 2b 20 53 74 35 e5 a3 10 7c +e4 da 10 71 61 86 d0 15 39 41 3e 60 9d 27 d1 da +6f d9 52 c6 1f 4b ab 91 c0 45 fa 4f 86 83 ec c4 +f8 dd e7 42 27 f7 73 cf f3 d9 6d b8 47 18 c4 94 +4b 06 af fe ba 94 b7 25 f1 b0 7d 39 28 b2 49 0a +85 c2 f1 ab f4 92 a9 17 7a 7c d2 ea 0c 96 68 75 +6f 82 5b be c9 00 fa 8a c3 82 4e 11 43 87 ef 57 +37 80 ca 33 48 82 38 7b 94 e5 aa d7 a2 7a 28 dc + +# ============================================= + +# Example 2: A 1024-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +ac 13 d9 fd ae 7b 73 35 b6 9c d9 85 67 e9 64 7d +99 bf 37 3a 9e 05 ce 34 35 d6 64 65 f3 28 b7 f7 +33 4b 79 2a ee 7e fa 04 4e bc 4c 7a 30 b2 1a 5d +7a 89 cd b3 a3 0d fc d9 fe e9 99 5e 09 41 5e dc +0b f9 e5 b4 c3 f7 4f f5 3f b4 d2 94 41 bf 1b 7e +d6 cb dd 4a 47 f9 25 22 69 e1 64 6f 6c 1a ee 05 +14 e9 3f 6c b9 df 71 d0 6c 06 0a 21 04 b4 7b 72 +60 ac 37 c1 06 86 1d c7 8c a5 a2 5f aa 9c b2 e3 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +ac 13 d9 fd ae 7b 73 35 b6 9c d9 85 67 e9 64 7d +99 bf 37 3a 9e 05 ce 34 35 d6 64 65 f3 28 b7 f7 +33 4b 79 2a ee 7e fa 04 4e bc 4c 7a 30 b2 1a 5d +7a 89 cd b3 a3 0d fc d9 fe e9 99 5e 09 41 5e dc +0b f9 e5 b4 c3 f7 4f f5 3f b4 d2 94 41 bf 1b 7e +d6 cb dd 4a 47 f9 25 22 69 e1 64 6f 6c 1a ee 05 +14 e9 3f 6c b9 df 71 d0 6c 06 0a 21 04 b4 7b 72 +60 ac 37 c1 06 86 1d c7 8c a5 a2 5f aa 9c b2 e3 + +# Public exponent: +01 00 01 + +# Exponent: +04 84 cc ef ad 7a 4e 6f 35 a9 6e c8 e3 0e ac f5 +e3 68 b3 11 95 fe bf 08 7d f5 70 53 81 0c 2b b0 +91 27 45 3a 4c 63 07 3b bf b9 90 24 91 4c cc 06 +72 66 56 01 86 a1 a2 67 33 1b 7d 4c 8b df ac 96 +fd a9 f3 f7 0b ec 4e ea bc e7 cd 52 19 34 3c 2e +49 1c ce 82 7e 44 ee 23 0e 4f 69 58 9e 57 5a e9 +06 30 30 44 2a 31 c8 2c de 30 dc 9c 79 cf 64 e7 +a0 97 5e 75 e1 6e a4 58 15 48 8b 45 52 56 ee b1 + +# Prime 1: +df 85 f4 a0 b4 33 bd 37 43 3c d7 97 8c 9b 37 f9 +e4 17 29 d8 3a 26 2b 98 46 53 8e 50 39 e6 59 68 +b5 95 a4 62 72 bd 5f 4a 2c 3a bf 89 0a 35 50 8a +5b cb 4c 29 ef bd 91 02 85 03 83 4c fa b2 c0 f9 + +# Prime 2: +c5 14 59 a6 72 ed 8b 72 4c 6a 8f 28 5c bb 8e a7 +6a 23 93 91 79 28 be 56 c0 dc df c9 43 c3 0b da +3c ee fb 86 dc c8 c4 55 67 8c fe 88 25 f3 88 77 +a3 72 8a 1f 10 29 1f 54 7b 1e 8b 16 04 83 e5 bb + +# Prime exponent 1: +b6 ba 83 a9 7c a7 6f 5f e6 0f af 0f ad 5a 97 00 +2a 7e e5 2e 67 1b 1d 38 77 05 87 a9 fe 2b 59 9c +48 15 f5 34 a6 28 39 e6 21 12 45 d2 7a 0d eb b1 +b0 29 1a 32 8e 52 a2 61 34 ec 12 42 b4 0f bd c1 + +# Prime exponent 2: +b9 b1 c6 13 2e e1 22 6e 6d 10 4e 99 72 5f 0b 38 +35 ab 15 e5 91 6a d1 85 be ad 9f 72 ed 95 3f 7a +bf c5 52 5c ad 75 c2 80 d2 54 28 94 b2 65 b8 65 +3a 2d b7 75 33 6d fb e6 47 27 ed 57 ae a3 74 f7 + +# Coefficient: +7b 8d 15 a5 dd 28 90 a6 7d 1b 54 9c 93 5f 58 5a +38 da 56 f7 c8 15 5a 51 9d c8 f1 f6 ad e5 53 d6 +37 93 c7 8a 0e ce 8d 53 72 4e 62 ae 50 3a d5 25 +bf af 10 cf 61 6a 47 73 ce 7c cd 5c 1b 31 51 bd + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 2.1 + +# ----------------- + +# Message to be signed: +e1 c0 f9 8d 53 f8 f8 b1 41 90 57 d5 b9 b1 0b 07 +fe ea ec 32 c0 46 3a 4d 68 38 2f 53 1b a1 d6 cf +e4 ed 38 a2 69 4a 34 b9 c8 05 ad f0 72 ff bc eb +e2 1d 8d 4b 5c 0e 8c 33 45 2d d8 f9 c9 bf 45 d1 +e6 33 75 11 33 58 82 29 d2 93 c6 49 6b 7c 98 3c +2c 72 bd 21 d3 39 27 2d 78 28 b0 d0 9d 01 0b ba +d3 18 d9 98 f7 04 79 67 33 8a ce fd 01 e8 74 ac +e5 f8 6d 2a 60 f3 b3 ca e1 3f c5 c6 65 08 cf b7 +23 78 fd d6 c8 de 24 97 65 10 3c e8 fe 7c d3 3a +d0 ef 16 86 fe b2 5e 6a 35 fb 64 e0 96 a4 + +# Signature: +64 ac 09 39 71 f8 f0 96 a4 c1 d4 a5 43 66 2a 2e +5a 12 81 c9 50 98 7d e8 98 70 7f 02 9c 15 9b d8 +32 ca c5 5d 91 36 e0 e9 b4 a8 0b f6 f2 1b 68 cf +97 70 a6 34 9a e5 1e 7f 09 db da 9d 59 c4 58 37 +37 47 2d 4d 65 32 c7 17 7e e9 81 08 d2 cf 42 cd +08 5a bb 49 22 eb 29 d9 6f 3d 0f 6b 1d 0d 43 c7 +39 cc f1 ba 65 16 75 e1 96 8b 50 7d 51 90 2f 38 +cd ec 0b 61 32 72 90 45 32 5f c1 fb 8f d5 58 e8 + +# PKCS#1 v1.5 Signature Example 2.2 + +# ----------------- + +# Message to be signed: +c1 11 46 4e 00 2e 4e c6 18 a8 e2 63 db cc a9 1f +b1 8a 00 a1 8b 44 0c 4b 55 97 be e7 db 2a ed a8 +31 e6 21 fc ac 8d d8 1c ee 35 03 24 2b 33 b0 da +a9 87 fe 2f 54 93 ad 2d 06 a1 50 07 59 00 40 ce +3c 22 77 64 2f d2 7f 3f 25 5e 3d 98 d8 9d fa eb +86 be 34 e0 b8 fb b9 35 fb 92 85 60 fa 29 2d 26 +34 62 5a 50 7d d5 80 a8 91 24 b9 21 29 3e 8d fe +dd c2 81 d7 9e b3 a5 69 d5 9e 0d b8 01 3e 53 f7 +d4 c2 f9 6e 5f 2e c2 7f d8 dd b0 18 25 d1 7f ca +40 6d aa 62 24 c7 60 6d 2c 91 52 82 09 6a 78 05 +5a 49 62 15 37 b4 f0 25 a6 e5 b2 12 9b c8 c1 a4 +07 + +# Signature: +6e 7e aa d8 04 94 5e b0 46 70 dd 86 76 b7 05 7d +03 ac 3e 22 64 65 b1 fb 84 03 e6 ae 79 83 e0 a4 +6a 89 a4 eb 32 bd c8 e7 ae 5a 53 d4 8a a6 4b c9 +c3 db c8 cf 9c d6 dc 6a 68 fc ea e9 e2 9f 47 45 +fa 49 e1 8d 18 4d c5 d2 6c 4f eb 35 1f b4 b2 28 +c4 c1 8c ab db de 86 01 72 4a e3 80 3d b3 05 f2 +a0 76 fa 8a 57 f4 61 0b 8a 6e 0e d4 35 75 be 5d +5b fc 16 30 47 9d f3 bc bc 51 51 77 af e4 99 4a + +# PKCS#1 v1.5 Signature Example 2.3 + +# ----------------- + +# Message to be signed: +29 b8 5b 14 b2 da 94 7a 4c 3a d1 e5 93 7d a1 92 +c6 05 08 65 af 95 04 a5 44 53 70 e4 3d 3a 8d a5 +d3 55 fd 58 76 6b 25 43 ac 6f 93 10 87 83 c1 3f +f2 8b 2b e5 60 83 f0 29 82 39 e0 ee 96 81 ee 47 +c6 + +# Signature: +80 b3 8c e7 35 12 6c 85 45 d9 1d 18 ec 90 37 65 +4d 46 e4 f3 c5 1a 6b 86 18 e1 5f 72 cd 20 75 00 +a4 70 01 75 77 d0 a8 c5 5a 2b a3 34 38 3f 1f 8d +99 fc e2 46 0b 32 97 bc 03 7e f6 4a c4 a3 09 8c +6a aa 24 a4 d0 14 4a f1 02 d0 dd a1 7e 07 dc 69 +59 23 93 2e 56 8a da 00 dc 4f 7d bf bc de c4 3c +c9 08 38 80 17 d2 ee f0 4e 60 df e4 d5 73 40 fa +b9 16 e2 b8 11 24 4c b1 e4 a5 52 38 6f e3 ed 4c + +# PKCS#1 v1.5 Signature Example 2.4 + +# ----------------- + +# Message to be signed: +d3 b7 aa d3 7a 48 90 e0 36 5b 86 c7 da 94 91 e7 +3c df 55 5d 1b 02 b4 51 81 6d c5 2f 96 30 d5 90 +de 83 a5 c9 39 61 01 25 22 df f6 db bb 9c db 0e +71 ae 51 40 19 64 af 18 90 e8 93 25 db d6 26 f2 +da 01 34 58 e3 9e ec a5 83 e8 9e 4c 08 e5 d4 12 +be 49 84 95 88 6e 05 51 cf e7 42 b8 b5 + +# Signature: +9d 8a 88 89 a3 11 b4 86 cb e2 22 57 03 f5 d4 ae +2a 54 c2 bc aa ad 06 fe 76 48 b9 e2 d8 5e dd a1 +a0 7d 85 6d 6a e9 bd 5c c1 e5 15 32 66 ec 7f 1e +1d f3 d9 29 cc 44 70 0f ac 92 64 58 41 4c 28 41 +da 83 32 8e 81 e0 b9 d6 c3 88 5e 76 73 70 ad 5c +f1 f5 76 d9 dc e3 48 ca ec 5e 64 43 e0 ae b7 c3 +f7 2b 7d d2 53 66 70 23 b9 a4 77 ab 34 df 8f 20 +67 e2 25 ad cb 73 ee 11 e1 59 eb 64 91 47 d6 02 + +# PKCS#1 v1.5 Signature Example 2.5 + +# ----------------- + +# Message to be signed: +f6 58 18 8c 8f 9d e6 0b 5e 99 a2 9f 52 d3 b8 89 +20 1b 30 d4 64 c3 b7 27 92 a3 02 09 5d c1 e7 7d +45 e9 4f 5d ab 73 db b3 13 54 38 57 ff 91 db f4 +73 df c1 45 d7 3b d5 06 20 75 d1 92 a3 fb f4 a1 +33 e7 e5 68 df 20 b8 cf f7 7b 3a f6 87 aa 22 55 +9e c1 + +# Signature: +0a 95 a4 4f 62 74 e7 4c ec 45 17 96 af 56 88 d4 +be 01 08 93 fa ae 27 d4 90 f4 77 1b 00 3f 70 46 +cc cd 41 9f c8 19 d7 33 19 55 f4 1e ac 93 39 f5 +46 c5 84 a8 b4 2a 5a c6 32 90 58 3f f3 eb 6b 29 +ca dc 75 4a e5 8d 5a 56 37 b6 60 97 96 e8 05 51 +73 ff 20 a9 cc e4 92 fd 78 37 46 86 15 e8 41 08 +87 f0 b4 a5 9f f2 52 a8 25 97 76 c8 ff da a6 7c +87 df f8 98 3a e6 79 d1 de 22 ea 15 8d 48 f6 8b + +# PKCS#1 v1.5 Signature Example 2.6 + +# ----------------- + +# Message to be signed: +31 ae 5f 83 a0 fb 3a c9 25 5f fa 43 5f 70 e2 ab +65 55 66 e5 fb 8b 78 b8 02 c1 87 cf f1 c5 e4 0f +ed 06 97 8c 5d 59 76 eb 4c a7 75 80 63 99 a6 fc +4d b5 0c 1f 88 66 1b a6 8a bc 21 fb 2c cd 53 7f +50 18 f3 6e d1 f7 d4 53 83 fd 46 9e 77 ba b3 e8 +a9 5d fa 1b 94 1e 43 0d de c5 52 dc d8 2f 5d 10 +d2 9c d1 0a 22 d1 7c e2 42 59 28 ff 5d 07 10 dc +e7 d9 f8 3b 12 e0 4c 1a 01 59 c2 71 76 e0 4a cc + +# Signature: +3f 11 ea 73 9f 32 9c 9d 40 04 60 34 b6 c0 cf ce +b4 9b c3 20 1a 5f 25 ea f5 01 5a ed ed 02 18 9c +e0 b0 cf de 19 12 5b d2 88 b7 d0 c0 62 32 1a 5b +dc 2c fa 42 26 f5 10 4a 1f ba eb be 7f 72 f5 f7 +92 7e 1e ae 26 fd c5 ba 92 f2 d3 f8 69 eb c3 2d +90 18 dd 04 ed e8 6d e5 c4 54 f1 f7 a1 b2 e2 d1 +94 0a ac ae 27 79 63 55 fe 18 ac 80 97 53 53 92 +9a c6 a8 38 45 8b 5d 9d c7 57 6e 38 87 ee 7b ca + +# PKCS#1 v1.5 Signature Example 2.7 + +# ----------------- + +# Message to be signed: +96 ff 99 f1 50 60 c9 73 a6 5b 69 a8 b5 b6 3a db +33 25 32 0d a9 37 29 75 84 ad 4f ad 5c 3c 74 69 +01 9e 9c f7 2a cb 31 5f 1e 49 19 27 bb a1 94 87 +55 82 3e b0 7e 3f 20 ac df 78 65 3c ae 45 0e 47 +bc 54 ba f8 ca 11 67 a5 05 08 44 e0 22 22 0e e6 +65 8a 8d dd 95 63 2e 9a dc 1a 6c 14 37 9c 1c 5a +e5 a0 ce 5d c4 02 08 09 62 2a fd ec f8 1f 18 a5 +1e 28 66 6d 02 b1 dc da 0a 27 b8 c3 d2 c2 7b 2c +07 b3 80 22 00 01 7a 7c 12 4a 43 37 cc 4b 6e a2 +ae a7 5c 68 b4 40 e3 79 47 e3 61 9b cf ee 05 5b +b2 ed ab c4 24 49 07 e0 48 3d d3 a1 7d 8e df f3 +a6 50 29 3f d4 ab f5 c4 5d 1a 5b 6c 54 02 ba 2b +81 b7 b0 e0 c9 5e e9 49 b2 a2 38 c1 99 56 20 6c +12 4e 0c d9 c2 46 20 b3 6a 83 bf 93 b9 6e f2 04 +bd e5 31 6c 1f 53 27 c0 a6 21 ec ce 20 93 c0 65 +2d df 32 17 68 d7 45 02 f1 90 85 29 62 9b ab 68 + +# Signature: +18 3f 85 3d 0d 03 62 18 70 e3 ba 58 68 50 c5 ea +59 fc 4e 9a cf 37 94 b9 ad 59 a1 bb 80 18 1e 77 +b1 11 d6 64 86 47 e1 39 a3 9e c0 4f 86 18 74 91 +e7 7b 4d 75 c0 60 79 5b f7 27 08 46 d3 96 e0 bf +ea 83 15 79 5e 79 d7 6a 91 9e a7 6b 06 ee c1 3b +af 4c e8 af e1 e3 4b c2 24 57 d7 b7 99 2e 08 42 +ef ad e1 79 b0 ae da cc fb e2 d2 3d 3e b3 14 e1 +de 91 c8 71 b9 db 5a bf fb 17 47 7f ba 23 3a 06 + +# PKCS#1 v1.5 Signature Example 2.8 + +# ----------------- + +# Message to be signed: +3a 17 6c 79 3a 54 6e 2d 27 6f b8 ff c3 28 16 3b +49 49 97 a5 30 2a ae 2e 50 45 a2 a2 06 87 ea 6d +1f 18 1c 6a bf e6 09 0c 8d c4 02 56 db 3d e0 83 +22 64 7f b7 95 bb a1 71 3f b5 7e 33 d5 3e 0e 13 +be da c6 a6 58 ad 4a b4 91 22 38 81 19 8d f2 93 +67 fa ad e8 be 9f ca a4 e4 83 f7 b7 f3 dc 7c bb +f9 7a 17 aa d8 8c 26 cf c6 41 0f 94 5b 54 fc 53 +db 55 ac 80 3d 8b 73 69 1b 14 84 84 7d 7f 3b 7e +93 94 e5 5f 0a 51 fe 61 ae 84 52 3c 94 b2 2e 82 +39 6d b6 cf ac b7 2e 0e e4 94 aa 0f 1f a5 93 12 +54 43 ae 15 55 a6 a9 33 fa ce 00 74 79 1d c2 c2 +92 42 eb + +# Signature: +41 3c 92 23 a2 e9 b1 22 cd 87 25 77 e5 2f 31 3d +41 da c7 9a 26 cb 10 33 da 0b 6f cc 4b 48 21 07 +74 4b f4 90 fa 79 8d cc d0 cb d1 18 ef 39 c0 f5 +59 d8 7b 89 33 5d b0 9b e7 70 0f b0 9f db d3 40 +40 a0 0b e5 ca 42 88 34 77 b0 6e 4e 10 a7 cb 11 +76 8f cb 02 c3 4f b1 06 e5 22 86 0d 10 69 39 06 +26 0f 43 d9 06 12 99 03 93 a8 ff ac 9f d7 0c a3 +78 29 11 1e eb a6 f3 de e5 4e f1 c1 62 68 b3 3e + +# PKCS#1 v1.5 Signature Example 2.9 + +# ----------------- + +# Message to be signed: +06 8a 99 1b 32 b6 76 c6 4b 89 8c 67 e1 13 72 82 +b4 37 11 b0 d0 67 1c 24 7d 9f 7c 48 f5 04 3e 4f +c2 06 dc 65 af 89 06 f2 52 f0 24 52 05 ea 08 43 +23 d4 27 6b e5 aa 0f c5 af 9c 3f 34 b2 fd 66 34 +df 57 2f c3 13 d2 73 b5 3e 9e 36 b9 46 e7 e6 72 +f9 8d 85 7d 7e dd d3 dd 04 39 31 32 f4 61 f2 2c +99 00 26 16 6f 38 5b e1 59 5c 7f 23 f8 9f f5 7e +05 a7 be 28 5d 10 56 15 48 5f 35 6a ba b1 ff 2a +b9 27 d6 09 95 2a 62 7e 46 8c a7 59 0a cb 52 13 +f4 31 39 f8 e2 c9 d4 d1 7c 6b d7 91 4e 53 f0 2f +d1 9a 13 1f f4 9c d2 5e de 8f 41 8a 88 53 0a 82 +39 88 7f 0f c7 97 ed b5 04 64 79 64 bf 31 ca af +08 0d 58 17 a0 + +# Signature: +57 5d a9 e9 be fc a1 82 95 46 e8 29 38 15 00 11 +32 03 0e 74 9c a5 10 88 f1 68 bd 15 0b 13 94 c7 +ac d5 97 8b ca 03 f7 b9 d9 2a 29 b8 e2 85 6b 0d +a0 7f 0b b1 5c 0b 33 e0 54 87 99 1a d9 7a 81 2d +c9 04 aa f0 fd 1e 38 7e f1 c2 70 c6 86 8d 3e e1 +c6 11 57 7b c4 d0 7f f4 56 b2 43 98 32 90 8a 3d +cc 4f c0 99 04 72 fd a3 cc 61 11 93 0b 99 79 5d +60 c0 e3 78 88 e8 7c e0 0b bf 3c 1c f3 07 f9 e1 + +# PKCS#1 v1.5 Signature Example 2.10 + +# ----------------- + +# Message to be signed: +d6 83 9e e6 d0 74 50 32 7e 09 a0 3e 1e c2 80 e1 +c8 d1 15 00 dc 39 0a 49 a9 c9 82 87 49 c3 e9 a4 +be e2 ba 57 6f 6d 12 17 a8 e7 85 4a 90 7e eb 93 +df ff 92 30 8a d0 d9 4e 2b 38 1f 92 b0 e8 4a 47 +1b f1 f3 7a 68 e9 65 f6 58 59 d1 fd fd 6f ea 84 +40 79 c4 03 70 dc ea e2 + +# Signature: +a7 c5 f6 d0 de 9c f8 f4 17 37 f2 3a e3 e8 cf 60 +9a eb cf 22 d5 de 12 13 d9 57 3c b9 44 03 f8 9c +0f 70 88 ff fc 61 10 6f a6 09 c7 37 1a 8d 7e 1b +cd 22 1b c1 ad 94 91 2f ab f2 ff c0 2f 84 84 56 +4c 22 5c 06 9b fc 6d a9 f3 f9 f4 97 4e 08 e1 fe +56 f7 48 ff 79 05 97 90 6a 95 4e 38 37 43 a3 7e +57 5f ef 07 4f 06 0f 3d d1 5b 5e e0 f9 4d ba 69 +d8 6c 99 22 3f a9 c3 a6 1a 8c b2 af 2f ab 1e 04 + +# PKCS#1 v1.5 Signature Example 2.11 + +# ----------------- + +# Message to be signed: +33 84 9c 67 df 9a 6f fa c3 da 90 a8 cd 31 73 1a +02 97 b9 d6 01 0a 03 32 0f 88 45 03 5f c3 43 09 +ad + +# Signature: +1b 87 05 1f 15 91 c8 ae 7e e3 cb 24 26 70 39 a7 +28 40 5d bf 23 1c af 21 f3 24 7f 05 85 8b 2a 51 +65 0b 81 bc 53 77 86 5e 4c 1e 8f d0 36 41 52 a1 +6b c5 8f 7d 2a c0 1c a6 79 cc 49 dd 04 89 03 d5 +5a d0 5f 10 2c 74 b3 60 1f 25 ad 30 62 40 25 c3 +0b 6f 0f 79 11 fc 22 45 8e 5d 43 5f 38 8e 3f bc +49 5f a0 c6 10 c1 29 8f 82 1d a5 38 40 3a 93 36 +4d 2e ab f1 e3 b3 2f 81 10 a7 e0 3e 37 2e cb c5 + +# PKCS#1 v1.5 Signature Example 2.12 + +# ----------------- + +# Message to be signed: +b3 da ba ca 20 59 a7 0e 25 cb dd f4 aa 59 25 99 +57 54 ac e4 3c 5d 60 36 40 48 9a f4 8f ea 6e dc +4e 19 cb ee a2 c0 db 62 ae 0a 10 4c 72 e4 cd 56 +cb 53 2f 4f e5 77 b3 6a 81 98 b4 87 9d 7f f8 04 +26 90 f6 62 77 3f 3d 63 93 f2 58 98 d2 + +# Signature: +26 f1 37 70 26 3f c5 bd be ad f8 8f b4 dd 30 7a +38 95 9b 16 f3 df 94 6a de 86 4b 1e 7e 91 4d 36 +4e bf 9a df d8 6a 70 02 2d c6 1b 43 fb 1f df 86 +96 97 8e 2d 1f 6a 2d ef ee 75 ad aa 69 a3 95 32 +07 40 50 be 70 8e af 03 1d 5f ae 0f fe 24 5b a4 +ff 3c 5e 34 0a f5 df ec 6a 4c ce 0e 18 87 6c fc +13 66 ee ed df ce 0f 83 5b 38 e8 18 81 b1 fc 58 +32 93 0f c7 9b 08 f1 fb 34 fb 22 42 33 f4 c4 68 + +# PKCS#1 v1.5 Signature Example 2.13 + +# ----------------- + +# Message to be signed: +09 91 12 fa e7 40 88 8c ea ac 70 54 d5 97 35 1d +79 e1 59 a9 58 d8 12 15 78 e5 2c 83 7d b3 54 3c +fa 6f 8e 7f 1d bd 2a 61 97 86 45 a4 d3 85 b9 bb +1c 60 bf b1 1b b3 c8 75 2a e3 1f 99 6d bb 52 62 +8f 93 d5 26 94 f1 82 e6 90 35 a5 e5 57 ec 71 82 +62 f4 03 df 52 11 f7 3c 6d e0 d5 5a 0b a7 + +# Signature: +8d 8c 8f 3a 86 f4 9e db d1 25 c8 3e bf 6d 52 e7 +65 16 15 01 48 21 54 59 8c 28 3a be 94 02 77 87 +2b 00 d0 77 7c 2e 69 7b 78 83 cc 32 1e 15 1c 80 +11 6f 9f cd 17 7a c4 c7 de dd f0 3c a1 b2 c5 93 +31 dc 1c 8e 94 7f 1e b2 aa ee 8c c9 41 dd c5 f3 +74 a6 3d 6c 99 38 ec d8 e8 8c bc ec 58 92 9c ff +dd ef 0b a2 17 58 85 a8 0d c4 cd 92 d6 b7 9d 9c +6a 81 69 6e 16 f9 a8 3a 10 ca 8e fa f1 97 5f 55 + +# PKCS#1 v1.5 Signature Example 2.14 + +# ----------------- + +# Message to be signed: +aa 17 e6 bb d6 db 19 e5 4b ee 1a 7f 0e dc ca ce +ab 63 5d 76 28 fc aa 18 ec fa fc 40 1c b3 fe b5 +1f 9a 37 31 f3 80 2c be a8 1c 73 30 28 c9 58 4b +6b 78 e2 05 59 54 cf 91 04 da a6 77 aa 40 be 9b +7c 65 b0 7a c4 a8 bf 25 c1 14 9e 05 47 35 cf 3c +e3 32 d4 29 bc 73 80 24 45 df b3 68 8b b8 19 48 +b5 7e 27 6a f3 24 62 f7 ad 80 4d 50 c9 3b c7 e9 +ef 75 37 69 5a 27 1a f7 2e 4b d4 7c e5 fa 9d 62 +f2 da c0 33 36 23 f4 9e b9 d6 d7 80 34 ed 1d f6 +e1 2b fd 04 26 1b be 5c e0 40 e0 3e be 25 8d 2d +05 2a 12 ad 4e 3b f2 53 04 23 01 c7 64 58 ed 91 +0c 5f fa 70 5c 74 7a d8 ca 0c 1c 62 28 da 2c 97 +e1 38 + +# Signature: +64 4e a0 76 21 4d bd dd 30 05 5d 7c 56 18 92 27 +9b 46 ba b1 e1 22 53 42 4c 28 f4 49 e1 72 64 6a +f3 49 8c 7a fc bf f7 68 e0 46 a7 c2 e3 d9 c0 e7 +12 8f 87 7b 92 19 5a a2 bb 9f 1c fb df d1 5b b6 +5f bd 23 ef b2 94 fb b1 1a 3c 66 05 6d 60 63 85 +3b b2 3c 27 46 65 a1 3e f4 f3 c1 2f 59 21 a4 19 +e9 49 b3 0c 0b c0 d7 7d 6b 28 69 1d 23 64 d9 5b +f6 8b e8 d5 97 8e f1 bc 98 52 a4 f0 66 04 47 4a + +# PKCS#1 v1.5 Signature Example 2.15 + +# ----------------- + +# Message to be signed: +28 24 9c 38 7a 06 14 40 e9 86 38 e1 ed 78 a4 86 +51 30 e5 75 33 d7 89 10 8c 63 e1 5f d8 01 9b ad +2c d1 a7 55 2b d8 af d2 06 d9 78 eb 1f 2c f3 f2 +3a fc 4b 34 e6 dd 7f 69 c1 fd f4 fe c2 52 68 d1 +86 55 51 94 49 22 90 6d ce 6d c4 41 f9 4a 46 6b +f8 39 1a d8 2b f5 94 0e 44 71 10 f1 d1 5d e1 29 +31 29 fb 44 24 a1 71 75 19 d6 d4 28 d6 6b 7a 10 +91 42 ac c9 15 f1 ea c9 6d ef 2c 32 90 b0 1d 05 +99 0b f8 02 3a 6a 64 71 2f 63 13 7a 8e + +# Signature: +57 02 06 06 69 ed 47 bb ca 11 b9 16 68 28 9e a3 +f5 e7 46 ad 2e 38 6d d1 bc 2a 8b ab 17 46 ba 2a +64 bf 15 b3 fc 2e c8 b0 cc 99 d8 54 fa 32 11 c9 +55 c4 55 d7 ff 2e 1e e2 39 f5 4f 38 6a 42 bb 25 +40 a8 75 8f 32 97 e5 52 de 1e be 8e ac 70 f3 54 +87 94 2b ba da d5 bd 95 73 90 ff 17 93 af 3d 30 +d9 36 b6 f7 9b 44 a9 b6 3c ee 62 d5 58 4d a3 a1 +fc ff a5 b6 fe ee c1 1c d6 3b 18 0f 0b fc 5b 6b + +# PKCS#1 v1.5 Signature Example 2.16 + +# ----------------- + +# Message to be signed: +e4 91 a1 56 fd ba 31 6a 2a 20 a1 2e ea 50 be 77 +4e c9 aa be b1 c3 98 e9 08 be a3 29 68 21 7e a4 +1e 96 6d b7 27 2f 0e fa 37 c9 0a e4 e9 f3 86 21 +a6 27 a9 d1 2c 8b 4e 80 60 c5 45 c5 60 59 e9 e4 +8a 7f 16 81 36 72 47 33 58 19 ba 12 7e 65 93 1e +1d 9f b7 0d fd df 4c 99 56 a5 b0 4c 52 bc f8 cb +df cd f2 29 19 64 da fa ca 7e e7 0e 80 a2 75 9c +ec 73 5d 01 ac a8 ff 89 4b 68 9b 93 78 3d a8 93 +9c 62 09 dd 68 3c 60 + +# Signature: +9f 20 5b a9 0d f2 d4 01 49 26 48 1f 9b 3f 45 a8 +9d 23 ec d8 4f 5f 16 e6 73 34 c4 ca f3 f3 b9 c2 +01 a7 98 d4 ee c5 62 76 59 88 23 18 0e 07 8d 0a +ef 4f 8f ba 0b 25 c1 fd a3 e3 36 54 c4 74 a9 c1 +1a 23 b0 87 10 91 3d ff 76 56 f0 e7 ee 22 cc 44 +c9 99 c0 95 a6 51 4a 9d 2f c0 ca 4e f2 08 de 0d +92 93 b0 c5 60 8b ae d1 07 4a 0c fd 57 b9 9e f8 +ce ab fd 34 72 b7 db 3a b9 60 6d 13 f9 bb 43 9a + +# PKCS#1 v1.5 Signature Example 2.17 + +# ----------------- + +# Message to be signed: +06 ad d7 5a b6 89 de 06 77 44 e6 9a 2e bd 4b 90 +fa 93 83 00 3c d0 5f f5 36 cb f2 94 cd 21 5f 09 +23 b7 fc 90 04 f0 aa 18 52 71 a1 d0 06 1f d0 e9 +77 7a d1 ec 0c 71 59 1f 57 8b f7 b8 e5 a1 + +# Signature: +45 14 21 0e 54 1d 5b ad 7d d6 0a e5 49 b9 43 ac +c4 4f 21 39 0d f5 b6 13 18 45 5a 17 61 0d f5 b7 +4d 84 ae d2 32 f1 7e 59 d9 1d d2 65 99 22 f8 12 +db d4 96 81 69 03 84 b9 54 e9 ad fb 9b 1a 96 8c +0c bf f7 63 ec ee d6 27 50 c5 91 64 b5 e0 80 a8 +fe f3 d5 5b fe 2a cf ad 27 52 a6 a8 45 9f a1 fa +b4 9a d3 78 c6 96 4b 23 ee 97 fd 10 34 61 0c 5c +c1 4c 61 e0 eb fb 17 11 f8 ad e9 6f e6 55 7b 38 + +# PKCS#1 v1.5 Signature Example 2.18 + +# ----------------- + +# Message to be signed: +31 1c 88 80 05 35 d1 b4 e9 bc 78 65 18 31 a3 e9 +67 e7 4b 58 28 e0 14 11 5f be 5f 60 9c e8 65 fe +d2 41 97 0f 87 2e c8 f2 3d c2 bf 61 6b 80 20 e4 +45 64 f9 34 dc bf 72 38 61 70 07 4d 92 0b a8 95 +d3 3d df 27 93 69 f2 36 a1 9a cd 4f eb 2b + +# Signature: +89 46 63 e6 3e c1 9f 56 20 3f 4a 44 6b 5e 2b 51 +74 c8 14 a5 4c be a2 c8 e2 98 f9 9b 34 c4 bb c2 +c8 b1 77 ba 98 57 d8 1c 85 44 36 bd 99 af 58 c0 +9d de 5a ca d2 d6 41 50 43 fb 40 e7 84 75 ef 74 +01 2e 4d 4f 75 b2 e9 58 85 c8 51 a2 3b 4a 25 54 +93 f3 0c 17 2e ae 01 d4 79 10 fa bd 26 9f 57 94 +0b a4 43 50 6c 05 22 bf 72 8a 25 7a c1 07 3b df +99 b4 29 56 db 00 2a 30 a5 4d bd af 28 4d 8f 69 + +# PKCS#1 v1.5 Signature Example 2.19 + +# ----------------- + +# Message to be signed: +b2 65 a9 77 7f aa f1 58 a8 08 aa e7 08 5a 83 e7 +07 9c ef 80 d5 fc 9d 7c dc 96 3e c9 + +# Signature: +28 1e 88 ce 19 0e 98 62 90 34 36 a8 6b a4 37 27 +16 44 9c c0 ce 8d 55 4f 70 2d 72 52 a0 67 60 af +42 12 1d d0 9b f6 ea 13 f0 eb 25 2e cc 76 42 10 +61 f5 74 4b d8 e3 2c 5a 8c 4f c1 f9 52 1b 3f 5c +29 14 6d d0 59 12 91 ac bd c5 b6 3b 55 1d 22 8a +e5 38 95 b1 97 e6 e2 7a 70 68 aa 31 03 b7 0c fb +30 f4 15 84 5c 7e 52 87 f1 11 4e 4c df b4 01 ed +51 98 64 cf 61 bc 46 9c 66 69 9b 29 60 a0 af f2 + +# PKCS#1 v1.5 Signature Example 2.20 + +# ----------------- + +# Message to be signed: +7c 43 9e 7a b9 90 cd ef 95 6c 42 39 47 9b 49 da +84 2f 8b 76 76 5a 7a d4 89 7b c1 6c 61 ed 3d 09 +80 5d 76 e8 a5 be 8b 57 8b 95 1f 45 45 df 92 a8 +a5 37 ba 3e 2c 13 dc e0 a0 03 e7 b6 24 9e 32 be +94 1f 21 cd a7 25 b8 04 07 be 1e 28 bb 9e 39 37 +38 32 53 56 ec 21 74 1d 5c 86 f3 c2 b4 f7 b9 47 +af d5 6b 2d 3a ec + +# Signature: +6a fa d7 7a 05 6d 07 29 05 86 e9 13 80 9a 04 37 +d3 9a b3 07 32 45 12 b2 f5 bc 2b af 58 0b f4 55 +43 eb 04 ff 83 e9 63 a6 d7 f3 3e 9d ff c1 fc f4 +24 48 c5 fc fa 47 27 19 c6 51 f8 1f 3c 62 22 98 +3d 38 91 7e 29 b4 84 85 87 9c eb b0 a6 1d 38 9e +23 8c 9c 71 c3 68 ed e4 08 3a 94 62 97 f7 19 0b +4c ef 86 7e 9c cd a8 f9 ff c6 19 84 fc f0 5d 4f +ba fe 10 7d ac f5 b1 dc 8e 2b 14 95 b2 44 f8 e7 + +# ============================================= + +# Example 3: A 1024-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +b5 d7 07 b7 92 e0 56 f7 2f d7 6d 8d a8 89 a5 3c +e4 d8 eb aa 08 2a ee b2 30 32 e3 c5 d8 eb c4 c1 +55 61 31 9b e8 df e1 88 99 1a 89 51 d4 b2 3a 51 +e8 a9 38 2c 80 5e 4c fd 49 0e bb ce aa 20 80 2a +d6 83 b0 5a 10 0f 29 98 5f 01 1c 3c 8a 44 26 25 +52 d8 3d 9a 1b 7c 27 31 5e 14 4a d8 df 5c be 8b +c6 40 0f d9 cb e7 6b 74 21 d7 08 aa 64 f0 40 ba +e0 7b 7b d6 f9 22 18 f9 a7 29 28 4c c5 98 cd d1 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +b5 d7 07 b7 92 e0 56 f7 2f d7 6d 8d a8 89 a5 3c +e4 d8 eb aa 08 2a ee b2 30 32 e3 c5 d8 eb c4 c1 +55 61 31 9b e8 df e1 88 99 1a 89 51 d4 b2 3a 51 +e8 a9 38 2c 80 5e 4c fd 49 0e bb ce aa 20 80 2a +d6 83 b0 5a 10 0f 29 98 5f 01 1c 3c 8a 44 26 25 +52 d8 3d 9a 1b 7c 27 31 5e 14 4a d8 df 5c be 8b +c6 40 0f d9 cb e7 6b 74 21 d7 08 aa 64 f0 40 ba +e0 7b 7b d6 f9 22 18 f9 a7 29 28 4c c5 98 cd d1 + +# Public exponent: +01 00 01 + +# Exponent: +45 17 92 b5 94 47 cc 93 78 a8 a4 d6 45 fb 22 ff +4b bf 06 70 61 51 1a c8 36 db 27 43 a6 24 13 6b +18 6b 69 43 a1 cc eb 6f 91 29 0d 93 3b bb 8a c0 +53 a4 74 95 28 23 6c a2 72 cf 77 d9 d3 37 ad 2a +b3 6a 87 a9 15 3c 5e 16 71 6e 09 ba 0b ea a6 4b +31 25 26 d4 a8 c2 dc 68 fe 09 e3 7e 50 74 a0 90 +9d 3f 04 ab 73 90 8a 98 0d ec 1d a7 eb 45 05 a4 +8b ca d3 b6 0d 01 60 84 58 64 a6 51 1f f5 59 a7 + +# Prime 1: +ff a9 f8 e8 b0 82 17 0b 63 73 f0 0d 73 c4 23 86 +d4 02 f2 80 8b 39 3b 32 f7 8f 86 ea f6 4b 21 bf +dd 33 4f b9 aa d1 6b a6 d9 da db c8 94 3a 29 e6 +63 c8 b3 9c 09 59 69 02 5b b9 b2 d9 d6 fe 67 b7 + +# Prime 2: +b6 14 37 8d 5e 3d a5 a8 0a 6d 73 52 fc 66 a5 64 +59 7b 06 8f c9 d3 af 5d b0 e4 e7 35 be f8 81 dd +40 17 ee 70 82 96 19 0b 6f dc 84 04 f0 7b d9 dc +5c d5 d2 be 48 86 a7 cb bc b2 1d 8c 3d 64 a6 b7 + +# Prime exponent 1: +51 0e 68 96 0d 70 11 32 51 23 ae d5 f5 00 18 6b +64 c8 52 6e 22 b5 d0 69 06 48 00 f4 79 85 b4 7b +89 fb fc a8 d6 d9 72 92 01 bb fb b6 8a 18 2e b4 +96 aa 49 17 8d 77 45 6d b3 fb 1a 13 2a b0 99 dd + +# Prime exponent 2: +57 eb bf 3f 76 48 52 5b a8 5d 5d 98 ae e4 69 ec +e1 00 75 14 ad a2 98 45 a7 8b 80 d2 05 1b 3e aa +35 ae d8 a6 5f 88 57 23 9c aa 60 dd 79 ba 74 62 +e2 39 26 00 58 49 1d 71 55 f6 b4 29 e9 e3 56 55 + +# Coefficient: +ee 10 7d c7 ef ec e9 a6 5c 0e 87 78 9a f5 59 0c +93 83 9d fe 82 85 20 da 17 74 ff 80 f7 e5 14 55 +7f ff 10 bd 8c ae 18 46 ef ee 7c 10 d7 a1 2c 4a +05 5c c1 36 e4 a4 ef 25 fd 3e d9 d0 cd df 74 f9 + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 3.1 + +# ----------------- + +# Message to be signed: +98 6e 7c 43 db b6 71 bd 41 b9 a7 f4 b6 af c8 0e +80 5f 24 23 48 8f b4 31 f5 ee 79 2b 6c 2a c7 db +53 cc 42 86 55 ae b3 2d 03 f4 e8 89 c5 c2 5d e6 +83 c4 61 b5 3a cf 89 f9 f8 d3 aa bd f6 b9 f0 c2 +a1 de 12 e1 5b 49 ed b3 91 9a 65 2f e9 49 1c 25 +a7 fc + +# Signature: +62 75 e8 73 97 e3 09 2a ab 36 98 bb 1b 5c f2 4b +8c d7 71 2b ec ac 35 e3 22 03 d5 43 14 e5 47 0e +a9 aa bc 86 57 f5 64 34 e5 af 9f ae 77 8f f6 04 +5c 20 e2 e1 ef 7c bd f8 8f 00 75 f3 3e a9 92 77 +7c b7 e9 2f 7d a1 8a 0f fd 00 aa 46 71 ed 63 91 +1f e9 e9 2f b4 a7 6e 77 dc 6e 0a 91 65 76 71 6c +15 ea ef 08 9a 71 a0 ae a3 5b ed 94 47 a6 c1 7f +2a ad b7 27 fd 42 f0 ac c8 24 62 38 1d 9f a2 ef + +# PKCS#1 v1.5 Signature Example 3.2 + +# ----------------- + +# Message to be signed: +4c 7b 98 12 0c 87 50 90 87 c4 78 + +# Signature: +59 e5 cb e7 33 1b 92 e0 cb 8f 68 9e ae bb 30 f2 +b3 34 a7 46 a6 57 05 59 12 ff 1c 92 76 0b 0b 85 +bc 42 82 f3 18 4b 9a 81 4f 44 37 f8 25 ae 07 d3 +56 ba c6 9e 54 0c 90 94 2c 7f 7e 6f f4 4f e5 74 +f1 21 25 0a d2 30 f4 b5 0c 78 31 1e 4f d3 c9 e2 +65 f5 17 ce 32 97 c3 e1 dd db 5c 86 9c 69 8f 44 +af 52 5e 73 64 01 a8 1b 45 9f 19 8a d1 80 8c cd +92 9d 49 04 74 ca f7 00 5f 91 0d ac de 21 b0 77 + +# PKCS#1 v1.5 Signature Example 3.3 + +# ----------------- + +# Message to be signed: +66 f7 07 54 22 c8 ec 42 16 a9 c4 ff 49 42 7d 48 +3c ae 10 c8 53 4a 41 b2 fd 15 fe e0 69 60 ec 6f +b3 f7 a7 e9 4a 2f 8a 2e 3e 43 dc 4a 40 57 6c 30 +97 ac 95 3b 1d e8 6f 0b 4e d3 6d 64 4f 23 ae 14 +42 55 29 62 24 64 ca 0c bf 0b 17 41 34 72 38 15 +7f ab 59 e4 de 55 24 09 6d 62 ba ec 63 ac 64 50 +32 7e fe c6 29 2f 98 01 9f c6 7a 2a 66 38 56 3e +9b 6e 2d 15 ef d2 37 bb 09 8a 44 3a ee b2 bf 6c +3f 8c 81 b8 c0 1b 7f cb 3f eb b0 de 3f c2 5b 65 +f5 af 96 b1 d5 cc 3b 27 d0 c6 05 30 87 b3 96 80 +e4 92 a4 ab 23 67 47 11 69 e5 28 38 94 5d ba 9d +d7 72 3f 4e 62 4a 05 f7 37 5b 92 7a 87 ab e6 a8 +93 a1 65 8f d4 9f 47 f6 c7 b0 fa 59 6c 65 fa 68 +a2 3f 0a b4 32 96 2d 18 d4 34 3b d6 fd 67 d0 0b +25 b8 1b 09 b5 62 03 85 64 + +# Signature: +59 9e 69 c1 54 e4 fe 66 b3 6a 69 04 92 fa eb b2 +bb e7 34 e0 41 5d 9f 3c f7 e3 78 28 f5 3e 61 13 +04 49 17 3a 33 46 0c 6b 4c 8d c7 d6 81 ca 6f 4d +af 1c b8 16 d4 0a a9 08 2e e1 93 7b e4 bc 6a 09 +c6 de 79 8c 82 86 fc d2 a2 b2 19 6c 59 99 4c 93 +7f 37 13 07 52 61 2c 6b ff 6d bb 53 e0 64 7f 88 +58 bc 38 38 64 02 1e 6d 56 68 19 20 24 92 97 82 +22 46 a0 f5 28 aa b3 ed 18 5e eb ce 91 9c f8 3e + +# PKCS#1 v1.5 Signature Example 3.4 + +# ----------------- + +# Message to be signed: +d9 34 44 28 fa 8a 58 f8 fa 7b 44 3e 51 fc 9b 51 +e3 7a 70 21 0d b8 bd 1d e7 f8 67 5d 84 79 ff 65 +7c a7 29 55 b2 3c 6f 4a 09 16 37 9a 4e de e1 f2 +6c 85 e0 52 90 21 1e eb 25 83 2b 09 cb e5 ea ed +3e 39 65 b0 5a 52 fb 5b 16 49 11 82 c5 91 3c b1 +82 57 48 e8 1a d0 14 f1 3d 29 6d c1 69 57 08 2b +1b 83 b4 be 50 a0 f9 59 c9 e7 f3 aa 80 77 97 2e +2b 93 c2 ef fd 9f 30 86 25 b8 ca 7f 54 d7 b6 96 +48 79 04 47 ac 91 f7 98 5e 51 0d f7 0d 6e bc 35 +72 c2 05 e6 + +# Signature: +2c 06 01 65 fc c5 65 5c 06 57 c8 fe 08 e0 5b dc +8c d7 7c 1f ec b6 d1 8b 89 38 11 c9 9d d0 91 e0 +d8 50 6d cc b4 9e 33 da af f6 da 96 7b 99 e3 44 +cb 17 fa 3c 96 31 29 9b 35 89 81 8b 37 ed 9d 5d +78 94 e4 a6 9d db 24 83 2e 1a 88 60 01 4e e5 e5 +eb 95 3e 8b 35 48 4b a4 fe c9 c3 03 3a e2 e1 18 +9a f7 94 a7 2e 42 67 21 5b fe 45 8f 0f ce 6b 37 +a5 54 9e f8 05 43 d0 d4 1a 87 b2 c6 e4 d8 4c b5 + +# PKCS#1 v1.5 Signature Example 3.5 + +# ----------------- + +# Message to be signed: +8c 67 02 da af 58 f6 a4 75 fa d2 c7 a4 bb 15 6a +57 06 42 55 77 d5 e3 0c 6a 6b d3 66 9f d0 30 af +d7 89 fa a3 d0 10 18 d4 5d b2 a0 47 f5 2c b4 f6 +3d ea 36 09 42 af e4 76 26 42 06 d9 83 ad 38 36 +e1 55 c5 6b 2e cc 08 76 3a fb 9f d5 1d 19 99 0e +fc 33 63 f6 57 e2 85 e0 35 21 e8 ca d0 1d 2c 93 +5a 18 3a e2 3f 0e e8 71 00 86 a8 5b 9f ad 4e 7f +2b 09 45 2e bc 40 3c e0 c0 e5 75 5a 7b 2f 33 f4 +de f0 db 71 c9 79 31 ff 90 4a 81 31 99 84 bd c5 +16 6f 6b 92 0c 97 ee 74 fb 7e 89 0f 49 0c 90 de +30 ca c9 76 b7 17 23 e2 f8 6e 9d e1 d5 03 a4 1b +c8 1d 53 cc be f8 ac 40 53 57 d9 df df 30 64 66 +b4 26 95 80 21 2e 9d 71 32 + +# Signature: +0d 89 fc f8 44 a9 dc 22 3d 5f 63 8d cc 3a 59 78 +71 6f 26 28 b8 a8 3a b3 3e 6e 25 5f f8 aa 01 57 +8c 14 e3 89 7d a4 5a ef d6 3f a8 7c f3 5e 24 4b +f4 82 8e cd 21 95 0f 30 85 a3 66 21 c9 da 1b be +7e a6 27 31 c6 8d 4d e0 a3 76 e2 2d ac 2f 54 8c +d4 ba 4a 54 2e 71 0f 55 ce 85 a9 c1 95 93 c0 8c +87 d2 96 d6 35 87 b3 fe 2c 5d 11 65 ee 27 74 4c +75 d8 f4 f1 43 71 63 7c 0c 0a 44 62 76 28 95 83 + +# PKCS#1 v1.5 Signature Example 3.6 + +# ----------------- + +# Message to be signed: +56 f4 ff d1 27 9d cf e5 62 a9 dd d4 1e cd f6 0a +3f f5 82 46 bf af 95 65 cf 67 4b 0b 90 75 f4 0e +ea c0 8f 0b 89 66 61 8a 19 6b 12 28 eb ce 93 fc +9d d7 9b d4 63 ea 7d 2c 97 4d 2c 2f 53 9e af b1 +b2 bc 1e a3 4d 74 f7 20 e1 19 34 2f f7 13 12 25 +aa 9a da 89 4b 76 b2 ec b1 2f 2f 40 28 44 b4 42 +5c f8 f1 a3 9b 0a 9c 83 b4 5b 03 cf c0 d1 5f d3 +14 d6 ab f5 32 b8 ed fc f2 36 51 4b 2e 45 86 97 +86 fe fe 27 f5 4d 66 6e e5 24 e4 b9 c0 53 be 39 +75 01 58 29 91 fa 2d 80 2c 7d 1b 17 8b 23 e9 b6 +ec e6 fd 2e f0 13 2c 06 01 a8 6f 07 68 ba dc 59 +c5 cc 33 f2 4d ed 55 4a e5 1a e3 ec 23 f9 dd 08 +9e 32 4a 68 21 f6 15 7f 12 84 42 ac 58 07 65 8a +d3 40 26 b8 fc fd a6 dc 7f 02 a9 3c 16 6e c9 45 +ee + +# Signature: +0d eb 39 7b f2 cf f9 79 d4 71 9c 64 8b 0a 35 25 +35 1f 5e 08 40 5c a2 61 4a 83 e5 6a ce 86 f5 52 +e4 1b b9 28 de 50 f0 bc 0f e3 1a 2e f2 ad 79 9f +d3 cf 47 42 b1 13 1a 37 bd 08 f2 a1 3c ac da 67 +f4 95 c9 f1 a9 ef 64 85 70 72 32 9f 00 cc 4c 01 +22 35 59 9a 83 fc 45 94 fe d9 23 03 49 01 ed c2 +7d 5f 05 79 98 34 93 5c ab e2 64 ff c1 96 63 71 +4d 8c 3d e8 e9 61 9f d2 84 2d 22 98 f7 a7 2c 99 + +# PKCS#1 v1.5 Signature Example 3.7 + +# ----------------- + +# Message to be signed: +0e 79 ac 9c 9c 03 96 d9 69 fb 3f 7c c9 94 7b 07 +8b ac 49 3b 03 52 c8 e0 cd e5 46 3e a5 c1 18 4f +d5 2a 1f b7 48 19 3c 14 7a 74 80 0d 24 f7 51 ba +93 5e 19 c9 11 5e df 07 22 88 33 0b f3 83 f4 95 +29 6b e1 aa 4a 50 95 b9 57 3b cb db 22 8a 43 13 +12 37 86 5d 26 df bf cf ef 07 8f 35 9f 9a 95 62 +e2 5b 69 63 85 e1 28 13 ff fb c8 d5 29 81 9a 91 +45 1d 33 a5 07 26 39 2e 4f ef 29 41 8c ca 2c 73 +a0 68 e6 0e ae 31 84 70 33 1a 0f 1d b4 bb b6 37 +17 3b e8 0f ea 03 c8 2c 15 d0 01 93 36 2d 3a 18 +ad 9e 2f 68 05 00 d7 26 5b 15 57 03 3a 52 09 77 +d8 10 fc + +# Signature: +73 3b 7f ea 12 0c a5 f0 35 9a 89 05 75 0c 49 c3 +63 d8 84 f5 6c 2b 7a 72 9f ad 7b ff 44 5a 1e 54 +79 89 41 74 53 93 e1 76 77 12 ac 4b 9d d2 68 38 +88 d9 e6 8b 90 5d ba b8 79 21 85 18 48 72 73 86 +02 ea f4 a8 0f 45 95 f7 8f d4 a4 61 0b f8 22 0b +86 a2 88 5f da 24 e1 99 64 28 cc d1 5f 20 08 e0 +68 51 b2 ee ad c3 dc 8e 03 01 2f 9b db 3c e0 57 +5d dc 3a dc 7c 59 08 49 8b 69 a7 97 ba 58 29 c7 + +# PKCS#1 v1.5 Signature Example 3.8 + +# ----------------- + +# Message to be signed: +22 eb 7d ba 73 30 7c 7c 52 a0 7c ed 89 db 8b c5 +39 4a ed 22 72 f7 e8 1a 74 f4 c0 2d 14 + +# Signature: +9e a4 60 0a 1a 65 49 fd 39 75 f6 49 8a 04 d6 9f +96 fa d0 e8 e6 fe bc fb e0 1c 2f 83 17 0b c7 4e +b9 1f 2e 33 53 38 d5 83 e8 85 aa c6 14 24 c9 b2 +66 c3 d2 d9 8e 79 77 ff e4 95 f9 c1 a6 ee 5e f4 +1a 4c c7 47 8c 24 b3 16 c7 d9 f6 db aa 65 a4 ca +de f1 81 ca 94 6f 9b 92 18 4f ae ca 8a 13 16 ae +ab 5c d3 87 8c 6d f0 74 f9 06 0b 9d b6 6d ec e9 +a9 36 7d 75 49 03 5a c6 bf 19 62 36 5e 1f d3 fc + +# PKCS#1 v1.5 Signature Example 3.9 + +# ----------------- + +# Message to be signed: +f6 80 + +# Signature: +51 63 90 61 fa 7b 7c d5 df 64 b3 0a 39 4c cf 7e +24 26 97 2a a1 dc f5 d4 5e b8 ec 2c d9 0b 9b 19 +68 92 be 5f a0 3c 43 f3 c3 72 3a e3 13 0d 61 51 +b3 3a 63 7c fc 50 ba 35 26 a7 39 6c f8 47 9c 50 +8c 18 11 81 0d 68 b3 88 0a f6 e6 4b 16 bd 70 79 +be 9c 00 39 29 51 22 61 89 8f a5 7c 06 ff 7e 1d +80 39 fa 99 3f d2 05 6a c7 01 9b 8d bc f2 53 0d +53 80 e6 01 a4 a1 87 1b 86 c2 0b c1 c4 89 c5 f3 + +# PKCS#1 v1.5 Signature Example 3.10 + +# ----------------- + +# Message to be signed: +65 0e 64 ed 1d a8 8b cf 8a e2 75 22 be 1d 5c 99 +19 f2 09 9d d6 32 45 5f 66 d9 af e8 ba f4 6c c8 +a1 98 40 9b 09 28 dd 87 22 62 84 d6 69 bf 01 bc +ec 44 37 6c b0 e9 bd c6 86 ac aa 8b 46 34 86 08 +59 94 ca fb 5a 8c fc 33 d4 9c ee f4 79 fc 6e 04 +f8 ee f6 37 eb 68 cb 57 81 8d 5f 97 70 ac 52 3e +d5 b0 16 38 36 7f f4 7f + +# Signature: +50 3e 05 66 1d 68 1e ca 57 4e 02 30 af 2d aa 87 +7b 90 51 6e 5e 19 72 8c 91 76 8d 6e ef ee 00 1b +35 41 9c 5f cb 56 11 d6 0e 7e cb e3 c9 5e 5c 88 +ba 93 46 07 04 f1 69 4a e8 04 44 eb 97 18 a0 8b +66 86 fa d8 6e 52 59 90 c3 c1 a6 6c 8c 53 aa 31 +ae d8 cb c4 0f d5 4f 5f f8 a1 34 74 9d 79 d3 8f +bb 0d 58 44 26 78 ff 2f 70 c6 c5 0f 25 47 2a 72 +d6 32 05 e7 82 42 3d f4 0b 6c 43 de 03 a1 8f 8b + +# PKCS#1 v1.5 Signature Example 3.11 + +# ----------------- + +# Message to be signed: +57 f8 ac 6a 9e 46 8b 7f 1f 74 5d ff e3 9e 9c bf +90 24 a0 ff 36 e0 22 83 92 be 6b 29 94 29 17 76 +b8 9c 0a 4b 1f a8 6b 2e c8 bb 7c 3e 64 f5 58 5a +fa 77 + +# Signature: +90 be 16 b4 08 b3 85 73 95 39 b3 b9 a2 9b 94 c7 +29 38 5f 79 dd 4a 79 81 1e 6f 67 c8 0e d3 59 e5 +f4 b2 a1 9c 22 2a 82 b3 d6 d6 2a 90 3f b1 80 c1 +f4 3c b3 fe 06 a2 50 bc b0 e7 c6 88 66 5c 83 68 +a1 1a b1 16 0a db 74 02 91 35 2b 38 38 b6 92 3a +4a 37 ad 06 04 0a 53 59 20 dc 0f 10 57 9e cf 48 +1c d4 41 37 17 d7 d4 d9 60 aa 75 1a 74 3e 2f 7c +61 6e 54 2e e6 5f bb fe 24 66 0e 10 1d aa 2b dd + +# PKCS#1 v1.5 Signature Example 3.12 + +# ----------------- + +# Message to be signed: +80 ef 01 aa cc 5b fb 0d b4 8c 6d e3 d8 14 95 b9 +c2 31 1a 38 93 89 f2 3b 70 c0 24 da 44 78 bf ab +2b fe 4e 54 6f 13 ff fd b9 63 89 4e c6 da db 3d +2b 0e e3 37 f1 16 31 05 8e ac 86 09 e5 a1 55 4a +f7 97 a9 f9 ab 47 8c 2d 5b 91 88 c8 25 + +# Signature: +44 c3 f5 1d cc 6f b2 b4 e7 0f 53 7f 54 64 c6 32 +0a d4 2e 21 28 fa df d9 a7 e9 37 cd 65 dc bf 35 +ac 66 cf fa fd 39 28 39 66 f2 f1 5d e5 27 72 35 +50 71 5a 31 04 29 45 e2 00 cc 5c 86 fa ba 5e c8 +ab af 50 9c 0c cd 64 d9 9d ed c7 6e 3c ea a8 c4 +47 17 93 37 f4 a0 77 7b 11 52 6e 47 2a cd 41 3b +4a c7 c3 03 cd cd 84 ca fc 02 52 43 ef 00 6f 79 +dd af 55 c1 5c c4 a8 f1 5e a2 c8 7f 05 77 38 14 + +# PKCS#1 v1.5 Signature Example 3.13 + +# ----------------- + +# Message to be signed: +ac 17 95 91 55 28 3b 0c 7c ff 51 5c 33 15 d8 9b +df e9 58 7c c0 01 20 d3 ab 31 bb 76 07 bd b3 01 +ca ea f5 e1 5f 5a 6f 58 c9 c5 68 ff b3 d2 34 02 +51 6f fe 23 0c 69 81 a8 1c 17 8a 8a 18 ca 33 0b +b8 ec af b4 81 b2 49 b4 66 a8 cf 78 b7 0d 9e 78 +a1 39 a8 8f 48 4c ce 7c 20 35 b2 e8 9d 49 3b de +88 5e 1c de 42 cb 1a 94 49 ff 57 0d cf 9e 33 c5 +cc 77 b2 59 be e2 83 05 39 68 02 ed c1 6f c5 a8 +e1 0b 56 da 2d a7 86 b5 fb 6c 81 2b 2e 17 5b 69 +6b 1a 9a 96 fc 72 2a 43 21 46 45 0f 07 a6 48 ef +3c cf 99 6e f3 08 1f a5 bb 42 21 c9 13 ba 22 28 +97 0c 9b 0e a5 26 6b ff + +# Signature: +48 45 8c 72 f0 67 dd 9a b7 20 ef 16 0c f3 18 4b +b9 80 1e 26 d6 14 a8 89 a8 35 84 41 07 ac 01 65 +0b 11 84 a0 0b ca a7 af 1f f7 de 3a 2e f2 e7 ce +b5 b2 5c 3b 5d 5b cb 29 86 59 34 32 47 48 c6 8f +07 de 17 4e 17 80 a7 0f a2 4d 6a 3a 9f 7a 41 b8 +19 37 c4 98 4b 2c be 06 b3 d7 b4 4c da e9 cb d4 +16 32 d0 09 43 c3 b5 73 b1 aa 29 12 75 0a 9a eb +07 f1 10 13 0b a3 61 dc f8 f5 36 79 0d 60 78 47 + +# PKCS#1 v1.5 Signature Example 3.14 + +# ----------------- + +# Message to be signed: +99 09 8f 77 f6 ed 35 c0 8f ab 3f a9 78 86 93 67 +1a 58 00 dc 30 3c 9c ce 42 46 16 fa 0c 7e e8 88 +86 87 67 4c a8 8a b2 2a 5f f2 d1 2e 2b 38 8b 09 +4f fd 7d bf 9a 09 27 a9 62 17 17 15 1e 08 ec b8 +ad e1 55 9f 4b 48 e2 3d 31 cf 57 cd 38 84 df e2 +b3 e4 b2 60 e8 96 02 94 07 96 94 96 02 6c 74 a2 +18 90 d9 a9 af d2 cb b8 f2 83 0a 56 6a ed 24 f0 +16 19 74 01 a8 cd 22 c8 2f b8 b2 28 91 84 58 24 +0a 23 d1 01 85 eb e7 72 dc 19 bc fe 3e 44 92 2f +e7 32 09 c1 ee 00 40 07 9f b0 3b 82 7c 82 17 d9 +ed 7c 98 c9 5f 30 97 4f be 4f bd dc f0 f2 8d 60 +21 c0 e9 1d a6 0c a2 ad 77 79 7e ce 86 de 5b f7 +68 75 0d db 5e d6 a3 11 6a d9 9b bd 17 ed f7 f7 +82 f0 db 1c d0 5b 0f 67 74 68 c5 ea 42 0d c1 16 +b1 0e 80 d1 10 de 2b 04 + +# Signature: +b4 6a e8 66 13 91 89 b6 b1 71 a7 62 05 fb 9c e0 +41 b4 02 98 e5 ba 92 c2 e9 cc 0b bf bb 4a 76 42 +5d e6 ce 13 02 1a e1 a4 a9 42 29 9f 98 ff 89 f5 +52 f4 3a 90 73 de 64 f4 9c 2c a3 62 0d 09 d7 e6 +e3 fe 28 22 1e 93 68 98 7e 11 0c d6 06 71 06 c4 +db 31 a0 38 90 23 67 96 c8 42 52 f5 6c 95 03 4a +01 c5 fe 98 1e 81 b6 54 85 5a af 27 47 50 11 55 +72 0c 21 93 f3 a1 d1 0f 49 fe e9 0c 52 fe e9 e4 + +# PKCS#1 v1.5 Signature Example 3.15 + +# ----------------- + +# Message to be signed: +ff 79 06 42 30 5b f3 02 00 38 92 e5 4d f9 f6 67 +50 9d c5 39 20 df 58 3f 50 a3 dd 61 ab b6 fa b7 +5d + +# Signature: +07 56 32 47 73 4f 3c 3d 7a 31 02 bc b4 5b b5 68 +15 68 ed 10 f2 ec 45 9e 46 9e 1a 9e 34 09 a1 39 +fb 15 1b 98 d3 f3 b6 2d aa ac 8b 8f 89 16 df 85 +d6 df a9 ab 76 0d f1 e1 5a c8 90 44 e5 79 cf 47 +a1 af 6c d6 ec 70 4c ed 9b 03 4c 6a aa 90 d0 e7 +0e 08 52 14 0e 75 41 f2 ef be 2c f1 90 b9 58 94 +1e c8 b5 97 4f 9c 44 4d 26 c3 43 16 c9 21 6b 65 +95 e6 56 bc 6c 78 44 fa c1 6c 51 52 60 92 8e 78 + +# PKCS#1 v1.5 Signature Example 3.16 + +# ----------------- + +# Message to be signed: +e9 9f cb f8 59 2d be 2d 7e 27 45 3c b4 4d e0 71 +00 eb b1 a2 a1 98 11 a4 78 ad be ab 27 0f 94 e8 +fe 36 9d 90 b3 ca 61 2f 9f 22 d7 1d 54 36 3a 42 +17 aa 55 11 3f 05 9b 33 84 e3 e5 7e 44 52 28 80 +62 af c0 8f cd b7 c5 f8 65 0b 29 83 73 00 46 1d +d5 67 6c 17 a2 0a 3c 8f b5 14 89 + +# Signature: +22 74 64 36 16 4e 63 93 78 71 c1 d4 7d 8e 3e 70 +c9 e5 2d 11 17 31 6b b1 54 cd 55 2e 83 6f 2a 3f +be 6d 89 d6 07 4b 51 b0 15 9c 26 c2 8d f7 5e 3d +7c fb 7c f0 02 f6 5d 1e e5 21 ed c2 c3 a6 5c 52 +6c 98 c7 c0 25 fa 8b b6 31 47 09 16 d3 01 b8 f7 +80 9d dd 91 9d ed 31 a0 d4 66 83 ec 5b b4 41 70 +61 6e ab cd 97 02 05 ed 76 02 02 d0 d8 7a 65 79 +59 08 b2 8d 32 6f 93 62 13 f2 9f eb 59 77 34 91 + +# PKCS#1 v1.5 Signature Example 3.17 + +# ----------------- + +# Message to be signed: +6a 6a 0c 9b 5b 15 bc da 19 6a 9d 0c 76 b1 19 d5 +34 d8 5a bd 12 39 62 d5 83 b7 6c e9 d1 80 bc e1 +ca 4a f8 70 fb c6 51 60 12 ca 91 6c 70 ba 86 2a +c7 e8 24 36 17 30 6f 4f 9a b9 50 11 99 ce f5 5c +6c f4 08 fe 7b 36 c5 57 c4 9d 42 0a 47 63 d2 46 +3c 8a d4 4b 3c fc 5b e2 74 2c 0e 7d 9b 0f 66 08 +f0 8c 7f 47 b6 93 ee 40 d2 e1 80 fa e1 ea c4 39 +c1 90 b5 6c 2c 0e 14 dd f9 a2 26 ba e1 7d 20 38 +5d 50 19 55 82 3c 3f 66 62 54 c1 d3 dd 36 ad 51 +68 b8 f1 8d 28 6f dc f6 7a 7d ad 94 09 70 85 fa +b7 ed 86 fe 21 42 a2 87 71 71 79 97 ef 1a 7a 08 +88 4e fc 39 35 6d 76 07 7a af 82 45 9a 7f ad 45 +84 88 75 f2 81 9b 09 89 37 fe 92 3b cc 9d c4 42 +d7 2d 75 4d 81 20 25 09 0c 9b c0 3d b3 08 0c 13 + +# Signature: +41 93 22 fa ca ce 76 f2 d5 e2 fb c1 9a ab 86 c7 +18 a2 80 64 f1 d7 b4 c6 62 f0 47 4a 87 77 a9 59 +bd 65 69 53 8c 16 08 1c 0f 52 69 8b 2f 00 17 30 +c0 3b 9a 3d 26 94 73 74 c9 61 fd ed a1 15 b6 b7 +da f6 65 18 f1 fe 82 0f 67 c3 ff 12 f0 bc 3f 11 +01 e3 91 1c 43 90 6b 0a 12 7e 50 be 01 40 c5 ef +c4 35 e2 95 7b 44 2e 60 ad 52 5a d7 0a c9 ef 61 +c3 d6 4f 0e 56 6c bc 1f 9d 51 ba e1 d4 72 71 da + +# PKCS#1 v1.5 Signature Example 3.18 + +# ----------------- + +# Message to be signed: +3b 93 ef 4a 55 50 96 69 19 15 dc 23 c0 0e 95 4c +de b2 0a 47 cd 55 d1 6c 3d 86 81 d4 6e d7 f2 ed +5e a4 27 95 be 17 ba ed 25 f0 f4 d1 13 b3 63 6a +dd d5 85 f1 6a 8b 5a ec + +# Signature: +ae 21 1f 4f 77 da 1b e6 af 9c 9e a7 04 db ac 4b +3f 3e 27 0d 2f ac f3 65 1d 78 7d 0e bf 59 a7 9a +39 61 2d a1 2d 57 c4 ac 8a bc 72 8e 1d a3 f0 1a +15 20 fc 9b 32 cb 0f fe 00 8c 80 69 92 8f 83 e1 +35 90 a7 8b 81 7e 81 9f bf 2f d0 58 93 ec e5 b1 +41 86 d9 01 c7 68 e3 42 dc 54 72 23 45 ae 8a a8 +73 8d 4d 59 70 c5 08 54 72 bd 98 99 fa 00 42 cf +14 bc ed ff db c0 ef 50 81 90 75 84 2f c3 6b b8 + +# PKCS#1 v1.5 Signature Example 3.19 + +# ----------------- + +# Message to be signed: +49 ff d5 6b f7 ef c1 13 04 a5 af bc 19 d4 79 24 +90 18 fd f4 e0 9f 61 87 26 44 04 95 de 11 dd ee +e3 88 72 d7 75 fc ea 74 a2 38 96 b5 34 3c 9c 38 +d4 6a f0 db a2 24 d0 47 58 0c c6 0a 65 e9 + +# Signature: +68 fb 0b d5 19 bf 6f 96 e0 76 af 29 01 2f 3c 3a +11 37 c0 98 8d e7 b6 fc ed f4 f5 1b df ee 64 5b +89 7f 17 70 9e 05 ca a0 b1 13 50 0d 90 4d c0 60 +0d 17 a9 ff 8e b0 2e 1e fc 9c 46 7a 24 00 3e f8 +1e 72 74 67 c4 7d d6 56 35 6d 70 37 2a 15 ea 88 +41 21 63 4b 01 5d 29 51 1f 28 95 55 77 99 07 9d +03 c6 d4 de 25 9b 3b 36 2b 80 49 2d 81 bc 9f e8 +54 44 63 ec 03 0b b5 c9 c7 3c 32 74 e3 ed 12 22 + +# PKCS#1 v1.5 Signature Example 3.20 + +# ----------------- + +# Message to be signed: +bc 25 5a f8 9a 6a 19 9b ca 4a 39 1e ad bc 3a 24 +90 3c 0b d6 67 36 8f 6b e7 8e 3f ea bf b4 ff d4 +63 12 27 63 74 0f fb be fe ab 9a 25 56 4b c5 d1 +c2 4c 93 e4 22 f7 50 73 e2 ad 72 bf 45 b1 0d f0 +0b 52 a1 47 12 8e 73 fe e3 3f a3 f0 57 7d 77 f8 +0f bc 2d f1 be d3 13 29 0c 12 77 7f 50 a3 34 db +6f ae bf 11 08 1a 04 f8 7c 2d 62 1c de c7 93 0b +9b 18 3a 99 04 75 dc bb 9c c7 f3 45 a3 b5 58 03 +03 0c f0 36 1a 5d 80 81 + +# Signature: +41 f6 52 df 79 fd d2 6d e9 5c 7a 98 fa 85 87 13 +fb 56 6d 8b 39 92 8e 71 76 4b 2b eb 19 84 03 e0 +3b 7e 06 dc 96 0c 50 51 57 bd f4 05 92 c4 d7 75 +03 fb 72 a4 e0 05 5f 97 4f e9 39 44 8d a3 68 f5 +3b d2 ef e2 6e 6f 9a 25 4b 3e 87 32 aa d8 16 87 +b3 61 e2 1a 40 cf 3e 5e 92 38 9a 2b 48 9c 05 c5 +97 f0 e1 64 e2 67 70 93 72 00 43 27 16 35 62 dd +8a 0a db bd fe 3b c6 16 bd 08 42 96 84 c2 0c 69 + +# ============================================= + +# Example 4: A 1024-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +d1 31 e0 92 43 37 0d d2 cd 54 25 c8 d0 30 f9 9a +db 10 5b 14 7b 8a 3d 00 67 c6 16 44 3b 7d 4b 96 +82 38 e0 6d bb 5f 20 28 e8 53 57 4b 7c 14 be 10 +83 c1 e5 7e 13 2c 1d f4 a3 a2 71 32 63 fa de 12 +f7 11 4f 43 69 bb f0 56 20 55 48 41 33 1e d8 11 +00 50 52 19 25 72 ce b4 8d 66 24 07 fd 30 81 cf +ab 8b 48 c7 e9 2d 3c 4a 26 a9 64 5a 38 e6 de e8 +8b b0 07 59 75 a4 da d9 64 6b 21 60 38 40 af 5f + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +d1 31 e0 92 43 37 0d d2 cd 54 25 c8 d0 30 f9 9a +db 10 5b 14 7b 8a 3d 00 67 c6 16 44 3b 7d 4b 96 +82 38 e0 6d bb 5f 20 28 e8 53 57 4b 7c 14 be 10 +83 c1 e5 7e 13 2c 1d f4 a3 a2 71 32 63 fa de 12 +f7 11 4f 43 69 bb f0 56 20 55 48 41 33 1e d8 11 +00 50 52 19 25 72 ce b4 8d 66 24 07 fd 30 81 cf +ab 8b 48 c7 e9 2d 3c 4a 26 a9 64 5a 38 e6 de e8 +8b b0 07 59 75 a4 da d9 64 6b 21 60 38 40 af 5f + +# Public exponent: +01 00 01 + +# Exponent: +56 b5 31 bb ee 18 37 a6 94 6c b8 6c 8f be 7c f6 +ee ad cc d2 a4 92 1b ce bb 34 a3 ae 0c 6a 56 96 +3f cb 8b 5a 70 3b 71 7d 03 2e e8 13 e5 8e 43 69 +5c f3 55 47 f8 72 64 c8 2d ba fa e8 44 00 8b 62 +d9 12 2e 9d e8 95 85 60 c8 db b0 07 72 7e 71 39 +e0 a9 82 e0 75 88 14 11 3d e5 4b a0 a4 55 17 51 +fc a0 fc b1 2d 8d e3 0d 78 b8 b1 12 98 a7 f7 8f +0b 08 8f 16 87 05 3c 84 a5 76 2f 62 a4 bd 05 c1 + +# Prime 1: +ee 22 a4 24 62 f7 71 8d fe cf 02 4b 17 c9 26 76 +78 05 91 71 33 9c c0 07 06 52 60 d3 04 7e 5f 89 +fe d9 10 34 28 43 37 8c 22 68 5d 53 2e 84 d2 59 +3a 7c 8c 02 6a 87 66 c5 a2 b2 ed 55 8e 88 23 19 + +# Prime 2: +e0 e3 70 0c 99 a3 e8 15 d7 4b 75 2a 84 fb 42 ec +20 e5 20 3c a7 c1 af 97 fb f3 97 b9 5d 11 05 37 +6c f5 d6 3e 3c 57 bf a6 58 55 e5 08 14 6c 86 db +aa b2 89 c9 5b c0 45 5a 58 2d d8 f5 3f fb ed 37 + +# Prime exponent 1: +d1 f1 34 68 e7 df 62 fb 5e b3 be 3f d9 de 7a cc +63 0f f5 a3 a9 6e fe 54 b3 1c 19 44 b0 67 81 6f +35 80 c4 aa 56 fc bb 92 0e 1b 98 7b 67 3d ad fd +00 75 21 32 58 1c bb 5c 6e 0d f4 f3 42 cf 7e b1 + +# Prime exponent 2: +ac d0 da 38 34 90 ea 36 6e 7d c4 09 ea ab 13 20 +55 9e fd 88 de f9 4e 30 a3 22 ec 03 3b eb 6a 70 +cf 40 93 64 bc 06 4a 76 50 07 a1 ba f5 c6 f8 53 +31 f7 85 3e c1 4d 1d 7e 71 a8 b9 c2 ad 6a b1 3d + +# Coefficient: +1e da 83 d4 a6 d0 99 b6 0b 2b 2b 84 c6 ae 41 65 +c7 22 50 3e bd 37 3c 83 6f 97 35 ca 3b 20 a3 eb +08 1b 31 e7 83 04 13 20 df c6 dd f9 05 14 ca b6 +ec 4b 80 ae 0c 05 2d d1 e7 ce 34 18 ae ee 24 a4 + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 4.1 + +# ----------------- + +# Message to be signed: +2c 93 6b f6 13 3a 96 93 f1 46 ee 5a 1a 91 c2 f1 +69 b2 e6 44 a5 18 e8 5a 75 f6 e4 3b 56 0d 4a 72 +f3 8c 64 f8 4c 05 24 0e 8b 4e 55 78 61 63 e7 27 +62 65 ba 21 3b a9 3d ee 1b 2e 10 21 35 a9 89 b6 +24 8e 88 32 7e 30 03 61 a7 4f 2e 9b c4 1f 2a 37 +68 3f 1a 1a 15 f9 dd 47 2e 11 8e 1c 4b 3e de 58 +dd 70 f3 ba cc 25 2e 0c 65 4b 0f 7a 6e 41 a9 28 +75 10 ef a0 3b c9 2e 80 5e 5b 2c 91 3f 51 e2 5c +7f 85 86 40 ca fa c9 d3 c9 17 68 65 07 fa 94 f8 +86 6f 86 9a 4e 5a 6a 3d 4f 9d 97 ed 81 37 f4 14 +d1 44 7a 86 ee f9 e1 49 69 94 ad 2d a5 97 + +# Signature: +9e 93 f7 ac c5 0f b3 a0 b1 24 3d c3 38 c8 cc b1 +2b ca b4 aa 45 04 40 b6 30 6c 81 b5 0b 8f 95 a9 +36 dd 16 63 30 c6 99 b2 85 80 da 1b e2 75 61 64 +02 da 85 bf d8 ee fc d6 99 35 87 e6 09 28 65 d8 +25 3b 04 08 1d 57 2f 26 27 59 f5 56 df b9 11 e8 +d9 4e 92 e5 5a f6 d5 89 80 18 ff 33 e5 f6 b1 f9 +90 19 96 e9 2f af 33 6e 2d cc e3 ab 0a 93 db 93 +2e 94 2c c6 47 8d 6c c2 fb 66 08 11 91 0c cd 17 + +# PKCS#1 v1.5 Signature Example 4.2 + +# ----------------- + +# Message to be signed: +94 32 3f 7c 38 b9 95 cc 6b d8 5d 47 9f 8d e2 de +c1 ef 2e 84 b1 fe ef ec f3 91 50 b5 d9 f2 cb 15 +85 ac 0d 71 9a b3 48 bd c9 75 0d db 8e 32 76 db +89 81 87 35 bd 62 31 41 3c bc a2 de 94 1b 55 e8 +cf a1 ab 13 2c c7 8a a4 f2 b5 1f d6 57 8e e2 e0 +32 e9 0e 34 08 0f 0f 8e 3d b1 4d 1b 56 f3 d0 77 +f2 9d bc 02 16 a4 13 44 99 8c 0f e1 ab 41 22 47 +df 21 e7 4e c2 2f 5d b0 14 8e ca f4 73 ee ec cc +14 ff 9e 45 d5 8c 2e 62 b5 fe 6a 50 1a b9 6f d7 +c5 ed de f1 4a a8 92 66 69 2e + +# Signature: +09 40 2a 43 56 be 73 44 9b 46 9e 36 31 e1 b0 23 +07 c5 ca c2 ce 15 28 d7 84 fa b9 26 df f5 1f 86 +24 1b 9d 66 f7 9d 6d 8e ee eb 24 9d 76 fa 9f 16 +6f f9 a8 c6 a3 9e 83 2d 5d 14 b9 d7 ec 5a 3d c2 +8f 01 eb b0 6e 39 d5 9e 84 61 b9 55 b2 a7 f5 b1 +f2 04 b0 4c c6 cc 62 64 61 61 ac 1c 2b f5 ba b5 +0f 06 8c 90 8d 28 de 5e ae f7 e8 eb fc ab b0 9b +7d 75 d8 35 40 dd 4b 35 4d 13 1d 86 f0 77 07 17 + +# PKCS#1 v1.5 Signature Example 4.3 + +# ----------------- + +# Message to be signed: +0e 23 3b 25 49 bd d2 1b a5 14 80 da 8e 3d ce f4 +db 20 e0 dc c0 5e e2 37 35 1e db c9 a5 3c 52 f6 +74 d1 05 fe c0 93 9d 36 99 64 7e fc 1e 25 cb 4e +9b 1a b7 52 ab 6f e2 88 69 ff 73 f2 3e 01 ee f8 +67 4c 53 5c 4c 93 35 f7 98 f1 de ec d4 89 d0 6d +c8 8f d6 bc 1d 49 96 ef f7 2b 43 9e 3c 01 4d d1 +4c bf 17 71 5c 15 89 43 de 2e 6f 97 1c 34 99 87 +a1 b3 95 d6 82 c3 b0 c1 7b 66 cd 3c a4 10 60 b5 +71 11 e2 28 31 4b 2d 34 b5 e4 4e 55 f1 c1 1c 31 +a6 eb 80 b5 f8 2d 96 bd 4a 17 + +# Signature: +d0 75 be 06 cb d6 22 3e 87 1b 0f 33 62 a7 97 de +28 2d a5 c4 03 23 f3 7c 2c c3 74 65 a1 a8 63 68 +dd cf a6 da a1 35 86 6c 32 03 d0 47 22 60 b2 9c +3c 9b 1b 88 94 08 5d 54 7c 5e b9 31 42 4f 24 14 +0a 5c ba 15 3b de d4 b9 ce 7d ae dc 64 5d 39 80 +c5 f5 83 f7 67 11 c6 7b 19 3a 52 12 f2 a9 35 4a +67 96 af 09 08 20 91 31 34 ec f3 05 be fb 65 32 +cd 48 d4 11 3a 0e c4 86 9a 0a 56 55 db dc 72 59 + +# PKCS#1 v1.5 Signature Example 4.4 + +# ----------------- + +# Message to be signed: +d4 7c 0f 5c 92 2e 4f 80 9e 9c ee d2 07 f1 24 a5 +ac de 37 fa 14 63 8e 8f bd 0a 72 fe 45 26 21 95 +8e 37 68 2c 6f f2 83 f3 d5 1d a1 52 aa 1f 63 74 +cd 27 d2 a4 a5 33 05 39 16 df f1 c0 7b a9 36 31 +74 81 69 63 60 69 04 58 d8 d1 e5 d6 6c 35 f9 c9 +9a 50 55 d9 f7 cf e7 60 5c ca 57 ea c3 35 ad e2 +ef f6 b5 aa 62 7d 5b + +# Signature: +11 86 0b f4 d7 45 19 ff 8c fc ce 3d 33 e3 aa bd +f7 71 40 a1 56 36 b2 67 8d f9 67 31 44 c2 41 b0 +a9 9a 0a 37 f2 92 ca d5 1d f0 b6 3b 14 f8 ab 17 +e3 fa 15 58 77 90 fb 06 2b 5f 26 6c 16 6b 2c a7 +51 57 a0 f9 e1 a5 c8 ec 26 b9 19 9d 07 18 77 99 +80 6a 1d e9 87 15 fb e5 27 57 a7 03 77 3c 91 8a +00 0c 21 1a 78 22 85 25 cb 52 eb 44 1b 26 9b 3f +33 05 0e d1 93 5a c0 e8 59 63 19 ae 80 c7 5b 84 + +# PKCS#1 v1.5 Signature Example 4.5 + +# ----------------- + +# Message to be signed: +be bd 9d de a3 ab f9 f8 eb 58 55 97 66 f8 b3 ab +83 53 52 38 c4 3d cd 81 a2 94 93 03 a9 5f 05 5a +83 40 ce ee 16 15 e5 8d f1 e0 14 c7 55 2d 76 9f +88 41 ba 09 97 5c ef e7 e4 8d fc 6a 26 49 e8 20 +03 e7 bf 42 0e 70 10 1b 32 7d 91 70 f7 3e 8d 88 +7c d2 98 f5 3d c1 bf c8 82 cf 0e fc fa d6 e8 6a +0e 7f 90 94 c4 f2 6c 46 92 1e 09 + +# Signature: +84 a2 6f be 67 01 0a a1 ef 2d 6c 79 26 32 39 b9 +78 f4 e8 93 dd 1e c6 f0 7d 23 17 f1 51 a2 a1 b3 +23 e5 05 f9 45 0c 37 df 6b 1b f3 e2 4f 38 b6 36 +bf 77 4e 96 74 1f fa a7 69 cf d7 a8 a6 b3 a5 ef +ab a2 3a ab 3a 43 7a 22 5b d9 41 86 e9 1d 39 2b +ed 2e ad 8a 78 f3 81 f4 09 49 cf 1f 3d 27 24 58 +1f 25 70 4b df 66 08 dd 11 9e 36 d8 7d 03 55 e6 +70 6c 8a 52 59 fd 60 c8 df 13 bc 62 aa 9f d5 7a + +# PKCS#1 v1.5 Signature Example 4.6 + +# ----------------- + +# Message to be signed: +9d 19 8e 2c 6e 12 f7 4a 9a 08 1b cf 70 fc 04 16 +8a 49 e0 9c 5f aa a0 11 e9 a0 9e 2c 43 ee 2c d3 +9b b2 f7 e5 68 2d ea b1 fa 11 1e 41 a3 19 4a 20 +a8 6d a5 51 01 82 4d 3d 78 a7 e3 2d b2 b6 0a a7 +73 77 0b 57 39 07 b4 09 a2 59 2c 83 f3 47 fe bb +2d 5c 85 e9 25 5d 6d c1 2a aa 33 5a df bb 5d c8 +62 d7 86 19 53 e2 68 7d 53 03 b6 86 ff f9 63 4e +e4 d1 5c bc c2 9f 7a 35 05 a7 3d eb 6f 9e 38 8e +96 85 ff f4 d5 45 0f 1e 32 75 35 9a 2b 99 44 0c +67 39 f5 b9 1e bd 14 ef 78 ae 73 c1 a6 19 11 f5 +ae 3a 2b 91 49 67 49 17 27 81 80 65 ee 01 0d f4 +9d 5a 16 ed 8d ce e8 48 ae 09 48 a2 52 4e ac 7c +4f f9 09 6c ed 61 35 76 42 c5 e0 f8 06 80 af ff +ce 0b a7 eb 59 58 99 49 52 6f f5 12 35 cd c7 2d +47 a2 7b 39 b8 d4 ac 84 9c 3b c0 4f a8 36 cf 18 +4b ae 0c 83 41 59 56 + +# Signature: +38 ef 24 5b 94 0d 93 97 0a 50 3b f4 3e 28 e1 7b +8a ff 08 3c cb e1 e9 c4 8e 4d 80 f5 16 c2 7d 08 +5c a2 a4 e5 73 23 6a 24 94 d9 b9 97 f8 12 48 48 +12 f6 65 25 d0 6c 0a 0b b2 13 0c 15 d6 ce 18 b2 +2f 3c ee 57 09 7f c0 d5 58 af d9 af 27 f1 51 f8 +43 6f bc 87 d6 be 61 42 64 7a 17 e0 4d f6 de c7 +0a 95 c7 da a8 4e de 94 cc b4 3e 1d 2c 37 b9 45 +81 73 10 d1 4a 22 b5 b9 ae 61 14 48 ee 41 bc 70 + +# PKCS#1 v1.5 Signature Example 4.7 + +# ----------------- + +# Message to be signed: +8e 8b a8 43 6f e3 10 4b 7c e2 a4 ef c3 6c 85 7d +49 e8 49 c0 08 5f c6 57 ba a0 33 17 93 b3 f3 6c +7c e7 38 b6 13 0b fa c7 5e 50 11 f3 2a a3 d1 + +# Signature: +78 44 69 9f 1c 4f 29 6e 50 26 1f 15 26 e0 dd 84 +f0 1c 82 cb 85 fa 24 60 9e b0 33 58 75 2c 6c f5 +99 94 d8 4e 12 f4 6a 72 00 cf 5a d9 7c 08 dd 4f +fc 44 65 7d b5 72 14 cd 1f 4e ed 6b 77 d2 39 fb +58 21 69 88 c5 e5 bc 73 5a 4f df f4 08 eb 9f 12 +79 d6 5b ba f6 a6 81 92 44 18 34 9e 62 ff 5e 58 +15 ea ea 59 2d 90 d1 ee f5 56 fc d4 d5 b4 b8 9c +6c 70 73 9d 6f 0d 3d 0b d1 6a 50 f1 e0 02 4e 98 + +# PKCS#1 v1.5 Signature Example 4.8 + +# ----------------- + +# Message to be signed: +58 5f a6 a7 f7 7a 4b 6e ba 56 90 e7 3e 71 28 b7 +2e 67 7c db 3a aa 86 29 ed 61 f2 ee 63 af 1a 71 +ba 87 13 6a 52 db 1a 33 21 fc fe b2 48 bf 2e 5c +f5 c6 39 57 1d 58 95 ad f1 fb 06 17 ed 14 0a 2a +0d 98 37 c3 c1 d8 45 0c 28 9d 33 bc 96 23 79 d7 +3e 30 87 f2 b7 ee 6e ad d6 65 01 48 c0 42 b6 ff +04 48 21 96 c7 18 fd c0 ce 57 9c eb 62 a8 1e 58 +43 73 eb 93 75 40 c4 26 b5 56 6a 9f 40 7c fc cf +bc 4b 75 36 94 af 0d f4 cd 6a a9 f1 65 46 a6 33 +94 a0 f6 57 73 71 34 3f fd db 65 1a 62 a3 a5 8e +dd ec 67 a2 9c ca e8 96 56 3c 63 e3 c9 0d 54 d9 +13 58 ad f1 94 e6 aa b1 f9 + +# Signature: +68 93 35 1c 73 91 5f ac 47 c9 62 cc 60 17 ca 74 +a5 b5 ee 4c b1 bb 5a 10 ad a2 a4 31 58 a2 26 1e +b2 7b 86 6d b3 9d 35 90 b4 f8 d2 0e e6 7c b1 a5 +78 94 63 15 0d 83 93 43 23 25 43 c8 26 50 51 01 +e1 d2 57 04 26 ab 9f ef d6 5b a8 4f aa ec 73 1f +27 37 4a b1 01 91 c9 60 83 16 93 f2 9a 85 4c 38 +12 85 99 f7 28 77 49 b0 b4 8b f7 e9 df da ed c8 +4e ec e0 71 40 45 84 73 0c ec ce 0d 5c f0 05 cc + +# PKCS#1 v1.5 Signature Example 4.9 + +# ----------------- + +# Message to be signed: +78 3c 18 b1 1f + +# Signature: +13 2f df b8 41 93 df b7 9f df e6 ba bc 2e fd 39 +b2 6a a2 09 68 a0 7c 0e 41 56 0e e4 df cd 4f ca +79 17 49 0f 24 e8 df 84 f4 e0 11 5a 3e 63 27 3e +7a 3b 12 8a bb bd 17 b8 aa 5a 06 ba 15 5e cb 23 +0f e7 97 26 04 79 95 70 10 e4 4b a5 75 29 2e c3 +f1 51 ab f4 8e 91 03 e5 51 42 ec 67 a4 13 4d d8 +f3 8e c6 59 f9 a7 89 fd 03 41 ce f2 bb cf 9f 52 +9b 93 21 8f c3 e4 3a 76 69 69 d1 bf 87 88 48 07 + +# PKCS#1 v1.5 Signature Example 4.10 + +# ----------------- + +# Message to be signed: +96 dc 98 b0 eb 84 f5 59 48 30 7a dd ec cb e7 64 +39 ca 36 58 bc 36 35 96 24 c8 fe 2f a0 9c 52 e4 +7a cd c3 2a 15 6d 90 76 82 41 0a 85 67 ab ca fd +c6 d8 bb 53 25 35 9e c7 5f fd b7 3e e0 a9 51 5a +4d df 9a 31 e5 d5 19 46 03 74 28 0a da 30 de 7d +d5 34 de aa 57 + +# Signature: +8f b4 3d c8 f0 6f 2b a4 8f 19 be 5b 1a 09 31 21 +3a 99 0a ed 9c 9f ed 1d e5 d6 f3 5a 2a 78 2f 0a +19 8f f6 38 8d 96 e9 d5 9b 88 e9 78 22 f3 49 ff +41 64 ee a5 0a 62 93 5c 61 cb c7 6e 3d f7 5f 68 +4d 96 24 75 e5 63 59 64 96 c9 88 0a 48 ed 97 8a +63 15 a3 45 57 17 91 cb 2d dc 88 da be 41 87 98 +a6 a4 41 c4 7a fb b1 cd 15 21 3e ca 3b 11 15 ec +8f 58 f8 77 be 8f bd 38 f4 fd ae f9 39 f5 26 40 + +# PKCS#1 v1.5 Signature Example 4.11 + +# ----------------- + +# Message to be signed: +37 20 01 59 9d 99 30 c7 d5 57 45 8b 43 6d ec fd +c1 4d 06 cb 7b 96 b0 67 18 c4 8d 7d e5 74 82 a8 +68 ae 7f 06 58 70 a6 21 65 06 d1 1b 77 93 23 df +df 04 6c f5 77 51 29 13 4b 4d 56 89 e4 d9 c0 ce +1e 12 d7 d4 b0 6c b5 fc 58 20 de cf a4 1b af 59 +bf 25 7b 32 f0 25 b7 67 9b 44 5b 94 99 c9 25 55 +14 58 85 99 2f 1b 76 f8 48 91 ee 4d 3b e0 f5 15 +0f d5 90 + +# Signature: +a8 97 c7 f9 72 e1 17 49 e1 e7 c1 55 ce 94 62 aa +7e 1c c0 a9 79 c1 27 29 79 51 26 cb 8c 0e a5 02 +21 c4 26 f1 bb 06 c1 ca f7 c5 1a c2 fb d9 4d 68 +8d a6 7d df 3e f6 66 06 e9 89 a1 6d e1 f9 2b 17 +70 6f 88 e8 7d 9f 14 69 a0 05 c9 fd 76 78 8e e8 +c4 a7 f0 12 09 e2 8b 86 f6 74 88 1a f5 7d b6 c3 +42 9b 6f b4 56 98 bf 5d 30 07 f6 1c 7d 44 11 78 +ad 12 43 a4 9b 2a a6 02 9b fe 90 2d 26 e4 23 75 + +# PKCS#1 v1.5 Signature Example 4.12 + +# ----------------- + +# Message to be signed: +bf bf d0 73 21 f0 f1 d5 fa 9f df 00 14 c2 fc b0 +35 8a ad 0e 35 4b 0d 29 08 1b 23 3b 43 56 77 50 +bd 6e 78 + +# Signature: +c2 4d 31 04 94 09 aa 16 d3 f9 72 ef 8b 75 95 ea +a0 07 83 3e 2b cd c7 50 48 52 f2 50 5f ba 1f c1 +5f 19 a0 ea dd e8 33 5c 73 06 fc 3f 51 66 1d a5 +20 ec c8 db 7f 47 38 85 ca bd e9 3f 0c eb f1 df +9e 8a 82 37 0b 00 a0 43 ad 63 2c dc c7 8f 3f ac +1d 8a 37 57 fc 8e 52 41 bf ed 55 c4 96 04 ac 19 +ab da c0 c9 c4 0d a3 73 c1 5f 3c 1b cc 97 3f fb +4f 8b 7b 5b 55 3a e0 75 e1 b1 bd dd d2 3d 7d 2a + +# PKCS#1 v1.5 Signature Example 4.13 + +# ----------------- + +# Message to be signed: +c6 97 39 d2 2a c8 96 6b f1 1c 11 6f 61 4b 16 67 +40 e9 6b 90 65 3e 57 50 94 5f cf 77 21 86 c0 37 +90 a0 7f da 32 3e 1a 61 91 6b 06 ee 21 57 db 3d +ff 80 d6 7d 5e 39 a5 3a e2 68 c8 f0 9e d9 9a 73 +20 05 b0 bc 6a 04 af 4e 08 d5 7a 00 e7 20 1b 30 +60 ef aa db 73 11 3b fc 08 7f d8 37 09 3a a2 52 +35 b8 c1 49 f5 62 15 f0 31 c2 4a + +# Signature: +d0 6d 32 26 0d a2 db 48 10 4f bd c2 4e 16 a6 5b +48 73 7d 43 ce 24 37 04 04 2a ad 6c 03 fd e5 a3 +dc 0f 2c c6 e3 ad 68 c3 c6 2e ab fa 1f 7b 1c ab +00 9d 11 75 af f7 7b e5 8f b1 2a 4e 58 12 7f ed +63 ea 3d f4 41 81 bd a3 8c 77 3c 83 b9 e8 04 bb +3d b7 96 32 63 df 30 e9 2c 4c 27 19 56 e7 e8 10 +45 2c 15 e0 6e 93 96 66 df 0c 83 34 03 30 96 c0 +7d ea 05 b4 4e bb 14 24 92 e7 66 91 31 eb cf 2c + +# PKCS#1 v1.5 Signature Example 4.14 + +# ----------------- + +# Message to be signed: +73 30 47 f3 36 f9 15 47 38 67 45 47 db 02 a9 f4 + +# Signature: +c1 13 c0 46 5c 84 cb fb 0f a1 bd bc 54 c3 e1 06 +8c a2 3e 69 b8 39 19 09 c3 90 0f e5 b4 e7 e3 f0 +34 c9 a9 88 a3 dd c3 c3 81 75 6a 1e 1a 27 c1 ec +fb 3a 70 e1 ee 0e 92 04 18 ac 4a b6 d9 53 2b 8d +09 59 a6 53 b4 c5 08 67 06 63 46 2b 2e 13 58 16 +b6 94 a6 b9 b4 68 a2 9f 38 de 53 bf cd df 97 e0 +3d 8d d2 4f 97 26 33 a4 9c f3 ea ae 1d 69 62 94 +38 60 dd 25 43 40 08 6b 10 35 7b 80 c1 cf bf 31 + +# PKCS#1 v1.5 Signature Example 4.15 + +# ----------------- + +# Message to be signed: +a9 74 0b 9a a0 d3 40 58 fd 3b 90 6e 4f 78 59 df +b0 7d 71 73 e5 e6 f6 35 0a da c2 1f 27 b2 30 74 +69 bd 0c e1 95 49 d0 70 01 20 cb e5 10 77 db bb +b0 0a 8d 8b 09 de 8d 83 96 e3 65 07 fe 1e f6 a1 +90 17 54 8e 0c 71 66 74 c2 fe c2 33 ad b2 f7 75 +66 5e c4 1f 2b d0 ba 39 6b 06 1a 9d aa 7e 86 6f +7c 23 fd 35 31 95 43 00 a3 42 f9 24 53 5e a1 49 +8c 48 f6 c8 79 93 28 + +# Signature: +4f bd 4f b2 37 04 f4 14 9a da 32 7f a5 33 88 52 +6a 07 dd 43 d9 15 fc bd a9 a1 3b b2 a3 73 8f 4a +db 1c 3d b2 6a b6 90 48 80 5a 80 c8 16 05 c9 6d +68 f8 41 80 2f 5a bb 02 05 7b 61 1f e2 f3 94 71 +62 65 e5 45 25 2c 23 0c e4 74 af f0 bb d4 ff 1f +38 08 49 60 36 a4 94 8c a7 a1 10 ff 26 c6 38 c5 +0f 32 15 b2 8a 09 f2 3a f6 f8 4c dc 89 78 98 d0 +fd 22 3b 13 48 1f e8 92 b1 a5 8b a2 e4 b3 68 5b + +# PKCS#1 v1.5 Signature Example 4.16 + +# ----------------- + +# Message to be signed: +af 8f 08 87 c2 19 00 4d 2a bd 89 4e a9 25 59 ee +31 98 af 3a 73 4f e9 b9 63 8c 26 3a 72 8a d9 5a +5a e8 ce 3e b1 58 39 f3 aa 78 52 bb 39 07 06 e7 +76 0e 43 + +# Signature: +32 7e c9 d0 be 7a ab 7b c9 59 d4 02 27 e1 d0 04 +81 fc 04 01 1f e0 8f d5 44 9b 90 c0 f0 54 e0 d6 +59 b9 26 cc 81 29 21 c2 0a 56 3c 4a be 4f 82 5d +6b 5e ef 57 b3 e2 d6 5d 20 a8 01 3a 50 dd 5c 93 +23 8c f0 49 f2 ff 0c 7e be b8 e8 ca f7 2e 46 e7 +cf 8a 0c 3f 49 25 61 6b 1b c1 82 6f fc b0 bd a6 +0b be be df d4 c6 0f 27 88 d1 66 6f b8 45 11 85 +36 46 c2 dd 46 68 51 fa c8 5b e0 ed 5a ce 5f e2 + +# PKCS#1 v1.5 Signature Example 4.17 + +# ----------------- + +# Message to be signed: +38 df 86 55 7f 37 5d 09 cc d8 bd 15 d8 cc f6 1f +5d 78 ca 5c 7f 5c de 78 2e 6b f5 d0 05 70 56 d4 +ba d9 8b 3d 2f 95 75 e8 24 ab 7a 33 ff 57 b0 ac +10 0a b0 d6 ea d7 aa 0b 50 f6 e4 d3 e5 ec 0b 96 +6b 81 57 79 a9 1b 3a 8b d0 49 bf 2a eb 92 01 42 +77 22 22 c9 ca 0c 32 8c 65 9e 0a 64 37 43 3c ce +b7 3c 14 9a ec 4a 74 80 d5 bb c4 29 20 d7 ca 23 +5d b6 74 + +# Signature: +30 46 05 5c 2b 8e f7 fa 92 c8 a9 e3 95 98 5b d4 +60 fb 6b 47 98 65 53 94 4d 21 04 51 19 f7 e7 61 +7e 03 fe 80 87 0a c6 aa bf 63 b0 96 ca d5 cc e7 +f5 06 95 3a 7f 69 3f e1 37 ad fb 97 cd 45 81 28 +ae 95 c4 7c a9 48 da cf 24 03 6a de aa 48 f2 9a +46 9f b5 13 19 1e 05 ac f7 9e 67 a7 93 a3 af 5e +4f 9c 6d 0d 01 fd d0 e0 cd 42 96 ad 3d a2 ca 89 +a5 0e ed cd 9f 7b 87 7d 2a e1 d5 8d 98 dc d7 8f + +# PKCS#1 v1.5 Signature Example 4.18 + +# ----------------- + +# Message to be signed: +cb 34 ed d5 ab 65 40 41 b6 14 30 56 + +# Signature: +1d df 48 ba 53 51 be d0 79 5f 55 b3 06 aa 1c 6e +d8 36 f5 92 ba 93 cf 0c 46 b7 c2 73 70 9d 36 b8 +df f0 2a bd b1 a7 68 d1 c7 11 4a 86 a4 57 49 6d +a5 79 e4 d8 19 f7 2a 19 2e 29 8b e2 15 2f 7c f3 +9d 1e 30 82 7d 02 82 cc f3 4d c8 88 9f 1c 2f 59 +70 93 0d 97 35 04 2f 8a 5a 71 22 63 16 5d 6e 6c +50 35 e2 e4 a5 0e 86 3c 06 79 9e 3c 89 cc b5 cb +0e 70 b3 c9 9c 08 40 30 67 7a 7c 97 90 7a 17 24 + +# PKCS#1 v1.5 Signature Example 4.19 + +# ----------------- + +# Message to be signed: +5b 09 ec 88 b1 52 71 78 fa 04 32 63 f3 06 7d 9f +fe 97 30 32 a9 9f 4c b0 8a d2 c7 e0 a2 45 6c dd +57 a7 df 56 fe 60 53 52 7a 5a eb 67 d7 e5 52 06 +3c 1c a9 7b 1b ef fa 7b 39 e9 97 ca f2 78 78 ea +0f 62 cb eb c8 c2 1d f4 c8 89 a2 02 85 1e 94 90 +88 49 0c 24 9b 6e 9a cf 1d 80 63 f5 be 23 43 98 +9b f9 5c 4d a0 1a 2b e7 8b 4a b6 b3 78 01 5b c3 +79 57 f7 69 48 b5 e5 8e 44 0c 28 45 3d 40 d7 cf +d5 7e 7d 69 06 00 47 4a b5 e7 59 73 b1 ea 0c 5f +1e 45 d1 41 90 af e2 f4 eb 6d 3b df 71 f1 d2 f8 +bb 15 6a 1c 29 5d 04 aa eb 9d 68 9d ce 79 ed 62 +bc 44 3e e2 0c + +# Signature: +af 56 fc 32 97 39 e2 f7 75 4b 6c a2 51 64 a6 fa +58 f6 85 dd b7 42 b4 84 1d 73 a5 e2 c4 c4 53 43 +b7 4d fd 2f 0d 37 0e dd dd 36 a0 17 56 4a 8d 3a +d4 02 e2 a3 41 c9 72 06 2c 23 81 4a 00 13 1e 17 +b1 de c7 b4 c5 7c 5b f1 d4 fa 79 22 29 37 a4 dc +5c 00 23 5f 85 3d d2 3d c9 75 7f 33 5c 85 c2 07 +eb 07 4d 4b cc 24 3e da a7 83 1b 83 13 56 55 e2 +27 7e f2 9e 7a eb f3 4a 0f 7b 23 4a 28 65 0a 30 + +# PKCS#1 v1.5 Signature Example 4.20 + +# ----------------- + +# Message to be signed: +3c 33 0c 1e f7 18 c1 41 e4 7b 8f a8 59 be 4d 5b +96 + +# Signature: +0b 10 22 dc 38 e2 17 fd 3b 0e 7e f1 9d fc b4 b4 +56 36 62 40 98 30 95 f6 db 96 58 31 a7 0f 0f 8e +20 e2 dd 2a c2 31 cc 37 90 45 c2 73 65 e7 3a 53 +71 9b b6 f0 11 c3 f8 63 6b 64 99 4c a4 80 60 2f +b3 b4 f0 e2 27 4b 58 b3 63 e0 d3 08 b5 28 e1 58 +59 a9 1d cf 99 bf fe fb c8 05 22 41 b9 74 19 2e +63 62 18 f3 98 33 2d af e8 25 9c a5 f5 cc fa 54 +c9 b3 2b 27 35 af 07 24 f4 0b 5a 5d 61 21 a4 0d + +# ============================================= + +# Example 5: A 1024-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +c5 5f fb dd 6a 27 53 bc 02 af 20 ae 18 ea 0d af +23 0b b6 f8 79 5d 05 ef ec c8 15 ba ec e2 2b 38 +79 99 5f 6d 97 64 c1 df 8f 97 85 13 81 68 62 66 +b8 09 2f b6 01 18 98 a7 67 07 a4 d1 d5 bd a0 8d +24 6c 68 7a 8b ba fa 63 98 ac 9e a2 72 68 23 71 +4a 0c 39 34 ca 6e 5f 8c e3 39 87 b5 34 85 7e a9 +f8 5c c4 e1 9a 1d 21 83 e0 e4 c8 aa 55 cb 22 7b +0e 56 ce b2 b6 2b 30 ef c7 88 64 b2 f9 fb 92 49 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +c5 5f fb dd 6a 27 53 bc 02 af 20 ae 18 ea 0d af +23 0b b6 f8 79 5d 05 ef ec c8 15 ba ec e2 2b 38 +79 99 5f 6d 97 64 c1 df 8f 97 85 13 81 68 62 66 +b8 09 2f b6 01 18 98 a7 67 07 a4 d1 d5 bd a0 8d +24 6c 68 7a 8b ba fa 63 98 ac 9e a2 72 68 23 71 +4a 0c 39 34 ca 6e 5f 8c e3 39 87 b5 34 85 7e a9 +f8 5c c4 e1 9a 1d 21 83 e0 e4 c8 aa 55 cb 22 7b +0e 56 ce b2 b6 2b 30 ef c7 88 64 b2 f9 fb 92 49 + +# Public exponent: +01 00 01 + +# Exponent: +07 e3 fa 71 b3 98 b6 e4 41 47 37 0b 3e bb bc a8 +4f c2 5c 22 3a d7 d9 30 ea 4a 65 73 ff 9c 5b 15 +fa e6 82 c6 22 d3 48 5c e3 a4 af 11 44 8f 23 bf +ef 83 8e 80 bc 32 7b 87 d5 ba 9c 80 37 07 49 af +c8 c1 c0 17 54 6f c6 b6 59 31 b7 59 ca 43 41 fa +5e 5e 10 b2 40 87 e6 e2 c0 f4 db b7 90 69 52 99 +9c bd 90 d2 43 5f ca cc 9c 82 e4 8f df 24 e4 95 +cf f3 0a d4 19 e7 12 3e 3a c9 42 27 2e 1a ba b1 + +# Prime 1: +f7 f7 c0 02 f0 19 6e cd d7 1b a5 ad 74 2b 69 48 +27 d2 88 af 1b 1b b6 9c 5e d7 fb 22 9d ee 4b 7a +32 f2 f7 56 8a 6f ca f3 83 d8 9a da 9f c1 4a 7b +a5 d0 a4 a4 6c 2c 54 3e ec 17 75 49 c8 a0 48 b7 + +# Prime 2: +cb c4 b2 86 04 76 a2 d3 e8 a4 da 21 00 16 ca ce +d0 e3 67 cb 86 77 10 a4 b5 aa 2d f2 b8 e5 da f5 +fd c6 47 80 7d 4d 5e bb 6c 56 b9 76 3c cd ae 4d +ea 33 08 eb 0a c2 a8 95 01 cb 20 9d 26 39 fc ff + +# Prime exponent 1: +6c 76 27 bc a1 3c de a4 96 a4 77 31 89 90 bb 7a +5e 40 ce 9c 99 24 e4 19 3d bb 07 14 3b 34 52 3b +5f 31 bb 52 55 37 54 f4 73 05 39 a6 cb 1e 06 f0 +52 b5 12 6f 01 09 da c7 b3 09 07 ba 80 50 eb bd + +# Prime exponent 2: +40 92 74 80 43 a9 d4 af 92 69 ab 36 09 f1 2f 13 +9a de 75 65 e9 96 91 8f a0 81 ed 4d 9d 8a 39 78 +fa 92 7a d6 1c df 07 c6 1c ee de 96 b9 6d f4 6e +7c 68 ef ca 8b fe 63 ad d4 83 aa 32 22 8a fd c1 + +# Coefficient: +2a 61 94 ca 29 70 72 38 45 ff f3 8c a1 a9 a3 b5 +66 b4 24 5d e2 f9 01 34 b8 e6 ae c8 ae 07 f3 bb +7c 5e 5a e6 e1 83 34 85 e5 5d 8c a6 0c e1 64 2f +72 75 96 8e 66 12 38 35 52 11 c6 38 48 94 0f 3c + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 5.1 + +# ----------------- + +# Message to be signed: +ea e9 a4 0b ff 18 3f 41 14 73 2e 7b 3b a5 56 f4 +ce 28 8d aa 83 e3 ff 23 61 12 44 a7 a0 90 1f 11 +7d 86 c0 9c 33 a5 23 2b d3 20 fa 37 a2 38 a8 aa +62 dd 21 ab bf ac db 93 fa 1c 44 cc 55 ac 61 be +a2 4a 6a 34 cc 64 76 75 38 37 e1 6f ac d8 2e b4 +9e 1c 57 c9 58 fb bf f5 68 88 7c f8 2e eb e9 61 +e5 80 e0 64 db 9c be c3 b5 3d f1 f2 71 99 e4 9a +04 cb e5 9c 69 a2 65 cf ac 8c e4 f9 1c a9 5d 52 +b1 14 5c 8b 9f 44 40 b3 9c 18 50 94 be 18 48 74 +da 59 71 d7 d7 63 fe 07 ce 16 e5 7f 1e 50 d2 28 +65 04 b4 81 e2 c6 85 bc 9d 9c 01 49 3f d3 a6 d8 +bb 9b 2e 96 bf de b6 c9 29 14 ca + +# Signature: +44 ce b4 42 24 2b ae 08 59 94 ea d0 7b 70 95 43 +ea 23 95 a6 e8 d4 64 73 d7 0d f3 4a 95 55 aa 56 +7f 4d a1 38 e9 63 fe 92 86 a8 4f b7 c5 cf 82 00 +03 59 04 b5 0c 32 40 3c ae 51 7b fa 7f ca 8a 66 +fc fd 63 2a f7 47 c4 9c df b0 b9 ae e3 52 28 b7 +dc 4c 21 00 39 69 b0 a0 13 ed e1 29 2b 65 d1 0a +50 c9 02 63 fb 0b f4 f4 b8 37 66 41 b0 3e 1f af +b8 83 f0 38 f4 32 3d fe 5b ea c4 68 de ea 99 c3 + +# PKCS#1 v1.5 Signature Example 5.2 + +# ----------------- + +# Message to be signed: +9d e5 ca 46 74 85 61 a0 b9 28 b2 60 a9 5a 3e d9 +20 ad c8 d5 ee b9 27 1d c7 1b c1 4f 69 cc d6 31 +1d 18 6a 77 9f 5e b8 db 17 c6 90 d6 86 7c f3 36 +9b bf f1 5f ab b3 cd 2c fd d6 f7 d7 52 86 ff 2d +24 99 c5 ab b4 8e d5 4f d4 d8 49 a9 18 0e 11 0e +0a 53 a7 21 39 82 92 11 0f e8 be 26 + +# Signature: +44 5f f5 b6 87 9f 8c e7 53 95 01 6f 04 95 f1 31 +35 b1 79 e7 3a 3c ae b3 30 e3 cd a7 f3 1f 1d cb +a7 aa 82 e2 68 c9 35 e9 d7 01 4e 0b 0d ce a6 9c +7b 96 8a db 17 42 4a 64 df d1 e2 bc 57 07 f9 20 +fc 0c 83 cc 63 df c7 4b 96 3e 68 2b 46 a2 2a c2 +56 ac 6b e5 70 9c 07 cf cc 3d 4e ba 3a 1d 61 ab +15 f1 ba db 0a 49 fb 5c f0 9a 1f 74 81 a3 aa ea +f7 c2 57 54 03 77 ae a7 b5 44 17 a6 09 c7 6f 4c + +# PKCS#1 v1.5 Signature Example 5.3 + +# ----------------- + +# Message to be signed: +18 3b a1 a3 81 1d 62 5c a9 da 1b ba ae dc 76 19 +20 12 fc b6 74 bb 9e 77 d8 f3 77 08 d2 40 d3 49 +e0 57 97 41 6f eb 24 e3 01 8c 7a 20 5d 05 9d e8 +e0 ae 05 a8 d7 e0 9e af ee b9 f0 6d e5 d4 28 7a +bb ef 05 9b c5 86 b2 1c 82 d6 4a ec e8 d7 42 8a +fc d7 b2 2f c5 d1 68 bc 07 6b 61 5f 02 73 3c b6 +31 25 c8 f3 6d 5c b8 09 ce 80 65 08 23 98 b3 88 +5a 89 19 57 0c 47 8a 07 2f 59 66 15 d7 8f 01 36 +d1 1b e3 2b 3f e0 f4 fb e3 c7 da 5d 81 34 19 10 +17 7e 48 b1 bb ac 27 6c 12 ee 81 54 65 dc 67 d4 +53 24 f9 05 aa ca 48 38 d8 1f 74 31 46 3e 89 eb +8b 95 36 58 69 36 af b4 2c b4 7b d8 c3 18 29 d3 +1e c1 ee 29 f9 1c cc 6d f9 cd 1b 0b 9b 86 46 b6 +02 67 fd 7e ce ae 92 c0 ae 9e 0c e5 ff 6f 7e 0b +f7 56 a9 b8 ff c9 c6 16 + +# Signature: +ab 4b 78 96 4c 2a 35 d3 28 55 e0 ef ce d3 4b f8 +02 19 b5 8c 48 8e a3 75 b1 f3 27 16 6a 51 35 e5 +da 99 45 c2 87 29 7a 3d 93 2e 57 27 46 f0 22 74 +8b 85 58 5a 0a bd 91 86 f4 ac 35 ed c8 50 d2 fd +88 05 b9 e9 f5 1a 5a dc b9 5e 1a c1 72 9e 57 b8 +53 31 c1 ed 15 c3 d0 cf ae 33 f6 1c 11 9b 55 c9 +5e 34 4b 72 f2 b4 f8 e7 e8 fa c7 a3 3e 5b 8b 27 +6a 60 88 a7 fa bf 4f a1 72 35 7f b6 e3 f4 4a 94 + +# PKCS#1 v1.5 Signature Example 5.4 + +# ----------------- + +# Message to be signed: +87 07 dc db 49 d2 83 a2 3a 9b d6 ff 87 af f8 34 +f0 6f f7 f4 7b 0e 5f 57 ff 1a 0d 99 5b ba 9c dd +5e a0 1b 42 b2 5d 6f f1 7a 0d c1 06 05 cf 45 2a +ca 73 be 54 ed 5e 0c e2 15 66 af cc 17 91 2a be +18 df ac d1 bc 03 e3 e2 88 2a 4b b3 a4 f3 9e ea +f9 63 d7 c3 5e 6b a8 58 b1 37 6a 07 51 60 c6 cf +ae d5 e8 c5 2e 45 11 32 34 72 19 bd 88 89 3e eb +e3 56 59 a0 ee 4d 94 f9 4d 03 5b 7a 86 86 ff b4 +16 eb 99 fb 2a aa 81 23 6b 05 ac 46 45 92 5f 2c +2b c1 9e be 89 a6 3f 2f 45 1d 0b 13 b2 fe f0 61 +e5 30 a3 49 ba f3 b2 35 64 22 b0 95 fd 9f 19 29 +93 ab 99 c9 f9 22 6e f9 a7 b3 cf b3 65 82 08 59 +29 c8 76 b5 e9 d7 c6 ac ac 7b b0 27 52 34 e4 1e +d3 51 c8 38 b7 a3 1a + +# Signature: +17 53 98 8b 39 dc 74 5d f9 69 1a f9 ee 69 ca da +73 a9 87 7c ca 12 f6 d4 06 27 dc ed 76 22 14 7e +c9 01 a5 b4 63 e7 ef 9b 37 fb d6 92 78 5a a2 2a +46 5d f4 03 af 92 a2 9f 79 5d 40 a8 3f a9 64 b8 +5a 7e c0 5a 3c da e3 f8 bc 8a 61 a7 9d c8 42 e1 +d3 77 bc 5e 1d 46 ad aa a8 66 be 28 2c 6e 23 88 +17 36 44 f4 06 27 bc f8 a0 97 4a 4b e8 fc c4 8a +ee 7e 82 59 f8 68 a2 bd 78 9a 90 89 92 05 6e 55 + +# PKCS#1 v1.5 Signature Example 5.5 + +# ----------------- + +# Message to be signed: +ac 9f a3 f6 3d f0 68 e9 0d 69 2e cc fa 7d 87 96 +49 1a ca 79 5b 98 58 a4 55 18 62 32 29 af 28 b1 +3a 50 2d 8c b3 b9 50 92 50 58 82 eb 99 4d e7 46 +59 62 56 98 a0 05 04 17 94 0d 8b fa 28 a3 f9 3d +14 9f f8 b0 bb 39 26 f6 18 ef 91 96 6f 4d 39 bd +ba 5a 05 17 dd eb b1 6d 2b c4 b4 e3 3a 7d 61 9c +95 a3 3c f5 f5 72 db e0 7f ab 4a a6 7f b3 f3 9a +a2 98 1a 3d c0 ca ee 64 75 8e a8 98 eb ce 10 bf +3a a4 fc 84 49 e8 e0 cf 7e 88 b1 88 23 8c 20 68 +ef ac eb fe ef 40 73 a6 54 a5 8a 30 99 d0 36 ae +ee 2d 81 82 98 d4 ab 39 23 8e dc 45 9a 9f d3 57 +7e 9f 5b fc 03 68 aa 65 7a ee da 1e eb 8a e7 f5 +ac 1e af 3b 1c 95 81 7d de 2e c1 a5 9f cb 5e f2 +7c c3 4f b7 53 31 da 7a 49 96 92 5a c3 ad 17 bb +c3 da fe 6a 9c 64 4e 30 98 ef fe f8 fe a5 cc 0d +5f 0c 04 8e 10 88 + +# Signature: +11 e1 a8 28 f0 0a 98 7e 03 d6 2e 2a 53 6c 29 7d +da c0 22 e0 63 ee 0d e4 e4 69 5d ed 1f db 22 09 +00 a3 ac 3f 87 d1 be 75 f9 59 c2 8b 57 8a 43 b2 +56 64 3c df ff 92 15 95 fd fb ea f4 10 c2 ae d9 +e5 e4 7e 1d 15 1a e2 8c 76 99 ae e2 25 a6 45 bc +42 b3 be b5 2f 08 38 7e c5 54 d0 20 4d 28 3c 3b +cc bc ca 21 6e da d9 4e c6 4f 9c 20 b3 40 6a b7 +8a 6c 4a 4d ae 3f a6 17 a0 0c 6a b2 f8 e2 47 62 + +# PKCS#1 v1.5 Signature Example 5.6 + +# ----------------- + +# Message to be signed: +15 74 69 73 44 e9 86 85 cd 6e 65 e4 67 83 f0 b5 + +# Signature: +3b 7d 67 d1 3c d3 c0 fd 30 5a d4 04 d8 a3 dc de +4a 45 17 9c 2d 0b 87 11 5d 6d 06 0c 24 9b 87 f3 +9e 46 3b 76 4b 42 07 c4 8a 74 cf ce 25 31 e8 18 +3d 3d 01 25 85 ce 57 39 d1 62 c4 ea 22 32 44 02 +ea 2e 6e af b8 a5 73 fc ff 40 15 c9 5c 45 e4 ca +7a c5 1a e3 a0 6f 42 1e 60 6d 68 3f 5e 12 2b 55 +79 14 8a 9c 46 6a de b0 24 28 f4 89 6a 86 df 63 +be 58 7d dd 7a 6a 8d e7 17 6b e4 e7 ff 4a aa 99 + +# PKCS#1 v1.5 Signature Example 5.7 + +# ----------------- + +# Message to be signed: +be 46 be 8b dd 85 43 d3 70 bb b7 ac 83 9f 5e 64 +53 f3 0c d8 75 2a 4b 92 67 32 c5 9e 61 09 04 4b +e3 a0 75 6c 70 25 a2 32 80 df 2e d7 66 ba 39 ab +b2 0b 94 4c 06 5f e1 48 7d ea 31 b4 70 8a 68 9a +50 b2 8d 54 29 94 cb bb 3a 5b b9 46 0e e7 a9 c1 +53 8b da 75 1a 52 8b 76 70 f9 15 78 d6 67 3e 08 +ab cc df 5f 4d 8c 1e be cf ca c7 5c c4 2d bb b8 +cd e3 c1 b4 74 b5 56 b3 2b b8 48 fc 32 7b a6 e3 +cf 5f 77 b1 eb c0 4a 19 f3 c8 c3 9b 6b 84 77 84 +ea a3 25 a2 b6 f3 + +# Signature: +91 de 2f 90 32 47 b2 d1 3a be 93 dd d9 6d fa ef +1b 4d 17 2b 09 09 58 f0 cc 34 fa 92 83 5a d6 0c +44 b4 27 fe 03 1c ad bf 92 ff 1c d0 38 41 44 c9 +b5 f2 8f 64 5c 63 e8 d7 16 bc ec 2e 04 3b c3 96 +56 64 17 85 c2 6b a3 6b a2 a1 09 e3 64 4e bf d9 +62 d7 a3 16 91 6b 3f 13 66 20 13 cc 0f 37 ad 8f +9e 0d 9e c8 b4 c8 ad 5c 75 32 cf a0 44 ae dc 73 +78 77 94 c2 98 79 7c 8a 7e 14 49 ea d6 15 0d ed + +# PKCS#1 v1.5 Signature Example 5.8 + +# ----------------- + +# Message to be signed: +0b 7e 06 63 e7 15 ea 38 bc 93 0e c9 d8 e2 a0 29 +aa 1a 4c 95 e7 b2 00 47 ae 15 44 d5 b2 d8 47 6f +c8 05 53 9f b0 ef ab 7d 5f f1 2c 36 d7 6a 79 7b +75 c0 b5 3f a9 26 54 73 da b6 80 c2 55 d5 7e 99 +b6 d9 fe 08 cf 1a 57 34 91 e2 19 78 fa e9 53 9c +c0 58 84 63 3a 1d d5 cb 21 53 6f d4 2d dd 73 1c +a7 6c 34 57 81 3c e1 bb 59 c2 1d d3 1b f2 ae 3b +fd 7d 20 c6 c7 12 a9 dd 43 95 1f 1b 19 8d ea f7 +41 08 ea d2 29 26 d2 b0 19 1e 59 d5 f6 79 ad 97 +c7 1e dc 69 de 97 98 7e 54 3e 87 a9 6a 9f ee 77 +e3 f0 ea 95 7b d4 6a + +# Signature: +48 51 09 8a 85 e7 0d a3 33 92 a9 e9 0b 34 76 a4 +8b a0 e3 2c d6 ad 3d c1 dd 91 da 57 e8 8d fb c7 +b6 57 4b 08 e8 71 60 80 e1 5d f4 05 79 c5 70 5d +5b ef 58 4b 08 b2 63 db c4 f0 d1 59 56 ff 11 25 +c4 8f 89 59 1e bc 94 1d 9f e8 f9 a7 80 c8 2e a3 +2b f3 ef a1 6c ab be e5 80 fd 6b 95 74 08 0f 69 +07 fe af f8 1d 48 c4 9a 6d e2 24 84 80 f1 d8 52 +39 e9 a4 18 dd 53 10 de f7 76 e0 8f 50 9a 14 78 + +# PKCS#1 v1.5 Signature Example 5.9 + +# ----------------- + +# Message to be signed: +13 42 33 ba cf a1 6d c8 4d 8f a4 bd bb 47 93 d1 +da c0 7d 60 54 bd 08 39 61 da 68 67 9c a3 75 33 +4f 09 20 b9 df b8 a6 8e d7 7f 27 fd 92 19 28 13 +61 e0 9f a6 08 4f 96 e6 98 85 b4 7e a7 75 af 06 +77 2d 66 12 d4 d1 6f 4a 5c c4 cd 0d 1e b2 3b 7a +1f 09 56 4b 84 2e a0 7c bd de 60 45 3a 2a a4 ab +69 dd fe b5 b1 3e 9f 08 cd 07 2e 5b 71 ce d3 34 +ea 70 4c 74 9f f4 72 7e be 12 c0 29 0e 00 a8 41 +d7 4b 06 55 cf d8 06 5d 28 20 fd f8 fd c1 bd 45 +58 81 80 8b ff 0e c7 27 60 74 75 bf 0b 2b c8 93 +59 58 32 9b 77 8e fc e5 60 fc 26 c3 bb 6e 2d c9 +ae f1 8f 96 9f ba 64 74 5e d4 d8 5b 14 75 7b b8 +33 ea db 9c 5c b0 ea ed 08 d3 0b 95 15 00 5a 3e +88 09 1f c5 cd 2f 36 ad 95 5b 7c 6f 2b 19 bb a3 +74 fd + +# Signature: +3e 37 b4 2d be c1 29 db 81 c5 e2 a2 22 f3 1e 81 +b9 37 ff 02 24 95 18 18 37 30 37 8b 4c 09 2a a7 +f3 b2 34 59 61 1a 82 4f c5 27 54 42 1a 27 cc e9 +18 b6 2a a7 b4 46 38 a0 c0 82 79 80 52 a5 88 46 +68 82 51 06 90 ac 77 30 23 28 02 46 c8 90 ff 1f +62 27 04 9e 66 8b c9 d6 e4 89 b6 94 4a 34 e8 f9 +30 02 bb b0 0d 75 2b 57 7c e3 52 53 00 82 be cd +30 9b 0d ac cd 1d 68 d0 6e 1d f7 12 21 c6 22 69 + +# PKCS#1 v1.5 Signature Example 5.10 + +# ----------------- + +# Message to be signed: +35 da 3d 02 34 bd 74 fc d7 6e 8e 69 52 8f 65 1b +88 27 1c bf 16 28 69 38 c2 c4 a3 7d 41 1d e8 f6 +75 78 eb 8b 3d 20 a8 fd 7d cd e7 b6 56 fe 96 a6 +80 87 32 28 ed 0f 9a 62 0f 15 05 44 23 72 f9 b2 +b4 16 84 98 72 34 90 f8 11 f3 11 1f 5f 77 38 63 +47 b4 82 2e d9 d6 b5 53 83 92 21 5c b6 c4 86 5b +b7 b5 b7 e2 84 2e ea 0e 90 01 ca 0c df 5d 6b + +# Signature: +12 ff 2a b5 fc 83 d6 49 59 7c 47 bf f3 29 b7 f4 +61 db bb da 01 fb 6b ad 26 54 3e 4d bc d6 0c 5e +2c de bf b1 12 78 4a 96 4e 27 f2 a2 e7 fd 07 ec +39 0a ab 14 94 37 03 58 a7 5b 5e 1f a4 f1 ad 52 +02 e6 d5 46 c0 f3 15 e8 6f af f1 d2 5b 94 72 82 +da 32 ea b5 6c 22 f0 6c 8a 9d 32 ae f2 81 d6 f0 +aa 55 d7 ad 3b cd fd b2 09 a1 6e f4 5c c6 f9 68 +2e ae 96 3c bb 21 3a db 7f ad 1b ef 49 c0 70 4f + +# PKCS#1 v1.5 Signature Example 5.11 + +# ----------------- + +# Message to be signed: +75 fd b0 72 73 f7 54 d1 11 6f 99 7a f2 d1 1a 51 +2b 94 e9 e0 48 01 b3 fc 73 91 30 b7 47 b4 be 87 +44 d7 e7 f8 a2 97 a0 89 d9 05 0c 5f 54 f8 a3 9a +a3 f2 + +# Signature: +07 ff c1 b7 a1 0d da ba 96 05 f0 a3 d9 3c 8a 5e +4c 0b 77 58 61 39 05 07 31 d9 cc 9b 3c 83 d2 b7 +3f af 9a 4e 24 d1 c8 bb 0d 62 3d f1 0f c8 40 7d +15 14 48 fa 43 ee 65 81 e7 b0 ac 80 d1 4a df a4 +f6 d2 7a 76 67 50 b2 31 cb c1 c5 cf d6 2d f1 b9 +72 7d 8b 87 41 46 9f 68 e5 0a 9b 3b c7 ad e1 37 +db 06 74 76 03 74 28 56 d5 e7 dd b4 e1 6a 5b 49 +d7 36 5d b2 76 3b f5 fd ea 08 3d 81 fa c9 2d 87 + +# PKCS#1 v1.5 Signature Example 5.12 + +# ----------------- + +# Message to be signed: +96 c9 fa ce fb a2 ed 33 ed 8b 7b 3d 8b 6d f2 8f +2f ab 0d cd d7 a3 cd 7a 7d ed a2 54 5e d4 47 0e +d2 5b 46 d2 16 6e eb b7 e1 47 10 17 83 b6 45 ba +c6 26 64 b8 72 70 09 f3 5d 1e a5 fd a5 e7 c2 8d +6a f6 fe 92 04 6c a7 24 ca b8 42 5a 52 a0 85 f9 +ac 90 83 d4 d6 90 bb dd df d0 a8 2d 94 8f 70 d6 +85 e2 6b b9 f5 27 40 8a bc 84 7b ff 12 02 de df +6d 2f ac 6c f3 68 2a 51 6b a7 2f 4f e9 7b 90 46 +6a f6 e5 43 12 31 65 b8 a6 83 ca ba 2f a2 3a 86 +ac 06 21 30 65 e1 ed 9b 4f 49 af 4f ff 6d 46 b3 +6d 13 3d 8d a2 dd 29 d5 5f 9f 32 2c 40 78 5d dc +21 c4 26 c5 e0 a6 7d 41 4f 5a b9 71 c4 46 0f f9 +b1 14 30 5a 8a e7 e7 b9 5c 73 03 4e 8e 93 c0 35 +29 dd 50 c9 4f 07 62 79 77 5a 5a 3a 80 c5 d2 48 +6a 2d 51 08 48 bd c9 b8 52 ac 1d 32 ce b7 c0 41 +a0 8f 2f 8e 62 + +# Signature: +46 d0 3f ae c4 a7 23 18 62 1e f4 d0 c1 bc a7 1a +2a ee a7 a8 1d f8 fe bb 8b a3 fb 35 40 d7 2d 15 +34 b9 82 69 16 e8 9f 27 d3 25 67 6c cf 5a 0a a1 +61 12 db 2d 93 03 e0 eb ce 4b 85 58 7c 55 ac a0 +68 50 de 84 de c2 13 d1 13 74 04 a5 de e6 ca 88 +d9 1a e2 8b 7b 53 6c 90 20 2b c7 72 6d a5 04 2a +85 08 d3 b1 3c fb aa dc ee 12 78 d3 5d 30 3a cf +ee 6e 07 41 90 49 11 a5 f1 88 10 ad d3 e7 b8 f6 + +# PKCS#1 v1.5 Signature Example 5.13 + +# ----------------- + +# Message to be signed: +c4 b4 c9 96 6e 56 f4 0a ff 47 08 13 1c d3 71 44 +21 34 3e de 70 c4 d4 6d b6 ef be 1b 19 a9 e3 c2 +e5 81 06 00 8a 98 38 59 cf 94 2a 31 97 74 69 5a +0c 98 a9 63 e2 fe 9d 93 79 bc + +# Signature: +b1 6b 10 f2 bd 7e a0 f7 6a 9e d2 ff cf 3e c1 0e +dc b8 24 60 fe 55 82 a7 76 4c 0c 50 56 ec fb 09 +72 06 48 d5 f1 9b 3d ea f2 ac c9 86 46 0e 71 14 +26 15 83 a5 f4 a9 90 e9 22 fe b5 b4 78 97 34 fd +cc e1 5d dc 87 ca c3 f6 c7 c9 e9 e2 19 23 15 f0 +84 1f 43 ea 86 de a9 a9 38 05 08 b0 6c 9c a5 e9 +d4 a6 51 d0 12 16 62 7c 46 6b f0 d6 ae 74 4b f3 +0f d7 91 a8 21 03 39 f5 05 7f f8 5c eb 84 f1 96 + +# PKCS#1 v1.5 Signature Example 5.14 + +# ----------------- + +# Message to be signed: +b8 38 a5 d8 88 95 0f 1b 8e 4d 94 7b ba 51 af f9 +bb 60 b8 3d 09 ed 9d 97 96 7a 76 95 5e d1 dd f0 +48 15 20 bc f4 f0 8b eb bf 89 9c c7 c3 ef 0c 04 +d5 00 1b 1e 2e 84 5f af c5 83 30 0c 98 ac a7 a0 +3e 90 a4 34 de 77 fe f7 20 da 36 63 f2 19 98 20 +8a 94 f8 94 76 7d 3e d8 13 96 b7 ef b2 86 e0 ff +7d b6 ea 8f db 4e 72 83 46 00 fe 5f 7f 15 0a 01 +b1 d4 a0 8b 5e c9 ee 1f bc 10 01 d1 2d 52 36 db +f0 72 7e 7e a3 60 78 f3 eb ac 50 46 b7 65 b4 e2 +3c dc ef d1 15 d6 2a 50 34 4d bb d7 42 8d 48 ff +c9 4b 11 e2 1c + +# Signature: +b1 56 81 ee f2 96 a6 6b 9f cd 66 30 f8 9c 55 82 +6a 38 9e 0c 2d 3d 47 6a 0f 8a 1e 08 cb ca cc 66 +02 c7 14 43 8f 32 f3 4e 02 c3 6e 5c 0f 16 8a b0 +28 91 7e 90 50 fb c8 50 f0 cf 65 d5 ee db 3b 54 +be 54 95 bb f0 fa ee b3 2b be 5a 8f 87 bb ac dd +25 85 fb 90 7b 13 18 5b 02 61 56 63 d2 01 1e f2 +3d 0a b0 4d ad 1f fa 67 9b 53 15 2c 9c 42 b8 46 +39 68 4e ae af 64 4e 4f c6 ff 2e c7 d4 7b a5 ac + +# PKCS#1 v1.5 Signature Example 5.15 + +# ----------------- + +# Message to be signed: +9f d5 39 c8 ad 86 49 24 ee c1 d6 55 c0 7d 1f 28 +27 0c db 32 6b 57 2c 46 67 ec a6 48 8c 03 36 57 +ff 29 25 4b 91 f3 21 6e 1c ac 97 97 53 f2 23 b1 +79 ea 5f 9e fc 23 6d 40 1d 1b 9a 3c 20 eb 2a fc +9b fc fd 07 92 ac c5 b0 0c 98 28 a6 45 + +# Signature: +38 bf df d3 27 2e 48 cf ee 68 ce b9 13 04 eb 91 +ee 25 e4 83 40 1f 30 fe 12 d5 e4 35 18 e4 b7 71 +14 a1 2c 8c 79 92 ae e7 d2 e7 74 ff f9 1d 8f d1 +cb 7c 6a 2a df 79 b7 c8 ab 93 e8 37 4d b7 4c 26 +90 9c 65 9a 97 c7 6a 22 2d f4 fc 8c 7e f5 19 90 +80 ea ae 2d 03 1c a7 51 c5 01 32 89 db 4e ad 77 +b2 8b 76 a4 c4 96 ad 0e b4 22 fc a8 8f c6 84 e4 +2a ea 88 fd 33 c2 56 75 1b a0 66 83 4e 77 a1 e2 + +# PKCS#1 v1.5 Signature Example 5.16 + +# ----------------- + +# Message to be signed: +1d e8 07 40 9d 0a 61 b0 32 2d fe d4 99 e8 c3 32 +41 ec 89 cd 7d 9f c5 + +# Signature: +8b 66 64 f8 69 d7 55 c5 d3 e6 df 99 22 e2 27 c1 +10 91 8a 6f bd 88 c1 a2 e1 28 95 23 ad bb d8 aa +43 1d 07 86 85 3a b5 96 dd 5b 00 12 43 b5 4a 2c +b1 0c 31 66 bf 00 23 38 fc a2 03 45 ae de 1b 22 +ea 1f a3 d2 41 c8 6c 76 bf c0 2f 4f ce ae 12 c8 +a9 d7 e4 4a d6 17 16 65 e8 8f 12 85 22 dd 53 5a +9d 65 00 8f 6a 73 2d 40 af 20 4e 22 0f 1f ac d9 +42 e0 9d 15 09 9f dc 51 b3 a1 42 6c b2 dd 32 93 + +# PKCS#1 v1.5 Signature Example 5.17 + +# ----------------- + +# Message to be signed: +4b 2b cb 26 79 a1 4c 3c 4c 06 9e d0 89 a6 5a ba +29 f2 2b 61 78 c0 + +# Signature: +1c 47 82 8e a5 3f b6 43 6e 95 96 b0 ce 47 d9 f3 +8b 5d eb 0b 19 7c 1b c4 74 e2 e8 22 65 70 cc 1b +72 f2 39 31 2a e7 c3 c6 38 2e 1d 8c da 7d 4f 12 +fe ba d7 0a fa e5 ac bf 24 28 ab c0 44 21 bb 4e +1e 59 90 11 1b 9a c8 3c 62 43 5c 21 aa 25 fd 9b +49 07 58 54 11 d2 53 ba 9b 87 78 f6 24 05 3d 46 +fe 95 d7 e2 2c a3 93 81 c7 79 2e ff 46 43 8f bc +16 5e d7 62 9c 2f c1 ce f1 b3 4d 77 76 8a 20 55 + +# PKCS#1 v1.5 Signature Example 5.18 + +# ----------------- + +# Message to be signed: +ef 46 ae 51 e0 15 8c d0 ef 9c 78 d7 1e 00 15 67 +d6 6a e3 c5 e9 a6 4f 24 57 15 c7 c2 ad 8e ea 0f +9d 32 00 23 07 2f db 0f b8 6a 45 21 7f d7 12 cc +80 e5 b9 41 47 c4 5f e0 0b 69 2c cd a1 10 25 98 +41 b2 c7 e5 c3 dc ff 59 56 f2 a5 96 cd a6 8e b7 +7f 4c 85 90 d7 36 b8 fd 60 66 77 3e f6 f9 5a 38 +cd 38 4e 94 83 a8 9d c2 b6 c2 e8 74 5c 95 c1 2f +a6 72 a1 be cf b6 3e ac 9b 55 3e da 8d 29 37 54 +ec 39 47 ea c0 22 8d e2 63 14 b5 9b 66 99 4c c6 +0e 83 60 e7 5d 38 76 29 8f 8f 8a 7d 14 1d a0 64 +e5 ca 02 6a 97 3e 28 f2 54 73 8c ee 66 9c 72 1b +03 4c b5 f8 e2 44 da dd 7c d1 e1 59 d4 51 d4 bf +65 80 f3 e6 9c dc 02 71 38 2e 8d c1 4b c7 33 af +38 99 2c 1c d8 82 c7 b1 50 d2 3a 06 7b 9b cf 3c +cd ab 6b 0f ba 13 2b 4c 14 47 c8 7c 39 3f + +# Signature: +8c 1d e1 5a b8 6c bf 5b d9 31 7c e2 b8 fc 82 f5 +72 2d b6 96 1c 9f 55 51 40 f7 8e bd a2 4e 3f 51 +fd 73 01 c1 e4 fe 12 b6 95 7c 30 14 4f a1 e1 27 +27 46 03 dc 02 05 11 30 b2 53 85 fc 86 46 ee 96 +a7 45 50 d2 d6 3f 85 81 85 bb 98 46 52 a3 43 1d +53 3d a6 01 46 22 a6 4e 06 91 66 2a 4f 7c 9d 58 +31 9b a3 f8 5f 19 18 24 75 e1 50 9b bf 21 3a f0 +10 10 b4 b9 f8 2e 64 75 11 fc 97 c6 b7 c9 7e 8d + +# PKCS#1 v1.5 Signature Example 5.19 + +# ----------------- + +# Message to be signed: +f8 7b b1 2d aa ad 62 c8 64 ac 3d 44 4d 51 4e ec +6e 59 b6 7c d0 82 0d fc bd f8 51 ea 73 89 1f 58 +a8 be 6e 84 3e e8 77 3e 4d c1 c7 d7 42 da 82 ff +16 c1 01 1b 99 56 6b 9f 3f d1 7d 68 d5 ac 99 ce +f5 a3 a0 f7 53 18 76 9d c0 13 bb 05 5b e1 30 56 +df 49 a8 39 b8 39 52 51 39 9b 27 a0 bb 31 c5 54 +ae df 3d 9c 74 82 b6 62 0c 5d 7c 69 14 a5 64 db +04 a0 00 04 56 99 ee 1e 50 88 a5 b6 8d 81 4e fe +9d 13 0d c3 4e 2b d9 78 51 13 9c 73 46 07 65 b1 +f2 65 46 86 fe de 9c 9b 3e 92 40 9d b2 d4 2a 32 +ba 9e 20 bc ae b2 c4 f9 ff 9b 0e 83 4b 74 92 a2 +b1 d8 c6 5c 8b a4 98 34 2a e7 d1 d9 fe 74 05 c2 + +# Signature: +20 7a 34 8c df 68 4a a8 e1 a4 af 7b 7c 25 27 07 +ce 6f 1f 9d b2 29 1f 2a 95 a0 71 5d 9c 7f c5 1a +a2 30 11 0b 5b 51 8a 9c 8f 95 8d d2 0c 75 24 d5 +b6 51 06 d7 42 1b a9 fc fb 78 91 78 41 2c 36 40 +f5 40 b8 1b b3 18 97 d2 64 5e c7 9d 8e 59 75 04 +8e 45 22 61 a1 c2 00 9c fe ee 07 15 a0 1b ee fd +75 e7 04 b2 a6 f0 f0 ae 7e a3 6c 53 cf e3 6f 57 +f0 34 e3 85 44 8f ca ab 08 dc ff 47 7d 36 ff 15 + +# PKCS#1 v1.5 Signature Example 5.20 + +# ----------------- + +# Message to be signed: +4c 4b + +# Signature: +1c b6 88 12 83 dc d1 86 3b a7 9d fb 22 35 1b c9 +a8 e0 35 8b 2f 8a 1d e3 f9 06 5d 8c a8 59 31 4a +e1 12 13 a2 cc 87 b2 f6 32 ef a6 7d 21 03 f3 82 +00 b9 19 3e b8 d4 99 82 09 9a fc 74 42 8f 4b 41 +31 6f 48 78 b3 f6 00 bc 2f b3 04 58 cc 9c 2a 03 +4a 06 8e 98 d5 7a e7 9c e3 e2 fc 84 b6 a7 45 f0 +37 a5 de a2 b9 da 4e 8d b4 ad a6 9f b8 2d 20 a4 +1b b8 43 07 93 ee f9 2a 4f d6 18 6d 17 96 63 cb + +# ============================================= + +# Example 6: A 1024-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +d6 31 14 57 e1 ca f1 22 44 36 69 79 83 c8 6d d3 +38 20 58 62 d2 a1 05 ba f7 10 34 28 fd 83 53 a1 +9b 7b a4 22 8f 78 b4 7f 79 07 35 70 34 c5 2d 85 +97 da 2b 5d 13 dc 53 5b 83 6c 74 13 0a 36 48 91 +8d 4a 7a 83 99 0c 2e 28 81 6a ec 0f ca 01 d1 05 +c6 c6 52 ec 57 33 d0 1f 00 58 b2 df 5a e6 73 33 +40 5a 3a 5b 12 20 a2 6a c3 d1 42 f2 b4 d8 37 eb +73 86 a4 0a 74 cc 3d 1e 4f bc 64 fd 7d a6 3c 41 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +d6 31 14 57 e1 ca f1 22 44 36 69 79 83 c8 6d d3 +38 20 58 62 d2 a1 05 ba f7 10 34 28 fd 83 53 a1 +9b 7b a4 22 8f 78 b4 7f 79 07 35 70 34 c5 2d 85 +97 da 2b 5d 13 dc 53 5b 83 6c 74 13 0a 36 48 91 +8d 4a 7a 83 99 0c 2e 28 81 6a ec 0f ca 01 d1 05 +c6 c6 52 ec 57 33 d0 1f 00 58 b2 df 5a e6 73 33 +40 5a 3a 5b 12 20 a2 6a c3 d1 42 f2 b4 d8 37 eb +73 86 a4 0a 74 cc 3d 1e 4f bc 64 fd 7d a6 3c 41 + +# Public exponent: +01 00 01 + +# Exponent: +5e a6 11 77 44 2f 89 9e ba c5 d0 96 01 c5 ef c2 +06 6b 44 a3 66 b0 00 f8 3d 74 cb 97 d1 6e d6 e5 +f2 ef 0f f8 b5 ad 81 15 53 45 fc 37 39 1a 68 a3 +40 17 08 52 79 14 43 41 8d 31 bf 99 2a 4a 12 86 +6f e9 ff cc de bb bb a6 37 ee 88 7b 71 6c aa 92 +e2 49 ce d6 57 ee d7 1f 5c cd d9 16 3f 32 69 52 +5d 78 9f 4b 33 c4 8a 95 76 44 36 ec 32 5e 86 89 +69 1c 27 2d 90 bd 88 88 98 51 37 2f b8 dc b9 + +# Prime 1: +f3 d4 b8 51 ad 7a c7 78 be cd dd ae 71 b6 13 f6 +59 7c 70 75 c4 d2 8d db ae 1e fa cf 03 59 71 ab +63 ee 90 db bd fb da 43 25 a1 5f bf 84 5e ea 54 +bb cd 05 57 4b 1c d6 01 dc ad ba 12 06 28 05 b9 + +# Prime 2: +e0 e1 ad 57 d6 8f 30 13 28 8c 14 83 e8 c5 b1 2e +fe b6 ec 14 5a e4 18 8e 1b 3b 39 04 87 90 0a d2 +c3 25 d2 32 80 6a 62 17 34 2a 65 75 95 14 f2 26 +8f ca 72 c4 c5 bb a0 32 81 89 dc fa e2 06 ae c9 + +# Prime exponent 1: +3b b6 d2 d5 1d f9 3d b4 b2 75 d4 5e 8e 76 9a f8 +ef fd 6b c5 4b c8 8c f9 49 f1 48 57 3e 68 bf 4f +cc 0f 76 e6 79 e6 9e 13 67 b9 d7 ab 1d 8d e9 31 +8b 34 b0 a4 2a 3f 0b a2 35 1b 4e c0 6f 45 89 f1 + +# Prime exponent 2: +71 f4 aa 5c 8a 93 80 af 14 aa f7 72 68 b0 55 3b +15 44 28 99 9f fd 5a 1c 18 dc 87 e6 2d b3 e6 68 +2b 0f ad 56 7e 10 6a a8 8b 7c b8 71 3f 1c a0 20 +be 58 be 93 cc 07 6a 04 6d f4 28 90 d1 9c c5 51 + +# Coefficient: +23 1a b8 dd 9a 56 99 d7 97 59 11 ef 0e f8 7c 28 +dd b9 2e 24 6e c3 4c 5f ac 33 83 22 dd ec 89 8d +56 68 67 45 3d e6 d7 8a 45 c3 16 b1 45 a2 86 18 +94 0e 1a cd 11 58 c3 af 92 fa ab fd c3 97 84 32 + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 6.1 + +# ----------------- + +# Message to be signed: +8f 75 0e 65 95 1b 5d e7 58 14 b0 b7 66 30 dc 9f +1c 62 53 a0 59 0e ac b5 51 2a 8a 4e 1a 8b e8 52 +5d 36 94 1f a9 d0 92 f6 bb 44 22 aa 8c 0a d6 42 +3e a2 8c 10 ca a6 e9 54 b7 95 69 d4 4c 86 0f 1c +65 81 eb 17 a7 54 3e 7b f7 fe + +# Signature: +b1 8b 5e c8 8d 4e 24 c9 14 b6 65 ff 9a 2c 75 f4 +e9 19 37 df 8c 19 95 59 43 e4 51 ad df 34 84 e4 +97 97 8d 26 da 23 1a f1 4d 9c 29 27 ed 21 0a fb +f9 de e3 32 67 aa 45 68 46 49 e8 6f b2 25 a0 53 +b5 45 52 90 c3 20 e3 f6 40 62 3c 75 ca 42 37 21 +f2 80 b8 87 44 24 97 f3 2a 90 d7 8f 64 44 04 77 +ad 09 27 c7 ba 01 c4 4d a9 d5 c2 83 a4 38 be 0d +c5 80 a0 05 28 fc 65 e2 04 d4 2a 2d 4e 29 13 c1 + +# PKCS#1 v1.5 Signature Example 6.2 + +# ----------------- + +# Message to be signed: +bd bf 3b 36 40 73 fe 04 8f ba e5 5e 3c de 66 8e +84 f7 53 ab fc 71 0b 8c db 7b 6c 0c f8 2d d5 b6 +74 d2 1e 2b 3e 36 b1 b0 36 0d f8 bf 7e 62 27 c9 +2e 15 f3 d7 84 + +# Signature: +66 ac f0 43 bc 6a ae 81 a4 d5 2b 4e 8c 40 12 8b +25 c6 d1 0a 8c 69 8c 83 ae d7 1e 8f 35 83 89 8b +e8 f4 c9 be a4 b6 31 90 e2 15 26 ca f8 3a b1 4a +4f 8b eb e8 13 a5 ab eb 95 95 67 bb 2f 06 c5 f1 +1e 46 4b 5c df 7b 2a 13 2d 42 6d db ec f5 85 90 +0a 0d 80 92 ca 52 b6 dc 0a bc 35 f1 40 94 69 89 +46 e1 cd 0e cd 6b d4 1e 2c 6f 96 3e e8 9c 82 19 +3e cc 5f d4 76 30 d3 4a d1 6c a2 47 9e af 06 2d + +# PKCS#1 v1.5 Signature Example 6.3 + +# ----------------- + +# Message to be signed: +3c 5c 74 bc 8f ae 80 7a e5 8b d2 13 e6 27 2a a3 +85 79 31 57 5c 2a a2 be 4b ca e4 d7 9a e0 87 b6 +b8 6f 91 5d f8 c0 96 c1 22 ed fb dc 79 7f 9d 70 +b9 76 13 97 fc e3 d3 e0 b8 a6 f2 56 db c6 60 5b +a9 48 d5 fb e6 f5 24 5c 02 95 ce 5d d7 3b f7 43 +65 17 f7 c4 22 2d 2c fd 85 42 e7 a1 00 cf 05 13 +04 a1 ab 6f e0 05 da 07 7b 62 87 8f d0 b7 41 e6 +27 1e 0d 34 6b 20 72 3b 7e 00 b3 b8 19 4e 1a 46 +0c 6b f2 56 00 76 82 90 c1 dc aa 2f 41 b9 41 a6 +4f d9 02 14 d5 16 6d 78 aa bb af 7e 41 d2 4f f6 +36 c9 76 2f d8 92 19 9d 2c fd 9d ed a5 00 51 e0 +01 b9 fd 3e 5e 22 27 ae cb 15 c1 b3 13 71 b3 5a +78 b3 b8 b7 63 63 76 f1 34 56 2b 4e 52 f4 51 b7 +41 a1 9a c9 32 56 9f f3 04 1f af 12 27 9f 90 + +# Signature: +5e 89 7f 87 9b a4 6f 67 11 2c d7 c7 c6 fb 27 37 +ad 79 3a 87 28 79 05 2a 88 45 7a f5 e9 d5 99 59 +a8 48 13 4a 68 24 de 3a 67 4f 72 a9 06 87 9e 95 +be 0e d8 7e a9 f9 74 a7 a0 7b a9 ad be c2 fb fa +02 94 37 8b 14 e7 35 f5 5f 40 3c a0 53 08 4f 51 +d3 d3 42 d8 af 9c 64 b4 d1 54 ad 9a a3 c6 bc aa +ce 1f 1b be 62 ee b5 d0 e6 c4 c0 30 93 c2 af 0f +07 88 8b 8b be fa 79 40 03 23 13 3f 77 6a 32 13 + +# PKCS#1 v1.5 Signature Example 6.4 + +# ----------------- + +# Message to be signed: +42 56 46 65 0d 6b 37 9e 16 e1 5b f3 85 3d dc 9d +44 4f 44 53 5c 49 3a 37 03 b0 01 63 af 34 76 df +37 2a 5b 28 f3 34 c0 86 03 13 e8 13 6d e6 08 29 +1b 33 78 38 1b 9e 21 eb ef 24 82 5d 12 + +# Signature: +a6 a0 cb 02 48 1a f2 48 ab ae 89 cd f4 16 1f 67 +76 d4 71 08 f1 8e c6 e8 43 7c 22 4a 14 f4 52 ad +a1 36 52 0f 0f e0 10 a7 34 5a f1 97 1a 02 e4 bc +f8 c9 8b 26 c5 b8 c6 00 3d e4 d2 b4 07 2d 8d ef +1e 19 23 d9 cc e0 a6 75 14 1d 37 87 3e 59 48 ea +6c 8a 78 0e d2 a5 ec c2 ba 9a 81 20 6c 7e cc c8 +0e ac 02 6d b7 d7 60 22 3a a2 38 7a 18 2e 98 d6 +6f 1e 23 df ea f3 51 5c ee 4f a1 ab d4 64 b7 68 + +# PKCS#1 v1.5 Signature Example 6.5 + +# ----------------- + +# Message to be signed: +f4 7d 87 bf d4 88 af 5b 24 db 34 ad 0c 13 1e fc +a1 0c dd 1a ae ff be 6e 36 48 47 22 ed 68 09 b1 +d5 7a 18 3b a0 3d 5e 40 5d 12 56 b2 50 5e cb 84 +db 35 df a9 4d e8 5d c2 a1 58 8b 6e 83 12 4c f8 +6c 5e 91 66 86 0d 4d d4 71 70 43 2b 08 ae 6a 6e +30 87 10 86 fa + +# Signature: +6c 00 8f f0 e1 28 fc ec 26 5f 37 9e b0 83 db 50 +62 4a 27 98 f9 33 67 c6 d1 6e 5d 95 a9 89 f4 f1 +ee d0 cc 4c d8 61 c6 a5 24 f2 b9 fa 30 e8 86 f1 +47 77 41 d7 ea 8a 60 df 14 0a ec f3 a6 cc f0 04 +3d ab 92 cb e7 29 53 cb 1c 18 41 e0 59 18 ec ed +5b 0f 69 4a f9 a9 8e c7 f4 e2 28 6d 23 3d fd 35 +13 2a 0b 58 4b f0 e0 dc bf 05 11 9c e2 e3 a4 d8 +13 cf 02 8f ec 48 c3 4a 18 81 eb b5 31 ca 48 9b + +# PKCS#1 v1.5 Signature Example 6.6 + +# ----------------- + +# Message to be signed: +03 18 78 d5 88 ee + +# Signature: +cc 15 4e 1a f7 13 f2 f9 5e 16 f4 11 17 5d 98 36 +ad 6d 8b bd c8 f9 8c f0 5c fa 00 58 23 5d 1f dd +e0 40 82 76 4c 29 dc dc c5 9e be 26 57 8b f9 e8 +ad 6a 5a a8 6b 9d 62 91 4b 4c f6 96 a8 ec 2d a8 +79 f8 fa 42 31 46 31 32 ea d7 bb 3b e7 50 ae 0c +56 28 a3 96 b7 0a df a2 7b 40 34 23 b1 00 18 f9 +d2 4f ea 33 70 30 14 7f bf aa 15 d4 75 32 c9 25 +7c 2c 7f 54 1b 5b 97 4d 15 dd 1e 3f d2 e2 0a 69 + +# PKCS#1 v1.5 Signature Example 6.7 + +# ----------------- + +# Message to be signed: +27 26 38 52 ea a9 60 bf 76 71 87 6f c7 90 0f 89 +8e a8 2e b2 b0 fc 41 85 65 fd ae 62 f7 d9 ec 4c +e2 21 7b 97 99 0d d2 72 db 15 7f 99 f6 3c 0d cb +b9 fb ac db d4 c4 da db 6d f6 77 56 35 8c a4 40 +11 5d 3e 5b 3d eb 1b a1 bd 90 ca 12 86 fd 10 0c +af 9b e4 85 a4 4a 38 45 00 57 18 10 4b bd fc 5e +78 1a 9e 37 d6 7a ff e5 56 dc a1 0f 8e fa 39 f9 +cb 63 92 a7 2e 3f 28 25 81 1a 2c 05 af 84 af 9b +e7 f3 71 db d4 10 6d 9f + +# Signature: +94 79 8d 17 94 78 bf e0 6d 96 a3 4a c9 9b c9 d5 +de 35 dc 46 97 ac 3f 70 e9 b3 4c 95 e2 2b 1c 30 +d1 42 6b e3 50 8e 62 2c 1a 18 ab 3c 46 72 fe 3d +e3 40 eb 51 0f b9 87 b5 3a e9 3a 59 af 6b 00 bb +ae e0 e8 27 08 e6 c6 ae 82 c8 45 53 24 01 78 36 +db 17 66 0d 06 9d 80 27 1e 1e a9 98 11 63 b1 4b +66 87 6d fd 12 8f 09 cd 2e 3d 6a 36 b7 3c 3b 40 +ad 8e 13 24 84 90 29 c8 b8 e3 c8 89 4e bf a1 94 + +# PKCS#1 v1.5 Signature Example 6.8 + +# ----------------- + +# Message to be signed: +a4 fb 21 03 d0 be 29 0e 99 60 16 a4 39 46 2e 6b +bd b0 72 4d 86 cd 51 85 91 33 ca 3d 39 da b7 7d +a2 06 9d 82 83 58 96 38 7c cf 3d f5 cd d7 a5 79 +3f 22 3f 3d 92 3e a4 63 51 35 31 ad a6 67 ab fe +f7 53 98 c7 a4 bc 6e fa dd 4e de ef 35 ab 8f 54 +01 e0 da f7 c2 fc a1 cd bb ee d3 bc dd 09 33 ff +3e e4 c5 e2 88 ab df 21 9e 36 a3 ee 6f 21 08 41 +a0 3c 9e 3e 4d ac 18 12 24 82 ef 85 f4 9f da cd +c5 02 d2 79 f1 57 7b e7 7a 4e 00 b7 c7 f1 7b a5 +da 6b 28 c0 1a 07 a8 63 df b2 1c 15 6d a3 20 01 +f5 3d 7e a3 fc b8 c9 55 4f 07 54 59 a6 7c c3 c4 +e6 9a 6a 37 17 87 87 46 3c eb ca ed a6 49 0a 8f +80 b3 92 de f9 f2 2a 4f + +# Signature: +72 66 70 c9 51 0b 58 35 4c 8a f3 2b 41 db 8f 69 +21 07 c0 c8 76 e5 52 73 a8 20 a0 c3 0d 39 24 46 +0f a5 bc 33 df e1 9d 72 e5 63 49 28 2a 80 fb 12 +a8 fa 9e a4 a5 da 69 c5 82 d7 c6 41 22 a8 a7 91 +b3 21 2c 39 e0 28 26 5b 84 54 df 71 5b a3 0b 00 +3d 12 91 69 cf 12 51 1c 0d 3e 7a ae ce f3 79 2c +f1 85 64 4c f8 0e 44 81 47 b1 a7 96 1a f3 84 41 +7d 18 2c 6f 85 52 46 da d5 b8 93 d9 a7 68 0e bc + +# PKCS#1 v1.5 Signature Example 6.9 + +# ----------------- + +# Message to be signed: +e5 50 6e 04 b1 91 84 10 76 85 87 25 a9 fd d8 f9 +74 5f 24 2e 99 49 4a 42 3f 80 36 74 74 27 1d ce +95 a9 9a 2f 71 13 4f 39 fb 3f 2e 47 c6 a0 b2 fb +6f 61 5b 0d ee 6d f3 3b 28 f8 b0 d4 1e 92 d1 42 +b1 46 e8 cd e9 b1 1d 6e c1 d3 7d 71 fd 82 b7 19 +ce 1a dd b8 21 ca 4c af bd 2a a4 f1 e6 11 a2 59 +e5 f0 5b 53 1f a1 1e 3b 67 1b 7a 5b 10 b4 c8 15 +6c 25 b0 a5 9e c6 e1 58 f6 d3 46 d8 48 04 fc f9 +2a 72 76 8f 4e bc 93 5e ee 5c fe c7 f6 e6 e8 3c +be 15 8a 13 27 5e 84 18 3a 94 d7 24 b0 e9 66 96 + +# Signature: +34 22 0e da fd 4a c8 84 b9 d0 0f bb fb 71 a4 a6 +c4 d4 b7 1c 19 84 22 05 07 99 d0 c0 fd 54 e9 09 +a4 ca d2 29 8f aa b3 34 7a 0a f0 d2 7d 53 01 a8 +86 00 9c f5 c6 f1 25 df c1 13 1a ce 38 8b b2 14 +c2 84 44 20 c0 23 db c8 b4 a9 66 11 b3 b3 93 ac +c3 83 94 90 fc 4e e2 d3 69 b8 c3 c8 76 57 22 83 +ef 34 d7 0c 64 03 ef 9e 2e 87 a2 76 b2 35 72 ed +82 e2 40 22 67 c2 73 7f 75 bb 4a 27 d3 cf 16 d2 + +# PKCS#1 v1.5 Signature Example 6.10 + +# ----------------- + +# Message to be signed: +8f c9 cf a7 21 df a0 9b a0 72 9e f9 18 9e 54 27 +b3 e7 38 c5 ae 38 a2 65 7f 7c 7e 31 4a 49 ca eb +a0 fc 9d 45 40 f5 f8 d6 c0 47 53 60 0e f6 b9 c3 +39 65 40 f8 6c 11 75 b6 0b f4 0e 3d 8c 84 51 35 +5e 13 74 f4 30 43 c0 c6 aa 41 d3 79 6b d8 27 9b +3c 30 62 b3 74 99 6b 7e ae dd 4d b0 ae e8 c9 4b +93 b1 71 fc 41 1d 4d fc 37 28 d0 23 15 58 cf c8 +fa 45 f9 51 b3 5c 9d 46 12 18 a6 50 c7 02 ce a9 +3b b3 fa 14 36 ed 44 5c 95 24 9d c2 20 54 71 01 +b9 a9 3e b0 14 cd 84 3f f3 9c e4 c9 6f 82 a3 9f +86 3a 4c 2e 1f a9 + +# Signature: +a2 6e 7d bd 5d fe 08 c7 2b d8 0d 5e 26 68 d5 d7 +2a bb 1a 0c 04 20 ff 0e a8 6a 9c 76 08 c4 70 e1 +c3 f7 2e bf 44 5d 12 18 71 81 41 55 58 dd 03 eb +e4 07 aa 06 b5 16 47 ba fe 0c 85 f3 d3 b8 dc e9 +0c eb f0 a0 ee cb ac 12 28 e7 85 82 0c 4f 90 9d +2e f3 92 f0 31 17 56 1e c3 8e b0 d8 8b 02 32 72 +a4 28 63 51 62 0f 21 04 3c ca f7 50 36 84 00 29 +57 ef 79 bc ff 9d 1c 20 1c 42 e0 96 0b d9 69 79 + +# PKCS#1 v1.5 Signature Example 6.11 + +# ----------------- + +# Message to be signed: +96 1f e3 4a 21 2c b0 e6 f6 dc de cf 1a 4c b7 b2 +14 39 0a 77 f4 4d 3a 3b 3e e2 b1 2f 1f 0e e3 14 +2e 9e af 70 89 55 ec 83 7e a1 d0 d2 95 4e 6c e9 +50 f3 4c 87 30 54 8f 2e 09 5d 5d bb 93 8b 19 0b +73 8b ff 81 71 93 02 b6 79 8b 76 8b 0b bd d2 e2 +b9 67 2d 89 14 05 c7 71 a7 79 02 fd 54 27 42 5a +f0 4e 21 b9 1c 5f 39 37 20 41 e4 94 d9 be 62 de +ce 31 bd 8a 26 2f 6d db 84 9f 06 8a a9 9f 7d 62 +62 e1 84 ab 9c b1 62 24 47 d6 2f f6 71 09 20 30 +70 71 c2 72 be 0b b3 7f 0e ef 64 5f 99 ea b5 1b +0b cb bb 64 87 d8 d2 b4 9f 3f 23 e0 aa 91 8c 89 +ac 85 56 53 e1 cc c0 05 91 58 0e 0c e1 e3 87 79 +c0 4b e7 df 1c 66 63 ac d9 93 7e 47 2b 3e b6 d4 +b7 0a 08 0d e8 e0 35 48 f5 12 45 be 7c e0 b8 6d +ee c1 76 e0 0e 54 bd 63 bd 5b b0 2f c9 54 + +# Signature: +98 ac 47 73 59 15 9e 93 e1 b3 36 ee 05 60 6d 42 +b7 e1 25 0d 12 95 60 c0 d0 95 f8 f8 ea 3c 04 74 +32 a9 9c 1e c4 bc 88 7d 7f 07 f6 1d f1 6f 0c 09 +f7 15 b7 05 38 8b b8 a6 11 87 34 6e 8d 7b 07 ea +b2 fc 05 db 89 e0 30 09 44 ae 37 73 e4 4c b9 2c +5c f0 f4 fb e0 1a 05 ad 79 bf aa 24 7f 83 ed 1e +da 48 ba af d1 e1 80 07 8c a8 d3 21 d5 0b 42 57 +87 f0 12 43 a4 93 37 4e 84 f5 cd 56 b7 53 d7 ac + +# PKCS#1 v1.5 Signature Example 6.12 + +# ----------------- + +# Message to be signed: +96 ff 0a 5e ca c9 51 16 bd 73 43 79 5a f8 3c 87 +ed 9f 83 45 d0 3f 6f 32 2f 29 54 93 f4 0b 19 ba +8f fe 2c 89 8c 7b 20 66 21 f7 2e 02 c7 f0 f0 0f +9f 1c 52 3d 73 d3 35 a2 6c ed dc 73 98 b7 ca 20 +09 ca cb b1 82 83 b7 6b 28 15 d1 e9 01 00 09 6e +95 b8 85 30 f1 c4 8c 39 61 c4 35 bc e0 28 9f f6 +2e 21 bf 4d 3e c8 99 c8 7e 14 c8 ea d7 92 2e 79 +5e 3e 6f 41 80 c0 89 9e a0 + +# Signature: +7c 7b 01 57 f6 a5 09 09 51 09 63 28 2f 00 11 1e +ea 70 19 37 54 e4 27 a0 2b 34 6f eb 68 2f 4c 71 +87 bb 38 1d 31 d2 3b 94 76 88 43 24 5a ad 53 61 +fc a4 2d 8b 28 4c 8d 92 e6 fb 99 2f a7 71 2f a5 +a9 31 55 df 02 0d 30 0a 3b f8 98 86 66 8c f3 7b +d1 3b 55 0a db 2d 2a 86 c6 9d aa ac dc 50 30 dc +84 34 3c 8b 49 34 f0 3c dc 0e ef 0f 6c 1e a7 ec +09 62 00 79 03 b4 48 21 7d e9 3b 75 07 54 9b 2e + +# PKCS#1 v1.5 Signature Example 6.13 + +# ----------------- + +# Message to be signed: +32 a1 2e 0c 67 0e d2 15 ae 54 49 a0 91 7a e9 5e +23 db 80 3a d2 8a 18 42 ed fa 90 bc 40 5d d8 9a +1b 46 8a ce bd 08 fe 9c 69 3d 8f b1 05 e8 22 2e +b5 7f 79 e4 b2 27 00 e0 7f 27 6d 4a ec c7 a1 5f +b7 47 33 06 56 27 b8 79 b0 16 ee d4 ab 4a 1c + +# Signature: +85 b9 0e b8 26 51 4a 0e c0 fc 1b dc 34 86 a8 dc +8b 0f 26 3e fe 57 cf 17 50 a4 2a 6b 5b 99 72 64 +fa 61 78 64 83 7e 63 9f 45 d9 20 58 41 cd c1 34 +ab ea cf 6e e0 ec da 09 b9 8d 76 9f 51 f3 94 7a +33 58 7f f0 c8 dd 01 b7 f6 b2 4a 2f bf 29 c9 ff +f7 37 ee e5 6a da 2c eb 74 6b 02 5d 95 65 22 d9 +20 d1 2d dd 13 db a0 8b 20 e1 ee e1 3a 8b 25 80 +e5 92 c3 4e 39 33 37 66 11 5a 23 b9 d0 0e 2a 42 + +# PKCS#1 v1.5 Signature Example 6.14 + +# ----------------- + +# Message to be signed: +bb da 73 cb e2 bf f7 ff 53 62 eb e9 32 c0 a0 dd +68 ac 84 ee 99 8f bf 59 a2 a9 26 55 20 32 31 63 +b3 0d 9e 70 08 b9 4b 0c 0e bc 5f 6c 4c 97 3c 13 +ff 15 3d 31 69 0c 3c 95 ab 23 1f 0c 9e c9 98 fb +fc ad c2 8b 2d 7f 06 50 7e 17 d2 1e 82 da + +# Signature: +26 f9 52 b6 57 fd b9 a1 1d c8 43 79 0c 9d 2a 6a +51 c9 76 10 1e fb 82 d0 53 60 67 62 ab a3 3a f6 +28 0b de 38 15 e0 87 4d 60 78 75 38 42 e5 b1 c9 +0c f7 99 12 20 fc fa 62 28 49 43 69 0c 30 1e 9f +c6 e4 79 af 68 b9 69 47 85 be 40 d4 69 86 a6 2a +12 1a a9 ad 0d e9 69 52 1f 1c b8 e7 c4 bd 70 c7 +c8 cd 7a 9d 13 54 e7 d0 aa 0d 85 d6 d7 aa 00 e4 +64 90 26 d6 f0 70 f8 b3 c2 7c 98 55 6b ea a4 c0 + +# PKCS#1 v1.5 Signature Example 6.15 + +# ----------------- + +# Message to be signed: +2c 32 5d da f6 52 6a 1e a3 51 8e e5 e5 40 7f 03 +90 e0 eb aa a5 f4 72 a1 e9 ab 46 f7 46 d7 1b a2 +e2 17 fa a8 17 99 bf 35 8f 95 e9 83 08 27 0b 18 +a0 01 99 29 a2 88 d0 c9 56 e0 bf 17 c5 19 8c eb +2c d9 fe 40 d7 02 a4 4e 56 45 ec a5 b4 39 ab ca +7b 2c 6f 95 ac c3 c2 c3 65 19 5c 79 5e 91 d6 3b +3c 09 33 24 4f f1 25 63 af 66 22 a4 0c 74 15 db +60 a7 8d ca 02 60 25 14 39 53 8d 38 aa 38 28 9d +92 88 86 ab 12 87 36 a6 a8 73 9c 14 55 c4 84 9f +2d 54 56 45 37 93 + +# Signature: +6d 1f 20 3d c3 ff a7 a3 34 d3 1b 9a 75 e0 12 58 +1b 8d 62 b2 bf 73 80 0b e5 1d 02 65 33 99 83 18 +c0 ca c9 2a 02 d4 6d 75 9b f8 0a 41 da a0 a6 a2 +9f 4f a0 bb 60 66 4c ac ad e2 4a 65 cb 47 65 11 +09 be ec 82 31 91 95 25 d1 47 32 68 74 55 78 db +9e 30 64 10 8a e4 6a 48 70 f1 80 66 78 9b 03 66 +a7 d0 ce 37 e0 30 b5 89 46 ec 8c 1a 14 11 54 db +0e 26 1b ef 8b af 2e 9f 65 fc d1 6b 7d 57 97 b6 + +# PKCS#1 v1.5 Signature Example 6.16 + +# ----------------- + +# Message to be signed: +29 85 e8 b5 50 81 2f b6 6c 18 f8 0e 6f 09 2a 94 +5d 09 15 83 86 1b 62 5d 1e + +# Signature: +2e 84 30 13 cd 5e 79 5e 21 66 c8 e9 1b 06 c3 13 +1d c3 a5 e1 21 36 d7 16 0f fd 11 bb ef cf 6a b6 +40 e0 5d 76 e0 c6 1e d3 06 f6 08 6b bb 56 7c a8 +7e 40 c6 92 4d 5c 84 a6 ce 28 a8 39 50 bd 4b 84 +e2 7f c5 06 9f d0 62 4d 50 ea c2 4a 94 11 b5 f7 +67 85 d9 db 5d a3 0f 42 56 95 b0 19 b8 4c db b8 +25 bd 46 e7 35 2e 08 f1 14 c8 7b 06 6f e4 3d 10 +56 a2 c6 10 ce a7 e3 d3 dc 98 bf 44 97 eb 4f 13 + +# PKCS#1 v1.5 Signature Example 6.17 + +# ----------------- + +# Message to be signed: +77 78 8e 83 8b 83 4e 8f 4d 04 5a a8 94 b9 0a bb +85 94 0c fc 58 d7 72 5e 7f 37 3d a5 54 71 37 c6 +0b ea 75 1e 01 42 bf 9a 6f 46 49 ae b5 46 ed 56 +0c c4 ea 15 62 d4 a5 fa 3e b1 b1 14 77 a3 05 1e +24 c6 06 b8 a7 1c 1a 77 4b dc f1 a5 31 0f ed 55 +59 23 73 0f a8 af 4c 15 80 0d 36 2b 37 ad f1 4f +7a fc e7 8e fa 6b d8 93 56 3e fe 0b 3b 82 8e bd +49 9f 12 a2 fe 33 2b fe 46 dc bb 31 4b bd bf 69 +08 7e 2a 66 5d f1 10 83 5d e5 5d 61 e5 c2 02 5f +d8 db + +# Signature: +8e 5f 33 53 c4 9c bb b2 ea 69 6a bb 57 40 ba e0 +15 ef fd 95 0d 56 07 13 76 05 a1 00 c4 a5 3f 1b +95 17 6c af 34 9f 4f d5 88 ae dd dc f5 06 0c cb +72 47 8c fb 09 85 62 f3 4d 8f 8e ba 44 6a 38 47 +56 5a 7b 89 55 ad 9e 0c 6e b6 70 99 e1 a4 6c 3e +b2 d4 9d 90 90 ae 5f 63 e8 a0 8b 6e 8f 21 f0 03 +e4 51 d2 50 ff c5 a7 90 d6 6a 0e 2e 3e 28 a6 33 +9f e9 1d 11 29 21 f5 5d 12 30 30 6f ad 5c 01 90 + +# PKCS#1 v1.5 Signature Example 6.18 + +# ----------------- + +# Message to be signed: +1d 59 9d 76 2c d5 4d f7 0f 1a 09 83 bc 3e a2 bb +ca 6f cb bd 16 26 03 ba 81 56 10 77 fd 92 84 92 +5c f1 f1 b0 8b ea 1e 70 bc 59 5d f0 b3 43 b8 3b +9c f3 d6 34 f9 5e 37 e8 d1 c5 85 fa b1 99 + +# Signature: +71 74 97 a4 e6 0d bf fa 19 6e ff 75 8e 90 1c e1 +fe 6e 2b c7 e1 d5 3a 3d cf 62 25 67 1a f1 46 c5 +de e2 00 a8 14 f4 89 8d 16 a9 b5 f5 08 dc 9f de +4d 64 07 0e 55 ae 3b 1f df 79 19 f4 2b 7c ff b7 +e9 28 c4 ca eb 55 2d c6 fd 08 18 34 b2 dc 2f ed +07 e7 e6 27 d3 4b 39 10 ca 71 3b f4 15 4e ff 99 +96 57 36 15 18 fc e5 a8 f6 42 dc 9a 18 a6 6e de +22 19 0f 60 aa f9 58 d6 24 6b 00 a0 32 c3 98 41 + +# PKCS#1 v1.5 Signature Example 6.19 + +# ----------------- + +# Message to be signed: +da 51 00 86 60 b6 3b 87 67 e6 5f 12 c6 30 8e c1 +8e d9 57 5a 42 6b c5 fb e6 60 10 ec 3f 01 17 5f +fa 57 41 ea cc dd b0 2f ce 7b 2e f7 78 44 40 d7 +2d 37 52 20 3f 53 4e 52 fc f6 26 a8 c5 96 51 3f +41 90 64 bb ba fd e7 f8 d6 5f 30 d7 ca 68 71 89 +70 de 71 fc 8c 0e ed 4d a0 0a 4e 1a b5 41 02 d9 +d1 65 bd 7c 54 af 5c 31 c1 5c 05 bc a5 5b 6f dd +19 10 86 a5 3e 52 96 f4 84 c3 47 d8 fb 94 5a 10 +c4 94 49 75 27 32 f6 2f 34 c3 25 15 58 86 51 13 +79 19 28 5a 2c 8e f7 b4 aa 0e 69 0b 0b 65 43 7f +f8 d5 6f c9 5d cb c3 e7 8d + +# Signature: +32 67 72 28 ff 08 c6 6f d0 3b b3 1f 0d fe 89 01 +53 b3 44 6b 57 eb 84 ef 39 56 20 8f 72 a0 7c 87 +67 e6 bf 09 f0 38 bc f7 f7 35 ee 24 a1 f6 40 a1 +89 8d 40 9e b5 3a bd b6 93 94 27 34 56 9a f7 1a +4c d9 9a 65 20 ba ca 5d 42 86 b1 99 cc 67 62 8e +2f ca d2 96 a3 0e ca 49 9e b8 80 50 7f 6a 37 44 +0b 61 c1 28 4c 40 3c 41 32 1b 99 05 3f 5d 69 72 +8d 5b 97 35 76 cf 04 74 83 33 d8 08 d5 e6 8a 8f + +# PKCS#1 v1.5 Signature Example 6.20 + +# ----------------- + +# Message to be signed: +8c d2 da d2 a5 d5 f9 fa a0 7e 24 a9 6e 86 f9 b0 +ac 8b 40 22 2a c9 fb 8a 8a 15 72 7c f2 f5 3e 68 +4a f4 ab dc 98 68 a7 25 3b 25 b0 96 bd 70 1f 46 +a9 43 + +# Signature: +8f 03 22 eb 2c 54 05 24 85 a6 45 49 ad ff 2a 36 +31 db 65 76 fc 0c af b5 51 69 7d c5 35 6f 02 e0 +93 cb 69 17 3a 7e 83 55 a0 da de bf a5 3c b2 90 +7f 00 2d b3 a3 e3 87 da 05 7b 7c 73 55 16 43 84 +3e f5 74 48 1f 80 74 15 17 7e 4b 34 c2 5b d5 5f +4c 02 fa 0a de a3 a9 58 04 65 f3 58 c0 05 96 b5 +cc 06 2d 58 92 30 3e 1a cc 11 3c 3b 4b c7 4d 42 +e8 58 02 90 78 48 2a 1b 23 4a 62 5b 04 28 44 06 + +# ============================================= + +# Example 7: A 1025-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +01 69 34 cd ff 48 50 b6 00 2c c0 f0 f4 01 0a 32 +c6 55 e5 cf 6e 7c 89 93 7f d7 55 ef 6a be 37 9d +ad de 70 cc 21 77 51 f1 4c ba 6d 90 fe 52 dc 0a +f5 8b 25 2f 26 bf 72 da 57 9f da f5 7d dd 6c d6 +02 18 79 94 9a 02 76 b4 43 3f f0 1e fc cc f3 5a +11 e7 c7 7b 38 c1 8c ca 94 ae 01 2d 0f 37 04 21 +49 1c 52 ad 15 ac 76 b1 2e cd 21 8f 52 e7 57 86 +6e 08 9d d8 ad bb 48 e9 ba 89 43 36 c5 75 c4 06 +55 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +01 69 34 cd ff 48 50 b6 00 2c c0 f0 f4 01 0a 32 +c6 55 e5 cf 6e 7c 89 93 7f d7 55 ef 6a be 37 9d +ad de 70 cc 21 77 51 f1 4c ba 6d 90 fe 52 dc 0a +f5 8b 25 2f 26 bf 72 da 57 9f da f5 7d dd 6c d6 +02 18 79 94 9a 02 76 b4 43 3f f0 1e fc cc f3 5a +11 e7 c7 7b 38 c1 8c ca 94 ae 01 2d 0f 37 04 21 +49 1c 52 ad 15 ac 76 b1 2e cd 21 8f 52 e7 57 86 +6e 08 9d d8 ad bb 48 e9 ba 89 43 36 c5 75 c4 06 +55 + +# Public exponent: +01 00 01 + +# Exponent: +0d 17 19 e5 bd 47 6d 87 c7 ec c3 1e b8 ab 42 5d +4f e4 c8 f5 c7 ae 23 0a 10 47 55 3f fb 53 9f d3 +85 5a f5 a4 3b 2d dd 4e 95 a2 b3 0d 40 7a a8 81 +59 bb ad 2a 87 3d 80 93 b4 8a 4b ce 20 ad 99 26 +25 3e d3 39 ac 3b 54 3f c7 42 96 95 33 8d b0 bc +1d c3 68 6c fd 13 9b b5 b2 87 36 bc 16 60 a9 53 +48 fc 91 c3 25 d0 3a 7f b2 16 d2 d9 cd 93 64 de +4e e7 d2 11 9c 3b 0f bb a8 a7 1f 0d 3f 5a b9 b9 + +# Prime 1: +01 58 c0 24 6c d1 69 fc 59 3b 25 8b bf 45 23 ab +2b 55 c4 60 73 3a 7f b4 69 10 90 77 b3 0e 4d 35 +f2 1a 35 b1 f4 1e 42 04 e8 1d 2e 4c 46 3c 24 11 +39 34 09 8b 45 2d ab 4b e1 59 97 20 ef 68 72 83 +3d + +# Prime 2: +01 0c 38 2d ea 5e 7d 79 29 8c 64 1f b2 e4 fa 09 +f2 4f 6a 7a 45 9a 88 2c 87 a8 03 49 5f 05 6e cc +3b 43 c5 37 73 1f 85 ef c8 fb 53 87 ad 67 31 a6 +43 53 32 15 de cc 38 7d 96 76 12 2c 17 0e 91 e0 +f9 + +# Prime exponent 1: +d5 78 dc d5 38 f2 fc dc 30 00 b6 c0 f0 49 fe e2 +ad 90 14 fd 24 fb 10 b6 82 18 42 d6 70 03 a5 64 +cd 8f f4 2a 2a 56 4c fd 81 9c 3a 84 bf 16 c2 47 +7e 8e 6e 5b 9e c4 d4 0e ad 50 24 87 ba 50 36 2d + +# Prime exponent 2: +88 88 dc 8e ae 94 ee a5 80 ca c2 fc 1c e5 4f 44 +e2 ba 50 0d b8 71 53 41 a6 fc 2d 50 4a 82 b1 42 +05 e8 91 a6 6f c8 8d 5c 60 db 8f 78 6c cc 70 57 +5b 35 66 be a8 74 a5 31 7f 5f 16 c4 91 ed 1e 79 + +# Coefficient: +17 b0 d6 23 36 19 1e 63 bc a1 59 93 4d 06 16 cb +89 97 40 9c bf ca 37 05 69 5b 14 fb 64 a0 81 c1 +c9 f5 86 19 3e 52 3a bd 0b eb 8d 72 0c fe 53 7d +fa 1e de c4 a6 64 37 d2 41 19 6b 7a 2c e5 56 c4 + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 7.1 + +# ----------------- + +# Message to be signed: +35 39 99 7a e7 09 fe 32 c1 03 6a 13 27 57 f2 a1 +66 7a 91 cc 83 be 73 3a ad a1 bd d2 17 92 4c 9a +2c 9f ed 1f ec f6 1d 1c f7 9d ae 9a 83 f8 ae 3f +4d 05 1b 34 fb b5 59 cb fd a4 92 f1 d8 3b 8b eb +a0 45 d4 ae 1c 8f ea 15 b7 57 7a 1b 8a 3f 55 ba +c1 72 7e dc a7 f8 f5 2c b4 ba 61 ca f1 fa 8f 8f +d9 aa c7 79 09 5c a8 4c 79 91 52 9f b8 06 99 d0 +d4 68 8d fd b1 42 ed 61 a9 5b 89 ce 33 06 bf 97 +80 e1 b9 1b 84 8c 8d 20 03 97 0e 52 70 2a 1f 61 +2e 2f 40 17 cf e0 a9 1d b9 e4 6d b9 dc + +# Signature: +00 08 0f 77 0a 2d 1f 6a bf 5f 22 1f 62 e1 66 ab +d7 9d 06 c7 b9 a8 78 d6 1b 80 fc 4d 5b a2 90 b2 +3a ba ab 51 8f 09 44 7e 45 ae e6 f3 bd 06 10 24 +44 36 a4 73 01 60 e6 a6 72 11 0c 01 ae b5 62 4b +71 8d c7 c0 86 1e 58 6b a8 b6 0a 29 d6 a5 75 5c +d2 cc 50 85 99 c6 e2 8d 73 55 b2 7e 40 b7 40 c6 +fb bb b1 a9 18 23 b1 c1 24 2b a6 93 d4 52 69 51 +47 db b2 3e a8 9c bf 11 eb 8b 07 ec 3a 02 7b 0f +17 + +# PKCS#1 v1.5 Signature Example 7.2 + +# ----------------- + +# Message to be signed: +31 80 08 87 3c 4c fe a7 12 5e a6 fd 52 15 df d9 +8d 5c 5e 73 32 3f 03 f2 15 c6 9c 8f 2b b1 98 3b +59 df a6 e9 9a dd 30 69 66 f3 11 0c 16 1c a2 26 +24 b8 80 70 26 5b 8f 3f 9d 5d f7 29 91 e7 9e 5b +18 9a a3 d9 cd 9b 20 47 cf a6 1d 01 23 4b 23 3d +36 ac 4b 96 ed 08 16 48 87 74 90 fa 4a 80 ec 4c +bb d9 d2 e0 06 2c 39 e1 85 3a 0c 38 34 4b a8 58 +bd 1d 99 5f 6c aa 28 bf 90 40 26 26 8a 99 72 11 +43 c8 6a 43 43 ba f8 9b 6d 55 07 64 25 1f b0 7d +16 7b 4c 4b 1b 70 f9 9e f5 fe 50 e6 2e 54 13 fc +ce 0f 99 59 c2 a3 78 c4 1d 6f 42 36 17 8b 14 b8 +91 9d b1 d0 + +# Signature: +00 6d 54 7d a4 ed cb 10 33 15 cb 8e 4b 66 9b ee +96 aa 21 56 23 5c a5 c3 e3 1b 24 a1 5a 13 92 e4 +94 04 7f ed cb 70 81 90 7c 56 17 a8 aa 18 d1 01 +b0 53 2a 36 32 45 19 23 c4 8a 75 b0 ec 21 76 cb +98 e5 ce 51 58 8b cf 86 8e 29 d5 d9 69 4f 00 ae +2c 92 4e 73 d2 e6 dd 14 4d 24 fa 45 d0 12 06 a3 +f5 d9 36 41 3c cb b7 4b 0e 2d 04 7d 82 b6 00 b8 +9d 51 59 4f ce 7d e6 bb d9 5b 97 fc fe c5 98 c4 +eb + +# PKCS#1 v1.5 Signature Example 7.3 + +# ----------------- + +# Message to be signed: +7f 83 b3 e0 54 c0 24 82 50 78 dd 9f 04 0e 1d 09 +05 82 00 c9 75 7b 76 fb 37 2b 8b 52 66 b9 dc 26 +9e c7 56 9d 00 + +# Signature: +01 34 ee 21 51 51 e5 32 50 f5 a0 01 6a cc e3 70 +1e 2a 58 dd aa d6 cc 36 9d f0 dc d9 34 6a 2b 53 +0f e3 71 5a fe ff 1e 9b cb 72 08 31 c1 25 58 97 +0a 9e 03 89 60 04 f2 87 ad b8 21 f3 17 cf 63 93 +00 ca e6 e9 09 e9 1e d2 a3 ea cb 99 52 a7 cc 54 +94 76 52 64 24 79 51 d2 8c 16 af 03 e2 4b 80 ee +32 b0 b6 2e df 10 d7 00 91 92 71 35 f0 5a 88 9f +2f 60 56 b9 5c dd ac e4 7c 69 f9 73 08 c0 df 2e +ba + +# PKCS#1 v1.5 Signature Example 7.4 + +# ----------------- + +# Message to be signed: +17 eb c1 50 07 bb 5e 4a f9 17 20 1c 3b a3 84 92 +65 89 c3 15 9a 89 d1 ab d4 c2 c9 86 fb a0 37 9e +8a f1 29 75 c5 d0 31 d1 bf c1 5c a9 17 36 f0 7b +17 66 d8 b8 a7 2d b1 0c 26 8c 98 fd 7a a1 1e 29 +99 f0 6d 86 12 7c c8 89 cf 15 0d cc 73 8f 6a b8 +ba ae 94 3c c6 06 dd 4d 9e ce 70 1a 4a 7b 10 1e +35 1d ee 20 b1 5e bc 55 25 6d b3 ce 46 a6 bd 50 +61 12 5b 62 b9 95 e9 70 d1 6f 7c 9a 8f c1 57 ff +68 ce c7 e6 0f 60 8f 66 26 dd 39 52 8b 24 09 aa +2f f9 32 fc 11 9b 2a 7a 81 77 2a 57 6b 3d 50 a0 +d2 87 a7 fa 2d b8 7d 2b 92 e1 c9 61 a7 0c aa 44 +d8 81 37 b9 50 e1 00 71 1a 98 54 ad fa fb 49 4d +34 e2 86 06 a2 7c + +# Signature: +01 05 da dc 99 c5 9b 5e 3a c5 54 b1 b5 e7 48 0e +5c 0a 62 c7 ab ae fd ac f4 42 6e cc fe 68 6b 8a +aa 1c a4 f5 1e ba bf fa 77 d9 98 03 e7 ee 8d 20 +d1 20 4a ad 8c 67 38 5d 07 44 c8 54 de 2f 99 7a +56 aa ae 04 ce cc 65 65 35 c1 6b b2 14 5d 18 01 +81 25 94 a8 01 3b 0e b5 4e 7b f6 5d 38 42 00 54 +ec 46 da c7 1a 12 52 08 b3 02 21 4a 7c 9b 3a 92 +ca 9b f7 37 39 c7 66 30 9a f8 03 ed de 7c 54 d2 +46 + +# PKCS#1 v1.5 Signature Example 7.5 + +# ----------------- + +# Message to be signed: +6a 52 ba 19 0e 44 ca 0f 10 70 02 10 48 76 2f 3e +79 ed 51 c9 4f 6d c1 a9 f1 ed 78 35 2e f3 79 aa +49 b3 a9 38 7e 3c a7 a1 96 f1 05 dc ab 18 50 6f +29 4a 69 + +# Signature: +00 0b 70 e6 01 c5 ec 58 68 4e 09 18 ba 7a 53 9e +9d 2d d2 9b 01 a3 f4 53 ca d4 a9 a4 0e 50 f5 db +df 72 c1 10 52 f2 0b e4 4a 5d 38 51 b0 1f d0 9d +9c 92 08 47 0f 0a 4a 95 03 5e 98 9e ed 7d 6b 06 +2e 13 f4 99 5b f0 93 0b 4a 3d 9b 8a 9e d7 5e 33 +88 6e 4b 19 4a b5 cc d6 b4 12 95 9c b4 f5 49 8b +d3 2f 66 85 46 be 2c 00 7a e8 de 5d 98 97 7b 94 +b1 7e 12 63 88 4b 54 e7 84 b3 8f c1 12 b8 cb dd +56 + +# PKCS#1 v1.5 Signature Example 7.6 + +# ----------------- + +# Message to be signed: +bb e0 b9 de 2b 5e 9d cd 31 67 42 94 3f 92 19 b2 +4f 66 a3 8f 9d e7 09 46 4f a5 49 5d 79 4a 63 7b +9e bc 06 77 62 da 7a 6e ef f0 98 fa 44 f3 cc 36 +f2 cc ef 67 fd 46 c5 9e 24 73 8c 81 0c 69 ed dc +d9 0c c7 d7 1a 4c 3e 69 3b ca a2 8a 53 3d 90 4b +41 ce d3 39 9b 4c 76 47 e5 ec 4b 3a d9 03 87 0f +5b 5f 8d 6a 8d 81 28 ae 23 81 ce c8 6c 4d 85 b7 +8a 45 1e 1e a9 7e 33 93 ff e9 97 e5 46 b0 9c 8c +f8 22 52 b3 3f 74 5f ee d4 13 32 06 51 8e 2b 88 +03 19 dc df 91 06 71 8a fb 01 6c 51 4b 38 05 32 +65 bc 98 79 10 0e 47 b0 3e ba 03 68 f0 9e 29 23 +ac 6f 40 a0 4b 75 05 4c d5 05 bb c8 96 5d 64 9a +1b ae 7b b6 64 3c b7 41 95 e9 1c 51 f4 18 3d b2 +d7 38 ce 60 35 50 d6 34 e6 dd 4f 27 f4 da ac 61 +56 cf a7 e2 46 8b 5d 6a eb 78 29 09 + +# Signature: +00 c2 e0 74 df bc d0 e7 3a c0 02 1a eb 99 33 10 +6b 20 1b 93 c1 7a 7b f9 33 56 d2 91 fb 4a ae b3 +d1 31 63 00 a8 de 7b 07 e3 d7 79 bc c2 99 e5 2b +6c b0 30 88 01 6d ae b8 41 38 2e b3 43 5f 2e 03 +eb f2 2d c0 86 fb 20 eb e5 3a c5 45 90 24 97 63 +a2 65 5a a7 eb 0e 7d 38 64 93 6b 34 00 6a 6c 4f +a0 2d 9c a1 04 ad ad a6 aa 01 b9 77 b6 de f2 75 +06 08 a7 8f 3e d8 3a d7 12 a7 a1 b0 fb de 7c 7c +8d + +# PKCS#1 v1.5 Signature Example 7.7 + +# ----------------- + +# Message to be signed: +83 a4 8b ff 88 6d 1d 68 f2 92 0a 0e cf f2 98 32 +1a 96 f5 ca dc df d8 be 16 b5 0d 34 d6 7d 94 cd +b1 a1 bf a0 ea e2 46 99 b6 63 c7 ba 3a 08 a3 90 +f7 22 58 84 85 67 94 d1 80 c5 46 ca c0 6e 41 18 + +# Signature: +01 2e 81 bd 38 63 50 65 bf 65 54 33 6b 00 d1 06 +18 33 05 53 e0 e8 08 78 aa d3 55 f0 0d 59 40 d8 +ba 45 01 c5 c4 9f 10 16 d5 f0 e6 a7 3a 4d 9f 87 +40 d2 cf c2 5e a2 48 df 3f 7b 1a e8 fc d2 6b d5 +62 e0 f6 eb 77 7f 46 d7 57 30 69 db 89 07 c0 21 +b6 45 d3 b2 40 58 47 51 99 a9 1b 55 72 d8 ac 87 +f8 3e e6 af 5c f9 e1 71 a8 58 f6 0d 2b 81 40 f5 +2d ae d6 84 42 22 8b 4f ff d8 de 40 07 8d 3d e8 +cb + +# PKCS#1 v1.5 Signature Example 7.8 + +# ----------------- + +# Message to be signed: +18 + +# Signature: +00 f2 c2 99 02 4a b7 bd 25 2c 69 46 be a1 0d c0 +53 97 38 98 bd 5f 0e 3c 94 60 e6 fe 09 d7 d1 91 +e7 1b f7 9d 43 6c aa 84 e9 86 be 3f c0 98 19 c0 +80 e5 6a 08 5c f4 24 41 4a f3 fc 70 07 cf 1a c3 +6f 1c f8 63 57 80 b5 56 8d 73 4a d6 d8 1a 2b a8 +eb 18 8b 29 46 69 d8 71 ca 40 e6 08 f0 ed 33 d5 +69 0c c6 15 70 c5 b8 47 eb db dc dc 4f a7 8f 42 +9e fc e1 3c 67 47 e5 4d 6f 26 1b 04 55 d6 dd 65 +c2 + +# PKCS#1 v1.5 Signature Example 7.9 + +# ----------------- + +# Message to be signed: +04 a6 e2 4b 93 c2 e5 f6 b4 bb e0 5f 5f b0 af a0 +42 d2 04 fe 33 78 d3 65 c2 f2 88 b6 a8 da d7 ef +e4 5d 15 3e ef 40 ca cc + +# Signature: +00 ec c8 95 fb d9 47 e2 df c4 7c 03 ba 2e 99 3d +1a 14 3a 7a 6a d6 3a 91 6e d5 44 83 ce 26 38 9f +89 d5 80 f4 ed bd d0 b3 7e 08 ca aa 5a 0c 1e 52 +6e 1e 9a 1a 8c 0d c9 cf 50 ed 77 de 26 76 46 0d +28 8d ce 56 5f 12 8a 26 6e a2 9b 4e cc 32 9a 94 +cc 25 23 96 dc 50 d5 c0 a1 3d 80 93 81 fa d8 8a +07 89 ad 4f 56 aa 77 e5 44 ec 25 70 af 99 18 b7 +f7 41 b4 86 ca 50 b3 38 4a d1 12 40 60 59 16 85 +a1 + +# PKCS#1 v1.5 Signature Example 7.10 + +# ----------------- + +# Message to be signed: +99 65 bd a5 5c bf 0e fe d8 d6 55 3b 40 27 f2 d8 +62 08 a6 e6 b4 89 c1 76 12 80 92 d6 29 e4 9d 16 +9f 16 fe 51 c4 c0 8a 64 94 b5 00 73 62 20 91 a3 +82 2e a5 7c 32 8b d9 b6 9d 24 65 a2 12 2a f1 78 +bf 6b 1b e3 07 ee 4c 31 47 9f fd 9f 4d 11 f3 3e +a2 0b 7a ec e8 12 ca b4 ee dd 46 99 31 51 d5 68 +ff 64 a1 67 04 a5 5d 95 0a b7 79 1a a2 3b 26 a0 +a8 af 88 0f 6f 80 56 bd d2 06 83 8b 44 c6 07 b6 +61 b4 f1 dc 36 21 06 5f de d3 db 6f 9e 3f 2d c8 +f4 00 ef e3 c2 af a6 c0 27 99 40 57 6b b0 5e 39 +80 4b d3 50 5f 4b d2 82 52 91 8b 28 e7 4e 05 8f +24 f2 7e f0 db 3d 0d cf 9e b2 9d 41 ff c1 10 07 +ce 86 b9 82 e8 9c 03 75 bd 99 76 a5 af 13 1a 61 +4d 28 08 ba 25 07 9d 97 7f 0b 23 97 96 ba 6b 1b +cd 5e 85 5d 96 + +# Signature: +01 56 62 e3 0e 79 0e 37 86 83 81 b4 f6 77 a2 ae +d6 b2 ac c5 64 49 17 31 82 49 10 ed 80 ad c4 77 +15 9c 88 61 8c c7 d0 be b0 49 b1 aa e7 4b 17 21 +e9 0b a7 f7 b0 ea 26 bf 33 ad 04 f8 6f f3 14 38 +97 bf 0d 4e b4 5e b7 de b5 44 11 ba 96 80 aa b1 +3a db fc f1 8a f4 6b 87 fc b1 46 1c 26 20 6a 95 +3b c3 cd bb 31 e2 96 ea 09 02 4b c5 c7 b6 2d e6 +c6 9c 14 bf cf eb 56 39 1a 9e f5 8c d8 05 eb 63 +1f + +# PKCS#1 v1.5 Signature Example 7.11 + +# ----------------- + +# Message to be signed: +71 c7 b1 8b 4a a8 ea 53 89 ad 78 49 23 28 65 be +2a 93 e3 47 a1 68 d2 5c 6c 6e a2 43 9c 1c c8 0b +b0 b7 22 3b e9 c8 93 71 22 84 5b b0 a3 9c 02 5c +43 75 9d ef e6 e4 e8 eb 3b aa b4 f1 eb dc a2 c8 +ad 12 a4 65 a3 0f 8a 65 25 b1 20 ef 6a ae c9 bd +db 45 cd 42 c0 15 0c 40 7b 04 8e df 65 19 94 92 +f2 07 ca 01 aa a5 54 3a f3 8e e9 8d 53 bd 10 d8 +ee bc 3b 64 97 7e 75 75 1d 74 50 dd b1 c0 e1 fc +24 da 17 18 81 1f be 9b 0a bf c3 ca 31 e6 99 5f +c7 34 90 73 e2 17 b3 7e 23 c5 f1 7a 8b 7a 3f 00 +48 6a 37 02 b9 51 0d 6f 05 1b 27 61 71 6e 32 c6 +2b b5 93 9b 2f b1 1a cb 1c 83 + +# Signature: +01 3a b6 3a b1 83 35 3a 23 5f b8 93 ab 4c 35 d6 +40 9c 21 84 9d cf cd a3 bf da 14 29 fe e7 42 a7 +d8 16 0f d3 c8 3b 38 53 a3 33 f9 51 53 9b b5 77 +1f 4d 0f e1 3a de b6 4e 40 30 b9 2e 8b 08 13 eb +52 b1 aa 33 bd 94 c5 b8 bc 1b bc cd f6 c1 df 0b +a6 70 71 7c 0c f6 fd 48 5b e2 fe 9e 16 81 3b e8 +cd d5 80 e6 10 86 67 5e 31 83 1c 92 4a 41 d4 67 +1a 95 d8 35 e3 fc a4 95 e8 86 58 d1 e5 70 e6 28 +c7 + +# PKCS#1 v1.5 Signature Example 7.12 + +# ----------------- + +# Message to be signed: +0b eb 19 b5 62 92 8c 27 1b b7 06 18 9e 43 cf a5 +7b e7 6b 2f 7a 83 e0 2a a2 cc b0 37 c0 f4 f7 f7 +31 62 d6 c2 6f 70 de 97 18 21 e7 b9 66 5c b9 31 +bb 0e ac 82 0b f8 59 98 4d b4 be ef ef 4a b8 8e +91 63 1c 0c d3 1d b7 f9 35 8a 5a a1 df f2 40 6b +45 f9 bd cb ef 20 d5 5c 28 2b ae 5c fb 61 06 02 +3b 56 33 c0 51 af 17 e7 29 bb 07 c9 af 6d d2 + +# Signature: +00 d6 3d a4 d5 d3 e2 28 4a 19 2a 6a 9d a3 f1 a7 +d3 fc c1 64 b9 fc 3d fd 74 52 b0 2f ed 6e f1 be +5a d2 a7 69 ec 9c 36 05 9b 71 91 1c cf 7a b7 1c +e3 09 87 ec 47 bb f5 5e 6d 46 30 d6 23 42 b3 15 +50 48 ee 0b f4 3d 24 fe 69 ab da c1 2f 79 4b 67 +98 bd 1a 7c b4 89 a6 4c e0 82 25 4c 3d 92 f4 75 +56 6b 56 40 0d 96 20 cd fd 63 fc 17 c1 93 c4 25 +d7 ed e9 41 f7 6d a1 e3 45 af 0e 2a 8b 88 44 c7 +40 + +# PKCS#1 v1.5 Signature Example 7.13 + +# ----------------- + +# Message to be signed: +02 87 ab e2 67 0a 45 f8 77 90 48 f5 + +# Signature: +00 42 f4 14 78 2d f6 5d 93 47 bf 1c ad 53 48 53 +74 6c c0 b8 53 c1 c5 26 f9 17 14 45 fc fa a4 99 +1a 70 f5 a8 44 5b cf 41 14 f0 7f c8 35 4c 84 a9 +3b 94 37 33 d3 93 7a 59 88 3b 89 6c e6 5f db 16 +5b 1e 30 55 37 4c e2 42 e1 26 8c 16 41 cc 44 3b +b9 e7 da 7f 71 f3 e7 f6 31 3f 23 9e 62 00 e7 9a +1b e3 ea d6 c3 6e 94 1f 24 46 0b aa 57 df 63 9e +57 da b3 ef f9 e7 7b 87 af 35 5b 83 da e7 7c be +06 + +# PKCS#1 v1.5 Signature Example 7.14 + +# ----------------- + +# Message to be signed: +3f 49 54 2c 0e 9f 50 93 2c 0d 45 3d c9 53 20 af +21 dd 2b d1 72 9c 29 f4 f0 8c 70 94 4c 2c c7 5d +e9 16 6b 4f d2 30 aa 93 70 2c 5f 2c 3d 9c 29 9a +35 91 02 57 00 33 54 0e b8 28 ca d7 5a 57 76 d2 +e8 cb 45 61 41 a6 fa 97 bc 4e 6e 62 d3 df 08 29 +82 a4 d9 8c 2d e4 41 e5 9e 93 12 + +# Signature: +01 5c 39 93 ce eb d8 db a4 5a 36 8d d4 05 af 8a +53 b9 3e 82 70 19 f9 94 e4 ed 78 2c 39 11 b9 b5 +80 d5 42 24 26 9b 79 97 f1 74 96 30 e5 2f 22 1f +af ab 96 41 c7 81 e7 04 4d 32 56 e2 e4 4e 14 37 +91 72 32 69 45 18 ba 9e 71 38 da 47 fe 53 43 29 +b8 c9 68 9e 27 85 c0 2b 60 3d d1 60 d3 73 36 a2 +b0 5b e0 47 82 65 9a c0 e9 67 1f e9 32 ea 80 91 +d6 13 18 b2 b2 01 bd a7 9a f6 c0 c4 44 69 38 e3 +f6 + +# PKCS#1 v1.5 Signature Example 7.15 + +# ----------------- + +# Message to be signed: +d0 db c9 6c f9 bf b1 e3 cd 6d e2 ea a0 8d 6d 79 +5b ed 81 87 ce b0 85 65 80 e4 b1 42 b9 ae 60 a0 +98 cd 42 98 4e 8d bf 1d 05 a0 c0 ab 83 51 54 8f +0a 13 64 6f 33 39 0b 2b b0 c8 64 b3 97 cf 13 37 +1f 8b 2f 67 5a 82 e4 6b f1 6c 4a fc 60 5e e3 e5 +a1 46 9c ac 51 fa 73 4b 44 65 d4 c1 3d 5b 2d d1 +2e ed a5 4e 7d 08 1c d9 e3 ea af 9e 57 db 42 20 +20 a0 b5 a5 ec 28 ca 43 97 7a 5d 67 6f fa b6 2f +78 10 71 93 59 41 59 ce bf bd 86 26 98 19 a0 f3 +41 a0 f4 12 84 dd 0a 73 ca 80 14 d2 e0 b8 01 79 +c6 38 0b 40 3a fb b1 1b 42 db 34 9b af d7 57 0f +be cb d1 4b d0 c2 1a d6 41 68 7a 6a c3 29 25 f7 +03 1a 24 a6 56 8a b9 e2 87 eb 80 75 41 10 df ba +68 8a 59 63 25 bc ac 4a 39 ce 8b 84 a4 + +# Signature: +00 8c c8 2d 64 55 9d e0 04 0f 55 41 19 9a ef f3 +99 9f e2 f0 86 f1 57 ff 51 f2 22 0d b3 45 51 9a +a1 14 b0 17 62 e7 0b c9 65 83 bb 38 b2 2b 3f 87 +be ab 32 e2 3a 3d eb db 8a 59 54 29 ff 12 fa d4 +95 d7 4e 22 0e 4f 7d ca 22 27 28 43 89 9e 81 04 +c6 9a 59 64 2f 6f a8 25 89 0f e8 13 2a 0f 79 94 +02 53 e5 00 7f b1 17 7a 5b f4 18 06 7e dd c8 d3 +2c 5e 59 35 bf 33 8f 1c 69 0e fc 80 11 dc 8c 84 +2e + +# PKCS#1 v1.5 Signature Example 7.16 + +# ----------------- + +# Message to be signed: +7d f0 23 6e 87 1a 71 c3 17 90 eb 5f 01 1c 91 1c +27 c6 03 73 b8 dc 9e bb 13 ac 85 ac cb 3b cb d3 +b4 74 f9 78 86 2d d8 42 02 ab 20 b3 34 73 94 25 +e1 b7 9e 0b b8 b4 bc 47 dc 71 53 f5 7a da 04 12 +44 7b f5 a5 e6 67 34 19 ba ad 65 3e 5f 5c 39 e2 +ef 7c fe 7e f4 77 8a b9 98 ca f9 7c e1 6c 58 33 +27 72 dd df 82 6f 1e ec 1a f3 db 80 e3 13 75 d6 +68 0a a2 54 b4 ab 6e f9 a3 ec 0e 04 03 e4 b5 83 +d3 71 dd d9 6d d5 7b 2c 61 a6 e4 01 25 1a 1a 63 +0d 1d dc dd 84 d9 0d 82 fa f5 a0 18 d2 a8 8e 26 +58 55 e9 d7 ca 36 c6 87 95 f0 b3 1b 59 1c d6 58 +7c 71 d0 60 a0 b3 f7 f3 ea ef 43 79 59 22 02 8b +c2 b6 ad 46 7c fc 2d 7f 65 9c 53 85 aa 70 ba 36 +72 cd de 4c fe 49 70 cc 79 04 60 1b 27 88 72 bf +51 32 1c 4a 97 2f + +# Signature: +01 45 5e 3b b2 9c bc a8 83 9b 9f 54 4d 51 47 2e +bc fd 25 c2 92 27 c4 65 5d 5f 7e bb d8 3c 48 e7 +64 3e 7b 59 4d 6f 7c d5 f6 bf 9a 40 b0 5c 4a 05 +cb ee 1f d6 59 d3 ce de 3e 7c ad 61 e6 fd f8 f0 +e4 fd ef 08 12 a8 53 90 8f 0f 99 ca 7e 38 8e bc +19 e8 74 76 5b 11 64 0f 1e e1 e9 8f 54 95 3d e6 +17 6f 15 82 03 70 17 c8 38 60 9a 57 a1 2a cb af +a6 a5 65 47 f5 7d 62 db e8 76 69 ed c0 fe 3b aa +da + +# PKCS#1 v1.5 Signature Example 7.17 + +# ----------------- + +# Message to be signed: +12 88 c0 3f 95 00 6e a3 2f 56 2d 40 d5 2a f9 fe +b3 2f 0f a0 6d b6 5b 58 8a 23 7b 34 e5 92 d5 5c +f9 79 f9 03 a6 42 ef 64 d2 ed 54 2a a8 c7 7d c1 +dd 76 2f 45 a5 93 03 ed 75 e5 41 ca 27 1e 2b 60 +ca 70 9e 44 fa 06 61 13 1e 8d 5d 41 63 fd 8d 39 +85 66 ce 26 de 87 30 e7 2f 9c ca 73 76 41 c2 44 +15 94 20 63 70 28 df 0a 18 07 9d 62 08 ea 8b 47 +11 a2 c7 50 f5 c0 a4 25 31 3d f8 d7 56 4b d2 43 +4d 31 15 23 d5 25 7e ed 80 6a c8 c9 c6 af 04 ac + +# Signature: +00 6b eb b9 6f 0e 28 2f 1b 4d 03 e6 c5 65 05 b9 +37 78 da 9f 49 36 50 e8 aa eb 65 cf e6 28 50 04 +2f 75 ab e6 e6 ea fe b9 a7 0a bd 21 eb 5d ba 73 +cb b8 7c 12 98 0a ac df 16 71 6b 19 98 c9 49 9c +e4 39 c5 4a ab 4d 19 ce 72 7b 78 75 a4 1a 3d 30 +81 4e 50 8d aa 26 eb 70 aa bb d0 dc ae cc 4d 4b +51 69 80 71 51 1e b3 1b 21 0e 66 dc bc 7f c0 b8 +c6 23 14 da ea 69 d4 7a e2 78 10 0d eb 51 40 92 +00 + +# PKCS#1 v1.5 Signature Example 7.18 + +# ----------------- + +# Message to be signed: +54 13 99 3c 26 58 bc 1d 98 85 + +# Signature: +00 bb eb 2c a0 bd 64 cb 89 60 37 5b 08 a9 48 0e +69 c0 9f d3 82 de a2 f9 40 89 b1 53 3a 08 51 fa +0c bd 0e ad ef ca 8c 70 b7 70 79 7a d0 89 e8 40 +d2 fe 1a 8f b8 54 9f 32 90 58 3b bb 81 d3 ee 2b +1c 48 f1 ea 75 1b f3 2f 95 90 be 3a fd b7 74 5e +16 6e 0b 32 2c 08 31 24 e6 45 83 94 82 d0 81 26 +22 d3 1a b1 87 7a 9b b4 1b 8d aa d8 68 f3 0e 75 +07 83 2a c3 41 01 12 13 3a a1 7b 2d 47 6d 47 6d +89 + +# PKCS#1 v1.5 Signature Example 7.19 + +# ----------------- + +# Message to be signed: +9c 84 c1 48 6b c1 2b 3f a6 c5 98 71 b6 82 7c 8c +e2 53 ca 5f ef a8 a8 c6 90 bf 32 6e 8e 37 cd b9 +6d 90 a8 2e ba b6 9f 86 35 0e 18 22 e8 bd 53 6a +2e b3 07 c4 3b 48 50 a8 da c2 f1 5f 32 e3 78 39 +ef 8c 5c 0e 91 dd 0a fa d4 2c cd 4f c6 06 54 a5 +50 02 d2 28 f5 2a 4a 5f e0 3b 8b bb 08 ca 82 da +ca 55 8b 44 db e1 26 6e 50 c0 e7 45 a3 6d 9d 29 +04 e3 40 8a bc d1 fd 56 99 94 06 3f 4a 75 cc 72 +f2 fe e2 a0 cd 89 3a 43 af 1c 5b 8b 48 7d f0 a7 +16 10 02 4e 4f 6d df 9f 28 ad 08 13 c1 aa b9 1b +cb 3c 90 64 d5 ff 74 2d ef fe a6 57 09 41 39 36 +9e 5e a6 f4 a9 63 19 a5 cc 82 24 14 5b 54 50 62 +75 8f ef d1 fe 34 09 ae 16 92 59 c6 cd fd 6b 5f +29 58 e3 14 fa ec be 69 d2 ca ce 58 ee 55 17 9a +b9 b3 e6 d1 ec c1 4a 55 + +# Signature: +00 e6 be 96 e1 8d ce bf 83 88 ba 82 ec 6f 27 10 +5b c2 78 71 59 5e 01 70 5a 2b 97 a1 f4 d7 88 38 +35 2b 0e 7c 0a 2c 62 7a 6f f3 7d b1 69 a9 a4 64 +8a d2 7a f0 65 33 a4 f0 41 d4 c8 20 ab f4 fb 52 +64 64 08 14 34 df 36 78 85 03 c6 5a f7 62 aa 21 +9f b7 6a 91 cb b4 0e 14 92 a9 cb 77 36 9b b4 cc +a1 93 4e 38 53 de 6c 86 a5 dc 11 48 ed ee b3 b0 +03 04 14 fe 30 83 ad 72 fe 29 5c 29 b5 ea 9b 66 +60 + +# PKCS#1 v1.5 Signature Example 7.20 + +# ----------------- + +# Message to be signed: +94 0c da b4 a3 e9 20 09 cc d4 2e 1e 94 7b 13 14 +e3 22 38 a2 de ce 7d 23 a8 9b 5b 30 c7 51 fd 0a +4a 43 0d 2c 54 85 94 9a 2b 00 7e 80 97 8b bb 19 +2c 35 4e b7 da 9a ed fc 74 db f5 f7 1d fd 43 b4 +6c 93 db 82 62 9b da e2 bd 0a 12 b8 82 ea 04 c3 +b4 65 f5 cf 93 02 3f 01 05 96 26 db be 99 f2 6b +b1 be 94 9d dd d1 6d c7 f3 de bb 19 a1 94 62 7f +0b 22 44 34 df 7d 87 00 e9 e9 8b 06 e3 60 c1 2f +db e3 d1 9f 51 c9 68 4e b9 08 9e cb b0 a2 f0 45 +03 99 d3 f5 9e ac 72 94 08 5d 04 4f 53 93 c6 ce +73 74 23 d8 b8 + +# Signature: +00 80 e2 c3 4f d4 ab 4d 1d 70 1e a3 f0 85 76 3a +ca ff c9 fd 3e d9 18 d0 4b ff ee 19 31 62 48 98 +c7 8f 89 41 bd 2a 59 ce b5 b8 40 f0 11 45 16 ce +41 1f ae 75 2b 1b 8a 22 1f fc a7 a6 87 66 c6 97 +c5 0a 3d 88 d8 d0 2f fc 12 41 d8 4b b7 a7 22 7f +3d 05 14 9e 15 11 12 77 a1 36 a5 b8 dd 96 dd 4b +22 5c 5f 49 cd f6 07 1d bf 71 93 5c 7a 6f 1e 2e +9a f3 02 1c 0d 58 a9 b8 1c 9b de 61 fa 47 2c 07 +a6 + +# ============================================= + +# Example 8: A 1026-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +03 33 12 64 88 f7 a2 91 51 32 e3 0d 5e 97 f6 ed +7b bb 67 b6 19 85 00 8e ae a2 a5 da fb 96 a4 48 +ab 75 ce 3d 6e 68 a6 26 5e 7c 24 56 84 99 93 24 +c8 1e 0b a6 38 98 63 fe b4 88 b3 f2 55 d0 d6 19 +c1 90 40 b7 4c 18 9f 0c 9a f4 b0 d5 a5 5a 54 4c +09 0c d6 15 2c 90 a6 f2 55 0d 7d 2a 6b 6d 34 7d +5b 1b 9d fb 1d e4 40 3c 79 66 23 d7 03 bf 9d b4 +43 bf 67 02 68 3b 8d 2a 9c 61 e9 36 8a c4 25 a5 +81 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +03 33 12 64 88 f7 a2 91 51 32 e3 0d 5e 97 f6 ed +7b bb 67 b6 19 85 00 8e ae a2 a5 da fb 96 a4 48 +ab 75 ce 3d 6e 68 a6 26 5e 7c 24 56 84 99 93 24 +c8 1e 0b a6 38 98 63 fe b4 88 b3 f2 55 d0 d6 19 +c1 90 40 b7 4c 18 9f 0c 9a f4 b0 d5 a5 5a 54 4c +09 0c d6 15 2c 90 a6 f2 55 0d 7d 2a 6b 6d 34 7d +5b 1b 9d fb 1d e4 40 3c 79 66 23 d7 03 bf 9d b4 +43 bf 67 02 68 3b 8d 2a 9c 61 e9 36 8a c4 25 a5 +81 + +# Public exponent: +01 00 01 + +# Exponent: +01 4a 2b 15 df a8 83 1d b4 ef a0 5b 19 50 84 b7 +42 73 4e e1 36 f4 48 3f 3b e2 50 9d 2f 61 90 23 +c3 0a 1f f2 df 78 cb d1 17 b1 4f 2c 99 13 17 1f +72 93 b9 fa 6d 41 f0 bd 11 a5 31 74 74 67 54 86 +d7 f0 ae c0 a7 78 ba 92 0e 81 f5 64 d1 59 30 cd +de e7 e2 b0 6a d8 ad b6 12 75 1f 4e 38 4d 6f 3f +a0 a6 63 9f d6 2e df 86 f5 2c 9f e0 77 62 91 83 +21 83 d3 59 b7 34 32 60 c9 4e 12 5f 4a b8 bf 43 +69 + +# Prime 1: +01 d6 e7 bd 8e 39 5b be f2 10 46 49 c0 12 78 cc +1c 51 c9 68 7d ef b4 59 1f 03 b6 78 52 a4 bc b5 +30 75 0c f9 bf ca d0 72 8c 53 99 d8 70 35 01 06 +cb a3 ec 41 6a 31 e4 2d 0b 59 75 10 ff 1c 9d 53 +bb + +# Prime 2: +01 bd 46 6f 43 a4 d4 61 3e 42 64 f0 1b 2d ac 2e +5a a4 20 43 f8 fb 5f 69 fa 87 1d 14 fb 27 3e 76 +7a 53 1c 40 f0 2f 34 3b c2 fb 45 a0 c7 e0 f6 be +25 61 92 3a 77 21 1d 66 a6 e2 db b4 3c 36 63 51 +f3 + +# Prime exponent 1: +fb 66 85 00 65 06 e2 0e 01 3a 45 2d 51 af 43 e8 +ea 91 08 44 13 b0 c8 d3 91 fb dc 88 e2 82 0c 89 +6e 34 1b 31 95 69 6b 7e 17 33 cf 25 38 66 ef e5 +d0 01 d5 7a 88 60 34 dc 16 4a 35 64 bd 36 10 f9 + +# Prime exponent 2: +be 4e 9e 3b 40 f5 6c 62 59 aa 1e 5c df 56 59 b1 +6f b8 42 94 e5 8a d0 16 bd 2c 96 cd 08 e6 cf 68 +54 a1 1c b8 0a d4 be 3e 05 7a aa cf 02 bd 32 63 +73 a2 35 ce b8 9e 82 43 0d 6e 6d 47 d6 ce f8 35 + +# Coefficient: +c0 23 5c 89 73 cf bf 30 bf 1d d3 c8 39 f0 2c 94 +c6 9d c5 34 cb fc 98 88 05 d6 fc 46 2a db d3 77 +d1 75 b9 a9 64 60 18 d7 fa b7 5c 1d 1f 7d 61 b7 +7f a7 95 59 b8 6f fa 9e c6 e2 11 33 fa 7f 1a 45 + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 8.1 + +# ----------------- + +# Message to be signed: +9a 28 20 f3 b9 02 9a bc 18 65 eb 06 fe 61 b8 d3 +97 b6 55 72 d6 00 61 ca a7 4e 63 56 93 1e 25 6b +89 71 2d 18 66 84 b4 de 1e 14 c9 eb fe f1 6e 40 +d9 9d 10 94 39 6c 56 1c 88 31 77 e5 12 6b 9b e2 +d9 a9 68 03 27 d5 37 0c 6f 26 86 1f 58 20 c4 3d +a6 7a 3a d6 09 04 e2 15 ee 6f f9 34 b9 da 70 d7 +73 0c 87 34 ab fc ec de 89 7f dd 67 0a 01 46 58 +68 ad c9 3f 26 13 19 57 a5 0c 52 fb 77 7c db aa +30 89 2c 9e 12 36 11 64 ec 13 97 9d 43 04 81 18 +e4 44 5d b8 7b ee 58 dd 98 7b 34 25 d0 20 71 d8 +db ae 80 70 8b 03 9d bb 64 db d1 de 56 57 d9 fe +d0 c1 18 a5 41 + +# Signature: +03 22 d0 0f c1 d9 66 94 f3 6e ae d2 30 90 56 f3 +ea 1c 1c c2 2b 13 b6 5e 79 11 8d 20 2c 42 d1 61 +30 99 38 05 09 da 74 35 bb 57 92 16 fd 57 65 06 +68 42 e3 56 a6 41 6f c8 42 a2 4a 9e a1 bc 6a 90 +98 05 23 b4 28 e3 99 bb d6 fc dc 2c b7 71 da f0 +03 7a 2d e8 c7 64 9b d5 33 17 de 0e 37 c3 14 ba +b0 c4 37 bb d7 98 df b9 65 50 6c 34 8b 74 2f 13 +8e f1 d1 a2 03 e0 51 e3 4b dd 3a 30 e0 fc e1 ac +43 + +# PKCS#1 v1.5 Signature Example 8.2 + +# ----------------- + +# Message to be signed: +ea 9a 1a 04 b7 cf 47 8a 89 7a 70 8f d9 88 f4 8e +80 1e db 0b 70 39 df 8c 23 bb 3c 56 f4 e8 21 ac +8b 2b dd 4b 40 fa f5 45 c7 78 dd f9 bc 1a 49 cb +57 f9 b7 1b 6d 48 b2 b6 a5 7a 63 c8 4c ea 85 9d +65 c6 68 28 4b 08 d9 6b dc aa be 25 2d b0 e4 a9 +6c b1 ba c6 01 93 41 db 6f be fb 8d 10 6b 0e 90 +ed a6 bc c6 c6 26 2f 37 e7 ea 9c 7e 5d 22 6b d7 +df 85 ec 5e 71 ef + +# Signature: +02 68 44 09 39 99 6a e5 cb da fd bc a8 6a 7c 42 +8a 04 b5 78 fe 2d be 51 26 a8 2f af 2b ec ff 09 +9a c6 0c b8 1b 11 7f 1e bf 42 04 fe 43 70 54 8d +5d 2c 46 80 63 68 2d a8 7d c8 01 79 bb 3b ba 85 +a1 48 ae 2d e7 dc b4 94 f4 76 22 1d f8 21 9d 4a +ae 1e 45 af 65 de 33 4a 1a 6d c1 45 52 86 ae 09 +cf 26 72 58 85 e7 74 80 99 72 d7 81 98 05 ff f5 +a8 c8 9d 37 37 64 50 73 92 49 f5 7e b1 51 b7 1d +c0 + +# PKCS#1 v1.5 Signature Example 8.3 + +# ----------------- + +# Message to be signed: +07 df 58 6b 90 5b 23 b9 1a f1 3d a1 23 04 bf 83 +ec a8 a7 3e 87 1f f9 + +# Signature: +01 bf d9 15 ff 77 80 f1 4c cc 55 bd 03 06 b3 ae +da 5b 5b 59 55 a8 26 d4 52 6b 0b c7 66 15 4f a8 +da 59 56 05 78 cc d4 88 2f e9 70 92 fb c7 36 fd +a7 3c ee fd 10 38 94 06 3e 93 e2 2a 7b 5c 44 f7 +a8 5e 3b db 96 71 9a 09 37 43 03 c9 1e d7 e2 27 +49 fe 3c 4d 6b 96 69 9d 50 7c 50 ad cf bd fc 13 +1d 6b 5f 2c f1 83 0e 31 ea be 39 ae b5 17 96 9c +94 a8 1c fe fe 67 31 aa 2c df fe 28 c8 af 71 40 +f4 + +# PKCS#1 v1.5 Signature Example 8.4 + +# ----------------- + +# Message to be signed: +50 0b 87 77 c7 f8 39 ba f0 a6 4b bb db c5 ce 79 +75 5c 57 a2 05 b8 45 c1 74 e2 d2 e9 05 46 a0 89 +c4 e6 ec 8a df fa 23 a7 ea 97 ba e6 b6 5d 78 2b +82 db 5d 2b 5a 56 d2 2a 29 a0 5e 7c 44 33 e2 b8 +2a 62 1a bb a9 0a dd 05 ce 39 3f c4 8a 84 05 42 +45 1a c7 cd 69 8d 84 b6 51 28 d8 83 5e 3a 8b 1e +b0 e0 1c b5 41 ec 50 f1 03 6e 00 8e 71 e9 64 da +dc 92 19 ed + +# Signature: +00 7a e0 cf d7 f4 c6 ad 1f f8 4b 4a 60 6b a1 c4 +79 8c 2e 49 9b 04 5b 56 7d 32 63 4f d9 55 f2 68 +26 0a b6 59 bf 5b e9 9e 08 26 eb 38 70 e8 f6 2f +5a 3c e7 58 e6 d1 56 c3 29 9b 43 1c d9 df c6 58 +37 ee 94 22 0d 95 23 51 14 87 99 be 9f ca f9 be +26 4d ae be ba 2b e8 66 05 20 1e f9 a0 d9 8f 58 +ec 63 8a bf c4 f2 78 48 f5 d4 79 d3 34 ac c2 a9 +7f dd 2d 32 7e c4 c7 dd c5 a8 ab d5 66 de 35 d1 +4f + +# PKCS#1 v1.5 Signature Example 8.5 + +# ----------------- + +# Message to be signed: +6b 3f 6a 63 d4 e7 78 59 24 3c 9c cc dc 98 01 65 +23 ab b0 24 83 b3 55 91 c3 3a ad 81 21 3b b7 c7 +bb 1a 47 0a ab c1 0d 44 25 6c 4d 45 59 d9 16 ef +a8 bf f9 62 12 b2 f4 a3 f3 71 a1 0d 57 41 52 65 +5f 5d fb a2 25 f1 08 95 a8 77 16 c1 37 45 0b b9 +51 9d fa a1 f2 07 fa a9 42 ea 88 ab f7 1e 9c 17 +98 00 85 b5 55 ae ba b7 62 64 ae 2a 3a b9 3c 2d +12 98 11 91 dd ac 6f b5 94 9e b3 6a ee 3c 5d a9 +40 f0 07 52 c9 16 d9 46 08 fa 7d 97 ba 6a 29 15 +b6 88 f2 03 23 d4 e9 d9 68 01 d8 9a 72 ab 58 92 +dc 21 17 c0 74 34 fc f9 72 e0 58 cf 8c 41 ca 4b +4f f5 54 f7 d5 06 8a d3 15 5f ce d0 f3 12 5b c0 +4f 91 93 37 8a 8f 5c 4c 3b 8c b4 dd 6d 1c c6 9d +30 ec ca 6e aa 51 e3 6a 05 73 0e 9e 34 2e 85 5b +af 09 9d ef b8 af d7 ad 8b 15 23 70 36 46 + +# Signature: +01 92 1f 22 f4 71 a0 8a f8 19 a9 52 e1 83 68 ce +15 f9 b0 64 eb 1d 00 b1 28 99 78 02 44 fe 8c 44 +24 b2 1f 64 35 0b 92 26 fe 95 ff 54 f1 14 39 83 +9b fb 54 f9 39 c9 14 95 e4 f0 27 90 18 97 27 3c +fa 29 5a 57 15 1f 4e 91 1d c1 02 a7 7d 95 8b 62 +27 24 c0 fd 3a 34 b3 b7 be fb 8b 8c d0 66 6e 81 +5d 0c 07 f2 ec b7 c4 dd 2f 42 b7 f4 09 13 12 e3 +d7 b2 df 26 78 87 e0 ac a7 0b 54 1c 4c 1e ea 16 +b5 + +# PKCS#1 v1.5 Signature Example 8.6 + +# ----------------- + +# Message to be signed: +93 29 a5 80 90 de 8b e5 7c 42 + +# Signature: +01 5c e2 4a 6f 2b 37 3a 19 99 7b b2 0c 18 ac 65 +9f 1e dc 0f 25 c9 e5 bf 76 d5 69 99 65 20 c2 80 +ef dc f1 5e 2d 63 ca af f6 c7 7a e0 38 97 03 7a +06 15 f9 83 8c 52 10 4e 97 25 18 e2 90 fa c3 8f +63 24 75 30 b4 cf 61 c6 ec e3 42 9b 53 07 81 cf +34 96 4f 32 ae 50 f1 09 34 63 83 86 d3 b4 df 76 +1c 59 7d 4a a7 fe ca 26 6c 27 f8 ce 66 ad e1 be +26 59 ce 14 2b a5 f9 35 88 3c 7e 8c 9b 89 57 ab +f2 + +# PKCS#1 v1.5 Signature Example 8.7 + +# ----------------- + +# Message to be signed: +6a ce 0f 1e 1d c6 3e 39 4a 06 1f 52 2a 54 2f be +71 20 25 4e 36 e9 f6 5d 19 57 c9 56 28 78 2c b0 +36 8f 3c 13 da d6 56 71 79 c1 ea 24 fe 83 5a 26 +63 85 e4 68 83 17 b8 2b 0c 3f e6 3c f2 d5 2f 04 +ae 8a 38 a5 75 59 bb 95 d9 eb d5 fe 8a 9a fe 14 +79 90 9e b9 9e 0d 3e f3 f3 12 e0 a4 ab b7 66 c7 +e2 13 1a 5f fb 48 31 83 fb b4 22 34 d3 2e 58 1f +59 50 65 c4 89 82 61 ec d0 ae 57 2c 22 1c 25 8d +e9 50 a4 08 01 ef 79 6d 4d d0 04 06 45 fc 53 4d +8e 78 58 23 48 38 ed 12 c6 87 40 c1 4e 37 16 13 +f0 04 61 76 bb b0 f4 3d 99 75 19 c4 0c 67 14 96 +ff 35 0a 3f df 42 9c c2 2f 46 4f 43 5f 6b 29 e7 +e1 c3 0e bd 50 59 27 d4 a0 96 58 7f c3 8d 3d 64 +94 39 1e + +# Signature: +02 73 ba 2c 50 2b 3f 29 84 c5 48 d9 f7 d6 c9 b3 +d7 fd 46 08 78 c8 4d 6b e3 3b 28 10 6e 15 fc 22 +17 ef f7 41 cd c2 66 83 4b ea a8 6d a4 05 f3 ca +e6 06 cc 61 f2 54 7b b9 22 92 03 45 fe 8f bb 5e +7b 6a bf 91 ea e8 c4 26 60 64 50 25 cc 7f c0 7a +53 4b 76 d3 78 75 e3 f4 0d 52 70 c1 0e f4 6c 7f +e4 5a fa bc ff ae 2a 9c 94 11 bd 04 d6 1d 4c 0e +5f fc 02 2c b3 6a 64 b7 c3 a8 c8 9b fd e4 36 ba +fd + +# PKCS#1 v1.5 Signature Example 8.8 + +# ----------------- + +# Message to be signed: +fd cc 0f 1e 5d cb e5 01 6a 6b 0f 8c 28 f5 b3 31 +ff 58 28 37 13 8d bf 62 ef 7f f6 1b c1 a3 53 96 +c9 2e 3d 54 8d 39 9e 35 0a 3c 6b c2 fd b5 da 94 +b9 86 a4 ce 6d ee 10 4e 9f 27 4b 15 25 58 bf a7 +22 cc fd da 3b 26 b9 f8 e5 15 25 f3 81 03 4c 51 +fd c9 f7 91 2a c9 27 d1 a7 08 cc 2d bb cd 7b a6 +c0 31 b0 11 cb a8 e2 df 8f c9 b8 83 64 ee 96 5f +24 27 0e 43 48 62 32 53 cb 9e 59 d6 f7 94 09 09 +94 a7 a4 c9 30 02 70 b5 7f 24 39 eb bb a4 65 84 +67 af db 7f e8 6b 4f 1a ad 1d 3d 3b 2f + +# Signature: +00 a7 c4 50 b3 0b 2e cb 19 bb 70 9a 92 31 cb fa +9f 0d 61 69 7a 26 b9 0a 96 d9 1c 24 c4 da 70 d7 +b0 0b 59 23 c8 e1 2d 41 09 4b 70 5d 50 c7 78 bb +da ce c6 60 d5 c1 5d ff d3 a2 47 8f d9 33 70 80 +dc a1 6b 9c 13 e6 23 3b 82 92 b2 fd cc 29 e9 bf +3b 21 a7 18 78 f3 4e f5 eb 7c d5 0a d4 12 03 72 +5a 0f 1c 66 3f 73 42 ec 7c 3d f3 d5 aa 51 d0 58 +df cc ce 5f e6 9d 36 3b 42 84 32 08 79 e8 6d 58 +b5 + +# PKCS#1 v1.5 Signature Example 8.9 + +# ----------------- + +# Message to be signed: +2d 1f cd 17 66 f7 d4 5f 29 59 4f 9d 4f 74 39 41 +ae 91 2a 97 91 1f fc 3d 65 dc d9 65 60 10 77 3b +b0 22 4b a6 df 11 1b 1c 13 68 38 4f 24 92 fc 4f +a7 28 0c 06 65 14 ae 84 f7 61 45 63 d9 05 2c a9 +4e f4 46 a3 1b 46 3b d6 c2 50 56 80 50 88 c1 d3 +1a ba ff 52 15 f7 a8 f8 9e 7b 64 f2 + +# Signature: +02 c0 e0 71 e8 36 90 dc 14 d9 a3 7d 61 e0 af c2 +7d f9 78 03 9d a6 01 ca 2c ec 1d ec 8f 0d 17 d2 +ff c4 50 e6 78 38 0a 02 5a 41 c7 46 11 8f 58 36 +42 52 a1 22 53 9e cc bb b4 ab 3d 8d 37 7b db b9 +11 c5 8a 4c b9 46 2f 36 dc 38 92 48 50 1b d0 8f +48 e3 53 3b 82 59 1a 2a 20 cf 62 df 5f 5a 1f 84 +ea 30 0c b3 94 57 13 71 41 ad 8c d1 d1 85 ab b1 +7b a5 d0 3b e3 48 c0 67 97 b0 95 58 f0 33 1c 24 +b9 + +# PKCS#1 v1.5 Signature Example 8.10 + +# ----------------- + +# Message to be signed: +4f 46 9a b7 9c b8 93 a5 3c 0e e3 81 5a 8b c0 87 +eb 74 ea 36 61 5b dd c3 33 de e0 5f c7 26 65 aa +6d 0b d5 9e 47 22 98 29 83 4b 1f 91 c9 cd 81 ce +28 d6 8f 14 82 5a 34 5f 3a 4f 38 a0 1b 2d ae 59 +10 07 64 aa b9 90 a8 50 b1 1c 13 d5 df e4 19 f1 +d9 20 d0 0c f1 3b f4 30 e4 ca 82 87 98 9b ee be +da 3e 5d 40 36 02 8c 8e f9 54 6e 35 01 50 d1 96 +f0 05 60 ba e1 47 22 99 e7 f4 29 1d 54 46 29 c4 +f6 52 e3 5c de 4f 80 3e 1b 3c a3 38 09 51 5e f2 +3d 25 4b 8e 65 20 2a 14 a4 11 b1 bc 31 5c 5f fa +ec b8 21 11 97 80 9d cb 5c ed 68 2c 09 f6 7e 41 +d1 60 2c + +# Signature: +01 71 29 64 ea 9a b9 70 29 5b 81 b0 fb d8 35 7e +54 b9 36 ee 87 72 d8 ae 9c 96 12 71 6f cc 2f cb +78 4c a9 ab ee eb b8 fc b6 89 82 16 1c c7 4e 40 +c7 c0 22 47 c0 d0 0e 03 bc 8e 1a 70 51 b8 7c 90 +dd 7d 3d fc 95 e0 b3 c8 8e 7a 0f 37 f3 0e 1b d5 +fe 8b 6e ee 46 5a 0b 34 cb 59 c6 4e bd b5 7d 6f +5f df f2 e7 0b b1 9c 60 d9 88 ea 95 6c dc dd 1b +e5 62 f2 6f b3 7c 34 da 52 a9 f9 11 b9 97 43 81 +2c + +# PKCS#1 v1.5 Signature Example 8.11 + +# ----------------- + +# Message to be signed: +52 bb 76 c9 ea 26 5d 6f ad 10 83 72 ff ab 25 03 +bb 20 d3 8d 37 df 19 92 54 a2 f6 de 0c 4f ca 7a +73 03 36 + +# Signature: +01 0c 55 34 23 60 22 60 15 8a 17 13 3b 5d 30 ef +e9 8e 9a eb 35 3b ab 33 71 e4 91 cd be bd 35 0a +0a 47 0b 9d bf d1 89 33 51 1f 0d 0e 36 94 a8 ac +4b f3 f5 b6 eb 9b f7 1c 23 d9 4c 2e 64 be b7 b7 +c7 22 52 ca 82 7b d0 c0 56 7b a8 a1 0a 6d 3b 7e +18 7b 0f d8 e9 e9 5d 4f e4 80 f2 50 dc 7f 03 42 +29 0e 9a 7d 32 70 3a 72 13 c6 52 13 ad ed 45 57 +54 78 1f 3d b7 3e 79 e3 d1 ba 6a f7 f6 90 fe 81 +73 + +# PKCS#1 v1.5 Signature Example 8.12 + +# ----------------- + +# Message to be signed: +5f 59 7a 19 cb f5 14 30 d3 c6 a2 47 a5 23 54 07 +38 6c ae d0 a2 94 f3 f4 1f 3f 37 82 50 d4 c5 a2 +c9 92 75 f9 55 44 cc c1 d7 7e 5c 15 1a f1 3e d6 +0b e5 22 eb 8c ab ed 89 a9 b4 5b 09 65 46 00 f9 +fc 75 1e 8b 12 e6 7e 52 + +# Signature: +00 3b d4 aa 90 81 fe 7e 9f 69 a2 69 fe c8 c8 a7 +36 70 c0 37 e8 5a 1f 36 fc ad 74 e5 b5 2d 71 0a +5a 18 ba 09 5b 98 10 cc 69 37 bc 76 34 09 51 e7 +fe d7 5b 32 6d 0a 3b 0f 26 c2 9c d5 eb 64 15 bb +f7 e2 dd 60 ad f6 a0 e6 13 02 dc c6 60 cc e9 10 +40 8b 4f 99 a4 40 ae 2a d6 c3 07 72 c2 9a 9e 7b +32 80 e2 e2 93 9a ba 0b 54 ab 02 2a a3 29 50 22 +71 8c d3 b7 87 b1 13 79 90 fb eb ef ac ec 8c b7 +49 + +# PKCS#1 v1.5 Signature Example 8.13 + +# ----------------- + +# Message to be signed: +84 0c c9 00 cb 4b 2c b6 7a 30 4a 9b 02 82 6d b0 +d6 67 36 92 2e 78 70 13 d6 bf 21 4d f5 79 ff 0c +f4 82 1f 9b + +# Signature: +01 3b 6c 08 0f 68 93 95 05 e1 87 a4 94 82 c7 91 +27 8d a3 ad 4a 74 7c 4f 01 79 1b 92 48 05 b6 82 +f6 49 bb d8 0d ba 12 fb be 59 40 f1 7f 27 e7 5d +42 67 7c 4c cc df fd 00 48 77 2e 36 93 4c 69 12 +12 8f f9 03 af ea 5e 1c a8 fe 94 24 fc 97 9b 21 +87 98 76 98 a5 c5 a7 5e 7d 70 70 a2 a6 74 85 2b +d8 05 bf 13 bb d1 29 6b ff 13 10 a6 d6 ed 45 fd +f8 67 2d 52 41 e7 4c d4 c4 19 86 e4 36 25 50 0c +23 + +# PKCS#1 v1.5 Signature Example 8.14 + +# ----------------- + +# Message to be signed: +c6 41 71 94 13 3b 5f 8e a6 3d 95 58 1c 89 6f 5b +9e f3 d8 7c f6 6c 02 91 64 0f 35 0a 32 5b 49 11 +52 e9 d1 43 0d 68 70 34 6e 46 8e 71 99 45 d4 e3 +65 d0 01 07 5f a9 70 f2 a9 87 0a 1c 65 43 4b a1 +70 02 41 2a cc 4c c7 4d 28 b2 de e2 9b 36 e3 97 +b6 8c 5d 59 cf 67 7c 29 ae e7 93 a9 30 0b 7b f4 +c6 73 b3 e0 b6 03 a3 61 1c a9 02 44 ff 08 78 75 +c5 16 88 57 cb 92 a9 5a aa 61 df f3 c2 12 dc 62 +06 f1 71 47 c4 4b 95 07 d5 c8 90 75 8b b3 5b b7 +2a 2a 5e 9d 4d b2 65 e5 37 3a 5b 34 02 90 4f 0f +1a 12 05 d5 bc c5 90 25 d3 22 0a 5d e1 b1 82 a8 +4d 30 41 2b 84 26 d4 69 32 32 1b 57 ef 72 64 0a +dd 2c ee bf 5b e9 68 43 6b cd 12 16 90 78 84 82 +32 93 b0 10 ec 28 f0 d9 + +# Signature: +01 60 47 ca ad 6c 47 bf 27 d0 cc fa 03 41 01 7e +56 5e 02 8c f2 6c 8e 66 0f 79 e0 91 f3 50 ce b2 +aa cf 92 f7 d0 1d 37 3f 71 55 11 9c 07 29 17 f2 +4f 01 bf 74 7b e2 dc dc 41 d1 be 58 85 35 c2 d6 +ac 17 04 c5 fb 16 f6 e5 dc 4b bc 84 53 f5 21 db +73 1e ba 78 98 e6 e5 21 2b 80 ce 9d a0 f1 56 28 +18 99 98 31 35 03 df d4 4e 3d 69 de 9b a9 cb 5e +b3 2a c4 1c b8 e3 62 1b a1 d2 91 d0 c5 da 24 9f +15 + +# PKCS#1 v1.5 Signature Example 8.15 + +# ----------------- + +# Message to be signed: +a6 42 f0 f7 0b 4b d3 b5 4b e2 20 11 9a 7f 79 + +# Signature: +00 a0 33 6e 63 67 52 7b bf 13 b0 a9 33 b6 31 c7 +2c b3 3e ab bc 29 2a 0f 8f 75 55 0c 22 30 fe 82 +57 f2 af 76 d5 43 cc d1 07 dd 2c 87 78 d3 ac 8a +7b 5b b4 ac fa 57 f2 af 6a 23 14 95 23 5a 51 da +dd b0 83 e3 73 b7 77 a9 5c f9 c4 a9 b6 be 77 51 +b6 5f eb 62 3a b3 34 43 36 54 b1 21 0f 7f 78 2b +17 25 c6 ba 4f fd 20 d1 7e d4 b6 ec 4a 3a f6 4b +d2 73 47 55 b7 73 9e eb f4 18 f0 9d 3a ff 28 9d +13 + +# PKCS#1 v1.5 Signature Example 8.16 + +# ----------------- + +# Message to be signed: +ca 16 e4 3d 9c 82 d9 d3 0c 8f cb 40 22 93 3c ff +c7 d7 4c aa 0d f4 86 35 09 31 8e da ba 4e 0d 51 +99 77 9c 03 50 4a ff a2 7d 87 19 1b 6b f6 86 a8 +4d 97 9a 2f dd 5b 8a 4c 49 32 14 45 c6 f7 5d 25 +23 59 17 ad be e2 a5 cf f8 a9 7a ef 78 c0 09 22 +10 11 d8 3c 0f 9d 37 16 08 75 af 73 67 71 8b 10 +ee c3 b4 29 90 e6 43 f6 37 07 cf bb 30 a7 fa 74 +ab 16 a7 eb f1 c8 38 c3 b2 26 37 b6 3c cd cb 6e +b3 4c 62 eb a9 e9 48 c7 ac 90 30 f0 63 77 29 d3 +e2 78 0a e6 be 4d 2f af 34 6c 11 63 d3 f9 82 48 +19 3a 76 39 9f b7 84 ca cf 68 fb 33 c7 4b ab c9 +dd b6 27 52 0c 0c 61 12 34 64 68 cf 20 a8 e0 2c +c9 a9 bd 27 91 0e 83 29 7b 85 e8 57 32 4a 01 00 +f5 cd d5 93 1b 6a 6d e0 5f 94 83 3a a8 61 0a 3a +4b 08 a5 a3 93 53 + +# Signature: +02 48 59 23 3f b9 db 7c d1 41 f4 b8 77 6a 1d 83 +e1 03 db 3a c9 42 89 d3 6e f4 0f 5e 6e 63 c3 12 +12 af dd dd 16 88 c2 c1 c8 d4 db 04 71 9e 1c 6e +8d bf 7d 60 be 25 f1 d6 88 87 fd ad da 3d 11 2e +3d 0d 24 c0 cd d7 98 8a 55 c7 10 29 40 08 2d 1a +c3 1f b3 ef ab e7 c2 88 cb 4e e7 2a 99 2a c9 6d +1e dd 78 ec 72 82 73 97 0a 79 69 95 c3 e2 a3 85 +81 e2 28 03 25 8e b4 cd 9d a2 04 0f af 74 1c 54 +2a + +# PKCS#1 v1.5 Signature Example 8.17 + +# ----------------- + +# Message to be signed: +3b aa 7e 9a da 21 43 f8 48 82 5d 22 93 67 04 d1 +c9 97 b2 da 76 76 9c 98 6f a1 52 b8 98 ae b1 1c +10 b9 45 79 76 4f 9d c9 33 65 2a 81 03 67 04 76 +95 8d 59 86 7a b2 4a 97 12 84 05 6e 99 c6 48 b7 +7e 7a 65 36 44 87 0f e4 c7 ce f3 7f 90 01 60 48 +72 ad ed e1 6a ac ed 8a a5 df 42 05 33 04 e4 d1 +71 12 0d 7a b3 ce 81 a4 d1 a2 74 98 d1 38 01 8f +66 21 bd fc 1d 53 e7 f3 c1 a5 aa 5d 62 b0 9a 55 +4a 56 f1 ed 4f 38 5a 07 68 ea a2 da 0c 9f 56 37 +03 4c 2e ef 58 cc 35 17 8b c2 a6 27 2c f5 29 b6 +5a df + +# Signature: +01 e6 3b 86 d0 c1 59 99 09 3d 44 28 af 7c 6d e6 +48 07 45 d8 19 e4 29 62 3f 47 2b 45 de 61 aa 56 +7b 60 d9 94 79 2a 0d 11 65 80 55 98 f4 e2 1f e6 +13 99 9a 96 22 5d 0b ba 98 f9 cf be e8 3a f5 85 +fa 07 84 39 a7 42 51 5a e2 18 ec 31 f8 d5 08 f2 +9b 0e 58 75 fc a8 f0 4f 11 a1 c8 2f 2b b0 ae 52 +8f da d3 ca 50 75 bb 3f 41 bb 57 83 34 81 33 fb +a8 a0 b3 ad 95 1a 1a 64 9c a0 f9 75 8b 20 c8 70 +fd + +# PKCS#1 v1.5 Signature Example 8.18 + +# ----------------- + +# Message to be signed: +7e b3 c9 8e 46 fd 1b 5c 9f f1 b1 1b e1 61 9b 56 +60 57 f2 6c 55 e2 88 f4 84 4c cd 50 ba a9 1b 03 +8d 60 95 83 6f 77 1f c1 c4 25 fb 53 3e f2 b1 dc +4a 3e 94 9b b9 95 25 c2 8f e8 a3 e9 31 78 f3 a0 +ac 97 fd 5d aa 81 b5 92 86 18 8e 17 b4 4b 37 71 +bc a8 55 d8 5f 3c 4d 28 6f 10 68 10 f4 e5 22 ea +05 83 4f 11 a3 1e 89 c3 59 90 c5 1b 08 0c 03 a6 +61 e3 d4 a1 b9 7a 2c 27 94 0f 5b 2e 41 2b 69 9e +a6 10 e8 99 6a e6 71 5a b6 e2 09 69 b6 aa 54 cc +72 31 9d fe e6 3b d2 ca cf d0 60 8d 40 e2 b4 03 +95 fe 55 dd a5 be a3 b0 f9 b9 4b 5a ad c0 98 dd +56 8d a3 95 db 2d 44 e4 + +# Signature: +01 5c fa d9 6e 4b 57 d9 cb b5 78 c7 90 74 a2 ba +86 9c 06 02 88 68 c5 a3 fc f4 a5 e3 61 83 1b d8 +c0 2c 25 b1 2b 90 23 4c 8e a4 82 2f b6 5e 82 d0 +91 a9 0f 89 b6 c1 15 6e 4b 44 d7 8d 32 a6 47 37 +d6 15 87 c0 ce 3f 4b 34 3e 71 f8 f7 a8 4c 6f 8f +c8 ae f8 f4 64 c8 b3 59 e4 fb 18 ad c6 99 c5 a0 +76 45 37 55 93 0c 5f 6f a7 07 1f 8f ec b8 63 1a +a4 14 f5 08 35 03 8b e7 ab 05 a4 b0 50 f3 f5 6e +86 + +# PKCS#1 v1.5 Signature Example 8.19 + +# ----------------- + +# Message to be signed: +6a 45 ee 0b 7e a8 03 68 b2 c4 29 af 28 81 53 f4 +56 cc 66 32 17 a8 ff cd 2a a0 5c 5d 32 2d b7 57 +56 cd bc 0f 68 41 41 fe 6b ca e1 89 bf 24 de 1c +8e dd 5b 11 36 44 a4 50 0d 0d 4f f5 80 08 36 40 +e1 2a 2c 95 de 69 e9 59 6b fb 1d 44 36 57 86 e1 +67 d0 25 d8 9e a2 f8 d1 3a 0e 64 77 f1 3b 85 bb +dc f1 60 77 4b 18 25 8c a0 be c0 bd 7b f1 39 11 +b3 89 6b 48 89 fa 3d e0 4a b2 6b d6 82 b4 ab 43 +7c 0c 17 f3 53 a2 3a 43 e9 2e 20 e7 f8 20 69 4e +40 3a ab dd 5d 19 6e 93 89 5b 47 92 55 df 40 30 +ad 8c e3 a5 3d 15 73 be 22 6d 81 aa 18 e4 85 89 +57 a2 d0 a3 35 9c 2e 7a + +# Signature: +01 64 f0 db cd d9 52 11 86 a2 80 84 a3 f3 ae 6a +ac b6 59 6b 85 6e 8a ab 2e 72 a7 f2 33 d6 2d 2d +3e f1 96 d3 78 7e 4b 04 57 31 da 9c 61 50 ad 9d +5f 91 8c 6b 06 c9 2a 11 a0 bf d5 ef cc b7 b0 3a +01 07 24 14 39 d3 4d 31 3d 35 b3 6a 0d 8c a0 81 +3c 36 23 b2 bd 78 f2 e3 a9 71 99 64 8d a3 58 06 +ff c5 8e ed 33 ac 9f cf 79 53 8f a8 89 15 b1 a5 +75 85 78 b9 a2 db 01 38 04 bf 32 e7 a5 6d c7 24 +37 + +# PKCS#1 v1.5 Signature Example 8.20 + +# ----------------- + +# Message to be signed: +92 a4 b4 bc e3 da a0 a7 a6 4b 72 ad 87 1f 3a a8 +ea b5 ac 40 11 aa ae a2 ce eb a8 92 77 c6 43 29 +57 26 26 c9 56 88 4f 48 54 f8 61 3d 22 51 8b 14 +f0 38 fc af 9e 68 e1 30 02 fb 0a 00 a7 8c c2 ea +51 44 fc 13 11 76 d5 e5 d6 7e 10 6a 99 87 9c + +# Signature: +01 24 fd 8b 2a cf 22 37 fc 71 a2 ee 97 e2 6a 4d +ab 7d ea 82 9e 15 be b2 f8 a7 37 91 a0 ba 15 2d +a5 b0 6a df 34 1d 74 09 e8 d3 d3 17 5b 51 01 34 +32 5a 35 32 97 a8 d6 d6 6c 09 70 03 22 ee c5 e3 +3f 62 48 6a 21 11 30 d7 4c 70 dd 92 5d f8 60 2a +e3 c4 c6 cc af 93 cc 9a 97 0d 1e 85 32 60 ee c6 +94 81 c5 f1 33 7e 9d d3 ae da 88 d8 82 99 be 08 +09 5b 71 5a 5b 21 66 e6 17 c9 26 72 2c ed d6 ef +34 + +# ============================================= + +# Example 9: A 1027-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +05 f3 74 34 88 26 1c 6f 06 25 e4 32 fa 6e b8 7f +b1 2b 26 21 82 90 bf e3 96 ba 76 ea 42 61 32 2f +81 43 e4 b4 eb cd 5d 2a e1 9b 0f 9d 8d cd 2f c7 +e6 82 32 08 a7 51 83 3d 3b 4e 8e 38 7c 39 f8 ed +6b bc 9f da ec 32 d3 ea 9a bb ff 57 47 23 f3 f1 +22 99 90 96 3e a4 fd 9f b5 44 f6 42 90 aa 2e a7 +da 63 11 91 a2 0d bc 94 23 b4 61 23 3b 93 72 49 +f2 f4 ea 10 92 8f ae 2a 6f e6 64 f1 2c 09 23 ed +11 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +05 f3 74 34 88 26 1c 6f 06 25 e4 32 fa 6e b8 7f +b1 2b 26 21 82 90 bf e3 96 ba 76 ea 42 61 32 2f +81 43 e4 b4 eb cd 5d 2a e1 9b 0f 9d 8d cd 2f c7 +e6 82 32 08 a7 51 83 3d 3b 4e 8e 38 7c 39 f8 ed +6b bc 9f da ec 32 d3 ea 9a bb ff 57 47 23 f3 f1 +22 99 90 96 3e a4 fd 9f b5 44 f6 42 90 aa 2e a7 +da 63 11 91 a2 0d bc 94 23 b4 61 23 3b 93 72 49 +f2 f4 ea 10 92 8f ae 2a 6f e6 64 f1 2c 09 23 ed +11 + +# Public exponent: +01 00 01 + +# Exponent: +01 4c c3 26 32 52 f8 c4 fb 77 cd 57 a1 42 0c 04 +c0 43 27 8a 0c 45 e7 d4 23 79 49 3e 34 0f 9c f1 +a9 6f 96 06 3a b7 59 d1 63 04 06 ae 28 6a 18 34 +b6 d1 db 71 ee 72 2c 93 74 5f dd 4a d3 3f aa 72 +d8 93 51 da 69 1a 7d 0a 71 d2 c5 5c 57 97 d2 cc +b3 b4 62 62 08 bc 5f 5c 84 fe 43 2f 66 4d c3 0e +de 09 63 e6 58 45 2b 2a d5 ef a4 93 5a 12 2f 46 +1d 1e ab 84 1c 8a e0 e6 e8 2f c1 fe e8 5d 18 1c +bd + +# Prime 1: +02 94 ea 0f a3 4e c3 13 72 33 44 20 2e 85 ec a2 +4b 5d f6 46 1a 1c 30 08 7d ca b5 d2 53 39 4a f5 +66 6f 03 5c 33 35 41 0d 8b b9 86 62 c9 78 f6 1d +37 db 4d 83 f0 b2 4c dc b6 3f ca db 79 c5 27 f5 +ab + +# Prime 2: +02 4e 19 16 52 f1 70 9f f4 74 37 40 85 81 88 8a +9d a1 09 17 c5 b5 ab af 91 46 10 9f da c6 94 76 +6f 4c 8f b0 57 96 8e 84 8d 99 58 6b 05 f8 a0 2f +ba 6c a1 eb 12 ba 08 df d4 9b 62 c2 7a 8f 15 f4 +33 + +# Prime exponent 1: +01 22 7f 36 dc 6b 14 27 89 fc aa a7 12 8b df 14 +fe d7 90 16 04 07 fb bc df bd a7 e9 88 97 18 31 +81 12 ae 81 6a 28 b0 2d 4a 0b 03 dc 8b fd d4 ff +c6 bb 67 f8 e4 65 1a 8f b0 b3 9d 70 96 b7 67 f6 +fd + +# Prime exponent 2: +02 25 ec 05 3c e8 da 6f 86 ad e3 6b d2 bf 43 93 +02 91 37 5b 1b 1a 51 d4 7d 0b 11 a5 17 8a 26 83 +34 f7 e1 94 92 1b b1 d7 5f ea 7f 56 c5 aa cd 05 +8d b3 7d 36 08 2e ac e4 83 4b 07 bf 7b dd ea b4 +b7 + +# Coefficient: +02 0b d0 f5 15 80 87 ed e3 8c b5 dc 66 e4 01 0a +e4 e4 8c c0 04 2e 15 2c d5 ee b0 51 c9 ec 45 ad +23 40 24 53 52 c0 1d 94 c6 a5 26 aa 5a 45 4c db +ae ac 85 95 34 9b be 6a 8d 55 19 a3 c9 b7 d0 7c +3a + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 9.1 + +# ----------------- + +# Message to be signed: +82 e5 c5 aa e6 4e 60 8b 27 50 4b 91 db + +# Signature: +01 45 82 da e9 35 e6 b2 ae ff 7d 72 50 89 da b0 +58 c6 78 b2 ee 28 bc d4 44 a7 2b df ac 31 46 3e +18 e9 4d 7b 5e cc 84 a4 31 69 6a 1c dd 79 f9 c0 +8c 33 e1 d4 b3 22 dd 27 7b 50 3a e6 e4 f9 c3 15 +30 5b 43 72 fe 45 fe 4a 7e bb fc 4a e5 90 fa 3c +52 0b f8 28 15 8f 78 20 29 9f 09 b1 34 ed e1 17 +b6 72 a1 ea c2 f0 50 c0 44 b2 55 ca 8d 45 52 d4 +b5 f3 f5 7b 87 34 db 24 74 50 07 44 a5 33 75 00 +5e + +# PKCS#1 v1.5 Signature Example 9.2 + +# ----------------- + +# Message to be signed: +77 e0 fb dc d6 e0 49 8f c5 68 4f f1 3d 4c 9f 5b +78 0e 77 e2 46 46 37 ff 66 ea a2 d7 d9 c3 de fb +9b 0e 3a 38 37 73 db 97 a4 fb 49 1b eb 21 14 fd +ea 2c 2a 48 0f fc 21 9b 79 6a d8 05 d5 4f be c1 +7d cb 34 b1 da 17 96 cb 9c d5 f2 41 6a b5 e7 66 +f8 e0 06 91 8e be c1 82 29 98 a2 8f ff a6 23 0c +07 87 26 fb a2 e4 a7 b0 + +# Signature: +05 93 27 ce e7 26 ff b6 03 e8 a9 fc d5 74 ab a9 +cb df c3 6c 0a a6 6f cf e3 55 5c f2 ef 35 82 d3 +22 0d f9 d6 bf 8a 78 e3 ff f0 c1 29 b3 ab b3 dc +71 21 12 a2 05 6b ca 08 63 65 54 c1 ac 57 df 87 +f3 66 41 52 68 8c 6a c7 2e 6b 88 f5 63 7c d7 3f +16 69 89 c8 29 09 fb 67 bc 1f a2 e2 d5 23 e5 1c +91 8f 2b be c1 d7 52 02 af 24 0a 61 cd 2d cc 55 +5c ae ae 9a 68 57 0d 77 81 0c f1 df 81 23 ff 41 +c0 + +# PKCS#1 v1.5 Signature Example 9.3 + +# ----------------- + +# Message to be signed: +0d fa 5b aa 1c dd b8 34 70 7a 5f 8c c6 ec e5 71 +a7 a7 fc a5 67 63 62 d2 b2 37 41 a9 57 0a e2 63 +8f 6b 1c 23 89 85 36 75 cc c6 cc 1b 4c 6d ae 23 +cd a7 1a b9 6b 5a 2f 22 14 57 50 43 3e 2d 6b a4 +27 6a c1 ff 9a 48 af c9 f3 12 f4 13 37 85 ca 5a +f3 74 66 74 31 9a 67 57 a1 64 e3 4d 14 98 bd 55 +30 90 2e 32 18 55 e3 be d4 08 81 f0 05 42 25 6a +a2 1a 42 fc + +# Signature: +01 d1 95 41 69 af 58 99 3e 14 77 2a 94 f1 9b c4 +79 24 cc db 2e 90 ee 43 36 fb 6e 08 49 8a f4 da +26 51 a2 b7 83 6c 31 3a 57 c8 61 b5 51 84 ec 3b +15 fa c8 14 53 51 be c5 a7 27 0a 3a a8 69 4d b4 +e9 a9 2c b9 32 7b b7 a4 f7 b7 0d 24 4e af 9e bf +a9 ed fd 4d 54 78 2f 3f 97 26 26 95 b9 7d 41 6e +52 7b e4 ea 2d ef fe 6e b5 e0 6c da 6f 0a 7e 41 +66 77 ac 0f d6 f8 19 5d 4c e2 89 70 d2 ca 41 1a +2b + +# PKCS#1 v1.5 Signature Example 9.4 + +# ----------------- + +# Message to be signed: +16 7e 79 56 8c 77 36 69 0c 3b ed bb c8 d4 24 eb +53 6a 12 85 5a 60 cd b1 0f 94 ba 11 23 17 e9 17 +a1 b7 d6 fc fa a3 43 8d 68 ee 09 fd 47 + +# Signature: +02 9a 2b 90 86 14 ed 7a 5f ab 72 f2 a1 c8 e5 48 +b6 f8 b8 b4 5b 75 81 fd 24 51 fe 45 a6 22 fa 0f +08 dd 0b a2 e8 f3 c4 17 20 1e a0 27 79 10 18 4f +37 6d a8 03 fa 72 c5 0d 39 be 28 82 52 6d 1e 85 +df 9a b1 79 75 76 4a cf b2 07 36 6f 6c d2 c8 b1 +36 a9 99 da af 48 f1 c0 8a 9e a1 f0 84 25 c2 1b +65 41 80 da 4a df 10 9b 4b c5 b8 17 dd 67 bf 7d +aa b4 a3 84 03 4a b4 ad e6 94 89 8c fc 27 2a b6 +53 + +# PKCS#1 v1.5 Signature Example 9.5 + +# ----------------- + +# Message to be signed: +0d 03 f7 12 84 f2 e4 83 24 2d 92 3f d1 e1 53 bc +16 0f 0c dc 2c 0b 76 f1 bc 2c f7 d1 be 9c cc 7f +af a6 af c3 90 34 01 84 09 cc fd 16 28 a7 0b 35 +83 33 bd 96 ee d3 ad f3 14 2b 17 60 bf 8a 9b b1 +9e a2 47 3a 2e d8 5c 91 cd 5f 0a 5f 2d 46 32 d6 +17 64 19 fa 1d 8c c8 8b 67 08 47 77 11 ea 49 58 +a8 39 01 fe f2 84 f5 a6 c5 02 79 8c 8b d0 a3 50 +f2 ea 83 ed 18 1e b9 70 d3 0b 78 13 4c 8e 1d 64 +f0 d1 49 5b 70 17 24 5f a6 9b d5 74 27 f7 49 20 +ba 0e ed e9 cb a3 4e b2 22 76 b0 f2 74 13 ba 3f +0d a8 eb de db 9b 0c 80 0e 44 48 1d 01 e6 bb b0 +df eb f9 a1 5e f6 a7 02 0b 2c 55 ee 02 79 11 79 +6f 66 f4 3d d8 46 02 1f 8d 6f 7e 01 bb 80 2b ac +09 fd e9 b9 04 be cf 99 90 e6 84 e6 56 9a ca eb +3c c6 4d cf 5d + +# Signature: +04 22 79 1f e7 b4 3e 1f 31 9a e6 7d 91 8c 59 87 +e6 39 36 81 a1 86 1c 1e 71 dd 6f ce 19 23 71 0d +bc ed 43 01 fd cd 4a ad 8f 4f c2 7d fa 02 a9 4d +91 bd 96 20 0a ed 8b 3c 5a 96 ef ee 7d 11 af 90 +87 fb 81 90 5c 5d f2 c2 4e d7 ed 63 d5 fc 22 ba +bd 6b 9e 3b 57 cd 25 41 9a 78 17 e9 36 16 e9 34 +54 b9 58 53 fe 52 04 b5 8c 09 8b 46 de 0b 3f 01 +f5 82 76 32 48 c2 90 b9 e8 09 69 65 24 42 a4 d8 +e5 + +# PKCS#1 v1.5 Signature Example 9.6 + +# ----------------- + +# Message to be signed: +4a ca 96 3f 14 ac f6 a7 9c 51 08 1e f2 57 16 66 +71 e3 b4 5f ee 31 24 07 ba 3c f6 d7 11 ab a1 ae +25 a4 a8 ba 45 48 19 a3 91 2a 31 2e 99 0f 1f a7 +4c bc b7 27 77 f1 c7 c6 63 a2 d1 cd b2 c5 c0 07 +4d 45 16 f4 87 17 de 14 03 e8 ff 7d 0f 9d e7 c7 +c8 51 f3 e3 51 16 8b a6 c4 14 be d5 d4 2b ae 52 +7b 72 4c eb 83 4d 79 ba cf 70 2c 56 a6 23 c1 68 +80 87 dc 9d e9 53 8e a7 c7 c7 61 cd 2f d5 78 f0 +dc 3f 55 2f fb d4 af c7 f4 ec 71 22 fd ec 1a 3a +2b 10 4d 53 2d b8 1c b9 14 18 54 d5 7d cf 54 b7 +56 01 a9 05 fa ed a6 5c 2a 7a 7b c2 b0 29 ad 12 +dd 7a 6a d1 b4 0b e0 40 28 b4 b5 b6 37 30 ef 98 +44 73 f0 c4 82 14 89 93 c3 6b 44 e5 4b e9 a5 f2 +34 e7 43 29 2a 12 a3 4b f2 ff 73 b7 f7 98 + +# Signature: +04 26 43 c0 3a da 72 4e 2d bb 19 cc 07 ad 0e 75 +22 28 b9 d3 6f 65 3c 6a 9c 0c 29 35 6c f4 c3 f1 +ca 19 37 76 d5 fe f4 3f c5 54 17 71 66 69 de 9a +b2 ad dd 3e a8 8a 90 ae 93 9a 5e b1 10 13 e2 28 +ae 08 16 ee fa 4d d4 2c 6c 08 c8 78 bd 58 b4 90 +40 29 6a 86 3b fd 11 28 5f 8b bd 31 5b e1 6d 2d +65 d7 f5 e5 f2 6a a9 71 47 f9 5f 5e e3 6f 98 9a +a8 96 d7 f9 f1 b3 05 1f 82 42 44 f9 05 96 72 3d +11 + +# PKCS#1 v1.5 Signature Example 9.7 + +# ----------------- + +# Message to be signed: +a7 5a 45 80 + +# Signature: +00 4f e4 c5 d9 14 3c 85 1e 46 16 7c c1 81 57 5c +07 5e 69 b9 81 f9 c1 03 f9 d9 b0 11 ff 8b 29 ba +55 a4 31 87 ce 87 77 99 63 17 a0 3c 9d 90 af c1 +89 0a 9a de ec 8e ac 08 7f 99 b8 15 e6 eb 2b 87 +1d cd dc 80 92 24 9d 8f 51 3c 6c 56 09 fd ae 2c +fc 6b f0 1f cb 80 25 a4 f7 9b f1 2a a8 e1 09 82 +9a 0b b3 8a 09 d1 a3 93 65 e0 40 56 52 da e4 51 +e5 c3 29 8f 47 04 05 98 ec d7 0e 4b 40 33 89 bc +d5 + +# PKCS#1 v1.5 Signature Example 9.8 + +# ----------------- + +# Message to be signed: +7c fc 00 a6 43 ae 99 79 68 01 ee 3c eb e2 cb b1 +a6 be 1c ac 15 c6 48 d4 ba 33 01 29 38 71 a9 9f +7c b1 43 c1 28 c7 7f 96 31 1f e4 3a 39 01 df 2c +2a 5c 40 4b e8 31 46 97 e0 9b 2e 80 aa c6 ac 39 +97 1b be 0d bc 26 67 3f 31 95 9f 23 8e af d1 50 +12 e4 96 7d 33 55 18 92 a3 d3 65 1f e4 46 9b 2d +ba 45 57 df 89 3a b6 b9 4f 13 25 c3 a1 + +# Signature: +05 98 5a 4c ce d0 e8 fd c5 89 24 ed ba 9e 40 0e +67 48 21 4f 8d 0b 83 aa fa 20 35 0b bf 0e 68 76 +ca 5a 9a f3 97 0d d6 3b e6 84 f9 93 6d b2 82 ff +8b 53 cf 5f 1b b1 cb f4 47 33 01 f3 72 d9 94 8a +f9 39 1b 20 02 b2 be 3e 45 ff 24 a2 d8 99 ae 8b +52 b6 71 b0 4b ab 46 01 06 be dc fa c0 13 95 9a +48 18 95 98 42 7f b9 57 15 9a 6d 32 9c 19 f3 6c +a7 53 81 b9 35 0d 34 38 9c 16 e1 80 a8 51 e4 57 +cd + +# PKCS#1 v1.5 Signature Example 9.9 + +# ----------------- + +# Message to be signed: +3d 90 de 72 35 51 59 49 24 5f 49 03 68 c1 f4 93 +83 e4 4c 1d b5 1d d5 38 5b df f5 bd 34 45 0e 63 +ce 42 15 0b 44 1e f9 eb c7 29 a9 03 34 53 f0 a9 +39 9f f6 86 1f 50 65 b6 66 6d c2 0b 28 72 03 42 +8e 72 bd f4 cb 74 8a c8 d4 a5 5f 43 d2 23 5e 0a +b2 ec 2c f2 b0 6a 01 5f 41 e3 51 68 ac 7e 3c 56 +8f 2f 16 ef 57 28 b2 be 95 24 91 9d 36 76 d6 8f +53 7e fe f2 9a 05 af 97 cf ed 7c e9 ec 45 c1 2f +16 5e 4d 7a 4f e7 2b 99 ea bf 83 31 6c df 2b d1 +64 4b 82 fa 13 e4 ff c4 49 e7 6d 44 c3 87 69 63 +51 47 8b 1a 0f 85 96 15 da 90 5f 20 e6 8b 24 56 +5c 87 3f 83 4e 59 34 58 51 8a de 41 c1 42 81 74 +da 0c 47 66 3a 76 00 c6 50 25 01 5e 09 c1 + +# Signature: +00 98 13 b2 fd c5 1b ff 88 de db ec a3 b1 4a e5 +8b c7 e7 14 c1 d9 2d 74 26 e4 94 4e f9 3e f9 ce +6d 10 dc 98 9e af e7 34 8d 0a 95 f9 9f 56 94 8f +72 60 2a c5 e8 61 4f 6b 38 e6 8d a7 9f 48 e2 76 +8e da 58 64 cf f2 54 51 37 f3 cf 4d 81 a5 ae b8 +9b 21 07 26 74 ca eb a0 00 71 00 c0 7e f4 dc bb +d0 5a fb ad 9e 8b 30 d7 46 ea 36 0d 6c f8 75 d1 +0a 67 a5 7f 4b 5d f4 12 1d 72 97 a4 bd ce 12 8c +b5 + +# PKCS#1 v1.5 Signature Example 9.10 + +# ----------------- + +# Message to be signed: +20 e6 a3 fe 16 b5 21 b3 c1 e6 ae 99 3e c6 e8 49 +a9 c1 1f 20 42 a2 d4 ce 89 cf 0f 99 e1 b4 b9 47 +1d a9 a1 73 0d a8 85 1f c5 ab 3c 09 22 05 5f 00 +37 58 b2 35 c2 8d e4 08 80 66 3f cd 80 14 07 18 +15 dd 06 49 4a 54 7c ce c3 34 8e 12 d5 38 d5 df +b4 8f 80 7b 59 e9 b7 cd 81 f3 91 c0 2c 01 6c d9 +c1 a8 4f 9c 59 51 79 d8 f2 00 24 2a 56 68 18 2c +f2 cb a3 b9 fb 6e ad 45 1d 6d 27 d9 c7 36 15 25 +d6 88 b5 52 33 ff 45 29 1c c0 74 02 d2 92 de 0b +e8 3d 16 46 c4 3c 28 88 1f d4 55 49 b1 4d 12 61 +b1 2f 12 04 38 27 6c 6b 3f 98 f5 5b cf 17 80 bc +1a 91 eb 11 d0 22 9e 1d 78 68 d7 fe e4 9d 6b 91 +68 e2 4d e1 cb 4f 0f 22 e6 7c bb 15 69 20 41 13 +02 72 94 b3 7e c7 fa e5 8b c6 4e 82 5e aa 4d 56 +94 d0 05 8f 2c d4 c7 d2 14 18 da 3c 03 07 fa 2f +04 92 e8 b3 77 58 d3 ea 40 a4 e3 0f 60 + +# Signature: +01 f0 2b 3f 83 91 23 af f2 a3 f4 3d a5 aa a0 b6 +bb b6 0c 04 37 82 f4 96 2a 7b 9f 02 5c 94 8e 34 +32 2e 98 de 37 03 e3 bb 45 a7 06 a2 bb 05 09 be +d9 f4 10 52 8c 88 1a b9 a1 dc 01 97 06 8c 37 28 +c3 71 6d 83 81 d9 f8 67 80 fe 78 a6 43 4b 72 f5 +1e 69 cd 32 a7 21 3c ce a7 43 b3 3c 3c 96 eb 00 +42 fb 98 a7 0c 2e 52 fc 17 8a b2 cb 9f f8 bd dd +c1 04 6b 08 e0 47 ba dd d6 5a 45 a4 e6 53 39 d7 +25 + +# PKCS#1 v1.5 Signature Example 9.11 + +# ----------------- + +# Message to be signed: +6e b4 9f 8a bc 5b 49 48 72 0a 7f 42 f7 40 84 78 +00 22 e0 e9 f9 f6 88 86 d9 f3 4e 7f 7f 8a c1 54 +db e1 9c 91 b8 ed 38 ec 03 6b 61 42 12 ca 35 f7 +9e d8 74 57 9e 24 85 da c8 20 5d 0e 56 b4 b4 c0 +00 0a 8a 75 a6 d4 97 fc 51 19 11 1a 40 db 51 3d +f6 61 96 55 b5 8a 11 6f ab ee 08 2b fa 79 37 3d +91 76 56 87 10 11 24 18 87 f4 42 60 8b d1 eb 1d +95 d1 76 80 65 fa 63 32 4f ab 27 36 f9 22 70 5c +f2 89 fd e9 26 74 33 85 92 07 a8 bc f1 2d 17 86 +1c fd 06 2b 88 df 78 87 0d 5a 5e 91 13 1b 63 + +# Signature: +02 a2 fa 32 71 77 96 71 0b 52 b0 51 90 6c db 98 +15 b2 d0 36 6c 07 0a 78 ff 72 d4 59 42 d7 ad de +ae 7e dc 73 ca 93 01 f1 f9 fa e6 8a 0b d4 b1 df +05 a9 a6 71 f8 a5 b7 d4 5c d1 1f dc 0f 0b a0 9d +25 ce c3 b6 30 3d 9a 66 6c 76 32 64 96 ea 31 ae +38 86 a0 c3 b7 d2 27 62 ee a2 78 93 4b 96 a4 f9 +0a 50 1a d3 08 8f 70 2e 14 76 3c e3 38 46 e2 fd +be 6d 66 1c b8 2e 6d 98 9d f3 c5 ac 8f e4 0a 85 +62 + +# PKCS#1 v1.5 Signature Example 9.12 + +# ----------------- + +# Message to be signed: +45 cf ec 13 2e e5 93 f0 c3 f3 81 3d 3c b4 49 e6 +e5 e6 1d 13 de 52 9a e3 e7 1c 99 8e a4 56 35 9c +e6 6b 82 04 5b 7a c7 97 fe 96 98 5d ea bc 51 22 +53 0b 2e 29 ef c9 75 ee 96 03 b4 f9 6f 3f f4 e5 +9b 0e 35 a9 ad 92 f2 b8 67 79 4d 8e + +# Signature: +03 9b e4 8f 13 3a e7 f0 b1 9e dd b2 13 56 09 73 +a3 e2 a1 14 6c 79 42 f8 26 4b ba 5a d0 08 69 2d +11 38 01 fc 27 78 a7 e3 3a 9e 11 5e a6 32 e5 01 +88 c8 7b 69 e8 d4 d8 cc a4 8a bf 9f 25 1e fc 00 +17 b9 9e de e5 66 dc dc 0b c5 8d bf 6d 67 bf 86 +3d b8 a8 9a bd f1 2a 77 f1 b7 0d e4 39 d1 76 f2 +ea ad a5 46 4c 79 a5 84 27 0c a5 14 f4 8f 1d ae +86 78 ec f1 ac 29 6d 07 c4 68 98 ba d4 1a cb 19 +9d + +# PKCS#1 v1.5 Signature Example 9.13 + +# ----------------- + +# Message to be signed: +22 51 29 87 15 7c f9 b9 ab 4e 53 37 b0 98 91 d6 +3c ec 37 43 c0 f7 bc 9d 18 2e + +# Signature: +02 c7 75 7f 99 93 ef 8c 6d 60 a3 f5 ab ed ce a5 +35 df f5 5a b9 f4 f6 2d 12 54 bf 26 1d d6 a2 ee +52 da 63 49 f4 7b 9b 28 9f 1d 0e a3 e0 ff 08 f4 +55 fa 54 85 65 8e 42 17 f4 40 c0 8b 90 ae 4c 6c +c2 56 97 cb 83 35 31 db b4 74 03 25 43 10 0b 5f +92 b6 78 19 5d db fb 1b 59 c5 9b e7 c8 3d d8 17 +45 cd 4e 70 9a 0e 3f 79 8e ad 5b f8 66 2d a6 5c +10 57 cc 08 2d 90 50 50 c4 65 95 8b 55 5d 77 b8 +b1 + +# PKCS#1 v1.5 Signature Example 9.14 + +# ----------------- + +# Message to be signed: +ae 48 cd 83 f4 a1 f9 4e 17 19 21 96 90 c8 c6 f6 +73 7a bd 15 e0 d0 8e 7f c2 ea 0d 31 5b 45 be c2 +46 e8 45 bf 17 60 c8 6c 3f 82 d8 4b 1e 9d 68 dc +cc 01 d9 a7 d0 7e cc 6b fb ee d8 3d 7a d0 3a 6d +56 6a 89 bc 64 42 1e 7e b4 7e 52 c0 23 86 58 d5 +e4 c5 59 7f 12 5a fc 6c 83 3c 63 cd 6f 97 f9 dd +5c ce 8a 26 38 80 7c e8 a5 83 da 03 2b ec 81 a3 +8c d2 99 a9 c7 8e 82 54 f2 88 51 64 13 52 5f d9 +4a 9e 0a 95 c6 56 d7 3c d5 2a 4d cc 7d d0 94 7f +4a 00 5e ae dc cf d0 3b b1 71 5c 35 1c f0 59 cd +52 2c 7f 53 8c 16 28 e7 2a 05 64 4e 8f ff 50 92 +6f a8 68 2a 67 53 78 6f 2a a2 61 0a bf aa 95 bf +99 af 15 61 71 51 d0 bd 0f c4 6f c3 b2 9c be e1 +e6 63 b9 23 13 6b 5e 19 92 83 9f 0b a5 2e 44 fc +cb d9 f3 20 ed e2 0f 55 a4 23 77 0e 57 3a 9f b2 +b3 6d c8 f1 84 + +# Signature: +00 fb a9 f6 f9 59 b1 70 b0 94 6d cb db 98 dc 8e +84 79 c6 69 ad ba 6c 54 63 6a 2d c7 d7 f7 03 3d +35 04 05 d7 17 f2 d6 3d ae 65 c2 4b 37 db 1d c3 +e9 f6 17 43 af 1c e6 de 24 67 d1 85 ae f0 8d 2b +f8 65 f0 75 ba a6 a2 9c 58 06 61 dc d4 a4 8f 21 +ff 4e 7b 03 9e ef 1e 1e 20 ba 80 cf 20 ea b6 ec +de 60 fa 5d 37 67 a3 0e 6a d4 14 47 13 ca 49 fc +03 80 99 af 53 6c 0d 5f 55 c4 cb 15 33 53 81 be +a0 + +# PKCS#1 v1.5 Signature Example 9.15 + +# ----------------- + +# Message to be signed: +2c 8a 00 7b 60 30 56 d3 31 87 bf 52 ce f6 16 1a +a5 f5 f5 33 7f c3 59 d4 63 44 72 1d 94 5f bc 4d +24 0d 30 62 0b 29 6c 39 77 cf 45 c2 47 eb 2c 36 +39 40 79 98 3f 03 ad 82 39 9c 4b 28 6c 48 16 59 +10 b3 48 b9 5e f3 9c 43 bf be b3 56 6d 1d 1e ea +5a 42 7f 4c b1 68 1f 2a 7c 40 1f 3f 0d 6d 9e e7 +99 3b e5 ec 5d 34 a7 55 41 e9 f8 dc 7c 60 69 a8 +97 7c 9f 93 6e db e4 1a 4e f7 85 a3 ef 7b a0 51 +89 90 09 ed 61 2a 22 8f 90 31 67 a9 34 ee e6 9b +4f 87 36 c2 95 11 c6 bd c6 1e ee 96 08 a9 91 1b +ba 52 83 9b e9 9f 91 d2 ef 85 b8 cf 10 c1 d6 35 +08 08 29 ba 79 91 fe 2e f8 2e 2b ae 27 08 14 06 +e8 9b ab 75 c3 ed 19 e8 7a 4a db 72 ec 26 21 f3 +f2 58 5b 38 cb b3 6b 3c 0d 40 5f fc a7 a6 fb 02 +24 42 07 94 cb d8 d7 83 18 01 c8 81 e1 65 + +# Signature: +04 10 47 e2 42 b6 44 87 41 f2 8a 4c 8b 2d fe ca +cc 0f f6 61 9e 95 6a 6a 6b 10 cd d0 1e ed d2 01 +c8 0e 0f bf 7c 5b ef 52 a7 aa 99 00 a8 59 39 4b +47 e8 3d 08 b5 e1 da 03 a3 35 54 00 0c ce 17 c1 +d8 62 29 a3 a2 03 50 d1 16 43 a7 58 c1 16 b8 fb +f7 26 60 df 4c 86 ef 8c 1f c4 54 4c 3a e1 d1 fc +3c e9 f2 63 f6 2e 80 07 cd 7f f7 ea 8d 50 a0 82 +83 89 ff 43 1f c5 c5 62 81 6d 3d 24 b6 07 21 1d +29 + +# PKCS#1 v1.5 Signature Example 9.16 + +# ----------------- + +# Message to be signed: +7b 15 d1 a7 9c 7a d2 d1 2f 75 da 57 d1 4a 8e b7 +1f dd 4c 4e ff 52 43 74 1a cd e2 3c e6 da d3 08 +c8 1d 5d 58 0f f9 c3 f8 93 ff 12 4f e4 58 b3 18 +84 da f7 fc 44 66 d7 00 dc 49 3f 1c 7a 7d bf 62 +24 1b 17 e7 36 23 fa 17 81 4a b4 d2 c9 24 5b e8 +3b b3 cc 5f 94 44 b1 52 17 b2 44 1f 45 9c 00 b8 +2e 58 68 9a 11 dd 5c 59 fa 39 5d 1a 6f 9b 2c 25 +cc 84 99 92 7a b9 a4 98 28 53 36 52 ce e2 32 32 +97 2d 65 69 ee 56 44 78 66 f1 0e ba d5 4e a3 f0 +61 32 0c 6d 3f ef ce 34 55 2b 62 66 96 7b 05 78 +d6 c4 55 b9 ac 24 66 36 17 12 e7 d0 5b d3 33 2e +c1 30 d4 5c 6a 49 76 16 2c 79 7a d1 36 3f 49 69 +e4 ae 3d ed 6e 36 ea 2c d7 fb 35 66 09 be 03 1a +79 b2 94 + +# Signature: +03 02 52 90 b4 46 2f 9a b7 9f df aa 7b 1d 53 a4 +d1 27 96 c8 5a ac 28 de ac 21 27 c8 25 2c 2a 62 +39 5a 8b 81 9d fc ee bf 68 dd 4d bf c8 7c 1c f3 +d0 17 a5 3a 26 40 92 50 6b b6 fc 95 28 e6 f8 76 +78 73 6c a5 6a 14 a1 aa 26 77 a8 b8 4f 5e 03 fa +2c 0c e4 78 5b 26 ba 92 e7 5f bd c1 6d 8d 4c 7f +b0 bc 39 a8 8e 13 2e 1e 05 ad 00 f1 2f 07 27 06 +34 3f 5e b3 da b5 11 2e 3b be 76 ed 0b bc 7b df +cf + +# PKCS#1 v1.5 Signature Example 9.17 + +# ----------------- + +# Message to be signed: +7a 76 44 00 1f 80 13 c5 0f d7 17 b2 44 65 47 7a +bc 34 ba 9c 1e 53 ad 76 32 64 5a 6e f7 c8 e6 4e +8e cb 7b ca 5b 4f 09 b5 2f 4d d4 8f 8b b3 dd 33 +8c 78 18 2c e8 6e 8b fb 1c 68 a8 76 f7 32 16 63 +06 a8 ea 8c 0d 7c 21 ff 26 fa af 4a b4 55 10 36 +19 50 c7 6f 95 c2 73 0b 9d 3e 4d 6d 85 ea 25 58 +4a c9 67 a0 2b 1e 0a 26 + +# Signature: +03 b2 ac cf ef f0 63 bd 17 5e f8 ae 0c b8 5b db +80 0d dc 27 77 6f 8d 3d c7 e2 1d 19 9b b8 d6 5f +5b 24 2e 79 d4 5e cd cf f0 2e 80 3f 56 81 ff 04 +4a 43 b5 5a 9a ac b1 ea f1 67 84 83 8b 1d 5a 2b +7c 1a 36 4d c4 05 31 1a 65 55 05 7e c7 3f 0a 8f +4e 0f fc a4 23 02 2c a6 ad 74 46 9b bd 55 57 bf +a1 cf 4b 95 63 6f 53 45 37 ef f2 fb 16 af 5e 64 +71 82 4a fe 21 67 91 8c 89 ad e0 1d 52 ae a7 39 +9d + +# PKCS#1 v1.5 Signature Example 9.18 + +# ----------------- + +# Message to be signed: +12 d2 24 fc 10 a0 fc 40 95 3a b6 d7 01 c4 16 c3 +a8 23 77 2b ea fa + +# Signature: +03 2c b5 c8 d6 12 90 b7 66 e6 49 8a a6 01 49 4d +9f 06 6f 27 a4 7a 28 70 f3 67 89 43 29 1a b2 2d +3c 45 c0 76 e5 60 81 9d 33 f8 89 f8 cf ab 2d f6 +c6 3c 0c e1 ed 5c eb 51 54 70 77 c0 82 78 18 7a +82 72 fe c7 de 95 54 cd c9 16 ca 72 f2 c4 51 43 +f2 cf 32 43 c4 bd 20 0c 6e 99 3f 0d b5 b7 1d 4f +63 77 1e 24 9b 19 b9 97 a6 e5 a9 19 ca 10 0c 90 +fe a6 a2 d4 dc 68 81 c3 a0 e1 c1 35 53 83 cf bb +4b + +# PKCS#1 v1.5 Signature Example 9.19 + +# ----------------- + +# Message to be signed: +e0 d4 e2 a5 e9 8a 51 23 7d a5 08 5d cf 09 8a e2 +c0 5b 4e 16 92 54 ee 6d da 16 21 0e 4a 3f e8 1c +72 56 ea ef f2 8c 0c 63 d8 54 b7 84 1a 13 6c 43 +60 b2 15 dc a0 58 74 8a 4b fa 82 58 68 04 28 21 +99 2a 4e d5 a7 d5 8f 80 12 20 75 49 be 8c c9 ce +cc 85 01 b9 f8 02 83 0f 86 58 45 ce 2e 33 9b ec +28 05 96 11 a1 a0 0b 55 35 c3 c6 15 e9 d2 a1 39 +59 f1 01 5c 8b ad 2d 75 3a 59 a6 14 3b 3a 30 58 +ef 72 25 60 ff e1 c1 84 87 c7 41 da d6 1f 07 a1 +56 42 e7 26 ad 18 a9 84 87 5e 68 c6 2e eb ed cf +94 6f 13 b8 93 b2 80 8f 78 f9 29 48 07 d7 74 68 +54 94 e6 b8 90 40 ee e6 de 1b a7 18 ba 2e 08 2c +3d 5e f1 7c 10 28 cd 66 + +# Signature: +03 e7 83 bb 53 db b6 7c f2 19 5f c1 a5 7f 4b 74 +c9 82 03 b1 f3 d6 15 fe b9 20 e4 ab e8 37 58 34 +67 2f 4b 8f 55 fe f2 ac a8 b5 d4 0a ef e4 ef bd +aa c3 e8 21 08 d0 7f 2f 1c f8 c0 d4 df f8 1b 39 +66 ec 69 be 51 17 ac 1a a6 11 8e 46 0b 92 d8 8f +cd d9 4d 08 eb aa 53 62 e5 9d 52 00 4b 43 36 95 +14 37 da 0f 51 d6 3e 50 56 15 b4 b7 55 54 08 0b +94 89 7f ef 29 3a 34 c4 04 00 c4 f9 9a a1 de fe +35 + +# PKCS#1 v1.5 Signature Example 9.20 + +# ----------------- + +# Message to be signed: +64 b3 ba 40 98 03 c9 b9 60 c1 c4 96 2f 51 27 1b +c8 9a 40 bd 40 5c e5 bc dc 88 51 d9 7c 9b e5 e5 +b7 46 4e 50 d9 9b 6c f8 ad f8 ff 83 2b 73 7d e8 +b6 ff 1a be b8 9d ba e9 3a 90 63 94 87 80 6b 05 +96 cd 31 68 60 f6 8f 00 27 a3 50 3e 15 89 67 af +df f4 69 07 68 17 fc 7d a3 22 3c ca 1e 6c 48 97 +3b 57 0e 0b f7 4b b8 b3 96 54 37 2b 7a 1d 6f + +# Signature: +00 d2 00 eb a0 b6 52 2a fb 42 0e bf 16 48 8c 53 +03 52 c4 2d de 81 e7 64 c0 ca db 43 82 8c b9 98 +d0 a6 0b 23 b5 b6 95 8a 00 fc 25 53 e2 35 e8 57 +4e 4d 4f ec 9e 66 8d ba 40 de 66 61 ab e1 3f cb +84 c1 ad 15 c4 b0 cc 0c 6f 4f 0f 83 77 87 c4 32 +5f 04 5d 61 ee 2c 99 72 b0 1f 32 12 65 4e c4 26 +62 56 7f aa c4 0e 9c 0a 28 15 8a 2a 6c 31 f0 1a +84 91 26 df 9e 96 cb 82 09 be b5 81 d6 84 6b b5 +ab + +# ============================================= + +# Example 10: A 1028-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +0d 5f b9 9f de df 42 56 e2 8d 4b 41 d7 07 fc 27 +63 3e 89 95 15 f4 da bf 6b 46 27 10 ac 11 25 81 +fa 73 fa 83 69 58 2c 9f d4 52 5a 70 16 18 99 df +63 25 84 9e 5c 43 49 3e 13 35 4e 27 09 55 a4 3e +38 35 b5 99 8e d4 2a 57 5b bf 68 8d 69 ec 36 6d +2b a6 f0 50 4c 1e e1 7d c5 9b 7e a0 b4 64 0c be +cd 8b d7 96 2b e8 56 6f 0e bd 65 57 43 65 6a 29 +12 85 e0 37 bb fa 86 55 80 1b d0 31 4f 46 4c 56 +91 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +0d 5f b9 9f de df 42 56 e2 8d 4b 41 d7 07 fc 27 +63 3e 89 95 15 f4 da bf 6b 46 27 10 ac 11 25 81 +fa 73 fa 83 69 58 2c 9f d4 52 5a 70 16 18 99 df +63 25 84 9e 5c 43 49 3e 13 35 4e 27 09 55 a4 3e +38 35 b5 99 8e d4 2a 57 5b bf 68 8d 69 ec 36 6d +2b a6 f0 50 4c 1e e1 7d c5 9b 7e a0 b4 64 0c be +cd 8b d7 96 2b e8 56 6f 0e bd 65 57 43 65 6a 29 +12 85 e0 37 bb fa 86 55 80 1b d0 31 4f 46 4c 56 +91 + +# Public exponent: +01 00 01 + +# Exponent: +e7 6f 42 b4 74 02 d5 e0 f9 64 64 92 5a b4 b3 bc +68 94 30 0e e4 86 fb 70 ce d4 91 f2 d1 b3 67 80 +84 c1 c2 cb 96 95 68 a5 f7 7d ab cd 40 93 39 37 +a8 67 f9 34 fb 2a ea ae 6d 78 67 98 e0 d0 4a 10 +6f 54 5e 41 a9 c9 38 33 d8 1f d4 d7 53 53 17 9c +b0 bc a4 5e 79 aa c9 41 34 64 b0 36 7f 31 ac 5a +ca 56 6f 22 14 bf 51 46 a9 48 4b 87 e4 2b da c2 +b0 1a 99 67 03 50 6b e0 77 49 aa 0f be b3 b2 29 + +# Prime 1: +03 ff af 4a 61 21 d7 42 0c fd a6 4c 41 71 2f 47 +c8 f2 d0 d2 5b 17 e9 5b 35 41 42 84 69 10 af ef +bd f2 1e 74 23 e8 b3 be 44 ae d9 af 5e 49 81 68 +5d 3b 9a 1d 59 c9 b9 47 fb 9c 33 9c 9a 31 e5 7b +d9 + +# Prime 2: +03 58 31 e3 b9 29 3b cd a4 51 be 9d b1 91 97 48 +6a a2 e2 2e 92 98 65 0f 2b 7f f4 25 69 eb ec 33 +d2 0a 34 98 44 a3 3b ea a0 93 d1 43 4a fb 4a 04 +a0 4a ed d3 bb c4 b3 87 77 a5 5f e6 50 5b 8c 15 +79 + +# Prime exponent 1: +02 8e 91 d5 ab ba 69 dc 50 56 38 e9 f5 c6 9c 06 +f8 d5 5a f5 c7 4d c8 e7 8b 6c 09 4e 85 a8 27 f7 +d2 ab 69 11 b6 8c 6b b2 b4 54 61 d9 a3 1e b9 62 +b4 8b 12 06 c6 8d 18 ae 90 92 d6 e5 c2 2b 39 a4 +31 + +# Prime exponent 2: +02 98 04 e1 32 fa 3a aa 4b 15 26 bb 50 3a b4 d4 +71 f7 6f 69 65 42 11 a6 89 3b 0c 13 74 29 87 9f +cc f7 23 41 30 82 54 76 ac 20 d7 fb d3 8c 3e 24 +86 58 76 48 6e e8 a7 bf 99 58 45 9e ee 95 81 78 +29 + +# Coefficient: +02 11 97 5e 88 56 d4 ea 9d 1d df 87 b8 7d 39 79 +2f 1c f7 e2 f1 82 f4 a4 e6 91 e5 00 2b 10 a0 8a +46 dc a1 a4 f4 83 00 85 d8 d4 0b ea 1d ff 11 b0 +c0 df 20 22 43 eb 99 3e 58 0a 94 49 9b 9c ed d2 +be + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 10.1 + +# ----------------- + +# Message to be signed: +b2 d5 88 50 9c 2e ac da 28 1e 76 71 cb a2 fc a9 +14 ef 73 a3 ae a9 20 20 43 ea d6 b7 21 25 c1 b0 +d5 cc 15 41 46 20 d5 73 d7 ab 0b 3a 8a b6 6a 92 +df 87 0b 75 b1 c4 d6 8e a7 05 6b e0 41 9e a2 53 +e6 b0 8b 12 9e 0f 64 f1 0a bf 82 e1 67 f8 e3 e9 +28 2e 7b f7 1b 04 3b aa 2b a2 d8 75 6d 46 b6 d3 +6e 97 34 15 f4 f8 c0 eb 43 fc 60 4c ed 49 3d c0 +46 a2 5a 11 9b d1 58 1d bb 59 7c 3e 67 c2 fd dc +39 6d f5 d2 3b 7b a8 0b d2 e3 12 90 bf c2 62 25 +e0 09 55 a9 8d 91 19 11 a3 99 67 6f bb + +# Signature: +07 9a 7b 91 6f 67 41 17 f1 d8 77 f4 93 43 25 68 +41 48 d5 d0 b0 d5 c2 c6 15 6a 11 15 9b c0 bd 30 +d0 a7 35 34 dc 94 45 eb e2 06 d6 07 5e b4 ea 7a +7c 04 32 bd 44 b8 3c fa e4 68 5a 9e b9 a9 7c bb +fa 4e 82 f7 1d b5 1a fa 0d 27 cf 27 f0 60 9b b3 +f8 80 64 13 24 7d 5d 49 54 f7 89 a1 01 bf 39 21 +72 8b 48 7e 85 fa 3f d4 dc d7 2d 04 44 8e 42 d3 +ec 05 cc 47 5d 74 cb f7 65 c3 4e 3e c1 4c ca 50 +40 + +# PKCS#1 v1.5 Signature Example 10.2 + +# ----------------- + +# Message to be signed: +ca 25 18 a5 a2 24 b2 3d 42 05 d8 dd 7e b0 4c bd +cd 0c cb 82 bc 87 96 1d 85 9d 66 00 b1 ac 3e 25 +a9 40 7b 6c 06 50 27 c0 40 81 f4 45 a2 30 ab 93 +08 e7 55 f3 3a 75 97 73 be 6b 96 9e 0e a7 74 aa +6e 33 4f b6 04 18 42 75 f3 6a 03 1d ae a6 51 86 +97 79 5b d6 a7 d6 69 7b 40 6d a2 ce ce 15 dc 11 +3d 85 44 98 85 61 13 1d 4f c6 f6 e3 c5 80 d8 06 +80 7d f2 c6 85 65 09 54 2e 4e d3 9d 34 6e ba 15 +97 6a 8f d0 1d 79 41 b0 16 56 06 c7 61 76 64 9a +16 10 05 a0 + +# Signature: +00 be b9 21 ce 74 89 81 9d 2f 85 c7 88 39 a2 7d +7e 19 ea 0a 76 4a c5 31 01 e8 6f 31 70 a7 6e 31 +8a 7e e8 9b 1f 5e 23 e7 e2 db 96 66 eb 43 91 b2 +79 2a 57 67 ee 35 9b 5c 71 e2 74 79 10 c8 2c 60 +83 d6 d3 48 29 b9 6f a5 a2 ec 0f 62 f1 bc da 5d +78 f8 dc 3c 65 0b 94 e3 2b 38 60 da 5f c5 b1 7f +bf 68 7e c0 07 5a 9c 73 dc 1e 98 d1 f3 6a ae c4 +49 3f 78 91 e3 ab 08 e2 04 2d 8b 1e 46 2e 8c 4c +33 + +# PKCS#1 v1.5 Signature Example 10.3 + +# ----------------- + +# Message to be signed: +d4 33 d1 5b 2d 61 b8 6a c8 ec 0d ae ba 65 e1 1d +ed 3c 38 84 25 25 e4 b7 c8 e4 53 b0 f5 53 cb 4e +b8 75 a6 9d 78 16 f5 4c 87 79 3e 3a bb 79 fc 55 +11 35 37 b4 76 29 65 cf ee 58 6e 0a 17 99 78 51 +e3 dc 9e af 6f 1c 9c 2e 98 c9 61 3e 3b be a0 13 +ff 58 61 6b 2a b0 5a b3 24 a9 c5 ff 4c 5e fd d9 +90 dd 97 d9 16 93 c1 eb d4 c0 9c 73 21 16 c8 df +c3 ec 51 5c 20 53 2c ba 7e 47 58 c6 8a 69 cf a0 +ac 31 86 + +# Signature: +03 ae 3b e1 c7 44 6a d3 ef d8 ba e6 1b 3d 32 d3 +ef 15 24 82 b1 bf ee 31 2f e9 e6 be ee ab 8c bd +08 f4 c8 f9 cf 06 7d ea b6 ba c7 c0 fe cd 87 bb +ab c7 f6 79 8c 77 ef 1c 3f d8 bc a2 8c f9 ec e6 +56 79 5f 60 b3 78 75 ea be f8 21 53 a1 2b c7 fd +e3 fb c9 e5 e1 48 f4 e1 6c b7 2a 77 3d 9d d0 23 +17 f7 0b 33 91 40 08 05 e8 5e 7a 23 56 7b 34 aa +65 a3 5f 74 41 70 af fc b3 23 37 1a d2 ab 9f 1e +4d + +# PKCS#1 v1.5 Signature Example 10.4 + +# ----------------- + +# Message to be signed: +7d 0f 5b d7 90 0f 1e 65 65 4e 6c 7e eb 06 4c b8 +28 f3 55 d6 de 9b f0 d3 47 83 ff cb e8 0a b1 b8 +ae 07 b7 f1 e3 f5 a3 20 dd 9b 8b 76 be 0e 97 72 +de 19 a8 d3 + +# Signature: +09 e7 a5 30 41 71 da 63 8b e7 60 1f bf f6 e4 95 +36 f3 36 60 82 25 3a bc 1d b5 d1 b6 54 93 da 59 +5e c9 3c 37 f5 89 0b 5f 47 15 bd 5e 80 c0 bb c5 +c6 3b 74 af 2e 60 43 91 32 d2 52 13 75 0b c1 de +30 2e 3e 8b 83 da d2 de 0d ff c4 fa ab 40 56 dd +7c 40 5e 04 d5 94 24 53 65 9d 49 0f 3c 3d aa 7d +3f 11 70 11 81 6b 56 59 01 04 de 7f 9c 05 23 73 +e2 dd e4 14 49 04 27 a5 89 64 49 3f f4 5f 08 a6 +e8 + +# PKCS#1 v1.5 Signature Example 10.5 + +# ----------------- + +# Message to be signed: +d9 6a a0 91 c1 60 b5 52 b1 6d f0 65 8f a8 + +# Signature: +0b 69 75 4e d6 d7 a7 d2 d8 5b 2c 7a 30 6c 78 d6 +3d 0f fa 43 8f 43 be ec 3a 02 86 ce 57 e7 e0 f8 +5c a4 30 e6 39 08 c0 fa 58 4b a2 50 5f 8c 94 65 +6e c0 24 94 bb 03 2f 92 0c 4b 6b 8c 94 3e 6b e9 +2f 57 8a a8 cc df aa c0 a5 4b 8a 9c 0d f5 48 27 +1f 89 73 c9 ff a2 a2 0c 84 76 2e 90 17 e7 45 2e +5d 74 da 69 0f 75 c0 99 ab 91 e2 a7 96 3b c5 37 +f9 c2 4c cc 3c 41 8c 6e 98 58 61 d9 3d aa b2 e6 +13 + +# PKCS#1 v1.5 Signature Example 10.6 + +# ----------------- + +# Message to be signed: +56 f0 48 64 5a 49 fa 01 41 f4 d6 74 aa fc f2 ff +fa 83 f9 b4 52 f1 fe ed 43 05 7c ac 27 67 5e a1 +a1 41 d8 7f 92 f9 ce bf 6e e4 f7 8f 8e d4 c3 a2 +9d eb 72 97 47 b4 f9 8e 4c 75 90 aa a8 d5 6d bc +61 d3 8c b5 62 22 26 f6 8e 43 f9 c4 f4 c0 39 98 +ae e9 09 34 39 5b c8 40 c8 6d cc 88 74 77 6f 43 +03 9f 56 a8 9d 24 bd c4 b3 05 df 09 e5 ca 0c 05 +12 ad 6d 15 71 91 9a 3d b3 a6 bd 98 b7 82 0a da +08 69 d2 25 a4 04 02 7a cb 6d 76 7f c3 14 db 37 +7e 8d 1d b6 ef 0a f2 94 54 db 2b d4 c1 ce e0 13 +a5 97 43 48 6d 32 32 95 83 cf 80 11 3c da a1 0e +4f 2c ea 6c 4f 9f c6 e4 e2 71 6e de 85 72 7c 3a +fd 43 49 46 09 77 76 30 ee 33 63 7e a3 5c 9b 4f +68 8e 49 2c 3c 64 0d + +# Signature: +06 66 ef 71 e2 c8 a1 eb 1c 46 40 3f d2 3e 52 18 +83 ad a1 b9 bc 5f bd 35 3b bb 3c 3d fb 57 0a c1 +c7 21 fa f3 f5 97 32 f2 13 37 73 80 39 79 48 46 +2f d2 0a 3f 0e 5e 08 91 a6 b0 7c 31 b3 60 aa a9 +65 e2 f0 93 0e b3 41 ee 77 ec 43 90 65 c0 aa d9 +17 87 ab 6d 2e 6c de dd f5 54 81 65 1a eb bf 9d +11 d5 4b c1 13 26 18 3e bf f4 9b d4 0b df 76 d7 +ef 69 b6 7e a3 96 8f a8 49 03 2f b8 24 b6 dd 6a +e3 + +# PKCS#1 v1.5 Signature Example 10.7 + +# ----------------- + +# Message to be signed: +79 da 89 e3 55 d5 51 a0 e0 31 f4 fb 71 ab 6f 41 +44 c4 76 2e 07 d0 64 14 33 cb 5e c8 61 34 96 3f +7d 2c 4d c7 be b5 c6 d4 61 57 c6 c4 e1 4a 4b 9c +7a 2c 0d 46 0f 1f c0 62 ea 1b 4f 98 74 d5 b1 c2 +9a e2 f2 a5 b3 90 62 e4 12 12 e6 5c 85 c2 8e 76 +75 89 96 5d 17 10 ad 5b c7 6f a5 a6 72 9a 06 fd +49 6e 2e 09 97 e5 73 37 bd 51 6e 6b c7 9b e9 e0 +70 aa 7b 86 c2 dd f1 4f 94 98 5f e1 58 2a 29 2c +d1 39 34 b3 c3 8d fe 59 77 ed 1d 9f 8a d3 24 c0 +dc 07 e5 85 3c 7e 48 90 bf bd c1 a0 1e cd 72 c5 +ff 68 a0 2f 1e + +# Signature: +0a 06 82 f7 42 e7 43 e1 c7 da ba ac 61 8a 78 6f +28 ed 13 a6 58 7a df c3 3c 98 29 d7 52 c1 3e f2 +7a 00 c7 e6 d4 5e 27 17 1a 58 41 77 1d 78 69 8c +6c c6 67 78 b8 c0 93 38 e3 5b 9b 6f 59 c0 64 ce +b3 eb 20 ce 90 9a 5c 6c ea ae bb e9 3e 86 c7 c5 +ff 4a 39 17 f1 26 81 96 32 cf 96 fa b1 d3 91 73 +a7 ae 7f c2 ff 5c 0f b4 09 05 35 da db 58 d8 7d +0d a3 db 32 ec ec 13 71 8b 3a c5 c3 0b a8 02 e3 +8b + +# PKCS#1 v1.5 Signature Example 10.8 + +# ----------------- + +# Message to be signed: +e6 9a c9 43 3e 6c 28 ac 53 f8 03 4a 86 8d a9 88 +3e 31 9e 82 e6 bc 2e 49 45 5e 6e 4f 09 8b 53 f2 +87 a8 58 da 1d 87 6a 9a 5a 6a 9f c1 4f d2 42 38 +cd 4e 4b 57 31 07 7a 4d bd d5 03 8a 9b c1 f5 de +f4 3f ec 77 f6 7e b0 62 fa ef ef 7d 04 29 23 8b +25 d0 31 85 78 96 62 3a 3f 1d 37 bf + +# Signature: +08 a0 20 e4 20 98 78 f1 e6 37 ad 59 da af 83 5d +af 4c a6 64 84 47 94 c1 c6 48 f0 e2 23 3d ba 75 +48 bd 16 1f 0c 0a 18 24 d7 62 03 1a 41 75 72 84 +2f 8e 64 4a a9 3f 9d 91 dd 77 09 e1 6a 42 9c c1 +43 90 3e f4 f8 37 a4 58 39 6b ca c2 40 92 b0 17 +24 c6 fe 3d d1 ad 24 3f 3f 70 b5 ae 6f aa 09 f3 +70 ca a5 12 10 4b 91 76 06 0d f2 bf 12 1c bc e9 +19 8e c2 fe 45 a5 9e bd dc 46 75 32 b5 af b9 b2 +35 + +# PKCS#1 v1.5 Signature Example 10.9 + +# ----------------- + +# Message to be signed: +45 e0 90 56 a2 8e 4b 2e 7c 11 f6 5e 68 8a 1e 3c +33 f0 e5 2c 9a 03 6c 09 d8 1d e5 a6 da b5 8d 4d +55 cf 41 1b 53 ad 64 6e 83 a3 4b 0c 08 c2 21 ae +03 76 ab 76 a7 9d 1f ee 67 1a 58 44 20 56 4f 8e +85 2e b6 f2 d4 27 ae e0 a0 96 dd 72 db e8 50 7c +67 7f 8a a0 0e b7 c2 5d fb 0a 49 dd 88 a6 c7 84 +76 b8 00 11 b6 82 8b 3a af 46 47 79 44 22 ba 6b +d6 3b 7a b0 e7 da fb d3 6f 6c 41 de a0 3d 73 22 +35 64 96 94 60 d9 28 54 0b 73 92 57 e7 0b b6 8d +5c 65 3c 37 96 94 58 95 + +# Signature: +08 71 7d 50 86 a6 45 3b de ff 77 d4 c2 b8 56 e3 +ba 99 0b ab f6 97 01 df 6c a0 a3 b3 a8 1b 55 69 +7d 31 88 9d 10 0d 68 95 c9 7f 0a 56 b4 71 68 c9 +8d a6 2e 59 ec 79 d7 ae ab 2f 9a 57 07 46 98 8a +26 f4 23 57 6c 70 3f d8 41 ae 51 c9 c2 29 a2 e9 +c2 5f e9 4c 5b 6c e2 fa 64 54 12 be e6 59 fa f6 +09 a3 2e b2 c0 5b ee ab aa 4f 58 ca ac 31 33 e5 +ea aa 27 34 4d 30 ee ca 22 c6 eb d8 d9 e3 44 41 +0e + +# PKCS#1 v1.5 Signature Example 10.10 + +# ----------------- + +# Message to be signed: +b8 1c 8b c4 ac 1f d9 71 b2 1f 02 7e 06 f4 d8 7b +34 d5 76 9d 23 c8 59 9d 1f 15 7b 08 a7 f9 2e 34 +19 fe c4 c8 c1 b3 4c a4 63 c7 68 b7 2e 07 f9 da +bc 3c bb dd 8b 56 17 cc 25 28 75 00 2a 1a 13 92 +af 0f af c0 8c 72 11 75 8f 3c 04 20 50 ad 73 1b +63 6c 0e 83 19 1a 79 de 5a a2 cb 94 dc 8b 0b dd +e7 5d b7 d0 c8 ba fb 42 23 d3 47 b0 24 b3 d9 c6 +b2 39 61 9b 5d 8b 63 46 ea 86 fb 8f 24 c5 84 dc +1a 47 79 1c b7 c8 c7 eb f1 ed 43 8b 88 + +# Signature: +01 b9 f4 33 94 c7 cb 88 5b fd cc 3c 84 96 22 23 +e8 aa a9 4c 6c 9b 79 05 40 1d 24 f0 dc 44 3b 2e +8d 84 0e 28 a9 5f a2 2e 1a e3 6f fe 08 96 6f 38 +d3 87 14 cf 68 da 8d b2 37 64 b8 8c 4b b2 be 4f +d3 da 9c cd 1b 50 69 42 aa 9d 73 fc 09 38 2d c3 +30 83 14 70 6e 6c e2 7f 00 76 1f 3c 9b d5 4f a0 +e3 1c 96 71 9a fb f0 76 3e 35 ca d8 89 b7 2e 13 +bd 12 b7 6d 6f 20 20 fa f6 1d d3 d7 08 22 8d f0 +6d + +# PKCS#1 v1.5 Signature Example 10.11 + +# ----------------- + +# Message to be signed: +d0 32 28 83 e5 98 16 3d 72 20 36 da 3e 63 2a a6 +55 97 ac bc d1 f4 76 03 10 96 96 f9 b3 9f dc + +# Signature: +07 8d 17 ab 8e 6f f0 be 50 b3 53 9e b0 3a e8 f0 +90 3b 7a 07 74 81 78 1f b0 b1 f0 9e dc f7 78 86 +31 2a d6 c0 60 27 4f 0c 38 9c 16 31 40 40 c8 d7 +d9 90 9c b7 5d f1 8c 82 d6 2d d3 4e b5 9c 6a 87 +d3 c4 6a 7e f7 47 4a 5e 44 7f 77 44 a6 a9 2f 59 +90 ea ec 7b fb 00 84 4d 68 4d 30 7d db 49 81 89 +41 49 e7 52 bf be 2e 77 05 7d a7 60 54 69 af 7f +fb 67 27 a9 98 1b 94 39 ca a5 d8 0e 6a e3 b3 d6 +51 + +# PKCS#1 v1.5 Signature Example 10.12 + +# ----------------- + +# Message to be signed: +e8 74 2f 04 b5 65 4d 92 88 b2 31 a4 7a 36 58 39 +bb 01 be 87 + +# Signature: +09 b7 53 06 a7 21 2e a6 f4 7e b0 cc f4 e2 e0 d6 +f8 f3 ab db 9c dc fa ad be 51 92 2f 92 ea 62 62 +3c 58 ea 74 ea 1a 24 7c 9d 73 1f 2c 03 35 36 b3 +52 73 c7 17 49 5f 32 5a 60 40 5b d5 f5 e4 05 b6 +80 27 9e 75 21 60 47 87 40 45 72 16 dc 92 9d dd +65 de a5 05 53 55 46 e4 77 0f 82 11 b8 49 c3 65 +21 8e 56 6e 5b b4 1b fc 36 1b 65 cd cc b0 e6 04 +c9 ed b9 70 ee 6a 28 6a 1f ce c0 ae 9d 92 55 8e +ab + +# PKCS#1 v1.5 Signature Example 10.13 + +# ----------------- + +# Message to be signed: +a0 3c 2b 85 fd e4 64 68 d1 c5 06 37 b0 0a 72 dc +fc 32 c4 16 31 73 9c 06 02 45 f5 3e 57 c6 6c 51 +76 6f 24 ea fd 93 e6 c6 67 43 48 05 91 bf 14 44 +6e 04 0b 67 a4 f8 46 99 57 6c 2e 14 63 ca cc bc +b0 73 e4 b7 ec 6d a6 c8 cb 41 d4 a1 23 c7 48 cd +7e 83 d2 61 e5 4c 2f d2 bc 49 5b c4 c4 4a 78 f9 +82 00 34 03 09 2e c6 96 0c 08 8e 2b cd e3 48 a2 +e0 e5 5a 4b 4f 42 ea b2 29 b9 5c 38 3f 21 13 ed +6c d1 f3 f3 16 7d e3 d2 8d 36 2c 8d 78 b2 eb 6e +31 62 0e 34 b2 f0 f9 41 da cd f7 b4 b8 56 8c 6a +86 3a 55 1d 7b d4 a5 d7 09 3e da 69 e1 e2 80 56 +dc b1 eb 69 ae 03 ad 74 be 72 a7 5a e8 fb 56 a2 +71 25 ca 3d 2d b3 76 9d 13 d3 5d b1 08 e2 64 4a +7f 3b 37 93 8f ec 97 62 31 52 06 d3 0c cf d5 76 +ae 7d e0 76 98 69 e5 04 4d 07 64 6c f7 8c 64 a4 +86 48 0b 0f d4 2c c7 b2 46 + +# Signature: +05 8d a5 49 4c 4e 98 aa 12 1f 67 f6 5a 2c 86 54 +25 a9 e6 00 2b 22 3f 03 88 80 97 53 57 3b 4f 33 +4d e4 5d 8f 00 07 25 5d 11 2d dc 84 db 26 67 00 +e4 40 b5 a8 69 00 c3 d3 d3 5b 02 4c 18 d8 a2 5a +58 00 22 6d 0a 56 d8 38 d8 91 9e 6d 5a 87 30 d6 +19 49 90 15 ec 46 65 c6 3d 77 80 83 a0 42 dd 4f +05 2a 1b bb 5f 40 80 cb bb 41 fa 94 5b ad 6a 74 +77 9f 68 07 25 e4 7a 08 a0 51 4f 35 0f a5 ad f9 +0a + +# PKCS#1 v1.5 Signature Example 10.14 + +# ----------------- + +# Message to be signed: +c4 0c 70 f2 6d a5 69 48 6b ac e7 85 da 32 e3 37 +a0 eb 94 fb 3a 0a a4 09 c5 77 01 75 c8 e8 cb 2b +aa 8d 2a 1b 98 46 c3 7d f7 d6 71 03 6d 5e 91 + +# Signature: +05 25 61 28 af ba 1f 55 d8 1f 79 ea 33 87 91 47 +a2 4a d7 77 93 46 ee 79 8b 21 1c 24 71 53 ea 38 +d2 6b 21 70 65 f6 1e 01 10 b5 3d 72 cb 64 93 4d +9b 1a d1 b3 de c3 32 09 2d 25 8f 0c af 1c 4a ee +8b 23 e0 9b ab 0f 0c 27 88 58 b4 41 d0 8c a3 ae +9f 00 aa 9a 3f 01 8f 7d 9f a9 8a 18 df 0d 24 84 +7e 56 7a 47 f5 77 9b d1 79 3a 4b 02 52 f2 ba d4 +0c 9c 4a 81 30 1c c2 8c 26 09 d7 bb 33 37 e9 7f +14 + +# PKCS#1 v1.5 Signature Example 10.15 + +# ----------------- + +# Message to be signed: +9e 6d cb 11 e0 e8 47 71 39 fa f0 41 a7 4e 2b ed +64 3a 62 ad ed ac 7c be f3 65 ec c4 3a e4 e5 82 +60 bc 72 46 23 bd 63 42 dc 66 0d 66 14 2e a6 36 +80 71 5f 52 2f f3 cd 4b 63 6f 84 aa 9d 75 fb fb +c3 84 10 7e 43 00 4d 98 6f bc e1 a2 7f 7e cc 7d +02 39 2c + +# Signature: +0c cf 23 4e b4 80 08 5d 92 0d 37 d6 87 96 5d 2f +d2 e4 a4 f3 bd 3b f7 dd c1 6b 5d 62 a6 90 32 74 +20 7c 6f 90 83 6e 29 ff c6 3a 57 f9 81 30 c5 25 +23 25 19 c7 08 f0 dc 8a 12 55 ab 55 db 1a 2b 9a +bc 11 06 16 02 07 5f f6 f9 7f 90 92 79 6b 98 87 +1a 6c d5 d2 61 7d dc 9d 25 5a 73 00 c9 10 fd 21 +0b 14 a9 81 e5 a0 e0 c6 bb 2b 04 5f a9 75 68 98 +b9 3b 8a 63 45 44 d7 7a fd b1 cf 0e 79 58 f1 1a +43 + +# PKCS#1 v1.5 Signature Example 10.16 + +# ----------------- + +# Message to be signed: +20 bc 46 3b 5e 12 20 a3 9c 84 e8 9f e6 71 6e ec +ab 55 55 f8 bf ce 60 cf b8 37 93 cc 40 a4 da 1d +22 c0 ab 4e aa 93 1f b7 47 be 35 f1 cf 6f b1 46 +5b ef 1d f2 76 0f cb 3f 70 d3 e2 96 e7 b2 70 45 +0d ff e2 d5 88 c4 39 6a 5f 6f 1e 63 87 aa 86 97 +1f b0 ad 24 df 55 04 43 dd 12 2b db 2c f3 c9 ed +61 25 fe 55 ce c9 91 cb ae 8e e1 56 2a 8c 0f 4f +36 4f 8f 0a 80 cb 30 fd 99 44 0b f6 55 f0 80 4f +92 96 8c a2 e0 1c 0d 5a bb 4e e2 67 63 6d d4 f5 +11 a8 d3 29 41 16 21 6b ed c1 08 86 45 e4 65 d8 +e1 98 b8 af e1 cd 54 24 b4 2a 53 3c ed 19 8a d5 +97 + +# Signature: +05 1b 71 42 66 06 6b bb 81 9a 2a 38 05 a8 9c ff +46 18 75 c0 95 f4 f3 89 82 d1 af c2 ad 2f 14 24 +50 b8 a7 52 94 7f 03 1c ce 2c 9c 34 0c 8a c9 f9 +f7 a5 48 b7 cc 17 e4 cc 52 56 96 ea 0c 87 53 a1 +e1 5b cb 98 5d ea ec 77 6f b9 e7 d9 f7 58 62 f8 +98 35 23 d9 f8 71 c6 3f b7 56 1a c7 1c 37 6b f4 +95 d4 32 38 59 bd 14 18 8f cd fb 4b 37 ab cb 5d +c1 a5 8e ed ea 7e 0f e6 2a c1 6e 20 8a ab 4c ee +26 + +# PKCS#1 v1.5 Signature Example 10.17 + +# ----------------- + +# Message to be signed: +92 da 26 0b c2 13 b7 2b 48 a0 57 53 50 3d 00 a1 +db fd 02 ac 7b 9f d4 4d 24 01 ea 7a d5 8a d1 86 +1f da 53 63 29 ae 41 73 c9 16 80 05 b9 66 2c 05 +cb ea 47 ad 86 4a f7 cb 16 60 2d 3d 18 34 71 bc +98 bc c6 2c 6d 00 d3 34 bf f5 b9 0c fe 7d 7e 12 +d0 7f e7 d4 cb d9 dc d3 c4 c2 34 90 be 8c ba dc +08 c9 17 79 80 37 3c 79 eb 4e ea 6d 81 a6 be e2 +27 0b f4 20 f9 19 79 ad 3f 27 1f d6 8d d4 28 3b +e8 14 10 92 8c a4 5b 9d eb 58 d3 ae 98 b2 f4 fc +a6 21 25 95 0b 5e e1 28 db a1 05 c3 5c c3 98 d1 +5e 74 2b ba 92 69 7b 5c 62 b2 67 ce 01 14 1c ec +ef 80 75 07 de 29 c4 85 30 5d 0a 99 09 43 23 0d +8d 9b 72 52 ee 0b 19 56 de 84 5f 2f bb 28 38 78 +5b 47 0a 7c 20 53 db 39 6b 31 5a 30 d8 a7 f9 1c +ff fd 03 e8 a3 9b a8 bc + +# Signature: +03 e2 3f 86 52 37 4d 48 d3 81 c3 78 35 3e b4 7d +90 64 cd 70 8e 1b 9b f6 88 70 4c 04 c0 09 00 88 +46 e6 a4 7e 0b d2 e3 0c 33 40 f5 d4 e1 9d 2d c5 +d8 89 0c 8f 01 04 dd 6f 5d d6 ca d9 c4 d9 94 84 +09 c3 cc 0b e6 70 71 9d d0 48 41 80 89 1c 93 5b +99 79 db 8e b4 68 a2 3e 4e f4 60 29 f3 af 14 57 +4b d1 0b 47 3e dd 9b 12 7a 30 6e 51 24 ad a4 02 +c1 48 f5 1b 52 e7 e6 28 bf ac ec 3f c2 54 3a 0f +92 + +# PKCS#1 v1.5 Signature Example 10.18 + +# ----------------- + +# Message to be signed: +86 03 a5 62 2a 2d bb bc bb e5 33 30 e9 08 d5 a2 +5f 6e 67 a5 1e 07 68 d7 c3 c3 fb e8 b9 2e 8b 1b +36 dc 00 74 3c e3 3d a0 f1 c8 cf b0 0d 63 ed d6 +b2 25 2f b6 72 13 97 d2 50 4b 30 ed 1d 29 3a 82 +e2 44 c9 51 bb fc 24 29 8a 42 ff ee 26 e4 56 a7 +be 10 5c b5 e3 7b 3d 25 de 28 bf c0 10 42 c4 a8 +2c e8 70 45 54 87 e5 b3 0e 26 f8 d5 39 8c 86 12 +6e + +# Signature: +08 22 fc 22 a9 cd 87 7c 09 b6 f9 2e 80 17 cc c0 +28 d5 37 99 67 c7 d0 4e f3 2f 86 9c 7e f6 7d 59 +3c 77 45 f6 29 d9 3d f2 60 03 8c d3 33 ea ee 92 +35 9f db bf 84 62 3b 7b 55 14 23 5b 83 06 27 2f +4e fd 13 a6 70 0b e9 28 9a d5 4e 57 d5 2d 1f eb +b4 6a 37 af d6 95 94 2c 4c bc fd 37 68 f2 82 1e +88 8e fa 0e 2c 5f d3 c9 c4 2c c3 55 50 d7 95 5c +db d3 5c 8e f8 58 1b 41 f8 dd ab 26 18 26 2e 3d +ff + +# PKCS#1 v1.5 Signature Example 10.19 + +# ----------------- + +# Message to be signed: +06 7d 4b ec b0 3e 1e b2 75 ae 22 50 7a 77 a5 39 +6e 71 9b 5f 00 b1 05 95 0b c7 99 8e 08 03 da 57 +a4 de 08 a4 07 8b 9a 00 d2 d4 6f + +# Signature: +09 10 8d 44 57 5f 61 4a 68 3e e4 d7 8b ce 1c 58 +f5 24 36 87 cb e9 c5 48 34 60 b6 5d f2 36 92 7d +bc 78 c0 64 39 ce 1c 7c 51 97 39 c8 f8 95 00 82 +d9 56 d6 0f c3 64 5b a7 af 8e 78 89 54 70 63 1b +b4 da 00 c0 1b 98 2c c1 1c 68 d2 65 0c 7c ae a4 +a2 6e 21 0f f4 b1 ca e1 db 50 5f ce a9 29 34 87 +b2 07 31 78 ca 24 5c f0 ca 23 56 ba f8 65 54 6b +54 af 95 35 ba b1 8d b6 79 ef 56 27 09 29 79 c0 +a8 + +# PKCS#1 v1.5 Signature Example 10.20 + +# ----------------- + +# Message to be signed: +88 4f c5 02 c8 82 48 49 47 8b 2e ac 1e 7e bb b7 +ca f2 8e eb 48 89 45 86 02 ec 70 35 81 d0 5e f9 +b1 a4 22 0b d2 f9 22 f2 5e 46 4c 88 07 01 c8 a4 +5b 1d 1f ab c8 66 2e b2 49 40 04 26 c2 22 62 38 +eb 8a d0 f9 06 9c 90 f0 01 82 77 44 80 25 a6 41 +80 ed 55 d1 af d2 7a ff 4f 00 70 2f 71 5d 29 10 +00 0d f3 92 5c 70 10 ff 11 7f 6d 8d 2a 81 67 09 +48 9e fd 29 a4 5c 59 23 17 7b f9 2c d0 bf 6b 94 +74 5d 34 8a 14 4e 98 74 0f 72 22 6a 3e 2a 9d 41 +7b 7c 1f d8 f8 95 f5 15 c5 c6 d4 06 a7 2b dc cd +39 15 2c 30 fd bd da 0e 62 82 3e e9 df ab 34 32 +e6 64 2e ec b6 98 7b 90 46 e0 40 a4 78 a4 df 64 +8d ef b3 01 6a a4 43 d0 67 a1 fa 41 55 55 53 74 +f8 ba 32 5a 8b 55 e4 d6 b5 fa 09 0e eb ae c9 c9 +2e 26 1c c0 4c ea a4 8b 3b ed 7b 3f 87 d3 + +# Signature: +0b 41 b4 12 19 71 26 15 9e 9b da 1a 24 62 c8 a4 +fd 3d ff dc 6e 98 e4 db fc 06 cf cc f1 6f 74 fc +b5 23 38 af 14 ed 39 36 e0 2c 1d 7e 77 23 6c c6 +a4 89 f0 0f 08 98 52 de 5c c4 25 b4 50 94 a0 42 +e3 85 46 4b 64 c3 b2 ff d0 1f 19 a0 1c 2c 03 81 +f7 58 a6 73 65 d1 e6 5a 70 7b 13 4e 3f 8a 93 16 +b4 aa cb 7e 85 1a 5e ab 3c d8 11 bd 45 22 dd 14 +1a 00 15 7d c3 fc af c4 15 4c af 05 93 ca 62 10 +2e + +# ============================================= + +# Example 11: A 1029-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +1e d7 ee a9 40 5f 50 7f 94 16 23 a1 7b ea 71 7b +86 0d e4 4c b7 76 87 b8 b8 5a 6d 7d 1e f4 f8 62 +8d 25 7c b9 42 38 c6 25 ba 25 d4 6a ae 59 39 60 +af 79 f7 5e 28 ab 63 ac 3c ac 48 20 b8 2d a1 cf +75 0d 6c 93 0d 6b 82 78 54 aa f6 ca c0 c1 7b 80 +b0 29 f5 d3 19 cc ca 66 5c 56 94 f5 4b a5 f0 96 +f4 54 34 13 ec 4c 5e 97 cc 1d da 89 d2 af d4 28 +57 87 59 03 2a df 92 89 50 65 ba af e8 8d 2d 8b +61 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +1e d7 ee a9 40 5f 50 7f 94 16 23 a1 7b ea 71 7b +86 0d e4 4c b7 76 87 b8 b8 5a 6d 7d 1e f4 f8 62 +8d 25 7c b9 42 38 c6 25 ba 25 d4 6a ae 59 39 60 +af 79 f7 5e 28 ab 63 ac 3c ac 48 20 b8 2d a1 cf +75 0d 6c 93 0d 6b 82 78 54 aa f6 ca c0 c1 7b 80 +b0 29 f5 d3 19 cc ca 66 5c 56 94 f5 4b a5 f0 96 +f4 54 34 13 ec 4c 5e 97 cc 1d da 89 d2 af d4 28 +57 87 59 03 2a df 92 89 50 65 ba af e8 8d 2d 8b +61 + +# Public exponent: +01 00 01 + +# Exponent: +0d 93 80 72 b1 6a 02 f5 d5 0a 15 ae eb eb 5a fe +43 18 74 48 2c 6d 18 fa 7e f3 16 c4 7f 4e d6 d2 +12 4c d0 e4 7e b8 9c c7 58 73 74 57 6c dc cb 3b +ba a1 95 f7 b5 31 13 93 69 b5 6f 9e 2f 53 ae a8 +ac 7a 97 e1 d7 45 8f 52 6c f7 d7 10 c4 90 2a ae +df 99 7c 11 94 b8 7b 62 cc d8 da b8 ff 5b 67 d4 +0f e8 3d e1 b8 2b 91 60 9a 7c 5c f3 92 29 eb 3a +1b 2f 0e bf 0b 12 5c b8 00 91 a0 7e bc 77 9c e7 +fd + +# Prime 1: +05 90 a1 e5 18 71 07 fa ef 1e 0c d5 2f a2 dc ad +a2 d5 8a bc c9 e0 73 8f f4 85 0f 7d 2d ee 19 82 +3f 6e 3e 2c a9 11 b7 17 4b e7 0b 15 c1 b8 87 e0 +ae 15 10 21 22 42 2f a1 58 b9 8b 0d 38 21 15 24 +5f + +# Prime 2: +05 8a dd 02 9b c9 7e cf d1 d0 db 26 be 45 ee 8d +3e 54 bf e6 36 fc 4d a6 66 dc f2 50 ab 2c 2e 96 +56 62 16 b8 a5 17 f1 0f 75 b9 8f de 6c cd 8a 58 +e8 fc 58 2e 78 74 90 e1 95 8f 7a 0f da 82 ad 68 +3f + +# Prime exponent 1: +01 80 ee fd a3 f9 06 9a fa f9 37 a6 72 d4 a2 a4 +18 17 73 01 47 da e9 de bf c7 24 44 42 a0 cf 2b +ae 4f ef 64 c9 da 0b 8a b3 eb 9d c7 27 2c e1 2a +08 5f 90 98 23 55 96 e1 15 c4 2c 9a 49 cc 46 96 +29 + +# Prime exponent 2: +05 12 e1 4e 11 05 7d 84 8c 23 f1 6b 5f 46 2f a2 +b7 8b e7 fc bd 1b 6d 8e 46 9e 3f 69 9f b9 9b 90 +5e d5 fe cc db bd b6 1d 1b fd 5a 7a 19 0a 74 7a +fe 16 7c 37 56 68 07 75 ab 6f a4 23 3d 3a e1 ba +0b + +# Coefficient: +26 2e 28 23 16 98 be 32 87 a9 c7 06 f3 94 7b 7d +5c 2f 5f d2 b9 14 46 f5 e9 a3 15 44 d9 af f4 55 +a3 ec c6 b5 43 14 82 0c 2a 48 82 61 d9 f9 8d 34 +8d 9c 3d 10 02 e4 e8 28 7a 15 2c 12 87 09 65 60 + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 11.1 + +# ----------------- + +# Message to be signed: +84 55 19 dd 45 d2 dd cb c8 db e0 b8 29 54 c4 58 +c3 66 4d 88 27 4e 50 2d 27 91 46 b1 8f 6a 81 67 +50 e9 4b 4e cd ee 68 32 cb 35 df cb db dd 3e 5d +c0 64 04 d5 f0 c7 0e 7c 7c d0 e1 9f 38 bc 5a e3 +2c 7c d9 1f 94 d8 f5 67 82 39 7b c7 4e 6b 06 98 +27 ec 27 30 17 37 40 ce 4a 10 e6 48 c7 88 97 af +1a 89 e8 33 31 d0 f4 61 37 8d 06 05 28 73 f1 7d +9f fc e4 6a 32 47 26 07 fe 73 e4 a5 61 87 9e 61 +9e 7c 1a e8 14 e4 5e 1d 2b db 12 19 46 b2 ae b8 +56 39 16 c5 43 eb fd c2 c0 90 fe b5 56 65 00 a8 +ce 74 af a4 53 72 bd e0 c6 67 3a 7f 6a cc b0 ee +9d 57 bd e9 3c 36 dd c5 7b 84 90 aa 2d 68 58 5a +3d b7 29 7a da 6d 9b 3f 35 6d bc 74 d3 15 c5 fa +1a bf 7d e6 ce bc a8 3c 9d f7 + +# Signature: +08 63 a6 26 dc 42 ba f3 e1 61 c3 5b 3d e3 b1 ab +c1 aa 5a df 54 16 46 5d 4c 7b 6b 01 ae 2d ad 73 +f9 f1 58 eb 21 3d bc 36 0b e4 d4 7e 57 07 87 1c +39 c3 8d bb c9 6b 46 c8 f9 af eb d3 dd ac 87 16 +90 98 e1 a7 67 18 d3 54 cd 09 1c a3 52 96 a7 7c +21 d2 51 2f fe 65 e3 b7 1b 90 22 e9 cd 1f 7c 35 +ce 13 65 fd 1f 2c 2c b9 67 ff 4c 8f 90 f0 c8 ea +ef 0d b7 3f ed 00 e9 8c fc 83 f8 0c 67 b3 be 1d +33 + +# PKCS#1 v1.5 Signature Example 11.2 + +# ----------------- + +# Message to be signed: +86 8e 7c 4f c6 34 0b 6b be b7 b8 6e a8 9e e7 26 +5f 32 31 f4 8b aa 92 e4 a2 e8 ce 0f a1 c1 a8 c0 +fb 0a ca 94 4c 74 bc cd + +# Signature: +10 cb f8 71 7f 76 27 8f cc 8f c0 aa b4 6e 90 a3 +d1 80 c3 c9 2a 4a 83 eb 93 c8 92 0a f8 8b d6 50 +6b 40 73 45 3f 0b ef f3 e6 1e db b4 db c9 c9 47 +c6 9d eb 69 a1 ac 92 9e fc 15 62 5b 9e d7 cf 1b +c4 23 a8 87 5f 37 80 dd da 9e b2 fc cd 9f a0 14 +62 6a 7f cf 99 86 49 bc fa 59 53 a3 c4 3e fb cc +38 70 4d 02 49 19 df 2f c4 ad ea 39 e3 4c d1 5c +d4 f8 6a d3 f5 01 01 2f 6b d2 8a a5 00 2c 3b 41 +ba + +# PKCS#1 v1.5 Signature Example 11.3 + +# ----------------- + +# Message to be signed: +92 cf 88 0d a5 89 15 e3 aa 95 08 93 53 e4 61 84 +c9 15 94 5c 57 67 9c 1e 4b d3 82 5e d9 19 a3 20 +52 e9 78 6e 23 b9 42 53 9b 93 15 f5 81 da f0 b4 +1f a3 26 1b 96 7d e4 0c d5 d9 2a 48 24 f3 64 bd +1e 1f 51 84 4b 10 9b 14 54 13 4a df 23 4e + +# Signature: +08 82 89 66 ac 58 36 c5 13 da 4f fb 87 61 87 97 +94 3c 61 2e de 7e 12 b3 10 03 ef 17 10 65 b4 ce +dc 6a 80 b1 45 6c 21 b6 74 b3 77 9a d3 5f 70 17 +7a a9 2c 6e ac 0b 83 3a 96 7d 7e 98 99 0b 48 24 +42 05 db f2 6f 5c d5 7e f8 7d c6 fe 5e d9 99 cf +8c a7 5d c8 e6 26 fd 6e b2 81 c4 99 af f7 29 89 +ed f5 2e c6 f3 bc af 81 ec 5f 8e 82 30 b8 7e de +dc f7 b7 78 14 3e d6 c8 ce bb ac 9d e5 41 09 dc +f7 + +# PKCS#1 v1.5 Signature Example 11.4 + +# ----------------- + +# Message to be signed: +87 3c 47 15 90 2f f1 9d e0 8b cc b0 cf 26 37 63 +fa b0 16 d0 22 0f 03 27 b4 75 5e 35 4e b2 47 f5 +db c2 d3 96 98 9b bd 36 d3 1f 61 98 93 90 ca c1 +66 43 12 5e 63 e1 a1 ae 1f 1b c9 bb ed ac ce 67 +fc 1b 51 a7 + +# Signature: +05 25 9c 48 15 93 ea 86 d1 f0 02 ca 58 aa ee 93 +29 fa fe 21 8f 67 50 f0 e5 88 f3 3b 64 e7 08 fb +27 a6 fe 81 eb ca 8a da ec 75 7a 14 ff 55 a0 c8 +8a da 2c 3b 43 e3 9e 8d fb e6 76 89 43 65 a2 21 +0c 2a a8 1f 42 4d 85 29 c2 07 6b 00 c9 2d d8 c8 +ae 3b 78 0d 87 db a7 29 dd fd ef 7d 40 7f 85 4a +71 cb 68 8b 9f 03 c7 1f 3b aa 24 a2 a6 e1 cb 41 +07 74 30 9e 40 c1 3c 2b 26 47 38 e5 69 7c fd de +f3 + +# PKCS#1 v1.5 Signature Example 11.5 + +# ----------------- + +# Message to be signed: +14 b2 76 02 ec e8 f0 67 b5 84 83 af 17 77 c4 ed +10 b8 b6 4e 64 c6 9f 57 ef 88 9a 1c a5 d5 b5 d6 +51 c6 08 db 23 9d ee a1 50 ff 12 cf 50 c8 67 96 +12 f9 7e cb 09 f7 + +# Signature: +15 c4 b3 f0 81 a2 e5 8a f5 94 e4 2f d6 ac cf 1d +0d 61 d9 3a 5e 3a 84 cf 90 4b 98 d9 ad 71 33 61 +b7 84 b2 4d 92 95 e4 3c 23 be 93 ef 36 51 4a 9b +ac 2c 1b df 4e e7 32 34 36 76 3a 20 66 2f 2d b3 +41 d9 e3 8b ed 5f 12 c7 dd 18 bc 3b b0 fc ba 5c +00 50 bd 1a 2a 44 03 71 97 b8 c9 fc 2a a5 99 eb +43 c3 d9 67 92 42 c9 9b bc 49 b0 3b 98 ea ca 83 +46 28 72 59 e6 ea 2e 89 15 5d 0d d2 b4 77 80 35 +75 + +# PKCS#1 v1.5 Signature Example 11.6 + +# ----------------- + +# Message to be signed: +e5 66 e5 fa 55 6c 76 5b 62 bd 6e 37 45 21 f5 08 +fe 44 66 68 c6 47 4b ef 04 6c c6 89 4a 87 32 2e +19 31 e8 0d 9e d9 ea 80 6b 16 7a 3a f7 7f c0 49 +38 b5 54 8e fb c0 68 d4 f1 96 6a 99 76 25 af 31 +a4 00 7f 06 98 a8 46 9a b6 81 f4 d5 08 b4 a4 8c +8f e7 20 cb 5a 94 a7 f4 43 dd 5a 58 03 04 97 da +a9 59 a3 aa f6 e3 41 84 39 7a + +# Signature: +07 e7 c9 44 26 24 bd 26 6c c1 cd 1a f3 b8 f0 62 +94 dd a1 c0 77 67 fe 19 bc ed 6c 9e d7 c4 b1 ed +7f 26 e2 03 db 7f 3a 1b fa 57 da ba 6f 3a a0 60 +03 bc dc 1e 00 c2 d3 d7 6b 9c bf f9 68 49 b1 af +f5 42 d0 d7 af c6 e4 22 49 2e ab 0a b7 f8 e1 d1 +ae 0b 27 9b 85 19 45 b7 65 85 1b 9f 8a d8 80 dd +16 4c 11 ac 4a 57 f9 6a 0e 48 4b a1 6a bf 1c be +8a ac 09 0a db 6a 71 79 7e 13 35 ee fe 2a c9 98 +0d + +# PKCS#1 v1.5 Signature Example 11.7 + +# ----------------- + +# Message to be signed: +b4 43 c3 43 52 7b 30 d5 ff + +# Signature: +0b 3f 13 c2 72 24 d1 61 01 b9 c8 20 1f 1b 4f 85 +37 db 3c 11 6f 3c e1 30 be 0d e0 dc 0d d2 0f 77 +3c df 7b 7f 37 23 87 c4 b6 53 e5 dd 44 21 84 45 +74 11 a8 2f 8e d0 03 66 ec c0 77 a4 26 7c 9d 7e +56 54 96 63 23 9b 43 19 fe 49 9a a7 89 54 04 9c +74 3b bf 09 d7 7b 30 29 d9 18 bb 7b 9a 6a e8 0b +12 9e 41 bb 56 da d2 b8 a4 b6 f3 19 33 74 c8 29 +2f e0 17 d0 63 34 7e 91 cb f4 dd 39 39 c2 37 f8 +3c + +# PKCS#1 v1.5 Signature Example 11.8 + +# ----------------- + +# Message to be signed: +db 90 04 7f 61 5a d7 19 72 ba ed 0c 10 62 6e c8 +cb 18 c6 d7 5e aa e0 58 21 9f d6 19 54 26 d4 4d +5c 54 3b ef 3c 4c 14 98 e8 77 d7 c8 53 e5 31 21 +eb 31 57 00 81 d5 de 48 85 cb c9 25 a6 c2 23 21 +cc c9 c3 78 4e b2 19 e4 2b 7e db 92 88 77 60 73 +29 79 8d 55 73 9c 89 d6 d6 b3 f0 d4 30 bb bc 47 +22 ea fa 67 de fc 86 ab a6 e6 34 83 fd 64 99 b0 +3f ab dc 84 65 d9 8b bb e4 40 2b 02 31 13 5c 21 +24 3d 7e 02 ad 5f 7e 9e 8b 94 60 c1 2d de 2a 39 +5b 45 69 61 cc 3d fd 9a 12 f5 d9 35 9e 0b 3a 6b +d7 7f 44 65 5b 60 3b 02 55 db ba ff 8b c8 40 75 +9a 34 62 fe ce 0d 8d b6 e4 5e 2f e2 bb f8 b6 e9 +7b 3f ea c0 79 86 73 82 57 ab 9f 8c fa 79 5a 20 +19 2b 5e 2c ea 11 8c a7 62 25 2a f6 c6 eb 00 ec +5c 68 20 bc c7 c7 + +# Signature: +00 aa b0 67 d3 a8 63 3d 0b eb d5 91 ed 34 d0 67 +f4 71 8c d7 f9 b1 e3 5a aa 40 5d a1 22 2a b9 40 +38 66 92 1f bd 05 74 33 40 7a 4a ae 7e 26 c5 cf +a0 bc 9c 11 57 05 7b 1d a1 cf 36 28 51 87 19 a6 +03 f6 c3 c4 de a3 0b f4 9d b9 b0 68 af ec 69 81 +21 dc e5 d6 0d 93 a6 f5 63 3f c6 af 9d f4 c5 dc +cc 13 8c 29 4e dd 42 9d 4a fe 3b 33 78 86 82 55 +cc 53 78 8c f2 b4 77 45 d6 4a cd 88 5b b4 7d 2e +ec + +# PKCS#1 v1.5 Signature Example 11.9 + +# ----------------- + +# Message to be signed: +2b e0 06 7b 95 18 5b ad e1 18 dc e9 5c 57 02 9b +55 4b 25 e1 c3 95 19 f8 f8 90 73 b9 a0 4b 7e 91 +29 9c db 87 b0 bd 17 c9 f1 51 92 5c 75 6e b9 b6 +45 07 25 61 26 41 07 88 21 38 85 4a e7 d5 07 e1 +5f cf e8 47 09 45 40 e7 1a 54 7f 63 b5 90 46 7f +ad ff 64 7f 64 3e 1c ec 11 24 65 29 06 2c 9e 40 +88 92 f2 a2 0c cc c0 ae 45 ca 97 a4 7f ca dc 8f +ed e2 1a 24 71 11 67 70 6c c4 b5 d6 94 77 e5 a8 +a1 46 b9 60 cd 4b 17 27 42 7b 16 51 7b 63 eb fb +cf 84 d0 b1 ac 8e 7e 70 f0 44 35 75 22 b1 d0 cb + +# Signature: +09 76 81 12 17 71 45 44 41 01 33 24 3b eb a9 a2 +1a 6f 72 12 c6 87 91 5c 72 02 7b ba 31 12 f6 97 +05 42 5c b9 94 cb b6 d3 59 c1 46 b9 5d b1 44 64 +35 d4 cf 96 1d fd 5c 49 87 39 bf d4 be 6e f1 ad +d7 4b 81 b2 89 8a 4c e4 3d c3 7c b0 e9 ed 77 44 +cf 40 9b ab ff 71 78 85 42 ff d2 86 eb e5 25 5d +63 dd 7b d5 5b a4 3f 51 84 e2 48 d3 a6 69 33 cd +b0 69 91 ec c9 0e b3 9e e7 1d 65 c8 8e d2 4d 94 +4c + +# PKCS#1 v1.5 Signature Example 11.10 + +# ----------------- + +# Message to be signed: +a7 90 e6 ac 5d 55 6f b7 cf 44 46 0c 7b 9b e5 eb +7f 24 f9 87 ff 89 0d cb 78 40 24 1d 45 54 5b 71 +05 63 5a 1a af 44 57 e6 41 0c 65 ae ce 50 11 e2 +77 5e c8 53 0a 64 a1 88 39 e9 c5 8a 7b 77 42 4f +74 29 3d cb 9e 9e a8 73 6d 6b a5 8b 1c 66 53 d5 +7b ea ab 98 73 5f 7a f7 32 47 7b 9a f6 a3 3f f0 +75 c7 e4 66 39 d7 48 55 08 20 ba 6a bd 4a 9d 48 +cb 49 03 f6 5b 76 f8 14 c6 cd c9 5e 8d 9e 87 0c +24 4a 02 9b 29 4a 8a 5c 82 6a b1 61 f6 f9 78 d9 +f1 c0 3f cd da ae fb fa db 8c aa e8 4b c2 dd 33 +2e b0 49 97 d6 1e fa 91 e9 24 1e 4c cd 97 64 c7 +26 e7 66 ed 3b 03 38 d0 86 f1 03 2c 15 33 ef 59 +3f 88 fd 56 03 37 91 b1 d0 62 5c 6c a5 1e ec 27 +9c fb 6a e3 f1 27 00 cf 5b ac 27 1e 65 67 + +# Signature: +0d 1b 11 1c e8 de 1d 7c 4f 7f ce ac 73 df 70 aa +6e da 58 dc 32 eb 98 f7 8e 7f b9 bc 25 de 3e 6b +09 ab 8c ae 3b 20 26 b6 18 7f f6 36 72 e5 7d a4 +ac 28 96 24 45 d1 fe 95 1d 27 be 6a 6c e7 a5 80 +7e 13 76 13 94 46 e8 54 9d 48 aa 59 fc 22 33 54 +d1 21 fd cc 38 f1 d0 27 5e 41 86 92 27 00 ad c6 +1d ae 1e 4b e8 05 22 2a 1c f0 7f 11 0a 61 58 a2 +a2 62 58 f1 9c 65 7a 11 0c 0d 9a d2 91 68 0c 75 +96 + +# PKCS#1 v1.5 Signature Example 11.11 + +# ----------------- + +# Message to be signed: +32 af d1 3e 60 7d 87 b2 5f f4 0a 88 5b 25 09 f5 +21 f2 a0 a7 72 a9 6a 39 fb 3f 71 c9 63 84 b3 d7 +57 8f 48 fc ea 97 39 56 0a 65 bf b4 83 d9 60 8d +20 25 55 f6 6d 61 2d 16 b9 25 53 87 b4 e1 12 41 +15 ed 48 bf ef 8b 89 d8 dd fc 21 9c cc e4 87 86 +c9 e6 42 6a 92 12 e7 b1 6d 97 1d 27 8a 11 18 f2 +f8 6b 9c 4b bf 75 c9 c2 d0 99 e3 f6 65 48 f1 f4 +a8 a8 21 d7 27 44 98 f7 cc e6 ec 5e 2b f2 bf ad +2c 6f c0 05 e8 0a 48 ca e4 69 92 fc 82 67 a6 48 +0a cb 89 4c cc 9b 62 09 5c ad 97 db 70 d8 82 a1 +3f b3 85 88 c4 8c a1 90 f1 80 cb 3e 61 ac b4 e2 +cf d9 cd bf 85 5c 53 99 21 f6 8e 11 49 d0 54 7e +f5 9a f5 37 92 dc 66 0d a5 ef 48 a7 ab 89 36 d3 +d3 6e d6 b6 46 9e b6 fd 95 e3 af 18 2c 87 68 fa +60 04 78 54 f1 8f 37 41 c1 88 3b b0 79 26 88 ca +db 9e 4d f3 91 d9 11 45 b8 5e 2a e2 4f fd fe 51 + +# Signature: +01 a9 37 b3 cc 82 54 d5 15 08 70 9e 4a 4d e7 b1 +81 de d9 a4 47 b3 ec 8d ad 49 2c 39 79 52 df 7c +55 0e 4b 26 c9 50 17 29 9d 8d 45 5f f7 97 1c 33 +8c d0 14 df 78 e2 a8 aa 5e be e2 58 f4 92 53 d5 +1a ce 9a 49 31 9f fc 80 7a d7 0b 2d f2 c9 6d cd +b7 3b 48 ac bc 4f 6c 3c 2a 70 1e 7c 15 4b 27 9b +07 05 bd f2 54 8c 8b 36 11 b9 7d a1 ac 09 cd 12 +12 50 99 54 0b f7 ba 99 b0 8c 2f 3d 5f 6a ea 7d +40 + +# PKCS#1 v1.5 Signature Example 11.12 + +# ----------------- + +# Message to be signed: +5b 00 b8 b7 94 a1 0d 21 f1 b4 5e ca a2 0d f7 c5 +b3 52 2c 1b 1d b4 b0 84 b9 59 aa 4e 56 58 ac 54 +68 f6 e8 fb 61 2f f9 9f 32 16 b5 d2 1c b4 ac c0 +bb 42 ee fd b8 e8 2d 75 4b 85 d0 97 45 89 4a 52 +3c 01 62 d0 8e cc e4 8b 99 dd 6c 38 e2 bd 3d 53 +1c 85 62 de ec fc 61 52 36 9a ac f5 80 ea f9 db +6c 68 b6 9d f2 fb f3 05 3f 60 1f 70 02 2c 9e 38 +1d fb c5 90 99 c3 7b de 5a d8 9a 8c c1 ef e4 c7 +b7 d7 8e 90 97 e0 81 21 ed a6 4a c4 5c 32 7e 5e +da f9 22 d3 c3 5f 88 b5 2c 93 d3 99 f4 c2 38 36 +2f e9 + +# Signature: +0f c6 ac 1d 42 94 79 38 cd 25 86 d0 e7 fc 3a 05 +42 b9 af 12 d3 6e eb f9 2b 5d 04 9c 79 65 b1 1b +a9 cc bf 47 00 f3 45 60 91 11 77 b9 d1 29 6f 1c +68 e3 af 46 9f 4f 39 9d bc 18 9c 23 ea 74 65 98 +28 13 32 33 05 ed 6c 35 ff 9c c1 09 d0 a2 30 3f +e7 d3 29 ca 31 7e c4 b1 8e dd 19 c6 2c 60 a3 c8 +c3 10 6f 86 db d0 72 e3 e1 eb 87 85 28 8c 21 ab +ca c2 2e 0c 0d 41 f4 e2 3e 7f 39 4d 46 82 f6 ce +87 + +# PKCS#1 v1.5 Signature Example 11.13 + +# ----------------- + +# Message to be signed: +b7 50 ae 6d 4d 2c eb 92 14 05 34 64 8d 36 ef 25 +e4 51 55 f5 2b de 1b f2 6a b7 + +# Signature: +16 aa de dc a0 9e 06 25 60 c6 61 d2 a4 9b 0e e4 +d9 ce 23 90 7c 69 d1 00 04 f1 49 d1 03 c5 9c 16 +fe 7d 43 73 59 7d b9 ff d8 92 3a 77 a6 b9 43 b1 +88 c4 74 25 e2 a9 e5 30 41 3e fd b6 84 8d d3 42 +0b a5 3e f8 1c 25 c5 78 f8 d9 51 4d 93 fc c9 cb +1f b5 2f 58 d8 8a 57 d1 fd 3f e2 2d a3 10 ec ea +9e ce 55 e9 60 8d 63 ae 21 db ae a6 57 1b 78 fc +fd d2 71 bb 65 92 57 47 6b 59 95 68 7a 02 bb e7 +89 + +# PKCS#1 v1.5 Signature Example 11.14 + +# ----------------- + +# Message to be signed: +47 be 01 02 0e b7 e7 87 5b d4 fc c0 05 a8 2b 36 +fd f2 14 5e f1 32 e2 ed 16 2f f6 94 bc 71 58 9c +7d c6 d5 a3 f8 9d 59 7f 2d 2a a3 43 33 51 18 f6 +fd bd ee f2 3e 61 3c ba cc de 41 95 e6 64 a0 09 +4b 07 fc 0a 32 84 8d 61 39 03 1c f5 72 a1 e3 23 +c5 a7 07 b6 fa 2a ee f2 dc 87 2d d5 a3 e7 6b 13 +f8 ef 94 ad eb d4 e2 05 74 8e 48 5b 40 01 d5 d2 +a0 90 b8 9b 2e 64 74 c4 79 e7 b0 0d 2d 57 f5 86 +ab 76 b8 0f 79 5b a8 99 62 88 29 2c 3f 2c a5 1a +44 e4 e8 41 c0 37 07 e4 80 25 af 4b fd 0a b6 ef +eb 83 62 ed d5 d2 34 05 ba 0e 23 1b 33 24 e1 ca +3c 5d 63 9d 2c 9d 82 + +# Signature: +06 39 17 92 9b bb 20 92 17 ff 48 ed 4f 55 d0 7a +03 f7 6d 6d 94 04 8b 6f 71 31 0b 2c 96 e2 14 ab +22 0d 4e 45 ac 01 c9 3d cc 8a 5c 26 a0 2d f6 1f +fd b3 17 54 96 65 61 0c 84 bd b8 94 5f c6 bb d3 +8b ae d7 fe e9 8e b0 56 d9 f0 39 a8 60 d4 52 b3 +ac ac 18 00 a9 32 a2 8c 88 28 6a bd a8 de 3c b6 +c0 d7 94 da ab 7a 8b a0 11 09 33 b4 d1 de d2 39 +cb dd 55 7d 3e 5a 16 29 17 85 33 15 de 68 09 00 +a8 + +# PKCS#1 v1.5 Signature Example 11.15 + +# ----------------- + +# Message to be signed: +4b 9c 09 64 48 10 d4 b3 06 55 ed 83 38 bb 27 6b +62 4c 68 01 98 22 d1 fc 8f 78 86 1e 13 e2 2a c1 +71 82 1c fd bd 3f 8f 5b 8d c9 c0 de 73 2b 74 6e +1d 13 2e 5f 3f 14 9a 5a 86 7c 2e e4 78 e8 f1 4a +d4 b9 dd eb d3 ae 78 17 e8 49 55 b3 40 4b 09 43 +93 e6 1c a0 18 9d 05 53 69 b4 24 30 09 a0 f5 40 +3f 41 c1 00 23 08 c0 0c e6 99 67 19 37 ba f1 3c +78 93 d6 63 c9 47 fc 7f 84 07 1a 67 2e 5e 07 37 +8a ac 08 b3 fa f0 fc cf 5b f2 83 09 25 85 eb e2 +40 a3 00 46 20 b6 f3 ae b6 73 2b 7b 9d 8d 3b ea +fc 84 67 d1 f1 f1 c7 da 66 b1 bf 5c cc 14 5b 32 +24 24 5f ae 31 df b4 03 f4 93 c0 75 53 57 ad d7 +cb 27 63 71 32 26 c5 4f 43 64 0f 7a 67 0e b7 b1 +f6 e9 e7 72 f2 e5 14 17 a7 05 cf c5 87 3f fb 88 +a5 db 07 ec c4 ee 89 f3 30 a6 69 0a 88 12 + +# Signature: +1a 0b 69 8c f3 a0 58 b4 49 19 af 73 c3 de 32 8e +86 ce 9a 5d 49 99 e0 12 2f 41 4b 94 f3 2b 2d 8a +b1 e6 55 0c c0 d4 8d c0 4b ef ac 2c 67 a4 d0 69 +a7 20 8f 14 2d c2 67 b3 e3 8f 63 38 a0 b1 83 9a +93 a8 36 80 7d 18 1e 3f 0c 7e 87 7f b2 42 16 02 +00 5b ca 25 a9 c3 72 26 6d 18 e6 d5 00 c5 c7 ab +13 38 52 83 d2 af 91 9d 0b ba 0d cb 88 bf 7b b9 +97 2d 67 00 8f f4 98 54 7d 80 fc a6 58 ef e7 64 +a5 + +# PKCS#1 v1.5 Signature Example 11.16 + +# ----------------- + +# Message to be signed: +ec 9f f1 4b 9f 19 7a 2b 4f 24 94 8c 29 d2 f6 4a +64 62 52 23 dd b8 53 46 37 8c 2c 25 34 3f cb ef +58 5a 99 e1 ec 0b ef 0e f9 d0 9e ad 85 be e1 c4 +bf b3 5e 48 fb 26 41 1b df 18 0d c5 cf 31 7b 3a +34 83 71 c7 c5 f4 aa 6d 59 08 fc fc 1e a3 90 18 +cf 04 49 e5 5f 4e f9 94 bf da 40 4f 1c 18 9f db +8a 0a 5b 09 06 c3 d4 0d e1 e7 87 c2 db 4d 88 db +c2 10 b9 f8 01 f4 cd 9c 97 22 7e 9b 2f bc 28 11 +e3 8c ed d9 e9 f0 35 60 03 1d 4c 95 8a 76 81 ba +9d 7e a5 e7 8e 9b d8 bd ed db 41 56 79 0e f2 1f +b7 4f bc 41 58 c2 93 9e 4e fc b8 2e fd c8 81 88 +6a 5b 67 13 a2 4b 9b 5f 2e e2 5c cf 72 1a 64 e0 +f6 40 77 8e cb 3d 35 b4 b8 ee a8 ec e3 12 32 63 +63 10 ae 3c c6 b8 2b 8a + +# Signature: +01 3b 42 05 78 20 c7 3e 3a cf c1 df 4d e1 44 0c +65 8e 01 80 43 6d a7 18 5a 9f ab d2 6e b3 26 74 +b5 54 de 35 4d 1f 4f 24 e8 77 73 26 7f ed 9d d0 +fd 82 93 ea ca 4a f3 d3 a9 dc 51 8c 8e 49 5a 14 +76 95 11 1d 3d c1 77 63 f1 f0 2e ec 1e e2 9f b1 +ab 74 9c f3 0c 78 86 da 8b 2f 64 69 69 59 8a a7 +0f 9a 92 fa 4f 93 5c 7c c7 7b fa b6 98 1f 0d f0 +d2 85 cf b1 0d 66 58 15 39 f7 8d 03 68 ed 4f 93 +01 + +# PKCS#1 v1.5 Signature Example 11.17 + +# ----------------- + +# Message to be signed: +41 4c ea 8e ec 6d a3 c6 6f fc 84 70 f7 e1 47 60 +f7 4b f6 e7 5b 84 dc 98 fc 80 60 dd 3c 21 9e 76 +77 7d fa ba a6 e6 b9 29 55 37 9f 3e ca af 5f cb +8a a5 54 9e c9 cd d1 f5 d5 77 20 1b 8e 32 9f 72 +fa a2 bc ad ea ee 38 8d af 7d 40 8a fd e6 55 3d +24 17 86 0f 3c 8e 25 30 5d ff 76 db bd 95 16 b6 +86 8e e4 56 fc 1f 7b 58 d9 ed 18 a4 6e 4f c1 e3 +53 e8 d0 76 be a3 0b f2 47 c6 0e 6f 68 58 01 a6 +d3 f6 30 ae a6 ab b4 12 a9 41 ff a6 f6 07 f6 bf +b1 3d 90 01 27 bb ec ee 4f 98 a7 ac a6 92 08 11 +57 50 53 ab 2d 42 70 13 80 1d 8c fb c3 88 0f 14 +75 43 15 55 a0 86 fa 55 60 c6 e2 20 6d 9e e9 38 +13 44 b8 24 1c 1d d1 d8 64 48 75 3a f4 4b 00 a0 +c9 + +# Signature: +16 97 bb 23 e2 91 52 5f 4a 0e 79 26 2f 34 06 63 +0d 0d 6d f3 32 49 69 26 c4 e5 ae f9 6e 41 d9 55 +14 86 47 ea f7 90 69 6a f6 8c 78 eb 2a b6 2f f7 +19 62 96 e1 ea 88 6d f0 91 73 66 09 0b 63 0a a3 +18 58 b5 16 15 87 3f a6 bc 8f f0 88 5c 57 b2 e7 +7a 04 90 88 93 cc ef b1 41 24 03 99 1d 0d 23 c5 +57 d2 22 29 1c b8 51 7b 43 28 6e e0 05 67 58 d9 +c1 0b cd 69 bd 68 b8 4a 2d 1f 53 79 05 b8 a4 65 +e9 + +# PKCS#1 v1.5 Signature Example 11.18 + +# ----------------- + +# Message to be signed: +17 89 b8 08 b1 0d e8 d1 77 8a a4 3f 94 10 1c b8 +9f 56 34 30 61 a1 a9 43 bb 8d a5 5e e6 b9 79 e2 +7a fe ab 0e d8 ee 37 14 fb e7 0b 3b e8 20 60 3e +5c ea de c4 b2 2f 95 87 73 22 5d f3 aa d4 87 b2 +80 57 eb fe be 2c 87 93 da 38 46 bd b1 59 03 ac +71 e9 c9 3b 20 16 66 8b d9 06 30 1a 0a 7d 50 dc +60 b2 fa d8 75 9d 18 db 14 7f 20 66 86 5f d9 09 +50 a1 88 74 7d 9b 69 68 53 48 6d ea ab 8e 44 3f +ad 29 92 fc 8a 56 5b dc ba da b0 b9 33 3a b7 fc +db 9c 3d 0b cf de 50 a5 8d 2a ea f1 ce fb 0c 95 +f9 07 73 b2 fa c1 37 cd bc + +# Signature: +02 f9 97 51 c8 44 38 ea c7 f9 96 32 50 d9 ee 22 +fd a7 29 7b 6e 86 e2 a8 bc c7 a9 b5 ac 01 f7 90 +e0 99 11 70 46 60 85 8e a5 c1 62 72 c3 81 33 fa +da de fa 23 c1 02 90 8e 41 9d e2 eb e9 ac 27 19 +45 72 87 8e 2a 97 1f 88 31 c8 f9 17 e8 52 e8 51 +df 99 d4 df 01 8f dd b2 ce a3 1a c3 a7 b6 89 75 +e8 0a 99 7c b7 dd 4d 4d f7 57 bb 8c 3e cd 91 0b +cb 06 03 35 52 12 7a c3 08 11 77 39 a0 2c 20 17 +17 + +# PKCS#1 v1.5 Signature Example 11.19 + +# ----------------- + +# Message to be signed: +ff 87 5c ca 0e fc 3d 90 f5 6e 31 f4 bb 66 84 14 +89 4d 09 de 90 12 7f 84 66 32 43 10 e1 13 69 a3 +f2 f6 49 3c 1c 78 a3 62 b2 a1 4f b5 48 8c b5 6c +e0 22 73 9e 43 aa 76 3d 9c 1c 97 b6 21 cc 53 68 +c9 c0 0e 81 60 67 92 69 5f 9a f9 ab 63 3e f2 39 +ea b3 44 9d da 9e 66 07 08 9c 37 51 90 35 4f 7a +59 a4 b3 ef 75 22 9d 1c 47 ec da e3 3b 27 69 ff +55 42 65 5e 78 10 22 d0 c4 3b 42 1a 99 84 3c 3d +e1 04 22 ad 2f d8 9d fe 44 66 15 f5 19 2e 75 79 +d4 37 43 79 bb ff b9 + +# Signature: +02 68 91 7f 8b da ac 9e be 32 b0 dc 6c d9 d3 9e +fd 3f 88 d8 17 d6 6c b6 39 0d 7b 55 c6 92 12 21 +84 4a b8 c0 89 86 d3 f2 ea 49 bc 6e 3a 10 02 08 +6c 0b 6d f1 63 f7 9d 16 11 6a 93 c4 a2 cc 04 22 +c9 48 41 e1 e3 b9 45 ab 1d 25 3a b8 d7 d1 39 c9 +18 8b a8 30 27 c5 93 f8 3a 6f 38 37 0e 7f 03 79 +ff dd f1 42 7d 6f cc cf 60 83 31 3f 18 15 b5 de +d6 73 74 30 bb 4a 70 ba 81 48 48 34 d8 d1 d2 9a +5e + +# PKCS#1 v1.5 Signature Example 11.20 + +# ----------------- + +# Message to be signed: +e0 7e cf 00 e2 40 1a c9 8b 2d 5a e0 c9 b8 3f 21 +9a b0 27 a6 51 99 fd b6 34 59 6e 23 44 62 41 38 +72 95 32 49 53 28 f9 3f b3 a3 32 55 27 8f 3e c2 +60 65 ce 54 99 5d 42 41 93 bc b7 58 1b fe 1a b8 +95 7d 0b 96 1c 30 30 b8 20 d0 9c 9e 32 6c c3 0c +0a f6 42 66 61 54 + +# Signature: +00 c4 6d b4 1b 65 dd c7 1f bb fc 12 5a 4f 9b ab +88 0a 2f 0c 1f 04 1c 41 1d f7 d4 5d 1e 19 99 7b +34 8e ab ba 19 bf 79 b2 21 77 b2 a0 d7 3f ef a5 +00 83 62 ce 59 60 d7 ef 58 a5 89 93 e7 46 03 d4 +d9 d0 b3 da d4 b2 0c 82 9d 36 ef ca f5 7f 0c 4f +0c ef 89 01 5a 48 45 02 42 bd 02 0d 5f 52 d8 b5 +0e a1 3e 56 a1 aa d6 01 91 5d 60 ec 9a bf c3 07 +f1 8a f2 06 72 38 4d cc 12 f9 82 27 31 36 99 71 +40 + +# ============================================= + +# Example 12: A 1030-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +36 98 1a 95 ae 24 18 14 52 da 25 7c 03 8f 05 82 +14 12 d8 4e b4 7a 43 fc c7 ef 12 17 95 9b a6 77 +02 7f 70 86 d3 a8 5c dd 34 9f 92 0f 03 4c 02 78 +79 2d c8 a8 cf 0c 00 80 e5 c6 1f 47 48 83 c6 87 +9f 4d ee 0a e9 52 47 8a 5e e2 ce 4e 39 18 64 1e +81 3c b3 74 f7 b2 83 2b cd 6a ea 80 9d 25 4f c2 +ca 9a c5 a3 32 42 4a b6 5c 2a 26 12 75 d1 9a 41 +4b 61 65 00 d5 e3 73 70 63 15 f0 63 dc 88 5d 7f +b9 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +36 98 1a 95 ae 24 18 14 52 da 25 7c 03 8f 05 82 +14 12 d8 4e b4 7a 43 fc c7 ef 12 17 95 9b a6 77 +02 7f 70 86 d3 a8 5c dd 34 9f 92 0f 03 4c 02 78 +79 2d c8 a8 cf 0c 00 80 e5 c6 1f 47 48 83 c6 87 +9f 4d ee 0a e9 52 47 8a 5e e2 ce 4e 39 18 64 1e +81 3c b3 74 f7 b2 83 2b cd 6a ea 80 9d 25 4f c2 +ca 9a c5 a3 32 42 4a b6 5c 2a 26 12 75 d1 9a 41 +4b 61 65 00 d5 e3 73 70 63 15 f0 63 dc 88 5d 7f +b9 + +# Public exponent: +01 00 01 + +# Exponent: +09 ad 03 17 30 b6 32 73 55 ac d6 94 68 70 0e 7e +9b ae ac 5a 24 a7 ff c9 3b 29 2e b8 71 da 54 92 +46 a5 ce 0c 83 52 55 65 1a 28 c6 e2 f4 c7 61 af +b6 f0 6b 9e 29 95 fb b7 dc a1 74 d5 36 2f ae bd +c3 9a 72 c5 79 5d 1f 33 92 ec 08 8b 5d c2 a7 85 +b2 c9 c4 c6 e6 69 e7 23 b5 dd 0c e4 43 25 55 12 +67 dd 62 e0 f7 8d 24 24 ad ae 48 e2 49 44 3a ef +4a 37 04 10 db 9e 70 93 99 ac 37 cc 48 1b 59 00 +c5 + +# Prime 1: +07 72 0f 21 cd db 92 27 45 b7 1c f8 11 6a 83 66 +9a 0d db 89 e8 f3 f0 6c 34 7c a7 87 cf 10 ef 16 +93 bd fe 3a 0c 36 4c 7a 7e 89 04 17 f2 af 49 47 +5c 7d 07 6f 9c ee aa e7 6d bd 4e 92 15 af 45 69 +4d + +# Prime 2: +07 55 1c 27 e9 aa f1 1f 47 4f 1c 9a 14 bf 14 4c +fa ef e2 7f ca 4f 20 79 5d ec 85 34 c9 37 bb 00 +fe 16 23 5e cd 69 1f d2 3e 32 cd fb 8b 78 66 6b +b7 82 84 ae 15 d5 9b e5 ca 74 73 e6 2d 46 a9 da +1d + +# Prime exponent 1: +02 e2 2c 74 16 0a 94 36 bb 6c 28 3e f6 57 be dd +ec 89 b3 5d 5c a7 a4 93 f3 5b d7 71 e4 42 95 a5 +b3 c0 20 06 11 16 b2 55 ba 4d 8c 15 4e 3a 8e 71 +a1 a3 16 4f 26 82 d4 13 5e cf b2 ef 26 90 c3 9b +fd + +# Prime exponent 2: +01 d2 bf f5 8c bc dc c8 12 4b 31 a9 7e 8f 24 d5 +1f 70 96 b9 7f ec bc fe 70 c4 67 3b 00 ed c2 aa +34 83 fc b7 8e 0c 1d c5 81 81 d0 86 43 df e4 57 +d4 81 b7 cc 31 d1 b3 ba 27 e5 5d 0c 57 25 c3 06 +61 + +# Coefficient: +06 d2 27 72 57 42 ef 03 46 2d 1c f6 12 67 4a 78 +83 1d 61 9d a3 d6 40 eb 7c 71 c8 7b 53 28 69 72 +73 c5 f7 51 e1 4d 7b 81 c1 2b 6d eb 44 75 1a 92 +95 cb 67 1e 81 48 4d ea a8 3b 4d f1 fd 37 e2 ff +3c + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 12.1 + +# ----------------- + +# Message to be signed: +e4 b2 d6 0e 3b dd 27 81 6f + +# Signature: +13 fd 4a c1 ac 68 48 17 37 80 96 5a ff 5e 61 c5 +96 89 2b c1 47 76 0d 43 07 9b 5d 71 77 e4 23 d4 +86 f5 a7 3e 1a 16 b3 ce 9b 5e da c1 61 ea 6d 4f +6c 23 fc fc 3e 62 19 ca c5 56 06 7f fa ed 4a da +c0 a9 50 05 09 0b 89 84 4c 54 35 4d b2 2a af f9 +ee ff 9d a5 aa a5 49 04 25 e1 35 cc 0f 64 58 4c +7f 05 fe 33 6e 44 40 bb 86 92 86 d4 4a f1 57 88 +0e 3a 40 fb 06 72 5d 09 de b3 7f 1e bb 18 1c 8f +5c + +# PKCS#1 v1.5 Signature Example 12.2 + +# ----------------- + +# Message to be signed: +78 86 85 fc 58 05 d6 27 b1 3f 2f e7 fe 6f 7c 9a +b2 ca 49 44 ab f3 08 b8 6d 1a 0f 58 3d 17 b5 76 +02 43 9e 1f 2c 6e 0c 5b f7 81 70 50 13 38 b4 c4 +47 e9 19 7b 65 03 fb 73 eb ab f7 76 de fa e3 3b +dc dc e7 7d e7 9b 82 be 14 85 a8 aa 9b 82 09 37 +db f4 28 a2 05 50 96 6a 86 b6 2a 17 2e 6c fb dc +fe 0d 6f c6 7a 4d b6 22 52 fd af 85 f1 e6 bc 14 +f8 ab 1c 53 32 6a a6 a7 bc 5e ec 88 e0 b1 1d 48 +d2 b5 61 f2 26 06 50 10 2f f2 7b 57 b7 00 72 bc +c1 21 e3 5e 70 f3 78 0c 83 33 b5 bf 6b 08 fa 12 +08 26 0f 33 + +# Signature: +09 04 cc 11 ac 66 a9 83 7b 74 56 8b e2 50 e5 3a +e4 be f7 8d c6 7f fe e5 09 e5 d9 b4 72 58 3e aa +a5 6d 4c 9e e7 0f 6e 82 dc 99 8b 53 ef f1 27 2b +f0 1f 09 e5 26 2b 15 5a 6e 56 d1 50 40 03 e4 c8 +a4 6e 65 02 55 32 78 23 0d 6e 81 b7 29 18 43 ab +97 69 73 7f 3c 69 31 52 f1 7b f2 d8 bf c7 82 bd +b3 fa 0a ea df 0d 44 1e 1e 52 de a5 4b 75 cf 16 +5e 35 c3 82 d3 11 74 f6 67 9d 2f 21 b9 81 f4 13 +58 + +# PKCS#1 v1.5 Signature Example 12.3 + +# ----------------- + +# Message to be signed: +4e c7 39 3f dc 4b 90 af 8f ff ca f3 4e 84 5a 09 +65 6a ef 9d da 12 b0 34 2c 46 eb 04 91 74 aa 51 +1b 43 c9 4d 75 c0 e2 90 70 af f5 b4 14 23 a1 70 +d9 b3 e8 b2 12 24 aa bc 53 1d 88 88 6e 26 46 d6 +78 8f 1b aa d4 ef 4b 0b 4b de 4b 12 ce 90 52 08 +2e 2d dd 0e 3e 6c aa bb 0a 14 34 4b 0a 58 3f 40 +4c 1b 6a 3c 7b ca 8a 58 85 d5 f2 24 af 1f ca c3 +fa d9 37 0e 9b 29 74 e8 ca 62 e2 2a ce b9 + +# Signature: +21 a6 6a f6 27 ee 0d d0 5f e7 56 3c c1 d2 9c cf +6f 87 31 b4 1e 3d b3 95 97 89 3b a1 cf 37 5f 78 +17 88 fd f0 73 b0 b5 93 c7 6d f2 81 6e c6 de fc +22 42 21 ac 19 f5 be e4 4f c0 e5 d4 09 3d 34 68 +27 8f b4 2d 40 5a 07 04 46 53 22 da 4d 3a 7c a9 +c3 da 73 c3 d0 82 ae e5 67 b7 70 83 32 3e 75 bb +35 ed 77 e8 db 9c 01 b4 96 a0 4c c4 a8 99 df 35 +9d a4 a2 28 7c af ff e1 ed 63 cd de ad 87 6c 94 +07 + +# PKCS#1 v1.5 Signature Example 12.4 + +# ----------------- + +# Message to be signed: +90 77 60 db 32 96 9b 09 7d c1 24 ef 89 75 15 11 +a5 d2 30 59 6d 2f d8 a8 91 ff 00 f0 5f ba d4 5f +72 a4 5d 46 56 24 a3 ab 67 af db b9 e5 f9 e6 5b +63 e3 0c 2e 57 fe 7f 32 f3 99 01 10 33 dc 05 29 +c0 97 1f be 06 4f c5 ed b0 1f 84 cd 57 28 3f bb +bd 2a a0 29 44 11 0b 6b 53 4f 74 08 2f 56 be 34 +6c c3 43 bd 4d 0b 34 80 91 c0 05 c6 19 9a 7e 3d +56 88 52 47 b0 c1 6a 36 b2 35 b8 f5 d4 f0 0a 6c +6b b6 fe ed e8 8f cd 78 8d 75 ca cf f7 d9 56 87 +99 65 71 55 9c 05 79 6a 55 71 1d 77 46 bb 92 d8 +52 89 3b a9 06 75 f9 8b 0f 54 08 48 1b f1 54 3f +39 de 3d 0c 0c 1f 53 49 5b d2 12 dd cd c6 d0 e5 +7d 7a 3d be 24 20 8c b2 4e d4 1d e0 3a 5f 05 2a +9b 58 12 70 0a 5c e0 5c 02 00 d4 71 9c 55 54 4e +7f b2 94 d3 44 a4 f2 05 ef 9a 34 97 b5 67 54 7c +bd 1a 63 3e 2b 79 d3 34 90 95 + +# Signature: +0e c9 38 a0 d4 b2 a4 ed d2 78 d6 3d e7 61 c1 02 +e2 59 21 02 ee 05 db 1b 59 1e 0d 85 7b f6 66 84 +9e 74 cc 19 b7 e4 e9 cc 39 2d e5 39 f7 90 fc 68 +e3 b5 21 db 3a 1a 26 7e 5a 4e 12 19 75 2e 01 99 +e7 01 9a 24 85 54 c5 ba e3 11 2b ee a4 0c f3 e6 +4f 8a af 9b b1 e9 d1 c1 d8 83 3c 2b fa 31 b9 d5 +45 0f a2 49 29 7f e2 e4 6a b0 3e 99 b1 f9 c6 51 +d5 39 eb 53 ce 09 61 ce 60 23 c1 7d d7 38 3d d1 +2b + +# PKCS#1 v1.5 Signature Example 12.5 + +# ----------------- + +# Message to be signed: +bd a5 54 95 47 32 d1 d5 f3 94 75 55 c6 1f fa b8 +01 db cd c8 12 1d c6 81 91 27 c2 f2 2a 43 6d 20 +62 2d 1f 4a 44 7c 3a 77 b6 58 57 31 af c0 3e 77 +ba eb 70 9c 1b fb 90 6a 1a a1 94 9a b6 76 3a 15 +c7 da 5a 12 a8 f3 95 10 1e 64 6a 83 71 73 14 1f +2a 0c f5 36 02 4b 36 91 8c f9 db 95 b1 cc 40 5a +ef e6 3a 3a 93 bc 4a da 60 a0 f4 e0 72 9f 4d b8 +b7 6f d6 4e fc bc b6 6f 0e 4a af f3 + +# Signature: +07 26 2f e1 f3 d7 b7 79 32 cd b7 cd 96 ac 19 8b +93 03 eb 44 46 0f 52 98 e8 e5 2f e6 70 52 99 bb +d6 18 ef d0 b3 63 31 56 2f 20 b2 0e 86 6d 99 c2 +d0 4a 01 49 f5 64 dd f6 6b a3 19 f3 b8 48 25 39 +6e a8 b8 93 ba 5b 3e e5 e5 24 5c fe 6b 61 6e 30 +a9 00 bf 83 bb 76 3d 20 b3 30 37 01 ca be 94 33 +41 48 88 2a e4 ef 14 e6 d9 e6 c7 52 bc e2 53 bd +da 57 39 e3 3b dc 32 eb 08 28 28 c1 c3 99 c2 2f +ea + +# PKCS#1 v1.5 Signature Example 12.6 + +# ----------------- + +# Message to be signed: +51 76 ad 7c 99 be 4c db bb 5d 79 ba 5f 49 6c ad +9f 42 dc 25 d5 27 a5 d5 e8 e3 35 91 79 22 5e 6b +0e 43 66 6d 3d 82 ab 5b af 42 4c 85 c3 31 21 60 +6e b7 9a da 6b af ca b5 c1 e2 54 6c ab f6 a3 60 +03 84 05 ca 18 c0 08 36 67 + +# Signature: +06 27 23 8b 0b 93 e4 cf 98 57 13 d2 91 29 6c ed +e3 45 e8 8e 17 82 45 25 53 59 39 b3 f3 d5 ff 4e +bc 40 74 00 11 49 00 25 df ea ae e9 06 38 c5 39 +1e b4 4e 9f f3 70 45 7b 60 d5 de 80 c1 65 38 cb +38 60 55 95 85 ca f5 e3 33 2c 7b 1f dd 8f 45 fb +6e 35 57 f2 c7 a6 0d 09 9e 94 f8 e9 6b aa 1e 03 +19 9a c8 3c ec 8f 9c 16 bb 49 15 1a 88 72 cb fe +70 f0 02 cf 3b 53 b6 11 d6 cb b6 65 89 7c eb f5 +99 + +# PKCS#1 v1.5 Signature Example 12.7 + +# ----------------- + +# Message to be signed: +e1 74 71 93 64 f7 bd c8 6e 2f 0c 61 26 5b f8 05 +7d 64 9c ca + +# Signature: +09 77 19 54 fc 8a 1f ee e9 0f 60 c4 b8 a5 bb d4 +62 c6 34 37 9a b3 da 19 ff eb a6 e0 31 b4 24 3a +83 50 9c ee ed 6e 01 2a 91 63 c6 14 5c f7 05 02 +a9 fb 0c 21 db 31 fa d5 ad 14 69 5d e0 02 62 e4 +e5 67 09 5e 16 11 0c 6e 65 d6 bc b9 cc 02 e9 19 +f9 0d 19 e7 30 7f 44 34 50 3f 9f e0 2c 12 c1 d3 +f5 0c c1 60 08 6f e4 60 29 8c 88 12 25 bf f2 e9 +e3 13 da 38 44 44 be c7 2a 67 ac 34 44 67 e8 2b +66 + +# PKCS#1 v1.5 Signature Example 12.8 + +# ----------------- + +# Message to be signed: +98 cb c9 1f d4 9b 50 7c 88 7e 97 c3 cf a9 b5 9c +26 00 1f ca c1 64 87 f6 00 4f 0b 68 74 54 63 20 +02 d5 49 b5 46 1f f1 53 0c 0f 5f c0 9a ac c4 6a +da da 7d c9 d7 b3 e2 0f ed fe ec d8 f2 f1 68 41 +77 32 68 54 2e 86 43 1c 7f b4 d1 63 f3 1e 8e 31 +72 20 34 26 bc 0d 88 a2 3b 13 76 34 bf c7 14 01 +72 20 fb fb ec 88 8e 01 e3 ef f7 bb bd f9 3f 08 +3b 88 fd d6 40 7d 98 9b cc 5e cb 15 3c 9c ee 34 +10 fd 00 6b cd f0 7a f2 28 79 0f d5 e0 4f 5c 0a +1b 63 64 8d 48 60 9b f1 63 c6 fd 65 60 20 75 7c +3c 06 38 e1 b8 2d 75 e2 b4 b9 08 b7 e0 a3 c8 d7 +26 6b 80 1f 60 fc 2b 4f 31 7e bb 8b f2 2a b9 e1 +cb 7b 77 84 39 5b d7 b4 24 32 9e 86 1d 47 86 61 +f6 dc 12 98 51 5f 48 56 4a 3f f9 97 35 bb 90 03 +38 75 a2 5b e8 b7 24 f3 + +# Signature: +0f 2d 7a 5e ab 83 58 45 03 d9 4e bf 7d de 9e ed +49 41 10 be 94 ed 64 8a f0 cf 6e 89 1b 06 2d 2c +9d ef 95 87 55 b1 a3 08 48 8d 16 70 74 29 51 ec +00 60 54 5d 2e c4 3f e8 4a ec 89 01 ad f4 fe 8d +67 aa e5 7a 31 9f 49 1c 85 c2 1c d7 f9 c5 99 81 +3c eb 9d f8 47 78 ad c8 2a 33 c4 e7 67 4d 7f be +13 48 dc 20 75 51 10 4f 54 42 ac d6 84 86 9a c2 +2c ac 51 6c c9 88 7f d1 d0 21 ef cc 54 ab da f2 +b6 + +# PKCS#1 v1.5 Signature Example 12.9 + +# ----------------- + +# Message to be signed: +3e ed 6b f1 16 cb 31 e0 fd d4 c5 c9 33 58 ba b6 +8f bf a8 b5 c5 15 bc ab f9 05 1c df 95 a2 43 e5 +ee 68 15 15 4e eb 4a c1 0f 52 31 d0 49 38 13 e2 +81 49 e9 68 2b b1 c8 b7 7a 6e 13 60 b2 b2 c0 f9 +c3 16 1e 41 7e f6 cb 3d 9a bb dc 74 2c e0 25 fa +fc d5 38 c7 7c 4d 07 16 49 1d a5 4b cd f1 67 b4 +7a 61 a0 35 27 c9 6e 4b 42 bf dc 98 5b 17 87 81 +b6 92 0f 60 f1 1c d5 fa 76 66 3f 56 f3 19 f4 50 +cc 2a 7f 13 bc ce 59 e4 1c b6 66 + +# Signature: +07 67 3f a6 83 e0 98 bf a2 b9 55 b6 c3 4e 9c e8 +ec cc 5a b0 ab 4c 2c f7 9b 9b e1 e6 64 42 5a 7c +17 7a 47 d5 32 0c d5 70 86 f9 51 89 18 45 09 4b +1f bb c9 de e5 f9 b5 56 df 3e 61 e7 e6 69 73 d6 +3e 69 c9 da 17 29 6f e6 15 d6 33 c8 62 18 dc a3 +99 25 8c 04 f8 05 bd 04 d9 dc 97 a2 9f 39 d6 06 +ff 8e 9c 0a 13 71 aa ee c0 03 ea 27 48 95 ff 7b +a1 50 2b 28 f8 17 63 02 c2 4e ec e5 b5 28 d6 71 +00 + +# PKCS#1 v1.5 Signature Example 12.10 + +# ----------------- + +# Message to be signed: +08 4e c2 87 86 5e 8f e6 88 04 72 37 20 97 ad 5b +96 4c 40 a9 35 ee d1 be a5 1a b1 b5 bc 75 c8 46 +bb cb d9 54 88 e9 ec c3 63 cf 07 3a 90 b2 0b e8 +b6 79 36 46 22 f3 45 e1 22 d0 56 6a cd 34 a4 ae +11 24 45 25 a3 8f 47 dc 1f 92 b1 7f 89 ed e0 6d +83 6b 44 26 ec bb ea 79 33 ac 0e 84 7e 55 10 33 +b5 f7 ea 4e af 1f 63 f3 47 9d b7 ea f8 02 c9 96 +de 92 33 86 cd 15 b1 22 de 5a 23 98 d3 f3 97 02 +c3 e9 06 5c 32 73 95 b9 a9 95 fa 25 4d e9 c7 ad +b4 51 + +# Signature: +13 a7 f0 04 c0 a8 8d 51 3e 2f 1a ae ab 41 7f a0 +b2 70 2f b9 3b 82 87 20 cc d8 00 cb b0 af 5a 19 +65 72 5b 6e e0 58 71 17 cb cb 81 a4 63 18 52 1c +95 0d d8 46 9b d8 55 73 f5 d2 9d 86 53 03 eb ac +45 c7 f6 03 1c 6f 93 78 eb 12 b4 2f 05 09 44 31 +6f 0b 93 db 89 9b ec 93 7d 5d 0f 58 ed 40 70 04 +01 cd 32 65 a6 a4 4b 09 bb 11 a4 38 ee a0 77 15 +ef e4 2d e4 e8 80 8f 88 24 02 61 14 8e 8d e2 93 +ed + +# PKCS#1 v1.5 Signature Example 12.11 + +# ----------------- + +# Message to be signed: +61 07 00 00 7c 3c 6c b0 96 c9 94 d6 5d 95 c9 b9 +a1 47 c3 46 14 cd 72 2f 29 eb c5 e0 93 78 6f 79 +09 48 02 14 1a 31 08 d2 ec 8a 87 4c 53 18 7e b0 +d6 ee 2a 85 91 38 cf bc 29 22 15 06 d0 bd 89 b0 +f3 db ef 50 6b d1 ba 40 36 b0 f1 ec 00 73 32 70 +60 75 2b 42 8c fa 12 db 28 0c 53 aa e5 f3 e3 57 +0e 91 8c b0 9b 90 e9 84 7f 1f 5c a4 48 7a 6b f3 +ed ad 42 5f 78 40 7e cb e3 f9 bc 7c ab 00 75 66 +58 79 43 1c 6c c3 9e 0c 7e 67 00 60 67 41 8b ee +8d 0d b5 e7 db e1 2d a7 16 ca + +# Signature: +1e be af 85 d1 8f 37 84 0e 8a 3e af 07 d6 9f 52 +4d 88 3f a4 2f 29 1e 20 07 db 59 5a d6 93 0e 8d +5a 75 b4 0b b9 5b eb 72 d7 ce d0 38 17 97 47 e9 +66 1d 08 38 40 d5 87 dc df 21 c3 ad c7 d4 7a 01 +f6 ec a9 c7 bf 9e 2a 98 87 75 1b 36 d1 ab af 25 +a3 13 fc 29 d7 f8 34 d2 a2 48 29 85 57 5e 1b e2 +4b c4 ef 43 a5 7e f4 b0 a6 83 69 93 e1 1b 67 07 +85 04 e3 b7 9c 72 17 75 f5 b9 9b fa cc c4 8a 8c +34 + +# PKCS#1 v1.5 Signature Example 12.12 + +# ----------------- + +# Message to be signed: +da 31 f9 be 26 09 + +# Signature: +1d 2b ba fc a4 1c a0 6c 4b 81 1c b9 d8 36 96 87 +16 6d 14 d9 f9 2c 5b 98 fc 7c 77 2f 2d 75 d3 5a +5f 9a cc e5 9b 99 ef b2 dc b9 7d cc bb c8 6d 7f +d6 b4 ae 8b ea b1 e9 81 e6 c7 74 5a 1b fb 4c 1f +44 a4 72 b2 ad 07 d4 1c c1 75 15 b7 b1 4a 49 99 +0b 24 34 42 ff 2c 8f e5 05 b1 84 9f a9 91 ca cf +68 09 a2 0e 55 f2 af 77 98 87 0d 65 77 6f 1f 9e +e4 87 97 e3 13 aa 66 a4 7e 69 5f 3e 73 1b 2c 7f +30 + +# PKCS#1 v1.5 Signature Example 12.13 + +# ----------------- + +# Message to be signed: +f9 8b e5 2d 9a 5e 55 ad 92 + +# Signature: +29 2e a3 4d 3e 61 18 bf 8c d0 54 e2 15 17 e8 63 +ce 7c b7 dd 72 73 30 8f 7e cf ea cf 9b 45 75 83 +d9 b9 b9 7c 54 ab f7 4e 5a 5c a3 6a 87 06 7e 47 +d6 7a a0 47 a1 c2 ed 7a 23 d0 55 ab 4f 09 4a 83 +c4 39 ef 8d d2 d0 20 35 ef 05 62 d9 67 31 3d 81 +10 2f c6 8b 74 52 5b b0 e1 d7 96 2e b2 75 8e c5 +e5 ae ab 65 a9 3d 2e c8 e6 55 40 5a f8 8c 00 fa +35 f5 9d e9 d0 cd 80 45 ab d3 71 73 b9 fc 6c 51 +d8 + +# PKCS#1 v1.5 Signature Example 12.14 + +# ----------------- + +# Message to be signed: +f4 38 ef f8 4c 37 3f c1 27 44 a3 84 15 82 43 dd +97 f4 36 5e 87 d7 1e 8b 56 b2 97 91 df 44 ad f3 +49 e7 62 60 04 a2 c5 33 35 ec 63 52 cc e2 ed d9 +63 94 7f d2 39 38 93 c2 48 ba 1b 84 08 42 ca 77 +6c 31 72 9f 70 7a f5 04 11 00 1c 28 7f ba 8f e7 +25 02 32 0c 44 5b b1 43 fb 7b f5 39 4e c1 fb 2c +d5 01 59 24 32 15 40 91 de 5a 23 65 d6 78 f3 57 +82 fe a8 b4 7f 64 d6 09 19 f0 f1 d5 af a7 62 6c +40 d1 6c ec 19 bf e0 25 d1 16 f4 2d 22 e2 0a db +56 37 5a d7 70 89 f9 a9 33 81 fd 78 b7 b1 51 1c +b4 e4 98 4d 2d dc 7c 9d 75 b3 10 f2 95 42 25 60 +d6 6e 36 02 a8 71 20 96 16 13 1a 84 71 43 dd 07 +8f 23 58 7d b5 02 dd a0 3e 18 60 64 82 db be 01 +4e a0 83 b7 ec 16 1b + +# Signature: +0e af eb f1 5d 84 ee 4a 13 f1 a8 2b 84 05 11 86 +41 e2 2e 51 da 94 d8 58 87 fc 4a 3b 11 f0 32 49 +cc 39 a0 37 45 01 07 1c 7e ef 4a ba a1 14 08 d0 +2f ae 17 86 de a3 75 88 47 9c 90 d6 27 69 85 91 +c3 ba e1 fe fd 6e 8c 40 e3 ff 4b 9f 60 61 e0 6c +12 fd d2 1c 7f 45 dd c5 b7 8d 1c bc 41 c1 57 06 +fa 20 ba 92 f9 9f 58 b2 2b e2 76 75 be e0 81 a0 +60 67 ee d1 58 f8 e2 0b f0 4a 6e 96 8f 71 9a 32 +34 + +# PKCS#1 v1.5 Signature Example 12.15 + +# ----------------- + +# Message to be signed: +fa 1c 0f 7b 10 15 a8 95 b1 a5 65 f3 29 96 b2 b8 +cc fd 86 4b 95 54 4d bb 9c f4 f6 e1 a8 41 de 92 +06 d5 57 26 fd f7 ee a2 bf 33 6a 82 9f d2 bc 12 +09 bd 21 5a ab b9 77 d2 3a 08 3f 10 ae 69 db 43 +7c a3 2d 7b fe 4c 88 25 b9 34 88 f0 1a fd f7 84 +45 8c ef 5c dd 8d ff dd 17 + +# Signature: +25 e2 2e 6d f7 fc 6b d4 e0 f6 1e bc 8d a0 63 fe +47 8a 3e d7 4d 68 f7 76 34 35 e0 e3 74 f6 52 62 +a5 d7 61 2e 86 78 59 61 22 c0 e5 b8 fa 0c 0b 12 +81 2b a9 65 3a 0f 27 38 83 c6 26 4c 6d fb 74 bb +34 40 5d 2a 04 30 43 fb b0 ab f2 af 7a 12 3d 2d +db f1 69 92 e0 9b aa 37 d7 31 d7 2e f1 99 62 65 +8a 8f b0 10 a1 0f 7d 55 62 ad 54 33 47 90 01 af +36 d3 d3 26 ea db 2e 9a be c7 b5 55 70 9d 5d 47 +e9 + +# PKCS#1 v1.5 Signature Example 12.16 + +# ----------------- + +# Message to be signed: +82 8e be 2f 51 e5 88 29 cf a6 15 26 dd ed 7e 1f +1b a3 11 db f1 06 4c 08 ac 0b b5 d6 71 6e ab 29 +8a 23 d6 3b 79 3f fd 9d 9c ea 60 22 95 98 82 3f +28 2f 10 7b 6e e8 8a 53 fd 93 e7 dd d4 8a 73 1a +21 09 ff ed c8 9a eb a2 c0 f1 6b cb 14 0a 0a 89 +dc 57 ee 8b 5d 00 0a 21 42 17 5b c7 07 bb 40 9a +ae 3a 03 9c 66 3d 01 9a 0b d9 13 c1 3f 7f f6 f6 +b9 1e 90 5a 58 9d 38 b1 50 48 5d 89 09 2d 18 a3 +a7 62 25 27 65 52 5d 98 45 66 42 5b 05 77 0d e9 +a8 be f4 43 ff 5f c1 48 33 af a4 cc ec e5 42 d4 +f2 ce f1 e7 96 f5 9f b3 a4 bf 37 cb 67 7a e4 22 +36 66 c8 2b 31 a1 6a 6c d7 01 a0 49 3c d9 96 86 +6c 84 bf cd df 85 2b 19 ff c8 9e 93 61 79 fc e8 +b9 9e 72 fd 4a fc 28 b5 11 73 af bb 25 c4 c7 + +# Signature: +16 17 55 9e 43 ba 18 2e 95 34 86 43 6f 15 b6 02 +83 1e 42 ee d2 03 c2 69 f6 53 bf 63 9c 2b 76 0b +0d 49 fb 53 2c a8 ad 01 e7 b4 af 83 72 92 55 db +55 9b cf 55 fa b3 65 9c eb ec d5 37 69 4f ef 2d +ef 9c 9e 76 2d 05 d2 32 1e d6 88 c3 f7 e2 c0 57 +33 ab 4f a8 1b 08 cf 79 fa cb 75 c3 20 0b 7a 48 +3a f0 8c b1 83 c5 09 27 cc 61 69 e4 32 f7 fc 9b +11 78 0d bf 4d 3b 72 d2 d0 b8 55 93 d8 b5 b0 18 +2a + +# PKCS#1 v1.5 Signature Example 12.17 + +# ----------------- + +# Message to be signed: +bb 4a 6e cc bd d6 de 0a c5 c3 b7 f9 97 98 10 4a +58 69 c1 cf 1a 1f ac 7f 85 9f e9 51 49 29 7e b7 +79 11 00 59 e2 69 f1 27 56 f0 8a 54 8b 66 af + +# Signature: +27 7b ae 63 e6 e3 25 3a 0e 20 4f 4e 6c 9f e8 4b +04 0b 86 4f 21 ed d4 42 6d 82 be 8f 1b 91 1b 0b +d2 81 cf 11 49 53 d4 02 09 da 2e 9a ae 13 3b cd +18 55 ef 0a 99 69 3a 94 43 c9 3f 6d d2 75 f0 58 +fd 1b b6 95 32 b6 4a 1d d7 e1 d0 e7 80 d7 52 04 +fa 8c 61 c2 eb 5d e8 82 72 cb 93 ae f0 80 f7 02 +bb 78 88 94 25 a5 f1 66 f6 3b 5b 1a 31 ec 5c 1c +26 a5 99 fa fe 58 77 42 98 b9 7d b3 14 fc 81 d0 +92 + +# PKCS#1 v1.5 Signature Example 12.18 + +# ----------------- + +# Message to be signed: +f1 d1 11 ad 08 e0 38 ca 3a b4 e5 2e 5e ab 71 01 +87 6c a9 be 62 6a 13 59 17 f4 5b 1f 9d 1b 32 ef +e4 ff 86 7a b8 a3 05 f9 49 c0 04 8b 25 f5 46 22 +61 b1 a3 49 3b 81 90 21 0f 5c fa 6b f7 e5 c3 00 +54 98 de ec c1 e1 c5 04 f3 a3 49 98 be 6a d6 ac +00 40 51 c4 e0 a3 db 2c 22 eb 5e 14 16 55 28 df +78 12 a2 0d 5c 7f 05 b9 40 ca 13 e9 38 3a e0 0d +6c d4 d0 f4 ae 3d ad 04 7a b9 c4 17 8d b6 6d 3b +80 96 0c af 0a 92 4d c9 4e b8 e0 77 09 bc db 34 +9e 90 fa 2e 10 c5 d5 26 d2 21 9c a7 6f 88 01 fd +c6 61 bd ca 6a 93 da 48 d0 45 ac 37 51 34 cc d6 +ff 7c 52 fd 15 c7 cd 3d 1f 31 af e5 04 bc e7 c0 +33 3a 89 79 e3 ce cc 53 c4 ea dd 7d 95 d4 6f a3 +b2 a9 f0 06 10 0d 6b fc 0e d5 ee 77 69 4f f1 a2 +4e 16 a5 44 de 71 46 52 90 dd dd 18 9f 01 67 03 +59 f8 c6 b5 d4 c6 b6 b9 f5 c5 7a a5 a3 8f 07 99 + +# Signature: +0d e9 42 31 c0 6a b1 87 b0 0d da 2b 34 e2 b4 cb +ac 41 f6 08 c4 8c 72 27 a6 28 2a 17 9e 58 c3 2e +f5 dd c9 76 4f a2 df c3 fb e0 21 dd b4 81 56 a6 +37 3c d6 9b 85 d3 64 d8 9b 5a 32 fa bb 2d 46 5d +05 62 d4 a1 dd 6f ca 64 78 0b 06 2a 94 71 24 a7 +fc 0b 82 e4 fe d1 2b 8b 4f 72 6a 0c 85 39 c6 cd +e2 1a f6 55 ac c8 de 1e 7b a9 d6 7b 87 b8 e7 77 +d4 8a cd 86 8a 80 db 15 31 4f 35 55 60 10 35 77 +eb + +# PKCS#1 v1.5 Signature Example 12.19 + +# ----------------- + +# Message to be signed: +9c 4e cc 4b 24 44 a4 01 bf b6 f4 b7 24 49 23 a5 +ad 33 86 c3 b8 41 67 8c f5 e6 44 7b 8a 3a 07 59 +86 c3 3f d0 01 b8 43 72 4d dd c4 21 2f f4 5a b3 +fe ca a9 0a 16 f6 b5 59 2c 51 5c c4 ee 54 ae a4 +59 34 32 16 70 96 67 8f 93 41 59 85 6d 14 c4 32 +e7 d6 d2 8d 71 b2 68 7f 54 ed 71 9e 5c 20 11 00 +68 8e 85 f2 0e 79 a9 ee 8a a4 b6 14 31 34 3d 1e +99 c2 14 35 c6 1e 8b c1 04 f2 ba d5 29 60 fc ee +e6 7b 85 03 3d 3a ee fa e4 13 ce 29 70 1e ff cb +02 b4 84 a0 31 e2 f3 19 ef 7e d0 d6 e6 9b 29 16 +ee b3 8c 4f 19 42 ba 23 c2 a1 79 0c e3 fe 09 d0 +1b 9b 9f e6 db a8 dc 21 0e aa 8f e7 3c a7 6f 1b +5b + +# Signature: +18 53 c2 1a 4a 18 54 7d 86 7b 3c ed 02 da f0 b2 +2c e8 d4 d5 af 2b 8e f5 f7 c8 fd 38 5b 81 53 64 +8d 81 83 1d 6a cb 5d a8 30 f6 77 40 25 9f fb 33 +9f 7b 90 af 48 83 81 9c 47 15 e0 8c 28 99 d4 c7 +24 6e 07 e5 bc 6e f3 cf d9 a0 4d a0 6c 43 e9 5c +77 2b e2 21 cf aa f6 95 4e f9 33 31 e5 95 ff 48 +92 1f 05 fc e8 fa 0d 42 9e 0c 99 56 2a 9c 2f 68 +eb f3 2c f1 c6 c6 bb 8b 27 4a 2e 42 d6 71 59 12 +ff + +# PKCS#1 v1.5 Signature Example 12.20 + +# ----------------- + +# Message to be signed: +c3 81 e6 03 99 86 51 66 d2 ba a0 31 45 26 83 34 +18 40 39 e0 53 35 a3 00 c2 80 4e 2b fe f5 a7 d1 +4c 44 3d 65 38 e1 6b df 9d a7 ad 1f ea 63 4e bf +e1 13 bc 82 1e 79 a4 49 b2 eb 2f 57 c2 1f ba 35 +ff cc 6a 7e 52 55 72 27 7e 8f 55 37 c7 b5 b9 79 +4d ef b3 9a ab 06 07 85 d1 99 40 02 dc f8 07 01 +2e 1d 17 91 da 94 3b 2b 75 9c 36 6b b4 24 e4 2c +9c 20 43 ce 78 8a 25 fb fe bb 87 e7 4c b0 20 b1 +1e 8e af 16 18 84 d6 67 2b be 9c 09 fb b3 b8 af +a0 61 + +# Signature: +19 90 69 57 37 53 01 8f 33 59 2a f1 5c 1d 31 31 +bf 5d 8a c4 f6 4c f6 14 d3 a0 1b f3 72 df 00 2e +b5 b5 fc 8f 82 ba 13 7f 83 dc 14 2e de 38 c5 81 +80 e7 bd a6 9c 4f 1b c7 bf 96 ec d3 fa 79 bc cb +dd b7 d9 2e 4f d8 64 c5 fa 93 3a 4d fc 60 0e 10 +83 00 8a 38 6f 4d 02 2c 20 24 ff 7e 0b 37 22 ea +fe a0 5a 1e 02 c7 a6 3e eb 40 f4 f4 c4 f6 60 c3 +24 72 a0 a7 89 23 e3 86 3a 99 44 5e 7c fe 27 00 +60 + +# ============================================= + +# Example 13: A 1031-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +70 e9 23 a5 a0 cd 8e cd f9 9b be 93 d7 d0 28 82 +95 5d 91 b6 ef e3 ce c8 6c 93 d2 1c 0a c3 01 b8 +29 3e 51 43 5b 87 8b c6 b3 4b ed 41 11 59 0e 76 +46 76 58 8b 11 6c 2a 36 a4 c7 7e d9 c9 0a 13 c1 +4d 23 e1 99 47 87 fc db 8f 5c 97 41 0f ca d4 04 +5b 85 85 70 2c ce 29 da 11 f9 7e 79 a9 7c 2e 5f +6a 5f c0 bb 8c e7 6d 15 54 a8 bc 47 96 17 20 d3 +64 05 0b f2 74 19 bf f1 68 c0 a7 ec c8 73 4c b5 +a5 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +70 e9 23 a5 a0 cd 8e cd f9 9b be 93 d7 d0 28 82 +95 5d 91 b6 ef e3 ce c8 6c 93 d2 1c 0a c3 01 b8 +29 3e 51 43 5b 87 8b c6 b3 4b ed 41 11 59 0e 76 +46 76 58 8b 11 6c 2a 36 a4 c7 7e d9 c9 0a 13 c1 +4d 23 e1 99 47 87 fc db 8f 5c 97 41 0f ca d4 04 +5b 85 85 70 2c ce 29 da 11 f9 7e 79 a9 7c 2e 5f +6a 5f c0 bb 8c e7 6d 15 54 a8 bc 47 96 17 20 d3 +64 05 0b f2 74 19 bf f1 68 c0 a7 ec c8 73 4c b5 +a5 + +# Public exponent: +01 00 01 + +# Exponent: +02 9e 10 f6 bb b7 d0 2d eb b1 a5 d5 19 0d 69 06 +ff ed eb 9d 15 4a 0f 66 db 87 80 b9 28 31 b5 96 +3e 94 84 7f 3e 7d b1 aa 91 48 fb 0e c5 57 6e 6b +a4 fe 04 d6 f2 78 32 b1 52 18 12 d3 7b 22 d9 ea +e2 80 08 e0 92 c6 7e 72 32 42 67 e1 b1 ee 45 43 +55 74 1d 8d e1 d2 a6 a0 50 74 bb 1c e5 81 8b 41 +bd 19 dc 6b 58 c8 93 7d 8a d6 40 d7 04 3f a1 1f +46 8d 6c cb ec 4a de 52 0a 9e 15 9d 60 5d 09 28 +29 + +# Prime 1: +0a b4 64 fd 6f e3 3c 45 9a b2 dc ce 5f 78 a4 d7 +4f 92 b9 97 d4 bf 54 2e 2d 85 4e 76 2c 85 86 fc +43 57 cc 58 cb 33 36 33 b0 95 a5 ee 04 a0 32 48 +53 64 d7 0f 67 a3 aa 04 85 4c 7a 87 a6 9c f4 c2 +ad + +# Prime 2: +0a 8c 3c c5 04 13 40 f4 32 fe 0a 78 73 13 57 79 +16 fe 76 c0 39 f9 71 75 9e c5 0e d6 c5 b9 a7 36 +9b 68 96 9e cb 52 59 fe 9c 50 d0 75 9b f8 b3 aa +c1 a5 d5 b5 28 8d 67 89 e7 18 fa 37 ef 42 39 95 +d9 + +# Prime exponent 1: +bb 29 5a 95 d5 b3 3c 1d c0 b1 8b f6 c1 4a a0 d9 +f2 6f 72 8b 39 36 0a a1 59 45 6e 94 c3 d9 e0 48 +c9 2a 4f b6 31 1d 36 92 8c e5 f4 47 a4 99 4a 8f +47 87 d8 a9 7f 68 11 3e f9 66 34 f5 90 2a b7 51 + +# Prime exponent 2: +02 fa 11 2c 89 39 e5 db 05 89 2c eb 51 8e e3 e1 +08 dc 48 27 78 35 2e 10 43 fe d9 71 43 dc 61 94 +c7 c7 7c ba d4 27 29 be f1 de dc f6 54 4e 9c 66 +54 c0 b8 cf a7 e2 40 96 6a e2 61 bb e7 8a 89 36 +01 + +# Coefficient: +a8 8b f3 ff e9 3f 40 4e 06 82 1c 97 71 ea e6 08 +15 71 2d 6f 94 52 71 f6 f3 6f 03 69 d9 66 c9 20 +c7 f8 cb c7 84 25 ac bb 9c e0 fa 1a 03 22 f5 0c +97 b8 11 5b d1 51 91 f2 24 b5 68 d1 d6 ec a6 db + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 13.1 + +# ----------------- + +# Message to be signed: +b5 e8 6c 8b a3 98 5a a5 54 1d f9 5e 51 3c ff 67 +61 2e af 2e 16 68 85 76 f7 d6 73 f6 f1 89 1f b7 +5c 9d d2 cd + +# Signature: +6b 42 fd 51 63 09 19 7f 8a f3 c7 3e 39 62 4d 8e +ba be cd a3 ec 3c e6 57 b1 11 7f 43 e9 83 87 7a +1b a1 aa f8 e9 5c c3 99 91 d9 2e 35 e2 db 1e 41 +30 90 14 3d 16 46 71 98 b9 b9 a9 90 d7 74 c2 7a +d3 bb b4 35 2d 3f 07 5d 61 73 2c 6b 58 ec 0f 66 +e4 92 a3 f7 ac 4b bc f0 12 ed 6b 40 1f eb 4f f3 +95 cb 8b 21 8a 81 d6 17 31 ee ce 37 6f 68 8e 66 +ae a6 98 b4 a8 86 2f 58 c9 1d 87 60 85 49 6f d0 +14 + +# PKCS#1 v1.5 Signature Example 13.2 + +# ----------------- + +# Message to be signed: +95 46 34 6c f2 21 94 c7 87 88 81 70 a4 82 f7 f4 +92 17 c3 94 0d c6 21 0c e3 9e 45 50 a3 9b 45 28 +22 41 9a ea c2 4b ec 19 8b b3 59 d0 8b e8 19 6d +f2 e7 57 76 61 96 c9 58 e2 b1 59 c7 4c 1c 30 23 +c2 db cc e9 ed 5d 0e f3 fb 51 45 0b ff 64 45 db +26 5e 60 6e 19 4b ee 06 4c a5 b3 21 d7 e1 55 14 +23 0c 2b 3b 55 d5 da 4c d0 40 52 2f 7b b8 6a 96 +2b 81 3f 9d a3 9e 51 38 9b c6 4f 56 e4 47 b2 a2 +bf 81 9d 7a 80 09 4e 2b 8d e2 7f 10 4b b6 eb 2f +2f b4 3a f1 d0 1e ad ca 23 a1 96 ba 12 5b 6a 78 +57 99 74 c0 ee c8 a5 49 67 71 f6 7d bd 50 69 f3 +36 e4 ef 1f 40 47 42 df c6 9c e3 25 aa 64 9f 8a +63 31 cf 40 35 55 e1 3f 08 10 a7 63 50 a7 e1 8d +29 92 fa b4 8f 39 7f 3b 93 c5 bd 5a 6f e1 d2 c4 +61 8b a1 f5 9f 00 2d c2 57 ec 39 ee 2f 87 62 98 +da 90 f7 44 0a d4 c6 c9 3f c1 14 df 05 + +# Signature: +67 e4 14 99 3f 98 7a 22 64 3d d0 39 e7 f9 fe 1c +ae 74 4a 7a e4 1d 4c 04 4f a4 ed 8d c9 e3 40 ce +bb 1e 2a fb 19 8e 84 7a ef 4b c0 61 fd 80 0d 81 +d4 d3 67 b0 fc 2f 73 09 33 c1 9b 88 d4 dd f0 5e +d9 8a 58 56 de 5e b4 5b 11 6b 7d 24 fe b4 56 77 +84 9d ab 76 e9 e0 cc b4 5b a6 b6 f6 14 1f 37 bb +ad 7c 19 1c 37 77 11 3b c7 38 8e 4e 46 44 ec a9 +47 03 a7 2b dd cc 6f 50 cf 98 0e 3f 6d e3 9d 73 +12 + +# PKCS#1 v1.5 Signature Example 13.3 + +# ----------------- + +# Message to be signed: +56 52 b4 c5 75 20 b2 55 fb 96 f7 0a 30 ab 92 ee +c1 93 99 56 b6 a9 43 c8 3e d0 98 6e 2e 6e e4 ef +bf 8a 52 28 78 67 28 12 03 a7 a6 d1 d8 86 b7 00 +59 52 b4 3b 77 85 44 ed a8 98 e0 df 2f a0 6f 68 +38 03 18 f1 4a 53 fe 55 d7 2f 8c fa 6a f2 1d 93 +bb fc 20 d3 58 c2 08 c5 62 d7 39 be 00 01 ce 07 +fd 8c d2 f4 6c 3b 44 c8 36 51 88 09 b7 6f 3a 70 +cf 69 26 be 06 9c 35 75 d5 + +# Signature: +01 64 11 a2 31 a7 38 94 4b 3e 44 f7 88 5c f8 1a +ca b7 32 d1 73 6d e3 4c 56 cf 40 f9 9a 6c e4 00 +70 a2 0a a9 4c 48 78 44 a9 3c ef 28 7a 58 bc 0e +a1 81 b2 cf 27 d9 14 f2 93 b9 29 77 9d 39 03 6c +4e 5a ae d3 5e ee 8a 7f d5 0e fd 09 6c 91 a8 f7 +2c 3c 14 1c 57 6c 8d 10 b6 36 fc 4d dc 1e 67 14 +f1 7f fc ce 10 6d 22 1b 4f d7 d6 fe 1e 7c bd 3f +3b 08 f5 54 6b 44 d1 fe b7 18 fb c1 33 70 c7 fa +2c + +# PKCS#1 v1.5 Signature Example 13.4 + +# ----------------- + +# Message to be signed: +6d 57 f0 79 a3 e8 ad cb 47 cf 2e 3c a9 76 e0 3b +09 c7 7d 1d 9d 9d 84 84 35 7e 91 23 09 e8 f4 a8 +3c b5 0c b6 a7 38 8c 41 4a ec 84 46 71 ff 81 06 +51 e8 28 10 3a 1f 6a 19 9b e2 60 f7 46 00 02 8c +6a 7b 7b b9 41 6c e7 b6 35 0a 3a 68 05 62 0c f5 +e6 b0 09 5d fa 22 b5 46 01 f6 19 af d1 0d a2 03 +d2 81 90 cf 9b 0d b5 98 6d 29 30 33 69 1e c5 bb +ba 6d 73 ea 32 47 2e fa 3f 16 0f d2 b1 b5 e4 3b +0b fa d3 16 77 30 5f ef 46 72 44 11 4e e1 0f 5c +b2 d6 7b 47 83 23 a7 11 04 1e 29 4c 46 b2 ed 39 +cc de 07 9c 87 7f e7 5c b8 75 14 4a c3 1e b0 31 +a7 38 a4 ce fe f9 1f 01 7b a7 15 23 f5 12 48 18 +cf 48 b9 72 bc 47 c8 f2 ed 35 6f 5b f6 91 fd 94 +67 0b b2 + +# Signature: +31 5c e4 17 d0 bb d7 3e 7c 43 56 79 7e 73 ed 7a +bf e9 fc ff f1 a5 34 28 99 a7 d1 1f b0 d0 54 2b +fc ab 66 de 2e 4e c0 7c 7d c2 be 7d 79 72 90 a3 +0d b8 c4 07 dd 16 37 65 88 a6 dc c1 a2 07 bf 7f +f3 11 54 0f aa 9d d6 f1 9a 73 ab 25 a7 49 6e 68 +2f a8 a7 05 40 81 07 6c 1a 02 15 7b e6 3e 7f 64 +5d e8 2d f7 c6 15 50 3f a8 3b 4e db a2 05 81 81 +2e 09 7f 65 05 6e d4 17 f6 f2 48 03 53 0c f8 18 +58 + +# PKCS#1 v1.5 Signature Example 13.5 + +# ----------------- + +# Message to be signed: +bb 75 44 6f 78 78 23 dd a2 42 2b 1a dc 7d 7f ef +d0 6a 6e 9a f5 c0 49 01 ac 5b 99 91 3a d6 29 8c +9d 1a 33 22 e8 b2 17 e4 e0 99 4c 42 20 42 80 d4 +04 d0 1e ce b5 ec 53 fb 86 f7 61 a3 96 b2 3a e1 +9d 46 79 05 a0 fe 80 50 b8 95 d8 ba 37 46 68 5c +47 43 9f 90 c3 66 9c 70 ff b8 19 94 56 5c 4d f2 +a3 1e b2 a4 52 bc 3c b3 12 b8 14 7c ec 19 10 32 +f3 8f 3b 3d 89 d7 58 2b f1 8e 7b 72 75 fb 4f 16 +ee 89 56 7e 2a 56 bc 73 b3 e2 e1 09 f9 94 0e bd +10 b9 df 2b 88 ac cf 0b a1 8e 5b 34 95 20 d2 c7 +f5 a3 1b d5 22 6d 12 ec 35 bf c9 e3 62 03 e1 35 +06 ba 12 b7 56 c8 ba 00 af 91 b8 5b 0b 4c 07 c7 +f4 84 ad c4 58 c9 26 aa eb 4f 08 2f ec 98 7d 9f +27 6b 89 49 59 7e c0 40 1b b7 1a 2f ea 9c 7b 74 +e0 df e6 aa 52 ac 8b 80 be ea d3 36 a4 9d b2 2f +b3 + +# Signature: +53 d0 d7 95 bb 08 2f 20 01 03 6f 47 2c 2e ce 6e +7d 2d b6 9f 29 2d a7 21 36 75 c7 cb ba 0d 33 b2 +32 12 f8 f4 3a 4a 8e 09 a6 a5 0e 01 9b bd d5 9a +58 89 8c c4 6c 58 a4 6e 42 ce 7b a0 93 fb 46 92 +f3 83 de 33 a9 a3 4f 47 c7 e6 19 38 bf 8a 6a da +a8 8d f2 12 96 b4 c6 7b 52 68 35 f7 57 f2 c2 6c +1d 30 9d 7c dd 5a d5 fd 8f 61 f8 51 ed 23 c4 be +2a bb 62 7d fd 81 7f 84 77 dc 04 2b 6a 2e 40 69 +40 + +# PKCS#1 v1.5 Signature Example 13.6 + +# ----------------- + +# Message to be signed: +88 39 39 d1 49 a5 44 e6 2e f0 4c 61 03 51 a2 df +a2 52 eb 9a 9d 1e 11 ae 54 c9 b0 7e bc f1 fd c4 +7e c1 d9 47 03 41 1d a4 15 f5 9f b3 e5 04 1e d9 +47 0e 7b cc 81 9b 5a fe af 86 0c 01 6e f1 25 bd +08 a6 cb 8b cd f3 b9 3a 51 dc ad b2 f6 8c 8c c3 +77 55 14 28 2a ff 75 67 ec 65 f2 70 d0 2b eb 95 +fb 8f ac 24 09 5e 17 06 e4 8b 52 48 65 bc 14 46 +1d 3e ce 8c 50 1c 3d 80 2a de 98 5a e9 5c fe 1a +b9 d6 b9 ab 0d 15 fc c8 86 6f 7f 25 9c 5e 41 c0 +2c d4 13 43 7e 7d 6b a7 f1 5b 0a 70 da fb d5 5c +0e db 6b 80 75 c2 7c ff 3b 28 9e 6c 99 e9 a8 84 +ff 7f 08 6d a9 f7 5d 6a 4c bb cc af 52 ba 25 c6 +34 2c 38 a7 6b 44 e1 01 15 5d f7 55 e3 9c 14 86 +2e 22 0c a3 6f fb cc 83 2a fe cb a8 7f 8a bd 96 +0a 57 7f 56 ca 6c d8 e9 91 26 65 8f 27 ac 6e 53 +c4 42 ed 47 66 + +# Signature: +1e c0 2a e6 a0 a3 f6 11 99 29 61 ca 27 cc bf 29 +6e 11 36 18 32 e1 ee 75 20 56 9a 9a ee 06 34 5c +da 22 b4 fa 48 fc 34 5e 47 78 bc 3c cd fe bd 2d +c5 a6 c9 d4 84 51 aa 44 1b ea 4b 95 11 99 65 4a +e8 d2 f7 52 2e 17 ed bc 2f 51 ce 15 cb cd 36 6f +49 39 cb 53 c3 b7 70 81 f4 a7 37 50 05 4e 00 b3 +0b a2 fe 58 f6 f0 2e 36 a8 62 54 23 97 db a6 a3 +cd 22 77 70 88 19 e7 8a 2d 87 6a 23 a5 a2 69 d7 +75 + +# PKCS#1 v1.5 Signature Example 13.7 + +# ----------------- + +# Message to be signed: +40 31 e0 de f4 f3 d1 ad 9b c0 82 77 0a 88 a1 d9 +b4 b7 10 75 48 cd f8 46 2b 0b ae 3d 99 4d 8e bc +4d a0 44 b9 05 dd 8e d9 1a 1d a6 76 72 78 22 36 +0e e2 b6 d5 e1 2b b7 03 16 d7 9e 8a bb 82 a6 43 +44 af b3 b2 25 88 5c + +# Signature: +0b e5 a6 d0 43 be 5d 27 d1 d5 1d 9e 3a a6 1d 92 +c9 d8 43 23 11 9b 48 c8 4a 80 38 97 18 d7 a1 aa +f5 7a 9a 0d 21 4f 65 06 48 48 64 df ae 85 db 7b +84 74 07 3a 8f 97 7b 42 b5 3b 40 7e 44 c7 c6 2b +16 8d 1e 77 78 f4 f2 78 57 bf ba 85 dd dc 8b 0e +9f 0e 9a 5b 6d e7 1a 04 43 72 0e 92 bb 88 b0 77 +cb a1 5d 3f 6e 2b e4 d2 7a 7c 50 9c 7d c0 3f 1f +dd 4f e3 38 a4 e5 45 c4 6c 03 45 22 cc c0 d4 5d +4c + +# PKCS#1 v1.5 Signature Example 13.8 + +# ----------------- + +# Message to be signed: +7f dc 96 a4 56 57 74 02 9f ff a9 3b 39 f0 5d ee +9f 84 fa 89 53 fd 0f 63 38 c8 1c 9d ec 6c dd 66 +1f fa b9 6f 0e 08 eb 0b 9b a9 ca 5b e1 7b 57 c4 +b4 86 8f d5 34 11 54 de 50 27 71 13 c7 18 53 41 + +# Signature: +1d d2 1f a4 95 be 7c 49 0f 98 2f 69 ea b1 4e 24 +da a0 4b d1 38 b7 14 32 49 cd cc d7 8c cf c9 10 +6a ca a0 3e c8 76 69 42 32 56 6e c6 ca b9 12 28 +40 f6 69 c8 00 f2 ee 09 2b b9 b6 cb 2a 45 42 a9 +0d e6 04 c4 f1 05 00 0a 3a 0d ec cd 3d d9 7a 32 +61 fa 38 22 7e b3 81 a1 f8 f2 3b 66 65 d2 84 80 +df b7 21 17 88 2e d8 db 25 d7 6d e4 0d e2 fb e7 +2d c3 94 ec 6f bd aa 99 c6 4f ad e7 29 78 a5 1f +c4 + +# PKCS#1 v1.5 Signature Example 13.9 + +# ----------------- + +# Message to be signed: +63 18 32 ab 19 18 cd 02 08 28 e4 7a e2 b4 47 6b +14 69 f2 72 e3 0e 53 e5 96 fb a2 6b 40 29 37 dc +44 c2 ea 57 45 c7 9d 2d c6 4a 10 e1 22 5c a0 b6 +92 9d 49 54 bc 5d 37 40 96 fd 87 8d d1 01 f7 66 +63 13 d9 a8 f8 26 bc 67 14 01 42 2c 1c fe 1a 6d +01 a4 d7 86 4a 14 c6 0c eb c2 f0 70 91 4c ee de +b1 78 2f e5 40 a0 a5 d2 57 84 44 f9 b3 60 34 ec +77 d6 b8 03 a0 c9 76 1b 32 75 92 aa 48 46 63 5c +56 3f 1c 6a 6d f6 8f aa bc e4 97 af 4d c9 a3 64 +2b 75 a4 a2 94 d3 08 56 8e 6d 73 c1 1d b5 67 24 +04 2b 55 c3 a2 4a 7b c7 a1 05 0e 4f 44 8b 6a + +# Signature: +45 d3 a6 ae 8f 48 35 5c 01 2b 50 10 79 ee 92 af +fe 3c 9e 60 2e 4a 08 0c fc 94 72 3a e9 6d ac 2a +66 e4 55 a4 0e 72 8b 2a 1b 27 e6 22 40 55 4e c7 +c5 c0 ad 6a a0 0c 09 22 e5 3d 7b 12 ed 42 c0 87 +32 2d 15 36 e4 6b 7d eb da 80 95 f5 5d 1e 12 bc +24 42 f4 3b 4d 12 8f ee 23 1d cd 6f 8c 37 aa 6b +cf 4f e7 b5 e0 de a9 c6 70 9d 3d 91 f9 e4 2a 53 +16 8a 16 b6 fe 99 7b 5d fe ba fb 46 ed 9a ea 5c +66 + +# PKCS#1 v1.5 Signature Example 13.10 + +# ----------------- + +# Message to be signed: +8b 04 3d 90 da e3 41 66 85 d5 3a 5b 4c 3c c2 54 +cd a0 cb d2 3b 4e 40 8d e8 20 a4 da 7a de 6d d9 +5d 4e 1a 97 e2 31 2c 3e 84 26 1e e0 b6 ce fe 60 +e6 b0 82 fd 59 65 ef a1 64 8f 4f ae 61 60 5f e3 +55 33 27 00 46 96 05 26 53 47 e6 54 7a ea 77 5b +85 6e 5a 46 c3 41 d2 99 52 bb ea 92 70 49 96 3e +37 40 20 8c fb 0b 65 28 57 b6 f5 2e 36 6a 17 0b +e3 4f 13 d3 58 46 bd e6 97 20 46 20 01 b0 9d d2 +68 b8 9b 09 00 31 8e 73 3d b2 00 9e fd 9b 51 77 +41 e5 10 d3 f3 94 f7 ad b5 45 59 b1 57 + +# Signature: +6b 27 8f 36 2c 29 2e ea 09 b9 0b f3 53 d1 43 f2 +ca 09 9f f8 79 57 34 79 df 2a ff 9b 25 0d 1c 91 +87 c6 a3 34 3e a1 4c 07 6f 2a 20 c1 a1 9d b2 6a +ad 35 48 ec 6f b3 b2 fa fc 75 1b 59 08 2d 8b 23 +c8 2c 8a 51 f7 fa f7 a4 d4 a8 23 98 bf be d4 49 +bd e4 ee 9d c8 68 01 60 66 6f d9 c7 74 c6 aa 57 +7b 4e c5 4c f0 d5 bd 9e 3d 1a fa 9c 3b 4b 91 46 +76 78 c9 d4 c4 fe 40 0a a8 57 a3 b0 54 5b df 84 +a6 + +# PKCS#1 v1.5 Signature Example 13.11 + +# ----------------- + +# Message to be signed: +3b 28 a6 09 2e 47 08 98 af 07 0a 08 7c 45 53 18 +8d e6 c3 44 bb 0b 5f dc 7f 66 fb c5 2d c9 3a 8b +92 a3 74 11 20 37 d6 a4 32 86 12 8a ce f9 5a 35 +05 c0 ab b1 af a6 2c 48 cb 21 36 07 7f 8a 0e 0e +0b 5a 4e e9 b2 c7 7d 7a 0c 0b 53 f3 8a 51 cc 3d +b9 b5 83 b3 ae c0 7f 1e 22 4f cb 3f 1d ad 19 5e +05 86 59 a9 d1 1f 8e dc 74 44 99 46 86 ed 62 c9 +75 66 e9 e0 0c bf 8f 0d bc 17 16 e6 b7 f0 f8 8f +e8 9a 86 7a 41 d6 43 13 5a d8 b1 8a a1 43 e7 37 +5d f1 95 29 + +# Signature: +32 62 fe 17 e4 4e 5e cc 84 31 70 d3 ae 27 51 da +1f 48 d6 e9 61 d8 1e 93 59 b0 98 2c 6d 61 30 8e +ba cf e2 60 7c 53 8c 17 0c e0 e7 2a 07 bc 01 48 +7b 29 5c 36 b8 e2 2a fd f6 e7 fe 39 c0 3a 5c 0c +36 61 06 1f 23 fb f5 89 0e ad 59 f8 72 c9 46 cc +e0 f8 16 c9 ed 3a 2c 1e 11 f8 f7 4d a1 e9 7a 39 +0d 53 4d 78 55 78 a2 45 5f cd 87 47 83 f4 57 2a +15 f4 93 7d ca 98 09 3f d0 e9 99 0a f0 00 52 56 +bf + +# PKCS#1 v1.5 Signature Example 13.12 + +# ----------------- + +# Message to be signed: +4f dd 6a 36 31 dd d4 bc 3c 76 07 19 02 a2 27 fd +5b 36 53 b1 f9 70 f2 b7 67 ef 55 4e 1c 75 ca de +81 9d 8d 1f ca 76 bc 10 54 1c bf 8b 1d 8b 0e 72 +55 f9 57 40 + +# Signature: +29 cb a5 b4 3f a3 56 57 75 89 34 91 b1 18 57 8b +14 b5 fa 1e eb e0 c8 07 59 a6 d1 91 e7 c2 13 1e +e1 0a c5 b9 b8 ae 1a a7 d6 96 c9 84 88 a3 5c df +a2 aa 00 6d 91 bf 7e 05 a5 c1 90 9e fb 20 da bc +82 13 3b 62 64 c0 42 18 0c 2c ca 65 45 9f 66 cc +7e b1 ba 75 d1 5d 4f 56 c7 52 8a ab 28 38 e6 79 +53 7a 4c 8d cd 37 d4 b4 ca 82 5c e1 65 fa 4a 97 +15 82 44 dc 87 c0 61 fb 12 00 1e 55 33 fb d4 cc +62 + +# PKCS#1 v1.5 Signature Example 13.13 + +# ----------------- + +# Message to be signed: +59 0c d2 30 50 e5 7b 28 d5 c2 18 5e ad 60 b1 e9 +52 9f 2b d5 26 13 eb 03 f6 ed 1a ef a4 a6 72 88 +d5 a3 a3 4f d9 5c a6 38 94 af 3a 40 cd 68 87 3a +1f 37 e3 54 d3 04 14 29 7b 19 25 4b c6 c1 a3 f7 +a4 75 20 ee a5 6e ff 77 db fd a6 bd 77 79 d0 2f +d8 16 fc 0e 99 91 9f e4 39 5e ae e5 b2 f5 f0 32 +cf c4 33 6f 9c f9 ac ef 74 db bf 4c 9a 09 18 da +65 58 b4 b4 e3 20 9b fc d7 1d dd 59 76 07 b6 e2 +8c 39 85 db f5 2c a7 d1 d7 51 cb 81 69 c0 b1 b1 +3f f8 b6 5b 73 1e 69 dd 2e ff e4 4c 63 6f 2b 69 +95 35 83 1a eb 5e 62 90 2f + +# Signature: +67 eb 89 57 ce 4c 06 f7 39 1d 00 c7 41 24 53 f4 +b6 8b 33 03 a1 29 25 54 e2 a5 fc 72 62 c5 2e 74 +be d7 0e c5 8c 89 50 cd c4 31 5a 8f b7 c6 80 15 +54 cd 35 78 1d 44 fb 5e 57 d6 8d 59 a0 0f 43 b8 +6d 53 b8 43 72 d5 56 e5 a4 15 3c be 6b 39 7c 4c +9c 68 00 70 5d 2f c0 c5 48 64 5e 11 b9 d8 d5 12 +b2 dd 9b f5 9f 3d c5 d1 1c 3c 77 3d 59 cc be d9 +e6 bc 14 32 09 10 cd f8 3b 46 59 01 b7 46 b5 96 +74 + +# PKCS#1 v1.5 Signature Example 13.14 + +# ----------------- + +# Message to be signed: +80 8c b9 76 13 fd 87 85 35 80 1c 80 08 79 15 10 +a5 fe 86 6a d5 b6 84 3a 6e 00 19 a0 fc c2 17 76 +03 54 f6 0c c6 99 fb be 1a df e8 b0 0e cd 6a 36 +a2 b5 a5 a1 fa a2 3d 34 38 20 02 4e 3a 31 97 ae +67 3c + +# Signature: +1c 53 96 59 f8 72 46 99 16 fb 00 07 ef 9e 48 57 +4e 96 4e 4c 0e 6a 2f a7 4b 13 73 fd 60 b6 64 a7 +98 ac 81 29 c0 8c 12 cd bf 37 49 75 0b e1 25 60 +2a 71 54 32 67 67 32 7e 92 ba 57 b5 e2 89 b5 ac +9d 77 71 b4 52 0a 7a 2c e6 6c 5e af 70 4a fc 5a +19 0f a6 0b e1 37 6f 94 3d 2b af 70 52 3e 47 c3 +de fc 0a 25 a6 00 18 31 a3 7a ab 0c f1 f6 48 7b +e3 7f 0e 31 ca 7d b5 ac 41 b5 63 09 57 55 93 69 +ff + +# PKCS#1 v1.5 Signature Example 13.15 + +# ----------------- + +# Message to be signed: +57 ed aa 05 66 25 16 86 f6 52 05 ef c6 26 60 e2 +c2 e0 4f a5 ea a3 30 2d e8 7a 3f 6b 49 1f 7f a3 +ac 72 70 cc 76 75 1a 43 69 42 ac 76 5e f5 f4 74 +91 62 d7 e7 97 12 6b cb 8f da c1 9c f1 8d cc 6e +ff 48 59 3c 05 c8 89 3b 59 1a 51 33 2f a2 6a b8 +63 c5 ea a4 d7 51 e8 d1 b1 9c 58 26 90 b5 41 5e +6a 89 e0 5f 23 1b 33 ac 38 c5 3f 95 a2 d5 f9 10 +51 c2 ec 6d db 2b 6d ba 78 9d 55 3a db 9f 10 c5 +83 59 70 36 d3 48 6f bb 32 17 2a 1c 11 07 9e 5f +09 aa 29 eb 46 74 c8 d7 bf 5b bd 6d 05 7e 6b 87 +a8 b3 aa f4 80 86 d7 21 cb bc 8e fa c6 24 4d 32 +39 ae 18 f1 66 23 fa 52 8e 2e 70 fa 25 65 6a 6a +4a 22 92 95 0f c9 28 ed b8 1c + +# Signature: +33 73 2f cc 23 34 2c 58 51 38 b2 5b 17 c8 12 ee +3e 9d 3d a4 1f 6f fb cc 16 17 a2 ee 75 cc 5b 25 +01 25 4f d1 97 6d 25 88 00 e9 05 d7 e4 4a 0a b6 +fb 4b 8a 88 bb 7b f9 31 73 95 30 3a b2 fc a4 31 +28 48 6a 2b ab 36 c7 5e f6 aa 5e b3 fc 5b d5 55 +b3 ea 79 12 4a ad 78 97 e3 a4 34 de e7 92 63 71 +de 2d 6d 23 7e 89 b0 3b 8d d7 09 60 58 e2 a4 b3 +2c b5 57 c7 ad a2 98 a7 e2 ed d3 a3 a3 b5 29 b4 +d2 + +# PKCS#1 v1.5 Signature Example 13.16 + +# ----------------- + +# Message to be signed: +08 33 76 bb 82 21 2b f8 80 be 12 85 65 3a f2 ca +d6 25 c5 2e 94 e3 21 43 68 77 f7 25 a8 3b bd 43 +f4 48 6d 89 6c f6 7e 31 39 1b 87 06 f8 c0 f8 f4 +bb 1d db a9 5c 33 2f 03 4f 39 09 11 3f 65 56 92 +60 a2 e4 f1 04 06 65 7c 99 fa ff 00 1f e1 6e bb +89 6e 9e 18 11 5a f1 d4 98 6c 85 79 ab 56 52 cc +ca 47 74 + +# Signature: +2a f4 6c 00 d1 d9 15 94 1e 21 2a 7b 8d 81 05 ee +0f 0e c4 80 ff fb b4 f1 3b f2 8d 73 e2 b3 19 b9 +84 a7 b7 c8 36 7a dc a7 ab 12 aa f5 3a cb 98 d0 +cb 54 ee 34 20 4c 90 8e 60 c7 c7 9e fb 42 c3 11 +4a 02 58 9e 1a e6 af b5 97 53 54 57 8c 14 35 ec +c8 9c 11 6e 90 26 b6 bc 88 9e e2 88 ae 4d af 03 +47 cc ce fc 5d fd 1e f8 3c b8 68 52 ee ff d8 40 +98 59 9b 72 5b f6 02 ee 62 0b df 44 af bd 84 c0 +cd + +# PKCS#1 v1.5 Signature Example 13.17 + +# ----------------- + +# Message to be signed: +8c 87 4c d0 ce 33 51 39 c0 8d 76 0b 82 5e b9 90 +5d + +# Signature: +66 9a 8a d7 cb 81 ef 21 87 f5 a8 56 47 68 4b 72 +48 4a ff 27 9f 0a f3 54 35 86 7c c2 b0 43 33 a1 +96 ec a6 cf 44 a9 7a 1b d3 9d 0f 6a 0f f9 59 57 +02 83 5b c8 0a 72 d7 14 04 ef 3f 46 fa 3b 0d 20 +e8 6d 7a 1d 5f 7e fc 3f 3b 8e 8a 7e 37 e8 7e 27 +a9 9f eb a9 6a d8 13 20 be 8f ff 78 55 7d 07 bf +ba e2 16 03 a1 36 8c af a5 ae 1d 1b 63 0a a2 1f +f2 0e 45 85 65 0a 77 3d 7e 2f 5e 7f 51 72 97 19 +3c + +# PKCS#1 v1.5 Signature Example 13.18 + +# ----------------- + +# Message to be signed: +cb 3e 61 21 d3 8b 7d 97 e1 8b a1 5c 49 3d 1a c3 +2e 9d 2e f4 e3 bd 16 df 9c 67 e4 a1 96 e9 24 7a +8d 0c 24 b2 1c 4a b2 3e 77 d6 db 11 7d 59 11 95 +bb af 44 66 82 5f 63 97 8f 11 40 85 28 1b 79 ae +a3 7e 32 c6 b3 6c 1e 9d dd 4a d1 23 6e 97 fd 42 +7b 4d 97 6e 07 64 9d ca 4f 33 a8 9c 46 fb 8c 00 +b4 26 7b 14 47 04 + +# Signature: +56 84 17 80 3a 40 0e 9d 05 0a 43 20 ae 7b 7d 8d +24 8e 16 36 50 86 9d 9f dd 10 0c c1 a6 b9 bc 29 +1c 3f 23 f1 25 60 03 16 4f 61 9d bc 78 63 5e bd +f0 89 49 0a fa 5a a0 0b 6f 97 eb 06 36 c3 bb a8 +9d 86 36 0a fe 26 00 43 d8 61 a7 4f 64 c7 1d 9c +bd 31 ea e2 39 3a 1a f1 56 1f 1a b9 2c aa 76 dd +1e 76 ab 23 33 09 8c 83 c2 d9 9f ae 82 73 98 75 +80 05 c1 76 cb c4 a2 e2 2e fa 0e 6c 12 f4 e3 42 +81 + +# PKCS#1 v1.5 Signature Example 13.19 + +# ----------------- + +# Message to be signed: +21 9a 2f 8d 0b 00 0a ed b5 f1 85 45 5e d3 ea 09 +4c 45 42 6b 28 5b ab 4a 07 cf 3d 0a 29 06 f3 e2 +03 18 4c 2d 3d 81 a8 09 b8 9c 9f c4 8b c9 af 9a +b3 2f 84 f1 5d 81 38 9c 4e db 0a c6 8a d0 95 02 +e3 f3 0c 7c f6 45 10 29 54 b2 97 c8 66 14 66 fc +10 + +# Signature: +03 83 5d 90 57 e2 b8 21 dc 4c 6e ac a3 f4 15 6a +56 55 0b 6f 9d 74 00 fc 5c 51 95 a4 ae e4 71 7d +f3 29 29 12 2b 43 27 3a 07 9a 24 f9 9d d9 e7 c3 +40 56 ae a4 fc 4e 45 7d 83 14 ef 34 42 7f 8e 20 +4b 81 bb 49 03 fb 3e 77 9e 38 9e 41 33 90 68 c1 +57 d9 b0 9f 2c 5e 99 cc 54 e6 ef 86 ee ac 0e 19 +f4 4e 33 e7 07 c4 26 1a 0a 83 ce b4 22 f2 e0 6b +cc ae 3b 8b ba 42 8d 75 57 15 2f 40 84 6e c0 11 +34 + +# PKCS#1 v1.5 Signature Example 13.20 + +# ----------------- + +# Message to be signed: +e3 9c a4 0d 2e 9d 03 ae 05 96 f6 0e b8 f6 09 99 +30 85 a5 db 15 6b 0d 50 98 fe 5f aa c5 5f 70 99 +3f e1 76 d2 d0 c0 38 b8 60 bb f9 a6 62 43 f5 e7 +8e 6c be 52 6e cf 25 12 8d ae 31 96 56 cc 32 1e +e8 0a 50 53 14 90 c9 a6 24 3f bd b0 c5 eb 4c d6 +42 d2 61 15 05 ae 10 84 97 57 38 ad 84 62 1d 67 +f5 + +# Signature: +4f cf a5 73 97 f2 7e e0 f8 ae 75 a0 a5 4d 54 b0 +c5 1b 95 7e e6 3b f7 90 1b 60 55 cc 39 87 c3 2d +f7 22 0e 16 6a 71 60 6a bc 78 f9 11 07 f9 74 df +f7 d6 25 7c 25 6d c6 ed 7a 69 c3 c9 9f 9f 89 ab +b5 8f e5 89 b7 ee 7c ad 0f 48 c1 60 10 d0 46 a9 +c4 e0 04 bb e1 a8 29 79 68 d4 0b c7 06 82 eb ae +a4 48 52 5d be e1 6b 03 bd 0b 65 26 d0 98 d0 9b +6b ad 9a ba 03 93 05 e2 ab 79 69 02 08 65 80 cc +f0 + +# ============================================= + +# Example 14: A 1536-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +d8 70 a7 76 cd 13 ed 44 3d f3 99 08 be e2 ca d7 +3c 48 5f d9 bf 06 32 13 22 88 7f be 65 5c 08 cb +e4 c8 f6 3e 25 4f c9 1c 75 f0 55 7d 90 1d 43 5b +0e 8d ed 82 d4 91 73 41 4d 29 86 03 24 e4 6c 1b +03 0d fe aa 29 d8 0f 98 98 c2 c5 e1 01 cb f6 da +a0 62 89 78 d4 15 b5 02 de a2 6d e6 56 1c 79 ab +06 5c 6d ca 6a bc 4d 4d 4d 5e 9f 5c 74 cb 3e 6a +5a f7 1d 1f 90 fa 5e aa 1b e0 ca 94 7a 70 a3 9e +fd 31 5c 4d f2 1a 1a 82 1c aa ff 8d cb ad 13 b2 +9c 7e 82 aa d5 3c 64 f5 82 ec 9e c3 1e 6b de 82 +ea 5a 5f 4c cc f0 c4 57 b8 88 f1 55 0c 4f f8 e1 +c1 78 a7 6a 46 c1 96 f4 be f5 9e 61 dd 94 4e 47 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +d8 70 a7 76 cd 13 ed 44 3d f3 99 08 be e2 ca d7 +3c 48 5f d9 bf 06 32 13 22 88 7f be 65 5c 08 cb +e4 c8 f6 3e 25 4f c9 1c 75 f0 55 7d 90 1d 43 5b +0e 8d ed 82 d4 91 73 41 4d 29 86 03 24 e4 6c 1b +03 0d fe aa 29 d8 0f 98 98 c2 c5 e1 01 cb f6 da +a0 62 89 78 d4 15 b5 02 de a2 6d e6 56 1c 79 ab +06 5c 6d ca 6a bc 4d 4d 4d 5e 9f 5c 74 cb 3e 6a +5a f7 1d 1f 90 fa 5e aa 1b e0 ca 94 7a 70 a3 9e +fd 31 5c 4d f2 1a 1a 82 1c aa ff 8d cb ad 13 b2 +9c 7e 82 aa d5 3c 64 f5 82 ec 9e c3 1e 6b de 82 +ea 5a 5f 4c cc f0 c4 57 b8 88 f1 55 0c 4f f8 e1 +c1 78 a7 6a 46 c1 96 f4 be f5 9e 61 dd 94 4e 47 + +# Public exponent: +01 00 01 + +# Exponent: +05 88 8f c7 7a 43 bd a7 a6 7b d1 58 47 65 0d f1 +85 c1 85 ed cf b3 ed 58 ce e3 b5 7c 5d 24 06 b7 +8b c0 55 87 4e 35 e5 7a dc 4b 0a 2c 7d 20 3a 66 +1c 0f a5 d8 57 ed e6 07 ef dc 95 68 04 2b f0 d5 +99 f4 e4 23 5e 91 7f 08 94 33 3a 92 df 94 62 d9 +c1 0a f3 df ca 70 49 a1 ea a6 35 70 13 98 83 c5 +be fe be e4 e2 21 89 43 d3 0f c6 45 ff e8 b9 14 +d2 18 dd 58 96 0a ad c1 21 71 5b ce 5c cd de 4a +2c 73 a8 d9 d8 6a 4e b6 e4 55 dc 92 4f d7 4a 0b +1f 75 69 1c 28 1b ae 91 4d 69 9e e2 59 d8 5c 5f +b5 dd 99 9e be f9 b7 0a 4b d9 4a a4 fa fa e2 6c +a7 84 d3 2f d4 e0 77 db b6 ea 69 3b cd 6d 27 d5 + +# Prime 1: +ff 8e f1 e7 4c 44 5a 5c c8 97 3a 81 9c 75 45 49 +12 35 72 0c f9 eb 83 f1 81 13 3c 78 a1 4d cc 4c +e5 e7 75 be 3e 0c 46 ed 2f 21 9a b8 8d 87 77 ad +6e cb e4 0c f9 18 76 4d 7e 37 c6 68 35 91 e7 aa +a1 3b 24 4b 7f cc 0e b6 df d7 6a 11 5f 30 ed 2d +63 68 c8 ea 78 0a 21 1c 0a c9 c0 72 5d fa b0 8d + +# Prime 2: +d8 d0 67 64 c1 f7 64 54 c6 8a 3a 08 1e 95 d7 47 +c2 94 11 ad c4 03 a7 cb 71 b4 3a f5 05 ca be 41 +b4 9c 97 1c 13 ad 65 63 b8 c9 0b 93 b5 89 79 bb +74 f8 20 ef b8 de d8 1f 46 30 54 a7 7f b3 0b b0 +99 98 51 a4 3c cd 01 69 18 51 31 f7 43 1b 02 e9 +c6 b9 f8 38 71 d9 cd 5e 0c 3c 58 70 cf 97 97 23 + +# Prime exponent 1: +e8 d6 15 f4 04 7a aa 51 aa b8 8e 27 94 a3 0b d3 +3d 71 d0 4d 9e 4e 43 d2 7f 25 45 8d 2a 79 b5 4f +c2 8f 95 a9 14 e3 1e a3 ee b3 11 42 60 40 32 7b +a3 5c c4 94 45 47 52 51 dc 53 78 c3 6d 3b 57 f5 +10 1c d0 3e b1 5a fb 75 06 90 3f 25 40 b3 55 04 +6b 74 06 ca 09 40 41 56 49 45 f3 be bf 7d 2d e9 + +# Prime exponent 2: +73 5d b1 26 73 ef 67 7b 94 89 48 87 b9 7e 91 a6 +a5 6a 94 5d 99 c7 38 29 90 bf 0e 00 02 ac f6 bf +8f 93 22 f4 d5 a3 96 27 91 d3 a8 4d 58 73 66 4a +d0 da 96 eb f7 ba db d5 08 4b ff 3f 81 3b 8c 24 +d4 15 b0 9b 6b 9e c9 f9 59 ef 1a 5f 2f 5d d8 16 +fc 9f 47 ed 00 e7 9b d7 47 3b 74 f3 d2 02 1f 71 + +# Coefficient: +10 62 18 af 97 1d 92 95 91 59 90 a4 ed 3e 09 d3 +63 db 33 06 b0 90 a1 33 eb d7 54 e2 bd 77 6b 25 +85 99 9d 4f 88 43 03 0a c7 0c 0f f5 de 52 12 67 +22 34 c0 07 ce 74 56 4c 79 1e dc d5 76 f9 68 44 +04 8c fa 66 36 46 b8 fd 80 c7 51 26 b2 26 6e 48 +f1 fa a7 05 44 ad 42 04 fd 61 56 29 2e 51 6e 13 + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 14.1 + +# ----------------- + +# Message to be signed: +f7 a3 c6 7e 92 a7 87 f3 5d cc 47 ae d7 d6 b6 19 +29 67 bd fd 00 a6 ac bf 6f 7e fe 46 d3 ac ae d9 +78 8a a4 f1 db 18 44 02 24 9f 9a ce fc 1c 7d fb +1e 69 0d 24 73 8d e8 6f a5 b5 25 0f 97 9e bd 8f +77 8e ec 0d 7f cf 73 1f a2 25 08 6c 86 65 64 ed +3e b1 54 dd 45 8d 05 00 28 2f 86 80 48 87 d4 43 +5e da 9a 44 36 a8 e9 23 a2 0c b4 b4 d0 e8 1c 91 +11 4b dc 06 82 27 8e c2 58 86 07 99 b5 9c 94 36 +f4 3a 53 ca b4 c4 cd + +# Signature: +09 d1 43 5b f5 a9 c1 72 03 d5 37 fe 57 df 98 7b +7a 51 f3 4b 2a 14 09 7e 06 a0 de 56 3b e7 d6 4b +4e a3 79 73 b4 fe 99 73 a6 6a 3f 31 ba 8e 07 e9 +11 7b 6a 1e e7 09 61 33 7b 4d 2b 0d f5 98 10 b6 +24 08 51 18 bd a7 0a c7 4a e4 3e 2f bc f8 92 27 +63 03 23 da 68 30 f5 b1 a2 b9 54 f1 b1 5a ea 07 +54 df 2c 51 18 57 95 16 e8 77 cc b0 b1 28 6c 57 +24 65 5e f8 d2 91 85 66 6f 6e 9b d3 2a 6b d9 ce +9e 1e f9 47 29 fc 67 d6 a3 0e 64 56 0e cf 78 bf +8e 1b 2b 40 e5 06 05 e2 5a e8 0c 38 67 64 ae d1 +1a 0e 71 44 90 49 c9 39 b2 96 2f 6c 24 17 a3 58 +cd c8 10 6b 12 b1 a5 58 76 39 43 8a f1 a6 8d 32 + +# PKCS#1 v1.5 Signature Example 14.2 + +# ----------------- + +# Message to be signed: +2a 13 30 03 ab 67 cd d2 e8 3b 44 e9 e9 dc 77 7d +e0 1f 4d 23 3d 22 e7 d2 b4 46 7f 04 81 2a 3a eb +ff b1 0a 09 24 54 e3 3b 9e 70 28 24 93 28 74 7e +a1 4a 11 c7 98 ac 2e 14 6e 4e 49 65 9b a8 60 67 +db 64 e9 bd 80 a7 02 1a ab cc 22 85 6e 81 01 40 +c2 0f d8 c6 52 7b ad bb d9 fa 59 53 fa 77 e6 85 +87 00 be b6 c7 4d 5a 46 3c 9d a8 61 13 3b aa 5b +d6 a5 99 80 7a e9 16 2e 3a f3 a3 48 d0 4a 4e dd +2f fb ab + +# Signature: +35 e6 66 cf b8 7c 04 88 a8 6f df ed 5f 9d ea ed +bc 46 74 17 1c 31 84 59 ac aa aa 20 e1 ca d7 c5 +86 04 14 0a 80 ff 7f 56 5b fb c8 6e 90 32 8d 4c +72 9b 91 bf 72 a9 8d b7 01 c1 be 63 8a 6e 8f 2e +46 8f 20 39 24 70 c7 c5 c3 44 42 d5 1b 1b 15 5f +b4 64 b8 a5 56 f4 a1 70 c0 23 01 fe d0 d1 aa 92 +aa fd eb c3 f1 8e a8 b4 d7 1e 24 5c 25 26 f6 fe +66 5d e4 83 85 f4 6c e1 bf 33 12 fa 89 28 09 8e +d3 31 2b 61 11 6c a7 e4 23 20 4e f0 8b d2 df 3a +d7 bb c8 50 09 8c b0 26 83 26 66 25 bb d9 59 82 +51 35 a4 5f 03 82 9d 09 6f ed 18 b2 0b aa 3f 9d +44 b0 07 aa 24 1f 92 f8 88 60 55 d9 8e 0e 07 04 + +# PKCS#1 v1.5 Signature Example 14.3 + +# ----------------- + +# Message to be signed: +58 62 7f fa aa 8e 80 0a 8b e9 8e 42 f5 1a 83 61 +1c fa b7 ee 37 6b 34 73 7b 3e 48 e1 bc 17 42 da +a7 7d e4 7e 1a 9b 29 33 77 aa + +# Signature: +3d 17 cb 38 6c 88 78 4d 35 9a d3 c3 8d be 88 8b +fa e8 31 bf b8 ed c9 d0 e8 01 e7 d6 9e 1d d4 c2 +44 1d 68 fd bb 35 12 6c 73 a4 ed ab bf f5 4e 74 +fa 51 09 da d8 b5 c3 13 d8 6a 79 e4 d4 12 76 60 +fc 2a 8e 1c 93 fa 8d 09 2a cc f0 1c c1 8a 60 6c +f0 7d e2 dc 3e 7b 55 33 11 52 db 01 b6 ca ea 1e +ce c9 09 31 99 be 62 c3 e1 23 e2 87 31 13 50 3b +22 03 0f 16 8d af c4 e6 bd 06 5a d2 f6 b1 de d0 +5b e0 c2 f9 b6 7b dc 1a 3b b1 8d a9 59 4c 95 7d +a4 e4 9f ac 3f e7 6e 07 66 f7 4e b0 d5 23 e4 dd +1a e7 59 da d6 b9 b9 08 b7 fc 8b 97 ef 5f 4c 82 +92 32 0a c3 87 c3 50 8b 54 cf b8 5d 34 f6 ad 39 + +# PKCS#1 v1.5 Signature Example 14.4 + +# ----------------- + +# Message to be signed: +0f 0f 8d 3c 0e 4d 26 08 af ad 5a 88 8e a1 4b 3f +6b 2b 27 89 dd 22 12 b8 59 09 e6 4b fb 10 4d 0f +7d e4 27 d1 4a 9f fa 85 5e 2d 4c a2 44 23 36 e5 +59 56 8b 28 41 5d 60 cf 80 63 de 55 92 17 1b 26 +9b 3d 76 33 51 c7 f7 d9 d2 58 09 e7 02 20 ee 30 +fe 8a 00 b9 5d 4c 20 20 26 89 7e d2 c6 1d 7a d4 +3a ed df 36 b5 c2 cb e2 1e 00 86 db d0 fd fd 19 +e4 3f 02 77 f3 bc 95 ed 55 a3 4a f9 30 91 66 02 +19 3c fe 04 51 4b d2 6a 05 7e 56 2a 11 90 c2 7e +aa b6 c3 22 fc fa f4 bb cc 7f 20 c3 77 9c 63 8d +7b bc 07 08 6c f7 5b f8 39 96 db 44 63 + +# Signature: +50 90 45 12 36 10 50 87 2e ae 80 10 26 28 b6 3d +02 16 8d ca 52 f0 ab d8 77 20 ea 48 05 0d 2c 62 +06 1a a2 15 32 68 be f8 ef b3 4e ed 46 17 1a 62 +88 e5 04 d4 20 f6 fc 14 51 38 61 1e 75 ed 3c f7 +9b 4d 10 26 64 d8 64 4f f3 e9 e5 db fd 71 cd c2 +7a 21 0e fb 10 be 90 27 56 04 f8 d4 49 14 8b 3f +86 09 90 39 c3 3a ef 90 bf 19 1b 35 18 eb 45 9d +a3 ba 14 fd 0c 72 22 9d ea 5f ac 2f 7d ad e1 08 +5c 8a 23 70 bb fc fa 2e 3a 9e 63 ca 22 4f 6d e8 +c8 d2 97 a3 b1 f0 6f 1f c9 49 78 90 fd 0e 0e 13 +88 7f ac b1 52 d1 2d 96 39 25 28 ef 28 d0 72 43 +31 ff 41 40 30 c7 a6 38 55 81 3c cd 89 fb db 1b + +# PKCS#1 v1.5 Signature Example 14.5 + +# ----------------- + +# Message to be signed: +26 65 cb 5e e3 6a a9 bb 1a 5c de 7c e8 + +# Signature: +4f 38 c2 ba 84 c5 0d 46 df 53 10 91 b6 27 12 14 +9c 1f 42 db d7 7e 03 d1 85 ea 96 ed a8 02 33 7c +22 c1 13 0b c3 be ce bf 15 39 fd 11 89 38 51 da +e3 cc 15 67 cb 6c 73 a7 2f a1 c9 69 48 68 21 12 +7e 7c fe a1 36 3e ee 95 2b 7c 6e b5 9e 10 2c 66 +57 c0 80 35 27 2c df 4a b5 e5 83 ed 73 7a d0 28 +ac 1c fa fe dd c9 07 3d fb d7 d3 ba 3d a9 e8 dc +d8 46 fa 36 5c 9c cd 8e 9b 39 48 3d 37 07 3c 1a +7b 78 2e e7 12 1b b1 a2 ad 8b f5 f8 ed 6e 65 3e +92 4d eb ad 87 1b 74 43 39 e5 ae 7e 96 f6 0d cc +45 ea 5d 69 7d 3b 1c c7 c5 e8 da 04 e9 2b e0 6c +ad 2e 61 4e ac 31 8a ec af 12 d5 a7 62 34 c2 c0 + +# PKCS#1 v1.5 Signature Example 14.6 + +# ----------------- + +# Message to be signed: +7b 7b 61 61 02 0f af b4 88 71 63 21 34 0d af 2c +06 ac 43 ce 21 32 86 86 84 aa af ab 13 99 65 3d +35 3b 26 93 ad 73 cb 55 b7 1d 66 ac d0 1a 16 0c +bf 74 37 67 bd 96 e7 fd 1c 7a 13 32 06 65 bb ad +1c 4a 0c ed 26 59 3c e8 9c d8 2f 54 6b d4 d1 b1 +bc d8 2c 65 a4 66 f9 9d a0 12 a4 1e 8c 41 20 69 +81 09 58 47 5b 4d 9c 2f 80 d8 2d 06 41 4c 83 25 +eb 4f 2c 5a 11 66 f1 f1 d2 d1 07 d4 8c + +# Signature: +d5 cb b6 c7 ef f4 a6 3a d8 25 0d e9 4c c2 9f 7f +31 a0 d7 10 6d 5d 77 1b 71 5d f8 a6 75 fd 16 34 +d6 e8 ab 58 87 5c c4 c1 51 7b 2f ad f4 e8 5c 1c +b8 b8 53 60 e0 68 75 87 d1 48 08 9f 3f 48 b7 9d +98 d2 02 7c 50 77 0b 33 4f 12 52 ac 0c 3b 2f 03 +65 34 c3 c2 97 22 f6 08 7d 06 d7 06 ce c7 c4 bd +ce 1c d6 4f 7b 4e 07 99 a8 7a a0 73 ea 83 20 29 +2b 8e c8 27 17 40 6d 36 ef 91 25 e4 1f b5 d5 3b +cc dd 62 2d 38 8f cc ee 60 a3 85 ec 20 6a 71 5d +c5 4d 78 77 bd 72 85 d0 84 4c 25 d5 93 77 97 91 +27 83 96 ff 9a 8a 91 30 6a 54 ea 76 60 7c 81 3f +80 1f 38 76 0c 3a 81 4b 93 96 95 9c 29 db ff 9d + +# PKCS#1 v1.5 Signature Example 14.7 + +# ----------------- + +# Message to be signed: +2b 0a d6 13 82 28 78 a5 72 e1 42 80 + +# Signature: +89 c8 10 84 da a8 f9 14 b7 e2 44 55 10 74 17 ca +62 1c 91 02 d5 01 ee b4 3d 17 4c 7b ad 38 1d b1 +8d 95 33 c3 41 1a ec 60 57 ca 5a 4d fd c3 f1 31 +c8 88 b8 8f 01 30 03 d6 17 e0 6d 64 47 95 02 ae +7e 42 4a 5d d6 37 b0 33 56 40 4d 26 0f 5e d6 b8 +cb 16 d2 57 85 28 cc 3e 85 00 34 6e b7 90 bd ad +41 b2 e3 6c a6 f1 98 85 e3 f6 f5 10 86 bf fb 6a +bb 9c 66 33 6b 49 47 34 64 c5 d7 ed 8e 9f f8 5e +11 ae ff 40 90 67 ba b0 a0 5c 41 e8 15 1b 8b e9 +87 f3 f5 95 8e 3e 6f 26 51 5d 96 bf 23 4b 22 ab +91 c0 85 7b 6c 08 a4 6b 03 05 fe 04 4c a9 aa a0 +d7 0a 27 58 a1 ce 43 16 64 a8 dd 79 40 8c 16 ba + +# PKCS#1 v1.5 Signature Example 14.8 + +# ----------------- + +# Message to be signed: +36 93 8c 8c 7c 6f 7e 35 52 34 db 5a 32 a6 48 10 +db 50 2b 67 c6 f5 92 54 4f fb 27 eb 1f 22 e0 6f +2d 63 8b 56 d5 d2 f7 d1 9e 9e 27 1f 2c c9 0c c0 +dd 36 d6 cc 2c 06 17 8b cc 70 6a ef 20 e5 6a 35 +8e 52 4f 63 16 76 9c 54 b6 de 2d d5 + +# Signature: +a0 37 53 a5 fb 54 aa 51 f6 dd 8d ab 91 f1 9c b8 +65 56 84 85 f8 55 8f 0d 10 3f 0d 2b 6d 78 53 6e +79 c8 15 c4 a0 37 bc af 11 b6 9d 4c db ab 03 5a +be 21 6f 71 52 f6 30 ff c7 9f 84 9d 8d cd 46 3a +ae 6a e9 7d 3d f1 5a 9e 73 d2 3f 18 78 fa c7 54 +cb dd 57 1a fe a5 d2 53 57 d4 b8 83 45 f4 89 be +0d 67 b9 bf ad f0 23 f2 6e 67 31 5e d5 fb f3 91 +91 0a f4 96 9b 72 4b f0 ca 31 c1 05 9f 8a 39 13 +b4 8a 13 81 9c 23 6c 9b e8 e8 24 ca 4c b6 19 fb +7d 78 4c d5 f9 52 6b 39 7c 76 c5 d0 c6 0c f7 f4 +8d 11 19 6e 54 f7 2a 08 bb 42 f7 5a ef e3 8f 0b +91 b4 2b b8 06 de 4b 87 c9 08 2f 72 1a 68 80 ca + +# PKCS#1 v1.5 Signature Example 14.9 + +# ----------------- + +# Message to be signed: +60 83 0c 01 cf a8 6f f2 dc ac 7a f9 32 1e e5 fe +50 2e 0e 7a 6f ac b7 3e 3f 6b c9 02 64 0a 61 09 +5f 64 6f d0 3e 80 d5 81 82 46 53 31 e7 5d 66 11 +a0 97 76 81 62 70 86 24 17 29 de 9f 44 ab 43 94 +9d ac 19 36 73 bd 6c f8 7f 5d 65 77 1e f8 72 81 +63 3f dd 07 ba c4 09 a6 e2 32 b6 01 ae ce 2d + +# Signature: +40 58 f6 e0 24 0d 85 1d 61 93 95 a7 52 87 a8 8f +af d8 dc 56 00 b0 69 bf 19 dc 3e 19 21 e1 17 b4 +97 b8 2b 3c 52 02 69 b1 d1 12 81 64 fc d8 8d d2 +b4 6d c8 5c 42 ec f6 7d eb ad 21 a3 b9 a1 55 42 +fe a2 26 06 ea b5 82 fc 32 97 11 ff c0 7f 4e ef +1f 3b bf e0 88 8c bc a4 85 ba fc 11 88 b0 af e8 +09 c9 aa f8 fa 36 66 b9 c9 05 85 39 db 1e c6 a1 +8e 5b e0 b8 01 44 d2 c3 7c a6 14 c0 90 b4 a7 f1 +34 58 e0 d3 a4 cb 0c b7 3d cc 4d 90 80 6f 61 08 +58 89 eb 5c 9b 14 09 de f3 60 fd 1c 2e 49 43 8d +7c 67 d7 9d bd 9a 59 2a b5 04 c4 71 5f 65 b2 9d +84 65 09 95 15 69 a8 c3 79 09 f5 d5 50 ee ff fa + +# PKCS#1 v1.5 Signature Example 14.10 + +# ----------------- + +# Message to be signed: +63 5d 22 03 ed 9d 5b 91 20 e3 1b f6 9d 30 5b e6 +06 86 97 e3 5c e5 9c 55 3e 50 8d c7 7b 07 3f fa +3a aa 59 f9 96 c3 0b 2e 68 63 23 81 9f de 22 be +6c 8d 53 86 84 14 b3 54 5a bf 43 57 68 a6 11 f0 +c1 a4 79 a0 c7 66 0d 53 5e 80 5b 5f ed c3 77 9c +f0 c5 2c 3c d0 40 ab 65 14 c7 f8 13 3d 47 b0 ac +c6 91 4e 6d 4a d3 c4 73 7c f5 12 91 09 4e 85 94 +33 ba 30 66 e1 9d 6a a2 da 89 6d c9 d9 5e f9 e5 +63 6d ab 35 f7 29 87 05 c6 d8 76 17 54 12 f8 84 +25 19 ff e1 6c f7 43 62 ab + +# Signature: +94 61 a1 a8 41 42 3e d5 cf c6 08 9a 74 db fc 53 +73 11 03 bf 49 85 dd b1 50 b0 e9 38 0d 3f e0 cf +6d 45 7c 5c 68 a7 f2 55 04 02 2d 69 5f f8 42 11 +8e bf 61 02 2f ea 47 fa 45 f7 c1 cc 72 6e 1d e5 +0b d0 64 b3 bb 70 16 57 16 2b 88 c0 b9 10 fe b7 +2f 48 7a 5c 7f 4b 9e cf ee 24 e0 7a a2 d1 98 d1 +13 cb 84 5d 81 7b b5 9b b1 da 24 a8 2b 91 c2 fe +3f ba 89 51 83 cb d9 c0 fe 0a c0 be 64 fe f2 e0 +13 92 05 b1 0b ca bf e5 a3 a7 a8 90 fc 0f e7 8d +ab e1 ad b5 bd 11 44 85 03 cb 0d cd 0b 68 f1 60 +19 6e 96 13 e2 9f be 9a 3f 94 06 ec 20 c0 30 e8 +1e c3 09 65 ea 01 9c 17 aa 97 11 01 c2 e5 30 59 + +# PKCS#1 v1.5 Signature Example 14.11 + +# ----------------- + +# Message to be signed: +87 fb a9 89 f3 cc 15 af 7e e7 61 c0 88 26 4a b7 +71 52 39 e0 b8 c8 a9 e4 8e 11 db 68 03 31 39 c2 +a2 89 ea 42 6e be 26 9f 5f b7 07 09 0a fb 89 1a +49 ca 05 c0 55 0d 72 9b f4 d3 7c 8f 1d a7 a3 ca +2f 43 87 a4 0b 5f 79 13 a3 85 f5 5b 81 41 af 36 +be 8f 57 16 65 f8 57 e7 7a 5c 9c cc e6 ba 8f 2b +e4 63 23 cc 56 91 56 6f f4 b6 d7 85 43 04 b9 3b +ba 1a 17 59 df b1 44 c9 54 7c f2 bc 8e aa ed aa +4f 1d d2 52 82 3b 72 87 ca 55 5d 21 06 08 9a 24 +3e 5d fe 8f c3 1d 3f 46 22 2a 68 ab af 31 81 5a +94 7e 58 57 cf 6a 33 17 0e cc b6 a5 e0 6d 23 cc +9d 48 ea f6 cd bc + +# Signature: +0b 5f 1c fc 25 3b aa d4 b9 83 f8 fe 05 0d 4a 01 +7c c4 66 98 0e bd 23 c9 d5 53 43 f5 10 7e 04 1e +b6 54 78 10 fd ba 46 86 e6 10 83 2f 92 82 ed f0 +66 04 b0 ab fe ea 38 01 32 79 17 79 40 99 7b 28 +90 2b 14 db 37 9e eb 4f 44 00 5d fc b0 03 68 03 +c9 f1 25 bc e1 f2 a8 2c 4d 30 07 ae 96 b8 48 b8 +13 ec 8c 97 ca 3f 71 0a 9a e0 db c2 8a 55 e0 58 +81 b8 58 db 55 71 20 f3 3c 59 cd 43 60 f9 20 8c +74 b2 7e c6 5d 11 ea 41 fa 6a 9e ac f2 a6 11 68 +ad 07 c2 09 94 8f 35 a1 61 f4 1f 87 54 0e a1 82 +84 aa b8 d8 f9 78 61 31 f0 43 90 2b 89 c1 7a 56 +0d 90 94 64 47 5a 0d fc e5 89 09 18 7c d6 e4 46 + +# PKCS#1 v1.5 Signature Example 14.12 + +# ----------------- + +# Message to be signed: +4b 5e 80 30 5c be a9 0d 63 7f db 23 47 c6 fe b6 +78 42 eb ac 6f 90 3d b5 a7 1e ba ab 8a 1c 2d f1 +12 60 a1 ec 90 7b 8b 63 4d 37 d3 6e d8 de 7d 0d +a1 03 bc 4a 9e 93 3f b7 bf ee 59 1c c9 33 29 9f +ee 46 0f 35 42 c9 78 f3 07 ae 05 24 64 f3 06 20 +ce bf 3c 9a 9c b6 a9 01 53 0c 1d 56 13 df 07 74 +31 2d 4b 5f + +# Signature: +b6 f0 3d 35 33 50 07 a7 47 ae 68 67 60 f9 ed ad +08 89 d2 d4 ca 0c b8 8b 67 43 12 d3 2c 55 2b 7a +66 c5 a9 52 8c 01 4b 58 c8 49 f2 31 a2 e0 45 68 +2e 3b bb 14 c7 f9 5f f8 bd b6 58 7f 25 11 cc 6b +f9 24 39 60 08 11 03 d4 7e 77 69 a1 77 eb db 91 +f1 28 73 de cd 5d c0 67 e4 5c 2b 2a 04 4f fa 3f +bb 04 c2 0a 3d c2 01 38 40 3f f2 5c a0 eb ad 96 +e4 85 9f a4 a0 d7 32 85 2a f3 50 a2 75 69 9a 94 +aa 6e 47 f2 17 e3 83 ef 8f ce 8e b6 ee d7 82 6d +7c 61 58 fc 58 82 e4 61 35 45 fa 26 ee e0 c9 f9 +3d e7 a1 65 08 ea 16 19 70 46 0d 6a 7c a7 70 f8 +de 8b a9 3c ea f3 97 dd f1 fb ce e2 82 a1 53 7d + +# PKCS#1 v1.5 Signature Example 14.13 + +# ----------------- + +# Message to be signed: +e5 ad 62 7f 24 f4 11 7a 0a 6b e4 a5 5f db 88 3d +75 a6 73 12 15 4a 71 89 23 d0 e8 f5 73 0a 54 d8 +ca 7c 97 4e 4d 59 33 8b b5 71 30 5c ce 99 0c bb +cf a9 1e a9 b7 73 b8 3d 7a 1f 0f fe c4 c6 b1 43 +fe 05 05 8b c9 0c e1 46 f3 69 cb ae 3b 3d 99 70 +5e f4 3d 07 21 b8 + +# Signature: +73 29 86 d4 ed db 8a 7e 9b 65 dc 01 6d d5 71 ef +ab eb 84 49 0e 88 e3 e7 3b 63 e8 0d 1c c8 6a 45 +2d ec 29 fc 81 7e 8a d4 ee bd dc d9 7c 74 5b c4 +79 7e 54 fe c6 ac e2 91 b1 96 dc 24 65 f0 8c f1 +dd d2 17 e7 7a af 7d 50 98 77 91 de 81 b0 41 10 +d1 1a b8 55 89 06 60 4e b9 d9 2b 35 f9 00 75 af +42 28 01 45 b0 88 e8 75 3d 0d b7 3c d3 a3 2b d1 +9c ea 35 38 ee 4f 09 27 3e f6 6d 07 05 d4 5e e7 +10 9f e5 95 df 55 76 7b 3d 10 81 72 27 bb 6b a3 +95 75 b8 5d 6a 35 a2 ff b8 8c b2 67 db fc 28 2b +b8 a3 de e0 2e c7 7b 0c b8 13 55 70 f8 a7 d7 ad +04 34 1a 08 64 e6 7f f6 fa 02 59 a1 69 74 c8 6a + +# PKCS#1 v1.5 Signature Example 14.14 + +# ----------------- + +# Message to be signed: +03 e3 9b a7 a8 0c 77 14 16 d8 52 63 e4 d4 3c 63 +93 df e7 96 52 3b 89 e0 a4 61 62 88 80 80 0d 8f +c2 43 1b 66 30 54 09 e0 6c 95 ae 7a 17 d5 34 b1 +e8 4c 19 9d fe 73 1d a9 49 f1 64 57 1d ec c8 b1 +66 be b8 dc 08 7c b4 86 99 98 c2 + +# Signature: +60 76 3b ea f7 c3 e2 2b 3b 22 dc 44 d9 47 82 6e +23 fc f9 6b 01 b7 74 1b 24 b1 b9 d9 3c 07 f0 c6 +4d 39 67 98 bb 58 9b d4 25 29 53 69 bf b8 79 ad +d3 42 cd 76 28 0b 57 e6 35 4f 61 95 e8 42 fa 2a +95 f1 c4 6f 0b 70 78 6c 31 8d e9 a5 5a 8a c4 54 +5e e7 cf f3 99 c6 78 e5 78 f8 93 9e d4 9e 84 bb +a9 aa e5 7c 1a 36 fc c3 94 86 46 6e 40 12 f9 58 +87 a6 81 10 f1 a4 84 67 e4 c2 34 f5 81 c5 ec 47 +71 06 cc b3 ec 86 17 b4 be 21 93 37 44 8f e7 2e +25 de ab 53 ea cb 92 e5 96 62 95 b3 a5 57 12 19 +58 df e7 9c a4 72 f7 9e fb da 1d cf ba 9d bd 0f +97 67 32 c0 93 b9 8f f1 93 c9 02 98 7a 42 6c 0f + +# PKCS#1 v1.5 Signature Example 14.15 + +# ----------------- + +# Message to be signed: +d4 c2 35 96 7d 4e 87 b6 71 1e 32 ac 70 37 a3 97 +f9 9b 1c ad 95 a1 88 94 6a 48 64 0e b6 b7 b0 03 +c3 2f 85 a1 21 b0 9c a4 c8 be c0 b8 27 44 aa f2 +7d 16 6c ef c7 a9 70 2a d3 1d bd 15 ea 2a 18 5f +5b 9b a6 42 f9 49 07 8b c6 09 b9 a8 a3 36 92 d7 +18 49 39 d1 f9 eb 42 6a 6d b7 40 ea d9 4c fe a1 +7f eb 06 18 d7 4d 9a 65 16 88 e9 0b 9b b7 05 24 +30 5d 61 8c 88 a5 5f 45 44 50 e0 c5 85 d3 a8 d9 +81 65 81 8f 36 3b 20 a2 52 49 2e 15 12 58 58 90 +a8 c3 20 a7 18 71 58 ce 0d 4e 4b e1 c7 01 f8 af +dc 54 5c 4d ab 86 8d 41 d4 1c 21 c2 cb 1f 67 df +79 53 d5 f7 26 1c 50 92 bb c4 33 2a c5 57 5b 6e +0e 03 14 9c 04 0c 3e 20 1c 79 15 ac 20 22 88 4e +a0 e6 c2 14 03 f0 b4 4e 0f 71 34 3f c9 11 1a 7d +b2 f5 e9 e5 09 c2 d8 97 84 ef b2 2c 31 e8 16 5e +0e 93 6c + +# Signature: +46 9f 08 bd d0 3b 75 64 0e 8a 44 a0 7c a8 de 4b +ac f8 33 1f e3 9c 44 d2 3a a7 b5 81 dc 3f 00 f5 +42 1b 5c 17 2d 0f fc e9 14 97 d3 d4 b1 04 f5 6a +98 ec 94 f7 19 27 1e 58 b4 3e fb d8 76 e1 c1 31 +fa 97 82 07 28 a5 56 75 55 21 4c d9 4a 18 fc ce +5c 2f 53 b1 9d 1f 3c 73 d0 9f 7b e1 80 97 38 b0 +3c e7 69 e4 54 ed 4c be dc af 43 c4 8b d3 9d f2 +f8 bb 63 b8 fc 4d 0d 4d 5b 20 4f c2 20 01 3a 66 +8c 19 f9 75 02 93 a4 71 15 83 88 26 45 db f3 ac +4f 83 9b 6f d1 cf 3b 5e e8 d7 34 e1 da 37 4d 91 +d8 9e a3 18 e9 18 34 83 f4 a0 9a 93 51 4a f5 4f +75 d0 a3 56 51 b2 40 f7 9f 20 a2 97 7d 14 57 8c + +# PKCS#1 v1.5 Signature Example 14.16 + +# ----------------- + +# Message to be signed: +d0 6a dc a4 c2 0f 0d 9f 7b e6 5a 20 32 7c 29 47 +56 e3 ed d9 e1 d3 9d 0f 95 c7 9d f1 ba c3 34 35 +9f ab 94 3d 85 45 a3 ba a3 7a 59 29 5c 58 b2 37 +75 2b 8d e7 d4 32 3c 56 e9 d7 cb 0c 7f 83 1d 54 +9c b3 87 19 a0 81 d5 8b 60 57 ec b7 42 9e 2c a6 +07 cd 13 06 35 59 43 15 9d c9 24 ad 3e 9c b1 3d +0e 71 ea dc b0 05 e1 84 c0 c2 ce aa f9 d7 4a 1c +1d f6 fe c1 8c 97 a0 + +# Signature: +9f d9 52 5c 15 c8 43 b8 06 9c 15 f2 6d 3f 95 24 +6a f3 7a 8b 8e 6b 93 9d df 5b 38 28 cd b6 2c fa +37 3a 92 ec c4 13 84 a8 77 ca a0 90 aa 13 c8 47 +ef 28 29 dd ca 14 14 20 14 02 14 81 55 05 50 da +a2 9d e2 ab 70 01 b8 55 c9 34 2f 0c 90 bf a6 c3 +34 9b 2c 39 62 13 ef 70 cb d8 4b b4 ce 6e f5 8b +17 6e 9f 6f cc db 6e 46 ca c3 41 14 a1 b9 f9 8a +8a 32 75 7b f7 5d 6b fc 45 5a de 6a 01 f9 60 50 +1b 79 f5 fb e3 b3 8f ca 03 46 4e 43 d4 96 63 c7 +9f f6 4d 32 98 1e 44 80 cd f4 2d 8a f8 da a7 f1 +2b 81 a5 aa 96 5f ad aa 3c 03 b7 ff 22 d3 cf df +fe 3c ad f4 d5 98 9e d1 4c 96 9a 6e 8c 9a 1e 04 + +# PKCS#1 v1.5 Signature Example 14.17 + +# ----------------- + +# Message to be signed: +3a 63 02 d7 9e 26 b5 55 c7 7d e9 2a 91 e0 78 57 +1e d1 57 2f fc 3e 4f c9 05 ce 53 f1 04 b3 22 00 +95 7e b2 b5 e5 f3 e3 fc bb c1 62 f9 e5 25 c7 06 +f1 dd 04 fc ab 51 6b c1 8a 8e 4f 88 a9 38 a5 b2 +56 85 d7 8d dc 9f 10 4e 49 bf 5c a0 b6 5a 4b 96 +57 e0 4a 71 fb 50 eb 4a ac 22 c0 bb 93 f6 0c ac +94 83 f1 77 13 55 3d ca 4b 31 e2 72 7b 32 e3 50 +fe 20 4c ec d9 a7 cd a4 da da 2e 87 ff 6f 2b 73 +e7 b0 78 1e 21 2f 34 fe 36 36 10 f0 18 a7 99 37 +37 55 ab 46 66 7b b6 52 5d 7d c7 a0 e8 28 90 17 +f5 48 7f a6 92 ef 2f dd ce 38 ad 3f 45 30 de 7e +e5 05 66 70 a7 35 d3 78 d1 ef c9 94 81 f8 c9 fb +ee a9 9f 56 6a 0b 6e 28 46 26 44 a6 d9 c6 cc 88 +fb + +# Signature: +b7 57 fa 74 7c 5c 87 67 66 f3 58 ac bf c7 e7 b8 +05 96 36 8d 0d 86 29 50 e5 55 f4 71 64 6f 64 0e +85 1d 61 2a 55 6f 55 a7 4a 32 92 42 9e 4c 14 f7 +8b a3 eb bd 96 87 f3 08 de db 3c fe d7 1f 4a 9d +d2 6f a5 12 2f 7f 71 94 ae b6 3b c8 b7 5c 34 31 +87 11 5a 1d bd 35 95 90 f7 ff 38 62 b7 08 85 af +1c a9 34 b8 ce bc 2c c9 e6 47 25 3f d1 32 7a 2e +d4 24 4d c8 f5 85 55 a6 89 7c a3 22 9c 80 1e 7b +f6 28 f5 25 e6 c9 48 80 4d 0b 1b 6d bc d7 90 2a +cd e7 a2 5b a5 91 d8 86 e2 8d aa 8d ed 5e e4 01 +e3 4e 64 12 f1 e6 44 ee c1 2a e9 42 61 90 6a 17 +26 11 dd 5a 98 67 78 9c 41 90 34 68 84 29 e9 06 + +# PKCS#1 v1.5 Signature Example 14.18 + +# ----------------- + +# Message to be signed: +9d c7 ce 1d 02 ca dc f1 0d f1 11 04 56 b8 a7 a5 +ea 43 76 b2 7e 8b f8 cc 8d b8 10 49 fd a3 fb d0 +db 8a 3d 0f 6b d7 48 6b 8d 84 bf 9f fd 4b 64 17 +52 df 7e df 50 86 5e 8e 58 ad 49 f7 24 0e 47 d3 +fc 98 5e db 59 6d ab fe 01 72 2a 22 77 60 38 3c +e2 4d 4a 05 d8 b0 6e f5 b9 6f 11 7d 81 + +# Signature: +05 a9 5e 11 b5 bf b0 1d cf de 3e fa 9f 31 3d 81 +bb 0d fd 46 de 63 b0 65 80 56 c5 3a f7 ad 9e 89 +43 8b 7d e7 8f f8 ea 88 d0 72 b1 74 9a 52 9f 1c +c9 cf 2c f3 2e 5a b7 20 e0 69 b4 90 6d 28 2a 03 +dd 78 d1 b3 ca 2a 3f 92 5b f5 1c 74 91 b7 3b a0 +bf 54 d5 0d 97 1d e5 b2 77 26 d8 fb 3e e2 77 34 +97 df 35 49 51 7e ed cd 9d e6 8d 90 df 35 d3 f0 +50 81 15 1a da b5 39 73 85 ab ee a7 2b 69 bd 0d +e1 8d ce e9 a2 be 00 e9 1a 03 24 03 b1 f8 1b bc +0a e7 31 c6 c0 d9 cf dd 06 c3 31 ed 89 d7 de 1d +e1 df 46 cf 09 ce 53 df 15 97 fb 69 94 68 1c 7f +be 94 c9 b0 8e 50 aa 1b 12 41 96 02 98 7f 37 dd + +# PKCS#1 v1.5 Signature Example 14.19 + +# ----------------- + +# Message to be signed: +87 a6 45 61 1b b1 91 85 3f 4f d9 b7 40 b2 de 4c +16 3e 75 62 b1 17 62 63 3e 72 df b6 f6 be 7e fb +90 41 a9 65 82 94 3a b2 01 83 91 c0 5a df ab 46 +4d d6 e3 3f 96 0d db f3 b1 7a c6 2b b7 8a fc 1c +6a 45 39 6c 09 08 70 7c 62 36 12 55 cb f0 9b ad +95 9b 31 33 da 48 d5 32 ba 7e f1 d2 0f b6 57 2a +1f 0e d6 f2 c6 e1 be c1 b1 7c c3 19 ba f7 2a 19 +8a a0 01 b8 3d 4e 98 69 c3 40 90 f2 29 a9 c7 f1 +42 a7 4e 85 ab 3e d5 1c 69 ac 15 fa b4 ab e4 67 +15 73 cf 5a d2 b5 8e 78 a9 44 ed cc ea c5 ee 58 +bf ce 66 f4 0a ac 2a be 4e 5f a0 72 dd 0f 66 4f +ac 81 1a ef 08 42 10 e5 64 1b 9c d0 8c 87 24 f4 +b4 1e ed 1d 9d 4a 18 77 80 46 59 7b d1 a2 7b bb +c0 56 c1 5e 43 c0 38 ef 37 5b 43 5e 73 a7 d3 2f +01 50 16 b7 82 35 ce 75 a7 b7 62 04 99 68 e9 93 +22 53 e4 2c a9 76 c8 d8 dc a1 bb 2d bf + +# Signature: +b8 80 62 26 fb d3 d9 7b 79 f0 dd 1d 8c f9 a2 35 +e5 1b 94 b7 e2 23 ec 68 33 2d 68 6e d3 31 3e d1 +be f6 88 70 23 af 7a 5c 99 df 03 68 a3 49 c6 a5 +94 79 5b 62 35 36 10 13 42 69 0d eb 5f ad 90 23 +78 2f 6d be 16 43 a4 56 18 57 4f 16 72 81 12 a7 +e0 ef 9f 58 65 6f 6a db f4 00 40 9f 4a a5 01 3c +15 9a 36 8c a5 9b de 6b 39 18 df e1 d8 02 fa 6c +fa 06 c9 ca 31 ac a7 8c b2 63 c8 ed 91 7a f9 a9 +a7 95 d5 e2 c4 01 e7 29 96 4c f7 ac 28 cc db 36 +d9 59 ed 7f d9 af 1c 47 09 7b 62 55 c6 4e 1b 16 +f2 1d 86 87 04 55 d5 f0 bf 90 1f cc 68 c3 4b 72 +c1 be e7 2e 6b 8c 4e 36 ae 33 99 6c 7a 59 d0 9a + +# PKCS#1 v1.5 Signature Example 14.20 + +# ----------------- + +# Message to be signed: +03 2e 28 3e 59 6e 87 fa a6 cf cf b8 fa 04 df 6a +61 e6 11 df e7 3b bf 66 8e e6 7b 49 6b fb 0f fb +7f 9d c9 31 a9 8b ce db 25 + +# Signature: +b9 fd c0 3d c1 99 70 71 3c 4a 17 e8 7e 7e bb 5f +13 50 5d 59 cb b2 2b a7 2e 9f f1 6b df 8b 65 9c +33 30 a9 3d cc 09 2a 5d 38 5b 2d 5e 15 34 00 31 +46 c0 50 b7 dd c4 f7 56 56 9d a2 11 80 15 82 26 +61 19 f5 59 9b 1e 65 e8 eb ea 6b c9 64 42 ee 12 +ac b9 6c 6d ba 08 3e 92 10 94 da 9c 9e cf 5a fa +a5 4b 7f de 7a 0c ae 3f df e4 d2 51 93 3a 52 f0 +2d c2 3e 1b 32 14 c6 83 e1 9a f4 6e 18 c7 49 56 +dc 6a b3 50 2d 46 ca ac 3c b2 6b 70 7c dc 30 25 +b6 de 4e 83 54 3b 95 84 5b 4a 15 97 60 77 0a 4b +d0 9e 46 35 a0 4e 21 7d 66 5c 95 94 87 9f 38 1d +71 10 09 34 fa da 61 c7 cc 22 b8 d2 ff 8e b3 5a + +# ============================================= + +# Example 15: A 2048-bit RSA key pair +# ----------------------------------- + + +# Public key +# ---------- + +# Modulus: +df 27 1f d2 5f 86 44 49 6b 0c 81 be 4b d5 02 97 +ef 09 9b 00 2a 6f d6 77 27 eb 44 9c ea 56 6e d6 +a3 98 1a 71 31 2a 14 1c ab c9 81 5c 12 09 e3 20 +a2 5b 32 46 4e 99 99 f1 8c a1 3a 9f d3 89 25 58 +f9 e0 ad ef dd 36 50 dd 23 a3 f0 36 d6 0f e3 98 +84 37 06 a4 0b 0b 84 62 c8 be e3 bc e1 2f 1f 28 +60 c2 44 4c dc 6a 44 47 6a 75 ff 4a a2 42 73 cc +be 3b f8 02 48 46 5f 8f f8 c3 a7 f3 36 7d fc 0d +f5 b6 50 9a 4f 82 81 1c ed d8 1c da aa 73 c4 91 +da 41 21 70 d5 44 d4 ba 96 b9 7f 0a fc 80 65 49 +8d 3a 49 fd 91 09 92 a1 f0 72 5b e2 4f 46 5c fe +7e 0e ab f6 78 99 6c 50 bc 5e 75 24 ab f7 3f 15 +e5 be f7 d5 18 39 4e 31 38 ce 49 44 50 6a aa af +3f 9b 23 6d ca b8 fc 00 f8 7a f5 96 fd c3 d9 d6 +c7 5c d5 08 36 2f ae 2c be dd cc 4c 74 50 b1 7b +77 6c 07 9e cc a1 f2 56 35 1a 43 b9 7d be 21 53 + +# Exponent: +01 00 01 + +# Private key +# ----------- + +# Modulus: +df 27 1f d2 5f 86 44 49 6b 0c 81 be 4b d5 02 97 +ef 09 9b 00 2a 6f d6 77 27 eb 44 9c ea 56 6e d6 +a3 98 1a 71 31 2a 14 1c ab c9 81 5c 12 09 e3 20 +a2 5b 32 46 4e 99 99 f1 8c a1 3a 9f d3 89 25 58 +f9 e0 ad ef dd 36 50 dd 23 a3 f0 36 d6 0f e3 98 +84 37 06 a4 0b 0b 84 62 c8 be e3 bc e1 2f 1f 28 +60 c2 44 4c dc 6a 44 47 6a 75 ff 4a a2 42 73 cc +be 3b f8 02 48 46 5f 8f f8 c3 a7 f3 36 7d fc 0d +f5 b6 50 9a 4f 82 81 1c ed d8 1c da aa 73 c4 91 +da 41 21 70 d5 44 d4 ba 96 b9 7f 0a fc 80 65 49 +8d 3a 49 fd 91 09 92 a1 f0 72 5b e2 4f 46 5c fe +7e 0e ab f6 78 99 6c 50 bc 5e 75 24 ab f7 3f 15 +e5 be f7 d5 18 39 4e 31 38 ce 49 44 50 6a aa af +3f 9b 23 6d ca b8 fc 00 f8 7a f5 96 fd c3 d9 d6 +c7 5c d5 08 36 2f ae 2c be dd cc 4c 74 50 b1 7b +77 6c 07 9e cc a1 f2 56 35 1a 43 b9 7d be 21 53 + +# Public exponent: +01 00 01 + +# Exponent: +5b d9 10 25 78 30 dc e1 75 20 b0 34 41 a5 1a 8c +ab 94 02 0a c6 ec c2 52 c8 08 f3 74 3c 95 b7 c8 +3b 8c 8a f1 a5 01 43 46 eb c4 24 2c df b5 d7 18 +e3 0a 73 3e 71 f2 91 e4 d4 73 b6 1b fb a6 da ca +ed 0a 77 bd 1f 09 50 ae 3c 91 a8 f9 01 11 88 25 +89 e1 d6 27 65 ee 67 1e 7b ae ea 30 9f 64 d4 47 +bb cf a9 ea 12 dc e0 5e 9e a8 93 9b c5 fe 61 08 +58 12 79 c9 82 b3 08 79 4b 34 48 e7 f7 b9 52 29 +2d f8 8c 80 cb 40 14 2c 4b 5c f5 f8 dd aa 08 91 +67 8d 61 0e 58 2f cb 88 0f 0d 70 7c af 47 d0 9a +84 e1 4c a6 58 41 e5 a3 ab c5 e9 db a9 40 75 a9 +08 43 41 f0 ed ad 9b 68 e3 b8 e0 82 b8 0b 6e 6e +8a 05 47 b4 4f b5 06 1b 6a 91 31 60 3a 55 37 dd +ab d0 1d 8e 86 3d 89 22 e9 aa 3e 4b fa ea 0b 39 +d7 92 83 ad 2c bc 8a 59 cc e7 a6 ec f4 e4 c8 1e +d4 c6 59 1c 80 7d ef d7 1a b0 68 66 bb 5e 77 45 + +# Prime 1: +f4 4f 5e 42 46 39 1f 48 2b 2f 52 96 e3 60 2e b3 +4a a1 36 42 77 10 f7 c0 41 6d 40 3f d6 9d 4b 29 +13 0c fe be f3 4e 88 5a bd b1 a8 a0 a5 f0 e9 b5 +c3 3e 1f c3 bf c2 85 b1 ae 17 e4 0c c6 7a 19 13 +dd 56 37 19 81 5e ba f8 51 4c 2a 7a a0 01 8e 63 +b6 c6 31 dc 31 5a 46 23 57 16 42 3d 11 ff 58 03 +4e 61 06 45 70 36 06 91 9f 5c 7c e2 66 0c d1 48 +bd 9e fc 12 3d 9c 54 b6 70 55 90 d0 06 cf cf 3f + +# Prime 2: +e9 d4 98 41 e0 e0 a6 ad 0d 51 78 57 13 3e 36 dc +72 c1 bd d9 0f 91 74 b5 2e 26 57 0f 37 36 40 f1 +c1 85 e7 ea 8e 2e d7 f1 e4 eb b9 51 f7 0a 58 02 +36 33 b0 09 7a ec 67 c6 dc b8 00 fc 1a 67 f9 bb +05 63 61 0f 08 eb c8 74 6a d1 29 77 21 36 eb 1d +da f4 64 36 45 0d 31 83 32 a8 49 82 fe 5d 28 db +e5 b3 e9 12 40 7c 3e 0e 03 10 0d 87 d4 36 ee 40 +9e ec 1c f8 5e 80 ab a0 79 b2 e6 10 6b 97 bc ed + +# Prime exponent 1: +ed 10 2a cd b2 68 71 53 4d 1c 41 4e ca d9 a4 d7 +32 fe 95 b1 0e ea 37 0d a6 2f 05 de 2c 39 3b 1a +63 33 03 ea 74 1b 6b 32 69 c9 7f 70 4b 35 27 02 +c9 ae 79 92 2f 7b e8 d1 0d b6 7f 02 6a 81 45 de +41 b3 0c 0a 42 bf 92 3b ac 5f 75 04 c2 48 60 4b +9f aa 57 ed 6b 32 46 c6 ba 15 8e 36 c6 44 f8 b9 +54 8f cf 4f 07 e0 54 a5 6f 76 86 74 05 44 40 bc +0d cb bc 9b 52 8f 64 a0 17 06 e0 5b 0b 91 10 6f + +# Prime exponent 2: +68 27 92 4a 85 e8 8b 55 ba 00 f8 21 91 28 bd 37 +24 c6 b7 d1 df e5 62 9e f1 97 92 5f ec af f5 ed +b9 cd f3 a7 be fd 8e a2 e8 dd 37 07 13 8b 3f f8 +7c 3c 39 c5 7f 43 9e 56 2e 2a a8 05 a3 9d 7c d7 +99 66 d2 ec e7 84 5f 1d bc 16 be e9 99 99 e4 d0 +bf 9e ec a4 5f cd a8 a8 50 00 35 fe 6b 5f 03 bc +2f 6d 1b fc 4d 4d 0a 37 23 96 1a f0 cd ce 4a 01 +ee c8 2d 7f 54 58 ec 19 e7 1b 90 ee ef 7d ff 61 + +# Coefficient: +57 b7 38 88 d1 83 a9 9a 63 07 42 22 77 55 1a 3d +9e 18 ad f0 6a 91 e8 b5 5c ef fe f9 07 7c 84 96 +94 8e cb 3b 16 b7 81 55 cb 2a 3a 57 c1 19 d3 79 +95 1c 01 0a a6 35 ed cf 62 d8 4c 5a 12 2a 8d 67 +ab 5f a9 e5 a4 a8 77 2a 1e 94 3b af c7 0a e3 a4 +c1 f0 f3 a4 dd ff ae fd 18 92 c8 cb 33 bb 0d 0b +95 90 e9 63 a6 91 10 fb 34 db 7b 90 6f c4 ba 28 +36 99 5a ac 7e 52 74 90 ac 95 2a 02 26 8a 4f 18 + +# PKCS#1 v1.5 signing of 20 random messages +# ------------------------------------------------------- + +# PKCS#1 v1.5 Signature Example 15.1 + +# ----------------- + +# Message to be signed: +f4 5d 55 f3 55 51 e9 75 d6 a8 dc 7e a9 f4 88 59 +39 40 cc 75 69 4a 27 8f 27 e5 78 a1 63 d8 39 b3 +40 40 84 18 08 cf 9c 58 c9 b8 72 8b f5 f9 ce 8e +e8 11 ea 91 71 4f 47 ba b9 2d 0f 6d 5a 26 fc fe +ea 6c d9 3b 91 0c 0a 2c 96 3e 64 eb 18 23 f1 02 +75 3d 41 f0 33 59 10 ad 3a 97 71 04 f1 aa f6 c3 +74 27 16 a9 75 5d 11 b8 ee d6 90 47 7f 44 5c 5d +27 20 8b 2e 28 43 30 fa 3d 30 14 23 fa 7f 2d 08 +6e 0a d0 b8 92 b9 db 54 4e 45 6d 3f 0d ab 85 d9 +53 c1 2d 34 0a a8 73 ed a7 27 c8 a6 49 db 7f a6 +37 40 e2 5e 9a f1 53 3b 30 7e 61 32 99 93 11 0e +95 19 4e 03 93 99 c3 82 4d 24 c5 1f 22 b2 6b de +10 24 cd 39 59 58 a2 df eb 48 16 a6 e8 ad ed b5 +0b 1f 6b 56 d0 b3 06 0f f0 f1 c4 cb 0d 0e 00 1d +d5 9d 73 be 12 + +# Signature: +b7 5a 54 66 b6 5d 0f 30 0e f5 38 33 f2 17 5c 8a +34 7a 38 04 fc 63 45 1d c9 02 f0 b7 1f 90 83 45 +9e d3 7a 51 79 a3 b7 23 a5 3f 10 51 64 2d 77 37 +4c 4c 6c 8d bb 1c a2 05 25 f5 c9 f3 2d b7 76 95 +35 56 da 31 29 0e 22 19 74 82 ce b6 99 06 c4 6a +75 8f b0 e7 40 9b a8 01 07 7d 2a 0a 20 ea e7 d1 +d6 d3 92 ab 49 57 e8 6b 76 f0 65 2d 68 b8 39 88 +a7 8f 26 e1 11 72 ea 60 9b f8 49 fb bd 78 ad 7e +dc e2 1d e6 62 a0 81 36 8c 04 06 07 ce e2 9d b0 +62 72 27 f4 49 63 ad 17 1d 22 93 b6 33 a3 92 e3 +31 dc a5 4f e3 08 27 52 f4 3f 63 c1 61 b4 47 a4 +c6 5a 68 75 67 0d 5f 66 00 fc c8 60 a1 ca eb 0a +88 f8 fd ec 4e 56 43 98 a5 c4 6c 87 f6 8c e0 70 +01 f6 21 3a be 0a b5 62 5f 87 d1 90 25 f0 8d 81 +da c7 bd 45 86 bc 93 82 19 1f 6d 28 80 f6 22 7e +5d f3 ee d2 1e 77 92 d2 49 48 04 87 f3 65 52 61 + +# PKCS#1 v1.5 Signature Example 15.2 + +# ----------------- + +# Message to be signed: +c1 4b 4c 60 75 b2 f9 aa d6 61 de f4 ec fd 3c b9 +33 c6 23 f4 e6 3b f5 34 10 d2 f0 16 d1 ab 98 e2 +72 9e cc f8 00 6c d8 e0 80 50 73 7d 95 fd bf 29 +6b 66 f5 b9 79 2a 90 29 36 c4 f7 ac 69 f5 14 53 +ce 43 69 45 2d c2 2d 96 f0 37 74 81 14 66 20 00 +dd 9c d3 a5 e1 79 f4 e0 f8 1f a6 a0 31 1c a1 ae +e6 51 9a 0f 63 ce c7 8d 27 bb 72 63 93 fb 7f 1f +88 cd e7 c9 7f 8a 66 cd 66 30 12 81 da c3 f3 a4 +33 24 8c 75 d6 c2 dc d7 08 b6 a9 7b 0a 3f 32 5e +0b 29 64 f8 a5 81 9e 47 9b + +# Signature: +af a7 34 34 62 be a1 22 cc 14 9f ca 70 ab da e7 +94 46 67 7d b5 37 36 66 af 7d c3 13 01 5f 4d e7 +86 e6 e3 94 94 6f ad 3c c0 e2 b0 2b ed ba 50 47 +fe 9e 2d 7d 09 97 05 e4 a3 9f 28 68 32 79 cf 0a +c8 5c 15 30 41 22 42 c0 e9 18 95 3b e0 00 e9 39 +cf 3b f1 82 52 5e 19 93 70 fa 79 07 eb a6 9d 5d +b4 63 10 17 c0 e3 6d f7 03 79 b5 db 8d 4c 69 5a +97 9a 8e 61 73 22 40 65 d7 dc 15 13 2e f2 8c d8 +22 79 51 63 06 3b 54 c6 51 14 1b e8 6d 36 e3 67 +35 bc 61 f3 1f ca 57 4e 53 09 f3 a3 bb df 91 ef +f1 2b 99 e9 cc 17 44 f1 ee 9a 1b d2 2c 5b ad 96 +ad 48 19 29 25 1f 03 43 fd 36 bc f0 ac de 7f 11 +e5 ad 60 97 77 21 20 27 96 fe 06 1f 9a da 1f c4 +c8 e0 0d 60 22 a8 35 75 85 ff e9 fd d5 93 31 a2 +8c 4a a3 12 15 88 fb 6c f6 83 96 d8 ac 05 46 59 +95 00 c9 70 85 00 a5 97 2b d5 4f 72 cf 8d b0 c8 + +# PKCS#1 v1.5 Signature Example 15.3 + +# ----------------- + +# Message to be signed: +d0 23 71 ad 7e e4 8b bf db 27 63 de 7a 84 3b 94 +08 ce 5e b5 ab f8 47 ca 3d 73 59 86 df 84 e9 06 +0b db cd d3 a5 5b a5 5d de 20 d4 76 1e 1a 21 d2 +25 c1 a1 86 f4 ac 4b 30 19 d3 ad f7 8f e6 33 46 +67 f5 6f 70 c9 01 a0 a2 70 0c 6f 0d 56 ad d7 19 +59 2d c8 8f 6d 23 06 c7 00 9f 6e 7a 63 5b 4c b3 +a5 02 df e6 8d dc 58 d0 3b e1 0a 11 70 00 4f e7 +4d d3 e4 6b 82 59 1f f7 54 14 f0 c4 a0 3e 60 5e +20 52 4f 24 16 f1 2e ca 58 9f 11 1b 75 d6 39 c6 +1b aa 80 ca fd 05 cf 35 00 24 4a 21 9e d9 ce d9 +f0 b1 02 97 18 2b 65 3b 52 6f 40 0f 29 53 ba 21 +4d 5b cd 47 88 41 32 87 2a e9 0d 4d 6b 1f 42 15 +39 f9 f3 46 62 a5 6d c0 e7 b4 b9 23 b6 23 1e 30 +d2 67 67 97 81 7f 7c 33 7b 5a c8 24 ba 93 14 3b +33 81 fa 3d ce 0e 6a eb d3 8e 67 73 51 87 b1 eb +d9 5c 02 + +# Signature: +3b ac 63 f8 6e 3b 70 27 12 03 10 6b 9c 79 aa bd +9f 47 7c 56 e4 ee 58 a4 fc e5 ba f2 ca b4 96 0f +88 39 1c 9c 23 69 8b e7 5c 99 ae df 9e 1a bf 17 +05 be 1d ac 33 14 0a db 48 eb 31 f4 50 bb 9e fe +83 b7 b9 0d b7 f1 57 6d 33 f4 0c 1c ba 4b 8d 6b +1d 33 23 56 4b 0f 17 74 11 4f a7 c0 8e 6d 1e 20 +dd 8f bb a9 b6 ac 7a d4 1e 26 b4 56 8f 4a 8a ac +bf d1 78 a8 f8 d2 c9 d5 f5 b8 81 12 93 5a 8b c9 +ae 32 cd a4 0b 8d 20 37 55 10 73 50 96 53 68 18 +ce 2b 2d b7 1a 97 72 c9 b0 dd a0 9a e1 01 52 fa +11 46 62 18 d0 91 b5 3d 92 54 30 61 b7 29 4a 55 +be 82 ff 35 d5 c3 2f a2 33 f0 5a aa c7 58 50 30 +7e cf 81 38 3c 11 16 74 39 7b 1a 1b 9d 3b f7 61 +2c cb e5 ba cd 2b 38 f0 a9 83 97 b2 4c 83 65 8f +b6 c0 b4 14 0e f1 19 70 c4 63 0d 44 34 4e 76 ea +ed 74 dc be e8 11 db f6 57 59 41 f0 8a 65 23 b8 + +# PKCS#1 v1.5 Signature Example 15.4 + +# ----------------- + +# Message to be signed: +29 03 55 84 ab 7e 02 26 a9 ec 4b 02 e8 dc f1 27 +2d c9 a4 1d 73 e2 82 00 07 b0 f6 e2 1f ec cd 5b +d9 db b9 ef 88 cd 67 58 76 9e e1 f9 56 da 7a d1 +84 41 de 6f ab 83 86 db c6 93 + +# Signature: +28 d8 e3 fc d5 dd db 21 ff bd 8d f1 63 0d 73 77 +aa 26 51 e1 4c ad 1c 0e 43 cc c5 2f 90 7f 94 6d +66 de 72 54 e2 7a 6c 19 0e b0 22 ee 89 ec f6 22 +4b 09 7b 71 06 8c d6 07 28 a1 ae d6 4b 80 e5 45 +7b d3 10 6d d9 17 06 c9 37 c9 79 5f 2b 36 36 7f +f1 53 dc 25 19 a8 db 9b df 2c 80 74 30 c4 51 de +17 bb cd 0c e7 82 b3 e8 f1 02 4d 90 62 4d ea 7f +1e ed c7 42 0b 7e 7c aa 65 77 ce f4 31 41 a7 26 +42 06 58 0e 44 a1 67 df 5e 41 ee a0 e6 9a 80 54 +54 c4 0e ef c1 3f 48 e4 23 d7 a3 2d 02 ed 42 c0 +ab 03 d0 a7 cf 70 c5 86 0a c9 2e 03 ee 00 5b 60 +ff 35 03 42 4b 98 cc 89 45 68 c7 c5 6a 02 33 55 +1c eb e5 88 cf 8b 01 67 b7 df 13 ad ca d8 28 67 +68 10 49 9c 70 4d a7 ae 23 41 4d 69 e3 c0 d2 db +5d cb c2 61 3b c1 20 42 1f 9e 36 53 c5 a8 76 72 +97 64 3c 7e 07 40 de 01 63 55 45 3d 6c 95 ae 72 + +# PKCS#1 v1.5 Signature Example 15.5 + +# ----------------- + +# Message to be signed: +bd a3 a1 c7 90 59 ea e5 98 30 8d 3d f6 09 + +# Signature: +a1 56 17 6c b9 67 77 c7 fb 96 10 5d bd 91 3b c4 +f7 40 54 f6 80 7c 60 08 a1 a9 56 ea 92 c1 f8 1c +b8 97 dc 4b 92 ef 9f 4e 40 66 8d c7 c5 56 90 1a +cb 6c f2 69 fe 61 5b 0f b7 2b 30 a5 13 38 69 23 +14 b0 e5 87 8a 88 c2 c7 77 4b d1 69 39 b5 ab d8 +2b 44 29 d6 7b d7 ac 8e 5e a7 fe 92 4e 20 a6 ec +66 22 91 f2 54 8d 73 4f 66 34 86 8b 03 9a a5 f9 +d4 d9 06 b2 d0 cb 85 85 bf 42 85 47 af c9 1c 6e +20 52 dd cd 00 1c 3e f8 c8 ee fc 3b 6b 2a 82 b6 +f9 c8 8c 56 f2 e2 c3 cb 0b e4 b8 0d a9 5e ba 37 +1d 8b 5f 60 f9 25 38 74 3d db b5 da 29 72 c7 1f +e7 b9 f1 b7 90 26 8a 0e 77 0f c5 eb 4d 5d d8 52 +47 d4 8a e2 ec 3f 26 25 5a 39 85 52 02 06 a1 f2 +68 e4 83 e9 db b1 d5 ca b1 90 91 76 06 de 31 e7 +c5 18 2d 8f 15 1b f4 1d fe cc ae d7 cd e6 90 b2 +16 47 10 6b 49 0c 72 9d 54 a8 fe 28 02 a6 d1 26 + +# PKCS#1 v1.5 Signature Example 15.6 + +# ----------------- + +# Message to be signed: +c1 87 91 5e 4e 87 da 81 c0 8e d4 35 6a 0c ce ac +1c 4f b5 c0 46 b4 52 81 b3 87 ec 28 f1 ab fd 56 +7e 54 6b 23 6b 37 d0 1a e7 1d 3b 28 34 36 5d 3d +f3 80 b7 50 61 b7 36 b0 13 0b 07 0b e5 8a e8 a4 +6d 12 16 63 61 b6 13 db c4 7d fa eb 4c a7 46 45 +6c 2e 88 83 85 52 5c ca 9d d1 c3 c7 a9 ad a7 6d +6c + +# Signature: +9c ab 74 16 36 08 66 9f 75 55 a3 33 cf 19 6f e3 +a0 e9 e5 eb 1a 32 d3 4b b5 c8 5f f6 89 aa ab 0e +3e 65 66 8e d3 b1 15 3f 94 eb 3d 8b e3 79 b8 ee +f0 07 c4 a0 2c 70 71 ce 30 d8 bb 34 1e 58 c6 20 +f7 3d 37 b4 ec bf 48 be 29 4f 6c 9e 0e cb 5e 63 +fe c4 1f 12 0e 55 53 df a0 eb eb bb 72 64 0a 95 +37 ba dc b4 51 33 02 29 d9 f7 10 f6 2e 3e d8 ec +78 4e 50 ee 1d 92 62 b4 26 71 34 00 11 d7 d0 98 +c6 f2 55 7b 21 31 fa 9b d0 25 46 36 59 7e 88 ec +b3 5a 24 0e f0 fd 85 95 71 24 df 80 80 fe e1 e1 +49 af 93 99 89 e8 6b 26 c8 5a 58 81 fa e8 67 3d +9f d4 08 00 dd 13 4e b9 bd b6 41 0f 42 0b 0a a9 +7b 20 ef cf 2e b0 c8 07 fa eb 83 a3 cc d9 b5 1d +45 53 e4 1d fc 0d f6 ca 80 a1 e8 1d c2 34 bb 83 +89 dd 19 5a 38 b4 2d e4 ed c4 9d 34 64 78 b9 f1 +1f 05 57 20 5f 5b 0b d7 ff e9 c8 50 f3 96 d7 c4 + +# PKCS#1 v1.5 Signature Example 15.7 + +# ----------------- + +# Message to be signed: +ab fa 2e cb 7d 29 bd 5b cb 99 31 ce 2b ad 2f 74 +38 3e 95 68 3c ee 11 02 2f 08 e8 e7 d0 b8 fa 05 +8b f9 eb 7e b5 f9 88 68 b5 bb 1f b5 c3 1c ed a3 +a6 4f 1a 12 cd f2 0f cd 0e 5a 24 6d 7a 17 73 d8 +db a0 e3 b2 77 54 5b ab e5 8f 2b 96 e3 f4 ed c1 +8e ab f5 cd 2a 56 0f ca 75 fe 96 e0 7d 85 9d ef +b2 56 4f 3a 34 f1 6f 11 e9 1b 3a 71 7b 41 af 53 +f6 60 53 23 00 1a a4 06 c6 + +# Signature: +c4 b4 37 bc f7 03 f3 52 e1 fa f7 4e b9 62 20 39 +42 6b 56 72 ca f2 a7 b3 81 c6 c4 f0 19 1e 7e 4a +98 f0 ee bc d6 f4 17 84 c2 53 7f f0 f9 9e 74 98 +2c 87 20 1b fb c6 5e ae 83 2d b7 1d 16 da ca db +09 77 e5 c5 04 67 9e 40 be 0f 9d b0 6f fd 84 8d +d2 e5 c3 8a 7e c0 21 e7 f6 8c 47 df d3 8c c3 54 +49 3d 53 39 b4 59 5a 5b f3 1e 3f 8f 13 81 68 07 +37 3d f6 ad 0d c7 e7 31 e5 1a d1 9e b4 75 4b 13 +44 85 84 2f e7 09 d3 78 44 4d 8e 36 b1 72 4a 4f +da 21 ca fe e6 53 ab 80 74 7f 79 52 ee 80 4d ea +b1 03 9d 84 13 99 45 bb f4 be 82 00 87 53 f3 c5 +4c 78 21 a1 d2 41 f4 21 79 c7 94 ef 70 42 bb f9 +95 56 56 22 2e 45 c3 43 69 a3 84 69 7b 6a e7 42 +e1 8f a5 ca 7a ba d2 7d 9f e7 10 52 e3 31 0d 0f +52 c8 d1 2e a3 3b f0 53 a3 00 f4 af c4 f0 98 df +4e 6d 88 67 79 d6 45 94 d3 69 15 8f db c1 f6 94 + +# PKCS#1 v1.5 Signature Example 15.8 + +# ----------------- + +# Message to be signed: +df 40 44 a8 9a 83 e9 fc bf 12 62 54 0a e3 03 8b +bc 90 f2 b2 62 8b f2 a4 46 7a c6 77 22 d8 54 6b +3a 71 cb 0e a4 16 69 d5 b4 d6 18 59 c1 b4 e4 7c +ec c5 93 3f 75 7e c8 6d b0 64 4e 31 18 12 d0 0f +b8 02 f0 34 00 63 9c 0e 36 4d ae 5a eb c5 79 1b +c6 55 76 23 61 bc 43 c5 3d 3c 78 86 76 8f 79 68 +c1 c5 44 c6 f7 9f 7b e8 20 c7 e2 bd 2f 9d 73 e6 +2d ed 6d 2e 93 7e 6a 6d ae f9 0e e3 7a 1a 52 a5 +4f 00 e3 1a dd d6 48 94 cf 4c 02 e1 60 99 e2 9f +9e b7 f1 a7 bb 7f 84 c4 7a 2b 59 48 13 be 02 a1 +7b 7f c4 3b 34 c2 2c 91 92 52 64 12 6c 89 f8 6b +b4 d8 7f 3e f1 31 29 6c 53 a3 08 e0 33 1d ac 8b +af 3b 63 42 22 66 ec ef 2b 90 78 15 35 db da 41 +cb d0 cf 22 a8 cb fb 53 2e c6 8f c6 af b2 ac 06 + +# Signature: +14 14 b3 85 67 ae 6d 97 3e de 4a 06 84 2d cc 0e +05 59 b1 9e 65 a4 88 9b db ab d0 fd 02 80 68 29 +13 ba cd 5d c2 f0 1b 30 bb 19 eb 81 0b 7d 9d ed +32 b2 84 f1 47 bb e7 71 c9 30 c6 05 2a a7 34 13 +90 a8 49 f8 1d a9 cd 11 e5 ec cf 24 6d ba e9 5f +a9 58 28 e9 ae 0c a3 55 03 25 32 6d ee f9 f4 95 +30 ba 44 1b ed 4a c2 9c 02 9c 9a 27 36 b1 a4 19 +0b 85 08 4a d1 50 42 6b 46 d7 f8 5b d7 02 f4 8d +ac 5f 71 33 0b c4 23 a7 66 c6 5c c1 dc ab 20 d3 +d3 bb a7 2b 63 b3 ef 82 44 d4 2f 15 7c b7 e3 a8 +ba 5c 05 27 2c 64 cc 1a d2 1a 13 49 3c 39 11 f6 +0b 4e 9f 4e cc 99 00 eb 05 6e e5 9d 6f e4 b8 ff +6e 80 48 cc c0 f3 8f 28 36 fd 3d fe 91 bf 4a 38 +6e 1e cc 2c 32 83 9f 0c a4 d1 b2 7a 56 8f a9 40 +dd 64 ad 16 bd 01 25 d0 34 8e 38 30 85 f0 88 94 +86 1c a1 89 87 22 7d 37 b4 2b 58 4a 83 57 cb 04 + +# PKCS#1 v1.5 Signature Example 15.9 + +# ----------------- + +# Message to be signed: +ea 94 1f f0 6f 86 c2 26 92 7f cf 0e 3b 11 b0 87 +26 76 17 0c 1b fc 33 bd a8 e2 65 c7 77 71 f9 d0 +85 01 64 a5 ee cb cc 5c e8 27 fb fa 07 c8 52 14 +79 6d 81 27 e8 ca a8 18 94 ea 61 ce b1 44 9e 72 +fe a0 a4 c9 43 b2 da 6d 9b 10 5f e0 53 b9 03 9a +9c c5 3d 42 0b 75 39 fa b2 23 9c 6b 51 d1 7e 69 +4c 95 7d 4b 0f 09 84 46 18 79 a0 75 9c 44 01 be +ec d4 c6 06 a0 af bd 7a 07 6f 50 a2 df c2 80 7f +24 f1 91 9b aa 77 46 d3 a6 4e 26 8e d3 f5 f8 e6 +da 83 a2 a5 c9 15 2f 83 7c b0 78 12 bd 5b a7 d3 +a0 79 85 de 88 11 3c 17 96 e9 b4 66 ec 29 9c 5a +c1 05 9e 27 f0 94 15 + +# Signature: +ce eb 84 cc b4 e9 09 92 65 65 07 21 ee a0 e8 ec +89 ca 25 bd 35 4d 4f 64 56 49 67 be 9d 4b 08 b3 +f1 c0 18 53 9c 9d 37 1c f8 96 1f 22 91 fb e0 dc +2f 2f 95 fe a4 7b 63 9f 1e 12 f4 bc 38 1c ef 0c +2b 7a 7b 95 c3 ad f2 76 05 b7 f6 39 98 c3 cb ad +54 28 08 c3 82 2e 06 4d 4a d1 40 93 67 9e 6e 01 +41 8a 6d 5c 05 96 84 cd 56 e3 4e d6 5a b6 05 b8 +de 4f cf a6 40 47 4a 54 a8 25 1b bb 73 26 a4 2d +08 58 5c fc fc 95 67 69 b1 5b 6d 7f df 7d a8 4f +81 97 6e aa 41 d6 92 38 0f f1 0e ae cf e0 a5 79 +68 29 09 b5 52 1f ad e8 54 d7 97 b8 a0 34 5b 9a +86 4e 05 88 f6 ca dd bf 65 f1 77 99 8e 18 0d 1f +10 24 43 e6 dc a5 3a 94 82 3c aa 9c 3b 35 f3 22 +58 3c 70 3a f6 74 76 15 9e c7 ec 93 d1 76 9b 30 +0a f0 e7 15 7d c2 98 c6 cd 2d ee 22 62 f8 cd dc +10 f1 1e 01 74 14 71 bb fd 65 18 a1 75 73 45 75 + +# PKCS#1 v1.5 Signature Example 15.10 + +# ----------------- + +# Message to be signed: +d8 b8 16 45 c1 3c d7 ec f5 d0 0e d2 c9 1b 9a cd +46 c1 55 68 e5 30 3c 4a 97 75 ed e7 6b 48 40 3d +6b e5 6c 05 b6 b1 cf 77 c6 e7 5d e0 96 c5 cb 35 +51 cb 6f a9 64 f3 c8 79 cf 58 9d 28 e1 da 2f 9d +ec + +# Signature: +27 45 07 4c a9 71 75 d9 92 e2 b4 47 91 c3 23 c5 +71 67 16 5c dd 8d a5 79 cd ef 46 86 b9 bb 40 4b +d3 6a 56 50 4e b1 fd 77 0f 60 bf a1 88 a7 b2 4b +0c 91 e8 81 c2 4e 35 b0 4d c4 dd 4c e3 85 66 bc +c9 ce 54 f4 9a 17 5f c9 d0 b2 25 22 d9 57 90 47 +f9 ed 42 ec a8 3f 76 4a 10 16 39 97 94 7e 7d 2b +52 ff 08 98 0e 7e 7c 22 57 93 7b 23 f3 d2 79 d4 +cd 17 d6 f4 95 54 63 73 d9 83 d5 36 ef d7 d1 b6 +71 81 ca 2c b5 0a c6 16 c5 c7 ab fb b9 26 0b 91 +b1 a3 8e 47 24 20 01 ff 45 2f 8d e1 0c a6 ea ea +dc af 9e dc 28 95 6f 28 a7 11 29 1f c9 a8 08 78 +b8 ba 4c fe 25 b8 28 1c b8 0b c9 cd 6d 2b d1 82 +52 46 ee be 25 2d 99 57 ef 93 70 73 52 08 4e 6d +36 d4 23 55 1b f2 66 a8 53 40 fb 4a 6a f3 70 88 +0a ab 07 15 3d 01 f4 8d 08 6d f0 bf be c0 5e 7b +44 3b 97 e7 17 18 97 0e 2f 4b f6 20 23 e9 5b 67 + +# PKCS#1 v1.5 Signature Example 15.11 + +# ----------------- + +# Message to be signed: +e5 73 9b 6c 14 c9 2d 51 0d 95 b8 26 93 33 37 ff +0d 24 ef 72 1a c4 ef 64 c2 ba d2 64 be 8b 44 ef +a1 51 6e 08 a2 7e b6 b6 11 d3 30 1d f0 06 2d ae +fc 73 a8 c0 d9 2e 2c 52 1f ac bc 7b 26 47 38 76 +7e a6 fc 97 d5 88 a0 ba f6 ce 50 ad f7 9e 60 0b +d2 9e 34 5f cb 1d ba 71 ac 5c 02 89 02 3f e4 a8 +2b 46 a5 40 77 19 19 7d 2e 95 8e 35 31 fd 54 ae +f9 03 aa bb 43 55 f8 83 18 99 4e d3 c3 dd 62 f4 +20 a7 + +# Signature: +be 40 a5 fb 94 f1 13 e1 b3 ef f6 b6 a3 39 86 f2 +02 e3 63 f0 74 83 b7 92 e6 8d fa 55 54 df 04 66 +cc 32 15 09 50 78 3b 4d 96 8b 63 9a 04 fd 2f b9 +7f 6e b9 67 02 1f 5a dc cb 9f ca 95 ac c8 f2 cd +88 5a 38 0b 0a 4e 82 bc 76 07 64 db ab 88 c1 e6 +c0 25 5c aa 94 f2 32 19 9d 6f 59 7c c9 14 5b 00 +e3 d4 ba 34 6b 55 9a 88 33 ad 15 16 ad 51 63 f0 +16 af 6a 59 83 1c 82 ea 13 c8 22 4d 84 d0 76 5a +9d 12 38 4d a4 60 a8 53 1b 4c 40 7e 04 f4 f3 50 +70 9e b9 f0 8f 5b 22 0f fb 45 ab f6 b7 5d 15 79 +fd 3f 1e b5 5f c7 5b 00 af 8b a3 b0 87 82 7f e9 +ae 9f b4 f6 c5 fa 63 03 1f e5 82 85 2f e2 83 4f +9c 89 bf f5 3e 25 52 21 6b c7 c1 d4 a3 d5 dc 2b +a6 95 5c d9 b1 7d 13 63 e7 fe e8 ed 76 29 75 3f +f3 12 5e dd 48 52 1a e3 b9 b0 32 17 f4 49 6d 0d +8e de 57 ac bc 5b d4 de ae 74 a5 6f 86 67 1d e2 + +# PKCS#1 v1.5 Signature Example 15.12 + +# ----------------- + +# Message to be signed: +7a f4 28 35 91 7a 88 d6 b3 c6 71 6b a2 f5 b0 d5 +b2 0b d4 e2 e6 e5 74 e0 6a f1 ee f7 c8 11 31 be +22 bf 81 28 b9 cb c6 ec 00 27 5b a8 02 94 a5 d1 +17 2d 08 24 a7 9e 8f dd 83 01 83 e4 c0 0b 96 78 +28 67 b1 22 7f ea 24 9a ad 32 ff c5 fe 00 7b c5 +1f 21 79 2f 72 8d ed a8 b5 70 8a a9 9c ab ab 20 +a4 aa 78 3e d8 6f 0f 27 b5 d5 63 f4 2e 07 15 8c +ea 72 d0 97 aa 68 87 ec 41 1d d0 12 91 2a 5e 03 +2b bf a6 78 50 71 44 bc c9 5f 39 b5 8b e7 bf d1 +75 9a db 9a 91 fa 1d 6d 82 26 a8 34 3a 8b 84 9d +ae 76 f7 b9 82 24 d5 9e 28 f7 81 f1 3e ce 60 5f +84 f6 c9 0b ae 5f 8c f3 78 81 6f 40 20 a7 dd a1 +be d9 0c 92 a2 36 34 d2 03 fa c3 fc d8 6d 68 d3 +18 2a 7d 9c ca be 7b 07 95 f5 c6 55 e9 ac c4 e3 +ec 18 51 40 d1 0c ef 05 34 64 ab 17 5c 83 bd 83 +93 5e 3d ab af 34 62 ee be 63 d1 5f 57 3d 26 9a + +# Signature: +4e 78 c5 90 2b 80 79 14 d1 2f a5 37 ae 68 71 c8 +6d b8 02 1e 55 d1 ad b8 eb 0c cf 1b 8f 36 ab 7d +ad 1f 68 2e 94 7a 62 70 72 f0 3e 62 73 71 78 1d +33 22 1d 17 4a be 46 0d bd 88 56 0c 22 f6 90 11 +6e 2f bb e6 e9 64 36 3a 3e 52 83 bb 5d 94 6e f1 +c0 04 7e ba 03 8c 75 6c 40 be 79 23 05 58 09 b0 +e9 f3 4a 03 a5 88 15 eb dd e7 67 93 1f 01 8f 6f +18 78 f2 ef 4f 47 dd 37 40 51 dd 48 68 5d ed 6e +fb 3e a8 02 1f 44 be 1d 7d 14 93 98 f9 8e a9 c0 +8d 62 88 8e bb 56 19 2d 17 74 7b 6b 8e 17 09 54 +31 f1 25 a8 a8 e9 96 2a a3 1c 28 52 64 e0 8f b2 +1a ac 33 6c e6 c3 8a a3 75 e4 2b c9 2a b0 ab 91 +03 84 31 e1 f9 2c 39 d2 af 5d ed 7e 43 bc 15 1e +6e be a4 c3 e2 58 3a f3 43 7e 82 c4 3c 5e 3b 5b +07 cf 03 59 68 3d 22 98 e3 59 48 ed 80 6c 06 3c +60 6e a1 78 15 0b 1e fc 15 85 69 34 c7 25 5c fe + +# PKCS#1 v1.5 Signature Example 15.13 + +# ----------------- + +# Message to be signed: +eb ae f3 f9 f2 3b df e5 fa 6b 8a f4 c2 08 c1 89 +f2 25 1b f3 2f 5f 13 7b 9d e4 40 63 78 68 6b 3f +07 21 f6 2d 24 cb 86 88 d6 fc 41 a2 7c ba e2 1d +30 e4 29 fe ac c7 11 19 41 c2 77 + +# Signature: +c4 8d be f5 07 11 4f 03 c9 5f af be b4 df 1b fa +88 e0 18 4a 33 cc 4f 8a 9a 10 35 ff 7f 82 2a 5e +38 cd a1 87 23 91 5f f0 78 24 44 29 e0 f6 08 1c +14 fd 83 33 1f a6 5c 6b a7 bb 9a 12 db f6 62 23 +74 cd 0c a5 7d e3 77 4e 2b d7 ae 82 36 77 d0 61 +d5 3a e9 c4 04 0d 2d a7 ef 70 14 f3 bb dc 95 a3 +61 a4 38 55 c8 ce 9b 97 ec ab ce 17 4d 92 62 85 +14 2b 53 4a 30 87 f9 f4 ef 74 51 1e c7 42 b0 d5 +68 56 03 fa f4 03 b5 07 2b 98 5d f4 6a df 2d 25 +29 a0 2d 40 71 1e 21 90 91 70 52 37 1b 79 b7 49 +b8 3a bf 0a e2 94 86 c3 f2 f6 24 77 b2 bd 36 2b +03 9c 01 3c 0c 50 76 ef 52 0d bb 40 5f 42 ce e9 +54 25 c3 73 a9 75 e1 cd d0 32 c4 96 22 c8 50 79 +b0 9e 88 da b2 b1 39 69 ef 7a 72 39 73 78 10 40 +45 9f 57 d5 01 36 38 48 3d e2 d9 1c b3 c4 90 da +81 c4 6d e6 cd 76 ea 8a 0c 8f 6f e3 31 71 2d 24 + +# PKCS#1 v1.5 Signature Example 15.14 + +# ----------------- + +# Message to be signed: +c5 a2 71 12 78 76 1d fc dd 4f 0c 99 e6 f5 61 9d +6c 48 b5 d4 c1 a8 09 82 fa a6 b4 cf 1c f7 a6 0f +f3 27 ab ef 93 c8 01 42 9e fd e0 86 40 85 81 46 +10 56 ac c3 3f 3d 04 f5 ad a2 12 16 ca cd 5f d1 +f9 ed 83 20 3e 0e 2f e6 13 8e 3e ae 84 24 e5 91 +5a 08 3f 3f 7a b7 60 52 c8 be 55 ae 88 2d 6e c1 +48 2b 1e 45 c5 da e9 f4 10 15 40 53 27 02 2e c3 +2f 0e a2 42 97 63 b2 55 04 3b 19 58 ee 3c f6 d6 +39 83 59 6e b3 85 84 4f 85 28 cc 9a 98 65 83 5d +c5 11 3c 02 b8 0d 0f ca 68 aa 25 e7 2b ca ae b3 +cf 9d 79 d8 4f 98 4f d4 17 + +# Signature: +6b d5 25 7a a0 66 11 fb 46 60 08 7c b4 bc 4a 9e +44 91 59 d3 16 52 bd 98 08 44 da f3 b1 c7 b3 53 +f8 e5 61 42 f7 ea 98 57 43 3b 18 57 3b 4d ee de +81 8a 93 b0 29 02 97 78 3f 1a 2f 23 cb c7 27 97 +a6 72 53 7f 01 f6 24 84 cd 41 62 c3 21 4b 9a c6 +28 22 4c 5d e0 1f 32 bb 9b 76 b2 73 54 f2 b1 51 +d0 e8 c4 21 3e 46 15 ad 0b c7 1f 51 5e 30 0d 6a +64 c6 74 34 11 ff fd e8 e5 ff 19 0e 54 92 30 43 +12 6e cf c4 c4 53 90 22 66 8f b6 75 f2 5c 07 e2 +00 99 ee 31 5b 98 d6 af ec 4b 1a 9a 93 dc 33 49 +6a 15 bd 6f de 16 63 a7 d4 9b 9f 1e 63 9d 38 66 +4b 37 a0 10 b1 f3 5e 65 86 82 d9 cd 63 e5 7d e0 +f1 5e 8b dd 09 65 58 f0 7e c0 ca a2 18 a8 c0 6f +47 88 45 39 40 28 7c 9d 34 b6 d4 0a 3f 09 bf 77 +99 fe 98 ae 4e b4 9f 3f f4 1c 50 40 a5 0c ef c9 +bd f2 39 4b 74 9c f1 64 48 0d f1 ab 68 80 27 3b + +# PKCS#1 v1.5 Signature Example 15.15 + +# ----------------- + +# Message to be signed: +9b f8 aa 25 3b 87 2e a7 7a 7e 23 47 6b e2 6b 23 +29 57 8c f6 ac 9e a2 80 5b 35 7f 6f c3 ad 13 0d +ba eb 3d 86 9a 13 cc e7 a8 08 bb bb c9 69 85 7e +03 94 5c 7b b6 1d f1 b5 c2 58 9b 8e 04 6c 2a 5d +7e 40 57 b1 a7 4f 24 c7 11 21 63 64 28 85 29 ec +95 70 f2 51 97 21 3b e1 f5 c2 e5 96 f8 bf 8b 2c +f3 cb 38 aa 56 ff e5 e3 1d f7 39 58 20 e9 4e cf +3b 11 89 a9 65 dc f9 a9 cb 42 98 d3 c8 8b 29 23 +c1 9f c6 bc 34 aa ce ca d4 e0 93 1a 7c 4e 5d 73 +dc 86 df a7 98 a8 47 6d 82 46 3e ef aa 90 a8 a9 +19 2a b0 8b 23 08 8d d5 8e 12 80 f7 d7 2e 45 48 +39 6b aa c1 12 25 2d d5 c5 34 6a db 20 04 a2 f7 +10 1c cc 89 9c c7 fa fa e8 bb e2 95 73 88 96 a5 +b2 01 22 85 01 4e f6 + +# Signature: +27 f7 f4 da 9b d6 10 10 6e f5 7d 32 38 3a 44 8a +8a 62 45 c8 3d c1 30 9c 6d 77 0d 35 7b a8 9e 73 +f2 ad 08 32 06 2e b0 fe 0a c9 15 57 5b cd 6b 8b +ca db 4e 2b a6 fa 9d a7 3a 59 17 51 52 b2 d4 fe +72 b0 70 c9 b7 37 9e 50 00 0e 55 e6 c2 69 f6 65 +8c 93 79 72 79 7d 3a dd 69 f1 30 e3 4b 85 bd ec +9f 3a 9b 39 22 02 d6 f3 e4 30 d0 9c ac a8 22 77 +59 ab 82 5f 70 12 d2 ff 4b 5b 62 c8 50 4d ba d8 +55 c0 5e dd 5c ab 5a 4c cc dc 67 f0 1d d6 51 7c +7d 41 c4 3e 2a 49 57 af f1 9d b6 f1 8b 17 85 9a +f0 bc 84 ab 67 14 6e c1 a4 a6 0a 17 d7 e0 5f 8b +4f 9c ed 6a d1 09 08 d8 d7 8f 7f c8 8b 76 ad c8 +29 0f 87 da f2 a7 be 10 ae 40 85 21 39 5d 54 ed +25 56 fb 76 61 85 4a 73 0c e3 d8 2c 71 a8 d4 93 +ec 49 a3 78 ac 8a 3c 74 43 9f 7c c5 55 ba 13 f8 +59 07 08 90 ee 18 ff 65 8f a4 d7 41 96 9d 70 a5 + +# PKCS#1 v1.5 Signature Example 15.16 + +# ----------------- + +# Message to be signed: +32 47 48 30 e2 20 37 54 c8 bf 06 81 dc 4f 84 2a +fe 36 09 30 37 86 16 c1 08 e8 33 65 6e 56 40 c8 +68 56 88 5b b0 5d 1e b9 43 8e fe de 67 92 63 de +07 cb 39 55 3f 6a 25 e0 06 b0 a5 23 11 a0 63 ca +08 82 66 d2 56 4f f6 49 0c 46 b5 60 98 18 54 8f +88 76 4d ad 34 a2 5e 3a 85 d5 75 02 3f 0b 9e 66 +50 48 a0 3c 35 05 79 a9 d3 24 46 c7 bb 96 cc 92 +e0 65 ab 94 d3 c8 95 2e 8d f6 8e f0 d9 fa 45 6b +3a 06 bb 80 e3 bb c4 b2 8e 6a 94 b6 d0 ff 76 96 +a6 4e fe 05 e7 35 fe a0 25 d7 bd bc 41 39 f3 a3 +b5 46 07 5c ba 7e fa 94 73 74 d3 f0 ac 80 a6 8d +76 5f 5d f6 21 0b ca 06 9a 2d 88 64 7a f7 ea 04 +2d ac 69 0c b5 73 78 ec 07 77 61 4f b8 b6 5f f4 +53 ca 6b 7d ce 60 98 45 1a 2f 8c 0d a9 bf ec f1 +fd f3 91 bb aa 4e 2a 91 ca 18 a1 12 1a 75 23 a2 +ab d4 25 14 f4 89 e8 + +# Signature: +69 17 43 72 57 c2 2c cb 54 03 29 0c 3d ee 82 d9 +cf 75 50 b3 1b d3 1c 51 bd 57 bf d3 5d 45 2a b4 +db 7c 4b e6 b2 e2 5a c9 a5 9a 1d 2a 7f eb 62 7f +0a fd 49 76 b3 00 3c c9 cf fd 88 96 50 5e c3 82 +f2 65 10 4d 4c f8 c9 32 fa 9f e8 6e 00 87 07 95 +99 12 38 9d a4 b2 d6 b3 69 b3 6a 5e 72 e2 9d 24 +c9 a9 8c 9d 31 a3 ab 44 e6 43 e6 94 12 66 a4 7a +45 e3 44 6c e8 77 6a be 24 1a 8f 5f c6 42 3b 24 +b1 ff 25 0d c2 c3 a8 17 23 53 56 10 77 e8 50 a7 +69 b2 5f 03 25 da c8 89 65 a3 b9 b4 72 c4 94 e9 +5f 71 9b 4e ac 33 2c aa 7a 65 c7 df e4 6d 9a a7 +e6 e0 0f 52 5f 30 3d d6 3a b7 91 92 18 90 18 68 +f9 33 7f 8c d2 6a af e6 f3 3b 7f b2 c9 88 10 af +19 f7 fc b2 82 ba 15 77 91 2c 1d 36 89 75 fd 5d +44 0b 86 e1 0c 19 97 15 fa 0b 6f 42 50 b5 33 73 +2d 0b ef e1 54 51 50 fc 47 b8 76 de 09 b0 0a 94 + +# PKCS#1 v1.5 Signature Example 15.17 + +# ----------------- + +# Message to be signed: +00 8e 59 50 5e af b5 50 aa e5 e8 45 58 4c eb b0 +0b 6d e1 73 3e 9f 95 d4 2c 88 2a 5b be b5 ce 1c +57 e1 19 e7 c0 d4 da ca 9f 1f f7 87 02 17 f7 cf +d8 a6 b3 73 97 7c ac 9c ab 8e 71 e4 20 + +# Signature: +92 25 03 b6 73 ee 5f 3e 69 1e 1c a8 5e 9f f4 17 +3c f7 2b 05 ac 2c 13 1d a5 60 35 93 e3 bc 25 9c +94 c1 f7 d3 a0 6a 5b 98 91 bf 11 3f a3 9e 59 ff +7c 1e d6 46 5e 90 80 49 cb 89 e4 e1 25 cd 37 d2 +ff d9 22 7a 41 b4 a0 a1 9c 0a 44 fb bf 3d e5 5b +ab 80 20 87 a3 bb 8d 4f f6 68 ee 6b bb 8a d8 9e +68 57 a7 9a 9c 72 78 19 90 df cf 92 cd 51 94 04 +c9 50 f1 3d 11 43 c3 18 4f 1d 25 0c 90 e1 7a c6 +ce 36 16 3b 98 95 62 7a d6 ff ec 14 22 44 1f 55 +e4 49 9d ba 9b e8 95 46 ae 8b c6 3c ca 01 dd 08 +46 3a e7 f1 fc e3 d8 93 99 69 38 77 8c 18 12 e6 +74 ad 9c 30 9c 5a cc a3 fd e4 4e 7d d8 69 59 93 +e9 c1 fa 87 ac da 99 ec e5 c8 49 9e 46 89 57 ad +66 35 9b f1 2a 51 ad be 78 d3 a2 13 b4 49 bf 0b +5f 8d 4d 49 6a cf 03 d3 03 3b 7c cd 19 6b c2 2f +68 fb 7b ef 4f 69 7c 5e a2 b3 50 62 f4 8a 36 dd + +# PKCS#1 v1.5 Signature Example 15.18 + +# ----------------- + +# Message to be signed: +6a bc 54 cf 8d 1d ff 1f 53 b1 7d 81 60 36 88 78 +a8 78 8c c6 d2 2f a5 c2 25 8c 88 e6 60 b0 9a 89 +33 f9 f2 c0 50 4d da dc 21 f6 e7 5e 0b 83 3b eb +55 52 29 de e6 56 b9 04 7b 92 f6 2e 76 b8 ff cc +60 da b0 6b 80 + +# Signature: +0b 6d af 42 f7 a8 62 14 7e 41 74 93 c2 c4 01 ef +ae 32 63 6a b4 cb d4 41 92 bb f5 f1 95 b5 0a e0 +96 a4 75 a1 61 4f 0a 9f a8 f7 a0 26 cb 46 c6 50 +6e 51 8e 33 d8 3e 56 47 7a 87 5a ca 8c 7e 71 4c +e1 bd bd 61 ef 5d 53 52 39 b3 3f 2b fd d6 17 71 +ba b6 27 76 d7 81 71 a1 42 3c ea 87 31 f8 2e 60 +76 6d 64 54 26 56 20 b1 5f 5c 5a 58 4f 55 f9 5b +80 2f e7 8c 57 4e d5 da cf c8 31 f3 cf 2b 05 02 +c0 b2 98 f2 5c cf 11 f9 73 b3 1f 85 e4 74 42 19 +85 f3 cf f7 02 df 39 46 ef 0a 66 05 68 21 11 b2 +f5 5b 1f 8a b0 d2 ea 3a 68 3c 69 98 5e ad 93 ed +44 9e a4 8f 03 58 dd f7 08 02 cb 41 de 2f d8 3f +3c 80 80 82 d8 49 36 94 8e 0c 84 a1 31 b4 92 78 +27 46 05 27 bb 5c d2 4b fa b7 b4 8e 07 1b 24 17 +19 30 f9 97 63 27 2f 97 97 bc b7 6f 1d 24 81 57 +55 58 fc f2 60 b1 f0 e5 54 eb b3 df 3c fc b9 58 + +# PKCS#1 v1.5 Signature Example 15.19 + +# ----------------- + +# Message to be signed: +af 2d 78 15 2c f1 0e fe 01 d2 74 f2 17 b1 77 f6 +b0 1b 5e 74 9f 15 67 71 5d a3 24 85 9c d3 dd 88 +db 84 8e c7 9f 48 db ba 7b 6f 1d 33 11 1e f3 1b +64 89 9e 73 91 c2 bf fd 69 f4 90 25 cf 20 1f c5 +85 db d1 54 2c 1c 77 8a 2c e7 a7 ee 10 8a 30 9f +ec a2 6d 13 3a 5f fe dc 4e 86 9d cd 76 56 59 6a +c8 42 7e a3 ef 6e 3f d7 8f e9 9d 8d dc 71 d8 39 +f6 78 6e 0d a6 e7 86 bd 62 b3 a4 f1 9b 89 1a 56 +15 7a 55 4e c2 a2 b3 9e 25 a1 d7 c7 d3 73 21 c7 +a1 d9 46 cf 4f be 75 8d 92 76 f0 85 63 44 9d 67 +41 4a 2c 03 0f 42 51 cf e2 21 3d 04 a5 41 06 37 +87 + +# Signature: +20 9c 61 15 78 57 38 7b 71 e2 4b f3 dd 56 41 45 +50 50 3b ec 18 0f f5 3b dd 9b ac 06 2a 2d 49 95 +09 bf 99 12 81 b7 95 27 df 91 36 61 5b 7a 6d 9d +b3 a1 03 b5 35 e0 20 2a 2c ac a1 97 a7 b7 4e 53 +56 f3 dd 59 5b 49 ac fd 9d 30 04 9a 98 ca 88 f6 +25 bc a1 d5 f2 2a 39 2d 8a 74 9e fb 6e ed 9b 78 +21 d3 11 0a c0 d2 44 19 9e cb 4a a3 d7 35 a8 3a +2e 88 93 c6 bf 85 81 38 3c ca ee 83 46 35 b7 fa +1f af fa 45 b1 3d 15 c1 da 33 af 71 e8 93 03 d6 +80 90 ff 62 ee 61 5f df 5a 84 d1 20 71 1d a5 3c +28 89 19 8a b3 83 17 a9 73 4a b2 7d 67 92 4c ea +74 15 6f f9 9b ef 98 76 bb 5c 33 9e 93 74 52 83 +e1 b3 4e 07 22 26 b8 80 45 e0 17 e9 f0 5b 2a 8c +41 67 40 25 8e 22 3b 26 90 02 74 91 73 22 73 f3 +22 9d 9e f2 b1 b3 80 7e 32 10 18 92 0a d3 e5 3d +ae 47 e6 d9 39 5c 18 4b 93 a3 74 c6 71 fa a2 ce + +# PKCS#1 v1.5 Signature Example 15.20 + +# ----------------- + +# Message to be signed: +40 ee 99 24 58 d6 f6 14 86 d2 56 76 a9 6d d2 cb +93 a3 7f 04 b1 78 48 2f 2b 18 6c f8 82 15 27 0d +ba 29 d7 86 d7 74 b0 c5 e7 8c 7f 6e 56 a9 56 e7 +f7 39 50 a2 b0 c0 c1 0a 08 db cd 67 e5 b2 10 bb +21 c5 8e 27 67 d4 4f 7d d4 01 4e 39 66 14 3b f7 +e3 d6 6f f0 c0 9b e4 c5 5f 93 b3 99 94 b8 51 8d +9c 1d 76 d5 b4 73 74 de a0 8f 15 7d 57 d7 06 34 +97 8f 38 56 e0 e5 b4 81 af bb db 5a 3a c4 8d 48 +4b e9 2c 93 de 22 91 78 35 4c 2d e5 26 e9 c6 5a +31 ed e1 ef 68 cb 63 98 d7 91 16 84 fe c0 ba bc +3a 78 1a 66 66 07 83 50 69 74 d0 e1 48 25 10 1c +3b fa ea + +# Signature: +92 75 02 b8 24 af c4 25 13 ca 65 70 de 33 8b 8a +64 c3 a8 5e b8 28 d3 19 36 24 f2 7e 8b 10 29 c5 +5c 11 9c 97 33 b1 8f 58 49 b3 50 09 18 bc c0 05 +51 d9 a8 fd f5 3a 97 74 9f a8 dc 48 0d 6f e9 74 +2a 58 71 f9 73 92 65 28 97 2a 1a f4 9e 39 25 b0 +ad f1 4a 84 27 19 b4 a5 a2 d8 9f a9 c0 b6 60 5d +21 2b ed 1e 67 23 b9 34 06 ad 30 e8 68 29 a5 c7 +19 b8 90 b3 89 30 6d c5 50 64 86 ee 2f 36 a8 df +e0 a9 6a f6 78 c9 cb d6 af f3 97 ca 20 0e 3e dc +1e 36 bd 2f 08 b3 1d 54 0c 0c b2 82 a9 55 9e 4a +dd 4f c9 e6 49 2e ed 0c cb d3 a6 98 2e 5f aa 2d +dd 17 be 47 41 7c 80 b4 e5 45 2d 31 f7 24 01 a0 +42 32 51 09 54 4d 95 4c 01 93 90 79 d4 09 a5 c3 +78 d7 51 2d fc 2d 2a 71 ef cc 34 32 a7 65 d1 c6 +a5 2c fc e8 99 cd 79 b1 5b 4f c3 72 36 41 ef 6b +d0 0a cc 10 40 7e 5d f5 8d d1 c3 c5 c5 59 a5 06 + +# ============================================= diff --git a/notes/rsa-testvectors/pss-int.txt b/notes/rsa-testvectors/pss-int.txt new file mode 100755 index 000000000..667c753f2 --- /dev/null +++ b/notes/rsa-testvectors/pss-int.txt @@ -0,0 +1,162 @@ +# ================================= +# WORKED-OUT EXAMPLE FOR RSASSA-PSS +# ================================= +# +# This file gives an example of the process of +# signing a message with RSASSA-PSS as +# specified in PKCS #1 v2.1. +# +# The message is an octet string of length 114, +# while the size of the modulus in the public +# key is 1024 bits. The message is signed via a +# random salt of length 20 octets +# +# The underlying hash function in the EMSA-PSS +# encoding method is SHA-1; the mask generation +# function is MGF1 with SHA-1 as specified in +# PKCS #1 v2.1. +# +# Integers are represented by strings of octets +# with the leftmost octet being the most +# significant octet. For example, +# +# 9,202,000 = (0x)8c 69 50. +# +# ============================================= + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +a2 ba 40 ee 07 e3 b2 bd 2f 02 ce 22 7f 36 a1 95 +02 44 86 e4 9c 19 cb 41 bb bd fb ba 98 b2 2b 0e +57 7c 2e ea ff a2 0d 88 3a 76 e6 5e 39 4c 69 d4 +b3 c0 5a 1e 8f ad da 27 ed b2 a4 2b c0 00 fe 88 +8b 9b 32 c2 2d 15 ad d0 cd 76 b3 e7 93 6e 19 95 +5b 22 0d d1 7d 4e a9 04 b1 ec 10 2b 2e 4d e7 75 +12 22 aa 99 15 10 24 c7 cb 41 cc 5e a2 1d 00 ee +b4 1f 7c 80 08 34 d2 c6 e0 6b ce 3b ce 7e a9 a5 + +# RSA public exponent e: +01 00 01 + +# Prime p: +d1 7f 65 5b f2 7c 8b 16 d3 54 62 c9 05 cc 04 a2 +6f 37 e2 a6 7f a9 c0 ce 0d ce d4 72 39 4a 0d f7 +43 fe 7f 92 9e 37 8e fd b3 68 ed df f4 53 cf 00 +7a f6 d9 48 e0 ad e7 57 37 1f 8a 71 1e 27 8f 6b + +# Prime q: +c6 d9 2b 6f ee 74 14 d1 35 8c e1 54 6f b6 29 87 +53 0b 90 bd 15 e0 f1 49 63 a5 e2 63 5a db 69 34 +7e c0 c0 1b 2a b1 76 3f d8 ac 1a 59 2f b2 27 57 +46 3a 98 24 25 bb 97 a3 a4 37 c5 bf 86 d0 3f 2f + +# p's CRT exponent dP: +9d 0d bf 83 e5 ce 9e 4b 17 54 dc d5 cd 05 bc b7 +b5 5f 15 08 33 0e a4 9f 14 d4 e8 89 55 0f 82 56 +cb 5f 80 6d ff 34 b1 7a da 44 20 88 53 57 7d 08 +e4 26 28 90 ac f7 52 46 1c ea 05 54 76 01 bc 4f + +# q's CRT exponent dQ: +12 91 a5 24 c6 b7 c0 59 e9 0e 46 dc 83 b2 17 1e +b3 fa 98 81 8f d1 79 b6 c8 bf 6c ec aa 47 63 03 +ab f2 83 fe 05 76 9c fc 49 57 88 fe 5b 1d df de +9e 88 4a 3c d5 e9 36 b7 e9 55 eb f9 7e b5 63 b1 + +# CRT coefficient qInv: +a6 3f 1d a3 8b 95 0c 9a d1 c6 7c e0 d6 77 ec 29 +14 cd 7d 40 06 2d f4 2a 67 eb 19 8a 17 6f 97 42 +aa c7 c5 fe a1 4f 22 97 66 2b 84 81 2c 4d ef c4 +9a 80 25 ab 43 82 28 6b e4 c0 37 88 dd 01 d6 9f + +# --------------------------------- +# Step-by-step RSASSA-PSS Signature +# --------------------------------- + +# Message M to be signed: +85 9e ef 2f d7 8a ca 00 30 8b dc 47 11 93 bf 55 +bf 9d 78 db 8f 8a 67 2b 48 46 34 f3 c9 c2 6e 64 +78 ae 10 26 0f e0 dd 8c 08 2e 53 a5 29 3a f2 17 +3c d5 0c 6d 5d 35 4f eb f7 8b 26 02 1c 25 c0 27 +12 e7 8c d4 69 4c 9f 46 97 77 e4 51 e7 f8 e9 e0 +4c d3 73 9c 6b bf ed ae 48 7f b5 56 44 e9 ca 74 +ff 77 a5 3c b7 29 80 2f 6e d4 a5 ff a8 ba 15 98 +90 fc + +# mHash = Hash(M) +# salt = random string of octets +# M' = Padding || mHash || salt +# H = Hash(M') +# DB = Padding || salt +# dbMask = MGF(H, length(DB)) +# maskedDB = DB xor dbMask (leftmost bit set to +# zero) +# EM = maskedDB || H || 0xbc + +# mHash: +37 b6 6a e0 44 58 43 35 3d 47 ec b0 b4 fd 14 c1 +10 e6 2d 6a + +# salt: +e3 b5 d5 d0 02 c1 bc e5 0c 2b 65 ef 88 a1 88 d8 +3b ce 7e 61 + +# M': +00 00 00 00 00 00 00 00 37 b6 6a e0 44 58 43 35 +3d 47 ec b0 b4 fd 14 c1 10 e6 2d 6a e3 b5 d5 d0 +02 c1 bc e5 0c 2b 65 ef 88 a1 88 d8 3b ce 7e 61 + +# H: +df 1a 89 6f 9d 8b c8 16 d9 7c d7 a2 c4 3b ad 54 +6f be 8c fe + +# DB: +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 01 e3 b5 d5 d0 02 c1 bc e5 0c +2b 65 ef 88 a1 88 d8 3b ce 7e 61 + +# dbMask: +66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67 +d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af +50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4 +d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1 +e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec +d3 18 3a 31 1f c8 97 39 a9 66 43 13 6e 8b 0f 46 +5e 87 a4 53 5c d4 c5 9b 10 02 8d + +# maskedDB: +66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67 +d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af +50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4 +d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1 +e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec +d3 18 3a 31 1f c8 96 da 1c b3 93 11 af 37 ea 4a +75 e2 4b db fd 5c 1d a0 de 7c ec + +# Encoded message EM: +66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67 +d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af +50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4 +d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1 +e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec +d3 18 3a 31 1f c8 96 da 1c b3 93 11 af 37 ea 4a +75 e2 4b db fd 5c 1d a0 de 7c ec df 1a 89 6f 9d +8b c8 16 d9 7c d7 a2 c4 3b ad 54 6f be 8c fe bc + +# Signature S, the RSA decryption of EM: +8d aa 62 7d 3d e7 59 5d 63 05 6c 7e c6 59 e5 44 +06 f1 06 10 12 8b aa e8 21 c8 b2 a0 f3 93 6d 54 +dc 3b dc e4 66 89 f6 b7 95 1b b1 8e 84 05 42 76 +97 18 d5 71 5d 21 0d 85 ef bb 59 61 92 03 2c 42 +be 4c 29 97 2c 85 62 75 eb 6d 5a 45 f0 5f 51 87 +6f c6 74 3d ed dd 28 ca ec 9b b3 0e a9 9e 02 c3 +48 82 69 60 4f e4 97 f7 4c cd 7c 7f ca 16 71 89 +71 23 cb d3 0d ef 5d 54 a2 b5 53 6a d9 0a 74 7e + +# ============================================= diff --git a/notes/rsa-testvectors/pss-vect.txt b/notes/rsa-testvectors/pss-vect.txt new file mode 100755 index 000000000..001e3c4dc --- /dev/null +++ b/notes/rsa-testvectors/pss-vect.txt @@ -0,0 +1,2581 @@ +# =========================== +# TEST VECTORS FOR RSASSA-PSS +# =========================== +# +# This file contains test vectors for the +# RSASSA-PSS signature scheme with appendix as +# defined in PKCS #1 v2.1. 10 RSA keys of +# different sizes have been generated. For each +# key, 6 random messages of length between 1 +# and 256 octets have been RSASSA-PSS signed +# via a random salt of length 20 octets. +# +# The underlying hash function in the EMSA-PSS +# encoding method is SHA-1; the mask generation +# function is MGF1 with SHA-1 as specified in +# PKCS #1 v2.1. +# +# Integers are represented by strings of octets +# with the leftmost octet being the most +# significant octet. For example, +# +# 9,202,000 = (0x)8c 69 50. +# +# Key lengths: +# +# Key 1: 1024 bits +# Key 2: 1025 bits +# Key 3: 1026 bits +# Key 4: 1027 bits +# Key 5: 1028 bits +# Key 6: 1029 bits +# Key 7: 1030 bits +# Key 8: 1031 bits +# Key 9: 1536 bits +# Key 10: 2048 bits +# +# ============================================= + +# ================================== +# Example 1: A 1024-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +a5 6e 4a 0e 70 10 17 58 9a 51 87 dc 7e a8 41 d1 +56 f2 ec 0e 36 ad 52 a4 4d fe b1 e6 1f 7a d9 91 +d8 c5 10 56 ff ed b1 62 b4 c0 f2 83 a1 2a 88 a3 +94 df f5 26 ab 72 91 cb b3 07 ce ab fc e0 b1 df +d5 cd 95 08 09 6d 5b 2b 8b 6d f5 d6 71 ef 63 77 +c0 92 1c b2 3c 27 0a 70 e2 59 8e 6f f8 9d 19 f1 +05 ac c2 d3 f0 cb 35 f2 92 80 e1 38 6b 6f 64 c4 +ef 22 e1 e1 f2 0d 0c e8 cf fb 22 49 bd 9a 21 37 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +33 a5 04 2a 90 b2 7d 4f 54 51 ca 9b bb d0 b4 47 +71 a1 01 af 88 43 40 ae f9 88 5f 2a 4b be 92 e8 +94 a7 24 ac 3c 56 8c 8f 97 85 3a d0 7c 02 66 c8 +c6 a3 ca 09 29 f1 e8 f1 12 31 88 44 29 fc 4d 9a +e5 5f ee 89 6a 10 ce 70 7c 3e d7 e7 34 e4 47 27 +a3 95 74 50 1a 53 26 83 10 9c 2a ba ca ba 28 3c +31 b4 bd 2f 53 c3 ee 37 e3 52 ce e3 4f 9e 50 3b +d8 0c 06 22 ad 79 c6 dc ee 88 35 47 c6 a3 b3 25 + +# Prime p: +e7 e8 94 27 20 a8 77 51 72 73 a3 56 05 3e a2 a1 +bc 0c 94 aa 72 d5 5c 6e 86 29 6b 2d fc 96 79 48 +c0 a7 2c bc cc a7 ea cb 35 70 6e 09 a1 df 55 a1 +53 5b d9 b3 cc 34 16 0b 3b 6d cd 3e da 8e 64 43 + +# Prime q: +b6 9d ca 1c f7 d4 d7 ec 81 e7 5b 90 fc ca 87 4a +bc de 12 3f d2 70 01 80 aa 90 47 9b 6e 48 de 8d +67 ed 24 f9 f1 9d 85 ba 27 58 74 f5 42 cd 20 dc +72 3e 69 63 36 4a 1f 94 25 45 2b 26 9a 67 99 fd + +# p's CRT exponent dP: +28 fa 13 93 86 55 be 1f 8a 15 9c ba ca 5a 72 ea +19 0c 30 08 9e 19 cd 27 4a 55 6f 36 c4 f6 e1 9f +55 4b 34 c0 77 79 04 27 bb dd 8d d3 ed e2 44 83 +28 f3 85 d8 1b 30 e8 e4 3b 2f ff a0 27 86 19 79 + +# q's CRT exponent dQ: +1a 8b 38 f3 98 fa 71 20 49 89 8d 7f b7 9e e0 a7 +76 68 79 12 99 cd fa 09 ef c0 e5 07 ac b2 1e d7 +43 01 ef 5b fd 48 be 45 5e ae b6 e1 67 82 55 82 +75 80 a8 e4 e8 e1 41 51 d1 51 0a 82 a3 f2 e7 29 + +# CRT coefficient qInv: +27 15 6a ba 41 26 d2 4a 81 f3 a5 28 cb fb 27 f5 +68 86 f8 40 a9 f6 e8 6e 17 a4 4b 94 fe 93 19 58 +4b 8e 22 fd de 1e 5a 2e 3b d8 aa 5b a8 d8 58 41 +94 eb 21 90 ac f8 32 b8 47 f1 3a 3d 24 a7 9f 4d + +# -------------------------------- +# RSASSA-PSS Signature Example 1.1 +# -------------------------------- + +# Message to be signed: +cd c8 7d a2 23 d7 86 df 3b 45 e0 bb bc 72 13 26 +d1 ee 2a f8 06 cc 31 54 75 cc 6f 0d 9c 66 e1 b6 +23 71 d4 5c e2 39 2e 1a c9 28 44 c3 10 10 2f 15 +6a 0d 8d 52 c1 f4 c4 0b a3 aa 65 09 57 86 cb 76 +97 57 a6 56 3b a9 58 fe d0 bc c9 84 e8 b5 17 a3 +d5 f5 15 b2 3b 8a 41 e7 4a a8 67 69 3f 90 df b0 +61 a6 e8 6d fa ae e6 44 72 c0 0e 5f 20 94 57 29 +cb eb e7 7f 06 ce 78 e0 8f 40 98 fb a4 1f 9d 61 +93 c0 31 7e 8b 60 d4 b6 08 4a cb 42 d2 9e 38 08 +a3 bc 37 2d 85 e3 31 17 0f cb f7 cc 72 d0 b7 1c +29 66 48 b3 a4 d1 0f 41 62 95 d0 80 7a a6 25 ca +b2 74 4f d9 ea 8f d2 23 c4 25 37 02 98 28 bd 16 +be 02 54 6f 13 0f d2 e3 3b 93 6d 26 76 e0 8a ed +1b 73 31 8b 75 0a 01 67 d0 + +# Salt: +de e9 59 c7 e0 64 11 36 14 20 ff 80 18 5e d5 7f +3e 67 76 af + +# Signature: +90 74 30 8f b5 98 e9 70 1b 22 94 38 8e 52 f9 71 +fa ac 2b 60 a5 14 5a f1 85 df 52 87 b5 ed 28 87 +e5 7c e7 fd 44 dc 86 34 e4 07 c8 e0 e4 36 0b c2 +26 f3 ec 22 7f 9d 9e 54 63 8e 8d 31 f5 05 12 15 +df 6e bb 9c 2f 95 79 aa 77 59 8a 38 f9 14 b5 b9 +c1 bd 83 c4 e2 f9 f3 82 a0 d0 aa 35 42 ff ee 65 +98 4a 60 1b c6 9e b2 8d eb 27 dc a1 2c 82 c2 d4 +c3 f6 6c d5 00 f1 ff 2b 99 4d 8a 4e 30 cb b3 3c + +# -------------------------------- +# RSASSA-PSS Signature Example 1.2 +# -------------------------------- + +# Message to be signed: +85 13 84 cd fe 81 9c 22 ed 6c 4c cb 30 da eb 5c +f0 59 bc 8e 11 66 b7 e3 53 0c 4c 23 3e 2b 5f 8f +71 a1 cc a5 82 d4 3e cc 72 b1 bc a1 6d fc 70 13 +22 6b 9e + +# Salt: +ef 28 69 fa 40 c3 46 cb 18 3d ab 3d 7b ff c9 8f +d5 6d f4 2d + +# Signature: +3e f7 f4 6e 83 1b f9 2b 32 27 41 42 a5 85 ff ce +fb dc a7 b3 2a e9 0d 10 fb 0f 0c 72 99 84 f0 4e +f2 9a 9d f0 78 07 75 ce 43 73 9b 97 83 83 90 db +0a 55 05 e6 3d e9 27 02 8d 9d 29 b2 19 ca 2c 45 +17 83 25 58 a5 5d 69 4a 6d 25 b9 da b6 60 03 c4 +cc cd 90 78 02 19 3b e5 17 0d 26 14 7d 37 b9 35 +90 24 1b e5 1c 25 05 5f 47 ef 62 75 2c fb e2 14 +18 fa fe 98 c2 2c 4d 4d 47 72 4f db 56 69 e8 43 + +# -------------------------------- +# RSASSA-PSS Signature Example 1.3 +# -------------------------------- + +# Message to be signed: +a4 b1 59 94 17 61 c4 0c 6a 82 f2 b8 0d 1b 94 f5 +aa 26 54 fd 17 e1 2d 58 88 64 67 9b 54 cd 04 ef +8b d0 30 12 be 8d c3 7f 4b 83 af 79 63 fa ff 0d +fa 22 54 77 43 7c 48 01 7f f2 be 81 91 cf 39 55 +fc 07 35 6e ab 3f 32 2f 7f 62 0e 21 d2 54 e5 db +43 24 27 9f e0 67 e0 91 0e 2e 81 ca 2c ab 31 c7 +45 e6 7a 54 05 8e b5 0d 99 3c db 9e d0 b4 d0 29 +c0 6d 21 a9 4c a6 61 c3 ce 27 fa e1 d6 cb 20 f4 +56 4d 66 ce 47 67 58 3d 0e 5f 06 02 15 b5 90 17 +be 85 ea 84 89 39 12 7b d8 c9 c4 d4 7b 51 05 6c +03 1c f3 36 f1 7c 99 80 f3 b8 f5 b9 b6 87 8e 8b +79 7a a4 3b 88 26 84 33 3e 17 89 3f e9 ca a6 aa +29 9f 7e d1 a1 8e e2 c5 48 64 b7 b2 b9 9b 72 61 +8f b0 25 74 d1 39 ef 50 f0 19 c9 ee f4 16 97 13 +38 e7 d4 70 + +# Salt: +71 0b 9c 47 47 d8 00 d4 de 87 f1 2a fd ce 6d f1 +81 07 cc 77 + +# Signature: +66 60 26 fb a7 1b d3 e7 cf 13 15 7c c2 c5 1a 8e +4a a6 84 af 97 78 f9 18 49 f3 43 35 d1 41 c0 01 +54 c4 19 76 21 f9 62 4a 67 5b 5a bc 22 ee 7d 5b +aa ff aa e1 c9 ba ca 2c c3 73 b3 f3 3e 78 e6 14 +3c 39 5a 91 aa 7f ac a6 64 eb 73 3a fd 14 d8 82 +72 59 d9 9a 75 50 fa ca 50 1e f2 b0 4e 33 c2 3a +a5 1f 4b 9e 82 82 ef db 72 8c c0 ab 09 40 5a 91 +60 7c 63 69 96 1b c8 27 0d 2d 4f 39 fc e6 12 b1 + +# -------------------------------- +# RSASSA-PSS Signature Example 1.4 +# -------------------------------- + +# Message to be signed: +bc 65 67 47 fa 9e af b3 f0 + +# Salt: +05 6f 00 98 5d e1 4d 8e f5 ce a9 e8 2f 8c 27 be +f7 20 33 5e + +# Signature: +46 09 79 3b 23 e9 d0 93 62 dc 21 bb 47 da 0b 4f +3a 76 22 64 9a 47 d4 64 01 9b 9a ea fe 53 35 9c +17 8c 91 cd 58 ba 6b cb 78 be 03 46 a7 bc 63 7f +4b 87 3d 4b ab 38 ee 66 1f 19 96 34 c5 47 a1 ad +84 42 e0 3d a0 15 b1 36 e5 43 f7 ab 07 c0 c1 3e +42 25 b8 de 8c ce 25 d4 f6 eb 84 00 f8 1f 7e 18 +33 b7 ee 6e 33 4d 37 09 64 ca 79 fd b8 72 b4 d7 +52 23 b5 ee b0 81 01 59 1f b5 32 d1 55 a6 de 87 + +# -------------------------------- +# RSASSA-PSS Signature Example 1.5 +# -------------------------------- + +# Message to be signed: +b4 55 81 54 7e 54 27 77 0c 76 8e 8b 82 b7 55 64 +e0 ea 4e 9c 32 59 4d 6b ff 70 65 44 de 0a 87 76 +c7 a8 0b 45 76 55 0e ee 1b 2a ca bc 7e 8b 7d 3e +f7 bb 5b 03 e4 62 c1 10 47 ea dd 00 62 9a e5 75 +48 0a c1 47 0f e0 46 f1 3a 2b f5 af 17 92 1d c4 +b0 aa 8b 02 be e6 33 49 11 65 1d 7f 85 25 d1 0f +32 b5 1d 33 be 52 0d 3d df 5a 70 99 55 a3 df e7 +82 83 b9 e0 ab 54 04 6d 15 0c 17 7f 03 7f dc cc +5b e4 ea 5f 68 b5 e5 a3 8c 9d 7e dc cc c4 97 5f +45 5a 69 09 b4 + +# Salt: +80 e7 0f f8 6a 08 de 3e c6 09 72 b3 9b 4f bf dc +ea 67 ae 8e + +# Signature: +1d 2a ad 22 1c a4 d3 1d df 13 50 92 39 01 93 98 +e3 d1 4b 32 dc 34 dc 5a f4 ae ae a3 c0 95 af 73 +47 9c f0 a4 5e 56 29 63 5a 53 a0 18 37 76 15 b1 +6c b9 b1 3b 3e 09 d6 71 eb 71 e3 87 b8 54 5c 59 +60 da 5a 64 77 6e 76 8e 82 b2 c9 35 83 bf 10 4c +3f db 23 51 2b 7b 4e 89 f6 33 dd 00 63 a5 30 db +45 24 b0 1c 3f 38 4c 09 31 0e 31 5a 79 dc d3 d6 +84 02 2a 7f 31 c8 65 a6 64 e3 16 97 8b 75 9f ad + +# -------------------------------- +# RSASSA-PSS Signature Example 1.6 +# -------------------------------- + +# Message to be signed: +10 aa e9 a0 ab 0b 59 5d 08 41 20 7b 70 0d 48 d7 +5f ae dd e3 b7 75 cd 6b 4c c8 8a e0 6e 46 94 ec +74 ba 18 f8 52 0d 4f 5e a6 9c bb e7 cc 2b eb a4 +3e fd c1 02 15 ac 4e b3 2d c3 02 a1 f5 3d c6 c4 +35 22 67 e7 93 6c fe bf 7c 8d 67 03 57 84 a3 90 +9f a8 59 c7 b7 b5 9b 8e 39 c5 c2 34 9f 18 86 b7 +05 a3 02 67 d4 02 f7 48 6a b4 f5 8c ad 5d 69 ad +b1 7a b8 cd 0c e1 ca f5 02 5a f4 ae 24 b1 fb 87 +94 c6 07 0c c0 9a 51 e2 f9 91 13 11 e3 87 7d 00 +44 c7 1c 57 a9 93 39 50 08 80 6b 72 3a c3 83 73 +d3 95 48 18 18 52 8c 1e 70 53 73 92 82 05 35 29 +51 0e 93 5c d0 fa 77 b8 fa 53 cc 2d 47 4b d4 fb +3c c5 c6 72 d6 ff dc 90 a0 0f 98 48 71 2c 4b cf +e4 6c 60 57 36 59 b1 1e 64 57 e8 61 f0 f6 04 b6 +13 8d 14 4f 8c e4 e2 da 73 + +# Salt: +a8 ab 69 dd 80 1f 00 74 c2 a1 fc 60 64 98 36 c6 +16 d9 96 81 + +# Signature: +2a 34 f6 12 5e 1f 6b 0b f9 71 e8 4f bd 41 c6 32 +be 8f 2c 2a ce 7d e8 b6 92 6e 31 ff 93 e9 af 98 +7f bc 06 e5 1e 9b e1 4f 51 98 f9 1f 3f 95 3b d6 +7d a6 0a 9d f5 97 64 c3 dc 0f e0 8e 1c be f0 b7 +5f 86 8d 10 ad 3f ba 74 9f ef 59 fb 6d ac 46 a0 +d6 e5 04 36 93 31 58 6f 58 e4 62 8f 39 aa 27 89 +82 54 3b c0 ee b5 37 dc 61 95 80 19 b3 94 fb 27 +3f 21 58 58 a0 a0 1a c4 d6 50 b9 55 c6 7f 4c 58 + +# ============================================= + +# ================================== +# Example 2: A 1025-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +01 d4 0c 1b cf 97 a6 8a e7 cd bd 8a 7b f3 e3 4f +a1 9d cc a4 ef 75 a4 74 54 37 5f 94 51 4d 88 fe +d0 06 fb 82 9f 84 19 ff 87 d6 31 5d a6 8a 1f f3 +a0 93 8e 9a bb 34 64 01 1c 30 3a d9 91 99 cf 0c +7c 7a 8b 47 7d ce 82 9e 88 44 f6 25 b1 15 e5 e9 +c4 a5 9c f8 f8 11 3b 68 34 33 6a 2f d2 68 9b 47 +2c bb 5e 5c ab e6 74 35 0c 59 b6 c1 7e 17 68 74 +fb 42 f8 fc 3d 17 6a 01 7e dc 61 fd 32 6c 4b 33 +c9 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +02 7d 14 7e 46 73 05 73 77 fd 1e a2 01 56 57 72 +17 6a 7d c3 83 58 d3 76 04 56 85 a2 e7 87 c2 3c +15 57 6b c1 6b 9f 44 44 02 d6 bf c5 d9 8a 3e 88 +ea 13 ef 67 c3 53 ec a0 c0 dd ba 92 55 bd 7b 8b +b5 0a 64 4a fd fd 1d d5 16 95 b2 52 d2 2e 73 18 +d1 b6 68 7a 1c 10 ff 75 54 5f 3d b0 fe 60 2d 5f +2b 7f 29 4e 36 01 ea b7 b9 d1 ce cd 76 7f 64 69 +2e 3e 53 6c a2 84 6c b0 c2 dd 48 6a 39 fa 75 b1 + +# Prime p: +01 66 01 e9 26 a0 f8 c9 e2 6e ca b7 69 ea 65 a5 +e7 c5 2c c9 e0 80 ef 51 94 57 c6 44 da 68 91 c5 +a1 04 d3 ea 79 55 92 9a 22 e7 c6 8a 7a f9 fc ad +77 7c 3c cc 2b 9e 3d 36 50 bc e4 04 39 9b 7e 59 +d1 + +# Prime q: +01 4e af a1 d4 d0 18 4d a7 e3 1f 87 7d 12 81 dd +da 62 56 64 86 9e 83 79 e6 7a d3 b7 5e ae 74 a5 +80 e9 82 7a bd 6e b7 a0 02 cb 54 11 f5 26 67 97 +76 8f b8 e9 5a e4 0e 3e 8a 01 f3 5f f8 9e 56 c0 +79 + +# p's CRT exponent dP: +e2 47 cc e5 04 93 9b 8f 0a 36 09 0d e2 00 93 87 +55 e2 44 4b 29 53 9a 7d a7 a9 02 f6 05 68 35 c0 +db 7b 52 55 94 97 cf e2 c6 1a 80 86 d0 21 3c 47 +2c 78 85 18 00 b1 71 f6 40 1d e2 e9 c2 75 6f 31 + +# q's CRT exponent dQ: +b1 2f ba 75 78 55 e5 86 e4 6f 64 c3 8a 70 c6 8b +3f 54 8d 93 d7 87 b3 99 99 9d 4c 8f 0b bd 25 81 +c2 1e 19 ed 00 18 a6 d5 d3 df 86 42 4b 3a bc ad +40 19 9d 31 49 5b 61 30 9f 27 c1 bf 55 d4 87 c1 + +# CRT coefficient qInv: +56 4b 1e 1f a0 03 bd a9 1e 89 09 04 25 aa c0 5b +91 da 9e e2 50 61 e7 62 8d 5f 51 30 4a 84 99 2f +dc 33 76 2b d3 78 a5 9f 03 0a 33 4d 53 2b d0 da +e8 f2 98 ea 9e d8 44 63 6a d5 fb 8c bd c0 3c ad + +# -------------------------------- +# RSASSA-PSS Signature Example 2.1 +# -------------------------------- + +# Message to be signed: +da ba 03 20 66 26 3f ae db 65 98 48 11 52 78 a5 +2c 44 fa a3 a7 6f 37 51 5e d3 36 32 10 72 c4 0a +9d 9b 53 bc 05 01 40 78 ad f5 20 87 51 46 aa e7 +0f f0 60 22 6d cb 7b 1f 1f c2 7e 93 60 + +# Salt: +57 bf 16 0b cb 02 bb 1d c7 28 0c f0 45 85 30 b7 +d2 83 2f f7 + +# Signature: +01 4c 5b a5 33 83 28 cc c6 e7 a9 0b f1 c0 ab 3f +d6 06 ff 47 96 d3 c1 2e 4b 63 9e d9 13 6a 5f ec +6c 16 d8 88 4b dd 99 cf dc 52 14 56 b0 74 2b 73 +68 68 cf 90 de 09 9a db 8d 5f fd 1d ef f3 9b a4 +00 7a b7 46 ce fd b2 2d 7d f0 e2 25 f5 46 27 dc +65 46 61 31 72 1b 90 af 44 53 63 a8 35 8b 9f 60 +76 42 f7 8f ab 0a b0 f4 3b 71 68 d6 4b ae 70 d8 +82 78 48 d8 ef 1e 42 1c 57 54 dd f4 2c 25 89 b5 +b3 + +# -------------------------------- +# RSASSA-PSS Signature Example 2.2 +# -------------------------------- + +# Message to be signed: +e4 f8 60 1a 8a 6d a1 be 34 44 7c 09 59 c0 58 57 +0c 36 68 cf d5 1d d5 f9 cc d6 ad 44 11 fe 82 13 +48 6d 78 a6 c4 9f 93 ef c2 ca 22 88 ce bc 2b 9b +60 bd 04 b1 e2 20 d8 6e 3d 48 48 d7 09 d0 32 d1 +e8 c6 a0 70 c6 af 9a 49 9f cf 95 35 4b 14 ba 61 +27 c7 39 de 1b b0 fd 16 43 1e 46 93 8a ec 0c f8 +ad 9e b7 2e 83 2a 70 35 de 9b 78 07 bd c0 ed 8b +68 eb 0f 5a c2 21 6b e4 0c e9 20 c0 db 0e dd d3 +86 0e d7 88 ef ac ca ca 50 2d 8f 2b d6 d1 a7 c1 +f4 1f f4 6f 16 81 c8 f1 f8 18 e9 c4 f6 d9 1a 0c +78 03 cc c6 3d 76 a6 54 4d 84 3e 08 4e 36 3b 8a +cc 55 aa 53 17 33 ed b5 de e5 b5 19 6e 9f 03 e8 +b7 31 b3 77 64 28 d9 e4 57 fe 3f bc b3 db 72 74 +44 2d 78 58 90 e9 cb 08 54 b6 44 4d ac e7 91 d7 +27 3d e1 88 97 19 33 8a 77 fe + +# Salt: +7f 6d d3 59 e6 04 e6 08 70 e8 98 e4 7b 19 bf 2e +5a 7b 2a 90 + +# Signature: +01 09 91 65 6c ca 18 2b 7f 29 d2 db c0 07 e7 ae +0f ec 15 8e b6 75 9c b9 c4 5c 5f f8 7c 76 35 dd +46 d1 50 88 2f 4d e1 e9 ae 65 e7 f7 d9 01 8f 68 +36 95 4a 47 c0 a8 1a 8a 6b 6f 83 f2 94 4d 60 81 +b1 aa 7c 75 9b 25 4b 2c 34 b6 91 da 67 cc 02 26 +e2 0b 2f 18 b4 22 12 76 1d cd 4b 90 8a 62 b3 71 +b5 91 8c 57 42 af 4b 53 7e 29 69 17 67 4f b9 14 +19 47 61 62 1c c1 9a 41 f6 fb 95 3f bc bb 64 9d +ea + +# -------------------------------- +# RSASSA-PSS Signature Example 2.3 +# -------------------------------- + +# Message to be signed: +52 a1 d9 6c 8a c3 9e 41 e4 55 80 98 01 b9 27 a5 +b4 45 c1 0d 90 2a 0d cd 38 50 d2 2a 66 d2 bb 07 +03 e6 7d 58 67 11 45 95 aa bf 5a 7a eb 5a 8f 87 +03 4b bb 30 e1 3c fd 48 17 a9 be 76 23 00 23 60 +6d 02 86 a3 fa f8 a4 d2 2b 72 8e c5 18 07 9f 9e +64 52 6e 3a 0c c7 94 1a a3 38 c4 37 99 7c 68 0c +ca c6 7c 66 bf a1 + +# Salt: +fc a8 62 06 8b ce 22 46 72 4b 70 8a 05 19 da 17 +e6 48 68 8c + +# Signature: +00 7f 00 30 01 8f 53 cd c7 1f 23 d0 36 59 fd e5 +4d 42 41 f7 58 a7 50 b4 2f 18 5f 87 57 85 20 c3 +07 42 af d8 43 59 b6 e6 e8 d3 ed 95 9d c6 fe 48 +6b ed c8 e2 cf 00 1f 63 a7 ab e1 62 56 a1 b8 4d +f0 d2 49 fc 05 d3 19 4c e5 f0 91 27 42 db bf 80 +dd 17 4f 6c 51 f6 ba d7 f1 6c f3 36 4e ba 09 5a +06 26 7d c3 79 38 03 ac 75 26 ae be 0a 47 5d 38 +b8 c2 24 7a b5 1c 48 98 df 70 47 dc 6a df 52 c6 +c4 + +# -------------------------------- +# RSASSA-PSS Signature Example 2.4 +# -------------------------------- + +# Message to be signed: +a7 18 2c 83 ac 18 be 65 70 a1 06 aa 9d 5c 4e 3d +bb d4 af ae b0 c6 0c 4a 23 e1 96 9d 79 ff + +# Salt: +80 70 ef 2d e9 45 c0 23 87 68 4b a0 d3 30 96 73 +22 35 d4 40 + +# Signature: +00 9c d2 f4 ed be 23 e1 23 46 ae 8c 76 dd 9a d3 +23 0a 62 07 61 41 f1 6c 15 2b a1 85 13 a4 8e f6 +f0 10 e0 e3 7f d3 df 10 a1 ec 62 9a 0c b5 a3 b5 +d2 89 30 07 29 8c 30 93 6a 95 90 3b 6b a8 55 55 +d9 ec 36 73 a0 61 08 fd 62 a2 fd a5 6d 1c e2 e8 +5c 4d b6 b2 4a 81 ca 3b 49 6c 36 d4 fd 06 eb 7c +91 66 d8 e9 48 77 c4 2b ea 62 2b 3b fe 92 51 fd +c2 1d 8d 53 71 ba da d7 8a 48 82 14 79 63 35 b4 +0b + +# -------------------------------- +# RSASSA-PSS Signature Example 2.5 +# -------------------------------- + +# Message to be signed: +86 a8 3d 4a 72 ee 93 2a 4f 56 30 af 65 79 a3 86 +b7 8f e8 89 99 e0 ab d2 d4 90 34 a4 bf c8 54 dd +94 f1 09 4e 2e 8c d7 a1 79 d1 95 88 e4 ae fc 1b +1b d2 5e 95 e3 dd 46 1f + +# Salt: +17 63 9a 4e 88 d7 22 c4 fc a2 4d 07 9a 8b 29 c3 +24 33 b0 c9 + +# Signature: +00 ec 43 08 24 93 1e bd 3b aa 43 03 4d ae 98 ba +64 6b 8c 36 01 3d 16 71 c3 cf 1c f8 26 0c 37 4b +19 f8 e1 cc 8d 96 50 12 40 5e 7e 9b f7 37 86 12 +df cc 85 fc e1 2c da 11 f9 50 bd 0b a8 87 67 40 +43 6c 1d 25 95 a6 4a 1b 32 ef cf b7 4a 21 c8 73 +b3 cc 33 aa f4 e3 dc 39 53 de 67 f0 67 4c 04 53 +b4 fd 9f 60 44 06 d4 41 b8 16 09 8c b1 06 fe 34 +72 bc 25 1f 81 5f 59 db 2e 43 78 a3 ad dc 18 1e +cf + +# -------------------------------- +# RSASSA-PSS Signature Example 2.6 +# -------------------------------- + +# Message to be signed: +04 9f 91 54 d8 71 ac 4a 7c 7a b4 53 25 ba 75 45 +a1 ed 08 f7 05 25 b2 66 7c f1 + +# Salt: +37 81 0d ef 10 55 ed 92 2b 06 3d f7 98 de 5d 0a +ab f8 86 ee + +# Signature: +00 47 5b 16 48 f8 14 a8 dc 0a bd c3 7b 55 27 f5 +43 b6 66 bb 6e 39 d3 0e 5b 49 d3 b8 76 dc cc 58 +ea c1 4e 32 a2 d5 5c 26 16 01 44 56 ad 2f 24 6f +c8 e3 d5 60 da 3d df 37 9a 1c 0b d2 00 f1 02 21 +df 07 8c 21 9a 15 1b c8 d4 ec 9d 2f c2 56 44 67 +81 10 14 ef 15 d8 ea 01 c2 eb bf f8 c2 c8 ef ab +38 09 6e 55 fc be 32 85 c7 aa 55 88 51 25 4f af +fa 92 c1 c7 2b 78 75 86 63 ef 45 82 84 31 39 d7 +a6 + +# ============================================= + +# ================================== +# Example 3: A 1026-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +02 f2 46 ef 45 1e d3 ee bb 9a 31 02 00 cc 25 85 +9c 04 8e 4b e7 98 30 29 91 11 2e b6 8c e6 db 67 +4e 28 0d a2 1f ed ed 1a e7 48 80 ca 52 2b 18 db +24 93 85 01 28 27 c5 15 f0 e4 66 a1 ff a6 91 d9 +81 70 57 4e 9d 0e ad b0 87 58 6c a4 89 33 da 3c +c9 53 d9 5b d0 ed 50 de 10 dd cb 67 36 10 7d 6c +83 1c 7f 66 3e 83 3c a4 c0 97 e7 00 ce 0f b9 45 +f8 8f b8 5f e8 e5 a7 73 17 25 65 b9 14 a4 71 a4 +43 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +65 14 51 73 3b 56 de 5a c0 a6 89 a4 ae b6 e6 89 +4a 69 01 4e 07 6c 88 dd 7a 66 7e ab 32 32 bb cc +d2 fc 44 ba 2f a9 c3 1d b4 6f 21 ed d1 fd b2 3c +5c 12 8a 5d a5 ba b9 1e 7f 95 2b 67 75 9c 7c ff +70 54 15 ac 9f a0 90 7c 7c a6 17 8f 66 8f b9 48 +d8 69 da 4c c3 b7 35 6f 40 08 df d5 44 9d 32 ee +02 d9 a4 77 eb 69 fc 29 26 6e 5d 90 70 51 23 75 +a5 0f bb cc 27 e2 38 ad 98 42 5f 6e bb f8 89 91 + +# Prime p: +01 bd 36 e1 8e ce 4b 0f db 2e 9c 9d 54 8b d1 a7 +d6 e2 c2 1c 6f dc 35 07 4a 1d 05 b1 c6 c8 b3 d5 +58 ea 26 39 c9 a9 a4 21 68 01 69 31 72 52 55 8b +d1 48 ad 21 5a ac 55 0e 2d cf 12 a8 2d 0e bf e8 +53 + +# Prime q: +01 b1 b6 56 ad 86 d8 e1 9d 5d c8 62 92 b3 a1 92 +fd f6 e0 dd 37 87 7b ad 14 82 2f a0 01 90 ca b2 +65 f9 0d 3f 02 05 7b 6f 54 d6 ec b1 44 91 e5 ad +ea ce bc 48 bf 0e bd 2a 2a d2 6d 40 2e 54 f6 16 +51 + +# p's CRT exponent dP: +1f 27 79 fd 2e 3e 5e 6b ae 05 53 95 18 fb a0 cd +0e ad 1a a4 51 3a 7c ba 18 f1 cf 10 e3 f6 81 95 +69 3d 27 8a 0f 0e e7 2f 89 f9 bc 76 0d 80 e2 f9 +d0 26 1d 51 65 01 c6 ae 39 f1 4a 47 6c e2 cc f5 + +# q's CRT exponent dQ: +01 1a 0d 36 79 4b 04 a8 54 aa b4 b2 46 2d 43 9a +50 46 c9 1d 94 0b 2b c6 f7 5b 62 95 6f ef 35 a2 +a6 e6 3c 53 09 81 7f 30 7b bf f9 d5 9e 7e 33 1b +d3 63 f6 d6 68 49 b1 83 46 ad ea 16 9f 0a e9 ae +c1 + +# CRT coefficient qInv: +0b 30 f0 ec f5 58 75 2f b3 a6 ce 4b a2 b8 c6 75 +f6 59 eb a6 c3 76 58 5a 1b 39 71 2d 03 8a e3 d2 +b4 6f cb 41 8a e1 5d 09 05 da 64 40 e1 51 3a 30 +b9 b7 d6 66 8f bc 5e 88 e5 ab 7a 17 5e 73 ba 35 + +# -------------------------------- +# RSASSA-PSS Signature Example 3.1 +# -------------------------------- + +# Message to be signed: +59 4b 37 33 3b bb 2c 84 52 4a 87 c1 a0 1f 75 fc +ec 0e 32 56 f1 08 e3 8d ca 36 d7 0d 00 57 + +# Salt: +f3 1a d6 c8 cf 89 df 78 ed 77 fe ac bc c2 f8 b0 +a8 e4 cf aa + +# Signature: +00 88 b1 35 fb 17 94 b6 b9 6c 4a 3e 67 81 97 f8 +ca c5 2b 64 b2 fe 90 7d 6f 27 de 76 11 24 96 4a +99 a0 1a 88 27 40 ec fa ed 6c 01 a4 74 64 bb 05 +18 23 13 c0 13 38 a8 cd 09 72 14 cd 68 ca 10 3b +d5 7d 3b c9 e8 16 21 3e 61 d7 84 f1 82 46 7a bf +8a 01 cf 25 3e 99 a1 56 ea a8 e3 e1 f9 0e 3c 6e +4e 3a a2 d8 3e d0 34 5b 89 fa fc 9c 26 07 7c 14 +b6 ac 51 45 4f a2 6e 44 6e 3a 2f 15 3b 2b 16 79 +7f + +# -------------------------------- +# RSASSA-PSS Signature Example 3.2 +# -------------------------------- + +# Message to be signed: +8b 76 95 28 88 4a 0d 1f fd 09 0c f1 02 99 3e 79 +6d ad cf bd dd 38 e4 4f f6 32 4c a4 51 + +# Salt: +fc f9 f0 e1 f1 99 a3 d1 d0 da 68 1c 5b 86 06 fc +64 29 39 f7 + +# Signature: +02 a5 f0 a8 58 a0 86 4a 4f 65 01 7a 7d 69 45 4f +3f 97 3a 29 99 83 9b 7b bc 48 bf 78 64 11 69 17 +95 56 f5 95 fa 41 f6 ff 18 e2 86 c2 78 30 79 bc +09 10 ee 9c c3 4f 49 ba 68 11 24 f9 23 df a8 8f +42 61 41 a3 68 a5 f5 a9 30 c6 28 c2 c3 c2 00 e1 +8a 76 44 72 1a 0c be c6 dd 3f 62 79 bd e3 e8 f2 +be 5e 2d 4e e5 6f 97 e7 ce af 33 05 4b e7 04 2b +d9 1a 63 bb 09 f8 97 bd 41 e8 11 97 de e9 9b 11 +af + +# -------------------------------- +# RSASSA-PSS Signature Example 3.3 +# -------------------------------- + +# Message to be signed: +1a bd ba 48 9c 5a da 2f 99 5e d1 6f 19 d5 a9 4d +9e 6e c3 4a 8d 84 f8 45 57 d2 6e 5e f9 b0 2b 22 +88 7e 3f 9a 4b 69 0a d1 14 92 09 c2 0c 61 43 1f +0c 01 7c 36 c2 65 7b 35 d7 b0 7d 3f 5a d8 70 85 +07 a9 c1 b8 31 df 83 5a 56 f8 31 07 18 14 ea 5d +3d 8d 8f 6a de 40 cb a3 8b 42 db 7a 2d 3d 7a 29 +c8 f0 a7 9a 78 38 cf 58 a9 75 7f a2 fe 4c 40 df +9b aa 19 3b fc 6f 92 b1 23 ad 57 b0 7a ce 3e 6a +c0 68 c9 f1 06 af d9 ee b0 3b 4f 37 c2 5d bf bc +fb 30 71 f6 f9 77 17 66 d0 72 f3 bb 07 0a f6 60 +55 32 97 3a e2 50 51 + +# Salt: +98 6e 7c 43 db b6 71 bd 41 b9 a7 f4 b6 af c8 0e +80 5f 24 23 + +# Signature: +02 44 bc d1 c8 c1 69 55 73 6c 80 3b e4 01 27 2e +18 cb 99 08 11 b1 4f 72 db 96 41 24 d5 fa 76 06 +49 cb b5 7a fb 87 55 db b6 2b f5 1f 46 6c f2 3a +0a 16 07 57 6e 98 3d 77 8f ce ff a9 2d f7 54 8a +ea 8e a4 ec ad 2c 29 dd 9f 95 bc 07 fe 91 ec f8 +be e2 55 bf e8 76 2f d7 69 0a a9 bf a4 fa 08 49 +ef 72 8c 2c 42 c4 53 23 64 52 2d f2 ab 7f 9f 8a +03 b6 3f 7a 49 91 75 82 86 68 f5 ef 5a 29 e3 80 +2c + +# -------------------------------- +# RSASSA-PSS Signature Example 3.4 +# -------------------------------- + +# Message to be signed: +8f b4 31 f5 ee 79 2b 6c 2a c7 db 53 cc 42 86 55 +ae b3 2d 03 f4 e8 89 c5 c2 5d e6 83 c4 61 b5 3a +cf 89 f9 f8 d3 aa bd f6 b9 f0 c2 a1 de 12 e1 5b +49 ed b3 91 9a 65 2f e9 49 1c 25 a7 fc e1 f7 22 +c2 54 36 08 b6 9d c3 75 ec + +# Salt: +f8 31 2d 9c 8e ea 13 ec 0a 4c 7b 98 12 0c 87 50 +90 87 c4 78 + +# Signature: +01 96 f1 2a 00 5b 98 12 9c 8d f1 3c 4c b1 6f 8a +a8 87 d3 c4 0d 96 df 3a 88 e7 53 2e f3 9c d9 92 +f2 73 ab c3 70 bc 1b e6 f0 97 cf eb bf 01 18 fd +9e f4 b9 27 15 5f 3d f2 2b 90 4d 90 70 2d 1f 7b +a7 a5 2b ed 8b 89 42 f4 12 cd 7b d6 76 c9 d1 8e +17 03 91 dc d3 45 c0 6a 73 09 64 b3 f3 0b cc e0 +bb 20 ba 10 6f 9a b0 ee b3 9c f8 a6 60 7f 75 c0 +34 7f 0a f7 9f 16 af a0 81 d2 c9 2d 1e e6 f8 36 +b8 + +# -------------------------------- +# RSASSA-PSS Signature Example 3.5 +# -------------------------------- + +# Message to be signed: +fe f4 16 1d fa af 9c 52 95 05 1d fc 1f f3 81 0c +8c 9e c2 e8 66 f7 07 54 22 c8 ec 42 16 a9 c4 ff +49 42 7d 48 3c ae 10 c8 53 4a 41 b2 fd 15 fe e0 +69 60 ec 6f b3 f7 a7 e9 4a 2f 8a 2e 3e 43 dc 4a +40 57 6c 30 97 ac 95 3b 1d e8 6f 0b 4e d3 6d 64 +4f 23 ae 14 42 55 29 62 24 64 ca 0c bf 0b 17 41 +34 72 38 15 7f ab 59 e4 de 55 24 09 6d 62 ba ec +63 ac 64 + +# Salt: +50 32 7e fe c6 29 2f 98 01 9f c6 7a 2a 66 38 56 +3e 9b 6e 2d + +# Signature: +02 1e ca 3a b4 89 22 64 ec 22 41 1a 75 2d 92 22 +10 76 d4 e0 1c 0e 6f 0d de 9a fd 26 ba 5a cf 6d +73 9e f9 87 54 5d 16 68 3e 56 74 c9 e7 0f 1d e6 +49 d7 e6 1d 48 d0 ca eb 4f b4 d8 b2 4f ba 84 a6 +e3 10 8f ee 7d 07 05 97 32 66 ac 52 4b 4a d2 80 +f7 ae 17 dc 59 d9 6d 33 51 58 6b 5a 3b db 89 5d +1e 1f 78 20 ac 61 35 d8 75 34 80 99 83 82 ba 32 +b7 34 95 59 60 8c 38 74 52 90 a8 5e f4 e9 f9 bd +83 + +# -------------------------------- +# RSASSA-PSS Signature Example 3.6 +# -------------------------------- + +# Message to be signed: +ef d2 37 bb 09 8a 44 3a ee b2 bf 6c 3f 8c 81 b8 +c0 1b 7f cb 3f eb + +# Salt: +b0 de 3f c2 5b 65 f5 af 96 b1 d5 cc 3b 27 d0 c6 +05 30 87 b3 + +# Signature: +01 2f af ec 86 2f 56 e9 e9 2f 60 ab 0c 77 82 4f +42 99 a0 ca 73 4e d2 6e 06 44 d5 d2 22 c7 f0 bd +e0 39 64 f8 e7 0a 5c b6 5e d4 4e 44 d5 6a e0 ed +f1 ff 86 ca 03 2c c5 dd 44 04 db b7 6a b8 54 58 +6c 44 ee d8 33 6d 08 d4 57 ce 6c 03 69 3b 45 c0 +f1 ef ef 93 62 4b 95 b8 ec 16 9c 61 6d 20 e5 53 +8e bc 0b 67 37 a6 f8 2b 4b c0 57 09 24 fc 6b 35 +75 9a 33 48 42 62 79 f8 b3 d7 74 4e 2d 22 24 26 +ce + +# ============================================= + +# ================================== +# Example 4: A 1027-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +05 4a db 78 86 44 7e fe 6f 57 e0 36 8f 06 cf 52 +b0 a3 37 07 60 d1 61 ce f1 26 b9 1b e7 f8 9c 42 +1b 62 a6 ec 1d a3 c3 11 d7 5e d5 0e 0a b5 ff f3 +fd 33 8a cc 3a a8 a4 e7 7e e2 63 69 ac b8 1b a9 +00 fa 83 f5 30 0c f9 bb 6c 53 ad 1d c8 a1 78 b8 +15 db 42 35 a9 a9 da 0c 06 de 4e 61 5e a1 27 7c +e5 59 e9 c1 08 de 58 c1 4a 81 aa 77 f5 a6 f8 d1 +33 54 94 49 88 48 c8 b9 59 40 74 0b e7 bf 7c 37 +05 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +fa 04 1f 8c d9 69 7c ee d3 8e c8 ca a2 75 52 3b +4d d7 2b 09 a3 01 d3 54 1d 72 f5 d3 1c 05 cb ce +2d 69 83 b3 61 83 af 10 69 0b d4 6c 46 13 1e 35 +78 94 31 a5 56 77 1d d0 04 9b 57 46 1b f0 60 c1 +f6 84 72 e8 a6 7c 25 f3 57 e5 b6 b4 73 8f a5 41 +a7 30 34 6b 4a 07 64 9a 2d fa 80 6a 69 c9 75 b6 +ab a6 46 78 ac c7 f5 91 3e 89 c6 22 f2 d8 ab b1 +e3 e3 25 54 e3 9d f9 4b a6 0c 00 2e 38 7d 90 11 + +# Prime p: +02 92 32 33 6d 28 38 94 5d ba 9d d7 72 3f 4e 62 +4a 05 f7 37 5b 92 7a 87 ab e6 a8 93 a1 65 8f d4 +9f 47 f6 c7 b0 fa 59 6c 65 fa 68 a2 3f 0a b4 32 +96 2d 18 d4 34 3b d6 fd 67 1a 5e a8 d1 48 41 39 +95 + +# Prime q: +02 0e f5 ef e7 c5 39 4a ed 22 72 f7 e8 1a 74 f4 +c0 2d 14 58 94 cb 1b 3c ab 23 a9 a0 71 0a 2a fc +7e 33 29 ac bb 74 3d 01 f6 80 c4 d0 2a fb 4c 8f +de 7e 20 93 08 11 bb 2b 99 57 88 b5 e8 72 c2 0b +b1 + +# p's CRT exponent dP: +02 6e 7e 28 01 0e cf 24 12 d9 52 3a d7 04 64 7f +b4 fe 9b 66 b1 a6 81 58 1b 0e 15 55 3a 89 b1 54 +28 28 89 8f 27 24 3e ba b4 5f f5 e1 ac b9 d4 df +1b 05 1f bc 62 82 4d bc 6f 6c 93 26 1a 78 b9 a7 +59 + +# q's CRT exponent dQ: +01 2d dc c8 6e f6 55 99 8c 39 dd ae 11 71 86 69 +e5 e4 6c f1 49 5b 07 e1 3b 10 14 cd 69 b3 af 68 +30 4a d2 a6 b6 43 21 e7 8b f3 bb ca 9b b4 94 e9 +1d 45 17 17 e2 d9 75 64 c6 54 94 65 d0 20 5c f4 +21 + +# CRT coefficient qInv: +01 06 00 c4 c2 18 47 45 9f e5 76 70 3e 2e be ca +e8 a5 09 4e e6 3f 53 6b f4 ac 68 d3 c1 3e 5e 4f +12 ac 5c c1 0a b6 a2 d0 5a 19 92 14 d1 82 47 47 +d5 51 90 96 36 b7 74 c2 2c ac 0b 83 75 99 ab cc +75 + +# -------------------------------- +# RSASSA-PSS Signature Example 4.1 +# -------------------------------- + +# Message to be signed: +9f b0 3b 82 7c 82 17 d9 + +# Salt: +ed 7c 98 c9 5f 30 97 4f be 4f bd dc f0 f2 8d 60 +21 c0 e9 1d + +# Signature: +03 23 d5 b7 bf 20 ba 45 39 28 9a e4 52 ae 42 97 +08 0f ef f4 51 84 23 ff 48 11 a8 17 83 7e 7d 82 +f1 83 6c df ab 54 51 4f f0 88 7b dd ee bf 40 bf +99 b0 47 ab c3 ec fa 6a 37 a3 ef 00 f4 a0 c4 a8 +8a ae 09 04 b7 45 c8 46 c4 10 7e 87 97 72 3e 8a +c8 10 d9 e3 d9 5d fa 30 ff 49 66 f4 d7 5d 13 76 +8d 20 85 7f 2b 14 06 f2 64 cf e7 5e 27 d7 65 2f +4b 5e d3 57 5f 28 a7 02 f8 c4 ed 9c f9 b2 d4 49 +48 + +# -------------------------------- +# RSASSA-PSS Signature Example 4.2 +# -------------------------------- + +# Message to be signed: +0c a2 ad 77 79 7e ce 86 de 5b f7 68 75 0d db 5e +d6 a3 11 6a d9 9b bd 17 ed f7 f7 82 f0 db 1c d0 +5b 0f 67 74 68 c5 ea 42 0d c1 16 b1 0e 80 d1 10 +de 2b 04 61 ea 14 a3 8b e6 86 20 39 2e 7e 89 3c +b4 ea 93 93 fb 88 6c 20 ff 79 06 42 30 5b f3 02 +00 38 92 e5 4d f9 f6 67 50 9d c5 39 20 df 58 3f +50 a3 dd 61 ab b6 fa b7 5d 60 03 77 e3 83 e6 ac +a6 71 0e ee a2 71 56 e0 67 52 c9 4c e2 5a e9 9f +cb f8 59 2d be 2d 7e 27 45 3c b4 4d e0 71 00 eb +b1 a2 a1 98 11 a4 78 ad be ab 27 0f 94 e8 fe 36 +9d 90 b3 ca 61 2f 9f + +# Salt: +22 d7 1d 54 36 3a 42 17 aa 55 11 3f 05 9b 33 84 +e3 e5 7e 44 + +# Signature: +04 9d 01 85 84 5a 26 4d 28 fe b1 e6 9e da ec 09 +06 09 e8 e4 6d 93 ab b3 83 71 ce 51 f4 aa 65 a5 +99 bd aa a8 1d 24 fb a6 6a 08 a1 16 cb 64 4f 3f +1e 65 3d 95 c8 9d b8 bb d5 da ac 27 09 c8 98 40 +00 17 84 10 a7 c6 aa 86 67 dd c3 8c 74 1f 71 0e +c8 66 5a a9 05 2b e9 29 d4 e3 b1 67 82 c1 66 21 +14 c5 41 4b b0 35 34 55 c3 92 fc 28 f3 db 59 05 +4b 5f 36 5c 49 e1 d1 56 f8 76 ee 10 cb 4f d7 05 +98 + +# -------------------------------- +# RSASSA-PSS Signature Example 4.3 +# -------------------------------- + +# Message to be signed: +28 80 62 af c0 8f cd b7 c5 f8 65 0b 29 83 73 00 +46 1d d5 67 6c 17 a2 0a 3c 8f b5 14 89 49 e3 f7 +3d 66 b3 ae 82 c7 24 0e 27 c5 b3 ec 43 28 ee 7d +6d df 6a 6a 0c 9b 5b 15 bc da 19 6a 9d 0c 76 b1 +19 d5 34 d8 5a bd 12 39 62 d5 83 b7 6c e9 d1 80 +bc e1 ca + +# Salt: +4a f8 70 fb c6 51 60 12 ca 91 6c 70 ba 86 2a c7 +e8 24 36 17 + +# Signature: +03 fb c4 10 a2 ce d5 95 00 fb 99 f9 e2 af 27 81 +ad a7 4e 13 14 56 24 60 27 82 e2 99 48 13 ee fc +a0 51 9e cd 25 3b 85 5f b6 26 a9 0d 77 1e ae 02 +8b 0c 47 a1 99 cb d9 f8 e3 26 97 34 af 41 63 59 +90 90 71 3a 3f a9 10 fa 09 60 65 27 21 43 2b 97 +10 36 a7 18 1a 2b c0 ca b4 3b 0b 59 8b c6 21 74 +61 d7 db 30 5f f7 e9 54 c5 b5 bb 23 1c 39 e7 91 +af 6b cf a7 6b 14 7b 08 13 21 f7 26 41 48 2a 2a +ad + +# -------------------------------- +# RSASSA-PSS Signature Example 4.4 +# -------------------------------- + +# Message to be signed: +6f 4f 9a b9 50 11 99 ce f5 5c 6c f4 08 fe 7b 36 +c5 57 c4 9d 42 0a 47 63 d2 46 3c 8a d4 4b 3c fc +5b e2 74 2c 0e 7d 9b 0f 66 08 f0 8c 7f 47 b6 93 +ee + +# Salt: +40 d2 e1 80 fa e1 ea c4 39 c1 90 b5 6c 2c 0e 14 +dd f9 a2 26 + +# Signature: +04 86 64 4b c6 6b f7 5d 28 33 5a 61 79 b1 08 51 +f4 3f 09 bd ed 9f ac 1a f3 32 52 bb 99 53 ba 42 +98 cd 64 66 b2 75 39 a7 0a da a3 f8 9b 3d b3 c7 +4a b6 35 d1 22 f4 ee 7c e5 57 a6 1e 59 b8 2f fb +78 66 30 e5 f9 db 53 c7 7d 9a 0c 12 fa b5 95 8d +4c 2c e7 da a8 07 cd 89 ba 2c c7 fc d0 2f f4 70 +ca 67 b2 29 fc ce 81 4c 85 2c 73 cc 93 be a3 5b +e6 84 59 ce 47 8e 9d 46 55 d1 21 c8 47 2f 37 1d +4f + +# -------------------------------- +# RSASSA-PSS Signature Example 4.5 +# -------------------------------- + +# Message to be signed: +e1 7d 20 38 5d 50 19 55 82 3c 3f 66 62 54 c1 d3 +dd 36 ad 51 68 b8 f1 8d 28 6f dc f6 7a 7d ad 94 +09 70 85 fa b7 ed 86 fe 21 42 a2 87 71 71 79 97 +ef 1a 7a 08 88 4e fc 39 35 6d 76 07 7a af 82 45 +9a 7f ad 45 84 88 75 f2 81 9b 09 89 37 fe 92 3b +cc 9d c4 42 d7 2d 75 4d 81 20 25 09 0c 9b c0 3d +b3 08 0c 13 8d d6 3b 35 5d 0b 4b 85 d6 68 8a c1 +9f 4d e1 50 84 a0 ba 4e 37 3b 93 ef 4a 55 50 96 +69 19 15 dc 23 c0 0e 95 4c de b2 0a 47 cd 55 d1 +6c 3d 86 81 d4 6e d7 f2 ed 5e a4 27 95 be 17 ba +ed 25 f0 f4 d1 13 b3 63 6a dd d5 85 f1 6a 8b 5a +ec 0c 8f a9 c5 f0 3c bf 3b 9b 73 + +# Salt: +24 97 dc 2b 46 15 df ae 5a 66 3d 49 ff d5 6b f7 +ef c1 13 04 + +# Signature: +02 2a 80 04 53 53 90 4c b3 0c bb 54 2d 7d 49 90 +42 1a 6e ec 16 a8 02 9a 84 22 ad fd 22 d6 af f8 +c4 cc 02 94 af 11 0a 0c 06 7e c8 6a 7d 36 41 34 +45 9b b1 ae 8f f8 36 d5 a8 a2 57 98 40 99 6b 32 +0b 19 f1 3a 13 fa d3 78 d9 31 a6 56 25 da e2 73 +9f 0c 53 67 0b 35 d9 d3 cb ac 08 e7 33 e4 ec 2b +83 af 4b 91 96 d6 3e 7c 4f f1 dd ea e2 a1 22 79 +1a 12 5b fe a8 de b0 de 8c cf 1f 4f fa f6 e6 fb +0a + +# -------------------------------- +# RSASSA-PSS Signature Example 4.6 +# -------------------------------- + +# Message to be signed: +af bc 19 d4 79 24 90 18 fd f4 e0 9f 61 87 26 44 +04 95 de 11 dd ee e3 88 72 d7 75 fc ea 74 a2 38 +96 b5 34 3c 9c 38 d4 6a f0 db a2 24 d0 47 58 0c +c6 0a 65 e9 39 1c f9 b5 9b 36 a8 60 59 8d 4e 82 +16 72 2f 99 3b 91 cf ae 87 bc 25 5a f8 9a 6a 19 +9b ca 4a 39 1e ad bc 3a 24 90 3c 0b d6 67 36 8f +6b e7 8e 3f ea bf b4 ff d4 63 12 27 63 74 0f fb +be fe ab 9a 25 56 4b c5 d1 c2 4c 93 e4 22 f7 50 +73 e2 ad 72 bf 45 b1 0d f0 0b 52 a1 47 12 8e 73 +fe e3 3f a3 f0 57 7d 77 f8 0f bc 2d f1 be d3 13 +29 0c 12 77 7f 50 + +# Salt: +a3 34 db 6f ae bf 11 08 1a 04 f8 7c 2d 62 1c de +c7 93 0b 9b + +# Signature: +00 93 8d cb 6d 58 30 46 06 5f 69 c7 8d a7 a1 f1 +75 70 66 a7 fa 75 12 5a 9d 29 29 f0 b7 9a 60 b6 +27 b0 82 f1 1f 5b 19 6f 28 eb 9d aa 6f 21 c0 5e +51 40 f6 ae f1 73 7d 20 23 07 5c 05 ec f0 4a 02 +8c 68 6a 2a b3 e7 d5 a0 66 4f 29 5c e1 29 95 e8 +90 90 8b 6a d2 1f 08 39 eb 65 b7 03 93 a7 b5 af +d9 87 1d e0 ca a0 ce de c5 b8 19 62 67 56 20 9d +13 ab 1e 7b b9 54 6a 26 ff 37 e9 a5 1a f9 fd 56 +2e + +# ============================================= + +# ================================== +# Example 5: A 1028-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +0d 10 f6 61 f2 99 40 f5 ed 39 aa 26 09 66 de b4 +78 43 67 9d 2b 6f b2 5b 3d e3 70 f3 ac 7c 19 91 +63 91 fd 25 fb 52 7e bf a6 a4 b4 df 45 a1 75 9d +99 6c 4b b4 eb d1 88 28 c4 4f c5 2d 01 91 87 17 +40 52 5f 47 a4 b0 cc 8d a3 25 ed 8a a6 76 b0 d0 +f6 26 e0 a7 7f 07 69 21 70 ac ac 80 82 f4 2f aa +7d c7 cd 12 3e 73 0e 31 a8 79 85 20 4c ab cb e6 +67 0d 43 a2 dd 2b 2d de f5 e0 53 92 fc 21 3b c5 +07 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +03 ce 08 b1 04 ff f3 96 a9 79 bd 3e 4e 46 92 5b +63 19 dd b6 3a cb cf d8 19 f1 7d 16 b8 07 7b 3a +87 10 1f f3 4b 77 fe 48 b8 b2 05 a9 6e 91 51 ba +8e ce a6 4d 0c ce 7b 23 c3 e6 a6 b8 30 58 bc 49 +da e8 16 ae 73 6d b5 a4 70 8e 2a d4 35 23 2b 56 +7f 90 96 ce 59 ff 28 06 1e 79 ab 1c 02 d7 17 e6 +b2 3c ea 6d b8 eb 51 92 fa 7c 1e ab 22 7d ba 74 +62 1c 45 60 18 96 ee f1 37 92 c8 44 0b eb 15 aa +c1 + +# Prime p: +03 f2 f3 31 f4 14 2d 4f 24 b4 3a a1 02 79 a8 96 +52 d4 e7 53 72 21 a1 a7 b2 a2 5d eb 55 1e 5d e9 +ac 49 74 11 c2 27 a9 4e 45 f9 1c 2d 1c 13 cc 04 +6c f4 ce 14 e3 2d 05 87 34 21 0d 44 a8 7e e1 b7 +3f + +# Prime q: +03 4f 09 0d 73 b5 58 03 03 0c f0 36 1a 5d 80 81 +bf b7 9f 85 15 23 fe ac 0a 21 24 d0 8d 40 13 ff +08 48 77 71 a8 70 d0 47 9d c0 68 6c 62 f7 71 8d +fe cf 02 4b 17 c9 26 76 78 05 91 71 33 9c c0 08 +39 + +# p's CRT exponent dP: +02 aa 66 3a db f5 1a b8 87 a0 18 cb 42 6e 78 bc +2f e1 82 dc b2 f7 bc b5 04 41 d1 7f df 0f 06 79 +8b 50 71 c6 e2 f5 fe b4 d5 4a d8 18 23 11 c1 ef +62 d4 c4 9f 18 d1 f5 1f 54 b2 d2 cf fb a4 da 1b +e5 + +# q's CRT exponent dQ: +02 bb e7 06 07 8b 5c 0b 39 15 12 d4 11 db 1b 19 +9b 5a 56 64 b8 40 42 ea d3 7f e9 94 ae 72 b9 53 +2d fb fb 3e 9e 69 81 a0 fb b8 06 51 31 41 b7 c2 +16 3f e5 6c 39 5e 4b fa ee 57 e3 83 3f 9b 91 8d +f9 + +# CRT coefficient qInv: +02 42 b6 cd 00 d3 0a 76 7a ee 9a 89 8e ad 45 3c +8e ae a6 3d 50 0b 7d 1e 00 71 3e da e5 1c e3 6b +23 b6 64 df 26 e6 3e 26 6e c8 f7 6e 6e 63 ed 1b +a4 1e b0 33 b1 20 f7 ea 52 12 ae 21 a9 8f bc 16 + +# -------------------------------- +# RSASSA-PSS Signature Example 5.1 +# -------------------------------- + +# Message to be signed: +30 c7 d5 57 45 8b 43 6d ec fd c1 4d 06 cb 7b 96 +b0 67 18 c4 8d 7d e5 74 82 a8 68 ae 7f 06 58 70 +a6 21 65 06 d1 1b 77 93 23 df df 04 6c f5 77 51 +29 13 4b 4d 56 89 e4 d9 c0 ce 1e 12 d7 d4 b0 6c +b5 fc 58 20 de cf a4 1b af 59 bf 25 7b 32 f0 25 +b7 67 9b 44 5b 94 99 c9 25 55 14 58 85 99 2f 1b +76 f8 48 91 ee 4d 3b e0 f5 15 0f d5 90 1e 3a 4c +8e d4 3f d3 6b 61 d0 22 e6 5a d5 00 8d bf 33 29 +3c 22 bf bf d0 73 21 f0 f1 d5 fa 9f df 00 14 c2 +fc b0 35 8a ad 0e 35 4b 0d 29 + +# Salt: +08 1b 23 3b 43 56 77 50 bd 6e 78 f3 96 a8 8b 9f +6a 44 51 51 + +# Signature: +0b a3 73 f7 6e 09 21 b7 0a 8f bf e6 22 f0 bf 77 +b2 8a 3d b9 8e 36 10 51 c3 d7 cb 92 ad 04 52 91 +5a 4d e9 c0 17 22 f6 82 3e eb 6a df 7e 0c a8 29 +0f 5d e3 e5 49 89 0a c2 a3 c5 95 0a b2 17 ba 58 +59 08 94 95 2d e9 6f 8d f1 11 b2 57 52 15 da 6c +16 15 90 c7 45 be 61 24 76 ee 57 8e d3 84 ab 33 +e3 ec e9 74 81 a2 52 f5 c7 9a 98 b5 53 2a e0 0c +dd 62 f2 ec c0 cd 1b ae fe 80 d8 0b 96 21 93 ec +1d + +# -------------------------------- +# RSASSA-PSS Signature Example 5.2 +# -------------------------------- + +# Message to be signed: +e7 b3 2e 15 56 ea 1b 27 95 04 6a c6 97 39 d2 2a +c8 96 6b f1 1c 11 6f 61 4b 16 67 40 e9 6b 90 65 +3e 57 50 94 5f cf 77 21 86 c0 37 90 a0 7f da 32 +3e 1a 61 91 6b 06 ee 21 57 db 3d ff 80 d6 7d 5e +39 a5 3a e2 68 c8 f0 9e d9 9a 73 20 05 b0 bc 6a +04 af 4e 08 d5 7a 00 e7 20 1b 30 60 ef aa db 73 +11 3b fc 08 7f d8 37 09 3a a2 52 35 b8 c1 49 f5 +62 15 f0 31 c2 4a d5 bd e7 f2 99 60 df 7d 52 40 +70 f7 44 9c 6f 78 50 84 be 1a 0f 73 30 47 f3 36 +f9 15 47 38 67 45 47 db 02 a9 f4 4d fc 6e 60 30 +10 81 e1 ce 99 84 7f 3b 5b 60 1f f0 6b 4d 57 76 +a9 74 0b 9a a0 d3 40 58 fd 3b 90 6e 4f 78 59 df +b0 7d 71 73 e5 e6 f6 35 0a da c2 1f 27 b2 30 74 +69 + +# Salt: +bd 0c e1 95 49 d0 70 01 20 cb e5 10 77 db bb b0 +0a 8d 8b 09 + +# Signature: +08 18 0d e8 25 e4 b8 b0 14 a3 2d a8 ba 76 15 55 +92 12 04 f2 f9 0d 5f 24 b7 12 90 8f f8 4f 3e 22 +0a d1 79 97 c0 dd 6e 70 66 30 ba 3e 84 ad d4 d5 +e7 ab 00 4e 58 07 4b 54 97 09 56 5d 43 ad 9e 97 +b5 a7 a1 a2 9e 85 b9 f9 0f 4a af cd f5 83 21 de +8c 59 74 ef 9a bf 2d 52 6f 33 c0 f2 f8 2e 95 d1 +58 ea 6b 81 f1 73 6d b8 d1 af 3d 6a c6 a8 3b 32 +d1 8b ae 0f f1 b2 fe 27 de 4c 76 ed 8c 79 80 a3 +4e + +# -------------------------------- +# RSASSA-PSS Signature Example 5.3 +# -------------------------------- + +# Message to be signed: +8d 83 96 e3 65 07 fe 1e f6 a1 90 17 54 8e 0c 71 +66 74 c2 fe c2 33 ad b2 f7 75 66 5e c4 1f 2b d0 +ba 39 6b 06 1a 9d aa 7e 86 6f 7c 23 fd 35 31 95 +43 00 a3 42 f9 24 53 5e a1 49 8c 48 f6 c8 79 93 +28 65 fc 02 00 0c 52 87 23 b7 ad 03 35 74 5b 51 +20 9a 0a fe d9 32 af 8f 08 87 c2 19 00 4d 2a bd +89 4e a9 25 59 ee 31 98 af 3a 73 4f e9 b9 63 8c +26 3a 72 8a d9 5a 5a e8 ce 3e b1 58 39 f3 aa 78 +52 bb 39 07 06 e7 76 0e 43 a7 12 91 a2 e3 f8 27 +23 7d ed a8 51 87 4c 51 76 65 f5 45 f2 72 38 df +86 55 7f 37 5d 09 cc d8 bd 15 d8 cc f6 1f 5d 78 +ca 5c 7f 5c de 78 2e 6b f5 d0 05 70 56 d4 ba d9 +8b 3d 2f 95 75 e8 24 ab 7a 33 ff 57 b0 ac 10 0a +b0 d6 ea d7 aa 0b 50 f6 e4 d3 e5 ec 0b 96 6b + +# Salt: +81 57 79 a9 1b 3a 8b d0 49 bf 2a eb 92 01 42 77 +22 22 c9 ca + +# Signature: +05 e0 fd bd f6 f7 56 ef 73 31 85 cc fa 8c ed 2e +b6 d0 29 d9 d5 6e 35 56 1b 5d b8 e7 02 57 ee 6f +d0 19 d2 f0 bb f6 69 fe 9b 98 21 e7 8d f6 d4 1e +31 60 8d 58 28 0f 31 8e e3 4f 55 99 41 c8 df 13 +28 75 74 ba c0 00 b7 e5 8d c4 f4 14 ba 49 fb 12 +7f 9d 0f 89 36 63 8c 76 e8 53 56 c9 94 f7 97 50 +f7 fa 3c f4 fd 48 2d f7 5e 3f b9 97 8c d0 61 f7 +ab b1 75 72 e6 e6 3e 0b de 12 cb dc f1 8c 68 b9 +79 + +# -------------------------------- +# RSASSA-PSS Signature Example 5.4 +# -------------------------------- + +# Message to be signed: +32 8c 65 9e 0a 64 37 43 3c ce b7 3c 14 + +# Salt: +9a ec 4a 74 80 d5 bb c4 29 20 d7 ca 23 5d b6 74 +98 9c 9a ac + +# Signature: +0b c9 89 85 3b c2 ea 86 87 32 71 ce 18 3a 92 3a +b6 5e 8a 53 10 0e 6d f5 d8 7a 24 c4 19 4e b7 97 +81 3e e2 a1 87 c0 97 dd 87 2d 59 1d a6 0c 56 86 +05 dd 7e 74 2d 5a f4 e3 3b 11 67 8c cb 63 90 32 +04 a3 d0 80 b0 90 2c 89 ab a8 86 8f 00 9c 0f 1c +0c b8 58 10 bb dd 29 12 1a bb 84 71 ff 2d 39 e4 +9f d9 2d 56 c6 55 c8 e0 37 ad 18 fa fb dc 92 c9 +58 63 f7 f6 1e a9 ef a2 8f ea 40 13 69 d1 9d ae +a1 + +# -------------------------------- +# RSASSA-PSS Signature Example 5.5 +# -------------------------------- + +# Message to be signed: +f3 7b 96 23 79 a4 7d 41 5a 37 6e ec 89 73 15 0b +cb 34 ed d5 ab 65 40 41 b6 14 30 56 0c 21 44 58 +2b a1 33 c8 67 d8 52 d6 b8 e2 33 21 90 13 02 ec +b4 5b 09 ec 88 b1 52 71 78 fa 04 32 63 f3 06 7d +9f fe 97 30 32 a9 9f 4c b0 8a d2 c7 e0 a2 45 6c +dd 57 a7 df 56 fe 60 53 52 7a 5a eb 67 d7 e5 52 +06 3c 1c a9 7b 1b ef fa 7b 39 e9 97 ca f2 78 78 +ea 0f 62 cb eb c8 c2 1d f4 c8 89 a2 02 85 1e 94 +90 88 49 0c 24 9b 6e 9a cf 1d 80 63 f5 be 23 43 +98 9b f9 5c 4d a0 1a 2b e7 8b 4a b6 b3 78 01 5b +c3 79 57 f7 69 48 b5 e5 8e 44 0c 28 45 3d 40 d7 +cf d5 7e 7d 69 06 00 47 4a b5 e7 59 73 b1 ea 0c +5f 1e 45 d1 41 90 af e2 f4 eb 6d 3b df 71 f1 d2 +f8 bb 15 6a 1c 29 5d 04 aa eb 9d 68 9d ce 79 ed +62 bc 44 3e + +# Salt: +e2 0c 1e 98 78 51 2c 39 97 0f 58 37 5e 15 49 a6 +8b 64 f3 1d + +# Signature: +0a ef a9 43 b6 98 b9 60 9e df 89 8a d2 27 44 ac +28 dc 23 94 97 ce a3 69 cb bd 84 f6 5c 95 c0 ad +77 6b 59 47 40 16 4b 59 a7 39 c6 ff 7c 2f 07 c7 +c0 77 a8 6d 95 23 8f e5 1e 1f cf 33 57 4a 4a e0 +68 4b 42 a3 f6 bf 67 7d 91 82 0c a8 98 74 46 7b +2c 23 ad d7 79 69 c8 07 17 43 0d 0e fc 1d 36 95 +89 2c e8 55 cb 7f 70 11 63 0f 4d f2 6d ef 8d df +36 fc 23 90 5f 57 fa 62 43 a4 85 c7 70 d5 68 1f +cd + +# -------------------------------- +# RSASSA-PSS Signature Example 5.6 +# -------------------------------- + +# Message to be signed: +c6 10 3c 33 0c 1e f7 18 c1 41 e4 7b 8f a8 59 be +4d 5b 96 25 9e 7d 14 20 70 ec d4 85 83 9d ba 5a +83 69 c1 7c 11 14 03 5e 53 2d 19 5c 74 f4 4a 04 +76 a2 d3 e8 a4 da 21 00 16 ca ce d0 e3 67 cb 86 +77 10 a4 b5 aa 2d f2 b8 e5 da f5 fd c6 47 80 7d +4d 5e bb 6c 56 b9 76 3c cd ae 4d ea 33 08 eb 0a +c2 a8 95 01 cb 20 9d 26 39 fa 5b f8 7c e7 90 74 +7d 3c b2 d2 95 e8 45 64 f2 f6 37 82 4f 0c 13 02 +81 29 b0 aa 4a 42 2d 16 22 82 + +# Salt: +23 29 1e 4a 33 07 e8 bb b7 76 62 3a b3 4e 4a 5f +4c c8 a8 db + +# Signature: +02 80 2d cc fa 8d fa f5 27 9b f0 b4 a2 9b a1 b1 +57 61 1f ae aa f4 19 b8 91 9d 15 94 19 00 c1 33 +9e 7e 92 e6 fa e5 62 c5 3e 6c c8 e8 41 04 b1 10 +bc e0 3a d1 85 25 e3 c4 9a 0e ad ad 5d 3f 28 f2 +44 a8 ed 89 ed ba fb b6 86 27 7c fa 8a e9 09 71 +4d 6b 28 f4 bf 8e 29 3a a0 4c 41 ef e7 c0 a8 12 +66 d5 c0 61 e2 57 5b e0 32 aa 46 46 74 ff 71 62 +62 19 bd 74 cc 45 f0 e7 ed 4e 3f f9 6e ee 75 8e +8f + +# ============================================= + +# ================================== +# Example 6: A 1029-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +16 4c a3 1c ff 60 9f 3a 0e 71 01 b0 39 f2 e4 fe +6d d3 75 19 ab 98 59 8d 17 9e 17 49 96 59 80 71 +f4 7d 3a 04 55 91 58 d7 be 37 3c f1 aa 53 f0 aa +6e f0 90 39 e5 67 8c 2a 4c 63 90 05 14 c8 c4 f8 +aa ed 5d e1 2a 5f 10 b0 9c 31 1a f8 c0 ff b5 b7 +a2 97 f2 ef c6 3b 8d 6b 05 10 93 1f 0b 98 e4 8b +f5 fc 6e c4 e7 b8 db 1f fa eb 08 c3 8e 02 ad b8 +f0 3a 48 22 9c 99 e9 69 43 1f 61 cb 8c 4d c6 98 +d1 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +03 b6 64 ee 3b 75 66 72 3f c6 ea f2 8a bb 43 0a +39 80 f1 12 6c 81 de 8a d7 09 ea b3 9a c9 dc d0 +b1 55 0b 37 29 d8 70 68 e9 52 00 9d f5 44 53 4c +1f 50 82 9a 78 f4 59 1e b8 fd 57 14 04 26 a6 bb +04 05 b6 a6 f5 1a 57 d9 26 7b 7b bc 65 33 91 a6 +99 a2 a9 0d ac 8a e2 26 bc c6 0f a8 cd 93 4c 73 +c7 b0 3b 1f 6b 81 81 58 63 18 38 a8 61 2e 6e 6e +a9 2b e2 4f 83 24 fa f5 b1 fd 85 87 22 52 67 ba +6f + +# Prime p: +04 f0 54 8c 96 26 ab 1e bf 12 44 93 47 41 d9 9a +06 22 0e fa 2a 58 56 aa 0e 75 73 0b 2e c9 6a dc +86 be 89 4f a2 80 3b 53 a5 e8 5d 27 6a cb d2 9a +b8 23 f8 0a 73 91 bb 54 a5 05 16 72 fb 04 ee b5 +43 + +# Prime q: +04 83 e0 ae 47 91 55 87 74 3f f3 45 36 2b 55 5d +39 62 d9 8b b6 f1 5f 84 8b 4c 92 b1 77 1c a8 ed +10 7d 8d 3e e6 5e c4 45 17 dd 0f aa 48 1a 38 7e +90 2f 7a 2e 74 7c 26 9e 7e a4 44 80 bc 53 8b 8e +5b + +# p's CRT exponent dP: +03 a8 e8 ae a9 92 0c 1a a3 b2 f0 d8 46 e4 b8 50 +d8 1c a3 06 a5 1c 83 54 4f 94 9f 64 f9 0d cf 3f +8e 26 61 f0 7e 56 12 20 a1 80 38 8f be 27 3e 70 +e2 e5 dc a8 3a 0e 13 48 dd 64 90 c7 31 d6 ec e1 +ab + +# q's CRT exponent dQ: +01 35 bd cd b6 0b f2 19 7c 43 6e d3 4b 32 cd 8b +4f c7 77 78 83 2b a7 67 03 55 1f b2 42 b3 01 69 +95 93 af 77 fd 8f c3 94 a8 52 6a d2 3c c4 1a 03 +80 6b d8 97 fe 4b 0e a6 46 55 8a ad dc c9 9e 8a +25 + +# CRT coefficient qInv: +03 04 c0 3d 9c 73 65 03 a9 84 ab bd 9b a2 23 01 +40 7c 4a 2a b1 dd 85 76 64 81 b6 0d 45 40 11 52 +e6 92 be 14 f4 12 1d 9a a3 fd 6e 0b 4d 1d 3a 97 +35 38 a3 1d 42 ee 6e 1e 5e f6 20 23 1a 2b ba f3 +5f + +# -------------------------------- +# RSASSA-PSS Signature Example 6.1 +# -------------------------------- + +# Message to be signed: +0a 20 b7 74 ad dc 2f a5 12 45 ed 7c b9 da 60 9e +50 ca c6 63 6a 52 54 3f 97 45 8e ed 73 40 f8 d5 +3f fc 64 91 8f 94 90 78 ee 03 ef 60 d4 2b 5f ec +24 60 50 bd 55 05 cd 8c b5 97 ba d3 c4 e7 13 b0 +ef 30 64 4e 76 ad ab b0 de 01 a1 56 1e fb 25 51 +58 c7 4f c8 01 e6 e9 19 e5 81 b4 6f 0f 0d dd 08 +e4 f3 4c 78 10 b5 ed 83 18 f9 1d 7c 8c + +# Salt: +5b 4e a2 ef 62 9c c2 2f 3b 53 8e 01 69 04 b4 7b +1e 40 bf d5 + +# Signature: +04 c0 cf ac ec 04 e5 ba db ec e1 59 a5 a1 10 3f +69 b3 f3 2b a5 93 cb 4c c4 b1 b7 ab 45 59 16 a9 +6a 27 cd 26 78 ea 0f 46 ba 37 f7 fc 9c 86 32 5f +29 73 3b 38 9f 1d 97 f4 3e 72 01 c0 f3 48 fc 45 +fe 42 89 23 35 36 2e ee 01 8b 5b 16 1f 2f 93 93 +03 12 25 c7 13 01 2a 57 6b c8 8e 23 05 24 89 86 +8d 90 10 cb f0 33 ec c5 68 e8 bc 15 2b dc 59 d5 +60 e4 12 91 91 5d 28 56 52 08 e2 2a ee c9 ef 85 +d1 + +# -------------------------------- +# RSASSA-PSS Signature Example 6.2 +# -------------------------------- + +# Message to be signed: +2a af f6 63 1f 62 1c e6 15 76 0a 9e bc e9 4b b3 +33 07 7a d8 64 88 c8 61 d4 b7 6d 29 c1 f4 87 46 +c6 11 ae 1e 03 ce d4 44 5d 7c fa 1f e5 f6 2e 1b +3f 08 45 2b de 3b 6e f8 19 73 ba fb b5 7f 97 bc +ee f8 73 98 53 95 b8 26 05 89 aa 88 cb 7d b5 0a +b4 69 26 2e 55 1b dc d9 a5 6f 27 5a 0a c4 fe 48 +47 00 c3 5f 3d bf 2b 46 9e de 86 47 41 b8 6f a5 +91 72 a3 60 ba 95 a0 2e 13 9b e5 0d df b7 cf 0b +42 fa ea bb fb ba a8 6a 44 97 69 9c 4f 2d fd 5b +08 40 6a f7 e1 41 44 42 7c 25 3e c0 ef a2 0e af +9a 8b e8 cd 49 ce 1f 1b c4 e9 3e 61 9c f2 aa 8e +d4 fb 39 bc 85 90 d0 f7 b9 64 88 f7 31 7a c9 ab +f7 be e4 e3 a0 e7 15 + +# Salt: +83 14 6a 9e 78 27 22 c2 8b 01 4f 98 b4 26 7b da +2a c9 50 4f + +# Signature: +0a 23 14 25 0c f5 2b 6e 4e 90 8d e5 b3 56 46 bc +aa 24 36 1d a8 16 0f b0 f9 25 75 90 ab 3a ce 42 +b0 dc 3e 77 ad 2d b7 c2 03 a2 0b d9 52 fb b5 6b +15 67 04 6e cf aa 93 3d 7b 10 00 c3 de 9f f0 5b +7d 98 9b a4 6f d4 3b c4 c2 d0 a3 98 6b 7f fa 13 +47 1d 37 eb 5b 47 d6 47 07 bd 29 0c fd 6a 9f 39 +3a d0 8e c1 e3 bd 71 bb 57 92 61 50 35 cd af 2d +89 29 ae d3 be 09 83 79 37 7e 77 7c e7 9a aa 47 +73 + +# -------------------------------- +# RSASSA-PSS Signature Example 6.3 +# -------------------------------- + +# Message to be signed: +0f 61 95 d0 4a 6e 6f c7 e2 c9 60 0d bf 84 0c 39 +ea 8d 4d 62 4f d5 35 07 01 6b 0e 26 85 8a 5e 0a +ec d7 ad a5 43 ae 5c 0a b3 a6 25 99 cb a0 a5 4e +6b f4 46 e2 62 f9 89 97 8f 9d df 5e 9a 41 + +# Salt: +a8 7b 8a ed 07 d7 b8 e2 da f1 4d dc a4 ac 68 c4 +d0 aa bf f8 + +# Signature: +08 6d f6 b5 00 09 8c 12 0f 24 ff 84 23 f7 27 d9 +c6 1a 5c 90 07 d3 b6 a3 1c e7 cf 8f 3c be c1 a2 +6b b2 0e 2b d4 a0 46 79 32 99 e0 3e 37 a2 1b 40 +19 4f b0 45 f9 0b 18 bf 20 a4 79 92 cc d7 99 cf +9c 05 9c 29 9c 05 26 85 49 54 aa de 8a 6a d9 d9 +7e c9 1a 11 45 38 3f 42 46 8b 23 1f 4d 72 f2 37 +06 d9 85 3c 3f a4 3c e8 ac e8 bf e7 48 49 87 a1 +ec 6a 16 c8 da f8 1f 7c 8b f4 27 74 70 7a 9d f4 +56 + +# -------------------------------- +# RSASSA-PSS Signature Example 6.4 +# -------------------------------- + +# Message to be signed: +33 7d 25 fe 98 10 eb ca 0d e4 d4 65 8d 3c eb 8e +0f e4 c0 66 ab a3 bc c4 8b 10 5d 3b f7 e0 25 7d +44 fe ce a6 59 6f 4d 0c 59 a0 84 02 83 36 78 f7 +06 20 f9 13 8d fe b7 de d9 05 e4 a6 d5 f0 5c 47 +3d 55 93 66 52 e2 a5 df 43 c0 cf da 7b ac af 30 +87 f4 52 4b 06 cf 42 15 7d 01 53 97 39 f7 fd de +c9 d5 81 25 df 31 a3 2e ab 06 c1 9b 71 f1 d5 bf + +# Salt: +a3 79 32 f8 a7 49 4a 94 2d 6f 76 74 38 e7 24 d6 +d0 c0 ef 18 + +# Signature: +0b 5b 11 ad 54 98 63 ff a9 c5 1a 14 a1 10 6c 2a +72 cc 8b 64 6e 5c 72 62 50 97 86 10 5a 98 47 76 +53 4c a9 b5 4c 1c c6 4b f2 d5 a4 4f d7 e8 a6 9d +b6 99 d5 ea 52 08 7a 47 48 fd 2a bc 1a fe d1 e5 +d6 f7 c8 90 25 53 0b da a2 21 3d 7e 03 0f a5 5d +f6 f3 4b cf 1c e4 6d 2e df 4e 3a e4 f3 b0 18 91 +a0 68 c9 e3 a4 4b bc 43 13 3e da d6 ec b9 f3 54 +00 c4 25 2a 57 62 d6 57 44 b9 9c b9 f4 c5 59 32 +9f + +# -------------------------------- +# RSASSA-PSS Signature Example 6.5 +# -------------------------------- + +# Message to be signed: +84 ec 50 2b 07 2e 82 87 78 9d 8f 92 35 82 9e a3 +b1 87 af d4 d4 c7 85 61 1b da 5f 9e b3 cb 96 71 +7e fa 70 07 22 7f 1c 08 cb cb 97 2e 66 72 35 e0 +fb 7d 43 1a 65 70 32 6d 2e cc e3 5a db 37 3d c7 +53 b3 be 5f 82 9b 89 17 54 93 19 3f ab 16 ba db +41 37 1b 3a ac 0a e6 70 07 6f 24 be f4 20 c1 35 +ad d7 ce e8 d3 5f bc 94 4d 79 fa fb 9e 30 7a 13 +b0 f5 56 cb 65 4a 06 f9 73 ed 22 67 23 30 19 7e +f5 a7 48 bf 82 6a 5d b2 38 3a 25 36 4b 68 6b 93 +72 bb 23 39 ae b1 ac 9e 98 89 32 7d 01 6f 16 70 +77 6d b0 62 01 ad bd ca f8 a5 e3 b7 4e 10 8b 73 + +# Salt: +7b 79 0c 1d 62 f7 b8 4e 94 df 6a f2 89 17 cf 57 +10 18 11 0e + +# Signature: +02 d7 1f a9 b5 3e 46 54 fe fb 7f 08 38 5c f6 b0 +ae 3a 81 79 42 eb f6 6c 35 ac 67 f0 b0 69 95 2a +3c e9 c7 e1 f1 b0 2e 48 0a 95 00 83 6d e5 d6 4c +db 7e cd e0 45 42 f7 a7 99 88 78 7e 24 c2 ba 05 +f5 fd 48 2c 02 3e d5 c3 0e 04 83 9d c4 4b ed 2a +3a 3a 4f ee 01 11 3c 89 1a 47 d3 2e b8 02 5c 28 +cb 05 0b 5c db 57 6c 70 fe 76 ef 52 34 05 c0 84 +17 fa f3 50 b0 37 a4 3c 37 93 39 fc b1 8d 3a 35 +6b + +# -------------------------------- +# RSASSA-PSS Signature Example 6.6 +# -------------------------------- + +# Message to be signed: +99 06 d8 9f 97 a9 fd ed d3 cc d8 24 db 68 73 26 +f3 0f 00 aa 25 a7 fc a2 af cb 3b 0f 86 cd 41 e7 +3f 0e 8f f7 d2 d8 3f 59 e2 8e d3 1a 5a 0d 55 15 +23 37 4d e2 2e 4c 7e 8f f5 68 b3 86 ee 3d c4 11 +63 f1 0b f6 7b b0 06 26 1c 90 82 f9 af 90 bf 1d +90 49 a6 b9 fa e7 1c 7f 84 fb e6 e5 5f 02 78 9d +e7 74 f2 30 f1 15 02 6a 4b 4e 96 c5 5b 04 a9 5d +a3 aa cb b2 ce ce 8f 81 76 4a 1f 1c 99 51 54 11 +08 7c f7 d3 4a ed ed 09 32 c1 83 + +# Salt: +fb be 05 90 25 b6 9b 89 fb 14 ae 22 89 e7 aa af +e6 0c 0f cd + +# Signature: +0a 40 a1 6e 2f e2 b3 8d 1d f9 05 46 16 7c f9 46 +9c 9e 3c 36 81 a3 44 2b 4b 2c 2f 58 1d eb 38 5c +e9 9f c6 18 8b b0 2a 84 1d 56 e7 6d 30 18 91 e2 +45 60 55 0f cc 2a 26 b5 5f 4c cb 26 d8 37 d3 50 +a1 54 bc ac a8 39 2d 98 fa 67 95 9e 97 27 b7 8c +ad 03 26 9f 56 96 8f c5 6b 68 bd 67 99 26 d8 3c +c9 cb 21 55 50 64 5c cd a3 1c 76 0f f3 58 88 94 +3d 2d 8a 1d 35 1e 81 e5 d0 7b 86 18 2e 75 10 81 +ef + +# ============================================= + +# ================================== +# Example 7: A 1030-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +37 c9 da 4a 66 c8 c4 08 b8 da 27 d0 c9 d7 9f 8c +cb 1e af c1 d2 fe 48 74 6d 94 0b 7c 4e f5 de e1 +8a d1 26 47 ce fa a0 c4 b3 18 8b 22 1c 51 53 86 +75 9b 93 f0 20 24 b2 5a b9 24 2f 83 57 d8 f3 fd +49 64 0e e5 e6 43 ea f6 c6 4d ee fa 70 89 72 7c +8f f0 39 93 33 39 15 c6 ef 21 bf 59 75 b6 e5 0d +11 8b 51 00 8e c3 3e 9f 01 a0 a5 45 a1 0a 83 6a +43 dd bc a9 d8 b5 c5 d3 54 80 22 d7 06 4e a2 9a +b3 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +3b ed 99 90 52 d9 57 bc 06 d6 51 ee f6 e3 a9 80 +94 b1 62 1b d3 8b 54 49 bd 6c 4a ea 3d e7 e0 84 +67 9a 44 84 de d2 5b e0 f0 82 6c f3 37 78 25 41 +4b 14 d4 d6 1d b1 4d e6 26 fb b8 0e 5f 4f ae c9 +56 f9 a0 a2 d2 4f 99 57 63 80 f0 84 eb 62 e4 6a +57 d5 54 27 8b 53 56 26 19 3c e0 20 60 57 5e b6 +6c 57 98 d3 6f 6c 5d 40 fb 00 d8 09 b4 2a 73 10 +2c 1c 74 ee 95 bd 71 42 0f ff ef 63 18 b5 2c 29 + +# Prime p: +07 ee fb 42 4b 0e 3a 40 e4 20 8e e5 af b2 80 b2 +23 17 30 81 14 dd e0 b4 b6 4f 73 01 84 ec 68 da +6c e2 86 7a 9f 48 ed 77 26 d5 e2 61 4e d0 4a 54 +10 73 6c 8c 71 4e e7 02 47 42 98 c6 29 2a f0 75 +35 + +# Prime q: +07 08 30 db f9 47 ea c0 22 8d e2 63 14 b5 9b 66 +99 4c c6 0e 83 60 e7 5d 38 76 29 8f 8f 8a 7d 14 +1d a0 64 e5 ca 02 6a 97 3e 28 f2 54 73 8c ee 66 +9c 72 1b 03 4c b5 f8 e2 44 da dd 7c d1 e1 59 d5 +47 + +# p's CRT exponent dP: +05 24 d2 0c 3d 95 cf f7 5a f2 31 34 83 22 7d 87 +02 71 7a a5 76 de 15 5f 96 05 15 50 1a db 1d 70 +e1 c0 4d e9 1b 75 b1 61 db f0 39 83 56 12 7e de +da 7b bc 19 a3 2d c1 62 1c c9 f5 3c 26 5d 0c e3 +31 + +# q's CRT exponent dQ: +05 f9 84 a1 f2 3c 93 8d 6a 0e 89 72 4b cf 3d d9 +3f 99 46 92 60 37 fe 7c 6b 13 a2 9e 52 84 85 5f +89 08 95 91 d4 40 97 56 27 bf 5c 9e 3a 8b 5c a7 +9c 77 2a d2 73 e4 0d 32 1a f4 a6 c9 7d fd ed 78 +d3 + +# CRT coefficient qInv: +dd d9 18 ad ad a2 9d ca b9 81 ff 9a cb a4 25 70 +23 c0 9a 38 01 cc ce 09 8c e2 68 f8 55 d0 df 57 +0c d6 e7 b9 b1 4b d9 a5 a9 25 4c bc 31 5b e6 f8 +ba 1e 25 46 dd d5 69 c5 ea 19 ee d8 35 3b de 5e + +# -------------------------------- +# RSASSA-PSS Signature Example 7.1 +# -------------------------------- + +# Message to be signed: +9e ad 0e 01 94 56 40 67 4e b4 1c ad 43 5e 23 74 +ea ef a8 ad 71 97 d9 79 13 c4 49 57 d8 d8 3f 40 +d7 6e e6 0e 39 bf 9c 0f 9e af 30 21 42 1a 07 4d +1a de 96 2c 6e 9d 3d c3 bb 17 4f e4 df e6 52 b0 +91 15 49 5b 8f d2 79 41 74 02 0a 06 02 b5 ca 51 +84 8c fc 96 ce 5e b5 7f c0 a2 ad c1 dd a3 6a 7c +c4 52 64 1a 14 91 1b 37 e4 5b fa 11 da a5 c7 ec +db 74 f6 d0 10 0d 1d 3e 39 e7 52 80 0e 20 33 97 +de 02 33 07 7b 9a 88 85 55 37 fa e9 27 f9 24 38 +0d 78 0f 98 e1 8d cf f3 9c 5e a7 41 b1 7d 6f dd +18 85 bc 9d 58 14 82 d7 71 ce b5 62 d7 8a 8b f8 +8f 0c 75 b1 13 63 e5 e3 6c d4 79 ce b0 54 5f 9d +a8 42 03 e0 e6 e5 08 37 5c c9 e8 44 b8 8b 7a c7 +a0 a2 01 ea 0f 1b ee 9a 2c 57 79 20 ca 02 c0 1b +9d 83 20 e9 74 a5 6f 4e fb 57 63 b9 62 55 ab bf +80 37 bf 18 02 cf 01 8f 56 37 94 93 e5 69 a9 + +# Salt: +b7 86 7a 59 95 8c b5 43 28 f8 77 5e 65 46 ec 06 +d2 7e aa 50 + +# Signature: +18 7f 39 07 23 c8 90 25 91 f0 15 4b ae 6d 4e cb +ff e0 67 f0 e8 b7 95 47 6e a4 f4 d5 1c cc 81 05 +20 bb 3c a9 bc a7 d0 b1 f2 ea 8a 17 d8 73 fa 27 +57 0a cd 64 2e 38 08 56 1c b9 e9 75 cc fd 80 b2 +3d c5 77 1c db 33 06 a5 f2 31 59 da cb d3 aa 2d +b9 3d 46 d7 66 e0 9e d1 5d 90 0a d8 97 a8 d2 74 +dc 26 b4 7e 99 4a 27 e9 7e 22 68 a7 66 53 3a e4 +b5 e4 2a 2f ca f7 55 c1 c4 79 4b 29 4c 60 55 58 +23 + +# -------------------------------- +# RSASSA-PSS Signature Example 7.2 +# -------------------------------- + +# Message to be signed: +8d 80 d2 d0 8d bd 19 c1 54 df 3f 14 67 3a 14 bd +03 73 52 31 f2 4e 86 bf 15 3d 0e 69 e7 4c bf f7 +b1 83 6e 66 4d e8 3f 68 01 24 37 0f c0 f9 6c 9b +65 c0 7a 36 6b 64 4c 4a b3 + +# Salt: +0c 09 58 22 66 df 08 63 10 82 1b a7 e1 8d f6 4d +fe e6 de 09 + +# Signature: +10 fd 89 76 8a 60 a6 77 88 ab b5 85 6a 78 7c 85 +61 f3 ed cf 9a 83 e8 98 f7 dc 87 ab 8c ce 79 42 +9b 43 e5 69 06 94 1a 88 61 94 f1 37 e5 91 fe 7c +33 95 55 36 1f bb e1 f2 4f eb 2d 4b cd b8 06 01 +f3 09 6b c9 13 2d ee a6 0a e1 30 82 f4 4f 9a d4 +1c d6 28 93 6a 4d 51 17 6e 42 fc 59 cb 76 db 81 +5c e5 ab 4d b9 9a 10 4a af ea 68 f5 d3 30 32 9e +bf 25 8d 4e de 16 06 4b d1 d0 03 93 d5 e1 57 0e +b8 + +# -------------------------------- +# RSASSA-PSS Signature Example 7.3 +# -------------------------------- + +# Message to be signed: +80 84 05 cd fc 1a 58 b9 bb 03 97 c7 20 72 2a 81 +ff fb 76 27 8f 33 59 17 ef 9c 47 38 14 b3 e0 16 +ba 29 73 cd 27 65 f8 f3 f8 2d 6c c3 8a a7 f8 55 +18 27 fe 8d 1e 38 84 b7 e6 1c 94 68 3b 8f 82 f1 +84 3b da e2 25 7e ee c9 81 2a d4 c2 cf 28 3c 34 +e0 b0 ae 0f e3 cb 99 0c f8 8f 2e f9 + +# Salt: +28 03 9d cf e1 06 d3 b8 29 66 11 25 8c 4a 56 65 +1c 9e 92 dd + +# Signature: +2b 31 fd e9 98 59 b9 77 aa 09 58 6d 8e 27 46 62 +b2 5a 2a 64 06 40 b4 57 f5 94 05 1c b1 e7 f7 a9 +11 86 54 55 24 29 26 cf 88 fe 80 df a3 a7 5b a9 +68 98 44 a1 1e 63 4a 82 b0 75 af bd 69 c1 2a 0d +f9 d2 5f 84 ad 49 45 df 3d c8 fe 90 c3 ce fd f2 +6e 95 f0 53 43 04 b5 bd ba 20 d3 e5 64 0a 2e bf +b8 98 aa c3 5a e4 0f 26 fc e5 56 3c 2f 9f 24 f3 +04 2a f7 6f 3c 70 72 d6 87 bb fb 95 9a 88 46 0a +f1 + +# -------------------------------- +# RSASSA-PSS Signature Example 7.4 +# -------------------------------- + +# Message to be signed: +f3 37 b9 ba d9 37 de 22 a1 a0 52 df f1 11 34 a8 +ce 26 97 62 02 98 19 39 b9 1e 07 15 ae 5e 60 96 +49 da 1a df ce f3 f4 cc a5 9b 23 83 60 e7 d1 e4 +96 c7 bf 4b 20 4b 5a cf f9 bb d6 16 6a 1d 87 a3 +6e f2 24 73 73 75 10 39 f8 a8 00 b8 39 98 07 b3 +a8 5f 44 89 34 97 c0 d0 5f b7 01 7b 82 22 81 52 +de 6f 25 e6 11 6d cc 75 03 c7 86 c8 75 c2 8f 3a +a6 07 e9 4a b0 f1 98 63 ab 1b 50 73 77 0b 0c d5 +f5 33 ac de 30 c6 fb 95 3c f3 da 68 02 64 e3 0f +c1 1b ff 9a 19 bf fa b4 77 9b 62 23 c3 fb 3f e0 +f7 1a ba de 4e b7 c0 9c 41 e2 4c 22 d2 3f a1 48 +e6 a1 73 fe b6 39 84 d1 bc 6e e3 a0 2d 91 5b 75 +2c ea f9 2a 30 15 ec eb 38 ca 58 6c 68 01 b3 7c +34 ce fb 2c ff 25 ea 23 c0 86 62 dc ab 26 a7 a9 +3a 28 5d 05 d3 04 4c + +# Salt: +a7 78 21 eb bb ef 24 62 8e 4e 12 e1 d0 ea 96 de +39 8f 7b 0f + +# Signature: +32 c7 ca 38 ff 26 94 9a 15 00 0c 4b a0 4b 2b 13 +b3 5a 38 10 e5 68 18 4d 7e ca ba a1 66 b7 ff ab +dd f2 b6 cf 4b a0 71 24 92 37 90 f2 e5 b1 a5 be +04 0a ea 36 fe 13 2e c1 30 e1 f1 05 67 98 2d 17 +ac 3e 89 b8 d2 6c 30 94 03 4e 76 2d 2e 03 12 64 +f0 11 70 be ec b3 d1 43 9e 05 84 6f 25 45 83 67 +a7 d9 c0 20 60 44 46 72 67 1e 64 e8 77 86 45 59 +ca 19 b2 07 4d 58 8a 28 1b 58 04 d2 37 72 fb be +19 + +# -------------------------------- +# RSASSA-PSS Signature Example 7.5 +# -------------------------------- + +# Message to be signed: +45 01 3c eb af d9 60 b2 55 47 6a 8e 25 98 b9 aa +32 ef be 6d c1 f3 4f 4a 49 8d 8c f5 a2 b4 54 8d +08 c5 5d 5f 95 f7 bc c9 61 91 63 05 6f 2d 58 b5 +2f a0 32 + +# Salt: +9d 5a d8 eb 45 21 34 b6 5d c3 a9 8b 6a 73 b5 f7 +41 60 9c d6 + +# Signature: +07 eb 65 1d 75 f1 b5 2b c2 63 b2 e1 98 33 6e 99 +fb eb c4 f3 32 04 9a 92 2a 10 81 56 07 ee 2d 98 +9d b3 a4 49 5b 7d cc d3 8f 58 a2 11 fb 7e 19 31 +71 a3 d8 91 13 24 37 eb ca 44 f3 18 b2 80 50 9e +52 b5 fa 98 fc ce 82 05 d9 69 7c 8e e4 b7 ff 59 +d4 c5 9c 79 03 8a 19 70 bd 2a 0d 45 1e cd c5 ef +11 d9 97 9c 9d 35 f8 c7 0a 61 63 71 76 07 89 0d +58 6a 7c 6d c0 1c 79 f8 6a 8f 28 e8 52 35 f8 c2 +f1 + +# -------------------------------- +# RSASSA-PSS Signature Example 7.6 +# -------------------------------- + +# Message to be signed: +23 58 09 70 86 c8 99 32 3e 75 d9 c9 0d 0c 09 f1 +2d 9d 54 ed fb df 70 a9 c2 eb 5a 04 d8 f3 6b 9b +2b df 2a ab e0 a5 bd a1 96 89 37 f9 d6 eb d3 b6 +b2 57 ef b3 13 6d 41 31 f9 ac b5 9b 85 e2 60 2c +2a 3f cd c8 35 49 4a 1f 4e 5e c1 8b 22 6c 80 23 +2b 36 a7 5a 45 fd f0 9a 7e a9 e9 8e fb de 14 50 +d1 19 4b f1 2e 15 a4 c5 f9 eb 5c 0b ce 52 69 e0 +c3 b2 8c fa b6 55 d8 1a 61 a2 0b 4b e2 f5 44 59 +bb 25 a0 db 94 c5 22 18 be 10 9a 74 26 de 83 01 +44 24 78 9a aa 90 e5 05 6e 63 2a 69 81 15 e2 82 +c1 a5 64 10 f2 6c 20 72 f1 93 48 1a 9d cd 88 05 +72 00 5e 64 f4 08 2e cf + +# Salt: +3f 2e fc 59 58 80 a7 d4 7f cf 3c ba 04 98 3e a5 +4c 4b 73 fb + +# Signature: +18 da 3c dc fe 79 bf b7 7f d9 c3 2f 37 7a d3 99 +14 6f 0a 8e 81 06 20 23 32 71 a6 e3 ed 32 48 90 +3f 5c dc 92 dc 79 b5 5d 3e 11 61 5a a0 56 a7 95 +85 37 92 a3 99 8c 34 9c a5 c4 57 e8 ca 7d 29 d7 +96 aa 24 f8 34 91 70 9b ef cf b1 51 0e a5 13 c9 +28 29 a3 f0 0b 10 4f 65 56 34 f3 20 75 2e 13 0e +c0 cc f6 75 4f f8 93 db 30 29 32 bb 02 5e b6 0e +87 82 25 98 fc 61 9e 0e 98 17 37 a9 a4 c4 15 2d +33 + +# ============================================= + +# ================================== +# Example 8: A 1031-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +49 53 70 a1 fb 18 54 3c 16 d3 63 1e 31 63 25 5d +f6 2b e6 ee e8 90 d5 f2 55 09 e4 f7 78 a8 ea 6f +bb bc df 85 df f6 4e 0d 97 20 03 ab 36 81 fb ba +6d d4 1f d5 41 82 9b 2e 58 2d e9 f2 a4 a4 e0 a2 +d0 90 0b ef 47 53 db 3c ee 0e e0 6c 7d fa e8 b1 +d5 3b 59 53 21 8f 9c ce ea 69 5b 08 66 8e de aa +dc ed 94 63 b1 d7 90 d5 eb f2 7e 91 15 b4 6c ad +4d 9a 2b 8e fa b0 56 1b 08 10 34 47 39 ad a0 73 +3f + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +6c 66 ff e9 89 80 c3 8f cd ea b5 15 98 98 83 61 +65 f4 b4 b8 17 c4 f6 a8 d4 86 ee 4e a9 13 0f e9 +b9 09 2b d1 36 d1 84 f9 5f 50 4a 60 7e ac 56 58 +46 d2 fd d6 59 7a 89 67 c7 39 6e f9 5a 6e ee bb +45 78 a6 43 96 6d ca 4d 8e e3 de 84 2d e6 32 79 +c6 18 15 9c 1a b5 4a 89 43 7b 6a 61 20 e4 93 0a +fb 52 a4 ba 6c ed 8a 49 47 ac 64 b3 0a 34 97 cb +e7 01 c2 d6 26 6d 51 72 19 ad 0e c6 d3 47 db e9 + +# Prime p: +08 da d7 f1 13 63 fa a6 23 d5 d6 d5 e8 a3 19 32 +8d 82 19 0d 71 27 d2 84 6c 43 9b 0a b7 26 19 b0 +a4 3a 95 32 0e 4e c3 4f c3 a9 ce a8 76 42 23 05 +bd 76 c5 ba 7b e9 e2 f4 10 c8 06 06 45 a1 d2 9e +db + +# Prime q: +08 47 e7 32 37 6f c7 90 0f 89 8e a8 2e b2 b0 fc +41 85 65 fd ae 62 f7 d9 ec 4c e2 21 7b 97 99 0d +d2 72 db 15 7f 99 f6 3c 0d cb b9 fb ac db d4 c4 +da db 6d f6 77 56 35 8c a4 17 48 25 b4 8f 49 70 +6d + +# p's CRT exponent dP: +05 c2 a8 3c 12 4b 36 21 a2 aa 57 ea 2c 3e fe 03 +5e ff 45 60 f3 3d de bb 7a da b8 1f ce 69 a0 c8 +c2 ed c1 65 20 dd a8 3d 59 a2 3b e8 67 96 3a c6 +5f 2c c7 10 bb cf b9 6e e1 03 de b7 71 d1 05 fd +85 + +# q's CRT exponent dQ: +04 ca e8 aa 0d 9f aa 16 5c 87 b6 82 ec 14 0b 8e +d3 b5 0b 24 59 4b 7a 3b 2c 22 0b 36 69 bb 81 9f +98 4f 55 31 0a 1a e7 82 36 51 d4 a0 2e 99 44 79 +72 59 51 39 36 34 34 e5 e3 0a 7e 7d 24 15 51 e1 +b9 + +# CRT coefficient qInv: +07 d3 e4 7b f6 86 60 0b 11 ac 28 3c e8 8d bb 3f +60 51 e8 ef d0 46 80 e4 4c 17 1e f5 31 b8 0b 2b +7c 39 fc 76 63 20 e2 cf 15 d8 d9 98 20 e9 6f f3 +0d c6 96 91 83 9c 4b 40 d7 b0 6e 45 30 7d c9 1f +3f + +# -------------------------------- +# RSASSA-PSS Signature Example 8.1 +# -------------------------------- + +# Message to be signed: +81 33 2f 4b e6 29 48 41 5e a1 d8 99 79 2e ea cf +6c 6e 1d b1 da 8b e1 3b 5c ea 41 db 2f ed 46 70 +92 e1 ff 39 89 14 c7 14 25 97 75 f5 95 f8 54 7f +73 56 92 a5 75 e6 92 3a f7 8f 22 c6 99 7d db 90 +fb 6f 72 d7 bb 0d d5 74 4a 31 de cd 3d c3 68 58 +49 83 6e d3 4a ec 59 63 04 ad 11 84 3c 4f 88 48 +9f 20 97 35 f5 fb 7f da f7 ce c8 ad dc 58 18 16 +8f 88 0a cb f4 90 d5 10 05 b7 a8 e8 4e 43 e5 42 +87 97 75 71 dd 99 ee a4 b1 61 eb 2d f1 f5 10 8f +12 a4 14 2a 83 32 2e db 05 a7 54 87 a3 43 5c 9a +78 ce 53 ed 93 bc 55 08 57 d7 a9 fb + +# Salt: +1d 65 49 1d 79 c8 64 b3 73 00 9b e6 f6 f2 46 7b +ac 4c 78 fa + +# Signature: +02 62 ac 25 4b fa 77 f3 c1 ac a2 2c 51 79 f8 f0 +40 42 2b 3c 5b af d4 0a 8f 21 cf 0f a5 a6 67 cc +d5 99 3d 42 db af b4 09 c5 20 e2 5f ce 2b 1e e1 +e7 16 57 7f 1e fa 17 f3 da 28 05 2f 40 f0 41 9b +23 10 6d 78 45 aa f0 11 25 b6 98 e7 a4 df e9 2d +39 67 bb 00 c4 d0 d3 5b a3 55 2a b9 a8 b3 ee f0 +7c 7f ec db c5 42 4a c4 db 1e 20 cb 37 d0 b2 74 +47 69 94 0e a9 07 e1 7f bb ca 67 3b 20 52 23 80 +c5 + +# -------------------------------- +# RSASSA-PSS Signature Example 8.2 +# -------------------------------- + +# Message to be signed: +e2 f9 6e af 0e 05 e7 ba 32 6e cc a0 ba 7f d2 f7 +c0 23 56 f3 ce de 9d 0f aa bf 4f cc 8e 60 a9 73 +e5 59 5f d9 ea 08 + +# Salt: +43 5c 09 8a a9 90 9e b2 37 7f 12 48 b0 91 b6 89 +87 ff 18 38 + +# Signature: +27 07 b9 ad 51 15 c5 8c 94 e9 32 e8 ec 0a 28 0f +56 33 9e 44 a1 b5 8d 4d dc ff 2f 31 2e 5f 34 dc +fe 39 e8 9c 6a 94 dc ee 86 db bd ae 5b 79 ba 4e +08 19 a9 e7 bf d9 d9 82 e7 ee 6c 86 ee 68 39 6e +8b 3a 14 c9 c8 f3 4b 17 8e b7 41 f9 d3 f1 21 10 +9b f5 c8 17 2f ad a2 e7 68 f9 ea 14 33 03 2c 00 +4a 8a a0 7e b9 90 00 0a 48 dc 94 c8 ba c8 aa be +2b 09 b1 aa 46 c0 a2 aa 0e 12 f6 3f bb a7 75 ba +7e + +# -------------------------------- +# RSASSA-PSS Signature Example 8.3 +# -------------------------------- + +# Message to be signed: +e3 5c 6e d9 8f 64 a6 d5 a6 48 fc ab 8a db 16 33 +1d b3 2e 5d 15 c7 4a 40 ed f9 4c 3d c4 a4 de 79 +2d 19 08 89 f2 0f 1e 24 ed 12 05 4a 6b 28 79 8f +cb 42 d1 c5 48 76 9b 73 4c 96 37 31 42 09 2a ed +27 76 03 f4 73 8d f4 dc 14 46 58 6d 0e c6 4d a4 +fb 60 53 6d b2 ae 17 fc 7e 3c 04 bb fb bb d9 07 +bf 11 7c 08 63 6f a1 6f 95 f5 1a 62 16 93 4d 3e +34 f8 50 30 f1 7b bb c5 ba 69 14 40 58 af f0 81 +e0 b1 9c f0 3c 17 19 5c 5e 88 8b a5 8f 6f e0 a0 +2e 5c 3b da 97 19 a7 + +# Salt: +c6 eb be 76 df 0c 4a ea 32 c4 74 17 5b 2f 13 68 +62 d0 45 29 + +# Signature: +2a d2 05 09 d7 8c f2 6d 1b 6c 40 61 46 08 6e 4b +0c 91 a9 1c 2b d1 64 c8 7b 96 6b 8f aa 42 aa 0c +a4 46 02 23 23 ba 4b 1a 1b 89 70 6d 7f 4c 3b e5 +7d 7b 69 70 2d 16 8a b5 95 5e e2 90 35 6b 8c 4a +29 ed 46 7d 54 7e c2 3c ba df 28 6c cb 58 63 c6 +67 9d a4 67 fc 93 24 a1 51 c7 ec 55 aa c6 db 40 +84 f8 27 26 82 5c fe 1a a4 21 bc 64 04 9f b4 2f +23 14 8f 9c 25 b2 dc 30 04 37 c3 8d 42 8a a7 5f +96 + +# -------------------------------- +# RSASSA-PSS Signature Example 8.4 +# -------------------------------- + +# Message to be signed: +db c5 f7 50 a7 a1 4b e2 b9 3e 83 8d 18 d1 4a 86 +95 e5 2e 8a dd 9c 0a c7 33 b8 f5 6d 27 47 e5 29 +a0 cc a5 32 dd 49 b9 02 ae fe d5 14 44 7f 9e 81 +d1 61 95 c2 85 38 68 cb 9b 30 f7 d0 d4 95 c6 9d +01 b5 c5 d5 0b 27 04 5d b3 86 6c 23 24 a4 4a 11 +0b 17 17 74 6d e4 57 d1 c8 c4 5c 3c d2 a9 29 70 +c3 d5 96 32 05 5d 4c 98 a4 1d 6e 99 e2 a3 dd d5 +f7 f9 97 9a b3 cd 18 f3 75 05 d2 51 41 de 2a 1b +ff 17 b3 a7 dc e9 41 9e cc 38 5c f1 1d 72 84 0f +19 95 3f d0 50 92 51 f6 ca fd e2 89 3d 0e 75 c7 +81 ba 7a 50 12 ca 40 1a 4f a9 9e 04 b3 c3 24 9f +92 6d 5a fe 82 cc 87 da b2 2c 3c 1b 10 5d e4 8e +34 ac e9 c9 12 4e 59 59 7a c7 eb f8 + +# Salt: +02 1f dc c6 eb b5 e1 9b 1c b1 6e 9c 67 f2 76 81 +65 7f e2 0a + +# Signature: +1e 24 e6 e5 86 28 e5 17 50 44 a9 eb 6d 83 7d 48 +af 12 60 b0 52 0e 87 32 7d e7 89 7e e4 d5 b9 f0 +df 0b e3 e0 9e d4 de a8 c1 45 4f f3 42 3b b0 8e +17 93 24 5a 9d f8 bf 6a b3 96 8c 8e dd c3 b5 32 +85 71 c7 7f 09 1c c5 78 57 69 12 df eb d1 64 b9 +de 54 54 fe 0b e1 c1 f6 38 5b 32 83 60 ce 67 ec +7a 05 f6 e3 0e b4 5c 17 c4 8a c7 00 41 d2 ca b6 +7f 0a 2a e7 aa fd cc 8d 24 5e a3 44 2a 63 00 cc +c7 + +# -------------------------------- +# RSASSA-PSS Signature Example 8.5 +# -------------------------------- + +# Message to be signed: +04 dc 25 1b e7 2e 88 e5 72 34 85 b6 38 3a 63 7e +2f ef e0 76 60 c5 19 a5 60 b8 bc 18 bd ed b8 6e +ae 23 64 ea 53 ba 9d ca 6e b3 d2 e7 d6 b8 06 af +42 b3 e8 7f 29 1b 4a 88 81 d5 bf 57 2c c9 a8 5e +19 c8 6a cb 28 f0 98 f9 da 03 83 c5 66 d3 c0 f5 +8c fd 8f 39 5d cf 60 2e 5c d4 0e 8c 71 83 f7 14 +99 6e 22 97 ef + +# Salt: +c5 58 d7 16 7c bb 45 08 ad a0 42 97 1e 71 b1 37 +7e ea 42 69 + +# Signature: +33 34 1b a3 57 6a 13 0a 50 e2 a5 cf 86 79 22 43 +88 d5 69 3f 5a cc c2 35 ac 95 ad d6 8e 5e b1 ee +c3 16 66 d0 ca 7a 1c da 6f 70 a1 aa 76 2c 05 75 +2a 51 95 0c db 8a f3 c5 37 9f 18 cf e6 b5 bc 55 +a4 64 82 26 a1 5e 91 2e f1 9a d7 7a de ea 91 1d +67 cf ef d6 9b a4 3f a4 11 91 35 ff 64 21 17 ba +98 5a 7e 01 00 32 5e 95 19 f1 ca 6a 92 16 bd a0 +55 b5 78 50 15 29 11 25 e9 0d cd 07 a2 ca 96 73 +ee + +# -------------------------------- +# RSASSA-PSS Signature Example 8.6 +# -------------------------------- + +# Message to be signed: +0e a3 7d f9 a6 fe a4 a8 b6 10 37 3c 24 cf 39 0c +20 fa 6e 21 35 c4 00 c8 a3 4f 5c 18 3a 7e 8e a4 +c9 ae 09 0e d3 17 59 f4 2d c7 77 19 cc a4 00 ec +dc c5 17 ac fc 7a c6 90 26 75 b2 ef 30 c5 09 66 +5f 33 21 48 2f c6 9a 9f b5 70 d1 5e 01 c8 45 d0 +d8 e5 0d 2a 24 cb f1 cf 0e 71 49 75 a5 db 7b 18 +d9 e9 e9 cb 91 b5 cb 16 86 90 60 ed 18 b7 b5 62 +45 50 3f 0c af 90 35 2b 8d e8 1c b5 a1 d9 c6 33 +60 92 f0 cd + +# Salt: +76 fd 4e 64 fd c9 8e b9 27 a0 40 3e 35 a0 84 e7 +6b a9 f9 2a + +# Signature: +1e d1 d8 48 fb 1e db 44 12 9b d9 b3 54 79 5a f9 +7a 06 9a 7a 00 d0 15 10 48 59 3e 0c 72 c3 51 7f +f9 ff 2a 41 d0 cb 5a 0a c8 60 d7 36 a1 99 70 4f +7c b6 a5 39 86 a8 8b bd 8a bc c0 07 6a 2c e8 47 +88 00 31 52 5d 44 9d a2 ac 78 35 63 74 c5 36 e3 +43 fa a7 cb a4 2a 5a aa 65 06 08 77 91 c0 6a 8e +98 93 35 ae d1 9b fa b2 d5 e6 7e 27 fb 0c 28 75 +af 89 6c 21 b6 e8 e7 30 9d 04 e4 f6 72 7e 69 46 +3e + +# ============================================= + +# ================================== +# Example 9: A 1536-bit RSA Key Pair +# ================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +e6 bd 69 2a c9 66 45 79 04 03 fd d0 f5 be b8 b9 +bf 92 ed 10 00 7f c3 65 04 64 19 dd 06 c0 5c 5b +5b 2f 48 ec f9 89 e4 ce 26 91 09 97 9c bb 40 b4 +a0 ad 24 d2 24 83 d1 ee 31 5a d4 cc b1 53 42 68 +35 26 91 c5 24 f6 dd 8e 6c 29 d2 24 cf 24 69 73 +ae c8 6c 5b f6 b1 40 1a 85 0d 1b 9a d1 bb 8c bc +ec 47 b0 6f 0f 8c 7f 45 d3 fc 8f 31 92 99 c5 43 +3d db c2 b3 05 3b 47 de d2 ec d4 a4 ca ef d6 14 +83 3d c8 bb 62 2f 31 7e d0 76 b8 05 7f e8 de 3f +84 48 0a d5 e8 3e 4a 61 90 4a 4f 24 8f b3 97 02 +73 57 e1 d3 0e 46 31 39 81 5c 6f d4 fd 5a c5 b8 +17 2a 45 23 0e cb 63 18 a0 4f 14 55 d8 4e 5a 8b + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +6a 7f d8 4f b8 5f ad 07 3b 34 40 6d b7 4f 8d 61 +a6 ab c1 21 96 a9 61 dd 79 56 5e 9d a6 e5 18 7b +ce 2d 98 02 50 f7 35 95 75 35 92 70 d9 15 90 bb +0e 42 7c 71 46 0b 55 d5 14 10 b1 91 bc f3 09 fe +a1 31 a9 2c 8e 70 27 38 fa 71 9f 1e 00 41 f5 2e +40 e9 1f 22 9f 4d 96 a1 e6 f1 72 e1 55 96 b4 51 +0a 6d ae c2 61 05 f2 be bc 53 31 6b 87 bd f2 13 +11 66 60 70 e8 df ee 69 d5 2c 71 a9 76 ca ae 79 +c7 2b 68 d2 85 80 dc 68 6d 9f 51 29 d2 25 f8 2b +3d 61 55 13 a8 82 b3 db 91 41 6b 48 ce 08 88 82 +13 e3 7e eb 9a f8 00 d8 1c ab 32 8c e4 20 68 99 +03 c0 0c 7b 5f d3 1b 75 50 3a 6d 41 96 84 d6 29 + +# Prime p: +f8 eb 97 e9 8d f1 26 64 ee fd b7 61 59 6a 69 dd +cd 0e 76 da ec e6 ed 4b f5 a1 b5 0a c0 86 f7 92 +8a 4d 2f 87 26 a7 7e 51 5b 74 da 41 98 8f 22 0b +1c c8 7a a1 fc 81 0c e9 9a 82 f2 d1 ce 82 1e dc +ed 79 4c 69 41 f4 2c 7a 1a 0b 8c 4d 28 c7 5e c6 +0b 65 22 79 f6 15 4a 76 2a ed 16 5d 47 de e3 67 + +# Prime q: +ed 4d 71 d0 a6 e2 4b 93 c2 e5 f6 b4 bb e0 5f 5f +b0 af a0 42 d2 04 fe 33 78 d3 65 c2 f2 88 b6 a8 +da d7 ef e4 5d 15 3e ef 40 ca cc 7b 81 ff 93 40 +02 d1 08 99 4b 94 a5 e4 72 8c d9 c9 63 37 5a e4 +99 65 bd a5 5c bf 0e fe d8 d6 55 3b 40 27 f2 d8 +62 08 a6 e6 b4 89 c1 76 12 80 92 d6 29 e4 9d 3d + +# p's CRT exponent dP: +2b b6 8b dd fb 0c 4f 56 c8 55 8b ff af 89 2d 80 +43 03 78 41 e7 fa 81 cf a6 1a 38 c5 e3 9b 90 1c +8e e7 11 22 a5 da 22 27 bd 6c de eb 48 14 52 c1 +2a d3 d6 1d 5e 4f 77 6a 0a b5 56 59 1b ef e3 e5 +9e 5a 7f dd b8 34 5e 1f 2f 35 b9 f4 ce e5 7c 32 +41 4c 08 6a ec 99 3e 93 53 e4 80 d9 ee c6 28 9f + +# q's CRT exponent dQ: +4f f8 97 70 9f ad 07 97 46 49 45 78 e7 0f d8 54 +61 30 ee ab 56 27 c4 9b 08 0f 05 ee 4a d9 f3 e4 +b7 cb a9 d6 a5 df f1 13 a4 1c 34 09 33 68 33 f1 +90 81 6d 8a 6b c4 2e 9b ec 56 b7 56 7d 0f 3c 9c +69 6d b6 19 b2 45 d9 01 dd 85 6d b7 c8 09 2e 77 +e9 a1 cc cd 56 ee 4d ba 42 c5 fd b6 1a ec 26 69 + +# CRT coefficient qInv: +77 b9 d1 13 7b 50 40 4a 98 27 29 31 6e fa fc 7d +fe 66 d3 4e 5a 18 26 00 d5 f3 0a 0a 85 12 05 1c +56 0d 08 1d 4d 0a 18 35 ec 3d 25 a6 0f 4e 4d 6a +a9 48 b2 bf 3d bb 5b 12 4c bb c3 48 92 55 a3 a9 +48 37 2f 69 78 49 67 45 f9 43 e1 db 4f 18 38 2c +ea a5 05 df c6 57 57 bb 3f 85 7a 58 dc e5 21 56 + +# -------------------------------- +# RSASSA-PSS Signature Example 9.1 +# -------------------------------- + +# Message to be signed: +a8 8e 26 58 55 e9 d7 ca 36 c6 87 95 f0 b3 1b 59 +1c d6 58 7c 71 d0 60 a0 b3 f7 f3 ea ef 43 79 59 +22 02 8b c2 b6 ad 46 7c fc 2d 7f 65 9c 53 85 aa +70 ba 36 72 cd de 4c fe 49 70 cc 79 04 60 1b 27 +88 72 bf 51 32 1c 4a 97 2f 3c 95 57 0f 34 45 d4 +f5 79 80 e0 f2 0d f5 48 46 e6 a5 2c 66 8f 12 88 +c0 3f 95 00 6e a3 2f 56 2d 40 d5 2a f9 fe b3 2f +0f a0 6d b6 5b 58 8a 23 7b 34 e5 92 d5 5c f9 79 +f9 03 a6 42 ef 64 d2 ed 54 2a a8 c7 7d c1 dd 76 +2f 45 a5 93 03 ed 75 e5 41 ca 27 1e 2b 60 ca 70 +9e 44 fa 06 61 13 1e 8d 5d 41 63 fd 8d 39 85 66 +ce 26 de 87 30 e7 2f 9c ca 73 76 41 c2 44 15 94 +20 63 70 28 df 0a 18 07 9d 62 08 ea 8b 47 11 a2 +c7 50 f5 + +# Salt: +c0 a4 25 31 3d f8 d7 56 4b d2 43 4d 31 15 23 d5 +25 7e ed 80 + +# Signature: +58 61 07 22 6c 3c e0 13 a7 c8 f0 4d 1a 6a 29 59 +bb 4b 8e 20 5b a4 3a 27 b5 0f 12 41 11 bc 35 ef +58 9b 03 9f 59 32 18 7c b6 96 d7 d9 a3 2c 0c 38 +30 0a 5c dd a4 83 4b 62 d2 eb 24 0a f3 3f 79 d1 +3d fb f0 95 bf 59 9e 0d 96 86 94 8c 19 64 74 7b +67 e8 9c 9a ba 5c d8 50 16 23 6f 56 6c c5 80 2c +b1 3e ad 51 bc 7c a6 be f3 b9 4d cb db b1 d5 70 +46 97 71 df 0e 00 b1 a8 a0 67 77 47 2d 23 16 27 +9e da e8 64 74 66 8d 4e 1e ff f9 5f 1d e6 1c 60 +20 da 32 ae 92 bb f1 65 20 fe f3 cf 4d 88 f6 11 +21 f2 4b bd 9f e9 1b 59 ca f1 23 5b 2a 93 ff 81 +fc 40 3a dd f4 eb de a8 49 34 a9 cd af 8e 1a 9e + +# -------------------------------- +# RSASSA-PSS Signature Example 9.2 +# -------------------------------- + +# Message to be signed: +c8 c9 c6 af 04 ac da 41 4d 22 7e f2 3e 08 20 c3 +73 2c 50 0d c8 72 75 e9 5b 0d 09 54 13 99 3c 26 +58 bc 1d 98 85 81 ba 87 9c 2d 20 1f 14 cb 88 ce +d1 53 a0 19 69 a7 bf 0a 7b e7 9c 84 c1 48 6b c1 +2b 3f a6 c5 98 71 b6 82 7c 8c e2 53 ca 5f ef a8 +a8 c6 90 bf 32 6e 8e 37 cd b9 6d 90 a8 2e ba b6 +9f 86 35 0e 18 22 e8 bd 53 6a 2e + +# Salt: +b3 07 c4 3b 48 50 a8 da c2 f1 5f 32 e3 78 39 ef +8c 5c 0e 91 + +# Signature: +80 b6 d6 43 25 52 09 f0 a4 56 76 38 97 ac 9e d2 +59 d4 59 b4 9c 28 87 e5 88 2e cb 44 34 cf d6 6d +d7 e1 69 93 75 38 1e 51 cd 7f 55 4f 2c 27 17 04 +b3 99 d4 2b 4b e2 54 0a 0e ca 61 95 1f 55 26 7f +7c 28 78 c1 22 84 2d ad b2 8b 01 bd 5f 8c 02 5f +7e 22 84 18 a6 73 c0 3d 6b c0 c7 36 d0 a2 95 46 +bd 67 f7 86 d9 d6 92 cc ea 77 8d 71 d9 8c 20 63 +b7 a7 10 92 18 7a 4d 35 af 10 81 11 d8 3e 83 ea +e4 6c 46 aa 34 27 7e 06 04 45 89 90 37 88 f1 d5 +e7 ce e2 5f b4 85 e9 29 49 11 88 14 d6 f2 c3 ee +36 14 89 01 6f 32 7f b5 bc 51 7e b5 04 70 bf fa +1a fa 5f 4c e9 aa 0c e5 b8 ee 19 bf 55 01 b9 58 + +# -------------------------------- +# RSASSA-PSS Signature Example 9.3 +# -------------------------------- + +# Message to be signed: +0a fa d4 2c cd 4f c6 06 54 a5 50 02 d2 28 f5 2a +4a 5f e0 3b 8b bb 08 ca 82 da ca 55 8b 44 db e1 +26 6e 50 c0 e7 45 a3 6d 9d 29 04 e3 40 8a bc d1 +fd 56 99 94 06 3f 4a 75 cc 72 f2 fe e2 a0 cd 89 +3a 43 af 1c 5b 8b 48 7d f0 a7 16 10 02 4e 4f 6d +df 9f 28 ad 08 13 c1 aa b9 1b cb 3c 90 64 d5 ff +74 2d ef fe a6 57 09 41 39 36 9e 5e a6 f4 a9 63 +19 a5 cc 82 24 14 5b 54 50 62 75 8f ef d1 fe 34 +09 ae 16 92 59 c6 cd fd 6b 5f 29 58 e3 14 fa ec +be 69 d2 ca ce 58 ee 55 17 9a b9 b3 e6 d1 ec c1 +4a 55 7c 5f eb e9 88 59 52 64 fc 5d a1 c5 71 46 +2e ca 79 8a 18 a1 a4 94 0c da b4 a3 e9 20 09 cc +d4 2e 1e 94 7b 13 14 e3 22 38 a2 de ce 7d 23 a8 +9b 5b 30 c7 51 fd 0a 4a 43 0d 2c 54 85 94 + +# Salt: +9a 2b 00 7e 80 97 8b bb 19 2c 35 4e b7 da 9a ed +fc 74 db f5 + +# Signature: +48 44 08 f3 89 8c d5 f5 34 83 f8 08 19 ef bf 27 +08 c3 4d 27 a8 b2 a6 fa e8 b3 22 f9 24 02 37 f9 +81 81 7a ca 18 46 f1 08 4d aa 6d 7c 07 95 f6 e5 +bf 1a f5 9c 38 e1 85 84 37 ce 1f 7e c4 19 b9 8c +87 36 ad f6 dd 9a 00 b1 80 6d 2b d3 ad 0a 73 77 +5e 05 f5 2d fe f3 a5 9a b4 b0 81 43 f0 df 05 cd +1a d9 d0 4b ec ec a6 da a4 a2 12 98 03 e2 00 cb +c7 77 87 ca f4 c1 d0 66 3a 6c 59 87 b6 05 95 20 +19 78 2c af 2e c1 42 6d 68 fb 94 ed 1d 4b e8 16 +a7 ed 08 1b 77 e6 ab 33 0b 3f fc 07 38 20 fe cd +e3 72 7f cb e2 95 ee 61 a0 50 a3 43 65 86 37 c3 +fd 65 9c fb 63 73 6d e3 2d 9f 90 d3 c2 f6 3e ca + +# -------------------------------- +# RSASSA-PSS Signature Example 9.4 +# -------------------------------- + +# Message to be signed: +1d fd 43 b4 6c 93 db 82 62 9b da e2 bd 0a 12 b8 +82 ea 04 c3 b4 65 f5 cf 93 02 3f 01 05 96 26 db +be 99 f2 6b b1 be 94 9d dd d1 6d c7 f3 de bb 19 +a1 94 62 7f 0b 22 44 34 df 7d 87 00 e9 e9 8b 06 +e3 60 c1 2f db e3 d1 9f 51 c9 68 4e b9 08 9e cb +b0 a2 f0 45 03 99 d3 f5 9e ac 72 94 08 5d 04 4f +53 93 c6 ce 73 74 23 d8 b8 6c 41 53 70 d3 89 e3 +0b 9f 0a 3c 02 d2 5d 00 82 e8 ad 6f 3f 1e f2 4a +45 c3 cf 82 b3 83 36 70 63 a4 d4 61 3e 42 64 f0 +1b 2d ac 2e 5a a4 20 43 f8 fb 5f 69 fa 87 1d 14 +fb 27 3e 76 7a 53 1c 40 f0 2f 34 3b c2 fb 45 a0 +c7 e0 f6 be 25 61 92 3a 77 21 1d 66 a6 e2 db b4 +3c 36 63 50 be ae 22 da 3a c2 c1 f5 07 70 96 fc +b5 c4 bf 25 5f 75 74 35 1a e0 b1 e1 f0 36 32 81 +7c 08 56 d4 a8 ba 97 af bd c8 b8 58 55 40 2b c5 +69 26 fc ec 20 9f 9e a8 + +# Salt: +70 f3 82 bd df 4d 5d 2d d8 8b 3b c7 b7 30 8b e6 +32 b8 40 45 + +# Signature: +84 eb eb 48 1b e5 98 45 b4 64 68 ba fb 47 1c 01 +12 e0 2b 23 5d 84 b5 d9 11 cb d1 92 6e e5 07 4a +e0 42 44 95 cb 20 e8 23 08 b8 eb b6 5f 41 9a 03 +fb 40 e7 2b 78 98 1d 88 aa d1 43 05 36 85 17 2c +97 b2 9c 8b 7b f0 ae 73 b5 b2 26 3c 40 3d a0 ed +2f 80 ff 74 50 af 78 28 eb 8b 86 f0 02 8b d2 a8 +b1 76 a4 d2 28 cc ce a1 83 94 f2 38 b0 9f f7 58 +cc 00 bc 04 30 11 52 35 57 42 f2 82 b5 4e 66 3a +91 9e 70 9d 8d a2 4a de 55 00 a7 b9 aa 50 22 6e +0c a5 29 23 e6 c2 d8 60 ec 50 ff 48 0f a5 74 77 +e8 2b 05 65 f4 37 9f 79 c7 72 d5 c2 da 80 af 9f +bf 32 5e ce 6f c2 0b 00 96 16 14 be e8 9a 18 3e + +# -------------------------------- +# RSASSA-PSS Signature Example 9.5 +# -------------------------------- + +# Message to be signed: +1b dc 6e 7c 98 fb 8c f5 4e 9b 09 7b 66 a8 31 e9 +cf e5 2d 9d 48 88 44 8e e4 b0 97 80 93 ba 1d 7d +73 ae 78 b3 a6 2b a4 ad 95 cd 28 9c cb 9e 00 52 +26 bb 3d 17 8b cc aa 82 1f b0 44 a4 e2 1e e9 76 +96 c1 4d 06 78 c9 4c 2d ae 93 b0 ad 73 92 22 18 +55 3d aa 7e 44 eb e5 77 25 a7 a4 5c c7 2b 9b 21 +38 a6 b1 7c 8d b4 11 ce 82 79 ee 12 41 af f0 a8 +be c6 f7 7f 87 ed b0 c6 9c b2 72 36 e3 43 5a 80 +0b 19 2e 4f 11 e5 19 e3 fe 30 fc 30 ea cc ca 4f +bb 41 76 90 29 bf 70 8e 81 7a 9e 68 38 05 be 67 +fa 10 09 84 68 3b 74 83 8e 3b cf fa 79 36 6e ed +1d 48 1c 76 72 91 18 83 8f 31 ba 8a 04 8a 93 c1 +be 44 24 59 8e 8d f6 32 8b 7a 77 88 0a 3f 9c 7e +2e 8d fc a8 eb 5a 26 fb 86 bd c5 56 d4 2b be 01 +d9 fa 6e d8 06 46 49 1c 93 41 + +# Salt: +d6 89 25 7a 86 ef fa 68 21 2c 5e 0c 61 9e ca 29 +5f b9 1b 67 + +# Signature: +82 10 2d f8 cb 91 e7 17 99 19 a0 4d 26 d3 35 d6 +4f bc 2f 87 2c 44 83 39 43 24 1d e8 45 48 10 27 +4c df 3d b5 f4 2d 42 3d b1 52 af 71 35 f7 01 42 +0e 39 b4 94 a6 7c bf d1 9f 91 19 da 23 3a 23 da +5c 64 39 b5 ba 0d 2b c3 73 ee e3 50 70 01 37 8d +4a 40 73 85 6b 7f e2 ab a0 b5 ee 93 b2 7f 4a fe +c7 d4 d1 20 92 1c 83 f6 06 76 5b 02 c1 9e 4d 6a +1a 3b 95 fa 4c 42 29 51 be 4f 52 13 10 77 ef 17 +17 97 29 cd df bd b5 69 50 db ac ee fe 78 cb 16 +64 0a 09 9e a5 6d 24 38 9e ef 10 f8 fe cb 31 ba +3e a3 b2 27 c0 a8 66 98 bb 89 e3 e9 36 39 05 bf +22 77 7b 2a 3a a5 21 b6 5b 4c ef 76 d8 3b de 4c + + ------------------------------ +# RSASSA-PSS Signature Example 9.6 + ------------------------------ + +# Message to be signed: +88 c7 a9 f1 36 04 01 d9 0e 53 b1 01 b6 1c 53 25 +c3 c7 5d b1 b4 11 fb eb 8e 83 0b 75 e9 6b 56 67 +0a d2 45 40 4e 16 79 35 44 ee 35 4b c6 13 a9 0c +c9 84 87 15 a7 3d b5 89 3e 7f 6d 27 98 15 c0 c1 +de 83 ef 8e 29 56 e3 a5 6e d2 6a 88 8d 7a 9c dc +d0 42 f4 b1 6b 7f a5 1e f1 a0 57 36 62 d1 6a 30 +2d 0e c5 b2 85 d2 e0 3a d9 65 29 c8 7b 3d 37 4d +b3 72 d9 5b 24 43 d0 61 b6 b1 a3 50 ba 87 80 7e +d0 83 af d1 eb 05 c3 f5 2f 4e ba 5e d2 22 77 14 +fd b5 0b 9d 9d 9d d6 81 4f 62 f6 27 2f cd 5c db +ce 7a 9e f7 97 + +# Salt: +c2 5f 13 bf 67 d0 81 67 1a 04 81 a1 f1 82 0d 61 +3b ba 22 76 + +# Signature: +a7 fd b0 d2 59 16 5c a2 c8 8d 00 bb f1 02 8a 86 +7d 33 76 99 d0 61 19 3b 17 a9 64 8e 14 cc bb aa +de ac aa cd ec 81 5e 75 71 29 4e bb 8a 11 7a f2 +05 fa 07 8b 47 b0 71 2c 19 9e 3a d0 51 35 c5 04 +c2 4b 81 70 51 15 74 08 02 48 79 92 ff d5 11 d4 +af c6 b8 54 49 1e b3 f0 dd 52 31 39 54 2f f1 5c +31 01 ee 85 54 35 17 c6 a3 c7 94 17 c6 7e 2d d9 +aa 74 1e 9a 29 b0 6d cb 59 3c 23 36 b3 67 0a e3 +af ba c7 c3 e7 6e 21 54 73 e8 66 e3 38 ca 24 4d +e0 0b 62 62 4d 6b 94 26 82 2c ea e9 f8 cc 46 08 +95 f4 12 50 07 3f d4 5c 5a 1e 7b 42 5c 20 4a 42 +3a 69 91 59 f6 90 3e 71 0b 37 a7 bb 2b c8 04 9f + +# ============================================= + +# =================================== +# Example 10: A 2048-bit RSA Key Pair +# =================================== + +# ------------------------------ +# Components of the RSA Key Pair +# ------------------------------ + +# RSA modulus n: +a5 dd 86 7a c4 cb 02 f9 0b 94 57 d4 8c 14 a7 70 +ef 99 1c 56 c3 9c 0e c6 5f d1 1a fa 89 37 ce a5 +7b 9b e7 ac 73 b4 5c 00 17 61 5b 82 d6 22 e3 18 +75 3b 60 27 c0 fd 15 7b e1 2f 80 90 fe e2 a7 ad +cd 0e ef 75 9f 88 ba 49 97 c7 a4 2d 58 c9 aa 12 +cb 99 ae 00 1f e5 21 c1 3b b5 43 14 45 a8 d5 ae +4f 5e 4c 7e 94 8a c2 27 d3 60 40 71 f2 0e 57 7e +90 5f be b1 5d fa f0 6d 1d e5 ae 62 53 d6 3a 6a +21 20 b3 1a 5d a5 da bc 95 50 60 0e 20 f2 7d 37 +39 e2 62 79 25 fe a3 cc 50 9f 21 df f0 4e 6e ea +45 49 c5 40 d6 80 9f f9 30 7e ed e9 1f ff 58 73 +3d 83 85 a2 37 d6 d3 70 5a 33 e3 91 90 09 92 07 +0d f7 ad f1 35 7c f7 e3 70 0c e3 66 7d e8 3f 17 +b8 df 17 78 db 38 1d ce 09 cb 4a d0 58 a5 11 00 +1a 73 81 98 ee 27 cf 55 a1 3b 75 45 39 90 65 82 +ec 8b 17 4b d5 8d 5d 1f 3d 76 7c 61 37 21 ae 05 + +# RSA public exponent e: +01 00 01 + +# RSA private exponent d: +2d 2f f5 67 b3 fe 74 e0 61 91 b7 fd ed 6d e1 12 +29 0c 67 06 92 43 0d 59 69 18 40 47 da 23 4c 96 +93 de ed 16 73 ed 42 95 39 c9 69 d3 72 c0 4d 6b +47 e0 f5 b8 ce e0 84 3e 5c 22 83 5d bd 3b 05 a0 +99 79 84 ae 60 58 b1 1b c4 90 7c bf 67 ed 84 fa +9a e2 52 df b0 d0 cd 49 e6 18 e3 5d fd fe 59 bc +a3 dd d6 6c 33 ce bb c7 7a d4 41 aa 69 5e 13 e3 +24 b5 18 f0 1c 60 f5 a8 5c 99 4a d1 79 f2 a6 b5 +fb e9 34 02 b1 17 67 be 01 bf 07 34 44 d6 ba 1d +d2 bc a5 bd 07 4d 4a 5f ae 35 31 ad 13 03 d8 4b +30 d8 97 31 8c bb ba 04 e0 3c 2e 66 de 6d 91 f8 +2f 96 ea 1d 4b b5 4a 5a ae 10 2d 59 46 57 f5 c9 +78 95 53 51 2b 29 6d ea 29 d8 02 31 96 35 7e 3e +3a 6e 95 8f 39 e3 c2 34 40 38 ea 60 4b 31 ed c6 +f0 f7 ff 6e 71 81 a5 7c 92 82 6a 26 8f 86 76 8e +96 f8 78 56 2f c7 1d 85 d6 9e 44 86 12 f7 04 8f + +# Prime p: +cf d5 02 83 fe ee b9 7f 6f 08 d7 3c bc 7b 38 36 +f8 2b bc d4 99 47 9f 5e 6f 76 fd fc b8 b3 8c 4f +71 dc 9e 88 bd 6a 6f 76 37 1a fd 65 d2 af 18 62 +b3 2a fb 34 a9 5f 71 b8 b1 32 04 3f fe be 3a 95 +2b af 75 92 44 81 48 c0 3f 9c 69 b1 d6 8e 4c e5 +cf 32 c8 6b af 46 fe d3 01 ca 1a b4 03 06 9b 32 +f4 56 b9 1f 71 89 8a b0 81 cd 8c 42 52 ef 52 71 +91 5c 97 94 b8 f2 95 85 1d a7 51 0f 99 cb 73 eb + +# Prime q: +cc 4e 90 d2 a1 b3 a0 65 d3 b2 d1 f5 a8 fc e3 1b +54 44 75 66 4e ab 56 1d 29 71 b9 9f b7 be f8 44 +e8 ec 1f 36 0b 8c 2a c8 35 96 92 97 1e a6 a3 8f +72 3f cc 21 1f 5d bc b1 77 a0 fd ac 51 64 a1 d4 +ff 7f bb 4e 82 99 86 35 3c b9 83 65 9a 14 8c dd +42 0c 7d 31 ba 38 22 ea 90 a3 2b e4 6c 03 0e 8c +17 e1 fa 0a d3 78 59 e0 6b 0a a6 fa 3b 21 6d 9c +be 6c 0e 22 33 97 69 c0 a6 15 91 3e 5d a7 19 cf + +# p's CRT exponent dP: +1c 2d 1f c3 2f 6b c4 00 4f d8 5d fd e0 fb bf 9a +4c 38 f9 c7 c4 e4 1d ea 1a a8 82 34 a2 01 cd 92 +f3 b7 da 52 65 83 a9 8a d8 5b b3 60 fb 98 3b 71 +1e 23 44 9d 56 1d 17 78 d7 a5 15 48 6b cb f4 7b +46 c9 e9 e1 a3 a1 f7 70 00 ef be b0 9a 8a fe 47 +e5 b8 57 cd a9 9c b1 6d 7f ff 9b 71 2e 3b d6 0c +a9 6d 9c 79 73 d6 16 d4 69 34 a9 c0 50 28 1c 00 +43 99 ce ff 1d b7 dd a7 87 66 a8 a9 b9 cb 08 73 + +# q's CRT exponent dQ: +cb 3b 3c 04 ca a5 8c 60 be 7d 9b 2d eb b3 e3 96 +43 f4 f5 73 97 be 08 23 6a 1e 9e af aa 70 65 36 +e7 1c 3a cf e0 1c c6 51 f2 3c 9e 05 85 8f ee 13 +bb 6a 8a fc 47 df 4e dc 9a 4b a3 0b ce cb 73 d0 +15 78 52 32 7e e7 89 01 5c 2e 8d ee 7b 9f 05 a0 +f3 1a c9 4e b6 17 31 64 74 0c 5c 95 14 7c d5 f3 +b5 ae 2c b4 a8 37 87 f0 1d 8a b3 1f 27 c2 d0 ee +a2 dd 8a 11 ab 90 6a ba 20 7c 43 c6 ee 12 53 31 + +# CRT coefficient qInv: +12 f6 b2 cf 13 74 a7 36 fa d0 56 16 05 0f 96 ab +4b 61 d1 17 7c 7f 9d 52 5a 29 f3 d1 80 e7 76 67 +e9 9d 99 ab f0 52 5d 07 58 66 0f 37 52 65 5b 0f +25 b8 df 84 31 d9 a8 ff 77 c1 6c 12 a0 a5 12 2a +9f 0b f7 cf d5 a2 66 a3 5c 15 9f 99 12 08 b9 03 +16 ff 44 4f 3e 0b 6b d0 e9 3b 8a 7a 24 48 e9 57 +e3 dd a6 cf cf 22 66 b1 06 01 3a c4 68 08 d3 b3 +88 7b 3b 00 34 4b aa c9 53 0b 4c e7 08 fc 32 b6 + +# --------------------------------- +# RSASSA-PSS Signature Example 10.1 +# --------------------------------- + +# Message to be signed: +88 31 77 e5 12 6b 9b e2 d9 a9 68 03 27 d5 37 0c +6f 26 86 1f 58 20 c4 3d a6 7a 3a d6 09 + +# Salt: +04 e2 15 ee 6f f9 34 b9 da 70 d7 73 0c 87 34 ab +fc ec de 89 + +# Signature: +82 c2 b1 60 09 3b 8a a3 c0 f7 52 2b 19 f8 73 54 +06 6c 77 84 7a bf 2a 9f ce 54 2d 0e 84 e9 20 c5 +af b4 9f fd fd ac e1 65 60 ee 94 a1 36 96 01 14 +8e ba d7 a0 e1 51 cf 16 33 17 91 a5 72 7d 05 f2 +1e 74 e7 eb 81 14 40 20 69 35 d7 44 76 5a 15 e7 +9f 01 5c b6 6c 53 2c 87 a6 a0 59 61 c8 bf ad 74 +1a 9a 66 57 02 28 94 39 3e 72 23 73 97 96 c0 2a +77 45 5d 0f 55 5b 0e c0 1d df 25 9b 62 07 fd 0f +d5 76 14 ce f1 a5 57 3b aa ff 4e c0 00 69 95 16 +59 b8 5f 24 30 0a 25 16 0c a8 52 2d c6 e6 72 7e +57 d0 19 d7 e6 36 29 b8 fe 5e 89 e2 5c c1 5b eb +3a 64 75 77 55 92 99 28 0b 9b 28 f7 9b 04 09 00 +0b e2 5b bd 96 40 8b a3 b4 3c c4 86 18 4d d1 c8 +e6 25 53 fa 1a f4 04 0f 60 66 3d e7 f5 e4 9c 04 +38 8e 25 7f 1c e8 9c 95 da b4 8a 31 5d 9b 66 b1 +b7 62 82 33 87 6f f2 38 52 30 d0 70 d0 7e 16 66 + +# --------------------------------- +# RSASSA-PSS Signature Example 10.2 +# --------------------------------- + +# Message to be signed: +dd 67 0a 01 46 58 68 ad c9 3f 26 13 19 57 a5 0c +52 fb 77 7c db aa 30 89 2c 9e 12 36 11 64 ec 13 +97 9d 43 04 81 18 e4 44 5d b8 7b ee 58 dd 98 7b +34 25 d0 20 71 d8 db ae 80 70 8b 03 9d bb 64 db +d1 de 56 57 d9 fe d0 c1 18 a5 41 43 74 2e 0f f3 +c8 7f 74 e4 58 57 64 7a f3 f7 9e b0 a1 4c 9d 75 +ea 9a 1a 04 b7 cf 47 8a 89 7a 70 8f d9 88 f4 8e +80 1e db 0b 70 39 df 8c 23 bb 3c 56 f4 e8 21 ac + +# Salt: +8b 2b dd 4b 40 fa f5 45 c7 78 dd f9 bc 1a 49 cb +57 f9 b7 1b + +# Signature: +14 ae 35 d9 dd 06 ba 92 f7 f3 b8 97 97 8a ed 7c +d4 bf 5f f0 b5 85 a4 0b d4 6c e1 b4 2c d2 70 30 +53 bb 90 44 d6 4e 81 3d 8f 96 db 2d d7 00 7d 10 +11 8f 6f 8f 84 96 09 7a d7 5e 1f f6 92 34 1b 28 +92 ad 55 a6 33 a1 c5 5e 7f 0a 0a d5 9a 0e 20 3a +5b 82 78 ae c5 4d d8 62 2e 28 31 d8 71 74 f8 ca +ff 43 ee 6c 46 44 53 45 d8 4a 59 65 9b fb 92 ec +d4 c8 18 66 86 95 f3 47 06 f6 68 28 a8 99 59 63 +7f 2b f3 e3 25 1c 24 bd ba 4d 4b 76 49 da 00 22 +21 8b 11 9c 84 e7 9a 65 27 ec 5b 8a 5f 86 1c 15 +99 52 e2 3e c0 5e 1e 71 73 46 fa ef e8 b1 68 68 +25 bd 2b 26 2f b2 53 10 66 c0 de 09 ac de 2e 42 +31 69 07 28 b5 d8 5e 11 5a 2f 6b 92 b7 9c 25 ab +c9 bd 93 99 ff 8b cf 82 5a 52 ea 1f 56 ea 76 dd +26 f4 3b aa fa 18 bf a9 2a 50 4c bd 35 69 9e 26 +d1 dc c5 a2 88 73 85 f3 c6 32 32 f0 6f 32 44 c3 + +# --------------------------------- +# RSASSA-PSS Signature Example 10.3 +# --------------------------------- + +# Message to be signed: +48 b2 b6 a5 7a 63 c8 4c ea 85 9d 65 c6 68 28 4b +08 d9 6b dc aa be 25 2d b0 e4 a9 6c b1 ba c6 01 +93 41 db 6f be fb 8d 10 6b 0e 90 ed a6 bc c6 c6 +26 2f 37 e7 ea 9c 7e 5d 22 6b d7 df 85 ec 5e 71 +ef ff 2f 54 c5 db 57 7f f7 29 ff 91 b8 42 49 1d +e2 74 1d 0c 63 16 07 df 58 6b 90 5b 23 b9 1a f1 +3d a1 23 04 bf 83 ec a8 a7 3e 87 1f f9 db + +# Salt: +4e 96 fc 1b 39 8f 92 b4 46 71 01 0c 0d c3 ef d6 +e2 0c 2d 73 + +# Signature: +6e 3e 4d 7b 6b 15 d2 fb 46 01 3b 89 00 aa 5b bb +39 39 cf 2c 09 57 17 98 70 42 02 6e e6 2c 74 c5 +4c ff d5 d7 d5 7e fb bf 95 0a 0f 5c 57 4f a0 9d +3f c1 c9 f5 13 b0 5b 4f f5 0d d8 df 7e df a2 01 +02 85 4c 35 e5 92 18 01 19 a7 0c e5 b0 85 18 2a +a0 2d 9e a2 aa 90 d1 df 03 f2 da ae 88 5b a2 f5 +d0 5a fd ac 97 47 6f 06 b9 3b 5b c9 4a 1a 80 aa +91 16 c4 d6 15 f3 33 b0 98 89 2b 25 ff ac e2 66 +f5 db 5a 5a 3b cc 10 a8 24 ed 55 aa d3 5b 72 78 +34 fb 8c 07 da 28 fc f4 16 a5 d9 b2 22 4f 1f 8b +44 2b 36 f9 1e 45 6f de a2 d7 cf e3 36 72 68 de +03 07 a4 c7 4e 92 41 59 ed 33 39 3d 5e 06 55 53 +1c 77 32 7b 89 82 1b de df 88 01 61 c7 8c d4 19 +6b 54 19 f7 ac c3 f1 3e 5e bf 16 1b 6e 7c 67 24 +71 6c a3 3b 85 c2 e2 56 40 19 2a c2 85 96 51 d5 +0b de 7e b9 76 e5 1c ec 82 8b 98 b6 56 3b 86 bb + +# --------------------------------- +# RSASSA-PSS Signature Example 10.4 +# --------------------------------- + +# Message to be signed: +0b 87 77 c7 f8 39 ba f0 a6 4b bb db c5 ce 79 75 +5c 57 a2 05 b8 45 c1 74 e2 d2 e9 05 46 a0 89 c4 +e6 ec 8a df fa 23 a7 ea 97 ba e6 b6 5d 78 2b 82 +db 5d 2b 5a 56 d2 2a 29 a0 5e 7c 44 33 e2 b8 2a +62 1a bb a9 0a dd 05 ce 39 3f c4 8a 84 05 42 45 +1a + +# Salt: +c7 cd 69 8d 84 b6 51 28 d8 83 5e 3a 8b 1e b0 e0 +1c b5 41 ec + +# Signature: +34 04 7f f9 6c 4d c0 dc 90 b2 d4 ff 59 a1 a3 61 +a4 75 4b 25 5d 2e e0 af 7d 8b f8 7c 9b c9 e7 dd +ee de 33 93 4c 63 ca 1c 0e 3d 26 2c b1 45 ef 93 +2a 1f 2c 0a 99 7a a6 a3 4f 8e ae e7 47 7d 82 cc +f0 90 95 a6 b8 ac ad 38 d4 ee c9 fb 7e ab 7a d0 +2d a1 d1 1d 8e 54 c1 82 5e 55 bf 58 c2 a2 32 34 +b9 02 be 12 4f 9e 90 38 a8 f6 8f a4 5d ab 72 f6 +6e 09 45 bf 1d 8b ac c9 04 4c 6f 07 09 8c 9f ce +c5 8a 3a ab 10 0c 80 51 78 15 5f 03 0a 12 4c 45 +0e 5a cb da 47 d0 e4 f1 0b 80 a2 3f 80 3e 77 4d +02 3b 00 15 c2 0b 9f 9b be 7c 91 29 63 38 d5 ec +b4 71 ca fb 03 20 07 b6 7a 60 be 5f 69 50 4a 9f +01 ab b3 cb 46 7b 26 0e 2b ce 86 0b e8 d9 5b f9 +2c 0c 8e 14 96 ed 1e 52 85 93 a4 ab b6 df 46 2d +de 8a 09 68 df fe 46 83 11 68 57 a2 32 f5 eb f6 +c8 5b e2 38 74 5a d0 f3 8f 76 7a 5f db f4 86 fb + +# --------------------------------- +# RSASSA-PSS Signature Example 10.5 +# --------------------------------- + +# Message to be signed: +f1 03 6e 00 8e 71 e9 64 da dc 92 19 ed 30 e1 7f +06 b4 b6 8a 95 5c 16 b3 12 b1 ed df 02 8b 74 97 +6b ed 6b 3f 6a 63 d4 e7 78 59 24 3c 9c cc dc 98 +01 65 23 ab b0 24 83 b3 55 91 c3 3a ad 81 21 3b +b7 c7 bb 1a 47 0a ab c1 0d 44 25 6c 4d 45 59 d9 +16 + +# Salt: +ef a8 bf f9 62 12 b2 f4 a3 f3 71 a1 0d 57 41 52 +65 5f 5d fb + +# Signature: +7e 09 35 ea 18 f4 d6 c1 d1 7c e8 2e b2 b3 83 6c +55 b3 84 58 9c e1 9d fe 74 33 63 ac 99 48 d1 f3 +46 b7 bf dd fe 92 ef d7 8a db 21 fa ef c8 9a de +42 b1 0f 37 40 03 fe 12 2e 67 42 9a 1c b8 cb d1 +f8 d9 01 45 64 c4 4d 12 01 16 f4 99 0f 1a 6e 38 +77 4c 19 4b d1 b8 21 32 86 b0 77 b0 49 9d 2e 7b +3f 43 4a b1 22 89 c5 56 68 4d ee d7 81 31 93 4b +b3 dd 65 37 23 6f 7c 6f 3d cb 09 d4 76 be 07 72 +1e 37 e1 ce ed 9b 2f 7b 40 68 87 bd 53 15 73 05 +e1 c8 b4 f8 4d 73 3b c1 e1 86 fe 06 cc 59 b6 ed +b8 f4 bd 7f fe fd f4 f7 ba 9c fb 9d 57 06 89 b5 +a1 a4 10 9a 74 6a 69 08 93 db 37 99 25 5a 0c b9 +21 5d 2d 1c d4 90 59 0e 95 2e 8c 87 86 aa 00 11 +26 52 52 47 0c 04 1d fb c3 ee c7 c3 cb f7 1c 24 +86 9d 11 5c 0c b4 a9 56 f5 6d 53 0b 80 ab 58 9a +cf ef c6 90 75 1d df 36 e8 d3 83 f8 3c ed d2 cc + +# --------------------------------- +# RSASSA-PSS Signature Example 10.6 +# --------------------------------- + +# Message to be signed: +25 f1 08 95 a8 77 16 c1 37 45 0b b9 51 9d fa a1 +f2 07 fa a9 42 ea 88 ab f7 1e 9c 17 98 00 85 b5 +55 ae ba b7 62 64 ae 2a 3a b9 3c 2d 12 98 11 91 +dd ac 6f b5 94 9e b3 6a ee 3c 5d a9 40 f0 07 52 +c9 16 d9 46 08 fa 7d 97 ba 6a 29 15 b6 88 f2 03 +23 d4 e9 d9 68 01 d8 9a 72 ab 58 92 dc 21 17 c0 +74 34 fc f9 72 e0 58 cf 8c 41 ca 4b 4f f5 54 f7 +d5 06 8a d3 15 5f ce d0 f3 12 5b c0 4f 91 93 37 +8a 8f 5c 4c 3b 8c b4 dd 6d 1c c6 9d 30 ec ca 6e +aa 51 e3 6a 05 73 0e 9e 34 2e 85 5b af 09 9d ef +b8 af d7 + +# Salt: +ad 8b 15 23 70 36 46 22 4b 66 0b 55 08 85 91 7c +a2 d1 df 28 + +# Signature: +6d 3b 5b 87 f6 7e a6 57 af 21 f7 54 41 97 7d 21 +80 f9 1b 2c 5f 69 2d e8 29 55 69 6a 68 67 30 d9 +b9 77 8d 97 07 58 cc b2 60 71 c2 20 9f fb d6 12 +5b e2 e9 6e a8 1b 67 cb 9b 93 08 23 9f da 17 f7 +b2 b6 4e cd a0 96 b6 b9 35 64 0a 5a 1c b4 2a 91 +55 b1 c9 ef 7a 63 3a 02 c5 9f 0d 6e e5 9b 85 2c +43 b3 50 29 e7 3c 94 0f f0 41 0e 8f 11 4e ed 46 +bb d0 fa e1 65 e4 2b e2 52 8a 40 1c 3b 28 fd 81 +8e f3 23 2d ca 9f 4d 2a 0f 51 66 ec 59 c4 23 96 +d6 c1 1d bc 12 15 a5 6f a1 71 69 db 95 75 34 3e +f3 4f 9d e3 2a 49 cd c3 17 49 22 f2 29 c2 3e 18 +e4 5d f9 35 31 19 ec 43 19 ce dc e7 a1 7c 64 08 +8c 1f 6f 52 be 29 63 41 00 b3 91 9d 38 f3 d1 ed +94 e6 89 1e 66 a7 3b 8f b8 49 f5 87 4d f5 94 59 +e2 98 c7 bb ce 2e ee 78 2a 19 5a a6 6f e2 d0 73 +2b 25 e5 95 f5 7d 3e 06 1b 1f c3 e4 06 3b f9 8f + +# ============================================= diff --git a/notes/rsa-testvectors/readme.txt b/notes/rsa-testvectors/readme.txt new file mode 100755 index 000000000..788c0ba87 --- /dev/null +++ b/notes/rsa-testvectors/readme.txt @@ -0,0 +1,22 @@ +==================== +pkcs-1v2-1-vec.zip +==================== + +This directory contains test vectors for RSAES-OAEP and +RSASSA-PSS as defined in PKCS #1 v2.1. + +The files: + +readme.txt This file. + +oaep-vect.txt Test vectors for RSAES-OAEP encryption. + +oaep-int.txt Intermediate values for RSAES-OAEP + encryption and RSA decryption with CRT. + Also, DER-encoded RSAPrivateKey and + RSAPublicKey types. + +pss-vect.txt Test vectors for RSASSA-PSS signing. + +pss-int.txt Intermediate values for RSASSA-PSS + signing. From 6dfe0013e1652c3945541705d29410f2a9af6d9e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 4 Aug 2014 23:57:27 +0200 Subject: [PATCH 0253/1192] rt.py: initial version --- notes/rsa-testvectors/rt.py | 179 ++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100755 notes/rsa-testvectors/rt.py diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py new file mode 100755 index 000000000..26178378e --- /dev/null +++ b/notes/rsa-testvectors/rt.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python + +import sys +import os +import hashlib + +def md5_for_file(path, block_size=256*128): + ''' + Block size directly depends on the block size of your filesystem + to avoid performances issues + Here I have blocks of 4096 octets (Default NTFS) + ''' + md5 = hashlib.md5() + with open(path,'rb') as f: + for chunk in iter(lambda: f.read(block_size), b''): + md5.update(chunk) + f.close() + return md5.hexdigest() + +def read_until_eq(f, s): + while True: + l = f.readline() + if l.strip() == s: + break + return l + +def read_until_start(f, s): + while True: + l = f.readline() + if l.startswith(s): + break + return l + +def read_hex(f): + t = [] + while True: + l = f.readline() + if l.strip() == '': + break + t.extend(l.strip().split(' ')) + return t + +class NamedData(object): + def __init__(self, name, data): + self.name = name + self.data = data + + def __str__(self): + return " /* {0} */\n {1},\n {{ {2} }}\n".format(self.name, len(self.data), ', '.join('0x' + x for x in self.data)) + +def read_part(f, s): + name = read_until_start(f, s).strip().lstrip('# ').rstrip(':') + data = read_hex(f) + e = NamedData(name, data) + return e + +class RsaKey(object): + def __init__(self, n, e, d, q, p, dP, dQ, qInv): + self.n = n + self.e = e + self.d = d + self.q = q + self.p = p + self.dP = dP + self.dQ = dQ + self.qInv = qInv + + def __str__(self): + return "{{\n{0},\n{1},\n{2},\n{3},\n{4},\n{5},\n{6},\n{7}\n}}\n".format(self.n, self.e, self.d, self.q, self.p, self.dP, self.dQ, self.qInv) + +def read_key(f): + n = read_part(f, '# RSA modulus n') + e = read_part(f, '# RSA public exponent e') + d = read_part(f, '# RSA private exponent d') + q = read_part(f, '# Prime p') + p = read_part(f, '# Prime q') + dP = read_part(f, '# p\'s CRT exponent dP') + dQ = read_part(f, '# q\'s CRT exponent dQ') + qInv = read_part(f, '# CRT coefficient qInv') + k = RsaKey(n, e, d, q, p, dP, dQ, qInv) + return k + +class Signature(object): + def __init__(self, name, msg, salt, sig): + self.name = name + self.msg = msg + self.salt = salt + self.sig = sig + + def __str__(self): + return "{{\n \"{0}\",\n{1},\n{2},\n{3}\n}}\n,".format(self.name, self.msg, self.salt, self.sig) + +def read_sig(f): + name = read_until_start(f, '# RSASSA-PSS Signature Example').strip().lstrip('# ') + msg = read_part(f, '# Message to be signed') + salt = read_part(f, '# Salt') + sig = read_part(f, '# Signature') + s = Signature(name, msg, salt, sig) + return s + +class Example(object): + def __init__(self, name, key, s): + self.name = name + self.key = key + self.s = s + + def __str__(self): + res = "{{/* {0} */\n{1},\n{{".format(self.name, str(self.key)) + for i in self.s: + res += str(i) + '\n' + res += '}\n},' + return res + +def read_example(f): + name = read_until_start(f, '# Example').strip().lstrip('# ') + key = read_key(f) + l = read_until_start(f, '#') + s = [] + while l.strip().startswith('# --------------------------------'): + sig = read_sig(f) + s.append(sig) + l = read_until_start(f, '#') + + e = Example(name, key, s) + f.seek(-len(l), os.SEEK_CUR) + return e + +print('/* Generated from file: %s\n * with md5 hash: %s\n */\n' % (sys.argv[1], md5_for_file(sys.argv[1]))) +print(''' +typedef struct rsaKey { + int n_l; + unsigned char n[256]; + int e_l; + unsigned char e[256]; + int d_l; + unsigned char d[256]; + int p_l; + unsigned char p[256]; + int q_l; + unsigned char q[256]; + int dP_l; + unsigned char dP[256]; + int dQ_l; + unsigned char dQ[256]; + int qInv_l; + unsigned char qInv[256]; +} rsaKey_t; + +typedef struct rsaSig { + const char* name; + int msg_l; + unsigned char msg[256]; + int salt_l; + unsigned char salt[256]; + int sig_l; + unsigned char sig[256]; +} rsaSig_t; + +typedef struct testcase { + rsaKey_t rsa; + rsaSig_t sig[6]; +} testcase_t; + +testcase_t testcases[] = + {''') + +with open(sys.argv[1], 'rb') as f: + ex = [] + while read_until_eq(f, '# ============================================='): + if f.tell() == os.path.getsize(sys.argv[1]): + break + e = read_example(f) +# print e + ex.append(e) + + for i in ex: + print(i) +f.close() +print('};\n') From 055c515161b709825cdbff8e7f0ed8d0db47ae6e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 17:11:35 +0200 Subject: [PATCH 0254/1192] fix pss-vect.txt --- notes/rsa-testvectors/pss-vect.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notes/rsa-testvectors/pss-vect.txt b/notes/rsa-testvectors/pss-vect.txt index 001e3c4dc..f0392e017 100755 --- a/notes/rsa-testvectors/pss-vect.txt +++ b/notes/rsa-testvectors/pss-vect.txt @@ -2236,9 +2236,9 @@ c7 d4 d1 20 92 1c 83 f6 06 76 5b 02 c1 9e 4d 6a 3e a3 b2 27 c0 a8 66 98 bb 89 e3 e9 36 39 05 bf 22 77 7b 2a 3a a5 21 b6 5b 4c ef 76 d8 3b de 4c - ------------------------------ +# -------------------------------- # RSASSA-PSS Signature Example 9.6 - ------------------------------ +# -------------------------------- # Message to be signed: 88 c7 a9 f1 36 04 01 d9 0e 53 b1 01 b6 1c 53 25 From 269516533c4c8a303fc5dab2f387746deb11de7a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 17:15:47 +0200 Subject: [PATCH 0255/1192] rt.py: add name of testcase in struct --- notes/rsa-testvectors/rt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py index 26178378e..b308aa497 100755 --- a/notes/rsa-testvectors/rt.py +++ b/notes/rsa-testvectors/rt.py @@ -105,7 +105,7 @@ def __init__(self, name, key, s): self.s = s def __str__(self): - res = "{{/* {0} */\n{1},\n{{".format(self.name, str(self.key)) + res = "{{\n \"{0}\",\n{1},\n{{".format(self.name, str(self.key)) for i in self.s: res += str(i) + '\n' res += '}\n},' @@ -157,6 +157,7 @@ def read_example(f): } rsaSig_t; typedef struct testcase { + const char* name; rsaKey_t rsa; rsaSig_t sig[6]; } testcase_t; From 4a819b2f1be5d52cc0e952db83a046d583596109 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 17:16:03 +0200 Subject: [PATCH 0256/1192] add generated file pss-vect.c --- notes/rsa-testvectors/pss-vect.c | 1394 ++++++++++++++++++++++++++++++ 1 file changed, 1394 insertions(+) create mode 100644 notes/rsa-testvectors/pss-vect.c diff --git a/notes/rsa-testvectors/pss-vect.c b/notes/rsa-testvectors/pss-vect.c new file mode 100644 index 000000000..0aab4c4f8 --- /dev/null +++ b/notes/rsa-testvectors/pss-vect.c @@ -0,0 +1,1394 @@ +/* Generated from file: pss-vect.txt + * with md5 hash: af66c6ca63a09d0443d5f78ff0e59c29 + */ + + +typedef struct rsaKey { + int n_l; + unsigned char n[256]; + int e_l; + unsigned char e[256]; + int d_l; + unsigned char d[256]; + int p_l; + unsigned char p[256]; + int q_l; + unsigned char q[256]; + int dP_l; + unsigned char dP[256]; + int dQ_l; + unsigned char dQ[256]; + int qInv_l; + unsigned char qInv[256]; +} rsaKey_t; + +typedef struct rsaSig { + const char* name; + int msg_l; + unsigned char msg[256]; + int salt_l; + unsigned char salt[256]; + int sig_l; + unsigned char sig[256]; +} rsaSig_t; + +typedef struct testcase { + const char* name; + rsaKey_t rsa; + rsaSig_t sig[6]; +} testcase_t; + +testcase_t testcases[] = + { +{ + "Example 1: A 1024-bit RSA Key Pair", +{ + /* RSA modulus n */ + 128, + { 0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51, 0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e, 0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a, 0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62, 0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf, 0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab, 0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d, 0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77, 0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59, 0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3, 0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f, 0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8, 0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51, 0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf, 0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe, 0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f, 0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3, 0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44, 0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10, 0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27, 0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c, 0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f, 0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e, 0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc, 0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 } +, + /* Prime p */ + 64, + { 0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73, 0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa, 0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96, 0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb, 0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b, 0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e, 0xda, 0x8e, 0x64, 0x43 } +, + /* Prime q */ + 64, + { 0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7, 0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f, 0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48, 0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba, 0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e, 0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26, 0x9a, 0x67, 0x99, 0xfd } +, + /* p's CRT exponent dP */ + 64, + { 0x28, 0xfa, 0x13, 0x93, 0x86, 0x55, 0xbe, 0x1f, 0x8a, 0x15, 0x9c, 0xba, 0xca, 0x5a, 0x72, 0xea, 0x19, 0x0c, 0x30, 0x08, 0x9e, 0x19, 0xcd, 0x27, 0x4a, 0x55, 0x6f, 0x36, 0xc4, 0xf6, 0xe1, 0x9f, 0x55, 0x4b, 0x34, 0xc0, 0x77, 0x79, 0x04, 0x27, 0xbb, 0xdd, 0x8d, 0xd3, 0xed, 0xe2, 0x44, 0x83, 0x28, 0xf3, 0x85, 0xd8, 0x1b, 0x30, 0xe8, 0xe4, 0x3b, 0x2f, 0xff, 0xa0, 0x27, 0x86, 0x19, 0x79 } +, + /* q's CRT exponent dQ */ + 64, + { 0x1a, 0x8b, 0x38, 0xf3, 0x98, 0xfa, 0x71, 0x20, 0x49, 0x89, 0x8d, 0x7f, 0xb7, 0x9e, 0xe0, 0xa7, 0x76, 0x68, 0x79, 0x12, 0x99, 0xcd, 0xfa, 0x09, 0xef, 0xc0, 0xe5, 0x07, 0xac, 0xb2, 0x1e, 0xd7, 0x43, 0x01, 0xef, 0x5b, 0xfd, 0x48, 0xbe, 0x45, 0x5e, 0xae, 0xb6, 0xe1, 0x67, 0x82, 0x55, 0x82, 0x75, 0x80, 0xa8, 0xe4, 0xe8, 0xe1, 0x41, 0x51, 0xd1, 0x51, 0x0a, 0x82, 0xa3, 0xf2, 0xe7, 0x29 } +, + /* CRT coefficient qInv */ + 64, + { 0x27, 0x15, 0x6a, 0xba, 0x41, 0x26, 0xd2, 0x4a, 0x81, 0xf3, 0xa5, 0x28, 0xcb, 0xfb, 0x27, 0xf5, 0x68, 0x86, 0xf8, 0x40, 0xa9, 0xf6, 0xe8, 0x6e, 0x17, 0xa4, 0x4b, 0x94, 0xfe, 0x93, 0x19, 0x58, 0x4b, 0x8e, 0x22, 0xfd, 0xde, 0x1e, 0x5a, 0x2e, 0x3b, 0xd8, 0xaa, 0x5b, 0xa8, 0xd8, 0x58, 0x41, 0x94, 0xeb, 0x21, 0x90, 0xac, 0xf8, 0x32, 0xb8, 0x47, 0xf1, 0x3a, 0x3d, 0x24, 0xa7, 0x9f, 0x4d } + +} +, +{{ + "RSASSA-PSS Signature Example 1.1", + /* Message to be signed */ + 217, + { 0xcd, 0xc8, 0x7d, 0xa2, 0x23, 0xd7, 0x86, 0xdf, 0x3b, 0x45, 0xe0, 0xbb, 0xbc, 0x72, 0x13, 0x26, 0xd1, 0xee, 0x2a, 0xf8, 0x06, 0xcc, 0x31, 0x54, 0x75, 0xcc, 0x6f, 0x0d, 0x9c, 0x66, 0xe1, 0xb6, 0x23, 0x71, 0xd4, 0x5c, 0xe2, 0x39, 0x2e, 0x1a, 0xc9, 0x28, 0x44, 0xc3, 0x10, 0x10, 0x2f, 0x15, 0x6a, 0x0d, 0x8d, 0x52, 0xc1, 0xf4, 0xc4, 0x0b, 0xa3, 0xaa, 0x65, 0x09, 0x57, 0x86, 0xcb, 0x76, 0x97, 0x57, 0xa6, 0x56, 0x3b, 0xa9, 0x58, 0xfe, 0xd0, 0xbc, 0xc9, 0x84, 0xe8, 0xb5, 0x17, 0xa3, 0xd5, 0xf5, 0x15, 0xb2, 0x3b, 0x8a, 0x41, 0xe7, 0x4a, 0xa8, 0x67, 0x69, 0x3f, 0x90, 0xdf, 0xb0, 0x61, 0xa6, 0xe8, 0x6d, 0xfa, 0xae, 0xe6, 0x44, 0x72, 0xc0, 0x0e, 0x5f, 0x20, 0x94, 0x57, 0x29, 0xcb, 0xeb, 0xe7, 0x7f, 0x06, 0xce, 0x78, 0xe0, 0x8f, 0x40, 0x98, 0xfb, 0xa4, 0x1f, 0x9d, 0x61, 0x93, 0xc0, 0x31, 0x7e, 0x8b, 0x60, 0xd4, 0xb6, 0x08, 0x4a, 0xcb, 0x42, 0xd2, 0x9e, 0x38, 0x08, 0xa3, 0xbc, 0x37, 0x2d, 0x85, 0xe3, 0x31, 0x17, 0x0f, 0xcb, 0xf7, 0xcc, 0x72, 0xd0, 0xb7, 0x1c, 0x29, 0x66, 0x48, 0xb3, 0xa4, 0xd1, 0x0f, 0x41, 0x62, 0x95, 0xd0, 0x80, 0x7a, 0xa6, 0x25, 0xca, 0xb2, 0x74, 0x4f, 0xd9, 0xea, 0x8f, 0xd2, 0x23, 0xc4, 0x25, 0x37, 0x02, 0x98, 0x28, 0xbd, 0x16, 0xbe, 0x02, 0x54, 0x6f, 0x13, 0x0f, 0xd2, 0xe3, 0x3b, 0x93, 0x6d, 0x26, 0x76, 0xe0, 0x8a, 0xed, 0x1b, 0x73, 0x31, 0x8b, 0x75, 0x0a, 0x01, 0x67, 0xd0 } +, + /* Salt */ + 20, + { 0xde, 0xe9, 0x59, 0xc7, 0xe0, 0x64, 0x11, 0x36, 0x14, 0x20, 0xff, 0x80, 0x18, 0x5e, 0xd5, 0x7f, 0x3e, 0x67, 0x76, 0xaf } +, + /* Signature */ + 128, + { 0x90, 0x74, 0x30, 0x8f, 0xb5, 0x98, 0xe9, 0x70, 0x1b, 0x22, 0x94, 0x38, 0x8e, 0x52, 0xf9, 0x71, 0xfa, 0xac, 0x2b, 0x60, 0xa5, 0x14, 0x5a, 0xf1, 0x85, 0xdf, 0x52, 0x87, 0xb5, 0xed, 0x28, 0x87, 0xe5, 0x7c, 0xe7, 0xfd, 0x44, 0xdc, 0x86, 0x34, 0xe4, 0x07, 0xc8, 0xe0, 0xe4, 0x36, 0x0b, 0xc2, 0x26, 0xf3, 0xec, 0x22, 0x7f, 0x9d, 0x9e, 0x54, 0x63, 0x8e, 0x8d, 0x31, 0xf5, 0x05, 0x12, 0x15, 0xdf, 0x6e, 0xbb, 0x9c, 0x2f, 0x95, 0x79, 0xaa, 0x77, 0x59, 0x8a, 0x38, 0xf9, 0x14, 0xb5, 0xb9, 0xc1, 0xbd, 0x83, 0xc4, 0xe2, 0xf9, 0xf3, 0x82, 0xa0, 0xd0, 0xaa, 0x35, 0x42, 0xff, 0xee, 0x65, 0x98, 0x4a, 0x60, 0x1b, 0xc6, 0x9e, 0xb2, 0x8d, 0xeb, 0x27, 0xdc, 0xa1, 0x2c, 0x82, 0xc2, 0xd4, 0xc3, 0xf6, 0x6c, 0xd5, 0x00, 0xf1, 0xff, 0x2b, 0x99, 0x4d, 0x8a, 0x4e, 0x30, 0xcb, 0xb3, 0x3c } + +} +, +{ + "RSASSA-PSS Signature Example 1.2", + /* Message to be signed */ + 51, + { 0x85, 0x13, 0x84, 0xcd, 0xfe, 0x81, 0x9c, 0x22, 0xed, 0x6c, 0x4c, 0xcb, 0x30, 0xda, 0xeb, 0x5c, 0xf0, 0x59, 0xbc, 0x8e, 0x11, 0x66, 0xb7, 0xe3, 0x53, 0x0c, 0x4c, 0x23, 0x3e, 0x2b, 0x5f, 0x8f, 0x71, 0xa1, 0xcc, 0xa5, 0x82, 0xd4, 0x3e, 0xcc, 0x72, 0xb1, 0xbc, 0xa1, 0x6d, 0xfc, 0x70, 0x13, 0x22, 0x6b, 0x9e } +, + /* Salt */ + 20, + { 0xef, 0x28, 0x69, 0xfa, 0x40, 0xc3, 0x46, 0xcb, 0x18, 0x3d, 0xab, 0x3d, 0x7b, 0xff, 0xc9, 0x8f, 0xd5, 0x6d, 0xf4, 0x2d } +, + /* Signature */ + 128, + { 0x3e, 0xf7, 0xf4, 0x6e, 0x83, 0x1b, 0xf9, 0x2b, 0x32, 0x27, 0x41, 0x42, 0xa5, 0x85, 0xff, 0xce, 0xfb, 0xdc, 0xa7, 0xb3, 0x2a, 0xe9, 0x0d, 0x10, 0xfb, 0x0f, 0x0c, 0x72, 0x99, 0x84, 0xf0, 0x4e, 0xf2, 0x9a, 0x9d, 0xf0, 0x78, 0x07, 0x75, 0xce, 0x43, 0x73, 0x9b, 0x97, 0x83, 0x83, 0x90, 0xdb, 0x0a, 0x55, 0x05, 0xe6, 0x3d, 0xe9, 0x27, 0x02, 0x8d, 0x9d, 0x29, 0xb2, 0x19, 0xca, 0x2c, 0x45, 0x17, 0x83, 0x25, 0x58, 0xa5, 0x5d, 0x69, 0x4a, 0x6d, 0x25, 0xb9, 0xda, 0xb6, 0x60, 0x03, 0xc4, 0xcc, 0xcd, 0x90, 0x78, 0x02, 0x19, 0x3b, 0xe5, 0x17, 0x0d, 0x26, 0x14, 0x7d, 0x37, 0xb9, 0x35, 0x90, 0x24, 0x1b, 0xe5, 0x1c, 0x25, 0x05, 0x5f, 0x47, 0xef, 0x62, 0x75, 0x2c, 0xfb, 0xe2, 0x14, 0x18, 0xfa, 0xfe, 0x98, 0xc2, 0x2c, 0x4d, 0x4d, 0x47, 0x72, 0x4f, 0xdb, 0x56, 0x69, 0xe8, 0x43 } + +} +, +{ + "RSASSA-PSS Signature Example 1.3", + /* Message to be signed */ + 228, + { 0xa4, 0xb1, 0x59, 0x94, 0x17, 0x61, 0xc4, 0x0c, 0x6a, 0x82, 0xf2, 0xb8, 0x0d, 0x1b, 0x94, 0xf5, 0xaa, 0x26, 0x54, 0xfd, 0x17, 0xe1, 0x2d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, 0x8f, 0xb0, 0x25, 0x74, 0xd1, 0x39, 0xef, 0x50, 0xf0, 0x19, 0xc9, 0xee, 0xf4, 0x16, 0x97, 0x13, 0x38, 0xe7, 0xd4, 0x70 } +, + /* Salt */ + 20, + { 0x71, 0x0b, 0x9c, 0x47, 0x47, 0xd8, 0x00, 0xd4, 0xde, 0x87, 0xf1, 0x2a, 0xfd, 0xce, 0x6d, 0xf1, 0x81, 0x07, 0xcc, 0x77 } +, + /* Signature */ + 128, + { 0x66, 0x60, 0x26, 0xfb, 0xa7, 0x1b, 0xd3, 0xe7, 0xcf, 0x13, 0x15, 0x7c, 0xc2, 0xc5, 0x1a, 0x8e, 0x4a, 0xa6, 0x84, 0xaf, 0x97, 0x78, 0xf9, 0x18, 0x49, 0xf3, 0x43, 0x35, 0xd1, 0x41, 0xc0, 0x01, 0x54, 0xc4, 0x19, 0x76, 0x21, 0xf9, 0x62, 0x4a, 0x67, 0x5b, 0x5a, 0xbc, 0x22, 0xee, 0x7d, 0x5b, 0xaa, 0xff, 0xaa, 0xe1, 0xc9, 0xba, 0xca, 0x2c, 0xc3, 0x73, 0xb3, 0xf3, 0x3e, 0x78, 0xe6, 0x14, 0x3c, 0x39, 0x5a, 0x91, 0xaa, 0x7f, 0xac, 0xa6, 0x64, 0xeb, 0x73, 0x3a, 0xfd, 0x14, 0xd8, 0x82, 0x72, 0x59, 0xd9, 0x9a, 0x75, 0x50, 0xfa, 0xca, 0x50, 0x1e, 0xf2, 0xb0, 0x4e, 0x33, 0xc2, 0x3a, 0xa5, 0x1f, 0x4b, 0x9e, 0x82, 0x82, 0xef, 0xdb, 0x72, 0x8c, 0xc0, 0xab, 0x09, 0x40, 0x5a, 0x91, 0x60, 0x7c, 0x63, 0x69, 0x96, 0x1b, 0xc8, 0x27, 0x0d, 0x2d, 0x4f, 0x39, 0xfc, 0xe6, 0x12, 0xb1 } + +} +, +{ + "RSASSA-PSS Signature Example 1.4", + /* Message to be signed */ + 9, + { 0xbc, 0x65, 0x67, 0x47, 0xfa, 0x9e, 0xaf, 0xb3, 0xf0 } +, + /* Salt */ + 20, + { 0x05, 0x6f, 0x00, 0x98, 0x5d, 0xe1, 0x4d, 0x8e, 0xf5, 0xce, 0xa9, 0xe8, 0x2f, 0x8c, 0x27, 0xbe, 0xf7, 0x20, 0x33, 0x5e } +, + /* Signature */ + 128, + { 0x46, 0x09, 0x79, 0x3b, 0x23, 0xe9, 0xd0, 0x93, 0x62, 0xdc, 0x21, 0xbb, 0x47, 0xda, 0x0b, 0x4f, 0x3a, 0x76, 0x22, 0x64, 0x9a, 0x47, 0xd4, 0x64, 0x01, 0x9b, 0x9a, 0xea, 0xfe, 0x53, 0x35, 0x9c, 0x17, 0x8c, 0x91, 0xcd, 0x58, 0xba, 0x6b, 0xcb, 0x78, 0xbe, 0x03, 0x46, 0xa7, 0xbc, 0x63, 0x7f, 0x4b, 0x87, 0x3d, 0x4b, 0xab, 0x38, 0xee, 0x66, 0x1f, 0x19, 0x96, 0x34, 0xc5, 0x47, 0xa1, 0xad, 0x84, 0x42, 0xe0, 0x3d, 0xa0, 0x15, 0xb1, 0x36, 0xe5, 0x43, 0xf7, 0xab, 0x07, 0xc0, 0xc1, 0x3e, 0x42, 0x25, 0xb8, 0xde, 0x8c, 0xce, 0x25, 0xd4, 0xf6, 0xeb, 0x84, 0x00, 0xf8, 0x1f, 0x7e, 0x18, 0x33, 0xb7, 0xee, 0x6e, 0x33, 0x4d, 0x37, 0x09, 0x64, 0xca, 0x79, 0xfd, 0xb8, 0x72, 0xb4, 0xd7, 0x52, 0x23, 0xb5, 0xee, 0xb0, 0x81, 0x01, 0x59, 0x1f, 0xb5, 0x32, 0xd1, 0x55, 0xa6, 0xde, 0x87 } + +} +, +{ + "RSASSA-PSS Signature Example 1.5", + /* Message to be signed */ + 149, + { 0xb4, 0x55, 0x81, 0x54, 0x7e, 0x54, 0x27, 0x77, 0x0c, 0x76, 0x8e, 0x8b, 0x82, 0xb7, 0x55, 0x64, 0xe0, 0x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0xae, 0xa3, 0xc0, 0x95, 0xaf, 0x73, 0x47, 0x9c, 0xf0, 0xa4, 0x5e, 0x56, 0x29, 0x63, 0x5a, 0x53, 0xa0, 0x18, 0x37, 0x76, 0x15, 0xb1, 0x6c, 0xb9, 0xb1, 0x3b, 0x3e, 0x09, 0xd6, 0x71, 0xeb, 0x71, 0xe3, 0x87, 0xb8, 0x54, 0x5c, 0x59, 0x60, 0xda, 0x5a, 0x64, 0x77, 0x6e, 0x76, 0x8e, 0x82, 0xb2, 0xc9, 0x35, 0x83, 0xbf, 0x10, 0x4c, 0x3f, 0xdb, 0x23, 0x51, 0x2b, 0x7b, 0x4e, 0x89, 0xf6, 0x33, 0xdd, 0x00, 0x63, 0xa5, 0x30, 0xdb, 0x45, 0x24, 0xb0, 0x1c, 0x3f, 0x38, 0x4c, 0x09, 0x31, 0x0e, 0x31, 0x5a, 0x79, 0xdc, 0xd3, 0xd6, 0x84, 0x02, 0x2a, 0x7f, 0x31, 0xc8, 0x65, 0xa6, 0x64, 0xe3, 0x16, 0x97, 0x8b, 0x75, 0x9f, 0xad } + +} +, +{ + "RSASSA-PSS Signature Example 1.6", + /* Message to be signed */ + 233, + { 0x10, 0xaa, 0xe9, 0xa0, 0xab, 0x0b, 0x59, 0x5d, 0x08, 0x41, 0x20, 0x7b, 0x70, 0x0d, 0x48, 0xd7, 0x5f, 0xae, 0xdd, 0xe3, 0xb7, 0x75, 0xcd, 0x6b, 0x4c, 0xc8, 0x8a, 0xe0, 0x6e, 0x46, 0x94, 0xec, 0x74, 0xba, 0x18, 0xf8, 0x52, 0x0d, 0x4f, 0x5e, 0xa6, 0x9c, 0xbb, 0xe7, 0xcc, 0x2b, 0xeb, 0xa4, 0x3e, 0xfd, 0xc1, 0x02, 0x15, 0xac, 0x4e, 0xb3, 0x2d, 0xc3, 0x02, 0xa1, 0xf5, 0x3d, 0xc6, 0xc4, 0x35, 0x22, 0x67, 0xe7, 0x93, 0x6c, 0xfe, 0xbf, 0x7c, 0x8d, 0x67, 0x03, 0x57, 0x84, 0xa3, 0x90, 0x9f, 0xa8, 0x59, 0xc7, 0xb7, 0xb5, 0x9b, 0x8e, 0x39, 0xc5, 0xc2, 0x34, 0x9f, 0x18, 0x86, 0xb7, 0x05, 0xa3, 0x02, 0x67, 0xd4, 0x02, 0xf7, 0x48, 0x6a, 0xb4, 0xf5, 0x8c, 0xad, 0x5d, 0x69, 0xad, 0xb1, 0x7a, 0xb8, 0xcd, 0x0c, 0xe1, 0xca, 0xf5, 0x02, 0x5a, 0xf4, 0xae, 0x24, 0xb1, 0xfb, 0x87, 0x94, 0xc6, 0x07, 0x0c, 0xc0, 0x9a, 0x51, 0xe2, 0xf9, 0x91, 0x13, 0x11, 0xe3, 0x87, 0x7d, 0x00, 0x44, 0xc7, 0x1c, 0x57, 0xa9, 0x93, 0x39, 0x50, 0x08, 0x80, 0x6b, 0x72, 0x3a, 0xc3, 0x83, 0x73, 0xd3, 0x95, 0x48, 0x18, 0x18, 0x52, 0x8c, 0x1e, 0x70, 0x53, 0x73, 0x92, 0x82, 0x05, 0x35, 0x29, 0x51, 0x0e, 0x93, 0x5c, 0xd0, 0xfa, 0x77, 0xb8, 0xfa, 0x53, 0xcc, 0x2d, 0x47, 0x4b, 0xd4, 0xfb, 0x3c, 0xc5, 0xc6, 0x72, 0xd6, 0xff, 0xdc, 0x90, 0xa0, 0x0f, 0x98, 0x48, 0x71, 0x2c, 0x4b, 0xcf, 0xe4, 0x6c, 0x60, 0x57, 0x36, 0x59, 0xb1, 0x1e, 0x64, 0x57, 0xe8, 0x61, 0xf0, 0xf6, 0x04, 0xb6, 0x13, 0x8d, 0x14, 0x4f, 0x8c, 0xe4, 0xe2, 0xda, 0x73 } +, + /* Salt */ + 20, + { 0xa8, 0xab, 0x69, 0xdd, 0x80, 0x1f, 0x00, 0x74, 0xc2, 0xa1, 0xfc, 0x60, 0x64, 0x98, 0x36, 0xc6, 0x16, 0xd9, 0x96, 0x81 } +, + /* Signature */ + 128, + { 0x2a, 0x34, 0xf6, 0x12, 0x5e, 0x1f, 0x6b, 0x0b, 0xf9, 0x71, 0xe8, 0x4f, 0xbd, 0x41, 0xc6, 0x32, 0xbe, 0x8f, 0x2c, 0x2a, 0xce, 0x7d, 0xe8, 0xb6, 0x92, 0x6e, 0x31, 0xff, 0x93, 0xe9, 0xaf, 0x98, 0x7f, 0xbc, 0x06, 0xe5, 0x1e, 0x9b, 0xe1, 0x4f, 0x51, 0x98, 0xf9, 0x1f, 0x3f, 0x95, 0x3b, 0xd6, 0x7d, 0xa6, 0x0a, 0x9d, 0xf5, 0x97, 0x64, 0xc3, 0xdc, 0x0f, 0xe0, 0x8e, 0x1c, 0xbe, 0xf0, 0xb7, 0x5f, 0x86, 0x8d, 0x10, 0xad, 0x3f, 0xba, 0x74, 0x9f, 0xef, 0x59, 0xfb, 0x6d, 0xac, 0x46, 0xa0, 0xd6, 0xe5, 0x04, 0x36, 0x93, 0x31, 0x58, 0x6f, 0x58, 0xe4, 0x62, 0x8f, 0x39, 0xaa, 0x27, 0x89, 0x82, 0x54, 0x3b, 0xc0, 0xee, 0xb5, 0x37, 0xdc, 0x61, 0x95, 0x80, 0x19, 0xb3, 0x94, 0xfb, 0x27, 0x3f, 0x21, 0x58, 0x58, 0xa0, 0xa0, 0x1a, 0xc4, 0xd6, 0x50, 0xb9, 0x55, 0xc6, 0x7f, 0x4c, 0x58 } + +} +, +} +}, +{ + "Example 2: A 1025-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x01, 0xd4, 0x0c, 0x1b, 0xcf, 0x97, 0xa6, 0x8a, 0xe7, 0xcd, 0xbd, 0x8a, 0x7b, 0xf3, 0xe3, 0x4f, 0xa1, 0x9d, 0xcc, 0xa4, 0xef, 0x75, 0xa4, 0x74, 0x54, 0x37, 0x5f, 0x94, 0x51, 0x4d, 0x88, 0xfe, 0xd0, 0x06, 0xfb, 0x82, 0x9f, 0x84, 0x19, 0xff, 0x87, 0xd6, 0x31, 0x5d, 0xa6, 0x8a, 0x1f, 0xf3, 0xa0, 0x93, 0x8e, 0x9a, 0xbb, 0x34, 0x64, 0x01, 0x1c, 0x30, 0x3a, 0xd9, 0x91, 0x99, 0xcf, 0x0c, 0x7c, 0x7a, 0x8b, 0x47, 0x7d, 0xce, 0x82, 0x9e, 0x88, 0x44, 0xf6, 0x25, 0xb1, 0x15, 0xe5, 0xe9, 0xc4, 0xa5, 0x9c, 0xf8, 0xf8, 0x11, 0x3b, 0x68, 0x34, 0x33, 0x6a, 0x2f, 0xd2, 0x68, 0x9b, 0x47, 0x2c, 0xbb, 0x5e, 0x5c, 0xab, 0xe6, 0x74, 0x35, 0x0c, 0x59, 0xb6, 0xc1, 0x7e, 0x17, 0x68, 0x74, 0xfb, 0x42, 0xf8, 0xfc, 0x3d, 0x17, 0x6a, 0x01, 0x7e, 0xdc, 0x61, 0xfd, 0x32, 0x6c, 0x4b, 0x33, 0xc9 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x02, 0x7d, 0x14, 0x7e, 0x46, 0x73, 0x05, 0x73, 0x77, 0xfd, 0x1e, 0xa2, 0x01, 0x56, 0x57, 0x72, 0x17, 0x6a, 0x7d, 0xc3, 0x83, 0x58, 0xd3, 0x76, 0x04, 0x56, 0x85, 0xa2, 0xe7, 0x87, 0xc2, 0x3c, 0x15, 0x57, 0x6b, 0xc1, 0x6b, 0x9f, 0x44, 0x44, 0x02, 0xd6, 0xbf, 0xc5, 0xd9, 0x8a, 0x3e, 0x88, 0xea, 0x13, 0xef, 0x67, 0xc3, 0x53, 0xec, 0xa0, 0xc0, 0xdd, 0xba, 0x92, 0x55, 0xbd, 0x7b, 0x8b, 0xb5, 0x0a, 0x64, 0x4a, 0xfd, 0xfd, 0x1d, 0xd5, 0x16, 0x95, 0xb2, 0x52, 0xd2, 0x2e, 0x73, 0x18, 0xd1, 0xb6, 0x68, 0x7a, 0x1c, 0x10, 0xff, 0x75, 0x54, 0x5f, 0x3d, 0xb0, 0xfe, 0x60, 0x2d, 0x5f, 0x2b, 0x7f, 0x29, 0x4e, 0x36, 0x01, 0xea, 0xb7, 0xb9, 0xd1, 0xce, 0xcd, 0x76, 0x7f, 0x64, 0x69, 0x2e, 0x3e, 0x53, 0x6c, 0xa2, 0x84, 0x6c, 0xb0, 0xc2, 0xdd, 0x48, 0x6a, 0x39, 0xfa, 0x75, 0xb1 } +, + /* Prime p */ + 65, + { 0x01, 0x66, 0x01, 0xe9, 0x26, 0xa0, 0xf8, 0xc9, 0xe2, 0x6e, 0xca, 0xb7, 0x69, 0xea, 0x65, 0xa5, 0xe7, 0xc5, 0x2c, 0xc9, 0xe0, 0x80, 0xef, 0x51, 0x94, 0x57, 0xc6, 0x44, 0xda, 0x68, 0x91, 0xc5, 0xa1, 0x04, 0xd3, 0xea, 0x79, 0x55, 0x92, 0x9a, 0x22, 0xe7, 0xc6, 0x8a, 0x7a, 0xf9, 0xfc, 0xad, 0x77, 0x7c, 0x3c, 0xcc, 0x2b, 0x9e, 0x3d, 0x36, 0x50, 0xbc, 0xe4, 0x04, 0x39, 0x9b, 0x7e, 0x59, 0xd1 } +, + /* Prime q */ + 65, + { 0x01, 0x4e, 0xaf, 0xa1, 0xd4, 0xd0, 0x18, 0x4d, 0xa7, 0xe3, 0x1f, 0x87, 0x7d, 0x12, 0x81, 0xdd, 0xda, 0x62, 0x56, 0x64, 0x86, 0x9e, 0x83, 0x79, 0xe6, 0x7a, 0xd3, 0xb7, 0x5e, 0xae, 0x74, 0xa5, 0x80, 0xe9, 0x82, 0x7a, 0xbd, 0x6e, 0xb7, 0xa0, 0x02, 0xcb, 0x54, 0x11, 0xf5, 0x26, 0x67, 0x97, 0x76, 0x8f, 0xb8, 0xe9, 0x5a, 0xe4, 0x0e, 0x3e, 0x8a, 0x01, 0xf3, 0x5f, 0xf8, 0x9e, 0x56, 0xc0, 0x79 } +, + /* p's CRT exponent dP */ + 64, + { 0xe2, 0x47, 0xcc, 0xe5, 0x04, 0x93, 0x9b, 0x8f, 0x0a, 0x36, 0x09, 0x0d, 0xe2, 0x00, 0x93, 0x87, 0x55, 0xe2, 0x44, 0x4b, 0x29, 0x53, 0x9a, 0x7d, 0xa7, 0xa9, 0x02, 0xf6, 0x05, 0x68, 0x35, 0xc0, 0xdb, 0x7b, 0x52, 0x55, 0x94, 0x97, 0xcf, 0xe2, 0xc6, 0x1a, 0x80, 0x86, 0xd0, 0x21, 0x3c, 0x47, 0x2c, 0x78, 0x85, 0x18, 0x00, 0xb1, 0x71, 0xf6, 0x40, 0x1d, 0xe2, 0xe9, 0xc2, 0x75, 0x6f, 0x31 } +, + /* q's CRT exponent dQ */ + 64, + { 0xb1, 0x2f, 0xba, 0x75, 0x78, 0x55, 0xe5, 0x86, 0xe4, 0x6f, 0x64, 0xc3, 0x8a, 0x70, 0xc6, 0x8b, 0x3f, 0x54, 0x8d, 0x93, 0xd7, 0x87, 0xb3, 0x99, 0x99, 0x9d, 0x4c, 0x8f, 0x0b, 0xbd, 0x25, 0x81, 0xc2, 0x1e, 0x19, 0xed, 0x00, 0x18, 0xa6, 0xd5, 0xd3, 0xdf, 0x86, 0x42, 0x4b, 0x3a, 0xbc, 0xad, 0x40, 0x19, 0x9d, 0x31, 0x49, 0x5b, 0x61, 0x30, 0x9f, 0x27, 0xc1, 0xbf, 0x55, 0xd4, 0x87, 0xc1 } +, + /* CRT coefficient qInv */ + 64, + { 0x56, 0x4b, 0x1e, 0x1f, 0xa0, 0x03, 0xbd, 0xa9, 0x1e, 0x89, 0x09, 0x04, 0x25, 0xaa, 0xc0, 0x5b, 0x91, 0xda, 0x9e, 0xe2, 0x50, 0x61, 0xe7, 0x62, 0x8d, 0x5f, 0x51, 0x30, 0x4a, 0x84, 0x99, 0x2f, 0xdc, 0x33, 0x76, 0x2b, 0xd3, 0x78, 0xa5, 0x9f, 0x03, 0x0a, 0x33, 0x4d, 0x53, 0x2b, 0xd0, 0xda, 0xe8, 0xf2, 0x98, 0xea, 0x9e, 0xd8, 0x44, 0x63, 0x6a, 0xd5, 0xfb, 0x8c, 0xbd, 0xc0, 0x3c, 0xad } + +} +, +{{ + "RSASSA-PSS Signature Example 2.1", + /* Message to be signed */ + 61, + { 0xda, 0xba, 0x03, 0x20, 0x66, 0x26, 0x3f, 0xae, 0xdb, 0x65, 0x98, 0x48, 0x11, 0x52, 0x78, 0xa5, 0x2c, 0x44, 0xfa, 0xa3, 0xa7, 0x6f, 0x37, 0x51, 0x5e, 0xd3, 0x36, 0x32, 0x10, 0x72, 0xc4, 0x0a, 0x9d, 0x9b, 0x53, 0xbc, 0x05, 0x01, 0x40, 0x78, 0xad, 0xf5, 0x20, 0x87, 0x51, 0x46, 0xaa, 0xe7, 0x0f, 0xf0, 0x60, 0x22, 0x6d, 0xcb, 0x7b, 0x1f, 0x1f, 0xc2, 0x7e, 0x93, 0x60 } +, + /* Salt */ + 20, + { 0x57, 0xbf, 0x16, 0x0b, 0xcb, 0x02, 0xbb, 0x1d, 0xc7, 0x28, 0x0c, 0xf0, 0x45, 0x85, 0x30, 0xb7, 0xd2, 0x83, 0x2f, 0xf7 } +, + /* Signature */ + 129, + { 0x01, 0x4c, 0x5b, 0xa5, 0x33, 0x83, 0x28, 0xcc, 0xc6, 0xe7, 0xa9, 0x0b, 0xf1, 0xc0, 0xab, 0x3f, 0xd6, 0x06, 0xff, 0x47, 0x96, 0xd3, 0xc1, 0x2e, 0x4b, 0x63, 0x9e, 0xd9, 0x13, 0x6a, 0x5f, 0xec, 0x6c, 0x16, 0xd8, 0x88, 0x4b, 0xdd, 0x99, 0xcf, 0xdc, 0x52, 0x14, 0x56, 0xb0, 0x74, 0x2b, 0x73, 0x68, 0x68, 0xcf, 0x90, 0xde, 0x09, 0x9a, 0xdb, 0x8d, 0x5f, 0xfd, 0x1d, 0xef, 0xf3, 0x9b, 0xa4, 0x00, 0x7a, 0xb7, 0x46, 0xce, 0xfd, 0xb2, 0x2d, 0x7d, 0xf0, 0xe2, 0x25, 0xf5, 0x46, 0x27, 0xdc, 0x65, 0x46, 0x61, 0x31, 0x72, 0x1b, 0x90, 0xaf, 0x44, 0x53, 0x63, 0xa8, 0x35, 0x8b, 0x9f, 0x60, 0x76, 0x42, 0xf7, 0x8f, 0xab, 0x0a, 0xb0, 0xf4, 0x3b, 0x71, 0x68, 0xd6, 0x4b, 0xae, 0x70, 0xd8, 0x82, 0x78, 0x48, 0xd8, 0xef, 0x1e, 0x42, 0x1c, 0x57, 0x54, 0xdd, 0xf4, 0x2c, 0x25, 0x89, 0xb5, 0xb3 } + +} +, +{ + "RSASSA-PSS Signature Example 2.2", + /* Message to be signed */ + 234, + { 0xe4, 0xf8, 0x60, 0x1a, 0x8a, 0x6d, 0xa1, 0xbe, 0x34, 0x44, 0x7c, 0x09, 0x59, 0xc0, 0x58, 0x57, 0x0c, 0x36, 0x68, 0xcf, 0xd5, 0x1d, 0xd5, 0xf9, 0xcc, 0xd6, 0xad, 0x44, 0x11, 0xfe, 0x82, 0x13, 0x48, 0x6d, 0x78, 0xa6, 0xc4, 0x9f, 0x93, 0xef, 0xc2, 0xca, 0x22, 0x88, 0xce, 0xbc, 0x2b, 0x9b, 0x60, 0xbd, 0x04, 0xb1, 0xe2, 0x20, 0xd8, 0x6e, 0x3d, 0x48, 0x48, 0xd7, 0x09, 0xd0, 0x32, 0xd1, 0xe8, 0xc6, 0xa0, 0x70, 0xc6, 0xaf, 0x9a, 0x49, 0x9f, 0xcf, 0x95, 0x35, 0x4b, 0x14, 0xba, 0x61, 0x27, 0xc7, 0x39, 0xde, 0x1b, 0xb0, 0xfd, 0x16, 0x43, 0x1e, 0x46, 0x93, 0x8a, 0xec, 0x0c, 0xf8, 0xad, 0x9e, 0xb7, 0x2e, 0x83, 0x2a, 0x70, 0x35, 0xde, 0x9b, 0x78, 0x07, 0xbd, 0xc0, 0xed, 0x8b, 0x68, 0xeb, 0x0f, 0x5a, 0xc2, 0x21, 0x6b, 0xe4, 0x0c, 0xe9, 0x20, 0xc0, 0xdb, 0x0e, 0xdd, 0xd3, 0x86, 0x0e, 0xd7, 0x88, 0xef, 0xac, 0xca, 0xca, 0x50, 0x2d, 0x8f, 0x2b, 0xd6, 0xd1, 0xa7, 0xc1, 0xf4, 0x1f, 0xf4, 0x6f, 0x16, 0x81, 0xc8, 0xf1, 0xf8, 0x18, 0xe9, 0xc4, 0xf6, 0xd9, 0x1a, 0x0c, 0x78, 0x03, 0xcc, 0xc6, 0x3d, 0x76, 0xa6, 0x54, 0x4d, 0x84, 0x3e, 0x08, 0x4e, 0x36, 0x3b, 0x8a, 0xcc, 0x55, 0xaa, 0x53, 0x17, 0x33, 0xed, 0xb5, 0xde, 0xe5, 0xb5, 0x19, 0x6e, 0x9f, 0x03, 0xe8, 0xb7, 0x31, 0xb3, 0x77, 0x64, 0x28, 0xd9, 0xe4, 0x57, 0xfe, 0x3f, 0xbc, 0xb3, 0xdb, 0x72, 0x74, 0x44, 0x2d, 0x78, 0x58, 0x90, 0xe9, 0xcb, 0x08, 0x54, 0xb6, 0x44, 0x4d, 0xac, 0xe7, 0x91, 0xd7, 0x27, 0x3d, 0xe1, 0x88, 0x97, 0x19, 0x33, 0x8a, 0x77, 0xfe } +, + /* Salt */ + 20, + { 0x7f, 0x6d, 0xd3, 0x59, 0xe6, 0x04, 0xe6, 0x08, 0x70, 0xe8, 0x98, 0xe4, 0x7b, 0x19, 0xbf, 0x2e, 0x5a, 0x7b, 0x2a, 0x90 } +, + /* Signature */ + 129, + { 0x01, 0x09, 0x91, 0x65, 0x6c, 0xca, 0x18, 0x2b, 0x7f, 0x29, 0xd2, 0xdb, 0xc0, 0x07, 0xe7, 0xae, 0x0f, 0xec, 0x15, 0x8e, 0xb6, 0x75, 0x9c, 0xb9, 0xc4, 0x5c, 0x5f, 0xf8, 0x7c, 0x76, 0x35, 0xdd, 0x46, 0xd1, 0x50, 0x88, 0x2f, 0x4d, 0xe1, 0xe9, 0xae, 0x65, 0xe7, 0xf7, 0xd9, 0x01, 0x8f, 0x68, 0x36, 0x95, 0x4a, 0x47, 0xc0, 0xa8, 0x1a, 0x8a, 0x6b, 0x6f, 0x83, 0xf2, 0x94, 0x4d, 0x60, 0x81, 0xb1, 0xaa, 0x7c, 0x75, 0x9b, 0x25, 0x4b, 0x2c, 0x34, 0xb6, 0x91, 0xda, 0x67, 0xcc, 0x02, 0x26, 0xe2, 0x0b, 0x2f, 0x18, 0xb4, 0x22, 0x12, 0x76, 0x1d, 0xcd, 0x4b, 0x90, 0x8a, 0x62, 0xb3, 0x71, 0xb5, 0x91, 0x8c, 0x57, 0x42, 0xaf, 0x4b, 0x53, 0x7e, 0x29, 0x69, 0x17, 0x67, 0x4f, 0xb9, 0x14, 0x19, 0x47, 0x61, 0x62, 0x1c, 0xc1, 0x9a, 0x41, 0xf6, 0xfb, 0x95, 0x3f, 0xbc, 0xbb, 0x64, 0x9d, 0xea } + +} +, +{ + "RSASSA-PSS Signature Example 2.3", + /* Message to be signed */ + 102, + { 0x52, 0xa1, 0xd9, 0x6c, 0x8a, 0xc3, 0x9e, 0x41, 0xe4, 0x55, 0x80, 0x98, 0x01, 0xb9, 0x27, 0xa5, 0xb4, 0x45, 0xc1, 0x0d, 0x90, 0x2a, 0x0d, 0xcd, 0x38, 0x50, 0xd2, 0x2a, 0x66, 0xd2, 0xbb, 0x07, 0x03, 0xe6, 0x7d, 0x58, 0x67, 0x11, 0x45, 0x95, 0xaa, 0xbf, 0x5a, 0x7a, 0xeb, 0x5a, 0x8f, 0x87, 0x03, 0x4b, 0xbb, 0x30, 0xe1, 0x3c, 0xfd, 0x48, 0x17, 0xa9, 0xbe, 0x76, 0x23, 0x00, 0x23, 0x60, 0x6d, 0x02, 0x86, 0xa3, 0xfa, 0xf8, 0xa4, 0xd2, 0x2b, 0x72, 0x8e, 0xc5, 0x18, 0x07, 0x9f, 0x9e, 0x64, 0x52, 0x6e, 0x3a, 0x0c, 0xc7, 0x94, 0x1a, 0xa3, 0x38, 0xc4, 0x37, 0x99, 0x7c, 0x68, 0x0c, 0xca, 0xc6, 0x7c, 0x66, 0xbf, 0xa1 } +, + /* Salt */ + 20, + { 0xfc, 0xa8, 0x62, 0x06, 0x8b, 0xce, 0x22, 0x46, 0x72, 0x4b, 0x70, 0x8a, 0x05, 0x19, 0xda, 0x17, 0xe6, 0x48, 0x68, 0x8c } +, + /* Signature */ + 129, + { 0x00, 0x7f, 0x00, 0x30, 0x01, 0x8f, 0x53, 0xcd, 0xc7, 0x1f, 0x23, 0xd0, 0x36, 0x59, 0xfd, 0xe5, 0x4d, 0x42, 0x41, 0xf7, 0x58, 0xa7, 0x50, 0xb4, 0x2f, 0x18, 0x5f, 0x87, 0x57, 0x85, 0x20, 0xc3, 0x07, 0x42, 0xaf, 0xd8, 0x43, 0x59, 0xb6, 0xe6, 0xe8, 0xd3, 0xed, 0x95, 0x9d, 0xc6, 0xfe, 0x48, 0x6b, 0xed, 0xc8, 0xe2, 0xcf, 0x00, 0x1f, 0x63, 0xa7, 0xab, 0xe1, 0x62, 0x56, 0xa1, 0xb8, 0x4d, 0xf0, 0xd2, 0x49, 0xfc, 0x05, 0xd3, 0x19, 0x4c, 0xe5, 0xf0, 0x91, 0x27, 0x42, 0xdb, 0xbf, 0x80, 0xdd, 0x17, 0x4f, 0x6c, 0x51, 0xf6, 0xba, 0xd7, 0xf1, 0x6c, 0xf3, 0x36, 0x4e, 0xba, 0x09, 0x5a, 0x06, 0x26, 0x7d, 0xc3, 0x79, 0x38, 0x03, 0xac, 0x75, 0x26, 0xae, 0xbe, 0x0a, 0x47, 0x5d, 0x38, 0xb8, 0xc2, 0x24, 0x7a, 0xb5, 0x1c, 0x48, 0x98, 0xdf, 0x70, 0x47, 0xdc, 0x6a, 0xdf, 0x52, 0xc6, 0xc4 } + +} +, +{ + "RSASSA-PSS Signature Example 2.4", + /* Message to be signed */ + 30, + { 0xa7, 0x18, 0x2c, 0x83, 0xac, 0x18, 0xbe, 0x65, 0x70, 0xa1, 0x06, 0xaa, 0x9d, 0x5c, 0x4e, 0x3d, 0xbb, 0xd4, 0xaf, 0xae, 0xb0, 0xc6, 0x0c, 0x4a, 0x23, 0xe1, 0x96, 0x9d, 0x79, 0xff } +, + /* Salt */ + 20, + { 0x80, 0x70, 0xef, 0x2d, 0xe9, 0x45, 0xc0, 0x23, 0x87, 0x68, 0x4b, 0xa0, 0xd3, 0x30, 0x96, 0x73, 0x22, 0x35, 0xd4, 0x40 } +, + /* Signature */ + 129, + { 0x00, 0x9c, 0xd2, 0xf4, 0xed, 0xbe, 0x23, 0xe1, 0x23, 0x46, 0xae, 0x8c, 0x76, 0xdd, 0x9a, 0xd3, 0x23, 0x0a, 0x62, 0x07, 0x61, 0x41, 0xf1, 0x6c, 0x15, 0x2b, 0xa1, 0x85, 0x13, 0xa4, 0x8e, 0xf6, 0xf0, 0x10, 0xe0, 0xe3, 0x7f, 0xd3, 0xdf, 0x10, 0xa1, 0xec, 0x62, 0x9a, 0x0c, 0xb5, 0xa3, 0xb5, 0xd2, 0x89, 0x30, 0x07, 0x29, 0x8c, 0x30, 0x93, 0x6a, 0x95, 0x90, 0x3b, 0x6b, 0xa8, 0x55, 0x55, 0xd9, 0xec, 0x36, 0x73, 0xa0, 0x61, 0x08, 0xfd, 0x62, 0xa2, 0xfd, 0xa5, 0x6d, 0x1c, 0xe2, 0xe8, 0x5c, 0x4d, 0xb6, 0xb2, 0x4a, 0x81, 0xca, 0x3b, 0x49, 0x6c, 0x36, 0xd4, 0xfd, 0x06, 0xeb, 0x7c, 0x91, 0x66, 0xd8, 0xe9, 0x48, 0x77, 0xc4, 0x2b, 0xea, 0x62, 0x2b, 0x3b, 0xfe, 0x92, 0x51, 0xfd, 0xc2, 0x1d, 0x8d, 0x53, 0x71, 0xba, 0xda, 0xd7, 0x8a, 0x48, 0x82, 0x14, 0x79, 0x63, 0x35, 0xb4, 0x0b } + +} +, +{ + "RSASSA-PSS Signature Example 2.5", + /* Message to be signed */ + 56, + { 0x86, 0xa8, 0x3d, 0x4a, 0x72, 0xee, 0x93, 0x2a, 0x4f, 0x56, 0x30, 0xaf, 0x65, 0x79, 0xa3, 0x86, 0xb7, 0x8f, 0xe8, 0x89, 0x99, 0xe0, 0xab, 0xd2, 0xd4, 0x90, 0x34, 0xa4, 0xbf, 0xc8, 0x54, 0xdd, 0x94, 0xf1, 0x09, 0x4e, 0x2e, 0x8c, 0xd7, 0xa1, 0x79, 0xd1, 0x95, 0x88, 0xe4, 0xae, 0xfc, 0x1b, 0x1b, 0xd2, 0x5e, 0x95, 0xe3, 0xdd, 0x46, 0x1f } +, + /* Salt */ + 20, + { 0x17, 0x63, 0x9a, 0x4e, 0x88, 0xd7, 0x22, 0xc4, 0xfc, 0xa2, 0x4d, 0x07, 0x9a, 0x8b, 0x29, 0xc3, 0x24, 0x33, 0xb0, 0xc9 } +, + /* Signature */ + 129, + { 0x00, 0xec, 0x43, 0x08, 0x24, 0x93, 0x1e, 0xbd, 0x3b, 0xaa, 0x43, 0x03, 0x4d, 0xae, 0x98, 0xba, 0x64, 0x6b, 0x8c, 0x36, 0x01, 0x3d, 0x16, 0x71, 0xc3, 0xcf, 0x1c, 0xf8, 0x26, 0x0c, 0x37, 0x4b, 0x19, 0xf8, 0xe1, 0xcc, 0x8d, 0x96, 0x50, 0x12, 0x40, 0x5e, 0x7e, 0x9b, 0xf7, 0x37, 0x86, 0x12, 0xdf, 0xcc, 0x85, 0xfc, 0xe1, 0x2c, 0xda, 0x11, 0xf9, 0x50, 0xbd, 0x0b, 0xa8, 0x87, 0x67, 0x40, 0x43, 0x6c, 0x1d, 0x25, 0x95, 0xa6, 0x4a, 0x1b, 0x32, 0xef, 0xcf, 0xb7, 0x4a, 0x21, 0xc8, 0x73, 0xb3, 0xcc, 0x33, 0xaa, 0xf4, 0xe3, 0xdc, 0x39, 0x53, 0xde, 0x67, 0xf0, 0x67, 0x4c, 0x04, 0x53, 0xb4, 0xfd, 0x9f, 0x60, 0x44, 0x06, 0xd4, 0x41, 0xb8, 0x16, 0x09, 0x8c, 0xb1, 0x06, 0xfe, 0x34, 0x72, 0xbc, 0x25, 0x1f, 0x81, 0x5f, 0x59, 0xdb, 0x2e, 0x43, 0x78, 0xa3, 0xad, 0xdc, 0x18, 0x1e, 0xcf } + +} +, +{ + "RSASSA-PSS Signature Example 2.6", + /* Message to be signed */ + 26, + { 0x04, 0x9f, 0x91, 0x54, 0xd8, 0x71, 0xac, 0x4a, 0x7c, 0x7a, 0xb4, 0x53, 0x25, 0xba, 0x75, 0x45, 0xa1, 0xed, 0x08, 0xf7, 0x05, 0x25, 0xb2, 0x66, 0x7c, 0xf1 } +, + /* Salt */ + 20, + { 0x37, 0x81, 0x0d, 0xef, 0x10, 0x55, 0xed, 0x92, 0x2b, 0x06, 0x3d, 0xf7, 0x98, 0xde, 0x5d, 0x0a, 0xab, 0xf8, 0x86, 0xee } +, + /* Signature */ + 129, + { 0x00, 0x47, 0x5b, 0x16, 0x48, 0xf8, 0x14, 0xa8, 0xdc, 0x0a, 0xbd, 0xc3, 0x7b, 0x55, 0x27, 0xf5, 0x43, 0xb6, 0x66, 0xbb, 0x6e, 0x39, 0xd3, 0x0e, 0x5b, 0x49, 0xd3, 0xb8, 0x76, 0xdc, 0xcc, 0x58, 0xea, 0xc1, 0x4e, 0x32, 0xa2, 0xd5, 0x5c, 0x26, 0x16, 0x01, 0x44, 0x56, 0xad, 0x2f, 0x24, 0x6f, 0xc8, 0xe3, 0xd5, 0x60, 0xda, 0x3d, 0xdf, 0x37, 0x9a, 0x1c, 0x0b, 0xd2, 0x00, 0xf1, 0x02, 0x21, 0xdf, 0x07, 0x8c, 0x21, 0x9a, 0x15, 0x1b, 0xc8, 0xd4, 0xec, 0x9d, 0x2f, 0xc2, 0x56, 0x44, 0x67, 0x81, 0x10, 0x14, 0xef, 0x15, 0xd8, 0xea, 0x01, 0xc2, 0xeb, 0xbf, 0xf8, 0xc2, 0xc8, 0xef, 0xab, 0x38, 0x09, 0x6e, 0x55, 0xfc, 0xbe, 0x32, 0x85, 0xc7, 0xaa, 0x55, 0x88, 0x51, 0x25, 0x4f, 0xaf, 0xfa, 0x92, 0xc1, 0xc7, 0x2b, 0x78, 0x75, 0x86, 0x63, 0xef, 0x45, 0x82, 0x84, 0x31, 0x39, 0xd7, 0xa6 } + +} +, +} +}, +{ + "Example 3: A 1026-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x02, 0xf2, 0x46, 0xef, 0x45, 0x1e, 0xd3, 0xee, 0xbb, 0x9a, 0x31, 0x02, 0x00, 0xcc, 0x25, 0x85, 0x9c, 0x04, 0x8e, 0x4b, 0xe7, 0x98, 0x30, 0x29, 0x91, 0x11, 0x2e, 0xb6, 0x8c, 0xe6, 0xdb, 0x67, 0x4e, 0x28, 0x0d, 0xa2, 0x1f, 0xed, 0xed, 0x1a, 0xe7, 0x48, 0x80, 0xca, 0x52, 0x2b, 0x18, 0xdb, 0x24, 0x93, 0x85, 0x01, 0x28, 0x27, 0xc5, 0x15, 0xf0, 0xe4, 0x66, 0xa1, 0xff, 0xa6, 0x91, 0xd9, 0x81, 0x70, 0x57, 0x4e, 0x9d, 0x0e, 0xad, 0xb0, 0x87, 0x58, 0x6c, 0xa4, 0x89, 0x33, 0xda, 0x3c, 0xc9, 0x53, 0xd9, 0x5b, 0xd0, 0xed, 0x50, 0xde, 0x10, 0xdd, 0xcb, 0x67, 0x36, 0x10, 0x7d, 0x6c, 0x83, 0x1c, 0x7f, 0x66, 0x3e, 0x83, 0x3c, 0xa4, 0xc0, 0x97, 0xe7, 0x00, 0xce, 0x0f, 0xb9, 0x45, 0xf8, 0x8f, 0xb8, 0x5f, 0xe8, 0xe5, 0xa7, 0x73, 0x17, 0x25, 0x65, 0xb9, 0x14, 0xa4, 0x71, 0xa4, 0x43 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x65, 0x14, 0x51, 0x73, 0x3b, 0x56, 0xde, 0x5a, 0xc0, 0xa6, 0x89, 0xa4, 0xae, 0xb6, 0xe6, 0x89, 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, 0xb1, 0xb6, 0x56, 0xad, 0x86, 0xd8, 0xe1, 0x9d, 0x5d, 0xc8, 0x62, 0x92, 0xb3, 0xa1, 0x92, 0xfd, 0xf6, 0xe0, 0xdd, 0x37, 0x87, 0x7b, 0xad, 0x14, 0x82, 0x2f, 0xa0, 0x01, 0x90, 0xca, 0xb2, 0x65, 0xf9, 0x0d, 0x3f, 0x02, 0x05, 0x7b, 0x6f, 0x54, 0xd6, 0xec, 0xb1, 0x44, 0x91, 0xe5, 0xad, 0xea, 0xce, 0xbc, 0x48, 0xbf, 0x0e, 0xbd, 0x2a, 0x2a, 0xd2, 0x6d, 0x40, 0x2e, 0x54, 0xf6, 0x16, 0x51 } +, + /* p's CRT exponent dP */ + 64, + { 0x1f, 0x27, 0x79, 0xfd, 0x2e, 0x3e, 0x5e, 0x6b, 0xae, 0x05, 0x53, 0x95, 0x18, 0xfb, 0xa0, 0xcd, 0x0e, 0xad, 0x1a, 0xa4, 0x51, 0x3a, 0x7c, 0xba, 0x18, 0xf1, 0xcf, 0x10, 0xe3, 0xf6, 0x81, 0x95, 0x69, 0x3d, 0x27, 0x8a, 0x0f, 0x0e, 0xe7, 0x2f, 0x89, 0xf9, 0xbc, 0x76, 0x0d, 0x80, 0xe2, 0xf9, 0xd0, 0x26, 0x1d, 0x51, 0x65, 0x01, 0xc6, 0xae, 0x39, 0xf1, 0x4a, 0x47, 0x6c, 0xe2, 0xcc, 0xf5 } +, + /* q's CRT exponent dQ */ + 65, + { 0x01, 0x1a, 0x0d, 0x36, 0x79, 0x4b, 0x04, 0xa8, 0x54, 0xaa, 0xb4, 0xb2, 0x46, 0x2d, 0x43, 0x9a, 0x50, 0x46, 0xc9, 0x1d, 0x94, 0x0b, 0x2b, 0xc6, 0xf7, 0x5b, 0x62, 0x95, 0x6f, 0xef, 0x35, 0xa2, 0xa6, 0xe6, 0x3c, 0x53, 0x09, 0x81, 0x7f, 0x30, 0x7b, 0xbf, 0xf9, 0xd5, 0x9e, 0x7e, 0x33, 0x1b, 0xd3, 0x63, 0xf6, 0xd6, 0x68, 0x49, 0xb1, 0x83, 0x46, 0xad, 0xea, 0x16, 0x9f, 0x0a, 0xe9, 0xae, 0xc1 } +, + /* CRT coefficient qInv */ + 64, + { 0x0b, 0x30, 0xf0, 0xec, 0xf5, 0x58, 0x75, 0x2f, 0xb3, 0xa6, 0xce, 0x4b, 0xa2, 0xb8, 0xc6, 0x75, 0xf6, 0x59, 0xeb, 0xa6, 0xc3, 0x76, 0x58, 0x5a, 0x1b, 0x39, 0x71, 0x2d, 0x03, 0x8a, 0xe3, 0xd2, 0xb4, 0x6f, 0xcb, 0x41, 0x8a, 0xe1, 0x5d, 0x09, 0x05, 0xda, 0x64, 0x40, 0xe1, 0x51, 0x3a, 0x30, 0xb9, 0xb7, 0xd6, 0x66, 0x8f, 0xbc, 0x5e, 0x88, 0xe5, 0xab, 0x7a, 0x17, 0x5e, 0x73, 0xba, 0x35 } + +} +, +{{ + "RSASSA-PSS Signature Example 3.1", + /* Message to be signed */ + 30, + { 0x59, 0x4b, 0x37, 0x33, 0x3b, 0xbb, 0x2c, 0x84, 0x52, 0x4a, 0x87, 0xc1, 0xa0, 0x1f, 0x75, 0xfc, 0xec, 0x0e, 0x32, 0x56, 0xf1, 0x08, 0xe3, 0x8d, 0xca, 0x36, 0xd7, 0x0d, 0x00, 0x57 } +, + /* Salt */ + 20, + { 0xf3, 0x1a, 0xd6, 0xc8, 0xcf, 0x89, 0xdf, 0x78, 0xed, 0x77, 0xfe, 0xac, 0xbc, 0xc2, 0xf8, 0xb0, 0xa8, 0xe4, 0xcf, 0xaa } +, + /* Signature */ + 129, + { 0x00, 0x88, 0xb1, 0x35, 0xfb, 0x17, 0x94, 0xb6, 0xb9, 0x6c, 0x4a, 0x3e, 0x67, 0x81, 0x97, 0xf8, 0xca, 0xc5, 0x2b, 0x64, 0xb2, 0xfe, 0x90, 0x7d, 0x6f, 0x27, 0xde, 0x76, 0x11, 0x24, 0x96, 0x4a, 0x99, 0xa0, 0x1a, 0x88, 0x27, 0x40, 0xec, 0xfa, 0xed, 0x6c, 0x01, 0xa4, 0x74, 0x64, 0xbb, 0x05, 0x18, 0x23, 0x13, 0xc0, 0x13, 0x38, 0xa8, 0xcd, 0x09, 0x72, 0x14, 0xcd, 0x68, 0xca, 0x10, 0x3b, 0xd5, 0x7d, 0x3b, 0xc9, 0xe8, 0x16, 0x21, 0x3e, 0x61, 0xd7, 0x84, 0xf1, 0x82, 0x46, 0x7a, 0xbf, 0x8a, 0x01, 0xcf, 0x25, 0x3e, 0x99, 0xa1, 0x56, 0xea, 0xa8, 0xe3, 0xe1, 0xf9, 0x0e, 0x3c, 0x6e, 0x4e, 0x3a, 0xa2, 0xd8, 0x3e, 0xd0, 0x34, 0x5b, 0x89, 0xfa, 0xfc, 0x9c, 0x26, 0x07, 0x7c, 0x14, 0xb6, 0xac, 0x51, 0x45, 0x4f, 0xa2, 0x6e, 0x44, 0x6e, 0x3a, 0x2f, 0x15, 0x3b, 0x2b, 0x16, 0x79, 0x7f } + +} +, +{ + "RSASSA-PSS Signature Example 3.2", + /* Message to be signed */ + 29, + { 0x8b, 0x76, 0x95, 0x28, 0x88, 0x4a, 0x0d, 0x1f, 0xfd, 0x09, 0x0c, 0xf1, 0x02, 0x99, 0x3e, 0x79, 0x6d, 0xad, 0xcf, 0xbd, 0xdd, 0x38, 0xe4, 0x4f, 0xf6, 0x32, 0x4c, 0xa4, 0x51 } +, + /* Salt */ + 20, + { 0xfc, 0xf9, 0xf0, 0xe1, 0xf1, 0x99, 0xa3, 0xd1, 0xd0, 0xda, 0x68, 0x1c, 0x5b, 0x86, 0x06, 0xfc, 0x64, 0x29, 0x39, 0xf7 } +, + /* Signature */ + 129, + { 0x02, 0xa5, 0xf0, 0xa8, 0x58, 0xa0, 0x86, 0x4a, 0x4f, 0x65, 0x01, 0x7a, 0x7d, 0x69, 0x45, 0x4f, 0x3f, 0x97, 0x3a, 0x29, 0x99, 0x83, 0x9b, 0x7b, 0xbc, 0x48, 0xbf, 0x78, 0x64, 0x11, 0x69, 0x17, 0x95, 0x56, 0xf5, 0x95, 0xfa, 0x41, 0xf6, 0xff, 0x18, 0xe2, 0x86, 0xc2, 0x78, 0x30, 0x79, 0xbc, 0x09, 0x10, 0xee, 0x9c, 0xc3, 0x4f, 0x49, 0xba, 0x68, 0x11, 0x24, 0xf9, 0x23, 0xdf, 0xa8, 0x8f, 0x42, 0x61, 0x41, 0xa3, 0x68, 0xa5, 0xf5, 0xa9, 0x30, 0xc6, 0x28, 0xc2, 0xc3, 0xc2, 0x00, 0xe1, 0x8a, 0x76, 0x44, 0x72, 0x1a, 0x0c, 0xbe, 0xc6, 0xdd, 0x3f, 0x62, 0x79, 0xbd, 0xe3, 0xe8, 0xf2, 0xbe, 0x5e, 0x2d, 0x4e, 0xe5, 0x6f, 0x97, 0xe7, 0xce, 0xaf, 0x33, 0x05, 0x4b, 0xe7, 0x04, 0x2b, 0xd9, 0x1a, 0x63, 0xbb, 0x09, 0xf8, 0x97, 0xbd, 0x41, 0xe8, 0x11, 0x97, 0xde, 0xe9, 0x9b, 0x11, 0xaf } + +} +, +{ + "RSASSA-PSS Signature Example 3.3", + /* Message to be signed */ + 167, + { 0x1a, 0xbd, 0xba, 0x48, 0x9c, 0x5a, 0xda, 0x2f, 0x99, 0x5e, 0xd1, 0x6f, 0x19, 0xd5, 0xa9, 0x4d, 0x9e, 0x6e, 0xc3, 0x4a, 0x8d, 0x84, 0xf8, 0x45, 0x57, 0xd2, 0x6e, 0x5e, 0xf9, 0xb0, 0x2b, 0x22, 0x88, 0x7e, 0x3f, 0x9a, 0x4b, 0x69, 0x0a, 0xd1, 0x14, 0x92, 0x09, 0xc2, 0x0c, 0x61, 0x43, 0x1f, 0x0c, 0x01, 0x7c, 0x36, 0xc2, 0x65, 0x7b, 0x35, 0xd7, 0xb0, 0x7d, 0x3f, 0x5a, 0xd8, 0x70, 0x85, 0x07, 0xa9, 0xc1, 0xb8, 0x31, 0xdf, 0x83, 0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7, 0x54, 0x8a, 0xea, 0x8e, 0xa4, 0xec, 0xad, 0x2c, 0x29, 0xdd, 0x9f, 0x95, 0xbc, 0x07, 0xfe, 0x91, 0xec, 0xf8, 0xbe, 0xe2, 0x55, 0xbf, 0xe8, 0x76, 0x2f, 0xd7, 0x69, 0x0a, 0xa9, 0xbf, 0xa4, 0xfa, 0x08, 0x49, 0xef, 0x72, 0x8c, 0x2c, 0x42, 0xc4, 0x53, 0x23, 0x64, 0x52, 0x2d, 0xf2, 0xab, 0x7f, 0x9f, 0x8a, 0x03, 0xb6, 0x3f, 0x7a, 0x49, 0x91, 0x75, 0x82, 0x86, 0x68, 0xf5, 0xef, 0x5a, 0x29, 0xe3, 0x80, 0x2c } + +} +, +{ + "RSASSA-PSS Signature Example 3.4", + /* Message to be signed */ + 73, + { 0x8f, 0xb4, 0x31, 0xf5, 0xee, 0x79, 0x2b, 0x6c, 0x2a, 0xc7, 0xdb, 0x53, 0xcc, 0x42, 0x86, 0x55, 0xae, 0xb3, 0x2d, 0x03, 0xf4, 0xe8, 0x89, 0xc5, 0xc2, 0x5d, 0xe6, 0x83, 0xc4, 0x61, 0xb5, 0x3a, 0xcf, 0x89, 0xf9, 0xf8, 0xd3, 0xaa, 0xbd, 0xf6, 0xb9, 0xf0, 0xc2, 0xa1, 0xde, 0x12, 0xe1, 0x5b, 0x49, 0xed, 0xb3, 0x91, 0x9a, 0x65, 0x2f, 0xe9, 0x49, 0x1c, 0x25, 0xa7, 0xfc, 0xe1, 0xf7, 0x22, 0xc2, 0x54, 0x36, 0x08, 0xb6, 0x9d, 0xc3, 0x75, 0xec } +, + /* Salt */ + 20, + { 0xf8, 0x31, 0x2d, 0x9c, 0x8e, 0xea, 0x13, 0xec, 0x0a, 0x4c, 0x7b, 0x98, 0x12, 0x0c, 0x87, 0x50, 0x90, 0x87, 0xc4, 0x78 } +, + /* Signature */ + 129, + { 0x01, 0x96, 0xf1, 0x2a, 0x00, 0x5b, 0x98, 0x12, 0x9c, 0x8d, 0xf1, 0x3c, 0x4c, 0xb1, 0x6f, 0x8a, 0xa8, 0x87, 0xd3, 0xc4, 0x0d, 0x96, 0xdf, 0x3a, 0x88, 0xe7, 0x53, 0x2e, 0xf3, 0x9c, 0xd9, 0x92, 0xf2, 0x73, 0xab, 0xc3, 0x70, 0xbc, 0x1b, 0xe6, 0xf0, 0x97, 0xcf, 0xeb, 0xbf, 0x01, 0x18, 0xfd, 0x9e, 0xf4, 0xb9, 0x27, 0x15, 0x5f, 0x3d, 0xf2, 0x2b, 0x90, 0x4d, 0x90, 0x70, 0x2d, 0x1f, 0x7b, 0xa7, 0xa5, 0x2b, 0xed, 0x8b, 0x89, 0x42, 0xf4, 0x12, 0xcd, 0x7b, 0xd6, 0x76, 0xc9, 0xd1, 0x8e, 0x17, 0x03, 0x91, 0xdc, 0xd3, 0x45, 0xc0, 0x6a, 0x73, 0x09, 0x64, 0xb3, 0xf3, 0x0b, 0xcc, 0xe0, 0xbb, 0x20, 0xba, 0x10, 0x6f, 0x9a, 0xb0, 0xee, 0xb3, 0x9c, 0xf8, 0xa6, 0x60, 0x7f, 0x75, 0xc0, 0x34, 0x7f, 0x0a, 0xf7, 0x9f, 0x16, 0xaf, 0xa0, 0x81, 0xd2, 0xc9, 0x2d, 0x1e, 0xe6, 0xf8, 0x36, 0xb8 } + +} +, +{ + "RSASSA-PSS Signature Example 3.5", + /* Message to be signed */ + 115, + { 0xfe, 0xf4, 0x16, 0x1d, 0xfa, 0xaf, 0x9c, 0x52, 0x95, 0x05, 0x1d, 0xfc, 0x1f, 0xf3, 0x81, 0x0c, 0x8c, 0x9e, 0xc2, 0xe8, 0x66, 0xf7, 0x07, 0x54, 0x22, 0xc8, 0xec, 0x42, 0x16, 0xa9, 0xc4, 0xff, 0x49, 0x42, 0x7d, 0x48, 0x3c, 0xae, 0x10, 0xc8, 0x53, 0x4a, 0x41, 0xb2, 0xfd, 0x15, 0xfe, 0xe0, 0x69, 0x60, 0xec, 0x6f, 0xb3, 0xf7, 0xa7, 0xe9, 0x4a, 0x2f, 0x8a, 0x2e, 0x3e, 0x43, 0xdc, 0x4a, 0x40, 0x57, 0x6c, 0x30, 0x97, 0xac, 0x95, 0x3b, 0x1d, 0xe8, 0x6f, 0x0b, 0x4e, 0xd3, 0x6d, 0x64, 0x4f, 0x23, 0xae, 0x14, 0x42, 0x55, 0x29, 0x62, 0x24, 0x64, 0xca, 0x0c, 0xbf, 0x0b, 0x17, 0x41, 0x34, 0x72, 0x38, 0x15, 0x7f, 0xab, 0x59, 0xe4, 0xde, 0x55, 0x24, 0x09, 0x6d, 0x62, 0xba, 0xec, 0x63, 0xac, 0x64 } +, + /* Salt */ + 20, + { 0x50, 0x32, 0x7e, 0xfe, 0xc6, 0x29, 0x2f, 0x98, 0x01, 0x9f, 0xc6, 0x7a, 0x2a, 0x66, 0x38, 0x56, 0x3e, 0x9b, 0x6e, 0x2d } +, + /* Signature */ + 129, + { 0x02, 0x1e, 0xca, 0x3a, 0xb4, 0x89, 0x22, 0x64, 0xec, 0x22, 0x41, 0x1a, 0x75, 0x2d, 0x92, 0x22, 0x10, 0x76, 0xd4, 0xe0, 0x1c, 0x0e, 0x6f, 0x0d, 0xde, 0x9a, 0xfd, 0x26, 0xba, 0x5a, 0xcf, 0x6d, 0x73, 0x9e, 0xf9, 0x87, 0x54, 0x5d, 0x16, 0x68, 0x3e, 0x56, 0x74, 0xc9, 0xe7, 0x0f, 0x1d, 0xe6, 0x49, 0xd7, 0xe6, 0x1d, 0x48, 0xd0, 0xca, 0xeb, 0x4f, 0xb4, 0xd8, 0xb2, 0x4f, 0xba, 0x84, 0xa6, 0xe3, 0x10, 0x8f, 0xee, 0x7d, 0x07, 0x05, 0x97, 0x32, 0x66, 0xac, 0x52, 0x4b, 0x4a, 0xd2, 0x80, 0xf7, 0xae, 0x17, 0xdc, 0x59, 0xd9, 0x6d, 0x33, 0x51, 0x58, 0x6b, 0x5a, 0x3b, 0xdb, 0x89, 0x5d, 0x1e, 0x1f, 0x78, 0x20, 0xac, 0x61, 0x35, 0xd8, 0x75, 0x34, 0x80, 0x99, 0x83, 0x82, 0xba, 0x32, 0xb7, 0x34, 0x95, 0x59, 0x60, 0x8c, 0x38, 0x74, 0x52, 0x90, 0xa8, 0x5e, 0xf4, 0xe9, 0xf9, 0xbd, 0x83 } + +} +, +{ + "RSASSA-PSS Signature Example 3.6", + /* Message to be signed */ + 22, + { 0xef, 0xd2, 0x37, 0xbb, 0x09, 0x8a, 0x44, 0x3a, 0xee, 0xb2, 0xbf, 0x6c, 0x3f, 0x8c, 0x81, 0xb8, 0xc0, 0x1b, 0x7f, 0xcb, 0x3f, 0xeb } +, + /* Salt */ + 20, + { 0xb0, 0xde, 0x3f, 0xc2, 0x5b, 0x65, 0xf5, 0xaf, 0x96, 0xb1, 0xd5, 0xcc, 0x3b, 0x27, 0xd0, 0xc6, 0x05, 0x30, 0x87, 0xb3 } +, + /* Signature */ + 129, + { 0x01, 0x2f, 0xaf, 0xec, 0x86, 0x2f, 0x56, 0xe9, 0xe9, 0x2f, 0x60, 0xab, 0x0c, 0x77, 0x82, 0x4f, 0x42, 0x99, 0xa0, 0xca, 0x73, 0x4e, 0xd2, 0x6e, 0x06, 0x44, 0xd5, 0xd2, 0x22, 0xc7, 0xf0, 0xbd, 0xe0, 0x39, 0x64, 0xf8, 0xe7, 0x0a, 0x5c, 0xb6, 0x5e, 0xd4, 0x4e, 0x44, 0xd5, 0x6a, 0xe0, 0xed, 0xf1, 0xff, 0x86, 0xca, 0x03, 0x2c, 0xc5, 0xdd, 0x44, 0x04, 0xdb, 0xb7, 0x6a, 0xb8, 0x54, 0x58, 0x6c, 0x44, 0xee, 0xd8, 0x33, 0x6d, 0x08, 0xd4, 0x57, 0xce, 0x6c, 0x03, 0x69, 0x3b, 0x45, 0xc0, 0xf1, 0xef, 0xef, 0x93, 0x62, 0x4b, 0x95, 0xb8, 0xec, 0x16, 0x9c, 0x61, 0x6d, 0x20, 0xe5, 0x53, 0x8e, 0xbc, 0x0b, 0x67, 0x37, 0xa6, 0xf8, 0x2b, 0x4b, 0xc0, 0x57, 0x09, 0x24, 0xfc, 0x6b, 0x35, 0x75, 0x9a, 0x33, 0x48, 0x42, 0x62, 0x79, 0xf8, 0xb3, 0xd7, 0x74, 0x4e, 0x2d, 0x22, 0x24, 0x26, 0xce } + +} +, +} +}, +{ + "Example 4: A 1027-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x05, 0x4a, 0xdb, 0x78, 0x86, 0x44, 0x7e, 0xfe, 0x6f, 0x57, 0xe0, 0x36, 0x8f, 0x06, 0xcf, 0x52, 0xb0, 0xa3, 0x37, 0x07, 0x60, 0xd1, 0x61, 0xce, 0xf1, 0x26, 0xb9, 0x1b, 0xe7, 0xf8, 0x9c, 0x42, 0x1b, 0x62, 0xa6, 0xec, 0x1d, 0xa3, 0xc3, 0x11, 0xd7, 0x5e, 0xd5, 0x0e, 0x0a, 0xb5, 0xff, 0xf3, 0xfd, 0x33, 0x8a, 0xcc, 0x3a, 0xa8, 0xa4, 0xe7, 0x7e, 0xe2, 0x63, 0x69, 0xac, 0xb8, 0x1b, 0xa9, 0x00, 0xfa, 0x83, 0xf5, 0x30, 0x0c, 0xf9, 0xbb, 0x6c, 0x53, 0xad, 0x1d, 0xc8, 0xa1, 0x78, 0xb8, 0x15, 0xdb, 0x42, 0x35, 0xa9, 0xa9, 0xda, 0x0c, 0x06, 0xde, 0x4e, 0x61, 0x5e, 0xa1, 0x27, 0x7c, 0xe5, 0x59, 0xe9, 0xc1, 0x08, 0xde, 0x58, 0xc1, 0x4a, 0x81, 0xaa, 0x77, 0xf5, 0xa6, 0xf8, 0xd1, 0x33, 0x54, 0x94, 0x49, 0x88, 0x48, 0xc8, 0xb9, 0x59, 0x40, 0x74, 0x0b, 0xe7, 0xbf, 0x7c, 0x37, 0x05 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0xfa, 0x04, 0x1f, 0x8c,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x1a, 0x5e, 0xa8, 0xd1, 0x48, 0x41, 0x39, 0x95 } +, + /* Prime q */ + 65, + { 0x02, 0x0e, 0xf5, 0xef, 0xe7, 0xc5, 0x39, 0x4a, 0xed, 0x22, 0x72, 0xf7, 0xe8, 0x1a, 0x74, 0xf4, 0xc0, 0x2d, 0x14, 0x58, 0x94, 0xcb, 0x1b, 0x3c, 0xab, 0x23, 0xa9, 0xa0, 0x71, 0x0a, 0x2a, 0xfc, 0x7e, 0x33, 0x29, 0xac, 0xbb, 0x74, 0x3d, 0x01, 0xf6, 0x80, 0xc4, 0xd0, 0x2a, 0xfb, 0x4c, 0x8f, 0xde, 0x7e, 0x20, 0x93, 0x08, 0x11, 0xbb, 0x2b, 0x99, 0x57, 0x88, 0xb5, 0xe8, 0x72, 0xc2, 0x0b, 0xb1 } +, + /* p's CRT exponent dP */ + 65, + { 0x02, 0x6e, 0x7e, 0x28, 0x01, 0x0e, 0xcf, 0x24, 0x12, 0xd9, 0x52, 0x3a, 0xd7, 0x04, 0x64, 0x7f, 0xb4, 0xfe, 0x9b, 0x66, 0xb1, 0xa6, 0x81, 0x58, 0x1b, 0x0e, 0x15, 0x55, 0x3a, 0x89, 0xb1, 0x54, 0x28, 0x28, 0x89, 0x8f, 0x27, 0x24, 0x3e, 0xba, 0xb4, 0x5f, 0xf5, 0xe1, 0xac, 0xb9, 0xd4, 0xdf, 0x1b, 0x05, 0x1f, 0xbc, 0x62, 0x82, 0x4d, 0xbc, 0x6f, 0x6c, 0x93, 0x26, 0x1a, 0x78, 0xb9, 0xa7, 0x59 } +, + /* q's CRT exponent dQ */ + 65, + { 0x01, 0x2d, 0xdc, 0xc8, 0x6e, 0xf6, 0x55, 0x99, 0x8c, 0x39, 0xdd, 0xae, 0x11, 0x71, 0x86, 0x69, 0xe5, 0xe4, 0x6c, 0xf1, 0x49, 0x5b, 0x07, 0xe1, 0x3b, 0x10, 0x14, 0xcd, 0x69, 0xb3, 0xaf, 0x68, 0x30, 0x4a, 0xd2, 0xa6, 0xb6, 0x43, 0x21, 0xe7, 0x8b, 0xf3, 0xbb, 0xca, 0x9b, 0xb4, 0x94, 0xe9, 0x1d, 0x45, 0x17, 0x17, 0xe2, 0xd9, 0x75, 0x64, 0xc6, 0x54, 0x94, 0x65, 0xd0, 0x20, 0x5c, 0xf4, 0x21 } +, + /* CRT coefficient qInv */ + 65, + { 0x01, 0x06, 0x00, 0xc4, 0xc2, 0x18, 0x47, 0x45, 0x9f, 0xe5, 0x76, 0x70, 0x3e, 0x2e, 0xbe, 0xca, 0xe8, 0xa5, 0x09, 0x4e, 0xe6, 0x3f, 0x53, 0x6b, 0xf4, 0xac, 0x68, 0xd3, 0xc1, 0x3e, 0x5e, 0x4f, 0x12, 0xac, 0x5c, 0xc1, 0x0a, 0xb6, 0xa2, 0xd0, 0x5a, 0x19, 0x92, 0x14, 0xd1, 0x82, 0x47, 0x47, 0xd5, 0x51, 0x90, 0x96, 0x36, 0xb7, 0x74, 0xc2, 0x2c, 0xac, 0x0b, 0x83, 0x75, 0x99, 0xab, 0xcc, 0x75 } + +} +, +{{ + "RSASSA-PSS Signature Example 4.1", + /* Message to be signed */ + 8, + { 0x9f, 0xb0, 0x3b, 0x82, 0x7c, 0x82, 0x17, 0xd9 } +, + /* Salt */ + 20, + { 0xed, 0x7c, 0x98, 0xc9, 0x5f, 0x30, 0x97, 0x4f, 0xbe, 0x4f, 0xbd, 0xdc, 0xf0, 0xf2, 0x8d, 0x60, 0x21, 0xc0, 0xe9, 0x1d } +, + /* Signature */ + 129, + { 0x03, 0x23, 0xd5, 0xb7, 0xbf, 0x20, 0xba, 0x45, 0x39, 0x28, 0x9a, 0xe4, 0x52, 0xae, 0x42, 0x97, 0x08, 0x0f, 0xef, 0xf4, 0x51, 0x84, 0x23, 0xff, 0x48, 0x11, 0xa8, 0x17, 0x83, 0x7e, 0x7d, 0x82, 0xf1, 0x83, 0x6c, 0xdf, 0xab, 0x54, 0x51, 0x4f, 0xf0, 0x88, 0x7b, 0xdd, 0xee, 0xbf, 0x40, 0xbf, 0x99, 0xb0, 0x47, 0xab, 0xc3, 0xec, 0xfa, 0x6a, 0x37, 0xa3, 0xef, 0x00, 0xf4, 0xa0, 0xc4, 0xa8, 0x8a, 0xae, 0x09, 0x04, 0xb7, 0x45, 0xc8, 0x46, 0xc4, 0x10, 0x7e, 0x87, 0x97, 0x72, 0x3e, 0x8a, 0xc8, 0x10, 0xd9, 0xe3, 0xd9, 0x5d, 0xfa, 0x30, 0xff, 0x49, 0x66, 0xf4, 0xd7, 0x5d, 0x13, 0x76, 0x8d, 0x20, 0x85, 0x7f, 0x2b, 0x14, 0x06, 0xf2, 0x64, 0xcf, 0xe7, 0x5e, 0x27, 0xd7, 0x65, 0x2f, 0x4b, 0x5e, 0xd3, 0x57, 0x5f, 0x28, 0xa7, 0x02, 0xf8, 0xc4, 0xed, 0x9c, 0xf9, 0xb2, 0xd4, 0x49, 0x48 } + +} +, +{ + "RSASSA-PSS Signature Example 4.2", + /* Message to be signed */ + 167, + { 0x0c, 0xa2, 0xad, 0x77, 0x79, 0x7e, 0xce, 0x86, 0xde, 0x5b, 0xf7, 0x68, 0x75, 0x0d, 0xdb, 0x5e, 0xd6, 0xa3, 0x11, 0x6a, 0xd9, 0x9b, 0xbd, 0x17, 0xed, 0xf7, 0xf7, 0x82, 0xf0, 0xdb, 0x1c, 0xd0, 0x5b, 0x0f, 0x67, 0x74, 0x68, 0xc5, 0xea, 0x42, 0x0d, 0xc1, 0x16, 0xb1, 0x0e, 0x80, 0xd1, 0x10, 0xde, 0x2b, 0x04, 0x61, 0xea, 0x14, 0xa3, 0x8b, 0xe6, 0x86, 0x20, 0x39, 0x2e, 0x7e, 0x89, 0x3c, 0xb4, 0xea, 0x93, 0x93, 0xfb, 0x88, 0x6c, 0x20, 0xff, 0x79, 0x06, 0x42, 0x30, 0x5b, 0xf3, 0x02, 0x00, 0x38, 0x92, 0xe5, 0x4d, 0xf9, 0xf6, 0x67, 0x50, 0x9d, 0xc5, 0x39, 0x20, 0xdf, 0x58, 0x3f, 0x50, 0xa3, 0xdd, 0x61, 0xab, 0xb6, 0xfa, 0xb7, 0x5d, 0x60, 0x03, 0x77, 0xe3, 0x83, 0xe6, 0xac, 0xa6, 0x71, 0x0e, 0xee, 0xa2, 0x71, 0x56, 0xe0, 0x67, 0x52, 0xc9, 0x4c, 0xe2, 0x5a, 0xe9, 0x9f, 0xcb, 0xf8, 0x59, 0x2d, 0xbe, 0x2d, 0x7e, 0x27, 0x45, 0x3c, 0xb4, 0x4d, 0xe0, 0x71, 0x00, 0xeb, 0xb1, 0xa2, 0xa1, 0x98, 0x11, 0xa4, 0x78, 0xad, 0xbe, 0xab, 0x27, 0x0f, 0x94, 0xe8, 0xfe, 0x36, 0x9d, 0x90, 0xb3, 0xca, 0x61, 0x2f, 0x9f } +, + /* Salt */ + 20, + { 0x22, 0xd7, 0x1d, 0x54, 0x36, 0x3a, 0x42, 0x17, 0xaa, 0x55, 0x11, 0x3f, 0x05, 0x9b, 0x33, 0x84, 0xe3, 0xe5, 0x7e, 0x44 } +, + /* Signature */ + 129, + { 0x04, 0x9d, 0x01, 0x85, 0x84, 0x5a, 0x26, 0x4d, 0x28, 0xfe, 0xb1, 0xe6, 0x9e, 0xda, 0xec, 0x09, 0x06, 0x09, 0xe8, 0xe4, 0x6d, 0x93, 0xab, 0xb3, 0x83, 0x71, 0xce, 0x51, 0xf4, 0xaa, 0x65, 0xa5, 0x99, 0xbd, 0xaa, 0xa8, 0x1d, 0x24, 0xfb, 0xa6, 0x6a, 0x08, 0xa1, 0x16, 0xcb, 0x64, 0x4f, 0x3f, 0x1e, 0x65, 0x3d, 0x95, 0xc8, 0x9d, 0xb8, 0xbb, 0xd5, 0xda, 0xac, 0x27, 0x09, 0xc8, 0x98, 0x40, 0x00, 0x17, 0x84, 0x10, 0xa7, 0xc6, 0xaa, 0x86, 0x67, 0xdd, 0xc3, 0x8c, 0x74, 0x1f, 0x71, 0x0e, 0xc8, 0x66, 0x5a, 0xa9, 0x05, 0x2b, 0xe9, 0x29, 0xd4, 0xe3, 0xb1, 0x67, 0x82, 0xc1, 0x66, 0x21, 0x14, 0xc5, 0x41, 0x4b, 0xb0, 0x35, 0x34, 0x55, 0xc3, 0x92, 0xfc, 0x28, 0xf3, 0xdb, 0x59, 0x05, 0x4b, 0x5f, 0x36, 0x5c, 0x49, 0xe1, 0xd1, 0x56, 0xf8, 0x76, 0xee, 0x10, 0xcb, 0x4f, 0xd7, 0x05, 0x98 } + +} +, +{ + "RSASSA-PSS Signature Example 4.3", + /* Message to be signed */ + 83, + { 0x28, 0x80, 0x62, 0xaf, 0xc0, 0x8f, 0xcd, 0xb7, 0xc5, 0xf8, 0x65, 0x0b, 0x29, 0x83, 0x73, 0x00, 0x46, 0x1d, 0xd5, 0x67, 0x6c, 0x17, 0xa2, 0x0a, 0x3c, 0x8f, 0xb5, 0x14, 0x89, 0x49, 0xe3, 0xf7, 0x3d, 0x66, 0xb3, 0xae, 0x82, 0xc7, 0x24, 0x0e, 0x27, 0xc5, 0xb3, 0xec, 0x43, 0x28, 0xee, 0x7d, 0x6d, 0xdf, 0x6a, 0x6a, 0x0c, 0x9b, 0x5b, 0x15, 0xbc, 0xda, 0x19, 0x6a, 0x9d, 0x0c, 0x76, 0xb1, 0x19, 0xd5, 0x34, 0xd8, 0x5a, 0xbd, 0x12, 0x39, 0x62, 0xd5, 0x83, 0xb7, 0x6c, 0xe9, 0xd1, 0x80, 0xbc, 0xe1, 0xca } +, + /* Salt */ + 20, + { 0x4a, 0xf8, 0x70, 0xfb, 0xc6, 0x51, 0x60, 0x12, 0xca, 0x91, 0x6c, 0x70, 0xba, 0x86, 0x2a, 0xc7, 0xe8, 0x24, 0x36, 0x17 } +, + /* Signature */ + 129, + { 0x03, 0xfb, 0xc4, 0x10, 0xa2, 0xce, 0xd5, 0x95, 0x00, 0xfb, 0x99, 0xf9, 0xe2, 0xaf, 0x27, 0x81, 0xad, 0xa7, 0x4e, 0x13, 0x14, 0x56, 0x24, 0x60, 0x27, 0x82, 0xe2, 0x99, 0x48, 0x13, 0xee, 0xfc, 0xa0, 0x51, 0x9e, 0xcd, 0x25, 0x3b, 0x85, 0x5f, 0xb6, 0x26, 0xa9, 0x0d, 0x77, 0x1e, 0xae, 0x02, 0x8b, 0x0c, 0x47, 0xa1, 0x99, 0xcb, 0xd9, 0xf8, 0xe3, 0x26, 0x97, 0x34, 0xaf, 0x41, 0x63, 0x59, 0x90, 0x90, 0x71, 0x3a, 0x3f, 0xa9, 0x10, 0xfa, 0x09, 0x60, 0x65, 0x27, 0x21, 0x43, 0x2b, 0x97, 0x10, 0x36, 0xa7, 0x18, 0x1a, 0x2b, 0xc0, 0xca, 0xb4, 0x3b, 0x0b, 0x59, 0x8b, 0xc6, 0x21, 0x74, 0x61, 0xd7, 0xdb, 0x30, 0x5f, 0xf7, 0xe9, 0x54, 0xc5, 0xb5, 0xbb, 0x23, 0x1c, 0x39, 0xe7, 0x91, 0xaf, 0x6b, 0xcf, 0xa7, 0x6b, 0x14, 0x7b, 0x08, 0x13, 0x21, 0xf7, 0x26, 0x41, 0x48, 0x2a, 0x2a, 0xad } + +} +, +{ + "RSASSA-PSS Signature Example 4.4", + /* Message to be signed */ + 49, + { 0x6f, 0x4f, 0x9a, 0xb9, 0x50, 0x11, 0x99, 0xce, 0xf5, 0x5c, 0x6c, 0xf4, 0x08, 0xfe, 0x7b, 0x36, 0xc5, 0x57, 0xc4, 0x9d, 0x42, 0x0a, 0x47, 0x63, 0xd2, 0x46, 0x3c, 0x8a, 0xd4, 0x4b, 0x3c, 0xfc, 0x5b, 0xe2, 0x74, 0x2c, 0x0e, 0x7d, 0x9b, 0x0f, 0x66, 0x08, 0xf0, 0x8c, 0x7f, 0x47, 0xb6, 0x93, 0xee } +, + /* Salt */ + 20, + { 0x40, 0xd2, 0xe1, 0x80, 0xfa, 0xe1, 0xea, 0xc4, 0x39, 0xc1, 0x90, 0xb5, 0x6c, 0x2c, 0x0e, 0x14, 0xdd, 0xf9, 0xa2, 0x26 } +, + /* Signature */ + 129, + { 0x04, 0x86, 0x64, 0x4b, 0xc6, 0x6b, 0xf7, 0x5d, 0x28, 0x33, 0x5a, 0x61, 0x79, 0xb1, 0x08, 0x51, 0xf4, 0x3f, 0x09, 0xbd, 0xed, 0x9f, 0xac, 0x1a, 0xf3, 0x32, 0x52, 0xbb, 0x99, 0x53, 0xba, 0x42, 0x98, 0xcd, 0x64, 0x66, 0xb2, 0x75, 0x39, 0xa7, 0x0a, 0xda, 0xa3, 0xf8, 0x9b, 0x3d, 0xb3, 0xc7, 0x4a, 0xb6, 0x35, 0xd1, 0x22, 0xf4, 0xee, 0x7c, 0xe5, 0x57, 0xa6, 0x1e, 0x59, 0xb8, 0x2f, 0xfb, 0x78, 0x66, 0x30, 0xe5, 0xf9, 0xdb, 0x53, 0xc7, 0x7d, 0x9a, 0x0c, 0x12, 0xfa, 0xb5, 0x95, 0x8d, 0x4c, 0x2c, 0xe7, 0xda, 0xa8, 0x07, 0xcd, 0x89, 0xba, 0x2c, 0xc7, 0xfc, 0xd0, 0x2f, 0xf4, 0x70, 0xca, 0x67, 0xb2, 0x29, 0xfc, 0xce, 0x81, 0x4c, 0x85, 0x2c, 0x73, 0xcc, 0x93, 0xbe, 0xa3, 0x5b, 0xe6, 0x84, 0x59, 0xce, 0x47, 0x8e, 0x9d, 0x46, 0x55, 0xd1, 0x21, 0xc8, 0x47, 0x2f, 0x37, 0x1d, 0x4f } + +} +, +{ + "RSASSA-PSS Signature Example 4.5", + /* Message to be signed */ + 187, + { 0xe1, 0x7d, 0x20, 0x38, 0x5d, 0x50, 0x19, 0x55, 0x82, 0x3c, 0x3f, 0x66, 0x62, 0x54, 0xc1, 0xd3, 0xdd, 0x36, 0xad, 0x51, 0x68, 0xb8, 0xf1, 0x8d, 0x28, 0x6f, 0xdc, 0xf6, 0x7a, 0x7d, 0xad, 0x94, 0x09, 0x70, 0x85, 0xfa, 0xb7, 0xed, 0x86, 0xfe, 0x21, 0x42, 0xa2, 0x87, 0x71, 0x71, 0x79, 0x97, 0xef, 0x1a, 0x7a, 0x08, 0x88, 0x4e, 0xfc, 0x39, 0x35, 0x6d, 0x76, 0x07, 0x7a, 0xaf, 0x82, 0x45, 0x9a, 0x7f, 0xad, 0x45, 0x84, 0x88, 0x75, 0xf2, 0x81, 0x9b, 0x09, 0x89, 0x37, 0xfe, 0x92, 0x3b, 0xcc, 0x9d, 0xc4, 0x42, 0xd7, 0x2d, 0x75, 0x4d, 0x81, 0x20, 0x25, 0x09, 0x0c, 0x9b, 0xc0, 0x3d, 0xb3, 0x08, 0x0c, 0x13, 0x8d, 0xd6, 0x3b, 0x35, 0x5d, 0x0b, 0x4b, 0x85, 0xd6, 0x68, 0x8a, 0xc1, 0x9f, 0x4d, 0xe1, 0x50, 0x84, 0xa0, 0xba, 0x4e, 0x37, 0x3b, 0x93, 0xef, 0x4a, 0x55, 0x50, 0x96, 0x69, 0x19, 0x15, 0xdc, 0x23, 0xc0, 0x0e, 0x95, 0x4c, 0xde, 0xb2, 0x0a, 0x47, 0xcd, 0x55, 0xd1, 0x6c, 0x3d, 0x86, 0x81, 0xd4, 0x6e, 0xd7, 0xf2, 0xed, 0x5e, 0xa4, 0x27, 0x95, 0xbe, 0x17, 0xba, 0xed, 0x25, 0xf0, 0xf4, 0xd1, 0x13, 0xb3, 0x63, 0x6a, 0xdd, 0xd5, 0x85, 0xf1, 0x6a, 0x8b, 0x5a, 0xec, 0x0c, 0x8f, 0xa9, 0xc5, 0xf0, 0x3c, 0xbf, 0x3b, 0x9b, 0x73 } +, + /* Salt */ + 20, + { 0x24, 0x97, 0xdc, 0x2b, 0x46, 0x15, 0xdf, 0xae, 0x5a, 0x66, 0x3d, 0x49, 0xff, 0xd5, 0x6b, 0xf7, 0xef, 0xc1, 0x13, 0x04 } +, + /* Signature */ + 129, + { 0x02, 0x2a, 0x80, 0x04, 0x53, 0x53, 0x90, 0x4c, 0xb3, 0x0c, 0xbb, 0x54, 0x2d, 0x7d, 0x49, 0x90, 0x42, 0x1a, 0x6e, 0xec, 0x16, 0xa8, 0x02, 0x9a, 0x84, 0x22, 0xad, 0xfd, 0x22, 0xd6, 0xaf, 0xf8, 0xc4, 0xcc, 0x02, 0x94, 0xaf, 0x11, 0x0a, 0x0c, 0x06, 0x7e, 0xc8, 0x6a, 0x7d, 0x36, 0x41, 0x34, 0x45, 0x9b, 0xb1, 0xae, 0x8f, 0xf8, 0x36, 0xd5, 0xa8, 0xa2, 0x57, 0x98, 0x40, 0x99, 0x6b, 0x32, 0x0b, 0x19, 0xf1, 0x3a, 0x13, 0xfa, 0xd3, 0x78, 0xd9, 0x31, 0xa6, 0x56, 0x25, 0xda, 0xe2, 0x73, 0x9f, 0x0c, 0x53, 0x67, 0x0b, 0x35, 0xd9, 0xd3, 0xcb, 0xac, 0x08, 0xe7, 0x33, 0xe4, 0xec, 0x2b, 0x83, 0xaf, 0x4b, 0x91, 0x96, 0xd6, 0x3e, 0x7c, 0x4f, 0xf1, 0xdd, 0xea, 0xe2, 0xa1, 0x22, 0x79, 0x1a, 0x12, 0x5b, 0xfe, 0xa8, 0xde, 0xb0, 0xde, 0x8c, 0xcf, 0x1f, 0x4f, 0xfa, 0xf6, 0xe6, 0xfb, 0x0a } + +} +, +{ + "RSASSA-PSS Signature Example 4.6", + /* Message to be signed */ + 166, + { 0xaf, 0xbc, 0x19, 0xd4, 0x79, 0x24, 0x90, 0x18, 0xfd, 0xf4, 0xe0, 0x9f, 0x61, 0x87, 0x26, 0x44, 0x04, 0x95, 0xde, 0x11, 0xdd, 0xee, 0xe3, 0x88, 0x72, 0xd7, 0x75, 0xfc, 0xea, 0x74, 0xa2, 0x38, 0x96, 0xb5, 0x34, 0x3c, 0x9c, 0x38, 0xd4, 0x6a, 0xf0, 0xdb, 0xa2, 0x24, 0xd0, 0x47, 0x58, 0x0c, 0xc6, 0x0a, 0x65, 0xe9, 0x39, 0x1c, 0xf9, 0xb5, 0x9b, 0x36, 0xa8, 0x60, 0x59, 0x8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x73, 0x7d, 0x20, 0x23, 0x07, 0x5c, 0x05, 0xec, 0xf0, 0x4a, 0x02, 0x8c, 0x68, 0x6a, 0x2a, 0xb3, 0xe7, 0xd5, 0xa0, 0x66, 0x4f, 0x29, 0x5c, 0xe1, 0x29, 0x95, 0xe8, 0x90, 0x90, 0x8b, 0x6a, 0xd2, 0x1f, 0x08, 0x39, 0xeb, 0x65, 0xb7, 0x03, 0x93, 0xa7, 0xb5, 0xaf, 0xd9, 0x87, 0x1d, 0xe0, 0xca, 0xa0, 0xce, 0xde, 0xc5, 0xb8, 0x19, 0x62, 0x67, 0x56, 0x20, 0x9d, 0x13, 0xab, 0x1e, 0x7b, 0xb9, 0x54, 0x6a, 0x26, 0xff, 0x37, 0xe9, 0xa5, 0x1a, 0xf9, 0xfd, 0x56, 0x2e } + +} +, +} +}, +{ + "Example 5: A 1028-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x0d, 0x10, 0xf6, 0x61, 0xf2, 0x99, 0x40, 0xf5, 0xed, 0x39, 0xaa, 0x26, 0x09, 0x66, 0xde, 0xb4, 0x78, 0x43, 0x67, 0x9d, 0x2b, 0x6f, 0xb2, 0x5b, 0x3d, 0xe3, 0x70, 0xf3, 0xac, 0x7c, 0x19, 0x91, 0x63, 0x91, 0xfd, 0x25, 0xfb, 0x52, 0x7e, 0xbf, 0xa6, 0xa4, 0xb4, 0xdf, 0x45, 0xa1, 0x75, 0x9d, 0x99, 0x6c, 0x4b, 0xb4, 0xeb, 0xd1, 0x88, 0x28, 0xc4, 0x4f, 0xc5, 0x2d, 0x01, 0x91, 0x87, 0x17, 0x40, 0x52, 0x5f, 0x47, 0xa4, 0xb0, 0xcc, 0x8d, 0xa3, 0x25, 0xed, 0x8a, 0xa6, 0x76, 0xb0, 0xd0, 0xf6, 0x26, 0xe0, 0xa7, 0x7f, 0x07, 0x69, 0x21, 0x70, 0xac, 0xac, 0x80, 0x82, 0xf4, 0x2f, 0xaa, 0x7d, 0xc7, 0xcd, 0x12, 0x3e, 0x73, 0x0e, 0x31, 0xa8, 0x79, 0x85, 0x20, 0x4c, 0xab, 0xcb, 0xe6, 0x67, 0x0d, 0x43, 0xa2, 0xdd, 0x2b, 0x2d, 0xde, 0xf5, 0xe0, 0x53, 0x92, 0xfc, 0x21, 0x3b, 0xc5, 0x07 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 129, + { 0x03, 0xce, 0x08, 0xb1, 0x04, 0xff, 0xf3, 0x96, 0xa9, 0x79, 0xbd, 0x3e, 0x4e, 0x46, 0x92, 0x5b, 0x63, 0x19, 0xdd, 0xb6, 0x3a, 0xcb, 0xcf, 0xd8, 0x19, 0xf1, 0x7d, 0x16, 0xb8, 0x07, 0x7b, 0x3a, 0x87, 0x10, 0x1f, 0xf3, 0x4b, 0x77, 0xfe, 0x48, 0xb8, 0xb2, 0x05, 0xa9, 0x6e, 0x91, 0x51, 0xba, 0x8e, 0xce, 0xa6, 0x4d, 0x0c, 0xce, 0x7b, 0x23, 0xc3, 0xe6, 0xa6, 0xb8, 0x30, 0x58, 0xbc, 0x49, 0xda, 0xe8, 0x16, 0xae, 0x73, 0x6d, 0xb5, 0xa4, 0x70, 0x8e, 0x2a, 0xd4, 0x35, 0x23, 0x2b, 0x56, 0x7f, 0x90, 0x96, 0xce, 0x59, 0xff, 0x28, 0x06, 0x1e, 0x79, 0xab, 0x1c, 0x02, 0xd7, 0x17, 0xe6, 0xb2, 0x3c, 0xea, 0x6d, 0xb8, 0xeb, 0x51, 0x92, 0xfa, 0x7c, 0x1e, 0xab, 0x22, 0x7d, 0xba, 0x74, 0x62, 0x1c, 0x45, 0x60, 0x18, 0x96, 0xee, 0xf1, 0x37, 0x92, 0xc8, 0x44, 0x0b, 0xeb, 0x15, 0xaa, 0xc1 } +, + /* Prime p */ + 65, + { 0x03, 0xf2, 0xf3, 0x31, 0xf4, 0x14, 0x2d, 0x4f, 0x24, 0xb4, 0x3a, 0xa1, 0x02, 0x79, 0xa8, 0x96, 0x52, 0xd4, 0xe7, 0x53, 0x72, 0x21, 0xa1, 0xa7, 0xb2, 0xa2, 0x5d, 0xeb, 0x55, 0x1e, 0x5d, 0xe9, 0xac, 0x49, 0x74, 0x11, 0xc2, 0x27, 0xa9, 0x4e, 0x45, 0xf9, 0x1c, 0x2d, 0x1c, 0x13, 0xcc, 0x04, 0x6c, 0xf4, 0xce, 0x14, 0xe3, 0x2d, 0x05, 0x87, 0x34, 0x21, 0x0d, 0x44, 0xa8, 0x7e, 0xe1, 0xb7, 0x3f } +, + /* Prime q */ + 65, + { 0x03, 0x4f, 0x09, 0x0d, 0x73, 0xb5, 0x58, 0x03, 0x03, 0x0c, 0xf0, 0x36, 0x1a, 0x5d, 0x80, 0x81, 0xbf, 0xb7, 0x9f, 0x85, 0x15, 0x23, 0xfe, 0xac, 0x0a, 0x21, 0x24, 0xd0, 0x8d, 0x40, 0x13, 0xff, 0x08, 0x48, 0x77, 0x71, 0xa8, 0x70, 0xd0, 0x47, 0x9d, 0xc0, 0x68, 0x6c, 0x62, 0xf7, 0x71, 0x8d, 0xfe, 0xcf, 0x02, 0x4b, 0x17, 0xc9, 0x26, 0x76, 0x78, 0x05, 0x91, 0x71, 0x33, 0x9c, 0xc0, 0x08, 0x39 } +, + /* p's CRT exponent dP */ + 65, + { 0x02, 0xaa, 0x66, 0x3a, 0xdb, 0xf5, 0x1a, 0xb8, 0x87, 0xa0, 0x18, 0xcb, 0x42, 0x6e, 0x78, 0xbc, 0x2f, 0xe1, 0x82, 0xdc, 0xb2, 0xf7, 0xbc, 0xb5, 0x04, 0x41, 0xd1, 0x7f, 0xdf, 0x0f, 0x06, 0x79, 0x8b, 0x50, 0x71, 0xc6, 0xe2, 0xf5, 0xfe, 0xb4, 0xd5, 0x4a, 0xd8, 0x18, 0x23, 0x11, 0xc1, 0xef, 0x62, 0xd4, 0xc4, 0x9f, 0x18, 0xd1, 0xf5, 0x1f, 0x54, 0xb2, 0xd2, 0xcf, 0xfb, 0xa4, 0xda, 0x1b, 0xe5 } +, + /* q's CRT exponent dQ */ + 65, + { 0x02, 0xbb, 0xe7, 0x06, 0x07, 0x8b, 0x5c, 0x0b, 0x39, 0x15, 0x12, 0xd4, 0x11, 0xdb, 0x1b, 0x19, 0x9b, 0x5a, 0x56, 0x64, 0xb8, 0x40, 0x42, 0xea, 0xd3, 0x7f, 0xe9, 0x94, 0xae, 0x72, 0xb9, 0x53, 0x2d, 0xfb, 0xfb, 0x3e, 0x9e, 0x69, 0x81, 0xa0, 0xfb, 0xb8, 0x06, 0x51, 0x31, 0x41, 0xb7, 0xc2, 0x16, 0x3f, 0xe5, 0x6c, 0x39, 0x5e, 0x4b, 0xfa, 0xee, 0x57, 0xe3, 0x83, 0x3f, 0x9b, 0x91, 0x8d, 0xf9 } +, + /* CRT coefficient qInv */ + 64, + { 0x02, 0x42, 0xb6, 0xcd, 0x00, 0xd3, 0x0a, 0x76, 0x7a, 0xee, 0x9a, 0x89, 0x8e, 0xad, 0x45, 0x3c, 0x8e, 0xae, 0xa6, 0x3d, 0x50, 0x0b, 0x7d, 0x1e, 0x00, 0x71, 0x3e, 0xda, 0xe5, 0x1c, 0xe3, 0x6b, 0x23, 0xb6, 0x64, 0xdf, 0x26, 0xe6, 0x3e, 0x26, 0x6e, 0xc8, 0xf7, 0x6e, 0x6e, 0x63, 0xed, 0x1b, 0xa4, 0x1e, 0xb0, 0x33, 0xb1, 0x20, 0xf7, 0xea, 0x52, 0x12, 0xae, 0x21, 0xa9, 0x8f, 0xbc, 0x16 } + +} +, +{{ + "RSASSA-PSS Signature Example 5.1", + /* Message to be signed */ + 154, + { 0x30, 0xc7, 0xd5, 0x57, 0x45, 0x8b, 0x43, 0x6d, 0xec, 0xfd, 0xc1, 0x4d, 0x06, 0xcb, 0x7b, 0x96, 0xb0, 0x67, 0x18, 0xc4, 0x8d, 0x7d, 0xe5, 0x74, 0x82, 0xa8, 0x68, 0xae, 0x7f, 0x06, 0x58, 0x70, 0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 0x17, 0x22, 0xf6, 0x82, 0x3e, 0xeb, 0x6a, 0xdf, 0x7e, 0x0c, 0xa8, 0x29, 0x0f, 0x5d, 0xe3, 0xe5, 0x49, 0x89, 0x0a, 0xc2, 0xa3, 0xc5, 0x95, 0x0a, 0xb2, 0x17, 0xba, 0x58, 0x59, 0x08, 0x94, 0x95, 0x2d, 0xe9, 0x6f, 0x8d, 0xf1, 0x11, 0xb2, 0x57, 0x52, 0x15, 0xda, 0x6c, 0x16, 0x15, 0x90, 0xc7, 0x45, 0xbe, 0x61, 0x24, 0x76, 0xee, 0x57, 0x8e, 0xd3, 0x84, 0xab, 0x33, 0xe3, 0xec, 0xe9, 0x74, 0x81, 0xa2, 0x52, 0xf5, 0xc7, 0x9a, 0x98, 0xb5, 0x53, 0x2a, 0xe0, 0x0c, 0xdd, 0x62, 0xf2, 0xec, 0xc0, 0xcd, 0x1b, 0xae, 0xfe, 0x80, 0xd8, 0x0b, 0x96, 0x21, 0x93, 0xec, 0x1d } + +} +, +{ + "RSASSA-PSS Signature Example 5.2", + /* Message to be signed */ + 209, + { 0xe7, 0xb3, 0x2e, 0x15, 0x56, 0xea, 0x1b, 0x27, 0x95, 0x04, 0x6a, 0xc6, 0x97, 0x39, 0xd2, 0x2a, 0xc8, 0x96, 0x6b, 0xf1, 0x1c, 0x11, 0x6f, 0x61, 0x4b, 0x16, 0x67, 0x40, 0xe9, 0x6b, 0x90, 0x65, 0x3e, 0x57, 0x50, 0x94, 0x5f, 0xcf, 0x77, 0x21, 0x86, 0xc0, 0x37, 0x90, 0xa0, 0x7f, 0xda, 0x32, 0x3e, 0x1a, 0x61, 0x91, 0x6b, 0x06, 0xee, 0x21, 0x57, 0xdb, 0x3d, 0xff, 0x80, 0xd6, 0x7d, 0x5e, 0x39, 0xa5, 0x3a, 0xe2, 0x68, 0xc8, 0xf0, 0x9e, 0xd9, 0x9a, 0x73, 0x20, 0x05, 0xb0, 0xbc, 0x6a, 0x04, 0xaf, 0x4e, 0x08, 0xd5, 0x7a, 0x00, 0xe7, 0x20, 0x1b, 0x30, 0x60, 0xef, 0xaa, 0xdb, 0x73, 0x11, 0x3b, 0xfc, 0x08, 0x7f, 0xd8, 0x37, 0x09, 0x3a, 0xa2, 0x52, 0x35, 0xb8, 0xc1, 0x49, 0xf5, 0x62, 0x15, 0xf0, 0x31, 0xc2, 0x4a, 0xd5, 0xbd, 0xe7, 0xf2, 0x99, 0x60, 0xdf, 0x7d, 0x52, 0x40, 0x70, 0xf7, 0x44, 0x9c, 0x6f, 0x78, 0x50, 0x84, 0xbe, 0x1a, 0x0f, 0x73, 0x30, 0x47, 0xf3, 0x36, 0xf9, 0x15, 0x47, 0x38, 0x67, 0x45, 0x47, 0xdb, 0x02, 0xa9, 0xf4, 0x4d, 0xfc, 0x6e, 0x60, 0x30, 0x10, 0x81, 0xe1, 0xce, 0x99, 0x84, 0x7f, 0x3b, 0x5b, 0x60, 0x1f, 0xf0, 0x6b, 0x4d, 0x57, 0x76, 0xa9, 0x74, 0x0b, 0x9a, 0xa0, 0xd3, 0x40, 0x58, 0xfd, 0x3b, 0x90, 0x6e, 0x4f, 0x78, 0x59, 0xdf, 0xb0, 0x7d, 0x71, 0x73, 0xe5, 0xe6, 0xf6, 0x35, 0x0a, 0xda, 0xc2, 0x1f, 0x27, 0xb2, 0x30, 0x74, 0x69 } +, + /* Salt */ + 20, + { 0xbd, 0x0c, 0xe1, 0x95, 0x49, 0xd0, 0x70, 0x01, 0x20, 0xcb, 0xe5, 0x10, 0x77, 0xdb, 0xbb, 0xb0, 0x0a, 0x8d, 0x8b, 0x09 } +, + /* Signature */ + 129, + { 0x08, 0x18, 0x0d, 0xe8, 0x25, 0xe4, 0xb8, 0xb0, 0x14, 0xa3, 0x2d, 0xa8, 0xba, 0x76, 0x15, 0x55, 0x92, 0x12, 0x04, 0xf2, 0xf9, 0x0d, 0x5f, 0x24, 0xb7, 0x12, 0x90, 0x8f, 0xf8, 0x4f, 0x3e, 0x22, 0x0a, 0xd1, 0x79, 0x97, 0xc0, 0xdd, 0x6e, 0x70, 0x66, 0x30, 0xba, 0x3e, 0x84, 0xad, 0xd4, 0xd5, 0xe7, 0xab, 0x00, 0x4e, 0x58, 0x07, 0x4b, 0x54, 0x97, 0x09, 0x56, 0x5d, 0x43, 0xad, 0x9e, 0x97, 0xb5, 0xa7, 0xa1, 0xa2, 0x9e, 0x85, 0xb9, 0xf9, 0x0f, 0x4a, 0xaf, 0xcd, 0xf5, 0x83, 0x21, 0xde, 0x8c, 0x59, 0x74, 0xef, 0x9a, 0xbf, 0x2d, 0x52, 0x6f, 0x33, 0xc0, 0xf2, 0xf8, 0x2e, 0x95, 0xd1, 0x58, 0xea, 0x6b, 0x81, 0xf1, 0x73, 0x6d, 0xb8, 0xd1, 0xaf, 0x3d, 0x6a, 0xc6, 0xa8, 0x3b, 0x32, 0xd1, 0x8b, 0xae, 0x0f, 0xf1, 0xb2, 0xfe, 0x27, 0xde, 0x4c, 0x76, 0xed, 0x8c, 0x79, 0x80, 0xa3, 0x4e } + +} +, +{ + "RSASSA-PSS Signature Example 5.3", + /* Message to be signed */ + 223, + { 0x8d, 0x83, 0x96, 0xe3, 0x65, 0x07, 0xfe, 0x1e, 0xf6, 0xa1, 0x90, 0x17, 0x54, 0x8e, 0x0c, 0x71, 0x66, 0x74, 0xc2, 0xfe, 0xc2, 0x33, 0xad, 0xb2, 0xf7, 0x75, 0x66, 0x5e, 0xc4, 0x1f, 0x2b, 0xd0, 0xba, 0x39, 0x6b, 0x06, 0x1a, 0x9d, 0xaa, 0x7e, 0x86, 0x6f, 0x7c, 0x23, 0xfd, 0x35, 0x31, 0x95, 0x43, 0x00, 0xa3, 0x42, 0xf9, 0x24, 0x53, 0x5e, 0xa1, 0x49, 0x8c, 0x48, 0xf6, 0xc8, 0x79, 0x93, 0x28, 0x65, 0xfc, 0x02, 0x00, 0x0c, 0x52, 0x87, 0x23, 0xb7, 0xad, 0x03, 0x35, 0x74, 0x5b, 0x51, 0x20, 0x9a, 0x0a, 0xfe, 0xd9, 0x32, 0xaf, 0x8f, 0x08, 0x87, 0xc2, 0x19, 0x00, 0x4d, 0x2a, 0xbd, 0x89, 0x4e, 0xa9, 0x25, 0x59, 0xee, 0x31, 0x98, 0xaf, 0x3a, 0x73, 0x4f, 0xe9, 0xb9, 0x63, 0x8c, 0x26, 0x3a, 0x72, 0x8a, 0xd9, 0x5a, 0x5a, 0xe8, 0xce, 0x3e, 0xb1, 0x58, 0x39, 0xf3, 0xaa, 0x78, 0x52, 0xbb, 0x39, 0x07, 0x06, 0xe7, 0x76, 0x0e, 0x43, 0xa7, 0x12, 0x91, 0xa2, 0xe3, 0xf8, 0x27, 0x23, 0x7d, 0xed, 0xa8, 0x51, 0x87, 0x4c, 0x51, 0x76, 0x65, 0xf5, 0x45, 0xf2, 0x72, 0x38, 0xdf, 0x86, 0x55, 0x7f, 0x37, 0x5d, 0x09, 0xcc, 0xd8, 0xbd, 0x15, 0xd8, 0xcc, 0xf6, 0x1f, 0x5d, 0x78, 0xca, 0x5c, 0x7f, 0x5c, 0xde, 0x78, 0x2e, 0x6b, 0xf5, 0xd0, 0x05, 0x70, 0x56, 0xd4, 0xba, 0xd9, 0x8b, 0x3d, 0x2f, 0x95, 0x75, 0xe8, 0x24, 0xab, 0x7a, 0x33, 0xff, 0x57, 0xb0, 0xac, 0x10, 0x0a, 0xb0, 0xd6, 0xea, 0xd7, 0xaa, 0x0b, 0x50, 0xf6, 0xe4, 0xd3, 0xe5, 0xec, 0x0b, 0x96, 0x6b } +, + /* Salt */ + 20, + { 0x81, 0x57, 0x79, 0xa9, 0x1b, 0x3a, 0x8b, 0xd0, 0x49, 0xbf, 0x2a, 0xeb, 0x92, 0x01, 0x42, 0x77, 0x22, 0x22, 0xc9, 0xca } +, + /* Signature */ + 129, + { 0x05, 0xe0, 0xfd, 0xbd, 0xf6, 0xf7, 0x56, 0xef, 0x73, 0x31, 0x85, 0xcc, 0xfa, 0x8c, 0xed, 0x2e, 0xb6, 0xd0, 0x29, 0xd9, 0xd5, 0x6e, 0x35, 0x56, 0x1b, 0x5d, 0xb8, 0xe7, 0x02, 0x57, 0xee, 0x6f, 0xd0, 0x19, 0xd2, 0xf0, 0xbb, 0xf6, 0x69, 0xfe, 0x9b, 0x98, 0x21, 0xe7, 0x8d, 0xf6, 0xd4, 0x1e, 0x31, 0x60, 0x8d, 0x58, 0x28, 0x0f, 0x31, 0x8e, 0xe3, 0x4f, 0x55, 0x99, 0x41, 0xc8, 0xdf, 0x13, 0x28, 0x75, 0x74, 0xba, 0xc0, 0x00, 0xb7, 0xe5, 0x8d, 0xc4, 0xf4, 0x14, 0xba, 0x49, 0xfb, 0x12, 0x7f, 0x9d, 0x0f, 0x89, 0x36, 0x63, 0x8c, 0x76, 0xe8, 0x53, 0x56, 0xc9, 0x94, 0xf7, 0x97, 0x50, 0xf7, 0xfa, 0x3c, 0xf4, 0xfd, 0x48, 0x2d, 0xf7, 0x5e, 0x3f, 0xb9, 0x97, 0x8c, 0xd0, 0x61, 0xf7, 0xab, 0xb1, 0x75, 0x72, 0xe6, 0xe6, 0x3e, 0x0b, 0xde, 0x12, 0xcb, 0xdc, 0xf1, 0x8c, 0x68, 0xb9, 0x79 } + +} +, +{ + "RSASSA-PSS Signature Example 5.4", + /* Message to be signed */ + 13, + { 0x32, 0x8c, 0x65, 0x9e, 0x0a, 0x64, 0x37, 0x43, 0x3c, 0xce, 0xb7, 0x3c, 0x14 } +, + /* Salt */ + 20, + { 0x9a, 0xec, 0x4a, 0x74, 0x80, 0xd5, 0xbb, 0xc4, 0x29, 0x20, 0xd7, 0xca, 0x23, 0x5d, 0xb6, 0x74, 0x98, 0x9c, 0x9a, 0xac } +, + /* Signature */ + 129, + { 0x0b, 0xc9, 0x89, 0x85, 0x3b, 0xc2, 0xea, 0x86, 0x87, 0x32, 0x71, 0xce, 0x18, 0x3a, 0x92, 0x3a, 0xb6, 0x5e, 0x8a, 0x53, 0x10, 0x0e, 0x6d, 0xf5, 0xd8, 0x7a, 0x24, 0xc4, 0x19, 0x4e, 0xb7, 0x97, 0x81, 0x3e, 0xe2, 0xa1, 0x87, 0xc0, 0x97, 0xdd, 0x87, 0x2d, 0x59, 0x1d, 0xa6, 0x0c, 0x56, 0x86, 0x05, 0xdd, 0x7e, 0x74, 0x2d, 0x5a, 0xf4, 0xe3, 0x3b, 0x11, 0x67, 0x8c, 0xcb, 0x63, 0x90, 0x32, 0x04, 0xa3, 0xd0, 0x80, 0xb0, 0x90, 0x2c, 0x89, 0xab, 0xa8, 0x86, 0x8f, 0x00, 0x9c, 0x0f, 0x1c, 0x0c, 0xb8, 0x58, 0x10, 0xbb, 0xdd, 0x29, 0x12, 0x1a, 0xbb, 0x84, 0x71, 0xff, 0x2d, 0x39, 0xe4, 0x9f, 0xd9, 0x2d, 0x56, 0xc6, 0x55, 0xc8, 0xe0, 0x37, 0xad, 0x18, 0xfa, 0xfb, 0xdc, 0x92, 0xc9, 0x58, 0x63, 0xf7, 0xf6, 0x1e, 0xa9, 0xef, 0xa2, 0x8f, 0xea, 0x40, 0x13, 0x69, 0xd1, 0x9d, 0xae, 0xa1 } + +} +, +{ + "RSASSA-PSS Signature Example 5.5", + /* Message to be signed */ + 228, + { 0xf3, 0x7b, 0x96, 0x23, 0x79, 0xa4, 0x7d, 0x41, 0x5a, 0x37, 0x6e, 0xec, 0x89, 0x73, 0x15, 0x0b, 0xcb, 0x34, 0xed, 0xd5, 0xab, 0x65, 0x40, 0x41, 0xb6, 0x14, 0x30, 0x56, 0x0c, 0x21, 0x44, 0x58, 0x2b, 0xa1, 0x33, 0xc8, 0x67, 0xd8, 0x52, 0xd6, 0xb8, 0xe2, 0x33, 0x21, 0x90, 0x13, 0x02, 0xec, 0xb4, 0x5b, 0x09, 0xec, 0x88, 0xb1, 0x52, 0x71, 0x78, 0xfa, 0x04, 0x32, 0x63, 0xf3, 0x06, 0x7d, 0x9f, 0xfe, 0x97, 0x30, 0x32, 0xa9, 0x9f, 0x4c, 0xb0, 0x8a, 0xd2,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xb6, 0x98, 0xb9, 0x60, 0x9e, 0xdf, 0x89, 0x8a, 0xd2, 0x27, 0x44, 0xac, 0x28, 0xdc, 0x23, 0x94, 0x97, 0xce, 0xa3, 0x69, 0xcb, 0xbd, 0x84, 0xf6, 0x5c, 0x95, 0xc0, 0xad, 0x77, 0x6b, 0x59, 0x47, 0x40, 0x16, 0x4b, 0x59, 0xa7, 0x39, 0xc6, 0xff, 0x7c, 0x2f, 0x07, 0xc7, 0xc0, 0x77, 0xa8, 0x6d, 0x95, 0x23, 0x8f, 0xe5, 0x1e, 0x1f, 0xcf, 0x33, 0x57, 0x4a, 0x4a, 0xe0, 0x68, 0x4b, 0x42, 0xa3, 0xf6, 0xbf, 0x67, 0x7d, 0x91, 0x82, 0x0c, 0xa8, 0x98, 0x74, 0x46, 0x7b, 0x2c, 0x23, 0xad, 0xd7, 0x79, 0x69, 0xc8, 0x07, 0x17, 0x43, 0x0d, 0x0e, 0xfc, 0x1d, 0x36, 0x95, 0x89, 0x2c, 0xe8, 0x55, 0xcb, 0x7f, 0x70, 0x11, 0x63, 0x0f, 0x4d, 0xf2, 0x6d, 0xef, 0x8d, 0xdf, 0x36, 0xfc, 0x23, 0x90, 0x5f, 0x57, 0xfa, 0x62, 0x43, 0xa4, 0x85, 0xc7, 0x70, 0xd5, 0x68, 0x1f, 0xcd } + +} +, +{ + "RSASSA-PSS Signature Example 5.6", + /* Message to be signed */ + 138, + { 0xc6, 0x10, 0x3c, 0x33, 0x0c, 0x1e, 0xf7, 0x18, 0xc1, 0x41, 0xe4, 0x7b, 0x8f, 0xa8, 0x59, 0xbe, 0x4d, 0x5b, 0x96, 0x25, 0x9e, 0x7d, 0x14, 0x20, 0x70, 0xec, 0xd4, 0x85, 0x83, 0x9d, 0xba, 0x5a, 0x83, 0x69, 0xc1, 0x7c, 0x11, 0x14, 0x03, 0x5e, 0x53, 0x2d, 0x19, 0x5c, 0x74, 0xf4, 0x4a, 0x04, 0x76, 0xa2, 0xd3, 0xe8, 0x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, 0x86, 0x27, 0x7c, 0xfa, 0x8a, 0xe9, 0x09, 0x71, 0x4d, 0x6b, 0x28, 0xf4, 0xbf, 0x8e, 0x29, 0x3a, 0xa0, 0x4c, 0x41, 0xef, 0xe7, 0xc0, 0xa8, 0x12, 0x66, 0xd5, 0xc0, 0x61, 0xe2, 0x57, 0x5b, 0xe0, 0x32, 0xaa, 0x46, 0x46, 0x74, 0xff, 0x71, 0x62, 0x62, 0x19, 0xbd, 0x74, 0xcc, 0x45, 0xf0, 0xe7, 0xed, 0x4e, 0x3f, 0xf9, 0x6e, 0xee, 0x75, 0x8e, 0x8f } + +} +, +} +}, +{ + "Example 6: A 1029-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x16, 0x4c, 0xa3, 0x1c, 0xff, 0x60, 0x9f, 0x3a, 0x0e, 0x71, 0x01, 0xb0, 0x39, 0xf2, 0xe4, 0xfe, 0x6d, 0xd3, 0x75, 0x19, 0xab, 0x98, 0x59, 0x8d, 0x17, 0x9e, 0x17, 0x49, 0x96, 0x59, 0x80, 0x71, 0xf4, 0x7d, 0x3a, 0x04, 0x55, 0x91, 0x58, 0xd7, 0xbe, 0x37, 0x3c, 0xf1, 0xaa, 0x53, 0xf0, 0xaa, 0x6e, 0xf0, 0x90, 0x39, 0xe5, 0x67, 0x8c, 0x2a, 0x4c, 0x63, 0x90, 0x05, 0x14, 0xc8, 0xc4, 0xf8, 0xaa, 0xed, 0x5d, 0xe1, 0x2a, 0x5f, 0x10, 0xb0, 0x9c, 0x31, 0x1a, 0xf8, 0xc0, 0xff, 0xb5, 0xb7, 0xa2, 0x97, 0xf2, 0xef, 0xc6, 0x3b, 0x8d, 0x6b, 0x05, 0x10, 0x93, 0x1f, 0x0b, 0x98, 0xe4, 0x8b, 0xf5, 0xfc, 0x6e, 0xc4, 0xe7, 0xb8, 0xdb, 0x1f, 0xfa, 0xeb, 0x08, 0xc3, 0x8e, 0x02, 0xad, 0xb8, 0xf0, 0x3a, 0x48, 0x22, 0x9c, 0x99, 0xe9, 0x69, 0x43, 0x1f, 0x61, 0xcb, 0x8c, 0x4d, 0xc6, 0x98, 0xd1 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 129, + { 0x03, 0xb6, 0x64, 0xee, 0x3b, 0x75, 0x66, 0x72, 0x3f, 0xc6, 0xea, 0xf2, 0x8a, 0xbb, 0x43, 0x0a, 0x39, 0x80, 0xf1, 0x12, 0x6c, 0x81, 0xde, 0x8a, 0xd7, 0x09, 0xea, 0xb3, 0x9a, 0xc9, 0xdc, 0xd0, 0xb1, 0x55, 0x0b, 0x37, 0x29, 0xd8, 0x70, 0x68, 0xe9, 0x52, 0x00, 0x9d, 0xf5, 0x44, 0x53, 0x4c, 0x1f, 0x50, 0x82, 0x9a, 0x78, 0xf4, 0x59, 0x1e, 0xb8, 0xfd, 0x57, 0x14, 0x04, 0x26, 0xa6, 0xbb, 0x04, 0x05, 0xb6, 0xa6, 0xf5, 0x1a, 0x57, 0xd9, 0x26, 0x7b, 0x7b, 0xbc, 0x65, 0x33, 0x91, 0xa6, 0x99, 0xa2, 0xa9, 0x0d, 0xac, 0x8a, 0xe2, 0x26, 0xbc, 0xc6, 0x0f, 0xa8, 0xcd, 0x93, 0x4c, 0x73, 0xc7, 0xb0, 0x3b, 0x1f, 0x6b, 0x81, 0x81, 0x58, 0x63, 0x18, 0x38, 0xa8, 0x61, 0x2e, 0x6e, 0x6e, 0xa9, 0x2b, 0xe2, 0x4f, 0x83, 0x24, 0xfa, 0xf5, 0xb1, 0xfd, 0x85, 0x87, 0x22, 0x52, 0x67, 0xba, 0x6f } +, + /* Prime p */ + 65, + { 0x04, 0xf0, 0x54, 0x8c, 0x96, 0x26, 0xab, 0x1e, 0xbf, 0x12, 0x44, 0x93, 0x47, 0x41, 0xd9, 0x9a, 0x06, 0x22, 0x0e, 0xfa, 0x2a, 0x58, 0x56, 0xaa, 0x0e, 0x75, 0x73, 0x0b, 0x2e, 0xc9, 0x6a, 0xdc, 0x86, 0xbe, 0x89, 0x4f, 0xa2, 0x80, 0x3b, 0x53, 0xa5, 0xe8, 0x5d, 0x27, 0x6a, 0xcb, 0xd2, 0x9a, 0xb8, 0x23, 0xf8, 0x0a, 0x73, 0x91, 0xbb, 0x54, 0xa5, 0x05, 0x16, 0x72, 0xfb, 0x04, 0xee, 0xb5, 0x43 } +, + /* Prime q */ + 65, + { 0x04, 0x83, 0xe0, 0xae, 0x47, 0x91, 0x55, 0x87, 0x74, 0x3f, 0xf3, 0x45, 0x36, 0x2b, 0x55, 0x5d, 0x39, 0x62, 0xd9, 0x8b, 0xb6, 0xf1, 0x5f, 0x84, 0x8b, 0x4c, 0x92, 0xb1, 0x77, 0x1c, 0xa8, 0xed, 0x10, 0x7d, 0x8d, 0x3e, 0xe6, 0x5e, 0xc4, 0x45, 0x17, 0xdd, 0x0f, 0xaa, 0x48, 0x1a, 0x38, 0x7e, 0x90, 0x2f, 0x7a, 0x2e, 0x74, 0x7c, 0x26, 0x9e, 0x7e, 0xa4, 0x44, 0x80, 0xbc, 0x53, 0x8b, 0x8e, 0x5b } +, + /* p's CRT exponent dP */ + 65, + { 0x03, 0xa8, 0xe8, 0xae, 0xa9, 0x92, 0x0c, 0x1a, 0xa3, 0xb2, 0xf0, 0xd8, 0x46, 0xe4, 0xb8, 0x50, 0xd8, 0x1c, 0xa3, 0x06, 0xa5, 0x1c, 0x83, 0x54, 0x4f, 0x94, 0x9f, 0x64, 0xf9, 0x0d, 0xcf, 0x3f, 0x8e, 0x26, 0x61, 0xf0, 0x7e, 0x56, 0x12, 0x20, 0xa1, 0x80, 0x38, 0x8f, 0xbe, 0x27, 0x3e, 0x70, 0xe2, 0xe5, 0xdc, 0xa8, 0x3a, 0x0e, 0x13, 0x48, 0xdd, 0x64, 0x90, 0xc7, 0x31, 0xd6, 0xec, 0xe1, 0xab } +, + /* q's CRT exponent dQ */ + 65, + { 0x01, 0x35, 0xbd, 0xcd, 0xb6, 0x0b, 0xf2, 0x19, 0x7c, 0x43, 0x6e, 0xd3, 0x4b, 0x32, 0xcd, 0x8b, 0x4f, 0xc7, 0x77, 0x78, 0x83, 0x2b, 0xa7, 0x67, 0x03, 0x55, 0x1f, 0xb2, 0x42, 0xb3, 0x01, 0x69, 0x95, 0x93, 0xaf, 0x77, 0xfd, 0x8f, 0xc3, 0x94, 0xa8, 0x52, 0x6a, 0xd2, 0x3c, 0xc4, 0x1a, 0x03, 0x80, 0x6b, 0xd8, 0x97, 0xfe, 0x4b, 0x0e, 0xa6, 0x46, 0x55, 0x8a, 0xad, 0xdc, 0xc9, 0x9e, 0x8a, 0x25 } +, + /* CRT coefficient qInv */ + 65, + { 0x03, 0x04, 0xc0, 0x3d, 0x9c, 0x73, 0x65, 0x03, 0xa9, 0x84, 0xab, 0xbd, 0x9b, 0xa2, 0x23, 0x01, 0x40, 0x7c, 0x4a, 0x2a, 0xb1, 0xdd, 0x85, 0x76, 0x64, 0x81, 0xb6, 0x0d, 0x45, 0x40, 0x11, 0x52, 0xe6, 0x92, 0xbe, 0x14, 0xf4, 0x12, 0x1d, 0x9a, 0xa3, 0xfd, 0x6e, 0x0b, 0x4d, 0x1d, 0x3a, 0x97, 0x35, 0x38, 0xa3, 0x1d, 0x42, 0xee, 0x6e, 0x1e, 0x5e, 0xf6, 0x20, 0x23, 0x1a, 0x2b, 0xba, 0xf3, 0x5f } + +} +, +{{ + "RSASSA-PSS Signature Example 6.1", + /* Message to be signed */ + 109, + { 0x0a, 0x20, 0xb7, 0x74, 0xad, 0xdc, 0x2f, 0xa5, 0x12, 0x45, 0xed, 0x7c, 0xb9, 0xda, 0x60, 0x9e, 0x50, 0xca, 0xc6, 0x63, 0x6a, 0x52, 0x54, 0x3f, 0x97, 0x45, 0x8e, 0xed, 0x73, 0x40, 0xf8, 0xd5, 0x3f, 0xfc, 0x64, 0x91, 0x8f, 0x94, 0x90, 0x78, 0xee, 0x03, 0xef, 0x60, 0xd4, 0x2b, 0x5f, 0xec, 0x24, 0x60, 0x50, 0xbd, 0x55, 0x05, 0xcd, 0x8c, 0xb5, 0x97, 0xba, 0xd3, 0xc4, 0xe7, 0x13, 0xb0, 0xef, 0x30, 0x64, 0x4e, 0x76, 0xad, 0xab, 0xb0, 0xde, 0x01, 0xa1, 0x56, 0x1e, 0xfb, 0x25, 0x51, 0x58, 0xc7, 0x4f, 0xc8, 0x01, 0xe6, 0xe9, 0x19, 0xe5, 0x81, 0xb4, 0x6f, 0x0f, 0x0d, 0xdd, 0x08, 0xe4, 0xf3, 0x4c, 0x78, 0x10, 0xb5, 0xed, 0x83, 0x18, 0xf9, 0x1d, 0x7c, 0x8c } +, + /* Salt */ + 20, + { 0x5b, 0x4e, 0xa2, 0xef, 0x62, 0x9c, 0xc2, 0x2f, 0x3b, 0x53, 0x8e, 0x01, 0x69, 0x04, 0xb4, 0x7b, 0x1e, 0x40, 0xbf, 0xd5 } +, + /* Signature */ + 129, + { 0x04, 0xc0, 0xcf, 0xac, 0xec, 0x04, 0xe5, 0xba, 0xdb, 0xec, 0xe1, 0x59, 0xa5, 0xa1, 0x10, 0x3f, 0x69, 0xb3, 0xf3, 0x2b, 0xa5, 0x93, 0xcb, 0x4c, 0xc4, 0xb1, 0xb7, 0xab, 0x45, 0x59, 0x16, 0xa9, 0x6a, 0x27, 0xcd, 0x26, 0x78, 0xea, 0x0f, 0x46, 0xba, 0x37, 0xf7, 0xfc, 0x9c, 0x86, 0x32, 0x5f, 0x29, 0x73, 0x3b, 0x38, 0x9f, 0x1d, 0x97, 0xf4, 0x3e, 0x72, 0x01, 0xc0, 0xf3, 0x48, 0xfc, 0x45, 0xfe, 0x42, 0x89, 0x23, 0x35, 0x36, 0x2e, 0xee, 0x01, 0x8b, 0x5b, 0x16, 0x1f, 0x2f, 0x93, 0x93, 0x03, 0x12, 0x25, 0xc7, 0x13, 0x01, 0x2a, 0x57, 0x6b, 0xc8, 0x8e, 0x23, 0x05, 0x24, 0x89, 0x86, 0x8d, 0x90, 0x10, 0xcb, 0xf0, 0x33, 0xec, 0xc5, 0x68, 0xe8, 0xbc, 0x15, 0x2b, 0xdc, 0x59, 0xd5, 0x60, 0xe4, 0x12, 0x91, 0x91, 0x5d, 0x28, 0x56, 0x52, 0x08, 0xe2, 0x2a, 0xee, 0xc9, 0xef, 0x85, 0xd1 } + +} +, +{ + "RSASSA-PSS Signature Example 6.2", + /* Message to be signed */ + 199, + { 0x2a, 0xaf, 0xf6, 0x63, 0x1f, 0x62, 0x1c, 0xe6, 0x15, 0x76, 0x0a, 0x9e, 0xbc, 0xe9, 0x4b, 0xb3, 0x33, 0x07, 0x7a, 0xd8, 0x64, 0x88, 0xc8, 0x61, 0xd4, 0xb7, 0x6d, 0x29, 0xc1, 0xf4, 0x87, 0x46, 0xc6, 0x11, 0xae, 0x1e, 0x03, 0xce, 0xd4, 0x44, 0x5d, 0x7c, 0xfa, 0x1f, 0xe5, 0xf6, 0x2e, 0x1b, 0x3f, 0x08, 0x45, 0x2b, 0xde, 0x3b, 0x6e, 0xf8, 0x19, 0x73, 0xba, 0xfb, 0xb5, 0x7f, 0x97, 0xbc, 0xee, 0xf8, 0x73, 0x98, 0x53, 0x95, 0xb8, 0x26, 0x05, 0x89, 0xaa, 0x88, 0xcb, 0x7d, 0xb5, 0x0a, 0xb4, 0x69, 0x26, 0x2e, 0x55, 0x1b, 0xdc, 0xd9, 0xa5, 0x6f, 0x27, 0x5a, 0x0a, 0xc4, 0xfe, 0x48, 0x47, 0x00, 0xc3, 0x5f, 0x3d, 0xbf, 0x2b, 0x46, 0x9e, 0xde, 0x86, 0x47, 0x41, 0xb8, 0x6f, 0xa5, 0x91, 0x72, 0xa3, 0x60, 0xba, 0x95, 0xa0, 0x2e, 0x13, 0x9b, 0xe5, 0x0d, 0xdf, 0xb7, 0xcf, 0x0b, 0x42, 0xfa, 0xea, 0xbb, 0xfb, 0xba, 0xa8, 0x6a, 0x44, 0x97, 0x69, 0x9c, 0x4f, 0x2d, 0xfd, 0x5b, 0x08, 0x40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x71, 0xbb, 0x57, 0x92, 0x61, 0x50, 0x35, 0xcd, 0xaf, 0x2d, 0x89, 0x29, 0xae, 0xd3, 0xbe, 0x09, 0x83, 0x79, 0x37, 0x7e, 0x77, 0x7c, 0xe7, 0x9a, 0xaa, 0x47, 0x73 } + +} +, +{ + "RSASSA-PSS Signature Example 6.3", + /* Message to be signed */ + 62, + { 0x0f, 0x61, 0x95, 0xd0, 0x4a, 0x6e, 0x6f, 0xc7, 0xe2, 0xc9, 0x60, 0x0d, 0xbf, 0x84, 0x0c, 0x39, 0xea, 0x8d, 0x4d, 0x62, 0x4f, 0xd5, 0x35, 0x07, 0x01, 0x6b, 0x0e, 0x26, 0x85, 0x8a, 0x5e, 0x0a, 0xec, 0xd7, 0xad, 0xa5, 0x43, 0xae, 0x5c, 0x0a, 0xb3, 0xa6, 0x25, 0x99, 0xcb, 0xa0, 0xa5, 0x4e, 0x6b, 0xf4, 0x46, 0xe2, 0x62, 0xf9, 0x89, 0x97, 0x8f, 0x9d, 0xdf, 0x5e, 0x9a, 0x41 } +, + /* Salt */ + 20, + { 0xa8, 0x7b, 0x8a, 0xed, 0x07, 0xd7, 0xb8, 0xe2, 0xda, 0xf1, 0x4d, 0xdc, 0xa4, 0xac, 0x68, 0xc4, 0xd0, 0xaa, 0xbf, 0xf8 } +, + /* Signature */ + 129, + { 0x08, 0x6d, 0xf6, 0xb5, 0x00, 0x09, 0x8c, 0x12, 0x0f, 0x24, 0xff, 0x84, 0x23, 0xf7, 0x27, 0xd9, 0xc6, 0x1a, 0x5c, 0x90, 0x07, 0xd3, 0xb6, 0xa3, 0x1c, 0xe7, 0xcf, 0x8f, 0x3c, 0xbe, 0xc1, 0xa2, 0x6b, 0xb2, 0x0e, 0x2b, 0xd4, 0xa0, 0x46, 0x79, 0x32, 0x99, 0xe0, 0x3e, 0x37, 0xa2, 0x1b, 0x40, 0x19, 0x4f, 0xb0, 0x45, 0xf9, 0x0b, 0x18, 0xbf, 0x20, 0xa4, 0x79, 0x92, 0xcc, 0xd7, 0x99, 0xcf, 0x9c, 0x05, 0x9c, 0x29, 0x9c, 0x05, 0x26, 0x85, 0x49, 0x54, 0xaa, 0xde, 0x8a, 0x6a, 0xd9, 0xd9, 0x7e, 0xc9, 0x1a, 0x11, 0x45, 0x38, 0x3f, 0x42, 0x46, 0x8b, 0x23, 0x1f, 0x4d, 0x72, 0xf2, 0x37, 0x06, 0xd9, 0x85, 0x3c, 0x3f, 0xa4, 0x3c, 0xe8, 0xac, 0xe8, 0xbf, 0xe7, 0x48, 0x49, 0x87, 0xa1, 0xec, 0x6a, 0x16, 0xc8, 0xda, 0xf8, 0x1f, 0x7c, 0x8b, 0xf4, 0x27, 0x74, 0x70, 0x7a, 0x9d, 0xf4, 0x56 } + +} +, +{ + "RSASSA-PSS Signature Example 6.4", + /* Message to be signed */ + 112, + { 0x33, 0x7d, 0x25, 0xfe, 0x98, 0x10, 0xeb, 0xca, 0x0d, 0xe4, 0xd4, 0x65, 0x8d, 0x3c, 0xeb, 0x8e, 0x0f, 0xe4, 0xc0, 0x66, 0xab, 0xa3, 0xbc, 0xc4, 0x8b, 0x10, 0x5d, 0x3b, 0xf7, 0xe0, 0x25, 0x7d, 0x44, 0xfe, 0xce, 0xa6, 0x59, 0x6f, 0x4d, 0x0c, 0x59, 0xa0, 0x84, 0x02, 0x83, 0x36, 0x78, 0xf7, 0x06, 0x20, 0xf9, 0x13, 0x8d, 0xfe, 0xb7, 0xde, 0xd9, 0x05, 0xe4, 0xa6, 0xd5, 0xf0, 0x5c, 0x47, 0x3d, 0x55, 0x93, 0x66, 0x52, 0xe2, 0xa5, 0xdf, 0x43, 0xc0, 0xcf, 0xda, 0x7b, 0xac, 0xaf, 0x30, 0x87, 0xf4, 0x52, 0x4b, 0x06, 0xcf, 0x42, 0x15, 0x7d, 0x01, 0x53, 0x97, 0x39, 0xf7, 0xfd, 0xde, 0xc9, 0xd5, 0x81, 0x25, 0xdf, 0x31, 0xa3, 0x2e, 0xab, 0x06, 0xc1, 0x9b, 0x71, 0xf1, 0xd5, 0xbf } +, + /* Salt */ + 20, + { 0xa3, 0x79, 0x32, 0xf8, 0xa7, 0x49, 0x4a, 0x94, 0x2d, 0x6f, 0x76, 0x74, 0x38, 0xe7, 0x24, 0xd6, 0xd0, 0xc0, 0xef, 0x18 } +, + /* Signature */ + 129, + { 0x0b, 0x5b, 0x11, 0xad, 0x54, 0x98, 0x63, 0xff, 0xa9, 0xc5, 0x1a, 0x14, 0xa1, 0x10, 0x6c, 0x2a, 0x72, 0xcc, 0x8b, 0x64, 0x6e, 0x5c, 0x72, 0x62, 0x50, 0x97, 0x86, 0x10, 0x5a, 0x98, 0x47, 0x76, 0x53, 0x4c, 0xa9, 0xb5, 0x4c, 0x1c, 0xc6, 0x4b, 0xf2, 0xd5, 0xa4, 0x4f, 0xd7, 0xe8, 0xa6, 0x9d, 0xb6, 0x99, 0xd5, 0xea, 0x52, 0x08, 0x7a, 0x47, 0x48, 0xfd, 0x2a, 0xbc, 0x1a, 0xfe, 0xd1, 0xe5, 0xd6, 0xf7, 0xc8, 0x90, 0x25, 0x53, 0x0b, 0xda, 0xa2, 0x21, 0x3d, 0x7e, 0x03, 0x0f, 0xa5, 0x5d, 0xf6, 0xf3, 0x4b, 0xcf, 0x1c, 0xe4, 0x6d, 0x2e, 0xdf, 0x4e, 0x3a, 0xe4, 0xf3, 0xb0, 0x18, 0x91, 0xa0, 0x68, 0xc9, 0xe3, 0xa4, 0x4b, 0xbc, 0x43, 0x13, 0x3e, 0xda, 0xd6, 0xec, 0xb9, 0xf3, 0x54, 0x00, 0xc4, 0x25, 0x2a, 0x57, 0x62, 0xd6, 0x57, 0x44, 0xb9, 0x9c, 0xb9, 0xf4, 0xc5, 0x59, 0x32, 0x9f } + +} +, +{ + "RSASSA-PSS Signature Example 6.5", + /* Message to be signed */ + 176, + { 0x84, 0xec, 0x50, 0x2b, 0x07, 0x2e, 0x82, 0x87, 0x78, 0x9d, 0x8f, 0x92, 0x35, 0x82, 0x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Signature */ + 129, + { 0x02, 0xd7, 0x1f, 0xa9, 0xb5, 0x3e, 0x46, 0x54, 0xfe, 0xfb, 0x7f, 0x08, 0x38, 0x5c, 0xf6, 0xb0, 0xae, 0x3a, 0x81, 0x79, 0x42, 0xeb, 0xf6, 0x6c, 0x35, 0xac, 0x67, 0xf0, 0xb0, 0x69, 0x95, 0x2a, 0x3c, 0xe9, 0xc7, 0xe1, 0xf1, 0xb0, 0x2e, 0x48, 0x0a, 0x95, 0x00, 0x83, 0x6d, 0xe5, 0xd6, 0x4c, 0xdb, 0x7e, 0xcd, 0xe0, 0x45, 0x42, 0xf7, 0xa7, 0x99, 0x88, 0x78, 0x7e, 0x24, 0xc2, 0xba, 0x05, 0xf5, 0xfd, 0x48, 0x2c, 0x02, 0x3e, 0xd5, 0xc3, 0x0e, 0x04, 0x83, 0x9d, 0xc4, 0x4b, 0xed, 0x2a, 0x3a, 0x3a, 0x4f, 0xee, 0x01, 0x11, 0x3c, 0x89, 0x1a, 0x47, 0xd3, 0x2e, 0xb8, 0x02, 0x5c, 0x28, 0xcb, 0x05, 0x0b, 0x5c, 0xdb, 0x57, 0x6c, 0x70, 0xfe, 0x76, 0xef, 0x52, 0x34, 0x05, 0xc0, 0x84, 0x17, 0xfa, 0xf3, 0x50, 0xb0, 0x37, 0xa4, 0x3c, 0x37, 0x93, 0x39, 0xfc, 0xb1, 0x8d, 0x3a, 0x35, 0x6b } + +} +, +{ + "RSASSA-PSS Signature Example 6.6", + /* Message to be signed */ + 139, + { 0x99, 0x06, 0xd8, 0x9f, 0x97, 0xa9, 0xfd, 0xed, 0xd3, 0xcc, 0xd8, 0x24, 0xdb, 0x68, 0x73, 0x26, 0xf3, 0x0f, 0x00, 0xaa, 0x25, 0xa7, 0xfc, 0xa2, 0xaf, 0xcb, 0x3b, 0x0f, 0x86, 0xcd, 0x41, 0xe7, 0x3f, 0x0e, 0x8f, 0xf7, 0xd2, 0xd8, 0x3f, 0x59, 0xe2, 0x8e, 0xd3, 0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, 0x37, 0xd3, 0x50, 0xa1, 0x54, 0xbc, 0xac, 0xa8, 0x39, 0x2d, 0x98, 0xfa, 0x67, 0x95, 0x9e, 0x97, 0x27, 0xb7, 0x8c, 0xad, 0x03, 0x26, 0x9f, 0x56, 0x96, 0x8f, 0xc5, 0x6b, 0x68, 0xbd, 0x67, 0x99, 0x26, 0xd8, 0x3c, 0xc9, 0xcb, 0x21, 0x55, 0x50, 0x64, 0x5c, 0xcd, 0xa3, 0x1c, 0x76, 0x0f, 0xf3, 0x58, 0x88, 0x94, 0x3d, 0x2d, 0x8a, 0x1d, 0x35, 0x1e, 0x81, 0xe5, 0xd0, 0x7b, 0x86, 0x18, 0x2e, 0x75, 0x10, 0x81, 0xef } + +} +, +} +}, +{ + "Example 7: A 1030-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x37, 0xc9, 0xda, 0x4a, 0x66, 0xc8, 0xc4, 0x08, 0xb8, 0xda, 0x27, 0xd0, 0xc9, 0xd7, 0x9f, 0x8c, 0xcb, 0x1e, 0xaf, 0xc1, 0xd2, 0xfe, 0x48, 0x74, 0x6d, 0x94, 0x0b, 0x7c, 0x4e, 0xf5, 0xde, 0xe1, 0x8a, 0xd1, 0x26, 0x47, 0xce, 0xfa, 0xa0, 0xc4, 0xb3, 0x18, 0x8b, 0x22, 0x1c, 0x51, 0x53, 0x86, 0x75, 0x9b, 0x93, 0xf0, 0x20, 0x24, 0xb2, 0x5a, 0xb9, 0x24, 0x2f, 0x83, 0x57, 0xd8, 0xf3, 0xfd, 0x49, 0x64, 0x0e, 0xe5, 0xe6, 0x43, 0xea, 0xf6, 0xc6, 0x4d, 0xee, 0xfa, 0x70, 0x89, 0x72, 0x7c, 0x8f, 0xf0, 0x39, 0x93, 0x33, 0x39, 0x15, 0xc6, 0xef, 0x21, 0xbf, 0x59, 0x75, 0xb6, 0xe5, 0x0d, 0x11, 0x8b, 0x51, 0x00, 0x8e, 0xc3, 0x3e, 0x9f, 0x01, 0xa0, 0xa5, 0x45, 0xa1, 0x0a, 0x83, 0x6a, 0x43, 0xdd, 0xbc, 0xa9, 0xd8, 0xb5, 0xc5, 0xd3, 0x54, 0x80, 0x22, 0xd7, 0x06, 0x4e, 0xa2, 0x9a, 0xb3 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x3b, 0xed, 0x99, 0x90, 0x52, 0xd9, 0x57, 0xbc, 0x06, 0xd6, 0x51, 0xee, 0xf6, 0xe3, 0xa9, 0x80, 0x94, 0xb1, 0x62, 0x1b, 0xd3, 0x8b, 0x54, 0x49, 0xbd, 0x6c, 0x4a, 0xea, 0x3d, 0xe7, 0xe0, 0x84, 0x67, 0x9a, 0x44, 0x84, 0xde, 0xd2, 0x5b, 0xe0, 0xf0, 0x82, 0x6c, 0xf3, 0x37, 0x78, 0x25, 0x41, 0x4b, 0x14, 0xd4, 0xd6, 0x1d, 0xb1, 0x4d, 0xe6, 0x26, 0xfb, 0xb8, 0x0e, 0x5f, 0x4f, 0xae, 0xc9, 0x56, 0xf9, 0xa0, 0xa2, 0xd2, 0x4f, 0x99, 0x57, 0x63, 0x80, 0xf0, 0x84, 0xeb, 0x62, 0xe4, 0x6a, 0x57, 0xd5, 0x54, 0x27, 0x8b, 0x53, 0x56, 0x26, 0x19, 0x3c, 0xe0, 0x20, 0x60, 0x57, 0x5e, 0xb6, 0x6c, 0x57, 0x98, 0xd3, 0x6f, 0x6c, 0x5d, 0x40, 0xfb, 0x00, 0xd8, 0x09, 0xb4, 0x2a, 0x73, 0x10, 0x2c, 0x1c, 0x74, 0xee, 0x95, 0xbd, 0x71, 0x42, 0x0f, 0xff, 0xef, 0x63, 0x18, 0xb5, 0x2c, 0x29 } +, + /* Prime p */ + 65, + { 0x07, 0xee, 0xfb, 0x42, 0x4b, 0x0e, 0x3a, 0x40, 0xe4, 0x20, 0x8e, 0xe5, 0xaf, 0xb2, 0x80, 0xb2, 0x23, 0x17, 0x30, 0x81, 0x14, 0xdd, 0xe0, 0xb4, 0xb6, 0x4f, 0x73, 0x01, 0x84, 0xec, 0x68, 0xda, 0x6c, 0xe2, 0x86, 0x7a, 0x9f, 0x48, 0xed, 0x77, 0x26, 0xd5, 0xe2, 0x61, 0x4e, 0xd0, 0x4a, 0x54, 0x10, 0x73, 0x6c, 0x8c, 0x71, 0x4e, 0xe7, 0x02, 0x47, 0x42, 0x98, 0xc6, 0x29, 0x2a, 0xf0, 0x75, 0x35 } +, + /* Prime q */ + 65, + { 0x07, 0x08, 0x30, 0xdb, 0xf9, 0x47, 0xea, 0xc0, 0x22, 0x8d, 0xe2, 0x63, 0x14, 0xb5, 0x9b, 0x66, 0x99, 0x4c, 0xc6, 0x0e, 0x83, 0x60, 0xe7, 0x5d, 0x38, 0x76, 0x29, 0x8f, 0x8f, 0x8a, 0x7d, 0x14, 0x1d, 0xa0, 0x64, 0xe5, 0xca, 0x02, 0x6a, 0x97, 0x3e, 0x28, 0xf2, 0x54, 0x73, 0x8c, 0xee, 0x66, 0x9c, 0x72, 0x1b, 0x03, 0x4c, 0xb5, 0xf8, 0xe2, 0x44, 0xda, 0xdd, 0x7c, 0xd1, 0xe1, 0x59, 0xd5, 0x47 } +, + /* p's CRT exponent dP */ + 65, + { 0x05, 0x24, 0xd2, 0x0c, 0x3d, 0x95, 0xcf, 0xf7, 0x5a, 0xf2, 0x31, 0x34, 0x83, 0x22, 0x7d, 0x87, 0x02, 0x71, 0x7a, 0xa5, 0x76, 0xde, 0x15, 0x5f, 0x96, 0x05, 0x15, 0x50, 0x1a, 0xdb, 0x1d, 0x70, 0xe1, 0xc0, 0x4d, 0xe9, 0x1b, 0x75, 0xb1, 0x61, 0xdb, 0xf0, 0x39, 0x83, 0x56, 0x12, 0x7e, 0xde, 0xda, 0x7b, 0xbc, 0x19, 0xa3, 0x2d, 0xc1, 0x62, 0x1c, 0xc9, 0xf5, 0x3c, 0x26, 0x5d, 0x0c, 0xe3, 0x31 } +, + /* q's CRT exponent dQ */ + 65, + { 0x05, 0xf9, 0x84, 0xa1, 0xf2, 0x3c, 0x93, 0x8d, 0x6a, 0x0e, 0x89, 0x72, 0x4b, 0xcf, 0x3d, 0xd9, 0x3f, 0x99, 0x46, 0x92, 0x60, 0x37, 0xfe, 0x7c, 0x6b, 0x13, 0xa2, 0x9e, 0x52, 0x84, 0x85, 0x5f, 0x89, 0x08, 0x95, 0x91, 0xd4, 0x40, 0x97, 0x56, 0x27, 0xbf, 0x5c, 0x9e, 0x3a, 0x8b, 0x5c, 0xa7, 0x9c, 0x77, 0x2a, 0xd2, 0x73, 0xe4, 0x0d, 0x32, 0x1a, 0xf4, 0xa6, 0xc9, 0x7d, 0xfd, 0xed, 0x78, 0xd3 } +, + /* CRT coefficient qInv */ + 64, + { 0xdd, 0xd9, 0x18, 0xad, 0xad, 0xa2, 0x9d, 0xca, 0xb9, 0x81, 0xff, 0x9a, 0xcb, 0xa4, 0x25, 0x70, 0x23, 0xc0, 0x9a, 0x38, 0x01, 0xcc, 0xce, 0x09, 0x8c, 0xe2, 0x68, 0xf8, 0x55, 0xd0, 0xdf, 0x57, 0x0c, 0xd6, 0xe7, 0xb9, 0xb1, 0x4b, 0xd9, 0xa5, 0xa9, 0x25, 0x4c, 0xbc, 0x31, 0x5b, 0xe6, 0xf8, 0xba, 0x1e, 0x25, 0x46, 0xdd, 0xd5, 0x69, 0xc5, 0xea, 0x19, 0xee, 0xd8, 0x35, 0x3b, 0xde, 0x5e } + +} +, +{{ + "RSASSA-PSS Signature Example 7.1", + /* Message to be signed */ + 255, + { 0x9e, 0xad, 0x0e, 0x01, 0x94, 0x56, 0x40, 0x67, 0x4e, 0xb4, 0x1c, 0xad, 0x43, 0x5e, 0x23, 0x74, 0xea, 0xef, 0xa8, 0xad, 0x71, 0x97, 0xd9, 0x79, 0x13, 0xc4, 0x49, 0x57, 0xd8, 0xd8, 0x3f, 0x40, 0xd7, 0x6e, 0xe6, 0x0e, 0x39, 0xbf, 0x9c, 0x0f, 0x9e, 0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x83, 0x20, 0xe9, 0x74, 0xa5, 0x6f, 0x4e, 0xfb, 0x57, 0x63, 0xb9, 0x62, 0x55, 0xab, 0xbf, 0x80, 0x37, 0xbf, 0x18, 0x02, 0xcf, 0x01, 0x8f, 0x56, 0x37, 0x94, 0x93, 0xe5, 0x69, 0xa9 } +, + /* Salt */ + 20, + { 0xb7, 0x86, 0x7a, 0x59, 0x95, 0x8c, 0xb5, 0x43, 0x28, 0xf8, 0x77, 0x5e, 0x65, 0x46, 0xec, 0x06, 0xd2, 0x7e, 0xaa, 0x50 } +, + /* Signature */ + 129, + { 0x18, 0x7f, 0x39, 0x07, 0x23, 0xc8, 0x90, 0x25, 0x91, 0xf0, 0x15, 0x4b, 0xae, 0x6d, 0x4e, 0xcb, 0xff, 0xe0, 0x67, 0xf0, 0xe8, 0xb7, 0x95, 0x47, 0x6e, 0xa4, 0xf4, 0xd5, 0x1c, 0xcc, 0x81, 0x05, 0x20, 0xbb, 0x3c, 0xa9, 0xbc, 0xa7, 0xd0, 0xb1, 0xf2, 0xea, 0x8a, 0x17, 0xd8, 0x73, 0xfa, 0x27, 0x57, 0x0a, 0xcd, 0x64, 0x2e, 0x38, 0x08, 0x56, 0x1c, 0xb9, 0xe9, 0x75, 0xcc, 0xfd, 0x80, 0xb2, 0x3d, 0xc5, 0x77, 0x1c, 0xdb, 0x33, 0x06, 0xa5, 0xf2, 0x31, 0x59, 0xda, 0xcb, 0xd3, 0xaa, 0x2d, 0xb9, 0x3d, 0x46, 0xd7, 0x66, 0xe0, 0x9e, 0xd1, 0x5d, 0x90, 0x0a, 0xd8, 0x97, 0xa8, 0xd2, 0x74, 0xdc, 0x26, 0xb4, 0x7e, 0x99, 0x4a, 0x27, 0xe9, 0x7e, 0x22, 0x68, 0xa7, 0x66, 0x53, 0x3a, 0xe4, 0xb5, 0xe4, 0x2a, 0x2f, 0xca, 0xf7, 0x55, 0xc1, 0xc4, 0x79, 0x4b, 0x29, 0x4c, 0x60, 0x55, 0x58, 0x23 } + +} +, +{ + "RSASSA-PSS Signature Example 7.2", + /* Message to be signed */ + 57, + { 0x8d, 0x80, 0xd2, 0xd0, 0x8d, 0xbd, 0x19, 0xc1, 0x54, 0xdf, 0x3f, 0x14, 0x67, 0x3a, 0x14, 0xbd, 0x03, 0x73, 0x52, 0x31, 0xf2, 0x4e, 0x86, 0xbf, 0x15, 0x3d, 0x0e, 0x69, 0xe7, 0x4c, 0xbf, 0xf7, 0xb1, 0x83, 0x6e, 0x66, 0x4d, 0xe8, 0x3f, 0x68, 0x01, 0x24, 0x37, 0x0f, 0xc0, 0xf9, 0x6c, 0x9b, 0x65, 0xc0, 0x7a, 0x36, 0x6b, 0x64, 0x4c, 0x4a, 0xb3 } +, + /* Salt */ + 20, + { 0x0c, 0x09, 0x58, 0x22, 0x66, 0xdf, 0x08, 0x63, 0x10, 0x82, 0x1b, 0xa7, 0xe1, 0x8d, 0xf6, 0x4d, 0xfe, 0xe6, 0xde, 0x09 } +, + /* Signature */ + 129, + { 0x10, 0xfd, 0x89, 0x76, 0x8a, 0x60, 0xa6, 0x77, 0x88, 0xab, 0xb5, 0x85, 0x6a, 0x78, 0x7c, 0x85, 0x61, 0xf3, 0xed, 0xcf, 0x9a, 0x83, 0xe8, 0x98, 0xf7, 0xdc, 0x87, 0xab, 0x8c, 0xce, 0x79, 0x42, 0x9b, 0x43, 0xe5, 0x69, 0x06, 0x94, 0x1a, 0x88, 0x61, 0x94, 0xf1, 0x37, 0xe5, 0x91, 0xfe, 0x7c, 0x33, 0x95, 0x55, 0x36, 0x1f, 0xbb, 0xe1, 0xf2, 0x4f, 0xeb, 0x2d, 0x4b, 0xcd, 0xb8, 0x06, 0x01, 0xf3, 0x09, 0x6b, 0xc9, 0x13, 0x2d, 0xee, 0xa6, 0x0a, 0xe1, 0x30, 0x82, 0xf4, 0x4f, 0x9a, 0xd4, 0x1c, 0xd6, 0x28, 0x93, 0x6a, 0x4d, 0x51, 0x17, 0x6e, 0x42, 0xfc, 0x59, 0xcb, 0x76, 0xdb, 0x81, 0x5c, 0xe5, 0xab, 0x4d, 0xb9, 0x9a, 0x10, 0x4a, 0xaf, 0xea, 0x68, 0xf5, 0xd3, 0x30, 0x32, 0x9e, 0xbf, 0x25, 0x8d, 0x4e, 0xde, 0x16, 0x06, 0x4b, 0xd1, 0xd0, 0x03, 0x93, 0xd5, 0xe1, 0x57, 0x0e, 0xb8 } + +} +, +{ + "RSASSA-PSS Signature Example 7.3", + /* Message to be signed */ + 92, + { 0x80, 0x84, 0x05, 0xcd, 0xfc, 0x1a, 0x58, 0xb9, 0xbb, 0x03, 0x97, 0xc7, 0x20, 0x72, 0x2a, 0x81, 0xff, 0xfb, 0x76, 0x27, 0x8f, 0x33, 0x59, 0x17, 0xef, 0x9c, 0x47, 0x38, 0x14, 0xb3, 0xe0, 0x16, 0xba, 0x29, 0x73, 0xcd, 0x27, 0x65, 0xf8, 0xf3, 0xf8, 0x2d, 0x6c, 0xc3, 0x8a, 0xa7, 0xf8, 0x55, 0x18, 0x27, 0xfe, 0x8d, 0x1e, 0x38, 0x84, 0xb7, 0xe6, 0x1c, 0x94, 0x68, 0x3b, 0x8f, 0x82, 0xf1, 0x84, 0x3b, 0xda, 0xe2, 0x25, 0x7e, 0xee, 0xc9, 0x81, 0x2a, 0xd4, 0xc2, 0xcf, 0x28, 0x3c, 0x34, 0xe0, 0xb0, 0xae, 0x0f, 0xe3, 0xcb, 0x99, 0x0c, 0xf8, 0x8f, 0x2e, 0xf9 } +, + /* Salt */ + 20, + { 0x28, 0x03, 0x9d, 0xcf, 0xe1, 0x06, 0xd3, 0xb8, 0x29, 0x66, 0x11, 0x25, 0x8c, 0x4a, 0x56, 0x65, 0x1c, 0x9e, 0x92, 0xdd } +, + /* Signature */ + 129, + { 0x2b, 0x31, 0xfd, 0xe9, 0x98, 0x59, 0xb9, 0x77, 0xaa, 0x09, 0x58, 0x6d, 0x8e, 0x27, 0x46, 0x62, 0xb2, 0x5a, 0x2a, 0x64, 0x06, 0x40, 0xb4, 0x57, 0xf5, 0x94, 0x05, 0x1c, 0xb1, 0xe7, 0xf7, 0xa9, 0x11, 0x86, 0x54, 0x55, 0x24, 0x29, 0x26, 0xcf, 0x88, 0xfe, 0x80, 0xdf, 0xa3, 0xa7, 0x5b, 0xa9, 0x68, 0x98, 0x44, 0xa1, 0x1e, 0x63, 0x4a, 0x82, 0xb0, 0x75, 0xaf, 0xbd, 0x69, 0xc1, 0x2a, 0x0d, 0xf9, 0xd2, 0x5f, 0x84, 0xad, 0x49, 0x45, 0xdf, 0x3d, 0xc8, 0xfe, 0x90, 0xc3, 0xce, 0xfd, 0xf2, 0x6e, 0x95, 0xf0, 0x53, 0x43, 0x04, 0xb5, 0xbd, 0xba, 0x20, 0xd3, 0xe5, 0x64, 0x0a, 0x2e, 0xbf, 0xb8, 0x98, 0xaa, 0xc3, 0x5a, 0xe4, 0x0f, 0x26, 0xfc, 0xe5, 0x56, 0x3c, 0x2f, 0x9f, 0x24, 0xf3, 0x04, 0x2a, 0xf7, 0x6f, 0x3c, 0x70, 0x72, 0xd6, 0x87, 0xbb, 0xfb, 0x95, 0x9a, 0x88, 0x46, 0x0a, 0xf1 } + +} +, +{ + "RSASSA-PSS Signature Example 7.4", + /* Message to be signed */ + 231, + { 0xf3, 0x37, 0xb9, 0xba, 0xd9, 0x37, 0xde, 0x22, 0xa1, 0xa0, 0x52, 0xdf, 0xf1, 0x11, 0x34, 0xa8, 0xce, 0x26, 0x97, 0x62, 0x02, 0x98, 0x19, 0x39, 0xb9, 0x1e, 0x07, 0x15, 0xae, 0x5e, 0x60, 0x96, 0x49, 0xda, 0x1a, 0xdf, 0xce, 0xf3, 0xf4, 0xcc, 0xa5, 0x9b, 0x23, 0x83, 0x60, 0xe7, 0xd1, 0xe4, 0x96, 0xc7, 0xbf, 0x4b, 0x20, 0x4b, 0x5a, 0xcf, 0xf9, 0xbb, 0xd6, 0x16, 0x6a, 0x1d, 0x87, 0xa3, 0x6e, 0xf2, 0x24, 0x73, 0x73, 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/* Signature */ + 129, + { 0x32, 0xc7, 0xca, 0x38, 0xff, 0x26, 0x94, 0x9a, 0x15, 0x00, 0x0c, 0x4b, 0xa0, 0x4b, 0x2b, 0x13, 0xb3, 0x5a, 0x38, 0x10, 0xe5, 0x68, 0x18, 0x4d, 0x7e, 0xca, 0xba, 0xa1, 0x66, 0xb7, 0xff, 0xab, 0xdd, 0xf2, 0xb6, 0xcf, 0x4b, 0xa0, 0x71, 0x24, 0x92, 0x37, 0x90, 0xf2, 0xe5, 0xb1, 0xa5, 0xbe, 0x04, 0x0a, 0xea, 0x36, 0xfe, 0x13, 0x2e, 0xc1, 0x30, 0xe1, 0xf1, 0x05, 0x67, 0x98, 0x2d, 0x17, 0xac, 0x3e, 0x89, 0xb8, 0xd2, 0x6c, 0x30, 0x94, 0x03, 0x4e, 0x76, 0x2d, 0x2e, 0x03, 0x12, 0x64, 0xf0, 0x11, 0x70, 0xbe, 0xec, 0xb3, 0xd1, 0x43, 0x9e, 0x05, 0x84, 0x6f, 0x25, 0x45, 0x83, 0x67, 0xa7, 0xd9, 0xc0, 0x20, 0x60, 0x44, 0x46, 0x72, 0x67, 0x1e, 0x64, 0xe8, 0x77, 0x86, 0x45, 0x59, 0xca, 0x19, 0xb2, 0x07, 0x4d, 0x58, 0x8a, 0x28, 0x1b, 0x58, 0x04, 0xd2, 0x37, 0x72, 0xfb, 0xbe, 0x19 } + +} +, +{ + "RSASSA-PSS Signature Example 7.5", + /* Message to be signed */ + 51, + { 0x45, 0x01, 0x3c, 0xeb, 0xaf, 0xd9, 0x60, 0xb2, 0x55, 0x47, 0x6a, 0x8e, 0x25, 0x98, 0xb9, 0xaa, 0x32, 0xef, 0xbe, 0x6d, 0xc1, 0xf3, 0x4f, 0x4a, 0x49, 0x8d, 0x8c, 0xf5, 0xa2, 0xb4, 0x54, 0x8d, 0x08, 0xc5, 0x5d, 0x5f, 0x95, 0xf7, 0xbc, 0xc9, 0x61, 0x91, 0x63, 0x05, 0x6f, 0x2d, 0x58, 0xb5, 0x2f, 0xa0, 0x32 } +, + /* Salt */ + 20, + { 0x9d, 0x5a, 0xd8, 0xeb, 0x45, 0x21, 0x34, 0xb6, 0x5d, 0xc3, 0xa9, 0x8b, 0x6a, 0x73, 0xb5, 0xf7, 0x41, 0x60, 0x9c, 0xd6 } +, + /* Signature */ + 129, + { 0x07, 0xeb, 0x65, 0x1d, 0x75, 0xf1, 0xb5, 0x2b, 0xc2, 0x63, 0xb2, 0xe1, 0x98, 0x33, 0x6e, 0x99, 0xfb, 0xeb, 0xc4, 0xf3, 0x32, 0x04, 0x9a, 0x92, 0x2a, 0x10, 0x81, 0x56, 0x07, 0xee, 0x2d, 0x98, 0x9d, 0xb3, 0xa4, 0x49, 0x5b, 0x7d, 0xcc, 0xd3, 0x8f, 0x58, 0xa2, 0x11, 0xfb, 0x7e, 0x19, 0x31, 0x71, 0xa3, 0xd8, 0x91, 0x13, 0x24, 0x37, 0xeb, 0xca, 0x44, 0xf3, 0x18, 0xb2, 0x80, 0x50, 0x9e, 0x52, 0xb5, 0xfa, 0x98, 0xfc, 0xce, 0x82, 0x05, 0xd9, 0x69, 0x7c, 0x8e, 0xe4, 0xb7, 0xff, 0x59, 0xd4, 0xc5, 0x9c, 0x79, 0x03, 0x8a, 0x19, 0x70, 0xbd, 0x2a, 0x0d, 0x45, 0x1e, 0xcd, 0xc5, 0xef, 0x11, 0xd9, 0x97, 0x9c, 0x9d, 0x35, 0xf8, 0xc7, 0x0a, 0x61, 0x63, 0x71, 0x76, 0x07, 0x89, 0x0d, 0x58, 0x6a, 0x7c, 0x6d, 0xc0, 0x1c, 0x79, 0xf8, 0x6a, 0x8f, 0x28, 0xe8, 0x52, 0x35, 0xf8, 0xc2, 0xf1 } + +} +, +{ + "RSASSA-PSS Signature Example 7.6", + /* Message to be signed */ + 184, + { 0x23, 0x58, 0x09, 0x70, 0x86, 0xc8, 0x99, 0x32, 0x3e, 0x75, 0xd9, 0xc9, 0x0d, 0x0c, 0x09, 0xf1, 0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0x04, 0x98, 0x3e, 0xa5, 0x4c, 0x4b, 0x73, 0xfb } +, + /* Signature */ + 129, + { 0x18, 0xda, 0x3c, 0xdc, 0xfe, 0x79, 0xbf, 0xb7, 0x7f, 0xd9, 0xc3, 0x2f, 0x37, 0x7a, 0xd3, 0x99, 0x14, 0x6f, 0x0a, 0x8e, 0x81, 0x06, 0x20, 0x23, 0x32, 0x71, 0xa6, 0xe3, 0xed, 0x32, 0x48, 0x90, 0x3f, 0x5c, 0xdc, 0x92, 0xdc, 0x79, 0xb5, 0x5d, 0x3e, 0x11, 0x61, 0x5a, 0xa0, 0x56, 0xa7, 0x95, 0x85, 0x37, 0x92, 0xa3, 0x99, 0x8c, 0x34, 0x9c, 0xa5, 0xc4, 0x57, 0xe8, 0xca, 0x7d, 0x29, 0xd7, 0x96, 0xaa, 0x24, 0xf8, 0x34, 0x91, 0x70, 0x9b, 0xef, 0xcf, 0xb1, 0x51, 0x0e, 0xa5, 0x13, 0xc9, 0x28, 0x29, 0xa3, 0xf0, 0x0b, 0x10, 0x4f, 0x65, 0x56, 0x34, 0xf3, 0x20, 0x75, 0x2e, 0x13, 0x0e, 0xc0, 0xcc, 0xf6, 0x75, 0x4f, 0xf8, 0x93, 0xdb, 0x30, 0x29, 0x32, 0xbb, 0x02, 0x5e, 0xb6, 0x0e, 0x87, 0x82, 0x25, 0x98, 0xfc, 0x61, 0x9e, 0x0e, 0x98, 0x17, 0x37, 0xa9, 0xa4, 0xc4, 0x15, 0x2d, 0x33 } + +} +, +} +}, +{ + "Example 8: A 1031-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x49, 0x53, 0x70, 0xa1, 0xfb, 0x18, 0x54, 0x3c, 0x16, 0xd3, 0x63, 0x1e, 0x31, 0x63, 0x25, 0x5d, 0xf6, 0x2b, 0xe6, 0xee, 0xe8, 0x90, 0xd5, 0xf2, 0x55, 0x09, 0xe4, 0xf7, 0x78, 0xa8, 0xea, 0x6f, 0xbb, 0xbc, 0xdf, 0x85, 0xdf, 0xf6, 0x4e, 0x0d, 0x97, 0x20, 0x03, 0xab, 0x36, 0x81, 0xfb, 0xba, 0x6d, 0xd4, 0x1f, 0xd5, 0x41, 0x82, 0x9b, 0x2e, 0x58, 0x2d, 0xe9, 0xf2, 0xa4, 0xa4, 0xe0, 0xa2, 0xd0, 0x90, 0x0b, 0xef, 0x47, 0x53, 0xdb, 0x3c, 0xee, 0x0e, 0xe0, 0x6c, 0x7d, 0xfa, 0xe8, 0xb1, 0xd5, 0x3b, 0x59, 0x53, 0x21, 0x8f, 0x9c, 0xce, 0xea, 0x69, 0x5b, 0x08, 0x66, 0x8e, 0xde, 0xaa, 0xdc, 0xed, 0x94, 0x63, 0xb1, 0xd7, 0x90, 0xd5, 0xeb, 0xf2, 0x7e, 0x91, 0x15, 0xb4, 0x6c, 0xad, 0x4d, 0x9a, 0x2b, 0x8e, 0xfa, 0xb0, 0x56, 0x1b, 0x08, 0x10, 0x34, 0x47, 0x39, 0xad, 0xa0, 0x73, 0x3f } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x6c, 0x66, 0xff, 0xe9, 0x89, 0x80, 0xc3, 0x8f, 0xcd, 0xea, 0xb5, 0x15, 0x98, 0x98, 0x83, 0x61, 0x65, 0xf4, 0xb4, 0xb8, 0x17, 0xc4, 0xf6, 0xa8, 0xd4, 0x86, 0xee, 0x4e, 0xa9, 0x13, 0x0f, 0xe9, 0xb9, 0x09, 0x2b, 0xd1, 0x36, 0xd1, 0x84, 0xf9, 0x5f, 0x50, 0x4a, 0x60, 0x7e, 0xac, 0x56, 0x58, 0x46, 0xd2, 0xfd, 0xd6, 0x59, 0x7a, 0x89, 0x67, 0xc7, 0x39, 0x6e, 0xf9, 0x5a, 0x6e, 0xee, 0xbb, 0x45, 0x78, 0xa6, 0x43, 0x96, 0x6d, 0xca, 0x4d, 0x8e, 0xe3, 0xde, 0x84, 0x2d, 0xe6, 0x32, 0x79, 0xc6, 0x18, 0x15, 0x9c, 0x1a, 0xb5, 0x4a, 0x89, 0x43, 0x7b, 0x6a, 0x61, 0x20, 0xe4, 0x93, 0x0a, 0xfb, 0x52, 0xa4, 0xba, 0x6c, 0xed, 0x8a, 0x49, 0x47, 0xac, 0x64, 0xb3, 0x0a, 0x34, 0x97, 0xcb, 0xe7, 0x01, 0xc2, 0xd6, 0x26, 0x6d, 0x51, 0x72, 0x19, 0xad, 0x0e, 0xc6, 0xd3, 0x47, 0xdb, 0xe9 } +, + /* Prime p */ + 65, + { 0x08, 0xda, 0xd7, 0xf1, 0x13, 0x63, 0xfa, 0xa6, 0x23, 0xd5, 0xd6, 0xd5, 0xe8, 0xa3, 0x19, 0x32, 0x8d, 0x82, 0x19, 0x0d, 0x71, 0x27, 0xd2, 0x84, 0x6c, 0x43, 0x9b, 0x0a, 0xb7, 0x26, 0x19, 0xb0, 0xa4, 0x3a, 0x95, 0x32, 0x0e, 0x4e, 0xc3, 0x4f, 0xc3, 0xa9, 0xce, 0xa8, 0x76, 0x42, 0x23, 0x05, 0xbd, 0x76, 0xc5, 0xba, 0x7b, 0xe9, 0xe2, 0xf4, 0x10, 0xc8, 0x06, 0x06, 0x45, 0xa1, 0xd2, 0x9e, 0xdb } +, + /* Prime q */ + 65, + { 0x08, 0x47, 0xe7, 0x32, 0x37, 0x6f, 0xc7, 0x90, 0x0f, 0x89, 0x8e, 0xa8, 0x2e, 0xb2, 0xb0, 0xfc, 0x41, 0x85, 0x65, 0xfd, 0xae, 0x62, 0xf7, 0xd9, 0xec, 0x4c, 0xe2, 0x21, 0x7b, 0x97, 0x99, 0x0d, 0xd2, 0x72, 0xdb, 0x15, 0x7f, 0x99, 0xf6, 0x3c, 0x0d, 0xcb, 0xb9, 0xfb, 0xac, 0xdb, 0xd4, 0xc4, 0xda, 0xdb, 0x6d, 0xf6, 0x77, 0x56, 0x35, 0x8c, 0xa4, 0x17, 0x48, 0x25, 0xb4, 0x8f, 0x49, 0x70, 0x6d } +, + /* p's CRT exponent dP */ + 65, + { 0x05, 0xc2, 0xa8, 0x3c, 0x12, 0x4b, 0x36, 0x21, 0xa2, 0xaa, 0x57, 0xea, 0x2c, 0x3e, 0xfe, 0x03, 0x5e, 0xff, 0x45, 0x60, 0xf3, 0x3d, 0xde, 0xbb, 0x7a, 0xda, 0xb8, 0x1f, 0xce, 0x69, 0xa0, 0xc8, 0xc2, 0xed, 0xc1, 0x65, 0x20, 0xdd, 0xa8, 0x3d, 0x59, 0xa2, 0x3b, 0xe8, 0x67, 0x96, 0x3a, 0xc6, 0x5f, 0x2c, 0xc7, 0x10, 0xbb, 0xcf, 0xb9, 0x6e, 0xe1, 0x03, 0xde, 0xb7, 0x71, 0xd1, 0x05, 0xfd, 0x85 } +, + /* q's CRT exponent dQ */ + 65, + { 0x04, 0xca, 0xe8, 0xaa, 0x0d, 0x9f, 0xaa, 0x16, 0x5c, 0x87, 0xb6, 0x82, 0xec, 0x14, 0x0b, 0x8e, 0xd3, 0xb5, 0x0b, 0x24, 0x59, 0x4b, 0x7a, 0x3b, 0x2c, 0x22, 0x0b, 0x36, 0x69, 0xbb, 0x81, 0x9f, 0x98, 0x4f, 0x55, 0x31, 0x0a, 0x1a, 0xe7, 0x82, 0x36, 0x51, 0xd4, 0xa0, 0x2e, 0x99, 0x44, 0x79, 0x72, 0x59, 0x51, 0x39, 0x36, 0x34, 0x34, 0xe5, 0xe3, 0x0a, 0x7e, 0x7d, 0x24, 0x15, 0x51, 0xe1, 0xb9 } +, + /* CRT coefficient qInv */ + 65, + { 0x07, 0xd3, 0xe4, 0x7b, 0xf6, 0x86, 0x60, 0x0b, 0x11, 0xac, 0x28, 0x3c, 0xe8, 0x8d, 0xbb, 0x3f, 0x60, 0x51, 0xe8, 0xef, 0xd0, 0x46, 0x80, 0xe4, 0x4c, 0x17, 0x1e, 0xf5, 0x31, 0xb8, 0x0b, 0x2b, 0x7c, 0x39, 0xfc, 0x76, 0x63, 0x20, 0xe2, 0xcf, 0x15, 0xd8, 0xd9, 0x98, 0x20, 0xe9, 0x6f, 0xf3, 0x0d, 0xc6, 0x96, 0x91, 0x83, 0x9c, 0x4b, 0x40, 0xd7, 0xb0, 0x6e, 0x45, 0x30, 0x7d, 0xc9, 0x1f, 0x3f } + +} +, +{{ + "RSASSA-PSS Signature Example 8.1", + /* Message to be signed */ + 172, + { 0x81, 0x33, 0x2f, 0x4b, 0xe6, 0x29, 0x48, 0x41, 0x5e, 0xa1, 0xd8, 0x99, 0x79, 0x2e, 0xea, 0xcf, 0x6c, 0x6e, 0x1d, 0xb1, 0xda, 0x8b, 0xe1, 0x3b, 0x5c, 0xea, 0x41, 0xdb, 0x2f, 0xed, 0x46, 0x70, 0x92, 0xe1, 0xff, 0x39, 0x89, 0x14, 0xc7, 0x14, 0x25, 0x97, 0x75, 0xf5, 0x95, 0xf8, 0x54, 0x7f, 0x73, 0x56, 0x92, 0xa5, 0x75, 0xe6, 0x92, 0x3a, 0xf7, 0x8f, 0x22, 0xc6, 0x99, 0x7d, 0xdb, 0x90, 0xfb, 0x6f, 0x72, 0xd7, 0xbb, 0x0d, 0xd5, 0x74, 0x4a, 0x31, 0xde, 0xcd, 0x3d, 0xc3, 0x68, 0x58, 0x49, 0x83, 0x6e, 0xd3, 0x4a, 0xec, 0x59, 0x63, 0x04, 0xad, 0x11, 0x84, 0x3c, 0x4f, 0x88, 0x48, 0x9f, 0x20, 0x97, 0x35, 0xf5, 0xfb, 0x7f, 0xda, 0xf7, 0xce, 0xc8, 0xad, 0xdc, 0x58, 0x18, 0x16, 0x8f, 0x88, 0x0a, 0xcb, 0xf4, 0x90, 0xd5, 0x10, 0x05, 0xb7, 0xa8, 0xe8, 0x4e, 0x43, 0xe5, 0x42, 0x87, 0x97, 0x75, 0x71, 0xdd, 0x99, 0xee, 0xa4, 0xb1, 0x61, 0xeb, 0x2d, 0xf1, 0xf5, 0x10, 0x8f, 0x12, 0xa4, 0x14, 0x2a, 0x83, 0x32, 0x2e, 0xdb, 0x05, 0xa7, 0x54, 0x87, 0xa3, 0x43, 0x5c, 0x9a, 0x78, 0xce, 0x53, 0xed, 0x93, 0xbc, 0x55, 0x08, 0x57, 0xd7, 0xa9, 0xfb } +, + /* Salt */ + 20, + { 0x1d, 0x65, 0x49, 0x1d, 0x79, 0xc8, 0x64, 0xb3, 0x73, 0x00, 0x9b, 0xe6, 0xf6, 0xf2, 0x46, 0x7b, 0xac, 0x4c, 0x78, 0xfa } +, + /* Signature */ + 129, + { 0x02, 0x62, 0xac, 0x25, 0x4b, 0xfa, 0x77, 0xf3, 0xc1, 0xac, 0xa2, 0x2c, 0x51, 0x79, 0xf8, 0xf0, 0x40, 0x42, 0x2b, 0x3c, 0x5b, 0xaf, 0xd4, 0x0a, 0x8f, 0x21, 0xcf, 0x0f, 0xa5, 0xa6, 0x67, 0xcc, 0xd5, 0x99, 0x3d, 0x42, 0xdb, 0xaf, 0xb4, 0x09, 0xc5, 0x20, 0xe2, 0x5f, 0xce, 0x2b, 0x1e, 0xe1, 0xe7, 0x16, 0x57, 0x7f, 0x1e, 0xfa, 0x17, 0xf3, 0xda, 0x28, 0x05, 0x2f, 0x40, 0xf0, 0x41, 0x9b, 0x23, 0x10, 0x6d, 0x78, 0x45, 0xaa, 0xf0, 0x11, 0x25, 0xb6, 0x98, 0xe7, 0xa4, 0xdf, 0xe9, 0x2d, 0x39, 0x67, 0xbb, 0x00, 0xc4, 0xd0, 0xd3, 0x5b, 0xa3, 0x55, 0x2a, 0xb9, 0xa8, 0xb3, 0xee, 0xf0, 0x7c, 0x7f, 0xec, 0xdb, 0xc5, 0x42, 0x4a, 0xc4, 0xdb, 0x1e, 0x20, 0xcb, 0x37, 0xd0, 0xb2, 0x74, 0x47, 0x69, 0x94, 0x0e, 0xa9, 0x07, 0xe1, 0x7f, 0xbb, 0xca, 0x67, 0x3b, 0x20, 0x52, 0x23, 0x80, 0xc5 } + +} +, +{ + "RSASSA-PSS Signature Example 8.2", + /* Message to be signed */ + 38, + { 0xe2, 0xf9, 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, 0xf6, 0x3f, 0xbb, 0xa7, 0x75, 0xba, 0x7e } + +} +, +{ + "RSASSA-PSS Signature Example 8.3", + /* Message to be signed */ + 151, + { 0xe3, 0x5c, 0x6e, 0xd9, 0x8f, 0x64, 0xa6, 0xd5, 0xa6, 0x48, 0xfc, 0xab, 0x8a, 0xdb, 0x16, 0x33, 0x1d, 0xb3, 0x2e, 0x5d, 0x15, 0xc7, 0x4a, 0x40, 0xed, 0xf9, 0x4c, 0x3d, 0xc4, 0xa4, 0xde, 0x79, 0x2d, 0x19, 0x08, 0x89, 0xf2, 0x0f, 0x1e, 0x24, 0xed, 0x12, 0x05, 0x4a, 0x6b, 0x28, 0x79, 0x8f, 0xcb, 0x42, 0xd1, 0xc5, 0x48, 0x76, 0x9b, 0x73, 0x4c, 0x96, 0x37, 0x31, 0x42, 0x09, 0x2a, 0xed, 0x27, 0x76, 0x03, 0xf4, 0x73, 0x8d, 0xf4, 0xdc, 0x14, 0x46, 0x58, 0x6d, 0x0e, 0xc6, 0x4d, 0xa4, 0xfb, 0x60, 0x53, 0x6d, 0xb2, 0xae, 0x17, 0xfc, 0x7e, 0x3c, 0x04, 0xbb, 0xfb, 0xbb, 0xd9, 0x07, 0xbf, 0x11, 0x7c, 0x08, 0x63, 0x6f, 0xa1, 0x6f, 0x95, 0xf5, 0x1a, 0x62, 0x16, 0x93, 0x4d, 0x3e, 0x34, 0xf8, 0x50, 0x30, 0xf1, 0x7b, 0xbb, 0xc5, 0xba, 0x69, 0x14, 0x40, 0x58, 0xaf, 0xf0, 0x81, 0xe0, 0xb1, 0x9c, 0xf0, 0x3c, 0x17, 0x19, 0x5c, 0x5e, 0x88, 0x8b, 0xa5, 0x8f, 0x6f, 0xe0, 0xa0, 0x2e, 0x5c, 0x3b, 0xda, 0x97, 0x19, 0xa7 } +, + /* Salt */ + 20, + { 0xc6, 0xeb, 0xbe, 0x76, 0xdf, 0x0c, 0x4a, 0xea, 0x32, 0xc4, 0x74, 0x17, 0x5b, 0x2f, 0x13, 0x68, 0x62, 0xd0, 0x45, 0x29 } +, + /* Signature */ + 129, + { 0x2a, 0xd2, 0x05, 0x09, 0xd7, 0x8c, 0xf2, 0x6d, 0x1b, 0x6c, 0x40, 0x61, 0x46, 0x08, 0x6e, 0x4b, 0x0c, 0x91, 0xa9, 0x1c, 0x2b, 0xd1, 0x64, 0xc8, 0x7b, 0x96, 0x6b, 0x8f, 0xaa, 0x42, 0xaa, 0x0c, 0xa4, 0x46, 0x02, 0x23, 0x23, 0xba, 0x4b, 0x1a, 0x1b, 0x89, 0x70, 0x6d, 0x7f, 0x4c, 0x3b, 0xe5, 0x7d, 0x7b, 0x69, 0x70, 0x2d, 0x16, 0x8a, 0xb5, 0x95, 0x5e, 0xe2, 0x90, 0x35, 0x6b, 0x8c, 0x4a, 0x29, 0xed, 0x46, 0x7d, 0x54, 0x7e, 0xc2, 0x3c, 0xba, 0xdf, 0x28, 0x6c, 0xcb, 0x58, 0x63, 0xc6, 0x67, 0x9d, 0xa4, 0x67, 0xfc, 0x93, 0x24, 0xa1, 0x51, 0xc7, 0xec, 0x55, 0xaa, 0xc6, 0xdb, 0x40, 0x84, 0xf8, 0x27, 0x26, 0x82, 0x5c, 0xfe, 0x1a, 0xa4, 0x21, 0xbc, 0x64, 0x04, 0x9f, 0xb4, 0x2f, 0x23, 0x14, 0x8f, 0x9c, 0x25, 0xb2, 0xdc, 0x30, 0x04, 0x37, 0xc3, 0x8d, 0x42, 0x8a, 0xa7, 0x5f, 0x96 } + +} +, +{ + "RSASSA-PSS Signature Example 8.4", + /* Message to be signed */ + 204, + { 0xdb, 0xc5, 0xf7, 0x50, 0xa7, 0xa1, 0x4b, 0xe2, 0xb9, 0x3e, 0x83, 0x8d, 0x18, 0xd1, 0x4a, 0x86, 0x95, 0xe5, 0x2e, 0x8a, 0xdd, 0x9c, 0x0a, 0xc7, 0x33, 0xb8, 0xf5, 0x6d, 0x27, 0x47, 0xe5, 0x29, 0xa0, 0xcc, 0xa5, 0x32, 0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 0x67, 0xf2, 0x76, 0x81, 0x65, 0x7f, 0xe2, 0x0a } +, + /* Signature */ + 129, + { 0x1e, 0x24, 0xe6, 0xe5, 0x86, 0x28, 0xe5, 0x17, 0x50, 0x44, 0xa9, 0xeb, 0x6d, 0x83, 0x7d, 0x48, 0xaf, 0x12, 0x60, 0xb0, 0x52, 0x0e, 0x87, 0x32, 0x7d, 0xe7, 0x89, 0x7e, 0xe4, 0xd5, 0xb9, 0xf0, 0xdf, 0x0b, 0xe3, 0xe0, 0x9e, 0xd4, 0xde, 0xa8, 0xc1, 0x45, 0x4f, 0xf3, 0x42, 0x3b, 0xb0, 0x8e, 0x17, 0x93, 0x24, 0x5a, 0x9d, 0xf8, 0xbf, 0x6a, 0xb3, 0x96, 0x8c, 0x8e, 0xdd, 0xc3, 0xb5, 0x32, 0x85, 0x71, 0xc7, 0x7f, 0x09, 0x1c, 0xc5, 0x78, 0x57, 0x69, 0x12, 0xdf, 0xeb, 0xd1, 0x64, 0xb9, 0xde, 0x54, 0x54, 0xfe, 0x0b, 0xe1, 0xc1, 0xf6, 0x38, 0x5b, 0x32, 0x83, 0x60, 0xce, 0x67, 0xec, 0x7a, 0x05, 0xf6, 0xe3, 0x0e, 0xb4, 0x5c, 0x17, 0xc4, 0x8a, 0xc7, 0x00, 0x41, 0xd2, 0xca, 0xb6, 0x7f, 0x0a, 0x2a, 0xe7, 0xaa, 0xfd, 0xcc, 0x8d, 0x24, 0x5e, 0xa3, 0x44, 0x2a, 0x63, 0x00, 0xcc, 0xc7 } + +} +, +{ + "RSASSA-PSS Signature Example 8.5", + /* Message to be signed */ + 101, + { 0x04, 0xdc, 0x25, 0x1b, 0xe7, 0x2e, 0x88, 0xe5, 0x72, 0x34, 0x85, 0xb6, 0x38, 0x3a, 0x63, 0x7e, 0x2f, 0xef, 0xe0, 0x76, 0x60, 0xc5, 0x19, 0xa5, 0x60, 0xb8, 0xbc, 0x18, 0xbd, 0xed, 0xb8, 0x6e, 0xae, 0x23, 0x64, 0xea, 0x53, 0xba, 0x9d, 0xca, 0x6e, 0xb3, 0xd2, 0xe7, 0xd6, 0xb8, 0x06, 0xaf, 0x42, 0xb3, 0xe8, 0x7f, 0x29, 0x1b, 0x4a, 0x88, 0x81, 0xd5, 0xbf, 0x57, 0x2c, 0xc9, 0xa8, 0x5e, 0x19, 0xc8, 0x6a, 0xcb, 0x28, 0xf0, 0x98, 0xf9, 0xda, 0x03, 0x83, 0xc5, 0x66, 0xd3, 0xc0, 0xf5, 0x8c, 0xfd, 0x8f, 0x39, 0x5d, 0xcf, 0x60, 0x2e, 0x5c, 0xd4, 0x0e, 0x8c, 0x71, 0x83, 0xf7, 0x14, 0x99, 0x6e, 0x22, 0x97, 0xef } +, + /* Salt */ + 20, + { 0xc5, 0x58, 0xd7, 0x16, 0x7c, 0xbb, 0x45, 0x08, 0xad, 0xa0, 0x42, 0x97, 0x1e, 0x71, 0xb1, 0x37, 0x7e, 0xea, 0x42, 0x69 } +, + /* Signature */ + 129, + { 0x33, 0x34, 0x1b, 0xa3, 0x57, 0x6a, 0x13, 0x0a, 0x50, 0xe2, 0xa5, 0xcf, 0x86, 0x79, 0x22, 0x43, 0x88, 0xd5, 0x69, 0x3f, 0x5a, 0xcc, 0xc2, 0x35, 0xac, 0x95, 0xad, 0xd6, 0x8e, 0x5e, 0xb1, 0xee, 0xc3, 0x16, 0x66, 0xd0, 0xca, 0x7a, 0x1c, 0xda, 0x6f, 0x70, 0xa1, 0xaa, 0x76, 0x2c, 0x05, 0x75, 0x2a, 0x51, 0x95, 0x0c, 0xdb, 0x8a, 0xf3, 0xc5, 0x37, 0x9f, 0x18, 0xcf, 0xe6, 0xb5, 0xbc, 0x55, 0xa4, 0x64, 0x82, 0x26, 0xa1, 0x5e, 0x91, 0x2e, 0xf1, 0x9a, 0xd7, 0x7a, 0xde, 0xea, 0x91, 0x1d, 0x67, 0xcf, 0xef, 0xd6, 0x9b, 0xa4, 0x3f, 0xa4, 0x11, 0x91, 0x35, 0xff, 0x64, 0x21, 0x17, 0xba, 0x98, 0x5a, 0x7e, 0x01, 0x00, 0x32, 0x5e, 0x95, 0x19, 0xf1, 0xca, 0x6a, 0x92, 0x16, 0xbd, 0xa0, 0x55, 0xb5, 0x78, 0x50, 0x15, 0x29, 0x11, 0x25, 0xe9, 0x0d, 0xcd, 0x07, 0xa2, 0xca, 0x96, 0x73, 0xee } + +} +, +{ + "RSASSA-PSS Signature Example 8.6", + /* Message to be signed */ + 132, + { 0x0e, 0xa3, 0x7d, 0xf9, 0xa6, 0xfe, 0xa4, 0xa8, 0xb6, 0x10, 0x37, 0x3c, 0x24, 0xcf, 0x39, 0x0c, 0x20, 0xfa, 0x6e, 0x21, 0x35, 0xc4, 0x00, 0xc8, 0xa3, 0x4f, 0x5c, 0x18, 0x3a, 0x7e, 0x8e, 0xa4, 0xc9, 0xae, 0x09, 0x0e, 0xd3, 0x17, 0x59, 0xf4, 0x2d, 0xc7, 0x77, 0x19, 0xcc, 0xa4, 0x00, 0xec, 0xdc, 0xc5, 0x17, 0xac, 0xfc, 0x7a, 0xc6, 0x90, 0x26, 0x75, 0xb2, 0xef, 0x30, 0xc5, 0x09, 0x66, 0x5f, 0x33, 0x21, 0x48, 0x2f, 0xc6, 0x9a, 0x9f, 0xb5, 0x70, 0xd1, 0x5e, 0x01, 0xc8, 0x45, 0xd0, 0xd8, 0xe5, 0x0d, 0x2a, 0x24, 0xcb, 0xf1, 0xcf, 0x0e, 0x71, 0x49, 0x75, 0xa5, 0xdb, 0x7b, 0x18, 0xd9, 0xe9, 0xe9, 0xcb, 0x91, 0xb5, 0xcb, 0x16, 0x86, 0x90, 0x60, 0xed, 0x18, 0xb7, 0xb5, 0x62, 0x45, 0x50, 0x3f, 0x0c, 0xaf, 0x90, 0x35, 0x2b, 0x8d, 0xe8, 0x1c, 0xb5, 0xa1, 0xd9, 0xc6, 0x33, 0x60, 0x92, 0xf0, 0xcd } +, + /* Salt */ + 20, + { 0x76, 0xfd, 0x4e, 0x64, 0xfd, 0xc9, 0x8e, 0xb9, 0x27, 0xa0, 0x40, 0x3e, 0x35, 0xa0, 0x84, 0xe7, 0x6b, 0xa9, 0xf9, 0x2a } +, + /* Signature */ + 129, + { 0x1e, 0xd1, 0xd8, 0x48, 0xfb, 0x1e, 0xdb, 0x44, 0x12, 0x9b, 0xd9, 0xb3, 0x54, 0x79, 0x5a, 0xf9, 0x7a, 0x06, 0x9a, 0x7a, 0x00, 0xd0, 0x15, 0x10, 0x48, 0x59, 0x3e, 0x0c, 0x72, 0xc3, 0x51, 0x7f, 0xf9, 0xff, 0x2a, 0x41, 0xd0, 0xcb, 0x5a, 0x0a, 0xc8, 0x60, 0xd7, 0x36, 0xa1, 0x99, 0x70, 0x4f, 0x7c, 0xb6, 0xa5, 0x39, 0x86, 0xa8, 0x8b, 0xbd, 0x8a, 0xbc, 0xc0, 0x07, 0x6a, 0x2c, 0xe8, 0x47, 0x88, 0x00, 0x31, 0x52, 0x5d, 0x44, 0x9d, 0xa2, 0xac, 0x78, 0x35, 0x63, 0x74, 0xc5, 0x36, 0xe3, 0x43, 0xfa, 0xa7, 0xcb, 0xa4, 0x2a, 0x5a, 0xaa, 0x65, 0x06, 0x08, 0x77, 0x91, 0xc0, 0x6a, 0x8e, 0x98, 0x93, 0x35, 0xae, 0xd1, 0x9b, 0xfa, 0xb2, 0xd5, 0xe6, 0x7e, 0x27, 0xfb, 0x0c, 0x28, 0x75, 0xaf, 0x89, 0x6c, 0x21, 0xb6, 0xe8, 0xe7, 0x30, 0x9d, 0x04, 0xe4, 0xf6, 0x72, 0x7e, 0x69, 0x46, 0x3e } + +} +, +} +}, +{ + "Example 9: A 1536-bit RSA Key Pair", +{ + /* RSA modulus n */ + 192, + { 0xe6, 0xbd, 0x69, 0x2a, 0xc9, 0x66, 0x45, 0x79, 0x04, 0x03, 0xfd, 0xd0, 0xf5, 0xbe, 0xb8, 0xb9, 0xbf, 0x92, 0xed, 0x10, 0x00, 0x7f, 0xc3, 0x65, 0x04, 0x64, 0x19, 0xdd, 0x06, 0xc0, 0x5c, 0x5b, 0x5b, 0x2f, 0x48, 0xec, 0xf9, 0x89, 0xe4, 0xce, 0x26, 0x91, 0x09, 0x97, 0x9c, 0xbb, 0x40, 0xb4, 0xa0, 0xad, 0x24, 0xd2, 0x24, 0x83, 0xd1, 0xee, 0x31, 0x5a, 0xd4, 0xcc, 0xb1, 0x53, 0x42, 0x68, 0x35, 0x26, 0x91, 0xc5, 0x24, 0xf6, 0xdd, 0x8e, 0x6c, 0x29, 0xd2, 0x24, 0xcf, 0x24, 0x69, 0x73, 0xae, 0xc8, 0x6c, 0x5b, 0xf6, 0xb1, 0x40, 0x1a, 0x85, 0x0d, 0x1b, 0x9a, 0xd1, 0xbb, 0x8c, 0xbc, 0xec, 0x47, 0xb0, 0x6f, 0x0f, 0x8c, 0x7f, 0x45, 0xd3, 0xfc, 0x8f, 0x31, 0x92, 0x99, 0xc5, 0x43, 0x3d, 0xdb, 0xc2, 0xb3, 0x05, 0x3b, 0x47, 0xde, 0xd2, 0xec, 0xd4, 0xa4, 0xca, 0xef, 0xd6, 0x14, 0x83, 0x3d, 0xc8, 0xbb, 0x62, 0x2f, 0x31, 0x7e, 0xd0, 0x76, 0xb8, 0x05, 0x7f, 0xe8, 0xde, 0x3f, 0x84, 0x48, 0x0a, 0xd5, 0xe8, 0x3e, 0x4a, 0x61, 0x90, 0x4a, 0x4f, 0x24, 0x8f, 0xb3, 0x97, 0x02, 0x73, 0x57, 0xe1, 0xd3, 0x0e, 0x46, 0x31, 0x39, 0x81, 0x5c, 0x6f, 0xd4, 0xfd, 0x5a, 0xc5, 0xb8, 0x17, 0x2a, 0x45, 0x23, 0x0e, 0xcb, 0x63, 0x18, 0xa0, 0x4f, 0x14, 0x55, 0xd8, 0x4e, 0x5a, 0x8b } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 192, + { 0x6a, 0x7f, 0xd8, 0x4f, 0xb8, 0x5f, 0xad, 0x07, 0x3b, 0x34, 0x40, 0x6d, 0xb7, 0x4f, 0x8d, 0x61, 0xa6, 0xab, 0xc1, 0x21, 0x96, 0xa9, 0x61, 0xdd, 0x79, 0x56, 0x5e, 0x9d, 0xa6, 0xe5, 0x18, 0x7b, 0xce, 0x2d, 0x98, 0x02, 0x50, 0xf7, 0x35, 0x95, 0x75, 0x35, 0x92, 0x70, 0xd9, 0x15, 0x90, 0xbb, 0x0e, 0x42, 0x7c, 0x71, 0x46, 0x0b, 0x55, 0xd5, 0x14, 0x10, 0xb1, 0x91, 0xbc, 0xf3, 0x09, 0xfe, 0xa1, 0x31, 0xa9, 0x2c, 0x8e, 0x70, 0x27, 0x38, 0xfa, 0x71, 0x9f, 0x1e, 0x00, 0x41, 0xf5, 0x2e, 0x40, 0xe9, 0x1f, 0x22, 0x9f, 0x4d, 0x96, 0xa1, 0xe6, 0xf1, 0x72, 0xe1, 0x55, 0x96, 0xb4, 0x51, 0x0a, 0x6d, 0xae, 0xc2, 0x61, 0x05, 0xf2, 0xbe, 0xbc, 0x53, 0x31, 0x6b, 0x87, 0xbd, 0xf2, 0x13, 0x11, 0x66, 0x60, 0x70, 0xe8, 0xdf, 0xee, 0x69, 0xd5, 0x2c, 0x71, 0xa9, 0x76, 0xca, 0xae, 0x79, 0xc7, 0x2b, 0x68, 0xd2, 0x85, 0x80, 0xdc, 0x68, 0x6d, 0x9f, 0x51, 0x29, 0xd2, 0x25, 0xf8, 0x2b, 0x3d, 0x61, 0x55, 0x13, 0xa8, 0x82, 0xb3, 0xdb, 0x91, 0x41, 0x6b, 0x48, 0xce, 0x08, 0x88, 0x82, 0x13, 0xe3, 0x7e, 0xeb, 0x9a, 0xf8, 0x00, 0xd8, 0x1c, 0xab, 0x32, 0x8c, 0xe4, 0x20, 0x68, 0x99, 0x03, 0xc0, 0x0c, 0x7b, 0x5f, 0xd3, 0x1b, 0x75, 0x50, 0x3a, 0x6d, 0x41, 0x96, 0x84, 0xd6, 0x29 } +, + /* Prime p */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, 0xe6, 0xb4, 0x89, 0xc1, 0x76, 0x12, 0x80, 0x92, 0xd6, 0x29, 0xe4, 0x9d, 0x3d } +, + /* p's CRT exponent dP */ + 96, + { 0x2b, 0xb6, 0x8b, 0xdd, 0xfb, 0x0c, 0x4f, 0x56, 0xc8, 0x55, 0x8b, 0xff, 0xaf, 0x89, 0x2d, 0x80, 0x43, 0x03, 0x78, 0x41, 0xe7, 0xfa, 0x81, 0xcf, 0xa6, 0x1a, 0x38, 0xc5, 0xe3, 0x9b, 0x90, 0x1c, 0x8e, 0xe7, 0x11, 0x22, 0xa5, 0xda, 0x22, 0x27, 0xbd, 0x6c, 0xde, 0xeb, 0x48, 0x14, 0x52, 0xc1, 0x2a, 0xd3, 0xd6, 0x1d, 0x5e, 0x4f, 0x77, 0x6a, 0x0a, 0xb5, 0x56, 0x59, 0x1b, 0xef, 0xe3, 0xe5, 0x9e, 0x5a, 0x7f, 0xdd, 0xb8, 0x34, 0x5e, 0x1f, 0x2f, 0x35, 0xb9, 0xf4, 0xce, 0xe5, 0x7c, 0x32, 0x41, 0x4c, 0x08, 0x6a, 0xec, 0x99, 0x3e, 0x93, 0x53, 0xe4, 0x80, 0xd9, 0xee, 0xc6, 0x28, 0x9f } +, + /* q's CRT exponent dQ */ + 96, + { 0x4f, 0xf8, 0x97, 0x70, 0x9f, 0xad, 0x07, 0x97, 0x46, 0x49, 0x45, 0x78, 0xe7, 0x0f, 0xd8, 0x54, 0x61, 0x30, 0xee, 0xab, 0x56, 0x27, 0xc4, 0x9b, 0x08, 0x0f, 0x05, 0xee, 0x4a, 0xd9, 0xf3, 0xe4, 0xb7, 0xcb, 0xa9, 0xd6, 0xa5, 0xdf, 0xf1, 0x13, 0xa4, 0x1c, 0x34, 0x09, 0x33, 0x68, 0x33, 0xf1, 0x90, 0x81, 0x6d, 0x8a, 0x6b, 0xc4, 0x2e, 0x9b, 0xec, 0x56, 0xb7, 0x56, 0x7d, 0x0f, 0x3c, 0x9c, 0x69, 0x6d, 0xb6, 0x19, 0xb2, 0x45, 0xd9, 0x01, 0xdd, 0x85, 0x6d, 0xb7, 0xc8, 0x09, 0x2e, 0x77, 0xe9, 0xa1, 0xcc, 0xcd, 0x56, 0xee, 0x4d, 0xba, 0x42, 0xc5, 0xfd, 0xb6, 0x1a, 0xec, 0x26, 0x69 } +, + /* CRT coefficient qInv */ + 96, + { 0x77, 0xb9, 0xd1, 0x13, 0x7b, 0x50, 0x40, 0x4a, 0x98, 0x27, 0x29, 0x31, 0x6e, 0xfa, 0xfc, 0x7d, 0xfe, 0x66, 0xd3, 0x4e, 0x5a, 0x18, 0x26, 0x00, 0xd5, 0xf3, 0x0a, 0x0a, 0x85, 0x12, 0x05, 0x1c, 0x56, 0x0d, 0x08, 0x1d, 0x4d, 0x0a, 0x18, 0x35, 0xec, 0x3d, 0x25, 0xa6, 0x0f, 0x4e, 0x4d, 0x6a, 0xa9, 0x48, 0xb2, 0xbf, 0x3d, 0xbb, 0x5b, 0x12, 0x4c, 0xbb, 0xc3, 0x48, 0x92, 0x55, 0xa3, 0xa9, 0x48, 0x37, 0x2f, 0x69, 0x78, 0x49, 0x67, 0x45, 0xf9, 0x43, 0xe1, 0xdb, 0x4f, 0x18, 0x38, 0x2c, 0xea, 0xa5, 0x05, 0xdf, 0xc6, 0x57, 0x57, 0xbb, 0x3f, 0x85, 0x7a, 0x58, 0xdc, 0xe5, 0x21, 0x56 } + +} +, +{{ + "RSASSA-PSS Signature Example 9.1", + /* Message to be signed */ + 211, + { 0xa8, 0x8e, 0x26, 0x58, 0x55, 0xe9, 0xd7, 0xca, 0x36, 0xc6, 0x87, 0x95, 0xf0, 0xb3, 0x1b, 0x59, 0x1c, 0xd6, 0x58, 0x7c, 0x71, 0xd0, 0x60, 0xa0, 0xb3, 0xf7, 0xf3, 0xea, 0xef, 0x43, 0x79, 0x59, 0x22, 0x02, 0x8b, 0xc2, 0xb6, 0xad, 0x46, 0x7c, 0xfc, 0x2d, 0x7f, 0x65, 0x9c, 0x53, 0x85, 0xaa, 0x70, 0xba, 0x36, 0x72, 0xcd, 0xde, 0x4c, 0xfe, 0x49, 0x70, 0xcc, 0x79, 0x04, 0x60, 0x1b, 0x27, 0x88, 0x72, 0xbf, 0x51, 0x32, 0x1c, 0x4a, 0x97, 0x2f, 0x3c, 0x95, 0x57, 0x0f, 0x34, 0x45, 0xd4, 0xf5, 0x79, 0x80, 0xe0, 0xf2, 0x0d, 0xf5, 0x48, 0x46, 0xe6, 0xa5, 0x2c, 0x66, 0x8f, 0x12, 0x88, 0xc0, 0x3f, 0x95, 0x00, 0x6e, 0xa3, 0x2f, 0x56, 0x2d, 0x40, 0xd5, 0x2a, 0xf9, 0xfe, 0xb3, 0x2f, 0x0f, 0xa0, 0x6d, 0xb6, 0x5b, 0x58, 0x8a, 0x23, 0x7b, 0x34, 0xe5, 0x92, 0xd5, 0x5c, 0xf9, 0x79, 0xf9, 0x03, 0xa6, 0x42, 0xef, 0x64, 0xd2, 0xed, 0x54, 0x2a, 0xa8, 0xc7, 0x7d, 0xc1, 0xdd, 0x76, 0x2f, 0x45, 0xa5, 0x93, 0x03, 0xed, 0x75, 0xe5, 0x41, 0xca, 0x27, 0x1e, 0x2b, 0x60, 0xca, 0x70, 0x9e, 0x44, 0xfa, 0x06, 0x61, 0x13, 0x1e, 0x8d, 0x5d, 0x41, 0x63, 0xfd, 0x8d, 0x39, 0x85, 0x66, 0xce, 0x26, 0xde, 0x87, 0x30, 0xe7, 0x2f, 0x9c, 0xca, 0x73, 0x76, 0x41, 0xc2, 0x44, 0x15, 0x94, 0x20, 0x63, 0x70, 0x28, 0xdf, 0x0a, 0x18, 0x07, 0x9d, 0x62, 0x08, 0xea, 0x8b, 0x47, 0x11, 0xa2, 0xc7, 0x50, 0xf5 } +, + /* Salt */ + 20, + { 0xc0, 0xa4, 0x25, 0x31, 0x3d, 0xf8, 0xd7, 0x56, 0x4b, 0xd2, 0x43, 0x4d, 0x31, 0x15, 0x23, 0xd5, 0x25, 0x7e, 0xed,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, 0xf4, 0xeb, 0xde, 0xa8, 0x49, 0x34, 0xa9, 0xcd, 0xaf, 0x8e, 0x1a, 0x9e } + +} +, +{ + "RSASSA-PSS Signature Example 9.2", + /* Message to be signed */ + 107, + { 0xc8, 0xc9, 0xc6, 0xaf, 0x04, 0xac, 0xda, 0x41, 0x4d, 0x22, 0x7e, 0xf2, 0x3e, 0x08, 0x20, 0xc3, 0x73, 0x2c, 0x50, 0x0d, 0xc8, 0x72, 0x75, 0xe9, 0x5b, 0x0d, 0x09, 0x54, 0x13, 0x99, 0x3c, 0x26, 0x58, 0xbc, 0x1d, 0x98, 0x85, 0x81, 0xba, 0x87, 0x9c, 0x2d, 0x20, 0x1f, 0x14, 0xcb, 0x88, 0xce, 0xd1, 0x53, 0xa0, 0x19, 0x69, 0xa7, 0xbf, 0x0a, 0x7b, 0xe7, 0x9c, 0x84, 0xc1, 0x48, 0x6b, 0xc1, 0x2b, 0x3f, 0xa6, 0xc5, 0x98, 0x71, 0xb6, 0x82, 0x7c, 0x8c, 0xe2, 0x53, 0xca, 0x5f, 0xef, 0xa8, 0xa8, 0xc6, 0x90, 0xbf, 0x32, 0x6e, 0x8e, 0x37, 0xcd, 0xb9, 0x6d, 0x90, 0xa8, 0x2e, 0xba, 0xb6, 0x9f, 0x86, 0x35, 0x0e, 0x18, 0x22, 0xe8, 0xbd, 0x53, 0x6a, 0x2e } +, + /* Salt */ + 20, + { 0xb3, 0x07, 0xc4, 0x3b, 0x48, 0x50, 0xa8, 0xda, 0xc2, 0xf1, 0x5f, 0x32, 0xe3, 0x78, 0x39, 0xef, 0x8c, 0x5c, 0x0e, 0x91 } +, + /* Signature */ + 192, + { 0x80, 0xb6, 0xd6, 0x43, 0x25, 0x52, 0x09, 0xf0, 0xa4, 0x56, 0x76, 0x38, 0x97, 0xac, 0x9e, 0xd2, 0x59, 0xd4, 0x59, 0xb4, 0x9c, 0x28, 0x87, 0xe5, 0x88, 0x2e, 0xcb, 0x44, 0x34, 0xcf, 0xd6, 0x6d, 0xd7, 0xe1, 0x69, 0x93, 0x75, 0x38, 0x1e, 0x51, 0xcd, 0x7f, 0x55, 0x4f, 0x2c, 0x27, 0x17, 0x04, 0xb3, 0x99, 0xd4, 0x2b, 0x4b, 0xe2, 0x54, 0x0a, 0x0e, 0xca, 0x61, 0x95, 0x1f, 0x55, 0x26, 0x7f, 0x7c, 0x28, 0x78, 0xc1, 0x22, 0x84, 0x2d, 0xad, 0xb2, 0x8b, 0x01, 0xbd, 0x5f, 0x8c, 0x02, 0x5f, 0x7e, 0x22, 0x84, 0x18, 0xa6, 0x73, 0xc0, 0x3d, 0x6b, 0xc0, 0xc7, 0x36, 0xd0, 0xa2, 0x95, 0x46, 0xbd, 0x67, 0xf7, 0x86, 0xd9, 0xd6, 0x92, 0xcc, 0xea, 0x77, 0x8d, 0x71, 0xd9, 0x8c, 0x20, 0x63, 0xb7, 0xa7, 0x10, 0x92, 0x18, 0x7a, 0x4d, 0x35, 0xaf, 0x10, 0x81, 0x11, 0xd8, 0x3e, 0x83, 0xea, 0xe4, 0x6c, 0x46, 0xaa, 0x34, 0x27, 0x7e, 0x06, 0x04, 0x45, 0x89, 0x90, 0x37, 0x88, 0xf1, 0xd5, 0xe7, 0xce, 0xe2, 0x5f, 0xb4, 0x85, 0xe9, 0x29, 0x49, 0x11, 0x88, 0x14, 0xd6, 0xf2, 0xc3, 0xee, 0x36, 0x14, 0x89, 0x01, 0x6f, 0x32, 0x7f, 0xb5, 0xbc, 0x51, 0x7e, 0xb5, 0x04, 0x70, 0xbf, 0xfa, 0x1a, 0xfa, 0x5f, 0x4c, 0xe9, 0xaa, 0x0c, 0xe5, 0xb8, 0xee, 0x19, 0xbf, 0x55, 0x01, 0xb9, 0x58 } + +} +, +{ + "RSASSA-PSS Signature Example 9.3", + /* Message to be signed */ + 222, + { 0x0a, 0xfa, 0xd4, 0x2c, 0xcd, 0x4f, 0xc6, 0x06, 0x54, 0xa5, 0x50, 0x02, 0xd2, 0x28, 0xf5, 0x2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x22, 0x38, 0xa2, 0xde, 0xce, 0x7d, 0x23, 0xa8, 0x9b, 0x5b, 0x30, 0xc7, 0x51, 0xfd, 0x0a, 0x4a, 0x43, 0x0d, 0x2c, 0x54, 0x85, 0x94 } +, + /* Salt */ + 20, + { 0x9a, 0x2b, 0x00, 0x7e, 0x80, 0x97, 0x8b, 0xbb, 0x19, 0x2c, 0x35, 0x4e, 0xb7, 0xda, 0x9a, 0xed, 0xfc, 0x74, 0xdb, 0xf5 } +, + /* Signature */ + 192, + { 0x48, 0x44, 0x08, 0xf3, 0x89, 0x8c, 0xd5, 0xf5, 0x34, 0x83, 0xf8, 0x08, 0x19, 0xef, 0xbf, 0x27, 0x08, 0xc3, 0x4d, 0x27, 0xa8, 0xb2, 0xa6, 0xfa, 0xe8, 0xb3, 0x22, 0xf9, 0x24, 0x02, 0x37, 0xf9, 0x81, 0x81, 0x7a, 0xca, 0x18, 0x46, 0xf1, 0x08, 0x4d, 0xaa, 0x6d, 0x7c, 0x07, 0x95, 0xf6, 0xe5, 0xbf, 0x1a, 0xf5, 0x9c, 0x38, 0xe1, 0x85, 0x84, 0x37, 0xce, 0x1f, 0x7e, 0xc4, 0x19, 0xb9, 0x8c, 0x87, 0x36, 0xad, 0xf6, 0xdd, 0x9a, 0x00, 0xb1, 0x80, 0x6d, 0x2b, 0xd3, 0xad, 0x0a, 0x73, 0x77, 0x5e, 0x05, 0xf5, 0x2d, 0xfe, 0xf3, 0xa5, 0x9a, 0xb4, 0xb0, 0x81, 0x43, 0xf0, 0xdf, 0x05, 0xcd, 0x1a, 0xd9, 0xd0, 0x4b, 0xec, 0xec, 0xa6, 0xda, 0xa4, 0xa2, 0x12, 0x98, 0x03, 0xe2, 0x00, 0xcb, 0xc7, 0x77, 0x87, 0xca, 0xf4, 0xc1, 0xd0, 0x66, 0x3a, 0x6c, 0x59, 0x87, 0xb6, 0x05, 0x95, 0x20, 0x19, 0x78, 0x2c, 0xaf, 0x2e, 0xc1, 0x42, 0x6d, 0x68, 0xfb, 0x94, 0xed, 0x1d, 0x4b, 0xe8, 0x16, 0xa7, 0xed, 0x08, 0x1b, 0x77, 0xe6, 0xab, 0x33, 0x0b, 0x3f, 0xfc, 0x07, 0x38, 0x20, 0xfe, 0xcd, 0xe3, 0x72, 0x7f, 0xcb, 0xe2, 0x95, 0xee, 0x61, 0xa0, 0x50, 0xa3, 0x43, 0x65, 0x86, 0x37, 0xc3, 0xfd, 0x65, 0x9c, 0xfb, 0x63, 0x73, 0x6d, 0xe3, 0x2d, 0x9f, 0x90, 0xd3, 0xc2, 0xf6, 0x3e, 0xca } + +} +, +{ + "RSASSA-PSS Signature Example 9.4", + /* Message to be signed */ + 248, + { 0x1d, 0xfd, 0x43, 0xb4, 0x6c, 0x93, 0xdb, 0x82, 0x62, 0x9b, 0xda, 0xe2, 0xbd, 0x0a, 0x12, 0xb8, 0x82, 0xea, 0x04, 0xc3, 0xb4, 0x65, 0xf5, 0xcf, 0x93, 0x02, 0x3f, 0x01, 0x05, 0x96, 0x26, 0xdb, 0xbe, 0x99, 0xf2, 0x6b, 0xb1, 0xbe, 0x94, 0x9d, 0xdd, 0xd1, 0x6d, 0xc7, 0xf3, 0xde, 0xbb, 0x19, 0xa1, 0x94, 0x62, 0x7f, 0x0b, 0x22, 0x44, 0x34, 0xdf, 0x7d, 0x87, 0x00, 0xe9, 0xe9, 0x8b, 0x06, 0xe3, 0x60, 0xc1, 0x2f, 0xdb, 0xe3, 0xd1, 0x9f, 0x51, 0xc9, 0x68, 0x4e, 0xb9, 0x08, 0x9e, 0xcb, 0xb0, 0xa2, 0xf0, 0x45, 0x03, 0x99, 0xd3, 0xf5, 0x9e, 0xac, 0x72, 0x94, 0x08, 0x5d, 0x04, 0x4f, 0x53, 0x93, 0xc6, 0xce, 0x73, 0x74, 0x23, 0xd8, 0xb8, 0x6c, 0x41, 0x53, 0x70, 0xd3, 0x89, 0xe3, 0x0b, 0x9f, 0x0a, 0x3c, 0x02, 0xd2, 0x5d, 0x00, 0x82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x07, 0x4a, 0xe0, 0x42, 0x44, 0x95, 0xcb, 0x20, 0xe8, 0x23, 0x08, 0xb8, 0xeb, 0xb6, 0x5f, 0x41, 0x9a, 0x03, 0xfb, 0x40, 0xe7, 0x2b, 0x78, 0x98, 0x1d, 0x88, 0xaa, 0xd1, 0x43, 0x05, 0x36, 0x85, 0x17, 0x2c, 0x97, 0xb2, 0x9c, 0x8b, 0x7b, 0xf0, 0xae, 0x73, 0xb5, 0xb2, 0x26, 0x3c, 0x40, 0x3d, 0xa0, 0xed, 0x2f, 0x80, 0xff, 0x74, 0x50, 0xaf, 0x78, 0x28, 0xeb, 0x8b, 0x86, 0xf0, 0x02, 0x8b, 0xd2, 0xa8, 0xb1, 0x76, 0xa4, 0xd2, 0x28, 0xcc, 0xce, 0xa1, 0x83, 0x94, 0xf2, 0x38, 0xb0, 0x9f, 0xf7, 0x58, 0xcc, 0x00, 0xbc, 0x04, 0x30, 0x11, 0x52, 0x35, 0x57, 0x42, 0xf2, 0x82, 0xb5, 0x4e, 0x66, 0x3a, 0x91, 0x9e, 0x70, 0x9d, 0x8d, 0xa2, 0x4a, 0xde, 0x55, 0x00, 0xa7, 0xb9, 0xaa, 0x50, 0x22, 0x6e, 0x0c, 0xa5, 0x29, 0x23, 0xe6, 0xc2, 0xd8, 0x60, 0xec, 0x50, 0xff, 0x48, 0x0f, 0xa5, 0x74, 0x77, 0xe8, 0x2b, 0x05, 0x65, 0xf4, 0x37, 0x9f, 0x79, 0xc7, 0x72, 0xd5, 0xc2, 0xda, 0x80, 0xaf, 0x9f, 0xbf, 0x32, 0x5e, 0xce, 0x6f, 0xc2, 0x0b, 0x00, 0x96, 0x16, 0x14, 0xbe, 0xe8, 0x9a, 0x18, 0x3e } + +} +, +{ + "RSASSA-PSS Signature Example 9.5", + /* Message to be signed */ + 234, + { 0x1b, 0xdc, 0x6e, 0x7c, 0x98, 0xfb, 0x8c, 0xf5, 0x4e, 0x9b, 0x09, 0x7b, 0x66, 0xa8, 0x31, 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b, 0x7a, 0x77, 0x88, 0x0a, 0x3f, 0x9c, 0x7e, 0x2e, 0x8d, 0xfc, 0xa8, 0xeb, 0x5a, 0x26, 0xfb, 0x86, 0xbd, 0xc5, 0x56, 0xd4, 0x2b, 0xbe, 0x01, 0xd9, 0xfa, 0x6e, 0xd8, 0x06, 0x46, 0x49, 0x1c, 0x93, 0x41 } +, + /* Salt */ + 20, + { 0xd6, 0x89, 0x25, 0x7a, 0x86, 0xef, 0xfa, 0x68, 0x21, 0x2c, 0x5e, 0x0c, 0x61, 0x9e, 0xca, 0x29, 0x5f, 0xb9, 0x1b, 0x67 } +, + /* Signature */ + 192, + { 0x82, 0x10, 0x2d, 0xf8, 0xcb, 0x91, 0xe7, 0x17, 0x99, 0x19, 0xa0, 0x4d, 0x26, 0xd3, 0x35, 0xd6, 0x4f, 0xbc, 0x2f, 0x87, 0x2c, 0x44, 0x83, 0x39, 0x43, 0x24, 0x1d, 0xe8, 0x45, 0x48, 0x10, 0x27, 0x4c, 0xdf, 0x3d, 0xb5, 0xf4, 0x2d, 0x42, 0x3d, 0xb1, 0x52, 0xaf, 0x71, 0x35, 0xf7, 0x01, 0x42, 0x0e, 0x39, 0xb4, 0x94, 0xa6, 0x7c, 0xbf, 0xd1, 0x9f, 0x91, 0x19, 0xda, 0x23, 0x3a, 0x23, 0xda, 0x5c, 0x64, 0x39, 0xb5, 0xba, 0x0d, 0x2b, 0xc3, 0x73, 0xee, 0xe3, 0x50, 0x70, 0x01, 0x37, 0x8d, 0x4a, 0x40, 0x73, 0x85, 0x6b, 0x7f, 0xe2, 0xab, 0xa0, 0xb5, 0xee, 0x93, 0xb2, 0x7f, 0x4a, 0xfe, 0xc7, 0xd4, 0xd1, 0x20, 0x92, 0x1c, 0x83, 0xf6, 0x06, 0x76, 0x5b, 0x02, 0xc1, 0x9e, 0x4d, 0x6a, 0x1a, 0x3b, 0x95, 0xfa, 0x4c, 0x42, 0x29, 0x51, 0xbe, 0x4f, 0x52, 0x13, 0x10, 0x77, 0xef, 0x17, 0x17, 0x97, 0x29, 0xcd, 0xdf, 0xbd, 0xb5, 0x69, 0x50, 0xdb, 0xac, 0xee, 0xfe, 0x78, 0xcb, 0x16, 0x64, 0x0a, 0x09, 0x9e, 0xa5, 0x6d, 0x24, 0x38, 0x9e, 0xef, 0x10, 0xf8, 0xfe, 0xcb, 0x31, 0xba, 0x3e, 0xa3, 0xb2, 0x27, 0xc0, 0xa8, 0x66, 0x98, 0xbb, 0x89, 0xe3, 0xe9, 0x36, 0x39, 0x05, 0xbf, 0x22, 0x77, 0x7b, 0x2a, 0x3a, 0xa5, 0x21, 0xb6, 0x5b, 0x4c, 0xef, 0x76, 0xd8, 0x3b, 0xde, 0x4c } + +} +, +{ + "RSASSA-PSS Signature Example 9.6", + /* Message to be signed */ + 165, + { 0x88, 0xc7, 0xa9, 0xf1, 0x36, 0x04, 0x01, 0xd9, 0x0e, 0x53, 0xb1, 0x01, 0xb6, 0x1c, 0x53, 0x25, 0xc3, 0xc7, 0x5d, 0xb1, 0xb4, 0x11, 0xfb, 0xeb, 0x8e, 0x83, 0x0b, 0x75, 0xe9, 0x6b, 0x56, 0x67, 0x0a, 0xd2, 0x45, 0x40, 0x4e, 0x16, 0x79, 0x35, 0x44, 0xee, 0x35, 0x4b, 0xc6, 0x13, 0xa9, 0x0c, 0xc9, 0x84, 0x87, 0x15, 0xa7, 0x3d, 0xb5, 0x89, 0x3e, 0x7f, 0x6d, 0x27, 0x98, 0x15, 0xc0, 0xc1, 0xde, 0x83, 0xef, 0x8e, 0x29, 0x56, 0xe3, 0xa5, 0x6e, 0xd2, 0x6a, 0x88, 0x8d, 0x7a, 0x9c, 0xdc, 0xd0, 0x42, 0xf4, 0xb1, 0x6b, 0x7f, 0xa5, 0x1e, 0xf1, 0xa0, 0x57, 0x36, 0x62, 0xd1, 0x6a, 0x30, 0x2d, 0x0e, 0xc5, 0xb2, 0x85, 0xd2, 0xe0, 0x3a, 0xd9, 0x65, 0x29, 0xc8, 0x7b, 0x3d, 0x37, 0x4d, 0xb3, 0x72, 0xd9, 0x5b, 0x24, 0x43, 0xd0, 0x61, 0xb6, 0xb1, 0xa3, 0x50, 0xba, 0x87, 0x80, 0x7e, 0xd0, 0x83, 0xaf, 0xd1, 0xeb, 0x05, 0xc3, 0xf5, 0x2f, 0x4e, 0xba, 0x5e, 0xd2, 0x22, 0x77, 0x14, 0xfd, 0xb5, 0x0b, 0x9d, 0x9d, 0x9d, 0xd6, 0x81, 0x4f, 0x62, 0xf6, 0x27, 0x2f, 0xcd, 0x5c, 0xdb, 0xce, 0x7a, 0x9e, 0xf7, 0x97 } +, + /* Salt */ + 20, + { 0xc2, 0x5f, 0x13, 0xbf, 0x67, 0xd0, 0x81, 0x67, 0x1a, 0x04, 0x81, 0xa1, 0xf1, 0x82, 0x0d, 0x61, 0x3b, 0xba, 0x22, 0x76 } +, + /* Signature */ + 192, + { 0xa7, 0xfd, 0xb0, 0xd2, 0x59, 0x16, 0x5c, 0xa2, 0xc8, 0x8d, 0x00, 0xbb, 0xf1, 0x02, 0x8a, 0x86, 0x7d, 0x33, 0x76, 0x99, 0xd0, 0x61, 0x19, 0x3b, 0x17, 0xa9, 0x64, 0x8e, 0x14, 0xcc, 0xbb, 0xaa, 0xde, 0xac, 0xaa, 0xcd, 0xec, 0x81, 0x5e, 0x75, 0x71, 0x29, 0x4e, 0xbb, 0x8a, 0x11, 0x7a, 0xf2, 0x05, 0xfa, 0x07, 0x8b, 0x47, 0xb0, 0x71, 0x2c, 0x19, 0x9e, 0x3a, 0xd0, 0x51, 0x35, 0xc5, 0x04, 0xc2, 0x4b, 0x81, 0x70, 0x51, 0x15, 0x74, 0x08, 0x02, 0x48, 0x79, 0x92, 0xff, 0xd5, 0x11, 0xd4, 0xaf, 0xc6, 0xb8, 0x54, 0x49, 0x1e, 0xb3, 0xf0, 0xdd, 0x52, 0x31, 0x39, 0x54, 0x2f, 0xf1, 0x5c, 0x31, 0x01, 0xee, 0x85, 0x54, 0x35, 0x17, 0xc6, 0xa3, 0xc7, 0x94, 0x17, 0xc6, 0x7e, 0x2d, 0xd9, 0xaa, 0x74, 0x1e, 0x9a, 0x29, 0xb0, 0x6d, 0xcb, 0x59, 0x3c, 0x23, 0x36, 0xb3, 0x67, 0x0a, 0xe3, 0xaf, 0xba, 0xc7, 0xc3, 0xe7, 0x6e, 0x21, 0x54, 0x73, 0xe8, 0x66, 0xe3, 0x38, 0xca, 0x24, 0x4d, 0xe0, 0x0b, 0x62, 0x62, 0x4d, 0x6b, 0x94, 0x26, 0x82, 0x2c, 0xea, 0xe9, 0xf8, 0xcc, 0x46, 0x08, 0x95, 0xf4, 0x12, 0x50, 0x07, 0x3f, 0xd4, 0x5c, 0x5a, 0x1e, 0x7b, 0x42, 0x5c, 0x20, 0x4a, 0x42, 0x3a, 0x69, 0x91, 0x59, 0xf6, 0x90, 0x3e, 0x71, 0x0b, 0x37, 0xa7, 0xbb, 0x2b, 0xc8, 0x04, 0x9f } + +} +, +} +}, +{ + "Example 10: A 2048-bit RSA Key Pair", +{ + /* RSA modulus n */ + 256, + { 0xa5, 0xdd, 0x86, 0x7a, 0xc4, 0xcb, 0x02, 0xf9, 0x0b, 0x94, 0x57, 0xd4, 0x8c, 0x14, 0xa7, 0x70, 0xef, 0x99, 0x1c, 0x56, 0xc3, 0x9c, 0x0e, 0xc6, 0x5f, 0xd1, 0x1a, 0xfa, 0x89, 0x37, 0xce, 0xa5, 0x7b, 0x9b, 0xe7, 0xac, 0x73, 0xb4, 0x5c, 0x00, 0x17, 0x61, 0x5b, 0x82, 0xd6, 0x22, 0xe3, 0x18, 0x75, 0x3b, 0x60, 0x27, 0xc0, 0xfd, 0x15, 0x7b, 0xe1, 0x2f, 0x80, 0x90, 0xfe, 0xe2, 0xa7, 0xad, 0xcd, 0x0e, 0xef, 0x75, 0x9f, 0x88, 0xba, 0x49, 0x97, 0xc7, 0xa4, 0x2d, 0x58, 0xc9, 0xaa, 0x12, 0xcb, 0x99, 0xae, 0x00, 0x1f, 0xe5, 0x21, 0xc1, 0x3b, 0xb5, 0x43, 0x14, 0x45, 0xa8, 0xd5, 0xae, 0x4f, 0x5e, 0x4c, 0x7e, 0x94, 0x8a, 0xc2, 0x27, 0xd3, 0x60, 0x40, 0x71, 0xf2, 0x0e, 0x57, 0x7e, 0x90, 0x5f, 0xbe, 0xb1, 0x5d, 0xfa, 0xf0, 0x6d, 0x1d, 0xe5, 0xae, 0x62, 0x53, 0xd6, 0x3a, 0x6a, 0x21, 0x20, 0xb3, 0x1a, 0x5d, 0xa5, 0xda, 0xbc, 0x95, 0x50, 0x60, 0x0e, 0x20, 0xf2, 0x7d, 0x37, 0x39, 0xe2, 0x62, 0x79, 0x25, 0xfe, 0xa3, 0xcc, 0x50, 0x9f, 0x21, 0xdf, 0xf0, 0x4e, 0x6e, 0xea, 0x45, 0x49, 0xc5, 0x40, 0xd6, 0x80, 0x9f, 0xf9, 0x30, 0x7e, 0xed, 0xe9, 0x1f, 0xff, 0x58, 0x73, 0x3d, 0x83, 0x85, 0xa2, 0x37, 0xd6, 0xd3, 0x70, 0x5a, 0x33, 0xe3, 0x91, 0x90, 0x09, 0x92, 0x07, 0x0d, 0xf7, 0xad, 0xf1, 0x35, 0x7c, 0xf7, 0xe3, 0x70, 0x0c, 0xe3, 0x66, 0x7d, 0xe8, 0x3f, 0x17, 0xb8, 0xdf, 0x17, 0x78, 0xdb, 0x38, 0x1d, 0xce, 0x09, 0xcb, 0x4a, 0xd0, 0x58, 0xa5, 0x11, 0x00, 0x1a, 0x73, 0x81, 0x98, 0xee, 0x27, 0xcf, 0x55, 0xa1, 0x3b, 0x75, 0x45, 0x39, 0x90, 0x65, 0x82, 0xec, 0x8b, 0x17, 0x4b, 0xd5, 0x8d, 0x5d, 0x1f, 0x3d, 0x76, 0x7c, 0x61, 0x37, 0x21, 0xae, 0x05 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 256, + { 0x2d, 0x2f, 0xf5, 0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c9, 0x4e, 0xb6, 0x17, 0x31, 0x64, 0x74, 0x0c, 0x5c, 0x95, 0x14, 0x7c, 0xd5, 0xf3, 0xb5, 0xae, 0x2c, 0xb4, 0xa8, 0x37, 0x87, 0xf0, 0x1d, 0x8a, 0xb3, 0x1f, 0x27, 0xc2, 0xd0, 0xee, 0xa2, 0xdd, 0x8a, 0x11, 0xab, 0x90, 0x6a, 0xba, 0x20, 0x7c, 0x43, 0xc6, 0xee, 0x12, 0x53, 0x31 } +, + /* CRT coefficient qInv */ + 128, + { 0x12, 0xf6, 0xb2, 0xcf, 0x13, 0x74, 0xa7, 0x36, 0xfa, 0xd0, 0x56, 0x16, 0x05, 0x0f, 0x96, 0xab, 0x4b, 0x61, 0xd1, 0x17, 0x7c, 0x7f, 0x9d, 0x52, 0x5a, 0x29, 0xf3, 0xd1, 0x80, 0xe7, 0x76, 0x67, 0xe9, 0x9d, 0x99, 0xab, 0xf0, 0x52, 0x5d, 0x07, 0x58, 0x66, 0x0f, 0x37, 0x52, 0x65, 0x5b, 0x0f, 0x25, 0xb8, 0xdf, 0x84, 0x31, 0xd9, 0xa8, 0xff, 0x77, 0xc1, 0x6c, 0x12, 0xa0, 0xa5, 0x12, 0x2a, 0x9f, 0x0b, 0xf7, 0xcf, 0xd5, 0xa2, 0x66, 0xa3, 0x5c, 0x15, 0x9f, 0x99, 0x12, 0x08, 0xb9, 0x03, 0x16, 0xff, 0x44, 0x4f, 0x3e, 0x0b, 0x6b, 0xd0, 0xe9, 0x3b, 0x8a, 0x7a, 0x24, 0x48, 0xe9, 0x57, 0xe3, 0xdd, 0xa6, 0xcf, 0xcf, 0x22, 0x66, 0xb1, 0x06, 0x01, 0x3a, 0xc4, 0x68, 0x08, 0xd3, 0xb3, 0x88, 0x7b, 0x3b, 0x00, 0x34, 0x4b, 0xaa, 0xc9, 0x53, 0x0b, 0x4c, 0xe7, 0x08, 0xfc, 0x32, 0xb6 } + +} +, +{{ + "RSASSA-PSS Signature Example 10.1", + /* Message to be signed */ + 29, + { 0x88, 0x31, 0x77, 0xe5, 0x12, 0x6b, 0x9b, 0xe2, 0xd9, 0xa9, 0x68, 0x03, 0x27, 0xd5, 0x37, 0x0c, 0x6f, 0x26, 0x86, 0x1f, 0x58, 0x20, 0xc4, 0x3d, 0xa6, 0x7a, 0x3a, 0xd6, 0x09 } +, + /* Salt */ + 20, + { 0x04, 0xe2, 0x15, 0xee, 0x6f, 0xf9, 0x34, 0xb9, 0xda, 0x70, 0xd7, 0x73, 0x0c, 0x87, 0x34, 0xab, 0xfc, 0xec, 0xde, 0x89 } +, + /* Signature */ + 256, + { 0x82, 0xc2, 0xb1, 0x60, 0x09, 0x3b, 0x8a, 0xa3, 0xc0, 0xf7, 0x52, 0x2b, 0x19, 0xf8, 0x73, 0x54, 0x06, 0x6c, 0x77, 0x84, 0x7a, 0xbf, 0x2a, 0x9f, 0xce, 0x54, 0x2d, 0x0e, 0x84, 0xe9, 0x20, 0xc5, 0xaf, 0xb4, 0x9f, 0xfd, 0xfd, 0xac, 0xe1, 0x65, 0x60, 0xee, 0x94, 0xa1, 0x36, 0x96, 0x01, 0x14, 0x8e, 0xba, 0xd7, 0xa0, 0xe1, 0x51, 0xcf, 0x16, 0x33, 0x17, 0x91, 0xa5, 0x72, 0x7d, 0x05, 0xf2, 0x1e, 0x74, 0xe7, 0xeb, 0x81, 0x14, 0x40, 0x20, 0x69, 0x35, 0xd7, 0x44, 0x76, 0x5a, 0x15, 0xe7, 0x9f, 0x01, 0x5c, 0xb6, 0x6c, 0x53, 0x2c, 0x87, 0xa6, 0xa0, 0x59, 0x61, 0xc8, 0xbf, 0xad, 0x74, 0x1a, 0x9a, 0x66, 0x57, 0x02, 0x28, 0x94, 0x39, 0x3e, 0x72, 0x23, 0x73, 0x97, 0x96, 0xc0, 0x2a, 0x77, 0x45, 0x5d, 0x0f, 0x55, 0x5b, 0x0e, 0xc0, 0x1d, 0xdf, 0x25, 0x9b, 0x62, 0x07, 0xfd, 0x0f, 0xd5, 0x76, 0x14, 0xce, 0xf1, 0xa5, 0x57, 0x3b, 0xaa, 0xff, 0x4e, 0xc0, 0x00, 0x69, 0x95, 0x16, 0x59, 0xb8, 0x5f, 0x24, 0x30, 0x0a, 0x25, 0x16, 0x0c, 0xa8, 0x52, 0x2d, 0xc6, 0xe6, 0x72, 0x7e, 0x57, 0xd0, 0x19, 0xd7, 0xe6, 0x36, 0x29, 0xb8, 0xfe, 0x5e, 0x89, 0xe2, 0x5c, 0xc1, 0x5b, 0xeb, 0x3a, 0x64, 0x75, 0x77, 0x55, 0x92, 0x99, 0x28, 0x0b, 0x9b, 0x28, 0xf7, 0x9b, 0x04, 0x09, 0x00, 0x0b, 0xe2, 0x5b, 0xbd, 0x96, 0x40, 0x8b, 0xa3, 0xb4, 0x3c, 0xc4, 0x86, 0x18, 0x4d, 0xd1, 0xc8, 0xe6, 0x25, 0x53, 0xfa, 0x1a, 0xf4, 0x04, 0x0f, 0x60, 0x66, 0x3d, 0xe7, 0xf5, 0xe4, 0x9c, 0x04, 0x38, 0x8e, 0x25, 0x7f, 0x1c, 0xe8, 0x9c, 0x95, 0xda, 0xb4, 0x8a, 0x31, 0x5d, 0x9b, 0x66, 0xb1, 0xb7, 0x62, 0x82, 0x33, 0x87, 0x6f, 0xf2, 0x38, 0x52, 0x30, 0xd0, 0x70, 0xd0, 0x7e, 0x16, 0x66 } + +} +, +{ + "RSASSA-PSS Signature Example 10.2", + /* Message to be signed */ + 128, + { 0xdd, 0x67, 0x0a, 0x01, 0x46, 0x58, 0x68, 0xad, 0xc9, 0x3f, 0x26, 0x13, 0x19, 0x57, 0xa5, 0x0c, 0x52, 0xfb, 0x77, 0x7c, 0xdb, 0xaa, 0x30, 0x89, 0x2c, 0x9e, 0x12, 0x36, 0x11, 0x64, 0xec, 0x13, 0x97, 0x9d, 0x43, 0x04, 0x81, 0x18, 0xe4, 0x44, 0x5d, 0xb8, 0x7b, 0xee, 0x58, 0xdd, 0x98, 0x7b, 0x34, 0x25, 0xd0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3a, 0x5b, 0x82, 0x78, 0xae, 0xc5, 0x4d, 0xd8, 0x62, 0x2e, 0x28, 0x31, 0xd8, 0x71, 0x74, 0xf8, 0xca, 0xff, 0x43, 0xee, 0x6c, 0x46, 0x44, 0x53, 0x45, 0xd8, 0x4a, 0x59, 0x65, 0x9b, 0xfb, 0x92, 0xec, 0xd4, 0xc8, 0x18, 0x66, 0x86, 0x95, 0xf3, 0x47, 0x06, 0xf6, 0x68, 0x28, 0xa8, 0x99, 0x59, 0x63, 0x7f, 0x2b, 0xf3, 0xe3, 0x25, 0x1c, 0x24, 0xbd, 0xba, 0x4d, 0x4b, 0x76, 0x49, 0xda, 0x00, 0x22, 0x21, 0x8b, 0x11, 0x9c, 0x84, 0xe7, 0x9a, 0x65, 0x27, 0xec, 0x5b, 0x8a, 0x5f, 0x86, 0x1c, 0x15, 0x99, 0x52, 0xe2, 0x3e, 0xc0, 0x5e, 0x1e, 0x71, 0x73, 0x46, 0xfa, 0xef, 0xe8, 0xb1, 0x68, 0x68, 0x25, 0xbd, 0x2b, 0x26, 0x2f, 0xb2, 0x53, 0x10, 0x66, 0xc0, 0xde, 0x09, 0xac, 0xde, 0x2e, 0x42, 0x31, 0x69, 0x07, 0x28, 0xb5, 0xd8, 0x5e, 0x11, 0x5a, 0x2f, 0x6b, 0x92, 0xb7, 0x9c, 0x25, 0xab, 0xc9, 0xbd, 0x93, 0x99, 0xff, 0x8b, 0xcf, 0x82, 0x5a, 0x52, 0xea, 0x1f, 0x56, 0xea, 0x76, 0xdd, 0x26, 0xf4, 0x3b, 0xaa, 0xfa, 0x18, 0xbf, 0xa9, 0x2a, 0x50, 0x4c, 0xbd, 0x35, 0x69, 0x9e, 0x26, 0xd1, 0xdc, 0xc5, 0xa2, 0x88, 0x73, 0x85, 0xf3, 0xc6, 0x32, 0x32, 0xf0, 0x6f, 0x32, 0x44, 0xc3 } + +} +, +{ + "RSASSA-PSS Signature Example 10.3", + /* Message to be signed */ + 110, + { 0x48, 0xb2, 0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0x19, 0x2a, 0xc2, 0x85, 0x96, 0x51, 0xd5, 0x0b, 0xde, 0x7e, 0xb9, 0x76, 0xe5, 0x1c, 0xec, 0x82, 0x8b, 0x98, 0xb6, 0x56, 0x3b, 0x86, 0xbb } + +} +, +{ + "RSASSA-PSS Signature Example 10.4", + /* Message to be signed */ + 81, + { 0x0b, 0x87, 0x77, 0xc7, 0xf8, 0x39, 0xba, 0xf0, 0xa6, 0x4b, 0xbb, 0xdb, 0xc5, 0xce, 0x79, 0x75, 0x5c, 0x57, 0xa2, 0x05, 0xb8, 0x45, 0xc1, 0x74, 0xe2, 0xd2, 0xe9, 0x05, 0x46, 0xa0, 0x89, 0xc4, 0xe6, 0xec, 0x8a, 0xdf, 0xfa, 0x23, 0xa7, 0xea, 0x97, 0xba, 0xe6, 0xb6, 0x5d, 0x78, 0x2b, 0x82, 0xdb, 0x5d, 0x2b, 0x5a, 0x56, 0xd2, 0x2a, 0x29, 0xa0, 0x5e, 0x7c, 0x44, 0x33, 0xe2, 0xb8, 0x2a, 0x62, 0x1a, 0xbb, 0xa9, 0x0a, 0xdd, 0x05, 0xce, 0x39, 0x3f, 0xc4, 0x8a, 0x84, 0x05, 0x42, 0x45, 0x1a } +, + /* Salt */ + 20, + { 0xc7, 0xcd, 0x69, 0x8d, 0x84, 0xb6, 0x51, 0x28, 0xd8, 0x83, 0x5e, 0x3a, 0x8b, 0x1e, 0xb0, 0xe0, 0x1c, 0xb5, 0x41, 0xec } +, + /* Signature */ + 256, + { 0x34, 0x04, 0x7f, 0xf9, 0x6c, 0x4d, 0xc0, 0xdc, 0x90, 0xb2, 0xd4, 0xff, 0x59, 0xa1, 0xa3, 0x61, 0xa4, 0x75, 0x4b, 0x25, 0x5d, 0x2e, 0xe0, 0xaf, 0x7d, 0x8b, 0xf8, 0x7c, 0x9b, 0xc9, 0xe7, 0xdd, 0xee, 0xde, 0x33, 0x93, 0x4c, 0x63, 0xca, 0x1c, 0x0e, 0x3d, 0x26, 0x2c, 0xb1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, 0xfe, 0x46, 0x83, 0x11, 0x68, 0x57, 0xa2, 0x32, 0xf5, 0xeb, 0xf6, 0xc8, 0x5b, 0xe2, 0x38, 0x74, 0x5a, 0xd0, 0xf3, 0x8f, 0x76, 0x7a, 0x5f, 0xdb, 0xf4, 0x86, 0xfb } + +} +, +{ + "RSASSA-PSS Signature Example 10.5", + /* Message to be signed */ + 81, + { 0xf1, 0x03, 0x6e, 0x00, 0x8e, 0x71, 0xe9, 0x64, 0xda, 0xdc, 0x92, 0x19, 0xed, 0x30, 0xe1, 0x7f, 0x06, 0xb4, 0xb6, 0x8a, 0x95, 0x5c, 0x16, 0xb3, 0x12, 0xb1, 0xed, 0xdf, 0x02, 0x8b, 0x74, 0x97, 0x6b, 0xed, 0x6b, 0x3f, 0x6a, 0x63, 0xd4, 0xe7, 0x78, 0x59, 0x24, 0x3c, 0x9c, 0xcc, 0xdc, 0x98, 0x01, 0x65, 0x23, 0xab, 0xb0, 0x24, 0x83, 0xb3, 0x55, 0x91, 0xc3, 0x3a, 0xad, 0x81, 0x21, 0x3b, 0xb7, 0xc7, 0xbb, 0x1a, 0x47, 0x0a, 0xab, 0xc1, 0x0d, 0x44, 0x25, 0x6c, 0x4d, 0x45, 0x59, 0xd9, 0x16 } +, + /* Salt */ + 20, + { 0xef, 0xa8, 0xbf, 0xf9, 0x62, 0x12, 0xb2, 0xf4, 0xa3, 0xf3, 0x71, 0xa1, 0x0d, 0x57, 0x41, 0x52, 0x65, 0x5f, 0x5d, 0xfb } +, + /* Signature */ + 256, + { 0x7e, 0x09, 0x35, 0xea, 0x18, 0xf4, 0xd6, 0xc1, 0xd1, 0x7c, 0xe8, 0x2e, 0xb2, 0xb3, 0x83, 0x6c, 0x55, 0xb3, 0x84, 0x58, 0x9c, 0xe1, 0x9d, 0xfe, 0x74, 0x33, 0x63, 0xac, 0x99, 0x48, 0xd1, 0xf3, 0x46, 0xb7, 0xbf, 0xdd, 0xfe, 0x92, 0xef, 0xd7, 0x8a, 0xdb,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, 0x5c, 0x0c, 0xb4, 0xa9, 0x56, 0xf5, 0x6d, 0x53, 0x0b, 0x80, 0xab, 0x58, 0x9a, 0xcf, 0xef, 0xc6, 0x90, 0x75, 0x1d, 0xdf, 0x36, 0xe8, 0xd3, 0x83, 0xf8, 0x3c, 0xed, 0xd2, 0xcc } + +} +, +{ + "RSASSA-PSS Signature Example 10.6", + /* Message to be signed */ + 163, + { 0x25, 0xf1, 0x08, 0x95, 0xa8, 0x77, 0x16, 0xc1, 0x37, 0x45, 0x0b, 0xb9, 0x51, 0x9d, 0xfa, 0xa1, 0xf2, 0x07, 0xfa, 0xa9, 0x42, 0xea, 0x88, 0xab, 0xf7, 0x1e, 0x9c, 0x17, 0x98, 0x00, 0x85, 0xb5, 0x55, 0xae, 0xba, 0xb7, 0x62, 0x64, 0xae, 0x2a, 0x3a, 0xb9, 0x3c, 0x2d, 0x12, 0x98, 0x11, 0x91, 0xdd, 0xac, 0x6f, 0xb5, 0x94, 0x9e, 0xb3, 0x6a, 0xee, 0x3c, 0x5d, 0xa9, 0x40, 0xf0, 0x07, 0x52, 0xc9, 0x16, 0xd9, 0x46, 0x08, 0xfa, 0x7d, 0x97, 0xba, 0x6a, 0x29, 0x15, 0xb6, 0x88, 0xf2, 0x03, 0x23, 0xd4, 0xe9, 0xd9, 0x68, 0x01, 0xd8, 0x9a, 0x72, 0xab, 0x58, 0x92, 0xdc, 0x21, 0x17, 0xc0, 0x74, 0x34, 0xfc, 0xf9, 0x72, 0xe0, 0x58, 0xcf, 0x8c, 0x41, 0xca, 0x4b, 0x4f, 0xf5, 0x54, 0xf7, 0xd5, 0x06, 0x8a, 0xd3, 0x15, 0x5f, 0xce, 0xd0, 0xf3, 0x12, 0x5b, 0xc0, 0x4f, 0x91, 0x93, 0x37, 0x8a, 0x8f, 0x5c, 0x4c, 0x3b, 0x8c, 0xb4, 0xdd, 0x6d, 0x1c, 0xc6, 0x9d, 0x30, 0xec, 0xca, 0x6e, 0xaa, 0x51, 0xe3, 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, 0x23, 0x96, 0xd6, 0xc1, 0x1d, 0xbc, 0x12, 0x15, 0xa5, 0x6f, 0xa1, 0x71, 0x69, 0xdb, 0x95, 0x75, 0x34, 0x3e, 0xf3, 0x4f, 0x9d, 0xe3, 0x2a, 0x49, 0xcd, 0xc3, 0x17, 0x49, 0x22, 0xf2, 0x29, 0xc2, 0x3e, 0x18, 0xe4, 0x5d, 0xf9, 0x35, 0x31, 0x19, 0xec, 0x43, 0x19, 0xce, 0xdc, 0xe7, 0xa1, 0x7c, 0x64, 0x08, 0x8c, 0x1f, 0x6f, 0x52, 0xbe, 0x29, 0x63, 0x41, 0x00, 0xb3, 0x91, 0x9d, 0x38, 0xf3, 0xd1, 0xed, 0x94, 0xe6, 0x89, 0x1e, 0x66, 0xa7, 0x3b, 0x8f, 0xb8, 0x49, 0xf5, 0x87, 0x4d, 0xf5, 0x94, 0x59, 0xe2, 0x98, 0xc7, 0xbb, 0xce, 0x2e, 0xee, 0x78, 0x2a, 0x19, 0x5a, 0xa6, 0x6f, 0xe2, 0xd0, 0x73, 0x2b, 0x25, 0xe5, 0x95, 0xf5, 0x7d, 0x3e, 0x06, 0x1b, 0x1f, 0xc3, 0xe4, 0x06, 0x3b, 0xf9, 0x8f } + +} +, +} +}, +}; + From b570175b473ccc41eba11c8d2891ec8c7ca6600a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 17:19:17 +0200 Subject: [PATCH 0257/1192] add testprof/no_prng a PRNG that is no PRNG as its output is predefined and can be set by calling add_entropy() --- testprof/makefile | 2 +- testprof/makefile.icc | 2 +- testprof/makefile.mingw | 2 +- testprof/makefile.msvc | 2 +- testprof/makefile.shared | 2 +- testprof/no_prng.c | 148 +++++++++++++++++++++++++++++++++++++++ testprof/tomcrypt_test.h | 4 ++ 7 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 testprof/no_prng.c diff --git a/testprof/makefile b/testprof/makefile index 3cf37d20f..3069796d7 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -5,7 +5,7 @@ ifndef RANLIB RANLIB=ranlib endif -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o diff --git a/testprof/makefile.icc b/testprof/makefile.icc index bbfd72863..9912314c7 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -1,7 +1,7 @@ CFLAGS += -I../src/headers -I./ CC?=icc -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index 73f97e444..da4162e5c 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -4,7 +4,7 @@ CFLAGS = $(CFLAGS_OPTS) -W -I../src/headers -I. -Wall -W -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index 2078b85d9..21159053a 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -1,6 +1,6 @@ CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ -OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj \ +OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ rsa_test.obj store_test.obj test_driver.obj x86_prof.obj katja_test.obj \ dh_test.obj misc_test.obj diff --git a/testprof/makefile.shared b/testprof/makefile.shared index cf891851b..00a3db52b 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -6,7 +6,7 @@ LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o \ +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o diff --git a/testprof/no_prng.c b/testprof/no_prng.c new file mode 100644 index 000000000..dfcb8310d --- /dev/null +++ b/testprof/no_prng.c @@ -0,0 +1,148 @@ +/* LibTomCrypt, modular cryptographic library + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file no_prng.c + NO PRNG, Steffen Jaeckel +*/ + +#ifdef LTC_PKCS_1 + +static unsigned char no_prng_entropy[1024]; +static unsigned long no_prng_len = 0; +static unsigned long no_prng_offset = 0; + +/** + Start the PRNG + @param prng [out] The PRNG state to initialize + @return CRYPT_OK if successful +*/ +int no_prng_start(prng_state *prng) +{ + no_prng_len = 0; + no_prng_offset = 0; + + return CRYPT_OK; +} + +/** + Add entropy to the PRNG state + @param in The data to add + @param inlen Length of the data to add + @param prng PRNG state to update + @return CRYPT_OK if successful +*/ +int no_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) +{ + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen <= sizeof(no_prng_entropy)); + + no_prng_len = MIN(inlen, sizeof(no_prng_entropy)); + memcpy(no_prng_entropy, in, no_prng_len); + no_prng_offset = 0; + + return CRYPT_OK; + +} + +/** + Make the PRNG ready to read from + @param prng The PRNG to make active + @return CRYPT_OK if successful +*/ +int no_prng_ready(prng_state *prng) +{ + LTC_ARGCHK(prng != NULL); + + return CRYPT_OK; +} + +/** + Read from the PRNG + @param out Destination + @param outlen Length of output + @param prng The active PRNG to read from + @return Number of octets read +*/ +unsigned long no_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) +{ + LTC_ARGCHK(out != NULL); + + outlen = MIN(outlen, no_prng_len - no_prng_offset); + memcpy(out, &no_prng_entropy[no_prng_offset], outlen); + no_prng_offset += outlen; + + return outlen; +} + +/** + Terminate the PRNG + @param prng The PRNG to terminate + @return CRYPT_OK if successful +*/ +int no_prng_done(prng_state *prng) +{ + return CRYPT_OK; +} + +/** + Export the PRNG state + @param out [out] Destination + @param outlen [in/out] Max size and resulting size of the state + @param prng The PRNG to export + @return CRYPT_OK if successful +*/ +int no_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) +{ + return CRYPT_OK; +} + +/** + Import a PRNG state + @param in The PRNG state + @param inlen Size of the state + @param prng The PRNG to import + @return CRYPT_OK if successful +*/ +int no_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) +{ + return CRYPT_OK; +} + +/** + PRNG self-test + @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled +*/ +int no_prng_test(void) +{ + return CRYPT_OK; +} + +const struct ltc_prng_descriptor no_prng_desc = +{ + "no_prng", 0, + &no_prng_start, + &no_prng_add_entropy, + &no_prng_ready, + &no_prng_read, + &no_prng_done, + &no_prng_export, + &no_prng_import, + &no_prng_test +}; + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index f4d1c60ae..ff7dbff58 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -72,6 +72,10 @@ extern struct list { extern int no_results; +#ifdef LTC_PKCS_1 +extern const struct ltc_prng_descriptor no_prng_desc; +#endif + int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); From fe1b6eced7ec9fa1b3ff70abc48632fa56a49015 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 17:21:02 +0200 Subject: [PATCH 0258/1192] add testprof/pkcs_1_pss_test --- demos/test.c | 1 + testprof/makefile | 2 +- testprof/makefile.icc | 2 +- testprof/makefile.mingw | 2 +- testprof/makefile.msvc | 2 +- testprof/makefile.shared | 2 +- testprof/pkcs_1_pss_test.c | 66 ++++++++++++++++++++++++++++++++++++++ testprof/tomcrypt_test.h | 1 + 8 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 testprof/pkcs_1_pss_test.c diff --git a/demos/test.c b/demos/test.c index b19b88720..5f95d97ca 100644 --- a/demos/test.c +++ b/demos/test.c @@ -24,6 +24,7 @@ int main(void) printf("\nmodes_test...."); fflush(stdout); x = modes_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nder_test......"); fflush(stdout); x = der_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\npkcs_1_pss_test...."); fflush(stdout); x = pkcs_1_pss_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ndh_test......."); fflush(stdout); x = dh_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); diff --git a/testprof/makefile b/testprof/makefile index 3069796d7..1548926f0 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -7,7 +7,7 @@ endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o ifndef LIBTEST_S LIBTEST_S=libtomcrypt_prof.a diff --git a/testprof/makefile.icc b/testprof/makefile.icc index 9912314c7..2dc46212a 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -3,7 +3,7 @@ CC?=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o pkcs_1_pss_test.o ifndef LIBTEST_S LIBTEST_S = libtomcrypt_prof.a diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index da4162e5c..16eea6817 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -6,7 +6,7 @@ CFLAGS = $(CFLAGS_OPTS) -W -I../src/headers -I. -Wall -W OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o default: $(LIBTEST_S) diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index 21159053a..dc7f81d39 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -3,7 +3,7 @@ CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ rsa_test.obj store_test.obj test_driver.obj x86_prof.obj katja_test.obj \ -dh_test.obj misc_test.obj +dh_test.obj misc_test.obj pkcs_1_pss_test.obj tomcrypt_prof.lib: $(OBJECTS) lib /out:tomcrypt_prof.lib $(OBJECTS) diff --git a/testprof/makefile.shared b/testprof/makefile.shared index 00a3db52b..637ebdd91 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -8,7 +8,7 @@ CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-par OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o pkcs_1_pss_test.o ifndef LIBTEST LIBTEST=libtomcrypt_prof.la diff --git a/testprof/pkcs_1_pss_test.c b/testprof/pkcs_1_pss_test.c new file mode 100644 index 000000000..fe6dbdfeb --- /dev/null +++ b/testprof/pkcs_1_pss_test.c @@ -0,0 +1,66 @@ +#include + +#ifdef LTC_PKCS_1 + +#include "../notes/rsa-testvectors/pss-vect.c" + + + +int pkcs_1_pss_test(void) +{ + int prng_idx = register_prng(&no_prng_desc); + int hash_idx = find_hash("sha1"); + unsigned int i; + + DO(prng_is_valid(prng_idx)); + DO(hash_is_valid(hash_idx)); + + for (i = 0; i < sizeof(testcases)/sizeof(testcases[0]); ++i) { + testcase_t* t = &testcases[i]; + rsa_key k, *key = &k; + DOX(mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, + &key->dP, &key->qP, &key->p, &key->q, NULL), t->name); + + DOX(mp_read_unsigned_bin(key->e, t->rsa.e, t->rsa.e_l), t->name); + DOX(mp_read_unsigned_bin(key->d, t->rsa.d, t->rsa.d_l), t->name); + DOX(mp_read_unsigned_bin(key->N, t->rsa.n, t->rsa.n_l), t->name); + DOX(mp_read_unsigned_bin(key->dQ, t->rsa.dQ, t->rsa.dQ_l), t->name); + DOX(mp_read_unsigned_bin(key->dP, t->rsa.dP, t->rsa.dP_l), t->name); + DOX(mp_read_unsigned_bin(key->qP, t->rsa.qInv, t->rsa.qInv_l), t->name); + DOX(mp_read_unsigned_bin(key->q, t->rsa.q, t->rsa.q_l), t->name); + DOX(mp_read_unsigned_bin(key->p, t->rsa.p, t->rsa.p_l), t->name); + key->type = PK_PRIVATE; + + unsigned int j; + for (j = 0; j < sizeof(t->sig)/sizeof(t->sig[0]); ++j) { + rsaSig_t* s = &t->sig[j]; + unsigned char buf[20], obuf[256]; + unsigned long buflen = sizeof(buf), obuflen = sizeof(obuf); + int stat; + prng_descriptor[prng_idx].add_entropy(s->salt, s->salt_l, NULL); + DOX(hash_memory(hash_idx, s->msg, s->msg_l, buf, &buflen), s->name); + DOX(rsa_sign_hash(buf, buflen, obuf, &obuflen, NULL, prng_idx, hash_idx, s->salt_l, key), s->name); + DOX(memcmp(s->sig, obuf, s->sig_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + DOX(rsa_verify_hash(obuf, obuflen, buf, buflen, hash_idx, s->salt_l, &stat, key), s->name); + } /* for */ + + mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + } /* for */ + + return 0; +} + +#else + +int pkcs_1_pss_test(void) +{ + fprintf(stderr, "NOP"); + return 0; +} + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index ff7dbff58..82a2f0e7c 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -51,6 +51,7 @@ int cipher_hash_test(void); int modes_test(void); int mac_test(void); int pkcs_1_test(void); +int pkcs_1_pss_test(void); int store_test(void); int rsa_test(void); int dh_test(void); From 3324da26019640d7df72841f5e644d7e42a6b8f6 Mon Sep 17 00:00:00 2001 From: Jonathan Herzog Date: Sun, 20 Jan 2008 22:45:58 -0800 Subject: [PATCH 0259/1192] Fixed small padding error in the PKCS#1 PSS code. The existing LTC code for padding meassages for PSS signatures contained a small error. In particular, the PSS-passing algorithms is supposed to be given (bitlength of key - 1) as an argument. The LTC code passes (bitlength of key), and subtracts 1 in the middle of the PSS-padding. This subtraction unfortunately comes too late: a calculation using that argument has already been made. Fortunately, this bug only appeared if the bit-length of the key was 1 mod 8, and so is unlikely to show up in practice. Still, this patch fixes the problem. Conflicts: src/pk/pkcs1/pkcs_1_pss_decode.c --- src/pk/pkcs1/pkcs_1_pss_decode.c | 8 +++++--- src/pk/pkcs1/pkcs_1_pss_encode.c | 3 ++- src/pk/rsa/rsa_verify_hash.c | 9 ++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/pk/pkcs1/pkcs_1_pss_decode.c b/src/pk/pkcs1/pkcs_1_pss_decode.c index 64de79292..27aa21675 100644 --- a/src/pk/pkcs1/pkcs_1_pss_decode.c +++ b/src/pk/pkcs1/pkcs_1_pss_decode.c @@ -51,11 +51,12 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, } hLen = hash_descriptor[hash_idx].hashsize; + modulus_bitlen--; modulus_len = (modulus_bitlen>>3) + (modulus_bitlen & 7 ? 1 : 0); /* check sizes */ if ((saltlen > modulus_len) || - (modulus_len < hLen + saltlen + 2) || (siglen != modulus_len)) { + (modulus_len < hLen + saltlen + 2)) { return CRYPT_PK_INVALID_SIZE; } @@ -95,8 +96,9 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, XMEMCPY(hash, sig + x, hLen); x += hLen; + /* check the MSB */ - if ((sig[0] & ~(0xFF >> ((modulus_len<<3) - (modulus_bitlen-1)))) != 0) { + if ((sig[0] & ~(0xFF >> ((modulus_len<<3) - (modulus_bitlen)))) != 0) { err = CRYPT_INVALID_PACKET; goto LBL_ERR; } @@ -112,7 +114,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, } /* now clear the first byte [make sure smaller than modulus] */ - DB[0] &= 0xFF >> ((modulus_len<<3) - (modulus_bitlen-1)); + DB[0] &= 0xFF >> ((modulus_len<<3) - (modulus_bitlen)); /* DB = PS || 0x01 || salt, PS == modulus_len - saltlen - hLen - 2 zero bytes */ diff --git a/src/pk/pkcs1/pkcs_1_pss_encode.c b/src/pk/pkcs1/pkcs_1_pss_encode.c index 94e7bb567..d10c44d23 100644 --- a/src/pk/pkcs1/pkcs_1_pss_encode.c +++ b/src/pk/pkcs1/pkcs_1_pss_encode.c @@ -54,6 +54,7 @@ int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, } hLen = hash_descriptor[hash_idx].hashsize; + modulus_bitlen--; modulus_len = (modulus_bitlen>>3) + (modulus_bitlen & 7 ? 1 : 0); /* check sizes */ @@ -147,7 +148,7 @@ int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, out[y] = 0xBC; /* now clear the 8*modulus_len - modulus_bitlen most significant bits */ - out[0] &= 0xFF >> ((modulus_len<<3) - (modulus_bitlen-1)); + out[0] &= 0xFF >> ((modulus_len<<3) - modulus_bitlen); /* store output size */ *outlen = modulus_len; diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index a0f94c796..5639cd46f 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -92,7 +92,14 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, if (padding == LTC_PKCS_1_PSS) { /* PSS decode and verify it */ - err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat); + + if(modulus_bitlen%8 == 1){ + err = pkcs_1_pss_decode(hash, hashlen, tmpbuf+1, x-1, saltlen, hash_idx, modulus_bitlen, stat); + } + else{ + err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat); + } + } else { /* PKCS #1 v1.5 decode it */ unsigned char *out; From faa9c6a607ad6254b5d73c430c0a2a966454b43c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 17:24:05 +0200 Subject: [PATCH 0260/1192] add missing unregister of no_prng --- testprof/pkcs_1_pss_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testprof/pkcs_1_pss_test.c b/testprof/pkcs_1_pss_test.c index fe6dbdfeb..ceeb80923 100644 --- a/testprof/pkcs_1_pss_test.c +++ b/testprof/pkcs_1_pss_test.c @@ -47,6 +47,8 @@ int pkcs_1_pss_test(void) mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); } /* for */ + unregister_prng(&no_prng_desc); + return 0; } From 60b9c5a6f1f04a0e0ffa070eee5a5dc85be9bc04 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 19:13:07 +0200 Subject: [PATCH 0261/1192] make pkcs1 test more generic --- notes/rsa-testvectors/pss-vect.c | 20 ++++---- notes/rsa-testvectors/rt.py | 80 ++++++++++++++++++-------------- testprof/pkcs_1_pss_test.c | 18 +++---- 3 files changed, 65 insertions(+), 53 deletions(-) diff --git a/notes/rsa-testvectors/pss-vect.c b/notes/rsa-testvectors/pss-vect.c index 0aab4c4f8..cf75af348 100644 --- a/notes/rsa-testvectors/pss-vect.c +++ b/notes/rsa-testvectors/pss-vect.c @@ -22,23 +22,23 @@ typedef struct rsaKey { unsigned char qInv[256]; } rsaKey_t; -typedef struct rsaSig { +typedef struct rsaData { const char* name; - int msg_l; - unsigned char msg[256]; - int salt_l; - unsigned char salt[256]; - int sig_l; - unsigned char sig[256]; -} rsaSig_t; + int o1_l; + unsigned char o1[256]; + int o2_l; + unsigned char o2[256]; + int o3_l; + unsigned char o3[256]; +} rsaData_t; typedef struct testcase { const char* name; rsaKey_t rsa; - rsaSig_t sig[6]; + rsaData_t data[6]; } testcase_t; -testcase_t testcases[] = +testcase_t testcases_pss[] = { { "Example 1: A 1024-bit RSA Key Pair", diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py index b308aa497..c9de56c4b 100755 --- a/notes/rsa-testvectors/rt.py +++ b/notes/rsa-testvectors/rt.py @@ -80,33 +80,33 @@ def read_key(f): k = RsaKey(n, e, d, q, p, dP, dQ, qInv) return k -class Signature(object): - def __init__(self, name, msg, salt, sig): +class Data(object): + def __init__(self, name, obj1, obj2, obj3): self.name = name - self.msg = msg - self.salt = salt - self.sig = sig + self.obj1 = obj1 + self.obj2 = obj2 + self.obj3 = obj3 def __str__(self): - return "{{\n \"{0}\",\n{1},\n{2},\n{3}\n}}\n,".format(self.name, self.msg, self.salt, self.sig) - -def read_sig(f): - name = read_until_start(f, '# RSASSA-PSS Signature Example').strip().lstrip('# ') - msg = read_part(f, '# Message to be signed') - salt = read_part(f, '# Salt') - sig = read_part(f, '# Signature') - s = Signature(name, msg, salt, sig) + return "{{\n \"{0}\",\n{1},\n{2},\n{3}\n}}\n,".format(self.name, self.obj1, self.obj2, self.obj3) + +def read_data(f): + name = read_until_start(f, ftype.o).strip().lstrip('# ') + obj1 = read_part(f, ftype.o1) + obj2 = read_part(f, ftype.o2) + obj3 = read_part(f, ftype.o3) + s = Data(name, obj1, obj2, obj3) return s class Example(object): - def __init__(self, name, key, s): + def __init__(self, name, key, data): self.name = name self.key = key - self.s = s + self.data = data def __str__(self): res = "{{\n \"{0}\",\n{1},\n{{".format(self.name, str(self.key)) - for i in self.s: + for i in self.data: res += str(i) + '\n' res += '}\n},' return res @@ -115,16 +115,30 @@ def read_example(f): name = read_until_start(f, '# Example').strip().lstrip('# ') key = read_key(f) l = read_until_start(f, '#') - s = [] + d = [] while l.strip().startswith('# --------------------------------'): - sig = read_sig(f) - s.append(sig) + data = read_data(f) + d.append(data) l = read_until_start(f, '#') - e = Example(name, key, s) + e = Example(name, key, d) f.seek(-len(l), os.SEEK_CUR) return e + +class PkcsType(object): + def __init__(self, name): + if name == 'pss': + self.o = '# RSASSA-PSS Signature Example' + self.o1 = '# Message to be signed' + self.o2 = '# Salt' + self.o3 = '# Signature' + else: + raise ValueError('Type unknown: ' + name) + self.name = name + +ftype = PkcsType(sys.argv[2]) + print('/* Generated from file: %s\n * with md5 hash: %s\n */\n' % (sys.argv[1], md5_for_file(sys.argv[1]))) print(''' typedef struct rsaKey { @@ -146,33 +160,31 @@ def read_example(f): unsigned char qInv[256]; } rsaKey_t; -typedef struct rsaSig { +typedef struct rsaData { const char* name; - int msg_l; - unsigned char msg[256]; - int salt_l; - unsigned char salt[256]; - int sig_l; - unsigned char sig[256]; -} rsaSig_t; + int o1_l; + unsigned char o1[256]; + int o2_l; + unsigned char o2[256]; + int o3_l; + unsigned char o3[256]; +} rsaData_t; typedef struct testcase { const char* name; rsaKey_t rsa; - rsaSig_t sig[6]; + rsaData_t data[6]; } testcase_t; -testcase_t testcases[] = - {''') +testcase_t testcases_%s[] = + {''' % sys.argv[2]) with open(sys.argv[1], 'rb') as f: ex = [] while read_until_eq(f, '# ============================================='): if f.tell() == os.path.getsize(sys.argv[1]): break - e = read_example(f) -# print e - ex.append(e) + ex.append(read_example(f)) for i in ex: print(i) diff --git a/testprof/pkcs_1_pss_test.c b/testprof/pkcs_1_pss_test.c index ceeb80923..e19de754d 100644 --- a/testprof/pkcs_1_pss_test.c +++ b/testprof/pkcs_1_pss_test.c @@ -15,8 +15,8 @@ int pkcs_1_pss_test(void) DO(prng_is_valid(prng_idx)); DO(hash_is_valid(hash_idx)); - for (i = 0; i < sizeof(testcases)/sizeof(testcases[0]); ++i) { - testcase_t* t = &testcases[i]; + for (i = 0; i < sizeof(testcases_pss)/sizeof(testcases_pss[0]); ++i) { + testcase_t* t = &testcases_pss[i]; rsa_key k, *key = &k; DOX(mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL), t->name); @@ -32,16 +32,16 @@ int pkcs_1_pss_test(void) key->type = PK_PRIVATE; unsigned int j; - for (j = 0; j < sizeof(t->sig)/sizeof(t->sig[0]); ++j) { - rsaSig_t* s = &t->sig[j]; + for (j = 0; j < sizeof(t->data)/sizeof(t->data[0]); ++j) { + rsaData_t* s = &t->data[j]; unsigned char buf[20], obuf[256]; unsigned long buflen = sizeof(buf), obuflen = sizeof(obuf); int stat; - prng_descriptor[prng_idx].add_entropy(s->salt, s->salt_l, NULL); - DOX(hash_memory(hash_idx, s->msg, s->msg_l, buf, &buflen), s->name); - DOX(rsa_sign_hash(buf, buflen, obuf, &obuflen, NULL, prng_idx, hash_idx, s->salt_l, key), s->name); - DOX(memcmp(s->sig, obuf, s->sig_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); - DOX(rsa_verify_hash(obuf, obuflen, buf, buflen, hash_idx, s->salt_l, &stat, key), s->name); + prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, NULL); + DOX(hash_memory(hash_idx, s->o1, s->o1_l, buf, &buflen), s->name); + DOX(rsa_sign_hash(buf, buflen, obuf, &obuflen, NULL, prng_idx, hash_idx, s->o2_l, key), s->name); + DOX(memcmp(s->o3, obuf, s->o3_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + DOX(rsa_verify_hash(obuf, obuflen, buf, buflen, hash_idx, s->o2_l, &stat, key), s->name); } /* for */ mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); From b0c7cbfaae7382f84e9bcb777de8fcef60f91880 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 19:14:16 +0200 Subject: [PATCH 0262/1192] improve testprof/pkcs_1_pss_test --- testprof/pkcs_1_pss_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testprof/pkcs_1_pss_test.c b/testprof/pkcs_1_pss_test.c index e19de754d..fe3a126ad 100644 --- a/testprof/pkcs_1_pss_test.c +++ b/testprof/pkcs_1_pss_test.c @@ -40,8 +40,10 @@ int pkcs_1_pss_test(void) prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, NULL); DOX(hash_memory(hash_idx, s->o1, s->o1_l, buf, &buflen), s->name); DOX(rsa_sign_hash(buf, buflen, obuf, &obuflen, NULL, prng_idx, hash_idx, s->o2_l, key), s->name); + DOX(obuflen == (unsigned long)s->o3_l?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); DOX(memcmp(s->o3, obuf, s->o3_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); DOX(rsa_verify_hash(obuf, obuflen, buf, buflen, hash_idx, s->o2_l, &stat, key), s->name); + DOX(stat == 1?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); } /* for */ mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); From ed0982b7e7f006cee8638045d7e25c94ae87b372 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 19:14:36 +0200 Subject: [PATCH 0263/1192] add oaep testvectors --- notes/rsa-testvectors/oaep-vect.c | 1394 +++++++++++++++++++++++++++++ notes/rsa-testvectors/rt.py | 5 + 2 files changed, 1399 insertions(+) create mode 100644 notes/rsa-testvectors/oaep-vect.c diff --git a/notes/rsa-testvectors/oaep-vect.c b/notes/rsa-testvectors/oaep-vect.c new file mode 100644 index 000000000..cd87a3dd3 --- /dev/null +++ b/notes/rsa-testvectors/oaep-vect.c @@ -0,0 +1,1394 @@ +/* Generated from file: oaep-vect.txt + * with md5 hash: 9c79a5465c35222512ed3e7ac1ad3190 + */ + + +typedef struct rsaKey { + int n_l; + unsigned char n[256]; + int e_l; + unsigned char e[256]; + int d_l; + unsigned char d[256]; + int p_l; + unsigned char p[256]; + int q_l; + unsigned char q[256]; + int dP_l; + unsigned char dP[256]; + int dQ_l; + unsigned char dQ[256]; + int qInv_l; + unsigned char qInv[256]; +} rsaKey_t; + +typedef struct rsaData { + const char* name; + int o1_l; + unsigned char o1[256]; + int o2_l; + unsigned char o2[256]; + int o3_l; + unsigned char o3[256]; +} rsaData_t; + +typedef struct testcase { + const char* name; + rsaKey_t rsa; + rsaData_t data[6]; +} testcase_t; + +testcase_t testcases_oaep[] = + { +{ + "Example 1: A 1024-bit RSA Key Pair", +{ + /* RSA modulus n */ + 128, + { 0xa8, 0xb3, 0xb2, 0x84, 0xaf, 0x8e, 0xb5, 0x0b, 0x38, 0x70, 0x34, 0xa8, 0x60, 0xf1, 0x46, 0xc4, 0x91, 0x9f, 0x31, 0x87, 0x63, 0xcd, 0x6c, 0x55, 0x98, 0xc8, 0xae, 0x48, 0x11, 0xa1, 0xe0, 0xab, 0xc4, 0xc7, 0xe0, 0xb0, 0x82, 0xd6, 0x93, 0xa5, 0xe7, 0xfc, 0xed, 0x67, 0x5c, 0xf4, 0x66, 0x85, 0x12, 0x77, 0x2c, 0x0c, 0xbc, 0x64, 0xa7, 0x42, 0xc6, 0xc6, 0x30, 0xf5, 0x33, 0xc8, 0xcc, 0x72, 0xf6, 0x2a, 0xe8, 0x33, 0xc4, 0x0b, 0xf2, 0x58, 0x42, 0xe9, 0x84, 0xbb, 0x78, 0xbd, 0xbf, 0x97, 0xc0, 0x10, 0x7d, 0x55, 0xbd, 0xb6, 0x62, 0xf5, 0xc4, 0xe0, 0xfa, 0xb9, 0x84, 0x5c, 0xb5, 0x14, 0x8e, 0xf7, 0x39, 0x2d, 0xd3, 0xaa, 0xff, 0x93, 0xae, 0x1e, 0x6b, 0x66, 0x7b, 0xb3, 0xd4, 0x24, 0x76, 0x16, 0xd4, 0xf5, 0xba, 0x10, 0xd4, 0xcf, 0xd2, 0x26, 0xde, 0x88, 0xd3, 0x9f, 0x16, 0xfb } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x53, 0x33, 0x9c, 0xfd, 0xb7, 0x9f, 0xc8, 0x46, 0x6a, 0x65, 0x5c, 0x73, 0x16, 0xac, 0xa8, 0x5c, 0x55, 0xfd, 0x8f, 0x6d, 0xd8, 0x98, 0xfd, 0xaf, 0x11, 0x95, 0x17, 0xef, 0x4f, 0x52, 0xe8,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 0xc7, 0xb8, 0x98, 0x2d, 0x82, 0x24, 0xa4, 0x90, 0xed, 0xbe, 0xb3, 0x3d, 0x3e, 0x3d, 0x5c, 0xc9, 0x3c, 0x47, 0x65, 0x70, 0x3d, 0x1d, 0xd7, 0x91, 0x64, 0x2f, 0x1f, 0x11, 0x6a, 0x0d, 0xd8, 0x52, 0xbe, 0x24, 0x19, 0xb2, 0xaf, 0x72, 0xbf, 0xe9, 0xa0, 0x30, 0xe8, 0x60, 0xb0, 0x28, 0x8b, 0x5d, 0x77 } +, + /* p's CRT exponent dP */ + 64, + { 0x0e, 0x12, 0xbf, 0x17, 0x18, 0xe9, 0xce, 0xf5, 0x59, 0x9b, 0xa1, 0xc3, 0x88, 0x2f, 0xe8, 0x04, 0x6a, 0x90, 0x87, 0x4e, 0xef, 0xce, 0x8f, 0x2c, 0xcc, 0x20, 0xe4, 0xf2, 0x74, 0x1f, 0xb0, 0xa3, 0x3a, 0x38, 0x48, 0xae, 0xc9, 0xc9, 0x30, 0x5f, 0xbe, 0xcb, 0xd2, 0xd7, 0x68, 0x19, 0x96, 0x7d, 0x46, 0x71, 0xac, 0xc6, 0x43, 0x1e, 0x40, 0x37, 0x96, 0x8d, 0xb3, 0x78, 0x78, 0xe6, 0x95, 0xc1 } +, + /* q's CRT exponent dQ */ + 64, + { 0x95, 0x29, 0x7b, 0x0f, 0x95, 0xa2, 0xfa, 0x67, 0xd0, 0x07, 0x07, 0xd6, 0x09, 0xdf, 0xd4, 0xfc, 0x05, 0xc8, 0x9d, 0xaf, 0xc2, 0xef, 0x6d, 0x6e, 0xa5, 0x5b, 0xec, 0x77, 0x1e, 0xa3, 0x33, 0x73, 0x4d, 0x92, 0x51, 0xe7, 0x90, 0x82, 0xec, 0xda, 0x86, 0x6e, 0xfe, 0xf1, 0x3c, 0x45, 0x9e, 0x1a, 0x63, 0x13, 0x86, 0xb7, 0xe3, 0x54, 0xc8, 0x99, 0xf5, 0xf1, 0x12, 0xca, 0x85, 0xd7, 0x15, 0x83 } +, + /* CRT coefficient qInv */ + 64, + { 0x4f, 0x45, 0x6c, 0x50, 0x24, 0x93, 0xbd, 0xc0, 0xed, 0x2a, 0xb7, 0x56, 0xa3, 0xa6, 0xed, 0x4d, 0x67, 0x35, 0x2a, 0x69, 0x7d, 0x42, 0x16, 0xe9, 0x32, 0x12, 0xb1, 0x27, 0xa6, 0x3d, 0x54, 0x11, 0xce, 0x6f, 0xa9, 0x8d, 0x5d, 0xbe, 0xfd, 0x73, 0x26, 0x3e, 0x37, 0x28, 0x14, 0x27, 0x43, 0x81, 0x81, 0x66, 0xed, 0x7d, 0xd6, 0x36, 0x87, 0xdd, 0x2a, 0x8c, 0xa1, 0xd2, 0xf4, 0xfb, 0xd8, 0xe1 } + +} +, +{{ + "RSAES-OAEP Encryption Example 1.1", + /* Message to be encrypted */ + 28, + { 0x66, 0x28, 0x19, 0x4e, 0x12, 0x07, 0x3d, 0xb0, 0x3b, 0xa9, 0x4c, 0xda, 0x9e, 0xf9, 0x53, 0x23, 0x97, 0xd5, 0x0d, 0xba, 0x79, 0xb9, 0x87, 0x00, 0x4a, 0xfe, 0xfe, 0x34 } +, + /* Seed */ + 20, + { 0x18, 0xb7, 0x76, 0xea, 0x21, 0x06, 0x9d, 0x69, 0x77, 0x6a, 0x33, 0xe9, 0x6b, 0xad, 0x48, 0xe1, 0xdd, 0xa0, 0xa5, 0xef } +, + /* Encryption */ + 128, + { 0x35, 0x4f, 0xe6, 0x7b, 0x4a, 0x12, 0x6d, 0x5d, 0x35, 0xfe, 0x36, 0xc7, 0x77, 0x79, 0x1a, 0x3f, 0x7b, 0xa1, 0x3d, 0xef, 0x48, 0x4e, 0x2d, 0x39, 0x08, 0xaf, 0xf7, 0x22, 0xfa, 0xd4, 0x68, 0xfb, 0x21, 0x69, 0x6d, 0xe9, 0x5d, 0x0b, 0xe9, 0x11, 0xc2, 0xd3, 0x17, 0x4f, 0x8a, 0xfc, 0xc2, 0x01, 0x03, 0x5f, 0x7b, 0x6d, 0x8e, 0x69, 0x40, 0x2d, 0xe5, 0x45, 0x16, 0x18, 0xc2, 0x1a, 0x53, 0x5f, 0xa9, 0xd7, 0xbf, 0xc5, 0xb8, 0xdd, 0x9f, 0xc2, 0x43, 0xf8, 0xcf, 0x92, 0x7d, 0xb3, 0x13, 0x22, 0xd6, 0xe8, 0x81, 0xea, 0xa9, 0x1a, 0x99, 0x61, 0x70, 0xe6, 0x57, 0xa0, 0x5a, 0x26, 0x64, 0x26, 0xd9, 0x8c, 0x88, 0x00, 0x3f, 0x84, 0x77, 0xc1, 0x22, 0x70, 0x94, 0xa0, 0xd9, 0xfa, 0x1e, 0x8c, 0x40, 0x24, 0x30, 0x9c, 0xe1, 0xec, 0xcc, 0xb5, 0x21, 0x00, 0x35, 0xd4, 0x7a, 0xc7, 0x2e, 0x8a } + +} +, +{ + "RSAES-OAEP Encryption Example 1.2", + /* Message to be encrypted */ + 28, + { 0x75, 0x0c, 0x40, 0x47, 0xf5, 0x47, 0xe8, 0xe4, 0x14, 0x11, 0x85, 0x65, 0x23, 0x29, 0x8a, 0xc9, 0xba, 0xe2, 0x45, 0xef, 0xaf, 0x13, 0x97, 0xfb, 0xe5, 0x6f, 0x9d, 0xd5 } +, + /* Seed */ + 20, + { 0x0c, 0xc7, 0x42, 0xce, 0x4a, 0x9b, 0x7f, 0x32, 0xf9, 0x51, 0xbc, 0xb2, 0x51, 0xef, 0xd9, 0x25, 0xfe, 0x4f, 0xe3, 0x5f } +, + /* Encryption */ + 128, + { 0x64, 0x0d, 0xb1, 0xac, 0xc5, 0x8e, 0x05, 0x68, 0xfe, 0x54, 0x07, 0xe5, 0xf9, 0xb7, 0x01, 0xdf, 0xf8, 0xc3, 0xc9, 0x1e, 0x71, 0x6c, 0x53, 0x6f, 0xc7, 0xfc, 0xec, 0x6c, 0xb5, 0xb7, 0x1c, 0x11, 0x65, 0x98, 0x8d, 0x4a, 0x27, 0x9e, 0x15, 0x77, 0xd7, 0x30, 0xfc, 0x7a, 0x29, 0x93, 0x2e, 0x3f, 0x00, 0xc8, 0x15, 0x15, 0x23, 0x6d, 0x8d, 0x8e, 0x31, 0x01, 0x7a, 0x7a, 0x09, 0xdf, 0x43, 0x52, 0xd9, 0x04, 0xcd, 0xeb, 0x79, 0xaa, 0x58, 0x3a, 0xdc, 0xc3, 0x1e, 0xa6, 0x98, 0xa4, 0xc0, 0x52, 0x83, 0xda, 0xba, 0x90, 0x89, 0xbe, 0x54, 0x91, 0xf6, 0x7c, 0x1a, 0x4e, 0xe4, 0x8d, 0xc7, 0x4b, 0xbb, 0xe6, 0x64, 0x3a, 0xef, 0x84, 0x66, 0x79, 0xb4, 0xcb, 0x39, 0x5a, 0x35, 0x2d, 0x5e, 0xd1, 0x15, 0x91, 0x2d, 0xf6, 0x96, 0xff, 0xe0, 0x70, 0x29, 0x32, 0x94, 0x6d, 0x71, 0x49, 0x2b, 0x44 } + +} +, +{ + "RSAES-OAEP Encryption Example 1.3", + /* Message to be encrypted */ + 55, + { 0xd9, 0x4a, 0xe0, 0x83, 0x2e, 0x64, 0x45, 0xce, 0x42, 0x33, 0x1c, 0xb0, 0x6d, 0x53, 0x1a, 0x82, 0xb1, 0xdb, 0x4b, 0xaa, 0xd3, 0x0f, 0x74, 0x6d, 0xc9, 0x16, 0xdf, 0x24, 0xd4, 0xe3, 0xc2, 0x45, 0x1f, 0xff, 0x59, 0xa6, 0x42, 0x3e, 0xb0, 0xe1, 0xd0, 0x2d, 0x4f, 0xe6, 0x46, 0xcf, 0x69, 0x9d, 0xfd, 0x81, 0x8c, 0x6e, 0x97, 0xb0, 0x51 } +, + /* Seed */ + 20, + { 0x25, 0x14, 0xdf, 0x46, 0x95, 0x75, 0x5a, 0x67, 0xb2, 0x88, 0xea, 0xf4, 0x90, 0x5c, 0x36, 0xee, 0xc6, 0x6f, 0xd2, 0xfd } +, + /* Encryption */ + 128, + { 0x42, 0x37, 0x36, 0xed, 0x03, 0x5f, 0x60, 0x26, 0xaf, 0x27, 0x6c, 0x35, 0xc0, 0xb3, 0x74, 0x1b, 0x36, 0x5e, 0x5f, 0x76, 0xca, 0x09, 0x1b, 0x4e, 0x8c, 0x29, 0xe2, 0xf0, 0xbe, 0xfe, 0xe6, 0x03, 0x59, 0x5a, 0xa8, 0x32, 0x2d, 0x60, 0x2d, 0x2e, 0x62, 0x5e, 0x95, 0xeb, 0x81, 0xb2, 0xf1, 0xc9, 0x72, 0x4e, 0x82, 0x2e, 0xca, 0x76, 0xdb, 0x86, 0x18, 0xcf, 0x09, 0xc5, 0x34, 0x35, 0x03, 0xa4, 0x36, 0x08, 0x35, 0xb5, 0x90, 0x3b, 0xc6, 0x37, 0xe3, 0x87, 0x9f, 0xb0, 0x5e, 0x0e, 0xf3, 0x26, 0x85, 0xd5, 0xae, 0xc5, 0x06, 0x7c, 0xd7, 0xcc, 0x96, 0xfe, 0x4b, 0x26, 0x70, 0xb6, 0xea, 0xc3, 0x06, 0x6b, 0x1f, 0xcf, 0x56, 0x86, 0xb6, 0x85, 0x89, 0xaa, 0xfb, 0x7d, 0x62, 0x9b, 0x02, 0xd8, 0xf8, 0x62, 0x5c, 0xa3, 0x83, 0x36, 0x24, 0xd4, 0x80, 0x0f, 0xb0, 0x81, 0xb1, 0xcf, 0x94, 0xeb } + +} +, +{ + "RSAES-OAEP Encryption Example 1.4", + /* Message to be encrypted */ + 26, + { 0x52, 0xe6, 0x50, 0xd9, 0x8e, 0x7f, 0x2a, 0x04, 0x8b, 0x4f, 0x86, 0x85, 0x21, 0x53, 0xb9, 0x7e, 0x01, 0xdd, 0x31, 0x6f, 0x34, 0x6a, 0x19, 0xf6, 0x7a, 0x85 } +, + /* Seed */ + 20, + { 0xc4, 0x43, 0x5a, 0x3e, 0x1a, 0x18, 0xa6, 0x8b, 0x68, 0x20, 0x43, 0x62, 0x90, 0xa3, 0x7c, 0xef, 0xb8, 0x5d, 0xb3, 0xfb } +, + /* Encryption */ + 128, + { 0x45, 0xea, 0xd4, 0xca, 0x55, 0x1e, 0x66, 0x2c, 0x98, 0x00, 0xf1, 0xac, 0xa8, 0x28, 0x3b, 0x05, 0x25, 0xe6, 0xab, 0xae, 0x30, 0xbe, 0x4b, 0x4a, 0xba, 0x76, 0x2f, 0xa4, 0x0f, 0xd3, 0xd3, 0x8e, 0x22, 0xab, 0xef, 0xc6, 0x97, 0x94, 0xf6, 0xeb, 0xbb, 0xc0, 0x5d, 0xdb, 0xb1, 0x12, 0x16, 0x24, 0x7d, 0x2f, 0x41, 0x2f, 0xd0, 0xfb, 0xa8, 0x7c, 0x6e, 0x3a, 0xcd, 0x88, 0x88, 0x13, 0x64, 0x6f, 0xd0, 0xe4, 0x8e, 0x78, 0x52, 0x04, 0xf9, 0xc3, 0xf7, 0x3d, 0x6d, 0x82, 0x39, 0x56, 0x27, 0x22, 0xdd, 0xdd, 0x87, 0x71, 0xfe, 0xc4, 0x8b, 0x83, 0xa3, 0x1e, 0xe6, 0xf5, 0x92, 0xc4, 0xcf, 0xd4, 0xbc, 0x88, 0x17, 0x4f, 0x3b, 0x13, 0xa1, 0x12, 0xaa, 0xe3, 0xb9, 0xf7, 0xb8, 0x0e, 0x0f, 0xc6, 0xf7, 0x25, 0x5b, 0xa8, 0x80, 0xdc, 0x7d, 0x80, 0x21, 0xe2, 0x2a, 0xd6, 0xa8, 0x5f, 0x07, 0x55 } + +} +, +{ + "RSAES-OAEP Encryption Example 1.5", + /* Message to be encrypted */ + 20, + { 0x8d, 0xa8, 0x9f, 0xd9, 0xe5, 0xf9, 0x74, 0xa2, 0x9f, 0xef, 0xfb, 0x46, 0x2b, 0x49, 0x18, 0x0f, 0x6c, 0xf9, 0xe8, 0x02 } +, + /* Seed */ + 20, + { 0xb3, 0x18, 0xc4, 0x2d, 0xf3, 0xbe, 0x0f, 0x83, 0xfe, 0xa8, 0x23, 0xf5, 0xa7, 0xb4, 0x7e, 0xd5, 0xe4, 0x25, 0xa3, 0xb5 } +, + /* Encryption */ + 128, + { 0x36, 0xf6, 0xe3, 0x4d, 0x94, 0xa8, 0xd3, 0x4d, 0xaa, 0xcb, 0xa3, 0x3a, 0x21, 0x39, 0xd0, 0x0a, 0xd8, 0x5a, 0x93, 0x45, 0xa8, 0x60, 0x51, 0xe7, 0x30, 0x71, 0x62, 0x00, 0x56, 0xb9, 0x20, 0xe2, 0x19, 0x00, 0x58, 0x55, 0xa2, 0x13, 0xa0, 0xf2, 0x38, 0x97, 0xcd, 0xcd, 0x73, 0x1b, 0x45, 0x25, 0x7c, 0x77, 0x7f, 0xe9, 0x08, 0x20, 0x2b, 0xef, 0xdd, 0x0b, 0x58, 0x38, 0x6b, 0x12, 0x44, 0xea, 0x0c, 0xf5, 0x39, 0xa0, 0x5d, 0x5d, 0x10, 0x32, 0x9d, 0xa4, 0x4e, 0x13, 0x03, 0x0f, 0xd7, 0x60, 0xdc, 0xd6, 0x44, 0xcf, 0xef, 0x20, 0x94, 0xd1, 0x91, 0x0d, 0x3f, 0x43, 0x3e, 0x1c, 0x7c, 0x6d, 0xd1, 0x8b, 0xc1, 0xf2, 0xdf, 0x7f, 0x64, 0x3d, 0x66, 0x2f, 0xb9, 0xdd, 0x37, 0xea, 0xd9, 0x05, 0x91, 0x90, 0xf4, 0xfa, 0x66, 0xca, 0x39, 0xe8, 0x69, 0xc4, 0xeb, 0x44, 0x9c, 0xbd, 0xc4, 0x39 } + +} +, +{ + "RSAES-OAEP Encryption Example 1.6", + /* Message to be encrypted */ + 7, + { 0x26, 0x52, 0x10, 0x50, 0x84, 0x42, 0x71 } +, + /* Seed */ + 20, + { 0xe4, 0xec, 0x09, 0x82, 0xc2, 0x33, 0x6f, 0x3a, 0x67, 0x7f, 0x6a, 0x35, 0x61, 0x74, 0xeb, 0x0c, 0xe8, 0x87, 0xab, 0xc2 } +, + /* Encryption */ + 128, + { 0x42, 0xce, 0xe2, 0x61, 0x7b, 0x1e, 0xce, 0xa4, 0xdb, 0x3f, 0x48, 0x29, 0x38, 0x6f, 0xbd, 0x61, 0xda, 0xfb, 0xf0, 0x38, 0xe1, 0x80, 0xd8, 0x37, 0xc9, 0x63, 0x66, 0xdf, 0x24, 0xc0, 0x97, 0xb4, 0xab, 0x0f, 0xac, 0x6b, 0xdf, 0x59, 0x0d, 0x82, 0x1c, 0x9f, 0x10, 0x64, 0x2e, 0x68, 0x1a, 0xd0, 0x5b, 0x8d, 0x78, 0xb3, 0x78, 0xc0, 0xf4, 0x6c, 0xe2, 0xfa, 0xd6, 0x3f, 0x74, 0xe0, 0xad, 0x3d, 0xf0, 0x6b, 0x07, 0x5d, 0x7e, 0xb5, 0xf5, 0x63, 0x6f, 0x8d, 0x40, 0x3b, 0x90, 0x59, 0xca, 0x76, 0x1b, 0x5c, 0x62, 0xbb, 0x52, 0xaa, 0x45, 0x00, 0x2e, 0xa7, 0x0b, 0xaa, 0xce, 0x08, 0xde, 0xd2, 0x43, 0xb9, 0xd8, 0xcb, 0xd6, 0x2a, 0x68, 0xad, 0xe2, 0x65, 0x83, 0x2b, 0x56, 0x56, 0x4e, 0x43, 0xa6, 0xfa, 0x42, 0xed, 0x19, 0x9a, 0x09, 0x97, 0x69, 0x74, 0x2d, 0xf1, 0x53, 0x9e, 0x82, 0x55 } + +} +, +} +}, +{ + "Example 2: A 1025-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x01, 0x94, 0x7c, 0x7f, 0xce, 0x90, 0x42, 0x5f, 0x47, 0x27, 0x9e, 0x70, 0x85, 0x1f, 0x25, 0xd5, 0xe6, 0x23, 0x16, 0xfe, 0x8a, 0x1d, 0xf1, 0x93, 0x71, 0xe3, 0xe6, 0x28, 0xe2, 0x60, 0x54, 0x3e, 0x49, 0x01, 0xef, 0x60, 0x81, 0xf6, 0x8c, 0x0b, 0x81, 0x41, 0x19, 0x0d, 0x2a, 0xe8, 0xda, 0xba, 0x7d, 0x12, 0x50, 0xec, 0x6d, 0xb6, 0x36, 0xe9, 0x44, 0xec, 0x37, 0x22, 0x87, 0x7c, 0x7c, 0x1d, 0x0a, 0x67, 0xf1, 0x4b, 0x16, 0x94, 0xc5, 0xf0, 0x37, 0x94, 0x51, 0xa4, 0x3e, 0x49, 0xa3, 0x2d, 0xde, 0x83, 0x67, 0x0b, 0x73, 0xda, 0x91, 0xa1, 0xc9, 0x9b, 0xc2, 0x3b, 0x43, 0x6a, 0x60, 0x05, 0x5c, 0x61, 0x0f, 0x0b, 0xaf, 0x99, 0xc1, 0xa0, 0x79, 0x56, 0x5b, 0x95, 0xa3, 0xf1, 0x52, 0x66, 0x32, 0xd1, 0xd4, 0xda, 0x60, 0xf2, 0x0e, 0xda, 0x25, 0xe6, 0x53, 0xc4, 0xf0, 0x02, 0x76, 0x6f, 0x45 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x08, 0x23, 0xf2, 0x0f, 0xad, 0xb5, 0xda, 0x89, 0x08, 0x8a, 0x9d, 0x00, 0x89, 0x3e, 0x21, 0xfa, 0x4a, 0x1b, 0x11, 0xfb, 0xc9, 0x3c, 0x64, 0xa3, 0xbe, 0x0b, 0xaa, 0xea, 0x97, 0xfb, 0x3b, 0x93, 0xc3, 0xff, 0x71, 0x37, 0x04, 0xc1, 0x9c, 0x96, 0x3c, 0x1d, 0x10, 0x7a, 0xae, 0x99, 0x05, 0x47, 0x39, 0xf7, 0x9e, 0x02, 0xe1, 0x86, 0xde, 0x86, 0xf8, 0x7a, 0x6d, 0xde, 0xfe, 0xa6, 0xd8, 0xcc, 0xd1, 0xd3, 0xc8, 0x1a, 0x47, 0xbf, 0xa7, 0x25, 0x5b, 0xe2, 0x06, 0x01, 0xa4, 0xa4, 0xb2, 0xf0, 0x8a, 0x16, 0x7b, 0x5e, 0x27, 0x9d, 0x71, 0x5b, 0x1b, 0x45, 0x5b, 0xdd, 0x7e, 0xab, 0x24, 0x59, 0x41, 0xd9, 0x76, 0x8b, 0x9a, 0xce, 0xfb, 0x3c, 0xcd, 0xa5, 0x95, 0x2d, 0xa3, 0xce, 0xe7, 0x25, 0x25, 0xb4, 0x50, 0x16, 0x63, 0xa8, 0xee, 0x15, 0xc9, 0xe9, 0x92, 0xd9, 0x24, 0x62, 0xfe, 0x39 } +, + /* Prime p */ + 65, + { 0x01, 0x59, 0xdb, 0xde, 0x04, 0xa3, 0x3e, 0xf0, 0x6f, 0xb6, 0x08, 0xb8, 0x0b, 0x19, 0x0f, 0x4d, 0x3e, 0x22, 0xbc, 0xc1, 0x3a, 0xc8, 0xe4, 0xa0, 0x81, 0x03, 0x3a, 0xbf, 0xa4, 0x16, 0xed, 0xb0, 0xb3, 0x38, 0xaa, 0x08, 0xb5, 0x73, 0x09, 0xea, 0x5a, 0x52, 0x40, 0xe7, 0xdc, 0x6e, 0x54, 0x37, 0x8c, 0x69, 0x41, 0x4c, 0x31, 0xd9, 0x7d, 0xdb, 0x1f, 0x40, 0x6d, 0xb3, 0x76, 0x9c, 0xc4, 0x1a, 0x43 } +, + /* Prime q */ + 65, + { 0x01, 0x2b, 0x65, 0x2f, 0x30, 0x40, 0x3b, 0x38, 0xb4, 0x09, 0x95, 0xfd, 0x6f, 0xf4, 0x1a, 0x1a, 0xcc, 0x8a, 0xda, 0x70, 0x37, 0x32, 0x36, 0xb7, 0x20, 0x2d, 0x39, 0xb2, 0xee, 0x30, 0xcf, 0xb4, 0x6d, 0xb0, 0x95, 0x11, 0xf6, 0xf3, 0x07, 0xcc, 0x61, 0xcc, 0x21, 0x60, 0x6c, 0x18, 0xa7, 0x5b, 0x8a, 0x62, 0xf8, 0x22, 0xdf, 0x03, 0x1b, 0xa0, 0xdf, 0x0d, 0xaf, 0xd5, 0x50, 0x6f, 0x56, 0x8b, 0xd7 } +, + /* p's CRT exponent dP */ + 64, + { 0x43, 0x6e, 0xf5, 0x08, 0xde, 0x73, 0x65, 0x19, 0xc2, 0xda, 0x4c, 0x58, 0x0d, 0x98, 0xc8, 0x2c, 0xb7, 0x45, 0x2a, 0x3f, 0xb5, 0xef, 0xad, 0xc3, 0xb9, 0xc7, 0x78, 0x9a, 0x1b, 0xc6, 0x58, 0x4f, 0x79, 0x5a, 0xdd, 0xbb, 0xd3, 0x24, 0x39, 0xc7, 0x46, 0x86, 0x55, 0x2e, 0xcb, 0x6c, 0x2c, 0x30, 0x7a, 0x4d, 0x3a, 0xf7, 0xf5, 0x39, 0xee, 0xc1, 0x57, 0x24, 0x8c, 0x7b, 0x31, 0xf1, 0xa2, 0x55 } +, + /* q's CRT exponent dQ */ + 65, + { 0x01, 0x2b, 0x15, 0xa8, 0x9f, 0x3d, 0xfb, 0x2b, 0x39, 0x07, 0x3e, 0x73, 0xf0, 0x2b, 0xdd, 0x0c, 0x1a, 0x7b, 0x37, 0x9d, 0xd4, 0x35, 0xf0, 0x5c, 0xdd, 0xe2, 0xef, 0xf9, 0xe4, 0x62, 0x94, 0x8b, 0x7c, 0xec, 0x62, 0xee, 0x90, 0x50, 0xd5, 0xe0, 0x81, 0x6e, 0x07, 0x85, 0xa8, 0x56, 0xb4, 0x91, 0x08, 0xdc, 0xb7, 0x5f, 0x36, 0x83, 0x87, 0x4d, 0x1c, 0xa6, 0x32, 0x9a, 0x19, 0x01, 0x30, 0x66, 0xff } +, + /* CRT coefficient qInv */ + 64, + { 0x02, 0x70, 0xdb, 0x17, 0xd5, 0x91, 0x4b, 0x01, 0x8d, 0x76, 0x11, 0x8b, 0x24, 0x38, 0x9a, 0x73, 0x50, 0xec, 0x83, 0x6b, 0x00, 0x63, 0xa2, 0x17, 0x21, 0x23, 0x6f, 0xd8, 0xed, 0xb6, 0xd8, 0x9b, 0x51, 0xe7, 0xee, 0xb8, 0x7b, 0x61, 0x1b, 0x71, 0x32, 0xcb, 0x7e, 0xa7, 0x35, 0x6c, 0x23, 0x15, 0x1c, 0x1e, 0x77, 0x51, 0x50, 0x7c, 0x78, 0x6d, 0x9e, 0xe1, 0x79, 0x41, 0x70, 0xa8, 0xc8, 0xe8 } + +} +, +{{ + "RSAES-OAEP Encryption Example 2.1", + /* Message to be encrypted */ + 27, + { 0x8f, 0xf0, 0x0c, 0xaa, 0x60, 0x5c, 0x70, 0x28, 0x30, 0x63, 0x4d, 0x9a, 0x6c, 0x3d, 0x42, 0xc6, 0x52, 0xb5, 0x8c, 0xf1, 0xd9, 0x2f, 0xec, 0x57, 0x0b, 0xee, 0xe7 } +, + /* Seed */ + 20, + { 0x8c, 0x40, 0x7b, 0x5e, 0xc2, 0x89, 0x9e, 0x50, 0x99, 0xc5, 0x3e, 0x8c, 0xe7, 0x93, 0xbf, 0x94, 0xe7, 0x1b, 0x17, 0x82 } +, + /* Encryption */ + 129, + { 0x01, 0x81, 0xaf, 0x89, 0x22, 0xb9, 0xfc, 0xb4, 0xd7, 0x9d, 0x92, 0xeb, 0xe1, 0x98, 0x15, 0x99, 0x2f, 0xc0, 0xc1, 0x43, 0x9d, 0x8b, 0xcd, 0x49, 0x13, 0x98, 0xa0, 0xf4, 0xad, 0x3a, 0x32, 0x9a, 0x5b, 0xd9, 0x38, 0x55, 0x60, 0xdb, 0x53, 0x26, 0x83, 0xc8, 0xb7, 0xda, 0x04, 0xe4, 0xb1, 0x2a, 0xed, 0x6a, 0xac, 0xdf, 0x47, 0x1c, 0x34, 0xc9, 0xcd, 0xa8, 0x91, 0xad, 0xdc, 0xc2, 0xdf, 0x34, 0x56, 0x65, 0x3a, 0xa6, 0x38, 0x2e, 0x9a, 0xe5, 0x9b, 0x54, 0x45, 0x52, 0x57, 0xeb, 0x09, 0x9d, 0x56, 0x2b, 0xbe, 0x10, 0x45, 0x3f, 0x2b, 0x6d, 0x13, 0xc5, 0x9c, 0x02, 0xe1, 0x0f, 0x1f, 0x8a, 0xbb, 0x5d, 0xa0, 0xd0, 0x57, 0x09, 0x32, 0xda, 0xcf, 0x2d, 0x09, 0x01, 0xdb, 0x72, 0x9d, 0x0f, 0xef, 0xcc, 0x05, 0x4e, 0x70, 0x96, 0x8e, 0xa5, 0x40, 0xc8, 0x1b, 0x04, 0xbc, 0xae, 0xfe, 0x72, 0x0e } + +} +, +{ + "RSAES-OAEP Encryption Example 2.2", + /* Message to be encrypted */ + 1, + { 0x2d } +, + /* Seed */ + 20, + { 0xb6, 0x00, 0xcf, 0x3c, 0x2e, 0x50, 0x6d, 0x7f, 0x16, 0x77, 0x8c, 0x91, 0x0d, 0x3a, 0x8b, 0x00, 0x3e, 0xee, 0x61, 0xd5 } +, + /* Encryption */ + 129, + { 0x01, 0x87, 0x59, 0xff, 0x1d, 0xf6, 0x3b, 0x27, 0x92, 0x41, 0x05, 0x62, 0x31, 0x44, 0x16, 0xa8, 0xae, 0xaf, 0x2a, 0xc6, 0x34, 0xb4, 0x6f, 0x94, 0x0a, 0xb8, 0x2d, 0x64, 0xdb, 0xf1, 0x65, 0xee, 0xe3, 0x30, 0x11, 0xda, 0x74, 0x9d, 0x4b, 0xab, 0x6e, 0x2f, 0xcd, 0x18, 0x12, 0x9c, 0x9e, 0x49, 0x27, 0x7d, 0x84, 0x53, 0x11, 0x2b, 0x42, 0x9a, 0x22, 0x2a, 0x84, 0x71, 0xb0, 0x70, 0x99, 0x39, 0x98, 0xe7, 0x58, 0x86, 0x1c, 0x4d, 0x3f, 0x6d, 0x74, 0x9d, 0x91, 0xc4, 0x29, 0x0d, 0x33, 0x2c, 0x7a, 0x4a, 0xb3, 0xf7, 0xea, 0x35, 0xff, 0x3a, 0x07, 0xd4, 0x97, 0xc9, 0x55, 0xff, 0x0f, 0xfc, 0x95, 0x00, 0x6b, 0x62, 0xc6, 0xd2, 0x96, 0x81, 0x0d, 0x9b, 0xfa, 0xb0, 0x24, 0x19, 0x6c, 0x79, 0x34, 0x01, 0x2c, 0x2d, 0xf9, 0x78, 0xef, 0x29, 0x9a, 0xba, 0x23, 0x99, 0x40, 0xcb, 0xa1, 0x02, 0x45 } + +} +, +{ + "RSAES-OAEP Encryption Example 2.3", + /* Message to be encrypted */ + 26, + { 0x74, 0xfc, 0x88, 0xc5, 0x1b, 0xc9, 0x0f, 0x77, 0xaf, 0x9d, 0x5e, 0x9a, 0x4a, 0x70, 0x13, 0x3d, 0x4b, 0x4e, 0x0b, 0x34, 0xda, 0x3c, 0x37, 0xc7, 0xef, 0x8e } +, + /* Seed */ + 20, + { 0xa7, 0x37, 0x68, 0xae, 0xea, 0xa9, 0x1f, 0x9d, 0x8c, 0x1e, 0xd6, 0xf9, 0xd2, 0xb6, 0x34, 0x67, 0xf0, 0x7c, 0xca, 0xe3 } +, + /* Encryption */ + 129, + { 0x01, 0x88, 0x02, 0xba, 0xb0, 0x4c, 0x60, 0x32, 0x5e, 0x81, 0xc4, 0x96, 0x23, 0x11, 0xf2, 0xbe, 0x7c, 0x2a, 0xdc, 0xe9, 0x30, 0x41, 0xa0, 0x07, 0x19, 0xc8, 0x8f, 0x95, 0x75, 0x75, 0xf2, 0xc7, 0x9f, 0x1b, 0x7b, 0xc8, 0xce, 0xd1, 0x15, 0xc7, 0x06, 0xb3, 0x11, 0xc0, 0x8a, 0x2d, 0x98, 0x6c, 0xa3, 0xb6, 0xa9, 0x33, 0x6b, 0x14, 0x7c, 0x29, 0xc6, 0xf2, 0x29, 0x40, 0x9d, 0xde, 0xc6, 0x51, 0xbd, 0x1f, 0xdd, 0x5a, 0x0b, 0x7f, 0x61, 0x0c, 0x99, 0x37, 0xfd, 0xb4, 0xa3, 0xa7, 0x62, 0x36, 0x4b, 0x8b, 0x32, 0x06, 0xb4, 0xea, 0x48, 0x5f, 0xd0, 0x98, 0xd0, 0x8f, 0x63, 0xd4, 0xaa, 0x8b, 0xb2, 0x69, 0x7d, 0x02, 0x7b, 0x75, 0x0c, 0x32, 0xd7, 0xf7, 0x4e, 0xaf, 0x51, 0x80, 0xd2, 0xe9, 0xb6, 0x6b, 0x17, 0xcb, 0x2f, 0xa5, 0x55, 0x23, 0xbc, 0x28, 0x0d, 0xa1, 0x0d, 0x14, 0xbe, 0x20, 0x53 } + +} +, +{ + "RSAES-OAEP Encryption Example 2.4", + /* Message to be encrypted */ + 53, + { 0xa7, 0xeb, 0x2a, 0x50, 0x36, 0x93, 0x1d, 0x27, 0xd4, 0xe8, 0x91, 0x32, 0x6d, 0x99, 0x69, 0x2f, 0xfa, 0xdd, 0xa9, 0xbf, 0x7e, 0xfd, 0x3e, 0x34, 0xe6, 0x22, 0xc4, 0xad, 0xc0, 0x85, 0xf7, 0x21, 0xdf, 0xe8, 0x85, 0x07, 0x2c, 0x78, 0xa2, 0x03, 0xb1, 0x51, 0x73, 0x9b, 0xe5, 0x40, 0xfa, 0x8c, 0x15, 0x3a, 0x10, 0xf0, 0x0a } +, + /* Seed */ + 20, + { 0x9a, 0x7b, 0x3b, 0x0e, 0x70, 0x8b, 0xd9, 0x6f, 0x81, 0x90, 0xec, 0xab, 0x4f, 0xb9, 0xb2, 0xb3, 0x80, 0x5a, 0x81, 0x56 } +, + /* Encryption */ + 129, + { 0x00, 0xa4, 0x57, 0x8c, 0xbc, 0x17, 0x63, 0x18, 0xa6, 0x38, 0xfb, 0xa7, 0xd0, 0x1d, 0xf1, 0x57, 0x46, 0xaf, 0x44, 0xd4, 0xf6, 0xcd, 0x96, 0xd7, 0xe7, 0xc4, 0x95, 0xcb, 0xf4, 0x25, 0xb0, 0x9c, 0x64, 0x9d, 0x32, 0xbf, 0x88, 0x6d, 0xa4, 0x8f, 0xba, 0xf9, 0x89, 0xa2, 0x11, 0x71, 0x87, 0xca, 0xfb, 0x1f, 0xb5, 0x80, 0x31, 0x76, 0x90, 0xe3, 0xcc, 0xd4, 0x46, 0x92, 0x0b, 0x7a, 0xf8, 0x2b, 0x31, 0xdb, 0x58, 0x04, 0xd8, 0x7d, 0x01, 0x51, 0x4a, 0xcb, 0xfa, 0x91, 0x56, 0xe7, 0x82, 0xf8, 0x67, 0xf6, 0xbe, 0xd9, 0x44, 0x9e, 0x0e, 0x9a, 0x2c, 0x09, 0xbc, 0xec, 0xc6, 0xaa, 0x08, 0x76, 0x36, 0x96, 0x5e, 0x34, 0xb3, 0xec, 0x76, 0x6f, 0x2f, 0xe2, 0xe4, 0x30, 0x18, 0xa2, 0xfd, 0xde, 0xb1, 0x40, 0x61, 0x6a, 0x0e, 0x9d, 0x82, 0xe5, 0x33, 0x10, 0x24, 0xee, 0x06, 0x52, 0xfc, 0x76, 0x41 } + +} +, +{ + "RSAES-OAEP Encryption Example 2.5", + /* Message to be encrypted */ + 19, + { 0x2e, 0xf2, 0xb0, 0x66, 0xf8, 0x54, 0xc3, 0x3f, 0x3b, 0xdc, 0xbb, 0x59, 0x94, 0xa4, 0x35, 0xe7, 0x3d, 0x6c, 0x6c } +, + /* Seed */ + 20, + { 0xeb, 0x3c, 0xeb, 0xbc, 0x4a, 0xdc, 0x16, 0xbb, 0x48, 0xe8, 0x8c, 0x8a, 0xec, 0x0e, 0x34, 0xaf, 0x7f, 0x42, 0x7f, 0xd3 } +, + /* Encryption */ + 129, + { 0x00, 0xeb, 0xc5, 0xf5, 0xfd, 0xa7, 0x7c, 0xfd, 0xad, 0x3c, 0x83, 0x64, 0x1a, 0x90, 0x25, 0xe7, 0x7d, 0x72, 0xd8, 0xa6, 0xfb, 0x33, 0xa8, 0x10, 0xf5, 0x95, 0x0f, 0x8d, 0x74, 0xc7, 0x3e, 0x8d, 0x93, 0x1e, 0x86, 0x34, 0xd8, 0x6a, 0xb1, 0x24, 0x62, 0x56, 0xae, 0x07, 0xb6, 0x00, 0x5b, 0x71, 0xb7, 0xf2, 0xfb, 0x98, 0x35, 0x12, 0x18, 0x33, 0x1c, 0xe6, 0x9b, 0x8f, 0xfb, 0xdc, 0x9d, 0xa0, 0x8b, 0xbc, 0x9c, 0x70, 0x4f, 0x87, 0x6d, 0xeb, 0x9d, 0xf9, 0xfc, 0x2e, 0xc0, 0x65, 0xca, 0xd8, 0x7f, 0x90, 0x90, 0xb0, 0x7a, 0xcc, 0x17, 0xaa, 0x7f, 0x99, 0x7b, 0x27, 0xac, 0xa4, 0x88, 0x06, 0xe8, 0x97, 0xf7, 0x71, 0xd9, 0x51, 0x41, 0xfe, 0x45, 0x26, 0xd8, 0xa5, 0x30, 0x1b, 0x67, 0x86, 0x27, 0xef, 0xab, 0x70, 0x7f, 0xd4, 0x0f, 0xbe, 0xbd, 0x6e, 0x79, 0x2a, 0x25, 0x61, 0x3e, 0x7a, 0xec } + +} +, +{ + "RSAES-OAEP Encryption Example 2.6", + /* Message to be encrypted */ + 22, + { 0x8a, 0x7f, 0xb3, 0x44, 0xc8, 0xb6, 0xcb, 0x2c, 0xf2, 0xef, 0x1f, 0x64, 0x3f, 0x9a, 0x32, 0x18, 0xf6, 0xe1, 0x9b, 0xba, 0x89, 0xc0 } +, + /* Seed */ + 20, + { 0x4c, 0x45, 0xcf, 0x4d, 0x57, 0xc9, 0x8e, 0x3d, 0x6d, 0x20, 0x95, 0xad, 0xc5, 0x1c, 0x48, 0x9e, 0xb5, 0x0d, 0xff, 0x84 } +, + /* Encryption */ + 129, + { 0x01, 0x08, 0x39, 0xec, 0x20, 0xc2, 0x7b, 0x90, 0x52, 0xe5, 0x5b, 0xef, 0xb9, 0xb7, 0x7e, 0x6f, 0xc2, 0x6e, 0x90, 0x75, 0xd7, 0xa5, 0x43, 0x78, 0xc6, 0x46, 0xab, 0xdf, 0x51, 0xe4, 0x45, 0xbd, 0x57, 0x15, 0xde, 0x81, 0x78, 0x9f, 0x56, 0xf1, 0x80, 0x3d, 0x91, 0x70, 0x76, 0x4a, 0x9e, 0x93, 0xcb, 0x78, 0x79, 0x86, 0x94, 0x02, 0x3e, 0xe7, 0x39, 0x3c, 0xe0, 0x4b, 0xc5, 0xd8, 0xf8, 0xc5, 0xa5, 0x2c, 0x17, 0x1d, 0x43, 0x83, 0x7e, 0x3a, 0xca, 0x62, 0xf6, 0x09, 0xeb, 0x0a, 0xa5, 0xff, 0xb0, 0x96, 0x0e, 0xf0, 0x41, 0x98, 0xdd, 0x75, 0x4f, 0x57, 0xf7, 0xfb, 0xe6, 0xab, 0xf7, 0x65, 0xcf, 0x11, 0x8b, 0x4c, 0xa4, 0x43, 0xb2, 0x3b, 0x5a, 0xab, 0x26, 0x6f, 0x95, 0x23, 0x26, 0xac, 0x45, 0x81, 0x10, 0x06, 0x44, 0x32, 0x5f, 0x8b, 0x72, 0x1a, 0xcd, 0x5d, 0x04, 0xff, 0x14, 0xef, 0x3a } + +} +, +} +}, +{ + "Example 3: A 1026-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x02, 0xb5, 0x8f, 0xec, 0x03, 0x9a, 0x86, 0x07, 0x00, 0xa4, 0xd7, 0xb6, 0x46, 0x2f, 0x93, 0xe6, 0xcd, 0xd4, 0x91, 0x16, 0x1d, 0xdd, 0x74, 0xf4, 0xe8, 0x10, 0xb4, 0x0e, 0x3c, 0x16, 0x52, 0x00, 0x6a, 0x5c, 0x27, 0x7b, 0x27, 0x74, 0xc1, 0x13, 0x05, 0xa4, 0xcb, 0xab, 0x5a, 0x78, 0xef, 0xa5, 0x7e, 0x17, 0xa8, 0x6d, 0xf7, 0xa3, 0xfa, 0x36, 0xfc, 0x4b, 0x1d, 0x22, 0x49, 0xf2, 0x2e, 0xc7, 0xc2, 0xdd, 0x6a, 0x46, 0x32, 0x32, 0xac, 0xce, 0xa9, 0x06, 0xd6, 0x6e, 0xbe, 0x80, 0xb5, 0x70, 0x4b, 0x10, 0x72, 0x9d, 0xa6, 0xf8, 0x33, 0x23, 0x4a, 0xbb, 0x5e, 0xfd, 0xd4, 0xa2, 0x92, 0xcb, 0xfa, 0xd3, 0x3b, 0x4d, 0x33, 0xfa, 0x7a, 0x14, 0xb8, 0xc3, 0x97, 0xb5, 0x6e, 0x3a, 0xcd, 0x21, 0x20, 0x34, 0x28, 0xb7, 0x7c, 0xdf, 0xa3, 0x3a, 0x6d, 0xa7, 0x06, 0xb3, 0xd8, 0xb0, 0xfc, 0x43, 0xe9 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x15, 0xb4, 0x8a, 0x5b, 0x56, 0x83, 0xa9, 0x46, 0x70, 0xe2, 0x3b, 0x57, 0x18, 0xf8, 0x14, 0xfa, 0x0e, 0x13, 0xf8, 0x50, 0x38, 0xf5, 0x07, 0x11, 0x18, 0x2c, 0xba, 0x61, 0x51, 0x05, 0x81, 0xf3, 0xd2, 0x2c, 0x7e, 0x23, 0x2e, 0xf9, 0x37, 0xe2, 0x2e, 0x55, 0x1d, 0x68, 0xb8, 0x6e, 0x2f, 0x8c, 0xb1, 0xaa, 0xd8, 0xbe, 0x2e, 0x48, 0x8f, 0x5d, 0xf7, 0xef, 0xd2, 0x79, 0xe3, 0xf5, 0x68, 0xd4, 0xea, 0xf3, 0x6f, 0x80, 0xcf, 0x71, 0x41, 0xac, 0xe6, 0x0f, 0xcc, 0x91, 0x13, 0xfb, 0x6c, 0x4a, 0x84, 0x1f, 0xd5, 0x0b, 0xbc, 0x7c, 0x51, 0x2f, 0xfc, 0xbe, 0xff, 0x21, 0x48, 0x7a, 0xa8, 0x11, 0xeb, 0x3c, 0xa8, 0xc6, 0x20, 0x05, 0x34, 0x6a, 0x86, 0xde, 0x86, 0xbf, 0xa1, 0xd8, 0xa9, 0x48, 0xfd, 0x3f, 0x34, 0x8c, 0x22, 0xea, 0xad, 0xf3, 0x33, 0xc3, 0xce, 0x6c, 0xe1, 0x32, 0x08, 0xfd } +, + /* Prime p */ + 65, + { 0x01, 0xbf, 0x01, 0xd2, 0x16, 0xd7, 0x35, 0x95, 0xcf, 0x02, 0x70, 0xc2, 0xbe, 0xb7, 0x8d, 0x40, 0xa0, 0xd8, 0x44, 0x7d, 0x31, 0xda, 0x91, 0x9a, 0x98, 0x3f, 0x7e, 0xea, 0x78, 0x1b, 0x77, 0xd8, 0x5f, 0xe3, 0x71, 0xb3, 0xe9, 0x37, 0x3e, 0x7b, 0x69, 0x21, 0x7d, 0x31, 0x50, 0xa0, 0x2d, 0x89, 0x58, 0xde, 0x7f, 0xad, 0x9d, 0x55, 0x51, 0x60, 0x95, 0x8b, 0x44, 0x54, 0x12, 0x7e, 0x0e, 0x7e, 0xaf } +, + /* Prime q */ + 65, + { 0x01, 0x8d, 0x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0x42, 0x43, 0xb4, 0x07, 0x9b, 0x03, 0x44, 0x5e, 0x60, 0x2e, 0x29, 0xfa, 0x51, 0x93, 0xe6, 0x4f, 0xe9 } +, + /* CRT coefficient qInv */ + 64, + { 0x8c, 0xb2, 0xf7, 0x56, 0xbd, 0x89, 0x41, 0xb1, 0xd3, 0xb7, 0x70, 0xe5, 0xad, 0x31, 0xee, 0x37, 0x3b, 0x28, 0xac, 0xda, 0x69, 0xff, 0x9b, 0x6f, 0x40, 0xfe, 0x57, 0x8b, 0x9f, 0x1a, 0xfb, 0x85, 0x83, 0x6f, 0x96, 0x27, 0xd3, 0x7a, 0xcf, 0xf7, 0x3c, 0x27, 0x79, 0xe6, 0x34, 0xbb, 0x26, 0x01, 0x1c, 0x2c, 0x8f, 0x7f, 0x33, 0x61, 0xae, 0x2a, 0x9e, 0xa6, 0x5e, 0xd6, 0x89, 0xe3, 0x63, 0x9a } + +} +, +{{ + "RSAES-OAEP Encryption Example 3.1", + /* Message to be encrypted */ + 8, + { 0x08, 0x78, 0x20, 0xb5, 0x69, 0xe8, 0xfa, 0x8d } +, + /* Seed */ + 20, + { 0x8c, 0xed, 0x6b, 0x19, 0x62, 0x90, 0x80, 0x57, 0x90, 0xe9, 0x09, 0x07, 0x40, 0x15, 0xe6, 0xa2, 0x0b, 0x0c, 0x48, 0x94 } +, + /* Encryption */ + 129, + { 0x02, 0x6a, 0x04, 0x85, 0xd9, 0x6a, 0xeb, 0xd9, 0x6b, 0x43, 0x82, 0x08, 0x50, 0x99, 0xb9, 0x62, 0xe6, 0xa2, 0xbd, 0xec, 0x3d, 0x90, 0xc8, 0xdb, 0x62, 0x5e, 0x14, 0x37, 0x2d, 0xe8, 0x5e, 0x2d, 0x5b, 0x7b, 0xaa, 0xb6, 0x5c, 0x8f, 0xaf, 0x91, 0xbb, 0x55, 0x04, 0xfb, 0x49, 0x5a, 0xfc, 0xe5, 0xc9, 0x88, 0xb3, 0xf6, 0xa5, 0x2e, 0x20, 0xe1, 0xd6, 0xcb, 0xd3, 0x56, 0x6c, 0x5c, 0xd1, 0xf2, 0xb8, 0x31, 0x8b, 0xb5, 0x42, 0xcc, 0x0e, 0xa2, 0x5c, 0x4a, 0xab, 0x99, 0x32, 0xaf, 0xa2, 0x07, 0x60, 0xea, 0xdd, 0xec, 0x78, 0x43, 0x96, 0xa0, 0x7e, 0xa0, 0xef, 0x24, 0xd4, 0xe6, 0xf4, 0xd3, 0x7e, 0x50, 0x52, 0xa7, 0xa3, 0x1e, 0x14, 0x6a, 0xa4, 0x80, 0xa1, 0x11, 0xbb, 0xe9, 0x26, 0x40, 0x13, 0x07, 0xe0, 0x0f, 0x41, 0x00, 0x33, 0x84, 0x2b, 0x6d, 0x82, 0xfe, 0x5c, 0xe4, 0xdf, 0xae, 0x80 } + +} +, +{ + "RSAES-OAEP Encryption Example 3.2", + /* Message to be encrypted */ + 28, + { 0x46, 0x53, 0xac, 0xaf, 0x17, 0x19, 0x60, 0xb0, 0x1f, 0x52, 0xa7, 0xbe, 0x63, 0xa3, 0xab, 0x21, 0xdc, 0x36, 0x8e, 0xc4, 0x3b, 0x50, 0xd8, 0x2e, 0xc3, 0x78, 0x1e, 0x04 } +, + /* Seed */ + 20, + { 0xb4, 0x29, 0x1d, 0x65, 0x67, 0x55, 0x08, 0x48, 0xcc, 0x15, 0x69, 0x67, 0xc8, 0x09, 0xba, 0xab, 0x6c, 0xa5, 0x07, 0xf0 } +, + /* Encryption */ + 129, + { 0x02, 0x4d, 0xb8, 0x9c, 0x78, 0x02, 0x98, 0x9b, 0xe0, 0x78, 0x38, 0x47, 0x86, 0x30, 0x84, 0x94, 0x1b, 0xf2, 0x09, 0xd7, 0x61, 0x98, 0x7e, 0x38, 0xf9, 0x7c, 0xb5, 0xf6, 0xf1, 0xbc, 0x88, 0xda, 0x72, 0xa5, 0x0b, 0x73, 0xeb, 0xaf, 0x11, 0xc8, 0x79, 0xc4, 0xf9, 0x5d, 0xf3, 0x7b, 0x85, 0x0b, 0x8f, 0x65, 0xd7, 0x62, 0x2e, 0x25, 0xb1, 0xb8, 0x89, 0xe8, 0x0f, 0xe8, 0x0b, 0xac, 0xa2, 0x06, 0x9d, 0x6e, 0x0e, 0x1d, 0x82, 0x99, 0x53, 0xfc, 0x45, 0x90, 0x69, 0xde, 0x98, 0xea, 0x97, 0x98, 0xb4, 0x51, 0xe5, 0x57, 0xe9, 0x9a, 0xbf, 0x8f, 0xe3, 0xd9, 0xcc, 0xf9, 0x09, 0x6e, 0xbb, 0xf3, 0xe5, 0x25, 0x5d, 0x3b, 0x4e, 0x1c, 0x6d, 0x2e, 0xca, 0xdf, 0x06, 0x7a, 0x35, 0x9e, 0xea, 0x86, 0x40, 0x5a, 0xcd, 0x47, 0xd5, 0xe1, 0x65, 0x51, 0x7c, 0xca, 0xfd, 0x47, 0xd6, 0xdb, 0xee, 0x4b, 0xf5 } + +} +, +{ + "RSAES-OAEP Encryption Example 3.3", + /* Message to be encrypted */ + 9, + { 0xd9, 0x4c, 0xd0, 0xe0, 0x8f, 0xa4, 0x04, 0xed, 0x89 } +, + /* Seed */ + 20, + { 0xce, 0x89, 0x28, 0xf6, 0x05, 0x95, 0x58, 0x25, 0x40, 0x08, 0xba, 0xdd, 0x97, 0x94, 0xfa, 0xdc, 0xd2, 0xfd, 0x1f, 0x65 } +, + /* Encryption */ + 129, + { 0x02, 0x39, 0xbc, 0xe6, 0x81, 0x03, 0x24, 0x41, 0x52, 0x88, 0x77, 0xd6, 0xd1, 0xc8, 0xbb, 0x28, 0xaa, 0x3b, 0xc9, 0x7f, 0x1d, 0xf5, 0x84, 0x56, 0x36, 0x18, 0x99, 0x57, 0x97, 0x68, 0x38, 0x44, 0xca, 0x86, 0x66, 0x47, 0x32, 0xf4, 0xbe, 0xd7, 0xa0, 0xaa, 0xb0, 0x83, 0xaa, 0xab, 0xfb, 0x72, 0x38, 0xf5, 0x82, 0xe3, 0x09, 0x58, 0xc2, 0x02, 0x4e, 0x44, 0xe5, 0x70, 0x43, 0xb9, 0x79, 0x50, 0xfd, 0x54, 0x3d, 0xa9, 0x77, 0xc9, 0x0c, 0xdd, 0xe5, 0x33, 0x7d, 0x61, 0x84, 0x42, 0xf9, 0x9e, 0x60, 0xd7, 0x78, 0x3a, 0xb5, 0x9c, 0xe6, 0xdd, 0x9d, 0x69, 0xc4, 0x7a, 0xd1, 0xe9, 0x62, 0xbe, 0xc2, 0x2d, 0x05, 0x89, 0x5c, 0xff, 0x8d, 0x3f, 0x64, 0xed, 0x52, 0x61, 0xd9, 0x2b, 0x26, 0x78, 0x51, 0x03, 0x93, 0x48, 0x49, 0x90, 0xba, 0x3f, 0x7f, 0x06, 0x81, 0x8a, 0xe6, 0xff, 0xce, 0x8a, 0x3a } + +} +, +{ + "RSAES-OAEP Encryption Example 3.4", + /* Message to be encrypted */ + 18, + { 0x6c, 0xc6, 0x41, 0xb6, 0xb6, 0x1e, 0x6f, 0x96, 0x39, 0x74, 0xda, 0xd2, 0x3a, 0x90, 0x13, 0x28, 0x4e, 0xf1 } +, + /* Seed */ + 20, + { 0x6e, 0x29, 0x79, 0xf5, 0x2d, 0x68, 0x14, 0xa5, 0x7d, 0x83, 0xb0, 0x90, 0x05, 0x48, 0x88, 0xf1, 0x19, 0xa5, 0xb9, 0xa3 } +, + /* Encryption */ + 129, + { 0x02, 0x99, 0x4c, 0x62, 0xaf, 0xd7, 0x6f, 0x49, 0x8b, 0xa1, 0xfd, 0x2c, 0xf6, 0x42, 0x85, 0x7f, 0xca, 0x81, 0xf4, 0x37, 0x3c, 0xb0, 0x8f, 0x1c, 0xba, 0xee, 0x6f, 0x02, 0x5c, 0x3b, 0x51, 0x2b, 0x42, 0xc3, 0xe8, 0x77, 0x91, 0x13, 0x47, 0x66, 0x48, 0x03, 0x9d, 0xbe, 0x04, 0x93, 0xf9, 0x24, 0x62, 0x92, 0xfa, 0xc2, 0x89, 0x50, 0x60, 0x0e, 0x7c, 0x0f, 0x32, 0xed, 0xf9, 0xc8, 0x1b, 0x9d, 0xec, 0x45, 0xc3, 0xbd, 0xe0, 0xcc, 0x8d, 0x88, 0x47, 0x59, 0x01, 0x69, 0x90, 0x7b, 0x7d, 0xc5, 0x99, 0x1c, 0xeb, 0x29, 0xbb, 0x07, 0x14, 0xd6, 0x13, 0xd9, 0x6d, 0xf0, 0xf1, 0x2e, 0xc5, 0xd8, 0xd3, 0x50, 0x7c, 0x8e, 0xe7, 0xae, 0x78, 0xdd, 0x83, 0xf2, 0x16, 0xfa, 0x61, 0xde, 0x10, 0x03, 0x63, 0xac, 0xa4, 0x8a, 0x7e, 0x91, 0x4a, 0xe9, 0xf4, 0x2d, 0xdf, 0xbe, 0x94, 0x3b, 0x09, 0xd9, 0xa0 } + +} +, +{ + "RSAES-OAEP Encryption Example 3.5", + /* Message to be encrypted */ + 46, + { 0xdf, 0x51, 0x51, 0x83, 0x2b, 0x61, 0xf4, 0xf2, 0x58, 0x91, 0xfb, 0x41, 0x72, 0xf3, 0x28, 0xd2, 0xed, 0xdf, 0x83, 0x71, 0xff, 0xcf, 0xdb, 0xe9, 0x97, 0x93, 0x92, 0x95, 0xf3, 0x0e, 0xca, 0x69, 0x18, 0x01, 0x7c, 0xfd, 0xa1, 0x15, 0x3b, 0xf7, 0xa6, 0xaf, 0x87, 0x59, 0x32, 0x23 } +, + /* Seed */ + 20, + { 0x2d, 0x76, 0x0b, 0xfe, 0x38, 0xc5, 0x9d, 0xe3, 0x4c, 0xdc, 0x8b, 0x8c, 0x78, 0xa3, 0x8e, 0x66, 0x28, 0x4a, 0x2d, 0x27 } +, + /* Encryption */ + 129, + { 0x01, 0x62, 0x04, 0x2f, 0xf6, 0x96, 0x95, 0x92, 0xa6, 0x16, 0x70, 0x31, 0x81, 0x1a, 0x23, 0x98, 0x34, 0xce, 0x63, 0x8a, 0xbf, 0x54, 0xfe, 0xc8, 0xb9, 0x94, 0x78, 0x12, 0x2a, 0xfe, 0x2e, 0xe6, 0x7f, 0x8c, 0x5b, 0x18, 0xb0, 0x33, 0x98, 0x05, 0xbf, 0xdb, 0xc5, 0xa4, 0xe6, 0x72, 0x0b, 0x37, 0xc5, 0x9c, 0xfb, 0xa9, 0x42, 0x46, 0x4c, 0x59, 0x7f, 0xf5, 0x32, 0xa1, 0x19, 0x82, 0x15, 0x45, 0xfd, 0x2e, 0x59, 0xb1, 0x14, 0xe6, 0x1d, 0xaf, 0x71, 0x82, 0x05, 0x29, 0xf5, 0x02, 0x9c, 0xf5, 0x24, 0x95, 0x43, 0x27, 0xc3, 0x4e, 0xc5, 0xe6, 0xf5, 0xba, 0x7e, 0xfc, 0xc4, 0xde, 0x94, 0x3a, 0xb8, 0xad, 0x4e, 0xd7, 0x87, 0xb1, 0x45, 0x43, 0x29, 0xf7, 0x0d, 0xb7, 0x98, 0xa3, 0xa8, 0xf4, 0xd9, 0x2f, 0x82, 0x74, 0xe2, 0xb2, 0x94, 0x8a, 0xde, 0x62, 0x7c, 0xe8, 0xee, 0x33, 0xe4, 0x3c, 0x60 } + +} +, +{ + "RSAES-OAEP Encryption Example 3.6", + /* Message to be encrypted */ + 56, + { 0x3c, 0x3b, 0xad, 0x89, 0x3c, 0x54, 0x4a, 0x6d, 0x52, 0x0a, 0xb0, 0x22, 0x31, 0x91, 0x88, 0xc8, 0xd5, 0x04, 0xb7, 0xa7, 0x88, 0xb8, 0x50, 0x90, 0x3b, 0x85, 0x97, 0x2e, 0xaa, 0x18, 0x55, 0x2e, 0x11, 0x34, 0xa7, 0xad, 0x60, 0x98, 0x82, 0x62, 0x54, 0xff, 0x7a, 0xb6, 0x72, 0xb3, 0xd8, 0xeb, 0x31, 0x58, 0xfa, 0xc6, 0xd4, 0xcb, 0xae, 0xf1 } +, + /* Seed */ + 20, + { 0xf1, 0x74, 0x77, 0x9c, 0x5f, 0xd3, 0xcf, 0xe0, 0x07, 0xba, 0xdc, 0xb7, 0xa3, 0x6c, 0x9b, 0x55, 0xbf, 0xcf, 0xbf, 0x0e } +, + /* Encryption */ + 129, + { 0x00, 0x11, 0x20, 0x51, 0xe7, 0x5d, 0x06, 0x49, 0x43, 0xbc, 0x44, 0x78, 0x07, 0x5e, 0x43, 0x48, 0x2f, 0xd5, 0x9c, 0xee, 0x06, 0x79, 0xde, 0x68, 0x93, 0xee, 0xc3, 0xa9, 0x43, 0xda, 0xa4, 0x90, 0xb9, 0x69, 0x1c, 0x93, 0xdf, 0xc0, 0x46, 0x4b, 0x66, 0x23, 0xb9, 0xf3, 0xdb, 0xd3, 0xe7, 0x00, 0x83, 0x26, 0x4f, 0x03, 0x4b, 0x37, 0x4f, 0x74, 0x16, 0x4e, 0x1a, 0x00, 0x76, 0x37, 0x25, 0xe5, 0x74, 0x74, 0x4b, 0xa0, 0xb9, 0xdb, 0x83, 0x43, 0x4f, 0x31, 0xdf, 0x96, 0xf6, 0xe2, 0xa2, 0x6f, 0x6d, 0x8e, 0xba, 0x34, 0x8b, 0xd4, 0x68, 0x6c, 0x22, 0x38, 0xac, 0x07, 0xc3, 0x7a, 0xac, 0x37, 0x85, 0xd1, 0xc7, 0xee, 0xa2, 0xf8, 0x19, 0xfd, 0x91, 0x49, 0x17, 0x98, 0xed, 0x8e, 0x9c, 0xef, 0x5e, 0x43, 0xb7, 0x81, 0xb0, 0xe0, 0x27, 0x6e, 0x37, 0xc4, 0x3f, 0xf9, 0x49, 0x2d, 0x00, 0x57, 0x30 } + +} +, +} +}, +{ + "Example 4: A 1027-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x05, 0x12, 0x40, 0xb6, 0xcc, 0x00, 0x04, 0xfa, 0x48, 0xd0, 0x13, 0x46, 0x71, 0xc0, 0x78, 0xc7, 0xc8, 0xde, 0xc3, 0xb3, 0xe2, 0xf2, 0x5b, 0xc2, 0x56, 0x44, 0x67, 0x33, 0x9d, 0xb3, 0x88, 0x53, 0xd0, 0x6b, 0x85, 0xee, 0xa5, 0xb2, 0xde, 0x35, 0x3b, 0xff, 0x42, 0xac, 0x2e, 0x46, 0xbc, 0x97, 0xfa, 0xe6, 0xac, 0x96, 0x18, 0xda, 0x95, 0x37, 0xa5, 0xc8, 0xf5, 0x53, 0xc1, 0xe3, 0x57, 0x62, 0x59, 0x91, 0xd6, 0x10, 0x8d, 0xcd, 0x78, 0x85, 0xfb, 0x3a, 0x25, 0x41, 0x3f, 0x53, 0xef, 0xca, 0xd9, 0x48, 0xcb, 0x35, 0xcd, 0x9b, 0x9a, 0xe9, 0xc1, 0xc6, 0x76, 0x26, 0xd1, 0x13, 0xd5, 0x7d, 0xde, 0x4c, 0x5b, 0xea, 0x76, 0xbb, 0x5b, 0xb7, 0xde, 0x96, 0xc0, 0x0d, 0x07, 0x37, 0x2e, 0x96, 0x85, 0xa6, 0xd7, 0x5c, 0xf9, 0xd2, 0x39, 0xfa, 0x14, 0x8d, 0x70, 0x93, 0x1b, 0x5f, 0x3f, 0xb0, 0x39 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 128, + { 0x04, 0x11, 0xff, 0xca, 0x3b, 0x7c, 0xa5, 0xe9, 0xe9, 0xbe, 0x7f, 0xe3, 0x8a, 0x85, 0x10, 0x5e, 0x35, 0x38, 0x96, 0xdb, 0x05, 0xc5, 0x79, 0x6a, 0xec, 0xd2, 0xa7, 0x25, 0x16, 0x1e, 0xb3, 0x65, 0x1c, 0x86, 0x29, 0xa9, 0xb8, 0x62, 0xb9, 0x04, 0xd7, 0xb0, 0xc7, 0xb3, 0x7f, 0x8c, 0xb5, 0xa1, 0xc2, 0xb5, 0x40, 0x01, 0x01, 0x8a, 0x00, 0xa1, 0xeb, 0x2c, 0xaf, 0xe4, 0xee, 0x4e, 0x94, 0x92, 0xc3, 0x48, 0xbc, 0x2b, 0xed, 0xab, 0x4b, 0x9e, 0xbb, 0xf0, 0x64, 0xe8, 0xef, 0xf3, 0x22, 0xb9, 0x00, 0x9f, 0x8e, 0xec, 0x65, 0x39, 0x05, 0xf4, 0x0d, 0xf8, 0x8a, 0x3c, 0xdc, 0x49, 0xd4, 0x56, 0x7f, 0x75, 0x62, 0x7d, 0x41, 0xac, 0xa6, 0x24, 0x12, 0x9b, 0x46, 0xa0, 0xb7, 0xc6, 0x98, 0xe5, 0xe6, 0x5f, 0x2b, 0x7b, 0xa1, 0x02, 0xc7, 0x49, 0xa1, 0x01, 0x35, 0xb6, 0x54, 0x0d, 0x04, 0x01 } +, + /* Prime p */ + 65, + { 0x02, 0x74, 0x58, 0xc1, 0x9e, 0xc1, 0x63, 0x69, 0x19, 0xe7, 0x36, 0xc9, 0xaf, 0x25, 0xd6, 0x09, 0xa5, 0x1b, 0x8f, 0x56, 0x1d, 0x19, 0xc6, 0xbf, 0x69, 0x43, 0xdd, 0x1e, 0xe1, 0xab, 0x8a, 0x4a, 0x3f, 0x23, 0x21, 0x00, 0xbd, 0x40, 0xb8, 0x8d, 0xec, 0xc6, 0xba, 0x23, 0x55, 0x48, 0xb6, 0xef, 0x79, 0x2a, 0x11, 0xc9, 0xde, 0x82, 0x3d, 0x0a, 0x79, 0x22, 0xc7, 0x09, 0x5b, 0x6e, 0xba, 0x57, 0x01 } +, + /* Prime q */ + 65, + { 0x02, 0x10, 0xee, 0x9b, 0x33, 0xab, 0x61, 0x71, 0x6e, 0x27, 0xd2, 0x51, 0xbd, 0x46, 0x5f, 0x4b, 0x35, 0xa1, 0xa2, 0x32, 0xe2, 0xda, 0x00, 0x90, 0x1c, 0x29, 0x4b, 0xf2, 0x23, 0x50, 0xce, 0x49, 0x0d, 0x09, 0x9f, 0x64, 0x2b, 0x53, 0x75, 0x61, 0x2d, 0xb6, 0x3b, 0xa1, 0xf2, 0x03, 0x86, 0x49, 0x2b, 0xf0, 0x4d, 0x34, 0xb3, 0xc2, 0x2b, 0xce, 0xb9, 0x09, 0xd1, 0x34, 0x41, 0xb5, 0x3b, 0x51, 0x39 } +, + /* p's CRT exponent dP */ + 64, + { 0x39, 0xfa, 0x02, 0x8b, 0x82, 0x6e, 0x88, 0xc1, 0x12, 0x1b, 0x75, 0x0a, 0x8b, 0x24, 0x2f, 0xa9, 0xa3, 0x5c, 0x5b, 0x66, 0xbd, 0xfd, 0x1f, 0xa6, 0x37, 0xd3, 0xcc, 0x48, 0xa8, 0x4a, 0x4f, 0x45, 0x7a, 0x19, 0x4e, 0x77, 0x27, 0xe4, 0x9f, 0x7b, 0xcc, 0x6e, 0x5a, 0x5a, 0x41, 0x26, 0x57, 0xfc, 0x47, 0x0c, 0x73, 0x22, 0xeb, 0xc3, 0x74, 0x16, 0xef, 0x45, 0x8c, 0x30, 0x7a, 0x8c, 0x09, 0x01 } +, + /* q's CRT exponent dQ */ + 65, + { 0x01, 0x5d, 0x99, 0xa8, 0x41, 0x95, 0x94, 0x39, 0x79, 0xfa, 0x9e, 0x1b, 0xe2, 0xc3, 0xc1, 0xb6, 0x9f, 0x43, 0x2f, 0x46, 0xfd, 0x03, 0xe4, 0x7d, 0x5b, 0xef, 0xbb, 0xbf, 0xd6, 0xb1, 0xd1, 0x37, 0x1d, 0x83, 0xef, 0xb3, 0x30, 0xa3, 0xe0, 0x20, 0x94, 0x2b, 0x2f, 0xed, 0x11, 0x5e, 0x5d, 0x02, 0xbe, 0x24, 0xfd, 0x92, 0xc9, 0x01, 0x9d, 0x1c, 0xec, 0xd6, 0xdd, 0x4c, 0xf1, 0xe5, 0x4c, 0xc8, 0x99 } +, + /* CRT coefficient qInv */ + 65, + { 0x01, 0xf0, 0xb7, 0x01, 0x51, 0x70, 0xb3, 0xf5, 0xe4, 0x22, 0x23, 0xba, 0x30, 0x30, 0x1c, 0x41, 0xa6, 0xd8, 0x7c, 0xbb, 0x70, 0xe3, 0x0c, 0xb7, 0xd3, 0xc6, 0x7d, 0x25, 0x47, 0x3d, 0xb1, 0xf6, 0xcb, 0xf0, 0x3e, 0x3f, 0x91, 0x26, 0xe3, 0xe9, 0x79, 0x68, 0x27, 0x9a, 0x86, 0x5b, 0x2c, 0x2b, 0x42, 0x65, 0x24, 0xcf, 0xc5, 0x2a, 0x68, 0x3d, 0x31, 0xed, 0x30, 0xeb, 0x98, 0x4b, 0xe4, 0x12, 0xba } + +} +, +{{ + "RSAES-OAEP Encryption Example 4.1", + /* Message to be encrypted */ + 56, + { 0x4a, 0x86, 0x60, 0x95, 0x34, 0xee, 0x43, 0x4a, 0x6c, 0xbc, 0xa3, 0xf7, 0xe9, 0x62, 0xe7, 0x6d, 0x45, 0x5e, 0x32, 0x64, 0xc1, 0x9f, 0x60, 0x5f, 0x6e, 0x5f, 0xf6, 0x13, 0x7c, 0x65, 0xc5, 0x6d, 0x7f, 0xb3, 0x44, 0xcd, 0x52, 0xbc, 0x93, 0x37, 0x4f, 0x3d, 0x16, 0x6c, 0x9f, 0x0c, 0x6f, 0x9c, 0x50, 0x6b, 0xad, 0x19, 0x33, 0x09, 0x72, 0xd2 } +, + /* Seed */ + 20, + { 0x1c, 0xac, 0x19, 0xce, 0x99, 0x3d, 0xef, 0x55, 0xf9, 0x82, 0x03, 0xf6, 0x85, 0x28, 0x96, 0xc9, 0x5c, 0xcc, 0xa1, 0xf3 } +, + /* Encryption */ + 129, + { 0x04, 0xcc, 0xe1, 0x96, 0x14, 0x84, 0x5e, 0x09, 0x41, 0x52, 0xa3, 0xfe, 0x18, 0xe5, 0x4e, 0x33, 0x30, 0xc4, 0x4e, 0x5e, 0xfb, 0xc6, 0x4a, 0xe1, 0x68, 0x86, 0xcb, 0x18, 0x69, 0x01, 0x4c, 0xc5, 0x78, 0x1b, 0x1f, 0x8f, 0x9e, 0x04, 0x53, 0x84, 0xd0, 0x11, 0x2a, 0x13, 0x5c, 0xa0, 0xd1, 0x2e, 0x9c, 0x88, 0xa8, 0xe4, 0x06, 0x34, 0x16, 0xde, 0xaa, 0xe3, 0x84, 0x4f, 0x60, 0xd6, 0xe9, 0x6f, 0xe1, 0x55, 0x14, 0x5f, 0x45, 0x25, 0xb9, 0xa3, 0x44, 0x31, 0xca, 0x37, 0x66, 0x18, 0x0f, 0x70, 0xe1, 0x5a, 0x5e, 0x5d, 0x8e, 0x8b, 0x1a, 0x51, 0x6f, 0xf8, 0x70, 0x60, 0x9f, 0x13, 0xf8, 0x96, 0x93, 0x5c, 0xed, 0x18, 0x82, 0x79, 0xa5, 0x8e, 0xd1, 0x3d, 0x07, 0x11, 0x42, 0x77, 0xd7, 0x5c, 0x65, 0x68, 0x60, 0x7e, 0x0a, 0xb0, 0x92, 0xfd, 0x80, 0x3a, 0x22, 0x3e, 0x4a, 0x8e, 0xe0, 0xb1, 0xa8 } + +} +, +{ + "RSAES-OAEP Encryption Example 4.2", + /* Message to be encrypted */ + 64, + { 0xb0, 0xad, 0xc4, 0xf3, 0xfe, 0x11, 0xda, 0x59, 0xce, 0x99, 0x27, 0x73, 0xd9, 0x05, 0x99, 0x43, 0xc0, 0x30, 0x46, 0x49, 0x7e, 0xe9, 0xd9, 0xf9, 0xa0, 0x6d, 0xf1, 0x16, 0x6d, 0xb4, 0x6d, 0x98, 0xf5, 0x8d, 0x27, 0xec, 0x07, 0x4c, 0x02, 0xee, 0xe6, 0xcb, 0xe2, 0x44, 0x9c, 0x8b, 0x9f, 0xc5, 0x08, 0x0c, 0x5c, 0x3f, 0x44, 0x33, 0x09, 0x25, 0x12, 0xec, 0x46, 0xaa, 0x79, 0x37, 0x43, 0xc8 } +, + /* Seed */ + 20, + { 0xf5, 0x45, 0xd5, 0x89, 0x75, 0x85, 0xe3, 0xdb, 0x71, 0xaa, 0x0c, 0xb8, 0xda, 0x76, 0xc5, 0x1d, 0x03, 0x2a, 0xe9, 0x63 } +, + /* Encryption */ + 129, + { 0x00, 0x97, 0xb6, 0x98, 0xc6, 0x16, 0x56, 0x45, 0xb3, 0x03, 0x48, 0x6f, 0xbf, 0x5a, 0x2a, 0x44, 0x79, 0xc0, 0xee, 0x85, 0x88, 0x9b, 0x54, 0x1a, 0x6f, 0x0b, 0x85, 0x8d, 0x6b, 0x65, 0x97, 0xb1, 0x3b, 0x85, 0x4e, 0xb4, 0xf8, 0x39, 0xaf, 0x03, 0x39, 0x9a, 0x80, 0xd7, 0x9b, 0xda, 0x65, 0x78, 0xc8, 0x41, 0xf9, 0x0d, 0x64, 0x57, 0x15, 0xb2, 0x80, 0xd3, 0x71, 0x43, 0x99, 0x2d, 0xd1, 0x86, 0xc8, 0x0b, 0x94, 0x9b, 0x77, 0x5c, 0xae, 0x97, 0x37, 0x0e, 0x4e, 0xc9, 0x74, 0x43, 0x13, 0x6c, 0x6d, 0xa4, 0x84, 0xe9, 0x70, 0xff, 0xdb, 0x13, 0x23, 0xa2, 0x08, 0x47, 0x82, 0x1d, 0x3b, 0x18, 0x38, 0x1d, 0xe1, 0x3b, 0xb4, 0x9a, 0xae, 0xa6, 0x65, 0x30, 0xc4, 0xa4, 0xb8, 0x27, 0x1f, 0x3e, 0xae, 0x17, 0x2c, 0xd3, 0x66, 0xe0, 0x7e, 0x66, 0x36, 0xf1, 0x01, 0x9d, 0x2a, 0x28, 0xae, 0xd1, 0x5e } + +} +, +{ + "RSAES-OAEP Encryption Example 4.3", + /* Message to be encrypted */ + 62, + { 0xbf, 0x6d, 0x42, 0xe7, 0x01, 0x70, 0x7b, 0x1d, 0x02, 0x06, 0xb0, 0xc8, 0xb4, 0x5a, 0x1c, 0x72, 0x64, 0x1f, 0xf1, 0x28, 0x89, 0x21, 0x9a, 0x82, 0xbd, 0xea, 0x96, 0x5b, 0x5e, 0x79, 0xa9, 0x6b, 0x0d, 0x01, 0x63, 0xed, 0x9d, 0x57, 0x8e, 0xc9, 0xad, 0xa2, 0x0f, 0x2f, 0xbc, 0xf1, 0xea, 0x3c, 0x40, 0x89, 0xd8, 0x34, 0x19, 0xba, 0x81, 0xb0, 0xc6, 0x0f, 0x36, 0x06, 0xda, 0x99 } +, + /* Seed */ + 20, + { 0xad, 0x99, 0x7f, 0xee, 0xf7, 0x30, 0xd6, 0xea, 0x7b, 0xe6, 0x0d, 0x0d, 0xc5, 0x2e, 0x72, 0xea, 0xcb, 0xfd, 0xd2, 0x75 } +, + /* Encryption */ + 129, + { 0x03, 0x01, 0xf9, 0x35, 0xe9, 0xc4, 0x7a, 0xbc, 0xb4, 0x8a, 0xcb, 0xbe, 0x09, 0x89, 0x5d, 0x9f, 0x59, 0x71, 0xaf, 0x14, 0x83, 0x9d, 0xa4, 0xff, 0x95, 0x41, 0x7e, 0xe4, 0x53, 0xd1, 0xfd, 0x77, 0x31, 0x90, 0x72, 0xbb, 0x72, 0x97, 0xe1, 0xb5, 0x5d, 0x75, 0x61, 0xcd, 0x9d, 0x1b, 0xb2, 0x4c, 0x1a, 0x9a, 0x37, 0xc6, 0x19, 0x86, 0x43, 0x08, 0x24, 0x28, 0x04, 0x87, 0x9d, 0x86, 0xeb, 0xd0, 0x01, 0xdc, 0xe5, 0x18, 0x39, 0x75, 0xe1, 0x50, 0x69, 0x89, 0xb7, 0x0e, 0x5a, 0x83, 0x43, 0x41, 0x54, 0xd5, 0xcb, 0xfd, 0x6a, 0x24, 0x78, 0x7e, 0x60, 0xeb, 0x0c, 0x65, 0x8d, 0x2a, 0xc1, 0x93, 0x30, 0x2d, 0x11, 0x92, 0xc6, 0xe6, 0x22, 0xd4, 0xa1, 0x2a, 0xd4, 0xb5, 0x39, 0x23, 0xbc, 0xa2, 0x46, 0xdf, 0x31, 0xc6, 0x39, 0x5e, 0x37, 0x70, 0x2c, 0x6a, 0x78, 0xae, 0x08, 0x1f, 0xb9, 0xd0, 0x65 } + +} +, +{ + "RSAES-OAEP Encryption Example 4.4", + /* Message to be encrypted */ + 22, + { 0xfb, 0x2e, 0xf1, 0x12, 0xf5, 0xe7, 0x66, 0xeb, 0x94, 0x01, 0x92, 0x97, 0x93, 0x47, 0x94, 0xf7, 0xbe, 0x2f, 0x6f, 0xc1, 0xc5, 0x8e } +, + /* Seed */ + 20, + { 0x13, 0x64, 0x54, 0xdf, 0x57, 0x30, 0xf7, 0x3c, 0x80, 0x7a, 0x7e, 0x40, 0xd8, 0xc1, 0xa3, 0x12, 0xac, 0x5b, 0x9d, 0xd3 } +, + /* Encryption */ + 129, + { 0x02, 0xd1, 0x10, 0xad, 0x30, 0xaf, 0xb7, 0x27, 0xbe, 0xb6, 0x91, 0xdd, 0x0c, 0xf1, 0x7d, 0x0a, 0xf1, 0xa1, 0xe7, 0xfa, 0x0c, 0xc0, 0x40, 0xec, 0x1a, 0x4b, 0xa2, 0x6a, 0x42, 0xc5, 0x9d, 0x0a, 0x79, 0x6a, 0x2e, 0x22, 0xc8, 0xf3, 0x57, 0xcc, 0xc9, 0x8b, 0x65, 0x19, 0xac, 0xeb, 0x68, 0x2e, 0x94, 0x5e, 0x62, 0xcb, 0x73, 0x46, 0x14, 0xa5, 0x29, 0x40, 0x7c, 0xd4, 0x52, 0xbe, 0xe3, 0xe4, 0x4f, 0xec, 0xe8, 0x42, 0x3c, 0xc1, 0x9e, 0x55, 0x54, 0x8b, 0x8b, 0x99, 0x4b, 0x84, 0x9c, 0x7e, 0xcd, 0xe4, 0x93, 0x3e, 0x76, 0x03, 0x7e, 0x1d, 0x0c, 0xe4, 0x42, 0x75, 0xb0, 0x87, 0x10, 0xc6, 0x8e, 0x43, 0x01, 0x30, 0xb9, 0x29, 0x73, 0x0e, 0xd7, 0x7e, 0x09, 0xb0, 0x15, 0x64, 0x2c, 0x55, 0x93, 0xf0, 0x4e, 0x4f, 0xfb, 0x94, 0x10, 0x79, 0x81, 0x02, 0xa8, 0xe9, 0x6f, 0xfd, 0xfe, 0x11, 0xe4 } + +} +, +{ + "RSAES-OAEP Encryption Example 4.5", + /* Message to be encrypted */ + 34, + { 0x28, 0xcc, 0xd4, 0x47, 0xbb, 0x9e, 0x85, 0x16, 0x6d, 0xab, 0xb9, 0xe5, 0xb7, 0xd1, 0xad, 0xad, 0xc4, 0xb9, 0xd3, 0x9f, 0x20, 0x4e, 0x96, 0xd5, 0xe4, 0x40, 0xce, 0x9a, 0xd9, 0x28, 0xbc, 0x1c, 0x22, 0x84 } +, + /* Seed */ + 20, + { 0xbc, 0xa8, 0x05, 0x7f, 0x82, 0x4b, 0x2e, 0xa2, 0x57, 0xf2, 0x86, 0x14, 0x07, 0xee, 0xf6, 0x3d, 0x33, 0x20, 0x86, 0x81 } +, + /* Encryption */ + 129, + { 0x00, 0xdb, 0xb8, 0xa7, 0x43, 0x9d, 0x90, 0xef, 0xd9, 0x19, 0xa3, 0x77, 0xc5, 0x4f, 0xae, 0x8f, 0xe1, 0x1e, 0xc5, 0x8c, 0x3b, 0x85, 0x83, 0x62, 0xe2, 0x3a, 0xd1, 0xb8, 0xa4, 0x43, 0x10, 0x79, 0x90, 0x66, 0xb9, 0x93, 0x47, 0xaa, 0x52, 0x56, 0x91, 0xd2, 0xad, 0xc5, 0x8d, 0x9b, 0x06, 0xe3, 0x4f, 0x28, 0x8c, 0x17, 0x03, 0x90, 0xc5, 0xf0, 0xe1, 0x1c, 0x0a, 0xa3, 0x64, 0x59, 0x59, 0xf1, 0x8e, 0xe7, 0x9e, 0x8f, 0x2b, 0xe8, 0xd7, 0xac, 0x5c, 0x23, 0xd0, 0x61, 0xf1, 0x8d, 0xd7, 0x4b, 0x8c, 0x5f, 0x2a, 0x58, 0xfc, 0xb5, 0xeb, 0x0c, 0x54, 0xf9, 0x9f, 0x01, 0xa8, 0x32, 0x47, 0x56, 0x82, 0x92, 0x53, 0x65, 0x83, 0x34, 0x09, 0x48, 0xd7, 0xa8, 0xc9, 0x7c, 0x4a, 0xcd, 0x1e, 0x98, 0xd1, 0xe2, 0x9d, 0xc3, 0x20, 0xe9, 0x7a, 0x26, 0x05, 0x32, 0xa8, 0xaa, 0x7a, 0x75, 0x8a, 0x1e, 0xc2 } + +} +, +{ + "RSAES-OAEP Encryption Example 4.6", + /* Message to be encrypted */ + 7, + { 0xf2, 0x22, 0x42, 0x75, 0x1e, 0xc6, 0xb1 } +, + /* Seed */ + 20, + { 0x2e, 0x7e, 0x1e, 0x17, 0xf6, 0x47, 0xb5, 0xdd, 0xd0, 0x33, 0xe1, 0x54, 0x72, 0xf9, 0x0f, 0x68, 0x12, 0xf3, 0xac, 0x4e } +, + /* Encryption */ + 129, + { 0x00, 0xa5, 0xff, 0xa4, 0x76, 0x8c, 0x8b, 0xbe, 0xca, 0xee, 0x2d, 0xb7, 0x7e, 0x8f, 0x2e, 0xec, 0x99, 0x59, 0x59, 0x33, 0x54, 0x55, 0x20, 0x83, 0x5e, 0x5b, 0xa7, 0xdb, 0x94, 0x93, 0xd3, 0xe1, 0x7c, 0xdd, 0xef, 0xe6, 0xa5, 0xf5, 0x67, 0x62, 0x44, 0x71, 0x90, 0x8d, 0xb4, 0xe2, 0xd8, 0x3a, 0x0f, 0xbe, 0xe6, 0x06, 0x08, 0xfc, 0x84, 0x04, 0x95, 0x03, 0xb2, 0x23, 0x4a, 0x07, 0xdc, 0x83, 0xb2, 0x7b, 0x22, 0x84, 0x7a, 0xd8, 0x92, 0x0f, 0xf4, 0x2f, 0x67, 0x4e, 0xf7, 0x9b, 0x76, 0x28, 0x0b, 0x00, 0x23, 0x3d, 0x2b, 0x51, 0xb8, 0xcb, 0x27, 0x03, 0xa9, 0xd4, 0x2b, 0xfb, 0xc8, 0x25, 0x0c, 0x96, 0xec, 0x32, 0xc0, 0x51, 0xe5, 0x7f, 0x1b, 0x4b, 0xa5, 0x28, 0xdb, 0x89, 0xc3, 0x7e, 0x4c, 0x54, 0xe2, 0x7e, 0x6e, 0x64, 0xac, 0x69, 0x63, 0x5a, 0xe8, 0x87, 0xd9, 0x54, 0x16, 0x19, 0xa9 } + +} +, +} +}, +{ + "Example 5: A 1028-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x0a, 0xad, 0xf3, 0xf9, 0xc1, 0x25, 0xe5, 0xd8, 0x91, 0xf3, 0x1a, 0xc4, 0x48, 0xe9, 0x93, 0xde, 0xfe, 0x58, 0x0f, 0x80, 0x2b, 0x45, 0xf9, 0xd7, 0xf2, 0x2b, 0xa5, 0x02, 0x1e, 0x9c, 0x47, 0x57, 0x6b, 0x5a, 0x1e, 0x68, 0x03, 0x1b, 0xa9, 0xdb, 0x4e, 0x6d, 0xab, 0xe4, 0xd9, 0x6a, 0x1d, 0x6f, 0x3d, 0x26, 0x72, 0x68, 0xcf, 0xf4, 0x08, 0x00, 0x5f, 0x11, 0x8e, 0xfc, 0xad, 0xb9, 0x98, 0x88, 0xd1, 0xc2, 0x34, 0x46, 0x71, 0x66, 0xb2, 0xa2, 0xb8, 0x49, 0xa0, 0x5a, 0x88, 0x9c, 0x06, 0x0a, 0xc0, 0xda, 0x0c, 0x5f, 0xae, 0x8b, 0x55, 0xf3, 0x09, 0xba, 0x62, 0xe7, 0x03, 0x74, 0x2f, 0xa0, 0x32, 0x6f, 0x2d, 0x10, 0xb0, 0x11, 0x02, 0x14, 0x89, 0xff, 0x49, 0x77, 0x70, 0x19, 0x0d, 0x89, 0x5f, 0xd3, 0x9f, 0x52, 0x29, 0x3c, 0x39, 0xef, 0xd7, 0x3a, 0x69, 0x8b, 0xda, 0xb9, 0xf1, 0x0e, 0xd9 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 129, + { 0x02, 0x56, 0xeb, 0x4c, 0xba, 0x70, 0x67, 0xf2, 0xd2, 0xbe, 0x54, 0x0d, 0xcd, 0xff, 0x45, 0x82, 0xa3, 0x6b, 0x7d, 0x31, 0xd1, 0xc9, 0x09, 0x9b, 0xb2, 0x14, 0xb7, 0x98, 0x48, 0x46, 0x6a, 0x26, 0x8f, 0x80, 0xf5, 0x8a, 0x49, 0xac, 0x04, 0xc0, 0xe3, 0x64, 0x89, 0x34, 0xa0, 0x20, 0x6c, 0x04, 0x53, 0x7c, 0x19, 0xb2, 0x36, 0x64, 0x3a, 0x60, 0x82, 0x73, 0x21, 0x44, 0xdf, 0x75, 0xfa, 0x21, 0x75, 0x88, 0xf7, 0x94, 0x68, 0x2b, 0xe8, 0x91, 0x68, 0x27, 0x6d, 0xc7, 0x26, 0xc5, 0xc0, 0xcb, 0xdb, 0x84, 0xd3, 0x1b, 0xbf, 0x26, 0xd0, 0xa4, 0x3a, 0xf4, 0x95, 0x71, 0x7f, 0x7d, 0x52, 0x8a, 0xcf, 0xee, 0x34, 0x15, 0x61, 0xf6, 0xff, 0x3c, 0xae, 0x05, 0xc5, 0x78, 0xf8, 0x47, 0x0d, 0x96, 0x82, 0xf9, 0xc0, 0xd0, 0x72, 0xf9, 0xf6, 0x06, 0x8b, 0x56, 0xd5, 0x88, 0x0f, 0x68, 0x2b, 0xe2, 0xc5 } +, + /* Prime p */ + 65, + { 0x03, 0xb0, 0xd3, 0x96, 0x2f, 0x6d, 0x17, 0x54, 0x9c, 0xbf, 0xca, 0x11, 0x29, 0x43, 0x48, 0xdc, 0xf0, 0xe7, 0xe3, 0x9f, 0x8c, 0x2b, 0xc6, 0x82, 0x4f, 0x21, 0x64, 0xb6, 0x06, 0xd6, 0x87, 0x86, 0x0d, 0xae, 0x1e, 0x63, 0x23, 0x93, 0xcf, 0xed, 0xf5, 0x13, 0x22, 0x82, 0x29, 0x06, 0x9e, 0x2f, 0x60, 0xe4, 0xac, 0xd7, 0xe6, 0x33, 0xa4, 0x36, 0x06, 0x3f, 0x82, 0x38, 0x5f, 0x48, 0x99, 0x37, 0x07 } +, + /* Prime q */ + 65, + { 0x02, 0xe4, 0xc3, 0x2e, 0x2f, 0x51, 0x72, 0x69, 0xb7, 0x07, 0x23, 0x09, 0xf0, 0x0c, 0x0e, 0x31, 0x36, 0x5f, 0x7c, 0xe2, 0x8b, 0x23, 0x6b, 0x82, 0x91, 0x2d, 0xf2, 0x39, 0xab, 0xf3, 0x95, 0x72, 0xcf, 0x0e, 0xd6, 0x04, 0xb0, 0x29, 0x82, 0xe5, 0x35, 0x64, 0xc5, 0x2d, 0x6a, 0x05, 0x39, 0x7d, 0xe5, 0xc0, 0x52, 0xa2, 0xfd, 0xdc, 0x14, 0x1e, 0xf7, 0x18, 0x98, 0x36, 0x34, 0x6a, 0xeb, 0x33, 0x1f } +, + /* p's CRT exponent dP */ + 65, + { 0x01, 0xe8, 0x4b, 0x11, 0x9d, 0x25, 0x16, 0x1f, 0xa6, 0x7b, 0x00, 0x25, 0x6a, 0x5b, 0xd9, 0xb6, 0x45, 0xd2, 0xb2, 0x32, 0xec, 0xb0, 0x5b, 0x01, 0x51, 0x80, 0x02, 0x9a, 0x88, 0x62, 0x2a, 0xdc, 0x3f, 0x09, 0xb3, 0xae, 0xac, 0xde, 0x61, 0x61, 0xab, 0x7c, 0xde, 0x22, 0xc2, 0xad, 0x26, 0xe7, 0x79, 0x7d, 0xf5, 0x4e, 0x07, 0x2c, 0xbd, 0x3b, 0x26, 0x73, 0x80, 0x0b, 0x3e, 0x43, 0x38, 0xdb, 0xd5 } +, + /* q's CRT exponent dQ */ + 64, + { 0xeb, 0x90, 0xaa, 0x1a, 0x40, 0x13, 0x5b, 0x4c, 0xea, 0x07, 0x19, 0x7c, 0xed, 0xc8, 0x81, 0x9b, 0xe1, 0xe7, 0xcb, 0xff, 0x25, 0x47, 0x66, 0x21, 0x16, 0xf4, 0x65, 0xa4, 0xa9, 0xf4, 0x87, 0xab, 0x12, 0xf3, 0xba, 0x4f, 0xef, 0x13, 0x82, 0x22, 0x65, 0xa6, 0x52, 0x97, 0xd9, 0x8b, 0x7b, 0xde, 0xd9, 0x37, 0x2e, 0x3f, 0xfe, 0x81, 0xa3, 0x8b, 0x3e, 0x96, 0x00, 0xfe, 0xd0, 0x55, 0x75, 0x4f } +, + /* CRT coefficient qInv */ + 65, + { 0x01, 0x2f, 0x7f, 0x81, 0x38, 0xf9, 0x40, 0x40, 0x62, 0xeb, 0x85, 0xa4, 0x29, 0x24, 0x52, 0x0b, 0x38, 0xf5, 0xbb, 0x88, 0x6a, 0x01, 0x96, 0xf4, 0x8b, 0xb8, 0xdc, 0xea, 0x60, 0xfd, 0x92, 0xcc, 0x02, 0x7f, 0x18, 0xe7, 0x81, 0x58, 0xa3, 0x4a, 0x5c, 0x5d, 0x5f, 0x86, 0x0a, 0x0f, 0x6c, 0x04, 0x07, 0x1a, 0x7d, 0x01, 0x31, 0x2c, 0x06, 0x50, 0x62, 0xf1, 0xeb, 0x48, 0xb7, 0x9d, 0x1c, 0x83, 0xcb } + +} +, +{{ + "RSAES-OAEP Encryption Example 5.1", + /* Message to be encrypted */ + 31, + { 0xaf, 0x71, 0xa9, 0x01, 0xe3, 0xa6, 0x1d, 0x31, 0x32, 0xf0, 0xfc, 0x1f, 0xdb, 0x47, 0x4f, 0x9e, 0xa6, 0x57, 0x92, 0x57, 0xff, 0xc2, 0x4d, 0x16, 0x41, 0x70, 0x14, 0x5b, 0x3d, 0xbd, 0xe8 } +, + /* Seed */ + 20, + { 0x44, 0xc9, 0x2e, 0x28, 0x3f, 0x77, 0xb9, 0x49, 0x9c, 0x60, 0x3d, 0x96, 0x36, 0x60, 0xc8, 0x7d, 0x2f, 0x93, 0x94, 0x61 } +, + /* Encryption */ + 129, + { 0x03, 0x60, 0x46, 0xa4, 0xa4, 0x7d, 0x9e, 0xd3, 0xba, 0x9a, 0x89, 0x13, 0x9c, 0x10, 0x50, 0x38, 0xeb, 0x74, 0x92, 0xb0, 0x5a, 0x5d, 0x68, 0xbf, 0xd5, 0x3a, 0xcc, 0xff, 0x45, 0x97, 0xf7, 0xa6, 0x86, 0x51, 0xb4, 0x7b, 0x4a, 0x46, 0x27, 0xd9, 0x27, 0xe4, 0x85, 0xee, 0xd7, 0xb4, 0x56, 0x64, 0x20, 0xe8, 0xb4, 0x09, 0x87, 0x9e, 0x5d, 0x60, 0x6e, 0xae, 0x25, 0x1d, 0x22, 0xa5, 0xdf, 0x79, 0x9f, 0x79, 0x20, 0xbf, 0xc1, 0x17, 0xb9, 0x92, 0x57, 0x2a, 0x53, 0xb1, 0x26, 0x31, 0x46, 0xbc, 0xea, 0x03, 0x38, 0x5c, 0xc5, 0xe8, 0x53, 0xc9, 0xa1, 0x01, 0xc8, 0xc3, 0xe1, 0xbd, 0xa3, 0x1a, 0x51, 0x98, 0x07, 0x49, 0x6c, 0x6c, 0xb5, 0xe5, 0xef, 0xb4, 0x08, 0x82, 0x3a, 0x35, 0x2b, 0x8f, 0xa0, 0x66, 0x1f, 0xb6, 0x64, 0xef, 0xad, 0xd5, 0x93, 0xde, 0xb9, 0x9f, 0xff, 0x5e, 0xd0, 0x00, 0xe5 } + +} +, +{ + "RSAES-OAEP Encryption Example 5.2", + /* Message to be encrypted */ + 44, + { 0xa3, 0xb8, 0x44, 0xa0, 0x82, 0x39, 0xa8, 0xac, 0x41, 0x60, 0x5a, 0xf1, 0x7a, 0x6c, 0xfd, 0xa4, 0xd3, 0x50, 0x13, 0x65, 0x85, 0x90, 0x3a, 0x41, 0x7a, 0x79, 0x26, 0x87, 0x60, 0x51, 0x9a, 0x4b, 0x4a, 0xc3, 0x30, 0x3e, 0xc7, 0x3f, 0x0f, 0x87, 0xcf, 0xb3, 0x23, 0x99 } +, + /* Seed */ + 20, + { 0xcb, 0x28, 0xf5, 0x86, 0x06, 0x59, 0xfc, 0xee, 0xe4, 0x9c, 0x3e, 0xea, 0xfc, 0xe6, 0x25, 0xa7, 0x08, 0x03, 0xbd, 0x32 } +, + /* Encryption */ + 129, + { 0x03, 0xd6, 0xeb, 0x65, 0x4e, 0xdc, 0xe6, 0x15, 0xbc, 0x59, 0xf4, 0x55, 0x26, 0x5e, 0xd4, 0xe5, 0xa1, 0x82, 0x23, 0xcb, 0xb9, 0xbe, 0x4e, 0x40, 0x69, 0xb4, 0x73, 0x80, 0x4d, 0x5d, 0xe9, 0x6f, 0x54, 0xdc, 0xaa, 0xa6, 0x03, 0xd0, 0x49, 0xc5, 0xd9, 0x4a, 0xa1, 0x47, 0x0d, 0xfc, 0xd2, 0x25, 0x40, 0x66, 0xb7, 0xc7, 0xb6, 0x1f, 0xf1, 0xf6, 0xf6, 0x77, 0x0e, 0x32, 0x15, 0xc5, 0x13, 0x99, 0xfd, 0x4e, 0x34, 0xec, 0x50, 0x82, 0xbc, 0x48, 0xf0, 0x89, 0x84, 0x0a, 0xd0, 0x43, 0x54, 0xae, 0x66, 0xdc, 0x0f, 0x1b, 0xd1, 0x8e, 0x46, 0x1a, 0x33, 0xcc, 0x12, 0x58, 0xb4, 0x43, 0xa2, 0x83, 0x7a, 0x6d, 0xf2, 0x67, 0x59, 0xaa, 0x23, 0x02, 0x33, 0x49, 0x86, 0xf8, 0x73, 0x80, 0xc9, 0xcc, 0x9d, 0x53, 0xbe, 0x9f, 0x99, 0x60, 0x5d, 0x2c, 0x9a, 0x97, 0xda, 0x7b, 0x09, 0x15, 0xa4, 0xa7, 0xad } + +} +, +{ + "RSAES-OAEP Encryption Example 5.3", + /* Message to be encrypted */ + 63, + { 0x30, 0x8b, 0x0e, 0xcb, 0xd2, 0xc7, 0x6c, 0xb7, 0x7f, 0xc6, 0xf7, 0x0c, 0x5e, 0xdd, 0x23, 0x3f, 0xd2, 0xf2, 0x09, 0x29, 0xd6, 0x29, 0xf0, 0x26, 0x95, 0x3b, 0xb6, 0x2a, 0x8f, 0x4a, 0x3a, 0x31, 0x4b, 0xde, 0x19, 0x5d, 0xe8, 0x5b, 0x5f, 0x81, 0x6d, 0xa2, 0xaa, 0xb0, 0x74, 0xd2, 0x6c, 0xb6, 0xac, 0xdd, 0xf3, 0x23, 0xae, 0x3b, 0x9c, 0x67, 0x8a, 0xc3, 0xcf, 0x12, 0xfb, 0xdd, 0xe7 } +, + /* Seed */ + 20, + { 0x22, 0x85, 0xf4, 0x0d, 0x77, 0x04, 0x82, 0xf9, 0xa9, 0xef, 0xa2, 0xc7, 0x2c, 0xb3, 0xac, 0x55, 0x71, 0x6d, 0xc0, 0xca } +, + /* Encryption */ + 129, + { 0x07, 0x70, 0x95, 0x21, 0x81, 0x64, 0x9f, 0x9f, 0x9f, 0x07, 0xff, 0x62, 0x6f, 0xf3, 0xa2, 0x2c, 0x35, 0xc4, 0x62, 0x44, 0x3d, 0x90, 0x5d, 0x45, 0x6a, 0x9f, 0xd0, 0xbf, 0xf4, 0x3c, 0xac, 0x2c, 0xa7, 0xa9, 0xf5, 0x54, 0xe9, 0x47, 0x8b, 0x9a, 0xcc, 0x3a, 0xc8, 0x38, 0xb0, 0x20, 0x40, 0xff, 0xd3, 0xe1, 0x84, 0x7d, 0xe2, 0xe4, 0x25, 0x39, 0x29, 0xf9, 0xdd, 0x9e, 0xe4, 0x04, 0x43, 0x25, 0xa9, 0xb0, 0x5c, 0xab, 0xb8, 0x08, 0xb2, 0xee, 0x84, 0x0d, 0x34, 0xe1, 0x5d, 0x10, 0x5a, 0x3f, 0x1f, 0x7b, 0x27, 0x69, 0x5a, 0x1a, 0x07, 0xa2, 0xd7, 0x3f, 0xe0, 0x8e, 0xca, 0xaa, 0x3c, 0x9c, 0x9d, 0x4d, 0x5a, 0x89, 0xff, 0x89, 0x0d, 0x54, 0x72, 0x7d, 0x7a, 0xe4, 0x0c, 0x0e, 0xc1, 0xa8, 0xdd, 0x86, 0x16, 0x5d, 0x8e, 0xe2, 0xc6, 0x36, 0x81, 0x41, 0x01, 0x6a, 0x48, 0xb5, 0x5b, 0x69, 0x67 } + +} +, +{ + "RSAES-OAEP Encryption Example 5.4", + /* Message to be encrypted */ + 6, + { 0x15, 0xc5, 0xb9, 0xee, 0x11, 0x85 } +, + /* Seed */ + 20, + { 0x49, 0xfa, 0x45, 0xd3, 0xa7, 0x8d, 0xd1, 0x0d, 0xfd, 0x57, 0x73, 0x99, 0xd1, 0xeb, 0x00, 0xaf, 0x7e, 0xed, 0x55, 0x13 } +, + /* Encryption */ + 129, + { 0x08, 0x12, 0xb7, 0x67, 0x68, 0xeb, 0xcb, 0x64, 0x2d, 0x04, 0x02, 0x58, 0xe5, 0xf4, 0x44, 0x1a, 0x01, 0x85, 0x21, 0xbd, 0x96, 0x68, 0x7e, 0x6c, 0x5e, 0x89, 0x9f, 0xcd, 0x6c, 0x17, 0x58, 0x8f, 0xf5, 0x9a, 0x82, 0xcc, 0x8a, 0xe0, 0x3a, 0x4b, 0x45, 0xb3, 0x12, 0x99, 0xaf, 0x17, 0x88, 0xc3, 0x29, 0xf7, 0xdc, 0xd2, 0x85, 0xf8, 0xcf, 0x4c, 0xed, 0x82, 0x60, 0x6b, 0x97, 0x61, 0x26, 0x71, 0xa4, 0x5b, 0xed, 0xca, 0x13, 0x34, 0x42, 0x14, 0x4d, 0x16, 0x17, 0xd1, 0x14, 0xf8, 0x02, 0x85, 0x7f, 0x0f, 0x9d, 0x73, 0x97, 0x51, 0xc5, 0x7a, 0x3f, 0x9e, 0xe4, 0x00, 0x91, 0x2c, 0x61, 0xe2, 0xe6, 0x99, 0x2b, 0xe0, 0x31, 0xa4, 0x3d, 0xd4, 0x8f, 0xa6, 0xba, 0x14, 0xee, 0xf7, 0xc4, 0x22, 0xb5, 0xed, 0xc4, 0xe7, 0xaf, 0xa0, 0x4f, 0xdd, 0x38, 0xf4, 0x02, 0xd1, 0xc8, 0xbb, 0x71, 0x9a, 0xbf } + +} +, +{ + "RSAES-OAEP Encryption Example 5.5", + /* Message to be encrypted */ + 45, + { 0x21, 0x02, 0x6e, 0x68, 0x00, 0xc7, 0xfa, 0x72, 0x8f, 0xca, 0xab, 0xa0, 0xd1, 0x96, 0xae, 0x28, 0xd7, 0xa2, 0xac, 0x4f, 0xfd, 0x8a, 0xbc, 0xe7, 0x94, 0xf0, 0x98, 0x5f, 0x60, 0xc8, 0xa6, 0x73, 0x72, 0x77, 0x36, 0x5d, 0x3f, 0xea, 0x11, 0xdb, 0x89, 0x23, 0xa2, 0x02, 0x9a } +, + /* Seed */ + 20, + { 0xf0, 0x28, 0x74, 0x13, 0x23, 0x4c, 0xc5, 0x03, 0x47, 0x24, 0xa0, 0x94, 0xc4, 0x58, 0x6b, 0x87, 0xaf, 0xf1, 0x33, 0xfc } +, + /* Encryption */ + 129, + { 0x07, 0xb6, 0x0e, 0x14, 0xec, 0x95, 0x4b, 0xfd, 0x29, 0xe6, 0x0d, 0x00, 0x47, 0xe7, 0x89, 0xf5, 0x1d, 0x57, 0x18, 0x6c, 0x63, 0x58, 0x99, 0x03, 0x30, 0x67, 0x93, 0xce, 0xd3, 0xf6, 0x82, 0x41, 0xc7, 0x43, 0x52, 0x9a, 0xba, 0x6a, 0x63, 0x74, 0xf9, 0x2e, 0x19, 0xe0, 0x16, 0x3e, 0xfa, 0x33, 0x69, 0x7e, 0x19, 0x6f, 0x76, 0x61, 0xdf, 0xaa, 0xa4, 0x7a, 0xac, 0x6b, 0xde, 0x5e, 0x51, 0xde, 0xb5, 0x07, 0xc7, 0x2c, 0x58, 0x9a, 0x2c, 0xa1, 0x69, 0x3d, 0x96, 0xb1, 0x46, 0x03, 0x81, 0x24, 0x9b, 0x2c, 0xdb, 0x9e, 0xac, 0x44, 0x76, 0x9f, 0x24, 0x89, 0xc5, 0xd3, 0xd2, 0xf9, 0x9f, 0x0e, 0xe3, 0xc7, 0xee, 0x5b, 0xf6, 0x4a, 0x5a, 0xc7, 0x9c, 0x42, 0xbd, 0x43, 0x3f, 0x14, 0x9b, 0xe8, 0xcb, 0x59, 0x54, 0x83, 0x61, 0x64, 0x05, 0x95, 0x51, 0x3c, 0x97, 0xaf, 0x7b, 0xc2, 0x50, 0x97, 0x23 } + +} +, +{ + "RSAES-OAEP Encryption Example 5.6", + /* Message to be encrypted */ + 11, + { 0x54, 0x1e, 0x37, 0xb6, 0x8b, 0x6c, 0x88, 0x72, 0xb8, 0x4c, 0x02 } +, + /* Seed */ + 20, + { 0xd9, 0xfb, 0xa4, 0x5c, 0x96, 0xf2, 0x1e, 0x6e, 0x26, 0xd2, 0x9e, 0xb2, 0xcd, 0xcb, 0x65, 0x85, 0xbe, 0x9c, 0xb3, 0x41 } +, + /* Encryption */ + 129, + { 0x08, 0xc3, 0x6d, 0x4d, 0xda, 0x33, 0x42, 0x3b, 0x2e, 0xd6, 0x83, 0x0d, 0x85, 0xf6, 0x41, 0x1b, 0xa1, 0xdc, 0xf4, 0x70, 0xa1, 0xfa, 0xe0, 0xeb, 0xef, 0xee, 0x7c, 0x08, 0x9f, 0x25, 0x6c, 0xef, 0x74, 0xcb, 0x96, 0xea, 0x69, 0xc3, 0x8f, 0x60, 0xf3, 0x9a, 0xbe, 0xe4, 0x41, 0x29, 0xbc, 0xb4, 0xc9, 0x2d, 0xe7, 0xf7, 0x97, 0x62, 0x3b, 0x20, 0x07, 0x4e, 0x3d, 0x9c, 0x28, 0x99, 0x70, 0x1e, 0xd9, 0x07, 0x1e, 0x1e, 0xfa, 0x0b, 0xdd, 0x84, 0xd4, 0xc3, 0xe5, 0x13, 0x03, 0x02, 0xd8, 0xf0, 0x24, 0x0b, 0xab, 0xa4, 0xb8, 0x4a, 0x71, 0xcc, 0x03, 0x2f, 0x22, 0x35, 0xa5, 0xff, 0x0f, 0xae, 0x27, 0x7c, 0x3e, 0x8f, 0x91, 0x12, 0xbe, 0xf4, 0x4c, 0x9a, 0xe2, 0x0d, 0x17, 0x5f, 0xc9, 0xa4, 0x05, 0x8b, 0xfc, 0x93, 0x0b, 0xa3, 0x1b, 0x02, 0xe2, 0xe4, 0xf4, 0x44, 0x48, 0x37, 0x10, 0xf2, 0x4a } + +} +, +} +}, +{ + "Example 6: A 1029-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x12, 0xb1, 0x7f, 0x6d, 0xad, 0x2e, 0xcd, 0x19, 0xff, 0x46, 0xdc, 0x13, 0xf7, 0x86, 0x0f, 0x09, 0xe0, 0xe0, 0xcf, 0xb6, 0x77, 0xb3, 0x8a, 0x52, 0x59, 0x23, 0x05, 0xce, 0xaf, 0x02, 0x2c, 0x16, 0x6d, 0xb9, 0x0d, 0x04, 0xac, 0x29, 0xe3, 0x3f, 0x7d, 0xd1, 0x2d, 0x9f, 0xaf, 0x66, 0xe0, 0x81, 0x6b, 0xb6, 0x3e, 0xad, 0x26, 0x7c, 0xc7, 0xd4, 0x6c, 0x17, 0xc3, 0x7b, 0xe2, 0x14, 0xbc, 0xa2, 0xa2, 0x2d, 0x72, 0x3a, 0x64, 0xe4, 0x44, 0x07, 0x43, 0x6b, 0x6f, 0xc9, 0x65, 0x72, 0x9a, 0xef, 0xc2, 0x55, 0x4f, 0x37, 0x6c, 0xd5, 0xdc, 0xea, 0x68, 0x29, 0x37, 0x80, 0xa6, 0x2b, 0xf3, 0x9d, 0x00, 0x29, 0x48, 0x5a, 0x16, 0x0b, 0xbb, 0x9e, 0x5d, 0xc0, 0x97, 0x2d, 0x21, 0xa5, 0x04, 0xf5, 0x2e, 0x5e, 0xe0, 0x28, 0xaa, 0x41, 0x63, 0x32, 0xf5, 0x10, 0xb2, 0xe9, 0xcf, 0xf5, 0xf7, 0x22, 0xaf } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 129, + { 0x02, 0x95, 0xec, 0xa3, 0x56, 0x06, 0x18, 0x36, 0x95, 0x59, 0xce, 0xcd, 0x30, 0x3a, 0xa9, 0xcf, 0xda, 0xfc, 0x1d, 0x9f, 0x06, 0x95, 0x9d, 0xf7, 0x5f, 0xfe, 0xf9, 0x29, 0xaa, 0x89, 0x69, 0x61, 0xbc, 0xd1, 0x90, 0xdc, 0x69, 0x97, 0xed, 0xa7, 0xf5, 0x96, 0x3e, 0x72, 0x4d, 0x07, 0xb4, 0xdc, 0x11, 0xf3, 0x06, 0x5e, 0x5a, 0xe9, 0x7d, 0x96, 0x83, 0x51, 0x12, 0x28, 0x0b, 0x90, 0x84, 0xbb, 0x14, 0xf2, 0xa2, 0x1e, 0xbd, 0x4e, 0x88, 0x9d, 0x41, 0xb9, 0xc4, 0x13, 0x2e, 0xc1, 0x95, 0x6f, 0xca, 0xb8, 0xbb, 0x2f, 0xed, 0x05, 0x75, 0x88, 0x49, 0x36, 0x52, 0x2c, 0x5f, 0xf7, 0xd3, 0x32, 0x61, 0x90, 0x48, 0x24, 0xe7, 0xca, 0xde, 0xe4, 0xe0, 0xbb, 0x37, 0x2d, 0x24, 0x57, 0xcf, 0x78, 0xe2, 0xbd, 0x12, 0x86, 0x22, 0x8f, 0xf8, 0x3f, 0x10, 0x73, 0x1c, 0xe6, 0x3c, 0x90, 0xcf, 0xf3, 0xf9 } +, + /* Prime p */ + 65, + { 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f, 0x15, 0xd8, 0xd0, 0x44, 0xc7, 0xeb, 0x83, 0xa1, 0xbe, 0x5f, 0xad, 0xf2, 0xcc, 0x37, 0x7c, 0x0d, 0x84, 0x75, 0x29, 0x4b } +, + /* q's CRT exponent dQ */ + 65, + { 0x02, 0x21, 0x97, 0xe0, 0x66, 0x74, 0x21, 0x96, 0xaa, 0xbc, 0x03, 0xfa, 0x2f, 0xee, 0xb4, 0xe7, 0x0b, 0x15, 0xcb, 0x78, 0x7d, 0x61, 0x7a, 0xcd, 0x31, 0xbb, 0x75, 0xc7, 0xbc, 0x23, 0x4a, 0xd7, 0x06, 0xf7, 0xc4, 0x8d, 0x21, 0x82, 0xd1, 0xf0, 0xff, 0x9c, 0x22, 0x8d, 0xcf, 0x41, 0x96, 0x7b, 0x6c, 0x0b, 0xa6, 0xd2, 0xc0, 0xad, 0x11, 0x0a, 0x1b, 0x85, 0x78, 0x31, 0xec, 0x24, 0x5e, 0x2c, 0xb1 } +, + /* CRT coefficient qInv */ + 65, + { 0x04, 0x01, 0xc4, 0xc0, 0xc5, 0x3d, 0x45, 0xdb, 0xdb, 0x5e, 0x9d, 0x96, 0xd0, 0xfe, 0xcf, 0x42, 0x75, 0xdf, 0x09, 0x74, 0xbc, 0x4a, 0x07, 0x36, 0xb4, 0xa7, 0x4c, 0x32, 0x69, 0x05, 0x3e, 0xfb, 0x68, 0x6a, 0xce, 0x24, 0x06, 0xe2, 0x2c, 0x9e, 0x05, 0x8d, 0xdb, 0x4a, 0xe5, 0x40, 0x62, 0x7a, 0xe2, 0xfd, 0xb0, 0x82, 0x61, 0xe8, 0xe7, 0xe4, 0xbc, 0xbc, 0x99, 0x4d, 0xaa, 0xfa, 0x30, 0x5c, 0x45 } + +} +, +{{ + "RSAES-OAEP Encryption Example 6.1", + /* Message to be encrypted */ + 22, + { 0x40, 0x46, 0xca, 0x8b, 0xaa, 0x33, 0x47, 0xca, 0x27, 0xf4, 0x9e, 0x0d, 0x81, 0xf9, 0xcc, 0x1d, 0x71, 0xbe, 0x9b, 0xa5, 0x17, 0xd4 } +, + /* Seed */ + 20, + { 0xdd, 0x0f, 0x6c, 0xfe, 0x41, 0x5e, 0x88, 0xe5, 0xa4, 0x69, 0xa5, 0x1f, 0xbb, 0xa6, 0xdf, 0xd4, 0x0a, 0xdb, 0x43, 0x84 } +, + /* Encryption */ + 129, + { 0x06, 0x30, 0xee, 0xbc, 0xd2, 0x85, 0x6c, 0x24, 0xf7, 0x98, 0x80, 0x6e, 0x41, 0xf9, 0xe6, 0x73, 0x45, 0xed, 0xa9, 0xce, 0xda, 0x38, 0x6a, 0xcc, 0x9f, 0xac, 0xae, 0xa1, 0xee, 0xed, 0x06, 0xac, 0xe5, 0x83, 0x70, 0x97, 0x18, 0xd9, 0xd1, 0x69, 0xfa, 0xdf, 0x41, 0x4d, 0x5c, 0x76, 0xf9, 0x29, 0x96, 0x83, 0x3e, 0xf3, 0x05, 0xb7, 0x5b, 0x1e, 0x4b, 0x95, 0xf6, 0x62, 0xa2, 0x0f, 0xae, 0xdc, 0x3b, 0xae, 0x0c, 0x48, 0x27, 0xa8, 0xbf, 0x8a, 0x88, 0xed, 0xbd, 0x57, 0xec, 0x20, 0x3a, 0x27, 0xa8, 0x41, 0xf0, 0x2e, 0x43, 0xa6, 0x15, 0xba, 0xb1, 0xa8, 0xca, 0xc0, 0x70, 0x1d, 0xe3, 0x4d, 0xeb, 0xde, 0xf6, 0x2a, 0x08, 0x80, 0x89, 0xb5, 0x5e, 0xc3, 0x6e, 0xa7, 0x52, 0x2f, 0xd3, 0xec, 0x8d, 0x06, 0xb6, 0xa0, 0x73, 0xe6, 0xdf, 0x83, 0x31, 0x53, 0xbc, 0x0a, 0xef, 0xd9, 0x3b, 0xd1, 0xa3 } + +} +, +{ + "RSAES-OAEP Encryption Example 6.2", + /* Message to be encrypted */ + 50, + { 0x5c, 0xc7, 0x2c, 0x60, 0x23, 0x1d, 0xf0, 0x3b, 0x3d, 0x40, 0xf9, 0xb5, 0x79, 0x31, 0xbc, 0x31, 0x10, 0x9f, 0x97, 0x25, 0x27, 0xf2, 0x8b, 0x19, 0xe7, 0x48, 0x0c, 0x72, 0x88, 0xcb, 0x3c, 0x92, 0xb2, 0x25, 0x12, 0x21, 0x4e, 0x4b, 0xe6, 0xc9, 0x14, 0x79, 0x2d, 0xda, 0xbd, 0xf5, 0x7f, 0xaa, 0x8a, 0xa7 } +, + /* Seed */ + 20, + { 0x8d, 0x14, 0xbd, 0x94, 0x6a, 0x13, 0x51, 0x14, 0x8f, 0x5c, 0xae, 0x2e, 0xd9, 0xa0, 0xc6, 0x53, 0xe8, 0x5e, 0xbd, 0x85 } +, + /* Encryption */ + 129, + { 0x0e, 0xbc, 0x37, 0x37, 0x61, 0x73, 0xa4, 0xfd, 0x2f, 0x89, 0xcc, 0x55, 0xc2, 0xca, 0x62, 0xb2, 0x6b, 0x11, 0xd5, 0x1c, 0x3c, 0x7c, 0xe4, 0x9e, 0x88, 0x45, 0xf7, 0x4e, 0x76, 0x07, 0x31, 0x7c, 0x43, 0x6b, 0xc8, 0xd2, 0x3b, 0x96, 0x67, 0xdf, 0xeb, 0x9d, 0x08, 0x72, 0x34, 0xb4, 0x7b, 0xc6, 0x83, 0x71, 0x75, 0xae, 0x5c, 0x05, 0x59, 0xf6, 0xb8, 0x1d, 0x7d, 0x22, 0x41, 0x6d, 0x3e, 0x50, 0xf4, 0xac, 0x53, 0x3d, 0x8f, 0x08, 0x12, 0xf2, 0xdb, 0x9e, 0x79, 0x1f, 0xe9, 0xc7, 0x75, 0xac, 0x8b, 0x6a, 0xd0, 0xf5, 0x35, 0xad, 0x9c, 0xeb, 0x23, 0xa4, 0xa0, 0x20, 0x14, 0xc5, 0x8a, 0xb3, 0xf8, 0xd3, 0x16, 0x14, 0x99, 0xa2, 0x60, 0xf3, 0x93, 0x48, 0xe7, 0x14, 0xae, 0x2a, 0x1d, 0x34, 0x43, 0x20, 0x8f, 0xd8, 0xb7, 0x22, 0xcc, 0xfd, 0xfb, 0x39, 0x3e, 0x98, 0x01, 0x1f, 0x99, 0xe6, 0x3f } + +} +, +{ + "RSAES-OAEP Encryption Example 6.3", + /* Message to be encrypted */ + 54, + { 0xb2, 0x0e, 0x65, 0x13, 0x03, 0x09, 0x2f, 0x4b, 0xcc, 0xb4, 0x30, 0x70, 0xc0, 0xf8, 0x6d, 0x23, 0x04, 0x93, 0x62, 0xed, 0x96, 0x64, 0x2f, 0xc5, 0x63, 0x2c, 0x27, 0xdb, 0x4a, 0x52, 0xe3, 0xd8, 0x31, 0xf2, 0xab, 0x06, 0x8b, 0x23, 0xb1, 0x49, 0x87, 0x9c, 0x00, 0x2f, 0x6b, 0xf3, 0xfe, 0xee, 0x97, 0x59, 0x11, 0x12, 0x56, 0x2c } +, + /* Seed */ + 20, + { 0x6c, 0x07, 0x5b, 0xc4, 0x55, 0x20, 0xf1, 0x65, 0xc0, 0xbf, 0x5e, 0xa4, 0xc5, 0xdf, 0x19, 0x1b, 0xc9, 0xef, 0x0e, 0x44 } +, + /* Encryption */ + 129, + { 0x0a, 0x98, 0xbf, 0x10, 0x93, 0x61, 0x93, 0x94, 0x43, 0x6c, 0xf6, 0x8d, 0x8f, 0x38, 0xe2, 0xf1, 0x58, 0xfd, 0xe8, 0xea, 0x54, 0xf3, 0x43, 0x5f, 0x23, 0x9b, 0x8d, 0x06, 0xb8, 0x32, 0x18, 0x44, 0x20, 0x24, 0x76, 0xae, 0xed, 0x96, 0x00, 0x94, 0x92, 0x48, 0x0c, 0xe3, 0xa8, 0xd7, 0x05, 0x49, 0x8c, 0x4c, 0x8c, 0x68, 0xf0, 0x15, 0x01, 0xdc, 0x81, 0xdb, 0x60, 0x8f, 0x60, 0x08, 0x73, 0x50, 0xc8, 0xc3, 0xb0, 0xbd, 0x2e, 0x9e, 0xf6, 0xa8, 0x14, 0x58, 0xb7, 0xc8, 0x01, 0xb8, 0x9f, 0x2e, 0x4f, 0xe9, 0x9d, 0x49, 0x00, 0xba, 0x6a, 0x4b, 0x5e, 0x5a, 0x96, 0xd8, 0x65, 0xdc, 0x67, 0x6c, 0x77, 0x55, 0x92, 0x87, 0x94, 0x13, 0x0d, 0x62, 0x80, 0xa8, 0x16, 0x0a, 0x19, 0x0f, 0x2d, 0xf3, 0xea, 0x7c, 0xf9, 0xaa, 0x02, 0x71, 0xd8, 0x8e, 0x9e, 0x69, 0x05, 0xec, 0xf1, 0xc5, 0x15, 0x2d, 0x65 } + +} +, +{ + "RSAES-OAEP Encryption Example 6.4", + /* Message to be encrypted */ + 8, + { 0x68, 0x4e, 0x30, 0x38, 0xc5, 0xc0, 0x41, 0xf7 } +, + /* Seed */ + 20, + { 0x3b, 0xbc, 0x3b, 0xd6, 0x63, 0x7d, 0xfe, 0x12, 0x84, 0x69, 0x01, 0x02, 0x9b, 0xf5, 0xb0, 0xc0, 0x71, 0x03, 0x43, 0x9c } +, + /* Encryption */ + 129, + { 0x00, 0x8e, 0x7a, 0x67, 0xca, 0xcf, 0xb5, 0xc4, 0xe2, 0x4b, 0xec, 0x7d, 0xee, 0x14, 0x91, 0x17, 0xf1, 0x95, 0x98, 0xce, 0x8c, 0x45, 0x80, 0x8f, 0xef, 0x88, 0xc6, 0x08, 0xff, 0x9c, 0xd6, 0xe6, 0x95, 0x26, 0x3b, 0x9a, 0x3c, 0x0a, 0xd4, 0xb8, 0xba, 0x4c, 0x95, 0x23, 0x8e, 0x96, 0xa8, 0x42, 0x2b, 0x85, 0x35, 0x62, 0x9c, 0x8d, 0x53, 0x82, 0x37, 0x44, 0x79, 0xad, 0x13, 0xfa, 0x39, 0x97, 0x4b, 0x24, 0x2f, 0x9a, 0x75, 0x9e, 0xea, 0xf9, 0xc8, 0x3a, 0xd5, 0xa8, 0xca, 0x18, 0x94, 0x0a, 0x01, 0x62, 0xba, 0x75, 0x58, 0x76, 0xdf, 0x26, 0x3f, 0x4b, 0xd5, 0x0c, 0x65, 0x25, 0xc5, 0x60, 0x90, 0x26, 0x7c, 0x1f, 0x0e, 0x09, 0xce, 0x08, 0x99, 0xa0, 0xcf, 0x35, 0x9e, 0x88, 0x12, 0x0a, 0xbd, 0x9b, 0xf8, 0x93, 0x44, 0x5b, 0x3c, 0xae, 0x77, 0xd3, 0x60, 0x73, 0x59, 0xae, 0x9a, 0x52, 0xf8 } + +} +, +{ + "RSAES-OAEP Encryption Example 6.5", + /* Message to be encrypted */ + 25, + { 0x32, 0x48, 0x8c, 0xb2, 0x62, 0xd0, 0x41, 0xd6, 0xe4, 0xdd, 0x35, 0xf9, 0x87, 0xbf, 0x3c, 0xa6, 0x96, 0xdb, 0x1f, 0x06, 0xac, 0x29, 0xa4, 0x46, 0x93 } +, + /* Seed */ + 20, + { 0xb4, 0x6b, 0x41, 0x89, 0x3e, 0x8b, 0xef, 0x32, 0x6f, 0x67, 0x59, 0x38, 0x3a, 0x83, 0x07, 0x1d, 0xae, 0x7f, 0xca, 0xbc } +, + /* Encryption */ + 129, + { 0x00, 0x00, 0x34, 0x74, 0x41, 0x6c, 0x7b, 0x68, 0xbd, 0xf9, 0x61, 0xc3, 0x85, 0x73, 0x79, 0x44, 0xd7, 0xf1, 0xf4, 0x0c, 0xb3, 0x95, 0x34, 0x3c, 0x69, 0x3c, 0xc0, 0xb4, 0xfe, 0x63, 0xb3, 0x1f, 0xed, 0xf1, 0xea, 0xee, 0xac, 0x9c, 0xcc, 0x06, 0x78, 0xb3, 0x1d, 0xc3, 0x2e, 0x09, 0x77, 0x48, 0x95, 0x14, 0xc4, 0xf0, 0x90, 0x85, 0xf6, 0x29, 0x8a, 0x96, 0x53, 0xf0, 0x1a, 0xea, 0x40, 0x45, 0xff, 0x58, 0x2e, 0xe8, 0x87, 0xbe, 0x26, 0xae, 0x57, 0x5b, 0x73, 0xee, 0xf7, 0xf3, 0x77, 0x49, 0x21, 0xe3, 0x75, 0xa3, 0xd1, 0x9a, 0xdd, 0xa0, 0xca, 0x31, 0xaa, 0x18, 0x49, 0x88, 0x7c, 0x1f, 0x42, 0xca, 0xc9, 0x67, 0x7f, 0x7a, 0x2f, 0x4e, 0x92, 0x3f, 0x6e, 0x5a, 0x86, 0x8b, 0x38, 0xc0, 0x84, 0xef, 0x18, 0x75, 0x94, 0xdc, 0x9f, 0x7f, 0x04, 0x8f, 0xea, 0x2e, 0x02, 0x95, 0x53, 0x84, 0xab } + +} +, +{ + "RSAES-OAEP Encryption Example 6.6", + /* Message to be encrypted */ + 12, + { 0x50, 0xba, 0x14, 0xbe, 0x84, 0x62, 0x72, 0x02, 0x79, 0xc3, 0x06, 0xba } +, + /* Seed */ + 20, + { 0x0a, 0x24, 0x03, 0x31, 0x2a, 0x41, 0xe3, 0xd5, 0x2f, 0x06, 0x0f, 0xbc, 0x13, 0xa6, 0x7d, 0xe5, 0xcf, 0x76, 0x09, 0xa7 } +, + /* Encryption */ + 129, + { 0x0a, 0x02, 0x6d, 0xda, 0x5f, 0xc8, 0x78, 0x5f, 0x7b, 0xd9, 0xbf, 0x75, 0x32, 0x7b, 0x63, 0xe8, 0x5e, 0x2c, 0x0f, 0xde, 0xe5, 0xda, 0xdb, 0x65, 0xeb, 0xdc, 0xac, 0x9a, 0xe1, 0xde, 0x95, 0xc9, 0x2c, 0x67, 0x2a, 0xb4, 0x33, 0xaa, 0x7a, 0x8e, 0x69, 0xce, 0x6a, 0x6d, 0x88, 0x97, 0xfa, 0xc4, 0xac, 0x4a, 0x54, 0xde, 0x84, 0x1a, 0xe5, 0xe5, 0xbb, 0xce, 0x76, 0x87, 0x87, 0x9d, 0x79, 0x63, 0x4c, 0xea, 0x7a, 0x30, 0x68, 0x40, 0x65, 0xc7, 0x14, 0xd5, 0x24, 0x09, 0xb9, 0x28, 0x25, 0x6b, 0xbf, 0x53, 0xea, 0xbc, 0xd5, 0x23, 0x1e, 0xb7, 0x25, 0x95, 0x04, 0x53, 0x73, 0x99, 0xbd, 0x29, 0x16, 0x4b, 0x72, 0x6d, 0x33, 0xa4, 0x6d, 0xa7, 0x01, 0x36, 0x0a, 0x41, 0x68, 0xa0, 0x91, 0xcc, 0xab, 0x72, 0xd4, 0x4a, 0x62, 0xfe, 0xd2, 0x46, 0xc0, 0xff, 0xea, 0x5b, 0x13, 0x48, 0xab, 0x54, 0x70 } + +} +, +} +}, +{ + "Example 7: A 1030-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x31, 0x11, 0x79, 0xf0, 0xbc, 0xfc, 0x9b, 0x9d, 0x3c, 0xa3, 0x15, 0xd0, 0x0e, 0xf3, 0x0d, 0x7b, 0xdd, 0x3a, 0x2c, 0xfa, 0xe9, 0x91, 0x1b, 0xfe, 0xdc, 0xb9, 0x48, 0xb3, 0xa4, 0x78, 0x2d, 0x07, 0x32, 0xb6, 0xab, 0x44, 0xaa, 0x4b, 0xf0, 0x37, 0x41, 0xa6, 0x44, 0xdc, 0x01, 0xbe, 0xc3, 0xe6, 0x9b, 0x01, 0xa0, 0x33, 0xe6, 0x75, 0xd8, 0xac, 0xd7, 0xc4, 0x92, 0x5c, 0x6b, 0x1a, 0xec, 0x31, 0x19, 0x05, 0x1d, 0xfd, 0x89, 0x76, 0x2d, 0x21, 0x5d, 0x45, 0x47, 0x5f, 0xfc, 0xb5, 0x9f, 0x90, 0x81, 0x48, 0x62, 0x3f, 0x37, 0x17, 0x71, 0x56, 0xf6, 0xae, 0x86, 0xdd, 0x7a, 0x7c, 0x5f, 0x43, 0xdc, 0x1e, 0x1f, 0x90, 0x82, 0x54, 0x05, 0x8a, 0x28, 0x4a, 0x5f, 0x06, 0xc0, 0x02, 0x17, 0x93, 0xa8, 0x7f, 0x1a, 0xc5, 0xfe, 0xff, 0x7d, 0xca, 0xee, 0x69, 0xc5, 0xe5, 0x1a, 0x37, 0x89, 0xe3, 0x73 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 129, + { 0x07, 0x0c, 0xfc, 0xff, 0x2f, 0xeb, 0x82, 0x76, 0xe2, 0x74, 0x32, 0xc4, 0x5d, 0xfe, 0xe4, 0x8f, 0x49, 0xb7, 0x91, 0x7d, 0x65, 0x30, 0xe1, 0xf0, 0xca, 0x34, 0x60, 0xf3, 0x2e, 0x02, 0x76, 0x17, 0x44, 0x87, 0xc5, 0x6e, 0x22, 0xa4, 0x5d, 0x25, 0x00, 0xd7, 0x77, 0x54, 0x95, 0x21, 0x9d, 0x7d, 0x16, 0x5a, 0x9c, 0xf3, 0xbd, 0x92, 0xc3, 0x2a, 0xf9, 0xa9, 0x8d, 0x8d, 0xc9, 0xcc, 0x29, 0x68, 0x00, 0xad, 0xc9, 0x4a, 0x0a, 0x54, 0xfb, 0x40, 0xf3, 0x42, 0x91, 0xbf, 0x84, 0xee, 0x8e, 0xa1, 0x2b, 0x6f, 0x10, 0x93, 0x59, 0xc6, 0xd3, 0x54, 0x2a, 0x50, 0xf9, 0xc7, 0x67, 0xf5, 0xcf, 0xff, 0x05, 0xa6, 0x81, 0xc2, 0xe6, 0x56, 0xfb, 0x77, 0xca, 0xaa, 0xdb, 0x4b, 0xe9, 0x46, 0x8d, 0x8a, 0xbc, 0xd4, 0xdf, 0x98, 0xf5, 0x8e, 0x86, 0xd2, 0x05, 0x3f, 0xa1, 0x34, 0x9f, 0x74, 0x8e, 0x21, 0xb1 } +, + /* Prime p */ + 65, + { 0x07, 0x49, 0x26, 0x2c, 0x11, 0x1c, 0xd4, 0x70, 0xec, 0x25, 0x66, 0xe6, 0xb3, 0x73, 0x2f, 0xc0, 0x93, 0x29, 0x46, 0x9a, 0xa1, 0x90, 0x71, 0xd3, 0xb9, 0xc0, 0x19, 0x06, 0x51, 0x4c, 0x6f, 0x1d, 0x26, 0xba, 0xa1, 0x4b, 0xea, 0xb0, 0x97, 0x1c, 0x8b, 0x7e, 0x61, 0x1a, 0x4f, 0x79, 0x00, 0x9d, 0x6f, 0xea, 0x77, 0x69, 0x28, 0xca, 0x25, 0x28, 0x5b, 0x0d, 0xe3, 0x64, 0x3d, 0x1a, 0x3f, 0x8c, 0x71 } +, + /* Prime q */ + 65, + { 0x06, 0xbc, 0x1e, 0x50, 0xe9, 0x6c, 0x02, 0xbf, 0x63, 0x6e, 0x9e, 0xea, 0x8b, 0x89, 0x9b, 0xbe, 0xbf, 0x76, 0x51, 0xde, 0x77, 0xdd, 0x47, 0x4c, 0x3e, 0x9b, 0xc2, 0x3b, 0xad, 0x81, 0x82, 0xb6, 0x19, 0x04, 0xc7, 0xd9, 0x7d, 0xfb, 0xeb, 0xfb, 0x1e, 0x00, 0x10, 0x88, 0x78, 0xb6, 0xe6, 0x7e, 0x41, 0x53, 0x91, 0xd6, 0x79, 0x42, 0xc2, 0xb2, 0xbf, 0x9b, 0x44, 0x35, 0xf8, 0x8b, 0x0c, 0xb0, 0x23 } +, + /* p's CRT exponent dP */ + 65, + { 0x03, 0xbc, 0x7e, 0xa7, 0xf0, 0xaa, 0xb1, 0x43, 0xab, 0xc6, 0xce, 0x8b, 0x97, 0x11, 0x86, 0x36, 0xa3, 0x01, 0x72, 0xe4, 0xcf, 0xe0, 0x2c, 0x8f, 0xa0, 0xdd, 0xa3, 0xb7, 0xba, 0xaf, 0x90, 0xf8, 0x09, 0x29, 0x82, 0x98, 0x55, 0x25, 0xf4, 0x88, 0xbd, 0xfc, 0xb4, 0xbd, 0x72, 0x6e, 0x22, 0x63, 0x9a, 0xc6, 0x4a, 0x30, 0x92, 0xab, 0x7f, 0xfc, 0xbf, 0x1d, 0x53, 0x34, 0xcf, 0xa5, 0x0b, 0x5b, 0xf1 } +, + /* q's CRT exponent dQ */ + 65, + { 0x02, 0x62, 0xa6, 0xaa, 0x29, 0xc2, 0xa3, 0xc6, 0x7d, 0xc5, 0x34, 0x6c, 0x06, 0x38, 0x1a, 0xfd, 0x98, 0x7a, 0xa3, 0xcc, 0x93, 0xcf, 0xbf, 0xec, 0xf5, 0x4f, 0xdd, 0x9f, 0x9d, 0x78, 0x7d, 0x7f, 0x59, 0xa5, 0x23, 0xd3, 0x98, 0x97, 0x9d, 0xa1, 0x37, 0xa2, 0xf6, 0x38, 0x1f, 0xe9, 0x48, 0x01, 0xf7, 0xc9, 0x4d, 0xa2, 0x15, 0x18, 0xdc, 0x34, 0xcb, 0x40, 0x87, 0x0c, 0x46, 0x97, 0x99, 0x4a, 0xd9 } +, + /* CRT coefficient qInv */ + 64, + { 0x64, 0x9d, 0x4c, 0x17, 0xb6, 0xee, 0x17, 0x21, 0xe7, 0x72, 0xd0, 0x38, 0x9a, 0x55, 0x9c, 0x3d, 0x3c, 0xdf, 0x95, 0x50, 0xd4, 0x57, 0xc4, 0x6b, 0x03, 0x7b, 0x74, 0x64, 0x1b, 0x1d, 0x52, 0x16, 0x6a, 0xf8, 0xa2, 0x13, 0xc8, 0x39, 0x62, 0x06, 0xcd, 0xfb, 0xa4, 0x42, 0x2f, 0x18, 0xd6, 0xf6, 0x1d, 0xbc, 0xb5, 0xd2, 0x14, 0xc9, 0x71, 0xbf, 0x48, 0x2a, 0xeb, 0x97, 0x6a, 0x73, 0x70, 0xc2 } + +} +, +{{ + "RSAES-OAEP Encryption Example 7.1", + /* Message to be encrypted */ + 4, + { 0x47, 0xaa, 0xe9, 0x09 } +, + /* Seed */ + 20, + { 0x43, 0xdd, 0x09, 0xa0, 0x7f, 0xf4, 0xca, 0xc7, 0x1c, 0xaa, 0x46, 0x32, 0xee, 0x5e, 0x1c, 0x1d, 0xae, 0xe4, 0xcd, 0x8f } +, + /* Encryption */ + 129, + { 0x16, 0x88, 0xe4, 0xce, 0x77, 0x94, 0xbb, 0xa6, 0xcb, 0x70, 0x14, 0x16, 0x9e, 0xcd, 0x55, 0x9c, 0xed, 0xe2, 0xa3, 0x0b, 0x56, 0xa5, 0x2b, 0x68, 0xd9, 0xfe, 0x18, 0xcf, 0x19, 0x73, 0xef, 0x97, 0xb2, 0xa0, 0x31, 0x53, 0x95, 0x1c, 0x75, 0x5f, 0x62, 0x94, 0xaa, 0x49, 0xad, 0xbd, 0xb5, 0x58, 0x45, 0xab, 0x68, 0x75, 0xfb, 0x39, 0x86, 0xc9, 0x3e, 0xcf, 0x92, 0x79, 0x62, 0x84, 0x0d, 0x28, 0x2f, 0x9e, 0x54, 0xce, 0x8b, 0x69, 0x0f, 0x7c, 0x0c, 0xb8, 0xbb, 0xd7, 0x34, 0x40, 0xd9, 0x57, 0x1d, 0x1b, 0x16, 0xcd, 0x92, 0x60, 0xf9, 0xea, 0xb4, 0x78, 0x3c, 0xc4, 0x82, 0xe5, 0x22, 0x3d, 0xc6, 0x09, 0x73, 0x87, 0x17, 0x83, 0xec, 0x27, 0xb0, 0xae, 0x0f, 0xd4, 0x77, 0x32, 0xcb, 0xc2, 0x86, 0xa1, 0x73, 0xfc, 0x92, 0xb0, 0x0f, 0xb4, 0xba, 0x68, 0x24, 0x64, 0x7c, 0xd9, 0x3c, 0x85, 0xc1 } + +} +, +{ + "RSAES-OAEP Encryption Example 7.2", + /* Message to be encrypted */ + 31, + { 0x1d, 0x9b, 0x2e, 0x22, 0x23, 0xd9, 0xbc, 0x13, 0xbf, 0xb9, 0xf1, 0x62, 0xce, 0x73, 0x5d, 0xb4, 0x8b, 0xa7, 0xc6, 0x8f, 0x68, 0x22, 0xa0, 0xa1, 0xa7, 0xb6, 0xae, 0x16, 0x58, 0x34, 0xe7 } +, + /* Seed */ + 20, + { 0x3a, 0x9c, 0x3c, 0xec, 0x7b, 0x84, 0xf9, 0xbd, 0x3a, 0xde, 0xcb, 0xc6, 0x73, 0xec, 0x99, 0xd5, 0x4b, 0x22, 0xbc, 0x9b } +, + /* Encryption */ + 129, + { 0x10, 0x52, 0xed, 0x39, 0x7b, 0x2e, 0x01, 0xe1, 0xd0, 0xee, 0x1c, 0x50, 0xbf, 0x24, 0x36, 0x3f, 0x95, 0xe5, 0x04, 0xf4, 0xa0, 0x34, 0x34, 0xa0, 0x8f, 0xd8, 0x22, 0x57, 0x4e, 0xd6, 0xb9, 0x73, 0x6e, 0xdb, 0xb5, 0xf3, 0x90, 0xdb, 0x10, 0x32, 0x14, 0x79, 0xa8, 0xa1, 0x39, 0x35, 0x0e, 0x2b, 0xd4, 0x97, 0x7c, 0x37, 0x78, 0xef, 0x33, 0x1f, 0x3e, 0x78, 0xae, 0x11, 0x8b, 0x26, 0x84, 0x51, 0xf2, 0x0a, 0x2f, 0x01, 0xd4, 0x71, 0xf5, 0xd5, 0x3c, 0x56, 0x69, 0x37, 0x17, 0x1b, 0x2d, 0xbc, 0x2d, 0x4b, 0xde, 0x45, 0x9a, 0x57, 0x99, 0xf0, 0x37, 0x2d, 0x65, 0x74, 0x23, 0x9b, 0x23, 0x23, 0xd2, 0x45, 0xd0, 0xbb, 0x81, 0xc2, 0x86, 0xb6, 0x3c, 0x89, 0xa3, 0x61, 0x01, 0x73, 0x37, 0xe4, 0x90, 0x2f, 0x88, 0xa4, 0x67, 0xf4, 0xc7, 0xf2, 0x44, 0xbf, 0xd5, 0xab, 0x46, 0x43, 0x7f, 0xf3, 0xb6 } + +} +, +{ + "RSAES-OAEP Encryption Example 7.3", + /* Message to be encrypted */ + 3, + { 0xd9, 0x76, 0xfc } +, + /* Seed */ + 20, + { 0x76, 0xa7, 0x5e, 0x5b, 0x61, 0x57, 0xa5, 0x56, 0xcf, 0x88, 0x84, 0xbb, 0x2e, 0x45, 0xc2, 0x93, 0xdd, 0x54, 0x5c, 0xf5 } +, + /* Encryption */ + 129, + { 0x21, 0x55, 0xcd, 0x84, 0x3f, 0xf2, 0x4a, 0x4e, 0xe8, 0xba, 0xdb, 0x76, 0x94, 0x26, 0x00, 0x28, 0xa4, 0x90, 0x81, 0x3b, 0xa8, 0xb3, 0x69, 0xa4, 0xcb, 0xf1, 0x06, 0xec, 0x14, 0x8e, 0x52, 0x98, 0x70, 0x7f, 0x59, 0x65, 0xbe, 0x7d, 0x10, 0x1c, 0x10, 0x49, 0xea, 0x85, 0x84, 0xc2, 0x4c, 0xd6, 0x34, 0x55, 0xad, 0x9c, 0x10, 0x4d, 0x68, 0x62, 0x82, 0xd3, 0xfb, 0x80, 0x3a, 0x4c, 0x11, 0xc1, 0xc2, 0xe9, 0xb9, 0x1c, 0x71, 0x78, 0x80, 0x1d, 0x1b, 0x66, 0x40, 0xf0, 0x03, 0xf5, 0x72, 0x8d, 0xf0, 0x07, 0xb8, 0xa4, 0xcc, 0xc9, 0x2b, 0xce, 0x05, 0xe4, 0x1a, 0x27, 0x27, 0x8d, 0x7c, 0x85, 0x01, 0x8c, 0x52, 0x41, 0x43, 0x13, 0xa5, 0x07, 0x77, 0x89, 0x00, 0x1d, 0x4f, 0x01, 0x91, 0x0b, 0x72, 0xaa, 0xd0, 0x5d, 0x22, 0x0a, 0xa1, 0x4a, 0x58, 0x73, 0x3a, 0x74, 0x89, 0xbc, 0x54, 0x55, 0x6b } + +} +, +{ + "RSAES-OAEP Encryption Example 7.4", + /* Message to be encrypted */ + 62, + { 0xd4, 0x73, 0x86, 0x23, 0xdf, 0x22, 0x3a, 0xa4, 0x38, 0x43, 0xdf, 0x84, 0x67, 0x53, 0x4c, 0x41, 0xd0, 0x13, 0xe0, 0xc8, 0x03, 0xc6, 0x24, 0xe2, 0x63, 0x66, 0x6b, 0x23, 0x9b, 0xde, 0x40, 0xa5, 0xf2, 0x9a, 0xeb, 0x8d, 0xe7, 0x9e, 0x3d, 0xaa, 0x61, 0xdd, 0x03, 0x70, 0xf4, 0x9b, 0xd4, 0xb0, 0x13, 0x83, 0x4b, 0x98, 0x21, 0x2a, 0xef, 0x6b, 0x1c, 0x5e, 0xe3, 0x73, 0xb3, 0xcb } +, + /* Seed */ + 20, + { 0x78, 0x66, 0x31, 0x4a, 0x6a, 0xd6, 0xf2, 0xb2, 0x50, 0xa3, 0x59, 0x41, 0xdb, 0x28, 0xf5, 0x86, 0x4b, 0x58, 0x58, 0x59 } +, + /* Encryption */ + 129, + { 0x0a, 0xb1, 0x4c, 0x37, 0x3a, 0xeb, 0x7d, 0x43, 0x28, 0xd0, 0xaa, 0xad, 0x8c, 0x09, 0x4d, 0x88, 0xb9, 0xeb, 0x09, 0x8b, 0x95, 0xf2, 0x10, 0x54, 0xa2, 0x90, 0x82, 0x52, 0x2b, 0xe7, 0xc2, 0x7a, 0x31, 0x28, 0x78, 0xb6, 0x37, 0x91, 0x7e, 0x3d, 0x81, 0x9e, 0x6c, 0x3c, 0x56, 0x8d, 0xb5, 0xd8, 0x43, 0x80, 0x2b, 0x06, 0xd5, 0x1d, 0x9e, 0x98, 0xa2, 0xbe, 0x0b, 0xf4, 0x0c, 0x03, 0x14, 0x23, 0xb0, 0x0e, 0xdf, 0xbf, 0xf8, 0x32, 0x0e, 0xfb, 0x91, 0x71, 0xbd, 0x20, 0x44, 0x65, 0x3a, 0x4c, 0xb9, 0xc5, 0x12, 0x2f, 0x6c, 0x65, 0xe8, 0x3c, 0xda, 0x2e, 0xc3, 0xc1, 0x26, 0x02, 0x7a, 0x9c, 0x1a, 0x56, 0xba, 0x87, 0x4d, 0x0f, 0xea, 0x23, 0xf3, 0x80, 0xb8, 0x2c, 0xf2, 0x40, 0xb8, 0xcf, 0x54, 0x00, 0x04, 0x75, 0x8c, 0x4c, 0x77, 0xd9, 0x34, 0x15, 0x7a, 0x74, 0xf3, 0xfc, 0x12, 0xbf, 0xac } + +} +, +{ + "RSAES-OAEP Encryption Example 7.5", + /* Message to be encrypted */ + 16, + { 0xbb, 0x47, 0x23, 0x1c, 0xa5, 0xea, 0x1d, 0x3a, 0xd4, 0x6c, 0x99, 0x34, 0x5d, 0x9a, 0x8a, 0x61 } +, + /* Seed */ + 20, + { 0xb2, 0x16, 0x6e, 0xd4, 0x72, 0xd5, 0x8d, 0xb1, 0x0c, 0xab, 0x2c, 0x6b, 0x00, 0x0c, 0xcc, 0xf1, 0x0a, 0x7d, 0xc5, 0x09 } +, + /* Encryption */ + 129, + { 0x02, 0x83, 0x87, 0xa3, 0x18, 0x27, 0x74, 0x34, 0x79, 0x8b, 0x4d, 0x97, 0xf4, 0x60, 0x06, 0x8d, 0xf5, 0x29, 0x8f, 0xab, 0xa5, 0x04, 0x1b, 0xa1, 0x17, 0x61, 0xa1, 0xcb, 0x73, 0x16, 0xb2, 0x41, 0x84, 0x11, 0x4e, 0xc5, 0x00, 0x25, 0x7e, 0x25, 0x89, 0xed, 0x3b, 0x60, 0x7a, 0x1e, 0xbb, 0xe9, 0x7a, 0x6c, 0xc2, 0xe0, 0x2b, 0xf1, 0xb6, 0x81, 0xf4, 0x23, 0x12, 0xa3, 0x3b, 0x7a, 0x77, 0xd8, 0xe7, 0x85, 0x5c, 0x4a, 0x6d, 0xe0, 0x3e, 0x3c, 0x04, 0x64, 0x3f, 0x78, 0x6b, 0x91, 0xa2, 0x64, 0xa0, 0xd6, 0x80, 0x5e, 0x2c, 0xea, 0x91, 0xe6, 0x81, 0x77, 0xeb, 0x7a, 0x64, 0xd9, 0x25, 0x5e, 0x4f, 0x27, 0xe7, 0x13, 0xb7, 0xcc, 0xec, 0x00, 0xdc, 0x20, 0x0e, 0xbd, 0x21, 0xc2, 0xea, 0x2b, 0xb8, 0x90, 0xfe, 0xae, 0x49, 0x42, 0xdf, 0x94, 0x1d, 0xc3, 0xf9, 0x78, 0x90, 0xed, 0x34, 0x74, 0x78 } + +} +, +{ + "RSAES-OAEP Encryption Example 7.6", + /* Message to be encrypted */ + 18, + { 0x21, 0x84, 0x82, 0x70, 0x95, 0xd3, 0x5c, 0x3f, 0x86, 0xf6, 0x00, 0xe8, 0xe5, 0x97, 0x54, 0x01, 0x32, 0x96 } +, + /* Seed */ + 20, + { 0x52, 0x67, 0x3b, 0xde, 0x2c, 0xa1, 0x66, 0xc2, 0xaa, 0x46, 0x13, 0x1a, 0xc1, 0xdc, 0x80, 0x8d, 0x67, 0xd7, 0xd3, 0xb1 } +, + /* Encryption */ + 129, + { 0x14, 0xc6, 0x78, 0xa9, 0x4a, 0xd6, 0x05, 0x25, 0xef, 0x39, 0xe9, 0x59, 0xb2, 0xf3, 0xba, 0x5c, 0x09, 0x7a, 0x94, 0xff, 0x91, 0x2b, 0x67, 0xdb, 0xac, 0xe8, 0x05, 0x35, 0xc1, 0x87, 0xab, 0xd4, 0x7d, 0x07, 0x54, 0x20, 0xb1, 0x87, 0x21, 0x52, 0xbb, 0xa0, 0x8f, 0x7f, 0xc3, 0x1f, 0x31, 0x3b, 0xbf, 0x92, 0x73, 0xc9, 0x12, 0xfc, 0x4c, 0x01, 0x49, 0xa9, 0xb0, 0xcf, 0xb7, 0x98, 0x07, 0xe3, 0x46, 0xeb, 0x33, 0x20, 0x69, 0x61, 0x1b, 0xec, 0x0f, 0xf9, 0xbc, 0xd1, 0x68, 0xf1, 0xf7, 0xc3, 0x3e, 0x77, 0x31, 0x3c, 0xea, 0x45, 0x4b, 0x94, 0xe2, 0x54, 0x9e, 0xec, 0xf0, 0x02, 0xe2, 0xac, 0xf7, 0xf6, 0xf2, 0xd2, 0x84, 0x5d, 0x4f, 0xe0, 0xaa, 0xb2, 0xe5, 0xa9, 0x2d, 0xdf, 0x68, 0xc4, 0x80, 0xae, 0x11, 0x24, 0x79, 0x35, 0xd1, 0xf6, 0x25, 0x74, 0x84, 0x22, 0x16, 0xae, 0x67, 0x41, 0x15 } + +} +, +} +}, +{ + "Example 8: A 1031-bit RSA Key Pair", +{ + /* RSA modulus n */ + 129, + { 0x5b, 0xdf, 0x0e, 0x30, 0xd3, 0x21, 0xdd, 0xa5, 0x14, 0x7f, 0x88, 0x24, 0x08, 0xfa, 0x69, 0x19, 0x54, 0x80, 0xdf, 0x8f, 0x80, 0xd3, 0xf6, 0xe8, 0xbf, 0x58, 0x18, 0x50, 0x4f, 0x36, 0x42, 0x7c, 0xa9, 0xb1, 0xf5, 0x54, 0x0b, 0x9c, 0x65, 0xa8, 0xf6, 0x97, 0x4c, 0xf8, 0x44, 0x7a, 0x24, 0x4d, 0x92, 0x80, 0x20, 0x1b, 0xb4, 0x9f, 0xcb, 0xbe, 0x63, 0x78, 0xd1, 0x94, 0x4c, 0xd2, 0x27, 0xe2, 0x30, 0xf9, 0x6e, 0x3d, 0x10, 0xf8, 0x19, 0xdc, 0xef, 0x27, 0x6c, 0x64, 0xa0, 0x0b, 0x2a, 0x4b, 0x67, 0x01, 0xe7, 0xd0, 0x1d, 0xe5, 0xfa, 0xbd, 0xe3, 0xb1, 0xe9, 0xa0, 0xdf, 0x82, 0xf4, 0x63, 0x13, 0x59, 0xcd, 0x22, 0x66, 0x96, 0x47, 0xfb, 0xb1, 0x71, 0x72, 0x46, 0x13, 0x4e, 0xd7, 0xb4, 0x97, 0xcf, 0xff, 0xbd, 0xc4, 0x2b, 0x59, 0xc7, 0x3a, 0x96, 0xed, 0x90, 0x16, 0x62, 0x12, 0xdf, 0xf7 } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 129, + { 0x0f, 0x7d, 0x1e, 0x9e, 0x5a, 0xaa, 0x25, 0xfd, 0x13, 0xe4, 0xa0, 0x66, 0x3a, 0xe1, 0x44, 0xe0, 0xd1, 0x5f, 0x5c, 0xd1, 0x8b, 0xcd, 0xb0, 0x9d, 0xf2, 0xcc, 0x7e, 0x64, 0xe3, 0xc5, 0xe9, 0x15, 0xad, 0x62, 0x64, 0x53, 0x04, 0x16, 0x1d, 0x09, 0x8c, 0x71, 0x5b, 0xb7, 0xab, 0x8b, 0xd0, 0x1d, 0x07, 0xea, 0xf3, 0xfe, 0xd7, 0xc7, 0xed, 0x08, 0xaf, 0x2a, 0x8a, 0x62, 0xef, 0x44, 0xab, 0x16, 0xb3, 0x20, 0xe1, 0x4a, 0xf7, 0x2a, 0x48, 0xf9, 0x6a, 0xfe, 0x26, 0x2a, 0x0a, 0xe4, 0xcf, 0x65, 0xe6, 0x35, 0xe9, 0x10, 0x79, 0x0c, 0xd4, 0xee, 0x5c, 0xea, 0x76, 0x8a, 0x4b, 0x26, 0x39, 0xf7, 0xe6, 0xf6, 0x77, 0xb3, 0xf0, 0xbb, 0x6b, 0xe3, 0x2b, 0x75, 0x74, 0x7d, 0x89, 0x09, 0x03, 0x6f, 0x02, 0x64, 0xf5, 0x8d, 0x40, 0x1c, 0xdb, 0xa1, 0x31, 0x71, 0x61, 0x57, 0xa7, 0x5e, 0xcf, 0x63, 0x31 } +, + /* Prime p */ + 65, + { 0x0a, 0x02, 0xef, 0x84, 0x48, 0xd9, 0xfa, 0xd8, 0xbb, 0xd0, 0xd0, 0x04, 0xc8, 0xc2, 0xaa, 0x97, 0x51, 0xef, 0x97, 0x21, 0xc1, 0xb0, 0xd0, 0x32, 0x36, 0xa5, 0x4b, 0x0d, 0xf9, 0x47, 0xcb, 0xae, 0xd5, 0xa2, 0x55, 0xee, 0x9e, 0x8e, 0x20, 0xd4, 0x91, 0xea, 0x17, 0x23, 0xfe, 0x09, 0x47, 0x04, 0xa9, 0x76, 0x2e, 0x88, 0xaf, 0xd1, 0x6e, 0xbb, 0x59, 0x94, 0x41, 0x2c, 0xa9, 0x66, 0xdc, 0x4f, 0x9f } +, + /* Prime q */ + 65, + { 0x09, 0x2d, 0x36, 0x2e, 0x7e, 0xd3, 0xa0, 0xbf, 0xd9, 0xe9, 0xfd, 0x0e, 0x6c, 0x03, 0x01, 0xb6, 0xdf, 0x29, 0x15, 0x9c, 0xf5, 0x0c, 0xc8, 0x3b, 0x9b, 0x0c, 0xf4, 0xd6, 0xee, 0xa7, 0x1a, 0x61, 0xe0, 0x02, 0xb4, 0x6e, 0x0a, 0xe9, 0xf2, 0xde, 0x62, 0xd2, 0x5b, 0x5d, 0x74, 0x52, 0xd4, 0x98, 0xb8, 0x1c, 0x9a, 0xc6, 0xfc, 0x58, 0x59, 0x3d, 0x4c, 0x3f, 0xb4, 0xf5, 0xd7, 0x2d, 0xfb, 0xb0, 0xa9 } +, + /* p's CRT exponent dP */ + 65, + { 0x07, 0xc7, 0x14, 0x10, 0xaf, 0x10, 0x39, 0x62, 0xdb, 0x36, 0x74, 0x04, 0xe3, 0x7a, 0xe8, 0x50, 0xba, 0xa4, 0xe9, 0xc2, 0x9d, 0xd9, 0x21, 0x45, 0x81, 0x52, 0x94, 0xa6, 0x7c, 0x7d, 0x1c, 0x6d, 0xed, 0x26, 0x3a, 0xa0, 0x30, 0xa9, 0xb6, 0x33, 0xae, 0x50, 0x30, 0x3e, 0x14, 0x03, 0x5d, 0x1a, 0xf0, 0x14, 0x12, 0x3e, 0xba, 0x68, 0x78, 0x20, 0x30, 0x8d, 0x8e, 0xbc, 0x85, 0xb6, 0x95, 0x7d, 0x7d } +, + /* q's CRT exponent dQ */ + 64, + { 0xae, 0x2c, 0x75, 0x38, 0x0c, 0x02, 0xc0, 0x16, 0xad, 0x05, 0x89, 0x1b, 0x33, 0x01, 0xde, 0x88, 0x1f, 0x28, 0xae, 0x11, 0x71, 0x18, 0x2b, 0x6b, 0x2c, 0x83, 0xbe, 0xa7, 0xc5, 0x15, 0xec, 0xa9, 0xca, 0x29, 0x8c, 0x7b, 0x1c, 0xab, 0x58, 0x17, 0xa5, 0x97, 0x06, 0x8f, 0xc8, 0x50, 0x60, 0xde, 0x4d, 0xa8, 0xa0, 0x16, 0x37, 0x8a, 0xae, 0x43, 0xc7, 0xf9, 0x67, 0xbc, 0xc3, 0x79, 0x04, 0xb9 } +, + /* CRT coefficient qInv */ + 65, + { 0x05, 0x98, 0xd1, 0x05, 0x9e, 0x3a, 0xda, 0x4f, 0x63, 0x20, 0x75, 0x2c, 0x09, 0xd8, 0x05, 0xff, 0x7d, 0x1f, 0x1a, 0xe0, 0xd0, 0x17, 0xae, 0xee, 0xe9, 0xce, 0xfa, 0x0d, 0x7d, 0xd7, 0xff, 0x77, 0x5e, 0x44, 0xb5, 0x78, 0x32, 0x2f, 0x64, 0x05, 0xd6, 0x21, 0x1d, 0xa1, 0x95, 0x19, 0x66, 0x6a, 0xa8, 0x7f, 0xdc, 0x4c, 0xd8, 0xc8, 0x8f, 0x6b, 0x6e, 0x3d, 0x67, 0xe9, 0x61, 0xdc, 0xbb, 0xa3, 0xd0 } + +} +, +{{ + "RSAES-OAEP Encryption Example 8.1", + /* Message to be encrypted */ + 54, + { 0x05, 0x0b, 0x75, 0x5e, 0x5e, 0x68, 0x80, 0xf7, 0xb9, 0xe9, 0xd6, 0x92, 0xa7, 0x4c, 0x37, 0xaa, 0xe4, 0x49, 0xb3, 0x1b, 0xfe, 0xa6, 0xde, 0xff, 0x83, 0x74, 0x7a, 0x89, 0x7f, 0x6c, 0x2c, 0x82, 0x5b, 0xb1, 0xad, 0xbf, 0x85, 0x0a, 0x3c, 0x96, 0x99, 0x4b, 0x5d, 0xe5, 0xb3, 0x3c, 0xbc, 0x7d, 0x4a, 0x17, 0x91, 0x3a, 0x79, 0x67 } +, + /* Seed */ + 20, + { 0x77, 0x06, 0xff, 0xca, 0x1e, 0xcf, 0xb1, 0xeb, 0xee, 0x2a, 0x55, 0xe5, 0xc6, 0xe2, 0x4c, 0xd2, 0x79, 0x7a, 0x41, 0x25 } +, + /* Encryption */ + 129, + { 0x09, 0xb3, 0x68, 0x3d, 0x8a, 0x2e, 0xb0, 0xfb, 0x29, 0x5b, 0x62, 0xed, 0x1f, 0xb9, 0x29, 0x0b, 0x71, 0x44, 0x57, 0xb7, 0x82, 0x53, 0x19, 0xf4, 0x64, 0x78, 0x72, 0xaf, 0x88, 0x9b, 0x30, 0x40, 0x94, 0x72, 0x02, 0x0a, 0xd1, 0x29, 0x12, 0xbf, 0x19, 0xb1, 0x1d, 0x48, 0x19, 0xf4, 0x96, 0x14, 0x82, 0x4f, 0xfd, 0x84, 0xd0, 0x9c, 0x0a, 0x17, 0xe7, 0xd1, 0x73, 0x09, 0xd1, 0x29, 0x19, 0x79, 0x04, 0x10, 0xaa, 0x29, 0x95, 0x69, 0x9f, 0x6a, 0x86, 0xdb, 0xe3, 0x24, 0x2b, 0x5a, 0xcc, 0x23, 0xaf, 0x45, 0x69, 0x10, 0x80, 0xd6, 0xb1, 0xae, 0x81, 0x0f, 0xb3, 0xe3, 0x05, 0x70, 0x87, 0xf0, 0x97, 0x00, 0x92, 0xce, 0x00, 0xbe, 0x95, 0x62, 0xff, 0x40, 0x53, 0xb6, 0x26, 0x2c, 0xe0, 0xca, 0xa9, 0x3e, 0x13, 0x72, 0x3d, 0x2e, 0x3a, 0x5b, 0xa0, 0x75, 0xd4, 0x5f, 0x0d, 0x61, 0xb5, 0x4b, 0x61 } + +} +, +{ + "RSAES-OAEP Encryption Example 8.2", + /* Message to be encrypted */ + 63, + { 0x4e, 0xb6, 0x8d, 0xcd, 0x93, 0xca, 0x9b, 0x19, 0xdf, 0x11, 0x1b, 0xd4, 0x36, 0x08, 0xf5, 0x57, 0x02, 0x6f, 0xe4, 0xaa, 0x1d, 0x5c, 0xfa, 0xc2, 0x27, 0xa3, 0xeb, 0x5a, 0xb9, 0x54, 0x8c, 0x18, 0xa0, 0x6d, 0xde, 0xd2, 0x3f, 0x81, 0x82, 0x59, 0x86, 0xb2, 0xfc, 0xd7, 0x11, 0x09, 0xec, 0xef, 0x7e, 0xff, 0x88, 0x87, 0x3f, 0x07, 0x5c, 0x2a, 0xa0, 0xc4, 0x69, 0xf6, 0x9c, 0x92, 0xbc } +, + /* Seed */ + 20, + { 0xa3, 0x71, 0x7d, 0xa1, 0x43, 0xb4, 0xdc, 0xff, 0xbc, 0x74, 0x26, 0x65, 0xa8, 0xfa, 0x95, 0x05, 0x85, 0x54, 0x83, 0x43 } +, + /* Encryption */ + 129, + { 0x2e, 0xcf, 0x15, 0xc9, 0x7c, 0x5a, 0x15, 0xb1, 0x47, 0x6a, 0xe9, 0x86, 0xb3, 0x71, 0xb5, 0x7a, 0x24, 0x28, 0x4f, 0x4a, 0x16, 0x2a, 0x8d, 0x0c, 0x81, 0x82, 0xe7, 0x90, 0x5e, 0x79, 0x22, 0x56, 0xf1, 0x81, 0x2b, 0xa5, 0xf8, 0x3f, 0x1f, 0x7a, 0x13, 0x0e, 0x42, 0xdc, 0xc0, 0x22, 0x32, 0x84, 0x4e, 0xdc, 0x14, 0xa3, 0x1a, 0x68, 0xee, 0x97, 0xae, 0x56, 0x4a, 0x38, 0x3a, 0x34, 0x11, 0x65, 0x64, 0x24, 0xc5, 0xf6, 0x2d, 0xdb, 0x64, 0x60, 0x93, 0xc3, 0x67, 0xbe, 0x1f, 0xcd, 0xa4, 0x26, 0xcf, 0x00, 0xa0, 0x6d, 0x8a, 0xcb, 0x7e, 0x57, 0x77, 0x6f, 0xbb, 0xd8, 0x55, 0xac, 0x3d, 0xf5, 0x06, 0xfc, 0x16, 0xb1, 0xd7, 0xc3, 0xf2, 0x11, 0x0f, 0x3d, 0x80, 0x68, 0xe9, 0x1e, 0x18, 0x63, 0x63, 0x83, 0x1c, 0x84, 0x09, 0x68, 0x0d, 0x8d, 0xa9, 0xec, 0xd8, 0xcf, 0x1f, 0xa2, 0x0e, 0xe3, 0x9d } + +} +, +{ + "RSAES-OAEP Encryption Example 8.3", + /* Message to be encrypted */ + 12, + { 0x86, 0x04, 0xac, 0x56, 0x32, 0x8c, 0x1a, 0xb5, 0xad, 0x91, 0x78, 0x61 } +, + /* Seed */ + 20, + { 0xee, 0x06, 0x20, 0x90, 0x73, 0xcc, 0xa0, 0x26, 0xbb, 0x26, 0x4e, 0x51, 0x85, 0xbf, 0x8c, 0x68, 0xb7, 0x73, 0x9f, 0x86 } +, + /* Encryption */ + 129, + { 0x4b, 0xc8, 0x91, 0x30, 0xa5, 0xb2, 0xda, 0xbb, 0x7c, 0x2f, 0xcf, 0x90, 0xeb, 0x5d, 0x0e, 0xaf, 0x9e, 0x68, 0x1b, 0x71, 0x46, 0xa3, 0x8f, 0x31, 0x73, 0xa3, 0xd9, 0xcf, 0xec, 0x52, 0xea, 0x9e, 0x0a, 0x41, 0x93, 0x2e, 0x64, 0x8a, 0x9d, 0x69, 0x34, 0x4c, 0x50, 0xda, 0x76, 0x3f, 0x51, 0xa0, 0x3c, 0x95, 0x76, 0x21, 0x31, 0xe8, 0x05, 0x22, 0x54, 0xdc, 0xd2, 0x24, 0x8c, 0xba, 0x40, 0xfd, 0x31, 0x66, 0x77, 0x86, 0xce, 0x05, 0xa2, 0xb7, 0xb5, 0x31, 0xac, 0x9d, 0xac, 0x9e, 0xd5, 0x84, 0xa5, 0x9b, 0x67, 0x7c, 0x1a, 0x8a, 0xed, 0x8c, 0x5d, 0x15, 0xd6, 0x8c, 0x05, 0x56, 0x9e, 0x2b, 0xe7, 0x80, 0xbf, 0x7d, 0xb6, 0x38, 0xfd, 0x2b, 0xfd, 0x2a, 0x85, 0xab, 0x27, 0x68, 0x60, 0xf3, 0x77, 0x73, 0x38, 0xfc, 0xa9, 0x89, 0xff, 0xd7, 0x43, 0xd1, 0x3e, 0xe0, 0x8e, 0x0c, 0xa9, 0x89, 0x3f } + +} +, +{ + "RSAES-OAEP Encryption Example 8.4", + /* Message to be encrypted */ + 34, + { 0xfd, 0xda, 0x5f, 0xbf, 0x6e, 0xc3, 0x61, 0xa9, 0xd9, 0xa4, 0xac, 0x68, 0xaf, 0x21, 0x6a, 0x06, 0x86, 0xf4, 0x38, 0xb1, 0xe0, 0xe5, 0xc3, 0x6b, 0x95, 0x5f, 0x74, 0xe1, 0x07, 0xf3, 0x9c, 0x0d, 0xdd, 0xcc } +, + /* Seed */ + 20, + { 0x99, 0x0a, 0xd5, 0x73, 0xdc, 0x48, 0xa9, 0x73, 0x23, 0x5b, 0x6d, 0x82, 0x54, 0x36, 0x18, 0xf2, 0xe9, 0x55, 0x10, 0x5d } +, + /* Encryption */ + 129, + { 0x2e, 0x45, 0x68, 0x47, 0xd8, 0xfc, 0x36, 0xff, 0x01, 0x47, 0xd6, 0x99, 0x35, 0x94, 0xb9, 0x39, 0x72, 0x27, 0xd5, 0x77, 0x75, 0x2c, 0x79, 0xd0, 0xf9, 0x04, 0xfc, 0xb0, 0x39, 0xd4, 0xd8, 0x12, 0xfe, 0xa6, 0x05, 0xa7, 0xb5, 0x74, 0xdd, 0x82, 0xca, 0x78, 0x6f, 0x93, 0x75, 0x23, 0x48, 0x43, 0x8e, 0xe9, 0xf5, 0xb5, 0x45, 0x49, 0x85, 0xd5, 0xf0, 0xe1, 0x69, 0x9e, 0x3e, 0x7a, 0xd1, 0x75, 0xa3, 0x2e, 0x15, 0xf0, 0x3d, 0xeb, 0x04, 0x2a, 0xb9, 0xfe, 0x1d, 0xd9, 0xdb, 0x1b, 0xb8, 0x6f, 0x8c, 0x08, 0x9c, 0xcb, 0x45, 0xe7, 0xef, 0x0c, 0x5e, 0xe7, 0xca, 0x9b, 0x72, 0x90, 0xca, 0x6b, 0x15, 0xbe, 0xd4, 0x70, 0x39, 0x78, 0x8a, 0x8a, 0x93, 0xff, 0x83, 0xe0, 0xe8, 0xd6, 0x24, 0x4c, 0x71, 0x00, 0x63, 0x62, 0xde, 0xef, 0x69, 0xb6, 0xf4, 0x16, 0xfb, 0x3c, 0x68, 0x43, 0x83, 0xfb, 0xd0 } + +} +, +{ + "RSAES-OAEP Encryption Example 8.5", + /* Message to be encrypted */ + 13, + { 0x4a, 0x5f, 0x49, 0x14, 0xbe, 0xe2, 0x5d, 0xe3, 0xc6, 0x93, 0x41, 0xde, 0x07 } +, + /* Seed */ + 20, + { 0xec, 0xc6, 0x3b, 0x28, 0xf0, 0x75, 0x6f, 0x22, 0xf5, 0x2a, 0xc8, 0xe6, 0xec, 0x12, 0x51, 0xa6, 0xec, 0x30, 0x47, 0x18 } +, + /* Encryption */ + 129, + { 0x1f, 0xb9, 0x35, 0x6f, 0xd5, 0xc4, 0xb1, 0x79, 0x6d, 0xb2, 0xeb, 0xf7, 0xd0, 0xd3, 0x93, 0xcc, 0x81, 0x0a, 0xdf, 0x61, 0x45, 0xde, 0xfc, 0x2f, 0xce, 0x71, 0x4f, 0x79, 0xd9, 0x38, 0x00, 0xd5, 0xe2, 0xac, 0x21, 0x1e, 0xa8, 0xbb, 0xec, 0xca, 0x4b, 0x65, 0x4b, 0x94, 0xc3, 0xb1, 0x8b, 0x30, 0xdd, 0x57, 0x6c, 0xe3, 0x4d, 0xc9, 0x54, 0x36, 0xef, 0x57, 0xa0, 0x94, 0x15, 0x64, 0x59, 0x23, 0x35, 0x9a, 0x5d, 0x7b, 0x41, 0x71, 0xef, 0x22, 0xc2, 0x46, 0x70, 0xf1, 0xb2, 0x29, 0xd3, 0x60, 0x3e, 0x91, 0xf7, 0x66, 0x71, 0xb7, 0xdf, 0x97, 0xe7, 0x31, 0x7c, 0x97, 0x73, 0x44, 0x76, 0xd5, 0xf3, 0xd1, 0x7d, 0x21, 0xcf, 0x82, 0xb5, 0xba, 0x9f, 0x83, 0xdf, 0x2e, 0x58, 0x8d, 0x36, 0x98, 0x4f, 0xd1, 0xb5, 0x84, 0x46, 0x8b, 0xd2, 0x3b, 0x2e, 0x87, 0x5f, 0x32, 0xf6, 0x89, 0x53, 0xf7, 0xb2 } + +} +, +{ + "RSAES-OAEP Encryption Example 8.6", + /* Message to be encrypted */ + 25, + { 0x8e, 0x07, 0xd6, 0x6f, 0x7b, 0x88, 0x0a, 0x72, 0x56, 0x3a, 0xbc, 0xd3, 0xf3, 0x50, 0x92, 0xbc, 0x33, 0x40, 0x9f, 0xb7, 0xf8, 0x8f, 0x24, 0x72, 0xbe } +, + /* Seed */ + 20, + { 0x39, 0x25, 0xc7, 0x1b, 0x36, 0x2d, 0x40, 0xa0, 0xa6, 0xde, 0x42, 0x14, 0x55, 0x79, 0xba, 0x1e, 0x7d, 0xd4, 0x59, 0xfc } +, + /* Encryption */ + 129, + { 0x3a, 0xfd, 0x9c, 0x66, 0x00, 0x14, 0x7b, 0x21, 0x79, 0x8d, 0x81, 0x8c, 0x65, 0x5a, 0x0f, 0x4c, 0x92, 0x12, 0xdb, 0x26, 0xd0, 0xb0, 0xdf, 0xdc, 0x2a, 0x75, 0x94, 0xcc, 0xb3, 0xd2, 0x2f, 0x5b, 0xf1, 0xd7, 0xc3, 0xe1, 0x12, 0xcd, 0x73, 0xfc, 0x7d, 0x50, 0x9c, 0x7a, 0x8b, 0xaf, 0xdd, 0x3c, 0x27, 0x4d, 0x13, 0x99, 0x00, 0x9f, 0x96, 0x09, 0xec, 0x4b, 0xe6, 0x47, 0x7e, 0x45, 0x3f, 0x07, 0x5a, 0xa3, 0x3d, 0xb3, 0x82, 0x87, 0x0c, 0x1c, 0x34, 0x09, 0xae, 0xf3, 0x92, 0xd7, 0x38, 0x6a, 0xe3, 0xa6, 0x96, 0xb9, 0x9a, 0x94, 0xb4, 0xda, 0x05, 0x89, 0x44, 0x7e, 0x95, 0x5d, 0x16, 0xc9, 0x8b, 0x17, 0x60, 0x2a, 0x59, 0xbd, 0x73, 0x62, 0x79, 0xfc, 0xd8, 0xfb, 0x28, 0x0c, 0x44, 0x62, 0xd5, 0x90, 0xbf, 0xa9, 0xbf, 0x13, 0xfe, 0xd5, 0x70, 0xea, 0xfd, 0xe9, 0x73, 0x30, 0xa2, 0xc2, 0x10 } + +} +, +} +}, +{ + "Example 9: A 1536-bit RSA Key Pair", +{ + /* RSA modulus n */ + 192, + { 0xcf, 0x2c, 0xd4, 0x1e, 0x34, 0xca, 0x3a, 0x72, 0x8e, 0xa5, 0xcb, 0x8a, 0xff, 0x64, 0xc3, 0x6d, 0x27, 0xbd, 0xef, 0x53, 0x64, 0xe3, 0x36, 0xfd, 0x68, 0xd3, 0x12, 0x3c, 0x5a, 0x19, 0x6a, 0x8c, 0x28, 0x70, 0x13, 0xe8, 0x53, 0xd5, 0x15, 0x6d, 0x58, 0xd1, 0x51, 0x95, 0x45, 0x20, 0xfb, 0x4f, 0x6d, 0x7b, 0x17, 0xab, 0xb6, 0x81, 0x77, 0x65, 0x90, 0x9c, 0x57, 0x61, 0x19, 0x65, 0x9d, 0x90, 0x2b, 0x19, 0x06, 0xed, 0x8a, 0x2b, 0x10, 0xc1, 0x55, 0xc2, 0x4d, 0x12, 0x45, 0x28, 0xda, 0xb9, 0xee, 0xae, 0x37, 0x9b, 0xea, 0xc6, 0x6e, 0x4a, 0x41, 0x17, 0x86, 0xdc, 0xb8, 0xfd, 0x00, 0x62, 0xeb, 0xc0, 0x30, 0xde, 0x12, 0x19, 0xa0, 0x4c, 0x2a, 0x8c, 0x1b, 0x7d, 0xd3, 0x13, 0x1e, 0x4d, 0x6b, 0x6c, 0xae, 0xe2, 0xe3, 0x1a, 0x5e, 0xd4, 0x1a, 0xc1, 0x50, 0x9b, 0x2e, 0xf1, 0xee, 0x2a, 0xb1, 0x83, 0x64, 0xbe, 0x56, 0x8c, 0xa9, 0x41, 0xc2, 0x5e, 0xcc, 0x84, 0xff, 0x9d, 0x64, 0x3b, 0x5e, 0xc1, 0xaa, 0xae, 0x10, 0x2a, 0x20, 0xd7, 0x3f, 0x47, 0x9b, 0x78, 0x0f, 0xd6, 0xda, 0x91, 0x07, 0x52, 0x12, 0xd9, 0xea, 0xc0, 0x3a, 0x06, 0x74, 0xd8, 0x99, 0xeb, 0xa2, 0xe4, 0x31, 0xf4, 0xc4, 0x4b, 0x61, 0x5b, 0x6b, 0xa2, 0x23, 0x2b, 0xd4, 0xb3, 0x3b, 0xae, 0xd7, 0x3d, 0x62, 0x5d } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 192, + { 0x19, 0x8c, 0x14, 0x1e, 0x23, 0x71, 0x5a, 0x92, 0xbc, 0xcf, 0x6a, 0x11, 0x9a, 0x5b, 0xc1, 0x13, 0x89, 0x46, 0x8d, 0x28, 0x11, 0xf5, 0x48, 0xd7, 0x27, 0xe1, 0x7b, 0x4a, 0xb0, 0xeb, 0x98, 0x6d, 0x6f, 0x21, 0x1e, 0xfb, 0x53, 0xb7, 0x1f, 0x7c, 0xcb, 0xea, 0x87, 0xee, 0x69, 0xc7, 0x5e, 0xe6, 0x15, 0x00, 0x8c, 0x53, 0x32, 0xde, 0xb5, 0x2b, 0xf3, 0x90, 0xab, 0xdf, 0xbf, 0xe3, 0x7d, 0x72, 0x05, 0x36, 0x81, 0x59, 0xb2, 0x63, 0x8c, 0x1d, 0xe3, 0x26, 0xe2, 0x1d, 0x22, 0x25, 0x1f, 0x0f, 0xb5, 0x84, 0x8b, 0x3b, 0xf1, 0x50, 0x05, 0xd2, 0xa7, 0x43, 0x30, 0xf0, 0xaf, 0xe9, 0x16, 0xee, 0x62, 0xcc, 0xc1, 0x34, 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93, 0xf9, 0xe5, 0x5e, 0xa6, 0x5e, 0xfd } +, + /* Prime q */ + 96, + { 0xd2, 0x00, 0xd4, 0x5e, 0x78, 0x8a, 0xac, 0xea, 0x60, 0x6a, 0x40, 0x1d, 0x04, 0x60, 0xf8, 0x7d, 0xd5, 0xc1, 0x02, 0x7e, 0x12, 0xdc, 0x1a, 0x0d, 0x75, 0x86, 0xe8, 0x93, 0x9d, 0x9c, 0xf7, 0x89, 0xb4, 0x0f, 0x51, 0xac, 0x04, 0x42, 0x96, 0x1d, 0xe7, 0xd2, 0x1c, 0xc2, 0x1e, 0x05, 0xc8, 0x31, 0x55, 0xc1, 0xf2, 0xaa, 0x91, 0x93, 0x38, 0x7c, 0xfd, 0xf9, 0x56, 0xcb, 0x48, 0xd1, 0x53, 0xba, 0x27, 0x04, 0x06, 0xf9, 0xbb, 0xba, 0x53, 0x7d, 0x49, 0x87, 0xd9, 0xe2, 0xf9, 0x94, 0x2d, 0x7a, 0x14, 0xcb, 0xff, 0xfe, 0xa7, 0x4f, 0xec, 0xdd, 0xa9, 0x28, 0xd2, 0x3e, 0x25, 0x9f, 0x5e, 0xe1 } +, + /* p's CRT exponent dP */ + 96, + { 0xdb, 0x16, 0x80, 0x2f, 0x79, 0xa2, 0xf0, 0xd4, 0x5f, 0x35, 0x8d, 0x69, 0xfd, 0x33, 0xe4, 0x4b, 0x81, 0xfa, 0xe8, 0x28, 0x62, 0x2e, 0x93, 0xa5, 0x42, 0x53, 0xe9, 0x97, 0xd0, 0x1b, 0x07, 0x43, 0x75, 0x9d, 0xa0, 0xe8, 0x12, 0xb4, 0xaa, 0x4e, 0x6c, 0x8b, 0xea, 0xb2, 0x32, 0x8d, 0x54, 0x31, 0x95, 0x5a, 0x41, 0x8a, 0x67, 0xff, 0x26, 0xa8, 0xc5, 0xc8, 0x07, 0xa5, 0xda, 0x35, 0x4e, 0x05, 0xef, 0x31, 0xcc, 0x8c, 0xf7, 0x58, 0xf4, 0x63, 0x73, 0x29, 0x50, 0xb0, 0x3e, 0x26, 0x57, 0x26, 0xfb, 0x94, 0xe3, 0x9d, 0x6a, 0x57, 0x2a, 0x26, 0x24, 0x4a, 0xb0, 0x8d, 0xb7, 0x57, 0x52, 0xad } +, + /* q's CRT exponent dQ */ + 96, + { 0xa0, 0xa3, 0x17, 0xcf, 0xe7, 0xdf, 0x14, 0x23, 0xf8, 0x7a, 0x6d, 0xee, 0x84, 0x51, 0xf4, 0xe2, 0xb4, 0xa6, 0x7e, 0x54, 0x97, 0xf2, 0x9b, 0x4f, 0x1e, 0x4e, 0x83, 0x0b, 0x9f, 0xad, 0xd9, 0x40, 0x11, 0x67, 0x02, 0x6f, 0x55, 0x96, 0xe5, 0xa3, 0x9c, 0x97, 0x81, 0x7e, 0x0f, 0x5f, 0x16, 0xe2, 0x7e, 0x19, 0xec, 0x99, 0x02, 0xe0, 0x1d, 0x7e, 0xa6, 0xfb, 0x9a, 0xa3, 0xc7, 0x60, 0xaf, 0xee, 0x1e, 0x38, 0x1b, 0x69, 0xde, 0x6a, 0xc9, 0xc0, 0x75, 0x85, 0xa0, 0x6a, 0xd9, 0xc4, 0xba, 0x00, 0xbf, 0x75, 0xc8, 0xad, 0x2f, 0xa8, 0x98, 0xa4, 0x79, 0xe8, 0x0a, 0xe2, 0x94, 0xfe, 0xd2, 0xa1 } +, + /* CRT coefficient qInv */ + 96, + { 0x0b, 0x21, 0xf3, 0x35, 0xc3, 0x53, 0x34, 0x2e, 0xb4, 0x4c, 0x3a, 0xa2, 0x44, 0x45, 0x78, 0x0c, 0x2d, 0x65, 0x5b, 0x94, 0x01, 0x74, 0xca, 0xe3, 0x8c, 0x7c, 0x8a, 0x4e, 0x64, 0x93, 0xc0, 0xba, 0x9f, 0xd3, 0x03, 0x74, 0x82, 0x67, 0xb0, 0x83, 0xb9, 0xa7, 0xa6, 0xcb, 0x61, 0xe4, 0x2d, 0xb3, 0x62, 0xb8, 0xc9, 0x89, 0x6d, 0xb7, 0x06, 0x4e, 0x02, 0xad, 0x5a, 0xe6, 0x15, 0x87, 0xda, 0x15, 0xb4, 0x64, 0x9c, 0x90, 0x59, 0x49, 0x09, 0xfe, 0xb3, 0x7d, 0xbc, 0xb6, 0x54, 0xbe, 0xb7, 0x26, 0x8e, 0xc8, 0x01, 0xe5, 0xa8, 0xb4, 0xaa, 0x39, 0x11, 0xbe, 0xbd, 0x88, 0x54, 0x2f, 0x05, 0xbe } + +} +, +{{ + "RSAES-OAEP Encryption Example 9.1", + /* Message to be encrypted */ + 61, + { 0xf7, 0x35, 0xfd, 0x55, 0xba, 0x92, 0x59, 0x2c, 0x3b, 0x52, 0xb8, 0xf9, 0xc4, 0xf6, 0x9a, 0xaa, 0x1c, 0xbe, 0xf8, 0xfe, 0x88, 0xad, 0xd0, 0x95, 0x59, 0x54, 0x12, 0x46, 0x7f, 0x9c, 0xf4, 0xec, 0x0b, 0x89, 0x6c, 0x59, 0xed, 0xa1, 0x62, 0x10, 0xe7, 0x54, 0x9c, 0x8a, 0xbb, 0x10, 0xcd, 0xbc, 0x21, 0xa1, 0x2e, 0xc9, 0xb6, 0xb5, 0xb8, 0xfd, 0x2f, 0x10, 0x39, 0x9e, 0xb6 } +, + /* Seed */ + 20, + { 0x8e, 0xc9, 0x65, 0xf1, 0x34, 0xa3, 0xec, 0x99, 0x31, 0xe9, 0x2a, 0x1c, 0xa0, 0xdc, 0x81, 0x69, 0xd5, 0xea, 0x70, 0x5c } +, + /* Encryption */ + 192, + { 0x26, 0x7b, 0xcd, 0x11, 0x8a, 0xca, 0xb1, 0xfc, 0x8b, 0xa8, 0x1c, 0x85, 0xd7, 0x30, 0x03, 0xcb, 0x86, 0x10, 0xfa, 0x55, 0xc1, 0xd9, 0x7d, 0xa8, 0xd4, 0x8a, 0x7c, 0x7f, 0x06, 0x89, 0x6a, 0x4d, 0xb7, 0x51, 0xaa, 0x28, 0x42, 0x55, 0xb9, 0xd3, 0x6a, 0xd6, 0x5f, 0x37, 0x65, 0x3d, 0x82, 0x9f, 0x1b, 0x37, 0xf9, 0x7b, 0x80, 0x01, 0x94, 0x25, 0x45, 0xb2, 0xfc, 0x2c, 0x55, 0xa7, 0x37, 0x6c, 0xa7, 0xa1, 0xbe, 0x4b, 0x17, 0x60, 0xc8, 0xe0, 0x5a, 0x33, 0xe5, 0xaa, 0x25, 0x26, 0xb8, 0xd9, 0x8e, 0x31, 0x70, 0x88, 0xe7, 0x83, 0x4c, 0x75, 0x5b, 0x2a, 0x59, 0xb1, 0x26, 0x31, 0xa1, 0x82, 0xc0, 0x5d, 0x5d, 0x43, 0xab, 0x17, 0x79, 0x26, 0x4f, 0x84, 0x56, 0xf5, 0x15, 0xce, 0x57, 0xdf, 0xdf, 0x51, 0x2d, 0x54, 0x93, 0xda, 0xb7, 0xb7, 0x33, 0x8d, 0xc4, 0xb7, 0xd7, 0x8d, 0xb9, 0xc0, 0x91, 0xac, 0x3b, 0xaf, 0x53, 0x7a, 0x69, 0xfc, 0x7f, 0x54, 0x9d, 0x97, 0x9f, 0x0e, 0xff, 0x9a, 0x94, 0xfd, 0xa4, 0x16, 0x9b, 0xd4, 0xd1, 0xd1, 0x9a, 0x69, 0xc9, 0x9e, 0x33, 0xc3, 0xb5, 0x54, 0x90, 0xd5, 0x01, 0xb3, 0x9b, 0x1e, 0xda, 0xe1, 0x18, 0xff, 0x67, 0x93, 0xa1, 0x53, 0x26, 0x15, 0x84, 0xd3, 0xa5, 0xf3, 0x9f, 0x6e, 0x68, 0x2e, 0x3d, 0x17, 0xc8, 0xcd, 0x12, 0x61, 0xfa, 0x72 } + +} +, +{ + "RSAES-OAEP Encryption Example 9.2", + /* Message to be encrypted */ + 39, + { 0x81, 0xb9, 0x06, 0x60, 0x50, 0x15, 0xa6, 0x3a, 0xab, 0xe4, 0x2d, 0xdf, 0x11, 0xe1, 0x97, 0x89, 0x12, 0xf5, 0x40, 0x4c, 0x74, 0x74, 0xb2, 0x6d, 0xce, 0x3e, 0xd4, 0x82, 0xbf, 0x96, 0x1e, 0xcc, 0x81, 0x8b, 0xf4, 0x20, 0xc5, 0x46, 0x59 } +, + /* Seed */ + 20, + { 0xec, 0xb1, 0xb8, 0xb2, 0x5f, 0xa5, 0x0c, 0xda, 0xb0, 0x8e, 0x56, 0x04, 0x28, 0x67, 0xf4, 0xaf, 0x58, 0x26, 0xd1, 0x6c } +, + /* Encryption */ + 192, + { 0x93, 0xac, 0x9f, 0x06, 0x71, 0xec, 0x29, 0xac, 0xbb, 0x44, 0x4e, 0xff, 0xc1, 0xa5, 0x74, 0x13, 0x51, 0xd6, 0x0f, 0xdb, 0x0e, 0x39, 0x3f, 0xbf, 0x75, 0x4a, 0xcf, 0x0d, 0xe4, 0x97, 0x61, 0xa1, 0x48, 0x41, 0xdf, 0x77, 0x72, 0xe9, 0xbc, 0x82, 0x77, 0x39, 0x66, 0xa1, 0x58, 0x4c, 0x4d, 0x72, 0xba, 0xea, 0x00, 0x11, 0x8f, 0x83, 0xf3, 0x5c, 0xca, 0x6e, 0x53, 0x7c, 0xbd, 0x4d, 0x81, 0x1f, 0x55, 0x83, 0xb2, 0x97, 0x83, 0xd8, 0xa6, 0xd9, 0x4c, 0xd3, 0x1b, 0xe7, 0x0d, 0x6f, 0x52, 0x6c, 0x10, 0xff, 0x09, 0xc6, 0xfa, 0x7c, 0xe0, 0x69, 0x79, 0x5a, 0x3f, 0xcd, 0x05, 0x11, 0xfd, 0x5f, 0xcb, 0x56, 0x4b, 0xcc, 0x80, 0xea, 0x9c, 0x78, 0xf3, 0x8b, 0x80, 0x01, 0x25, 0x39, 0xd8, 0xa4, 0xdd, 0xf6, 0xfe, 0x81, 0xe9, 0xcd, 0xdb, 0x7f, 0x50, 0xdb, 0xbb, 0xbc, 0xc7, 0xe5, 0xd8, 0x60, 0x97, 0xcc, 0xf4, 0xec, 0x49, 0x18, 0x9f, 0xb8, 0xbf, 0x31, 0x8b, 0xe6, 0xd5, 0xa0, 0x71, 0x5d, 0x51, 0x6b, 0x49, 0xaf, 0x19, 0x12, 0x58, 0xcd, 0x32, 0xdc, 0x83, 0x3c, 0xe6, 0xeb, 0x46, 0x73, 0xc0, 0x3a, 0x19, 0xbb, 0xac, 0xe8, 0x8c, 0xc5, 0x48, 0x95, 0xf6, 0x36, 0xcc, 0x0c, 0x1e, 0xc8, 0x90, 0x96, 0xd1, 0x1c, 0xe2, 0x35, 0xa2, 0x65, 0xca, 0x17, 0x64, 0x23, 0x2a, 0x68, 0x9a, 0xe8 } + +} +, +{ + "RSAES-OAEP Encryption Example 9.3", + /* Message to be encrypted */ + 17, + { 0xfd, 0x32, 0x64, 0x29, 0xdf, 0x9b, 0x89, 0x0e, 0x09, 0xb5, 0x4b, 0x18, 0xb8, 0xf3, 0x4f, 0x1e, 0x24 } +, + /* Seed */ + 20, + { 0xe8, 0x9b, 0xb0, 0x32, 0xc6, 0xce, 0x62, 0x2c, 0xbd, 0xb5, 0x3b, 0xc9, 0x46, 0x60, 0x14, 0xea, 0x77, 0xf7, 0x77, 0xc0 } +, + /* Encryption */ + 192, + { 0x81, 0xeb, 0xdd, 0x95, 0x05, 0x4b, 0x0c, 0x82, 0x2e, 0xf9, 0xad, 0x76, 0x93, 0xf5, 0xa8, 0x7a, 0xdf, 0xb4, 0xb4, 0xc4, 0xce, 0x70, 0xdf, 0x2d, 0xf8, 0x4e, 0xd4, 0x9c, 0x04, 0xda, 0x58, 0xba, 0x5f, 0xc2, 0x0a, 0x19, 0xe1, 0xa6, 0xe8, 0xb7, 0xa3, 0x90, 0x0b, 0x22, 0x79, 0x6d, 0xc4, 0xe8, 0x69, 0xee, 0x6b, 0x42, 0x79, 0x2d, 0x15, 0xa8, 0xec, 0xeb, 0x56, 0xc0, 0x9c, 0x69, 0x91, 0x4e, 0x81, 0x3c, 0xea, 0x8f, 0x69, 0x31, 0xe4, 0xb8, 0xed, 0x6f, 0x42, 0x1a, 0xf2, 0x98, 0xd5, 0x95, 0xc9, 0x7f, 0x47, 0x89, 0xc7, 0xca, 0xa6, 0x12, 0xc7, 0xef, 0x36, 0x09, 0x84, 0xc2, 0x1b, 0x93, 0xed, 0xc5, 0x40, 0x10, 0x68, 0xb5, 0xaf, 0x4c, 0x78, 0xa8, 0x77, 0x1b, 0x98, 0x4d, 0x53, 0xb8, 0xea, 0x8a, 0xdf, 0x2f, 0x6a, 0x7d, 0x4a, 0x0b, 0xa7, 0x6c, 0x75, 0xe1, 0xdd, 0x9f, 0x65, 0x8f, 0x20, 0xde, 0xd4, 0xa4, 0x60, 0x71, 0xd4, 0x6d, 0x77, 0x91, 0xb5, 0x68, 0x03, 0xd8, 0xfe, 0xa7, 0xf0, 0xb0, 0xf8, 0xe4, 0x1a, 0xe3, 0xf0, 0x93, 0x83, 0xa6, 0xf9, 0x58, 0x5f, 0xe7, 0x75, 0x3e, 0xaa, 0xff, 0xd2, 0xbf, 0x94, 0x56, 0x31, 0x08, 0xbe, 0xec, 0xc2, 0x07, 0xbb, 0xb5, 0x35, 0xf5, 0xfc, 0xc7, 0x05, 0xf0, 0xdd, 0xe9, 0xf7, 0x08, 0xc6, 0x2f, 0x49, 0xa9, 0xc9, 0x03, 0x71, 0xd3 } + +} +, +{ + "RSAES-OAEP Encryption Example 9.4", + /* Message to be encrypted */ + 62, + { 0xf1, 0x45, 0x9b, 0x5f, 0x0c, 0x92, 0xf0, 0x1a, 0x0f, 0x72, 0x3a, 0x2e, 0x56, 0x62, 0x48, 0x4d, 0x8f, 0x8c, 0x0a, 0x20, 0xfc, 0x29, 0xda, 0xd6, 0xac, 0xd4, 0x3b, 0xb5, 0xf3, 0xef, 0xfd, 0xf4, 0xe1, 0xb6, 0x3e, 0x07, 0xfd, 0xfe, 0x66, 0x28, 0xd0, 0xd7, 0x4c, 0xa1, 0x9b, 0xf2, 0xd6, 0x9e, 0x4a, 0x0a, 0xbf, 0x86, 0xd2, 0x93, 0x92, 0x5a, 0x79, 0x67, 0x72, 0xf8, 0x08, 0x8e } +, + /* Seed */ + 20, + { 0x60, 0x6f, 0x3b, 0x99, 0xc0, 0xb9, 0xcc, 0xd7, 0x71, 0xea, 0xa2, 0x9e, 0xa0, 0xe4, 0xc8, 0x84, 0xf3, 0x18, 0x9c, 0xcc } +, + /* Encryption */ + 192, + { 0xbc, 0xc3, 0x5f, 0x94, 0xcd, 0xe6, 0x6c, 0xb1, 0x13, 0x66, 0x25, 0xd6, 0x25, 0xb9, 0x44, 0x32, 0xa3, 0x5b, 0x22, 0xf3, 0xd2, 0xfa, 0x11, 0xa6, 0x13, 0xff, 0x0f, 0xca, 0x5b, 0xd5, 0x7f, 0x87, 0xb9, 0x02, 0xcc, 0xdc, 0x1c, 0xd0, 0xae, 0xbc, 0xb0, 0x71, 0x5e, 0xe8, 0x69, 0xd1, 0xd1, 0xfe, 0x39, 0x5f, 0x67, 0x93, 0x00, 0x3f, 0x5e, 0xca, 0x46, 0x50, 0x59, 0xc8, 0x86, 0x60, 0xd4, 0x46, 0xff, 0x5f, 0x08, 0x18, 0x55, 0x20, 0x22, 0x55, 0x7e, 0x38, 0xc0, 0x8a, 0x67, 0xea, 0xd9, 0x91, 0x26, 0x22, 0x54, 0xf1, 0x06, 0x82, 0x97, 0x5e, 0xc5, 0x63, 0x97, 0x76, 0x85, 0x37, 0xf4, 0x97, 0x7a, 0xf6, 0xd5, 0xf6, 0xaa, 0xce, 0xb7, 0xfb, 0x25, 0xde, 0xc5, 0x93, 0x72, 0x30, 0x23, 0x1f, 0xd8, 0x97, 0x8a, 0xf4, 0x91, 0x19, 0xa2, 0x9f, 0x29, 0xe4, 0x24, 0xab, 0x82, 0x72, 0xb4, 0x75, 0x62, 0x79, 0x2d, 0x5c, 0x94, 0xf7, 0x74, 0xb8, 0x82, 0x9d, 0x0b, 0x0d, 0x9f, 0x1a, 0x8c, 0x9e, 0xdd, 0xf3, 0x75, 0x74, 0xd5, 0xfa, 0x24, 0x8e, 0xef, 0xa9, 0xc5, 0x27, 0x1f, 0xc5, 0xec, 0x25, 0x79, 0xc8, 0x1b, 0xdd, 0x61, 0xb4, 0x10, 0xfa, 0x61, 0xfe, 0x36, 0xe4, 0x24, 0x22, 0x1c, 0x11, 0x3a, 0xdd, 0xb2, 0x75, 0x66, 0x4c, 0x80, 0x1d, 0x34, 0xca, 0x8c, 0x63, 0x51, 0xe4, 0xa8, 0x58 } + +} +, +{ + "RSAES-OAEP Encryption Example 9.5", + /* Message to be encrypted */ + 53, + { 0x53, 0xe6, 0xe8, 0xc7, 0x29, 0xd6, 0xf9, 0xc3, 0x19, 0xdd, 0x31, 0x7e, 0x74, 0xb0, 0xdb, 0x8e, 0x4c, 0xcc, 0xa2, 0x5f, 0x3c, 0x83, 0x05, 0x74, 0x6e, 0x13, 0x7a, 0xc6, 0x3a, 0x63, 0xef, 0x37, 0x39, 0xe7, 0xb5, 0x95, 0xab, 0xb9, 0x6e, 0x8d, 0x55, 0xe5, 0x4f, 0x7b, 0xd4, 0x1a, 0xb4, 0x33, 0x37, 0x8f, 0xfb, 0x91, 0x1d } +, + /* Seed */ + 20, + { 0xfc, 0xbc, 0x42, 0x14, 0x02, 0xe9, 0xec, 0xab, 0xc6, 0x08, 0x2a, 0xfa, 0x40, 0xba, 0x5f, 0x26, 0x52, 0x2c, 0x84, 0x0e } +, + /* Encryption */ + 192, + { 0x23, 0x2a, 0xfb, 0xc9, 0x27, 0xfa, 0x08, 0xc2, 0xf6, 0xa2, 0x7b, 0x87, 0xd4, 0xa5, 0xcb, 0x09, 0xc0, 0x7d, 0xc2, 0x6f, 0xae, 0x73, 0xd7, 0x3a, 0x90, 0x55, 0x88, 0x39, 0xf4, 0xfd, 0x66, 0xd2, 0x81, 0xb8, 0x7e, 0xc7, 0x34, 0xbc, 0xe2, 0x37, 0xba, 0x16, 0x66, 0x98, 0xed, 0x82, 0x91, 0x06, 0xa7, 0xde, 0x69, 0x42, 0xcd, 0x6c, 0xdc, 0xe7, 0x8f, 0xed, 0x8d, 0x2e, 0x4d, 0x81, 0x42, 0x8e, 0x66, 0x49, 0x0d, 0x03, 0x62, 0x64, 0xce, 0xf9, 0x2a, 0xf9, 0x41, 0xd3, 0xe3, 0x50, 0x55, 0xfe, 0x39, 0x81, 0xe1, 0x4d, 0x29, 0xcb, 0xb9, 0xa4, 0xf6, 0x74, 0x73, 0x06, 0x3b, 0xae, 0xc7, 0x9a, 0x11, 0x79, 0xf5, 0xa1, 0x7c, 0x9c, 0x18, 0x32, 0xf2, 0x83, 0x8f, 0xd7, 0xd5, 0xe5, 0x9b, 0xb9, 0x65, 0x9d, 0x56, 0xdc, 0xe8, 0xa0, 0x19, 0xed, 0xef, 0x1b, 0xb3, 0xac, 0xcc, 0x69, 0x7c, 0xc6, 0xcc, 0x7a, 0x77, 0x8f, 0x60, 0xa0, 0x64, 0xc7, 0xf6, 0xf5, 0xd5, 0x29, 0xc6, 0x21, 0x02, 0x62, 0xe0, 0x03, 0xde, 0x58, 0x3e, 0x81, 0xe3, 0x16, 0x7b, 0x89, 0x97, 0x1f, 0xb8, 0xc0, 0xe1, 0x5d, 0x44, 0xff, 0xfe, 0xf8, 0x9b, 0x53, 0xd8, 0xd6, 0x4d, 0xd7, 0x97, 0xd1, 0x59, 0xb5, 0x6d, 0x2b, 0x08, 0xea, 0x53, 0x07, 0xea, 0x12, 0xc2, 0x41, 0xbd, 0x58, 0xd4, 0xee, 0x27, 0x8a, 0x1f, 0x2e } + +} +, +{ + "RSAES-OAEP Encryption Example 9.6", + /* Message to be encrypted */ + 11, + { 0xb6, 0xb2, 0x8e, 0xa2, 0x19, 0x8d, 0x0c, 0x10, 0x08, 0xbc, 0x64 } +, + /* Seed */ + 20, + { 0x23, 0xaa, 0xde, 0x0e, 0x1e, 0x08, 0xbb, 0x9b, 0x9a, 0x78, 0xd2, 0x30, 0x2a, 0x52, 0xf9, 0xc2, 0x1b, 0x2e, 0x1b, 0xa2 } +, + /* Encryption */ + 192, + { 0x43, 0x8c, 0xc7, 0xdc, 0x08, 0xa6, 0x8d, 0xa2, 0x49, 0xe4, 0x25, 0x05, 0xf8, 0x57, 0x3b, 0xa6, 0x0e, 0x2c, 0x27, 0x73, 0xd5, 0xb2, 0x90, 0xf4, 0xcf, 0x9d, 0xff, 0x71, 0x8e, 0x84, 0x20, 0x81, 0xc3, 0x83, 0xe6, 0x70, 0x24, 0xa0, 0xf2, 0x95, 0x94, 0xea, 0x98, 0x7b, 0x9d, 0x25, 0xe4, 0xb7, 0x38, 0xf2, 0x85, 0x97, 0x0d, 0x19, 0x5a, 0xbb, 0x3a, 0x8c, 0x80, 0x54, 0xe3, 0xd7, 0x9d, 0x6b, 0x9c, 0x9a, 0x83, 0x27, 0xba, 0x59, 0x6f, 0x12, 0x59, 0xe2, 0x71, 0x26, 0x67, 0x47, 0x66, 0x90, 0x7d, 0x8d, 0x58, 0x2f, 0xf3, 0xa8, 0x47, 0x61, 0x54, 0x92, 0x9a, 0xdb, 0x1e, 0x6d, 0x12, 0x35, 0xb2, 0xcc, 0xb4, 0xec, 0x8f, 0x66, 0x3b, 0xa9, 0xcc, 0x67, 0x0a, 0x92, 0xbe, 0xbd, 0x85, 0x3c, 0x8d, 0xbf, 0x69, 0xc6, 0x43, 0x6d, 0x01, 0x6f, 0x61, 0xad, 0xd8, 0x36, 0xe9, 0x47, 0x32, 0x45, 0x04, 0x34, 0x20, 0x7f, 0x9f, 0xd4, 0xc4, 0x3d, 0xec, 0x2a, 0x12, 0xa9, 0x58, 0xef, 0xa0, 0x1e, 0xfe, 0x26, 0x69, 0x89, 0x9b, 0x5e, 0x60, 0x4c, 0x25, 0x5c, 0x55, 0xfb, 0x71, 0x66, 0xde, 0x55, 0x89, 0xe3, 0x69, 0x59, 0x7b, 0xb0, 0x91, 0x68, 0xc0, 0x6d, 0xd5, 0xdb, 0x17, 0x7e, 0x06, 0xa1, 0x74, 0x0e, 0xb2, 0xd5, 0xc8, 0x2f, 0xae, 0xca, 0x6d, 0x92, 0xfc, 0xee, 0x99, 0x31, 0xba, 0x9f } + +} +, +} +}, +{ + "Example 10: A 2048-bit RSA Key Pair", +{ + /* RSA modulus n */ + 256, + { 0xae, 0x45, 0xed, 0x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 0x19, 0xa7, 0xaa, 0x06, 0x3a, 0xef, 0xa2, 0xc3, 0xc1, 0x98, 0x0e, 0x56, 0x0c, 0xd6, 0x4a, 0xfe, 0x77, 0x95, 0x85, 0xb6, 0x10, 0x76, 0x57, 0xb9, 0x57, 0x85, 0x7e, 0xfd, 0xe6, 0x01, 0x09, 0x88, 0xab, 0x7d, 0xe4, 0x17, 0xfc, 0x88, 0xd8, 0xf3, 0x84, 0xc4, 0xe6, 0xe7, 0x2c, 0x3f, 0x94, 0x3e, 0x0c, 0x31, 0xc0, 0xc4, 0xa5, 0xcc, 0x36, 0xf8, 0x79, 0xd8, 0xa3, 0xac, 0x9d, 0x7d, 0x59, 0x86, 0x0e, 0xaa, 0xda, 0x6b, 0x83, 0xbb } +, + /* RSA public exponent e */ + 3, + { 0x01, 0x00, 0x01 } +, + /* RSA private exponent d */ + 256, + { 0x05, 0x6b, 0x04, 0x21, 0x6f, 0xe5, 0xf3, 0x54, 0xac, 0x77, 0x25, 0x0a, 0x4b, 0x6b, 0x0c, 0x85, 0x25, 0xa8, 0x5c, 0x59, 0xb0, 0xbd, 0x80, 0xc5, 0x64, 0x50, 0xa2, 0x2d, 0x5f, 0x43, 0x8e, 0x59, 0x6a, 0x33, 0x3a, 0xa8, 0x75, 0xe2, 0x91, 0xdd, 0x43, 0xf4, 0x8c, 0xb8, 0x8b, 0x9d, 0x5f, 0xc0, 0xd4, 0x99, 0xf9, 0xfc, 0xd1, 0xc3, 0x97, 0xf9, 0xaf, 0xc0, 0x70, 0xcd, 0x9e, 0x39, 0x8c, 0x8d, 0x19, 0xe6, 0x1d, 0xb7, 0xc7, 0x41, 0x0a, 0x6b, 0x26, 0x75, 0xdf, 0xbf, 0x5d, 0x34, 0x5b, 0x80, 0x4d, 0x20, 0x1a, 0xdd, 0x50, 0x2d, 0x5c, 0xe2, 0xdf, 0xcb, 0x09, 0x1c, 0xe9, 0x99, 0x7b, 0xbe, 0xbe, 0x57, 0x30, 0x6f, 0x38, 0x3e, 0x4d, 0x58, 0x81, 0x03, 0xf0, 0x36, 0xf7, 0xe8, 0x5d, 0x19, 0x34, 0xd1, 0x52, 0xa3, 0x23, 0xe4, 0xa8, 0xdb, 0x45, 0x1d, 0x6f, 0x4a, 0x5b, 0x1b, 0x0f, 0x10, 0x2c, 0xc1, 0x50, 0xe0, 0x2f, 0xee, 0xe2, 0xb8, 0x8d, 0xea, 0x4a, 0xd4, 0xc1, 0xba, 0xcc, 0xb2, 0x4d, 0x84, 0x07, 0x2d, 0x14, 0xe1, 0xd2, 0x4a, 0x67, 0x71, 0xf7, 0x40, 0x8e, 0xe3, 0x05, 0x64, 0xfb, 0x86, 0xd4, 0x39, 0x3a, 0x34, 0xbc, 0xf0, 0xb7, 0x88, 0x50, 0x1d, 0x19, 0x33, 0x03, 0xf1, 0x3a, 0x22, 0x84, 0xb0, 0x01, 0xf0, 0xf6, 0x49, 0xea, 0xf7, 0x93, 0x28, 0xd4, 0xac, 0x5c, 0x43, 0x0a, 0xb4, 0x41, 0x49, 0x20, 0xa9, 0x46, 0x0e, 0xd1, 0xb7, 0xbc, 0x40, 0xec, 0x65, 0x3e, 0x87, 0x6d, 0x09, 0xab, 0xc5, 0x09, 0xae, 0x45, 0xb5, 0x25, 0x19, 0x01, 0x16, 0xa0, 0xc2, 0x61, 0x01, 0x84, 0x82, 0x98, 0x50, 0x9c, 0x1c, 0x3b, 0xf3, 0xa4, 0x83, 0xe7, 0x27, 0x40, 0x54, 0xe1, 0x5e, 0x97, 0x07, 0x50, 0x36, 0xe9, 0x89, 0xf6, 0x09, 0x32, 0x80, 0x7b, 0x52, 0x57, 0x75, 0x1e, 0x79 } +, + /* Prime p */ + 128, + { 0xec, 0xf5, 0xae, 0xcd, 0x1e, 0x55, 0x15, 0xff, 0xfa, 0xcb, 0xd7, 0x5a, 0x28, 0x16, 0xc6, 0xeb, 0xf4, 0x90, 0x18, 0xcd, 0xfb, 0x46, 0x38, 0xe1, 0x85, 0xd6, 0x6a, 0x73, 0x96, 0xb6, 0xf8, 0x09, 0x0f, 0x80, 0x18, 0xc7, 0xfd, 0x95, 0xcc, 0x34, 0xb8, 0x57, 0xdc, 0x17, 0xf0, 0xcc, 0x65, 0x16, 0xbb, 0x13, 0x46, 0xab, 0x4d, 0x58, 0x2c, 0xad, 0xad, 0x7b, 0x41, 0x03, 0x35, 0x23, 0x87, 0xb7, 0x03, 0x38, 0xd0, 0x84, 0x04, 0x7c, 0x9d, 0x95, 0x39, 0xb6, 0x49, 0x62, 0x04, 0xb3, 0xdd, 0x6e, 0xa4, 0x42, 0x49, 0x92, 0x07, 0xbe, 0xc0, 0x1f, 0x96, 0x42, 0x87, 0xff, 0x63, 0x36, 0xc3, 0x98, 0x46, 0x58, 0x33, 0x68, 0x46, 0xf5, 0x6e, 0x46, 0x86, 0x18, 0x81, 0xc1, 0x02, 0x33, 0xd2, 0x17, 0x6b, 0xf1, 0x5a, 0x5e, 0x96, 0xdd, 0xc7, 0x80, 0xbc, 0x86, 0x8a, 0xa7, 0x7d, 0x3c, 0xe7, 0x69 } +, + /* Prime q */ + 128, + { 0xbc, 0x46, 0xc4, 0x64, 0xfc, 0x6a, 0xc4, 0xca, 0x78, 0x3b, 0x0e, 0xb0, 0x8a, 0x3c, 0x84, 0x1b, 0x77, 0x2f, 0x7e, 0x9b, 0x2f, 0x28, 0xba, 0xbd, 0x58, 0x8a, 0xe8, 0x85, 0xe1, 0xa0, 0xc6, 0x1e, 0x48, 0x58, 0xa0, 0xfb, 0x25, 0xac, 0x29, 0x99, 0x90, 0xf3, 0x5b, 0xe8, 0x51, 0x64, 0xc2, 0x59, 0xba, 0x11, 0x75, 0xcd, 0xd7, 0x19, 0x27, 0x07, 0x13, 0x51, 0x84, 0x99, 0x2b, 0x6c, 0x29, 0xb7, 0x46, 0xdd, 0x0d, 0x2c, 0xab, 0xe1, 0x42, 0x83, 0x5f, 0x7d, 0x14, 0x8c, 0xc1, 0x61, 0x52, 0x4b, 0x4a, 0x09, 0x94, 0x6d, 0x48, 0xb8, 0x28, 0x47, 0x3f, 0x1c, 0xe7, 0x6b, 0x6c, 0xb6, 0x88, 0x6c, 0x34, 0x5c, 0x03, 0xe0, 0x5f, 0x41, 0xd5, 0x1b, 0x5c, 0x3a, 0x90, 0xa3, 0xf2, 0x40, 0x73, 0xc7, 0xd7, 0x4a, 0x4f, 0xe2, 0x5d, 0x9c, 0xf2, 0x1c, 0x75, 0x96, 0x0f, 0x3f, 0xc3, 0x86, 0x31, 0x83 } +, + /* p's CRT exponent dP */ + 128, + { 0xc7, 0x35, 0x64, 0x57, 0x1d, 0x00, 0xfb, 0x15, 0xd0, 0x8a, 0x3d, 0xe9, 0x95, 0x7a, 0x50, 0x91, 0x5d, 0x71, 0x26, 0xe9, 0x44, 0x2d, 0xac, 0xf4, 0x2b, 0xc8, 0x2e, 0x86, 0x2e, 0x56, 0x73, 0xff, 0x6a, 0x00, 0x8e, 0xd4, 0xd2, 0xe3, 0x74, 0x61, 0x7d, 0xf8, 0x9f, 0x17, 0xa1, 0x60, 0xb4, 0x3b, 0x7f, 0xda, 0x9c, 0xb6, 0xb6, 0xb7, 0x42, 0x18, 0x60, 0x98, 0x15, 0xf7, 0xd4, 0x5c, 0xa2, 0x63, 0xc1, 0x59, 0xaa, 0x32, 0xd2, 0x72, 0xd1, 0x27, 0xfa, 0xf4, 0xbc, 0x8c, 0xa2, 0xd7, 0x73, 0x78, 0xe8, 0xae, 0xb1, 0x9b, 0x0a, 0xd7, 0xda, 0x3c, 0xb3, 0xde, 0x0a, 0xe7, 0x31, 0x49, 0x80, 0xf6, 0x2b, 0x6d, 0x4b, 0x0a, 0x87, 0x5d, 0x1d, 0xf0, 0x3c, 0x1b, 0xae, 0x39, 0xcc, 0xd8, 0x33, 0xef, 0x6c, 0xd7, 0xe2, 0xd9, 0x52, 0x8b, 0xf0, 0x84, 0xd1, 0xf9, 0x69, 0xe7, 0x94, 0xe9, 0xf6, 0xc1 } +, + /* q's CRT exponent dQ */ + 128, + { 0x26, 0x58, 0xb3, 0x7f, 0x6d, 0xf9, 0xc1, 0x03, 0x0b, 0xe1, 0xdb, 0x68, 0x11, 0x7f, 0xa9, 0xd8, 0x7e, 0x39, 0xea, 0x2b, 0x69, 0x3b, 0x7e, 0x6d, 0x3a, 0x2f, 0x70, 0x94, 0x74, 0x13, 0xee, 0xc6, 0x14, 0x2e, 0x18, 0xfb, 0x8d, 0xfc, 0xb6, 0xac, 0x54, 0x5d, 0x7c, 0x86, 0xa0, 0xad, 0x48, 0xf8, 0x45, 0x71, 0x70, 0xf0, 0xef, 0xb2, 0x6b, 0xc4, 0x81, 0x26, 0xc5, 0x3e, 0xfd, 0x1d, 0x16, 0x92, 0x01, 0x98, 0xdc, 0x2a, 0x11, 0x07, 0xdc, 0x28, 0x2d, 0xb6, 0xa8, 0x0c, 0xd3, 0x06, 0x23, 0x60, 0xba, 0x3f, 0xa1, 0x3f, 0x70, 0xe4, 0x31, 0x2f, 0xf1, 0xa6, 0xcd, 0x6b, 0x8f, 0xc4, 0xcd, 0x9c, 0x5c, 0x3d, 0xb1, 0x7c, 0x6d, 0x6a, 0x57, 0x21, 0x2f, 0x73, 0xae, 0x29, 0xf6, 0x19, 0x32, 0x7b, 0xad, 0x59, 0xb1, 0x53, 0x85, 0x85, 0x85, 0xba, 0x4e, 0x28, 0xb6, 0x0a, 0x62, 0xa4, 0x5e, 0x49 } +, + /* CRT coefficient qInv */ + 128, + { 0x6f, 0x38, 0x52, 0x6b, 0x39, 0x25, 0x08, 0x55, 0x34, 0xef, 0x3e, 0x41, 0x5a, 0x83, 0x6e, 0xde, 0x8b, 0x86, 0x15, 0x8a, 0x2c, 0x7c, 0xbf, 0xec, 0xcb, 0x0b, 0xd8, 0x34, 0x30, 0x4f, 0xec, 0x68, 0x3b, 0xa8, 0xd4, 0xf4, 0x79, 0xc4, 0x33, 0xd4, 0x34, 0x16, 0xe6, 0x32, 0x69, 0x62, 0x3c, 0xea, 0x10, 0x07, 0x76, 0xd8, 0x5a, 0xff, 0x40, 0x1d, 0x3f, 0xff, 0x61, 0x0e, 0xe6, 0x54, 0x11, 0xce, 0x3b, 0x13, 0x63, 0xd6, 0x3a, 0x97, 0x09, 0xee, 0xde, 0x42, 0x64, 0x7c, 0xea, 0x56, 0x14, 0x93, 0xd5, 0x45, 0x70, 0xa8, 0x79, 0xc1, 0x86, 0x82, 0xcd, 0x97, 0x71, 0x0b, 0x96, 0x20, 0x5e, 0xc3, 0x11, 0x17, 0xd7, 0x3b, 0x5f, 0x36, 0x22, 0x3f, 0xad, 0xd6, 0xe8, 0xba, 0x90, 0xdd, 0x7c, 0x0e, 0xe6, 0x1d, 0x44, 0xe1, 0x63, 0x25, 0x1e, 0x20, 0xc7, 0xf6, 0x6e, 0xb3, 0x05, 0x11, 0x7c, 0xb8 } + +} +, +{{ + "RSAES-OAEP Encryption Example 10.1", + /* Message to be encrypted */ + 28, + { 0x8b, 0xba, 0x6b, 0xf8, 0x2a, 0x6c, 0x0f, 0x86, 0xd5, 0xf1, 0x75, 0x6e, 0x97, 0x95, 0x68, 0x70, 0xb0, 0x89, 0x53, 0xb0, 0x6b, 0x4e, 0xb2, 0x05, 0xbc, 0x16, 0x94, 0xee } +, + /* Seed */ + 20, + { 0x47, 0xe1, 0xab, 0x71, 0x19, 0xfe, 0xe5, 0x6c, 0x95, 0xee, 0x5e, 0xaa, 0xd8, 0x6f, 0x40, 0xd0, 0xaa, 0x63, 0xbd, 0x33 } +, + /* Encryption */ + 256, + { 0x53, 0xea, 0x5d, 0xc0, 0x8c, 0xd2, 0x60, 0xfb, 0x3b, 0x85, 0x85, 0x67, 0x28, 0x7f, 0xa9, 0x15, 0x52, 0xc3, 0x0b, 0x2f, 0xeb, 0xfb, 0xa2, 0x13, 0xf0, 0xae, 0x87, 0x70, 0x2d, 0x06, 0x8d, 0x19, 0xba, 0xb0, 0x7f, 0xe5, 0x74, 0x52, 0x3d, 0xfb, 0x42, 0x13, 0x9d, 0x68, 0xc3, 0xc5, 0xaf, 0xee, 0xe0, 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, 0x01, 0x68, 0x24, 0xf0, 0x54, 0xbf, 0x4d, 0x3c, 0x8c, 0x90, 0xa9, 0x7b, 0xb6, 0xb6, 0x55, 0x32, 0x84, 0xeb, 0x42, 0x9f, 0xcc } + +} +, +{ + "RSAES-OAEP Encryption Example 10.2", + /* Message to be encrypted */ + 16, + { 0xe6, 0xad, 0x18, 0x1f, 0x05, 0x3b, 0x58, 0xa9, 0x04, 0xf2, 0x45, 0x75, 0x10, 0x37, 0x3e, 0x57 } +, + /* Seed */ + 20, + { 0x6d, 0x17, 0xf5, 0xb4, 0xc1, 0xff, 0xac, 0x35, 0x1d, 0x19, 0x5b, 0xf7, 0xb0, 0x9d, 0x09, 0xf0, 0x9a, 0x40, 0x79, 0xcf } +, + /* Encryption */ + 256, + { 0xa2, 0xb1, 0xa4, 0x30, 0xa9, 0xd6, 0x57, 0xe2, 0xfa, 0x1c, 0x2b, 0xb5, 0xed, 0x43, 0xff, 0xb2, 0x5c, 0x05, 0xa3, 0x08, 0xfe, 0x90, 0x93, 0xc0, 0x10, 0x31, 0x79, 0x5f, 0x58, 0x74, 0x40, 0x01, 0x10, 0x82, 0x8a, 0xe5, 0x8f, 0xb9, 0xb5, 0x81, 0xce, 0x9d, 0xdd, 0xd3, 0xe5, 0x49, 0xae, 0x04, 0xa0, 0x98, 0x54, 0x59, 0xbd, 0xe6, 0xc6, 0x26, 0x59, 0x4e, 0x7b, 0x05, 0xdc, 0x42, 0x78, 0xb2, 0xa1, 0x46, 0x5c, 0x13, 0x68, 0x40, 0x88, 0x23, 0xc8, 0x5e, 0x96, 0xdc, 0x66, 0xc3, 0xa3, 0x09, 0x83, 0xc6, 0x39, 0x66, 0x4f, 0xc4, 0x56, 0x9a, 0x37, 0xfe, 0x21, 0xe5, 0xa1, 0x95, 0xb5, 0x77, 0x6e, 0xed, 0x2d, 0xf8, 0xd8, 0xd3, 0x61, 0xaf, 0x68, 0x6e, 0x75, 0x02, 0x29, 0xbb, 0xd6, 0x63, 0xf1, 0x61, 0x86, 0x8a, 0x50, 0x61, 0x5e, 0x0c, 0x33, 0x7b, 0xec, 0x0c, 0xa3, 0x5f, 0xec, 0x0b, 0xb1, 0x9c, 0x36, 0xeb, 0x2e, 0x0b, 0xbc, 0xc0, 0x58, 0x2f, 0xa1, 0xd9, 0x3a, 0xac, 0xdb, 0x06, 0x10, 0x63, 0xf5, 0x9f, 0x2c, 0xe1, 0xee, 0x43, 0x60, 0x5e, 0x5d, 0x89, 0xec, 0xa1, 0x83, 0xd2, 0xac, 0xdf, 0xe9, 0xf8, 0x10, 0x11, 0x02, 0x2a, 0xd3, 0xb4, 0x3a, 0x3d, 0xd4, 0x17, 0xda, 0xc9, 0x4b, 0x4e, 0x11, 0xea, 0x81, 0xb1, 0x92, 0x96, 0x6e, 0x96, 0x6b, 0x18, 0x20, 0x82, 0xe7, 0x19, 0x64, 0x60, 0x7b, 0x4f, 0x80, 0x02, 0xf3, 0x62, 0x99, 0x84, 0x4a, 0x11, 0xf2, 0xae, 0x0f, 0xae, 0xac, 0x2e, 0xae, 0x70, 0xf8, 0xf4, 0xf9, 0x80, 0x88, 0xac, 0xdc, 0xd0, 0xac, 0x55, 0x6e, 0x9f, 0xcc, 0xc5, 0x11, 0x52, 0x19, 0x08, 0xfa, 0xd2, 0x6f, 0x04, 0xc6, 0x42, 0x01, 0x45, 0x03, 0x05, 0x77, 0x87, 0x58, 0xb0, 0x53, 0x8b, 0xf8, 0xb5, 0xbb, 0x14, 0x4a, 0x82, 0x8e, 0x62, 0x97, 0x95 } + +} +, +{ + "RSAES-OAEP Encryption Example 10.3", + /* Message to be encrypted */ + 26, + { 0x51, 0x0a, 0x2c, 0xf6, 0x0e, 0x86, 0x6f, 0xa2, 0x34, 0x05, 0x53, 0xc9, 0x4e, 0xa3, 0x9f, 0xbc, 0x25, 0x63, 0x11, 0xe8, 0x3e, 0x94, 0x45, 0x4b, 0x41, 0x24 } +, + /* Seed */ + 20, + { 0x38, 0x53, 0x87, 0x51, 0x4d, 0x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59, 0x55, 0x5e, 0xe2, 0x83, 0x92, 0x0f, 0x4c, 0x8a, 0x63, 0xc4, 0xa7, 0x34, 0x0c, 0xba, 0xfd, 0xdc, 0x33, 0x9e, 0xcd, 0xb4, 0xb0, 0x51, 0x50, 0x02, 0xf9, 0x6c, 0x93, 0x2b, 0x5b, 0x79, 0x16, 0x7a, 0xf6, 0x99, 0xc0, 0xad, 0x3f, 0xcc, 0xfd, 0xf0, 0xf4, 0x4e, 0x85, 0xa7, 0x02, 0x62, 0xbf, 0x2e, 0x18, 0xfe, 0x34, 0xb8, 0x50, 0x58, 0x99, 0x75, 0xe8, 0x67, 0xff, 0x96, 0x9d, 0x48, 0xea, 0xbf, 0x21, 0x22, 0x71, 0x54, 0x6c, 0xdc, 0x05, 0xa6, 0x9e, 0xcb, 0x52, 0x6e, 0x52, 0x87, 0x0c, 0x83, 0x6f, 0x30, 0x7b, 0xd7, 0x98, 0x78, 0x0e, 0xde } + +} +, +{ + "RSAES-OAEP Encryption Example 10.4", + /* Message to be encrypted */ + 36, + { 0xbc, 0xdd, 0x19, 0x0d, 0xa3, 0xb7, 0xd3, 0x00, 0xdf, 0x9a, 0x06, 0xe2, 0x2c, 0xaa, 0xe2, 0xa7, 0x5f, 0x10, 0xc9, 0x1f, 0xf6, 0x67, 0xb7, 0xc1, 0x6b, 0xde, 0x8b, 0x53, 0x06, 0x4a, 0x26, 0x49, 0xa9, 0x40, 0x45, 0xc9 } +, + /* Seed */ + 20, + { 0x5c, 0xac, 0xa6, 0xa0, 0xf7, 0x64, 0x16, 0x1a, 0x96, 0x84, 0xf8, 0x5d, 0x92, 0xb6, 0xe0, 0xef, 0x37, 0xca, 0x8b, 0x65 } +, + /* Encryption */ + 256, + { 0x63, 0x18, 0xe9, 0xfb, 0x5c, 0x0d, 0x05, 0xe5, 0x30, 0x7e, 0x16, 0x83, 0x43, 0x6e, 0x90, 0x32, 0x93, 0xac, 0x46, 0x42, 0x35, 0x8a, 0xaa, 0x22, 0x3d, 0x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x70, 0x39, 0x09, 0x3e, 0x60, 0x6d, 0x65, 0x53, 0x65, 0xde, 0x65, 0x50, 0xb8, 0x72, 0xcd, 0x6d, 0xe1, 0xd4, 0x40, 0xee, 0x03, 0x1b, 0x61, 0x94, 0x5f, 0x62, 0x9a, 0xd8, 0xa3, 0x53, 0xb0, 0xd4, 0x09, 0x39, 0xe9, 0x6a, 0x3c, 0x45, 0x0d, 0x2a, 0x8d, 0x5e, 0xee, 0x9f, 0x67, 0x80, 0x93, 0xc8 } + +} +, +{ + "RSAES-OAEP Encryption Example 10.5", + /* Message to be encrypted */ + 23, + { 0xa7, 0xdd, 0x6c, 0x7d, 0xc2, 0x4b, 0x46, 0xf9, 0xdd, 0x5f, 0x1e, 0x91, 0xad, 0xa4, 0xc3, 0xb3, 0xdf, 0x94, 0x7e, 0x87, 0x72, 0x32, 0xa9 } +, + /* Seed */ + 20, + { 0x95, 0xbc, 0xa9, 0xe3, 0x85, 0x98, 0x94, 0xb3, 0xdd, 0x86, 0x9f, 0xa7, 0xec, 0xd5, 0xbb, 0xc6, 0x40, 0x1b, 0xf3, 0xe4 } +, + /* Encryption */ + 256, + { 0x75, 0x29, 0x08, 0x72, 0xcc, 0xfd, 0x4a, 0x45, 0x05, 0x66, 0x0d, 0x65, 0x1f, 0x56, 0xda, 0x6d, 0xaa, 0x09, 0xca, 0x13, 0x01, 0xd8, 0x90, 0x63, 0x2f, 0x6a, 0x99, 0x2f, 0x3d, 0x56, 0x5c, 0xee, 0x46, 0x4a, 0xfd, 0xed, 0x40, 0xed, 0x3b, 0x5b, 0xe9, 0x35, 0x67, 0x14, 0xea, 0x5a, 0xa7, 0x65, 0x5f, 0x4a, 0x13, 0x66, 0xc2, 0xf1, 0x7c, 0x72, 0x8f, 0x6f, 0x2c, 0x5a, 0x5d, 0x1f, 0x8e, 0x28, 0x42, 0x9b, 0xc4, 0xe6, 0xf8, 0xf2, 0xcf, 0xf8, 0xda, 0x8d, 0xc0, 0xe0, 0xa9, 0x80, 0x8e, 0x45, 0xfd, 0x09, 0xea, 0x2f, 0xa4, 0x0c, 0xb2, 0xb6, 0xce, 0x6f, 0xff, 0xf5, 0xc0, 0xe1, 0x59, 0xd1, 0x1b, 0x68, 0xd9, 0x0a, 0x85, 0xf7, 0xb8, 0x4e, 0x10, 0x3b, 0x09, 0xe6, 0x82, 0x66, 0x64, 0x80, 0xc6, 0x57, 0x50, 0x5c, 0x09, 0x29, 0x25, 0x94, 0x68, 0xa3, 0x14, 0x78, 0x6d, 0x74, 0xea, 0xb1, 0x31, 0x57, 0x3c, 0xf2, 0x34, 0xbf, 0x57, 0xdb, 0x7d, 0x9e, 0x66, 0xcc, 0x67, 0x48, 0x19, 0x2e, 0x00, 0x2d, 0xc0, 0xde, 0xea, 0x93, 0x05, 0x85, 0xf0, 0x83, 0x1f, 0xdc, 0xd9, 0xbc, 0x33, 0xd5, 0x1f, 0x79, 0xed, 0x2f, 0xfc, 0x16, 0xbc, 0xf4, 0xd5, 0x98, 0x12, 0xfc, 0xeb, 0xca, 0xa3, 0xf9, 0x06, 0x9b, 0x0e, 0x44, 0x56, 0x86, 0xd6, 0x44, 0xc2, 0x5c, 0xcf, 0x63, 0xb4, 0x56, 0xee, 0x5f, 0xa6, 0xff, 0xe9, 0x6f, 0x19, 0xcd, 0xf7, 0x51, 0xfe, 0xd9, 0xea, 0xf3, 0x59, 0x57, 0x75, 0x4d, 0xbf, 0x4b, 0xfe, 0xa5, 0x21, 0x6a, 0xa1, 0x84, 0x4d, 0xc5, 0x07, 0xcb, 0x2d, 0x08, 0x0e, 0x72, 0x2e, 0xba, 0x15, 0x03, 0x08, 0xc2, 0xb5, 0xff, 0x11, 0x93, 0x62, 0x0f, 0x17, 0x66, 0xec, 0xf4, 0x48, 0x1b, 0xaf, 0xb9, 0x43, 0xbd, 0x29, 0x28, 0x77, 0xf2, 0x13, 0x6c, 0xa4, 0x94, 0xab, 0xa0 } + +} +, +{ + "RSAES-OAEP Encryption Example 10.6", + /* Message to be encrypted */ + 45, + { 0xea, 0xf1, 0xa7, 0x3a, 0x1b, 0x0c, 0x46, 0x09, 0x53, 0x7d, 0xe6, 0x9c, 0xd9, 0x22, 0x8b, 0xbc, 0xfb, 0x9a, 0x8c, 0xa8, 0xc6, 0xc3, 0xef, 0xaf, 0x05, 0x6f, 0xe4, 0xa7, 0xf4, 0x63, 0x4e, 0xd0, 0x0b, 0x7c, 0x39, 0xec, 0x69, 0x22, 0xd7, 0xb8, 0xea, 0x2c, 0x04, 0xeb, 0xac } +, + /* Seed */ + 20, + { 0x9f, 0x47, 0xdd, 0xf4, 0x2e, 0x97, 0xee, 0xa8, 0x56, 0xa9, 0xbd, 0xbc, 0x71, 0x4e, 0xb3, 0xac, 0x22, 0xf6, 0xeb, 0x32 } +, + /* Encryption */ + 256, + { 0x2d, 0x20, 0x7a, 0x73, 0x43, 0x2a, 0x8f, 0xb4, 0xc0, 0x30, 0x51, 0xb3, 0xf7, 0x3b, 0x28, 0xa6, 0x17, 0x64, 0x09, 0x8d, 0xfa, 0x34, 0xc4, 0x7a, 0x20, 0x99, 0x5f, 0x81, 0x15, 0xaa, 0x68, 0x16, 0x67, 0x9b, 0x55, 0x7e, 0x82, 0xdb, 0xee, 0x58, 0x49, 0x08, 0xc6, 0xe6, 0x97, 0x82, 0xd7, 0xde, 0xb3, 0x4d, 0xbd, 0x65, 0xaf, 0x06, 0x3d, 0x57, 0xfc, 0xa7, 0x6a, 0x5f, 0xd0, 0x69, 0x49, 0x2f, 0xd6, 0x06, 0x8d, 0x99, 0x84, 0xd2, 0x09, 0x35, 0x05, 0x65, 0xa6, 0x2e, 0x5c, 0x77, 0xf2, 0x30, 0x38, 0xc1, 0x2c, 0xb1, 0x0c, 0x66, 0x34, 0x70, 0x9b, 0x54, 0x7c, 0x46, 0xf6, 0xb4, 0xa7, 0x09, 0xbd, 0x85, 0xca, 0x12, 0x2d, 0x74, 0x46, 0x5e, 0xf9, 0x77, 0x62, 0xc2, 0x97, 0x63, 0xe0, 0x6d, 0xbc, 0x7a, 0x9e, 0x73, 0x8c, 0x78, 0xbf, 0xca, 0x01, 0x02, 0xdc, 0x5e, 0x79, 0xd6, 0x5b, 0x97, 0x3f, 0x28, 0x24, 0x0c, 0xaa, 0xb2, 0xe1, 0x61, 0xa7, 0x8b, 0x57, 0xd2, 0x62, 0x45, 0x7e, 0xd8, 0x19, 0x5d, 0x53, 0xe3, 0xc7, 0xae, 0x9d, 0xa0, 0x21, 0x88, 0x3c, 0x6d, 0xb7, 0xc2, 0x4a, 0xfd, 0xd2, 0x32, 0x2e, 0xac, 0x97, 0x2a, 0xd3, 0xc3, 0x54, 0xc5, 0xfc, 0xef, 0x1e, 0x14, 0x6c, 0x3a, 0x02, 0x90, 0xfb, 0x67, 0xad, 0xf0, 0x07, 0x06, 0x6e, 0x00, 0x42, 0x8d, 0x2c, 0xec, 0x18, 0xce, 0x58, 0xf9, 0x32, 0x86, 0x98, 0xde, 0xfe, 0xf4, 0xb2, 0xeb, 0x5e, 0xc7, 0x69, 0x18, 0xfd, 0xe1, 0xc1, 0x98, 0xcb, 0xb3, 0x8b, 0x7a, 0xfc, 0x67, 0x62, 0x6a, 0x9a, 0xef, 0xec, 0x43, 0x22, 0xbf, 0xd9, 0x0d, 0x25, 0x63, 0x48, 0x1c, 0x9a, 0x22, 0x1f, 0x78, 0xc8, 0x27, 0x2c, 0x82, 0xd1, 0xb6, 0x2a, 0xb9, 0x14, 0xe1, 0xc6, 0x9f, 0x6a, 0xf6, 0xef, 0x30, 0xca, 0x52, 0x60, 0xdb, 0x4a, 0x46 } + +} +, +} +}, +}; + diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py index c9de56c4b..d794ab373 100755 --- a/notes/rsa-testvectors/rt.py +++ b/notes/rsa-testvectors/rt.py @@ -133,6 +133,11 @@ def __init__(self, name): self.o1 = '# Message to be signed' self.o2 = '# Salt' self.o3 = '# Signature' + elif name == 'oaep': + self.o = '# RSAES-OAEP Encryption Example' + self.o1 = '# Message to be encrypted' + self.o2 = '# Seed' + self.o3 = '# Encryption' else: raise ValueError('Type unknown: ' + name) self.name = name From c99a147d4a330d2e12daf36a9c1bb03875984a6a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 19:15:14 +0200 Subject: [PATCH 0264/1192] add testprof/pkcs_1_oaep_test --- demos/test.c | 1 + testprof/makefile | 3 +- testprof/makefile.icc | 3 +- testprof/makefile.mingw | 3 +- testprof/makefile.msvc | 2 +- testprof/makefile.shared | 3 +- testprof/pkcs_1_oaep_test.c | 69 +++++++++++++++++++++++++++++++++++++ testprof/tomcrypt_test.h | 1 + 8 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 testprof/pkcs_1_oaep_test.c diff --git a/demos/test.c b/demos/test.c index 5f95d97ca..95572782b 100644 --- a/demos/test.c +++ b/demos/test.c @@ -25,6 +25,7 @@ int main(void) printf("\nder_test......"); fflush(stdout); x = der_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_pss_test...."); fflush(stdout); x = pkcs_1_pss_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\npkcs_1_oaep_test...."); fflush(stdout); x = pkcs_1_oaep_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ndh_test......."); fflush(stdout); x = dh_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); diff --git a/testprof/makefile b/testprof/makefile index 1548926f0..a33b27d45 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -7,7 +7,8 @@ endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ +pkcs_1_pss_test.o pkcs_1_oaep_test.o ifndef LIBTEST_S LIBTEST_S=libtomcrypt_prof.a diff --git a/testprof/makefile.icc b/testprof/makefile.icc index 2dc46212a..e888496ef 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -3,7 +3,8 @@ CC?=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o pkcs_1_pss_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ +pkcs_1_pss_test.o pkcs_1_oaep_test.o ifndef LIBTEST_S LIBTEST_S = libtomcrypt_prof.a diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index 16eea6817..f1f808ac2 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -6,7 +6,8 @@ CFLAGS = $(CFLAGS_OPTS) -W -I../src/headers -I. -Wall -W OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o \ +pkcs_1_oaep_test.o default: $(LIBTEST_S) diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index dc7f81d39..093461c37 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -3,7 +3,7 @@ CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ rsa_test.obj store_test.obj test_driver.obj x86_prof.obj katja_test.obj \ -dh_test.obj misc_test.obj pkcs_1_pss_test.obj +dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj tomcrypt_prof.lib: $(OBJECTS) lib /out:tomcrypt_prof.lib $(OBJECTS) diff --git a/testprof/makefile.shared b/testprof/makefile.shared index 637ebdd91..8cd0261cc 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -8,7 +8,8 @@ CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-par OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o pkcs_1_pss_test.o +store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ +pkcs_1_pss_test.o pkcs_1_oaep_test.o ifndef LIBTEST LIBTEST=libtomcrypt_prof.la diff --git a/testprof/pkcs_1_oaep_test.c b/testprof/pkcs_1_oaep_test.c new file mode 100644 index 000000000..bb606cff0 --- /dev/null +++ b/testprof/pkcs_1_oaep_test.c @@ -0,0 +1,69 @@ +#include + +#ifdef LTC_PKCS_1 + +#include "../notes/rsa-testvectors/oaep-vect.c" + + + +int pkcs_1_oaep_test(void) +{ + int prng_idx = register_prng(&no_prng_desc); + int hash_idx = find_hash("sha1"); + unsigned int i; + + DO(prng_is_valid(prng_idx)); + DO(hash_is_valid(hash_idx)); + + for (i = 0; i < sizeof(testcases_oaep)/sizeof(testcases_oaep[0]); ++i) { + testcase_t* t = &testcases_oaep[i]; + rsa_key k, *key = &k; + DOX(mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, + &key->dP, &key->qP, &key->p, &key->q, NULL), t->name); + + DOX(mp_read_unsigned_bin(key->e, t->rsa.e, t->rsa.e_l), t->name); + DOX(mp_read_unsigned_bin(key->d, t->rsa.d, t->rsa.d_l), t->name); + DOX(mp_read_unsigned_bin(key->N, t->rsa.n, t->rsa.n_l), t->name); + DOX(mp_read_unsigned_bin(key->dQ, t->rsa.dQ, t->rsa.dQ_l), t->name); + DOX(mp_read_unsigned_bin(key->dP, t->rsa.dP, t->rsa.dP_l), t->name); + DOX(mp_read_unsigned_bin(key->qP, t->rsa.qInv, t->rsa.qInv_l), t->name); + DOX(mp_read_unsigned_bin(key->q, t->rsa.q, t->rsa.q_l), t->name); + DOX(mp_read_unsigned_bin(key->p, t->rsa.p, t->rsa.p_l), t->name); + key->type = PK_PRIVATE; + + unsigned int j; + for (j = 0; j < sizeof(t->data)/sizeof(t->data[0]); ++j) { + rsaData_t* s = &t->data[j]; + unsigned char buf[256], obuf[256]; + unsigned long buflen = sizeof(buf), obuflen = sizeof(obuf); + int stat; + prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, NULL); + DOX(rsa_encrypt_key(s->o1, s->o1_l, obuf, &obuflen, NULL, 0, NULL, prng_idx, hash_idx, key), s->name); + DOX(obuflen == (unsigned long)s->o3_l?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + DOX(memcmp(s->o3, obuf, s->o3_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + DOX(rsa_decrypt_key(obuf, obuflen, buf, &buflen, NULL, 0, hash_idx, &stat, key), s->name); + DOX(stat == 1?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + } /* for */ + + mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + } /* for */ + + unregister_prng(&no_prng_desc); + + return 0; +} + +#else + +int pkcs_1_oaep_test(void) +{ + fprintf(stderr, "NOP"); + return 0; +} + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 82a2f0e7c..36d64fd5c 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -52,6 +52,7 @@ int modes_test(void); int mac_test(void); int pkcs_1_test(void); int pkcs_1_pss_test(void); +int pkcs_1_oaep_test(void); int store_test(void); int rsa_test(void); int dh_test(void); From 95f9d527f6c96df9c9bcfcbddd4552a025975a65 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 19:26:20 +0200 Subject: [PATCH 0265/1192] rt.py: start making even more generic, fixed naming of p and q --- notes/rsa-testvectors/rt.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py index d794ab373..885912dcc 100755 --- a/notes/rsa-testvectors/rt.py +++ b/notes/rsa-testvectors/rt.py @@ -55,29 +55,29 @@ def read_part(f, s): return e class RsaKey(object): - def __init__(self, n, e, d, q, p, dP, dQ, qInv): + def __init__(self, n, e, d, p, q, dP, dQ, qInv): self.n = n self.e = e self.d = d - self.q = q self.p = p + self.q = q self.dP = dP self.dQ = dQ self.qInv = qInv def __str__(self): - return "{{\n{0},\n{1},\n{2},\n{3},\n{4},\n{5},\n{6},\n{7}\n}}\n".format(self.n, self.e, self.d, self.q, self.p, self.dP, self.dQ, self.qInv) + return "{{\n{0},\n{1},\n{2},\n{3},\n{4},\n{5},\n{6},\n{7}\n}}\n".format(self.n, self.e, self.d, self.p, self.q, self.dP, self.dQ, self.qInv) def read_key(f): - n = read_part(f, '# RSA modulus n') - e = read_part(f, '# RSA public exponent e') - d = read_part(f, '# RSA private exponent d') - q = read_part(f, '# Prime p') - p = read_part(f, '# Prime q') - dP = read_part(f, '# p\'s CRT exponent dP') - dQ = read_part(f, '# q\'s CRT exponent dQ') - qInv = read_part(f, '# CRT coefficient qInv') - k = RsaKey(n, e, d, q, p, dP, dQ, qInv) + n = read_part(f, ftype.n) + e = read_part(f, ftype.e) + d = read_part(f, ftype.d) + p = read_part(f, ftype.p) + q = read_part(f, ftype.q) + dP = read_part(f, ftype.dP) + dQ = read_part(f, ftype.dQ) + qInv = read_part(f, ftype.qInv) + k = RsaKey(n, e, d, p, q, dP, dQ, qInv) return k class Data(object): @@ -140,6 +140,15 @@ def __init__(self, name): self.o3 = '# Encryption' else: raise ValueError('Type unknown: ' + name) + if name == 'pss' or name == 'oaep': + self.n = '# RSA modulus n' + self.e = '# RSA public exponent e' + self.d = '# RSA private exponent d' + self.p = '# Prime p' + self.q = '# Prime q' + self.dP = '# p\'s CRT exponent dP' + self.dQ = '# q\'s CRT exponent dQ' + self.qInv = '# CRT coefficient qInv' self.name = name ftype = PkcsType(sys.argv[2]) From 25fcd4c70f8070720e83b41ed348f9da1dd58bcf Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 21:53:36 +0200 Subject: [PATCH 0266/1192] rt.py: add possibility to parse PKCS#1 v1.5 EMSA testvectors --- notes/rsa-testvectors/rt.py | 62 ++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py index 885912dcc..8795b0c05 100755 --- a/notes/rsa-testvectors/rt.py +++ b/notes/rsa-testvectors/rt.py @@ -17,10 +17,10 @@ def md5_for_file(path, block_size=256*128): f.close() return md5.hexdigest() -def read_until_eq(f, s): +def read_until_ends(f, s): while True: l = f.readline() - if l.strip() == s: + if l.strip().endswith(s): break return l @@ -69,6 +69,8 @@ def __str__(self): return "{{\n{0},\n{1},\n{2},\n{3},\n{4},\n{5},\n{6},\n{7}\n}}\n".format(self.n, self.e, self.d, self.p, self.q, self.dP, self.dQ, self.qInv) def read_key(f): + if ftype.version == 1: + read_until_start(f, '# Private key') n = read_part(f, ftype.n) e = read_part(f, ftype.e) d = read_part(f, ftype.d) @@ -88,13 +90,19 @@ def __init__(self, name, obj1, obj2, obj3): self.obj3 = obj3 def __str__(self): - return "{{\n \"{0}\",\n{1},\n{2},\n{3}\n}}\n,".format(self.name, self.obj1, self.obj2, self.obj3) + if self.obj3 == None: + return "{{\n \"{0}\",\n{1},\n{2}\n}}\n,".format(self.name, self.obj1, self.obj2) + else: + return "{{\n \"{0}\",\n{1},\n{2},\n{3}\n}}\n,".format(self.name, self.obj1, self.obj2, self.obj3) def read_data(f): name = read_until_start(f, ftype.o).strip().lstrip('# ') obj1 = read_part(f, ftype.o1) obj2 = read_part(f, ftype.o2) - obj3 = read_part(f, ftype.o3) + if ftype.name == 'emsa': + obj3 = None + else: + obj3 = read_part(f, ftype.o3) s = Data(name, obj1, obj2, obj3) return s @@ -114,9 +122,11 @@ def __str__(self): def read_example(f): name = read_until_start(f, '# Example').strip().lstrip('# ') key = read_key(f) - l = read_until_start(f, '#') + l = read_until_start(f, ftype.sod) d = [] - while l.strip().startswith('# --------------------------------'): + while l.strip().startswith(ftype.sod): + if ftype.version == 1: + f.seek(-len(l), os.SEEK_CUR) data = read_data(f) d.append(data) l = read_until_start(f, '#') @@ -138,9 +148,16 @@ def __init__(self, name): self.o1 = '# Message to be encrypted' self.o2 = '# Seed' self.o3 = '# Encryption' + elif name == 'emsa': + self.o = '# PKCS#1 v1.5 Signature Example' + self.o1 = '# Message to be signed' + self.o2 = '# Signature' else: raise ValueError('Type unknown: ' + name) + if name == 'pss' or name == 'oaep': + self.version = 2 + self.numcases = 6 self.n = '# RSA modulus n' self.e = '# RSA public exponent e' self.d = '# RSA private exponent d' @@ -149,6 +166,19 @@ def __init__(self, name): self.dP = '# p\'s CRT exponent dP' self.dQ = '# q\'s CRT exponent dQ' self.qInv = '# CRT coefficient qInv' + self.sod = '# --------------------------------' + elif name == 'emsa': + self.version = 1 + self.numcases = 20 + self.n = '# Modulus' + self.e = '# Public exponent' + self.d = '# Exponent' + self.p = '# Prime 1' + self.q = '# Prime 2' + self.dP = '# Prime exponent 1' + self.dQ = '# Prime exponent 2' + self.qInv = '# Coefficient' + self.sod = self.o self.name = name ftype = PkcsType(sys.argv[2]) @@ -179,26 +209,30 @@ def __init__(self, name): int o1_l; unsigned char o1[256]; int o2_l; - unsigned char o2[256]; - int o3_l; - unsigned char o3[256]; -} rsaData_t; + unsigned char o2[256];''') + +if ftype.name != 'emsa': + print(''' int o3_l; + unsigned char o3[256];''') + +print('''} rsaData_t; typedef struct testcase { const char* name; rsaKey_t rsa; - rsaData_t data[6]; + rsaData_t data[%d]; } testcase_t; testcase_t testcases_%s[] = - {''' % sys.argv[2]) + {''' % (ftype.numcases, sys.argv[2])) with open(sys.argv[1], 'rb') as f: ex = [] - while read_until_eq(f, '# ============================================='): + while read_until_ends(f, '============================================='): if f.tell() == os.path.getsize(sys.argv[1]): break - ex.append(read_example(f)) + e = read_example(f) + ex.append(e) for i in ex: print(i) From 7302a7cfcb58679f3d8462af4f9f255c78780160 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 23:48:35 +0200 Subject: [PATCH 0267/1192] add testprof/pkcs_1_emsa_test --- demos/test.c | 1 + notes/rsa-testvectors/pkcs1v15sign-vectors.c | 4227 ++++++++++++++++++ testprof/makefile | 2 +- testprof/makefile.icc | 2 +- testprof/makefile.mingw | 2 +- testprof/makefile.msvc | 3 +- testprof/makefile.shared | 2 +- testprof/pkcs_1_emsa_test.c | 65 + testprof/tomcrypt_test.h | 1 + 9 files changed, 4300 insertions(+), 5 deletions(-) create mode 100644 notes/rsa-testvectors/pkcs1v15sign-vectors.c create mode 100644 testprof/pkcs_1_emsa_test.c diff --git a/demos/test.c b/demos/test.c index 95572782b..0beb748ca 100644 --- a/demos/test.c +++ b/demos/test.c @@ -26,6 +26,7 @@ int main(void) printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_pss_test...."); fflush(stdout); x = pkcs_1_pss_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_oaep_test...."); fflush(stdout); x = pkcs_1_oaep_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\npkcs_1_emsa_test...."); fflush(stdout); x = pkcs_1_emsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ndh_test......."); fflush(stdout); x = dh_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); diff --git a/notes/rsa-testvectors/pkcs1v15sign-vectors.c b/notes/rsa-testvectors/pkcs1v15sign-vectors.c new file mode 100644 index 000000000..0d7ff6983 --- /dev/null +++ b/notes/rsa-testvectors/pkcs1v15sign-vectors.c @@ -0,0 +1,4227 @@ +/* Generated from file: pkcs1v15sign-vectors.txt + * with md5 hash: d799f020ab2fc966cae369de7ff62641 + */ + + +typedef struct rsaKey { + int n_l; + unsigned char n[256]; + int e_l; + unsigned char e[256]; + int d_l; + unsigned char d[256]; + int p_l; + unsigned char p[256]; + int q_l; + unsigned char q[256]; + int dP_l; + unsigned char dP[256]; + int dQ_l; + unsigned char dQ[256]; + int qInv_l; + unsigned char qInv[256]; +} rsaKey_t; + +typedef struct rsaData { + const char* name; + int o1_l; + unsigned char o1[256]; + int o2_l; + unsigned char o2[256]; +} rsaData_t; + +typedef struct testcase { + const char* name; + rsaKey_t rsa; + rsaData_t data[20]; +} testcase_t; + +testcase_t testcases_emsa[] = + { +{ + "Example 1: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51, 0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e, 0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a, 0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62, 0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf, 0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab, 0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d, 0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77, 0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59, 0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3, 0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f, 0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8, 0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51, 0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf, 0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe, 0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f, 0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3, 0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44, 0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10, 0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27, 0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c, 0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f, 0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e, 0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc, 0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 } +, + /* Prime 1 */ + 64, + { 0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73, 0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa, 0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96, 0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb, 0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b, 0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e, 0xda, 0x8e, 0x64, 0x43 } +, + /* Prime 2 */ + 64, + { 0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7, 0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f, 0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48, 0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba, 0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e, 0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26, 0x9a, 0x67, 0x99, 0xfd } +, + /* Prime exponent 1 */ + 64, + { 0x28, 0xfa, 0x13, 0x93, 0x86, 0x55, 0xbe, 0x1f, 0x8a, 0x15, 0x9c, 0xba, 0xca, 0x5a, 0x72, 0xea, 0x19, 0x0c, 0x30, 0x08, 0x9e, 0x19, 0xcd, 0x27, 0x4a, 0x55, 0x6f, 0x36, 0xc4, 0xf6, 0xe1, 0x9f, 0x55, 0x4b, 0x34, 0xc0, 0x77, 0x79, 0x04, 0x27, 0xbb, 0xdd, 0x8d, 0xd3, 0xed, 0xe2, 0x44, 0x83, 0x28, 0xf3, 0x85, 0xd8, 0x1b, 0x30, 0xe8, 0xe4, 0x3b, 0x2f, 0xff, 0xa0, 0x27, 0x86, 0x19, 0x79 } +, + /* Prime exponent 2 */ + 64, + { 0x1a, 0x8b, 0x38, 0xf3, 0x98, 0xfa, 0x71, 0x20, 0x49, 0x89, 0x8d, 0x7f, 0xb7, 0x9e, 0xe0, 0xa7, 0x76, 0x68, 0x79, 0x12, 0x99, 0xcd, 0xfa, 0x09, 0xef, 0xc0, 0xe5, 0x07, 0xac, 0xb2, 0x1e, 0xd7, 0x43, 0x01, 0xef, 0x5b, 0xfd, 0x48, 0xbe, 0x45, 0x5e, 0xae, 0xb6, 0xe1, 0x67, 0x82, 0x55, 0x82, 0x75, 0x80, 0xa8, 0xe4, 0xe8, 0xe1, 0x41, 0x51, 0xd1, 0x51, 0x0a, 0x82, 0xa3, 0xf2, 0xe7, 0x29 } +, + /* Coefficient */ + 64, + { 0x27, 0x15, 0x6a, 0xba, 0x41, 0x26, 0xd2, 0x4a, 0x81, 0xf3, 0xa5, 0x28, 0xcb, 0xfb, 0x27, 0xf5, 0x68, 0x86, 0xf8, 0x40, 0xa9, 0xf6, 0xe8, 0x6e, 0x17, 0xa4, 0x4b, 0x94, 0xfe, 0x93, 0x19, 0x58, 0x4b, 0x8e, 0x22, 0xfd, 0xde, 0x1e, 0x5a, 0x2e, 0x3b, 0xd8, 0xaa, 0x5b, 0xa8, 0xd8, 0x58, 0x41, 0x94, 0xeb, 0x21, 0x90, 0xac, 0xf8, 0x32, 0xb8, 0x47, 0xf1, 0x3a, 0x3d, 0x24, 0xa7, 0x9f, 0x4d } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 1.1", + /* Message to be signed */ + 217, + { 0xcd, 0xc8, 0x7d, 0xa2, 0x23, 0xd7, 0x86, 0xdf, 0x3b, 0x45, 0xe0, 0xbb, 0xbc, 0x72, 0x13, 0x26, 0xd1, 0xee, 0x2a, 0xf8, 0x06, 0xcc, 0x31, 0x54, 0x75, 0xcc, 0x6f, 0x0d, 0x9c, 0x66, 0xe1, 0xb6, 0x23, 0x71, 0xd4, 0x5c, 0xe2, 0x39, 0x2e, 0x1a, 0xc9, 0x28, 0x44, 0xc3, 0x10, 0x10, 0x2f, 0x15, 0x6a, 0x0d, 0x8d, 0x52, 0xc1, 0xf4, 0xc4, 0x0b, 0xa3, 0xaa, 0x65, 0x09, 0x57, 0x86, 0xcb, 0x76, 0x97, 0x57, 0xa6, 0x56, 0x3b, 0xa9, 0x58, 0xfe, 0xd0, 0xbc, 0xc9, 0x84, 0xe8, 0xb5, 0x17, 0xa3, 0xd5, 0xf5, 0x15, 0xb2, 0x3b, 0x8a, 0x41, 0xe7, 0x4a, 0xa8, 0x67, 0x69, 0x3f, 0x90, 0xdf, 0xb0, 0x61, 0xa6, 0xe8, 0x6d, 0xfa, 0xae, 0xe6, 0x44, 0x72, 0xc0, 0x0e, 0x5f, 0x20, 0x94, 0x57, 0x29, 0xcb, 0xeb, 0xe7, 0x7f, 0x06, 0xce, 0x78, 0xe0, 0x8f, 0x40, 0x98, 0xfb, 0xa4, 0x1f, 0x9d, 0x61, 0x93, 0xc0, 0x31, 0x7e, 0x8b, 0x60, 0xd4, 0xb6, 0x08, 0x4a, 0xcb, 0x42, 0xd2, 0x9e, 0x38, 0x08, 0xa3, 0xbc, 0x37, 0x2d, 0x85, 0xe3, 0x31, 0x17, 0x0f, 0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34, 0xcd, 0xce, 0x8e, 0xe3, 0x58, 0x94, 0xc4, 0x84, 0xd7 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.2", + /* Message to be signed */ + 51, + { 0x85, 0x13, 0x84, 0xcd, 0xfe, 0x81, 0x9c, 0x22, 0xed, 0x6c, 0x4c, 0xcb, 0x30, 0xda, 0xeb, 0x5c, 0xf0, 0x59, 0xbc, 0x8e, 0x11, 0x66, 0xb7, 0xe3, 0x53, 0x0c, 0x4c, 0x23, 0x3e, 0x2b, 0x5f, 0x8f, 0x71, 0xa1, 0xcc, 0xa5, 0x82, 0xd4, 0x3e, 0xcc, 0x72, 0xb1, 0xbc, 0xa1, 0x6d, 0xfc, 0x70, 0x13, 0x22, 0x6b, 0x9e } +, + /* Signature */ + 128, + { 0x84, 0xfd, 0x2c, 0xe7, 0x34, 0xec, 0x1d, 0xa8, 0x28, 0xd0, 0xf1, 0x5b, 0xf4, 0x9a, 0x87, 0x07, 0xc1, 0x5d, 0x05, 0x94, 0x81, 0x36, 0xde, 0x53, 0x7a, 0x3d, 0xb4, 0x21, 0x38, 0x41, 0x67, 0xc8, 0x6f, 0xae, 0x02, 0x25, 0x87, 0xee, 0x9e, 0x13, 0x7d, 0xae, 0xe7, 0x54, 0x73, 0x82, 0x62, 0x93, 0x2d, 0x27, 0x1c, 0x74, 0x4c, 0x6d, 0x3a, 0x18, 0x9a, 0xd4, 0x31, 0x1b, 0xdb, 0x02, 0x04, 0x92, 0xe3, 0x22, 0xfb, 0xdd, 0xc4, 0x04, 0x06, 0xea, 0x86, 0x0d, 0x4e, 0x8e, 0xa2, 0xa4, 0x08, 0x4a, 0xa9, 0x8b, 0x96, 0x22, 0xa4, 0x46, 0x75, 0x6f, 0xdb, 0x74, 0x0d, 0xdb, 0x3d, 0x91, 0xdb, 0x76, 0x70, 0xe2, 0x11, 0x66, 0x1b, 0xbf, 0x87, 0x09, 0xb1, 0x1c, 0x08, 0xa7, 0x07, 0x71, 0x42, 0x2d, 0x1a, 0x12, 0xde, 0xf2, 0x9f, 0x06, 0x88, 0xa1, 0x92, 0xae, 0xbd, 0x89, 0xe0, 0xf8, 0x96, 0xf8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.3", + /* Message to be signed */ + 228, + { 0xa4, 0xb1, 0x59, 0x94, 0x17, 0x61, 0xc4, 0x0c, 0x6a, 0x82, 0xf2, 0xb8, 0x0d, 0x1b, 0x94, 0xf5, 0xaa, 0x26, 0x54, 0xfd, 0x17, 0xe1, 0x2d, 0x58, 0x88, 0x64, 0x67, 0x9b, 0x54, 0xcd, 0x04, 0xef, 0x8b, 0xd0, 0x30, 0x12, 0xbe, 0x8d, 0xc3, 0x7f, 0x4b, 0x83, 0xaf, 0x79, 0x63, 0xfa, 0xff, 0x0d, 0xfa, 0x22, 0x54, 0x77, 0x43, 0x7c, 0x48, 0x01, 0x7f, 0xf2, 0xbe, 0x81, 0x91, 0xcf, 0x39, 0x55, 0xfc, 0x07, 0x35, 0x6e, 0xab, 0x3f, 0x32, 0x2f, 0x7f, 0x62, 0x0e, 0x21, 0xd2, 0x54, 0xe5, 0xdb, 0x43, 0x24, 0x27, 0x9f, 0xe0, 0x67, 0xe0, 0x91, 0x0e, 0x2e, 0x81, 0xca, 0x2c, 0xab, 0x31, 0xc7, 0x45, 0xe6, 0x7a, 0x54, 0x05, 0x8e, 0xb5, 0x0d, 0x99, 0x3c, 0xdb, 0x9e, 0xd0, 0xb4, 0xd0, 0x29, 0xc0, 0x6d, 0x21, 0xa9, 0x4c, 0xa6, 0x61, 0xc3, 0xce, 0x27, 0xfa, 0xe1, 0xd6, 0xcb, 0x20, 0xf4, 0x56, 0x4d, 0x66, 0xce, 0x47, 0x67, 0x58, 0x3d, 0x0e, 0x5f, 0x06, 0x02, 0x15, 0xb5, 0x90, 0x17, 0xbe, 0x85, 0xea, 0x84, 0x89, 0x39, 0x12, 0x7b, 0xd8, 0xc9, 0xc4, 0xd4, 0x7b, 0x51, 0x05, 0x6c, 0x03, 0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0x0a, 0xf4, 0x6f, 0xee, 0xca, 0x5b, 0x60, 0xf8, 0x82, 0x82, 0x9e, 0xe7, 0xb2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.4", + /* Message to be signed */ + 9, + { 0xbc, 0x65, 0x67, 0x47, 0xfa, 0x9e, 0xaf, 0xb3, 0xf0 } +, + /* Signature */ + 128, + { 0x45, 0x60, 0x7a, 0xd6, 0x11, 0xcf, 0x57, 0x47, 0xa4, 0x1a, 0xc9, 0x4d, 0x0f, 0xfe, 0xc8, 0x78, 0xbd, 0xaf, 0x63, 0xf6, 0xb5, 0x7a, 0x4b, 0x08, 0x8b, 0xf3, 0x6e, 0x34, 0xe1, 0x09, 0xf8, 0x40, 0xf2, 0x4b, 0x74, 0x2a, 0xda, 0x16, 0x10, 0x2d, 0xab, 0xf9, 0x51, 0xcb, 0xc4, 0x4f, 0x89, 0x82, 0xe9, 0x4e, 0xd4, 0xcd, 0x09, 0x44, 0x8d, 0x20, 0xec, 0x0e, 0xfa, 0x73, 0x54, 0x5f, 0x80, 0xb6, 0x54, 0x06, 0xbe, 0xd6, 0x19, 0x4a, 0x61, 0xc3, 0x40, 0xb4, 0xad, 0x15, 0x68, 0xcb, 0xb7, 0x58, 0x51, 0x04, 0x9f, 0x11, 0xaf, 0x17, 0x34, 0x96, 0x40, 0x76, 0xe0, 0x20, 0x29, 0xae, 0xe2, 0x00, 0xe4, 0x0e, 0x80, 0xbe, 0x0f, 0x43, 0x61, 0xf6, 0x98, 0x41, 0xc4, 0xf9, 0x2a, 0x44, 0x50, 0xa2, 0x28, 0x6d, 0x43, 0x28, 0x9b, 0x40, 0x55, 0x54, 0xc5, 0x4d, 0x25, 0xc6, 0xec, 0xb5, 0x84, 0xf4 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.5", + /* Message to be signed */ + 149, + { 0xb4, 0x55, 0x81, 0x54, 0x7e, 0x54, 0x27, 0x77, 0x0c, 0x76, 0x8e, 0x8b, 0x82, 0xb7, 0x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64, 0xf0, 0xb4, 0x3f, 0x58, 0x8c, 0xfa, 0x20, 0x5a, 0x6a, 0xb7, 0x04, 0x32, 0x8c, 0x2d, 0x4a, 0xb9, 0x2a, 0x7a, 0xe1, 0x34, 0x40, 0x61, 0x4d, 0x3e, 0x08, 0x5f, 0x40, 0x1d, 0xa9, 0xad, 0x28, 0xe2, 0x10, 0x5e, 0x4a, 0x0e, 0xdb, 0x68, 0x1a, 0x64, 0x24, 0xdf, 0x04, 0x73, 0x88, 0xce, 0x05, 0x1e, 0xe9, 0xdf, 0x7b, 0xc2, 0x16, 0x3f, 0xe3, 0x47, 0x52, 0x0a, 0xd5, 0x1c, 0xcd, 0x51, 0x80, 0x64, 0x38, 0x3e, 0x74, 0x1a, 0xca, 0xd3, 0xcb, 0xdc, 0x2c, 0xb5, 0xa7, 0xc6, 0x8e, 0x86, 0x84, 0x64, 0xc2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.6", + /* Message to be signed */ + 233, + { 0x10, 0xaa, 0xe9, 0xa0, 0xab, 0x0b, 0x59, 0x5d, 0x08, 0x41, 0x20, 0x7b, 0x70, 0x0d, 0x48, 0xd7, 0x5f, 0xae, 0xdd, 0xe3, 0xb7, 0x75, 0xcd, 0x6b, 0x4c, 0xc8, 0x8a, 0xe0, 0x6e, 0x46, 0x94, 0xec, 0x74, 0xba, 0x18, 0xf8, 0x52, 0x0d, 0x4f, 0x5e, 0xa6, 0x9c, 0xbb, 0xe7, 0xcc, 0x2b, 0xeb, 0xa4, 0x3e, 0xfd, 0xc1, 0x02, 0x15, 0xac, 0x4e, 0xb3, 0x2d, 0xc3, 0x02, 0xa1, 0xf5, 0x3d, 0xc6, 0xc4, 0x35, 0x22, 0x67, 0xe7, 0x93, 0x6c, 0xfe, 0xbf, 0x7c, 0x8d, 0x67, 0x03, 0x57, 0x84, 0xa3, 0x90, 0x9f, 0xa8, 0x59, 0xc7, 0xb7, 0xb5, 0x9b, 0x8e, 0x39, 0xc5, 0xc2, 0x34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, 0x88, 0xcb, 0x38, 0x3a, 0xaf, 0xc3, 0x69, 0x86, 0x68, 0xe7, 0xb7, 0xa5, 0x9a, 0x9c, 0xbb, 0x5b, 0x08, 0x97, 0xb6, 0xc5, 0xaf, 0xb7, 0xf8, 0xba, 0xc4, 0xb9, 0x24, 0xe9, 0x8d, 0x76, 0x0a, 0x15, 0xfc, 0x43, 0xd2, 0x81, 0x4a, 0xb2, 0xd5, 0x18, 0x7f, 0x79, 0xbe, 0xd9, 0x91, 0x5a, 0x93, 0x39, 0x7e, 0xbc, 0x22, 0xa7, 0x67, 0x75, 0x06, 0xa0, 0x2e, 0x07, 0x6d, 0x3f, 0xfd, 0xc0, 0x44, 0x1d, 0xbd, 0x4d, 0xb0, 0x04, 0x53, 0xdc, 0x28, 0xd8, 0x30, 0xe0, 0x57, 0x3f, 0x77, 0xb8, 0x17, 0xb5, 0x05, 0xc3, 0x8b, 0x4a, 0x4b, 0xb5, 0xd0 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.7", + /* Message to be signed */ + 127, + { 0xef, 0xb5, 0xda, 0x1b, 0x4d, 0x1e, 0x6d, 0x9a, 0x5d, 0xff, 0x92, 0xd0, 0x18, 0x4d, 0xa7, 0xe3, 0x1f, 0x87, 0x7d, 0x12, 0x81, 0xdd, 0xda, 0x62, 0x56, 0x64, 0x86, 0x9e, 0x83, 0x79, 0xe6, 0x7a, 0xd3, 0xb7, 0x5e, 0xae, 0x74, 0xa5, 0x80, 0xe9, 0x82, 0x7a, 0xbd, 0x6e, 0xb7, 0xa0, 0x02, 0xcb, 0x54, 0x11, 0xf5, 0x26, 0x67, 0x97, 0x76, 0x8f, 0xb8, 0xe9, 0x5a, 0xe4, 0x0e, 0x3e, 0x8b, 0x34, 0x66, 0xf5, 0xab, 0x15, 0xd6, 0x95, 0x53, 0x95, 0x29, 0x39, 0xec, 0x23, 0xe6, 0x1d, 0x58, 0x49, 0x7f, 0xac, 0x76, 0xaa, 0x1c, 0x0b, 0xb5, 0xa3, 0xcb, 0x4a, 0x54, 0x38, 0x35, 0x87, 0xc7, 0xbb, 0x78, 0xd1, 0x3e, 0xef, 0xda, 0x20, 0x54, 0x43, 0xe6, 0xce, 0x43, 0x65, 0x80, 0x2d, 0xf5, 0x5c, 0x64, 0x71, 0x34, 0x97, 0x98, 0x4e, 0x7c, 0xa9, 0x67, 0x22, 0xb3, 0xed, 0xf8, 0x4d, 0x56 } +, + /* Signature */ + 128, + { 0x83, 0x85, 0xd5, 0x85, 0x33, 0xa9, 0x95, 0xf7, 0x2d, 0xf2, 0x62, 0xb7, 0x0f, 0x40, 0xb3, 0x91, 0xdd, 0xf5, 0x15, 0xf4, 0x64, 0xb9, 0xd2, 0xcc, 0x2d, 0x66, 0x39, 0x8f, 0xc0, 0x56, 0x89, 0xd8, 0x11, 0x63, 0x29, 0x46, 0xd6, 0x2e, 0xab, 0xdc, 0xa7, 0xa3, 0x1f, 0xcf, 0x6c, 0xd6, 0xc9, 0x81, 0xd2, 0x8b, 0xbc, 0x29, 0x08, 0x3e, 0x4a, 0x6d, 0x5b, 0x2b, 0x37, 0x8c, 0xa4, 0xe5, 0x40, 0xf0, 0x60, 0xb9, 0x6d, 0x53, 0xad, 0x26, 0x93, 0xf8, 0x21, 0x78, 0xb9, 0x4e, 0x2e, 0x2f, 0x86, 0xb9, 0xac, 0xcf, 0xa0, 0x20, 0x25, 0x10, 0x7e, 0x06, 0x2a, 0xb7, 0x08, 0x01, 0x75, 0x68, 0x45, 0x01, 0x02, 0x8f, 0x67, 0x64, 0x61, 0xd8, 0x1c, 0x00, 0x8f, 0xe4, 0x75, 0x06, 0x71, 0x64, 0x99, 0x70, 0x87, 0x8f, 0xc1, 0x75, 0xcf, 0x98, 0xe9, 0x6b, 0x2e, 0xcb, 0xf6, 0x87, 0x4d, 0x77, 0xda, 0xcb } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.8", + /* Message to be signed */ + 232, + { 0x53, 0xbb, 0x58, 0xce, 0x42, 0xf1, 0x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33, 0xda, 0x2a, 0x43, 0x6d, 0x1d, 0x8f, 0xf1, 0xcc, 0x51, 0x93, 0xe2, 0xa6, 0x43, 0x89, 0xfc, 0xed, 0x91, 0x8e, 0x7f, 0xeb, 0x67, 0x16, 0x33, 0x0f, 0x66, 0x80, 0x1d, 0xb9, 0x49, 0x75, 0x49, 0xcf, 0x1d, 0x3b, 0xd9, 0x7c, 0xf1, 0xbc, 0x62, 0x55 } +, + /* Signature */ + 128, + { 0x8e, 0x1f, 0x3d, 0x26, 0xec, 0x7c, 0x6b, 0xbb, 0x8c, 0x54, 0xc5, 0xd2, 0x5f, 0x31, 0x20, 0x58, 0x78, 0x03, 0xaf, 0x6d, 0x3c, 0x2b, 0x99, 0xa3, 0x7c, 0xed, 0x6a, 0x36, 0x57, 0xd4, 0xae, 0x54, 0x26, 0x6f, 0x63, 0xff, 0xfd, 0xe6, 0x60, 0xc8, 0x66, 0xd6, 0x5d, 0x0a, 0xb0, 0x58, 0x9e, 0x1d, 0x12, 0xd9, 0xce, 0x60, 0x54, 0xb0, 0x5c, 0x86, 0x68, 0xae, 0x12, 0x71, 0x71, 0xcc, 0xaa, 0xe7, 0xf1, 0xcd, 0x40, 0x96, 0x77, 0xf5, 0x21, 0x57, 0xb6, 0x12, 0x3a, 0xb2, 0x27, 0xf2, 0x7a, 0x00, 0x96, 0x6d, 0x14, 0x39, 0xb4, 0x2a, 0x32, 0x16, 0x9d, 0x10, 0x70, 0x39, 0x40, 0x26, 0xfc, 0x8b, 0xc9, 0x35, 0x45, 0xb1, 0xac, 0x25, 0x2d, 0x0f, 0x7d, 0xa7, 0x51, 0xc0, 0x2e, 0x33, 0xa4, 0x78, 0x31, 0xfb, 0xd7, 0x15, 0x14, 0xc2, 0xbb, 0xbd, 0x3a, 0xdb, 0x67, 0x40, 0xc0, 0xfd, 0x68, 0xad } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.9", + /* Message to be signed */ + 42, + { 0x27, 0xca, 0xdc, 0x69, 0x84, 0x50, 0x94, 0x5f, 0x20, 0x4e, 0xc3, 0xcf, 0x8c, 0x6c, 0xbd, 0x8c, 0xeb, 0x4c, 0xc0, 0xcb, 0xe3, 0x12, 0x27, 0x4f, 0xa9, 0x6b, 0x04, 0xde, 0xac, 0x85, 0x51, 0x60, 0xc0, 0xe0, 0x4e, 0x4a, 0xc5, 0xd3, 0x82, 0x10, 0xc2, 0x7c } +, + /* Signature */ + 128, + { 0x7b, 0x63, 0xf9, 0x22, 0x33, 0x56, 0xf3, 0x5f, 0x61, 0x17, 0xf6, 0x8c, 0x8f, 0x82, 0x20, 0x03, 0x4f, 0xc2, 0x38, 0x4a, 0xb5, 0xdc, 0x69, 0x04, 0x14, 0x1f, 0x13, 0x93, 0x14, 0xd6, 0xee, 0x89, 0xf5, 0x4e, 0xc6, 0xff, 0xd1, 0x8c, 0x41, 0x3a, 0x23, 0xc5, 0x93, 0x1c, 0x7f, 0xbb, 0x13, 0xc5, 0x55, 0xcc, 0xfd, 0x59, 0x0e, 0x0e, 0xaa, 0x85, 0x3c, 0x8c, 0x94, 0xd2, 0x52, 0x0c, 0xd4, 0x25, 0x0d, 0x9a, 0x05, 0xa1, 0x93, 0xb6, 0x5d, 0xc7, 0x49, 0xb8, 0x24, 0x78, 0xaf, 0x01, 0x56, 0xee, 0x1d, 0xe5, 0x5d, 0xda, 0xd3, 0x3e, 0xc1, 0xf0, 0x09, 0x9c, 0xad, 0x6c, 0x89, 0x1a, 0x36, 0x17, 0xc7, 0x39, 0x3d, 0x05, 0xfb, 0xfb, 0xbb, 0x00, 0x52, 0x8a, 0x00, 0x1d, 0xf0, 0xb2, 0x04, 0xeb, 0xdf, 0x1a, 0x34, 0x10, 0x90, 0xde, 0xa8, 0x9f, 0x87, 0x0a, 0x87, 0x74, 0x58, 0x42, 0x7f, 0x7b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.10", + /* Message to be signed */ + 19, + { 0x71, 0x64, 0x07, 0xe9, 0x01, 0xb9, 0xef, 0x92, 0xd7, 0x61, 0xb0, 0x13, 0xfd, 0x13, 0xeb, 0x7a, 0xd7, 0x2a, 0xed } +, + /* Signature */ + 128, + { 0x2a, 0x22, 0xdb, 0xe3, 0x77, 0x4d, 0x5b, 0x29, 0x72, 0x01, 0xb5, 0x5a, 0x0f, 0x17, 0xf4, 0x2d, 0xce, 0x63, 0xb7, 0x84, 0x5c, 0xb3, 0x25, 0xcf, 0xe9, 0x51, 0xd0, 0xba, 0xdb, 0x5c, 0x5a, 0x14, 0x47, 0x21, 0x43, 0xd8, 0x96, 0xc8, 0x6c, 0xc3, 0x39, 0xf8, 0x36, 0x71, 0x16, 0x42, 0x15, 0xab, 0xc9, 0x78, 0x62, 0xf2, 0x15, 0x16, 0x54, 0xe7, 0x5a, 0x3b, 0x35, 0x7c, 0x37, 0x31, 0x1b, 0x3d, 0x72, 0x68, 0xca, 0xb5, 0x40, 0x20, 0x2e, 0x23, 0xbe, 0xe5, 0x27, 0x36, 0xf2, 0xcd, 0x86, 0xcc, 0xe0, 0xc7, 0xdb, 0xde, 0x95, 0xe1, 0xc6, 0x00, 0xa4, 0x73, 0x95, 0xdc, 0x5e, 0xb0, 0xa4, 0x72, 0x15, 0x3f, 0xbc, 0x4f, 0xb2, 0x1b, 0x64, 0x3e, 0x0c, 0x04, 0xae, 0x14, 0xdd, 0x37, 0xe9, 0x7e, 0x61, 0x7a, 0x75, 0x67, 0xc8, 0x96, 0x52, 0x21, 0x97, 0x81, 0x00, 0x1b, 0xa6, 0xf8, 0x32, 0x98 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.11", + /* Message to be signed */ + 206, + { 0x46, 0xc2, 0x4e, 0x41, 0x03, 0x00, 0x16, 0x29, 0xc7, 0x12, 0xdd, 0x4c, 0xe8, 0xd7, 0x47, 0xee, 0x59, 0x5d, 0x6c, 0x74, 0x4c, 0xcc, 0x4f, 0x71, 0x34, 0x7d, 0x9b, 0x8a, 0xbf, 0x49, 0xd1, 0xb8, 0xfb, 0x2e, 0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x60, 0xd4, 0x47, 0xe9, 0x23, 0xa1, 0x10, 0x51, 0xfb, 0x24, 0x30, 0x79, 0xf4, 0x46, 0xfd, 0x73, 0xa7, 0x01, 0x81, 0xd5, 0x36, 0x34, 0xd7, 0xa0, 0x96, 0x8e, 0x4e, 0xe2, 0x77, 0x77, 0xed, 0xa6, 0x3f, 0x6e, 0x4a, 0x3a, 0x91, 0xad, 0x59, 0x85, 0x99, 0x8a, 0x48, 0x48, 0xda, 0x59, 0xce, 0x69, 0x7b, 0x24, 0xbb, 0x33, 0x2f, 0xa2, 0xad, 0x9c, 0xe4, 0x62, 0xca, 0x4a, 0xff, 0xdc, 0x21, 0xda, 0xb9, 0x08, 0xe8, 0xce, 0x15, 0xaf, 0x6e, 0xb9, 0x10, 0x5b, 0x1a, 0xbc, 0xf3, 0x91, 0x42, 0xaa, 0x17, 0xb3, 0x4c, 0x4c, 0x09, 0x23, 0x86, 0xa7, 0xab, 0xbf, 0xe0, 0x28, 0xaf, 0xdb, 0xeb, 0xc1, 0x4f, 0x2c, 0xe2, 0x6f, 0xbe, 0xe5, 0xed, 0xec, 0xa1, 0x15, 0x02, 0xd3, 0x9a, 0x6b, 0x74, 0x03, 0x15, 0x48, 0x43, 0xd9, 0x8a, 0x62, 0xa7 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.12", + /* Message to be signed */ + 107, + { 0xbc, 0x99, 0xa9, 0x32, 0xaa, 0x16, 0xd6, 0x22, 0xbf, 0xff, 0x79, 0xc5, 0x0b, 0x4c, 0x42, 0x35, 0x86, 0x73, 0x26, 0x11, 0x29, 0xe2, 0x8d, 0x6a, 0x91, 0x8f, 0xf1, 0xb0, 0xf1, 0xc4, 0xf4, 0x6a, 0xd8, 0xaf, 0xa9, 0x8b, 0x0c, 0xa0, 0xf5, 0x6f, 0x96, 0x79, 0x75, 0xb0, 0xa2, 0x9b, 0xe8, 0x82, 0xe9, 0x3b, 0x6c, 0xd3, 0xfc, 0x33, 0xe1, 0xfa, 0xef, 0x72, 0xe5, 0x2b, 0x2a, 0xe0, 0xa3, 0xf1, 0x20, 0x24, 0x50, 0x6e, 0x25, 0x69, 0x0e, 0x90, 0x2e, 0x78, 0x29, 0x82, 0x14, 0x55, 0x56, 0x53, 0x22, 0x84, 0xcf, 0x50, 0x57, 0x89, 0x73, 0x8f, 0x4d, 0xa3, 0x1f, 0xa1, 0x33, 0x3d, 0x3a, 0xf8, 0x62, 0xb2, 0xba, 0x6b, 0x6c, 0xe7, 0xab, 0x4c, 0xce, 0x6a, 0xba } +, + /* Signature */ + 128, + { 0x87, 0x2e, 0xc5, 0xad, 0x4f, 0x18, 0x46, 0x25, 0x6f, 0x17, 0xe9, 0x93, 0x6a, 0xc5, 0x0e, 0x43, 0xe9, 0x96, 0x3e, 0xa8, 0xc1, 0xe7, 0x6f, 0x15, 0x87, 0x9b, 0x78, 0x74, 0xd7, 0x7d, 0x12, 0x2a, 0x60, 0x9d, 0xc8, 0xc5, 0x61, 0x14, 0x5b, 0x94, 0xbf, 0x4f, 0xfd, 0xff, 0xde, 0xb1, 0x7e, 0x6e, 0x76, 0xff, 0xc6, 0xc1, 0x0c, 0x07, 0x47, 0xf5, 0xe3, 0x7a, 0x9f, 0x43, 0x4f, 0x56, 0x09, 0xe7, 0x9d, 0xa5, 0x25, 0x02, 0x15, 0xa4, 0x57, 0xaf, 0xdf, 0x12, 0xc6, 0x50, 0x7c, 0xc1, 0x55, 0x1f, 0x54, 0xa2, 0x80, 0x10, 0x59, 0x58, 0x26, 0xa2, 0xc9, 0xb9, 0x7f, 0xa0, 0xaa, 0x85, 0x1c, 0xc6, 0x8b, 0x70, 0x5d, 0x7a, 0x06, 0xd7, 0x20, 0xba, 0x02, 0x7e, 0x4a, 0x1c, 0x0b, 0x01, 0x95, 0x00, 0xfb, 0x63, 0xb7, 0x80, 0x71, 0x68, 0x4d, 0xcf, 0xa9, 0x77, 0x27, 0x00, 0xb9, 0x82, 0xdc, 0x66 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.13", + /* Message to be signed */ + 128, + { 0x73, 0x1e, 0x17, 0x2a, 0xc0, 0x63, 0x99, 0x2c, 0x5b, 0x11, 0xba, 0x17, 0x0d, 0xfb, 0x23, 0xbb, 0x00, 0x0d, 0x47, 0xba, 0x19, 0x53, 0x29, 0xcf, 0x27, 0x80, 0x61, 0x03, 0x73, 0x81, 0x51, 0x4c, 0x14, 0x60, 0x64, 0xc5, 0x28, 0x5d, 0xb1, 0x30, 0xdd, 0x5b, 0xae, 0x98, 0xb7, 0x72, 0x22, 0x59, 0x50, 0xea, 0xb0, 0x5d, 0x3e, 0xa9, 0x96, 0xf6, 0xff, 0xfb, 0x9a, 0x8c, 0x86, 0x22, 0x91, 0x3f, 0x27, 0x99, 0x14, 0xc8, 0x9a, 0xda, 0x4f, 0x3d, 0xd7, 0x76, 0x66, 0xa8, 0x68, 0xbf, 0xcb, 0xff, 0x2b, 0x95, 0xb7, 0xda, 0xf4, 0x53, 0xd4, 0xe2, 0xc9, 0xd7, 0x5b, 0xee, 0xe7, 0xf8, 0xe7, 0x09, 0x05, 0xe4, 0x06, 0x6a, 0x4f, 0x73, 0xae, 0xcc, 0x67, 0xf9, 0x56, 0xaa, 0x5a, 0x32, 0x92, 0xb8, 0x48, 0x8c, 0x91, 0x7d, 0x31, 0x7c, 0xfd, 0xc8, 0x62, 0x53, 0xe6, 0x90, 0x38, 0x1e, 0x15, 0xab } +, + /* Signature */ + 128, + { 0x76, 0x20, 0x4e, 0xac, 0xc1, 0xd6, 0x3e, 0xc1, 0xd6, 0xad, 0x5b, 0xd0, 0x69, 0x2e, 0x1a, 0x2f, 0x68, 0x6d, 0xf6, 0xe6, 0x4c, 0xa9, 0x45, 0xc7, 0x7a, 0x82, 0x4d, 0xe2, 0x12, 0xef, 0xa6, 0xd9, 0x78, 0x2d, 0x81, 0xb4, 0x59, 0x14, 0x03, 0xff, 0x40, 0x20, 0x62, 0x02, 0x98, 0xc0, 0x7e, 0xbd, 0x3a, 0x8a, 0x61, 0xc5, 0xbf, 0x4d, 0xad, 0x62, 0xcb, 0xfc, 0x4a, 0xe6, 0xa0, 0x39, 0x37, 0xbe, 0x4b, 0x49, 0xa2, 0x16, 0xd5, 0x70, 0xfc, 0x6e, 0x81, 0x87, 0x29, 0x37, 0x87, 0x6e, 0x27, 0xbd, 0x19, 0xcf, 0x60, 0x1e, 0xff, 0xc3, 0x0d, 0xdc, 0xa5, 0x73, 0xc9, 0xd5, 0x6c, 0xd4, 0x56, 0x9b, 0xdb, 0x48, 0x51, 0xc4, 0x50, 0xc4, 0x2c, 0xb2, 0x1e, 0x73, 0x8c, 0xdd, 0x61, 0x02, 0x7b, 0x8b, 0xe5, 0xe9, 0xb4, 0x10, 0xfc, 0x46, 0xaa, 0x3f, 0x29, 0xe4, 0xbe, 0x9e, 0x64, 0x45, 0x13, 0x46 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.14", + /* Message to be signed */ + 217, + { 0x02, 0x11, 0x38, 0x26, 0x83, 0xa7, 0x4d, 0x8d, 0x2a, 0x2c, 0xb6, 0xa0, 0x65, 0x50, 0x56, 0x3b, 0xe1, 0xc2, 0x6c, 0xa6, 0x28, 0x21, 0xe4, 0xff, 0x16, 0x3b, 0x72, 0x04, 0x64, 0xfc, 0x3a, 0x28, 0xd9, 0x1b, 0xed, 0xdd, 0xc6, 0x27, 0x49, 0xa5, 0x53, 0x8e, 0xaf, 0x41, 0xfb, 0xe0, 0xc8, 0x2a, 0x77, 0xe0, 0x6a, 0xd9, 0x93, 0x83, 0xc9, 0xe9, 0x85, 0xff, 0xb8, 0xa9, 0x3f, 0xd4, 0xd7, 0xc5, 0x8d, 0xb5, 0x1a, 0xd9, 0x1b, 0xa4, 0x61, 0xd6, 0x9a, 0x8f, 0xd7, 0xdd, 0xab, 0xe2, 0x49, 0x67, 0x57, 0xa0, 0xc4, 0x91, 0x22, 0xc1, 0xa7, 0x9a, 0x85, 0xcc, 0x05, 0x53, 0xe8, 0x21, 0x4d, 0x03, 0x6d, 0xfe, 0x01, 0x85, 0xef, 0xa0, 0xd0, 0x58, 0x60, 0xc6, 0x12, 0xfa, 0x08, 0x82, 0xc8, 0x2d, 0x24, 0x6e, 0x58, 0x30, 0xa6, 0x73, 0x55, 0xdf, 0xf1, 0x8a, 0x2c, 0x36, 0xb7, 0x32, 0xf9, 0x88, 0xcf, 0xed, 0xc5, 0x62, 0x26, 0x4c, 0x62, 0x54, 0xb4, 0x0f, 0xca, 0xbb, 0x97, 0xb7, 0x60, 0x94, 0x75, 0x68, 0xdc, 0xd6, 0xa1, 0x7c, 0xda, 0x6e, 0xe8, 0x85, 0x5b, 0xdd, 0xba, 0xb9, 0x37, 0x02, 0x47, 0x1a, 0xa0, 0xcf, 0xb1, 0xbe, 0xd2, 0xe1, 0x31, 0x18, 0xeb, 0xa1, 0x17, 0x5b, 0x73, 0xc9, 0x62, 0x53, 0xc1, 0x08, 0xd0, 0xb2, 0xab, 0xa0, 0x5a, 0xb8, 0xe1, 0x7e, 0x84, 0x39, 0x2e, 0x20, 0x08, 0x5f, 0x47, 0x40, 0x4d, 0x83, 0x65, 0x52, 0x7d, 0xc3, 0xfb, 0x8f, 0x2b, 0xb4, 0x8a, 0x50, 0x03, 0x8e, 0x71, 0x36, 0x1c, 0xcf, 0x97, 0x34, 0x07 } +, + /* Signature */ + 128, + { 0x52, 0x55, 0x00, 0x91, 0x83, 0x31, 0xf1, 0x04, 0x2e, 0xae, 0x0c, 0x5c, 0x20, 0x54, 0xaa, 0x7f, 0x92, 0xde, 0xb2, 0x69, 0x91, 0xb5, 0x79, 0x66, 0x34, 0xf2, 0x29, 0xda, 0xf9, 0xb4, 0x9e, 0xb2, 0x05, 0x4d, 0x87, 0x31, 0x9f, 0x3c, 0xfa, 0x9b, 0x46, 0x6b, 0xd0, 0x75, 0xef, 0x66, 0x99, 0xae, 0xa4, 0xbd, 0x4a, 0x19, 0x5a, 0x1c, 0x52, 0x96, 0x8b, 0x5e, 0x2b, 0x75, 0xe0, 0x92, 0xd8, 0x46, 0xea, 0x1b, 0x5c, 0xc2, 0x79, 0x05, 0xa8, 0xe1, 0xd5, 0xe5, 0xde, 0x0e, 0xdf, 0xdb, 0x21, 0x39, 0x1e, 0xbb, 0x95, 0x18, 0x64, 0xeb, 0xd9, 0xf0, 0xb0, 0xec, 0x35, 0xb6, 0x54, 0x28, 0x71, 0x36, 0x0a, 0x31, 0x7b, 0x7e, 0xf1, 0x3a, 0xe0, 0x6a, 0xf6, 0x84, 0xe3, 0x8e, 0x21, 0xb1, 0xe1, 0x9b, 0xc7, 0x29, 0x8e, 0x5d, 0x6f, 0xe0, 0x01, 0x3a, 0x16, 0x4b, 0xfa, 0x25, 0xd3, 0xe7, 0x31, 0x3d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.15", + /* Message to be signed */ + 66, + { 0xfc, 0x6b, 0x70, 0x0d, 0x22, 0x58, 0x33, 0x88, 0xab, 0x2f, 0x8d, 0xaf, 0xca, 0xf1, 0xa0, 0x56, 0x20, 0x69, 0x80, 0x20, 0xda, 0x4b, 0xae, 0x44, 0xda, 0xfb, 0xd0, 0x87, 0x7b, 0x50, 0x12, 0x50, 0x6d, 0xc3, 0x18, 0x1d, 0x5c, 0x66, 0xbf, 0x02, 0x3f, 0x34, 0x8b, 0x41, 0xfd, 0x9f, 0x94, 0x79, 0x5a, 0xb9, 0x64, 0x52, 0xa4, 0x21, 0x9f, 0x2d, 0x39, 0xd7, 0x2a, 0xf3, 0x59, 0xcf, 0x19, 0x56, 0x51, 0xc7 } +, + /* Signature */ + 128, + { 0x44, 0x52, 0xa6, 0xcc, 0x26, 0x26, 0xb0, 0x1e, 0x95, 0xab, 0x30, 0x6d, 0xf0, 0xd0, 0xcc, 0x74, 0x84, 0xfb, 0xab, 0x3c, 0x22, 0xe9, 0x70, 0x32, 0x83, 0x56, 0x7f, 0x66, 0xea, 0xdc, 0x24, 0x8d, 0xbd, 0xa5, 0x8f, 0xce, 0x7d, 0xd0, 0xc7, 0x0c, 0xce, 0x3f, 0x15, 0x0f, 0xca, 0x4b, 0x36, 0x9d, 0xff, 0x3b, 0x62, 0x37, 0xe2, 0xb1, 0x62, 0x81, 0xab, 0x55, 0xb5, 0x3f, 0xb1, 0x30, 0x89, 0xc8, 0x5c, 0xd2, 0x65, 0x05, 0x6b, 0x3d, 0x62, 0xa8, 0x8b, 0xfc, 0x21, 0x35, 0xb1, 0x67, 0x91, 0xf7, 0xfb, 0xca, 0xb9, 0xfd, 0x2d, 0xc3, 0x3b, 0xec, 0xb6, 0x17, 0xbe, 0x41, 0x9d, 0x2c, 0x04, 0x61, 0x42, 0xa4, 0xd4, 0x7b, 0x33, 0x83, 0x14, 0x55, 0x2e, 0xdd, 0x4b, 0x6f, 0xe9, 0xce, 0x11, 0x04, 0xec, 0xec, 0x4a, 0x99, 0x58, 0xd7, 0x33, 0x1e, 0x93, 0x0f, 0xc0, 0x9b, 0xf0, 0x8a, 0x6e, 0x64 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.16", + /* Message to be signed */ + 169, + { 0x13, 0xba, 0x08, 0x6d, 0x70, 0x9c, 0xfa, 0x5f, 0xed, 0xaa, 0x55, 0x7a, 0x89, 0x18, 0x1a, 0x61, 0x40, 0xf2, 0x30, 0x0e, 0xd6, 0xd7, 0xc3, 0xfe, 0xbb, 0x6c, 0xf6, 0x8a, 0xbe, 0xbc, 0xbc, 0x67, 0x8f, 0x2b, 0xca, 0x3d, 0xc2, 0x33, 0x02, 0x95, 0xee, 0xc4, 0x5b, 0xb1, 0xc4, 0x07, 0x5f, 0x3a, 0xda, 0x98, 0x7e, 0xae, 0x88, 0xb3, 0x9c, 0x51, 0x60, 0x6c, 0xb8, 0x04, 0x29, 0xe6, 0x49, 0xd9, 0x8a, 0xcc, 0x84, 0x41, 0xb1, 0xf8, 0x89, 0x7d, 0xb8, 0x6c, 0x5a, 0x4c, 0xe0, 0xab, 0xf2, 0x8b, 0x1b, 0x81, 0xdc, 0xa3, 0x66, 0x76, 0x97, 0xb8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1, 0x7f, 0x0b, 0x10, 0x10, 0x31, 0x88, 0xbc, 0x64, 0xee, 0xf5, 0xa3, 0x55, 0x1b, 0x41, 0x4c, 0x73, 0x36, 0x70, 0x21, 0x5b, 0x1a, 0x22, 0x70, 0x25, 0x62, 0x58, 0x1a, 0xb1 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.17", + /* Message to be signed */ + 4, + { 0xeb, 0x1e, 0x59, 0x35 } +, + /* Signature */ + 128, + { 0x37, 0x0c, 0xb9, 0x83, 0x9a, 0xe6, 0x07, 0x4f, 0x84, 0xb2, 0xac, 0xd6, 0xe6, 0xf6, 0xb7, 0x92, 0x1b, 0x4b, 0x52, 0x34, 0x63, 0x75, 0x7f, 0x64, 0x46, 0x71, 0x61, 0x40, 0xc4, 0xe6, 0xc0, 0xe7, 0x5b, 0xec, 0x6a, 0xd0, 0x19, 0x7e, 0xbf, 0xa8, 0x6b, 0xf4, 0x6d, 0x09, 0x4f, 0x5f, 0x6c, 0xd3, 0x6d, 0xca, 0x3a, 0x5c, 0xc7, 0x3c, 0x8b, 0xbb, 0x70, 0xe2, 0xc7, 0xc9, 0xab, 0x5d, 0x96, 0x4e, 0xc8, 0xe3, 0xdf, 0xde, 0x48, 0x1b, 0x4a, 0x1b, 0xef, 0xfd, 0x01, 0xb4, 0xad, 0x15, 0xb3, 0x1a, 0xe7, 0xae, 0xbb, 0x9b, 0x70, 0x34, 0x4a, 0x94, 0x11, 0x08, 0x31, 0x65, 0xfd, 0xf9, 0xc3, 0x75, 0x4b, 0xbb, 0x8b, 0x94, 0xdd, 0x34, 0xbd, 0x48, 0x13, 0xdf, 0xad, 0xa1, 0xf6, 0x93, 0x7d, 0xe4, 0x26, 0x7d, 0x55, 0x97, 0xca, 0x09, 0xa3, 0x1e, 0x83, 0xd7, 0xf1, 0xa7, 0x9d, 0xd1, 0x9b, 0x5e } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.18", + /* Message to be signed */ + 28, + { 0x63, 0x46, 0xb1, 0x53, 0xe8, 0x89, 0xc8, 0x22, 0x82, 0x09, 0x63, 0x00, 0x71, 0xc8, 0xa5, 0x77, 0x83, 0xf3, 0x68, 0x76, 0x0b, 0x8e, 0xb9, 0x08, 0xcf, 0xc2, 0xb2, 0x76 } +, + /* Signature */ + 128, + { 0x24, 0x79, 0xc9, 0x75, 0xc5, 0xb1, 0xae, 0x4c, 0x4e, 0x94, 0x0f, 0x47, 0x3a, 0x90, 0x45, 0xb8, 0xbf, 0x5b, 0x0b, 0xfc, 0xa7, 0x8e, 0xc2, 0x9a, 0x38, 0xdf, 0xbe, 0xdc, 0x8a, 0x74, 0x9b, 0x7a, 0x26, 0x92, 0xf7, 0xc5, 0x2d, 0x5b, 0xc7, 0xc8, 0x31, 0xc7, 0x23, 0x23, 0x72, 0xa0, 0x0f, 0xed, 0x3b, 0x6b, 0x49, 0xe7, 0x60, 0xec, 0x99, 0xe0, 0x74, 0xff, 0x2e, 0xea, 0xd5, 0x13, 0x4e, 0x83, 0x05, 0x72, 0x5d, 0xfa, 0x39, 0x21, 0x2b, 0x84, 0xbd, 0x4b, 0x8d, 0x80, 0xbc, 0x8b, 0xc1, 0x7a, 0x51, 0x28, 0x23, 0xa3, 0xbe, 0xb1, 0x8f, 0xc0, 0x8e, 0x45, 0xed, 0x19, 0xc2, 0x6c, 0x81, 0x77, 0x07, 0xd6, 0x7f, 0xb0, 0x58, 0x32, 0xef, 0x1f, 0x12, 0xa3, 0x3e, 0x90, 0xcd, 0x93, 0xb8, 0xa7, 0x80, 0x31, 0x9e, 0x29, 0x63, 0xca, 0x25, 0xa2, 0xaf, 0x7b, 0x09, 0xad, 0x8f, 0x59, 0x5c, 0x21 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.19", + /* Message to be signed */ + 50, + { 0x64, 0x70, 0x2d, 0xb9, 0xf8, 0x25, 0xa0, 0xf3, 0xab, 0xc3, 0x61, 0x97, 0x46, 0x59, 0xf5, 0xe9, 0xd3, 0x0c, 0x3a, 0xa4, 0xf5, 0x6f, 0xea, 0xc6, 0x90, 0x50, 0xc7, 0x29, 0x05, 0xe7, 0x7f, 0xe0, 0xc2, 0x2f, 0x88, 0xa3, 0x78, 0xc2, 0x1f, 0xcf, 0x45, 0xfe, 0x8a, 0x5c, 0x71, 0x73, 0x02, 0x09, 0x39, 0x29 } +, + /* Signature */ + 128, + { 0x15, 0x2f, 0x34, 0x51, 0xc8, 0x58, 0xd6, 0x95, 0x94, 0xe6, 0x56, 0x7d, 0xfb, 0x31, 0x29, 0x1c, 0x1e, 0xe7, 0x86, 0x0b, 0x9d, 0x15, 0xeb, 0xd5, 0xa5, 0xed, 0xd2, 0x76, 0xac, 0x3e, 0x6f, 0x7a, 0x8d, 0x14, 0x80, 0xe4, 0x2b, 0x33, 0x81, 0xd2, 0xbe, 0x02, 0x3a, 0xcf, 0x7e, 0xbb, 0xdb, 0x28, 0xde, 0x3d, 0x21, 0x63, 0xae, 0x44, 0x25, 0x9c, 0x6d, 0xf9, 0x8c, 0x33, 0x5d, 0x04, 0x5b, 0x61, 0xda, 0xc9, 0xdb, 0xa9, 0xdb, 0xbb, 0x4e, 0x6a, 0xb4, 0xa0, 0x83, 0xcd, 0x76, 0xb5, 0x80, 0xcb, 0xe4, 0x72, 0x20, 0x6a, 0x1a, 0x9f, 0xd6, 0x06, 0x80, 0xce, 0xea, 0x1a, 0x57, 0x0a, 0x29, 0xb0, 0x88, 0x1c, 0x77, 0x5e, 0xae, 0xf5, 0x52, 0x5d, 0x6d, 0x2f, 0x34, 0x4c, 0x28, 0x83, 0x7d, 0x0a, 0xca, 0x42, 0x2b, 0xbb, 0x0f, 0x1a, 0xba, 0x8f, 0x68, 0x61, 0xae, 0x18, 0xbd, 0x73, 0xfe, 0x44 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 1.20", + /* Message to be signed */ + 43, + { 0x94, 0x19, 0x21, 0xde, 0x4a, 0x1c, 0x9c, 0x16, 0x18, 0xd6, 0xf3, 0xca, 0x3c, 0x17, 0x9f, 0x6e, 0x29, 0xba, 0xe6, 0xdd, 0xf9, 0xa6, 0xa5, 0x64, 0xf9, 0x29, 0xe3, 0xce, 0x82, 0xcf, 0x32, 0x65, 0xd7, 0x83, 0x7d, 0x5e, 0x69, 0x2b, 0xe8, 0xdc, 0xc9, 0xe8, 0x6c } +, + /* Signature */ + 128, + { 0x70, 0x76, 0xc2, 0x87, 0xfc, 0x6f, 0xff, 0x2b, 0x20, 0x53, 0x74, 0x35, 0xe5, 0xa3, 0x10, 0x7c, 0xe4, 0xda, 0x10, 0x71, 0x61, 0x86, 0xd0, 0x15, 0x39, 0x41, 0x3e, 0x60, 0x9d, 0x27, 0xd1, 0xda, 0x6f, 0xd9, 0x52, 0xc6, 0x1f, 0x4b, 0xab, 0x91, 0xc0, 0x45, 0xfa, 0x4f, 0x86, 0x83, 0xec, 0xc4, 0xf8, 0xdd, 0xe7, 0x42, 0x27, 0xf7, 0x73, 0xcf, 0xf3, 0xd9, 0x6d, 0xb8, 0x47, 0x18, 0xc4, 0x94, 0x4b, 0x06, 0xaf, 0xfe, 0xba, 0x94, 0xb7, 0x25, 0xf1, 0xb0, 0x7d, 0x39, 0x28, 0xb2, 0x49, 0x0a, 0x85, 0xc2, 0xf1, 0xab, 0xf4, 0x92, 0xa9, 0x17, 0x7a, 0x7c, 0xd2, 0xea, 0x0c, 0x96, 0x68, 0x75, 0x6f, 0x82, 0x5b, 0xbe, 0xc9, 0x00, 0xfa, 0x8a, 0xc3, 0x82, 0x4e, 0x11, 0x43, 0x87, 0xef, 0x57, 0x37, 0x80, 0xca, 0x33, 0x48, 0x82, 0x38, 0x7b, 0x94, 0xe5, 0xaa, 0xd7, 0xa2, 0x7a, 0x28, 0xdc } + +} +, +} +}, +{ + "Example 2: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xac, 0x13, 0xd9, 0xfd, 0xae, 0x7b, 0x73, 0x35, 0xb6, 0x9c, 0xd9, 0x85, 0x67, 0xe9, 0x64, 0x7d, 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xdf, 0xac, 0x96, 0xfd, 0xa9, 0xf3, 0xf7, 0x0b, 0xec, 0x4e, 0xea, 0xbc, 0xe7, 0xcd, 0x52, 0x19, 0x34, 0x3c, 0x2e, 0x49, 0x1c, 0xce, 0x82, 0x7e, 0x44, 0xee, 0x23, 0x0e, 0x4f, 0x69, 0x58, 0x9e, 0x57, 0x5a, 0xe9, 0x06, 0x30, 0x30, 0x44, 0x2a, 0x31, 0xc8, 0x2c, 0xde, 0x30, 0xdc, 0x9c, 0x79, 0xcf, 0x64, 0xe7, 0xa0, 0x97, 0x5e, 0x75, 0xe1, 0x6e, 0xa4, 0x58, 0x15, 0x48, 0x8b, 0x45, 0x52, 0x56, 0xee, 0xb1 } +, + /* Prime 1 */ + 64, + { 0xdf, 0x85, 0xf4, 0xa0, 0xb4, 0x33, 0xbd, 0x37, 0x43, 0x3c, 0xd7, 0x97, 0x8c, 0x9b, 0x37, 0xf9, 0xe4, 0x17, 0x29, 0xd8, 0x3a, 0x26, 0x2b, 0x98, 0x46, 0x53, 0x8e, 0x50, 0x39, 0xe6, 0x59, 0x68, 0xb5, 0x95, 0xa4, 0x62, 0x72, 0xbd, 0x5f, 0x4a, 0x2c, 0x3a, 0xbf, 0x89, 0x0a, 0x35, 0x50, 0x8a, 0x5b, 0xcb, 0x4c, 0x29, 0xef, 0xbd, 0x91, 0x02, 0x85, 0x03, 0x83, 0x4c, 0xfa, 0xb2, 0xc0, 0xf9 } +, + /* Prime 2 */ + 64, + { 0xc5, 0x14, 0x59, 0xa6, 0x72, 0xed, 0x8b, 0x72, 0x4c, 0x6a, 0x8f, 0x28, 0x5c, 0xbb, 0x8e, 0xa7, 0x6a, 0x23, 0x93, 0x91, 0x79, 0x28, 0xbe, 0x56, 0xc0, 0xdc, 0xdf, 0xc9, 0x43, 0xc3, 0x0b, 0xda, 0x3c, 0xee, 0xfb, 0x86, 0xdc, 0xc8, 0xc4, 0x55, 0x67, 0x8c, 0xfe, 0x88, 0x25, 0xf3, 0x88, 0x77, 0xa3, 0x72, 0x8a, 0x1f, 0x10, 0x29, 0x1f, 0x54, 0x7b, 0x1e, 0x8b, 0x16, 0x04, 0x83, 0xe5, 0xbb } +, + /* Prime exponent 1 */ + 64, + { 0xb6, 0xba, 0x83, 0xa9, 0x7c, 0xa7, 0x6f, 0x5f, 0xe6, 0x0f, 0xaf, 0x0f, 0xad, 0x5a, 0x97, 0x00, 0x2a, 0x7e, 0xe5, 0x2e, 0x67, 0x1b, 0x1d, 0x38, 0x77, 0x05, 0x87, 0xa9, 0xfe, 0x2b, 0x59, 0x9c, 0x48, 0x15, 0xf5, 0x34, 0xa6, 0x28, 0x39, 0xe6, 0x21, 0x12, 0x45, 0xd2, 0x7a, 0x0d, 0xeb, 0xb1, 0xb0, 0x29, 0x1a, 0x32, 0x8e, 0x52, 0xa2, 0x61, 0x34, 0xec, 0x12, 0x42, 0xb4, 0x0f, 0xbd, 0xc1 } +, + /* Prime exponent 2 */ + 64, + { 0xb9, 0xb1, 0xc6, 0x13, 0x2e, 0xe1, 0x22, 0x6e, 0x6d, 0x10, 0x4e, 0x99, 0x72, 0x5f, 0x0b, 0x38, 0x35, 0xab, 0x15, 0xe5, 0x91, 0x6a, 0xd1, 0x85, 0xbe, 0xad, 0x9f, 0x72, 0xed, 0x95, 0x3f, 0x7a, 0xbf, 0xc5, 0x52, 0x5c, 0xad, 0x75, 0xc2, 0x80, 0xd2, 0x54, 0x28, 0x94, 0xb2, 0x65, 0xb8, 0x65, 0x3a, 0x2d, 0xb7, 0x75, 0x33, 0x6d, 0xfb, 0xe6, 0x47, 0x27, 0xed, 0x57, 0xae, 0xa3, 0x74, 0xf7 } +, + /* Coefficient */ + 64, + { 0x7b, 0x8d, 0x15, 0xa5, 0xdd, 0x28, 0x90, 0xa6, 0x7d, 0x1b, 0x54, 0x9c, 0x93, 0x5f, 0x58, 0x5a, 0x38, 0xda, 0x56, 0xf7, 0xc8, 0x15, 0x5a, 0x51, 0x9d, 0xc8, 0xf1, 0xf6, 0xad, 0xe5, 0x53, 0xd6, 0x37, 0x93, 0xc7, 0x8a, 0x0e, 0xce, 0x8d, 0x53, 0x72, 0x4e, 0x62, 0xae, 0x50, 0x3a, 0xd5, 0x25, 0xbf, 0xaf, 0x10, 0xcf, 0x61, 0x6a, 0x47, 0x73, 0xce, 0x7c, 0xcd, 0x5c, 0x1b, 0x31, 0x51, 0xbd } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 2.1", + /* Message to be signed */ + 158, + { 0xe1, 0xc0, 0xf9, 0x8d, 0x53, 0xf8, 0xf8, 0xb1, 0x41, 0x90, 0x57, 0xd5, 0xb9, 0xb1, 0x0b, 0x07, 0xfe, 0xea, 0xec, 0x32, 0xc0, 0x46, 0x3a, 0x4d, 0x68, 0x38, 0x2f, 0x53, 0x1b, 0xa1, 0xd6, 0xcf, 0xe4, 0xed, 0x38, 0xa2, 0x69, 0x4a, 0x34, 0xb9, 0xc8, 0x05, 0xad, 0xf0, 0x72, 0xff, 0xbc, 0xeb, 0xe2, 0x1d, 0x8d, 0x4b, 0x5c, 0x0e, 0x8c, 0x33, 0x45, 0x2d, 0xd8, 0xf9, 0xc9, 0xbf, 0x45, 0xd1, 0xe6, 0x33, 0x75, 0x11, 0x33, 0x58, 0x82, 0x29, 0xd2, 0x93, 0xc6, 0x49, 0x6b, 0x7c, 0x98, 0x3c, 0x2c, 0x72, 0xbd, 0x21, 0xd3, 0x39, 0x27, 0x2d, 0x78, 0x28, 0xb0, 0xd0, 0x9d, 0x01, 0x0b, 0xba, 0xd3, 0x18, 0xd9, 0x98, 0xf7, 0x04, 0x79, 0x67, 0x33, 0x8a, 0xce, 0xfd, 0x01, 0xe8, 0x74, 0xac, 0xe5, 0xf8, 0x6d, 0x2a, 0x60, 0xf3, 0xb3, 0xca, 0xe1, 0x3f, 0xc5, 0xc6, 0x65, 0x08, 0xcf, 0xb7, 0x23, 0x78, 0xfd, 0xd6, 0xc8, 0xde, 0x24, 0x97, 0x65, 0x10, 0x3c, 0xe8, 0xfe, 0x7c, 0xd3, 0x3a, 0xd0, 0xef, 0x16, 0x86, 0xfe, 0xb2, 0x5e, 0x6a, 0x35, 0xfb, 0x64, 0xe0, 0x96, 0xa4 } +, + /* Signature */ + 128, + { 0x64, 0xac, 0x09, 0x39, 0x71, 0xf8, 0xf0, 0x96, 0xa4, 0xc1, 0xd4, 0xa5, 0x43, 0x66, 0x2a, 0x2e, 0x5a, 0x12, 0x81, 0xc9, 0x50, 0x98, 0x7d, 0xe8, 0x98, 0x70, 0x7f, 0x02, 0x9c, 0x15, 0x9b, 0xd8, 0x32, 0xca, 0xc5, 0x5d, 0x91, 0x36, 0xe0, 0xe9, 0xb4, 0xa8, 0x0b, 0xf6, 0xf2, 0x1b, 0x68, 0xcf, 0x97, 0x70, 0xa6, 0x34, 0x9a, 0xe5, 0x1e, 0x7f, 0x09, 0xdb, 0xda, 0x9d, 0x59, 0xc4, 0x58, 0x37, 0x37, 0x47, 0x2d, 0x4d, 0x65, 0x32, 0xc7, 0x17, 0x7e, 0xe9, 0x81, 0x08, 0xd2, 0xcf, 0x42, 0xcd, 0x08, 0x5a, 0xbb, 0x49, 0x22, 0xeb, 0x29, 0xd9, 0x6f, 0x3d, 0x0f, 0x6b, 0x1d, 0x0d, 0x43, 0xc7, 0x39, 0xcc, 0xf1, 0xba, 0x65, 0x16, 0x75, 0xe1, 0x96, 0x8b, 0x50, 0x7d, 0x51, 0x90, 0x2f, 0x38, 0xcd, 0xec, 0x0b, 0x61, 0x32, 0x72, 0x90, 0x45, 0x32, 0x5f, 0xc1, 0xfb, 0x8f, 0xd5, 0x58, 0xe8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.2", + /* Message to be signed */ + 177, + { 0xc1, 0x11, 0x46, 0x4e, 0x00, 0x2e, 0x4e, 0xc6, 0x18, 0xa8, 0xe2, 0x63, 0xdb, 0xcc, 0xa9, 0x1f, 0xb1, 0x8a, 0x00, 0xa1, 0x8b, 0x44, 0x0c, 0x4b, 0x55, 0x97,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0, 0xa4, 0x6a, 0x89, 0xa4, 0xeb, 0x32, 0xbd, 0xc8, 0xe7, 0xae, 0x5a, 0x53, 0xd4, 0x8a, 0xa6, 0x4b, 0xc9, 0xc3, 0xdb, 0xc8, 0xcf, 0x9c, 0xd6, 0xdc, 0x6a, 0x68, 0xfc, 0xea, 0xe9, 0xe2, 0x9f, 0x47, 0x45, 0xfa, 0x49, 0xe1, 0x8d, 0x18, 0x4d, 0xc5, 0xd2, 0x6c, 0x4f, 0xeb, 0x35, 0x1f, 0xb4, 0xb2, 0x28, 0xc4, 0xc1, 0x8c, 0xab, 0xdb, 0xde, 0x86, 0x01, 0x72, 0x4a, 0xe3, 0x80, 0x3d, 0xb3, 0x05, 0xf2, 0xa0, 0x76, 0xfa, 0x8a, 0x57, 0xf4, 0x61, 0x0b, 0x8a, 0x6e, 0x0e, 0xd4, 0x35, 0x75, 0xbe, 0x5d, 0x5b, 0xfc, 0x16, 0x30, 0x47, 0x9d, 0xf3, 0xbc, 0xbc, 0x51, 0x51, 0x77, 0xaf, 0xe4, 0x99, 0x4a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.3", + /* Message to be signed */ + 65, + { 0x29, 0xb8, 0x5b, 0x14, 0xb2, 0xda, 0x94, 0x7a, 0x4c, 0x3a, 0xd1, 0xe5, 0x93, 0x7d, 0xa1, 0x92, 0xc6, 0x05, 0x08, 0x65, 0xaf, 0x95, 0x04, 0xa5, 0x44, 0x53, 0x70, 0xe4, 0x3d, 0x3a, 0x8d, 0xa5, 0xd3, 0x55, 0xfd, 0x58, 0x76, 0x6b, 0x25, 0x43, 0xac, 0x6f, 0x93, 0x10, 0x87, 0x83, 0xc1, 0x3f, 0xf2, 0x8b, 0x2b, 0xe5, 0x60, 0x83, 0xf0, 0x29, 0x82, 0x39, 0xe0, 0xee, 0x96, 0x81, 0xee, 0x47, 0xc6 } +, + /* Signature */ + 128, + { 0x80, 0xb3, 0x8c, 0xe7, 0x35, 0x12, 0x6c, 0x85, 0x45, 0xd9, 0x1d, 0x18, 0xec, 0x90, 0x37, 0x65, 0x4d, 0x46, 0xe4, 0xf3, 0xc5, 0x1a, 0x6b, 0x86, 0x18, 0xe1, 0x5f, 0x72, 0xcd, 0x20, 0x75, 0x00, 0xa4, 0x70, 0x01, 0x75, 0x77, 0xd0, 0xa8, 0xc5, 0x5a, 0x2b, 0xa3, 0x34, 0x38, 0x3f, 0x1f, 0x8d, 0x99, 0xfc, 0xe2, 0x46, 0x0b, 0x32, 0x97, 0xbc, 0x03, 0x7e, 0xf6, 0x4a, 0xc4, 0xa3, 0x09, 0x8c, 0x6a, 0xaa, 0x24, 0xa4, 0xd0, 0x14, 0x4a, 0xf1, 0x02, 0xd0, 0xdd, 0xa1, 0x7e, 0x07, 0xdc, 0x69, 0x59, 0x23, 0x93, 0x2e, 0x56, 0x8a, 0xda, 0x00, 0xdc, 0x4f, 0x7d, 0xbf, 0xbc, 0xde, 0xc4, 0x3c, 0xc9, 0x08, 0x38, 0x80, 0x17, 0xd2, 0xee, 0xf0, 0x4e, 0x60, 0xdf, 0xe4, 0xd5, 0x73, 0x40, 0xfa, 0xb9, 0x16, 0xe2, 0xb8, 0x11, 0x24, 0x4c, 0xb1, 0xe4, 0xa5, 0x52, 0x38, 0x6f, 0xe3, 0xed, 0x4c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.4", + /* Message to be signed */ + 93, + { 0xd3, 0xb7, 0xaa, 0xd3, 0x7a, 0x48, 0x90, 0xe0, 0x36, 0x5b, 0x86, 0xc7, 0xda, 0x94, 0x91, 0xe7, 0x3c, 0xdf, 0x55, 0x5d, 0x1b, 0x02, 0xb4, 0x51, 0x81, 0x6d, 0xc5, 0x2f, 0x96, 0x30, 0xd5, 0x90, 0xde, 0x83, 0xa5, 0xc9, 0x39, 0x61, 0x01, 0x25, 0x22, 0xdf, 0xf6, 0xdb, 0xbb, 0x9c, 0xdb, 0x0e, 0x71, 0xae, 0x51, 0x40, 0x19, 0x64, 0xaf, 0x18, 0x90, 0xe8, 0x93, 0x25, 0xdb, 0xd6, 0x26, 0xf2, 0xda, 0x01, 0x34, 0x58, 0xe3, 0x9e, 0xec, 0xa5, 0x83, 0xe8, 0x9e, 0x4c, 0x08, 0xe5, 0xd4, 0x12, 0xbe, 0x49, 0x84, 0x95, 0x88, 0x6e, 0x05, 0x51, 0xcf, 0xe7, 0x42, 0xb8, 0xb5 } +, + /* Signature */ + 128, + { 0x9d, 0x8a, 0x88, 0x89, 0xa3, 0x11, 0xb4, 0x86, 0xcb, 0xe2, 0x22, 0x57, 0x03, 0xf5, 0xd4, 0xae, 0x2a, 0x54, 0xc2, 0xbc, 0xaa, 0xad, 0x06, 0xfe, 0x76, 0x48, 0xb9, 0xe2, 0xd8, 0x5e, 0xdd, 0xa1, 0xa0, 0x7d, 0x85, 0x6d, 0x6a, 0xe9, 0xbd, 0x5c, 0xc1, 0xe5, 0x15, 0x32, 0x66, 0xec, 0x7f, 0x1e, 0x1d, 0xf3, 0xd9, 0x29, 0xcc, 0x44, 0x70, 0x0f, 0xac, 0x92, 0x64, 0x58, 0x41, 0x4c, 0x28, 0x41, 0xda, 0x83, 0x32, 0x8e, 0x81, 0xe0, 0xb9, 0xd6, 0xc3, 0x88, 0x5e, 0x76, 0x73, 0x70, 0xad, 0x5c, 0xf1, 0xf5, 0x76, 0xd9, 0xdc, 0xe3, 0x48, 0xca, 0xec, 0x5e, 0x64, 0x43, 0xe0, 0xae, 0xb7, 0xc3, 0xf7, 0x2b, 0x7d, 0xd2, 0x53, 0x66, 0x70, 0x23, 0xb9, 0xa4, 0x77, 0xab, 0x34, 0xdf, 0x8f, 0x20, 0x67, 0xe2, 0x25, 0xad, 0xcb, 0x73, 0xee, 0x11, 0xe1, 0x59, 0xeb, 0x64, 0x91, 0x47, 0xd6, 0x02 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.5", + /* Message to be signed */ + 82, + { 0xf6, 0x58, 0x18, 0x8c, 0x8f, 0x9d, 0xe6, 0x0b, 0x5e, 0x99, 0xa2, 0x9f, 0x52, 0xd3, 0xb8, 0x89, 0x20, 0x1b, 0x30, 0xd4, 0x64, 0xc3, 0xb7, 0x27, 0x92, 0xa3, 0x02, 0x09, 0x5d, 0xc1, 0xe7, 0x7d, 0x45, 0xe9, 0x4f, 0x5d, 0xab, 0x73, 0xdb, 0xb3, 0x13, 0x54, 0x38, 0x57, 0xff, 0x91, 0xdb, 0xf4, 0x73, 0xdf, 0xc1, 0x45, 0xd7, 0x3b, 0xd5, 0x06, 0x20, 0x75, 0xd1, 0x92, 0xa3, 0xfb, 0xf4, 0xa1, 0x33, 0xe7, 0xe5, 0x68, 0xdf, 0x20, 0xb8, 0xcf, 0xf7, 0x7b, 0x3a, 0xf6, 0x87, 0xaa, 0x22, 0x55, 0x9e, 0xc1 } +, + /* Signature */ + 128, + { 0x0a, 0x95, 0xa4, 0x4f, 0x62, 0x74, 0xe7, 0x4c, 0xec, 0x45, 0x17, 0x96, 0xaf, 0x56, 0x88, 0xd4, 0xbe, 0x01, 0x08, 0x93, 0xfa, 0xae, 0x27, 0xd4, 0x90, 0xf4, 0x77, 0x1b, 0x00, 0x3f, 0x70, 0x46, 0xcc, 0xcd, 0x41, 0x9f, 0xc8, 0x19, 0xd7, 0x33, 0x19, 0x55, 0xf4, 0x1e, 0xac, 0x93, 0x39, 0xf5, 0x46, 0xc5, 0x84, 0xa8, 0xb4, 0x2a, 0x5a, 0xc6, 0x32, 0x90, 0x58, 0x3f, 0xf3, 0xeb, 0x6b, 0x29, 0xca, 0xdc, 0x75, 0x4a, 0xe5, 0x8d, 0x5a, 0x56, 0x37, 0xb6, 0x60, 0x97, 0x96, 0xe8, 0x05, 0x51, 0x73, 0xff, 0x20, 0xa9, 0xcc, 0xe4, 0x92, 0xfd, 0x78, 0x37, 0x46, 0x86, 0x15, 0xe8, 0x41, 0x08, 0x87, 0xf0, 0xb4, 0xa5, 0x9f, 0xf2, 0x52, 0xa8, 0x25, 0x97, 0x76, 0xc8, 0xff, 0xda, 0xa6, 0x7c, 0x87, 0xdf, 0xf8, 0x98, 0x3a, 0xe6, 0x79, 0xd1, 0xde, 0x22, 0xea, 0x15, 0x8d, 0x48, 0xf6, 0x8b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.6", + /* Message to be signed */ + 128, + { 0x31, 0xae, 0x5f, 0x83, 0xa0, 0xfb, 0x3a, 0xc9, 0x25, 0x5f, 0xfa, 0x43, 0x5f, 0x70, 0xe2, 0xab, 0x65, 0x55, 0x66, 0xe5, 0xfb, 0x8b, 0x78, 0xb8, 0x02, 0xc1, 0x87, 0xcf, 0xf1, 0xc5, 0xe4, 0x0f, 0xed, 0x06, 0x97, 0x8c, 0x5d, 0x59, 0x76, 0xeb, 0x4c, 0xa7, 0x75, 0x80, 0x63, 0x99, 0xa6, 0xfc, 0x4d, 0xb5, 0x0c, 0x1f, 0x88, 0x66, 0x1b, 0xa6, 0x8a, 0xbc, 0x21, 0xfb, 0x2c, 0xcd, 0x53, 0x7f, 0x50, 0x18, 0xf3, 0x6e, 0xd1, 0xf7, 0xd4, 0x53, 0x83, 0xfd, 0x46, 0x9e, 0x77, 0xba, 0xb3, 0xe8, 0xa9, 0x5d, 0xfa, 0x1b, 0x94, 0x1e, 0x43, 0x0d, 0xde, 0xc5, 0x52, 0xdc, 0xd8, 0x2f, 0x5d, 0x10, 0xd2, 0x9c, 0xd1, 0x0a, 0x22, 0xd1, 0x7c, 0xe2, 0x42, 0x59, 0x28, 0xff, 0x5d, 0x07, 0x10, 0xdc, 0xe7, 0xd9, 0xf8, 0x3b, 0x12, 0xe0, 0x4c, 0x1a, 0x01, 0x59, 0xc2, 0x71, 0x76, 0xe0, 0x4a, 0xcc } +, + /* Signature */ + 128, + { 0x3f, 0x11, 0xea, 0x73, 0x9f, 0x32, 0x9c, 0x9d, 0x40, 0x04, 0x60, 0x34, 0xb6, 0xc0, 0xcf, 0xce, 0xb4, 0x9b, 0xc3, 0x20, 0x1a, 0x5f, 0x25, 0xea, 0xf5, 0x01, 0x5a, 0xed, 0xed, 0x02, 0x18, 0x9c, 0xe0, 0xb0, 0xcf, 0xde, 0x19, 0x12, 0x5b, 0xd2, 0x88, 0xb7, 0xd0, 0xc0, 0x62, 0x32, 0x1a, 0x5b, 0xdc, 0x2c, 0xfa, 0x42, 0x26, 0xf5, 0x10, 0x4a, 0x1f, 0xba, 0xeb, 0xbe, 0x7f, 0x72, 0xf5, 0xf7, 0x92, 0x7e, 0x1e, 0xae, 0x26, 0xfd, 0xc5, 0xba, 0x92, 0xf2, 0xd3, 0xf8, 0x69, 0xeb, 0xc3, 0x2d, 0x90, 0x18, 0xdd, 0x04, 0xed, 0xe8, 0x6d, 0xe5, 0xc4, 0x54, 0xf1, 0xf7, 0xa1, 0xb2, 0xe2, 0xd1, 0x94, 0x0a, 0xac, 0xae, 0x27, 0x79, 0x63, 0x55, 0xfe, 0x18, 0xac, 0x80, 0x97, 0x53, 0x53, 0x92, 0x9a, 0xc6, 0xa8, 0x38, 0x45, 0x8b, 0x5d, 0x9d, 0xc7, 0x57, 0x6e, 0x38, 0x87, 0xee, 0x7b, 0xca } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.7", + /* Message to be signed */ + 256, + { 0x96, 0xff, 0x99, 0xf1, 0x50, 0x60, 0xc9, 0x73, 0xa6, 0x5b, 0x69, 0xa8, 0xb5, 0xb6, 0x3a, 0xdb, 0x33, 0x25, 0x32, 0x0d, 0xa9, 0x37, 0x29, 0x75, 0x84, 0xad, 0x4f, 0xad, 0x5c, 0x3c, 0x74, 0x69, 0x01, 0x9e, 0x9c, 0xf7, 0x2a, 0xcb, 0x31, 0x5f, 0x1e, 0x49, 0x19, 0x27, 0xbb, 0xa1, 0x94, 0x87, 0x55, 0x82, 0x3e, 0xb0, 0x7e, 0x3f, 0x20, 0xac, 0xdf, 0x78, 0x65, 0x3c, 0xae, 0x45, 0x0e, 0x47, 0xbc, 0x54, 0xba, 0xf8, 0xca, 0x11, 0x67, 0xa5, 0x05, 0x08, 0x44,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 0x18, 0x3f, 0x85, 0x3d, 0x0d, 0x03, 0x62, 0x18, 0x70, 0xe3, 0xba, 0x58, 0x68, 0x50, 0xc5, 0xea, 0x59, 0xfc, 0x4e, 0x9a, 0xcf, 0x37, 0x94, 0xb9, 0xad, 0x59, 0xa1, 0xbb, 0x80, 0x18, 0x1e, 0x77, 0xb1, 0x11, 0xd6, 0x64, 0x86, 0x47, 0xe1, 0x39, 0xa3, 0x9e, 0xc0, 0x4f, 0x86, 0x18, 0x74, 0x91, 0xe7, 0x7b, 0x4d, 0x75, 0xc0, 0x60, 0x79, 0x5b, 0xf7, 0x27, 0x08, 0x46, 0xd3, 0x96, 0xe0, 0xbf, 0xea, 0x83, 0x15, 0x79, 0x5e, 0x79, 0xd7, 0x6a, 0x91, 0x9e, 0xa7, 0x6b, 0x06, 0xee, 0xc1, 0x3b, 0xaf, 0x4c, 0xe8, 0xaf, 0xe1, 0xe3, 0x4b, 0xc2, 0x24, 0x57, 0xd7, 0xb7, 0x99, 0x2e, 0x08, 0x42, 0xef, 0xad, 0xe1, 0x79, 0xb0, 0xae, 0xda, 0xcc, 0xfb, 0xe2, 0xd2, 0x3d, 0x3e, 0xb3, 0x14, 0xe1, 0xde, 0x91, 0xc8, 0x71, 0xb9, 0xdb, 0x5a, 0xbf, 0xfb, 0x17, 0x47, 0x7f, 0xba, 0x23, 0x3a, 0x06 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.8", + /* Message to be signed */ + 179, + { 0x3a, 0x17, 0x6c, 0x79, 0x3a, 0x54, 0x6e, 0x2d, 0x27, 0x6f, 0xb8, 0xff, 0xc3, 0x28, 0x16, 0x3b, 0x49, 0x49, 0x97, 0xa5, 0x30, 0x2a, 0xae, 0x2e, 0x50, 0x45, 0xa2, 0xa2, 0x06, 0x87, 0xea, 0x6d, 0x1f, 0x18, 0x1c, 0x6a, 0xbf, 0xe6, 0x09, 0x0c, 0x8d, 0xc4, 0x02, 0x56, 0xdb, 0x3d, 0xe0, 0x83, 0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0x89, 0x33, 0x5d, 0xb0, 0x9b, 0xe7, 0x70, 0x0f, 0xb0, 0x9f, 0xdb, 0xd3, 0x40, 0x40, 0xa0, 0x0b, 0xe5, 0xca, 0x42, 0x88, 0x34, 0x77, 0xb0, 0x6e, 0x4e, 0x10, 0xa7, 0xcb, 0x11, 0x76, 0x8f, 0xcb, 0x02, 0xc3, 0x4f, 0xb1, 0x06, 0xe5, 0x22, 0x86, 0x0d, 0x10, 0x69, 0x39, 0x06, 0x26, 0x0f, 0x43, 0xd9, 0x06, 0x12, 0x99, 0x03, 0x93, 0xa8, 0xff, 0xac, 0x9f, 0xd7, 0x0c, 0xa3, 0x78, 0x29, 0x11, 0x1e, 0xeb, 0xa6, 0xf3, 0xde, 0xe5, 0x4e, 0xf1, 0xc1, 0x62, 0x68, 0xb3, 0x3e } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.9", + /* Message to be signed */ + 197, + { 0x06, 0x8a, 0x99, 0x1b, 0x32, 0xb6, 0x76, 0xc6, 0x4b, 0x89, 0x8c, 0x67, 0xe1, 0x13, 0x72, 0x82, 0xb4, 0x37, 0x11, 0xb0, 0xd0, 0x67, 0x1c, 0x24, 0x7d, 0x9f, 0x7c, 0x48, 0xf5, 0x04, 0x3e, 0x4f, 0xc2, 0x06, 0xdc, 0x65, 0xaf, 0x89, 0x06, 0xf2, 0x52, 0xf0, 0x24, 0x52, 0x05, 0xea, 0x08, 0x43, 0x23, 0xd4, 0x27, 0x6b, 0xe5, 0xaa, 0x0f, 0xc5, 0xaf, 0x9c, 0x3f, 0x34, 0xb2, 0xfd, 0x66, 0x34, 0xdf, 0x57, 0x2f, 0xc3, 0x13, 0xd2, 0x73, 0xb5, 0x3e, 0x9e, 0x36, 0xb9, 0x46, 0xe7, 0xe6, 0x72, 0xf9, 0x8d, 0x85, 0x7d, 0x7e, 0xdd, 0xd3, 0xdd, 0x04, 0x39, 0x31, 0x32, 0xf4, 0x61, 0xf2, 0x2c, 0x99, 0x00, 0x26, 0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x7b, 0xc4, 0xd0, 0x7f, 0xf4, 0x56, 0xb2, 0x43, 0x98, 0x32, 0x90, 0x8a, 0x3d, 0xcc, 0x4f, 0xc0, 0x99, 0x04, 0x72, 0xfd, 0xa3, 0xcc, 0x61, 0x11, 0x93, 0x0b, 0x99, 0x79, 0x5d, 0x60, 0xc0, 0xe3, 0x78, 0x88, 0xe8, 0x7c, 0xe0, 0x0b, 0xbf, 0x3c, 0x1c, 0xf3, 0x07, 0xf9, 0xe1 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.10", + /* Message to be signed */ + 88, + { 0xd6, 0x83, 0x9e, 0xe6, 0xd0, 0x74, 0x50, 0x32, 0x7e, 0x09, 0xa0, 0x3e, 0x1e, 0xc2, 0x80, 0xe1, 0xc8, 0xd1, 0x15, 0x00, 0xdc, 0x39, 0x0a, 0x49, 0xa9, 0xc9, 0x82, 0x87, 0x49, 0xc3, 0xe9, 0xa4, 0xbe, 0xe2, 0xba, 0x57, 0x6f, 0x6d, 0x12, 0x17, 0xa8, 0xe7, 0x85, 0x4a, 0x90, 0x7e, 0xeb, 0x93, 0xdf, 0xff, 0x92, 0x30, 0x8a, 0xd0, 0xd9, 0x4e, 0x2b, 0x38, 0x1f, 0x92, 0xb0, 0xe8, 0x4a, 0x47, 0x1b, 0xf1, 0xf3, 0x7a, 0x68, 0xe9, 0x65, 0xf6, 0x58, 0x59, 0xd1, 0xfd, 0xfd, 0x6f, 0xea, 0x84, 0x40, 0x79, 0xc4, 0x03, 0x70, 0xdc, 0xea, 0xe2 } +, + /* Signature */ + 128, + { 0xa7, 0xc5, 0xf6, 0xd0, 0xde, 0x9c, 0xf8, 0xf4, 0x17, 0x37, 0xf2, 0x3a, 0xe3, 0xe8, 0xcf, 0x60, 0x9a, 0xeb, 0xcf, 0x22, 0xd5, 0xde, 0x12, 0x13, 0xd9, 0x57, 0x3c, 0xb9, 0x44, 0x03, 0xf8, 0x9c, 0x0f, 0x70, 0x88, 0xff, 0xfc, 0x61, 0x10, 0x6f, 0xa6, 0x09, 0xc7, 0x37, 0x1a, 0x8d, 0x7e, 0x1b, 0xcd, 0x22, 0x1b, 0xc1, 0xad, 0x94, 0x91, 0x2f, 0xab, 0xf2, 0xff, 0xc0, 0x2f, 0x84, 0x84, 0x56, 0x4c, 0x22, 0x5c, 0x06, 0x9b, 0xfc, 0x6d, 0xa9, 0xf3, 0xf9, 0xf4, 0x97, 0x4e, 0x08, 0xe1, 0xfe, 0x56, 0xf7, 0x48, 0xff, 0x79, 0x05, 0x97, 0x90, 0x6a, 0x95, 0x4e, 0x38, 0x37, 0x43, 0xa3, 0x7e, 0x57, 0x5f, 0xef, 0x07, 0x4f, 0x06, 0x0f, 0x3d, 0xd1, 0x5b, 0x5e, 0xe0, 0xf9, 0x4d, 0xba, 0x69, 0xd8, 0x6c, 0x99, 0x22, 0x3f, 0xa9, 0xc3, 0xa6, 0x1a, 0x8c, 0xb2, 0xaf, 0x2f, 0xab, 0x1e, 0x04 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.11", + /* Message to be signed */ + 33, + { 0x33, 0x84, 0x9c, 0x67, 0xdf, 0x9a, 0x6f, 0xfa, 0xc3, 0xda, 0x90, 0xa8, 0xcd, 0x31, 0x73, 0x1a, 0x02, 0x97, 0xb9, 0xd6, 0x01, 0x0a, 0x03, 0x32, 0x0f, 0x88, 0x45, 0x03, 0x5f, 0xc3, 0x43, 0x09, 0xad } +, + /* Signature */ + 128, + { 0x1b, 0x87, 0x05, 0x1f, 0x15, 0x91, 0xc8, 0xae, 0x7e, 0xe3, 0xcb, 0x24, 0x26, 0x70, 0x39, 0xa7, 0x28, 0x40, 0x5d, 0xbf, 0x23, 0x1c, 0xaf, 0x21, 0xf3, 0x24, 0x7f, 0x05, 0x85, 0x8b, 0x2a, 0x51, 0x65, 0x0b, 0x81, 0xbc, 0x53, 0x77, 0x86, 0x5e, 0x4c, 0x1e, 0x8f, 0xd0, 0x36, 0x41, 0x52, 0xa1, 0x6b, 0xc5, 0x8f, 0x7d, 0x2a, 0xc0, 0x1c, 0xa6, 0x79, 0xcc, 0x49, 0xdd, 0x04, 0x89, 0x03, 0xd5, 0x5a, 0xd0, 0x5f, 0x10, 0x2c, 0x74, 0xb3, 0x60, 0x1f, 0x25, 0xad, 0x30, 0x62, 0x40, 0x25, 0xc3, 0x0b, 0x6f, 0x0f, 0x79, 0x11, 0xfc, 0x22, 0x45, 0x8e, 0x5d, 0x43, 0x5f, 0x38, 0x8e, 0x3f, 0xbc, 0x49, 0x5f, 0xa0, 0xc6, 0x10, 0xc1, 0x29, 0x8f, 0x82, 0x1d, 0xa5, 0x38, 0x40, 0x3a, 0x93, 0x36, 0x4d, 0x2e, 0xab, 0xf1, 0xe3, 0xb3, 0x2f, 0x81, 0x10, 0xa7, 0xe0, 0x3e, 0x37, 0x2e, 0xcb, 0xc5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.12", + /* Message to be signed */ + 77, + { 0xb3, 0xda, 0xba, 0xca, 0x20, 0x59, 0xa7, 0x0e, 0x25, 0xcb, 0xdd, 0xf4, 0xaa, 0x59, 0x25, 0x99, 0x57, 0x54, 0xac, 0xe4, 0x3c, 0x5d, 0x60, 0x36, 0x40, 0x48, 0x9a, 0xf4, 0x8f, 0xea, 0x6e, 0xdc, 0x4e, 0x19, 0xcb, 0xee, 0xa2, 0xc0, 0xdb, 0x62, 0xae, 0x0a, 0x10, 0x4c, 0x72, 0xe4, 0xcd, 0x56, 0xcb, 0x53, 0x2f, 0x4f, 0xe5, 0x77, 0xb3, 0x6a, 0x81, 0x98, 0xb4, 0x87, 0x9d, 0x7f, 0xf8, 0x04, 0x26, 0x90, 0xf6, 0x62, 0x77, 0x3f, 0x3d, 0x63, 0x93, 0xf2, 0x58, 0x98, 0xd2 } +, + /* Signature */ + 128, + { 0x26, 0xf1, 0x37, 0x70, 0x26, 0x3f, 0xc5, 0xbd, 0xbe, 0xad, 0xf8, 0x8f, 0xb4, 0xdd, 0x30, 0x7a, 0x38, 0x95, 0x9b, 0x16, 0xf3, 0xdf, 0x94, 0x6a, 0xde, 0x86, 0x4b, 0x1e, 0x7e, 0x91, 0x4d, 0x36, 0x4e, 0xbf, 0x9a, 0xdf, 0xd8, 0x6a, 0x70, 0x02, 0x2d, 0xc6, 0x1b, 0x43, 0xfb, 0x1f, 0xdf, 0x86, 0x96, 0x97, 0x8e, 0x2d, 0x1f, 0x6a, 0x2d, 0xef, 0xee, 0x75, 0xad, 0xaa, 0x69, 0xa3, 0x95, 0x32, 0x07, 0x40, 0x50, 0xbe, 0x70, 0x8e, 0xaf, 0x03, 0x1d, 0x5f, 0xae, 0x0f, 0xfe, 0x24, 0x5b, 0xa4, 0xff, 0x3c, 0x5e, 0x34, 0x0a, 0xf5, 0xdf, 0xec, 0x6a, 0x4c, 0xce, 0x0e, 0x18, 0x87, 0x6c, 0xfc, 0x13, 0x66, 0xee, 0xed, 0xdf, 0xce, 0x0f, 0x83, 0x5b, 0x38, 0xe8, 0x18, 0x81, 0xb1, 0xfc, 0x58, 0x32, 0x93, 0x0f, 0xc7, 0x9b, 0x08, 0xf1, 0xfb, 0x34, 0xfb, 0x22, 0x42, 0x33, 0xf4, 0xc4, 0x68 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.13", + /* Message to be signed */ + 94, + { 0x09, 0x91, 0x12, 0xfa, 0xe7, 0x40, 0x88, 0x8c, 0xea, 0xac, 0x70, 0x54, 0xd5, 0x97, 0x35, 0x1d, 0x79, 0xe1, 0x59, 0xa9, 0x58, 0xd8, 0x12, 0x15, 0x78, 0xe5, 0x2c, 0x83, 0x7d, 0xb3, 0x54, 0x3c, 0xfa, 0x6f, 0x8e, 0x7f, 0x1d, 0xbd, 0x2a, 0x61, 0x97, 0x86, 0x45, 0xa4, 0xd3, 0x85, 0xb9, 0xbb, 0x1c, 0x60, 0xbf, 0xb1, 0x1b, 0xb3, 0xc8, 0x75, 0x2a, 0xe3, 0x1f, 0x99, 0x6d, 0xbb, 0x52, 0x62, 0x8f, 0x93, 0xd5, 0x26, 0x94, 0xf1, 0x82, 0xe6, 0x90, 0x35, 0xa5, 0xe5, 0x57, 0xec, 0x71, 0x82, 0x62, 0xf4, 0x03, 0xdf, 0x52, 0x11, 0xf7, 0x3c, 0x6d, 0xe0, 0xd5, 0x5a, 0x0b, 0xa7 } +, + /* Signature */ + 128, + { 0x8d, 0x8c, 0x8f, 0x3a, 0x86, 0xf4, 0x9e, 0xdb, 0xd1, 0x25, 0xc8, 0x3e, 0xbf, 0x6d, 0x52, 0xe7, 0x65, 0x16, 0x15, 0x01, 0x48, 0x21, 0x54, 0x59, 0x8c, 0x28, 0x3a, 0xbe, 0x94, 0x02, 0x77, 0x87, 0x2b, 0x00, 0xd0, 0x77, 0x7c, 0x2e, 0x69, 0x7b, 0x78, 0x83, 0xcc, 0x32, 0x1e, 0x15, 0x1c, 0x80, 0x11, 0x6f, 0x9f, 0xcd, 0x17, 0x7a, 0xc4, 0xc7, 0xde, 0xdd, 0xf0, 0x3c, 0xa1, 0xb2, 0xc5, 0x93, 0x31, 0xdc, 0x1c, 0x8e, 0x94, 0x7f, 0x1e, 0xb2, 0xaa, 0xee, 0x8c, 0xc9, 0x41, 0xdd, 0xc5, 0xf3, 0x74, 0xa6, 0x3d, 0x6c, 0x99, 0x38, 0xec, 0xd8, 0xe8, 0x8c, 0xbc, 0xec, 0x58, 0x92, 0x9c, 0xff, 0xdd, 0xef, 0x0b, 0xa2, 0x17, 0x58, 0x85, 0xa8, 0x0d, 0xc4, 0xcd, 0x92, 0xd6, 0xb7, 0x9d, 0x9c, 0x6a, 0x81, 0x69, 0x6e, 0x16, 0xf9, 0xa8, 0x3a, 0x10, 0xca, 0x8e, 0xfa, 0xf1, 0x97, 0x5f, 0x55 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.14", + /* Message to be signed */ + 194, + { 0xaa, 0x17, 0xe6, 0xbb, 0xd6, 0xdb, 0x19, 0xe5, 0x4b, 0xee, 0x1a, 0x7f, 0x0e, 0xdc, 0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 0xa0, 0x76, 0x21, 0x4d, 0xbd, 0xdd, 0x30, 0x05, 0x5d, 0x7c, 0x56, 0x18, 0x92, 0x27, 0x9b, 0x46, 0xba, 0xb1, 0xe1, 0x22, 0x53, 0x42, 0x4c, 0x28, 0xf4, 0x49, 0xe1, 0x72, 0x64, 0x6a, 0xf3, 0x49, 0x8c, 0x7a, 0xfc, 0xbf, 0xf7, 0x68, 0xe0, 0x46, 0xa7, 0xc2, 0xe3, 0xd9, 0xc0, 0xe7, 0x12, 0x8f, 0x87, 0x7b, 0x92, 0x19, 0x5a, 0xa2, 0xbb, 0x9f, 0x1c, 0xfb, 0xdf, 0xd1, 0x5b, 0xb6, 0x5f, 0xbd, 0x23, 0xef, 0xb2, 0x94, 0xfb, 0xb1, 0x1a, 0x3c, 0x66, 0x05, 0x6d, 0x60, 0x63, 0x85, 0x3b, 0xb2, 0x3c, 0x27, 0x46, 0x65, 0xa1, 0x3e, 0xf4, 0xf3, 0xc1, 0x2f, 0x59, 0x21, 0xa4, 0x19, 0xe9, 0x49, 0xb3, 0x0c, 0x0b, 0xc0, 0xd7, 0x7d, 0x6b, 0x28, 0x69, 0x1d, 0x23, 0x64, 0xd9, 0x5b, 0xf6, 0x8b, 0xe8, 0xd5, 0x97, 0x8e, 0xf1, 0xbc, 0x98, 0x52, 0xa4, 0xf0, 0x66, 0x04, 0x47, 0x4a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.15", + /* Message to be signed */ + 141, + { 0x28, 0x24, 0x9c, 0x38, 0x7a, 0x06, 0x14, 0x40, 0xe9, 0x86, 0x38, 0xe1, 0xed, 0x78, 0xa4, 0x86, 0x51, 0x30, 0xe5, 0x75, 0x33, 0xd7, 0x89, 0x10, 0x8c, 0x63, 0xe1, 0x5f, 0xd8, 0x01, 0x9b, 0xad, 0x2c, 0xd1, 0xa7, 0x55, 0x2b, 0xd8, 0xaf, 0xd2, 0x06, 0xd9, 0x78, 0xeb, 0x1f, 0x2c, 0xf3, 0xf2, 0x3a, 0xfc, 0x4b, 0x34, 0xe6, 0xdd, 0x7f, 0x69, 0xc1, 0xfd, 0xf4, 0xfe, 0xc2, 0x52, 0x68, 0xd1, 0x86, 0x55, 0x51, 0x94, 0x49, 0x22, 0x90, 0x6d, 0xce, 0x6d, 0xc4, 0x41, 0xf9, 0x4a, 0x46, 0x6b, 0xf8, 0x39, 0x1a, 0xd8, 0x2b, 0xf5, 0x94, 0x0e, 0x44, 0x71, 0x10, 0xf1, 0xd1, 0x5d, 0xe1, 0x29, 0x31, 0x29, 0xfb, 0x44, 0x24, 0xa1, 0x71, 0x75, 0x19, 0xd6, 0xd4, 0x28, 0xd6, 0x6b, 0x7a, 0x10, 0x91, 0x42, 0xac, 0xc9, 0x15, 0xf1, 0xea, 0xc9, 0x6d, 0xef, 0x2c, 0x32, 0x90, 0xb0, 0x1d, 0x05, 0x99, 0x0b, 0xf8, 0x02, 0x3a, 0x6a, 0x64, 0x71, 0x2f, 0x63, 0x13, 0x7a, 0x8e } +, + /* Signature */ + 128, + { 0x57, 0x02, 0x06, 0x06, 0x69, 0xed, 0x47, 0xbb, 0xca, 0x11, 0xb9, 0x16, 0x68, 0x28, 0x9e, 0xa3, 0xf5, 0xe7, 0x46, 0xad, 0x2e, 0x38, 0x6d, 0xd1, 0xbc, 0x2a, 0x8b, 0xab, 0x17, 0x46, 0xba, 0x2a, 0x64, 0xbf, 0x15, 0xb3, 0xfc, 0x2e, 0xc8, 0xb0, 0xcc, 0x99, 0xd8, 0x54, 0xfa, 0x32, 0x11, 0xc9, 0x55, 0xc4, 0x55, 0xd7, 0xff, 0x2e, 0x1e, 0xe2, 0x39, 0xf5, 0x4f, 0x38, 0x6a, 0x42, 0xbb, 0x25, 0x40, 0xa8, 0x75, 0x8f, 0x32, 0x97, 0xe5, 0x52, 0xde, 0x1e, 0xbe, 0x8e, 0xac, 0x70, 0xf3, 0x54, 0x87, 0x94, 0x2b, 0xba, 0xda, 0xd5, 0xbd, 0x95, 0x73, 0x90, 0xff, 0x17, 0x93, 0xaf, 0x3d, 0x30, 0xd9, 0x36, 0xb6, 0xf7, 0x9b, 0x44, 0xa9, 0xb6, 0x3c, 0xee, 0x62, 0xd5, 0x58, 0x4d, 0xa3, 0xa1, 0xfc, 0xff, 0xa5, 0xb6, 0xfe, 0xee, 0xc1, 0x1c, 0xd6, 0x3b, 0x18, 0x0f, 0x0b, 0xfc, 0x5b, 0x6b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.16", + /* Message to be signed */ + 135, + { 0xe4, 0x91, 0xa1, 0x56, 0xfd, 0xba, 0x31, 0x6a, 0x2a, 0x20, 0xa1, 0x2e, 0xea, 0x50, 0xbe, 0x77, 0x4e, 0xc9, 0xaa, 0xbe, 0xb1, 0xc3, 0x98, 0xe9, 0x08, 0xbe, 0xa3, 0x29, 0x68, 0x21, 0x7e, 0xa4, 0x1e, 0x96, 0x6d, 0xb7, 0x27, 0x2f, 0x0e, 0xfa, 0x37, 0xc9, 0x0a, 0xe4, 0xe9, 0xf3, 0x86, 0x21, 0xa6, 0x27, 0xa9, 0xd1, 0x2c, 0x8b, 0x4e, 0x80, 0x60, 0xc5, 0x45, 0xc5, 0x60, 0x59, 0xe9, 0xe4, 0x8a, 0x7f, 0x16, 0x81, 0x36, 0x72, 0x47, 0x33, 0x58, 0x19, 0xba, 0x12, 0x7e, 0x65, 0x93, 0x1e, 0x1d, 0x9f, 0xb7, 0x0d, 0xfd, 0xdf, 0x4c, 0x99, 0x56, 0xa5, 0xb0, 0x4c, 0x52, 0xbc, 0xf8, 0xcb, 0xdf, 0xcd, 0xf2, 0x29, 0x19, 0x64, 0xda, 0xfa, 0xca, 0x7e, 0xe7, 0x0e, 0x80, 0xa2, 0x75, 0x9c, 0xec, 0x73, 0x5d, 0x01, 0xac, 0xa8, 0xff, 0x89, 0x4b, 0x68, 0x9b, 0x93, 0x78, 0x3d, 0xa8, 0x93, 0x9c, 0x62, 0x09, 0xdd, 0x68, 0x3c, 0x60 } +, + /* Signature */ + 128, + { 0x9f, 0x20, 0x5b, 0xa9, 0x0d, 0xf2, 0xd4, 0x01, 0x49, 0x26, 0x48, 0x1f, 0x9b, 0x3f, 0x45, 0xa8, 0x9d, 0x23, 0xec, 0xd8, 0x4f, 0x5f, 0x16, 0xe6, 0x73, 0x34, 0xc4, 0xca, 0xf3, 0xf3, 0xb9, 0xc2, 0x01, 0xa7, 0x98, 0xd4, 0xee, 0xc5, 0x62, 0x76, 0x59, 0x88, 0x23, 0x18, 0x0e, 0x07, 0x8d, 0x0a, 0xef, 0x4f, 0x8f, 0xba, 0x0b, 0x25, 0xc1, 0xfd, 0xa3, 0xe3, 0x36, 0x54, 0xc4, 0x74, 0xa9, 0xc1, 0x1a, 0x23, 0xb0, 0x87, 0x10, 0x91, 0x3d, 0xff, 0x76, 0x56, 0xf0, 0xe7, 0xee, 0x22, 0xcc, 0x44, 0xc9, 0x99, 0xc0, 0x95, 0xa6, 0x51, 0x4a, 0x9d, 0x2f, 0xc0, 0xca, 0x4e, 0xf2, 0x08, 0xde, 0x0d, 0x92, 0x93, 0xb0, 0xc5, 0x60, 0x8b, 0xae, 0xd1, 0x07, 0x4a, 0x0c, 0xfd, 0x57, 0xb9, 0x9e, 0xf8, 0xce, 0xab, 0xfd, 0x34, 0x72, 0xb7, 0xdb, 0x3a, 0xb9, 0x60, 0x6d, 0x13, 0xf9, 0xbb, 0x43, 0x9a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.17", + /* Message to be signed */ + 62, + { 0x06, 0xad, 0xd7, 0x5a, 0xb6, 0x89, 0xde, 0x06, 0x77, 0x44, 0xe6, 0x9a, 0x2e, 0xbd, 0x4b, 0x90, 0xfa, 0x93, 0x83, 0x00, 0x3c, 0xd0, 0x5f, 0xf5, 0x36, 0xcb, 0xf2, 0x94, 0xcd, 0x21, 0x5f, 0x09, 0x23, 0xb7, 0xfc, 0x90, 0x04, 0xf0, 0xaa, 0x18, 0x52, 0x71, 0xa1, 0xd0, 0x06, 0x1f, 0xd0, 0xe9, 0x77, 0x7a, 0xd1, 0xec, 0x0c, 0x71, 0x59, 0x1f, 0x57, 0x8b, 0xf7, 0xb8, 0xe5, 0xa1 } +, + /* Signature */ + 128, + { 0x45, 0x14, 0x21, 0x0e, 0x54, 0x1d, 0x5b, 0xad, 0x7d, 0xd6, 0x0a, 0xe5, 0x49, 0xb9, 0x43, 0xac, 0xc4, 0x4f, 0x21, 0x39, 0x0d, 0xf5, 0xb6, 0x13, 0x18, 0x45, 0x5a, 0x17, 0x61, 0x0d, 0xf5, 0xb7, 0x4d, 0x84, 0xae, 0xd2, 0x32, 0xf1, 0x7e, 0x59, 0xd9, 0x1d, 0xd2, 0x65, 0x99, 0x22, 0xf8, 0x12, 0xdb, 0xd4, 0x96, 0x81, 0x69, 0x03, 0x84, 0xb9, 0x54, 0xe9, 0xad, 0xfb, 0x9b, 0x1a, 0x96, 0x8c, 0x0c, 0xbf, 0xf7, 0x63, 0xec, 0xee, 0xd6, 0x27, 0x50, 0xc5, 0x91, 0x64, 0xb5, 0xe0, 0x80, 0xa8, 0xfe, 0xf3, 0xd5, 0x5b, 0xfe, 0x2a, 0xcf, 0xad, 0x27, 0x52, 0xa6, 0xa8, 0x45, 0x9f, 0xa1, 0xfa, 0xb4, 0x9a, 0xd3, 0x78, 0xc6, 0x96, 0x4b, 0x23, 0xee, 0x97, 0xfd, 0x10, 0x34, 0x61, 0x0c, 0x5c, 0xc1, 0x4c, 0x61, 0xe0, 0xeb, 0xfb, 0x17, 0x11, 0xf8, 0xad, 0xe9, 0x6f, 0xe6, 0x55, 0x7b, 0x38 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.18", + /* Message to be signed */ + 78, + { 0x31, 0x1c, 0x88, 0x80, 0x05, 0x35, 0xd1, 0xb4, 0xe9, 0xbc, 0x78, 0x65, 0x18, 0x31, 0xa3, 0xe9, 0x67, 0xe7, 0x4b, 0x58, 0x28, 0xe0, 0x14, 0x11, 0x5f, 0xbe, 0x5f, 0x60, 0x9c, 0xe8, 0x65, 0xfe, 0xd2, 0x41, 0x97, 0x0f, 0x87, 0x2e, 0xc8, 0xf2, 0x3d, 0xc2, 0xbf, 0x61, 0x6b, 0x80, 0x20, 0xe4, 0x45, 0x64, 0xf9, 0x34, 0xdc, 0xbf, 0x72, 0x38, 0x61, 0x70, 0x07, 0x4d, 0x92, 0x0b, 0xa8, 0x95, 0xd3, 0x3d, 0xdf, 0x27, 0x93, 0x69, 0xf2, 0x36, 0xa1, 0x9a, 0xcd, 0x4f, 0xeb, 0x2b } +, + /* Signature */ + 128, + { 0x89, 0x46, 0x63, 0xe6, 0x3e, 0xc1, 0x9f, 0x56, 0x20, 0x3f, 0x4a, 0x44, 0x6b, 0x5e, 0x2b, 0x51, 0x74, 0xc8, 0x14, 0xa5, 0x4c, 0xbe, 0xa2, 0xc8, 0xe2, 0x98, 0xf9, 0x9b, 0x34, 0xc4, 0xbb, 0xc2, 0xc8, 0xb1, 0x77, 0xba, 0x98, 0x57, 0xd8, 0x1c, 0x85, 0x44, 0x36, 0xbd, 0x99, 0xaf, 0x58, 0xc0, 0x9d, 0xde, 0x5a, 0xca, 0xd2, 0xd6, 0x41, 0x50, 0x43, 0xfb, 0x40, 0xe7, 0x84, 0x75, 0xef, 0x74, 0x01, 0x2e, 0x4d, 0x4f, 0x75, 0xb2, 0xe9, 0x58, 0x85, 0xc8, 0x51, 0xa2, 0x3b, 0x4a, 0x25, 0x54, 0x93, 0xf3, 0x0c, 0x17, 0x2e, 0xae, 0x01, 0xd4, 0x79, 0x10, 0xfa, 0xbd, 0x26, 0x9f, 0x57, 0x94, 0x0b, 0xa4, 0x43, 0x50, 0x6c, 0x05, 0x22, 0xbf, 0x72, 0x8a, 0x25, 0x7a, 0xc1, 0x07, 0x3b, 0xdf, 0x99, 0xb4, 0x29, 0x56, 0xdb, 0x00, 0x2a, 0x30, 0xa5, 0x4d, 0xbd, 0xaf, 0x28, 0x4d, 0x8f, 0x69 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.19", + /* Message to be signed */ + 28, + { 0xb2, 0x65, 0xa9, 0x77, 0x7f, 0xaa, 0xf1, 0x58, 0xa8, 0x08, 0xaa, 0xe7, 0x08, 0x5a, 0x83, 0xe7, 0x07, 0x9c, 0xef, 0x80, 0xd5, 0xfc, 0x9d, 0x7c, 0xdc, 0x96, 0x3e, 0xc9 } +, + /* Signature */ + 128, + { 0x28, 0x1e, 0x88, 0xce, 0x19, 0x0e, 0x98, 0x62, 0x90, 0x34, 0x36, 0xa8, 0x6b, 0xa4, 0x37, 0x27, 0x16, 0x44, 0x9c, 0xc0, 0xce, 0x8d, 0x55, 0x4f, 0x70, 0x2d, 0x72, 0x52, 0xa0, 0x67, 0x60, 0xaf, 0x42, 0x12, 0x1d, 0xd0, 0x9b, 0xf6, 0xea, 0x13, 0xf0, 0xeb, 0x25, 0x2e, 0xcc, 0x76, 0x42, 0x10, 0x61, 0xf5, 0x74, 0x4b, 0xd8, 0xe3, 0x2c, 0x5a, 0x8c, 0x4f, 0xc1, 0xf9, 0x52, 0x1b, 0x3f, 0x5c, 0x29, 0x14, 0x6d, 0xd0, 0x59, 0x12, 0x91, 0xac, 0xbd, 0xc5, 0xb6, 0x3b, 0x55, 0x1d, 0x22, 0x8a, 0xe5, 0x38, 0x95, 0xb1, 0x97, 0xe6, 0xe2, 0x7a, 0x70, 0x68, 0xaa, 0x31, 0x03, 0xb7, 0x0c, 0xfb, 0x30, 0xf4, 0x15, 0x84, 0x5c, 0x7e, 0x52, 0x87, 0xf1, 0x11, 0x4e, 0x4c, 0xdf, 0xb4, 0x01, 0xed, 0x51, 0x98, 0x64, 0xcf, 0x61, 0xbc, 0x46, 0x9c, 0x66, 0x69, 0x9b, 0x29, 0x60, 0xa0, 0xaf, 0xf2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 2.20", + /* Message to be signed */ + 102, + { 0x7c, 0x43, 0x9e, 0x7a, 0xb9, 0x90, 0xcd, 0xef, 0x95, 0x6c, 0x42, 0x39, 0x47, 0x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7, 0x19, 0x0b, 0x4c, 0xef, 0x86, 0x7e, 0x9c, 0xcd, 0xa8, 0xf9, 0xff, 0xc6, 0x19, 0x84, 0xfc, 0xf0, 0x5d, 0x4f, 0xba, 0xfe, 0x10, 0x7d, 0xac, 0xf5, 0xb1, 0xdc, 0x8e, 0x2b, 0x14, 0x95, 0xb2, 0x44, 0xf8, 0xe7 } + +} +, +} +}, +{ + "Example 3: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xb5, 0xd7, 0x07, 0xb7, 0x92, 0xe0, 0x56, 0xf7, 0x2f, 0xd7, 0x6d, 0x8d, 0xa8, 0x89, 0xa5, 0x3c, 0xe4, 0xd8, 0xeb, 0xaa, 0x08, 0x2a, 0xee, 0xb2, 0x30, 0x32, 0xe3, 0xc5, 0xd8, 0xeb, 0xc4, 0xc1, 0x55, 0x61, 0x31, 0x9b, 0xe8, 0xdf, 0xe1, 0x88, 0x99, 0x1a, 0x89, 0x51, 0xd4, 0xb2, 0x3a, 0x51, 0xe8, 0xa9, 0x38, 0x2c, 0x80, 0x5e, 0x4c, 0xfd, 0x49, 0x0e, 0xbb, 0xce, 0xaa, 0x20, 0x80, 0x2a, 0xd6, 0x83, 0xb0, 0x5a, 0x10, 0x0f, 0x29, 0x98, 0x5f, 0x01, 0x1c, 0x3c, 0x8a, 0x44, 0x26, 0x25, 0x52, 0xd8, 0x3d, 0x9a, 0x1b, 0x7c, 0x27, 0x31, 0x5e, 0x14, 0x4a, 0xd8, 0xdf, 0x5c, 0xbe, 0x8b, 0xc6, 0x40, 0x0f, 0xd9, 0xcb, 0xe7, 0x6b, 0x74, 0x21, 0xd7, 0x08, 0xaa, 0x64, 0xf0, 0x40, 0xba, 0xe0, 0x7b, 0x7b, 0xd6, 0xf9, 0x22, 0x18, 0xf9, 0xa7, 0x29, 0x28, 0x4c, 0xc5, 0x98, 0xcd, 0xd1 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x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x69, 0x02, 0x5b, 0xb9, 0xb2, 0xd9, 0xd6, 0xfe, 0x67, 0xb7 } +, + /* Prime 2 */ + 64, + { 0xb6, 0x14, 0x37, 0x8d, 0x5e, 0x3d, 0xa5, 0xa8, 0x0a, 0x6d, 0x73, 0x52, 0xfc, 0x66, 0xa5, 0x64, 0x59, 0x7b, 0x06, 0x8f, 0xc9, 0xd3, 0xaf, 0x5d, 0xb0, 0xe4, 0xe7, 0x35, 0xbe, 0xf8, 0x81, 0xdd, 0x40, 0x17, 0xee, 0x70, 0x82, 0x96, 0x19, 0x0b, 0x6f, 0xdc, 0x84, 0x04, 0xf0, 0x7b, 0xd9, 0xdc, 0x5c, 0xd5, 0xd2, 0xbe, 0x48, 0x86, 0xa7, 0xcb, 0xbc, 0xb2, 0x1d, 0x8c, 0x3d, 0x64, 0xa6, 0xb7 } +, + /* Prime exponent 1 */ + 64, + { 0x51, 0x0e, 0x68, 0x96, 0x0d, 0x70, 0x11, 0x32, 0x51, 0x23, 0xae, 0xd5, 0xf5, 0x00, 0x18, 0x6b, 0x64, 0xc8, 0x52, 0x6e, 0x22, 0xb5, 0xd0, 0x69, 0x06, 0x48, 0x00, 0xf4, 0x79, 0x85, 0xb4, 0x7b, 0x89, 0xfb, 0xfc, 0xa8, 0xd6, 0xd9, 0x72, 0x92, 0x01, 0xbb, 0xfb, 0xb6, 0x8a, 0x18, 0x2e, 0xb4, 0x96, 0xaa, 0x49, 0x17, 0x8d, 0x77, 0x45, 0x6d, 0xb3, 0xfb, 0x1a, 0x13, 0x2a, 0xb0, 0x99, 0xdd } +, + /* Prime exponent 2 */ + 64, + { 0x57, 0xeb, 0xbf, 0x3f, 0x76, 0x48, 0x52, 0x5b, 0xa8, 0x5d, 0x5d, 0x98, 0xae, 0xe4, 0x69, 0xec, 0xe1, 0x00, 0x75, 0x14, 0xad, 0xa2, 0x98, 0x45, 0xa7, 0x8b, 0x80, 0xd2, 0x05, 0x1b, 0x3e, 0xaa, 0x35, 0xae, 0xd8, 0xa6, 0x5f, 0x88, 0x57, 0x23, 0x9c, 0xaa, 0x60, 0xdd, 0x79, 0xba, 0x74, 0x62, 0xe2, 0x39, 0x26, 0x00, 0x58, 0x49, 0x1d, 0x71, 0x55, 0xf6, 0xb4, 0x29, 0xe9, 0xe3, 0x56, 0x55 } +, + /* Coefficient */ + 64, + { 0xee, 0x10, 0x7d, 0xc7, 0xef, 0xec, 0xe9, 0xa6, 0x5c, 0x0e, 0x87, 0x78, 0x9a, 0xf5, 0x59, 0x0c, 0x93, 0x83, 0x9d, 0xfe, 0x82, 0x85, 0x20, 0xda, 0x17, 0x74, 0xff, 0x80, 0xf7, 0xe5, 0x14, 0x55, 0x7f, 0xff, 0x10, 0xbd, 0x8c, 0xae, 0x18, 0x46, 0xef, 0xee, 0x7c, 0x10, 0xd7, 0xa1, 0x2c, 0x4a, 0x05, 0x5c, 0xc1, 0x36, 0xe4, 0xa4, 0xef, 0x25, 0xfd, 0x3e, 0xd9, 0xd0, 0xcd, 0xdf, 0x74, 0xf9 } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 3.1", + /* Message to be signed */ + 82, + { 0x98, 0x6e, 0x7c, 0x43, 0xdb, 0xb6, 0x71, 0xbd, 0x41, 0xb9, 0xa7, 0xf4, 0xb6, 0xaf, 0xc8, 0x0e, 0x80, 0x5f, 0x24, 0x23, 0x48, 0x8f, 0xb4, 0x31, 0xf5, 0xee, 0x79, 0x2b, 0x6c, 0x2a, 0xc7, 0xdb, 0x53, 0xcc, 0x42, 0x86, 0x55, 0xae, 0xb3, 0x2d, 0x03, 0xf4, 0xe8, 0x89, 0xc5, 0xc2, 0x5d, 0xe6, 0x83, 0xc4, 0x61, 0xb5, 0x3a, 0xcf, 0x89, 0xf9, 0xf8, 0xd3, 0xaa, 0xbd, 0xf6, 0xb9, 0xf0, 0xc2, 0xa1, 0xde, 0x12, 0xe1, 0x5b, 0x49, 0xed, 0xb3, 0x91, 0x9a, 0x65, 0x2f, 0xe9, 0x49, 0x1c, 0x25, 0xa7, 0xfc } +, + /* Signature */ + 128, + { 0x62, 0x75, 0xe8, 0x73, 0x97, 0xe3, 0x09, 0x2a, 0xab, 0x36, 0x98, 0xbb, 0x1b, 0x5c, 0xf2, 0x4b, 0x8c, 0xd7, 0x71, 0x2b, 0xec, 0xac, 0x35, 0xe3, 0x22, 0x03, 0xd5, 0x43, 0x14, 0xe5, 0x47, 0x0e, 0xa9, 0xaa, 0xbc, 0x86, 0x57, 0xf5, 0x64, 0x34, 0xe5, 0xaf, 0x9f, 0xae, 0x77, 0x8f, 0xf6, 0x04, 0x5c, 0x20, 0xe2, 0xe1, 0xef, 0x7c, 0xbd, 0xf8, 0x8f, 0x00, 0x75, 0xf3, 0x3e, 0xa9, 0x92, 0x77, 0x7c, 0xb7, 0xe9, 0x2f, 0x7d, 0xa1, 0x8a, 0x0f, 0xfd, 0x00, 0xaa, 0x46, 0x71, 0xed, 0x63, 0x91, 0x1f, 0xe9, 0xe9, 0x2f, 0xb4, 0xa7, 0x6e, 0x77, 0xdc, 0x6e, 0x0a, 0x91, 0x65, 0x76, 0x71, 0x6c, 0x15, 0xea, 0xef, 0x08, 0x9a, 0x71, 0xa0, 0xae, 0xa3, 0x5b, 0xed, 0x94, 0x47, 0xa6, 0xc1, 0x7f, 0x2a, 0xad, 0xb7, 0x27, 0xfd, 0x42, 0xf0, 0xac, 0xc8, 0x24, 0x62, 0x38, 0x1d, 0x9f, 0xa2, 0xef } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.2", + /* Message to be signed */ + 11, + { 0x4c, 0x7b, 0x98, 0x12, 0x0c, 0x87, 0x50, 0x90, 0x87, 0xc4, 0x78 } +, + /* Signature */ + 128, + { 0x59, 0xe5, 0xcb, 0xe7, 0x33, 0x1b, 0x92, 0xe0, 0xcb, 0x8f, 0x68, 0x9e, 0xae, 0xbb, 0x30, 0xf2, 0xb3, 0x34, 0xa7, 0x46, 0xa6, 0x57, 0x05, 0x59, 0x12, 0xff, 0x1c, 0x92, 0x76, 0x0b, 0x0b, 0x85, 0xbc, 0x42, 0x82, 0xf3, 0x18, 0x4b, 0x9a, 0x81, 0x4f, 0x44, 0x37, 0xf8, 0x25, 0xae, 0x07, 0xd3, 0x56, 0xba, 0xc6, 0x9e, 0x54, 0x0c, 0x90, 0x94, 0x2c, 0x7f, 0x7e, 0x6f, 0xf4, 0x4f, 0xe5, 0x74, 0xf1, 0x21, 0x25, 0x0a, 0xd2, 0x30, 0xf4, 0xb5, 0x0c, 0x78, 0x31, 0x1e, 0x4f, 0xd3, 0xc9, 0xe2, 0x65, 0xf5, 0x17, 0xce, 0x32, 0x97, 0xc3, 0xe1, 0xdd, 0xdb, 0x5c, 0x86, 0x9c, 0x69, 0x8f, 0x44, 0xaf, 0x52, 0x5e, 0x73, 0x64, 0x01, 0xa8, 0x1b, 0x45, 0x9f, 0x19, 0x8a, 0xd1, 0x80, 0x8c, 0xcd, 0x92, 0x9d, 0x49, 0x04, 0x74, 0xca, 0xf7, 0x00, 0x5f, 0x91, 0x0d, 0xac, 0xde, 0x21, 0xb0, 0x77 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.3", + /* Message to be signed */ + 233, + { 0x66, 0xf7, 0x07, 0x54, 0x22, 0xc8, 0xec, 0x42, 0x16, 0xa9, 0xc4, 0xff, 0x49, 0x42, 0x7d, 0x48, 0x3c, 0xae, 0x10, 0xc8, 0x53, 0x4a, 0x41, 0xb2, 0xfd, 0x15, 0xfe, 0xe0, 0x69, 0x60, 0xec, 0x6f, 0xb3, 0xf7, 0xa7, 0xe9, 0x4a, 0x2f, 0x8a, 0x2e, 0x3e, 0x43, 0xdc, 0x4a, 0x40, 0x57, 0x6c, 0x30, 0x97, 0xac, 0x95, 0x3b, 0x1d, 0xe8, 0x6f, 0x0b, 0x4e, 0xd3, 0x6d, 0x64, 0x4f, 0x23, 0xae, 0x14, 0x42, 0x55, 0x29, 0x62, 0x24, 0x64, 0xca, 0x0c, 0xbf, 0x0b, 0x17, 0x41, 0x34,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3, 0x78, 0x28, 0xf5, 0x3e, 0x61, 0x13, 0x04, 0x49, 0x17, 0x3a, 0x33, 0x46, 0x0c, 0x6b, 0x4c, 0x8d, 0xc7, 0xd6, 0x81, 0xca, 0x6f, 0x4d, 0xaf, 0x1c, 0xb8, 0x16, 0xd4, 0x0a, 0xa9, 0x08, 0x2e, 0xe1, 0x93, 0x7b, 0xe4, 0xbc, 0x6a, 0x09, 0xc6, 0xde, 0x79, 0x8c, 0x82, 0x86, 0xfc, 0xd2, 0xa2, 0xb2, 0x19, 0x6c, 0x59, 0x99, 0x4c, 0x93, 0x7f, 0x37, 0x13, 0x07, 0x52, 0x61, 0x2c, 0x6b, 0xff, 0x6d, 0xbb, 0x53, 0xe0, 0x64, 0x7f, 0x88, 0x58, 0xbc, 0x38, 0x38, 0x64, 0x02, 0x1e, 0x6d, 0x56, 0x68, 0x19, 0x20, 0x24, 0x92, 0x97, 0x82, 0x22, 0x46, 0xa0, 0xf5, 0x28, 0xaa, 0xb3, 0xed, 0x18, 0x5e, 0xeb, 0xce, 0x91, 0x9c, 0xf8, 0x3e } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.4", + /* Message to be signed */ + 148, + { 0xd9, 0x34, 0x44, 0x28, 0xfa, 0x8a, 0x58, 0xf8, 0xfa, 0x7b, 0x44, 0x3e, 0x51, 0xfc, 0x9b, 0x51, 0xe3, 0x7a, 0x70, 0x21, 0x0d, 0xb8, 0xbd, 0x1d, 0xe7, 0xf8, 0x67, 0x5d, 0x84, 0x79, 0xff, 0x65, 0x7c, 0xa7, 0x29, 0x55, 0xb2, 0x3c, 0x6f, 0x4a, 0x09, 0x16, 0x37, 0x9a, 0x4e, 0xde, 0xe1, 0xf2, 0x6c, 0x85, 0xe0, 0x52, 0x90, 0x21, 0x1e, 0xeb, 0x25, 0x83, 0x2b, 0x09, 0xcb, 0xe5, 0xea, 0xed, 0x3e, 0x39, 0x65, 0xb0, 0x5a, 0x52, 0xfb, 0x5b, 0x16, 0x49, 0x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, 0x0f, 0xce, 0x6b, 0x37, 0xa5, 0x54, 0x9e, 0xf8, 0x05, 0x43, 0xd0, 0xd4, 0x1a, 0x87, 0xb2, 0xc6, 0xe4, 0xd8, 0x4c, 0xb5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.5", + /* Message to be signed */ + 201, + { 0x8c, 0x67, 0x02, 0xda, 0xaf, 0x58, 0xf6, 0xa4, 0x75, 0xfa, 0xd2, 0xc7, 0xa4, 0xbb, 0x15, 0x6a, 0x57, 0x06, 0x42, 0x55, 0x77, 0xd5, 0xe3, 0x0c, 0x6a, 0x6b, 0xd3, 0x66, 0x9f, 0xd0, 0x30, 0xaf, 0xd7, 0x89, 0xfa, 0xa3, 0xd0, 0x10, 0x18, 0xd4, 0x5d, 0xb2, 0xa0, 0x47, 0xf5, 0x2c, 0xb4, 0xf6, 0x3d, 0xea, 0x36, 0x09, 0x42, 0xaf, 0xe4, 0x76, 0x26, 0x42, 0x06, 0xd9, 0x83, 0xad, 0x38, 0x36, 0xe1, 0x55, 0xc5, 0x6b, 0x2e, 0xcc, 0x08, 0x76, 0x3a, 0xfb, 0x9f, 0xd5, 0x1d, 0x19, 0x99, 0x0e, 0xfc, 0x33, 0x63, 0xf6, 0x57, 0xe2, 0x85, 0xe0, 0x35, 0x21, 0xe8, 0xca, 0xd0, 0x1d, 0x2c, 0x93, 0x5a, 0x18, 0x3a, 0xe2, 0x3f, 0x0e, 0xe8, 0x71, 0x00, 0x86, 0xa8, 0x5b, 0x9f, 0xad, 0x4e, 0x7f, 0x2b, 0x09, 0x45, 0x2e, 0xbc, 0x40, 0x3c, 0xe0, 0xc0, 0xe5, 0x75, 0x5a, 0x7b, 0x2f, 0x33, 0xf4, 0xde, 0xf0, 0xdb, 0x71, 0xc9, 0x79, 0x31, 0xff, 0x90, 0x4a, 0x81, 0x31, 0x99, 0x84, 0xbd, 0xc5, 0x16, 0x6f, 0x6b, 0x92, 0x0c, 0x97, 0xee, 0x74, 0xfb, 0x7e, 0x89, 0x0f, 0x49, 0x0c, 0x90, 0xde, 0x30, 0xca, 0xc9, 0x76, 0xb7, 0x17, 0x23, 0xe2, 0xf8, 0x6e, 0x9d, 0xe1, 0xd5, 0x03, 0xa4, 0x1b, 0xc8, 0x1d, 0x53, 0xcc, 0xbe, 0xf8, 0xac, 0x40, 0x53, 0x57, 0xd9, 0xdf, 0xdf, 0x30, 0x64, 0x66, 0xb4, 0x26, 0x95, 0x80, 0x21, 0x2e, 0x9d, 0x71, 0x32 } +, + /* Signature */ + 128, + { 0x0d, 0x89, 0xfc, 0xf8, 0x44, 0xa9, 0xdc, 0x22, 0x3d, 0x5f, 0x63, 0x8d, 0xcc, 0x3a, 0x59, 0x78, 0x71, 0x6f, 0x26, 0x28, 0xb8, 0xa8, 0x3a, 0xb3, 0x3e, 0x6e, 0x25, 0x5f, 0xf8, 0xaa, 0x01, 0x57, 0x8c, 0x14, 0xe3, 0x89, 0x7d, 0xa4, 0x5a, 0xef, 0xd6, 0x3f, 0xa8, 0x7c, 0xf3, 0x5e, 0x24, 0x4b, 0xf4, 0x82, 0x8e, 0xcd, 0x21, 0x95, 0x0f, 0x30, 0x85, 0xa3, 0x66, 0x21, 0xc9, 0xda, 0x1b, 0xbe, 0x7e, 0xa6, 0x27, 0x31, 0xc6, 0x8d, 0x4d, 0xe0, 0xa3, 0x76, 0xe2, 0x2d, 0xac, 0x2f, 0x54, 0x8c, 0xd4, 0xba, 0x4a, 0x54, 0x2e, 0x71, 0x0f, 0x55, 0xce, 0x85, 0xa9, 0xc1, 0x95, 0x93, 0xc0, 0x8c, 0x87, 0xd2, 0x96, 0xd6, 0x35, 0x87, 0xb3, 0xfe, 0x2c, 0x5d, 0x11, 0x65, 0xee, 0x27, 0x74, 0x4c, 0x75, 0xd8, 0xf4, 0xf1, 0x43, 0x71, 0x63, 0x7c, 0x0c, 0x0a, 0x44, 0x62, 0x76, 0x28, 0x95, 0x83 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.6", + /* Message to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 0xed, 0x55, 0x4a, 0xe5, 0x1a, 0xe3, 0xec, 0x23, 0xf9, 0xdd, 0x08, 0x9e, 0x32, 0x4a, 0x68, 0x21, 0xf6, 0x15, 0x7f, 0x12, 0x84, 0x42, 0xac, 0x58, 0x07, 0x65, 0x8a, 0xd3, 0x40, 0x26, 0xb8, 0xfc, 0xfd, 0xa6, 0xdc, 0x7f, 0x02, 0xa9, 0x3c, 0x16, 0x6e, 0xc9, 0x45, 0xee } +, + /* Signature */ + 128, + { 0x0d, 0xeb, 0x39, 0x7b, 0xf2, 0xcf, 0xf9, 0x79, 0xd4, 0x71, 0x9c, 0x64, 0x8b, 0x0a, 0x35, 0x25, 0x35, 0x1f, 0x5e, 0x08, 0x40, 0x5c, 0xa2, 0x61, 0x4a, 0x83, 0xe5, 0x6a, 0xce, 0x86, 0xf5, 0x52, 0xe4, 0x1b, 0xb9, 0x28, 0xde, 0x50, 0xf0, 0xbc, 0x0f, 0xe3, 0x1a, 0x2e, 0xf2, 0xad, 0x79, 0x9f, 0xd3, 0xcf, 0x47, 0x42, 0xb1, 0x13, 0x1a, 0x37, 0xbd, 0x08, 0xf2, 0xa1, 0x3c, 0xac, 0xda, 0x67, 0xf4, 0x95, 0xc9, 0xf1, 0xa9, 0xef, 0x64, 0x85, 0x70, 0x72, 0x32, 0x9f, 0x00, 0xcc, 0x4c, 0x01, 0x22, 0x35, 0x59, 0x9a, 0x83, 0xfc, 0x45, 0x94, 0xfe, 0xd9, 0x23, 0x03, 0x49, 0x01, 0xed, 0xc2, 0x7d, 0x5f, 0x05, 0x79, 0x98, 0x34, 0x93, 0x5c, 0xab, 0xe2, 0x64, 0xff, 0xc1, 0x96, 0x63, 0x71, 0x4d, 0x8c, 0x3d, 0xe8, 0xe9, 0x61, 0x9f, 0xd2, 0x84, 0x2d, 0x22, 0x98, 0xf7, 0xa7, 0x2c, 0x99 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.7", + /* Message to be signed */ + 179, + { 0x0e, 0x79, 0xac, 0x9c, 0x9c, 0x03, 0x96, 0xd9, 0x69, 0xfb, 0x3f, 0x7c, 0xc9, 0x94, 0x7b, 0x07, 0x8b, 0xac, 0x49, 0x3b, 0x03, 0x52, 0xc8, 0xe0, 0xcd, 0xe5, 0x46, 0x3e, 0xa5, 0xc1, 0x18, 0x4f, 0xd5, 0x2a, 0x1f, 0xb7, 0x48, 0x19, 0x3c, 0x14, 0x7a, 0x74, 0x80, 0x0d, 0x24, 0xf7, 0x51, 0xba, 0x93, 0x5e, 0x19, 0xc9, 0x11, 0x5e, 0xdf, 0x07, 0x22, 0x88, 0x33, 0x0b, 0xf3, 0x83, 0xf4, 0x95, 0x29, 0x6b, 0xe1, 0xaa, 0x4a, 0x50, 0x95, 0xb9, 0x57, 0x3b, 0xcb, 0xdb, 0x22, 0x8a, 0x43, 0x13, 0x12, 0x37, 0x86, 0x5d, 0x26, 0xdf, 0xbf, 0xcf, 0xef, 0x07, 0x8f, 0x35, 0x9f, 0x9a, 0x95, 0x62, 0xe2, 0x5b, 0x69, 0x63, 0x85, 0xe1, 0x28, 0x13, 0xff, 0xfb, 0xc8, 0xd5, 0x29, 0x81, 0x9a, 0x91, 0x45, 0x1d, 0x33, 0xa5, 0x07, 0x26, 0x39, 0x2e, 0x4f, 0xef, 0x29, 0x41, 0x8c, 0xca, 0x2c, 0x73, 0xa0, 0x68, 0xe6, 0x0e, 0xae, 0x31, 0x84, 0x70, 0x33, 0x1a, 0x0f, 0x1d, 0xb4, 0xbb, 0xb6, 0x37, 0x17, 0x3b, 0xe8, 0x0f, 0xea, 0x03, 0xc8, 0x2c, 0x15, 0xd0, 0x01, 0x93, 0x36, 0x2d, 0x3a, 0x18, 0xad, 0x9e, 0x2f, 0x68, 0x05, 0x00, 0xd7, 0x26, 0x5b, 0x15, 0x57, 0x03, 0x3a, 0x52, 0x09, 0x77, 0xd8, 0x10, 0xfc } +, + /* Signature */ + 128, + { 0x73, 0x3b, 0x7f, 0xea, 0x12, 0x0c, 0xa5, 0xf0, 0x35, 0x9a, 0x89, 0x05, 0x75, 0x0c, 0x49, 0xc3, 0x63, 0xd8, 0x84, 0xf5, 0x6c, 0x2b, 0x7a, 0x72, 0x9f, 0xad, 0x7b, 0xff, 0x44, 0x5a, 0x1e, 0x54, 0x79, 0x89, 0x41, 0x74, 0x53, 0x93, 0xe1, 0x76, 0x77, 0x12, 0xac, 0x4b, 0x9d, 0xd2, 0x68, 0x38, 0x88, 0xd9, 0xe6, 0x8b, 0x90, 0x5d, 0xba, 0xb8, 0x79, 0x21, 0x85, 0x18, 0x48, 0x72, 0x73, 0x86, 0x02, 0xea, 0xf4, 0xa8, 0x0f, 0x45, 0x95, 0xf7, 0x8f, 0xd4, 0xa4, 0x61, 0x0b, 0xf8, 0x22, 0x0b, 0x86, 0xa2, 0x88, 0x5f, 0xda, 0x24, 0xe1, 0x99, 0x64, 0x28, 0xcc, 0xd1, 0x5f, 0x20, 0x08, 0xe0, 0x68, 0x51, 0xb2, 0xee, 0xad, 0xc3, 0xdc, 0x8e, 0x03, 0x01, 0x2f, 0x9b, 0xdb, 0x3c, 0xe0, 0x57, 0x5d, 0xdc, 0x3a, 0xdc, 0x7c, 0x59, 0x08, 0x49, 0x8b, 0x69, 0xa7, 0x97, 0xba, 0x58, 0x29, 0xc7 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.8", + /* Message to be signed */ + 29, + { 0x22, 0xeb, 0x7d, 0xba, 0x73, 0x30, 0x7c, 0x7c, 0x52, 0xa0, 0x7c, 0xed, 0x89, 0xdb, 0x8b, 0xc5, 0x39, 0x4a, 0xed, 0x22, 0x72, 0xf7, 0xe8, 0x1a, 0x74, 0xf4, 0xc0, 0x2d, 0x14 } +, + /* Signature */ + 128, + { 0x9e, 0xa4, 0x60, 0x0a, 0x1a, 0x65, 0x49, 0xfd, 0x39, 0x75, 0xf6, 0x49, 0x8a, 0x04, 0xd6, 0x9f, 0x96, 0xfa, 0xd0, 0xe8, 0xe6, 0xfe, 0xbc, 0xfb, 0xe0, 0x1c, 0x2f, 0x83, 0x17, 0x0b, 0xc7, 0x4e, 0xb9, 0x1f, 0x2e, 0x33, 0x53, 0x38, 0xd5, 0x83, 0xe8, 0x85, 0xaa, 0xc6, 0x14, 0x24, 0xc9, 0xb2, 0x66, 0xc3, 0xd2, 0xd9, 0x8e, 0x79, 0x77, 0xff, 0xe4, 0x95, 0xf9, 0xc1, 0xa6, 0xee, 0x5e, 0xf4, 0x1a, 0x4c, 0xc7, 0x47, 0x8c, 0x24, 0xb3, 0x16, 0xc7, 0xd9, 0xf6, 0xdb, 0xaa, 0x65, 0xa4, 0xca, 0xde, 0xf1, 0x81, 0xca, 0x94, 0x6f, 0x9b, 0x92, 0x18, 0x4f, 0xae, 0xca, 0x8a, 0x13, 0x16, 0xae, 0xab, 0x5c, 0xd3, 0x87, 0x8c, 0x6d, 0xf0, 0x74, 0xf9, 0x06, 0x0b, 0x9d, 0xb6, 0x6d, 0xec, 0xe9, 0xa9, 0x36, 0x7d, 0x75, 0x49, 0x03, 0x5a, 0xc6, 0xbf, 0x19, 0x62, 0x36, 0x5e, 0x1f, 0xd3, 0xfc } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.9", + /* Message to be signed */ + 2, + { 0xf6, 0x80 } +, + /* Signature */ + 128, + { 0x51, 0x63, 0x90, 0x61, 0xfa, 0x7b, 0x7c, 0xd5, 0xdf, 0x64, 0xb3, 0x0a, 0x39, 0x4c, 0xcf, 0x7e, 0x24, 0x26, 0x97, 0x2a, 0xa1, 0xdc, 0xf5, 0xd4, 0x5e, 0xb8, 0xec, 0x2c, 0xd9, 0x0b, 0x9b, 0x19, 0x68, 0x92, 0xbe, 0x5f, 0xa0, 0x3c, 0x43, 0xf3, 0xc3, 0x72, 0x3a, 0xe3, 0x13, 0x0d, 0x61, 0x51, 0xb3, 0x3a, 0x63, 0x7c, 0xfc, 0x50, 0xba, 0x35, 0x26, 0xa7, 0x39, 0x6c, 0xf8, 0x47, 0x9c, 0x50, 0x8c, 0x18, 0x11, 0x81, 0x0d, 0x68, 0xb3, 0x88, 0x0a, 0xf6, 0xe6, 0x4b, 0x16, 0xbd, 0x70, 0x79, 0xbe, 0x9c, 0x00, 0x39, 0x29, 0x51, 0x22, 0x61, 0x89, 0x8f, 0xa5, 0x7c, 0x06, 0xff, 0x7e, 0x1d, 0x80, 0x39, 0xfa, 0x99, 0x3f, 0xd2, 0x05, 0x6a, 0xc7, 0x01, 0x9b, 0x8d, 0xbc, 0xf2, 0x53, 0x0d, 0x53, 0x80, 0xe6, 0x01, 0xa4, 0xa1, 0x87, 0x1b, 0x86, 0xc2, 0x0b, 0xc1, 0xc4, 0x89, 0xc5, 0xf3 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.10", + /* Message to be signed */ + 104, + { 0x65, 0x0e, 0x64, 0xed, 0x1d, 0xa8, 0x8b, 0xcf, 0x8a, 0xe2, 0x75, 0x22, 0xbe, 0x1d, 0x5c, 0x99, 0x19, 0xf2, 0x09, 0x9d, 0xd6, 0x32, 0x45, 0x5f, 0x66, 0xd9, 0xaf, 0xe8, 0xba, 0xf4, 0x6c, 0xc8, 0xa1, 0x98, 0x40, 0x9b, 0x09, 0x28, 0xdd, 0x87, 0x22, 0x62, 0x84, 0xd6, 0x69, 0xbf, 0x01, 0xbc, 0xec, 0x44, 0x37, 0x6c, 0xb0, 0xe9, 0xbd, 0xc6, 0x86, 0xac, 0xaa, 0x8b, 0x46, 0x34, 0x86, 0x08, 0x59, 0x94, 0xca, 0xfb, 0x5a, 0x8c, 0xfc, 0x33, 0xd4, 0x9c, 0xee, 0xf4, 0x79, 0xfc, 0x6e, 0x04, 0xf8, 0xee, 0xf6, 0x37, 0xeb, 0x68, 0xcb, 0x57, 0x81, 0x8d, 0x5f, 0x97, 0x70, 0xac, 0x52, 0x3e, 0xd5, 0xb0, 0x16, 0x38, 0x36, 0x7f, 0xf4, 0x7f } +, + /* Signature */ + 128, + { 0x50, 0x3e, 0x05, 0x66, 0x1d, 0x68, 0x1e, 0xca, 0x57, 0x4e, 0x02, 0x30, 0xaf, 0x2d, 0xaa, 0x87, 0x7b, 0x90, 0x51, 0x6e, 0x5e, 0x19, 0x72, 0x8c, 0x91, 0x76, 0x8d, 0x6e, 0xef, 0xee, 0x00, 0x1b, 0x35, 0x41, 0x9c, 0x5f, 0xcb, 0x56, 0x11, 0xd6, 0x0e, 0x7e, 0xcb, 0xe3, 0xc9, 0x5e, 0x5c, 0x88, 0xba, 0x93, 0x46, 0x07, 0x04, 0xf1, 0x69, 0x4a, 0xe8, 0x04, 0x44, 0xeb, 0x97, 0x18, 0xa0, 0x8b, 0x66, 0x86, 0xfa, 0xd8, 0x6e, 0x52, 0x59, 0x90, 0xc3, 0xc1, 0xa6, 0x6c, 0x8c, 0x53, 0xaa, 0x31, 0xae, 0xd8, 0xcb, 0xc4, 0x0f, 0xd5, 0x4f, 0x5f, 0xf8, 0xa1, 0x34, 0x74, 0x9d, 0x79, 0xd3, 0x8f, 0xbb, 0x0d, 0x58, 0x44, 0x26, 0x78, 0xff, 0x2f, 0x70, 0xc6, 0xc5, 0x0f, 0x25, 0x47, 0x2a, 0x72, 0xd6, 0x32, 0x05, 0xe7, 0x82, 0x42, 0x3d, 0xf4, 0x0b, 0x6c, 0x43, 0xde, 0x03, 0xa1, 0x8f, 0x8b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.11", + /* Message to be signed */ + 50, + { 0x57, 0xf8, 0xac, 0x6a, 0x9e, 0x46, 0x8b, 0x7f, 0x1f, 0x74, 0x5d, 0xff, 0xe3, 0x9e, 0x9c, 0xbf, 0x90, 0x24, 0xa0, 0xff, 0x36, 0xe0, 0x22, 0x83, 0x92, 0xbe, 0x6b, 0x29, 0x94, 0x29, 0x17, 0x76, 0xb8, 0x9c, 0x0a, 0x4b, 0x1f, 0xa8, 0x6b, 0x2e, 0xc8, 0xbb, 0x7c, 0x3e, 0x64, 0xf5, 0x58, 0x5a, 0xfa, 0x77 } +, + /* Signature */ + 128, + { 0x90, 0xbe, 0x16, 0xb4, 0x08, 0xb3, 0x85, 0x73, 0x95, 0x39, 0xb3, 0xb9, 0xa2, 0x9b, 0x94, 0xc7, 0x29, 0x38, 0x5f, 0x79, 0xdd, 0x4a, 0x79, 0x81, 0x1e, 0x6f, 0x67, 0xc8, 0x0e, 0xd3, 0x59, 0xe5, 0xf4, 0xb2, 0xa1, 0x9c, 0x22, 0x2a, 0x82, 0xb3, 0xd6, 0xd6, 0x2a, 0x90, 0x3f, 0xb1, 0x80, 0xc1, 0xf4, 0x3c, 0xb3, 0xfe, 0x06, 0xa2, 0x50, 0xbc, 0xb0, 0xe7, 0xc6, 0x88, 0x66, 0x5c, 0x83, 0x68, 0xa1, 0x1a, 0xb1, 0x16, 0x0a, 0xdb, 0x74, 0x02, 0x91, 0x35, 0x2b, 0x38, 0x38, 0xb6, 0x92, 0x3a, 0x4a, 0x37, 0xad, 0x06, 0x04, 0x0a, 0x53, 0x59, 0x20, 0xdc, 0x0f, 0x10, 0x57, 0x9e, 0xcf, 0x48, 0x1c, 0xd4, 0x41, 0x37, 0x17, 0xd7, 0xd4, 0xd9, 0x60, 0xaa, 0x75, 0x1a, 0x74, 0x3e, 0x2f, 0x7c, 0x61, 0x6e, 0x54, 0x2e, 0xe6, 0x5f, 0xbb, 0xfe, 0x24, 0x66, 0x0e, 0x10, 0x1d, 0xaa, 0x2b, 0xdd } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.12", + /* Message to be signed */ + 77, + { 0x80, 0xef, 0x01, 0xaa, 0xcc, 0x5b, 0xfb, 0x0d, 0xb4, 0x8c, 0x6d, 0xe3, 0xd8, 0x14, 0x95, 0xb9, 0xc2, 0x31, 0x1a, 0x38, 0x93, 0x89, 0xf2, 0x3b, 0x70, 0xc0, 0x24, 0xda, 0x44, 0x78, 0xbf, 0xab, 0x2b, 0xfe, 0x4e, 0x54, 0x6f, 0x13, 0xff, 0xfd, 0xb9, 0x63, 0x89, 0x4e, 0xc6, 0xda, 0xdb, 0x3d, 0x2b, 0x0e, 0xe3, 0x37, 0xf1, 0x16, 0x31, 0x05, 0x8e, 0xac, 0x86, 0x09, 0xe5, 0xa1, 0x55, 0x4a, 0xf7, 0x97, 0xa9, 0xf9, 0xab, 0x47, 0x8c, 0x2d, 0x5b, 0x91, 0x88, 0xc8, 0x25 } +, + /* Signature */ + 128, + { 0x44, 0xc3, 0xf5, 0x1d, 0xcc, 0x6f, 0xb2, 0xb4, 0xe7, 0x0f, 0x53, 0x7f, 0x54, 0x64, 0xc6, 0x32, 0x0a, 0xd4, 0x2e, 0x21, 0x28, 0xfa, 0xdf, 0xd9, 0xa7, 0xe9, 0x37, 0xcd, 0x65, 0xdc, 0xbf, 0x35, 0xac, 0x66, 0xcf, 0xfa, 0xfd, 0x39, 0x28, 0x39, 0x66, 0xf2, 0xf1, 0x5d, 0xe5, 0x27, 0x72, 0x35, 0x50, 0x71, 0x5a, 0x31, 0x04, 0x29, 0x45, 0xe2, 0x00, 0xcc, 0x5c, 0x86, 0xfa, 0xba, 0x5e, 0xc8, 0xab, 0xaf, 0x50, 0x9c, 0x0c, 0xcd, 0x64, 0xd9, 0x9d, 0xed, 0xc7, 0x6e, 0x3c, 0xea, 0xa8, 0xc4, 0x47, 0x17, 0x93, 0x37, 0xf4, 0xa0, 0x77, 0x7b, 0x11, 0x52, 0x6e, 0x47, 0x2a, 0xcd, 0x41, 0x3b, 0x4a, 0xc7, 0xc3, 0x03, 0xcd, 0xcd, 0x84, 0xca, 0xfc, 0x02, 0x52, 0x43, 0xef, 0x00, 0x6f, 0x79, 0xdd, 0xaf, 0x55, 0xc1, 0x5c, 0xc4, 0xa8, 0xf1, 0x5e, 0xa2, 0xc8, 0x7f, 0x05, 0x77, 0x38, 0x14 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.13", + /* Message to be signed */ + 184, + { 0xac, 0x17, 0x95, 0x91, 0x55, 0x28, 0x3b, 0x0c, 0x7c, 0xff, 0x51, 0x5c, 0x33, 0x15, 0xd8, 0x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3, 0x18, 0x4b, 0xb9, 0x80, 0x1e, 0x26, 0xd6, 0x14, 0xa8, 0x89, 0xa8, 0x35, 0x84, 0x41, 0x07, 0xac, 0x01, 0x65, 0x0b, 0x11, 0x84, 0xa0, 0x0b, 0xca, 0xa7, 0xaf, 0x1f, 0xf7, 0xde, 0x3a, 0x2e, 0xf2, 0xe7, 0xce, 0xb5, 0xb2, 0x5c, 0x3b, 0x5d, 0x5b, 0xcb, 0x29, 0x86, 0x59, 0x34, 0x32, 0x47, 0x48, 0xc6, 0x8f, 0x07, 0xde, 0x17, 0x4e, 0x17, 0x80, 0xa7, 0x0f, 0xa2, 0x4d, 0x6a, 0x3a, 0x9f, 0x7a, 0x41, 0xb8, 0x19, 0x37, 0xc4, 0x98, 0x4b, 0x2c, 0xbe, 0x06, 0xb3, 0xd7, 0xb4, 0x4c, 0xda, 0xe9, 0xcb, 0xd4, 0x16, 0x32, 0xd0, 0x09, 0x43, 0xc3, 0xb5, 0x73, 0xb1, 0xaa, 0x29, 0x12, 0x75, 0x0a, 0x9a, 0xeb, 0x07, 0xf1, 0x10, 0x13, 0x0b, 0xa3, 0x61, 0xdc, 0xf8, 0xf5, 0x36, 0x79, 0x0d, 0x60, 0x78, 0x47 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.14", + /* Message to be signed */ + 232, + { 0x99, 0x09, 0x8f, 0x77, 0xf6, 0xed, 0x35, 0xc0, 0x8f, 0xab, 0x3f, 0xa9, 0x78, 0x86, 0x93, 0x67, 0x1a, 0x58, 0x00, 0xdc, 0x30, 0x3c, 0x9c, 0xce, 0x42, 0x46, 0x16, 0xfa, 0x0c, 0x7e, 0xe8, 0x88, 0x86, 0x87, 0x67, 0x4c, 0xa8, 0x8a, 0xb2, 0x2a, 0x5f, 0xf2, 0xd1, 0x2e, 0x2b, 0x38, 0x8b, 0x09, 0x4f, 0xfd, 0x7d, 0xbf, 0x9a, 0x09, 0x27, 0xa9, 0x62, 0x17, 0x17, 0x15, 0x1e, 0x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x62, 0x05, 0xfb, 0x9c, 0xe0, 0x41, 0xb4, 0x02, 0x98, 0xe5, 0xba, 0x92, 0xc2, 0xe9, 0xcc, 0x0b, 0xbf, 0xbb, 0x4a, 0x76, 0x42, 0x5d, 0xe6, 0xce, 0x13, 0x02, 0x1a, 0xe1, 0xa4, 0xa9, 0x42, 0x29, 0x9f, 0x98, 0xff, 0x89, 0xf5, 0x52, 0xf4, 0x3a, 0x90, 0x73, 0xde, 0x64, 0xf4, 0x9c, 0x2c, 0xa3, 0x62, 0x0d, 0x09, 0xd7, 0xe6, 0xe3, 0xfe, 0x28, 0x22, 0x1e, 0x93, 0x68, 0x98, 0x7e, 0x11, 0x0c, 0xd6, 0x06, 0x71, 0x06, 0xc4, 0xdb, 0x31, 0xa0, 0x38, 0x90, 0x23, 0x67, 0x96, 0xc8, 0x42, 0x52, 0xf5, 0x6c, 0x95, 0x03, 0x4a, 0x01, 0xc5, 0xfe, 0x98, 0x1e, 0x81, 0xb6, 0x54, 0x85, 0x5a, 0xaf, 0x27, 0x47, 0x50, 0x11, 0x55, 0x72, 0x0c, 0x21, 0x93, 0xf3, 0xa1, 0xd1, 0x0f, 0x49, 0xfe, 0xe9, 0x0c, 0x52, 0xfe, 0xe9, 0xe4 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.15", + /* Message to be signed */ + 33, + { 0xff, 0x79, 0x06, 0x42, 0x30, 0x5b, 0xf3, 0x02, 0x00, 0x38, 0x92, 0xe5, 0x4d, 0xf9, 0xf6, 0x67, 0x50, 0x9d, 0xc5, 0x39, 0x20, 0xdf, 0x58, 0x3f, 0x50, 0xa3, 0xdd, 0x61, 0xab, 0xb6, 0xfa, 0xb7, 0x5d } +, + /* Signature */ + 128, + { 0x07, 0x56, 0x32, 0x47, 0x73, 0x4f, 0x3c, 0x3d, 0x7a, 0x31, 0x02, 0xbc, 0xb4, 0x5b, 0xb5, 0x68, 0x15, 0x68, 0xed, 0x10, 0xf2, 0xec, 0x45, 0x9e, 0x46, 0x9e, 0x1a, 0x9e, 0x34, 0x09, 0xa1, 0x39, 0xfb, 0x15, 0x1b, 0x98, 0xd3, 0xf3, 0xb6, 0x2d, 0xaa, 0xac, 0x8b, 0x8f, 0x89, 0x16, 0xdf, 0x85, 0xd6, 0xdf, 0xa9, 0xab, 0x76, 0x0d, 0xf1, 0xe1, 0x5a, 0xc8, 0x90, 0x44, 0xe5, 0x79, 0xcf, 0x47, 0xa1, 0xaf, 0x6c, 0xd6, 0xec, 0x70, 0x4c, 0xed, 0x9b, 0x03, 0x4c, 0x6a, 0xaa, 0x90, 0xd0, 0xe7, 0x0e, 0x08, 0x52, 0x14, 0x0e, 0x75, 0x41, 0xf2, 0xef, 0xbe, 0x2c, 0xf1, 0x90, 0xb9, 0x58, 0x94, 0x1e, 0xc8, 0xb5, 0x97, 0x4f, 0x9c, 0x44, 0x4d, 0x26, 0xc3, 0x43, 0x16, 0xc9, 0x21, 0x6b, 0x65, 0x95, 0xe6, 0x56, 0xbc, 0x6c, 0x78, 0x44, 0xfa, 0xc1, 0x6c, 0x51, 0x52, 0x60, 0x92, 0x8e, 0x78 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.16", + /* Message to be signed */ + 91, + { 0xe9, 0x9f, 0xcb, 0xf8, 0x59, 0x2d, 0xbe, 0x2d, 0x7e, 0x27, 0x45, 0x3c, 0xb4, 0x4d, 0xe0, 0x71, 0x00, 0xeb, 0xb1, 0xa2, 0xa1, 0x98, 0x11, 0xa4, 0x78, 0xad, 0xbe, 0xab, 0x27, 0x0f, 0x94, 0xe8, 0xfe, 0x36, 0x9d, 0x90, 0xb3, 0xca, 0x61, 0x2f, 0x9f, 0x22, 0xd7, 0x1d, 0x54, 0x36, 0x3a, 0x42, 0x17, 0xaa, 0x55, 0x11, 0x3f, 0x05, 0x9b, 0x33, 0x84, 0xe3, 0xe5, 0x7e, 0x44, 0x52, 0x28, 0x80, 0x62, 0xaf, 0xc0, 0x8f, 0xcd, 0xb7, 0xc5, 0xf8, 0x65, 0x0b, 0x29, 0x83, 0x73, 0x00, 0x46, 0x1d, 0xd5, 0x67, 0x6c, 0x17, 0xa2, 0x0a, 0x3c, 0x8f, 0xb5, 0x14, 0x89 } +, + /* Signature */ + 128, + { 0x22, 0x74, 0x64, 0x36, 0x16, 0x4e, 0x63, 0x93, 0x78, 0x71, 0xc1, 0xd4, 0x7d, 0x8e, 0x3e, 0x70, 0xc9, 0xe5, 0x2d, 0x11, 0x17, 0x31, 0x6b, 0xb1, 0x54, 0xcd, 0x55, 0x2e, 0x83, 0x6f, 0x2a, 0x3f, 0xbe, 0x6d, 0x89, 0xd6, 0x07, 0x4b, 0x51, 0xb0, 0x15, 0x9c, 0x26, 0xc2, 0x8d, 0xf7, 0x5e, 0x3d, 0x7c, 0xfb, 0x7c, 0xf0, 0x02, 0xf6, 0x5d, 0x1e, 0xe5, 0x21, 0xed, 0xc2, 0xc3, 0xa6, 0x5c, 0x52, 0x6c, 0x98, 0xc7, 0xc0, 0x25, 0xfa, 0x8b, 0xb6, 0x31, 0x47, 0x09, 0x16, 0xd3, 0x01, 0xb8, 0xf7, 0x80, 0x9d, 0xdd, 0x91, 0x9d, 0xed, 0x31, 0xa0, 0xd4, 0x66, 0x83, 0xec, 0x5b, 0xb4, 0x41, 0x70, 0x61, 0x6e, 0xab, 0xcd, 0x97, 0x02, 0x05, 0xed, 0x76, 0x02, 0x02, 0xd0, 0xd8, 0x7a, 0x65, 0x79, 0x59, 0x08, 0xb2, 0x8d, 0x32, 0x6f, 0x93, 0x62, 0x13, 0xf2, 0x9f, 0xeb, 0x59, 0x77, 0x34, 0x91 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.17", + /* Message to be signed */ + 224, + { 0x6a, 0x6a, 0x0c, 0x9b, 0x5b, 0x15, 0xbc, 0xda, 0x19, 0x6a, 0x9d, 0x0c, 0x76, 0xb1, 0x19, 0xd5, 0x34, 0xd8, 0x5a, 0xbd, 0x12, 0x39, 0x62, 0xd5, 0x83, 0xb7, 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d, 0x81, 0x20, 0x25, 0x09, 0x0c, 0x9b, 0xc0, 0x3d, 0xb3, 0x08, 0x0c, 0x13 } +, + /* Signature */ + 128, + { 0x41, 0x93, 0x22, 0xfa, 0xca, 0xce, 0x76, 0xf2, 0xd5, 0xe2, 0xfb, 0xc1, 0x9a, 0xab, 0x86, 0xc7, 0x18, 0xa2, 0x80, 0x64, 0xf1, 0xd7, 0xb4, 0xc6, 0x62, 0xf0, 0x47, 0x4a, 0x87, 0x77, 0xa9, 0x59, 0xbd, 0x65, 0x69, 0x53, 0x8c, 0x16, 0x08, 0x1c, 0x0f, 0x52, 0x69, 0x8b, 0x2f, 0x00, 0x17, 0x30, 0xc0, 0x3b, 0x9a, 0x3d, 0x26, 0x94, 0x73, 0x74, 0xc9, 0x61, 0xfd, 0xed, 0xa1, 0x15, 0xb6, 0xb7, 0xda, 0xf6, 0x65, 0x18, 0xf1, 0xfe, 0x82, 0x0f, 0x67, 0xc3, 0xff, 0x12, 0xf0, 0xbc, 0x3f, 0x11, 0x01, 0xe3, 0x91, 0x1c, 0x43, 0x90, 0x6b, 0x0a, 0x12, 0x7e, 0x50, 0xbe, 0x01, 0x40, 0xc5, 0xef, 0xc4, 0x35, 0xe2, 0x95, 0x7b, 0x44, 0x2e, 0x60, 0xad, 0x52, 0x5a, 0xd7, 0x0a, 0xc9, 0xef, 0x61, 0xc3, 0xd6, 0x4f, 0x0e, 0x56, 0x6c, 0xbc, 0x1f, 0x9d, 0x51, 0xba, 0xe1, 0xd4, 0x72, 0x71, 0xda } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.18", + /* Message to be signed */ + 56, + { 0x3b, 0x93, 0xef, 0x4a, 0x55, 0x50, 0x96, 0x69, 0x19, 0x15, 0xdc, 0x23, 0xc0, 0x0e, 0x95, 0x4c, 0xde, 0xb2, 0x0a, 0x47, 0xcd, 0x55, 0xd1, 0x6c, 0x3d, 0x86, 0x81, 0xd4, 0x6e, 0xd7, 0xf2, 0xed, 0x5e, 0xa4, 0x27, 0x95, 0xbe, 0x17, 0xba, 0xed, 0x25, 0xf0, 0xf4, 0xd1, 0x13, 0xb3, 0x63, 0x6a, 0xdd, 0xd5, 0x85, 0xf1, 0x6a, 0x8b, 0x5a, 0xec } +, + /* Signature */ + 128, + { 0xae, 0x21, 0x1f, 0x4f, 0x77, 0xda, 0x1b, 0xe6, 0xaf, 0x9c, 0x9e, 0xa7, 0x04, 0xdb, 0xac, 0x4b, 0x3f, 0x3e, 0x27, 0x0d, 0x2f, 0xac, 0xf3, 0x65, 0x1d, 0x78, 0x7d, 0x0e, 0xbf, 0x59, 0xa7, 0x9a, 0x39, 0x61, 0x2d, 0xa1, 0x2d, 0x57, 0xc4, 0xac, 0x8a, 0xbc, 0x72, 0x8e, 0x1d, 0xa3, 0xf0, 0x1a, 0x15, 0x20, 0xfc, 0x9b, 0x32, 0xcb, 0x0f, 0xfe, 0x00, 0x8c, 0x80, 0x69, 0x92, 0x8f, 0x83, 0xe1, 0x35, 0x90, 0xa7, 0x8b, 0x81, 0x7e, 0x81, 0x9f, 0xbf, 0x2f, 0xd0, 0x58, 0x93, 0xec, 0xe5, 0xb1, 0x41, 0x86, 0xd9, 0x01, 0xc7, 0x68, 0xe3, 0x42, 0xdc, 0x54, 0x72, 0x23, 0x45, 0xae, 0x8a, 0xa8, 0x73, 0x8d, 0x4d, 0x59, 0x70, 0xc5, 0x08, 0x54, 0x72, 0xbd, 0x98, 0x99, 0xfa, 0x00, 0x42, 0xcf, 0x14, 0xbc, 0xed, 0xff, 0xdb, 0xc0, 0xef, 0x50, 0x81, 0x90, 0x75, 0x84, 0x2f, 0xc3, 0x6b, 0xb8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.19", + /* Message to be signed */ + 62, + { 0x49, 0xff, 0xd5, 0x6b, 0xf7, 0xef, 0xc1, 0x13, 0x04, 0xa5, 0xaf, 0xbc, 0x19, 0xd4, 0x79, 0x24, 0x90, 0x18, 0xfd, 0xf4, 0xe0, 0x9f, 0x61, 0x87, 0x26, 0x44, 0x04, 0x95, 0xde, 0x11, 0xdd, 0xee, 0xe3, 0x88, 0x72, 0xd7, 0x75, 0xfc, 0xea, 0x74, 0xa2, 0x38, 0x96, 0xb5, 0x34, 0x3c, 0x9c, 0x38, 0xd4, 0x6a, 0xf0, 0xdb, 0xa2, 0x24, 0xd0, 0x47, 0x58, 0x0c, 0xc6, 0x0a, 0x65, 0xe9 } +, + /* Signature */ + 128, + { 0x68, 0xfb, 0x0b, 0xd5, 0x19, 0xbf, 0x6f, 0x96, 0xe0, 0x76, 0xaf, 0x29, 0x01, 0x2f, 0x3c, 0x3a, 0x11, 0x37, 0xc0, 0x98, 0x8d, 0xe7, 0xb6, 0xfc, 0xed, 0xf4, 0xf5, 0x1b, 0xdf, 0xee, 0x64, 0x5b, 0x89, 0x7f, 0x17, 0x70, 0x9e, 0x05, 0xca, 0xa0, 0xb1, 0x13, 0x50, 0x0d, 0x90, 0x4d, 0xc0, 0x60, 0x0d, 0x17, 0xa9, 0xff, 0x8e, 0xb0, 0x2e, 0x1e, 0xfc, 0x9c, 0x46, 0x7a, 0x24, 0x00, 0x3e, 0xf8, 0x1e, 0x72, 0x74, 0x67, 0xc4, 0x7d, 0xd6, 0x56, 0x35, 0x6d, 0x70, 0x37, 0x2a, 0x15, 0xea, 0x88, 0x41, 0x21, 0x63, 0x4b, 0x01, 0x5d, 0x29, 0x51, 0x1f, 0x28, 0x95, 0x55, 0x77, 0x99, 0x07, 0x9d, 0x03, 0xc6, 0xd4, 0xde, 0x25, 0x9b, 0x3b, 0x36, 0x2b, 0x80, 0x49, 0x2d, 0x81, 0xbc, 0x9f, 0xe8, 0x54, 0x44, 0x63, 0xec, 0x03, 0x0b, 0xb5, 0xc9, 0xc7, 0x3c, 0x32, 0x74, 0xe3, 0xed, 0x12, 0x22 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 3.20", + /* Message to be signed */ + 136, + { 0xbc, 0x25, 0x5a, 0xf8, 0x9a, 0x6a, 0x19,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 0xe0, 0x05, 0x5f, 0x97, 0x4f, 0xe9, 0x39, 0x44, 0x8d, 0xa3, 0x68, 0xf5, 0x3b, 0xd2, 0xef, 0xe2, 0x6e, 0x6f, 0x9a, 0x25, 0x4b, 0x3e, 0x87, 0x32, 0xaa, 0xd8, 0x16, 0x87, 0xb3, 0x61, 0xe2, 0x1a, 0x40, 0xcf, 0x3e, 0x5e, 0x92, 0x38, 0x9a, 0x2b, 0x48, 0x9c, 0x05, 0xc5, 0x97, 0xf0, 0xe1, 0x64, 0xe2, 0x67, 0x70, 0x93, 0x72, 0x00, 0x43, 0x27, 0x16, 0x35, 0x62, 0xdd, 0x8a, 0x0a, 0xdb, 0xbd, 0xfe, 0x3b, 0xc6, 0x16, 0xbd, 0x08, 0x42, 0x96, 0x84, 0xc2, 0x0c, 0x69 } + +} +, +} +}, +{ + "Example 4: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xd1, 0x31, 0xe0, 0x92, 0x43, 0x37, 0x0d, 0xd2, 0xcd, 0x54, 0x25, 0xc8, 0xd0, 0x30, 0xf9, 0x9a, 0xdb, 0x10, 0x5b, 0x14, 0x7b, 0x8a, 0x3d, 0x00, 0x67, 0xc6, 0x16, 0x44, 0x3b, 0x7d, 0x4b, 0x96, 0x82, 0x38, 0xe0, 0x6d, 0xbb, 0x5f, 0x20, 0x28, 0xe8, 0x53, 0x57, 0x4b, 0x7c, 0x14, 0xbe, 0x10, 0x83, 0xc1, 0xe5, 0x7e, 0x13, 0x2c, 0x1d, 0xf4, 0xa3, 0xa2, 0x71, 0x32, 0x63, 0xfa, 0xde, 0x12, 0xf7, 0x11, 0x4f, 0x43, 0x69, 0xbb, 0xf0, 0x56, 0x20, 0x55, 0x48, 0x41, 0x33, 0x1e, 0xd8, 0x11, 0x00, 0x50, 0x52, 0x19, 0x25, 0x72, 0xce, 0xb4, 0x8d, 0x66, 0x24, 0x07, 0xfd, 0x30, 0x81, 0xcf, 0xab, 0x8b, 0x48, 0xc7, 0xe9, 0x2d, 0x3c, 0x4a, 0x26, 0xa9, 0x64, 0x5a, 0x38, 0xe6, 0xde, 0xe8, 0x8b, 0xb0, 0x07, 0x59, 0x75, 0xa4, 0xda, 0xd9, 0x64, 0x6b, 0x21, 0x60, 0x38, 0x40, 0xaf, 0x5f } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x56, 0xb5, 0x31, 0xbb, 0xee, 0x18, 0x37, 0xa6, 0x94, 0x6c, 0xb8, 0x6c, 0x8f, 0xbe, 0x7c, 0xf6, 0xee, 0xad, 0xcc, 0xd2, 0xa4, 0x92, 0x1b, 0xce, 0xbb, 0x34, 0xa3, 0xae, 0x0c, 0x6a, 0x56, 0x96, 0x3f, 0xcb, 0x8b, 0x5a, 0x70, 0x3b, 0x71, 0x7d, 0x03, 0x2e, 0xe8, 0x13, 0xe5, 0x8e, 0x43, 0x69, 0x5c, 0xf3, 0x55, 0x47, 0xf8, 0x72, 0x64, 0xc8, 0x2d, 0xba, 0xfa, 0xe8, 0x44, 0x00, 0x8b, 0x62, 0xd9, 0x12, 0x2e, 0x9d, 0xe8, 0x95, 0x85, 0x60, 0xc8, 0xdb, 0xb0, 0x07, 0x72, 0x7e, 0x71, 0x39, 0xe0, 0xa9, 0x82, 0xe0, 0x75, 0x88, 0x14, 0x11, 0x3d, 0xe5, 0x4b, 0xa0, 0xa4, 0x55, 0x17, 0x51, 0xfc, 0xa0, 0xfc, 0xb1, 0x2d, 0x8d, 0xe3, 0x0d, 0x78, 0xb8, 0xb1, 0x12, 0x98, 0xa7, 0xf7, 0x8f, 0x0b, 0x08, 0x8f, 0x16, 0x87, 0x05, 0x3c, 0x84, 0xa5, 0x76, 0x2f, 0x62, 0xa4, 0xbd, 0x05, 0xc1 } +, + /* Prime 1 */ + 64, + { 0xee, 0x22, 0xa4, 0x24, 0x62, 0xf7, 0x71, 0x8d, 0xfe, 0xcf, 0x02, 0x4b, 0x17, 0xc9, 0x26, 0x76, 0x78, 0x05, 0x91, 0x71, 0x33, 0x9c, 0xc0, 0x07, 0x06, 0x52, 0x60, 0xd3, 0x04, 0x7e, 0x5f, 0x89, 0xfe, 0xd9, 0x10, 0x34, 0x28, 0x43, 0x37, 0x8c, 0x22, 0x68, 0x5d, 0x53, 0x2e, 0x84, 0xd2, 0x59, 0x3a, 0x7c, 0x8c, 0x02, 0x6a, 0x87, 0x66, 0xc5, 0xa2, 0xb2, 0xed, 0x55, 0x8e, 0x88, 0x23, 0x19 } +, + /* Prime 2 */ + 64, + { 0xe0, 0xe3, 0x70, 0x0c, 0x99, 0xa3, 0xe8, 0x15, 0xd7, 0x4b, 0x75, 0x2a, 0x84, 0xfb, 0x42, 0xec, 0x20, 0xe5, 0x20, 0x3c, 0xa7, 0xc1, 0xaf, 0x97, 0xfb, 0xf3, 0x97, 0xb9, 0x5d, 0x11, 0x05, 0x37, 0x6c, 0xf5, 0xd6, 0x3e, 0x3c, 0x57, 0xbf, 0xa6, 0x58, 0x55, 0xe5, 0x08, 0x14, 0x6c, 0x86, 0xdb, 0xaa, 0xb2, 0x89, 0xc9, 0x5b, 0xc0, 0x45, 0x5a, 0x58, 0x2d, 0xd8, 0xf5, 0x3f, 0xfb, 0xed, 0x37 } +, + /* Prime exponent 1 */ + 64, + { 0xd1, 0xf1, 0x34, 0x68, 0xe7, 0xdf, 0x62, 0xfb, 0x5e, 0xb3, 0xbe, 0x3f, 0xd9, 0xde, 0x7a, 0xcc, 0x63, 0x0f, 0xf5, 0xa3, 0xa9, 0x6e, 0xfe, 0x54, 0xb3, 0x1c, 0x19, 0x44, 0xb0, 0x67, 0x81, 0x6f, 0x35, 0x80, 0xc4, 0xaa, 0x56, 0xfc, 0xbb, 0x92, 0x0e, 0x1b, 0x98, 0x7b, 0x67, 0x3d, 0xad, 0xfd, 0x00, 0x75, 0x21, 0x32, 0x58, 0x1c, 0xbb, 0x5c, 0x6e, 0x0d, 0xf4, 0xf3, 0x42, 0xcf, 0x7e, 0xb1 } +, + /* Prime exponent 2 */ + 64, + { 0xac, 0xd0, 0xda, 0x38, 0x34, 0x90, 0xea, 0x36, 0x6e, 0x7d, 0xc4, 0x09, 0xea, 0xab, 0x13, 0x20, 0x55, 0x9e, 0xfd, 0x88, 0xde, 0xf9, 0x4e, 0x30, 0xa3, 0x22, 0xec, 0x03, 0x3b, 0xeb, 0x6a, 0x70, 0xcf, 0x40, 0x93, 0x64, 0xbc, 0x06, 0x4a, 0x76, 0x50, 0x07, 0xa1, 0xba, 0xf5, 0xc6, 0xf8, 0x53, 0x31, 0xf7, 0x85, 0x3e, 0xc1, 0x4d, 0x1d, 0x7e, 0x71, 0xa8, 0xb9, 0xc2, 0xad, 0x6a, 0xb1, 0x3d } +, + /* Coefficient */ + 64, + { 0x1e, 0xda, 0x83, 0xd4, 0xa6, 0xd0, 0x99, 0xb6, 0x0b, 0x2b, 0x2b, 0x84, 0xc6, 0xae, 0x41, 0x65, 0xc7, 0x22, 0x50, 0x3e, 0xbd, 0x37, 0x3c, 0x83, 0x6f, 0x97, 0x35, 0xca, 0x3b, 0x20, 0xa3, 0xeb, 0x08, 0x1b, 0x31, 0xe7, 0x83, 0x04, 0x13, 0x20, 0xdf, 0xc6, 0xdd, 0xf9, 0x05, 0x14, 0xca, 0xb6, 0xec, 0x4b, 0x80, 0xae, 0x0c, 0x05, 0x2d, 0xd1, 0xe7, 0xce, 0x34, 0x18, 0xae, 0xee, 0x24, 0xa4 } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 4.1", + /* Message to be signed */ + 174, + { 0x2c, 0x93, 0x6b, 0xf6, 0x13, 0x3a, 0x96, 0x93, 0xf1, 0x46, 0xee, 0x5a, 0x1a, 0x91, 0xc2, 0xf1, 0x69, 0xb2, 0xe6, 0x44, 0xa5, 0x18, 0xe8, 0x5a, 0x75, 0xf6, 0xe4, 0x3b, 0x56, 0x0d, 0x4a, 0x72, 0xf3, 0x8c, 0x64, 0xf8, 0x4c, 0x05, 0x24, 0x0e, 0x8b, 0x4e, 0x55, 0x78, 0x61, 0x63, 0xe7, 0x27, 0x62, 0x65, 0xba, 0x21, 0x3b, 0xa9, 0x3d, 0xee, 0x1b, 0x2e, 0x10, 0x21, 0x35, 0xa9, 0x89, 0xb6, 0x24, 0x8e, 0x88, 0x32, 0x7e, 0x30, 0x03, 0x61, 0xa7, 0x4f, 0x2e, 0x9b, 0xc4, 0x1f, 0x2a, 0x37, 0x68, 0x3f, 0x1a, 0x1a, 0x15, 0xf9, 0xdd, 0x47, 0x2e, 0x11, 0x8e, 0x1c, 0x4b, 0x3e, 0xde, 0x58, 0xdd, 0x70, 0xf3, 0xba, 0xcc, 0x25, 0x2e, 0x0c, 0x65, 0x4b, 0x0f, 0x7a, 0x6e, 0x41, 0xa9, 0x28, 0x75, 0x10, 0xef, 0xa0, 0x3b, 0xc9, 0x2e, 0x80, 0x5e, 0x5b, 0x2c, 0x91, 0x3f, 0x51, 0xe2, 0x5c, 0x7f, 0x85, 0x86, 0x40, 0xca, 0xfa, 0xc9, 0xd3, 0xc9, 0x17, 0x68, 0x65, 0x07, 0xfa, 0x94, 0xf8, 0x86, 0x6f, 0x86, 0x9a, 0x4e, 0x5a, 0x6a, 0x3d, 0x4f, 0x9d, 0x97, 0xed, 0x81, 0x37, 0xf4, 0x14, 0xd1, 0x44, 0x7a, 0x86, 0xee, 0xf9, 0xe1, 0x49, 0x69, 0x94, 0xad, 0x2d, 0xa5, 0x97 } +, + /* Signature */ + 128, + { 0x9e, 0x93, 0xf7, 0xac, 0xc5, 0x0f, 0xb3, 0xa0, 0xb1, 0x24, 0x3d, 0xc3, 0x38, 0xc8, 0xcc, 0xb1, 0x2b, 0xca, 0xb4, 0xaa, 0x45, 0x04, 0x40, 0xb6, 0x30, 0x6c, 0x81, 0xb5, 0x0b, 0x8f, 0x95, 0xa9, 0x36, 0xdd, 0x16, 0x63, 0x30, 0xc6, 0x99, 0xb2, 0x85, 0x80, 0xda, 0x1b, 0xe2, 0x75, 0x61, 0x64, 0x02, 0xda, 0x85, 0xbf, 0xd8, 0xee, 0xfc, 0xd6, 0x99, 0x35, 0x87, 0xe6, 0x09, 0x28, 0x65, 0xd8, 0x25, 0x3b, 0x04, 0x08, 0x1d, 0x57, 0x2f, 0x26, 0x27, 0x59, 0xf5, 0x56, 0xdf, 0xb9, 0x11, 0xe8, 0xd9, 0x4e, 0x92, 0xe5, 0x5a, 0xf6, 0xd5, 0x89, 0x80, 0x18, 0xff, 0x33, 0xe5, 0xf6, 0xb1, 0xf9, 0x90, 0x19, 0x96, 0xe9, 0x2f, 0xaf, 0x33, 0x6e, 0x2d, 0xcc, 0xe3, 0xab, 0x0a, 0x93, 0xdb, 0x93, 0x2e, 0x94, 0x2c, 0xc6, 0x47, 0x8d, 0x6c, 0xc2, 0xfb, 0x66, 0x08, 0x11, 0x91, 0x0c, 0xcd, 0x17 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.2", + /* Message to be signed */ + 154, + { 0x94, 0x32, 0x3f, 0x7c, 0x38, 0xb9, 0x95, 0xcc, 0x6b, 0xd8, 0x5d, 0x47, 0x9f, 0x8d, 0xe2, 0xde, 0xc1, 0xef, 0x2e, 0x84, 0xb1, 0xfe, 0xef, 0xec, 0xf3, 0x91, 0x50, 0xb5, 0xd9, 0xf2, 0xcb, 0x15, 0x85, 0xac, 0x0d, 0x71, 0x9a, 0xb3, 0x48, 0xbd, 0xc9, 0x75, 0x0d, 0xdb, 0x8e, 0x32, 0x76, 0xdb, 0x89, 0x81, 0x87, 0x35, 0xbd, 0x62, 0x31, 0x41, 0x3c, 0xbc, 0xa2, 0xde, 0x94, 0x1b, 0x55, 0xe8, 0xcf, 0xa1, 0xab, 0x13, 0x2c, 0xc7, 0x8a, 0xa4, 0xf2, 0xb5, 0x1f, 0xd6, 0x57, 0x8e, 0xe2, 0xe0, 0x32, 0xe9, 0x0e, 0x34, 0x08, 0x0f, 0x0f, 0x8e, 0x3d, 0xb1, 0x4d, 0x1b, 0x56, 0xf3, 0xd0, 0x77, 0xf2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x86, 0xf0, 0x77, 0x07, 0x17 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.3", + /* Message to be signed */ + 154, + { 0x0e, 0x23, 0x3b, 0x25, 0x49, 0xbd, 0xd2, 0x1b, 0xa5, 0x14, 0x80, 0xda, 0x8e, 0x3d, 0xce, 0xf4, 0xdb, 0x20, 0xe0, 0xdc, 0xc0, 0x5e, 0xe2, 0x37, 0x35, 0x1e, 0xdb, 0xc9, 0xa5, 0x3c, 0x52, 0xf6, 0x74, 0xd1, 0x05, 0xfe, 0xc0, 0x93, 0x9d, 0x36, 0x99, 0x64, 0x7e, 0xfc, 0x1e, 0x25, 0xcb, 0x4e, 0x9b, 0x1a, 0xb7, 0x52, 0xab, 0x6f, 0xe2, 0x88, 0x69, 0xff, 0x73, 0xf2, 0x3e, 0x01, 0xee, 0xf8, 0x67, 0x4c, 0x53, 0x5c, 0x4c, 0x93, 0x35, 0xf7, 0x98, 0xf1, 0xde, 0xec, 0xd4, 0x89, 0xd0, 0x6d, 0xc8, 0x8f, 0xd6, 0xbc, 0x1d, 0x49, 0x96, 0xef, 0xf7, 0x2b, 0x43, 0x9e, 0x3c, 0x01, 0x4d, 0xd1, 0x4c, 0xbf, 0x17, 0x71, 0x5c, 0x15, 0x89, 0x43, 0xde, 0x2e, 0x6f, 0x97, 0x1c, 0x34, 0x99, 0x87, 0xa1, 0xb3, 0x95, 0xd6, 0x82, 0xc3, 0xb0, 0xc1, 0x7b, 0x66, 0xcd, 0x3c, 0xa4, 0x10, 0x60, 0xb5, 0x71, 0x11, 0xe2, 0x28, 0x31, 0x4b, 0x2d, 0x34, 0xb5, 0xe4, 0x4e, 0x55, 0xf1, 0xc1, 0x1c, 0x31, 0xa6, 0xeb, 0x80, 0xb5, 0xf8, 0x2d, 0x96, 0xbd, 0x4a, 0x17 } +, + /* Signature */ + 128, + { 0xd0, 0x75, 0xbe, 0x06, 0xcb, 0xd6, 0x22, 0x3e, 0x87, 0x1b, 0x0f, 0x33, 0x62, 0xa7, 0x97, 0xde, 0x28, 0x2d, 0xa5, 0xc4, 0x03, 0x23, 0xf3, 0x7c, 0x2c, 0xc3, 0x74, 0x65, 0xa1, 0xa8, 0x63, 0x68, 0xdd, 0xcf, 0xa6, 0xda, 0xa1, 0x35, 0x86, 0x6c, 0x32, 0x03, 0xd0, 0x47, 0x22, 0x60, 0xb2, 0x9c, 0x3c, 0x9b, 0x1b, 0x88, 0x94, 0x08, 0x5d, 0x54, 0x7c, 0x5e, 0xb9, 0x31, 0x42, 0x4f, 0x24, 0x14, 0x0a, 0x5c, 0xba, 0x15, 0x3b, 0xde, 0xd4, 0xb9, 0xce, 0x7d, 0xae, 0xdc, 0x64, 0x5d, 0x39, 0x80, 0xc5, 0xf5, 0x83, 0xf7, 0x67, 0x11, 0xc6, 0x7b, 0x19, 0x3a, 0x52, 0x12, 0xf2, 0xa9, 0x35, 0x4a, 0x67, 0x96, 0xaf, 0x09, 0x08, 0x20, 0x91, 0x31, 0x34, 0xec, 0xf3, 0x05, 0xbe, 0xfb, 0x65, 0x32, 0xcd, 0x48, 0xd4, 0x11, 0x3a, 0x0e, 0xc4, 0x86, 0x9a, 0x0a, 0x56, 0x55, 0xdb, 0xdc, 0x72, 0x59 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.4", + /* Message to be signed */ + 103, + { 0xd4, 0x7c, 0x0f, 0x5c, 0x92, 0x2e, 0x4f, 0x80, 0x9e, 0x9c, 0xee, 0xd2, 0x07, 0xf1, 0x24, 0xa5, 0xac, 0xde, 0x37, 0xfa, 0x14, 0x63, 0x8e, 0x8f, 0xbd, 0x0a, 0x72, 0xfe, 0x45, 0x26, 0x21, 0x95, 0x8e, 0x37, 0x68, 0x2c, 0x6f, 0xf2, 0x83, 0xf3, 0xd5, 0x1d, 0xa1, 0x52, 0xaa, 0x1f, 0x63, 0x74, 0xcd, 0x27, 0xd2, 0xa4, 0xa5, 0x33, 0x05, 0x39, 0x16, 0xdf, 0xf1, 0xc0, 0x7b, 0xa9, 0x36, 0x31, 0x74, 0x81, 0x69, 0x63, 0x60, 0x69, 0x04, 0x58, 0xd8, 0xd1, 0xe5, 0xd6, 0x6c, 0x35, 0xf9, 0xc9, 0x9a, 0x50, 0x55, 0xd9, 0xf7, 0xcf, 0xe7, 0x60, 0x5c, 0xca, 0x57, 0xea, 0xc3, 0x35, 0xad, 0xe2, 0xef, 0xf6, 0xb5, 0xaa, 0x62, 0x7d, 0x5b } +, + /* Signature */ + 128, + { 0x11, 0x86, 0x0b, 0xf4, 0xd7, 0x45, 0x19, 0xff, 0x8c, 0xfc, 0xce, 0x3d, 0x33, 0xe3, 0xaa, 0xbd, 0xf7, 0x71, 0x40, 0xa1, 0x56, 0x36, 0xb2, 0x67, 0x8d, 0xf9, 0x67, 0x31, 0x44, 0xc2, 0x41, 0xb0, 0xa9, 0x9a, 0x0a, 0x37, 0xf2, 0x92, 0xca, 0xd5, 0x1d, 0xf0, 0xb6, 0x3b, 0x14, 0xf8, 0xab, 0x17, 0xe3, 0xfa, 0x15, 0x58, 0x77, 0x90, 0xfb, 0x06, 0x2b, 0x5f, 0x26, 0x6c, 0x16, 0x6b, 0x2c, 0xa7, 0x51, 0x57, 0xa0, 0xf9, 0xe1, 0xa5, 0xc8, 0xec, 0x26, 0xb9, 0x19, 0x9d, 0x07, 0x18, 0x77, 0x99, 0x80, 0x6a, 0x1d, 0xe9, 0x87, 0x15, 0xfb, 0xe5, 0x27, 0x57, 0xa7, 0x03, 0x77, 0x3c, 0x91, 0x8a, 0x00, 0x0c, 0x21, 0x1a, 0x78, 0x22, 0x85, 0x25, 0xcb, 0x52, 0xeb, 0x44, 0x1b, 0x26, 0x9b, 0x3f, 0x33, 0x05, 0x0e, 0xd1, 0x93, 0x5a, 0xc0, 0xe8, 0x59, 0x63, 0x19, 0xae, 0x80, 0xc7, 0x5b, 0x84 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.5", + /* Message to be signed */ + 107, + { 0xbe, 0xbd, 0x9d, 0xde, 0xa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39, 0x2b, 0xed, 0x2e, 0xad, 0x8a, 0x78, 0xf3, 0x81, 0xf4, 0x09, 0x49, 0xcf, 0x1f, 0x3d, 0x27, 0x24, 0x58, 0x1f, 0x25, 0x70, 0x4b, 0xdf, 0x66, 0x08, 0xdd, 0x11, 0x9e, 0x36, 0xd8, 0x7d, 0x03, 0x55, 0xe6, 0x70, 0x6c, 0x8a, 0x52, 0x59, 0xfd, 0x60, 0xc8, 0xdf, 0x13, 0xbc, 0x62, 0xaa, 0x9f, 0xd5, 0x7a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.6", + /* Message to be signed */ + 247, + { 0x9d, 0x19, 0x8e, 0x2c, 0x6e, 0x12, 0xf7, 0x4a, 0x9a, 0x08, 0x1b, 0xcf, 0x70, 0xfc, 0x04, 0x16, 0x8a, 0x49, 0xe0, 0x9c, 0x5f, 0xaa, 0xa0, 0x11, 0xe9, 0xa0, 0x9e, 0x2c, 0x43, 0xee, 0x2c, 0xd3, 0x9b, 0xb2, 0xf7, 0xe5, 0x68, 0x2d, 0xea, 0xb1, 0xfa, 0x11, 0x1e, 0x41, 0xa3, 0x19, 0x4a, 0x20, 0xa8, 0x6d, 0xa5, 0x51, 0x01, 0x82, 0x4d, 0x3d, 0x78, 0xa7, 0xe3, 0x2d, 0xb2, 0xb6, 0x0a, 0xa7, 0x73, 0x77, 0x0b, 0x57, 0x39, 0x07, 0xb4, 0x09, 0xa2, 0x59, 0x2c, 0x83, 0xf3, 0x47, 0xfe, 0xbb, 0x2d, 0x5c, 0x85, 0xe9, 0x25, 0x5d, 0x6d, 0xc1, 0x2a, 0xaa, 0x33, 0x5a, 0xdf, 0xbb, 0x5d, 0xc8, 0x62, 0xd7, 0x86, 0x19, 0x53, 0xe2, 0x68, 0x7d, 0x53, 0x03, 0xb6, 0x86, 0xff, 0xf9, 0x63, 0x4e, 0xe4, 0xd1, 0x5c, 0xbc, 0xc2, 0x9f, 0x7a, 0x35, 0x05, 0xa7, 0x3d, 0xeb, 0x6f, 0x9e, 0x38, 0x8e, 0x96, 0x85, 0xff, 0xf4, 0xd5, 0x45, 0x0f, 0x1e, 0x32, 0x75, 0x35, 0x9a, 0x2b, 0x99, 0x44, 0x0c, 0x67, 0x39, 0xf5, 0xb9, 0x1e, 0xbd, 0x14, 0xef, 0x78, 0xae, 0x73, 0xc1, 0xa6, 0x19, 0x11, 0xf5, 0xae, 0x3a, 0x2b, 0x91, 0x49, 0x67, 0x49, 0x17, 0x27, 0x81, 0x80, 0x65, 0xee, 0x01, 0x0d, 0xf4, 0x9d, 0x5a, 0x16, 0xed, 0x8d, 0xce, 0xe8, 0x48, 0xae, 0x09, 0x48, 0xa2, 0x52, 0x4e, 0xac, 0x7c, 0x4f, 0xf9, 0x09, 0x6c, 0xed, 0x61, 0x35, 0x76, 0x42, 0xc5, 0xe0, 0xf8, 0x06, 0x80, 0xaf, 0xff, 0xce, 0x0b, 0xa7, 0xeb, 0x59, 0x58, 0x99, 0x49, 0x52, 0x6f, 0xf5, 0x12, 0x35, 0xcd, 0xc7, 0x2d, 0x47, 0xa2, 0x7b, 0x39, 0xb8, 0xd4, 0xac, 0x84, 0x9c, 0x3b, 0xc0, 0x4f, 0xa8, 0x36, 0xcf, 0x18, 0x4b, 0xae, 0x0c, 0x83, 0x41, 0x59, 0x56 } +, + /* Signature */ + 128, + { 0x38, 0xef, 0x24, 0x5b, 0x94, 0x0d, 0x93, 0x97, 0x0a, 0x50, 0x3b, 0xf4, 0x3e, 0x28, 0xe1, 0x7b, 0x8a, 0xff, 0x08, 0x3c, 0xcb, 0xe1, 0xe9, 0xc4, 0x8e, 0x4d, 0x80, 0xf5, 0x16, 0xc2, 0x7d, 0x08, 0x5c, 0xa2, 0xa4, 0xe5, 0x73, 0x23, 0x6a, 0x24, 0x94, 0xd9, 0xb9, 0x97, 0xf8, 0x12, 0x48, 0x48, 0x12, 0xf6, 0x65, 0x25, 0xd0, 0x6c, 0x0a, 0x0b, 0xb2, 0x13, 0x0c, 0x15, 0xd6, 0xce, 0x18, 0xb2, 0x2f, 0x3c, 0xee, 0x57, 0x09, 0x7f, 0xc0, 0xd5, 0x58, 0xaf, 0xd9, 0xaf, 0x27, 0xf1, 0x51, 0xf8, 0x43, 0x6f, 0xbc, 0x87, 0xd6, 0xbe, 0x61, 0x42, 0x64, 0x7a, 0x17, 0xe0, 0x4d, 0xf6, 0xde, 0xc7, 0x0a, 0x95, 0xc7, 0xda, 0xa8, 0x4e, 0xde, 0x94, 0xcc, 0xb4, 0x3e, 0x1d, 0x2c, 0x37, 0xb9, 0x45, 0x81, 0x73, 0x10, 0xd1, 0x4a, 0x22, 0xb5, 0xb9, 0xae, 0x61, 0x14, 0x48, 0xee, 0x41, 0xbc, 0x70 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.7", + /* Message to be signed */ + 47, + { 0x8e, 0x8b, 0xa8, 0x43, 0x6f, 0xe3, 0x10, 0x4b, 0x7c, 0xe2, 0xa4, 0xef, 0xc3, 0x6c, 0x85, 0x7d, 0x49, 0xe8, 0x49, 0xc0, 0x08, 0x5f, 0xc6, 0x57, 0xba, 0xa0, 0x33, 0x17, 0x93, 0xb3, 0xf3, 0x6c, 0x7c, 0xe7, 0x38, 0xb6, 0x13, 0x0b, 0xfa, 0xc7, 0x5e, 0x50, 0x11, 0xf3, 0x2a, 0xa3, 0xd1 } +, + /* Signature */ + 128, + { 0x78, 0x44, 0x69, 0x9f, 0x1c, 0x4f, 0x29, 0x6e, 0x50, 0x26, 0x1f, 0x15, 0x26, 0xe0, 0xdd, 0x84, 0xf0, 0x1c, 0x82, 0xcb, 0x85, 0xfa, 0x24, 0x60, 0x9e, 0xb0, 0x33, 0x58, 0x75, 0x2c, 0x6c, 0xf5, 0x99, 0x94, 0xd8, 0x4e, 0x12, 0xf4, 0x6a, 0x72, 0x00, 0xcf, 0x5a, 0xd9, 0x7c, 0x08, 0xdd, 0x4f, 0xfc, 0x44, 0x65, 0x7d, 0xb5, 0x72, 0x14, 0xcd, 0x1f, 0x4e, 0xed, 0x6b, 0x77, 0xd2, 0x39, 0xfb, 0x58, 0x21, 0x69, 0x88, 0xc5, 0xe5, 0xbc, 0x73, 0x5a, 0x4f, 0xdf, 0xf4, 0x08, 0xeb, 0x9f, 0x12, 0x79, 0xd6, 0x5b, 0xba, 0xf6, 0xa6, 0x81, 0x92, 0x44, 0x18, 0x34, 0x9e, 0x62, 0xff, 0x5e, 0x58, 0x15, 0xea, 0xea, 0x59, 0x2d, 0x90, 0xd1, 0xee, 0xf5, 0x56, 0xfc, 0xd4, 0xd5, 0xb4, 0xb8, 0x9c, 0x6c, 0x70, 0x73, 0x9d, 0x6f, 0x0d, 0x3d, 0x0b, 0xd1, 0x6a, 0x50, 0xf1, 0xe0, 0x02, 0x4e, 0x98 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.8", + /* Message to be signed */ + 185, + { 0x58, 0x5f, 0xa6, 0xa7, 0xf7, 0x7a, 0x4b, 0x6e, 0xba, 0x56, 0x90, 0xe7, 0x3e, 0x71, 0x28, 0xb7, 0x2e, 0x67, 0x7c, 0xdb, 0x3a, 0xaa, 0x86, 0x29, 0xed, 0x61, 0xf2, 0xee, 0x63, 0xaf, 0x1a, 0x71, 0xba, 0x87, 0x13, 0x6a, 0x52, 0xdb, 0x1a, 0x33, 0x21, 0xfc, 0xfe, 0xb2, 0x48, 0xbf, 0x2e, 0x5c, 0xf5, 0xc6, 0x39, 0x57, 0x1d, 0x58, 0x95, 0xad, 0xf1, 0xfb, 0x06, 0x17, 0xed, 0x14, 0x0a, 0x2a, 0x0d, 0x98, 0x37, 0xc3, 0xc1, 0xd8, 0x45, 0x0c, 0x28, 0x9d, 0x33, 0xbc, 0x96, 0x23, 0x79, 0xd7, 0x3e, 0x30, 0x87, 0xf2, 0xb7, 0xee, 0x6e, 0xad, 0xd6, 0x65, 0x01, 0x48, 0xc0, 0x42, 0xb6, 0xff, 0x04, 0x48, 0x21, 0x96, 0xc7, 0x18, 0xfd, 0xc0, 0xce, 0x57, 0x9c, 0xeb, 0x62, 0xa8, 0x1e, 0x58, 0x43, 0x73, 0xeb, 0x93, 0x75, 0x40, 0xc4, 0x26, 0xb5, 0x56, 0x6a, 0x9f, 0x40, 0x7c, 0xfc, 0xcf, 0xbc, 0x4b, 0x75, 0x36, 0x94, 0xaf, 0x0d, 0xf4, 0xcd, 0x6a, 0xa9, 0xf1, 0x65, 0x46, 0xa6, 0x33, 0x94, 0xa0, 0xf6, 0x57, 0x73, 0x71, 0x34, 0x3f, 0xfd, 0xdb, 0x65, 0x1a, 0x62, 0xa3, 0xa5, 0x8e, 0xdd, 0xec, 0x67, 0xa2, 0x9c, 0xca, 0xe8, 0x96, 0x56, 0x3c, 0x63, 0xe3, 0xc9, 0x0d, 0x54, 0xd9, 0x13, 0x58, 0xad, 0xf1, 0x94, 0xe6, 0xaa, 0xb1, 0xf9 } +, + /* Signature */ + 128, + { 0x68, 0x93, 0x35, 0x1c, 0x73, 0x91, 0x5f, 0xac, 0x47, 0xc9, 0x62, 0xcc, 0x60, 0x17, 0xca, 0x74, 0xa5, 0xb5, 0xee, 0x4c, 0xb1, 0xbb, 0x5a, 0x10, 0xad, 0xa2, 0xa4, 0x31, 0x58, 0xa2, 0x26, 0x1e, 0xb2, 0x7b, 0x86, 0x6d, 0xb3, 0x9d, 0x35, 0x90, 0xb4, 0xf8, 0xd2, 0x0e, 0xe6, 0x7c, 0xb1, 0xa5, 0x78, 0x94, 0x63, 0x15, 0x0d, 0x83, 0x93, 0x43, 0x23, 0x25, 0x43, 0xc8, 0x26, 0x50, 0x51, 0x01, 0xe1, 0xd2, 0x57, 0x04, 0x26, 0xab, 0x9f, 0xef, 0xd6, 0x5b, 0xa8, 0x4f, 0xaa, 0xec, 0x73, 0x1f, 0x27, 0x37, 0x4a, 0xb1, 0x01, 0x91, 0xc9, 0x60, 0x83, 0x16, 0x93, 0xf2, 0x9a, 0x85, 0x4c, 0x38, 0x12, 0x85, 0x99, 0xf7, 0x28, 0x77, 0x49, 0xb0, 0xb4, 0x8b, 0xf7, 0xe9, 0xdf, 0xda, 0xed, 0xc8, 0x4e, 0xec, 0xe0, 0x71, 0x40, 0x45, 0x84, 0x73, 0x0c, 0xec, 0xce, 0x0d, 0x5c, 0xf0, 0x05, 0xcc } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.9", + /* Message to be signed */ + 5, + { 0x78, 0x3c, 0x18, 0xb1, 0x1f } +, + /* Signature */ + 128, + { 0x13, 0x2f, 0xdf, 0xb8, 0x41, 0x93, 0xdf, 0xb7, 0x9f, 0xdf, 0xe6, 0xba, 0xbc, 0x2e, 0xfd, 0x39, 0xb2, 0x6a, 0xa2, 0x09, 0x68, 0xa0, 0x7c, 0x0e, 0x41, 0x56, 0x0e, 0xe4, 0xdf, 0xcd, 0x4f, 0xca, 0x79, 0x17, 0x49, 0x0f, 0x24, 0xe8, 0xdf, 0x84, 0xf4, 0xe0, 0x11, 0x5a, 0x3e, 0x63, 0x27, 0x3e, 0x7a, 0x3b, 0x12, 0x8a, 0xbb, 0xbd, 0x17, 0xb8, 0xaa, 0x5a, 0x06, 0xba, 0x15, 0x5e, 0xcb, 0x23, 0x0f, 0xe7, 0x97, 0x26, 0x04, 0x79, 0x95, 0x70, 0x10, 0xe4, 0x4b, 0xa5, 0x75, 0x29, 0x2e, 0xc3, 0xf1, 0x51, 0xab, 0xf4, 0x8e, 0x91, 0x03, 0xe5, 0x51, 0x42, 0xec, 0x67, 0xa4, 0x13, 0x4d, 0xd8, 0xf3, 0x8e, 0xc6, 0x59, 0xf9, 0xa7, 0x89, 0xfd, 0x03, 0x41, 0xce, 0xf2, 0xbb, 0xcf, 0x9f, 0x52, 0x9b, 0x93, 0x21, 0x8f, 0xc3, 0xe4, 0x3a, 0x76, 0x69, 0x69, 0xd1, 0xbf, 0x87, 0x88, 0x48, 0x07 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.10", + /* Message to be signed */ + 85, + { 0x96, 0xdc, 0x98, 0xb0, 0xeb, 0x84, 0xf5, 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0x15, 0x21, 0x3e, 0xca, 0x3b, 0x11, 0x15, 0xec, 0x8f, 0x58, 0xf8, 0x77, 0xbe, 0x8f, 0xbd, 0x38, 0xf4, 0xfd, 0xae, 0xf9, 0x39, 0xf5, 0x26, 0x40 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.11", + /* Message to be signed */ + 115, + { 0x37, 0x20, 0x01, 0x59, 0x9d, 0x99, 0x30, 0xc7, 0xd5, 0x57, 0x45, 0x8b, 0x43, 0x6d, 0xec, 0xfd, 0xc1, 0x4d, 0x06, 0xcb, 0x7b, 0x96, 0xb0, 0x67, 0x18, 0xc4, 0x8d, 0x7d, 0xe5, 0x74, 0x82, 0xa8, 0x68, 0xae, 0x7f, 0x06, 0x58, 0x70, 0xa6, 0x21, 0x65, 0x06, 0xd1, 0x1b, 0x77, 0x93, 0x23, 0xdf, 0xdf, 0x04, 0x6c, 0xf5, 0x77, 0x51, 0x29, 0x13, 0x4b, 0x4d, 0x56, 0x89, 0xe4, 0xd9, 0xc0, 0xce, 0x1e, 0x12, 0xd7, 0xd4, 0xb0, 0x6c, 0xb5, 0xfc, 0x58, 0x20, 0xde, 0xcf, 0xa4, 0x1b, 0xaf, 0x59, 0xbf, 0x25, 0x7b, 0x32, 0xf0, 0x25, 0xb7, 0x67, 0x9b, 0x44, 0x5b, 0x94, 0x99, 0xc9, 0x25, 0x55, 0x14, 0x58, 0x85, 0x99, 0x2f, 0x1b, 0x76, 0xf8, 0x48, 0x91, 0xee, 0x4d, 0x3b, 0xe0, 0xf5, 0x15, 0x0f, 0xd5, 0x90 } +, + /* Signature */ + 128, + { 0xa8, 0x97, 0xc7, 0xf9, 0x72, 0xe1, 0x17, 0x49, 0xe1, 0xe7, 0xc1, 0x55, 0xce, 0x94, 0x62, 0xaa, 0x7e, 0x1c, 0xc0, 0xa9, 0x79, 0xc1, 0x27, 0x29, 0x79, 0x51, 0x26, 0xcb, 0x8c, 0x0e, 0xa5, 0x02, 0x21, 0xc4, 0x26, 0xf1, 0xbb, 0x06, 0xc1, 0xca, 0xf7, 0xc5, 0x1a, 0xc2, 0xfb, 0xd9, 0x4d, 0x68, 0x8d, 0xa6, 0x7d, 0xdf, 0x3e, 0xf6, 0x66, 0x06, 0xe9, 0x89, 0xa1, 0x6d, 0xe1, 0xf9, 0x2b, 0x17, 0x70, 0x6f, 0x88, 0xe8, 0x7d, 0x9f, 0x14, 0x69, 0xa0, 0x05, 0xc9, 0xfd, 0x76, 0x78, 0x8e, 0xe8, 0xc4, 0xa7, 0xf0, 0x12, 0x09, 0xe2, 0x8b, 0x86, 0xf6, 0x74, 0x88, 0x1a, 0xf5, 0x7d, 0xb6, 0xc3, 0x42, 0x9b, 0x6f, 0xb4, 0x56, 0x98, 0xbf, 0x5d, 0x30, 0x07, 0xf6, 0x1c, 0x7d, 0x44, 0x11, 0x78, 0xad, 0x12, 0x43, 0xa4, 0x9b, 0x2a, 0xa6, 0x02, 0x9b, 0xfe, 0x90, 0x2d, 0x26, 0xe4, 0x23, 0x75 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.12", + /* Message to be signed */ + 35, + { 0xbf, 0xbf, 0xd0, 0x73, 0x21, 0xf0, 0xf1, 0xd5, 0xfa, 0x9f, 0xdf, 0x00, 0x14, 0xc2, 0xfc, 0xb0, 0x35, 0x8a, 0xad, 0x0e, 0x35, 0x4b, 0x0d, 0x29, 0x08, 0x1b, 0x23, 0x3b, 0x43, 0x56, 0x77, 0x50, 0xbd, 0x6e, 0x78 } +, + /* Signature */ + 128, + { 0xc2, 0x4d, 0x31, 0x04, 0x94, 0x09, 0xaa, 0x16, 0xd3, 0xf9, 0x72, 0xef, 0x8b, 0x75, 0x95, 0xea, 0xa0, 0x07, 0x83, 0x3e, 0x2b, 0xcd, 0xc7, 0x50, 0x48, 0x52, 0xf2, 0x50, 0x5f, 0xba, 0x1f, 0xc1, 0x5f, 0x19, 0xa0, 0xea, 0xdd, 0xe8, 0x33, 0x5c, 0x73, 0x06, 0xfc, 0x3f, 0x51, 0x66, 0x1d, 0xa5, 0x20, 0xec, 0xc8, 0xdb, 0x7f, 0x47, 0x38, 0x85, 0xca, 0xbd, 0xe9, 0x3f, 0x0c, 0xeb, 0xf1, 0xdf, 0x9e, 0x8a, 0x82, 0x37, 0x0b, 0x00, 0xa0, 0x43, 0xad, 0x63, 0x2c, 0xdc, 0xc7, 0x8f, 0x3f, 0xac, 0x1d, 0x8a, 0x37, 0x57, 0xfc, 0x8e, 0x52, 0x41, 0xbf, 0xed, 0x55, 0xc4, 0x96, 0x04, 0xac, 0x19, 0xab, 0xda, 0xc0, 0xc9, 0xc4, 0x0d, 0xa3, 0x73, 0xc1, 0x5f, 0x3c, 0x1b, 0xcc, 0x97, 0x3f, 0xfb, 0x4f, 0x8b, 0x7b, 0x5b, 0x55, 0x3a, 0xe0, 0x75, 0xe1, 0xb1, 0xbd, 0xdd, 0xd2, 0x3d, 0x7d, 0x2a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.13", + /* Message to be signed */ + 107, + { 0xc6, 0x97, 0x39, 0xd2, 0x2a, 0xc8, 0x96, 0x6b, 0xf1, 0x1c, 0x11, 0x6f, 0x61, 0x4b, 0x16, 0x67, 0x40, 0xe9, 0x6b, 0x90, 0x65, 0x3e, 0x57, 0x50, 0x94, 0x5f, 0xcf, 0x77, 0x21, 0x86, 0xc0, 0x37, 0x90, 0xa0, 0x7f, 0xda, 0x32, 0x3e, 0x1a, 0x61, 0x91, 0x6b, 0x06, 0xee, 0x21, 0x57, 0xdb, 0x3d, 0xff, 0x80, 0xd6, 0x7d, 0x5e, 0x39, 0xa5, 0x3a, 0xe2, 0x68, 0xc8, 0xf0, 0x9e, 0xd9, 0x9a, 0x73, 0x20, 0x05, 0xb0, 0xbc, 0x6a, 0x04, 0xaf, 0x4e, 0x08, 0xd5, 0x7a, 0x00, 0xe7, 0x20, 0x1b, 0x30, 0x60, 0xef, 0xaa, 0xdb, 0x73, 0x11, 0x3b, 0xfc, 0x08, 0x7f, 0xd8, 0x37, 0x09, 0x3a, 0xa2, 0x52, 0x35, 0xb8, 0xc1, 0x49, 0xf5, 0x62, 0x15, 0xf0, 0x31, 0xc2, 0x4a } +, + /* Signature */ + 128, + { 0xd0, 0x6d, 0x32, 0x26, 0x0d, 0xa2, 0xdb, 0x48, 0x10, 0x4f, 0xbd, 0xc2, 0x4e, 0x16, 0xa6, 0x5b, 0x48, 0x73, 0x7d, 0x43, 0xce, 0x24, 0x37, 0x04, 0x04, 0x2a, 0xad, 0x6c, 0x03, 0xfd, 0xe5, 0xa3, 0xdc, 0x0f, 0x2c, 0xc6, 0xe3, 0xad, 0x68, 0xc3, 0xc6, 0x2e, 0xab, 0xfa, 0x1f, 0x7b, 0x1c, 0xab, 0x00, 0x9d, 0x11, 0x75, 0xaf, 0xf7, 0x7b, 0xe5, 0x8f, 0xb1, 0x2a, 0x4e, 0x58, 0x12, 0x7f, 0xed, 0x63, 0xea, 0x3d, 0xf4, 0x41, 0x81, 0xbd, 0xa3, 0x8c, 0x77, 0x3c, 0x83, 0xb9, 0xe8, 0x04, 0xbb, 0x3d, 0xb7, 0x96, 0x32, 0x63, 0xdf, 0x30, 0xe9, 0x2c, 0x4c, 0x27, 0x19, 0x56, 0xe7, 0xe8, 0x10, 0x45, 0x2c, 0x15, 0xe0, 0x6e, 0x93, 0x96, 0x66, 0xdf, 0x0c, 0x83, 0x34, 0x03, 0x30, 0x96, 0xc0, 0x7d, 0xea, 0x05, 0xb4, 0x4e, 0xbb, 0x14, 0x24, 0x92, 0xe7, 0x66, 0x91, 0x31, 0xeb, 0xcf, 0x2c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.14", + /* Message to be signed */ + 16, + { 0x73, 0x30, 0x47, 0xf3, 0x36, 0xf9, 0x15, 0x47, 0x38, 0x67, 0x45, 0x47, 0xdb, 0x02, 0xa9, 0xf4 } +, + /* Signature */ + 128, + { 0xc1, 0x13, 0xc0, 0x46, 0x5c, 0x84, 0xcb, 0xfb, 0x0f, 0xa1, 0xbd, 0xbc, 0x54, 0xc3, 0xe1, 0x06, 0x8c, 0xa2, 0x3e, 0x69, 0xb8, 0x39, 0x19, 0x09, 0xc3, 0x90, 0x0f, 0xe5, 0xb4, 0xe7, 0xe3, 0xf0, 0x34, 0xc9, 0xa9, 0x88, 0xa3, 0xdd, 0xc3, 0xc3, 0x81, 0x75, 0x6a, 0x1e, 0x1a, 0x27, 0xc1, 0xec, 0xfb, 0x3a, 0x70, 0xe1, 0xee, 0x0e, 0x92, 0x04, 0x18, 0xac, 0x4a, 0xb6, 0xd9, 0x53, 0x2b, 0x8d, 0x09, 0x59, 0xa6, 0x53, 0xb4, 0xc5, 0x08, 0x67, 0x06, 0x63, 0x46, 0x2b, 0x2e, 0x13, 0x58, 0x16, 0xb6, 0x94, 0xa6, 0xb9, 0xb4, 0x68, 0xa2, 0x9f, 0x38, 0xde, 0x53, 0xbf, 0xcd, 0xdf, 0x97, 0xe0, 0x3d, 0x8d, 0xd2, 0x4f, 0x97, 0x26, 0x33, 0xa4, 0x9c, 0xf3, 0xea, 0xae, 0x1d, 0x69, 0x62, 0x94, 0x38, 0x60, 0xdd, 0x25, 0x43, 0x40, 0x08, 0x6b, 0x10, 0x35, 0x7b, 0x80, 0xc1, 0xcf, 0xbf, 0x31 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.15", + /* Message to be signed */ + 119, + { 0xa9, 0x74, 0x0b, 0x9a, 0xa0, 0xd3, 0x40, 0x58, 0xfd, 0x3b, 0x90, 0x6e, 0x4f, 0x78, 0x59, 0xdf, 0xb0, 0x7d, 0x71, 0x73, 0xe5, 0xe6, 0xf6, 0x35, 0x0a, 0xda, 0xc2, 0x1f, 0x27, 0xb2, 0x30, 0x74, 0x69, 0xbd, 0x0c, 0xe1, 0x95, 0x49, 0xd0, 0x70, 0x01, 0x20, 0xcb, 0xe5, 0x10, 0x77, 0xdb, 0xbb, 0xb0, 0x0a, 0x8d, 0x8b, 0x09, 0xde, 0x8d, 0x83, 0x96, 0xe3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b1, 0xa5, 0x8b, 0xa2, 0xe4, 0xb3, 0x68, 0x5b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.16", + /* Message to be signed */ + 51, + { 0xaf, 0x8f, 0x08, 0x87, 0xc2, 0x19, 0x00, 0x4d, 0x2a, 0xbd, 0x89, 0x4e, 0xa9, 0x25, 0x59, 0xee, 0x31, 0x98, 0xaf, 0x3a, 0x73, 0x4f, 0xe9, 0xb9, 0x63, 0x8c, 0x26, 0x3a, 0x72, 0x8a, 0xd9, 0x5a, 0x5a, 0xe8, 0xce, 0x3e, 0xb1, 0x58, 0x39, 0xf3, 0xaa, 0x78, 0x52, 0xbb, 0x39, 0x07, 0x06, 0xe7, 0x76, 0x0e, 0x43 } +, + /* Signature */ + 128, + { 0x32, 0x7e, 0xc9, 0xd0, 0xbe, 0x7a, 0xab, 0x7b, 0xc9, 0x59, 0xd4, 0x02, 0x27, 0xe1, 0xd0, 0x04, 0x81, 0xfc, 0x04, 0x01, 0x1f, 0xe0, 0x8f, 0xd5, 0x44, 0x9b, 0x90, 0xc0, 0xf0, 0x54, 0xe0, 0xd6, 0x59, 0xb9, 0x26, 0xcc, 0x81, 0x29, 0x21, 0xc2, 0x0a, 0x56, 0x3c, 0x4a, 0xbe, 0x4f, 0x82, 0x5d, 0x6b, 0x5e, 0xef, 0x57, 0xb3, 0xe2, 0xd6, 0x5d, 0x20, 0xa8, 0x01, 0x3a, 0x50, 0xdd, 0x5c, 0x93, 0x23, 0x8c, 0xf0, 0x49, 0xf2, 0xff, 0x0c, 0x7e, 0xbe, 0xb8, 0xe8, 0xca, 0xf7, 0x2e, 0x46, 0xe7, 0xcf, 0x8a, 0x0c, 0x3f, 0x49, 0x25, 0x61, 0x6b, 0x1b, 0xc1, 0x82, 0x6f, 0xfc, 0xb0, 0xbd, 0xa6, 0x0b, 0xbe, 0xbe, 0xdf, 0xd4, 0xc6, 0x0f, 0x27, 0x88, 0xd1, 0x66, 0x6f, 0xb8, 0x45, 0x11, 0x85, 0x36, 0x46, 0xc2, 0xdd, 0x46, 0x68, 0x51, 0xfa, 0xc8, 0x5b, 0xe0, 0xed, 0x5a, 0xce, 0x5f, 0xe2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.17", + /* Message to be signed */ + 115, + { 0x38, 0xdf, 0x86, 0x55, 0x7f, 0x37, 0x5d, 0x09, 0xcc, 0xd8, 0xbd, 0x15, 0xd8, 0xcc, 0xf6, 0x1f, 0x5d, 0x78, 0xca, 0x5c, 0x7f, 0x5c, 0xde, 0x78, 0x2e, 0x6b, 0xf5, 0xd0, 0x05, 0x70, 0x56, 0xd4, 0xba, 0xd9, 0x8b, 0x3d, 0x2f, 0x95, 0x75, 0xe8, 0x24, 0xab, 0x7a, 0x33, 0xff, 0x57, 0xb0, 0xac, 0x10, 0x0a, 0xb0, 0xd6, 0xea, 0xd7, 0xaa, 0x0b, 0x50, 0xf6, 0xe4, 0xd3, 0xe5, 0xec, 0x0b, 0x96, 0x6b, 0x81, 0x57, 0x79, 0xa9, 0x1b, 0x3a, 0x8b, 0xd0, 0x49, 0xbf, 0x2a, 0xeb, 0x92, 0x01, 0x42, 0x77, 0x22, 0x22, 0xc9, 0xca, 0x0c, 0x32, 0x8c, 0x65, 0x9e, 0x0a, 0x64, 0x37, 0x43, 0x3c, 0xce, 0xb7, 0x3c, 0x14, 0x9a, 0xec, 0x4a, 0x74, 0x80, 0xd5, 0xbb, 0xc4, 0x29, 0x20, 0xd7, 0xca, 0x23, 0x5d, 0xb6, 0x74 } +, + /* Signature */ + 128, + { 0x30, 0x46, 0x05, 0x5c, 0x2b, 0x8e, 0xf7, 0xfa, 0x92, 0xc8, 0xa9, 0xe3, 0x95, 0x98, 0x5b, 0xd4, 0x60, 0xfb, 0x6b, 0x47, 0x98, 0x65, 0x53, 0x94, 0x4d, 0x21, 0x04, 0x51, 0x19, 0xf7, 0xe7, 0x61, 0x7e, 0x03, 0xfe, 0x80, 0x87, 0x0a, 0xc6, 0xaa, 0xbf, 0x63, 0xb0, 0x96, 0xca, 0xd5, 0xcc, 0xe7, 0xf5, 0x06, 0x95, 0x3a, 0x7f, 0x69, 0x3f, 0xe1, 0x37, 0xad, 0xfb, 0x97, 0xcd, 0x45, 0x81, 0x28, 0xae, 0x95, 0xc4, 0x7c, 0xa9, 0x48, 0xda, 0xcf, 0x24, 0x03, 0x6a, 0xde, 0xaa, 0x48, 0xf2, 0x9a, 0x46, 0x9f, 0xb5, 0x13, 0x19, 0x1e, 0x05, 0xac, 0xf7, 0x9e, 0x67, 0xa7, 0x93, 0xa3, 0xaf, 0x5e, 0x4f, 0x9c, 0x6d, 0x0d, 0x01, 0xfd, 0xd0, 0xe0, 0xcd, 0x42, 0x96, 0xad, 0x3d, 0xa2, 0xca, 0x89, 0xa5, 0x0e, 0xed, 0xcd, 0x9f, 0x7b, 0x87, 0x7d, 0x2a, 0xe1, 0xd5, 0x8d, 0x98, 0xdc, 0xd7, 0x8f } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.18", + /* Message to be signed */ + 12, + { 0xcb, 0x34, 0xed, 0xd5, 0xab, 0x65, 0x40, 0x41, 0xb6, 0x14, 0x30, 0x56 } +, + /* Signature */ + 128, + { 0x1d, 0xdf, 0x48, 0xba, 0x53, 0x51, 0xbe, 0xd0, 0x79, 0x5f, 0x55, 0xb3, 0x06, 0xaa, 0x1c, 0x6e, 0xd8, 0x36, 0xf5, 0x92, 0xba, 0x93, 0xcf, 0x0c, 0x46, 0xb7, 0xc2, 0x73, 0x70, 0x9d, 0x36, 0xb8, 0xdf, 0xf0, 0x2a, 0xbd, 0xb1, 0xa7, 0x68, 0xd1, 0xc7, 0x11, 0x4a, 0x86, 0xa4, 0x57, 0x49, 0x6d, 0xa5, 0x79, 0xe4, 0xd8, 0x19, 0xf7, 0x2a, 0x19, 0x2e, 0x29, 0x8b, 0xe2, 0x15, 0x2f, 0x7c, 0xf3, 0x9d, 0x1e, 0x30, 0x82, 0x7d, 0x02, 0x82, 0xcc, 0xf3, 0x4d, 0xc8, 0x88, 0x9f, 0x1c, 0x2f, 0x59, 0x70, 0x93, 0x0d, 0x97, 0x35, 0x04, 0x2f, 0x8a, 0x5a, 0x71, 0x22, 0x63, 0x16, 0x5d, 0x6e, 0x6c, 0x50, 0x35, 0xe2, 0xe4, 0xa5, 0x0e, 0x86, 0x3c, 0x06, 0x79, 0x9e, 0x3c, 0x89, 0xcc, 0xb5, 0xcb, 0x0e, 0x70, 0xb3, 0xc9, 0x9c, 0x08, 0x40, 0x30, 0x67, 0x7a, 0x7c, 0x97, 0x90, 0x7a, 0x17, 0x24 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.19", + /* Message to be signed */ + 181, + { 0x5b, 0x09, 0xec, 0x88, 0xb1, 0x52, 0x71, 0x78, 0xfa, 0x04, 0x32, 0x63, 0xf3, 0x06, 0x7d, 0x9f, 0xfe, 0x97, 0x30, 0x32, 0xa9, 0x9f, 0x4c, 0xb0, 0x8a, 0xd2, 0xc7, 0xe0, 0xa2, 0x45, 0x6c, 0xdd, 0x57, 0xa7, 0xdf, 0x56, 0xfe, 0x60, 0x53, 0x52, 0x7a, 0x5a, 0xeb, 0x67, 0xd7, 0xe5, 0x52, 0x06, 0x3c, 0x1c, 0xa9, 0x7b, 0x1b, 0xef, 0xfa, 0x7b, 0x39, 0xe9, 0x97, 0xca, 0xf2, 0x78, 0x78, 0xea, 0x0f, 0x62, 0xcb, 0xeb, 0xc8, 0xc2, 0x1d, 0xf4, 0xc8, 0x89, 0xa2, 0x02, 0x85, 0x1e, 0x94, 0x90, 0x88, 0x49, 0x0c, 0x24, 0x9b, 0x6e, 0x9a, 0xcf, 0x1d, 0x80, 0x63, 0xf5, 0xbe, 0x23, 0x43, 0x98, 0x9b, 0xf9, 0x5c, 0x4d, 0xa0, 0x1a, 0x2b, 0xe7, 0x8b, 0x4a, 0xb6, 0xb3, 0x78, 0x01, 0x5b, 0xc3, 0x79, 0x57, 0xf7, 0x69, 0x48, 0xb5, 0xe5, 0x8e, 0x44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a, 0x0f, 0x7b, 0x23, 0x4a, 0x28, 0x65, 0x0a, 0x30 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 4.20", + /* Message to be signed */ + 17, + { 0x3c, 0x33, 0x0c, 0x1e, 0xf7, 0x18, 0xc1, 0x41, 0xe4, 0x7b, 0x8f, 0xa8, 0x59, 0xbe, 0x4d, 0x5b, 0x96 } +, + /* Signature */ + 128, + { 0x0b, 0x10, 0x22, 0xdc, 0x38, 0xe2, 0x17, 0xfd, 0x3b, 0x0e, 0x7e, 0xf1, 0x9d, 0xfc, 0xb4, 0xb4, 0x56, 0x36, 0x62, 0x40, 0x98, 0x30, 0x95, 0xf6, 0xdb, 0x96, 0x58, 0x31, 0xa7, 0x0f, 0x0f, 0x8e, 0x20, 0xe2, 0xdd, 0x2a, 0xc2, 0x31, 0xcc, 0x37, 0x90, 0x45, 0xc2, 0x73, 0x65, 0xe7, 0x3a, 0x53, 0x71, 0x9b, 0xb6, 0xf0, 0x11, 0xc3, 0xf8, 0x63, 0x6b, 0x64, 0x99, 0x4c, 0xa4, 0x80, 0x60, 0x2f, 0xb3, 0xb4, 0xf0, 0xe2, 0x27, 0x4b, 0x58, 0xb3, 0x63, 0xe0, 0xd3, 0x08, 0xb5, 0x28, 0xe1, 0x58, 0x59, 0xa9, 0x1d, 0xcf, 0x99, 0xbf, 0xfe, 0xfb, 0xc8, 0x05, 0x22, 0x41, 0xb9, 0x74, 0x19, 0x2e, 0x63, 0x62, 0x18, 0xf3, 0x98, 0x33, 0x2d, 0xaf, 0xe8, 0x25, 0x9c, 0xa5, 0xf5, 0xcc, 0xfa, 0x54, 0xc9, 0xb3, 0x2b, 0x27, 0x35, 0xaf, 0x07, 0x24, 0xf4, 0x0b, 0x5a, 0x5d, 0x61, 0x21, 0xa4, 0x0d } + +} +, +} +}, +{ + "Example 5: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xc5, 0x5f, 0xfb, 0xdd, 0x6a, 0x27, 0x53, 0xbc, 0x02, 0xaf, 0x20, 0xae, 0x18, 0xea, 0x0d, 0xaf, 0x23, 0x0b, 0xb6, 0xf8, 0x79, 0x5d, 0x05, 0xef, 0xec, 0xc8, 0x15, 0xba, 0xec, 0xe2, 0x2b, 0x38, 0x79, 0x99, 0x5f, 0x6d, 0x97, 0x64, 0xc1, 0xdf, 0x8f, 0x97, 0x85, 0x13, 0x81, 0x68, 0x62, 0x66, 0xb8, 0x09, 0x2f, 0xb6, 0x01, 0x18, 0x98, 0xa7, 0x67, 0x07, 0xa4, 0xd1, 0xd5, 0xbd, 0xa0, 0x8d, 0x24, 0x6c, 0x68, 0x7a, 0x8b, 0xba, 0xfa, 0x63, 0x98, 0xac, 0x9e, 0xa2, 0x72, 0x68, 0x23, 0x71, 0x4a, 0x0c, 0x39, 0x34, 0xca, 0x6e, 0x5f, 0x8c, 0xe3, 0x39, 0x87, 0xb5, 0x34, 0x85, 0x7e, 0xa9, 0xf8, 0x5c, 0xc4, 0xe1, 0x9a, 0x1d, 0x21, 0x83, 0xe0, 0xe4, 0xc8, 0xaa, 0x55, 0xcb, 0x22, 0x7b, 0x0e, 0x56, 0xce, 0xb2, 0xb6, 0x2b, 0x30, 0xef, 0xc7, 0x88, 0x64, 0xb2, 0xf9, 0xfb, 0x92, 0x49 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x07, 0xe3, 0xfa, 0x71, 0xb3, 0x98, 0xb6, 0xe4, 0x41, 0x47, 0x37, 0x0b, 0x3e, 0xbb, 0xbc, 0xa8, 0x4f, 0xc2, 0x5c, 0x22, 0x3a, 0xd7, 0xd9, 0x30, 0xea, 0x4a, 0x65, 0x73, 0xff, 0x9c, 0x5b, 0x15, 0xfa, 0xe6, 0x82, 0xc6, 0x22, 0xd3, 0x48, 0x5c, 0xe3, 0xa4, 0xaf, 0x11, 0x44, 0x8f, 0x23, 0xbf, 0xef, 0x83, 0x8e, 0x80, 0xbc, 0x32, 0x7b, 0x87, 0x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, 0x6c, 0x56, 0xb9, 0x76, 0x3c, 0xcd, 0xae, 0x4d, 0xea, 0x33, 0x08, 0xeb, 0x0a, 0xc2, 0xa8, 0x95, 0x01, 0xcb, 0x20, 0x9d, 0x26, 0x39, 0xfc, 0xff } +, + /* Prime exponent 1 */ + 64, + { 0x6c, 0x76, 0x27, 0xbc, 0xa1, 0x3c, 0xde, 0xa4, 0x96, 0xa4, 0x77, 0x31, 0x89, 0x90, 0xbb, 0x7a, 0x5e, 0x40, 0xce, 0x9c, 0x99, 0x24, 0xe4, 0x19, 0x3d, 0xbb, 0x07, 0x14, 0x3b, 0x34, 0x52, 0x3b, 0x5f, 0x31, 0xbb, 0x52, 0x55, 0x37, 0x54, 0xf4, 0x73, 0x05, 0x39, 0xa6, 0xcb, 0x1e, 0x06, 0xf0, 0x52, 0xb5, 0x12, 0x6f, 0x01, 0x09, 0xda, 0xc7, 0xb3, 0x09, 0x07, 0xba, 0x80, 0x50, 0xeb, 0xbd } +, + /* Prime exponent 2 */ + 64, + { 0x40, 0x92, 0x74, 0x80, 0x43, 0xa9, 0xd4, 0xaf, 0x92, 0x69, 0xab, 0x36, 0x09, 0xf1, 0x2f, 0x13, 0x9a, 0xde, 0x75, 0x65, 0xe9, 0x96, 0x91, 0x8f, 0xa0, 0x81, 0xed, 0x4d, 0x9d, 0x8a, 0x39, 0x78, 0xfa, 0x92, 0x7a, 0xd6, 0x1c, 0xdf, 0x07, 0xc6, 0x1c, 0xee, 0xde, 0x96, 0xb9, 0x6d, 0xf4, 0x6e, 0x7c, 0x68, 0xef, 0xca, 0x8b, 0xfe, 0x63, 0xad, 0xd4, 0x83, 0xaa, 0x32, 0x22, 0x8a, 0xfd, 0xc1 } +, + /* Coefficient */ + 64, + { 0x2a, 0x61, 0x94, 0xca, 0x29, 0x70, 0x72, 0x38, 0x45, 0xff, 0xf3, 0x8c, 0xa1, 0xa9, 0xa3, 0xb5, 0x66, 0xb4, 0x24, 0x5d, 0xe2, 0xf9, 0x01, 0x34, 0xb8, 0xe6, 0xae, 0xc8, 0xae, 0x07, 0xf3, 0xbb, 0x7c, 0x5e, 0x5a, 0xe6, 0xe1, 0x83, 0x34, 0x85, 0xe5, 0x5d, 0x8c, 0xa6, 0x0c, 0xe1, 0x64, 0x2f, 0x72, 0x75, 0x96, 0x8e, 0x66, 0x12, 0x38, 0x35, 0x52, 0x11, 0xc6, 0x38, 0x48, 0x94, 0x0f, 0x3c } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 5.1", + /* Message to be signed */ + 187, + { 0xea, 0xe9, 0xa4, 0x0b, 0xff, 0x18, 0x3f, 0x41, 0x14, 0x73, 0x2e, 0x7b, 0x3b, 0xa5, 0x56, 0xf4, 0xce, 0x28, 0x8d, 0xaa, 0x83, 0xe3, 0xff, 0x23, 0x61, 0x12, 0x44, 0xa7, 0xa0, 0x90, 0x1f, 0x11, 0x7d, 0x86, 0xc0, 0x9c, 0x33, 0xa5, 0x23, 0x2b, 0xd3, 0x20, 0xfa, 0x37, 0xa2, 0x38, 0xa8, 0xaa, 0x62, 0xdd, 0x21, 0xab, 0xbf, 0xac, 0xdb, 0x93, 0xfa, 0x1c, 0x44, 0xcc, 0x55, 0xac, 0x61, 0xbe, 0xa2, 0x4a, 0x6a, 0x34, 0xcc, 0x64, 0x76, 0x75, 0x38, 0x37, 0xe1, 0x6f, 0xac, 0xd8, 0x2e, 0xb4, 0x9e, 0x1c, 0x57, 0xc9, 0x58, 0xfb, 0xbf, 0xf5, 0x68, 0x88, 0x7c, 0xf8, 0x2e, 0xeb, 0xe9, 0x61, 0xe5, 0x80, 0xe0, 0x64, 0xdb, 0x9c, 0xbe, 0xc3, 0xb5, 0x3d, 0xf1, 0xf2, 0x71, 0x99, 0xe4, 0x9a, 0x04, 0xcb, 0xe5, 0x9c, 0x69, 0xa2, 0x65, 0xcf, 0xac, 0x8c, 0xe4, 0xf9, 0x1c, 0xa9, 0x5d, 0x52, 0xb1, 0x14, 0x5c, 0x8b, 0x9f, 0x44, 0x40, 0xb3, 0x9c, 0x18, 0x50, 0x94, 0xbe, 0x18, 0x48, 0x74, 0xda, 0x59, 0x71, 0xd7, 0xd7, 0x63, 0xfe, 0x07, 0xce, 0x16, 0xe5, 0x7f, 0x1e, 0x50, 0xd2, 0x28, 0x65, 0x04, 0xb4, 0x81, 0xe2, 0xc6, 0x85, 0xbc, 0x9d, 0x9c, 0x01, 0x49, 0x3f, 0xd3, 0xa6, 0xd8, 0xbb, 0x9b, 0x2e, 0x96, 0xbf, 0xde, 0xb6, 0xc9, 0x29, 0x14, 0xca } +, + /* Signature */ + 128, + { 0x44, 0xce, 0xb4, 0x42, 0x24, 0x2b, 0xae, 0x08, 0x59, 0x94, 0xea, 0xd0, 0x7b, 0x70, 0x95, 0x43, 0xea, 0x23, 0x95, 0xa6, 0xe8, 0xd4, 0x64, 0x73, 0xd7, 0x0d, 0xf3, 0x4a, 0x95, 0x55, 0xaa, 0x56, 0x7f, 0x4d, 0xa1, 0x38, 0xe9, 0x63, 0xfe, 0x92, 0x86, 0xa8, 0x4f, 0xb7, 0xc5, 0xcf, 0x82, 0x00, 0x03, 0x59, 0x04, 0xb5, 0x0c, 0x32, 0x40, 0x3c, 0xae, 0x51, 0x7b, 0xfa, 0x7f, 0xca, 0x8a, 0x66, 0xfc, 0xfd, 0x63, 0x2a, 0xf7, 0x47, 0xc4, 0x9c, 0xdf, 0xb0, 0xb9, 0xae, 0xe3, 0x52, 0x28, 0xb7, 0xdc, 0x4c, 0x21, 0x00, 0x39, 0x69, 0xb0, 0xa0, 0x13, 0xed, 0xe1, 0x29, 0x2b, 0x65, 0xd1, 0x0a, 0x50, 0xc9, 0x02, 0x63, 0xfb, 0x0b, 0xf4, 0xf4, 0xb8, 0x37, 0x66, 0x41, 0xb0, 0x3e, 0x1f, 0xaf, 0xb8, 0x83, 0xf0, 0x38, 0xf4, 0x32, 0x3d, 0xfe, 0x5b, 0xea, 0xc4, 0x68, 0xde, 0xea, 0x99, 0xc3 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.2", + /* Message to be signed */ + 92, + { 0x9d, 0xe5, 0xca, 0x46, 0x74, 0x85, 0x61, 0xa0, 0xb9, 0x28, 0xb2, 0x60, 0xa9, 0x5a, 0x3e, 0xd9, 0x20, 0xad, 0xc8, 0xd5, 0xee, 0xb9, 0x27, 0x1d, 0xc7, 0x1b, 0xc1, 0x4f, 0x69, 0xcc, 0xd6, 0x31, 0x1d, 0x18, 0x6a, 0x77, 0x9f, 0x5e, 0xb8, 0xdb, 0x17, 0xc6, 0x90, 0xd6, 0x86, 0x7c, 0xf3, 0x36, 0x9b, 0xbf, 0xf1, 0x5f, 0xab, 0xb3, 0xcd, 0x2c, 0xfd, 0xd6, 0xf7, 0xd7, 0x52, 0x86, 0xff, 0x2d, 0x24, 0x99, 0xc5, 0xab, 0xb4, 0x8e, 0xd5, 0x4f, 0xd4, 0xd8, 0x49, 0xa9, 0x18, 0x0e, 0x11, 0x0e, 0x0a, 0x53, 0xa7, 0x21, 0x39, 0x82, 0x92, 0x11, 0x0f, 0xe8, 0xbe, 0x26 } +, + /* Signature */ + 128, + { 0x44, 0x5f, 0xf5, 0xb6, 0x87, 0x9f, 0x8c, 0xe7, 0x53, 0x95, 0x01, 0x6f, 0x04, 0x95, 0xf1, 0x31, 0x35, 0xb1, 0x79, 0xe7, 0x3a, 0x3c, 0xae, 0xb3, 0x30, 0xe3, 0xcd, 0xa7, 0xf3, 0x1f, 0x1d, 0xcb, 0xa7, 0xaa, 0x82, 0xe2, 0x68, 0xc9, 0x35, 0xe9, 0xd7, 0x01, 0x4e, 0x0b, 0x0d, 0xce, 0xa6, 0x9c, 0x7b, 0x96, 0x8a, 0xdb, 0x17, 0x42, 0x4a, 0x64, 0xdf, 0xd1, 0xe2, 0xbc, 0x57, 0x07, 0xf9, 0x20, 0xfc, 0x0c, 0x83, 0xcc, 0x63, 0xdf, 0xc7, 0x4b, 0x96, 0x3e, 0x68, 0x2b, 0x46, 0xa2, 0x2a, 0xc2, 0x56, 0xac, 0x6b, 0xe5, 0x70, 0x9c, 0x07, 0xcf, 0xcc, 0x3d, 0x4e, 0xba, 0x3a, 0x1d, 0x61, 0xab, 0x15, 0xf1, 0xba, 0xdb, 0x0a, 0x49, 0xfb, 0x5c, 0xf0, 0x9a, 0x1f, 0x74, 0x81, 0xa3, 0xaa, 0xea, 0xf7, 0xc2, 0x57, 0x54, 0x03, 0x77, 0xae, 0xa7, 0xb5, 0x44, 0x17, 0xa6, 0x09, 0xc7, 0x6f, 0x4c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.3", + /* Message to be signed */ + 232, + { 0x18, 0x3b, 0xa1, 0xa3, 0x81, 0x1d, 0x62, 0x5c, 0xa9, 0xda, 0x1b, 0xba, 0xae, 0xdc, 0x76, 0x19, 0x20, 0x12, 0xfc, 0xb6, 0x74, 0xbb, 0x9e, 0x77, 0xd8, 0xf3, 0x77, 0x08, 0xd2, 0x40, 0xd3, 0x49, 0xe0, 0x57, 0x97, 0x41, 0x6f, 0xeb, 0x24, 0xe3, 0x01, 0x8c, 0x7a, 0x20, 0x5d, 0x05, 0x9d, 0xe8, 0xe0, 0xae, 0x05, 0xa8, 0xd7, 0xe0, 0x9e, 0xaf, 0xee, 0xb9, 0xf0, 0x6d, 0xe5, 0xd4, 0x28, 0x7a, 0xbb, 0xef, 0x05, 0x9b, 0xc5, 0x86, 0xb2, 0x1c, 0x82, 0xd6, 0x4a, 0xec, 0xe8, 0xd7, 0x42, 0x8a, 0xfc, 0xd7, 0xb2, 0x2f, 0xc5, 0xd1, 0x68, 0xbc, 0x07, 0x6b, 0x61, 0x5f, 0x02, 0x73, 0x3c, 0xb6, 0x31, 0x25, 0xc8, 0xf3, 0x6d, 0x5c, 0xb8, 0x09, 0xce, 0x80, 0x65, 0x08, 0x23, 0x98, 0xb3, 0x88, 0x5a, 0x89, 0x19, 0x57, 0x0c, 0x47, 0x8a, 0x07, 0x2f, 0x59, 0x66, 0x15, 0xd7, 0x8f, 0x01, 0x36, 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 0x57, 0xb8, 0x53, 0x31, 0xc1, 0xed, 0x15, 0xc3, 0xd0, 0xcf, 0xae, 0x33, 0xf6, 0x1c, 0x11, 0x9b, 0x55, 0xc9, 0x5e, 0x34, 0x4b, 0x72, 0xf2, 0xb4, 0xf8, 0xe7, 0xe8, 0xfa, 0xc7, 0xa3, 0x3e, 0x5b, 0x8b, 0x27, 0x6a, 0x60, 0x88, 0xa7, 0xfa, 0xbf, 0x4f, 0xa1, 0x72, 0x35, 0x7f, 0xb6, 0xe3, 0xf4, 0x4a, 0x94 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.4", + /* Message to be signed */ + 215, + { 0x87, 0x07, 0xdc, 0xdb, 0x49, 0xd2, 0x83, 0xa2, 0x3a, 0x9b, 0xd6, 0xff, 0x87, 0xaf, 0xf8, 0x34, 0xf0, 0x6f, 0xf7, 0xf4, 0x7b, 0x0e, 0x5f, 0x57, 0xff, 0x1a, 0x0d, 0x99, 0x5b, 0xba, 0x9c, 0xdd, 0x5e, 0xa0, 0x1b, 0x42, 0xb2, 0x5d, 0x6f, 0xf1, 0x7a, 0x0d, 0xc1, 0x06, 0x05, 0xcf, 0x45, 0x2a, 0xca, 0x73, 0xbe, 0x54, 0xed, 0x5e, 0x0c, 0xe2, 0x15, 0x66, 0xaf, 0xcc, 0x17, 0x91, 0x2a, 0xbe, 0x18, 0xdf, 0xac, 0xd1, 0xbc, 0x03, 0xe3, 0xe2, 0x88, 0x2a, 0x4b, 0xb3, 0xa4, 0xf3, 0x9e, 0xea, 0xf9, 0x63, 0xd7, 0xc3, 0x5e, 0x6b, 0xa8, 0x58, 0xb1, 0x37, 0x6a, 0x07, 0x51, 0x60, 0xc6, 0xcf, 0xae, 0xd5, 0xe8, 0xc5, 0x2e, 0x45, 0x11, 0x32, 0x34, 0x72, 0x19, 0xbd, 0x88, 0x89, 0x3e, 0xeb, 0xe3, 0x56, 0x59, 0xa0, 0xee, 0x4d, 0x94, 0xf9, 0x4d, 0x03, 0x5b, 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66, 0xbe, 0x28, 0x2c, 0x6e, 0x23, 0x88, 0x17, 0x36, 0x44, 0xf4, 0x06, 0x27, 0xbc, 0xf8, 0xa0, 0x97, 0x4a, 0x4b, 0xe8, 0xfc, 0xc4, 0x8a, 0xee, 0x7e, 0x82, 0x59, 0xf8, 0x68, 0xa2, 0xbd, 0x78, 0x9a, 0x90, 0x89, 0x92, 0x05, 0x6e, 0x55 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.5", + /* Message to be signed */ + 246, + { 0xac, 0x9f, 0xa3, 0xf6, 0x3d, 0xf0, 0x68, 0xe9, 0x0d, 0x69, 0x2e, 0xcc, 0xfa, 0x7d, 0x87, 0x96, 0x49, 0x1a, 0xca, 0x79, 0x5b, 0x98, 0x58, 0xa4, 0x55, 0x18, 0x62, 0x32, 0x29, 0xaf, 0x28, 0xb1, 0x3a, 0x50, 0x2d, 0x8c, 0xb3, 0xb9, 0x50, 0x92, 0x50, 0x58, 0x82, 0xeb, 0x99, 0x4d, 0xe7, 0x46, 0x59, 0x62, 0x56, 0x98, 0xa0, 0x05, 0x04, 0x17, 0x94, 0x0d, 0x8b, 0xfa, 0x28, 0xa3, 0xf9, 0x3d, 0x14, 0x9f, 0xf8, 0xb0, 0xbb, 0x39, 0x26, 0xf6, 0x18, 0xef, 0x91, 0x96, 0x6f, 0x4d, 0x39, 0xbd, 0xba, 0x5a, 0x05, 0x17, 0xdd, 0xeb, 0xb1, 0x6d, 0x2b, 0xc4, 0xb4, 0xe3, 0x3a, 0x7d, 0x61, 0x9c, 0x95, 0xa3, 0x3c, 0xf5, 0xf5, 0x72, 0xdb, 0xe0, 0x7f, 0xab, 0x4a, 0xa6, 0x7f, 0xb3, 0xf3, 0x9a, 0xa2, 0x98, 0x1a, 0x3d, 0xc0, 0xca, 0xee, 0x64, 0x75, 0x8e, 0xa8, 0x98, 0xeb, 0xce, 0x10, 0xbf, 0x3a, 0xa4, 0xfc, 0x84, 0x49, 0xe8, 0xe0, 0xcf, 0x7e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 0x76, 0x99, 0xae, 0xe2, 0x25, 0xa6, 0x45, 0xbc, 0x42, 0xb3, 0xbe, 0xb5, 0x2f, 0x08, 0x38, 0x7e, 0xc5, 0x54, 0xd0, 0x20, 0x4d, 0x28, 0x3c, 0x3b, 0xcc, 0xbc, 0xca, 0x21, 0x6e, 0xda, 0xd9, 0x4e, 0xc6, 0x4f, 0x9c, 0x20, 0xb3, 0x40, 0x6a, 0xb7, 0x8a, 0x6c, 0x4a, 0x4d, 0xae, 0x3f, 0xa6, 0x17, 0xa0, 0x0c, 0x6a, 0xb2, 0xf8, 0xe2, 0x47, 0x62 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.6", + /* Message to be signed */ + 16, + { 0x15, 0x74, 0x69, 0x73, 0x44, 0xe9, 0x86, 0x85, 0xcd, 0x6e, 0x65, 0xe4, 0x67, 0x83, 0xf0, 0xb5 } +, + /* Signature */ + 128, + { 0x3b, 0x7d, 0x67, 0xd1, 0x3c, 0xd3, 0xc0, 0xfd, 0x30, 0x5a, 0xd4, 0x04, 0xd8, 0xa3, 0xdc, 0xde, 0x4a, 0x45, 0x17, 0x9c, 0x2d, 0x0b, 0x87, 0x11, 0x5d, 0x6d, 0x06, 0x0c, 0x24, 0x9b, 0x87, 0xf3, 0x9e, 0x46, 0x3b, 0x76, 0x4b, 0x42, 0x07, 0xc4, 0x8a, 0x74, 0xcf, 0xce, 0x25, 0x31, 0xe8, 0x18, 0x3d, 0x3d, 0x01, 0x25, 0x85, 0xce, 0x57, 0x39, 0xd1, 0x62, 0xc4, 0xea, 0x22, 0x32, 0x44, 0x02, 0xea, 0x2e, 0x6e, 0xaf, 0xb8, 0xa5, 0x73, 0xfc, 0xff, 0x40, 0x15, 0xc9, 0x5c, 0x45, 0xe4, 0xca, 0x7a, 0xc5, 0x1a, 0xe3, 0xa0, 0x6f, 0x42, 0x1e, 0x60, 0x6d, 0x68, 0x3f, 0x5e, 0x12, 0x2b, 0x55, 0x79, 0x14, 0x8a, 0x9c, 0x46, 0x6a, 0xde, 0xb0, 0x24, 0x28, 0xf4, 0x89, 0x6a, 0x86, 0xdf, 0x63, 0xbe, 0x58, 0x7d, 0xdd, 0x7a, 0x6a, 0x8d, 0xe7, 0x17, 0x6b, 0xe4, 0xe7, 0xff, 0x4a, 0xaa, 0x99 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.7", + /* Message to be signed */ + 150, + { 0xbe, 0x46, 0xbe, 0x8b, 0xdd, 0x85, 0x43, 0xd3, 0x70, 0xbb, 0xb7, 0xac, 0x83, 0x9f, 0x5e, 0x64, 0x53, 0xf3, 0x0c, 0xd8, 0x75, 0x2a, 0x4b, 0x92, 0x67, 0x32, 0xc5, 0x9e, 0x61, 0x09, 0x04, 0x4b, 0xe3, 0xa0, 0x75, 0x6c, 0x70, 0x25, 0xa2, 0x32, 0x80, 0xdf, 0x2e, 0xd7, 0x66, 0xba, 0x39, 0xab, 0xb2, 0x0b, 0x94, 0x4c, 0x06, 0x5f, 0xe1, 0x48, 0x7d, 0xea, 0x31, 0xb4, 0x70, 0x8a, 0x68, 0x9a, 0x50, 0xb2, 0x8d, 0x54, 0x29, 0x94, 0xcb, 0xbb, 0x3a, 0x5b, 0xb9, 0x46, 0x0e, 0xe7, 0xa9, 0xc1, 0x53, 0x8b, 0xda, 0x75, 0x1a, 0x52, 0x8b, 0x76, 0x70, 0xf9, 0x15, 0x78, 0xd6, 0x67, 0x3e, 0x08, 0xab, 0xcc, 0xdf, 0x5f, 0x4d, 0x8c, 0x1e, 0xbe, 0xcf, 0xca, 0xc7, 0x5c, 0xc4, 0x2d, 0xbb, 0xb8, 0xcd, 0xe3, 0xc1, 0xb4, 0x74, 0xb5, 0x56, 0xb3, 0x2b, 0xb8, 0x48, 0xfc, 0x32, 0x7b, 0xa6, 0xe3, 0xcf, 0x5f, 0x77, 0xb1, 0xeb, 0xc0, 0x4a, 0x19, 0xf3, 0xc8, 0xc3, 0x9b, 0x6b, 0x84, 0x77, 0x84, 0xea, 0xa3, 0x25, 0xa2, 0xb6, 0xf3 } +, + /* Signature */ + 128, + { 0x91, 0xde, 0x2f, 0x90, 0x32, 0x47, 0xb2, 0xd1, 0x3a, 0xbe, 0x93, 0xdd, 0xd9, 0x6d, 0xfa, 0xef, 0x1b, 0x4d, 0x17, 0x2b, 0x09, 0x09, 0x58, 0xf0, 0xcc, 0x34, 0xfa, 0x92, 0x83, 0x5a, 0xd6, 0x0c, 0x44, 0xb4, 0x27, 0xfe, 0x03, 0x1c, 0xad, 0xbf, 0x92, 0xff, 0x1c, 0xd0, 0x38, 0x41, 0x44, 0xc9, 0xb5, 0xf2, 0x8f, 0x64, 0x5c, 0x63, 0xe8, 0xd7, 0x16, 0xbc, 0xec, 0x2e, 0x04, 0x3b, 0xc3, 0x96, 0x56, 0x64, 0x17, 0x85, 0xc2, 0x6b, 0xa3, 0x6b, 0xa2, 0xa1, 0x09, 0xe3, 0x64, 0x4e, 0xbf, 0xd9, 0x62, 0xd7, 0xa3, 0x16, 0x91, 0x6b, 0x3f, 0x13, 0x66, 0x20, 0x13, 0xcc, 0x0f, 0x37, 0xad, 0x8f, 0x9e, 0x0d, 0x9e, 0xc8, 0xb4, 0xc8, 0xad, 0x5c, 0x75, 0x32, 0xcf, 0xa0, 0x44, 0xae, 0xdc, 0x73, 0x78, 0x77, 0x94, 0xc2, 0x98, 0x79, 0x7c, 0x8a, 0x7e, 0x14, 0x49, 0xea, 0xd6, 0x15, 0x0d, 0xed } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.8", + /* Message to be signed */ + 167, + { 0x0b, 0x7e, 0x06, 0x63, 0xe7, 0x15, 0xea, 0x38, 0xbc, 0x93, 0x0e, 0xc9, 0xd8, 0xe2, 0xa0, 0x29, 0xaa, 0x1a, 0x4c, 0x95, 0xe7, 0xb2, 0x00, 0x47, 0xae, 0x15, 0x44, 0xd5, 0xb2, 0xd8, 0x47, 0x6f, 0xc8, 0x05, 0x53, 0x9f, 0xb0, 0xef, 0xab, 0x7d, 0x5f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, 0xdb, 0xc4, 0xf0, 0xd1, 0x59, 0x56, 0xff, 0x11, 0x25, 0xc4, 0x8f, 0x89, 0x59, 0x1e, 0xbc, 0x94, 0x1d, 0x9f, 0xe8, 0xf9, 0xa7, 0x80, 0xc8, 0x2e, 0xa3, 0x2b, 0xf3, 0xef, 0xa1, 0x6c, 0xab, 0xbe, 0xe5, 0x80, 0xfd, 0x6b, 0x95, 0x74, 0x08, 0x0f, 0x69, 0x07, 0xfe, 0xaf, 0xf8, 0x1d, 0x48, 0xc4, 0x9a, 0x6d, 0xe2, 0x24, 0x84, 0x80, 0xf1, 0xd8, 0x52, 0x39, 0xe9, 0xa4, 0x18, 0xdd, 0x53, 0x10, 0xde, 0xf7, 0x76, 0xe0, 0x8f, 0x50, 0x9a, 0x14, 0x78 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.9", + /* Message to be signed */ + 226, + { 0x13, 0x42, 0x33, 0xba, 0xcf, 0xa1, 0x6d, 0xc8, 0x4d, 0x8f, 0xa4, 0xbd, 0xbb, 0x47, 0x93, 0xd1, 0xda, 0xc0, 0x7d, 0x60, 0x54, 0xbd, 0x08, 0x39, 0x61, 0xda, 0x68, 0x67, 0x9c, 0xa3, 0x75, 0x33, 0x4f, 0x09, 0x20, 0xb9, 0xdf, 0xb8, 0xa6, 0x8e, 0xd7, 0x7f, 0x27, 0xfd, 0x92, 0x19, 0x28, 0x13, 0x61, 0xe0, 0x9f, 0xa6, 0x08, 0x4f, 0x96, 0xe6, 0x98, 0x85, 0xb4, 0x7e, 0xa7, 0x75, 0xaf, 0x06, 0x77, 0x2d, 0x66, 0x12, 0xd4, 0xd1, 0x6f, 0x4a, 0x5c, 0xc4, 0xcd, 0x0d, 0x1e, 0xb2, 0x3b, 0x7a, 0x1f, 0x09, 0x56, 0x4b, 0x84, 0x2e, 0xa0, 0x7c, 0xbd, 0xde, 0x60, 0x45, 0x3a, 0x2a, 0xa4, 0xab, 0x69, 0xdd, 0xfe, 0xb5, 0xb1, 0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0x82, 0x79, 0x80, 0x52, 0xa5, 0x88, 0x46, 0x68, 0x82, 0x51, 0x06, 0x90, 0xac, 0x77, 0x30, 0x23, 0x28, 0x02, 0x46, 0xc8, 0x90, 0xff, 0x1f, 0x62, 0x27, 0x04, 0x9e, 0x66, 0x8b, 0xc9, 0xd6, 0xe4, 0x89, 0xb6, 0x94, 0x4a, 0x34, 0xe8, 0xf9, 0x30, 0x02, 0xbb, 0xb0, 0x0d, 0x75, 0x2b, 0x57, 0x7c, 0xe3, 0x52, 0x53, 0x00, 0x82, 0xbe, 0xcd, 0x30, 0x9b, 0x0d, 0xac, 0xcd, 0x1d, 0x68, 0xd0, 0x6e, 0x1d, 0xf7, 0x12, 0x21, 0xc6, 0x22, 0x69 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.10", + /* Message to be signed */ + 111, + { 0x35, 0xda, 0x3d, 0x02, 0x34, 0xbd, 0x74, 0xfc, 0xd7, 0x6e, 0x8e, 0x69, 0x52, 0x8f, 0x65, 0x1b, 0x88, 0x27, 0x1c, 0xbf, 0x16, 0x28, 0x69, 0x38, 0xc2, 0xc4, 0xa3, 0x7d, 0x41, 0x1d, 0xe8, 0xf6, 0x75, 0x78, 0xeb, 0x8b, 0x3d, 0x20, 0xa8, 0xfd, 0x7d, 0xcd, 0xe7, 0xb6, 0x56, 0xfe, 0x96, 0xa6, 0x80, 0x87, 0x32, 0x28, 0xed, 0x0f, 0x9a, 0x62, 0x0f, 0x15, 0x05, 0x44, 0x23, 0x72, 0xf9, 0xb2, 0xb4, 0x16, 0x84, 0x98, 0x72, 0x34, 0x90, 0xf8, 0x11, 0xf3, 0x11, 0x1f, 0x5f, 0x77, 0x38, 0x63, 0x47, 0xb4, 0x82, 0x2e, 0xd9, 0xd6, 0xb5, 0x53, 0x83, 0x92, 0x21, 0x5c, 0xb6, 0xc4, 0x86, 0x5b, 0xb7, 0xb5, 0xb7, 0xe2, 0x84, 0x2e, 0xea, 0x0e, 0x90, 0x01, 0xca, 0x0c, 0xdf, 0x5d, 0x6b } +, + /* Signature */ + 128, + { 0x12, 0xff, 0x2a, 0xb5, 0xfc, 0x83, 0xd6, 0x49, 0x59, 0x7c, 0x47, 0xbf, 0xf3, 0x29, 0xb7, 0xf4, 0x61, 0xdb, 0xbb, 0xda, 0x01, 0xfb, 0x6b, 0xad, 0x26, 0x54, 0x3e, 0x4d, 0xbc, 0xd6, 0x0c, 0x5e, 0x2c, 0xde, 0xbf, 0xb1, 0x12, 0x78, 0x4a, 0x96, 0x4e, 0x27, 0xf2, 0xa2, 0xe7, 0xfd, 0x07, 0xec, 0x39, 0x0a, 0xab, 0x14, 0x94, 0x37, 0x03, 0x58, 0xa7, 0x5b, 0x5e, 0x1f, 0xa4, 0xf1, 0xad, 0x52, 0x02, 0xe6, 0xd5, 0x46, 0xc0, 0xf3, 0x15, 0xe8, 0x6f, 0xaf, 0xf1, 0xd2, 0x5b, 0x94, 0x72, 0x82, 0xda, 0x32, 0xea, 0xb5, 0x6c, 0x22, 0xf0, 0x6c, 0x8a, 0x9d, 0x32, 0xae, 0xf2, 0x81, 0xd6, 0xf0, 0xaa, 0x55, 0xd7, 0xad, 0x3b, 0xcd, 0xfd, 0xb2, 0x09, 0xa1, 0x6e, 0xf4, 0x5c, 0xc6, 0xf9, 0x68, 0x2e, 0xae, 0x96, 0x3c, 0xbb, 0x21, 0x3a, 0xdb, 0x7f, 0xad, 0x1b, 0xef, 0x49, 0xc0, 0x70, 0x4f } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.11", + /* Message to be signed */ + 50, + { 0x75, 0xfd, 0xb0, 0x72, 0x73, 0xf7, 0x54, 0xd1, 0x11, 0x6f, 0x99, 0x7a, 0xf2, 0xd1, 0x1a, 0x51, 0x2b, 0x94, 0xe9, 0xe0, 0x48, 0x01, 0xb3, 0xfc, 0x73, 0x91, 0x30, 0xb7, 0x47, 0xb4, 0xbe, 0x87, 0x44, 0xd7, 0xe7, 0xf8, 0xa2, 0x97, 0xa0, 0x89, 0xd9, 0x05, 0x0c, 0x5f, 0x54, 0xf8, 0xa3, 0x9a, 0xa3, 0xf2 } +, + /* Signature */ + 128, + { 0x07, 0xff, 0xc1, 0xb7, 0xa1, 0x0d, 0xda, 0xba, 0x96, 0x05, 0xf0, 0xa3, 0xd9, 0x3c, 0x8a, 0x5e, 0x4c, 0x0b, 0x77, 0x58, 0x61, 0x39, 0x05, 0x07, 0x31, 0xd9, 0xcc, 0x9b, 0x3c, 0x83, 0xd2, 0xb7, 0x3f, 0xaf, 0x9a, 0x4e, 0x24, 0xd1, 0xc8, 0xbb, 0x0d, 0x62, 0x3d, 0xf1, 0x0f, 0xc8, 0x40, 0x7d, 0x15, 0x14, 0x48, 0xfa, 0x43, 0xee, 0x65, 0x81, 0xe7, 0xb0, 0xac, 0x80, 0xd1, 0x4a, 0xdf, 0xa4, 0xf6, 0xd2, 0x7a, 0x76, 0x67, 0x50, 0xb2, 0x31, 0xcb, 0xc1, 0xc5, 0xcf, 0xd6, 0x2d, 0xf1, 0xb9, 0x72, 0x7d, 0x8b, 0x87, 0x41, 0x46, 0x9f, 0x68, 0xe5, 0x0a, 0x9b, 0x3b, 0xc7, 0xad, 0xe1, 0x37, 0xdb, 0x06, 0x74, 0x76, 0x03, 0x74, 0x28, 0x56, 0xd5, 0xe7, 0xdd, 0xb4, 0xe1, 0x6a, 0x5b, 0x49, 0xd7, 0x36, 0x5d, 0xb2, 0x76, 0x3b, 0xf5, 0xfd, 0xea, 0x08, 0x3d, 0x81, 0xfa, 0xc9, 0x2d, 0x87 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.12", + /* Message to be signed */ + 245, + { 0x96, 0xc9, 0xfa, 0xce, 0xfb, 0xa2, 0xed, 0x33, 0xed, 0x8b, 0x7b, 0x3d, 0x8b, 0x6d, 0xf2, 0x8f, 0x2f, 0xab, 0x0d, 0xcd, 0xd7, 0xa3, 0xcd, 0x7a, 0x7d, 0xed, 0xa2, 0x54, 0x5e, 0xd4, 0x47, 0x0e,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x79, 0x77, 0x5a, 0x5a, 0x3a, 0x80, 0xc5, 0xd2, 0x48, 0x6a, 0x2d, 0x51, 0x08, 0x48, 0xbd, 0xc9, 0xb8, 0x52, 0xac, 0x1d, 0x32, 0xce, 0xb7, 0xc0, 0x41, 0xa0, 0x8f, 0x2f, 0x8e, 0x62 } +, + /* Signature */ + 128, + { 0x46, 0xd0, 0x3f, 0xae, 0xc4, 0xa7, 0x23, 0x18, 0x62, 0x1e, 0xf4, 0xd0, 0xc1, 0xbc, 0xa7, 0x1a, 0x2a, 0xee, 0xa7, 0xa8, 0x1d, 0xf8, 0xfe, 0xbb, 0x8b, 0xa3, 0xfb, 0x35, 0x40, 0xd7, 0x2d, 0x15, 0x34, 0xb9, 0x82, 0x69, 0x16, 0xe8, 0x9f, 0x27, 0xd3, 0x25, 0x67, 0x6c, 0xcf, 0x5a, 0x0a, 0xa1, 0x61, 0x12, 0xdb, 0x2d, 0x93, 0x03, 0xe0, 0xeb, 0xce, 0x4b, 0x85, 0x58, 0x7c, 0x55, 0xac, 0xa0, 0x68, 0x50, 0xde, 0x84, 0xde, 0xc2, 0x13, 0xd1, 0x13, 0x74, 0x04, 0xa5, 0xde, 0xe6, 0xca, 0x88, 0xd9, 0x1a, 0xe2, 0x8b, 0x7b, 0x53, 0x6c, 0x90, 0x20, 0x2b, 0xc7, 0x72, 0x6d, 0xa5, 0x04, 0x2a, 0x85, 0x08, 0xd3, 0xb1, 0x3c, 0xfb, 0xaa, 0xdc, 0xee, 0x12, 0x78, 0xd3, 0x5d, 0x30, 0x3a, 0xcf, 0xee, 0x6e, 0x07, 0x41, 0x90, 0x49, 0x11, 0xa5, 0xf1, 0x88, 0x10, 0xad, 0xd3, 0xe7, 0xb8, 0xf6 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.13", + /* Message to be signed */ + 58, + { 0xc4, 0xb4, 0xc9, 0x96, 0x6e, 0x56, 0xf4, 0x0a, 0xff, 0x47, 0x08, 0x13, 0x1c, 0xd3, 0x71, 0x44, 0x21, 0x34, 0x3e, 0xde, 0x70, 0xc4, 0xd4, 0x6d, 0xb6, 0xef, 0xbe, 0x1b, 0x19, 0xa9, 0xe3, 0xc2, 0xe5, 0x81, 0x06, 0x00, 0x8a, 0x98, 0x38, 0x59, 0xcf, 0x94, 0x2a, 0x31, 0x97, 0x74, 0x69, 0x5a, 0x0c, 0x98, 0xa9, 0x63, 0xe2, 0xfe, 0x9d, 0x93, 0x79, 0xbc } +, + /* Signature */ + 128, + { 0xb1, 0x6b, 0x10, 0xf2, 0xbd, 0x7e, 0xa0, 0xf7, 0x6a, 0x9e, 0xd2, 0xff, 0xcf, 0x3e, 0xc1, 0x0e, 0xdc, 0xb8, 0x24, 0x60, 0xfe, 0x55, 0x82, 0xa7, 0x76, 0x4c, 0x0c, 0x50, 0x56, 0xec, 0xfb, 0x09, 0x72, 0x06, 0x48, 0xd5, 0xf1, 0x9b, 0x3d, 0xea, 0xf2, 0xac, 0xc9, 0x86, 0x46, 0x0e, 0x71, 0x14, 0x26, 0x15, 0x83, 0xa5, 0xf4, 0xa9, 0x90, 0xe9, 0x22, 0xfe, 0xb5, 0xb4, 0x78, 0x97, 0x34, 0xfd, 0xcc, 0xe1, 0x5d, 0xdc, 0x87, 0xca, 0xc3, 0xf6, 0xc7, 0xc9, 0xe9, 0xe2, 0x19, 0x23, 0x15, 0xf0, 0x84, 0x1f, 0x43, 0xea, 0x86, 0xde, 0xa9, 0xa9, 0x38, 0x05, 0x08, 0xb0, 0x6c, 0x9c, 0xa5, 0xe9, 0xd4, 0xa6, 0x51, 0xd0, 0x12, 0x16, 0x62, 0x7c, 0x46, 0x6b, 0xf0, 0xd6, 0xae, 0x74, 0x4b, 0xf3, 0x0f, 0xd7, 0x91, 0xa8, 0x21, 0x03, 0x39, 0xf5, 0x05, 0x7f, 0xf8, 0x5c, 0xeb, 0x84, 0xf1, 0x96 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.14", + /* Message to be signed */ + 165, + { 0xb8, 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x38, 0x9e, 0x0c, 0x2d, 0x3d, 0x47, 0x6a, 0x0f, 0x8a, 0x1e, 0x08, 0xcb, 0xca, 0xcc, 0x66, 0x02, 0xc7, 0x14, 0x43, 0x8f, 0x32, 0xf3, 0x4e, 0x02, 0xc3, 0x6e, 0x5c, 0x0f, 0x16, 0x8a, 0xb0, 0x28, 0x91, 0x7e, 0x90, 0x50, 0xfb, 0xc8, 0x50, 0xf0, 0xcf, 0x65, 0xd5, 0xee, 0xdb, 0x3b, 0x54, 0xbe, 0x54, 0x95, 0xbb, 0xf0, 0xfa, 0xee, 0xb3, 0x2b, 0xbe, 0x5a, 0x8f, 0x87, 0xbb, 0xac, 0xdd, 0x25, 0x85, 0xfb, 0x90, 0x7b, 0x13, 0x18, 0x5b, 0x02, 0x61, 0x56, 0x63, 0xd2, 0x01, 0x1e, 0xf2, 0x3d, 0x0a, 0xb0, 0x4d, 0xad, 0x1f, 0xfa, 0x67, 0x9b, 0x53, 0x15, 0x2c, 0x9c, 0x42, 0xb8, 0x46, 0x39, 0x68, 0x4e, 0xae, 0xaf, 0x64, 0x4e, 0x4f, 0xc6, 0xff, 0x2e, 0xc7, 0xd4, 0x7b, 0xa5, 0xac } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.15", + /* Message to be signed */ + 77, + { 0x9f, 0xd5, 0x39, 0xc8, 0xad, 0x86, 0x49, 0x24, 0xee, 0xc1, 0xd6, 0x55, 0xc0, 0x7d, 0x1f, 0x28, 0x27, 0x0c, 0xdb, 0x32, 0x6b, 0x57, 0x2c, 0x46, 0x67, 0xec, 0xa6, 0x48, 0x8c, 0x03, 0x36, 0x57, 0xff, 0x29, 0x25, 0x4b, 0x91, 0xf3, 0x21, 0x6e, 0x1c, 0xac, 0x97, 0x97, 0x53, 0xf2, 0x23, 0xb1, 0x79, 0xea, 0x5f, 0x9e, 0xfc, 0x23, 0x6d, 0x40, 0x1d, 0x1b, 0x9a, 0x3c, 0x20, 0xeb, 0x2a, 0xfc, 0x9b, 0xfc, 0xfd, 0x07, 0x92, 0xac, 0xc5, 0xb0, 0x0c, 0x98, 0x28, 0xa6, 0x45 } +, + /* Signature */ + 128, + { 0x38, 0xbf, 0xdf, 0xd3, 0x27, 0x2e, 0x48, 0xcf, 0xee, 0x68, 0xce, 0xb9, 0x13, 0x04, 0xeb, 0x91, 0xee, 0x25, 0xe4, 0x83, 0x40, 0x1f, 0x30, 0xfe, 0x12, 0xd5, 0xe4, 0x35, 0x18, 0xe4, 0xb7, 0x71, 0x14, 0xa1, 0x2c, 0x8c, 0x79, 0x92, 0xae, 0xe7, 0xd2, 0xe7, 0x74, 0xff, 0xf9, 0x1d, 0x8f, 0xd1, 0xcb, 0x7c, 0x6a, 0x2a, 0xdf, 0x79, 0xb7, 0xc8, 0xab, 0x93, 0xe8, 0x37, 0x4d, 0xb7, 0x4c, 0x26, 0x90, 0x9c, 0x65, 0x9a, 0x97, 0xc7, 0x6a, 0x22, 0x2d, 0xf4, 0xfc, 0x8c, 0x7e, 0xf5, 0x19, 0x90, 0x80, 0xea, 0xae, 0x2d, 0x03, 0x1c, 0xa7, 0x51, 0xc5, 0x01, 0x32, 0x89, 0xdb, 0x4e, 0xad, 0x77, 0xb2, 0x8b, 0x76, 0xa4, 0xc4, 0x96, 0xad, 0x0e, 0xb4, 0x22, 0xfc, 0xa8, 0x8f, 0xc6, 0x84, 0xe4, 0x2a, 0xea, 0x88, 0xfd, 0x33, 0xc2, 0x56, 0x75, 0x1b, 0xa0, 0x66, 0x83, 0x4e, 0x77, 0xa1, 0xe2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.16", + /* Message to be signed */ + 23, + { 0x1d, 0xe8, 0x07, 0x40, 0x9d, 0x0a, 0x61, 0xb0, 0x32, 0x2d, 0xfe, 0xd4, 0x99, 0xe8, 0xc3, 0x32, 0x41, 0xec, 0x89, 0xcd, 0x7d, 0x9f, 0xc5 } +, + /* Signature */ + 128, + { 0x8b, 0x66, 0x64, 0xf8, 0x69, 0xd7, 0x55, 0xc5, 0xd3, 0xe6, 0xdf, 0x99, 0x22, 0xe2, 0x27, 0xc1, 0x10, 0x91, 0x8a, 0x6f, 0xbd, 0x88, 0xc1, 0xa2, 0xe1, 0x28, 0x95, 0x23, 0xad, 0xbb, 0xd8, 0xaa, 0x43, 0x1d, 0x07, 0x86, 0x85, 0x3a, 0xb5, 0x96, 0xdd, 0x5b, 0x00, 0x12, 0x43, 0xb5, 0x4a, 0x2c, 0xb1, 0x0c, 0x31, 0x66, 0xbf, 0x00, 0x23, 0x38, 0xfc, 0xa2, 0x03, 0x45, 0xae, 0xde, 0x1b, 0x22, 0xea, 0x1f, 0xa3, 0xd2, 0x41, 0xc8, 0x6c, 0x76, 0xbf, 0xc0, 0x2f, 0x4f, 0xce, 0xae, 0x12, 0xc8, 0xa9, 0xd7, 0xe4, 0x4a, 0xd6, 0x17, 0x16, 0x65, 0xe8, 0x8f, 0x12, 0x85, 0x22, 0xdd, 0x53, 0x5a, 0x9d, 0x65, 0x00, 0x8f, 0x6a, 0x73, 0x2d, 0x40, 0xaf, 0x20, 0x4e, 0x22, 0x0f, 0x1f, 0xac, 0xd9, 0x42, 0xe0, 0x9d, 0x15, 0x09, 0x9f, 0xdc, 0x51, 0xb3, 0xa1, 0x42, 0x6c, 0xb2, 0xdd, 0x32, 0x93 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.17", + /* Message to be signed */ + 22, + { 0x4b, 0x2b, 0xcb, 0x26, 0x79, 0xa1, 0x4c, 0x3c, 0x4c, 0x06, 0x9e, 0xd0, 0x89, 0xa6, 0x5a, 0xba, 0x29, 0xf2, 0x2b, 0x61, 0x78, 0xc0 } +, + /* Signature */ + 128, + { 0x1c, 0x47, 0x82, 0x8e, 0xa5, 0x3f, 0xb6, 0x43, 0x6e, 0x95, 0x96, 0xb0, 0xce, 0x47, 0xd9, 0xf3, 0x8b, 0x5d, 0xeb, 0x0b, 0x19, 0x7c, 0x1b, 0xc4, 0x74, 0xe2, 0xe8, 0x22, 0x65, 0x70, 0xcc, 0x1b, 0x72, 0xf2, 0x39, 0x31, 0x2a, 0xe7, 0xc3, 0xc6, 0x38, 0x2e, 0x1d, 0x8c, 0xda, 0x7d, 0x4f, 0x12, 0xfe, 0xba, 0xd7, 0x0a, 0xfa, 0xe5, 0xac, 0xbf, 0x24, 0x28, 0xab, 0xc0, 0x44, 0x21, 0xbb, 0x4e, 0x1e, 0x59, 0x90, 0x11, 0x1b, 0x9a, 0xc8, 0x3c, 0x62, 0x43, 0x5c, 0x21, 0xaa, 0x25, 0xfd, 0x9b, 0x49, 0x07, 0x58, 0x54, 0x11, 0xd2, 0x53, 0xba, 0x9b, 0x87, 0x78, 0xf6, 0x24, 0x05, 0x3d, 0x46, 0xfe, 0x95, 0xd7, 0xe2, 0x2c, 0xa3, 0x93, 0x81, 0xc7, 0x79, 0x2e, 0xff, 0x46, 0x43, 0x8f, 0xbc, 0x16, 0x5e, 0xd7, 0x62, 0x9c, 0x2f, 0xc1, 0xce, 0xf1, 0xb3, 0x4d, 0x77, 0x76, 0x8a, 0x20, 0x55 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.18", + /* Message to be signed */ + 238, + { 0xef, 0x46, 0xae, 0x51, 0xe0, 0x15, 0x8c, 0xd0, 0xef, 0x9c, 0x78, 0xd7, 0x1e, 0x00, 0x15, 0x67, 0xd6, 0x6a, 0xe3, 0xc5, 0xe9, 0xa6, 0x4f, 0x24, 0x57, 0x15, 0xc7, 0xc2, 0xad, 0x8e, 0xea, 0x0f, 0x9d, 0x32, 0x00, 0x23, 0x07, 0x2f, 0xdb, 0x0f, 0xb8, 0x6a, 0x45, 0x21, 0x7f, 0xd7, 0x12, 0xcc, 0x80, 0xe5, 0xb9, 0x41, 0x47, 0xc4, 0x5f, 0xe0, 0x0b, 0x69, 0x2c, 0xcd, 0xa1, 0x10, 0x25, 0x98, 0x41, 0xb2, 0xc7, 0xe5, 0xc3, 0xdc, 0xff, 0x59, 0x56, 0xf2, 0xa5, 0x96, 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d, 0xb6, 0x96, 0x1c, 0x9f, 0x55, 0x51, 0x40, 0xf7, 0x8e, 0xbd, 0xa2, 0x4e, 0x3f, 0x51, 0xfd, 0x73, 0x01, 0xc1, 0xe4, 0xfe, 0x12, 0xb6, 0x95, 0x7c, 0x30, 0x14, 0x4f, 0xa1, 0xe1, 0x27, 0x27, 0x46, 0x03, 0xdc, 0x02, 0x05, 0x11, 0x30, 0xb2, 0x53, 0x85, 0xfc, 0x86, 0x46, 0xee, 0x96, 0xa7, 0x45, 0x50, 0xd2, 0xd6, 0x3f, 0x85, 0x81, 0x85, 0xbb, 0x98, 0x46, 0x52, 0xa3, 0x43, 0x1d, 0x53, 0x3d, 0xa6, 0x01, 0x46, 0x22, 0xa6, 0x4e, 0x06, 0x91, 0x66, 0x2a, 0x4f, 0x7c, 0x9d, 0x58, 0x31, 0x9b, 0xa3, 0xf8, 0x5f, 0x19, 0x18, 0x24, 0x75, 0xe1, 0x50, 0x9b, 0xbf, 0x21, 0x3a, 0xf0, 0x10, 0x10, 0xb4, 0xb9, 0xf8, 0x2e, 0x64, 0x75, 0x11, 0xfc, 0x97, 0xc6, 0xb7, 0xc9, 0x7e, 0x8d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.19", + /* Message to be signed */ + 192, + { 0xf8, 0x7b, 0xb1, 0x2d, 0xaa, 0xad, 0x62, 0xc8, 0x64, 0xac, 0x3d, 0x44, 0x4d, 0x51, 0x4e, 0xec, 0x6e, 0x59, 0xb6, 0x7c, 0xd0, 0x82, 0x0d, 0xfc, 0xbd, 0xf8, 0x51, 0xea, 0x73, 0x89, 0x1f, 0x58, 0xa8, 0xbe, 0x6e, 0x84, 0x3e, 0xe8, 0x77, 0x3e, 0x4d, 0xc1, 0xc7, 0xd7, 0x42, 0xda, 0x82, 0xff, 0x16, 0xc1, 0x01, 0x1b, 0x99, 0x56, 0x6b, 0x9f, 0x3f, 0xd1, 0x7d, 0x68, 0xd5, 0xac, 0x99, 0xce, 0xf5, 0xa3,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9, 0xfc, 0xfb, 0x78, 0x91, 0x78, 0x41, 0x2c, 0x36, 0x40, 0xf5, 0x40, 0xb8, 0x1b, 0xb3, 0x18, 0x97, 0xd2, 0x64, 0x5e, 0xc7, 0x9d, 0x8e, 0x59, 0x75, 0x04, 0x8e, 0x45, 0x22, 0x61, 0xa1, 0xc2, 0x00, 0x9c, 0xfe, 0xee, 0x07, 0x15, 0xa0, 0x1b, 0xee, 0xfd, 0x75, 0xe7, 0x04, 0xb2, 0xa6, 0xf0, 0xf0, 0xae, 0x7e, 0xa3, 0x6c, 0x53, 0xcf, 0xe3, 0x6f, 0x57, 0xf0, 0x34, 0xe3, 0x85, 0x44, 0x8f, 0xca, 0xab, 0x08, 0xdc, 0xff, 0x47, 0x7d, 0x36, 0xff, 0x15 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 5.20", + /* Message to be signed */ + 2, + { 0x4c, 0x4b } +, + /* Signature */ + 128, + { 0x1c, 0xb6, 0x88, 0x12, 0x83, 0xdc, 0xd1, 0x86, 0x3b, 0xa7, 0x9d, 0xfb, 0x22, 0x35, 0x1b, 0xc9, 0xa8, 0xe0, 0x35, 0x8b, 0x2f, 0x8a, 0x1d, 0xe3, 0xf9, 0x06, 0x5d, 0x8c, 0xa8, 0x59, 0x31, 0x4a, 0xe1, 0x12, 0x13, 0xa2, 0xcc, 0x87, 0xb2, 0xf6, 0x32, 0xef, 0xa6, 0x7d, 0x21, 0x03, 0xf3, 0x82, 0x00, 0xb9, 0x19, 0x3e, 0xb8, 0xd4, 0x99, 0x82, 0x09, 0x9a, 0xfc, 0x74, 0x42, 0x8f, 0x4b, 0x41, 0x31, 0x6f, 0x48, 0x78, 0xb3, 0xf6, 0x00, 0xbc, 0x2f, 0xb3, 0x04, 0x58, 0xcc, 0x9c, 0x2a, 0x03, 0x4a, 0x06, 0x8e, 0x98, 0xd5, 0x7a, 0xe7, 0x9c, 0xe3, 0xe2, 0xfc, 0x84, 0xb6, 0xa7, 0x45, 0xf0, 0x37, 0xa5, 0xde, 0xa2, 0xb9, 0xda, 0x4e, 0x8d, 0xb4, 0xad, 0xa6, 0x9f, 0xb8, 0x2d, 0x20, 0xa4, 0x1b, 0xb8, 0x43, 0x07, 0x93, 0xee, 0xf9, 0x2a, 0x4f, 0xd6, 0x18, 0x6d, 0x17, 0x96, 0x63, 0xcb } + +} +, +} +}, +{ + "Example 6: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xd6, 0x31, 0x14, 0x57, 0xe1, 0xca, 0xf1, 0x22, 0x44, 0x36, 0x69, 0x79, 0x83, 0xc8, 0x6d, 0xd3, 0x38, 0x20, 0x58, 0x62, 0xd2, 0xa1, 0x05, 0xba, 0xf7, 0x10, 0x34, 0x28, 0xfd, 0x83, 0x53, 0xa1, 0x9b, 0x7b, 0xa4, 0x22, 0x8f, 0x78, 0xb4, 0x7f, 0x79, 0x07, 0x35, 0x70, 0x34, 0xc5, 0x2d, 0x85, 0x97, 0xda, 0x2b, 0x5d, 0x13, 0xdc, 0x53, 0x5b, 0x83, 0x6c, 0x74, 0x13, 0x0a, 0x36, 0x48, 0x91, 0x8d, 0x4a, 0x7a, 0x83, 0x99, 0x0c, 0x2e, 0x28, 0x81, 0x6a, 0xec, 0x0f, 0xca, 0x01, 0xd1, 0x05, 0xc6, 0xc6, 0x52, 0xec, 0x57, 0x33, 0xd0, 0x1f, 0x00, 0x58, 0xb2, 0xdf, 0x5a, 0xe6, 0x73, 0x33, 0x40, 0x5a, 0x3a, 0x5b, 0x12, 0x20, 0xa2, 0x6a, 0xc3, 0xd1, 0x42, 0xf2, 0xb4, 0xd8, 0x37, 0xeb, 0x73, 0x86, 0xa4, 0x0a, 0x74, 0xcc, 0x3d, 0x1e, 0x4f, 0xbc, 0x64, 0xfd, 0x7d, 0xa6, 0x3c, 0x41 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 127, + { 0x5e, 0xa6, 0x11, 0x77, 0x44, 0x2f, 0x89, 0x9e, 0xba, 0xc5, 0xd0, 0x96, 0x01, 0xc5, 0xef, 0xc2, 0x06, 0x6b, 0x44, 0xa3, 0x66, 0xb0, 0x00, 0xf8, 0x3d, 0x74, 0xcb, 0x97, 0xd1, 0x6e, 0xd6, 0xe5, 0xf2, 0xef, 0x0f, 0xf8, 0xb5, 0xad, 0x81, 0x15, 0x53, 0x45, 0xfc, 0x37, 0x39, 0x1a, 0x68, 0xa3, 0x40, 0x17, 0x08, 0x52, 0x79, 0x14, 0x43, 0x41, 0x8d, 0x31, 0xbf, 0x99, 0x2a, 0x4a, 0x12, 0x86, 0x6f, 0xe9, 0xff, 0xcc, 0xde, 0xbb, 0xbb, 0xa6, 0x37, 0xee, 0x88, 0x7b, 0x71, 0x6c, 0xaa, 0x92, 0xe2, 0x49, 0xce, 0xd6, 0x57, 0xee, 0xd7, 0x1f, 0x5c, 0xcd, 0xd9, 0x16, 0x3f, 0x32, 0x69, 0x52, 0x5d, 0x78, 0x9f, 0x4b, 0x33, 0xc4, 0x8a, 0x95, 0x76, 0x44, 0x36, 0xec, 0x32, 0x5e, 0x86, 0x89, 0x69, 0x1c, 0x27, 0x2d, 0x90, 0xbd, 0x88, 0x88, 0x98, 0x51, 0x37, 0x2f, 0xb8, 0xdc, 0xb9 } +, + /* Prime 1 */ + 64, + { 0xf3, 0xd4, 0xb8, 0x51, 0xad, 0x7a, 0xc7, 0x78, 0xbe, 0xcd, 0xdd, 0xae, 0x71, 0xb6, 0x13, 0xf6, 0x59, 0x7c, 0x70, 0x75, 0xc4, 0xd2, 0x8d, 0xdb, 0xae, 0x1e, 0xfa, 0xcf, 0x03, 0x59, 0x71, 0xab, 0x63, 0xee, 0x90, 0xdb, 0xbd, 0xfb, 0xda, 0x43, 0x25, 0xa1, 0x5f, 0xbf, 0x84, 0x5e, 0xea, 0x54, 0xbb, 0xcd, 0x05, 0x57, 0x4b, 0x1c, 0xd6, 0x01, 0xdc, 0xad, 0xba, 0x12, 0x06, 0x28, 0x05, 0xb9 } +, + /* Prime 2 */ + 64, + { 0xe0, 0xe1, 0xad, 0x57, 0xd6, 0x8f, 0x30, 0x13, 0x28, 0x8c, 0x14, 0x83, 0xe8, 0xc5, 0xb1, 0x2e, 0xfe, 0xb6, 0xec, 0x14, 0x5a, 0xe4, 0x18, 0x8e, 0x1b, 0x3b, 0x39, 0x04, 0x87, 0x90, 0x0a, 0xd2, 0xc3, 0x25, 0xd2, 0x32, 0x80, 0x6a, 0x62, 0x17, 0x34, 0x2a, 0x65, 0x75, 0x95, 0x14, 0xf2, 0x26, 0x8f, 0xca, 0x72, 0xc4, 0xc5, 0xbb, 0xa0, 0x32, 0x81, 0x89, 0xdc, 0xfa, 0xe2, 0x06, 0xae, 0xc9 } +, + /* Prime exponent 1 */ + 64, + { 0x3b, 0xb6, 0xd2, 0xd5, 0x1d, 0xf9, 0x3d, 0xb4, 0xb2, 0x75, 0xd4, 0x5e, 0x8e, 0x76, 0x9a, 0xf8, 0xef, 0xfd, 0x6b, 0xc5, 0x4b, 0xc8, 0x8c, 0xf9, 0x49, 0xf1, 0x48, 0x57, 0x3e, 0x68, 0xbf, 0x4f, 0xcc, 0x0f, 0x76, 0xe6, 0x79, 0xe6, 0x9e, 0x13, 0x67, 0xb9, 0xd7, 0xab, 0x1d, 0x8d, 0xe9, 0x31, 0x8b, 0x34, 0xb0, 0xa4, 0x2a, 0x3f, 0x0b, 0xa2, 0x35, 0x1b, 0x4e, 0xc0, 0x6f, 0x45, 0x89, 0xf1 } +, + /* Prime exponent 2 */ + 64, + { 0x71, 0xf4, 0xaa, 0x5c, 0x8a, 0x93, 0x80, 0xaf, 0x14, 0xaa, 0xf7, 0x72, 0x68, 0xb0, 0x55, 0x3b, 0x15, 0x44, 0x28, 0x99, 0x9f, 0xfd, 0x5a, 0x1c, 0x18, 0xdc, 0x87, 0xe6, 0x2d, 0xb3, 0xe6, 0x68, 0x2b, 0x0f, 0xad, 0x56, 0x7e, 0x10, 0x6a, 0xa8, 0x8b, 0x7c, 0xb8, 0x71, 0x3f, 0x1c, 0xa0, 0x20, 0xbe, 0x58, 0xbe, 0x93, 0xcc, 0x07, 0x6a, 0x04, 0x6d, 0xf4, 0x28, 0x90, 0xd1, 0x9c, 0xc5, 0x51 } +, + /* Coefficient */ + 64, + { 0x23, 0x1a, 0xb8, 0xdd, 0x9a, 0x56, 0x99, 0xd7, 0x97, 0x59, 0x11, 0xef, 0x0e, 0xf8, 0x7c, 0x28, 0xdd, 0xb9, 0x2e, 0x24, 0x6e, 0xc3, 0x4c, 0x5f, 0xac, 0x33, 0x83, 0x22, 0xdd, 0xec, 0x89, 0x8d, 0x56, 0x68, 0x67, 0x45, 0x3d, 0xe6, 0xd7, 0x8a, 0x45, 0xc3, 0x16, 0xb1, 0x45, 0xa2, 0x86, 0x18, 0x94, 0x0e, 0x1a, 0xcd, 0x11, 0x58, 0xc3, 0xaf, 0x92, 0xfa, 0xab, 0xfd, 0xc3, 0x97, 0x84, 0x32 } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 6.1", + /* Message to be signed */ + 74, + { 0x8f, 0x75, 0x0e, 0x65, 0x95, 0x1b, 0x5d, 0xe7, 0x58, 0x14, 0xb0, 0xb7, 0x66, 0x30, 0xdc, 0x9f, 0x1c, 0x62, 0x53, 0xa0, 0x59, 0x0e, 0xac, 0xb5, 0x51, 0x2a, 0x8a, 0x4e, 0x1a, 0x8b, 0xe8, 0x52, 0x5d, 0x36, 0x94, 0x1f, 0xa9, 0xd0, 0x92, 0xf6, 0xbb, 0x44, 0x22, 0xaa, 0x8c, 0x0a, 0xd6, 0x42, 0x3e, 0xa2, 0x8c, 0x10, 0xca, 0xa6, 0xe9, 0x54, 0xb7, 0x95, 0x69, 0xd4, 0x4c, 0x86, 0x0f, 0x1c, 0x65, 0x81, 0xeb, 0x17, 0xa7, 0x54, 0x3e, 0x7b, 0xf7, 0xfe } +, + /* Signature */ + 128, + { 0xb1, 0x8b, 0x5e, 0xc8, 0x8d, 0x4e, 0x24, 0xc9, 0x14, 0xb6, 0x65, 0xff, 0x9a, 0x2c, 0x75, 0xf4, 0xe9, 0x19, 0x37, 0xdf, 0x8c, 0x19, 0x95, 0x59, 0x43, 0xe4, 0x51, 0xad, 0xdf, 0x34, 0x84, 0xe4, 0x97, 0x97, 0x8d, 0x26, 0xda, 0x23, 0x1a, 0xf1, 0x4d, 0x9c, 0x29, 0x27, 0xed, 0x21, 0x0a, 0xfb, 0xf9, 0xde, 0xe3, 0x32, 0x67, 0xaa, 0x45, 0x68, 0x46, 0x49, 0xe8, 0x6f, 0xb2, 0x25, 0xa0, 0x53, 0xb5, 0x45, 0x52, 0x90, 0xc3, 0x20, 0xe3, 0xf6, 0x40, 0x62, 0x3c, 0x75, 0xca, 0x42, 0x37, 0x21, 0xf2, 0x80, 0xb8, 0x87, 0x44, 0x24, 0x97, 0xf3, 0x2a, 0x90, 0xd7, 0x8f, 0x64, 0x44, 0x04, 0x77, 0xad, 0x09, 0x27, 0xc7, 0xba, 0x01, 0xc4, 0x4d, 0xa9, 0xd5, 0xc2, 0x83, 0xa4, 0x38, 0xbe, 0x0d, 0xc5, 0x80, 0xa0, 0x05, 0x28, 0xfc, 0x65, 0xe2, 0x04, 0xd4, 0x2a, 0x2d, 0x4e, 0x29, 0x13, 0xc1 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.2", + /* Message to be signed */ + 53, + { 0xbd, 0xbf, 0x3b, 0x36, 0x40, 0x73, 0xfe, 0x04, 0x8f, 0xba, 0xe5, 0x5e, 0x3c, 0xde, 0x66, 0x8e, 0x84, 0xf7, 0x53, 0xab, 0xfc, 0x71, 0x0b, 0x8c, 0xdb, 0x7b, 0x6c, 0x0c, 0xf8, 0x2d, 0xd5, 0xb6, 0x74, 0xd2, 0x1e, 0x2b, 0x3e, 0x36, 0xb1, 0xb0, 0x36, 0x0d, 0xf8, 0xbf, 0x7e, 0x62, 0x27, 0xc9, 0x2e, 0x15, 0xf3, 0xd7, 0x84 } +, + /* Signature */ + 128, + { 0x66, 0xac, 0xf0, 0x43, 0xbc, 0x6a, 0xae, 0x81, 0xa4, 0xd5, 0x2b, 0x4e, 0x8c, 0x40, 0x12, 0x8b, 0x25, 0xc6, 0xd1, 0x0a, 0x8c, 0x69, 0x8c, 0x83, 0xae, 0xd7, 0x1e, 0x8f, 0x35, 0x83, 0x89, 0x8b, 0xe8, 0xf4, 0xc9, 0xbe, 0xa4, 0xb6, 0x31, 0x90, 0xe2, 0x15, 0x26, 0xca, 0xf8, 0x3a, 0xb1, 0x4a, 0x4f, 0x8b, 0xeb, 0xe8, 0x13, 0xa5, 0xab, 0xeb, 0x95, 0x95, 0x67, 0xbb, 0x2f, 0x06, 0xc5, 0xf1, 0x1e, 0x46, 0x4b, 0x5c, 0xdf, 0x7b, 0x2a, 0x13, 0x2d, 0x42, 0x6d, 0xdb, 0xec, 0xf5, 0x85, 0x90, 0x0a, 0x0d, 0x80, 0x92, 0xca, 0x52, 0xb6, 0xdc, 0x0a, 0xbc, 0x35, 0xf1, 0x40, 0x94, 0x69, 0x89, 0x46, 0xe1, 0xcd, 0x0e, 0xcd, 0x6b, 0xd4, 0x1e, 0x2c, 0x6f, 0x96, 0x3e, 0xe8, 0x9c, 0x82, 0x19, 0x3e, 0xcc, 0x5f, 0xd4, 0x76, 0x30, 0xd3, 0x4a, 0xd1, 0x6c, 0xa2, 0x47, 0x9e, 0xaf, 0x06, 0x2d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.3", + /* Message to be signed */ + 223, + { 0x3c, 0x5c, 0x74, 0xbc, 0x8f, 0xae, 0x80, 0x7a, 0xe5, 0x8b, 0xd2, 0x13, 0xe6, 0x27, 0x2a, 0xa3, 0x85, 0x79, 0x31, 0x57, 0x5c, 0x2a, 0xa2, 0xbe, 0x4b, 0xca, 0xe4, 0xd7, 0x9a, 0xe0, 0x87, 0xb6, 0xb8, 0x6f, 0x91, 0x5d, 0xf8, 0xc0, 0x96, 0xc1, 0x22, 0xed, 0xfb, 0xdc, 0x79, 0x7f, 0x9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9b, 0xa4, 0x6f, 0x67, 0x11, 0x2c, 0xd7, 0xc7, 0xc6, 0xfb, 0x27, 0x37, 0xad, 0x79, 0x3a, 0x87, 0x28, 0x79, 0x05, 0x2a, 0x88, 0x45, 0x7a, 0xf5, 0xe9, 0xd5, 0x99, 0x59, 0xa8, 0x48, 0x13, 0x4a, 0x68, 0x24, 0xde, 0x3a, 0x67, 0x4f, 0x72, 0xa9, 0x06, 0x87, 0x9e, 0x95, 0xbe, 0x0e, 0xd8, 0x7e, 0xa9, 0xf9, 0x74, 0xa7, 0xa0, 0x7b, 0xa9, 0xad, 0xbe, 0xc2, 0xfb, 0xfa, 0x02, 0x94, 0x37, 0x8b, 0x14, 0xe7, 0x35, 0xf5, 0x5f, 0x40, 0x3c, 0xa0, 0x53, 0x08, 0x4f, 0x51, 0xd3, 0xd3, 0x42, 0xd8, 0xaf, 0x9c, 0x64, 0xb4, 0xd1, 0x54, 0xad, 0x9a, 0xa3, 0xc6, 0xbc, 0xaa, 0xce, 0x1f, 0x1b, 0xbe, 0x62, 0xee, 0xb5, 0xd0, 0xe6, 0xc4, 0xc0, 0x30, 0x93, 0xc2, 0xaf, 0x0f, 0x07, 0x88, 0x8b, 0x8b, 0xbe, 0xfa, 0x79, 0x40, 0x03, 0x23, 0x13, 0x3f, 0x77, 0x6a, 0x32, 0x13 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.4", + /* Message to be signed */ + 61, + { 0x42, 0x56, 0x46, 0x65, 0x0d, 0x6b, 0x37, 0x9e, 0x16, 0xe1, 0x5b, 0xf3, 0x85, 0x3d, 0xdc, 0x9d, 0x44, 0x4f, 0x44, 0x53, 0x5c, 0x49, 0x3a, 0x37, 0x03, 0xb0, 0x01, 0x63, 0xaf, 0x34, 0x76, 0xdf, 0x37, 0x2a, 0x5b, 0x28, 0xf3, 0x34, 0xc0, 0x86, 0x03, 0x13, 0xe8, 0x13, 0x6d, 0xe6, 0x08, 0x29, 0x1b, 0x33, 0x78, 0x38, 0x1b, 0x9e, 0x21, 0xeb, 0xef, 0x24, 0x82, 0x5d, 0x12 } +, + /* Signature */ + 128, + { 0xa6, 0xa0, 0xcb, 0x02, 0x48, 0x1a, 0xf2, 0x48, 0xab, 0xae, 0x89, 0xcd, 0xf4, 0x16, 0x1f, 0x67, 0x76, 0xd4, 0x71, 0x08, 0xf1, 0x8e, 0xc6, 0xe8, 0x43, 0x7c, 0x22, 0x4a, 0x14, 0xf4, 0x52, 0xad, 0xa1, 0x36, 0x52, 0x0f, 0x0f, 0xe0, 0x10, 0xa7, 0x34, 0x5a, 0xf1, 0x97, 0x1a, 0x02, 0xe4, 0xbc, 0xf8, 0xc9, 0x8b, 0x26, 0xc5, 0xb8, 0xc6, 0x00, 0x3d, 0xe4, 0xd2, 0xb4, 0x07, 0x2d, 0x8d, 0xef, 0x1e, 0x19, 0x23, 0xd9, 0xcc, 0xe0, 0xa6, 0x75, 0x14, 0x1d, 0x37, 0x87, 0x3e, 0x59, 0x48, 0xea, 0x6c, 0x8a, 0x78, 0x0e, 0xd2, 0xa5, 0xec, 0xc2, 0xba, 0x9a, 0x81, 0x20, 0x6c, 0x7e, 0xcc, 0xc8, 0x0e, 0xac, 0x02, 0x6d, 0xb7, 0xd7, 0x60, 0x22, 0x3a, 0xa2, 0x38, 0x7a, 0x18, 0x2e, 0x98, 0xd6, 0x6f, 0x1e, 0x23, 0xdf, 0xea, 0xf3, 0x51, 0x5c, 0xee, 0x4f, 0xa1, 0xab, 0xd4, 0x64, 0xb7, 0x68 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.5", + /* Message to be signed */ + 85, + { 0xf4, 0x7d, 0x87, 0xbf, 0xd4, 0x88, 0xaf, 0x5b, 0x24, 0xdb, 0x34, 0xad, 0x0c, 0x13, 0x1e, 0xfc, 0xa1, 0x0c, 0xdd, 0x1a, 0xae, 0xff, 0xbe, 0x6e, 0x36, 0x48, 0x47, 0x22, 0xed, 0x68, 0x09, 0xb1, 0xd5, 0x7a, 0x18, 0x3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.5 Signature Example 6.6", + /* Message to be signed */ + 6, + { 0x03, 0x18, 0x78, 0xd5, 0x88, 0xee } +, + /* Signature */ + 128, + { 0xcc, 0x15, 0x4e, 0x1a, 0xf7, 0x13, 0xf2, 0xf9, 0x5e, 0x16, 0xf4, 0x11, 0x17, 0x5d, 0x98, 0x36, 0xad, 0x6d, 0x8b, 0xbd, 0xc8, 0xf9, 0x8c, 0xf0, 0x5c, 0xfa, 0x00, 0x58, 0x23, 0x5d, 0x1f, 0xdd, 0xe0, 0x40, 0x82, 0x76, 0x4c, 0x29, 0xdc, 0xdc, 0xc5, 0x9e, 0xbe, 0x26, 0x57, 0x8b, 0xf9, 0xe8, 0xad, 0x6a, 0x5a, 0xa8, 0x6b, 0x9d, 0x62, 0x91, 0x4b, 0x4c, 0xf6, 0x96, 0xa8, 0xec, 0x2d, 0xa8, 0x79, 0xf8, 0xfa, 0x42, 0x31, 0x46, 0x31, 0x32, 0xea, 0xd7, 0xbb, 0x3b, 0xe7, 0x50, 0xae, 0x0c, 0x56, 0x28, 0xa3, 0x96, 0xb7, 0x0a, 0xdf, 0xa2, 0x7b, 0x40, 0x34, 0x23, 0xb1, 0x00, 0x18, 0xf9, 0xd2, 0x4f, 0xea, 0x33, 0x70, 0x30, 0x14, 0x7f, 0xbf, 0xaa, 0x15, 0xd4, 0x75, 0x32, 0xc9, 0x25, 0x7c, 0x2c, 0x7f, 0x54, 0x1b, 0x5b, 0x97, 0x4d, 0x15, 0xdd, 0x1e, 0x3f, 0xd2, 0xe2, 0x0a, 0x69 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.7", + /* Message to be signed */ + 136, + { 0x27, 0x26, 0x38, 0x52, 0xea, 0xa9, 0x60, 0xbf, 0x76, 0x71, 0x87, 0x6f, 0xc7, 0x90, 0x0f, 0x89, 0x8e, 0xa8, 0x2e, 0xb2, 0xb0, 0xfc, 0x41, 0x85, 0x65, 0xfd, 0xae, 0x62, 0xf7, 0xd9, 0xec, 0x4c, 0xe2,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0x01, 0x78, 0x36, 0xdb, 0x17, 0x66, 0x0d, 0x06, 0x9d, 0x80, 0x27, 0x1e, 0x1e, 0xa9, 0x98, 0x11, 0x63, 0xb1, 0x4b, 0x66, 0x87, 0x6d, 0xfd, 0x12, 0x8f, 0x09, 0xcd, 0x2e, 0x3d, 0x6a, 0x36, 0xb7, 0x3c, 0x3b, 0x40, 0xad, 0x8e, 0x13, 0x24, 0x84, 0x90, 0x29, 0xc8, 0xb8, 0xe3, 0xc8, 0x89, 0x4e, 0xbf, 0xa1, 0x94 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.8", + /* Message to be signed */ + 200, + { 0xa4, 0xfb, 0x21, 0x03, 0xd0, 0xbe, 0x29, 0x0e, 0x99, 0x60, 0x16, 0xa4, 0x39, 0x46, 0x2e, 0x6b, 0xbd, 0xb0, 0x72, 0x4d, 0x86, 0xcd, 0x51, 0x85, 0x91, 0x33, 0xca, 0x3d, 0x39, 0xda, 0xb7, 0x7d, 0xa2, 0x06, 0x9d, 0x82, 0x83, 0x58, 0x96, 0x38, 0x7c, 0xcf, 0x3d, 0xf5, 0xcd, 0xd7, 0xa5, 0x79, 0x3f, 0x22, 0x3f, 0x3d, 0x92, 0x3e, 0xa4, 0x63, 0x51, 0x35, 0x31, 0xad, 0xa6, 0x67, 0xab, 0xfe, 0xf7, 0x53, 0x98, 0xc7, 0xa4, 0xbc, 0x6e, 0xfa, 0xdd, 0x4e, 0xde, 0xef, 0x35, 0xab, 0x8f, 0x54, 0x01, 0xe0, 0xda, 0xf7, 0xc2, 0xfc, 0xa1, 0xcd, 0xbb, 0xee, 0xd3, 0xbc, 0xdd, 0x09, 0x33, 0xff, 0x3e, 0xe4, 0xc5, 0xe2, 0x88, 0xab, 0xdf, 0x21, 0x9e, 0x36, 0xa3, 0xee, 0x6f, 0x21, 0x08, 0x41, 0xa0, 0x3c, 0x9e, 0x3e, 0x4d, 0xac, 0x18, 0x12, 0x24, 0x82, 0xef, 0x85, 0xf4, 0x9f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, 0x96, 0x1a, 0xf3, 0x84, 0x41, 0x7d, 0x18, 0x2c, 0x6f, 0x85, 0x52, 0x46, 0xda, 0xd5, 0xb8, 0x93, 0xd9, 0xa7, 0x68, 0x0e, 0xbc } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.9", + /* Message to be signed */ + 160, + { 0xe5, 0x50, 0x6e, 0x04, 0xb1, 0x91, 0x84, 0x10, 0x76, 0x85, 0x87, 0x25, 0xa9, 0xfd, 0xd8, 0xf9, 0x74, 0x5f, 0x24, 0x2e, 0x99, 0x49, 0x4a, 0x42, 0x3f, 0x80, 0x36, 0x74, 0x74, 0x27, 0x1d, 0xce, 0x95, 0xa9, 0x9a, 0x2f, 0x71, 0x13, 0x4f, 0x39, 0xfb, 0x3f, 0x2e, 0x47, 0xc6, 0xa0, 0xb2, 0xfb, 0x6f, 0x61, 0x5b, 0x0d, 0xee, 0x6d, 0xf3, 0x3b, 0x28, 0xf8, 0xb0, 0xd4, 0x1e, 0x92, 0xd1, 0x42, 0xb1, 0x46, 0xe8, 0xcd, 0xe9, 0xb1, 0x1d, 0x6e, 0xc1, 0xd3, 0x7d, 0x71, 0xfd, 0x82, 0xb7, 0x19, 0xce, 0x1a, 0xdd, 0xb8, 0x21, 0xca, 0x4c, 0xaf, 0xbd, 0x2a, 0xa4, 0xf1, 0xe6, 0x11, 0xa2, 0x59, 0xe5, 0xf0, 0x5b, 0x53, 0x1f, 0xa1, 0x1e, 0x3b, 0x67, 0x1b, 0x7a, 0x5b, 0x10, 0xb4, 0xc8, 0x15, 0x6c, 0x25, 0xb0, 0xa5, 0x9e, 0xc6, 0xe1, 0x58, 0xf6, 0xd3, 0x46, 0xd8, 0x48, 0x04, 0xfc, 0xf9, 0x2a, 0x72, 0x76, 0x8f, 0x4e, 0xbc, 0x93, 0x5e, 0xee, 0x5c, 0xfe, 0xc7, 0xf6, 0xe6, 0xe8, 0x3c, 0xbe, 0x15, 0x8a, 0x13, 0x27, 0x5e, 0x84, 0x18, 0x3a, 0x94, 0xd7, 0x24, 0xb0, 0xe9, 0x66, 0x96 } +, + /* Signature */ + 128, + { 0x34, 0x22, 0x0e, 0xda, 0xfd, 0x4a, 0xc8, 0x84, 0xb9, 0xd0, 0x0f, 0xbb, 0xfb, 0x71, 0xa4, 0xa6, 0xc4, 0xd4, 0xb7, 0x1c, 0x19, 0x84, 0x22, 0x05, 0x07, 0x99, 0xd0, 0xc0, 0xfd, 0x54, 0xe9, 0x09, 0xa4, 0xca, 0xd2, 0x29, 0x8f, 0xaa, 0xb3, 0x34, 0x7a, 0x0a, 0xf0, 0xd2, 0x7d, 0x53, 0x01, 0xa8, 0x86, 0x00, 0x9c, 0xf5, 0xc6, 0xf1, 0x25, 0xdf, 0xc1, 0x13, 0x1a, 0xce, 0x38, 0x8b, 0xb2, 0x14, 0xc2, 0x84, 0x44, 0x20, 0xc0, 0x23, 0xdb, 0xc8, 0xb4, 0xa9, 0x66, 0x11, 0xb3, 0xb3, 0x93, 0xac, 0xc3, 0x83, 0x94, 0x90, 0xfc, 0x4e, 0xe2, 0xd3, 0x69, 0xb8, 0xc3, 0xc8, 0x76, 0x57, 0x22, 0x83, 0xef, 0x34, 0xd7, 0x0c, 0x64, 0x03, 0xef, 0x9e, 0x2e, 0x87, 0xa2, 0x76, 0xb2, 0x35, 0x72, 0xed, 0x82, 0xe2, 0x40, 0x22, 0x67, 0xc2, 0x73, 0x7f, 0x75, 0xbb, 0x4a, 0x27, 0xd3, 0xcf, 0x16, 0xd2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.10", + /* Message to be signed */ + 166, + { 0x8f, 0xc9, 0xcf, 0xa7, 0x21, 0xdf, 0xa0, 0x9b, 0xa0, 0x72, 0x9e, 0xf9, 0x18, 0x9e, 0x54, 0x27, 0xb3, 0xe7, 0x38, 0xc5, 0xae, 0x38, 0xa2, 0x65, 0x7f, 0x7c, 0x7e, 0x31, 0x4a, 0x49, 0xca, 0xeb, 0xa0, 0xfc, 0x9d, 0x45, 0x40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, 0x06, 0xb5, 0x16, 0x47, 0xba, 0xfe, 0x0c, 0x85, 0xf3, 0xd3, 0xb8, 0xdc, 0xe9, 0x0c, 0xeb, 0xf0, 0xa0, 0xee, 0xcb, 0xac, 0x12, 0x28, 0xe7, 0x85, 0x82, 0x0c, 0x4f, 0x90, 0x9d, 0x2e, 0xf3, 0x92, 0xf0, 0x31, 0x17, 0x56, 0x1e, 0xc3, 0x8e, 0xb0, 0xd8, 0x8b, 0x02, 0x32, 0x72, 0xa4, 0x28, 0x63, 0x51, 0x62, 0x0f, 0x21, 0x04, 0x3c, 0xca, 0xf7, 0x50, 0x36, 0x84, 0x00, 0x29, 0x57, 0xef, 0x79, 0xbc, 0xff, 0x9d, 0x1c, 0x20, 0x1c, 0x42, 0xe0, 0x96, 0x0b, 0xd9, 0x69, 0x79 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.11", + /* Message to be signed */ + 238, + { 0x96, 0x1f, 0xe3, 0x4a, 0x21, 0x2c, 0xb0, 0xe6, 0xf6, 0xdc, 0xde, 0xcf, 0x1a, 0x4c, 0xb7, 0xb2, 0x14, 0x39, 0x0a, 0x77, 0xf4, 0x4d, 0x3a, 0x3b, 0x3e, 0xe2, 0xb1, 0x2f, 0x1f, 0x0e, 0xe3, 0x14, 0x2e, 0x9e, 0xaf, 0x70, 0x89, 0x55, 0xec, 0x83, 0x7e, 0xa1, 0xd0, 0xd2, 0x95, 0x4e, 0x6c, 0xe9, 0x50, 0xf3, 0x4c, 0x87, 0x30, 0x54, 0x8f, 0x2e, 0x09, 0x5d, 0x5d, 0xbb, 0x93, 0x8b, 0x19, 0x0b, 0x73, 0x8b, 0xff, 0x81, 0x71, 0x93, 0x02, 0xb6, 0x79, 0x8b, 0x76, 0x8b, 0x0b, 0xbd, 0xd2, 0xe2, 0xb9, 0x67, 0x2d, 0x89, 0x14, 0x05, 0xc7, 0x71, 0xa7, 0x79, 0x02, 0xfd, 0x54, 0x27, 0x42, 0x5a, 0xf0, 0x4e, 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, 0xf6, 0x1d, 0xf1, 0x6f, 0x0c, 0x09, 0xf7, 0x15, 0xb7, 0x05, 0x38, 0x8b, 0xb8, 0xa6, 0x11, 0x87, 0x34, 0x6e, 0x8d, 0x7b, 0x07, 0xea, 0xb2, 0xfc, 0x05, 0xdb, 0x89, 0xe0, 0x30, 0x09, 0x44, 0xae, 0x37, 0x73, 0xe4, 0x4c, 0xb9, 0x2c, 0x5c, 0xf0, 0xf4, 0xfb, 0xe0, 0x1a, 0x05, 0xad, 0x79, 0xbf, 0xaa, 0x24, 0x7f, 0x83, 0xed, 0x1e, 0xda, 0x48, 0xba, 0xaf, 0xd1, 0xe1, 0x80, 0x07, 0x8c, 0xa8, 0xd3, 0x21, 0xd5, 0x0b, 0x42, 0x57, 0x87, 0xf0, 0x12, 0x43, 0xa4, 0x93, 0x37, 0x4e, 0x84, 0xf5, 0xcd, 0x56, 0xb7, 0x53, 0xd7, 0xac } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.12", + /* Message to be signed */ + 121, + { 0x96, 0xff, 0x0a, 0x5e, 0xca, 0xc9, 0x51, 0x16, 0xbd, 0x73, 0x43, 0x79, 0x5a, 0xf8, 0x3c, 0x87, 0xed, 0x9f, 0x83, 0x45, 0xd0, 0x3f, 0x6f, 0x32, 0x2f, 0x29, 0x54, 0x93, 0xf4, 0x0b, 0x19, 0xba, 0x8f, 0xfe, 0x2c, 0x89, 0x8c, 0x7b, 0x20, 0x66, 0x21, 0xf7, 0x2e, 0x02, 0xc7, 0xf0, 0xf0, 0x0f, 0x9f, 0x1c, 0x52, 0x3d, 0x73, 0xd3, 0x35, 0xa2, 0x6c, 0xed, 0xdc, 0x73, 0x98, 0xb7, 0xca, 0x20, 0x09, 0xca, 0xcb, 0xb1, 0x82, 0x83, 0xb7, 0x6b, 0x28, 0x15, 0xd1, 0xe9, 0x01, 0x00, 0x09, 0x6e, 0x95, 0xb8, 0x85, 0x30, 0xf1, 0xc4, 0x8c, 0x39, 0x61, 0xc4, 0x35, 0xbc, 0xe0, 0x28, 0x9f, 0xf6, 0x2e, 0x21, 0xbf, 0x4d, 0x3e, 0xc8, 0x99, 0xc8, 0x7e, 0x14, 0xc8, 0xea, 0xd7, 0x92, 0x2e, 0x79, 0x5e, 0x3e, 0x6f, 0x41, 0x80, 0xc0, 0x89, 0x9e, 0xa0 } +, + /* Signature */ + 128, + { 0x7c, 0x7b, 0x01, 0x57, 0xf6, 0xa5, 0x09, 0x09, 0x51, 0x09, 0x63, 0x28, 0x2f, 0x00, 0x11, 0x1e, 0xea, 0x70, 0x19, 0x37, 0x54, 0xe4, 0x27, 0xa0, 0x2b, 0x34, 0x6f, 0xeb, 0x68, 0x2f, 0x4c, 0x71, 0x87, 0xbb, 0x38, 0x1d, 0x31, 0xd2, 0x3b, 0x94, 0x76, 0x88, 0x43, 0x24, 0x5a, 0xad, 0x53, 0x61, 0xfc, 0xa4, 0x2d, 0x8b, 0x28, 0x4c, 0x8d, 0x92, 0xe6, 0xfb, 0x99, 0x2f, 0xa7, 0x71, 0x2f, 0xa5, 0xa9, 0x31, 0x55, 0xdf, 0x02, 0x0d, 0x30, 0x0a, 0x3b, 0xf8, 0x98, 0x86, 0x66, 0x8c, 0xf3, 0x7b, 0xd1, 0x3b, 0x55, 0x0a, 0xdb, 0x2d, 0x2a, 0x86, 0xc6, 0x9d, 0xaa, 0xac, 0xdc, 0x50, 0x30, 0xdc, 0x84, 0x34, 0x3c, 0x8b, 0x49, 0x34, 0xf0, 0x3c, 0xdc, 0x0e, 0xef, 0x0f, 0x6c, 0x1e, 0xa7, 0xec, 0x09, 0x62, 0x00, 0x79, 0x03, 0xb4, 0x48, 0x21, 0x7d, 0xe9, 0x3b, 0x75, 0x07, 0x54, 0x9b, 0x2e } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.13", + /* Message to be signed */ + 79, + { 0x32, 0xa1, 0x2e, 0x0c, 0x67, 0x0e, 0xd2, 0x15, 0xae, 0x54, 0x49, 0xa0, 0x91, 0x7a, 0x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x39, 0x33, 0x37, 0x66, 0x11, 0x5a, 0x23, 0xb9, 0xd0, 0x0e, 0x2a, 0x42 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.14", + /* Message to be signed */ + 78, + { 0xbb, 0xda, 0x73, 0xcb, 0xe2, 0xbf, 0xf7, 0xff, 0x53, 0x62, 0xeb, 0xe9, 0x32, 0xc0, 0xa0, 0xdd, 0x68, 0xac, 0x84, 0xee, 0x99, 0x8f, 0xbf, 0x59, 0xa2, 0xa9, 0x26, 0x55, 0x20, 0x32, 0x31, 0x63, 0xb3, 0x0d, 0x9e, 0x70, 0x08, 0xb9, 0x4b, 0x0c, 0x0e, 0xbc, 0x5f, 0x6c, 0x4c, 0x97, 0x3c, 0x13, 0xff, 0x15, 0x3d, 0x31, 0x69, 0x0c, 0x3c, 0x95, 0xab, 0x23, 0x1f, 0x0c, 0x9e, 0xc9, 0x98, 0xfb, 0xfc, 0xad, 0xc2, 0x8b, 0x2d, 0x7f, 0x06, 0x50, 0x7e, 0x17, 0xd2, 0x1e, 0x82, 0xda } +, + /* Signature */ + 128, + { 0x26, 0xf9, 0x52, 0xb6, 0x57, 0xfd, 0xb9, 0xa1, 0x1d, 0xc8, 0x43, 0x79, 0x0c, 0x9d, 0x2a, 0x6a, 0x51, 0xc9, 0x76, 0x10, 0x1e, 0xfb, 0x82, 0xd0, 0x53, 0x60, 0x67, 0x62, 0xab, 0xa3, 0x3a, 0xf6, 0x28, 0x0b, 0xde, 0x38, 0x15, 0xe0, 0x87, 0x4d, 0x60, 0x78, 0x75, 0x38, 0x42, 0xe5, 0xb1, 0xc9, 0x0c, 0xf7, 0x99, 0x12, 0x20, 0xfc, 0xfa, 0x62, 0x28, 0x49, 0x43, 0x69, 0x0c, 0x30, 0x1e, 0x9f, 0xc6, 0xe4, 0x79, 0xaf, 0x68, 0xb9, 0x69, 0x47, 0x85, 0xbe, 0x40, 0xd4, 0x69, 0x86, 0xa6, 0x2a, 0x12, 0x1a, 0xa9, 0xad, 0x0d, 0xe9, 0x69, 0x52, 0x1f, 0x1c, 0xb8, 0xe7, 0xc4, 0xbd, 0x70, 0xc7, 0xc8, 0xcd, 0x7a, 0x9d, 0x13, 0x54, 0xe7, 0xd0, 0xaa, 0x0d, 0x85, 0xd6, 0xd7, 0xaa, 0x00, 0xe4, 0x64, 0x90, 0x26, 0xd6, 0xf0, 0x70, 0xf8, 0xb3, 0xc2, 0x7c, 0x98, 0x55, 0x6b, 0xea, 0xa4, 0xc0 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.15", + /* Message to be signed */ + 150, + { 0x2c, 0x32, 0x5d, 0xda, 0xf6, 0x52, 0x6a, 0x1e, 0xa3, 0x51, 0x8e, 0xe5, 0xe5, 0x40, 0x7f, 0x03, 0x90, 0xe0, 0xeb, 0xaa, 0xa5, 0xf4, 0x72, 0xa1, 0xe9, 0xab, 0x46, 0xf7, 0x46, 0xd7, 0x1b, 0xa2, 0xe2, 0x17, 0xfa, 0xa8, 0x17, 0x99, 0xbf, 0x35, 0x8f, 0x95, 0xe9, 0x83, 0x08, 0x27, 0x0b, 0x18, 0xa0, 0x01, 0x99, 0x29, 0xa2, 0x88, 0xd0, 0xc9, 0x56, 0xe0, 0xbf, 0x17, 0xc5, 0x19, 0x8c, 0xeb, 0x2c, 0xd9, 0xfe, 0x40, 0xd7, 0x02, 0xa4, 0x4e, 0x56, 0x45, 0xec, 0xa5, 0xb4, 0x39, 0xab, 0xca, 0x7b, 0x2c, 0x6f, 0x95, 0xac, 0xc3, 0xc2, 0xc3, 0x65, 0x19, 0x5c, 0x79, 0x5e, 0x91, 0xd6, 0x3b, 0x3c, 0x09, 0x33, 0x24, 0x4f, 0xf1, 0x25, 0x63, 0xaf, 0x66, 0x22, 0xa4, 0x0c, 0x74, 0x15, 0xdb, 0x60, 0xa7, 0x8d, 0xca, 0x02, 0x60, 0x25, 0x14, 0x39, 0x53, 0x8d, 0x38, 0xaa, 0x38, 0x28, 0x9d, 0x92, 0x88, 0x86, 0xab, 0x12, 0x87, 0x36, 0xa6, 0xa8, 0x73, 0x9c, 0x14, 0x55, 0xc4, 0x84, 0x9f, 0x2d, 0x54, 0x56, 0x45, 0x37, 0x93 } +, + /* Signature */ + 128, + { 0x6d, 0x1f, 0x20, 0x3d, 0xc3, 0xff, 0xa7, 0xa3, 0x34, 0xd3, 0x1b, 0x9a, 0x75, 0xe0, 0x12, 0x58, 0x1b, 0x8d, 0x62, 0xb2, 0xbf, 0x73, 0x80, 0x0b, 0xe5, 0x1d, 0x02, 0x65, 0x33, 0x99, 0x83, 0x18, 0xc0, 0xca, 0xc9, 0x2a, 0x02, 0xd4, 0x6d, 0x75, 0x9b, 0xf8, 0x0a, 0x41, 0xda, 0xa0, 0xa6, 0xa2, 0x9f, 0x4f, 0xa0, 0xbb, 0x60, 0x66, 0x4c, 0xac, 0xad, 0xe2, 0x4a, 0x65, 0xcb, 0x47, 0x65, 0x11, 0x09, 0xbe, 0xec, 0x82, 0x31, 0x91, 0x95, 0x25, 0xd1, 0x47, 0x32, 0x68, 0x74, 0x55, 0x78, 0xdb, 0x9e, 0x30, 0x64, 0x10, 0x8a, 0xe4, 0x6a, 0x48, 0x70, 0xf1, 0x80, 0x66, 0x78, 0x9b, 0x03, 0x66, 0xa7, 0xd0, 0xce, 0x37, 0xe0, 0x30, 0xb5, 0x89, 0x46, 0xec, 0x8c, 0x1a, 0x14, 0x11, 0x54, 0xdb, 0x0e, 0x26, 0x1b, 0xef, 0x8b, 0xaf, 0x2e, 0x9f, 0x65, 0xfc, 0xd1, 0x6b, 0x7d, 0x57, 0x97, 0xb6 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.16", + /* Message to be signed */ + 25, + { 0x29, 0x85, 0xe8, 0xb5, 0x50, 0x81, 0x2f, 0xb6, 0x6c, 0x18, 0xf8, 0x0e, 0x6f, 0x09, 0x2a, 0x94, 0x5d, 0x09, 0x15, 0x83, 0x86, 0x1b, 0x62, 0x5d, 0x1e } +, + /* Signature */ + 128, + { 0x2e, 0x84, 0x30, 0x13, 0xcd, 0x5e, 0x79, 0x5e, 0x21, 0x66, 0xc8, 0xe9, 0x1b, 0x06, 0xc3, 0x13, 0x1d, 0xc3, 0xa5, 0xe1, 0x21, 0x36, 0xd7, 0x16, 0x0f, 0xfd, 0x11, 0xbb, 0xef, 0xcf, 0x6a, 0xb6, 0x40, 0xe0, 0x5d, 0x76, 0xe0, 0xc6, 0x1e, 0xd3, 0x06, 0xf6, 0x08, 0x6b, 0xbb, 0x56, 0x7c, 0xa8, 0x7e, 0x40, 0xc6, 0x92, 0x4d, 0x5c, 0x84, 0xa6, 0xce, 0x28, 0xa8, 0x39, 0x50, 0xbd, 0x4b, 0x84, 0xe2, 0x7f, 0xc5, 0x06, 0x9f, 0xd0, 0x62, 0x4d, 0x50, 0xea, 0xc2, 0x4a, 0x94, 0x11, 0xb5, 0xf7, 0x67, 0x85, 0xd9, 0xdb, 0x5d, 0xa3, 0x0f, 0x42, 0x56, 0x95, 0xb0, 0x19, 0xb8, 0x4c, 0xdb, 0xb8, 0x25, 0xbd, 0x46, 0xe7, 0x35, 0x2e, 0x08, 0xf1, 0x14, 0xc8, 0x7b, 0x06, 0x6f, 0xe4, 0x3d, 0x10, 0x56, 0xa2, 0xc6, 0x10, 0xce, 0xa7, 0xe3, 0xd3, 0xdc, 0x98, 0xbf, 0x44, 0x97, 0xeb, 0x4f, 0x13 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.17", + /* Message to be signed */ + 146, + { 0x77, 0x78, 0x8e, 0x83, 0x8b, 0x83, 0x4e, 0x8f, 0x4d, 0x04, 0x5a, 0xa8, 0x94, 0xb9, 0x0a, 0xbb, 0x85, 0x94, 0x0c, 0xfc, 0x58, 0xd7, 0x72, 0x5e, 0x7f, 0x37, 0x3d, 0xa5, 0x54, 0x71, 0x37, 0xc6, 0x0b, 0xea, 0x75, 0x1e, 0x01, 0x42, 0xbf, 0x9a, 0x6f, 0x46, 0x49, 0xae, 0xb5, 0x46, 0xed, 0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d4, 0x9d, 0x90, 0x90, 0xae, 0x5f, 0x63, 0xe8, 0xa0, 0x8b, 0x6e, 0x8f, 0x21, 0xf0, 0x03, 0xe4, 0x51, 0xd2, 0x50, 0xff, 0xc5, 0xa7, 0x90, 0xd6, 0x6a, 0x0e, 0x2e, 0x3e, 0x28, 0xa6, 0x33, 0x9f, 0xe9, 0x1d, 0x11, 0x29, 0x21, 0xf5, 0x5d, 0x12, 0x30, 0x30, 0x6f, 0xad, 0x5c, 0x01, 0x90 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.18", + /* Message to be signed */ + 62, + { 0x1d, 0x59, 0x9d, 0x76, 0x2c, 0xd5, 0x4d, 0xf7, 0x0f, 0x1a, 0x09, 0x83, 0xbc, 0x3e, 0xa2, 0xbb, 0xca, 0x6f, 0xcb, 0xbd, 0x16, 0x26, 0x03, 0xba, 0x81, 0x56, 0x10, 0x77, 0xfd, 0x92, 0x84, 0x92, 0x5c, 0xf1, 0xf1, 0xb0, 0x8b, 0xea, 0x1e, 0x70, 0xbc, 0x59, 0x5d, 0xf0, 0xb3, 0x43, 0xb8, 0x3b, 0x9c, 0xf3, 0xd6, 0x34, 0xf9, 0x5e, 0x37, 0xe8, 0xd1, 0xc5, 0x85, 0xfa, 0xb1, 0x99 } +, + /* Signature */ + 128, + { 0x71, 0x74, 0x97, 0xa4, 0xe6, 0x0d, 0xbf, 0xfa, 0x19, 0x6e, 0xff, 0x75, 0x8e, 0x90, 0x1c, 0xe1, 0xfe, 0x6e, 0x2b, 0xc7, 0xe1, 0xd5, 0x3a, 0x3d, 0xcf, 0x62, 0x25, 0x67, 0x1a, 0xf1, 0x46, 0xc5, 0xde, 0xe2, 0x00, 0xa8, 0x14, 0xf4, 0x89, 0x8d, 0x16, 0xa9, 0xb5, 0xf5, 0x08, 0xdc, 0x9f, 0xde, 0x4d, 0x64, 0x07, 0x0e, 0x55, 0xae, 0x3b, 0x1f, 0xdf, 0x79, 0x19, 0xf4, 0x2b, 0x7c, 0xff, 0xb7, 0xe9, 0x28, 0xc4, 0xca, 0xeb, 0x55, 0x2d, 0xc6, 0xfd, 0x08, 0x18, 0x34, 0xb2, 0xdc, 0x2f, 0xed, 0x07, 0xe7, 0xe6, 0x27, 0xd3, 0x4b, 0x39, 0x10, 0xca, 0x71, 0x3b, 0xf4, 0x15, 0x4e, 0xff, 0x99, 0x96, 0x57, 0x36, 0x15, 0x18, 0xfc, 0xe5, 0xa8, 0xf6, 0x42, 0xdc, 0x9a, 0x18, 0xa6, 0x6e, 0xde, 0x22, 0x19, 0x0f, 0x60, 0xaa, 0xf9, 0x58, 0xd6, 0x24, 0x6b, 0x00, 0xa0, 0x32, 0xc3, 0x98, 0x41 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.19", + /* Message to be signed */ + 169, + { 0xda, 0x51, 0x00, 0x86, 0x60, 0xb6, 0x3b, 0x87, 0x67, 0xe6, 0x5f, 0x12, 0xc6, 0x30, 0x8e, 0xc1, 0x8e, 0xd9, 0x57, 0x5a, 0x42, 0x6b, 0xc5, 0xfb, 0xe6, 0x60, 0x10, 0xec, 0x3f, 0x01, 0x17, 0x5f, 0xfa, 0x57, 0x41, 0xea, 0xcc, 0xdd, 0xb0, 0x2f, 0xce, 0x7b, 0x2e, 0xf7, 0x78, 0x44, 0x40, 0xd7, 0x2d, 0x37, 0x52, 0x20, 0x3f, 0x53, 0x4e, 0x52, 0xfc, 0xf6, 0x26, 0xa8, 0xc5, 0x96, 0x51, 0x3f, 0x41, 0x90, 0x64, 0xbb, 0xba, 0xfd, 0xe7, 0xf8, 0xd6, 0x5f, 0x30, 0xd7, 0xca, 0x68, 0x71, 0x89, 0x70, 0xde, 0x71, 0xfc, 0x8c, 0x0e, 0xed, 0x4d, 0xa0, 0x0a, 0x4e, 0x1a, 0xb5, 0x41, 0x02, 0xd9, 0xd1, 0x65, 0xbd, 0x7c, 0x54, 0xaf, 0x5c, 0x31, 0xc1, 0x5c, 0x05, 0xbc, 0xa5, 0x5b, 0x6f, 0xdd, 0x19, 0x10, 0x86, 0xa5, 0x3e, 0x52, 0x96, 0xf4, 0x84, 0xc3, 0x47, 0xd8, 0xfb, 0x94, 0x5a, 0x10, 0xc4, 0x94, 0x49, 0x75, 0x27, 0x32, 0xf6, 0x2f, 0x34, 0xc3, 0x25, 0x15, 0x58, 0x86, 0x51, 0x13, 0x79, 0x19, 0x28, 0x5a, 0x2c, 0x8e, 0xf7, 0xb4, 0xaa, 0x0e, 0x69, 0x0b, 0x0b, 0x65, 0x43, 0x7f, 0xf8, 0xd5, 0x6f, 0xc9, 0x5d, 0xcb, 0xc3, 0xe7, 0x8d } +, + /* Signature */ + 128, + { 0x32, 0x67, 0x72, 0x28, 0xff, 0x08, 0xc6, 0x6f, 0xd0, 0x3b, 0xb3, 0x1f, 0x0d, 0xfe, 0x89, 0x01, 0x53, 0xb3, 0x44, 0x6b, 0x57, 0xeb, 0x84, 0xef, 0x39, 0x56, 0x20, 0x8f, 0x72, 0xa0, 0x7c, 0x87, 0x67, 0xe6, 0xbf, 0x09, 0xf0, 0x38, 0xbc, 0xf7, 0xf7, 0x35, 0xee, 0x24, 0xa1, 0xf6, 0x40, 0xa1, 0x89, 0x8d, 0x40, 0x9e, 0xb5, 0x3a, 0xbd, 0xb6, 0x93, 0x94, 0x27, 0x34, 0x56, 0x9a, 0xf7, 0x1a, 0x4c, 0xd9, 0x9a, 0x65, 0x20, 0xba, 0xca, 0x5d, 0x42, 0x86, 0xb1, 0x99, 0xcc, 0x67, 0x62, 0x8e, 0x2f, 0xca, 0xd2, 0x96, 0xa3, 0x0e, 0xca, 0x49, 0x9e, 0xb8, 0x80, 0x50, 0x7f, 0x6a, 0x37, 0x44, 0x0b, 0x61, 0xc1, 0x28, 0x4c, 0x40, 0x3c, 0x41, 0x32, 0x1b, 0x99, 0x05, 0x3f, 0x5d, 0x69, 0x72, 0x8d, 0x5b, 0x97, 0x35, 0x76, 0xcf, 0x04, 0x74, 0x83, 0x33, 0xd8, 0x08, 0xd5, 0xe6, 0x8a, 0x8f } + +} +, +{ + "PKCS#1 v1.5 Signature Example 6.20", + /* Message to be signed */ + 50, + { 0x8c, 0xd2, 0xda, 0xd2, 0xa5, 0xd5, 0xf9, 0xfa, 0xa0, 0x7e, 0x24, 0xa9, 0x6e, 0x86, 0xf9, 0xb0, 0xac, 0x8b, 0x40, 0x22, 0x2a, 0xc9, 0xfb, 0x8a, 0x8a, 0x15, 0x72, 0x7c, 0xf2, 0xf5, 0x3e, 0x68, 0x4a, 0xf4, 0xab, 0xdc, 0x98, 0x68, 0xa7, 0x25, 0x3b, 0x25, 0xb0, 0x96, 0xbd, 0x70, 0x1f, 0x46, 0xa9, 0x43 } +, + /* Signature */ + 128, + { 0x8f, 0x03, 0x22, 0xeb, 0x2c, 0x54, 0x05, 0x24, 0x85, 0xa6, 0x45, 0x49, 0xad, 0xff, 0x2a, 0x36, 0x31, 0xdb, 0x65, 0x76, 0xfc, 0x0c, 0xaf, 0xb5, 0x51, 0x69, 0x7d, 0xc5, 0x35, 0x6f, 0x02, 0xe0, 0x93, 0xcb, 0x69, 0x17, 0x3a, 0x7e, 0x83, 0x55, 0xa0, 0xda, 0xde, 0xbf, 0xa5, 0x3c, 0xb2, 0x90, 0x7f, 0x00, 0x2d, 0xb3, 0xa3, 0xe3, 0x87, 0xda, 0x05, 0x7b, 0x7c, 0x73, 0x55, 0x16, 0x43, 0x84, 0x3e, 0xf5, 0x74, 0x48, 0x1f, 0x80, 0x74, 0x15, 0x17, 0x7e, 0x4b, 0x34, 0xc2, 0x5b, 0xd5, 0x5f, 0x4c, 0x02, 0xfa, 0x0a, 0xde, 0xa3, 0xa9, 0x58, 0x04, 0x65, 0xf3, 0x58, 0xc0, 0x05, 0x96, 0xb5, 0xcc, 0x06, 0x2d, 0x58, 0x92, 0x30, 0x3e, 0x1a, 0xcc, 0x11, 0x3c, 0x3b, 0x4b, 0xc7, 0x4d, 0x42, 0xe8, 0x58, 0x02, 0x90, 0x78, 0x48, 0x2a, 0x1b, 0x23, 0x4a, 0x62, 0x5b, 0x04, 0x28, 0x44, 0x06 } + +} +, +} +}, +{ + "Example 7: A 1025-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x01, 0x69, 0x34, 0xcd, 0xff, 0x48, 0x50, 0xb6, 0x00, 0x2c, 0xc0, 0xf0, 0xf4, 0x01, 0x0a, 0x32, 0xc6, 0x55, 0xe5, 0xcf, 0x6e, 0x7c, 0x89, 0x93, 0x7f, 0xd7, 0x55, 0xef, 0x6a, 0xbe, 0x37, 0x9d, 0xad, 0xde, 0x70, 0xcc, 0x21, 0x77, 0x51, 0xf1, 0x4c, 0xba, 0x6d, 0x90, 0xfe, 0x52, 0xdc, 0x0a, 0xf5, 0x8b, 0x25, 0x2f, 0x26, 0xbf, 0x72, 0xda, 0x57, 0x9f, 0xda, 0xf5, 0x7d, 0xdd, 0x6c, 0xd6, 0x02, 0x18, 0x79, 0x94, 0x9a, 0x02, 0x76, 0xb4, 0x43, 0x3f, 0xf0, 0x1e, 0xfc, 0xcc, 0xf3, 0x5a, 0x11, 0xe7, 0xc7, 0x7b, 0x38, 0xc1, 0x8c, 0xca, 0x94, 0xae, 0x01, 0x2d, 0x0f, 0x37, 0x04, 0x21, 0x49, 0x1c, 0x52, 0xad, 0x15, 0xac, 0x76, 0xb1, 0x2e, 0xcd, 0x21, 0x8f, 0x52, 0xe7, 0x57, 0x86, 0x6e, 0x08, 0x9d, 0xd8, 0xad, 0xbb, 0x48, 0xe9, 0xba, 0x89, 0x43, 0x36, 0xc5, 0x75, 0xc4, 0x06, 0x55 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x0d, 0x17, 0x19, 0xe5, 0xbd, 0x47, 0x6d, 0x87, 0xc7, 0xec, 0xc3, 0x1e, 0xb8, 0xab, 0x42, 0x5d, 0x4f, 0xe4, 0xc8, 0xf5, 0xc7, 0xae, 0x23, 0x0a, 0x10, 0x47, 0x55, 0x3f, 0xfb, 0x53, 0x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a, 0x09, 0xf2, 0x4f, 0x6a, 0x7a, 0x45, 0x9a, 0x88, 0x2c, 0x87, 0xa8, 0x03, 0x49, 0x5f, 0x05, 0x6e, 0xcc, 0x3b, 0x43, 0xc5, 0x37, 0x73, 0x1f, 0x85, 0xef, 0xc8, 0xfb, 0x53, 0x87, 0xad, 0x67, 0x31, 0xa6, 0x43, 0x53, 0x32, 0x15, 0xde, 0xcc, 0x38, 0x7d, 0x96, 0x76, 0x12, 0x2c, 0x17, 0x0e, 0x91, 0xe0, 0xf9 } +, + /* Prime exponent 1 */ + 64, + { 0xd5, 0x78, 0xdc, 0xd5, 0x38, 0xf2, 0xfc, 0xdc, 0x30, 0x00, 0xb6, 0xc0, 0xf0, 0x49, 0xfe, 0xe2, 0xad, 0x90, 0x14, 0xfd, 0x24, 0xfb, 0x10, 0xb6, 0x82, 0x18, 0x42, 0xd6, 0x70, 0x03, 0xa5, 0x64, 0xcd, 0x8f, 0xf4, 0x2a, 0x2a, 0x56, 0x4c, 0xfd, 0x81, 0x9c, 0x3a, 0x84, 0xbf, 0x16, 0xc2, 0x47, 0x7e, 0x8e, 0x6e, 0x5b, 0x9e, 0xc4, 0xd4, 0x0e, 0xad, 0x50, 0x24, 0x87, 0xba, 0x50, 0x36, 0x2d } +, + /* Prime exponent 2 */ + 64, + { 0x88, 0x88, 0xdc, 0x8e, 0xae, 0x94, 0xee, 0xa5, 0x80, 0xca, 0xc2, 0xfc, 0x1c, 0xe5, 0x4f, 0x44, 0xe2, 0xba, 0x50, 0x0d, 0xb8, 0x71, 0x53, 0x41, 0xa6, 0xfc, 0x2d, 0x50, 0x4a, 0x82, 0xb1, 0x42, 0x05, 0xe8, 0x91, 0xa6, 0x6f, 0xc8, 0x8d, 0x5c, 0x60, 0xdb, 0x8f, 0x78, 0x6c, 0xcc, 0x70, 0x57, 0x5b, 0x35, 0x66, 0xbe, 0xa8, 0x74, 0xa5, 0x31, 0x7f, 0x5f, 0x16, 0xc4, 0x91, 0xed, 0x1e, 0x79 } +, + /* Coefficient */ + 64, + { 0x17, 0xb0, 0xd6, 0x23, 0x36, 0x19, 0x1e, 0x63, 0xbc, 0xa1, 0x59, 0x93, 0x4d, 0x06, 0x16, 0xcb, 0x89, 0x97, 0x40, 0x9c, 0xbf, 0xca, 0x37, 0x05, 0x69, 0x5b, 0x14, 0xfb, 0x64, 0xa0, 0x81, 0xc1, 0xc9, 0xf5, 0x86, 0x19, 0x3e, 0x52, 0x3a, 0xbd, 0x0b, 0xeb, 0x8d, 0x72, 0x0c, 0xfe, 0x53, 0x7d, 0xfa, 0x1e, 0xde, 0xc4, 0xa6, 0x64, 0x37, 0xd2, 0x41, 0x19, 0x6b, 0x7a, 0x2c, 0xe5, 0x56, 0xc4 } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 7.1", + /* Message to be signed */ + 157, + { 0x35, 0x39, 0x99, 0x7a, 0xe7, 0x09, 0xfe, 0x32, 0xc1, 0x03, 0x6a, 0x13, 0x27, 0x57, 0xf2, 0xa1, 0x66, 0x7a, 0x91, 0xcc, 0x83, 0xbe, 0x73, 0x3a, 0xad, 0xa1, 0xbd, 0xd2, 0x17, 0x92, 0x4c, 0x9a, 0x2c, 0x9f, 0xed, 0x1f, 0xec, 0xf6, 0x1d, 0x1c, 0xf7, 0x9d, 0xae, 0x9a, 0x83, 0xf8, 0xae, 0x3f, 0x4d, 0x05, 0x1b, 0x34, 0xfb, 0xb5, 0x59, 0xcb, 0xfd, 0xa4, 0x92, 0xf1, 0xd8, 0x3b, 0x8b, 0xeb, 0xa0, 0x45, 0xd4, 0xae, 0x1c, 0x8f, 0xea, 0x15, 0xb7, 0x57, 0x7a, 0x1b, 0x8a, 0x3f, 0x55, 0xba, 0xc1, 0x72, 0x7e, 0xdc, 0xa7, 0xf8, 0xf5, 0x2c, 0xb4, 0xba, 0x61, 0xca, 0xf1, 0xfa, 0x8f, 0x8f, 0xd9, 0xaa, 0xc7, 0x79, 0x09, 0x5c, 0xa8, 0x4c, 0x79, 0x91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, +{ + "PKCS#1 v1.5 Signature Example 7.2", + /* Message to be signed */ + 180, + { 0x31, 0x80, 0x08, 0x87, 0x3c, 0x4c, 0xfe, 0xa7, 0x12, 0x5e, 0xa6, 0xfd, 0x52, 0x15, 0xdf, 0xd9, 0x8d, 0x5c, 0x5e, 0x73, 0x32, 0x3f, 0x03, 0xf2, 0x15, 0xc6, 0x9c, 0x8f, 0x2b, 0xb1, 0x98, 0x3b, 0x59, 0xdf, 0xa6, 0xe9, 0x9a, 0xdd, 0x30, 0x69, 0x66, 0xf3, 0x11, 0x0c, 0x16, 0x1c, 0xa2, 0x26, 0x24, 0xb8, 0x80, 0x70, 0x26, 0x5b, 0x8f, 0x3f, 0x9d, 0x5d, 0xf7, 0x29, 0x91, 0xe7, 0x9e, 0x5b, 0x18, 0x9a, 0xa3, 0xd9, 0xcd, 0x9b, 0x20, 0x47, 0xcf, 0xa6, 0x1d, 0x01, 0x23, 0x4b, 0x23, 0x3d, 0x36, 0xac, 0x4b, 0x96, 0xed, 0x08, 0x16, 0x48, 0x87, 0x74, 0x90, 0xfa, 0x4a, 0x80, 0xec, 0x4c, 0xbb, 0xd9, 0xd2, 0xe0, 0x06, 0x2c, 0x39, 0xe1, 0x85, 0x3a, 0x0c, 0x38, 0x34, 0x4b, 0xa8, 0x58, 0xbd, 0x1d, 0x99, 0x5f, 0x6c, 0xaa, 0x28, 0xbf, 0x90, 0x40, 0x26, 0x26, 0x8a, 0x99, 0x72, 0x11, 0x43, 0xc8, 0x6a, 0x43, 0x43, 0xba, 0xf8, 0x9b, 0x6d, 0x55, 0x07, 0x64, 0x25, 0x1f, 0xb0, 0x7d, 0x16, 0x7b, 0x4c, 0x4b, 0x1b, 0x70, 0xf9, 0x9e, 0xf5, 0xfe, 0x50, 0xe6, 0x2e, 0x54, 0x13, 0xfc, 0xce, 0x0f, 0x99, 0x59, 0xc2, 0xa3, 0x78, 0xc4, 0x1d, 0x6f, 0x42, 0x36, 0x17, 0x8b, 0x14, 0xb8, 0x91, 0x9d, 0xb1, 0xd0 } +, + /* Signature */ + 129, + { 0x00, 0x6d, 0x54, 0x7d, 0xa4, 0xed, 0xcb, 0x10, 0x33, 0x15, 0xcb, 0x8e, 0x4b, 0x66, 0x9b, 0xee, 0x96, 0xaa, 0x21, 0x56, 0x23, 0x5c, 0xa5, 0xc3, 0xe3, 0x1b, 0x24, 0xa1, 0x5a, 0x13, 0x92, 0xe4, 0x94, 0x04, 0x7f, 0xed, 0xcb, 0x70, 0x81, 0x90, 0x7c, 0x56, 0x17, 0xa8, 0xaa, 0x18, 0xd1, 0x01, 0xb0, 0x53, 0x2a, 0x36, 0x32, 0x45, 0x19, 0x23, 0xc4, 0x8a, 0x75, 0xb0, 0xec, 0x21, 0x76, 0xcb, 0x98, 0xe5, 0xce, 0x51, 0x58, 0x8b, 0xcf, 0x86, 0x8e, 0x29, 0xd5, 0xd9, 0x69, 0x4f, 0x00, 0xae, 0x2c, 0x92, 0x4e, 0x73, 0xd2, 0xe6, 0xdd, 0x14, 0x4d, 0x24, 0xfa, 0x45, 0xd0, 0x12, 0x06, 0xa3, 0xf5, 0xd9, 0x36, 0x41, 0x3c, 0xcb, 0xb7, 0x4b, 0x0e, 0x2d, 0x04, 0x7d, 0x82, 0xb6, 0x00, 0xb8, 0x9d, 0x51, 0x59, 0x4f, 0xce, 0x7d, 0xe6, 0xbb, 0xd9, 0x5b, 0x97, 0xfc, 0xfe, 0xc5, 0x98, 0xc4, 0xeb } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.3", + /* Message to be signed */ + 37, + { 0x7f, 0x83, 0xb3, 0xe0, 0x54, 0xc0, 0x24, 0x82, 0x50, 0x78, 0xdd, 0x9f, 0x04, 0x0e, 0x1d, 0x09, 0x05, 0x82, 0x00, 0xc9, 0x75, 0x7b, 0x76, 0xfb, 0x37, 0x2b, 0x8b, 0x52, 0x66, 0xb9, 0xdc, 0x26, 0x9e, 0xc7, 0x56, 0x9d, 0x00 } +, + /* Signature */ + 129, + { 0x01, 0x34, 0xee, 0x21, 0x51, 0x51, 0xe5, 0x32, 0x50, 0xf5, 0xa0, 0x01, 0x6a, 0xcc, 0xe3, 0x70, 0x1e, 0x2a, 0x58, 0xdd, 0xaa, 0xd6, 0xcc, 0x36, 0x9d, 0xf0, 0xdc, 0xd9, 0x34, 0x6a, 0x2b, 0x53, 0x0f, 0xe3, 0x71, 0x5a, 0xfe, 0xff, 0x1e, 0x9b, 0xcb, 0x72, 0x08, 0x31, 0xc1, 0x25, 0x58, 0x97, 0x0a, 0x9e, 0x03, 0x89, 0x60, 0x04, 0xf2, 0x87, 0xad, 0xb8, 0x21, 0xf3, 0x17, 0xcf, 0x63, 0x93, 0x00, 0xca, 0xe6, 0xe9, 0x09, 0xe9, 0x1e, 0xd2, 0xa3, 0xea, 0xcb, 0x99, 0x52, 0xa7, 0xcc, 0x54, 0x94, 0x76, 0x52, 0x64, 0x24, 0x79, 0x51, 0xd2, 0x8c, 0x16, 0xaf, 0x03, 0xe2, 0x4b, 0x80, 0xee, 0x32, 0xb0, 0xb6, 0x2e, 0xdf, 0x10, 0xd7, 0x00, 0x91, 0x92, 0x71, 0x35, 0xf0, 0x5a, 0x88, 0x9f, 0x2f, 0x60, 0x56, 0xb9, 0x5c, 0xdd, 0xac, 0xe4, 0x7c, 0x69, 0xf9, 0x73, 0x08, 0xc0, 0xdf, 0x2e, 0xba } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.4", + /* Message to be signed */ + 198, + { 0x17, 0xeb, 0xc1, 0x50, 0x07, 0xbb, 0x5e, 0x4a, 0xf9, 0x17, 0x20, 0x1c, 0x3b, 0xa3, 0x84, 0x92, 0x65, 0x89, 0xc3, 0x15, 0x9a, 0x89, 0xd1, 0xab, 0xd4, 0xc2, 0xc9, 0x86, 0xfb, 0xa0, 0x37, 0x9e, 0x8a, 0xf1, 0x29, 0x75, 0xc5, 0xd0, 0x31, 0xd1, 0xbf, 0xc1, 0x5c, 0xa9, 0x17, 0x36, 0xf0, 0x7b, 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, 0x8a, 0xaa, 0x1c, 0xa4, 0xf5, 0x1e, 0xba, 0xbf, 0xfa, 0x77, 0xd9, 0x98, 0x03, 0xe7, 0xee, 0x8d, 0x20, 0xd1, 0x20, 0x4a, 0xad, 0x8c, 0x67, 0x38, 0x5d, 0x07, 0x44, 0xc8, 0x54, 0xde, 0x2f, 0x99, 0x7a, 0x56, 0xaa, 0xae, 0x04, 0xce, 0xcc, 0x65, 0x65, 0x35, 0xc1, 0x6b, 0xb2, 0x14, 0x5d, 0x18, 0x01, 0x81, 0x25, 0x94, 0xa8, 0x01, 0x3b, 0x0e, 0xb5, 0x4e, 0x7b, 0xf6, 0x5d, 0x38, 0x42, 0x00, 0x54, 0xec, 0x46, 0xda, 0xc7, 0x1a, 0x12, 0x52, 0x08, 0xb3, 0x02, 0x21, 0x4a, 0x7c, 0x9b, 0x3a, 0x92, 0xca, 0x9b, 0xf7, 0x37, 0x39, 0xc7, 0x66, 0x30, 0x9a, 0xf8, 0x03, 0xed, 0xde, 0x7c, 0x54, 0xd2, 0x46 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.5", + /* Message to be signed */ + 51, + { 0x6a, 0x52, 0xba, 0x19, 0x0e, 0x44, 0xca, 0x0f, 0x10, 0x70, 0x02, 0x10, 0x48, 0x76, 0x2f, 0x3e, 0x79, 0xed, 0x51, 0xc9, 0x4f, 0x6d, 0xc1, 0xa9, 0xf1, 0xed, 0x78, 0x35, 0x2e, 0xf3, 0x79, 0xaa, 0x49, 0xb3, 0xa9, 0x38, 0x7e, 0x3c, 0xa7, 0xa1, 0x96, 0xf1, 0x05, 0xdc, 0xab, 0x18, 0x50, 0x6f, 0x29, 0x4a, 0x69 } +, + /* Signature */ + 129, + { 0x00, 0x0b, 0x70, 0xe6, 0x01, 0xc5, 0xec, 0x58, 0x68, 0x4e, 0x09, 0x18, 0xba, 0x7a, 0x53, 0x9e, 0x9d, 0x2d, 0xd2, 0x9b, 0x01, 0xa3, 0xf4, 0x53, 0xca, 0xd4, 0xa9, 0xa4, 0x0e, 0x50, 0xf5, 0xdb, 0xdf, 0x72, 0xc1, 0x10, 0x52, 0xf2, 0x0b, 0xe4, 0x4a, 0x5d, 0x38, 0x51, 0xb0, 0x1f, 0xd0, 0x9d, 0x9c, 0x92, 0x08, 0x47, 0x0f, 0x0a, 0x4a, 0x95, 0x03, 0x5e, 0x98, 0x9e, 0xed, 0x7d, 0x6b, 0x06, 0x2e, 0x13, 0xf4, 0x99, 0x5b, 0xf0, 0x93, 0x0b, 0x4a, 0x3d, 0x9b, 0x8a, 0x9e, 0xd7, 0x5e, 0x33, 0x88, 0x6e, 0x4b, 0x19, 0x4a, 0xb5, 0xcc, 0xd6, 0xb4, 0x12, 0x95, 0x9c, 0xb4, 0xf5, 0x49, 0x8b, 0xd3, 0x2f, 0x66, 0x85, 0x46, 0xbe, 0x2c, 0x00, 0x7a, 0xe8, 0xde, 0x5d, 0x98, 0x97, 0x7b, 0x94, 0xb1, 0x7e, 0x12, 0x63, 0x88, 0x4b, 0x54, 0xe7, 0x84, 0xb3, 0x8f, 0xc1, 0x12, 0xb8, 0xcb, 0xdd, 0x56 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.6", + /* Message to be signed */ + 236, + { 0xbb, 0xe0, 0xb9, 0xde, 0x2b, 0x5e, 0x9d, 0xcd, 0x31, 0x67, 0x42, 0x94, 0x3f, 0x92, 0x19, 0xb2, 0x4f, 0x66, 0xa3, 0x8f, 0x9d, 0xe7, 0x09, 0x46, 0x4f, 0xa5, 0x49, 0x5d, 0x79, 0x4a, 0x63, 0x7b, 0x9e, 0xbc, 0x06, 0x77, 0x62, 0xda, 0x7a, 0x6e, 0xef, 0xf0, 0x98, 0xfa, 0x44, 0xf3, 0xcc, 0x36, 0xf2, 0xcc, 0xef, 0x67, 0xfd, 0x46, 0xc5, 0x9e, 0x24, 0x73, 0x8c, 0x81, 0x0c, 0x69, 0xed, 0xdc, 0xd9, 0x0c, 0xc7, 0xd7, 0x1a, 0x4c, 0x3e, 0x69, 0x3b, 0xca, 0xa2, 0x8a, 0x53, 0x3d, 0x90, 0x4b, 0x41, 0xce, 0xd3, 0x39, 0x9b, 0x4c, 0x76, 0x47, 0xe5, 0xec, 0x4b, 0x3a, 0xd9, 0x03, 0x87, 0x0f, 0x5b, 0x5f, 0x8d, 0x6a, 0x8d, 0x81, 0x28, 0xae, 0x23, 0x81, 0xce, 0xc8, 0x6c, 0x4d, 0x85, 0xb7, 0x8a, 0x45, 0x1e, 0x1e, 0xa9, 0x7e, 0x33, 0x93, 0xff, 0xe9, 0x97, 0xe5, 0x46, 0xb0, 0x9c, 0x8c, 0xf8, 0x22, 0x52, 0xb3, 0x3f, 0x74, 0x5f, 0xee, 0xd4, 0x13, 0x32, 0x06, 0x51, 0x8e, 0x2b, 0x88, 0x03, 0x19, 0xdc, 0xdf, 0x91, 0x06, 0x71, 0x8a, 0xfb, 0x01, 0x6c, 0x51, 0x4b, 0x38, 0x05, 0x32, 0x65, 0xbc, 0x98, 0x79, 0x10, 0x0e, 0x47, 0xb0, 0x3e, 0xba, 0x03, 0x68, 0xf0, 0x9e, 0x29, 0x23, 0xac, 0x6f, 0x40, 0xa0, 0x4b, 0x75, 0x05, 0x4c, 0xd5, 0x05, 0xbb, 0xc8, 0x96, 0x5d, 0x64, 0x9a, 0x1b, 0xae, 0x7b, 0xb6, 0x64, 0x3c, 0xb7, 0x41, 0x95, 0xe9, 0x1c, 0x51, 0xf4, 0x18, 0x3d, 0xb2, 0xd7, 0x38, 0xce, 0x60, 0x35, 0x50, 0xd6, 0x34, 0xe6, 0xdd, 0x4f, 0x27, 0xf4, 0xda, 0xac, 0x61, 0x56, 0xcf, 0xa7, 0xe2, 0x46, 0x8b, 0x5d, 0x6a, 0xeb, 0x78, 0x29, 0x09 } +, + /* Signature */ + 129, + { 0x00, 0xc2, 0xe0, 0x74, 0xdf, 0xbc, 0xd0, 0xe7, 0x3a, 0xc0, 0x02, 0x1a, 0xeb, 0x99, 0x33, 0x10, 0x6b, 0x20, 0x1b, 0x93, 0xc1, 0x7a, 0x7b, 0xf9, 0x33, 0x56, 0xd2, 0x91, 0xfb, 0x4a, 0xae, 0xb3, 0xd1, 0x31, 0x63, 0x00, 0xa8, 0xde, 0x7b, 0x07, 0xe3, 0xd7, 0x79, 0xbc, 0xc2, 0x99, 0xe5, 0x2b, 0x6c, 0xb0, 0x30, 0x88, 0x01, 0x6d, 0xae, 0xb8, 0x41, 0x38, 0x2e, 0xb3, 0x43, 0x5f, 0x2e, 0x03, 0xeb, 0xf2, 0x2d, 0xc0, 0x86, 0xfb, 0x20, 0xeb, 0xe5, 0x3a, 0xc5, 0x45, 0x90, 0x24, 0x97, 0x63, 0xa2, 0x65, 0x5a, 0xa7, 0xeb, 0x0e, 0x7d, 0x38, 0x64, 0x93, 0x6b, 0x34, 0x00, 0x6a, 0x6c, 0x4f, 0xa0, 0x2d, 0x9c, 0xa1, 0x04, 0xad, 0xad, 0xa6, 0xaa, 0x01, 0xb9, 0x77, 0xb6, 0xde, 0xf2, 0x75, 0x06, 0x08, 0xa7, 0x8f, 0x3e, 0xd8, 0x3a, 0xd7, 0x12, 0xa7, 0xa1, 0xb0, 0xfb, 0xde, 0x7c, 0x7c, 0x8d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.7", + /* Message to be signed */ + 64, + { 0x83, 0xa4, 0x8b, 0xff, 0x88, 0x6d, 0x1d, 0x68, 0xf2, 0x92, 0x0a, 0x0e, 0xcf, 0xf2, 0x98, 0x32, 0x1a, 0x96, 0xf5, 0xca, 0xdc, 0xdf, 0xd8, 0xbe, 0x16, 0xb5, 0x0d, 0x34, 0xd6, 0x7d, 0x94, 0xcd, 0xb1, 0xa1, 0xbf, 0xa0, 0xea, 0xe2, 0x46, 0x99, 0xb6, 0x63, 0xc7, 0xba, 0x3a, 0x08, 0xa3, 0x90, 0xf7, 0x22, 0x58, 0x84, 0x85, 0x67, 0x94, 0xd1, 0x80, 0xc5, 0x46, 0xca, 0xc0, 0x6e, 0x41, 0x18 } +, + /* Signature */ + 129, + { 0x01, 0x2e, 0x81, 0xbd, 0x38, 0x63, 0x50, 0x65, 0xbf, 0x65, 0x54, 0x33, 0x6b, 0x00, 0xd1, 0x06, 0x18, 0x33, 0x05, 0x53, 0xe0, 0xe8, 0x08, 0x78, 0xaa, 0xd3, 0x55, 0xf0, 0x0d, 0x59, 0x40, 0xd8, 0xba, 0x45, 0x01, 0xc5, 0xc4, 0x9f, 0x10, 0x16, 0xd5, 0xf0, 0xe6, 0xa7, 0x3a, 0x4d, 0x9f, 0x87, 0x40, 0xd2, 0xcf, 0xc2, 0x5e, 0xa2, 0x48, 0xdf, 0x3f, 0x7b, 0x1a, 0xe8, 0xfc, 0xd2, 0x6b, 0xd5, 0x62, 0xe0, 0xf6, 0xeb, 0x77, 0x7f, 0x46, 0xd7, 0x57, 0x30, 0x69, 0xdb, 0x89, 0x07, 0xc0, 0x21, 0xb6, 0x45, 0xd3, 0xb2, 0x40, 0x58, 0x47, 0x51, 0x99, 0xa9, 0x1b, 0x55, 0x72, 0xd8, 0xac, 0x87, 0xf8, 0x3e, 0xe6, 0xaf, 0x5c, 0xf9, 0xe1, 0x71, 0xa8, 0x58, 0xf6, 0x0d, 0x2b, 0x81, 0x40, 0xf5, 0x2d, 0xae, 0xd6, 0x84, 0x42, 0x22, 0x8b, 0x4f, 0xff, 0xd8, 0xde, 0x40, 0x07, 0x8d, 0x3d, 0xe8, 0xcb } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.8", + /* Message to be signed */ + 1, + { 0x18 } +, + /* Signature */ + 129, + { 0x00, 0xf2, 0xc2, 0x99, 0x02, 0x4a, 0xb7, 0xbd, 0x25, 0x2c, 0x69, 0x46, 0xbe, 0xa1, 0x0d, 0xc0, 0x53, 0x97, 0x38, 0x98, 0xbd, 0x5f, 0x0e, 0x3c, 0x94, 0x60, 0xe6, 0xfe, 0x09, 0xd7, 0xd1, 0x91, 0xe7, 0x1b, 0xf7, 0x9d, 0x43, 0x6c, 0xaa, 0x84, 0xe9, 0x86, 0xbe, 0x3f, 0xc0, 0x98, 0x19, 0xc0, 0x80, 0xe5, 0x6a, 0x08, 0x5c, 0xf4, 0x24, 0x41, 0x4a, 0xf3, 0xfc, 0x70, 0x07, 0xcf, 0x1a, 0xc3, 0x6f, 0x1c, 0xf8, 0x63, 0x57, 0x80, 0xb5, 0x56, 0x8d, 0x73, 0x4a, 0xd6, 0xd8, 0x1a, 0x2b, 0xa8, 0xeb, 0x18, 0x8b, 0x29, 0x46, 0x69, 0xd8, 0x71, 0xca, 0x40, 0xe6, 0x08, 0xf0, 0xed, 0x33, 0xd5, 0x69, 0x0c, 0xc6, 0x15, 0x70, 0xc5, 0xb8, 0x47, 0xeb, 0xdb, 0xdc, 0xdc, 0x4f, 0xa7, 0x8f, 0x42, 0x9e, 0xfc, 0xe1, 0x3c, 0x67, 0x47, 0xe5, 0x4d, 0x6f, 0x26, 0x1b, 0x04, 0x55, 0xd6, 0xdd, 0x65, 0xc2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.9", + /* Message to be signed */ + 40, + { 0x04, 0xa6, 0xe2, 0x4b, 0x93, 0xc2, 0xe5, 0xf6, 0xb4, 0xbb, 0xe0, 0x5f, 0x5f, 0xb0, 0xaf, 0xa0, 0x42, 0xd2, 0x04, 0xfe, 0x33, 0x78, 0xd3, 0x65, 0xc2, 0xf2, 0x88, 0xb6, 0xa8, 0xda, 0xd7, 0xef, 0xe4, 0x5d, 0x15, 0x3e, 0xef, 0x40, 0xca, 0xcc } +, + /* Signature */ + 129, + { 0x00, 0xec, 0xc8, 0x95, 0xfb, 0xd9, 0x47, 0xe2, 0xdf, 0xc4, 0x7c, 0x03, 0xba, 0x2e, 0x99, 0x3d, 0x1a, 0x14, 0x3a, 0x7a, 0x6a, 0xd6, 0x3a, 0x91, 0x6e, 0xd5, 0x44, 0x83, 0xce, 0x26, 0x38, 0x9f, 0x89, 0xd5, 0x80, 0xf4, 0xed, 0xbd, 0xd0, 0xb3, 0x7e, 0x08, 0xca, 0xaa, 0x5a, 0x0c, 0x1e, 0x52, 0x6e, 0x1e, 0x9a, 0x1a, 0x8c, 0x0d, 0xc9, 0xcf, 0x50, 0xed, 0x77, 0xde, 0x26, 0x76, 0x46, 0x0d, 0x28, 0x8d, 0xce, 0x56, 0x5f, 0x12, 0x8a, 0x26, 0x6e, 0xa2, 0x9b, 0x4e, 0xcc, 0x32, 0x9a, 0x94, 0xcc, 0x25, 0x23, 0x96, 0xdc, 0x50, 0xd5, 0xc0, 0xa1, 0x3d, 0x80, 0x93, 0x81, 0xfa, 0xd8, 0x8a, 0x07, 0x89, 0xad, 0x4f, 0x56, 0xaa, 0x77, 0xe5, 0x44, 0xec, 0x25, 0x70, 0xaf, 0x99, 0x18, 0xb7, 0xf7, 0x41, 0xb4, 0x86, 0xca, 0x50, 0xb3, 0x38, 0x4a, 0xd1, 0x12, 0x40, 0x60, 0x59, 0x16, 0x85, 0xa1 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.10", + /* Message to be signed */ + 229, + { 0x99, 0x65, 0xbd, 0xa5, 0x5c, 0xbf, 0x0e, 0xfe, 0xd8, 0xd6, 0x55, 0x3b, 0x40, 0x27, 0xf2, 0xd8, 0x62, 0x08, 0xa6, 0xe6, 0xb4, 0x89, 0xc1, 0x76, 0x12, 0x80, 0x92, 0xd6, 0x29, 0xe4, 0x9d, 0x16, 0x9f, 0x16, 0xfe, 0x51, 0xc4, 0xc0, 0x8a, 0x64, 0x94, 0xb5, 0x00, 0x73, 0x62, 0x20, 0x91, 0xa3, 0x82, 0x2e, 0xa5, 0x7c, 0x32, 0x8b, 0xd9, 0xb6, 0x9d, 0x24, 0x65, 0xa2, 0x12, 0x2a, 0xf1, 0x78, 0xbf, 0x6b, 0x1b, 0xe3, 0x07, 0xee, 0x4c, 0x31, 0x47, 0x9f, 0xfd, 0x9f, 0x4d, 0x11, 0xf3, 0x3e, 0xa2, 0x0b, 0x7a, 0xec, 0xe8, 0x12, 0xca, 0xb4, 0xee, 0xdd, 0x46, 0x99, 0x31, 0x51, 0xd5, 0x68, 0xff, 0x64, 0xa1, 0x67, 0x04, 0xa5, 0x5d, 0x95, 0x0a, 0xb7, 0x79, 0x1a, 0xa2, 0x3b, 0x26, 0xa0, 0xa8, 0xaf, 0x88, 0x0f, 0x6f, 0x80, 0x56, 0xbd, 0xd2, 0x06, 0x83, 0x8b, 0x44, 0xc6, 0x07, 0xb6, 0x61, 0xb4, 0xf1, 0xdc, 0x36, 0x21, 0x06, 0x5f, 0xde, 0xd3, 0xdb, 0x6f, 0x9e, 0x3f, 0x2d, 0xc8, 0xf4, 0x00, 0xef, 0xe3, 0xc2, 0xaf, 0xa6, 0xc0, 0x27, 0x99, 0x40, 0x57, 0x6b, 0xb0, 0x5e, 0x39, 0x80, 0x4b, 0xd3, 0x50, 0x5f, 0x4b, 0xd2, 0x82, 0x52, 0x91, 0x8b, 0x28, 0xe7, 0x4e, 0x05, 0x8f, 0x24, 0xf2, 0x7e, 0xf0, 0xdb, 0x3d, 0x0d, 0xcf, 0x9e, 0xb2, 0x9d, 0x41, 0xff, 0xc1, 0x10, 0x07, 0xce, 0x86, 0xb9, 0x82, 0xe8, 0x9c, 0x03, 0x75, 0xbd, 0x99, 0x76, 0xa5, 0xaf, 0x13, 0x1a, 0x61, 0x4d, 0x28, 0x08, 0xba, 0x25, 0x07, 0x9d, 0x97, 0x7f, 0x0b, 0x23, 0x97, 0x96, 0xba, 0x6b, 0x1b, 0xcd, 0x5e, 0x85, 0x5d, 0x96 } +, + /* Signature */ + 129, + { 0x01, 0x56, 0x62, 0xe3, 0x0e, 0x79, 0x0e, 0x37, 0x86, 0x83, 0x81, 0xb4, 0xf6, 0x77, 0xa2, 0xae, 0xd6, 0xb2, 0xac, 0xc5, 0x64, 0x49, 0x17, 0x31, 0x82, 0x49, 0x10, 0xed, 0x80, 0xad, 0xc4, 0x77, 0x15, 0x9c, 0x88, 0x61, 0x8c, 0xc7, 0xd0, 0xbe, 0xb0, 0x49, 0xb1, 0xaa, 0xe7, 0x4b, 0x17, 0x21, 0xe9, 0x0b, 0xa7, 0xf7, 0xb0, 0xea, 0x26, 0xbf, 0x33, 0xad, 0x04, 0xf8, 0x6f, 0xf3, 0x14, 0x38, 0x97, 0xbf, 0x0d, 0x4e, 0xb4, 0x5e, 0xb7, 0xde, 0xb5, 0x44, 0x11, 0xba, 0x96, 0x80, 0xaa, 0xb1, 0x3a, 0xdb, 0xfc, 0xf1, 0x8a, 0xf4, 0x6b, 0x87, 0xfc, 0xb1, 0x46, 0x1c, 0x26, 0x20, 0x6a, 0x95, 0x3b, 0xc3, 0xcd, 0xbb, 0x31, 0xe2, 0x96, 0xea, 0x09, 0x02, 0x4b, 0xc5, 0xc7, 0xb6, 0x2d, 0xe6, 0xc6, 0x9c, 0x14, 0xbf, 0xcf, 0xeb, 0x56, 0x39, 0x1a, 0x9e, 0xf5, 0x8c, 0xd8, 0x05, 0xeb, 0x63, 0x1f } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.11", + /* Message to be signed */ + 186, + { 0x71, 0xc7, 0xb1, 0x8b, 0x4a, 0xa8, 0xea, 0x53, 0x89, 0xad, 0x78, 0x49, 0x23, 0x28, 0x65, 0xbe, 0x2a, 0x93, 0xe3, 0x47, 0xa1, 0x68, 0xd2, 0x5c, 0x6c, 0x6e, 0xa2, 0x43, 0x9c, 0x1c, 0xc8, 0x0b, 0xb0, 0xb7, 0x22, 0x3b, 0xe9, 0xc8, 0x93, 0x71, 0x22, 0x84, 0x5b, 0xb0, 0xa3, 0x9c, 0x02, 0x5c, 0x43, 0x75, 0x9d, 0xef, 0xe6, 0xe4, 0xe8, 0xeb, 0x3b, 0xaa, 0xb4, 0xf1, 0xeb, 0xdc, 0xa2, 0xc8, 0xad, 0x12, 0xa4, 0x65, 0xa3, 0x0f, 0x8a, 0x65, 0x25, 0xb1, 0x20, 0xef, 0x6a, 0xae, 0xc9, 0xbd, 0xdb, 0x45, 0xcd, 0x42, 0xc0, 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x0b, 0xa6, 0x70, 0x71, 0x7c, 0x0c, 0xf6, 0xfd, 0x48, 0x5b, 0xe2, 0xfe, 0x9e, 0x16, 0x81, 0x3b, 0xe8, 0xcd, 0xd5, 0x80, 0xe6, 0x10, 0x86, 0x67, 0x5e, 0x31, 0x83, 0x1c, 0x92, 0x4a, 0x41, 0xd4, 0x67, 0x1a, 0x95, 0xd8, 0x35, 0xe3, 0xfc, 0xa4, 0x95, 0xe8, 0x86, 0x58, 0xd1, 0xe5, 0x70, 0xe6, 0x28, 0xc7 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.12", + /* Message to be signed */ + 111, + { 0x0b, 0xeb, 0x19, 0xb5, 0x62, 0x92, 0x8c, 0x27, 0x1b, 0xb7, 0x06, 0x18, 0x9e, 0x43, 0xcf, 0xa5, 0x7b, 0xe7, 0x6b, 0x2f, 0x7a, 0x83, 0xe0, 0x2a, 0xa2, 0xcc, 0xb0, 0x37, 0xc0, 0xf4, 0xf7, 0xf7, 0x31, 0x62, 0xd6, 0xc2, 0x6f, 0x70, 0xde, 0x97, 0x18, 0x21, 0xe7, 0xb9, 0x66, 0x5c, 0xb9, 0x31, 0xbb, 0x0e, 0xac, 0x82, 0x0b, 0xf8, 0x59, 0x98, 0x4d, 0xb4, 0xbe, 0xef, 0xef, 0x4a, 0xb8, 0x8e, 0x91, 0x63, 0x1c, 0x0c, 0xd3, 0x1d, 0xb7, 0xf9, 0x35, 0x8a, 0x5a, 0xa1, 0xdf, 0xf2, 0x40, 0x6b, 0x45, 0xf9, 0xbd, 0xcb, 0xef, 0x20, 0xd5, 0x5c, 0x28, 0x2b, 0xae, 0x5c, 0xfb, 0x61, 0x06, 0x02, 0x3b, 0x56, 0x33, 0xc0, 0x51, 0xaf, 0x17, 0xe7, 0x29, 0xbb, 0x07, 0xc9, 0xaf, 0x6d, 0xd2 } +, + /* Signature */ + 129, + { 0x00, 0xd6, 0x3d, 0xa4, 0xd5, 0xd3, 0xe2, 0x28, 0x4a, 0x19, 0x2a, 0x6a, 0x9d, 0xa3, 0xf1, 0xa7, 0xd3, 0xfc, 0xc1, 0x64, 0xb9, 0xfc, 0x3d, 0xfd, 0x74, 0x52, 0xb0, 0x2f, 0xed, 0x6e, 0xf1, 0xbe, 0x5a, 0xd2, 0xa7, 0x69, 0xec, 0x9c, 0x36, 0x05, 0x9b, 0x71, 0x91, 0x1c, 0xcf, 0x7a, 0xb7, 0x1c, 0xe3, 0x09, 0x87, 0xec, 0x47, 0xbb, 0xf5, 0x5e, 0x6d, 0x46, 0x30, 0xd6, 0x23, 0x42, 0xb3, 0x15, 0x50, 0x48, 0xee, 0x0b, 0xf4, 0x3d, 0x24, 0xfe, 0x69, 0xab, 0xda, 0xc1, 0x2f, 0x79, 0x4b, 0x67, 0x98, 0xbd, 0x1a, 0x7c, 0xb4, 0x89, 0xa6, 0x4c, 0xe0, 0x82, 0x25, 0x4c, 0x3d, 0x92, 0xf4, 0x75, 0x56, 0x6b, 0x56, 0x40, 0x0d, 0x96, 0x20, 0xcd, 0xfd, 0x63, 0xfc, 0x17, 0xc1, 0x93, 0xc4, 0x25, 0xd7, 0xed, 0xe9, 0x41, 0xf7, 0x6d, 0xa1, 0xe3, 0x45, 0xaf, 0x0e, 0x2a, 0x8b, 0x88, 0x44, 0xc7, 0x40 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.13", + /* Message to be signed */ + 12, + { 0x02, 0x87, 0xab, 0xe2, 0x67, 0x0a, 0x45, 0xf8, 0x77, 0x90, 0x48, 0xf5 } +, + /* Signature */ + 129, + { 0x00, 0x42, 0xf4, 0x14, 0x78, 0x2d, 0xf6, 0x5d, 0x93, 0x47, 0xbf, 0x1c, 0xad, 0x53, 0x48, 0x53, 0x74, 0x6c, 0xc0, 0xb8, 0x53, 0xc1, 0xc5, 0x26, 0xf9, 0x17, 0x14, 0x45, 0xfc, 0xfa, 0xa4, 0x99, 0x1a, 0x70, 0xf5, 0xa8, 0x44, 0x5b, 0xcf, 0x41, 0x14, 0xf0, 0x7f, 0xc8, 0x35, 0x4c, 0x84, 0xa9, 0x3b, 0x94, 0x37, 0x33, 0xd3, 0x93, 0x7a, 0x59, 0x88, 0x3b, 0x89, 0x6c, 0xe6, 0x5f, 0xdb, 0x16, 0x5b, 0x1e, 0x30, 0x55, 0x37, 0x4c, 0xe2, 0x42, 0xe1, 0x26, 0x8c, 0x16, 0x41, 0xcc, 0x44, 0x3b, 0xb9, 0xe7, 0xda, 0x7f, 0x71, 0xf3, 0xe7, 0xf6, 0x31, 0x3f, 0x23, 0x9e, 0x62, 0x00, 0xe7, 0x9a, 0x1b, 0xe3, 0xea, 0xd6, 0xc3, 0x6e, 0x94, 0x1f, 0x24, 0x46, 0x0b, 0xaa, 0x57, 0xdf, 0x63, 0x9e, 0x57, 0xda, 0xb3, 0xef, 0xf9, 0xe7, 0x7b, 0x87, 0xaf, 0x35, 0x5b, 0x83, 0xda, 0xe7, 0x7c, 0xbe, 0x06 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.14", + /* Message to be signed */ + 91, + { 0x3f, 0x49, 0x54, 0x2c, 0x0e, 0x9f, 0x50, 0x93, 0x2c, 0x0d, 0x45, 0x3d, 0xc9, 0x53, 0x20, 0xaf, 0x21, 0xdd, 0x2b, 0xd1, 0x72, 0x9c, 0x29, 0xf4, 0xf0, 0x8c, 0x70, 0x94, 0x4c, 0x2c, 0xc7, 0x5d, 0xe9, 0x16, 0x6b, 0x4f, 0xd2, 0x30, 0xaa, 0x93, 0x70, 0x2c, 0x5f, 0x2c, 0x3d, 0x9c, 0x29, 0x9a, 0x35, 0x91, 0x02, 0x57, 0x00, 0x33, 0x54, 0x0e, 0xb8, 0x28, 0xca, 0xd7, 0x5a, 0x57, 0x76, 0xd2, 0xe8, 0xcb, 0x45, 0x61, 0x41, 0xa6, 0xfa, 0x97, 0xbc, 0x4e, 0x6e, 0x62, 0xd3, 0xdf, 0x08, 0x29, 0x82, 0xa4, 0xd9, 0x8c, 0x2d, 0xe4, 0x41, 0xe5, 0x9e, 0x93, 0x12 } +, + /* Signature */ + 129, + { 0x01, 0x5c, 0x39, 0x93, 0xce, 0xeb, 0xd8, 0xdb, 0xa4, 0x5a, 0x36, 0x8d, 0xd4, 0x05, 0xaf, 0x8a, 0x53, 0xb9, 0x3e, 0x82, 0x70, 0x19, 0xf9, 0x94, 0xe4, 0xed, 0x78, 0x2c, 0x39, 0x11, 0xb9, 0xb5, 0x80, 0xd5, 0x42, 0x24, 0x26, 0x9b, 0x79, 0x97, 0xf1, 0x74, 0x96, 0x30, 0xe5, 0x2f, 0x22, 0x1f, 0xaf, 0xab, 0x96, 0x41, 0xc7, 0x81, 0xe7, 0x04, 0x4d, 0x32, 0x56, 0xe2, 0xe4, 0x4e, 0x14, 0x37, 0x91, 0x72, 0x32, 0x69, 0x45, 0x18, 0xba, 0x9e, 0x71, 0x38, 0xda, 0x47, 0xfe, 0x53, 0x43, 0x29, 0xb8, 0xc9, 0x68, 0x9e, 0x27, 0x85, 0xc0, 0x2b, 0x60, 0x3d, 0xd1, 0x60, 0xd3, 0x73, 0x36, 0xa2, 0xb0, 0x5b, 0xe0, 0x47, 0x82, 0x65, 0x9a, 0xc0, 0xe9, 0x67, 0x1f, 0xe9, 0x32, 0xea, 0x80, 0x91, 0xd6, 0x13, 0x18, 0xb2, 0xb2, 0x01, 0xbd, 0xa7, 0x9a, 0xf6, 0xc0, 0xc4, 0x44, 0x69, 0x38, 0xe3, 0xf6 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.15", + /* Message to be signed */ + 221, + { 0xd0, 0xdb, 0xc9, 0x6c, 0xf9, 0xbf, 0xb1, 0xe3, 0xcd, 0x6d, 0xe2, 0xea, 0xa0, 0x8d, 0x6d, 0x79, 0x5b, 0xed, 0x81, 0x87, 0xce, 0xb0, 0x85, 0x65, 0x80, 0xe4, 0xb1, 0x42, 0xb9, 0xae, 0x60, 0xa0, 0x98, 0xcd, 0x42, 0x98, 0x4e, 0x8d, 0xbf, 0x1d, 0x05, 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c, 0xc8, 0x2d, 0x64, 0x55, 0x9d, 0xe0, 0x04, 0x0f, 0x55, 0x41, 0x19, 0x9a, 0xef, 0xf3, 0x99, 0x9f, 0xe2, 0xf0, 0x86, 0xf1, 0x57, 0xff, 0x51, 0xf2, 0x22, 0x0d, 0xb3, 0x45, 0x51, 0x9a, 0xa1, 0x14, 0xb0, 0x17, 0x62, 0xe7, 0x0b, 0xc9, 0x65, 0x83, 0xbb, 0x38, 0xb2, 0x2b, 0x3f, 0x87, 0xbe, 0xab, 0x32, 0xe2, 0x3a, 0x3d, 0xeb, 0xdb, 0x8a, 0x59, 0x54, 0x29, 0xff, 0x12, 0xfa, 0xd4, 0x95, 0xd7, 0x4e, 0x22, 0x0e, 0x4f, 0x7d, 0xca, 0x22, 0x27, 0x28, 0x43, 0x89, 0x9e, 0x81, 0x04, 0xc6, 0x9a, 0x59, 0x64, 0x2f, 0x6f, 0xa8, 0x25, 0x89, 0x0f, 0xe8, 0x13, 0x2a, 0x0f, 0x79, 0x94, 0x02, 0x53, 0xe5, 0x00, 0x7f, 0xb1, 0x17, 0x7a, 0x5b, 0xf4, 0x18, 0x06, 0x7e, 0xdd, 0xc8, 0xd3, 0x2c, 0x5e, 0x59, 0x35, 0xbf, 0x33, 0x8f, 0x1c, 0x69, 0x0e, 0xfc, 0x80, 0x11, 0xdc, 0x8c, 0x84, 0x2e } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.16", + /* Message to be signed */ + 230, + { 0x7d, 0xf0, 0x23, 0x6e, 0x87, 0x1a, 0x71, 0xc3, 0x17, 0x90, 0xeb, 0x5f, 0x01, 0x1c, 0x91, 0x1c, 0x27, 0xc6, 0x03, 0x73, 0xb8, 0xdc, 0x9e, 0xbb, 0x13, 0xac, 0x85, 0xac, 0xcb, 0x3b, 0xcb, 0xd3, 0xb4, 0x74, 0xf9, 0x78, 0x86, 0x2d, 0xd8, 0x42, 0x02, 0xab, 0x20, 0xb3, 0x34, 0x73, 0x94, 0x25, 0xe1, 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, 0x45, 0x5e, 0x3b, 0xb2, 0x9c, 0xbc, 0xa8, 0x83, 0x9b, 0x9f, 0x54, 0x4d, 0x51, 0x47, 0x2e, 0xbc, 0xfd, 0x25, 0xc2, 0x92, 0x27, 0xc4, 0x65, 0x5d, 0x5f, 0x7e, 0xbb, 0xd8, 0x3c, 0x48, 0xe7, 0x64, 0x3e, 0x7b, 0x59, 0x4d, 0x6f, 0x7c, 0xd5, 0xf6, 0xbf, 0x9a, 0x40, 0xb0, 0x5c, 0x4a, 0x05, 0xcb, 0xee, 0x1f, 0xd6, 0x59, 0xd3, 0xce, 0xde, 0x3e, 0x7c, 0xad, 0x61, 0xe6, 0xfd, 0xf8, 0xf0, 0xe4, 0xfd, 0xef, 0x08, 0x12, 0xa8, 0x53, 0x90, 0x8f, 0x0f, 0x99, 0xca, 0x7e, 0x38, 0x8e, 0xbc, 0x19, 0xe8, 0x74, 0x76, 0x5b, 0x11, 0x64, 0x0f, 0x1e, 0xe1, 0xe9, 0x8f, 0x54, 0x95, 0x3d, 0xe6, 0x17, 0x6f, 0x15, 0x82, 0x03, 0x70, 0x17, 0xc8, 0x38, 0x60, 0x9a, 0x57, 0xa1, 0x2a, 0xcb, 0xaf, 0xa6, 0xa5, 0x65, 0x47, 0xf5, 0x7d, 0x62, 0xdb, 0xe8, 0x76, 0x69, 0xed, 0xc0, 0xfe, 0x3b, 0xaa, 0xda } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.17", + /* Message to be signed */ + 144, + { 0x12, 0x88, 0xc0, 0x3f, 0x95, 0x00, 0x6e, 0xa3, 0x2f, 0x56, 0x2d, 0x40, 0xd5, 0x2a, 0xf9, 0xfe, 0xb3, 0x2f, 0x0f, 0xa0, 0x6d, 0xb6, 0x5b, 0x58, 0x8a, 0x23, 0x7b, 0x34, 0xe5, 0x92, 0xd5, 0x5c, 0xf9, 0x79, 0xf9, 0x03, 0xa6, 0x42, 0xef, 0x64, 0xd2, 0xed, 0x54, 0x2a, 0xa8, 0xc7, 0x7d, 0xc1, 0xdd, 0x76, 0x2f, 0x45, 0xa5, 0x93, 0x03, 0xed, 0x75, 0xe5, 0x41, 0xca, 0x27, 0x1e, 0x2b, 0x60, 0xca, 0x70, 0x9e, 0x44, 0xfa, 0x06, 0x61, 0x13, 0x1e, 0x8d, 0x5d, 0x41, 0x63, 0xfd, 0x8d, 0x39, 0x85, 0x66, 0xce, 0x26, 0xde, 0x87, 0x30, 0xe7, 0x2f, 0x9c, 0xca, 0x73, 0x76, 0x41, 0xc2, 0x44, 0x15, 0x94, 0x20, 0x63, 0x70, 0x28, 0xdf, 0x0a, 0x18, 0x07, 0x9d, 0x62, 0x08, 0xea, 0x8b, 0x47, 0x11, 0xa2, 0xc7, 0x50, 0xf5, 0xc0, 0xa4, 0x25, 0x31, 0x3d, 0xf8, 0xd7, 0x56, 0x4b, 0xd2, 0x43, 0x4d, 0x31, 0x15, 0x23, 0xd5, 0x25, 0x7e, 0xed, 0x80, 0x6a, 0xc8, 0xc9, 0xc6, 0xaf, 0x04, 0xac } +, + /* Signature */ + 129, + { 0x00, 0x6b, 0xeb, 0xb9, 0x6f, 0x0e, 0x28, 0x2f, 0x1b, 0x4d, 0x03, 0xe6, 0xc5, 0x65, 0x05, 0xb9, 0x37, 0x78, 0xda, 0x9f, 0x49, 0x36, 0x50, 0xe8, 0xaa, 0xeb, 0x65, 0xcf, 0xe6, 0x28, 0x50, 0x04, 0x2f, 0x75, 0xab, 0xe6, 0xe6, 0xea, 0xfe, 0xb9, 0xa7, 0x0a, 0xbd, 0x21, 0xeb, 0x5d, 0xba, 0x73, 0xcb, 0xb8, 0x7c, 0x12, 0x98, 0x0a, 0xac, 0xdf, 0x16, 0x71, 0x6b, 0x19, 0x98, 0xc9, 0x49, 0x9c, 0xe4, 0x39, 0xc5, 0x4a, 0xab, 0x4d, 0x19, 0xce, 0x72, 0x7b, 0x78, 0x75, 0xa4, 0x1a, 0x3d, 0x30, 0x81, 0x4e, 0x50, 0x8d, 0xaa, 0x26, 0xeb, 0x70, 0xaa, 0xbb, 0xd0, 0xdc, 0xae, 0xcc, 0x4d, 0x4b, 0x51, 0x69, 0x80, 0x71, 0x51, 0x1e, 0xb3, 0x1b, 0x21, 0x0e, 0x66, 0xdc, 0xbc, 0x7f, 0xc0, 0xb8, 0xc6, 0x23, 0x14, 0xda, 0xea, 0x69, 0xd4, 0x7a, 0xe2, 0x78, 0x10, 0x0d, 0xeb, 0x51, 0x40, 0x92, 0x00 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.18", + /* Message to be signed */ + 10, + { 0x54, 0x13, 0x99, 0x3c, 0x26, 0x58, 0xbc, 0x1d, 0x98, 0x85 } +, + /* Signature */ + 129, + { 0x00, 0xbb, 0xeb, 0x2c, 0xa0, 0xbd, 0x64, 0xcb, 0x89, 0x60, 0x37, 0x5b, 0x08, 0xa9, 0x48, 0x0e, 0x69, 0xc0, 0x9f, 0xd3, 0x82, 0xde, 0xa2, 0xf9, 0x40, 0x89, 0xb1, 0x53, 0x3a, 0x08, 0x51, 0xfa, 0x0c, 0xbd, 0x0e, 0xad, 0xef, 0xca, 0x8c, 0x70, 0xb7, 0x70, 0x79, 0x7a, 0xd0, 0x89, 0xe8, 0x40, 0xd2, 0xfe, 0x1a, 0x8f, 0xb8, 0x54, 0x9f, 0x32, 0x90, 0x58, 0x3b, 0xbb, 0x81, 0xd3, 0xee, 0x2b, 0x1c, 0x48, 0xf1, 0xea, 0x75, 0x1b, 0xf3, 0x2f, 0x95, 0x90, 0xbe, 0x3a, 0xfd, 0xb7, 0x74, 0x5e, 0x16, 0x6e, 0x0b, 0x32, 0x2c, 0x08, 0x31, 0x24, 0xe6, 0x45, 0x83, 0x94, 0x82, 0xd0, 0x81, 0x26, 0x22, 0xd3, 0x1a, 0xb1, 0x87, 0x7a, 0x9b, 0xb4, 0x1b, 0x8d, 0xaa, 0xd8, 0x68, 0xf3, 0x0e, 0x75, 0x07, 0x83, 0x2a, 0xc3, 0x41, 0x01, 0x12, 0x13, 0x3a, 0xa1, 0x7b, 0x2d, 0x47, 0x6d, 0x47, 0x6d, 0x89 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.19", + /* Message to be signed */ + 232, + { 0x9c, 0x84, 0xc1, 0x48, 0x6b, 0xc1, 0x2b, 0x3f, 0xa6, 0xc5, 0x98, 0x71, 0xb6, 0x82, 0x7c, 0x8c, 0xe2, 0x53, 0xca, 0x5f, 0xef, 0xa8, 0xa8, 0xc6, 0x90, 0xbf, 0x32, 0x6e, 0x8e, 0x37, 0xcd, 0xb9, 0x6d, 0x90, 0xa8, 0x2e, 0xba, 0xb6, 0x9f, 0x86, 0x35, 0x0e, 0x18, 0x22, 0xe8, 0xbd, 0x53, 0x6a, 0x2e, 0xb3, 0x07, 0xc4, 0x3b, 0x48, 0x50, 0xa8, 0xda, 0xc2, 0xf1, 0x5f, 0x32, 0xe3, 0x78, 0x39, 0xef, 0x8c, 0x5c, 0x0e, 0x91, 0xdd, 0x0a, 0xfa, 0xd4, 0x2c, 0xcd, 0x4f, 0xc6, 0x06, 0x54, 0xa5, 0x50, 0x02, 0xd2, 0x28, 0xf5, 0x2a, 0x4a, 0x5f, 0xe0, 0x3b, 0x8b, 0xbb, 0x08, 0xca, 0x82, 0xda, 0xca, 0x55, 0x8b, 0x44, 0xdb, 0xe1, 0x26, 0x6e, 0x50, 0xc0, 0xe7, 0x45, 0xa3, 0x6d, 0x9d, 0x29, 0x04, 0xe3, 0x40, 0x8a, 0xbc, 0xd1, 0xfd, 0x56, 0x99, 0x94, 0x06, 0x3f, 0x4a, 0x75, 0xcc, 0x72, 0xf2, 0xfe, 0xe2, 0xa0, 0xcd, 0x89, 0x3a, 0x43, 0xaf, 0x1c, 0x5b, 0x8b, 0x48, 0x7d, 0xf0, 0xa7, 0x16, 0x10, 0x02, 0x4e, 0x4f, 0x6d, 0xdf, 0x9f, 0x28, 0xad, 0x08, 0x13, 0xc1, 0xaa, 0xb9, 0x1b, 0xcb, 0x3c, 0x90, 0x64, 0xd5, 0xff, 0x74, 0x2d, 0xef, 0xfe, 0xa6, 0x57, 0x09, 0x41, 0x39, 0x36, 0x9e, 0x5e, 0xa6, 0xf4, 0xa9, 0x63, 0x19, 0xa5, 0xcc, 0x82, 0x24, 0x14, 0x5b, 0x54, 0x50, 0x62, 0x75, 0x8f, 0xef, 0xd1, 0xfe, 0x34, 0x09, 0xae, 0x16, 0x92, 0x59, 0xc6, 0xcd, 0xfd, 0x6b, 0x5f, 0x29, 0x58, 0xe3, 0x14, 0xfa, 0xec, 0xbe, 0x69, 0xd2, 0xca, 0xce, 0x58, 0xee, 0x55, 0x17, 0x9a, 0xb9, 0xb3, 0xe6, 0xd1, 0xec, 0xc1, 0x4a, 0x55 } +, + /* Signature */ + 129, + { 0x00, 0xe6, 0xbe, 0x96, 0xe1, 0x8d, 0xce, 0xbf, 0x83, 0x88, 0xba, 0x82, 0xec, 0x6f, 0x27, 0x10, 0x5b, 0xc2, 0x78, 0x71, 0x59, 0x5e, 0x01, 0x70, 0x5a, 0x2b, 0x97, 0xa1, 0xf4, 0xd7, 0x88, 0x38, 0x35, 0x2b, 0x0e, 0x7c, 0x0a, 0x2c, 0x62, 0x7a, 0x6f, 0xf3, 0x7d, 0xb1, 0x69, 0xa9, 0xa4, 0x64, 0x8a, 0xd2, 0x7a, 0xf0, 0x65, 0x33, 0xa4, 0xf0, 0x41, 0xd4, 0xc8, 0x20, 0xab, 0xf4, 0xfb, 0x52, 0x64, 0x64, 0x08, 0x14, 0x34, 0xdf, 0x36, 0x78, 0x85, 0x03, 0xc6, 0x5a, 0xf7, 0x62, 0xaa, 0x21, 0x9f, 0xb7, 0x6a, 0x91, 0xcb, 0xb4, 0x0e, 0x14, 0x92, 0xa9, 0xcb, 0x77, 0x36, 0x9b, 0xb4, 0xcc, 0xa1, 0x93, 0x4e, 0x38, 0x53, 0xde, 0x6c, 0x86, 0xa5, 0xdc, 0x11, 0x48, 0xed, 0xee, 0xb3, 0xb0, 0x03, 0x04, 0x14, 0xfe, 0x30, 0x83, 0xad, 0x72, 0xfe, 0x29, 0x5c, 0x29, 0xb5, 0xea, 0x9b, 0x66, 0x60 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 7.20", + /* Message to be signed */ + 165, + { 0x94, 0x0c, 0xda, 0xb4, 0xa3, 0xe9, 0x20, 0x09, 0xcc, 0xd4, 0x2e, 0x1e, 0x94, 0x7b, 0x13, 0x14, 0xe3, 0x22, 0x38, 0xa2, 0xde, 0xce, 0x7d, 0x23, 0xa8, 0x9b, 0x5b, 0x30, 0xc7, 0x51, 0xfd, 0x0a, 0x4a, 0x43, 0x0d, 0x2c, 0x54, 0x85, 0x94, 0x9a, 0x2b, 0x00, 0x7e, 0x80, 0x97, 0x8b, 0xbb, 0x19, 0x2c, 0x35, 0x4e, 0xb7, 0xda, 0x9a, 0xed, 0xfc, 0x74, 0xdb, 0xf5, 0xf7, 0x1d, 0xfd, 0x43, 0xb4, 0x6c, 0x93, 0xdb, 0x82, 0x62, 0x9b, 0xda, 0xe2, 0xbd, 0x0a, 0x12, 0xb8, 0x82, 0xea, 0x04, 0xc3, 0xb4, 0x65, 0xf5, 0xcf, 0x93, 0x02, 0x3f, 0x01, 0x05, 0x96, 0x26, 0xdb, 0xbe, 0x99, 0xf2, 0x6b, 0xb1, 0xbe, 0x94, 0x9d, 0xdd, 0xd1, 0x6d, 0xc7, 0xf3, 0xde, 0xbb, 0x19, 0xa1, 0x94, 0x62, 0x7f, 0x0b, 0x22, 0x44, 0x34, 0xdf, 0x7d, 0x87, 0x00, 0xe9, 0xe9, 0x8b, 0x06, 0xe3, 0x60, 0xc1, 0x2f, 0xdb, 0xe3, 0xd1, 0x9f, 0x51, 0xc9, 0x68, 0x4e, 0xb9, 0x08, 0x9e, 0xcb, 0xb0, 0xa2, 0xf0, 0x45, 0x03, 0x99, 0xd3, 0xf5, 0x9e, 0xac, 0x72, 0x94, 0x08, 0x5d, 0x04, 0x4f, 0x53, 0x93, 0xc6, 0xce, 0x73, 0x74, 0x23, 0xd8, 0xb8 } +, + /* Signature */ + 129, + { 0x00, 0x80, 0xe2, 0xc3, 0x4f, 0xd4, 0xab, 0x4d, 0x1d, 0x70, 0x1e, 0xa3, 0xf0, 0x85, 0x76, 0x3a, 0xca, 0xff, 0xc9, 0xfd, 0x3e, 0xd9, 0x18, 0xd0, 0x4b, 0xff, 0xee, 0x19, 0x31, 0x62, 0x48, 0x98, 0xc7, 0x8f, 0x89, 0x41, 0xbd, 0x2a, 0x59, 0xce, 0xb5, 0xb8, 0x40, 0xf0, 0x11, 0x45, 0x16, 0xce, 0x41, 0x1f, 0xae, 0x75, 0x2b, 0x1b, 0x8a, 0x22, 0x1f, 0xfc, 0xa7, 0xa6, 0x87, 0x66, 0xc6, 0x97, 0xc5, 0x0a, 0x3d, 0x88, 0xd8, 0xd0, 0x2f, 0xfc, 0x12, 0x41, 0xd8, 0x4b, 0xb7, 0xa7, 0x22, 0x7f, 0x3d, 0x05, 0x14, 0x9e, 0x15, 0x11, 0x12, 0x77, 0xa1, 0x36, 0xa5, 0xb8, 0xdd, 0x96, 0xdd, 0x4b, 0x22, 0x5c, 0x5f, 0x49, 0xcd, 0xf6, 0x07, 0x1d, 0xbf, 0x71, 0x93, 0x5c, 0x7a, 0x6f, 0x1e, 0x2e, 0x9a, 0xf3, 0x02, 0x1c, 0x0d, 0x58, 0xa9, 0xb8, 0x1c, 0x9b, 0xde, 0x61, 0xfa, 0x47, 0x2c, 0x07, 0xa6 } + +} +, +} +}, +{ + "Example 8: A 1026-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x03, 0x33, 0x12, 0x64, 0x88, 0xf7, 0xa2, 0x91, 0x51, 0x32, 0xe3, 0x0d, 0x5e, 0x97, 0xf6, 0xed, 0x7b, 0xbb, 0x67, 0xb6, 0x19, 0x85, 0x00, 0x8e, 0xae, 0xa2, 0xa5, 0xda, 0xfb, 0x96, 0xa4, 0x48, 0xab, 0x75, 0xce, 0x3d, 0x6e, 0x68, 0xa6, 0x26, 0x5e, 0x7c, 0x24, 0x56, 0x84, 0x99, 0x93, 0x24, 0xc8, 0x1e, 0x0b, 0xa6, 0x38, 0x98, 0x63, 0xfe, 0xb4, 0x88, 0xb3, 0xf2, 0x55, 0xd0, 0xd6, 0x19, 0xc1, 0x90, 0x40, 0xb7, 0x4c, 0x18, 0x9f, 0x0c, 0x9a, 0xf4, 0xb0, 0xd5, 0xa5, 0x5a, 0x54, 0x4c, 0x09, 0x0c, 0xd6, 0x15, 0x2c, 0x90, 0xa6, 0xf2, 0x55, 0x0d, 0x7d, 0x2a, 0x6b, 0x6d, 0x34, 0x7d, 0x5b, 0x1b, 0x9d, 0xfb, 0x1d, 0xe4, 0x40, 0x3c, 0x79, 0x66, 0x23, 0xd7, 0x03, 0xbf, 0x9d, 0xb4, 0x43, 0xbf, 0x67, 0x02, 0x68, 0x3b, 0x8d, 0x2a, 0x9c, 0x61, 0xe9, 0x36, 0x8a, 0xc4, 0x25, 0xa5, 0x81 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 129, + { 0x01, 0x4a, 0x2b, 0x15, 0xdf, 0xa8, 0x83, 0x1d, 0xb4, 0xef, 0xa0, 0x5b, 0x19, 0x50, 0x84, 0xb7, 0x42, 0x73, 0x4e, 0xe1, 0x36, 0xf4, 0x48, 0x3f, 0x3b, 0xe2, 0x50, 0x9d, 0x2f, 0x61, 0x90, 0x23, 0xc3, 0x0a, 0x1f, 0xf2, 0xdf, 0x78, 0xcb, 0xd1, 0x17, 0xb1, 0x4f, 0x2c, 0x99, 0x13, 0x17, 0x1f, 0x72, 0x93, 0xb9, 0xfa, 0x6d, 0x41, 0xf0, 0xbd, 0x11, 0xa5, 0x31, 0x74, 0x74, 0x67, 0x54, 0x86, 0xd7, 0xf0, 0xae, 0xc0, 0xa7, 0x78, 0xba, 0x92, 0x0e, 0x81, 0xf5, 0x64, 0xd1, 0x59, 0x30, 0xcd, 0xde, 0xe7, 0xe2, 0xb0, 0x6a, 0xd8, 0xad, 0xb6, 0x12, 0x75, 0x1f, 0x4e, 0x38, 0x4d, 0x6f, 0x3f, 0xa0, 0xa6, 0x63, 0x9f, 0xd6, 0x2e, 0xdf, 0x86, 0xf5, 0x2c, 0x9f, 0xe0, 0x77, 0x62, 0x91, 0x83, 0x21, 0x83, 0xd3, 0x59, 0xb7, 0x34, 0x32, 0x60, 0xc9, 0x4e, 0x12, 0x5f, 0x4a, 0xb8, 0xbf, 0x43, 0x69 } +, + /* Prime 1 */ + 65, + { 0x01, 0xd6, 0xe7, 0xbd, 0x8e, 0x39, 0x5b, 0xbe, 0xf2, 0x10, 0x46, 0x49, 0xc0, 0x12, 0x78, 0xcc, 0x1c, 0x51, 0xc9, 0x68, 0x7d, 0xef, 0xb4, 0x59, 0x1f, 0x03, 0xb6, 0x78, 0x52, 0xa4, 0xbc, 0xb5, 0x30, 0x75, 0x0c, 0xf9, 0xbf, 0xca, 0xd0, 0x72, 0x8c, 0x53, 0x99, 0xd8, 0x70, 0x35, 0x01, 0x06, 0xcb, 0xa3, 0xec, 0x41, 0x6a, 0x31, 0xe4, 0x2d, 0x0b, 0x59, 0x75, 0x10, 0xff, 0x1c, 0x9d, 0x53, 0xbb } +, + /* Prime 2 */ + 65, + { 0x01, 0xbd, 0x46, 0x6f, 0x43, 0xa4, 0xd4, 0x61, 0x3e, 0x42, 0x64, 0xf0, 0x1b, 0x2d, 0xac, 0x2e, 0x5a, 0xa4, 0x20, 0x43, 0xf8, 0xfb, 0x5f, 0x69, 0xfa, 0x87, 0x1d, 0x14, 0xfb, 0x27, 0x3e, 0x76, 0x7a, 0x53, 0x1c, 0x40, 0xf0, 0x2f, 0x34, 0x3b, 0xc2, 0xfb, 0x45, 0xa0, 0xc7, 0xe0, 0xf6, 0xbe, 0x25, 0x61, 0x92, 0x3a, 0x77, 0x21, 0x1d, 0x66, 0xa6, 0xe2, 0xdb, 0xb4, 0x3c, 0x36, 0x63, 0x51, 0xf3 } +, + /* Prime exponent 1 */ + 64, + { 0xfb, 0x66, 0x85, 0x00, 0x65, 0x06, 0xe2, 0x0e, 0x01, 0x3a, 0x45, 0x2d, 0x51, 0xaf, 0x43, 0xe8, 0xea, 0x91, 0x08, 0x44, 0x13, 0xb0, 0xc8, 0xd3, 0x91, 0xfb, 0xdc, 0x88, 0xe2, 0x82, 0x0c, 0x89, 0x6e, 0x34, 0x1b, 0x31, 0x95, 0x69, 0x6b, 0x7e, 0x17, 0x33, 0xcf, 0x25, 0x38, 0x66, 0xef, 0xe5, 0xd0, 0x01, 0xd5, 0x7a, 0x88, 0x60, 0x34, 0xdc, 0x16, 0x4a, 0x35, 0x64, 0xbd, 0x36, 0x10, 0xf9 } +, + /* Prime exponent 2 */ + 64, + { 0xbe, 0x4e, 0x9e, 0x3b, 0x40, 0xf5, 0x6c, 0x62, 0x59, 0xaa, 0x1e, 0x5c, 0xdf, 0x56, 0x59, 0xb1, 0x6f, 0xb8, 0x42, 0x94, 0xe5, 0x8a, 0xd0, 0x16, 0xbd, 0x2c, 0x96, 0xcd, 0x08, 0xe6, 0xcf, 0x68, 0x54, 0xa1, 0x1c, 0xb8, 0x0a, 0xd4, 0xbe, 0x3e, 0x05, 0x7a, 0xaa, 0xcf, 0x02, 0xbd, 0x32, 0x63, 0x73, 0xa2, 0x35, 0xce, 0xb8, 0x9e, 0x82, 0x43, 0x0d, 0x6e, 0x6d, 0x47, 0xd6, 0xce, 0xf8, 0x35 } +, + /* Coefficient */ + 64, + { 0xc0, 0x23, 0x5c, 0x89, 0x73, 0xcf, 0xbf, 0x30, 0xbf, 0x1d, 0xd3, 0xc8, 0x39, 0xf0, 0x2c, 0x94, 0xc6, 0x9d, 0xc5, 0x34, 0xcb, 0xfc, 0x98, 0x88, 0x05, 0xd6, 0xfc, 0x46, 0x2a, 0xdb, 0xd3, 0x77, 0xd1, 0x75, 0xb9, 0xa9, 0x64, 0x60, 0x18, 0xd7, 0xfa, 0xb7, 0x5c, 0x1d, 0x1f, 0x7d, 0x61, 0xb7, 0x7f, 0xa7, 0x95, 0x59, 0xb8, 0x6f, 0xfa, 0x9e, 0xc6, 0xe2, 0x11, 0x33, 0xfa, 0x7f, 0x1a, 0x45 } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 8.1", + /* Message to be signed */ + 181, + { 0x9a, 0x28, 0x20, 0xf3, 0xb9, 0x02, 0x9a, 0xbc, 0x18, 0x65, 0xeb, 0x06, 0xfe, 0x61, 0xb8, 0xd3, 0x97, 0xb6, 0x55, 0x72, 0xd6, 0x00, 0x61, 0xca, 0xa7, 0x4e, 0x63, 0x56, 0x93, 0x1e, 0x25, 0x6b, 0x89, 0x71, 0x2d, 0x18, 0x66, 0x84, 0xb4, 0xde, 0x1e, 0x14, 0xc9, 0xeb, 0xfe, 0xf1, 0x6e, 0x40, 0xd9, 0x9d, 0x10, 0x94, 0x39, 0x6c, 0x56, 0x1c, 0x88, 0x31, 0x77, 0xe5, 0x12, 0x6b, 0x9b, 0xe2, 0xd9, 0xa9, 0x68, 0x03, 0x27, 0xd5, 0x37, 0x0c, 0x6f, 0x26, 0x86, 0x1f, 0x58, 0x20, 0xc4, 0x3d, 0xa6, 0x7a, 0x3a, 0xd6, 0x09, 0x04, 0xe2, 0x15, 0xee, 0x6f, 0xf9, 0x34, 0xb9, 0xda, 0x70, 0xd7, 0x73, 0x0c, 0x87, 0x34, 0xab, 0xfc, 0xec, 0xde, 0x89, 0x7f, 0xdd, 0x67, 0x0a, 0x01, 0x46, 0x58, 0x68, 0xad, 0xc9, 0x3f, 0x26, 0x13, 0x19, 0x57, 0xa5, 0x0c, 0x52, 0xfb, 0x77, 0x7c, 0xdb, 0xaa, 0x30, 0x89, 0x2c, 0x9e, 0x12, 0x36, 0x11, 0x64, 0xec, 0x13, 0x97, 0x9d, 0x43, 0x04, 0x81, 0x18, 0xe4, 0x44, 0x5d, 0xb8, 0x7b, 0xee, 0x58, 0xdd, 0x98, 0x7b, 0x34, 0x25, 0xd0, 0x20, 0x71, 0xd8, 0xdb, 0xae, 0x80, 0x70, 0x8b, 0x03, 0x9d, 0xbb, 0x64, 0xdb, 0xd1, 0xde, 0x56, 0x57, 0xd9, 0xfe, 0xd0, 0xc1, 0x18, 0xa5, 0x41 } +, + /* Signature */ + 129, + { 0x03, 0x22, 0xd0, 0x0f, 0xc1, 0xd9, 0x66, 0x94, 0xf3, 0x6e, 0xae, 0xd2, 0x30, 0x90, 0x56, 0xf3, 0xea, 0x1c, 0x1c, 0xc2, 0x2b, 0x13, 0xb6, 0x5e, 0x79, 0x11, 0x8d, 0x20, 0x2c, 0x42, 0xd1, 0x61, 0x30, 0x99, 0x38, 0x05, 0x09, 0xda, 0x74, 0x35, 0xbb, 0x57, 0x92, 0x16, 0xfd, 0x57, 0x65, 0x06, 0x68, 0x42, 0xe3, 0x56, 0xa6, 0x41, 0x6f, 0xc8, 0x42, 0xa2, 0x4a, 0x9e, 0xa1, 0xbc, 0x6a, 0x90, 0x98, 0x05, 0x23, 0xb4, 0x28, 0xe3, 0x99, 0xbb, 0xd6, 0xfc, 0xdc, 0x2c, 0xb7, 0x71, 0xda, 0xf0, 0x03, 0x7a, 0x2d, 0xe8, 0xc7, 0x64, 0x9b, 0xd5, 0x33, 0x17, 0xde, 0x0e, 0x37, 0xc3, 0x14, 0xba, 0xb0, 0xc4, 0x37, 0xbb, 0xd7, 0x98, 0xdf, 0xb9, 0x65, 0x50, 0x6c, 0x34, 0x8b, 0x74, 0x2f, 0x13, 0x8e, 0xf1, 0xd1, 0xa2, 0x03, 0xe0, 0x51, 0xe3, 0x4b, 0xdd, 0x3a, 0x30, 0xe0, 0xfc, 0xe1, 0xac, 0x43 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.2", + /* Message to be signed */ + 118, + { 0xea, 0x9a, 0x1a, 0x04, 0xb7, 0xcf, 0x47, 0x8a, 0x89, 0x7a, 0x70, 0x8f, 0xd9, 0x88, 0xf4, 0x8e, 0x80, 0x1e, 0xdb, 0x0b, 0x70, 0x39, 0xdf, 0x8c, 0x23, 0xb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a, 0x1a, 0x6d, 0xc1, 0x45, 0x52, 0x86, 0xae, 0x09, 0xcf, 0x26, 0x72, 0x58, 0x85, 0xe7, 0x74, 0x80, 0x99, 0x72, 0xd7, 0x81, 0x98, 0x05, 0xff, 0xf5, 0xa8, 0xc8, 0x9d, 0x37, 0x37, 0x64, 0x50, 0x73, 0x92, 0x49, 0xf5, 0x7e, 0xb1, 0x51, 0xb7, 0x1d, 0xc0 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.3", + /* Message to be signed */ + 23, + { 0x07, 0xdf, 0x58, 0x6b, 0x90, 0x5b, 0x23, 0xb9, 0x1a, 0xf1, 0x3d, 0xa1, 0x23, 0x04, 0xbf, 0x83, 0xec, 0xa8, 0xa7, 0x3e, 0x87, 0x1f, 0xf9 } +, + /* Signature */ + 129, + { 0x01, 0xbf, 0xd9, 0x15, 0xff, 0x77, 0x80, 0xf1, 0x4c, 0xcc, 0x55, 0xbd, 0x03, 0x06, 0xb3, 0xae, 0xda, 0x5b, 0x5b, 0x59, 0x55, 0xa8, 0x26, 0xd4, 0x52, 0x6b, 0x0b, 0xc7, 0x66, 0x15, 0x4f, 0xa8, 0xda, 0x59, 0x56, 0x05, 0x78, 0xcc, 0xd4, 0x88, 0x2f, 0xe9, 0x70, 0x92, 0xfb, 0xc7, 0x36, 0xfd, 0xa7, 0x3c, 0xee, 0xfd, 0x10, 0x38, 0x94, 0x06, 0x3e, 0x93, 0xe2, 0x2a, 0x7b, 0x5c, 0x44, 0xf7, 0xa8, 0x5e, 0x3b, 0xdb, 0x96, 0x71, 0x9a, 0x09, 0x37, 0x43, 0x03, 0xc9, 0x1e, 0xd7, 0xe2, 0x27, 0x49, 0xfe, 0x3c, 0x4d, 0x6b, 0x96, 0x69, 0x9d, 0x50, 0x7c, 0x50, 0xad, 0xcf, 0xbd, 0xfc, 0x13, 0x1d, 0x6b, 0x5f, 0x2c, 0xf1, 0x83, 0x0e, 0x31, 0xea, 0xbe, 0x39, 0xae, 0xb5, 0x17, 0x96, 0x9c, 0x94, 0xa8, 0x1c, 0xfe, 0xfe, 0x67, 0x31, 0xaa, 0x2c, 0xdf, 0xfe, 0x28, 0xc8, 0xaf, 0x71, 0x40, 0xf4 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.4", + /* Message to be signed */ + 116, + { 0x50, 0x0b, 0x87, 0x77, 0xc7, 0xf8, 0x39, 0xba, 0xf0, 0xa6, 0x4b, 0xbb, 0xdb, 0xc5, 0xce, 0x79, 0x75, 0x5c, 0x57, 0xa2, 0x05, 0xb8, 0x45, 0xc1, 0x74, 0xe2, 0xd2, 0xe9, 0x05, 0x46, 0xa0, 0x89, 0xc4, 0xe6, 0xec, 0x8a, 0xdf, 0xfa, 0x23, 0xa7, 0xea, 0x97, 0xba, 0xe6, 0xb6, 0x5d, 0x78, 0x2b, 0x82, 0xdb, 0x5d, 0x2b, 0x5a, 0x56, 0xd2, 0x2a, 0x29, 0xa0, 0x5e, 0x7c, 0x44, 0x33, 0xe2, 0xb8, 0x2a, 0x62, 0x1a, 0xbb, 0xa9, 0x0a, 0xdd, 0x05, 0xce, 0x39, 0x3f, 0xc4, 0x8a, 0x84, 0x05, 0x42, 0x45, 0x1a, 0xc7, 0xcd, 0x69, 0x8d, 0x84, 0xb6, 0x51, 0x28, 0xd8, 0x83, 0x5e, 0x3a, 0x8b, 0x1e, 0xb0, 0xe0, 0x1c, 0xb5, 0x41, 0xec, 0x50, 0xf1, 0x03, 0x6e, 0x00, 0x8e, 0x71, 0xe9, 0x64, 0xda, 0xdc, 0x92, 0x19, 0xed } +, + /* Signature */ + 129, + { 0x00, 0x7a, 0xe0, 0xcf, 0xd7, 0xf4, 0xc6, 0xad, 0x1f, 0xf8, 0x4b, 0x4a, 0x60, 0x6b, 0xa1, 0xc4, 0x79, 0x8c, 0x2e, 0x49, 0x9b, 0x04, 0x5b, 0x56, 0x7d, 0x32, 0x63, 0x4f, 0xd9, 0x55, 0xf2, 0x68, 0x26, 0x0a, 0xb6, 0x59, 0xbf, 0x5b, 0xe9, 0x9e, 0x08, 0x26, 0xeb, 0x38, 0x70, 0xe8, 0xf6, 0x2f, 0x5a, 0x3c, 0xe7, 0x58, 0xe6, 0xd1, 0x56, 0xc3, 0x29, 0x9b, 0x43, 0x1c, 0xd9, 0xdf, 0xc6, 0x58, 0x37, 0xee, 0x94, 0x22, 0x0d, 0x95, 0x23, 0x51, 0x14, 0x87, 0x99, 0xbe, 0x9f, 0xca, 0xf9, 0xbe, 0x26, 0x4d, 0xae, 0xbe, 0xba, 0x2b, 0xe8, 0x66, 0x05, 0x20, 0x1e, 0xf9, 0xa0, 0xd9, 0x8f, 0x58, 0xec, 0x63, 0x8a, 0xbf, 0xc4, 0xf2, 0x78, 0x48, 0xf5, 0xd4, 0x79, 0xd3, 0x34, 0xac, 0xc2, 0xa9, 0x7f, 0xdd, 0x2d, 0x32, 0x7e, 0xc4, 0xc7, 0xdd, 0xc5, 0xa8, 0xab, 0xd5, 0x66, 0xde, 0x35, 0xd1, 0x4f } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.5", + /* Message to be signed */ + 238, + { 0x6b, 0x3f, 0x6a, 0x63, 0xd4, 0xe7, 0x78, 0x59, 0x24, 0x3c, 0x9c, 0xcc, 0xdc, 0x98, 0x01, 0x65, 0x23, 0xab, 0xb0, 0x24, 0x83, 0xb3, 0x55, 0x91, 0xc3, 0x3a, 0xad, 0x81, 0x21, 0x3b, 0xb7, 0xc7, 0xbb, 0x1a, 0x47, 0x0a, 0xab, 0xc1, 0x0d, 0x44, 0x25, 0x6c, 0x4d, 0x45, 0x59, 0xd9, 0x16, 0xef, 0xa8, 0xbf, 0xf9, 0x62, 0x12, 0xb2, 0xf4, 0xa3, 0xf3, 0x71, 0xa1, 0x0d, 0x57, 0x41, 0x52, 0x65, 0x5f, 0x5d, 0xfb, 0xa2, 0x25, 0xf1, 0x08, 0x95, 0xa8, 0x77, 0x16, 0xc1, 0x37, 0x45, 0x0b, 0xb9, 0x51, 0x9d, 0xfa, 0xa1, 0xf2, 0x07, 0xfa, 0xa9, 0x42, 0xea, 0x88, 0xab, 0xf7, 0x1e, 0x9c, 0x17, 0x98, 0x00, 0x85, 0xb5, 0x55, 0xae, 0xba, 0xb7, 0x62, 0x64, 0xae, 0x2a, 0x3a, 0xb9, 0x3c, 0x2d, 0x12, 0x98, 0x11, 0x91, 0xdd, 0xac, 0x6f, 0xb5, 0x94, 0x9e, 0xb3, 0x6a, 0xee, 0x3c, 0x5d, 0xa9, 0x40, 0xf0, 0x07, 0x52, 0xc9, 0x16, 0xd9, 0x46, 0x08, 0xfa, 0x7d, 0x97, 0xba, 0x6a, 0x29, 0x15, 0xb6, 0x88, 0xf2, 0x03, 0x23, 0xd4, 0xe9, 0xd9, 0x68, 0x01, 0xd8, 0x9a, 0x72, 0xab, 0x58, 0x92, 0xdc, 0x21, 0x17, 0xc0, 0x74, 0x34, 0xfc, 0xf9, 0x72, 0xe0, 0x58, 0xcf, 0x8c, 0x41, 0xca, 0x4b, 0x4f, 0xf5, 0x54, 0xf7, 0xd5, 0x06, 0x8a, 0xd3, 0x15, 0x5f, 0xce, 0xd0, 0xf3, 0x12, 0x5b, 0xc0, 0x4f, 0x91, 0x93, 0x37, 0x8a, 0x8f, 0x5c, 0x4c, 0x3b, 0x8c, 0xb4, 0xdd, 0x6d, 0x1c, 0xc6, 0x9d, 0x30, 0xec, 0xca, 0x6e, 0xaa, 0x51, 0xe3, 0x6a, 0x05, 0x73, 0x0e, 0x9e, 0x34, 0x2e, 0x85, 0x5b, 0xaf, 0x09, 0x9d, 0xef, 0xb8, 0xaf, 0xd7, 0xad, 0x8b, 0x15, 0x23, 0x70, 0x36, 0x46 } +, + /* Signature */ + 129, + { 0x01, 0x92, 0x1f, 0x22, 0xf4, 0x71, 0xa0, 0x8a, 0xf8, 0x19, 0xa9, 0x52, 0xe1, 0x83, 0x68, 0xce, 0x15, 0xf9, 0xb0, 0x64, 0xeb, 0x1d, 0x00, 0xb1, 0x28, 0x99, 0x78, 0x02, 0x44, 0xfe, 0x8c, 0x44, 0x24, 0xb2, 0x1f, 0x64, 0x35, 0x0b, 0x92, 0x26, 0xfe, 0x95, 0xff, 0x54, 0xf1, 0x14, 0x39, 0x83, 0x9b, 0xfb, 0x54, 0xf9, 0x39, 0xc9, 0x14, 0x95, 0xe4, 0xf0, 0x27, 0x90, 0x18, 0x97, 0x27, 0x3c, 0xfa, 0x29, 0x5a, 0x57, 0x15, 0x1f, 0x4e, 0x91, 0x1d, 0xc1, 0x02, 0xa7, 0x7d, 0x95, 0x8b, 0x62, 0x27, 0x24, 0xc0, 0xfd, 0x3a, 0x34, 0xb3, 0xb7, 0xbe, 0xfb, 0x8b, 0x8c, 0xd0, 0x66, 0x6e, 0x81, 0x5d, 0x0c, 0x07, 0xf2, 0xec, 0xb7, 0xc4, 0xdd, 0x2f, 0x42, 0xb7, 0xf4, 0x09, 0x13, 0x12, 0xe3, 0xd7, 0xb2, 0xdf, 0x26, 0x78, 0x87, 0xe0, 0xac, 0xa7, 0x0b, 0x54, 0x1c, 0x4c, 0x1e, 0xea, 0x16, 0xb5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.6", + /* Message to be signed */ + 10, + { 0x93, 0x29, 0xa5, 0x80, 0x90, 0xde, 0x8b, 0xe5, 0x7c, 0x42 } +, + /* Signature */ + 129, + { 0x01, 0x5c, 0xe2, 0x4a, 0x6f, 0x2b, 0x37, 0x3a, 0x19, 0x99, 0x7b, 0xb2, 0x0c, 0x18, 0xac, 0x65, 0x9f, 0x1e, 0xdc, 0x0f, 0x25, 0xc9, 0xe5, 0xbf, 0x76, 0xd5, 0x69, 0x99, 0x65, 0x20, 0xc2, 0x80, 0xef, 0xdc, 0xf1, 0x5e, 0x2d, 0x63, 0xca, 0xaf, 0xf6, 0xc7, 0x7a, 0xe0, 0x38, 0x97, 0x03, 0x7a, 0x06, 0x15, 0xf9, 0x83, 0x8c, 0x52, 0x10, 0x4e, 0x97, 0x25, 0x18, 0xe2, 0x90, 0xfa, 0xc3, 0x8f, 0x63, 0x24, 0x75, 0x30, 0xb4, 0xcf, 0x61, 0xc6, 0xec, 0xe3, 0x42, 0x9b, 0x53, 0x07, 0x81, 0xcf, 0x34, 0x96, 0x4f, 0x32, 0xae, 0x50, 0xf1, 0x09, 0x34, 0x63, 0x83, 0x86, 0xd3, 0xb4, 0xdf, 0x76, 0x1c, 0x59, 0x7d, 0x4a, 0xa7, 0xfe, 0xca, 0x26, 0x6c, 0x27, 0xf8, 0xce, 0x66, 0xad, 0xe1, 0xbe, 0x26, 0x59, 0xce, 0x14, 0x2b, 0xa5, 0xf9, 0x35, 0x88, 0x3c, 0x7e, 0x8c, 0x9b, 0x89, 0x57, 0xab, 0xf2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.7", + /* Message to be signed */ + 211, + { 0x6a, 0xce, 0x0f, 0x1e, 0x1d, 0xc6, 0x3e, 0x39, 0x4a, 0x06, 0x1f, 0x52, 0x2a, 0x54, 0x2f, 0xbe, 0x71, 0x20, 0x25, 0x4e, 0x36, 0xe9, 0xf6, 0x5d, 0x19, 0x57, 0xc9, 0x56, 0x28, 0x78, 0x2c, 0xb0, 0x36, 0x8f, 0x3c, 0x13, 0xda, 0xd6, 0x56, 0x71, 0x79, 0xc1, 0xea, 0x24, 0xfe, 0x83, 0x5a, 0x26, 0x63, 0x85, 0xe4, 0x68, 0x83, 0x17, 0xb8, 0x2b, 0x0c, 0x3f, 0xe6, 0x3c, 0xf2, 0xd5, 0x2f, 0x04, 0xae, 0x8a, 0x38, 0xa5, 0x75, 0x59, 0xbb, 0x95, 0xd9, 0xeb, 0xd5, 0xfe, 0x8a, 0x9a, 0xfe, 0x14, 0x79, 0x90, 0x9e, 0xb9, 0x9e, 0x0d, 0x3e, 0xf3, 0xf3, 0x12, 0xe0, 0xa4, 0xab, 0xb7, 0x66, 0xc7, 0xe2, 0x13, 0x1a, 0x5f, 0xfb, 0x48, 0x31, 0x83, 0xfb, 0xb4, 0x22, 0x34, 0xd3, 0x2e, 0x58, 0x1f, 0x59, 0x50, 0x65, 0xc4, 0x89, 0x82, 0x61, 0xec, 0xd0, 0xae, 0x57, 0x2c, 0x22, 0x1c, 0x25, 0x8d, 0xe9, 0x50, 0xa4, 0x08, 0x01, 0xef, 0x79, 0x6d, 0x4d, 0xd0, 0x04, 0x06, 0x45, 0xfc, 0x53, 0x4d, 0x8e, 0x78, 0x58, 0x23, 0x48, 0x38, 0xed, 0x12, 0xc6, 0x87, 0x40, 0xc1, 0x4e, 0x37, 0x16, 0x13, 0xf0, 0x04, 0x61, 0x76, 0xbb, 0xb0, 0xf4, 0x3d, 0x99, 0x75, 0x19, 0xc4, 0x0c, 0x67, 0x14, 0x96, 0xff, 0x35, 0x0a, 0x3f, 0xdf, 0x42, 0x9c, 0xc2, 0x2f, 0x46, 0x4f, 0x43, 0x5f, 0x6b, 0x29, 0xe7, 0xe1, 0xc3, 0x0e, 0xbd, 0x50, 0x59, 0x27, 0xd4, 0xa0, 0x96, 0x58, 0x7f, 0xc3, 0x8d, 0x3d, 0x64, 0x94, 0x39, 0x1e } +, + /* Signature */ + 129, + { 0x02, 0x73, 0xba, 0x2c, 0x50, 0x2b, 0x3f, 0x29, 0x84, 0xc5, 0x48, 0xd9, 0xf7, 0xd6, 0xc9, 0xb3, 0xd7, 0xfd, 0x46, 0x08, 0x78, 0xc8, 0x4d, 0x6b, 0xe3, 0x3b, 0x28, 0x10, 0x6e, 0x15, 0xfc, 0x22, 0x17, 0xef, 0xf7, 0x41, 0xcd, 0xc2, 0x66, 0x83, 0x4b, 0xea, 0xa8, 0x6d, 0xa4, 0x05, 0xf3, 0xca, 0xe6, 0x06, 0xcc, 0x61, 0xf2, 0x54, 0x7b, 0xb9, 0x22, 0x92, 0x03, 0x45, 0xfe, 0x8f, 0xbb, 0x5e, 0x7b, 0x6a, 0xbf, 0x91, 0xea, 0xe8, 0xc4, 0x26, 0x60, 0x64, 0x50, 0x25, 0xcc, 0x7f, 0xc0, 0x7a, 0x53, 0x4b, 0x76, 0xd3, 0x78, 0x75, 0xe3, 0xf4, 0x0d, 0x52, 0x70, 0xc1, 0x0e, 0xf4, 0x6c, 0x7f, 0xe4, 0x5a, 0xfa, 0xbc, 0xff, 0xae, 0x2a, 0x9c, 0x94, 0x11, 0xbd, 0x04, 0xd6, 0x1d, 0x4c, 0x0e, 0x5f, 0xfc, 0x02, 0x2c, 0xb3, 0x6a, 0x64, 0xb7, 0xc3, 0xa8, 0xc8, 0x9b, 0xfd, 0xe4, 0x36, 0xba, 0xfd } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.8", + /* Message to be signed */ + 157, + { 0xfd, 0xcc, 0x0f, 0x1e, 0x5d, 0xcb, 0xe5, 0x01, 0x6a, 0x6b, 0x0f, 0x8c, 0x28, 0xf5, 0xb3, 0x31, 0xff, 0x58, 0x28, 0x37, 0x13, 0x8d, 0xbf, 0x62, 0xef, 0x7f, 0xf6, 0x1b, 0xc1, 0xa3, 0x53, 0x96, 0xc9, 0x2e, 0x3d, 0x54, 0x8d, 0x39, 0x9e, 0x35, 0x0a, 0x3c, 0x6b, 0xc2, 0xfd, 0xb5, 0xda, 0x94, 0xb9, 0x86, 0xa4, 0xce, 0x6d, 0xee, 0x10, 0x4e, 0x9f, 0x27, 0x4b, 0x15, 0x25, 0x58, 0xbf, 0xa7, 0x22, 0xcc, 0xfd, 0xda, 0x3b, 0x26, 0xb9, 0xf8, 0xe5, 0x15, 0x25, 0xf3, 0x81, 0x03, 0x4c, 0x51, 0xfd, 0xc9, 0xf7, 0x91, 0x2a, 0xc9, 0x27, 0xd1, 0xa7, 0x08, 0xcc, 0x2d, 0xbb, 0xcd, 0x7b, 0xa6, 0xc0, 0x31, 0xb0, 0x11, 0xcb, 0xa8, 0xe2, 0xdf, 0x8f, 0xc9, 0xb8, 0x83, 0x64, 0xee, 0x96, 0x5f, 0x24, 0x27, 0x0e, 0x43, 0x48, 0x62, 0x32, 0x53, 0xcb, 0x9e, 0x59, 0xd6, 0xf7, 0x94, 0x09, 0x09, 0x94, 0xa7, 0xa4, 0xc9, 0x30, 0x02, 0x70, 0xb5, 0x7f, 0x24, 0x39, 0xeb, 0xbb, 0xa4, 0x65, 0x84, 0x67, 0xaf, 0xdb, 0x7f, 0xe8, 0x6b, 0x4f, 0x1a, 0xad, 0x1d, 0x3d, 0x3b, 0x2f } +, + /* Signature */ + 129, + { 0x00, 0xa7, 0xc4, 0x50, 0xb3, 0x0b, 0x2e, 0xcb, 0x19, 0xbb, 0x70, 0x9a, 0x92, 0x31, 0xcb, 0xfa, 0x9f, 0x0d, 0x61, 0x69, 0x7a, 0x26, 0xb9, 0x0a, 0x96, 0xd9, 0x1c, 0x24, 0xc4, 0xda, 0x70, 0xd7, 0xb0, 0x0b, 0x59, 0x23, 0xc8, 0xe1, 0x2d, 0x41, 0x09, 0x4b, 0x70, 0x5d, 0x50, 0xc7, 0x78, 0xbb, 0xda, 0xce, 0xc6, 0x60, 0xd5, 0xc1, 0x5d, 0xff, 0xd3, 0xa2, 0x47, 0x8f, 0xd9, 0x33, 0x70, 0x80, 0xdc, 0xa1, 0x6b, 0x9c, 0x13, 0xe6, 0x23, 0x3b, 0x82, 0x92, 0xb2, 0xfd, 0xcc, 0x29, 0xe9, 0xbf, 0x3b, 0x21, 0xa7, 0x18, 0x78, 0xf3, 0x4e, 0xf5, 0xeb, 0x7c, 0xd5, 0x0a, 0xd4, 0x12, 0x03, 0x72, 0x5a, 0x0f, 0x1c, 0x66, 0x3f, 0x73, 0x42, 0xec, 0x7c, 0x3d, 0xf3, 0xd5, 0xaa, 0x51, 0xd0, 0x58, 0xdf, 0xcc, 0xce, 0x5f, 0xe6, 0x9d, 0x36, 0x3b, 0x42, 0x84, 0x32, 0x08, 0x79, 0xe8, 0x6d, 0x58, 0xb5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.9", + /* Message to be signed */ + 92, + { 0x2d, 0x1f, 0xcd, 0x17, 0x66, 0xf7, 0xd4, 0x5f, 0x29, 0x59, 0x4f, 0x9d, 0x4f, 0x74, 0x39, 0x41, 0xae, 0x91, 0x2a, 0x97, 0x91, 0x1f, 0xfc, 0x3d, 0x65, 0xdc, 0xd9, 0x65, 0x60, 0x10, 0x77, 0x3b, 0xb0, 0x22, 0x4b, 0xa6, 0xdf, 0x11, 0x1b, 0x1c, 0x13, 0x68, 0x38, 0x4f, 0x24, 0x92, 0xfc, 0x4f, 0xa7, 0x28, 0x0c, 0x06, 0x65, 0x14, 0xae, 0x84, 0xf7, 0x61, 0x45, 0x63, 0xd9, 0x05, 0x2c, 0xa9, 0x4e, 0xf4, 0x46, 0xa3, 0x1b, 0x46, 0x3b, 0xd6, 0xc2, 0x50, 0x56, 0x80, 0x50, 0x88, 0xc1, 0xd3, 0x1a, 0xba, 0xff, 0x52, 0x15, 0xf7, 0xa8, 0xf8, 0x9e, 0x7b, 0x64, 0xf2 } +, + /* Signature */ + 129, + { 0x02, 0xc0, 0xe0, 0x71, 0xe8, 0x36, 0x90, 0xdc, 0x14, 0xd9, 0xa3, 0x7d, 0x61, 0xe0, 0xaf, 0xc2, 0x7d, 0xf9, 0x78, 0x03, 0x9d, 0xa6, 0x01, 0xca, 0x2c, 0xec, 0x1d, 0xec, 0x8f, 0x0d, 0x17, 0xd2, 0xff, 0xc4, 0x50, 0xe6, 0x78, 0x38, 0x0a, 0x02, 0x5a, 0x41, 0xc7, 0x46, 0x11, 0x8f, 0x58, 0x36, 0x42, 0x52, 0xa1, 0x22, 0x53, 0x9e, 0xcc, 0xbb, 0xb4, 0xab, 0x3d, 0x8d, 0x37, 0x7b, 0xdb, 0xb9, 0x11, 0xc5, 0x8a, 0x4c, 0xb9, 0x46, 0x2f, 0x36, 0xdc, 0x38, 0x92, 0x48, 0x50, 0x1b, 0xd0, 0x8f, 0x48, 0xe3, 0x53, 0x3b, 0x82, 0x59, 0x1a, 0x2a, 0x20, 0xcf, 0x62, 0xdf, 0x5f, 0x5a, 0x1f, 0x84, 0xea, 0x30, 0x0c, 0xb3, 0x94, 0x57, 0x13, 0x71, 0x41, 0xad, 0x8c, 0xd1, 0xd1, 0x85, 0xab, 0xb1, 0x7b, 0xa5, 0xd0, 0x3b, 0xe3, 0x48, 0xc0, 0x67, 0x97, 0xb0, 0x95, 0x58, 0xf0, 0x33, 0x1c, 0x24, 0xb9 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.10", + /* Message to be signed */ + 179, + { 0x4f, 0x46, 0x9a, 0xb7, 0x9c, 0xb8, 0x93, 0xa5, 0x3c, 0x0e, 0xe3, 0x81, 0x5a, 0x8b, 0xc0, 0x87, 0xeb, 0x74, 0xea, 0x36, 0x61, 0x5b, 0xdd, 0xc3, 0x33, 0xde, 0xe0, 0x5f, 0xc7, 0x26, 0x65, 0xaa, 0x6d, 0x0b, 0xd5, 0x9e, 0x47, 0x22, 0x98, 0x29, 0x83, 0x4b, 0x1f, 0x91, 0xc9, 0xcd, 0x81, 0xce, 0x28, 0xd6, 0x8f, 0x14, 0x82, 0x5a, 0x34, 0x5f, 0x3a, 0x4f, 0x38, 0xa0, 0x1b, 0x2d, 0xae, 0x59, 0x10, 0x07, 0x64, 0xaa, 0xb9, 0x90, 0xa8, 0x50, 0xb1, 0x1c, 0x13, 0xd5, 0xdf, 0xe4, 0x19, 0xf1, 0xd9, 0x20, 0xd0, 0x0c, 0xf1, 0x3b, 0xf4, 0x30, 0xe4, 0xca, 0x82, 0x87, 0x98, 0x9b, 0xee, 0xbe, 0xda, 0x3e, 0x5d, 0x40, 0x36, 0x02, 0x8c, 0x8e, 0xf9, 0x54, 0x6e, 0x35, 0x01, 0x50, 0xd1, 0x96, 0xf0, 0x05, 0x60, 0xba, 0xe1, 0x47, 0x22, 0x99, 0xe7, 0xf4, 0x29, 0x1d, 0x54, 0x46, 0x29, 0xc4, 0xf6, 0x52, 0xe3, 0x5c, 0xde, 0x4f, 0x80, 0x3e, 0x1b, 0x3c, 0xa3, 0x38, 0x09, 0x51, 0x5e, 0xf2, 0x3d, 0x25, 0x4b, 0x8e, 0x65, 0x20, 0x2a, 0x14, 0xa4, 0x11, 0xb1, 0xbc, 0x31, 0x5c, 0x5f, 0xfa, 0xec, 0xb8, 0x21, 0x11, 0x97, 0x80, 0x9d, 0xcb, 0x5c, 0xed, 0x68, 0x2c, 0x09, 0xf6, 0x7e, 0x41, 0xd1, 0x60, 0x2c } +, + /* Signature */ + 129, + { 0x01, 0x71, 0x29, 0x64, 0xea, 0x9a, 0xb9, 0x70, 0x29, 0x5b, 0x81, 0xb0, 0xfb, 0xd8, 0x35, 0x7e, 0x54, 0xb9, 0x36, 0xee, 0x87, 0x72, 0xd8, 0xae, 0x9c, 0x96, 0x12, 0x71, 0x6f, 0xcc, 0x2f, 0xcb, 0x78, 0x4c, 0xa9, 0xab, 0xee, 0xeb, 0xb8, 0xfc, 0xb6, 0x89, 0x82, 0x16, 0x1c, 0xc7, 0x4e, 0x40, 0xc7, 0xc0, 0x22, 0x47, 0xc0, 0xd0, 0x0e, 0x03, 0xbc, 0x8e, 0x1a, 0x70, 0x51, 0xb8, 0x7c, 0x90, 0xdd, 0x7d, 0x3d, 0xfc, 0x95, 0xe0, 0xb3, 0xc8, 0x8e, 0x7a, 0x0f, 0x37, 0xf3, 0x0e, 0x1b, 0xd5, 0xfe, 0x8b, 0x6e, 0xee, 0x46, 0x5a, 0x0b, 0x34, 0xcb, 0x59, 0xc6, 0x4e, 0xbd, 0xb5, 0x7d, 0x6f, 0x5f, 0xdf, 0xf2, 0xe7, 0x0b, 0xb1, 0x9c, 0x60, 0xd9, 0x88, 0xea, 0x95, 0x6c, 0xdc, 0xdd, 0x1b, 0xe5, 0x62, 0xf2, 0x6f, 0xb3, 0x7c, 0x34, 0xda, 0x52, 0xa9, 0xf9, 0x11, 0xb9, 0x97, 0x43, 0x81, 0x2c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.11", + /* Message to be signed */ + 35, + { 0x52, 0xbb, 0x76, 0xc9, 0xea, 0x26, 0x5d, 0x6f, 0xad, 0x10, 0x83, 0x72, 0xff, 0xab, 0x25, 0x03, 0xbb, 0x20, 0xd3, 0x8d, 0x37, 0xdf, 0x19, 0x92, 0x54, 0xa2, 0xf6, 0xde, 0x0c, 0x4f, 0xca, 0x7a, 0x73, 0x03, 0x36 } +, + /* Signature */ + 129, + { 0x01, 0x0c, 0x55, 0x34, 0x23, 0x60, 0x22, 0x60, 0x15, 0x8a, 0x17, 0x13, 0x3b, 0x5d, 0x30, 0xef, 0xe9, 0x8e, 0x9a, 0xeb, 0x35, 0x3b, 0xab, 0x33, 0x71, 0xe4, 0x91, 0xcd, 0xbe, 0xbd, 0x35, 0x0a, 0x0a, 0x47, 0x0b, 0x9d, 0xbf, 0xd1, 0x89, 0x33, 0x51, 0x1f, 0x0d, 0x0e, 0x36, 0x94, 0xa8, 0xac, 0x4b, 0xf3, 0xf5, 0xb6, 0xeb, 0x9b, 0xf7, 0x1c, 0x23, 0xd9, 0x4c, 0x2e, 0x64, 0xbe, 0xb7, 0xb7, 0xc7, 0x22, 0x52, 0xca, 0x82, 0x7b, 0xd0, 0xc0, 0x56, 0x7b, 0xa8, 0xa1, 0x0a, 0x6d, 0x3b, 0x7e, 0x18, 0x7b, 0x0f, 0xd8, 0xe9, 0xe9, 0x5d, 0x4f, 0xe4, 0x80, 0xf2, 0x50, 0xdc, 0x7f, 0x03, 0x42, 0x29, 0x0e, 0x9a, 0x7d, 0x32, 0x70, 0x3a, 0x72, 0x13, 0xc6, 0x52, 0x13, 0xad, 0xed, 0x45, 0x57, 0x54, 0x78, 0x1f, 0x3d, 0xb7, 0x3e, 0x79, 0xe3, 0xd1, 0xba, 0x6a, 0xf7, 0xf6, 0x90, 0xfe, 0x81, 0x73 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.12", + /* Message to be signed */ + 72, + { 0x5f, 0x59, 0x7a, 0x19, 0xcb, 0xf5, 0x14, 0x30, 0xd3, 0xc6, 0xa2, 0x47, 0xa5, 0x23, 0x54, 0x07, 0x38, 0x6c, 0xae, 0xd0, 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} + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.13", + /* Message to be signed */ + 36, + { 0x84, 0x0c, 0xc9, 0x00, 0xcb, 0x4b, 0x2c, 0xb6, 0x7a, 0x30, 0x4a, 0x9b, 0x02, 0x82, 0x6d, 0xb0, 0xd6, 0x67, 0x36, 0x92, 0x2e, 0x78, 0x70, 0x13, 0xd6, 0xbf, 0x21, 0x4d, 0xf5, 0x79, 0xff, 0x0c, 0xf4, 0x82, 0x1f, 0x9b } +, + /* Signature */ + 129, + { 0x01, 0x3b, 0x6c, 0x08, 0x0f, 0x68, 0x93, 0x95, 0x05, 0xe1, 0x87, 0xa4, 0x94, 0x82, 0xc7, 0x91, 0x27, 0x8d, 0xa3, 0xad, 0x4a, 0x74, 0x7c, 0x4f, 0x01, 0x79, 0x1b, 0x92, 0x48, 0x05, 0xb6, 0x82, 0xf6, 0x49, 0xbb, 0xd8, 0x0d, 0xba, 0x12, 0xfb, 0xbe, 0x59, 0x40, 0xf1, 0x7f, 0x27, 0xe7, 0x5d, 0x42, 0x67, 0x7c, 0x4c, 0xcc, 0xdf, 0xfd, 0x00, 0x48, 0x77, 0x2e, 0x36, 0x93, 0x4c, 0x69, 0x12, 0x12, 0x8f, 0xf9, 0x03, 0xaf, 0xea, 0x5e, 0x1c, 0xa8, 0xfe, 0x94, 0x24, 0xfc, 0x97, 0x9b, 0x21, 0x87, 0x98, 0x76, 0x98, 0xa5, 0xc5, 0xa7, 0x5e, 0x7d, 0x70, 0x70, 0xa2, 0xa6, 0x74, 0x85, 0x2b, 0xd8, 0x05, 0xbf, 0x13, 0xbb, 0xd1, 0x29, 0x6b, 0xff, 0x13, 0x10, 0xa6, 0xd6, 0xed, 0x45, 0xfd, 0xf8, 0x67, 0x2d, 0x52, 0x41, 0xe7, 0x4c, 0xd4, 0xc4, 0x19, 0x86, 0xe4, 0x36, 0x25, 0x50, 0x0c, 0x23 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.14", + /* Message to be signed */ + 216, +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0x32, 0x32, 0x1b, 0x57, 0xef, 0x72, 0x64, 0x0a, 0xdd, 0x2c, 0xee, 0xbf, 0x5b, 0xe9, 0x68, 0x43, 0x6b, 0xcd, 0x12, 0x16, 0x90, 0x78, 0x84, 0x82, 0x32, 0x93, 0xb0, 0x10, 0xec, 0x28, 0xf0, 0xd9 } +, + /* Signature */ + 129, + { 0x01, 0x60, 0x47, 0xca, 0xad, 0x6c, 0x47, 0xbf, 0x27, 0xd0, 0xcc, 0xfa, 0x03, 0x41, 0x01, 0x7e, 0x56, 0x5e, 0x02, 0x8c, 0xf2, 0x6c, 0x8e, 0x66, 0x0f, 0x79, 0xe0, 0x91, 0xf3, 0x50, 0xce, 0xb2, 0xaa, 0xcf, 0x92, 0xf7, 0xd0, 0x1d, 0x37, 0x3f, 0x71, 0x55, 0x11, 0x9c, 0x07, 0x29, 0x17, 0xf2, 0x4f, 0x01, 0xbf, 0x74, 0x7b, 0xe2, 0xdc, 0xdc, 0x41, 0xd1, 0xbe, 0x58, 0x85, 0x35, 0xc2, 0xd6, 0xac, 0x17, 0x04, 0xc5, 0xfb, 0x16, 0xf6, 0xe5, 0xdc, 0x4b, 0xbc, 0x84, 0x53, 0xf5, 0x21, 0xdb, 0x73, 0x1e, 0xba, 0x78, 0x98, 0xe6, 0xe5, 0x21, 0x2b, 0x80, 0xce, 0x9d, 0xa0, 0xf1, 0x56, 0x28, 0x18, 0x99, 0x98, 0x31, 0x35, 0x03, 0xdf, 0xd4, 0x4e, 0x3d, 0x69, 0xde, 0x9b, 0xa9, 0xcb, 0x5e, 0xb3, 0x2a, 0xc4, 0x1c, 0xb8, 0xe3, 0x62, 0x1b, 0xa1, 0xd2, 0x91, 0xd0, 0xc5, 0xda, 0x24, 0x9f, 0x15 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.15", + /* Message to be signed */ + 15, + { 0xa6, 0x42, 0xf0, 0xf7, 0x0b, 0x4b, 0xd3, 0xb5, 0x4b, 0xe2, 0x20, 0x11, 0x9a, 0x7f, 0x79 } +, + /* Signature */ + 129, + { 0x00, 0xa0, 0x33, 0x6e, 0x63, 0x67, 0x52, 0x7b, 0xbf, 0x13, 0xb0, 0xa9, 0x33, 0xb6, 0x31, 0xc7, 0x2c, 0xb3, 0x3e, 0xab, 0xbc, 0x29, 0x2a, 0x0f, 0x8f, 0x75, 0x55, 0x0c, 0x22, 0x30, 0xfe, 0x82, 0x57, 0xf2, 0xaf, 0x76, 0xd5, 0x43, 0xcc, 0xd1, 0x07, 0xdd, 0x2c, 0x87, 0x78, 0xd3, 0xac, 0x8a, 0x7b, 0x5b, 0xb4, 0xac, 0xfa, 0x57, 0xf2, 0xaf, 0x6a, 0x23, 0x14, 0x95, 0x23, 0x5a, 0x51, 0xda, 0xdd, 0xb0, 0x83, 0xe3, 0x73, 0xb7, 0x77, 0xa9, 0x5c, 0xf9, 0xc4, 0xa9, 0xb6, 0xbe, 0x77, 0x51, 0xb6, 0x5f, 0xeb, 0x62, 0x3a, 0xb3, 0x34, 0x43, 0x36, 0x54, 0xb1, 0x21, 0x0f, 0x7f, 0x78, 0x2b, 0x17, 0x25, 0xc6, 0xba, 0x4f, 0xfd, 0x20, 0xd1, 0x7e, 0xd4, 0xb6, 0xec, 0x4a, 0x3a, 0xf6, 0x4b, 0xd2, 0x73, 0x47, 0x55, 0xb7, 0x73, 0x9e, 0xeb, 0xf4, 0x18, 0xf0, 0x9d, 0x3a, 0xff, 0x28, 0x9d, 0x13 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.16", + /* Message to be signed */ + 230, + { 0xca, 0x16, 0xe4, 0x3d, 0x9c, 0x82, 0xd9, 0xd3, 0x0c, 0x8f, 0xcb, 0x40, 0x22, 0x93, 0x3c, 0xff, 0xc7, 0xd7, 0x4c, 0xaa, 0x0d, 0xf4, 0x86, 0x35, 0x09, 0x31, 0x8e, 0xda, 0xba, 0x4e, 0x0d, 0x51, 0x99, 0x77, 0x9c, 0x03, 0x50, 0x4a, 0xff, 0xa2, 0x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 0x08, 0xa5, 0xa3, 0x93, 0x53 } +, + /* Signature */ + 129, + { 0x02, 0x48, 0x59, 0x23, 0x3f, 0xb9, 0xdb, 0x7c, 0xd1, 0x41, 0xf4, 0xb8, 0x77, 0x6a, 0x1d, 0x83, 0xe1, 0x03, 0xdb, 0x3a, 0xc9, 0x42, 0x89, 0xd3, 0x6e, 0xf4, 0x0f, 0x5e, 0x6e, 0x63, 0xc3, 0x12, 0x12, 0xaf, 0xdd, 0xdd, 0x16, 0x88, 0xc2, 0xc1, 0xc8, 0xd4, 0xdb, 0x04, 0x71, 0x9e, 0x1c, 0x6e, 0x8d, 0xbf, 0x7d, 0x60, 0xbe, 0x25, 0xf1, 0xd6, 0x88, 0x87, 0xfd, 0xad, 0xda, 0x3d, 0x11, 0x2e, 0x3d, 0x0d, 0x24, 0xc0, 0xcd, 0xd7, 0x98, 0x8a, 0x55, 0xc7, 0x10, 0x29, 0x40, 0x08, 0x2d, 0x1a, 0xc3, 0x1f, 0xb3, 0xef, 0xab, 0xe7, 0xc2, 0x88, 0xcb, 0x4e, 0xe7, 0x2a, 0x99, 0x2a, 0xc9, 0x6d, 0x1e, 0xdd, 0x78, 0xec, 0x72, 0x82, 0x73, 0x97, 0x0a, 0x79, 0x69, 0x95, 0xc3, 0xe2, 0xa3, 0x85, 0x81, 0xe2, 0x28, 0x03, 0x25, 0x8e, 0xb4, 0xcd, 0x9d, 0xa2, 0x04, 0x0f, 0xaf, 0x74, 0x1c, 0x54, 0x2a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.17", + /* Message to be signed */ + 162, + { 0x3b, 0xaa, 0x7e, 0x9a, 0xda, 0x21, 0x43, 0xf8, 0x48, 0x82, 0x5d, 0x22, 0x93, 0x67, 0x04, 0xd1, 0xc9, 0x97, 0xb2, 0xda, 0x76, 0x76, 0x9c, 0x98, 0x6f, 0xa1, 0x52, 0xb8, 0x98, 0xae, 0xb1, 0x1c, 0x10, 0xb9, 0x45, 0x79, 0x76, 0x4f, 0x9d, 0xc9, 0x33, 0x65, 0x2a, 0x81, 0x03, 0x67, 0x04, 0x76, 0x95, 0x8d, 0x59, 0x86, 0x7a, 0xb2, 0x4a, 0x97, 0x12, 0x84, 0x05, 0x6e, 0x99, 0xc6, 0x48, 0xb7, 0x7e, 0x7a, 0x65, 0x36, 0x44, 0x87, 0x0f, 0xe4, 0xc7, 0xce, 0xf3, 0x7f, 0x90, 0x01, 0x60, 0x48, 0x72, 0xad, 0xed, 0xe1, 0x6a, 0xac, 0xed, 0x8a, 0xa5, 0xdf, 0x42, 0x05, 0x33, 0x04, 0xe4, 0xd1, 0x71, 0x12, 0x0d, 0x7a, 0xb3, 0xce, 0x81, 0xa4, 0xd1, 0xa2, 0x74, 0x98, 0xd1, 0x38, 0x01, 0x8f, 0x66, 0x21, 0xbd, 0xfc, 0x1d, 0x53, 0xe7, 0xf3, 0xc1, 0xa5, 0xaa, 0x5d, 0x62, 0xb0, 0x9a, 0x55, 0x4a, 0x56, 0xf1, 0xed, 0x4f, 0x38, 0x5a, 0x07, 0x68, 0xea, 0xa2, 0xda, 0x0c, 0x9f, 0x56, 0x37, 0x03, 0x4c, 0x2e, 0xef, 0x58, 0xcc, 0x35, 0x17, 0x8b, 0xc2, 0xa6, 0x27, 0x2c, 0xf5, 0x29, 0xb6, 0x5a, 0xdf } +, + /* Signature */ + 129, + { 0x01, 0xe6, 0x3b, 0x86, 0xd0, 0xc1, 0x59, 0x99, 0x09, 0x3d, 0x44, 0x28, 0xaf, 0x7c, 0x6d, 0xe6, 0x48, 0x07, 0x45, 0xd8, 0x19, 0xe4, 0x29, 0x62, 0x3f, 0x47, 0x2b, 0x45, 0xde, 0x61, 0xaa, 0x56, 0x7b, 0x60, 0xd9, 0x94, 0x79, 0x2a, 0x0d, 0x11, 0x65, 0x80, 0x55, 0x98, 0xf4, 0xe2, 0x1f, 0xe6, 0x13, 0x99, 0x9a, 0x96, 0x22, 0x5d, 0x0b, 0xba, 0x98, 0xf9, 0xcf, 0xbe, 0xe8, 0x3a, 0xf5, 0x85, 0xfa, 0x07, 0x84, 0x39, 0xa7, 0x42, 0x51, 0x5a, 0xe2, 0x18, 0xec, 0x31, 0xf8, 0xd5, 0x08, 0xf2, 0x9b, 0x0e, 0x58, 0x75, 0xfc, 0xa8, 0xf0, 0x4f, 0x11, 0xa1, 0xc8, 0x2f, 0x2b, 0xb0, 0xae, 0x52, 0x8f, 0xda, 0xd3, 0xca, 0x50, 0x75, 0xbb, 0x3f, 0x41, 0xbb, 0x57, 0x83, 0x34, 0x81, 0x33, 0xfb, 0xa8, 0xa0, 0xb3, 0xad, 0x95, 0x1a, 0x1a, 0x64, 0x9c, 0xa0, 0xf9, 0x75, 0x8b, 0x20, 0xc8, 0x70, 0xfd } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.18", + /* Message to be signed */ + 184, + { 0x7e, 0xb3, 0xc9, 0x8e, 0x46, 0xfd, 0x1b, 0x5c, 0x9f, 0xf1, 0xb1, 0x1b, 0xe1, 0x61, 0x9b, 0x56, 0x60, 0x57, 0xf2, 0x6c, 0x55, 0xe2, 0x88, 0xf4, 0x84, 0x4c, 0xcd, 0x50, 0xba, 0xa9, 0x1b, 0x03, 0x8d, 0x60, 0x95, 0x83, 0x6f, 0x77, 0x1f, 0xc1, 0xc4, 0x25, 0xfb, 0x53, 0x3e, 0xf2, 0xb1, 0xdc, 0x4a, 0x3e, 0x94, 0x9b, 0xb9, 0x95, 0x25, 0xc2, 0x8f, 0xe8, 0xa3, 0xe9, 0x31, 0x78, 0xf3, 0xa0, 0xac, 0x97, 0xfd, 0x5d, 0xaa, 0x81, 0xb5, 0x92, 0x86, 0x18, 0x8e, 0x17, 0xb4, 0x4b, 0x37, 0x71, 0xbc, 0xa8, 0x55, 0xd8, 0x5f, 0x3c, 0x4d, 0x28, 0x6f, 0x10, 0x68, 0x10, 0xf4, 0xe5, 0x22, 0xea, 0x05, 0x83, 0x4f, 0x11, 0xa3, 0x1e, 0x89, 0xc3, 0x59, 0x90, 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0x0c, 0x5f, 0x6f, 0xa7, 0x07, 0x1f, 0x8f, 0xec, 0xb8, 0x63, 0x1a, 0xa4, 0x14, 0xf5, 0x08, 0x35, 0x03, 0x8b, 0xe7, 0xab, 0x05, 0xa4, 0xb0, 0x50, 0xf3, 0xf5, 0x6e, 0x86 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.19", + /* Message to be signed */ + 184, + { 0x6a, 0x45, 0xee, 0x0b, 0x7e, 0xa8, 0x03, 0x68, 0xb2, 0xc4, 0x29, 0xaf, 0x28, 0x81, 0x53, 0xf4, 0x56, 0xcc, 0x66, 0x32, 0x17, 0xa8, 0xff, 0xcd, 0x2a, 0xa0, 0x5c, 0x5d, 0x32, 0x2d, 0xb7, 0x57, 0x56, 0xcd, 0xbc, 0x0f, 0x68, 0x41, 0x41, 0xfe, 0x6b, 0xca, 0xe1, 0x89, 0xbf, 0x24, 0xde, 0x1c, 0x8e, 0xdd, 0x5b, 0x11, 0x36, 0x44, 0xa4, 0x50, 0x0d, 0x0d, 0x4f, 0xf5, 0x80, 0x08, 0x36, 0x40, 0xe1, 0x2a, 0x2c, 0x95, 0xde, 0x69, 0xe9, 0x59, 0x6b, 0xfb, 0x1d, 0x44, 0x36, 0x57, 0x86, 0xe1, 0x67, 0xd0, 0x25, 0xd8, 0x9e, 0xa2, 0xf8, 0xd1, 0x3a, 0x0e, 0x64, 0x77, 0xf1, 0x3b, 0x85, 0xbb, 0xdc, 0xf1, 0x60, 0x77, 0x4b, 0x18, 0x25, 0x8c, 0xa0, 0xbe, 0xc0, 0xbd, 0x7b, 0xf1, 0x39, 0x11, 0xb3, 0x89, 0x6b, 0x48, 0x89, 0xfa, 0x3d, 0xe0, 0x4a, 0xb2, 0x6b, 0xd6, 0x82, 0xb4, 0xab, 0x43, 0x7c, 0x0c, 0x17, 0xf3, 0x53, 0xa2, 0x3a, 0x43, 0xe9, 0x2e, 0x20, 0xe7, 0xf8, 0x20, 0x69, 0x4e, 0x40, 0x3a, 0xab, 0xdd, 0x5d, 0x19, 0x6e, 0x93, 0x89, 0x5b, 0x47, 0x92, 0x55, 0xdf, 0x40, 0x30, 0xad, 0x8c, 0xe3, 0xa5, 0x3d, 0x15, 0x73, 0xbe, 0x22, 0x6d, 0x81, 0xaa, 0x18, 0xe4, 0x85, 0x89, 0x57, 0xa2, 0xd0, 0xa3, 0x35, 0x9c, 0x2e, 0x7a } +, + /* Signature */ + 129, + { 0x01, 0x64, 0xf0, 0xdb, 0xcd, 0xd9, 0x52, 0x11, 0x86, 0xa2, 0x80, 0x84, 0xa3, 0xf3, 0xae, 0x6a, 0xac, 0xb6, 0x59, 0x6b, 0x85, 0x6e, 0x8a, 0xab, 0x2e, 0x72, 0xa7, 0xf2, 0x33, 0xd6, 0x2d, 0x2d, 0x3e, 0xf1, 0x96, 0xd3, 0x78, 0x7e, 0x4b, 0x04, 0x57, 0x31, 0xda, 0x9c, 0x61, 0x50, 0xad, 0x9d, 0x5f, 0x91, 0x8c, 0x6b, 0x06, 0xc9, 0x2a, 0x11, 0xa0, 0xbf, 0xd5, 0xef, 0xcc, 0xb7, 0xb0, 0x3a, 0x01, 0x07, 0x24, 0x14, 0x39, 0xd3, 0x4d, 0x31, 0x3d, 0x35, 0xb3, 0x6a, 0x0d, 0x8c, 0xa0, 0x81, 0x3c, 0x36, 0x23, 0xb2, 0xbd, 0x78, 0xf2, 0xe3, 0xa9, 0x71, 0x99, 0x64, 0x8d, 0xa3, 0x58, 0x06, 0xff, 0xc5, 0x8e, 0xed, 0x33, 0xac, 0x9f, 0xcf, 0x79, 0x53, 0x8f, 0xa8, 0x89, 0x15, 0xb1, 0xa5, 0x75, 0x85, 0x78, 0xb9, 0xa2, 0xdb, 0x01, 0x38, 0x04, 0xbf, 0x32, 0xe7, 0xa5, 0x6d, 0xc7, 0x24, 0x37 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 8.20", + /* Message to be signed */ + 79, + { 0x92, 0xa4, 0xb4, 0xbc, 0xe3, 0xda, 0xa0, 0xa7, 0xa6, 0x4b, 0x72, 0xad, 0x87, 0x1f, 0x3a, 0xa8, 0xea, 0xb5, 0xac, 0x40, 0x11, 0xaa, 0xae, 0xa2, 0xce, 0xeb, 0xa8, 0x92, 0x77, 0xc6, 0x43, 0x29, 0x57, 0x26, 0x26, 0xc9, 0x56, 0x88, 0x4f, 0x48, 0x54, 0xf8, 0x61, 0x3d, 0x22, 0x51, 0x8b, 0x14, 0xf0, 0x38, 0xfc, 0xaf, 0x9e, 0x68, 0xe1, 0x30, 0x02, 0xfb, 0x0a, 0x00, 0xa7, 0x8c, 0xc2, 0xea, 0x51, 0x44, 0xfc, 0x13, 0x11, 0x76, 0xd5, 0xe5, 0xd6, 0x7e, 0x10, 0x6a, 0x99, 0x87, 0x9c } +, + /* Signature */ + 129, + { 0x01, 0x24, 0xfd, 0x8b, 0x2a, 0xcf, 0x22, 0x37, 0xfc, 0x71, 0xa2, 0xee, 0x97, 0xe2, 0x6a, 0x4d, 0xab, 0x7d, 0xea, 0x82, 0x9e, 0x15, 0xbe, 0xb2, 0xf8, 0xa7, 0x37, 0x91, 0xa0, 0xba, 0x15, 0x2d, 0xa5, 0xb0, 0x6a, 0xdf, 0x34, 0x1d, 0x74, 0x09, 0xe8, 0xd3, 0xd3, 0x17, 0x5b, 0x51, 0x01, 0x34, 0x32, 0x5a, 0x35, 0x32, 0x97, 0xa8, 0xd6, 0xd6, 0x6c, 0x09, 0x70, 0x03, 0x22, 0xee, 0xc5, 0xe3, 0x3f, 0x62, 0x48, 0x6a, 0x21, 0x11, 0x30, 0xd7, 0x4c, 0x70, 0xdd, 0x92, 0x5d, 0xf8, 0x60, 0x2a, 0xe3, 0xc4, 0xc6, 0xcc, 0xaf, 0x93, 0xcc, 0x9a, 0x97, 0x0d, 0x1e, 0x85, 0x32, 0x60, 0xee, 0xc6, 0x94, 0x81, 0xc5, 0xf1, 0x33, 0x7e, 0x9d, 0xd3, 0xae, 0xda, 0x88, 0xd8, 0x82, 0x99, 0xbe, 0x08, 0x09, 0x5b, 0x71, 0x5a, 0x5b, 0x21, 0x66, 0xe6, 0x17, 0xc9, 0x26, 0x72, 0x2c, 0xed, 0xd6, 0xef, 0x34 } + +} +, +} +}, +{ + "Example 9: A 1027-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x05, 0xf3, 0x74, 0x34, 0x88, 0x26, 0x1c, 0x6f, 0x06, 0x25, 0xe4, 0x32, 0xfa, 0x6e, 0xb8, 0x7f, 0xb1, 0x2b, 0x26, 0x21, 0x82, 0x90, 0xbf, 0xe3, 0x96, 0xba, 0x76, 0xea, 0x42, 0x61, 0x32, 0x2f, 0x81, 0x43, 0xe4, 0xb4, 0xeb, 0xcd, 0x5d, 0x2a, 0xe1, 0x9b, 0x0f, 0x9d, 0x8d, 0xcd, 0x2f, 0xc7, 0xe6, 0x82, 0x32, 0x08, 0xa7, 0x51, 0x83, 0x3d, 0x3b, 0x4e, 0x8e, 0x38, 0x7c, 0x39, 0xf8, 0xed, 0x6b, 0xbc, 0x9f, 0xda, 0xec, 0x32, 0xd3, 0xea, 0x9a, 0xbb, 0xff, 0x57, 0x47, 0x23, 0xf3, 0xf1, 0x22, 0x99, 0x90, 0x96, 0x3e, 0xa4, 0xfd, 0x9f, 0xb5, 0x44, 0xf6, 0x42, 0x90, 0xaa, 0x2e, 0xa7, 0xda, 0x63, 0x11, 0x91, 0xa2, 0x0d, 0xbc, 0x94, 0x23, 0xb4, 0x61, 0x23, 0x3b, 0x93, 0x72, 0x49, 0xf2, 0xf4, 0xea, 0x10, 0x92, 0x8f, 0xae, 0x2a, 0x6f, 0xe6, 0x64, 0xf1, 0x2c, 0x09, 0x23, 0xed, 0x11 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 129, + { 0x01, 0x4c, 0xc3, 0x26, 0x32, 0x52, 0xf8, 0xc4, 0xfb, 0x77, 0xcd, 0x57, 0xa1, 0x42, 0x0c, 0x04, 0xc0, 0x43, 0x27, 0x8a, 0x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 0x52, 0xf1, 0x70, 0x9f, 0xf4, 0x74, 0x37, 0x40, 0x85, 0x81, 0x88, 0x8a, 0x9d, 0xa1, 0x09, 0x17, 0xc5, 0xb5, 0xab, 0xaf, 0x91, 0x46, 0x10, 0x9f, 0xda, 0xc6, 0x94, 0x76, 0x6f, 0x4c, 0x8f, 0xb0, 0x57, 0x96, 0x8e, 0x84, 0x8d, 0x99, 0x58, 0x6b, 0x05, 0xf8, 0xa0, 0x2f, 0xba, 0x6c, 0xa1, 0xeb, 0x12, 0xba, 0x08, 0xdf, 0xd4, 0x9b, 0x62, 0xc2, 0x7a, 0x8f, 0x15, 0xf4, 0x33 } +, + /* Prime exponent 1 */ + 65, + { 0x01, 0x22, 0x7f, 0x36, 0xdc, 0x6b, 0x14, 0x27, 0x89, 0xfc, 0xaa, 0xa7, 0x12, 0x8b, 0xdf, 0x14, 0xfe, 0xd7, 0x90, 0x16, 0x04, 0x07, 0xfb, 0xbc, 0xdf, 0xbd, 0xa7, 0xe9, 0x88, 0x97, 0x18, 0x31, 0x81, 0x12, 0xae, 0x81, 0x6a, 0x28, 0xb0, 0x2d, 0x4a, 0x0b, 0x03, 0xdc, 0x8b, 0xfd, 0xd4, 0xff, 0xc6, 0xbb, 0x67, 0xf8, 0xe4, 0x65, 0x1a, 0x8f, 0xb0, 0xb3, 0x9d, 0x70, 0x96, 0xb7, 0x67, 0xf6, 0xfd } +, + /* Prime exponent 2 */ + 65, + { 0x02, 0x25, 0xec, 0x05, 0x3c, 0xe8, 0xda, 0x6f, 0x86, 0xad, 0xe3, 0x6b, 0xd2, 0xbf, 0x43, 0x93, 0x02, 0x91, 0x37, 0x5b, 0x1b, 0x1a, 0x51, 0xd4, 0x7d, 0x0b, 0x11, 0xa5, 0x17, 0x8a, 0x26, 0x83, 0x34, 0xf7, 0xe1, 0x94, 0x92, 0x1b, 0xb1, 0xd7, 0x5f, 0xea, 0x7f, 0x56, 0xc5, 0xaa, 0xcd, 0x05, 0x8d, 0xb3, 0x7d, 0x36, 0x08, 0x2e, 0xac, 0xe4, 0x83, 0x4b, 0x07, 0xbf, 0x7b, 0xdd, 0xea, 0xb4, 0xb7 } +, + /* Coefficient */ + 65, + { 0x02, 0x0b, 0xd0, 0xf5, 0x15, 0x80, 0x87, 0xed, 0xe3, 0x8c, 0xb5, 0xdc, 0x66, 0xe4, 0x01, 0x0a, 0xe4, 0xe4, 0x8c, 0xc0, 0x04, 0x2e, 0x15, 0x2c, 0xd5, 0xee, 0xb0, 0x51, 0xc9, 0xec, 0x45, 0xad, 0x23, 0x40, 0x24, 0x53, 0x52, 0xc0, 0x1d, 0x94, 0xc6, 0xa5, 0x26, 0xaa, 0x5a, 0x45, 0x4c, 0xdb, 0xae, 0xac, 0x85, 0x95, 0x34, 0x9b, 0xbe, 0x6a, 0x8d, 0x55, 0x19, 0xa3, 0xc9, 0xb7, 0xd0, 0x7c, 0x3a } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 9.1", + /* Message to be signed */ + 13, + { 0x82, 0xe5, 0xc5, 0xaa, 0xe6, 0x4e, 0x60, 0x8b, 0x27, 0x50, 0x4b, 0x91, 0xdb } +, + /* Signature */ + 129, + { 0x01, 0x45, 0x82, 0xda, 0xe9, 0x35, 0xe6, 0xb2, 0xae, 0xff, 0x7d, 0x72, 0x50, 0x89, 0xda, 0xb0, 0x58, 0xc6, 0x78, 0xb2, 0xee, 0x28, 0xbc, 0xd4, 0x44, 0xa7, 0x2b, 0xdf, 0xac, 0x31, 0x46, 0x3e, 0x18, 0xe9, 0x4d, 0x7b, 0x5e, 0xcc, 0x84, 0xa4, 0x31, 0x69, 0x6a, 0x1c, 0xdd, 0x79, 0xf9, 0xc0, 0x8c, 0x33, 0xe1, 0xd4, 0xb3, 0x22, 0xdd, 0x27, 0x7b, 0x50, 0x3a, 0xe6, 0xe4, 0xf9, 0xc3, 0x15, 0x30, 0x5b, 0x43, 0x72, 0xfe, 0x45, 0xfe, 0x4a, 0x7e, 0xbb, 0xfc, 0x4a, 0xe5, 0x90, 0xfa, 0x3c, 0x52, 0x0b, 0xf8, 0x28, 0x15, 0x8f, 0x78, 0x20, 0x29, 0x9f, 0x09, 0xb1, 0x34, 0xed, 0xe1, 0x17, 0xb6, 0x72, 0xa1, 0xea, 0xc2, 0xf0, 0x50, 0xc0, 0x44, 0xb2, 0x55, 0xca, 0x8d, 0x45, 0x52, 0xd4, 0xb5, 0xf3, 0xf5, 0x7b, 0x87, 0x34, 0xdb, 0x24, 0x74, 0x50, 0x07, 0x44, 0xa5, 0x33, 0x75, 0x00, 0x5e } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.2", + /* Message to be signed */ + 104, + { 0x77, 0xe0, 0xfb, 0xdc, 0xd6, 0xe0, 0x49, 0x8f, 0xc5, 0x68, 0x4f, 0xf1, 0x3d, 0x4c, 0x9f, 0x5b, 0x78, 0x0e, 0x77, 0xe2, 0x46, 0x46, 0x37, 0xff, 0x66, 0xea, 0xa2, 0xd7, 0xd9, 0xc3, 0xde, 0xfb, 0x9b, 0x0e, 0x3a, 0x38, 0x37, 0x73, 0xdb, 0x97, 0xa4, 0xfb, 0x49, 0x1b, 0xeb, 0x21, 0x14, 0xfd, 0xea, 0x2c, 0x2a, 0x48, 0x0f, 0xfc, 0x21, 0x9b, 0x79, 0x6a, 0xd8, 0x05, 0xd5, 0x4f, 0xbe, 0xc1, 0x7d, 0xcb, 0x34, 0xb1, 0xda, 0x17, 0x96, 0xcb, 0x9c, 0xd5, 0xf2, 0x41, 0x6a, 0xb5, 0xe7, 0x66, 0xf8, 0xe0, 0x06, 0x91, 0x8e, 0xbe, 0xc1, 0x82, 0x29, 0x98, 0xa2, 0x8f, 0xff, 0xa6, 0x23, 0x0c, 0x07, 0x87, 0x26, 0xfb, 0xa2, 0xe4, 0xa7, 0xb0 } +, + /* Signature */ + 129, + { 0x05, 0x93, 0x27, 0xce, 0xe7, 0x26, 0xff, 0xb6, 0x03, 0xe8, 0xa9, 0xfc, 0xd5, 0x74, 0xab, 0xa9, 0xcb, 0xdf, 0xc3, 0x6c, 0x0a, 0xa6, 0x6f, 0xcf, 0xe3, 0x55, 0x5c, 0xf2, 0xef, 0x35, 0x82, 0xd3, 0x22, 0x0d, 0xf9, 0xd6, 0xbf, 0x8a, 0x78, 0xe3, 0xff, 0xf0, 0xc1, 0x29, 0xb3, 0xab, 0xb3, 0xdc, 0x71, 0x21, 0x12, 0xa2, 0x05, 0x6b, 0xca, 0x08, 0x63, 0x65, 0x54, 0xc1, 0xac, 0x57, 0xdf, 0x87, 0xf3, 0x66, 0x41, 0x52, 0x68, 0x8c, 0x6a, 0xc7, 0x2e, 0x6b, 0x88, 0xf5, 0x63, 0x7c, 0xd7, 0x3f, 0x16, 0x69, 0x89, 0xc8, 0x29, 0x09, 0xfb, 0x67, 0xbc, 0x1f, 0xa2, 0xe2, 0xd5, 0x23, 0xe5, 0x1c, 0x91, 0x8f, 0x2b, 0xbe, 0xc1, 0xd7, 0x52, 0x02, 0xaf, 0x24, 0x0a, 0x61, 0xcd, 0x2d, 0xcc, 0x55, 0x5c, 0xae, 0xae, 0x9a, 0x68, 0x57, 0x0d, 0x77, 0x81, 0x0c, 0xf1, 0xdf, 0x81, 0x23, 0xff, 0x41, 0xc0 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.3", + /* Message to be signed */ + 116, + { 0x0d, 0xfa, 0x5b, 0xaa, 0x1c, 0xdd, 0xb8, 0x34, 0x70, 0x7a, 0x5f, 0x8c, 0xc6, 0xec, 0xe5, 0x71, 0xa7, 0xa7, 0xfc, 0xa5, 0x67, 0x63, 0x62, 0xd2, 0xb2, 0x37, 0x41, 0xa9, 0x57, 0x0a, 0xe2, 0x63, 0x8f, 0x6b, 0x1c, 0x23, 0x89, 0x85, 0x36, 0x75, 0xcc, 0xc6, 0xcc, 0x1b, 0x4c, 0x6d, 0xae, 0x23, 0xcd, 0xa7, 0x1a, 0xb9, 0x6b, 0x5a, 0x2f, 0x22, 0x14, 0x57, 0x50, 0x43, 0x3e, 0x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a, 0x2b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.4", + /* Message to be signed */ + 45, + { 0x16, 0x7e, 0x79, 0x56, 0x8c, 0x77, 0x36, 0x69, 0x0c, 0x3b, 0xed, 0xbb, 0xc8, 0xd4, 0x24, 0xeb, 0x53, 0x6a, 0x12, 0x85, 0x5a, 0x60, 0xcd, 0xb1, 0x0f, 0x94, 0xba, 0x11, 0x23, 0x17, 0xe9, 0x17, 0xa1, 0xb7, 0xd6, 0xfc, 0xfa, 0xa3, 0x43, 0x8d, 0x68, 0xee, 0x09, 0xfd, 0x47 } +, + /* Signature */ + 129, + { 0x02, 0x9a, 0x2b, 0x90, 0x86, 0x14, 0xed, 0x7a, 0x5f, 0xab, 0x72, 0xf2, 0xa1, 0xc8, 0xe5, 0x48, 0xb6, 0xf8, 0xb8, 0xb4, 0x5b, 0x75, 0x81, 0xfd, 0x24, 0x51, 0xfe, 0x45, 0xa6, 0x22, 0xfa, 0x0f, 0x08, 0xdd, 0x0b, 0xa2, 0xe8, 0xf3, 0xc4, 0x17, 0x20, 0x1e, 0xa0, 0x27, 0x79, 0x10, 0x18, 0x4f, 0x37, 0x6d, 0xa8, 0x03, 0xfa, 0x72, 0xc5, 0x0d, 0x39, 0xbe, 0x28, 0x82, 0x52, 0x6d, 0x1e, 0x85, 0xdf, 0x9a, 0xb1, 0x79, 0x75, 0x76, 0x4a, 0xcf, 0xb2, 0x07, 0x36, 0x6f, 0x6c, 0xd2, 0xc8, 0xb1, 0x36, 0xa9, 0x99, 0xda, 0xaf, 0x48, 0xf1, 0xc0, 0x8a, 0x9e, 0xa1, 0xf0, 0x84, 0x25, 0xc2, 0x1b, 0x65, 0x41, 0x80, 0xda, 0x4a, 0xdf, 0x10, 0x9b, 0x4b, 0xc5, 0xb8, 0x17, 0xdd, 0x67, 0xbf, 0x7d, 0xaa, 0xb4, 0xa3, 0x84, 0x03, 0x4a, 0xb4, 0xad, 0xe6, 0x94, 0x89, 0x8c, 0xfc, 0x27, 0x2a, 0xb6, 0x53 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.5", + /* Message to be signed */ + 229, + { 0x0d, 0x03, 0xf7, 0x12, 0x84, 0xf2, 0xe4, 0x83, 0x24, 0x2d, 0x92, 0x3f, 0xd1, 0xe1, 0x53, 0xbc, 0x16, 0x0f, 0x0c, 0xdc, 0x2c, 0x0b, 0x76, 0xf1, 0xbc, 0x2c, 0xf7, 0xd1, 0xbe, 0x9c, 0xcc, 0x7f, 0xaf, 0xa6, 0xaf, 0xc3, 0x90, 0x34, 0x01, 0x84, 0x09, 0xcc, 0xfd, 0x16, 0x28, 0xa7, 0x0b, 0x35, 0x83, 0x33, 0xbd, 0x96, 0xee, 0xd3, 0xad, 0xf3, 0x14, 0x2b, 0x17, 0x60, 0xbf, 0x8a, 0x9b, 0xb1, 0x9e, 0xa2, 0x47, 0x3a, 0x2e, 0xd8, 0x5c, 0x91, 0xcd, 0x5f, 0x0a, 0x5f, 0x2d, 0x46, 0x32, 0xd6, 0x17, 0x64, 0x19, 0xfa, 0x1d, 0x8c, 0xc8, 0x8b, 0x67, 0x08, 0x47, 0x77, 0x11, 0xea, 0x49, 0x58, 0xa8, 0x39, 0x01, 0xfe, 0xf2, 0x84, 0xf5, 0xa6, 0xc5, 0x02, 0x79, 0x8c, 0x8b, 0xd0, 0xa3, 0x50, 0xf2, 0xea, 0x83, 0xed, 0x18, 0x1e, 0xb9, 0x70, 0xd3, 0x0b, 0x78, 0x13, 0x4c, 0x8e, 0x1d, 0x64, 0xf0, 0xd1, 0x49, 0x5b, 0x70, 0x17, 0x24, 0x5f, 0xa6, 0x9b, 0xd5, 0x74, 0x27, 0xf7, 0x49, 0x20, 0xba, 0x0e, 0xed, 0xe9, 0xcb, 0xa3, 0x4e, 0xb2, 0x22, 0x76, 0xb0, 0xf2, 0x74, 0x13, 0xba, 0x3f, 0x0d, 0xa8, 0xeb, 0xde, 0xdb, 0x9b, 0x0c, 0x80, 0x0e, 0x44, 0x48, 0x1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24, 0x42, 0xa4, 0xd8, 0xe5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.6", + /* Message to be signed */ + 222, + { 0x4a, 0xca, 0x96, 0x3f, 0x14, 0xac, 0xf6, 0xa7, 0x9c, 0x51, 0x08, 0x1e, 0xf2, 0x57, 0x16, 0x66, 0x71, 0xe3, 0xb4, 0x5f, 0xee, 0x31, 0x24, 0x07, 0xba, 0x3c, 0xf6, 0xd7, 0x11, 0xab, 0xa1, 0xae, 0x25, 0xa4, 0xa8, 0xba, 0x45, 0x48, 0x19, 0xa3, 0x91, 0x2a, 0x31, 0x2e, 0x99, 0x0f, 0x1f, 0xa7, 0x4c, 0xbc, 0xb7, 0x27, 0x77, 0xf1, 0xc7, 0xc6, 0x63, 0xa2, 0xd1, 0xcd, 0xb2, 0xc5, 0xc0, 0x07, 0x4d, 0x45, 0x16, 0xf4, 0x87, 0x17, 0xde, 0x14, 0x03, 0xe8, 0xff, 0x7d, 0x0f, 0x9d, 0xe7, 0xc7, 0xc8, 0x51, 0xf3, 0xe3, 0x51, 0x16, 0x8b, 0xa6, 0xc4, 0x14, 0xbe, 0xd5, 0xd4, 0x2b, 0xae, 0x52, 0x7b, 0x72, 0x4c, 0xeb, 0x83, 0x4d, 0x79, 0xba, 0xcf, 0x70, 0x2c, 0x56, 0xa6, 0x23, 0xc1, 0x68, 0x80, 0x87, 0xdc, 0x9d, 0xe9, 0x53, 0x8e, 0xa7, 0xc7, 0xc7, 0x61, 0xcd, 0x2f, 0xd5, 0x78, 0xf0, 0xdc, 0x3f, 0x55, 0x2f, 0xfb, 0xd4, 0xaf, 0xc7, 0xf4, 0xec, 0x71, 0x22, 0xfd, 0xec, 0x1a, 0x3a, 0x2b, 0x10, 0x4d, 0x53, 0x2d, 0xb8, 0x1c, 0xb9, 0x14, 0x18, 0x54, 0xd5, 0x7d, 0xcf, 0x54, 0xb7, 0x56, 0x01, 0xa9, 0x05, 0xfa, 0xed, 0xa6, 0x5c, 0x2a, 0x7a, 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} +, +{ + "PKCS#1 v1.5 Signature Example 9.7", + /* Message to be signed */ + 4, + { 0xa7, 0x5a, 0x45, 0x80 } +, + /* Signature */ + 129, + { 0x00, 0x4f, 0xe4, 0xc5, 0xd9, 0x14, 0x3c, 0x85, 0x1e, 0x46, 0x16, 0x7c, 0xc1, 0x81, 0x57, 0x5c, 0x07, 0x5e, 0x69, 0xb9, 0x81, 0xf9, 0xc1, 0x03, 0xf9, 0xd9, 0xb0, 0x11, 0xff, 0x8b, 0x29, 0xba, 0x55, 0xa4, 0x31, 0x87, 0xce, 0x87, 0x77, 0x99, 0x63, 0x17, 0xa0, 0x3c, 0x9d, 0x90, 0xaf, 0xc1, 0x89, 0x0a, 0x9a, 0xde, 0xec, 0x8e, 0xac, 0x08, 0x7f, 0x99, 0xb8, 0x15, 0xe6, 0xeb, 0x2b, 0x87, 0x1d, 0xcd, 0xdc, 0x80, 0x92, 0x24, 0x9d, 0x8f, 0x51, 0x3c, 0x6c, 0x56, 0x09, 0xfd, 0xae, 0x2c, 0xfc, 0x6b, 0xf0, 0x1f, 0xcb, 0x80, 0x25, 0xa4, 0xf7, 0x9b, 0xf1, 0x2a, 0xa8, 0xe1, 0x09, 0x82, 0x9a, 0x0b, 0xb3, 0x8a, 0x09, 0xd1, 0xa3, 0x93, 0x65, 0xe0, 0x40, 0x56, 0x52, 0xda, 0xe4, 0x51, 0xe5, 0xc3, 0x29, 0x8f, 0x47, 0x04, 0x05, 0x98, 0xec, 0xd7, 0x0e, 0x4b, 0x40, 0x33, 0x89, 0xbc, 0xd5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.8", + /* Message to be signed */ + 109, + { 0x7c, 0xfc, 0x00, 0xa6, 0x43, 0xae, 0x99, 0x79, 0x68, 0x01, 0xee, 0x3c, 0xeb, 0xe2, 0xcb, 0xb1, 0xa6, 0xbe, 0x1c, 0xac, 0x15, 0xc6, 0x48, 0xd4, 0xba, 0x33, 0x01, 0x29, 0x38, 0x71, 0xa9, 0x9f,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 0x9a, 0x6d, 0x32, 0x9c, 0x19, 0xf3, 0x6c, 0xa7, 0x53, 0x81, 0xb9, 0x35, 0x0d, 0x34, 0x38, 0x9c, 0x16, 0xe1, 0x80, 0xa8, 0x51, 0xe4, 0x57, 0xcd } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.9", + /* Message to be signed */ + 206, + { 0x3d, 0x90, 0xde, 0x72, 0x35, 0x51, 0x59, 0x49, 0x24, 0x5f, 0x49, 0x03, 0x68, 0xc1, 0xf4, 0x93, 0x83, 0xe4, 0x4c, 0x1d, 0xb5, 0x1d, 0xd5, 0x38, 0x5b, 0xdf, 0xf5, 0xbd, 0x34, 0x45, 0x0e, 0x63, 0xce, 0x42, 0x15, 0x0b, 0x44, 0x1e, 0xf9, 0xeb, 0xc7, 0x29, 0xa9, 0x03, 0x34, 0x53, 0xf0, 0xa9, 0x39, 0x9f, 0xf6, 0x86, 0x1f, 0x50, 0x65, 0xb6, 0x66, 0x6d, 0xc2, 0x0b, 0x28, 0x72, 0x03, 0x42, 0x8e, 0x72, 0xbd, 0xf4, 0xcb, 0x74, 0x8a, 0xc8, 0xd4, 0xa5, 0x5f, 0x43, 0xd2, 0x23, 0x5e, 0x0a, 0xb2, 0xec, 0x2c, 0xf2, 0xb0, 0x6a, 0x01, 0x5f, 0x41, 0xe3, 0x51, 0x68, 0xac, 0x7e, 0x3c, 0x56, 0x8f, 0x2f, 0x16, 0xef, 0x57, 0x28, 0xb2, 0xbe, 0x95, 0x24, 0x91, 0x9d, 0x36, 0x76, 0xd6, 0x8f, 0x53, 0x7e, 0xfe, 0xf2, 0x9a, 0x05, 0xaf, 0x97, 0xcf, 0xed, 0x7c, 0xe9, 0xec, 0x45, 0xc1, 0x2f, 0x16, 0x5e, 0x4d, 0x7a, 0x4f, 0xe7, 0x2b, 0x99, 0xea, 0xbf, 0x83, 0x31, 0x6c, 0xdf, 0x2b, 0xd1, 0x64, 0x4b, 0x82, 0xfa, 0x13, 0xe4, 0xff, 0xc4, 0x49, 0xe7, 0x6d, 0x44, 0xc3, 0x87, 0x69, 0x63, 0x51, 0x47, 0x8b, 0x1a, 0x0f, 0x85, 0x96, 0x15, 0xda, 0x90, 0x5f, 0x20, 0xe6, 0x8b, 0x24, 0x56, 0x5c, 0x87, 0x3f, 0x83, 0x4e, 0x59, 0x34, 0x58, 0x51, 0x8a, 0xde, 0x41, 0xc1, 0x42, 0x81, 0x74, 0xda, 0x0c, 0x47, 0x66, 0x3a, 0x76, 0x00, 0xc6, 0x50, 0x25, 0x01, 0x5e, 0x09, 0xc1 } +, + /* Signature */ + 129, + { 0x00, 0x98, 0x13, 0xb2, 0xfd, 0xc5, 0x1b, 0xff, 0x88, 0xde, 0xdb, 0xec, 0xa3, 0xb1, 0x4a, 0xe5, 0x8b, 0xc7, 0xe7, 0x14, 0xc1, 0xd9, 0x2d, 0x74, 0x26, 0xe4, 0x94, 0x4e, 0xf9, 0x3e, 0xf9, 0xce, 0x6d, 0x10, 0xdc, 0x98, 0x9e, 0xaf, 0xe7, 0x34, 0x8d, 0x0a, 0x95, 0xf9, 0x9f, 0x56, 0x94, 0x8f, 0x72, 0x60, 0x2a, 0xc5, 0xe8, 0x61, 0x4f, 0x6b, 0x38, 0xe6, 0x8d, 0xa7, 0x9f, 0x48, 0xe2, 0x76, 0x8e, 0xda, 0x58, 0x64, 0xcf, 0xf2, 0x54, 0x51, 0x37, 0xf3, 0xcf, 0x4d, 0x81, 0xa5, 0xae, 0xb8, 0x9b, 0x21, 0x07, 0x26, 0x74, 0xca, 0xeb, 0xa0, 0x00, 0x71, 0x00, 0xc0, 0x7e, 0xf4, 0xdc, 0xbb, 0xd0, 0x5a, 0xfb, 0xad, 0x9e, 0x8b, 0x30, 0xd7, 0x46, 0xea, 0x36, 0x0d, 0x6c, 0xf8, 0x75, 0xd1, 0x0a, 0x67, 0xa5, 0x7f, 0x4b, 0x5d, 0xf4, 0x12, 0x1d, 0x72, 0x97, 0xa4, 0xbd, 0xce, 0x12, 0x8c, 0xb5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.10", + /* Message to be signed */ + 253, + { 0x20, 0xe6, 0xa3, 0xfe, 0x16, 0xb5, 0x21, 0xb3, 0xc1, 0xe6, 0xae, 0x99, 0x3e, 0xc6, 0xe8, 0x49, 0xa9, 0xc1, 0x1f, 0x20, 0x42, 0xa2, 0xd4, 0xce, 0x89, 0xcf, 0x0f, 0x99, 0xe1, 0xb4, 0xb9, 0x47, 0x1d, 0xa9, 0xa1, 0x73, 0x0d, 0xa8, 0x85, 0x1f, 0xc5, 0xab, 0x3c, 0x09, 0x22, 0x05, 0x5f, 0x00, 0x37, 0x58, 0xb2, 0x35, 0xc2, 0x8d, 0xe4, 0x08, 0x80, 0x66, 0x3f, 0xcd, 0x80, 0x14, 0x07, 0x18, 0x15, 0xdd, 0x06, 0x49, 0x4a, 0x54, 0x7c, 0xce, 0xc3, 0x34, 0x8e, 0x12, 0xd5, 0x38, 0xd5, 0xdf, 0xb4, 0x8f, 0x80, 0x7b, 0x59, 0xe9, 0xb7, 0xcd, 0x81, 0xf3, 0x91, 0xc0, 0x2c, 0x01, 0x6c, 0xd9, 0xc1, 0xa8, 0x4f, 0x9c, 0x59, 0x51, 0x79, 0xd8, 0xf2, 0x00, 0x24, 0x2a, 0x56, 0x68, 0x18, 0x2c, 0xf2, 0xcb, 0xa3, 0xb9, 0xfb, 0x6e, 0xad, 0x45, 0x1d, 0x6d, 0x27, 0xd9, 0xc7, 0x36, 0x15, 0x25, 0xd6, 0x88, 0xb5, 0x52, 0x33, 0xff, 0x45, 0x29, 0x1c, 0xc0, 0x74, 0x02, 0xd2, 0x92, 0xde, 0x0b, 0xe8, 0x3d, 0x16, 0x46, 0xc4, 0x3c, 0x28, 0x88, 0x1f, 0xd4, 0x55, 0x49, 0xb1, 0x4d, 0x12, 0x61, 0xb1, 0x2f, 0x12, 0x04, 0x38, 0x27, 0x6c, 0x6b, 0x3f, 0x98, 0xf5, 0x5b, 0xcf, 0x17, 0x80,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, 0xfc, 0x17, 0x8a, 0xb2, 0xcb, 0x9f, 0xf8, 0xbd, 0xdd, 0xc1, 0x04, 0x6b, 0x08, 0xe0, 0x47, 0xba, 0xdd, 0xd6, 0x5a, 0x45, 0xa4, 0xe6, 0x53, 0x39, 0xd7, 0x25 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.11", + /* Message to be signed */ + 159, + { 0x6e, 0xb4, 0x9f, 0x8a, 0xbc, 0x5b, 0x49, 0x48, 0x72, 0x0a, 0x7f, 0x42, 0xf7, 0x40, 0x84, 0x78, 0x00, 0x22, 0xe0, 0xe9, 0xf9, 0xf6, 0x88, 0x86, 0xd9, 0xf3, 0x4e, 0x7f, 0x7f, 0x8a, 0xc1, 0x54, 0xdb, 0xe1, 0x9c, 0x91, 0xb8, 0xed, 0x38, 0xec, 0x03, 0x6b, 0x61, 0x42, 0x12, 0xca, 0x35, 0xf7, 0x9e, 0xd8, 0x74, 0x57, 0x9e, 0x24, 0x85, 0xda, 0xc8, 0x20, 0x5d, 0x0e, 0x56, 0xb4, 0xb4, 0xc0, 0x00, 0x0a, 0x8a, 0x75, 0xa6, 0xd4, 0x97, 0xfc, 0x51, 0x19, 0x11, 0x1a, 0x40, 0xdb, 0x51, 0x3d, 0xf6, 0x61, 0x96, 0x55, 0xb5, 0x8a, 0x11, 0x6f, 0xab, 0xee, 0x08, 0x2b, 0xfa, 0x79, 0x37, 0x3d, 0x91, 0x76, 0x56, 0x87, 0x10, 0x11, 0x24, 0x18, 0x87, 0xf4, 0x42, 0x60, 0x8b, 0xd1, 0xeb, 0x1d, 0x95, 0xd1, 0x76, 0x80, 0x65, 0xfa, 0x63, 0x32, 0x4f, 0xab, 0x27, 0x36, 0xf9, 0x22, 0x70, 0x5c, 0xf2, 0x89, 0xfd, 0xe9, 0x26, 0x74, 0x33, 0x85, 0x92, 0x07, 0xa8, 0xbc, 0xf1, 0x2d, 0x17, 0x86, 0x1c, 0xfd, 0x06, 0x2b, 0x88, 0xdf, 0x78, 0x87, 0x0d, 0x5a, 0x5e, 0x91, 0x13, 0x1b, 0x63 } +, + /* Signature */ + 129, + { 0x02, 0xa2, 0xfa, 0x32, 0x71, 0x77, 0x96, 0x71, 0x0b, 0x52, 0xb0, 0x51, 0x90, 0x6c, 0xdb, 0x98, 0x15, 0xb2, 0xd0, 0x36, 0x6c, 0x07, 0x0a, 0x78, 0xff, 0x72, 0xd4, 0x59, 0x42, 0xd7, 0xad, 0xde, 0xae, 0x7e, 0xdc, 0x73, 0xca, 0x93, 0x01, 0xf1, 0xf9, 0xfa, 0xe6, 0x8a, 0x0b, 0xd4, 0xb1, 0xdf, 0x05, 0xa9, 0xa6, 0x71, 0xf8, 0xa5, 0xb7, 0xd4, 0x5c, 0xd1, 0x1f, 0xdc, 0x0f, 0x0b, 0xa0, 0x9d, 0x25, 0xce, 0xc3, 0xb6, 0x30, 0x3d, 0x9a, 0x66, 0x6c, 0x76, 0x32, 0x64, 0x96, 0xea, 0x31, 0xae, 0x38, 0x86, 0xa0, 0xc3, 0xb7, 0xd2, 0x27, 0x62, 0xee, 0xa2, 0x78, 0x93, 0x4b, 0x96, 0xa4, 0xf9, 0x0a, 0x50, 0x1a, 0xd3, 0x08, 0x8f, 0x70, 0x2e, 0x14, 0x76, 0x3c, 0xe3, 0x38, 0x46, 0xe2, 0xfd, 0xbe, 0x6d, 0x66, 0x1c, 0xb8, 0x2e, 0x6d, 0x98, 0x9d, 0xf3, 0xc5, 0xac, 0x8f, 0xe4, 0x0a, 0x85, 0x62 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.12", + /* Message to be signed */ + 76, + { 0x45, 0xcf, 0xec, 0x13, 0x2e, 0xe5, 0x93, 0xf0, 0xc3, 0xf3, 0x81, 0x3d, 0x3c, 0xb4, 0x49, 0xe6, 0xe5, 0xe6, 0x1d, 0x13, 0xde, 0x52, 0x9a, 0xe3, 0xe7, 0x1c, 0x99, 0x8e, 0xa4, 0x56, 0x35, 0x9c, 0xe6, 0x6b, 0x82, 0x04, 0x5b, 0x7a, 0xc7, 0x97, 0xfe, 0x96, 0x98, 0x5d, 0xea, 0xbc, 0x51, 0x22, 0x53, 0x0b, 0x2e, 0x29, 0xef, 0xc9, 0x75, 0xee, 0x96, 0x03, 0xb4, 0xf9, 0x6f, 0x3f, 0xf4, 0xe5, 0x9b, 0x0e, 0x35, 0xa9, 0xad, 0x92, 0xf2, 0xb8, 0x67, 0x79, 0x4d, 0x8e } +, + /* Signature */ + 129, + { 0x03, 0x9b, 0xe4, 0x8f, 0x13, 0x3a, 0xe7, 0xf0, 0xb1, 0x9e, 0xdd, 0xb2, 0x13, 0x56, 0x09, 0x73, 0xa3, 0xe2, 0xa1, 0x14, 0x6c, 0x79, 0x42, 0xf8, 0x26, 0x4b, 0xba, 0x5a, 0xd0, 0x08, 0x69, 0x2d, 0x11, 0x38, 0x01, 0xfc, 0x27, 0x78, 0xa7, 0xe3, 0x3a, 0x9e, 0x11, 0x5e, 0xa6, 0x32, 0xe5, 0x01, 0x88, 0xc8, 0x7b, 0x69, 0xe8, 0xd4, 0xd8, 0xcc, 0xa4, 0x8a, 0xbf, 0x9f, 0x25, 0x1e, 0xfc, 0x00, 0x17, 0xb9, 0x9e, 0xde, 0xe5, 0x66, 0xdc, 0xdc, 0x0b, 0xc5, 0x8d, 0xbf, 0x6d, 0x67, 0xbf, 0x86, 0x3d, 0xb8, 0xa8, 0x9a, 0xbd, 0xf1, 0x2a, 0x77, 0xf1, 0xb7, 0x0d, 0xe4, 0x39, 0xd1, 0x76, 0xf2, 0xea, 0xad, 0xa5, 0x46, 0x4c, 0x79, 0xa5, 0x84, 0x27, 0x0c, 0xa5, 0x14, 0xf4, 0x8f, 0x1d, 0xae, 0x86, 0x78, 0xec, 0xf1, 0xac, 0x29, 0x6d, 0x07, 0xc4, 0x68, 0x98, 0xba, 0xd4, 0x1a, 0xcb, 0x19, 0x9d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.13", + /* Message to be signed */ + 26, + { 0x22, 0x51, 0x29, 0x87, 0x15, 0x7c, 0xf9, 0xb9, 0xab, 0x4e, 0x53, 0x37, 0xb0, 0x98, 0x91, 0xd6, 0x3c, 0xec, 0x37, 0x43, 0xc0, 0xf7, 0xbc, 0x9d, 0x18, 0x2e } +, + /* Signature */ + 129, + { 0x02, 0xc7, 0x75, 0x7f, 0x99, 0x93, 0xef, 0x8c, 0x6d, 0x60, 0xa3, 0xf5, 0xab, 0xed, 0xce, 0xa5, 0x35, 0xdf, 0xf5, 0x5a, 0xb9, 0xf4, 0xf6, 0x2d, 0x12, 0x54, 0xbf, 0x26, 0x1d, 0xd6, 0xa2, 0xee, 0x52, 0xda, 0x63, 0x49, 0xf4, 0x7b, 0x9b, 0x28, 0x9f, 0x1d, 0x0e, 0xa3, 0xe0, 0xff, 0x08, 0xf4, 0x55, 0xfa, 0x54, 0x85, 0x65, 0x8e, 0x42, 0x17, 0xf4, 0x40, 0xc0, 0x8b, 0x90, 0xae, 0x4c, 0x6c, 0xc2, 0x56, 0x97, 0xcb, 0x83, 0x35, 0x31, 0xdb, 0xb4, 0x74, 0x03, 0x25, 0x43, 0x10, 0x0b, 0x5f, 0x92, 0xb6, 0x78, 0x19, 0x5d, 0xdb, 0xfb, 0x1b, 0x59, 0xc5, 0x9b, 0xe7, 0xc8, 0x3d, 0xd8, 0x17, 0x45, 0xcd, 0x4e, 0x70, 0x9a, 0x0e, 0x3f, 0x79, 0x8e, 0xad, 0x5b, 0xf8, 0x66, 0x2d, 0xa6, 0x5c, 0x10, 0x57, 0xcc, 0x08, 0x2d, 0x90, 0x50, 0x50, 0xc4, 0x65, 0x95, 0x8b, 0x55, 0x5d, 0x77, 0xb8, 0xb1 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.14", + /* Message to be signed */ + 245, + { 0xae, 0x48, 0xcd, 0x83, 0xf4, 0xa1, 0xf9, 0x4e, 0x17, 0x19, 0x21, 0x96, 0x90, 0xc8, 0xc6, 0xf6, 0x73, 0x7a, 0xbd, 0x15, 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x6f, 0xc3, 0xb2, 0x9c, 0xbe, 0xe1, 0xe6, 0x63, 0xb9, 0x23, 0x13, 0x6b, 0x5e, 0x19, 0x92, 0x83, 0x9f, 0x0b, 0xa5, 0x2e, 0x44, 0xfc, 0xcb, 0xd9, 0xf3, 0x20, 0xed, 0xe2, 0x0f, 0x55, 0xa4, 0x23, 0x77, 0x0e, 0x57, 0x3a, 0x9f, 0xb2, 0xb3, 0x6d, 0xc8, 0xf1, 0x84 } +, + /* Signature */ + 129, + { 0x00, 0xfb, 0xa9, 0xf6, 0xf9, 0x59, 0xb1, 0x70, 0xb0, 0x94, 0x6d, 0xcb, 0xdb, 0x98, 0xdc, 0x8e, 0x84, 0x79, 0xc6, 0x69, 0xad, 0xba, 0x6c, 0x54, 0x63, 0x6a, 0x2d, 0xc7, 0xd7, 0xf7, 0x03, 0x3d, 0x35, 0x04, 0x05, 0xd7, 0x17, 0xf2, 0xd6, 0x3d, 0xae, 0x65, 0xc2, 0x4b, 0x37, 0xdb, 0x1d, 0xc3, 0xe9, 0xf6, 0x17, 0x43, 0xaf, 0x1c, 0xe6, 0xde, 0x24, 0x67, 0xd1, 0x85, 0xae, 0xf0, 0x8d, 0x2b, 0xf8, 0x65, 0xf0, 0x75, 0xba, 0xa6, 0xa2, 0x9c, 0x58, 0x06, 0x61, 0xdc, 0xd4, 0xa4, 0x8f, 0x21, 0xff, 0x4e, 0x7b, 0x03, 0x9e, 0xef, 0x1e, 0x1e, 0x20, 0xba, 0x80, 0xcf, 0x20, 0xea, 0xb6, 0xec, 0xde, 0x60, 0xfa, 0x5d, 0x37, 0x67, 0xa3, 0x0e, 0x6a, 0xd4, 0x14, 0x47, 0x13, 0xca, 0x49, 0xfc, 0x03, 0x80, 0x99, 0xaf, 0x53, 0x6c, 0x0d, 0x5f, 0x55, 0xc4, 0xcb, 0x15, 0x33, 0x53, 0x81, 0xbe, 0xa0 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.15", + /* Message to be signed */ + 238, + { 0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} +, +{ + "PKCS#1 v1.5 Signature Example 9.16", + /* Message to be signed */ + 211, + { 0x7b, 0x15, 0xd1, 0xa7, 0x9c, 0x7a, 0xd2, 0xd1, 0x2f, 0x75, 0xda, 0x57, 0xd1, 0x4a, 0x8e, 0xb7, 0x1f, 0xdd, 0x4c, 0x4e, 0xff, 0x52, 0x43, 0x74, 0x1a, 0xcd, 0xe2, 0x3c, 0xe6, 0xda, 0xd3, 0x08, 0xc8, 0x1d, 0x5d, 0x58, 0x0f, 0xf9, 0xc3, 0xf8, 0x93, 0xff, 0x12, 0x4f, 0xe4, 0x58, 0xb3, 0x18, 0x84, 0xda, 0xf7, 0xfc, 0x44, 0x66, 0xd7, 0x00, 0xdc, 0x49, 0x3f, 0x1c, 0x7a, 0x7d, 0xbf, 0x62, 0x24, 0x1b, 0x17, 0xe7, 0x36, 0x23, 0xfa, 0x17, 0x81, 0x4a, 0xb4, 0xd2, 0xc9, 0x24, 0x5b, 0xe8, 0x3b, 0xb3, 0xcc, 0x5f, 0x94, 0x44, 0xb1, 0x52, 0x17, 0xb2, 0x44, 0x1f, 0x45, 0x9c, 0x00, 0xb8, 0x2e, 0x58, 0x68, 0x9a, 0x11, 0xdd, 0x5c, 0x59, 0xfa, 0x39, 0x5d, 0x1a, 0x6f, 0x9b, 0x2c, 0x25, 0xcc, 0x84, 0x99, 0x92, 0x7a, 0xb9, 0xa4, 0x98, 0x28, 0x53, 0x36, 0x52, 0xce, 0xe2, 0x32, 0x32, 0x97, 0x2d, 0x65, 0x69, 0xee, 0x56, 0x44, 0x78, 0x66, 0xf1, 0x0e, 0xba, 0xd5, 0x4e, 0xa3, 0xf0, 0x61, 0x32, 0x0c, 0x6d, 0x3f, 0xef, 0xce, 0x34, 0x55, 0x2b, 0x62, 0x66, 0x96, 0x7b, 0x05, 0x78, 0xd6, 0xc4, 0x55, 0xb9, 0xac, 0x24, 0x66, 0x36, 0x17, 0x12, 0xe7, 0xd0, 0x5b, 0xd3, 0x33, 0x2e, 0xc1, 0x30, 0xd4, 0x5c, 0x6a, 0x49, 0x76, 0x16, 0x2c, 0x79, 0x7a, 0xd1, 0x36, 0x3f, 0x49, 0x69, 0xe4, 0xae, 0x3d, 0xed, 0x6e, 0x36, 0xea, 0x2c, 0xd7, 0xfb, 0x35, 0x66, 0x09, 0xbe, 0x03, 0x1a, 0x79, 0xb2, 0x94 } +, + /* Signature */ + 129, + { 0x03, 0x02, 0x52, 0x90, 0xb4, 0x46, 0x2f, 0x9a, 0xb7, 0x9f, 0xdf, 0xaa, 0x7b, 0x1d, 0x53, 0xa4, 0xd1, 0x27, 0x96, 0xc8, 0x5a, 0xac, 0x28, 0xde, 0xac, 0x21, 0x27, 0xc8, 0x25, 0x2c, 0x2a, 0x62, 0x39, 0x5a, 0x8b, 0x81, 0x9d, 0xfc, 0xee, 0xbf, 0x68, 0xdd, 0x4d, 0xbf, 0xc8, 0x7c, 0x1c, 0xf3, 0xd0, 0x17, 0xa5, 0x3a, 0x26, 0x40, 0x92, 0x50, 0x6b, 0xb6, 0xfc, 0x95, 0x28, 0xe6, 0xf8, 0x76, 0x78, 0x73, 0x6c, 0xa5, 0x6a, 0x14, 0xa1, 0xaa, 0x26, 0x77, 0xa8, 0xb8, 0x4f, 0x5e, 0x03, 0xfa, 0x2c, 0x0c, 0xe4, 0x78, 0x5b, 0x26, 0xba, 0x92, 0xe7, 0x5f, 0xbd, 0xc1, 0x6d, 0x8d, 0x4c, 0x7f, 0xb0, 0xbc, 0x39, 0xa8, 0x8e, 0x13, 0x2e, 0x1e, 0x05, 0xad, 0x00, 0xf1, 0x2f, 0x07, 0x27, 0x06, 0x34, 0x3f, 0x5e, 0xb3, 0xda, 0xb5, 0x11, 0x2e, 0x3b, 0xbe, 0x76, 0xed, 0x0b, 0xbc, 0x7b, 0xdf, 0xcf } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.17", + /* Message to be signed */ + 104, + { 0x7a, 0x76, 0x44, 0x00, 0x1f, 0x80, 0x13, 0xc5, 0x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4, 0x23, 0x02, 0x2c, 0xa6, 0xad, 0x74, 0x46, 0x9b, 0xbd, 0x55, 0x57, 0xbf, 0xa1, 0xcf, 0x4b, 0x95, 0x63, 0x6f, 0x53, 0x45, 0x37, 0xef, 0xf2, 0xfb, 0x16, 0xaf, 0x5e, 0x64, 0x71, 0x82, 0x4a, 0xfe, 0x21, 0x67, 0x91, 0x8c, 0x89, 0xad, 0xe0, 0x1d, 0x52, 0xae, 0xa7, 0x39, 0x9d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.18", + /* Message to be signed */ + 22, + { 0x12, 0xd2, 0x24, 0xfc, 0x10, 0xa0, 0xfc, 0x40, 0x95, 0x3a, 0xb6, 0xd7, 0x01, 0xc4, 0x16, 0xc3, 0xa8, 0x23, 0x77, 0x2b, 0xea, 0xfa } +, + /* Signature */ + 129, + { 0x03, 0x2c, 0xb5, 0xc8, 0xd6, 0x12, 0x90, 0xb7, 0x66, 0xe6, 0x49, 0x8a, 0xa6, 0x01, 0x49, 0x4d, 0x9f, 0x06, 0x6f, 0x27, 0xa4, 0x7a, 0x28, 0x70, 0xf3, 0x67, 0x89, 0x43, 0x29, 0x1a, 0xb2, 0x2d, 0x3c, 0x45, 0xc0, 0x76, 0xe5, 0x60, 0x81, 0x9d, 0x33, 0xf8, 0x89, 0xf8, 0xcf, 0xab, 0x2d, 0xf6, 0xc6, 0x3c, 0x0c, 0xe1, 0xed, 0x5c, 0xeb, 0x51, 0x54, 0x70, 0x77, 0xc0, 0x82, 0x78, 0x18, 0x7a, 0x82, 0x72, 0xfe, 0xc7, 0xde, 0x95, 0x54, 0xcd, 0xc9, 0x16, 0xca, 0x72, 0xf2, 0xc4, 0x51, 0x43, 0xf2, 0xcf, 0x32, 0x43, 0xc4, 0xbd, 0x20, 0x0c, 0x6e, 0x99, 0x3f, 0x0d, 0xb5, 0xb7, 0x1d, 0x4f, 0x63, 0x77, 0x1e, 0x24, 0x9b, 0x19, 0xb9, 0x97, 0xa6, 0xe5, 0xa9, 0x19, 0xca, 0x10, 0x0c, 0x90, 0xfe, 0xa6, 0xa2, 0xd4, 0xdc, 0x68, 0x81, 0xc3, 0xa0, 0xe1, 0xc1, 0x35, 0x53, 0x83, 0xcf, 0xbb, 0x4b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.19", + /* Message to be signed */ + 200, + { 0xe0, 0xd4, 0xe2, 0xa5, 0xe9, 0x8a, 0x51, 0x23, 0x7d, 0xa5, 0x08, 0x5d, 0xcf, 0x09, 0x8a, 0xe2, 0xc0, 0x5b, 0x4e, 0x16, 0x92, 0x54, 0xee, 0x6d, 0xda, 0x16, 0x21, 0x0e, 0x4a, 0x3f, 0xe8, 0x1c, 0x72, 0x56, 0xea, 0xef, 0xf2, 0x8c, 0x0c, 0x63, 0xd8, 0x54, 0xb7, 0x84, 0x1a, 0x13, 0x6c, 0x43, 0x60, 0xb2, 0x15, 0xdc, 0xa0, 0x58, 0x74, 0x8a, 0x4b, 0xfa, 0x82, 0x58, 0x68, 0x04, 0x28, 0x21, 0x99, 0x2a, 0x4e, 0xd5, 0xa7, 0xd5, 0x8f, 0x80, 0x12, 0x20, 0x75, 0x49, 0xbe, 0x8c, 0xc9, 0xce, 0xcc, 0x85, 0x01, 0xb9, 0xf8, 0x02, 0x83, 0x0f, 0x86, 0x58, 0x45, 0xce, 0x2e, 0x33, 0x9b, 0xec, 0x28, 0x05, 0x96, 0x11, 0xa1, 0xa0, 0x0b, 0x55, 0x35, 0xc3, 0xc6, 0x15, 0xe9, 0xd2, 0xa1, 0x39, 0x59, 0xf1, 0x01, 0x5c, 0x8b, 0xad, 0x2d, 0x75, 0x3a, 0x59, 0xa6, 0x14, 0x3b, 0x3a, 0x30, 0x58, 0xef, 0x72, 0x25, 0x60, 0xff, 0xe1, 0xc1, 0x84, 0x87, 0xc7, 0x41, 0xda, 0xd6, 0x1f, 0x07, 0xa1, 0x56, 0x42, 0xe7, 0x26, 0xad, 0x18, 0xa9, 0x84, 0x87, 0x5e, 0x68, 0xc6, 0x2e, 0xeb, 0xed, 0xcf, 0x94, 0x6f, 0x13, 0xb8, 0x93, 0xb2, 0x80, 0x8f, 0x78, 0xf9, 0x29, 0x48, 0x07, 0xd7, 0x74, 0x68, 0x54, 0x94, 0xe6, 0xb8, 0x90, 0x40, 0xee, 0xe6, 0xde, 0x1b, 0xa7, 0x18, 0xba, 0x2e, 0x08, 0x2c, 0x3d, 0x5e, 0xf1, 0x7c, 0x10, 0x28, 0xcd, 0x66 } +, + /* Signature */ + 129, + { 0x03, 0xe7, 0x83, 0xbb, 0x53, 0xdb, 0xb6, 0x7c, 0xf2, 0x19, 0x5f, 0xc1, 0xa5, 0x7f, 0x4b, 0x74, 0xc9, 0x82, 0x03, 0xb1, 0xf3, 0xd6, 0x15, 0xfe, 0xb9, 0x20, 0xe4, 0xab, 0xe8, 0x37, 0x58, 0x34, 0x67, 0x2f, 0x4b, 0x8f, 0x55, 0xfe, 0xf2, 0xac, 0xa8, 0xb5, 0xd4, 0x0a, 0xef, 0xe4, 0xef, 0xbd, 0xaa, 0xc3, 0xe8, 0x21, 0x08, 0xd0, 0x7f, 0x2f, 0x1c, 0xf8, 0xc0, 0xd4, 0xdf, 0xf8, 0x1b, 0x39, 0x66, 0xec, 0x69, 0xbe, 0x51, 0x17, 0xac, 0x1a, 0xa6, 0x11, 0x8e, 0x46, 0x0b, 0x92, 0xd8, 0x8f, 0xcd, 0xd9, 0x4d, 0x08, 0xeb, 0xaa, 0x53, 0x62, 0xe5, 0x9d, 0x52, 0x00, 0x4b, 0x43, 0x36, 0x95, 0x14, 0x37, 0xda, 0x0f, 0x51, 0xd6, 0x3e, 0x50, 0x56, 0x15, 0xb4, 0xb7, 0x55, 0x54, 0x08, 0x0b, 0x94, 0x89, 0x7f, 0xef, 0x29, 0x3a, 0x34, 0xc4, 0x04, 0x00, 0xc4, 0xf9, 0x9a, 0xa1, 0xde, 0xfe, 0x35 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 9.20", + /* Message to be signed */ + 111, + { 0x64, 0xb3, 0xba, 0x40, 0x98, 0x03, 0xc9, 0xb9, 0x60, 0xc1, 0xc4, 0x96, 0x2f, 0x51, 0x27, 0x1b, 0xc8, 0x9a, 0x40, 0xbd, 0x40, 0x5c, 0xe5, 0xbc, 0xdc, 0x88, 0x51, 0xd9, 0x7c, 0x9b, 0xe5, 0xe5, 0xb7, 0x46, 0x4e, 0x50, 0xd9, 0x9b, 0x6c, 0xf8, 0xad, 0xf8, 0xff, 0x83, 0x2b, 0x73, 0x7d, 0xe8, 0xb6, 0xff, 0x1a, 0xbe, 0xb8, 0x9d, 0xba, 0xe9, 0x3a, 0x90, 0x63, 0x94, 0x87, 0x80, 0x6b, 0x05, 0x96, 0xcd, 0x31, 0x68, 0x60, 0xf6, 0x8f, 0x00, 0x27, 0xa3, 0x50, 0x3e, 0x15, 0x89, 0x67, 0xaf, 0xdf, 0xf4, 0x69, 0x07, 0x68, 0x17, 0xfc, 0x7d, 0xa3, 0x22, 0x3c, 0xca, 0x1e, 0x6c, 0x48, 0x97, 0x3b, 0x57, 0x0e, 0x0b, 0xf7, 0x4b, 0xb8, 0xb3, 0x96, 0x54, 0x37, 0x2b, 0x7a, 0x1d, 0x6f } +, + /* Signature */ + 129, + { 0x00, 0xd2, 0x00, 0xeb, 0xa0, 0xb6, 0x52, 0x2a, 0xfb, 0x42, 0x0e, 0xbf, 0x16, 0x48, 0x8c, 0x53, 0x03, 0x52, 0xc4, 0x2d, 0xde, 0x81, 0xe7, 0x64, 0xc0, 0xca, 0xdb, 0x43, 0x82, 0x8c, 0xb9, 0x98, 0xd0, 0xa6, 0x0b, 0x23, 0xb5, 0xb6, 0x95, 0x8a, 0x00, 0xfc, 0x25, 0x53, 0xe2, 0x35, 0xe8, 0x57, 0x4e, 0x4d, 0x4f, 0xec, 0x9e, 0x66, 0x8d, 0xba, 0x40, 0xde, 0x66, 0x61, 0xab, 0xe1, 0x3f, 0xcb, 0x84, 0xc1, 0xad, 0x15, 0xc4, 0xb0, 0xcc, 0x0c, 0x6f, 0x4f, 0x0f, 0x83, 0x77, 0x87, 0xc4, 0x32, 0x5f, 0x04, 0x5d, 0x61, 0xee, 0x2c, 0x99, 0x72, 0xb0, 0x1f, 0x32, 0x12, 0x65, 0x4e, 0xc4, 0x26, 0x62, 0x56, 0x7f, 0xaa, 0xc4, 0x0e, 0x9c, 0x0a, 0x28, 0x15, 0x8a, 0x2a, 0x6c, 0x31, 0xf0, 0x1a, 0x84, 0x91, 0x26, 0xdf, 0x9e, 0x96, 0xcb, 0x82, 0x09, 0xbe, 0xb5, 0x81, 0xd6, 0x84, 0x6b, 0xb5, 0xab } + +} +, +} +}, +{ + "Example 10: A 1028-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x0d, 0x5f, 0xb9, 0x9f, 0xde, 0xdf, 0x42, 0x56, 0xe2, 0x8d, 0x4b, 0x41, 0xd7, 0x07, 0xfc, 0x27, 0x63, 0x3e, 0x89, 0x95, 0x15, 0xf4, 0xda, 0xbf, 0x6b, 0x46, 0x27, 0x10, 0xac, 0x11, 0x25, 0x81, 0xfa, 0x73, 0xfa, 0x83, 0x69, 0x58, 0x2c, 0x9f, 0xd4, 0x52, 0x5a, 0x70, 0x16, 0x18, 0x99, 0xdf, 0x63, 0x25, 0x84, 0x9e, 0x5c, 0x43, 0x49, 0x3e, 0x13, 0x35, 0x4e, 0x27, 0x09, 0x55, 0xa4, 0x3e, 0x38, 0x35, 0xb5, 0x99, 0x8e, 0xd4, 0x2a, 0x57, 0x5b, 0xbf, 0x68, 0x8d, 0x69, 0xec, 0x36, 0x6d, 0x2b, 0xa6, 0xf0, 0x50, 0x4c, 0x1e, 0xe1, 0x7d, 0xc5, 0x9b, 0x7e, 0xa0, 0xb4, 0x64, 0x0c, 0xbe, 0xcd, 0x8b, 0xd7, 0x96, 0x2b, 0xe8, 0x56, 0x6f, 0x0e, 0xbd, 0x65, 0x57, 0x43, 0x65, 0x6a, 0x29, 0x12, 0x85, 0xe0, 0x37, 0xbb, 0xfa, 0x86, 0x55, 0x80, 0x1b, 0xd0, 0x31, 0x4f, 0x46, 0x4c, 0x56, 0x91 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0xe7, 0x6f, 0x42, 0xb4, 0x74, 0x02, 0xd5, 0xe0, 0xf9, 0x64, 0x64, 0x92, 0x5a, 0xb4, 0xb3, 0xbc, 0x68, 0x94, 0x30, 0x0e, 0xe4, 0x86, 0xfb, 0x70, 0xce, 0xd4, 0x91, 0xf2, 0xd1, 0xb3, 0x67, 0x80, 0x84, 0xc1, 0xc2, 0xcb, 0x96, 0x95, 0x68, 0xa5, 0xf7, 0x7d, 0xab, 0xcd, 0x40, 0x93, 0x39, 0x37, 0xa8, 0x67, 0xf9, 0x34, 0xfb, 0x2a, 0xea, 0xae, 0x6d, 0x78, 0x67, 0x98, 0xe0, 0xd0, 0x4a, 0x10, 0x6f, 0x54, 0x5e, 0x41, 0xa9, 0xc9, 0x38, 0x33, 0xd8, 0x1f, 0xd4, 0xd7, 0x53, 0x53, 0x17, 0x9c, 0xb0, 0xbc, 0xa4, 0x5e, 0x79, 0xaa, 0xc9, 0x41, 0x34, 0x64, 0xb0, 0x36, 0x7f, 0x31, 0xac, 0x5a, 0xca, 0x56, 0x6f, 0x22, 0x14, 0xbf, 0x51, 0x46, 0xa9, 0x48, 0x4b, 0x87, 0xe4, 0x2b, 0xda, 0xc2, 0xb0, 0x1a, 0x99, 0x67, 0x03, 0x50, 0x6b, 0xe0, 0x77, 0x49, 0xaa, 0x0f, 0xbe, 0xb3, 0xb2, 0x29 } +, + /* Prime 1 */ + 65, + { 0x03, 0xff, 0xaf, 0x4a, 0x61, 0x21, 0xd7, 0x42, 0x0c, 0xfd, 0xa6, 0x4c, 0x41, 0x71, 0x2f, 0x47, 0xc8, 0xf2, 0xd0, 0xd2, 0x5b, 0x17, 0xe9, 0x5b, 0x35, 0x41, 0x42, 0x84, 0x69, 0x10, 0xaf, 0xef, 0xbd, 0xf2, 0x1e, 0x74, 0x23, 0xe8, 0xb3, 0xbe, 0x44, 0xae, 0xd9, 0xaf, 0x5e, 0x49, 0x81, 0x68, 0x5d, 0x3b, 0x9a, 0x1d, 0x59, 0xc9, 0xb9, 0x47, 0xfb, 0x9c, 0x33, 0x9c, 0x9a, 0x31, 0xe5, 0x7b, 0xd9 } +, + /* Prime 2 */ + 65, + { 0x03, 0x58, 0x31, 0xe3, 0xb9, 0x29, 0x3b, 0xcd, 0xa4, 0x51, 0xbe, 0x9d, 0xb1, 0x91, 0x97, 0x48, 0x6a, 0xa2, 0xe2, 0x2e, 0x92, 0x98, 0x65, 0x0f, 0x2b, 0x7f, 0xf4, 0x25, 0x69, 0xeb, 0xec, 0x33, 0xd2, 0x0a, 0x34, 0x98, 0x44, 0xa3, 0x3b, 0xea, 0xa0, 0x93, 0xd1, 0x43, 0x4a, 0xfb, 0x4a, 0x04, 0xa0, 0x4a, 0xed, 0xd3, 0xbb, 0xc4, 0xb3, 0x87, 0x77, 0xa5, 0x5f, 0xe6, 0x50, 0x5b, 0x8c, 0x15, 0x79 } +, + /* Prime exponent 1 */ + 65, + { 0x02, 0x8e, 0x91, 0xd5, 0xab, 0xba, 0x69, 0xdc, 0x50, 0x56, 0x38, 0xe9, 0xf5, 0xc6, 0x9c, 0x06, 0xf8, 0xd5, 0x5a, 0xf5, 0xc7, 0x4d, 0xc8, 0xe7, 0x8b, 0x6c, 0x09, 0x4e, 0x85, 0xa8, 0x27, 0xf7, 0xd2, 0xab, 0x69, 0x11, 0xb6, 0x8c, 0x6b, 0xb2, 0xb4, 0x54, 0x61, 0xd9, 0xa3, 0x1e, 0xb9, 0x62, 0xb4, 0x8b, 0x12, 0x06, 0xc6, 0x8d, 0x18, 0xae, 0x90, 0x92, 0xd6, 0xe5, 0xc2, 0x2b, 0x39, 0xa4, 0x31 } +, + /* Prime exponent 2 */ + 65, + { 0x02, 0x98, 0x04, 0xe1, 0x32, 0xfa, 0x3a, 0xaa, 0x4b, 0x15, 0x26, 0xbb, 0x50, 0x3a, 0xb4, 0xd4, 0x71, 0xf7, 0x6f, 0x69, 0x65, 0x42, 0x11, 0xa6, 0x89, 0x3b, 0x0c, 0x13, 0x74, 0x29, 0x87, 0x9f, 0xcc, 0xf7, 0x23, 0x41, 0x30, 0x82, 0x54, 0x76, 0xac, 0x20, 0xd7, 0xfb, 0xd3, 0x8c, 0x3e, 0x24, 0x86, 0x58, 0x76, 0x48, 0x6e, 0xe8, 0xa7, 0xbf, 0x99, 0x58, 0x45, 0x9e, 0xee, 0x95, 0x81, 0x78, 0x29 } +, + /* Coefficient */ + 65, + { 0x02, 0x11, 0x97, 0x5e, 0x88, 0x56, 0xd4, 0xea, 0x9d, 0x1d, 0xdf, 0x87, 0xb8, 0x7d, 0x39, 0x79, 0x2f, 0x1c, 0xf7, 0xe2, 0xf1, 0x82, 0xf4, 0xa4, 0xe6, 0x91, 0xe5, 0x00, 0x2b, 0x10, 0xa0, 0x8a, 0x46, 0xdc, 0xa1, 0xa4, 0xf4, 0x83, 0x00, 0x85, 0xd8, 0xd4, 0x0b, 0xea, 0x1d, 0xff, 0x11, 0xb0, 0xc0, 0xdf, 0x20, 0x22, 0x43, 0xeb, 0x99, 0x3e, 0x58, 0x0a, 0x94, 0x49, 0x9b, 0x9c, 0xed, 0xd2, 0xbe } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 10.1", + /* Message to be signed */ + 157, + { 0xb2, 0xd5, 0x88, 0x50, 0x9c, 0x2e, 0xac, 0xda, 0x28, 0x1e, 0x76, 0x71, 0xcb, 0xa2, 0xfc, 0xa9, 0x14, 0xef, 0x73, 0xa3, 0xae, 0xa9, 0x20, 0x20, 0x43, 0xea, 0xd6, 0xb7, 0x21, 0x25, 0xc1, 0xb0, 0xd5, 0xcc, 0x15, 0x41, 0x46, 0x20, 0xd5, 0x73, 0xd7, 0xab, 0x0b, 0x3a, 0x8a, 0xb6, 0x6a, 0x92, 0xdf, 0x87, 0x0b, 0x75, 0x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0xcf, 0x27, 0xf0, 0x60, 0x9b, 0xb3, 0xf8, 0x80, 0x64, 0x13, 0x24, 0x7d, 0x5d, 0x49, 0x54, 0xf7, 0x89, 0xa1, 0x01, 0xbf, 0x39, 0x21, 0x72, 0x8b, 0x48, 0x7e, 0x85, 0xfa, 0x3f, 0xd4, 0xdc, 0xd7, 0x2d, 0x04, 0x44, 0x8e, 0x42, 0xd3, 0xec, 0x05, 0xcc, 0x47, 0x5d, 0x74, 0xcb, 0xf7, 0x65, 0xc3, 0x4e, 0x3e, 0xc1, 0x4c, 0xca, 0x50, 0x40 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.2", + /* Message to be signed */ + 148, + { 0xca, 0x25, 0x18, 0xa5, 0xa2, 0x24, 0xb2, 0x3d, 0x42, 0x05, 0xd8, 0xdd, 0x7e, 0xb0, 0x4c, 0xbd, 0xcd, 0x0c, 0xcb, 0x82, 0xbc, 0x87, 0x96, 0x1d, 0x85, 0x9d, 0x66, 0x00, 0xb1, 0xac, 0x3e, 0x25, 0xa9, 0x40, 0x7b, 0x6c, 0x06, 0x50, 0x27, 0xc0, 0x40, 0x81, 0xf4, 0x45, 0xa2, 0x30, 0xab, 0x93, 0x08, 0xe7, 0x55, 0xf3, 0x3a, 0x75, 0x97, 0x73, 0xbe, 0x6b, 0x96, 0x9e, 0x0e, 0xa7, 0x74, 0xaa, 0x6e, 0x33, 0x4f, 0xb6, 0x04, 0x18, 0x42, 0x75, 0xf3, 0x6a, 0x03, 0x1d, 0xae, 0xa6, 0x51, 0x86, 0x97, 0x79, 0x5b, 0xd6, 0xa7, 0xd6, 0x69, 0x7b, 0x40, 0x6d, 0xa2, 0xce, 0xce, 0x15, 0xdc, 0x11, 0x3d, 0x85, 0x44, 0x98, 0x85, 0x61, 0x13, 0x1d, 0x4f, 0xc6, 0xf6, 0xe3, 0xc5, 0x80, 0xd8, 0x06, 0x80, 0x7d, 0xf2, 0xc6, 0x85, 0x65, 0x09, 0x54, 0x2e, 0x4e, 0xd3, 0x9d, 0x34, 0x6e, 0xba, 0x15, 0x97, 0x6a, 0x8f, 0xd0, 0x1d, 0x79, 0x41, 0xb0, 0x16, 0x56, 0x06, 0xc7, 0x61, 0x76, 0x64, 0x9a, 0x16, 0x10, 0x05, 0xa0 } +, + /* Signature */ + 129, + { 0x00, 0xbe, 0xb9, 0x21, 0xce, 0x74, 0x89, 0x81, 0x9d, 0x2f, 0x85, 0xc7, 0x88, 0x39, 0xa2, 0x7d, 0x7e, 0x19, 0xea, 0x0a, 0x76, 0x4a, 0xc5, 0x31, 0x01, 0xe8, 0x6f, 0x31, 0x70, 0xa7, 0x6e, 0x31, 0x8a, 0x7e, 0xe8, 0x9b, 0x1f, 0x5e, 0x23, 0xe7, 0xe2, 0xdb, 0x96, 0x66, 0xeb, 0x43, 0x91, 0xb2, 0x79, 0x2a, 0x57, 0x67, 0xee, 0x35, 0x9b, 0x5c, 0x71, 0xe2, 0x74, 0x79, 0x10, 0xc8, 0x2c, 0x60, 0x83, 0xd6, 0xd3, 0x48, 0x29, 0xb9, 0x6f, 0xa5, 0xa2, 0xec, 0x0f, 0x62, 0xf1, 0xbc, 0xda, 0x5d, 0x78, 0xf8, 0xdc, 0x3c, 0x65, 0x0b, 0x94, 0xe3, 0x2b, 0x38, 0x60, 0xda, 0x5f, 0xc5, 0xb1, 0x7f, 0xbf, 0x68, 0x7e, 0xc0, 0x07, 0x5a, 0x9c, 0x73, 0xdc, 0x1e, 0x98, 0xd1, 0xf3, 0x6a, 0xae, 0xc4, 0x49, 0x3f, 0x78, 0x91, 0xe3, 0xab, 0x08, 0xe2, 0x04, 0x2d, 0x8b, 0x1e, 0x46, 0x2e, 0x8c, 0x4c, 0x33 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.3", + /* Message to be signed */ + 131, + { 0xd4, 0x33, 0xd1, 0x5b, 0x2d, 0x61, 0xb8, 0x6a, 0xc8, 0xec, 0x0d, 0xae, 0xba, 0x65, 0xe1, 0x1d, 0xed, 0x3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x60, 0xb3, 0x78, 0x75, 0xea, 0xbe, 0xf8, 0x21, 0x53, 0xa1, 0x2b, 0xc7, 0xfd, 0xe3, 0xfb, 0xc9, 0xe5, 0xe1, 0x48, 0xf4, 0xe1, 0x6c, 0xb7, 0x2a, 0x77, 0x3d, 0x9d, 0xd0, 0x23, 0x17, 0xf7, 0x0b, 0x33, 0x91, 0x40, 0x08, 0x05, 0xe8, 0x5e, 0x7a, 0x23, 0x56, 0x7b, 0x34, 0xaa, 0x65, 0xa3, 0x5f, 0x74, 0x41, 0x70, 0xaf, 0xfc, 0xb3, 0x23, 0x37, 0x1a, 0xd2, 0xab, 0x9f, 0x1e, 0x4d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.4", + /* Message to be signed */ + 52, + { 0x7d, 0x0f, 0x5b, 0xd7, 0x90, 0x0f, 0x1e, 0x65, 0x65, 0x4e, 0x6c, 0x7e, 0xeb, 0x06, 0x4c, 0xb8, 0x28, 0xf3, 0x55, 0xd6, 0xde, 0x9b, 0xf0, 0xd3, 0x47, 0x83, 0xff, 0xcb, 0xe8, 0x0a, 0xb1, 0xb8, 0xae, 0x07, 0xb7, 0xf1, 0xe3, 0xf5, 0xa3, 0x20, 0xdd, 0x9b, 0x8b, 0x76, 0xbe, 0x0e, 0x97, 0x72, 0xde, 0x19, 0xa8, 0xd3 } +, + /* Signature */ + 129, + { 0x09, 0xe7, 0xa5, 0x30, 0x41, 0x71, 0xda, 0x63, 0x8b, 0xe7, 0x60, 0x1f, 0xbf, 0xf6, 0xe4, 0x95, 0x36, 0xf3, 0x36, 0x60, 0x82, 0x25, 0x3a, 0xbc, 0x1d, 0xb5, 0xd1, 0xb6, 0x54, 0x93, 0xda, 0x59, 0x5e, 0xc9, 0x3c, 0x37, 0xf5, 0x89, 0x0b, 0x5f, 0x47, 0x15, 0xbd, 0x5e, 0x80, 0xc0, 0xbb, 0xc5, 0xc6, 0x3b, 0x74, 0xaf, 0x2e, 0x60, 0x43, 0x91, 0x32, 0xd2, 0x52, 0x13, 0x75, 0x0b, 0xc1, 0xde, 0x30, 0x2e, 0x3e, 0x8b, 0x83, 0xda, 0xd2, 0xde, 0x0d, 0xff, 0xc4, 0xfa, 0xab, 0x40, 0x56, 0xdd, 0x7c, 0x40, 0x5e, 0x04, 0xd5, 0x94, 0x24, 0x53, 0x65, 0x9d, 0x49, 0x0f, 0x3c, 0x3d, 0xaa, 0x7d, 0x3f, 0x11, 0x70, 0x11, 0x81, 0x6b, 0x56, 0x59, 0x01, 0x04, 0xde, 0x7f, 0x9c, 0x05, 0x23, 0x73, 0xe2, 0xdd, 0xe4, 0x14, 0x49, 0x04, 0x27, 0xa5, 0x89, 0x64, 0x49, 0x3f, 0xf4, 0x5f, 0x08, 0xa6, 0xe8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.5", + /* Message to be signed */ + 14, + { 0xd9, 0x6a, 0xa0, 0x91, 0xc1, 0x60, 0xb5, 0x52, 0xb1, 0x6d, 0xf0, 0x65, 0x8f, 0xa8 } +, + /* Signature */ + 129, + { 0x0b, 0x69, 0x75, 0x4e, 0xd6, 0xd7, 0xa7, 0xd2, 0xd8, 0x5b, 0x2c, 0x7a, 0x30, 0x6c, 0x78, 0xd6, 0x3d, 0x0f, 0xfa, 0x43, 0x8f, 0x43, 0xbe, 0xec, 0x3a, 0x02, 0x86, 0xce, 0x57, 0xe7, 0xe0, 0xf8, 0x5c, 0xa4, 0x30, 0xe6, 0x39, 0x08, 0xc0, 0xfa, 0x58, 0x4b, 0xa2, 0x50, 0x5f, 0x8c, 0x94, 0x65, 0x6e, 0xc0, 0x24, 0x94, 0xbb, 0x03, 0x2f, 0x92, 0x0c, 0x4b, 0x6b, 0x8c, 0x94, 0x3e, 0x6b, 0xe9, 0x2f, 0x57, 0x8a, 0xa8, 0xcc, 0xdf, 0xaa, 0xc0, 0xa5, 0x4b, 0x8a, 0x9c, 0x0d, 0xf5, 0x48, 0x27, 0x1f, 0x89, 0x73, 0xc9, 0xff, 0xa2, 0xa2, 0x0c, 0x84, 0x76, 0x2e, 0x90, 0x17, 0xe7, 0x45, 0x2e, 0x5d, 0x74, 0xda, 0x69, 0x0f, 0x75, 0xc0, 0x99, 0xab, 0x91, 0xe2, 0xa7, 0x96, 0x3b, 0xc5, 0x37, 0xf9, 0xc2, 0x4c, 0xcc, 0x3c, 0x41, 0x8c, 0x6e, 0x98, 0x58, 0x61, 0xd9, 0x3d, 0xaa, 0xb2, 0xe6, 0x13 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.6", + /* Message to be signed */ + 215, + { 0x56, 0xf0, 0x48, 0x64, 0x5a, 0x49, 0xfa, 0x01, 0x41, 0xf4, 0xd6, 0x74, 0xaa, 0xfc, 0xf2, 0xff, 0xfa, 0x83, 0xf9, 0xb4, 0x52, 0xf1, 0xfe, 0xed, 0x43, 0x05, 0x7c, 0xac, 0x27, 0x67, 0x5e, 0xa1, 0xa1, 0x41, 0xd8, 0x7f, 0x92, 0xf9, 0xce, 0xbf, 0x6e, 0xe4, 0xf7, 0x8f, 0x8e, 0xd4, 0xc3, 0xa2, 0x9d, 0xeb, 0x72, 0x97, 0x47, 0xb4, 0xf9, 0x8e, 0x4c, 0x75, 0x90, 0xaa, 0xa8, 0xd5, 0x6d, 0xbc, 0x61, 0xd3, 0x8c, 0xb5, 0x62, 0x22, 0x26, 0xf6, 0x8e, 0x43, 0xf9, 0xc4, 0xf4, 0xc0, 0x39, 0x98, 0xae, 0xe9, 0x09, 0x34, 0x39, 0x5b, 0xc8, 0x40, 0xc8, 0x6d, 0xcc, 0x88, 0x74, 0x77, 0x6f, 0x43, 0x03, 0x9f, 0x56, 0xa8, 0x9d, 0x24, 0xbd, 0xc4, 0xb3, 0x05, 0xdf, 0x09, 0xe5, 0xca, 0x0c, 0x05, 0x12, 0xad, 0x6d, 0x15, 0x71, 0x91, 0x9a, 0x3d, 0xb3, 0xa6, 0xbd, 0x98, 0xb7, 0x82, 0x0a, 0xda, 0x08, 0x69, 0xd2, 0x25, 0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 0xc1, 0x13, 0x26, 0x18, 0x3e, 0xbf, 0xf4, 0x9b, 0xd4, 0x0b, 0xdf, 0x76, 0xd7, 0xef, 0x69, 0xb6, 0x7e, 0xa3, 0x96, 0x8f, 0xa8, 0x49, 0x03, 0x2f, 0xb8, 0x24, 0xb6, 0xdd, 0x6a, 0xe3 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.7", + /* Message to be signed */ + 165, + { 0x79, 0xda, 0x89, 0xe3, 0x55, 0xd5, 0x51, 0xa0, 0xe0, 0x31, 0xf4, 0xfb, 0x71, 0xab, 0x6f, 0x41, 0x44, 0xc4, 0x76, 0x2e, 0x07, 0xd0, 0x64, 0x14, 0x33, 0xcb, 0x5e, 0xc8, 0x61, 0x34, 0x96, 0x3f, 0x7d, 0x2c, 0x4d, 0xc7, 0xbe, 0xb5, 0xc6, 0xd4, 0x61, 0x57, 0xc6, 0xc4, 0xe1, 0x4a, 0x4b, 0x9c, 0x7a, 0x2c, 0x0d, 0x46, 0x0f, 0x1f, 0xc0, 0x62, 0xea, 0x1b, 0x4f, 0x98, 0x74, 0xd5, 0xb1, 0xc2, 0x9a, 0xe2, 0xf2, 0xa5, 0xb3, 0x90, 0x62, 0xe4, 0x12, 0x12, 0xe6, 0x5c, 0x85, 0xc2, 0x8e, 0x76, 0x75, 0x89, 0x96, 0x5d, 0x17, 0x10, 0xad, 0x5b, 0xc7, 0x6f, 0xa5, 0xa6, 0x72, 0x9a, 0x06, 0xfd, 0x49, 0x6e, 0x2e, 0x09, 0x97, 0xe5, 0x73, 0x37, 0xbd, 0x51, 0x6e, 0x6b, 0xc7, 0x9b, 0xe9, 0xe0, 0x70, 0xaa, 0x7b, 0x86, 0xc2, 0xdd, 0xf1, 0x4f, 0x94, 0x98, 0x5f, 0xe1, 0x58, 0x2a, 0x29, 0x2c, 0xd1, 0x39, 0x34, 0xb3, 0xc3, 0x8d, 0xfe, 0x59, 0x77, 0xed, 0x1d, 0x9f, 0x8a, 0xd3, 0x24, 0xc0, 0xdc, 0x07, 0xe5, 0x85, 0x3c, 0x7e, 0x48, 0x90, 0xbf, 0xbd, 0xc1, 0xa0, 0x1e, 0xcd, 0x72, 0xc5, 0xff, 0x68, 0xa0, 0x2f, 0x1e } +, + /* Signature */ + 129, + { 0x0a, 0x06, 0x82, 0xf7, 0x42, 0xe7, 0x43, 0xe1, 0xc7, 0xda, 0xba, 0xac, 0x61, 0x8a, 0x78, 0x6f, 0x28, 0xed, 0x13, 0xa6, 0x58, 0x7a, 0xdf, 0xc3, 0x3c, 0x98, 0x29, 0xd7, 0x52, 0xc1, 0x3e, 0xf2, 0x7a, 0x00, 0xc7, 0xe6, 0xd4, 0x5e, 0x27, 0x17, 0x1a, 0x58, 0x41, 0x77, 0x1d, 0x78, 0x69, 0x8c, 0x6c, 0xc6, 0x67, 0x78, 0xb8, 0xc0, 0x93, 0x38, 0xe3, 0x5b, 0x9b, 0x6f, 0x59, 0xc0, 0x64, 0xce, 0xb3, 0xeb, 0x20, 0xce, 0x90, 0x9a, 0x5c, 0x6c, 0xea, 0xae, 0xbb, 0xe9, 0x3e, 0x86, 0xc7, 0xc5, 0xff, 0x4a, 0x39, 0x17, 0xf1, 0x26, 0x81, 0x96, 0x32, 0xcf, 0x96, 0xfa, 0xb1, 0xd3, 0x91, 0x73, 0xa7, 0xae, 0x7f, 0xc2, 0xff, 0x5c, 0x0f, 0xb4, 0x09, 0x05, 0x35, 0xda, 0xdb, 0x58, 0xd8, 0x7d, 0x0d, 0xa3, 0xdb, 0x32, 0xec, 0xec, 0x13, 0x71, 0x8b, 0x3a, 0xc5, 0xc3, 0x0b, 0xa8, 0x02, 0xe3, 0x8b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.8", + /* Message to be signed */ + 92, + { 0xe6, 0x9a, 0xc9, 0x43, 0x3e, 0x6c, 0x28, 0xac, 0x53, 0xf8, 0x03, 0x4a, 0x86, 0x8d, 0xa9, 0x88, 0x3e, 0x31, 0x9e, 0x82, 0xe6, 0xbc, 0x2e, 0x49, 0x45, 0x5e, 0x6e, 0x4f, 0x09, 0x8b, 0x53, 0xf2, 0x87, 0xa8, 0x58, 0xda, 0x1d, 0x87, 0x6a, 0x9a, 0x5a, 0x6a, 0x9f, 0xc1, 0x4f, 0xd2, 0x42, 0x38, 0xcd, 0x4e, 0x4b, 0x57, 0x31, 0x07, 0x7a, 0x4d, 0xbd, 0xd5, 0x03, 0x8a, 0x9b, 0xc1, 0xf5, 0xde, 0xf4, 0x3f, 0xec, 0x77, 0xf6, 0x7e, 0xb0, 0x62, 0xfa, 0xef, 0xef, 0x7d, 0x04, 0x29, 0x23, 0x8b, 0x25, 0xd0, 0x31, 0x85, 0x78, 0x96, 0x62, 0x3a, 0x3f, 0x1d, 0x37, 0xbf } +, + /* Signature */ + 129, + { 0x08, 0xa0, 0x20, 0xe4, 0x20, 0x98, 0x78, 0xf1, 0xe6, 0x37, 0xad, 0x59, 0xda, 0xaf, 0x83, 0x5d, 0xaf, 0x4c, 0xa6, 0x64, 0x84, 0x47, 0x94, 0xc1, 0xc6, 0x48, 0xf0, 0xe2, 0x23, 0x3d, 0xba, 0x75, 0x48, 0xbd, 0x16, 0x1f, 0x0c, 0x0a, 0x18, 0x24, 0xd7, 0x62, 0x03, 0x1a, 0x41, 0x75, 0x72, 0x84, 0x2f, 0x8e, 0x64, 0x4a, 0xa9, 0x3f, 0x9d, 0x91, 0xdd, 0x77, 0x09, 0xe1, 0x6a, 0x42, 0x9c, 0xc1, 0x43, 0x90, 0x3e, 0xf4, 0xf8, 0x37, 0xa4, 0x58, 0x39, 0x6b, 0xca, 0xc2, 0x40, 0x92, 0xb0, 0x17, 0x24, 0xc6, 0xfe, 0x3d, 0xd1, 0xad, 0x24, 0x3f, 0x3f, 0x70, 0xb5, 0xae, 0x6f, 0xaa, 0x09, 0xf3, 0x70, 0xca, 0xa5, 0x12, 0x10, 0x4b, 0x91, 0x76, 0x06, 0x0d, 0xf2, 0xbf, 0x12, 0x1c, 0xbc, 0xe9, 0x19, 0x8e, 0xc2, 0xfe, 0x45, 0xa5, 0x9e, 0xbd, 0xdc, 0x46, 0x75, 0x32, 0xb5, 0xaf, 0xb9, 0xb2, 0x35 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.9", + /* Message to be signed */ + 152, + { 0x45, 0xe0, 0x90, 0x56, 0xa2, 0x8e, 0x4b, 0x2e, 0x7c, 0x11, 0xf6, 0x5e, 0x68, 0x8a, 0x1e, 0x3c, 0x33, 0xf0, 0xe5, 0x2c, 0x9a, 0x03, 0x6c, 0x09, 0xd8, 0x1d, 0xe5, 0xa6, 0xda, 0xb5, 0x8d, 0x4d, 0x55, 0xcf, 0x41, 0x1b, 0x53, 0xad, 0x64, 0x6e, 0x83, 0xa3, 0x4b, 0x0c, 0x08, 0xc2, 0x21, 0xae, 0x03, 0x76, 0xab, 0x76, 0xa7, 0x9d, 0x1f, 0xee, 0x67, 0x1a, 0x58, 0x44, 0x20, 0x56, 0x4f, 0x8e, 0x85, 0x2e, 0xb6, 0xf2, 0xd4, 0x27, 0xae, 0xe0, 0xa0, 0x96, 0xdd, 0x72, 0xdb, 0xe8, 0x50, 0x7c, 0x67, 0x7f, 0x8a, 0xa0, 0x0e, 0xb7, 0xc2, 0x5d, 0xfb, 0x0a, 0x49, 0xdd, 0x88, 0xa6, 0xc7, 0x84, 0x76, 0xb8, 0x00, 0x11, 0xb6, 0x82, 0x8b, 0x3a, 0xaf, 0x46, 0x47, 0x79, 0x44, 0x22, 0xba, 0x6b, 0xd6, 0x3b, 0x7a, 0xb0, 0xe7, 0xda, 0xfb, 0xd3, 0x6f, 0x6c, 0x41, 0xde, 0xa0, 0x3d, 0x73, 0x22, 0x35, 0x64, 0x96, 0x94, 0x60, 0xd9, 0x28, 0x54, 0x0b, 0x73, 0x92, 0x57, 0xe7, 0x0b, 0xb6, 0x8d, 0x5c, 0x65, 0x3c, 0x37, 0x96, 0x94, 0x58, 0x95 } +, + /* Signature */ + 129, + { 0x08, 0x71, 0x7d, 0x50, 0x86, 0xa6, 0x45, 0x3b, 0xde, 0xff, 0x77, 0xd4, 0xc2, 0xb8, 0x56, 0xe3, 0xba, 0x99, 0x0b, 0xab, 0xf6, 0x97, 0x01, 0xdf, 0x6c, 0xa0, 0xa3, 0xb3, 0xa8, 0x1b, 0x55, 0x69, 0x7d, 0x31, 0x88, 0x9d, 0x10, 0x0d, 0x68, 0x95, 0xc9, 0x7f, 0x0a, 0x56, 0xb4, 0x71, 0x68, 0xc9, 0x8d, 0xa6, 0x2e, 0x59, 0xec, 0x79, 0xd7, 0xae, 0xab, 0x2f, 0x9a, 0x57, 0x07, 0x46, 0x98, 0x8a, 0x26, 0xf4, 0x23, 0x57, 0x6c, 0x70, 0x3f, 0xd8, 0x41, 0xae, 0x51, 0xc9, 0xc2, 0x29, 0xa2, 0xe9, 0xc2, 0x5f, 0xe9, 0x4c, 0x5b, 0x6c, 0xe2, 0xfa, 0x64, 0x54, 0x12, 0xbe, 0xe6, 0x59, 0xfa, 0xf6, 0x09, 0xa3, 0x2e, 0xb2, 0xc0, 0x5b, 0xee, 0xab, 0xaa, 0x4f, 0x58, 0xca, 0xac, 0x31, 0x33, 0xe5, 0xea, 0xaa, 0x27, 0x34, 0x4d, 0x30, 0xee, 0xca, 0x22, 0xc6, 0xeb, 0xd8, 0xd9, 0xe3, 0x44, 0x41, 0x0e } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.10", + /* Message to be signed */ + 141, + { 0xb8, 0x1c, 0x8b, 0xc4, 0xac, 0x1f, 0xd9, 0x71, 0xb2, 0x1f, 0x02, 0x7e, 0x06, 0xf4, 0xd8, 0x7b, 0x34, 0xd5, 0x76, 0x9d, 0x23, 0xc8, 0x59, 0x9d, 0x1f, 0x15, 0x7b, 0x08, 0xa7, 0xf9, 0x2e, 0x34, 0x19, 0xfe, 0xc4, 0xc8, 0xc1, 0xb3, 0x4c, 0xa4, 0x63, 0xc7, 0x68, 0xb7, 0x2e, 0x07, 0xf9, 0xda, 0xbc, 0x3c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x76, 0x1f, 0x3c, 0x9b, 0xd5, 0x4f, 0xa0, 0xe3, 0x1c, 0x96, 0x71, 0x9a, 0xfb, 0xf0, 0x76, 0x3e, 0x35, 0xca, 0xd8, 0x89, 0xb7, 0x2e, 0x13, 0xbd, 0x12, 0xb7, 0x6d, 0x6f, 0x20, 0x20, 0xfa, 0xf6, 0x1d, 0xd3, 0xd7, 0x08, 0x22, 0x8d, 0xf0, 0x6d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.11", + /* Message to be signed */ + 31, + { 0xd0, 0x32, 0x28, 0x83, 0xe5, 0x98, 0x16, 0x3d, 0x72, 0x20, 0x36, 0xda, 0x3e, 0x63, 0x2a, 0xa6, 0x55, 0x97, 0xac, 0xbc, 0xd1, 0xf4, 0x76, 0x03, 0x10, 0x96, 0x96, 0xf9, 0xb3, 0x9f, 0xdc } +, + /* Signature */ + 129, + { 0x07, 0x8d, 0x17, 0xab, 0x8e, 0x6f, 0xf0, 0xbe, 0x50, 0xb3, 0x53, 0x9e, 0xb0, 0x3a, 0xe8, 0xf0, 0x90, 0x3b, 0x7a, 0x07, 0x74, 0x81, 0x78, 0x1f, 0xb0, 0xb1, 0xf0, 0x9e, 0xdc, 0xf7, 0x78, 0x86, 0x31, 0x2a, 0xd6, 0xc0, 0x60, 0x27, 0x4f, 0x0c, 0x38, 0x9c, 0x16, 0x31, 0x40, 0x40, 0xc8, 0xd7, 0xd9, 0x90, 0x9c, 0xb7, 0x5d, 0xf1, 0x8c, 0x82, 0xd6, 0x2d, 0xd3, 0x4e, 0xb5, 0x9c, 0x6a, 0x87, 0xd3, 0xc4, 0x6a, 0x7e, 0xf7, 0x47, 0x4a, 0x5e, 0x44, 0x7f, 0x77, 0x44, 0xa6, 0xa9, 0x2f, 0x59, 0x90, 0xea, 0xec, 0x7b, 0xfb, 0x00, 0x84, 0x4d, 0x68, 0x4d, 0x30, 0x7d, 0xdb, 0x49, 0x81, 0x89, 0x41, 0x49, 0xe7, 0x52, 0xbf, 0xbe, 0x2e, 0x77, 0x05, 0x7d, 0xa7, 0x60, 0x54, 0x69, 0xaf, 0x7f, 0xfb, 0x67, 0x27, 0xa9, 0x98, 0x1b, 0x94, 0x39, 0xca, 0xa5, 0xd8, 0x0e, 0x6a, 0xe3, 0xb3, 0xd6, 0x51 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.12", + /* Message to be signed */ + 20, + { 0xe8, 0x74, 0x2f, 0x04, 0xb5, 0x65, 0x4d, 0x92, 0x88, 0xb2, 0x31, 0xa4, 0x7a, 0x36, 0x58, 0x39, 0xbb, 0x01, 0xbe, 0x87 } +, + /* Signature */ + 129, + { 0x09, 0xb7, 0x53, 0x06, 0xa7, 0x21, 0x2e, 0xa6, 0xf4, 0x7e, 0xb0, 0xcc, 0xf4, 0xe2, 0xe0, 0xd6, 0xf8, 0xf3, 0xab, 0xdb, 0x9c, 0xdc, 0xfa, 0xad, 0xbe, 0x51, 0x92, 0x2f, 0x92, 0xea, 0x62, 0x62, 0x3c, 0x58, 0xea, 0x74, 0xea, 0x1a, 0x24, 0x7c, 0x9d, 0x73, 0x1f, 0x2c, 0x03, 0x35, 0x36, 0xb3, 0x52, 0x73, 0xc7, 0x17, 0x49, 0x5f, 0x32, 0x5a, 0x60, 0x40, 0x5b, 0xd5, 0xf5, 0xe4, 0x05, 0xb6, 0x80, 0x27, 0x9e, 0x75, 0x21, 0x60, 0x47, 0x87, 0x40, 0x45, 0x72, 0x16, 0xdc, 0x92, 0x9d, 0xdd, 0x65, 0xde, 0xa5, 0x05, 0x53, 0x55, 0x46, 0xe4, 0x77, 0x0f, 0x82, 0x11, 0xb8, 0x49, 0xc3, 0x65, 0x21, 0x8e, 0x56, 0x6e, 0x5b, 0xb4, 0x1b, 0xfc, 0x36, 0x1b, 0x65, 0xcd, 0xcc, 0xb0, 0xe6, 0x04, 0xc9, 0xed, 0xb9, 0x70, 0xee, 0x6a, 0x28, 0x6a, 0x1f, 0xce, 0xc0, 0xae, 0x9d, 0x92, 0x55, 0x8e, 0xab } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.13", + /* Message to be signed */ + 249, + { 0xa0, 0x3c, 0x2b, 0x85, 0xfd, 0xe4, 0x64, 0x68, 0xd1, 0xc5, 0x06, 0x37, 0xb0, 0x0a, 0x72, 0xdc, 0xfc, 0x32, 0xc4, 0x16, 0x31, 0x73, 0x9c, 0x06, 0x02, 0x45, 0xf5, 0x3e, 0x57, 0xc6, 0x6c, 0x51, 0x76, 0x6f, 0x24, 0xea, 0xfd, 0x93, 0xe6, 0xc6, 0x67, 0x43, 0x48, 0x05, 0x91, 0xbf, 0x14, 0x44, 0x6e, 0x04, 0x0b, 0x67, 0xa4, 0xf8, 0x46, 0x99, 0x57, 0x6c, 0x2e, 0x14, 0x63, 0xca, 0xcc, 0xbc, 0xb0, 0x73, 0xe4, 0xb7, 0xec, 0x6d, 0xa6, 0xc8, 0xcb, 0x41, 0xd4, 0xa1, 0x23, 0xc7, 0x48, 0xcd, 0x7e, 0x83, 0xd2, 0x61, 0xe5, 0x4c, 0x2f, 0xd2, 0xbc, 0x49, 0x5b, 0xc4, 0xc4, 0x4a, 0x78, 0xf9, 0x82, 0x00, 0x34, 0x03, 0x09, 0x2e, 0xc6, 0x96, 0x0c, 0x08, 0x8e, 0x2b, 0xcd, 0xe3, 0x48, 0xa2, 0xe0, 0xe5, 0x5a, 0x4b, 0x4f, 0x42, 0xea, 0xb2, 0x29, 0xb9, 0x5c, 0x38, 0x3f, 0x21, 0x13, 0xed, 0x6c, 0xd1, 0xf3, 0xf3, 0x16, 0x7d, 0xe3, 0xd2, 0x8d, 0x36, 0x2c, 0x8d, 0x78, 0xb2, 0xeb, 0x6e, 0x31, 0x62, 0x0e, 0x34, 0xb2, 0xf0, 0xf9, 0x41, 0xda, 0xcd, 0xf7, 0xb4, 0xb8, 0x56, 0x8c, 0x6a, 0x86, 0x3a, 0x55, 0x1d, 0x7b, 0xd4, 0xa5, 0xd7, 0x09, 0x3e, 0xda, 0x69, 0xe1, 0xe2, 0x80, 0x56, 0xdc, 0xb1, 0xeb, 0x69, 0xae, 0x03, 0xad, 0x74, 0xbe, 0x72, 0xa7, 0x5a, 0xe8, 0xfb, 0x56, 0xa2, 0x71, 0x25, 0xca, 0x3d, 0x2d, 0xb3, 0x76, 0x9d, 0x13, 0xd3, 0x5d, 0xb1, 0x08, 0xe2, 0x64, 0x4a, 0x7f, 0x3b, 0x37, 0x93, 0x8f, 0xec, 0x97, 0x62, 0x31, 0x52, 0x06, 0xd3, 0x0c, 0xcf, 0xd5, 0x76, 0xae, 0x7d, 0xe0, 0x76, 0x98, 0x69, 0xe5, 0x04, 0x4d, 0x07, 0x64, 0x6c, 0xf7, 0x8c, 0x64, 0xa4, 0x86, 0x48, 0x0b, 0x0f, 0xd4, 0x2c, 0xc7, 0xb2, 0x46 } +, + /* Signature */ + 129, + { 0x05, 0x8d, 0xa5, 0x49, 0x4c, 0x4e, 0x98, 0xaa, 0x12, 0x1f, 0x67, 0xf6, 0x5a, 0x2c, 0x86, 0x54, 0x25, 0xa9, 0xe6, 0x00, 0x2b, 0x22, 0x3f, 0x03, 0x88, 0x80, 0x97, 0x53, 0x57, 0x3b, 0x4f, 0x33, 0x4d, 0xe4, 0x5d, 0x8f, 0x00, 0x07, 0x25, 0x5d, 0x11, 0x2d, 0xdc, 0x84, 0xdb, 0x26, 0x67, 0x00, 0xe4, 0x40, 0xb5, 0xa8, 0x69, 0x00, 0xc3, 0xd3, 0xd3, 0x5b, 0x02, 0x4c, 0x18, 0xd8, 0xa2, 0x5a, 0x58, 0x00, 0x22, 0x6d, 0x0a, 0x56, 0xd8, 0x38, 0xd8, 0x91, 0x9e, 0x6d, 0x5a, 0x87, 0x30, 0xd6, 0x19, 0x49, 0x90, 0x15, 0xec, 0x46, 0x65, 0xc6, 0x3d, 0x77, 0x80, 0x83, 0xa0, 0x42, 0xdd, 0x4f, 0x05, 0x2a, 0x1b, 0xbb, 0x5f, 0x40, 0x80, 0xcb, 0xbb, 0x41, 0xfa, 0x94, 0x5b, 0xad, 0x6a, 0x74, 0x77, 0x9f, 0x68, 0x07, 0x25, 0xe4, 0x7a, 0x08, 0xa0, 0x51, 0x4f, 0x35, 0x0f, 0xa5, 0xad, 0xf9, 0x0a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.14", + /* Message to be signed */ + 47, + { 0xc4, 0x0c, 0x70, 0xf2, 0x6d, 0xa5, 0x69, 0x48, 0x6b, 0xac, 0xe7, 0x85, 0xda, 0x32, 0xe3, 0x37, 0xa0, 0xeb, 0x94, 0xfb, 0x3a, 0x0a, 0xa4, 0x09, 0xc5, 0x77, 0x01, 0x75, 0xc8, 0xe8, 0xcb, 0x2b, 0xaa, 0x8d, 0x2a, 0x1b, 0x98, 0x46, 0xc3, 0x7d, 0xf7, 0xd6, 0x71, 0x03, 0x6d, 0x5e, 0x91 } +, + /* Signature */ + 129, + { 0x05, 0x25, 0x61, 0x28, 0xaf, 0xba, 0x1f, 0x55, 0xd8, 0x1f, 0x79, 0xea, 0x33, 0x87, 0x91, 0x47, 0xa2, 0x4a, 0xd7, 0x77, 0x93, 0x46, 0xee, 0x79, 0x8b, 0x21, 0x1c, 0x24, 0x71, 0x53, 0xea, 0x38, 0xd2, 0x6b, 0x21, 0x70, 0x65, 0xf6, 0x1e, 0x01, 0x10, 0xb5, 0x3d, 0x72, 0xcb, 0x64, 0x93, 0x4d, 0x9b, 0x1a, 0xd1, 0xb3, 0xde, 0xc3, 0x32, 0x09, 0x2d, 0x25, 0x8f, 0x0c, 0xaf, 0x1c, 0x4a, 0xee, 0x8b, 0x23, 0xe0, 0x9b, 0xab, 0x0f, 0x0c, 0x27, 0x88, 0x58, 0xb4, 0x41, 0xd0, 0x8c, 0xa3, 0xae, 0x9f, 0x00, 0xaa, 0x9a, 0x3f, 0x01, 0x8f, 0x7d, 0x9f, 0xa9, 0x8a, 0x18, 0xdf, 0x0d, 0x24, 0x84, 0x7e, 0x56, 0x7a, 0x47, 0xf5, 0x77, 0x9b, 0xd1, 0x79, 0x3a, 0x4b, 0x02, 0x52, 0xf2, 0xba, 0xd4, 0x0c, 0x9c, 0x4a, 0x81, 0x30, 0x1c, 0xc2, 0x8c, 0x26, 0x09, 0xd7, 0xbb, 0x33, 0x37, 0xe9, 0x7f, 0x14 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.15", + /* Message to be signed */ + 83, + { 0x9e, 0x6d, 0xcb, 0x11, 0xe0, 0xe8, 0x47, 0x71, 0x39, 0xfa, 0xf0, 0x41, 0xa7, 0x4e, 0x2b, 0xed, 0x64, 0x3a, 0x62, 0xad, 0xed, 0xac, 0x7c, 0xbe, 0xf3, 0x65, 0xec, 0xc4, 0x3a, 0xe4, 0xe5, 0x82, 0x60, 0xbc, 0x72, 0x46, 0x23, 0xbd, 0x63, 0x42, 0xdc, 0x66, 0x0d, 0x66, 0x14, 0x2e, 0xa6, 0x36, 0x80, 0x71, 0x5f, 0x52, 0x2f, 0xf3, 0xcd, 0x4b, 0x63, 0x6f, 0x84, 0xaa, 0x9d, 0x75, 0xfb, 0xfb, 0xc3, 0x84, 0x10, 0x7e, 0x43, 0x00, 0x4d, 0x98, 0x6f, 0xbc, 0xe1, 0xa2, 0x7f, 0x7e, 0xcc, 0x7d, 0x02, 0x39, 0x2c } +, + /* Signature */ + 129, + { 0x0c, 0xcf, 0x23, 0x4e, 0xb4, 0x80, 0x08, 0x5d, 0x92, 0x0d, 0x37, 0xd6, 0x87, 0x96, 0x5d, 0x2f, 0xd2, 0xe4, 0xa4, 0xf3, 0xbd, 0x3b, 0xf7, 0xdd, 0xc1, 0x6b, 0x5d, 0x62, 0xa6, 0x90, 0x32, 0x74, 0x20, 0x7c, 0x6f, 0x90, 0x83, 0x6e, 0x29, 0xff, 0xc6, 0x3a, 0x57, 0xf9, 0x81, 0x30, 0xc5, 0x25, 0x23, 0x25, 0x19, 0xc7, 0x08, 0xf0, 0xdc, 0x8a, 0x12, 0x55, 0xab, 0x55, 0xdb, 0x1a, 0x2b, 0x9a, 0xbc, 0x11, 0x06, 0x16, 0x02, 0x07, 0x5f, 0xf6, 0xf9, 0x7f, 0x90, 0x92, 0x79, 0x6b, 0x98, 0x87, 0x1a, 0x6c, 0xd5, 0xd2, 0x61, 0x7d, 0xdc, 0x9d, 0x25, 0x5a, 0x73, 0x00, 0xc9, 0x10, 0xfd, 0x21, 0x0b, 0x14, 0xa9, 0x81, 0xe5, 0xa0, 0xe0, 0xc6, 0xbb, 0x2b, 0x04, 0x5f, 0xa9, 0x75, 0x68, 0x98, 0xb9, 0x3b, 0x8a, 0x63, 0x45, 0x44, 0xd7, 0x7a, 0xfd, 0xb1, 0xcf, 0x0e, 0x79, 0x58, 0xf1, 0x1a, 0x43 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.16", + /* Message to be signed */ + 177, + { 0x20, 0xbc, 0x46, 0x3b, 0x5e, 0x12, 0x20, 0xa3, 0x9c, 0x84, 0xe8, 0x9f, 0xe6, 0x71, 0x6e, 0xec, 0xab, 0x55, 0x55, 0xf8, 0xbf, 0xce, 0x60, 0xcf, 0xb8, 0x37, 0x93, 0xcc, 0x40, 0xa4, 0xda, 0x1d, 0x22, 0xc0, 0xab, 0x4e, 0xaa, 0x93, 0x1f, 0xb7, 0x47, 0xbe, 0x35, 0xf1, 0xcf, 0x6f, 0xb1, 0x46, 0x5b, 0xef, 0x1d, 0xf2, 0x76, 0x0f, 0xcb, 0x3f, 0x70, 0xd3, 0xe2, 0x96, 0xe7, 0xb2, 0x70, 0x45, 0x0d, 0xff, 0xe2, 0xd5, 0x88, 0xc4, 0x39, 0x6a, 0x5f, 0x6f, 0x1e, 0x63, 0x87, 0xaa, 0x86, 0x97, 0x1f, 0xb0, 0xad, 0x24, 0xdf, 0x55, 0x04, 0x43, 0xdd, 0x12, 0x2b, 0xdb, 0x2c, 0xf3, 0xc9, 0xed, 0x61, 0x25, 0xfe, 0x55, 0xce, 0xc9, 0x91, 0xcb, 0xae, 0x8e, 0xe1, 0x56, 0x2a, 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xa5, 0x8e, 0xed, 0xea, 0x7e, 0x0f, 0xe6, 0x2a, 0xc1, 0x6e, 0x20, 0x8a, 0xab, 0x4c, 0xee, 0x26 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.17", + /* Message to be signed */ + 232, + { 0x92, 0xda, 0x26, 0x0b, 0xc2, 0x13, 0xb7, 0x2b, 0x48, 0xa0, 0x57, 0x53, 0x50, 0x3d, 0x00, 0xa1, 0xdb, 0xfd, 0x02, 0xac, 0x7b, 0x9f, 0xd4, 0x4d, 0x24, 0x01, 0xea, 0x7a, 0xd5, 0x8a, 0xd1, 0x86, 0x1f, 0xda, 0x53, 0x63, 0x29, 0xae, 0x41, 0x73, 0xc9, 0x16, 0x80, 0x05, 0xb9, 0x66, 0x2c, 0x05, 0xcb, 0xea, 0x47, 0xad, 0x86, 0x4a, 0xf7, 0xcb, 0x16, 0x60, 0x2d, 0x3d, 0x18, 0x34, 0x71, 0xbc, 0x98, 0xbc, 0xc6, 0x2c, 0x6d, 0x00, 0xd3, 0x34, 0xbf, 0xf5, 0xb9, 0x0c, 0xfe, 0x7d, 0x7e, 0x12, 0xd0, 0x7f, 0xe7, 0xd4, 0xcb, 0xd9, 0xdc, 0xd3, 0xc4, 0xc2, 0x34, 0x90, 0xbe, 0x8c, 0xba, 0xdc, 0x08, 0xc9, 0x17, 0x79, 0x80, 0x37, 0x3c, 0x79, 0xeb, 0x4e, 0xea, 0x6d, 0x81, 0xa6, 0xbe, 0xe2, 0x27, 0x0b, 0xf4, 0x20, 0xf9, 0x19, 0x79, 0xad, 0x3f, 0x27, 0x1f, 0xd6, 0x8d, 0xd4, 0x28, 0x3b, 0xe8, 0x14, 0x10, 0x92, 0x8c, 0xa4, 0x5b, 0x9d, 0xeb, 0x58, 0xd3, 0xae, 0x98, 0xb2, 0xf4, 0xfc, 0xa6, 0x21, 0x25, 0x95, 0x0b, 0x5e, 0xe1, 0x28, 0xdb, 0xa1, 0x05, 0xc3, 0x5c, 0xc3, 0x98, 0xd1, 0x5e, 0x74, 0x2b, 0xba, 0x92, 0x69, 0x7b, 0x5c, 0x62, 0xb2, 0x67, 0xce, 0x01, 0x14, 0x1c, 0xec, 0xef, 0x80, 0x75, 0x07, 0xde, 0x29, 0xc4, 0x85, 0x30, 0x5d, 0x0a, 0x99, 0x09, 0x43, 0x23, 0x0d, 0x8d, 0x9b, 0x72, 0x52, 0xee, 0x0b, 0x19, 0x56, 0xde, 0x84, 0x5f, 0x2f, 0xbb, 0x28, 0x38, 0x78, 0x5b, 0x47, 0x0a, 0x7c, 0x20, 0x53, 0xdb, 0x39, 0x6b, 0x31, 0x5a, 0x30, 0xd8, 0xa7, 0xf9, 0x1c, 0xff, 0xfd, 0x03, 0xe8, 0xa3, 0x9b, 0xa8, 0xbc } +, + /* Signature */ + 129, + { 0x03, 0xe2, 0x3f, 0x86, 0x52, 0x37, 0x4d, 0x48, 0xd3, 0x81, 0xc3, 0x78, 0x35, 0x3e, 0xb4, 0x7d, 0x90, 0x64, 0xcd, 0x70, 0x8e, 0x1b, 0x9b, 0xf6, 0x88, 0x70, 0x4c, 0x04, 0xc0, 0x09, 0x00, 0x88, 0x46, 0xe6, 0xa4, 0x7e, 0x0b, 0xd2, 0xe3, 0x0c, 0x33, 0x40, 0xf5, 0xd4, 0xe1, 0x9d, 0x2d, 0xc5, 0xd8, 0x89, 0x0c, 0x8f, 0x01, 0x04, 0xdd, 0x6f, 0x5d, 0xd6, 0xca, 0xd9, 0xc4, 0xd9, 0x94, 0x84, 0x09, 0xc3, 0xcc, 0x0b, 0xe6, 0x70, 0x71, 0x9d, 0xd0, 0x48, 0x41, 0x80, 0x89, 0x1c, 0x93, 0x5b, 0x99, 0x79, 0xdb, 0x8e, 0xb4, 0x68, 0xa2, 0x3e, 0x4e, 0xf4, 0x60, 0x29, 0xf3, 0xaf, 0x14, 0x57, 0x4b, 0xd1, 0x0b, 0x47, 0x3e, 0xdd, 0x9b, 0x12, 0x7a, 0x30, 0x6e, 0x51, 0x24, 0xad, 0xa4, 0x02, 0xc1, 0x48, 0xf5, 0x1b, 0x52, 0xe7, 0xe6, 0x28, 0xbf, 0xac, 0xec, 0x3f, 0xc2, 0x54, 0x3a, 0x0f, 0x92 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.18", + /* Message to be signed */ + 113, + { 0x86, 0x03, 0xa5, 0x62, 0x2a, 0x2d, 0xbb, 0xbc, 0xbb, 0xe5, 0x33, 0x30, 0xe9, 0x08, 0xd5, 0xa2, 0x5f, 0x6e, 0x67, 0xa5, 0x1e, 0x07, 0x68, 0xd7, 0xc3, 0xc3, 0xfb, 0xe8, 0xb9, 0x2e, 0x8b, 0x1b, 0x36, 0xdc, 0x00, 0x74, 0x3c, 0xe3, 0x3d, 0xa0, 0xf1, 0xc8, 0xcf, 0xb0, 0x0d, 0x63, 0xed, 0xd6, 0xb2, 0x25, 0x2f, 0xb6, 0x72, 0x13, 0x97, 0xd2, 0x50, 0x4b, 0x30, 0xed, 0x1d, 0x29, 0x3a, 0x82, 0xe2, 0x44, 0xc9, 0x51, 0xbb, 0xfc, 0x24, 0x29, 0x8a, 0x42, 0xff, 0xee, 0x26, 0xe4, 0x56, 0xa7, 0xbe, 0x10, 0x5c, 0xb5, 0xe3, 0x7b, 0x3d, 0x25, 0xde, 0x28, 0xbf, 0xc0, 0x10, 0x42, 0xc4, 0xa8, 0x2c, 0xe8, 0x70, 0x45, 0x54, 0x87, 0xe5, 0xb3, 0x0e, 0x26, 0xf8, 0xd5, 0x39, 0x8c, 0x86, 0x12, 0x6e } +, + /* Signature */ + 129, + { 0x08, 0x22, 0xfc, 0x22, 0xa9, 0xcd, 0x87, 0x7c, 0x09, 0xb6, 0xf9, 0x2e, 0x80, 0x17, 0xcc, 0xc0, 0x28, 0xd5, 0x37, 0x99, 0x67, 0xc7, 0xd0, 0x4e, 0xf3, 0x2f, 0x86, 0x9c, 0x7e, 0xf6, 0x7d, 0x59, 0x3c, 0x77, 0x45, 0xf6, 0x29, 0xd9, 0x3d, 0xf2, 0x60, 0x03, 0x8c, 0xd3, 0x33, 0xea, 0xee, 0x92, 0x35, 0x9f, 0xdb, 0xbf, 0x84, 0x62, 0x3b, 0x7b, 0x55, 0x14, 0x23, 0x5b, 0x83, 0x06, 0x27, 0x2f, 0x4e, 0xfd, 0x13, 0xa6, 0x70, 0x0b, 0xe9, 0x28, 0x9a, 0xd5, 0x4e, 0x57, 0xd5, 0x2d, 0x1f, 0xeb, 0xb4, 0x6a, 0x37, 0xaf, 0xd6, 0x95, 0x94, 0x2c, 0x4c, 0xbc, 0xfd, 0x37, 0x68, 0xf2, 0x82, 0x1e, 0x88, 0x8e, 0xfa, 0x0e, 0x2c, 0x5f, 0xd3, 0xc9, 0xc4, 0x2c, 0xc3, 0x55, 0x50, 0xd7, 0x95, 0x5c, 0xdb, 0xd3, 0x5c, 0x8e, 0xf8, 0x58, 0x1b, 0x41, 0xf8, 0xdd, 0xab, 0x26, 0x18, 0x26, 0x2e, 0x3d, 0xff } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.19", + /* Message to be signed */ + 43, + { 0x06, 0x7d, 0x4b, 0xec, 0xb0, 0x3e, 0x1e, 0xb2, 0x75, 0xae, 0x22, 0x50, 0x7a, 0x77, 0xa5, 0x39, 0x6e, 0x71, 0x9b, 0x5f, 0x00, 0xb1, 0x05, 0x95, 0x0b, 0xc7, 0x99, 0x8e, 0x08, 0x03, 0xda, 0x57, 0xa4, 0xde, 0x08, 0xa4, 0x07, 0x8b, 0x9a, 0x00, 0xd2, 0xd4, 0x6f } +, + /* Signature */ + 129, + { 0x09, 0x10, 0x8d, 0x44, 0x57, 0x5f, 0x61, 0x4a, 0x68, 0x3e, 0xe4, 0xd7, 0x8b, 0xce, 0x1c, 0x58, 0xf5, 0x24, 0x36, 0x87, 0xcb, 0xe9, 0xc5, 0x48, 0x34, 0x60, 0xb6, 0x5d, 0xf2, 0x36, 0x92, 0x7d, 0xbc, 0x78, 0xc0, 0x64, 0x39, 0xce, 0x1c, 0x7c, 0x51, 0x97, 0x39, 0xc8, 0xf8, 0x95, 0x00, 0x82, 0xd9, 0x56, 0xd6, 0x0f, 0xc3, 0x64, 0x5b, 0xa7, 0xaf, 0x8e, 0x78, 0x89, 0x54, 0x70, 0x63, 0x1b, 0xb4, 0xda, 0x00, 0xc0, 0x1b, 0x98, 0x2c, 0xc1, 0x1c, 0x68, 0xd2, 0x65, 0x0c, 0x7c, 0xae, 0xa4, 0xa2, 0x6e, 0x21, 0x0f, 0xf4, 0xb1, 0xca, 0xe1, 0xdb, 0x50, 0x5f, 0xce, 0xa9, 0x29, 0x34, 0x87, 0xb2, 0x07, 0x31, 0x78, 0xca, 0x24, 0x5c, 0xf0, 0xca, 0x23, 0x56, 0xba, 0xf8, 0x65, 0x54, 0x6b, 0x54, 0xaf, 0x95, 0x35, 0xba, 0xb1, 0x8d, 0xb6, 0x79, 0xef, 0x56, 0x27, 0x09, 0x29, 0x79, 0xc0, 0xa8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 10.20", + /* Message to be signed */ + 238, + { 0x88, 0x4f, 0xc5, 0x02, 0xc8, 0x82, 0x48, 0x49, 0x47, 0x8b, 0x2e, 0xac, 0x1e, 0x7e, 0xbb, 0xb7, 0xca, 0xf2, 0x8e, 0xeb, 0x48, 0x89, 0x45, 0x86, 0x02, 0xec, 0x70, 0x35, 0x81, 0xd0, 0x5e, 0xf9, 0xb1, 0xa4, 0x22, 0x0b, 0xd2, 0xf9, 0x22, 0xf2, 0x5e, 0x46, 0x4c, 0x88, 0x07, 0x01, 0xc8, 0xa4, 0x5b, 0x1d, 0x1f, 0xab, 0xc8, 0x66, 0x2e, 0xb2, 0x49, 0x40, 0x04, 0x26, 0xc2, 0x22, 0x62, 0x38, 0xeb, 0x8a, 0xd0, 0xf9, 0x06, 0x9c, 0x90, 0xf0, 0x01, 0x82, 0x77, 0x44, 0x80, 0x25, 0xa6, 0x41, 0x80, 0xed, 0x55, 0xd1, 0xaf, 0xd2, 0x7a, 0xff, 0x4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c, 0xb5, 0x23, 0x38, 0xaf, 0x14, 0xed, 0x39, 0x36, 0xe0, 0x2c, 0x1d, 0x7e, 0x77, 0x23, 0x6c, 0xc6, 0xa4, 0x89, 0xf0, 0x0f, 0x08, 0x98, 0x52, 0xde, 0x5c, 0xc4, 0x25, 0xb4, 0x50, 0x94, 0xa0, 0x42, 0xe3, 0x85, 0x46, 0x4b, 0x64, 0xc3, 0xb2, 0xff, 0xd0, 0x1f, 0x19, 0xa0, 0x1c, 0x2c, 0x03, 0x81, 0xf7, 0x58, 0xa6, 0x73, 0x65, 0xd1, 0xe6, 0x5a, 0x70, 0x7b, 0x13, 0x4e, 0x3f, 0x8a, 0x93, 0x16, 0xb4, 0xaa, 0xcb, 0x7e, 0x85, 0x1a, 0x5e, 0xab, 0x3c, 0xd8, 0x11, 0xbd, 0x45, 0x22, 0xdd, 0x14, 0x1a, 0x00, 0x15, 0x7d, 0xc3, 0xfc, 0xaf, 0xc4, 0x15, 0x4c, 0xaf, 0x05, 0x93, 0xca, 0x62, 0x10, 0x2e } + +} +, +} +}, +{ + "Example 11: A 1029-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x1e, 0xd7, 0xee, 0xa9, 0x40, 0x5f, 0x50, 0x7f, 0x94, 0x16, 0x23, 0xa1, 0x7b, 0xea, 0x71, 0x7b, 0x86, 0x0d, 0xe4, 0x4c, 0xb7, 0x76, 0x87, 0xb8, 0xb8, 0x5a, 0x6d, 0x7d, 0x1e, 0xf4, 0xf8, 0x62, 0x8d, 0x25, 0x7c, 0xb9, 0x42, 0x38, 0xc6, 0x25, 0xba, 0x25, 0xd4, 0x6a, 0xae, 0x59, 0x39, 0x60, 0xaf, 0x79, 0xf7, 0x5e, 0x28, 0xab, 0x63, 0xac, 0x3c, 0xac, 0x48, 0x20, 0xb8, 0x2d, 0xa1, 0xcf, 0x75, 0x0d, 0x6c, 0x93, 0x0d, 0x6b, 0x82, 0x78, 0x54, 0xaa, 0xf6, 0xca, 0xc0, 0xc1, 0x7b, 0x80, 0xb0, 0x29, 0xf5, 0xd3, 0x19, 0xcc, 0xca, 0x66, 0x5c, 0x56, 0x94, 0xf5, 0x4b, 0xa5, 0xf0, 0x96, 0xf4, 0x54, 0x34, 0x13, 0xec, 0x4c, 0x5e, 0x97, 0xcc, 0x1d, 0xda, 0x89, 0xd2, 0xaf, 0xd4, 0x28, 0x57, 0x87, 0x59, 0x03, 0x2a, 0xdf, 0x92, 0x89, 0x50, 0x65, 0xba, 0xaf, 0xe8, 0x8d, 0x2d, 0x8b, 0x61 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 129, + { 0x0d, 0x93, 0x80, 0x72, 0xb1, 0x6a, 0x02, 0xf5, 0xd5, 0x0a, 0x15, 0xae, 0xeb, 0xeb, 0x5a, 0xfe, 0x43, 0x18, 0x74, 0x48, 0x2c, 0x6d, 0x18, 0xfa, 0x7e, 0xf3, 0x16, 0xc4, 0x7f, 0x4e, 0xd6, 0xd2, 0x12, 0x4c, 0xd0, 0xe4, 0x7e, 0xb8, 0x9c, 0xc7, 0x58, 0x73, 0x74, 0x57, 0x6c, 0xdc, 0xcb, 0x3b, 0xba, 0xa1, 0x95, 0xf7, 0xb5, 0x31, 0x13, 0x93, 0x69, 0xb5, 0x6f, 0x9e, 0x2f, 0x53, 0xae, 0xa8, 0xac, 0x7a, 0x97, 0xe1, 0xd7, 0x45, 0x8f, 0x52, 0x6c, 0xf7, 0xd7, 0x10, 0xc4, 0x90, 0x2a, 0xae, 0xdf, 0x99, 0x7c, 0x11, 0x94, 0xb8, 0x7b, 0x62, 0xcc, 0xd8, 0xda, 0xb8, 0xff, 0x5b, 0x67, 0xd4, 0x0f, 0xe8, 0x3d, 0xe1, 0xb8, 0x2b, 0x91, 0x60, 0x9a, 0x7c, 0x5c, 0xf3, 0x92, 0x29, 0xeb, 0x3a, 0x1b, 0x2f, 0x0e, 0xbf, 0x0b, 0x12, 0x5c, 0xb8, 0x00, 0x91, 0xa0, 0x7e, 0xbc, 0x77, 0x9c, 0xe7, 0xfd } +, + /* Prime 1 */ + 65, + { 0x05, 0x90, 0xa1, 0xe5, 0x18, 0x71, 0x07, 0xfa, 0xef, 0x1e, 0x0c, 0xd5, 0x2f, 0xa2, 0xdc, 0xad, 0xa2, 0xd5, 0x8a, 0xbc, 0xc9, 0xe0, 0x73, 0x8f, 0xf4, 0x85, 0x0f, 0x7d, 0x2d, 0xee, 0x19, 0x82, 0x3f, 0x6e, 0x3e, 0x2c, 0xa9, 0x11, 0xb7, 0x17, 0x4b, 0xe7, 0x0b, 0x15, 0xc1, 0xb8, 0x87, 0xe0, 0xae, 0x15, 0x10, 0x21, 0x22, 0x42, 0x2f, 0xa1, 0x58, 0xb9, 0x8b, 0x0d, 0x38, 0x21, 0x15, 0x24, 0x5f } +, + /* Prime 2 */ + 65, + { 0x05, 0x8a, 0xdd, 0x02, 0x9b, 0xc9, 0x7e, 0xcf, 0xd1, 0xd0, 0xdb, 0x26, 0xbe, 0x45, 0xee, 0x8d, 0x3e, 0x54, 0xbf, 0xe6, 0x36, 0xfc, 0x4d, 0xa6, 0x66, 0xdc, 0xf2, 0x50, 0xab, 0x2c, 0x2e, 0x96, 0x56, 0x62, 0x16, 0xb8, 0xa5, 0x17, 0xf1, 0x0f, 0x75, 0xb9, 0x8f, 0xde, 0x6c, 0xcd, 0x8a, 0x58, 0xe8, 0xfc, 0x58, 0x2e, 0x78, 0x74, 0x90, 0xe1, 0x95, 0x8f, 0x7a, 0x0f, 0xda, 0x82, 0xad, 0x68, 0x3f } +, + /* Prime exponent 1 */ + 65, + { 0x01, 0x80, 0xee, 0xfd, 0xa3, 0xf9, 0x06, 0x9a, 0xfa, 0xf9, 0x37, 0xa6, 0x72, 0xd4, 0xa2, 0xa4, 0x18, 0x17, 0x73, 0x01, 0x47, 0xda, 0xe9, 0xde, 0xbf, 0xc7, 0x24, 0x44, 0x42, 0xa0, 0xcf, 0x2b, 0xae, 0x4f, 0xef, 0x64, 0xc9, 0xda, 0x0b, 0x8a, 0xb3, 0xeb, 0x9d, 0xc7, 0x27, 0x2c, 0xe1, 0x2a, 0x08, 0x5f, 0x90, 0x98, 0x23, 0x55, 0x96, 0xe1, 0x15, 0xc4, 0x2c, 0x9a, 0x49, 0xcc, 0x46, 0x96, 0x29 } +, + /* Prime exponent 2 */ + 65, + { 0x05, 0x12, 0xe1, 0x4e, 0x11, 0x05, 0x7d, 0x84, 0x8c, 0x23, 0xf1, 0x6b, 0x5f, 0x46, 0x2f, 0xa2, 0xb7, 0x8b, 0xe7, 0xfc, 0xbd, 0x1b, 0x6d, 0x8e, 0x46, 0x9e, 0x3f, 0x69, 0x9f, 0xb9, 0x9b, 0x90, 0x5e, 0xd5, 0xfe, 0xcc, 0xdb, 0xbd, 0xb6, 0x1d, 0x1b, 0xfd, 0x5a, 0x7a, 0x19, 0x0a, 0x74, 0x7a, 0xfe, 0x16, 0x7c, 0x37, 0x56, 0x68, 0x07, 0x75, 0xab, 0x6f, 0xa4, 0x23, 0x3d, 0x3a, 0xe1, 0xba, 0x0b } +, + /* Coefficient */ + 64, + { 0x26, 0x2e, 0x28, 0x23, 0x16, 0x98, 0xbe, 0x32, 0x87, 0xa9, 0xc7, 0x06, 0xf3, 0x94, 0x7b, 0x7d, 0x5c, 0x2f, 0x5f, 0xd2, 0xb9, 0x14, 0x46, 0xf5, 0xe9, 0xa3, 0x15, 0x44, 0xd9, 0xaf, 0xf4, 0x55, 0xa3, 0xec, 0xc6, 0xb5, 0x43, 0x14, 0x82, 0x0c, 0x2a, 0x48, 0x82, 0x61, 0xd9, 0xf9, 0x8d, 0x34, 0x8d, 0x9c, 0x3d, 0x10, 0x02, 0xe4, 0xe8, 0x28, 0x7a, 0x15, 0x2c, 0x12, 0x87, 0x09, 0x65, 0x60 } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 11.1", + /* Message to be signed */ + 218, + { 0x84, 0x55, 0x19, 0xdd, 0x45, 0xd2, 0xdd, 0xcb, 0xc8, 0xdb,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 0x29, 0x7a, 0xda, 0x6d, 0x9b, 0x3f, 0x35, 0x6d, 0xbc, 0x74, 0xd3, 0x15, 0xc5, 0xfa, 0x1a, 0xbf, 0x7d, 0xe6, 0xce, 0xbc, 0xa8, 0x3c, 0x9d, 0xf7 } +, + /* Signature */ + 129, + { 0x08, 0x63, 0xa6, 0x26, 0xdc, 0x42, 0xba, 0xf3, 0xe1, 0x61, 0xc3, 0x5b, 0x3d, 0xe3, 0xb1, 0xab, 0xc1, 0xaa, 0x5a, 0xdf, 0x54, 0x16, 0x46, 0x5d, 0x4c, 0x7b, 0x6b, 0x01, 0xae, 0x2d, 0xad, 0x73, 0xf9, 0xf1, 0x58, 0xeb, 0x21, 0x3d, 0xbc, 0x36, 0x0b, 0xe4, 0xd4, 0x7e, 0x57, 0x07, 0x87, 0x1c, 0x39, 0xc3, 0x8d, 0xbb, 0xc9, 0x6b, 0x46, 0xc8, 0xf9, 0xaf, 0xeb, 0xd3, 0xdd, 0xac, 0x87, 0x16, 0x90, 0x98, 0xe1, 0xa7, 0x67, 0x18, 0xd3, 0x54, 0xcd, 0x09, 0x1c, 0xa3, 0x52, 0x96, 0xa7, 0x7c, 0x21, 0xd2, 0x51, 0x2f, 0xfe, 0x65, 0xe3, 0xb7, 0x1b, 0x90, 0x22, 0xe9, 0xcd, 0x1f, 0x7c, 0x35, 0xce, 0x13, 0x65, 0xfd, 0x1f, 0x2c, 0x2c, 0xb9, 0x67, 0xff, 0x4c, 0x8f, 0x90, 0xf0, 0xc8, 0xea, 0xef, 0x0d, 0xb7, 0x3f, 0xed, 0x00, 0xe9, 0x8c, 0xfc, 0x83, 0xf8, 0x0c, 0x67, 0xb3, 0xbe, 0x1d, 0x33 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.2", + /* Message to be signed */ + 40, + { 0x86, 0x8e, 0x7c, 0x4f, 0xc6, 0x34, 0x0b, 0x6b, 0xbe, 0xb7, 0xb8, 0x6e, 0xa8, 0x9e, 0xe7, 0x26, 0x5f, 0x32, 0x31, 0xf4, 0x8b, 0xaa, 0x92, 0xe4, 0xa2, 0xe8, 0xce, 0x0f, 0xa1, 0xc1, 0xa8, 0xc0, 0xfb, 0x0a, 0xca, 0x94, 0x4c, 0x74, 0xbc, 0xcd } +, + /* Signature */ + 129, + { 0x10, 0xcb, 0xf8, 0x71, 0x7f, 0x76, 0x27, 0x8f, 0xcc, 0x8f, 0xc0, 0xaa, 0xb4, 0x6e, 0x90, 0xa3, 0xd1, 0x80, 0xc3, 0xc9, 0x2a, 0x4a, 0x83, 0xeb, 0x93, 0xc8, 0x92, 0x0a, 0xf8, 0x8b, 0xd6, 0x50, 0x6b, 0x40, 0x73, 0x45, 0x3f, 0x0b, 0xef, 0xf3, 0xe6, 0x1e, 0xdb, 0xb4, 0xdb, 0xc9, 0xc9, 0x47, 0xc6, 0x9d, 0xeb, 0x69, 0xa1, 0xac, 0x92, 0x9e, 0xfc, 0x15, 0x62, 0x5b, 0x9e, 0xd7, 0xcf, 0x1b, 0xc4, 0x23, 0xa8, 0x87, 0x5f, 0x37, 0x80, 0xdd, 0xda, 0x9e, 0xb2, 0xfc, 0xcd, 0x9f, 0xa0, 0x14, 0x62, 0x6a, 0x7f, 0xcf, 0x99, 0x86, 0x49, 0xbc, 0xfa, 0x59, 0x53, 0xa3, 0xc4, 0x3e, 0xfb, 0xcc, 0x38, 0x70, 0x4d, 0x02, 0x49, 0x19, 0xdf, 0x2f, 0xc4, 0xad, 0xea, 0x39, 0xe3, 0x4c, 0xd1, 0x5c, 0xd4, 0xf8, 0x6a, 0xd3, 0xf5, 0x01, 0x01, 0x2f, 0x6b, 0xd2, 0x8a, 0xa5, 0x00, 0x2c, 0x3b, 0x41, 0xba } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.3", + /* Message to be signed */ + 78, + { 0x92, 0xcf, 0x88, 0x0d, 0xa5, 0x89, 0x15, 0xe3, 0xaa, 0x95, 0x08, 0x93, 0x53, 0xe4, 0x61, 0x84, 0xc9, 0x15,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b, 0xac, 0x9d, 0xe5, 0x41, 0x09, 0xdc, 0xf7 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.4", + /* Message to be signed */ + 68, + { 0x87, 0x3c, 0x47, 0x15, 0x90, 0x2f, 0xf1, 0x9d, 0xe0, 0x8b, 0xcc, 0xb0, 0xcf, 0x26, 0x37, 0x63, 0xfa, 0xb0, 0x16, 0xd0, 0x22, 0x0f, 0x03, 0x27, 0xb4, 0x75, 0x5e, 0x35, 0x4e, 0xb2, 0x47, 0xf5, 0xdb, 0xc2, 0xd3, 0x96, 0x98, 0x9b, 0xbd, 0x36, 0xd3, 0x1f, 0x61, 0x98, 0x93, 0x90, 0xca, 0xc1, 0x66, 0x43, 0x12, 0x5e, 0x63, 0xe1, 0xa1, 0xae, 0x1f, 0x1b, 0xc9, 0xbb, 0xed, 0xac, 0xce, 0x67, 0xfc, 0x1b, 0x51, 0xa7 } +, + /* Signature */ + 129, + { 0x05, 0x25, 0x9c, 0x48, 0x15, 0x93, 0xea, 0x86, 0xd1, 0xf0, 0x02, 0xca, 0x58, 0xaa, 0xee, 0x93, 0x29, 0xfa, 0xfe, 0x21, 0x8f, 0x67, 0x50, 0xf0, 0xe5, 0x88, 0xf3, 0x3b, 0x64, 0xe7, 0x08, 0xfb, 0x27, 0xa6, 0xfe, 0x81, 0xeb, 0xca, 0x8a, 0xda, 0xec, 0x75, 0x7a, 0x14, 0xff, 0x55, 0xa0, 0xc8, 0x8a, 0xda, 0x2c, 0x3b, 0x43, 0xe3, 0x9e, 0x8d, 0xfb, 0xe6, 0x76, 0x89, 0x43, 0x65, 0xa2, 0x21, 0x0c, 0x2a, 0xa8, 0x1f, 0x42, 0x4d, 0x85, 0x29, 0xc2, 0x07, 0x6b, 0x00, 0xc9, 0x2d, 0xd8, 0xc8, 0xae, 0x3b, 0x78, 0x0d, 0x87, 0xdb, 0xa7, 0x29, 0xdd, 0xfd, 0xef, 0x7d, 0x40, 0x7f, 0x85, 0x4a, 0x71, 0xcb, 0x68, 0x8b, 0x9f, 0x03, 0xc7, 0x1f, 0x3b, 0xaa, 0x24, 0xa2, 0xa6, 0xe1, 0xcb, 0x41, 0x07, 0x74, 0x30, 0x9e, 0x40, 0xc1, 0x3c, 0x2b, 0x26, 0x47, 0x38, 0xe5, 0x69, 0x7c, 0xfd, 0xde, 0xf3 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.5", + /* Message to be signed */ + 54, + { 0x14, 0xb2, 0x76, 0x02, 0xec, 0xe8, 0xf0, 0x67, 0xb5, 0x84, 0x83, 0xaf, 0x17, 0x77, 0xc4, 0xed, 0x10, 0xb8, 0xb6, 0x4e, 0x64, 0xc6, 0x9f, 0x57, 0xef, 0x88, 0x9a, 0x1c, 0xa5, 0xd5, 0xb5, 0xd6, 0x51, 0xc6, 0x08, 0xdb, 0x23, 0x9d, 0xee, 0xa1, 0x50, 0xff, 0x12, 0xcf, 0x50, 0xc8, 0x67, 0x96, 0x12, 0xf9, 0x7e, 0xcb, 0x09, 0xf7 } +, + /* Signature */ + 129, + { 0x15, 0xc4, 0xb3, 0xf0, 0x81, 0xa2, 0xe5, 0x8a, 0xf5, 0x94, 0xe4, 0x2f, 0xd6, 0xac, 0xcf, 0x1d, 0x0d, 0x61, 0xd9, 0x3a, 0x5e, 0x3a, 0x84, 0xcf, 0x90, 0x4b, 0x98, 0xd9, 0xad, 0x71, 0x33, 0x61, 0xb7, 0x84, 0xb2, 0x4d, 0x92, 0x95, 0xe4, 0x3c, 0x23, 0xbe, 0x93, 0xef, 0x36, 0x51, 0x4a, 0x9b, 0xac, 0x2c, 0x1b, 0xdf, 0x4e, 0xe7, 0x32, 0x34, 0x36, 0x76, 0x3a, 0x20, 0x66, 0x2f, 0x2d, 0xb3, 0x41, 0xd9, 0xe3, 0x8b, 0xed, 0x5f, 0x12, 0xc7, 0xdd, 0x18, 0xbc, 0x3b, 0xb0, 0xfc, 0xba, 0x5c, 0x00, 0x50, 0xbd, 0x1a, 0x2a, 0x44, 0x03, 0x71, 0x97, 0xb8, 0xc9, 0xfc, 0x2a, 0xa5, 0x99, 0xeb, 0x43, 0xc3, 0xd9, 0x67, 0x92, 0x42, 0xc9, 0x9b, 0xbc, 0x49, 0xb0, 0x3b, 0x98, 0xea, 0xca, 0x83, 0x46, 0x28, 0x72, 0x59, 0xe6, 0xea, 0x2e, 0x89, 0x15, 0x5d, 0x0d, 0xd2, 0xb4, 0x77, 0x80, 0x35, 0x75 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.6", + /* Message to be signed */ + 106, + { 0xe5, 0x66, 0xe5, 0xfa, 0x55, 0x6c, 0x76, 0x5b, 0x62, 0xbd, 0x6e, 0x37, 0x45, 0x21, 0xf5, 0x08, 0xfe, 0x44, 0x66, 0x68, 0xc6, 0x47, 0x4b, 0xef, 0x04, 0x6c, 0xc6, 0x89, 0x4a, 0x87, 0x32, 0x2e, 0x19, 0x31, 0xe8, 0x0d, 0x9e, 0xd9, 0xea, 0x80, 0x6b, 0x16, 0x7a, 0x3a, 0xf7, 0x7f, 0xc0, 0x49, 0x38, 0xb5, 0x54, 0x8e, 0xfb, 0xc0, 0x68, 0xd4, 0xf1, 0x96, 0x6a, 0x99, 0x76, 0x25, 0xaf, 0x31, 0xa4, 0x00, 0x7f, 0x06, 0x98, 0xa8, 0x46, 0x9a, 0xb6, 0x81, 0xf4, 0xd5, 0x08, 0xb4, 0xa4, 0x8c, 0x8f, 0xe7, 0x20, 0xcb, 0x5a, 0x94, 0xa7, 0xf4, 0x43, 0xdd, 0x5a, 0x58, 0x03, 0x04, 0x97, 0xda, 0xa9, 0x59, 0xa3, 0xaa, 0xf6, 0xe3, 0x41, 0x84, 0x39, 0x7a } +, + /* Signature */ + 129, + { 0x07, 0xe7, 0xc9, 0x44, 0x26, 0x24, 0xbd, 0x26, 0x6c, 0xc1, 0xcd, 0x1a, 0xf3, 0xb8, 0xf0, 0x62, 0x94, 0xdd, 0xa1, 0xc0, 0x77, 0x67, 0xfe, 0x19, 0xbc, 0xed, 0x6c, 0x9e, 0xd7, 0xc4, 0xb1, 0xed, 0x7f, 0x26, 0xe2, 0x03, 0xdb, 0x7f, 0x3a, 0x1b, 0xfa, 0x57, 0xda, 0xba, 0x6f, 0x3a, 0xa0, 0x60, 0x03, 0xbc, 0xdc, 0x1e, 0x00, 0xc2, 0xd3, 0xd7, 0x6b, 0x9c, 0xbf, 0xf9, 0x68, 0x49, 0xb1, 0xaf, 0xf5, 0x42, 0xd0, 0xd7, 0xaf, 0xc6, 0xe4, 0x22, 0x49, 0x2e, 0xab, 0x0a, 0xb7, 0xf8, 0xe1, 0xd1, 0xae, 0x0b, 0x27, 0x9b, 0x85, 0x19, 0x45, 0xb7, 0x65, 0x85, 0x1b, 0x9f, 0x8a, 0xd8, 0x80, 0xdd, 0x16, 0x4c, 0x11, 0xac, 0x4a, 0x57, 0xf9, 0x6a, 0x0e, 0x48, 0x4b, 0xa1, 0x6a, 0xbf, 0x1c, 0xbe, 0x8a, 0xac, 0x09, 0x0a, 0xdb, 0x6a, 0x71, 0x79, 0x7e, 0x13, 0x35, 0xee, 0xfe, 0x2a, 0xc9, 0x98, 0x0d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.7", + /* Message to be signed */ + 9, + { 0xb4, 0x43, 0xc3, 0x43, 0x52, 0x7b, 0x30, 0xd5, 0xff } +, + /* Signature */ + 129, + { 0x0b, 0x3f, 0x13, 0xc2, 0x72, 0x24, 0xd1, 0x61, 0x01, 0xb9, 0xc8, 0x20, 0x1f, 0x1b, 0x4f, 0x85, 0x37, 0xdb, 0x3c, 0x11, 0x6f, 0x3c, 0xe1, 0x30, 0xbe, 0x0d, 0xe0, 0xdc, 0x0d, 0xd2, 0x0f, 0x77, 0x3c, 0xdf, 0x7b, 0x7f, 0x37, 0x23, 0x87, 0xc4, 0xb6, 0x53, 0xe5, 0xdd, 0x44, 0x21, 0x84, 0x45, 0x74, 0x11, 0xa8, 0x2f, 0x8e, 0xd0, 0x03, 0x66, 0xec, 0xc0, 0x77, 0xa4, 0x26, 0x7c, 0x9d, 0x7e, 0x56, 0x54, 0x96, 0x63, 0x23, 0x9b, 0x43, 0x19, 0xfe, 0x49, 0x9a, 0xa7, 0x89, 0x54, 0x04, 0x9c, 0x74, 0x3b, 0xbf, 0x09, 0xd7, 0x7b, 0x30, 0x29, 0xd9, 0x18, 0xbb, 0x7b, 0x9a, 0x6a, 0xe8, 0x0b, 0x12, 0x9e, 0x41, 0xbb, 0x56, 0xda, 0xd2, 0xb8, 0xa4, 0xb6, 0xf3, 0x19, 0x33, 0x74, 0xc8, 0x29, 0x2f, 0xe0, 0x17, 0xd0, 0x63, 0x34, 0x7e, 0x91, 0xcb, 0xf4, 0xdd, 0x39, 0x39, 0xc2, 0x37, 0xf8, 0x3c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.8", + /* Message to be signed */ + 230, + { 0xdb, 0x90, 0x04, 0x7f, 0x61, 0x5a, 0xd7, 0x19, 0x72, 0xba, 0xed, 0x0c, 0x10, 0x62, 0x6e, 0xc8, 0xcb, 0x18, 0xc6, 0xd7, 0x5e, 0xaa, 0xe0, 0x58, 0x21, 0x9f, 0xd6, 0x19, 0x54, 0x26, 0xd4, 0x4d, 0x5c, 0x54, 0x3b, 0xef, 0x3c, 0x4c, 0x14, 0x98, 0xe8, 0x77, 0xd7, 0xc8, 0x53, 0xe5, 0x31, 0x21, 0xeb, 0x31, 0x57, 0x00, 0x81, 0xd5, 0xde, 0x48, 0x85, 0xcb, 0xc9, 0x25, 0xa6, 0xc2, 0x23, 0x21, 0xcc, 0xc9, 0xc3, 0x78, 0x4e, 0xb2, 0x19, 0xe4, 0x2b, 0x7e, 0xdb, 0x92, 0x88, 0x77, 0x60, 0x73, 0x29, 0x79, 0x8d, 0x55, 0x73, 0x9c, 0x89, 0xd6, 0xd6, 0xb3, 0xf0, 0xd4, 0x30, 0xbb, 0xbc, 0x47, 0x22, 0xea, 0xfa, 0x67, 0xde, 0xfc, 0x86, 0xab, 0xa6, 0xe6, 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, 0xcf, 0x36, 0x28, 0x51, 0x87, 0x19, 0xa6, 0x03, 0xf6, 0xc3, 0xc4, 0xde, 0xa3, 0x0b, 0xf4, 0x9d, 0xb9, 0xb0, 0x68, 0xaf, 0xec, 0x69, 0x81, 0x21, 0xdc, 0xe5, 0xd6, 0x0d, 0x93, 0xa6, 0xf5, 0x63, 0x3f, 0xc6, 0xaf, 0x9d, 0xf4, 0xc5, 0xdc, 0xcc, 0x13, 0x8c, 0x29, 0x4e, 0xdd, 0x42, 0x9d, 0x4a, 0xfe, 0x3b, 0x33, 0x78, 0x86, 0x82, 0x55, 0xcc, 0x53, 0x78, 0x8c, 0xf2, 0xb4, 0x77, 0x45, 0xd6, 0x4a, 0xcd, 0x88, 0x5b, 0xb4, 0x7d, 0x2e, 0xec } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.9", + /* Message to be signed */ + 160, + { 0x2b, 0xe0, 0x06, 0x7b, 0x95, 0x18, 0x5b, 0xad, 0xe1, 0x18, 0xdc, 0xe9, 0x5c, 0x57, 0x02, 0x9b, 0x55, 0x4b, 0x25, 0xe1, 0xc3, 0x95, 0x19, 0xf8, 0xf8, 0x90, 0x73, 0xb9, 0xa0, 0x4b, 0x7e, 0x91, 0x29, 0x9c, 0xdb, 0x87, 0xb0, 0xbd, 0x17, 0xc9, 0xf1, 0x51, 0x92, 0x5c, 0x75, 0x6e, 0xb9, 0xb6, 0x45, 0x07, 0x25, 0x61, 0x26, 0x41, 0x07, 0x88, 0x21, 0x38, 0x85, 0x4a, 0xe7, 0xd5, 0x07, 0xe1, 0x5f, 0xcf, 0xe8, 0x47, 0x09, 0x45, 0x40, 0xe7, 0x1a, 0x54, 0x7f, 0x63, 0xb5, 0x90, 0x46, 0x7f, 0xad, 0xff, 0x64, 0x7f, 0x64, 0x3e, 0x1c, 0xec, 0x11, 0x24, 0x65, 0x29, 0x06, 0x2c, 0x9e, 0x40, 0x88, 0x92, 0xf2, 0xa2, 0x0c, 0xcc, 0xc0, 0xae, 0x45, 0xca, 0x97, 0xa4, 0x7f, 0xca, 0xdc, 0x8f, 0xed, 0xe2, 0x1a, 0x24, 0x71, 0x11, 0x67, 0x70, 0x6c, 0xc4, 0xb5, 0xd6, 0x94, 0x77, 0xe5, 0xa8, 0xa1, 0x46, 0xb9, 0x60, 0xcd, 0x4b, 0x17, 0x27, 0x42, 0x7b, 0x16, 0x51, 0x7b, 0x63, 0xeb, 0xfb, 0xcf, 0x84, 0xd0, 0xb1, 0xac, 0x8e, 0x7e, 0x70, 0xf0, 0x44, 0x35, 0x75, 0x22, 0xb1, 0xd0, 0xcb } +, + /* Signature */ + 129, + { 0x09, 0x76, 0x81, 0x12, 0x17, 0x71, 0x45, 0x44, 0x41, 0x01, 0x33, 0x24, 0x3b, 0xeb, 0xa9, 0xa2, 0x1a, 0x6f, 0x72, 0x12, 0xc6, 0x87, 0x91, 0x5c, 0x72, 0x02, 0x7b, 0xba, 0x31, 0x12, 0xf6, 0x97, 0x05, 0x42, 0x5c, 0xb9, 0x94, 0xcb, 0xb6, 0xd3, 0x59, 0xc1, 0x46, 0xb9, 0x5d, 0xb1, 0x44, 0x64, 0x35, 0xd4, 0xcf, 0x96, 0x1d, 0xfd, 0x5c, 0x49, 0x87, 0x39, 0xbf, 0xd4, 0xbe, 0x6e, 0xf1, 0xad, 0xd7, 0x4b, 0x81, 0xb2, 0x89, 0x8a, 0x4c, 0xe4, 0x3d, 0xc3, 0x7c, 0xb0, 0xe9, 0xed, 0x77, 0x44, 0xcf, 0x40, 0x9b, 0xab, 0xff, 0x71, 0x78, 0x85, 0x42, 0xff, 0xd2, 0x86, 0xeb, 0xe5, 0x25, 0x5d, 0x63, 0xdd, 0x7b, 0xd5, 0x5b, 0xa4, 0x3f, 0x51, 0x84, 0xe2, 0x48, 0xd3, 0xa6, 0x69, 0x33, 0xcd, 0xb0, 0x69, 0x91, 0xec, 0xc9, 0x0e, 0xb3, 0x9e, 0xe7, 0x1d, 0x65, 0xc8, 0x8e, 0xd2, 0x4d, 0x94, 0x4c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.10", + /* Message to be signed */ + 222, + { 0xa7, 0x90, 0xe6, 0xac, 0x5d, 0x55, 0x6f, 0xb7, 0xcf, 0x44, 0x46, 0x0c, 0x7b, 0x9b, 0xe5, 0xeb, 0x7f, 0x24, 0xf9, 0x87, 0xff, 0x89, 0x0d, 0xcb, 0x78, 0x40, 0x24, 0x1d, 0x45, 0x54, 0x5b, 0x71, 0x05, 0x63, 0x5a, 0x1a, 0xaf, 0x44, 0x57, 0xe6, 0x41, 0x0c, 0x65, 0xae, 0xce, 0x50, 0x11, 0xe2, 0x77, 0x5e, 0xc8, 0x53, 0x0a, 0x64, 0xa1, 0x88, 0x39, 0xe9, 0xc5, 0x8a, 0x7b, 0x77, 0x42, 0x4f, 0x74, 0x29, 0x3d, 0xcb, 0x9e, 0x9e, 0xa8, 0x73, 0x6d, 0x6b, 0xa5, 0x8b, 0x1c, 0x66, 0x53, 0xd5, 0x7b, 0xea, 0xab, 0x98, 0x73, 0x5f, 0x7a, 0xf7, 0x32, 0x47, 0x7b, 0x9a, 0xf6, 0xa3, 0x3f, 0xf0, 0x75, 0xc7, 0xe4, 0x66, 0x39, 0xd7, 0x48, 0x55, 0x08, 0x20, 0xba, 0x6a, 0xbd, 0x4a, 0x9d, 0x48, 0xcb, 0x49, 0x03, 0xf6, 0x5b, 0x76, 0xf8, 0x14, 0xc6, 0xcd, 0xc9, 0x5e, 0x8d, 0x9e, 0x87, 0x0c, 0x24, 0x4a, 0x02, 0x9b, 0x29, 0x4a, 0x8a, 0x5c, 0x82, 0x6a, 0xb1, 0x61, 0xf6, 0xf9, 0x78, 0xd9, 0xf1, 0xc0, 0x3f, 0xcd, 0xda, 0xae, 0xfb, 0xfa, 0xdb, 0x8c, 0xaa, 0xe8, 0x4b, 0xc2, 0xdd, 0x33, 0x2e, 0xb0, 0x49, 0x97, 0xd6, 0x1e, 0xfa, 0x91, 0xe9, 0x24, 0x1e, 0x4c, 0xcd, 0x97, 0x64, 0xc7, 0x26, 0xe7, 0x66, 0xed, 0x3b, 0x03, 0x38, 0xd0, 0x86, 0xf1, 0x03, 0x2c, 0x15, 0x33, 0xef, 0x59, 0x3f, 0x88, 0xfd, 0x56, 0x03, 0x37, 0x91, 0xb1, 0xd0, 0x62, 0x5c, 0x6c, 0xa5, 0x1e, 0xec, 0x27, 0x9c, 0xfb, 0x6a, 0xe3, 0xf1, 0x27, 0x00, 0xcf, 0x5b, 0xac, 0x27, 0x1e, 0x65, 0x67 } +, + /* Signature */ + 129, + { 0x0d, 0x1b, 0x11, 0x1c, 0xe8, 0xde, 0x1d, 0x7c, 0x4f, 0x7f, 0xce, 0xac, 0x73, 0xdf, 0x70, 0xaa, 0x6e, 0xda, 0x58, 0xdc, 0x32, 0xeb, 0x98, 0xf7, 0x8e, 0x7f, 0xb9, 0xbc, 0x25, 0xde, 0x3e, 0x6b, 0x09, 0xab, 0x8c, 0xae, 0x3b, 0x20, 0x26, 0xb6, 0x18, 0x7f, 0xf6, 0x36, 0x72, 0xe5, 0x7d, 0xa4, 0xac, 0x28, 0x96, 0x24, 0x45, 0xd1, 0xfe, 0x95, 0x1d, 0x27, 0xbe, 0x6a, 0x6c, 0xe7, 0xa5, 0x80, 0x7e, 0x13, 0x76, 0x13, 0x94, 0x46, 0xe8, 0x54, 0x9d, 0x48, 0xaa, 0x59, 0xfc, 0x22, 0x33, 0x54, 0xd1, 0x21, 0xfd, 0xcc, 0x38, 0xf1, 0xd0, 0x27, 0x5e, 0x41, 0x86, 0x92, 0x27, 0x00, 0xad, 0xc6, 0x1d, 0xae, 0x1e, 0x4b, 0xe8, 0x05, 0x22, 0x2a, 0x1c, 0xf0, 0x7f, 0x11, 0x0a, 0x61, 0x58, 0xa2, 0xa2, 0x62, 0x58, 0xf1, 0x9c, 0x65, 0x7a, 0x11, 0x0c, 0x0d, 0x9a, 0xd2, 0x91, 0x68, 0x0c, 0x75, 0x96 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.11", + /* Message to be signed */ + 256, + { 0x32, 0xaf, 0xd1, 0x3e, 0x60, 0x7d, 0x87, 0xb2, 0x5f, 0xf4, 0x0a, 0x88, 0x5b, 0x25, 0x09, 0xf5, 0x21, 0xf2, 0xa0, 0xa7, 0x72, 0xa9, 0x6a, 0x39, 0xfb, 0x3f, 0x71, 0xc9, 0x63, 0x84, 0xb3, 0xd7, 0x57, 0x8f, 0x48, 0xfc, 0xea, 0x97, 0x39, 0x56, 0x0a, 0x65, 0xbf, 0xb4, 0x83, 0xd9, 0x60, 0x8d, 0x20, 0x25, 0x55, 0xf6, 0x6d, 0x61, 0x2d, 0x16, 0xb9, 0x25, 0x53, 0x87, 0xb4, 0xe1, 0x12, 0x41, 0x15, 0xed, 0x48, 0xbf, 0xef, 0x8b, 0x89, 0xd8, 0xdd, 0xfc, 0x21, 0x9c, 0xcc, 0xe4, 0x87, 0x86, 0xc9, 0xe6, 0x42, 0x6a, 0x92, 0x12, 0xe7, 0xb1, 0x6d, 0x97, 0x1d, 0x27, 0x8a, 0x11, 0x18, 0xf2, 0xf8, 0x6b, 0x9c, 0x4b, 0xbf, 0x75, 0xc9, 0xc2, 0xd0, 0x99, 0xe3, 0xf6, 0x65, 0x48, 0xf1, 0xf4, 0xa8, 0xa8, 0x21, 0xd7, 0x27, 0x44, 0x98, 0xf7, 0xcc, 0xe6, 0xec, 0x5e, 0x2b, 0xf2, 0xbf, 0xad, 0x2c, 0x6f, 0xc0, 0x05, 0xe8, 0x0a, 0x48, 0xca, 0xe4, 0x69, 0x92, 0xfc, 0x82, 0x67, 0xa6, 0x48, 0x0a, 0xcb, 0x89, 0x4c, 0xcc, 0x9b, 0x62, 0x09, 0x5c, 0xad, 0x97, 0xdb, 0x70, 0xd8, 0x82, 0xa1, 0x3f, 0xb3, 0x85, 0x88, 0xc4, 0x8c, 0xa1, 0x90, 0xf1, 0x80, 0xcb, 0x3e, 0x61, 0xac, 0xb4, 0xe2, 0xcf, 0xd9, 0xc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0x36, 0x11, 0xb9, 0x7d, 0xa1, 0xac, 0x09, 0xcd, 0x12, 0x12, 0x50, 0x99, 0x54, 0x0b, 0xf7, 0xba, 0x99, 0xb0, 0x8c, 0x2f, 0x3d, 0x5f, 0x6a, 0xea, 0x7d, 0x40 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.12", + /* Message to be signed */ + 162, + { 0x5b, 0x00, 0xb8, 0xb7, 0x94, 0xa1, 0x0d, 0x21, 0xf1, 0xb4, 0x5e, 0xca, 0xa2, 0x0d, 0xf7, 0xc5, 0xb3, 0x52, 0x2c, 0x1b, 0x1d, 0xb4, 0xb0, 0x84, 0xb9, 0x59, 0xaa, 0x4e, 0x56, 0x58, 0xac, 0x54, 0x68, 0xf6, 0xe8, 0xfb, 0x61, 0x2f, 0xf9, 0x9f, 0x32, 0x16, 0xb5, 0xd2, 0x1c, 0xb4, 0xac, 0xc0, 0xbb, 0x42, 0xee, 0xfd, 0xb8, 0xe8, 0x2d, 0x75, 0x4b, 0x85, 0xd0, 0x97, 0x45, 0x89, 0x4a, 0x52, 0x3c, 0x01, 0x62, 0xd0, 0x8e, 0xcc, 0xe4, 0x8b, 0x99, 0xdd, 0x6c, 0x38, 0xe2, 0xbd, 0x3d, 0x53, 0x1c, 0x85, 0x62, 0xde, 0xec, 0xfc, 0x61, 0x52, 0x36, 0x9a, 0xac, 0xf5, 0x80, 0xea, 0xf9, 0xdb, 0x6c, 0x68, 0xb6, 0x9d, 0xf2, 0xfb, 0xf3, 0x05, 0x3f, 0x60, 0x1f, 0x70, 0x02, 0x2c, 0x9e, 0x38, 0x1d, 0xfb, 0xc5, 0x90, 0x99, 0xc3, 0x7b, 0xde, 0x5a, 0xd8, 0x9a, 0x8c, 0xc1, 0xef, 0xe4, 0xc7, 0xb7, 0xd7, 0x8e, 0x90, 0x97, 0xe0, 0x81, 0x21, 0xed, 0xa6, 0x4a, 0xc4, 0x5c, 0x32, 0x7e, 0x5e, 0xda, 0xf9, 0x22, 0xd3, 0xc3, 0x5f, 0x88, 0xb5, 0x2c, 0x93, 0xd3, 0x99, 0xf4, 0xc2, 0x38, 0x36, 0x2f, 0xe9 } +, + /* Signature */ + 129, + { 0x0f, 0xc6, 0xac, 0x1d, 0x42, 0x94, 0x79, 0x38, 0xcd, 0x25, 0x86, 0xd0, 0xe7, 0xfc, 0x3a, 0x05, 0x42, 0xb9, 0xaf, 0x12, 0xd3, 0x6e, 0xeb, 0xf9, 0x2b, 0x5d, 0x04, 0x9c, 0x79, 0x65, 0xb1, 0x1b, 0xa9, 0xcc, 0xbf, 0x47, 0x00, 0xf3, 0x45, 0x60, 0x91, 0x11, 0x77, 0xb9, 0xd1, 0x29, 0x6f, 0x1c, 0x68, 0xe3, 0xaf, 0x46, 0x9f, 0x4f, 0x39, 0x9d, 0xbc, 0x18, 0x9c, 0x23, 0xea, 0x74, 0x65, 0x98, 0x28, 0x13, 0x32, 0x33, 0x05, 0xed, 0x6c, 0x35, 0xff, 0x9c, 0xc1, 0x09, 0xd0, 0xa2, 0x30, 0x3f, 0xe7, 0xd3, 0x29, 0xca, 0x31, 0x7e, 0xc4, 0xb1, 0x8e, 0xdd, 0x19, 0xc6, 0x2c, 0x60, 0xa3, 0xc8, 0xc3, 0x10, 0x6f, 0x86, 0xdb, 0xd0, 0x72, 0xe3, 0xe1, 0xeb, 0x87, 0x85, 0x28, 0x8c, 0x21, 0xab, 0xca, 0xc2, 0x2e, 0x0c, 0x0d, 0x41, 0xf4, 0xe2, 0x3e, 0x7f, 0x39, 0x4d, 0x46, 0x82, 0xf6, 0xce, 0x87 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.13", + /* Message to be signed */ + 26, + { 0xb7, 0x50, 0xae, 0x6d, 0x4d, 0x2c, 0xeb, 0x92, 0x14, 0x05, 0x34, 0x64, 0x8d, 0x36, 0xef, 0x25, 0xe4, 0x51, 0x55, 0xf5, 0x2b, 0xde, 0x1b, 0xf2, 0x6a, 0xb7 } +, + /* Signature */ + 129, + { 0x16, 0xaa, 0xde, 0xdc, 0xa0, 0x9e, 0x06, 0x25, 0x60, 0xc6, 0x61, 0xd2, 0xa4, 0x9b, 0x0e, 0xe4, 0xd9, 0xce, 0x23, 0x90, 0x7c, 0x69, 0xd1, 0x00, 0x04, 0xf1, 0x49, 0xd1, 0x03, 0xc5, 0x9c, 0x16, 0xfe, 0x7d, 0x43, 0x73, 0x59, 0x7d, 0xb9, 0xff, 0xd8, 0x92, 0x3a, 0x77, 0xa6, 0xb9, 0x43, 0xb1, 0x88, 0xc4, 0x74, 0x25, 0xe2, 0xa9, 0xe5, 0x30, 0x41, 0x3e, 0xfd, 0xb6, 0x84, 0x8d, 0xd3, 0x42, 0x0b, 0xa5, 0x3e, 0xf8, 0x1c, 0x25, 0xc5, 0x78, 0xf8, 0xd9, 0x51, 0x4d, 0x93, 0xfc, 0xc9, 0xcb, 0x1f, 0xb5, 0x2f, 0x58, 0xd8, 0x8a, 0x57, 0xd1, 0xfd, 0x3f, 0xe2, 0x2d, 0xa3, 0x10, 0xec, 0xea, 0x9e, 0xce, 0x55, 0xe9, 0x60, 0x8d, 0x63, 0xae, 0x21, 0xdb, 0xae, 0xa6, 0x57, 0x1b, 0x78, 0xfc, 0xfd, 0xd2, 0x71, 0xbb, 0x65, 0x92, 0x57, 0x47, 0x6b, 0x59, 0x95, 0x68, 0x7a, 0x02, 0xbb, 0xe7, 0x89 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.14", + /* Message to be signed */ + 183, + { 0x47, 0xbe, 0x01, 0x02, 0x0e, 0xb7, 0xe7, 0x87, 0x5b, 0xd4, 0xfc, 0xc0, 0x05, 0xa8, 0x2b, 0x36, 0xfd, 0xf2, 0x14, 0x5e, 0xf1, 0x32, 0xe2, 0xed, 0x16, 0x2f, 0xf6, 0x94, 0xbc, 0x71, 0x58, 0x9c, 0x7d, 0xc6, 0xd5, 0xa3, 0xf8, 0x9d, 0x59, 0x7f, 0x2d, 0x2a, 0xa3, 0x43, 0x33, 0x51, 0x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2d, 0xf6, 0x1f, 0xfd, 0xb3, 0x17, 0x54, 0x96, 0x65, 0x61, 0x0c, 0x84, 0xbd, 0xb8, 0x94, 0x5f, 0xc6, 0xbb, 0xd3, 0x8b, 0xae, 0xd7, 0xfe, 0xe9, 0x8e, 0xb0, 0x56, 0xd9, 0xf0, 0x39, 0xa8, 0x60, 0xd4, 0x52, 0xb3, 0xac, 0xac, 0x18, 0x00, 0xa9, 0x32, 0xa2, 0x8c, 0x88, 0x28, 0x6a, 0xbd, 0xa8, 0xde, 0x3c, 0xb6, 0xc0, 0xd7, 0x94, 0xda, 0xab, 0x7a, 0x8b, 0xa0, 0x11, 0x09, 0x33, 0xb4, 0xd1, 0xde, 0xd2, 0x39, 0xcb, 0xdd, 0x55, 0x7d, 0x3e, 0x5a, 0x16, 0x29, 0x17, 0x85, 0x33, 0x15, 0xde, 0x68, 0x09, 0x00, 0xa8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.15", + /* Message to be signed */ + 238, + { 0x4b, 0x9c, 0x09, 0x64, 0x48, 0x10, 0xd4, 0xb3, 0x06, 0x55, 0xed, 0x83, 0x38, 0xbb, 0x27, 0x6b, 0x62, 0x4c, 0x68, 0x01, 0x98, 0x22, 0xd1, 0xfc, 0x8f, 0x78, 0x86, 0x1e, 0x13, 0xe2, 0x2a, 0xc1, 0x71, 0x82, 0x1c, 0xfd, 0xbd, 0x3f, 0x8f, 0x5b, 0x8d, 0xc9, 0xc0, 0xde, 0x73, 0x2b, 0x74, 0x6e, 0x1d, 0x13, 0x2e, 0x5f, 0x3f, 0x14, 0x9a, 0x5a, 0x86, 0x7c, 0x2e, 0xe4, 0x78, 0xe8, 0xf1, 0x4a, 0xd4, 0xb9, 0xdd, 0xeb, 0xd3, 0xae, 0x78, 0x17, 0xe8, 0x49, 0x55, 0xb3, 0x40, 0x4b, 0x09, 0x43, 0x93, 0xe6, 0x1c, 0xa0, 0x18, 0x9d, 0x05, 0x53, 0x69, 0xb4, 0x24, 0x30, 0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c0, 0xd4, 0x8d, 0xc0, 0x4b, 0xef, 0xac, 0x2c, 0x67, 0xa4, 0xd0, 0x69, 0xa7, 0x20, 0x8f, 0x14, 0x2d, 0xc2, 0x67, 0xb3, 0xe3, 0x8f, 0x63, 0x38, 0xa0, 0xb1, 0x83, 0x9a, 0x93, 0xa8, 0x36, 0x80, 0x7d, 0x18, 0x1e, 0x3f, 0x0c, 0x7e, 0x87, 0x7f, 0xb2, 0x42, 0x16, 0x02, 0x00, 0x5b, 0xca, 0x25, 0xa9, 0xc3, 0x72, 0x26, 0x6d, 0x18, 0xe6, 0xd5, 0x00, 0xc5, 0xc7, 0xab, 0x13, 0x38, 0x52, 0x83, 0xd2, 0xaf, 0x91, 0x9d, 0x0b, 0xba, 0x0d, 0xcb, 0x88, 0xbf, 0x7b, 0xb9, 0x97, 0x2d, 0x67, 0x00, 0x8f, 0xf4, 0x98, 0x54, 0x7d, 0x80, 0xfc, 0xa6, 0x58, 0xef, 0xe7, 0x64, 0xa5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.16", + /* Message to be signed */ + 216, + { 0xec, 0x9f, 0xf1, 0x4b, 0x9f, 0x19, 0x7a, 0x2b, 0x4f, 0x24, 0x94, 0x8c, 0x29, 0xd2, 0xf6, 0x4a, 0x64, 0x62, 0x52, 0x23, 0xdd, 0xb8, 0x53, 0x46, 0x37, 0x8c, 0x2c, 0x25, 0x34, 0x3f, 0xcb, 0xef, 0x58, 0x5a, 0x99, 0xe1, 0xec, 0x0b, 0xef, 0x0e, 0xf9, 0xd0, 0x9e, 0xad, 0x85, 0xbe, 0xe1, 0xc4, 0xbf, 0xb3, 0x5e, 0x48, 0xfb, 0x26, 0x41, 0x1b, 0xdf, 0x18, 0x0d, 0xc5, 0xcf, 0x31, 0x7b, 0x3a, 0x34, 0x83, 0x71, 0xc7, 0xc5, 0xf4, 0xaa, 0x6d, 0x59, 0x08, 0xfc, 0xfc, 0x1e, 0xa3, 0x90, 0x18, 0xcf, 0x04, 0x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 0x9d, 0xd0, 0xfd, 0x82, 0x93, 0xea, 0xca, 0x4a, 0xf3, 0xd3, 0xa9, 0xdc, 0x51, 0x8c, 0x8e, 0x49, 0x5a, 0x14, 0x76, 0x95, 0x11, 0x1d, 0x3d, 0xc1, 0x77, 0x63, 0xf1, 0xf0, 0x2e, 0xec, 0x1e, 0xe2, 0x9f, 0xb1, 0xab, 0x74, 0x9c, 0xf3, 0x0c, 0x78, 0x86, 0xda, 0x8b, 0x2f, 0x64, 0x69, 0x69, 0x59, 0x8a, 0xa7, 0x0f, 0x9a, 0x92, 0xfa, 0x4f, 0x93, 0x5c, 0x7c, 0xc7, 0x7b, 0xfa, 0xb6, 0x98, 0x1f, 0x0d, 0xf0, 0xd2, 0x85, 0xcf, 0xb1, 0x0d, 0x66, 0x58, 0x15, 0x39, 0xf7, 0x8d, 0x03, 0x68, 0xed, 0x4f, 0x93, 0x01 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.17", + /* Message to be signed */ + 209, + { 0x41, 0x4c, 0xea, 0x8e, 0xec, 0x6d, 0xa3, 0xc6, 0x6f, 0xfc, 0x84, 0x70, 0xf7, 0xe1, 0x47, 0x60, 0xf7, 0x4b, 0xf6, 0xe7, 0x5b, 0x84, 0xdc, 0x98, 0xfc, 0x80, 0x60, 0xdd, 0x3c, 0x21, 0x9e, 0x76, 0x77, 0x7d, 0xfa, 0xba, 0xa6, 0xe6, 0xb9, 0x29, 0x55, 0x37, 0x9f, 0x3e, 0xca, 0xaf, 0x5f, 0xcb, 0x8a, 0xa5, 0x54, 0x9e, 0xc9, 0xcd, 0xd1, 0xf5, 0xd5, 0x77, 0x20, 0x1b, 0x8e, 0x32, 0x9f, 0x72, 0xfa, 0xa2, 0xbc, 0xad, 0xea, 0xee, 0x38, 0x8d, 0xaf, 0x7d, 0x40, 0x8a, 0xfd, 0xe6, 0x55, 0x3d, 0x24, 0x17, 0x86, 0x0f, 0x3c, 0x8e, 0x25, 0x30, 0x5d, 0xff, 0x76, 0xdb, 0xbd, 0x95, 0x16, 0xb6, 0x86, 0x8e, 0xe4, 0x56, 0xfc, 0x1f, 0x7b, 0x58, 0xd9, 0xed, 0x18, 0xa4, 0x6e, 0x4f, 0xc1, 0xe3, 0x53, 0xe8, 0xd0, 0x76, 0xbe, 0xa3, 0x0b, 0xf2, 0x47, 0xc6, 0x0e, 0x6f, 0x68, 0x58, 0x01, 0xa6, 0xd3, 0xf6, 0x30, 0xae, 0xa6, 0xab, 0xb4, 0x12, 0xa9, 0x41, 0xff, 0xa6, 0xf6, 0x07, 0xf6, 0xbf, 0xb1, 0x3d, 0x90, 0x01, 0x27, 0xbb, 0xec, 0xee, 0x4f, 0x98, 0xa7, 0xac, 0xa6, 0x92, 0x08, 0x11, 0x57, 0x50, 0x53, 0xab, 0x2d, 0x42, 0x70, 0x13, 0x80, 0x1d, 0x8c, 0xfb, 0xc3, 0x88, 0x0f, 0x14, 0x75, 0x43, 0x15, 0x55, 0xa0, 0x86, 0xfa, 0x55, 0x60, 0xc6, 0xe2, 0x20, 0x6d, 0x9e, 0xe9, 0x38, 0x13, 0x44, 0xb8, 0x24, 0x1c, 0x1d, 0xd1, 0xd8, 0x64, 0x48, 0x75, 0x3a, 0xf4, 0x4b, 0x00, 0xa0, 0xc9 } +, + /* Signature */ + 129, + { 0x16, 0x97, 0xbb, 0x23, 0xe2, 0x91, 0x52, 0x5f, 0x4a, 0x0e, 0x79, 0x26, 0x2f, 0x34, 0x06, 0x63, 0x0d, 0x0d, 0x6d, 0xf3, 0x32, 0x49, 0x69, 0x26, 0xc4, 0xe5, 0xae, 0xf9, 0x6e, 0x41, 0xd9, 0x55, 0x14, 0x86, 0x47, 0xea, 0xf7, 0x90, 0x69, 0x6a, 0xf6, 0x8c, 0x78, 0xeb, 0x2a, 0xb6, 0x2f, 0xf7, 0x19, 0x62, 0x96, 0xe1, 0xea, 0x88, 0x6d, 0xf0, 0x91, 0x73, 0x66, 0x09, 0x0b, 0x63, 0x0a, 0xa3, 0x18, 0x58, 0xb5, 0x16, 0x15, 0x87, 0x3f, 0xa6, 0xbc, 0x8f, 0xf0, 0x88, 0x5c, 0x57, 0xb2, 0xe7, 0x7a, 0x04, 0x90, 0x88, 0x93, 0xcc, 0xef, 0xb1, 0x41, 0x24, 0x03, 0x99, 0x1d, 0x0d, 0x23, 0xc5, 0x57, 0xd2, 0x22, 0x29, 0x1c, 0xb8, 0x51, 0x7b, 0x43, 0x28, 0x6e, 0xe0, 0x05, 0x67, 0x58, 0xd9, 0xc1, 0x0b, 0xcd, 0x69, 0xbd, 0x68, 0xb8, 0x4a, 0x2d, 0x1f, 0x53, 0x79, 0x05, 0xb8, 0xa4, 0x65, 0xe9 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.18", + /* Message to be signed */ + 169, + { 0x17, 0x89, 0xb8, 0x08, 0xb1, 0x0d, 0xe8, 0xd1, 0x77, 0x8a, 0xa4, 0x3f, 0x94, 0x10, 0x1c, 0xb8, 0x9f, 0x56, 0x34, 0x30, 0x61, 0xa1, 0xa9, 0x43, 0xbb, 0x8d, 0xa5, 0x5e, 0xe6, 0xb9, 0x79, 0xe2, 0x7a, 0xfe, 0xab, 0x0e, 0xd8, 0xee, 0x37, 0x14, 0xfb, 0xe7, 0x0b, 0x3b, 0xe8, 0x20, 0x60, 0x3e, 0x5c, 0xea, 0xde, 0xc4, 0xb2, 0x2f, 0x95, 0x87, 0x73, 0x22, 0x5d, 0xf3, 0xaa, 0xd4, 0x87, 0xb2, 0x80, 0x57, 0xeb, 0xfe, 0xbe, 0x2c, 0x87, 0x93, 0xda, 0x38, 0x46, 0xbd, 0xb1, 0x59, 0x03, 0xac, 0x71, 0xe9, 0xc9, 0x3b, 0x20, 0x16, 0x66, 0x8b, 0xd9, 0x06, 0x30, 0x1a, 0x0a, 0x7d, 0x50, 0xdc, 0x60, 0xb2, 0xfa, 0xd8, 0x75, 0x9d, 0x18, 0xdb, 0x14, 0x7f, 0x20, 0x66, 0x86, 0x5f, 0xd9, 0x09, 0x50, 0xa1, 0x88, 0x74, 0x7d, 0x9b, 0x69, 0x68, 0x53, 0x48, 0x6d, 0xea, 0xab, 0x8e, 0x44, 0x3f, 0xad, 0x29, 0x92, 0xfc, 0x8a, 0x56, 0x5b, 0xdc, 0xba, 0xda, 0xb0, 0xb9, 0x33, 0x3a, 0xb7, 0xfc, 0xdb, 0x9c, 0x3d, 0x0b, 0xcf, 0xde, 0x50, 0xa5, 0x8d, 0x2a, 0xea, 0xf1, 0xce, 0xfb, 0x0c, 0x95, 0xf9, 0x07, 0x73, 0xb2, 0xfa, 0xc1, 0x37, 0xcd, 0xbc } +, + /* Signature */ + 129, + { 0x02, 0xf9, 0x97, 0x51, 0xc8, 0x44, 0x38, 0xea, 0xc7, 0xf9, 0x96, 0x32, 0x50, 0xd9, 0xee, 0x22, 0xfd, 0xa7, 0x29, 0x7b, 0x6e, 0x86, 0xe2, 0xa8, 0xbc, 0xc7, 0xa9, 0xb5, 0xac, 0x01, 0xf7, 0x90, 0xe0, 0x99, 0x11, 0x70, 0x46, 0x60, 0x85, 0x8e, 0xa5, 0xc1, 0x62, 0x72, 0xc3, 0x81, 0x33, 0xfa, 0xda, 0xde, 0xfa, 0x23, 0xc1, 0x02, 0x90, 0x8e, 0x41, 0x9d, 0xe2, 0xeb, 0xe9, 0xac, 0x27, 0x19, 0x45, 0x72, 0x87, 0x8e, 0x2a, 0x97, 0x1f, 0x88, 0x31, 0xc8, 0xf9, 0x17, 0xe8, 0x52, 0xe8, 0x51, 0xdf, 0x99, 0xd4, 0xdf, 0x01, 0x8f, 0xdd, 0xb2, 0xce, 0xa3, 0x1a, 0xc3, 0xa7, 0xb6, 0x89, 0x75, 0xe8, 0x0a, 0x99, 0x7c, 0xb7, 0xdd, 0x4d, 0x4d, 0xf7, 0x57, 0xbb, 0x8c, 0x3e, 0xcd, 0x91, 0x0b, 0xcb, 0x06, 0x03, 0x35, 0x52, 0x12, 0x7a, 0xc3, 0x08, 0x11, 0x77, 0x39, 0xa0, 0x2c, 0x20, 0x17, 0x17 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.19", + /* Message to be signed */ + 151, + { 0xff, 0x87, 0x5c, 0xca, 0x0e, 0xfc, 0x3d, 0x90, 0xf5, 0x6e, 0x31, 0xf4, 0xbb, 0x66, 0x84, 0x14, 0x89, 0x4d, 0x09, 0xde, 0x90, 0x12, 0x7f, 0x84, 0x66, 0x32, 0x43, 0x10, 0xe1, 0x13, 0x69, 0xa3, 0xf2, 0xf6, 0x49, 0x3c, 0x1c, 0x78, 0xa3, 0x62, 0xb2, 0xa1, 0x4f, 0xb5, 0x48, 0x8c, 0xb5, 0x6c, 0xe0, 0x22, 0x73, 0x9e, 0x43, 0xaa, 0x76, 0x3d, 0x9c, 0x1c, 0x97, 0xb6, 0x21, 0xcc, 0x53, 0x68, 0xc9, 0xc0, 0x0e, 0x81, 0x60, 0x67, 0x92, 0x69, 0x5f, 0x9a, 0xf9, 0xab, 0x63, 0x3e, 0xf2, 0x39, 0xea, 0xb3, 0x44, 0x9d, 0xda, 0x9e, 0x66, 0x07, 0x08, 0x9c, 0x37, 0x51, 0x90, 0x35, 0x4f, 0x7a, 0x59, 0xa4, 0xb3, 0xef, 0x75, 0x22, 0x9d, 0x1c, 0x47, 0xec, 0xda, 0xe3, 0x3b, 0x27, 0x69, 0xff, 0x55, 0x42, 0x65, 0x5e, 0x78, 0x10, 0x22, 0xd0, 0xc4, 0x3b, 0x42, 0x1a, 0x99, 0x84, 0x3c, 0x3d, 0xe1, 0x04, 0x22, 0xad, 0x2f, 0xd8, 0x9d, 0xfe, 0x44, 0x66, 0x15, 0xf5, 0x19, 0x2e, 0x75, 0x79, 0xd4, 0x37, 0x43, 0x79, 0xbb, 0xff, 0xb9 } +, + /* Signature */ + 129, + { 0x02, 0x68, 0x91, 0x7f, 0x8b, 0xda, 0xac, 0x9e, 0xbe, 0x32, 0xb0, 0xdc, 0x6c, 0xd9, 0xd3, 0x9e, 0xfd, 0x3f, 0x88, 0xd8, 0x17, 0xd6, 0x6c, 0xb6, 0x39, 0x0d, 0x7b, 0x55, 0xc6, 0x92, 0x12, 0x21, 0x84, 0x4a, 0xb8, 0xc0, 0x89, 0x86, 0xd3, 0xf2, 0xea, 0x49, 0xbc, 0x6e, 0x3a, 0x10, 0x02, 0x08, 0x6c, 0x0b, 0x6d, 0xf1, 0x63, 0xf7, 0x9d, 0x16, 0x11, 0x6a, 0x93, 0xc4, 0xa2, 0xcc, 0x04, 0x22, 0xc9, 0x48, 0x41, 0xe1, 0xe3, 0xb9, 0x45, 0xab, 0x1d, 0x25, 0x3a, 0xb8, 0xd7, 0xd1, 0x39, 0xc9, 0x18, 0x8b, 0xa8, 0x30, 0x27, 0xc5, 0x93, 0xf8, 0x3a, 0x6f, 0x38, 0x37, 0x0e, 0x7f, 0x03, 0x79, 0xff, 0xdd, 0xf1, 0x42, 0x7d, 0x6f, 0xcc, 0xcf, 0x60, 0x83, 0x31, 0x3f, 0x18, 0x15, 0xb5, 0xde, 0xd6, 0x73, 0x74, 0x30, 0xbb, 0x4a, 0x70, 0xba, 0x81, 0x48, 0x48, 0x34, 0xd8, 0xd1, 0xd2, 0x9a, 0x5e } + +} +, +{ + "PKCS#1 v1.5 Signature Example 11.20", + /* Message to be signed */ + 86, + { 0xe0, 0x7e, 0xcf, 0x00, 0xe2, 0x40, 0x1a, 0xc9, 0x8b, 0x2d, 0x5a, 0xe0, 0xc9, 0xb8, 0x3f, 0x21, 0x9a, 0xb0, 0x27, 0xa6, 0x51, 0x99, 0xfd, 0xb6, 0x34, 0x59, 0x6e, 0x23, 0x44, 0x62, 0x41, 0x38, 0x72, 0x95, 0x32, 0x49, 0x53, 0x28, 0xf9, 0x3f, 0xb3, 0xa3, 0x32, 0x55, 0x27, 0x8f, 0x3e, 0xc2, 0x60, 0x65, 0xce, 0x54, 0x99, 0x5d, 0x42, 0x41, 0x93, 0xbc, 0xb7, 0x58, 0x1b, 0xfe, 0x1a, 0xb8, 0x95, 0x7d, 0x0b, 0x96, 0x1c, 0x30, 0x30, 0xb8, 0x20, 0xd0, 0x9c, 0x9e, 0x32, 0x6c, 0xc3, 0x0c, 0x0a, 0xf6, 0x42, 0x66, 0x61, 0x54 } +, + /* Signature */ + 129, + { 0x00, 0xc4, 0x6d, 0xb4, 0x1b, 0x65, 0xdd, 0xc7, 0x1f, 0xbb, 0xfc, 0x12, 0x5a, 0x4f, 0x9b, 0xab, 0x88, 0x0a, 0x2f, 0x0c, 0x1f, 0x04, 0x1c, 0x41, 0x1d, 0xf7, 0xd4, 0x5d, 0x1e, 0x19, 0x99, 0x7b, 0x34, 0x8e, 0xab, 0xba, 0x19, 0xbf, 0x79, 0xb2, 0x21, 0x77, 0xb2, 0xa0, 0xd7, 0x3f, 0xef, 0xa5, 0x00, 0x83, 0x62, 0xce, 0x59, 0x60, 0xd7, 0xef, 0x58, 0xa5, 0x89, 0x93, 0xe7, 0x46, 0x03, 0xd4, 0xd9, 0xd0, 0xb3, 0xda, 0xd4, 0xb2, 0x0c, 0x82, 0x9d, 0x36, 0xef, 0xca, 0xf5, 0x7f, 0x0c, 0x4f, 0x0c, 0xef, 0x89, 0x01, 0x5a, 0x48, 0x45, 0x02, 0x42, 0xbd, 0x02, 0x0d, 0x5f, 0x52, 0xd8, 0xb5, 0x0e, 0xa1, 0x3e, 0x56, 0xa1, 0xaa, 0xd6, 0x01, 0x91, 0x5d, 0x60, 0xec, 0x9a, 0xbf, 0xc3, 0x07, 0xf1, 0x8a, 0xf2, 0x06, 0x72, 0x38, 0x4d, 0xcc, 0x12, 0xf9, 0x82, 0x27, 0x31, 0x36, 0x99, 0x71, 0x40 } + +} +, +} +}, +{ + "Example 12: A 1030-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x36, 0x98, 0x1a, 0x95, 0xae, 0x24, 0x18, 0x14, 0x52, 0xda, 0x25, 0x7c, 0x03, 0x8f, 0x05, 0x82, 0x14, 0x12, 0xd8, 0x4e, 0xb4, 0x7a, 0x43, 0xfc, 0xc7, 0xef, 0x12, 0x17, 0x95, 0x9b, 0xa6, 0x77, 0x02, 0x7f, 0x70, 0x86, 0xd3, 0xa8, 0x5c, 0xdd, 0x34, 0x9f, 0x92, 0x0f, 0x03, 0x4c, 0x02, 0x78, 0x79, 0x2d, 0xc8, 0xa8, 0xcf, 0x0c, 0x00, 0x80, 0xe5, 0xc6, 0x1f, 0x47, 0x48, 0x83, 0xc6, 0x87, 0x9f, 0x4d, 0xee, 0x0a, 0xe9, 0x52, 0x47, 0x8a, 0x5e, 0xe2, 0xce, 0x4e, 0x39, 0x18, 0x64, 0x1e, 0x81, 0x3c, 0xb3, 0x74, 0xf7, 0xb2, 0x83, 0x2b, 0xcd, 0x6a, 0xea, 0x80, 0x9d, 0x25, 0x4f, 0xc2, 0xca, 0x9a, 0xc5, 0xa3, 0x32, 0x42, 0x4a, 0xb6, 0x5c, 0x2a, 0x26, 0x12, 0x75, 0xd1, 0x9a, 0x41, 0x4b, 0x61, 0x65, 0x00, 0xd5, 0xe3, 0x73, 0x70, 0x63, 0x15, 0xf0, 0x63, 0xdc, 0x88, 0x5d, 0x7f, 0xb9 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 129, + { 0x09, 0xad, 0x03, 0x17, 0x30, 0xb6, 0x32, 0x73, 0x55, 0xac, 0xd6, 0x94, 0x68, 0x70, 0x0e, 0x7e, 0x9b, 0xae, 0xac, 0x5a, 0x24, 0xa7, 0xff, 0xc9, 0x3b, 0x29, 0x2e, 0xb8, 0x71, 0xda, 0x54, 0x92, 0x46, 0xa5, 0xce, 0x0c, 0x83, 0x52, 0x55, 0x65, 0x1a, 0x28, 0xc6, 0xe2, 0xf4, 0xc7, 0x61, 0xaf, 0xb6, 0xf0, 0x6b, 0x9e, 0x29, 0x95, 0xfb, 0xb7, 0xdc, 0xa1, 0x74, 0xd5, 0x36, 0x2f, 0xae, 0xbd, 0xc3, 0x9a, 0x72, 0xc5, 0x79, 0x5d, 0x1f, 0x33, 0x92, 0xec, 0x08, 0x8b, 0x5d, 0xc2, 0xa7, 0x85, 0xb2, 0xc9, 0xc4, 0xc6, 0xe6, 0x69, 0xe7, 0x23, 0xb5, 0xdd, 0x0c, 0xe4, 0x43, 0x25, 0x55, 0x12, 0x67, 0xdd, 0x62, 0xe0, 0xf7, 0x8d, 0x24, 0x24, 0xad, 0xae, 0x48, 0xe2, 0x49, 0x44, 0x3a, 0xef, 0x4a, 0x37, 0x04, 0x10, 0xdb, 0x9e, 0x70, 0x93, 0x99, 0xac, 0x37, 0xcc, 0x48, 0x1b, 0x59, 0x00, 0xc5 } +, + /* Prime 1 */ + 65, + { 0x07, 0x72, 0x0f, 0x21, 0xcd, 0xdb, 0x92, 0x27, 0x45, 0xb7, 0x1c, 0xf8, 0x11, 0x6a, 0x83, 0x66, 0x9a, 0x0d, 0xdb, 0x89, 0xe8, 0xf3, 0xf0, 0x6c, 0x34, 0x7c, 0xa7, 0x87, 0xcf, 0x10, 0xef, 0x16, 0x93, 0xbd, 0xfe, 0x3a, 0x0c, 0x36, 0x4c, 0x7a, 0x7e, 0x89, 0x04, 0x17, 0xf2, 0xaf, 0x49, 0x47, 0x5c, 0x7d, 0x07, 0x6f, 0x9c, 0xee, 0xaa, 0xe7, 0x6d, 0xbd, 0x4e, 0x92, 0x15, 0xaf, 0x45, 0x69, 0x4d } +, + /* Prime 2 */ + 65, + { 0x07, 0x55, 0x1c, 0x27, 0xe9, 0xaa, 0xf1, 0x1f, 0x47, 0x4f, 0x1c, 0x9a, 0x14, 0xbf, 0x14, 0x4c, 0xfa, 0xef, 0xe2, 0x7f, 0xca, 0x4f, 0x20, 0x79, 0x5d, 0xec, 0x85, 0x34, 0xc9, 0x37, 0xbb, 0x00, 0xfe, 0x16, 0x23, 0x5e, 0xcd, 0x69, 0x1f, 0xd2, 0x3e, 0x32, 0xcd, 0xfb, 0x8b, 0x78, 0x66, 0x6b, 0xb7, 0x82, 0x84, 0xae, 0x15, 0xd5, 0x9b, 0xe5, 0xca, 0x74, 0x73, 0xe6, 0x2d, 0x46, 0xa9, 0xda, 0x1d } +, + /* Prime exponent 1 */ + 65, + { 0x02, 0xe2, 0x2c, 0x74, 0x16, 0x0a, 0x94, 0x36, 0xbb, 0x6c, 0x28, 0x3e, 0xf6, 0x57, 0xbe, 0xdd, 0xec, 0x89, 0xb3, 0x5d, 0x5c, 0xa7, 0xa4, 0x93, 0xf3, 0x5b, 0xd7, 0x71, 0xe4, 0x42, 0x95, 0xa5, 0xb3, 0xc0, 0x20, 0x06, 0x11, 0x16, 0xb2, 0x55, 0xba, 0x4d, 0x8c, 0x15, 0x4e, 0x3a, 0x8e, 0x71, 0xa1, 0xa3, 0x16, 0x4f, 0x26, 0x82, 0xd4, 0x13, 0x5e, 0xcf, 0xb2, 0xef, 0x26, 0x90, 0xc3, 0x9b, 0xfd } +, + /* Prime exponent 2 */ + 65, + { 0x01, 0xd2, 0xbf, 0xf5, 0x8c, 0xbc, 0xdc, 0xc8, 0x12, 0x4b, 0x31, 0xa9, 0x7e, 0x8f, 0x24, 0xd5, 0x1f, 0x70, 0x96, 0xb9, 0x7f, 0xec, 0xbc, 0xfe, 0x70, 0xc4, 0x67, 0x3b, 0x00, 0xed, 0xc2, 0xaa, 0x34, 0x83, 0xfc, 0xb7, 0x8e, 0x0c, 0x1d, 0xc5, 0x81, 0x81, 0xd0, 0x86, 0x43, 0xdf, 0xe4, 0x57, 0xd4, 0x81, 0xb7, 0xcc, 0x31, 0xd1, 0xb3, 0xba, 0x27, 0xe5, 0x5d, 0x0c, 0x57, 0x25, 0xc3, 0x06, 0x61 } +, + /* Coefficient */ + 65, + { 0x06, 0xd2, 0x27, 0x72, 0x57, 0x42, 0xef, 0x03, 0x46, 0x2d, 0x1c, 0xf6, 0x12, 0x67, 0x4a, 0x78, 0x83, 0x1d, 0x61, 0x9d, 0xa3, 0xd6, 0x40, 0xeb, 0x7c, 0x71, 0xc8, 0x7b, 0x53, 0x28, 0x69, 0x72, 0x73, 0xc5, 0xf7, 0x51, 0xe1, 0x4d, 0x7b, 0x81, 0xc1, 0x2b, 0x6d, 0xeb, 0x44, 0x75, 0x1a, 0x92, 0x95, 0xcb, 0x67, 0x1e, 0x81, 0x48, 0x4d, 0xea, 0xa8, 0x3b, 0x4d, 0xf1, 0xfd, 0x37, 0xe2, 0xff, 0x3c } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 12.1", + /* Message to be signed */ + 9, + { 0xe4, 0xb2, 0xd6, 0x0e, 0x3b, 0xdd, 0x27, 0x81, 0x6f } +, + /* Signature */ + 129, + { 0x13, 0xfd, 0x4a, 0xc1, 0xac, 0x68, 0x48, 0x17, 0x37, 0x80, 0x96, 0x5a, 0xff, 0x5e, 0x61, 0xc5, 0x96, 0x89, 0x2b, 0xc1, 0x47, 0x76, 0x0d, 0x43, 0x07, 0x9b, 0x5d, 0x71, 0x77, 0xe4, 0x23, 0xd4, 0x86, 0xf5, 0xa7, 0x3e, 0x1a, 0x16, 0xb3, 0xce, 0x9b, 0x5e, 0xda, 0xc1, 0x61, 0xea, 0x6d, 0x4f, 0x6c, 0x23, 0xfc, 0xfc, 0x3e, 0x62, 0x19, 0xca, 0xc5, 0x56, 0x06, 0x7f, 0xfa, 0xed, 0x4a, 0xda, 0xc0, 0xa9, 0x50, 0x05, 0x09, 0x0b, 0x89, 0x84, 0x4c, 0x54, 0x35, 0x4d, 0xb2, 0x2a, 0xaf, 0xf9, 0xee, 0xff, 0x9d, 0xa5, 0xaa, 0xa5, 0x49, 0x04, 0x25, 0xe1, 0x35, 0xcc, 0x0f, 0x64, 0x58, 0x4c, 0x7f, 0x05, 0xfe, 0x33, 0x6e, 0x44, 0x40, 0xbb, 0x86, 0x92, 0x86, 0xd4, 0x4a, 0xf1, 0x57, 0x88, 0x0e, 0x3a, 0x40, 0xfb, 0x06, 0x72, 0x5d, 0x09, 0xde, 0xb3, 0x7f, 0x1e, 0xbb, 0x18, 0x1c, 0x8f, 0x5c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.2", + /* Message to be signed */ + 164, + { 0x78, 0x86, 0x85, 0xfc, 0x58, 0x05, 0xd6, 0x27, 0xb1, 0x3f, 0x2f, 0xe7, 0xfe, 0x6f, 0x7c, 0x9a, 0xb2, 0xca, 0x49, 0x44, 0xab, 0xf3, 0x08, 0xb8, 0x6d, 0x1a, 0x0f, 0x58, 0x3d, 0x17, 0xb5, 0x76, 0x02, 0x43, 0x9e, 0x1f, 0x2c, 0x6e, 0x0c, 0x5b, 0xf7, 0x81, 0x70, 0x50, 0x13, 0x38, 0xb4, 0xc4, 0x47, 0xe9, 0x19, 0x7b, 0x65, 0x03, 0xfb, 0x73, 0xeb, 0xab, 0xf7, 0x76, 0xde, 0xfa, 0xe3, 0x3b, 0xdc, 0xdc, 0xe7, 0x7d, 0xe7, 0x9b, 0x82, 0xbe, 0x14, 0x85, 0xa8, 0xaa, 0x9b, 0x82, 0x09, 0x37, 0xdb, 0xf4, 0x28, 0xa2, 0x05, 0x50, 0x96, 0x6a, 0x86, 0xb6, 0x2a, 0x17, 0x2e, 0x6c, 0xfb, 0xdc, 0xfe, 0x0d, 0x6f, 0xc6, 0x7a, 0x4d, 0xb6, 0x22, 0x52, 0xfd, 0xaf, 0x85, 0xf1, 0xe6, 0xbc, 0x14, 0xf8, 0xab, 0x1c, 0x53, 0x32, 0x6a, 0xa6, 0xa7, 0xbc, 0x5e, 0xec, 0x88, 0xe0, 0xb1, 0x1d, 0x48, 0xd2, 0xb5, 0x61, 0xf2, 0x26, 0x06, 0x50, 0x10, 0x2f, 0xf2, 0x7b, 0x57, 0xb7, 0x00, 0x72, 0xbc, 0xc1, 0x21, 0xe3, 0x5e, 0x70, 0xf3, 0x78, 0x0c, 0x83, 0x33, 0xb5, 0xbf, 0x6b, 0x08, 0xfa, 0x12, 0x08, 0x26, 0x0f, 0x33 } +, + /* Signature */ + 129, + { 0x09, 0x04, 0xcc, 0x11, 0xac, 0x66, 0xa9, 0x83, 0x7b, 0x74, 0x56, 0x8b, 0xe2, 0x50, 0xe5, 0x3a, 0xe4, 0xbe, 0xf7, 0x8d, 0xc6, 0x7f, 0xfe, 0xe5, 0x09, 0xe5, 0xd9, 0xb4, 0x72, 0x58, 0x3e, 0xaa, 0xa5, 0x6d, 0x4c, 0x9e, 0xe7, 0x0f, 0x6e, 0x82, 0xdc, 0x99, 0x8b, 0x53, 0xef, 0xf1, 0x27, 0x2b, 0xf0, 0x1f, 0x09, 0xe5, 0x26, 0x2b, 0x15, 0x5a, 0x6e, 0x56, 0xd1, 0x50, 0x40, 0x03, 0xe4, 0xc8, 0xa4, 0x6e, 0x65, 0x02, 0x55, 0x32, 0x78, 0x23, 0x0d, 0x6e, 0x81, 0xb7, 0x29, 0x18, 0x43, 0xab, 0x97, 0x69, 0x73, 0x7f, 0x3c, 0x69, 0x31, 0x52, 0xf1, 0x7b, 0xf2, 0xd8, 0xbf, 0xc7, 0x82, 0xbd, 0xb3, 0xfa, 0x0a, 0xea, 0xdf, 0x0d, 0x44, 0x1e, 0x1e, 0x52, 0xde, 0xa5, 0x4b, 0x75, 0xcf, 0x16, 0x5e, 0x35, 0xc3, 0x82, 0xd3, 0x11, 0x74, 0xf6, 0x67, 0x9d, 0x2f, 0x21, 0xb9, 0x81, 0xf4, 0x13, 0x58 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.3", + /* Message to be signed */ + 126, + { 0x4e, 0xc7, 0x39, 0x3f, 0xdc, 0x4b, 0x90, 0xaf, 0x8f, 0xff, 0xca, 0xf3, 0x4e, 0x84, 0x5a, 0x09, 0x65, 0x6a, 0xef, 0x9d, 0xda, 0x12, 0xb0, 0x34, 0x2c, 0x46, 0xeb, 0x04, 0x91, 0x74, 0xaa, 0x51, 0x1b, 0x43, 0xc9, 0x4d, 0x75, 0xc0, 0xe2, 0x90, 0x70, 0xaf, 0xf5, 0xb4, 0x14, 0x23, 0xa1, 0x70, 0xd9, 0xb3, 0xe8, 0xb2, 0x12, 0x24, 0xaa, 0xbc, 0x53, 0x1d, 0x88, 0x88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 0xa2, 0x28, 0x7c, 0xaf, 0xff, 0xe1, 0xed, 0x63, 0xcd, 0xde, 0xad, 0x87, 0x6c, 0x94, 0x07 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.4", + /* Message to be signed */ + 250, + { 0x90, 0x77, 0x60, 0xdb, 0x32, 0x96, 0x9b, 0x09, 0x7d, 0xc1, 0x24, 0xef, 0x89, 0x75, 0x15, 0x11, 0xa5, 0xd2, 0x30, 0x59, 0x6d, 0x2f, 0xd8, 0xa8, 0x91, 0xff, 0x00, 0xf0, 0x5f, 0xba, 0xd4, 0x5f, 0x72, 0xa4, 0x5d, 0x46, 0x56, 0x24, 0xa3, 0xab, 0x67, 0xaf, 0xdb, 0xb9, 0xe5, 0xf9, 0xe6, 0x5b, 0x63, 0xe3, 0x0c, 0x2e, 0x57, 0xfe, 0x7f, 0x32, 0xf3, 0x99, 0x01, 0x10, 0x33, 0xdc, 0x05, 0x29, 0xc0, 0x97, 0x1f, 0xbe, 0x06, 0x4f, 0xc5, 0xed, 0xb0, 0x1f, 0x84, 0xcd, 0x57, 0x28, 0x3f, 0xbb, 0xbd, 0x2a, 0xa0, 0x29, 0x44, 0x11, 0x0b, 0x6b, 0x53, 0x4f, 0x74, 0x08, 0x2f, 0x56, 0xbe, 0x34, 0x6c, 0xc3, 0x43, 0xbd, 0x4d, 0x0b, 0x34, 0x80, 0x91, 0xc0, 0x05, 0xc6, 0x19, 0x9a, 0x7e, 0x3d, 0x56, 0x88, 0x52, 0x47, 0xb0, 0xc1, 0x6a, 0x36, 0xb2, 0x35, 0xb8, 0xf5, 0xd4, 0xf0, 0x0a, 0x6c, 0x6b, 0xb6, 0xfe, 0xed, 0xe8, 0x8f, 0xcd, 0x78, 0x8d, 0x75, 0xca, 0xcf, 0xf7, 0xd9, 0x56, 0x87, 0x99, 0x65, 0x71, 0x55, 0x9c, 0x05, 0x79, 0x6a, 0x55, 0x71, 0x1d, 0x77, 0x46, 0xbb, 0x92, 0xd8, 0x52, 0x89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x2b, 0xfa, 0x31, 0xb9, 0xd5, 0x45, 0x0f, 0xa2, 0x49, 0x29, 0x7f, 0xe2, 0xe4, 0x6a, 0xb0, 0x3e, 0x99, 0xb1, 0xf9, 0xc6, 0x51, 0xd5, 0x39, 0xeb, 0x53, 0xce, 0x09, 0x61, 0xce, 0x60, 0x23, 0xc1, 0x7d, 0xd7, 0x38, 0x3d, 0xd1, 0x2b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.5", + /* Message to be signed */ + 124, + { 0xbd, 0xa5, 0x54, 0x95, 0x47, 0x32, 0xd1, 0xd5, 0xf3, 0x94, 0x75, 0x55, 0xc6, 0x1f, 0xfa, 0xb8, 0x01, 0xdb, 0xcd, 0xc8, 0x12, 0x1d, 0xc6, 0x81, 0x91, 0x27, 0xc2, 0xf2, 0x2a, 0x43, 0x6d, 0x20, 0x62, 0x2d, 0x1f, 0x4a, 0x44, 0x7c, 0x3a, 0x77, 0xb6, 0x58, 0x57, 0x31, 0xaf, 0xc0, 0x3e, 0x77, 0xba, 0xeb, 0x70, 0x9c, 0x1b, 0xfb, 0x90, 0x6a, 0x1a, 0xa1, 0x94, 0x9a, 0xb6, 0x76, 0x3a, 0x15, 0xc7, 0xda, 0x5a, 0x12, 0xa8, 0xf3, 0x95, 0x10, 0x1e, 0x64, 0x6a, 0x83, 0x71, 0x73, 0x14, 0x1f, 0x2a, 0x0c, 0xf5, 0x36, 0x02, 0x4b, 0x36, 0x91, 0x8c, 0xf9, 0xdb, 0x95, 0xb1, 0xcc, 0x40, 0x5a, 0xef, 0xe6, 0x3a, 0x3a, 0x93, 0xbc, 0x4a, 0xda, 0x60, 0xa0, 0xf4, 0xe0, 0x72, 0x9f, 0x4d, 0xb8, 0xb7, 0x6f, 0xd6, 0x4e, 0xfc, 0xbc, 0xb6, 0x6f, 0x0e, 0x4a, 0xaf, 0xf3 } +, + /* Signature */ + 129, + { 0x07, 0x26, 0x2f, 0xe1, 0xf3, 0xd7, 0xb7, 0x79, 0x32, 0xcd, 0xb7, 0xcd, 0x96, 0xac, 0x19, 0x8b, 0x93, 0x03, 0xeb, 0x44, 0x46, 0x0f, 0x52, 0x98, 0xe8, 0xe5, 0x2f, 0xe6, 0x70, 0x52, 0x99, 0xbb, 0xd6, 0x18, 0xef, 0xd0, 0xb3, 0x63, 0x31, 0x56, 0x2f, 0x20, 0xb2, 0x0e, 0x86, 0x6d, 0x99, 0xc2, 0xd0, 0x4a, 0x01, 0x49, 0xf5, 0x64, 0xdd, 0xf6, 0x6b, 0xa3, 0x19, 0xf3, 0xb8, 0x48, 0x25, 0x39, 0x6e, 0xa8, 0xb8, 0x93, 0xba, 0x5b, 0x3e, 0xe5, 0xe5, 0x24, 0x5c, 0xfe, 0x6b, 0x61, 0x6e, 0x30, 0xa9, 0x00, 0xbf, 0x83, 0xbb, 0x76, 0x3d, 0x20, 0xb3, 0x30, 0x37, 0x01, 0xca, 0xbe, 0x94, 0x33, 0x41, 0x48, 0x88, 0x2a, 0xe4, 0xef, 0x14, 0xe6, 0xd9, 0xe6, 0xc7, 0x52, 0xbc, 0xe2, 0x53, 0xbd, 0xda, 0x57, 0x39, 0xe3, 0x3b, 0xdc, 0x32, 0xeb, 0x08, 0x28, 0x28, 0xc1, 0xc3, 0x99, 0xc2, 0x2f, 0xea } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.6", + /* Message to be signed */ + 73, + { 0x51, 0x76, 0xad, 0x7c, 0x99, 0xbe, 0x4c, 0xdb, 0xbb, 0x5d, 0x79, 0xba, 0x5f, 0x49, 0x6c, 0xad, 0x9f, 0x42, 0xdc, 0x25, 0xd5, 0x27, 0xa5, 0xd5, 0xe8, 0xe3, 0x35, 0x91, 0x79, 0x22, 0x5e, 0x6b, 0x0e, 0x43, 0x66, 0x6d, 0x3d, 0x82, 0xab, 0x5b, 0xaf, 0x42, 0x4c, 0x85, 0xc3, 0x31, 0x21, 0x60, 0x6e, 0xb7, 0x9a, 0xda, 0x6b, 0xaf, 0xca, 0xb5, 0xc1, 0xe2, 0x54, 0x6c, 0xab, 0xf6, 0xa3, 0x60, 0x03, 0x84, 0x05, 0xca, 0x18, 0xc0, 0x08, 0x36, 0x67 } +, + /* Signature */ + 129, + { 0x06, 0x27, 0x23, 0x8b, 0x0b, 0x93, 0xe4, 0xcf, 0x98, 0x57, 0x13, 0xd2, 0x91, 0x29, 0x6c, 0xed, 0xe3, 0x45, 0xe8, 0x8e, 0x17, 0x82, 0x45, 0x25, 0x53, 0x59, 0x39, 0xb3, 0xf3, 0xd5, 0xff, 0x4e, 0xbc, 0x40, 0x74, 0x00, 0x11, 0x49, 0x00, 0x25, 0xdf, 0xea, 0xae, 0xe9, 0x06, 0x38, 0xc5, 0x39, 0x1e, 0xb4, 0x4e, 0x9f, 0xf3, 0x70, 0x45, 0x7b, 0x60, 0xd5, 0xde, 0x80, 0xc1, 0x65, 0x38, 0xcb, 0x38, 0x60, 0x55, 0x95, 0x85, 0xca, 0xf5, 0xe3, 0x33, 0x2c, 0x7b, 0x1f, 0xdd, 0x8f, 0x45, 0xfb, 0x6e, 0x35, 0x57, 0xf2, 0xc7, 0xa6, 0x0d, 0x09, 0x9e, 0x94, 0xf8, 0xe9, 0x6b, 0xaa, 0x1e, 0x03, 0x19, 0x9a, 0xc8, 0x3c, 0xec, 0x8f, 0x9c, 0x16, 0xbb, 0x49, 0x15, 0x1a, 0x88, 0x72, 0xcb, 0xfe, 0x70, 0xf0, 0x02, 0xcf, 0x3b, 0x53, 0xb6, 0x11, 0xd6, 0xcb, 0xb6, 0x65, 0x89, 0x7c, 0xeb, 0xf5, 0x99 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.7", + /* Message to be signed */ + 20, + { 0xe1, 0x74, 0x71, 0x93, 0x64, 0xf7, 0xbd, 0xc8, 0x6e, 0x2f, 0x0c, 0x61, 0x26, 0x5b, 0xf8, 0x05, 0x7d, 0x64, 0x9c, 0xca } +, + /* Signature */ + 129, + { 0x09, 0x77, 0x19, 0x54, 0xfc, 0x8a, 0x1f, 0xee, 0xe9, 0x0f, 0x60, 0xc4, 0xb8, 0xa5, 0xbb, 0xd4, 0x62, 0xc6, 0x34, 0x37, 0x9a, 0xb3, 0xda, 0x19, 0xff, 0xeb, 0xa6, 0xe0, 0x31, 0xb4, 0x24, 0x3a, 0x83, 0x50, 0x9c, 0xee, 0xed, 0x6e, 0x01, 0x2a, 0x91, 0x63, 0xc6, 0x14, 0x5c, 0xf7, 0x05, 0x02, 0xa9, 0xfb, 0x0c, 0x21, 0xdb, 0x31, 0xfa, 0xd5, 0xad, 0x14, 0x69, 0x5d, 0xe0, 0x02, 0x62, 0xe4, 0xe5, 0x67, 0x09, 0x5e, 0x16, 0x11, 0x0c, 0x6e, 0x65, 0xd6, 0xbc, 0xb9, 0xcc, 0x02, 0xe9, 0x19, 0xf9, 0x0d, 0x19, 0xe7, 0x30, 0x7f, 0x44, 0x34, 0x50, 0x3f, 0x9f, 0xe0, 0x2c, 0x12, 0xc1, 0xd3, 0xf5, 0x0c, 0xc1, 0x60, 0x08, 0x6f, 0xe4, 0x60, 0x29, 0x8c, 0x88, 0x12, 0x25, 0xbf, 0xf2, 0xe9, 0xe3, 0x13, 0xda, 0x38, 0x44, 0x44, 0xbe, 0xc7, 0x2a, 0x67, 0xac, 0x34, 0x44, 0x67, 0xe8, 0x2b, 0x66 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.8", + /* Message to be signed */ + 232, + { 0x98, 0xcb, 0xc9, 0x1f, 0xd4, 0x9b, 0x50, 0x7c, 0x88, 0x7e, 0x97, 0xc3, 0xcf, 0xa9, 0xb5, 0x9c, 0x26, 0x00, 0x1f, 0xca, 0xc1, 0x64, 0x87, 0xf6, 0x00, 0x4f, 0x0b, 0x68, 0x74, 0x54, 0x63, 0x20, 0x02, 0xd5, 0x49, 0xb5, 0x46, 0x1f, 0xf1, 0x53, 0x0c, 0x0f, 0x5f, 0xc0, 0x9a, 0xac, 0xc4, 0x6a, 0xda, 0xda, 0x7d, 0xc9, 0xd7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2d, 0x7a, 0x5e, 0xab, 0x83, 0x58, 0x45, 0x03, 0xd9, 0x4e, 0xbf, 0x7d, 0xde, 0x9e, 0xed, 0x49, 0x41, 0x10, 0xbe, 0x94, 0xed, 0x64, 0x8a, 0xf0, 0xcf, 0x6e, 0x89, 0x1b, 0x06, 0x2d, 0x2c, 0x9d, 0xef, 0x95, 0x87, 0x55, 0xb1, 0xa3, 0x08, 0x48, 0x8d, 0x16, 0x70, 0x74, 0x29, 0x51, 0xec, 0x00, 0x60, 0x54, 0x5d, 0x2e, 0xc4, 0x3f, 0xe8, 0x4a, 0xec, 0x89, 0x01, 0xad, 0xf4, 0xfe, 0x8d, 0x67, 0xaa, 0xe5, 0x7a, 0x31, 0x9f, 0x49, 0x1c, 0x85, 0xc2, 0x1c, 0xd7, 0xf9, 0xc5, 0x99, 0x81, 0x3c, 0xeb, 0x9d, 0xf8, 0x47, 0x78, 0xad, 0xc8, 0x2a, 0x33, 0xc4, 0xe7, 0x67, 0x4d, 0x7f, 0xbe, 0x13, 0x48, 0xdc, 0x20, 0x75, 0x51, 0x10, 0x4f, 0x54, 0x42, 0xac, 0xd6, 0x84, 0x86, 0x9a, 0xc2, 0x2c, 0xac, 0x51, 0x6c, 0xc9, 0x88, 0x7f, 0xd1, 0xd0, 0x21, 0xef, 0xcc, 0x54, 0xab, 0xda, 0xf2, 0xb6 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.9", + /* Message to be signed */ + 139, + { 0x3e, 0xed, 0x6b, 0xf1, 0x16, 0xcb, 0x31, 0xe0, 0xfd, 0xd4, 0xc5, 0xc9, 0x33, 0x58, 0xba, 0xb6, 0x8f, 0xbf, 0xa8, 0xb5, 0xc5, 0x15, 0xbc, 0xab, 0xf9, 0x05, 0x1c, 0xdf, 0x95, 0xa2, 0x43, 0xe5, 0xee, 0x68, 0x15, 0x15, 0x4e, 0xeb, 0x4a, 0xc1, 0x0f, 0x52, 0x31, 0xd0, 0x49, 0x38, 0x13, 0xe2, 0x81,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xdc, 0x97, 0xa2, 0x9f, 0x39, 0xd6, 0x06, 0xff, 0x8e, 0x9c, 0x0a, 0x13, 0x71, 0xaa, 0xee, 0xc0, 0x03, 0xea, 0x27, 0x48, 0x95, 0xff, 0x7b, 0xa1, 0x50, 0x2b, 0x28, 0xf8, 0x17, 0x63, 0x02, 0xc2, 0x4e, 0xec, 0xe5, 0xb5, 0x28, 0xd6, 0x71, 0x00 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.10", + /* Message to be signed */ + 146, + { 0x08, 0x4e, 0xc2, 0x87, 0x86, 0x5e, 0x8f, 0xe6, 0x88, 0x04, 0x72, 0x37, 0x20, 0x97, 0xad, 0x5b, 0x96, 0x4c, 0x40, 0xa9, 0x35, 0xee, 0xd1, 0xbe, 0xa5, 0x1a, 0xb1, 0xb5, 0xbc, 0x75, 0xc8, 0x46, 0xbb, 0xcb, 0xd9, 0x54, 0x88, 0xe9, 0xec, 0xc3, 0x63, 0xcf, 0x07, 0x3a, 0x90, 0xb2, 0x0b, 0xe8, 0xb6, 0x79, 0x36, 0x46, 0x22, 0xf3, 0x45, 0xe1, 0x22, 0xd0, 0x56, 0x6a, 0xcd, 0x34, 0xa4, 0xae, 0x11, 0x24, 0x45, 0x25, 0xa3, 0x8f, 0x47, 0xdc, 0x1f, 0x92, 0xb1, 0x7f, 0x89, 0xed, 0xe0, 0x6d, 0x83, 0x6b, 0x44, 0x26, 0xec, 0xbb, 0xea, 0x79, 0x33, 0xac, 0x0e, 0x84, 0x7e, 0x55, 0x10, 0x33, 0xb5, 0xf7, 0xea, 0x4e, 0xaf, 0x1f, 0x63, 0xf3, 0x47, 0x9d, 0xb7, 0xea, 0xf8, 0x02, 0xc9, 0x96, 0xde, 0x92, 0x33, 0x86, 0xcd, 0x15, 0xb1, 0x22, 0xde, 0x5a, 0x23, 0x98, 0xd3, 0xf3, 0x97, 0x02, 0xc3, 0xe9, 0x06, 0x5c, 0x32, 0x73, 0x95, 0xb9, 0xa9, 0x95, 0xfa, 0x25, 0x4d, 0xe9, 0xc7, 0xad, 0xb4, 0x51 } +, + /* Signature */ + 129, + { 0x13, 0xa7, 0xf0, 0x04, 0xc0, 0xa8, 0x8d, 0x51, 0x3e, 0x2f, 0x1a, 0xae, 0xab, 0x41, 0x7f, 0xa0, 0xb2, 0x70, 0x2f, 0xb9, 0x3b, 0x82, 0x87, 0x20, 0xcc, 0xd8, 0x00, 0xcb, 0xb0, 0xaf, 0x5a, 0x19, 0x65, 0x72, 0x5b, 0x6e, 0xe0, 0x58, 0x71, 0x17, 0xcb, 0xcb, 0x81, 0xa4, 0x63, 0x18, 0x52, 0x1c, 0x95, 0x0d, 0xd8, 0x46, 0x9b, 0xd8, 0x55, 0x73, 0xf5, 0xd2, 0x9d, 0x86, 0x53, 0x03, 0xeb, 0xac, 0x45, 0xc7, 0xf6, 0x03, 0x1c, 0x6f, 0x93, 0x78, 0xeb, 0x12, 0xb4, 0x2f, 0x05, 0x09, 0x44, 0x31, 0x6f, 0x0b, 0x93, 0xdb, 0x89, 0x9b, 0xec, 0x93, 0x7d, 0x5d, 0x0f, 0x58, 0xed, 0x40, 0x70, 0x04, 0x01, 0xcd, 0x32, 0x65, 0xa6, 0xa4, 0x4b, 0x09, 0xbb, 0x11, 0xa4, 0x38, 0xee, 0xa0, 0x77, 0x15, 0xef, 0xe4, 0x2d, 0xe4, 0xe8, 0x80, 0x8f, 0x88, 0x24, 0x02, 0x61, 0x14, 0x8e, 0x8d, 0xe2, 0x93, 0xed } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.11", + /* Message to be signed */ + 154, + { 0x61, 0x07, 0x00, 0x00, 0x7c, 0x3c, 0x6c, 0xb0, 0x96, 0xc9, 0x94, 0xd6, 0x5d, 0x95, 0xc9, 0xb9, 0xa1, 0x47, 0xc3, 0x46, 0x14, 0xcd, 0x72, 0x2f, 0x29, 0xeb, 0xc5, 0xe0, 0x93, 0x78, 0x6f, 0x79, 0x09, 0x48, 0x02, 0x14, 0x1a, 0x31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xec, 0xa9, 0xc7, 0xbf, 0x9e, 0x2a, 0x98, 0x87, 0x75, 0x1b, 0x36, 0xd1, 0xab, 0xaf, 0x25, 0xa3, 0x13, 0xfc, 0x29, 0xd7, 0xf8, 0x34, 0xd2, 0xa2, 0x48, 0x29, 0x85, 0x57, 0x5e, 0x1b, 0xe2, 0x4b, 0xc4, 0xef, 0x43, 0xa5, 0x7e, 0xf4, 0xb0, 0xa6, 0x83, 0x69, 0x93, 0xe1, 0x1b, 0x67, 0x07, 0x85, 0x04, 0xe3, 0xb7, 0x9c, 0x72, 0x17, 0x75, 0xf5, 0xb9, 0x9b, 0xfa, 0xcc, 0xc4, 0x8a, 0x8c, 0x34 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.12", + /* Message to be signed */ + 6, + { 0xda, 0x31, 0xf9, 0xbe, 0x26, 0x09 } +, + /* Signature */ + 129, + { 0x1d, 0x2b, 0xba, 0xfc, 0xa4, 0x1c, 0xa0, 0x6c, 0x4b, 0x81, 0x1c, 0xb9, 0xd8, 0x36, 0x96, 0x87, 0x16, 0x6d, 0x14, 0xd9, 0xf9, 0x2c, 0x5b, 0x98, 0xfc, 0x7c, 0x77, 0x2f, 0x2d, 0x75, 0xd3, 0x5a, 0x5f, 0x9a, 0xcc, 0xe5, 0x9b, 0x99, 0xef, 0xb2, 0xdc, 0xb9, 0x7d, 0xcc, 0xbb, 0xc8, 0x6d, 0x7f, 0xd6, 0xb4, 0xae, 0x8b, 0xea, 0xb1, 0xe9, 0x81, 0xe6, 0xc7, 0x74, 0x5a, 0x1b, 0xfb, 0x4c, 0x1f, 0x44, 0xa4, 0x72, 0xb2, 0xad, 0x07, 0xd4, 0x1c, 0xc1, 0x75, 0x15, 0xb7, 0xb1, 0x4a, 0x49, 0x99, 0x0b, 0x24, 0x34, 0x42, 0xff, 0x2c, 0x8f, 0xe5, 0x05, 0xb1, 0x84, 0x9f, 0xa9, 0x91, 0xca, 0xcf, 0x68, 0x09, 0xa2, 0x0e, 0x55, 0xf2, 0xaf, 0x77, 0x98, 0x87, 0x0d, 0x65, 0x77, 0x6f, 0x1f, 0x9e, 0xe4, 0x87, 0x97, 0xe3, 0x13, 0xaa, 0x66, 0xa4, 0x7e, 0x69, 0x5f, 0x3e, 0x73, 0x1b, 0x2c, 0x7f, 0x30 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.13", + /* Message to be signed */ + 9, + { 0xf9, 0x8b, 0xe5, 0x2d, 0x9a, 0x5e, 0x55, 0xad, 0x92 } +, + /* Signature */ + 129, + { 0x29, 0x2e, 0xa3, 0x4d, 0x3e, 0x61, 0x18, 0xbf, 0x8c, 0xd0, 0x54, 0xe2, 0x15, 0x17, 0xe8, 0x63, 0xce, 0x7c, 0xb7, 0xdd, 0x72, 0x73, 0x30, 0x8f, 0x7e, 0xcf, 0xea, 0xcf, 0x9b, 0x45, 0x75, 0x83, 0xd9, 0xb9, 0xb9, 0x7c, 0x54, 0xab, 0xf7, 0x4e, 0x5a, 0x5c, 0xa3, 0x6a, 0x87, 0x06, 0x7e, 0x47, 0xd6, 0x7a, 0xa0, 0x47, 0xa1, 0xc2, 0xed, 0x7a, 0x23, 0xd0, 0x55, 0xab, 0x4f, 0x09, 0x4a, 0x83, 0xc4, 0x39, 0xef, 0x8d, 0xd2, 0xd0, 0x20, 0x35, 0xef, 0x05, 0x62, 0xd9, 0x67, 0x31, 0x3d, 0x81, 0x10, 0x2f, 0xc6, 0x8b, 0x74, 0x52, 0x5b, 0xb0, 0xe1, 0xd7, 0x96, 0x2e, 0xb2, 0x75, 0x8e, 0xc5, 0xe5, 0xae, 0xab, 0x65, 0xa9, 0x3d, 0x2e, 0xc8, 0xe6, 0x55, 0x40, 0x5a, 0xf8, 0x8c, 0x00, 0xfa, 0x35, 0xf5, 0x9d, 0xe9, 0xd0, 0xcd, 0x80, 0x45, 0xab, 0xd3, 0x71, 0x73, 0xb9, 0xfc, 0x6c, 0x51, 0xd8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.14", + /* Message to be signed */ + 215, + { 0xf4, 0x38, 0xef, 0xf8, 0x4c, 0x37, 0x3f, 0xc1, 0x27, 0x44, 0xa3, 0x84, 0x15, 0x82, 0x43, 0xdd, 0x97, 0xf4, 0x36, 0x5e, 0x87, 0xd7, 0x1e, 0x8b, 0x56, 0xb2, 0x97, 0x91, 0xdf, 0x44, 0xad, 0xf3, 0x49, 0xe7, 0x62, 0x60, 0x04, 0xa2, 0xc5, 0x33, 0x35, 0xec, 0x63, 0x52, 0xcc, 0xe2, 0xed, 0xd9, 0x63, 0x94, 0x7f, 0xd2, 0x39, 0x38, 0x93, 0xc2, 0x48, 0xba, 0x1b, 0x84, 0x08, 0x42, 0xca, 0x77, 0x6c, 0x31, 0x72, 0x9f, 0x70, 0x7a, 0xf5, 0x04, 0x11, 0x00, 0x1c, 0x28, 0x7f, 0xba, 0x8f, 0xe7, 0x25, 0x02, 0x32, 0x0c, 0x44, 0x5b, 0xb1, 0x43, 0xfb, 0x7b, 0xf5, 0x39, 0x4e, 0xc1, 0xfb, 0x2c, 0xd5, 0x01, 0x59, 0x24, 0x32, 0x15, 0x40, 0x91, 0xde, 0x5a, 0x23, 0x65, 0xd6, 0x78, 0xf3, 0x57, 0x82, 0xfe, 0xa8, 0xb4, 0x7f, 0x64, 0xd6, 0x09, 0x19, 0xf0, 0xf1, 0xd5, 0xaf, 0xa7, 0x62, 0x6c, 0x40, 0xd1, 0x6c, 0xec, 0x19, 0xbf, 0xe0, 0x25, 0xd1, 0x16, 0xf4, 0x2d, 0x22, 0xe2, 0x0a, 0xdb, 0x56, 0x37, 0x5a, 0xd7, 0x70, 0x89, 0xf9, 0xa9, 0x33, 0x81, 0xfd, 0x78, 0xb7, 0xb1, 0x51, 0x1c, 0xb4, 0xe4, 0x98, 0x4d, 0x2d, 0xdc, 0x7c, 0x9d, 0x75, 0xb3, 0x10, 0xf2, 0x95, 0x42, 0x25, 0x60, 0xd6, 0x6e, 0x36, 0x02, 0xa8, 0x71, 0x20, 0x96, 0x16, 0x13, 0x1a, 0x84, 0x71, 0x43, 0xdd, 0x07, 0x8f, 0x23, 0x58, 0x7d, 0xb5, 0x02, 0xdd, 0xa0, 0x3e, 0x18, 0x60, 0x64, 0x82, 0xdb, 0xbe, 0x01, 0x4e, 0xa0, 0x83, 0xb7, 0xec, 0x16, 0x1b } +, + /* Signature */ + 129, + { 0x0e, 0xaf, 0xeb, 0xf1, 0x5d, 0x84, 0xee, 0x4a, 0x13, 0xf1, 0xa8, 0x2b, 0x84, 0x05, 0x11, 0x86, 0x41, 0xe2, 0x2e, 0x51, 0xda, 0x94, 0xd8, 0x58, 0x87, 0xfc, 0x4a, 0x3b, 0x11, 0xf0, 0x32, 0x49, 0xcc, 0x39, 0xa0, 0x37, 0x45, 0x01, 0x07, 0x1c, 0x7e, 0xef, 0x4a, 0xba, 0xa1, 0x14, 0x08, 0xd0, 0x2f, 0xae, 0x17, 0x86, 0xde, 0xa3, 0x75, 0x88, 0x47, 0x9c, 0x90, 0xd6, 0x27, 0x69, 0x85, 0x91, 0xc3, 0xba, 0xe1, 0xfe, 0xfd, 0x6e, 0x8c, 0x40, 0xe3, 0xff, 0x4b, 0x9f, 0x60, 0x61, 0xe0, 0x6c, 0x12, 0xfd, 0xd2, 0x1c, 0x7f, 0x45, 0xdd, 0xc5, 0xb7, 0x8d, 0x1c, 0xbc, 0x41, 0xc1, 0x57, 0x06, 0xfa, 0x20, 0xba, 0x92, 0xf9, 0x9f, 0x58, 0xb2, 0x2b, 0xe2, 0x76, 0x75, 0xbe, 0xe0, 0x81, 0xa0, 0x60, 0x67, 0xee, 0xd1, 0x58, 0xf8, 0xe2, 0x0b, 0xf0, 0x4a, 0x6e, 0x96, 0x8f, 0x71, 0x9a, 0x32, 0x34 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.15", + /* Message to be signed */ + 89, + { 0xfa, 0x1c, 0x0f, 0x7b, 0x10, 0x15, 0xa8, 0x95, 0xb1, 0xa5, 0x65, 0xf3, 0x29,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, 0x62, 0xad, 0x54, 0x33, 0x47, 0x90, 0x01, 0xaf, 0x36, 0xd3, 0xd3, 0x26, 0xea, 0xdb, 0x2e, 0x9a, 0xbe, 0xc7, 0xb5, 0x55, 0x70, 0x9d, 0x5d, 0x47, 0xe9 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.16", + /* Message to be signed */ + 223, + { 0x82, 0x8e, 0xbe, 0x2f, 0x51, 0xe5, 0x88, 0x29, 0xcf, 0xa6, 0x15, 0x26, 0xdd, 0xed, 0x7e, 0x1f, 0x1b, 0xa3, 0x11, 0xdb, 0xf1, 0x06, 0x4c, 0x08, 0xac, 0x0b, 0xb5, 0xd6, 0x71, 0x6e, 0xab, 0x29, 0x8a, 0x23, 0xd6, 0x3b, 0x79, 0x3f, 0xfd, 0x9d, 0x9c, 0xea, 0x60, 0x22, 0x95, 0x98, 0x82, 0x3f, 0x28, 0x2f, 0x10, 0x7b, 0x6e, 0xe8, 0x8a, 0x53, 0xfd, 0x93, 0xe7, 0xdd, 0xd4, 0x8a, 0x73, 0x1a, 0x21, 0x09, 0xff, 0xed, 0xc8, 0x9a, 0xeb, 0xa2, 0xc0, 0xf1, 0x6b, 0xcb, 0x14, 0x0a, 0x0a, 0x89, 0xdc, 0x57, 0xee, 0x8b, 0x5d, 0x00, 0x0a, 0x21, 0x42, 0x17, 0x5b, 0xc7, 0x07, 0xbb, 0x40, 0x9a, 0xae, 0x3a, 0x03, 0x9c, 0x66, 0x3d, 0x01, 0x9a, 0x0b, 0xd9, 0x13, 0xc1, 0x3f, 0x7f, 0xf6, 0xf6, 0xb9, 0x1e, 0x90, 0x5a, 0x58, 0x9d, 0x38, 0xb1, 0x50, 0x48, 0x5d, 0x89, 0x09, 0x2d, 0x18, 0xa3, 0xa7, 0x62, 0x25, 0x27, 0x65, 0x52, 0x5d, 0x98, 0x45, 0x66, 0x42, 0x5b, 0x05, 0x77, 0x0d, 0xe9, 0xa8, 0xbe, 0xf4, 0x43, 0xff, 0x5f, 0x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 0xf7, 0xfc, 0x9b, 0x11, 0x78, 0x0d, 0xbf, 0x4d, 0x3b, 0x72, 0xd2, 0xd0, 0xb8, 0x55, 0x93, 0xd8, 0xb5, 0xb0, 0x18, 0x2a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.17", + /* Message to be signed */ + 47, + { 0xbb, 0x4a, 0x6e, 0xcc, 0xbd, 0xd6, 0xde, 0x0a, 0xc5, 0xc3, 0xb7, 0xf9, 0x97, 0x98, 0x10, 0x4a, 0x58, 0x69, 0xc1, 0xcf, 0x1a, 0x1f, 0xac, 0x7f, 0x85, 0x9f, 0xe9, 0x51, 0x49, 0x29, 0x7e, 0xb7, 0x79, 0x11, 0x00, 0x59, 0xe2, 0x69, 0xf1, 0x27, 0x56, 0xf0, 0x8a, 0x54, 0x8b, 0x66, 0xaf } +, + /* Signature */ + 129, + { 0x27, 0x7b, 0xae, 0x63, 0xe6, 0xe3, 0x25, 0x3a, 0x0e, 0x20, 0x4f, 0x4e, 0x6c, 0x9f, 0xe8, 0x4b, 0x04, 0x0b, 0x86, 0x4f, 0x21, 0xed, 0xd4, 0x42, 0x6d, 0x82, 0xbe, 0x8f, 0x1b, 0x91, 0x1b, 0x0b, 0xd2, 0x81, 0xcf, 0x11, 0x49, 0x53, 0xd4, 0x02, 0x09, 0xda, 0x2e, 0x9a, 0xae, 0x13, 0x3b, 0xcd, 0x18, 0x55, 0xef, 0x0a, 0x99, 0x69, 0x3a, 0x94, 0x43, 0xc9, 0x3f, 0x6d, 0xd2, 0x75, 0xf0, 0x58, 0xfd, 0x1b, 0xb6, 0x95, 0x32, 0xb6, 0x4a, 0x1d, 0xd7, 0xe1, 0xd0, 0xe7, 0x80, 0xd7, 0x52, 0x04, 0xfa, 0x8c, 0x61, 0xc2, 0xeb, 0x5d, 0xe8, 0x82, 0x72, 0xcb, 0x93, 0xae, 0xf0, 0x80, 0xf7, 0x02, 0xbb, 0x78, 0x88, 0x94, 0x25, 0xa5, 0xf1, 0x66, 0xf6, 0x3b, 0x5b, 0x1a, 0x31, 0xec, 0x5c, 0x1c, 0x26, 0xa5, 0x99, 0xfa, 0xfe, 0x58, 0x77, 0x42, 0x98, 0xb9, 0x7d, 0xb3, 0x14, 0xfc, 0x81, 0xd0, 0x92 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.18", + /* Message to be signed */ + 256, + { 0xf1, 0xd1, 0x11, 0xad, 0x08, 0xe0, 0x38, 0xca, 0x3a, 0xb4, 0xe5, 0x2e, 0x5e, 0xab, 0x71, 0x01, 0x87, 0x6c, 0xa9, 0xbe, 0x62, 0x6a, 0x13, 0x59, 0x17, 0xf4, 0x5b, 0x1f, 0x9d, 0x1b, 0x32, 0xef, 0xe4, 0xff, 0x86, 0x7a, 0xb8, 0xa3, 0x05, 0xf9, 0x49, 0xc0, 0x04, 0x8b, 0x25, 0xf5, 0x46, 0x22, 0x61, 0xb1, 0xa3, 0x49, 0x3b, 0x81, 0x90, 0x21, 0x0f, 0x5c, 0xfa, 0x6b, 0xf7, 0xe5, 0xc3, 0x00, 0x54, 0x98, 0xde, 0xec, 0xc1, 0xe1, 0xc5, 0x04, 0xf3, 0xa3, 0x49, 0x98, 0xbe, 0x6a, 0xd6, 0xac, 0x00, 0x40, 0x51, 0xc4, 0xe0, 0xa3, 0xdb, 0x2c, 0x22, 0xeb, 0x5e, 0x14, 0x16, 0x55, 0x28, 0xdf, 0x78, 0x12, 0xa2, 0x0d, 0x5c, 0x7f, 0x05, 0xb9, 0x40, 0xca, 0x13, 0xe9, 0x38, 0x3a, 0xe0, 0x0d, 0x6c, 0xd4, 0xd0, 0xf4, 0xae, 0x3d, 0xad, 0x04, 0x7a, 0xb9, 0xc4, 0x17, 0x8d, 0xb6, 0x6d, 0x3b, 0x80, 0x96, 0x0c, 0xaf, 0x0a, 0x92, 0x4d, 0xc9, 0x4e, 0xb8, 0xe0, 0x77, 0x09, 0xbc, 0xdb, 0x34, 0x9e, 0x90, 0xfa, 0x2e, 0x10, 0xc5, 0xd5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, 0x2a, 0x94, 0x71, 0x24, 0xa7, 0xfc, 0x0b, 0x82, 0xe4, 0xfe, 0xd1, 0x2b, 0x8b, 0x4f, 0x72, 0x6a, 0x0c, 0x85, 0x39, 0xc6, 0xcd, 0xe2, 0x1a, 0xf6, 0x55, 0xac, 0xc8, 0xde, 0x1e, 0x7b, 0xa9, 0xd6, 0x7b, 0x87, 0xb8, 0xe7, 0x77, 0xd4, 0x8a, 0xcd, 0x86, 0x8a, 0x80, 0xdb, 0x15, 0x31, 0x4f, 0x35, 0x55, 0x60, 0x10, 0x35, 0x77, 0xeb } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.19", + /* Message to be signed */ + 193, + { 0x9c, 0x4e, 0xcc, 0x4b, 0x24, 0x44, 0xa4, 0x01, 0xbf, 0xb6, 0xf4, 0xb7, 0x24, 0x49, 0x23, 0xa5, 0xad, 0x33, 0x86, 0xc3, 0xb8, 0x41, 0x67, 0x8c, 0xf5, 0xe6, 0x44, 0x7b, 0x8a, 0x3a, 0x07, 0x59, 0x86, 0xc3, 0x3f, 0xd0, 0x01, 0xb8, 0x43, 0x72, 0x4d, 0xdd, 0xc4, 0x21, 0x2f, 0xf4, 0x5a, 0xb3, 0xfe, 0xca, 0xa9, 0x0a, 0x16, 0xf6, 0xb5, 0x59, 0x2c, 0x51, 0x5c, 0xc4, 0xee, 0x54, 0xae, 0xa4, 0x59, 0x34, 0x32, 0x16, 0x70, 0x96, 0x67, 0x8f, 0x93, 0x41, 0x59, 0x85, 0x6d, 0x14, 0xc4, 0x32, 0xe7, 0xd6, 0xd2, 0x8d, 0x71, 0xb2, 0x68, 0x7f, 0x54, 0xed, 0x71, 0x9e, 0x5c, 0x20, 0x11, 0x00, 0x68, 0x8e, 0x85, 0xf2, 0x0e, 0x79, 0xa9, 0xee, 0x8a, 0xa4, 0xb6, 0x14, 0x31, 0x34, 0x3d, 0x1e, 0x99, 0xc2, 0x14, 0x35, 0xc6, 0x1e, 0x8b, 0xc1, 0x04, 0xf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x2a, 0x9c, 0x2f, 0x68, 0xeb, 0xf3, 0x2c, 0xf1, 0xc6, 0xc6, 0xbb, 0x8b, 0x27, 0x4a, 0x2e, 0x42, 0xd6, 0x71, 0x59, 0x12, 0xff } + +} +, +{ + "PKCS#1 v1.5 Signature Example 12.20", + /* Message to be signed */ + 146, + { 0xc3, 0x81, 0xe6, 0x03, 0x99, 0x86, 0x51, 0x66, 0xd2, 0xba, 0xa0, 0x31, 0x45, 0x26, 0x83, 0x34, 0x18, 0x40, 0x39, 0xe0, 0x53, 0x35, 0xa3, 0x00, 0xc2, 0x80, 0x4e, 0x2b, 0xfe, 0xf5, 0xa7, 0xd1, 0x4c, 0x44, 0x3d, 0x65, 0x38, 0xe1, 0x6b, 0xdf, 0x9d, 0xa7, 0xad, 0x1f, 0xea, 0x63, 0x4e, 0xbf, 0xe1, 0x13, 0xbc, 0x82, 0x1e, 0x79, 0xa4, 0x49, 0xb2, 0xeb, 0x2f, 0x57, 0xc2, 0x1f, 0xba, 0x35, 0xff, 0xcc, 0x6a, 0x7e, 0x52, 0x55, 0x72, 0x27, 0x7e, 0x8f, 0x55, 0x37, 0xc7, 0xb5, 0xb9, 0x79, 0x4d, 0xef, 0xb3, 0x9a, 0xab, 0x06, 0x07, 0x85, 0xd1, 0x99, 0x40, 0x02, 0xdc, 0xf8, 0x07, 0x01, 0x2e, 0x1d, 0x17, 0x91, 0xda, 0x94, 0x3b, 0x2b, 0x75, 0x9c, 0x36, 0x6b, 0xb4, 0x24, 0xe4, 0x2c, 0x9c, 0x20, 0x43, 0xce, 0x78, 0x8a, 0x25, 0xfb, 0xfe, 0xbb, 0x87, 0xe7, 0x4c, 0xb0, 0x20, 0xb1, 0x1e, 0x8e, 0xaf, 0x16, 0x18, 0x84, 0xd6, 0x67, 0x2b, 0xbe, 0x9c, 0x09, 0xfb, 0xb3, 0xb8, 0xaf, 0xa0, 0x61 } +, + /* Signature */ + 129, + { 0x19, 0x90, 0x69, 0x57, 0x37, 0x53, 0x01, 0x8f, 0x33, 0x59, 0x2a, 0xf1, 0x5c, 0x1d, 0x31, 0x31, 0xbf, 0x5d, 0x8a, 0xc4, 0xf6, 0x4c, 0xf6, 0x14, 0xd3, 0xa0, 0x1b, 0xf3, 0x72, 0xdf, 0x00, 0x2e, 0xb5, 0xb5, 0xfc, 0x8f, 0x82, 0xba, 0x13, 0x7f, 0x83, 0xdc, 0x14, 0x2e, 0xde, 0x38, 0xc5, 0x81, 0x80, 0xe7, 0xbd, 0xa6, 0x9c, 0x4f, 0x1b, 0xc7, 0xbf, 0x96, 0xec, 0xd3, 0xfa, 0x79, 0xbc, 0xcb, 0xdd, 0xb7, 0xd9, 0x2e, 0x4f, 0xd8, 0x64, 0xc5, 0xfa, 0x93, 0x3a, 0x4d, 0xfc, 0x60, 0x0e, 0x10, 0x83, 0x00, 0x8a, 0x38, 0x6f, 0x4d, 0x02, 0x2c, 0x20, 0x24, 0xff, 0x7e, 0x0b, 0x37, 0x22, 0xea, 0xfe, 0xa0, 0x5a, 0x1e, 0x02, 0xc7, 0xa6, 0x3e, 0xeb, 0x40, 0xf4, 0xf4, 0xc4, 0xf6, 0x60, 0xc3, 0x24, 0x72, 0xa0, 0xa7, 0x89, 0x23, 0xe3, 0x86, 0x3a, 0x99, 0x44, 0x5e, 0x7c, 0xfe, 0x27, 0x00, 0x60 } + +} +, +} +}, +{ + "Example 13: A 1031-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x70, 0xe9, 0x23, 0xa5, 0xa0, 0xcd, 0x8e, 0xcd, 0xf9, 0x9b, 0xbe, 0x93, 0xd7, 0xd0, 0x28, 0x82, 0x95, 0x5d, 0x91, 0xb6, 0xef, 0xe3, 0xce, 0xc8, 0x6c, 0x93, 0xd2, 0x1c, 0x0a, 0xc3, 0x01, 0xb8, 0x29, 0x3e, 0x51, 0x43, 0x5b, 0x87, 0x8b, 0xc6, 0xb3, 0x4b, 0xed, 0x41, 0x11, 0x59, 0x0e, 0x76, 0x46, 0x76, 0x58, 0x8b, 0x11, 0x6c, 0x2a, 0x36, 0xa4, 0xc7, 0x7e, 0xd9, 0xc9, 0x0a, 0x13, 0xc1, 0x4d, 0x23, 0xe1, 0x99, 0x47, 0x87, 0xfc, 0xdb, 0x8f, 0x5c, 0x97, 0x41, 0x0f, 0xca, 0xd4, 0x04, 0x5b, 0x85, 0x85, 0x70, 0x2c, 0xce, 0x29, 0xda, 0x11, 0xf9, 0x7e, 0x79, 0xa9, 0x7c, 0x2e, 0x5f, 0x6a, 0x5f, 0xc0, 0xbb, 0x8c, 0xe7, 0x6d, 0x15, 0x54, 0xa8, 0xbc, 0x47, 0x96, 0x17, 0x20, 0xd3, 0x64, 0x05, 0x0b, 0xf2, 0x74, 0x19, 0xbf, 0xf1, 0x68, 0xc0, 0xa7, 0xec, 0xc8, 0x73, 0x4c, 0xb5, 0xa5 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 129, + { 0x02, 0x9e, 0x10, 0xf6, 0xbb, 0xb7, 0xd0, 0x2d, 0xeb, 0xb1, 0xa5, 0xd5, 0x19, 0x0d, 0x69, 0x06, 0xff, 0xed, 0xeb, 0x9d, 0x15, 0x4a, 0x0f, 0x66, 0xdb, 0x87, 0x80, 0xb9, 0x28, 0x31, 0xb5, 0x96, 0x3e, 0x94, 0x84, 0x7f, 0x3e, 0x7d, 0xb1, 0xaa, 0x91, 0x48, 0xfb, 0x0e, 0xc5, 0x57, 0x6e, 0x6b, 0xa4, 0xfe, 0x04, 0xd6, 0xf2, 0x78, 0x32, 0xb1, 0x52, 0x18, 0x12, 0xd3, 0x7b, 0x22, 0xd9, 0xea, 0xe2, 0x80, 0x08, 0xe0, 0x92, 0xc6, 0x7e, 0x72, 0x32, 0x42, 0x67, 0xe1, 0xb1, 0xee, 0x45, 0x43, 0x55, 0x74, 0x1d, 0x8d, 0xe1, 0xd2, 0xa6, 0xa0, 0x50, 0x74, 0xbb, 0x1c, 0xe5, 0x81, 0x8b, 0x41, 0xbd, 0x19, 0xdc, 0x6b, 0x58, 0xc8, 0x93, 0x7d, 0x8a, 0xd6, 0x40, 0xd7, 0x04, 0x3f, 0xa1, 0x1f, 0x46, 0x8d, 0x6c, 0xcb, 0xec, 0x4a, 0xde, 0x52, 0x0a, 0x9e, 0x15, 0x9d, 0x60, 0x5d, 0x09, 0x28, 0x29 } +, + /* Prime 1 */ + 65, + { 0x0a, 0xb4, 0x64, 0xfd, 0x6f, 0xe3, 0x3c, 0x45, 0x9a, 0xb2, 0xdc, 0xce, 0x5f, 0x78, 0xa4, 0xd7, 0x4f, 0x92, 0xb9, 0x97, 0xd4, 0xbf, 0x54, 0x2e, 0x2d, 0x85, 0x4e, 0x76, 0x2c, 0x85, 0x86, 0xfc, 0x43, 0x57, 0xcc, 0x58, 0xcb, 0x33, 0x36, 0x33, 0xb0, 0x95, 0xa5, 0xee, 0x04, 0xa0, 0x32, 0x48, 0x53, 0x64, 0xd7, 0x0f, 0x67, 0xa3, 0xaa, 0x04, 0x85, 0x4c, 0x7a, 0x87, 0xa6, 0x9c, 0xf4, 0xc2, 0xad } +, + /* Prime 2 */ + 65, + { 0x0a, 0x8c, 0x3c, 0xc5, 0x04, 0x13, 0x40, 0xf4, 0x32, 0xfe, 0x0a, 0x78, 0x73, 0x13, 0x57, 0x79, 0x16, 0xfe, 0x76, 0xc0, 0x39, 0xf9, 0x71, 0x75, 0x9e, 0xc5, 0x0e, 0xd6, 0xc5, 0xb9, 0xa7, 0x36, 0x9b, 0x68, 0x96, 0x9e, 0xcb, 0x52, 0x59, 0xfe, 0x9c, 0x50, 0xd0, 0x75, 0x9b, 0xf8, 0xb3, 0xaa, 0xc1, 0xa5, 0xd5, 0xb5, 0x28, 0x8d, 0x67, 0x89, 0xe7, 0x18, 0xfa, 0x37, 0xef, 0x42, 0x39, 0x95, 0xd9 } +, + /* Prime exponent 1 */ + 64, + { 0xbb, 0x29, 0x5a, 0x95, 0xd5, 0xb3, 0x3c, 0x1d, 0xc0, 0xb1, 0x8b, 0xf6, 0xc1, 0x4a, 0xa0, 0xd9, 0xf2, 0x6f, 0x72, 0x8b, 0x39, 0x36, 0x0a, 0xa1, 0x59, 0x45, 0x6e, 0x94, 0xc3, 0xd9, 0xe0, 0x48, 0xc9, 0x2a, 0x4f, 0xb6, 0x31, 0x1d, 0x36, 0x92, 0x8c, 0xe5, 0xf4, 0x47, 0xa4, 0x99, 0x4a, 0x8f, 0x47, 0x87, 0xd8, 0xa9, 0x7f, 0x68, 0x11, 0x3e, 0xf9, 0x66, 0x34, 0xf5, 0x90, 0x2a, 0xb7, 0x51 } +, + /* Prime exponent 2 */ + 65, + { 0x02, 0xfa, 0x11, 0x2c, 0x89, 0x39, 0xe5, 0xdb, 0x05, 0x89, 0x2c, 0xeb, 0x51, 0x8e, 0xe3, 0xe1, 0x08, 0xdc, 0x48, 0x27, 0x78, 0x35, 0x2e, 0x10, 0x43, 0xfe, 0xd9, 0x71, 0x43, 0xdc, 0x61, 0x94, 0xc7, 0xc7, 0x7c, 0xba, 0xd4, 0x27, 0x29, 0xbe, 0xf1, 0xde, 0xdc, 0xf6, 0x54, 0x4e, 0x9c, 0x66, 0x54, 0xc0, 0xb8, 0xcf, 0xa7, 0xe2, 0x40, 0x96, 0x6a, 0xe2, 0x61, 0xbb, 0xe7, 0x8a, 0x89, 0x36, 0x01 } +, + /* Coefficient */ + 64, + { 0xa8, 0x8b, 0xf3, 0xff, 0xe9, 0x3f, 0x40, 0x4e, 0x06, 0x82, 0x1c, 0x97, 0x71, 0xea, 0xe6, 0x08, 0x15, 0x71, 0x2d, 0x6f, 0x94, 0x52, 0x71, 0xf6, 0xf3, 0x6f, 0x03, 0x69, 0xd9, 0x66, 0xc9, 0x20, 0xc7, 0xf8, 0xcb, 0xc7, 0x84, 0x25, 0xac, 0xbb, 0x9c, 0xe0, 0xfa, 0x1a, 0x03, 0x22, 0xf5, 0x0c, 0x97, 0xb8, 0x11, 0x5b, 0xd1, 0x51, 0x91, 0xf2, 0x24, 0xb5, 0x68, 0xd1, 0xd6, 0xec, 0xa6, 0xdb } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 13.1", + /* Message to be signed */ + 36, + { 0xb5, 0xe8, 0x6c, 0x8b, 0xa3, 0x98, 0x5a, 0xa5, 0x54, 0x1d, 0xf9, 0x5e, 0x51, 0x3c, 0xff, 0x67, 0x61, 0x2e, 0xaf, 0x2e, 0x16, 0x68, 0x85, 0x76, 0xf7, 0xd6, 0x73, 0xf6, 0xf1, 0x89, 0x1f, 0xb7, 0x5c, 0x9d, 0xd2, 0xcd } +, + /* Signature */ + 129, + { 0x6b, 0x42, 0xfd, 0x51, 0x63, 0x09, 0x19, 0x7f, 0x8a, 0xf3, 0xc7, 0x3e, 0x39, 0x62, 0x4d, 0x8e, 0xba, 0xbe, 0xcd, 0xa3, 0xec, 0x3c, 0xe6, 0x57, 0xb1, 0x11, 0x7f, 0x43, 0xe9, 0x83, 0x87, 0x7a, 0x1b, 0xa1, 0xaa, 0xf8, 0xe9, 0x5c, 0xc3, 0x99, 0x91, 0xd9, 0x2e, 0x35, 0xe2, 0xdb, 0x1e, 0x41, 0x30, 0x90, 0x14, 0x3d, 0x16, 0x46, 0x71, 0x98, 0xb9, 0xb9, 0xa9, 0x90, 0xd7, 0x74, 0xc2, 0x7a, 0xd3, 0xbb, 0xb4, 0x35, 0x2d, 0x3f, 0x07, 0x5d, 0x61, 0x73, 0x2c, 0x6b, 0x58, 0xec, 0x0f, 0x66, 0xe4, 0x92, 0xa3, 0xf7, 0xac, 0x4b, 0xbc, 0xf0, 0x12, 0xed, 0x6b, 0x40, 0x1f, 0xeb, 0x4f, 0xf3, 0x95, 0xcb, 0x8b, 0x21, 0x8a, 0x81, 0xd6, 0x17, 0x31, 0xee, 0xce, 0x37, 0x6f, 0x68, 0x8e, 0x66, 0xae, 0xa6, 0x98, 0xb4, 0xa8, 0x86, 0x2f, 0x58, 0xc9, 0x1d, 0x87, 0x60, 0x85, 0x49, 0x6f, 0xd0, 0x14 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.2", + /* Message to be signed */ + 253, + { 0x95, 0x46, 0x34, 0x6c, 0xf2, 0x21, 0x94, 0xc7, 0x87, 0x88, 0x81, 0x70, 0xa4, 0x82, 0xf7, 0xf4, 0x92, 0x17, 0xc3, 0x94, 0x0d, 0xc6, 0x21, 0x0c, 0xe3, 0x9e, 0x45, 0x50, 0xa3, 0x9b, 0x45, 0x28, 0x22, 0x41, 0x9a, 0xea, 0xc2, 0x4b, 0xec, 0x19, 0x8b, 0xb3, 0x59, 0xd0, 0x8b, 0xe8, 0x19, 0x6d, 0xf2, 0xe7, 0x57, 0x76, 0x61, 0x96, 0xc9, 0x58, 0xe2, 0xb1, 0x59, 0xc7, 0x4c, 0x1c, 0x30, 0x23, 0xc2, 0xdb, 0xcc, 0xe9, 0xed, 0x5d, 0x0e, 0xf3, 0xfb, 0x51, 0x45, 0x0b, 0xff, 0x64, 0x45, 0xdb, 0x26, 0x5e, 0x60, 0x6e, 0x19, 0x4b, 0xee, 0x06, 0x4c, 0xa5, 0xb3, 0x21, 0xd7, 0xe1, 0x55, 0x14, 0x23, 0x0c, 0x2b, 0x3b, 0x55, 0xd5, 0xda, 0x4c, 0xd0, 0x40, 0x52, 0x2f, 0x7b, 0xb8, 0x6a, 0x96, 0x2b, 0x81, 0x3f, 0x9d, 0xa3, 0x9e, 0x51, 0x38, 0x9b, 0xc6, 0x4f, 0x56, 0xe4, 0x47, 0xb2, 0xa2, 0xbf, 0x81, 0x9d, 0x7a, 0x80, 0x09, 0x4e, 0x2b, 0x8d, 0xe2, 0x7f, 0x10, 0x4b, 0xb6, 0xeb, 0x2f, 0x2f, 0xb4, 0x3a, 0xf1, 0xd0, 0x1e, 0xad, 0xca, 0x23, 0xa1, 0x96, 0xba, 0x12, 0x5b, 0x6a, 0x78, 0x57, 0x99, 0x74, 0xc0, 0xee, 0xc8, 0xa5, 0x49, 0x67, 0x71, 0xf6, 0x7d, 0xbd, 0x50, 0x69, 0xf3, 0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b, 0xc7, 0x38, 0x8e, 0x4e, 0x46, 0x44, 0xec, 0xa9, 0x47, 0x03, 0xa7, 0x2b, 0xdd, 0xcc, 0x6f, 0x50, 0xcf, 0x98, 0x0e, 0x3f, 0x6d, 0xe3, 0x9d, 0x73, 0x12 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.3", + /* Message to be signed */ + 121, + { 0x56, 0x52, 0xb4, 0xc5, 0x75, 0x20, 0xb2, 0x55, 0xfb, 0x96, 0xf7, 0x0a, 0x30, 0xab, 0x92, 0xee, 0xc1, 0x93, 0x99, 0x56, 0xb6, 0xa9, 0x43, 0xc8, 0x3e, 0xd0, 0x98, 0x6e, 0x2e, 0x6e, 0xe4, 0xef, 0xbf, 0x8a, 0x52, 0x28, 0x78, 0x67, 0x28, 0x12, 0x03, 0xa7, 0xa6, 0xd1, 0xd8, 0x86, 0xb7, 0x00, 0x59, 0x52, 0xb4, 0x3b, 0x77, 0x85, 0x44, 0xed, 0xa8, 0x98, 0xe0, 0xdf, 0x2f, 0xa0, 0x6f, 0x68, 0x38, 0x03, 0x18, 0xf1, 0x4a, 0x53, 0xfe, 0x55, 0xd7, 0x2f, 0x8c, 0xfa, 0x6a, 0xf2, 0x1d, 0x93, 0xbb, 0xfc, 0x20, 0xd3, 0x58, 0xc2, 0x08, 0xc5, 0x62, 0xd7, 0x39, 0xbe, 0x00, 0x01, 0xce, 0x07, 0xfd, 0x8c, 0xd2, 0xf4, 0x6c, 0x3b, 0x44, 0xc8, 0x36, 0x51, 0x88, 0x09, 0xb7, 0x6f, 0x3a, 0x70, 0xcf, 0x69, 0x26, 0xbe, 0x06, 0x9c, 0x35, 0x75, 0xd5 } +, + /* Signature */ + 129, + { 0x01, 0x64, 0x11, 0xa2, 0x31, 0xa7, 0x38, 0x94, 0x4b, 0x3e, 0x44, 0xf7, 0x88, 0x5c, 0xf8, 0x1a, 0xca, 0xb7, 0x32, 0xd1, 0x73, 0x6d, 0xe3, 0x4c, 0x56, 0xcf, 0x40, 0xf9, 0x9a, 0x6c, 0xe4, 0x00, 0x70, 0xa2, 0x0a, 0xa9, 0x4c, 0x48, 0x78, 0x44, 0xa9, 0x3c, 0xef, 0x28, 0x7a, 0x58, 0xbc, 0x0e, 0xa1, 0x81, 0xb2, 0xcf, 0x27, 0xd9, 0x14, 0xf2, 0x93, 0xb9, 0x29, 0x77, 0x9d, 0x39, 0x03, 0x6c, 0x4e, 0x5a, 0xae, 0xd3, 0x5e, 0xee, 0x8a, 0x7f, 0xd5, 0x0e, 0xfd, 0x09, 0x6c, 0x91, 0xa8, 0xf7, 0x2c, 0x3c, 0x14, 0x1c, 0x57, 0x6c, 0x8d, 0x10, 0xb6, 0x36, 0xfc, 0x4d, 0xdc, 0x1e, 0x67, 0x14, 0xf1, 0x7f, 0xfc, 0xce, 0x10, 0x6d, 0x22, 0x1b, 0x4f, 0xd7, 0xd6, 0xfe, 0x1e, 0x7c, 0xbd, 0x3f, 0x3b, 0x08, 0xf5, 0x54, 0x6b, 0x44, 0xd1, 0xfe, 0xb7, 0x18, 0xfb, 0xc1, 0x33, 0x70, 0xc7, 0xfa, 0x2c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.4", + /* Message to be signed */ + 211, + { 0x6d, 0x57, 0xf0, 0x79, 0xa3, 0xe8, 0xad, 0xcb, 0x47, 0xcf, 0x2e, 0x3c, 0xa9, 0x76, 0xe0, 0x3b, 0x09, 0xc7, 0x7d, 0x1d, 0x9d, 0x9d, 0x84, 0x84, 0x35, 0x7e, 0x91, 0x23, 0x09, 0xe8, 0xf4, 0xa8, 0x3c, 0xb5, 0x0c, 0xb6, 0xa7, 0x38, 0x8c, 0x41, 0x4a, 0xec, 0x84, 0x46, 0x71, 0xff, 0x81, 0x06, 0x51, 0xe8, 0x28, 0x10, 0x3a, 0x1f, 0x6a, 0x19, 0x9b, 0xe2, 0x60, 0xf7, 0x46, 0x00, 0x02, 0x8c, 0x6a, 0x7b, 0x7b, 0xb9, 0x41, 0x6c, 0xe7, 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, 0xc2, 0xbe, 0x7d, 0x79, 0x72, 0x90, 0xa3, 0x0d, 0xb8, 0xc4, 0x07, 0xdd, 0x16, 0x37, 0x65, 0x88, 0xa6, 0xdc, 0xc1, 0xa2, 0x07, 0xbf, 0x7f, 0xf3, 0x11, 0x54, 0x0f, 0xaa, 0x9d, 0xd6, 0xf1, 0x9a, 0x73, 0xab, 0x25, 0xa7, 0x49, 0x6e, 0x68, 0x2f, 0xa8, 0xa7, 0x05, 0x40, 0x81, 0x07, 0x6c, 0x1a, 0x02, 0x15, 0x7b, 0xe6, 0x3e, 0x7f, 0x64, 0x5d, 0xe8, 0x2d, 0xf7, 0xc6, 0x15, 0x50, 0x3f, 0xa8, 0x3b, 0x4e, 0xdb, 0xa2, 0x05, 0x81, 0x81, 0x2e, 0x09, 0x7f, 0x65, 0x05, 0x6e, 0xd4, 0x17, 0xf6, 0xf2, 0x48, 0x03, 0x53, 0x0c, 0xf8, 0x18, 0x58 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.5", + /* Message to be signed */ + 241, + { 0xbb, 0x75, 0x44, 0x6f, 0x78, 0x78, 0x23, 0xdd, 0xa2, 0x42, 0x2b, 0x1a, 0xdc, 0x7d, 0x7f, 0xef, 0xd0, 0x6a, 0x6e, 0x9a, 0xf5, 0xc0, 0x49, 0x01, 0xac, 0x5b, 0x99, 0x91, 0x3a, 0xd6, 0x29, 0x8c, 0x9d, 0x1a, 0x33, 0x22, 0xe8, 0xb2, 0x17, 0xe4, 0xe0, 0x99, 0x4c, 0x42, 0x20, 0x42, 0x80, 0xd4, 0x04, 0xd0, 0x1e, 0xce, 0xb5, 0xec, 0x53, 0xfb, 0x86, 0xf7, 0x61, 0xa3, 0x96, 0xb2, 0x3a, 0xe1, 0x9d, 0x46, 0x79, 0x05, 0xa0, 0xfe, 0x80, 0x50, 0xb8, 0x95, 0xd8, 0xba, 0x37, 0x46, 0x68, 0x5c, 0x47, 0x43, 0x9f, 0x90, 0xc3, 0x66, 0x9c, 0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, 0xcb, 0xba, 0x0d, 0x33, 0xb2, 0x32, 0x12, 0xf8, 0xf4, 0x3a, 0x4a, 0x8e, 0x09, 0xa6, 0xa5, 0x0e, 0x01, 0x9b, 0xbd, 0xd5, 0x9a, 0x58, 0x89, 0x8c, 0xc4, 0x6c, 0x58, 0xa4, 0x6e, 0x42, 0xce, 0x7b, 0xa0, 0x93, 0xfb, 0x46, 0x92, 0xf3, 0x83, 0xde, 0x33, 0xa9, 0xa3, 0x4f, 0x47, 0xc7, 0xe6, 0x19, 0x38, 0xbf, 0x8a, 0x6a, 0xda, 0xa8, 0x8d, 0xf2, 0x12, 0x96, 0xb4, 0xc6, 0x7b, 0x52, 0x68, 0x35, 0xf7, 0x57, 0xf2, 0xc2, 0x6c, 0x1d, 0x30, 0x9d, 0x7c, 0xdd, 0x5a, 0xd5, 0xfd, 0x8f, 0x61, 0xf8, 0x51, 0xed, 0x23, 0xc4, 0xbe, 0x2a, 0xbb, 0x62, 0x7d, 0xfd, 0x81, 0x7f, 0x84, 0x77, 0xdc, 0x04, 0x2b, 0x6a, 0x2e, 0x40, 0x69, 0x40 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.6", + /* Message to be signed */ + 245, + { 0x88, 0x39, 0x39, 0xd1, 0x49, 0xa5, 0x44, 0xe6, 0x2e, 0xf0, 0x4c, 0x61, 0x03, 0x51, 0xa2, 0xdf, 0xa2, 0x52, 0xeb, 0x9a, 0x9d, 0x1e, 0x11, 0xae, 0x54, 0xc9, 0xb0, 0x7e, 0xbc, 0xf1, 0xfd, 0xc4, 0x7e, 0xc1, 0xd9, 0x47, 0x03, 0x41, 0x1d, 0xa4, 0x15, 0xf5, 0x9f, 0xb3, 0xe5, 0x04, 0x1e, 0xd9, 0x47, 0x0e, 0x7b, 0xcc, 0x81, 0x9b, 0x5a, 0xfe, 0xaf, 0x86, 0x0c, 0x01, 0x6e, 0xf1, 0x25, 0xbd, 0x08, 0xa6, 0xcb, 0x8b, 0xcd, 0xf3, 0xb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a3, 0xf6, 0x11, 0x99, 0x29, 0x61, 0xca, 0x27, 0xcc, 0xbf, 0x29, 0x6e, 0x11, 0x36, 0x18, 0x32, 0xe1, 0xee, 0x75, 0x20, 0x56, 0x9a, 0x9a, 0xee, 0x06, 0x34, 0x5c, 0xda, 0x22, 0xb4, 0xfa, 0x48, 0xfc, 0x34, 0x5e, 0x47, 0x78, 0xbc, 0x3c, 0xcd, 0xfe, 0xbd, 0x2d, 0xc5, 0xa6, 0xc9, 0xd4, 0x84, 0x51, 0xaa, 0x44, 0x1b, 0xea, 0x4b, 0x95, 0x11, 0x99, 0x65, 0x4a, 0xe8, 0xd2, 0xf7, 0x52, 0x2e, 0x17, 0xed, 0xbc, 0x2f, 0x51, 0xce, 0x15, 0xcb, 0xcd, 0x36, 0x6f, 0x49, 0x39, 0xcb, 0x53, 0xc3, 0xb7, 0x70, 0x81, 0xf4, 0xa7, 0x37, 0x50, 0x05, 0x4e, 0x00, 0xb3, 0x0b, 0xa2, 0xfe, 0x58, 0xf6, 0xf0, 0x2e, 0x36, 0xa8, 0x62, 0x54, 0x23, 0x97, 0xdb, 0xa6, 0xa3, 0xcd, 0x22, 0x77, 0x70, 0x88, 0x19, 0xe7, 0x8a, 0x2d, 0x87, 0x6a, 0x23, 0xa5, 0xa2, 0x69, 0xd7, 0x75 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.7", + /* Message to be signed */ + 71, + { 0x40, 0x31, 0xe0, 0xde, 0xf4, 0xf3, 0xd1, 0xad, 0x9b, 0xc0, 0x82, 0x77, 0x0a, 0x88, 0xa1, 0xd9, 0xb4, 0xb7, 0x10, 0x75, 0x48, 0xcd, 0xf8, 0x46, 0x2b, 0x0b, 0xae, 0x3d, 0x99, 0x4d, 0x8e, 0xbc, 0x4d, 0xa0, 0x44, 0xb9, 0x05, 0xdd, 0x8e, 0xd9, 0x1a, 0x1d, 0xa6, 0x76, 0x72, 0x78, 0x22, 0x36, 0x0e, 0xe2, 0xb6, 0xd5, 0xe1, 0x2b, 0xb7, 0x03, 0x16, 0xd7, 0x9e, 0x8a, 0xbb, 0x82, 0xa6, 0x43, 0x44, 0xaf, 0xb3, 0xb2, 0x25, 0x88, 0x5c } +, + /* Signature */ + 129, + { 0x0b, 0xe5, 0xa6, 0xd0, 0x43, 0xbe, 0x5d, 0x27, 0xd1, 0xd5, 0x1d, 0x9e, 0x3a, 0xa6, 0x1d, 0x92, 0xc9, 0xd8, 0x43, 0x23, 0x11, 0x9b, 0x48, 0xc8, 0x4a, 0x80, 0x38, 0x97, 0x18, 0xd7, 0xa1, 0xaa, 0xf5, 0x7a, 0x9a, 0x0d, 0x21, 0x4f, 0x65, 0x06, 0x48, 0x48, 0x64, 0xdf, 0xae, 0x85, 0xdb, 0x7b, 0x84, 0x74, 0x07, 0x3a, 0x8f, 0x97, 0x7b, 0x42, 0xb5, 0x3b, 0x40, 0x7e, 0x44, 0xc7, 0xc6, 0x2b, 0x16, 0x8d, 0x1e, 0x77, 0x78, 0xf4, 0xf2, 0x78, 0x57, 0xbf, 0xba, 0x85, 0xdd, 0xdc, 0x8b, 0x0e, 0x9f, 0x0e, 0x9a, 0x5b, 0x6d, 0xe7, 0x1a, 0x04, 0x43, 0x72, 0x0e, 0x92, 0xbb, 0x88, 0xb0, 0x77, 0xcb, 0xa1, 0x5d, 0x3f, 0x6e, 0x2b, 0xe4, 0xd2, 0x7a, 0x7c, 0x50, 0x9c, 0x7d, 0xc0, 0x3f, 0x1f, 0xdd, 0x4f, 0xe3, 0x38, 0xa4, 0xe5, 0x45, 0xc4, 0x6c, 0x03, 0x45, 0x22, 0xcc, 0xc0, 0xd4, 0x5d, 0x4c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.8", + /* Message to be signed */ + 64, + { 0x7f, 0xdc, 0x96, 0xa4, 0x56, 0x57, 0x74, 0x02, 0x9f, 0xff, 0xa9, 0x3b, 0x39, 0xf0, 0x5d, 0xee, 0x9f, 0x84, 0xfa, 0x89, 0x53, 0xfd, 0x0f, 0x63, 0x38, 0xc8, 0x1c, 0x9d, 0xec, 0x6c, 0xdd, 0x66, 0x1f, 0xfa, 0xb9, 0x6f, 0x0e, 0x08, 0xeb, 0x0b, 0x9b, 0xa9, 0xca, 0x5b, 0xe1, 0x7b, 0x57, 0xc4, 0xb4, 0x86, 0x8f, 0xd5, 0x34, 0x11, 0x54, 0xde, 0x50, 0x27, 0x71, 0x13, 0xc7, 0x18, 0x53, 0x41 } +, + /* Signature */ + 129, + { 0x1d, 0xd2, 0x1f, 0xa4, 0x95, 0xbe, 0x7c, 0x49, 0x0f, 0x98, 0x2f, 0x69, 0xea, 0xb1, 0x4e, 0x24, 0xda, 0xa0, 0x4b, 0xd1, 0x38, 0xb7, 0x14, 0x32, 0x49, 0xcd, 0xcc, 0xd7, 0x8c, 0xcf, 0xc9, 0x10, 0x6a, 0xca, 0xa0, 0x3e, 0xc8, 0x76, 0x69, 0x42, 0x32, 0x56, 0x6e, 0xc6, 0xca, 0xb9, 0x12, 0x28, 0x40, 0xf6, 0x69, 0xc8, 0x00, 0xf2, 0xee, 0x09, 0x2b, 0xb9, 0xb6, 0xcb, 0x2a, 0x45, 0x42, 0xa9, 0x0d, 0xe6, 0x04, 0xc4, 0xf1, 0x05, 0x00, 0x0a, 0x3a, 0x0d, 0xec, 0xcd, 0x3d, 0xd9, 0x7a, 0x32, 0x61, 0xfa, 0x38, 0x22, 0x7e, 0xb3, 0x81, 0xa1, 0xf8, 0xf2, 0x3b, 0x66, 0x65, 0xd2, 0x84, 0x80, 0xdf, 0xb7, 0x21, 0x17, 0x88, 0x2e, 0xd8, 0xdb, 0x25, 0xd7, 0x6d, 0xe4, 0x0d, 0xe2, 0xfb, 0xe7, 0x2d, 0xc3, 0x94, 0xec, 0x6f, 0xbd, 0xaa, 0x99, 0xc6, 0x4f, 0xad, 0xe7, 0x29, 0x78, 0xa5, 0x1f, 0xc4 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.9", + /* Message to be signed */ + 175, + { 0x63, 0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, 0x01, 0x2b, 0x50, 0x10, 0x79, 0xee, 0x92, 0xaf, 0xfe, 0x3c, 0x9e, 0x60, 0x2e, 0x4a, 0x08, 0x0c, 0xfc, 0x94, 0x72, 0x3a, 0xe9, 0x6d, 0xac, 0x2a, 0x66, 0xe4, 0x55, 0xa4, 0x0e, 0x72, 0x8b, 0x2a, 0x1b, 0x27, 0xe6, 0x22, 0x40, 0x55, 0x4e, 0xc7, 0xc5, 0xc0, 0xad, 0x6a, 0xa0, 0x0c, 0x09, 0x22, 0xe5, 0x3d, 0x7b, 0x12, 0xed, 0x42, 0xc0, 0x87, 0x32, 0x2d, 0x15, 0x36, 0xe4, 0x6b, 0x7d, 0xeb, 0xda, 0x80, 0x95, 0xf5, 0x5d, 0x1e, 0x12, 0xbc, 0x24, 0x42, 0xf4, 0x3b, 0x4d, 0x12, 0x8f, 0xee, 0x23, 0x1d, 0xcd, 0x6f, 0x8c, 0x37, 0xaa, 0x6b, 0xcf, 0x4f, 0xe7, 0xb5, 0xe0, 0xde, 0xa9, 0xc6, 0x70, 0x9d, 0x3d, 0x91, 0xf9, 0xe4, 0x2a, 0x53, 0x16, 0x8a, 0x16, 0xb6, 0xfe, 0x99, 0x7b, 0x5d, 0xfe, 0xba, 0xfb, 0x46, 0xed, 0x9a, 0xea, 0x5c, 0x66 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.10", + /* Message to be signed */ + 157, + { 0x8b, 0x04, 0x3d, 0x90, 0xda, 0xe3, 0x41, 0x66, 0x85, 0xd5, 0x3a, 0x5b, 0x4c, 0x3c, 0xc2, 0x54, 0xcd, 0xa0, 0xcb, 0xd2, 0x3b, 0x4e, 0x40, 0x8d, 0xe8, 0x20, 0xa4, 0xda, 0x7a, 0xde, 0x6d, 0xd9, 0x5d, 0x4e, 0x1a, 0x97, 0xe2, 0x31, 0x2c, 0x3e, 0x84, 0x26, 0x1e, 0xe0, 0xb6, 0xce, 0xfe, 0x60, 0xe6, 0xb0, 0x82, 0xfd, 0x59, 0x65, 0xef, 0xa1, 0x64, 0x8f, 0x4f, 0xae, 0x61, 0x60, 0x5f, 0xe3, 0x55, 0x33, 0x27, 0x00, 0x46, 0x96, 0x05, 0x26, 0x53, 0x47, 0xe6, 0x54, 0x7a, 0xea, 0x77, 0x5b, 0x85, 0x6e, 0x5a, 0x46, 0xc3, 0x41, 0xd2, 0x99, 0x52, 0xbb, 0xea, 0x92, 0x70, 0x49, 0x96, 0x3e, 0x37, 0x40, 0x20, 0x8c, 0xfb, 0x0b, 0x65, 0x28, 0x57, 0xb6, 0xf5, 0x2e, 0x36, 0x6a, 0x17, 0x0b, 0xe3, 0x4f, 0x13, 0xd3, 0x58, 0x46, 0xbd, 0xe6, 0x97, 0x20, 0x46, 0x20, 0x01, 0xb0, 0x9d, 0xd2, 0x68, 0xb8, 0x9b, 0x09, 0x00, 0x31, 0x8e, 0x73, 0x3d, 0xb2, 0x00, 0x9e, 0xfd, 0x9b, 0x51, 0x77, 0x41, 0xe5, 0x10, 0xd3, 0xf3, 0x94, 0xf7, 0xad, 0xb5, 0x45, 0x59, 0xb1, 0x57 } +, + /* Signature */ + 129, + { 0x6b, 0x27, 0x8f, 0x36, 0x2c, 0x29, 0x2e, 0xea, 0x09, 0xb9, 0x0b, 0xf3, 0x53, 0xd1, 0x43, 0xf2, 0xca, 0x09, 0x9f, 0xf8, 0x79, 0x57, 0x34, 0x79, 0xdf, 0x2a, 0xff, 0x9b, 0x25, 0x0d, 0x1c, 0x91, 0x87, 0xc6, 0xa3, 0x34, 0x3e, 0xa1, 0x4c, 0x07, 0x6f, 0x2a, 0x20, 0xc1, 0xa1, 0x9d, 0xb2, 0x6a, 0xad, 0x35, 0x48, 0xec, 0x6f, 0xb3, 0xb2, 0xfa, 0xfc, 0x75, 0x1b, 0x59, 0x08, 0x2d, 0x8b, 0x23, 0xc8, 0x2c, 0x8a, 0x51, 0xf7, 0xfa, 0xf7, 0xa4, 0xd4, 0xa8, 0x23, 0x98, 0xbf, 0xbe, 0xd4, 0x49, 0xbd, 0xe4, 0xee, 0x9d, 0xc8, 0x68, 0x01, 0x60, 0x66, 0x6f, 0xd9, 0xc7, 0x74, 0xc6, 0xaa, 0x57, 0x7b, 0x4e, 0xc5, 0x4c, 0xf0, 0xd5, 0xbd, 0x9e, 0x3d, 0x1a, 0xfa, 0x9c, 0x3b, 0x4b, 0x91, 0x46, 0x76, 0x78, 0xc9, 0xd4, 0xc4, 0xfe, 0x40, 0x0a, 0xa8, 0x57, 0xa3, 0xb0, 0x54, 0x5b, 0xdf, 0x84, 0xa6 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.11", + /* Message to be signed */ + 148, + { 0x3b, 0x28, 0xa6, 0x09, 0x2e, 0x47, 0x08, 0x98, 0xaf, 0x07, 0x0a, 0x08, 0x7c, 0x45, 0x53, 0x18, 0x8d, 0xe6, 0xc3, 0x44, 0xbb, 0x0b, 0x5f, 0xdc, 0x7f, 0x66, 0xfb, 0xc5, 0x2d, 0xc9, 0x3a, 0x8b, 0x92, 0xa3, 0x74, 0x11, 0x20, 0x37, 0xd6, 0xa4, 0x32, 0x86, 0x12, 0x8a, 0xce, 0xf9, 0x5a, 0x35, 0x05, 0xc0, 0xab, 0xb1, 0xaf, 0xa6, 0x2c, 0x48, 0xcb, 0x21, 0x36, 0x07, 0x7f, 0x8a, 0x0e, 0x0e, 0x0b, 0x5a, 0x4e, 0xe9, 0xb2, 0xc7, 0x7d, 0x7a, 0x0c, 0x0b, 0x53, 0xf3, 0x8a, 0x51, 0xcc, 0x3d, 0xb9, 0xb5, 0x83, 0xb3, 0xae, 0xc0, 0x7f, 0x1e, 0x22, 0x4f, 0xcb, 0x3f, 0x1d, 0xad, 0x19, 0x5e, 0x05, 0x86, 0x59, 0xa9, 0xd1, 0x1f, 0x8e, 0xdc, 0x74, 0x44, 0x99, 0x46, 0x86, 0xed, 0x62, 0xc9, 0x75, 0x66, 0xe9, 0xe0, 0x0c, 0xbf, 0x8f, 0x0d, 0xbc, 0x17, 0x16, 0xe6, 0xb7, 0xf0, 0xf8, 0x8f, 0xe8, 0x9a, 0x86, 0x7a, 0x41, 0xd6, 0x43, 0x13, 0x5a, 0xd8, 0xb1, 0x8a, 0xa1, 0x43, 0xe7, 0x37, 0x5d, 0xf1, 0x95, 0x29 } +, + /* Signature */ + 129, + { 0x32, 0x62, 0xfe, 0x17, 0xe4, 0x4e, 0x5e, 0xcc, 0x84, 0x31, 0x70, 0xd3, 0xae, 0x27, 0x51, 0xda, 0x1f, 0x48, 0xd6, 0xe9, 0x61, 0xd8, 0x1e, 0x93, 0x59, 0xb0, 0x98, 0x2c, 0x6d, 0x61, 0x30, 0x8e, 0xba, 0xcf, 0xe2, 0x60, 0x7c, 0x53, 0x8c, 0x17, 0x0c, 0xe0, 0xe7, 0x2a, 0x07, 0xbc, 0x01, 0x48, 0x7b, 0x29, 0x5c, 0x36, 0xb8, 0xe2, 0x2a, 0xfd, 0xf6, 0xe7, 0xfe, 0x39, 0xc0, 0x3a, 0x5c, 0x0c, 0x36, 0x61, 0x06, 0x1f, 0x23, 0xfb, 0xf5, 0x89, 0x0e, 0xad, 0x59, 0xf8, 0x72, 0xc9, 0x46, 0xcc, 0xe0, 0xf8, 0x16, 0xc9, 0xed, 0x3a, 0x2c, 0x1e, 0x11, 0xf8, 0xf7, 0x4d, 0xa1, 0xe9, 0x7a, 0x39, 0x0d, 0x53, 0x4d, 0x78, 0x55, 0x78, 0xa2, 0x45, 0x5f, 0xcd, 0x87, 0x47, 0x83, 0xf4, 0x57, 0x2a, 0x15, 0xf4, 0x93, 0x7d, 0xca, 0x98, 0x09, 0x3f, 0xd0, 0xe9, 0x99, 0x0a, 0xf0, 0x00, 0x52, 0x56, 0xbf } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.12", + /* Message to be signed */ + 52, + { 0x4f, 0xdd, 0x6a, 0x36, 0x31, 0xdd, 0xd4, 0xbc, 0x3c, 0x76, 0x07, 0x19, 0x02, 0xa2, 0x27, 0xfd, 0x5b, 0x36, 0x53, 0xb1, 0xf9, 0x70, 0xf2, 0xb7, 0x67, 0xef, 0x55, 0x4e, 0x1c, 0x75, 0xca, 0xde, 0x81, 0x9d, 0x8d, 0x1f, 0xca, 0x76, 0xbc, 0x10, 0x54, 0x1c, 0xbf, 0x8b, 0x1d, 0x8b, 0x0e, 0x72, 0x55, 0xf9, 0x57, 0x40 } +, + /* Signature */ + 129, + { 0x29, 0xcb, 0xa5, 0xb4, 0x3f, 0xa3, 0x56, 0x57, 0x75, 0x89, 0x34, 0x91, 0xb1, 0x18, 0x57, 0x8b, 0x14, 0xb5, 0xfa, 0x1e, 0xeb, 0xe0, 0xc8, 0x07, 0x59, 0xa6, 0xd1, 0x91, 0xe7, 0xc2, 0x13, 0x1e, 0xe1, 0x0a, 0xc5, 0xb9, 0xb8, 0xae, 0x1a, 0xa7, 0xd6, 0x96, 0xc9, 0x84, 0x88, 0xa3, 0x5c, 0xdf, 0xa2, 0xaa, 0x00, 0x6d, 0x91, 0xbf, 0x7e, 0x05, 0xa5, 0xc1, 0x90, 0x9e, 0xfb, 0x20, 0xda, 0xbc, 0x82, 0x13, 0x3b, 0x62, 0x64, 0xc0, 0x42, 0x18, 0x0c, 0x2c, 0xca, 0x65, 0x45, 0x9f, 0x66, 0xcc, 0x7e, 0xb1, 0xba, 0x75, 0xd1, 0x5d, 0x4f, 0x56, 0xc7, 0x52, 0x8a, 0xab, 0x28, 0x38, 0xe6, 0x79, 0x53, 0x7a, 0x4c, 0x8d, 0xcd, 0x37, 0xd4, 0xb4, 0xca, 0x82, 0x5c, 0xe1, 0x65, 0xfa, 0x4a, 0x97, 0x15, 0x82, 0x44, 0xdc, 0x87, 0xc0, 0x61, 0xfb, 0x12, 0x00, 0x1e, 0x55, 0x33, 0xfb, 0xd4, 0xcc, 0x62 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.13", + /* Message to be signed */ + 169, + { 0x59, 0x0c, 0xd2, 0x30, 0x50, 0xe5, 0x7b, 0x28, 0xd5, 0x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0x29, 0x25, 0x54, 0xe2, 0xa5, 0xfc, 0x72, 0x62, 0xc5, 0x2e, 0x74, 0xbe, 0xd7, 0x0e, 0xc5, 0x8c, 0x89, 0x50, 0xcd, 0xc4, 0x31, 0x5a, 0x8f, 0xb7, 0xc6, 0x80, 0x15, 0x54, 0xcd, 0x35, 0x78, 0x1d, 0x44, 0xfb, 0x5e, 0x57, 0xd6, 0x8d, 0x59, 0xa0, 0x0f, 0x43, 0xb8, 0x6d, 0x53, 0xb8, 0x43, 0x72, 0xd5, 0x56, 0xe5, 0xa4, 0x15, 0x3c, 0xbe, 0x6b, 0x39, 0x7c, 0x4c, 0x9c, 0x68, 0x00, 0x70, 0x5d, 0x2f, 0xc0, 0xc5, 0x48, 0x64, 0x5e, 0x11, 0xb9, 0xd8, 0xd5, 0x12, 0xb2, 0xdd, 0x9b, 0xf5, 0x9f, 0x3d, 0xc5, 0xd1, 0x1c, 0x3c, 0x77, 0x3d, 0x59, 0xcc, 0xbe, 0xd9, 0xe6, 0xbc, 0x14, 0x32, 0x09, 0x10, 0xcd, 0xf8, 0x3b, 0x46, 0x59, 0x01, 0xb7, 0x46, 0xb5, 0x96, 0x74 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.14", + /* Message to be signed */ + 66, + { 0x80, 0x8c, 0xb9, 0x76, 0x13, 0xfd, 0x87, 0x85, 0x35, 0x80, 0x1c, 0x80, 0x08, 0x79, 0x15, 0x10, 0xa5, 0xfe, 0x86, 0x6a, 0xd5, 0xb6, 0x84, 0x3a, 0x6e, 0x00, 0x19, 0xa0, 0xfc, 0xc2, 0x17, 0x76, 0x03, 0x54, 0xf6, 0x0c, 0xc6, 0x99, 0xfb, 0xbe, 0x1a, 0xdf, 0xe8, 0xb0, 0x0e, 0xcd, 0x6a, 0x36, 0xa2, 0xb5, 0xa5, 0xa1, 0xfa, 0xa2, 0x3d, 0x34, 0x38, 0x20, 0x02, 0x4e, 0x3a, 0x31, 0x97, 0xae, 0x67, 0x3c } +, + /* Signature */ + 129, + { 0x1c, 0x53, 0x96, 0x59, 0xf8, 0x72, 0x46, 0x99, 0x16, 0xfb, 0x00, 0x07, 0xef, 0x9e, 0x48, 0x57, 0x4e, 0x96, 0x4e, 0x4c, 0x0e, 0x6a, 0x2f, 0xa7, 0x4b, 0x13, 0x73, 0xfd, 0x60, 0xb6, 0x64, 0xa7, 0x98, 0xac, 0x81, 0x29, 0xc0, 0x8c, 0x12, 0xcd, 0xbf, 0x37, 0x49, 0x75, 0x0b, 0xe1, 0x25, 0x60, 0x2a, 0x71, 0x54, 0x32, 0x67, 0x67, 0x32, 0x7e, 0x92, 0xba, 0x57, 0xb5, 0xe2, 0x89, 0xb5, 0xac, 0x9d, 0x77, 0x71, 0xb4, 0x52, 0x0a, 0x7a, 0x2c, 0xe6, 0x6c, 0x5e, 0xaf, 0x70, 0x4a, 0xfc, 0x5a, 0x19, 0x0f, 0xa6, 0x0b, 0xe1, 0x37, 0x6f, 0x94, 0x3d, 0x2b, 0xaf, 0x70, 0x52, 0x3e, 0x47, 0xc3, 0xde, 0xfc, 0x0a, 0x25, 0xa6, 0x00, 0x18, 0x31, 0xa3, 0x7a, 0xab, 0x0c, 0xf1, 0xf6, 0x48, 0x7b, 0xe3, 0x7f, 0x0e, 0x31, 0xca, 0x7d, 0xb5, 0xac, 0x41, 0xb5, 0x63, 0x09, 0x57, 0x55, 0x93, 0x69, 0xff } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.15", + /* Message to be signed */ + 202, + { 0x57, 0xed, 0xaa, 0x05, 0x66, 0x25, 0x16, 0x86, 0xf6, 0x52, 0x05, 0xef, 0xc6, 0x26, 0x60, 0xe2, 0xc2, 0xe0, 0x4f, 0xa5, 0xea, 0xa3, 0x30, 0x2d, 0xe8, 0x7a, 0x3f, 0x6b, 0x49, 0x1f, 0x7f, 0xa3, 0xac, 0x72, 0x70, 0xcc, 0x76, 0x75, 0x1a, 0x43, 0x69, 0x42, 0xac, 0x76, 0x5e, 0xf5, 0xf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 0xa2, 0xee, 0x75, 0xcc, 0x5b, 0x25, 0x01, 0x25, 0x4f, 0xd1, 0x97, 0x6d, 0x25, 0x88, 0x00, 0xe9, 0x05, 0xd7, 0xe4, 0x4a, 0x0a, 0xb6, 0xfb, 0x4b, 0x8a, 0x88, 0xbb, 0x7b, 0xf9, 0x31, 0x73, 0x95, 0x30, 0x3a, 0xb2, 0xfc, 0xa4, 0x31, 0x28, 0x48, 0x6a, 0x2b, 0xab, 0x36, 0xc7, 0x5e, 0xf6, 0xaa, 0x5e, 0xb3, 0xfc, 0x5b, 0xd5, 0x55, 0xb3, 0xea, 0x79, 0x12, 0x4a, 0xad, 0x78, 0x97, 0xe3, 0xa4, 0x34, 0xde, 0xe7, 0x92, 0x63, 0x71, 0xde, 0x2d, 0x6d, 0x23, 0x7e, 0x89, 0xb0, 0x3b, 0x8d, 0xd7, 0x09, 0x60, 0x58, 0xe2, 0xa4, 0xb3, 0x2c, 0xb5, 0x57, 0xc7, 0xad, 0xa2, 0x98, 0xa7, 0xe2, 0xed, 0xd3, 0xa3, 0xa3, 0xb5, 0x29, 0xb4, 0xd2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.16", + /* Message to be signed */ + 99, + { 0x08, 0x33, 0x76, 0xbb, 0x82, 0x21, 0x2b, 0xf8, 0x80, 0xbe, 0x12, 0x85, 0x65, 0x3a, 0xf2, 0xca, 0xd6, 0x25, 0xc5, 0x2e, 0x94, 0xe3, 0x21, 0x43, 0x68, 0x77, 0xf7, 0x25, 0xa8, 0x3b, 0xbd, 0x43, 0xf4, 0x48, 0x6d, 0x89, 0x6c, 0xf6, 0x7e, 0x31, 0x39, 0x1b, 0x87, 0x06, 0xf8, 0xc0, 0xf8, 0xf4, 0xbb, 0x1d, 0xdb, 0xa9, 0x5c, 0x33, 0x2f, 0x03, 0x4f, 0x39, 0x09, 0x11, 0x3f, 0x65, 0x56, 0x92, 0x60, 0xa2, 0xe4, 0xf1, 0x04, 0x06, 0x65, 0x7c, 0x99, 0xfa, 0xff, 0x00, 0x1f, 0xe1, 0x6e, 0xbb, 0x89, 0x6e, 0x9e, 0x18, 0x11, 0x5a, 0xf1, 0xd4, 0x98, 0x6c, 0x85, 0x79, 0xab, 0x56, 0x52, 0xcc, 0xca, 0x47, 0x74 } +, + /* Signature */ + 129, + { 0x2a, 0xf4, 0x6c, 0x00, 0xd1, 0xd9, 0x15, 0x94, 0x1e, 0x21, 0x2a, 0x7b, 0x8d, 0x81, 0x05, 0xee, 0x0f, 0x0e, 0xc4, 0x80, 0xff, 0xfb, 0xb4, 0xf1, 0x3b, 0xf2, 0x8d, 0x73, 0xe2, 0xb3, 0x19, 0xb9, 0x84, 0xa7, 0xb7, 0xc8, 0x36, 0x7a, 0xdc, 0xa7, 0xab, 0x12, 0xaa, 0xf5, 0x3a, 0xcb, 0x98, 0xd0, 0xcb, 0x54, 0xee, 0x34, 0x20, 0x4c, 0x90, 0x8e, 0x60, 0xc7, 0xc7, 0x9e, 0xfb, 0x42, 0xc3, 0x11, 0x4a, 0x02, 0x58, 0x9e, 0x1a, 0xe6, 0xaf, 0xb5, 0x97, 0x53, 0x54, 0x57, 0x8c, 0x14, 0x35, 0xec, 0xc8, 0x9c, 0x11, 0x6e, 0x90, 0x26, 0xb6, 0xbc, 0x88, 0x9e, 0xe2, 0x88, 0xae, 0x4d, 0xaf, 0x03, 0x47, 0xcc, 0xce, 0xfc, 0x5d, 0xfd, 0x1e, 0xf8, 0x3c, 0xb8, 0x68, 0x52, 0xee, 0xff, 0xd8, 0x40, 0x98, 0x59, 0x9b, 0x72, 0x5b, 0xf6, 0x02, 0xee, 0x62, 0x0b, 0xdf, 0x44, 0xaf, 0xbd, 0x84, 0xc0, 0xcd } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.17", + /* Message to be signed */ + 17, + { 0x8c, 0x87, 0x4c, 0xd0, 0xce, 0x33, 0x51, 0x39, 0xc0, 0x8d, 0x76, 0x0b, 0x82, 0x5e, 0xb9, 0x90, 0x5d } +, + /* Signature */ + 129, + { 0x66, 0x9a, 0x8a, 0xd7, 0xcb, 0x81, 0xef, 0x21, 0x87, 0xf5, 0xa8, 0x56, 0x47, 0x68, 0x4b, 0x72, 0x48, 0x4a, 0xff, 0x27, 0x9f, 0x0a, 0xf3, 0x54, 0x35, 0x86, 0x7c, 0xc2, 0xb0, 0x43, 0x33, 0xa1, 0x96, 0xec, 0xa6, 0xcf, 0x44, 0xa9, 0x7a, 0x1b, 0xd3, 0x9d, 0x0f, 0x6a, 0x0f, 0xf9, 0x59, 0x57, 0x02, 0x83, 0x5b, 0xc8, 0x0a, 0x72, 0xd7, 0x14, 0x04, 0xef, 0x3f, 0x46, 0xfa, 0x3b, 0x0d, 0x20, 0xe8, 0x6d, 0x7a, 0x1d, 0x5f, 0x7e, 0xfc, 0x3f, 0x3b, 0x8e, 0x8a, 0x7e, 0x37, 0xe8, 0x7e, 0x27, 0xa9, 0x9f, 0xeb, 0xa9, 0x6a, 0xd8, 0x13, 0x20, 0xbe, 0x8f, 0xff, 0x78, 0x55, 0x7d, 0x07, 0xbf, 0xba, 0xe2, 0x16, 0x03, 0xa1, 0x36, 0x8c, 0xaf, 0xa5, 0xae, 0x1d, 0x1b, 0x63, 0x0a, 0xa2, 0x1f, 0xf2, 0x0e, 0x45, 0x85, 0x65, 0x0a, 0x77, 0x3d, 0x7e, 0x2f, 0x5e, 0x7f, 0x51, 0x72, 0x97, 0x19, 0x3c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.18", + /* Message to be signed */ + 102, + { 0xcb, 0x3e, 0x61, 0x21, 0xd3, 0x8b, 0x7d, 0x97, 0xe1, 0x8b, 0xa1, 0x5c, 0x49, 0x3d, 0x1a, 0xc3, 0x2e, 0x9d, 0x2e, 0xf4, 0xe3, 0xbd, 0x16, 0xdf, 0x9c, 0x67, 0xe4, 0xa1, 0x96, 0xe9, 0x24, 0x7a, 0x8d, 0x0c, 0x24, 0xb2, 0x1c, 0x4a, 0xb2, 0x3e, 0x77, 0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xfa, 0x0e, 0x6c, 0x12, 0xf4, 0xe3, 0x42, 0x81 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.19", + /* Message to be signed */ + 81, + { 0x21, 0x9a, 0x2f, 0x8d, 0x0b, 0x00, 0x0a, 0xed, 0xb5, 0xf1, 0x85, 0x45, 0x5e, 0xd3, 0xea, 0x09, 0x4c, 0x45, 0x42, 0x6b, 0x28, 0x5b, 0xab, 0x4a, 0x07, 0xcf, 0x3d, 0x0a, 0x29, 0x06, 0xf3, 0xe2, 0x03, 0x18, 0x4c, 0x2d, 0x3d, 0x81, 0xa8, 0x09, 0xb8, 0x9c, 0x9f, 0xc4, 0x8b, 0xc9, 0xaf, 0x9a, 0xb3, 0x2f, 0x84, 0xf1, 0x5d, 0x81, 0x38, 0x9c, 0x4e, 0xdb, 0x0a, 0xc6, 0x8a, 0xd0, 0x95, 0x02, 0xe3, 0xf3, 0x0c, 0x7c, 0xf6, 0x45, 0x10, 0x29, 0x54, 0xb2, 0x97, 0xc8, 0x66, 0x14, 0x66, 0xfc, 0x10 } +, + /* Signature */ + 129, + { 0x03, 0x83, 0x5d, 0x90, 0x57, 0xe2, 0xb8, 0x21, 0xdc, 0x4c, 0x6e, 0xac, 0xa3, 0xf4, 0x15, 0x6a, 0x56, 0x55, 0x0b, 0x6f, 0x9d, 0x74, 0x00, 0xfc, 0x5c, 0x51, 0x95, 0xa4, 0xae, 0xe4, 0x71, 0x7d, 0xf3, 0x29, 0x29, 0x12, 0x2b, 0x43, 0x27, 0x3a, 0x07, 0x9a, 0x24, 0xf9, 0x9d, 0xd9, 0xe7, 0xc3, 0x40, 0x56, 0xae, 0xa4, 0xfc, 0x4e, 0x45, 0x7d, 0x83, 0x14, 0xef, 0x34, 0x42, 0x7f, 0x8e, 0x20, 0x4b, 0x81, 0xbb, 0x49, 0x03, 0xfb, 0x3e, 0x77, 0x9e, 0x38, 0x9e, 0x41, 0x33, 0x90, 0x68, 0xc1, 0x57, 0xd9, 0xb0, 0x9f, 0x2c, 0x5e, 0x99, 0xcc, 0x54, 0xe6, 0xef, 0x86, 0xee, 0xac, 0x0e, 0x19, 0xf4, 0x4e, 0x33, 0xe7, 0x07, 0xc4, 0x26, 0x1a, 0x0a, 0x83, 0xce, 0xb4, 0x22, 0xf2, 0xe0, 0x6b, 0xcc, 0xae, 0x3b, 0x8b, 0xba, 0x42, 0x8d, 0x75, 0x57, 0x15, 0x2f, 0x40, 0x84, 0x6e, 0xc0, 0x11, 0x34 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 13.20", + /* Message to be signed */ + 97, + { 0xe3, 0x9c, 0xa4, 0x0d, 0x2e, 0x9d, 0x03, 0xae, 0x05, 0x96, 0xf6, 0x0e, 0xb8, 0xf6, 0x09, 0x99, 0x30, 0x85, 0xa5, 0xdb, 0x15, 0x6b, 0x0d, 0x50, 0x98, 0xfe, 0x5f, 0xaa, 0xc5, 0x5f, 0x70, 0x99, 0x3f, 0xe1, 0x76, 0xd2, 0xd0, 0xc0, 0x38, 0xb8, 0x60, 0xbb, 0xf9, 0xa6, 0x62, 0x43, 0xf5, 0xe7, 0x8e, 0x6c, 0xbe, 0x52, 0x6e, 0xcf, 0x25, 0x12, 0x8d, 0xae, 0x31, 0x96, 0x56, 0xcc, 0x32, 0x1e, 0xe8, 0x0a, 0x50, 0x53, 0x14, 0x90, 0xc9, 0xa6, 0x24, 0x3f, 0xbd, 0xb0, 0xc5, 0xeb, 0x4c, 0xd6, 0x42, 0xd2, 0x61, 0x15, 0x05, 0xae, 0x10, 0x84, 0x97, 0x57, 0x38, 0xad, 0x84, 0x62, 0x1d, 0x67, 0xf5 } +, + /* Signature */ + 129, + { 0x4f, 0xcf, 0xa5, 0x73, 0x97, 0xf2, 0x7e, 0xe0, 0xf8, 0xae, 0x75, 0xa0, 0xa5, 0x4d, 0x54, 0xb0, 0xc5, 0x1b, 0x95, 0x7e, 0xe6, 0x3b, 0xf7, 0x90, 0x1b, 0x60, 0x55, 0xcc, 0x39, 0x87, 0xc3, 0x2d, 0xf7, 0x22, 0x0e, 0x16, 0x6a, 0x71, 0x60, 0x6a, 0xbc, 0x78, 0xf9, 0x11, 0x07, 0xf9, 0x74, 0xdf, 0xf7, 0xd6, 0x25, 0x7c, 0x25, 0x6d, 0xc6, 0xed, 0x7a, 0x69, 0xc3, 0xc9, 0x9f, 0x9f, 0x89, 0xab, 0xb5, 0x8f, 0xe5, 0x89, 0xb7, 0xee, 0x7c, 0xad, 0x0f, 0x48, 0xc1, 0x60, 0x10, 0xd0, 0x46, 0xa9, 0xc4, 0xe0, 0x04, 0xbb, 0xe1, 0xa8, 0x29, 0x79, 0x68, 0xd4, 0x0b, 0xc7, 0x06, 0x82, 0xeb, 0xae, 0xa4, 0x48, 0x52, 0x5d, 0xbe, 0xe1, 0x6b, 0x03, 0xbd, 0x0b, 0x65, 0x26, 0xd0, 0x98, 0xd0, 0x9b, 0x6b, 0xad, 0x9a, 0xba, 0x03, 0x93, 0x05, 0xe2, 0xab, 0x79, 0x69, 0x02, 0x08, 0x65, 0x80, 0xcc, 0xf0 } + +} +, +} +}, +{ + "Example 14: A 1536-bit RSA key pair", +{ + /* Modulus */ + 192, + { 0xd8, 0x70, 0xa7, 0x76, 0xcd, 0x13, 0xed, 0x44, 0x3d, 0xf3, 0x99, 0x08, 0xbe, 0xe2, 0xca, 0xd7, 0x3c, 0x48, 0x5f, 0xd9, 0xbf, 0x06, 0x32, 0x13, 0x22, 0x88, 0x7f, 0xbe, 0x65, 0x5c, 0x08, 0xcb, 0xe4, 0xc8, 0xf6, 0x3e, 0x25, 0x4f, 0xc9, 0x1c, 0x75, 0xf0, 0x55, 0x7d, 0x90, 0x1d, 0x43, 0x5b, 0x0e, 0x8d, 0xed, 0x82, 0xd4, 0x91, 0x73, 0x41, 0x4d, 0x29, 0x86, 0x03, 0x24, 0xe4, 0x6c, 0x1b, 0x03, 0x0d, 0xfe, 0xaa, 0x29, 0xd8, 0x0f, 0x98, 0x98, 0xc2, 0xc5, 0xe1, 0x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, 0x2a, 0x79, 0xb5, 0x4f, 0xc2, 0x8f, 0x95, 0xa9, 0x14, 0xe3, 0x1e, 0xa3, 0xee, 0xb3, 0x11, 0x42, 0x60, 0x40, 0x32, 0x7b, 0xa3, 0x5c, 0xc4, 0x94, 0x45, 0x47, 0x52, 0x51, 0xdc, 0x53, 0x78, 0xc3, 0x6d, 0x3b, 0x57, 0xf5, 0x10, 0x1c, 0xd0, 0x3e, 0xb1, 0x5a, 0xfb, 0x75, 0x06, 0x90, 0x3f, 0x25, 0x40, 0xb3, 0x55, 0x04, 0x6b, 0x74, 0x06, 0xca, 0x09, 0x40, 0x41, 0x56, 0x49, 0x45, 0xf3, 0xbe, 0xbf, 0x7d, 0x2d, 0xe9 } +, + /* Prime exponent 2 */ + 96, + { 0x73, 0x5d, 0xb1, 0x26, 0x73, 0xef, 0x67, 0x7b, 0x94, 0x89, 0x48, 0x87, 0xb9, 0x7e, 0x91, 0xa6, 0xa5, 0x6a, 0x94, 0x5d, 0x99, 0xc7, 0x38, 0x29, 0x90, 0xbf, 0x0e, 0x00, 0x02, 0xac, 0xf6, 0xbf, 0x8f, 0x93, 0x22, 0xf4, 0xd5, 0xa3, 0x96, 0x27, 0x91, 0xd3, 0xa8, 0x4d, 0x58, 0x73, 0x66, 0x4a, 0xd0, 0xda, 0x96, 0xeb, 0xf7, 0xba, 0xdb, 0xd5, 0x08, 0x4b, 0xff, 0x3f, 0x81, 0x3b, 0x8c, 0x24, 0xd4, 0x15, 0xb0, 0x9b, 0x6b, 0x9e, 0xc9, 0xf9, 0x59, 0xef, 0x1a, 0x5f, 0x2f, 0x5d, 0xd8, 0x16, 0xfc, 0x9f, 0x47, 0xed, 0x00, 0xe7, 0x9b, 0xd7, 0x47, 0x3b, 0x74, 0xf3, 0xd2, 0x02, 0x1f, 0x71 } +, + /* Coefficient */ + 96, + { 0x10, 0x62, 0x18, 0xaf, 0x97, 0x1d, 0x92, 0x95, 0x91, 0x59, 0x90, 0xa4, 0xed, 0x3e, 0x09, 0xd3, 0x63, 0xdb, 0x33, 0x06, 0xb0, 0x90, 0xa1, 0x33, 0xeb, 0xd7, 0x54, 0xe2, 0xbd, 0x77, 0x6b, 0x25, 0x85, 0x99, 0x9d, 0x4f, 0x88, 0x43, 0x03, 0x0a, 0xc7, 0x0c, 0x0f, 0xf5, 0xde, 0x52, 0x12, 0x67, 0x22, 0x34, 0xc0, 0x07, 0xce, 0x74, 0x56, 0x4c, 0x79, 0x1e, 0xdc, 0xd5, 0x76, 0xf9, 0x68, 0x44, 0x04, 0x8c, 0xfa, 0x66, 0x36, 0x46, 0xb8, 0xfd, 0x80, 0xc7, 0x51, 0x26, 0xb2, 0x26, 0x6e, 0x48, 0xf1, 0xfa, 0xa7, 0x05, 0x44, 0xad, 0x42, 0x04, 0xfd, 0x61, 0x56, 0x29, 0x2e, 0x51, 0x6e, 0x13 } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 14.1", + /* Message to be signed */ + 135, + { 0xf7, 0xa3, 0xc6, 0x7e, 0x92, 0xa7, 0x87, 0xf3, 0x5d, 0xcc, 0x47, 0xae, 0xd7, 0xd6, 0xb6, 0x19, 0x29, 0x67, 0xbd, 0xfd, 0x00, 0xa6, 0xac, 0xbf, 0x6f, 0x7e, 0xfe, 0x46, 0xd3, 0xac, 0xae, 0xd9, 0x78, 0x8a, 0xa4, 0xf1, 0xdb, 0x18, 0x44, 0x02, 0x24, 0x9f, 0x9a, 0xce, 0xfc, 0x1c, 0x7d, 0xfb, 0x1e, 0x69, 0x0d, 0x24, 0x73, 0x8d, 0xe8, 0x6f, 0xa5, 0xb5, 0x25, 0x0f, 0x97, 0x9e, 0xbd, 0x8f, 0x77, 0x8e, 0xec, 0x0d, 0x7f, 0xcf, 0x73, 0x1f, 0xa2, 0x25, 0x08, 0x6c, 0x86, 0x65, 0x64, 0xed, 0x3e, 0xb1, 0x54, 0xdd, 0x45, 0x8d, 0x05, 0x00, 0x28, 0x2f, 0x86, 0x80, 0x48, 0x87, 0xd4,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0xcf, 0x78, 0xbf, 0x8e, 0x1b, 0x2b, 0x40, 0xe5, 0x06, 0x05, 0xe2, 0x5a, 0xe8, 0x0c, 0x38, 0x67, 0x64, 0xae, 0xd1, 0x1a, 0x0e, 0x71, 0x44, 0x90, 0x49, 0xc9, 0x39, 0xb2, 0x96, 0x2f, 0x6c, 0x24, 0x17, 0xa3, 0x58, 0xcd, 0xc8, 0x10, 0x6b, 0x12, 0xb1, 0xa5, 0x58, 0x76, 0x39, 0x43, 0x8a, 0xf1, 0xa6, 0x8d, 0x32 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.2", + /* Message to be signed */ + 131, + { 0x2a, 0x13, 0x30, 0x03, 0xab, 0x67, 0xcd, 0xd2, 0xe8, 0x3b, 0x44, 0xe9, 0xe9, 0xdc, 0x77, 0x7d, 0xe0, 0x1f, 0x4d, 0x23, 0x3d, 0x22, 0xe7, 0xd2, 0xb4, 0x46, 0x7f, 0x04, 0x81, 0x2a, 0x3a, 0xeb, 0xff, 0xb1, 0x0a, 0x09, 0x24, 0x54, 0xe3, 0x3b, 0x9e, 0x70, 0x28, 0x24, 0x93, 0x28, 0x74, 0x7e, 0xa1, 0x4a, 0x11, 0xc7, 0x98, 0xac, 0x2e, 0x14, 0x6e, 0x4e, 0x49, 0x65, 0x9b, 0xa8, 0x60, 0x67, 0xdb, 0x64, 0xe9, 0xbd, 0x80, 0xa7, 0x02, 0x1a, 0xab, 0xcc, 0x22, 0x85, 0x6e, 0x81, 0x01, 0x40, 0xc2, 0x0f, 0xd8, 0xc6, 0x52, 0x7b, 0xad, 0xbb, 0xd9, 0xfa, 0x59, 0x53, 0xfa, 0x77, 0xe6, 0x85, 0x87, 0x00, 0xbe, 0xb6, 0xc7, 0x4d, 0x5a, 0x46, 0x3c, 0x9d, 0xa8, 0x61, 0x13, 0x3b, 0xaa, 0x5b, 0xd6, 0xa5, 0x99, 0x80, 0x7a, 0xe9, 0x16, 0x2e, 0x3a, 0xf3, 0xa3, 0x48, 0x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0x3f, 0x9d, 0x44, 0xb0, 0x07, 0xaa, 0x24, 0x1f, 0x92, 0xf8, 0x88, 0x60, 0x55, 0xd9, 0x8e, 0x0e, 0x07, 0x04 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.3", + /* Message to be signed */ + 42, + { 0x58, 0x62, 0x7f, 0xfa, 0xaa, 0x8e, 0x80, 0x0a, 0x8b, 0xe9, 0x8e, 0x42, 0xf5, 0x1a, 0x83, 0x61, 0x1c, 0xfa, 0xb7, 0xee, 0x37, 0x6b, 0x34, 0x73, 0x7b, 0x3e, 0x48, 0xe1, 0xbc, 0x17, 0x42, 0xda, 0xa7, 0x7d, 0xe4, 0x7e, 0x1a, 0x9b, 0x29, 0x33, 0x77, 0xaa } +, + /* Signature */ + 192, + { 0x3d, 0x17, 0xcb, 0x38, 0x6c, 0x88, 0x78, 0x4d, 0x35, 0x9a, 0xd3, 0xc3, 0x8d, 0xbe, 0x88, 0x8b, 0xfa, 0xe8, 0x31, 0xbf, 0xb8, 0xed, 0xc9, 0xd0, 0xe8, 0x01, 0xe7, 0xd6, 0x9e, 0x1d, 0xd4, 0xc2, 0x44, 0x1d, 0x68, 0xfd, 0xbb, 0x35, 0x12, 0x6c, 0x73, 0xa4, 0xed, 0xab, 0xbf, 0xf5, 0x4e, 0x74, 0xfa, 0x51, 0x09, 0xda, 0xd8, 0xb5, 0xc3, 0x13, 0xd8, 0x6a, 0x79, 0xe4, 0xd4, 0x12, 0x76, 0x60, 0xfc, 0x2a, 0x8e, 0x1c, 0x93, 0xfa, 0x8d, 0x09, 0x2a, 0xcc, 0xf0, 0x1c, 0xc1, 0x8a, 0x60, 0x6c, 0xf0, 0x7d, 0xe2, 0xdc, 0x3e, 0x7b, 0x55, 0x33, 0x11, 0x52, 0xdb, 0x01, 0xb6, 0xca, 0xea, 0x1e, 0xce, 0xc9, 0x09, 0x31, 0x99, 0xbe, 0x62, 0xc3, 0xe1, 0x23, 0xe2, 0x87, 0x31, 0x13, 0x50, 0x3b, 0x22, 0x03, 0x0f, 0x16, 0x8d, 0xaf, 0xc4, 0xe6, 0xbd, 0x06, 0x5a, 0xd2, 0xf6, 0xb1, 0xde, 0xd0, 0x5b, 0xe0, 0xc2, 0xf9, 0xb6, 0x7b, 0xdc, 0x1a, 0x3b, 0xb1, 0x8d, 0xa9, 0x59, 0x4c, 0x95, 0x7d, 0xa4, 0xe4, 0x9f, 0xac, 0x3f, 0xe7, 0x6e, 0x07, 0x66, 0xf7, 0x4e, 0xb0, 0xd5, 0x23, 0xe4, 0xdd, 0x1a, 0xe7, 0x59, 0xda, 0xd6, 0xb9, 0xb9, 0x08, 0xb7, 0xfc, 0x8b, 0x97, 0xef, 0x5f, 0x4c, 0x82, 0x92, 0x32, 0x0a, 0xc3, 0x87, 0xc3, 0x50, 0x8b, 0x54, 0xcf, 0xb8, 0x5d, 0x34, 0xf6, 0xad, 0x39 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.4", + /* Message to be signed */ + 173, + { 0x0f, 0x0f, 0x8d, 0x3c, 0x0e, 0x4d, 0x26, 0x08, 0xaf, 0xad, 0x5a, 0x88, 0x8e, 0xa1, 0x4b, 0x3f, 0x6b, 0x2b, 0x27, 0x89, 0xdd, 0x22, 0x12, 0xb8, 0x59, 0x09, 0xe6, 0x4b, 0xfb, 0x10, 0x4d, 0x0f, 0x7d, 0xe4, 0x27, 0xd1, 0x4a, 0x9f, 0xfa, 0x85, 0x5e, 0x2d, 0x4c, 0xa2, 0x44, 0x23, 0x36, 0xe5, 0x59, 0x56, 0x8b, 0x28, 0x41, 0x5d, 0x60, 0xcf, 0x80, 0x63, 0xde, 0x55, 0x92, 0x17, 0x1b, 0x26, 0x9b, 0x3d, 0x76, 0x33, 0x51, 0xc7, 0xf7, 0xd9, 0xd2, 0x58, 0x09, 0xe7, 0x02, 0x20, 0xee, 0x30, 0xfe, 0x8a, 0x00, 0xb9, 0x5d, 0x4c, 0x20, 0x20, 0x26, 0x89, 0x7e, 0xd2, 0xc6, 0x1d, 0x7a, 0xd4, 0x3a, 0xed, 0xdf, 0x36, 0xb5, 0xc2, 0xcb, 0xe2, 0x1e, 0x00, 0x86, 0xdb, 0xd0, 0xfd, 0xfd, 0x19, 0xe4, 0x3f, 0x02, 0x77, 0xf3, 0xbc, 0x95, 0xed, 0x55, 0xa3, 0x4a, 0xf9, 0x30, 0x91, 0x66, 0x02, 0x19, 0x3c, 0xfe, 0x04, 0x51, 0x4b, 0xd2, 0x6a, 0x05, 0x7e, 0x56, 0x2a, 0x11, 0x90, 0xc2, 0x7e, 0xaa, 0xb6, 0xc3, 0x22, 0xfc, 0xfa, 0xf4, 0xbb, 0xcc, 0x7f, 0x20, 0xc3, 0x77, 0x9c, 0x63, 0x8d, 0x7b, 0xbc, 0x07, 0x08, 0x6c, 0xf7, 0x5b, 0xf8, 0x39, 0x96, 0xdb, 0x44, 0x63 } +, + /* Signature */ + 192, + { 0x50, 0x90, 0x45, 0x12, 0x36, 0x10, 0x50, 0x87, 0x2e, 0xae, 0x80, 0x10, 0x26, 0x28, 0xb6, 0x3d, 0x02, 0x16, 0x8d, 0xca, 0x52, 0xf0, 0xab, 0xd8, 0x77, 0x20, 0xea, 0x48, 0x05, 0x0d, 0x2c, 0x62, 0x06, 0x1a, 0xa2, 0x15, 0x32, 0x68, 0xbe, 0xf8, 0xef, 0xb3, 0x4e, 0xed, 0x46, 0x17, 0x1a, 0x62, 0x88, 0xe5, 0x04, 0xd4, 0x20, 0xf6, 0xfc, 0x14, 0x51, 0x38, 0x61, 0x1e, 0x75, 0xed, 0x3c, 0xf7, 0x9b, 0x4d, 0x10, 0x26, 0x64, 0xd8, 0x64, 0x4f, 0xf3, 0xe9, 0xe5, 0xdb, 0xfd, 0x71, 0xcd, 0xc2, 0x7a, 0x21, 0x0e, 0xfb, 0x10, 0xbe, 0x90, 0x27, 0x56, 0x04, 0xf8, 0xd4, 0x49, 0x14, 0x8b, 0x3f, 0x86, 0x09, 0x90, 0x39, 0xc3, 0x3a, 0xef, 0x90, 0xbf, 0x19, 0x1b, 0x35, 0x18, 0xeb, 0x45, 0x9d, 0xa3, 0xba, 0x14, 0xfd, 0x0c, 0x72, 0x22, 0x9d, 0xea, 0x5f, 0xac, 0x2f, 0x7d, 0xad, 0xe1, 0x08, 0x5c, 0x8a, 0x23, 0x70, 0xbb, 0xfc, 0xfa, 0x2e, 0x3a, 0x9e, 0x63, 0xca, 0x22, 0x4f, 0x6d, 0xe8, 0xc8, 0xd2, 0x97, 0xa3, 0xb1, 0xf0, 0x6f, 0x1f, 0xc9, 0x49, 0x78, 0x90, 0xfd, 0x0e, 0x0e, 0x13, 0x88, 0x7f, 0xac, 0xb1, 0x52, 0xd1, 0x2d, 0x96, 0x39, 0x25, 0x28, 0xef, 0x28, 0xd0, 0x72, 0x43, 0x31, 0xff, 0x41, 0x40, 0x30, 0xc7, 0xa6, 0x38, 0x55, 0x81, 0x3c, 0xcd, 0x89, 0xfb, 0xdb, 0x1b } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.5", + /* Message to be signed */ + 13, + { 0x26, 0x65, 0xcb, 0x5e, 0xe3, 0x6a, 0xa9, 0xbb, 0x1a, 0x5c, 0xde, 0x7c, 0xe8 } +, + /* Signature */ + 192, + { 0x4f, 0x38, 0xc2, 0xba, 0x84, 0xc5, 0x0d, 0x46, 0xdf, 0x53, 0x10, 0x91, 0xb6, 0x27, 0x12, 0x14, 0x9c, 0x1f, 0x42, 0xdb, 0xd7, 0x7e, 0x03, 0xd1, 0x85, 0xea, 0x96, 0xed, 0xa8, 0x02, 0x33, 0x7c, 0x22, 0xc1, 0x13, 0x0b, 0xc3, 0xbe, 0xce, 0xbf, 0x15, 0x39, 0xfd, 0x11, 0x89, 0x38, 0x51, 0xda, 0xe3, 0xcc, 0x15, 0x67, 0xcb, 0x6c, 0x73, 0xa7, 0x2f, 0xa1, 0xc9, 0x69, 0x48, 0x68, 0x21, 0x12, 0x7e, 0x7c, 0xfe, 0xa1, 0x36, 0x3e, 0xee, 0x95, 0x2b, 0x7c, 0x6e, 0xb5, 0x9e, 0x10, 0x2c, 0x66, 0x57, 0xc0, 0x80, 0x35, 0x27, 0x2c, 0xdf, 0x4a, 0xb5, 0xe5, 0x83, 0xed, 0x73, 0x7a, 0xd0, 0x28, 0xac, 0x1c, 0xfa, 0xfe, 0xdd, 0xc9, 0x07, 0x3d, 0xfb, 0xd7, 0xd3, 0xba, 0x3d, 0xa9, 0xe8, 0xdc, 0xd8, 0x46, 0xfa, 0x36, 0x5c, 0x9c, 0xcd, 0x8e, 0x9b, 0x39, 0x48, 0x3d, 0x37, 0x07, 0x3c, 0x1a, 0x7b, 0x78, 0x2e, 0xe7, 0x12, 0x1b, 0xb1, 0xa2, 0xad, 0x8b, 0xf5, 0xf8, 0xed, 0x6e, 0x65, 0x3e, 0x92, 0x4d, 0xeb, 0xad, 0x87, 0x1b, 0x74, 0x43, 0x39, 0xe5, 0xae, 0x7e, 0x96, 0xf6, 0x0d, 0xcc, 0x45, 0xea, 0x5d, 0x69, 0x7d, 0x3b, 0x1c, 0xc7, 0xc5, 0xe8, 0xda, 0x04, 0xe9, 0x2b, 0xe0, 0x6c, 0xad, 0x2e, 0x61, 0x4e, 0xac, 0x31, 0x8a, 0xec, 0xaf, 0x12, 0xd5, 0xa7, 0x62, 0x34, 0xc2, 0xc0 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.6", + /* Message to be signed */ + 125, + { 0x7b, 0x7b, 0x61, 0x61, 0x02, 0x0f, 0xaf, 0xb4, 0x88, 0x71, 0x63, 0x21, 0x34, 0x0d, 0xaf, 0x2c, 0x06, 0xac, 0x43, 0xce, 0x21, 0x32, 0x86, 0x86, 0x84, 0xaa, 0xaf, 0xab, 0x13, 0x99, 0x65, 0x3d, 0x35, 0x3b, 0x26, 0x93, 0xad, 0x73, 0xcb, 0x55, 0xb7, 0x1d, 0x66, 0xac, 0xd0, 0x1a, 0x16, 0x0c, 0xbf, 0x74, 0x37, 0x67, 0xbd, 0x96, 0xe7, 0x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20, 0x29, 0x2b, 0x8e, 0xc8, 0x27, 0x17, 0x40, 0x6d, 0x36, 0xef, 0x91, 0x25, 0xe4, 0x1f, 0xb5, 0xd5, 0x3b, 0xcc, 0xdd, 0x62, 0x2d, 0x38, 0x8f, 0xcc, 0xee, 0x60, 0xa3, 0x85, 0xec, 0x20, 0x6a, 0x71, 0x5d, 0xc5, 0x4d, 0x78, 0x77, 0xbd, 0x72, 0x85, 0xd0, 0x84, 0x4c, 0x25, 0xd5, 0x93, 0x77, 0x97, 0x91, 0x27, 0x83, 0x96, 0xff, 0x9a, 0x8a, 0x91, 0x30, 0x6a, 0x54, 0xea, 0x76, 0x60, 0x7c, 0x81, 0x3f, 0x80, 0x1f, 0x38, 0x76, 0x0c, 0x3a, 0x81, 0x4b, 0x93, 0x96, 0x95, 0x9c, 0x29, 0xdb, 0xff, 0x9d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.7", + /* Message to be signed */ + 12, + { 0x2b, 0x0a, 0xd6, 0x13, 0x82, 0x28, 0x78, 0xa5, 0x72, 0xe1, 0x42, 0x80 } +, + /* Signature */ + 192, + { 0x89, 0xc8, 0x10, 0x84, 0xda, 0xa8, 0xf9, 0x14, 0xb7, 0xe2, 0x44, 0x55, 0x10, 0x74, 0x17, 0xca, 0x62, 0x1c, 0x91, 0x02, 0xd5, 0x01, 0xee, 0xb4, 0x3d, 0x17, 0x4c, 0x7b, 0xad, 0x38, 0x1d, 0xb1, 0x8d, 0x95, 0x33, 0xc3, 0x41, 0x1a, 0xec, 0x60, 0x57, 0xca, 0x5a, 0x4d, 0xfd, 0xc3, 0xf1, 0x31, 0xc8, 0x88, 0xb8, 0x8f, 0x01, 0x30, 0x03, 0xd6, 0x17, 0xe0, 0x6d, 0x64, 0x47, 0x95, 0x02, 0xae, 0x7e, 0x42, 0x4a, 0x5d, 0xd6, 0x37, 0xb0, 0x33, 0x56, 0x40, 0x4d, 0x26, 0x0f, 0x5e, 0xd6, 0xb8, 0xcb, 0x16, 0xd2, 0x57, 0x85, 0x28, 0xcc, 0x3e, 0x85, 0x00, 0x34, 0x6e, 0xb7, 0x90, 0xbd, 0xad, 0x41, 0xb2, 0xe3, 0x6c, 0xa6, 0xf1, 0x98, 0x85, 0xe3, 0xf6, 0xf5, 0x10, 0x86, 0xbf, 0xfb, 0x6a, 0xbb, 0x9c, 0x66, 0x33, 0x6b, 0x49, 0x47, 0x34, 0x64, 0xc5, 0xd7, 0xed, 0x8e, 0x9f, 0xf8, 0x5e, 0x11, 0xae, 0xff, 0x40, 0x90, 0x67, 0xba, 0xb0, 0xa0, 0x5c, 0x41, 0xe8, 0x15, 0x1b, 0x8b, 0xe9, 0x87, 0xf3, 0xf5, 0x95, 0x8e, 0x3e, 0x6f, 0x26, 0x51, 0x5d, 0x96, 0xbf, 0x23, 0x4b, 0x22, 0xab, 0x91, 0xc0, 0x85, 0x7b, 0x6c, 0x08, 0xa4, 0x6b, 0x03, 0x05, 0xfe, 0x04, 0x4c, 0xa9, 0xaa, 0xa0, 0xd7, 0x0a, 0x27, 0x58, 0xa1, 0xce, 0x43, 0x16, 0x64, 0xa8, 0xdd, 0x79, 0x40, 0x8c, 0x16, 0xba } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.8", + /* Message to be signed */ + 76, + { 0x36, 0x93, 0x8c, 0x8c, 0x7c, 0x6f, 0x7e, 0x35, 0x52, 0x34, 0xdb, 0x5a, 0x32, 0xa6, 0x48, 0x10, 0xdb, 0x50, 0x2b, 0x67, 0xc6, 0xf5, 0x92, 0x54, 0x4f, 0xfb, 0x27, 0xeb, 0x1f, 0x22, 0xe0, 0x6f, 0x2d, 0x63, 0x8b, 0x56, 0xd5, 0xd2, 0xf7, 0xd1, 0x9e, 0x9e, 0x27, 0x1f, 0x2c, 0xc9, 0x0c, 0xc0, 0xdd, 0x36, 0xd6, 0xcc, 0x2c, 0x06, 0x17, 0x8b, 0xcc, 0x70, 0x6a, 0xef, 0x20, 0xe5, 0x6a, 0x35, 0x8e, 0x52,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, 0xf7, 0x5a, 0xef, 0xe3, 0x8f, 0x0b, 0x91, 0xb4, 0x2b, 0xb8, 0x06, 0xde, 0x4b, 0x87, 0xc9, 0x08, 0x2f, 0x72, 0x1a, 0x68, 0x80, 0xca } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.9", + /* Message to be signed */ + 95, + { 0x60, 0x83, 0x0c, 0x01, 0xcf, 0xa8, 0x6f, 0xf2, 0xdc, 0xac, 0x7a, 0xf9, 0x32, 0x1e, 0xe5, 0xfe, 0x50, 0x2e, 0x0e, 0x7a, 0x6f, 0xac, 0xb7, 0x3e, 0x3f, 0x6b, 0xc9, 0x02, 0x64, 0x0a, 0x61, 0x09, 0x5f, 0x64, 0x6f, 0xd0, 0x3e, 0x80, 0xd5, 0x81, 0x82, 0x46, 0x53, 0x31, 0xe7, 0x5d, 0x66, 0x11, 0xa0, 0x97, 0x76, 0x81, 0x62, 0x70, 0x86, 0x24, 0x17, 0x29, 0xde, 0x9f, 0x44, 0xab, 0x43, 0x94, 0x9d, 0xac, 0x19, 0x36, 0x73, 0xbd, 0x6c, 0xf8, 0x7f, 0x5d, 0x65, 0x77, 0x1e, 0xf8, 0x72, 0x81, 0x63, 0x3f, 0xdd, 0x07, 0xba, 0xc4, 0x09, 0xa6, 0xe2, 0x32, 0xb6, 0x01, 0xae, 0xce, 0x2d } +, + /* Signature */ + 192, + { 0x40, 0x58, 0xf6, 0xe0, 0x24, 0x0d, 0x85, 0x1d, 0x61, 0x93, 0x95, 0xa7, 0x52, 0x87, 0xa8, 0x8f, 0xaf, 0xd8, 0xdc, 0x56, 0x00, 0xb0, 0x69, 0xbf, 0x19, 0xdc, 0x3e, 0x19, 0x21, 0xe1, 0x17, 0xb4, 0x97, 0xb8, 0x2b, 0x3c, 0x52, 0x02, 0x69, 0xb1, 0xd1, 0x12, 0x81, 0x64, 0xfc, 0xd8, 0x8d, 0xd2, 0xb4, 0x6d, 0xc8, 0x5c, 0x42, 0xec, 0xf6, 0x7d, 0xeb, 0xad, 0x21, 0xa3, 0xb9, 0xa1, 0x55, 0x42, 0xfe, 0xa2, 0x26, 0x06, 0xea, 0xb5, 0x82, 0xfc, 0x32, 0x97, 0x11, 0xff, 0xc0, 0x7f, 0x4e, 0xef, 0x1f, 0x3b, 0xbf, 0xe0, 0x88, 0x8c, 0xbc, 0xa4, 0x85, 0xba, 0xfc, 0x11, 0x88, 0xb0, 0xaf, 0xe8, 0x09, 0xc9, 0xaa, 0xf8, 0xfa, 0x36, 0x66, 0xb9, 0xc9, 0x05, 0x85, 0x39, 0xdb, 0x1e, 0xc6, 0xa1, 0x8e, 0x5b, 0xe0, 0xb8, 0x01, 0x44, 0xd2, 0xc3, 0x7c, 0xa6, 0x14, 0xc0, 0x90, 0xb4, 0xa7, 0xf1, 0x34, 0x58, 0xe0, 0xd3, 0xa4, 0xcb, 0x0c, 0xb7, 0x3d, 0xcc, 0x4d, 0x90, 0x80, 0x6f, 0x61, 0x08, 0x58, 0x89, 0xeb, 0x5c, 0x9b, 0x14, 0x09, 0xde, 0xf3, 0x60, 0xfd, 0x1c, 0x2e, 0x49, 0x43, 0x8d, 0x7c, 0x67, 0xd7, 0x9d, 0xbd, 0x9a, 0x59, 0x2a, 0xb5, 0x04, 0xc4, 0x71, 0x5f, 0x65, 0xb2, 0x9d, 0x84, 0x65, 0x09, 0x95, 0x15, 0x69, 0xa8, 0xc3, 0x79, 0x09, 0xf5, 0xd5, 0x50, 0xee, 0xff, 0xfa } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.10", + /* Message to be signed */ + 153, + { 0x63, 0x5d, 0x22, 0x03, 0xed, 0x9d, 0x5b, 0x91, 0x20, 0xe3, 0x1b, 0xf6, 0x9d, 0x30, 0x5b, 0xe6, 0x06, 0x86, 0x97, 0xe3, 0x5c, 0xe5, 0x9c, 0x55, 0x3e, 0x50, 0x8d, 0xc7, 0x7b, 0x07, 0x3f, 0xfa, 0x3a, 0xaa, 0x59, 0xf9, 0x96, 0xc3, 0x0b, 0x2e, 0x68, 0x63, 0x23, 0x81, 0x9f, 0xde, 0x22, 0xbe, 0x6c, 0x8d, 0x53, 0x86, 0x84, 0x14, 0xb3, 0x54, 0x5a, 0xbf, 0x43, 0x57, 0x68, 0xa6, 0x11, 0xf0, 0xc1, 0xa4, 0x79, 0xa0, 0xc7, 0x66, 0x0d, 0x53, 0x5e, 0x80, 0x5b, 0x5f, 0xed, 0xc3, 0x77, 0x9c, 0xf0, 0xc5, 0x2c, 0x3c, 0xd0, 0x40, 0xab, 0x65, 0x14, 0xc7, 0xf8, 0x13, 0x3d, 0x47, 0xb0, 0xac, 0xc6, 0x91, 0x4e, 0x6d, 0x4a, 0xd3, 0xc4, 0x73, 0x7c, 0xf5, 0x12, 0x91, 0x09, 0x4e, 0x85, 0x94, 0x33, 0xba, 0x30, 0x66, 0xe1, 0x9d, 0x6a, 0xa2, 0xda, 0x89, 0x6d, 0xc9, 0xd9, 0x5e, 0xf9, 0xe5, 0x63, 0x6d, 0xab, 0x35, 0xf7, 0x29, 0x87, 0x05, 0xc6, 0xd8, 0x76, 0x17, 0x54, 0x12, 0xf8, 0x84, 0x25, 0x19, 0xff, 0xe1, 0x6c, 0xf7, 0x43, 0x62, 0xab } +, + /* Signature */ + 192, + { 0x94, 0x61, 0xa1, 0xa8, 0x41, 0x42, 0x3e, 0xd5, 0xcf, 0xc6, 0x08, 0x9a, 0x74, 0xdb, 0xfc, 0x53, 0x73, 0x11, 0x03, 0xbf, 0x49, 0x85, 0xdd, 0xb1, 0x50, 0xb0, 0xe9, 0x38, 0x0d, 0x3f, 0xe0, 0xcf, 0x6d, 0x45, 0x7c, 0x5c, 0x68, 0xa7, 0xf2, 0x55, 0x04, 0x02, 0x2d, 0x69, 0x5f, 0xf8, 0x42, 0x11, 0x8e, 0xbf, 0x61, 0x02, 0x2f, 0xea, 0x47, 0xfa, 0x45, 0xf7, 0xc1, 0xcc, 0x72, 0x6e, 0x1d, 0xe5, 0x0b, 0xd0, 0x64, 0xb3, 0xbb, 0x70, 0x16, 0x57, 0x16, 0x2b, 0x88, 0xc0, 0xb9, 0x10, 0xfe, 0xb7, 0x2f, 0x48, 0x7a, 0x5c, 0x7f, 0x4b, 0x9e, 0xcf, 0xee, 0x24, 0xe0, 0x7a, 0xa2, 0xd1, 0x98, 0xd1, 0x13, 0xcb, 0x84, 0x5d, 0x81, 0x7b, 0xb5, 0x9b, 0xb1, 0xda, 0x24, 0xa8, 0x2b, 0x91, 0xc2, 0xfe, 0x3f, 0xba, 0x89, 0x51, 0x83, 0xcb, 0xd9, 0xc0, 0xfe, 0x0a, 0xc0, 0xbe, 0x64, 0xfe, 0xf2, 0xe0, 0x13, 0x92, 0x05, 0xb1, 0x0b, 0xca, 0xbf, 0xe5, 0xa3, 0xa7, 0xa8, 0x90, 0xfc, 0x0f, 0xe7, 0x8d, 0xab, 0xe1, 0xad, 0xb5, 0xbd, 0x11, 0x44, 0x85, 0x03, 0xcb, 0x0d, 0xcd, 0x0b, 0x68, 0xf1, 0x60, 0x19, 0x6e, 0x96, 0x13, 0xe2, 0x9f, 0xbe, 0x9a, 0x3f, 0x94, 0x06, 0xec, 0x20, 0xc0, 0x30, 0xe8, 0x1e, 0xc3, 0x09, 0x65, 0xea, 0x01, 0x9c, 0x17, 0xaa, 0x97, 0x11, 0x01, 0xc2, 0xe5, 0x30, 0x59 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.11", + /* Message to be signed */ + 182, + { 0x87, 0xfb, 0xa9, 0x89, 0xf3, 0xcc, 0x15, 0xaf, 0x7e, 0xe7, 0x61, 0xc0, 0x88, 0x26, 0x4a, 0xb7, 0x71, 0x52, 0x39, 0xe0, 0xb8, 0xc8, 0xa9, 0xe4, 0x8e, 0x11, 0xdb, 0x68, 0x03, 0x31, 0x39, 0xc2, 0xa2, 0x89, 0xea, 0x42, 0x6e, 0xbe, 0x26, 0x9f, 0x5f, 0xb7, 0x07, 0x09, 0x0a, 0xfb, 0x89, 0x1a, 0x49, 0xca, 0x05, 0xc0,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 0xab, 0xfe, 0xea, 0x38, 0x01, 0x32, 0x79, 0x17, 0x79, 0x40, 0x99, 0x7b, 0x28, 0x90, 0x2b, 0x14, 0xdb, 0x37, 0x9e, 0xeb, 0x4f, 0x44, 0x00, 0x5d, 0xfc, 0xb0, 0x03, 0x68, 0x03, 0xc9, 0xf1, 0x25, 0xbc, 0xe1, 0xf2, 0xa8, 0x2c, 0x4d, 0x30, 0x07, 0xae, 0x96, 0xb8, 0x48, 0xb8, 0x13, 0xec, 0x8c, 0x97, 0xca, 0x3f, 0x71, 0x0a, 0x9a, 0xe0, 0xdb, 0xc2, 0x8a, 0x55, 0xe0, 0x58, 0x81, 0xb8, 0x58, 0xdb, 0x55, 0x71, 0x20, 0xf3, 0x3c, 0x59, 0xcd, 0x43, 0x60, 0xf9, 0x20, 0x8c, 0x74, 0xb2, 0x7e, 0xc6, 0x5d, 0x11, 0xea, 0x41, 0xfa, 0x6a, 0x9e, 0xac, 0xf2, 0xa6, 0x11, 0x68, 0xad, 0x07, 0xc2, 0x09, 0x94, 0x8f, 0x35, 0xa1, 0x61, 0xf4, 0x1f, 0x87, 0x54, 0x0e, 0xa1, 0x82, 0x84, 0xaa, 0xb8, 0xd8, 0xf9, 0x78, 0x61, 0x31, 0xf0, 0x43, 0x90, 0x2b, 0x89, 0xc1, 0x7a, 0x56, 0x0d, 0x90, 0x94, 0x64, 0x47, 0x5a, 0x0d, 0xfc, 0xe5, 0x89, 0x09, 0x18, 0x7c, 0xd6, 0xe4, 0x46 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.12", + /* Message to be signed */ + 100, + { 0x4b, 0x5e, 0x80, 0x30, 0x5c, 0xbe, 0xa9, 0x0d, 0x63, 0x7f, 0xdb, 0x23, 0x47, 0xc6, 0xfe, 0xb6, 0x78, 0x42, 0xeb, 0xac, 0x6f, 0x90, 0x3d, 0xb5, 0xa7, 0x1e, 0xba, 0xab, 0x8a, 0x1c, 0x2d, 0xf1, 0x12, 0x60, 0xa1, 0xec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d7, 0x32, 0x85, 0x2a, 0xf3, 0x50, 0xa2, 0x75, 0x69, 0x9a, 0x94, 0xaa, 0x6e, 0x47, 0xf2, 0x17, 0xe3, 0x83, 0xef, 0x8f, 0xce, 0x8e, 0xb6, 0xee, 0xd7, 0x82, 0x6d, 0x7c, 0x61, 0x58, 0xfc, 0x58, 0x82, 0xe4, 0x61, 0x35, 0x45, 0xfa, 0x26, 0xee, 0xe0, 0xc9, 0xf9, 0x3d, 0xe7, 0xa1, 0x65, 0x08, 0xea, 0x16, 0x19, 0x70, 0x46, 0x0d, 0x6a, 0x7c, 0xa7, 0x70, 0xf8, 0xde, 0x8b, 0xa9, 0x3c, 0xea, 0xf3, 0x97, 0xdd, 0xf1, 0xfb, 0xce, 0xe2, 0x82, 0xa1, 0x53, 0x7d } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.13", + /* Message to be signed */ + 86, + { 0xe5, 0xad, 0x62, 0x7f, 0x24, 0xf4, 0x11, 0x7a, 0x0a, 0x6b, 0xe4, 0xa5, 0x5f, 0xdb, 0x88, 0x3d, 0x75, 0xa6, 0x73, 0x12, 0x15, 0x4a, 0x71, 0x89, 0x23, 0xd0, 0xe8, 0xf5, 0x73, 0x0a, 0x54, 0xd8, 0xca, 0x7c, 0x97, 0x4e, 0x4d, 0x59, 0x33, 0x8b, 0xb5, 0x71, 0x30, 0x5c, 0xce, 0x99, 0x0c, 0xbb, 0xcf, 0xa9, 0x1e, 0xa9, 0xb7, 0x73, 0xb8, 0x3d, 0x7a, 0x1f, 0x0f, 0xfe, 0xc4, 0xc6, 0xb1, 0x43, 0xfe, 0x05, 0x05, 0x8b, 0xc9, 0x0c, 0xe1, 0x46, 0xf3, 0x69, 0xcb, 0xae, 0x3b, 0x3d, 0x99, 0x70, 0x5e, 0xf4, 0x3d, 0x07, 0x21, 0xb8 } +, + /* Signature */ + 192, + { 0x73, 0x29, 0x86, 0xd4, 0xed, 0xdb, 0x8a, 0x7e, 0x9b, 0x65, 0xdc, 0x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.5 Signature Example 14.14", + /* Message to be signed */ + 75, + { 0x03, 0xe3, 0x9b, 0xa7, 0xa8, 0x0c, 0x77, 0x14, 0x16, 0xd8, 0x52, 0x63, 0xe4, 0xd4, 0x3c, 0x63, 0x93, 0xdf, 0xe7, 0x96, 0x52, 0x3b, 0x89, 0xe0, 0xa4, 0x61, 0x62, 0x88, 0x80, 0x80, 0x0d, 0x8f, 0xc2, 0x43, 0x1b, 0x66, 0x30, 0x54, 0x09, 0xe0, 0x6c, 0x95, 0xae, 0x7a, 0x17, 0xd5, 0x34, 0xb1, 0xe8, 0x4c, 0x19, 0x9d, 0xfe, 0x73, 0x1d, 0xa9, 0x49, 0xf1, 0x64, 0x57, 0x1d, 0xec, 0xc8, 0xb1, 0x66, 0xbe, 0xb8, 0xdc, 0x08, 0x7c, 0xb4, 0x86, 0x99, 0x98, 0xc2 } +, + /* Signature */ + 192, + { 0x60, 0x76, 0x3b, 0xea, 0xf7, 0xc3, 0xe2, 0x2b, 0x3b, 0x22, 0xdc, 0x44, 0xd9, 0x47, 0x82, 0x6e, 0x23, 0xfc, 0xf9, 0x6b, 0x01, 0xb7, 0x74, 0x1b, 0x24, 0xb1, 0xb9, 0xd9, 0x3c, 0x07, 0xf0, 0xc6, 0x4d, 0x39, 0x67, 0x98, 0xbb, 0x58, 0x9b, 0xd4, 0x25, 0x29, 0x53, 0x69, 0xbf, 0xb8, 0x79, 0xad, 0xd3, 0x42, 0xcd, 0x76, 0x28, 0x0b, 0x57, 0xe6, 0x35, 0x4f, 0x61, 0x95, 0xe8, 0x42, 0xfa, 0x2a, 0x95, 0xf1, 0xc4, 0x6f, 0x0b, 0x70, 0x78, 0x6c, 0x31, 0x8d, 0xe9, 0xa5, 0x5a, 0x8a, 0xc4, 0x54, 0x5e, 0xe7, 0xcf, 0xf3, 0x99, 0xc6, 0x78, 0xe5, 0x78, 0xf8, 0x93, 0x9e, 0xd4, 0x9e, 0x84, 0xbb, 0xa9, 0xaa, 0xe5, 0x7c, 0x1a, 0x36, 0xfc, 0xc3, 0x94, 0x86, 0x46, 0x6e, 0x40, 0x12, 0xf9, 0x58, 0x87, 0xa6, 0x81, 0x10, 0xf1, 0xa4, 0x84, 0x67, 0xe4, 0xc2, 0x34, 0xf5, 0x81, 0xc5, 0xec, 0x47, 0x71, 0x06, 0xcc, 0xb3, 0xec, 0x86, 0x17, 0xb4, 0xbe, 0x21, 0x93, 0x37, 0x44, 0x8f, 0xe7, 0x2e, 0x25, 0xde, 0xab, 0x53, 0xea, 0xcb, 0x92, 0xe5, 0x96, 0x62, 0x95, 0xb3, 0xa5, 0x57, 0x12, 0x19, 0x58, 0xdf, 0xe7, 0x9c, 0xa4, 0x72, 0xf7, 0x9e, 0xfb, 0xda, 0x1d, 0xcf, 0xba, 0x9d, 0xbd, 0x0f, 0x97, 0x67, 0x32, 0xc0, 0x93, 0xb9, 0x8f, 0xf1, 0x93, 0xc9, 0x02, 0x98, 0x7a, 0x42, 0x6c, 0x0f } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.15", + /* Message to be signed */ + 243, + { 0xd4, 0xc2, 0x35, 0x96, 0x7d, 0x4e, 0x87, 0xb6, 0x71, 0x1e, 0x32, 0xac, 0x70, 0x37, 0xa3, 0x97, 0xf9, 0x9b, 0x1c, 0xad, 0x95, 0xa1, 0x88, 0x94, 0x6a, 0x48, 0x64, 0x0e, 0xb6, 0xb7, 0xb0, 0x03, 0xc3, 0x2f, 0x85, 0xa1, 0x21, 0xb0, 0x9c, 0xa4, 0xc8, 0xbe, 0xc0, 0xb8, 0x27, 0x44, 0xaa, 0xf2, 0x7d, 0x16, 0x6c, 0xef, 0xc7, 0xa9, 0x70, 0x2a, 0xd3, 0x1d, 0xbd, 0x15, 0xea, 0x2a, 0x18, 0x5f, 0x5b, 0x9b, 0xa6, 0x42, 0xf9, 0x49, 0x07, 0x8b, 0xc6, 0x09, 0xb9, 0xa8, 0xa3, 0x36, 0x92, 0xd7, 0x18, 0x49, 0x39, 0xd1, 0xf9,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0xd2, 0x3a, 0xa7, 0xb5, 0x81, 0xdc, 0x3f, 0x00, 0xf5, 0x42, 0x1b, 0x5c, 0x17, 0x2d, 0x0f, 0xfc, 0xe9, 0x14, 0x97, 0xd3, 0xd4, 0xb1, 0x04, 0xf5, 0x6a, 0x98, 0xec, 0x94, 0xf7, 0x19, 0x27, 0x1e, 0x58, 0xb4, 0x3e, 0xfb, 0xd8, 0x76, 0xe1, 0xc1, 0x31, 0xfa, 0x97, 0x82, 0x07, 0x28, 0xa5, 0x56, 0x75, 0x55, 0x21, 0x4c, 0xd9, 0x4a, 0x18, 0xfc, 0xce, 0x5c, 0x2f, 0x53, 0xb1, 0x9d, 0x1f, 0x3c, 0x73, 0xd0, 0x9f, 0x7b, 0xe1, 0x80, 0x97, 0x38, 0xb0, 0x3c, 0xe7, 0x69, 0xe4, 0x54, 0xed, 0x4c, 0xbe, 0xdc, 0xaf, 0x43, 0xc4, 0x8b, 0xd3, 0x9d, 0xf2, 0xf8, 0xbb, 0x63, 0xb8, 0xfc, 0x4d, 0x0d, 0x4d, 0x5b, 0x20, 0x4f, 0xc2, 0x20, 0x01, 0x3a, 0x66, 0x8c, 0x19, 0xf9, 0x75, 0x02, 0x93, 0xa4, 0x71, 0x15, 0x83, 0x88, 0x26, 0x45, 0xdb, 0xf3, 0xac, 0x4f, 0x83, 0x9b, 0x6f, 0xd1, 0xcf, 0x3b, 0x5e, 0xe8, 0xd7, 0x34, 0xe1, 0xda, 0x37, 0x4d, 0x91, 0xd8, 0x9e, 0xa3, 0x18, 0xe9, 0x18, 0x34, 0x83, 0xf4, 0xa0, 0x9a, 0x93, 0x51, 0x4a, 0xf5, 0x4f, 0x75, 0xd0, 0xa3, 0x56, 0x51, 0xb2, 0x40, 0xf7, 0x9f, 0x20, 0xa2, 0x97, 0x7d, 0x14, 0x57, 0x8c } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.16", + /* Message to be signed */ + 119, + { 0xd0, 0x6a, 0xdc, 0xa4, 0xc2, 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ab, 0x70, 0x01, 0xb8, 0x55, 0xc9, 0x34, 0x2f, 0x0c, 0x90, 0xbf, 0xa6, 0xc3, 0x34, 0x9b, 0x2c, 0x39, 0x62, 0x13, 0xef, 0x70, 0xcb, 0xd8, 0x4b, 0xb4, 0xce, 0x6e, 0xf5, 0x8b, 0x17, 0x6e, 0x9f, 0x6f, 0xcc, 0xdb, 0x6e, 0x46, 0xca, 0xc3, 0x41, 0x14, 0xa1, 0xb9, 0xf9, 0x8a, 0x8a, 0x32, 0x75, 0x7b, 0xf7, 0x5d, 0x6b, 0xfc, 0x45, 0x5a, 0xde, 0x6a, 0x01, 0xf9, 0x60, 0x50, 0x1b, 0x79, 0xf5, 0xfb, 0xe3, 0xb3, 0x8f, 0xca, 0x03, 0x46, 0x4e, 0x43, 0xd4, 0x96, 0x63, 0xc7, 0x9f, 0xf6, 0x4d, 0x32, 0x98, 0x1e, 0x44, 0x80, 0xcd, 0xf4, 0x2d, 0x8a, 0xf8, 0xda, 0xa7, 0xf1, 0x2b, 0x81, 0xa5, 0xaa, 0x96, 0x5f, 0xad, 0xaa, 0x3c, 0x03, 0xb7, 0xff, 0x22, 0xd3, 0xcf, 0xdf, 0xfe, 0x3c, 0xad, 0xf4, 0xd5, 0x98, 0x9e, 0xd1, 0x4c, 0x96, 0x9a, 0x6e, 0x8c, 0x9a, 0x1e, 0x04 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.17", + /* Message to be signed */ + 209, + { 0x3a, 0x63, 0x02, 0xd7, 0x9e, 0x26, 0xb5, 0x55, 0xc7, 0x7d, 0xe9, 0x2a, 0x91, 0xe0, 0x78, 0x57, 0x1e, 0xd1, 0x57, 0x2f, 0xfc, 0x3e, 0x4f, 0xc9, 0x05, 0xce, 0x53, 0xf1, 0x04, 0xb3, 0x22, 0x00, 0x95, 0x7e, 0xb2, 0xb5, 0xe5, 0xf3, 0xe3, 0xfc, 0xbb, 0xc1, 0x62, 0xf9, 0xe5, 0x25, 0xc7, 0x06, 0xf1, 0xdd, 0x04, 0xfc, 0xab, 0x51, 0x6b, 0xc1, 0x8a, 0x8e, 0x4f, 0x88, 0xa9, 0x38, 0xa5, 0xb2, 0x56, 0x85, 0xd7, 0x8d, 0xdc, 0x9f, 0x10, 0x4e, 0x49, 0xbf, 0x5c, 0xa0, 0xb6, 0x5a, 0x4b, 0x96, 0x57, 0xe0, 0x4a, 0x71, 0xfb, 0x50, 0xeb, 0x4a, 0xac, 0x22, 0xc0, 0xbb, 0x93, 0xf6, 0x0c, 0xac, 0x94, 0x83, 0xf1, 0x77, 0x13, 0x55, 0x3d, 0xca, 0x4b, 0x31, 0xe2, 0x72, 0x7b, 0x32, 0xe3, 0x50, 0xfe, 0x20, 0x4c, 0xec, 0xd9, 0xa7, 0xcd, 0xa4, 0xda, 0xda, 0x2e, 0x87, 0xff, 0x6f, 0x2b, 0x73, 0xe7, 0xb0, 0x78, 0x1e, 0x21, 0x2f, 0x34, 0xfe, 0x36, 0x36, 0x10, 0xf0, 0x18, 0xa7, 0x99, 0x37, 0x37, 0x55, 0xab, 0x46, 0x66, 0x7b, 0xb6, 0x52, 0x5d, 0x7d, 0xc7, 0xa0, 0xe8, 0x28, 0x90, 0x17, 0xf5, 0x48, 0x7f, 0xa6, 0x92, 0xef, 0x2f, 0xdd, 0xce, 0x38, 0xad, 0x3f, 0x45, 0x30, 0xde, 0x7e, 0xe5, 0x05, 0x66, 0x70, 0xa7, 0x35, 0xd3, 0x78, 0xd1, 0xef, 0xc9, 0x94, 0x81, 0xf8, 0xc9, 0xfb, 0xee, 0xa9, 0x9f, 0x56, 0x6a, 0x0b, 0x6e, 0x28, 0x46, 0x26, 0x44, 0xa6, 0xd9, 0xc6, 0xcc, 0x88, 0xfb } +, + /* Signature */ + 192, + { 0xb7, 0x57, 0xfa, 0x74, 0x7c, 0x5c, 0x87, 0x67, 0x66, 0xf3, 0x58, 0xac, 0xbf, 0xc7, 0xe7, 0xb8, 0x05, 0x96, 0x36, 0x8d, 0x0d, 0x86, 0x29, 0x50, 0xe5, 0x55, 0xf4, 0x71, 0x64, 0x6f, 0x64, 0x0e, 0x85, 0x1d, 0x61, 0x2a, 0x55, 0x6f, 0x55, 0xa7, 0x4a, 0x32, 0x92, 0x42, 0x9e, 0x4c, 0x14, 0xf7, 0x8b, 0xa3, 0xeb, 0xbd, 0x96, 0x87, 0xf3, 0x08, 0xde, 0xdb, 0x3c, 0xfe, 0xd7, 0x1f, 0x4a, 0x9d, 0xd2, 0x6f, 0xa5, 0x12, 0x2f, 0x7f, 0x71, 0x94, 0xae, 0xb6, 0x3b, 0xc8, 0xb7, 0x5c, 0x34, 0x31, 0x87, 0x11, 0x5a, 0x1d, 0xbd, 0x35, 0x95, 0x90, 0xf7, 0xff, 0x38, 0x62, 0xb7, 0x08, 0x85, 0xaf, 0x1c, 0xa9, 0x34, 0xb8, 0xce, 0xbc, 0x2c, 0xc9, 0xe6, 0x47, 0x25, 0x3f, 0xd1, 0x32, 0x7a, 0x2e, 0xd4, 0x24, 0x4d, 0xc8, 0xf5, 0x85, 0x55, 0xa6, 0x89, 0x7c, 0xa3, 0x22, 0x9c, 0x80, 0x1e, 0x7b, 0xf6, 0x28, 0xf5, 0x25, 0xe6, 0xc9, 0x48, 0x80, 0x4d, 0x0b, 0x1b, 0x6d, 0xbc, 0xd7, 0x90, 0x2a, 0xcd, 0xe7, 0xa2, 0x5b, 0xa5, 0x91, 0xd8, 0x86, 0xe2, 0x8d, 0xaa, 0x8d, 0xed, 0x5e, 0xe4, 0x01, 0xe3, 0x4e, 0x64, 0x12, 0xf1, 0xe6, 0x44, 0xee, 0xc1, 0x2a, 0xe9, 0x42, 0x61, 0x90, 0x6a, 0x17, 0x26, 0x11, 0xdd, 0x5a, 0x98, 0x67, 0x78, 0x9c, 0x41, 0x90, 0x34, 0x68, 0x84, 0x29, 0xe9, 0x06 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.18", + /* Message to be signed */ + 93, + { 0x9d, 0xc7, 0xce, 0x1d, 0x02, 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 0xfb, 0x3e, 0xe2, 0x77, 0x34, 0x97, 0xdf, 0x35, 0x49, 0x51, 0x7e, 0xed, 0xcd, 0x9d, 0xe6, 0x8d, 0x90, 0xdf, 0x35, 0xd3, 0xf0, 0x50, 0x81, 0x15, 0x1a, 0xda, 0xb5, 0x39, 0x73, 0x85, 0xab, 0xee, 0xa7, 0x2b, 0x69, 0xbd, 0x0d, 0xe1, 0x8d, 0xce, 0xe9, 0xa2, 0xbe, 0x00, 0xe9, 0x1a, 0x03, 0x24, 0x03, 0xb1, 0xf8, 0x1b, 0xbc, 0x0a, 0xe7, 0x31, 0xc6, 0xc0, 0xd9, 0xcf, 0xdd, 0x06, 0xc3, 0x31, 0xed, 0x89, 0xd7, 0xde, 0x1d, 0xe1, 0xdf, 0x46, 0xcf, 0x09, 0xce, 0x53, 0xdf, 0x15, 0x97, 0xfb, 0x69, 0x94, 0x68, 0x1c, 0x7f, 0xbe, 0x94, 0xc9, 0xb0, 0x8e, 0x50, 0xaa, 0x1b, 0x12, 0x41, 0x96, 0x02, 0x98, 0x7f, 0x37, 0xdd } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.19", + /* Message to be signed */ + 253, + { 0x87, 0xa6, 0x45, 0x61, 0x1b, 0xb1, 0x91, 0x85, 0x3f, 0x4f, 0xd9, 0xb7, 0x40, 0xb2, 0xde, 0x4c, 0x16, 0x3e, 0x75, 0x62, 0xb1, 0x17, 0x62, 0x63, 0x3e, 0x72, 0xdf, 0xb6, 0xf6, 0xbe, 0x7e, 0xfb, 0x90, 0x41, 0xa9, 0x65, 0x82, 0x94, 0x3a, 0xb2, 0x01, 0x83, 0x91, 0xc0, 0x5a, 0xdf, 0xab, 0x46, 0x4d, 0xd6, 0xe3, 0x3f, 0x96, 0x0d, 0xdb, 0xf3, 0xb1, 0x7a, 0xc6, 0x2b, 0xb7, 0x8a, 0xfc, 0x1c, 0x6a, 0x45, 0x39, 0x6c, 0x09, 0x08, 0x70, 0x7c, 0x62, 0x36, 0x12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6c, 0x7a, 0x59, 0xd0, 0x9a } + +} +, +{ + "PKCS#1 v1.5 Signature Example 14.20", + /* Message to be signed */ + 41, + { 0x03, 0x2e, 0x28, 0x3e, 0x59, 0x6e, 0x87, 0xfa, 0xa6, 0xcf, 0xcf, 0xb8, 0xfa, 0x04, 0xdf, 0x6a, 0x61, 0xe6, 0x11, 0xdf, 0xe7, 0x3b, 0xbf, 0x66, 0x8e, 0xe6, 0x7b, 0x49, 0x6b, 0xfb, 0x0f, 0xfb, 0x7f, 0x9d, 0xc9, 0x31, 0xa9, 0x8b, 0xce, 0xdb, 0x25 } +, + /* Signature */ + 192, + { 0xb9, 0xfd, 0xc0, 0x3d, 0xc1, 0x99, 0x70, 0x71, 0x3c, 0x4a, 0x17, 0xe8, 0x7e, 0x7e, 0xbb, 0x5f, 0x13, 0x50, 0x5d, 0x59, 0xcb, 0xb2, 0x2b, 0xa7, 0x2e, 0x9f, 0xf1, 0x6b, 0xdf, 0x8b, 0x65, 0x9c, 0x33, 0x30, 0xa9, 0x3d, 0xcc, 0x09, 0x2a, 0x5d, 0x38, 0x5b, 0x2d, 0x5e, 0x15, 0x34, 0x00, 0x31, 0x46, 0xc0, 0x50, 0xb7, 0xdd, 0xc4, 0xf7, 0x56, 0x56, 0x9d, 0xa2, 0x11, 0x80, 0x15, 0x82, 0x26, 0x61, 0x19, 0xf5, 0x59, 0x9b, 0x1e, 0x65, 0xe8, 0xeb, 0xea, 0x6b, 0xc9, 0x64, 0x42, 0xee, 0x12, 0xac, 0xb9, 0x6c, 0x6d, 0xba, 0x08, 0x3e, 0x92, 0x10, 0x94, 0xda, 0x9c, 0x9e, 0xcf, 0x5a, 0xfa, 0xa5, 0x4b, 0x7f, 0xde, 0x7a, 0x0c, 0xae, 0x3f, 0xdf, 0xe4, 0xd2, 0x51, 0x93, 0x3a, 0x52, 0xf0, 0x2d, 0xc2, 0x3e, 0x1b, 0x32, 0x14, 0xc6, 0x83, 0xe1, 0x9a, 0xf4, 0x6e, 0x18, 0xc7, 0x49, 0x56, 0xdc, 0x6a, 0xb3, 0x50, 0x2d, 0x46, 0xca, 0xac, 0x3c, 0xb2, 0x6b, 0x70, 0x7c, 0xdc, 0x30, 0x25, 0xb6, 0xde, 0x4e, 0x83, 0x54, 0x3b, 0x95, 0x84, 0x5b, 0x4a, 0x15, 0x97, 0x60, 0x77, 0x0a, 0x4b, 0xd0, 0x9e, 0x46, 0x35, 0xa0, 0x4e, 0x21, 0x7d, 0x66, 0x5c, 0x95, 0x94, 0x87, 0x9f, 0x38, 0x1d, 0x71, 0x10, 0x09, 0x34, 0xfa, 0xda, 0x61, 0xc7, 0xcc, 0x22, 0xb8, 0xd2, 0xff, 0x8e, 0xb3, 0x5a } + +} +, +} +}, +{ + "Example 15: A 2048-bit RSA key pair", +{ + /* Modulus */ + 256, + { 0xdf, 0x27, 0x1f, 0xd2, 0x5f, 0x86, 0x44, 0x49, 0x6b, 0x0c, 0x81, 0xbe, 0x4b, 0xd5, 0x02, 0x97, 0xef, 0x09, 0x9b, 0x00, 0x2a, 0x6f, 0xd6, 0x77, 0x27, 0xeb, 0x44, 0x9c, 0xea, 0x56, 0x6e, 0xd6, 0xa3, 0x98, 0x1a, 0x71, 0x31, 0x2a, 0x14, 0x1c, 0xab, 0xc9, 0x81, 0x5c, 0x12, 0x09, 0xe3, 0x20, 0xa2, 0x5b, 0x32, 0x46, 0x4e, 0x99, 0x99, 0xf1, 0x8c, 0xa1, 0x3a, 0x9f, 0xd3, 0x89, 0x25, 0x58, 0xf9, 0xe0, 0xad, 0xef, 0xdd, 0x36, 0x50, 0xdd, 0x23, 0xa3, 0xf0, 0x36, 0xd6, 0x0f, 0xe3, 0x98, 0x84, 0x37, 0x06, 0xa4, 0x0b, 0x0b, 0x84, 0x62, 0xc8, 0xbe, 0xe3, 0xbc, 0xe1, 0x2f, 0x1f, 0x28, 0x60, 0xc2, 0x44, 0x4c, 0xdc, 0x6a, 0x44, 0x47, 0x6a, 0x75, 0xff, 0x4a, 0xa2, 0x42, 0x73, 0xcc, 0xbe, 0x3b, 0xf8, 0x02, 0x48, 0x46, 0x5f, 0x8f, 0xf8, 0xc3, 0xa7, 0xf3, 0x36, 0x7d, 0xfc, 0x0d, 0xf5, 0xb6, 0x50, 0x9a, 0x4f, 0x82, 0x81, 0x1c, 0xed, 0xd8, 0x1c, 0xda, 0xaa, 0x73, 0xc4, 0x91, 0xda, 0x41, 0x21, 0x70, 0xd5, 0x44, 0xd4, 0xba, 0x96, 0xb9, 0x7f, 0x0a, 0xfc, 0x80, 0x65, 0x49, 0x8d, 0x3a, 0x49, 0xfd, 0x91, 0x09, 0x92, 0xa1, 0xf0, 0x72, 0x5b, 0xe2, 0x4f, 0x46, 0x5c, 0xfe, 0x7e, 0x0e, 0xab, 0xf6, 0x78, 0x99, 0x6c, 0x50, 0xbc, 0x5e, 0x75, 0x24, 0xab, 0xf7, 0x3f, 0x15, 0xe5, 0xbe, 0xf7, 0xd5, 0x18, 0x39, 0x4e, 0x31, 0x38, 0xce, 0x49, 0x44, 0x50, 0x6a, 0xaa, 0xaf, 0x3f, 0x9b, 0x23, 0x6d, 0xca, 0xb8, 0xfc, 0x00, 0xf8, 0x7a, 0xf5, 0x96, 0xfd, 0xc3, 0xd9, 0xd6, 0xc7, 0x5c, 0xd5, 0x08, 0x36, 0x2f, 0xae, 0x2c, 0xbe, 0xdd, 0xcc, 0x4c, 0x74, 0x50, 0xb1, 0x7b, 0x77, 0x6c, 0x07, 0x9e, 0xcc, 0xa1, 0xf2, 0x56, 0x35, 0x1a, 0x43, 0xb9, 0x7d, 0xbe, 0x21, 0x53 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 256, + { 0x5b, 0xd9, 0x10, 0x25, 0x78, 0x30, 0xdc, 0xe1, 0x75, 0x20, 0xb0, 0x34, 0x41, 0xa5, 0x1a, 0x8c, 0xab, 0x94, 0x02, 0x0a, 0xc6, 0xec, 0xc2, 0x52, 0xc8, 0x08, 0xf3, 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, 0xe0, 0xe0, 0xa6, 0xad, 0x0d, 0x51, 0x78, 0x57, 0x13, 0x3e, 0x36, 0xdc, 0x72, 0xc1, 0xbd, 0xd9, 0x0f, 0x91, 0x74, 0xb5, 0x2e, 0x26, 0x57, 0x0f, 0x37, 0x36, 0x40, 0xf1, 0xc1, 0x85, 0xe7, 0xea, 0x8e, 0x2e, 0xd7, 0xf1, 0xe4, 0xeb, 0xb9, 0x51, 0xf7, 0x0a, 0x58, 0x02, 0x36, 0x33, 0xb0, 0x09, 0x7a, 0xec, 0x67, 0xc6, 0xdc, 0xb8, 0x00, 0xfc, 0x1a, 0x67, 0xf9, 0xbb, 0x05, 0x63, 0x61, 0x0f, 0x08, 0xeb, 0xc8, 0x74, 0x6a, 0xd1, 0x29, 0x77, 0x21, 0x36, 0xeb, 0x1d, 0xda, 0xf4, 0x64, 0x36, 0x45, 0x0d, 0x31, 0x83, 0x32, 0xa8, 0x49, 0x82, 0xfe, 0x5d, 0x28, 0xdb, 0xe5, 0xb3, 0xe9, 0x12, 0x40, 0x7c, 0x3e, 0x0e, 0x03, 0x10, 0x0d, 0x87, 0xd4, 0x36, 0xee, 0x40, 0x9e, 0xec, 0x1c, 0xf8, 0x5e, 0x80, 0xab, 0xa0, 0x79, 0xb2, 0xe6, 0x10, 0x6b, 0x97, 0xbc, 0xed } +, + /* Prime exponent 1 */ + 128, + { 0xed, 0x10, 0x2a, 0xcd, 0xb2, 0x68, 0x71, 0x53, 0x4d, 0x1c, 0x41, 0x4e, 0xca, 0xd9, 0xa4, 0xd7, 0x32, 0xfe, 0x95, 0xb1, 0x0e, 0xea, 0x37, 0x0d, 0xa6, 0x2f, 0x05, 0xde, 0x2c, 0x39, 0x3b, 0x1a, 0x63, 0x33, 0x03, 0xea, 0x74, 0x1b, 0x6b, 0x32, 0x69, 0xc9, 0x7f, 0x70, 0x4b, 0x35, 0x27, 0x02, 0xc9, 0xae, 0x79, 0x92, 0x2f, 0x7b, 0xe8, 0xd1, 0x0d, 0x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, 0xce, 0x4a, 0x01, 0xee, 0xc8, 0x2d, 0x7f, 0x54, 0x58, 0xec, 0x19, 0xe7, 0x1b, 0x90, 0xee, 0xef, 0x7d, 0xff, 0x61 } +, + /* Coefficient */ + 128, + { 0x57, 0xb7, 0x38, 0x88, 0xd1, 0x83, 0xa9, 0x9a, 0x63, 0x07, 0x42, 0x22, 0x77, 0x55, 0x1a, 0x3d, 0x9e, 0x18, 0xad, 0xf0, 0x6a, 0x91, 0xe8, 0xb5, 0x5c, 0xef, 0xfe, 0xf9, 0x07, 0x7c, 0x84, 0x96, 0x94, 0x8e, 0xcb, 0x3b, 0x16, 0xb7, 0x81, 0x55, 0xcb, 0x2a, 0x3a, 0x57, 0xc1, 0x19, 0xd3, 0x79, 0x95, 0x1c, 0x01, 0x0a, 0xa6, 0x35, 0xed, 0xcf, 0x62, 0xd8, 0x4c, 0x5a, 0x12, 0x2a, 0x8d, 0x67, 0xab, 0x5f, 0xa9, 0xe5, 0xa4, 0xa8, 0x77, 0x2a, 0x1e, 0x94, 0x3b, 0xaf, 0xc7, 0x0a, 0xe3, 0xa4, 0xc1, 0xf0, 0xf3, 0xa4, 0xdd, 0xff, 0xae, 0xfd, 0x18, 0x92, 0xc8, 0xcb, 0x33, 0xbb, 0x0d, 0x0b, 0x95, 0x90, 0xe9, 0x63, 0xa6, 0x91, 0x10, 0xfb, 0x34, 0xdb, 0x7b, 0x90, 0x6f, 0xc4, 0xba, 0x28, 0x36, 0x99, 0x5a, 0xac, 0x7e, 0x52, 0x74, 0x90, 0xac, 0x95, 0x2a, 0x02, 0x26, 0x8a, 0x4f, 0x18 } + +} +, +{{ + "PKCS#1 v1.5 Signature Example 15.1", + /* Message to be signed */ + 229, + { 0xf4, 0x5d, 0x55, 0xf3, 0x55, 0x51, 0xe9, 0x75, 0xd6, 0xa8, 0xdc, 0x7e, 0xa9, 0xf4, 0x88, 0x59, 0x39, 0x40, 0xcc, 0x75, 0x69, 0x4a, 0x27, 0x8f, 0x27, 0xe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e3, 0x08, 0x27, 0x52, 0xf4, 0x3f, 0x63, 0xc1, 0x61, 0xb4, 0x47, 0xa4, 0xc6, 0x5a, 0x68, 0x75, 0x67, 0x0d, 0x5f, 0x66, 0x00, 0xfc, 0xc8, 0x60, 0xa1, 0xca, 0xeb, 0x0a, 0x88, 0xf8, 0xfd, 0xec, 0x4e, 0x56, 0x43, 0x98, 0xa5, 0xc4, 0x6c, 0x87, 0xf6, 0x8c, 0xe0, 0x70, 0x01, 0xf6, 0x21, 0x3a, 0xbe, 0x0a, 0xb5, 0x62, 0x5f, 0x87, 0xd1, 0x90, 0x25, 0xf0, 0x8d, 0x81, 0xda, 0xc7, 0xbd, 0x45, 0x86, 0xbc, 0x93, 0x82, 0x19, 0x1f, 0x6d, 0x28, 0x80, 0xf6, 0x22, 0x7e, 0x5d, 0xf3, 0xee, 0xd2, 0x1e, 0x77, 0x92, 0xd2, 0x49, 0x48, 0x04, 0x87, 0xf3, 0x65, 0x52, 0x61 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.2", + /* Message to be signed */ + 153, + { 0xc1, 0x4b, 0x4c, 0x60, 0x75, 0xb2, 0xf9, 0xaa, 0xd6, 0x61, 0xde, 0xf4, 0xec, 0xfd, 0x3c, 0xb9, 0x33, 0xc6, 0x23, 0xf4, 0xe6, 0x3b, 0xf5, 0x34, 0x10, 0xd2, 0xf0, 0x16, 0xd1, 0xab, 0x98, 0xe2, 0x72, 0x9e, 0xcc, 0xf8, 0x00, 0x6c, 0xd8, 0xe0, 0x80, 0x50, 0x73, 0x7d, 0x95, 0xfd, 0xbf, 0x29, 0x6b, 0x66, 0xf5, 0xb9, 0x79, 0x2a, 0x90, 0x29, 0x36, 0xc4, 0xf7, 0xac, 0x69, 0xf5, 0x14, 0x53, 0xce, 0x43, 0x69, 0x45, 0x2d, 0xc2, 0x2d, 0x96, 0xf0, 0x37, 0x74, 0x81, 0x14, 0x66, 0x20, 0x00, 0xdd, 0x9c, 0xd3, 0xa5, 0xe1, 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a, 0x8e, 0x61, 0x73, 0x22, 0x40, 0x65, 0xd7, 0xdc, 0x15, 0x13, 0x2e, 0xf2, 0x8c, 0xd8, 0x22, 0x79, 0x51, 0x63, 0x06, 0x3b, 0x54, 0xc6, 0x51, 0x14, 0x1b, 0xe8, 0x6d, 0x36, 0xe3, 0x67, 0x35, 0xbc, 0x61, 0xf3, 0x1f, 0xca, 0x57, 0x4e, 0x53, 0x09, 0xf3, 0xa3, 0xbb, 0xdf, 0x91, 0xef, 0xf1, 0x2b, 0x99, 0xe9, 0xcc, 0x17, 0x44, 0xf1, 0xee, 0x9a, 0x1b, 0xd2, 0x2c, 0x5b, 0xad, 0x96, 0xad, 0x48, 0x19, 0x29, 0x25, 0x1f, 0x03, 0x43, 0xfd, 0x36, 0xbc, 0xf0, 0xac, 0xde, 0x7f, 0x11, 0xe5, 0xad, 0x60, 0x97, 0x77, 0x21, 0x20, 0x27, 0x96, 0xfe, 0x06, 0x1f, 0x9a, 0xda, 0x1f, 0xc4, 0xc8, 0xe0, 0x0d, 0x60, 0x22, 0xa8, 0x35, 0x75, 0x85, 0xff, 0xe9, 0xfd, 0xd5, 0x93, 0x31, 0xa2, 0x8c, 0x4a, 0xa3, 0x12, 0x15, 0x88, 0xfb, 0x6c, 0xf6, 0x83, 0x96, 0xd8, 0xac, 0x05, 0x46, 0x59, 0x95, 0x00, 0xc9, 0x70, 0x85, 0x00, 0xa5, 0x97, 0x2b, 0xd5, 0x4f, 0x72, 0xcf, 0x8d, 0xb0, 0xc8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.3", + /* Message to be signed */ + 243, + { 0xd0, 0x23, 0x71, 0xad, 0x7e, 0xe4, 0x8b, 0xbf, 0xdb, 0x27, 0x63, 0xde, 0x7a, 0x84, 0x3b, 0x94, 0x08, 0xce, 0x5e, 0xb5, 0xab, 0xf8, 0x47, 0xca, 0x3d, 0x73, 0x59, 0x86, 0xdf, 0x84, 0xe9, 0x06, 0x0b, 0xdb, 0xcd, 0xd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, 0x01, 0x52, 0xfa, 0x11, 0x46, 0x62, 0x18, 0xd0, 0x91, 0xb5, 0x3d, 0x92, 0x54, 0x30, 0x61, 0xb7, 0x29, 0x4a, 0x55, 0xbe, 0x82, 0xff, 0x35, 0xd5, 0xc3, 0x2f, 0xa2, 0x33, 0xf0, 0x5a, 0xaa, 0xc7, 0x58, 0x50, 0x30, 0x7e, 0xcf, 0x81, 0x38, 0x3c, 0x11, 0x16, 0x74, 0x39, 0x7b, 0x1a, 0x1b, 0x9d, 0x3b, 0xf7, 0x61, 0x2c, 0xcb, 0xe5, 0xba, 0xcd, 0x2b, 0x38, 0xf0, 0xa9, 0x83, 0x97, 0xb2, 0x4c, 0x83, 0x65, 0x8f, 0xb6, 0xc0, 0xb4, 0x14, 0x0e, 0xf1, 0x19, 0x70, 0xc4, 0x63, 0x0d, 0x44, 0x34, 0x4e, 0x76, 0xea, 0xed, 0x74, 0xdc, 0xbe, 0xe8, 0x11, 0xdb, 0xf6, 0x57, 0x59, 0x41, 0xf0, 0x8a, 0x65, 0x23, 0xb8 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.4", + /* Message to be signed */ + 58, + { 0x29, 0x03, 0x55, 0x84, 0xab, 0x7e, 0x02, 0x26, 0xa9, 0xec, 0x4b, 0x02, 0xe8, 0xdc, 0xf1, 0x27, 0x2d, 0xc9, 0xa4, 0x1d, 0x73, 0xe2, 0x82, 0x00, 0x07, 0xb0, 0xf6, 0xe2, 0x1f, 0xec, 0xcd, 0x5b, 0xd9, 0xdb, 0xb9, 0xef, 0x88, 0xcd, 0x67, 0x58, 0x76, 0x9e, 0xe1, 0xf9, 0x56, 0xda, 0x7a, 0xd1, 0x84, 0x41, 0xde, 0x6f, 0xab, 0x83, 0x86, 0xdb, 0xc6, 0x93 } +, + /* Signature */ + 256, + { 0x28, 0xd8, 0xe3, 0xfc, 0xd5, 0xdd, 0xdb, 0x21, 0xff, 0xbd, 0x8d, 0xf1, 0x63, 0x0d, 0x73, 0x77, 0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0x13, 0xad, 0xca, 0xd8, 0x28, 0x67, 0x68, 0x10, 0x49, 0x9c, 0x70, 0x4d, 0xa7, 0xae, 0x23, 0x41, 0x4d, 0x69, 0xe3, 0xc0, 0xd2, 0xdb, 0x5d, 0xcb, 0xc2, 0x61, 0x3b, 0xc1, 0x20, 0x42, 0x1f, 0x9e, 0x36, 0x53, 0xc5, 0xa8, 0x76, 0x72, 0x97, 0x64, 0x3c, 0x7e, 0x07, 0x40, 0xde, 0x01, 0x63, 0x55, 0x45, 0x3d, 0x6c, 0x95, 0xae, 0x72 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.5", + /* Message to be signed */ + 14, + { 0xbd, 0xa3, 0xa1, 0xc7, 0x90, 0x59, 0xea, 0xe5, 0x98, 0x30, 0x8d, 0x3d, 0xf6, 0x09 } +, + /* Signature */ + 256, + { 0xa1, 0x56, 0x17, 0x6c, 0xb9, 0x67, 0x77, 0xc7, 0xfb, 0x96, 0x10, 0x5d, 0xbd, 0x91, 0x3b, 0xc4, 0xf7, 0x40, 0x54, 0xf6, 0x80, 0x7c, 0x60, 0x08, 0xa1, 0xa9, 0x56, 0xea, 0x92, 0xc1, 0xf8, 0x1c, 0xb8, 0x97, 0xdc, 0x4b, 0x92, 0xef, 0x9f, 0x4e, 0x40, 0x66, 0x8d, 0xc7, 0xc5, 0x56, 0x90, 0x1a, 0xcb, 0x6c, 0xf2, 0x69, 0xfe, 0x61, 0x5b, 0x0f, 0xb7, 0x2b, 0x30, 0xa5, 0x13, 0x38, 0x69, 0x23, 0x14, 0xb0, 0xe5, 0x87, 0x8a, 0x88, 0xc2, 0xc7, 0x77, 0x4b, 0xd1, 0x69, 0x39, 0xb5, 0xab, 0xd8, 0x2b, 0x44, 0x29, 0xd6, 0x7b, 0xd7, 0xac, 0x8e, 0x5e, 0xa7, 0xfe, 0x92, 0x4e, 0x20, 0xa6, 0xec, 0x66, 0x22, 0x91, 0xf2, 0x54, 0x8d, 0x73, 0x4f, 0x66, 0x34, 0x86, 0x8b, 0x03, 0x9a, 0xa5, 0xf9, 0xd4, 0xd9, 0x06, 0xb2, 0xd0, 0xcb, 0x85, 0x85, 0xbf, 0x42, 0x85, 0x47, 0xaf, 0xc9, 0x1c, 0x6e, 0x20, 0x52, 0xdd, 0xcd, 0x00, 0x1c, 0x3e, 0xf8, 0xc8, 0xee, 0xfc, 0x3b, 0x6b, 0x2a, 0x82, 0xb6, 0xf9, 0xc8, 0x8c, 0x56, 0xf2, 0xe2, 0xc3, 0xcb, 0x0b, 0xe4, 0xb8, 0x0d, 0xa9, 0x5e, 0xba, 0x37, 0x1d, 0x8b, 0x5f, 0x60, 0xf9, 0x25, 0x38, 0x74, 0x3d, 0xdb, 0xb5, 0xda, 0x29, 0x72, 0xc7, 0x1f, 0xe7, 0xb9, 0xf1, 0xb7, 0x90, 0x26, 0x8a, 0x0e, 0x77, 0x0f, 0xc5, 0xeb, 0x4d, 0x5d, 0xd8, 0x52, 0x47, 0xd4, 0x8a, 0xe2, 0xec, 0x3f, 0x26, 0x25, 0x5a, 0x39, 0x85, 0x52, 0x02, 0x06, 0xa1, 0xf2, 0x68, 0xe4, 0x83, 0xe9, 0xdb, 0xb1, 0xd5, 0xca, 0xb1, 0x90, 0x91, 0x76, 0x06, 0xde, 0x31, 0xe7, 0xc5, 0x18, 0x2d, 0x8f, 0x15, 0x1b, 0xf4, 0x1d, 0xfe, 0xcc, 0xae, 0xd7, 0xcd, 0xe6, 0x90, 0xb2, 0x16, 0x47, 0x10, 0x6b, 0x49, 0x0c, 0x72, 0x9d, 0x54, 0xa8, 0xfe, 0x28, 0x02, 0xa6, 0xd1, 0x26 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.6", + /* Message to be signed */ + 97, + { 0xc1, 0x87, 0x91, 0x5e, 0x4e, 0x87, 0xda, 0x81, 0xc0, 0x8e, 0xd4, 0x35, 0x6a, 0x0c, 0xce, 0xac, 0x1c, 0x4f, 0xb5, 0xc0, 0x46, 0xb4, 0x52, 0x81,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f6, 0x2e, 0x3e, 0xd8, 0xec, 0x78, 0x4e, 0x50, 0xee, 0x1d, 0x92, 0x62, 0xb4, 0x26, 0x71, 0x34, 0x00, 0x11, 0xd7, 0xd0, 0x98, 0xc6, 0xf2, 0x55, 0x7b, 0x21, 0x31, 0xfa, 0x9b, 0xd0, 0x25, 0x46, 0x36, 0x59, 0x7e, 0x88, 0xec, 0xb3, 0x5a, 0x24, 0x0e, 0xf0, 0xfd, 0x85, 0x95, 0x71, 0x24, 0xdf, 0x80, 0x80, 0xfe, 0xe1, 0xe1, 0x49, 0xaf, 0x93, 0x99, 0x89, 0xe8, 0x6b, 0x26, 0xc8, 0x5a, 0x58, 0x81, 0xfa, 0xe8, 0x67, 0x3d, 0x9f, 0xd4, 0x08, 0x00, 0xdd, 0x13, 0x4e, 0xb9, 0xbd, 0xb6, 0x41, 0x0f, 0x42, 0x0b, 0x0a, 0xa9, 0x7b, 0x20, 0xef, 0xcf, 0x2e, 0xb0, 0xc8, 0x07, 0xfa, 0xeb, 0x83, 0xa3, 0xcc, 0xd9, 0xb5, 0x1d, 0x45, 0x53, 0xe4, 0x1d, 0xfc, 0x0d, 0xf6, 0xca, 0x80, 0xa1, 0xe8, 0x1d, 0xc2, 0x34, 0xbb, 0x83, 0x89, 0xdd, 0x19, 0x5a, 0x38, 0xb4, 0x2d, 0xe4, 0xed, 0xc4, 0x9d, 0x34, 0x64, 0x78, 0xb9, 0xf1, 0x1f, 0x05, 0x57, 0x20, 0x5f, 0x5b, 0x0b, 0xd7, 0xff, 0xe9, 0xc8, 0x50, 0xf3, 0x96, 0xd7, 0xc4 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.7", + /* Message to be signed */ + 121, + { 0xab, 0xfa, 0x2e, 0xcb, 0x7d, 0x29, 0xbd, 0x5b, 0xcb, 0x99, 0x31, 0xce, 0x2b, 0xad, 0x2f, 0x74, 0x38, 0x3e, 0x95, 0x68, 0x3c, 0xee, 0x11, 0x02, 0x2f, 0x08, 0xe8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0x7e, 0xc0, 0x21, 0xe7, 0xf6, 0x8c, 0x47, 0xdf, 0xd3, 0x8c, 0xc3, 0x54, 0x49, 0x3d, 0x53, 0x39, 0xb4, 0x59, 0x5a, 0x5b, 0xf3, 0x1e, 0x3f, 0x8f, 0x13, 0x81, 0x68, 0x07, 0x37, 0x3d, 0xf6, 0xad, 0x0d, 0xc7, 0xe7, 0x31, 0xe5, 0x1a, 0xd1, 0x9e, 0xb4, 0x75, 0x4b, 0x13, 0x44, 0x85, 0x84, 0x2f, 0xe7, 0x09, 0xd3, 0x78, 0x44, 0x4d, 0x8e, 0x36, 0xb1, 0x72, 0x4a, 0x4f, 0xda, 0x21, 0xca, 0xfe, 0xe6, 0x53, 0xab, 0x80, 0x74, 0x7f, 0x79, 0x52, 0xee, 0x80, 0x4d, 0xea, 0xb1, 0x03, 0x9d, 0x84, 0x13, 0x99, 0x45, 0xbb, 0xf4, 0xbe, 0x82, 0x00, 0x87, 0x53, 0xf3, 0xc5, 0x4c, 0x78, 0x21, 0xa1, 0xd2, 0x41, 0xf4, 0x21, 0x79, 0xc7, 0x94, 0xef, 0x70, 0x42, 0xbb, 0xf9, 0x95, 0x56, 0x56, 0x22, 0x2e, 0x45, 0xc3, 0x43, 0x69, 0xa3, 0x84, 0x69, 0x7b, 0x6a, 0xe7, 0x42, 0xe1, 0x8f, 0xa5, 0xca, 0x7a, 0xba, 0xd2, 0x7d, 0x9f, 0xe7, 0x10, 0x52, 0xe3, 0x31, 0x0d, 0x0f, 0x52, 0xc8, 0xd1, 0x2e, 0xa3, 0x3b, 0xf0, 0x53, 0xa3, 0x00, 0xf4, 0xaf, 0xc4, 0xf0, 0x98, 0xdf, 0x4e, 0x6d, 0x88, 0x67, 0x79, 0xd6, 0x45, 0x94, 0xd3, 0x69, 0x15, 0x8f, 0xdb, 0xc1, 0xf6, 0x94 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.8", + /* Message to be signed */ + 224, + { 0xdf, 0x40, 0x44, 0xa8, 0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x08, 0xe0, 0x33, 0x1d, 0xac, 0x8b, 0xaf, 0x3b, 0x63, 0x42, 0x22, 0x66, 0xec, 0xef, 0x2b, 0x90, 0x78, 0x15, 0x35, 0xdb, 0xda, 0x41, 0xcb, 0xd0, 0xcf, 0x22, 0xa8, 0xcb, 0xfb, 0x53, 0x2e, 0xc6, 0x8f, 0xc6, 0xaf, 0xb2, 0xac, 0x06 } +, + /* Signature */ + 256, + { 0x14, 0x14, 0xb3, 0x85, 0x67, 0xae, 0x6d, 0x97, 0x3e, 0xde, 0x4a, 0x06, 0x84, 0x2d, 0xcc, 0x0e, 0x05, 0x59, 0xb1, 0x9e, 0x65, 0xa4, 0x88, 0x9b, 0xdb, 0xab, 0xd0, 0xfd, 0x02, 0x80, 0x68, 0x29, 0x13, 0xba, 0xcd, 0x5d, 0xc2, 0xf0, 0x1b, 0x30, 0xbb, 0x19, 0xeb, 0x81, 0x0b, 0x7d, 0x9d, 0xed, 0x32, 0xb2, 0x84, 0xf1, 0x47, 0xbb, 0xe7, 0x71, 0xc9, 0x30, 0xc6, 0x05, 0x2a, 0xa7, 0x34, 0x13, 0x90, 0xa8, 0x49, 0xf8, 0x1d, 0xa9, 0xcd, 0x11, 0xe5, 0xec, 0xcf, 0x24, 0x6d, 0xba, 0xe9, 0x5f, 0xa9, 0x58, 0x28, 0xe9, 0xae, 0x0c, 0xa3, 0x55, 0x03, 0x25, 0x32, 0x6d, 0xee, 0xf9, 0xf4, 0x95, 0x30, 0xba, 0x44, 0x1b, 0xed, 0x4a, 0xc2, 0x9c, 0x02, 0x9c, 0x9a, 0x27, 0x36, 0xb1, 0xa4, 0x19, 0x0b, 0x85, 0x08, 0x4a, 0xd1, 0x50, 0x42, 0x6b, 0x46, 0xd7, 0xf8, 0x5b, 0xd7, 0x02, 0xf4, 0x8d, 0xac, 0x5f, 0x71, 0x33, 0x0b, 0xc4, 0x23, 0xa7, 0x66, 0xc6, 0x5c, 0xc1, 0xdc, 0xab, 0x20, 0xd3, 0xd3, 0xbb, 0xa7, 0x2b, 0x63, 0xb3, 0xef, 0x82, 0x44, 0xd4, 0x2f, 0x15, 0x7c, 0xb7, 0xe3, 0xa8, 0xba, 0x5c, 0x05, 0x27, 0x2c, 0x64, 0xcc, 0x1a, 0xd2, 0x1a, 0x13, 0x49, 0x3c, 0x39, 0x11, 0xf6, 0x0b, 0x4e, 0x9f, 0x4e, 0xcc, 0x99, 0x00, 0xeb, 0x05, 0x6e, 0xe5, 0x9d, 0x6f, 0xe4, 0xb8, 0xff, 0x6e, 0x80, 0x48, 0xcc, 0xc0, 0xf3, 0x8f, 0x28, 0x36, 0xfd, 0x3d, 0xfe, 0x91, 0xbf, 0x4a, 0x38, 0x6e, 0x1e, 0xcc, 0x2c, 0x32, 0x83, 0x9f, 0x0c, 0xa4, 0xd1, 0xb2, 0x7a, 0x56, 0x8f, 0xa9, 0x40, 0xdd, 0x64, 0xad, 0x16, 0xbd, 0x01, 0x25, 0xd0, 0x34, 0x8e, 0x38, 0x30, 0x85, 0xf0, 0x88, 0x94, 0x86, 0x1c, 0xa1, 0x89, 0x87, 0x22, 0x7d, 0x37, 0xb4, 0x2b, 0x58, 0x4a, 0x83, 0x57, 0xcb, 0x04 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.9", + /* Message to be signed */ + 183, + { 0xea, 0x94, 0x1f, 0xf0, 0x6f, 0x86, 0xc2, 0x26, 0x92, 0x7f, 0xcf, 0x0e, 0x3b, 0x11, 0xb0, 0x87, 0x26, 0x76, 0x17, 0x0c, 0x1b, 0xfc, 0x33, 0xbd, 0xa8, 0xe2, 0x65, 0xc7, 0x77, 0x71, 0xf9, 0xd0, 0x85, 0x01, 0x64, 0xa5, 0xee, 0xcb, 0xcc, 0x5c, 0xe8, 0x27, 0xfb, 0xfa, 0x07, 0xc8, 0x52, 0x14, 0x79, 0x6d, 0x81, 0x27, 0xe8, 0xca, 0xa8, 0x18, 0x94, 0xea, 0x61, 0xce, 0xb1, 0x44, 0x9e, 0x72, 0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 0xbb, 0xfd, 0x65, 0x18, 0xa1, 0x75, 0x73, 0x45, 0x75 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.10", + /* Message to be signed */ + 65, + { 0xd8, 0xb8, 0x16, 0x45, 0xc1, 0x3c, 0xd7, 0xec, 0xf5, 0xd0, 0x0e, 0xd2, 0xc9, 0x1b, 0x9a, 0xcd, 0x46, 0xc1, 0x55, 0x68, 0xe5, 0x30, 0x3c, 0x4a, 0x97, 0x75, 0xed, 0xe7, 0x6b, 0x48, 0x40, 0x3d, 0x6b, 0xe5, 0x6c, 0x05, 0xb6, 0xb1, 0xcf, 0x77, 0xc6, 0xe7, 0x5d, 0xe0, 0x96, 0xc5, 0xcb, 0x35, 0x51, 0xcb, 0x6f, 0xa9, 0x64, 0xf3, 0xc8, 0x79, 0xcf, 0x58, 0x9d, 0x28, 0xe1, 0xda, 0x2f, 0x9d, 0xec } +, + /* Signature */ + 256, + { 0x27, 0x45, 0x07, 0x4c, 0xa9, 0x71, 0x75, 0xd9, 0x92, 0xe2, 0xb4, 0x47, 0x91, 0xc3, 0x23, 0xc5, 0x71, 0x67, 0x16, 0x5c, 0xdd, 0x8d, 0xa5, 0x79, 0xcd, 0xef, 0x46, 0x86, 0xb9, 0xbb, 0x40, 0x4b, 0xd3, 0x6a, 0x56, 0x50, 0x4e, 0xb1, 0xfd, 0x77, 0x0f, 0x60, 0xbf, 0xa1, 0x88, 0xa7, 0xb2, 0x4b, 0x0c, 0x91, 0xe8, 0x81, 0xc2, 0x4e, 0x35, 0xb0, 0x4d, 0xc4, 0xdd, 0x4c, 0xe3, 0x85, 0x66, 0xbc, 0xc9, 0xce, 0x54, 0xf4, 0x9a, 0x17, 0x5f, 0xc9, 0xd0, 0xb2, 0x25, 0x22, 0xd9, 0x57, 0x90, 0x47, 0xf9, 0xed, 0x42, 0xec, 0xa8, 0x3f, 0x76, 0x4a, 0x10, 0x16, 0x39, 0x97, 0x94, 0x7e, 0x7d, 0x2b, 0x52, 0xff, 0x08, 0x98, 0x0e, 0x7e, 0x7c, 0x22, 0x57, 0x93, 0x7b, 0x23, 0xf3, 0xd2, 0x79, 0xd4, 0xcd, 0x17, 0xd6, 0xf4, 0x95, 0x54, 0x63, 0x73, 0xd9, 0x83, 0xd5, 0x36, 0xef, 0xd7, 0xd1, 0xb6, 0x71, 0x81, 0xca, 0x2c, 0xb5, 0x0a, 0xc6, 0x16, 0xc5, 0xc7, 0xab, 0xfb, 0xb9, 0x26, 0x0b, 0x91, 0xb1, 0xa3, 0x8e, 0x47, 0x24, 0x20, 0x01, 0xff, 0x45, 0x2f, 0x8d, 0xe1, 0x0c, 0xa6, 0xea, 0xea, 0xdc, 0xaf, 0x9e, 0xdc, 0x28, 0x95, 0x6f, 0x28, 0xa7, 0x11, 0x29, 0x1f, 0xc9, 0xa8, 0x08, 0x78, 0xb8, 0xba, 0x4c, 0xfe, 0x25, 0xb8, 0x28, 0x1c, 0xb8, 0x0b, 0xc9, 0xcd, 0x6d, 0x2b, 0xd1, 0x82, 0x52, 0x46, 0xee, 0xbe, 0x25, 0x2d, 0x99, 0x57, 0xef, 0x93, 0x70, 0x73, 0x52, 0x08, 0x4e, 0x6d, 0x36, 0xd4, 0x23, 0x55, 0x1b, 0xf2, 0x66, 0xa8, 0x53, 0x40, 0xfb, 0x4a, 0x6a, 0xf3, 0x70, 0x88, 0x0a, 0xab, 0x07, 0x15, 0x3d, 0x01, 0xf4, 0x8d, 0x08, 0x6d, 0xf0, 0xbf, 0xbe, 0xc0, 0x5e, 0x7b, 0x44, 0x3b, 0x97, 0xe7, 0x17, 0x18, 0x97, 0x0e, 0x2f, 0x4b, 0xf6, 0x20, 0x23, 0xe9, 0x5b, 0x67 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.11", + /* Message to be signed */ + 130, + { 0xe5, 0x73, 0x9b, 0x6c, 0x14, 0xc9, 0x2d, 0x51, 0x0d, 0x95, 0xb8, 0x26, 0x93, 0x33, 0x37, 0xff, 0x0d, 0x24, 0x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0x1d, 0xe2 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.12", + /* Message to be signed */ + 256, + { 0x7a, 0xf4, 0x28, 0x35, 0x91, 0x7a, 0x88, 0xd6, 0xb3, 0xc6, 0x71, 0x6b, 0xa2, 0xf5, 0xb0, 0xd5, 0xb2, 0x0b, 0xd4, 0xe2, 0xe6, 0xe5, 0x74, 0xe0, 0x6a, 0xf1, 0xee, 0xf7, 0xc8, 0x11, 0x31, 0xbe, 0x22, 0xbf, 0x81, 0x28, 0xb9, 0xcb, 0xc6, 0xec, 0x00, 0x27, 0x5b, 0xa8, 0x02, 0x94, 0xa5, 0xd1, 0x17, 0x2d, 0x08, 0x24, 0xa7, 0x9e, 0x8f, 0xdd, 0x83, 0x01, 0x83, 0xe4, 0xc0, 0x0b, 0x96, 0x78, 0x28, 0x67, 0xb1, 0x22, 0x7f, 0xea, 0x24, 0x9a, 0xad, 0x32, 0xff, 0xc5, 0xfe, 0x00, 0x7b, 0xc5, 0x1f, 0x21, 0x79, 0x2f, 0x72, 0x8d, 0xed, 0xa8, 0xb5, 0x70, 0x8a, 0xa9, 0x9c, 0xab, 0xab, 0x20, 0xa4, 0xaa, 0x78, 0x3e, 0xd8, 0x6f, 0x0f, 0x27, 0xb5, 0xd5, 0x63, 0xf4, 0x2e, 0x07, 0x15, 0x8c, 0xea, 0x72, 0xd0, 0x97, 0xaa, 0x68, 0x87, 0xec, 0x41, 0x1d, 0xd0, 0x12, 0x91, 0x2a, 0x5e, 0x03, 0x2b, 0xbf, 0xa6, 0x78, 0x50, 0x71, 0x44, 0xbc, 0xc9, 0x5f, 0x39, 0xb5, 0x8b, 0xe7, 0xbf, 0xd1, 0x75, 0x9a, 0xdb, 0x9a, 0x91, 0xfa, 0x1d, 0x6d, 0x82, 0x26, 0xa8, 0x34, 0x3a, 0x8b, 0x84, 0x9d, 0xae, 0x76, 0xf7, 0xb9, 0x82, 0x24, 0xd5, 0x9e, 0x28, 0xf7, 0x81, 0xf1, 0x3e, 0xce, 0x60, 0x5f, 0x84, 0xf6, 0xc9, 0x0b, 0xae, 0x5f, 0x8c, 0xf3, 0x78, 0x81, 0x6f, 0x40, 0x20, 0xa7, 0xdd, 0xa1, 0xbe, 0xd9, 0x0c, 0x92, 0xa2, 0x36, 0x34, 0xd2, 0x03, 0xfa, 0xc3, 0xfc, 0xd8, 0x6d, 0x68, 0xd3, 0x18, 0x2a, 0x7d, 0x9c, 0xca, 0xbe, 0x7b, 0x07, 0x95, 0xf5, 0xc6, 0x55, 0xe9, 0xac, 0xc4, 0xe3, 0xec, 0x18, 0x51, 0x40, 0xd1, 0x0c, 0xef, 0x05, 0x34, 0x64, 0xab, 0x17, 0x5c, 0x83, 0xbd, 0x83, 0x93, 0x5e, 0x3d, 0xab, 0xaf, 0x34, 0x62, 0xee, 0xbe, 0x63, 0xd1, 0x5f, 0x57, 0x3d, 0x26, 0x9a } +, + /* Signature */ + 256, + { 0x4e, 0x78, 0xc5, 0x90, 0x2b, 0x80, 0x79, 0x14, 0xd1, 0x2f, 0xa5, 0x37, 0xae, 0x68, 0x71, 0xc8, 0x6d, 0xb8, 0x02, 0x1e, 0x55, 0xd1, 0xad, 0xb8, 0xeb, 0x0c, 0xcf, 0x1b, 0x8f, 0x36, 0xab, 0x7d, 0xad, 0x1f, 0x68, 0x2e, 0x94, 0x7a, 0x62, 0x70, 0x72, 0xf0, 0x3e, 0x62, 0x73, 0x71, 0x78, 0x1d, 0x33, 0x22, 0x1d, 0x17, 0x4a, 0xbe, 0x46, 0x0d, 0xbd, 0x88, 0x56, 0x0c, 0x22, 0xf6, 0x90, 0x11, 0x6e, 0x2f, 0xbb, 0xe6, 0xe9, 0x64, 0x36, 0x3a, 0x3e, 0x52, 0x83, 0xbb, 0x5d, 0x94, 0x6e, 0xf1, 0xc0, 0x04, 0x7e, 0xba, 0x03, 0x8c, 0x75, 0x6c, 0x40, 0xbe, 0x79, 0x23, 0x05, 0x58, 0x09, 0xb0, 0xe9, 0xf3, 0x4a, 0x03, 0xa5, 0x88, 0x15, 0xeb, 0xdd, 0xe7, 0x67, 0x93, 0x1f, 0x01, 0x8f, 0x6f, 0x18, 0x78, 0xf2, 0xef, 0x4f, 0x47, 0xdd, 0x37, 0x40, 0x51, 0xdd, 0x48, 0x68, 0x5d, 0xed, 0x6e, 0xfb, 0x3e, 0xa8, 0x02, 0x1f, 0x44, 0xbe, 0x1d, 0x7d, 0x14, 0x93, 0x98, 0xf9, 0x8e, 0xa9, 0xc0, 0x8d, 0x62, 0x88, 0x8e, 0xbb, 0x56, 0x19, 0x2d, 0x17, 0x74, 0x7b, 0x6b, 0x8e, 0x17, 0x09, 0x54, 0x31, 0xf1, 0x25, 0xa8, 0xa8, 0xe9, 0x96, 0x2a, 0xa3, 0x1c, 0x28, 0x52, 0x64, 0xe0, 0x8f, 0xb2, 0x1a, 0xac, 0x33, 0x6c, 0xe6, 0xc3, 0x8a, 0xa3, 0x75, 0xe4, 0x2b, 0xc9, 0x2a, 0xb0, 0xab, 0x91, 0x03, 0x84, 0x31, 0xe1, 0xf9, 0x2c, 0x39, 0xd2, 0xaf, 0x5d, 0xed, 0x7e, 0x43, 0xbc, 0x15, 0x1e, 0x6e, 0xbe, 0xa4, 0xc3, 0xe2, 0x58, 0x3a, 0xf3, 0x43, 0x7e, 0x82, 0xc4, 0x3c, 0x5e, 0x3b, 0x5b, 0x07, 0xcf, 0x03, 0x59, 0x68, 0x3d, 0x22, 0x98, 0xe3, 0x59, 0x48, 0xed, 0x80, 0x6c, 0x06, 0x3c, 0x60, 0x6e, 0xa1, 0x78, 0x15, 0x0b, 0x1e, 0xfc, 0x15, 0x85, 0x69, 0x34, 0xc7, 0x25, 0x5c, 0xfe } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.13", + /* Message to be signed */ + 59, + { 0xeb, 0xae, 0xf3, 0xf9, 0xf2, 0x3b, 0xdf, 0xe5, 0xfa, 0x6b, 0x8a, 0xf4, 0xc2, 0x08, 0xc1, 0x89, 0xf2, 0x25, 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a, 0xdf, 0x2d, 0x25, 0x29, 0xa0, 0x2d, 0x40, 0x71, 0x1e, 0x21, 0x90, 0x91, 0x70, 0x52, 0x37, 0x1b, 0x79, 0xb7, 0x49, 0xb8, 0x3a, 0xbf, 0x0a, 0xe2, 0x94, 0x86, 0xc3, 0xf2, 0xf6, 0x24, 0x77, 0xb2, 0xbd, 0x36, 0x2b, 0x03, 0x9c, 0x01, 0x3c, 0x0c, 0x50, 0x76, 0xef, 0x52, 0x0d, 0xbb, 0x40, 0x5f, 0x42, 0xce, 0xe9, 0x54, 0x25, 0xc3, 0x73, 0xa9, 0x75, 0xe1, 0xcd, 0xd0, 0x32, 0xc4, 0x96, 0x22, 0xc8, 0x50, 0x79, 0xb0, 0x9e, 0x88, 0xda, 0xb2, 0xb1, 0x39, 0x69, 0xef, 0x7a, 0x72, 0x39, 0x73, 0x78, 0x10, 0x40, 0x45, 0x9f, 0x57, 0xd5, 0x01, 0x36, 0x38, 0x48, 0x3d, 0xe2, 0xd9, 0x1c, 0xb3, 0xc4, 0x90, 0xda, 0x81, 0xc4, 0x6d, 0xe6, 0xcd, 0x76, 0xea, 0x8a, 0x0c, 0x8f, 0x6f, 0xe3, 0x31, 0x71, 0x2d, 0x24 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.14", + /* Message to be signed */ + 169, + { 0xc5, 0xa2, 0x71, 0x12, 0x78, 0x76, 0x1d, 0xfc, 0xdd, 0x4f, 0x0c, 0x99, 0xe6, 0xf5, 0x61, 0x9d, 0x6c, 0x48, 0xb5, 0xd4, 0xc1, 0xa8, 0x09, 0x82, 0xfa, 0xa6, 0xb4, 0xcf, 0x1c, 0xf7, 0xa6, 0x0f, 0xf3, 0x27, 0xab, 0xef, 0x93, 0xc8, 0x01, 0x42, 0x9e, 0xfd, 0xe0, 0x86, 0x40, 0x85, 0x81, 0x46, 0x10, 0x56, 0xac, 0xc3, 0x3f, 0x3d, 0x04, 0xf5, 0xad, 0xa2, 0x12, 0x16, 0xca, 0xcd, 0x5f, 0xd1, 0xf9, 0xed, 0x83, 0x20, 0x3e, 0x0e, 0x2f, 0xe6, 0x13, 0x8e, 0x3e, 0xae, 0x84, 0x24, 0xe5, 0x91, 0x5a, 0x08, 0x3f, 0x3f, 0x7a, 0xb7, 0x60, 0x52, 0xc8, 0xbe, 0x55, 0xae, 0x88, 0x2d, 0x6e, 0xc1, 0x48, 0x2b, 0x1e, 0x45, 0xc5, 0xda, 0xe9, 0xf4, 0x10, 0x15, 0x40, 0x53, 0x27, 0x02, 0x2e, 0xc3, 0x2f, 0x0e, 0xa2, 0x42, 0x97, 0x63, 0xb2, 0x55, 0x04, 0x3b, 0x19, 0x58, 0xee, 0x3c, 0xf6, 0xd6, 0x39, 0x83, 0x59, 0x6e, 0xb3, 0x85, 0x84, 0x4f, 0x85, 0x28, 0xcc, 0x9a, 0x98, 0x65, 0x83, 0x5d, 0xc5, 0x11, 0x3c, 0x02, 0xb8, 0x0d, 0x0f, 0xca, 0x68, 0xaa, 0x25, 0xe7, 0x2b, 0xca, 0xae, 0xb3, 0xcf, 0x9d, 0x79, 0xd8, 0x4f, 0x98, 0x4f, 0xd4, 0x17 } +, + /* Signature */ + 256, + { 0x6b, 0xd5, 0x25, 0x7a, 0xa0, 0x66, 0x11, 0xfb, 0x46, 0x60, 0x08, 0x7c, 0xb4, 0xbc, 0x4a, 0x9e, 0x44, 0x91, 0x59, 0xd3, 0x16, 0x52, 0xbd, 0x98, 0x08, 0x44, 0xda, 0xf3, 0xb1, 0xc7, 0xb3, 0x53, 0xf8, 0xe5, 0x61, 0x42, 0xf7, 0xea, 0x98, 0x57, 0x43, 0x3b, 0x18, 0x57, 0x3b, 0x4d, 0xee, 0xde, 0x81, 0x8a, 0x93, 0xb0, 0x29, 0x02, 0x97, 0x78, 0x3f, 0x1a, 0x2f, 0x23, 0xcb, 0xc7, 0x27, 0x97, 0xa6, 0x72, 0x53, 0x7f, 0x01, 0xf6, 0x24, 0x84, 0xcd, 0x41, 0x62, 0xc3,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example 15.15", + /* Message to be signed */ + 215, + { 0x9b, 0xf8, 0xaa, 0x25, 0x3b, 0x87, 0x2e, 0xa7, 0x7a, 0x7e, 0x23, 0x47, 0x6b, 0xe2, 0x6b, 0x23, 0x29, 0x57, 0x8c, 0xf6, 0xac, 0x9e, 0xa2, 0x80, 0x5b, 0x35, 0x7f, 0x6f, 0xc3, 0xad, 0x13, 0x0d, 0xba, 0xeb, 0x3d, 0x86, 0x9a, 0x13, 0xcc, 0xe7, 0xa8, 0x08, 0xbb, 0xbb, 0xc9, 0x69, 0x85, 0x7e, 0x03, 0x94, 0x5c, 0x7b, 0xb6, 0x1d, 0xf1, 0xb5, 0xc2, 0x58, 0x9b, 0x8e, 0x04, 0x6c, 0x2a, 0x5d, 0x7e, 0x40, 0x57, 0xb1, 0xa7, 0x4f, 0x24, 0xc7, 0x11, 0x21, 0x63, 0x64, 0x28, 0x85, 0x29, 0xec, 0x95, 0x70, 0xf2, 0x51, 0x97, 0x21, 0x3b, 0xe1, 0xf5, 0xc2, 0xe5, 0x96, 0xf8, 0xbf, 0x8b, 0x2c, 0xf3, 0xcb, 0x38, 0xaa, 0x56, 0xff, 0xe5, 0xe3, 0x1d, 0xf7, 0x39, 0x58, 0x20, 0xe9, 0x4e, 0xcf, 0x3b, 0x11, 0x89, 0xa9, 0x65, 0xdc, 0xf9, 0xa9, 0xcb, 0x42, 0x98, 0xd3, 0xc8, 0x8b, 0x29, 0x23, 0xc1, 0x9f, 0xc6, 0xbc, 0x34, 0xaa, 0xce, 0xca, 0xd4, 0xe0, 0x93, 0x1a, 0x7c, 0x4e, 0x5d, 0x73, 0xdc, 0x86, 0xdf, 0xa7, 0x98, 0xa8, 0x47, 0x6d, 0x82, 0x46, 0x3e, 0xef, 0xaa, 0x90, 0xa8, 0xa9, 0x19, 0x2a, 0xb0, 0x8b, 0x23, 0x08, 0x8d, 0xd5, 0x8e, 0x12, 0x80, 0xf7, 0xd7, 0x2e, 0x45, 0x48, 0x39, 0x6b, 0xaa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0x7d, 0x41, 0xc4, 0x3e, 0x2a, 0x49, 0x57, 0xaf, 0xf1, 0x9d, 0xb6, 0xf1, 0x8b, 0x17, 0x85, 0x9a, 0xf0, 0xbc, 0x84, 0xab, 0x67, 0x14, 0x6e, 0xc1, 0xa4, 0xa6, 0x0a, 0x17, 0xd7, 0xe0, 0x5f, 0x8b, 0x4f, 0x9c, 0xed, 0x6a, 0xd1, 0x09, 0x08, 0xd8, 0xd7, 0x8f, 0x7f, 0xc8, 0x8b, 0x76, 0xad, 0xc8, 0x29, 0x0f, 0x87, 0xda, 0xf2, 0xa7, 0xbe, 0x10, 0xae, 0x40, 0x85, 0x21, 0x39, 0x5d, 0x54, 0xed, 0x25, 0x56, 0xfb, 0x76, 0x61, 0x85, 0x4a, 0x73, 0x0c, 0xe3, 0xd8, 0x2c, 0x71, 0xa8, 0xd4, 0x93, 0xec, 0x49, 0xa3, 0x78, 0xac, 0x8a, 0x3c, 0x74, 0x43, 0x9f, 0x7c, 0xc5, 0x55, 0xba, 0x13, 0xf8, 0x59, 0x07, 0x08, 0x90, 0xee, 0x18, 0xff, 0x65, 0x8f, 0xa4, 0xd7, 0x41, 0x96, 0x9d, 0x70, 0xa5 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.16", + /* Message to be signed */ + 247, + { 0x32, 0x47, 0x48, 0x30, 0xe2, 0x20, 0x37, 0x54, 0xc8, 0xbf, 0x06, 0x81, 0xdc, 0x4f, 0x84, 0x2a, 0xfe, 0x36, 0x09, 0x30, 0x37, 0x86, 0x16, 0xc1, 0x08, 0xe8, 0x33, 0x65, 0x6e, 0x56, 0x40, 0xc8, 0x68, 0x56, 0x88, 0x5b, 0xb0, 0x5d, 0x1e, 0xb9, 0x43, 0x8e, 0xfe, 0xde, 0x67, 0x92, 0x63, 0xde, 0x07, 0xcb, 0x39, 0x55, 0x3f, 0x6a, 0x25, 0xe0, 0x06, 0xb0, 0xa5, 0x23, 0x11, 0xa0, 0x63, 0xca, 0x08, 0x82, 0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6, 0x3a, 0xb7, 0x91, 0x92, 0x18, 0x90, 0x18, 0x68, 0xf9, 0x33, 0x7f, 0x8c, 0xd2, 0x6a, 0xaf, 0xe6, 0xf3, 0x3b, 0x7f, 0xb2, 0xc9, 0x88, 0x10, 0xaf, 0x19, 0xf7, 0xfc, 0xb2, 0x82, 0xba, 0x15, 0x77, 0x91, 0x2c, 0x1d, 0x36, 0x89, 0x75, 0xfd, 0x5d, 0x44, 0x0b, 0x86, 0xe1, 0x0c, 0x19, 0x97, 0x15, 0xfa, 0x0b, 0x6f, 0x42, 0x50, 0xb5, 0x33, 0x73, 0x2d, 0x0b, 0xef, 0xe1, 0x54, 0x51, 0x50, 0xfc, 0x47, 0xb8, 0x76, 0xde, 0x09, 0xb0, 0x0a, 0x94 } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.17", + /* Message to be signed */ + 61, + { 0x00, 0x8e, 0x59, 0x50, 0x5e, 0xaf, 0xb5, 0x50, 0xaa, 0xe5, 0xe8, 0x45, 0x58, 0x4c, 0xeb, 0xb0, 0x0b, 0x6d, 0xe1, 0x73, 0x3e, 0x9f, 0x95, 0xd4, 0x2c, 0x88, 0x2a, 0x5b, 0xbe, 0xb5, 0xce, 0x1c, 0x57, 0xe1, 0x19, 0xe7, 0xc0, 0xd4, 0xda, 0xca, 0x9f, 0x1f, 0xf7, 0x87, 0x02, 0x17, 0xf7, 0xcf, 0xd8, 0xa6, 0xb3, 0x73, 0x97, 0x7c, 0xac, 0x9c, 0xab, 0x8e, 0x71, 0xe4, 0x20 } +, + /* Signature */ + 256, + { 0x92, 0x25, 0x03, 0xb6, 0x73, 0xee, 0x5f, 0x3e, 0x69, 0x1e, 0x1c, 0xa8, 0x5e, 0x9f, 0xf4, 0x17, 0x3c, 0xf7, 0x2b, 0x05, 0xac, 0x2c, 0x13, 0x1d, 0xa5, 0x60, 0x35, 0x93, 0xe3, 0xbc, 0x25, 0x9c, 0x94, 0xc1, 0xf7, 0xd3, 0xa0, 0x6a, 0x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 0x5f, 0x8d, 0x4d, 0x49, 0x6a, 0xcf, 0x03, 0xd3, 0x03, 0x3b, 0x7c, 0xcd, 0x19, 0x6b, 0xc2, 0x2f, 0x68, 0xfb, 0x7b, 0xef, 0x4f, 0x69, 0x7c, 0x5e, 0xa2, 0xb3, 0x50, 0x62, 0xf4, 0x8a, 0x36, 0xdd } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.18", + /* Message to be signed */ + 69, + { 0x6a, 0xbc, 0x54, 0xcf, 0x8d, 0x1d, 0xff, 0x1f, 0x53, 0xb1, 0x7d, 0x81, 0x60, 0x36, 0x88, 0x78, 0xa8, 0x78, 0x8c, 0xc6, 0xd2, 0x2f, 0xa5, 0xc2, 0x25, 0x8c, 0x88, 0xe6, 0x60, 0xb0, 0x9a, 0x89, 0x33, 0xf9, 0xf2, 0xc0, 0x50, 0x4d, 0xda, 0xdc, 0x21, 0xf6, 0xe7, 0x5e, 0x0b, 0x83, 0x3b, 0xeb, 0x55, 0x52, 0x29, 0xde, 0xe6, 0x56, 0xb9, 0x04, 0x7b, 0x92, 0xf6, 0x2e, 0x76, 0xb8, 0xff, 0xcc, 0x60, 0xda, 0xb0, 0x6b, 0x80 } +, + /* Signature */ + 256, + { 0x0b, 0x6d, 0xaf, 0x42, 0xf7, 0xa8, 0x62, 0x14, 0x7e, 0x41, 0x74, 0x93, 0xc2, 0xc4, 0x01, 0xef, 0xae, 0x32, 0x63, 0x6a, 0xb4, 0xcb, 0xd4, 0x41, 0x92, 0xbb, 0xf5, 0xf1, 0x95, 0xb5, 0x0a, 0xe0, 0x96, 0xa4, 0x75, 0xa1, 0x61, 0x4f, 0x0a, 0x9f, 0xa8, 0xf7, 0xa0, 0x26, 0xcb, 0x46, 0xc6, 0x50, 0x6e, 0x51, 0x8e, 0x33, 0xd8, 0x3e, 0x56, 0x47, 0x7a, 0x87, 0x5a, 0xca, 0x8c, 0x7e, 0x71, 0x4c, 0xe1, 0xbd, 0xbd, 0x61, 0xef, 0x5d, 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+ +} +, +{ + "PKCS#1 v1.5 Signature Example 15.19", + /* Message to be signed */ + 177, + { 0xaf, 0x2d, 0x78, 0x15, 0x2c, 0xf1, 0x0e, 0xfe, 0x01, 0xd2, 0x74, 0xf2, 0x17, 0xb1, 0x77, 0xf6, 0xb0, 0x1b, 0x5e, 0x74, 0x9f, 0x15, 0x67, 0x71, 0x5d, 0xa3, 0x24, 0x85, 0x9c, 0xd3, 0xdd, 0x88, 0xdb, 0x84, 0x8e, 0xc7, 0x9f, 0x48, 0xdb, 0xba, 0x7b, 0x6f, 0x1d, 0x33, 0x11, 0x1e, 0xf3, 0x1b, 0x64, 0x89, 0x9e, 0x73, 0x91, 0xc2, 0xbf, 0xfd, 0x69, 0xf4, 0x90, 0x25, 0xcf, 0x20, 0x1f, 0xc5, 0x85, 0xdb, 0xd1, 0x54, 0x2c, 0x1c, 0x77, 0x8a, 0x2c, 0xe7, 0xa7, 0xee, 0x10, 0x8a, 0x30, 0x9f, 0xec, 0xa2, 0x6d, 0x13, 0x3a, 0x5f, 0xfe, 0xdc, 0x4e, 0x86, 0x9d, 0xcd, 0x76, 0x56, 0x59, 0x6a, 0xc8, 0x42, 0x7e, 0xa3, 0xef, 0x6e, 0x3f, 0xd7, 0x8f, 0xe9, 0x9d, 0x8d, 0xdc, 0x71, 0xd8, 0x39, 0xf6, 0x78, 0x6e, 0x0d, 0xa6, 0xe7, 0x86, 0xbd, 0x62, 0xb3, 0xa4, 0xf1, 0x9b, 0x89, 0x1a, 0x56, 0x15, 0x7a, 0x55, 0x4e, 0xc2, 0xa2, 0xb3, 0x9e, 0x25, 0xa1, 0xd7, 0xc7, 0xd3, 0x73, 0x21, 0xc7, 0xa1, 0xd9, 0x46, 0xcf, 0x4f, 0xbe, 0x75, 0x8d, 0x92, 0x76, 0xf0, 0x85, 0x63, 0x44, 0x9d, 0x67, 0x41, 0x4a, 0x2c, 0x03, 0x0f, 0x42, 0x51, 0xcf, 0xe2, 0x21, 0x3d, 0x04, 0xa5, 0x41, 0x06, 0x37, 0x87 } +, + /* Signature */ + 256, + { 0x20, 0x9c, 0x61, 0x15, 0x78, 0x57, 0x38, 0x7b, 0x71, 0xe2, 0x4b, 0xf3, 0xdd, 0x56, 0x41, 0x45, 0x50, 0x50, 0x3b, 0xec, 0x18, 0x0f, 0xf5, 0x3b, 0xdd, 0x9b, 0xac, 0x06, 0x2a, 0x2d, 0x49, 0x95, 0x09, 0xbf, 0x99, 0x12, 0x81, 0xb7, 0x95, 0x27, 0xdf, 0x91, 0x36, 0x61, 0x5b, 0x7a, 0x6d, 0x9d, 0xb3, 0xa1, 0x03, 0xb5, 0x35, 0xe0, 0x20, 0x2a, 0x2c, 0xac, 0xa1, 0x97, 0xa7, 0xb7, 0x4e, 0x53, 0x56, 0xf3, 0xdd, 0x59, 0x5b, 0x49, 0xac, 0xfd, 0x9d, 0x30, 0x04, 0x9a, 0x98, 0xca, 0x88, 0xf6, 0x25, 0xbc, 0xa1, 0xd5, 0xf2, 0x2a, 0x39, 0x2d, 0x8a, 0x74, 0x9e, 0xfb, 0x6e, 0xed, 0x9b, 0x78, 0x21, 0xd3, 0x11, 0x0a, 0xc0, 0xd2, 0x44, 0x19, 0x9e, 0xcb, 0x4a, 0xa3, 0xd7, 0x35, 0xa8, 0x3a, 0x2e, 0x88, 0x93, 0xc6, 0xbf, 0x85, 0x81, 0x38, 0x3c, 0xca, 0xee, 0x83, 0x46, 0x35, 0xb7, 0xfa, 0x1f, 0xaf, 0xfa, 0x45, 0xb1, 0x3d, 0x15, 0xc1, 0xda, 0x33, 0xaf, 0x71, 0xe8, 0x93, 0x03, 0xd6, 0x80, 0x90, 0xff, 0x62, 0xee, 0x61, 0x5f, 0xdf, 0x5a, 0x84, 0xd1, 0x20, 0x71, 0x1d, 0xa5, 0x3c, 0x28, 0x89, 0x19, 0x8a, 0xb3, 0x83, 0x17, 0xa9, 0x73, 0x4a, 0xb2, 0x7d, 0x67, 0x92, 0x4c, 0xea, 0x74, 0x15, 0x6f, 0xf9, 0x9b, 0xef, 0x98, 0x76, 0xbb, 0x5c, 0x33, 0x9e, 0x93, 0x74, 0x52, 0x83, 0xe1, 0xb3, 0x4e, 0x07, 0x22, 0x26, 0xb8, 0x80, 0x45, 0xe0, 0x17, 0xe9, 0xf0, 0x5b, 0x2a, 0x8c, 0x41, 0x67, 0x40, 0x25, 0x8e, 0x22, 0x3b, 0x26, 0x90, 0x02, 0x74, 0x91, 0x73, 0x22, 0x73, 0xf3, 0x22, 0x9d, 0x9e, 0xf2, 0xb1, 0xb3, 0x80, 0x7e, 0x32, 0x10, 0x18, 0x92, 0x0a, 0xd3, 0xe5, 0x3d, 0xae, 0x47, 0xe6, 0xd9, 0x39, 0x5c, 0x18, 0x4b, 0x93, 0xa3, 0x74, 0xc6, 0x71, 0xfa, 0xa2, 0xce } + +} +, +{ + "PKCS#1 v1.5 Signature Example 15.20", + /* Message to be signed */ + 179, + { 0x40, 0xee, 0x99, 0x24, 0x58, 0xd6, 0xf6, 0x14, 0x86, 0xd2, 0x56, 0x76, 0xa9, 0x6d, 0xd2, 0xcb, 0x93, 0xa3, 0x7f, 0x04, 0xb1, 0x78, 0x48, 0x2f, 0x2b, 0x18, 0x6c, 0xf8, 0x82, 0x15, 0x27, 0x0d, 0xba, 0x29, 0xd7, 0x86, 0xd7, 0x74, 0xb0, 0xc5, 0xe7, 0x8c, 0x7f, 0x6e, 0x56, 0xa9, 0x56, 0xe7, 0xf7, 0x39, 0x50, 0xa2, 0xb0, 0xc0, 0xc1, 0x0a, 0x08, 0xdb, 0xcd, 0x67, 0xe5, 0xb2, 0x10, 0xbb, 0x21, 0xc5, 0x8e, 0x27, 0x67, 0xd4, 0x4f, 0x7d, 0xd4, 0x01, 0x4e, 0x39, 0x66, 0x14, 0x3b, 0xf7, 0xe3, 0xd6, 0x6f, 0xf0, 0xc0, 0x9b, 0xe4, 0xc5, 0x5f, 0x93, 0xb3, 0x99, 0x94, 0xb8, 0x51, 0x8d, 0x9c, 0x1d, 0x76, 0xd5, 0xb4, 0x73, 0x74, 0xde, 0xa0, 0x8f, 0x15, 0x7d, 0x57, 0xd7, 0x06, 0x34, 0x97, 0x8f, 0x38, 0x56, 0xe0, 0xe5, 0xb4, 0x81, 0xaf, 0xbb, 0xdb, 0x5a, 0x3a, 0xc4, 0x8d, 0x48, 0x4b, 0xe9, 0x2c, 0x93, 0xde, 0x22, 0x91, 0x78, 0x35, 0x4c, 0x2d, 0xe5, 0x26, 0xe9, 0xc6, 0x5a, 0x31, 0xed, 0xe1, 0xef, 0x68, 0xcb, 0x63, 0x98, 0xd7, 0x91, 0x16, 0x84, 0xfe, 0xc0, 0xba, 0xbc, 0x3a, 0x78, 0x1a, 0x66, 0x66, 0x07, 0x83, 0x50, 0x69, 0x74, 0xd0, 0xe1, 0x48, 0x25, 0x10, 0x1c, 0x3b, 0xfa, 0xea } +, + /* Signature */ + 256, + { 0x92, 0x75, 0x02, 0xb8, 0x24, 0xaf, 0xc4, 0x25, 0x13, 0xca, 0x65, 0x70, 0xde, 0x33, 0x8b, 0x8a, 0x64, 0xc3, 0xa8, 0x5e, 0xb8, 0x28, 0xd3, 0x19, 0x36, 0x24, 0xf2, 0x7e, 0x8b, 0x10, 0x29, 0xc5, 0x5c, 0x11, 0x9c, 0x97, 0x33, 0xb1, 0x8f, 0x58, 0x49, 0xb3, 0x50, 0x09, 0x18, 0xbc, 0xc0, 0x05, 0x51, 0xd9, 0xa8, 0xfd, 0xf5, 0x3a, 0x97, 0x74, 0x9f, 0xa8, 0xdc, 0x48, 0x0d, 0x6f, 0xe9, 0x74, 0x2a, 0x58, 0x71, 0xf9, 0x73, 0x92, 0x65, 0x28, 0x97, 0x2a, 0x1a, 0xf4, 0x9e, 0x39, 0x25, 0xb0, 0xad, 0xf1, 0x4a, 0x84, 0x27, 0x19, 0xb4, 0xa5, 0xa2, 0xd8, 0x9f, 0xa9, 0xc0, 0xb6, 0x60, 0x5d, 0x21, 0x2b, 0xed, 0x1e, 0x67, 0x23, 0xb9, 0x34, 0x06, 0xad, 0x30, 0xe8, 0x68, 0x29, 0xa5, 0xc7, 0x19, 0xb8, 0x90, 0xb3, 0x89, 0x30, 0x6d, 0xc5, 0x50, 0x64, 0x86, 0xee, 0x2f, 0x36, 0xa8, 0xdf, 0xe0, 0xa9, 0x6a, 0xf6, 0x78, 0xc9, 0xcb, 0xd6, 0xaf, 0xf3, 0x97, 0xca, 0x20, 0x0e, 0x3e, 0xdc, 0x1e, 0x36, 0xbd, 0x2f, 0x08, 0xb3, 0x1d, 0x54, 0x0c, 0x0c, 0xb2, 0x82, 0xa9, 0x55, 0x9e, 0x4a, 0xdd, 0x4f, 0xc9, 0xe6, 0x49, 0x2e, 0xed, 0x0c, 0xcb, 0xd3, 0xa6, 0x98, 0x2e, 0x5f, 0xaa, 0x2d, 0xdd, 0x17, 0xbe, 0x47, 0x41, 0x7c, 0x80, 0xb4, 0xe5, 0x45, 0x2d, 0x31, 0xf7, 0x24, 0x01, 0xa0, 0x42, 0x32, 0x51, 0x09, 0x54, 0x4d, 0x95, 0x4c, 0x01, 0x93, 0x90, 0x79, 0xd4, 0x09, 0xa5, 0xc3, 0x78, 0xd7, 0x51, 0x2d, 0xfc, 0x2d, 0x2a, 0x71, 0xef, 0xcc, 0x34, 0x32, 0xa7, 0x65, 0xd1, 0xc6, 0xa5, 0x2c, 0xfc, 0xe8, 0x99, 0xcd, 0x79, 0xb1, 0x5b, 0x4f, 0xc3, 0x72, 0x36, 0x41, 0xef, 0x6b, 0xd0, 0x0a, 0xcc, 0x10, 0x40, 0x7e, 0x5d, 0xf5, 0x8d, 0xd1, 0xc3, 0xc5, 0xc5, 0x59, 0xa5, 0x06 } + +} +, +} +}, +}; + diff --git a/testprof/makefile b/testprof/makefile index a33b27d45..6a81666e8 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -8,7 +8,7 @@ endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o ifndef LIBTEST_S LIBTEST_S=libtomcrypt_prof.a diff --git a/testprof/makefile.icc b/testprof/makefile.icc index e888496ef..c101bf5c1 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -4,7 +4,7 @@ CC?=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o ifndef LIBTEST_S LIBTEST_S = libtomcrypt_prof.a diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index f1f808ac2..9e7f42f89 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -7,7 +7,7 @@ CFLAGS = $(CFLAGS_OPTS) -W -I../src/headers -I. -Wall -W OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o \ -pkcs_1_oaep_test.o +pkcs_1_oaep_test.o pkcs_1_emsa_test.o default: $(LIBTEST_S) diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index 093461c37..192bc6b6b 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -3,7 +3,8 @@ CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ rsa_test.obj store_test.obj test_driver.obj x86_prof.obj katja_test.obj \ -dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj +dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj \ +pkcs_1_emsa_test.obj tomcrypt_prof.lib: $(OBJECTS) lib /out:tomcrypt_prof.lib $(OBJECTS) diff --git a/testprof/makefile.shared b/testprof/makefile.shared index 8cd0261cc..7240b2e44 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -9,7 +9,7 @@ CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-par OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o ifndef LIBTEST LIBTEST=libtomcrypt_prof.la diff --git a/testprof/pkcs_1_emsa_test.c b/testprof/pkcs_1_emsa_test.c new file mode 100644 index 000000000..c9941a89f --- /dev/null +++ b/testprof/pkcs_1_emsa_test.c @@ -0,0 +1,65 @@ +#include + +#ifdef LTC_PKCS_1 + +#include "../notes/rsa-testvectors/pkcs1v15sign-vectors.c" + + + +int pkcs_1_emsa_test(void) +{ + int hash_idx = find_hash("sha1"); + unsigned int i; + + DO(hash_is_valid(hash_idx)); + + for (i = 0; i < sizeof(testcases_emsa)/sizeof(testcases_emsa[0]); ++i) { + testcase_t* t = &testcases_emsa[i]; + rsa_key k, *key = &k; + DOX(mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, + &key->dP, &key->qP, &key->p, &key->q, NULL), t->name); + + DOX(mp_read_unsigned_bin(key->e, t->rsa.e, t->rsa.e_l), t->name); + DOX(mp_read_unsigned_bin(key->d, t->rsa.d, t->rsa.d_l), t->name); + DOX(mp_read_unsigned_bin(key->N, t->rsa.n, t->rsa.n_l), t->name); + DOX(mp_read_unsigned_bin(key->dQ, t->rsa.dQ, t->rsa.dQ_l), t->name); + DOX(mp_read_unsigned_bin(key->dP, t->rsa.dP, t->rsa.dP_l), t->name); + DOX(mp_read_unsigned_bin(key->qP, t->rsa.qInv, t->rsa.qInv_l), t->name); + DOX(mp_read_unsigned_bin(key->q, t->rsa.q, t->rsa.q_l), t->name); + DOX(mp_read_unsigned_bin(key->p, t->rsa.p, t->rsa.p_l), t->name); + key->type = PK_PRIVATE; + + unsigned int j; + for (j = 0; j < sizeof(t->data)/sizeof(t->data[0]); ++j) { + rsaData_t* s = &t->data[j]; + unsigned char buf[20], obuf[256]; + unsigned long buflen = sizeof(buf), obuflen = sizeof(obuf); + int stat; + DOX(hash_memory(hash_idx, s->o1, s->o1_l, buf, &buflen), s->name); + DOX(rsa_sign_hash_ex(buf, buflen, obuf, &obuflen, LTC_PKCS_1_V1_5, NULL, -1, hash_idx, 0, key), s->name); + DOX(obuflen == (unsigned long)s->o2_l?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + DOX(memcmp(s->o2, obuf, s->o2_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + DOX(rsa_verify_hash_ex(obuf, obuflen, buf, buflen, LTC_PKCS_1_V1_5, hash_idx, 0, &stat, key), s->name); + DOX(stat == 1?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + } /* for */ + + mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + } /* for */ + + return 0; +} + +#else + +int pkcs_1_emsa_test(void) +{ + fprintf(stderr, "NOP"); + return 0; +} + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 36d64fd5c..e84acdbba 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -53,6 +53,7 @@ int mac_test(void); int pkcs_1_test(void); int pkcs_1_pss_test(void); int pkcs_1_oaep_test(void); +int pkcs_1_emsa_test(void); int store_test(void); int rsa_test(void); int dh_test(void); From b51824748abde842d21d5b185c2fb367c29971cb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 23:49:17 +0200 Subject: [PATCH 0268/1192] rt.py: extend for PKCS#1 v1.5 EME --- notes/rsa-testvectors/rt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py index 8795b0c05..747cbb401 100755 --- a/notes/rsa-testvectors/rt.py +++ b/notes/rsa-testvectors/rt.py @@ -152,6 +152,11 @@ def __init__(self, name): self.o = '# PKCS#1 v1.5 Signature Example' self.o1 = '# Message to be signed' self.o2 = '# Signature' + elif name == 'eme': + self.o = '# PKCS#1 v1.5 Encryption Example' + self.o1 = '# Message' + self.o2 = '# Seed' + self.o3 = '# Encryption' else: raise ValueError('Type unknown: ' + name) @@ -167,7 +172,7 @@ def __init__(self, name): self.dQ = '# q\'s CRT exponent dQ' self.qInv = '# CRT coefficient qInv' self.sod = '# --------------------------------' - elif name == 'emsa': + elif name == 'emsa' or name == 'eme': self.version = 1 self.numcases = 20 self.n = '# Modulus' From c24e2a1e6b7ed65c7648ec2fd3498d226a880968 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 23:49:55 +0200 Subject: [PATCH 0269/1192] fix pkcs1v15crypt-vectors.txt --- notes/rsa-testvectors/pkcs1v15crypt-vectors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt b/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt index 412c11892..515e6e96b 100755 --- a/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt +++ b/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt @@ -115,6 +115,7 @@ ce 6f a9 8d 5d be fd 73 26 3e 37 28 14 27 43 81 # PKCS#1 v1.5 encryption of 20 random messages with random seeds # --------------------------------------------------------------------------- +# PKCS#1 v1.5 Encryption Example 1.1 # ---------------------------------- # Message: From 92274aafb5d609a781e11a96c77452675b564244 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 00:58:45 +0200 Subject: [PATCH 0270/1192] add testprof/pkcs_1_eme_test --- demos/test.c | 1 + notes/rsa-testvectors/pkcs1v15crypt-vectors.c | 5429 +++++++++++++++++ testprof/makefile | 2 +- testprof/makefile.icc | 2 +- testprof/makefile.mingw | 2 +- testprof/makefile.msvc | 2 +- testprof/makefile.shared | 2 +- testprof/pkcs_1_eme_test.c | 69 + testprof/tomcrypt_test.h | 1 + 9 files changed, 5505 insertions(+), 5 deletions(-) create mode 100644 notes/rsa-testvectors/pkcs1v15crypt-vectors.c create mode 100644 testprof/pkcs_1_eme_test.c diff --git a/demos/test.c b/demos/test.c index 0beb748ca..051cb8d2d 100644 --- a/demos/test.c +++ b/demos/test.c @@ -27,6 +27,7 @@ int main(void) printf("\npkcs_1_pss_test...."); fflush(stdout); x = pkcs_1_pss_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_oaep_test...."); fflush(stdout); x = pkcs_1_oaep_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\npkcs_1_emsa_test...."); fflush(stdout); x = pkcs_1_emsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + printf("\npkcs_1_eme_test...."); fflush(stdout); x = pkcs_1_eme_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ndh_test......."); fflush(stdout); x = dh_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); diff --git a/notes/rsa-testvectors/pkcs1v15crypt-vectors.c b/notes/rsa-testvectors/pkcs1v15crypt-vectors.c new file mode 100644 index 000000000..b44601093 --- /dev/null +++ b/notes/rsa-testvectors/pkcs1v15crypt-vectors.c @@ -0,0 +1,5429 @@ +/* Generated from file: pkcs1v15crypt-vectors.txt + * with md5 hash: 120f611de26e7eb0f0e16da16639539c + */ + + +typedef struct rsaKey { + int n_l; + unsigned char n[256]; + int e_l; + unsigned char e[256]; + int d_l; + unsigned char d[256]; + int p_l; + unsigned char p[256]; + int q_l; + unsigned char q[256]; + int dP_l; + unsigned char dP[256]; + int dQ_l; + unsigned char dQ[256]; + int qInv_l; + unsigned char qInv[256]; +} rsaKey_t; + +typedef struct rsaData { + const char* name; + int o1_l; + unsigned char o1[256]; + int o2_l; + unsigned char o2[256]; + int o3_l; + unsigned char o3[256]; +} rsaData_t; + +typedef struct testcase { + const char* name; + rsaKey_t rsa; + rsaData_t data[20]; +} testcase_t; + +testcase_t testcases_eme[] = + { +{ + "Example 1: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xa8, 0xb3, 0xb2, 0x84, 0xaf, 0x8e, 0xb5, 0x0b, 0x38, 0x70, 0x34, 0xa8, 0x60, 0xf1, 0x46, 0xc4, 0x91, 0x9f, 0x31, 0x87, 0x63, 0xcd, 0x6c, 0x55, 0x98, 0xc8, 0xae, 0x48, 0x11, 0xa1, 0xe0, 0xab, 0xc4, 0xc7, 0xe0, 0xb0, 0x82, 0xd6, 0x93, 0xa5, 0xe7, 0xfc, 0xed, 0x67, 0x5c, 0xf4, 0x66, 0x85, 0x12, 0x77, 0x2c, 0x0c, 0xbc, 0x64, 0xa7, 0x42, 0xc6, 0xc6, 0x30, 0xf5, 0x33, 0xc8, 0xcc, 0x72, 0xf6, 0x2a, 0xe8, 0x33, 0xc4, 0x0b, 0xf2, 0x58, 0x42, 0xe9, 0x84, 0xbb, 0x78, 0xbd, 0xbf, 0x97, 0xc0, 0x10, 0x7d, 0x55, 0xbd, 0xb6, 0x62, 0xf5, 0xc4, 0xe0, 0xfa, 0xb9, 0x84, 0x5c, 0xb5, 0x14, 0x8e, 0xf7, 0x39, 0x2d, 0xd3, 0xaa, 0xff, 0x93, 0xae, 0x1e, 0x6b, 0x66, 0x7b, 0xb3, 0xd4, 0x24, 0x76, 0x16, 0xd4, 0xf5, 0xba, 0x10, 0xd4, 0xcf, 0xd2, 0x26, 0xde, 0x88, 0xd3, 0x9f, 0x16, 0xfb } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x53, 0x33, 0x9c, 0xfd, 0xb7, 0x9f, 0xc8, 0x46, 0x6a, 0x65, 0x5c, 0x73, 0x16, 0xac, 0xa8, 0x5c, 0x55, 0xfd, 0x8f, 0x6d, 0xd8, 0x98, 0xfd, 0xaf, 0x11, 0x95, 0x17, 0xef, 0x4f, 0x52, 0xe8, 0xfd, 0x8e, 0x25, 0x8d, 0xf9, 0x3f, 0xee, 0x18, 0x0f, 0xa0, 0xe4, 0xab, 0x29, 0x69, 0x3c, 0xd8, 0x3b, 0x15, 0x2a, 0x55, 0x3d, 0x4a, 0xc4, 0xd1, 0x81, 0x2b, 0x8b, 0x9f, 0xa5, 0xaf, 0x0e, 0x7f, 0x55, 0xfe, 0x73, 0x04, 0xdf, 0x41, 0x57, 0x09, 0x26, 0xf3, 0x31, 0x1f, 0x15, 0xc4, 0xd6, 0x5a, 0x73, 0x2c, 0x48, 0x31, 0x16, 0xee, 0x3d, 0x3d, 0x2d, 0x0a, 0xf3, 0x54, 0x9a, 0xd9, 0xbf, 0x7c, 0xbf, 0xb7, 0x8a, 0xd8, 0x84, 0xf8, 0x4d, 0x5b, 0xeb, 0x04, 0x72, 0x4d, 0xc7, 0x36, 0x9b, 0x31, 0xde, 0xf3, 0x7d, 0x0c, 0xf5, 0x39, 0xe9, 0xcf, 0xcd, 0xd3, 0xde, 0x65, 0x37, 0x29, 0xea, 0xd5, 0xd1 } +, + /* Prime 1 */ + 64, + { 0xd3, 0x27, 0x37, 0xe7, 0x26, 0x7f, 0xfe, 0x13, 0x41, 0xb2, 0xd5, 0xc0, 0xd1, 0x50, 0xa8, 0x1b, 0x58, 0x6f, 0xb3, 0x13, 0x2b, 0xed, 0x2f, 0x8d, 0x52, 0x62, 0x86, 0x4a, 0x9c, 0xb9, 0xf3, 0x0a, 0xf3, 0x8b, 0xe4, 0x48, 0x59, 0x8d, 0x41, 0x3a, 0x17, 0x2e, 0xfb, 0x80, 0x2c, 0x21, 0xac, 0xf1, 0xc1, 0x1c, 0x52, 0x0c, 0x2f, 0x26, 0xa4, 0x71, 0xdc, 0xad, 0x21, 0x2e, 0xac, 0x7c, 0xa3, 0x9d } +, + /* Prime 2 */ + 64, + { 0xcc, 0x88, 0x53, 0xd1, 0xd5, 0x4d, 0xa6, 0x30, 0xfa, 0xc0, 0x04, 0xf4, 0x71, 0xf2, 0x81, 0xc7, 0xb8, 0x98, 0x2d, 0x82, 0x24, 0xa4, 0x90, 0xed, 0xbe, 0xb3, 0x3d, 0x3e, 0x3d, 0x5c, 0xc9, 0x3c, 0x47, 0x65, 0x70, 0x3d, 0x1d, 0xd7, 0x91, 0x64, 0x2f, 0x1f, 0x11, 0x6a, 0x0d, 0xd8, 0x52, 0xbe, 0x24, 0x19, 0xb2, 0xaf, 0x72, 0xbf, 0xe9, 0xa0, 0x30, 0xe8, 0x60, 0xb0, 0x28, 0x8b, 0x5d, 0x77 } +, + /* Prime exponent 1 */ + 64, + { 0x0e, 0x12, 0xbf, 0x17, 0x18, 0xe9, 0xce, 0xf5, 0x59, 0x9b, 0xa1, 0xc3, 0x88, 0x2f, 0xe8, 0x04, 0x6a, 0x90, 0x87, 0x4e, 0xef, 0xce, 0x8f, 0x2c, 0xcc, 0x20, 0xe4, 0xf2, 0x74, 0x1f, 0xb0, 0xa3, 0x3a, 0x38, 0x48, 0xae, 0xc9, 0xc9, 0x30, 0x5f, 0xbe, 0xcb, 0xd2, 0xd7, 0x68, 0x19, 0x96, 0x7d, 0x46, 0x71, 0xac, 0xc6, 0x43, 0x1e, 0x40, 0x37, 0x96, 0x8d, 0xb3, 0x78, 0x78, 0xe6, 0x95, 0xc1 } +, + /* Prime exponent 2 */ + 64, + { 0x95, 0x29, 0x7b, 0x0f, 0x95, 0xa2, 0xfa, 0x67, 0xd0, 0x07, 0x07, 0xd6, 0x09, 0xdf, 0xd4, 0xfc, 0x05, 0xc8, 0x9d, 0xaf, 0xc2, 0xef, 0x6d, 0x6e, 0xa5, 0x5b, 0xec, 0x77, 0x1e, 0xa3, 0x33, 0x73, 0x4d, 0x92, 0x51, 0xe7, 0x90, 0x82, 0xec, 0xda, 0x86, 0x6e, 0xfe, 0xf1, 0x3c, 0x45, 0x9e, 0x1a, 0x63, 0x13, 0x86, 0xb7, 0xe3, 0x54, 0xc8, 0x99, 0xf5, 0xf1, 0x12, 0xca, 0x85, 0xd7, 0x15, 0x83 } +, + /* Coefficient */ + 64, + { 0x4f, 0x45, 0x6c, 0x50, 0x24, 0x93, 0xbd, 0xc0, 0xed, 0x2a, 0xb7, 0x56, 0xa3, 0xa6, 0xed, 0x4d, 0x67, 0x35, 0x2a, 0x69, 0x7d, 0x42, 0x16, 0xe9, 0x32, 0x12, 0xb1, 0x27, 0xa6, 0x3d, 0x54, 0x11, 0xce, 0x6f, 0xa9, 0x8d, 0x5d, 0xbe, 0xfd, 0x73, 0x26, 0x3e, 0x37, 0x28, 0x14, 0x27, 0x43, 0x81, 0x81, 0x66, 0xed, 0x7d, 0xd6, 0x36, 0x87, 0xdd, 0x2a, 0x8c, 0xa1, 0xd2, 0xf4, 0xfb, 0xd8, 0xe1 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 1.1", + /* Message */ + 28, + { 0x66, 0x28, 0x19, 0x4e, 0x12, 0x07, 0x3d, 0xb0, 0x3b, 0xa9, 0x4c, 0xda, 0x9e, 0xf9, 0x53, 0x23, 0x97, 0xd5, 0x0d, 0xba, 0x79, 0xb9, 0x87, 0x00, 0x4a, 0xfe, 0xfe, 0x34 } +, + /* Seed */ + 97, + { 0x01, 0x73, 0x41, 0xae, 0x38, 0x75, 0xd5, 0xf8, 0x71, 0x01, 0xf8, 0xcc, 0x4f, 0xa9, 0xb9, 0xbc, 0x15, 0x6b, 0xb0, 0x46, 0x28, 0xfc, 0xcd, 0xb2, 0xf4, 0xf1, 0x1e, 0x90, 0x5b, 0xd3, 0xa1, 0x55, 0xd3, 0x76, 0xf5, 0x93, 0xbd, 0x73, 0x04, 0x21, 0x08, 0x74, 0xeb, 0xa0, 0x8a, 0x5e, 0x22, 0xbc, 0xcc, 0xb4, 0xc9, 0xd3, 0x88, 0x2a, 0x93, 0xa5, 0x4d, 0xb0, 0x22, 0xf5, 0x03, 0xd1, 0x63, 0x38, 0xb6, 0xb7, 0xce, 0x16, 0xdc, 0x7f, 0x4b, 0xbf, 0x9a, 0x96, 0xb5, 0x97, 0x72, 0xd6, 0x60, 0x6e, 0x97, 0x47, 0xc7, 0x64, 0x9b, 0xf9, 0xe0, 0x83, 0xdb, 0x98, 0x18, 0x84, 0xa9, 0x54, 0xab, 0x3c, 0x6f } +, + /* Encryption */ + 128, + { 0x50, 0xb4, 0xc1, 0x41, 0x36, 0xbd, 0x19, 0x8c, 0x2f, 0x3c, 0x3e, 0xd2, 0x43, 0xfc, 0xe0, 0x36, 0xe1, 0x68, 0xd5, 0x65, 0x17, 0x98, 0x4a, 0x26, 0x3c, 0xd6, 0x64, 0x92, 0xb8, 0x08, 0x04, 0xf1, 0x69, 0xd2, 0x10, 0xf2, 0xb9, 0xbd, 0xfb, 0x48, 0xb1, 0x2f, 0x9e, 0xa0, 0x50, 0x09, 0xc7, 0x7d, 0xa2, 0x57, 0xcc, 0x60, 0x0c, 0xce, 0xfe, 0x3a, 0x62, 0x83, 0x78, 0x9d, 0x8e, 0xa0, 0xe6, 0x07, 0xac, 0x58, 0xe2, 0x69, 0x0e, 0xc4, 0xeb, 0xc1, 0x01, 0x46, 0xe8, 0xcb, 0xaa, 0x5e, 0xd4, 0xd5, 0xcc, 0xe6, 0xfe, 0x7b, 0x0f, 0xf9, 0xef, 0xc1, 0xea, 0xbb, 0x56, 0x4d, 0xbf, 0x49, 0x82, 0x85, 0xf4, 0x49, 0xee, 0x61, 0xdd, 0x7b, 0x42, 0xee, 0x5b, 0x58, 0x92, 0xcb, 0x90, 0x60, 0x1f, 0x30, 0xcd, 0xa0, 0x7b, 0xf2, 0x64, 0x89, 0x31, 0x0b, 0xcd, 0x23, 0xb5, 0x28, 0xce, 0xab, 0x3c, 0x31 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.2", + /* Message */ + 28, + { 0x75, 0x0c, 0x40, 0x47, 0xf5, 0x47, 0xe8, 0xe4, 0x14, 0x11, 0x85, 0x65, 0x23, 0x29, 0x8a, 0xc9, 0xba, 0xe2, 0x45, 0xef, 0xaf, 0x13, 0x97, 0xfb, 0xe5, 0x6f, 0x9d, 0xd5 } +, + /* Seed */ + 97, + { 0xac, 0x47, 0x28, 0xa8, 0x42, 0x8c, 0x1e, 0x52, 0x24, 0x71, 0xa8, 0xdf, 0x73, 0x5a, 0x8e, 0x92, 0x92, 0xaf, 0x0d, 0x55, 0xbc, 0xb7, 0x3a, 0x12, 0xac, 0x32, 0xc2, 0x64, 0xf3, 0x88, 0x1c, 0x7c, 0x8a, 0x71, 0x0f, 0x70, 0xfe, 0xb1, 0x04, 0x85, 0xc8, 0x37, 0x0f, 0x78, 0x1f, 0xff, 0xd0, 0x21, 0x81, 0x6f, 0x05, 0x87, 0x39, 0x76, 0x6d, 0xa0, 0xa9, 0xc9, 0xdb, 0x0e, 0xae, 0x7e, 0x9a, 0x25, 0xb6, 0xc4, 0x33, 0x18, 0xd0, 0xca, 0xac, 0x23, 0x65, 0x22, 0xca, 0x31, 0x0f, 0x17, 0xfc, 0x52, 0xad, 0x42, 0x29, 0xc8, 0x3a, 0x24, 0xe9, 0xe5, 0x45, 0xeb, 0x35, 0xe9, 0x82, 0x6d, 0x55, 0x9f, 0x57 } +, + /* Encryption */ + 128, + { 0x68, 0x42, 0xe5, 0xe2, 0xcc, 0x00, 0x41, 0xd6, 0xb0, 0xc8, 0x1a, 0x56, 0x2c, 0x39, 0xa6, 0x17, 0x37, 0x9a, 0x51, 0x5c, 0xab, 0x74, 0xab, 0xcb, 0x26, 0x19, 0xc7, 0x74, 0x0a, 0x54, 0x1d, 0x95, 0x55, 0xdd, 0x91, 0x65, 0x97, 0x5b, 0xf8, 0xa3, 0xeb, 0xd0, 0xd0, 0x45, 0x66, 0x61, 0xdf, 0xb1, 0xa6, 0x86, 0x1b, 0xa2, 0x33, 0x22, 0x69, 0x93, 0x0e, 0x0d, 0xb5, 0x14, 0xfc, 0xa0, 0x73, 0x3e, 0xeb, 0x9c, 0x40, 0x57, 0x13, 0xeb, 0x1f, 0x9d, 0x76, 0x80, 0x33, 0xed, 0x29, 0x3e, 0x1e, 0x08, 0x1a, 0x12, 0x5f, 0x32, 0xdd, 0xb9, 0xea, 0x52, 0xed, 0xbe, 0x27, 0x5c, 0x4a, 0xf6, 0x0f, 0x8a, 0x7b, 0xf8, 0x32, 0xbd, 0x22, 0x75, 0x61, 0xc2, 0x08, 0xdc, 0x00, 0x31, 0xa8, 0x4b, 0x50, 0x12, 0xc9, 0xdd, 0x9f, 0x74, 0x45, 0x9d, 0xcb, 0x07, 0x0b, 0xdb, 0xe1, 0x3c, 0xfa, 0x8c, 0x2d, 0x50 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.3", + /* Message */ + 55, + { 0xd9, 0x4a, 0xe0, 0x83, 0x2e, 0x64, 0x45, 0xce, 0x42, 0x33, 0x1c, 0xb0, 0x6d, 0x53, 0x1a, 0x82, 0xb1, 0xdb, 0x4b, 0xaa, 0xd3, 0x0f, 0x74, 0x6d, 0xc9, 0x16, 0xdf, 0x24, 0xd4, 0xe3, 0xc2, 0x45, 0x1f, 0xff, 0x59, 0xa6, 0x42, 0x3e, 0xb0, 0xe1, 0xd0, 0x2d, 0x4f, 0xe6, 0x46, 0xcf, 0x69, 0x9d, 0xfd, 0x81, 0x8c, 0x6e, 0x97, 0xb0, 0x51 } +, + /* Seed */ + 70, + { 0xdd, 0x2d, 0x60, 0xa5, 0xe0, 0x08, 0xeb, 0xe1, 0xd0, 0xbe, 0x6f, 0x60, 0xdb, 0xc4, 0x3f, 0x29, 0x62, 0xef, 0x50, 0xbf, 0xde, 0x54, 0x2b, 0xbb, 0xe9, 0x8f, 0xed, 0xd1, 0xfe, 0xac, 0x05, 0x7e, 0x77, 0x1c, 0xf1, 0x5f, 0xc6, 0x32, 0xc8, 0xdb, 0x27, 0x2e, 0x28, 0xd2, 0x9b, 0x57, 0x93, 0xea, 0x6a, 0xb8, 0x06, 0x21, 0x8c, 0x53, 0x82, 0x39, 0xb9, 0x3a, 0x93, 0x5e, 0x65, 0xd2, 0x44, 0x16, 0xec, 0x6c, 0x6e, 0x99, 0xae, 0x04 } +, + /* Encryption */ + 128, + { 0x70, 0x9c, 0x7d, 0x2d, 0x45, 0x98, 0xc9, 0x60, 0x65, 0xb6, 0x58, 0x8d, 0xa2, 0xf8, 0x9f, 0xa8, 0x7f, 0x06, 0x2d, 0x72, 0x41, 0xef, 0x65, 0x95, 0x89, 0x8f, 0x63, 0x7a, 0xda, 0x57, 0xea, 0xe9, 0x01, 0x73, 0xf0, 0xfb, 0x4b, 0xf6, 0xa9, 0x1e, 0xbd, 0x96, 0x50, 0x69, 0x07, 0xc8, 0x53, 0xda, 0xcf, 0x20, 0x84, 0x94, 0xbe, 0x94, 0xd3, 0x13, 0xa0, 0x41, 0x85, 0xd4, 0x74, 0xa9, 0x07, 0x41, 0x2e, 0xff, 0xc3, 0xe0, 0x24, 0xd0, 0x7e, 0x4d, 0x09, 0xaa, 0x24, 0x5f, 0xbc, 0xb1, 0x30, 0x21, 0x9b, 0xfa, 0x5d, 0xe0, 0x2d, 0x4f, 0x7e, 0x2e, 0xc9, 0xe6, 0x2e, 0x8a, 0xd3, 0x2d, 0xee, 0x5f, 0xf4, 0xd8, 0xe4, 0xcf, 0xec, 0xbc, 0x50, 0x33, 0xa1, 0xc2, 0xc6, 0x1c, 0x52, 0x33, 0xae, 0x16, 0x19, 0x2a, 0x48, 0x1d, 0x00, 0x75, 0xbf, 0xc7, 0xce, 0x02, 0x82, 0x12, 0xcd, 0x27, 0xbe, 0xbe } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.4", + /* Message */ + 26, + { 0x52, 0xe6, 0x50, 0xd9, 0x8e, 0x7f, 0x2a, 0x04, 0x8b, 0x4f, 0x86, 0x85, 0x21, 0x53, 0xb9, 0x7e, 0x01, 0xdd, 0x31, 0x6f, 0x34, 0x6a, 0x19, 0xf6, 0x7a, 0x85 } +, + /* Seed */ + 99, + { 0x26, 0x29, 0xa7, 0xaa, 0xc0, 0xc3, 0x90, 0x5e, 0x83, 0x1e, 0xb6, 0x02, 0x38, 0x8c, 0x54, 0x5a, 0xf5, 0x54, 0xb9, 0x6b, 0x2a, 0xe5, 0x15, 0x32, 0xe9, 0xcc, 0xdb, 0x89, 0x72, 0xef, 0x30, 0xb6, 0x4a, 0x2f, 0x98, 0xc6, 0x95, 0x29, 0x7a, 0x01, 0xc5, 0x81, 0x2a, 0x2c, 0x40, 0x15, 0x82, 0xf3, 0x7b, 0x14, 0x4a, 0x3e, 0x90, 0xe5, 0x9d, 0x81, 0xb6, 0x90, 0x39, 0xc6, 0x4b, 0x84, 0x4b, 0x02, 0x8c, 0x10, 0x5c, 0x8e, 0x68, 0x36, 0x15, 0xaf, 0xb6, 0x58, 0xb6, 0xc4, 0xd9, 0xf3, 0x82, 0x38, 0xa7, 0x63, 0x01, 0xbb, 0x14, 0x44, 0x91, 0x13, 0xb6, 0x9d, 0xe1, 0x26, 0x04, 0x5e, 0x26, 0xf1, 0x3e, 0xe6, 0xd7 } +, + /* Encryption */ + 128, + { 0x54, 0xdd, 0xb7, 0x84, 0x26, 0x8e, 0xad, 0xb3, 0x95, 0x5b, 0xd9, 0xf9, 0x49, 0x88, 0x42, 0x59, 0x5a, 0xd2, 0x9f, 0xf8, 0xa6, 0x67, 0xfe, 0xb4, 0x1f, 0x6f, 0x53, 0x0c, 0xb6, 0x0b, 0xc9, 0x26, 0xac, 0x6c, 0x71, 0xc7, 0x72, 0xf8, 0x03, 0xd0, 0x22, 0xb4, 0x1c, 0xa5, 0x72, 0x04, 0x22, 0x3b, 0x27, 0xca, 0x79, 0xec, 0x5b, 0x72, 0x65, 0x2c, 0xa9, 0xaf, 0xbf, 0x40, 0xdc, 0x2f, 0x6a, 0x0e, 0x13, 0xbc, 0xd6, 0x0d, 0x37, 0xf7, 0x95, 0x04, 0xb0, 0xff, 0xcc, 0x01, 0xcf, 0x53, 0x42, 0xd6, 0xd3, 0x4a, 0xc6, 0xf1, 0xf2, 0xf9, 0xf2, 0xf4, 0x87, 0x46, 0x25, 0xb9, 0xfd, 0xbb, 0x7d, 0xda, 0x2e, 0xc8, 0x7d, 0xf0, 0xcf, 0x87, 0x25, 0x97, 0x98, 0xdf, 0x86, 0xa0, 0x6b, 0xd5, 0xae, 0xf7, 0x35, 0x4b, 0x8c, 0xb1, 0xcb, 0x13, 0x75, 0x75, 0xf4, 0xcf, 0xbc, 0x46, 0x28, 0x1b, 0xb3, 0x31 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.5", + /* Message */ + 20, + { 0x8d, 0xa8, 0x9f, 0xd9, 0xe5, 0xf9, 0x74, 0xa2, 0x9f, 0xef, 0xfb, 0x46, 0x2b, 0x49, 0x18, 0x0f, 0x6c, 0xf9, 0xe8, 0x02 } +, + /* Seed */ + 105, + { 0xc3, 0xca, 0x84, 0x60, 0x0f, 0x35, 0xc8, 0x65, 0x5f, 0xc7, 0xc6, 0x4c, 0x75, 0xc5, 0x87, 0x38, 0x53, 0xd3, 0xaa, 0x8a, 0x94, 0x26, 0xa5, 0x1b, 0x63, 0xd7, 0xe7, 0x5d, 0xcf, 0x6c, 0xae, 0x97, 0xa4, 0x25, 0x3f, 0xba, 0x87, 0x1d, 0x6f, 0x96, 0x89, 0x97, 0x19, 0x9b, 0xf0, 0x1b, 0x6a, 0x4d, 0x34, 0x28, 0xce, 0x4c, 0x96, 0xd1, 0xc4, 0x87, 0xb2, 0x83, 0x0c, 0xb9, 0xe3, 0x5d, 0x64, 0x05, 0x56, 0x23, 0x69, 0x9a, 0xb4, 0x97, 0x9a, 0x02, 0x58, 0x4b, 0x92, 0xe6, 0xba, 0x39, 0xe7, 0x57, 0x28, 0x40, 0x79, 0xab, 0xf1, 0x33, 0xa7, 0xda, 0x54, 0xe5, 0x42, 0x52, 0x17, 0xa2, 0x10, 0xf6, 0x7c, 0x18, 0x26, 0x9b, 0x51, 0x1f, 0x61, 0xf8, 0xc5 } +, + /* Encryption */ + 128, + { 0xa8, 0x55, 0x48, 0x01, 0x3b, 0xd0, 0xe2, 0x0e, 0xe0, 0xeb, 0xd3, 0x6f, 0xb7, 0x48, 0x97, 0x7f, 0x98, 0x58, 0x46, 0xd7, 0x61, 0x0e, 0xed, 0x24, 0xc3, 0x6c, 0xd8, 0x30, 0x33, 0xdd, 0x2a, 0xa4, 0x58, 0x0b, 0xd1, 0x53, 0x35, 0x20, 0x9d, 0xcf, 0x78, 0x2e, 0xe2, 0x6c, 0x48, 0xc3, 0x06, 0x44, 0xb0, 0xb5, 0xcc, 0x86, 0xc8, 0xcd, 0x16, 0x5a, 0xe2, 0x1e, 0xad, 0xf5, 0x78, 0x04, 0x18, 0x67, 0x76, 0x07, 0x03, 0x18, 0x75, 0xe2, 0x21, 0xec, 0xdf, 0x3b, 0x10, 0x57, 0x31, 0x6f, 0x3f, 0x12, 0xa4, 0x7d, 0x5d, 0xa4, 0x0c, 0x41, 0x53, 0x9b, 0x63, 0x64, 0x30, 0xda, 0x2e, 0x54, 0x21, 0x90, 0x11, 0x9e, 0x42, 0x9c, 0x53, 0xc2, 0x22, 0x6f, 0x95, 0x9b, 0x19, 0xcc, 0xf4, 0x8a, 0x3d, 0x24, 0x02, 0x17, 0xc4, 0xde, 0x70, 0xd7, 0x07, 0x2a, 0x7e, 0x0d, 0x95, 0xb6, 0x16, 0xd1, 0x15, 0xa8 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.6", + /* Message */ + 7, + { 0x26, 0x52, 0x10, 0x50, 0x84, 0x42, 0x71 } +, + /* Seed */ + 118, + { 0x3c, 0x6a, 0x04, 0x71, 0xda, 0xf0, 0x0b, 0x7c, 0x2e, 0xfc, 0x9e, 0xe8, 0x80, 0x41, 0x65, 0x4f, 0x87, 0x62, 0x90, 0x07, 0xc1, 0x24, 0x32, 0x22, 0x11, 0xa5, 0xf4, 0xea, 0x3c, 0x58, 0x23, 0x85, 0x7b, 0xc8, 0xfc, 0x7e, 0x21, 0xc9, 0x45, 0x48, 0xb0, 0xee, 0xbd, 0xcf, 0xf7, 0x91, 0x60, 0xe1, 0x12, 0x46, 0x1e, 0x40, 0x50, 0x91, 0x10, 0xcf, 0xdc, 0x4f, 0x0f, 0x13, 0xc7, 0xfb, 0x92, 0x1a, 0xba, 0xc8, 0xdf, 0xaa, 0xc2, 0x1a, 0xcb, 0x0f, 0x7b, 0x8a, 0x13, 0xa4, 0xb5, 0xcc, 0xa5, 0x23, 0xd5, 0xc7, 0xdd, 0xf7, 0x05, 0x23, 0xeb, 0x57, 0x0c, 0x59, 0xb6, 0xc7, 0xae, 0x97, 0x67, 0xe4, 0xec, 0x9a, 0x63, 0xd1, 0x13, 0x6d, 0x10, 0x23, 0x1b, 0x40, 0x1e, 0x20, 0xe7, 0x41, 0x02, 0x84, 0x83, 0x48, 0x01, 0x7a, 0x16, 0x16 } +, + /* Encryption */ + 128, + { 0x5e, 0x51, 0x43, 0x63, 0x28, 0x7d, 0xe9, 0xb3, 0x80, 0x04, 0x8c, 0xc4, 0x43, 0x5d, 0x53, 0x29, 0x4a, 0xd5, 0x94, 0x1c, 0x55, 0x1a, 0x97, 0xe1, 0x3c, 0x16, 0xdc, 0x13, 0x98, 0xde, 0x61, 0x0d, 0xc7, 0x33, 0x7b, 0xc6, 0xbd, 0xe5, 0x78, 0xe9, 0xe9, 0xf5, 0x6a, 0xf1, 0x44, 0x54, 0xf2, 0xe8, 0x31, 0xbe, 0xef, 0x32, 0x31, 0xa8, 0x50, 0x68, 0xe8, 0xfe, 0xf7, 0x2c, 0x89, 0xe1, 0xdf, 0x1c, 0x99, 0x43, 0x0a, 0x60, 0xf6, 0xd9, 0x42, 0x89, 0xcf, 0xba, 0x87, 0xb2, 0xb4, 0x32, 0xa4, 0x0b, 0x88, 0xdb, 0x61, 0xda, 0xe0, 0x88, 0xf9, 0xed, 0x4e, 0x28, 0x4a, 0x21, 0x63, 0xaf, 0x65, 0xbf, 0x2b, 0x43, 0x55, 0x9a, 0x5d, 0xa2, 0xae, 0xc5, 0xbb, 0x8f, 0x43, 0xf9, 0x2c, 0x1b, 0x04, 0xa5, 0x14, 0x6a, 0x65, 0xb6, 0xe0, 0x19, 0xb4, 0xcd, 0xd2, 0x94, 0x0c, 0x35, 0xd9, 0x64, 0x5b, 0x2d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.7", + /* Message */ + 5, + { 0x8a, 0x84, 0x7d, 0xd9, 0xe2 } +, + /* Seed */ + 120, + { 0xa1, 0x3d, 0xff, 0x8a, 0x48, 0xe8, 0x04, 0x94, 0xae, 0x66, 0xe6, 0xba, 0x9f, 0x17, 0x9a, 0x01, 0x0d, 0x9e, 0x6d, 0x40, 0x31, 0x87, 0x96, 0x7f, 0x99, 0xfd, 0xd9, 0x0e, 0xf9, 0x0e, 0x0a, 0x94, 0x07, 0x3f, 0xf0, 0xe4, 0xd0, 0xe6, 0x66, 0x4f, 0xf3, 0x73, 0xb5, 0x09, 0x95, 0x3e, 0x04, 0xef, 0x77, 0x83, 0xbe, 0x0f, 0xb4, 0x6c, 0x8a, 0x9f, 0xc0, 0xed, 0x8c, 0x1f, 0x33, 0xcb, 0x4d, 0x0d, 0x2f, 0x1d, 0x0d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 0x6e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.8", + /* Message */ + 49, + { 0x37, 0x32, 0x36, 0xb7, 0x20, 0x2d, 0x39, 0xb2, 0xee, 0x30, 0xcf, 0xb4, 0x6d, 0xb0, 0x95, 0x11, 0xf6, 0xf3, 0x07, 0xcc, 0x61, 0xcc, 0x21, 0x60, 0x6c, 0x18, 0xa7, 0x5b, 0x8a, 0x62, 0xf8, 0x22, 0xdf, 0x03, 0x1b, 0xa0, 0xe0, 0xe8, 0x2d, 0xd2, 0xf3, 0xe5, 0xd3, 0x1e, 0x4e, 0xa2, 0x57, 0xb1, 0x5b } +, + /* Seed */ + 76, + { 0x21, 0x99, 0x74, 0xa0, 0x87, 0xf0, 0xa2, 0x81, 0x93, 0xe6, 0x49, 0xa0, 0x4a, 0xe9, 0xd8, 0x4c, 0xf2, 0xc8, 0xa9, 0xa4, 0x6c, 0xdf, 0xd8, 0xf1, 0xac, 0x62, 0xc7, 0xe0, 0xf2, 0x0f, 0x4e, 0x27, 0x03, 0x0c, 0x72, 0xb2, 0x0a, 0x5d, 0xb7, 0x25, 0xb4, 0xa8, 0x68, 0x3d, 0xf5, 0x55, 0x6e, 0xe7, 0x94, 0x7f, 0xa0, 0xa7, 0x66, 0x1b, 0x6d, 0x99, 0xdc, 0xb7, 0x9e, 0x49, 0x4f, 0x46, 0x73, 0xf0, 0x73, 0xa0, 0x41, 0xdd, 0x90, 0x7c, 0x87, 0x32, 0x4e, 0x86, 0x25, 0xdd } +, + /* Encryption */ + 128, + { 0x1a, 0x6d, 0xf5, 0x75, 0x99, 0x84, 0xf2, 0xc4, 0x11, 0x93, 0x55, 0xc5, 0xdb, 0x35, 0xc8, 0xa4, 0x78, 0x16, 0x4d, 0x5e, 0x5e, 0xe7, 0x7b, 0x49, 0x91, 0xf1, 0x04, 0xba, 0x91, 0xb9, 0x87, 0x0f, 0x15, 0x91, 0xbe, 0x1f, 0x19, 0xf5, 0x5a, 0x80, 0x51, 0xa6, 0x2c, 0x0e, 0x59, 0x49, 0x3d, 0xf6, 0xf0, 0x0f, 0xe5, 0x0e, 0xf7, 0x3a, 0x6c, 0xf0, 0xc4, 0x35, 0x41, 0xf5, 0x32, 0x0d, 0xab, 0x7b, 0x2f, 0xc6, 0x7c, 0x93, 0x22, 0x5c, 0xcc, 0xd6, 0xd5, 0x03, 0x47, 0xaa, 0x96, 0x9a, 0xd8, 0x7b, 0xd3, 0xd8, 0x20, 0x81, 0x45, 0x4f, 0xea, 0xd8, 0x10, 0xdc, 0x1a, 0xb8, 0xc2, 0x17, 0x81, 0xf7, 0x61, 0x2e, 0x64, 0x06, 0x72, 0x9b, 0x32, 0x2e, 0x04, 0xb1, 0x62, 0x4f, 0x85, 0x38, 0x98, 0x56, 0x59, 0xae, 0x34, 0xd9, 0x93, 0x1e, 0x01, 0x9f, 0x76, 0x2c, 0x79, 0x7d, 0x5c, 0xbf, 0xa3, 0x2d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.9", + /* Message */ + 33, + { 0x97, 0xe0, 0xb6, 0x36, 0xbf, 0xdd, 0xb8, 0xe1, 0xc8, 0xa9, 0xcf, 0x5b, 0x30, 0x5c, 0xef, 0x3a, 0x8f, 0x47, 0xf9, 0xa8, 0xb3, 0x34, 0x4f, 0x13, 0x55, 0xfa, 0x3d, 0xba, 0xb6, 0x7b, 0xb9, 0x72, 0x10 } +, + /* Seed */ + 92, + { 0xc1, 0xf8, 0x9b, 0xcd, 0xc5, 0x60, 0x40, 0xd5, 0xe6, 0x63, 0xb7, 0x4b, 0xfd, 0xe2, 0x39, 0x7b, 0x58, 0x46, 0x08, 0xcd, 0xf3, 0x2d, 0x5a, 0x58, 0x44, 0x72, 0x4a, 0xc7, 0xe5, 0x98, 0xa8, 0x6e, 0xf7, 0x11, 0x4b, 0x1b, 0xe0, 0x87, 0x30, 0xcb, 0x10, 0xf6, 0x61, 0xfb, 0xfb, 0x86, 0x09, 0xf7, 0xc6, 0xc3, 0x74, 0x42, 0xa1, 0xb1, 0x1e, 0x04, 0xa6, 0x11, 0xff, 0x8c, 0xa5, 0xce, 0x9a, 0xfc, 0x1e, 0xb3, 0xaa, 0xa9, 0x2c, 0x9f, 0x28, 0xba, 0xe2, 0x20, 0x44, 0x05, 0x78, 0x99, 0x02, 0x26, 0x07, 0x83, 0x78, 0xc4, 0x93, 0x41, 0x13, 0x74, 0xc5, 0x3e, 0x3d, 0xdc } +, + /* Encryption */ + 128, + { 0x87, 0x3c, 0xc4, 0xdc, 0xa4, 0x27, 0x97, 0x2b, 0x63, 0xc6, 0xcc, 0x8a, 0xc1, 0x1c, 0xcc, 0x33, 0xc9, 0x59, 0xf7, 0xfc, 0xfe, 0x4b, 0x45, 0xbb, 0xd4, 0x7b, 0x29, 0xd9, 0xc9, 0x88, 0xc0, 0x1a, 0x96, 0xbc, 0x1e, 0xae, 0x0e, 0xf9, 0xb1, 0x94, 0x8d, 0xce, 0x2c, 0xc9, 0xf0, 0xaa, 0x91, 0x7e, 0x86, 0xa6, 0xc1, 0x1f, 0x8d, 0xa3, 0xda, 0x29, 0xdf, 0x90, 0x59, 0x01, 0xf1, 0x91, 0x8a, 0x76, 0x16, 0x8d, 0xe1, 0x17, 0x5e, 0x27, 0x35, 0x12, 0x8c, 0x09, 0x72, 0x99, 0xd6, 0x6e, 0xa5, 0xcc, 0xf9, 0xb9, 0x5b, 0x36, 0x92, 0xee, 0xbf, 0xc6, 0xea, 0x11, 0xbc, 0x37, 0x09, 0x1b, 0x79, 0x5f, 0x18, 0x80, 0x3d, 0x70, 0xe7, 0x95, 0x58, 0xe1, 0x25, 0x16, 0x23, 0x0f, 0xed, 0x55, 0x15, 0xe5, 0x1b, 0x45, 0xae, 0x86, 0xce, 0xfe, 0x47, 0xb9, 0x37, 0x90, 0xe4, 0x99, 0x4d, 0xc4, 0x1e, 0x05 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.10", + /* Message */ + 55, + { 0x82, 0xb5, 0x07, 0x5b, 0xfc, 0x88, 0xf4, 0x00, 0x65, 0x76, 0xaa, 0x80, 0xa0, 0x00, 0x7a, 0x74, 0x51, 0x18, 0x4d, 0x4f, 0x76, 0x0c, 0xf9, 0x24, 0x28, 0x04, 0x22, 0x2b, 0x0e, 0x07, 0x26, 0xf5, 0x55, 0x03, 0x0e, 0x4e, 0x6b, 0x01, 0xf7, 0x93, 0xb0, 0x97, 0x01, 0x81, 0x27, 0x82, 0x4a, 0x3e, 0x40, 0x24, 0x57, 0xd8, 0x49, 0x5f, 0xc0 } +, + /* Seed */ + 70, + { 0xd5, 0x5e, 0x3d, 0x48, 0x97, 0xe9, 0xd8, 0x65, 0x01, 0x4c, 0xb1, 0x5d, 0x3e, 0xe3, 0xf9, 0xfb, 0xd2, 0x9c, 0x92, 0xe5, 0xc2, 0x37, 0xdc, 0xae, 0x46, 0x67, 0x2a, 0x46, 0x3e, 0xaa, 0xa4, 0xf7, 0xdd, 0x09, 0x86, 0x1e, 0x94, 0x6a, 0xc6, 0x5b, 0x85, 0x62, 0x50, 0x63, 0x93, 0xb8, 0x51, 0x92, 0xad, 0x41, 0xfb, 0x0c, 0x48, 0xc8, 0xc0, 0x52, 0x98, 0x1b, 0xdd, 0xcd, 0x5f, 0x1f, 0xc8, 0xb1, 0x39, 0xcd, 0x47, 0xca, 0xcf, 0xfc } +, + /* Encryption */ + 128, + { 0x2e, 0x83, 0xc3, 0xd2, 0x88, 0x01, 0x5a, 0x5f, 0x50, 0x3d, 0x3e, 0x5d, 0xe7, 0xd2, 0xad, 0x91, 0x06, 0x54, 0x5e, 0xf9, 0x7d, 0x63, 0xe4, 0xd0, 0x6a, 0x5a, 0x0d, 0x9d, 0xbc, 0x29, 0xf6, 0xba, 0xfb, 0x93, 0xa5, 0x17, 0x3f, 0xa5, 0x06, 0x3a, 0x69, 0x39, 0xdb, 0xa6, 0xc7, 0xa4, 0x28, 0xc3, 0x5e, 0x7d, 0xbe, 0x6a, 0x95, 0x93, 0xfe, 0x5e, 0xc4, 0xc1, 0x98, 0x78, 0x89, 0x3f, 0x31, 0x37, 0x09, 0xc8, 0x76, 0x02, 0x72, 0x6c, 0xb3, 0x25, 0x5b, 0xe7, 0x5a, 0xdc, 0x7f, 0x2f, 0x27, 0xe6, 0xdb, 0x91, 0xc3, 0xa3, 0x43, 0xea, 0xff, 0x1c, 0x28, 0xd9, 0xd5, 0xf7, 0xcb, 0x65, 0x74, 0xe6, 0x31, 0x06, 0x90, 0x03, 0xcd, 0xcf, 0xa0, 0x77, 0x43, 0xa7, 0x34, 0x0d, 0x58, 0x83, 0x9e, 0x70, 0x8b, 0xf3, 0x6a, 0xf6, 0x34, 0x2d, 0xb8, 0xdf, 0xa4, 0x1f, 0xea, 0xda, 0xfc, 0x69, 0x53, 0xac } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.11", + /* Message */ + 34, + { 0x36, 0x48, 0xc3, 0x6f, 0x85, 0x1f, 0x52, 0xf2, 0x32, 0x87, 0x79, 0x09, 0x19, 0x85, 0xa3, 0xc8, 0x12, 0xe1, 0x8a, 0x70, 0x55, 0xd0, 0x90, 0xbb, 0xf0, 0x32, 0x4c, 0x13, 0x79, 0x3b, 0xb8, 0x22, 0x1a, 0x57 } +, + /* Seed */ + 91, + { 0xc1, 0x27, 0x71, 0x85, 0xc3, 0x59, 0x55, 0xca, 0xed, 0xfd, 0xf9, 0xde, 0x55, 0xd5, 0xd9, 0x5a, 0x39, 0x8d, 0x58, 0xf5, 0xf3, 0x33, 0x19, 0x1f, 0xc0, 0x29, 0x45, 0xef, 0xdf, 0xad, 0xfb, 0x6d, 0xb0, 0x5e, 0xe2, 0xa2, 0xd3, 0x41, 0x83, 0xed, 0xf8, 0x9a, 0x1a, 0x4d, 0xcc, 0xc4, 0x65, 0x91, 0xb3, 0x53, 0x2b, 0xa7, 0x03, 0x93, 0x62, 0xc7, 0x5d, 0xf1, 0x94, 0xec, 0x10, 0x64, 0x48, 0xaf, 0xb7, 0xf6, 0xbf, 0xb2, 0x80, 0x7e, 0x38, 0x3e, 0x15, 0x99, 0x54, 0x25, 0x5e, 0x82, 0x7c, 0xb9, 0xda, 0xdc, 0x8d, 0x9b, 0x7e, 0x68, 0xa1, 0xaa, 0x09, 0x76, 0x35 } +, + /* Encryption */ + 128, + { 0x88, 0x62, 0xf1, 0x97, 0x3f, 0xef, 0xe0, 0xaf, 0x02, 0xd9, 0x6c, 0xc4, 0x58, 0x33, 0x4d, 0xed, 0x6c, 0x02, 0xd8, 0xd7, 0xea, 0xf5, 0x93, 0x77, 0x9c, 0x5d, 0x38, 0x6c, 0x4e, 0x49, 0xf7, 0x68, 0xf1, 0x30, 0xb4, 0x87, 0xb3, 0xc9, 0x1e, 0x32, 0x3a, 0x47, 0x7e, 0x4c, 0x11, 0x0a, 0x33, 0x41, 0xff, 0x46, 0xee, 0xe3, 0x7c, 0x77, 0x3e, 0x5c, 0x0a, 0xc8, 0x39, 0xbc, 0x55, 0xcc, 0x0c, 0x07, 0x0c, 0xac, 0x01, 0xcd, 0x45, 0x18, 0x3c, 0xfe, 0xe6, 0xb8, 0x8b, 0xfb, 0x82, 0x36, 0x1d, 0x35, 0x60, 0x19, 0x7c, 0xde, 0xab, 0x42, 0xe5, 0xc7, 0x55, 0xd2, 0x37, 0x97, 0x1a, 0x88, 0xda, 0xf6, 0x10, 0xcb, 0x39, 0x52, 0x61, 0x4b, 0x36, 0x40, 0x56, 0xcd, 0x49, 0x14, 0x20, 0xef, 0xfe, 0x3a, 0x0b, 0x8c, 0xe3, 0x1f, 0x2e, 0x3e, 0x49, 0xca, 0xd6, 0xf3, 0xb0, 0x64, 0x0f, 0x44, 0x91, 0xde } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.12", + /* Message */ + 20, + { 0x94, 0xf7, 0x8c, 0xf4, 0x5c, 0x53, 0xfc, 0x46, 0xe7, 0xeb, 0x1b, 0x26, 0x61, 0x8a, 0x29, 0xe9, 0x48, 0x50, 0x12, 0xc1 } +, + /* Seed */ + 105, + { 0xe6, 0xde, 0x9e, 0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0x90, 0x3b, 0x10, 0x43, 0xce, 0x79, 0x49, 0x4c, 0x57, 0x54, 0xf7, 0xf9, 0x0f, 0xc1, 0xf0, 0x73, 0xa6, 0x19, 0x92, 0x9e, 0xf1, 0x26, 0x39, 0x4b, 0x06, 0x24, 0xf3, 0xb8, 0xba, 0x6d, 0x56, 0x45, 0xe9, 0x90, 0xe7, 0xc0, 0x13, 0x2c, 0xe2, 0x12, 0x31, 0x46, 0xfd, 0x9c, 0xad, 0xf7, 0x45, 0xec, 0x61 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.13", + /* Message */ + 35, + { 0x77, 0x9d, 0x1e, 0xb8, 0x4f, 0xa2, 0x84, 0xc3, 0x7d, 0x29, 0xd5, 0xe1, 0x79, 0xd0, 0x03, 0x06, 0xb4, 0x13, 0xc4, 0x4a, 0x80, 0x0a, 0x07, 0x7e, 0x59, 0x85, 0x3f, 0x63, 0x05, 0xf9, 0x2e, 0x59, 0xfb, 0x7f, 0x81 } +, + /* Seed */ + 90, + { 0xc3, 0xe6, 0xd1, 0x8b, 0xda, 0x97, 0x78, 0x2c, 0xa7, 0x81, 0xfa, 0x76, 0xd9, 0x7a, 0x6c, 0x94, 0xd8, 0x54, 0xd1, 0x41, 0x99, 0xb4, 0xea, 0x7d, 0x82, 0xc5, 0xbc, 0xbb, 0xe6, 0xcd, 0xaa, 0xb5, 0x25, 0x57, 0x47, 0x44, 0x3c, 0x59, 0xbf, 0x8c, 0x77, 0xec, 0xda, 0xa6, 0x4a, 0xe7, 0xce, 0x61, 0xe2, 0xc7, 0x30, 0x01, 0x32, 0xb7, 0x54, 0xe9, 0x16, 0x2f, 0x7c, 0xde, 0x75, 0x8f, 0x48, 0x0a, 0xe5, 0x88, 0xcf, 0xd4, 0x4a, 0x94, 0x6d, 0x64, 0xe2, 0x72, 0x0a, 0x2d, 0x17, 0x52, 0x55, 0x45, 0x22, 0x04, 0x84, 0x83, 0x81, 0x18, 0xad, 0x6e, 0x6b, 0x54 } +, + /* Encryption */ + 128, + { 0x72, 0x2c, 0xa9, 0x25, 0x66, 0xc7, 0x3c, 0xc8, 0x5d, 0x19, 0xce, 0x3f, 0xaa, 0x14, 0xcb, 0x2e, 0x79, 0x84, 0x9f, 0x20, 0x50, 0x92, 0xd1, 0x58, 0x92, 0x82, 0x31, 0x3c, 0x04, 0x27, 0xf0, 0x67, 0x79, 0x8a, 0xfa, 0xe3, 0xe3, 0xf0, 0xa5, 0x61, 0xf3, 0x99, 0x34, 0x6e, 0x9d, 0x10, 0x7d, 0xa0, 0x4a, 0xf4, 0x4b, 0x0c, 0x6f, 0x04, 0x4a, 0xde, 0xfe, 0x09, 0x7a, 0x0c, 0xd1, 0x4a, 0x47, 0xa9, 0x9c, 0xd9, 0x81, 0x9a, 0x98, 0x41, 0x37, 0x06, 0x30, 0x7c, 0xbd, 0x0d, 0xa0, 0x16, 0x97, 0x46, 0x9e, 0xff, 0x71, 0xd3, 0x14, 0x41, 0x63, 0x94, 0x93, 0xfb, 0xed, 0x8e, 0xee, 0x1b, 0xa3, 0x9f, 0xdd, 0x07, 0xfc, 0x0e, 0xa0, 0x82, 0x30, 0x18, 0x61, 0x79, 0xf9, 0x0e, 0x7e, 0xf1, 0x3c, 0x61, 0xee, 0x56, 0xf1, 0x67, 0xfc, 0x2f, 0x6b, 0x15, 0x79, 0x3e, 0x1a, 0x32, 0x24, 0xff, 0xa2, 0x9e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.14", + /* Message */ + 1, + { 0x88 } +, + /* Seed */ + 124, + { 0xc0, 0x16, 0x9d, 0x76, 0xe4, 0xea, 0x45, 0x45, 0x41, 0x0d, 0xdf, 0x66, 0x46, 0xc1, 0xba, 0x7d, 0xd2, 0x72, 0xd7, 0xc3, 0x49, 0x8b, 0xa6, 0xb0, 0x80, 0x4b, 0x42, 0x61, 0x30, 0xa8, 0x0f, 0xbf, 0xff, 0x4b, 0xb7, 0xb5, 0xf5, 0x59, 0xb0, 0xa9, 0x09, 0x0e, 0x4a, 0xd9, 0xb9, 0xf4, 0x16, 0xa6, 0xdf, 0xdc, 0x15, 0x01, 0xb1, 0xba, 0x46, 0x87, 0x7b, 0x1a, 0x96, 0xfa, 0x84, 0x91, 0xdc, 0xfd, 0xde, 0x50, 0xeb, 0xee, 0xd2, 0x4d, 0x3f, 0x98, 0x96, 0x24, 0x13, 0x34, 0x6e, 0xd4, 0xa3, 0x39, 0x3e, 0x23, 0x5b, 0x77, 0xbc, 0x1e, 0xd6, 0x74, 0x68, 0xec, 0xe2, 0x79, 0x2a, 0x2f, 0xd3, 0xa8, 0x34, 0x8f, 0xc5, 0x50, 0x9b, 0x59, 0x06, 0xf2, 0x88, 0x56, 0x15, 0xdf, 0x8c, 0x14, 0x61, 0x37, 0x7a, 0x74, 0x1d, 0x59, 0x52, 0xfb, 0x36, 0xea, 0xc0, 0x20, 0x1e, 0x27 } +, + /* Encryption */ + 128, + { 0x4e, 0xd7, 0xd1, 0x29, 0x1a, 0x03, 0x36, 0x65, 0x4d, 0x5c, 0xa2, 0xb1, 0xf9, 0xd2, 0x0c, 0xb2, 0xda, 0x72, 0x26, 0xf7, 0x11, 0x6b, 0x93, 0x09, 0x88, 0x43, 0x9b, 0x44, 0x63, 0x98, 0x11, 0x04, 0xbd, 0x63, 0xc2, 0xce, 0x2b, 0x77, 0xd6, 0x26, 0xb3, 0x10, 0x9c, 0x93, 0x14, 0x03, 0xac, 0x5b, 0x49, 0xb4, 0x24, 0x7c, 0x4f, 0x69, 0x67, 0xb8, 0xc0, 0xdb, 0x06, 0x3c, 0x99, 0x95, 0xaf, 0x9d, 0x36, 0x54, 0x06, 0x50, 0x93, 0x8b, 0x01, 0xf9, 0x39, 0x06, 0xf9, 0x83, 0x89, 0x07, 0xed, 0x59, 0x36, 0xab, 0xb3, 0x43, 0xb0, 0xe2, 0x55, 0x09, 0xa1, 0xd2, 0xd4, 0xc5, 0xc8, 0xb9, 0x58, 0x06, 0x50, 0xda, 0x2c, 0xe1, 0x1f, 0xa3, 0xcf, 0x3e, 0x64, 0x07, 0x23, 0xea, 0xcb, 0xee, 0x87, 0xfa, 0xd3, 0xee, 0x35, 0x95, 0x8b, 0x45, 0x07, 0x5d, 0xf7, 0x81, 0xc4, 0x13, 0x46, 0x6a, 0xf1, 0x39 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.15", + /* Message */ + 51, + { 0xa2, 0xdc, 0x08, 0x77, 0x78, 0xd5, 0x43, 0x40, 0x8e, 0x89, 0x73, 0xf1, 0x36, 0x31, 0x59, 0xed, 0xb8, 0xf0, 0x78, 0x3c, 0x45, 0x70, 0x89, 0x07, 0x2d, 0xce, 0x66, 0xd3, 0x10, 0x2b, 0xb4, 0xfa, 0xe6, 0x0a, 0xa6, 0x0e, 0x41, 0x93, 0x3c, 0x48, 0xa1, 0xbe, 0x39, 0x53, 0xec, 0x2f, 0x80, 0x4c, 0x0c, 0xc9, 0x6c } +, + /* Seed */ + 74, + { 0x18, 0x11, 0x20, 0x14, 0x06, 0x53, 0x29, 0xd0, 0x4b, 0xfb, 0x0c, 0xf5, 0x44, 0xdd, 0x38, 0xd7, 0xbe, 0xf1, 0x54, 0x9b, 0x4a, 0x49, 0xa1, 0x67, 0x76, 0xdd, 0xa7, 0x4d, 0x0a, 0x7e, 0xdc, 0x49, 0x67, 0xb4, 0x24, 0x0c, 0x37, 0x14, 0x2f, 0xa3, 0xf6, 0x63, 0x9c, 0x26, 0x96, 0xcd, 0x7d, 0x4b, 0x18, 0xa1, 0x1e, 0x2f, 0xb5, 0x40, 0x81, 0xf2, 0xde, 0x5b, 0xd7, 0xbd, 0x15, 0xcd, 0xda, 0x92, 0xc9, 0x4c, 0x3a, 0x47, 0x18, 0x7b, 0x5f, 0xf4, 0x3b, 0x53 } +, + /* Encryption */ + 128, + { 0x71, 0x15, 0x19, 0x0a, 0x21, 0x04, 0x88, 0xf0, 0x4f, 0xa0, 0xc0, 0x0c, 0x93, 0xa4, 0x68, 0xa8, 0x03, 0x0b, 0x7b, 0x9f, 0xc1, 0x00, 0x20, 0xd8, 0x31, 0x0b, 0xcb, 0x01, 0xa5, 0xc8, 0xdd, 0xa1, 0xd0, 0x6c, 0xe2, 0x41, 0xdc, 0x77, 0x5b, 0x43, 0xe6, 0xf1, 0x3b, 0x19, 0xab, 0xfc, 0xbf, 0x36, 0x16, 0xe8, 0x4f, 0x10, 0x7c, 0x9e, 0xd8, 0x0d, 0x1b, 0x86, 0xbf, 0x87, 0xc9, 0x8c, 0x2b, 0x62, 0x9f, 0xfa, 0xda, 0xa6, 0xec, 0x01, 0xf4, 0xe6, 0x75, 0x55, 0x8e, 0xf5, 0x26, 0x06, 0xea, 0xf1, 0x26, 0x06, 0x8f, 0xa7, 0x53, 0x4d, 0xd1, 0x3b, 0x92, 0x0d, 0x23, 0x81, 0x69, 0x5a, 0xd7, 0x75, 0xff, 0xf0, 0xbb, 0x7c, 0xec, 0x46, 0x90, 0x90, 0x1d, 0x6f, 0x1e, 0x17, 0x36, 0xb8, 0x2c, 0xfe, 0x3a, 0x0c, 0x22, 0x4d, 0x18, 0xf1, 0x29, 0x15, 0xfd, 0xc9, 0x5c, 0x18, 0x39, 0x7c, 0x35, 0x70 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.16", + /* Message */ + 36, + { 0x11, 0x0b, 0xf2, 0xb1, 0xd0, 0xdd, 0x81, 0x2f, 0x2a, 0x5a, 0x21, 0xf3, 0x40, 0x4f, 0xa2, 0xf2, 0xc4, 0x54, 0xc4, 0x43, 0x2f, 0xdf, 0xa7, 0x0f, 0x1b, 0x0f, 0x23, 0xec, 0x69, 0xc1, 0x02, 0x37, 0x73, 0xa7, 0x3a, 0xba } +, + /* Seed */ + 89, + { 0x17, 0xb8, 0x5f, 0x76, 0x53, 0xff, 0x0e, 0xf5, 0xde, 0x7f, 0x25, 0x69, 0x6c, 0xd4, 0x90, 0x23, 0xad, 0x8e, 0xac, 0x94, 0x8a, 0x83, 0xe2, 0x24, 0x58, 0xec, 0xd5, 0xd1, 0x0a, 0x43, 0x86, 0x6d, 0xc7, 0x91, 0x55, 0x5e, 0x64, 0xf0, 0x78, 0xc3, 0x8c, 0x75, 0x2b, 0x6e, 0x9c, 0x6e, 0xee, 0xb3, 0x39, 0xee, 0xc9, 0x10, 0x16, 0xd2, 0x58, 0x88, 0x6d, 0x01, 0x27, 0x75, 0xad, 0x64, 0x36, 0x02, 0xa0, 0xf0, 0xd1, 0x79, 0x34, 0x54, 0xa0, 0x60, 0x94, 0x71, 0x16, 0x22, 0x88, 0x22, 0x39, 0x50, 0x82, 0x6e, 0xd8, 0xe2, 0x02, 0x5d, 0xa9, 0xa4, 0xe9 } +, + /* Encryption */ + 128, + { 0x5d, 0x0f, 0x2f, 0xd8, 0x5e, 0x6f, 0x9d, 0x9e, 0x43, 0x2f, 0xad, 0x86, 0x0f, 0xdc, 0x49, 0x96, 0x96, 0x24, 0xff, 0x4f, 0xa0, 0x71, 0x5d, 0x36, 0x1e, 0x9f, 0x00, 0xb0, 0x5b, 0x3a, 0xa0, 0xba, 0x9e, 0xb2, 0x7b, 0xae, 0x61, 0x0e, 0xfd, 0xe1, 0x14, 0x3c, 0xbc, 0x93, 0x3b, 0x52, 0xde, 0xa7, 0x01, 0x87, 0x60, 0xbb, 0x25, 0x1b, 0xe0, 0xe1, 0xe3, 0x0c, 0xd1, 0xc5, 0x99, 0x1a, 0xef, 0x74, 0x4d, 0xb8, 0x2f, 0x16, 0x6b, 0x90, 0x63, 0xef, 0xb7, 0xe3, 0x38, 0x40, 0xa2, 0x56, 0x90, 0x05, 0x65, 0x4b, 0x14, 0x0e, 0x11, 0x5f, 0xa5, 0x6c, 0x30, 0x40, 0x6e, 0x45, 0x65, 0x6e, 0x81, 0x99, 0xaf, 0x39, 0x4f, 0x63, 0x86, 0x34, 0x6d, 0x5f, 0x1a, 0x30, 0x0b, 0x95, 0xba, 0x48, 0xfc, 0x08, 0x73, 0xd6, 0x18, 0xd6, 0x92, 0xbb, 0x02, 0x5b, 0xf1, 0x5e, 0x9d, 0x23, 0x2c, 0x64, 0x1a, 0xda } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.17", + /* Message */ + 60, + { 0xd9, 0xd9, 0x37, 0x13, 0x1f, 0xf1, 0x94, 0x0a, 0x86, 0xbf, 0x71, 0x39, 0xb4, 0x81, 0x14, 0x36, 0x41, 0x95, 0xb4, 0x00, 0x52, 0x22, 0xa8, 0xbb, 0xbc, 0x26, 0x1a, 0x7f, 0x2e, 0x21, 0x2b, 0x8d, 0xd0, 0x35, 0xe5, 0x3f, 0x91, 0x44, 0xf5, 0x61, 0x0b, 0x4c, 0xec, 0x32, 0xea, 0x01, 0xbd, 0xa9, 0xd3, 0xc8, 0x0c, 0xf2, 0x94, 0x64, 0xf8, 0x0f, 0x5f, 0x56, 0x56, 0xc8 } +, + /* Seed */ + 65, + { 0x33, 0x05, 0xe1, 0xda, 0x60, 0xe5, 0x86, 0x73, 0xfc, 0x46, 0xcd, 0x33, 0xbe, 0x2a, 0x66, 0xd3, 0xa1, 0x02, 0xc3, 0xdb, 0x16, 0x1e, 0xf4, 0x8c, 0x0d, 0x60, 0xef, 0x25, 0x03, 0x1b, 0x40, 0x14, 0x16, 0x78, 0x26, 0x24, 0x6a, 0xa5, 0x28, 0xa3, 0xa3, 0xe5, 0xb0, 0xab, 0x95, 0x07, 0x8d, 0x84, 0x01, 0xd9, 0x29, 0x03, 0x59, 0x5a, 0xfc, 0x1a, 0xa8, 0x54, 0xe6, 0x04, 0x4e, 0x5e, 0xb5, 0xf5, 0xbe } +, + /* Encryption */ + 128, + { 0x0e, 0x12, 0x16, 0x74, 0x89, 0xf0, 0xba, 0xef, 0xca, 0xd6, 0x39, 0x34, 0xbc, 0x15, 0x9f, 0x1b, 0xbd, 0x9e, 0x9b, 0x28, 0x7e, 0x50, 0x0f, 0x49, 0x09, 0x23, 0xc1, 0x6a, 0x85, 0x56, 0x4a, 0x1d, 0xa6, 0x36, 0x59, 0x37, 0x5f, 0x22, 0xaf, 0x7b, 0xa4, 0x97, 0x98, 0xe1, 0x57, 0x8c, 0xf3, 0x15, 0xfa, 0xe3, 0xe9, 0xed, 0x56, 0x99, 0xc6, 0x91, 0xe3, 0xc1, 0xd0, 0xbb, 0x46, 0xda, 0x49, 0x2d, 0x01, 0x34, 0x9e, 0x93, 0x29, 0x59, 0x3d, 0x43, 0x81, 0xd0, 0x74, 0xa0, 0xa5, 0x31, 0xdf, 0x92, 0x1b, 0x31, 0x31, 0x6f, 0x7e, 0x2b, 0x4f, 0xe9, 0x15, 0x34, 0x72, 0x83, 0x24, 0x23, 0x35, 0xf0, 0xb0, 0xb2, 0x31, 0x92, 0xc7, 0x21, 0x02, 0xf2, 0xc6, 0x36, 0x24, 0xb1, 0xe7, 0x89, 0x65, 0x45, 0x0e, 0x82, 0x30, 0xd4, 0x87, 0x7e, 0x46, 0x17, 0xb0, 0x3d, 0x44, 0x83, 0x13, 0x98, 0xdd, 0xbf } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.18", + /* Message */ + 8, + { 0x81, 0xb3, 0x4a, 0xeb, 0x8a, 0xfb, 0x8a, 0x3f } +, + /* Seed */ + 117, + { 0x02, 0xf7, 0x48, 0x34, 0x2d, 0x01, 0x0f, 0xb5, 0x6a, 0x6f, 0x69, 0xf2, 0x1f, 0x8c, 0x6a, 0x63, 0x16, 0x79, 0xc8, 0xc4, 0xb8, 0xf6, 0xfe, 0xb5, 0x25, 0xcf, 0x8e, 0x72, 0xfd, 0xa8, 0xef, 0x8d, 0xf6, 0x62, 0x31, 0x28, 0xc0, 0xfe, 0x74, 0xbc, 0x59, 0x0c, 0xaa, 0x34, 0xf1, 0xee, 0xd1, 0xad, 0x2d, 0x61, 0x42, 0xdc, 0xc5, 0xbc, 0xae, 0x84, 0xef, 0x31, 0x37, 0x62, 0xf2, 0xe4, 0xe7, 0x03, 0x03, 0xd2, 0x09, 0xc8, 0xd9, 0x57, 0x7a, 0x7c, 0x84, 0x3d, 0x2b, 0x91, 0x72, 0xed, 0x4e, 0xfe, 0x2a, 0xd6, 0x29, 0x61, 0x4b, 0x99, 0xa9, 0x1a, 0x4c, 0xc8, 0x32, 0x5b, 0xa3, 0x24, 0x11, 0x6e, 0xcf, 0x0c, 0x5e, 0x29, 0x09, 0x49, 0x38, 0xae, 0x49, 0x89, 0x84, 0xf4, 0xf4, 0xcb, 0xb1, 0x62, 0x38, 0x86, 0xe0, 0x39, 0x73 } +, + /* Encryption */ + 128, + { 0x43, 0xb2, 0x76, 0xc7, 0xd3, 0x68, 0xea, 0x21, 0xc6, 0x80, 0x71, 0x16, 0xcd, 0xe8, 0x60, 0x82, 0x98, 0xf2, 0x40, 0x02, 0x07, 0x2d, 0x77, 0x6e, 0x56, 0xe6, 0x2c, 0x35, 0x72, 0xbf, 0xb9, 0x9d, 0xa4, 0xc5, 0x6e, 0x93, 0x8a, 0x47, 0xdc, 0x07, 0x5f, 0xa1, 0xff, 0x7a, 0x61, 0x8f, 0xb5, 0xfa, 0xed, 0x3e, 0xe3, 0x7b, 0x91, 0xdf, 0xc3, 0x91, 0x53, 0x49, 0x5a, 0xeb, 0xa9, 0xdf, 0x6d, 0x45, 0xdf, 0x94, 0xb0, 0xe8, 0xa8, 0xad, 0x2d, 0xb3, 0x7a, 0x9f, 0xe4, 0x6d, 0x0f, 0xdf, 0x15, 0x42, 0x31, 0xfd, 0x6f, 0x32, 0x21, 0x47, 0x4e, 0x8f, 0x5c, 0x19, 0x1f, 0xdb, 0x85, 0x38, 0xe1, 0xa6, 0x03, 0xe5, 0x98, 0x97, 0xe1, 0x50, 0xfa, 0xf9, 0x5b, 0x65, 0xda, 0x14, 0x06, 0x67, 0xed, 0xb1, 0x98, 0x09, 0xeb, 0x4a, 0x16, 0xac, 0xd0, 0x1e, 0xcc, 0x60, 0x4b, 0xda, 0x57, 0xf2, 0x0e, 0xf2 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.19", + /* Message */ + 10, + { 0x7b, 0xf9, 0xfa, 0xd8, 0x89, 0xde, 0x73, 0xed, 0x87, 0x3d } +, + /* Seed */ + 115, + { 0xfa, 0x5d, 0xad, 0x45, 0xa4, 0xbb, 0x5e, 0x74, 0xc4, 0xcf, 0x2e, 0x21, 0x3e, 0xd4, 0x0a, 0xa9, 0x61, 0x75, 0x98, 0xd1, 0x1d, 0x49, 0xae, 0x1c, 0x32, 0xd7, 0x94, 0xe0, 0x9c, 0xd0, 0xe5, 0xc7, 0xaa, 0xae, 0x81, 0xb9, 0x55, 0x4d, 0xde, 0x31, 0x08, 0xd6, 0x0a, 0x9a, 0x82, 0xf4, 0x2c, 0xc6, 0xc2, 0xa6, 0x89, 0xf4, 0x60, 0xff, 0x1d, 0x53, 0xad, 0x85, 0xbf, 0x83, 0x83, 0x11, 0xe7, 0x58, 0x9e, 0x19, 0x67, 0x95, 0x7b, 0x51, 0x56, 0x7a, 0xa0, 0xd3, 0x3a, 0xfa, 0x37, 0x52, 0xcd, 0xe6, 0xc5, 0x66, 0x1d, 0x4f, 0x27, 0xae, 0xd3, 0xdf, 0x52, 0x90, 0x5f, 0x1c, 0xf2, 0x25, 0x33, 0x04, 0x61, 0x8e, 0x07, 0x86, 0x04, 0x1e, 0x70, 0xb4, 0xdc, 0xba, 0xc8, 0xc1, 0x08, 0xba, 0x34, 0xac, 0x39, 0x39, 0xf4 } +, + /* Encryption */ + 128, + { 0x61, 0xc2, 0x55, 0x0e, 0x0b, 0x36, 0xa6, 0x79, 0x7f, 0xf8, 0x64, 0x93, 0x80, 0x1b, 0x11, 0x46, 0xd8, 0x90, 0x59, 0x49, 0x83, 0x52, 0xe4, 0xc2, 0x62, 0x27, 0x5b, 0x14, 0x04, 0xb1, 0x33, 0x15, 0xe9, 0x56, 0xbb, 0x3d, 0x31, 0x21, 0x85, 0xb5, 0x21, 0xb3, 0xc7, 0x08, 0xe9, 0xd9, 0x54, 0x02, 0x17, 0x19, 0xa0, 0x59, 0xd9, 0x84, 0x72, 0x4c, 0x53, 0xc0, 0x4f, 0x5a, 0xd2, 0x74, 0xbe, 0xf9, 0xff, 0x0a, 0x79, 0x50, 0xb2, 0xfd, 0xec, 0xc5, 0x29, 0x0c, 0xd5, 0xf3, 0xbc, 0x26, 0x52, 0x4c, 0xd1, 0x34, 0x20, 0x48, 0x18, 0x4b, 0x0e, 0x2c, 0xdf, 0x94, 0x06, 0xa4, 0x53, 0xa2, 0xef, 0x9f, 0x3b, 0xb2, 0x3c, 0x4e, 0x7c, 0x1c, 0x8b, 0x29, 0x52, 0xa0, 0x20, 0x2b, 0xcc, 0x23, 0x82, 0x47, 0xea, 0x32, 0x7b, 0x8c, 0x07, 0x00, 0xc8, 0x00, 0x3f, 0xd6, 0x34, 0xec, 0x1e, 0xd9, 0xbf, 0x30 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 1.20", + /* Message */ + 31, + { 0xb6, 0xa3, 0x50, 0x9b, 0xb3, 0xb9, 0xb0, 0xb5, 0x7c, 0xd5, 0x8d, 0xe4, 0x09, 0xd9, 0x53, 0x20, 0x1a, 0x04, 0x2f, 0x94, 0x92, 0xdc, 0x1d, 0x7e, 0x34, 0xa7, 0xd0, 0x94, 0x1a, 0x1a, 0x1b } +, + /* Seed */ + 94, + { 0x3a, 0x9e, 0x15, 0x06, 0x57, 0x86, 0xb3, 0xe0, 0x1d, 0x82, 0x6b, 0x86, 0x2a, 0x8f, 0x70, 0x2b, 0x5c, 0xac, 0x8c, 0x16, 0x62, 0xee, 0x7d, 0x15, 0xff, 0x32, 0x3c, 0xdf, 0xe7, 0x1e, 0xbf, 0x4a, 0xd1, 0xb1, 0xf3, 0xa6, 0xbc, 0xbd, 0xd4, 0xb0, 0x01, 0x08, 0x77, 0xec, 0xac, 0x09, 0x1f, 0x61, 0x59, 0x08, 0xe2, 0xbe, 0x40, 0x0b, 0xb0, 0xc4, 0x98, 0xe3, 0x55, 0xd5, 0x71, 0xfd, 0x10, 0x89, 0x5b, 0x8e, 0xe9, 0xc3, 0xa9, 0xc3, 0x1e, 0x4b, 0x11, 0x03, 0x89, 0xc3, 0xd5, 0xc4, 0x6e, 0xbf, 0x76, 0xb3, 0xb3, 0x5a, 0xd1, 0xf4, 0x79, 0x1b, 0x6d, 0x20, 0x97, 0xf1, 0x09, 0xf2 } +, + /* Encryption */ + 128, + { 0x6b, 0x4b, 0x6d, 0x7b, 0xab, 0xfe, 0x4d, 0x64, 0x17, 0xac, 0xad, 0xfb, 0x78, 0x57, 0x2e, 0x7c, 0x87, 0xe3, 0xfe, 0x1b, 0xd5, 0x8e, 0xef, 0xb0, 0xd4, 0xb1, 0x27, 0x9c, 0x7b, 0x7c, 0x83, 0x26, 0xa6, 0x8b, 0xb2, 0x87, 0x95, 0xe0, 0x9f, 0x9b, 0x1c, 0xe2, 0xe2, 0x4a, 0x53, 0x9f, 0x4b, 0x0d, 0x93, 0xb2, 0x92, 0x74, 0xce, 0xcf, 0x7c, 0xd9, 0xf0, 0xb7, 0x32, 0xae, 0xbe, 0xda, 0x91, 0x11, 0xbd, 0xfe, 0x25, 0xe2, 0x68, 0xa8, 0x8e, 0x34, 0x22, 0xe2, 0x9b, 0x52, 0xbd, 0x4b, 0x7a, 0x05, 0x47, 0xdb, 0x8f, 0xe1, 0x2a, 0x6f, 0xcf, 0x1a, 0x3c, 0x06, 0xa0, 0x02, 0xbf, 0x87, 0x0a, 0x2f, 0xab, 0xb7, 0xc4, 0x57, 0xe4, 0xbb, 0xce, 0x3e, 0x31, 0x6f, 0x72, 0x32, 0x44, 0x9f, 0x87, 0xa9, 0xd7, 0x02, 0xb1, 0x2d, 0x19, 0xbd, 0xe7, 0xf9, 0x59, 0x0f, 0x94, 0x67, 0xb0, 0x6b, 0xd5, 0x8a } + +} +, +} +}, +{ + "Example 2: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0x98, 0xb7, 0x05, 0x82, 0xca, 0x80, 0x8f, 0xd1, 0xd3, 0x50, 0x95, 0x62, 0xa0, 0xef, 0x30, 0x5a, 0xf6, 0xd9, 0x87, 0x54, 0x43, 0xb3, 0x5b, 0xdf, 0x24, 0xd5, 0x36, 0x35, 0x3e, 0x3f, 0x12, 0x28, 0xdc, 0xd1, 0x2a, 0x78, 0x56, 0x83, 0x56, 0xc6, 0xff, 0x32, 0x3a, 0xbf, 0x72, 0xac, 0x1c, 0xdb, 0xfe, 0x71, 0x2f, 0xb4, 0x9f, 0xe5, 0x94, 0xa5, 0xa2, 0x17, 0x5d, 0x48, 0xb6, 0x73, 0x25, 0x38, 0xd8, 0xdf, 0x37, 0xcb, 0x97, 0x0b, 0xe4, 0xa5, 0xb5, 0x62, 0xc3, 0xf2, 0x98, 0xdb, 0x9d, 0xdf, 0x75, 0x60, 0x78, 0x77, 0x91, 0x8c, 0xce, 0xd1, 0xd0, 0xd1, 0xf3, 0x77, 0x33, 0x8c, 0x0d, 0x3d, 0x32, 0x07, 0x79, 0x7e, 0x86, 0x2c, 0x65, 0xd1, 0x14, 0x39, 0xe5, 0x88, 0x17, 0x75, 0x27, 0xa7, 0xde, 0xd9, 0x19, 0x71, 0xad, 0xcf, 0x91, 0xe2, 0xe8, 0x34, 0xe3, 0x7f, 0x05, 0xa7, 0x36, 0x55 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x06, 0x14, 0xa7, 0x86, 0x05, 0x2d, 0x28, 0x4c, 0xd9, 0x06, 0xa8, 0xe4, 0x13, 0xf7, 0x62, 0x2c, 0x05, 0x0f, 0x35, 0x49, 0xc0, 0x26, 0x58, 0x9e, 0xa2, 0x77, 0x50, 0xe0, 0xbe, 0xd9, 0x41, 0x0e, 0x5a, 0x78, 0x83, 0xa1, 0xe6, 0x03, 0xf5, 0xc5, 0x17, 0xad, 0x36, 0xd4, 0x9f, 0xaa, 0xc5, 0xbd, 0x66, 0xbc, 0xb8, 0x03, 0x0f, 0xa8, 0xd3, 0x09, 0xe3, 0x51, 0xdd, 0xd7, 0x82, 0xd8, 0x43, 0xdf, 0x97, 0x56, 0x80, 0xae, 0x73, 0xee, 0xa9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, 0xe8, 0xc0, 0xcd, 0x8f, 0xbf, 0x24, 0x9c, 0x33 } +, + /* Prime exponent 1 */ + 64, + { 0x94, 0x4c, 0x3a, 0x65, 0x79, 0x57, 0x4c, 0xf7, 0x87, 0x33, 0x62, 0xab, 0x14, 0x35, 0x9c, 0xb7, 0xd5, 0x03, 0x93, 0xc2, 0xa8, 0x4f, 0x59, 0xf0, 0xbd, 0x3c, 0xbd, 0x48, 0xed, 0x17, 0x7c, 0x68, 0x95, 0xbe, 0x8e, 0xb6, 0xe2, 0x9f, 0xf5, 0x8c, 0x3b, 0x9e, 0x0f, 0xf3, 0x2a, 0xb5, 0x7b, 0xf3, 0xbe, 0x44, 0x07, 0x62, 0x84, 0x81, 0x84, 0xaa, 0x9a, 0xa9, 0x19, 0xd5, 0x74, 0x56, 0x7e, 0x73 } +, + /* Prime exponent 2 */ + 64, + { 0x45, 0xeb, 0xef, 0xd5, 0x87, 0x27, 0x30, 0x8c, 0xd2, 0xb4, 0xe6, 0x08, 0x5a, 0x81, 0x58, 0xd2, 0x9a, 0x41, 0x8f, 0xee, 0xc1, 0x14, 0xe0, 0x03, 0x85, 0xbc, 0xeb, 0x96, 0xfb, 0xbc, 0x84, 0xd0, 0x71, 0xa5, 0x61, 0xb9, 0x5c, 0x30, 0x08, 0x79, 0x00, 0xe2, 0x58, 0x0e, 0xdb, 0x05, 0xf6, 0xce, 0xa7, 0x90, 0x7f, 0xcd, 0xca, 0x5f, 0x92, 0x91, 0x7b, 0x4b, 0xbe, 0xba, 0x5e, 0x1e, 0x14, 0x0f } +, + /* Coefficient */ + 64, + { 0xc5, 0x24, 0x68, 0xc8, 0xfd, 0x15, 0xe5, 0xda, 0x2f, 0x6c, 0x8e, 0xba, 0x4e, 0x97, 0xba, 0xeb, 0xe9, 0x95, 0xb6, 0x7a, 0x1a, 0x7a, 0xd7, 0x19, 0xdd, 0x9f, 0xff, 0x36, 0x6b, 0x18, 0x4d, 0x5a, 0xb4, 0x55, 0x07, 0x59, 0x09, 0x29, 0x20, 0x44, 0xec, 0xb3, 0x45, 0xcf, 0x2c, 0xdd, 0x26, 0x22, 0x8e, 0x21, 0xf8, 0x51, 0x83, 0x25, 0x5f, 0x4a, 0x9e, 0x69, 0xf4, 0xc7, 0x15, 0x2e, 0xbb, 0x0f } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 2.1", + /* Message */ + 17, + { 0xe9, 0xa7, 0x71, 0xe0, 0xa6, 0x5f, 0x28, 0x70, 0x8e, 0x83, 0xd5, 0xe6, 0xcc, 0x89, 0x8a, 0x41, 0xd7 } +, + /* Seed */ + 108, + { 0x16, 0x8e, 0x3e, 0xb5, 0x80, 0x9b, 0x08, 0x70, 0xe1, 0xf2, 0x48, 0x7e, 0x1b, 0xe7, 0x7a, 0x17, 0x6b, 0x34, 0x71, 0x6d, 0xe1, 0x41, 0xba, 0x4c, 0x90, 0x59, 0xda, 0x90, 0xe5, 0xe5, 0x1a, 0x36, 0x94, 0xe8, 0x58, 0xfe, 0xd1, 0x0b, 0x92, 0x6c, 0x02, 0x52, 0x39, 0x80, 0xa8, 0x90, 0x9d, 0xa9, 0x96, 0xc6, 0x43, 0x33, 0xea, 0x67, 0x67, 0x87, 0xbc, 0xe6, 0x77, 0xf1, 0x1f, 0xda, 0x77, 0xdb, 0xb1, 0xa9, 0x51, 0x6e, 0xdd, 0xa9, 0xb1, 0x29, 0x4f, 0xc2, 0xe4, 0x50, 0x52, 0x22, 0x88, 0xe9, 0x30, 0xbe, 0x7f, 0xa7, 0x29, 0xb2, 0x50, 0xe3, 0xaa, 0xc5, 0x20, 0x51, 0x1e, 0x95, 0x16, 0xaa, 0x86, 0x3a, 0xf6, 0xbc, 0x07, 0x5c, 0xbd, 0xbf, 0xf4, 0x30, 0x46, 0x70 } +, + /* Encryption */ + 128, + { 0x71, 0xc2, 0xb8, 0xfb, 0x38, 0x19, 0xf1, 0x34, 0xc2, 0x24, 0x7c, 0x6b, 0xab, 0xb4, 0xcf, 0xbe, 0x17, 0xd7, 0xb2, 0x64, 0x3f, 0x87, 0xac, 0xe5, 0xc5, 0x71, 0x27, 0x7b, 0xe1, 0x90, 0x8e, 0xf3, 0xa5, 0x28, 0x8e, 0x34, 0x38, 0x4e, 0x46, 0x0a, 0x70, 0x38, 0x6e, 0x7e, 0xa1, 0xd1, 0x9d, 0x3d, 0xca, 0x1c, 0xe1, 0x5b, 0xa9, 0x32, 0x39, 0xa8, 0xcd, 0xda, 0x18, 0xe3, 0x17, 0xfe, 0x07, 0x96, 0x80, 0xce, 0x7e, 0x6a, 0xc6, 0xd9, 0xbd, 0xaf, 0x86, 0xcb, 0x9a, 0xeb, 0xf1, 0xcf, 0x46, 0xcd, 0x10, 0xef, 0x6a, 0x68, 0x8b, 0x0c, 0xb2, 0xce, 0x76, 0x5d, 0xd0, 0xb3, 0x25, 0x20, 0x42, 0x39, 0x66, 0xee, 0xe1, 0xaa, 0x05, 0xc6, 0xc2, 0x8c, 0x6f, 0x35, 0x24, 0xfb, 0x68, 0x6b, 0x5f, 0xb1, 0x58, 0x53, 0x65, 0x9e, 0x58, 0x3a, 0xc4, 0x37, 0x21, 0x9d, 0xef, 0x8e, 0xdc, 0x58, 0xbe, 0x2d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.2", + /* Message */ + 47, + { 0x66, 0x4b, 0xf0, 0x5d, 0x61, 0x2b, 0xaf, 0x61, 0x52, 0x4c, 0x60, 0x8e, 0xda, 0x36, 0xfc, 0x6e, 0xa2, 0xc9, 0x3c, 0x14, 0x31, 0x53, 0x22, 0x1b, 0xcf, 0xd6, 0xba, 0x0c, 0xfb, 0xbd, 0x6b, 0x64, 0x14, 0x47, 0xe4, 0x78, 0x8b, 0x0a, 0x46, 0x2c, 0xb5, 0xb3, 0xf9, 0xfa, 0xfc, 0x9a, 0x75 } +, + /* Seed */ + 78, + { 0xe7, 0xf0, 0xa2, 0x79, 0x18, 0xca, 0xd9, 0x15, 0xda, 0x28, 0x11, 0x36, 0x59, 0xff, 0xb5, 0xdf, 0xa0, 0xb5, 0x1b, 0x24, 0xd5, 0xa7, 0x1c, 0x20, 0x27, 0xf8, 0xe4, 0xd9, 0x40, 0x9e, 0x8c, 0x64, 0x72, 0xf0, 0xc5, 0x4b, 0x5c, 0x08, 0x85, 0x8d, 0xa6, 0x3d, 0x4b, 0x81, 0x72, 0xb0, 0x7d, 0xcf, 0x8c, 0x5a, 0x7e, 0x8f, 0x9e, 0x90, 0xf0, 0x17, 0xc2, 0x4b, 0x44, 0xd1, 0x6b, 0x67, 0x0b, 0xdc, 0x96, 0x03, 0x0c, 0x83, 0x53, 0xa2, 0x83, 0x9b, 0xa4, 0xc0, 0x75, 0xd2, 0x4c, 0x20 } +, + /* Encryption */ + 128, + { 0x06, 0x86, 0x90, 0x18, 0x13, 0xdb, 0x05, 0x3a, 0xc7, 0x08, 0xe3, 0xfc, 0xec, 0x6b, 0xae, 0x03, 0x60, 0x08, 0x8f, 0xd3, 0x44, 0xe9, 0xd7, 0xea, 0x11, 0x8b, 0xb3, 0xf5, 0x37, 0x53, 0x14, 0x25, 0x1e, 0x60, 0x67, 0x37, 0xf5, 0x82, 0x4b, 0x36, 0x28, 0xf6, 0x65, 0x03, 0x48, 0xf6, 0xab, 0x55, 0x3b, 0x27, 0x7d, 0xa0, 0x15, 0x44, 0xd0, 0x56, 0x73, 0xba, 0xed, 0xf4, 0x55, 0xcc, 0x03, 0x32, 0xf6, 0x13, 0xf6, 0x54, 0x78, 0xfc, 0xfe, 0x06, 0x67, 0x34, 0xc4, 0x65, 0x58, 0xbc, 0x23, 0x3b, 0x4b, 0x6f, 0x52, 0x41, 0xe4, 0xf4, 0xac, 0x53, 0xfc, 0x18, 0xc5, 0x53, 0x84, 0xc8, 0xfd, 0x96, 0x18, 0x3f, 0x0b, 0xb5, 0x51, 0x5e, 0x89, 0x31, 0x14, 0xf9, 0xc6, 0x1c, 0xcc, 0x11, 0xfc, 0x19, 0x83, 0xde, 0x74, 0x46, 0x92, 0x64, 0xdb, 0xdb, 0xb0, 0xc7, 0x49, 0x17, 0x4e, 0xcd, 0xfb, 0xe3 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.3", + /* Message */ + 52, + { 0x5e, 0x76, 0xe6, 0x6e, 0xd5, 0x75, 0x41, 0xfc, 0x23, 0xd3, 0x59, 0xf4, 0xad, 0xbf, 0x3f, 0x56, 0x82, 0x01, 0xd3, 0xc6, 0xf0, 0xe0, 0x26, 0xaa, 0xa5, 0x67, 0x63, 0x56, 0xcc, 0x98, 0x66, 0xf1, 0x75, 0x5d, 0xe9, 0x8c, 0xb3, 0x9f, 0x23, 0x6d, 0xaf, 0xa9, 0xe6, 0xbc, 0x79, 0x4b, 0x74, 0x43, 0xb5, 0x3a, 0x2d, 0x85 } +, + /* Seed */ + 73, + { 0x5c, 0x65, 0x68, 0xb6, 0xe3, 0x3b, 0xc1, 0x3a, 0xd2, 0xdc, 0xd6, 0x01, 0x2d, 0x17, 0xda, 0x81, 0xb1, 0x3d, 0xbd, 0x62, 0xaa, 0xe4, 0x0a, 0x64, 0xaf, 0x97, 0xe2, 0x19, 0xe7, 0x5d, 0xc1, 0x81, 0x12, 0x60, 0x77, 0xd1, 0x20, 0xdd, 0xa1, 0x9d, 0x63, 0x12, 0xcf, 0x1e, 0x98, 0x71, 0xc1, 0x15, 0xf0, 0x86, 0x7f, 0xe6, 0x62, 0xd7, 0x8a, 0x40, 0x31, 0x97, 0x6b, 0xdd, 0xef, 0x68, 0xf5, 0x2b, 0x68, 0x99, 0x58, 0x67, 0xcd, 0x80, 0x95, 0x05, 0xdd } +, + /* Encryption */ + 128, + { 0x19, 0xe7, 0x99, 0x66, 0xff, 0x1f, 0xbc, 0x10, 0x07, 0x3d, 0xe7, 0x3d, 0xf3, 0xa5, 0x31, 0x63, 0x78, 0x74, 0xe4, 0x7d, 0xf6, 0x39, 0x25, 0x6c, 0x51, 0xd0, 0xbb, 0xa9, 0x35, 0x61, 0x0b, 0x46, 0x34, 0xf9, 0xe5, 0xb4, 0x68, 0x9b, 0xd9, 0x21, 0x73, 0x5b, 0x32, 0x23, 0x6e, 0xfc, 0xc6, 0xe7, 0xcc, 0x49, 0xa9, 0xe0, 0x6a, 0x25, 0xac, 0x96, 0x59, 0xb7, 0xfe, 0x82, 0x9c, 0xb3, 0xe8, 0xb0, 0x1f, 0x10, 0x31, 0x79, 0x42, 0x23, 0x65, 0x74, 0x1b, 0x76, 0xc8, 0x34, 0x21, 0x49, 0xce, 0xdc, 0x76, 0xeb, 0x0a, 0xd0, 0x18, 0xed, 0x42, 0x35, 0xfb, 0xd5, 0x24, 0xfd, 0x87, 0xc9, 0x54, 0x9a, 0xb3, 0x3f, 0xf2, 0x3e, 0xe4, 0xf8, 0x20, 0x0e, 0xfa, 0x33, 0x02, 0x7e, 0x9d, 0xee, 0xc6, 0x0f, 0xac, 0x01, 0x3d, 0x1e, 0x56, 0xe6, 0xe3, 0x33, 0xd4, 0x93, 0xa4, 0xa9, 0x46, 0x0f, 0xe5, 0x8a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.4", + /* Message */ + 9, + { 0x5b, 0x19, 0x50, 0x48, 0xeb, 0x90, 0xeb, 0x47, 0x93 } +, + /* Seed */ + 116, + { 0xbb, 0xbd, 0x49, 0x55, 0x0e, 0xd1, 0xea, 0x1b, 0x6b, 0xc7, 0x20, 0x6c, 0xe0, 0xb0, 0x03, 0xa6, 0x32, 0xa5, 0x2b, 0x0b, 0xac, 0x5f, 0x32, 0x71, 0x0b, 0x39, 0xfa, 0x64, 0xb3, 0x55, 0x6a, 0xd6, 0xf6, 0xc8, 0x2b, 0xd9, 0xd5, 0x31, 0xb3, 0x07, 0x46, 0x9e, 0x86, 0x3f, 0x54, 0xb5, 0xfe, 0x21, 0x83, 0x05, 0x69, 0x54, 0xf2, 0xa9, 0x67, 0xe4, 0xdc, 0x2b, 0x32, 0x6e, 0x41, 0xdd, 0xdf, 0x74, 0x3a, 0x76, 0x4f, 0x7e, 0x82, 0x88, 0x68, 0x29, 0xa8, 0xfa, 0xb2, 0x77, 0x2a, 0x34, 0x97, 0x70, 0x6b, 0x95, 0x38, 0xa9, 0xf8, 0x42, 0x96, 0xc8, 0x2d, 0x9b, 0xaf, 0xc2, 0x9c, 0x39, 0xd4, 0x68, 0x4f, 0x75, 0xff, 0x6b, 0xb1, 0xc1, 0x2e, 0x39, 0xbb, 0x80, 0x56, 0xaf, 0x2d, 0x24, 0x34, 0x4b, 0x2c, 0xae, 0x46, 0x29 } +, + /* Encryption */ + 128, + { 0x42, 0xc9, 0xcb, 0x68, 0x21, 0xb5, 0x5d, 0xae, 0x30, 0xd9, 0x00, 0x25, 0x75, 0x31, 0x12, 0xe6, 0xee, 0x02, 0xf4, 0xad, 0x6f, 0x0f, 0x5b, 0x3c, 0xc4, 0x95, 0x2a, 0x12, 0x7c, 0x8a, 0x16, 0xf6, 0x64, 0x79, 0xb8, 0x14, 0x4f, 0x3c, 0xf2, 0x9d, 0x84, 0xe4, 0x3d, 0x67, 0xd6, 0x77, 0x12, 0xc7, 0xf5, 0xb7, 0x6d, 0xa2, 0xc6, 0x6b, 0xa0, 0xe9, 0x0c, 0xd4, 0xb1, 0xfc, 0x1c, 0x1b, 0x3f, 0x17, 0xa3, 0x92, 0xe7, 0x04, 0x08, 0x28, 0x8a, 0xf6, 0x9b, 0x50, 0xfe, 0x8a, 0x50, 0xb3, 0x29, 0x6a, 0x0d, 0xab, 0xd7, 0xc8, 0xdc, 0x39, 0x84, 0xa1, 0x94, 0x06, 0x88, 0xbe, 0x70, 0x98, 0x25, 0x16, 0x20, 0x25, 0x6c, 0xc2, 0x1b, 0x7c, 0x76, 0xed, 0x29, 0xd8, 0x6f, 0xf7, 0xc0, 0x1e, 0xc2, 0x87, 0xdf, 0x47, 0x38, 0xbe, 0x34, 0x69, 0xb3, 0x0a, 0x3f, 0x8f, 0xb7, 0xbe, 0x83, 0xd9, 0x36, 0x1a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.5", + /* Message */ + 61, + { 0x66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0x26, 0x58, 0xb2, 0x08, 0xe8, 0x8e, 0x64, 0x45, 0xfc, 0x35, 0x01, 0x9b, 0x0c, 0xad, 0x6b, 0xf4, 0xd0, 0x6e, 0x2c, 0xa5, 0xf1, 0x19, 0x49, 0xee, 0xee, 0x7e, 0xe4, 0x7f, 0x1d, 0x5b, 0x4c, 0x88, 0x24, 0x1f, 0x50, 0xe4, 0xd6, 0xed, 0xf0, 0x18, 0x3d, 0x4f, 0xa3, 0x5a, 0x37, 0x1f, 0xc4, 0x07, 0x36, 0x4f, 0x2d, 0xca, 0xa4, 0xcd, 0xae, 0xce, 0xfc, 0xea, 0x6d, 0xfa, 0xc1, 0xd5, 0x13, 0xf9, 0x05, 0xe7, 0x47, 0x94, 0x47, 0x44, 0xbb, 0x64, 0x57, 0x6b, 0xa1, 0xc8 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.6", + /* Message */ + 11, + { 0x81, 0xcb, 0x0a, 0x97, 0x69, 0x8f, 0x82, 0x3b, 0x56, 0xb4, 0x5f } +, + /* Seed */ + 114, + { 0x93, 0x8c, 0x8d, 0xfd, 0xa0, 0x8b, 0x89, 0x05, 0x5b, 0x68, 0xaf, 0x01, 0x1f, 0x24, 0x6c, 0xec, 0x1f, 0x93, 0xa2, 0x77, 0x1d, 0xa9, 0x7d, 0xba, 0x20, 0x95, 0x4c, 0x90, 0x09, 0x12, 0x28, 0x5e, 0x5d, 0xb1, 0x87, 0xb2, 0x9e, 0x32, 0x72, 0xe9, 0x9e, 0x69, 0x4e, 0x12, 0x14, 0x17, 0x25, 0x28, 0x45, 0x30, 0x84, 0x06, 0x4e, 0x5c, 0x60, 0xf0, 0x1e, 0x78, 0x6f, 0xc5, 0xd0, 0xd9, 0xaf, 0x06, 0x39, 0xa4, 0x98, 0xc5, 0x7a, 0xde, 0x93, 0x77, 0x60, 0xae, 0x51, 0x74, 0x84, 0xaf, 0xd7, 0x02, 0x5e, 0xa0, 0xd5, 0x5a, 0x62, 0xb1, 0x1f, 0x9a, 0xab, 0x7f, 0xa5, 0xdd, 0xd0, 0x93, 0xe5, 0xea, 0xba, 0xd6, 0x1b, 0x67, 0xa2, 0x95, 0xa7, 0x75, 0xbe, 0x96, 0xc6, 0xb7, 0x6e, 0xc3, 0xfe, 0x47, 0x29, 0x50 } +, + /* Encryption */ + 128, + { 0x7f, 0xb8, 0xf3, 0x35, 0xee, 0xdc, 0x4a, 0xf6, 0xaf, 0x44, 0x07, 0x3d, 0xa1, 0x96, 0x45, 0x7d, 0x04, 0x61, 0x45, 0x03, 0x01, 0x47, 0xf8, 0x42, 0x0f, 0xc7, 0x9b, 0xd5, 0x89, 0x77, 0x4a, 0x73, 0x0a, 0x6d, 0x94, 0xfb, 0x7e, 0xfa, 0xdc, 0x5a, 0xee, 0xa7, 0xc0, 0x70, 0xf1, 0x89, 0x24, 0x91, 0x25, 0xe1, 0x66, 0xc6, 0xd3, 0x01, 0x29, 0xec, 0xf2, 0xc4, 0x82, 0x2a, 0x50, 0x49, 0x6b, 0xc2, 0xf2, 0x1e, 0x79, 0xac, 0x57, 0xdb, 0xfb, 0xdd, 0x71, 0xa6, 0x8b, 0x58, 0xd9, 0x05, 0x1b, 0x48, 0x0b, 0xf4, 0x77, 0x48, 0xa1, 0x3d, 0xfb, 0x67, 0x3e, 0xae, 0xd7, 0x71, 0x0a, 0x46, 0x8f, 0xe7, 0x2f, 0x7d, 0x74, 0xe6, 0xf4, 0xa2, 0x89, 0x44, 0x04, 0x3a, 0x52, 0xd9, 0x30, 0xde, 0x68, 0xdb, 0xcb, 0x6e, 0xe7, 0xfb, 0x8b, 0x69, 0x64, 0x05, 0x41, 0xe3, 0xed, 0x5b, 0x75, 0x4e, 0x65, 0xfe } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.7", + /* Message */ + 45, + { 0x05, 0xf7, 0x83, 0x56, 0x23, 0xc8, 0xcf, 0xaa, 0xe4, 0x82, 0xa9, 0x10, 0x85, 0xb9, 0x7f, 0x6b, 0x95, 0x92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0xd2, 0x12, 0x97, 0x73, 0x1d, 0x7c, 0x22, 0xc1, 0x45, 0x99, 0xe7, 0x57, 0x19, 0xfd, 0x23, 0x05, 0x2b, 0x8a, 0xa6, 0x5b, 0x7e, 0x9c, 0x5c, 0x02, 0x00, 0x38, 0x2d, 0x35, 0xd5, 0x60, 0xf2, 0xd3, 0x3d, 0xd0, 0x49, 0xe0, 0x6a, 0xc8, 0x27, 0xcb, 0xdd, 0x9a, 0xf5, 0x81, 0xa6, 0xb2, 0x6d, 0xb6, 0x1d, 0x43, 0xd7, 0x12, 0x4b, 0x34, 0x72, 0x1d, 0xf1, 0x42 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.8", + /* Message */ + 59, + { 0xe2, 0xe0, 0xf6, 0xb3, 0x28, 0xd9, 0xbb, 0xe9, 0xfd, 0x66, 0xcd, 0x87, 0x98, 0x7c, 0x11, 0x60, 0xed, 0x23, 0x7b, 0x1c, 0x7c, 0x65, 0x6a, 0x89, 0xfb, 0x1f, 0x21, 0xd7, 0x09, 0x40, 0x3b, 0x04, 0x10, 0xf8, 0xe4, 0xe1, 0x2e, 0xb9, 0x69, 0x0a, 0xeb, 0xeb, 0x38, 0x07, 0x31, 0x9a, 0x93, 0x65, 0x64, 0xf6, 0x67, 0x17, 0xa7, 0x1c, 0x48, 0x62, 0xcc, 0xc5, 0x6e } +, + /* Seed */ + 66, + { 0xcf, 0x18, 0xe6, 0x08, 0xb1, 0x56, 0x14, 0x5c, 0x44, 0xde, 0x31, 0x49, 0x66, 0xcb, 0xcc, 0x66, 0x74, 0xa4, 0x5a, 0xe0, 0xdf, 0x90, 0x04, 0x06, 0xe4, 0x0d, 0x3d, 0xfc, 0x32, 0x2f, 0x39, 0x40, 0x4c, 0xee, 0xb6, 0xdc, 0x58, 0xf8, 0x01, 0xbb, 0xf2, 0xac, 0x4f, 0x47, 0x84, 0x1a, 0xbd, 0x79, 0x61, 0x79, 0xd0, 0x82, 0x4f, 0x3b, 0xf5, 0x51, 0x8d, 0x78, 0xcc, 0x66, 0xad, 0x8d, 0xfb, 0xed, 0xb1, 0x17 } +, + /* Encryption */ + 128, + { 0x14, 0x01, 0xaa, 0x21, 0xec, 0x6e, 0xba, 0xa7, 0xe3, 0xa9, 0xf7, 0x13, 0xc8, 0x6b, 0x50, 0x8e, 0x37, 0x5f, 0x6c, 0x12, 0x5b, 0x29, 0x62, 0x6e, 0xbd, 0x34, 0x9f, 0x64, 0xe2, 0x0f, 0xa4, 0x8a, 0x1b, 0x06, 0x84, 0x79, 0xff, 0xf3, 0x30, 0x22, 0xf6, 0x6f, 0x86, 0xe9, 0x7d, 0x9c, 0x5e, 0xdd, 0x90, 0x26, 0xe3, 0x18, 0x3c, 0xe0, 0x86, 0x41, 0x57, 0x06, 0x59, 0x35, 0x2f, 0x87, 0xa6, 0x18, 0x91, 0xf3, 0xd8, 0x6a, 0x3d, 0x24, 0x5f, 0x02, 0x45, 0xe3, 0x9d, 0x99, 0x89, 0x2c, 0x67, 0xfa, 0x2b, 0xed, 0x8e, 0x37, 0x54, 0x8d, 0xe2, 0x3d, 0xef, 0xdd, 0x1e, 0x43, 0xd5, 0xd7, 0xe3, 0xd9, 0xa3, 0xc2, 0x2c, 0xe6, 0xa3, 0x68, 0xd8, 0x4c, 0x5a, 0xfa, 0x1c, 0xc5, 0xbf, 0x49, 0xb6, 0x8f, 0xe5, 0xc2, 0x5a, 0x32, 0x6b, 0x0e, 0xec, 0x5e, 0x44, 0xc5, 0xe2, 0xff, 0x5a, 0x35, 0x9d, 0xd1 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.9", + /* Message */ + 17, + { 0xc6, 0x95, 0x78, 0xea, 0x03, 0xe2, 0x69, 0xb1, 0xb9, 0x16, 0x33, 0xa7, 0x2f, 0x9f, 0xb4, 0xd1, 0x0c } +, + /* Seed */ + 108, + { 0xe0, 0xa1, 0xa9, 0xba, 0xe3, 0x0a, 0x7a, 0xc6, 0x6c, 0xab, 0x3d, 0x86, 0x43, 0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 0x18, 0x53, 0x46, 0x3b, 0xc1, 0xcf, 0x03, 0x67, 0x7e, 0x78, 0x6e, 0xe5, 0x2e, 0x72, 0x71, 0xc3, 0xc1, 0x1a, 0xc0, 0x05, 0x53, 0xc6, 0x75, 0x27, 0x07, 0xe0, 0xdf, 0x92, 0x80, 0xc4, 0xf2, 0xb7, 0xd1, 0x9f, 0xd6, 0xf3, 0xd8, 0xbb, 0xcc, 0x7b, 0xe6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.10", + /* Message */ + 20, + { 0x76, 0x72, 0xcf, 0xc2, 0x7a, 0x41, 0xd5, 0x01, 0xaa, 0x4c, 0x41, 0xba, 0xab, 0xf4, 0x52, 0x5a, 0x7c, 0x45, 0x5f, 0xc8 } +, + /* Seed */ + 105, + { 0x4c, 0xee, 0xa1, 0xa8, 0x94, 0x64, 0xa5, 0xd2, 0xf8, 0x9e, 0x07, 0x89, 0x53, 0xca, 0xf7, 0x76, 0x36, 0x58, 0x98, 0xa5, 0xbd, 0x5e, 0x8e, 0x44, 0x8c, 0x65, 0xda, 0x26, 0xff, 0x98, 0x90, 0x0c, 0xd0, 0x80, 0x61, 0xef, 0x44, 0x6c, 0x69, 0xb4, 0x8d, 0xc4, 0x60, 0x9e, 0xd8, 0x65, 0x4a, 0x64, 0x6d, 0x70, 0x82, 0x62, 0xcb, 0x84, 0x09, 0xac, 0x27, 0xc4, 0xa4, 0x9a, 0xdf, 0xed, 0x47, 0xa8, 0x5a, 0xd4, 0x29, 0xed, 0x75, 0x07, 0x75, 0x78, 0xe4, 0xc2, 0x73, 0xc6, 0x1e, 0x2c, 0x3b, 0x46, 0xbe, 0xb4, 0x72, 0xf0, 0xa3, 0x45, 0xa0, 0x5d, 0x61, 0xa7, 0xea, 0xaa, 0xd8, 0xa6, 0x3e, 0x0b, 0x3d, 0x49, 0x52, 0xf2, 0x7c, 0x40, 0x81, 0x32, 0x9e } +, + /* Encryption */ + 128, + { 0x25, 0x2b, 0x14, 0x13, 0x3f, 0x1d, 0xb2, 0x50, 0x13, 0x29, 0x35, 0x01, 0xe3, 0x56, 0x53, 0x4f, 0x26, 0xaf, 0xe3, 0x34, 0x68, 0x8e, 0x68, 0xd7, 0x91, 0x83, 0x3a, 0x0d, 0x82, 0x56, 0x05, 0x70, 0xbb, 0xb3, 0xce, 0x2b, 0x16, 0xd8, 0xb5, 0xf7, 0xf8, 0x9e, 0x7e, 0xbc, 0x7c, 0xf9, 0xc2, 0x94, 0xab, 0x34, 0x16, 0xb7, 0xc2, 0x11, 0x87, 0x70, 0x7f, 0xe5, 0xe7, 0x99, 0x2e, 0x72, 0x0f, 0xf9, 0x58, 0xda, 0xa4, 0x0f, 0x5a, 0xd4, 0x5b, 0xc7, 0x47, 0x47, 0x96, 0x39, 0xa5, 0x37, 0xfe, 0x0a, 0x4a, 0x75, 0xfc, 0xfb, 0x45, 0xa5, 0x3f, 0x01, 0x73, 0xaf, 0xc0, 0xf3, 0xcc, 0x91, 0x0b, 0x86, 0xae, 0x31, 0x37, 0x62, 0x8d, 0x90, 0xff, 0x67, 0x5a, 0xe1, 0xae, 0x31, 0xe1, 0x64, 0x05, 0x37, 0xea, 0x1a, 0x7c, 0xcc, 0xfb, 0x73, 0xf8, 0xbe, 0x5a, 0xec, 0xa0, 0x3b, 0xab, 0x19, 0x3b, 0xb0 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.11", + /* Message */ + 32, + { 0xa1, 0x6a, 0xd8, 0xf2, 0xe0, 0x93, 0x23, 0x42, 0xed, 0x21, 0xe1, 0x37, 0x77, 0xf4, 0x65, 0x2a, 0x35, 0x50, 0xdd, 0xb4, 0x36, 0x8b, 0x5e, 0xa7, 0x1c, 0x66, 0xdb, 0xc3, 0xbb, 0xfe, 0xb7, 0xdb } +, + /* Seed */ + 93, + { 0x55, 0x88, 0x4c, 0x83, 0x0d, 0x4a, 0x80, 0xb7, 0x9f, 0x08, 0x9d, 0xa7, 0x4d, 0xc2, 0x5a, 0xe0, 0xc4, 0x82, 0x46, 0x21, 0x45, 0xe1, 0xd0, 0x95, 0x23, 0xda, 0x3c, 0x93, 0x44, 0xbb, 0x97, 0xb0, 0x52, 0xfb, 0xdc, 0x15, 0x43, 0xdf, 0xb5, 0x3c, 0xf2, 0x37, 0x82, 0x59, 0x68, 0x7c, 0x7b, 0x1b, 0x35, 0xca, 0xf2, 0xf9, 0x19, 0x99, 0xed, 0x4a, 0xce, 0x39, 0xaf, 0x10, 0xd6, 0xbe, 0xd0, 0xfa, 0x22, 0x44, 0x4c, 0x12, 0x9d, 0x90, 0x74, 0x1c, 0xfc, 0xda, 0x90, 0x19, 0x8e, 0x27, 0x82, 0xfb, 0x03, 0xbd, 0xcc, 0x7c, 0xfa, 0xfd, 0x89, 0xdb, 0x6f, 0xb0, 0xfe, 0xd2, 0x24 } +, + /* Encryption */ + 128, + { 0x08, 0x32, 0x6a, 0xff, 0x6d, 0x03, 0xcc, 0x4e, 0x26, 0x10, 0xdd, 0x53, 0x6a, 0xf7, 0xf2, 0x1d, 0x76, 0x22, 0x7d, 0x82, 0x7d, 0x52, 0x80, 0xd8, 0xb8, 0x3a, 0xb9, 0xeb, 0x30, 0xe0, 0x76, 0x9c, 0xfa, 0x02, 0xb5, 0xc1, 0x35, 0x2b, 0xf4, 0xd1, 0x70, 0xce, 0xb6, 0x6f, 0x8b, 0xe6, 0x98, 0x78, 0x4e, 0x1a, 0x6c, 0x20, 0x3f, 0xa5, 0xab, 0x90, 0x07, 0xa6, 0xf7, 0xfc, 0x20, 0x65, 0x20, 0x4b, 0x98, 0x2f, 0xa5, 0x61, 0xfb, 0xb3, 0x61, 0xaf, 0x2b, 0x8e, 0xea, 0x42, 0xab, 0x3f, 0xec, 0x0e, 0xd0, 0x86, 0x22, 0xe5, 0xf2, 0x89, 0x80, 0x52, 0x75, 0x38, 0x0b, 0x69, 0x34, 0x2a, 0x96, 0xf7, 0x6a, 0x99, 0x04, 0x87, 0x68, 0x90, 0xd9, 0x2f, 0x24, 0x00, 0x20, 0x32, 0x35, 0x1d, 0x8a, 0x1c, 0xbc, 0x3d, 0x27, 0xb2, 0x46, 0x48, 0x21, 0xbb, 0xfb, 0xfb, 0xb9, 0xa6, 0x78, 0x51, 0x96, 0x10 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.12", + /* Message */ + 1, + { 0x4a } +, + /* Seed */ + 124, + { 0x8a, 0xa0, 0xce, 0xd1, 0x7f, 0x09, 0xad, 0xae, 0x61, 0x0a, 0x46, 0x03, 0x0d, 0xad, 0x40, 0x31, 0x1b, 0xf1, 0x46, 0x9c, 0x27, 0x37, 0x41, 0x1e, 0x40, 0xf9, 0x23, 0x96, 0x75, 0x1d, 0xd5, 0x66, 0x37, 0xc9, 0x58, 0xdb, 0xc5, 0x8a, 0x17, 0xfd, 0xbd, 0xdd, 0xdb, 0xbf, 0x79, 0x75, 0x18, 0x78, 0x98, 0xbe, 0x1a, 0xa6, 0x3c, 0x5e, 0xee, 0x5f, 0x9a, 0x19, 0x02, 0x98, 0x0f, 0x59, 0x51, 0x84, 0xb9, 0xb5, 0xb4, 0x65, 0xb9, 0x2e, 0x20, 0xf7, 0xae, 0x8b, 0x5a, 0x5c, 0xee, 0x7f, 0x3b, 0x57, 0xd9, 0x97, 0xa0, 0x6a, 0x70, 0x2d, 0x23, 0x83, 0x50, 0xa9, 0x26, 0x98, 0xef, 0x27, 0x5d, 0xff, 0x52, 0x77, 0xbd, 0x2c, 0x99, 0x96, 0x47, 0x40, 0x5a, 0xdb, 0xe4, 0xfb, 0x3f, 0x1b, 0xe7, 0x5e, 0x15, 0x9a, 0x4c, 0x43, 0x83, 0x13, 0xb7, 0xfd, 0x8a, 0xca, 0x9d, 0xea } +, + /* Encryption */ + 128, + { 0x4c, 0x4e, 0x5a, 0xb6, 0x2d, 0x0c, 0x96, 0x7a, 0xb8, 0x29, 0x21, 0x42, 0x9f, 0xfe, 0x50, 0xd2, 0x24, 0x0e, 0x7e, 0x0a, 0x18, 0x75, 0x48, 0x87, 0x55, 0xbb, 0x7f, 0xf6, 0x15, 0xa8, 0xc9, 0x9a, 0xbc, 0x37, 0xb2, 0xe4, 0x71, 0x47, 0xa9, 0x27, 0xd7, 0xb9, 0x8c, 0x30, 0xdb, 0x24, 0xda, 0x8c, 0xd3, 0x5e, 0x13, 0xd7, 0xb7, 0x14, 0x14, 0xd0, 0x32, 0xbd, 0x0c, 0x3c, 0xe3, 0x8b, 0x89, 0xb1, 0x1b, 0x2c, 0x3f, 0x9d, 0x83, 0x08, 0x16, 0x71, 0x6a, 0x2e, 0x8c, 0xcd, 0x8c, 0x79, 0xe9, 0xc7, 0x49, 0x31, 0xa7, 0xb8, 0xa8, 0xdb, 0x13, 0x12, 0x8c, 0xe4, 0x0b, 0x21, 0x59, 0xe4, 0x98, 0xda, 0x98, 0xf2, 0xaa, 0x35, 0x2f, 0x23, 0x85, 0x31, 0x06, 0xb6, 0x61, 0xd8, 0x8e, 0xd0, 0x6f, 0xf6, 0x6a, 0x56, 0xe7, 0x56, 0x59, 0x72, 0x20, 0xbd, 0x10, 0x15, 0x81, 0x53, 0xce, 0x5c, 0x02, 0x63 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.13", + /* Message */ + 11, + { 0xbf, 0xfc, 0x42, 0x08, 0x73, 0xf5, 0xaf, 0x5d, 0xd2, 0x3b, 0xb0 } +, + /* Seed */ + 114, + { 0xdd, 0x31, 0xcc, 0xd4, 0x7d, 0x4e, 0x31, 0x02, 0xdf, 0x0f, 0xc5, 0x9b, 0x1b, 0x84, 0x77, 0xaf, 0x3a, 0x78, 0xc2, 0xfa, 0x9c, 0x8e, 0xcb, 0x4f, 0x0b, 0x3b, 0xde, 0x23, 0x50, 0x04, 0x36, 0x55, 0x03, 0x64, 0x66, 0x5f, 0x81, 0xc0, 0x35, 0x6a, 0xbc, 0x0b, 0x78, 0xe9, 0x73, 0x19, 0x11, 0x14, 0x02, 0x75, 0xc8, 0x66, 0xf7, 0x5a, 0xd0, 0xcb, 0xbc, 0x88,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2, 0x77, 0x81, 0x95 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.14", + /* Message */ + 40, + { 0x1a, 0x9b, 0x87, 0x29, 0x21, 0x0a, 0x84, 0x71, 0xfc, 0x5c, 0xd7, 0x09, 0xf2, 0xed, 0xd3, 0x24, 0x01, 0x50, 0x24, 0x4b, 0xec, 0x96, 0xa9, 0x2f, 0xf8, 0x07, 0xe3, 0xb3, 0x0d, 0x29, 0x5d, 0x3c, 0x34, 0x5c, 0x04, 0x4f, 0x2e, 0x95, 0x60, 0x37 } +, + /* Seed */ + 85, + { 0x58, 0x78, 0xc9, 0x1b, 0x16, 0x6e, 0x90, 0xc3, 0x4e, 0x6e, 0x66, 0x56, 0x8c, 0x15, 0x1f, 0x4d, 0x44, 0x43, 0x40, 0xb5, 0xf1, 0xd7, 0x30, 0x52, 0xcc, 0x56, 0x33, 0xea, 0x2e, 0x47, 0xac, 0xed, 0x7b, 0x17, 0x8a, 0x64, 0xfb, 0x09, 0xa5, 0xad, 0x08, 0x46, 0xae, 0xe4, 0x11, 0x6d, 0x67, 0x80, 0xee, 0x75, 0xeb, 0x20, 0x85, 0x16, 0x68, 0x82, 0x0c, 0xde, 0xc0, 0xf2, 0xc4, 0x96, 0xe4, 0xc2, 0x88, 0xd8, 0x27, 0x9c, 0x1c, 0x5d, 0x4e, 0xc0, 0x0d, 0x98, 0x0c, 0x27, 0x2e, 0x87, 0x05, 0x18, 0x48, 0x6d, 0xca, 0xea, 0x85 } +, + /* Encryption */ + 128, + { 0x37, 0x00, 0xac, 0x36, 0x2c, 0xf6, 0x0e, 0x16, 0x39, 0x47, 0xa1, 0x98, 0xd0, 0x0f, 0x3b, 0x3b, 0x26, 0xe0, 0x3e, 0xe2, 0xfb, 0x78, 0x2b, 0x42, 0x88, 0xb8, 0xc1, 0xde, 0x76, 0xe9, 0xe8, 0x99, 0x46, 0xc9, 0x80, 0x7c, 0x56, 0xe0, 0x9c, 0x7b, 0x52, 0xbe, 0x00, 0x78, 0xac, 0xf6, 0x92, 0x96, 0x4a, 0xcb, 0x97, 0xd1, 0xfa, 0x5c, 0xeb, 0x57, 0x76, 0xa1, 0xd5, 0x56, 0xb4, 0xbc, 0x9d, 0xb0, 0x0b, 0xda, 0x25, 0x23, 0x7a, 0x75, 0x1b, 0x7c, 0x22, 0x9b, 0x6b, 0x57, 0xf7, 0xff, 0x75, 0x1c, 0x12, 0xd1, 0xf2, 0x2a, 0x4f, 0xb0, 0xe9, 0x0b, 0x63, 0xd0, 0x42, 0xd9, 0x49, 0x9e, 0x0f, 0x7e, 0xfe, 0xad, 0xd3, 0xc5, 0x88, 0xf2, 0xc7, 0x43, 0xa1, 0x2c, 0x56, 0x7c, 0x81, 0x57, 0x8d, 0xbe, 0xeb, 0xfd, 0x37, 0x74, 0xda, 0x34, 0xad, 0x09, 0xee, 0xbe, 0x90, 0x17, 0x89, 0x02, 0x14, 0xb5 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.15", + /* Message */ + 64, + { 0xa6, 0xd0, 0xe8, 0xc1, 0xea, 0x4a, 0xb4, 0xec, 0xc8, 0x95, 0x7d, 0x62, 0x28, 0x15, 0x79, 0x67, 0x5a, 0x64, 0x8d, 0x62, 0xb7, 0xf2, 0x2b, 0x2b, 0x08, 0xd1, 0x31, 0x3f, 0x40, 0x6f, 0x13, 0x7e, 0x99, 0x42, 0x67, 0x35, 0xcd, 0xb9, 0x37, 0x2f, 0xec, 0xa1, 0xee, 0x78, 0x46, 0x3f, 0xa5, 0xde, 0x9c, 0xdd, 0x84, 0x75, 0x6c, 0x68, 0xbd, 0x1d, 0x92, 0xba, 0x96, 0x5f, 0x50, 0x64, 0x10, 0xb1 } +, + /* Seed */ + 61, + { 0x1c, 0x25, 0xc9, 0xb8, 0x32, 0x16, 0x9a, 0x1f, 0xdb, 0x6c, 0x14, 0x8e, 0x47, 0xe6, 0x6c, 0x3c, 0xc8, 0x21, 0x41, 0xe6, 0x11, 0xa6, 0xf3, 0x0c, 0xc9, 0x0c, 0x50, 0x49, 0xe8, 0xc5, 0x02, 0xb3, 0x1c, 0xad, 0xc7, 0x62, 0x39, 0xb7, 0xbd, 0xaf, 0x93, 0xfa, 0x97, 0x34, 0x3e, 0x7e, 0xe5, 0x51, 0xbc, 0x52, 0xfd, 0xb5, 0xec, 0x9e, 0x40, 0x0a, 0xf0, 0x5d, 0xbe, 0xac, 0xda } +, + /* Encryption */ + 128, + { 0x00, 0xe8, 0xb2, 0xfc, 0x76, 0xdf, 0xb4, 0xa6, 0xcc, 0x43, 0x64, 0xde, 0x8f, 0x68, 0x3c, 0x3f, 0xcd, 0x0a, 0x9e, 0xcf, 0xbd, 0x4a, 0x5a, 0x72, 0x24, 0xf4, 0x9a, 0xe9, 0xb4, 0xf3, 0xb5, 0xcd, 0xc7, 0x1c, 0xbb, 0x8c, 0x66, 0xfd, 0x35, 0xf3, 0xd1, 0x8e, 0xca, 0x98, 0x96, 0x7b, 0xd4, 0x00, 0x5d, 0xf7, 0x91, 0x52, 0x41, 0x6f, 0xd4, 0x7e, 0x56, 0x2c, 0x55, 0xed, 0xc6, 0xd6, 0x12, 0x12, 0x28, 0x6e, 0xf9, 0x75, 0xbc, 0xc8, 0x02, 0x69, 0x25, 0x92, 0x65, 0x39, 0x00, 0x97, 0x3c, 0x72, 0xe0, 0x1a, 0x69, 0x3b, 0x05, 0xfc, 0x2d, 0x58, 0x56, 0xea, 0xef, 0x7a, 0xc0, 0x8f, 0xf5, 0xec, 0xd5, 0x31, 0xe2, 0xc2, 0xce, 0x92, 0x77, 0x45, 0xa1, 0x16, 0x5a, 0x51, 0xaa, 0x66, 0x98, 0xa1, 0xff, 0xcb, 0x87, 0xf8, 0x1e, 0xf6, 0x51, 0x0b, 0xca, 0xf9, 0xcb, 0x76, 0x1e, 0x9e, 0x1f, 0x0f } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.16", + /* Message */ + 63, + { 0xf3, 0x40, 0x5b, 0x21, 0x8f, 0x3e, 0xc6, 0x03, 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x5e, 0x80, 0x97, 0xfb, 0x69, 0x5a, 0xab, 0x36, 0xfe, 0xf5, 0x16, 0xe6, 0xa3, 0x3f, 0x36, 0xf7, 0xf9, 0x5a, 0xd1, 0xff, 0x15, 0x88, 0x90, 0x25, 0xb1, 0xb2, 0xe8, 0x1e, 0x1b, 0xf3, 0xb2, 0xde, 0x5b, 0xa9, 0x18, 0x7c, 0xa9, 0x6c, 0xeb, 0xa9, 0xfc, 0xec, 0xef, 0x9c, 0x53, 0xe4, 0x94, 0x34, 0x86, 0x18, 0x59, 0x67, 0xcf, 0x7a, 0x64, 0x77, 0xc3, 0x29, 0xf0, 0x0e, 0xa6, 0x95, 0x52, 0x5b, 0xca, 0x99, 0xf2, 0xc7 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.17", + /* Message */ + 52, + { 0x6a, 0xfa, 0xdb, 0xe3, 0xda, 0x68, 0xd9, 0x02, 0x85, 0xbb, 0x8f, 0x1e, 0x21, 0x29, 0xff, 0xeb, 0xb1, 0xc6, 0x5b, 0x95, 0x88, 0xd6, 0xc2, 0xc0, 0x40, 0x24, 0xc2, 0x38, 0xb2, 0x0c, 0x65, 0xd2, 0xac, 0xa5, 0xe3, 0x82, 0x76, 0x00, 0x0a, 0x0e, 0x6a, 0x0d, 0x05, 0x37, 0xef, 0xee, 0xf6, 0xd3, 0xe3, 0xd9, 0x4f, 0xb9 } +, + /* Seed */ + 73, + { 0xee, 0x17, 0x6e, 0xa3, 0xcf, 0xd4, 0x90, 0xb6, 0xc0, 0x49, 0xd2, 0xe7, 0x4c, 0x90, 0xc0, 0xee, 0x74, 0x68, 0x52, 0x03, 0x49, 0xb8, 0x51, 0x65, 0x3d, 0xb0, 0x58, 0xa1, 0xc3, 0xe9, 0x56, 0xe0, 0x88, 0x5f, 0x26, 0x1b, 0x6e, 0x71, 0xcf, 0x1e, 0x62, 0x3d, 0x3b, 0x9d, 0x1d, 0x56, 0xfa, 0x13, 0x67, 0xe4, 0x7f, 0xf3, 0x74, 0xad, 0x39, 0x30, 0x9f, 0xfa, 0x2e, 0x67, 0x11, 0x28, 0xd5, 0xab, 0xb4, 0xa6, 0x1a, 0x5b, 0x0d, 0xc2, 0xdb, 0x2c, 0x08 } +, + /* Encryption */ + 128, + { 0x67, 0x2f, 0xe9, 0x51, 0x59, 0xa9, 0x89, 0x3f, 0x34, 0x98, 0xb6, 0x16, 0xc1, 0x7b, 0x59, 0xda, 0x71, 0xda, 0x80, 0x2f, 0xeb, 0xf7, 0xcd, 0x38, 0x11, 0x06, 0x14, 0xa1, 0xb2, 0x5d, 0x96, 0xaa, 0x8a, 0x74, 0xaa, 0xaa, 0x2a, 0x0f, 0x00, 0x0e, 0xf8, 0xac, 0xa3, 0xb4, 0x1a, 0xd1, 0x61, 0xb6, 0x26, 0x33, 0xf2, 0x41, 0x31, 0x9c, 0x33, 0xe4, 0xec, 0xb7, 0x70, 0x6a, 0xb3, 0xad, 0xc6, 0xa3, 0xef, 0xea, 0x22, 0x43, 0x0f, 0x3f, 0x5c, 0x9c, 0x4c, 0xe5, 0x40, 0x4e, 0xb8, 0xe7, 0x5a, 0x10, 0x93, 0x69, 0xc0, 0xaa, 0x0b, 0x7d, 0xd7, 0x13, 0xbd, 0x8b, 0x77, 0xcc, 0xa5, 0xf7, 0x4b, 0xca, 0x5b, 0xc5, 0x55, 0x69, 0x6b, 0x68, 0xe1, 0x17, 0x2d, 0xb4, 0x02, 0x50, 0x1d, 0xcd, 0x26, 0x49, 0x68, 0x5d, 0xb0, 0xfd, 0x88, 0xc8, 0x83, 0x60, 0xda, 0xcc, 0x65, 0x09, 0xff, 0xa8, 0xdf, 0xc2 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.18", + /* Message */ + 48, + { 0x6d, 0x9f, 0x9b, 0x4b, 0xb1, 0x23, 0xba, 0x90, 0x95, 0x53, 0xa7, 0x57, 0x3a, 0x97, 0x1f, 0x64, 0xb7, 0x25, 0x24, 0xcf, 0xeb, 0x04, 0x2d, 0xe3, 0x92, 0x15, 0xf6, 0x50, 0xdb, 0x61, 0x2d, 0x66, 0xd7, 0xae, 0x86, 0x05, 0xd0, 0x44, 0x19, 0x54, 0x62, 0x5f, 0xa9, 0x81, 0x22, 0x33, 0x0e, 0x92 } +, + /* Seed */ + 77, + { 0x7f, 0xf8, 0x68, 0x5a, 0xec, 0xf3, 0x40, 0x26, 0x13, 0x90, 0xad, 0x07, 0x42, 0x73, 0x0c, 0xb6, 0x39, 0x28, 0x30, 0x14, 0xab, 0x37, 0x73, 0x55, 0x6c, 0x69, 0x7f, 0x97, 0xef, 0x62, 0x1a, 0x4d, 0xcb, 0xf8, 0xec, 0x6e, 0xde, 0xc5, 0x0d, 0x8e, 0xc9, 0x59, 0x0a, 0xdb, 0xaf, 0x23, 0x51, 0xdd, 0xfa, 0x0e, 0x52, 0xea, 0x6e, 0xd1, 0x8e, 0xb6, 0xc3, 0x78, 0xf3, 0x80, 0x85, 0xae, 0x5e, 0xe4, 0xcc, 0x48, 0xc1, 0x89, 0x1b, 0xa4, 0x7b, 0x20, 0x10, 0xd5, 0xd4, 0x35, 0x39 } +, + /* Encryption */ + 128, + { 0x8d, 0x30, 0x65, 0x5c, 0xf1, 0x5b, 0xf1, 0x0a, 0x46, 0x97, 0x87, 0xc6, 0xa1, 0x0e, 0x79, 0x25, 0x4f, 0xf0, 0xbd, 0x11, 0x93, 0x8b, 0xc6, 0x0a, 0x81, 0xa7, 0x58, 0xd9, 0x3c, 0xf2, 0xa0, 0x30, 0x24, 0x59, 0xfc, 0x2f, 0x0d, 0x77, 0x00, 0xb8, 0x6d, 0xd6, 0xed, 0x61, 0x83, 0x83, 0xb4, 0x4b, 0x45, 0x87, 0x04, 0xca, 0x11, 0x92, 0x8e, 0x50, 0x4f, 0x02, 0x8e, 0xfe, 0x50, 0x37, 0x17, 0x2c, 0x3e, 0x51, 0xb8, 0x37, 0xbe, 0x61, 0x56, 0xde, 0x6a, 0x09, 0xc5, 0x55, 0x97, 0xbe, 0x74, 0xc9, 0x7c, 0xaa, 0x1d, 0xeb, 0xf3, 0x14, 0xcd, 0x94, 0xb9, 0x1b, 0x9f, 0x94, 0xcb, 0xf7, 0x64, 0x0f, 0x86, 0xc2, 0x6d, 0x1d, 0x6a, 0x0b, 0x10, 0x46, 0x28, 0xb5, 0x87, 0x11, 0x4a, 0xa3, 0x1d, 0x99, 0xf6, 0x9c, 0xf9, 0x57, 0x37, 0x93, 0x2c, 0x0c, 0xb5, 0x33, 0x33, 0x74, 0xde, 0xa0, 0x7f, 0xac } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.19", + /* Message */ + 23, + { 0x33, 0xcc, 0xcb, 0x59, 0x7d, 0xe9, 0x5c, 0xed, 0xb8, 0xb6, 0x57, 0xfc, 0xd8, 0xf8, 0x88, 0x86, 0xda, 0x04, 0xc7, 0x57, 0x93, 0x53, 0x14 } +, + /* Seed */ + 102, + { 0x53, 0x42, 0xf4, 0x68, 0x43, 0x91, 0xcd, 0x74, 0xf5, 0x28, 0x2d, 0xb8, 0x31, 0x41, 0xff, 0xf6, 0x78, 0xf2, 0x3a, 0x3e, 0xa6, 0x52, 0xe0, 0xd4, 0x27, 0xfb, 0x6a, 0xd9, 0x76, 0xc5, 0xa7, 0x10, 0xa6, 0x37, 0x95, 0x77, 0x71, 0x89, 0x47, 0xac, 0x72, 0x7b, 0x4d, 0x58, 0xa0, 0xb0, 0xbd, 0x20, 0x7a, 0xe3, 0x73, 0xa8, 0xb9, 0x9a, 0xc8, 0xe2, 0x51, 0xeb, 0x02, 0x45, 0x8a, 0x9e, 0xdc, 0x39, 0x52, 0xfb, 0x28, 0x42, 0x6d, 0x18, 0xfd, 0xa1, 0x8a, 0x80, 0x2b, 0xbf, 0x0a, 0x0b, 0x8b, 0x2c, 0xf2, 0x5c, 0xa3, 0xa0, 0x22, 0xf7, 0x78, 0xc7, 0xf4, 0x7f, 0xc5, 0x30, 0xd0, 0xb7, 0xa5, 0xbc, 0x84, 0x6e, 0xea, 0x91, 0x80, 0xf2 } +, + /* Encryption */ + 128, + { 0x8c, 0x4a, 0x63, 0xd0, 0x73, 0x1e, 0x2e, 0x71, 0xeb, 0x46, 0x15, 0x18, 0x9a, 0x96, 0x8b, 0x3e, 0x4a, 0x24, 0x28, 0x56, 0xb2, 0x09, 0x02, 0x45, 0x23, 0x8b, 0x66, 0x45, 0x97, 0x8f, 0x1e, 0xe8, 0xd7, 0x98, 0x11, 0x06, 0x2e, 0xbd, 0x2d, 0x1f, 0x3d, 0x52, 0x3a, 0xe6, 0x00, 0xe0, 0xe5, 0xa6, 0xe4, 0x05, 0xc4, 0xe4, 0xb5, 0xa1, 0x6e, 0x8d, 0xfb, 0x49, 0x24, 0x30, 0x4b, 0x0d, 0x1f, 0xf4, 0xd6, 0x41, 0xbf, 0x98, 0x7f, 0xc6, 0xd4, 0x1d, 0x3e, 0xb7, 0xcd, 0xc5, 0x31, 0x34, 0xd0, 0x06, 0x9c, 0xdb, 0x5a, 0xfe, 0xf7, 0xf8, 0xf9, 0xca, 0xc0, 0xee, 0x52, 0x30, 0xb6, 0xf8, 0x86, 0x22, 0xa8, 0x4d, 0xe5, 0x2a, 0xd6, 0xf7, 0x50, 0x47, 0x84, 0x37, 0x06, 0xca, 0x96, 0x97, 0x42, 0xc5, 0x8d, 0xa7, 0x72, 0x62, 0xff, 0x1f, 0x12, 0x8a, 0x66, 0x4e, 0x51, 0xcd, 0x63, 0x5e, 0x71, 0x15 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 2.20", + /* Message */ + 2, + { 0x19, 0xd6 } +, + /* Seed */ + 123, + { 0xea, 0xac, 0xb5, 0x78, 0xae, 0xab, 0xf6, 0x9d, 0x4e, 0xae, 0xeb, 0x36, 0xd0, 0x4c, 0xd8, 0xa2, 0x2e, 0x8f, 0xd7, 0xa2, 0x5f, 0x04, 0x43, 0xa1, 0x1e, 0x4e, 0x08, 0xb3, 0xff, 0xac, 0x1e, 0x05, 0x42, 0x1a, 0x87, 0x6c, 0xca, 0x91, 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ab, 0x82, 0xae, 0x76, 0x2b, 0x28, 0xc1, 0x43, 0x65, 0x15, 0x2a, 0xe0, 0xf5, 0x4f, 0x2e, 0x9d, 0x14, 0x43, 0x9a, 0x84, 0x6b, 0x38, 0x3f, 0x5e, 0x2c, 0x55, 0xef, 0xa7, 0x00, 0x85, 0x97, 0xb5 } + +} +, +} +}, +{ + "Example 3: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xb9, 0x30, 0x96, 0xd0, 0x26, 0x1e, 0xfe, 0x00, 0x0b, 0x3d, 0x17, 0x04, 0xf5, 0x04, 0x31, 0x60, 0xab, 0xd3, 0xeb, 0x56, 0x6c, 0x61, 0xe5, 0x3c, 0x76, 0xc4, 0x01, 0xe2, 0xb6, 0x55, 0x21, 0xbc, 0x12, 0xd4, 0x81, 0x21, 0x51, 0x83, 0xe8, 0xf4, 0x6c, 0x2c, 0xa8, 0xd0, 0x0a, 0xda, 0x5d, 0xfd, 0x04, 0xdc, 0xf7, 0xcf, 0x36, 0xcc, 0x58, 0x11, 0x05, 0xd9, 0x9d, 0x2a, 0x7d, 0xd9, 0x4b, 0x56, 0x76, 0x0a, 0x65, 0x64, 0xfe, 0xe5, 0xe8, 0xaa, 0xeb, 0x06, 0x07, 0xe1, 0x45, 0x19, 0x62, 0x10, 0xa3, 0x1b, 0x7e, 0xd8, 0xdd, 0x2a, 0xf3, 0x2d, 0x29, 0xd2, 0xba, 0xd6, 0xf1, 0x5f, 0xfa, 0x5a, 0x11, 0xdc, 0x73, 0x5c, 0xc3, 0x62, 0x19, 0x02, 0x1e, 0xe8, 0xd1, 0xee, 0xed, 0x34, 0x63, 0x9b, 0x5a, 0x91, 0xac, 0x6a, 0x92, 0x67, 0x4e, 0x18, 0x39, 0x70, 0xc5, 0x9d, 0x5b, 0x19, 0x6d, 0x4b } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x01, 0x07, 0xea, 0x61, 0xad, 0xec, 0xa5,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12, 0x43, 0xa1, 0xcc, 0x6f } +, + /* Prime 2 */ + 64, + { 0xcc, 0x5a, 0x02, 0xf9, 0x55, 0x7a, 0x63, 0x5c, 0xf5, 0xe6, 0x9b, 0x0f, 0x2b, 0x3f, 0x2e, 0x61, 0x2e, 0x1f, 0x0a, 0xbb, 0xd4, 0xbc, 0xf1, 0x69, 0xca, 0xc0, 0x84, 0xdc, 0xf4, 0xb9, 0xb4, 0x34, 0x43, 0xa7, 0x85, 0x23, 0x90, 0xf8, 0x19, 0x41, 0x9e, 0xc1, 0xa8, 0x38, 0x7e, 0xf0, 0x4d, 0xd2, 0xdb, 0x7d, 0x60, 0xb4, 0x0a, 0x21, 0xf9, 0x4f, 0x46, 0xd2, 0x27, 0x87, 0x4b, 0x3e, 0x52, 0xe5 } +, + /* Prime exponent 1 */ + 64, + { 0xab, 0x92, 0x8b, 0x10, 0x35, 0x57, 0x3b, 0x23, 0x36, 0x6b, 0x28, 0xf2, 0x6b, 0xe7, 0xba, 0x45, 0x29, 0x85, 0x83, 0xed, 0x73, 0xf0, 0xf2, 0x9e, 0xa8, 0xc4, 0x98, 0x6b, 0xb8, 0x77, 0xcc, 0xaf, 0x0a, 0xd7, 0x19, 0x19, 0x6f, 0x5b, 0xf4, 0x23, 0xfc, 0xe3, 0x2d, 0x64, 0x06, 0x60, 0x64, 0x27, 0x3c, 0x55, 0x0a, 0x40, 0xae, 0x6d, 0x08, 0x79, 0xb3, 0xfa, 0x97, 0x01, 0x5a, 0xeb, 0x4a, 0x19 } +, + /* Prime exponent 2 */ + 63, + { 0x8c, 0x7d, 0x55, 0x8e, 0x15, 0x36, 0x0f, 0x19, 0xd9, 0xf4, 0xb0, 0xa5, 0xbd, 0x15, 0xb2, 0xcd, 0x1c, 0xe8, 0x3a, 0x78, 0xe7, 0xc8, 0xfe, 0x2f, 0xbd, 0x34, 0x9e, 0x23, 0x4a, 0x1c, 0x61, 0xc7, 0x8c, 0xbb, 0x9e, 0xcc, 0xd4, 0xdd, 0xbc, 0x7f, 0x60, 0xa5, 0xc3, 0x01, 0x14, 0x44, 0x21, 0x3c, 0xd5, 0xa9, 0x5c, 0xd2, 0x6a, 0x24, 0xf1, 0x41, 0x8f, 0x6e, 0xeb, 0xbe, 0x17, 0xfc, 0xc1 } +, + /* Coefficient */ + 64, + { 0xb0, 0xb1, 0xb9, 0xcb, 0x23, 0xac, 0x2a, 0x8a, 0x56, 0x36, 0x66, 0x69, 0x9a, 0x52, 0x40, 0x54, 0xbe, 0xf3, 0x81, 0xaa, 0xbd, 0x75, 0x55, 0x31, 0xa1, 0xdf, 0xa8, 0x85, 0xdc, 0x8f, 0x98, 0x86, 0xa5, 0x5a, 0xf0, 0xe3, 0x68, 0x63, 0x91, 0xc7, 0x97, 0x68, 0x1a, 0x8f, 0xef, 0xcf, 0x24, 0xdb, 0xd8, 0x1e, 0x03, 0x13, 0x16, 0x99, 0x8f, 0x5d, 0x81, 0x8d, 0x24, 0x76, 0xda, 0xd0, 0x6d, 0xe8 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 3.1", + /* Message */ + 17, + { 0x44, 0xe5, 0x6a, 0xa7, 0x7b, 0xd9, 0x35, 0xac, 0x59, 0xa9, 0xbd, 0x32, 0x37, 0x83, 0xe1, 0x27, 0x42 } +, + /* Seed */ + 108, + { 0x92, 0xee, 0xf6, 0x19, 0xf0, 0x4f, 0x52, 0x02, 0x8f, 0x4c, 0xc3, 0xe5, 0x24, 0x1f, 0x0a, 0xa0, 0x92, 0x1b, 0x4d, 0x18, 0x3c, 0x1f, 0x5b, 0xd6, 0x8d, 0x86, 0xfb, 0xe9, 0xe7, 0xb7, 0xd0, 0xbb, 0x10, 0x4e, 0xd1, 0xca, 0xe0, 0x7a, 0xc7, 0xd8, 0x0b, 0xfd, 0x9c, 0x1c, 0xef, 0xf8, 0xdc, 0xda, 0x1d, 0xcc, 0x69, 0x30, 0xf4, 0xc5, 0x51, 0x37, 0x34, 0x6b, 0xfd, 0x68, 0xc1, 0x9d, 0x87, 0x97, 0x2f, 0x7f, 0x34, 0xcb, 0xae, 0x56, 0x63, 0x26, 0x0f, 0xeb, 0x79, 0xf7, 0x60, 0x22, 0x1c, 0xd6, 0x7b, 0xe0, 0x66, 0xd5, 0xaf, 0x0f, 0x07, 0x3c, 0x0f, 0x2c, 0x43, 0x9e, 0x8b, 0xcb, 0x74, 0x63, 0xed, 0xe4, 0x4c, 0x8b, 0x15, 0x0e, 0xba, 0xf3, 0x29, 0x87, 0x26, 0xc3 } +, + /* Encryption */ + 128, + { 0x15, 0x91, 0xd1, 0xce, 0x0f, 0xad, 0x66, 0xd8, 0x6f, 0xd4, 0x2e, 0xfd, 0xb3, 0x1e, 0x9a, 0x02, 0x8a, 0x31, 0x57, 0xfb, 0x09, 0x14, 0xb2, 0x47, 0xeb, 0x3d, 0x22, 0xd7, 0x6f, 0x97, 0x69, 0xb0, 0xe1, 0x9f, 0x6c, 0x06, 0x4c, 0xa1, 0xb9, 0x89, 0x06, 0x39, 0xee, 0x6e, 0x37, 0xb7, 0x09, 0x22, 0x4d, 0x6b, 0x58, 0xeb, 0xb6, 0x55, 0xae, 0x4b, 0x69, 0xed, 0x4c, 0xd7, 0x5d, 0x81, 0x29, 0x21, 0x17, 0xc0, 0x69, 0x30, 0xd4, 0x2a, 0xc4, 0xd4, 0x2e, 0xa7, 0x35, 0x14, 0x21, 0x8f, 0x49, 0xea, 0x07, 0xca, 0x97, 0x43, 0x67, 0x09, 0x68, 0x3d, 0x67, 0xa8, 0xe9, 0xe8, 0x08, 0xda, 0x69, 0xa5, 0x0b, 0x73, 0x9c, 0x42, 0xeb, 0x0d, 0xeb, 0x94, 0xa3, 0x49, 0x8f, 0xc5, 0x45, 0x0e, 0xb6, 0x9a, 0xce, 0x23, 0x76, 0x76, 0x61, 0xfe, 0xdf, 0x34, 0x18, 0x3a, 0x1b, 0x6f, 0x42, 0x5d, 0xd6, 0xa0 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.2", + /* Message */ + 18, + { 0xa7, 0x57, 0x38, 0x29, 0x1f, 0xad, 0x54, 0x13, 0x95, 0x7f, 0xa3, 0xb9, 0xf3, 0xb2, 0xca, 0xac, 0x9f, 0x5a } +, + /* Seed */ + 107, + { 0x3a, 0x19, 0x1a, 0xaf, 0x45, 0xed, 0x4c, 0x25, 0x89, 0x20, 0x5d, 0x9c, 0xf6, 0xa3, 0x0f, 0x07, 0x70, 0x0e, 0x38, 0xbe, 0x06, 0x25, 0x62, 0x43, 0x01, 0x8d, 0x23, 0xc6, 0x84, 0xda, 0xec, 0xe7, 0xe8, 0x67, 0xe3, 0x9d, 0x76, 0xc6, 0xb6, 0xf0, 0x35, 0x43, 0xfc, 0x15, 0xaf, 0x81, 0xbf, 0x84, 0xf9, 0x64, 0xea, 0xf3, 0xa9, 0x5a, 0x4b, 0x80, 0x86, 0x28, 0xfd, 0x51, 0x55, 0x38, 0x99, 0xf8, 0x11, 0xc0, 0x8c, 0x62, 0x60, 0x9c, 0x51, 0x4c, 0xfa, 0x1d, 0xbb, 0x78, 0xd5, 0xa5, 0xb3, 0x3c, 0xc0, 0xb8, 0x57, 0xfc, 0xb1, 0xee, 0xcc, 0x53, 0x1b, 0x13, 0x26, 0x34, 0x43, 0x90, 0x59, 0xf5, 0x5a, 0x73, 0x3e, 0x14, 0x6e, 0x1c, 0xa1, 0xeb, 0x5a, 0x97, 0xf4 } +, + /* Encryption */ + 128, + { 0x70, 0xaa, 0xf7, 0x24, 0x39, 0x6c, 0x1a, 0xc5, 0x0e, 0xdb, 0xbf, 0xe8, 0x34, 0x1b, 0x08, 0x7b, 0xa0, 0xff, 0xe2, 0x87, 0x60, 0x5a, 0x8c, 0x3a, 0x8c, 0xcf, 0x85, 0xab, 0x2e, 0xd2, 0xfe, 0x22, 0x15, 0x9d, 0x62, 0xaa, 0x02, 0x74, 0x76, 0xeb, 0xbf, 0x07, 0x70, 0x02, 0x6d, 0x2d, 0x3b, 0x0c, 0x0d, 0x77, 0x34, 0xfa, 0xaa, 0xa8, 0xd1, 0x5e, 0x2c, 0xe5, 0x1c, 0x85, 0x53, 0x5c, 0x26, 0xb4, 0x15, 0x0a, 0xd6, 0x34, 0x6e, 0x3b, 0xfd, 0x38, 0xdb, 0x5d, 0xac, 0xf7, 0x52, 0xe7, 0x5d, 0x75, 0x31, 0x40, 0x54, 0xd1, 0x67, 0xa9, 0x6d, 0x81, 0x9f, 0x34, 0x38, 0xa7, 0xbe, 0xc4, 0x46, 0x7f, 0xc5, 0x60, 0xa6, 0x94, 0x46, 0x94, 0x85, 0xe8, 0xe7, 0x8e, 0x47, 0xe4, 0xe8, 0x27, 0x7c, 0xa7, 0xd3, 0xfd, 0x2a, 0xd9, 0x4a, 0x30, 0x46, 0x4c, 0x24, 0x57, 0x85, 0x47, 0x25, 0xc6, 0x16, 0x15 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.3", + /* Message */ + 14, + { 0x87, 0x31, 0x2f, 0x78, 0x7d, 0xe0, 0x65, 0x97, 0x50, 0xd6, 0x02, 0xac, 0x11, 0x02 } +, + /* Seed */ + 111, + { 0xa2, 0x29, 0xe3, 0xe8, 0xef, 0x1c, 0xaa, 0x66, 0xca, 0xf0, 0xd8, 0xac, 0xd8, 0xd6, 0x6b, 0x9e, 0x41, 0xcc, 0x77, 0x1f, 0x26, 0xe2, 0x0f, 0x12, 0xec, 0xc6, 0xe2, 0xaa, 0x38, 0x45, 0x51, 0x3d, 0xd1, 0x34, 0xf7, 0xc6, 0xe5, 0x74, 0xf4, 0x1b, 0x21, 0x5d, 0x1d, 0x11, 0x17, 0x56, 0xda, 0xf9, 0x71, 0xcc, 0xf3, 0x9c, 0xcd, 0xce, 0x78, 0x16, 0x19, 0xd7, 0x97, 0x20, 0xdf, 0x91, 0x8d, 0x33, 0x9c, 0x82, 0x6d, 0xc0, 0x49, 0xb3, 0x90, 0x91, 0x7c, 0x17, 0xba, 0x0f, 0xb1, 0x30, 0x2f, 0xff, 0x11, 0x0a, 0x14, 0xdd, 0x23, 0x84, 0x90, 0x27, 0x41, 0xf9, 0x12, 0xb2, 0x6a, 0x1a, 0xdb, 0xe0, 0xed, 0x1e, 0x8f, 0xd9, 0x89, 0x71, 0x0b, 0x40, 0x3d, 0x27, 0xc4, 0xe0, 0x18, 0xfb, 0x9b } +, + /* Encryption */ + 128, + { 0x03, 0x38, 0x46, 0xd7, 0x66, 0x4c, 0x8f, 0x92, 0x62, 0x57, 0xc7, 0xfd, 0x32, 0x64, 0x48, 0x47, 0x92, 0xac, 0x7f, 0x9b, 0xc8, 0x75, 0x8a, 0x7a, 0x16, 0xab, 0xb8, 0x9f, 0xa3, 0xcc, 0xc4, 0xd1, 0x3a, 0x1e, 0xed, 0x88, 0xaf, 0x73, 0x23, 0xbc, 0x3c, 0x74, 0xe2, 0x3f, 0xda, 0xb5, 0x03, 0x81, 0x89, 0x4c, 0x86, 0x26, 0xdf, 0xd0, 0xac, 0x85, 0x89, 0xd4, 0x62, 0x34, 0xd3, 0xc3, 0x5f, 0x18, 0x99, 0x81, 0x79, 0x44, 0x84, 0x31, 0xdc, 0x81, 0x6f, 0xb6, 0x3e, 0x55, 0xcf, 0x26, 0xd7, 0x4a, 0x9d, 0x2a, 0x09, 0x32, 0x67, 0x3c, 0xb4, 0xbe, 0xb8, 0x29, 0xcd, 0x7d, 0x49, 0x50, 0x88, 0x48, 0xc6, 0xd0, 0xc0, 0x0d, 0x5c, 0x70, 0xf7, 0xfb, 0x47, 0x67, 0x70, 0xe4, 0x03, 0x19, 0x23, 0x7c, 0x78, 0x6b, 0xf4, 0xe2, 0x6c, 0x48, 0xd2, 0xcf, 0xd9, 0x6e, 0xe3, 0x62, 0xbf, 0x29, 0x28, 0x25 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.4", + /* Message */ + 54, + { 0x9a, 0x2b, 0xca, 0x75, 0xe3, 0x26, 0x49, 0x77, 0x7b, 0x9f, 0x13, 0xec, 0x30, 0xfe, 0x16, 0xbb, 0x8a, 0xb4, 0x6d, 0x6d, 0x5e, 0x0c, 0x64, 0x63, 0xa7, 0x3d, 0x8c, 0x36, 0x63, 0xad, 0xab, 0xc7, 0x23, 0xbd, 0xe7, 0x2a, 0x50, 0x76, 0x5e, 0x7b, 0x30, 0x0e, 0xf6, 0xb5, 0x61, 0xde, 0xe8, 0x84, 0x84, 0x88, 0x0e, 0x4d, 0x61, 0x2c } +, + /* Seed */ + 71, + { 0x8b, 0xfa, 0xe9, 0x22, 0x2f, 0x75, 0xa0, 0x69, 0x98, 0xed, 0x6d, 0x9b, 0x14, 0x9e, 0x89, 0x05, 0xcf, 0xc8, 0xdb, 0x05, 0x5a, 0x0e, 0x32, 0xac, 0xed, 0xf8, 0x24, 0xd2, 0xf6, 0xb5, 0xb4, 0x2b, 0x3a, 0xea, 0xc6, 0xa7, 0x10, 0x4e, 0x14, 0x4d, 0x5e, 0x48, 0x34, 0x28, 0x0e, 0x36, 0x44, 0x5a, 0xb8, 0x50, 0xf3, 0xa6, 0xde, 0x16, 0x4c, 0x2c, 0x79, 0x0f, 0xe7, 0xd9, 0xd7, 0xbc, 0x7f, 0x9b, 0xdb, 0xe2, 0x52, 0x17, 0xda, 0x2d, 0xed } +, + /* Encryption */ + 128, + { 0x6e, 0xc5, 0xf5, 0x59, 0xc8, 0xa3, 0x20, 0xd9, 0x0d, 0x1e, 0xb5, 0xef, 0x09, 0x1c, 0x4d, 0x12, 0x55, 0xa2, 0x4a, 0x69, 0x19, 0x41, 0x0e, 0xb1, 0xdf, 0x65, 0xa9, 0x7b, 0x30, 0xcd, 0xd7, 0xfa, 0xe1, 0x8e, 0x65, 0x12, 0xa0, 0x27, 0xe9, 0x76, 0x70, 0x4b, 0x4f, 0xa0, 0x44, 0x37, 0x43, 0x93, 0xd5, 0x01, 0xe2, 0xba, 0x46, 0x18, 0x62, 0x00, 0xef, 0x0d, 0xdd, 0xf1, 0x9c, 0x75, 0x77, 0x58, 0xe4, 0x67, 0x94, 0x30, 0xbc, 0xd9, 0xfd, 0x11, 0x9e, 0xa2, 0x43, 0xb3, 0x49, 0xdc, 0xf8, 0x1c, 0x34, 0x32, 0xd3, 0x1f, 0xba, 0x91, 0x1e, 0xc6, 0xfc, 0x68, 0x6e, 0xaa, 0xdf, 0xf6, 0xb9, 0xfd, 0xf5, 0x3a, 0xa4, 0xc8, 0x5a, 0x49, 0xa2, 0x2a, 0x05, 0x1c, 0x5f, 0x18, 0x07, 0xf3, 0x08, 0x3b, 0x1b, 0x3e, 0x61, 0x17, 0xb4, 0xef, 0x12, 0x08, 0xde, 0x0a, 0x80, 0x01, 0xdc, 0x29, 0x1c, 0x4e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.5", + /* Message */ + 48, + { 0xdf, 0xd6, 0x3e, 0x6e, 0xc6, 0x1e, 0x07, 0x27, 0x5b, 0x8e, 0x37, 0xcc, 0x63, 0x69, 0xe1, 0xf3, 0xec, 0x0b, 0xfc, 0x57, 0xa2, 0x98, 0xb9, 0x05, 0xae, 0x5d, 0x07, 0x74, 0xe0, 0xf5, 0x22, 0xe6, 0x75, 0x9c, 0x7d, 0x11, 0x6f, 0x8e, 0x8e, 0xfe, 0x69, 0x45, 0x0f, 0xa7, 0xa8, 0x38, 0x9f, 0x81 } +, + /* Seed */ + 77, + { 0xc4, 0x22, 0x37, 0x7b, 0x89, 0x86, 0x4b, 0x0d, 0xf3, 0x8b, 0x4f, 0x9c, 0x15, 0xf9, 0x8a, 0x05, 0x96, 0x55, 0xe1, 0xc9, 0xb0, 0xc7, 0x09, 0x63, 0x5c, 0xa6, 0x06, 0x49, 0xd8, 0xd2, 0x47, 0x5e, 0xe1, 0x6c, 0xb1, 0x27, 0xf6, 0x76, 0x39, 0x12, 0x96, 0x4e, 0x19, 0x84, 0xd6, 0xda, 0xad, 0x4d, 0x6a, 0xbd, 0x04, 0xb0, 0x46, 0x18, 0xb3, 0x2e, 0x53, 0x25, 0xba, 0x95, 0xeb, 0x5e, 0x76, 0xdb, 0xd4, 0x6d, 0x9f, 0xb5, 0x9d, 0xf0, 0x7a, 0x08, 0x1e, 0x95, 0x6c, 0xb0, 0x73 } +, + /* Encryption */ + 128, + { 0x9e, 0x06, 0xcd, 0x91, 0xa4, 0x4a, 0x9a, 0xde, 0xa6, 0xa7, 0x98, 0x03, 0xd3, 0xe6, 0xbb, 0xab, 0x17, 0xdb, 0x10, 0x62, 0xb6, 0x51, 0x0b, 0xed, 0x40, 0x07, 0x55, 0x66, 0x74, 0x95, 0x44, 0xc0, 0x3d, 0x7a, 0x78, 0xb1, 0x37, 0xb0, 0xdc, 0x1e, 0x66, 0x26, 0x32, 0x1f, 0xed, 0xaf, 0xc2, 0x0d, 0xcd, 0xbf, 0x70, 0x80, 0xf7, 0xf5, 0xbd, 0xd5, 0x67, 0x44, 0xce, 0x99, 0x9f, 0x76, 0x70, 0x5c, 0x4f, 0x5e, 0x6f, 0xa1, 0x5f, 0x46, 0xc5, 0xae, 0x50, 0x80, 0x90, 0xdb, 0xbc, 0x85, 0xfb, 0x86, 0x89, 0x9c, 0x95, 0x78, 0x60, 0x8d, 0xfd, 0x77, 0x8a, 0xa4, 0xa7, 0x9d, 0x3d, 0x73, 0x63, 0x54, 0xcc, 0xfb, 0xfa, 0x2c, 0x86, 0xf2, 0x9a, 0x7a, 0x58, 0x45, 0x3d, 0x75, 0x7f, 0xd5, 0x22, 0xf7, 0x84, 0x08, 0xd9, 0x91, 0x6b, 0x1b, 0xd0, 0x65, 0x4b, 0xff, 0xe6, 0xe0, 0x66, 0xba, 0xeb, 0x50 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.6", + /* Message */ + 35, + { 0x5d, 0x91, 0xfb, 0xc1, 0xa7, 0xba, 0x79, 0x93, 0x9b, 0x89, 0xa2, 0x40, 0x8c, 0xce, 0x8e, 0xd4, 0xbb, 0x26, 0x66, 0xdd, 0xfe, 0x09, 0xd9, 0x19, 0x21, 0xa0, 0xaa, 0x69, 0x09, 0x6a, 0x95, 0x69, 0x92, 0xc2, 0x1c } +, + /* Seed */ + 90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a5, 0x2a, 0xc9, 0x88, 0xc9, 0x2e, 0x6c, 0x69, 0xb5, 0x80, 0x76, 0x1c, 0x49, 0x88, 0x1f, 0x29, 0xdd, 0x8a, 0x76, 0xda, 0x79, 0x3f, 0x43, 0x2e, 0x7d, 0x5d, 0xc7, 0x31, 0xa2, 0x5e, 0x5b, 0xb5, 0x02, 0x58, 0xd0, 0x27, 0x39, 0x5f, 0xbd } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.7", + /* Message */ + 8, + { 0x04, 0xed, 0xd8, 0x3c, 0x65, 0x65, 0x6a, 0x01 } +, + /* Seed */ + 117, + { 0x88, 0xf9, 0xa2, 0x71, 0x97, 0xf9, 0xf2, 0x57, 0xfa, 0x81, 0xc0, 0xe3, 0x05, 0x90, 0xb7, 0x3e, 0x9e, 0x11, 0xc7, 0x6b, 0xc8, 0x9e, 0x08, 0x53, 0x6b, 0x4b, 0x64, 0xa2, 0x50, 0x6a, 0xeb, 0x33, 0xb4, 0x50, 0x74, 0x73, 0x08, 0x09, 0xa0, 0x5c, 0x45, 0xb9, 0xbc, 0x95, 0x71, 0x73, 0x69, 0xcf, 0x92, 0xc1, 0xbf, 0x98, 0x6e, 0x53, 0xba, 0x11, 0x23, 0x83, 0x30, 0xfd, 0xc4, 0xe0, 0x5e, 0xa1, 0x07, 0x33, 0x4a, 0xb3, 0x11, 0x06, 0xae, 0xbd, 0x9c, 0x6c, 0x29, 0xe5, 0x01, 0xa5, 0x7d, 0x99, 0x7c, 0x01, 0xbb, 0xc1, 0x01, 0x0b, 0xd5, 0x2f, 0x05, 0x38, 0xb9, 0x51, 0x59, 0xf3, 0x91, 0x32, 0x0d, 0xe6, 0xdb, 0x23, 0xd8, 0x16, 0x2c, 0xf1, 0x46, 0x58, 0x4c, 0x6e, 0x07, 0x6c, 0x4e, 0xae, 0x86, 0x20, 0x72, 0xeb, 0x5b } +, + /* Encryption */ + 128, + { 0x79, 0x1b, 0x37, 0x91, 0x48, 0xa8, 0x3a, 0x03, 0x4d, 0x31, 0x2a, 0x82, 0xbb, 0xb3, 0x7b, 0x11, 0x1b, 0x40, 0xbc, 0xf6, 0xa3, 0x37, 0xfd, 0xe2, 0x89, 0xb0, 0x8e, 0x07, 0x2e, 0x44, 0x03, 0x19, 0x73, 0xff, 0x9d, 0x0c, 0x27, 0xf7, 0x0d, 0x64, 0xa8, 0xea, 0xfc, 0x6e, 0xb5, 0xf8, 0xeb, 0x4e, 0x52, 0xe2, 0xc4, 0x19, 0x7e, 0xcf, 0xa5, 0x45, 0xed, 0x63, 0xae, 0x9a, 0x12, 0x83, 0x79, 0xd3, 0xf5, 0x62, 0xa1, 0x8f, 0xe3, 0xad, 0x14, 0x05, 0x27, 0x67, 0xf0, 0x54, 0x1b, 0x90, 0x16, 0x81, 0x85, 0xcb, 0xb7, 0x8d, 0xb6, 0x03, 0x81, 0xc0, 0x92, 0xbc, 0x23, 0xe1, 0xaa, 0x05, 0xb4, 0x08, 0x92, 0xf9, 0xa1, 0x16, 0xe6, 0x25, 0xcb, 0x14, 0x8b, 0x56, 0x07, 0x42, 0xcc, 0x12, 0x78, 0xc4, 0xd2, 0x1a, 0x4a, 0x7d, 0x37, 0xf6, 0x98, 0x2a, 0xee, 0x27, 0xf2, 0xa4, 0xc0, 0xc5, 0x73, 0xd2 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.8", + /* Message */ + 25, + { 0x3f, 0x7e, 0xea, 0x78, 0x1b, 0x77, 0xd8, 0x5f, 0xe3, 0x71, 0xb3, 0xe9, 0x37, 0x3e, 0x7b, 0x69, 0x21, 0x7d, 0x31, 0x50, 0xa0, 0x2d, 0x89, 0x58, 0xde } +, + /* Seed */ + 100, + { 0x49, 0x99, 0xc6, 0x4c, 0xbf, 0xa3, 0x85, 0x24, 0xad, 0xca, 0xb6, 0x6f, 0x64, 0x45, 0x4d, 0x36, 0xfb, 0xfc, 0xb2, 0x98, 0x6e, 0x1f, 0xa4, 0x75, 0x3a, 0x0e, 0x03, 0x88,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 0x14, 0x41, 0x4d, 0xfb, 0x15, 0x77, 0xd7, 0x19, 0xa9, 0x58, 0x82, 0x64, 0x71, 0x2d, 0xe3, 0xbf, 0x4a, 0x76, 0x79 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.9", + /* Message */ + 47, + { 0xa3, 0x85, 0x08, 0xd9, 0x46, 0x0c, 0x63, 0xf4, 0x15, 0x81, 0xa8, 0x86, 0x9a, 0x75, 0x82, 0x4b, 0x14, 0xf5, 0xc6, 0x50, 0x32, 0x29, 0x99, 0xdc, 0x41, 0x13, 0x50, 0xd0, 0xd4, 0xe8, 0x62, 0x4f, 0xf0, 0x9c, 0xeb, 0x00, 0xd3, 0xbe, 0xdc, 0x5d, 0x76, 0x2a, 0x40, 0xc9, 0x39, 0x80, 0x04 } +, + /* Seed */ + 78, + { 0x6a, 0x0a, 0x28, 0x8a, 0x1e, 0x67, 0x43, 0x0c, 0x66, 0x6a, 0xeb, 0xea, 0x44, 0xb5, 0x82, 0xa9, 0x09, 0x69, 0xcc, 0x01, 0xe9, 0x0a, 0xae, 0x10, 0x53, 0xce, 0x55, 0xee, 0xb9, 0x87, 0x9b, 0xcc, 0x62, 0x25, 0x39, 0x15, 0xe9, 0x22, 0xf1, 0x09, 0x66, 0x67, 0xbd, 0xa0, 0x2a, 0x14, 0xe7, 0x07, 0x47, 0xb3, 0x59, 0x35, 0x24, 0xc2, 0x84, 0x85, 0x47, 0xd2, 0x11, 0x4d, 0x1d, 0x0c, 0xdc, 0xb9, 0x7e, 0xb4, 0xdf, 0x45, 0x5b, 0xba, 0xc9, 0xb0, 0xcc, 0x29, 0x08, 0x39, 0xb7, 0x3a } +, + /* Encryption */ + 128, + { 0xa6, 0x77, 0x57, 0x80, 0x8f, 0x5a, 0xbd, 0xc8, 0x1e, 0xdb, 0x7f, 0x69, 0x2f, 0x9f, 0xb8, 0x52, 0xf1, 0xa1, 0x66, 0x1c, 0x4a, 0x00, 0x98, 0x05, 0xc4, 0x4b, 0x21, 0x6c, 0xd3, 0xb1, 0x32, 0x2b, 0xbb, 0x25, 0xd1, 0x45, 0x8e, 0x31, 0xb0, 0xf0, 0x7d, 0x65, 0x50, 0x57, 0x59, 0xc4, 0xb4, 0x14, 0x7f, 0x23, 0xcb, 0xee, 0x2a, 0xf4, 0xa1, 0xa5, 0x93, 0x8a, 0x06, 0x8c, 0xe9, 0xc5, 0x32, 0x3f, 0xf5, 0x3f, 0x4b, 0x39, 0x2e, 0x12, 0x50, 0xd0, 0x37, 0xb3, 0x1e, 0x62, 0x81, 0xdc, 0xdf, 0xb9, 0x6b, 0xf4, 0xbf, 0xea, 0xa1, 0x47, 0xf0, 0x96, 0xc7, 0x84, 0xc9, 0x2f, 0x4a, 0xc5, 0x70, 0x91, 0x12, 0x28, 0x02, 0x50, 0x29, 0xc3, 0xb5, 0x23, 0x30, 0x3f, 0xe8, 0x22, 0x7e, 0x8b, 0x2c, 0xc0, 0xef, 0x15, 0x70, 0x14, 0xcb, 0x67, 0x31, 0xaa, 0xc0, 0x9b, 0xfe, 0x6f, 0xfa, 0x18, 0xea, 0xf6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.10", + /* Message */ + 28, + { 0xf7, 0x84, 0x05, 0x23, 0x6a, 0x9e, 0xb5, 0x57, 0xaa, 0xce, 0xc6, 0x00, 0x7d, 0xbc, 0x4c, 0x0e, 0xde, 0x78, 0xed, 0x12, 0xb0, 0x4c, 0x82, 0x88, 0x8a, 0x82, 0xc2, 0x13 } +, + /* Seed */ + 97, + { 0x86, 0xf0, 0x72, 0x3b, 0x31, 0x68, 0xe2, 0xae, 0xac, 0xe9, 0xec, 0x2e, 0x95, 0xfd, 0xa6, 0xe6, 0xd6, 0xfc, 0x8d, 0x62, 0x94, 0x55, 0x65, 0x66, 0x39, 0x9d, 0x73, 0x11, 0xe7, 0x99, 0xfa, 0xa9, 0xb1, 0xee, 0x1f, 0x03, 0x2a, 0xb2, 0xe5, 0x34, 0xa9, 0x1f, 0xbc, 0xd0,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} + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.11", + /* Message */ + 40, + { 0x56, 0x1d, 0x27, 0xc1, 0xd3, 0xf6, 0xd5, 0xd1, 0xa6, 0x43, 0xaa, 0x47, 0xe5, 0x5d, 0x78, 0xeb, 0x00, 0xf3, 0x2d, 0x42, 0x89, 0x6a, 0x34, 0xe0, 0xc1, 0xd7, 0x1b, 0xc3, 0xa5, 0x45, 0x7c, 0x92, 0x05, 0xbe, 0xd1, 0x3b, 0x98, 0x4c, 0x52, 0x59 } +, + /* Seed */ + 85, + { 0x98, 0x17, 0x6e, 0x1d, 0x67, 0xa2, 0x46, 0x2f, 0x5d, 0xc1, 0xbf, 0xa6, 0xe0, 0x75, 0x95, 0x42, 0x10, 0x4a, 0xc1, 0x48, 0x11, 0xd3, 0x18, 0x79, 0x38, 0x25, 0x04, 0x55, 0xc6, 0x5e, 0x4a, 0xaa, 0x76, 0x32, 0xbd, 0x2d, 0x1d, 0x75, 0x2e, 0x1f, 0x34, 0xc5, 0x3c, 0xab, 0x26, 0x76, 0x76, 0xa7, 0x8c, 0x10, 0xc9, 0x98, 0xe7, 0x73, 0xfd, 0x8f, 0xfe, 0x35, 0xc8, 0x67, 0xc4, 0x43, 0xbe, 0xf7, 0x98, 0x65, 0xaa, 0x2d, 0xa2, 0x91, 0x5a, 0x85, 0xc7, 0x02, 0x63, 0x23, 0x69, 0x3e, 0x45, 0x4d, 0x8a, 0xb3, 0x2a, 0x77, 0x15 } +, + /* Encryption */ + 128, + { 0x0b, 0xc0, 0x47, 0x83, 0xc6, 0x92, 0x44, 0x7a, 0x3d, 0xe6, 0x1f, 0x53, 0xb7, 0x2f, 0x7a, 0xa4, 0x10, 0x31, 0x6d, 0xd5, 0x09, 0xa6, 0xf4, 0x9e, 0x3a, 0xba, 0x56, 0xad, 0x1f, 0xf8, 0x6e, 0xbe, 0x9e, 0x63, 0x66, 0xe1, 0x7e, 0x51, 0x45, 0x00, 0x76, 0xbe, 0xa3, 0x71, 0xd4, 0xc6, 0x89, 0xcd, 0x61, 0x49, 0x5c, 0xd8, 0xfa, 0x29, 0xc0, 0xe8, 0x7b, 0x6d, 0xbf, 0xa8, 0xe3, 0x86, 0xc2, 0xe8, 0x20, 0xe4, 0xc7, 0x42, 0xa4, 0x87, 0xe8, 0x9b, 0x27, 0x5a, 0x21, 0x86, 0xe2, 0x38, 0x40, 0xbe, 0x9c, 0x02, 0x52, 0x7b, 0xa7, 0x17, 0xe9, 0xe6, 0x0b, 0x5b, 0xf4, 0x17, 0x71, 0x1d, 0xf3, 0x4d, 0x7b, 0x8e, 0x2d, 0x12, 0xbc, 0xeb, 0x85, 0x93, 0x85, 0xfa, 0x00, 0x1d, 0x4b, 0x4b, 0xff, 0xbb, 0xc0, 0xed, 0xef, 0xbd, 0x40, 0x02, 0x41, 0x84, 0x68, 0xc5, 0x66, 0xfd, 0xf6, 0xb8, 0x35, 0x09 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.12", + /* Message */ + 45, + { 0xeb, 0x5f, 0x8c, 0x0d, 0xc9, 0xd9, 0x01, 0x06, 0x1b, 0x82, 0xae, 0xff, 0x8d, 0x67, 0xd8, 0xbf, 0xfc, 0x0c, 0x04, 0x7e, 0xcc, 0x4a, 0xa3, 0x46, 0xb2, 0x3b, 0xdb, 0xa6, 0x2a, 0x87, 0xe9, 0xdc, 0x77, 0x0b, 0x11, 0x69, 0x5f, 0xbf, 0x19, 0x02, 0xf2, 0x4b, 0x66, 0xce, 0xab } +, + /* Seed */ + 80, + { 0x74, 0x82, 0x77, 0x0f, 0x3c, 0xf5, 0x7e, 0xdb, 0x81, 0x40, 0xeb, 0xc3, 0x3a, 0x02, 0x82, 0x45, 0xee, 0x06, 0x48, 0x52, 0x06, 0x89, 0xa5, 0x0e, 0x33, 0xf5, 0xf4, 0x67, 0xf6, 0xd1, 0xe4, 0x32, 0x4e, 0x1c, 0x50, 0xc8, 0x99, 0xe5, 0xad, 0x2c, 0x46, 0xc9, 0x7f, 0x81, 0x20, 0xd1, 0xc7, 0x22, 0x39, 0xd6, 0xa8, 0x2d, 0x8f, 0x8e, 0xbc, 0x80, 0xb9, 0x73, 0xee, 0xa8, 0xc5, 0x45, 0x69, 0x29, 0x50, 0x45, 0x14, 0xb4, 0xb1, 0x56, 0x62, 0x84, 0x4f, 0x29, 0x50, 0x62, 0xf2, 0x1e, 0xbd, 0x92 } +, + /* Encryption */ + 128, + { 0xb8, 0x40, 0x43, 0x54, 0xa3, 0x81, 0xb7, 0xc2, 0xab, 0xe5, 0xf7, 0x28, 0x25, 0xf3, 0xd3, 0x15, 0xbd, 0xac, 0xe6, 0xc3, 0xcf, 0xbd, 0x88, 0xb8, 0x97, 0x68, 0x61, 0x20, 0x05, 0x19, 0x7c, 0x61, 0x66, 0x38, 0x83, 0xf2, 0xc2, 0x57, 0x4f, 0x99, 0x5e, 0xa6, 0xf9, 0x4e, 0xb3, 0x4f, 0x27, 0x68, 0x62, 0xb3, 0x3f, 0x58, 0xa8, 0x83, 0x92, 0x23, 0x70, 0x6b, 0xe1, 0xc1, 0xff, 0x47, 0x23, 0x05, 0xf1, 0x1b, 0xa9, 0x56, 0x2a, 0x0e, 0xb0, 0x12, 0xf1, 0xaa, 0xf8, 0x5c, 0x22, 0xe8, 0x8f, 0x2f, 0xdf, 0xea, 0xff, 0x86, 0x33, 0xd3, 0xcf, 0xeb, 0x5f, 0x76, 0x4f, 0x42, 0x28, 0x92, 0x0d, 0xe3, 0x0c, 0x6b, 0xde, 0x2c, 0xb4, 0xe8, 0xf0, 0x3d, 0x90, 0xed, 0x54, 0x8f, 0x64, 0x85, 0x00, 0x35, 0x1a, 0x5f, 0x41, 0xdf, 0x74, 0xad, 0x65, 0xe8, 0xc3, 0xbe, 0xe9, 0x50, 0x5a, 0x7d, 0x70, 0xe1 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.13", + /* Message */ + 48, + { 0x5a, 0x7f, 0x0e, 0xae, 0xba, 0xe4, 0x9c, 0xf5, 0x7c, 0x47, 0x5a, 0x6d, 0xa6, 0x79, 0x43, 0xa7, 0xd3, 0x04, 0x6e, 0x3f, 0x7c, 0x7d, 0x50, 0xb0, 0x9a, 0x80, 0x98, 0xb5, 0x44, 0x69, 0x39, 0x68, 0x93, 0xcf, 0xc0, 0xb2, 0xf0, 0x8f, 0x6c, 0x2b, 0xff, 0x23, 0x50, 0x51, 0x57, 0x5e, 0x6e, 0x56 } +, + /* Seed */ + 77, + { 0xfb, 0x08, 0x48, 0x86, 0xdb, 0x37, 0x98, 0xd2, 0xb5, 0xbb, 0x35, 0xa3, 0xb1, 0xd3, 0xaf, 0x4f, 0xdf, 0xc0, 0x45, 0x6c, 0xbc, 0x79, 0x7b, 0x96, 0x40, 0xd8, 0xc4, 0x4a, 0x0e, 0x03, 0x4e, 0x40, 0x37, 0x2b, 0x34, 0xfc, 0x7c, 0x1e, 0x8b, 0x66, 0x01, 0x1b, 0x4e, 0xcd, 0xfa, 0xec, 0x6e, 0xe4, 0xcd, 0xc8, 0x28, 0xcb, 0x1a, 0xb4, 0x91, 0x27, 0x4a, 0xc1, 0xe3, 0x9f, 0x67, 0x58, 0x7a, 0x55, 0x47, 0x67, 0x09, 0xb4, 0x02, 0x3f, 0xc5, 0x69, 0xcb, 0xe8, 0xb4, 0xfd, 0x4b } +, + /* Encryption */ + 128, + { 0x07, 0x78, 0x4e, 0xcb, 0x8c, 0xc5, 0xba, 0x02, 0xd2, 0x07, 0xba, 0xb0, 0x55, 0xc0, 0xe5, 0x5d, 0x10, 0xa9, 0xb9, 0x42, 0x70, 0xcc, 0xa2, 0x50, 0xee, 0x75, 0xfa, 0x1b, 0x5a, 0xe1, 0x90, 0xb3, 0x3b, 0x96, 0x96, 0xeb, 0x2e, 0xc9, 0x72, 0xb2, 0x6a, 0x0e, 0x94, 0x23, 0xaf, 0x16, 0xaa, 0x37, 0x89, 0x17, 0x62, 0x76, 0x06, 0x0a, 0x76, 0x40, 0x03, 0x21, 0x11, 0x74, 0x82, 0x96, 0x34, 0x03, 0x4f, 0x97, 0x12, 0xc9, 0x17, 0x10, 0x17, 0xf2, 0xfb, 0x21, 0x3f, 0x25, 0xc1, 0x46, 0xc2, 0x65, 0x1f, 0x89, 0x44, 0x0c, 0xa5, 0x36, 0xe5, 0x33, 0xe3, 0x05, 0xcc, 0x6b, 0x01, 0x13, 0x39, 0x8f, 0x61, 0xb4, 0x63, 0xb0, 0x73, 0xe1, 0xbe, 0x05, 0x07, 0x3e, 0x9d, 0x64, 0xbc, 0xae, 0xea, 0x54, 0x44, 0xb8, 0x20, 0xc6, 0xab, 0xf3, 0x46, 0x54, 0x30, 0xff, 0x4d, 0xe4, 0xa8, 0xbc, 0x0e, 0x75 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.14", + /* Message */ + 47, + { 0xf9, 0x1c, 0x71, 0xaf, 0x5a, 0xea, 0xca, 0xe1, 0x79, 0xe1, 0x6e, 0x87, 0xc9, 0x02, 0x3b, 0xa9, 0x4d, 0x84, 0xd7, 0x51, 0x6c, 0xec, 0x6c, 0x39, 0x89, 0x80, 0x1f, 0xb3, 0xe7, 0xad, 0xd0, 0x64, 0xbd, 0xdf, 0x92, 0x8b, 0x50, 0x00, 0x94, 0x0b, 0xbd, 0xe5, 0x39, 0xd6, 0x23, 0x37, 0x9c } +, + /* Seed */ + 78, + { 0xde, 0xb2, 0x60, 0x25, 0x8b, 0xe2, 0xc8, 0x53, 0x35, 0x21, 0x57, 0xb0, 0x65, 0x26, 0xb1, 0x43, 0xba, 0x13, 0x3c, 0x4f, 0x49, 0xbf, 0x3d, 0xf2, 0xc0, 0x50, 0xec, 0xb2, 0xc9, 0xca, 0x32, 0x53, 0x11, 0xb3, 0xc3, 0xe3, 0xd8, 0x8d, 0xf6, 0xc2, 0x4a, 0x89, 0x4e, 0xab, 0x63, 0x74, 0x5b, 0x62, 0x53, 0xe3, 0xc4, 0x6b, 0xca, 0x17, 0x1a, 0x26, 0xa4, 0xf2, 0xfc, 0x0a, 0xb6, 0x2b, 0x8a, 0x2e, 0x63, 0xa0, 0x18, 0xeb, 0x47, 0x01, 0x8c, 0xab, 0x95, 0x1f, 0x59, 0xf0, 0x20, 0x3a } +, + /* Encryption */ + 128, + { 0x0d, 0xff, 0xff, 0x51, 0x97, 0x10, 0xc9, 0xea, 0xdc, 0x53, 0x3b, 0x10, 0x8a, 0x4c, 0x29, 0x74, 0xfe, 0x53, 0x18, 0x91, 0xa3, 0x41, 0x07, 0xa6, 0x74, 0x27, 0x93, 0x5b, 0xa7, 0x20, 0xcd, 0xc6, 0xf6, 0xee, 0x02, 0x9a, 0x1b, 0x03, 0x68, 0x61, 0xdb, 0x14, 0x04, 0xc5, 0x86, 0x49, 0x90, 0x54, 0x1f, 0xa2, 0x42, 0x13, 0x01, 0xa7, 0xb2, 0x48, 0xcb, 0x11, 0xf3, 0x65, 0xb6, 0xa4, 0xaa, 0x94, 0x6f, 0x22, 0x31, 0xcb, 0xb1, 0x47, 0x32, 0xb0, 0x1a, 0xa4, 0xa6, 0x0b, 0xcb, 0xe5, 0x20, 0xec, 0x6c, 0x38, 0x53, 0xa6, 0x95, 0x8a, 0x93, 0xc5, 0xb6, 0x8b, 0x85, 0xd4, 0xbc, 0x3d, 0x84, 0x15, 0xef, 0x8b, 0x1d, 0x4f, 0x63, 0x03, 0x8f, 0x4d, 0x94, 0x2c, 0xa6, 0xbc, 0x7a, 0x38, 0x25, 0x1f, 0x15, 0xa4, 0xe3, 0x3b, 0x18, 0x9c, 0x25, 0x0b, 0xcf, 0xbc, 0x03, 0x15, 0x6e, 0x4f, 0x92, 0x11 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.15", + /* Message */ + 28, + { 0x07, 0x90, 0xc0, 0x81, 0xf3, 0x61, 0xc9, 0x5b, 0x59, 0xd5, 0x27, 0xd3, 0xcb, 0x50, 0x71, 0x0e, 0x66, 0xe2, 0x72, 0x59, 0x50, 0x10, 0x25, 0xed, 0x3f, 0x20, 0xf3, 0x0c } +, + /* Seed */ + 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, 0x0c, 0x6c, 0xc5, 0x52, 0x05, 0x86, 0x7f, 0x39, 0x04, 0xed, 0x60, 0xf5, 0xb5, 0xbe, 0xdf, 0x7c, 0x3b, 0x3c, 0x7d, 0xd5, 0xf3, 0x87, 0x54, 0x8f, 0x40, 0x05, 0x67, 0x02, 0xea, 0x72, 0x01, 0x76, 0xdc, 0xe2, 0x06, 0xd4, 0x13, 0xd7, 0x42, 0x3f, 0x94, 0x3f, 0xcd, 0xf6, 0x39 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.16", + /* Message */ + 64, + { 0x93, 0xc4, 0x1a, 0x1a, 0xdd, 0xa8, 0xf6, 0x93, 0x60, 0xf4, 0x1a, 0x58, 0xec, 0xa0, 0xb5, 0x5e, 0xcb, 0x37, 0xa6, 0xa9, 0x00, 0xfb, 0xc7, 0xda, 0xcd, 0x9c, 0xa3, 0x99, 0xc2, 0x3d, 0x31, 0x72, 0x61, 0x53, 0x77, 0xac, 0x0c, 0xc6, 0xb0, 0xed, 0x43, 0xbf, 0x59, 0x7f, 0x21, 0xcd, 0x25, 0x9d, 0x8f, 0x80, 0x88, 0x7b, 0x15, 0x9d, 0x96, 0xd6, 0x61, 0x61, 0xd5, 0x58, 0x9b, 0x95, 0xf1, 0xfe } +, + /* Seed */ + 61, + { 0x99, 0x1a, 0x2a, 0x7c, 0x06, 0x1c, 0x23, 0xa8, 0xeb, 0xc9, 0x48, 0x9a, 0xbc, 0x1b, 0x4a, 0x64, 0xa5, 0xd4, 0xe8, 0x38, 0xd9, 0xfc, 0xba, 0x42, 0x88, 0xc0, 0x1f, 0xea, 0xd6, 0x6d, 0x59, 0xf4, 0x96, 0x36, 0xe4, 0xa8, 0xd7, 0x52, 0x4c, 0xb8, 0x9d, 0x7a, 0xdc, 0x7a, 0xf3, 0xf6, 0x1a, 0xe6, 0xb3, 0x9b, 0x58, 0x8f, 0xb7, 0x7e, 0xb7, 0x02, 0x23, 0x62, 0xff, 0xd2, 0x6b } +, + /* Encryption */ + 128, + { 0x7e, 0x54, 0xa4, 0x32, 0xf5, 0x25, 0xc5, 0x23, 0x33, 0xab, 0xe3, 0xbb, 0x45, 0x48, 0x7e, 0x03, 0x9a, 0xf9, 0x4d, 0xd3, 0xef, 0xc3, 0x58, 0x44, 0xdd, 0x8e, 0x83, 0x5e, 0xe1, 0x00, 0x61, 0x78, 0xe2, 0x4d, 0xcd, 0x19, 0xfc, 0x07, 0x66, 0x7b, 0x4a, 0x34, 0xf3, 0xbd, 0x77, 0x1d, 0x09, 0xa7, 0xe2, 0x9f, 0x8c, 0xa1, 0x7e, 0x88, 0xd0, 0x29, 0xb9, 0x0d, 0xdb, 0x5f, 0x28, 0x13, 0xbe, 0x99, 0x00, 0x0d, 0x59, 0xf5, 0x43, 0x2c, 0x46, 0x6a, 0x84, 0x28, 0x75, 0x77, 0x20, 0x4b, 0xf7, 0x65, 0x97, 0x39, 0x27, 0x69, 0x98, 0x30, 0x57, 0x47, 0x66, 0x7f, 0xaf, 0xd8, 0x02, 0x9c, 0xdc, 0xbb, 0x59, 0x18, 0x39, 0x3c, 0x2c, 0xfc, 0xe4, 0xd8, 0x4a, 0x92, 0x20, 0xea, 0x3e, 0x38, 0x19, 0x72, 0x53, 0x36, 0xf2, 0x5f, 0xee, 0x8e, 0x08, 0x5d, 0xeb, 0xed, 0x33, 0x32, 0xd5, 0xdd, 0xf1, 0xee } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.17", + /* Message */ + 60, + { 0x9e, 0x2a, 0x7b, 0x37, 0x74, 0xb1, 0x1e, 0x62, 0xb6, 0x49, 0x0b, 0x56, 0x51, 0xa0, 0xc1, 0x8e, 0x09, 0x2e, 0x9f, 0xab, 0x8b, 0x22, 0x84, 0xae, 0x46, 0x43, 0xbe, 0xc3, 0x6b, 0x26, 0x5e, 0x5b, 0xa3, 0xc5, 0x1a, 0xc3, 0x85, 0xb2, 0xc7, 0x3d, 0x22, 0x0b, 0x2d, 0xc2, 0xe1, 0x0b, 0x0d,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70, 0x59, 0x56, 0x62, 0x62, 0x6c, 0xf9, 0x6a, 0xc0, 0x5a, 0x7c, 0x8b, 0x10, 0x33, 0x33, 0xe9, 0x06, 0xe1, 0x32, 0x63, 0x9b, 0x65, 0xa7, 0x66, 0xf4, 0x09, 0x2c, 0x8c, 0xa0, 0x78 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.18", + /* Message */ + 61, + { 0x0a, 0xc5, 0x2d, 0x40, 0x01, 0xf2, 0x5c, 0x2c, 0x9d, 0xb9, 0x1c, 0xe5, 0x0b, 0xdd, 0xf0, 0xd5, 0x91, 0x9e, 0x19, 0x96, 0x2e, 0x83, 0xb0, 0x7c, 0xb7, 0x9a, 0xdb, 0x00, 0x43, 0x6e, 0x13, 0x66, 0xb0, 0xaa, 0x8f, 0x3f, 0xd1, 0xee, 0x79, 0x6b, 0x23, 0xc8, 0xbc, 0x56, 0x0c, 0xcf, 0xa4, 0xbc, 0xbd, 0xb1, 0xf8, 0x40, 0x4d, 0xd6, 0xf7, 0x55, 0x15, 0x20, 0xd7, 0xd9, 0xe2 } +, + /* Seed */ + 64, + { 0x22, 0xff, 0xdc, 0xfe, 0xc6, 0xf0, 0x6b, 0x1b, 0xbd, 0x14, 0x53, 0x97, 0x70, 0x43, 0xa3, 0x4e, 0xdd, 0xf8, 0x59, 0x4d, 0xa0, 0x22, 0x13, 0x09, 0x14, 0x97, 0x55, 0x42, 0xf2, 0xf0, 0x0e, 0x98, 0xf3, 0x1e, 0x0d, 0xd0, 0xc4, 0x8f, 0x7e, 0xe5, 0xf0, 0x9d, 0x6a, 0x52, 0x71, 0x21, 0xad, 0x23, 0x37, 0x1c, 0x6c, 0xd0, 0xe0, 0x79, 0x0e, 0xb7, 0x30, 0x8b, 0xbb, 0x08, 0x96, 0xdd, 0x59, 0x0d } +, + /* Encryption */ + 128, + { 0xb2, 0x69, 0x57, 0xc5, 0x62, 0x29, 0x4d, 0xe1, 0xf3, 0x93, 0x24, 0xb1, 0xcd, 0x80, 0x3c, 0xfc, 0x39, 0xfc, 0xee, 0x2d, 0x3c, 0x9d, 0x13, 0x79, 0xf8, 0xa1, 0x12, 0x07, 0x9d, 0x69, 0x43, 0x68, 0xf5, 0x55, 0x03, 0xc2, 0x09, 0x4d, 0x98, 0x8a, 0x8a, 0x5b, 0x5a, 0xc5, 0x49, 0xbe, 0x1c, 0xf5, 0x53, 0x16, 0x04, 0x5d, 0xf5, 0xb6, 0xf6, 0x33, 0xa4, 0xef, 0x1e, 0x1f, 0x01, 0x9b, 0xa1, 0xb5, 0x42, 0xbf, 0x0a, 0x87, 0xfa, 0x3e, 0x5c, 0xa3, 0xf6, 0xb6, 0x1c, 0xc8, 0x56, 0x61, 0x28, 0xa0, 0xfa, 0x41, 0x8b, 0x08, 0x25, 0xc9, 0x0e, 0xc2, 0xf1, 0xec, 0x74, 0xe5, 0x87, 0xcd, 0x80, 0x57, 0xd9, 0x52, 0x96, 0x7a, 0xc4, 0x52, 0x1c, 0xcd, 0xbf, 0x63, 0x26, 0xf3, 0x50, 0x93, 0x00, 0x93, 0x82, 0x6d, 0x2e, 0xfa, 0x05, 0x8e, 0xd6, 0x44, 0x15, 0x37, 0x4d, 0xb3, 0x20, 0x48, 0x85, 0xca } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.19", + /* Message */ + 13, + { 0xa8, 0x00, 0x34, 0x62, 0xf8, 0x06, 0xb7, 0xf6, 0x61, 0xfb, 0x66, 0x46, 0x32 } +, + /* Seed */ + 112, + { 0xc7, 0x43, 0xf4, 0xa6, 0xda, 0x03, 0xab, 0x2d, 0xe5, 0xa7, 0x31, 0xcb, 0x88, 0xd8, 0xca, 0x9b, 0x61, 0xc7, 0x31, 0x9a, 0x5f, 0x8b, 0xf9, 0xd2, 0x37, 0x87, 0x7a, 0x05, 0xd0, 0xf3, 0x68, 0xc3, 0x60, 0x8a, 0x05, 0x2a, 0xc6, 0xce, 0x13, 0x73, 0x17, 0x95, 0x47, 0x55, 0x42, 0xea, 0x16,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0x6d, 0x09, 0xd9, 0x03, 0x49, 0x1f, 0x21, 0x09, 0x6c, 0x34, 0xc3, 0x95, 0x3b } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 3.20", + /* Message */ + 2, + { 0xef, 0x32 } +, + /* Seed */ + 123, + { 0x43, 0x99, 0xcb, 0x04, 0x4a, 0x60, 0x07, 0x6d, 0x18, 0xcc, 0xb3, 0x4e, 0x8b, 0x07, 0x8c, 0x81, 0x8e, 0xa7, 0x7f, 0x63, 0xb0, 0xa4, 0x3a, 0xbd, 0xec, 0xc5, 0x77, 0x81, 0x93, 0xa8, 0xbb, 0xba, 0x5d, 0x56, 0xd0, 0xfc, 0x4e, 0x82, 0xa2, 0x11, 0x51, 0x6b, 0xbd, 0xef, 0x44, 0xe7, 0xf4, 0xe7, 0xfe, 0xbb, 0xe1, 0xe1, 0x92, 0x3c, 0x99, 0x9a, 0x7e, 0x96, 0x1c, 0xd6, 0xee, 0x1c, 0x41, 0x6a, 0x85, 0x96, 0xe2, 0x4b, 0x63, 0x83, 0xa4, 0x69, 0x93, 0x5f, 0x33, 0xd1, 0x56, 0xfd, 0x5b, 0xcf, 0xdb, 0xd4, 0x27, 0x46, 0x0d, 0x48, 0x66, 0x83, 0x06, 0x1e, 0x41, 0x05, 0xf3, 0x5b, 0x5e, 0x75, 0x23, 0x20, 0x15, 0x5c, 0x7f, 0x69, 0xad, 0x8e, 0xb4, 0x02, 0xcc, 0x11, 0x06, 0xe0, 0x28, 0x9a, 0x9b, 0x49, 0x65, 0x82, 0x3e, 0x7a, 0x51, 0xcf, 0xe4, 0xd2, 0x6d } +, + /* Encryption */ + 128, + { 0x13, 0x1b, 0x62, 0x5e, 0x86, 0xe6, 0xcd, 0x1e, 0x08, 0xac, 0xf1, 0x95, 0xd9, 0x3c, 0xd3, 0xa0, 0xdc, 0x8b, 0xa9, 0xe2, 0xdc, 0xd6, 0xfc, 0x99, 0x6b, 0xe2, 0x17, 0x24, 0xaf, 0x17, 0x90, 0xb6, 0x88, 0xd7, 0x9d, 0x3e, 0xa9, 0xa9, 0x50, 0x98, 0xca, 0xbb, 0xe8, 0xa5, 0xd4, 0x85, 0x92, 0xe4, 0x74, 0x6b, 0x0e, 0xd2, 0xaf, 0x7c, 0xaf, 0x89, 0xb7, 0xb6, 0x15, 0x2e, 0x38, 0x24, 0xd9, 0x15, 0x89, 0xee, 0xec, 0x33, 0x75, 0xc7, 0x1a, 0x89, 0x97, 0x48, 0x70, 0x3a, 0xcc, 0x1e, 0x8d, 0x1d, 0xe4, 0x71, 0xea, 0x75, 0x28, 0x04, 0x0b, 0x79, 0x5f, 0x29, 0x9e, 0x66, 0x8c, 0xec, 0x9f, 0x5a, 0xf3, 0xeb, 0x48, 0xf9, 0x8c, 0x0d, 0x85, 0x20, 0x67, 0x77, 0x3e, 0x10, 0x1f, 0xa2, 0x4a, 0xeb, 0x6b, 0x40, 0x4d, 0xaf, 0xb4, 0x2e, 0x7a, 0x63, 0xb0, 0x4a, 0x66, 0xbd, 0x0e, 0x9f, 0x9c, 0x94 } + +} +, +} +}, +{ + "Example 4: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xe9, 0xf2, 0x5e, 0x48, 0x14, 0x0b, 0x5d, 0xcf, 0x46, 0x99, 0xe3, 0x03, 0x7f, 0xa8, 0x34, 0xf0, 0xc7, 0x8b, 0x16, 0x73, 0x5f, 0xf7, 0x9f, 0x6b, 0x18, 0xae, 0x60, 0xb5, 0x18, 0x48, 0xd3, 0x06, 0x99, 0xec, 0x64, 0x6d, 0x85, 0x7f, 0x15, 0x77, 0x0e, 0x2c, 0x7a, 0x0c, 0x0c, 0x90, 0x0f, 0xb6, 0x04, 0x0b, 0x5f, 0x34, 0x48, 0x4e, 0x9c, 0xf5, 0xce, 0xda, 0x23, 0xd5, 0xb2, 0x50, 0xef, 0x93, 0x28, 0x6f, 0x01, 0x1e, 0x9a, 0x5b, 0xf9, 0xe5, 0x42, 0xe5, 0xc9, 0xf4, 0x42, 0xde, 0x54, 0x58, 0xe2, 0x3e, 0x41, 0xd1, 0xd9, 0xcd, 0x9f, 0x0c, 0xe1, 0xcf, 0x20, 0x08, 0xd3, 0xea, 0x4d, 0x80, 0x32, 0xe8, 0x54, 0xcf, 0xfc, 0xdf, 0x5f, 0x69, 0x8d, 0x13, 0x16, 0xe0, 0x29, 0xc4, 0x88, 0xfc, 0xbb, 0x2b, 0xe2, 0x9a, 0x4e, 0x7b, 0xfb, 0x8e, 0x6e, 0x81, 0xd3, 0x42, 0x12, 0x3e, 0xe7, 0x5b } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x45, 0x45, 0x88, 0x68, 0x44, 0x53, 0x27, 0x48, 0x60, 0x49, 0xe1, 0xbf, 0xdf, 0xf5, 0x61, 0x13, 0xa8, 0xaa, 0x45, 0x10, 0x0d, 0xab, 0x07, 0x4f, 0xd1, 0x63, 0x94, 0xec, 0x1a, 0x90, 0x39, 0xb8, 0x1b, 0x2c, 0xb5, 0x81, 0xfe, 0x84, 0xe6, 0x48, 0xb5, 0xf0, 0x32, 0x85, 0x4d, 0xd4, 0xfc, 0x69, 0xf3, 0x61, 0xa0, 0xa3, 0x9d, 0x03, 0x76, 0x13, 0x8c, 0xd7, 0xe7, 0xc3, 0x77, 0x84, 0xe2, 0xa2, 0xf9, 0xd4, 0xf2, 0x66, 0x84, 0xcc, 0x5c, 0xc9, 0xf5, 0x12, 0xba, 0x62, 0x15, 0xeb, 0xd2, 0x32, 0xf9, 0xaa, 0x3d, 0xa4, 0x69, 0xdb, 0x43, 0xda, 0x1c, 0x06, 0x46, 0xe7, 0x5b, 0x33, 0xaa, 0xc5, 0x70, 0x08, 0x1b, 0x5b, 0x2e, 0x96, 0xea, 0xb7, 0x54, 0x6a, 0xcf, 0x93, 0x17, 0x85, 0xaa, 0x2f, 0xd1, 0x82, 0x4c, 0xbe, 0x2c, 0x5f, 0x9b, 0xf5, 0x63, 0x34, 0xec, 0x15, 0x66, 0xd1, 0xcf, 0x45 } +, + /* Prime 1 */ + 64, + { 0xfc, 0xdf, 0x1c, 0x49, 0x35, 0x8a, 0x1a, 0xac, 0x93, 0x88, 0xc4, 0x6c, 0xaa, 0x04, 0x72, 0xfa, 0x35, 0xb2, 0x1b, 0xdf, 0x99, 0xa2, 0x7b, 0xc2, 0xac, 0x65, 0x46, 0x7b, 0x88, 0xd0, 0x16, 0x1f, 0xbc, 0x70, 0xf3, 0xf4, 0xfa, 0x13, 0xa5, 0xf3, 0xa9, 0x8b, 0x59, 0xc0, 0x67, 0xea, 0xbf, 0x19, 0x62, 0x16, 0xa1, 0xb8, 0x9e, 0x20, 0xaf, 0xb2, 0xe5, 0xe5, 0xed, 0xde, 0xae, 0x8e, 0xe1, 0xef } +, + /* Prime 2 */ + 64, + { 0xec, 0xd7, 0x51, 0xd3, 0xd3, 0xf3, 0xb2, 0x08, 0xbd, 0x71, 0x8a, 0xe4, 0x35, 0x5d, 0x23, 0xf9, 0x16, 0xfa, 0x8f, 0xf6, 0x7d, 0xf0, 0x36, 0x61, 0x6b, 0xfd, 0xa7, 0xcb, 0xc8, 0x7a, 0xeb, 0xef, 0xaa, 0x7e, 0xda, 0x69, 0x1f, 0xb9, 0x8f, 0xbb, 0x03, 0x8a, 0x02, 0x07, 0x22, 0x01, 0x3c, 0xa8, 0xee, 0x3d, 0x04, 0x8f, 0x97, 0xba, 0xd2, 0xa2, 0x93, 0x0b, 0xe4, 0xb9, 0x6f, 0xb7, 0x4d, 0x55 } +, + /* Prime exponent 1 */ + 64, + { 0x1d, 0x2f, 0x73, 0x08, 0x50, 0x11, 0x9c, 0x7a, 0x86, 0x9c, 0xa6, 0x6f, 0x14, 0x40, 0x67, 0x34, 0xd1, 0xb5, 0xb8, 0xd9, 0xd9, 0xd5, 0x93, 0x0b, 0x28, 0xf2, 0x97, 0x6b, 0xf2, 0xa2, 0x71, 0xab, 0x40, 0x08, 0x99, 0x5f, 0x90, 0xed, 0x6b, 0x9d, 0xef, 0xd7, 0x91, 0x88, 0x4f, 0x76, 0x1c, 0x90, 0x45, 0x6d, 0xef, 0x44, 0x6b, 0x9b, 0xc2, 0x2b, 0x97, 0xb5, 0x2d, 0xfb, 0x21, 0x92, 0x84, 0x29 } +, + /* Prime exponent 2 */ + 64, + { 0x4d, 0x50, 0x95, 0x03, 0xc3, 0x83, 0x20, 0x31, 0x3e, 0x36, 0x9c, 0x92, 0x96, 0xe1, 0x0a, 0xe7, 0x3b, 0x9b, 0x1b, 0xf7, 0xe9, 0x70, 0xcb, 0x2f, 0xce, 0x63, 0x05, 0xad, 0xbe, 0x8a, 0x72, 0x0e, 0xd0, 0xe7, 0x8c, 0x41, 0x18, 0xfc, 0x28, 0x71, 0x72, 0x5c, 0x51, 0x01, 0x27, 0x16, 0xa4, 0x48, 0xb9, 0x4c, 0xed, 0xfa, 0x3a, 0x1b, 0xe0, 0xba, 0xf5, 0xa9, 0xc2, 0x46, 0xce, 0xb3, 0x55, 0xe9 } +, + /* Coefficient */ + 64, + { 0xbc, 0x15, 0xf4, 0x7c, 0x0b, 0xb6, 0xde, 0x6a, 0x7a, 0x3a, 0x1f, 0xe9, 0x28, 0x89, 0x80, 0x9b, 0x4a, 0x3c, 0x0c, 0xfa, 0x65, 0x0c, 0x2f, 0xec, 0x36, 0xb8, 0x92, 0x85, 0x14, 0x65, 0x47, 0xa5, 0x7d, 0x2b, 0x15, 0x71, 0xac, 0xb9, 0xd3, 0x0a, 0xa7, 0x91, 0xec, 0x97, 0xfd, 0x51, 0xfd, 0xe1, 0xec, 0x26, 0xf5, 0x6b, 0x32, 0x63, 0xda, 0xec, 0x9e, 0x29, 0x2e, 0x9c, 0x17, 0x37, 0x36, 0x4b } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 4.1", + /* Message */ + 29, + { 0xca, 0x24, 0x72, 0x1c, 0x88, 0xe0, 0x47, 0x74, 0xf4, 0x15, 0xb4, 0xc4, 0x6c, 0xa0, 0xfc, 0x26, 0xd5, 0xbb, 0x53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x68, 0xb4, 0x1a, 0x8e, 0x93, 0xe4, 0x83, 0x88, 0x65, 0xd4, 0xbd, 0x9c, 0x51, 0xcd, 0xe8, 0xdf, 0xbe, 0xee, 0xa5, 0x88, 0x2b, 0x09, 0xdc, 0x70, 0xbc, 0x9f, 0xe7, 0x49, 0xb5, 0xd2, 0x4b, 0xb7, 0xca, 0x51, 0x1d, 0xb2, 0xc2, 0xb8, 0x29, 0xa7, 0xc9, 0x14, 0x6c, 0x77, 0x4e, 0xb0, 0xbd, 0x7a, 0xaf, 0xdc, 0x5c, 0x38, 0xd3, 0xd7, 0xcd, 0x58, 0x27 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.2", + /* Message */ + 40, + { 0x25, 0xc7, 0xbc, 0x4c, 0xb2, 0x43, 0xac, 0x1f, 0x07, 0x40, 0x86, 0x9c, 0xd2, 0x6b, 0xa8, 0x26, 0xf3, 0x55, 0xd4, 0x77, 0xc4, 0xaa, 0x6c, 0xbe, 0x54, 0x3a, 0xdd, 0xea, 0x84, 0x44, 0x44, 0xf4, 0x1c, 0x35, 0x92, 0xbb, 0x3d, 0xa7, 0xd4, 0x21 } +, + /* Seed */ + 85, + { 0x27, 0x2b, 0xe3, 0xfb, 0xcc, 0x76, 0x14, 0x99, 0x6f, 0x1a, 0xc0, 0xe0, 0xa5, 0xe2, 0x69, 0x06, 0x23, 0xbb, 0x0b, 0x69, 0x70, 0xfc, 0xde, 0x0b, 0x6f, 0x45, 0x58, 0xee, 0x62, 0x34, 0x26, 0xfa, 0x60, 0xad, 0xd6, 0xc5, 0xa8, 0xa1, 0x0d, 0x4a, 0x37, 0x51, 0x50, 0x15, 0x36, 0xfe, 0x8a, 0x45, 0xc5, 0x42, 0xf6, 0x27, 0xf4, 0x22, 0x9f, 0xa1, 0x24, 0x57, 0xc1, 0x13, 0x31, 0x13, 0x72, 0x05, 0x55, 0x2b, 0x01, 0x4c, 0x91, 0xb1, 0xc4, 0xe0, 0x9e, 0x45, 0x96, 0x78, 0x34, 0x0a, 0x74, 0xc2, 0x85, 0xe2, 0x6a, 0xef, 0xb9 } +, + /* Encryption */ + 128, + { 0x76, 0x50, 0xd6, 0xf8, 0x1a, 0xef, 0x5c, 0x0e, 0x32, 0x0e, 0xc7, 0x7f, 0xc8, 0x9b, 0x7c, 0x3e, 0x61, 0x83, 0x85, 0x0d, 0x10, 0xc9, 0x8a, 0xd7, 0xe9, 0xfe, 0xea, 0x47, 0xe3, 0x8c, 0xfb, 0x37, 0xa0, 0x25, 0xdb, 0x42, 0x1f, 0xb6, 0xd0, 0x05, 0x80, 0x9e, 0x38, 0xbb, 0x3c, 0x51, 0x95, 0x1d, 0xa9, 0xd9, 0x43, 0x3b, 0xa7, 0xef, 0xb1, 0x7d, 0xe7, 0xd8, 0xfe, 0x3e, 0x9b, 0x9c, 0xe4, 0x55, 0x53, 0x74, 0xea, 0x66, 0x3a, 0x1b, 0x5d, 0xa4, 0xa0, 0x92, 0x29, 0x4c, 0xe9, 0x66, 0x98, 0x56, 0x55, 0xe2, 0xdd, 0xd2, 0x0d, 0x7d, 0xe3, 0xaa, 0x35, 0x37, 0x05, 0x8c, 0xfd, 0x7e, 0x7a, 0x7b, 0x97, 0xfc, 0xdd, 0x98, 0x53, 0x79, 0x2b, 0xa8, 0x3f, 0xcc, 0x89, 0x07, 0x4a, 0x8d, 0x0f, 0x3c, 0xef, 0xdf, 0x98, 0x5b, 0x9e, 0x78, 0xae, 0xbf, 0xb0, 0x59, 0x67, 0x36, 0x4f, 0x24, 0x11, 0xcd } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.3", + /* Message */ + 20, + { 0xcf, 0x00, 0x7e, 0xbd, 0x23, 0xda, 0x06, 0x97, 0x1a, 0xf7, 0x9a, 0xa6, 0x34, 0xd5, 0xd2, 0x55, 0x05, 0xbd, 0x52, 0x29 } +, + /* Seed */ + 105, + { 0x9c, 0xf7, 0x23, 0x7e, 0x28, 0xa8, 0x6e, 0x41, 0x8d, 0x66, 0x4f, 0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 0xaa, 0x9c, 0x63, 0xbd, 0x27, 0x9f, 0xae, 0x4c, 0x33, 0xf4, 0x2a, 0x9d, 0x73, 0xbb, 0x39, 0x11, 0x8e, 0xb8, 0x7d, 0x25, 0x12, 0xb9, 0xd9, 0x36, 0xa2, 0x7e, 0xd2, 0xe4, 0x49, 0x60, 0x7d, 0xbf, 0x0e, 0x3e, 0x22, 0x3a, 0x53, 0x95, 0x26, 0x35, 0x59, 0x9c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.4", + /* Message */ + 34, + { 0xef, 0xda, 0x79, 0xe9, 0xc3, 0x36, 0xc2, 0x34, 0xff, 0x37, 0xb4, 0xf5, 0x8f, 0xdb, 0xd3, 0x1a, 0xf3, 0x67, 0x5b, 0x3d, 0x2b, 0x10, 0x5e, 0xaf, 0xbe, 0xad, 0x4b, 0xbb, 0xff, 0xf5, 0x4e, 0x68, 0x6a, 0xb5 } +, + /* Seed */ + 91, + { 0x30, 0xc2, 0x09, 0x43, 0xf1, 0xbf, 0xc4, 0x23, 0x61, 0xd4, 0xd2, 0x2f, 0x51, 0xa8, 0xd7, 0x86, 0xcb, 0x2d, 0x0d, 0xd5, 0xff, 0x7d, 0x70, 0x5b, 0x30, 0x28, 0x60, 0x18, 0x11, 0x29, 0x3d, 0xbe, 0x5d, 0x72, 0xc3, 0x55, 0x97, 0x10, 0xce, 0x0a, 0xe9, 0x5d, 0x2f, 0x16, 0xb2, 0x39, 0xa4, 0xac, 0x84, 0x45, 0x53, 0x7d, 0x48, 0x8e, 0x3e, 0x6d, 0x2c, 0xf5, 0xb7, 0xa6, 0x4c, 0x06, 0xc3, 0x75, 0x6e, 0x11, 0x60, 0x67, 0x63, 0x63, 0x3e, 0xdb, 0xdd, 0xbf, 0x26, 0xbe, 0xe6, 0x51, 0x18, 0x42, 0xd2, 0x75, 0x2d, 0xcd, 0x88, 0x89, 0x6c, 0xb8, 0x55, 0x8a, 0x87 } +, + /* Encryption */ + 128, + { 0xbb, 0x91, 0xb2, 0xf6, 0xf4, 0x33, 0x1d, 0x64, 0xd0, 0x73, 0x6a, 0x2e, 0xa6, 0x03, 0x29, 0xaa, 0x16, 0xc2, 0xed, 0x7a, 0x4d, 0x5c, 0xa8, 0xd7, 0x84, 0xe6, 0x30, 0x4c, 0xe4, 0x84, 0x4c, 0x71, 0x58, 0xf8, 0x22, 0xd2, 0xaf, 0x29, 0xc8, 0x90, 0x97, 0x7d, 0x75, 0xa9, 0x35, 0xe4, 0x3d, 0x93, 0xb5, 0xbe, 0x10, 0xc1, 0xd4, 0x4f, 0xa0, 0x0c, 0xe2, 0x8e, 0x75, 0xf5, 0x27, 0xbd, 0x84, 0xa3, 0xbe, 0x5a, 0xf5, 0xbe, 0xe9, 0x45, 0x67, 0xc5, 0x5e, 0x15, 0xee, 0x3e, 0x93, 0x42, 0x6a, 0xd8, 0xd5, 0x0f, 0x06, 0x4c, 0x57, 0x93, 0xca, 0x38, 0xc4, 0x3a, 0x70, 0xc5, 0xf5, 0x60, 0x74, 0x0b, 0x16, 0xee, 0xa1, 0x6b, 0x7f, 0x13, 0x41, 0x5f, 0x75, 0x1b, 0x3f, 0xdb, 0x87, 0x7a, 0x88, 0x29, 0x33, 0x21, 0xf5, 0x0f, 0xff, 0xa6, 0xf1, 0x24, 0x94, 0x96, 0xc2, 0xb0, 0x27, 0xa2, 0x18, 0xed } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.5", + /* Message */ + 52, + { 0x4a, 0x01, 0xfc, 0x13, 0xc1, 0xd8, 0x6f, 0xe7, 0xb2, 0xfd, 0xc7, 0x92, 0xf5, 0x28, 0x0f, 0x87, 0x5a, 0xdc, 0x5a, 0xe9, 0x9f, 0xf9, 0x11, 0xd0, 0x2c, 0x8c, 0x00, 0x3d, 0x39, 0xbb, 0xee, 0x54, 0xb8, 0x51, 0xef, 0xa3, 0x4b, 0x41, 0x31, 0xbe, 0x52, 0x0d, 0x81, 0x00, 0xef, 0x62, 0xc2, 0x5a, 0x4b, 0x51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, 0xfd, 0x5f, 0xdf, 0x59, 0x71, 0xf3, 0xdd, 0xb0, 0xe3, 0x12, 0xa9, 0x16, 0x06, 0xf3, 0x13, 0x73, 0x02, 0x0d, 0xb3, 0xa7, 0x6d, 0x04, 0xfd, 0x6d, 0x65, 0xd6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.6", + /* Message */ + 7, + { 0x7a, 0xb0, 0x6e, 0x19, 0x69, 0x22, 0xc0 } +, + /* Seed */ + 118, + { 0xde, 0x0d, 0x60, 0x33, 0xc1, 0xe9, 0x6b, 0x5f, 0xd8, 0x31, 0x21, 0x4f, 0x30, 0xd8, 0x1b, 0x8f, 0xd9, 0xa2, 0x69, 0x3e, 0x5e, 0x8a, 0x36, 0xea, 0xff, 0xd0, 0x39, 0xe7, 0x47, 0x3c, 0x28, 0xee, 0x43, 0xa3, 0x91, 0x6c, 0x78, 0xc9, 0xa1, 0x12, 0x95, 0x8a, 0x94, 0xce, 0x67, 0x1c, 0xcc, 0x40, 0xd9, 0x7e, 0xd4, 0x18, 0x7a, 0x3f, 0xff, 0xa0, 0xdc, 0x12, 0x9d, 0x88, 0xa8, 0xb8, 0xc4, 0x96, 0x6e, 0xa3, 0x94, 0xa9, 0x10, 0x89, 0x61, 0x25, 0xf5, 0x4d, 0xaf, 0xbb, 0x3b, 0x17, 0xb9, 0xfa, 0x10, 0xc4, 0x82, 0x20, 0x09, 0x64, 0x90, 0xc6, 0xf7, 0x5b, 0xe2, 0x51, 0x83, 0xe9, 0x98, 0x4d, 0xf5, 0xe4, 0xd7, 0xeb, 0xf9, 0x47, 0x5d, 0x11, 0xea, 0x39, 0x33, 0x5a, 0xc7, 0x2f, 0x93, 0xd3, 0x33, 0xbd, 0x74, 0x22, 0x19, 0x42 } +, + /* Encryption */ + 128, + { 0x54, 0x18, 0x23, 0xf9, 0x05, 0x57, 0x6d, 0xa1, 0x42, 0xe2, 0x65, 0xd8, 0x90, 0x45, 0xab, 0x66, 0x20, 0xfd, 0x1a, 0x74, 0xc9, 0x53, 0x3a, 0xda, 0x4b, 0xc7, 0xb4, 0x3d, 0x95, 0x62, 0x9a, 0x31, 0x18, 0x6f, 0x4e, 0x89, 0x89, 0x20, 0x83, 0xd2, 0x54, 0x9b, 0x0e, 0x63, 0x8b, 0xdf, 0xc0, 0xd2, 0x7e, 0x14, 0xec, 0x18, 0xc4, 0x5c, 0xa3, 0x58, 0x61, 0xdf, 0xe6, 0x12, 0xa3, 0xa1, 0xed, 0xaa, 0xfc, 0x72, 0xfb, 0x46, 0x81, 0xa9, 0x9e, 0xa6, 0xe6, 0x48, 0xbe, 0x89, 0x62, 0xf1, 0x56, 0x1e, 0x75, 0x0d, 0x14, 0x49, 0xf2, 0x3f, 0x43, 0x0a, 0xf9, 0x30, 0x72, 0x25, 0x54, 0x4d, 0x8a, 0x8b, 0x89, 0x65, 0xaf, 0x5d, 0xd1, 0x8c, 0xb7, 0x89, 0x53, 0xce, 0x6d, 0x16, 0xd8, 0x5e, 0xb2, 0x11, 0xaf, 0x0c, 0x64, 0x68, 0xa2, 0xaf, 0x9f, 0x72, 0xe7, 0x86, 0x61, 0xb0, 0xfc, 0xaa, 0x48, 0x15 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.7", + /* Message */ + 7, + { 0x9a, 0xda, 0x9c, 0x10, 0xb8, 0xae, 0x22 } +, + /* Seed */ + 118, + { 0xcc, 0x23, 0x43, 0x72, 0x4a, 0xc5, 0x0e, 0xe5, 0x47, 0x08, 0xfc, 0x5f, 0xd0, 0x3f, 0x09, 0xa1, 0xcc, 0x12, 0x22, 0xa4, 0x4b, 0xcd, 0x44, 0x03, 0x87, 0x7c, 0x6b, 0xde, 0x86, 0xbf, 0x43, 0xe4, 0x2c, 0x10, 0x84, 0xf6, 0xef, 0xff, 0x20, 0xfa, 0xc0, 0xac, 0xc3, 0x1e, 0xca, 0x17, 0xc7, 0x38, 0xd4, 0x68, 0x68, 0x73, 0x65, 0x52, 0xfd, 0x2f, 0x7e, 0x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, 0xf3, 0xc1, 0x35, 0xab, 0x95, 0x94, 0x9a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.8", + /* Message */ + 19, + { 0xd8, 0x12, 0x6f, 0x4a, 0x88, 0x78, 0x97, 0x82, 0x93, 0x11, 0x76, 0x51, 0xb3, 0x0e, 0x79, 0x22, 0xd1, 0x4a, 0xcf } +, + /* Seed */ + 106, + { 0xad, 0xf9, 0xb0, 0xa9, 0x15, 0x2f, 0x0e, 0x6e, 0xc6, 0xf4, 0x39, 0x59, 0x71, 0xad, 0x40, 0x3f, 0x02, 0xe7, 0xfa, 0x98, 0xf8, 0x15, 0x56, 0x0a, 0xfa, 0xff, 0xa7, 0xca, 0xd5, 0xb4, 0x47, 0x4b, 0x6e, 0xce, 0x65, 0xed, 0xab, 0xe2, 0x7e, 0xc2, 0x4a, 0x0a, 0xa4, 0x73, 0xed, 0x75, 0xa6, 0x1f, 0x5c, 0x24, 0x90, 0xa5, 0x36, 0xb1, 0xa4, 0xdf, 0x7b, 0x03, 0x41, 0x77, 0x37, 0xc5, 0x34, 0xe1, 0xd4, 0x5b, 0xf7, 0x26, 0x94, 0x38, 0x6b, 0xee, 0x82, 0x0c, 0x48, 0xdb, 0xd1, 0x83, 0x17, 0xbd, 0x61, 0x7c, 0x04, 0xb6, 0xa4, 0x17, 0xe3, 0x0e, 0xed, 0x79, 0x58, 0x8d, 0xc2, 0x3f, 0xd4, 0xdb, 0xa1, 0x37, 0x44, 0xb4, 0xb2, 0xaa, 0x5a, 0xf8, 0x0a, 0x8a } +, + /* Encryption */ + 128, + { 0x3b, 0x2b, 0x85, 0xed, 0xfc, 0xd7, 0xc7, 0xc2, 0x7b, 0xde, 0xde, 0xe1, 0xc2, 0x8a, 0xb6, 0x18, 0x7a, 0xbf, 0x1c, 0x96, 0xd9, 0x45, 0x30, 0x07, 0x92, 0xcf, 0x8a, 0xf1, 0x97, 0xc2, 0xf9, 0xa3, 0x91, 0xb4, 0x8b, 0x83, 0x32, 0xcf, 0xde, 0x7e, 0x4c, 0x7d, 0xc3, 0x4c, 0x42, 0x30, 0x29, 0x56, 0x92, 0xce, 0xfd, 0xa5, 0xef, 0xb2, 0x57, 0x35, 0x49, 0x2b, 0x9f, 0xf7, 0x84, 0xc7, 0xba, 0xe7, 0x35, 0x11, 0xc6, 0x18, 0xe3, 0xaa, 0x7b, 0xc8, 0x7b, 0xc3, 0x13, 0xf2, 0x67, 0x09, 0xa8, 0xea, 0x4a, 0xd7, 0x3a, 0x34, 0x9a, 0xb9, 0xe5, 0xad, 0x82, 0x6c, 0x96, 0xad, 0x0e, 0xca, 0x97, 0xe3, 0x13, 0x28, 0x6b, 0xcc, 0xbf, 0x8e, 0x33, 0xc9, 0x1f, 0x03, 0x68, 0x39, 0xb9, 0x94, 0x8b, 0x4e, 0xb0, 0xc3, 0x8e, 0x21, 0x3e, 0xf4, 0x7f, 0x77, 0x66, 0x1a, 0x27, 0xf8, 0xcf, 0xe4, 0x99, 0x03 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.9", + /* Message */ + 58, + { 0xf5, 0xdf, 0x01, 0xaf, 0xe6, 0xa9, 0x22, 0x51, 0x8b, 0x3f, 0x4b, 0x80, 0xcd, 0x4f, 0xca, 0x73, 0xb9, 0x7b, 0xab, 0x61, 0x71, 0x6e, 0x27, 0xd2, 0x51, 0xbd, 0x46, 0x5f, 0x4b, 0x35, 0xa1, 0xa2, 0x32, 0xe2, 0xda, 0x00, 0x90, 0x1c, 0x29, 0x4b, 0xf2, 0x23, 0x50, 0xce, 0x49, 0x0d, 0x09, 0x9f, 0x64, 0x2b, 0x53, 0x75, 0x61, 0x2d, 0xb6, 0x3b, 0xa1, 0xf2 } +, + /* Seed */ + 67, + { 0x6b, 0xf2, 0x81, 0x0d, 0xb8, 0xfb, 0x26, 0x93, 0x98, 0x41, 0x2d, 0xbb, 0x88, 0x06, 0x02, 0x82, 0xd4, 0x5f, 0xbe, 0x96, 0x27, 0x33, 0x7e, 0x54, 0x34, 0x26, 0x1a, 0x5d, 0xbc, 0x19, 0x3a, 0xd6, 0x18, 0xc1, 0x1f, 0x7b, 0xde, 0xc1, 0xde, 0x25, 0x05, 0xf8, 0x60, 0x37, 0xfc, 0x18, 0x51, 0xbf, 0x6f, 0xb4, 0x9d, 0x23, 0x60, 0x62, 0x73, 0x47, 0x49, 0x9e, 0xfc, 0x98, 0xe2, 0x92, 0x05, 0xda, 0x90, 0x6d, 0x32 } +, + /* Encryption */ + 128, + { 0x40, 0x12, 0xfc, 0xc5, 0xcf, 0xb9, 0x78, 0xde, 0xf8, 0x8f, 0xb8, 0xf8, 0x17, 0x4a, 0xa5, 0xb4, 0xa3, 0x07, 0x75, 0xac, 0x45, 0x59, 0xf0, 0xb2, 0xf3, 0xd3, 0xb4, 0x38, 0x9b, 0x82, 0x8a, 0x79, 0xd1, 0x40, 0x25, 0x10, 0xc9, 0xa0, 0x33, 0x7d, 0x48, 0x9d, 0x11, 0x82, 0xab, 0x31, 0xc8, 0x38, 0xac, 0x7c, 0x80, 0xb7, 0x48, 0x60, 0x9a, 0x2a, 0xa5, 0x37, 0xda, 0x7a, 0xcc, 0x3a, 0x4a, 0x7a, 0x31, 0xd2, 0xad, 0x25, 0x2b, 0xfd, 0x59, 0x28, 0x0b, 0x3d, 0x18, 0x13, 0xa2, 0x6f, 0x93, 0xc5, 0x9e, 0xe8, 0xc5, 0xee, 0x68, 0x87, 0x18, 0xf4, 0x27, 0x83, 0x93, 0xfe, 0xce, 0x32, 0x3a, 0x9d, 0xff, 0x83, 0x37, 0x55, 0xe8, 0x9a, 0xc8, 0xee, 0x1f, 0xa2, 0x90, 0x4b, 0xf2, 0x4c, 0xdf, 0x4f, 0x01, 0xe6, 0xea, 0xed, 0xb6, 0xa8, 0xef, 0x01, 0xf4, 0x07, 0xbe, 0xf3, 0x30, 0x9f, 0x03, 0x39 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.10", + /* Message */ + 4, + { 0xa3, 0x82, 0x3f, 0xaf } +, + /* Seed */ + 121, + { 0x94, 0xf6, 0x70, 0xfd, 0x82, 0xf6, 0x91, 0x32, 0x75, 0xee, 0xa4, 0xc6, 0x71, 0x16, 0xca, 0xaa, 0xbd, 0x33, 0x57, 0x8c, 0xf8, 0x4d, 0x22, 0x63, 0x64, 0x38, 0xa6, 0xfd, 0x7e, 0xcf, 0xee, 0xfc, 0x0b, 0x18, 0x7d, 0xec, 0xf7, 0x93, 0x89, 0x1c, 0x6e, 0x4c, 0xfc, 0x52, 0xb5, 0x67, 0xd8, 0x72, 0xbf, 0xfb, 0xee, 0x0a, 0x67, 0x47, 0x2a, 0x1a, 0x48, 0xc0, 0xf1, 0xba, 0x59, 0x8a, 0xd8, 0x25, 0x89, 0x01, 0xc5, 0x6a, 0x55, 0x92, 0xf1, 0x41, 0x14, 0x7e, 0x81, 0x33, 0x9d, 0x74, 0x7e, 0x06, 0x32, 0xde, 0xf0, 0x0d, 0x3d, 0xbe, 0xe9, 0x5c, 0x4e, 0x43, 0x21, 0xcc, 0x25, 0xb5, 0x31, 0x14, 0x47, 0xa3, 0x02, 0xc5, 0x34, 0x92, 0x9c, 0xf7, 0xe5, 0x34, 0xf9, 0xae, 0x67, 0xf4, 0x1e, 0x01, 0xe2, 0x2a, 0x3d, 0x7c, 0xe4, 0x1b, 0x3b, 0x31, 0x35 } +, + /* Encryption */ + 128, + { 0x7b, 0x60, 0x25, 0x42, 0xb6, 0x4f, 0x0a, 0x1e, 0x0e, 0xc2, 0xaa, 0x01, 0xcb, 0xed, 0x37, 0x7e, 0x33, 0x1e, 0xa3, 0xff, 0x86, 0xf3, 0x56, 0xfb, 0x7a, 0x58, 0x83, 0x76, 0x4b, 0xe4, 0xcb, 0xf7, 0xd0, 0x75, 0x4c, 0x58, 0x29, 0x64, 0x31, 0x36, 0xf2, 0x57, 0x23, 0x36, 0xa2, 0x3f, 0x15, 0x41, 0x1d, 0x83, 0x85, 0x14, 0xa1, 0x43, 0x87, 0x24, 0xad, 0x74, 0x09, 0xe8, 0xec, 0x8f, 0xe2, 0x63, 0x41, 0xae, 0xea, 0x56, 0x68, 0x34, 0x5d, 0x0d, 0x82, 0x3f, 0xb5, 0xc2, 0x1d, 0xf4, 0x59, 0xe8, 0xbf, 0x7c, 0x15, 0xb8, 0x0b, 0x07, 0x2e, 0x5f, 0x8a, 0x84, 0x65, 0xa4, 0x4a, 0xa9, 0xd0, 0x9d, 0x82, 0x5c, 0x03, 0x15, 0xa0, 0xec, 0xd2, 0xd6, 0x49, 0x70, 0x2b, 0x10, 0x9b, 0xe8, 0xfe, 0x35, 0xeb, 0x22, 0x84, 0x3a, 0x20, 0xe7, 0xfd, 0x87, 0x4f, 0x1c, 0x6b, 0x46, 0xa8, 0x0b, 0x68, 0xdf } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.11", + /* Message */ + 62, + { 0x75, 0xb9, 0xa4, 0xa0, 0xbb, 0x2d, 0x46, 0x43, 0xe4, 0x78, 0xf6, 0x54, 0xf2, 0xcc, 0x1a, 0x8c, 0x1b, 0xb4, 0x67, 0x19, 0x76, 0x0d, 0x45, 0x41, 0xa8, 0xa7, 0x33, 0xf3, 0x3b, 0x71, 0x3d, 0x32, 0xc6, 0x0b, 0xfd, 0x35, 0xf1, 0x61, 0x74, 0x83, 0x48, 0x47, 0xe8, 0x81, 0x2c, 0xbd, 0x7f, 0x06, 0xce, 0x72, 0x89, 0xf3, 0x72, 0xc5, 0x82, 0x30, 0xf2, 0xb0, 0x01, 0x45, 0x9b, 0x5d } +, + /* Seed */ + 63, + { 0x49, 0xa7, 0x3d, 0xeb, 0x93, 0xe3, 0xf1, 0xbe, 0xaa, 0xad, 0x3a, 0x19, 0x9a, 0x70, 0x56, 0x9e, 0x09, 0x9a, 0xfa, 0xca, 0xf7, 0xa7, 0x5f, 0xc4, 0xce, 0x64, 0x8f, 0xa8, 0x2e, 0xaf, 0x2a, 0x0f, 0xe4, 0x11, 0xd2, 0x64, 0xfe, 0x45, 0xf7, 0x45, 0x25, 0xc9, 0x1f, 0x3c, 0x75, 0x10, 0x17, 0xf8, 0x0a, 0x02, 0xba, 0xbf, 0xf3, 0x57, 0x99, 0x62, 0x6f, 0x2b, 0x8d, 0xdb, 0x9f, 0x36, 0x91 } +, + /* Encryption */ + 128, + { 0xe5, 0xae, 0xe7, 0x0d, 0xe8, 0x62, 0x72, 0x3c, 0x51, 0x73, 0xdf, 0xfb, 0xf6, 0x92, 0x6c, 0x3d, 0x33, 0x16, 0xd5, 0x90, 0x9c, 0xf5, 0xa1, 0xd6, 0x63, 0xe6, 0x80, 0xab, 0x2b, 0xb5, 0x76, 0xe3, 0x5b, 0x93, 0xfd, 0x43, 0x27, 0x43, 0xa1, 0x8e, 0x8d, 0xb4, 0xfa, 0xa3, 0x32, 0xf4, 0x46, 0x68, 0xa3, 0xd1, 0x9e, 0x5e, 0x69, 0x57, 0x32, 0xf8, 0x4b, 0xbd, 0x86, 0xd0, 0xdd, 0xed, 0x76, 0x65, 0xb7, 0x0b, 0x97, 0x63, 0x2e, 0xab, 0xe2, 0x36, 0x4c, 0xaf, 0xef, 0x7b, 0x74, 0xdc, 0xd1, 0xbf, 0xbd, 0x62, 0x5e, 0x2b, 0xbb, 0xf6, 0x65, 0x4c, 0xc0, 0x26, 0x61, 0x81, 0xac, 0x0a, 0x75, 0x7c, 0x3f, 0xba, 0xbd, 0x43, 0x0a, 0xe8, 0x63, 0x71, 0xeb, 0x56, 0xaf, 0x61, 0x0f, 0x77, 0xcf, 0x2f, 0xff, 0x6e, 0x24, 0x8f, 0x8c, 0x57, 0x91, 0x60, 0xb9, 0x1d, 0xce, 0xcc, 0x0d, 0x20, 0x2b, 0x50 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.12", + /* Message */ + 52, + { 0x15, 0x06, 0xeb, 0x34, 0x91, 0x78, 0x5a, 0xa7, 0x21, 0x06, 0xbf, 0x6c, 0x85, 0xd0, 0x10, 0x02, 0x04, 0x6d, 0x1c, 0x16, 0xd4, 0x35, 0xdd, 0x4e, 0x7c, 0x4b, 0x7e, 0x8e, 0x90, 0xdd, 0xdf, 0x16, 0x33, 0x2f, 0x94, 0xf4, 0xb8, 0x35, 0xd0, 0xe4, 0xad, 0x55, 0xd8, 0x3a, 0x81, 0xb3, 0x5c, 0x54, 0xb6, 0x79, 0xd3, 0xcf } +, + /* Seed */ + 73, + { 0xf6, 0x6e, 0x6a, 0x84, 0x75, 0x84, 0x40, 0x86, 0xe2, 0x84, 0x77, 0x22, 0x97, 0x46, 0x80, 0x1d, 0x43, 0x50, 0xd9, 0xad, 0x07, 0x68, 0xf3, 0xc3, 0xd8, 0xfa, 0xa8, 0x10, 0x7d, 0x95, 0xfb, 0x20, 0x5e, 0x4b, 0xa8, 0xc6, 0x4b, 0x73, 0x8e, 0x54, 0xe5, 0xac, 0x0d, 0xfe, 0xab, 0x99, 0x6d, 0x61, 0x12, 0x5c, 0x26, 0x79, 0x80, 0x72, 0x59, 0xbc, 0x9e, 0x47, 0xd8, 0xbd, 0xd2, 0xc0, 0x40, 0x95, 0x05, 0x44, 0x8b, 0xbf, 0x87, 0x2b, 0xf6, 0x64, 0x7a } +, + /* Encryption */ + 128, + { 0xd1, 0xfa, 0x39, 0x52, 0xcc, 0x61, 0x45, 0xff, 0x77, 0x1b, 0x6c, 0x5a, 0x68, 0x27, 0x5b, 0xbc, 0x22, 0xd0, 0x03, 0x92, 0x03, 0x66, 0x17, 0x37, 0x5f, 0x0c, 0x2b, 0xec, 0x3e, 0x28, 0x85, 0x83, 0xec, 0xfd, 0xc6, 0xdf, 0x6a, 0x82, 0x8d, 0xe3, 0x7f, 0x77, 0xc5, 0x56, 0xa8, 0xcb, 0xc4, 0xd4, 0x43, 0x36, 0xe8, 0xd2, 0xe3, 0x05, 0x87, 0xe3, 0x31, 0x58, 0x73, 0x17, 0xe9, 0x7b, 0x05, 0xa3, 0xfd, 0x78, 0x02, 0x5b, 0x2d, 0x49, 0x6b, 0x3b, 0xbe, 0xeb, 0x6c, 0x72, 0x5d, 0x9e, 0xa5, 0x61, 0xa7, 0x32, 0x28, 0x82, 0x33, 0xd6, 0x8b, 0x79, 0x49, 0x7f, 0xb0, 0xb6, 0xfe, 0xe0, 0xa6, 0xb6, 0x8a, 0xc3, 0x13, 0x66, 0x1b, 0x4b, 0x65, 0x47, 0x39, 0xf9, 0x18, 0xf6, 0xfd, 0x3b, 0xff, 0xc1, 0x7c, 0x1d, 0xf4, 0x1f, 0x01, 0x44, 0x95, 0xd5, 0x5f, 0x95, 0x90, 0x14, 0x7b, 0x82, 0xd1, 0x5d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.13", + /* Message */ + 2, + { 0x9e, 0x3e } +, + /* Seed */ + 123, + { 0x9b, 0x3d, 0xdf, 0x17, 0xcd, 0x74, 0xe7, 0x6c, 0x69, 0xb5, 0xca, 0x3a, 0x01, 0x0a, 0x0e, 0x0f, 0xbd, 0x17, 0x05, 0xd6, 0x9c, 0x30, 0x74, 0x35, 0x3b, 0xe7, 0xd3, 0xc0, 0xc2, 0x05, 0xf0, 0x99, 0xc7, 0xa8, 0x10, 0xb7, 0xa1, 0xad, 0xe0, 0x9f, 0x5a, 0x03, 0x6b, 0xb7, 0x69, 0xef, 0xf5, 0x3a, 0x53, 0xd4, 0xc6, 0xf8, 0x71, 0x52, 0x92, 0x2d, 0x9a, 0x7b, 0x86, 0xed, 0xeb, 0xa3, 0x72, 0x37, 0xd7, 0xf1, 0x73, 0x4d, 0x9d, 0x97, 0x39, 0x38, 0x3f, 0x48, 0x80, 0xaf, 0x3a, 0xd6, 0x88, 0x87, 0xe0, 0xfe, 0x7c, 0x87, 0xa1, 0x74, 0xfb, 0x32, 0x38, 0xb1, 0xe5, 0x1e, 0xad, 0x2a, 0x84, 0x34, 0x40, 0xc2, 0xb2, 0x7f, 0x22, 0xdd, 0xa4, 0x22, 0x8d, 0xce, 0x70, 0xf9, 0x1c, 0x98, 0xd4, 0x71, 0xa8, 0x74, 0x4d, 0x27, 0x65, 0x55, 0x79, 0x58, 0x81, 0x02, 0x44 } +, + /* Encryption */ + 128, + { 0x42, 0x12, 0x6b, 0x49, 0x2a, 0x1e, 0x7c, 0xc0, 0x33, 0x95, 0xb2, 0xac, 0x70, 0x33, 0xcf, 0x6a, 0x67, 0x36, 0xb1, 0x2e, 0x76, 0x82, 0x5a, 0x17, 0x3b, 0x9e, 0x01, 0x1a, 0xe8, 0xbf, 0xed, 0x44, 0xfe, 0xcb, 0x8d, 0x9f, 0x58, 0xcc, 0xe1, 0x99, 0x11, 0xfe, 0x42, 0xd4, 0x55, 0xe2, 0x49, 0x20, 0x09, 0x32, 0xa9, 0xb6, 0x8f, 0xe2, 0xe4, 0x19, 0xbc, 0x63, 0x9c, 0x11, 0x78, 0xd1, 0x1f, 0xfb, 0xdb, 0xd9, 0x95, 0x5d, 0x45, 0x9f, 0x5e, 0xcf, 0xe0, 0x90, 0x20, 0x09, 0x8e, 0x29, 0x7b, 0x8e, 0x91, 0x48, 0x5e, 0x94, 0xbf, 0x11, 0xe7, 0xbf, 0x77, 0xed, 0xf5, 0xa2, 0x70, 0x11, 0xc8, 0x2b, 0x92, 0x73, 0x65, 0xa1, 0x2c, 0x9c, 0x77, 0xc7, 0xe4, 0x9b, 0xb7, 0xfe, 0x2f, 0x61, 0x33, 0x39, 0xde, 0x3f, 0x51, 0x20, 0x87, 0x79, 0x53, 0x86, 0xca, 0x58, 0x5a, 0x70, 0x24, 0x78, 0x27, 0x90 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.14", + /* Message */ + 28, + { 0x70, 0xaa, 0x78, 0xa4, 0xd3, 0x7f, 0x74, 0xc1, 0x81, 0xaa, 0x27, 0x40, 0x7f, 0x2f, 0x9f, 0xe6, 0x63, 0xa9, 0x1b, 0x16, 0xbe, 0x9b, 0xea, 0x6f, 0xc6, 0x12, 0x88, 0x7f } +, + /* Seed */ + 97, + { 0xd0, 0xfd, 0x16, 0xc0, 0xf0, 0xd7, 0x90, 0x9a, 0x38, 0x86, 0x17, 0x08, 0x11, 0xe4, 0x4f, 0x24, 0xfa, 0xdf, 0x94, 0xff, 0x17, 0x03, 0x9a, 0x56, 0x84, 0xa0, 0x9b, 0x24, 0xe1, 0x93, 0x3f, 0xa0, 0xc4, 0x71, 0x51, 0x63, 0x5d, 0x75, 0x7b, 0x73, 0xc2, 0x3f, 0xf3, 0x91, 0x01, 0xcb, 0xe2, 0x52, 0x9a, 0x63, 0xa7, 0xf3, 0xa0, 0x19, 0x5b, 0x6e, 0x47, 0x51, 0x07, 0x11, 0xde, 0x17, 0x1a, 0x16, 0x56, 0xc9, 0xea, 0xb3, 0xcf, 0x82, 0xd1, 0xc6, 0x52, 0x26, 0xb5, 0x8f, 0xd0, 0xfe, 0x58, 0xec, 0x31, 0x96, 0x24, 0x7f, 0x34, 0xb1, 0xa0, 0x55, 0x27, 0x02, 0xdc, 0x03, 0x75, 0x12, 0xc6, 0x81, 0x04 } +, + /* Encryption */ + 128, + { 0x95, 0x36, 0xd4, 0x7e, 0x1d, 0x68, 0x7f, 0x1f, 0x24, 0x99, 0x6c, 0xb4, 0x6c, 0xe9, 0x46, 0xae, 0x54, 0xd4, 0xa1, 0x49, 0xb3, 0x4b, 0x5b, 0xc3, 0x44, 0x43, 0xa2, 0x01, 0x51, 0x83, 0x87, 0xf4, 0xb6, 0x38, 0x18, 0x37, 0xcb, 0x7e, 0x4b, 0x0a, 0x44, 0x75, 0x13, 0x70, 0x42, 0xf1, 0x44, 0x8c, 0x1e, 0xa4, 0x15, 0x15, 0xef, 0x31, 0xc2, 0xfc, 0xbf, 0x62, 0xe7, 0xe9, 0x58, 0x67, 0xb6, 0x74, 0xac, 0x23, 0x0a, 0xed, 0x9c, 0x7d, 0x8d, 0x61, 0xc5, 0x27, 0x52, 0xb2, 0xfc, 0x2a, 0x0b, 0xba, 0xfc, 0x77, 0xb3, 0x1c, 0x51, 0x49, 0x30, 0xde, 0x98, 0x23, 0xb4, 0x38, 0xb6, 0xfa, 0xaa, 0x40, 0xd2, 0x55, 0x31, 0x03, 0x3c, 0x66, 0x48, 0x3f, 0xa0, 0x02, 0x3a, 0xf2, 0x1d, 0xa6, 0x4f, 0xcc, 0x8b, 0xb8, 0xc5, 0xd5, 0x2d, 0x3f, 0x6c, 0x43, 0x80, 0xf1, 0xd6, 0x08, 0xd8, 0xc0, 0x11, 0x8f } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.15", + /* Message */ + 59, + { 0x01, 0x16, 0xa4, 0x61, 0x77, 0x73, 0xb6, 0xdd, 0xb2, 0x19, 0x16, 0x1c, 0x4f, 0xd0, 0x71, 0x93, 0x7b, 0xbb, 0x07, 0x15, 0xcc, 0x62, 0x7c, 0x17, 0xb8, 0xe7, 0x52, 0x80, 0xd9, 0x9c, 0xdd, 0x41, 0x6e, 0xa5, 0xcd, 0xfa, 0x09, 0x06, 0xb9, 0xaf, 0x0a, 0x20, 0xcd, 0x47, 0x7f, 0xdc, 0xad, 0x14, 0x15, 0xa1, 0x9a, 0x9d, 0x1b, 0x96, 0xfd, 0xc3, 0xc0, 0xed, 0xb9 } +, + /* Seed */ + 66, + { 0x86, 0xb1, 0x58, 0x60, 0x9b, 0xfa, 0x08, 0xa8, 0xed, 0xe4, 0xef, 0x3f, 0x23, 0xe1, 0x2e, 0xb5, 0x0d, 0x24, 0x55, 0x74, 0x26, 0x4d, 0x76, 0x4d, 0x87, 0x12, 0x67, 0xdb, 0x8a, 0x95, 0x24, 0xea, 0x3f, 0xa2, 0xe3, 0x84, 0x5f, 0xfc, 0x29, 0x1b, 0xda, 0x98, 0x99, 0x89, 0xbf, 0x71, 0x5a, 0xa2, 0xb0, 0x8c, 0x49, 0x79, 0x8a, 0x81, 0x9f, 0x68, 0x58, 0xd9, 0xfa, 0x35, 0xf9, 0x4d, 0xf3, 0xc7, 0xe0, 0x86 } +, + /* Encryption */ + 128, + { 0x74, 0xa3, 0xdf, 0x38, 0x5d, 0x20, 0x87, 0x7b, 0xca, 0x9d, 0xbc, 0xeb, 0xca, 0x2e, 0x53, 0x2c, 0x6a, 0xbe, 0x95, 0x62, 0xd6, 0x81, 0x7b, 0xe1, 0x6e, 0x11, 0x8a, 0x60, 0xf4, 0xab, 0x0a, 0x1a, 0xc0, 0xa8, 0x46, 0x66, 0x53, 0xa8, 0xf8, 0x17, 0x0e, 0x35, 0xfc, 0xe1, 0x4b, 0x44, 0x9c, 0xd5, 0x9f, 0x55, 0x8e, 0x02, 0x0a, 0x89, 0x88, 0x94, 0xbd, 0x2a, 0x71, 0x75, 0x58, 0xe6, 0x65, 0x0f, 0x3a, 0x12, 0x85, 0x70, 0xd8, 0xc1, 0x69, 0xa7, 0x74, 0x66, 0x63, 0xc1, 0xd7, 0xef, 0x62, 0x14, 0x5f, 0x4b, 0x75, 0xc5, 0xfe, 0xb6, 0x38, 0x6f, 0xdb, 0x85, 0x33, 0x94, 0xc6, 0x59, 0xa9, 0x1a, 0xa2, 0xaa, 0xe0, 0x3b, 0xef, 0x91, 0x13, 0xdd, 0x49, 0x28, 0xff, 0x28, 0xb3, 0x80, 0x92, 0x7a, 0xd1, 0xba, 0x4e, 0x8a, 0x37, 0xed, 0xd1, 0x72, 0xef, 0xe8, 0xe9, 0xea, 0xbb, 0x61, 0x4d, 0x83 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.16", + /* Message */ + 63, + { 0x15, 0xc5, 0xfc, 0xc7, 0x54, 0x7d, 0x63, 0x76, 0x1f, 0x6a, 0xf1, 0xf2, 0x6e, 0xed, 0x9b, 0xe8, 0x13, 0x4f, 0x9f, 0x92, 0x12, 0x7e, 0x76, 0xb0, 0x3a, 0x33, 0xa9, 0x7b, 0x9b, 0xe3, 0xf7, 0x8b, 0x2e, 0x22, 0xfc, 0x7c, 0x85, 0x06, 0x99, 0xa1, 0x5c, 0x0e, 0x0e, 0xce, 0xbe, 0x2a, 0x71, 0x80, 0x5f, 0x02, 0x4b, 0x93, 0x88, 0xa3, 0xbd, 0xb2, 0xb3, 0x60, 0xd6, 0x9c, 0x5c, 0x0c, 0x46 } +, + /* Seed */ + 62, + { 0x5b, 0x4f, 0x17, 0xa9, 0xde, 0x91, 0x73, 0x7a, 0x7f, 0xe8, 0x54, 0xe8, 0xa1, 0x76, 0xbe, 0x5a, 0x0a, 0x16, 0xfc, 0x10, 0x42, 0xcb, 0x87, 0x0c, 0xc0, 0x18, 0x92, 0xfc, 0xd3, 0x8e, 0xa7, 0x5b, 0x07, 0x3c, 0x0f, 0xfa, 0x01, 0x4f, 0x96, 0xa3, 0x58, 0xe3, 0xaa, 0x5e, 0x73, 0xea, 0xf8, 0xa9, 0x1f, 0xce, 0x75, 0x47, 0x0b, 0xde, 0x64, 0xe8, 0x7a, 0xb8, 0x91, 0xba, 0x3b, 0xf2 } +, + /* Encryption */ + 128, + { 0x73, 0x62, 0xd7, 0x39, 0x8d, 0x0c, 0x25, 0x1f, 0x83, 0x58, 0x17, 0xe4, 0x79, 0x37, 0xa9, 0x25, 0x58, 0x36, 0xca, 0x02, 0x30, 0x45, 0x7f, 0xf6, 0x08, 0xb0, 0x78, 0xd5, 0x09, 0x31, 0xa8, 0x80, 0x33, 0xea, 0x76, 0x50, 0x81, 0x12, 0x65, 0xf8, 0xe2, 0x68, 0xb5, 0x33, 0x15, 0xd8, 0x43, 0x8e, 0x52, 0xa6, 0xa4, 0xb1, 0xb3, 0x89, 0x5d, 0x30, 0xc3, 0xda, 0xe1, 0x1a, 0x3b, 0x8e, 0xa8, 0xc3, 0x0f, 0x05, 0xe9, 0xd7, 0x1d, 0xef, 0x46, 0xd4, 0x51, 0x11, 0x92, 0xa1, 0x0f, 0x54, 0x21, 0x8d, 0x39, 0x36, 0xcb, 0x17, 0x98, 0x3a, 0x1e, 0x7a, 0xff, 0x18, 0x18, 0x89, 0x39, 0xb9, 0x46, 0x92, 0x76, 0x49, 0xb0, 0xfc, 0x4f, 0x7b, 0xbf, 0xcb, 0xfc, 0x14, 0xe1, 0xc0, 0xec, 0xa0, 0x7d, 0x00, 0xc9, 0x03, 0xdb, 0x78, 0x16, 0x9c, 0x50, 0xef, 0x0a, 0x38, 0xf1, 0xda, 0x19, 0xae, 0x44, 0x59 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.17", + /* Message */ + 29, + { 0x7c, 0xad, 0x18, 0xf1, 0x75, 0x13, 0x87, 0x42, 0x28, 0x5e, 0x90, 0x35, 0xd1, 0x3a, 0xd4, 0x1f, 0xc3, 0xa8, 0x52, 0x10, 0xe1, 0x54, 0x4e, 0x24, 0xde, 0xa3, 0xfc, 0xfe, 0x66 } +, + /* Seed */ + 96, + { 0x9a, 0x06, 0xca, 0x10, 0xfc, 0xc6, 0x61, 0x0e, 0x77, 0xdf, 0xf9, 0x0d, 0xd1, 0x76, 0xf8, 0x2e, 0x3f, 0x96, 0xe4, 0xa9, 0xd7, 0xab, 0x87, 0x2c, 0x74, 0x8e, 0xd4, 0x22, 0xf3, 0x4b, 0x33, 0x48, 0x61, 0x94, 0x40, 0xf0, 0xaa, 0xa2, 0x2a, 0x66, 0x98, 0x51, 0xda, 0xc8, 0x89, 0x4a, 0x8e, 0xfa, 0x34, 0xea, 0x2c, 0x2d, 0xa5, 0xe9, 0x58, 0x69, 0xe0, 0xad, 0xc0, 0x05, 0xa4, 0x9b, 0xa4, 0x58, 0x18, 0xca, 0xa4, 0x74, 0x11, 0x5c, 0x34, 0x49, 0x96, 0x6a, 0x85, 0xc4, 0x18, 0xfc, 0xaa, 0x8f, 0x45, 0x63, 0x0e, 0xfe, 0x0b, 0x1b, 0x4d, 0x3d, 0x69, 0xbe, 0x1b, 0xc0, 0x06, 0x8a, 0xa7, 0x99 } +, + /* Encryption */ + 128, + { 0x1e, 0xfa, 0xd4, 0x14, 0x46, 0xb9, 0x1f, 0xda, 0xdd, 0x8b, 0x80, 0x61, 0x9f, 0x68, 0x27, 0x36, 0x68, 0xb7, 0x58, 0x5f, 0xd9, 0x1f, 0x34, 0x49, 0xec, 0x85, 0xc2, 0x42, 0xd0, 0x84, 0x9e, 0x4a, 0x53, 0xa5, 0x97, 0x7b, 0x61, 0xaa, 0x40, 0xd1, 0x2c, 0xc4, 0x85, 0xec, 0x7e, 0x4f, 0xf2, 0x0f, 0x98, 0x86, 0x91, 0xcb, 0x9d, 0x73, 0xaf, 0x46, 0xea, 0x37, 0x6a, 0xfc, 0x69, 0xba, 0x22, 0x33, 0x86, 0xe9, 0xf1, 0x5d, 0x03, 0x26, 0x97, 0xda, 0x75, 0xe2, 0xf9, 0x52, 0xbe, 0x2a, 0xf0, 0x62, 0xe8, 0x24, 0x6c, 0xf7, 0x49, 0xb8, 0x9c, 0x4c, 0xbc, 0xd6, 0x4e, 0x23, 0xf8, 0x82, 0xbb, 0x55, 0x3c, 0x3c, 0xe3, 0x05, 0x20, 0x36, 0x22, 0xb5, 0xa7, 0x39, 0x77, 0x35, 0xa6, 0x34, 0xaa, 0xb0, 0xd1, 0x7e, 0xf9, 0xb5, 0x55, 0x9d, 0xdd, 0x34, 0xf4, 0x87, 0x2b, 0x56, 0xe7, 0x98, 0x6e, 0xfc } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.18", + /* Message */ + 18, + { 0xfd, 0x98, 0xc3, 0x8b, 0xe3, 0x19, 0x30, 0x70, 0xb5, 0xc4, 0x33, 0x4b, 0x11, 0xc2, 0x5b, 0x33, 0x4a, 0x44 } +, + /* Seed */ + 107, + { 0xf3, 0x57, 0x91, 0x11, 0x03, 0xe9, 0x87, 0xd1, 0xa9, 0xf1, 0x5c, 0xc2, 0xe5, 0x2f, 0x42, 0x39, 0x0e, 0x0f, 0xaa, 0x50, 0x02, 0xc4, 0xf1, 0x7d, 0x40, 0xa4, 0xaf, 0x50, 0xf3, 0x1a, 0x23, 0x17, 0x50, 0xe7, 0xaf, 0x61, 0xd9, 0xaf, 0xdf, 0x9c, 0xaa, 0x38, 0x61, 0xa2, 0x0d, 0xc7, 0x21, 0x89, 0x58, 0x61, 0xfb, 0x11, 0x8e, 0x08, 0x8d, 0x32, 0x18, 0xe6, 0xfb, 0x35, 0x56, 0xb1, 0x62, 0xd6, 0xbd, 0x67, 0x91, 0x1d, 0xbc, 0x94, 0x21, 0x98, 0x42, 0x65, 0x82, 0x72, 0xa5, 0xd4, 0x9b, 0xf5, 0xab, 0xb4, 0xa0, 0x87, 0x94, 0x95, 0xc5, 0xe6, 0xe6, 0x86, 0x28, 0x59, 0x29, 0xa5, 0x5a, 0x36, 0x8f, 0x52, 0x4c, 0x14, 0xa4, 0x0b, 0x0c, 0x61, 0x38, 0x0d, 0x0e } +, + /* Encryption */ + 128, + { 0xde, 0xae, 0x18, 0x3b, 0x56, 0xc3, 0xfb, 0x38, 0x41, 0xea, 0x57, 0x42, 0x34, 0xac, 0xd3, 0x0a, 0xff, 0x00, 0xd0, 0x05, 0x1f, 0x57, 0x80, 0x37, 0x58, 0xa4, 0x71, 0x4a, 0xbc, 0xbe, 0xdc, 0xda, 0x8b, 0xd1, 0xa4, 0x8a, 0x98, 0x01, 0x53, 0xdf, 0x89, 0x6b, 0x13, 0x76, 0xaa, 0x4b, 0x45, 0x95, 0x80, 0x13, 0xd6, 0x19, 0xbe, 0x7e, 0xaf, 0xf6, 0xc1, 0xa6, 0x75, 0xe2, 0x92, 0xef, 0xc3, 0xf4, 0x39, 0x3d, 0xdb, 0xde, 0xab, 0x47, 0xe8, 0x90, 0xa7, 0x8c, 0xef, 0x69, 0x00, 0x24, 0x49, 0x57, 0x87, 0x48, 0x90, 0x6c, 0x10, 0x21, 0xb8, 0x91, 0xb9, 0x43, 0xd8, 0x18, 0xd3, 0xa6, 0x1e, 0x67, 0xa3, 0x15, 0x61, 0x2d, 0x4c, 0xb1, 0xcf, 0x19, 0x7c, 0xe5, 0xdf, 0xab, 0xef, 0xda, 0xeb, 0x59, 0x0b, 0x8e, 0x8c, 0x73, 0x68, 0x5e, 0x74, 0x7e, 0x59, 0xa3, 0x95, 0xc8, 0x45, 0xc5, 0xd0, 0xc3 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.19", + /* Message */ + 54, + { 0x96, 0x53, 0xd7, 0x94, 0x69, 0xf0, 0x5d, 0x40, 0x19, 0x65, 0xa9, 0x5c, 0xe8, 0x74, 0xfa, 0x22, 0x5e, 0xc4, 0x79, 0x74, 0xe8, 0xd0, 0x68, 0x41, 0xc1, 0x3b, 0x47, 0x85, 0xe0, 0x0d, 0x54, 0x7f, 0x9d, 0x31, 0x44, 0xc3, 0x87, 0x9e, 0x6c, 0xcd, 0xaf, 0x78, 0x7a, 0xef, 0xc2, 0xf8, 0x45, 0x2a, 0x4a, 0x3c, 0x88, 0x4e, 0x38, 0xee } +, + /* Seed */ + 71, + { 0x85, 0x5d, 0x6d, 0x15, 0x12, 0xe5, 0x43, 0xa4, 0x5d, 0x3a, 0x9a, 0xa9, 0x68, 0x5d, 0x5d, 0xfd, 0xa7, 0x04, 0x79, 0xba, 0x39, 0x52, 0x63, 0x64, 0x14, 0x1b, 0xb6, 0x36, 0x27, 0x45, 0x89, 0x85, 0x71, 0x20, 0x01, 0x22, 0xf4, 0xbc, 0x82, 0xc6, 0x22, 0x43, 0x45, 0xc6, 0x9d, 0x3e, 0xf5, 0x42, 0xf1, 0x23, 0xbd, 0xe3, 0x01, 0x5b, 0x60, 0xc4, 0xc0, 0xff, 0xb9, 0x8d, 0x63, 0x01, 0x31, 0xae, 0xe8, 0x1f, 0xe4, 0xa0, 0xb0, 0x15, 0x38 } +, + /* Encryption */ + 128, + { 0x69, 0xca, 0x62, 0xe2, 0x9a, 0x5b, 0xdb, 0x4b, 0x04, 0xe2, 0x40, 0x16, 0x21, 0x2c, 0x25, 0x91, 0x40, 0xa6, 0x0c, 0xfa, 0x81, 0xeb, 0x66, 0x93, 0xbf, 0xfa, 0xfc, 0x9f, 0x60, 0x0d, 0xce, 0x10, 0x82, 0x2a, 0x00, 0x7b, 0x6a, 0xde, 0x93, 0xfa, 0xcd, 0xa1, 0xb2, 0xb1, 0x65, 0xb5, 0x57, 0x76, 0x0f, 0x0a, 0x67, 0x5a, 0xc9, 0xbc, 0xb2, 0x06, 0xb9, 0x64, 0xfb, 0x90, 0xcf, 0x6a, 0x2c, 0xf9, 0x9f, 0x18, 0x6b, 0x36, 0xd2, 0xeb, 0x99, 0x1d, 0x82, 0x53, 0xa0, 0x75, 0x4f, 0x9c, 0xc2, 0xd7, 0x2d, 0xe5, 0x49, 0xab, 0xae, 0x90, 0x94, 0xf5, 0xa8, 0x6c, 0xe1, 0xdb, 0x49, 0x4d, 0xbb, 0x6e, 0x51, 0x62, 0x86, 0x71, 0x5b, 0x3d, 0xd4, 0x05, 0x59, 0xb3, 0x10, 0x7b, 0x95, 0x24, 0xb7, 0x29, 0xac, 0x65, 0x4c, 0xfb, 0x40, 0xf9, 0xab, 0x35, 0xd0, 0x34, 0xe0, 0x27, 0x19, 0x7c, 0xbc, 0x36 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 4.20", + /* Message */ + 41, + { 0x0b, 0xdf, 0x3f, 0xce, 0x8e, 0x48, 0x7d, 0xb2, 0x2d, 0x07, 0x60, 0xab, 0x71, 0x15, 0x86, 0xca, 0x8e, 0x45, 0x9c, 0x39, 0x4f, 0xf8, 0xb1, 0xa1, 0x86, 0x70, 0x67, 0xa9, 0x31, 0x51, 0x99, 0xa8, 0x01, 0x24, 0x74, 0xb0, 0xf9, 0x0d, 0xcc, 0x87, 0xcb } +, + /* Seed */ + 84, + { 0xc9, 0xb7, 0x8d, 0xce, 0x9d, 0xfd, 0x7f, 0x04, 0x04, 0xff, 0x98, 0x2e, 0x06, 0xb5, 0x96, 0x50, 0xba, 0xfe, 0x31, 0xea, 0x19, 0xbc, 0x1f, 0x2e, 0x1f, 0x39, 0x89, 0xf4, 0xce, 0xfc, 0xe4, 0x6f, 0xc6, 0x52, 0x42, 0x3d, 0xb3, 0xc9, 0x9d, 0x92, 0xa8, 0xfb, 0x58, 0xf3, 0xee, 0x39, 0x3d, 0x55, 0x5b, 0x76, 0x84, 0x88, 0x9a, 0x4b, 0xf8, 0x15, 0xa1, 0x3e, 0x3b, 0x9b, 0xf2, 0x43, 0x71, 0x40, 0x66, 0xb9, 0x07, 0x58, 0x90, 0x67, 0x50, 0x47, 0xf1, 0x7e, 0x93, 0x5b, 0xdc, 0xf0, 0xe6, 0x6f, 0xcf, 0xe3, 0x9b, 0xcf } +, + /* Encryption */ + 128, + { 0x43, 0xad, 0x3e, 0x62, 0x5f, 0xb1, 0x72, 0x15, 0x57, 0x8b, 0xef, 0x2f, 0x46, 0x5f, 0xaa, 0x72, 0xae, 0x69, 0x43, 0x83, 0x36, 0x9f, 0xf7, 0xaa, 0x15, 0x12, 0x01, 0xa3, 0xf2, 0x59, 0xc8, 0xd8, 0xce, 0x8c, 0x16, 0xbd, 0x25, 0x52, 0x21, 0x49, 0xf6, 0x66, 0xe8, 0xd6, 0x92, 0xa0, 0x79, 0x5e, 0xa7, 0x15, 0x69, 0xd2, 0x88, 0x1f, 0x97, 0x07, 0x08, 0x5d, 0x3f, 0x59, 0xbd, 0xfa, 0x28, 0x73, 0x66, 0xd7, 0xf5, 0xa3, 0xf7, 0x6e, 0xa5, 0xdc, 0x10, 0x9f, 0xcb, 0x03, 0x30, 0x2d, 0xa0, 0xb7, 0x86, 0x99, 0x71, 0x3e, 0x0d, 0x30, 0x09, 0x58, 0x4f, 0x97, 0x17, 0x6c, 0x1b, 0x9b, 0xa6, 0x3e, 0x80, 0xcf, 0xa8, 0xfd, 0x4c, 0x01, 0x3d, 0x74, 0xb5, 0xfa, 0xde, 0x84, 0x72, 0xd5, 0x2c, 0x11, 0xe2, 0xe9, 0x36, 0x81, 0xba, 0x19, 0xd3, 0x53, 0xd3, 0x1c, 0xe6, 0xfa, 0x3c, 0x0a, 0xb6, 0x0d } + +} +, +} +}, +{ + "Example 5: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xab, 0x29, 0xd4, 0x9c, 0xdc, 0x92, 0x5c, 0x69, 0xca, 0xe7, 0x52, 0x92, 0xfc, 0x03, 0x62, 0x03, 0x73, 0xc6, 0xfb, 0x36, 0xd3, 0xc2, 0x49, 0xdd, 0x5b, 0xb5, 0x0f, 0x88, 0x1a, 0x4c, 0x93, 0x89, 0xaf, 0xe7, 0x3e, 0x8c, 0x56, 0xb8, 0xd6, 0x67, 0xa5, 0xea, 0xf2, 0xb5, 0x71, 0x4a, 0xda, 0xf4, 0xca, 0xa0, 0x06, 0xa4, 0x9a, 0xc4, 0xbd, 0x4b, 0x91, 0xd5, 0x45, 0xcf, 0x3c, 0x10, 0x00, 0x9d, 0x31, 0x8a, 0x9d, 0xe0, 0xf3, 0xbb, 0xd8, 0x38, 0x4e, 0x8c, 0x7e, 0x96, 0xca, 0x15, 0x95, 0xe3, 0x2a, 0x70, 0x41, 0xd1, 0x68, 0xca, 0xa7, 0x34, 0x43, 0xb8, 0x85, 0xbf, 0x7f, 0x61, 0x4a, 0xe1, 0x21, 0x2e, 0x3b, 0x5a, 0xdd, 0xa2, 0x9d, 0xfa, 0xd5, 0x01, 0xb8, 0xb1, 0xa8, 0x1c, 0x3f, 0x48, 0xa4, 0x56, 0xe1, 0x33, 0xad, 0x52, 0xda, 0x2a, 0xbc, 0xe5, 0xd6, 0xe7, 0x82, 0xf2, 0x75, 0xc9 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x07, 0x7b, 0xb2, 0x73, 0x32, 0x34, 0x86, 0xec, 0x4c, 0x25, 0xed, 0x67, 0x06, 0x34, 0x1a, 0xa8, 0xa6, 0x7a, 0xec, 0x58, 0x43, 0x0d, 0x53, 0x3f, 0xe5, 0x86, 0xc6, 0xb9, 0x4f, 0x57, 0x0a, 0x3b, 0x42, 0x90, 0xc4, 0x5c, 0x0b, 0xdd, 0x94, 0x68, 0x1f, 0x29, 0xa4, 0xb7, 0x58, 0x8e, 0xea, 0x80, 0x39, 0xcc, 0xa1, 0xc5, 0xb8, 0x0b, 0x82, 0x70, 0x27, 0x9d, 0xd0, 0xa9, 0xc5, 0x09, 0x39, 0x11, 0x93, 0xe3, 0xd5, 0xc2,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, 0xad, 0x19, 0x33, 0x09, 0x72, 0xd2, 0x1c, 0xac, 0x19, 0xce, 0x99, 0x6d } +, + /* Prime exponent 1 */ + 64, + { 0xe8, 0xa6, 0x0d, 0x88, 0x39, 0x54, 0x09, 0x73, 0xa2, 0xdd, 0x4a, 0x3b, 0xd1, 0x48, 0x05, 0x1d, 0xf8, 0xd1, 0x0e, 0x82, 0x87, 0xab, 0xb5, 0x45, 0xb0, 0x0c, 0x29, 0xec, 0x90, 0x7e, 0xfe, 0x16, 0x9f, 0x39, 0xbc, 0x02, 0x2d, 0x56, 0x97, 0x5a, 0xfd, 0x5c, 0xff, 0x82, 0x7e, 0x83, 0xda, 0x86, 0x7e, 0xd7, 0xce, 0x6f, 0xc6, 0xc8, 0xa2, 0xb7, 0xe4, 0xe0, 0x35, 0x75, 0x19, 0xeb, 0x49, 0x61 } +, + /* Prime exponent 2 */ + 64, + { 0x8f, 0xf2, 0xe2, 0x27, 0x37, 0x35, 0xc5, 0x5f, 0x05, 0x56, 0x6a, 0xe7, 0x5f, 0x29, 0xa9, 0xc9, 0x33, 0xa6, 0x2d, 0xef, 0xd7, 0xe2, 0x20, 0x01, 0x7f, 0x05, 0x45, 0xfc, 0xe9, 0x07, 0xe0, 0x65, 0xc4, 0x9f, 0x7b, 0xac, 0x34, 0x84, 0xc6, 0xf0, 0x60, 0x49, 0x99, 0x43, 0x32, 0x07, 0xc9, 0x13, 0xe8, 0x0b, 0xc0, 0x1b, 0xf7, 0x8d, 0x83, 0xef, 0xaf, 0x00, 0xda, 0x17, 0x12, 0xa4, 0xa6, 0x35 } +, + /* Coefficient */ + 64, + { 0x5f, 0x1f, 0xf9, 0x6a, 0x8a, 0x90, 0x19, 0x78, 0x4f, 0x92, 0x26, 0xe2, 0x5c, 0x9b, 0xfe, 0x25, 0x08, 0x02, 0x39, 0x43, 0x73, 0x90, 0x25, 0xdd, 0x6b, 0xab, 0x03, 0x7f, 0xf4, 0x7d, 0xc6, 0x42, 0x49, 0x85, 0x15, 0xc2, 0xf9, 0xe6, 0xff, 0x60, 0x60, 0xc5, 0xb7, 0xd2, 0x34, 0x30, 0xd8, 0xd5, 0x0f, 0x1c, 0x0f, 0x6d, 0x50, 0xc1, 0x80, 0xb4, 0xae, 0xa8, 0xa4, 0xa8, 0x2f, 0xcd, 0x2b, 0x74 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 5.1", + /* Message */ + 53, + { 0x5d, 0xc9, 0xf8, 0xb1, 0x2d, 0xc8, 0x12, 0xa0, 0x9a, 0xa4, 0xb0, 0x6d, 0xfc, 0xb5, 0x7e, 0x1d, 0x2e, 0x8d, 0x1c, 0x7d, 0x2c, 0x07, 0x6b, 0x25, 0xd5, 0xc1, 0x8e, 0xdb, 0xc0, 0x46, 0xbd, 0x63, 0xc7, 0xca, 0x4a, 0x59, 0x9f, 0x18, 0xde, 0x26, 0xf3, 0xbe, 0x73, 0x8c, 0xc2, 0x8d, 0x16, 0x67, 0x2c, 0x00, 0x6e, 0x4d, 0x9c } +, + /* Seed */ + 72, + { 0x43, 0xd6, 0x05, 0xa5, 0x74, 0x0a, 0x97, 0x0b, 0x32, 0x37, 0x27, 0xaf, 0x35, 0x2a, 0x1b, 0xd4, 0x8d, 0xe6, 0x9d, 0x95, 0x05, 0xe2, 0x2c, 0x2f, 0xad, 0x03, 0x0c, 0x3b, 0x84, 0xb6, 0xde, 0xa2, 0xd2, 0x2f, 0x91, 0x64, 0x06, 0xa7, 0x69, 0x3c, 0xf5, 0x06, 0xc2, 0xd2, 0x51, 0x88, 0x6f, 0x02, 0x20, 0x3e, 0x3f, 0x76, 0x55, 0xa3, 0x0a, 0x68, 0x37, 0xaf, 0x8a, 0x8c, 0xbe, 0xc7, 0xb5, 0xc9, 0x2f, 0xc0, 0x4c, 0x8c, 0x18, 0xdf, 0xe9, 0xd3 } +, + /* Encryption */ + 128, + { 0x21, 0x5a, 0x35, 0xf4, 0xc0, 0x43, 0x5b, 0x07, 0xed, 0x5d, 0x2c, 0x4b, 0x68, 0x65, 0xbc, 0x28, 0x1c, 0xea, 0x70, 0x50, 0xcf, 0xea, 0x7a, 0x7e, 0x86, 0xe0, 0x3f, 0x8a, 0xcb, 0x28, 0xb5, 0x8d, 0xbe, 0xe6, 0x54, 0x58, 0x91, 0x9c, 0xea, 0xa5, 0xa3, 0x3e, 0xdd, 0x98, 0x20, 0x1e, 0xa6, 0xe7, 0x63, 0x2d, 0x76, 0x22, 0xd5, 0xa5, 0x1d, 0x35, 0xa3, 0x5f, 0xed, 0xe8, 0x6e, 0xf2, 0x03, 0xee, 0xf6, 0xeb, 0x34, 0x75, 0xec, 0x8f, 0x19, 0xe6, 0x9c, 0x0e, 0xd5, 0x2c, 0x05, 0xdd, 0x7d, 0x59, 0xe3, 0x53, 0xf5, 0x2b, 0x67, 0x10, 0xaf, 0x40, 0x26, 0x65, 0x55, 0x04, 0x10, 0x7d, 0xdb, 0x86, 0xf9, 0x57, 0xe6, 0xc0, 0x6b, 0xa6, 0x7b, 0x1f, 0x4f, 0xc9, 0xf1, 0x21, 0xe1, 0x5f, 0x82, 0x73, 0x67, 0x09, 0xd2, 0xde, 0x8d, 0x77, 0x43, 0x2d, 0xf0, 0x8d, 0xcc, 0xd2, 0xa0, 0xcc, 0x77, 0x04 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.2", + /* Message */ + 16, + { 0xd7, 0x74, 0x07, 0xd8, 0xf6, 0x9f, 0x80, 0xdc, 0x08, 0xeb, 0xa5, 0xf4, 0x26, 0x28, 0x2d, 0xe7 } +, + /* Seed */ + 109, + { 0xb8, 0x29, 0xc7, 0x89, 0xbe, 0x38, 0x1c, 0xd5, 0x9d, 0xe2, 0x14, 0x89, 0xdb, 0xa1, 0x41, 0xe0, 0xbd, 0x1f, 0xa8, 0xa3, 0xc3, 0x82, 0x6d, 0x59, 0xc6, 0xd1, 0x10, 0xe7, 0xdf, 0x72, 0x42, 0xba, 0x98, 0xc4, 0x7a, 0x43, 0x92, 0xc7, 0xf2, 0xac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x01, 0xa8, 0xd3, 0xd3, 0xea, 0xa3, 0x53, 0x9b, 0xbf, 0x62, 0xaa, 0xd9, 0x9a, 0x3b, 0xb1, 0x1e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.3", + /* Message */ + 2, + { 0x23, 0x8a } +, + /* Seed */ + 123, + { 0xa5, 0x88, 0x1a, 0xcf, 0xf3, 0x52, 0x9f, 0x25, 0x1b, 0x1b, 0x9c, 0x61, 0x9c, 0xe9, 0xf9, 0xdf, 0x91, 0xe0, 0xa0, 0x3d, 0xd8, 0x89, 0x16, 0x36, 0x46, 0x87, 0x1a, 0x62, 0x72, 0x07, 0xee, 0xf1, 0x47, 0x68, 0x0c, 0x32, 0xf4, 0x50, 0xa7, 0x76, 0xe1, 0x9f, 0x54, 0xec, 0x05, 0x5d, 0xc6, 0x8b, 0x04, 0xbd, 0x4d, 0x89, 0x37, 0x6d, 0xf3, 0xea, 0xfa, 0x6f, 0xca, 0xf6, 0x0e, 0xb8, 0x31, 0x84, 0x39, 0x10, 0xb6, 0x25, 0xb6, 0x4f, 0x25, 0xd9, 0x29, 0x9a, 0xfc, 0x30, 0x6a, 0x23, 0x76, 0x53, 0x80, 0x45, 0x51, 0x94, 0xb7, 0x5d, 0xc0, 0x13, 0x5d, 0x27, 0xc3, 0xb7, 0xd7, 0x2d, 0xf9, 0x08, 0x77, 0x5c, 0x7e, 0x90, 0xbe, 0xfc, 0x0c, 0x5a, 0xdf, 0x74, 0xa1, 0x69, 0xed, 0x58, 0x68, 0xf3, 0xd6, 0x34, 0x32, 0x7a, 0x05, 0x78, 0x18, 0x92, 0x54, 0x45, 0x43 } +, + /* Encryption */ + 128, + { 0x77, 0x10, 0xee, 0xa8, 0x65, 0x7d, 0xfd, 0x15, 0x65, 0x16, 0x65, 0x62, 0xdf, 0x0e, 0x2e, 0x84, 0x0e, 0xc3, 0xe3, 0xde, 0xdc, 0x0b, 0x80, 0x2b, 0xb0, 0x21, 0x3e, 0x47, 0xa5, 0xce, 0x97, 0xf4, 0xb8, 0x5b, 0xa9, 0xba, 0x14, 0x19, 0x77, 0x36, 0x3d, 0x8f, 0x54, 0xb0, 0x6d, 0x57, 0x8d, 0x5b, 0x2a, 0x96, 0xe9, 0x69, 0xcf, 0xa9, 0x15, 0xdf, 0x21, 0x9f, 0x00, 0x2a, 0x85, 0xd0, 0x32, 0x57, 0x04, 0x7b, 0x31, 0x16, 0xa1, 0xc4, 0xdd, 0xaf, 0x79, 0x1d, 0x93, 0x98, 0x2d, 0x1b, 0x9f, 0xfa, 0x24, 0x31, 0x86, 0xe9, 0xe2, 0xb1, 0x9e, 0xf0, 0x74, 0x1c, 0xe9, 0x8d, 0xe2, 0xa4, 0xa1, 0x58, 0x6e, 0x50, 0x12, 0xc4, 0x81, 0xde, 0x23, 0xa0, 0xef, 0xf8, 0x82, 0xfd, 0x62, 0x38, 0x38, 0xd2, 0x01, 0x1f, 0x4f, 0x63, 0x73, 0x8a, 0xff, 0xd7, 0xef, 0xb8, 0xc5, 0x0f, 0x46, 0xa6, 0xc2, 0x0e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.4", + /* Message */ + 33, + { 0x25, 0xa2, 0x7e, 0xb1, 0xb2, 0x1f, 0x10, 0xcf, 0x9d, 0x57, 0x1c, 0x33, 0x05, 0x61, 0x0b, 0x97, 0xf0, 0xda, 0xee, 0x39, 0x90, 0x5c, 0x65, 0x94, 0xbf, 0xbf, 0x45, 0x2a, 0x9a, 0x00, 0xd9, 0xe8, 0x2b } +, + /* Seed */ + 92, + { 0x25, 0x04, 0x61, 0x80, 0x11, 0xc6, 0x73, 0xdb, 0x3c, 0x41, 0x22, 0x79, 0xdc, 0x8a, 0xd1, 0x65, 0xab, 0x7b, 0x64, 0x73, 0xae, 0x19, 0x5e, 0x8d, 0x6d, 0x41, 0x21, 0x49, 0x18, 0x19, 0x8b, 0x34, 0x51, 0xa6, 0x50, 0x8d, 0x61, 0x38, 0xce, 0xdc, 0x51, 0x8d, 0x80, 0x12, 0xba, 0x0e, 0xc7, 0x9b, 0x38, 0x6a, 0xf8, 0xfa, 0x40, 0xb0, 0x34, 0x78, 0xbb, 0xf2, 0xba, 0x06, 0x5e, 0x58, 0x2d, 0x61, 0x95, 0xcc, 0xbe, 0x15, 0x8f, 0x11, 0x78, 0x1e, 0xae, 0xb1, 0xb1, 0x72, 0x0b, 0x72, 0xd9, 0xb5, 0x21, 0x27, 0xde, 0xb9, 0x55, 0x17, 0x11, 0xe8, 0x87, 0xdb, 0xd0, 0xb8 } +, + /* Encryption */ + 128, + { 0x35, 0x72, 0xbd, 0xea, 0x23, 0x05, 0xe1, 0x78, 0x5c, 0x75, 0x4d, 0xe7, 0x44, 0xc4, 0xfa, 0x3f, 0xa2, 0xcb, 0x75, 0x71, 0x60, 0xe5, 0xcb, 0x39, 0xa3, 0x14, 0x97, 0xe1, 0x48, 0x5b, 0xbd, 0x7c, 0x08, 0x99, 0xc5, 0x35, 0x85, 0xb2, 0xbb, 0xbb, 0xd9, 0x90, 0x81, 0xb4, 0x16, 0xef, 0xc6, 0x85, 0x78, 0xdb, 0x78, 0xe0, 0xec, 0xd0, 0x8d, 0xa7, 0xa3, 0x95, 0x3e, 0x38, 0x6b, 0xb2, 0x5c, 0x12, 0xbb, 0xb8, 0x7c, 0x78, 0x94, 0x42, 0x83, 0xa8, 0xc8, 0x01, 0x87, 0xb4, 0x50, 0x8d, 0xab, 0xbc, 0x76, 0x97, 0xf4, 0x3a, 0x8a, 0xe7, 0x8a, 0x33, 0xfe, 0xbb, 0x15, 0xf3, 0xcd, 0x58, 0x1c, 0x80, 0xd4, 0x9b, 0x97, 0x1b, 0xcb, 0xd4, 0x8e, 0x44, 0x14, 0x2f, 0x58, 0xc2, 0xc9, 0x1a, 0xdb, 0x1a, 0xe1, 0x45, 0xaa, 0x9a, 0x83, 0xb3, 0xc5, 0x81, 0x5a, 0xa1, 0xa8, 0xff, 0x8d, 0xd2, 0x31, 0xfe } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.5", + /* Message */ + 6, + { 0x59, 0xcf, 0x0b, 0x6b, 0x50, 0xea } +, + /* Seed */ + 119, + { 0x2b, 0xf1, 0x91, 0x60, 0xdf, 0x69, 0x88, 0x93, 0x5b, 0xd2, 0x46, 0x10, 0x6b, 0x89, 0x09, 0xdd, 0x7b, 0xb3, 0xe5, 0x16, 0x90, 0xdf, 0x84, 0xd7, 0x6e, 0x4d, 0x31, 0xac, 0x82, 0x10, 0x44, 0x56, 0x34, 0x6b, 0x4c, 0x3c, 0x9b, 0xa7, 0xb5, 0xe9, 0xe6, 0x8e, 0xe2, 0x08, 0x6c, 0x84, 0x73, 0xc6, 0x83, 0x02, 0xe2, 0x59, 0x9a, 0xbf, 0x6b, 0x31, 0xce, 0xb3, 0xf7, 0x81, 0xad, 0x6b, 0x56, 0x89, 0x86, 0xf2, 0x1c, 0xd6, 0xd7, 0x55, 0x32, 0x8f, 0xb8, 0x3a, 0xfd, 0x55, 0x48, 0x50, 0x1d, 0x07, 0x0a, 0xc2, 0xdd, 0x8f, 0x5c, 0xdf, 0xb6, 0x2c, 0xef, 0x54, 0x5e, 0x81, 0x5f, 0xe3, 0x82, 0xbc, 0x0c, 0x67, 0xb6, 0x76, 0xe5, 0x45, 0x6e, 0xbb, 0x9a, 0xb6, 0x7d, 0xf4, 0x77, 0x40, 0xc6, 0xa4, 0x3d, 0xe3, 0xf9, 0xa2, 0x47, 0x7a, 0x9b } +, + /* Encryption */ + 128, + { 0x2e, 0xd5, 0x91, 0xfd, 0x4b, 0x35, 0x7e, 0x94, 0xf4, 0x81, 0xba, 0x84, 0xff, 0x4e, 0xbe, 0x7a, 0xe4, 0x31, 0x05, 0x4e, 0x5c, 0xd9, 0x8a, 0x99, 0x58, 0x96, 0x48, 0xe6, 0x16, 0xcd, 0x68, 0xe0, 0xd4, 0x72, 0x4f, 0xa8, 0xa6, 0xc5, 0x99, 0x68, 0x6b, 0xfe, 0xe1, 0x74, 0x7a, 0xd0, 0x77, 0xdb, 0xed, 0xad, 0x45, 0xf1, 0x24, 0x4d, 0x7f, 0x8e, 0x00, 0xda, 0x3a, 0x3a, 0x06, 0xd2, 0x31, 0x32, 0xd3, 0x17, 0x1d, 0x74, 0x4e, 0xf1, 0x4e, 0x1e, 0x97, 0xcd, 0xda, 0x10, 0x9b, 0xd2, 0xe5, 0x56, 0xa5, 0xfc, 0x7b, 0xbc, 0x60, 0x9a, 0x7f, 0xf2, 0x4c, 0xfa, 0xbe, 0xf4, 0xb5, 0x6c, 0xbb, 0xb7, 0x0e, 0x05, 0x06, 0x53, 0xb6, 0x98, 0x48, 0xd7, 0x11, 0x30, 0x75, 0xa5, 0xde, 0xbe, 0x7a, 0x46, 0x82, 0x15, 0xf8, 0xdc, 0x08, 0xe7, 0xef, 0x84, 0xfd, 0x55, 0x77, 0x8c, 0xd5, 0xb5, 0x96, 0xe5 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.6", + /* Message */ + 57, + { 0xe9, 0x44, 0x52, 0xf5, 0x0a, 0x5e, 0xdb, 0xe6, 0x75, 0x73, 0xab, 0x22, 0x30, 0x9f, 0xa2, 0x1b, 0xab, 0xc6, 0xd2, 0x25, 0x20, 0xe6, 0xe8, 0x3b, 0xf7, 0x2e, 0x7a, 0xfa, 0x6d, 0x71, 0xe2, 0x02, 0x96, 0xda, 0xea, 0xf5, 0x4a, 0x60, 0xc8, 0x03, 0x63, 0x04, 0x87, 0x9a, 0x21, 0x31, 0xd1, 0x78, 0x78, 0x0e, 0x34, 0x8e, 0xe0, 0x12, 0x0b, 0x99, 0x7c } +, + /* Seed */ + 68, + { 0xc5, 0x30, 0x44, 0x3a, 0x16, 0xef, 0xd8, 0xd6, 0xd7, 0x2a, 0xb4, 0x44, 0x3f, 0x8d, 0xb2, 0x44, 0x91, 0xde, 0x99, 0xd5, 0xaa, 0xbe, 0x51, 0x88, 0xb3, 0xf6, 0x1d, 0xc0, 0x48, 0x3b, 0x7e, 0xe0, 0x0b, 0x1c, 0x13, 0x25, 0x9b, 0x8a, 0xe2, 0x40, 0x9f, 0x1a, 0xe6, 0x2d, 0x99, 0x30, 0xc1, 0x1a, 0x4d, 0xde, 0xf3, 0xe8, 0x35, 0x82, 0x93, 0x88, 0x93, 0xf9, 0xac, 0x66, 0x8f, 0x79, 0xc6, 0x4c, 0x7f, 0x5d, 0x79, 0x6d } +, + /* Encryption */ + 128, + { 0x0e, 0xee, 0x90, 0xc7, 0x08, 0x18, 0x22, 0x1a, 0xe2, 0x70, 0x4b, 0xbe, 0x38, 0xd6, 0x8f, 0x8e, 0x15, 0x4c, 0x6e, 0xe7, 0xad, 0xe5, 0x3e, 0x2a, 0x1f, 0x4d, 0x1d, 0xba, 0xac, 0x98, 0xc5, 0x75, 0x91, 0xeb, 0xb6, 0xc6, 0x38, 0xbc, 0xb6, 0x8e, 0x18, 0x14, 0x35, 0xb7, 0x00, 0x01, 0xba, 0xd1, 0x80, 0x19, 0x2b, 0xfd, 0xa0, 0x57, 0x32, 0xc0, 0x5e, 0x7f, 0xb5, 0xaf, 0x22, 0xaa, 0x89, 0xd2, 0xa8, 0xff, 0x80, 0xcf, 0x9f, 0x08, 0x62, 0xf0, 0x4c, 0x05, 0xca, 0xca, 0x3d, 0x2a, 0x3a, 0x5b, 0x07, 0x79, 0x94, 0x6c, 0x6d, 0xdf, 0xa0, 0x4c, 0xd7, 0x9f, 0xa1, 0x64, 0xd6, 0x02, 0xf1, 0xb7, 0xde, 0x5c, 0x95, 0xbe, 0x85, 0xe9, 0x60, 0x84, 0x67, 0xe2, 0x5c, 0x29, 0xd0, 0x35, 0xc4, 0x66, 0x09, 0x06, 0x26, 0x9f, 0x6d, 0xc0, 0x0a, 0x47, 0x2b, 0x04, 0x46, 0xea, 0x56, 0xe7, 0x2a, 0x59 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.7", + /* Message */ + 44, + { 0x1c, 0xbf, 0xa0, 0xe7, 0xb1, 0xa1, 0x0c, 0x13, 0xd7, 0x50, 0x77, 0xb1, 0x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, 0x71, 0xaf, 0x09, 0xa0, 0x92, 0x9e, 0xde, 0xee, 0xde, 0x83, 0xe7, 0x22, 0x44, 0x20, 0x3b, 0x2b, 0xf4, 0x5c, 0xeb, 0x18, 0x7e, 0x9d, 0xb3, 0xc7, 0xd3, 0xad, 0x05, 0xb2, 0x3b, 0x59, 0x62, 0x4c, 0x24, 0x66, 0x96, 0xcf, 0xc7, 0x58, 0x06, 0x39, 0x14, 0x02, 0xe4, 0x44, 0xe3, 0x97, 0x49, 0x69, 0x88, 0xe1, 0xe1, 0xf4, 0x2c, 0x6a, 0xde, 0xd3, 0x0c, 0xdc, 0x93, 0x79, 0x37, 0xf3, 0x00, 0x54 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.8", + /* Message */ + 64, + { 0xe1, 0x72, 0xa6, 0xb8, 0xb4, 0x96, 0xf0, 0x77, 0x73, 0x8b, 0x74, 0xf6, 0xd8, 0xb2, 0x92, 0xdd, 0xa6, 0x07, 0xf2, 0xad, 0xbf, 0xb3, 0x72, 0xbe, 0x37, 0xee, 0x00, 0x08, 0x88, 0xbe, 0xa3, 0x1f, 0x99, 0xcb, 0xa1, 0xcf, 0x39, 0x32, 0xe4, 0xbe, 0x37, 0x17, 0xc9, 0xe1, 0x68, 0x90, 0x1a, 0x32, 0xd1, 0xb8, 0x20, 0xbe, 0x4f, 0xb0, 0x13, 0x75, 0x27, 0xa2, 0x48, 0x18, 0x77, 0xfe, 0x01, 0xee } +, + /* Seed */ + 61, + { 0x84, 0x0c, 0xe1, 0x3b, 0xbc, 0x96, 0x17, 0xdc, 0x9f, 0x3f, 0x26, 0xb1, 0x47, 0x30, 0x1a, 0x6f, 0x46, 0x30, 0x0d, 0x77, 0x81, 0xa5, 0xd9, 0x81, 0x16, 0x2f, 0x86, 0x92, 0x87, 0x37, 0x1f, 0x1d, 0x59, 0x58, 0x76, 0x4f, 0xb0, 0x0b, 0x05, 0x53, 0x70, 0xec, 0x71, 0x1b, 0xba, 0x52, 0x83, 0xfc, 0xb0, 0x0b, 0x83, 0xbc, 0x02, 0x17, 0x5e, 0xa1, 0x01, 0x7b, 0xcc, 0x83, 0x53 } +, + /* Encryption */ + 128, + { 0x99, 0x3e, 0x39, 0x6f, 0xb5, 0x7b, 0x2e, 0xa6, 0xa1, 0xa3, 0xfc, 0xed, 0x9a, 0x69, 0xd3, 0x61, 0xcb, 0xb6, 0x26, 0x5b, 0x26, 0x50, 0x3c, 0x17, 0x5f, 0x84, 0xc6, 0x1a, 0x41, 0xea, 0x3e, 0x1c, 0xe4, 0xfb, 0xb6, 0x2e, 0x01, 0xd6, 0x42, 0x0e, 0x22, 0xfe, 0xf1, 0xd9, 0xe2, 0x8a, 0x58, 0x83, 0xe2, 0xea, 0xc8, 0x2e, 0x05, 0xf3, 0x58, 0xea, 0x75, 0xf7, 0x7d, 0xa4, 0x89, 0x7b, 0x6b, 0x64, 0x9a, 0xa4, 0x74, 0x28, 0x39, 0x41, 0x93, 0xdd, 0xec, 0x64, 0x8c, 0x3a, 0x7f, 0xb8, 0x1c, 0xfc, 0xf4, 0xb5, 0x1c, 0xe3, 0xeb, 0xba, 0x78, 0xae, 0xdc, 0xa7, 0xbb, 0x91, 0x7b, 0x35, 0xb3, 0xe2, 0x2a, 0xeb, 0x20, 0x1c, 0xea, 0x96, 0x59, 0x2e, 0x50, 0xe0, 0xd2, 0x84, 0x1e, 0x7d, 0x2c, 0xe0, 0xd6, 0x9f, 0xf3, 0x03, 0x9d, 0xc0, 0x1e, 0x96, 0x4a, 0x97, 0x7a, 0x01, 0x76, 0x83, 0xb3, 0x87 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.9", + /* Message */ + 55, + { 0xc8, 0xf0, 0xea, 0x23, 0xe0, 0x66, 0x11, 0xe4, 0xfd, 0x27, 0xb6, 0x1d, 0xb7, 0x92, 0x0c, 0x55, 0xf3, 0xc0, 0xa2, 0x22, 0x12, 0x88, 0x38, 0xe4, 0xcd, 0xb0, 0x62, 0xe1, 0x76, 0xb2, 0x1f, 0xc2, 0x32, 0x53, 0x55, 0x8c, 0x5d, 0x40, 0xde, 0x2d, 0xfd, 0x62, 0x0f, 0xb7, 0xcd, 0xf1, 0x39, 0x9c, 0x2a, 0xf8, 0xfc, 0x77, 0xca, 0x33, 0x35 } +, + /* Seed */ + 70, + { 0x16, 0x4d, 0x77, 0xb5, 0xd2, 0x6a, 0xe6, 0xd7, 0xab, 0xe7, 0xca, 0xed, 0x62, 0x5d, 0x87, 0xc2, 0x11, 0xcc, 0x50, 0x9a, 0xd0, 0x17, 0x2c, 0x20, 0x83, 0x3d, 0x8f, 0x98, 0xca, 0xe3, 0x8a, 0x2c, 0x37, 0x0e, 0xf2, 0x1d, 0x40, 0x96, 0xda, 0x84, 0x1d, 0xbe, 0xee, 0x94, 0x8e, 0xc6, 0x34, 0x03, 0xca, 0xbd, 0x4a, 0x5f, 0x71, 0xac, 0xe4, 0x93, 0x64, 0xaa, 0x7d, 0xe2, 0x0f, 0x32, 0xc9, 0x88, 0x33, 0x7a, 0x11, 0x5f, 0x83, 0x46 } +, + /* Encryption */ + 128, + { 0x7a, 0x8f, 0x15, 0xee, 0xf5, 0x10, 0xad, 0xe8, 0xd5, 0xc3, 0x17, 0xf9, 0x06, 0x4a, 0xd7, 0xda, 0xe6, 0xc9, 0x3e, 0x7c, 0xf1, 0x56, 0xa7, 0x37, 0x22, 0x02, 0x32, 0x58, 0xf8, 0xb5, 0x74, 0x47, 0x34, 0x70, 0x00, 0x34, 0xa3, 0xde, 0x6f, 0x13, 0x7a, 0xf6, 0xe9, 0x00, 0x46, 0xd8, 0x6e, 0x9b, 0x90, 0x59, 0x0f, 0xa5, 0xa6, 0x50, 0xce, 0xf4, 0xfd, 0xb4, 0xd3, 0x36, 0x02, 0x33, 0xaf, 0x86, 0xf4, 0xa7, 0xa2, 0x3c, 0x24, 0x3d, 0x19, 0x51, 0xc6, 0x66, 0xb6, 0x73, 0xc3, 0x3c, 0x7d, 0xec, 0x4f, 0x51, 0xac, 0xe3, 0x4b, 0x80, 0x5c, 0x0a, 0x9e, 0x67, 0xe2, 0x09, 0xcc, 0x7f, 0x9e, 0xd6, 0x9b, 0x8f, 0x5e, 0xb5, 0xc5, 0x53, 0xe0, 0xf1, 0x5c, 0x10, 0x30, 0x4b, 0xf5, 0x6d, 0x7b, 0xe1, 0x71, 0xf3, 0x1c, 0xce, 0x88, 0xf3, 0x7d, 0x1f, 0xb4, 0xa2, 0xa0, 0x04, 0x18, 0x89, 0x75, 0x76 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.10", + /* Message */ + 49, + { 0x19, 0xdb, 0x24, 0x22, 0x05, 0xc0, 0x3d, 0x7f, 0xa9, 0x93, 0x5d, 0x9e, 0x04, 0xfa, 0x6e, 0xcf, 0x38, 0xa5, 0x1e, 0xa9, 0x98, 0xac, 0x8e, 0x4b, 0xac, 0xa6, 0xcd, 0xfd, 0x6a, 0x0a, 0xce, 0x1d, 0xf3, 0x67, 0xe7, 0x3d, 0x23, 0xc2, 0x40, 0xaf, 0x76, 0xb6, 0x2e, 0x9f, 0xe9, 0x21, 0x5f, 0xe9, 0x43 } +, + /* Seed */ + 76, + { 0xbe, 0x49, 0x52, 0x05, 0x55, 0x69, 0x56, 0xfa, 0xe2, 0xa2, 0x2e, 0xa7, 0x0c, 0xe1, 0x02, 0xde, 0x06, 0x6c, 0x9e, 0x58, 0x95, 0x96, 0x06, 0x21, 0x74, 0x84, 0xa5, 0xb1, 0x50, 0x36, 0xff, 0xa1, 0xd4, 0x61, 0x23, 0x9d, 0xd4, 0x7b, 0x4f, 0x38, 0x1c, 0xea, 0x71, 0x51, 0x6e, 0x2d, 0xb0, 0xfc, 0x36, 0x9d, 0x72, 0xb4, 0x40, 0x69, 0x65, 0x12, 0xa9, 0x72, 0x88, 0xf0, 0x6f, 0xc0, 0xbc, 0xeb, 0x96, 0x82, 0x86, 0xe9, 0x95, 0xe0, 0x2d, 0x21, 0x8d, 0x9c, 0x26, 0x62 } +, + /* Encryption */ + 128, + { 0x55, 0x12, 0xb3, 0x99, 0x9b, 0x30, 0xc9, 0xc1, 0x44, 0x0e, 0x59, 0x75, 0x93, 0x1d, 0x55, 0xf2, 0x1e, 0x9e, 0xb4, 0x22, 0xb6, 0x2d, 0xaf, 0xcd, 0xab, 0x5d, 0x50, 0x03, 0xa7, 0x5e, 0xb1, 0x24, 0x81, 0x99, 0x86, 0x36, 0x19, 0x13, 0x36, 0x1d, 0xfc, 0x46, 0xac, 0x29, 0xaa, 0xba, 0x8e, 0x1a, 0xa0, 0x2e, 0x1b, 0xa4, 0x44, 0x67, 0x16, 0x2d, 0x20, 0xf6, 0x3a, 0xd1, 0x70, 0xfe, 0x0d, 0x87, 0xa5, 0x3d, 0x93, 0xc6, 0x4e, 0x02, 0x6b, 0x12, 0xbe, 0x6b, 0xc2, 0xb8, 0xeb, 0x0e, 0x57, 0xc0, 0x39, 0xeb, 0x60, 0xf3, 0x2c, 0x4b, 0x52, 0x70, 0x35, 0xf7, 0x03, 0xa7, 0xa8, 0x37, 0x4b, 0xd7, 0xfa, 0xa7, 0xb5, 0x40, 0x4a, 0x3c, 0x5a, 0xad, 0xb7, 0x92, 0xe2, 0x5f, 0xf9, 0x28, 0x76, 0xb2, 0x3d, 0xd3, 0xa7, 0x42, 0x2c, 0x45, 0x26, 0x6c, 0x6d, 0x98, 0x6e, 0xec, 0x53, 0x34, 0xb9, 0xba } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.11", + /* Message */ + 35, + { 0x49, 0xa7, 0x61, 0xf8, 0xc1, 0x8e, 0xf9, 0x23, 0x62, 0xd6, 0xab, 0xb2, 0x4c, 0x07, 0xfc, 0x72, 0x82, 0x55, 0x84, 0x24, 0x53, 0x69, 0x4e, 0x17, 0x60, 0x58, 0x99, 0xf4, 0x37, 0xb3, 0x1a, 0xc9, 0x8d, 0xb5, 0x16 } +, + /* Seed */ + 90, + { 0xd8, 0xcd, 0x85, 0xed, 0xfa, 0x0a, 0x84, 0xd0, 0x76, 0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0xcf, 0x3c, 0xd9, 0x51, 0x96, 0x77, 0xa5, 0x8b, 0x1d, 0x1d, 0x99, 0x4f, 0xc1, 0xc9, 0x05, 0x7a, 0xc1, 0x06, 0xe8, 0x16, 0x04, 0x59, 0x26, 0xb4, 0x5b, 0x00, 0xe5 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.12", + /* Message */ + 10, + { 0x84, 0xe8, 0x28, 0xf7, 0x15, 0xf2, 0x28, 0xa6, 0x02, 0x65 } +, + /* Seed */ + 115, + { 0xf7, 0xf2, 0x75, 0xa8, 0x53, 0xd4, 0xe1, 0x26, 0xd7, 0xd0, 0xc3, 0x8e, 0xf7, 0x03, 0xf3, 0xfb, 0xda, 0x7a, 0x95, 0x20, 0x78, 0x8d, 0x7a, 0x81, 0xa3, 0x1b, 0x05, 0x30, 0xd4, 0x3f, 0xe6, 0xc9, 0x4b, 0x1b, 0x1b, 0xb1, 0x08, 0x51, 0x20, 0x9d, 0xb2, 0x6a, 0xc4, 0xb8, 0x88, 0xae, 0xce, 0xea, 0x77, 0x13, 0x82, 0x4c, 0x29, 0x38, 0xb4, 0xc6, 0x43, 0x1b, 0x2b, 0x03, 0xc6, 0x93, 0xab, 0x7b, 0x54, 0x63, 0x15, 0x41, 0x54, 0x6a, 0xc4, 0x03, 0x94, 0x79, 0x85, 0x48, 0xfb, 0xba, 0x95, 0x88, 0x2d, 0x91, 0xa1, 0x7c, 0x27, 0xe7, 0xdd, 0x53, 0x02, 0x6c, 0x96, 0x79, 0x1e, 0xe5, 0x5f, 0x24, 0x7d, 0x7f, 0x89, 0x8f, 0xea, 0xb3, 0x70, 0x9a, 0x13, 0x2a, 0x78, 0x26, 0x66, 0xa1, 0x4d, 0x0d, 0xf1, 0xa8, 0x4e } +, + /* Encryption */ + 128, + { 0x4e, 0x3f, 0xe9, 0x6e, 0x8f, 0x96, 0xe5, 0xb3, 0xc6, 0x11, 0xca, 0xdb, 0x96, 0xed, 0x51, 0x04, 0x20, 0x98, 0xec, 0xc5, 0x47, 0xbe, 0x7b, 0x88, 0xf8, 0xde, 0xa7, 0x65, 0xae, 0x14, 0xe8, 0x35, 0x0c, 0xfe, 0x39, 0xdc, 0xb1, 0xc1, 0xd6, 0xe4, 0x17, 0x9c, 0xa4, 0x04, 0xd5, 0x38, 0x4d, 0x87, 0xb0, 0x66, 0x50, 0x75, 0xee, 0xd7, 0xda, 0x7a, 0xaf, 0x71, 0x00, 0x8e, 0x24, 0x67, 0xd7, 0x0b, 0xff, 0xf6, 0x23, 0xb4, 0x59, 0x4b, 0x6d, 0xff, 0xf9, 0x0e, 0x3d, 0x84, 0x85, 0xf9, 0x41, 0x89, 0x48, 0x6c, 0xa0, 0xca, 0x9e, 0x72, 0x2b, 0x2a, 0x77, 0x7e, 0x25, 0xb5, 0x82, 0xf7, 0xad, 0x4e, 0xc5, 0x10, 0x3a, 0xd7, 0x67, 0x85, 0x9a, 0xc5, 0x9a, 0x1b, 0x8c, 0x5c, 0x19, 0x71, 0x30, 0x17, 0x48, 0xfc, 0xc2, 0x64, 0xf6, 0xc9, 0x29, 0x36, 0x4a, 0x8d, 0x9a, 0xf4, 0x22, 0x55, 0xc0, 0xf6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.13", + /* Message */ + 51, + { 0xc4, 0x79, 0x7e, 0x8a, 0x6f, 0x26, 0x9b, 0xf2, 0x5d, 0x4c, 0xb4, 0xec, 0x3f, 0xa4, 0x6f, 0x8f, 0x11, 0xe6, 0xb3, 0x69, 0xfb, 0xda, 0xec, 0x1e, 0x51, 0x97, 0x83, 0x58, 0xd4, 0x6f, 0x3c, 0xf3, 0xb8, 0x42, 0x91, 0x7d, 0x96, 0x7a, 0xa9, 0xd3, 0x0b, 0x18, 0x34, 0x53, 0x93, 0x7a, 0x68, 0x26, 0x56, 0xb2, 0x7b } +, + /* Seed */ + 74, + { 0x17, 0x77, 0x42, 0x19, 0x7f, 0x04, 0x11, 0x44, 0x3b, 0xd8, 0x7e, 0x28, 0xea, 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x4a, 0xe2, 0x25, 0x38, 0xa7, 0xb0, 0x08, 0x7f, 0x25 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.14", + /* Message */ + 20, + { 0xa5, 0xe9, 0xde, 0xb1, 0xc2, 0x0f, 0x98, 0x2d, 0x5b, 0x7d, 0x4b, 0x87, 0xd7, 0x99, 0x46, 0x1f, 0x05, 0x3d, 0x91, 0x9e } +, + /* Seed */ + 105, + { 0x59, 0x75, 0x9c, 0xf5, 0xf8, 0x38, 0xd9, 0x52, 0x49, 0x3d, 0x0f, 0x42, 0x81, 0xe3, 0xea, 0x0f, 0xe2, 0x16, 0x97, 0x1c, 0x0a, 0x2e, 0x24, 0x54, 0xb9, 0x6c, 0x8a, 0x11, 0xb4, 0xc6, 0x91, 0x27, 0x15, 0x90, 0x24, 0xdb, 0x6e, 0xc5, 0xc3, 0x36, 0x40, 0xd1, 0x20, 0x29, 0x58, 0x99, 0xf6, 0x66, 0x6c, 0x94, 0x17, 0xb2, 0x02, 0xa8, 0x6c, 0x26, 0xef, 0xd7, 0xc6, 0x13, 0x4c, 0x92, 0xfd, 0x86, 0xb8, 0x32, 0x3d, 0x17, 0x4a, 0x62, 0x53, 0x48, 0x81, 0x38, 0x2d, 0x7c, 0x6c, 0x9e, 0x1b, 0x8c, 0x1e, 0x95, 0xda, 0xf2, 0x10, 0xc3, 0xe9, 0xba, 0x43, 0xe5, 0x88, 0x79, 0xf3, 0x4f, 0x2f, 0xa7, 0x1e, 0xf6, 0xae, 0x4b, 0x68, 0xd6, 0x41, 0x47, 0xbe } +, + /* Encryption */ + 128, + { 0x70, 0xac, 0x10, 0x2d, 0x07, 0x1e, 0x3d, 0x90, 0x22, 0x81, 0x83, 0x62, 0x16, 0xe0, 0x81, 0x29, 0x0b, 0xb5, 0xdf, 0xcd, 0x56, 0x68, 0xd1, 0x1d, 0xae, 0xfa, 0x0a, 0xb0, 0x64, 0x59, 0x9d, 0x0f, 0x91, 0x4b, 0x47, 0x29, 0x61, 0x37, 0x5b, 0xbf, 0x5f, 0x2a, 0x66, 0x6f, 0xae, 0x0f, 0x6a, 0x25, 0xba, 0xfd, 0x44, 0xf6, 0x65, 0xc1, 0x7c, 0x14, 0x4d, 0xc4, 0xd4, 0xcc, 0x0a, 0x5d, 0x5b, 0xa5, 0x5c, 0x47, 0xa4, 0xcd, 0xe9, 0x59, 0xb3, 0x2b, 0xaa, 0x52, 0x32, 0xa0, 0x7f, 0xbf, 0x93, 0x78, 0xc9, 0xc5, 0x3c, 0xa2, 0xb3, 0x77, 0x81, 0xc9, 0x3a, 0x1c, 0xc8, 0xd6, 0x52, 0x94, 0x78, 0xa1, 0xc6, 0x73, 0x03, 0x4d, 0xda, 0x7f, 0xf3, 0x35, 0x60, 0x78, 0x6a, 0x46, 0x4f, 0x5b, 0x4a, 0x55, 0x9c, 0x62, 0x6a, 0xe2, 0x95, 0xbc, 0x91, 0xd0, 0xee, 0xd9, 0x37, 0x5f, 0x49, 0xe3, 0xe4, 0xaa } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.15", + /* Message */ + 63, + { 0x73, 0x9f, 0xa7, 0x6d, 0xbd, 0x12, 0x73, 0x03, 0xb7, 0xab, 0xf9, 0x3e, 0x1d, 0x7b, 0xa7, 0x29, 0x75, 0x5d, 0x6c, 0x81, 0x1b, 0x5e, 0x93, 0x35, 0x5e, 0x0c, 0x01, 0x1f, 0x74, 0x46, 0x4c, 0x7d, 0xb4, 0x79, 0x19, 0x3c, 0x3f, 0xb7, 0x38, 0x0a, 0x62, 0xa0, 0xc0, 0x06, 0xa2, 0xd1, 0xdc, 0x49, 0xa7, 0x66, 0xaf, 0x63, 0xfb, 0xa4, 0x52, 0x7c, 0xd1, 0x57, 0x50, 0x6d, 0x62, 0xc2, 0x1a } +, + /* Seed */ + 62, + { 0xa0, 0xb4, 0xda, 0xff, 0x3e, 0x26, 0xce, 0xbb, 0x3e, 0x4e, 0x3a, 0x43, 0xdb, 0x36, 0xc4, 0x66, 0xfb, 0x8c, 0xe6, 0x05, 0xb2, 0x5a, 0xf4, 0xc9, 0xda, 0x74, 0x4b, 0x62, 0xd4, 0x1f, 0x9e, 0x62, 0xc2, 0x28, 0x5c, 0x39, 0x0d, 0x60, 0xd1, 0x8e, 0x3d, 0x7e, 0x67, 0x5b, 0x4a, 0xc3, 0x19, 0x67, 0x24, 0x45, 0x19, 0x46, 0xbc, 0x1c, 0xcf, 0x2a, 0x9b, 0x56, 0x2c, 0x45, 0x33, 0xc9 } +, + /* Encryption */ + 128, + { 0x2b, 0x79, 0x80, 0x91, 0xb3, 0xa3, 0x91, 0x53, 0x3d, 0x62, 0xdc, 0x0e, 0x41, 0x7b, 0xa6, 0xde, 0xda, 0x00, 0x5b, 0xfc, 0x30, 0xab, 0x7d, 0xc8, 0x2e, 0x8f, 0x9b, 0xcc, 0x74, 0x17, 0xbc, 0xb0, 0x04, 0x34, 0x8c, 0x6d, 0x00, 0xe5, 0x37, 0xd2, 0x72, 0x2b, 0x84, 0x38, 0x61, 0x48, 0x92, 0x45, 0xab, 0x0d, 0x51, 0xf2, 0x11, 0x44, 0x7d, 0xac, 0x33, 0xa3, 0xf9, 0xdd, 0x6f, 0x3c, 0xa6, 0x6b, 0xbf, 0xa0, 0xd1, 0xad, 0xf9, 0x8b, 0xc9, 0x09, 0x95, 0x15, 0x92, 0x69, 0x76, 0xb9, 0x25, 0x8a, 0xab, 0x63, 0x20, 0x4a, 0xd8, 0x91, 0x65, 0xc8, 0x7b, 0xbe, 0xfd, 0x8d, 0x98, 0x85, 0x34, 0xb3, 0x74, 0x07, 0xdf, 0x7d, 0x43, 0xad, 0x39, 0x1e, 0xed, 0x99, 0x82, 0x47, 0x28, 0xef, 0xc3, 0xa5, 0x33, 0xb7, 0x89, 0xb4, 0x7e, 0x8a, 0xa7, 0x12, 0x16, 0x17, 0x47, 0x4f, 0x33, 0x25, 0xc5, 0x1a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.16", + /* Message */ + 21, + { 0x5a, 0x44, 0xb5, 0x47, 0xbd, 0xa1, 0x9e, 0xcc, 0xa1, 0xdc, 0x7b, 0xc0, 0x45, 0x50, 0x20, 0x5f, 0x66, 0xc5, 0xde, 0x0a, 0xcb } +, + /* Seed */ + 104, + { 0x2f, 0x54, 0x85, 0xd2, 0x5f, 0xe5, 0xce, 0x40, 0xae, 0x62, 0xa1, 0x12, 0x97, 0x6c, 0xb4, 0xa5, 0x39, 0xb7, 0x4d, 0x96, 0xef, 0x8b, 0xe8, 0x73, 0x32, 0x5e, 0x20, 0x4b, 0xb3, 0xf8, 0x66, 0x07, 0xa1, 0x6a, 0x2c, 0x2a, 0xb5, 0x0f, 0x69, 0x78, 0x09, 0xed, 0x03, 0x01, 0x72, 0x70, 0xef, 0x20, 0xa1, 0x02, 0xc4, 0x3a, 0x2c, 0x4c, 0x3b, 0xe6, 0xab, 0x7a, 0x8a, 0xe2, 0xdc, 0xb5, 0x69, 0x84, 0xd5, 0xe0, 0x65, 0x52, 0x45, 0x93, 0xeb, 0x70, 0x70, 0x83, 0x4c, 0xe5, 0x53, 0xf1, 0x75, 0x69, 0x20, 0xbb, 0xcb, 0xbe, 0x4f, 0xb2, 0x6d, 0x35, 0xd4, 0xad, 0xcb, 0x59, 0xdf, 0x52, 0x46, 0x35, 0x6f, 0xf1, 0x2e, 0x7a, 0xa9, 0xee, 0x6d, 0xef } +, + /* Encryption */ + 128, + { 0x62, 0xd1, 0x48, 0x9a, 0x40, 0x3a, 0x90, 0xfa, 0xac, 0x67, 0x7a, 0xbc, 0x17, 0x4a, 0xa7, 0x24, 0x3b, 0xc7, 0x51, 0xa9, 0x64, 0x69, 0x5f, 0x6c, 0x32, 0xb3, 0x9d, 0xe0, 0x18, 0xfe, 0x46, 0x43, 0x44, 0x20, 0xea, 0x76, 0x59, 0xbe, 0x2c, 0x41, 0x0b, 0xc5, 0x6c, 0x4e, 0x3e, 0x7a, 0x1b, 0x16, 0x77, 0xfd, 0xf4, 0xad, 0xfb, 0x23, 0x24, 0xf0, 0x41, 0xed, 0xd5, 0x79, 0x0c, 0x4c, 0xdf, 0xab, 0x36, 0x55, 0xe0, 0x7e, 0x41, 0xfe, 0x9d, 0x73, 0x29, 0x21, 0x51, 0xb0, 0xdd, 0x5b, 0x96, 0xfc, 0x84, 0xa6, 0xb2, 0x0f, 0x6f, 0x3b, 0xc0, 0xf6, 0x0e, 0xae, 0xa8, 0xd8, 0x29, 0x17, 0xb2, 0x10, 0x83, 0x05, 0x59, 0x40, 0xfc, 0x02, 0xee, 0x3e, 0x17, 0xc3, 0x78, 0xbd, 0x4d, 0x85, 0x06, 0xd0, 0x8e, 0xc4, 0x5f, 0x33, 0xde, 0x57, 0x80, 0xf0, 0x1b, 0xd3, 0x18, 0xa9, 0xa1, 0x67, 0x87, 0xad } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.17", + /* Message */ + 5, + { 0x16, 0x80, 0x2d, 0x80, 0x3c } +, + /* Seed */ + 120, + { 0x02, 0xf0, 0xe7, 0x62, 0xc3, 0x39, 0x17, 0xbf, 0x6a, 0x4d, 0xf1, 0x1f, 0xa2, 0x84, 0x73, 0x54, 0x7a, 0x5a, 0xb0, 0x76, 0x7d, 0xd3, 0xa6, 0x1a, 0x8d, 0x05, 0xcc, 0x1e, 0x6f, 0x98, 0x34, 0x5a, 0xf1, 0xa0, 0x0e, 0x42, 0xf6, 0x2b, 0xd8, 0xec, 0xca, 0xcb, 0xd3, 0x7f, 0x4c, 0xcb, 0x80, 0x9e, 0x9e, 0x05, 0x5f, 0x73, 0xd3, 0x37, 0x5a, 0x60, 0x41, 0xd9, 0x78, 0x2c, 0xcd, 0x85, 0xd5, 0x9d, 0x14, 0xf4, 0x3e, 0x5c, 0x94, 0x10, 0x25, 0x7b, 0x90, 0x6e, 0x41, 0xcc, 0x8b, 0x97, 0x35, 0x47, 0xd0, 0x62, 0x2b, 0xd2, 0x1d, 0xb2, 0x9a, 0x91, 0x38, 0xd3, 0xb1, 0xbe, 0xde, 0x38, 0xce, 0x5c, 0x94, 0xc4, 0xe1, 0xd2, 0xa0, 0xa8, 0x40, 0x0b, 0x45, 0xba, 0xcd, 0x42, 0x69, 0x79, 0x7c, 0x38, 0x5a, 0xa3, 0x06, 0x6e, 0x65, 0x80, 0x72, 0x99 } +, + /* Encryption */ + 128, + { 0x75, 0x3b, 0x9c, 0xee, 0x70, 0xd4, 0x18, 0x1f, 0x95, 0x63, 0x87, 0x80, 0xdb, 0x7a, 0x04, 0xf9, 0xb1, 0x2e, 0xa3, 0x8e, 0x5d, 0xae, 0xe4, 0xf2, 0x89, 0x4c, 0x02, 0x67, 0x3a, 0x53, 0xf4, 0x85, 0x30, 0x74, 0x6f, 0xf2, 0x85, 0x8b, 0x78, 0x7e, 0xfc, 0xb4, 0x2d, 0x45, 0xe5, 0x31, 0xbe, 0xa1, 0xc8, 0xda, 0xe9, 0x48, 0x77, 0x15, 0x3b, 0x95, 0x6a, 0xc7, 0xb2, 0x87, 0x46, 0xee, 0x21, 0xc6, 0x31, 0xbf, 0x9a, 0x3b, 0xa7, 0x9d, 0x2b, 0xa8, 0x13, 0x21, 0xb7, 0x96, 0x03, 0xb1, 0xd0, 0x1a, 0x4e, 0x90, 0x9e, 0xd5, 0xa2, 0x7c, 0xbf, 0x27, 0xc9, 0x57, 0x78, 0x3d, 0x3f, 0x79, 0x50, 0xe0, 0x1d, 0xd8, 0xf4, 0x47, 0xf1, 0x0e, 0xce, 0xd3, 0x6f, 0x2d, 0x19, 0x35, 0x86, 0xf5, 0xcc, 0x17, 0xfb, 0x62, 0x2a, 0x05, 0xfa, 0xa1, 0xfb, 0x5c, 0xd2, 0xaa, 0x06, 0x4c, 0x08, 0x67, 0xb1, 0xca } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.18", + /* Message */ + 48, + { 0xd6, 0xd0, 0xf6, 0x03, 0x85, 0x97, 0x9c, 0xa5, 0x06, 0xfc, 0x83, 0x34, 0x21, 0xbc, 0xd2, 0x2d, 0xa6, 0xa0, 0x6a, 0x8f, 0x37, 0x0a, 0x7f, 0x02, 0xfe, 0xf4, 0x7c, 0x1c, 0xb2, 0x19, 0x9f, 0x26, 0x45, 0xc7, 0x54, 0x90, 0xfb, 0xf7, 0x89, 0xad, 0x52, 0x47, 0x04, 0xda, 0x8a, 0x27, 0x66, 0xc6 } +, + /* Seed */ + 77, + { 0xa0, 0x3c, 0x05, 0x67, 0x2e, 0xfe, 0x23, 0xb4, 0x4b, 0x26, 0xc7, 0x93, 0xe7, 0x05, 0x3a, 0x77, 0x04, 0x8b, 0xa2, 0xdb, 0xb4, 0xb5, 0x3a, 0xe9, 0x75, 0x18, 0x54, 0xe7, 0xad, 0xd7, 0xd6, 0x7c, 0x12, 0xcb, 0xd1, 0x6c, 0x0b, 0x19, 0x34, 0xd2, 0xc2, 0x3e, 0x77, 0xcd, 0xcc, 0x89, 0xce, 0x1d, 0x45, 0xc7, 0x61, 0x15, 0x8a, 0xa8, 0x61, 0x31, 0x71, 0xa7, 0x39, 0x01, 0xac, 0x1f, 0x61, 0xc6, 0x57, 0x05, 0x53, 0x3d, 0x3e, 0x63, 0x9b, 0x57, 0xa2, 0x48, 0x92, 0x91, 0x79 } +, + /* Encryption */ + 128, + { 0x00, 0x78, 0xdc, 0x48, 0xa6, 0x61, 0x58, 0x99, 0x2a, 0xaa, 0x68, 0xfc, 0x3c, 0xcc, 0x62, 0x8f, 0x92, 0xa7, 0x08, 0xd0, 0xb1, 0xd4, 0x38, 0x37, 0x20, 0x8d, 0x53, 0x4b, 0xc3, 0xf9, 0xbe, 0x1c, 0x14, 0x12, 0xed, 0x0f, 0x9f, 0x7b, 0xef, 0x49, 0x43, 0x0d, 0xc9, 0xe9, 0x98, 0xf7, 0x52, 0xe0, 0x74, 0x77, 0x68, 0xb4, 0xae, 0x38, 0x14, 0x46, 0x96, 0xc0, 0x03, 0xd6, 0xd2, 0x5e, 0xa1, 0xa6, 0xca, 0x6a, 0xec, 0x92, 0x4a, 0x9f, 0x4d, 0x9b, 0x57, 0x5a, 0x8f, 0x13, 0x6b, 0xba, 0x29, 0xbf, 0x31, 0xc1, 0x3b, 0x70, 0x50, 0xbd, 0x55, 0xd1, 0x00, 0x0d, 0x43, 0x3d, 0xaa, 0x6c, 0xf1, 0x0b, 0x49, 0x11, 0x6c, 0x80, 0x63, 0x10, 0x7f, 0xd3, 0xa5, 0xbd, 0xf6, 0x15, 0x45, 0xc5, 0xd8, 0x63, 0xf6, 0xa7, 0x88, 0x81, 0x78, 0x6c, 0xc8, 0xdc, 0x37, 0x6d, 0x36, 0xc9, 0x11, 0x36, 0x82, 0x25 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.19", + /* Message */ + 34, + { 0xb0, 0x38, 0x1c, 0xac, 0x04, 0xf3, 0x10, 0x15, 0x04, 0x96, 0x8f, 0x26, 0xd6, 0x55, 0x47, 0x45, 0x38, 0x3b, 0xd1, 0x71, 0xd3, 0x61, 0x56, 0xdd, 0x36, 0x80, 0xb3, 0xdb, 0x6f, 0xad, 0x7f, 0x77, 0x1f, 0x7d } +, + /* Seed */ + 91, + { 0xcc, 0x54, 0x8a, 0x67, 0x77, 0xcd, 0xe9, 0x53, 0xc1, 0x5a, 0x71, 0xfc, 0x49, 0x7c, 0x0c, 0x36, 0x17, 0xb1, 0xbb, 0x05, 0x6b, 0x03, 0x28, 0x8d, 0x9a, 0x54, 0x8b, 0x69, 0x3b, 0xb4, 0x30, 0x8b, 0x67, 0xc1, 0xda, 0xc3, 0x8b, 0xb9, 0xb8, 0xc9, 0xcc, 0x89, 0x6a, 0xc2, 0x44, 0xa9, 0xe3, 0x0d, 0x13, 0x24, 0x30, 0xf4, 0xce, 0xae, 0x57, 0x90, 0x34, 0x3d, 0xbc, 0xe3, 0x8d, 0x05, 0x6f, 0x27, 0xb8, 0x6b, 0xdd, 0x9d, 0x32, 0xa8, 0x17, 0x1f, 0x3b, 0x3c, 0xc2, 0xfd, 0x14, 0x22, 0x65, 0xac, 0x9a, 0x68, 0xdc, 0x35, 0x36, 0x27, 0x33, 0x9c, 0xd8, 0x83, 0x03 } +, + /* Encryption */ + 128, + { 0x45, 0x6f, 0x7c, 0x3e, 0x3b, 0xe8, 0x5f, 0xf7, 0xbd, 0xd6, 0xb5, 0xb2, 0x50, 0xbf, 0xb8, 0x1c, 0xd6, 0xfb, 0xb1, 0x86, 0xd2, 0x5e, 0x0c, 0x1c, 0x52, 0x59, 0xd6, 0x78, 0x87, 0x93, 0xc5, 0x41, 0xed, 0xac, 0xb4, 0xec, 0xde, 0xdb, 0x8a, 0x89, 0x29, 0x01, 0x34, 0xa6, 0x06, 0xf4, 0x6a, 0x81, 0x99, 0x1c, 0x13, 0xb1, 0x20, 0xe3, 0x30, 0x56, 0xbc, 0x0f, 0xc7, 0xe9, 0x7b, 0x34, 0x2d, 0x0f, 0x20, 0x05, 0x18, 0x13, 0xdd, 0xe4, 0x5e, 0x0b, 0x59, 0x6a, 0x7d, 0xcd, 0x69, 0x04, 0x90, 0x3b, 0x8f, 0xc0, 0x76, 0xa6, 0xe2, 0x4b, 0x3a, 0xd8, 0x01, 0x34, 0x16, 0xd9, 0xfd, 0x18, 0x48, 0x30, 0x55, 0x4a, 0xd5, 0x4d, 0x55, 0x48, 0xbc, 0xad, 0xda, 0xf5, 0x92, 0x0a, 0x02, 0x49, 0x55, 0x88, 0x78, 0x25, 0xdd, 0x37, 0x1a, 0xe4, 0xef, 0x90, 0x06, 0x9a, 0x4f, 0x31, 0x1c, 0x5a, 0x17, 0x29 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 5.20", + /* Message */ + 1, + { 0xe5 } +, + /* Seed */ + 124, + { 0xfe, 0x0b, 0xc7, 0xac, 0xb5, 0x6c, 0xe1, 0x4b, 0x4e, 0x2f, 0x55, 0xfb, 0xa0, 0xe2, 0xb1, 0x71, 0x54, 0x90, 0x7b, 0xe9, 0x4c, 0xe4, 0x85, 0xc6, 0x98, 0x4d, 0x61, 0xf6, 0x7c, 0x04, 0xa7, 0x40, 0xa2, 0x8d, 0x60,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x21, 0xdd, 0x9e, 0xb3, 0x33, 0xef, 0x80, 0xaf, 0xe3, 0xaf, 0x9f, 0x72, 0x9c, 0xa1, 0x8f, 0x42, 0xc8, 0x8a, 0x71, 0x73, 0x85, 0x8c, 0x54, 0x20, 0x66, 0xf8, 0xa2, 0x52, 0xcc, 0xf0, 0xfe, 0xaf, 0xe6, 0xb5, 0xa9, 0x24 } + +} +, +} +}, +{ + "Example 6: A 1024-bit RSA key pair", +{ + /* Modulus */ + 128, + { 0xdd, 0xca, 0xd6, 0xa3, 0x8b, 0x37, 0x04, 0xcb, 0xe0, 0x6b, 0xb1, 0xb5, 0x1d, 0x11, 0x62, 0x58, 0x49, 0x78, 0xa4, 0x29, 0x1f, 0xb6, 0x73, 0xb4, 0xea, 0x30, 0xed, 0x8b, 0x51, 0xa4, 0xbf, 0x26, 0x1d, 0xc9, 0xf0, 0xf4, 0x69, 0xce, 0x99, 0x88, 0xa0, 0x89, 0xf0, 0x84, 0x36, 0x64, 0x64, 0xa1, 0x80, 0xcf, 0xd7, 0x17, 0x10, 0x69, 0xa6, 0xf6, 0x36, 0xd7, 0x5f, 0x23, 0x40, 0x1b, 0x30, 0xcf, 0x43, 0xad, 0xcf, 0x87, 0x0e, 0xcd, 0x24, 0x58, 0x2f, 0x4d, 0xa2, 0x95, 0x22, 0x91, 0x51, 0xdd, 0xcf, 0xc7, 0xc9, 0x91, 0x86, 0xb2, 0x45, 0x88, 0x5c, 0xb6, 0x31, 0x96, 0xc4, 0xa5, 0x72, 0x6f, 0x20, 0x7e, 0xe3, 0x60, 0xaf, 0x3a, 0xd8, 0xc4, 0x83, 0x85, 0xa4, 0xe0, 0x84, 0x1d, 0x7d, 0x85, 0x1d, 0x54, 0x54, 0x5d, 0xe7, 0x67, 0xd8, 0xf9, 0x99, 0xdc, 0x17, 0xeb, 0x0c, 0x57, 0x11, 0x89 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x5e, 0x48, 0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, 0x57, 0xbf, 0x7e, 0x3b, 0x5e, 0x4a, 0x80, 0x23 } +, + /* Prime 2 */ + 64, + { 0xe3, 0xc5, 0xf8, 0xcb, 0xfd, 0x51, 0xc6, 0xc2, 0x66, 0xb1, 0xa3, 0x2f, 0xb2, 0xf6, 0xfa, 0x48, 0x9b, 0x97, 0x54, 0xb2, 0x27, 0xc7, 0x7f, 0x53, 0x59, 0xc5, 0x5d, 0xfa, 0x03, 0x80, 0xfe, 0x9a, 0x02, 0xb4, 0xd3, 0x95, 0x05, 0xf3, 0xab, 0x36, 0x95, 0x7c, 0xeb, 0xfa, 0xd5, 0x34, 0xd7, 0xf9, 0xa2, 0x67, 0xeb, 0xee, 0x19, 0xaf, 0xe5, 0xc6, 0x24, 0x04, 0x3e, 0x30, 0x19, 0xd0, 0xac, 0x63 } +, + /* Prime exponent 1 */ + 64, + { 0x2c, 0xf4, 0x79, 0x97, 0xdf, 0x1c, 0x62, 0x97, 0x1b, 0x33, 0x76, 0x1c, 0x19, 0xee, 0xd0, 0x3c, 0x96, 0xa7, 0x15, 0xc0, 0x3f, 0x7c, 0x59, 0x57, 0x0e, 0x73, 0x82, 0x94, 0xb6, 0xaf, 0x2c, 0xc0, 0xbb, 0x80, 0x6a, 0xa1, 0xd3, 0x26, 0x55, 0x78, 0xbd, 0x89, 0x65, 0xf2, 0x0a, 0xf4, 0xed, 0x32, 0x1a, 0xc6, 0xc7, 0xdb, 0x61, 0x82, 0x10, 0xd1, 0xde, 0xc1, 0x47, 0x17, 0x97, 0xd2, 0xa1, 0xb7 } +, + /* Prime exponent 2 */ + 64, + { 0xa6, 0xc0, 0x29, 0xbb, 0xd5, 0x91, 0xc7, 0xcc, 0x4c, 0x78, 0x61, 0xfa, 0xaa, 0xaf, 0x8b, 0x5e, 0x1a, 0xa2, 0x78, 0x7c, 0x11, 0x09, 0x49, 0x5a, 0xd1, 0x0e, 0xe0, 0x15, 0x07, 0xf9, 0xa8, 0xeb, 0x41, 0x6d, 0xf6, 0xb4, 0x53, 0xee, 0x26, 0xfb, 0x48, 0x07, 0x73, 0x8f, 0x68, 0x05, 0x4e, 0xd4, 0x50, 0x24, 0x7a, 0xa2, 0x0e, 0xa6, 0x2a, 0xb6, 0x9b, 0x69, 0x8b, 0xc9, 0x95, 0x2c, 0xa2, 0xf7 } +, + /* Coefficient */ + 64, + { 0xaa, 0xd0, 0x60, 0xde, 0x5e, 0xdb, 0x35, 0x81, 0x8b, 0xd6, 0x3e, 0x85, 0xd4, 0x2e, 0xee, 0x55, 0xe4, 0xcf, 0x8f, 0xa4, 0x2d, 0x4e, 0xa5, 0x92, 0x83, 0xce, 0xf9, 0x6a, 0xca, 0xad, 0x55, 0x5d, 0x47, 0x8d, 0x2f, 0xd7, 0xc3, 0x8f, 0xa9, 0x31, 0xfa, 0x1a, 0xeb, 0x6d, 0xe5, 0x66, 0x55, 0x3d, 0x08, 0xf1, 0xcb, 0xc0, 0x6a, 0x51, 0x0f, 0xc2, 0xe5, 0x69, 0xb5, 0xa8, 0x22, 0x67, 0xac, 0x91 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 6.1", + /* Message */ + 19, + { 0xa3, 0xe1, 0x52, 0x75, 0xfb, 0x33, 0xae, 0xc3, 0x7b, 0xd3, 0xdd, 0x58, 0x2e, 0x19, 0xf5, 0xd3, 0x8b, 0x9d, 0x0d } +, + /* Seed */ + 106, + { 0x78, 0xda, 0xa6, 0x1c, 0x07, 0xf9, 0x41, 0xb4, 0xb4, 0x40, 0xe7, 0x38, 0x33, 0x8d, 0x06, 0xcc, 0x15, 0x7a, 0x01, 0x57, 0x4a, 0x72, 0xfa, 0x78, 0xd3, 0x63, 0xdc, 0xe9, 0x94, 0x09, 0x04, 0x22, 0x0a, 0x71, 0x32, 0x35, 0x69, 0x96, 0xf0, 0x7c, 0x01, 0xd5, 0x4e, 0xe5, 0x4f, 0xa3, 0x2c, 0x5f, 0xaa, 0x1b, 0x90, 0xd2, 0x43, 0x0c, 0x80, 0xa2, 0x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CS#1 v1.5 Encryption Example 6.2", + /* Message */ + 50, + { 0x44, 0x3a, 0xb0, 0x3c, 0x46, 0x04, 0xdb, 0xd8, 0xbf, 0x80, 0x06, 0xae, 0xcc, 0x2a, 0xa8, 0xde, 0x64, 0xa1, 0x55, 0xb4, 0xf9, 0x0c, 0xdb, 0x08, 0x59, 0x98, 0x6d, 0x5c, 0xa3, 0x60, 0x66, 0x03, 0x59, 0x80, 0x8c, 0x59, 0xbd, 0x9c, 0x2d, 0xe7, 0x75, 0xfc, 0x18, 0x52, 0x02, 0x24, 0xb6, 0x69, 0xc3, 0x25 } +, + /* Seed */ + 75, + { 0x3a, 0x6a, 0x60, 0x89, 0xf7, 0x27, 0xdd, 0x16, 0x92, 0x97, 0xa5, 0x79, 0xfc, 0xaf, 0x8e, 0xa7, 0xf8, 0xe1, 0x2d, 0x54, 0x27, 0xf1, 0xf7, 0x90, 0x1a, 0x90, 0x22, 0xa2, 0x1e, 0x2d, 0x82, 0xd2, 0xf0, 0x8e, 0x63, 0xba, 0xca, 0x26, 0x7b, 0x65, 0x3a, 0xaf, 0x89, 0xde, 0x23, 0x2b, 0xa3, 0xd3, 0x92, 0xd1, 0xcb, 0x49, 0xdd, 0x76, 0xb3, 0x88, 0xb2, 0xda, 0xdf, 0xb0, 0x09, 0x4f, 0xda, 0x97, 0x18, 0xf1, 0x78, 0x37, 0x38, 0xd1, 0x8f, 0xa7, 0xaa, 0xa6, 0x29 } +, + /* Encryption */ + 128, + { 0x5a, 0x0a, 0xe0, 0xde, 0x28, 0xfd, 0x33, 0xcc, 0x98, 0x01, 0xbf, 0x4d, 0xd3, 0x06, 0x71, 0x23, 0x74, 0x53, 0x63, 0xca, 0xce, 0x4d, 0xd8, 0xb7, 0xb8, 0xb8, 0x11, 0xd6, 0x48, 0x2f, 0x59, 0x12, 0x0c, 0x0d, 0x65, 0x3e, 0xee, 0x86, 0xa6, 0x1a, 0x01, 0x2a, 0x18, 0x0e, 0xc5, 0xd1, 0x7e, 0x99, 0x14, 0x6d, 0x0c, 0xca, 0x0a, 0x58, 0x7c, 0x85, 0xcf, 0x01, 0xdc, 0x7a, 0xdd, 0x84, 0x23, 0x0d, 0x91, 0x80, 0xbd, 0xdf, 0x5a, 0x77, 0x19, 0xf6, 0x9d, 0x1f, 0xc4, 0x81, 0xaf, 0x6f, 0x47, 0xdb, 0x8c, 0xbd, 0x4e, 0xe1, 0x87, 0x1a, 0x57, 0x3f, 0xc8, 0x76, 0x7c, 0xe8, 0xbe, 0xed, 0xb5, 0xc7, 0x3f, 0xa9, 0x3f, 0x0c, 0x53, 0x80, 0x4a, 0xfe, 0x2e, 0x76, 0xcc, 0xeb, 0xb8, 0x7c, 0xba, 0x00, 0xcd, 0xac, 0x94, 0xde, 0x40, 0xe2, 0xb0, 0xbe, 0xaa, 0x8e, 0x2e, 0x41, 0x58, 0xc7, 0x78, 0x50 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.3", + /* Message */ + 57, + { 0xd1, 0xba, 0x30, 0xe8, 0x8c, 0xdd, 0xa3, 0x3d, 0x2b, 0x41, 0x89, 0x6f, 0x43, 0xdf, 0x08, 0x1e, 0xef, 0x20, 0xca, 0xf7, 0x8d, 0x7c, 0x1b, 0x97, 0x0c, 0x6a, 0x61, 0x72, 0xe8, 0x38, 0x39, 0xdc, 0x43, 0xd4, 0xbe, 0x29, 0xf9, 0xa7, 0x72, 0xba, 0x41, 0x59, 0x73, 0x8b, 0xc6, 0x13, 0x29, 0x68, 0x61, 0x8d, 0xc7, 0x19, 0x7c, 0x0e, 0xdc, 0x57, 0xa1 } +, + /* Seed */ + 68, + { 0x9b, 0xb6, 0x2b, 0xf9, 0xa7, 0x51, 0xfe, 0x41, 0x81, 0x66, 0x43, 0x68, 0x98, 0xed, 0xe8, 0x35, 0xcf, 0xae, 0xe2, 0xf5, 0x0e, 0xfc, 0xad, 0x60, 0x94, 0x2f, 0x2f, 0xb2, 0xda, 0x1a, 0x20, 0x38, 0x03, 0xf0, 0xbe, 0x80, 0xbe, 0xb1, 0x7f, 0xfa, 0xd0, 0xda, 0xb2, 0x18, 0xb1, 0x28, 0x02, 0x7f, 0x34, 0x97, 0xa4, 0xf8, 0xd4, 0x1a, 0xb9, 0xa1, 0xbe, 0x26, 0x4e, 0x96, 0xb4, 0x45, 0x48, 0x76, 0x7b, 0xe8, 0xd4, 0xa7 } +, + /* Encryption */ + 128, + { 0x81, 0x19, 0x1c, 0x54, 0x75, 0x27, 0x3d, 0xe6, 0x6a, 0x41, 0xbf, 0x56, 0x04, 0xf3, 0x2b, 0x58, 0xb7, 0x59, 0xa1, 0x4e, 0x74, 0x26, 0xc7, 0x46, 0xde, 0x4b, 0x53, 0xba, 0xf7, 0x80, 0xbb, 0xa4, 0x2b, 0x42, 0xe9, 0x27, 0x8a, 0xa9, 0x45, 0x27, 0xf0, 0xee, 0xbf, 0x85, 0x5f, 0x46, 0x2d, 0x6f, 0xbb, 0x29, 0x78, 0xa4, 0x65, 0x30, 0x37, 0xd8, 0xb4, 0x48, 0xe1, 0xb8, 0x07, 0xa1, 0x83, 0x1d, 0xbc, 0x53, 0x22, 0xd0, 0x66, 0x98, 0x4e, 0xec, 0x28, 0x11, 0x4f, 0xb7, 0x20, 0x1c, 0x79, 0x6b, 0x57, 0x3a, 0xdc, 0xc5, 0xcc, 0x92, 0x7f, 0x3a, 0x58, 0x97, 0xb2, 0x00, 0x55, 0x64, 0xef, 0x1a, 0x2c, 0x01, 0x67, 0xf5, 0x43, 0x65, 0x51, 0x18, 0x34, 0xac, 0x6f, 0x49, 0x58, 0xb8, 0x31, 0x8d, 0x09, 0xe6, 0x78, 0x54, 0xd6, 0x31, 0xca, 0x52, 0x80, 0x76, 0x86, 0xab, 0x70, 0x5d, 0x71, 0xa3 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.4", + /* Message */ + 47, + { 0xa5, 0x4b, 0xc2, 0x27, 0x8b, 0x56, 0x76, 0x85, 0xc9, 0xb5, 0x68, 0x54, 0xe4, 0xc1,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x2d, 0x95, 0xb4, 0xb1, 0x3d, 0xa1, 0x73, 0x2b, 0xd8, 0xb8, 0xbe, 0x11, 0x97, 0x02, 0x79, 0x19, 0x53, 0x0c, 0x34, 0x7f, 0x3d, 0xd1, 0x03, 0x9e, 0x34, 0x8a, 0x53, 0xb1, 0x16, 0xf9, 0xf8, 0xfe, 0x89, 0x36, 0xa8, 0x4a, 0xcc, 0x39, 0xf2, 0xe0, 0x69, 0x56, 0xb6, 0x78, 0xd2, 0x0f, 0xdf, 0x95, 0x17, 0x07, 0x2e, 0x02, 0xf5, 0x70, 0x78, 0xfd, 0xc0, 0x46, 0x59, 0x40, 0x0c, 0x5c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.5", + /* Message */ + 58, + { 0xf3, 0xc0, 0x0b, 0x00, 0x9e, 0x5e, 0x08, 0xa6, 0x3b, 0xe1, 0xe4, 0x00, 0x35, 0xcd, 0xac, 0xa5, 0x01, 0x1c, 0xc7, 0x01, 0xcf, 0x7e, 0xeb, 0xcb, 0x99, 0xf0, 0xff, 0xe1, 0x7c, 0xfd, 0x0a, 0x4b, 0xf7, 0xbe, 0xfd, 0x2d, 0xd5, 0x36, 0xac, 0x94, 0x6d, 0xb7, 0x97, 0xfd, 0xbc, 0x67, 0x9c, 0xbe, 0x68, 0xf1, 0xa2, 0xf3, 0x62, 0x59, 0xc5, 0x58, 0xf0, 0x4d } +, + /* Seed */ + 67, + { 0xe2, 0x2d, 0x5e, 0x43, 0xb1, 0xeb, 0xa1, 0xac, 0x0c, 0xe6, 0x5c, 0x32, 0x70, 0x51, 0x0e, 0x0f, 0x13, 0xc9, 0x4e, 0x96, 0x24, 0xee, 0x52, 0x56, 0x59, 0xef, 0x4d, 0x57, 0x37, 0x88, 0x20, 0xc9, 0x35, 0x22, 0x9b, 0x30, 0x99, 0xaa, 0x2b, 0x23, 0x50, 0x61, 0x4f, 0x8c, 0xc4, 0x29, 0x58, 0x15, 0xa2, 0xc9, 0xed, 0xb2, 0xd9, 0xc5, 0x9c, 0x73, 0xd1, 0xaa, 0x90, 0x0c, 0x21, 0x34, 0xc0, 0xa7, 0xd0, 0x90, 0x9c } +, + /* Encryption */ + 128, + { 0x53, 0x3e, 0x67, 0xa2, 0xbc, 0x5b, 0x3f, 0x01, 0x34, 0x2d, 0x8c, 0xb8, 0xd9, 0x25, 0xd7, 0x3b, 0x4d, 0xb3, 0x4c, 0xb6, 0x75, 0xda, 0x90, 0x39, 0x22, 0x6a, 0x98, 0xe4, 0xd8, 0x13, 0xc6, 0x20, 0x11, 0x09, 0x90, 0xa8, 0xe6, 0xac, 0xba, 0x50, 0xfd, 0x04, 0xf3, 0x30, 0x7d, 0xeb, 0xaf, 0x20, 0xd4, 0xf3, 0x74, 0xcf, 0x6d, 0xe0, 0xd9, 0xb2, 0x1d, 0x86, 0xe2, 0x66, 0x07, 0x9c, 0xf2, 0xf1, 0x8b, 0x45, 0x03, 0x20, 0x8a, 0x21, 0x5d, 0xe2, 0xb1, 0x1c, 0xca, 0x9e, 0x34, 0x64, 0xfc, 0x5a, 0xc1, 0xdd, 0x7e, 0x96, 0xb2, 0xfc, 0x04, 0x09, 0xe4, 0x2f, 0x46, 0xa5, 0x06, 0x12, 0xa6, 0xb2, 0x06, 0x1e, 0xd1, 0x61, 0x9a, 0x7f, 0xe4, 0x67, 0x96, 0xed, 0x8f, 0x52, 0x06, 0x9a, 0x5b, 0xfc, 0x84, 0x08, 0xd5, 0x58, 0xf5, 0x2a, 0x03, 0x33, 0x2e, 0xe8, 0xed, 0xde, 0xf8, 0xf7, 0x45, 0xd9 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.6", + /* Message */ + 53, + { 0xaa, 0xfe, 0x5b, 0x27, 0x11, 0x11, 0xef, 0xb8, 0x79, 0x2f, 0x5a, 0xa9, 0x23, 0x83, 0x07, 0x29, 0x76, 0xb7, 0x2a, 0x0a, 0x27, 0x2f, 0x90, 0xc5, 0x24, 0x61, 0xf8, 0x8a, 0xfb, 0x1b, 0xb6, 0xb7, 0xec, 0x26, 0x38, 0x1c, 0x65, 0x76, 0xa4, 0x10, 0x87, 0xa0, 0x39, 0x80, 0x9d, 0x14, 0xf6, 0x11, 0x60, 0x67, 0x59, 0x4e, 0xbb } +, + /* Seed */ + 72, + { 0x75, 0x0e, 0xf0, 0x86, 0x9f, 0x8c, 0x75, 0x7e, 0xf4, 0x31, 0x57, 0x8b, 0x45, 0xa6, 0xe7, 0x41, 0xbd, 0x1d, 0x96, 0x0e, 0xfc, 0x37, 0x89, 0xb1, 0x0d, 0x2b, 0xde, 0x27, 0x38, 0x18, 0x07, 0x4e, 0xbf, 0xe5, 0xfa, 0xae, 0x10, 0xac, 0x24, 0x4f, 0x89, 0xf6, 0xc0, 0x2d, 0xe5, 0xd1, 0xad, 0xae, 0xfc, 0x7a, 0x8f, 0xd2, 0x4d, 0x7b, 0xc3, 0x76, 0xfd, 0x65, 0xd3, 0x5e, 0x39, 0x50, 0x8c, 0x42, 0x36, 0xac, 0xbe, 0x2d, 0x5c, 0xa7, 0x69, 0x4b } +, + /* Encryption */ + 128, + { 0x34, 0x4d, 0x43, 0x37, 0x61, 0x2b, 0x22, 0xdd, 0x40, 0x2b, 0xe3, 0x79, 0xe6, 0xb2, 0x65, 0x0b, 0x51, 0x9e, 0xf3, 0x7b, 0x7a, 0xb4, 0x85, 0x81, 0x94, 0x52, 0xd1, 0x67, 0xc1, 0xb2, 0x15, 0xdb, 0xd3, 0xfb, 0x24, 0xf9, 0xb2, 0xf9, 0x29, 0x86, 0x69, 0xcb, 0x1a, 0xee, 0x14, 0x1a, 0x7d, 0x89, 0x01, 0x64, 0x20, 0x43, 0x11, 0x1f, 0xc3, 0x8b, 0x3f, 0x40, 0xef, 0x0b, 0x7f, 0xfd, 0x7d, 0xf7, 0x6c, 0x2d, 0x92, 0xe3, 0x29, 0x41, 0x1c, 0x75, 0xe0, 0xf1, 0x72, 0x85, 0xbb, 0x6b, 0xb8, 0x26, 0x88, 0x12, 0x8e, 0xd9, 0xbb, 0x95, 0x1c, 0xae, 0xdd, 0x7d, 0x06, 0x7e, 0xdd, 0x0b, 0x13, 0xe8, 0x27, 0x5a, 0xc8, 0x86, 0x25, 0xd9, 0x7c, 0xe8, 0xd2, 0x0b, 0x69, 0xb3, 0x57, 0x38, 0xb2, 0xf4, 0x72, 0x6e, 0x29, 0x84, 0xb8, 0xdf, 0xa8, 0x66, 0x95, 0xaa, 0xe8, 0x8d, 0x9e, 0x17, 0x6d, 0xf6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.7", + /* Message */ + 37, + { 0xa1, 0x22, 0x4d, 0xf9, 0xaa, 0xb6, 0x58, 0x78, 0x45, 0xb2, 0xa3, 0x93, 0xa5, 0xa8, 0x76, 0xc1, 0x7d, 0x95, 0x9d, 0x53, 0x5b, 0x54, 0x19, 0xd4, 0x12, 0xa9, 0xa5, 0x31, 0xbb, 0x43, 0x7e, 0x1d, 0xac, 0x1b, 0x54, 0x6d, 0x62 } +, + /* Seed */ + 88, + { 0x76, 0x1d, 0xc4, 0xf5, 0x1b, 0xc8, 0x51, 0x8d, 0x62, 0x7c, 0x45, 0xb3, 0xe9, 0x81, 0x8b, 0x85, 0x42, 0xa0, 0x6f, 0xfe, 0x17, 0x2b, 0xe3, 0xaf, 0x5c, 0xe7, 0xa9, 0x05, 0x3f, 0xe5, 0x4e, 0x69, 0x70, 0x12, 0x49, 0x73, 0x37, 0x4d, 0xfc, 0xc1, 0xf4, 0x9f, 0xcf, 0xfe, 0x95, 0x7a, 0xae, 0x8c, 0x9c, 0x3b, 0x13, 0x0f, 0x46, 0x05, 0xd2, 0xc3, 0xef, 0xa2, 0x93, 0x2a, 0xd0, 0x83, 0xde, 0xc5, 0x8e, 0x70, 0xd4, 0xf6, 0x92, 0x6c, 0x80, 0xb5, 0xd4, 0x89, 0x1a, 0x1a, 0x55, 0x9e, 0xdb, 0x0c, 0xaf, 0xfa, 0xca, 0xd7, 0x5e, 0xb2, 0x64, 0x83 } +, + /* Encryption */ + 128, + { 0x78, 0x5f, 0x6a, 0xaa, 0xb4, 0xd2, 0xf3, 0x18, 0xd4, 0xaf, 0x37, 0xb6, 0xe0, 0x07, 0x4e, 0xd5, 0xa4, 0x19, 0x4f, 0xa6, 0x05, 0xa7, 0xec, 0x87, 0xd0, 0x5a, 0x07, 0xf3, 0x34, 0x9b, 0x5b, 0x92, 0xf5, 0xfc, 0x47, 0x90, 0xea, 0xb1, 0x37, 0x86, 0xcb, 0xf0, 0x35, 0xc7, 0x8f, 0xfc, 0xf1, 0x34, 0x4d, 0x1f, 0x3e, 0xcd, 0xaa, 0xe0, 0x16, 0x72, 0x22, 0x2e, 0x6d, 0x4a, 0x96, 0x55, 0x59, 0xe2, 0xc0, 0x82, 0x91, 0xcb, 0x1d, 0x4c, 0x2d, 0x4e, 0x68, 0xff, 0x8e, 0xe7, 0x15, 0x23, 0xf6, 0xdd, 0xae, 0xc5, 0x0a, 0x4a, 0xb2, 0x2e, 0xdc, 0xa2, 0x47, 0x36, 0x4c, 0x92, 0xd8, 0x73, 0x99, 0xe8, 0xa7, 0x1d, 0xf7, 0x43, 0x6b, 0x62, 0xd8, 0xba, 0x8a, 0xd2, 0x02, 0x94, 0xcb, 0xc6, 0x0d, 0xca, 0xe0, 0x30, 0x5c, 0x79, 0x73, 0xf7, 0xfc, 0xb4, 0xa5, 0xcb, 0xed, 0x15, 0x71, 0x3a, 0x7a, 0x16 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.8", + /* Message */ + 48, + { 0x1e, 0x0e, 0x3f, 0x65, 0x0c, 0x32, 0xdb, 0xb2, 0xf6, 0x91, 0x6f, 0x36, 0xf1, 0x35, 0xbc, 0xae, 0x88, 0x1d, 0x54, 0x55, 0x07, 0x40, 0x2d, 0x6a, 0xfd, 0x3d, 0x5b, 0x3b, 0xd8, 0x38, 0x5a, 0x50, 0xb4, 0xfa, 0xd6, 0xf7, 0x89, 0x49, 0xfd, 0xe6, 0x21, 0x64, 0xed, 0x76, 0x89, 0xe5, 0xf9, 0xa4 } +, + /* Seed */ + 77, + { 0xee, 0xa9, 0x0a, 0x54, 0xd0, 0x16, 0xda, 0x7e, 0x8f, 0x08, 0x76, 0xa7, 0x33, 0xb0, 0xf2, 0xa0, 0x6f, 0x90, 0xa7, 0x3c, 0x1a, 0x3c, 0xd6, 0x39, 0xb6, 0xcf, 0xa9, 0x06, 0xce, 0x08, 0xef, 0x78, 0x8b, 0xb6, 0xfe, 0xa7, 0x4f, 0x22, 0xeb, 0x91, 0xa6, 0xab, 0x32, 0x84, 0xcd, 0xfc, 0x1e, 0x72, 0xe6, 0x3e, 0x78, 0xd1, 0x8a, 0x64, 0xd6, 0x7f, 0x9d, 0x1a, 0x29, 0x19, 0x49, 0xed, 0x2e, 0x32, 0x3e, 0x91, 0xdc, 0x03, 0x38, 0x76, 0xee, 0xeb, 0x09, 0xff, 0xa7, 0x1f, 0x59 } +, + /* Encryption */ + 128, + { 0x6b, 0xbd, 0xae, 0x20, 0xf9, 0x89, 0xbf, 0xaa, 0x5d, 0x65, 0xda, 0xdc, 0xd6, 0x1a, 0x86, 0xb6, 0x63, 0x07, 0xa0, 0x60, 0x2f, 0xb5, 0x51, 0xa7, 0x38, 0x06, 0x12, 0x2d, 0xb1, 0x88, 0xec, 0x1d, 0x41, 0xe8, 0x4d, 0xaa, 0x2c, 0xc7, 0xd6, 0xbe, 0x54, 0x1e, 0x12, 0x28, 0x88, 0x09, 0xa1, 0x7e, 0x08, 0x5f, 0x2c, 0xaf, 0xa8, 0xae, 0x13, 0x67, 0x0e, 0x0f, 0x33, 0x65, 0xa1, 0x47, 0x1c, 0xb3, 0x15, 0x7c, 0x06, 0xe0, 0xf6, 0x3b, 0x82, 0x00, 0xf3, 0x16, 0x0c, 0x16, 0x3f, 0xde, 0x7c, 0x90, 0x1e, 0xf3, 0x26, 0xe5, 0x70, 0x0c, 0x9f, 0x5e, 0x07, 0xfe, 0x01, 0x98, 0x81, 0x0f, 0xa8, 0x0c, 0x8c, 0x5d, 0xc5, 0x3a, 0x50, 0xbc, 0xe2, 0x54, 0xf7, 0xd1, 0x99, 0x01, 0xcf, 0x6c, 0xbb, 0x60, 0x34, 0x13, 0xe4, 0x1f, 0x90, 0x30, 0xe7, 0x39, 0xc8, 0xba, 0x96, 0x49, 0x97, 0x84, 0x74, 0x99 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.9", + /* Message */ + 32, + { 0x73, 0xdd, 0xf0, 0xa1, 0x4d, 0x57, 0xba, 0x65, 0xb4, 0xf6, 0x93, 0xac, 0x76, 0x1e, 0x20, 0x2b, 0x1e, 0x5b, 0x85, 0x7c, 0x8b, 0x34, 0x04, 0xe1, 0x41, 0x85, 0xdf, 0xa8, 0xaa, 0xf0, 0x49, 0x89 } +, + /* Seed */ + 93, + { 0xfd, 0x43, 0x3d, 0x7b, 0x01, 0x76, 0xb7, 0x31, 0xd7, 0x80, 0xdd, 0x6c, 0x58, 0x51, 0xb8, 0x2f, 0x17, 0x6d, 0x62, 0xb8, 0x0d, 0x96, 0xae, 0xb6, 0x31, 0xd7, 0xfb, 0x8a, 0xc5, 0xbe, 0x55, 0xac, 0x21, 0x7f, 0x4e, 0x08, 0xbc, 0x7e, 0xcf, 0x81, 0xf8, 0xe3, 0xf5, 0xdd, 0xaa, 0xcd, 0xc6, 0xc2, 0x17, 0x8d, 0xf7, 0x81, 0x88, 0x23, 0x97, 0x53, 0x3a, 0x63, 0x8e, 0x62, 0xf0, 0x74, 0xac, 0x48, 0x8f, 0x4c, 0x12, 0xaa, 0x57, 0xbe, 0x2e, 0xce, 0x5b, 0xb6, 0xe9, 0x09, 0x6c, 0xd9, 0x22, 0x59, 0xa4, 0x5b, 0x0b, 0x03, 0x2f, 0x10, 0x14, 0x31, 0xa2, 0x8b, 0x86, 0x40, 0xfb } +, + /* Encryption */ + 128, + { 0xae, 0x97, 0xff, 0x43, 0x4e, 0x9a, 0x5e, 0xe4, 0x87, 0x76, 0x1d, 0xb3, 0x56, 0x90, 0x0b, 0x06, 0x37, 0x37, 0x46, 0x5b, 0xe5, 0x05, 0x8d, 0xc0, 0x3a, 0x28, 0xa3, 0x22, 0xe5, 0xc0, 0xe0, 0x91, 0xb7, 0x99, 0xbf, 0x65, 0x94, 0x55, 0xcf, 0xbe, 0x05, 0x42, 0x7a, 0xc4, 0xd0, 0x44, 0x05, 0xe5, 0x6e, 0xe0, 0x4e, 0x06, 0x3a, 0x23, 0x73, 0xdb, 0xcb, 0x9b, 0x4f, 0xa1, 0x6e, 0x43, 0x07, 0x94, 0x6a, 0x49, 0xb3, 0x56, 0x34, 0x52, 0x0d, 0x41, 0x6f, 0x65, 0xc3, 0xc3, 0x22, 0xed, 0xc5, 0x46, 0x71, 0x56, 0x91, 0x28, 0xa2, 0xa1, 0x52, 0xa7, 0x6f, 0xe4, 0x44, 0xc4, 0x30, 0xaa, 0x6f, 0x03, 0xc4, 0x12, 0x9c, 0x6e, 0x21, 0x31, 0x75, 0x5d, 0x76, 0x4c, 0xec, 0x4a, 0x14, 0x86, 0xa8, 0x1b, 0xa8, 0xa3, 0x16, 0x8d, 0x16, 0xe7, 0x4d, 0xca, 0x8e, 0x77, 0xbb, 0xfd, 0x67, 0xea, 0x37, 0x2b } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.10", + /* Message */ + 29, + { 0xef, 0x3e, 0x76, 0x98, 0xe7, 0xd9, 0xcc, 0x86, 0x3b, 0x46, 0x6b, 0xb2, 0x88, 0x55, 0x6e, 0x4a, 0xc2, 0x52, 0x82, 0xe0, 0x94, 0xfb, 0x5b, 0x57, 0xc1, 0x76, 0x17, 0xbb, 0x98 } +, + /* Seed */ + 96, + { 0xdb, 0x90, 0xa7, 0x58, 0x0d, 0x8d, 0x42, 0x9e, 0x22, 0xbd, 0x7e, 0xa5, 0xc7, 0xb4, 0xcd, 0x0c, 0x65, 0xad, 0x0e, 0x2e, 0x27, 0xf5, 0x33, 0x41, 0xbc, 0x23, 0xa8, 0xb1, 0x35, 0x8a, 0x76, 0xa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xce, 0x64, 0x7e, 0xed, 0x41, 0x76, 0x85, 0xc6, 0xe1, 0xdb, 0x85, 0x6c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.11", + /* Message */ + 31, + { 0xf8, 0x69, 0x18, 0x47, 0x4f, 0x88, 0x16, 0x97, 0x11, 0x1b, 0xdd, 0xdc, 0x1f, 0x00, 0x61, 0x3e, 0xb2, 0xc3, 0xd9, 0xc1, 0x78, 0x76, 0x68, 0x35, 0x3e, 0xbb, 0x02, 0xb3, 0x20, 0xa3, 0x26 } +, + /* Seed */ + 94, + { 0xcb, 0x7d, 0x99, 0xda, 0x9b, 0x11, 0xea, 0x57, 0xf6, 0x40, 0x55, 0x43, 0x44, 0x7d, 0xd1, 0x5f, 0xb5, 0xcc, 0xa0, 0xa1, 0x0f, 0x3b, 0x69, 0xb4, 0xd2, 0x33, 0x09, 0xef, 0xf2, 0x75, 0x0c, 0x48, 0x6c, 0xa6, 0x55, 0x32, 0x5b, 0x55, 0xa3, 0x27, 0xff, 0xe8, 0xbd, 0x6d, 0xca, 0x99, 0xbc, 0x8e, 0xfb, 0x5b, 0xc2, 0x94, 0x2e, 0xc0, 0x39, 0xe2, 0x84, 0x25, 0xe4, 0xa5, 0x6a, 0x07, 0xd3, 0x80, 0x12, 0xf1, 0x0d, 0x21, 0x5a, 0x22, 0xd6, 0x37, 0x68, 0x59, 0x43, 0xd3, 0x64, 0x72, 0x53, 0x01, 0xdd, 0x40, 0xe2, 0x17, 0x22, 0x8a, 0xb7, 0x91, 0x59, 0x89, 0x98, 0x83, 0x6b, 0xbf } +, + /* Encryption */ + 128, + { 0x2a, 0x40, 0x87, 0x80, 0xad, 0x51, 0x4e, 0x56, 0x71, 0xfe, 0x1d, 0xfc, 0x36, 0x7d, 0x7a, 0xa4, 0x65, 0xfc, 0x34, 0x69, 0xf1, 0xc1, 0x52, 0xae, 0xe1, 0x81, 0x45, 0xe0, 0xf5, 0xf0, 0x75, 0x9f, 0x44, 0x69, 0xb4, 0x3d, 0x55, 0x12, 0x3f, 0x5d, 0xc9, 0xff, 0xc6, 0x17, 0xf2, 0x3f, 0xa4, 0x9b, 0x78, 0x96, 0x02, 0x19, 0x66, 0x0e, 0xc6, 0x22, 0x74, 0xd6, 0xc5, 0x9b, 0xa3, 0x14, 0x60, 0xbd, 0x10, 0x94, 0x1e, 0xbb, 0x5e, 0x05, 0x69, 0x41, 0x51, 0xc5, 0x7b, 0x5b, 0x95, 0x88, 0xca, 0xf0, 0x9f, 0x45, 0x50, 0x20, 0xa5, 0x4e, 0x97, 0x7c, 0x3c, 0xc0, 0x27, 0xda, 0xe3, 0x1f, 0x2c, 0xe4, 0x42, 0x17, 0x02, 0x3e, 0x10, 0xad, 0xb6, 0xf2, 0xd8, 0xaa, 0x0f, 0x80, 0x84, 0xfc, 0x45, 0x86, 0x05, 0x80, 0x3f, 0xd4, 0x4b, 0x21, 0xab, 0xc2, 0x7b, 0xdb, 0x8d, 0x4c, 0x56, 0x17, 0x84, 0xcf } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.12", + /* Message */ + 22, + { 0x6a, 0x40, 0xbb, 0x60, 0x70, 0x8c, 0x5a, 0x99, 0x2e, 0xcf, 0xdc, 0x7e, 0xe5, 0x3f, 0x54, 0x08, 0x4d, 0x19, 0xaf, 0xfd, 0x4d, 0x21 } +, + /* Seed */ + 103, + { 0xc3, 0xf4, 0xfa, 0xca, 0x56, 0xc1, 0xff, 0x07, 0xd1, 0xad, 0x10, 0x37, 0x07, 0xd1, 0xb6, 0x68, 0x20, 0x47, 0xb4, 0xd9, 0xd6, 0x24, 0x6c, 0x2e, 0x5c, 0x4b, 0x0c, 0xe6, 0x55, 0x3d, 0x55, 0x31, 0x3f, 0x8f, 0x38, 0xae, 0xe5, 0xe4, 0xd8, 0x07, 0x3a, 0x55, 0xd2, 0x4a, 0xd7, 0x96, 0xc4, 0xb7, 0x61, 0x26, 0xc8, 0xaa, 0x61, 0xc4, 0x6a, 0x4e, 0xe8, 0x5f, 0xa9, 0x05, 0x7a, 0x52, 0x6c, 0xd0, 0xaa, 0x24, 0x5e, 0x58, 0x28, 0xf2, 0x18, 0x1b, 0x4a, 0x64, 0x79, 0x86, 0x87, 0x48, 0xe7, 0x47, 0x9f, 0x40, 0x34, 0x53, 0x3c, 0x0f, 0x3e, 0x1e, 0xb4, 0x35, 0xfa, 0x47, 0xd5, 0x3b, 0x58, 0xe4, 0x2c, 0x96, 0x17, 0xbf, 0x7e, 0x77, 0x7e } +, + /* Encryption */ + 128, + { 0xc4, 0x64, 0x11, 0xc7, 0x11, 0x6f, 0xe6, 0xf4, 0x6f, 0x1c, 0xa0, 0xf7, 0x4c, 0x60, 0x81, 0xa5, 0x5d, 0xf4, 0x1d, 0x2c, 0x0b, 0x8f, 0xc5, 0xd3, 0x8f, 0xaa, 0x34, 0x0b, 0x5e, 0xcf, 0x71, 0x83, 0xf8, 0x5f, 0x88, 0xc4, 0xfb, 0x28, 0xac, 0x5f, 0xb1, 0xf1, 0x8a, 0xeb, 0xfc, 0xfc, 0x10, 0xbf, 0xdd, 0x3a, 0x19, 0x00, 0x2c, 0x6b, 0x52, 0x24, 0x14, 0x92, 0x70, 0x4b, 0x6f, 0xe6, 0x3d, 0x61, 0xa7, 0x30, 0x10, 0xc1, 0x49, 0xff, 0x63, 0x03, 0x28, 0x3e, 0x99, 0x78, 0xcd, 0x84, 0x54, 0x04, 0xfa, 0x06, 0xb8, 0xc6, 0x98, 0xaa, 0xea, 0x8f, 0x86, 0x13, 0x61, 0xd8, 0x86, 0xb2, 0xc0, 0xf0, 0x1b, 0x47, 0xa1, 0xa9, 0xa3, 0xdd, 0x90, 0x3f, 0x8a, 0x58, 0xae, 0xd6, 0x6a, 0xfc, 0x85, 0xe9, 0xb7, 0x1e, 0xfc, 0x3f, 0x55, 0xa1, 0x21, 0x66, 0x74, 0x16, 0xa3, 0x00, 0x00, 0x13, 0x13, 0xe8 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.13", + /* Message */ + 13, + { 0x32, 0x52, 0xfe, 0x99, 0x62, 0x09, 0x74, 0xe0, 0x77, 0xd6, 0xeb, 0x55, 0x75 } +, + /* Seed */ + 112, + { 0xbf, 0x06, 0x9b, 0x4b, 0xcf, 0x15, 0x44, 0x8b, 0xc3, 0x9e, 0x45, 0xf4, 0x42, 0x6a, 0xad, 0x0d, 0x5d, 0x82, 0xb7, 0x4e, 0x93, 0xae, 0x1c, 0xdd, 0x71, 0xf7, 0x1b, 0xb9, 0xbe, 0xb9, 0xb2, 0x3d, 0x59, 0x73, 0x2f, 0x9c, 0x8b, 0xc6, 0x34, 0x3d, 0x13, 0x02, 0x31, 0xde, 0x18, 0xf7, 0xc8, 0x9f, 0xc2, 0xf4, 0x22, 0x18, 0x9c, 0xd9, 0x27, 0xe5, 0x09, 0xb1, 0x31, 0x97, 0xaa, 0x56, 0xd8, 0x1a, 0x73, 0x76, 0xf8, 0x33, 0x3e, 0x47, 0x42, 0x44, 0x8c, 0xc8, 0x92, 0xde, 0x40, 0x44, 0x97, 0x2c, 0x7f, 0x67, 0xdc, 0xbe, 0x85, 0x44, 0xa9, 0x0e, 0xec, 0x59, 0xe7, 0x95, 0xae, 0x59, 0x64, 0x08, 0x39, 0x2a, 0xf5, 0x77, 0x6d, 0xa0, 0xd6, 0xcb, 0x29, 0xc7, 0xe0, 0xa7, 0x86, 0x81, 0x30, 0xa7 } +, + /* Encryption */ + 128, + { 0x76, 0x53, 0xcb, 0xff, 0x58, 0x68, 0x92, 0xcd, 0xd2, 0x58, 0xbf, 0xe6, 0xba, 0xeb, 0xd9, 0x91, 0x45, 0xeb, 0x1b, 0x22, 0x89, 0x4e, 0x1a, 0x76, 0x4d, 0x02, 0xb2, 0xba, 0x99, 0x59, 0x52, 0xa0, 0x12, 0x58, 0x20, 0x8d, 0xe1, 0xa0, 0x1d, 0x8e, 0x8c, 0xbb, 0x5c, 0xda, 0xf0, 0xd6, 0x03, 0x69, 0x4f, 0x88, 0x25, 0x5e, 0x80, 0x90, 0x97, 0xb7, 0x0e, 0x9d, 0x79, 0xe6, 0x2b, 0xd5, 0xc0, 0xd8, 0x36, 0xdc, 0xc2, 0x9d, 0xd1, 0x9b, 0x05, 0xa1, 0x60, 0x26, 0x90, 0x42, 0x05, 0xb6, 0x0c, 0x45, 0x03, 0xd4, 0xfb, 0xe9, 0x93, 0x38, 0x55, 0xe8, 0x68, 0x02, 0xc7, 0x54, 0x28, 0xd9, 0xa6, 0x34, 0x73, 0x03, 0x16, 0x76, 0x32, 0xd3, 0x3c, 0x5d, 0x9e, 0xcc, 0x8a, 0xe2, 0x49, 0x3b, 0x58, 0xc3, 0x6b, 0x2a, 0x65, 0x53, 0xa7, 0xb9, 0xe2, 0xb1, 0x35, 0x8a, 0xe2, 0x8d, 0xad, 0x50, 0x28, 0x0d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.14", + /* Message */ + 2, + { 0xdc, 0x94 } +, + /* Seed */ + 123, + { 0x05, 0xe8, 0x05, 0xbf, 0xfb, 0xd1, 0xb7, 0x4d, 0x1a, 0x5a, 0x83, 0x8d, 0x85, 0x71, 0x67, 0xb4, 0xc7, 0xd4, 0x0a, 0x6c, 0xd3, 0xe6, 0x8f, 0x31, 0xbe, 0x46, 0x93, 0xb9, 0x8c, 0xec, 0x6d, 0x75, 0x89, 0x49, 0x19, 0xab, 0x18, 0x57, 0x2c, 0x75, 0x82, 0x2e, 0x75, 0xe9, 0xde, 0xd7, 0x2d, 0xa0, 0x67, 0x97, 0x83, 0xa7, 0x72, 0x18, 0x14, 0xe1, 0x99, 0x16, 0x0b, 0x75, 0x07, 0xf6, 0x7f, 0x4e, 0xde, 0x58, 0x7c, 0x88, 0xbe, 0x76, 0x81, 0x5c, 0x50, 0xb2, 0x61, 0xdf, 0x30, 0x8b, 0x31, 0x43, 0x23, 0x73, 0x0c, 0x1e, 0x07, 0x3a, 0xa7, 0x29, 0x98, 0xcc, 0x2f, 0x8e, 0x0a, 0x8a, 0x5b, 0xd6, 0x5b, 0xf9, 0x34, 0xac, 0xa8, 0xa6, 0x48, 0x59, 0xe2, 0x5f, 0x02, 0xc5, 0xa2, 0x71, 0x39, 0x41, 0xc8, 0xc8, 0xe6, 0x27, 0x20, 0x84, 0x6d, 0xfb, 0x51, 0xc2, 0xff } +, + /* Encryption */ + 128, + { 0x6a, 0xdd, 0xe2, 0x44, 0xf0, 0x63, 0x8c, 0x5a, 0xb7, 0x45, 0xff, 0xba, 0xb5, 0xab, 0xe1, 0xfe, 0x80, 0x0b, 0x0e, 0xee, 0x15, 0x35, 0x50, 0xc4, 0x8c, 0x36, 0xf4, 0x24, 0x9f, 0x9d, 0x5d, 0x36, 0xb4, 0x7b, 0x28, 0xcc, 0xda, 0x71, 0xa7, 0xdd, 0x83, 0x2e, 0x64, 0x35, 0xad, 0x0e, 0xb8, 0x5e, 0xf7, 0x55, 0x6b, 0xb8, 0x4b, 0xf9, 0x5a, 0x59, 0xcc, 0xc9, 0xc2, 0x07, 0x51, 0xed, 0x3e, 0x1a, 0xd0, 0xde, 0x10, 0x29, 0x94, 0xa7, 0x12, 0xc5, 0x14, 0x01, 0x46, 0x92, 0xa6, 0x7f, 0x1d, 0x87, 0xca, 0x2e, 0x4f, 0xef, 0x29, 0xec, 0x83, 0xe0, 0x1e, 0x29, 0xad, 0x0c, 0x97, 0x8a, 0xcc, 0xa4, 0xd5, 0xc5, 0x02, 0x74, 0x5a, 0x6c, 0x50, 0x0d, 0xf2, 0x00, 0x04, 0xbc, 0x9b, 0xf1, 0x6f, 0x5f, 0xcc, 0x69, 0xbf, 0x52, 0x70, 0x9e, 0x31, 0xcf, 0x6a, 0x2b, 0x9f, 0xe6, 0x24, 0xd9, 0xa3, 0x64 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.15", + /* Message */ + 8, + { 0x4f, 0xae, 0x6c, 0xf3, 0x7e, 0x9d, 0x5f, 0x59 } +, + /* Seed */ + 117, + { 0xe7, 0xf9, 0xed, 0x4a, 0x0c, 0x3a, 0x64, 0x66, 0x69, 0x03, 0x9b, 0xd0, 0x1f, 0x24, 0x9f, 0x32, 0xbe, 0xa1, 0xe6, 0x57, 0x6c, 0x21, 0xd4, 0x51, 0x89, 0xd0, 0xf8, 0x91, 0xcf, 0x4a, 0xfd, 0x62, 0x32, 0x08, 0x3a, 0x32, 0x1e, 0xd2, 0xd3, 0x4d, 0x07, 0x09, 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0x0f, 0x61, 0x3a, 0x2e, 0xb7, 0x95, 0x47, 0xab, 0x57, 0x8c, 0x58, 0x6d, 0x3b, 0x65, 0x4a, 0x06, 0xfe, 0x1e, 0xf3, 0x7a, 0x22, 0x10, 0x66 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.16", + /* Message */ + 14, + { 0xcd, 0xfd, 0xfd, 0xaa, 0xbc, 0xa3, 0x76, 0x7e, 0x70, 0xbb, 0xc5, 0xe9, 0xab, 0xf6 } +, + /* Seed */ + 111, + { 0xac, 0x77, 0x7f, 0x67, 0x29, 0x9d, 0xe4, 0xc1, 0xc4, 0xc5, 0x74, 0xf3, 0x1f, 0x67, 0x4f, 0x6f, 0xaa, 0xbd, 0xe0, 0x31, 0xf8, 0xec, 0x33, 0xe8, 0x26, 0x76, 0xeb, 0x32, 0xa9, 0x3f, 0x65, 0x79, 0xaa, 0xc3, 0xe9, 0x59, 0x35, 0x9f, 0xc5, 0x73, 0xee, 0x5c, 0x0e, 0x3e, 0x07, 0x76, 0x53, 0xef, 0xf9, 0xd5, 0xf8, 0xdb, 0x4b, 0x1e, 0x7a, 0xca, 0xdb, 0x05, 0x99, 0x71, 0x53, 0x1f, 0x49, 0xb0, 0x7c, 0x93, 0xeb, 0x9f, 0xde, 0xdc, 0xf0, 0x90, 0x3a, 0x7d, 0x50, 0xb4, 0x79, 0x67, 0x6f, 0xcd, 0xe8, 0x74, 0x0a, 0xfb, 0xd7, 0xd3, 0x7c, 0x3a, 0x21, 0x02, 0x41, 0x2b, 0xde, 0x1d, 0x3a, 0x82, 0x44, 0x15, 0x6a, 0xd8, 0x08, 0x9d, 0x45, 0xdf, 0xdc, 0x91, 0xcd, 0xe6, 0xc3, 0xa1, 0x59 } +, + /* Encryption */ + 128, + { 0x51, 0x3c, 0x76, 0x1e, 0xb1, 0x92, 0x9a, 0xff, 0x79, 0x77, 0xa9, 0xff, 0x0e, 0x61, 0xb7, 0xa1, 0xd5, 0x11, 0xc8, 0xcb, 0x25, 0x39, 0x24, 0x33, 0x24, 0x25, 0x56, 0x9a, 0x07, 0xe2, 0x29, 0xcb, 0x39, 0x01, 0x71, 0x53, 0x90, 0xf7, 0xde, 0x37, 0xbd, 0x36, 0x2c, 0x96, 0xfc, 0x0b, 0x0d, 0x79, 0x81, 0x0c, 0x1e, 0x8b, 0x15, 0xe1, 0x3b, 0x00, 0x32, 0x73, 0x47, 0x78, 0xcf, 0x96, 0x4e, 0x6f, 0x6d, 0x17, 0xfc, 0x41, 0xc7, 0x86, 0x76, 0x72, 0xb2, 0x54, 0x0f, 0x56, 0x9d, 0x0a, 0x46, 0x0a, 0x80, 0xfa, 0xd5, 0x6b, 0x5f, 0x05, 0x4a, 0xb8, 0xe4, 0x9e, 0x40, 0x9e, 0x9e, 0x0b, 0x86, 0x13, 0xcb, 0x3d, 0xa2, 0x0c, 0x35, 0xc3, 0xe1, 0xbb, 0x99, 0xb7, 0xec, 0xab, 0x7a, 0x00, 0xfc, 0x1f, 0xc2, 0x37, 0x0f, 0x9c, 0x80, 0x85, 0x67, 0xdf, 0x89, 0xbe, 0x2e, 0xdd, 0xbd, 0xb6, 0xb1, 0x10 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.17", + /* Message */ + 18, + { 0xb8, 0x20, 0xc3, 0x2e, 0x73, 0x7d, 0xaa, 0x23, 0x4f, 0x29, 0xba, 0x90, 0x64, 0x7f, 0xc3, 0xbf, 0x0a, 0x8e } +, + /* Seed */ + 107, + { 0xf5, 0xca, 0xf8, 0xfe, 0xb4, 0x2d, 0xf7, 0xb6, 0xb3, 0x89, 0xf5, 0x05, 0x99, 0xa4, 0xec, 0x20, 0xe6, 0x19, 0xca, 0x22, 0xd2, 0xbf, 0xc9, 0x1b, 0xc7, 0xf1, 0x4a, 0xe9, 0xf1, 0x22, 0x9e, 0x07, 0xc8, 0x88, 0xed, 0x57, 0xaa, 0x6a, 0xd3, 0xc1, 0x04, 0x10, 0x44, 0xc5, 0x1a, 0xfb, 0x55, 0x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x1b, 0x4c, 0x38, 0x3a, 0x69, 0xc7 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.18", + /* Message */ + 43, + { 0x60, 0x6b, 0xbd, 0x61, 0x37, 0x15, 0xdd, 0xcd, 0x92, 0xc7, 0xb6, 0xdf, 0x04, 0xb3, 0x60, 0x72, 0xf0, 0x11, 0x62, 0xd0, 0x08, 0x76, 0x63, 0x12, 0xca, 0x69, 0x77, 0xdd, 0x3a, 0x06, 0xeb, 0x95, 0xe1, 0xba, 0xc7, 0xbc, 0x1b, 0xc6, 0x60, 0x2c, 0x9e, 0xe6, 0x44 } +, + /* Seed */ + 82, + { 0x51, 0x3a, 0x5c, 0x95, 0x68, 0xe8, 0x9b, 0x9a, 0x53, 0xd5, 0xaf, 0x71, 0x6e, 0x55, 0xfb, 0x34, 0x0f, 0x8a, 0x39, 0x23, 0x70, 0xe8, 0x88, 0xa8, 0x0c, 0xae, 0xda, 0x50, 0x2e, 0x7f, 0x9d, 0xfc, 0x17, 0x51, 0x95, 0xa5, 0x0e, 0x47, 0x07, 0x13, 0x96, 0xd6, 0xec, 0x55, 0x4e, 0xb7, 0x2f, 0x18, 0x3b, 0xe1, 0x8f, 0x3b, 0xf4, 0xec, 0x73, 0xb3, 0x05, 0x92, 0xfa, 0xef, 0x2f, 0xb5, 0x14, 0xde, 0xbe, 0xfc, 0xc6, 0x5c, 0x8d, 0x23, 0xc4, 0xad, 0x25, 0x94, 0x56, 0xc1, 0xe8, 0x0b, 0x36, 0x0a, 0xd4, 0x59 } +, + /* Encryption */ + 128, + { 0x47, 0x21, 0xa2, 0x39, 0x40, 0x18, 0x87, 0x30, 0xf5, 0xde, 0xac, 0x85, 0x00, 0x2e, 0x38, 0x31, 0xb1, 0x49, 0xae, 0x57, 0xaf, 0xc6, 0x97, 0x35, 0xa0, 0x45, 0xee, 0x3f, 0xc3, 0x53, 0x64, 0x72, 0xfc, 0x83, 0x3c, 0x27, 0xc8, 0x7e, 0xab, 0x6f, 0xc9, 0x05, 0xe3, 0x67, 0x96, 0x1b, 0x31, 0x24, 0x98, 0x63, 0x6b, 0xe6, 0xc7, 0x7a, 0xa8, 0x0b, 0x8d, 0xa2, 0xf5, 0xd9, 0x48, 0xaa, 0xa7, 0x7b, 0x5f, 0xab, 0x72, 0x4b, 0xbf, 0x64, 0xee, 0x89, 0xd2, 0x81, 0xee, 0xd4, 0x7b, 0x21, 0x2c, 0x32, 0x95, 0x26, 0x65, 0x77, 0xf4, 0xfd, 0x93, 0xa2, 0x22, 0x39, 0xde, 0xe5, 0x40, 0xc9, 0x40, 0x0f, 0xe5, 0x6d, 0x7a, 0xef, 0x51, 0xdf, 0x36, 0xa8, 0x9a, 0xe9, 0x2f, 0x92, 0x6f, 0x55, 0x83, 0x31, 0xe4, 0x1b, 0xfd, 0xfe, 0xfe, 0x35, 0x75, 0x8b, 0x93, 0xce, 0x11, 0x40, 0xac, 0x9b, 0x6a, 0x54 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.19", + /* Message */ + 36, + { 0x1d, 0x82, 0xde, 0xf8, 0xc5, 0x92, 0x87, 0x50, 0x08, 0xa5, 0xf8, 0x9e, 0x7e, 0xb6, 0x4e, 0x25, 0x2e, 0xdd, 0xe9, 0xdd, 0xb8, 0x81, 0xd3, 0x73, 0x62, 0x31, 0x7f, 0x6e, 0x6e, 0x6e, 0x99, 0x3c, 0x60, 0x23, 0x3b, 0x0f } +, + /* Seed */ + 89, + { 0x87, 0x5e, 0x07, 0x5e, 0xf1, 0xb0, 0x54, 0xb5, 0x84, 0x1e, 0x08, 0x45, 0x0d, 0x78, 0xeb, 0x54, 0xa5, 0x5c, 0x88, 0xb6, 0xd0, 0x18, 0x13, 0xc1, 0x07, 0xa0, 0x9b, 0x74, 0x54, 0x3b, 0x3f, 0x9f, 0xe1, 0xb7, 0xc9, 0x02, 0x11, 0xc6, 0x2e, 0xa7, 0x33, 0x81, 0x20, 0xd4, 0xae, 0x0f, 0x73, 0xba, 0x82, 0xc0, 0x1d, 0x28, 0xf8, 0x19, 0x4b, 0x3a, 0x39, 0x6b, 0xdf, 0x50, 0xf9, 0x41, 0x3a, 0x7f, 0xb0, 0x3b, 0xe2, 0x25, 0xfe, 0x05, 0x45, 0xdb, 0x80, 0xcd, 0xf0, 0xf6, 0x10, 0xa9, 0x5f, 0xd9, 0x03, 0x76, 0xe0, 0x39, 0xe3, 0x83, 0x1f, 0xf9, 0x9e } +, + /* Encryption */ + 128, + { 0x8f, 0xb5, 0x46, 0x26, 0x3c, 0x1d, 0x18, 0x75, 0xc7, 0x43, 0xf5, 0x2f, 0x02, 0x67, 0xb2, 0xf2, 0xfe, 0x68, 0x8d, 0x25, 0x42, 0x02, 0x10, 0x49, 0xf5, 0x34, 0x89, 0xce, 0x7c, 0x35, 0x91, 0x30, 0xf8, 0xe1, 0x1e, 0x3c, 0x46, 0x1c, 0x5e, 0x86, 0x3e, 0x4d, 0xc1, 0x9f, 0x07, 0xa1, 0x3a, 0x4c, 0x1a, 0x88, 0x22, 0x4b, 0x26, 0xc5, 0xc0, 0xcb, 0xe2, 0x02, 0x02, 0x45, 0xd9, 0x1e, 0x1b, 0x83, 0x42, 0x42, 0x52, 0x52, 0xf5, 0x3f, 0xc4, 0x0e, 0x4b, 0x14, 0xfa, 0x02, 0xbb, 0xd7, 0x47, 0x37, 0xd4, 0x02, 0x2c, 0xc5, 0x4f, 0xe3, 0x8f, 0x0d, 0x27, 0xd8, 0xfe, 0xa5, 0x0f, 0x2f, 0xdd, 0x84, 0x65, 0xd4, 0xf3, 0x2f, 0x8a, 0xc0, 0x3e, 0xe0, 0x06, 0xbe, 0x62, 0x33, 0xe4, 0xd1, 0xa3, 0xc1, 0x6e, 0xb1, 0x44, 0xb5, 0xd8, 0xbe, 0x72, 0x9a, 0xd3, 0x04, 0xf8, 0x23, 0x61, 0xe0, 0x7c, 0xfb } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 6.20", + /* Message */ + 28, + { 0x8a, 0x8a, 0x3e, 0xab, 0xdc, 0xa7, 0xca, 0xb0, 0xcc, 0x29, 0x6a, 0x29, 0x1e, 0xa8, 0xa9, 0x3d, 0xa4, 0xd2, 0xd2, 0xa1, 0x96, 0xff, 0x2f, 0x8d, 0x18, 0x1f, 0xee, 0x1f } +, + /* Seed */ + 97, + { 0x2e, 0x47, 0x36, 0xe4, 0x29, 0x6a, 0xb4, 0x66, 0x18, 0xb1, 0xef, 0x34, 0xda, 0x26, 0x77, 0x6e, 0x92, 0xef, 0x66, 0xf7, 0xcd, 0x17, 0x4e, 0xf9, 0x47, 0x69, 0x72, 0x42, 0x23, 0xa7, 0x65, 0xb4, 0xeb, 0xef, 0x08, 0xa8, 0x8f, 0xed, 0xbe, 0x27, 0x05, 0x60, 0xe5, 0xf6, 0x74, 0x37, 0xcf, 0x49, 0xd5, 0x7e, 0xa6, 0x62, 0x0a, 0xca, 0x59, 0x89, 0x8a, 0xfd, 0x52, 0xcd, 0xef, 0x30, 0xa8, 0xb0, 0xd9, 0x85, 0x5e, 0x5d, 0xfb, 0xe3, 0x47, 0xde, 0x77, 0xc4, 0xc0, 0x28, 0x0b, 0x0f, 0x1f, 0xd4, 0x4d, 0x4f, 0xe6, 0x89, 0x06, 0xbe, 0x8a, 0x4f, 0x12, 0xc5, 0x33, 0x08, 0x7b, 0xf5, 0xbc, 0xea, 0xfb } +, + /* Encryption */ + 128, + { 0x03, 0xf3, 0xe4, 0xba, 0x03, 0x48, 0x31, 0xa0, 0xe3, 0x0a, 0x4a, 0x33, 0x44, 0xce, 0xad, 0x61, 0xb2, 0x8b, 0x43, 0xbe, 0x31, 0x53, 0x2c, 0x2d, 0x76, 0x37, 0x53, 0x9b, 0x90, 0x13, 0x83, 0x7e, 0xdc, 0xb1, 0xf2, 0x16, 0xd3, 0x2f, 0xdf, 0xae, 0x73, 0x32, 0x36, 0x74, 0xa2, 0x81, 0x45, 0x65, 0xdb, 0xf2, 0x9e, 0x71, 0x2d, 0x18, 0xc4, 0x37, 0x39, 0x64, 0xdf, 0x60, 0xc9, 0x39, 0x9f, 0xda, 0x54, 0x14, 0xa0, 0xeb, 0x45, 0xbd, 0xe8, 0x66, 0x1a, 0x89, 0x09, 0x12, 0x95, 0xa1, 0xef, 0x71, 0x61, 0x6a, 0x3c, 0xd1, 0x45, 0xe9, 0xb3, 0x18, 0xb6, 0x51, 0xaf, 0x17, 0x5d, 0x4e, 0xc3, 0x50, 0x1d, 0x5e, 0xb7, 0x63, 0xe8, 0xd3, 0x5a, 0x2b, 0x72, 0x74, 0x6e, 0x02, 0x0b, 0x4b, 0xa5, 0x99, 0x73, 0x83, 0x4b, 0x21, 0x50, 0x02, 0x6b, 0x43, 0x2b, 0x17, 0x9a, 0x9a, 0xe8, 0x17, 0x2b, 0x7b } + +} +, +} +}, +{ + "Example 7: A 1025-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x01, 0x70, 0x93, 0x41, 0xd2, 0xec, 0x08, 0x04, 0xa7, 0x40, 0x34, 0xe8, 0xfa, 0x72, 0x86, 0x42, 0x98, 0x3d, 0x16, 0x50, 0xd7, 0x46, 0xe4, 0x49, 0xc9, 0xee, 0x40, 0x79, 0xaa, 0x15, 0xe5, 0x1f, 0x1f, 0xc1, 0x34, 0x24, 0x2e, 0x52, 0x4b, 0x0d, 0x3d, 0x0d, 0xbf, 0x5a, 0x51, 0x21, 0x93, 0x9b, 0x12, 0x5f, 0xcc, 0x86, 0x3e, 0x51, 0x41, 0x60, 0xb6, 0x34, 0xe3, 0x7a, 0xa6, 0x98, 0x94, 0x77, 0x6c, 0x7d, 0x33, 0xe1, 0xe7, 0xc6, 0x19, 0x52, 0x1d, 0xe4, 0x82, 0xa0, 0xae, 0xa4, 0x5c, 0x3c, 0x6a, 0xbc, 0x3f, 0x33, 0xe2, 0x5d, 0x86, 0xff, 0xa1, 0x39, 0x33, 0x25, 0x65, 0x9b, 0xf2, 0xd4, 0x09, 0x8d, 0xf1, 0x69, 0xb4, 0x07, 0x21, 0x87, 0x66, 0x0e, 0x27, 0x77, 0x00, 0x19, 0x9b, 0x7a, 0x3e, 0x34, 0x84, 0xb3, 0x84, 0x5f, 0x6f, 0xbf, 0x31, 0x98, 0x65, 0x7d, 0xf8, 0xcb, 0xf3, 0xa8, 0x1b } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x6f, 0xeb, 0xf7, 0x98, 0x12, 0x1e, 0x99, 0x33, 0x24, 0x97, 0x2c, 0x8c, 0x28, 0xcc, 0xc6, 0x5a, 0x2e, 0x6a, 0xa1, 0x5f, 0xcd, 0xe2, 0x32, 0xda, 0x03, 0xe4, 0x46, 0x4d, 0xb4, 0xda, 0x5f, 0xaa, 0x27, 0xe4, 0x2a, 0x7c, 0x7a, 0x76, 0xd9, 0xed, 0x49, 0x48, 0x6b, 0x27, 0xa9, 0xd7, 0x85, 0xc6, 0x7d, 0x9a, 0xc0, 0xc5, 0x19, 0xad, 0x8d, 0xad, 0xa6, 0xbf, 0xd1, 0x15, 0xd7, 0xcd, 0x75, 0xb9, 0x9c, 0x4b, 0x59, 0xc7, 0x69, 0x83, 0xa7, 0x01, 0x5b, 0x0d, 0xa6, 0x97, 0x3c, 0x69, 0xfa, 0x95, 0x08, 0x10, 0xae, 0x27, 0x68, 0xd9, 0x75, 0x88, 0x90, 0x05, 0x62, 0xe8, 0x6a, 0x6d, 0xf7, 0xc7, 0x14, 0xb8, 0x44, 0xb1, 0xe0, 0x46, 0x68, 0x6a, 0x5a, 0xfc, 0x66, 0x7b, 0x13, 0x57, 0x3a, 0x55, 0xbe, 0x9b, 0x5b, 0x38, 0xb9, 0x9b, 0xd3, 0xcf, 0x54, 0xe4, 0x34, 0x4a, 0x2f, 0x2d, 0x0e, 0x21 } +, + /* Prime 1 */ + 65, + { 0x01, 0x40, 0xef, 0x5b, 0x50, 0x70, 0x54, 0xd5, 0xa6, 0x94, 0x46, 0x4e, 0xf4, 0x7e, 0x49, 0x86, 0x8c, 0xb3, 0x3c, 0x97, 0xe0, 0xe3, 0xed, 0xd7, 0x7b, 0xf4, 0x5a, 0x52, 0x5e, 0x60, 0x8d, 0x7e, 0x21, 0x5f, 0x91, 0x33, 0x48, 0xa9, 0xb8, 0x27, 0xc8, 0x39, 0x73, 0x7a, 0x42, 0xb6, 0xad, 0xfb, 0xb2, 0xbb, 0x49, 0x7e, 0x14, 0x78, 0x92, 0x2f, 0x71, 0x88, 0x97, 0xd9, 0xfe, 0xed, 0x27, 0x7a, 0x6b } +, + /* Prime 2 */ + 65, + { 0x01, 0x26, 0x00, 0x4b, 0xbe, 0x2d, 0xf7, 0x6b, 0x6f, 0x38, 0xae, 0xa1, 0x64, 0xb1, 0xfd, 0x0f, 0x97, 0x61, 0x2b, 0x2d, 0xb9, 0x6c, 0xed, 0xe2, 0x8a, 0x3a, 0x91, 0xce, 0x0d, 0x74, 0x25, 0x3b, 0xb3, 0xf9, 0x55, 0x9b, 0x89, 0xf4, 0x81, 0x33, 0x75, 0x65, 0x2a, 0x50, 0x70, 0x06, 0xce, 0x99, 0x95, 0xa9, 0x8f, 0x0e, 0x6e, 0xf3, 0xbc, 0x22, 0xe5, 0x51, 0x9b, 0x61, 0x3b, 0xfb, 0xcd, 0x55, 0x11 } +, + /* Prime exponent 1 */ + 64, + { 0x98, 0x14, 0xd4, 0xe0, 0xb9, 0x5a, 0x7a, 0x24, 0x05, 0xff, 0x8b, 0x4a, 0xb0, 0xcd, 0x86, 0xc5, 0x05, 0xea, 0xa0, 0xce, 0x21, 0x34, 0x83, 0xf8, 0x69, 0x42, 0xa3, 0xe5, 0xb5, 0x3b, 0x57, 0x99, 0xd8, 0xff, 0xa5, 0x9d, 0xb9, 0x4f, 0x5b, 0x0a, 0xb6, 0xae, 0xd2, 0x30, 0xeb, 0x00, 0x67, 0x55, 0xbb, 0x0a, 0x88, 0x84, 0x8a, 0xde, 0x3b, 0x3d, 0x41, 0xcd, 0x33, 0xb0, 0x6a, 0x11, 0x5b, 0x21 } +, + /* Prime exponent 2 */ + 64, + { 0x1c, 0x4b, 0x1c, 0xfe, 0xf1, 0x67, 0x85, 0x34, 0x4f, 0xed, 0x26, 0x65, 0x0d, 0x68, 0x00, 0x2f, 0x1e, 0x4f, 0xcc, 0x77, 0xb2, 0xce, 0xf5, 0xe5, 0x3d, 0x9b, 0xb8, 0x8b, 0xbc, 0xe8, 0xb4, 0x65, 0x2e, 0x92, 0x99, 0x84, 0x5e, 0x3e, 0x6c, 0xd8, 0x58, 0x63, 0x09, 0x18, 0xae, 0xdf, 0x05, 0x12, 0xcd, 0x1d, 0x92, 0x53, 0x05, 0x2b, 0xce, 0xe3, 0xe8, 0xc5, 0x9e, 0x46, 0xea, 0x85, 0xa9, 0x31 } +, + /* Coefficient */ + 64, + { 0xfd, 0xc5, 0x10, 0xc4, 0xd9, 0x79, 0x07, 0x30, 0xb0, 0xfd, 0x47, 0xd3, 0x13, 0xab, 0xd4, 0x08, 0x58, 0xc7, 0xdf, 0xd5, 0x8f, 0x4b, 0x37, 0x91, 0x5f, 0x7a, 0x4b, 0x1d, 0xb3, 0xd7, 0xd8, 0xab, 0xd0, 0x6d, 0x3d, 0xa0, 0x02, 0xde, 0x98, 0x4a, 0x76, 0x09, 0xcc, 0x18, 0xa9, 0x44, 0x86, 0x46, 0x0a, 0x61, 0x74, 0x6c, 0x7e, 0xa6, 0x31, 0x17, 0xa6, 0x8a, 0xa2, 0x82, 0x59, 0x74, 0x4f, 0x49 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 7.1", + /* Message */ + 58, + { 0xda, 0x50, 0x9d, 0xce, 0x45, 0xe2, 0x47, 0x00, 0x37, 0x9b, 0xfe, 0x5a, 0xa1, 0xa8, 0x1c, 0x24, 0x70, 0x6c, 0x18, 0x42, 0xd9, 0xb1, 0x3e, 0x7a, 0x2e, 0x0a, 0x15, 0xd3, 0xa4, 0xaf, 0x8e, 0x6d, 0x08, 0x61, 0x2d, 0xca, 0xa1, 0x5d, 0x46, 0x0e, 0xce, 0x87, 0x29, 0x88, 0xe3,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4, 0x8e, 0x23, 0x98, 0xa8, 0x8e, 0x5b, 0x45, 0xd9, 0x9a, 0x17, 0xdd, 0x1f, 0x21, 0x2e, 0xda, 0xbc, 0xbc, 0xd3, 0x00, 0xa8, 0x4d, 0x39, 0x8e, 0xf5, 0x79, 0x35, 0xbd, 0xae, 0x95, 0x9e, 0x60, 0x54, 0xe7, 0x3a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.2", + /* Message */ + 12, + { 0xce, 0x0a, 0x79, 0x47, 0x49, 0x87, 0x41, 0x60, 0xe5, 0xd2, 0xe4, 0xff } +, + /* Seed */ + 114, + { 0xf4, 0xb2, 0xc9, 0xf3, 0x11, 0xc1, 0xfd, 0x41, 0xd4, 0x79, 0x44, 0xb5, 0x0e, 0x17, 0x55, 0xd4, 0xea, 0xc5, 0xee, 0x65, 0x08, 0x7c, 0x9f, 0xc6, 0xd2, 0xf0, 0x75, 0xb7, 0x38, 0xc6, 0x49, 0x26, 0xea, 0xf7, 0xd4, 0x31, 0x6b, 0xcd, 0xb6, 0x36, 0x54, 0xd5, 0x42, 0x0d, 0xa6, 0x1e, 0x02, 0x45, 0xf1, 0x95, 0xb9, 0xe8, 0x24, 0xaa, 0x0b, 0x06, 0xc8, 0x87, 0x99, 0xb1, 0x27, 0xfe, 0x9b, 0x03, 0x6d, 0xf3, 0x61, 0x75, 0xc0, 0xa6, 0xbd, 0x80, 0xe4, 0xe0, 0xaf, 0x6e, 0xbc, 0x2f, 0x42, 0x70, 0xb0, 0x4c, 0xe3, 0x0b, 0x9f, 0xa2, 0x7f, 0x04, 0x35, 0x86, 0x0f, 0xcc, 0xf4, 0x0b, 0x3d, 0xc7, 0xea, 0xef, 0xfd, 0xba, 0xb9, 0xe1, 0x76, 0x66, 0x19, 0xbb, 0x01, 0x6c, 0x17, 0x90, 0x26, 0x63, 0xcb, 0x24 } +, + /* Encryption */ + 129, + { 0x01, 0x0c, 0xf7, 0x4b, 0xeb, 0xc2, 0x63, 0x6d, 0x2c, 0x49, 0xd9, 0xc6, 0x22, 0xbd, 0x76, 0xcc, 0x0b, 0x1d, 0x02, 0xeb, 0xb5, 0x2f, 0xdf, 0xae, 0xc0, 0x1c, 0x4a, 0xc1, 0xe7, 0x56, 0x07, 0x1a, 0x8e, 0xf7, 0x6e, 0x12, 0x2a, 0x4c, 0x62, 0xc6, 0xba, 0x32, 0x65, 0xfa, 0x4c, 0x90, 0x56, 0x26, 0xd1, 0x13, 0xd5, 0x9d, 0xb7, 0x9a, 0xd6, 0x5f, 0x86, 0x40, 0xb3, 0xc4, 0x34, 0x4d, 0x73, 0x40, 0xc1, 0x6e, 0x38, 0xde, 0xb1, 0x89, 0xe3, 0xa1, 0xb1, 0x1e, 0xaa, 0xb0, 0xb2, 0x60, 0x6a, 0x7f, 0x82, 0xf5, 0x94, 0x6d, 0x41, 0x9a, 0xce, 0xbb, 0xbb, 0x3a, 0x93, 0x7d, 0x41, 0xe2, 0x9b, 0x33, 0xed, 0xd3, 0xad, 0x15, 0xf1, 0xe7, 0x77, 0x0f, 0xcf, 0xc3, 0x0a, 0xe0, 0x6a, 0xa0, 0x1b, 0xcd, 0x03, 0xd5, 0xdf, 0xb1, 0x62, 0xf8, 0x7a, 0x18, 0x39, 0x67, 0x55, 0x3c, 0x25, 0x02, 0xcb, 0x5f, 0xfe } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.3", + /* Message */ + 2, + { 0x41, 0xd6 } +, + /* Seed */ + 124, + { 0x55, 0x6e, 0x59, 0xb2, 0xc1, 0x89, 0x58, 0x75, 0x08, 0xe2, 0x08, 0x92, 0xfa, 0x56, 0x02, 0xd2, 0x49, 0xfb, 0xfb, 0x71, 0xa1, 0x09, 0x05, 0xed, 0x5a, 0xf7, 0xb7, 0x9b, 0xe8, 0x71, 0x11, 0xa0, 0xc6, 0x9a, 0xdd, 0xb1, 0x9e, 0xef, 0x31, 0x6d, 0x7c, 0x0b, 0x21, 0x81, 0x79, 0x90, 0xdc, 0x3e, 0xd8, 0x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x99, 0x10, 0x41, 0x15, 0x9a, 0x2a, 0xd1, 0xdb, 0x08, 0x96, 0x01, 0x5c, 0x4f, 0xf1, 0xd7, 0xb3, 0x54, 0x47, 0xcf, 0xc1, 0x0a, 0x24, 0xbe } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.4", + /* Message */ + 62, + { 0x0b, 0xb4, 0xab, 0xc7, 0xdc, 0x6c, 0xa4, 0x23, 0x5c, 0x29, 0xed, 0x0a, 0x2c, 0xb6, 0x3f, 0xd1, 0x41, 0x34, 0x1e, 0x2c, 0x4c, 0x90, 0x1e, 0x6d, 0xc9, 0x5d, 0xa9, 0xf0, 0x01, 0x0f, 0xa2, 0xe0, 0x22, 0xcc, 0xfe, 0x8a, 0xdf, 0xdb, 0x6e, 0xcf, 0x4d, 0x89, 0xf5, 0x79, 0xa1, 0x0a, 0x51, 0x70, 0xbe, 0x18, 0xc4, 0x6a, 0x24, 0x1c, 0xa7, 0xee, 0xd1, 0x07, 0xca, 0xfe, 0x4a, 0x9d } +, + /* Seed */ + 64, + { 0xbb, 0x80, 0xbe, 0x78, 0x02, 0xdd, 0x8b, 0xf5, 0xfb, 0x5b, 0x1b, 0x86, 0x39, 0x66, 0x54, 0xf4, 0x73, 0x9f, 0x5d, 0x43, 0x51, 0xf1, 0x9c, 0xe3, 0x1b, 0x72, 0xc2, 0x10, 0xae, 0xa1, 0xa2, 0xed, 0x21, 0x42, 0xd8, 0xd6, 0xf7, 0xae, 0x37, 0x4f, 0x06, 0x13, 0x3a, 0x31, 0x5c, 0x62, 0x64, 0xda, 0x65, 0xce, 0xf2, 0x33, 0xed, 0x3d, 0xcc, 0x81, 0x59, 0xd7, 0x6c, 0x3a, 0x17, 0xf3, 0x6d, 0x0c } +, + /* Encryption */ + 129, + { 0x00, 0x6f, 0x1b, 0x6c, 0x1f, 0xb3, 0x7a, 0xe5, 0xc8, 0xc0, 0x24, 0x44, 0x9a, 0xbc, 0x38, 0x40, 0xe8, 0xe5, 0x09, 0x71, 0x43, 0xee, 0xd1, 0x6b, 0xea, 0xf6, 0x7b, 0x6c, 0x7a, 0x48, 0x24, 0xac, 0x38, 0xb6, 0xf8, 0xc3, 0x53, 0xb6, 0x45, 0xc8, 0xce, 0xa4, 0xfa, 0xb0, 0x9c, 0x02, 0xfa, 0x6c, 0x32, 0x5a, 0x50, 0x74, 0x38, 0xb9, 0x64, 0x5e, 0xc8, 0x23, 0x00, 0x86, 0xb3, 0x15, 0xe3, 0x4e, 0x7a, 0x56, 0xad, 0xb0, 0xec, 0xd8, 0x9f, 0xd0, 0x7b, 0x98, 0x73, 0x9c, 0x24, 0xdb, 0x6f, 0xe1, 0x1f, 0xf2, 0xe5, 0xad, 0x38, 0x31, 0x8e, 0xc3, 0x1d, 0xf2, 0xed, 0x25, 0x08, 0xde, 0xbc, 0xa7, 0xa6, 0x7e, 0x24, 0x01, 0x96, 0xaa, 0x9a, 0xcd, 0x80, 0x32, 0x9f, 0x4c, 0x43, 0x43, 0xc1, 0x0b, 0x72, 0x69, 0x9f, 0x9d, 0x6b, 0x5b, 0xc2, 0x43, 0x99, 0x5b, 0x09, 0xc4, 0x6d, 0xd3, 0xd8, 0x03, 0xce } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.5", + /* Message */ + 15, + { 0xed, 0x26, 0xec, 0x20, 0x2d, 0x5e, 0x69, 0x74, 0x0d, 0xa3, 0x48, 0x84, 0x06, 0xbb, 0xbd } +, + /* Seed */ + 111, + { 0xf2, 0xfd, 0x08, 0xcc, 0x0d, 0xb9, 0xa5, 0x5a, 0xbf, 0xeb, 0xd9, 0x2e, 0x2a, 0x9d, 0x75, 0x87, 0x2a, 0xb7, 0xdf, 0xfb, 0x0b, 0x4d, 0xa1, 0x36, 0x06, 0xe1, 0x52, 0x75, 0x9f, 0x86, 0x6f, 0x22, 0xeb, 0x87, 0x29, 0xfb, 0x8c, 0x9a, 0x5c, 0x45, 0xba, 0x2f, 0x4a, 0xca, 0xe4, 0x31, 0x59, 0xa7, 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 0x79, 0xf9, 0x9b, 0xb2, 0xd9, 0x1c, 0x37, 0xaa, 0xb1, 0x35, 0x72 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.6", + /* Message */ + 33, + { 0xdc, 0x28, 0x5a, 0x26, 0x39, 0x59, 0x39, 0xe7, 0x99, 0x72, 0x04, 0xc7, 0x1a, 0x93, 0x2f, 0x79, 0x5b, 0x4d, 0xe4, 0x01, 0xe9, 0x6f, 0x34, 0xe1, 0x89, 0x36, 0x32, 0x37, 0xe9, 0xcf, 0xda, 0xdc, 0x61 } +, + /* Seed */ + 93, + { 0xd8, 0x0b, 0xfc, 0xc2, 0x91, 0xce, 0x51, 0x8c, 0xe0, 0xbb, 0x6a, 0xe9, 0x34, 0xdf, 0xd8, 0x56, 0x58, 0xb2, 0x39, 0xfb, 0x45, 0x39, 0xcb, 0xe0, 0x5d, 0xa1, 0x26, 0xa8, 0x98, 0xb7, 0xf3, 0x64, 0x88, 0x7c, 0x0d, 0xdf, 0xb1, 0xea, 0xea, 0x1d, 0x5a, 0x90, 0xde, 0x76, 0x95, 0x66, 0x5c, 0x55, 0x82, 0x2a, 0x11, 0x72, 0xcb, 0x5b, 0xe8, 0xa1, 0x12, 0xd2, 0x8c, 0x86, 0x02, 0xc5, 0x13, 0xbe, 0x48, 0xc2, 0x92, 0xf0, 0x59, 0x72, 0xe6, 0x71, 0x1a, 0x44, 0xcb, 0xc7, 0x28, 0x17, 0x15, 0x09, 0x4b, 0x49, 0x0f, 0xde, 0x29, 0x16, 0x5a, 0x6b, 0x6b, 0x7d, 0x99, 0xdb, 0xed } +, + /* Encryption */ + 129, + { 0x01, 0x57, 0xe7, 0xb5, 0x4a, 0x34, 0x1b, 0x8d, 0xf8, 0xbd, 0x9b, 0x99, 0xfc, 0x2e, 0x6c, 0x58, 0xd8, 0x86, 0xfc, 0x79, 0xe7, 0x44, 0x2a, 0x9e, 0x76, 0xd0, 0xd6, 0x7e, 0x48, 0x58, 0xc4, 0xab, 0xf0, 0xed, 0x25, 0xc3, 0x3d, 0xf6, 0x2e, 0x2a, 0xad, 0xa3, 0x99, 0xdf, 0xea, 0xdc, 0x7f, 0xf6, 0x89, 0x28, 0xe6, 0xb9, 0x00, 0x71, 0x02, 0xdd, 0xf8, 0x09, 0xf5, 0x90, 0x8e, 0xef, 0xc1, 0x0f, 0x2a, 0x73, 0x71, 0x06, 0x09, 0x23, 0x1f, 0x5d, 0x45, 0xe0, 0x0a, 0xdd, 0xa1, 0x34, 0xb6, 0x02, 0xdd, 0x0e, 0xee, 0x0f, 0x67, 0x22, 0x49, 0x4b, 0x7e, 0x4f, 0x7b, 0x40, 0x57, 0x72, 0xc8, 0x31, 0xb6, 0x37, 0x29, 0xbe, 0x0f, 0x1c, 0x4b, 0x6d, 0x2a, 0x54, 0x2c, 0x15, 0x65, 0xc7, 0xdf, 0x23, 0x1d, 0x9e, 0x89, 0x2e, 0x58, 0x6a, 0x18, 0xec, 0x54, 0x37, 0x73, 0x76, 0xdb, 0x77, 0xf8, 0x13, 0x84 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.7", + /* Message */ + 55, + { 0x46, 0x47, 0xd8, 0x41, 0xc5, 0xa0, 0xb9, 0x97, 0x3a, 0x91, 0x45, 0x4d, 0xd1, 0xa0, 0x5e, 0xc0, 0xe5, 0x75, 0x03, 0xed, 0x99, 0x67, 0x2a, 0xc0, 0x02, 0xdf, 0xee, 0x77, 0x7f, 0x7f, 0xa5, 0x06, 0xfb, 0x41, 0xb2, 0xec, 0x8b, 0x8d, 0x2c, 0xdb, 0x9b, 0xef, 0x01, 0x33, 0xbd, 0x5e, 0x3a, 0x7d, 0x0c, 0x43, 0x44, 0xb2, 0x8f, 0xa8, 0xdb } +, + /* Seed */ + 71, + { 0xf5, 0x27, 0xa1, 0x4e, 0x2e, 0x06, 0xe7, 0x3f, 0x1c, 0x24, 0x5d, 0x19, 0x0d, 0x02, 0xcc, 0xed, 0x01, 0x1e, 0x46, 0x84, 0x87, 0xac, 0x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5 Encryption Example 7.8", + /* Message */ + 8, + { 0xba, 0x10, 0xd4, 0x7a, 0x9f, 0x62, 0x42, 0x81 } +, + /* Seed */ + 118, + { 0x37, 0x9f, 0xdc, 0xfa, 0x5d, 0x8c, 0x61, 0x37, 0xc3, 0x6b, 0xad, 0x14, 0x3f, 0xd9, 0xb1, 0xf7, 0xe8, 0x94, 0xfa, 0x0e, 0x9a, 0xc0, 0xfb, 0x9c, 0xec, 0x60, 0xe8, 0x6c, 0x82, 0x53, 0x97, 0x5d, 0x8e, 0x78, 0x74, 0x21, 0x08, 0x49, 0x5e, 0x59, 0x4a, 0xd0, 0x89, 0x8f, 0xd0, 0x4c, 0x91, 0xe4, 0x01, 0xe7, 0xc8, 0x80, 0x89, 0xa8, 0x7b, 0x4a, 0x4a, 0x82, 0xe8, 0x34, 0xcd, 0x37, 0x77, 0xa7, 0xd3, 0xf8, 0x0e, 0x64, 0x86, 0x81, 0x2d, 0x4a, 0xb0, 0xd3, 0x37, 0x23, 0x16, 0x2b, 0xcb, 0xc7, 0xe0, 0x81, 0xa9, 0x9d, 0x3f, 0x9b, 0x5c, 0x3b, 0xa4, 0x4b, 0x19, 0xbd, 0xf8, 0x84, 0xa4, 0x62, 0x6f, 0xd7, 0xde, 0xf7, 0x67, 0x40, 0x57, 0xbe, 0xa0, 0x82, 0xe0, 0x0d, 0xb4, 0xb7, 0x61, 0xad, 0x75, 0x3a, 0xb5, 0x98, 0x5a, 0x94 } +, + /* Encryption */ + 129, + { 0x00, 0xc4, 0x96, 0x5e, 0x29, 0x63, 0xd7, 0xbc, 0x5b, 0x10, 0x44, 0xd8, 0xfc, 0x75, 0xeb, 0x33, 0x82, 0xce, 0xdd, 0x99, 0x07, 0x41, 0x97, 0x92, 0xef, 0xc8, 0x8c, 0x92, 0xb1, 0xd5, 0xc3, 0x90, 0xfa, 0xb1, 0x90, 0x01, 0x1c, 0x51, 0x8a, 0xc9, 0xce, 0x45, 0xc1, 0xb8, 0xe7, 0x27, 0x6b, 0xff, 0xc7, 0xc7, 0xe0, 0x5c, 0x25, 0x37, 0x08, 0x91, 0x37, 0xa9, 0x8d, 0xf6, 0xe0, 0xc6, 0x92, 0x02, 0x0e, 0xd6, 0x54, 0xaf, 0x83, 0x33, 0x9b, 0xab, 0x11, 0x92, 0x71, 0x77, 0xf2, 0xf5, 0x23, 0x22, 0x6b, 0x4f, 0xe6, 0x4b, 0x99, 0xc1, 0x72, 0x9f, 0x6c, 0x92, 0x29, 0x06, 0xbc, 0x16, 0xd3, 0x1f, 0x0c, 0x94, 0xdc, 0x2e, 0xa4, 0x13, 0x81, 0x0d, 0x55, 0x94, 0x0c, 0x97, 0xaf, 0xdd, 0x48, 0x29, 0xfb, 0xf1, 0x61, 0x8a, 0x8c, 0x9d, 0xe8, 0x9d, 0xc2, 0x40, 0x06, 0xe7, 0xe4, 0x21, 0xa5, 0x8d, 0x38 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.9", + /* Message */ + 38, + { 0xef, 0xc7, 0x48, 0x9f, 0xec, 0x77, 0x9e, 0x05, 0x2e, 0x37, 0x9c, 0x1a, 0xd9, 0x04, 0x59, 0x03, 0xb6, 0x84, 0x2a, 0x9c, 0xa4, 0x1b, 0x48, 0xbd, 0xdc, 0xe5, 0x80, 0x80, 0xa5, 0xed, 0xec, 0x63, 0xf3, 0x6e, 0xe1, 0x15, 0x60, 0xfd } +, + /* Seed */ + 88, + { 0xc8, 0xec, 0xba, 0x62, 0x72, 0x14, 0xc4, 0x14, 0xd7, 0xc3, 0xfd, 0xd3, 0x16, 0xc2, 0xd8, 0x2a, 0x98, 0x53, 0x57, 0x28, 0xb9, 0xa9, 0x37, 0x6f, 0x69, 0xa9, 0x53, 0xd7, 0xcd, 0x1c, 0xea, 0xd7, 0x10, 0x53, 0xdb, 0xe0, 0x14, 0x0c, 0x7f, 0x02, 0xbd, 0x71, 0xe0, 0x13, 0x7f, 0xea, 0x29, 0xcd, 0x4c, 0x21, 0xa5, 0x8b, 0xde, 0xc6, 0x66, 0x40, 0x99, 0x0d, 0x28, 0xc1, 0x0b, 0x70, 0x17, 0x59, 0x3c, 0x1d, 0x11, 0xfe, 0x9a, 0xbe, 0xbd, 0x71, 0x24, 0xe1, 0xd9, 0x85, 0x63, 0x1e, 0x94, 0xe9, 0xe5, 0x12, 0x41, 0x26, 0x0f, 0x9e, 0xf1, 0xf1 } +, + /* Encryption */ + 129, + { 0x00, 0x32, 0x18, 0x4e, 0xf2, 0x88, 0xfa, 0x0a, 0xaa, 0x0c, 0x2c, 0x1a, 0x19, 0xe7, 0xc2, 0x9f, 0x81, 0xc7, 0x01, 0x2f, 0x45, 0x29, 0xeb, 0x9e, 0xeb, 0x53, 0x68, 0x1f, 0x62, 0x47, 0xf8, 0xd4, 0x35, 0x69, 0x13, 0x45, 0xa5, 0x14, 0x8a, 0x2c, 0x87, 0x7b, 0x2b, 0x18, 0x92, 0x6b, 0xae, 0x9d, 0xe5, 0xb3, 0x17, 0xba, 0xc0, 0xe9, 0x02, 0xc9, 0x60, 0x25, 0xee, 0xc2, 0xf9, 0xea, 0xbd, 0x0f, 0x9e, 0x88, 0x86, 0xef, 0x95, 0x19, 0xc8, 0x24, 0x9f, 0xeb, 0x83, 0x46, 0x65, 0xc1, 0x01, 0x0d, 0xb7, 0x62, 0x4f, 0x48, 0x7e, 0x16, 0x1f, 0x89, 0xf6, 0xae, 0x00, 0x18, 0xc1, 0xf4, 0xe0, 0xab, 0x54, 0x72, 0xf7, 0xf0, 0x99, 0x35, 0x61, 0xcd, 0x59, 0x85, 0xf3, 0x83, 0xd0, 0x49, 0xdd, 0x83, 0x2b, 0x82, 0xc8, 0x37, 0x48, 0xb2, 0x28, 0x1b, 0xfb, 0x99, 0xd9, 0xd5, 0x00, 0x8d, 0xc8, 0x07, 0xde } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.10", + /* Message */ + 19, + { 0x5b, 0x26, 0x4f, 0xf8, 0x8d, 0xef, 0xd3, 0xc2, 0x99, 0x99, 0x3d, 0x81, 0x12, 0x9a, 0x6e, 0x5d, 0xd2, 0xb5, 0x7b } +, + /* Seed */ + 107, + { 0x0b, 0xe7, 0xab, 0x5b, 0x29, 0x70, 0x48, 0x43, 0xc1, 0xc0, 0xd7, 0xe4, 0xef, 0x5e, 0x93, 0xf3, 0xba, 0x71, 0x7d, 0xb7, 0x81, 0x5a, 0xf5, 0x72, 0xe3, 0xa9, 0xab, 0x3f, 0x99, 0xb1, 0xac, 0x9a, 0x22, 0xb9, 0x2d, 0x9b, 0x43, 0xda, 0x2b, 0x99, 0x65, 0xc7, 0x97, 0x70, 0x57, 0x17, 0x3c, 0x03, 0x57, 0x3f, 0x32, 0x48, 0x0a, 0x92, 0x70, 0x19, 0xaf, 0xff, 0x0e, 0x0e, 0x34, 0xe4, 0x09, 0x5e, 0x4a, 0x4d, 0x39, 0x2d, 0xcd, 0x1b, 0xd9, 0xf2, 0x7d, 0x32, 0xfd, 0xe7, 0x15, 0x9f, 0x02, 0x3c, 0x83, 0x08, 0x9e, 0x88, 0xa7, 0x1f, 0x24, 0x33, 0x64, 0x8e, 0xf8, 0xc8, 0x40, 0x45, 0xb9, 0xc3, 0x6d, 0x8e, 0x5f, 0x6e, 0xff, 0x03, 0x4b, 0x91, 0xb7, 0x02, 0x34 } +, + /* Encryption */ + 129, + { 0x00, 0x4c, 0x65, 0x29, 0x35, 0x56, 0xf2, 0xfd, 0x15, 0xab, 0x90, 0xeb, 0x22, 0xe0, 0x75, 0x33, 0xb3, 0xdc, 0x17, 0x33, 0x4f, 0x5e, 0xed, 0x27, 0xa3, 0x99, 0x31, 0x80, 0xc5, 0x6c, 0x8e, 0x3d, 0x8f, 0x51, 0xee, 0xb2, 0x75, 0x95, 0xf8, 0x78, 0xd2, 0x36, 0x65, 0xba, 0x3a, 0xb0, 0xe7, 0x28, 0xa5, 0xae, 0xf7, 0x23, 0x4f, 0x60, 0x36, 0xb0, 0x23, 0xf8, 0x71, 0xc2, 0xd6, 0x55, 0x2a, 0x18, 0xad, 0x5a, 0x25, 0xbe, 0xc5, 0x5b, 0xc7, 0x6b, 0xee, 0x63, 0x83, 0x46, 0x12, 0x81, 0xd3, 0x9a, 0x30, 0xf6, 0xd6, 0x60, 0x92, 0xe0, 0xcf, 0xf6, 0x92, 0x32, 0x68, 0xfc, 0x04, 0x3c, 0xdf, 0x74, 0x7e, 0x8d, 0x54, 0x89, 0x50, 0x4e, 0x7d, 0xb3, 0x0a, 0x7b, 0xd9, 0x1a, 0x2b, 0xfc, 0x6c, 0x1b, 0x34, 0x14, 0x40, 0x57, 0x01, 0x75, 0x3d, 0x5b, 0x85, 0xff, 0x73, 0x52, 0x01, 0x2d, 0x55, 0xe9, 0x23 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.11", + /* Message */ + 37, + { 0x72, 0xe2, 0x09, 0x00, 0xe5, 0xbc, 0xc2, 0x3c, 0xf8, 0x79, 0xed, 0x35, 0x31, 0x88, 0x9a, 0x1e, 0xd5, 0xaa, 0x3d, 0x5c, 0x79, 0x2e, 0x34, 0xe3, 0xb1, 0x26, 0x90, 0xd9, 0xac, 0x24, 0x03, 0xd0, 0xf6, 0xf7, 0x8f, 0x59, 0x23 } +, + /* Seed */ + 89, + { 0x11, 0x62, 0x75, 0xe9, 0xbe, 0x1b, 0xd4, 0xe6, 0xf2, 0x03, 0xff, 0xe4, 0xf0, 0xab, 0x9a, 0x32, 0x73, 0x84, 0x10, 0xe9, 0x23, 0xe8, 0x39, 0x71, 0xee, 0x9a, 0x6b, 0x99, 0x2c, 0x65, 0x0a, 0x03, 0x1f, 0x94, 0x0f, 0x6e, 0xf3, 0x3d, 0x61, 0x50, 0xdf, 0xf8, 0xb3, 0x9d, 0xcf, 0x22, 0x50, 0xd5, 0x66, 0x5c, 0x04, 0x27, 0x3b, 0x2b, 0xe2, 0xde, 0xc9, 0x97, 0x12, 0xbb, 0xc0, 0x12, 0xf7, 0x5a, 0x31, 0xb3, 0x0b, 0xa0, 0x6f, 0xf9, 0xeb, 0xe3, 0xb8, 0x9f, 0x58, 0xa6, 0x8f, 0x26, 0x85, 0xe3, 0x38, 0xff, 0x6c, 0xb8, 0xd4, 0x18, 0x1a, 0x8a, 0x14 } +, + /* Encryption */ + 129, + { 0x00, 0x21, 0x4a, 0x83, 0xbe, 0x45, 0x3a, 0x75, 0xbc, 0xda, 0x94, 0x33, 0xa7, 0xb9, 0x51, 0x43, 0x34, 0x39, 0x98, 0x30, 0x72, 0x07, 0x1c, 0xc8, 0x21, 0x12, 0xb7, 0x77, 0x42, 0xbe, 0x0c, 0x38, 0x22, 0x6c, 0xa3, 0xc6, 0xf3, 0x8d, 0x55, 0xb9, 0xca, 0x3f, 0x08, 0xc8, 0x79, 0x37, 0x89, 0x79, 0x6e, 0x6c, 0xde, 0x67, 0x37, 0x6d, 0x67, 0x3f, 0x5e, 0xc5, 0x7d, 0xac, 0xc3, 0x74, 0xc4, 0xc3, 0x17, 0x34, 0x44, 0xdd, 0x8a, 0x63, 0x76, 0xde, 0x8f, 0x9d, 0xdc, 0x31, 0xa4, 0xc0, 0x60, 0xd7, 0x72, 0xf0, 0x2e, 0xb7, 0x49, 0x51, 0x2d, 0xcd, 0x04, 0x02, 0x31, 0x17, 0x5d, 0x0b, 0x69, 0x42, 0xa9, 0x47, 0xb2, 0xc8, 0x2f, 0x7c, 0x19, 0xe2, 0xce, 0x87, 0x50, 0x00, 0xaf, 0x84, 0x27, 0x4c, 0xbe, 0x2a, 0xdb, 0xf2, 0xfb, 0xfb, 0x53, 0x7c, 0xcb, 0xe2, 0xfb, 0xd0, 0x72, 0x87, 0x13, 0x78, 0x75 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.12", + /* Message */ + 21, + { 0x16, 0xb1, 0x10, 0xe2, 0x90, 0x9b, 0x11, 0xb0, 0xcf, 0x36, 0xb0, 0x52, 0xc6, 0xf3, 0x93, 0x6a, 0x2c, 0xa1, 0x3f, 0xc3, 0xa5 } +, + /* Seed */ + 105, + { 0xc2, 0xbf, 0x9e, 0x4f, 0xb1, 0xed, 0x70, 0xca, 0x21, 0x2d, 0x15, 0xee, 0x8e, 0xb3, 0xcd, 0x66, 0x0e, 0xb6, 0x5c, 0x52, 0x78, 0xe0, 0x3a, 0x3b, 0x10, 0xeb, 0x12, 0xb2, 0x53, 0x34, 0xa4, 0x72, 0x8b, 0x94, 0x99, 0x20, 0x12, 0x2f, 0xb9, 0x92, 0xbf, 0x2c, 0xe4, 0x30, 0x10, 0x3d, 0x74, 0xab, 0x74, 0xe6, 0xd6, 0xe7, 0x62, 0xb8, 0x5d, 0x6e, 0xf9, 0xbe, 0xb7, 0xd7, 0x25, 0x98, 0xf2, 0x93, 0xa4, 0x35, 0x62, 0xe9, 0x06, 0x89, 0x54, 0x11, 0x11, 0x51, 0x1d, 0x31, 0x4a, 0x9c, 0x46, 0x02, 0x23, 0x76, 0xad, 0x05, 0x5d, 0x54, 0xce, 0xd6, 0xac, 0x1f, 0x36, 0xe9, 0x8c, 0x2b, 0x25, 0xa0, 0xac, 0xde, 0x64, 0xdc, 0xf6, 0x52, 0x2c, 0x3d, 0x22 } +, + /* Encryption */ + 129, + { 0x01, 0x6a, 0xa9, 0x5a, 0x08, 0x23, 0x82, 0xc1, 0x0c, 0x04, 0x53, 0x10, 0xfe, 0xfe, 0xcc, 0x8d, 0x17, 0xdb, 0xf2, 0x16, 0xd8, 0xed, 0xc0, 0x4b, 0xda, 0xcd, 0x4f, 0x52, 0x4d, 0xe4, 0x85, 0xb7, 0xfe, 0x8a, 0x26, 0xf1, 0x4c, 0xab, 0xd2, 0x97, 0xe7, 0xf0, 0x3b, 0x3c, 0x85, 0x08, 0x6a, 0x16, 0x14, 0x7d, 0x5f, 0x61, 0x93, 0x91, 0x9b, 0xb9, 0x5a, 0x53, 0xc1, 0x46, 0xc7, 0x84, 0xc0, 0x0b, 0x53, 0x32, 0xe0, 0x18, 0xf6, 0x43, 0xcf, 0x95, 0x87, 0x24, 0xcd, 0x08, 0x07, 0x5e, 0xb6, 0x4c, 0xa5, 0x68, 0x0c, 0x27, 0xc7, 0x05, 0xd4, 0x0d, 0x88, 0xb9, 0xd7, 0xf4, 0x26, 0xb7, 0x36, 0xe3, 0xc5, 0xf6, 0x39, 0x4e, 0xa6, 0x83, 0xb6, 0x5c, 0x23, 0x73, 0xa6, 0xfc, 0xeb, 0x14, 0xf2, 0xea, 0x85, 0x1c, 0xa8, 0xe0, 0x00, 0xe2, 0x4d, 0xc8, 0xf7, 0xe7, 0xc8, 0x1b, 0x1d, 0x4e, 0x72, 0x0c, 0x36 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.13", + /* Message */ + 17, + { 0x3c, 0x86, 0x0a, 0x28, 0xfa, 0xe8, 0xda, 0x2a, 0xc0, 0xd9, 0xa3, 0x39, 0x89, 0x97, 0x7f, 0xfa, 0x04 } +, + /* Seed */ + 109, + { 0x7c, 0x96, 0x99, 0x90, 0x6c, 0x9f, 0x16, 0x65, 0x12, 0x5c, 0x0b, 0x10, 0x67, 0x3f, 0x3d, 0xad, 0x98, 0xc9, 0x1a, 0x4f, 0xf0, 0xfa, 0xaa, 0x64, 0x7d, 0xb5, 0x54, 0xfd, 0x62, 0x27, 0xef, 0x50, 0x90, 0x9c, 0x97, 0xb7, 0x06, 0x09, 0x2b, 0xe2, 0x10, 0xdb, 0x2c, 0x24, 0xba, 0x9e, 0x8e, 0x6a, 0x87, 0xf9, 0xdd, 0xd9, 0xf3, 0xf4, 0x91, 0x29, 0x10, 0x29, 0xac, 0x6e, 0xe4, 0x6e, 0x08, 0xd0, 0xd7, 0xa5, 0x3c, 0x46, 0x2d, 0xb4, 0xf0, 0xfd, 0x1c, 0xc2, 0x3e, 0xc8, 0xf5, 0x5e, 0xda, 0x07, 0xf4, 0xca, 0x0d, 0x3e, 0x3c, 0xd3, 0x76, 0x22, 0x85, 0x5b, 0x4d, 0xb0, 0x8f, 0x64, 0xbe, 0x3e, 0x26, 0xc3, 0xe9, 0x78, 0x75, 0x17, 0x12, 0x94, 0xea, 0xdf, 0x86, 0xfc, 0xd6 } +, + /* Encryption */ + 129, + { 0x01, 0x0c, 0x1e, 0x04, 0xa8, 0x58, 0xc6, 0x15, 0xee, 0x96, 0x95, 0xf6, 0x4a, 0xb2, 0xdb, 0x99, 0x80, 0x6d, 0xa4, 0x82, 0xd2, 0xb4, 0x60, 0x29, 0x3c, 0x46, 0xdc, 0x7b, 0x71, 0x7a, 0x59, 0x76, 0xa3, 0xc7, 0xe3, 0x6d, 0x8d, 0x47, 0xa8, 0x4a, 0x34, 0xd6, 0x3c, 0xdf, 0xca, 0x2c, 0x1e, 0x38, 0x45, 0x25, 0x73, 0xed, 0x44, 0xc3, 0xa0, 0x40, 0x40, 0x5e, 0xcf, 0x3f, 0xbf, 0x36, 0x83, 0x41, 0xc4, 0xa1, 0xfc, 0x90, 0x83, 0xa8, 0xf5, 0x52, 0x93, 0x67, 0xb9, 0x9c, 0xb8, 0x9f, 0xc5, 0xa0, 0x8b, 0x8f, 0x34, 0x75, 0xa0, 0xd5, 0x5e, 0x3e, 0x42, 0xcc, 0xcb, 0xeb, 0x20, 0xd0, 0x4a, 0x19, 0x97, 0xee, 0xda, 0x4e, 0x3c, 0xc9, 0xe9, 0x92, 0xd2, 0x37, 0xec, 0x7d, 0x32, 0xfe, 0x25, 0x84, 0x5a, 0xb0, 0x24, 0xd5, 0x88, 0x28, 0x05, 0xed, 0x52, 0xf1, 0x0e, 0xd7, 0xd2, 0x5d, 0x62, 0xd0, 0xaf } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.14", + /* Message */ + 30, + { 0x4e, 0xdf, 0x4a, 0xd3, 0x44, 0x0f, 0x17, 0xb1, 0x0d, 0x26, 0xaf, 0xcd, 0xf4, 0xe4, 0x44, 0xd2, 0xaa, 0x61, 0xa1, 0x97, 0x55, 0xa6, 0x21, 0x07, 0x98, 0x3f, 0x01, 0x22, 0xfb, 0x2a } +, + /* Seed */ + 96, + { 0xe0, 0x20, 0x09, 0x39, 0x39, 0xb4, 0x18, 0x9e, 0x93, 0x4c, 0xb6, 0x2d, 0x27, 0xca, 0x5e, 0x97, 0x19, 0x65, 0x2c, 0x13, 0x7f, 0xc4, 0x9e, 0x72, 0x1c, 0x4a, 0xb9, 0xe9, 0xf3, 0x98, 0xb0, 0xa6, 0x12, 0xde, 0x8a, 0x8a, 0x89, 0x99, 0xaf, 0x0d, 0xbc, 0x1c, 0xea, 0x0b, 0x61, 0x63, 0xda, 0x42, 0x61, 0x23, 0x28, 0x14, 0xed, 0x92, 0xeb, 0x21, 0x60, 0xcf, 0x4b, 0x26, 0xd0, 0x55, 0x1b, 0x1b, 0xdd, 0x91, 0x9d, 0x49, 0x47, 0x93, 0x78, 0x6e, 0x1b, 0x86, 0xf7, 0x9d, 0x64, 0x16, 0x61, 0x2a, 0x28, 0x22, 0x61, 0x36, 0x3d, 0x6c, 0x9b, 0x7a, 0x0d, 0x92, 0xad, 0x17, 0x58, 0xea, 0xad, 0x51 } +, + /* Encryption */ + 129, + { 0x00, 0x8c, 0xf9, 0xb3, 0xf3, 0xe7, 0x60, 0x90, 0xd1, 0x01, 0x17, 0x4e, 0xcd, 0x97, 0xd1, 0x0b, 0xff, 0x6d, 0xe4, 0xd4, 0x64, 0x40, 0x00, 0x3f, 0xc0, 0xd4, 0x28, 0xf1, 0x9b, 0x85, 0x58, 0xf3, 0x13, 0x74, 0xa5, 0xfa, 0x28, 0x3d, 0x03, 0xd4, 0xdd, 0x43, 0xf9, 0x3a, 0x4d, 0x9f, 0x14, 0xca, 0x00, 0x68, 0xdc, 0x2c, 0xf3, 0xe2, 0x54, 0x37, 0xb0, 0x5a, 0xb1, 0xd4, 0x06, 0x21, 0xee, 0xbd, 0x84, 0x16, 0xf5, 0x82, 0x8a, 0xe7, 0xc6, 0xcf, 0xd2, 0x97, 0xb4, 0x51, 0x8f, 0x79, 0x94, 0x2b, 0x91, 0x43, 0x23, 0x28, 0x4e, 0x29, 0x76, 0xa5, 0x4d, 0x3c, 0xd9, 0x11, 0x63, 0x3a, 0x30, 0x7e, 0xda, 0xf1, 0xed, 0xb6, 0x74, 0x98, 0x46, 0x6b, 0x3e, 0x98, 0x91, 0x6f, 0x99, 0x04, 0xf4, 0xa0, 0xea, 0x9b, 0x87, 0xa9, 0x83, 0x44, 0xf0, 0x73, 0x83, 0x3e, 0xdf, 0x9b, 0x2b, 0x53, 0x94, 0xcf, 0xd7 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.15", + /* Message */ + 22, + { 0x8a, 0x6d, 0x53, 0xb0, 0xad, 0xa1, 0x85, 0x4e, 0x23, 0x13, 0x69, 0x1a, 0xab, 0x23, 0x06, 0x3d, 0xe1, 0x31, 0xbc, 0x36, 0xc7, 0x64 } +, + /* Seed */ + 104, + { 0x26, 0x85, 0x45, 0x8a, 0xeb, 0xfb, 0xd6, 0x07, 0x4e, 0xbe, 0xb0, 0xfc, 0x0c, 0xc4, 0x92, 0x1c, 0x27, 0x3e, 0x8c, 0x0a, 0x88, 0x15, 0x51, 0x50, 0x2e, 0x4c, 0x29, 0x9f, 0x33, 0x4d, 0xd5, 0x67, 0xf5, 0x16, 0x75, 0xb0, 0xff, 0x30, 0xf2, 0xc4, 0x82, 0x63, 0x20, 0x03, 0x64, 0x99, 0x66, 0x99, 0xf9, 0xb1, 0x72, 0xaf, 0xfe, 0xc0, 0xe7, 0x9e, 0x5c, 0x52, 0x3d, 0x1e, 0x77, 0x9e, 0xc0, 0x6d, 0xec, 0xd4, 0x76, 0xa5, 0x74, 0x30, 0x78, 0x1e, 0x2d, 0xc8, 0x1f, 0x25, 0xd6, 0x0d, 0x3a, 0x73, 0x97, 0x65, 0x79, 0xa2, 0xf0, 0x1f, 0x07, 0x58, 0x4c, 0xf8, 0xe5, 0xfb, 0x3e, 0xbd, 0x8d, 0x5a, 0x93, 0x2d, 0x57, 0xaa, 0x8a, 0x18, 0x0a, 0xaa } +, + /* Encryption */ + 129, + { 0x01, 0x3a, 0x3d, 0x32, 0xee, 0xc7, 0x35, 0xeb, 0xda, 0x13, 0xf8, 0xbe, 0x76, 0x02, 0xa0, 0x47, 0x5c, 0xf3, 0xcf, 0x28, 0x5b, 0x42, 0x86, 0xad, 0x93, 0xd6, 0x12, 0xc3, 0xad, 0x91, 0x72, 0x48, 0x80, 0x9d, 0x1c, 0x4c, 0x18, 0x0b, 0x36, 0x70, 0x15, 0xcc, 0x66, 0xc4, 0xd8, 0xe7, 0x86, 0x73, 0x84, 0x16, 0x8c, 0xf4, 0xcb, 0x71, 0x9b, 0xd5, 0x93, 0x35, 0x53, 0x55, 0xcd, 0xd7, 0xd7, 0x53, 0x0c, 0x80, 0xc8, 0x67, 0x74, 0x5f, 0x96, 0x61, 0xc6, 0xc3, 0x3b, 0xcb, 0x97, 0xf2, 0xcf, 0x75, 0xa4, 0xc2, 0x7c, 0x3c, 0xbb, 0xdb, 0xbe, 0x7e, 0xaf, 0x4f, 0x82, 0x34, 0xf2, 0x12, 0xe3, 0x05, 0x82, 0x56, 0xd4, 0x43, 0x9a, 0x9f, 0x97, 0x81, 0xdf, 0x48, 0xef, 0xdb, 0x02, 0x35, 0x68, 0xf9, 0x4a, 0xe4, 0x59, 0x46, 0x54, 0xa0, 0xf9, 0xba, 0xf6, 0xea, 0x30, 0xb7, 0xd8, 0xd9, 0x48, 0x0a, 0xd3 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.16", + /* Message */ + 17, + { 0x20, 0xf0, 0x20, 0x44, 0xe6, 0x3a, 0xc9, 0x2e, 0xb9, 0xfa, 0xf1, 0xa0, 0xce, 0x35, 0xba, 0x72, 0x09 } +, + /* Seed */ + 109, + { 0x2d, 0xe1, 0xfc, 0xc1, 0x17, 0xf8, 0x21, 0xf1, 0xde, 0xa7, 0x94, 0xb5, 0xee, 0xb3, 0x13, 0xf4, 0x29, 0xe0, 0x0b, 0x97, 0x6b, 0x53, 0x41, 0x9d, 0x3d, 0x03, 0xec, 0xaa, 0x1b, 0x50, 0x76, 0x88, 0x77, 0xe8, 0xb7, 0xfb, 0x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3, 0xc4, 0xb6, 0x27, 0x3d, 0x1b, 0x28, 0xa2, 0x13, 0xe1, 0x20, 0xb4, 0xf2, 0x42, 0x86, 0x96, 0x5e, 0xbe, 0xe9, 0x4f, 0xf8, 0x96 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.17", + /* Message */ + 3, + { 0xd3, 0x88, 0x3b } +, + /* Seed */ + 123, + { 0x5c, 0xa3, 0xbb, 0xf9, 0x92, 0xd7, 0xae, 0x35, 0x94, 0xc6, 0x05, 0xc3, 0x9c, 0x3e, 0x97, 0x90, 0x25, 0xcc, 0xb0, 0xa3, 0x5c, 0x6e, 0xf0, 0xfa, 0x57, 0x4a, 0x98, 0xbe, 0x05, 0xef, 0x7c, 0x32, 0x8a, 0x19, 0xa2, 0x77, 0x5b, 0xa0, 0x6f, 0x2d, 0xd1, 0xe0, 0xff, 0x6f, 0x0f, 0x1f, 0x6a, 0x3b, 0x20, 0xfb, 0xda, 0x21, 0x62, 0xd0, 0x92, 0x4f, 0xf5, 0x5b, 0x70, 0xeb, 0xfe, 0x2b, 0x16, 0xd4, 0xff, 0x6a, 0xef, 0x8d, 0x47, 0xeb, 0xe5, 0x96, 0x38, 0xe5, 0x81, 0x0f, 0xfd, 0xb5, 0x8d, 0xb0, 0x5f, 0x4d, 0x9b, 0x4a, 0x3a, 0x42, 0x3f, 0x96, 0x7f, 0xe5, 0x79, 0xf8, 0x73, 0x78, 0x36, 0x9d, 0x5c, 0x5c, 0x07, 0xe5, 0xe3, 0xcb, 0x5d, 0xdd, 0xf3, 0x89, 0x62, 0x11, 0x80, 0x27, 0x0a, 0x21, 0xe0, 0x10, 0x78, 0xc8, 0x9a, 0xfb, 0xab, 0x18, 0x9e, 0x87, 0xf7 } +, + /* Encryption */ + 129, + { 0x01, 0x6f, 0x55, 0x05, 0xf7, 0x4f, 0xf1, 0x10, 0x4d, 0xa1, 0xf8, 0xa5, 0x2e, 0x50, 0xbf, 0xe2, 0x9c, 0x99, 0x87, 0x10, 0xc5, 0x7d, 0xe4, 0x40, 0x98, 0xa9, 0x57, 0x9e, 0x7a, 0x33, 0x13, 0xb6, 0x29, 0x60, 0x31, 0x02, 0xf0, 0x8d, 0x2d, 0x91, 0x1f, 0x91, 0x7a, 0x9c, 0x96, 0x62, 0x60, 0x8c, 0x97, 0xa1, 0xea, 0x37, 0x17, 0x34, 0xf6, 0x7c, 0xbf, 0x70, 0x03, 0xd9, 0x3c, 0x4c, 0x31, 0x4c, 0x3a, 0x0e, 0x77, 0xf3, 0x65, 0x8f, 0xa4, 0xd0, 0x72, 0x25, 0x62, 0xc4, 0xe1, 0x3e, 0x85, 0xa7, 0xc8, 0xd0, 0xd9, 0xd4, 0xfb, 0xf7, 0x12, 0x58, 0x84, 0xba, 0x62, 0xad, 0x28, 0x59, 0xb4, 0xd9, 0x61, 0x36, 0xf7, 0xa2, 0x45, 0x54, 0x69, 0xce, 0xb6, 0x0b, 0x63, 0xba, 0x84, 0x74, 0xe6, 0x16, 0x0c, 0x83, 0x17, 0x92, 0x1a, 0x07, 0xb4, 0xb6, 0x43, 0x6f, 0x37, 0x6c, 0x5f, 0x98, 0x25, 0x7b, 0x17 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.18", + /* Message */ + 11, + { 0x06, 0xa2, 0xae, 0x82, 0xa4, 0x85, 0x32, 0x07, 0xc9, 0xf9, 0x75 } +, + /* Seed */ + 115, + { 0xe2, 0xc3, 0x36, 0x33, 0xd5, 0x47, 0x54, 0xad, 0xdd, 0x24, 0xc8, 0x5c, 0x32, 0xd2, 0x8a, 0xd8, 0x70, 0xf1, 0x60, 0x3d, 0x44, 0x44, 0x60, 0xa0, 0x3a, 0xac, 0xad, 0x7d, 0xcb, 0x80, 0x96, 0x01, 0x56, 0xbb, 0xb2, 0x59, 0xca, 0xd3, 0x46, 0xbe, 0x90, 0xc0, 0xd4, 0xf3, 0xfb, 0x18, 0xac, 0x6e, 0x9d, 0x5a, 0x9a, 0xe2, 0xa5, 0xab, 0x98, 0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 0x5f, 0x6c, 0xa7, 0x9a, 0x9e, 0xd6, 0x0f, 0x65 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.19", + /* Message */ + 6, + { 0xad, 0x8b, 0x11, 0xa9, 0x27, 0xde } +, + /* Seed */ + 120, + { 0x5e, 0xca, 0xcf, 0xf6, 0x3a, 0x79, 0x38, 0xe9, 0x98, 0x06, 0x8a, 0x2f, 0x4b, 0xa6, 0xbc, 0xc1, 0x02, 0x0e, 0x1f, 0x28, 0xc7, 0x34, 0xe4, 0x34, 0xe8, 0x86, 0x3c, 0x48, 0xe6, 0xdf, 0xfa, 0xe2, 0x8d, 0x18, 0x52, 0x72, 0x7f, 0xfa, 0x7f, 0x2e, 0xfa, 0x3d, 0xe7, 0x01, 0x3b, 0x81, 0x2a, 0x02, 0xb2, 0x17, 0x1a, 0x0f, 0x94, 0x0b, 0x36, 0xd9, 0x28, 0xdb, 0xdb, 0x96, 0x0a, 0x6b, 0x22, 0x03, 0x0c, 0x89, 0x37, 0x89, 0xcb, 0xfd, 0xea, 0x97, 0x35, 0xe9, 0xad, 0x10, 0x94, 0xa6, 0x84, 0x61, 0xc2, 0xeb, 0x6f, 0x71, 0x8b, 0xe4, 0x74, 0xd9, 0x3a, 0x51, 0x93, 0x0e, 0x3c, 0xda, 0x02, 0xc2, 0x1f, 0x63, 0x63, 0x91, 0x4e, 0x7e, 0xda, 0x54, 0x84, 0x03, 0x7a, 0x76, 0xad, 0xc5, 0x33, 0x12, 0xeb, 0x9d, 0xbb, 0xe4, 0x5e, 0x23, 0xa1, 0x4b } +, + /* Encryption */ + 129, + { 0x01, 0x1f, 0xa4, 0x3f, 0x5f, 0x4f, 0xbb, 0x98, 0x30, 0x11, 0x81, 0x4d, 0x4a, 0xf5, 0x45, 0x52, 0x1d, 0xf0, 0xb5, 0x9e, 0x9b, 0x6f, 0xfd, 0x71, 0x33, 0x3b, 0x8f, 0x9b, 0xba, 0xaa, 0x0f, 0xcd, 0xc1, 0x42, 0x1c, 0xe4, 0xbf, 0x31, 0xbf, 0x99, 0x59, 0xfd, 0xc6, 0xb0, 0x9b, 0x4f, 0x42, 0x51, 0xdd, 0xee, 0xe8, 0x21, 0x0f, 0xc3, 0xa5, 0x2f, 0xe7, 0xc7, 0x1a, 0x87, 0x6e, 0x6d, 0xde, 0x1d, 0xfb, 0x59, 0xa4, 0xda, 0xb2, 0x7d, 0x34, 0xfd, 0xce, 0x5b, 0xbf, 0xc6, 0xed, 0x62, 0x3e, 0x89, 0x96, 0x7f, 0xb6, 0xfe, 0x73, 0x16, 0x20, 0x15, 0x28, 0x2c, 0x5f, 0x45, 0x01, 0x38, 0xf2, 0x50, 0x4a, 0xb6, 0x1c, 0x1f, 0x12, 0xd2, 0x64, 0x9d, 0x81, 0x5d, 0x6e, 0x81, 0x38, 0x43, 0x8f, 0x8a, 0x80, 0x46, 0xc4, 0xe8, 0x40, 0xcb, 0x71, 0x85, 0x98, 0xe1, 0xe4, 0xa9, 0xfc, 0x25, 0xa9, 0x45, 0x64 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 7.20", + /* Message */ + 44, + { 0xbe, 0xe2, 0x94, 0x36, 0xc2, 0xa0, 0xde, 0x16, 0xf6, 0x60, 0x42, 0x91, 0x70, 0x07, 0xfb, 0x51, 0x30, 0xf3, 0xc1, 0xaa, 0x7d, 0xf2, 0xc7, 0xc3, 0xbd, 0x99, 0xfb, 0xc1, 0xb4, 0x13, 0xaf, 0x4f, 0x96, 0xa6, 0x5b, 0x0e, 0x54, 0x3e, 0xc6, 0xa5, 0x0b, 0xe8, 0x3a, 0x9f } +, + /* Seed */ + 82, + { 0x23, 0x91, 0xa6, 0x84, 0x25, 0xdd, 0x8f, 0x0b, 0x83, 0xc9, 0xb3, 0x61, 0x24, 0x67, 0xa7, 0x79, 0xcf, 0x92, 0xf5, 0xff, 0x96, 0x11, 0xc0, 0x14, 0x93, 0xbc, 0xbe, 0xf8, 0x65, 0xe1, 0x5b, 0xba, 0x5e, 0x8f, 0xcf, 0x74, 0xbe, 0xb9, 0xea, 0x25, 0x73, 0xa9, 0xfc, 0xe5, 0x41, 0x64, 0xd0, 0x6b, 0xaa, 0x8b, 0x6d, 0xf3, 0x67, 0xcc, 0x4c, 0x6a, 0x11, 0x4a, 0xa0, 0x34, 0x6c, 0x45, 0x4a, 0x2a, 0x9e, 0x60, 0x53, 0x59, 0x18, 0xd3, 0x66, 0x0c, 0x66, 0x48, 0x4e, 0xd9, 0x53, 0x72, 0x7a, 0x9c, 0x9a, 0x25 } +, + /* Encryption */ + 129, + { 0x00, 0x98, 0x9d, 0xdb, 0xd2, 0x8d, 0x60, 0x95, 0xad, 0xa6, 0x88, 0x1e, 0x28, 0x34, 0x1c, 0xe7, 0xa0, 0xa1, 0xca, 0x6b, 0xf7, 0xf3, 0x1f, 0x77, 0x2f, 0x91, 0x04, 0x93, 0xaf, 0xdb, 0xa2, 0xd6, 0x35, 0x9d, 0x50, 0xb9, 0x83, 0x3f, 0x83, 0xd0, 0xab, 0x87, 0x13, 0xab, 0xe8, 0xe2, 0x10, 0x2a, 0x27, 0xab, 0x2a, 0x60, 0x1f, 0xb7, 0x7b, 0x9a, 0x25, 0xd6, 0xa0, 0xaf, 0xf4, 0x0c, 0xfd, 0xcf, 0x9e, 0x12, 0xc4, 0x28, 0x43, 0xeb, 0xad, 0x32, 0x83, 0x24, 0xa7, 0x19, 0xf2, 0x9e, 0x8d, 0x79, 0xea, 0x9e, 0x5d, 0x0d, 0x98, 0x86, 0x95, 0x73, 0x60, 0x34, 0xdb, 0x5f, 0xea, 0x73, 0xdd, 0x36, 0x00, 0x13, 0x6f, 0x57, 0xa3, 0x98, 0xfe, 0x35, 0x2b, 0x27, 0x8c, 0x60, 0xcb, 0x74, 0xec, 0x98, 0xad, 0x57, 0xa3, 0xe1, 0xd8, 0xc4, 0x47, 0x8c, 0xa6, 0x17, 0x9f, 0x4d, 0x04, 0x26, 0xf0, 0xf4, 0x20 } + +} +, +} +}, +{ + "Example 8: A 1026-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x02, 0x52, 0xe9, 0x5b, 0xb1, 0x1b, 0xa1, 0xe1, 0xc7, 0xc9, 0x5b, 0x68, 0x53, 0xf8, 0xde, 0x0b, 0xfe, 0x2b, 0x64, 0x03, 0xac, 0x1b, 0xde, 0x81, 0x9d, 0x91, 0x89, 0x07, 0x74, 0x7b, 0x01, 0x99, 0xfa, 0xdb, 0x80, 0x59, 0xc2, 0x5a, 0xaf, 0x1a, 0xc5, 0x65, 0xa7, 0x49, 0x29, 0xd0, 0x15, 0xa2, 0x01, 0xf8, 0x97, 0xa9, 0xba, 0xfe, 0x75, 0x41, 0x68, 0x95, 0x5b, 0x35, 0x5b, 0xb0, 0x09, 0xce, 0x16, 0x14, 0x93, 0x12, 0x28, 0x3c, 0x39, 0xce, 0xe2, 0x20, 0xd0, 0xf0, 0x85, 0x8b, 0x13, 0x81, 0x2e, 0x86, 0xa7, 0xd4, 0xe5, 0x38, 0x8b, 0x7e, 0xae, 0x5a, 0xca, 0x7c, 0x88, 0x6a, 0x76, 0xd3, 0xb1, 0xe6, 0xdd, 0x67, 0x92, 0x68, 0xa8, 0x23, 0x11, 0xe2, 0x82, 0x03, 0x18, 0xcb, 0x8f, 0x0f, 0x7e, 0x85, 0xf0, 0xe6, 0x69, 0x2e, 0xb0, 0xde, 0xdf, 0x30, 0x88, 0x1c, 0xaf, 0x73, 0x15, 0xd2, 0x7d } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 129, + { 0x01, 0x04, 0xc8, 0x5f, 0xd5, 0xd8, 0xd7, 0x93, 0x2a, 0x29, 0x85, 0xc4, 0xcb, 0x7e, 0x9e, 0x13, 0xa2, 0xc4, 0xf1, 0x90, 0x3c, 0x8b, 0x70, 0xf3, 0xdf, 0x97, 0x12, 0xfa, 0xee, 0x20, 0x17, 0xb9, 0x20, 0x82, 0xc5, 0x16, 0x53, 0xc0, 0xbd, 0xde, 0x9d, 0xe6, 0x6c, 0x39, 0x01, 0xb7, 0xc2, 0x2b, 0xe4, 0xf2, 0x4c, 0xc5, 0x6d, 0xff, 0xaa, 0x75, 0xd4, 0x3b, 0x18, 0xa2, 0xe0, 0xc0, 0xdf, 0xe3, 0x72, 0x6b, 0x19, 0x8c, 0xaa, 0x0c, 0x96, 0x65, 0x26, 0x3a, 0x93, 0x79, 0x6a, 0x27, 0xd3, 0x29, 0x84, 0x46, 0x5f, 0x4b, 0x4a, 0xff, 0xca, 0x0d, 0x92, 0xf4, 0xe5, 0x1a, 0x37, 0xe4, 0x1a, 0xb1, 0x55, 0x07, 0x66, 0xd5, 0xca, 0x7e, 0x90, 0xd4, 0xde, 0x90, 0x9b, 0xbd, 0x79, 0x4e, 0x8b, 0xc5, 0x2b, 0x74, 0x99, 0xa7, 0x3e, 0x46, 0x8a, 0xb4, 0x42, 0x13, 0xcb, 0x3a, 0x3b, 0x54, 0x52, 0xd2, 0xff } +, + /* Prime 1 */ + 65, + { 0x01, 0x93, 0x3f, 0x8f, 0x85, 0x82, 0xb8, 0xff, 0xf3, 0xe6, 0xbd, 0x30, 0x42, 0x81, 0x97, 0xf0, 0xac, 0xec, 0x63, 0xe6, 0x91, 0xf7, 0x9b, 0x91, 0xfb, 0xd4, 0xd4, 0xc4, 0x94, 0x2b, 0x8a, 0xe9, 0x13, 0xa4, 0x01, 0xf0, 0xe1, 0x7b, 0xa7, 0x66, 0xd0, 0xa8, 0xee, 0xec, 0x4c, 0xb0, 0xe3, 0xda, 0x17, 0xb6, 0xd9, 0x1f, 0x1a, 0x74, 0x24, 0x88, 0x09, 0x20, 0x1e, 0x37, 0x30, 0x15, 0x18, 0x61, 0x8f } +, + /* Prime 2 */ + 65, + { 0x01, 0x79, 0xad, 0x28, 0x3c, 0xac, 0x68, 0xaf, 0x21, 0x6a, 0x06, 0x86, 0xf4, 0x38, 0xb1, 0xe0, 0xe5, 0xc3, 0x6b, 0x95, 0x5f, 0x74, 0xe1, 0x07, 0xf3, 0x9c, 0x0d, 0xdd, 0xcc, 0x99, 0x0a, 0xd5, 0x73, 0xdc, 0x48, 0xa9, 0x73, 0x23, 0x5b, 0x6d, 0x82, 0x54, 0x36, 0x18, 0xf2, 0xe9, 0x55, 0x10, 0x5d, 0x8c, 0x4a, 0x5f, 0x49, 0x14, 0xbe, 0xe2, 0x5d, 0xe3, 0xc6, 0x93, 0x41, 0xde, 0x07, 0xed, 0x33 } +, + /* Prime exponent 1 */ + 65, + { 0x01, 0x6e, 0xf5, 0x3d, 0x6f, 0x3a, 0xd9, 0x8d, 0x9a, 0x6f, 0xd4, 0xa4, 0x71, 0x31, 0x2b, 0x8a, 0x8a, 0x62, 0x88, 0x3a, 0xcf, 0x84, 0x6b, 0x5e, 0xfa, 0xb3, 0xe0, 0x77, 0x8f, 0x7a, 0xdc, 0x6b, 0x64, 0x43, 0x30, 0xbc, 0xfb, 0x04, 0xa2, 0xff, 0x0e, 0x4d, 0x5d, 0x37, 0x4e, 0x46, 0xfe, 0xe2, 0x7e, 0x08, 0x18, 0x27, 0x94, 0xd4, 0x32, 0x56, 0x55, 0x2f, 0x94, 0x2f, 0x96, 0xa2, 0xeb, 0xd0, 0x03 } +, + /* Prime exponent 2 */ + 64, + { 0xe6, 0xc6, 0xe6, 0x25, 0x5c, 0xfc, 0x82, 0xb7, 0x1a, 0x40, 0x6e, 0xca, 0x60, 0xb2, 0x60, 0xc8, 0x45, 0x07, 0x42, 0x39, 0x18, 0x04, 0x41, 0x85, 0x9c, 0x3f, 0xe4, 0xde, 0x16, 0x4e, 0x46, 0x6c, 0x0b, 0x98, 0xe2, 0xe2, 0x16, 0x22, 0xd1, 0xe1, 0xa7, 0x6f, 0x7f, 0x03, 0x3f, 0x8c, 0xd8, 0xf9, 0x30, 0xb6, 0x69, 0x4f, 0x10, 0xbc, 0x2b, 0x3a, 0x4f, 0xea, 0x91, 0x24, 0xd8, 0x75, 0x63, 0x7d } +, + /* Coefficient */ + 64, + { 0x35, 0x42, 0x45, 0x2e, 0x83, 0x2c, 0x16, 0xac, 0xf9, 0xc3, 0xf4, 0x13, 0x49, 0x23, 0x5e, 0xdd, 0xd2, 0x75, 0xc7, 0x05, 0x3c, 0x55, 0x3b, 0xf8, 0x9e, 0x1a, 0x84, 0x57, 0x12, 0x48, 0x33, 0x3a, 0xad, 0x52, 0x0e, 0x3a, 0x34, 0x46, 0xc4, 0xc5, 0xe3, 0xfd, 0xd9, 0xba, 0xec, 0xd9, 0x29, 0x48, 0x0e, 0xb5, 0xb8, 0xfb, 0xef, 0x8e, 0x03, 0xad, 0xe9, 0xe3, 0x9a, 0x28, 0xfd, 0x8e, 0x75, 0x6c } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 8.1", + /* Message */ + 34, + { 0xf7, 0x26, 0x37, 0xae, 0xc2, 0x8d, 0x2b, 0x6e, 0xbf, 0x8f, 0x73, 0xd7, 0x48, 0x75, 0xdf, 0x01, 0xcd, 0x12, 0x24, 0x8f, 0x00, 0x20, 0x60, 0x8e, 0x61, 0xc7, 0x3d, 0x1a, 0x01, 0xf9, 0x72, 0xf7, 0x4d, 0xee } +, + /* Seed */ + 92, + { 0xcc, 0x20, 0x77, 0xa2, 0x40, 0x01, 0xf3, 0xe3, 0x86, 0x96, 0x94, 0xe4, 0xfe, 0x27, 0x72, 0xbf, 0x93, 0x8f, 0x76, 0x27, 0x66, 0x7b, 0x62, 0xd5, 0x90, 0xf9, 0xee, 0x4f, 0xcf, 0xff, 0xbb, 0xb4, 0x7a, 0xfd, 0x5f, 0xed, 0x6a, 0x18, 0x08, 0x44, 0xa9, 0x12, 0x1a, 0x32, 0xed, 0x7c, 0xbc, 0x56, 0xcd, 0x28, 0x70, 0xa2, 0xd6, 0x96, 0xb9, 0x43, 0xd6, 0xfd, 0xe9, 0x76, 0x7c, 0x1b, 0x96, 0x48, 0x61, 0x6c, 0x32, 0xed, 0x6c, 0x40, 0x0d, 0x42, 0x3d, 0xd4, 0xab, 0x72, 0x16, 0xaf, 0xad, 0xa0, 0x28, 0x40, 0x2e, 0xb2, 0xa1, 0xc3, 0xeb, 0xcc, 0x24, 0x5a, 0xfc, 0x7f } +, + /* Encryption */ + 129, + { 0x00, 0x72, 0x57, 0x5d, 0x3b, 0x11, 0xc5, 0xff, 0xd6, 0xae, 0x24, 0xf3, 0x53, 0xff, 0x74, 0x99, 0x27, 0xb4, 0xae, 0x5d, 0xf4, 0x63, 0xf7, 0x0c, 0x5f, 0x3e, 0xf5, 0x49, 0x6b, 0x0d, 0x14, 0x5e, 0xb2, 0xb8, 0xa5, 0x3c, 0x28, 0xd5, 0x3e, 0xfe, 0x8b, 0xf9, 0xf2, 0x7b, 0x2e, 0xf4, 0xce, 0xea, 0x48, 0x31, 0x05, 0x77, 0xc3, 0xd2, 0xb4, 0xb9, 0x49, 0xa1, 0x2e, 0x3d, 0xf3, 0xf5, 0x67, 0x76, 0x82, 0x88, 0x18, 0x45, 0x2d, 0x81, 0xbd, 0x45, 0xaf, 0x15, 0x8c, 0x87, 0xbb, 0x57, 0x74, 0x5b, 0x8a, 0x10, 0xfc, 0x1a, 0x92, 0xa0, 0xea, 0x55, 0xc8, 0x51, 0x39, 0xf8, 0x42, 0xf7, 0x3f, 0x1d, 0x61, 0x3b, 0x9a, 0x96, 0x4a, 0xf8, 0xed, 0x72, 0x0d, 0x0e, 0x08, 0x47, 0xf7, 0xae, 0x5b, 0x30, 0x5c, 0x05, 0xf1, 0x2c, 0xbc, 0x4c, 0x9c, 0x16, 0x84, 0xac, 0xf9, 0x02, 0x97, 0x0d, 0x82, 0x09, 0x49 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.2", + /* Message */ + 60, + { 0x2a, 0x8e, 0x3e, 0xe7, 0xea, 0xc6, 0xb2, 0x2e, 0xc6, 0x58, 0xad, 0x44, 0xd6, 0x66, 0xc8, 0xcd, 0x3f, 0x57, 0xec, 0xea, 0x29, 0x9b, 0x5c, 0xb7, 0xbf, 0x9a, 0x37, 0x3d, 0xfa, 0x66, 0x97, 0x2f, 0x13, 0xe5, 0xf3, 0xa3, 0x00, 0xe8, 0x0e, 0x6d, 0xbf, 0x74, 0x15, 0x68, 0x0d, 0x0d, 0x24, 0x90, 0x1a, 0xd6, 0xb1, 0x40, 0xb0, 0x00, 0xaa, 0xb8, 0x53, 0x51, 0xf9, 0x2f } +, + /* Seed */ + 66, + { 0xfb, 0x19, 0x20, 0x9d, 0x8a, 0x29, 0xaf, 0xaf, 0xbc, 0x05, 0x3a, 0xc1, 0xf3, 0x20, 0xba, 0x60, 0xfc, 0x1f, 0xe1, 0x04, 0xaa, 0x78, 0x39, 0xc8, 0x4c, 0x9b, 0x3e, 0xaa, 0x18, 0xa8, 0xf9, 0x43, 0xbb, 0x21, 0x9f, 0x59, 0xcc, 0x16, 0x7a, 0x38, 0x4b, 0xac, 0x7b, 0xd3, 0x65, 0x82, 0x4e, 0x10, 0x36, 0x31, 0xb9, 0x7b, 0xb9, 0xa6, 0xd1, 0x18, 0xf4, 0xf0, 0xa9, 0x51, 0xfa, 0x47, 0x8a, 0x05, 0xea, 0x09 } +, + /* Encryption */ + 129, + { 0x02, 0x1b, 0x54, 0x64, 0x65, 0x71, 0xa9, 0xa9, 0x3f, 0x0b, 0x0a, 0x03, 0x82, 0xe5, 0x40, 0xa8, 0xc3, 0x97, 0x4c, 0xb3, 0x1c, 0x87, 0xeb, 0xf1, 0x7b, 0x3b, 0xa6, 0x2a, 0x1c, 0x95, 0x21, 0xc5, 0x0d, 0x7f, 0x90, 0x70, 0x2e, 0x13, 0xae, 0x0e, 0x22, 0x26, 0x38, 0x34, 0xe7, 0x64, 0x60, 0x35, 0x15, 0x94, 0x45, 0xa0, 0x87, 0x7d, 0x9a, 0x4f, 0x5b, 0x16, 0x17, 0x7f, 0x7f, 0xe0, 0x52, 0xbb, 0xd0, 0x23, 0xd0, 0x81, 0x89, 0x4f, 0x2d, 0x97, 0xca, 0xc2, 0x45, 0x20, 0x76, 0xca, 0x11, 0x91, 0xa1, 0x71, 0xa4, 0x8f, 0xa1, 0xcb, 0xbb, 0xc3, 0xf0, 0xf6, 0xf3, 0xbc, 0x1a, 0x44, 0x78, 0x40, 0x3a, 0x5a, 0x48, 0x8f, 0xeb, 0xb3, 0xa4, 0x13, 0x80, 0x16, 0x3d, 0x94, 0x2c, 0x97, 0x7b, 0xb8, 0xec, 0xd2, 0x86, 0x6c, 0x5f, 0x5d, 0x91, 0x9e, 0xd2, 0x0c, 0x0d, 0xb3, 0xee, 0x31, 0xef, 0x2f, 0x51 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.3", + /* Message */ + 24, + { 0xd9, 0x9b, 0x4f, 0x10, 0xd9, 0xf3, 0x2e, 0x12, 0xec, 0xfa, 0xe2, 0x63, 0x0b, 0x22, 0xac, 0x02, 0x6a, 0xf9, 0x64, 0xb9, 0xc7, 0x15, 0xd2, 0x07 } +, + /* Seed */ + 102, + { 0xe0, 0xaf, 0x8b, 0x7e, 0xab, 0x36, 0xa6, 0xee, 0x31, 0x6d, 0x78, 0x13, 0x67, 0xf0, 0x9e, 0xa1, 0x1e, 0x31, 0xfd, 0xc1, 0xef, 0x2c, 0xf9, 0xc9, 0x7c, 0x37, 0x9e, 0xaa, 0xcf, 0x68, 0x72, 0xa8, 0x21, 0x3c, 0xbe, 0x4c, 0xe2, 0xe2, 0x9c, 0x77, 0x8b, 0x35, 0x95, 0x40, 0x10, 0x06, 0x3f, 0x17, 0x76, 0xab, 0x5b, 0x17, 0x2d, 0xa6, 0x24, 0xb4, 0x06, 0xa1, 0xc5, 0x8e, 0x0b, 0x57, 0x4a, 0x03, 0xb1, 0xb1, 0xb2, 0xcd, 0x7d, 0x3a, 0x9e, 0x50, 0x35, 0xa9, 0xa9, 0x73, 0x05, 0x8f, 0x04, 0x97, 0x65, 0x2d, 0x2f, 0x73, 0xb1, 0xdc, 0x8f, 0x48, 0x7c, 0x09, 0xcf, 0xe7, 0x1d, 0x8f, 0xf8, 0xf1, 0x45, 0x8c, 0x79, 0x0e, 0xe0, 0xc5 } +, + /* Encryption */ + 129, + { 0x01, 0x02, 0x3b, 0xbe, 0x85, 0x57, 0xc2, 0x63, 0x0a, 0x26, 0x22, 0x46, 0xdb, 0x7a, 0xbc, 0x54, 0x03, 0x43, 0x88, 0x70, 0x38, 0xf6, 0x4c, 0x64, 0x1f, 0xd7, 0x4e, 0xe8, 0x74, 0xae, 0x96, 0x70, 0xfb, 0x28, 0x62, 0xd4, 0x24, 0x70, 0x3d, 0xa2, 0x0b, 0xe4, 0xf4, 0x8b, 0x23, 0x9c, 0xd0, 0x60, 0x43, 0x81, 0x9d, 0x8f, 0x61, 0x51, 0x44, 0xe2, 0xb1, 0xf0, 0x0c, 0x8f, 0x88, 0x49, 0x2e, 0x62, 0xf6, 0xe0, 0x73, 0x16, 0xf8, 0x49, 0x05, 0x35, 0x3b, 0x0b, 0x18, 0x80, 0xed, 0x77, 0xda, 0x2b, 0x62, 0xd3, 0xa9, 0x3b, 0xb7, 0x0f, 0xf6, 0xa5, 0x00, 0x79, 0x38, 0xb9, 0x73, 0xb4, 0xcd, 0x5a, 0xbf, 0xee, 0x0c, 0xf1, 0x3f, 0x5d, 0x4a, 0xb2, 0x16, 0x01, 0x02, 0x68, 0x5c, 0xac, 0x80, 0x81, 0x83, 0x4f, 0x95, 0x55, 0x80, 0x6b, 0xb3, 0x22, 0xd0, 0xdc, 0x5b, 0x8a, 0x2b, 0xf1, 0x28, 0x45, 0x62 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.4", + /* Message */ + 25, + { 0xca, 0xec, 0xa8, 0xe5, 0x9b, 0x81, 0x0c, 0xf7, 0x51, 0x12, 0xf7, 0xed, 0x04, 0x7a, 0x46, 0x69, 0x2c, 0xa0, 0xb7, 0xa8, 0x6e, 0x18, 0x41, 0xd7, 0x19 } +, + /* Seed */ + 101, + { 0x76, 0x1f, 0x68, 0x64, 0xdc, 0xeb, 0xc9, 0x5a, 0x77, 0x9b, 0xc0, 0xb1, 0x6a, 0x95, 0x86, 0x6c, 0x33, 0xdc, 0x8d, 0xca, 0xce, 0x61, 0xcd, 0x7b, 0xf9, 0x01, 0x72, 0xd9, 0x9a, 0xa4, 0x57, 0xdb, 0x6d, 0x90, 0x88, 0x7d, 0x84, 0xc4, 0x73, 0x8d, 0x25, 0xcd, 0xf0, 0xe8, 0x95, 0x69, 0xae, 0x47, 0xd3, 0x07, 0x3e, 0xc4, 0x46, 0xee, 0xed, 0xd5, 0x2d, 0x57, 0x20, 0x8b, 0xdb, 0x69, 0x45, 0x57, 0x03, 0x46, 0x57, 0xa7, 0x03, 0x78, 0x49, 0x37, 0xba, 0x69, 0x4d, 0x42, 0x51, 0x21, 0x38, 0x53, 0x2b, 0x8a, 0xd1, 0xd9, 0x86, 0xfe, 0x47, 0x31, 0x8b, 0x28, 0x23, 0xde, 0x82, 0xce, 0x27, 0x6f, 0xa6, 0xf0, 0xd3, 0xc8, 0xef } +, + /* Encryption */ + 129, + { 0x01, 0x1c, 0x0c, 0x03, 0xf7, 0xb6, 0xe1, 0xc1, 0xa8, 0x41, 0x17, 0x40, 0xa6, 0xe5, 0xb4, 0x73, 0xc2, 0x8d, 0x62, 0x21, 0x17, 0x6c, 0x9d, 0x4f, 0x68, 0x02, 0x4c, 0xa5, 0x7c, 0xda, 0x27, 0x3a, 0xf5, 0x54, 0x74, 0x03, 0x60, 0x99, 0x0a, 0x1b, 0x74, 0xde, 0x34, 0xbc, 0xea, 0x10, 0x3c, 0x2d, 0x0c, 0x36, 0x57, 0x60, 0x02, 0x08, 0x0b, 0x30, 0xbd, 0x28, 0xf0, 0x76, 0xfb, 0x75, 0xfc, 0x9b, 0xeb, 0x9e, 0x05, 0xd1, 0x98, 0x9a, 0x31, 0x1d, 0x12, 0xc1, 0xf2, 0x8f, 0xd6, 0x93, 0x92, 0xad, 0x4b, 0xe5, 0x2c, 0xe3, 0x89, 0xde, 0xc1, 0x1e, 0xba, 0x94, 0x6b, 0xe0, 0x59, 0x91, 0xda, 0x7f, 0xd8, 0x87, 0xa8, 0xd8, 0x76, 0x8d, 0xe7, 0x36, 0xb9, 0x05, 0xbf, 0x4b, 0xdb, 0xe8, 0x8b, 0x85, 0xdf, 0xc3, 0xb2, 0x5a, 0xea, 0x30, 0xfe, 0x90, 0xdf, 0x1d, 0x22, 0xd8, 0xa8, 0xd6, 0x15, 0x65, 0x1c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.5", + /* Message */ + 39, + { 0x10, 0x12, 0x12, 0x85, 0x6e, 0x60, 0xcd, 0x27, 0x2f, 0xb1, 0x69, 0xcf, 0x62, 0xcf, 0x47, 0xf1, 0xbc, 0x50, 0xef, 0x9f, 0x1f, 0xcf, 0xd2, 0x14, 0x81, 0x6c, 0x80, 0x7f, 0x18, 0x4a, 0x90, 0x3f, 0x16, 0xf0, 0xe8, 0x09, 0xac, 0xf5, 0xe0 } +, + /* Seed */ + 87, + { 0x60, 0x43, 0xc8, 0xdf, 0x6a, 0x7f, 0x4a, 0xb8, 0x3e, 0x31, 0x97, 0xe8, 0xcd, 0x02, 0x25, 0xdc, 0x38, 0x66, 0xb5, 0xd8, 0xe6, 0x99, 0x3c, 0x2c, 0xc5, 0xb8, 0x76, 0x35, 0x1e, 0xe3, 0x3c, 0x71, 0xc1, 0xa4, 0xcc, 0xdc, 0xe4, 0x5f, 0x3e, 0x9d, 0xc7, 0xb7, 0xe5, 0x1b, 0x52, 0xee, 0xbe, 0x0e, 0x27, 0x0e, 0x71, 0x62, 0x07, 0xca, 0x14, 0x03, 0xe1, 0x3e, 0x72, 0x3c, 0xe7, 0x3f, 0x10, 0x45, 0x5e, 0xdb, 0xde, 0x85, 0xb0, 0x82, 0x90, 0x52, 0xed, 0xaf, 0xe5, 0x6e, 0x9a, 0x22, 0x02, 0x4d, 0x40, 0x68, 0x37, 0x1d, 0x36, 0xc9, 0x1f } +, + /* Encryption */ + 129, + { 0x00, 0x05, 0xc5, 0xcf, 0xf8, 0x9b, 0x93, 0x3d, 0x8b, 0x65, 0x23, 0xb3, 0x59, 0x06, 0xbb, 0x3a, 0x71, 0x1a, 0x0f, 0x7f, 0x50, 0x3f, 0x92, 0x14, 0x74, 0x66, 0x59, 0x85, 0x03, 0x91, 0x27, 0x30, 0x3b, 0x00, 0x11, 0xe7, 0xa4, 0x2b, 0x41, 0xc3, 0x3b, 0xd2, 0x0d, 0xb3, 0x1b, 0x15, 0x60, 0xc9, 0xb5, 0x22, 0x20, 0x89, 0xcd, 0xcf, 0x53, 0xb8, 0x2c, 0x95, 0xf8, 0xc1, 0xad, 0xcd, 0x8b, 0x78, 0x3f, 0xd4, 0xb4, 0x8a, 0x45, 0x40, 0x20, 0x66, 0x8e, 0x0b, 0x62, 0x52, 0x0e, 0x52, 0x58, 0x52, 0x09, 0xdb, 0x52, 0x9f, 0x38, 0x70, 0x86, 0x49, 0xd8, 0xe0, 0x64, 0x89, 0x0b, 0x22, 0x8f, 0xb3, 0xc1, 0x98, 0x1b, 0x2a, 0xef, 0x3a, 0x54, 0x65, 0xce, 0xb1, 0x30, 0x21, 0xeb, 0xe0, 0x8d, 0x02, 0xe3, 0x3a, 0xa2, 0xdc, 0x3c, 0x39, 0x28, 0x4e, 0xf7, 0xa8, 0x58, 0xdc, 0xce, 0xb2, 0x8f, 0xfa, 0x28 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.6", + /* Message */ + 17, + { 0x6f, 0x03, 0xb5, 0x72, 0x52, 0x30, 0xde, 0x7f, 0x99, 0x63, 0x69, 0x8e, 0xdb, 0x79, 0x75, 0xec, 0xe8 } +, + /* Seed */ + 109, + { 0xa3, 0x0e, 0xe5, 0xae, 0xab, 0x59, 0x31, 0x03, 0x3e, 0xfb, 0x70, 0xaf, 0xbc, 0x2d, 0x3d, 0x11, 0xa6, 0x33, 0x84, 0xcb, 0x8c, 0xb3, 0x3a, 0x8f, 0xca, 0xe6, 0x14, 0x66, 0x84, 0xe6, 0x3f, 0x0c, 0xc3, 0x2e, 0x89, 0xa7, 0xe4, 0xea, 0x43, 0x32, 0x7b, 0xf0, 0x35, 0x66, 0x95, 0x43, 0x19, 0x28, 0x86, 0xde, 0xc3, 0xfb, 0x4e, 0x2d, 0x08, 0x11, 0xef, 0xa9, 0xae, 0xc5, 0x10, 0x9e, 0x31, 0xb6, 0xa0, 0x56, 0xe5, 0x3e, 0x31, 0x7f, 0x6a, 0x90, 0x4b, 0x13, 0xa7, 0x35, 0x6f, 0x5e, 0x7a, 0xe6, 0x0b, 0x97, 0x21, 0x5e, 0xd1, 0x48, 0x17, 0xd2, 0x8f, 0x74, 0xb1, 0x64, 0x0b, 0x1f, 0x2e, 0x42, 0xef, 0x0d, 0x38, 0xca, 0x35, 0xa3, 0x54, 0xa0, 0xaf, 0xef, 0xa8, 0x03, 0xa4 } +, + /* Encryption */ + 129, + { 0x00, 0x10, 0xbd, 0x2b, 0x35, 0x6f, 0x9e, 0xab, 0xc2, 0x2f, 0x7e, 0x68, 0xf7, 0x2f, 0x61, 0x75, 0xf9, 0xab, 0x9d, 0xed, 0xa9, 0x64, 0x23, 0xb7, 0x4b, 0x11, 0xde, 0x82, 0xc6, 0x07, 0xa1, 0x38, 0x86, 0x3e, 0x17, 0x96, 0x6c, 0x07, 0xf5, 0x6c, 0xde, 0x9e, 0xd6, 0xbc, 0x42, 0x2e, 0xd9, 0xfe, 0xaa, 0x1f, 0x65, 0x36, 0x7c, 0xcf, 0x91, 0xcd, 0x4c, 0x91, 0x58, 0xa7, 0x49, 0x57, 0x1a, 0x0e, 0x9f, 0x96, 0x07, 0xcb, 0x48, 0xcd, 0x00, 0xa4, 0x48, 0xde, 0x03, 0x64, 0x91, 0x06, 0xce, 0x0c, 0x24, 0x06, 0xaa, 0x50, 0xaa, 0x12, 0x17, 0x17, 0x8c, 0xdb, 0x06, 0x80, 0x1c, 0x70, 0xa8, 0x9a, 0x7a, 0x1a, 0x83, 0x06, 0x8e, 0x68, 0xdb, 0x95, 0xd2, 0x4c, 0xa3, 0xdb, 0x33, 0xa7, 0xe5, 0xe4, 0x3a, 0x68, 0x15, 0x22, 0x74, 0xbb, 0xbf, 0x40, 0x06, 0xd9, 0xfb, 0x69, 0xf0, 0x51, 0x4c, 0xc9, 0xe2 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.7", + /* Message */ + 9, + { 0x87, 0x99, 0x13, 0x04, 0x54, 0x61, 0xbc, 0x0e, 0xac } +, + /* Seed */ + 117, + { 0xc3, 0xc6, 0xa2, 0x4a, 0xc3, 0x40, 0xa4, 0xa3, 0xff, 0x3b, 0x2c, 0x30, 0x2b, 0x56, 0xeb, 0x83, 0x91, 0xbb, 0xd9, 0x5f, 0xaf, 0xb6, 0x64, 0x78, 0x38, 0x44, 0x38, 0xab, 0xd8, 0xb4, 0x5d, 0x13, 0x2b, 0x26, 0x99, 0x09, 0xb1, 0x87, 0x84, 0x0a, 0x68, 0x44, 0xad, 0x39, 0x9f, 0xa8, 0x13, 0x72, 0x05, 0xe0, 0x2c, 0xca, 0xe7, 0x77, 0x5c, 0xe6, 0x66, 0x21, 0x20, 0xe1, 0x54, 0xb7, 0xbf, 0xd3, 0x0e, 0x8e, 0xa4, 0xd3, 0x4a, 0x7d, 0xb6, 0xa2, 0x34, 0x88, 0xa5, 0xda, 0xea, 0x38, 0x08, 0x5b, 0xed, 0x56, 0x78, 0x0c, 0xff, 0x87, 0x27, 0x12, 0x5f, 0x1a, 0xd5, 0xf9, 0xd5, 0xa0, 0xbc, 0x3b, 0xe5, 0x80, 0xbc, 0x4f, 0xa0, 0x68, 0x26, 0x7b, 0x27, 0xde, 0x38, 0x3c, 0x55, 0xc7, 0xfc, 0x17, 0x64, 0xc8, 0x6a, 0xc2, 0x1a } +, + /* Encryption */ + 129, + { 0x01, 0xd2, 0x1e, 0xce, 0x33, 0xf4, 0x40, 0xc7, 0x2a, 0x11, 0x1d, 0x62, 0xef, 0x48, 0x6c, 0x77, 0xc6, 0xc8, 0x90, 0xcd, 0x81, 0xa4, 0xeb, 0x05, 0x32, 0xad, 0x2c, 0x0e, 0xc7, 0x68, 0xdd, 0x1d, 0xe5, 0xb2, 0x11, 0x2f, 0xdf, 0x04, 0xe2, 0x87, 0xa9, 0x5b, 0x95, 0x0b, 0x1f, 0xca, 0x5a, 0xe6, 0x93, 0xcf, 0x0e, 0x8a, 0xcc, 0x93, 0x6f, 0x37, 0x47, 0x14, 0xde, 0x74, 0x95, 0x90, 0x8c, 0x29, 0x15, 0xa7, 0x07, 0x21, 0x3a, 0xc3, 0xdb, 0xda, 0xba, 0xd8, 0x1b, 0x4b, 0xa1, 0xcb, 0x50, 0xb9, 0x5f, 0x93, 0x14, 0x53, 0x1f, 0xec, 0x83, 0x3f, 0x08, 0x21, 0xc0, 0x4b, 0x57, 0x40, 0xd7, 0x3b, 0x8c, 0xf1, 0xf9, 0xe3, 0xd7, 0xab, 0xc9, 0x74, 0x49, 0x26, 0x13, 0x8f, 0xb0, 0x15, 0xc0, 0xf0, 0x56, 0xcc, 0x4b, 0xa2, 0xf3, 0x16, 0x37, 0x34, 0xdb, 0x44, 0x3e, 0xbd, 0x68, 0x85, 0x8c, 0x4f, 0xa6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.8", + /* Message */ + 1, + { 0x5b } +, + /* Seed */ + 125, + { 0x42, 0xb9, 0x99, 0xfb, 0x16, 0x3a, 0x6f, 0xfa, 0x67, 0xa9, 0xbc, 0x4e, 0x6b, 0xa1, 0x2f, 0x81, 0xb1, 0xd5, 0x6e, 0x54, 0xbf, 0x08, 0x66, 0x39, 0x7f, 0xd3, 0x14, 0xeb, 0x0c, 0xf9, 0x7f, 0x13, 0xb7, 0x80, 0x4f, 0x76, 0x8f, 0xba, 0x54, 0x06, 0x21, 0xf0, 0x5c, 0xd3, 0x72, 0x64, 0xd8, 0xe8, 0xf5, 0x82, 0x28, 0xfb, 0x6a, 0xb3, 0x0e, 0xf5, 0x4e, 0x30, 0xfa, 0x8c, 0xfc, 0xb5, 0xa8, 0x7e, 0x14, 0x8f, 0xba, 0xbf, 0x85, 0x88, 0x6a, 0xb1, 0xf0, 0x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+, +{ + "PKCS#1 v1.5 Encryption Example 8.9", + /* Message */ + 50, + { 0xf6, 0x35, 0x29, 0x90, 0x13, 0x24, 0xa2, 0x0f, 0xe5, 0xe9, 0x25, 0x8a, 0xda, 0x2f, 0x95, 0x37, 0xb0, 0x1f, 0x58, 0x39, 0xb4, 0x45, 0x97, 0xe3, 0x29, 0x3a, 0x12, 0x25, 0xca, 0x3a, 0x2a, 0xdf, 0x68, 0x4a, 0x72, 0xa7, 0x93, 0xc6, 0x9c, 0x56, 0xaf, 0x2d, 0x34, 0x98, 0xd3, 0x2a, 0x09, 0x2e, 0x91, 0x4b } +, + /* Seed */ + 76, + { 0x7b, 0xfa, 0x85, 0x97, 0xa4, 0x34, 0xcd, 0xad, 0xfe, 0x15, 0x63, 0x14, 0x44, 0x95, 0x13, 0xd7, 0x6c, 0x10, 0x5d, 0xf1, 0xbf, 0xc4, 0x8c, 0x4d, 0x07, 0x6a, 0xbf, 0xc0, 0x5b, 0x5d, 0xda, 0x72, 0xe0, 0xdd, 0x15, 0xf9, 0xfe, 0x82, 0xa9, 0x95, 0x5b, 0xd5, 0x6d, 0x33, 0x43, 0xe7, 0xc6, 0xf2, 0x5a, 0x60, 0x74, 0x12, 0x07, 0xe7, 0x3a, 0x2d, 0x10, 0xbb, 0x95, 0xd1, 0xd7, 0x29, 0xa2, 0x27, 0x93, 0xe6, 0xc4, 0x55, 0xe9, 0x16, 0x23, 0x5a, 0x81, 0x16, 0x94, 0xdb } +, + /* Encryption */ + 129, + { 0x00, 0xad, 0xf4, 0x78, 0x74, 0x67, 0xea, 0xc2, 0xea, 0x61, 0xfe, 0x7e, 0xf8, 0x2f, 0xd8, 0x7c, 0x2d, 0xa5, 0x89, 0x9f, 0x30, 0x30, 0x2b, 0xbc, 0x11, 0x27, 0x86, 0xd2, 0xfb, 0x11, 0xc1, 0x42, 0xf3, 0xf1, 0xd8, 0xcf, 0x37, 0x16, 0x0d, 0x2e, 0x4a, 0x43, 0x98, 0x3f, 0xfb, 0xd3, 0x93, 0xa4, 0x1b, 0x59, 0x9e, 0xe6, 0xa2, 0x7e, 0x24, 0x64, 0x25, 0x50, 0x2d, 0x46, 0x90, 0x20, 0x2f, 0xe5, 0xf8, 0xee, 0x1b, 0xc6, 0xc1, 0xd5, 0xd1, 0x6b, 0xe2, 0x3b, 0x97, 0x3a, 0xed, 0xf7, 0xf9, 0x11, 0x1b, 0xd8, 0xb1, 0x42, 0x84, 0x42, 0x65, 0xfd, 0x93, 0x57, 0x7a, 0x43, 0xc3, 0xac, 0xc6, 0xe2, 0xaf, 0x20, 0x89, 0xd9, 0xd2, 0xf3, 0xf3, 0x1a, 0x5c, 0x24, 0x7a, 0x7b, 0x68, 0x31, 0x5b, 0xae, 0x25, 0xd5, 0xae, 0x81, 0x40, 0xa5, 0x1f, 0xfc, 0x00, 0x97, 0x10, 0x7e, 0xc1, 0x62, 0x0a, 0xb3, 0xb5 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.10", + /* Message */ + 32, + { 0xc6, 0xd1, 0x4b, 0x04, 0x71, 0x45, 0xf3, 0x17, 0x78, 0x1d, 0xd7, 0x38, 0x2d, 0xc0, 0xa9, 0x72, 0x57, 0xd5, 0x54, 0xbb, 0x53, 0x53, 0x9e, 0xe9, 0xa2, 0x92, 0xe7, 0xda, 0x5c, 0xb6, 0x42, 0x6f } +, + /* Seed */ + 94, + { 0x01, 0xff, 0x38, 0xd5, 0xde, 0xd6, 0xc4, 0x3d, 0xc1, 0xdc, 0x5c, 0x27, 0xa7, 0xe4, 0x81, 0x3f, 0x44, 0x8f, 0x45, 0xc9, 0x6e, 0xdf, 0x4b, 0xd9, 0x3e, 0x96, 0xfa, 0xda, 0x9b, 0xc8, 0xec, 0x5b, 0x43, 0x4f, 0x06, 0x19, 0xa3, 0x8e, 0x04, 0x35, 0x6e, 0x06, 0x27, 0x85, 0x51, 0x40, 0x7b, 0x7f, 0x37, 0xe4, 0x2d, 0x91, 0x45, 0x62, 0x0a, 0x81, 0x98, 0x18, 0x50, 0xa4, 0x9e, 0x28, 0x51, 0x17, 0x2d, 0x23, 0x0b, 0x37, 0x82, 0x41, 0x10, 0xf8, 0xff, 0xdb, 0x84, 0x77, 0x94, 0x63, 0x9d, 0x26, 0x50, 0xcb, 0xed, 0x36, 0x26, 0x01, 0x05, 0xf1, 0xf1, 0x29, 0x6e, 0x52, 0xa7, 0xd4 } +, + /* Encryption */ + 129, + { 0x00, 0x5e, 0xdc, 0x93, 0x97, 0x89, 0xcf, 0xbf, 0xaa, 0xff, 0x28, 0x2b, 0xaf, 0x97, 0x01, 0xd6, 0x1f, 0x9d, 0xbe, 0xe6, 0xf2, 0xd2, 0x06, 0xcf, 0xab, 0x77, 0x57, 0x61, 0xf4, 0x2c, 0xb2, 0x74, 0xec, 0xba, 0x31, 0xc7, 0xcd, 0x2f, 0xe6, 0x03, 0x1a, 0xba, 0x0b, 0x84, 0xd4, 0x62, 0x7d, 0x30, 0x37, 0xe3, 0x1c, 0xe7, 0xe1, 0x56, 0x23, 0xba, 0x7c, 0xb7, 0x69, 0x02, 0x51, 0xc0, 0x63, 0x27, 0xa4, 0x31, 0x37, 0x12, 0x98, 0xdf, 0x29, 0x21, 0x95, 0xb6, 0x45, 0x11, 0x62, 0xd2, 0xda, 0x92, 0xa7, 0x07, 0x8e, 0x2d, 0x07, 0xc9, 0xf5, 0x6a, 0x07, 0x06, 0x8a, 0x9a, 0x3e, 0x17, 0x3e, 0x4a, 0xae, 0x25, 0xa5, 0xd1, 0xc6, 0x8e, 0x68, 0x20, 0x8c, 0xb5, 0x25, 0x3a, 0x0a, 0x53, 0xaa, 0x6e, 0x2e, 0xf6, 0xc2, 0x95, 0xd1, 0x51, 0x65, 0x69, 0xb8, 0x62, 0xcb, 0x92, 0xca, 0x82, 0x3c, 0xcb, 0xab } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.11", + /* Message */ + 63, + { 0xc1, 0x16, 0x53, 0xe8, 0x10, 0xb5, 0x3e, 0x65, 0x11, 0xf1, 0x33, 0x23, 0xfe, 0x52, 0x26, 0xa1, 0x70, 0xc2, 0x1f, 0x6d, 0xaa, 0x44, 0x29, 0xd9, 0x68, 0xef, 0xda, 0x05, 0x29, 0xd7, 0xb6, 0xe1, 0x0d, 0xce, 0xd8, 0x0c, 0x6b, 0x63, 0x01, 0xde, 0xd2, 0x2f, 0x52, 0x91, 0x1c, 0x0f, 0x7f, 0xf4, 0x53, 0x5b, 0xd5, 0xe2, 0x0f, 0xf5, 0x35, 0x88, 0xcd, 0x3d, 0xe6, 0x64, 0x8a, 0xc0, 0x2d } +, + /* Seed */ + 63, + { 0x85, 0xfa, 0x7c, 0x6c, 0xe9, 0x6d, 0x0a, 0x8a, 0x1f, 0xba, 0x75, 0x04, 0x71, 0x7c, 0xcb, 0xe1, 0x37, 0x13, 0x80, 0x93, 0x95, 0x6e, 0xff, 0x06, 0x3f, 0xc2, 0xef, 0xd4, 0xa4, 0x6d, 0x7d, 0xc7, 0x4e, 0x90, 0xf1, 0xda, 0x9e, 0x43, 0xdb, 0xa9, 0x12, 0x9f, 0x14, 0xec, 0x55, 0x9a, 0x4d, 0x2d, 0x6c, 0x5a, 0x19, 0xcb, 0xf3, 0xa6, 0x8c, 0x62, 0xd0, 0x98, 0x34, 0x52, 0xa9, 0xee, 0x0c } +, + /* Encryption */ + 129, + { 0x01, 0xb0, 0x8d, 0x49, 0x83, 0x13, 0xa7, 0xd7, 0x4a, 0x05, 0x53, 0x14, 0xeb, 0x43, 0x15, 0xba, 0x02, 0x87, 0x60, 0xda, 0xd4, 0x11, 0x14, 0xd5, 0x94, 0x2d, 0x63, 0xbf, 0x8d, 0x27, 0xbe, 0x3f, 0x49, 0xcc, 0xd9, 0x4a, 0xcf, 0x9d, 0x3a, 0xa2, 0x2d, 0x09, 0xb9, 0x9b, 0xf9, 0x74, 0x09, 0xbc, 0xf3, 0x32, 0x13, 0xc0, 0x99, 0x67, 0x07, 0x86, 0x82, 0x03, 0xa9, 0xab, 0x27, 0x70, 0x8d, 0x3f, 0xff, 0x69, 0xb8, 0x9d, 0x02, 0xe3, 0x6e, 0x01, 0x21, 0xa1, 0x19, 0xb8, 0xd4, 0xd9, 0xbf, 0xd4, 0xfe, 0x8b, 0x16, 0x8f, 0xd7, 0xc1, 0x2a, 0x24, 0x3f, 0x7a, 0x00, 0x0b, 0x39, 0xbf, 0x8d, 0x56, 0x48, 0x17, 0x24, 0x20, 0x80, 0x23, 0xbb, 0x60, 0x7b, 0x30, 0x50, 0x5d, 0xd1, 0x74, 0x2f, 0x87, 0x9f, 0x16, 0xc1, 0x0c, 0xe4, 0x90, 0xd3, 0x4a, 0x68, 0x0d, 0x27, 0xac, 0x39, 0x60, 0x7d, 0xa2, 0x4e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.12", + /* Message */ + 50, + { 0x09, 0x5b, 0x77, 0xc9, 0x4d, 0xc1, 0xb1, 0x87, 0x88, 0xe4, 0x00, 0xe6, 0x91, 0x6a, 0x4b, 0x4c, 0xfd, 0x73, 0xac, 0xe0, 0xdf, 0x9a, 0x3a, 0xc1, 0x31, 0xbd, 0xf9, 0xad, 0x0a, 0x12, 0xdb, 0x76, 0x6d, 0xeb, 0x22, 0x53, 0x59, 0xd9, 0x01, 0xcd, 0x56, 0xed, 0x88, 0xcd, 0xa3, 0xd3, 0x28, 0x56, 0x54, 0x02 } +, + /* Seed */ + 76, + { 0xa3, 0x4a, 0x68, 0x05, 0x55, 0x71, 0x09, 0xc2, 0x61, 0xdd, 0xdf, 0x5f, 0x85, 0xd3, 0x71, 0xae, 0x65, 0x20, 0xf4, 0x5a, 0xdf, 0x46, 0x96, 0x01, 0xb5, 0xc3, 0x59, 0xfe, 0xc7, 0x44, 0xcb, 0x2a, 0xae, 0x80, 0x98, 0x3c, 0x73, 0x2d, 0xb6, 0xc5, 0x45, 0xdf, 0x55, 0xe0, 0x20, 0x8a, 0xcf, 0xbb, 0xf1, 0xc2, 0xc5, 0xe7, 0x99, 0x88, 0xf3, 0x4e, 0xcd, 0x6e, 0x5b, 0xb4, 0xb5, 0x25, 0xc1, 0xb8, 0xbc, 0xb0, 0x70, 0xd0, 0xd8, 0x42, 0x48, 0xb1, 0xf8, 0xe7, 0x48, 0x0e } +, + /* Encryption */ + 129, + { 0x00, 0x39, 0x56, 0x36, 0xa8, 0x26, 0x67, 0xdc, 0xf0, 0x0d, 0x5d, 0xbd, 0xd8, 0x54, 0x12, 0x06, 0x94, 0x8d, 0x49, 0x36, 0x89, 0x17, 0xec, 0x0e, 0x00, 0xfd, 0x7a, 0xc5, 0xca, 0x8b, 0xf4, 0x4e, 0xc5, 0x83, 0x78, 0x38, 0x6e, 0x59, 0x4b, 0xc0, 0x65, 0xa9, 0xa6, 0x3c, 0xf2, 0xa3, 0x55, 0xa6, 0x08, 0xb6, 0xf0, 0xba, 0xcb, 0xa5, 0x60, 0x08, 0xbb, 0xa4, 0x72, 0x2a, 0x7c, 0x47, 0x05, 0x45, 0xa2, 0x0f, 0x38, 0x78, 0x53, 0xd4, 0x60, 0x31, 0x3b, 0x2e, 0x86, 0x4e, 0x17, 0xb2, 0x33, 0xe5, 0x96, 0x35, 0x41, 0x32, 0xaf, 0x17, 0x3b, 0x4d, 0x04, 0x49, 0x26, 0x47, 0x79, 0x02, 0x62, 0xd3, 0xa4, 0x3f, 0x84, 0x27, 0x37, 0x88, 0x37, 0x46, 0x6b, 0x06, 0x73, 0xa8, 0x15, 0x27, 0xe6, 0xbe, 0x10, 0x45, 0x80, 0x32, 0x6f, 0xec, 0x84, 0xba, 0x37, 0x1e, 0xa6, 0x10, 0x91, 0xfa, 0x40, 0x33, 0xa4 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.13", + /* Message */ + 1, + { 0x38 } +, + /* Seed */ + 125, + { 0x54, 0x7c, 0x91, 0x75, 0x19, 0x05, 0xd5, 0xa2, 0x84, 0xac, 0x3f, 0xe4, 0x32, 0xcb, 0xe0, 0x30, 0x55, 0xb2, 0x85, 0x06, 0x58, 0x96, 0x11, 0x0e, 0xa3, 0x6d, 0x05, 0xa1, 0x40, 0x08, 0x3c, 0xe3, 0x95, 0x5f, 0xa8, 0x28, 0x41, 0xea, 0xf6, 0xdb, 0x4a, 0x50, 0xd1, 0x2c, 0x07, 0x4f, 0x45, 0xa6, 0x88, 0xb5, 0x57, 0x6d, 0x6e, 0x61, 0x68, 0x07, 0x54, 0x0a, 0xc1, 0x17, 0x58, 0x5c, 0x5b, 0xc3, 0xbe, 0x52, 0x60, 0x72, 0x7c, 0xdf, 0x12, 0x3c, 0x77, 0x4d, 0xb4, 0x0c, 0xff, 0x29, 0x70, 0x88, 0x62, 0x48, 0x53, 0xe4, 0x69, 0x51, 0x36, 0xb9, 0x31, 0x16, 0x15, 0x17, 0xa7, 0xb9, 0xb5, 0xdd, 0xcd, 0x9d, 0x32, 0xde, 0x3d, 0xfe, 0x3e, 0xe2, 0xea, 0x68, 0x8c, 0xf7, 0xbf, 0x88, 0x2c, 0xcf, 0x7b, 0x9c, 0x48, 0xd5, 0xe1, 0x9e, 0xff, 0xa6, 0x50, 0x4a, 0x42, 0x62, 0x0b } +, + /* Encryption */ + 129, + { 0x00, 0x89, 0xe3, 0x9d, 0xcf, 0xdf, 0x91, 0x69, 0x3d, 0xef, 0xe3, 0x9d, 0x12, 0xbb, 0x25, 0xf8, 0x0a, 0x76, 0x8d, 0x44, 0x1b, 0x48, 0x1d, 0x6a, 0x75, 0x48, 0x69, 0x50, 0x42, 0x48, 0x0c, 0xd4, 0xa0, 0xba, 0x97, 0x83, 0xd5, 0xc5, 0xbd, 0x38, 0x89, 0x6d, 0xce, 0x06, 0xac, 0xb1, 0x77, 0xa4, 0xac, 0x59, 0x68, 0xe6, 0x55, 0xa7, 0xaa, 0xf5, 0x0d, 0x69, 0x4a, 0x64, 0x97, 0x13, 0xb7, 0xa4, 0xbd, 0xd1, 0x4c, 0x81, 0x9f, 0x83, 0xb2, 0x04, 0x7d, 0xe2, 0x19, 0x5f, 0x73, 0x03, 0x66, 0x54, 0x53, 0xa8, 0xa1, 0x11, 0x5e, 0x5b, 0x48, 0xac, 0x0e, 0x9a, 0x65, 0xed, 0xdb, 0x31, 0x89, 0x51, 0x7b, 0x04, 0x6f, 0xcb, 0xc2, 0xd1, 0x43, 0x81, 0x77, 0x6a, 0x77, 0xfb, 0x46, 0x8e, 0x11, 0x29, 0x3c, 0x78, 0xc8, 0x37, 0x4c, 0x8f, 0x46, 0x60, 0x35, 0x1a, 0xc2, 0xb2, 0xc7, 0x84, 0x5a, 0x25, 0xfe } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.14", + /* Message */ + 42, + { 0x80, 0x64, 0x6b, 0x3c, 0x4d, 0xf0, 0xeb, 0x79, 0x1b, 0xda, 0x0c, 0xcc, 0x4d, 0x97, 0xd8, 0x1e, 0xa8, 0xf6, 0xf7, 0x4e, 0xb2, 0x45, 0xe2, 0xc7, 0xc3, 0x48, 0xfd, 0x7f, 0xb9, 0x90, 0x16, 0xa9, 0xd4, 0x0a, 0x60, 0x5a, 0xc7, 0x42, 0xb2, 0x7a, 0xd2, 0x48 } +, + /* Seed */ + 84, + { 0x11, 0xb8, 0xe7, 0x98, 0xd7, 0xa1, 0x42, 0xd0, 0x82, 0xe0, 0x59, 0x8a, 0x8c, 0xb4, 0xf8, 0xc2, 0xaa, 0x87, 0x5d, 0x5b, 0x65, 0x17, 0x8c, 0x4e, 0xe6, 0x7a, 0x5c, 0xb8, 0x41, 0xd1, 0xcd, 0xa3, 0x04, 0x31, 0xd0, 0x20, 0xdf, 0x28, 0x80, 0xd7, 0x93, 0x58, 0x15, 0xd5, 0x9d, 0x91, 0xb9, 0x99, 0x3e, 0x53, 0xac, 0x34, 0x1c, 0x97, 0x28, 0x61, 0xea, 0xa2, 0x66, 0x97, 0xcf, 0x10, 0xca, 0x8b, 0x27, 0x94, 0xb4, 0x53, 0x03, 0xbe, 0x03, 0x48, 0x9e, 0xbe, 0x07, 0x4d, 0x8f, 0x23, 0x98, 0x54, 0xc3, 0xa6, 0x06, 0xfb } +, + /* Encryption */ + 129, + { 0x01, 0xf1, 0xe5, 0xa3, 0xdb, 0xd8, 0x24, 0x75, 0x2d, 0x2f, 0xba, 0x3c, 0x32, 0x42, 0xe9, 0xd9, 0x96, 0xe6, 0x27, 0x43, 0x0d, 0x49, 0x3e, 0x1b, 0x44, 0x6a, 0x2d, 0xbc, 0xd8, 0x6a, 0x48, 0x09, 0x3e, 0x37, 0xa2, 0xe1, 0x28, 0xb2, 0x8c, 0x49, 0xd2, 0xd1, 0x72, 0xbf, 0x5a, 0x97, 0x7c, 0x36, 0x9b, 0xaa, 0x9f, 0xfb, 0x83, 0x9b, 0xd2, 0xfd, 0xf0, 0x0b, 0xd3, 0x0f, 0xf5, 0x22, 0x8b, 0x57, 0x6b, 0x94, 0xe6, 0xd8, 0xec, 0xf9, 0x44, 0x24, 0x7a, 0xda, 0xd0, 0x19, 0xf2, 0x1d, 0x06, 0xfb, 0xe4, 0x18, 0xd3, 0xa6, 0xd5, 0x4c, 0xdf, 0x11, 0x3e, 0x8d, 0x14, 0xf6, 0xea, 0x06, 0xd8, 0xdb, 0x79, 0x64, 0x93, 0xbc, 0xb1, 0x89, 0x6f, 0xc4, 0xf3, 0xf3, 0x03, 0x86, 0xc5, 0xc8, 0xba, 0xb7, 0x03, 0x7c, 0x87, 0x9a, 0xfe, 0xa4, 0x7c, 0x8f, 0xb7, 0xa3, 0xc5, 0xb5, 0x0b, 0x29, 0x18, 0x66, 0xb9 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.15", + /* Message */ + 9, + { 0x6b, 0x63, 0x1c, 0x7c, 0x35, 0xea, 0x75, 0xa1, 0xb0 } +, + /* Seed */ + 117, + { 0x3e, 0x42, 0x40, 0xc3, 0xe0, 0x9e, 0xa7, 0x83, 0x55, 0x35, 0x8c, 0xda, 0x61, 0x29, 0x53, 0x47, 0x30, 0xf4, 0x8a, 0x9c, 0x9a, 0x1a, 0x52, 0x13, 0x28, 0x4b, 0xfd, 0x07, 0x71, 0x21, 0x6a, 0xd4, 0xca, 0x23, 0x3d, 0x99, 0x3e, 0xe6, 0x35, 0x7f, 0x4b, 0x1b, 0x12, 0xa6, 0xba, 0xa1, 0x77, 0x43, 0x13, 0x4a, 0x85, 0x7f, 0xd7, 0x69, 0xa8, 0xbc, 0x78, 0xd6, 0x1f, 0xb1, 0x4f, 0xea, 0x05, 0x22, 0x1d, 0xcf, 0x5a, 0xeb, 0x1a, 0xff, 0xd4, 0x0d, 0x8b, 0xc6, 0x94, 0x5c, 0x30, 0x10, 0x45, 0xb6, 0x86, 0xc6, 0x11, 0xfa, 0x43, 0x7e, 0x30, 0xca, 0x0f, 0xab, 0x5a, 0x4c, 0xde, 0xf5, 0x20, 0x5b, 0xaf, 0x99, 0x26, 0xc6, 0x07, 0xbe, 0x96, 0x37, 0xb1, 0x50, 0x7f, 0x50, 0x83, 0xe9, 0x40, 0xcc, 0xfa, 0x2f, 0xb3, 0x86, 0x19 } +, + /* Encryption */ + 129, + { 0x00, 0x47, 0xcb, 0x9a, 0x91, 0x98, 0xd9, 0x83, 0xb3, 0x22, 0x24, 0xcf, 0x27, 0xfc, 0x72, 0x99, 0xbb, 0xd4, 0xae, 0x07, 0x78, 0xa8, 0x3f, 0xc5, 0x9c, 0x47, 0x45, 0xfa, 0x99, 0xe9, 0x17, 0xbb, 0x74, 0xf8, 0xbd, 0x4e, 0xf1, 0x3f, 0x14, 0x0c, 0xa9, 0xb7, 0x2e, 0x2a, 0xa1, 0x74, 0xce, 0xea, 0x26, 0x48, 0x94, 0xe2, 0x15, 0xf4, 0x1c, 0x36, 0xd4, 0xe6, 0xf3, 0x46, 0xf6, 0x9b, 0x4f, 0x85, 0x50, 0x5c, 0x54, 0xcd, 0x46, 0x25, 0x9c, 0x71, 0x2e, 0x30, 0xc4, 0x92, 0x94, 0xba, 0xdb, 0x1c, 0x47, 0x16, 0x85, 0x1f, 0x2b, 0x75, 0xe3, 0x96, 0x12, 0xcd, 0x54, 0x66, 0xba, 0x56, 0xe3, 0xf3, 0x15, 0x99, 0xc2, 0xdc, 0xe2, 0x3d, 0x04, 0xc9, 0x3a, 0x64, 0x40, 0x22, 0x27, 0xdf, 0x40, 0xb5, 0x14, 0xc7, 0x4d, 0x0a, 0xa3, 0x6e, 0x1e, 0x86, 0x58, 0xe2, 0x92, 0x77, 0xb3, 0x05, 0xaf, 0x35, 0x15 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.16", + /* Message */ + 53, + { 0x40, 0x08, 0x55, 0xda, 0x54, 0xa6, 0xd1, 0xfe, 0x5f, 0xb5, 0x8a, 0x73, 0xd2, 0xa5, 0xe5, 0x58, 0x38, 0x70, 0xfb, 0xd5, 0x25, 0xd2, 0xf5, 0x72, 0xad, 0xb5, 0x96, 0x30, 0x06, 0xd0, 0xa1, 0x33, 0x9b, 0xea, 0x88, 0x9d, 0x6d, 0x46, 0xa4, 0x37, 0x62, 0xf5, 0x13, 0xbb, 0x7c, 0xc0, 0x36, 0x22, 0xbf, 0x85, 0x92, 0x44, 0xd6 } +, + /* Seed */ + 73, + { 0x49, 0x6e, 0x50, 0xba, 0xb5, 0xef, 0x18, 0xf2, 0x2c, 0x3f, 0x62, 0xb9, 0x21, 0x14, 0x8d, 0x36, 0xc1, 0x01, 0xad, 0x0a, 0x9a, 0x20, 0x38, 0x67, 0x58, 0x08, 0xce, 0x8b, 0x62, 0xf8, 0xa6, 0xa0, 0xba, 0x8d, 0x91, 0x05, 0xf9, 0x2e, 0xd8, 0xa0, 0x2b, 0x31, 0x2f, 0x32, 0x4f, 0x3f, 0xd3, 0x91, 0x92, 0xbd, 0x41, 0x53, 0x78, 0x4f, 0xb5, 0x59, 0x05, 0xc3, 0xb6, 0x69, 0x30, 0x7b, 0xad, 0xa8, 0x27, 0xaf, 0xa1, 0xb5, 0xcb, 0x3d, 0xc1, 0x1d, 0xc4 } +, + /* Encryption */ + 129, + { 0x00, 0xd3, 0xa8, 0x5d, 0xec, 0x97, 0xd3, 0x44, 0x88, 0xee, 0x33, 0xc6, 0x58, 0xba, 0x18, 0x8e, 0x64, 0xcb, 0x57, 0x83, 0x7d, 0x2e, 0xdd, 0xbc, 0xba, 0x8e, 0xe5, 0x2f, 0x13, 0xf1, 0xe4, 0xfe, 0x9b, 0xec, 0x2f, 0x92, 0xe7, 0x21, 0x09, 0x87, 0xe1, 0xc3, 0xfe, 0x34, 0x5d, 0x40, 0x19, 0x77, 0x0b, 0x07, 0x74, 0x94, 0x51, 0xb0, 0x4d, 0x67, 0x30, 0xd5, 0x3a, 0x91, 0x01, 0x5b, 0x25, 0x7e, 0x81, 0x0d, 0xae, 0x0a, 0x0c, 0x11, 0x6a, 0x4f, 0x22, 0x45, 0x14, 0xed, 0xbd, 0x39, 0xb2, 0xc6, 0x5e, 0x15, 0x2d, 0x3b, 0x97, 0x89, 0xdd, 0xa4, 0xf0, 0xd4, 0x5b, 0xf9, 0x83, 0x2d, 0x27, 0x9d, 0x34, 0x31, 0x06, 0x2b, 0x4d, 0xe1, 0xb0, 0x67, 0x7e, 0xf5, 0x9c, 0x6c, 0x33, 0x27, 0x68, 0xec, 0xda, 0x3a, 0xa6, 0xbc, 0xd1, 0x0f, 0x70, 0xbd, 0x06, 0x03, 0x0a, 0x76, 0x65, 0xed, 0x3f, 0x20, 0x79 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.17", + /* Message */ + 48, + { 0xb8, 0x7e, 0xdb, 0x45, 0x5a, 0x7e, 0x85, 0x53, 0x9f, 0x92, 0x8e, 0xda, 0xe9, 0x09, 0xfb, 0xf8, 0xf7, 0xa1, 0x99, 0xc0, 0x3a, 0x94, 0xa9, 0xa4, 0x5a, 0xca, 0xb2, 0x5e, 0xfa, 0xee, 0xcc, 0x26, 0x29, 0x74, 0xca, 0xe0, 0xbb, 0x72, 0x24, 0x3a, 0x99, 0xc6, 0x47, 0x20, 0x79, 0xf1, 0x97, 0x38 } +, + /* Seed */ + 78, + { 0x03, 0x5e, 0x31, 0x59, 0x4a, 0x56, 0x65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 0x30, 0x1a, 0x4d, 0xdd, 0x50, 0x51, 0x6f, 0x16, 0xa5, 0xfb, 0x78, 0xf3, 0x95, 0x99, 0x00, 0xdb, 0xcc, 0xa1, 0xf2 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.18", + /* Message */ + 38, + { 0x30, 0x2a, 0xc8, 0x0e, 0x30, 0xc6, 0x55, 0x3e, 0x93, 0x59, 0xdf, 0x85, 0xb1, 0xe2, 0x4a, 0x16, 0xc8, 0x62, 0xa2, 0x0f, 0xf4, 0xfd, 0x9d, 0x5f, 0x14, 0x6b, 0xe2, 0x81, 0xdc, 0x30, 0x66, 0xae, 0xb8, 0xfa, 0x00, 0xb5, 0x2a, 0x99 } +, + /* Seed */ + 88, + { 0x32, 0x6c, 0x99, 0x35, 0x8c, 0x4e, 0x5f, 0xa4, 0xd2, 0xc0, 0x43, 0xf0, 0x2f, 0x92, 0x70, 0x5f, 0x79, 0x1c, 0xf7, 0x12, 0xbc, 0x01, 0x04, 0x5b, 0x4c, 0xf3, 0x49, 0xb4, 0x2a, 0xe5, 0xac, 0xfa, 0xc3, 0x78, 0x38, 0x11, 0xbb, 0xf0, 0x7f, 0x34, 0xbd, 0x6c, 0x85, 0x19, 0x55, 0xcb, 0xa4, 0xa8, 0xb2, 0xa7, 0xd1, 0x39, 0xa7, 0x8b, 0xc4, 0xd8, 0x8e, 0x3a, 0x88, 0xe6, 0xc4, 0xcf, 0x49, 0x4e, 0x6a, 0x4a, 0x52, 0x35, 0x41, 0x45, 0xe1, 0x18, 0x83, 0xcb, 0x5c, 0x78, 0xb5, 0x72, 0xf3, 0x0a, 0x51, 0xed, 0x23, 0xf2, 0x56, 0x4b, 0x69, 0x60 } +, + /* Encryption */ + 129, + { 0x02, 0x03, 0x29, 0x87, 0xcc, 0xf7, 0x5a, 0x63, 0x86, 0x24, 0x17, 0x80, 0x64, 0xdb, 0xa4, 0xb7, 0x2b, 0xe5, 0x39, 0xe0, 0x7e, 0xcd, 0xf5, 0x30, 0x03, 0x56, 0xcc, 0x43, 0xd7, 0x29, 0xfe, 0x34, 0xfb, 0x35, 0xbb, 0xbf, 0x5a, 0x32, 0x17, 0x2c, 0xe3, 0x9e, 0xa1, 0xfb, 0x47, 0xd3, 0x8e, 0x49, 0x7a, 0x03, 0xb6, 0x01, 0xee, 0xaf, 0xda, 0xaf, 0x99, 0xa3, 0x4f, 0xd7, 0x21, 0x18, 0x4a, 0xf2, 0xe1, 0x8e, 0x83, 0xd0, 0x50, 0xa4, 0x10, 0x8b, 0x15, 0xe5, 0xe3, 0xa2, 0x7e, 0x0e, 0x63, 0x6d, 0xf8, 0xd9, 0x4f, 0x98, 0x16, 0x58, 0xeb, 0xde, 0xcd, 0xab, 0x0d, 0xef, 0xcc, 0x0d, 0xaf, 0x3a, 0xc9, 0xa2, 0x7b, 0x3f, 0x22, 0xa0, 0x54, 0x1d, 0x35, 0x00, 0x27, 0x52, 0xe9, 0xcc, 0x4f, 0xb2, 0x58, 0x2f, 0xae, 0x25, 0x11, 0xa1, 0x32, 0xec, 0x5c, 0x22, 0x8a, 0x88, 0x72, 0xbd, 0xba, 0xd6, 0x87 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.19", + /* Message */ + 43, + { 0x00, 0xb3, 0x82, 0x01, 0x74, 0x6d, 0xca, 0xf4, 0x03, 0x48, 0xaf, 0x57, 0xba, 0xd7, 0x25, 0x70, 0xca, 0xf5, 0xa2, 0x85, 0x5f, 0xec, 0x6c, 0x42, 0xee, 0x22, 0xdc, 0xfe, 0x64, 0xc9, 0x97, 0xec, 0x62, 0xa5, 0xc9, 0x75, 0x62, 0x4b, 0xbd, 0x1f, 0x8e, 0xc9, 0x16 } +, + /* Seed */ + 83, + { 0x93, 0x91, 0x05, 0xc0, 0x04, 0xc0, 0x1a, 0xa9, 0xf4, 0x74, 0x46, 0xd3, 0xcc, 0xf5, 0x30, 0xe9, 0xb2, 0x17, 0x4c, 0x50, 0xae, 0xbc, 0xa0, 0xa9, 0x5c,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9, 0x91, 0x1d, 0xcb, 0x7f, 0x24 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 8.20", + /* Message */ + 26, + { 0xba, 0x28, 0x33, 0x66, 0x04, 0x76, 0xd8, 0x73, 0x15, 0x07, 0x66, 0x9f, 0x50, 0x29, 0x8c, 0x2c, 0x68, 0xd4, 0x4c, 0x53, 0xe3, 0xd0, 0xa8, 0x03, 0x78, 0x6e } +, + /* Seed */ + 100, + { 0x86, 0xce, 0x8e, 0x92, 0xad, 0x88, 0xb1, 0x46, 0x2a, 0x17, 0x1a, 0xf2, 0x8b, 0x4e, 0x99, 0x08, 0x8c, 0x04, 0x98, 0xa2, 0x9b, 0x4c, 0xa5, 0xe6, 0x6f, 0x64, 0xf8, 0x6a, 0xde, 0xc7, 0xf9, 0x64, 0xe8, 0xeb, 0x82, 0x57, 0xc5, 0xc0, 0x1c, 0xda, 0x16, 0x5e, 0x0f, 0x75, 0x11, 0xdb, 0x14, 0x7c, 0x10, 0xbc, 0x07, 0x51, 0x5f, 0x04, 0xf0, 0x5f, 0x52, 0xd2, 0xbc, 0x89, 0x22, 0x83, 0x57, 0xc6, 0x61, 0xb4, 0x3f, 0x43, 0xd5, 0x42, 0xdb, 0xe7, 0x78, 0x34, 0x09, 0x1c, 0x7c, 0xe7, 0x0b, 0x18, 0x2e, 0x19, 0xbc, 0x93, 0x6c, 0x30, 0x68, 0x4a, 0x83, 0x1e, 0x2c, 0x3b, 0x8a, 0x4a, 0x74, 0x46, 0x3f, 0x0c, 0x9f, 0x1b } +, + /* Encryption */ + 129, + { 0x01, 0x12, 0xac, 0x28, 0x98, 0xa2, 0x5c, 0x13, 0x28, 0x79, 0x1f, 0xc9, 0x6a, 0x82, 0xb7, 0x29, 0x18, 0xb5, 0x1a, 0x66, 0x8c, 0x54, 0x0b, 0xcf, 0xfc, 0x8e, 0x0b, 0x3a, 0xaf, 0xe2, 0x05, 0xee, 0x87, 0x1f, 0x5e, 0xb7, 0x6a, 0xd1, 0x16, 0xd3, 0x04, 0xcc, 0x04, 0x42, 0xbd, 0xb1, 0xaf, 0x5b, 0x9a, 0x63, 0x45, 0x82, 0x7e, 0x67, 0x8e, 0x40, 0xe3, 0x3f, 0xc8, 0x58, 0xef, 0x6c, 0x45, 0x6b, 0xe4, 0x36, 0x52, 0xbb, 0x2e, 0xbc, 0x39, 0x64, 0xb4, 0xbf, 0x4a, 0x93, 0xa8, 0xee, 0xef, 0x84, 0x04, 0xae, 0xf1, 0xa0, 0x44, 0x41, 0x5a, 0x15, 0x6f, 0x7c, 0xfd, 0x79, 0x95, 0xac, 0x25, 0xe7, 0xb0, 0x30, 0x26, 0x69, 0x8e, 0x14, 0x48, 0x9e, 0xfc, 0xc1, 0xae, 0x92, 0x96, 0x58, 0xbb, 0x66, 0x3d, 0xe0, 0xac, 0x44, 0xa7, 0xa5, 0x5c, 0xaa, 0x0b, 0x0b, 0x20, 0x34, 0xc2, 0xaa, 0xec, 0x13, 0x4e } + +} +, +} +}, +{ + "Example 9: A 1027-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x06, 0x8e, 0xf0, 0xb2, 0x74, 0x15, 0x7d, 0x7b, 0x5e, 0xc7, 0x29, 0x03, 0x86, 0x59, 0x56, 0x18, 0x3e, 0x0e, 0x34, 0x62, 0xec, 0xd2, 0x21, 0x14, 0xca, 0xd4, 0xc7, 0xba, 0xac, 0x94, 0xc7, 0xc2, 0xc5, 0xe6, 0xcb, 0xdf, 0xa2, 0xab, 0xfe, 0xaf, 0x8d, 0x23, 0x18, 0x2e, 0x9c, 0x08, 0x81, 0x5d, 0x10, 0x0d, 0x8e, 0x8f, 0x62, 0x1d, 0x3c, 0xd4, 0xaf, 0xbb, 0x99, 0x85, 0x96, 0x6f, 0xd6, 0xa4, 0x18, 0x2b, 0x59, 0x90, 0x88, 0xa3, 0x5d, 0x77, 0xfe, 0x01, 0x78, 0xac, 0xf7, 0x53, 0x1c, 0x70, 0xd8, 0x96, 0xff, 0x78, 0x8e, 0xdc, 0x82, 0x06, 0x05, 0x40, 0xef, 0xef, 0xd9, 0xf3, 0xc2, 0x4d, 0x5b, 0xe6, 0x9a, 0xf7, 0xf2, 0xf4, 0x44, 0x85, 0xb1, 0x91, 0x18, 0xa4, 0x68, 0x81, 0x4f, 0xc5, 0x13, 0xe3, 0xa1, 0xce, 0xd6, 0x77, 0x91, 0xf9, 0x03, 0x6e, 0xee, 0x56, 0xfa, 0x9e, 0x20, 0x60, 0x2b } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x71, 0x94, 0x0b, 0xe6, 0x79, 0x7b, 0xb3, 0x28, 0x5e, 0xbd, 0xc2, 0x0c, 0xc9, 0x27, 0x5f, 0x5d, 0x77, 0x55, 0x88, 0xe9, 0xaf, 0x6f, 0x68, 0x7a, 0x2e, 0x39, 0xd2, 0xc1, 0x91, 0x11, 0x10, 0x76, 0x95, 0xdd, 0xed, 0xe3, 0x91, 0xd2, 0x19, 0x6b, 0x29, 0x58, 0x1d, 0xf3, 0x15, 0x4a, 0x37, 0x12, 0xfa, 0x6f, 0xcd, 0xf8, 0x5b, 0xb4, 0xfd, 0x48, 0x64, 0x1f, 0x07, 0x1f, 0xfd, 0xb1, 0xde, 0x08, 0xa1, 0xd5, 0x92, 0x1c, 0xa1, 0x0e, 0x68, 0xdc, 0x04, 0x13, 0x13, 0xc9, 0xbb, 0xcb, 0x80, 0x81, 0xbd, 0xb5, 0xd4, 0x60, 0x42, 0x27, 0xcb, 0xe5, 0x78, 0x07, 0x41, 0x65, 0x74, 0xd1, 0xa3, 0x8d, 0xa0, 0xb2, 0x34, 0x4b, 0xb2, 0x15, 0xb4, 0x18, 0x2b, 0x10, 0x6b, 0x2b, 0x53, 0x4a, 0x8d, 0x32, 0x06, 0xf2, 0xd7, 0xd3, 0x03, 0xb8, 0xdd, 0x5b, 0xce, 0x29, 0x2a, 0xbf, 0x75, 0xcd, 0x76, 0x49 } +, + /* Prime 1 */ + 65, + { 0x02, 0x95, 0x10, 0xb9, 0x33, 0xb7, 0xc8, 0x4e, 0x41, 0xff, 0xcc, 0x72, 0x2e, 0x32, 0x38, 0x60, 0xc9, 0xb2, 0xd0, 0x88, 0x3c, 0x68, 0x33, 0x62, 0x4b, 0xa5, 0xbb, 0xb8, 0x97, 0x53, 0xd7, 0x60, 0x3a, 0x7d, 0xcf, 0x26, 0x6c, 0xc8, 0xf4, 0xbb, 0x07, 0x48, 0x48, 0x26, 0x0f, 0x68, 0xdd, 0x82, 0x6b, 0x63, 0x8a, 0x8d, 0xd2, 0xef, 0xaf, 0x68, 0xaa, 0xee, 0x26, 0x5a, 0xe8, 0x98, 0x39, 0xb1, 0x63 } +, + /* Prime 2 */ + 65, + { 0x02, 0x8a, 0x2d, 0x03, 0x34, 0x49, 0x44, 0x62, 0xf6, 0x11, 0xf3, 0x60, 0x3e, 0x0d, 0x37, 0x4f, 0x3e, 0x32, 0xd2, 0xfa, 0xb5, 0xe9, 0xd6, 0x97, 0x2d, 0xfd, 0x70, 0x79, 0x64, 0x46, 0xa4, 0x8b, 0xc3, 0x03, 0xee, 0x25, 0x8b, 0x75, 0xa1, 0xb7, 0xac, 0xe7, 0x0d, 0x48, 0x58, 0x51, 0x79, 0x4e, 0x42, 0x84, 0xf2, 0xdc, 0x51, 0xd3, 0x97, 0x8d, 0x55, 0x53, 0x7b, 0xea, 0x22, 0x55, 0x11, 0xf4, 0x99 } +, + /* Prime exponent 1 */ + 65, + { 0x01, 0xb9, 0x55, 0x0d, 0xdf, 0xda, 0x3d, 0x6f, 0x09, 0x9e, 0xe5, 0xf6, 0x00, 0xa3, 0x64, 0x82, 0x31, 0x86, 0x20, 0xb4, 0x23, 0x68, 0x09, 0x8e, 0x01, 0x24, 0xe7, 0x5b, 0x88, 0x23, 0xe0, 0x31, 0x0d, 0x3b, 0xba, 0xd5, 0x53, 0x61, 0x22, 0x09, 0xcf, 0x05, 0xd1, 0xad, 0x1f, 0x32, 0x8a, 0x57, 0xac, 0xac, 0x2a, 0xef, 0x1e, 0x39, 0x08, 0x69, 0x1f, 0x5c, 0x98, 0xdc, 0xae, 0x56, 0x1a, 0x86, 0x33 } +, + /* Prime exponent 2 */ + 64, + { 0xe8, 0xff, 0xa4, 0x8c, 0x52, 0x4d, 0x5d, 0xa1, 0x8d, 0x61, 0x48, 0x76, 0x34, 0x4a, 0x43, 0xed, 0xa8, 0x4d, 0x0f, 0x67, 0xad, 0xbb, 0x27, 0x46, 0x65, 0xf2, 0xae, 0xae, 0x0e, 0xda, 0xdc, 0xf3, 0x30, 0x2f, 0x61, 0xe9, 0x0e, 0x68, 0xbb, 0xe8, 0x0c, 0x8d, 0x28, 0x05, 0xee, 0x7c, 0xa8, 0x5d, 0x12, 0x43, 0xee, 0x4c, 0xac, 0xa5, 0x3d, 0x12, 0xfc, 0xee, 0x05, 0x43, 0xf4, 0x74, 0x90, 0xd1 } +, + /* Coefficient */ + 65, + { 0x01, 0x98, 0x4a, 0x81, 0x5c, 0xdb, 0x46, 0xad, 0x81, 0xcd, 0x82, 0x10, 0xaa, 0x07, 0x22, 0x70, 0x0c, 0x59, 0x90, 0x9d, 0xdc, 0x9c, 0x4a, 0x49, 0xf1, 0x9b, 0xe1, 0x5d, 0xa6, 0x04, 0x47, 0x8c, 0x21, 0x88, 0x81, 0xd5, 0x43, 0xa7, 0x54, 0x6b, 0xf7, 0x75, 0x69, 0x4c, 0x2b, 0xd1, 0x3d, 0xda, 0x69, 0x2c, 0xd0, 0xbc, 0x24, 0x39, 0xef, 0x22, 0xef, 0xb6, 0x7f, 0xfc, 0x5d, 0x46, 0x95, 0x21, 0xb2 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 9.1", + /* Message */ + 61, + { 0x96, 0xad, 0x3b, 0xa4, 0xd2, 0x9b, 0xdd, 0x35, 0x25, 0xbb, 0xc5, 0xd0, 0x2e, 0x88, 0xc0, 0x13, 0x3f, 0xfd, 0xea, 0x40, 0x94, 0x74, 0xdb, 0x34, 0xdf, 0x73, 0x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 0xb9, 0xb5, 0x17, 0x7a, 0x04, 0x04, 0xba, 0x49, 0xe5, 0x7f, 0x83, 0xc9, 0x3f, 0x7f, 0xe2, 0xde, 0x24, 0x18, 0x45, 0xf5, 0x81, 0xf6, 0x42, 0x12, 0x43, 0x7e, 0x0c, 0x04, 0xff, 0x34, 0xea, 0x1d, 0xee, 0x6d, 0xd2, 0x8f, 0x6f, 0xf3, 0x36, 0x72, 0x35, 0x44, 0x13, 0x74, 0xf0, 0xf2, 0xef, 0x71, 0xa9, 0xcd, 0xae, 0x9e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.2", + /* Message */ + 37, + { 0x7f, 0x92, 0xab, 0xb6, 0xe5, 0x2e, 0xd5, 0xd4, 0x20, 0x84, 0x9e, 0xd6, 0xcc, 0xab, 0x36, 0xc3, 0xd0, 0x84, 0x92, 0x55, 0x43, 0x1e, 0x19, 0x3d, 0x67, 0xbd, 0x94, 0x4b, 0x6c, 0x0f, 0xce, 0xfb, 0x77, 0x29, 0xcf, 0x5a, 0x31 } +, + /* Seed */ + 89, + { 0xce, 0xa9, 0x68, 0xbe, 0x78, 0xab, 0x5f, 0xaa, 0xc2, 0x27, 0xdc, 0x3c, 0x6f, 0xc9, 0xce, 0xd4, 0x9f, 0x85, 0x1e, 0xd5, 0x8b, 0x08, 0xd5, 0xca, 0x37, 0x54, 0x28, 0x48, 0x9a, 0xfb, 0xef, 0x3b, 0xf5, 0xed, 0x83, 0x74, 0x6d, 0x95, 0x9a, 0x0a, 0x56, 0xe9, 0xac, 0x66, 0xff, 0x2e, 0x7c, 0x8b, 0x8c, 0x3a, 0xda, 0x97, 0xfa, 0x15, 0xdd, 0x7f, 0x99, 0x13, 0x41, 0x74, 0x70, 0x70, 0xcc, 0xad, 0x65, 0x42, 0xbd, 0x7f, 0x4b, 0x33, 0xf5, 0x56, 0x04, 0x45, 0x8b, 0x91, 0x03, 0xae, 0x13, 0xdc, 0x89, 0xb4, 0xe6, 0x2c, 0xcb, 0xf8, 0x4f, 0xf7, 0x3b } +, + /* Encryption */ + 129, + { 0x02, 0x5a, 0x1e, 0x65, 0xeb, 0x37, 0xf4, 0xb3, 0x28, 0xcc, 0x31, 0xb0, 0x17, 0x24, 0xf8, 0x3c, 0x26, 0xed, 0x8d, 0x18, 0xa6, 0x51, 0x65, 0x21, 0x3b, 0xa0, 0xef, 0xf7, 0xae, 0x76, 0x7e, 0xe6, 0x0b, 0x99, 0x27, 0x76, 0x1a, 0x06, 0x94, 0xb5, 0xc3, 0xbb, 0x64, 0xb7, 0xe0, 0x39, 0x96, 0xa3, 0x56, 0x8d, 0x6f, 0xd1, 0xac, 0x6b, 0x7a, 0x8b, 0x71, 0x97, 0x5b, 0xb0, 0x71, 0x6d, 0x94, 0x5c, 0x02, 0xd4, 0x73, 0x68, 0x96, 0x6f, 0xff, 0xb1, 0xd4, 0x49, 0xfc, 0x6e, 0xd7, 0x3e, 0x2d, 0x19, 0x83, 0x1b, 0x86, 0xd1, 0x87, 0x67, 0x51, 0x29, 0x36, 0x69, 0xe7, 0x7d, 0x6e, 0x12, 0xa0, 0xf0, 0xc9, 0x62, 0xdf, 0xcd, 0x40, 0x0f, 0xb8, 0x3c, 0xe8, 0x26, 0x07, 0x16, 0x31, 0x7a, 0xd5, 0xfd, 0xe2, 0x18, 0x49, 0xaa, 0x6f, 0x68, 0xe7, 0x0c, 0xe0, 0xb5, 0xb3, 0x11, 0x42, 0x89, 0x8a, 0xd1, 0xa2 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.3", + /* Message */ + 61, + { 0xf5, 0xb5, 0x35, 0xb6, 0x3d, 0x53, 0x5e, 0x21, 0x37, 0x73, 0x2c, 0x30, 0x13, 0x37, 0xc9, 0x53, 0xea, 0x2e, 0xdd, 0x58, 0xa7, 0x8c, 0x20, 0x25, 0x83, 0x2d, 0xca, 0x9d, 0x6b, 0xcd, 0xad, 0x87, 0xc9, 0x97, 0xc9, 0x06, 0x83, 0x6b, 0x2b, 0xf9, 0x5c, 0x83, 0xf0, 0x3f, 0x7a, 0xfa, 0x29, 0x01, 0x34, 0x6d, 0x67, 0x4a, 0xa6, 0x9a, 0x1b, 0x47, 0xf6, 0xb9, 0x16, 0xfd, 0x4b } +, + /* Seed */ + 65, + { 0xc8, 0x9e, 0xfd, 0xb2, 0x34, 0xe0, 0x1a, 0x2f, 0x07, 0x76, 0x29, 0x57, 0xe8, 0xc0, 0xa4, 0xf9, 0x1a, 0xba, 0xe6, 0xd4, 0xf3, 0x60, 0xe8, 0x9a, 0x7c, 0x48, 0x6c, 0x55, 0x49, 0xf3, 0xd0, 0xad, 0x75, 0x77, 0x7f, 0x0c, 0xcd, 0x97, 0xa0, 0x97, 0x5e, 0x98, 0x44, 0xd9, 0x86, 0x87, 0x02, 0x76, 0xc9, 0x82, 0x5f, 0x5d, 0x1e, 0xef, 0x3d, 0x1b, 0x48, 0x7a, 0xbc, 0xd1, 0x9b, 0x51, 0x2d, 0x08, 0xbe } +, + /* Encryption */ + 129, + { 0x03, 0x9a, 0x1c, 0xe8, 0xc0, 0x91, 0x62, 0x51, 0xa0, 0x1e, 0x5f, 0xb6, 0x61, 0x5d, 0x2e, 0x11, 0x98, 0x2f, 0x4f, 0xae, 0x7d, 0x46, 0xdf, 0x21, 0xda, 0xa2, 0x98, 0xf2, 0xc7, 0x46, 0x11, 0xb5, 0x58, 0x16, 0xcc, 0x27, 0xfa, 0x37, 0x27, 0x9a, 0xaf, 0x59, 0x02, 0xec, 0xb6, 0xc8, 0x39, 0xfa, 0x90, 0x0c, 0xf3, 0xaf, 0x86, 0xff, 0x40, 0xa4, 0x47, 0xdc, 0x40, 0x22, 0x35, 0xf9, 0x06, 0x67, 0x91, 0x23, 0xf3, 0xcd, 0x38, 0x19, 0x04, 0xf3, 0x3e, 0xee, 0x35, 0x3a, 0xc9, 0x0d, 0x5f, 0x7f, 0x20, 0x3a, 0x6e, 0xa8, 0x91, 0x35, 0x1a, 0xdb, 0x11, 0x60, 0x1b, 0xd9, 0xd6, 0xb0, 0xa0, 0x24, 0x33, 0x3a, 0x24, 0x55, 0xbe, 0x1c, 0xa6, 0x2e, 0xd8, 0x2c, 0xf3, 0x7c, 0xf8, 0xde, 0x4e, 0x23, 0x92, 0xdd, 0x54, 0xe7, 0x75, 0x03, 0x3c, 0x56, 0x99, 0x0b, 0xae, 0x5c, 0x43, 0x91, 0xb6, 0x65, 0x3a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.4", + /* Message */ + 47, + { 0xa7, 0xcf, 0x29, 0x82, 0x03, 0x47, 0xa5, 0x2a, 0xb9, 0xcc, 0x42, 0x04, 0xbb, 0x6a, 0xc1, 0xbd, 0x7f, 0xd9, 0x0a, 0x75, 0x8a, 0x15, 0x6d, 0xfa, 0x9c, 0xe7, 0x19, 0x27, 0xe7, 0x4e, 0xe2, 0x15, 0x98, 0x70, 0x8c, 0xf6, 0x9c, 0xfd, 0x79, 0x85, 0x74, 0x2f, 0x50, 0x27, 0xff, 0xa7, 0x10 } +, + /* Seed */ + 79, + { 0x10, 0x9f, 0x0d, 0x6c, 0xa0, 0xe1, 0x3f, 0x50, 0x4c, 0x07, 0xd8, 0x4a, 0x5b, 0xbe, 0x43, 0xed, 0x6a, 0x94, 0xac, 0xba, 0xfa, 0xb0, 0x48, 0x89, 0x36, 0x05, 0xd3, 0x41, 0xc5, 0xd2, 0x8d, 0x85, 0x44, 0xc3, 0xfd, 0x28, 0x43, 0x50, 0xf2, 0xc2, 0x2d, 0x1f, 0x36, 0x7d, 0xfb, 0x9b, 0x6a, 0x67, 0x51, 0xd0, 0x6a, 0xae, 0xb1, 0x7c, 0x3c, 0x0a, 0x10, 0x11, 0xae, 0x38, 0xfb, 0xa4, 0xe4, 0x6d, 0x4e, 0x44, 0xc4, 0x82, 0x87, 0x9e, 0xba, 0x06, 0x44, 0x37, 0x48, 0x71, 0xb5, 0xc5, 0x3b } +, + /* Encryption */ + 129, + { 0x04, 0x48, 0xc3, 0x9c, 0xc4, 0x57, 0xd6, 0xcc, 0xc3, 0x0b, 0x0d, 0x76, 0xff, 0x5a, 0x13, 0x2e, 0x00, 0xc7, 0x5d, 0x53, 0x36, 0x46, 0xb8, 0x44, 0x0b, 0x13, 0xce, 0x73, 0x0e, 0x1b, 0x7a, 0xd8, 0x3b, 0xb2, 0xba, 0x4a, 0x08, 0x2b, 0xb5, 0xa3, 0x3c, 0xf4, 0x14, 0x66, 0xe0, 0x67, 0xfc, 0xf1, 0x6c, 0x6a, 0x29, 0xf1, 0x87, 0x9f, 0x77, 0xe9, 0xb0, 0xdb, 0xf3, 0xec, 0x08, 0x05, 0x75, 0xbe, 0xba, 0xc0, 0xc5, 0x67, 0x6b, 0xae, 0xe0, 0x02, 0xd5, 0x73, 0xd1, 0xbc, 0xc8, 0xa7, 0x0f, 0xed, 0x2a, 0xb6, 0x79, 0x43, 0xef, 0xc9, 0xbc, 0x13, 0x13, 0x9e, 0x5d, 0x8d, 0xde, 0x2c, 0xb3, 0x0e, 0x1b, 0x93, 0x4f, 0x50, 0xcf, 0x6c, 0x45, 0x73, 0x92, 0x3f, 0x73, 0x98, 0xde, 0x66, 0x70, 0xcc, 0x26, 0x34, 0x1f, 0x3e, 0x35, 0xa4, 0x19, 0x36, 0x1e, 0x59, 0xf6, 0x08, 0x98, 0xf2, 0x69, 0x2b, 0x94 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.5", + /* Message */ + 10, + { 0xb8, 0x03, 0xc7, 0xef, 0x5f, 0x9a, 0x9b, 0xd5, 0x84, 0x01 } +, + /* Seed */ + 116, + { 0x8e, 0x77, 0x58, 0xed, 0x4d, 0x1b, 0xa4, 0xdc, 0xe0, 0x88, 0x92, 0x6c, 0x10, 0xb2, 0xf3, 0xd4, 0xc1, 0xe2, 0x67, 0x1a, 0xe7, 0x2e, 0x65, 0x9f, 0x72, 0x1f, 0xf7, 0xbe, 0x6f, 0xc0, 0x35, 0xe3, 0x85, 0xd5, 0x12, 0xd0, 0x7a, 0x38, 0xdc, 0xca, 0x1e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0x3d, 0x04, 0x66, 0xac, 0xe4, 0xcc, 0xcc, 0xb3, 0x4e, 0x5b, 0x26, 0x6d, 0x3d, 0x6b, 0x94, 0x7b, 0xc7, 0xc0, 0xae, 0x34, 0xd5, 0xe2, 0x64 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.6", + /* Message */ + 49, + { 0x61, 0x7e, 0xa9, 0xe4, 0xa5, 0x6c, 0x4e, 0xc1, 0xd3, 0xd7, 0xfd, 0x7f, 0x32, 0x81, 0xae, 0x7f, 0xa9, 0x32, 0xb2, 0xa0, 0xa6, 0xcf, 0x55, 0xeb, 0x60, 0x48, 0x14, 0x56, 0x81, 0xb3, 0x58, 0x8e, 0xdf, 0x70, 0x12, 0x69, 0xf8, 0x9f, 0xe6, 0x4a, 0xa1, 0x4a, 0xd8, 0xdf, 0x0d, 0x46, 0x79, 0x61, 0x31 } +, + /* Seed */ + 77, + { 0x64, 0xd7, 0xeb, 0xd0, 0x48, 0x50, 0xeb, 0x6f, 0x7a, 0xe1, 0xaf, 0x48, 0x12, 0x0a, 0x80, 0x13, 0x0f, 0x32, 0xed, 0xb5, 0x03, 0x69, 0x64, 0x0b, 0x22, 0x2b, 0x8d, 0x63, 0xef, 0xf6, 0x57, 0x12, 0x70, 0xdc, 0xab, 0x31, 0x76, 0xd0, 0x24, 0x72, 0x28, 0xdc, 0xd1, 0xc3, 0xf3, 0xcf, 0xd5, 0x13, 0x31, 0xb7, 0x56, 0xa8, 0x65, 0x2a, 0x14, 0xdd, 0xaa, 0xb9, 0x93, 0x96, 0xb9, 0x19, 0x9a, 0x73, 0x87, 0x50, 0xd6, 0x9e, 0xfc, 0xd3, 0x77, 0xf1, 0x84, 0xae, 0x19, 0xb5, 0xa9 } +, + /* Encryption */ + 129, + { 0x02, 0xdf, 0xe7, 0x29, 0x58, 0x59, 0x58, 0x81, 0xd8, 0x07, 0x56, 0x6d, 0x3e, 0x36, 0x07, 0xc0, 0x22, 0xe4, 0x61, 0xfe, 0x1d, 0xbe, 0xd3, 0xcc, 0x6d, 0x63, 0xde, 0xdc, 0xb7, 0x19, 0x0f, 0x06, 0xc7, 0xd2, 0x4b, 0x4f, 0x03, 0x26, 0x4c, 0xaf, 0xbb, 0x74, 0x82, 0xec, 0x28, 0xb9, 0xba, 0x48, 0x9d, 0x03, 0x11, 0x5a, 0xf5, 0x8f, 0xde, 0x47, 0x5e, 0xda, 0x58, 0xbf, 0x01, 0x55, 0xcd, 0xf1, 0xaf, 0x16, 0xdf, 0x20, 0x6b, 0xcd, 0x12, 0x57, 0x04, 0xc3, 0xe3, 0x15, 0xad, 0x3d, 0x95, 0x44, 0xb9, 0xe2, 0xc2, 0xfe, 0xa8, 0x10, 0xce, 0x48, 0x45, 0x56, 0xd2, 0x9e, 0x07, 0xad, 0xbf, 0x0f, 0xf4, 0x61, 0xcc, 0xbc, 0xf6, 0x62, 0xbd, 0x74, 0x95, 0x9a, 0x43, 0x7d, 0x4c, 0x80, 0x11, 0xce, 0xad, 0xa5, 0x50, 0x2a, 0xf7, 0x67, 0x6d, 0x9a, 0x15, 0x21, 0xe3, 0x18, 0x9d, 0xaf, 0xde, 0x00, 0xdd } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.7", + /* Message */ + 60, + { 0xc9, 0x1f, 0x2c, 0x98, 0xc7, 0x5b, 0x2f, 0xd4, 0xcd, 0x8d, 0x5c, 0x7f, 0xf2, 0xe7, 0x69, 0xb1, 0x2f, 0x28, 0xf3, 0x13, 0xfb, 0xac, 0xb5, 0x1b, 0x5e, 0x50, 0x14, 0xdf, 0xce, 0x9d, 0x63, 0x5e, 0x7c, 0x6b, 0x2d, 0x88, 0xaf, 0x5e, 0xac, 0x30, 0xd1, 0x62, 0xb8, 0xdd, 0xc2, 0x2e, 0xd8, 0xbc, 0x7b, 0xee, 0x50, 0x6b, 0xfb, 0xf3, 0x1e, 0x51, 0xba, 0x48, 0xf4, 0x26 } +, + /* Seed */ + 66, + { 0x6c, 0x44, 0x59, 0x61, 0xf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 0xb4, 0x15, 0xfe, 0xe0, 0x52, 0x19, 0xa5, 0x84, 0x23, 0x7a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.8", + /* Message */ + 51, + { 0x7b, 0x1c, 0x31, 0x51, 0xa3, 0x8d, 0x32, 0xec, 0x7b, 0x82, 0xc4, 0x8c, 0x00, 0x0a, 0xa4, 0x81, 0xde, 0x41, 0x8e, 0x80, 0x3b, 0x67, 0x3d, 0x2e, 0x9a, 0x0f, 0xc3, 0xd5, 0xe9, 0x74, 0xad, 0xcd, 0xce, 0xbd, 0x3c, 0x2a, 0x8f, 0x41, 0x14, 0x21, 0x18, 0xa5, 0x5e, 0x87, 0xd0, 0x4b, 0xba, 0xd5, 0xb3, 0x64, 0x25 } +, + /* Seed */ + 75, + { 0xb0, 0xf5, 0xbe, 0x9b, 0x3f, 0x23, 0x7c, 0xc5, 0xaf, 0xca, 0x5a, 0x99, 0xfc, 0xcb, 0x77, 0xb6, 0xef, 0xd8, 0x68, 0x94, 0x7f, 0x98, 0x55, 0x4f, 0xbe, 0xce, 0xac, 0xfa, 0x88, 0x4c, 0x15, 0x15, 0x39, 0xd7, 0xcf, 0x42, 0x3e, 0x72, 0x60, 0x31, 0xbf, 0xeb, 0x8d, 0xd2, 0xd4, 0xf3, 0x01, 0xda, 0x6b, 0xdf, 0xca, 0xd6, 0xe5, 0x81, 0x65, 0x82, 0xad, 0xdc, 0xe1, 0x0d, 0x85, 0xd5, 0xee, 0x1d, 0x04, 0x46, 0xf3, 0x73, 0xb9, 0x5e, 0xe1, 0x60, 0xbc, 0xf0, 0x35 } +, + /* Encryption */ + 129, + { 0x06, 0x6c, 0x30, 0x09, 0xdc, 0x6c, 0xba, 0xc7, 0xb8, 0xbd, 0x51, 0x41, 0xc5, 0x5c, 0xf8, 0x6a, 0x3d, 0x79, 0x69, 0xd5, 0x85, 0x45, 0x2e, 0x3a, 0x66, 0x54, 0x0f, 0x94, 0x02, 0xdb, 0xa2, 0x15, 0xe3, 0xfb, 0x3a, 0x27, 0x7f, 0x0d, 0x33, 0x96, 0xc8, 0xc0, 0x08, 0xaf, 0x19, 0x91, 0x3e, 0x3d, 0x91, 0xe4, 0x0f, 0x86, 0x76, 0x06, 0xb5, 0xbf, 0x54, 0x30, 0x4c, 0x04, 0x71, 0xda, 0xdd, 0x64, 0x04, 0xb6, 0x7a, 0x48, 0x57, 0xbf, 0x52, 0x24, 0x6c, 0x0d, 0x60, 0x18, 0x23, 0xdd, 0x03, 0x80, 0xc6, 0x60, 0x9d, 0xac, 0xb9, 0x2d, 0xb6, 0x02, 0xe5, 0x57, 0x64, 0xae, 0x46, 0x50, 0xdf, 0x1a, 0xdb, 0xb4, 0xb9, 0x5f, 0xa5, 0xaf, 0x4b, 0xcd, 0x11, 0x21, 0xf1, 0x3c, 0x0a, 0x73, 0x23, 0xad, 0xa8, 0xc6, 0x0d, 0xe3, 0xd0, 0x81, 0x72, 0x9d, 0x19, 0x7f, 0x9c, 0xf8, 0xe2, 0x7c, 0xde, 0x80, 0xb1 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.9", + /* Message */ + 58, + { 0xb2, 0x93, 0xc6, 0xf6, 0xd0, 0x5d, 0x1f, 0x38, 0xb5, 0x61, 0xea, 0x3d, 0x0d, 0x0a, 0xd6, 0xa2, 0xaf, 0x83, 0x09, 0xbb, 0x9a, 0xde, 0xfa, 0x77, 0x8f, 0xd6, 0xbb, 0x9f, 0xff, 0x3e, 0x01, 0x0c, 0x40, 0x4c, 0x53, 0x39, 0x97, 0xcc, 0xfe, 0xd7, 0xe1, 0x91, 0x7a, 0x66, 0x92, 0x61, 0xcf, 0xcc, 0xa4, 0xe3, 0x70, 0x29, 0x99, 0x1d, 0x2d, 0xe9, 0xb2, 0x99 } +, + /* Seed */ + 68, + { 0x87, 0xbd, 0x2f, 0x6b, 0xb4, 0x82, 0x45, 0x59, 0x1d, 0x65, 0xf0, 0x23, 0xa6, 0x5b, 0x63, 0xbb, 0xba, 0x84, 0x19, 0x79, 0x2c, 0x01, 0x41, 0x09, 0x2b, 0x1d, 0xb1, 0xbe, 0x53, 0xe8, 0xc9, 0xb4, 0xdf, 0x95, 0xf0, 0xad, 0x55, 0xb9, 0x6e, 0x5e, 0x57, 0x61, 0x5d, 0x21, 0x4b, 0x49, 0x77, 0x87, 0x0a, 0x27, 0x2f, 0x72, 0x31, 0x66, 0xc6, 0x20, 0x45, 0x76, 0x5e, 0x6b, 0x4a, 0x73, 0xa7, 0xc9, 0xeb, 0xe1, 0x1d, 0x24 } +, + /* Encryption */ + 129, + { 0x03, 0x10, 0x4e, 0xc6, 0xc4, 0xab, 0x9d, 0xac, 0xae, 0x42, 0x7f, 0xb1, 0x06, 0x99, 0xbc, 0xae, 0x00, 0x3d, 0xa5, 0x6f, 0x6d, 0x07, 0x50, 0x95, 0x87, 0x14, 0x5b, 0x73, 0x3e, 0xdb, 0x53, 0x23, 0x9a, 0x6f, 0x42, 0x22, 0x86, 0x83, 0x9c, 0xac, 0x06, 0x4a, 0xdf, 0xee, 0xe5, 0xdc, 0x89, 0x78, 0x0c, 0xdd, 0xad, 0xcc, 0x80, 0x72, 0x19, 0xd6, 0xa9, 0x7b, 0x85, 0xc1, 0x3f, 0x27, 0x93, 0x7d, 0x70, 0x32, 0x7f, 0x82, 0xcc, 0x36, 0xa5, 0xda, 0x8e, 0x45, 0x63, 0x77, 0xfc, 0xa2, 0x3a, 0xee, 0x51, 0x4e, 0x04, 0x4a, 0xbf, 0x1f, 0x66, 0xc3, 0xe7, 0xbd, 0xeb, 0xc2, 0xcf, 0xf6, 0x28, 0xbd, 0x52, 0x4a, 0x09, 0x66, 0xe2, 0x63, 0x8d, 0x28, 0x33, 0xbf, 0xa3, 0x43, 0xeb, 0xc7, 0x41, 0xf7, 0x6b, 0x5b, 0x70, 0xa1, 0x13, 0x6f, 0x4a, 0xbc, 0x60, 0x28, 0x64, 0xa2, 0xad, 0x43, 0xa7, 0x91, 0xbd } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.10", + /* Message */ + 5, + { 0x08, 0x38, 0xf4, 0xa5, 0x92 } +, + /* Seed */ + 121, + { 0x89, 0xc5, 0x89, 0x8c, 0x6c, 0x3d, 0xc6, 0xcb, 0xdb, 0x1a, 0xcb, 0x28, 0x05, 0xdf, 0x53, 0x98, 0xf0, 0xb3, 0x35, 0x8a, 0x18, 0xe5, 0xe6, 0x3c, 0x14, 0xd2, 0x0c, 0x98, 0xd2, 0x1d, 0x9f, 0xd8, 0xb2, 0xec, 0xc9, 0xa0, 0xe8, 0x3d, 0xaf, 0x0c, 0x06, 0x92, 0x68, 0xbb, 0xe8, 0x6f, 0xee, 0xa5, 0x1c, 0x93, 0x79, 0x1b, 0x68, 0xe5, 0xd9, 0x3b, 0x74, 0x5f, 0xea, 0xf6, 0xad, 0xc4, 0x2b, 0x83, 0xc3, 0x09, 0xc9, 0xcd, 0x3d, 0xfe, 0x1c, 0x06, 0x15, 0x3a, 0xb8, 0x80, 0x85, 0x56, 0x18, 0x98, 0x90, 0xbe, 0x05, 0x3a, 0x92, 0x54, 0x88, 0xd0, 0x29, 0xfe, 0x50, 0x40, 0xe3, 0xe7, 0xd5, 0xd5, 0x31, 0xb3, 0x2e, 0xb9, 0xd2, 0xf4, 0xee, 0xa2, 0x21, 0x11, 0xb3, 0x8a, 0x65, 0x53, 0xf0, 0x0e, 0xdd, 0x23, 0x65, 0x57, 0x5b, 0xb9, 0x49, 0xf3, 0x63 } +, + /* Encryption */ + 129, + { 0x01, 0x4f, 0x27, 0x97, 0xdd, 0xe8, 0xd4, 0x60, 0x18, 0xff, 0x23, 0xd8, 0x9b, 0xe2, 0xe3, 0xae, 0x04, 0x6e, 0xed, 0x31, 0x97, 0xc8, 0x79, 0xc6, 0x0e, 0x26, 0xf3, 0xd2, 0x40, 0x08, 0x66, 0xeb, 0x50, 0xd7, 0xb4, 0x5f, 0x6b, 0x01, 0xae, 0x9c, 0xa0, 0x06, 0x84, 0x7e, 0xfb, 0xe9, 0xab, 0xcc, 0x9b, 0xc3, 0xe3, 0x56, 0x90, 0x07, 0x2b, 0x68, 0xdb, 0x9e, 0xcd, 0x92, 0x6d, 0x94, 0x5f, 0x78, 0x7b, 0x27, 0xc3, 0x75, 0x3b, 0xf9, 0x6b, 0x2d, 0x49, 0x98, 0x30, 0x84, 0x14, 0x2c, 0x42, 0xa1, 0x26, 0x1a, 0xff, 0x7b, 0x17, 0xff, 0x4b, 0x20, 0xde, 0x9b, 0xff, 0xa5, 0x86, 0x24, 0xab, 0x37, 0x1d, 0x4c, 0xe2, 0xf9, 0x64, 0x69, 0xa8, 0xe1, 0x03, 0x8d, 0x57, 0x20, 0xb8, 0x1c, 0xf0, 0x42, 0xdc, 0x78, 0xbf, 0xda, 0x9a, 0x3c, 0xcb, 0x61, 0x60, 0x81, 0x2d, 0xde, 0xa1, 0x58, 0xbd, 0x2f, 0x5c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.11", + /* Message */ + 60, + { 0x12, 0x38, 0x0c, 0x5e, 0x80, 0xbb, 0x95, 0xbb, 0xc8, 0x85, 0x73, 0x57, 0xfe, 0xfd, 0x17, 0xbf, 0x9e, 0x50, 0x96, 0x27, 0xd2, 0x8c, 0xdf, 0xcd, 0x12, 0xbb, 0x13, 0x16, 0x61, 0xb3, 0x42, 0xdf, 0xa6, 0xca, 0x67, 0x2e, 0x13, 0xa8, 0x85, 0x1f, 0xce, 0x19, 0xb1, 0xa8, 0xca, 0xf0, 0xe3, 0x3c, 0xd6, 0xef, 0x53, 0x8a, 0x05, 0xfa, 0x54, 0x26, 0x9a, 0x13, 0x78, 0xe7 } +, + /* Seed */ + 66, + { 0x88, 0x03, 0x31, 0xeb, 0xe9, 0x1a, 0xb6, 0xce, 0x16, 0x84, 0xd9, 0xaf, 0x5d, 0x97, 0x7e, 0xb4, 0x26, 0xca, 0x71, 0x56, 0xe0, 0xb6, 0xf4, 0x33, 0x6c, 0x6e, 0x09, 0x33, 0xd6, 0xfa, 0x48, 0x78, 0x2c, 0x0a, 0xc9, 0x69, 0xf3, 0xdd, 0xe6, 0x1d, 0x8f, 0xd7, 0x4c, 0x47, 0xfe, 0x9e, 0x30, 0x61, 0x71, 0x0d, 0x24, 0x5b, 0x1d, 0x38, 0x11, 0x04, 0x28, 0x60, 0xc1, 0xf4, 0x8d, 0x2b, 0x8f, 0xfd, 0x80, 0x9e } +, + /* Encryption */ + 129, + { 0x04, 0x6c, 0x54, 0x5f, 0xf4, 0x96, 0xc2, 0x1f, 0x69, 0x01, 0x27, 0x24, 0x54, 0x18, 0xcc, 0x5f, 0xb1, 0x8f, 0x09, 0x10, 0x2e, 0x7a, 0xca, 0x87, 0xe2, 0x6e, 0x20, 0x82, 0xfc, 0x16, 0xf6, 0x2f, 0xe9, 0xf4, 0x2a, 0x72, 0x22, 0x71, 0xa7, 0x9e, 0xae, 0xe9, 0x62, 0x5a, 0x7e, 0x63, 0x2c, 0x19, 0x36, 0x40, 0x4c, 0xec, 0x62, 0x11, 0xd8, 0x23, 0x86, 0x3b, 0xa0, 0x2c, 0x6b, 0x0a, 0x83, 0x19, 0x58, 0xb4, 0xed, 0x8f, 0xc6, 0x25, 0xa2, 0xe5, 0x2a, 0x05, 0x4f, 0x8f, 0x18, 0x1f, 0x13, 0x0f, 0x8b, 0xc4, 0xb1, 0xdf, 0xbd, 0x44, 0xb7, 0x0a, 0x35, 0xb3, 0x5e, 0x9c, 0x7f, 0x4a, 0xc5, 0x5e, 0xe5, 0xe2, 0xcb, 0x06, 0x8b, 0x75, 0x86, 0x39, 0xb2, 0xcd, 0x64, 0x3d, 0xbf, 0xa8, 0x2e, 0x2d, 0x97, 0x20, 0xe4, 0x89, 0xf5, 0xc8, 0x21, 0xd8, 0xeb, 0xdc, 0x13, 0x68, 0xa9, 0xd3, 0x46, 0x8a, 0x37 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.12", + /* Message */ + 40, + { 0xee, 0xe1, 0xe4, 0x5d, 0x18, 0xb1, 0x47, 0xc2, 0x69, 0xa6, 0x0a, 0x9c, 0x64, 0x20, 0x18, 0xed, 0x6c, 0xd1, 0x15, 0x7c, 0xd0, 0xce, 0x2b, 0x29, 0x68, 0xdf, 0xa4, 0xb4, 0x97, 0xfc, 0x40, 0xb2, 0x24, 0xbd, 0x86, 0x1e, 0x25, 0x35, 0x12, 0x2b } +, + /* Seed */ + 86, + { 0x5c, 0x51, 0x3e, 0x51, 0x44, 0x52, 0xb1, 0x4a, 0xee, 0x33, 0xb6, 0x17, 0x60, 0xb8, 0x58, 0xc5, 0x35, 0x7c, 0x7d, 0x7f, 0x20, 0xe4, 0xa3, 0x7c, 0x7e, 0xef, 0xe4, 0x19, 0xca, 0xe3, 0xfd, 0x16, 0xf9, 0xd8, 0x3e, 0x5e, 0xcd, 0xe1, 0x9e, 0xe6, 0x32, 0x85, 0xdd, 0xce, 0x66, 0x80, 0xee, 0x94, 0x64, 0xfe, 0x83, 0x75, 0x6e, 0x90, 0x31, 0xd6, 0x37, 0x9e, 0x6a, 0x6b, 0x38, 0x4c, 0xe2, 0x77, 0xbc, 0x64, 0x2c, 0xed, 0x83, 0xb2, 0x9c, 0xf7, 0x4b, 0x72, 0xce, 0xff, 0xf5, 0x30, 0x71, 0x04, 0xe1, 0x83, 0xde, 0x2c, 0xe6, 0xa1 } +, + /* Encryption */ + 129, + { 0x03, 0xa8, 0x64, 0x83, 0xcb, 0xb7, 0x2c, 0x15, 0xf5, 0xa6, 0x93, 0x2b, 0x01, 0x2f, 0x40, 0xc4, 0xb1, 0x73, 0x33, 0x3b, 0x26, 0x86, 0xf4, 0x98, 0x4b, 0xa6, 0x6e, 0x24, 0xc7, 0xcf, 0x44, 0x41, 0x23, 0xba, 0x2e, 0xa6, 0x66, 0xa1, 0x75, 0x5d, 0x09, 0x35, 0x7b, 0xee, 0xa4, 0x37, 0x9c, 0xe3, 0xcd, 0xb0, 0xa7, 0x7a, 0x6e, 0xe3, 0xb7, 0xca, 0x60, 0xdb, 0x68, 0x24, 0x17, 0xf7, 0x16, 0x3d, 0x7d, 0x3a, 0xc7, 0x35, 0x28, 0x11, 0xbb, 0x94, 0xc5, 0xb7, 0x71, 0xf3, 0xd3, 0xfd, 0xa7, 0x73, 0xe5, 0xce, 0xbc, 0x8b, 0xc6, 0x60, 0x11, 0x55, 0xb3, 0xf4, 0xe4, 0xb4, 0xca, 0x85, 0xd9, 0xba, 0xb8, 0xec, 0x25, 0x8c, 0xec, 0xff, 0x44, 0x33, 0xc9, 0x2e, 0x8f, 0x86, 0x3d, 0x96, 0xfc, 0xc7, 0x94, 0x29, 0x49, 0x8a, 0x9e, 0x17, 0x90, 0x33, 0x0b, 0xc4, 0x87, 0xc0, 0x10, 0xd7, 0x99, 0x24, 0x5d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.13", + /* Message */ + 28, + { 0x55, 0x09, 0xa5, 0xc1, 0xac, 0x54, 0x89, 0xdc, 0xb7, 0x65, 0xf3, 0x7c, 0xeb, 0xbe, 0x7d, 0x81, 0xcf, 0x02, 0x76, 0xb1, 0xf2, 0xcf, 0xf9, 0x5d, 0x27, 0x4b, 0xbd, 0x04 } +, + /* Seed */ + 98, + { 0x76, 0xe8, 0x1a, 0x51, 0x37, 0x1f, 0xb5, 0x07, 0x41, 0x14, 0x1d, 0xcb, 0x31, 0xd5, 0x1d, 0x1c, 0x46, 0x1f, 0xcc, 0x02, 0x6a, 0xea, 0x85, 0x20, 0x15, 0xd4, 0x68, 0x74, 0x0b, 0x45, 0x23, 0x40, 0x5f, 0x95, 0xba, 0x87, 0x9b, 0x08, 0x69, 0xbf, 0x03, 0x1a, 0x60, 0x65, 0x4f, 0xc4, 0xe5, 0x68, 0xc1, 0x95, 0x7c, 0xe4, 0xe4, 0x2a, 0x35, 0x0a, 0x95, 0xbf, 0x8c, 0xb2, 0xa8, 0xb5, 0xfd, 0xe6, 0xdc, 0xfd, 0x25, 0x05, 0xc0, 0x37, 0xa2, 0x9e, 0xde, 0x68, 0x9c, 0x53, 0xd8, 0x32, 0x19, 0xe7, 0x3e, 0x64, 0x08, 0x17, 0xbf, 0x8a, 0xfc, 0x9a, 0xb0, 0x04, 0xec, 0xae, 0xc8, 0x43, 0xe4, 0xfe, 0x4e, 0x38 } +, + /* Encryption */ + 129, + { 0x02, 0x55, 0xde, 0x28, 0x0b, 0x71, 0xaf, 0xef, 0xaf, 0xa2, 0x0f, 0x24, 0x1e, 0x08, 0x1b, 0x7e, 0xc6, 0xc1, 0x62, 0xdd, 0xda, 0x18, 0x84, 0xfa, 0x9f, 0x82, 0x5c, 0x4c, 0xe7, 0x63, 0x6e, 0xfb, 0xc1, 0x1b, 0x84, 0xa6, 0xeb, 0xea, 0x35, 0x89, 0x25, 0x71, 0xac, 0x9e, 0x6b, 0x1a, 0xd8, 0x47, 0x3f, 0xa5, 0x73, 0xc8, 0x83, 0xc9, 0xf2, 0x15, 0xa1, 0x95, 0x80, 0xc3, 0xea, 0x30, 0x2f, 0x88, 0xf4, 0x4f, 0x48, 0xe4, 0xd9, 0x5c, 0x34, 0x40, 0xd4, 0x93, 0x1f, 0x17, 0x66, 0xa1, 0xfe, 0x7e, 0x79, 0x0e, 0x5d, 0x38, 0xe8, 0x5d, 0x1f, 0x63, 0x85, 0x0a, 0x3c, 0x70, 0x7a, 0xd8, 0x97, 0x7b, 0x88, 0xc3, 0x8c, 0xb9, 0xed, 0x98, 0x34, 0x5c, 0xd3, 0x50, 0xc3, 0xdd, 0x45, 0x30, 0x9f, 0xc8, 0x1c, 0xb4, 0x62, 0x76, 0xe4, 0xad, 0x64, 0x7f, 0xa8, 0x4c, 0x14, 0x12, 0x5e, 0xfd, 0x67, 0xd8, 0xba } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.14", + /* Message */ + 58, + { 0x02, 0x53, 0x81, 0xa5, 0x5c, 0x8e, 0x48, 0x7d, 0x7f, 0x4f, 0xf7, 0xc3, 0x6c, 0xfb, 0x37, 0x50, 0x07, 0xd1, 0x9f, 0x93, 0x71, 0x13, 0x6e, 0x2b, 0x3d, 0xf4, 0x42, 0x5e, 0xee, 0xee, 0x5d, 0x79, 0xc3, 0x52, 0x61, 0xfb, 0xb4, 0xea, 0x68, 0xbd, 0x91, 0xe8, 0xed, 0xab, 0xa2, 0x32, 0x9e, 0x29, 0x31, 0x53, 0x06, 0xc7, 0xd7, 0x18, 0x33, 0x15, 0x5b, 0x88 } +, + /* Seed */ + 68, + { 0xaa, 0x31, 0x0f, 0x62, 0xda, 0x90, 0xda, 0x4a, 0x20, 0x28, 0xb3, 0x81, 0x39, 0x9c, 0xb7, 0xe0, 0xed, 0x3b, 0xb5, 0x10, 0x57, 0x5c, 0x9b, 0xd0, 0xf6, 0x38, 0x21, 0x5b, 0xaf, 0x78, 0x08, 0xe3, 0x24, 0x5e, 0xaf, 0x38, 0xb7, 0x6e, 0x26, 0x52, 0x29, 0x0b, 0x7c, 0xc6, 0x20, 0x90, 0x7c, 0xda, 0x0c, 0xb7, 0xaf, 0x07, 0x3c, 0x12, 0x2f, 0xf8, 0x3d, 0xaa, 0xe1, 0x98, 0x6b, 0x43, 0xec, 0x1a, 0x14, 0x82, 0xdb, 0xa6 } +, + /* Encryption */ + 129, + { 0x04, 0x9b, 0xfa, 0xc6, 0x41, 0x0b, 0x77, 0x80, 0x39, 0x7a, 0x49, 0xfb, 0x88, 0x93, 0xb2, 0x4d, 0x90, 0x3b, 0x36, 0x00, 0xf3, 0x3c, 0x78, 0x2c, 0x14, 0x75, 0xb5, 0xd2, 0x4b, 0x4f, 0x4e, 0x88, 0xfd, 0x11, 0x24, 0xef, 0x06, 0x45, 0xf3, 0xd3, 0x91, 0xed, 0x31, 0x00, 0x6d, 0xd1, 0xb7, 0xc2, 0x64, 0x12, 0x8d, 0x0d, 0xb9, 0xaa, 0x0d, 0x65, 0xa0, 0x9f, 0xfb, 0xe2, 0x9a, 0x94, 0xcc, 0xa3, 0x58, 0xda, 0x64, 0xbd, 0x1b, 0x72, 0xff, 0x55, 0x88, 0x88, 0x08, 0x10, 0x5b, 0xe0, 0x91, 0xae, 0x23, 0xea, 0x3f, 0x34, 0x75, 0x05, 0x17, 0x9e, 0xcc, 0xb2, 0x41, 0x0d, 0x89, 0xde, 0xcb, 0x62, 0x33, 0x0f, 0x36, 0xc7, 0x44, 0x26, 0x2e, 0xb2, 0xb0, 0x78, 0xb4, 0x25, 0x4b, 0xcd, 0xce, 0xce, 0x21, 0x1c, 0xf0, 0x57, 0x4a, 0x24, 0x68, 0xe2, 0xa1, 0xe0, 0x18, 0xbc, 0x31, 0xf5, 0x02, 0x22, 0x35 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.15", + /* Message */ + 38, + { 0x07, 0x3c, 0x43, 0x67, 0xba, 0xfd, 0x48, 0x10, 0xd7, 0x70, 0x44, 0x60, 0xc7, 0x83, 0xd3, 0x50, 0xf7, 0xcc, 0xd0, 0x99, 0x47, 0x2f, 0x79, 0xf7, 0xfd, 0xf2, 0x3e, 0xf0, 0xcf, 0xaa, 0xcc, 0xab, 0x95, 0x71, 0xdf, 0x53, 0xfd, 0xe4 } +, + /* Seed */ + 88, + { 0xf9, 0x5a, 0x39, 0x96, 0xde, 0xf1, 0xca, 0xfc, 0x1a, 0x4a, 0x0b, 0x34, 0x14, 0x6b, 0x73, 0xde, 0x6b, 0x5a, 0x92, 0xcb, 0x81, 0x2e, 0x20, 0xb2, 0x0c, 0x12, 0x2a, 0x25, 0x1e, 0x6b, 0x22, 0xe0, 0x46, 0x9c, 0x98, 0xdb, 0x12, 0x8d, 0x43, 0xce, 0xfc, 0xdd, 0x80, 0xc7, 0xff, 0x36, 0x99, 0x80, 0x16, 0xa8, 0x92, 0xa8, 0xb6, 0x34, 0xb3, 0x6b, 0x9b, 0x0c, 0xe8, 0x7e, 0xa8, 0x0b, 0x5d, 0xd9, 0xfd, 0x7a, 0x08, 0x29, 0x14, 0xe7, 0x3b, 0x83, 0xa3, 0x84, 0x1d, 0xe5, 0x1b, 0x71, 0xb1, 0xa6, 0xb7, 0xef, 0x7d, 0xe4, 0xe4, 0xb8, 0x8e, 0xdc } +, + /* Encryption */ + 129, + { 0x02, 0xde, 0xe4, 0x8b, 0x0f, 0x99, 0x53, 0xee, 0x12, 0xc7, 0x18, 0xb3, 0x03, 0xb0, 0xc8, 0x9d, 0x61, 0x50, 0xeb, 0xbe, 0x83, 0xad, 0x62, 0x4e, 0x11, 0x7e, 0x3f, 0x27, 0x04, 0xa0, 0xb1, 0x7a, 0x2e, 0xbe, 0xe8, 0x38, 0x52, 0x56, 0xf0, 0xe6, 0x42, 0x80, 0xfb, 0x06, 0xc3, 0xb1, 0x46, 0xc0, 0x99, 0xaf, 0x23, 0xa9, 0xf2, 0x47, 0x93, 0x39, 0x37, 0x81, 0xa5, 0x55, 0xac, 0x4e, 0xa2, 0xd8, 0x8d, 0x78, 0x5d, 0x8c, 0xdb, 0x6e, 0x7a, 0x2f, 0x89, 0x52, 0xd2, 0x50, 0x3c, 0xcf, 0x90, 0x1f, 0x12, 0x39, 0xf6, 0xf7, 0xb1, 0xac, 0xd4, 0x41, 0x21, 0xc3, 0x65, 0xfd, 0xae, 0x37, 0x07, 0x46, 0xde, 0x45, 0x26, 0xe7, 0xc6, 0x56, 0x0f, 0x87, 0x54, 0x6e, 0xd5, 0x77, 0xcf, 0x97, 0x98, 0xbe, 0xf4, 0x7e, 0x49, 0x20, 0x65, 0x50, 0x9c, 0x49, 0x21, 0x2d, 0x37, 0x0d, 0xea, 0x05, 0x22, 0xd7, 0x94 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.16", + /* Message */ + 42, + { 0xba, 0xb2, 0x0b, 0x9a, 0x6a, 0x53, 0x2e, 0x6f, 0x8a, 0xf0, 0x78, 0xb3, 0xa1, 0x85, 0xe0, 0xaa, 0x86, 0xe6, 0x16, 0x81, 0xbd, 0x1b, 0xd7, 0x75, 0x04, 0x4a, 0x2c, 0x95, 0x8d, 0x61, 0xed, 0xc2, 0x51, 0x60, 0x7c, 0xd9, 0xf3, 0x11, 0x48, 0xf5, 0xa9, 0x11 }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, 0x55, 0xa2, 0x4c, 0xc4, 0xeb, 0x90, 0x68, 0x23, 0x6d, 0xaa, 0x0f, 0x2f, 0x93, 0x45, 0x8d, 0x72, 0x72, 0x6c, 0x2d, 0x8e, 0x31, 0x25, 0x9a, 0xcd, 0x3a, 0x7f, 0xde, 0xb6, 0xfe, 0xb5, 0xc6, 0xd2, 0xed, 0x17, 0x8d, 0xdb } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.17", + /* Message */ + 63, + { 0x19, 0xb1, 0xf4, 0xcd, 0x3d, 0xbd, 0xf0, 0x5b, 0x3d, 0x5f, 0x16, 0x80, 0x85, 0x6c, 0x5a, 0x74, 0x4f, 0x51, 0x62, 0xb5, 0x20, 0xbf, 0xcd, 0xfc, 0x98, 0x87, 0xdd, 0x92, 0xbe, 0x9d, 0x8c, 0xb6, 0x25, 0xc7, 0x25, 0xad, 0x75, 0xf4, 0xf2, 0xca, 0xa5, 0xef, 0x51, 0xfa, 0xca, 0x71, 0xb5, 0xe6, 0x6f, 0x84, 0xf2, 0xfc, 0x6f, 0x67, 0x8a, 0xce, 0x80, 0x9d, 0x76, 0xb8, 0x42, 0xea, 0xfe } +, + /* Seed */ + 63, + { 0x78, 0xa7, 0x18, 0x82, 0x85, 0x3d, 0x85, 0xaf, 0x16, 0x5c, 0xc0, 0xb2, 0x2f, 0xfd, 0xc8, 0x87, 0x3d, 0xf4, 0x9e, 0x2d, 0x6c, 0xc0, 0xad, 0x0b, 0x0a, 0x99, 0x5b, 0x4a, 0x25, 0x9c, 0x86, 0x7d, 0xc1, 0xaa, 0xb6, 0x42, 0x8a, 0x5b, 0x8e, 0x9f, 0x3b, 0xe8, 0x7d, 0x87, 0xf9, 0xe6, 0xea, 0xc5, 0x50, 0xf4, 0xdf, 0x11, 0x36, 0x8e, 0x7f, 0x6c, 0xfd, 0x7d, 0x0e, 0x47, 0x6a, 0x45, 0x9b } +, + /* Encryption */ + 129, + { 0x06, 0x2a, 0x78, 0xdb, 0x5c, 0xa6, 0x9a, 0x30, 0x48, 0x10, 0x78, 0x94, 0x93, 0xdb, 0x8c, 0xd6, 0x44, 0xfb, 0x29, 0x4e, 0x17, 0xfd, 0x36, 0x45, 0x32, 0xb8, 0xec, 0x17, 0xce, 0x3f, 0xda, 0x70, 0x47, 0x64, 0x65, 0x62, 0x4a, 0x60, 0xa6, 0xec, 0xdb, 0xd5, 0xd9, 0x72, 0x40, 0xc8, 0xd8, 0x9d, 0xea, 0xc1, 0x1d, 0xc3, 0x0d, 0x7b, 0x85, 0x14, 0x41, 0x40, 0x8e, 0xdd, 0x64, 0x28, 0x81, 0xa0, 0x11, 0x2b, 0x62, 0xf8, 0xcf, 0xde, 0x34, 0xd9, 0xc1, 0x13, 0x85, 0xc2, 0x91, 0x89, 0xbf, 0x38, 0x93, 0xa6, 0xab, 0xac, 0xe0, 0x4a, 0x10, 0xaa, 0x68, 0x0c, 0xd3, 0xa6, 0xee, 0x00, 0x2c, 0x30, 0x70, 0x35, 0xd2, 0x39, 0x9a, 0x2a, 0x60, 0xb5, 0xa7, 0xf1, 0xca, 0xaf, 0x05, 0x84, 0xd1, 0x0f, 0xd0, 0x6d, 0x6e, 0xfd, 0x56, 0x11, 0x4c, 0x05, 0xe4, 0x3d, 0x42, 0xd8, 0x34, 0xf0, 0x3e, 0x3f, 0xe9 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.18", + /* Message */ + 32, + { 0x8c, 0xb7, 0x3b, 0xc4, 0x78, 0x50, 0xc1, 0x7f, 0xeb, 0xd3, 0x4f, 0xf4, 0xb7, 0x32, 0x3b, 0x50, 0x53, 0x03, 0x0b, 0x96, 0x22, 0x14, 0x03, 0xcd, 0xef, 0x45, 0xde, 0xc6, 0x5b, 0xa6, 0x0e, 0xa3 } +, + /* Seed */ + 94, + { 0xed, 0x64, 0x78, 0x61, 0x48, 0x81, 0xeb, 0xe3, 0xfd, 0xd6, 0xd9, 0xee, 0x05, 0xf2, 0x76, 0x5f, 0xc8, 0xa3, 0x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x02, 0x42, 0xb3, 0x0b, 0x32, 0x42, 0x07, 0x88, 0x16, 0xb5, 0x8b, 0x0a, 0x9f, 0xfa, 0x16, 0xf1, 0xd8, 0x63, 0x15, 0xf8, 0xa1, 0xcb, 0x2f, 0x8f, 0x6b } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.19", + /* Message */ + 56, + { 0x8e, 0xa5, 0x56, 0x43, 0xdf, 0xe7, 0xcb, 0xe0, 0x75, 0xc1, 0x7b, 0x93, 0xc6, 0xba, 0x6b, 0x5a, 0x74, 0xea, 0x8d, 0x1a, 0xba, 0xb9, 0xc7, 0x28, 0xae, 0x5b, 0x00, 0x86, 0x6c, 0x62, 0x88, 0x0d, 0x3c, 0x00, 0x05, 0x20, 0x37, 0xcf, 0x80, 0x2d, 0x2c, 0xf2, 0xa8, 0xe1, 0xbe, 0xa5, 0x8c, 0x7b, 0xa6, 0x04, 0x77, 0x4d, 0x4f, 0x80, 0xbc, 0x04 } +, + /* Seed */ + 70, + { 0xaf, 0x9d, 0x9d, 0x31, 0x2e, 0x22, 0x57, 0x0f, 0xbc, 0x4b, 0xc8, 0x5a, 0x44, 0x5e, 0xd8, 0xd8, 0x99, 0x66, 0x0e, 0xd2, 0x4c, 0xf0, 0x30, 0x15, 0x33, 0x94, 0x6e, 0x5c, 0xb9, 0x47, 0x1a, 0x27, 0xc5, 0x10, 0xcd, 0x17, 0x55, 0x91, 0xd2, 0x3d, 0x36, 0x3d, 0xc4, 0xe3, 0xe6, 0x9c, 0x7b, 0xb4, 0x65, 0x51, 0x7a, 0x4c, 0xd1, 0xd1, 0xce, 0x41, 0x3e, 0x10, 0x16, 0xae, 0xaf, 0xd5, 0x5d, 0x2c, 0xb9, 0xde, 0xbc, 0xfe, 0x4b, 0x1d } +, + /* Encryption */ + 129, + { 0x05, 0x87, 0x11, 0x19, 0x16, 0xbb, 0x42, 0xf8, 0x47, 0x57, 0x69, 0x1e, 0xfe, 0xde, 0x7e, 0xb7, 0x79, 0x6a, 0x5c, 0xf8, 0x87, 0xc3, 0x7c, 0xa9, 0xf6, 0x1b, 0x45, 0x1f, 0xb1, 0xba, 0xde, 0x38, 0x9c, 0xfc, 0x5f, 0xdc, 0x21, 0x98, 0x41, 0xbb, 0x41, 0xda, 0x82, 0x74, 0x52, 0x72, 0x5f, 0xc8, 0x2b, 0x4d, 0x1a, 0xde, 0x56, 0x9c, 0xee, 0xc8, 0x05, 0x79, 0xed, 0xb1, 0xb4, 0xb1, 0x5b, 0x46, 0xad, 0x7d, 0x45, 0xb2, 0x45, 0x98, 0x80, 0x23, 0xea, 0x0d, 0xfc, 0xb3, 0x74, 0x4a, 0x69, 0x2e, 0xb9, 0xac, 0xa8, 0x5f, 0x21, 0x10, 0x10, 0xaf, 0xb1, 0xe9, 0x89, 0x4f, 0x85, 0x4a, 0x5e, 0x34, 0xfe, 0x89, 0xaa, 0x05, 0x19, 0x68, 0xa3, 0xb2, 0x36, 0x2c, 0x15, 0x0c, 0x6d, 0x97, 0x0e, 0xdd, 0x82, 0xb9, 0xe2, 0xd1, 0x3b, 0x38, 0xc3, 0xc2, 0x95, 0x6d, 0x91, 0x50, 0x08, 0x86, 0x41, 0xd5, 0x30 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 9.20", + /* Message */ + 4, + { 0x52, 0x5c, 0xff, 0xa3 } +, + /* Seed */ + 122, + { 0x0c, 0x99, 0x30, 0x4c, 0xc6, 0x26, 0x3d, 0x1e, 0xe2, 0x44, 0x6e, 0x24, 0x8c, 0x27, 0x11, 0x2c, 0x8f, 0x96, 0xda, 0x82, 0x51, 0x5f, 0x06, 0xf8, 0x12, 0x39, 0x8a, 0x88, 0x81, 0x1f, 0x39, 0xfb, 0x05, 0x62, 0x05, 0xc4, 0x4d, 0x6b, 0xd4, 0x85, 0x5a, 0x62, 0xc2, 0x1c, 0x60, 0x1b, 0x88, 0xf8, 0x02, 0x34, 0xe2, 0x32, 0x41, 0xf7, 0x16, 0x32, 0x2d, 0x80, 0x54, 0xa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45, 0xee, 0xb1, 0x86, 0xec, 0x19, 0x2c, 0x54, 0x0a, 0xc2, 0x3c } + +} +, +} +}, +{ + "Example 10: A 1028-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x0b, 0x52, 0xcb, 0x6b, 0x5c, 0x3b, 0x9e, 0xc5, 0xaa, 0xad, 0x89, 0x4e, 0x51, 0x77, 0xf7, 0xf4, 0x5b, 0x8d, 0x33, 0xdc, 0xbb, 0xe9, 0x6a, 0x5b, 0x26, 0xf3, 0x00, 0x72, 0xbf, 0x15, 0x73, 0xa6, 0xc4, 0x1f, 0xb0, 0xa9, 0x7a, 0xe1, 0xe5, 0x2e, 0xd8, 0xc2, 0x5c, 0x62, 0xb9, 0x8b, 0xf5, 0x9d, 0xe7, 0xb6, 0x8a, 0xb9, 0x8c, 0x2d, 0x8b, 0x93, 0xc4, 0x94, 0x27, 0x23, 0xcc, 0x4b, 0xae, 0xd2, 0xb3, 0x93, 0xc0, 0x7b, 0x2b, 0x11, 0x90, 0x9c, 0x73, 0x2d, 0xf7, 0xc1, 0xdc, 0xbb, 0x43, 0x3a, 0x83, 0x9d, 0x46, 0xf4, 0x28, 0xe9, 0xdd, 0xc8, 0xd3, 0x5f, 0xd3, 0x3e, 0xed, 0x29, 0x81, 0x80, 0xf7, 0x5f, 0x2d, 0x5c, 0x9f, 0xe8, 0x53, 0x4f, 0x03, 0x47, 0xf8, 0x68, 0x5c, 0x28, 0xc4, 0x37, 0xea, 0x5b, 0x81, 0x1a, 0x28, 0x6e, 0x81, 0x0c, 0x69, 0x7a, 0x88, 0xcd, 0x7e, 0x45, 0x36, 0x4c, 0x1f } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x45, 0xcc, 0x14, 0x17, 0xb2, 0x6f, 0xce, 0x3e, 0x9f, 0xd3, 0x10, 0x89, 0xb1, 0xa3, 0xcc, 0xc4, 0x6f, 0x8f, 0xf2, 0x1e, 0xac, 0x2e, 0x1d, 0x67, 0xc0, 0xae, 0x20, 0x15, 0x2d, 0xc5, 0x0d, 0x1c, 0xe7, 0xce, 0x6f, 0x26, 0x40, 0x4e, 0x2e, 0x64, 0x95, 0xb9, 0x77, 0xbf, 0x13, 0xf9, 0xa4, 0x05, 0xb2, 0x45, 0x80, 0xd6, 0x39, 0x3a, 0x85, 0x22, 0x54, 0x96, 0xe4, 0xab, 0xc4, 0x9e, 0xbe, 0xff, 0xde, 0x70, 0xcf, 0x26, 0x76, 0x68, 0x66, 0xf2, 0x76, 0xe1, 0x5b, 0x49, 0x2a, 0xf8, 0x03, 0x3f, 0x1b, 0xac, 0x7f, 0x66, 0xb7, 0x1a, 0x3b, 0xaf, 0x57, 0x1f, 0xfc, 0xcc, 0x03, 0x8a, 0x48, 0x86, 0x93, 0x94, 0xcc, 0xa3, 0xfa, 0x00, 0x49, 0x85, 0xb4, 0x34, 0xa5, 0x15, 0x17, 0x87, 0x7e, 0xae, 0x97, 0xa3, 0x84, 0x94, 0x7f, 0x01, 0xa7, 0x2c, 0xf4, 0xb2, 0x01, 0x93, 0xdd, 0x27, 0x64, 0x81 } +, + /* Prime 1 */ + 65, + { 0x03, 0x5f, 0xed, 0xee, 0x7e, 0x64, 0xfd, 0x68, 0x65, 0x79, 0x31, 0xa9, 0xdf, 0x9d, 0x55, 0x62, 0x28, 0xdf, 0xc6, 0x33, 0xa7, 0x50, 0x02, 0x76, 0x8f, 0x65, 0xd7, 0x15, 0xf0, 0x44, 0xf2, 0x3b, 0x3f, 0xe7, 0x88, 0xbb, 0x17, 0x86, 0x4d, 0x61, 0xdf, 0x57, 0x9e, 0x68, 0xdf, 0x80, 0xde, 0xa3, 0xa6, 0x31, 0x90, 0x62, 0x9d, 0xac, 0x7d, 0xe6, 0x29, 0xef, 0x9a, 0xb8, 0xf4, 0xdf, 0x0b, 0x27, 0x7f } +, + /* Prime 2 */ + 65, + { 0x03, 0x5a, 0xf8, 0xe6, 0xfe, 0x2f, 0x84, 0x61, 0xfc, 0x89, 0xa6, 0x45, 0x00, 0xf8, 0x19, 0x9c, 0xcb, 0xd3, 0xf4, 0x69, 0x07, 0x85, 0x96, 0x15, 0x56, 0x03, 0xd3, 0xf0, 0x88, 0x08, 0x33, 0xc3, 0x77, 0xdb, 0x07, 0x8e, 0x43, 0x7e, 0x35, 0x60, 0x00, 0x4a, 0xd1, 0xd6, 0xf8, 0xd3, 0x47, 0x88, 0x3f, 0x3e, 0xb0, 0x1d, 0x18, 0x9d, 0x52, 0xef, 0xf6, 0xe2, 0x60, 0xe5, 0x2f, 0xba, 0xa6, 0x2b, 0x61 } +, + /* Prime exponent 1 */ + 64, + { 0xb2, 0x43, 0xb3, 0x49, 0x8b, 0x67, 0x2a, 0xaa, 0x7d, 0x96, 0x7c, 0xd9, 0xf2, 0x6a, 0x12, 0xe6, 0x22, 0x3e, 0x90, 0x9b, 0xfe, 0x8b, 0x73, 0x91, 0x65, 0x4f, 0x3b, 0x6c, 0xa7, 0x9d, 0x60, 0x12, 0x70, 0xa1, 0x2b, 0x11, 0xd0, 0x99, 0x99, 0x0f, 0x6f, 0xd1, 0xf5, 0x0b, 0xe1, 0x58, 0x8f, 0x66, 0x14, 0xa6, 0x19, 0x63, 0x35, 0x9b, 0x88, 0xe9, 0xb0, 0x52, 0x39, 0xc5, 0xf5, 0x5c, 0x24, 0xdb } +, + /* Prime exponent 2 */ + 65, + { 0x01, 0x35, 0x25, 0xad, 0xe5, 0x3f, 0xee, 0xd2, 0x61, 0x54, 0x9d, 0x3d, 0xea, 0x8a, 0x60, 0x95, 0x79, 0x1a, 0x90, 0xb5, 0x98, 0x5a, 0x70, 0xd8, 0xbe, 0xfb, 0x63, 0xb5, 0x07, 0x10, 0x84, 0xa8, 0xce, 0x23, 0x4b, 0x85, 0xdd, 0x2e, 0xb8, 0x41, 0x13, 0xf9, 0xd9, 0xaa, 0x18, 0x25, 0xda, 0x71, 0xe3, 0xe9, 0x48, 0xf3, 0x3f, 0xdf, 0xa7, 0x70, 0xec, 0x17, 0x2f, 0xae, 0x6c, 0xce, 0x2d, 0x6e, 0x21 } +, + /* Coefficient */ + 64, + { 0x1c, 0x52, 0x92, 0x93, 0x3c, 0x58, 0xd0, 0x22, 0x59, 0x2f, 0xc0, 0x03, 0x38, 0xbf, 0x22, 0xed, 0xfc, 0xba, 0x33, 0x16, 0x16, 0xb7, 0x9f, 0x8d, 0x2e, 0xfd, 0x1f, 0xa2, 0x4c, 0x64, 0xf5, 0xdc, 0xfa, 0xd9, 0xaa, 0x52, 0xba, 0xa4, 0x6e, 0x86, 0x59, 0xdd, 0xa9, 0xea, 0xb3, 0xa7, 0x86, 0x3e, 0x61, 0x37, 0x4a, 0xc0, 0xda, 0xe0, 0x18, 0x5f, 0xb5, 0x8e, 0xcb, 0x0b, 0x74, 0x65, 0xee, 0x07 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 10.1", + /* Message */ + 46, + { 0x59, 0x22, 0xd0, 0x9f, 0xdf, 0x65, 0x22, 0x80, 0x2f, 0xbc, 0xf7, 0xa2, 0x8e, 0xc3, 0xd9, 0xfa, 0xdf, 0x60, 0x72, 0x03, 0xa3, 0x1b, 0xd0, 0xda, 0x96, 0x3a, 0xa0, 0x31, 0x5f, 0x35, 0xe1, 0xa0, 0xa3, 0x74, 0xd4, 0x87, 0xdd, 0x08, 0x62, 0xa6, 0xf6, 0xbe, 0xc9, 0x32, 0xb7, 0xdb } +, + /* Seed */ + 80, + { 0x61, 0x39, 0x5a, 0x0f, 0xa1, 0x2e, 0x1e, 0xc2, 0xff, 0xea, 0x2a, 0x88, 0x90, 0x65, 0x3e, 0x8f, 0x37, 0x8d, 0xc4, 0x6c, 0xe2, 0xb8, 0xaa, 0x4a, 0x0a, 0x1c, 0x56, 0x7b, 0x30, 0xe5, 0x9c, 0x3a, 0x33, 0xa6, 0x68, 0x98, 0x97, 0x14, 0xfc, 0x3d, 0x45, 0xac, 0x88, 0x63, 0x27, 0xe3, 0x6c, 0x34, 0x5d, 0xa8, 0x58, 0xf9, 0x03, 0xd1, 0xe6, 0x06, 0x74, 0x03, 0x14, 0xcb, 0x80, 0x8d, 0x86, 0xab, 0xc3, 0x1b, 0x49, 0xb3, 0x5b, 0x3f, 0x20, 0xe3, 0x79, 0x29, 0xdc, 0xc8, 0x59, 0xd5, 0x91, 0x41 } +, + /* Encryption */ + 129, + { 0x04, 0x39, 0xe7, 0xdd, 0x09, 0xaf, 0x61, 0xc0, 0xee, 0x25, 0xf3, 0xe5, 0xc2, 0x95, 0x1d, 0xa4, 0x9d, 0x3f, 0xd7, 0x08, 0xb2, 0x97, 0xa3, 0x05, 0x5f, 0xf9, 0x98, 0x3a, 0x9e, 0xa5, 0x38, 0xb8, 0x3d, 0x59, 0xda, 0xbd, 0xb8, 0x5d, 0xaf, 0x82, 0xae, 0x7b, 0xb1, 0x97, 0x8e, 0x7d, 0xa2, 0xa6, 0xdc, 0x05, 0x87, 0xef, 0x9c, 0x73, 0x2e, 0xe6, 0x88, 0x37, 0x3f, 0xbc, 0xbf, 0xa2, 0xda, 0xcf, 0xf9, 0xb3, 0xc1, 0x2f, 0x70, 0x4e, 0xe1, 0x4f, 0x83, 0x24, 0xbd, 0x4c, 0xc6, 0xbf, 0x9d, 0xcd, 0x3f, 0x05, 0x33, 0xc3, 0xb1, 0x1a, 0x0d, 0x38, 0xdb, 0xcc, 0x7b, 0xb7, 0xef, 0x9a, 0x72, 0x29, 0x6b, 0x6c, 0x13, 0xdc, 0x42, 0xd7, 0xec, 0x17, 0xf8, 0x51, 0xa5, 0x16, 0x12, 0xc7, 0x49, 0x4c, 0x63, 0x68, 0xa7, 0xfb, 0xec, 0x93, 0xd2, 0x2e, 0x8f, 0x9b, 0x72, 0xbd, 0xc0, 0x44, 0x9f, 0xb4, 0x30 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.2", + /* Message */ + 62, + { 0x5f, 0xba, 0xd4, 0x3a, 0x91, 0x0a, 0x29, 0x0e, 0x50, 0x55, 0xd5, 0x14, 0xe7, 0x1c, 0x8e, 0xab, 0xf1, 0xf9, 0x33, 0x20, 0xeb, 0xd0, 0xda, 0x8f, 0x90, 0xd1, 0x46, 0xa8, 0xf3, 0xdd, 0x5c, 0x1a, 0x2c, 0x72, 0x0b, 0x93, 0x21, 0x1e, 0x48, 0x29, 0x34, 0x14, 0x9f, 0x1d, 0x21, 0xb9, 0x78, 0xf4, 0x8a, 0x0b, 0xb8, 0xe4, 0xcc, 0xa3, 0xf5, 0xd4, 0x5d, 0x3f, 0x3e, 0x3b, 0xa8, 0xe1 } +, + /* Seed */ + 64, + { 0x21, 0x04, 0x52, 0x61, 0x80, 0x4b, 0xf7, 0x54, 0xbc, 0xb8, 0xbf, 0x34, 0x98, 0xb1, 0xad, 0x10, 0xaf, 0xf3, 0x3d, 0xa1, 0xf2, 0x25, 0xed, 0xa5, 0x64, 0x65, 0x90, 0x45, 0x8b, 0x20, 0x70, 0x9f, 0xc8, 0xd0, 0xb4, 0x98, 0x90, 0x7a, 0x83, 0x64, 0xce, 0x1c, 0x43, 0x6b, 0x6b, 0x1e, 0x73, 0x18, 0x1c, 0x86, 0xc6, 0x77, 0xaf, 0x45, 0xc1, 0x7f, 0x9e, 0x4a, 0xf3, 0x75, 0x9c, 0xad, 0x24, 0x87 } +, + /* Encryption */ + 129, + { 0x02, 0x9f, 0x64, 0xac, 0x33, 0x01, 0x34, 0x00, 0x7f, 0x77, 0xf7, 0x2c, 0x37, 0xf4, 0x17, 0x7c, 0x24, 0xd6, 0x60, 0xbe, 0x4e, 0xba, 0xc1, 0x86, 0x8a, 0xd1, 0x1f, 0x9e, 0x30, 0x51, 0xb8, 0xcd, 0x77, 0xc4, 0x69, 0x11, 0x99, 0xac, 0x49, 0x19, 0xdb, 0x2e, 0xd3, 0x63, 0x74, 0x0d, 0x2d, 0xde, 0x32, 0x91, 0xf1, 0x0d, 0x92, 0x68, 0xe7, 0xc7, 0xde, 0x37, 0xea, 0x42, 0x1e, 0xbb, 0x1f, 0xad, 0x65, 0x29, 0xf2, 0x92, 0x19, 0x2a, 0x96, 0x80, 0xba, 0x96, 0x3e, 0xda, 0x93, 0x74, 0x03, 0x7a, 0xb9, 0x52, 0x9a, 0x48, 0x6f, 0x35, 0xcb, 0xd2, 0x9e, 0x09, 0xea, 0x98, 0xa5, 0x04, 0x5d, 0x9e, 0x16, 0xbb, 0x87, 0x70, 0x15, 0x5d, 0x70, 0xaf, 0xd2, 0x17, 0xa1, 0x46, 0x86, 0x27, 0x49, 0xec, 0x1a, 0xd1, 0x59, 0xcf, 0x6e, 0x6a, 0x63, 0xdf, 0x14, 0x2b, 0x82, 0x46, 0xd8, 0x44, 0xa7, 0x37, 0x2d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.3", + /* Message */ + 62, + { 0x22, 0xbb, 0xc6, 0x16, 0xec, 0x6e, 0xf3, 0x57, 0x31, 0x56, 0xb4, 0x17, 0x61, 0xac, 0x3b, 0xdb, 0x57, 0xbd, 0x9b, 0x70, 0x36, 0xed, 0xc9, 0xa6, 0x97, 0x88, 0x75, 0xe2, 0xa6, 0x14, 0xcd, 0xe3, 0xef, 0xed, 0xaf, 0xd3, 0x88, 0x9a, 0x5d, 0xbd, 0xcc, 0x5f, 0xad, 0x9e, 0x9b, 0xec, 0xf8, 0xa8, 0xbb, 0x80, 0x33, 0xff, 0x91, 0xdf, 0xed, 0x60, 0x4b, 0xf8, 0xc6, 0xe9, 0xbb, 0xc7 } +, + /* Seed */ + 64, + { 0x3b, 0x47, 0xd2, 0xca, 0x95, 0x54, 0xb3, 0x4f, 0x94, 0x29, 0x57, 0x8d, 0x4f, 0xde, 0xc5, 0xd9, 0x6e, 0xca, 0x89, 0xb6, 0x81, 0x72, 0xd1, 0xdb, 0x13, 0x56, 0xb3, 0xda, 0x7a, 0x69, 0xf1, 0x58, 0x4d, 0x4c, 0x84, 0x6b, 0x18, 0x43, 0x2f, 0x02, 0xf2, 0x59, 0xca, 0xdc, 0x24, 0xe1, 0x54, 0xff, 0x15, 0xf8, 0x06, 0xf2, 0x53, 0x43, 0x50, 0x0e, 0x13, 0xb5, 0xbe, 0x43, 0xc7, 0xb5, 0xae, 0x7e } +, + /* Encryption */ + 129, + { 0x00, 0xc4, 0xe6, 0xc1, 0x0c, 0x25, 0x5e, 0x4b, 0xeb, 0x2b, 0x31, 0xc1, 0x65, 0x68, 0x46, 0xb9, 0x7c, 0xa2, 0x3a, 0x3b, 0xa3, 0x2a, 0xb1, 0x9c, 0x64, 0x85, 0x20, 0x11, 0x3d, 0x70, 0x34, 0xdf, 0xa4, 0x6b, 0x0c, 0xd2, 0x3d, 0x73, 0x99, 0xa9, 0x3c, 0xb0, 0x2f, 0x1e, 0xba, 0x94, 0x83, 0x18, 0xe3, 0x79, 0x1c, 0x30, 0x6a, 0x2e, 0xb9, 0xc0, 0xc5, 0x6d, 0x8f, 0x7e, 0x83, 0x25, 0x0f, 0x83, 0xad, 0x49, 0x2f, 0xad, 0xf7, 0x83, 0x17, 0x69, 0xf0, 0x2e, 0x18, 0x24, 0x34, 0x74, 0x45, 0xd0, 0x41, 0x9b, 0x98, 0xb8, 0xe7, 0x95, 0x45, 0x65, 0x32, 0x30, 0x0b, 0x92, 0xd6, 0xe4, 0x55, 0xb5, 0xa4, 0xeb, 0xa8, 0x53, 0xd6, 0xf7, 0x45, 0x92, 0x90, 0xab, 0x02, 0x31, 0x99, 0x48, 0x53, 0xa8, 0xc0, 0x7e, 0x54, 0xf5, 0x9c, 0x62, 0x45, 0x37, 0x08, 0x02, 0x89, 0xf9, 0x31, 0x43, 0xeb, 0xc6, 0x61 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.4", + /* Message */ + 50, + { 0x31, 0x6c, 0xc4, 0x45, 0x0a, 0x53, 0x70, 0x3c, 0x05, 0x8c, 0x90, 0x1f, 0x50, 0x7d, 0x7a, 0xd0, 0xcb, 0x63, 0x96, 0xc5, 0x51, 0xd4, 0xf0, 0x61, 0x82, 0xab, 0xd3, 0xa4, 0x3a, 0xac, 0xba, 0xbb, 0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0xc1, 0xf0, 0x4c, 0x94, 0xc8, 0x6d, 0x47, 0x7d, 0xb4, 0x03, 0xb0, 0x4f, 0xb6, 0xc0, 0x28, 0x50, 0x57, 0x24, 0x79, 0x38, 0x40, 0xcb, 0xf4, 0x68, 0xaa, 0xaa, 0x91, 0xbc, 0x54, 0xe0, 0xd6, 0x47, 0x7c, 0xe6, 0x48, 0xce, 0xdd, 0x12, 0x76, 0xf2, 0xad, 0x2d, 0x4d, 0x42, 0x3b, 0x6c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.5", + /* Message */ + 51, + { 0xd5, 0x4e, 0xa3, 0x7c, 0xbf, 0xbd, 0xb8, 0x18, 0x3b, 0x3b, 0x54, 0x7f, 0x6d, 0xf2, 0xd5, 0xd6, 0x3c, 0x41, 0x5b, 0x1c, 0x44, 0xed, 0x63, 0x93, 0xc6, 0x97, 0xb4, 0xd9, 0x3a, 0x97, 0xfa, 0x0d, 0x2f, 0x4d, 0x30, 0x0a, 0x68, 0xe9, 0x8f, 0x7f, 0xd0, 0x46, 0x07, 0x01, 0xd1, 0x57, 0x9d, 0x96, 0x83, 0x61, 0x2b } +, + /* Seed */ + 75, + { 0xd1, 0xce, 0xb0, 0xc0, 0x72, 0xd6, 0x88, 0x8f, 0xa9, 0x1a, 0x75, 0x7c, 0xbf, 0x50, 0xd6, 0x69, 0x76, 0xbb, 0xb7, 0x2e, 0x61, 0x94, 0x62, 0x61, 0x4d, 0x5d, 0xec, 0x0f, 0xc0, 0xbb, 0xca, 0xbb, 0x07, 0x07, 0x89, 0xc2, 0xb0, 0x89, 0x50, 0x91, 0xb8, 0xfa, 0x9c, 0x7e, 0x75, 0xab, 0x20, 0xb8, 0x97, 0x58, 0xf9, 0x7f, 0xd0, 0x47, 0xbc, 0x44, 0xa5, 0x68, 0xa2, 0x61, 0x2d, 0x0d, 0x50, 0x1d, 0x15, 0xd4, 0xfb, 0x82, 0xe7, 0x75, 0x28, 0x79, 0x69, 0x49, 0xf3 } +, + /* Encryption */ + 129, + { 0x03, 0xc1, 0x38, 0xc7, 0x91, 0x99, 0xb0, 0xb1, 0x70, 0x0b, 0xab, 0x2e, 0x63, 0xe1, 0xd2, 0xa0, 0x03, 0x1e, 0xf6, 0x02, 0xf7, 0xdd, 0xf1, 0xed, 0x3a, 0x16, 0x1a, 0x5e, 0x70, 0xf1, 0x64, 0x51, 0xda, 0xa1, 0x01, 0xf7, 0x4c, 0xdd, 0x65, 0x47, 0xa7, 0xc6, 0x52, 0xc7, 0x32, 0x9b, 0xb1, 0x73, 0x7f, 0xb1, 0x4c, 0x1c, 0xc0, 0xc0, 0xc3, 0xe7, 0x61, 0x2a, 0xe2, 0x0e, 0xe0, 0x21, 0xab, 0x21, 0xd7, 0x0b, 0xf9, 0x51, 0x7b, 0x4d, 0x33, 0xa9, 0xd8, 0x09, 0x61, 0x2e, 0x7f, 0x42, 0x68, 0x85, 0xb7, 0x9b, 0x31, 0x2e, 0x26, 0x6e, 0x42, 0xb2, 0x02, 0xb5, 0x71, 0xc6, 0x6f, 0x9a, 0x10, 0x7b, 0x8f, 0xd7, 0xc5, 0x6c, 0x05, 0x0a, 0x8e, 0x1e, 0xb1, 0x89, 0x56, 0xdb, 0x06, 0xa0, 0x20, 0x9d, 0xd1, 0x6e, 0xf2, 0xd9, 0x05, 0x24, 0xdb, 0x87, 0x91, 0x7f, 0x34, 0x00, 0x6b, 0xe6, 0xb1, 0x5a, 0x13 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.6", + /* Message */ + 9, + { 0xf6, 0x4b, 0x25, 0x11, 0xcb, 0xe3, 0xcc, 0x65, 0x81 } +, + /* Seed */ + 117, + { 0xda, 0xca, 0x19, 0x63, 0xcb, 0x3d, 0xe5, 0x24, 0x57, 0x79, 0xe9, 0x64, 0x77, 0xff, 0xda, 0x27, 0x7f, 0x4b, 0x92, 0x3f, 0xa9, 0xa8, 0xd9, 0x38, 0x5d, 0x52, 0x31, 0x69, 0x23, 0x3f, 0x58, 0x79, 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, 0xc8, 0xb5, 0x19, 0x93, 0x82, 0x1d, 0x76, 0xdf, 0x2a, 0xc2, 0x29, 0x8d, 0x8b, 0x80, 0xab, 0x17, 0xc3, 0x8b, 0x38, 0x53, 0xf1, 0x8f, 0xe3, 0x09, 0xcc, 0x7b, 0xf7, 0xc4, 0xa2, 0xc2, 0x7d, 0x63 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.7", + /* Message */ + 16, + { 0x85, 0x26, 0x49, 0x01, 0x52, 0x06, 0xe2, 0xa4, 0x09, 0x78, 0x76, 0xf8, 0xab, 0xb9, 0xb8, 0x46 } +, + /* Seed */ + 110, + { 0x03, 0x4f, 0xe3, 0x4e, 0x20, 0xe6, 0x06, 0xa8, 0xdc, 0x7c, 0xbc, 0xd0, 0xd6, 0xab, 0x3e, 0x07, 0x97, 0xc5, 0xdc, 0x4e, 0xd7, 0x86, 0x8e, 0xdc, 0x79, 0x59, 0x89, 0x3e, 0x58, 0x13, 0x7d, 0x26, 0x32, 0xb2, 0xc5, 0xa2, 0x9a, 0x81, 0x35, 0xc2, 0x4a, 0xf6, 0x99, 0xb5, 0x9d, 0x68, 0x10, 0x3a, 0x1f, 0x42, 0x33, 0x93, 0xe3, 0x88, 0x6e, 0x3f, 0xa8, 0x54, 0xe3, 0x97, 0x21, 0x50, 0x19, 0x41, 0x3a, 0xf0, 0xb0, 0xd4, 0xfb, 0x1b, 0xd6, 0x9b, 0xd4, 0x93, 0x4d, 0x4d, 0x1e, 0x2e, 0x9f, 0x3b, 0x9e, 0x7c, 0x46, 0xd4, 0x98, 0x4f, 0xe9, 0xe7, 0xa3, 0x7a, 0xb2, 0xf1, 0xc7, 0x8b, 0x0b, 0x8d, 0x9c, 0xd8, 0xfa, 0xbb, 0x3d, 0x18, 0xd4, 0xc5, 0x06, 0xe2, 0xfd, 0x3f, 0x85, 0xae } +, + /* Encryption */ + 129, + { 0x01, 0x6f, 0xbf, 0x2a, 0x7d, 0x36, 0x80, 0x71, 0xcc, 0x7b, 0xe5, 0x94, 0x49, 0x35, 0x4b, 0x9d, 0xe0, 0x5a, 0x85, 0xe1, 0xbb, 0x97, 0xb2, 0x51, 0x4b, 0x52, 0xb8, 0xd1, 0xf3, 0xe2, 0x69, 0x94, 0xe1, 0x2c, 0xfe, 0xda, 0x59, 0xe0, 0x58, 0xa2, 0xf3, 0xc8, 0x79, 0x23, 0x50, 0xc0, 0x68, 0x41, 0x7f, 0x99, 0x44, 0x1b, 0xfe, 0x74, 0x17, 0xe0, 0xb5, 0x31, 0x6e, 0x16, 0x3b, 0xa8, 0xd1, 0xf9, 0xe3, 0x2c, 0x59, 0xa4, 0x44, 0x98, 0x82, 0xf4, 0x7a, 0xd9, 0xb2, 0x4f, 0x68, 0x76, 0xd4, 0x78, 0xd3, 0xf5, 0xb7, 0xd2, 0x75, 0x35, 0x73, 0xe3, 0xf6, 0x97, 0xbf, 0x64, 0xc7, 0xb3, 0xac, 0x22, 0x28, 0xce, 0x69, 0xe7, 0x5e, 0x8e, 0x14, 0xab, 0x93, 0xf2, 0x19, 0x78, 0x05, 0x9a, 0x14, 0x3b, 0x87, 0x7c, 0x6d, 0xd4, 0x21, 0xb6, 0xe2, 0x0b, 0x07, 0x35, 0xa5, 0x36, 0x05, 0x55, 0x2a, 0xb0, 0xa8 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.8", + /* Message */ + 58, + { 0xf4, 0xfb, 0x50, 0xbe, 0xab, 0xec, 0xba, 0x77, 0xe7, 0x1d, 0xd8, 0xd1, 0x6c, 0x97, 0x5a, 0x86, 0xf6, 0x19, 0xea, 0x7d, 0xbf, 0x41, 0x96, 0x9a, 0x24, 0xba, 0xe2, 0xb8, 0x42, 0xc2, 0x69, 0xe0, 0xb4, 0xd6, 0xa2, 0x9e, 0x82, 0x9d, 0xbe, 0x2e, 0x49, 0x79, 0x9c, 0x9e, 0xd9, 0x71, 0xa3, 0x03, 0x35, 0xe6, 0xed, 0x9b, 0xf3, 0x9d, 0x12, 0x4b, 0xe0, 0xf8 } +, + /* Seed */ + 68, + { 0x9d, 0xbd, 0x92, 0xda, 0xee, 0xb8, 0x2b, 0xde, 0x81, 0x6c, 0x59, 0x3f, 0x70, 0x6b, 0x15, 0x92, 0x56, 0x85, 0x22, 0xbc, 0xa0, 0x79, 0x7f, 0x9e, 0x81, 0x1d, 0xd9, 0xdc, 0x0e, 0x89, 0x6e, 0x98, 0x4a, 0x4a, 0x9a, 0xce, 0x77, 0xde, 0xf5, 0xa9, 0x25, 0x0d, 0xb7, 0x95, 0x81, 0xaf, 0x33, 0xfb, 0x6d, 0xe2, 0x42, 0x7d, 0x1a, 0xf6, 0xa5, 0xf6, 0x92, 0x9f, 0xa8, 0xb6, 0x7b, 0xad, 0x02, 0x3f, 0x04, 0xb3, 0xff, 0xd2 } +, + /* Encryption */ + 129, + { 0x02, 0x92, 0xed, 0xfb, 0xac, 0x38, 0xe2, 0x22, 0x45, 0x45, 0xaf, 0x82, 0x86, 0x23, 0x27, 0x63, 0xbc, 0xb1, 0x8b, 0xae, 0x13, 0x70, 0x97, 0x99, 0xe3, 0x50, 0x77, 0x58, 0xd0, 0x14, 0x1a, 0xc2, 0x97, 0x6f, 0x30, 0xb8, 0x54, 0x67, 0xd7, 0x83, 0xab, 0xf6, 0xfc, 0x71, 0xdf, 0x61, 0x9e, 0x1a, 0x59, 0xe6, 0x23, 0x4f, 0x27, 0xb6, 0x32, 0xfe, 0xaa, 0xbf, 0xd9, 0x85, 0x33, 0x77, 0x35, 0x4d, 0x93, 0x3e, 0xf4, 0xec, 0x59, 0x94, 0xc0, 0xd5, 0x0d, 0x95, 0x2e, 0x0e, 0xce, 0x0b, 0xe1, 0xbe, 0x4d, 0x38, 0xf1, 0x1f, 0x66, 0xe7, 0xc3, 0xda, 0x88, 0xc8, 0x3b, 0x4b, 0xed, 0xcc, 0x06, 0x2e, 0x09, 0xf9, 0xaf, 0x95, 0xea, 0xca, 0xc0, 0x09, 0x9c, 0x52, 0x5f, 0x24, 0x1e, 0xa7, 0xd5, 0x65, 0xe1, 0xb7, 0x68, 0xcb, 0x97, 0x08, 0xf3, 0xbc, 0xd5, 0x91, 0x77, 0xb6, 0x76, 0x6a, 0x37, 0x34, 0x88 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.9", + /* Message */ + 56, + { 0x76, 0x91, 0x3e, 0x84, 0x8f, 0xb7, 0xb9, 0xfa, 0xca, 0x91, 0xba, 0xf4, 0xf4, 0x42, 0x01, 0x06, 0xa9, 0x4d, 0x6c, 0xe2, 0x5d, 0x14, 0x97, 0xfc, 0x4e, 0x7f, 0x85, 0x96, 0x54, 0x79, 0x5d, 0x7f, 0x24, 0x39, 0x9f, 0x3a, 0x12, 0x08, 0xaf, 0x02, 0x8e, 0x61, 0x67, 0x8a, 0x6d, 0x19, 0xa1, 0x86, 0x40, 0xb4, 0xd5, 0x0f, 0x75, 0x55, 0x86, 0x00 } +, + /* Seed */ + 70, + { 0x9c, 0xee, 0xaa, 0x26, 0x09, 0xba, 0x90, 0xeb, 0x61, 0xe4, 0xf7, 0x49, 0xc4, 0xcd, 0xa0, 0x1a, 0xea, 0x23, 0x68, 0x81, 0x76, 0x2d, 0xfc, 0x15, 0x0d, 0x97, 0xc1, 0x1e, 0xb6, 0x44, 0x0c, 0xb0, 0x57, 0xe5, 0x3c, 0x3f, 0xd9, 0xb3, 0x9e, 0x56, 0x0a, 0x46, 0xe9, 0xd3, 0xfa, 0x3a, 0xf3, 0xfe, 0xe5, 0xee, 0x2d, 0x02, 0xfa, 0x42, 0x49, 0xaf, 0x99, 0x98, 0xf5, 0x3e, 0xd0, 0x4d, 0xb0, 0x10, 0xe9, 0x6d, 0x8a, 0x01, 0xff, 0x6b } +, + /* Encryption */ + 129, + { 0x01, 0x96, 0x30, 0x89, 0xc3, 0x43, 0xed, 0x88, 0xb5, 0x6d, 0x6a, 0xcf, 0xef, 0xbc, 0x65, 0x5a, 0x37, 0xcc, 0xfd, 0x96, 0x20, 0x3f, 0x21, 0x87, 0x64, 0x69, 0x5a, 0xd3, 0x10, 0xc0, 0xb2, 0x66, 0x65, 0xee, 0x74, 0x5e, 0xb0, 0x10, 0xfc, 0x83, 0xbe, 0x8c, 0x20, 0x64, 0x5c, 0x43, 0x47, 0xdc, 0xd9, 0x44, 0x65, 0x5d, 0x9f, 0xe6, 0xcd, 0x98, 0x77, 0xdc, 0x70, 0xe5, 0xc1, 0x88, 0xcf, 0xc9, 0xa6, 0x6e, 0x71, 0xda, 0x74, 0x5c, 0xd3, 0xe1, 0xa7, 0xb7, 0xf5, 0xa1, 0xb2, 0x5b, 0x4f, 0xc1, 0x47, 0x0a, 0xdf, 0xbf, 0x7d, 0x8e, 0x45, 0xfb, 0x10, 0x7c, 0x5a, 0xeb, 0x50, 0xea, 0x8b, 0x56, 0xe0, 0x4c, 0xa5, 0x5b, 0x9b, 0x65, 0x2a, 0xd8, 0x34, 0xd9, 0xc9, 0x65, 0x77, 0xb6, 0x42, 0xef, 0x33, 0xf1, 0x64, 0xd4, 0x93, 0x1f, 0xb8, 0x9e, 0x0c, 0x8c, 0x6b, 0xf9, 0x17, 0x08, 0xfd, 0xa6, 0xdb } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.10", + /* Message */ + 44, + { 0xc3, 0x39, 0xf8, 0x57, 0xe4, 0xd0, 0x23, 0x1f, 0xa3, 0x7c, 0x06, 0xf0, 0x95, 0x6b, 0x4d, 0x53, 0xa6, 0xc5, 0x8e, 0x06, 0x10, 0xd8, 0xda, 0x43, 0x17, 0xdc, 0x84, 0x11, 0xd3, 0xa0, 0xf8, 0x98, 0x49, 0xb9, 0x4e, 0x8d, 0x7c, 0xcd, 0xb0, 0xc7, 0xd5, 0x33, 0x0c, 0x25 } +, + /* Seed */ + 82, + { 0x24, 0x90, 0x81, 0x6a, 0xc9, 0x69, 0x76, 0xca, 0x72, 0x5e, 0xb4, 0x98, 0xe2, 0xff, 0x04, 0x0a, 0xfe, 0x3d, 0x64, 0x17, 0xd3, 0x2e, 0x4f, 0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0x28, 0x3c, 0x5a, 0x5f, 0x74, 0xe3, 0x60, 0x13 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.11", + /* Message */ + 30, + { 0x47, 0x58, 0x65, 0xa5, 0x7b, 0xdb, 0x91, 0xad, 0xdf, 0x77, 0x7c, 0xc9, 0xd0, 0xa1, 0x7a, 0x71, 0xa9, 0xf9, 0x71, 0x0a, 0x93, 0x1b, 0xd0, 0xc3, 0x14, 0x9b, 0x23, 0x91, 0xa3, 0x53 } +, + /* Seed */ + 96, + { 0x56, 0x2f, 0x79, 0x70, 0x94, 0x6a, 0xc4, 0xcf, 0x05, 0xed, 0xfb, 0x26, 0x34, 0x16, 0x7e, 0x14, 0xd6, 0x65, 0x8d, 0x24, 0xcd, 0xae, 0xf7, 0x5b, 0x40, 0x7c, 0x90, 0x04, 0x81, 0x8e, 0xfa, 0x75, 0xd1, 0x64, 0x5e, 0x81, 0x52, 0xd1, 0xfc, 0x80, 0xd6, 0x99, 0xdf, 0xe9, 0x9a, 0x27, 0xa7, 0xdf, 0x99, 0x7a, 0x8a, 0x66, 0x47, 0x5a, 0xaf, 0xce, 0x41, 0x95, 0x98, 0xe2, 0xa1, 0x91, 0x99, 0xfc, 0x20, 0x53, 0xe3, 0xac, 0xdd, 0x07, 0xfe, 0xc8, 0xba, 0x61, 0xf2, 0xb0, 0x3e, 0xfc, 0x7d, 0xee, 0xd8, 0x15, 0xcd, 0xa8, 0x95, 0x2e, 0x21, 0xe3, 0xc0, 0xb9, 0xa9, 0x35, 0x2a, 0xb3, 0x6f, 0x5e } +, + /* Encryption */ + 129, + { 0x03, 0xe2, 0x68, 0xd7, 0xd1, 0x80, 0xd0, 0x3c, 0x7c, 0xbc, 0x85, 0x07, 0xed, 0x1f, 0x83, 0x0e, 0xd3, 0x7a, 0x79, 0x95, 0x71, 0x2d, 0x7d, 0x91, 0x57, 0x32, 0x24, 0x3d, 0xe6, 0x85, 0xd5, 0xbd, 0x99, 0xa1, 0x4a, 0x8e, 0x86, 0xa6, 0x7c, 0xdd, 0x60, 0xdc, 0xd9, 0x0c, 0x33, 0x92, 0x10, 0x83, 0x5a, 0x46, 0xce, 0xac, 0x19, 0x36, 0xab, 0x3a, 0xa9, 0xc3, 0x81, 0x88, 0x2d, 0x76, 0x94, 0xa8, 0x38, 0x3d, 0x68, 0x98, 0xe2, 0x73, 0x44, 0xbd, 0x15, 0x6f, 0xe9, 0x28, 0x2c, 0x71, 0x32, 0x26, 0x25, 0xd6, 0x8d, 0x30, 0x70, 0xef, 0xf0, 0x1a, 0xc8, 0xd5, 0x95, 0xf6, 0x48, 0x6d, 0x79, 0xb7, 0x88, 0xe3, 0x69, 0x12, 0xfd, 0x3c, 0xcf, 0x28, 0x4e, 0xdd, 0x5f, 0xce, 0xe2, 0x40, 0x9d, 0xca, 0x7d, 0x4f, 0x29, 0xcc, 0x18, 0x2a, 0x78, 0x47, 0x8b, 0xd3, 0xea, 0x23, 0x62, 0x11, 0x25, 0x10, 0xa5 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.12", + /* Message */ + 26, + { 0x9e, 0x1e, 0x53, 0xf9, 0x86, 0x59, 0x9d, 0xa8, 0x98, 0xd5, 0x6d, 0xc1, 0xc7, 0x55, 0x6f, 0xef, 0xca, 0xa3, 0x39, 0x5d, 0x84, 0x50, 0xd5, 0x2b, 0x3b, 0xa7 } +, + /* Seed */ + 100, + { 0x0b, 0x17, 0x63, 0xcc, 0x34, 0x0e, 0x6e, 0x39, 0x78, 0x62, 0x6a, 0x06, 0xd6, 0xef, 0xc4, 0x0d, 0xed, 0x73, 0xdb, 0x53, 0x5a, 0x82, 0x2e, 0xc0, 0x4c, 0x99, 0x24, 0xd9, 0xec, 0x40, 0xd3, 0x85, 0x20, 0x15, 0xd7, 0xe1, 0x02, 0x9c, 0x13, 0x93, 0xad, 0xcf, 0x01, 0x50, 0x30, 0x8a, 0xcb, 0x27, 0x3c, 0x36, 0x35, 0x68, 0x28, 0xa4, 0x77, 0xfc, 0xf9, 0xa2, 0x9a, 0xca, 0xb9, 0x09, 0x35, 0x70, 0x42, 0x50, 0x26, 0xda, 0xc1, 0x4d, 0xa6, 0xcd, 0x30, 0x4c, 0xda, 0xa5, 0x4c, 0x9a, 0x4c, 0x5a, 0x99, 0x4e, 0xd6, 0x8a, 0x5c, 0xea, 0xc7, 0xe0, 0x81, 0xde, 0xc4, 0x64, 0x6e, 0x23, 0x7e, 0x47, 0x1e, 0x52, 0x5e, 0xf8 } +, + /* Encryption */ + 129, + { 0x06, 0xd5, 0x19, 0xa7, 0x30, 0xea, 0x5f, 0x54, 0x9f, 0xe1, 0x9e, 0x30, 0x1b, 0xa5, 0x15, 0x2d, 0x10, 0x3a, 0x3e, 0xad, 0x3f, 0x89, 0xab, 0x35, 0x16, 0xff, 0x7b, 0x34, 0x4c, 0x4f, 0x72, 0xa1, 0xc2, 0x6a, 0xa9, 0x0d, 0x5a, 0x01, 0xa2, 0xa6, 0x51, 0x93, 0xd3, 0xcf, 0x63, 0x41, 0xe5, 0x9a, 0x31, 0xfd, 0x2d, 0x7d, 0xfe, 0x43, 0x5c, 0x09, 0x84, 0xd1, 0xbb, 0xe8, 0x11, 0x32, 0x01, 0x0f, 0x43, 0x58, 0xee, 0xbf, 0xe8, 0x3f, 0xaf, 0x24, 0x1e, 0x7f, 0x35, 0xaf, 0x98, 0xb7, 0xc7, 0xab, 0x91, 0xe4, 0xf0, 0xe8, 0xa3, 0x2a, 0x2f, 0x57, 0xf0, 0x7f, 0x49, 0xd5, 0xc2, 0x1f, 0x1e, 0x13, 0x80, 0xba, 0x0e, 0x17, 0x9a, 0x38, 0xd3, 0xa2, 0xca, 0x46, 0x4f, 0xc1, 0x4d, 0x2b, 0x74, 0xa0, 0x3a, 0x88, 0x84, 0xaa, 0x85, 0x7b, 0x66, 0x01, 0x47, 0x02, 0xb1, 0xbc, 0x4e, 0x7c, 0xc5, 0xe1, 0xeb } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.13", + /* Message */ + 25, + { 0x1a, 0xe3, 0x1e, 0x0c, 0xbe, 0x44, 0x97, 0xba, 0x43, 0xc5, 0xd1, 0x5f, 0x53, 0x5f, 0xe0, 0x18, 0x84, 0x1c, 0x73, 0x14, 0x57, 0x67, 0xa6, 0xa4, 0xc8 } +, + /* Seed */ + 101, + { 0x8f, 0xf0, 0xfa, 0xa7, 0xa2, 0xb4, 0xff, 0x55, 0x3c, 0xcb, 0xb2, 0x0f, 0xf3, 0x10, 0xac, 0x5e, 0x0e, 0xa9, 0x28, 0x18, 0x56, 0x2e, 0xc9, 0xa0, 0x60, 0x64, 0xf5, 0xde, 0x79, 0x86, 0xb4, 0xf6, 0xc9, 0xae, 0xa2, 0xb9, 0xf0, 0x11, 0x42, 0x38, 0xe5, 0xa4, 0x99, 0xa8, 0xae, 0x20, 0xea, 0xe4, 0x02, 0x1f, 0xcd, 0xd8, 0xf0, 0x60, 0xc9, 0x93, 0xa9, 0xbf, 0x64, 0x2d, 0xa0, 0x25, 0x67, 0x39, 0x33, 0x48, 0x08, 0xe3, 0x88, 0xe1, 0xda, 0x82, 0x37, 0x27, 0x8b, 0xf4, 0xf4, 0x7e, 0x05, 0x01, 0x5a, 0x8b, 0x88, 0xc5, 0x42, 0x0c, 0xeb, 0xc8, 0xbb, 0x37, 0xee, 0x43, 0x52, 0x83, 0x7a, 0xf7, 0x64, 0x70, 0x18, 0x41, 0x97 } +, + /* Encryption */ + 129, + { 0x04, 0xa2, 0x10, 0xf7, 0x6c, 0x0f, 0x84, 0x93, 0x99, 0x09, 0x53, 0x58, 0x98, 0x86, 0xf6, 0x2c, 0x1c, 0x48, 0x25, 0x01, 0x2a, 0xf4, 0x4b, 0xdc, 0xf2, 0xc9, 0x9b, 0x32, 0xa7, 0x0a, 0x17, 0xf7, 0x64, 0xa3, 0xa9, 0x7b, 0x2b, 0x04, 0x7e, 0x39, 0xd8, 0x0c, 0xde, 0x15, 0x4e, 0xbe, 0xd5, 0xd2, 0x81, 0x3e, 0xe8, 0x4a, 0xc9, 0xc8, 0xd6, 0xec, 0x6a, 0x96, 0xf4, 0x02, 0xdb, 0xb3, 0x26, 0xd5, 0xa6, 0xe9, 0xc0, 0xf7, 0x87, 0xc1, 0x5e, 0x98, 0x23, 0xc5, 0x08, 0xb3, 0x23, 0x5f, 0x3a, 0x00, 0x8d, 0xdd, 0xcd, 0xdb, 0x07, 0x9e, 0x80, 0xff, 0x50, 0xfe, 0x37, 0x25, 0x4a, 0x0c, 0xc4, 0x68, 0x29, 0x7e, 0xe3, 0x32, 0x53, 0xa7, 0x4c, 0x1e, 0x03, 0x70, 0x26, 0x05, 0x69, 0x58, 0xad, 0x07, 0x78, 0xe0, 0xaa, 0x12, 0x50, 0xdf, 0x1c, 0x14, 0x85, 0x7c, 0xb0, 0xd7, 0x1a, 0xa6, 0x93, 0x7e, 0x31 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.14", + /* Message */ + 17, + { 0xa6, 0xe3, 0xd1, 0x07, 0x03, 0x21, 0xd8, 0xff, 0x76, 0xb8, 0x5c, 0x70, 0x93, 0xfa, 0xa0, 0x42, 0x83 } +, + /* Seed */ + 109, + { 0xd1, 0x60, 0xb1, 0x2c, 0x76, 0x62, 0x2c, 0x3d, 0x34, 0xd8, 0x55, 0x87, 0xe6, 0xe8, 0x1c, 0xf0, 0x54, 0x61, 0x8a, 0x34, 0x6b, 0x67, 0x52, 0xd5, 0x36, 0x9a, 0x71, 0xc4, 0x92, 0x35, 0x7a, 0x13, 0x4b, 0x7f, 0x67, 0xf3, 0x34, 0xa4, 0xf3, 0xb3, 0x28, 0xba, 0xa9, 0xf0, 0x07, 0x18, 0x47, 0xd0, 0xda, 0xfd, 0xac, 0x22, 0x5d, 0x7b, 0x7f, 0x07, 0x16, 0x18, 0xea, 0x86, 0x81, 0xfc, 0xd2, 0xd2, 0x30, 0x5c, 0x2f, 0x64, 0x63, 0x1e, 0x62, 0x31, 0x85, 0xfc, 0x09, 0x96, 0xe6, 0x1c, 0x84, 0xf4, 0x18, 0x0c, 0x63, 0x7b, 0xf6, 0xea, 0x2d, 0x06, 0x03, 0x75, 0xf1, 0x6a, 0x65, 0xe5, 0xb1, 0xe2, 0xb8, 0x65, 0x28, 0x5d, 0xa3, 0xd8, 0xfb, 0x1b, 0x6a, 0x60, 0xea, 0x36, 0xe1 } +, + /* Encryption */ + 129, + { 0x0a, 0x70, 0x03, 0xb5, 0x86, 0x1a, 0x85, 0xa8, 0xf7, 0x2f, 0x19, 0x9d, 0xc6, 0x5c, 0x17, 0xfc, 0x58, 0xa9, 0x24, 0xbc, 0xc4, 0x08, 0x19, 0xe2, 0x8c, 0x95, 0x83, 0xe8, 0x21, 0x03, 0x8c, 0x00, 0x05, 0x36, 0x5e, 0x90, 0x9e, 0xee, 0x4f, 0x32, 0x66, 0xf5, 0x9a, 0x84, 0xe3, 0x25, 0xb1, 0xbe, 0xa9, 0xd2, 0x81, 0xb4, 0x82, 0x3f, 0x2f, 0xce, 0x44, 0x15, 0x3f, 0x03, 0x17, 0x0f, 0xad, 0xcb, 0x16, 0xa2, 0x79, 0xb2, 0xc9, 0x58, 0x7f, 0x6b, 0x79, 0xef, 0xfc, 0x55, 0xa3, 0xc4, 0x34, 0xe0, 0xbc, 0x5d, 0xaf, 0xe9, 0xd4, 0x03, 0x26, 0x48, 0xaa, 0xe7, 0xe4, 0xed, 0x1d, 0x7f, 0x14, 0x1b, 0xfe, 0x72, 0x26, 0x83, 0xfa, 0x32, 0xc8, 0x9d, 0xdd, 0x67, 0x3c, 0x3f, 0x0c, 0x03, 0xc8, 0x54, 0x59, 0x89, 0x0a, 0xb7, 0xfb, 0xc1, 0xd9, 0xa8, 0x14, 0xbf, 0xe9, 0xb0, 0xd1, 0x2a, 0xb1, 0x7f, 0x51 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.15", + /* Message */ + 40, + { 0xd0, 0xbc, 0x89, 0x03, 0x9b, 0xa1, 0x9e, 0xe5, 0x0a, 0x73, 0x82, 0x98, 0x4e, 0x42, 0x8a, 0xed, 0x88, 0x61, 0x4f, 0x78, 0x98, 0x13, 0x01, 0x89, 0x16, 0xe2, 0xe7, 0xeb, 0x0d, 0xb8, 0x3d, 0xa2, 0x8e, 0xc2, 0x3c, 0x04, 0xa0, 0xc2, 0xf7, 0x6a } +, + /* Seed */ + 86, + { 0xc6, 0x4d, 0x10, 0xa4, 0xb5, 0x2f, 0x49, 0x0a, 0xb6, 0x2a, 0x60, 0x38, 0xb3, 0x2b, 0x23, 0xc6, 0x3a, 0x1c, 0x85, 0x97, 0x0d, 0x93, 0x45, 0x14, 0x83, 0x94, 0xcd, 0x35, 0xcf, 0xd6, 0xf6, 0xb1, 0x59, 0x0f, 0xce, 0x8c, 0x67, 0x5b, 0xee, 0xf8, 0x7c, 0xd0, 0x34, 0x5e, 0x5c, 0xad, 0xe8, 0x95, 0x09, 0x45, 0x56, 0x54, 0x26, 0xb6, 0xb2, 0x83, 0x03, 0xb0, 0xb0, 0x39, 0x32, 0x98, 0xcd, 0xd9, 0x5c, 0x88, 0x1f, 0xa0, 0x65, 0x33, 0xca, 0x9d, 0x2d, 0x27, 0x14, 0xd0, 0xf1, 0x37, 0x85, 0xa6, 0x1b, 0x3a, 0x17, 0xa7, 0x81, 0x40 } +, + /* Encryption */ + 129, + { 0x00, 0x8b, 0x19, 0x75, 0x58, 0xca, 0x4c, 0xe5, 0x90, 0x14, 0x58, 0xab, 0xd8, 0xe8, 0xfd, 0x52, 0xd9, 0x89, 0x96, 0x0f, 0x01, 0xc2, 0x16, 0xef, 0xb5, 0x81, 0xf8, 0x61, 0x14, 0x8d, 0x1a, 0x2b, 0x44, 0xeb, 0x0b, 0x7c, 0x15, 0xdd, 0xc3, 0x45, 0xdc, 0x83, 0xf9, 0x03, 0x7d, 0xdb, 0x8f, 0xe2, 0xea, 0xa2, 0xcb, 0xed, 0x9b, 0x1c, 0x1e, 0xee, 0xae, 0xb8, 0x65, 0xbd, 0x29, 0xf4, 0x4e, 0xe1, 0x47, 0x8c, 0x95, 0xe9, 0xfb, 0xf4, 0x44, 0x82, 0x8e, 0xed, 0xcb, 0xc0, 0x17, 0x02, 0x00, 0xde, 0x35, 0x49, 0xb2, 0x2c, 0x11, 0xe4, 0xb4, 0x33, 0x79, 0x8b, 0x9d, 0x63, 0xbb, 0x49, 0xf0, 0xb0, 0x2d, 0xaf, 0x56, 0x58, 0xce, 0xed, 0xea, 0xa9, 0x3c, 0x0f, 0xae, 0xb9, 0x44, 0x65, 0x38, 0xba, 0x92, 0xeb, 0x17, 0xc8, 0x5d, 0xb5, 0xee, 0xa2, 0x04, 0xba, 0x2f, 0x49, 0xc3, 0xce, 0x65, 0xbf, 0x13 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.16", + /* Message */ + 43, + { 0xce, 0x0a, 0x4a, 0x59, 0x39, 0xf6, 0xaa, 0x26, 0x3b, 0xbf, 0x8e, 0x1e, 0x5e, 0x94, 0x31, 0x03, 0x56, 0xab, 0xa5, 0x75, 0x59, 0xc4, 0x1b, 0x39, 0x44, 0x27, 0x70, 0xb6, 0x1f, 0x6b, 0x3c, 0x9b, 0x5f, 0xe7, 0x27, 0xf3, 0x19, 0x52, 0x28, 0x08, 0xd5, 0x80, 0x19 } +, + /* Seed */ + 83, + { 0x27, 0xcc, 0xe2, 0xd4, 0x3c, 0x71, 0x31, 0x8e, 0xd4, 0xfc, 0x8c, 0x0b, 0xdb, 0x9b, 0x79, 0x13, 0x53, 0x19, 0x9f, 0x3d, 0x89, 0xfc, 0x12, 0xac, 0x47, 0xfd, 0xb6, 0xd8, 0x8b, 0x44, 0xc6, 0x54, 0x5e, 0x9e, 0xee, 0xd9, 0xf4, 0xc6, 0x85, 0x15, 0xd4, 0xf5, 0x30, 0xb8, 0x13, 0x7d, 0x77, 0x45, 0x71, 0x3b, 0xad, 0x0e, 0xbb, 0x70, 0x52, 0x23, 0x1f, 0x6b, 0x4c, 0xed, 0x18, 0x7a, 0xec, 0xd1, 0xe7, 0xa1, 0x69, 0xd8, 0x6c, 0xbd, 0x13, 0xd5, 0x0b, 0x78, 0xbe, 0x27, 0xc6, 0x54, 0x5d, 0x81, 0x92, 0xe0, 0xec } +, + /* Encryption */ + 129, + { 0x0a, 0xd3, 0xae, 0x7e, 0x5a, 0x98, 0x65, 0x2c, 0x1b, 0xf3, 0x45, 0xc4, 0x91, 0x90, 0x3f, 0x55, 0x17, 0xc6, 0x11, 0xac, 0x31, 0x00, 0x05, 0x87, 0x7f, 0xa9, 0x1a, 0xbc, 0xee, 0x64, 0x85, 0xf2, 0x77, 0x8a, 0xbf, 0x0a, 0x6c, 0x73, 0x87, 0x87, 0x37, 0x63, 0x9b, 0x26, 0x72, 0xfd, 0xd0, 0x0a, 0x39, 0x65, 0xd7, 0xd3, 0xd8, 0xd7, 0x68, 0x8e, 0x77, 0xb5, 0x45, 0x9e, 0x14, 0x5e, 0xce, 0x64, 0xa9, 0xa5, 0x2c, 0x37, 0x97, 0xf3, 0x61, 0x07, 0xc9, 0x36, 0x8b, 0xdf, 0x79, 0x90, 0xf3, 0xfb, 0x6c, 0x5c, 0xff, 0x59, 0xf4, 0xf8, 0xa3, 0xd4, 0x90, 0x93, 0xdf, 0xfe, 0x74, 0x06, 0xc9, 0x10, 0xaa, 0x57, 0x23, 0x22, 0x8d, 0xae, 0x5a, 0x9b, 0x29, 0xa4, 0xcc, 0x47, 0x69, 0xaf, 0x8b, 0xd5, 0xfd, 0x6e, 0xce, 0x88, 0x58, 0xa2, 0x9d, 0xb1, 0xb1, 0x9c, 0x08, 0x1b, 0xf0, 0xd6, 0xb0, 0xdc, 0x78 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.17", + /* Message */ + 40, + { 0x03, 0xbf, 0xb2, 0x59, 0xbd, 0x92, 0x46, 0xde, 0x3f, 0x71, 0xc3, 0x13, 0x9c, 0x72, 0x85, 0x74, 0xb4, 0x4d, 0x97, 0xad, 0x57, 0xbb, 0xdd, 0x67, 0x01, 0x94, 0x95, 0xc2, 0xa2, 0x00, 0x41, 0x39, 0x26, 0x34, 0xe3, 0x1a, 0xad, 0x63, 0xf6, 0x3b } +, + /* Seed */ + 86, + { 0x5f, 0xa4, 0xbb, 0xb7, 0x0e, 0x1f, 0x9e, 0xcb, 0x5e, 0xb2, 0x14, 0x7b, 0xf4, 0x59, 0xd1, 0xd0, 0x64, 0x43, 0xf0, 0x25, 0xc0, 0x8e, 0x36, 0x4c, 0xcc, 0x1b, 0x16, 0x0c, 0x16, 0x41, 0x6f, 0xb1, 0x74, 0xb4, 0x4b, 0x95, 0x36, 0x38, 0xa9, 0x68, 0x8c, 0x5e, 0xa2, 0xd0, 0x60, 0x17, 0x1f, 0x30, 0x54, 0xf3, 0xca, 0x3f, 0xe0, 0x13, 0xb9, 0xe3, 0x18, 0x8e, 0xe3, 0x9d, 0xa9, 0x1f, 0x80, 0x16, 0xd4, 0xb7, 0x33, 0x18, 0x79, 0x35, 0x1f, 0x32, 0x2a, 0xe5, 0x29, 0x86, 0x4d, 0x90, 0x74, 0x09, 0x8a, 0xa2, 0x51, 0x6b, 0x44, 0xca } +, + /* Encryption */ + 129, + { 0x01, 0x78, 0xe3, 0xa0, 0x17, 0xed, 0x2f, 0xc1, 0x18, 0xbb, 0x2e, 0x03, 0x28, 0xbe, 0xb2, 0x8a, 0x98, 0xc8, 0x53, 0xb9, 0xe5, 0xa5, 0xf8, 0x30, 0x80, 0xc0, 0xf1, 0x01, 0x7f, 0xdc, 0xa8, 0x37, 0x92, 0x07, 0x72, 0x2c, 0x25, 0x73, 0x7a, 0x89, 0x15, 0xe0, 0xeb, 0x72, 0xc5, 0x22, 0x85, 0xe8, 0x8f, 0x61, 0x30, 0xa1, 0xcf, 0x56, 0xad, 0x1d, 0x96, 0xca, 0x2c, 0xe4, 0xb7, 0x1e, 0xc3, 0x68, 0x94, 0x7b, 0xd0, 0x71, 0xf8, 0x36, 0x59, 0x10, 0xc7, 0x92, 0x57, 0x5b, 0x8c, 0xd6, 0xfd, 0x27, 0xe5, 0x23, 0xe8, 0x59, 0x65, 0xdd, 0xa9, 0x22, 0x82, 0xd5, 0xdf, 0xd1, 0xc0, 0x64, 0xea, 0xab, 0x6a, 0xbe, 0xac, 0x65, 0xe1, 0x6a, 0xe0, 0x4f, 0x0d, 0x40, 0xb3, 0xbb, 0x68, 0x41, 0x0b, 0x92, 0x74, 0xdf, 0xee, 0xa3, 0x2a, 0x43, 0xf9, 0x40, 0x83, 0xc1, 0x07, 0x80, 0x35, 0x3f, 0x43, 0xe4, 0x3c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.18", + /* Message */ + 37, + { 0x16, 0x2c, 0xca, 0x9e, 0xd4, 0x70, 0x8d, 0xd1, 0x03, 0x40, 0xe1, 0x94, 0xc3, 0x5c, 0x0a, 0x5f, 0xa4, 0x9a, 0x5c, 0x3b, 0x5b, 0x24, 0x71, 0x71, 0x20, 0x3c, 0xa4, 0x8a, 0x79, 0xe5, 0x2d, 0xff, 0x40, 0xf2, 0xbc, 0xa9, 0x9a } +, + /* Seed */ + 89, + { 0x4d, 0x73, 0xff, 0xcd, 0xc2, 0x69, 0x43, 0xa8, 0x70, 0x78, 0x23, 0x47, 0x8d, 0xa3, 0x1a, 0xac, 0x01, 0x27, 0x4b, 0x17, 0x17, 0xc5, 0x0c, 0x6a, 0xd0, 0xc6, 0x2e, 0xe2, 0xbc, 0xd5, 0x57, 0x95, 0x2e, 0xf1, 0x3f, 0x15, 0xff, 0xaf, 0x66, 0xbb, 0x4f, 0x45, 0x39, 0x99, 0x11, 0xc6, 0xd6, 0x5a, 0xd1, 0x87, 0x57, 0x2b, 0xc1, 0xeb, 0xa0, 0xd2, 0x86, 0xcc, 0x45, 0xaa, 0x49, 0x32, 0xe7, 0x3e, 0x47, 0x0c, 0x5d, 0xc8, 0x29, 0x39, 0x04, 0x02, 0x5c, 0x86, 0x3f, 0xbc, 0x96, 0x22, 0x37, 0x04, 0x90, 0xc9, 0x1c, 0x87, 0x40, 0xb0, 0x94, 0xd8, 0xf0 } +, + /* Encryption */ + 129, + { 0x04, 0x2b, 0xce, 0x0d, 0xfc, 0xec, 0xa9, 0xff, 0x05, 0xa6, 0xe3, 0xf7, 0x4a, 0x6a, 0x70, 0xcd, 0xcb, 0xe0, 0xde, 0xc8, 0x1e, 0xdd, 0xc8, 0x8e, 0x46, 0x7f, 0x47, 0xbb, 0x76, 0x0d, 0xa4, 0x4c, 0x79, 0x4d, 0x3c, 0xdc, 0xab, 0x93, 0x92, 0x49, 0xf8, 0x49, 0xd1, 0xd4, 0x39, 0x56, 0x64, 0x1b, 0x0b, 0x79, 0xc6, 0x86, 0x1c, 0x5f, 0x71, 0x5b, 0x9d, 0x8d, 0x8b, 0xe9, 0xf0, 0x76, 0x6a, 0xdb, 0x3f, 0x18, 0xaf, 0x7d, 0xb3, 0x6a, 0xd9, 0x5f, 0xfc, 0xd7, 0xe0, 0xfa, 0xc1, 0x62, 0x85, 0x23, 0xe8, 0xf6, 0x9a, 0xde, 0xb7, 0xff, 0x50, 0x94, 0xa2, 0xb5, 0xbf, 0x92, 0xb9, 0xd0, 0xef, 0xb1, 0x11, 0x8b, 0x85, 0x39, 0x26, 0x25, 0xfd, 0x56, 0xf8, 0x8f, 0xaa, 0x0a, 0x16, 0xd5, 0x47, 0x30, 0xfb, 0xc5, 0xca, 0xf1, 0x66, 0x82, 0xe9, 0xe4, 0x1b, 0x7e, 0x79, 0xd2, 0x02, 0x2f, 0x7c, 0xcf, 0x96 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.19", + /* Message */ + 58, + { 0x8e, 0x1b, 0x52, 0xcb, 0x4e, 0x00, 0x77, 0x27, 0xc4, 0xb5, 0xf6, 0x5d, 0x78, 0x47, 0xf3, 0x49, 0x16, 0x89, 0x1e, 0xf9, 0xc7, 0x3a, 0xd1, 0x8c, 0xf2, 0x71, 0xf8, 0x9f, 0x18, 0x2c, 0x69, 0x3e, 0x52, 0x89, 0xdc, 0x31, 0xda, 0xbc, 0x34, 0xcf, 0x7f, 0x44, 0xfb, 0xde, 0x57, 0x9e, 0x64, 0x51, 0x69, 0xec, 0xba, 0x6e, 0x4e, 0x87, 0x7f, 0x7d, 0xef, 0x44 } +, + /* Seed */ + 68, + { 0xba, 0x14, 0x74, 0x8e, 0x6d, 0xa7, 0xb6, 0xac, 0x18, 0x33, 0x32, 0x32, 0x95, 0xad, 0xb5, 0x42, 0x2d, 0xbd, 0x19, 0xe2, 0xec, 0x72, 0xdf, 0xd0, 0xaa, 0xfd, 0x7b, 0xd0, 0x7b, 0xfb, 0x97, 0xe7, 0xdb, 0x10, 0x8a, 0x3e, 0xaa, 0xdc, 0xff, 0x67, 0xb6, 0x7e, 0xc7, 0xe4, 0xc6, 0x70, 0x04, 0xc1, 0x78, 0x34, 0x6a, 0x12, 0x5d, 0xd3, 0xb6, 0xca, 0x55, 0x23, 0x70, 0x59, 0x4f, 0x7f, 0x42, 0xcb, 0x33, 0x4b, 0x44, 0x85 } +, + /* Encryption */ + 129, + { 0x09, 0x4b, 0x40, 0x30, 0xe3, 0x0c, 0x8b, 0x46, 0x2e, 0xca, 0x00, 0xf1, 0x6b, 0xb1, 0x70, 0x19, 0xd1, 0xea, 0x31, 0x25, 0xf1, 0xc6, 0x4c, 0x67, 0x1c, 0xb0, 0x0d, 0x46, 0xe3, 0xad, 0x87, 0x84, 0x28, 0x52, 0xb2, 0x01, 0x49, 0x6e, 0xe2, 0xb3, 0xd5, 0x42, 0x28, 0x93, 0xa8, 0x0c, 0x66, 0xa3, 0x0d, 0xa2, 0xc9, 0xf1, 0xa3, 0x2a, 0xd4, 0xd4, 0xe7, 0x73, 0x77, 0x43, 0xca, 0x1b, 0x78, 0xef, 0x7d, 0x4a, 0x63, 0xc5, 0xe1, 0xe0, 0xbe, 0x7e, 0x51, 0x88, 0xcc, 0xe9, 0x42, 0x95, 0x69, 0x74, 0xff, 0xd4, 0x81, 0xe6, 0x47, 0x83, 0x44, 0x23, 0x0c, 0x37, 0xda, 0x5b, 0x25, 0xf6, 0xb5, 0x99, 0xa5, 0x9a, 0x05, 0x80, 0xf1, 0xa0, 0x00, 0xc2, 0x59, 0x54, 0xf3, 0xa4, 0x63, 0xf2, 0x89, 0x5f, 0x32, 0xb0, 0x5c, 0xc0, 0x88, 0x21, 0xb1, 0xa0, 0x23, 0x60, 0x9f, 0x18, 0xca, 0x7d, 0x44, 0x9c, 0xb4 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 10.20", + /* Message */ + 12, + { 0x82, 0xff, 0x62, 0xaf, 0xfa, 0xd8, 0x00, 0x30, 0x94, 0xcc, 0x65, 0x35 } +, + /* Seed */ + 114, + { 0x1c, 0x7f, 0x21, 0xfd, 0x02, 0x09, 0x79, 0x07, 0x40, 0x5e, 0xaa, 0x77, 0xae, 0x72, 0x88, 0x65, 0x72, 0x1d, 0x93, 0x86, 0xf5, 0xaa, 0xbc, 0x2e, 0x0a, 0x95, 0xf3, 0xed, 0xb0, 0x5d, 0x46, 0xe2, 0x33, 0x79, 0x3b, 0xa1, 0xa3, 0x88, 0xe4, 0xb0, 0xdd, 0xa0, 0x0c, 0xc3, 0x2b, 0x94, 0x8a, 0xc2, 0x65, 0xae, 0x6a, 0x2b, 0xf2, 0xc3, 0x90, 0xa4, 0xdc, 0xce, 0x11, 0x0d, 0x5e, 0x86, 0x64, 0x47, 0x28, 0xf5, 0x37, 0x81, 0x36, 0x47, 0x6c, 0xf7, 0x1d, 0xc7, 0xba, 0xac, 0x50, 0xcc, 0x41, 0xc2, 0x01, 0x48, 0xdd, 0x37, 0xd5, 0xf7, 0x0a, 0x81, 0x2a, 0x29, 0x4e, 0x24, 0x2d, 0xe8, 0x03, 0xb4, 0x8b, 0x63, 0x40, 0xf4, 0x28, 0xd3, 0xc9, 0xbc, 0xa9, 0x6f, 0x76, 0x6f, 0xc4, 0xf4, 0x41, 0x67, 0xe0, 0x4a } +, + /* Encryption */ + 129, + { 0x00, 0x30, 0x3c, 0x35, 0x2e, 0x1f, 0xdd, 0x2a, 0xf8, 0xa8, 0xe3, 0xa1, 0x69, 0xb5, 0xda, 0xc5, 0x43, 0x45, 0xca, 0xa3, 0x35, 0xa7, 0x1a, 0x37, 0xe9, 0x38, 0xbf, 0x98, 0x47, 0x08, 0x86, 0x56, 0x84, 0x18, 0xae, 0x98, 0xd0, 0xaa, 0xdf, 0xe7, 0x9d, 0x0c, 0x65, 0x1b, 0x3f, 0x51, 0x6e, 0x70, 0xf1, 0x01, 0x74, 0xfe, 0x63, 0x22, 0xcd, 0x37, 0x6d, 0xa0, 0x2f, 0x22, 0x6d, 0x15, 0xb3, 0x6a, 0xbf, 0x6d, 0x1c, 0xbd, 0xab, 0x6d, 0xd5, 0x65, 0x4d, 0x99, 0x25, 0xf7, 0x25, 0x3c, 0xe9, 0x91, 0x51, 0x2a, 0x44, 0xe9, 0xfa, 0x15, 0x27, 0x12, 0xd7, 0xb8, 0xdb, 0x7f, 0x18, 0x33, 0x75, 0x80, 0xfe, 0x51, 0xdc, 0x32, 0xa0, 0x58, 0x2c, 0xe2, 0x60, 0x53, 0xf1, 0xb9, 0x49, 0x28, 0x69, 0xb9, 0xc4, 0x7d, 0xf9, 0x28, 0x39, 0xc0, 0x50, 0x2f, 0x2d, 0xb4, 0xcc, 0x4d, 0x0b, 0x20, 0x4f, 0x6f, 0xd1 } + +} +, +} +}, +{ + "Example 11: A 1029-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x11, 0x65, 0x47, 0x94, 0xf4, 0x64, 0x9a, 0x97, 0xac, 0x87, 0xef, 0x67, 0x94, 0xf6, 0xa6, 0xff, 0xb5, 0xcd, 0xab, 0x87, 0x02, 0xc2, 0x32, 0x54, 0xfd, 0xe0, 0x34, 0xf3, 0x12, 0x9a, 0xad, 0x82, 0x5c, 0xf3, 0xc0, 0xcc, 0x38, 0x80, 0xa9, 0x6f, 0xb6, 0x4e, 0x48, 0xd7, 0x59, 0x5e, 0xde, 0x06, 0xc3, 0x1d, 0x0a, 0xcb, 0xd1, 0xf8, 0xef, 0x9c, 0xd1, 0xf9, 0xf6, 0xf0, 0x0b, 0x24, 0xba, 0x53, 0x45, 0xab, 0xa1, 0x46, 0xd4, 0x1c, 0x56, 0x3b, 0xae, 0xce, 0x3b, 0x25, 0x23, 0xdf, 0x6a, 0x9f, 0x43, 0x01, 0x8a, 0x5f, 0x08, 0x69, 0xb6, 0xec, 0x99, 0x34, 0x69, 0x88, 0x6b, 0x5d, 0x23, 0x17, 0xd5, 0x9c, 0xff, 0xd4, 0xed, 0xe9, 0x46, 0x6a, 0x03, 0xf6, 0xdf, 0xec, 0x17, 0x5c, 0xad, 0x5a, 0x85, 0x44, 0x30, 0x95, 0xc7, 0x30, 0xb9, 0x8b, 0xbf, 0xa0, 0x48, 0x9b, 0x91, 0xbb, 0x27, 0x39, 0x9d } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 128, + { 0x1d, 0x4c, 0x4c, 0x6e, 0x13, 0xda, 0xb2, 0x84, 0x6c, 0xe6, 0x85, 0xd0, 0xc4, 0x93, 0x52, 0x5b, 0xb0, 0xad, 0x35, 0x62, 0x59, 0x6d, 0xb9, 0xad, 0x16, 0x94, 0x5d, 0x44, 0x5c, 0xe6, 0x7c, 0x54, 0xe9, 0x38, 0xf6, 0x54, 0x54, 0x2b, 0x09, 0x34, 0x48, 0x02, 0x91, 0xac, 0x21, 0xae, 0xd0, 0x98, 0xe8, 0x5a, 0xd6, 0xfe, 0xc6, 0xd0, 0xfe, 0x15, 0x4c, 0x3c, 0x34, 0x2b, 0x16, 0x99, 0x9a, 0x8c, 0xec, 0xe7, 0xfa, 0xf9, 0x90, 0xb7, 0xc8, 0xce, 0x87, 0xb6, 0x6f, 0xe3, 0x27, 0xfb, 0x35, 0x2e, 0xd0, 0x11, 0x32, 0x3d, 0x2b, 0x81, 0x9a, 0x36, 0xca, 0xbe, 0xcc, 0x5a, 0xae, 0x72, 0x30, 0xd3, 0xf8, 0xe0, 0x02, 0x45, 0xaf, 0x35, 0xaf, 0x80, 0x88, 0x62, 0xe5, 0x4d, 0x92, 0x56, 0x07, 0xee, 0x8b, 0x58, 0xe6, 0xa9, 0xf3, 0xad, 0x8f, 0xa7, 0x28, 0xfc, 0xe2, 0x68, 0x56, 0xc3, 0x67, 0xb1 } +, + /* Prime 1 */ + 65, + { 0x04, 0x41, 0x0a, 0xb5, 0x54, 0x60, 0x2d, 0x7e, 0xfb, 0x0c, 0xce, 0x92, 0x71, 0xa5, 0x22, 0x20, 0xf2, 0x52, 0x50, 0x02, 0x34, 0xb3, 0x82, 0x02, 0xfa, 0xfc, 0x94, 0xaa, 0x26, 0xb4, 0xfb, 0x04, 0xe5, 0xf5, 0x08, 0x74, 0x9a, 0x44, 0xef, 0xb8, 0x9b, 0x75, 0x78, 0xdb, 0x00, 0x7e, 0x03, 0x06, 0x23, 0x89, 0x48, 0x69, 0x12, 0x80, 0xf7, 0x3c, 0x12, 0x7a, 0x49, 0x30, 0xb4, 0x63, 0x39, 0xba, 0xd9 } +, + /* Prime 2 */ + 65, + { 0x04, 0x16, 0xd3, 0xfd, 0xed, 0x8f, 0x9e, 0x7b, 0x01, 0x9f, 0x67, 0x12, 0x32, 0x0e, 0xec, 0x11, 0xd8, 0xcc, 0x83, 0x81, 0xea, 0x86, 0x26, 0x6e, 0xe0, 0x3f, 0x00, 0x72, 0xe9, 0xa2, 0xfc, 0xdd, 0x80, 0x81, 0xae, 0x74, 0xfe, 0x27, 0x88, 0x70, 0xf4, 0xfd, 0xa2, 0xa0, 0x00, 0x6c, 0x4f, 0x54, 0x23, 0x9e, 0x24, 0xa1, 0x5d, 0x1a, 0xeb, 0xc6, 0x7d, 0x90, 0xd8, 0x18, 0x4d, 0x29, 0x5f, 0x52, 0x65 } +, + /* Prime exponent 1 */ + 65, + { 0x04, 0x06, 0x7b, 0x98, 0x7b, 0x5f, 0x8a, 0x8d, 0x56, 0x06, 0x97, 0x4d, 0x11, 0x06, 0x1d, 0x96, 0x29, 0x55, 0x63, 0xe9, 0xc2, 0x6e, 0x7d, 0x3e, 0x4e, 0xba, 0x43, 0xfe, 0x01, 0x24, 0x4d, 0x46, 0x24, 0x46, 0x49, 0x1a, 0xf4, 0x82, 0xf8, 0x86, 0xa9, 0x6b, 0x6d, 0xd1, 0x64, 0xd4, 0xd8, 0x0d, 0xae, 0x00, 0x90, 0x29, 0x04, 0x5e, 0x4e, 0x13, 0x64, 0xb4, 0x9b, 0x9e, 0xdf, 0x81, 0xe8, 0xb5, 0x79 } +, + /* Prime exponent 2 */ + 64, + { 0xe1, 0x38, 0x72, 0xe5, 0x6d, 0x84, 0xd7, 0x4a, 0x1e, 0x15, 0x7a, 0xe0, 0xb2, 0x3d, 0x30, 0x09, 0xc8, 0xd6, 0x72, 0x59, 0x16, 0xcb, 0xa6, 0x07, 0x31, 0x06, 0xd3, 0xb2, 0x58, 0x92, 0xb6, 0xc5, 0x33, 0x21, 0x69, 0xa2, 0x54, 0xb7, 0x12, 0x36, 0x63, 0x6b, 0x5d, 0xa9, 0x39, 0xa4, 0x47, 0xa1, 0xf2, 0x20, 0x47, 0x67, 0x54, 0xa7, 0x6d, 0x69, 0x0e, 0x84, 0xaf, 0x95, 0xca, 0x54, 0xeb, 0xd1 } +, + /* Coefficient */ + 65, + { 0x02, 0x51, 0x37, 0xae, 0x5d, 0x25, 0xfe, 0x1d, 0xaf, 0x9b, 0x38, 0x32, 0xf8, 0x07, 0x56, 0xb8, 0x6d, 0xb5, 0xca, 0x0e, 0x37, 0x2e, 0x51, 0x63, 0x03, 0x4e, 0xa3, 0x39, 0x1f, 0x5e, 0x54, 0x58, 0x2a, 0x1d, 0xd0, 0x47, 0x58, 0xb9, 0x92, 0xa5, 0xa8, 0xe4, 0x6e, 0xe1, 0x6f, 0x8a, 0xd3, 0x8c, 0xa6, 0x52, 0x27, 0x45, 0xaa, 0x7d, 0xf5, 0x1d, 0xf8, 0x9f, 0xc2, 0x21, 0x08, 0x01, 0x0e, 0x00, 0x4e } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 11.1", + /* Message */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19, 0xc4, 0x8a, 0x51, 0x6f, 0x06, 0x91, 0xcb, 0xea, 0xcb, 0xb1, 0x9d, 0x1b, 0xa5, 0x09, 0xf0, 0x4f, 0xc0, 0x13, 0x36, 0xd9, 0x0f, 0x73, 0x96, 0xb4, 0x3a, 0xa2, 0xf2, 0xb5, 0x15, 0x0c, 0x28, 0xa4, 0x5f, 0x35, 0xa9, 0xde, 0x1a, 0x29, 0x73, 0xea, 0x10, 0x28, 0x67, 0x94, 0x94, 0x0a, 0xb7, 0x9f, 0x12, 0x9e, 0x31, 0x8c, 0xf9, 0x7a, 0x5f, 0xd7, 0x2b, 0x04, 0x5b, 0x46, 0x6d, 0x66, 0x6e, 0x5d, 0xe0, 0xb7, 0x14, 0xf2, 0x12, 0xa0, 0xb9, 0x05, 0x2a, 0x0c, 0x91, 0x44, 0x8e, 0x52, 0x0d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.2", + /* Message */ + 27, + { 0xc6, 0xe2, 0x57, 0xf3, 0xa1, 0xb3, 0x5b, 0xbd, 0xc5, 0xcf, 0x42, 0x0b, 0xd7, 0x65, 0x4c, 0x52, 0xb2, 0x52, 0xdf, 0x32, 0xc5, 0x70, 0xd4, 0x28, 0xe6, 0x3e, 0xa2 } +, + /* Seed */ + 99, + { 0x77, 0xbb, 0xd7, 0x2b, 0x7b, 0x8f, 0xd2, 0x85, 0x02, 0xec, 0xf7, 0x9f, 0xd1, 0xc8, 0xaf, 0x8e, 0xbf, 0xe2, 0x44, 0x32, 0x70, 0x93, 0xb8, 0x24, 0x79, 0x5e, 0x95, 0xc0, 0xb4, 0x36, 0xeb, 0x41, 0xe5, 0xf0, 0xf2, 0xae, 0xc4, 0x33, 0x63, 0xaa, 0x2c, 0x08, 0xfc, 0x33, 0xf2, 0x87, 0xe6, 0x53, 0x80, 0x40, 0xe4, 0x28, 0x0d, 0xba, 0x47, 0x23, 0xe5, 0x32, 0x92, 0xe0, 0xa6, 0x7b, 0x21, 0xef, 0x77, 0x70, 0x79, 0x85, 0xb7, 0x2b, 0x2e, 0xca, 0xde, 0x28, 0x0a, 0x61, 0xfa, 0x73, 0xd7, 0x3d, 0xbb, 0x2f, 0xdb, 0x17, 0xf7, 0x75, 0xf4, 0x5f, 0xa1, 0x75, 0xb7, 0x7c, 0xb1, 0x06, 0x7d, 0x6f, 0x93, 0xa4, 0x37 } +, + /* Encryption */ + 129, + { 0x0d, 0x21, 0x49, 0x5c, 0x49, 0x28, 0xc2, 0x6a, 0x92, 0xc1, 0x6a, 0x90, 0x7f, 0x08, 0x33, 0x35, 0xad, 0xe8, 0xeb, 0x0c, 0x20, 0xb0, 0xb4, 0x5f, 0xe0, 0xe0, 0x8e, 0xf3, 0x9a, 0xe2, 0x4e, 0xc0, 0xb5, 0x05, 0x7e, 0x60, 0x78, 0xdd, 0x7a, 0x1b, 0x9d, 0x10, 0x2c, 0x24, 0x81, 0x85, 0x57, 0xe9, 0x0b, 0x83, 0xff, 0xda, 0x14, 0xf3, 0xcc, 0x37, 0x3c, 0x84, 0xc1, 0x05, 0xce, 0xee, 0x71, 0xbc, 0x73, 0x1a, 0x7f, 0x35, 0x71, 0xbd, 0x7b, 0xbb, 0xa1, 0xd4, 0xf2, 0x3f, 0xf4, 0xdf, 0x0a, 0x84, 0xf3, 0x12, 0x99, 0x0f, 0xf7, 0x71, 0xff, 0x11, 0x8f, 0x05, 0xbc, 0xfa, 0x22, 0x2f, 0x11, 0xc1, 0xea, 0x01, 0xf6, 0xa4, 0x68, 0xca, 0x5a, 0x87, 0x50, 0x80, 0x40, 0x98, 0xf8, 0x46, 0xa8, 0x64, 0x30, 0xea, 0x23, 0xe9, 0xf0, 0x7e, 0x23, 0x48, 0x46, 0x1e, 0xf0, 0x0b, 0xa6, 0x25, 0x34, 0xfc, 0xe7 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.3", + /* Message */ + 41, + { 0x2d, 0x30, 0x7f, 0x44, 0xdd, 0xff, 0x9c, 0x45, 0x35, 0xa0, 0x6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 0xe8, 0x40, 0x67, 0xf9, 0x19, 0x8e, 0x92, 0x4a, 0x9c, 0xfe, 0x14, 0x50, 0xb0, 0x18, 0xa6, 0xb6, 0x9d, 0xd2, 0x37, 0x58, 0xe9, 0x25, 0x1c, 0x76, 0xcc, 0xea, 0xe8, 0x40, 0xda, 0x2c, 0xc6, 0x25, 0x17, 0x39, 0xe2, 0x3b, 0x9a, 0x42, 0xb6, 0x34, 0x46, 0xec, 0xa0, 0xd6, 0x15, 0x99, 0xa1, 0x46, 0xb7, 0x41, 0xfd, 0x43, 0x51, 0x1c, 0x73, 0x66, 0x3a, 0x92, 0x3e, 0x37, 0x57, 0xf1, 0x8a, 0x17, 0x1c, 0x3b, 0x12 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.4", + /* Message */ + 10, + { 0x1f, 0x03, 0x33, 0x88, 0x55, 0x4b, 0xeb, 0xfa, 0xa0, 0x1c } +, + /* Seed */ + 116, + { 0x9d, 0x81, 0x57, 0x56, 0x74, 0x66, 0x3b, 0x3d, 0x87, 0x7d, 0x4b, 0x0a, 0xa4, 0xfd, 0xc6, 0x05, 0x47, 0x0a, 0xbc, 0x55, 0x0b, 0x53, 0x52, 0x72, 0xc8, 0x23, 0x70, 0x18, 0x86, 0x7c, 0x50, 0x22, 0xca, 0xfe, 0x6a, 0x4a, 0xc8, 0x37, 0x37, 0xe9, 0x9c, 0x6e, 0xba, 0xfe, 0x69, 0xca, 0xa7, 0xfd, 0xca, 0x70, 0x27, 0xc8, 0xfb, 0xc4, 0x37, 0xec, 0x52, 0x32, 0xce, 0x2e, 0x25, 0x29, 0xa0, 0xf7, 0x03, 0xe2, 0x01, 0xf7, 0xe5, 0x10, 0x32, 0x35, 0xba, 0x65, 0xa6, 0x47, 0x94, 0xf1, 0x90, 0xef, 0x42, 0x54, 0x93, 0xb6, 0x48, 0xed, 0x24, 0xa2, 0x19, 0x7d, 0x0a, 0xb0, 0x4d, 0x81, 0xc7, 0xb3, 0x35, 0xa2, 0xda, 0xfd, 0x6b, 0x59, 0xc9, 0x43, 0xa0, 0x9b, 0x48, 0xea, 0xc3, 0x5e, 0x35, 0x59, 0x62, 0x91, 0xf5, 0xf7 } +, + /* Encryption */ + 129, + { 0x00, 0x1b, 0xdf, 0x33, 0x93, 0x34, 0x2c, 0x38, 0x13, 0xee, 0x3b, 0x87, 0x07, 0xea, 0xf5, 0x46, 0x47, 0xba, 0xde, 0x4c, 0x71, 0x8a, 0x4b, 0x64, 0x54, 0x78, 0x12, 0xe0, 0x10, 0xc2, 0xb7, 0x46, 0xc8, 0x8c, 0xda, 0xfd, 0xc3, 0x16, 0xf0, 0x36, 0x9a, 0x6c, 0x43, 0x0a, 0xe7, 0xe6, 0xc5, 0x0f, 0x05, 0xd5, 0x45, 0xc3, 0xf7, 0x98, 0xde, 0xb1, 0xd9, 0xa5, 0xbb, 0x69, 0xc5, 0x91, 0x39, 0x33, 0xc2, 0xd7, 0x79, 0x2f, 0xae, 0x9d, 0x42, 0xad, 0x76, 0x49, 0x4d, 0xc9, 0xa3, 0xe2, 0x7c, 0x21, 0x1d, 0xb4, 0xef, 0x19, 0x85, 0x18, 0x7a, 0x6c, 0x4d, 0x28, 0x1c, 0x47, 0x72, 0x17, 0x74, 0xa7, 0xa1, 0x1c, 0x12, 0x18, 0xd4, 0xdd, 0x26, 0x7b, 0x57, 0x48, 0x58, 0x77, 0xaa, 0x75, 0x1f, 0x6c, 0x28, 0x19, 0xf8, 0x1b, 0x50, 0x54, 0xa2, 0x8a, 0x26, 0xa5, 0x3d, 0xf3, 0xea, 0x34, 0x82, 0xb3, 0x40 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.5", + /* Message */ + 43, + { 0xf7, 0x1b, 0xc7, 0x37, 0x4b, 0xd5, 0x9c, 0x37, 0x77, 0x59, 0x76, 0xf3, 0x35, 0x24, 0x4a, 0x36, 0x84, 0x3c, 0x59, 0xe7, 0x48, 0x9a, 0xd2, 0x8b, 0x1a, 0x82, 0x2d, 0x2d, 0x7d, 0x0b, 0x9a, 0x6f, 0xe9, 0xac, 0x5b, 0xf4, 0x36, 0x82, 0xd6, 0x3d, 0x63, 0x6e, 0xf6 } +, + /* Seed */ + 83, + { 0xa1, 0xff, 0x98, 0x44, 0xa7, 0x3e, 0xc4, 0xb3, 0xbe, 0xfb, 0x1a, 0x86, 0x03, 0x52, 0xcf, 0x9b, 0x75, 0xfc, 0x66, 0xff, 0x47, 0x9a, 0x2d, 0xed, 0x59, 0x98, 0x84, 0x5a, 0x79, 0x77, 0x3a, 0x8c, 0x62, 0x06, 0xa3, 0x64, 0x36, 0xc8, 0x80, 0xa5, 0x5e, 0x18, 0x71, 0x18, 0x35, 0x45, 0x6d, 0x91, 0x45, 0x4b, 0x5b, 0xa1, 0x32, 0x07, 0x8f, 0x20, 0x37, 0xfb, 0xda, 0x72, 0x86, 0x25, 0x1b, 0xad, 0xd1, 0x2d, 0x0a, 0x97, 0x81, 0xaf, 0x3f, 0x58, 0x97, 0xcd, 0x94, 0x7b, 0x1e, 0x14, 0x25, 0xf9, 0x70, 0x55, 0x09 } +, + /* Encryption */ + 129, + { 0x09, 0x3f, 0xb6, 0x85, 0x26, 0xce, 0xad, 0x01, 0x0a, 0x54, 0xd1, 0x16, 0xcd, 0x7d, 0x60, 0x35, 0x09, 0x9b, 0xf1, 0xab, 0xff, 0xe9, 0x33, 0x1d, 0xe3, 0x64, 0x86, 0xf0, 0x53, 0xa8, 0x02, 0x98, 0xe4, 0xab, 0xfa, 0xb4, 0x0d, 0x3b, 0x03, 0xa3, 0xe7, 0xe9, 0x25, 0x59, 0x73, 0x38, 0xf1, 0x70, 0x3b, 0x04, 0x53, 0x5a, 0x9c, 0x87, 0xc6, 0x58, 0x36, 0xf1, 0x61, 0x11, 0xaa, 0xe8, 0x89, 0xe6, 0xc8, 0xd9, 0x0a, 0x24, 0x07, 0xd4, 0x41, 0xa1, 0xc2, 0xa3, 0x11, 0xcb, 0xd9, 0x46, 0x11, 0xa4, 0x2e, 0x93, 0xc7, 0x3a, 0x3d, 0x21, 0x48, 0x3f, 0xad, 0xb8, 0xf4, 0xe2, 0x46, 0xd0, 0x89, 0xf1, 0xcf, 0xd7, 0x08, 0x52, 0xb4, 0xdc, 0x77, 0x8a, 0x60, 0xd1, 0x52, 0xd3, 0xfc, 0xa7, 0x5f, 0xd6, 0x06, 0x67, 0x04, 0xe9, 0x33, 0xbf, 0x99, 0xf5, 0xbb, 0x77, 0xaf, 0xc9, 0xa9, 0xcb, 0x3b, 0x8c, 0xb5 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.6", + /* Message */ + 25, + { 0x46, 0x87, 0x83, 0xd4, 0xea, 0xc8, 0x81, 0x34, 0x32, 0x04, 0x85, 0x47, 0xce, 0x24, 0x1f, 0x72, 0xdb, 0x1c, 0x85, 0xce, 0x4a, 0xdb, 0xe3, 0xee, 0x2c } +, + /* Seed */ + 101, + { 0xc6, 0xe3, 0x26, 0x30, 0xed, 0x90, 0xd0, 0xaf, 0xb1, 0x68, 0xc0, 0x8b, 0x75, 0x22, 0x59, 0xef, 0x4b, 0x9e, 0x81, 0x17, 0x62, 0xf7, 0xcf, 0x4c, 0x53, 0x5c, 0xb4, 0xa0, 0xa0, 0x4b, 0x1d, 0x43, 0x65, 0x4e, 0xd4, 0xfa, 0xdf, 0xc7, 0xdd, 0xbc, 0x3a, 0xad, 0x03, 0x14, 0x07, 0x8b, 0x22, 0x6c, 0x4f, 0x3e, 0x97, 0x84, 0x45, 0x7c, 0x91, 0xc7, 0x76, 0x8c, 0x5c, 0x37, 0xb7, 0x60, 0x08, 0x93, 0x2e, 0x8d, 0x04, 0x57, 0x85, 0x05, 0x73, 0xce, 0x6b, 0x41, 0xa4, 0x3c, 0xdd, 0xa9, 0x70, 0x03, 0x18, 0x36, 0x84, 0x0e, 0x4e, 0x60, 0xa3, 0x48, 0x7b, 0x47, 0xa1, 0x85, 0xc8, 0x6f, 0x8a, 0x16, 0xf6, 0xf2, 0x21, 0xd0, 0xa0 } +, + /* Encryption */ + 129, + { 0x01, 0x71, 0xa1, 0x2b, 0x00, 0xcf, 0xd1, 0x09, 0x67, 0x4e, 0x5b, 0xf7, 0xf8, 0x43, 0x47, 0xfd, 0xa3, 0xfe, 0x4a, 0x8e, 0xa2, 0xf4, 0x8e, 0x0d, 0x6b, 0x6d, 0x94, 0xb4, 0x9f, 0xd7, 0xbd, 0xfb, 0x26, 0xe3, 0x24, 0x00, 0xa7, 0x12, 0x51, 0xab, 0x84, 0x22, 0x06, 0x92, 0x1d, 0x83, 0x72, 0x3a, 0x89, 0xea, 0x09, 0x93, 0x00, 0x25, 0x92, 0x0e, 0x3e, 0xf8, 0xa8, 0x87, 0xd2, 0xbc, 0x24, 0x15, 0xa7, 0xf1, 0xed, 0x37, 0xba, 0x8a, 0x5d, 0x03, 0xef, 0x92, 0x6a, 0xce, 0xf6, 0x11, 0x90, 0x00, 0x1c, 0x5e, 0xa0, 0xf8, 0xcd, 0x92, 0x02, 0x0c, 0xd8, 0x96, 0x67, 0xe9, 0xea, 0x5f, 0x7f, 0x2b, 0x15, 0x37, 0x8a, 0x21, 0x0b, 0x8a, 0xe9, 0x14, 0x81, 0x90, 0x98, 0xda, 0x1c, 0xbe, 0xc9, 0xc5, 0x43, 0xa2, 0x63, 0x30, 0x0f, 0x99, 0x4f, 0xb0, 0xb4, 0x92, 0x85, 0x71, 0x40, 0x1c, 0x20, 0x2b, 0xd6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.7", + /* Message */ + 26, + { 0xaf, 0x63, 0x1d, 0x76, 0xc9, 0x7f, 0xd9, 0x95, 0xe4, 0x94, 0xaa, 0x9b, 0x4b, 0xd7, 0x58, 0xc5, 0xc6, 0x72, 0xc5, 0xe4, 0x15, 0x8f, 0x3a, 0xaf, 0x87, 0x4b } +, + /* Seed */ + 100, + { 0x40, 0x6e, 0x1e, 0x23, 0xf9, 0x92, 0xbb, 0x07, 0x62, 0x12, 0x5c, 0xa4, 0x63, 0xbd, 0x0f, 0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x59, 0x09, 0x40, 0xfe, 0xd1, 0x20, 0x6a, 0xd5, 0x9b, 0x9d, 0xd6, 0x44, 0x4e, 0x1e, 0x19, 0x6e, 0x94, 0x73, 0x25, 0x22, 0x4f, 0xfa, 0xca, 0x06, 0x9e, 0x9c, 0xdf, 0x8c, 0x62, 0x02, 0x69, 0x07, 0x7d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.8", + /* Message */ + 56, + { 0x73, 0xcb, 0x53, 0x90, 0x82, 0xfb, 0x06, 0xdc, 0xae, 0x3c, 0x20, 0x68, 0xe9, 0x89, 0xe7, 0xc0, 0xd8, 0xff, 0xf0, 0xfb, 0x34, 0x0b, 0x6d, 0xe8, 0x0d, 0x0b, 0xa5, 0xd1, 0xe0, 0x06, 0x4f, 0x22, 0x13, 0x92, 0x8a, 0x4b, 0xaf, 0x20, 0xa8, 0x03, 0x48, 0xaf, 0x3c, 0xde, 0x9d, 0xe6, 0x3f, 0x88, 0x6d, 0x63, 0xe5, 0x6a, 0x3e, 0x32, 0xcd, 0x8e } +, + /* Seed */ + 70, + { 0x28, 0xe2, 0xa9, 0x7c, 0x7e, 0x9e, 0x03, 0x3b, 0x49, 0xaa, 0xdc, 0xee, 0x8f, 0xdc, 0x07, 0xed, 0xfd, 0xfd, 0xb9, 0x50, 0x35, 0x4b, 0x70, 0x8c, 0xe5, 0xdf, 0x84, 0x8d, 0x1b, 0x51, 0xaa, 0x2f, 0x4a, 0xff, 0x99, 0x74, 0x16, 0x01, 0x81, 0x42, 0x29, 0x47, 0xb1, 0x33, 0x76, 0x4c, 0x5a, 0x40, 0x06, 0x57, 0x04, 0x6a, 0x49, 0x36, 0x3f, 0xfd, 0xf1, 0xf9, 0x3c, 0xa4, 0x8b, 0x3e, 0x52, 0x93, 0x7e, 0x1f, 0x38, 0xfb, 0x50, 0xfb } +, + /* Encryption */ + 129, + { 0x0c, 0x72, 0xe6, 0x95, 0x48, 0xc3, 0x4e, 0xca, 0xf2, 0x48, 0xb2, 0xdc, 0x6b, 0xb6, 0x43, 0x87, 0xf4, 0xf3, 0x35, 0x0f, 0x66, 0x8e, 0x59, 0x01, 0x35, 0x60, 0x80, 0x8c, 0x41, 0x3f, 0xa8, 0x35, 0xfd, 0x36, 0x0e, 0x04, 0xe4, 0x74, 0x7a, 0x00, 0x31, 0xc8, 0xa6, 0x4a, 0x9d, 0x7a, 0x07, 0xb3, 0x63, 0xfa, 0xd2, 0x93, 0xb7, 0x03, 0xa7, 0xdc, 0x99, 0x0f, 0x80, 0x6f, 0xb9, 0x0e, 0x39, 0x12, 0x21, 0xa1, 0x16, 0xdf, 0x10, 0x8f, 0x54, 0x6e, 0xae, 0x51, 0x71, 0x6b, 0xa0, 0x45, 0x01, 0xab, 0x77, 0x7b, 0x0c, 0x2a, 0x17, 0x71, 0x2f, 0x71, 0xe4, 0x06, 0x27, 0x5f, 0x01, 0x73, 0x77, 0xcf, 0x24, 0x88, 0xc4, 0x35, 0xef, 0x6c, 0x6e, 0x7c, 0x45, 0xcd, 0xb9, 0x8f, 0x24, 0x47, 0x7c, 0xed, 0x18, 0x0e, 0xb3, 0xef, 0xc8, 0x70, 0x3e, 0x96, 0x38, 0x26, 0xbf, 0xb3, 0x44, 0xf1, 0x6e, 0xb4, 0xa1 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.9", + /* Message */ + 38, + { 0xf2, 0xf9, 0x85, 0xb8, 0x03, 0x12, 0x73, 0xcb, 0x5f, 0xc8, 0x9a, 0x31, 0xdd, 0xeb, 0x4c, 0x67, 0xa4, 0xe4, 0xf3, 0x8c, 0x09, 0xd3, 0x02, 0x87, 0x42, 0x09, 0xb3, 0x9c, 0x69, 0xb7, 0x1f, 0x84, 0x95, 0x88, 0x86, 0x8f, 0xa5, 0xf8 } +, + /* Seed */ + 88, + { 0xc1, 0x20, 0x44, 0x6f, 0x5b, 0xdd, 0xa0, 0x6c, 0x63, 0x73, 0x8f, 0x18, 0x15, 0x55, 0x95, 0xf6, 0x2b, 0xc2,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, 0x6a, 0xef, 0x03, 0x31, 0x8f, 0xf1, 0xaf, 0xe4, 0x72, 0xdb, 0x4e, 0xe3, 0xe2, 0x1e, 0xc1, 0x29, 0x33 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.10", + /* Message */ + 36, + { 0x39, 0x87, 0x2c, 0xfd, 0x6c, 0xf7, 0x4b, 0x4c, 0xcc, 0x1a, 0x70, 0xd9, 0x73, 0xb3, 0x18, 0x99, 0xa6, 0x7a, 0xee, 0xde, 0xe5, 0xd6, 0x71, 0xe0, 0x5b, 0xd6, 0x01, 0x12, 0xe6, 0x45, 0x12, 0xbb, 0xe4, 0x3b, 0xb8, 0x40 } +, + /* Seed */ + 90, + { 0x68, 0xac, 0x3f, 0x96, 0x97, 0xb7, 0x50, 0x75, 0x4f, 0xa7, 0x53, 0x2e, 0x41, 0x61, 0xc1, 0x20, 0x18, 0xe0, 0x33, 0xa6, 0x02, 0x51, 0xc8, 0xdc, 0xa8, 0x38, 0x78, 0x16, 0xf4, 0x23, 0x79, 0xab, 0x97, 0x8e, 0x15, 0x57, 0x8a, 0xe2, 0xe9, 0x4c, 0x17, 0x76, 0x48, 0x8b, 0x0c, 0xfd, 0xff, 0x18, 0x6f, 0xa6, 0xd7, 0x98, 0x88, 0xf8, 0x16, 0x9e, 0xe4, 0x49, 0xea, 0xdd, 0xc8, 0xe7, 0xf5, 0xa6, 0x58, 0xd0, 0x99, 0x7a, 0x93, 0x4f, 0x58, 0x6e, 0x31, 0xf7, 0x47, 0x30, 0xbe, 0x60, 0x3f, 0x1e, 0xe6, 0x2f, 0xa6, 0xc0, 0x8b, 0x0b, 0xff, 0xae, 0x6b, 0x88 } +, + /* Encryption */ + 129, + { 0x09, 0xb7, 0x70, 0x07, 0xf1, 0x5d, 0x65, 0x9e, 0xfc, 0xca, 0xca, 0x66, 0xc1, 0xe7, 0xd9, 0x62, 0xe0, 0x47, 0xa1, 0xe1, 0x49, 0xe5, 0x2d, 0xcc, 0x0e, 0x1a, 0xdc, 0x9e, 0x18, 0x3b, 0xf7, 0x3b, 0x5f, 0x23, 0x48, 0xd3, 0x43, 0x28, 0x24, 0x1b, 0x40, 0x7f, 0x61, 0x82, 0x2f, 0x6d, 0x57, 0xe1, 0xab, 0xb3, 0x22, 0xd3, 0x02, 0xf4, 0x53, 0x0d, 0x2c, 0xb9, 0xa4, 0x1a, 0x27, 0x70, 0x23, 0x8a, 0x1b, 0xdf, 0x87, 0x5e, 0xdd, 0x79, 0x78, 0x10, 0xd9, 0x04, 0xe9, 0x7a, 0x4d, 0x7c, 0x51, 0x51, 0x32, 0xd6, 0xab, 0xbf, 0x3a, 0x4a, 0x40, 0x74, 0x86, 0xdd, 0x00, 0x4e, 0xa3, 0x8a, 0xff, 0x8d, 0x4e, 0xd3, 0x82, 0x5f, 0xe1, 0x31, 0x42, 0xf1, 0x36, 0xfd, 0x1d, 0x71, 0x3e, 0x80, 0xe0, 0xcf, 0x22, 0x57, 0x69, 0xb4, 0x19, 0xcc, 0xa5, 0x4c, 0x15, 0x6e, 0x54, 0x66, 0x8b, 0x30, 0x6b, 0x5f, 0x2a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.11", + /* Message */ + 14, + { 0x74, 0xd5, 0x6b, 0xf8, 0xd9, 0xc1, 0x80, 0xdc, 0x09, 0x93, 0x71, 0xa5, 0xaf, 0x72 } +, + /* Seed */ + 112, + { 0x33, 0x78, 0x70, 0xf0, 0x47, 0x9c, 0xf1, 0x28, 0x3a, 0x0c, 0x87, 0xc9, 0xc4, 0xaf, 0x54, 0xba, 0x8f, 0x85, 0x06, 0x44, 0xd5, 0x9a, 0x20, 0x25, 0x26, 0x3d, 0x2b, 0xdc, 0x49, 0xbf, 0xa6, 0x63, 0x6e, 0x75, 0x18, 0xf9, 0x4b, 0x6a, 0xb1, 0x8f, 0x85, 0xb1, 0x93, 0x21, 0x20, 0x9b, 0x76, 0x9f, 0x0c, 0x19, 0x75, 0xd1, 0xd5, 0xad, 0xa0, 0x6f, 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, 0xb3, 0x26, 0xa4, 0x8a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.12", + /* Message */ + 35, + { 0x61, 0x10, 0x63, 0xb5, 0xda, 0x12, 0x3c, 0xe2, 0x12, 0x96, 0x17, 0xdf, 0x38, 0x59, 0x95, 0x57, 0xb9, 0x5d, 0x1b, 0x05, 0xe6, 0xb6, 0x6b, 0xcd, 0x49, 0xaf, 0xe9, 0x83, 0x1a, 0x04, 0x21, 0xa5, 0xbe, 0x4e, 0x48 } +, + /* Seed */ + 91, + { 0x10, 0xf9, 0xdf, 0x30, 0xec, 0x97, 0x77, 0xfc, 0xab, 0x5a, 0x92, 0x4d, 0xed, 0x36, 0xfd, 0xfd, 0x6e, 0x1f, 0x38, 0x14, 0x49, 0xad, 0x99, 0xd2, 0x0a, 0xea, 0x0e, 0x39, 0x72, 0xea, 0x60, 0x4e, 0xa2, 0x27, 0x50, 0xd0, 0x60, 0x1d, 0x10, 0xa3, 0x77, 0xda, 0xd1, 0xa9, 0x4f, 0x9b, 0x02, 0x73, 0x40, 0x94, 0x81, 0x23, 0x82, 0x73, 0x98, 0xbb, 0x22, 0xb1, 0x44, 0x5f, 0x71, 0xc5, 0x05, 0xc6, 0x23, 0xaa, 0xf5, 0x16, 0xcd, 0x9f, 0xb3, 0xe9, 0x77, 0xf7, 0x78, 0xcf, 0xdd, 0x3a, 0x5d, 0x28, 0xc2, 0x29, 0x9e, 0x4b, 0x2a, 0xbd, 0x9f, 0x98, 0xc4, 0x35, 0x5a } +, + /* Encryption */ + 129, + { 0x07, 0xf2, 0xd5, 0x8b, 0xc4, 0x16, 0x39, 0x94, 0xd7, 0x6f, 0x49, 0x1e, 0xdd, 0x69, 0x74, 0x3c, 0x45, 0xdd, 0xa0, 0xc3, 0x8c, 0xcb, 0x07, 0x69, 0xde, 0x9c, 0xf9, 0xf4, 0xfd, 0x00, 0x55, 0xd3, 0x0a, 0x0c, 0xf0, 0x02, 0x80, 0x0d, 0x76, 0xed, 0x8c, 0x12, 0xcb, 0xd3, 0x6a, 0xf0, 0x51, 0xa9, 0xd7, 0x33, 0x7b, 0x29, 0xbc, 0x77, 0x4d, 0xc3, 0xc4, 0x01, 0x2b, 0xf5, 0xc2, 0x8a, 0xea, 0xd8, 0xc3, 0xe0, 0x36, 0xaa, 0x41, 0x39, 0x8a, 0x8b, 0x0f, 0xe9, 0x91, 0xc0, 0xbf, 0x66, 0xb5, 0x34, 0x1c, 0x99, 0xd9, 0x37, 0x7d, 0x94, 0x70, 0x4a, 0xd4, 0x90, 0xa9, 0xf8, 0x74, 0x6f, 0xc5, 0xce, 0xf7, 0x26, 0xe1, 0x96, 0xf3, 0x41, 0xf9, 0x3a, 0x1f, 0x1e, 0xae, 0x2c, 0x13, 0xe0, 0x0c, 0xfd, 0x22, 0x06, 0x2f, 0x8e, 0xb3, 0xda, 0x9d, 0xaf, 0xb9, 0x5a, 0x1e, 0x7b, 0x81, 0xb1, 0xfd, 0xb6, 0x56 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.13", + /* Message */ + 36, + { 0x80, 0x76, 0x4f, 0x78, 0x5f, 0xd4, 0x17, 0x6e, 0x16, 0x41, 0xe1, 0x29, 0xa3, 0x5a, 0x9b, 0x31, 0xb3, 0xa8, 0x9a, 0x75, 0x67, 0xad, 0x6c, 0x1f, 0x0d, 0x65, 0xec, 0x8a, 0xf9, 0x5f, 0xc1, 0x6e, 0x15, 0x28, 0x14, 0x09 } +, + /* Seed */ + 90, + { 0x20, 0x36, 0xd0, 0x98, 0xa6, 0xe9, 0x35, 0xf9, 0xa4, 0x11, 0x20, 0x1d, 0x2b, 0xcb, 0x62, 0x9f, 0x79, 0x0a, 0x94, 0xdb, 0x2e, 0xc6, 0x98, 0x67, 0x43, 0x3b, 0x17, 0x61, 0xd7, 0xc6, 0x95, 0x4b, 0xe9, 0x1a, 0x9f, 0xc7, 0x19, 0x19, 0x0e, 0x10, 0x86, 0x13, 0xcd, 0x58, 0x4c, 0xbb, 0x97, 0x76, 0x87, 0x04, 0x69, 0x24, 0xbc, 0xa6, 0xb2, 0xfe, 0x1a, 0x54, 0xbf, 0x76, 0xac, 0xf7, 0x7b, 0x36, 0x8c, 0x39, 0x65, 0x0f, 0x6d, 0x0a, 0x49, 0x8d, 0xbd, 0xed, 0xae, 0x3f, 0x4c, 0x21, 0x04, 0x0a, 0x8a, 0xed, 0x63, 0x4d, 0xe4, 0xed, 0x8a, 0xf1, 0x34, 0x6e } +, + /* Encryption */ + 129, + { 0x04, 0x9c, 0x61, 0x44, 0x4e, 0x92, 0x47, 0x72, 0xf9, 0x4a, 0x79, 0x5c, 0xcd, 0x99, 0xeb, 0x2f, 0xe4, 0x30, 0x99, 0x7b, 0x91, 0xb4, 0x2d, 0xe6, 0x16, 0x36, 0x29, 0xab, 0x98, 0xd2, 0x5a, 0x71, 0xe7, 0xf9, 0x68, 0x86, 0xa5, 0x7e, 0x97, 0x9d, 0x9c, 0x94, 0xc9, 0x62, 0x20, 0x9c, 0x1f, 0x71, 0x2c, 0x70, 0x57, 0x1a, 0x81, 0xf3, 0x77, 0xea, 0xf7, 0x4e, 0x80, 0xe7, 0x07, 0x22, 0xe1, 0xbe, 0x3d, 0x13, 0x37, 0xc5, 0x04, 0x5f, 0x79, 0x7b, 0xd5, 0x7d, 0xf2, 0xf5, 0xae, 0x5e, 0xf3, 0x3a, 0xe5, 0x79, 0xe9, 0x3b, 0x38, 0xfb, 0x25, 0x0d, 0xf0, 0xc2, 0xbc, 0x59, 0xb3, 0x3a, 0x74, 0x86, 0x7b, 0x8f, 0x3d, 0xfe, 0x5b, 0xa7, 0x85, 0xd7, 0x28, 0xb8, 0x9d, 0x96, 0xb3, 0x00, 0x2b, 0xc0, 0x05, 0x4d, 0xb5, 0xbb, 0x0d, 0x84, 0xfd, 0xa4, 0x5d, 0xb4, 0xa1, 0xf2, 0x62, 0x8a, 0xb1, 0x12, 0x30 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.14", + /* Message */ + 18, + { 0x0a, 0xbc, 0x2b, 0xc5, 0xfc, 0xd0, 0x40, 0x18, 0x9f, 0x84, 0x22, 0xf1, 0xca, 0x04, 0x50, 0x21, 0xda, 0x95 } +, + /* Seed */ + 108, + { 0xe4, 0x73, 0x2e, 0x49, 0x90, 0x69, 0x9f, 0xd7, 0x47, 0x40, 0xc8, 0x52, 0xae, 0x8d, 0x4d, 0x70, 0x7f, 0xbd, 0x79, 0x46, 0x0f, 0x88, 0x74, 0x09, 0x84, 0xae, 0x53, 0xff, 0xb9, 0xfc, 0x39, 0x62, 0x68, 0x3e, 0xad, 0x0d, 0x14, 0x04, 0xf5, 0x31, 0x51, 0xd1, 0xae, 0xe8, 0x0f, 0xcd, 0x6a, 0x1f, 0xf6, 0x5f, 0xc8, 0x8e, 0xf0, 0x8f, 0xd7, 0x6d, 0x9f, 0xdc, 0xa8, 0xf9, 0xe3, 0xac, 0x7d, 0x8d, 0x82, 0xb8, 0x2e, 0xce, 0x78, 0x9c, 0x66, 0xc5, 0x40, 0x22, 0x80, 0xb3, 0xe5, 0x68, 0x10, 0x1c, 0xe2, 0xa2, 0xa7, 0xb2, 0xb2, 0xf1, 0xe9, 0x65, 0x19, 0xcf, 0xb4, 0x1e, 0x60, 0x49, 0x3d, 0x76, 0x8e, 0xb5, 0xb9, 0x6c, 0xcc, 0x49, 0xbb, 0x0f, 0x6e, 0xc7, 0x11, 0xfd } +, + /* Encryption */ + 129, + { 0x03, 0xd8, 0xae, 0x60, 0x4f, 0x92, 0x95, 0x31, 0x73, 0xc7, 0x7a, 0x01, 0xff, 0xa0, 0x90, 0xaa, 0x0e, 0x37, 0xa3, 0x8a, 0x47, 0xc9, 0x72, 0x19, 0xc0, 0xb9, 0xf8, 0x64, 0xd3, 0x48, 0x74, 0x6a, 0xf7, 0xf4, 0xa6, 0x32, 0x11, 0x29, 0xc6, 0x04, 0x6a, 0x99, 0x4c, 0xed, 0x1c, 0xcf, 0x33, 0x24, 0xda, 0x93, 0x71, 0x53, 0x88, 0x8d, 0xd6, 0xc6, 0x70, 0x19, 0xa7, 0xca, 0xa7, 0x65, 0x5a, 0x36, 0x42, 0x83, 0x8e, 0xdf, 0xa0, 0xe2, 0xed, 0x8d, 0xc2, 0x5c, 0x14, 0xbf, 0xf8, 0xbf, 0xf5, 0x65, 0xc7, 0x18, 0xf8, 0xb6, 0xc9, 0x20, 0x56, 0xc9, 0xbb, 0xe8, 0xd9, 0x30, 0x83, 0x70, 0xc7, 0xcd, 0x75, 0xa0, 0x4e, 0x11, 0xb6, 0xe2, 0x5a, 0xa6, 0xc3, 0xc2, 0xcd, 0xdd, 0x17, 0x2a, 0x4b, 0x6a, 0xee, 0xf0, 0x4f, 0xb8, 0x35, 0xb6, 0x86, 0x37, 0xcf, 0x0c, 0xa0, 0xb9, 0xa9, 0x11, 0xb8, 0xb8, 0x74 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.15", + /* Message */ + 24, + { 0x8f, 0x98, 0x35, 0xef, 0xb6, 0x9c, 0xca, 0x8c, 0x07, 0xbf, 0xef, 0x4d, 0x8f, 0x53, 0x5d, 0x0c, 0xbd, 0xa5, 0x36, 0x7b, 0xbd, 0x41, 0x08, 0x0a } +, + /* Seed */ + 102, + { 0x32, 0xd4, 0xbe, 0x07, 0xe6, 0xc7, 0xfb, 0x81, 0xd5, 0x20, 0x8c, 0x25, 0x01, 0xc5, 0xdf, 0x7c, 0x56, 0xd1, 0x98, 0x6d, 0xc6, 0xd6, 0x31, 0x10, 0xad, 0x21, 0xd8, 0x1e, 0x57, 0xce, 0x11, 0x3f, 0x3d, 0xbb, 0xfe, 0xbe, 0x0f, 0x80, 0xc0, 0x16, 0xb7, 0x19, 0xe9, 0xd5, 0xc3, 0xd9, 0xa3, 0xbb, 0xbb, 0x2f, 0x35, 0xbe, 0x95, 0xd4, 0x56, 0x22, 0x2b, 0x51, 0xc3, 0xd6, 0x5b, 0x38, 0x8e, 0x7a, 0xda, 0xf6, 0xb9, 0xce, 0xae, 0x1f, 0xd4, 0x6a, 0x6e, 0x05, 0xca, 0x1b, 0xb1, 0x99, 0xc2, 0x7b, 0xac, 0xdc, 0x8b, 0x5f, 0xd1, 0x4f, 0x03, 0x51, 0xae, 0xb3, 0xfd, 0xd6, 0xdc, 0x1d, 0x93, 0xf3, 0xb5, 0x31, 0x56, 0xef, 0xa3, 0xc6 } +, + /* Encryption */ + 129, + { 0x0e, 0x47, 0xad, 0x4d, 0x92, 0xd1, 0x9a, 0x1e, 0xbc, 0xac, 0xbf, 0x87, 0x5d, 0x80, 0x19, 0x27, 0xd4, 0xfe, 0x5a, 0xfa, 0xf6, 0x6e, 0xd8, 0x01, 0x5c, 0x55, 0x9b, 0x56, 0x6a, 0x9f, 0x3c, 0xbf, 0x0a, 0xbe, 0x8a, 0x76, 0xfe, 0x73, 0x24, 0xf6, 0x28, 0xc2, 0xe4, 0xf3, 0x45, 0x84, 0xa5, 0x0f, 0xf7, 0x7e, 0x82, 0x2a, 0x54, 0x11, 0x8e, 0xfa, 0x9b, 0xae, 0x9d, 0x0f, 0xa5, 0x02, 0x94, 0xc6, 0x18, 0x0b, 0xaf, 0x3a, 0x8b, 0x0c, 0x7e, 0x45, 0x3a, 0x74, 0x37, 0xab, 0x1a, 0x19, 0xcc, 0x00, 0x30, 0x7a, 0x8c, 0x6a, 0xed, 0x95, 0xc3, 0x15, 0xb2, 0x4b, 0x47, 0x90, 0x07, 0x24, 0x56, 0xc9, 0x44, 0x60, 0x99, 0x5d, 0xbb, 0x1f, 0xe5, 0xa1, 0x2b, 0x4c, 0xf4, 0x45, 0x42, 0x96, 0xf7, 0x40, 0x02, 0x83, 0xce, 0xfd, 0xce, 0x6b, 0x00, 0xcc, 0x80, 0x49, 0xdd, 0x5d, 0xd8, 0xcb, 0x2a, 0xf3, 0x6f } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.16", + /* Message */ + 47, + { 0x6d, 0xfb, 0xd9, 0x3b, 0x00, 0x78, 0xd4, 0x9a, 0xe4, 0xfe, 0x1e, 0x24, 0xcc, 0xa9, 0x7d, 0x0a, 0x9a, 0xff, 0xd7, 0xbe, 0xe0, 0x62, 0xae, 0xd2, 0x9d, 0xef, 0x0b, 0x1c, 0x0b, 0x3a, 0xef, 0xad, 0x81, 0x1d, 0x6e, 0x7a, 0xce, 0x8b, 0x49, 0xd7, 0x24, 0x2a, 0x9f, 0xe6, 0xe2, 0x3c, 0x22 } +, + /* Seed */ + 79, + { 0x31, 0x9f, 0x9c, 0xda, 0x2c, 0x93, 0x38, 0x8e, 0xbe, 0x1a, 0x50, 0xe7, 0x6c, 0x93, 0x97, 0x55, 0x9d, 0xca, 0xf1, 0x4f, 0xe1, 0x03, 0x52, 0xaa, 0x51, 0x1d, 0xc5, 0xba, 0xa6, 0x4d, 0xc1, 0x52, 0xfc, 0xc7, 0x9c, 0xbb, 0x23, 0xd4, 0xe6, 0x9b, 0x12, 0xb9, 0xf2, 0x7a, 0x79, 0x09, 0x15, 0x98, 0x87, 0xbb, 0x04, 0x12, 0x9a, 0xd6, 0x35, 0x16, 0x81, 0x33, 0x86, 0x37, 0x4f, 0x31, 0x89, 0x2d, 0x4c, 0xdc, 0x4f, 0xe6, 0x39, 0x69, 0xb5, 0xbf, 0xdd, 0xc6, 0x67, 0xf9, 0x46, 0x89, 0x7d } +, + /* Encryption */ + 129, + { 0x01, 0xc5, 0xce, 0x83, 0x6b, 0xe2, 0x20, 0x8a, 0x3d, 0x81, 0x4e, 0x7e, 0x60, 0xc2, 0x76, 0x74, 0xac, 0xb7, 0xcd, 0x3e, 0x31, 0xc0, 0x24, 0xd9, 0xd3, 0x8f, 0xc2, 0x29, 0x53, 0xaa, 0xfe, 0x73, 0xaf, 0x52, 0x40, 0x43, 0x4d, 0xcf, 0x54, 0xa3, 0x88, 0x99, 0x2e, 0xac, 0x36, 0xec, 0x84, 0x64, 0xd9, 0xa0, 0x42, 0xac, 0x58, 0xd1, 0x8a, 0x70, 0x39, 0x8b, 0x8a, 0x77, 0x3e, 0x66, 0x69, 0xbb, 0x3d, 0x76, 0xee, 0xac, 0xdf, 0x1f, 0xd1, 0x52, 0x47, 0x40, 0x99, 0xbf, 0xa6, 0x62, 0xa4, 0x81, 0xdb, 0xab, 0x4c, 0xa4, 0x67, 0x14, 0x95, 0x87, 0x45, 0xe2, 0xb7, 0x83, 0x2a, 0x59, 0xcc, 0xb0, 0x05, 0x36, 0x49, 0xb7, 0xe0, 0x95, 0x07, 0x43, 0x33, 0x3f, 0x5f, 0xcd, 0x6f, 0x65, 0x19, 0x7d, 0xdc, 0xb4, 0xe1, 0xbc, 0x12, 0xa6, 0x6e, 0x8e, 0x92, 0xa8, 0x65, 0x9f, 0xae, 0xe5, 0x71, 0x31, 0xe2 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.17", + /* Message */ + 31, + { 0xe5, 0x87, 0x9f, 0xfc, 0xe0, 0xb6, 0x29, 0xb8, 0x85, 0x7c, 0x19, 0x5c, 0xf5, 0xd0, 0x9f, 0x7b, 0x93, 0xbf, 0xf1, 0xf7, 0xa9, 0xf2, 0xd8, 0xa4, 0x5a, 0x56, 0x3b, 0xbb, 0xe9, 0xe6, 0x2d } +, + /* Seed */ + 95, + { 0xba, 0xce, 0x2c, 0xea, 0x0b, 0xfe, 0xc2, 0x5a, 0x2d, 0x34, 0xd7, 0x29, 0x92, 0xc2, 0xb8, 0xea, 0x0a, 0xea, 0x17, 0xb7, 0xa3, 0xa8, 0xbe, 0xd6, 0x0d, 0x1b, 0xb5, 0x10, 0x13, 0x34, 0x7b, 0x2d, 0x03, 0x6a, 0x75, 0xa4, 0xec, 0x3e, 0xb2, 0xc1, 0x78, 0x8d, 0x44, 0xa9, 0xe1, 0xc5, 0xc8, 0x8d, 0x04, 0x1e, 0x82, 0xaf, 0x87, 0x81, 0x55, 0xdd, 0xc7, 0xd8, 0x1b, 0x3e, 0x27, 0xcd, 0xdd, 0x20, 0x40, 0x9d, 0xbd, 0xda, 0x4a, 0x64, 0xbf, 0x83, 0x11, 0xa7, 0xb7, 0xeb, 0x77, 0x29, 0x93, 0x12, 0x66, 0x1a, 0x6e, 0x37, 0xdf, 0x35, 0x02, 0xf8, 0x6a, 0x22, 0x49, 0x2b, 0xef, 0xac, 0xf4 } +, + /* Encryption */ + 129, + { 0x01, 0xe4, 0xfa, 0xeb, 0xca, 0xb8, 0x9d, 0x7b, 0xaa, 0x3e, 0x03, 0x93, 0xf7, 0x16, 0x84, 0xb0, 0xae, 0x53, 0xdf, 0x8e, 0xb9, 0x87, 0x3e, 0x65, 0xa7, 0x16, 0xec, 0x2f, 0x41, 0x74, 0x1f, 0x8b, 0x78, 0x16, 0xd2, 0xe1, 0x97, 0xd9, 0x76, 0xfd, 0x53, 0xa8, 0xee, 0x7f, 0x92, 0x4b, 0xf4, 0xbf, 0xd4, 0x10, 0x42, 0xe1, 0x64, 0x45, 0xe9, 0x06, 0x0b, 0x55, 0xa0, 0xb6, 0xdc, 0x16, 0xaa, 0xf3, 0x06, 0x44, 0x91, 0xd1, 0x89, 0x28, 0x22, 0x39, 0x50, 0x39, 0x33, 0x28, 0xc1, 0x47, 0xdb, 0xd0, 0x35, 0x31, 0xec, 0x01, 0x2d, 0x8c, 0x52, 0x75, 0x02, 0xe7, 0xeb, 0x3d, 0xca, 0x50, 0x9b, 0x7d, 0xe1, 0x69, 0x95, 0x92, 0x46, 0x07, 0xc8, 0xb2, 0x8a, 0x2b, 0xda, 0x9b, 0xcb, 0x2c, 0x77, 0x81, 0x46, 0x1c, 0x76, 0x66, 0x3b, 0x88, 0x7b, 0x96, 0x43, 0xe2, 0x31, 0x7f, 0x0e, 0xa1, 0xd1, 0xbb, 0x14 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.18", + /* Message */ + 62, + { 0x0a, 0x2e, 0x24, 0x13, 0x0e, 0x8a, 0x9d, 0x28, 0xdf, 0xcb, 0x9d, 0xf9, 0x76, 0x5f, 0x46, 0x83, 0xe9, 0xda, 0x78, 0x42, 0x5a, 0x28, 0x19, 0x98, 0x06, 0xa9, 0x3b, 0x32, 0x2e, 0xfa, 0x88, 0x49, 0x3a, 0xc3, 0x72, 0x52, 0xc2, 0x9a, 0x26, 0x4f, 0x3e, 0x85, 0xae, 0x56, 0x53, 0x8e, 0x80, 0x8d, 0xc5, 0x56, 0x42, 0xa4, 0x88, 0x5f, 0x05, 0x46, 0x40, 0xf6, 0x9c, 0x89, 0x81, 0xfe } +, + /* Seed */ + 64, + { 0x20, 0x43, 0x1e, 0xf3, 0x1f, 0xce, 0x19, 0x93, 0x9d, 0xa5, 0x45, 0xa0, 0x85, 0x30, 0x11, 0x2d, 0xb0, 0xfa, 0x07, 0x13, 0x8d, 0xd8, 0x6d, 0xb1, 0xcc, 0x65, 0xe2, 0xb0, 0x3f, 0xc2, 0xbe, 0x60, 0x7c, 0x3e, 0x60, 0x38, 0xeb, 0xb7, 0x89, 0x17, 0x55, 0xb2, 0x31, 0x29, 0xfb, 0x96, 0x9a, 0x7f, 0xe1, 0x06, 0x10, 0xf2, 0xeb, 0xc3, 0xf0, 0x77, 0xb2, 0xc8, 0xf4, 0x60, 0x1e, 0x09, 0xab, 0x4c } +, + /* Encryption */ + 129, + { 0x0c, 0x14, 0xb7, 0xd3, 0x2d, 0x3d, 0x4c, 0xe2, 0xb0, 0x8e, 0xe4, 0x4f, 0x51, 0x6a, 0xee, 0x29, 0x90, 0xb6, 0x30, 0x52, 0x40, 0xb2, 0x5d, 0x23, 0x34, 0xaa, 0x31, 0x75, 0x2a, 0xef, 0x28, 0x02, 0x16, 0x39, 0xf7, 0x6a, 0x4c, 0x47, 0x19, 0x56, 0x9b, 0x30, 0x05, 0x2d, 0x4b, 0xd0, 0x8b, 0x3a, 0x07, 0xf2, 0x3b, 0xe6, 0x86, 0x23, 0x7e, 0x48, 0x1e, 0x67, 0xbf, 0x3f, 0x5a, 0x01, 0xad, 0xd7, 0x56, 0xda, 0x77, 0x2c, 0x7d, 0xc1, 0x3d, 0x32, 0x29, 0x8b, 0x9b, 0xbc, 0x3d, 0x33, 0xe6, 0xdf, 0x82, 0xd8, 0x5c, 0x08, 0x9d, 0x34, 0x76, 0x00, 0x49, 0x7a, 0x8b, 0x8e, 0xa4, 0xde, 0x68, 0xab, 0xb9, 0x0e, 0x5c, 0x6a, 0xeb, 0x26, 0x9a, 0x97, 0xbe, 0x42, 0x6c, 0xef, 0xac, 0xde, 0xbb, 0xcc, 0x0c, 0x1f, 0x2c, 0x40, 0x9b, 0xbc, 0x7c, 0x72, 0xd9, 0x0b, 0xdb, 0x42, 0x6b, 0x13, 0xcc, 0xc1, 0x9a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.19", + /* Message */ + 63, + { 0x7e, 0xfc, 0x62, 0x7b, 0xa5, 0xfa, 0x28, 0x25, 0xaa, 0xe0, 0xca, 0x94, 0x03, 0x0e, 0x70, 0x47, 0x08, 0xd3, 0x5f, 0x92, 0x23, 0x98, 0x26, 0xb4, 0x2e, 0x2d, 0x4d, 0xbb, 0xe4, 0x02, 0xab, 0x7d, 0x19, 0x6a, 0x7f, 0x54, 0x88, 0x0c, 0xf2, 0xc5, 0xa4, 0xd0, 0xfc, 0xe5, 0x3a, 0x20, 0xa3, 0x2b, 0x68, 0x30, 0xe6, 0x2d, 0xcd, 0x00, 0xdb, 0xcb, 0xf3, 0x3b, 0x5c, 0x0c, 0x70, 0x44, 0x01 } +, + /* Seed */ + 63, + { 0xf0, 0x49, 0x79, 0x19, 0xc1, 0x42, 0xf3, 0xa9, 0x8e, 0xf5, 0x5b, 0xcd, 0x59, 0x88, 0x23, 0x4f, 0xdc, 0x8a, 0xeb, 0xf7, 0x36, 0xd4, 0x7a, 0xf9, 0x70, 0x90, 0xa7, 0xa9, 0xdd, 0xe0, 0xa7, 0x35, 0x09, 0xf9, 0xcd, 0x41, 0x36, 0x26, 0xbb, 0x8b, 0xa7, 0x67, 0xc9, 0xd6, 0x38, 0x49, 0x1c, 0x28, 0x6e, 0x67, 0xbf, 0x22, 0xd6, 0x70, 0xd5, 0x6b, 0x24, 0xc1, 0x5b, 0xad, 0x70, 0x35, 0x1e } +, + /* Encryption */ + 129, + { 0x01, 0xdb, 0xce, 0x3b, 0x3f, 0x84, 0xb2, 0xda, 0x06, 0xb1, 0x67, 0xe2, 0x06, 0x64, 0x9d, 0x42, 0x4a, 0x42, 0xb8, 0xe9, 0xea, 0x54, 0x53, 0xa1, 0x6b, 0x5f, 0xc6, 0xc2, 0xe9, 0xcb, 0x17, 0xed, 0xa1, 0xef, 0xfe, 0x4e, 0x78, 0x36, 0xa5, 0xe5, 0x8f, 0x99, 0xe5, 0x31, 0x53, 0x0b, 0x40, 0x17, 0x1e, 0x4b, 0x51, 0xfc, 0x0b, 0x92, 0xde, 0x30, 0x31, 0x30, 0x09, 0x36, 0xd2, 0x59, 0x5e, 0x39, 0x10, 0x09, 0xe2, 0xe5, 0x3c, 0x32, 0xf7, 0x59, 0x60, 0x4a, 0x6d, 0xba, 0xd9, 0xc9, 0x70, 0x90, 0x0f, 0xa6, 0xe4, 0x1a, 0x35, 0x08, 0x3f, 0x78, 0x7b, 0x9b, 0xf3, 0xbe, 0xbc, 0xea, 0xa1, 0xa7, 0x71, 0x84, 0x1b, 0x5e, 0x6e, 0x4c, 0x8b, 0x50, 0x96, 0x29, 0x00, 0x7b, 0x46, 0x7e, 0x3c, 0xec, 0x8a, 0x1d, 0x03, 0x23, 0xc3, 0xc5, 0xdb, 0xc3, 0x4d, 0x8d, 0x41, 0x25, 0xa3, 0x98, 0xc9, 0xd5, 0x3d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 11.20", + /* Message */ + 15, + { 0x59, 0x3d, 0x3f, 0xcd, 0x05, 0xac, 0xee, 0x30, 0x29, 0x81, 0x5e, 0x1e, 0x76, 0xa8, 0x90 } +, + /* Seed */ + 111, + { 0x12, 0x35, 0xee, 0x3e, 0x7a, 0x9d, 0xf5, 0x96, 0x7f, 0xe9, 0x8d, 0x97, 0x10, 0xff, 0xdd, 0x5f, 0x7e, 0xb2, 0x2d, 0xc0, 0x71, 0x47, 0xaf, 0x43, 0x6f, 0xe2, 0x0a, 0xa5, 0x26, 0xbf, 0x0b, 0x94, 0x19, 0x0c, 0xab, 0xb5, 0x21, 0x3d, 0xe9, 0x8a, 0x23, 0xf5, 0xef, 0x27, 0x50, 0x22, 0xa2, 0xf7, 0x3e, 0x60, 0xe9, 0xef, 0xe2, 0xc0, 0x34, 0xc5, 0x5c, 0xeb, 0x26, 0xaa, 0x80, 0x6c, 0xde, 0xd6, 0x73, 0x9d, 0xdb, 0x2c, 0xbd, 0x3e, 0xc3, 0xb5, 0x55, 0x20, 0x4a, 0x79, 0x84, 0x65, 0xc3, 0x7c, 0x67, 0x57, 0x19, 0x56, 0x86, 0xa3, 0xea, 0x3c, 0x56, 0x57, 0xc3, 0x60, 0xa0, 0x15, 0x8d, 0x99, 0x2d, 0x4f, 0xeb, 0xfa, 0x04, 0x29, 0xee, 0xb7, 0xc9, 0x2a, 0x46, 0x84, 0x34, 0xc5, 0xb7 } +, + /* Encryption */ + 129, + { 0x0f, 0x69, 0x98, 0x81, 0xa1, 0x52, 0x46, 0x18, 0xbc, 0x25, 0xd4, 0xe5, 0x14, 0xe2, 0x07, 0x30, 0x68, 0xea, 0x7d, 0x35, 0x38, 0x4b, 0xaf, 0xd4, 0x6f, 0xc2, 0x82, 0xe1, 0xd8, 0x55, 0x11, 0x9e, 0xe9, 0x69, 0xf2, 0x11, 0xc7, 0x18, 0x4a, 0x07, 0x03, 0x06, 0x47, 0xfc, 0x40, 0x99, 0x0e, 0xcf, 0x2e, 0xa4, 0x05, 0x22, 0x86, 0x5d, 0x91, 0x77, 0x8a, 0x62, 0x7e, 0xca, 0x8e, 0x50, 0xc2, 0xbb, 0x97, 0x60, 0xb0, 0x45, 0xda, 0xaf, 0x12, 0x77, 0xa4, 0xfa, 0x98, 0x35, 0x76, 0xca, 0x8c, 0xfa, 0xd7, 0x60, 0x83, 0x29, 0xc1, 0x88, 0x15, 0x88, 0x01, 0x7d, 0x63, 0x72, 0x2b, 0x70, 0xe9, 0x8b, 0xe5, 0x24, 0xe0, 0x03, 0x39, 0x95, 0x98, 0x25, 0x73, 0xd3, 0x38, 0x70, 0x78, 0xc8, 0xb7, 0xc1, 0xc5, 0xf9, 0xae, 0xf2, 0x64, 0xa0, 0x48, 0x46, 0x84, 0xb3, 0x42, 0x66, 0x43, 0x73, 0x7d, 0x34, 0xbb } + +} +, +} +}, +{ + "Example 12: A 1030-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x26, 0x1f, 0xe0, 0x28, 0x44, 0x59, 0xc2, 0xfa, 0x6f, 0x05, 0x54, 0x6b, 0xed, 0x58, 0x5e, 0x1e, 0xe0, 0xa1, 0x30, 0xb7, 0x1c, 0x2b, 0x8a, 0x6f, 0xbb, 0x3b, 0xdc, 0x75, 0x78, 0x7b, 0x26, 0x55, 0xd0, 0xed, 0x4e, 0x32, 0x5b, 0x54, 0xc7, 0xb3, 0x71, 0xa6, 0xfc, 0xf2, 0xb6, 0x78, 0x82, 0x77, 0xa5, 0x0d, 0x47, 0x05, 0xba, 0x23, 0xc5, 0x96, 0x28, 0x5d, 0xa7, 0xe3, 0xc9, 0x30, 0x4a, 0x41, 0xe7, 0xcc, 0x48, 0x8b, 0x44, 0x92, 0x2f, 0x7b, 0xe2, 0xb4, 0x7c, 0x16, 0x31, 0x9e, 0x33, 0x74, 0x51, 0x17, 0x3d, 0x40, 0xb1, 0xea, 0x48, 0x1d, 0x1a, 0x9c, 0x11, 0x29, 0xb1, 0xfe, 0xb7, 0xd0, 0x9f, 0x67, 0x49, 0x7a, 0xeb, 0x98, 0x94, 0x8f, 0x1a, 0xbf, 0x3b, 0x77, 0x86, 0xbd, 0x3b, 0x87, 0x04, 0x71, 0x87, 0xc8, 0xf3, 0x70, 0x15, 0x68, 0x2b, 0x3f, 0x2d, 0xe5, 0x0e, 0x07, 0x8e, 0x8d, 0x0f } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 129, + { 0x05, 0xd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 0x58, 0x97, 0xe2, 0xeb, 0x96, 0xc4, 0xdd, 0xbb, 0x91, 0x12, 0xf1 } +, + /* Prime 2 */ + 65, + { 0x05, 0xe5, 0x8c, 0xeb, 0xd4, 0x7d, 0x87, 0xb1, 0xe7, 0x8d, 0xa2, 0xfe, 0xee, 0x6d, 0xc5, 0xf9, 0xbf, 0xa2, 0x20, 0xc3, 0x55, 0xe8, 0x20, 0xc8, 0xfb, 0xaa, 0x88, 0x46, 0xdf, 0x11, 0x00, 0x36, 0x2c, 0xd1, 0x69, 0x1f, 0x5c, 0xbf, 0x5c, 0x78, 0x68, 0xc4, 0x72, 0xd0, 0x28, 0x2a, 0xbe, 0x01, 0x03, 0x16, 0x1f, 0x4d, 0x8c, 0x62, 0xaf, 0xf3, 0x5b, 0xb1, 0xfb, 0x7c, 0xc6, 0x99, 0xd9, 0x9f, 0xff } +, + /* Prime exponent 1 */ + 65, + { 0x01, 0x6c, 0xc9, 0x14, 0x95, 0xd6, 0xc1, 0x95, 0x29, 0x40, 0x73, 0x80, 0xf7, 0x52, 0x20, 0xaa, 0xd5, 0x95, 0x1a, 0xf5, 0xea, 0x4c, 0xd2, 0x48, 0xf0, 0xd6, 0x4d, 0x89, 0x53, 0xf1, 0xcf, 0xc3, 0x89, 0xb2, 0x03, 0x18, 0x5d, 0xed, 0x03, 0x09, 0x54, 0xa9, 0x87, 0xc9, 0xab, 0x90, 0x3f, 0x7b, 0x13, 0xa7, 0x1b, 0xdb, 0xcb, 0x5b, 0x85, 0x87, 0x14, 0x30, 0x30, 0x2e, 0x7b, 0x60, 0x17, 0x7d, 0x41 } +, + /* Prime exponent 2 */ + 64, + { 0xf9, 0xcc, 0x89, 0x15, 0xff, 0xb3, 0xdd, 0xc7, 0xc0, 0x93, 0x71, 0x76, 0x49, 0x2a, 0x12, 0xbb, 0x18, 0x7c, 0x2d, 0x76, 0xe0, 0xd3, 0xd4, 0x0e, 0x79, 0x58, 0xd5, 0xc9, 0x82, 0x09, 0xb3, 0xed, 0x54, 0xb5, 0xfd, 0x9f, 0x9e, 0x77, 0x11, 0xe1, 0xdc, 0x68, 0x57, 0x73, 0xde, 0x26, 0xd5, 0x0a, 0x0a, 0xb6, 0x21, 0x62, 0x12, 0xce, 0xa5, 0x09, 0xce, 0x79, 0x1c, 0x5b, 0xcd, 0x07, 0xcb, 0x47 } +, + /* Coefficient */ + 65, + { 0x05, 0xfe, 0x93, 0x3b, 0x87, 0x3f, 0x1d, 0x68, 0xf6, 0xbe, 0x2d, 0x4d, 0x5a, 0xa2, 0x2d, 0x96, 0x8f, 0x2b, 0x7a, 0xf5, 0x41, 0xa2, 0xdc, 0xd6, 0x4e, 0x09, 0xc0, 0x30, 0xb1, 0x50, 0x35, 0x8a, 0x98, 0x02, 0xae, 0x86, 0x59, 0x95, 0xd7, 0x6a, 0x50, 0x03, 0x7d, 0x19, 0x8d, 0x7e, 0x70, 0x4d, 0x26, 0x84, 0x7a, 0xda, 0x8a, 0xe3, 0xd3, 0x85, 0xc2, 0x96, 0x5f, 0xb1, 0x7f, 0xcf, 0x15, 0x2f, 0x77 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 12.1", + /* Message */ + 20, + { 0x7d, 0xe6, 0x9c, 0xd9, 0x22, 0x8b, 0xbc, 0xfb, 0x9a, 0x8c, 0xa8, 0xc6, 0xc3, 0xef, 0xaf, 0x05, 0x6f, 0xe4, 0xa7, 0xf4 } +, + /* Seed */ + 106, + { 0x33, 0xd6, 0x2c, 0xd6, 0x67, 0x82, 0x3f, 0xbf, 0x13, 0xd5, 0x92, 0xae, 0x4d, 0x02, 0xa2, 0x37, 0x0d, 0x1d, 0x99, 0xdb, 0x06, 0xc7, 0x25, 0x42, 0x5e, 0x0d, 0x12, 0xfc, 0xb4, 0x83, 0x4e, 0xf9, 0xe5, 0x49, 0x9d, 0x60, 0x7e, 0x8a, 0xae, 0xfe, 0xba, 0x81, 0x96, 0x49, 0xfb, 0x3d, 0x61, 0xc7, 0x05, 0xf5, 0xe9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0, 0xbc, 0x32, 0x0b, 0x5a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.2", + /* Message */ + 47, + { 0x97, 0xee, 0xa8, 0x56, 0xa9, 0xbd, 0xbc, 0x71, 0x4e, 0xb3, 0xac, 0x22, 0xf6, 0xeb, 0x32, 0x71, 0x96, 0x69, 0xc4, 0x2f, 0x94, 0x30, 0xc5, 0x89, 0x50, 0xc6, 0x4c, 0x0d, 0xab, 0xff, 0x3a, 0x9e, 0x20, 0x43, 0x41, 0x6c, 0x67, 0xca, 0xaa, 0xab, 0x7c, 0x68, 0xcc, 0xb3, 0xca, 0x99, 0xa3 } +, + /* Seed */ + 79, + { 0x9f, 0x14, 0x12, 0x61, 0xce, 0xc4, 0xf2, 0xc5, 0x2f, 0x96, 0x91, 0x25, 0xa3, 0x6f, 0x14, 0x10, 0x27, 0x08, 0x82, 0x50, 0xd3, 0x6b, 0x17, 0x42, 0x1c, 0xd0, 0x96, 0x14, 0x76, 0x19, 0x06, 0x46, 0x8a, 0xfa, 0xb7, 0x62, 0x2c, 0x0d, 0x02, 0x19, 0x36, 0x91, 0x74, 0x47, 0x91, 0xe0, 0xd3, 0x5b, 0x6b, 0xc9, 0xf3, 0x37, 0x7e, 0x10, 0xb2, 0x85, 0x6c, 0x8e, 0xd9, 0x19, 0x9c, 0x89, 0xf4, 0xa4, 0x16, 0x13, 0xd3, 0xc4, 0x0c, 0xca, 0x37, 0x3a, 0x7c, 0xc6, 0x3c, 0x52, 0x60, 0xfe, 0x5a } +, + /* Encryption */ + 129, + { 0x0d, 0x26, 0xa0, 0x5d, 0xe9, 0x3b, 0x70, 0x7b, 0x85, 0x40, 0xfd, 0xc1, 0x98, 0x89, 0xd2, 0xd1, 0xe7, 0x93, 0x71, 0x57, 0xd3, 0x2d, 0x30, 0x3c, 0x52, 0x8d, 0xe3, 0x5e, 0x55, 0x3f, 0x94, 0x20, 0x28, 0x74, 0x4a, 0xf6, 0xa0, 0x40, 0x2e, 0xca, 0x0f, 0xcf, 0x5a, 0x85, 0x26, 0x1a, 0xd4, 0x75, 0xd8, 0x71, 0x0c, 0xc9, 0xf8, 0xb1, 0x1b, 0xa2, 0xc6, 0xda, 0xf1, 0xd6, 0x72, 0x69, 0x0c, 0x68, 0xed, 0x11, 0xe0, 0x35, 0xe9, 0xc6, 0x60, 0xec, 0xe1, 0xd8, 0x0c, 0xda, 0xb8, 0x00, 0xea, 0xd3, 0xc6, 0xe0, 0x78, 0x61, 0x7a, 0x1b, 0x0d, 0x27, 0x3d, 0xed, 0xd8, 0xd6, 0x57, 0x49, 0x16, 0x6b, 0xd0, 0x77, 0x74, 0xfb, 0x4c, 0x14, 0x86, 0xaa, 0x8a, 0x0a, 0xdf, 0x59, 0x5d, 0xbc, 0x3d, 0x10, 0xff, 0xae, 0xf1, 0x83, 0x84, 0x98, 0xa6, 0x75, 0x55, 0xc7, 0x7b, 0x6e, 0xd9, 0x83, 0xd5, 0xb9, 0xde } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.3", + /* Message */ + 5, + { 0x8e, 0x3e, 0x77, 0x2f, 0x39 } +, + /* Seed */ + 121, + { 0x9e, 0xb7, 0x31, 0xfa, 0x6d, 0x8d, 0x5b, 0x75, 0x81, 0xf8, 0xfa, 0xd2, 0xc8, 0x22, 0x5b, 0xc9, 0x68, 0x34, 0xaf, 0x61, 0xdb, 0x3d, 0x40, 0x9d, 0xd5, 0x63, 0x04, 0xae, 0x23, 0xea, 0x62, 0x69, 0x63, 0xa4, 0xd8, 0x04, 0x40, 0xc2, 0x4e, 0x43, 0x1e, 0x41, 0x97, 0x60, 0x90, 0x3a, 0xc4, 0x4b, 0xfe, 0x41, 0xa7, 0x50, 0x81, 0xa5, 0x46, 0x2b, 0xae, 0x65, 0x47, 0xc0, 0xe7, 0xa0, 0x6e, 0x91, 0x60, 0xdf, 0x9c, 0x01, 0xfa, 0x6c, 0x53, 0x54, 0xc8, 0x33, 0x18, 0xdb, 0x65, 0x6d, 0xee, 0x0a, 0x43, 0x77, 0x87, 0xfa, 0x46, 0x39, 0x4e, 0x55, 0x2e, 0xa5, 0x33, 0x15, 0x59, 0xb4, 0x01, 0x7b, 0xb6, 0xa0, 0xe1, 0xd6, 0xfc, 0x8a, 0x65, 0xb4, 0x5d, 0xa0, 0xc4, 0x5d, 0x88, 0x95, 0x48, 0x61, 0xcd, 0x6e, 0x7a, 0x41, 0x7e, 0x03, 0x7b, 0x1b, 0x05 } +, + /* Encryption */ + 129, + { 0x24, 0x4a, 0x86, 0x34, 0x51, 0x9a, 0xf4, 0x9f, 0x56, 0x9b, 0x69, 0x86, 0xab, 0x47, 0x79, 0x64, 0xa6, 0xb2, 0x92, 0x0d, 0x84, 0x3a, 0x1d, 0x97, 0xef, 0xd7, 0xfe, 0xf8, 0x3e, 0x81, 0xba, 0xda, 0x4c, 0x4b, 0x56, 0x29, 0x61, 0xef, 0x4e, 0x1f, 0xc3, 0x33, 0x46, 0x4b, 0x92, 0x6b, 0xd7, 0x4b, 0x07, 0xad, 0x50, 0xc6, 0x5b, 0x68, 0x16, 0x83, 0xd3, 0x89, 0xfe, 0x41, 0xd6, 0xd2, 0x13, 0xb6, 0x46, 0x9f, 0x18, 0x2b, 0x14, 0xb4, 0x62, 0xd7, 0x2c, 0x1c, 0xe3, 0x92, 0x8c, 0xa8, 0x06, 0xd9, 0x66, 0xb5, 0x2d, 0x42, 0xd0, 0xbf, 0xd6, 0x0c, 0x9d, 0x04, 0x91, 0x4d, 0x50, 0x83, 0x7c, 0xda, 0xe0, 0x9b, 0x33, 0x0e, 0x37, 0x27, 0x44, 0xdc, 0xe1, 0x7f, 0x18, 0xe9, 0x4d, 0x71, 0x1c, 0x8b, 0x58, 0xea, 0x44, 0x9f, 0x14, 0x49, 0xd3, 0x69, 0xfa, 0xef, 0x51, 0x46, 0x83, 0xd3, 0x01, 0x60, 0x79 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.4", + /* Message */ + 20, + { 0xdc, 0xfa, 0xe7, 0x71, 0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 0x99, 0x37, 0x6d, 0xf4, 0x90, 0x32, 0x3d, 0x25, 0xc2, 0x17, 0xbc, 0x71, 0xbe, 0x37, 0xf1, 0x81, 0x03, 0x5c, 0xf4, 0x57, 0xeb, 0x5c, 0x06, 0xd6, 0xa3, 0xde, 0xd3, 0xd6, 0x6d, 0x5b, 0x35, 0xf0, 0x61, 0x81, 0xbf, 0x94, 0xd0, 0xec, 0x13, 0xec, 0x44, 0x7c, 0x70, 0x82, 0x33, 0x49, 0x1c, 0x55, 0x4f, 0x9e, 0x99, 0x1f, 0x6b, 0xcb, 0x8b, 0x78, 0xd3, 0x3c, 0x9c, 0x36, 0x95, 0x5b, 0x8d, 0xce, 0x51, 0x79, 0xff, 0x8b, 0xc5, 0x92, 0x44, 0xf6, 0x67, 0x90, 0x87 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.5", + /* Message */ + 42, + { 0xd7, 0x1d, 0xd8, 0x7a, 0x13, 0x99, 0x1a, 0x0d, 0xa2, 0xc7, 0x4a, 0x58, 0xb0, 0x48, 0x56, 0x34, 0xb3, 0xe0, 0x4f, 0xec, 0x9e, 0x3f, 0x1c, 0xf2, 0x60, 0x4a, 0x93, 0xbe, 0xd7, 0x96, 0x96, 0xfa, 0x63, 0x78, 0xeb, 0x1b, 0xa0, 0xe5, 0xd2, 0x04, 0x70, 0xa4 } +, + /* Seed */ + 84, + { 0x09, 0x90, 0x59, 0x92, 0x58, 0xe9, 0x7a, 0x2e, 0xbf, 0xbe, 0x10, 0x97, 0x72, 0x25, 0xc4, 0x16, 0x76, 0x2e, 0x95, 0xd2, 0x55, 0x3a, 0x80, 0x1f, 0x72, 0x6c, 0xc2, 0x49, 0xbc, 0xdf, 0x32, 0x21, 0x32, 0x58, 0x57, 0x19, 0xfc, 0x12, 0x39, 0x9a, 0xcd, 0x72, 0x54, 0xae, 0x77, 0xda, 0x34, 0x3f, 0xe2, 0xa9, 0xa3, 0xac, 0xb1, 0x1c, 0x14, 0xe2, 0x14, 0xe2, 0xd8, 0x5a, 0x76, 0x70, 0x8c, 0x3e, 0x72, 0x17, 0x3d, 0xa5, 0xd9, 0x90, 0x58, 0xe0, 0xc8, 0x70, 0x9e, 0xdf, 0x28, 0xc3, 0x69, 0x38, 0x76, 0x9f, 0x1f, 0x22 } +, + /* Encryption */ + 129, + { 0x0f, 0xf9, 0xcc, 0xe7, 0xb6, 0x9d, 0x7f, 0xca, 0x48, 0xd7, 0xc4, 0xf6, 0xcc, 0xff, 0x24, 0x8c, 0x3d, 0xb8, 0x8b, 0xf1, 0xb7, 0x85, 0x2c, 0xd9, 0xd8, 0x52, 0x5c, 0x3b, 0x41, 0xe4, 0x4a, 0x9b, 0x54, 0x0f, 0x20, 0x8f, 0xfb, 0xb8, 0xc8, 0x5b, 0xfa, 0x89, 0x0a, 0xc0, 0x2e, 0x99, 0x49, 0x59, 0xd6, 0xb0, 0x7f, 0x64, 0x81, 0x40, 0x78, 0x55, 0x6f, 0x8e, 0xc6, 0x0d, 0xb3, 0x57, 0xac, 0xea, 0xf8, 0x39, 0x11, 0x5f, 0xad, 0x41, 0xf8, 0x91, 0x8d, 0x69, 0xc2, 0x1a, 0x3a, 0xff, 0xef, 0x6e, 0xb1, 0x4a, 0x5d, 0x2c, 0xd0, 0x64, 0x5c, 0xd7, 0x06, 0xb5, 0x81, 0x43, 0x39, 0x4a, 0x27, 0x35, 0x36, 0x82, 0xe3, 0xba, 0xa1, 0x98, 0x00, 0x2e, 0x16, 0x80, 0xf2, 0x8f, 0x34, 0xbe, 0x08, 0x9a, 0x57, 0x84, 0xac, 0xe5, 0xca, 0x6b, 0x11, 0x08, 0x99, 0xdf, 0xb9, 0x58, 0x2f, 0x2e, 0x4b, 0x2a, 0x40 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.6", + /* Message */ + 58, + { 0x5e, 0x4b, 0x15, 0x8f, 0x8d, 0xcb, 0xcd, 0xd7, 0xe3, 0x08, 0x38, 0x5b, 0x40, 0x19, 0x0f, 0x5d, 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 0x83, 0xdb, 0x28, 0x74, 0x23, 0xaf, 0x91, 0xb4, 0x13, 0x91, 0x8c, 0x08, 0x02, 0xc7, 0x77, 0x8e, 0x46, 0xc2, 0x96, 0xdc, 0x9f, 0x04, 0xcd, 0xb8, 0xb0, 0x6a, 0xdc, 0x7c, 0x53, 0xd8, 0x59, 0xf4, 0x42, 0xcc, 0xbd, 0x5f, 0xfa, 0xb5, 0xaf, 0x75, 0x2b, 0x97, 0x9b, 0xf5, 0x23, 0xa4, 0x0a, 0x1d, 0x08, 0xd7, 0x60, 0x63, 0xff, 0xb3, 0xd5, 0xcf, 0xc8, 0x2f, 0x15, 0xeb, 0xd6, 0xd4 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.7", + /* Message */ + 58, + { 0x35, 0x9b, 0xa5, 0x07, 0x56, 0xa8, 0x03, 0x30, 0x40, 0x9d, 0x3f, 0x23, 0x6a, 0x34, 0x0b, 0x90, 0xf4, 0x2f, 0x73, 0x2a, 0x87, 0x71, 0x1f, 0xe2, 0x23, 0x52, 0xd4, 0xc8, 0x25, 0x0d, 0x45, 0x47, 0x5e, 0x32, 0xb9, 0x58, 0x83, 0xe1, 0x60, 0x97, 0x55, 0xa1, 0x3c, 0xdf, 0xc1, 0xbf, 0x39, 0x4c, 0x5c, 0x67, 0x36, 0x9e, 0xca, 0x1f, 0x9a, 0x33, 0xe8, 0xba } +, + /* Seed */ + 68, + { 0xf9, 0xeb, 0xdd, 0xac, 0x9d, 0xe1, 0x70, 0x9a, 0x06, 0xbf, 0x6b, 0xbd, 0xdf, 0x58, 0x94, 0xe2, 0x3b, 0x96, 0x2b, 0xa0, 0xc0, 0x64, 0xbf, 0xcd, 0x7c, 0xc5, 0x76, 0x60, 0x3b, 0x0a, 0x1a, 0x1f, 0xf3, 0x5d, 0x64, 0x5e, 0xe8, 0x7a, 0xc6, 0xf8, 0x21, 0xa6, 0xa1, 0x51, 0xe6, 0xbb, 0xb0, 0x5b, 0xf3, 0xe0, 0x5c, 0xd9, 0xa6, 0xe2, 0xcd, 0x9c, 0x6c, 0xf5, 0x53, 0xbf, 0xb0, 0x7b, 0xd2, 0xfd, 0xa0, 0x40, 0xdf, 0xb6 } +, + /* Encryption */ + 129, + { 0x08, 0x33, 0x60, 0xe6, 0x49, 0x05, 0x9d, 0x00, 0x65, 0x8d, 0xba, 0x21, 0xf2, 0xdf, 0x28, 0xa2, 0x76, 0x4c, 0x45, 0x89, 0xf7, 0xa7, 0x7d, 0x5a, 0xf9, 0x95, 0x79, 0xa8, 0xab, 0x44, 0x80, 0xc8, 0x26, 0xa7, 0x7c, 0x2f, 0xb7, 0x95, 0x4f, 0x4f, 0x31, 0xfe, 0x1d, 0x9e, 0xb1, 0xbf, 0x40, 0xe8, 0x09, 0x57, 0x7f, 0x39, 0x30, 0x1a, 0xd3, 0xab, 0x95, 0xb3, 0x81, 0x6c, 0x90, 0xec, 0x3f, 0x1c, 0xd6, 0x29, 0xc4, 0x39, 0x61, 0x74, 0xbe, 0xd9, 0xfe, 0x1e, 0x0f, 0x47, 0x68, 0x23, 0xe5, 0x3b, 0x41, 0xd1, 0x35, 0xb4, 0x9a, 0x02, 0xb0, 0x0e, 0xff, 0xc7, 0x61, 0xec, 0x90, 0x94, 0x23, 0xaf, 0x15, 0x85, 0x52, 0x37, 0xb7, 0x7e, 0xe0, 0x7d, 0xf2, 0x5a, 0xb4, 0xe8, 0x58, 0x46, 0x7d, 0x4c, 0xcf, 0xe8, 0x08, 0x43, 0x24, 0x1b, 0xbf, 0x88, 0xeb, 0x4f, 0x85, 0x3e, 0xf4, 0xb4, 0x3b, 0xa3, 0xac } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.8", + /* Message */ + 25, + { 0xa9, 0xf3, 0x9f, 0x8b, 0xa0, 0x64, 0x66, 0x25, 0x0c, 0x26, 0x5d, 0xf0, 0xca, 0x46, 0x57, 0x0a, 0x16, 0x01, 0x12, 0xcf, 0x38, 0xfd, 0x74, 0x59, 0x99 } +, + /* Seed */ + 101, + { 0x88, 0xb3, 0xc2, 0x8b, 0xd3, 0x99, 0x9a, 0x86, 0x0b, 0x8d, 0xe7, 0x75, 0x93, 0x5b, 0x8e, 0xd7, 0x8f, 0xa2, 0xf2, 0x7c, 0x26, 0x8b, 0x24, 0x3a, 0x02, 0x45, 0xaf, 0x86, 0x72, 0x25, 0x47, 0x19, 0xf2, 0x3a, 0x4b, 0x7f, 0xed, 0xc0, 0x0d, 0x54, 0xe1, 0x2e, 0x9d, 0x70, 0x1f, 0x64, 0x69, 0x94, 0x24, 0xb6, 0xb8, 0x7d, 0x14, 0xd9, 0x67, 0x6e, 0xfa, 0x95, 0x9b, 0xe2, 0x1a, 0x04, 0xb6, 0x43, 0x5d, 0x25, 0x10, 0x03, 0xdd, 0x15, 0x3d, 0x7d, 0x08, 0xff, 0x28, 0xd9, 0x3a, 0x93, 0x20, 0xdc, 0x1b, 0xbc, 0x3d, 0xb3, 0x97, 0xa5, 0x48, 0x94, 0xf2, 0x05, 0x79, 0xf9, 0x3e, 0x4e, 0xad, 0x65, 0xc3, 0x1a, 0x40, 0x7e, 0xb4 } +, + /* Encryption */ + 129, + { 0x19, 0x83, 0x96, 0x50, 0xb9, 0x25, 0xf1, 0xf9, 0x6d, 0x61, 0x1e, 0x4d, 0xbb, 0x91, 0x49, 0x93, 0x54, 0x5c, 0x67, 0x39, 0x0c, 0x32, 0x93, 0x5f, 0xbf, 0x82, 0x25, 0x9d, 0xad, 0x10, 0xf2, 0x37, 0x30, 0xeb, 0x48, 0xf3, 0x42, 0x00, 0x46, 0x5a, 0x20, 0x38, 0x72, 0x77, 0xe2, 0xb9, 0x61, 0xe0, 0x83, 0x18, 0xd2, 0x07, 0x74, 0x47, 0xc9, 0x10, 0x92, 0x71, 0xe4, 0xde, 0xd8, 0xff, 0x3d, 0xc4, 0xf3, 0x79, 0xee, 0xe4, 0x55, 0xae, 0x96, 0x08, 0x1a, 0x1a, 0xe2, 0x4b, 0x96, 0xca, 0x73, 0x0a, 0x62, 0xf7, 0xac, 0xc5, 0xa5, 0xea, 0x52, 0x28, 0xe3, 0xa4, 0x8e, 0xa6, 0x74, 0x1c, 0xb3, 0x0e, 0x82, 0x9d, 0x55, 0x09, 0xcc, 0xc6, 0xc2, 0x87, 0xc7, 0x29, 0x1f, 0x3a, 0x1d, 0x89, 0xd6, 0x26, 0xbc, 0x98, 0x15, 0x77, 0xde, 0x52, 0xa1, 0x1f, 0x12, 0xae, 0x21, 0x43, 0xd3, 0xb0, 0xb5, 0x2f, 0x86 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.9", + /* Message */ + 1, + { 0x68 } +, + /* Seed */ + 125, + { 0x53, 0x8b, 0x09, 0x5e, 0x4f, 0x2a, 0xd6, 0x77, 0x30, 0x68, 0x74, 0x21, 0x91, 0x52, 0x42, 0x25, 0x1d, 0x07, 0xf6, 0x61, 0xed, 0xac, 0x7f, 0xe7, 0x9e, 0x31, 0xd6, 0xc3, 0x45, 0xaf, 0xf5, 0x9d, 0xf3, 0x88, 0xc7, 0x18, 0x2f, 0xff, 0x0c, 0x04, 0x27, 0xb5, 0x99, 0x35, 0xc6, 0x91, 0xda, 0xb8, 0xbc, 0x42, 0xbe, 0x47, 0xd7, 0x69, 0x11, 0x88, 0x0d, 0x91, 0x7b, 0x86, 0x27, 0x18, 0xb4, 0xc1, 0xc1, 0x88, 0x8d, 0x42, 0x20, 0xb9, 0xf8, 0x23, 0x1a, 0xcd, 0xf1, 0x2d, 0x9b, 0x85, 0x18, 0x6b, 0xe0, 0x95, 0x0c, 0x1a, 0xff, 0x84, 0xcd, 0x0f, 0xe3, 0x65, 0x86, 0xa5, 0x0e, 0x7e, 0x04, 0xb1, 0x72, 0xca, 0x9c, 0x85, 0x9e, 0x2d, 0xed, 0x6b, 0x8e, 0xa5, 0x79, 0xdd, 0x5e, 0x6e, 0xee, 0x77, 0x2c, 0xca, 0xa6, 0xb4, 0xa5, 0xd8, 0xab, 0x17, 0x31, 0xa8, 0x35, 0xd6, 0xa8 } +, + /* Encryption */ + 129, + { 0x1e, 0x86, 0x8a, 0xdb, 0x0e, 0x65, 0x32, 0x80, 0x60, 0x4e, 0x8d, 0x3b, 0xc4, 0xd9, 0x69, 0x84, 0xa2, 0x0a, 0xa0, 0x9d, 0x48, 0x0b, 0x4d, 0xff, 0xac, 0x62, 0xba, 0x78, 0xcb, 0xb7, 0xee, 0xd0, 0x64, 0x5a, 0x6d, 0x94, 0xd9, 0xd2, 0xf2, 0xd1, 0xe9, 0x17, 0xc1, 0x46, 0xb4, 0x1f, 0xaa, 0x3d, 0x1d, 0x2c, 0x19, 0x01, 0x05, 0x36, 0x8f, 0xb4, 0x84, 0x06, 0xa1, 0xd2, 0x42, 0x6a, 0xf3, 0xdc, 0xc8, 0x5b, 0xd0, 0x2d, 0x5c, 0x26, 0xc8, 0x97, 0xcc, 0xb2, 0x2e, 0x57, 0x59, 0x12, 0x64, 0x1a, 0x18, 0x8e, 0xf4, 0xac, 0x47, 0xa0, 0xa9, 0xfe, 0x9a, 0xa2, 0x70, 0x6d, 0x8e, 0x10, 0x61, 0xf5, 0xd9, 0x30, 0x63, 0xf4, 0x90, 0x17, 0x00, 0x3b, 0x23, 0x09, 0xca, 0x7d, 0x8d, 0x36, 0x70, 0x3b, 0xfd, 0xda, 0x3f, 0x7f, 0x43, 0xdf, 0x15, 0x8a, 0x15, 0xbb, 0x22, 0x13, 0x9a, 0xae, 0x15, 0x10, 0x77 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.10", + /* Message */ + 23, + { 0x35, 0x65, 0x87, 0xe6, 0xc6, 0xc0, 0xb4, 0x6c, 0x24, 0x45, 0xe0, 0x18, 0x63, 0x52, 0x76, 0xab, 0x84, 0x5f, 0xd1, 0x07, 0x6d, 0x10, 0x7f } +, + /* Seed */ + 103, + { 0xe5, 0xd3, 0x3e, 0x4d, 0x93, 0xc7, 0x08, 0x44, 0xee, 0x4a, 0x01, 0x65, 0x56, 0x24, 0x2d, 0x08, 0xe8, 0xe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, 0x9b, 0xc9, 0xc6, 0x72, 0x76, 0x95, 0x14, 0x48, 0x19, 0x3b, 0xb4, 0xb1, 0xaf, 0xa2, 0x70, 0x79, 0xc3, 0x41, 0x70, 0xa2, 0x69, 0x56, 0x51, 0x0d, 0x44, 0x27, 0x64, 0x22, 0x99, 0x08, 0x42, 0x0f, 0xe8, 0x0a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.11", + /* Message */ + 64, + { 0xe1, 0x53, 0x27, 0x6a, 0x68, 0x79, 0x67, 0x8f, 0xee, 0x19, 0x89, 0x48, 0x28, 0xd6, 0x26, 0x2e, 0xa3, 0x9a, 0xd0, 0x54, 0xc8, 0x9e, 0xdc, 0xb2, 0x3f, 0x72, 0xdc, 0xda, 0x1b, 0x00, 0x73, 0xc2, 0x87, 0x62, 0x02, 0x18, 0xd9, 0x2d, 0x0e, 0xb3, 0x0c, 0x62, 0xaf, 0xbf, 0x2b, 0x45, 0xdf, 0x62, 0xd0, 0x66, 0x65, 0xf8, 0x05, 0x25, 0xb6, 0x72, 0x7f, 0x95, 0xe3, 0x42, 0x29, 0xe6, 0x82, 0xa8 } +, + /* Seed */ + 62, + { 0x2a, 0xd7, 0x14, 0x2f, 0xcf, 0xa3, 0xbd, 0xbe, 0xb7, 0x55, 0xb2, 0xc5, 0xb5, 0xcf, 0x13, 0xe6, 0x96, 0x9e, 0xb7, 0x3b, 0x7a, 0x06, 0xbc, 0x29, 0xbc, 0xad, 0x7e, 0x75, 0x30, 0xa5, 0x90, 0x23, 0x0f, 0x6a, 0x43, 0xfc, 0x03, 0xd6, 0xc3, 0xa9, 0xc6, 0x41, 0xe5, 0x3a, 0x41, 0x77, 0xd5, 0x75, 0x02, 0x91, 0xec, 0x6d, 0x4b, 0x33, 0xf8, 0x71, 0x66, 0x8a, 0xd8, 0x56, 0x90, 0x77 } +, + /* Encryption */ + 129, + { 0x17, 0x8e, 0x49, 0x77, 0x0a, 0x4c, 0x8f, 0xfb, 0x7f, 0x65, 0xf3, 0x82, 0xcd, 0xb5, 0x76, 0xe6, 0x08, 0xe9, 0x75, 0xc4, 0x37, 0x13, 0x39, 0x10, 0x2b, 0x95, 0x2a, 0x1e, 0x71, 0xcb, 0xcb, 0x91, 0xfd, 0xcd, 0x0c, 0x0e, 0xd5, 0xa8, 0x5f, 0xbd, 0x26, 0x3d, 0xa6, 0xa7, 0x4e, 0x49, 0x1f, 0xb0, 0x4b, 0x60, 0xa5, 0x96, 0x1d, 0x8e, 0x6a, 0xc7, 0x24, 0xec, 0x8a, 0x81, 0x61, 0xc2, 0x2a, 0xe3, 0x10, 0x40, 0x7f, 0x59, 0xf7, 0xe6, 0x02, 0xda, 0x48, 0xaa, 0x2d, 0xad, 0x68, 0x3e, 0x88, 0xdb, 0x1d, 0x84, 0x29, 0x5e, 0x0f, 0xba, 0x5f, 0xf2, 0xf6, 0x73, 0xdf, 0x32, 0x85, 0x4d, 0x01, 0xb7, 0x1a, 0x89, 0x46, 0x0f, 0xf0, 0xe6, 0xe1, 0xbe, 0x98, 0xae, 0xbf, 0xa2, 0x27, 0xe3, 0x97, 0xea, 0xcc, 0x8b, 0x23, 0x17, 0x41, 0x47, 0xc4, 0x4e, 0x16, 0x20, 0x1e, 0xc6, 0xba, 0xbd, 0x16, 0x5b, 0xa4 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.12", + /* Message */ + 15, + { 0xfa, 0x4e, 0xb9, 0x31, 0xa7, 0xe2, 0x09, 0x0f, 0x31, 0xed, 0xb1, 0xff, 0x7d, 0x83, 0x61 } +, + /* Seed */ + 111, + { 0x43, 0x7f, 0xa1, 0x51, 0xf4, 0x34, 0x05, 0xdb, 0x22, 0x42, 0x2c, 0xb3, 0x5d, 0x1c, 0x57, 0x61, 0x16, 0x1c, 0xb9, 0xa7, 0x8a, 0xbc, 0xb6, 0xf0, 0x6d, 0xc4, 0xe7, 0xa8, 0x69, 0x48, 0x1f, 0x40, 0xb2, 0x1a, 0xe1, 0xd3, 0x3e, 0x07, 0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 0xb6, 0x8b, 0x8e, 0xde, 0x9d, 0xc5, 0xa1, 0x69, 0xdc, 0x60, 0xdc, 0x5f, 0xac, 0x46, 0x8f, 0x24, 0x27, 0x84, 0x58, 0x10, 0x62 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.13", + /* Message */ + 49, + { 0x58, 0x81, 0x15, 0xe5, 0x37, 0x09, 0xeb, 0x15, 0xa3, 0x37, 0x4c, 0x25, 0x32, 0x9e, 0x88, 0x38, 0x26, 0xe3, 0x21, 0x3f, 0x37, 0xa1, 0xb7, 0xa6, 0x5d, 0xe1, 0x2d, 0xf2, 0x31, 0x72, 0xf1, 0x7f, 0xa4, 0x96, 0xff, 0x49, 0x2b, 0x09, 0x17, 0x3b, 0xa0, 0xc6, 0xf5, 0x8c, 0x29, 0x3d, 0x47, 0xf1, 0x48 } +, + /* Seed */ + 77, + { 0x07, 0x81, 0x85, 0xe0, 0x83, 0xcb, 0xb0, 0x6f, 0xe1, 0xa7, 0x49, 0x74, 0x35, 0x15, 0xf3, 0xa0, 0xb4, 0xb2, 0x6f, 0x85, 0x3b, 0x10, 0xe5, 0x68, 0xe8, 0x70, 0x82, 0xce, 0x44, 0x41, 0x2c, 0xa6, 0x7e, 0x59, 0x88, 0x8c, 0xcc, 0x0f, 0x50, 0x31, 0x01, 0x52, 0x1a, 0xca, 0xbf, 0xd9, 0x8f, 0xb7, 0xb5, 0xc1, 0x1d, 0x8a, 0x94, 0x1b, 0xa0, 0x3c, 0x49, 0x5a, 0xa0, 0x3e, 0x13, 0x52, 0x2f, 0x48, 0x7f, 0x6e, 0x16, 0x16, 0xbe, 0xc2, 0x07, 0x2b, 0x39, 0x96, 0xfa, 0xee, 0x29 } +, + /* Encryption */ + 129, + { 0x0e, 0x7e, 0x50, 0xa7, 0xb2, 0x47, 0xb0, 0x29, 0x7d, 0xec, 0x65, 0xc9, 0x52, 0x3f, 0x67, 0xca, 0xb6, 0xb5, 0x2a, 0x02, 0x5f, 0x53, 0x32, 0x0e, 0x94, 0x86, 0xcd, 0x20, 0x74, 0x10, 0xca, 0xdc, 0x74, 0xe4, 0xb0, 0x3f, 0xc0, 0x6b, 0xbe, 0xd5, 0x98, 0xb0, 0x22, 0xb6, 0x3b, 0x37, 0x76, 0x2a, 0x65, 0xfd, 0x35, 0x1c, 0xb2, 0x72, 0x7f, 0x3d, 0x80, 0x35, 0xa4, 0xcd, 0xba, 0x9c, 0x6a, 0x31, 0xe4, 0xed, 0x6b, 0xeb, 0x4f, 0xed, 0x31, 0x34, 0xeb, 0x63, 0xdf, 0xce, 0xab, 0x4f, 0x5f, 0x24, 0x59, 0xe5, 0x9f, 0xca, 0x01, 0x74, 0x75, 0x8a, 0xab, 0x37, 0x53, 0xb5, 0xc1, 0x93, 0xc8, 0x1e, 0x11, 0x49, 0x0f, 0x97, 0xb6, 0x22, 0xb7, 0x3f, 0xa7, 0x3f, 0x8e, 0xae, 0x7d, 0xa8, 0x39, 0x34, 0x84, 0xb8, 0x29, 0x79, 0x71, 0xa3, 0xe9, 0x23, 0x12, 0x9c, 0xe4, 0x35, 0x7b, 0x64, 0x5c, 0xc6, 0x38 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.14", + /* Message */ + 11, + { 0x20, 0xf1, 0xcf, 0xaa, 0x63, 0x67, 0xc7, 0xc3, 0x9b, 0x54, 0xa0 } +, + /* Seed */ + 115, + { 0x4a, 0x1c, 0x7b, 0x70, 0xf7, 0x83, 0xba, 0x0d, 0x5a, 0x26, 0xd4, 0x64, 0x5c, 0xf0, 0x5f, 0xa6, 0x10, 0xf5, 0xbe, 0x01, 0x77, 0xfd, 0xde, 0x9f, 0x2c, 0x34, 0x50, 0x57, 0xdb, 0x42, 0x44, 0x57, 0xfa, 0xa4, 0x30, 0xc9, 0x42, 0x4a, 0x54, 0xf7, 0xe5, 0x5f, 0xcf, 0xee, 0x6f, 0xae, 0xa4, 0x24, 0x4c, 0x03, 0x97, 0x74, 0x81, 0xed, 0xfc, 0xbb, 0x28, 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, 0x03, 0x1a, 0x27, 0xf6, 0xbb, 0x28 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.15", + /* Message */ + 33, + { 0x73, 0x60, 0xcd, 0xb6, 0xc1, 0x59, 0x96, 0xb0, 0x60, 0x33, 0x1e, 0x9f, 0x2a, 0x36, 0x89, 0x95, 0xc0, 0x64, 0xad, 0xda, 0x56, 0x55, 0x95, 0x27, 0x78, 0x2c, 0x17, 0x0c, 0x69, 0x1b, 0xb3, 0xbd, 0x3b } +, + /* Seed */ + 93, + { 0x58, 0xdd, 0x80, 0xf4, 0xfd, 0xc5, 0xc9, 0x5d, 0xd9, 0xeb, 0x56, 0xac, 0x80, 0xa0, 0x2d, 0x53, 0xe8, 0xcc, 0x2e, 0xfb, 0x3c, 0xba, 0xc6, 0x72, 0x7d, 0x75, 0xb1, 0xe7, 0xb3, 0x5e, 0x05, 0x42, 0x19, 0x43, 0x3a, 0xf5, 0xaa, 0xe1, 0x98, 0xfd, 0x62, 0xf2, 0xec, 0xd2, 0xab, 0x8e, 0x26, 0x38, 0x77, 0xb5, 0xc9, 0x1e, 0xd5, 0x13, 0xe2, 0x35, 0x49, 0x7a, 0x63, 0x19, 0x2d, 0xb9, 0xa9, 0xbc, 0xb3, 0xbc, 0xa9, 0x7a, 0xe9, 0xbf, 0xce, 0xdf, 0x93, 0x56, 0x44, 0xb2, 0xd3, 0xbc, 0x20, 0xe0, 0x2a, 0xe5, 0xe7, 0x42, 0x4e, 0x81, 0x2a, 0x29, 0x49, 0x61, 0x6b, 0x82, 0x01 } +, + /* Encryption */ + 129, + { 0x20, 0x3b, 0xcd, 0xe1, 0xb4, 0x12, 0xe3, 0xce, 0xa2, 0x5b, 0x86, 0x30, 0xb2, 0x08, 0xf9, 0x78, 0xab, 0x22, 0xc1, 0xda, 0x81, 0x25, 0x07, 0x6e, 0x10, 0xff, 0x91, 0xd7, 0xbc, 0xfa, 0xef, 0xd7, 0xdc, 0xd8, 0x39, 0x16, 0x55, 0xc8, 0x86, 0xe8, 0xa9, 0x45, 0xa7, 0xf5, 0x7a, 0x74, 0xce, 0x2d, 0xc0, 0xe8, 0xec, 0x7f, 0xdb, 0x17, 0xcf, 0x19, 0x57, 0x80, 0xd3, 0xce, 0x80, 0xe0, 0xdd, 0xe7, 0x63, 0x9c, 0x67, 0x72, 0x05, 0xb8, 0xf9, 0xec, 0xea, 0x11, 0x54, 0x68, 0x97, 0x7b, 0xde, 0xa3, 0x50, 0x0b, 0x23, 0x9f, 0xce, 0x0d, 0x7a, 0x94, 0xbe, 0x6d, 0xe3, 0x33, 0xea, 0x7e, 0xcc, 0x22, 0xc0, 0x7e, 0x65, 0xd0, 0xeb, 0xd6, 0x5a, 0x39, 0x0a, 0x18, 0x5f, 0x18, 0x17, 0x89, 0xe7, 0xca, 0x8c, 0x1a, 0xc2, 0xfc, 0xa8, 0x28, 0xbb, 0x8d, 0x28, 0x22, 0x7e, 0x38, 0xc9, 0x88, 0x9c, 0xe0, 0x08 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.16", + /* Message */ + 29, + { 0x31, 0x9b, 0x82, 0x94, 0xbd, 0xf0, 0x7c, 0xd4, 0x06, 0x85, 0xe8, 0x80, 0x09, 0xfa, 0x7b, 0x3f, 0x12, 0x90, 0x16, 0x0e, 0xf3, 0x30, 0x67, 0xad, 0xd5, 0xef, 0x4d, 0x80, 0xfd } +, + /* Seed */ + 97, + { 0x4e, 0x07, 0xd7, 0xf9, 0x63, 0xbe, 0x24, 0xee, 0x6d, 0x8b, 0xd4, 0xdd, 0x95, 0xe9, 0xe3, 0x33, 0x49, 0x30, 0xe0, 0x3e, 0x65, 0x8d, 0x29, 0x6b, 0xb7, 0x95, 0x48, 0x6d, 0x72, 0x4e, 0x07, 0x41, 0xdd, 0x50, 0x73, 0x47, 0xa5, 0xb5, 0x7b, 0x79, 0xc9, 0x0d, 0x3c, 0x90, 0xc1, 0xae, 0xa7, 0x16, 0x19, 0x09, 0x1a, 0xcc, 0x81, 0x98, 0xb5, 0x51, 0x22, 0xda, 0x50, 0x99, 0x58, 0x2e, 0x0d, 0xb7, 0xda, 0x3c, 0xbd, 0x3c, 0xfd, 0x85, 0x29, 0x8f, 0x31, 0x55, 0x4e, 0x29, 0xcb, 0xcb, 0xa1, 0x19, 0x9c, 0xe4, 0x70, 0x16, 0x3c, 0xa0, 0x33, 0x7c, 0xc4, 0x14, 0xad, 0x32, 0x76, 0x70, 0x81, 0x11, 0xd6 } +, + /* Encryption */ + 129, + { 0x04, 0xfc, 0x7b, 0xb6, 0xfb, 0x64, 0x19, 0x61, 0x2b, 0x6e, 0xf5, 0x4b, 0x3c, 0xa0, 0x0a, 0x87, 0x46, 0x51, 0x95, 0xc3, 0x7f, 0x7f, 0x94, 0x0c, 0x23, 0x3e, 0xcb, 0x1d, 0x4a, 0x50, 0x5d, 0x3c, 0x56, 0xed, 0x23, 0xe0, 0x9e, 0x03, 0xf1, 0x45, 0x4f, 0x04, 0xb5, 0x6f, 0x6d, 0xa2, 0x5d, 0x0a, 0x6f, 0xca, 0xb0, 0xc4, 0x00, 0x87, 0x4a, 0xe9, 0x80, 0x6e, 0xe1, 0x87, 0x80, 0xb7, 0x5c, 0x6c, 0xa5, 0x66, 0x29, 0xe5, 0x77, 0xe8, 0xe7, 0xb5, 0xd2, 0xfc, 0x2c, 0x44, 0x0b, 0x98, 0x00, 0x19, 0x5b, 0x58, 0x51, 0x1b, 0xc3, 0xa7, 0x95, 0x44, 0x12, 0xc8, 0xf2, 0x73, 0xcc, 0x0e, 0x9d, 0x97, 0x1a, 0xbb, 0xdd, 0xd7, 0x02, 0x8e, 0x6f, 0x84, 0x87, 0x6a, 0x30, 0x58, 0xa4, 0x54, 0xfe, 0x2f, 0x33, 0xc7, 0x5e, 0x3d, 0xd0, 0x62, 0xf1, 0x19, 0xcd, 0x3e, 0xca, 0x81, 0x06, 0xb6, 0xbf, 0xbe, 0xa4 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.17", + /* Message */ + 26, + { 0x79, 0xc6, 0x82, 0xa2, 0xb9, 0x79, 0xfe, 0x5c, 0x96, 0x32, 0xaf, 0x18, 0x31, 0xc2, 0xaa, 0xcf, 0x0c, 0x6b, 0xf5, 0x66, 0x88, 0x5b, 0xf5, 0x25, 0x62, 0x50 } +, + /* Seed */ + 100, + { 0x5c, 0x2a, 0x95, 0x6d, 0x4b, 0x5f, 0x06, 0xf7, 0x50, 0x83, 0x5a, 0xb8, 0xb2, 0x9c, 0xf7, 0xc6, 0x41, 0xd7, 0x93, 0xc5, 0x56, 0xe1, 0x2a, 0xab, 0xa9, 0x56, 0xdf, 0xde, 0x46, 0x32, 0xd5, 0xe5, 0x02, 0xd5, 0x90, 0x41, 0x78, 0x3a, 0xfd, 0x1d, 0xa7, 0xb2, 0xe2, 0xd2, 0x4e, 0x22, 0xd6, 0x44, 0x78, 0x35, 0xbf, 0x6d, 0x77, 0xc6, 0xee, 0xbc, 0x0d, 0x2d, 0x64, 0xe7, 0xed, 0x2c, 0x14, 0x17, 0x18, 0xad, 0x86, 0x87, 0xc5, 0x97, 0xb7, 0x71, 0x8f, 0x38, 0xbf, 0x1a, 0x33, 0x16, 0xed, 0xef, 0xf6, 0xb7, 0x2e, 0x28, 0x51, 0x82, 0x88, 0x07, 0xbc, 0xff, 0xa9, 0xb8, 0xe1, 0xa8, 0x52, 0xf3, 0xfa, 0xa8, 0x07, 0xf6 } +, + /* Encryption */ + 129, + { 0x25, 0x1d, 0x48, 0x56, 0xb7, 0xa7, 0x58, 0x0d, 0x53, 0x88, 0x01, 0x62, 0x28, 0x1b, 0xb4, 0xe4, 0x1b, 0xde, 0xb2, 0xa8, 0x7d, 0xdb, 0xd5, 0xae, 0x1b, 0x30, 0x7d, 0x44, 0x48, 0xbe, 0x1f, 0x11, 0x69, 0x5f, 0xf7, 0x22, 0xc4, 0x32, 0x41, 0x5d, 0x0c, 0x74, 0xba, 0xa3, 0xfc, 0x0d, 0xd5, 0x11, 0x66, 0xac, 0x86, 0x5b, 0x31, 0x0c, 0x4f, 0x5c, 0x87, 0x07, 0x98, 0x62, 0x54, 0xc8, 0x96, 0x04, 0xcc, 0xda, 0xbc, 0xe6, 0xc6, 0x92, 0x44, 0x66, 0x21, 0x89, 0x8b, 0x4f, 0x5a, 0x08, 0xbc, 0xdf, 0x64, 0x62, 0xe5, 0x18, 0xee, 0x3a, 0xeb, 0x75, 0xe2, 0x6d, 0x8f, 0x63, 0xa0, 0x6f, 0xcb, 0xb3, 0xdf, 0x09, 0x8c, 0xee, 0xbb, 0x0f, 0xd2, 0xf6, 0x37, 0xe3, 0xa7, 0x93, 0x7f, 0x4d, 0x19, 0xe3, 0xa1, 0x92, 0x4c, 0x16, 0x08, 0x2e, 0xdc, 0x33, 0x3c, 0xb6, 0xde, 0x37, 0x63, 0x72, 0x46, 0xe4, 0x98 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.18", + /* Message */ + 63, + { 0x1e, 0x0d, 0x18, 0x07, 0xa2, 0xbd, 0x49, 0x6b, 0xb0, 0xcb, 0xa8, 0x41, 0xc7, 0x71, 0x58, 0xbf, 0xa5, 0xf8, 0xaa, 0x77, 0xd0, 0x56, 0x75, 0xc6, 0x4a, 0x5e, 0xb1, 0x85, 0x65, 0x91, 0xd3, 0x48, 0x54, 0xf8, 0x65, 0x92, 0x5b, 0x37, 0x1b, 0x68, 0x6a, 0xaa, 0xb4, 0x45, 0x98, 0xb4, 0xa1, 0x6a, 0xb6, 0xb7, 0x93, 0x44, 0xd3, 0xc2, 0x3f, 0x7d, 0x5b, 0xf1, 0x73, 0xb8, 0x42, 0xd7, 0x8c } +, + /* Seed */ + 63, + { 0xdb, 0xaf, 0xa5, 0x33, 0x2f, 0x0b, 0x55, 0x27, 0x96, 0x63, 0x6d, 0x8a, 0x09, 0x28, 0xb7, 0xd8, 0x7d, 0x9c, 0xee, 0x3d, 0x4b, 0xe6, 0xa3, 0x1c, 0x77, 0xe1, 0x4e, 0x0e, 0x5d, 0xfd, 0xd4, 0x03, 0xef, 0xb9, 0x8f, 0xa3, 0x38, 0x81, 0x6e, 0x12, 0x62, 0xc0, 0x64, 0x96, 0xfd, 0xe9, 0xd5, 0x57, 0xc0, 0x0c, 0xc0, 0xdd, 0x35, 0xfc, 0x33, 0xac, 0xcd, 0x79, 0xa3, 0x15, 0x06, 0x90, 0xeb } +, + /* Encryption */ + 129, + { 0x1b, 0x2e, 0xce, 0xa5, 0xfa, 0x90, 0x03, 0xfa, 0xb6, 0x55, 0x98, 0x57, 0xc6, 0xd9, 0x4f, 0x95, 0x70, 0x03, 0xf4, 0xe4, 0x1c, 0x09, 0x45, 0x64, 0x80, 0x4f, 0xe6, 0x96, 0x39, 0xe5, 0x40, 0xb6, 0x8f, 0x26, 0x3f, 0xaa, 0xec, 0xa1, 0x99, 0x69, 0x7a, 0x48, 0x85, 0x8b, 0x8a, 0x0f, 0xce, 0xa4, 0x91, 0x05, 0x7d, 0xf2, 0xfb, 0x8b, 0x35, 0xd0, 0x93, 0xd8, 0x94, 0xae, 0xc1, 0x7c, 0x5c, 0xde, 0x5d, 0xfd, 0x8f, 0x33, 0x51, 0x2b, 0xcc, 0x66, 0xcd, 0xe7, 0x6d, 0xa0, 0x73, 0x36, 0x98, 0x5a, 0x97, 0x43, 0x5b, 0x6e, 0xfe, 0xe4, 0xee, 0x09, 0xd3, 0xa2, 0x8a, 0xff, 0x34, 0xce, 0x6a, 0xe8, 0x75, 0x0d, 0xa4, 0x1e, 0x16, 0xca, 0x47, 0xe9, 0x38, 0x81, 0x8e, 0x44, 0xa9, 0xb4, 0x1f, 0xe9, 0x1a, 0x6a, 0x80, 0x1d, 0x35, 0x5e, 0xe8, 0xd6, 0x60, 0xe2, 0x7e, 0x4f, 0xe2, 0xce, 0x7f, 0x32, 0x5b } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.19", + /* Message */ + 15, + { 0x1c, 0x10, 0x5d, 0x5e, 0xbe, 0xa3, 0x66, 0x46, 0xa9, 0x72, 0x84, 0xc1, 0x7a,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 0x5b, 0x9c, 0xa2, 0x83, 0xc4, 0xc9, 0x7e, 0x61, 0xcf, 0x9f, 0x40, 0x73, 0xe0, 0x32, 0xca, 0x27, 0xd6, 0x9b, 0x1b, 0x4e, 0xeb, 0xea, 0x77, 0xcc, 0x95, 0xa9, 0x28, 0x1f, 0x26, 0xb6, 0x4a, 0x05, 0xa9, 0x39, 0x44, 0xc8, 0x2c, 0x5a, 0x13, 0x42, 0x8e, 0xce, 0x21, 0xfb, 0x44, 0x01, 0xad, 0x42, 0x6e, 0x7a, 0xc1, 0xf0, 0x5b, 0xff, 0x84, 0xb3, 0x47, 0xcd, 0xc4, 0xdb, 0xe5, 0x2e, 0x67, 0x8a, 0xed } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 12.20", + /* Message */ + 12, + { 0xf1, 0x04, 0x02, 0xf0, 0x02, 0x05, 0xc5, 0x27, 0x57, 0xed, 0x6e, 0x9d } +, + /* Seed */ + 114, + { 0xe2, 0xae, 0xe7, 0xfc, 0xf4, 0x3c, 0xed, 0xe0, 0x75, 0x52, 0xa2, 0xdf, 0xe5, 0xb5, 0xa9, 0xef, 0x80, 0x82, 0x76, 0xd8, 0xf1, 0x0e, 0xb3, 0xf9, 0xbc, 0x50, 0xf1, 0xbd, 0x94, 0x0a, 0xaa, 0xe6, 0x34, 0xc9, 0xd8, 0xa0, 0x78, 0x8d, 0x44, 0xd4, 0x1e, 0x8a, 0x5c, 0x60, 0x36, 0x49, 0xef, 0xea, 0x83, 0x03, 0x32, 0x31, 0x51, 0x6c, 0x69, 0xd3, 0x3e, 0x12, 0xf1, 0xf5, 0xd3, 0xf0, 0xac, 0x1f, 0xc2, 0x3a, 0x9b, 0x3f, 0x5d, 0xa4, 0xe0, 0xef, 0x6e, 0x45, 0x50, 0xcb, 0x43, 0xfd, 0xff, 0x02, 0xb2, 0x5d, 0xac, 0x86, 0x27, 0x2d, 0x66, 0xdb, 0x59, 0xcd, 0xd6, 0x35, 0xf9, 0xc0, 0xdd, 0x0d, 0xaa, 0x08, 0x57, 0x91, 0x0c, 0x15, 0x88, 0x1b, 0x16, 0x0d, 0x70, 0xea, 0x53, 0x40, 0x5a, 0xa9, 0x59, 0xf4 } +, + /* Encryption */ + 129, + { 0x0b, 0x96, 0x56, 0x31, 0x78, 0x32, 0xa9, 0x40, 0xc7, 0x95, 0xbb, 0xa5, 0x8d, 0xaa, 0x15, 0x9a, 0x4f, 0x73, 0x3e, 0x82, 0x6c, 0xe5, 0x5a, 0x4e, 0xc5, 0x64, 0x33, 0xc5, 0x16, 0x84, 0x44, 0x4c, 0x78, 0xe2, 0xe2, 0xfc, 0xb3, 0x7f, 0x85, 0xad, 0x87, 0x79, 0x16, 0x52, 0x2d, 0x8a, 0x35, 0xa4, 0x3f, 0x53, 0xc5, 0x95, 0x17, 0xa8, 0x18, 0xe5, 0x21, 0xe1, 0x98, 0x2a, 0x50, 0x91, 0xbf, 0x2c, 0x68, 0xb0, 0x0e, 0xe4, 0x9a, 0xbd, 0x90, 0xdd, 0x77, 0x6c, 0x02, 0xf6, 0x4f, 0x34, 0xf6, 0x80, 0xa8, 0x8e, 0xee, 0x05, 0xec, 0x08, 0x88, 0x92, 0xbc, 0x0a, 0x95, 0x55, 0xb3, 0xf2, 0x0c, 0x8b, 0xee, 0x57, 0x9c, 0x0d, 0xdd, 0xe1, 0x51, 0x1a, 0x18, 0xaf, 0x98, 0xbc, 0x1d, 0x9c, 0xf9, 0x0b, 0x81, 0xbf, 0x13, 0x2a, 0xbd, 0x58, 0x97, 0x0b, 0x3e, 0x84, 0xd8, 0x14, 0xe2, 0x7d, 0x02, 0x5b, 0x73 } + +} +, +} +}, +{ + "Example 13: A 1031-bit RSA key pair", +{ + /* Modulus */ + 129, + { 0x55, 0x5d, 0xc2, 0xba, 0xf0, 0x41, 0xb7, 0xf0, 0x9a, 0x04, 0x78, 0x42, 0x3a, 0xeb, 0xcb, 0x5f, 0x49, 0xb9, 0x5d, 0xbe, 0x15, 0x70, 0xe9, 0xa5, 0x42, 0x12, 0x8d, 0x33, 0x22, 0x87, 0x86, 0x6a, 0xc4, 0xcc, 0x63, 0xe7, 0x6f, 0x8e, 0x3a, 0xef, 0x22, 0xc9, 0x75, 0x3a, 0x54, 0x51, 0x99, 0x94, 0x24, 0x52, 0x41, 0x8a, 0x67, 0xd1, 0xa2, 0x23, 0x0d, 0xdb, 0x6f, 0x42, 0x22, 0xc6, 0x63, 0xd3, 0x8e, 0x80, 0x05, 0x0e, 0xeb, 0x67, 0x95, 0x6e, 0xc5, 0xf5, 0x49, 0x94, 0xa0, 0xbe, 0xa6, 0x95, 0xfa, 0x59, 0xfa, 0xdf, 0x2d, 0xcf, 0xe7, 0xac, 0xb5, 0x4e, 0xd9, 0xda, 0x3d, 0x0b, 0xeb, 0x12, 0x2c, 0x8a, 0x69, 0x1b, 0x0b, 0xb5, 0x1a, 0xe6, 0x5a, 0x77, 0x4d, 0x75, 0xb1, 0xb3, 0x49, 0xcb, 0x68, 0xc5, 0x17, 0xcb, 0xd3, 0x86, 0xae, 0x48, 0x2f, 0x05, 0xee, 0x46, 0x03, 0xec, 0xf2, 0x95, 0x5d } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 129, + { 0x05, 0x97, 0x87, 0xbb, 0x01, 0x23, 0xfc, 0xed, 0x98, 0xd9, 0x34, 0x1b, 0x7a, 0x8a, 0x99, 0x9e, 0xdb, 0x50, 0x76, 0x30, 0x8e, 0x6d, 0x00, 0x11, 0x20, 0x3b, 0xe0, 0xdd, 0xf9, 0xa4, 0x11, 0x0d, 0x0b, 0x69, 0x2c, 0x1e, 0x2b, 0xf3, 0x90, 0x2e, 0xbc, 0x03, 0xa0, 0x57, 0x3a, 0xd0, 0xc1, 0x93, 0xaf, 0xb1, 0x67, 0xb3, 0xae, 0x4b, 0x50, 0x28, 0xa5, 0xae, 0xbb, 0x22, 0x04, 0xef, 0x23, 0xf8, 0xe5, 0x83, 0x60, 0xbe, 0x94, 0x84, 0x95, 0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0x6e, 0x87, 0x7c, 0x6b, 0x9d, 0x77, 0xc6, 0xa2, 0x76, 0xe3, 0xef } +, + /* Prime exponent 1 */ + 65, + { 0x08, 0xd1, 0xc7, 0xd9, 0xc4, 0xd0, 0x2c, 0xbd, 0xdf, 0x7c, 0x7e, 0x86, 0x62, 0xa8, 0x2f, 0x41, 0x19, 0xcd, 0x56, 0x24, 0x0f, 0x25, 0x0b, 0x05, 0x97, 0xbd, 0xde, 0x37, 0x27, 0x9b, 0x86, 0xa1, 0x58, 0x64, 0xa1, 0xc6, 0x8c, 0x73, 0x39, 0xb4, 0xdd, 0x0d, 0x26, 0x59, 0xa0, 0x29, 0x61, 0xdc, 0x79, 0x12, 0xa4, 0xef, 0xcb, 0x7c, 0xb7, 0x96, 0x1a, 0x97, 0xfe, 0x36, 0xd6, 0xbb, 0x4c, 0xe0, 0x0d } +, + /* Prime exponent 2 */ + 65, + { 0x01, 0xd4, 0x91, 0x3b, 0xd1, 0xd3, 0x87, 0xd5, 0x3b, 0xaf, 0x09, 0xbd, 0x17, 0x5e, 0xc6, 0x48, 0x67, 0x6d, 0x2f, 0xb2, 0x1d, 0x0a, 0x10, 0x8e, 0x7c, 0xbb, 0xdc, 0xc8, 0x0b, 0xb3, 0x4c, 0x43, 0x80, 0xb8, 0xca, 0x86, 0x5d, 0x46, 0xd2, 0x2a, 0x74, 0x3b, 0x31, 0xf2, 0x81, 0xe1, 0x08, 0x21, 0x5e, 0x84, 0x05, 0x80, 0x63, 0x82, 0x65, 0x42, 0x88, 0xd4, 0x54, 0x49, 0x9b, 0x1e, 0xf4, 0x8b, 0x75 } +, + /* Coefficient */ + 65, + { 0x08, 0x7b, 0x2e, 0xf2, 0x11, 0x44, 0x8e, 0x5c, 0x96, 0x1c, 0x9f, 0x6d, 0xfe, 0xe6, 0xaa, 0x26, 0x8e, 0xe8, 0x97, 0x7e, 0x31, 0x1c, 0x07, 0xcc, 0x8d, 0xb4, 0x72, 0xda, 0x6c, 0x49, 0x86, 0x3f, 0xaa, 0xf3, 0x3b, 0xf5, 0x05, 0xdc, 0xfd, 0x81, 0xf5, 0x3a, 0x53, 0xbe, 0x12, 0x1e, 0x44, 0x5e, 0x89, 0xd7, 0xe0, 0x38, 0xef, 0x27, 0xf3, 0x72, 0x7b, 0x51, 0x2a, 0x2b, 0x80, 0x94, 0x41, 0x20, 0xea } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 13.1", + /* Message */ + 7, + { 0x7b, 0xc8, 0x1d, 0x81, 0x46, 0xe3, 0x59 } +, + /* Seed */ + 119, + { 0x76, 0x65, 0x5e, 0x4a, 0xd8, 0xfb, 0x99, 0x34, 0xd1, 0x84, 0x7c, 0xc9, 0x0c, 0x02, 0x47, 0x3c, 0x57, 0x2b, 0x5f, 0xdf, 0xd1, 0x64, 0xa9, 0x70, 0xa3, 0xcd, 0x96, 0xbc, 0x8c, 0xd7, 0x96, 0xac, 0x80, 0x2c, 0x50, 0x28, 0x22, 0x90, 0xea, 0xd4, 0xc7, 0x7a, 0xa5, 0xcc, 0x2a, 0x7e, 0x34, 0x34, 0x18, 0xc9, 0xdf, 0x47, 0xef, 0xb8, 0x87, 0x86, 0xaf, 0x4c, 0xc8, 0xd1, 0x82, 0x1c, 0x50, 0x07, 0x39, 0x09, 0xe8, 0x4f, 0x7b, 0x45, 0x1a, 0xf4, 0xa3, 0x2a, 0xee, 0x6c, 0x7c, 0xc8, 0x97, 0xee, 0xf7, 0x66, 0x0e, 0x1c, 0x4c, 0x53, 0x5d, 0x10, 0x03, 0x9d, 0x3a, 0xa2, 0x03, 0x5c, 0x98, 0x51, 0x01, 0x25, 0xec, 0x5f, 0x2a, 0x2e, 0x9d, 0xac, 0x63, 0x95, 0x89, 0xff, 0x8b, 0xb3, 0x9f, 0x07, 0x43, 0x8d, 0xef, 0xb7, 0xd1, 0x33, 0x77 } +, + /* Encryption */ + 129, + { 0x14, 0x6d, 0x65, 0x12, 0xdf, 0xdf, 0xfb, 0xc0, 0x2d, 0x5d, 0x54, 0xbf, 0xf3, 0xe0, 0x36, 0xa3, 0x5b, 0x4c, 0x2a, 0xa9, 0x44, 0xd6, 0xf6, 0x72, 0x47, 0x93, 0x30, 0x65, 0x37, 0x08, 0x1b, 0xd1, 0x1e, 0xe5, 0x68, 0xa4, 0xe9, 0x71, 0x9f, 0x1e, 0x31, 0xf2, 0xd1, 0x4e, 0x18, 0xc2, 0xda, 0x62, 0x44, 0x70, 0xc5, 0xb0, 0xff, 0xab, 0x39, 0x7f, 0x92, 0x31, 0xb6, 0xef, 0x46, 0x34, 0xf6, 0x3a, 0x18, 0x28, 0x5d, 0xf3, 0x41, 0x45, 0x17, 0xa5, 0x1f, 0x93, 0x58, 0x6d, 0x66, 0xb0, 0x3c, 0xab, 0x1e, 0x78, 0xa4, 0xeb, 0x94, 0x1b, 0x9d, 0x3d, 0x7f, 0x92, 0x03, 0xb5, 0x9e, 0x1c, 0xb3, 0xbb, 0x48, 0x64, 0xb6, 0x46, 0xdc, 0x17, 0xa0, 0x64, 0x11, 0xeb, 0xd5, 0xff, 0x03, 0x37, 0x20, 0x58, 0x88, 0x1b, 0x4a, 0x24, 0xb2, 0x4f, 0x4c, 0x2d, 0xcd, 0x5c, 0xb4, 0x4c, 0x2e, 0xea, 0xbe, 0x6f, 0x72 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.2", + /* Message */ + 52, + { 0x68, 0x6a, 0x81, 0x0a, 0x03, 0x1d, 0x80, 0x61, 0xe4, 0x1a, 0x77, 0x6a, 0x7d, 0xfb, 0xdb, 0x3a, 0xf6, 0x26, 0xfe, 0x97, 0x69, 0xde, 0xee, 0xa4, 0x60, 0xba, 0x28, 0x67, 0xac, 0xf0, 0x3d, 0x9f, 0x92, 0x4d, 0x32, 0x1e, 0x8a, 0x8f, 0x42, 0x5c, 0x28, 0x51, 0x92, 0x98, 0x67, 0xa3, 0x26, 0xae, 0x27, 0x5b, 0x49, 0xd2 } +, + /* Seed */ + 74, + { 0xf7, 0x9b, 0x49, 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0xc8, 0x64, 0xe2, 0x28, 0xc2, 0xcc, 0x1b, 0x64, 0xe3, 0x36, 0x16, 0x95, 0xb5, 0xaa, 0x11, 0x3d, 0xc5, 0xa7 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.3", + /* Message */ + 9, + { 0x18, 0x54, 0x4a, 0xad, 0x24, 0xab, 0x07, 0x5d, 0x3a } +, + /* Seed */ + 117, + { 0x23, 0x20, 0x4b, 0x8a, 0xd9, 0x45, 0x75, 0xf6, 0xe2, 0xf4, 0x6c, 0x79, 0x7b, 0xb8, 0x73, 0xaa, 0x3f, 0x46, 0x1a, 0xcd, 0x05, 0xe7, 0xdb, 0x78, 0x46, 0xa2, 0x31, 0x57, 0x59, 0x2d, 0x52, 0xe9, 0xa9, 0xa7, 0x04, 0x38, 0x19, 0xc4, 0x88, 0x96, 0x27, 0x5e, 0xd9, 0xdf, 0x0b, 0x1e, 0x54, 0x04, 0x93, 0xc0, 0x77, 0xea, 0x15, 0x41, 0x9a, 0xfa, 0x87, 0xdc, 0x35, 0xf9, 0xfd, 0xf7, 0xab, 0x8a, 0xaf, 0x47, 0xee, 0xe1, 0xd3, 0x3e, 0xcc, 0x28, 0x95, 0x06, 0x45, 0xf1, 0xb6, 0x91, 0x38, 0x2d, 0x87, 0x54, 0x1e, 0xd0, 0x64, 0x06, 0x93, 0x0c, 0x7e, 0xe1, 0x10, 0x9a, 0xa5, 0xca, 0x75, 0xa4, 0x90, 0x93, 0x4e, 0xa8, 0xd3, 0xb2, 0xa0, 0x4b, 0xa1, 0x52, 0x1b, 0xe0, 0x92, 0xc8, 0x68, 0xf7, 0xea, 0x5b, 0xe3, 0x78, 0xea } +, + /* Encryption */ + 129, + { 0x34, 0xd6, 0xe5, 0x46, 0xd6, 0x9e, 0x27, 0x06, 0xcd, 0xfc, 0x6d, 0x9e, 0x74, 0x18, 0xf8, 0xbe, 0x03, 0xe4, 0x57, 0x56, 0xa8, 0xb1, 0x9b, 0x60, 0xc2, 0x1d, 0x27, 0x34, 0x20, 0xaa, 0x7d, 0x5e, 0xbb, 0xbf, 0x46, 0x0e, 0xf4, 0xc8, 0x4f, 0x6d, 0x47, 0x77, 0xe6, 0xbf, 0x20, 0x3f, 0xf9, 0x18, 0x5f, 0xd5, 0x7d, 0xc7, 0x23, 0xb5, 0x8f, 0x35, 0xc1, 0xe9, 0xb5, 0xff, 0xf4, 0x7c, 0xf9, 0x5a, 0xe5, 0x69, 0xa5, 0xcb, 0x64, 0xdd, 0x9c, 0xb8, 0xd6, 0x40, 0x7c, 0x0b, 0xa5, 0xef, 0xd1, 0x48, 0xf1, 0x8b, 0x56, 0x96, 0xb0, 0x47, 0xda, 0xaa, 0xa2, 0x77, 0xed, 0x8d, 0x45, 0x28, 0x61, 0x4e, 0xe3, 0xda, 0x52, 0x38, 0x71, 0x32, 0xb7, 0xa9, 0xcc, 0xfe, 0x07, 0x3b, 0xe5, 0x03, 0x32, 0xc9, 0xe2, 0x83, 0x73, 0x53, 0xc6, 0x7d, 0xaa, 0x0f, 0xdf, 0xef, 0xc3, 0xb6, 0x52, 0xcf, 0x7d, 0x79, 0xfd } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.4", + /* Message */ + 4, + { 0xd9, 0x0f, 0xa3, 0x8f } +, + /* Seed */ + 122, + { 0x3e, 0x09, 0xf6, 0x50, 0x6f, 0x7f, 0x71, 0x91, 0x47, 0xae, 0x21, 0xe3, 0x94, 0x53, 0xae, 0x0b, 0x41, 0x60, 0x98, 0xda, 0x10, 0x3a, 0xf8, 0x4c, 0x0f, 0x7c, 0xef, 0xae, 0x50, 0x01, 0x99, 0xc9, 0x85, 0x59, 0x67, 0xa8, 0x30, 0x0a, 0x1a, 0x7f, 0x8d, 0x2c, 0xc1, 0x3b, 0x91, 0x72, 0x7e, 0xeb, 0xd9, 0x3c, 0xf7, 0x7d, 0x3f, 0xac, 0xb1, 0x9e, 0x83, 0xa8, 0x40, 0xeb, 0x58, 0x3b, 0xce, 0xa6, 0xc6, 0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0x0a, 0x2d, 0x74, 0xe5, 0x23, 0x3a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.5", + /* Message */ + 47, + { 0xfc, 0xbd, 0xd0, 0x24, 0x8d, 0xf8, 0x57, 0xaf, 0x17, 0x5b, 0x43, 0x96, 0x87, 0x5c, 0x00, 0x6d, 0x51, 0x14, 0xcc, 0x11, 0x16, 0x42, 0x80, 0x04, 0x38, 0x08, 0xaa, 0x79, 0x88, 0x6c, 0x4c, 0xaa, 0x29, 0x11, 0x7b, 0xf3, 0xce, 0x45, 0xa9, 0xbe, 0x55, 0x07, 0xc6, 0xb8, 0xbf, 0x0d, 0x30 } +, + /* Seed */ + 79, + { 0x2c, 0x9d, 0x14, 0x57, 0xba, 0x44, 0x50, 0xdf, 0x40, 0x21, 0xe4, 0xe5, 0x11, 0x83, 0xf7, 0x95, 0xd0, 0x91, 0xc0, 0x7f, 0x6a, 0xe0, 0xdd, 0x96, 0x2d, 0x57, 0x28, 0xc5, 0x4b, 0x7f, 0xc3, 0xc7, 0x72, 0xd7, 0x9d, 0x7b, 0xec, 0xe1, 0xbb, 0x0c, 0x99, 0x6c, 0x9a, 0xc0, 0x7f, 0x99, 0x54, 0xdd, 0xa7, 0x68, 0x7b, 0xec, 0x86, 0xbc, 0xdb, 0x31, 0x40, 0xb2, 0x45, 0xbb, 0x5e, 0x01, 0x27, 0x5b, 0x38, 0xd1, 0xf2, 0x52, 0x33, 0x5e, 0x36, 0xc6, 0x8c, 0x0e, 0x58, 0xf4, 0xce, 0x11, 0x7e } +, + /* Encryption */ + 129, + { 0x2c, 0xed, 0xde, 0xf2, 0x02, 0x69, 0x1a, 0xae, 0x42, 0x71, 0x85, 0x2a, 0x89, 0x83, 0xde, 0x7c, 0x21, 0x4c, 0xee, 0x00, 0xdb, 0xe1, 0xa1, 0x58, 0x84, 0xf4, 0xc3, 0xc1, 0xde, 0x7a, 0x3e, 0xa0, 0x1e, 0xcc, 0xf4, 0x7a, 0xe8, 0x6c, 0x26, 0x93, 0x24, 0xae, 0x52, 0x37, 0x73, 0x37, 0xb6, 0xca, 0x82, 0xe8, 0x5d, 0x55, 0x3f, 0xbb, 0x2e, 0xe5, 0xf9, 0x77, 0xdc, 0x66, 0x4e, 0x14, 0x2f, 0x1b, 0x54, 0x53, 0x8f, 0xaf, 0x85, 0xca, 0xc2, 0x7c, 0x29, 0xf2, 0xed, 0x0c, 0x40, 0x42, 0x67, 0x33, 0x5d, 0x48, 0xea, 0x40, 0xe8, 0xa3, 0xdd, 0xd8, 0x96, 0xbb, 0xb3, 0xe0, 0xed, 0xf0, 0xe1, 0x6f, 0x9e, 0x89, 0x44, 0x68, 0x3b, 0x8c, 0xfb, 0xaa, 0xb5, 0xea, 0xf2, 0x25, 0x30, 0xf1, 0x58, 0xc4, 0x88, 0x0b, 0xc3, 0xe4, 0x60, 0xc0, 0x6a, 0x24, 0x03, 0x42, 0x21, 0x0a, 0xa8, 0x7b, 0x79, 0x09, 0x68 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.6", + /* Message */ + 34, + { 0x25, 0xf2, 0xa3, 0x06, 0xea, 0xbe, 0x6e, 0x3a, 0x18, 0x30, 0xdc, 0x93, 0x6b, 0xfa, 0x41, 0xcd, 0xeb, 0xb8, 0x80, 0x05, 0x17, 0x5d, 0xf4, 0xa3, 0xc9, 0xc4, 0x64, 0x23, 0x01, 0x45, 0x61, 0x11, 0x5a, 0xa8 } +, + /* Seed */ + 92, + { 0xcb, 0x8e, 0x0f, 0xf4, 0x1b, 0xab, 0x01, 0xa1, 0x42, 0xf9, 0x6e, 0x7d, 0x7c, 0xd3, 0x92, 0x82, 0x0a, 0x82, 0xa1, 0x73, 0x66, 0x74, 0xb9, 0x21, 0x35, 0xef, 0x33, 0x08, 0x96, 0x88, 0xdd, 0x30, 0xb2, 0xc2, 0xf7, 0xba, 0x11, 0x1a, 0xf7, 0x8d, 0x3f, 0x76, 0xa3, 0x7f, 0x66, 0x7d, 0xb3, 0x97, 0x5f, 0xce, 0x64, 0xec, 0x9a, 0xfb, 0x09, 0x68, 0x50, 0x7f, 0x7b, 0x31, 0x09, 0x7e, 0xaa, 0xe4, 0x88, 0x1b, 0x36, 0x24, 0x06, 0x56, 0x16, 0xca, 0x09, 0x0c, 0x20, 0x4c, 0x1f, 0xa4, 0xbe, 0x13, 0x48, 0x50, 0xea, 0x5e, 0x90, 0xfe, 0xcd, 0xc8, 0x45, 0xb9, 0xd8, 0x39 } +, + /* Encryption */ + 129, + { 0x4c, 0x7a, 0xc8, 0x12, 0x45, 0xe7, 0xd4, 0xde, 0x3c, 0x4d, 0xbf, 0xb3, 0x15, 0xc4, 0x68, 0x34, 0x1c, 0xbf, 0x22, 0x87, 0x57, 0x35, 0xc5, 0xf8, 0x05, 0x90, 0x50, 0x58, 0x53, 0x06, 0x8d, 0x6b, 0xe7, 0x03, 0x9b, 0x1c, 0xee, 0x6d, 0x07, 0xec, 0xb7, 0x66, 0x9c, 0x42, 0xf6, 0xb9, 0x2f, 0x2a, 0x71, 0xf6, 0x45, 0xf7, 0x2c, 0xba, 0xff, 0x76, 0x34, 0x16, 0x37, 0xd2, 0xf1, 0xd6, 0xb1, 0xfe, 0xce, 0xb0, 0x7f, 0x21, 0xe1, 0x4c, 0x70, 0xfb, 0x77, 0xbc, 0x7f, 0x87, 0xb0, 0x31, 0xc2, 0xc8, 0xf2, 0xad, 0xa4, 0xec, 0x43, 0xe9, 0x12, 0x68, 0x2c, 0x2f, 0x49, 0x63, 0x9e, 0x75, 0x71, 0x57, 0x18, 0x77, 0xfc, 0x48, 0x1c, 0xbf, 0x26, 0x98, 0xb3, 0x73, 0x15, 0xbd, 0x4b, 0x93, 0x07, 0x83, 0xf4, 0x79, 0x45, 0x64, 0x2b, 0x7d, 0x81, 0x5e, 0x04, 0x32, 0xd4, 0x5d, 0xd1, 0xd0, 0xd3, 0xb2, 0xa5 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.7", + /* Message */ + 51, + { 0xa0, 0xda, 0xab, 0x4f, 0x9f, 0xe0, 0x4a, 0x2a, 0x51, 0xbf, 0x08, 0x32, 0x70, 0x11, 0x5d, 0x0d, 0x06, 0xdc, 0x29, 0x21, 0xcf, 0x8d, 0xd1, 0x3f, 0x5c, 0xff, 0x26, 0x04, 0xbc, 0x55, 0x1e, 0xfd, 0x98, 0x3d, 0x9b, 0x25, 0xb7, 0x27, 0x4f, 0x3c, 0xcb, 0x0a, 0xdc, 0xc1, 0x1b, 0x1a, 0x39, 0x54, 0xab, 0x9d, 0xb4 } +, + /* Seed */ + 75, + { 0xc8, 0x1d, 0x1c, 0x02, 0xf0, 0x6e, 0x7f, 0xfd, 0x6e, 0x03, 0xb8, 0x1b, 0x71, 0x93, 0xaa, 0xbd, 0xac, 0x56, 0x63, 0xab, 0x14, 0x25, 0xa6, 0x7d, 0x1a, 0x29, 0x50, 0x88, 0x5f, 0x5d, 0x1c, 0x4b, 0x72, 0x5e, 0x20, 0x9d, 0xcb, 0xce, 0x9f, 0x7b, 0xf2, 0x96, 0x75, 0x23, 0x42, 0xf1, 0x84, 0xfe, 0xa0, 0x6a, 0x7d, 0x6c, 0xb2, 0xbd, 0x39, 0xb2, 0xa3, 0x18, 0x07, 0x51, 0x64, 0xa2, 0xe7, 0x61, 0xb7, 0x02, 0x70, 0x2b, 0x01, 0x92, 0x46, 0xc1, 0xe5, 0x0e, 0x6e } +, + /* Encryption */ + 129, + { 0x06, 0xc0, 0x6c, 0x97, 0x5f, 0xc6, 0xb9, 0xc2, 0x60, 0xd3, 0xd8, 0x81, 0x3b, 0x57, 0x14, 0x24, 0x8b, 0xeb, 0x39, 0x9b, 0x7d, 0x68, 0xfc, 0xac, 0x25, 0x03, 0x38, 0xca, 0xc5, 0x4c, 0x40, 0x72, 0x95, 0x9f, 0x62, 0x03, 0x84, 0x44, 0xe9, 0xe6, 0x66, 0xba, 0xb5, 0xf9, 0x36, 0x06, 0x70, 0x47, 0xbc, 0xaf, 0x4b, 0xa4, 0xed, 0x68, 0xc6, 0xc8, 0x18, 0x57, 0x46, 0x29, 0x32, 0x56, 0xe7, 0xc7, 0x24, 0x16, 0x65, 0x81, 0x54, 0xde, 0xc0, 0x67, 0xf4, 0x25, 0x0d, 0xc6, 0xb2, 0x9b, 0xba, 0xc1, 0x8e, 0x82, 0x1e, 0x49, 0xa4, 0xc9, 0xb1, 0x63, 0x83, 0x1f, 0x7b, 0xb3, 0x83, 0x92, 0x32, 0x6c, 0x6b, 0x46, 0x85, 0x46, 0x4f, 0xe4, 0xf0, 0x26, 0xc9, 0xae, 0x4d, 0xbc, 0x58, 0x49, 0x47, 0x7b, 0x4c, 0x26, 0x0a, 0xa4, 0xac, 0x02, 0xd2, 0x1a, 0x26, 0x40, 0x20, 0xf1, 0x0c, 0xa1, 0x1b, 0x4b, 0x0e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.8", + /* Message */ + 51, + { 0x74, 0x3c, 0xdd, 0xb3, 0x61, 0xc0, 0xbb, 0x32, 0x47, 0x64, 0x95, 0xad, 0x5d, 0xc6, 0x3a, 0x2b, 0xce, 0x5f, 0xba, 0xc1, 0xc8, 0xc2, 0x03, 0x93, 0x69, 0x32, 0x67, 0xd8, 0x43, 0xf2, 0x8b, 0x8c, 0xf3, 0xea, 0x13, 0xe3, 0x74, 0xe0, 0x9d, 0x0a, 0xa3, 0xf7, 0xae, 0x5d, 0x8f, 0x72, 0xd8, 0xe6, 0xcb, 0x9d, 0xbd } +, + /* Seed */ + 75, + { 0xf7, 0x2e, 0xd2, 0xd0, 0x69, 0xb8, 0xae, 0x50, 0x27, 0x04, 0x6e, 0x03, 0x27, 0xb9, 0x87, 0x84, 0x58, 0x09, 0xb4, 0xe8, 0x16, 0xc8, 0x86, 0x58, 0x24, 0xfc, 0x4a, 0x23, 0x01, 0xb4, 0x56, 0x80, 0x2b, 0x18, 0x9c, 0xbb, 0x43, 0xf0, 0x48, 0x32, 0xac, 0x25, 0xc8, 0x48, 0xd7, 0x4f, 0xbe, 0x1d, 0x62, 0x5a, 0xa9, 0x8a, 0xe0, 0x5e, 0xb6, 0x25, 0x47, 0x76, 0x1c, 0x78, 0xb8, 0x17, 0x61, 0xc3, 0x03, 0xf9, 0x3d, 0xf3, 0xfc, 0x0f, 0xea, 0x3c, 0x5a, 0x7b, 0xb1 } +, + /* Encryption */ + 129, + { 0x38, 0x3e, 0xbb, 0xf1, 0x59, 0xe1, 0xd0, 0xa2, 0x1c, 0x74, 0xeb, 0x61, 0xe3, 0x64, 0x3c, 0xb6, 0x31, 0xbe, 0x18, 0xc7, 0xa2, 0xa5, 0x4e, 0x24, 0x89, 0x33, 0x58, 0x7d, 0x34, 0x5e, 0x99, 0x52, 0x72, 0x46, 0x6d, 0xc1, 0xbd, 0x61, 0x3a, 0xdd, 0xb4, 0xcd, 0x7b, 0xa5, 0x01, 0x92, 0xfc, 0x2d, 0x89, 0x4d, 0x7f, 0xda, 0xf7, 0x83, 0x63, 0xb0, 0x79, 0xd9, 0x98, 0x01, 0x9f, 0x16, 0x42, 0x31, 0xcc, 0x2d, 0x75, 0x2d, 0xb7, 0x6a, 0x9f, 0x9d, 0x0c, 0x52, 0x04, 0xbf, 0xb0, 0xf9, 0x93, 0x05, 0x53, 0x09, 0x6b, 0x5b, 0x76, 0x80, 0xb0, 0x89, 0x4f, 0xb9, 0x9c, 0x11, 0x42, 0x5c, 0x67, 0xd6, 0x5d, 0x96, 0x5e, 0x35, 0x12, 0x8e, 0x15, 0x47, 0x46, 0xb3, 0xfe, 0xd8, 0xd0, 0x16, 0x99, 0x30, 0x70, 0xa7, 0x0e, 0x07, 0xeb, 0xeb, 0xe0, 0x6f, 0x2f, 0x4e, 0x97, 0x6c, 0x9a, 0x63, 0xfb, 0xe3, 0x20 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.9", + /* Message */ + 58, + { 0xe5, 0x31, 0x92, 0xfe, 0xbc, 0xd3, 0x69, 0x58, 0xbd, 0x08, 0x03, 0xf2, 0xea, 0x0a, 0xfd, 0xbf, 0xdf, 0x99, 0x3b, 0x58, 0xa9, 0xe4, 0xee, 0x70, 0xdf, 0x95, 0xb0, 0x6d, 0x4e, 0x7d, 0x74, 0xb6, 0x74, 0x5b, 0x87, 0xf5, 0x81, 0xf3, 0x42, 0xf8, 0xae, 0xf9, 0xae, 0x4c, 0x31, 0x82, 0xc4, 0x19, 0x9b, 0x65, 0x51, 0xfe, 0x18, 0xf8, 0xd3, 0xb9, 0xff, 0xe4 } +, + /* Seed */ + 68, + { 0xad, 0x98, 0x2f, 0xa7, 0x29, 0xf2, 0x7f, 0xce, 0x8a, 0x67, 0x49, 0x03, 0xec, 0xac, 0x69, 0x4d, 0xd3, 0x34, 0x13, 0xc7, 0x8e, 0x34, 0x28, 0xae, 0xed, 0x46, 0x9f, 0x84, 0xd9, 0x57, 0x5c, 0x6d, 0xa2, 0x75, 0x29, 0xf2, 0xc1, 0x4b, 0x53, 0xb7, 0x58, 0xd2, 0x0f, 0xb6, 0xb2, 0x47, 0xc8, 0x29, 0xc5, 0xfb, 0x1a, 0x16, 0xaf, 0x55, 0x07, 0x9a, 0x70, 0x73, 0xcc, 0xa0, 0x56, 0x25, 0x96, 0x2b, 0x6d, 0x1a, 0x6b, 0xef } +, + /* Encryption */ + 129, + { 0x22, 0x1d, 0x88, 0xa8, 0x6c, 0x9e, 0xd3, 0x7a, 0xa0, 0x9c, 0xf5, 0x72, 0x54, 0x97, 0x82, 0xe5, 0x8c, 0xa8, 0xd4, 0x85, 0x1f, 0x01, 0x6a, 0xcf, 0x28, 0x9e, 0xe8, 0xbf, 0x23, 0x79, 0x0b, 0x1a, 0x8f, 0x14, 0x8c, 0x16, 0x55, 0x08, 0xbc, 0x3f, 0xdb, 0x1e, 0xf9, 0xc9, 0x01, 0x16, 0x27, 0x42, 0x7c, 0x5f, 0x32, 0xe5, 0xca, 0xb8, 0x50, 0xcb, 0x6b, 0xc0, 0xbc, 0x04, 0xa1, 0x1d, 0xa2, 0xf0, 0x18, 0x13, 0xf3, 0x41, 0x41, 0x7b, 0x3e, 0x63, 0x2b, 0xca, 0xe0, 0x02, 0x97, 0x7d, 0x64, 0xff, 0xc9, 0x62, 0xc7, 0xfa, 0x75, 0x72, 0xf5, 0x6d, 0x26, 0x17, 0xe2, 0xa5, 0x2d, 0x3e, 0xf9, 0x17, 0xc4, 0x4a, 0x33, 0xb7, 0x15, 0x82, 0xaf, 0xf1, 0x39, 0x0b, 0x7c, 0x77, 0x4d, 0x60, 0x7c, 0x8d, 0x57, 0x8f, 0x7b, 0xc9, 0x0b, 0x35, 0x80, 0xd7, 0x7b, 0x03, 0x73, 0x19, 0x14, 0x77, 0xbc, 0x14, 0x26 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.10", + /* Message */ + 25, + { 0xd0, 0xeb, 0x48, 0x0e, 0x27, 0x45, 0x77, 0x9c, 0x8a, 0x30, 0xfe, 0x82, 0x0a, 0xef, 0x56, 0xd4, 0xce, 0x39, 0xef, 0x84, 0xea, 0x40, 0xc7, 0xdf, 0x0c } +, + /* Seed */ + 101, + { 0x46, 0x5f, 0x91, 0xe3, 0xf0, 0x7c, 0xb7, 0x22, 0x83, 0xbc, 0x2b, 0xbe, 0x52, 0x8b, 0x9a, 0xb3, 0x68, 0x16, 0x54, 0xfe, 0x20, 0xb6, 0x1a, 0x33, 0xf1, 0x23, 0xad, 0xe5, 0x2e, 0x83, 0x2f, 0xfa, 0x8a, 0x1b, 0x74, 0xa4, 0x44, 0x3c, 0xc8, 0x92, 0x95, 0xa2, 0x1a, 0x2a, 0xac, 0x98, 0x74, 0xda, 0x0a, 0x56, 0x79, 0xd1, 0x8c, 0xb5, 0xc4, 0xcd, 0x69, 0x0b, 0xd0, 0xa2, 0x0c, 0xbd, 0x9e, 0x9a, 0xa0, 0x72, 0xaa, 0x87, 0x13, 0x44, 0x8f, 0x95, 0xe5, 0xd6, 0xa6, 0xe6, 0x24, 0xd5, 0xb9, 0x08, 0x5c, 0xfc, 0xec, 0xb7, 0x99, 0x2f, 0x10, 0xea, 0x2d, 0xa6, 0xd6, 0x26, 0xeb, 0xe5, 0x43, 0xd8, 0x70, 0x22, 0x36, 0xee, 0x6c } +, + /* Encryption */ + 129, + { 0x06, 0xf3, 0xf8, 0xc7, 0x0d, 0x0f, 0xc4, 0xe7, 0x44, 0x73, 0xe6, 0x8f, 0xd2, 0x3c, 0xc9, 0xdf, 0x1e, 0xdd, 0x42, 0x35, 0xb4, 0x28, 0xb7, 0x72, 0xa0, 0x83, 0xb4, 0x1c, 0x34, 0x51, 0x62, 0x5a, 0x6f, 0x15, 0xde, 0xa4, 0xbf, 0x31, 0x3b, 0xf4, 0xf0, 0x3f, 0xdc, 0x4f, 0xe9, 0xf6, 0xa2, 0x07, 0x1a, 0xc6, 0x9a, 0xa3, 0xf0, 0xfc, 0x41, 0x57, 0xef, 0xc6, 0x21, 0xf9, 0x59, 0x40, 0x61, 0xf6, 0xc1, 0x98, 0x06, 0xbd, 0x5d, 0x75, 0x9a, 0xd0, 0x23, 0xca, 0xd1, 0x48, 0xe4, 0x47, 0xd2, 0x59, 0xb6, 0x2b, 0xf7, 0x34, 0x25, 0x91, 0xbe, 0x83, 0xba, 0xec, 0x77, 0x71, 0x4c, 0xfe, 0x2b, 0x90, 0x1f, 0x36, 0x9a, 0xea, 0x68, 0x02, 0x48, 0xba, 0xbf, 0x06, 0x87, 0x10, 0xcb, 0xb9, 0x70, 0x48, 0x4f, 0x32, 0x4a, 0x23, 0x52, 0x53, 0xa3, 0x1e, 0x02, 0x25, 0x34, 0xab, 0xec, 0x7b, 0x39, 0x96, 0x06 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.11", + /* Message */ + 27, + { 0x1c, 0x42, 0x97, 0xf6, 0xdf, 0xc0, 0x7f, 0xfe, 0x57, 0x59, 0xaa, 0x1e, 0xaa, 0x5b, 0x79, 0x37, 0x8a, 0xfc, 0xdd, 0x1a, 0x9a, 0x33, 0xa2, 0x13, 0x3a, 0x39, 0xac } +, + /* Seed */ + 99, + { 0xa7, 0x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xf7, 0x64, 0x83, 0x54, 0xbf, 0xcb, 0x70, 0x21, 0x39, 0xed, 0x39, 0x54, 0x94, 0x7d, 0x7b, 0x18, 0x0b, 0x6c, 0x02, 0xbc, 0xad, 0x82, 0x43, 0xa0, 0xab, 0x27, 0xca, 0x66, 0x52, 0x76, 0x29, 0x1b, 0x46, 0xcc, 0x31, 0x8d, 0xa9, 0xb5, 0xf6, 0x0a, 0x04, 0xaf, 0xfe, 0xbc, 0xb0 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.12", + /* Message */ + 16, + { 0x00, 0x92, 0x7f, 0xca, 0x7f, 0x5e, 0xc7, 0x6f, 0x54, 0x8d, 0xd4, 0x82, 0x63, 0xe3, 0x39, 0xbe } +, + /* Seed */ + 110, + { 0xde, 0xbc, 0x2c, 0x1f, 0x22, 0xd9, 0x32, 0xff, 0xcb, 0x89, 0x7c, 0xf1, 0x0a, 0xe6, 0x2c, 0x3e, 0x05, 0x1e, 0x3f, 0x78, 0x46, 0x3a, 0xe6, 0x7d, 0x95, 0x61, 0xcf, 0x1a, 0x73, 0xd5, 0x5c, 0x4b, 0x14, 0xac, 0xa6, 0xc2, 0x1d, 0x83, 0xba, 0xf9, 0x76, 0xcd, 0x8b, 0xf2, 0x46, 0xc2, 0x29, 0x78, 0x61, 0xa6, 0xb1, 0xe9, 0xc9, 0xef, 0x30, 0x81, 0xc5, 0x1c, 0x4b, 0x68, 0x7c, 0x67, 0xb5, 0xdd, 0x0f, 0xe0, 0xf7, 0x55, 0x3f, 0x73, 0x8c, 0x2c, 0x8a, 0x5f, 0x81, 0xd1, 0x26, 0x8a, 0x0c, 0x2d, 0x4a, 0x46, 0x1d, 0x63, 0x5b, 0x0e, 0x59, 0xd2, 0x3b, 0xa4, 0x17, 0xab, 0xb8, 0x04, 0x5e, 0x9c, 0x10, 0xd6, 0x6b, 0x0e, 0xc8, 0x92, 0xf9, 0x53, 0xc6, 0xf2, 0x11, 0xf0, 0x2f, 0xf0 } +, + /* Encryption */ + 129, + { 0x49, 0xb9, 0x20, 0x89, 0xb5, 0x2a, 0xb7, 0x8c, 0x33, 0xb5, 0xbb, 0x30, 0x32, 0xcf, 0x70, 0x24, 0x94, 0x4a, 0xc6, 0x8e, 0x13, 0x9d, 0x2d, 0x56, 0x06, 0x8c, 0x7a, 0x26, 0x2a, 0x53, 0xe7, 0x80, 0x9f, 0xb5, 0xb0, 0x15, 0x65, 0xcc, 0x65, 0x61, 0xd7, 0x13, 0x30, 0x46, 0x87, 0x52, 0x30, 0xac, 0x21, 0x75, 0x64, 0x72, 0x96, 0xcf, 0x2b, 0x48, 0x47, 0xe1, 0x2b, 0x73, 0x63, 0x19, 0x72, 0x53, 0x21, 0xbe, 0xa2, 0x64, 0x75, 0x7d, 0xe0, 0xeb, 0x49, 0x88, 0x72, 0xd8, 0x9a, 0x4d, 0x7c, 0xe4, 0xa1, 0xbd, 0xb7, 0x33, 0x5d, 0xae, 0xa7, 0x8b, 0xa1, 0x96, 0xfd, 0x50, 0xd9, 0x03, 0x82, 0xe6, 0xd6, 0x2f, 0x8d, 0xf7, 0xae, 0x68, 0x5a, 0x1d, 0xfc, 0x84, 0x9e, 0x11, 0x99, 0x7d, 0xee, 0x88, 0x60, 0xd1, 0x0f, 0x70, 0x7b, 0x0d, 0x35, 0x36, 0x5a, 0x81, 0x24, 0x30, 0x73, 0x1e, 0x7a, 0x50, 0x8d } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.13", + /* Message */ + 26, + { 0x8b, 0x6d, 0xf2, 0xd6, 0xda, 0x63, 0x1a, 0xc8, 0xd5, 0x55, 0x6a, 0x26, 0x97, 0x54, 0x28, 0xfc, 0x4d, 0x20, 0xef, 0x5b, 0x4a, 0x1f, 0x06, 0x8e, 0xd2, 0xe5 } +, + /* Seed */ + 100, + { 0xff, 0x2c, 0x06, 0x98, 0x85, 0x2d, 0x1b, 0x0a, 0xe3, 0xc5, 0xc5, 0xc9, 0xbe, 0x26, 0xe8, 0x3c, 0x90, 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0x9e, 0x1b, 0x1b, 0xdc, 0x58, 0x75, 0xb8, 0x78, 0xdd, 0xcf, 0xc1, 0x47, 0x0f, 0xee, 0xf2, 0xae, 0xeb, 0x01, 0x4b, 0x7e, 0x33, 0xef, 0xb9, 0xf4, 0xdd, 0x07, 0x83, 0xd1, 0x71, 0x23 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.14", + /* Message */ + 44, + { 0xea, 0x03, 0x96, 0x69, 0xbc, 0xd7, 0xa8, 0xcd, 0xce, 0xab, 0x58, 0x55, 0x91, 0xb5, 0x63, 0x61, 0xe9, 0x0b, 0xda, 0x0e, 0xa4, 0x40, 0x10, 0x49, 0x64, 0xe8, 0x89, 0xec, 0xe1, 0x8a, 0xeb, 0x04, 0xce, 0x0a, 0xb5, 0xb1, 0xcc, 0xb2, 0x30, 0xae, 0x03, 0x25, 0x5a, 0x39 } +, + /* Seed */ + 82, + { 0x20, 0x4f, 0xae, 0xb3, 0x13, 0x96, 0x5c, 0xc1, 0xa1, 0x8f, 0xaf, 0x10, 0x39, 0xfd, 0xde, 0x68, 0x1b, 0xc4, 0x3b, 0x22, 0x3e, 0x28, 0xbc, 0x47, 0x1c, 0x50, 0x42, 0x3d, 0xa0, 0xbd, 0x79, 0x7d, 0x6a, 0x8c, 0x73, 0x8c, 0x54, 0x03, 0x3c, 0x8e, 0x55, 0x9e, 0xa2, 0xd1, 0x0c, 0x3b, 0x79, 0xb8, 0x0e, 0x2e, 0xfd, 0xec, 0xfe, 0x89, 0x1c, 0xea, 0x2e, 0xcb, 0x34, 0x51, 0xa1, 0xa8, 0xe2, 0xec, 0x2f, 0x44, 0x7b, 0x79, 0x8d, 0x7d, 0xe5, 0x64, 0x1b, 0xda, 0x4a, 0xa9, 0x90, 0xb3, 0x01, 0xe1, 0xdd, 0xe7 } +, + /* Encryption */ + 129, + { 0x4c, 0xa1, 0xc8, 0x5c, 0xe3, 0xc6, 0x20, 0xd4, 0x29, 0x91, 0xcf, 0x41, 0x73, 0x3e, 0xad, 0x26, 0xa0, 0x93, 0x11, 0x18, 0x5f, 0xff, 0xe5, 0x8f, 0x41, 0x28, 0x8f, 0x6d, 0x0b, 0xb6, 0x84, 0x5b, 0x2d, 0x5a, 0xcf, 0x1a, 0xa0, 0x6c, 0x78, 0xd7, 0x1f, 0x76, 0x93, 0x96, 0xa9, 0x43, 0x42, 0x03, 0xe3, 0x8b, 0xb0, 0x1f, 0xd8, 0x8e, 0xb2, 0x3e, 0x6b, 0xc5, 0x1b, 0xa0, 0xc5, 0xf3, 0xee, 0xb3, 0x27, 0x13, 0xca, 0xd4, 0xd0, 0x87, 0x80, 0x50, 0x61, 0xab, 0x47, 0x3a, 0x15, 0x67, 0xe7, 0x9b, 0xbf, 0x4e, 0xae, 0x49, 0x36, 0xf1, 0x8d, 0x02, 0x05, 0xb3, 0x74, 0x6a, 0x17, 0xe0, 0x64, 0x8c, 0x52, 0x22, 0x3d, 0xd9, 0xf9, 0x99, 0x72, 0x81, 0xb5, 0x35, 0xab, 0x2f, 0xb3, 0xcf, 0xf0, 0x3c, 0xa8, 0x90, 0xf7, 0x10, 0xaa, 0x88, 0xfd, 0x2d, 0x0f, 0x39, 0x2f, 0xf4, 0xa8, 0x8d, 0x31, 0x1a, 0xa1 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.15", + /* Message */ + 5, + { 0x0f, 0x46, 0x2b, 0xeb, 0xc6 } +, + /* Seed */ + 121, + { 0x4e, 0xae, 0x5d, 0x54, 0x92, 0xd9, 0x44, 0xff, 0xdb, 0x04, 0x2a, 0xd9, 0x50, 0x16, 0x81, 0xad, 0xb3, 0xeb, 0x6a, 0xb5, 0x28, 0xb6, 0xe8, 0x13, 0x53, 0x55, 0xb6, 0x23, 0xab, 0x55, 0xa7, 0x40, 0x87, 0xb1, 0x9f, 0xc5, 0x9b, 0x85, 0x34, 0xda, 0x9a, 0x88, 0xda, 0x29, 0xf6, 0x6f, 0x71, 0xf9, 0x45, 0x2a, 0xed, 0xe0, 0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 0x63, 0x6b, 0x3d, 0xb9, 0x87, 0x05, 0x4a, 0x56, 0x08, 0x75, 0x22, 0x75, 0x96, 0x29, 0x97, 0xe7 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.16", + /* Message */ + 45, + { 0x51, 0x4d, 0x3b, 0x38, 0x00, 0x22, 0xb3, 0x78, 0x2e, 0x8a, 0x77, 0xd7, 0x7b, 0xf2, 0x4a, 0xfd, 0xf9, 0x2f, 0x33, 0x97, 0x47, 0x4d, 0xae, 0x0d, 0x4b, 0xd6, 0xe4, 0xfa, 0x31, 0xca, 0x60, 0x83, 0xdf, 0x49, 0x6b, 0x36, 0x62, 0x6e, 0x7f, 0x8e, 0x1c, 0x91, 0x9f, 0x9f, 0x2e } +, + /* Seed */ + 81, + { 0xd4, 0xd3, 0xa9, 0xe8, 0xfb, 0xeb, 0x1d, 0xc6, 0x07, 0xb4, 0xdd, 0x78, 0x87, 0xba, 0x25, 0xc3, 0xd0, 0xbd, 0x81, 0x34, 0x84, 0xbd, 0x53, 0x76, 0xdc, 0x83, 0xef, 0xb5, 0x8e, 0xc5, 0xb2, 0x56, 0x2c, 0xb4, 0x4f, 0x98, 0x5e, 0x59, 0xf5, 0x0b, 0x9a, 0xde, 0x3c, 0x66, 0x71, 0x6c, 0xc6, 0xf4, 0x2e, 0x51, 0xc6, 0x0a, 0x2f, 0x4d, 0x8d, 0x75, 0xbf, 0xb9, 0xb8, 0x24, 0x10, 0x5d, 0x1e, 0xe1, 0x58, 0x35, 0xf5, 0xf5, 0xf2, 0x54, 0xfc, 0x6f, 0x68, 0x0e, 0xee, 0x0b, 0x85, 0xaf, 0x54, 0x7c, 0x17 } +, + /* Encryption */ + 129, + { 0x19, 0xfb, 0x39, 0x1a, 0x31, 0x00, 0x87, 0xbc, 0x3d, 0x08, 0x79, 0x1f, 0xd5, 0x99, 0x94, 0xbe, 0x80, 0x12, 0xdf, 0xfd, 0x76, 0xa0, 0x2a, 0xdb, 0xd4, 0x79, 0xcc, 0x0c, 0x15, 0x56, 0x60, 0x5d, 0x4d, 0xa2, 0xa3, 0x46, 0x1c, 0x7c, 0x71, 0xa8, 0x5e, 0xd8, 0xcf, 0x85, 0xe0, 0x8f, 0x45, 0xda, 0xde, 0x51, 0x8c, 0x00, 0xaf, 0x09, 0xf4, 0x93, 0xee, 0x8a, 0x55, 0x46, 0xff, 0xbe, 0xfb, 0x05, 0x3c, 0xca, 0x2e, 0xef, 0x06, 0x84, 0x76, 0x3c, 0xf7, 0x80, 0xf2, 0xe0, 0x97, 0xbd, 0x8e, 0x5c, 0x2e, 0xa8, 0x4c, 0xb1, 0xa8, 0xb8, 0xf8, 0x49, 0x6c, 0xc9, 0x18, 0x16, 0x7f, 0x65, 0x6c, 0xdc, 0x9e, 0x1d, 0x3b, 0x2a, 0x23, 0x38, 0xb6, 0x4c, 0x61, 0xe9, 0x0e, 0xcc, 0x27, 0x4a, 0x12, 0x10, 0xe3, 0xdb, 0x57, 0x83, 0xae, 0x3c, 0x00, 0xab, 0xd3, 0x74, 0x8a, 0x81, 0x0f, 0xd9, 0x14, 0x91, 0x14 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.17", + /* Message */ + 55, + { 0xfb, 0xa1, 0x63, 0x17, 0xb0, 0x93, 0x08, 0x3e, 0x37, 0x20, 0xaa, 0x06, 0x48, 0x17, 0xe7, 0x4c, 0xa7, 0x51, 0xa5, 0x17, 0x87, 0x4b, 0x69, 0x26, 0x50, 0xc4, 0x14, 0x7f, 0x11, 0x9f, 0x68, 0x90, 0x70, 0x2c, 0xf8, 0xb1, 0x4f, 0x0c, 0x18, 0x82, 0x21, 0x2d, 0x72, 0x40, 0x6c, 0x3a, 0x45, 0xd7, 0xd9, 0xff, 0xa4, 0x31, 0x24, 0x10, 0xa6 } +, + /* Seed */ + 71, + { 0x9c, 0xc9, 0xa4, 0xbf, 0x8c, 0xc2, 0x75, 0xa6, 0xb9, 0xb1, 0x35, 0x10, 0x31, 0x91, 0x10, 0x91, 0x7a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c, 0xe2, 0x66, 0x02 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.18", + /* Message */ + 53, + { 0x5f, 0xfe, 0x82, 0xe0, 0x33, 0x54, 0x42, 0x45, 0xb8, 0x49, 0x62, 0xd3, 0x92, 0x7c, 0x2f, 0xa5, 0x99, 0x72, 0xef, 0x59, 0xc2, 0x37, 0xa3, 0x86, 0xa5, 0x1b, 0xd0, 0xba, 0x1f, 0x2c, 0x1f, 0x8e, 0x45, 0xb4, 0x6a, 0x05, 0xad, 0x97, 0xdb, 0x49, 0xd3, 0xac, 0xc6, 0x34, 0x4f, 0x1e, 0xda, 0xdf, 0x65, 0x64, 0xc2, 0x8c, 0xe1 } +, + /* Seed */ + 73, + { 0xcc, 0x23, 0x59, 0xbf, 0xd0, 0xd5, 0x7b, 0xce, 0xbf, 0x07, 0x5b, 0x87, 0xa5, 0x85, 0xa9, 0xbd, 0xe6, 0x59, 0x3e, 0xb2, 0x49, 0x61, 0xef, 0xf1, 0x98, 0x7e, 0x73, 0x56, 0x05, 0xd4, 0xe3, 0x0e, 0x97, 0x19, 0x37, 0xf6, 0xf3, 0xf5, 0xbe, 0x52, 0x78, 0xfd, 0x47, 0x6d, 0xc6, 0x60, 0xee, 0x07, 0x30, 0xcd, 0x07, 0xe5, 0xd1, 0xf4, 0x20, 0x09, 0xa3, 0x33, 0x31, 0x2d, 0x93, 0x28, 0xf3, 0xb0, 0x08, 0x5c, 0x40, 0x75, 0xbc, 0x70, 0x9a, 0x10, 0xf1 } +, + /* Encryption */ + 129, + { 0x05, 0x8b, 0x50, 0xe0, 0xbc, 0xa6, 0xb9, 0x34, 0xc0, 0x1b, 0xf7, 0xc3, 0x3b, 0xb6, 0x15, 0xb7, 0x22, 0xea, 0x41, 0x80, 0x7a, 0x7d, 0x2c, 0x7c, 0xb3, 0xd4, 0x38, 0xe2, 0x8d, 0xbe, 0x33, 0x3e, 0xd6, 0xd8, 0x37, 0x47, 0x7a, 0xf8, 0x4b, 0xb0, 0x06, 0xbb, 0xb1, 0x0b, 0x36, 0x94, 0x4f, 0x15, 0xd4, 0xf6, 0xd2, 0x8b, 0x5e, 0xd2, 0x49, 0xd5, 0x69, 0x0c, 0x08, 0x37, 0xa1, 0x6e, 0x15, 0x7b, 0xa8, 0x80, 0x22, 0x74, 0x10, 0x1c, 0xd4, 0x4e, 0x7f, 0xed, 0x72, 0xa7, 0x59, 0x81, 0xc9, 0x75, 0x66, 0xbc, 0x70, 0xe5, 0x55, 0x97, 0x02, 0xbf, 0x5b, 0x62, 0xfb, 0x09, 0xb2, 0x13, 0x60, 0x56, 0x73, 0xaa, 0xeb, 0xb7, 0xfe, 0x9b, 0x1a, 0xe6, 0xd8, 0x04, 0x03, 0xa2, 0x01, 0x33, 0x80, 0x3e, 0x1e, 0xd2, 0x35, 0x0b, 0x8e, 0x15, 0xff, 0x01, 0x9a, 0x70, 0x0f, 0x2a, 0xbe, 0x87, 0xd6, 0xe7, 0x33 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.19", + /* Message */ + 49, + { 0x22, 0x63, 0x3c, 0xc3, 0xfe, 0x7a, 0x7b, 0x4f, 0x00, 0xfa, 0x99, 0x9c, 0x4f, 0xe0, 0xd8, 0x82, 0xc3, 0x1b, 0xdc, 0x0d, 0x67, 0x0c, 0x0c, 0xc3, 0xd2, 0x88, 0x96, 0x1f, 0xbe, 0x63, 0x72, 0xe0, 0xe5, 0x32, 0x46, 0x42, 0xc7, 0xb1, 0xfa, 0x85, 0x2e, 0x1b, 0x4f, 0x69, 0x6f, 0x12, 0xf5, 0x58, 0x66 } +, + /* Seed */ + 77, + { 0x3e, 0xdf, 0xca, 0xf4, 0x88, 0x71, 0xd2, 0x91, 0xd5, 0xb7, 0xf7, 0x72, 0x3d, 0x92, 0xd9, 0x51, 0x51, 0x52, 0xb6, 0xbf, 0x52, 0xb8, 0x23, 0x69, 0x9c, 0x58, 0x8f, 0x75, 0xf3, 0x4e, 0x37, 0x95, 0x55, 0x0d, 0x07, 0x81, 0x18, 0xe2, 0x86, 0xc9, 0x6e, 0x90, 0x07, 0xae, 0xe1, 0x54, 0xf5, 0x7c, 0xe7, 0xf1, 0xd4, 0x60, 0x39, 0x47, 0x3a, 0x4a, 0x37, 0xa9, 0xb5, 0x90, 0xa3, 0x7e, 0xea, 0x59, 0x94, 0x7f, 0xe8, 0x58, 0x7c, 0x95, 0x69, 0x88, 0xbc, 0xb1, 0x74, 0xe9, 0x7c } +, + /* Encryption */ + 129, + { 0x3d, 0xeb, 0xbc, 0x6c, 0xfb, 0x0e, 0xed, 0x87, 0x16, 0x6b, 0xcc, 0xd5, 0x4c, 0x75, 0x97, 0xad, 0x36, 0xca, 0x0a, 0xc9, 0x6c, 0xf1, 0x66, 0x76, 0xe1, 0x87, 0x4b, 0xf5, 0xf1, 0x0a, 0x0e, 0xc6, 0x9c, 0x3b, 0xe2, 0x25, 0x96, 0x78, 0xee, 0xa6, 0x3a, 0x18, 0x08, 0xd9, 0x06, 0x65, 0xff, 0xce, 0x9a, 0xf0, 0x82, 0x7e, 0xe6, 0x29, 0xed, 0xd6, 0x59, 0x43, 0x43, 0x7f, 0x8c, 0xa0, 0xa6, 0x71, 0x17, 0x2c, 0x52, 0x1c, 0xc0, 0xd1, 0xdd, 0x01, 0xe2, 0x2f, 0x20, 0xa6, 0xc7, 0x9c, 0x42, 0x7a, 0xda, 0x88, 0x56, 0x00, 0x0c, 0x4e, 0x03, 0x5d, 0x9c, 0x5e, 0xf2, 0xe1, 0x05, 0xf2, 0xc9, 0xf6, 0x45, 0x7d, 0x9e, 0xe9, 0x5b, 0x43, 0xbc, 0x4b, 0xe3, 0x29, 0x4a, 0x0e, 0xe1, 0xd5, 0xc8, 0x33, 0xae, 0x91, 0x07, 0x8a, 0xed, 0x09, 0xe7, 0x92, 0xbb, 0x42, 0xc2, 0x5e, 0x00, 0xb0, 0x87, 0xe5, 0x61 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 13.20", + /* Message */ + 63, + { 0x55, 0x2b, 0x38, 0x4c, 0x5e, 0x51, 0x74, 0xf5, 0x1f, 0x38, 0x0d, 0x8b, 0x53, 0xe3, 0xc8, 0x97, 0xb4, 0x8c, 0x66, 0x9a, 0x9c, 0x2d, 0x11, 0x98, 0x5b, 0x86, 0x54, 0xde, 0x7f, 0x76, 0xd9, 0x62, 0x39, 0x6a, 0x37, 0xb9, 0x53, 0x41, 0xf9, 0x9d, 0xec, 0xe4, 0xaf, 0xd7, 0x1d, 0x3c, 0x84, 0xe1, 0x28, 0x7b, 0x0f, 0x0f, 0x86, 0xee, 0xff, 0xcf, 0xd9, 0x7b, 0xa1, 0x88, 0xe3, 0x79, 0x9e } +, + /* Seed */ + 63, + { 0x2e, 0x2f, 0x3e, 0x3f, 0x46, 0xd4, 0x74, 0x0c, 0xb2, 0x6c, 0xbc, 0x65, 0xaa, 0xe2, 0xaf, 0xe4, 0x9d, 0x0b, 0xe6, 0x66, 0x39, 0xd0, 0xdb, 0x10, 0xdf, 0xd6, 0xaf, 0x60, 0x64, 0x46, 0xf3, 0xb7, 0xde, 0x98, 0x21, 0x2f, 0x86, 0x17, 0x4b, 0xdf, 0xa5, 0xb2, 0xe2, 0x35, 0x85, 0x07, 0x45, 0x3c, 0x20, 0xad, 0xa6, 0x9a, 0x4f, 0xfe, 0x0a, 0x35, 0xe1, 0x2e, 0xfb, 0xab, 0x3b, 0xb4, 0x4c } +, + /* Encryption */ + 129, + { 0x14, 0x92, 0x91, 0xee, 0xb5, 0x36, 0xfc, 0x07, 0x03, 0xf7, 0xbd, 0xf1, 0xf0, 0x31, 0xa4, 0x30, 0xcc, 0x83, 0xad, 0xc4, 0x3e, 0x09, 0x68, 0x64, 0x91, 0x26, 0x69, 0x34, 0xef, 0x37, 0xea, 0xea, 0xb1, 0x1b, 0xc7, 0xf3, 0x91, 0x49, 0xab, 0x33, 0x43, 0x66, 0x94, 0x59, 0x36, 0x73, 0xcc, 0xc6, 0x39, 0x0b, 0x52, 0x9e, 0x64, 0xd3, 0x42, 0xe9, 0xf2, 0x1d, 0x17, 0x6d, 0xa2, 0x1f, 0xa6, 0x5a, 0xbd, 0x57, 0xee, 0xc6, 0x0d, 0xde, 0xc7, 0xd1, 0xa0, 0x93, 0xdb, 0xa3, 0x76, 0x44, 0x5f, 0x1b, 0xcf, 0xe5, 0xa6, 0xaa, 0xce, 0x9f, 0x13, 0x42, 0xaf, 0x39, 0xdb, 0x8a, 0xd4, 0x85, 0xba, 0x22, 0x2d, 0x39, 0x12, 0x62, 0x28, 0xfa, 0xee, 0xb4, 0x9b, 0xb3, 0xb2, 0x71, 0xfd, 0x38, 0xe1, 0x15, 0x25, 0xd8, 0x03, 0x15, 0x4e, 0x74, 0x08, 0x4b, 0x75, 0xc3, 0xdb, 0xcd, 0xff, 0x2e, 0x3d, 0x10, 0x42 } + +} +, +} +}, +{ + "Example 14: A 1536-bit RSA key pair", +{ + /* Modulus */ + 192, + { 0xbe, 0x0c, 0xa0, 0x1f, 0x9c, 0x17, 0x21, 0x66, 0xf9, 0x12, 0x39, 0x1e, 0x5d, 0x58, 0xdd, 0xc3, 0x0d, 0x5d, 0xd0, 0x27, 0x9a, 0x49, 0xbb, 0x31, 0x2a, 0x31, 0xe4, 0xc8, 0xa6, 0x6a, 0x52, 0xfb, 0x4e, 0x8b, 0x67, 0x42, 0xfa, 0xac, 0xb2, 0x24, 0xc3, 0x03, 0x9f, 0x1e, 0x19, 0x8f, 0x33, 0x23, 0xb8, 0x88, 0xba, 0x0e, 0x35, 0xbb, 0x94, 0xc5, 0x11, 0xbd, 0x22, 0xb8, 0x86, 0x40, 0x5a, 0x71, 0x5e, 0x40, 0x9d, 0xe3, 0xbc, 0xeb, 0x4f, 0xc9, 0x91, 0x1b, 0x0e, 0x9c, 0x3b, 0x1e, 0x42, 0xe2, 0x57, 0xd5, 0xbb, 0xea, 0x07, 0x22, 0xb5, 0xd5, 0xdd, 0x35, 0x37, 0x56, 0x9d, 0xc7, 0x56, 0x06, 0x46, 0xa7, 0x50, 0xb8, 0x7e, 0xaa, 0x6f, 0x3a, 0x40, 0x5a, 0x94, 0xbf, 0x2a, 0xda, 0x72, 0xb5, 0x0a, 0x4b, 0x01, 0x87, 0xbb, 0x9d, 0x00, 0xec, 0x45, 0x1d, 0x50, 0xa6, 0xa9, 0x1a, 0x1e, 0x2a, 0x91, 0x19, 0x2a, 0x7f, 0xd7, 0x56, 0xb9, 0x00, 0x14, 0x1f, 0xe8, 0x8f, 0x96, 0xe2, 0x08, 0x0d, 0xfd, 0xd8, 0x01, 0x66, 0xa7, 0xbf, 0x67, 0xe3, 0x71, 0x44, 0xd0, 0x9e, 0x3a, 0xf8, 0x99, 0x74, 0xe5, 0x7c, 0x72, 0xb0, 0x3a, 0x2b, 0x88, 0xfd, 0x29, 0x95, 0x25, 0x2a, 0xce, 0x4f, 0x30, 0xe2, 0xe4, 0x7c, 0x28, 0x18, 0x05, 0x72, 0x40, 0x53, 0x6b, 0x58, 0xdb, 0x42, 0x07, 0x50, 0x9e, 0x59 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 191, + { 0xf3, 0x7d, 0x28, 0xd6, 0x1f, 0x28, 0x99, 0xa5, 0xc0, 0xe0, 0xa0, 0x74, 0x9d, 0x13, 0x89, 0x38, 0x7c, 0x64, 0xc8, 0xc3, 0x58, 0xa9, 0x71, 0xda, 0xd1, 0x3c, 0xff, 0x85, 0xc5, 0x9a, 0x62, 0xdd, 0xa7, 0xbb, 0xc0, 0xf7, 0xe5, 0xbd, 0xc6, 0x5d, 0xff, 0x9d, 0xe9, 0xc7, 0x45, 0x40, 0x46, 0x31, 0x75, 0x81, 0x48, 0x16, 0x8d, 0xfe, 0x6a, 0xc0, 0xa2, 0x87, 0x6a, 0x56, 0x05, 0x3b, 0xab, 0x2a, 0x2a, 0x9f, 0xf2, 0x72, 0x79, 0x4d, 0xd5, 0xd8, 0x13, 0x9e, 0xed, 0x10, 0xbc, 0xfb, 0x4d, 0xf3, 0x30, 0x20, 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0xc8, 0x76, 0x78, 0xeb, 0x0b, 0xf7, 0x6c, 0x88, 0x76, 0xc3, 0xab, 0xb9, 0xef, 0x72, 0xcf, 0x01, 0x8f, 0x58, 0x11, 0xa6, 0xbe, 0xe0, 0x4f, 0x09 } +, + /* Prime 2 */ + 96, + { 0xd9, 0x64, 0xe9, 0x6e, 0xa6, 0xfa, 0x43, 0x70, 0xb5, 0x91, 0xee, 0x79, 0xe7, 0xe7, 0x2e, 0xcc, 0x21, 0x81, 0x53, 0x78, 0x7a, 0x60, 0xe2, 0xf7, 0xae, 0x94, 0xfa, 0x95, 0xb9, 0xbd, 0x68, 0x69, 0xd2, 0x81, 0xac, 0x3c, 0xcf, 0xb6, 0x57, 0x24, 0x7c, 0x58, 0x3e, 0xaf, 0xdc, 0x13, 0xd4, 0xd7, 0xa7, 0xd7, 0x76, 0x5e, 0x44, 0x67, 0xdf, 0x76, 0xb5, 0x28, 0xbf, 0x94, 0xbd, 0x03, 0xa3, 0xea, 0x73, 0xb8, 0x1b, 0xe2, 0x6c, 0xca, 0xd9, 0x89, 0xb9, 0xf0, 0x77, 0x28, 0xda, 0xd5, 0x3b, 0x38, 0xef, 0x7f, 0xe9, 0xeb, 0xe9, 0x11, 0x40, 0xcb, 0xad, 0x17, 0xdc, 0x7e, 0xcb, 0x1d, 0x58, 0xd1 } +, + /* Prime exponent 1 */ + 96, + { 0x9e, 0x79, 0xf6, 0x9b, 0x5d, 0x60, 0x94, 0x6f, 0x22, 0xb5, 0xb7, 0x03, 0x3f, 0x18, 0x64, 0x6c, 0x0a, 0xcf, 0x12, 0x03, 0x41, 0x19, 0xf7, 0x23, 0x5a, 0xa1, 0xa7, 0xf0, 0x6a, 0xc8, 0xab, 0x6e, 0xd7, 0x89, 0x11, 0x38, 0x0a, 0x33, 0xb9, 0xea, 0x1f, 0x3e, 0x7f, 0x22, 0x19, 0xbe, 0x30, 0xa5, 0x39, 0x3d, 0xf0, 0xdc, 0x75, 0x51, 0x22, 0xc5, 0x8f, 0x99, 0x66, 0xf8, 0x1b, 0xac, 0x40, 0xe4, 0x69, 0x38, 0x44, 0x90, 0xe3, 0x8d, 0x99, 0xe8, 0x8b, 0x0b, 0x99, 0xc4, 0x97, 0xcc, 0xb5, 0x86, 0x4c, 0xd3, 0x72, 0x9f, 0x4f, 0xf8, 0x34, 0xae, 0x1e, 0x1b, 0x77, 0x24, 0x64, 0xb5, 0xe2, 0x41 } +, + /* Prime exponent 2 */ + 96, + { 0x3a, 0x05, 0xe9, 0x18, 0x13, 0x91, 0x30, 0x76, 0xe0, 0xbf, 0x76, 0x7b, 0x2b, 0x1e, 0x55, 0x2b, 0x3e, 0xb6, 0x19, 0xe5, 0x4a, 0x24, 0x99, 0xef, 0xa9, 0xb5, 0x31, 0xbc, 0xcc, 0xba, 0x75, 0x27, 0xe9, 0x7b, 0x9a, 0xd1, 0x10, 0x4f, 0x86, 0xaa, 0xc2, 0x55, 0x7b, 0x45, 0xcc, 0xe3, 0xae, 0x27, 0x71, 0x30, 0xdc, 0xf3, 0x04, 0x27, 0x05, 0x49, 0xd5, 0xc8, 0x6e, 0x79, 0xf0, 0x89, 0x0c, 0x33, 0x03, 0x77, 0xdc, 0x59, 0x6e, 0xd8, 0x25, 0x7f, 0xd1, 0x15, 0x11, 0x78, 0xe2, 0x0f, 0x8f, 0xa2, 0xfe, 0xa9, 0x91, 0x71, 0xd9, 0xdf, 0x35, 0x00, 0x27, 0xce, 0xfa, 0x97, 0x0c, 0xf7, 0x64, 0x41 } +, + /* Coefficient */ + 96, + { 0x18, 0xb1, 0x0d, 0xd7, 0x3b, 0x14, 0x7d, 0x86, 0xb6, 0x0c, 0xf7, 0xfe, 0xbf, 0x46, 0x35, 0x93, 0xc0, 0xbd, 0xd6, 0xbc, 0x83, 0xa8, 0x39, 0x57, 0x3b, 0x4b, 0x3f, 0xe6, 0x5c, 0x0b, 0x13, 0xe7, 0xb6, 0x94, 0xb8, 0x1a, 0x56, 0x57, 0x21, 0x0b, 0xe9, 0x47, 0x01, 0x1d, 0x8d, 0x49, 0x29, 0xc1, 0x27, 0xfd, 0x2f, 0x3e, 0x31, 0x06, 0xc2, 0x53, 0x38, 0x3b, 0xe6, 0x35, 0x41, 0xd1, 0x23, 0x5b, 0xd7, 0x9c, 0x57, 0x2e, 0x92, 0xe2, 0x36, 0x34, 0x28, 0x20, 0x98, 0xbe, 0xe9, 0x4d, 0x48, 0xbd, 0x62, 0x8a, 0x0e, 0xb2, 0x1e, 0xd2, 0x61, 0xcf, 0xa3, 0x5b, 0x69, 0xb9, 0x77, 0x70, 0xe2, 0x93 } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 14.1", + /* Message */ + 9, + { 0x2b, 0xd6, 0xe3, 0xc1, 0xde, 0xfd, 0xdd, 0x5a, 0x43 } +, + /* Seed */ + 180, + { 0xe7, 0x84, 0xd5, 0x25, 0x03, 0xe6, 0x29, 0x1f, 0x25, 0x8e, 0x44, 0x2d, 0xb5, 0x77, 0xf9, 0x91, 0x63, 0x82, 0xa0, 0xd1, 0x4c, 0x7b, 0x9d, 0xcc, 0xbd, 0xb6, 0x07, 0xaf, 0x01, 0xf0, 0x25, 0x8f, 0xdc, 0x97, 0x23, 0x97, 0xda, 0x12, 0x39, 0xd4, 0x44, 0x9a, 0x58, 0x28, 0x6e, 0xce, 0x20, 0x08, 0xf7, 0x18, 0xf6, 0x90, 0xce, 0xe7, 0x3a, 0x02, 0x7f, 0xab, 0xf8, 0x4b, 0xdf, 0x7a, 0xce, 0x45, 0xf7, 0xed, 0x2d, 0x77, 0x32, 0x4c, 0xbe, 0xe9, 0x0e, 0xcc, 0x6f, 0x1e, 0x7b, 0x86, 0xcc, 0x29, 0x35, 0xa4, 0x7b, 0xa1, 0x56, 0x65, 0x0b, 0x42, 0xfc, 0x71, 0xaa, 0xd0, 0x70, 0x99, 0xa2, 0x7e, 0x97, 0xfe, 0x5a, 0x3f, 0x25, 0xfe, 0x13, 0x48, 0xe4, 0x42, 0x39, 0x12, 0x12, 0xa5,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0x93, 0xbf, 0xaa, 0x01, 0x6a, 0xeb, 0xff, 0x99, 0x53, 0x30, 0xa6, 0xdc, 0xb6, 0x21, 0x5d, 0xd3, 0xbd, 0xb3, 0x5d, 0x7c, 0xd6, 0x1c, 0xcf, 0x0e, 0x9c, 0xcc, 0xbf, 0x51, 0xe9, 0xea, 0x65, 0x8e, 0xa3, 0x1d, 0x12, 0x43, 0x44, 0x4c, 0x4b, 0x72, 0xff, 0xf0, 0x1a, 0xc9, 0x3f, 0x28, 0xeb, 0x7f, 0x67, 0xc1, 0x83, 0x2e, 0x56, 0x8e, 0xd7, 0x2f, 0xd9, 0x57, 0xd5, 0xb4, 0xfd, 0x2f, 0x00, 0xb6, 0x02, 0x31, 0x71, 0xb8, 0x5a, 0xb0, 0xca, 0xa1, 0x03, 0x0e, 0xd3, 0xe3, 0xed, 0xc9, 0x50, 0x31, 0x45 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.2", + /* Message */ + 43, + { 0x10, 0x47, 0x35, 0xd9, 0xad, 0x72, 0x60, 0x46, 0x47, 0x3d, 0xf4, 0xb1, 0x3b, 0x2f, 0x5f, 0xa2, 0x85, 0xc3, 0xd2, 0x33, 0xec, 0xd4, 0x61, 0x70, 0x58, 0x2d, 0xd2, 0x28, 0xcd, 0xee, 0x46, 0x4d, 0xa5, 0x09, 0x5e, 0x20, 0x8c, 0xf8, 0xfb, 0xca, 0x05, 0x38, 0x8b } +, + /* Seed */ + 146, + { 0xdc, 0x6a, 0x63, 0x1e, 0x29, 0x75, 0x45, 0xd2, 0xf6, 0xfe, 0x9c, 0x69, 0xa5, 0xd3, 0x06, 0xa1, 0x09, 0x16, 0xd7, 0xe7, 0xef, 0x0d, 0xc9, 0x53, 0xf2, 0x1b, 0x6a, 0x04, 0x14, 0x31, 0xec, 0x8b, 0xa5, 0xce, 0x1c, 0x13, 0x87, 0x43, 0xfa, 0xac, 0x54, 0x97, 0xd6, 0x99, 0xf2, 0xff, 0x1d, 0x4a, 0x44,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 0x89, 0xdc, 0x83, 0x69, 0xf3, 0x4d, 0x76, 0xd8, 0x37, 0xd6, 0xf3, 0x8a, 0x95, 0x18, 0xa6, 0x27, 0x1c, 0x5b, 0x56, 0x34, 0x62, 0x25, 0xa5, 0xab, 0x8d, 0xa6, 0x03, 0x2a, 0x59, 0x30, 0xfd, 0x5b, 0x77, 0x72, 0x9d, 0xe6, 0x32, 0xe1, 0x75, 0x2f, 0xc7, 0x2a, 0x0c, 0x34, 0xae, 0xce, 0x25, 0x65, 0x7b, 0x28, 0x1b, 0xe8, 0x93, 0x2c, 0x56, 0x50, 0xc9, 0x82, 0xfa, 0x14, 0x5f, 0xde, 0x0b, 0xcd, 0xd4, 0x8a, 0x73, 0xaa, 0x02, 0x88, 0xb4, 0xde, 0x46, 0x11, 0x33, 0xf2, 0x7d, 0x51, 0xe3, 0x86, 0x01, 0x6a, 0x72, 0x72, 0x6a, 0x9e, 0xde, 0x1d, 0x32, 0xdf, 0xc7, 0xe6, 0xf9, 0x78, 0x0c, 0x04, 0xeb, 0x70, 0xff, 0xff, 0xc2, 0x68, 0x82, 0x95, 0x66, 0x73, 0x33 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.3", + /* Message */ + 25, + { 0x31, 0x7e, 0x6f, 0x5e, 0x17, 0x50, 0x0f, 0xe9, 0x4f, 0xdf, 0xf2, 0x84, 0xbb, 0xe5, 0x03, 0x01, 0x04, 0x4d, 0x14, 0x22, 0xd3, 0xca, 0x70, 0x05, 0x98 } +, + /* Seed */ + 164, + { 0x46, 0x6d, 0x53, 0xc8, 0xd0, 0xbb, 0x9e, 0xd4, 0x60, 0xca, 0xa6, 0x3d, 0x79, 0xbf, 0xb8, 0x77, 0xbc, 0x4e, 0xa3, 0x45, 0xca, 0xb4, 0x35, 0x7e, 0x63, 0x9a, 0x95, 0xdc, 0xae, 0x37, 0x9d, 0xdc, 0xea, 0x5d, 0x64, 0xfe, 0xe9, 0x9f, 0xb6, 0xf7, 0x5f, 0xf2, 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 0x56, 0x96, 0xf3, 0xba, 0x95, 0xfd, 0xb8, 0xd0, 0x90, 0xa6, 0xc2, 0x4a, 0x29, 0xd9, 0x90, 0xfb, 0xff, 0x1d, 0xa2, 0x02, 0x81, 0x42, 0x55, 0x8f, 0x0a, 0xd7, 0x53, 0x43, 0xc7, 0x2f, 0x38, 0x82, 0x3d, 0xb7, 0x66, 0x7b, 0x05, 0xe1, 0x6b, 0x51, 0x92, 0xb9, 0x33, 0x60, 0x07, 0xf7, 0x58, 0x10, 0x6c, 0x32, 0x8b, 0xd4, 0x76, 0x11, 0x8d, 0xf8, 0x2a, 0xd0, 0x75, 0x48, 0xa7, 0x26, 0x92, 0x1f, 0xb2, 0xe1, 0x92, 0xb4, 0x3c, 0x8c, 0x30, 0xcc, 0x9b, 0x84, 0x34, 0x63, 0x0e, 0x27, 0xfd, 0x8b, 0x23, 0xef, 0x8d, 0x8f, 0x22, 0xbe, 0x7f, 0x73, 0xae, 0xcd, 0xcb, 0x2b, 0x1e, 0xc5, 0x53, 0x9d, 0x5f, 0xbb, 0x2c, 0xff, 0x9e, 0xd5, 0xe7, 0xf1, 0x9b, 0x49, 0x18, 0x3d, 0x22, 0x1d, 0xfd, 0x53, 0x7d, 0x4f, 0x37, 0x03, 0x2e, 0xf3, 0x2f, 0x63, 0xb6, 0xff, 0x74, 0xee, 0x24, 0xa0, 0x96, 0xcf, 0x45, 0x59, 0x27, 0x09 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.4", + /* Message */ + 29, + { 0x90, 0x96, 0x3d, 0xda, 0xb3, 0x78, 0x91, 0xe7, 0x28, 0x8b, 0x53, 0xbe, 0x5d, 0x9d, 0xc5, 0x67, 0xb1, 0xa0, 0x7a, 0x15, 0x66, 0xc2, 0xaf, 0xdd, 0xd7, 0x72, 0x73, 0x24, 0xba } +, + /* Seed */ + 160, + { 0xa4, 0x9f, 0x12, 0x15, 0x17, 0x5b, 0xa0, 0x4c, 0x27, 0x4a, 0xbc, 0x05, 0x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0xb4, 0x20, 0x25, 0x42, 0x0c, 0x63, 0x96, 0x1e, 0xa0, 0x06, 0x26, 0x57, 0xca, 0x50, 0x65, 0xde, 0xb6, 0x53, 0xac, 0x78, 0xeb, 0x64, 0x98, 0xcf, 0x14, 0xd1, 0x70, 0x4c, 0xec, 0x59, 0x11, 0x69, 0x60, 0x8d, 0xb0, 0x1f, 0xc9, 0x3d, 0x0d, 0x68, 0xe6, 0x28, 0x01, 0xb4, 0x65, 0xa3, 0x87, 0xa9, 0xc7, 0x2f, 0x7e, 0xb3, 0x5b, 0x0b, 0xa5, 0x3a, 0x5e, 0xfa, 0x98, 0xc9, 0xf0, 0xcb, 0x7c, 0x7c, 0xba, 0x18, 0x04, 0xcd, 0x70, 0x1d, 0x02, 0x97, 0xb6, 0x60, 0x05, 0xae, 0x25, 0xec, 0x3b, 0x6c, 0xd4, 0xcf, 0x31, 0x94, 0xa3, 0xfa, 0x65, 0xd9, 0x8c, 0x4b, 0x95, 0x33, 0x30, 0x79, 0x0e, 0xfd, 0xe7, 0x4f, 0xa2, 0x75, 0xd2, 0xa7, 0x9d, 0x33, 0x10, 0xa5, 0xbc, 0xc2, 0xc8, 0x1c, 0x91, 0xfc, 0x25, 0x56, 0x2c, 0xa9, 0x39, 0xf8, 0xd9, 0xc1, 0x75, 0xed, 0xf4, 0xb0, 0x76, 0x73, 0xd5, 0x39, 0x24, 0xe2, 0x7b, 0x15, 0x52, 0x88, 0x1c, 0x10, 0x83, 0x19, 0x23, 0x71, 0x5d, 0x14, 0x9f, 0x1f, 0x31, 0x9e, 0x38, 0xe9, 0x1d, 0xfa, 0x56, 0x6c, 0x54, 0x53, 0xba, 0xcc, 0x14, 0x8b } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.5", + /* Message */ + 11, + { 0x3d, 0x81, 0x02, 0x1f, 0xf6, 0x47, 0x33, 0x37, 0xe0, 0x4b, 0x92 } +, + /* Seed */ + 178, + { 0x9b, 0x70, 0x29, 0x73, 0x13, 0x77,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b } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.6", + /* Message */ + 20, + { 0x5c, 0x74, 0x5d, 0xd4, 0xa8, 0xc5, 0x92, 0x93, 0x4e, 0xd1, 0x5e, 0x22, 0xfa, 0x9d, 0xec, 0x4a, 0x4d, 0xc2, 0x0a, 0x9f } +, + /* Seed */ + 169, + { 0x0e, 0x6a, 0xbb, 0x82, 0x9a, 0x3b, 0x16, 0xd0, 0x8b, 0x0b, 0xd4, 0x3e, 0xb9, 0x5c, 0x79, 0x1a, 0xf2, 0xa3, 0x39, 0x12, 0xea, 0x83, 0x3e, 0xe6, 0x89, 0x3e, 0xd5, 0xad, 0x3e, 0xe7, 0x44, 0xc8, 0xb2, 0xdd, 0x28, 0xfc, 0xee, 0x80, 0x8d, 0x3f, 0x01, 0x49, 0x58, 0x25, 0xbe, 0x0f, 0xe6, 0x37, 0x32, 0x07, 0xa8, 0x78, 0xd4, 0xa5, 0x25, 0xea, 0x72, 0xcf, 0xb0, 0xbb, 0x58, 0xa2, 0x67, 0x76, 0xfb, 0x39, 0xee, 0xbd, 0x33, 0x5f, 0x04, 0xcf, 0x71, 0x86, 0xbe, 0x61, 0xc5, 0x63, 0x5d, 0x95, 0xe5, 0x60, 0xed, 0xdf, 0xd4, 0x5d, 0xd8, 0x6a, 0x4e, 0x67, 0x0d, 0x33, 0x56, 0x8d, 0x83, 0xd2, 0xca, 0x20, 0x3e, 0xd2, 0x8d, 0x90, 0xe4, 0x8b, 0x06, 0x4d, 0x09, 0xa7, 0x5f, 0x82, 0x8d, 0xea, 0xcd, 0x5b, 0x37, 0xef, 0xcf, 0x78, 0x4f, 0xb1, 0x1b, 0x17, 0xd6, 0xd9, 0xf2, 0x31, 0x52, 0x24, 0xf8, 0xe7, 0x63, 0x79, 0x1b, 0xac, 0x6c, 0xf4, 0x6e, 0x1c, 0x23, 0xb0, 0xb0, 0x25, 0x2c, 0x19, 0xed, 0xf0, 0x40, 0xd3, 0x5f, 0x59, 0x25, 0x53,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xe9, 0xdc, 0x4a, 0x63, 0xa0, 0x11, 0xa6, 0x23, 0x32, 0xcf, 0x57, 0x02, 0x62, 0xa0, 0x63, 0x59, 0xcc, 0x36, 0xc0, 0x5a, 0x6f, 0xe1, 0x8a, 0xfb, 0x78, 0x32, 0xb3, 0x2e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.7", + /* Message */ + 45, + { 0xb0, 0xe7, 0x7f, 0x42, 0xc1, 0xa1, 0xe3, 0xf4, 0x15, 0x57, 0x23, 0xa9, 0x0d, 0xb8, 0x8e, 0xb1, 0x53, 0xcb, 0x3d, 0x3a, 0x28, 0xed, 0xdf, 0x25, 0x9c, 0x47, 0x05, 0x6a, 0x47, 0x0c, 0x91, 0x5e, 0xc9, 0x55, 0xf8, 0x31, 0x89, 0xf7, 0x1a, 0xea, 0xcd, 0xd5, 0x5c, 0x33, 0x5f } +, + /* Seed */ + 144, + { 0xfb, 0x36, 0x01, 0x10, 0x5c, 0xaa, 0x9a, 0x2f, 0xdd, 0x6d, 0xd6, 0xc5, 0x74, 0x6f, 0x4f, 0xca, 0xfe, 0xf4, 0x41, 0xbc, 0xb0, 0xfb, 0x8a, 0x2c, 0xc0, 0x3d, 0x0b, 0x57, 0x34, 0x9f, 0x93, 0x21, 0xaf, 0x9d, 0x99, 0x84, 0xe6, 0x4e, 0x2e, 0xc4, 0x85, 0xc9, 0xad, 0x75, 0x5f, 0x14, 0x0c, 0x0b, 0x66, 0xdb, 0x1c, 0xfc, 0x26, 0x69, 0x1c, 0x26, 0x77, 0x31, 0xd1, 0xa3, 0xaf, 0xe6, 0x87, 0x20, 0x2a, 0x96, 0x77, 0xe4, 0x2e, 0x84, 0x4d, 0x47, 0x7b, 0x75, 0xbc, 0xbb, 0x8c, 0x97, 0xd9, 0x9f, 0xcf, 0x72, 0xb3, 0xfb, 0x6d, 0x34, 0x9f, 0xa9, 0xc4, 0x76, 0x61, 0x91, 0x47, 0x21, 0x7a, 0x04, 0xdc, 0x06, 0xaa, 0x3c, 0x3c, 0x17, 0x64, 0x95, 0x38, 0x0c, 0xb9, 0x2c, 0x0a, 0x7e, 0x09, 0x7b, 0x4b, 0x4c, 0x5f, 0xfe, 0x04, 0x63, 0x1a, 0xb1, 0xd1, 0xbf, 0xea, 0x03, 0x67, 0x86, 0x50, 0xc8, 0x5c, 0x17, 0x0f, 0xa4, 0xa1, 0xd6, 0x4a, 0x4c, 0x13, 0x5e, 0x61, 0x48, 0x14, 0x90, 0xb6, 0x2b } +, + /* Encryption */ + 192, + { 0xa4, 0xbd, 0xd4, 0x92, 0xfe, 0xc7, 0x9c, 0x3a, 0x79, 0x09, 0x3a, 0x44, 0x33, 0x42, 0x72, 0xd9, 0xd1, 0x7f, 0x54, 0x3d, 0x02, 0x02, 0xc3, 0x9e, 0x40, 0x8b, 0xfb, 0x39, 0x36, 0x6b, 0xe2, 0xde, 0x61, 0xdf, 0x50, 0xac, 0x45, 0x8c, 0xae, 0xdd, 0xef, 0xfb, 0x69, 0xe2, 0x13, 0xca, 0x92, 0xb7, 0x49, 0x53, 0x66, 0x34, 0x7e, 0xde, 0x73, 0x3f, 0xf3, 0x99, 0xae, 0xc7, 0x96, 0xc3, 0xc3, 0xb1, 0xdf, 0x34, 0x9f, 0x01, 0x1d, 0xa0, 0x1f, 0xee, 0x7d, 0x21, 0xc1, 0xc2, 0x61, 0x84, 0x3d, 0xe8, 0x82, 0x08, 0x56, 0x0c, 0x0e, 0x89, 0x84, 0xb9, 0x52, 0x23, 0xea, 0x37, 0x31, 0xdb, 0x91, 0xc5, 0x93, 0x7a, 0x79, 0xb0, 0xdb, 0x93, 0x87, 0x59, 0x1c, 0xe3, 0x2e, 0xc7, 0xf5, 0x83, 0xe6, 0x00, 0xf5, 0x24, 0x44, 0xdf, 0xa7, 0x67, 0x1c, 0xe8, 0x27, 0x38, 0x98, 0xfb, 0xbc, 0xa3, 0xa4, 0xaa, 0x68, 0x32, 0xcb, 0xb3, 0x54, 0x3a, 0xbe, 0x96, 0x47, 0xe5, 0xf8, 0xc1, 0x37, 0x72, 0x82, 0x52, 0xce, 0x54, 0x40, 0xfc, 0xe1, 0x0e, 0x4d, 0x4e, 0xf7, 0x5d, 0x56, 0xb8, 0x14, 0xd5, 0x19, 0x64, 0x44, 0x41, 0x41, 0x1c, 0x10, 0xa2, 0xa1, 0x4c, 0x35, 0x04, 0x72, 0x82, 0x7c, 0x99, 0xea, 0x3e, 0xe5, 0xfd, 0xa3, 0x88, 0x0f, 0x34, 0x1d, 0xca, 0x8d, 0x3d, 0x3a, 0x4e, 0x5e, 0x05, 0xba, 0x42 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.8", + /* Message */ + 44, + { 0xb8, 0x7f, 0x04, 0xb3, 0x35, 0x0e, 0x12, 0x63, 0xda, 0xa3, 0xf9, 0x40, 0x5e, 0x6f, 0xd3, 0xd2, 0x5d, 0x8e, 0xfa, 0x13, 0x25, 0x56, 0xa4, 0x95, 0x71, 0xf5, 0x70, 0x8a, 0x42, 0x52, 0x7a, 0xf3, 0x1d, 0xb0, 0x1e, 0xdf, 0x79, 0x82, 0x0f, 0x93, 0x26, 0x64, 0x5f, 0xb1 } +, + /* Seed */ + 145, + { 0xec, 0x8d, 0x01, 0x4d, 0x6e, 0xb8, 0xd0, 0x23, 0x9a, 0x97, 0x73, 0xbd, 0xd3, 0x20, 0xbf, 0xb3, 0xf2, 0xee, 0x8f, 0xc2, 0x7d, 0x5f, 0xdd, 0x91, 0xf3, 0xf3, 0x90, 0x5d, 0xc8, 0xa4, 0xc5, 0xff, 0x13, 0x52, 0x9a, 0xee, 0xe4, 0x61, 0x85, 0x4c, 0xcc, 0xd4, 0xe0, 0x9b, 0x62, 0x4a, 0xfa, 0x64, 0x7a, 0x7c, 0x04, 0x81, 0x4e, 0xb1, 0xe5, 0x7b, 0xa1, 0x4d, 0xf4, 0xc7, 0x95, 0xb4, 0x2e, 0x84, 0xc4, 0xd0, 0x86, 0x29, 0x24, 0x5d, 0xac, 0xbb, 0xed, 0x27, 0x39, 0x9a, 0x72, 0x5a, 0x94, 0x8f, 0x3b, 0xa2, 0xf8, 0xb6, 0x4d, 0x26, 0x02, 0xdd, 0x0d, 0x5f, 0x55, 0xcb, 0x23, 0xea, 0xaf, 0xfb, 0x3a, 0x66, 0x50, 0x8e, 0x4a, 0x68, 0x9a, 0xd9, 0xee, 0xe6, 0x44, 0xe6, 0xa2, 0x6d, 0x43, 0x8f, 0x36, 0x63, 0xfe, 0xa9, 0xbd, 0x03, 0x12, 0xbb, 0x0e, 0x7e, 0x5a, 0x6d, 0xee, 0x04, 0xbb, 0xe8, 0xa0, 0x74, 0x5a, 0x73, 0xd5, 0xac, 0x89, 0xfa, 0xa0, 0x96, 0xa5, 0x2e, 0xd3, 0x04, 0x6d, 0x77, 0xde } +, + /* Encryption */ + 192, + { 0x77, 0x5d, 0xc3, 0x24, 0xfe, 0x9d, 0x5e, 0x05, 0xad, 0x01, 0x50, 0x13, 0xd6, 0x5f, 0x0e, 0xba, 0x0d, 0xcd, 0x52, 0xff, 0x9d, 0xfc, 0x17, 0x95, 0xea, 0x93, 0xd0, 0xf4, 0x33, 0x57, 0x98, 0x96, 0x86, 0xfe, 0x3f, 0x8b, 0x04, 0x62, 0x23, 0xbb, 0xa5, 0xc7, 0x84, 0x9a, 0xca, 0xc3, 0x12, 0x35, 0x43, 0x43, 0x26, 0x16, 0xc3, 0x10, 0x3a, 0xc2, 0xba, 0x8d, 0xb0, 0xa1, 0xd2, 0x99, 0x40, 0xbb, 0xa2, 0x62, 0x47, 0x0e, 0x5e, 0x53, 0xbe, 0x60, 0xe0, 0xeb, 0x72, 0x4d, 0x07, 0xcd, 0x91, 0x2a, 0xef, 0xbb, 0x87, 0xfb, 0x51, 0x98, 0x0e, 0x9e, 0x1a, 0xc1, 0x94, 0xda, 0x31, 0x92, 0x95, 0x41, 0xca, 0x43, 0x22, 0x4b, 0x15, 0x2b, 0xe6, 0xf2, 0xdf, 0x6c, 0x5f, 0x04, 0x42, 0xb4, 0xf4, 0xd2, 0xcc, 0x2f, 0xb0, 0x27, 0x39, 0xd4, 0x85, 0xa0, 0x11, 0x62, 0xbc, 0x8d, 0xbb, 0xad, 0x14, 0x76, 0xeb, 0x06, 0xe2, 0x45, 0xab, 0x36, 0xc4, 0xc7, 0x2d, 0x3f, 0x36, 0x07, 0xd0, 0x50, 0x84, 0xa0, 0xf6, 0xb7, 0x2d, 0xc8, 0xba, 0xc3, 0x46, 0xbd, 0x19, 0x09, 0x1b, 0x02, 0xf5, 0x98, 0x2c, 0x91, 0x45, 0x7c, 0x7b, 0x10, 0xf4, 0x47, 0x2b, 0x57, 0x18, 0x45, 0x24, 0x21, 0x4b, 0x23, 0x82, 0x5b, 0x59, 0xf4, 0x34, 0xcc, 0x48, 0xa2, 0xb8, 0x54, 0xca, 0xb5, 0x0f, 0xf7, 0x9e, 0x59, 0x09, 0x1c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.9", + /* Message */ + 33, + { 0xe1, 0x95, 0xa0, 0x36, 0xa5, 0x30, 0xe1, 0xc2, 0xa9, 0xd7, 0xa1, 0x03, 0x35, 0x8d, 0xc2, 0xbd, 0x25, 0xb1, 0x01, 0xbf, 0x70, 0x44, 0x50, 0xab, 0x8e, 0x50, 0x62, 0xcb, 0x63, 0xdf, 0x56, 0x10, 0x35 } +, + /* Seed */ + 156, + { 0x0e, 0xf8, 0x81, 0xde, 0xfc, 0x45, 0xad, 0x3f, 0x3e, 0x58, 0xb1, 0x10, 0x5e, 0x49, 0xb4, 0x23, 0xab, 0x89, 0x12, 0x4a, 0x65, 0xb5, 0x2c, 0xfd, 0x81, 0xcf, 0xd5, 0x42, 0xb9, 0x1e, 0x7c, 0x4c, 0x1a, 0x60, 0x71, 0xa2, 0xcf, 0x12, 0xb4, 0x82, 0x7e, 0xd5, 0xd1, 0x9c, 0xba, 0xf8, 0xfe, 0xea, 0x54, 0xbb, 0x3d, 0x73, 0x85, 0x7e, 0xe8, 0x7c, 0x71, 0x5c, 0x71, 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, 0x0e, 0x31, 0xc2, 0xda, 0xbe, 0x3c, 0x82, 0xa9, 0x54, 0x50, 0x27, 0x27, 0x49, 0xae, 0x2e, 0xbb, 0x89, 0x98, 0x5d, 0x00, 0xb6, 0x3d, 0xed, 0xd9, 0x59, 0x6d, 0x05, 0x16, 0xd1, 0x2a, 0x78, 0xc3, 0x74, 0xb7, 0xed, 0xdc, 0x7d, 0xce, 0xe8, 0xe4, 0xfd, 0xd1, 0x6c, 0x1d, 0xfa, 0xbf, 0xf7, 0xff, 0xd4, 0xc1, 0xfd, 0x61, 0xce, 0x04, 0xbe, 0x8e, 0x49, 0x75, 0xc5, 0xcd, 0x71, 0xe2, 0xcb, 0x0e, 0x54, 0x1b, 0x84, 0x61, 0xbb, 0x81, 0xfb, 0x28, 0xcc, 0xe7, 0x73, 0x65, 0x3e, 0x8b, 0x16, 0xb2, 0x8a, 0x8c, 0x20, 0x74, 0x28, 0x89, 0x5f, 0x28, 0x53, 0x55, 0x87, 0xa5, 0xc9, 0x9d, 0x46, 0xba, 0x4d, 0xf9, 0xae, 0x08, 0x50, 0x18, 0x51, 0x3d, 0x69, 0xab, 0xa3, 0xf6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.10", + /* Message */ + 25, + { 0x04, 0x2a, 0x39, 0x22, 0xaa, 0x87, 0x1e, 0xea, 0x0d, 0x78, 0x42, 0x2c, 0xe7, 0x85, 0x66, 0xab, 0xbb, 0x5b, 0x08, 0xc2, 0xdd, 0xf1, 0xee, 0x30, 0xcf } +, + /* Seed */ + 164, + { 0x5a, 0xe8, 0x51, 0x14, 0xb0, 0x02, 0x7a, 0x23, 0xc7, 0x2b, 0xdb, 0x46, 0xae, 0x7b, 0xb8, 0x87, 0xbe, 0xc5, 0xba, 0xd7, 0xa9, 0x88, 0x4e, 0x93, 0xf6, 0xf4, 0xfd, 0x0b, 0xc9, 0x38, 0xbc, 0x72, 0x41, 0x0c, 0xce, 0x96, 0xa1, 0x4f, 0x4d, 0xe1, 0x99, 0x19, 0x77, 0x35, 0x05, 0x1e, 0xfc, 0xdc, 0xc1, 0x96, 0xf3, 0xad, 0xbf, 0xaa, 0x06, 0x3c, 0xb3, 0xf7, 0xa2, 0x34, 0xc6, 0xcf, 0x99, 0xd7, 0x0f, 0xbb, 0x7e, 0x35, 0xb6, 0xae, 0xc6, 0x64, 0x14, 0x66, 0x93, 0x91, 0xe3, 0xcb, 0xe7, 0x21, 0xec, 0x99, 0x1a, 0x1e, 0x5d, 0xfb, 0xb0, 0x38, 0xf2, 0x70, 0x36, 0x85, 0x93, 0x74, 0x9b, 0x20, 0x8d, 0x08, 0x9a, 0xae, 0xe2, 0xef, 0x35, 0xc3, 0xda, 0xf6, 0x23, 0x8b, 0x5f, 0xe4, 0x2d, 0x13, 0xdd, 0xe4, 0x07, 0xdf, 0x14, 0xf2, 0xd6, 0x18, 0xc9, 0x79, 0xc9, 0x7d, 0x2d, 0xe0, 0x29, 0x33, 0xb5, 0x7f, 0xe8, 0x81, 0x22, 0x04, 0x86, 0x2b, 0x2f, 0x1d, 0xee, 0x98, 0x3f, 0x24, 0xc2, 0xc5, 0x96, 0xea, 0x66, 0x8e, 0x63, 0x7d, 0x0a, 0x6a, 0xe6, 0xdc, 0x52, 0x65, 0x27, 0x69, 0x94, 0xe7, 0xe4, 0xf0, 0x2b, 0x6e } +, + /* Encryption */ + 192, + { 0x12, 0x44, 0xde, 0x88, 0x0e, 0x0f, 0x78, 0x52, 0xe9, 0x96, 0x95, 0x9d, 0x76, 0x2f, 0xca, 0xd9, 0x15, 0x65, 0xa4, 0xd0, 0xad, 0x3b, 0xc5, 0x27, 0x50, 0xd4, 0xa0, 0x44, 0x0f, 0x0b, 0x5c, 0x65, 0x1a, 0xa0, 0xe6, 0xf4, 0x92, 0x06, 0x1b, 0x2c, 0x86, 0x24, 0xc5, 0x2e, 0xde, 0x68, 0x58, 0xfa, 0x25, 0x18, 0xae, 0x8e, 0x8b, 0x11, 0x65, 0x58, 0xb2, 0xc8, 0x07, 0x6c, 0x17, 0xae, 0x78, 0x3d, 0x8d, 0xb2, 0x5f, 0x0d, 0x8f, 0xb1, 0xf2, 0x75, 0x8a, 0x82, 0xab, 0x97, 0x1f, 0xa7, 0x28, 0x3e, 0xf0, 0x74, 0x9a, 0x37, 0xbe, 0x28, 0x93, 0xf8, 0x94, 0x37, 0xfb, 0x8e, 0xa9, 0x00, 0x72, 0xb5, 0x85, 0x5a, 0x26, 0x08, 0xfc, 0x54, 0x2f, 0x5d, 0x2e, 0x0c, 0xb5, 0x43, 0xf4, 0xfa, 0xc5, 0x28, 0xf9, 0x43, 0x52, 0xd0, 0x16, 0x40, 0xfc, 0x2c, 0x53, 0x1b, 0x79, 0x81, 0x0c, 0x00, 0x77, 0x7b, 0xc9, 0xe1, 0x0d, 0xd9, 0xea, 0x99, 0x96, 0xe7, 0x40, 0x87, 0xfa, 0xdc, 0xb7, 0x1a, 0xa1, 0x43, 0x00, 0x67, 0x65, 0x71, 0x61, 0x48, 0x82, 0x94, 0x3f, 0x4a, 0x56, 0x14, 0x12, 0xc0, 0x54, 0x67, 0xdc, 0xa6, 0x6c, 0xa4, 0x9f, 0x82, 0x29, 0x35, 0x18, 0x23, 0xdb, 0x8a, 0x6b, 0x9f, 0x80, 0x3d, 0x70, 0x9c, 0x11, 0x87, 0xed, 0x74, 0x10, 0xcf, 0x91, 0x00, 0x15, 0x59, 0x5c, 0xea, 0xb6, 0x3e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.11", + /* Message */ + 52, + { 0xf3, 0x1d, 0x3d, 0x0c, 0x30, 0xfd, 0x65, 0xd7, 0xb9, 0x8b, 0x70, 0x99, 0x44, 0x78, 0x2e, 0x20, 0x52, 0x5c, 0xa7, 0xc1, 0xf4, 0x2d, 0x5d, 0x03, 0xa0, 0xf6, 0xd2, 0x75, 0x9d, 0xf1, 0x91, 0x9e, 0xea, 0x82, 0xf8, 0x0f, 0x10, 0x00, 0xfd, 0x5c, 0xf8, 0x59, 0xdf, 0x59, 0x87, 0x1b, 0xac, 0x82, 0xdd, 0x90, 0x76, 0xcf } +, + /* Seed */ + 137, + { 0x04, 0x4b, 0xc3, 0x77, 0xe8, 0x58, 0x9f, 0xa5, 0xaf, 0x1c, 0x17, 0x34, 0x7d, 0x50, 0xe0, 0xcb, 0xbf, 0x90, 0x15, 0x76, 0xf2, 0x41, 0xde, 0x69, 0x0c, 0x88, 0x16, 0xc1, 0x29, 0xcd, 0x9f, 0x2f, 0xb0, 0x83, 0x1a, 0x01, 0x7b, 0xec, 0x30, 0xb8, 0x2b, 0x68, 0xf6, 0x98, 0x31, 0x1a, 0xf6, 0xe0, 0x77, 0x72, 0xbc, 0xd8, 0x98, 0xfa, 0x0c, 0x27, 0xf6, 0x2a, 0xfd, 0xe8, 0x95, 0x89, 0x77, 0x84, 0x46, 0x25, 0x55, 0x2d, 0x9b, 0xcb, 0x5a, 0x81, 0xaa, 0x3d, 0x74, 0x15, 0xb2, 0x42, 0xa0, 0x3b, 0x12, 0xfc, 0x1d, 0x3f, 0xe2, 0xd2, 0xce, 0x6e, 0x5f, 0x71, 0xc4, 0xa4, 0xa4, 0xc7, 0xca, 0x83, 0xe0, 0x65, 0x6f, 0x50, 0x02, 0xac, 0x36, 0xd8, 0xd0, 0x2b, 0x69, 0xae, 0x65, 0x73, 0x44, 0x98, 0xf1, 0x31, 0x95, 0x2c, 0xea, 0x48, 0x1f, 0xa2, 0xc2, 0x96, 0x5b, 0x6e, 0xf0, 0x51, 0x7e, 0xde, 0x50, 0xdd, 0xb0, 0x9b, 0x3e, 0xa7, 0x02, 0x6d, 0x06 } +, + /* Encryption */ + 192, + { 0x86, 0xf6, 0x6f, 0x0c, 0x25, 0x05, 0x85, 0x06, 0x59, 0x43, 0xde, 0x2f, 0x71, 0x1f, 0xae, 0x4f, 0xf2, 0x62, 0x70, 0x0e, 0x0d, 0x33, 0x06, 0xa2, 0x4c, 0x94, 0x30, 0xf8, 0x7c, 0xfd, 0x93, 0xde, 0xf4, 0xc3, 0x44, 0x7c, 0xc7, 0x21, 0x0f, 0xd9, 0x4a, 0x14, 0x33, 0x62, 0xf4, 0xf9, 0x45, 0xc6, 0xdb, 0xe2, 0x80, 0xbd, 0xef, 0x5d, 0x14, 0xf7, 0x5e, 0xb7, 0xbb, 0x31, 0x32, 0x0b, 0xcb, 0xd0, 0xd8, 0x8f, 0x0c, 0xcf, 0x2c, 0x95, 0xa7, 0x4c, 0xb4, 0x58, 0xc6, 0x27, 0x2b, 0x58, 0xbf, 0x74, 0x30, 0x93, 0xc4, 0xbb, 0xa2, 0xd7, 0xbe, 0xe9, 0xea, 0x2d, 0xd3, 0x0c, 0xf7, 0x2f, 0xe2, 0x93, 0xc9, 0x0c, 0x97, 0x43, 0x0a, 0x04, 0x7b, 0x17, 0x26, 0x63, 0x91, 0xc5, 0x1f, 0x5c, 0x39, 0x8b, 0xa3, 0xdf, 0x8c, 0xb7, 0x4b, 0xa3, 0xe3, 0x72, 0xf9, 0x55, 0x5c, 0xcc, 0x97, 0xd6, 0xdb, 0x76, 0x14, 0xea, 0x06, 0xd5, 0xc4, 0x8c, 0x1c, 0x60, 0x06, 0x13, 0x3d, 0x0e, 0x9d, 0x69, 0x95, 0x79, 0x93, 0x85, 0x92, 0x0a, 0xd8, 0xaf, 0xc3, 0xde, 0xad, 0xf6, 0x31, 0xce, 0xcc, 0x55, 0x9c, 0xaf, 0xf4, 0x95, 0xb0, 0x8d, 0x68, 0x3f, 0xb2, 0x2a, 0xa6, 0x97, 0xd7, 0x1c, 0x69, 0x6e, 0x46, 0xb1, 0xbf, 0x4f, 0xd7, 0x6b, 0x8d, 0x0b, 0x39, 0xf1, 0x79, 0xbf, 0x66, 0x84, 0x1b, 0xbb, 0x97, 0x07 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.12", + /* Message */ + 29, + { 0x6a, 0x35, 0x55, 0x57, 0x9d, 0xad, 0x03, 0x94, 0x35, 0x43, 0xff, 0x74, 0xe1, 0x74, 0x7c, 0x25, 0x7a, 0x83, 0xd3, 0x52, 0x94, 0xc2, 0x53, 0x93, 0x83, 0xe2, 0x35, 0xde, 0x69 } +, + /* Seed */ + 160, + { 0x5d, 0x92, 0x43, 0x4e, 0xdb, 0xd4, 0xf5, 0xbd, 0x27, 0x19, 0x71, 0x71, 0xf8, 0x53, 0xce, 0xb7, 0x26, 0x30, 0x30, 0x83, 0xad, 0x45, 0x67, 0xa1, 0xd7, 0xc6, 0x10, 0x4d, 0x19, 0x2b, 0x9b, 0xcc, 0xdf, 0xd0, 0xda, 0xed, 0xa2, 0x74, 0xe5, 0xcd, 0xfb, 0x3d, 0x0c, 0x5d, 0x19, 0xc9, 0x68, 0x25, 0x81, 0xec, 0x7a, 0xdc, 0x1a, 0x87, 0xe0, 0x81, 0x51, 0x41, 0x5d, 0x5a, 0x9a, 0xdc, 0x1a, 0xf4, 0x50, 0xb1, 0xba, 0x88, 0xd0, 0xef, 0x32, 0xac, 0x2d, 0x1f, 0x8a, 0xe3, 0x45, 0x95, 0x28, 0x14, 0x75, 0x3a, 0xf3, 0x8e, 0x12, 0x63, 0x5c, 0xff, 0x8c, 0x09, 0x21, 0x59, 0xb4, 0xe7, 0x5d, 0xee, 0xa1, 0x98, 0x3e, 0xd3, 0xd2, 0xd9, 0xec, 0x2f, 0xe7, 0xb9, 0xa2, 0xe1, 0x6a, 0x14, 0x1e, 0x81, 0x8b, 0x84, 0xcd, 0x9b, 0x71, 0xc1, 0x29, 0xa8, 0xb3, 0xc6, 0xdb, 0x62, 0x02, 0x32, 0xdc, 0x03, 0xa2, 0x40, 0x1f, 0x73, 0x1f, 0xf8, 0xa6, 0x3d, 0xa4, 0x58, 0xa7, 0xd8, 0x78, 0x90, 0x56, 0x25, 0xae, 0xe1, 0xfc, 0x09, 0x4d, 0xfb, 0x07, 0xb4, 0x57, 0x5a, 0x7f, 0x0a, 0xad, 0x23, 0x3e, 0x82 } +, + /* Encryption */ + 192, + { 0x93, 0x10, 0x27, 0x2d, 0x12, 0x4b, 0xc5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"PKCS#1 v1.5 Encryption Example 14.13", + /* Message */ + 47, + { 0xcb, 0x79, 0xaf, 0x5a, 0xea, 0xfd, 0xf2, 0xba, 0xd2, 0x1d, 0xfe, 0x62, 0x92, 0x66, 0x42, 0xcb, 0xa8, 0x04, 0xec, 0x7f, 0xd0, 0xea, 0x5d, 0x54, 0x08, 0xac, 0xe9, 0xed, 0xff, 0x28, 0xe7, 0xe8, 0xdf, 0xff, 0x6d, 0xf3, 0x83, 0xaf, 0x14, 0x40, 0x21, 0x46, 0x04, 0x76, 0xc0, 0xc8, 0x2c } +, + /* Seed */ + 142, + { 0x5f, 0xce, 0xa2, 0x57, 0xcf, 0xa9, 0x2c, 0x84, 0xf0, 0xb8, 0x93, 0x7d, 0x17, 0x3f, 0xae, 0xcf, 0x75, 0x03, 0xab, 0x16, 0x2e, 0x0b, 0xae, 0xef, 0x7e, 0x4c, 0x51, 0x1f, 0x3e, 0x32, 0xa3, 0x24, 0xed, 0x40, 0xe2, 0x42, 0xa8, 0x52, 0xba, 0x57, 0x89, 0x5b, 0x7c, 0xfe, 0x4d, 0x61, 0x79, 0x61, 0xe0, 0x36, 0xf6, 0x63, 0xe0, 0x22, 0x8a, 0x29, 0xcd, 0x1a, 0x95, 0xac, 0xac, 0x08, 0xa2, 0x55, 0x26, 0xd1, 0xeb, 0xff, 0x0a, 0xb3, 0xf0, 0x33, 0xed, 0xbf, 0x1a, 0xe2, 0x76, 0xa8, 0xd2, 0x36, 0x73, 0x6c, 0xc7, 0xaf, 0x51, 0xb5, 0xd2, 0xbd, 0xc8, 0x3d, 0xcc, 0x7d, 0x7d, 0x3b, 0xf5, 0xb8, 0x22, 0xaf, 0x2e, 0xff, 0xed, 0x7e, 0xfc, 0xb6, 0x17, 0xe0, 0x83, 0xe5, 0x1b, 0xe9, 0x94, 0xae, 0xd6, 0x56, 0x9b, 0x23, 0x83, 0xb9, 0x41, 0xae, 0xe5, 0x94, 0xc7, 0xb0, 0x12, 0xe6, 0x75, 0x1c, 0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x3e, 0x31, 0xd3, 0xb0, 0xa8, 0x88, 0xa7, 0xb1, 0x4c, 0x78, 0x1d, 0xd8, 0x5b, 0xab, 0x40, 0x86, 0x74, 0xf5, 0xf5, 0x7e, 0x4b, 0x76, 0x3d, 0x84, 0x35 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.14", + /* Message */ + 19, + { 0xd1, 0x62, 0x33, 0xfc, 0x77, 0x5c, 0x31, 0x9f, 0x15, 0x7a, 0xa2, 0x00, 0x47, 0x6c, 0xd6, 0xed, 0x64, 0xa1, 0xea } +, + /* Seed */ + 170, + { 0xbb, 0x33, 0xb2, 0x2b, 0x5f, 0x46, 0x79, 0x4b, 0xe8, 0x3e, 0x6a, 0xff, 0x34, 0xa0, 0xe4, 0x11, 0xd1, 0xf3, 0xf4, 0xb8, 0xda, 0xf9, 0xb5, 0x85, 0x87, 0x24, 0xef, 0xfd, 0xb9, 0x69, 0xc9, 0x55, 0x25, 0xc6, 0x2d, 0xc4, 0x4b, 0xb2, 0xb0, 0x83, 0x38, 0x60, 0x03, 0x05, 0x4b, 0xbd, 0x36, 0x66, 0xb7, 0x82, 0x82, 0x60, 0x6f, 0xe6, 0xea, 0x17, 0x27, 0x31, 0xbe, 0xe1, 0x16, 0x72, 0xd6, 0x01, 0xde, 0x32, 0x42, 0x3d, 0x83, 0xf4, 0x63, 0xcc, 0x29, 0x30, 0xf5, 0xfb, 0x79, 0xda, 0x15, 0x34, 0xc4, 0x15, 0xc9, 0x65, 0x82, 0x75, 0x65, 0x94, 0xa9, 0x99, 0xb2, 0x26, 0x35, 0x42, 0x48, 0xa0, 0x9f, 0x14, 0x1c, 0xae, 0xcf, 0x88, 0x83, 0x90, 0x78, 0xf7, 0x7f, 0x40, 0xbd, 0x48, 0x51, 0x34, 0x9c, 0x1f, 0xc7, 0x5e, 0x1e, 0xce, 0x6f, 0xd6, 0x96, 0x6b, 0xc9, 0xc9, 0xd5, 0xec, 0x12, 0x09, 0x6e, 0xd5, 0x04, 0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 0x69, 0x97, 0xd3, 0x06, 0x3c, 0xc1, 0xa6, 0x9a, 0xdc, 0x19, 0x2a, 0x40, 0xc7, 0x6f, 0x92, 0xd4, 0x7a, 0x05, 0x80, 0xe3, 0xc0, 0x21, 0x20, 0x02, 0x3e, 0xce, 0x70, 0x32, 0x80, 0x7b, 0x7c, 0x09, 0x13, 0x43, 0xaa, 0x87, 0x3f, 0x6a, 0x4d, 0xdd, 0xe4, 0x3f, 0xb2, 0xdc, 0xc3, 0x79, 0xae, 0xee, 0xf6, 0x54 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.15", + /* Message */ + 17, + { 0xd2, 0xf3, 0xc2, 0xe6, 0xf4, 0x3b, 0x0f, 0xc9, 0xfc, 0x22, 0x93, 0xb8, 0x45, 0x88, 0xe6, 0x61, 0x15 } +, + /* Seed */ + 172, + { 0xb9, 0x81, 0x64, 0x89, 0x52, 0x5c, 0xd0, 0x26, 0x15, 0x6f, 0xb4, 0xe8, 0xa4, 0xa8, 0xf3, 0x4a, 0xea, 0x8a, 0x3a, 0xa1, 0xa6, 0x34, 0xcc, 0xcb, 0x32, 0x58, 0x91, 0x8f, 0xe8, 0x5c, 0xb8, 0xd4, 0xaa, 0x02, 0xa5, 0x28, 0x52, 0xa8, 0x94, 0x1d, 0x3e, 0xa6, 0xc0, 0x48, 0xb5, 0x8c, 0xc6, 0xc7, 0x56, 0x85, 0x67, 0x56, 0x25, 0xe5, 0xe4, 0xdd, 0x7d, 0xf9, 0x3b, 0x8a, 0xce, 0xc0, 0x79, 0x67, 0x0b, 0x49, 0xf3, 0xdc, 0x6e, 0x07, 0x63, 0xed, 0x4c, 0x8e, 0x2d, 0x0e, 0xe9, 0xb5, 0xca, 0x5b, 0xb6, 0x2d, 0xe0, 0x06, 0x91, 0x98, 0x38, 0xe4, 0xb6, 0x9b, 0xa1, 0x05, 0xd4, 0xc5, 0xa4, 0xcc, 0x6d, 0xca, 0x67, 0xb1, 0x21, 0x93, 0xa0, 0x32, 0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, 0xb5, 0xbd, 0x0a, 0xad, 0x91, 0xce, 0x62, 0xfb, 0x8c, 0x2b, 0xf5, 0x4b, 0xa6, 0x6f, 0x7e, 0x8d, 0x00, 0x21, 0x92, 0x16, 0x29, 0x20, 0xa4, 0x6e, 0x36, 0xde, 0xa5, 0x66, 0x1f, 0xdd, 0x75, 0x81, 0x53, 0x56, 0x40, 0x74, 0xb8, 0x55, 0x9f, 0x88, 0x93, 0x62, 0x42, 0xfc, 0x09, 0x98, 0x14, 0x8f, 0x19, 0xeb, 0x50, 0xfc, 0x11, 0xfb, 0x24, 0xa7, 0xed, 0x8c, 0x83, 0x49, 0x65, 0x8f, 0xe9, 0xd3, 0x1e, 0x62, 0x74, 0xd4, 0x5d, 0x6f, 0x2b, 0x60, 0x9b, 0xb5, 0xcc, 0xd1, 0x7e, 0x28, 0x4c, 0x99 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.16", + /* Message */ + 50, + { 0x21, 0xee, 0x58, 0x12, 0xe3, 0x24, 0x6d, 0xab, 0x9c, 0x3c, 0x25, 0x9b, 0x21, 0x37, 0xd6, 0x5f, 0x98, 0xa0, 0x5e, 0x57, 0x40, 0x46, 0x5c, 0xa2, 0x2c, 0x69, 0x34, 0x97, 0x00, 0xa4, 0x2c, 0xbe, 0x4f, 0xfb, 0x39, 0x3f, 0xe2, 0x81, 0x99, 0x33, 0x9c, 0x51, 0x03, 0x1c, 0xd3, 0xb2, 0x2f, 0x2f, 0x0a, 0x83 } +, + /* Seed */ + 139, + { 0xe9, 0xde, 0x5b, 0xd3, 0x55, 0xe6, 0xaf, 0xf1, 0x9f, 0xa1, 0x1a, 0x2d, 0x0d, 0x3e, 0xdc, 0x3f, 0x64, 0x69, 0xbd, 0x3c, 0x75, 0x72, 0x06, 0xd6, 0x6b, 0x3f, 0x09, 0x90, 0x8f, 0xf6, 0x18, 0xaf, 0x48, 0x01, 0xac, 0x77, 0xb5, 0x2c, 0xde, 0x03, 0xd4, 0xae, 0x74, 0x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, 0x9f, 0x44, 0xc5, 0x88, 0x69, 0x99, 0x6e, 0xf1, 0x14, 0x69, 0xbc, 0xc1, 0x0b, 0x75, 0x6c, 0x02, 0xd5, 0xc0, 0xe6, 0x18, 0x83, 0x68, 0x5c, 0xc3, 0x7d, 0x75, 0x8d, 0xfd, 0xe4, 0xc9, 0xb7, 0x35, 0x4e, 0x3b, 0x4f, 0x31, 0x6c, 0xa7, 0xf7, 0xfd, 0xe6, 0x59, 0xc3, 0xfd, 0x5e, 0x33, 0x2e, 0x1b, 0x63, 0x92, 0xa2, 0x92, 0x9e, 0x13, 0x17, 0x66, 0xce, 0x9b, 0xa1, 0xd9, 0x71, 0xad, 0x24, 0x6f, 0x3d, 0xf0, 0x22, 0x43, 0x38, 0x63, 0x8b, 0xb6, 0x53, 0x45, 0x8c, 0xd4, 0xb5, 0x26, 0xd9, 0x61, 0x74, 0x4d, 0xaf, 0xec, 0xd5, 0x99, 0x8a, 0xd7, 0x2a, 0xed, 0x3c, 0x34, 0x59, 0x9f, 0x7a, 0x40, 0x98, 0xe3, 0xd2, 0xdf, 0x9d, 0x13, 0xa2, 0x1c, 0xe2, 0x37, 0x0c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.17", + /* Message */ + 56, + { 0xa0, 0x34, 0xa6, 0xc1, 0x66, 0xcf, 0x0b, 0x25, 0xd2, 0xdd, 0xe5, 0x3a, 0xf4, 0xb8, 0x33, 0xb4, 0x78, 0xc6, 0xb0, 0xd2, 0xfb, 0x0c, 0xef, 0x13, 0x7f, 0xbf, 0x5c, 0x27, 0x12, 0x70, 0x64, 0x91, 0x23, 0x7f, 0x7b, 0x28, 0x6d, 0x12, 0x11, 0xd5, 0x73, 0x10, 0xf8, 0xa7, 0x62, 0xb1, 0xb3, 0xbf, 0xe1, 0x9c, 0x9a, 0x4b, 0x16, 0xd3, 0xe0, 0xa8 } +, + /* Seed */ + 133, + { 0xd8, 0x44, 0x17, 0x97, 0x22, 0x87, 0x13, 0x0a, 0x24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8e, 0xcf, 0x12, 0xfd, 0xd3, 0xbe, 0xab, 0xdb, 0x06, 0x15, 0x8a, 0xef, 0x46, 0xc3, 0xfe, 0xd2, 0xd1, 0x83, 0x34, 0x06, 0xec, 0xa7, 0xa6, 0x9e, 0xb2, 0xd2, 0x08, 0xa2, 0xf6, 0xf4, 0x40, 0xd5, 0x4f, 0x6b, 0xe5, 0xdd, 0x56, 0x47, 0x09, 0xed, 0xa8, 0x12, 0xac, 0x06, 0x29, 0xa9, 0x4c, 0x7f, 0x8a, 0xee, 0x78, 0xbe, 0xaf, 0x9e, 0x93, 0x78, 0xc8, 0xdd, 0x9c, 0x62, 0x03, 0x74, 0xbb, 0xac, 0xa3, 0x94, 0x18, 0x59, 0xdd, 0x70, 0x2f, 0x6f, 0x7b, 0x25, 0xa2, 0x38, 0x45, 0x9e, 0xe8, 0x97, 0x59, 0xde, 0x94, 0x22, 0xb5, 0xbb, 0x6d, 0x28, 0x57, 0x16, 0x6c, 0xa2, 0x12, 0x0e, 0x63, 0x47, 0x74, 0xa0, 0xd1, 0xd4, 0x2e, 0xb8, 0xd9, 0x48, 0x15, 0xa1, 0x04, 0x4b, 0xea, 0x8b, 0xfb, 0x02, 0xda, 0x58, 0x62, 0xcd, 0x9a, 0x74, 0x5f, 0x15, 0x92, 0x47, 0x8c, 0x6f, 0x57, 0xbf, 0xd1, 0x3a, 0x5f, 0xdf, 0x4b, 0x8f, 0xaa, 0xe8, 0xa4, 0xbf, 0xc4 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.18", + /* Message */ + 35, + { 0x8f, 0xc6, 0x39, 0x4c, 0xd6, 0xe1, 0x75, 0x33, 0xd1, 0xff, 0x8e, 0xbb, 0xf3, 0xe1, 0xae, 0xae, 0xa3, 0x30, 0xed, 0x9f, 0x5a, 0x6e, 0x1e, 0xfb, 0x83, 0x45, 0x42, 0x94, 0xc6, 0xce, 0x24, 0xf6, 0x90, 0x4a, 0x0e } +, + /* Seed */ + 154, + { 0xbe, 0x1c, 0x18, 0x02, 0xdb, 0x44, 0x68, 0x2e, 0x58, 0xc6, 0x1f, 0xe3, 0x87, 0x57, 0xea, 0x0e, 0x38, 0x4e, 0xba, 0xdd, 0x79, 0x59, 0x48, 0x4b, 0x38, 0xbb, 0x23, 0x57, 0x55, 0xc4, 0x61, 0x77, 0xe6, 0x71, 0x76, 0x9f, 0x36, 0x57, 0x3d, 0x7c, 0xb0, 0xee, 0x7e, 0x82, 0x08, 0x7b, 0x58, 0x4b, 0x58, 0xbb, 0x30, 0x05, 0x30, 0x33, 0x68, 0xc6, 0x59, 0x0a, 0xd9, 0xf2, 0x88, 0x2c, 0xfa, 0x74, 0x0d, 0x51, 0xdc, 0x55, 0xeb, 0x0c, 0x79, 0x0f, 0x5b, 0xb6, 0xb6, 0xa3, 0xbd, 0x71, 0xf8, 0xb2, 0x14, 0x6b, 0xb9, 0xe8, 0x03, 0x4c, 0x35, 0xb7, 0xca, 0xbc, 0xbe, 0x10, 0x93, 0x6f, 0xfc, 0x5f, 0x0a, 0x8d, 0x7b, 0x30, 0x47, 0x6a, 0xb9, 0x16, 0x85, 0xae, 0xd8, 0xfa, 0x95, 0x8e, 0x73, 0xc1, 0xee, 0xa3, 0x04, 0x4c, 0x56, 0xb4, 0xb8, 0x70, 0xda, 0x89, 0x37, 0x1a, 0x93, 0xb8, 0x96, 0x52, 0x79, 0xb5, 0x5b, 0xb9, 0x2c, 0xc3, 0x16, 0xc2, 0x3e, 0xf0, 0x97, 0x53, 0x51, 0xc7, 0x49, 0x81, 0x7d, 0xb5, 0xdc, 0xd8, 0x6b, 0x94, 0xad, 0xf6, 0x03, 0xbd } +, + /* Encryption */ + 192, + { 0xb8, 0x3c, 0x71, 0x8c, 0xe5, 0xc6, 0xab, 0x1e, 0x40, 0xff, 0xa5, 0x67, 0x0a, 0xc1, 0x66, 0x66, 0x4d, 0x3a, 0x68, 0x33, 0xcb, 0x3b, 0xde, 0xf4, 0x62, 0x79, 0x4a, 0x25, 0xd5, 0x3e, 0x17, 0x04, 0x60, 0x06, 0x85, 0x8e, 0x63, 0xf8, 0x8a, 0xb9, 0x5d, 0x04, 0xf4, 0xfb, 0x67, 0x74, 0xf7, 0x00, 0x5d, 0xbb, 0x2e, 0x22, 0xd5, 0x19, 0x36, 0x0d, 0x5e, 0x13, 0x38, 0xad, 0x15, 0x30, 0x8f, 0x6c, 0x64, 0x12, 0x54, 0x95, 0x67, 0x00, 0x7e, 0x02, 0x1c, 0xb2, 0x37, 0xed, 0x4a, 0xf5, 0xee, 0xf3, 0xbc, 0xf9, 0xb7, 0x31, 0x59, 0x9f, 0x72, 0x53, 0xce, 0xba, 0x83, 0x04, 0xf4, 0xee, 0x8c, 0x34, 0x33, 0x39, 0xd0, 0xa0, 0x64, 0xeb, 0x77, 0xf1, 0xe9, 0x3f, 0xd1, 0xcc, 0x7b, 0xa5, 0xfc, 0x3b, 0xb8, 0x18, 0x4c, 0xed, 0x0e, 0x86, 0x97, 0xac, 0x47, 0xb7, 0x46, 0x20, 0xc4, 0x94, 0xea, 0xb5, 0x86, 0xed, 0x9f, 0xe7, 0x6e, 0x07, 0xe4, 0xbd, 0x2a, 0x2d, 0x1b, 0x95, 0x59, 0x5b, 0x69, 0xc6, 0x46, 0x77, 0xa8, 0x83, 0x5d, 0x56, 0xac, 0x63, 0x9d, 0xf8, 0xf6, 0x43, 0x24, 0x1b, 0x3e, 0x2c, 0x46, 0x88, 0xd2, 0xad, 0xf2, 0x28, 0xde, 0x2d, 0xa9, 0xbb, 0x0a, 0x36, 0x34, 0x38, 0xe7, 0x51, 0xb5, 0x25, 0x0d, 0xea, 0xe3, 0x05, 0xa3, 0x90, 0x5e, 0x7e, 0x07, 0x7a, 0x4e, 0x8c, 0x74, 0x66 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.19", + /* Message */ + 33, + { 0x89, 0xa1, 0x2d, 0x22, 0xbf, 0x87, 0x7d, 0x44, 0x0a, 0x2e, 0x03, 0xae, 0xa9, 0x32, 0xeb,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a, 0x1d, 0x5f, 0x21, 0x6b, 0x8e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 14.20", + /* Message */ + 54, + { 0x09, 0xd6, 0x94, 0x8c, 0xe1, 0xc1, 0xf2, 0x4c, 0x6d, 0x52, 0x9c, 0xbc, 0x5d, 0x6d, 0x6c, 0x1b, 0xea, 0xab, 0x56, 0x95, 0xb3, 0x0c, 0xaa, 0xb7, 0x44, 0x96, 0x9b, 0xf7, 0xf9, 0xdb, 0xd2, 0x83, 0x33, 0x5e, 0x98, 0xa9, 0xbc, 0xd6, 0x5d, 0xad, 0x2b, 0x4f, 0x0e, 0x3c, 0xec, 0x89, 0x0b, 0x05, 0xe6, 0x7f, 0xe9, 0x78, 0x23, 0xd4 } +, + /* Seed */ + 135, + { 0xed, 0xed, 0x62, 0xa6, 0x50, 0xf7, 0xde, 0x3b, 0x12, 0x80, 0x22, 0x9d, 0x5f, 0xb1, 0xc4, 0x40, 0x8e, 0x82, 0xdf, 0xe0, 0x31, 0x7e, 0x64, 0x30, 0xfc, 0xf4, 0x71, 0xb1, 0xe2, 0x8d, 0xa8, 0xcf, 0x6b, 0x4b, 0xf4, 0xc5, 0xd0, 0x31, 0xe3, 0xee, 0x68, 0x8b, 0x64, 0x07, 0x72, 0xaa, 0x50, 0x08, 0xe5, 0x86, 0x3c, 0x70, 0x7a, 0x40, 0x22, 0xc3, 0x29, 0xa6, 0x66, 0x4e, 0x71, 0x10, 0x12, 0x06, 0xb5, 0x4d, 0xb5, 0x40, 0x6e, 0x7f, 0xa9, 0xc8, 0x22, 0x6f, 0x42, 0x93, 0x11, 0x19, 0x62, 0x0c, 0xa3, 0x0d, 0xe7, 0xd0, 0x3b, 0xe1, 0x43, 0x94, 0x0c, 0xbb, 0x4d, 0x1a, 0x9c, 0x86, 0xe9, 0x86, 0x3c, 0x98, 0x7b, 0xff, 0x07, 0x02, 0x3d, 0xe1, 0x98, 0x64, 0xf7, 0x33, 0xda, 0x0c, 0x89, 0xbd, 0x03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, 0xcb, 0x9c, 0x0e, 0x53, 0xf0, 0xd9, 0x1b, 0x01, 0xce, 0xc0, 0xf0, 0xef, 0x9d, 0xfe, 0x3f, 0x2b, 0x30, 0x65, 0xbd, 0x55, 0xb7, 0x2f, 0xb1, 0x70, 0x60, 0xab, 0xe8, 0x83, 0x0a, 0xca, 0x00, 0x44, 0x64, 0xfe, 0x7d } + +} +, +} +}, +{ + "Example 15: A 2048-bit RSA key pair", +{ + /* Modulus */ + 256, + { 0xdc, 0xfa, 0x10, 0xff, 0xa7, 0x46, 0x65, 0xae, 0xef, 0x87, 0x09, 0x74, 0xea, 0x99, 0xb2, 0xce, 0x54, 0x54, 0x7c, 0x67, 0xf4, 0x2a, 0xaa, 0x6d, 0xd0, 0x1a, 0x2e, 0xd3, 0x1f, 0xd2, 0xc2, 0x42, 0xaf, 0x5d, 0x96, 0x0b, 0x1f, 0x89, 0x6e, 0xfb, 0xa3, 0x54, 0x3d, 0x65, 0x54, 0xb7, 0xb1, 0x26, 0x87, 0xa5, 0xc6, 0x88, 0x56, 0x8f, 0x32, 0xe0, 0x26, 0xc5, 0x32, 0xd2, 0x59, 0x93, 0xb9, 0x7a, 0x7c, 0x28, 0x42, 0xec, 0x2b, 0x8e, 0x12, 0x35, 0xee, 0xe2, 0x41, 0x4d, 0x25, 0x80, 0x6c, 0x6f, 0xba, 0xe4, 0x38, 0x95, 0x4e, 0xba, 0x9d, 0x27, 0x55, 0xdf, 0xfe, 0xeb, 0x1b, 0x47, 0x70, 0x09, 0x57, 0x81, 0x5a, 0x8a, 0x23, 0x3f, 0x97, 0xb1, 0xa2, 0xc7, 0x14, 0xb3, 0xe2, 0xbe, 0x2e, 0x42, 0xd8, 0xbe, 0x30, 0xb1, 0x96, 0x15, 0x82, 0xea, 0x99, 0x48, 0x91, 0x0e, 0x0c, 0x79, 0x7c, 0x50, 0xfc, 0x4b, 0xb4, 0x55, 0xf0, 0xfc, 0x45, 0xe5, 0xe3, 0x4e, 0x63, 0x96, 0xac, 0x5b, 0x2d, 0x46, 0x23, 0x93, 0x65, 0xc7, 0xf3, 0xda, 0xaf, 0x09, 0x09, 0x40, 0x0d, 0x61, 0xcf, 0x9e, 0x0c, 0xa8, 0x08, 0x3e, 0xaf, 0x33, 0x5a, 0x6f, 0xce, 0xb6, 0x86, 0x3c, 0x1c, 0xc0, 0xcf, 0x5a, 0x17, 0x1a, 0xff, 0x35, 0xd9, 0x7e, 0xcb, 0x60, 0xef, 0x25, 0x1c, 0x7e, 0xc2, 0xc8, 0xa5, 0x88, 0x36, 0x1d, 0xc4, 0x12, 0x66, 0xa4, 0xb7, 0xed, 0x38, 0xb0, 0x26, 0xce, 0x0d, 0x53, 0x78, 0x64, 0x49, 0xdb, 0xb1, 0x1a, 0x06, 0xea, 0x33, 0xcc, 0xf1, 0xec, 0xa5, 0x75, 0x20, 0x1e, 0xd1, 0xaa, 0x47, 0x3e, 0xd1, 0x18, 0x7e, 0xc1, 0xd8, 0xa7, 0x44, 0xea, 0x34, 0x5b, 0xed, 0x7e, 0xa0, 0x0e, 0xe4, 0xe8, 0x1b, 0xba, 0x46, 0x48, 0x60, 0x1d, 0xd5, 0x37, 0xdc, 0x91, 0x01, 0x5d, 0x31, 0xf0, 0xc2, 0xc1 } +, + /* Public exponent */ + 3, + { 0x01, 0x00, 0x01 } +, + /* Exponent */ + 256, + { 0x21, 0x95, 0x08, 0x51, 0xcd, 0xf2, 0x53, 0x20, 0x31, 0x8b, 0x30, 0x5a, 0xfa, 0x0f, 0x37, 0x1f, 0x07, 0xae, 0x5a, 0x44, 0xb3, 0x14, 0xeb, 0xd7, 0x29, 0xf5, 0xdc, 0xb1, 0x5d, 0xa7, 0xfa, 0x39, 0x47, 0xac, 0xdd, 0x91, 0x5d, 0xae, 0xd5, 0x74, 0xbd, 0x16, 0xdf, 0x88, 0xbf, 0x85, 0xf6, 0x10, 0x60, 0xb3, 0x87, 0x17, 0x2f, 0xae, 0x6e, 0x01, 0x26, 0x2b, 0x38, 0x64, 0xc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 0x94, 0x14, 0xeb, 0xf7, 0x20, 0x30, 0x00, 0xa1, 0x9f, 0xc0, 0x42, 0x48, 0x75 } +, + /* Prime 1 */ + 128, + { 0xf1, 0x23, 0xbf, 0xe5, 0x3d, 0xe9, 0x7a, 0x56, 0x9d, 0x91, 0xad, 0xcf, 0x55, 0x6f, 0xa6, 0x25, 0xad, 0x30, 0xf3, 0xfd, 0x3d, 0x81, 0x1f, 0x9e, 0x91, 0xe6, 0xaf, 0x44, 0xb6, 0xe7, 0x80, 0xcb, 0x0f, 0x32, 0x78, 0x29, 0xfb, 0x21, 0x19, 0x0a, 0xe2, 0x80, 0x66, 0x46, 0xd7, 0x28, 0xcd, 0x9b, 0x65, 0x31, 0x13, 0x2b, 0x1e, 0xbf, 0xef, 0x12, 0x72, 0x99, 0x30, 0x60, 0xf1, 0xce, 0x70, 0xb1, 0x24, 0x39, 0x30, 0x91, 0xee, 0x85, 0x93, 0xb7, 0x27, 0x36, 0x7e, 0xdb, 0xba, 0x00, 0x9e, 0xc5, 0xbe, 0x17, 0xc4, 0xac, 0xee, 0x12, 0x0c, 0x84, 0x12, 0x67, 0xd4, 0x76, 0x31, 0xa1, 0x6c, 0x36, 0xa6, 0xd1, 0xc9, 0x99, 0x73, 0xc1, 0xb0, 0xb5, 0xa8, 0x35, 0xbf, 0x39, 0xfe, 0xaf, 0xe8, 0xf6, 0x42, 0x1f, 0xd9, 0xc2, 0xa9, 0x0b, 0xc2, 0x79, 0x76, 0x65, 0x9e, 0x67, 0xbc, 0x83, 0x12, 0x4d } +, + /* Prime 2 */ + 128, + { 0xea, 0x98, 0x39, 0xb7, 0xe3, 0x7e, 0xa8, 0x9b, 0xbd, 0xa2, 0x7e, 0x4c, 0x93, 0x47, 0x1c, 0xb4, 0xfd, 0x92, 0x18, 0x9a, 0x0a, 0x96, 0xbc, 0xb4, 0xd7, 0x56, 0x93, 0xf1, 0x8a, 0x5c, 0x2f, 0x74, 0x2a, 0xf9, 0xe3, 0x6f, 0xde, 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, 0x60, 0x49, 0x7c, 0xc2, 0x76, 0x0a, 0xc0, 0xf2, 0xad, 0x4a, 0x2f, 0xcd, 0x0e, 0x84, 0xd7, 0xa1, 0xd9, 0x4d, 0xfd, 0xd2, 0x65, 0x8f, 0xd9, 0xce, 0x18, 0x47, 0x5c, 0x1f, 0xa7, 0x5e, 0xe0, 0xce, 0xba, 0xd0, 0xcf, 0x0a, 0xc0, 0x4d } +, + /* Prime exponent 2 */ + 128, + { 0x52, 0x81, 0x71, 0x23, 0x3c, 0x4e, 0x4a, 0x6c, 0x63, 0xb8, 0x67, 0x64, 0xf5, 0x13, 0x38, 0x84, 0x6a, 0xfd, 0xdb, 0xcb, 0x29, 0x58, 0x34, 0x4c, 0x01, 0xc4, 0x00, 0x4a, 0x1d, 0xd8, 0x28, 0x14, 0x5a, 0x1d, 0x02, 0xa1, 0x50, 0x7d, 0xef, 0x4f, 0x58, 0x24, 0x7a, 0x64, 0xfc, 0x10, 0xc0, 0xa2, 0x88, 0xc1, 0xae, 0x89, 0x57, 0x21, 0xd7, 0x8b, 0x8f, 0x04, 0x4d, 0xb7, 0xc0, 0x0d, 0x86, 0xda, 0x55, 0xa9, 0xb6, 0x54, 0x29, 0x2e, 0xcd, 0x76, 0x82, 0x70, 0xbe, 0x69, 0xe4, 0xbd, 0x59, 0x22, 0xd4, 0xef, 0xfd, 0x1f, 0x70, 0x95, 0x5f, 0x96, 0x27, 0xe3, 0xe1, 0x9b, 0x74, 0x9e, 0x93, 0xb4, 0x0e, 0xf3, 0xdd, 0x1d, 0x61, 0xd9, 0x39, 0x15, 0xe2, 0xb0, 0x9d, 0x93, 0x0b, 0x4b, 0x17, 0x68, 0xbf, 0xac, 0xc0, 0x13, 0x6f, 0x39, 0xb0, 0xcf, 0xdf, 0xb4, 0xd0, 0x50, 0x01, 0x1e, 0x2e, 0x65 } +, + /* Coefficient */ + 128, + { 0xdf, 0x2e, 0xb2, 0x32, 0x2c, 0xc2, 0xda, 0xab, 0xf4, 0xd1, 0x46, 0x55, 0x08, 0xf4, 0x15, 0x21, 0xcd, 0xa7, 0xce, 0xff, 0x23, 0xeb, 0xe6, 0x1d, 0x00, 0xd4, 0x41, 0xee, 0x72, 0x8d, 0xda, 0x5d, 0x16, 0xc7, 0xbf, 0x92, 0x0c, 0xd9, 0x5f, 0x34, 0xbe, 0xb4, 0xfe, 0x32, 0xee, 0x81, 0x7e, 0xf3, 0x36, 0x2e, 0x0b, 0xcd, 0x1d, 0x12, 0x45, 0xf7, 0xb0, 0x77, 0x93, 0xea, 0xa1, 0x90, 0xdc, 0x5a, 0x37, 0xfd, 0xaf, 0x4c, 0x68, 0xe2, 0xca, 0x13, 0x97, 0x2d, 0x7f, 0x51, 0x48, 0xb7, 0x96, 0xb6, 0xfb, 0x6d, 0x7a, 0xdd, 0xa0, 0x7b, 0xd2, 0xcd, 0x13, 0xbe, 0x98, 0xce, 0xbe, 0xd1, 0xed, 0xc6, 0xca, 0x41, 0x2e, 0x39, 0x53, 0x50, 0xc5, 0x9a, 0x1d, 0x84, 0x2b, 0xc4, 0xaa, 0x2f, 0x3c, 0x0b, 0x24, 0x3f, 0xde, 0x7d, 0xfd, 0x95, 0x35, 0x6f, 0x24, 0x39, 0x25, 0x1a, 0x11, 0x72, 0xc4, 0x5e } + +} +, +{{ + "PKCS#1 v1.5 Encryption Example 15.1", + /* Message */ + 19, + { 0x2a, 0xac, 0xec, 0x86, 0xf4, 0x23, 0xdd, 0x92, 0x5e, 0xc1, 0x58, 0x82, 0x2a, 0x74, 0x8c, 0xbe, 0x6c, 0x31, 0xa0 } +, + /* Seed */ + 234, + { 0xcc, 0x4b, 0x87, 0xf6, 0x74, 0x49, 0x7b, 0xb0, 0xe3, 0x3d, 0x9e, 0x2a, 0x4a, 0x80, 0x70, 0xb7, 0xd7, 0x8b, 0x5f, 0xd2, 0xc4, 0xb4, 0xf6, 0xeb, 0xac, 0xcd, 0x4e, 0xe5, 0x05, 0xb7, 0x1f, 0xca, 0xfe, 0x21, 0x56,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, 0x4b, 0xa1, 0xb5, 0x94, 0x6b, 0xda, 0x0b, 0xd3, 0x13, 0xfa, 0xec, 0x4c, 0x99, 0x3e, 0xd2, 0x74, 0x8e, 0xed, 0x8c, 0xce, 0x4b, 0xdb, 0x52, 0x0b, 0xa7, 0xdb, 0x16, 0x5f, 0x9f, 0xe5, 0x6a, 0xa8, 0x45, 0x4d, 0x6f, 0xf3, 0x38, 0x74, 0xfe, 0xee, 0xbf, 0x29, 0xde, 0x2d, 0xf5, 0xb7, 0xf0, 0x0a, 0xa1, 0xd9, 0xfb, 0x07, 0x3f, 0xc4, 0x06, 0x7b, 0x58, 0xdc, 0x50, 0x62, 0x4e, 0x12, 0x7f, 0x71, 0x1d, 0xde, 0x2c, 0xc2, 0xcf, 0xda, 0xb4, 0x91, 0x9c, 0xcf, 0x28, 0xc8, 0x36, 0x60, 0xdf, 0xc2, 0x27, 0xb0, 0xf5, 0x00, 0xec, 0x1f, 0x90, 0x4f } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.2", + /* Message */ + 21, + { 0x5c, 0x8b, 0xf2, 0xac, 0xab, 0x08, 0xbf, 0xfe, 0xfa, 0x64, 0x80, 0x95, 0x2b, 0x24, 0xda, 0xa5, 0x01, 0x9d, 0x12, 0x5f, 0xee } +, + /* Seed */ + 232, + { 0x5e, 0x16, 0x30, 0x70, 0xef, 0xdd, 0xb7, 0x9f, 0x47, 0x64, 0xf8, 0xa8, 0x1d, 0x44, 0x46, 0x0b, 0x5c, 0x40, 0x0b, 0xec, 0x70, 0x37, 0x52, 0x29, 0x20, 0xf7, 0x72, 0x95, 0x9f, 0xd4, 0xcf, 0x3a, 0xef, 0x2f, 0x14, 0x45, 0x4d, 0xcd, 0x9e, 0x86, 0x25, 0x12, 0xca, 0x69, 0xdb, 0x83, 0x68, 0xa4, 0xcd, 0x8d, 0x1a, 0x44, 0xda, 0x59, 0x5d, 0x6b, 0x43, 0x93, 0x91, 0xc9, 0x31, 0x46, 0xb1, 0x23, 0x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f, 0x48, 0x7c, 0x1a, 0xad, 0xb0, 0x19, 0x15, 0xce, 0xdd, 0xe8, 0xcd, 0x9f, 0xb8, 0x4e, 0xfd, 0x98, 0x1a, 0xc9, 0x8c, 0xd5, 0x7a, 0x82, 0x56, 0xd4, 0xe9, 0xe2, 0xd0, 0x86, 0x2d, 0xab, 0x04, 0x54, 0xd3, 0xff, 0x4f, 0xb9, 0x85, 0x26, 0x4a, 0x46, 0x99, 0x5a, 0xb0, 0x68, 0xa7, 0x4e, 0xdc, 0x7e, 0xd8, 0xae, 0xff, 0x5f, 0xa3, 0x0f, 0x3a, 0x7d, 0x75, 0x94 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.3", + /* Message */ + 13, + { 0xe2, 0x00, 0x4b, 0x31, 0x07, 0x39, 0x98, 0x2c, 0xfa, 0x9e, 0x95, 0x45, 0x3a } +, + /* Seed */ + 240, + { 0xe9, 0x3e, 0x64, 0x12, 0x33, 0x7a, 0xb7, 0xb0, 0xf1, 0xb5, 0x69, 0x80, 0x1a, 0x3c, 0x16, 0x4a, 0x6f, 0x23, 0xe3, 0xc2, 0x7c, 0x7c, 0x55, 0xa8, 0xc5, 0xac, 0x9e, 0xaf, 0x31, 0x88, 0x55, 0xf8, 0x32, 0x8b, 0x5d, 0x7a, 0xb4, 0xcb, 0x86, 0x19, 0xa0, 0x0e, 0x99, 0x41, 0xcc, 0xaa, 0x94, 0x85, 0x70, 0x52, 0x71, 0x82, 0x61, 0x74, 0x43, 0xc1, 0xd2, 0x1e, 0x4a, 0x6e, 0x21, 0xb3, 0xf6, 0xd4, 0xf6, 0x98, 0xa6, 0x1a, 0xe0, 0x29, 0x17, 0x2c, 0xf4, 0xda, 0x03, 0x9d, 0x91, 0x58, 0x5a, 0x87, 0xda, 0xd1, 0x28, 0xc2, 0xfa, 0xc5, 0x53, 0x1b, 0x2f, 0x45, 0xdc, 0xef, 0x9b, 0x9f, 0xc3, 0x31, 0xc8, 0x04, 0x48, 0x85, 0x28, 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 0xb8, 0x92, 0xf0, 0x16, 0x7b, 0x23, 0xbe, 0x33, 0x62, 0xfa, 0xce, 0x80, 0x8d, 0x6a, 0x5e, 0xb8, 0x96, 0x19, 0x44, 0x08, 0xdb, 0x7c, 0x01, 0x63, 0x9c, 0x58, 0x62, 0x30, 0x4c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.4", + /* Message */ + 53, + { 0xdb, 0x6a, 0xf1, 0x29, 0x23, 0x05, 0x27, 0x8c, 0x5b, 0x33, 0x83, 0xf8, 0xa4, 0x1d, 0x6c, 0x83, 0x52, 0x21, 0x14, 0xc9, 0x88, 0x85, 0x50, 0x74, 0x06, 0x5b, 0x23, 0xf9, 0xfe, 0xae, 0x8e, 0xa4, 0x31, 0xfd, 0x5d, 0xa3, 0x6f, 0x9b, 0xab, 0xf9, 0xdc, 0x61, 0xdf, 0x2e, 0x39, 0x23, 0x47, 0x83, 0x04, 0x73, 0x38, 0xec, 0x4f } +, + /* Seed */ + 200, + { 0xcb, 0x85, 0x1f, 0xb2, 0x76, 0xa7, 0x49, 0x1c, 0xd3, 0xef, 0xe4, 0xd3, 0x39, 0x50, 0x16, 0xc1, 0xec, 0x2b, 0x15, 0x09, 0x4a, 0x1e, 0xc6, 0xd9, 0x30, 0xd4, 0xca, 0x21, 0xb4, 0x20, 0xf8, 0x47, 0xff, 0x68, 0x68, 0xf0, 0x14, 0xd2, 0x09, 0xff, 0x80, 0x7e, 0x8b, 0x1f, 0x71, 0x67, 0x0b, 0x32, 0x50, 0x94, 0xc0, 0xf6, 0xe3, 0x2f, 0x84, 0xf7, 0x68, 0x22, 0x22, 0x02, 0xb2, 0x1b, 0xe3, 0x6a, 0x28, 0x6b, 0x30, 0xe0, 0x82, 0xef, 0x3b, 0xba, 0x64, 0x7c, 0xeb, 0xee, 0xaf, 0xe3, 0x10, 0x69, 0x44, 0x18, 0xd7, 0x0a, 0x67, 0x9e, 0xb2, 0x01, 0x07, 0x80, 0xdd, 0x0e, 0x96, 0x55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5 Encryption Example 15.5", + /* Message */ + 11, + { 0xe7, 0x99, 0xe4, 0xeb, 0xc8, 0x69, 0x31, 0x9e, 0xe2, 0x25, 0x80 } +, + /* Seed */ + 242, + { 0x3a, 0x07, 0x57, 0xcb, 0x49, 0xa3, 0xfe, 0x6a, 0xe8, 0x0d, 0x37, 0x42, 0x06, 0x8b, 0x5c, 0x80, 0x68, 0xb8, 0xc5, 0x88, 0x54, 0x20, 0x01, 0x10, 0x93, 0xc2, 0x20, 0x99, 0xed, 0xaa, 0xdb, 0x49, 0x1f, 0x22, 0x6f, 0x85, 0x60, 0x66, 0x16, 0x3a, 0xb5, 0x10, 0x5e, 0x78, 0x79, 0xc7, 0x49, 0x1c, 0x18, 0x35, 0x98, 0x5d, 0xc4, 0x94, 0x21, 0x0e, 0xf7, 0x8b, 0xad, 0x48, 0x16, 0xd9, 0xb6, 0x94, 0xc9, 0xc8, 0xbe, 0x46, 0x6a, 0x4d, 0x17, 0x8a, 0x7d, 0xde, 0xcb, 0xce, 0x53, 0x65, 0x40, 0x0d, 0x68, 0x21, 0xb6, 0xe9, 0xae, 0x0e, 0x03, 0xbb, 0x69, 0xad, 0xc4, 0xec, 0x73, 0x4a, 0xfd, 0xcd, 0xea, 0x6d, 0xc0, 0xc4, 0x85, 0x96, 0xc4, 0x8b, 0x27, 0x35, 0xef, 0x70, 0xf3, 0x73, 0x4c, 0x18, 0x6d, 0x03, 0x18, 0x37, 0x8d, 0x2b, 0xf8, 0x09, 0x96, 0x88, 0x67, 0x2f, 0xa3, 0x85, 0x91, 0xda, 0x4a, 0xe6, 0xfc, 0x11, 0x2b, 0x72, 0x7e, 0xc8, 0x19, 0x84, 0xdf, 0x7b, 0x56, 0xc9, 0x84, 0x4e, 0x25, 0xb0, 0xfc, 0xd8, 0x1d, 0x2b, 0xe7, 0xd1, 0x8d, 0x01, 0x64, 0x6a, 0x6d, 0x9f, 0xe2, 0x25, 0xd3, 0x69, 0x7c, 0x34, 0xed, 0x2e, 0x33, 0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fb, 0x09, 0xf4, 0xe3, 0x13, 0x07, 0x49, 0x12, 0xaf, 0x0c, 0xb7, 0x41, 0x5f, 0xb2, 0x15, 0xeb, 0x97, 0xfa, 0xeb, 0xbe, 0xf1, 0xa4, 0x47, 0x23, 0x9a, 0x91, 0xdb, 0x4a, 0x34, 0xfc, 0xa4, 0xd8, 0x43, 0x46, 0x25, 0x9e, 0xe0, 0xa1, 0xda, 0xdd, 0x10, 0xb7, 0xf0, 0x1f, 0xc8, 0xc5, 0x3e, 0x42, 0x0f, 0x88, 0xcd, 0xfa, 0x0c, 0xbc, 0xf6, 0x2b, 0xe4, 0x4b, 0x8a, 0x79, 0x40, 0x86, 0x4f, 0xf8, 0x13, 0x7e, 0xdb, 0x12, 0x2a, 0xc2, 0xda, 0xe5, 0x41, 0x0a, 0x47, 0xcf, 0x07, 0x62, 0xe2, 0x0f, 0x20, 0x86, 0xcb, 0xf6, 0x6f, 0xf4, 0xd1, 0xa9, 0xf7, 0x27, 0x0f, 0x00, 0x9c, 0xb2, 0xe0, 0x7d, 0x90, 0x20, 0xb4, 0x8a, 0x76, 0xd2, 0x41, 0x08, 0xe9, 0x98, 0x9b, 0xf9, 0x04, 0xe4, 0xa7, 0x1d, 0xdb, 0x91, 0x74, 0x0a, 0xd7, 0xe5, 0xd1, 0xb6, 0x8e, 0xc6, 0x4e, 0x3e, 0x66, 0xcd, 0x0e, 0x89, 0x7d, 0xcc, 0x66, 0x57, 0x39, 0xeb, 0xac, 0x45, 0x19, 0x93, 0xf0, 0x2c, 0xc5, 0xbf, 0xc6, 0x3a, 0x60, 0x2f, 0x55, 0x83, 0x81, 0xda } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.6", + /* Message */ + 55, + { 0x09, 0x97, 0x12, 0xb8, 0x26, 0xba, 0x67, 0xcf, 0x92, 0x92, 0x25, 0xbd, 0x61, 0x2e, 0xc0, 0x65, 0xd4, 0x51, 0xed, 0xe2, 0x31, 0xc8, 0xd5, 0xc2, 0x04, 0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 0x85, 0x5c, 0x0b, 0x22, 0xb4, 0x46, 0xfe, 0x1e, 0xc5, 0xf1, 0x11, 0x2c, 0x5a, 0x7f, 0xc2, 0x85, 0xef, 0xdc, 0x84, 0x20, 0xec, 0x01, 0xa3, 0xa7, 0xc3, 0x3f, 0x73, 0x5b, 0x45, 0x55, 0x09, 0x2a, 0x9e, 0x8d, 0xe1, 0x6f, 0x3f, 0x7d, 0x46, 0x9f, 0x88, 0xcd, 0x75, 0xc0, 0x1c, 0x7f, 0x2e, 0x7d, 0x54, 0x6a, 0x1b, 0x9e, 0x7f, 0x49, 0x84, 0xfa, 0x29, 0xa2, 0xcc, 0x80, 0xd3, 0x10, 0xf9, 0xd7, 0x81, 0x8d, 0xf6, 0xd9, 0xad, 0x6c, 0xc2, 0x05, 0x37, 0x4d, 0x52, 0xe8, 0xe1, 0x73, 0x90, 0xbd, 0xe7, 0x2f, 0x25, 0xb7, 0x12, 0xa4, 0x26, 0x9f, 0x23, 0xae, 0xb2, 0x41, 0xa6, 0x66, 0xe9, 0x64, 0x96, 0xcd, 0x84, 0xb8, 0x33, 0xfb, 0x53, 0xd0, 0x57, 0x1f, 0x7a, 0xc2, 0xd1, 0x96, 0x4b, 0x8f, 0x2a, 0x7e, 0x13, 0x33, 0x6d, 0x9a, 0x7e, 0x03, 0x04, 0x1d, 0xcf, 0xcb } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.7", + /* Message */ + 41, + { 0x5f, 0x2a, 0x5c, 0x7f, 0x93, 0xe7, 0x14, 0xee, 0xca, 0xb3, 0xa5, 0x5a, 0x69, 0xc7, 0x9a, 0x3c, 0xbc, 0x15, 0xbd, 0x19, 0xdf, 0x27, 0x98, 0x9a, 0x9b, 0xab, 0x59, 0xfb, 0xbe, 0xa9, 0xff, 0xcc, 0x66, 0x3b, 0xf8, 0xe1, 0xe7, 0x40, 0x7d, 0xc2, 0x73 } +, + /* Seed */ + 212, + { 0xe0, 0x19, 0x60, 0x82, 0x6d, 0x1a, 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b, 0x87, 0xe4, 0xbd, 0x61, 0x0e, 0x35, 0x8f, 0x35, 0x26, 0xda, 0x05, 0x92, 0xc9, 0xe5, 0x02, 0xb7, 0x2b, 0x76, 0xe4, 0x65, 0x66 } +, + /* Encryption */ + 256, + { 0x77, 0xd9, 0x07, 0x18, 0x1c, 0xc3, 0xb1, 0xbb, 0x19, 0x81, 0xe8, 0xcb, 0x22, 0xf7, 0xad, 0x75, 0xf8, 0x82, 0xe2, 0x6a, 0xfd, 0x28, 0x1b, 0x64, 0xdb, 0x70, 0xc8, 0x4c, 0x6a, 0x50, 0xfe, 0x74, 0x24, 0x9e, 0x22, 0xfb, 0xee, 0x90, 0xe3, 0x0d, 0x0b, 0x70, 0xae, 0x2f, 0x7e, 0x12, 0xac, 0xdd, 0xf6, 0x78, 0xf0, 0x0d, 0x22, 0x7e, 0x53, 0x61, 0x54, 0x26, 0x62, 0x43, 0x02, 0x69, 0xfe, 0xea, 0x34, 0x12, 0x47, 0x92, 0xaf, 0xb3, 0xf8, 0x7b, 0x30, 0xf9, 0x50, 0xf4, 0xed, 0xf2, 0x2c, 0x44, 0x04, 0xc9, 0x68, 0x8d, 0xec, 0x38, 0xea, 0x0b, 0x99, 0xcb, 0x3d, 0xc3, 0x84, 0xbd, 0x88, 0xfa, 0x31, 0x83, 0xd7, 0xe0, 0x7a, 0x20, 0x54, 0xd7, 0x3e, 0xa5, 0x1d, 0x42, 0x86, 0xbb, 0x39, 0xda, 0xe3, 0xae, 0x6d, 0x0b, 0x96, 0x51, 0xf1, 0xea, 0x48, 0x8f, 0x80, 0x5f, 0x2a, 0x21, 0x6e, 0xa2, 0x1a, 0x56, 0x76, 0xb9, 0x7d, 0x1b, 0x11, 0xd3, 0xb4, 0x03, 0x6c, 0xe1, 0x67, 0xfe, 0xf6, 0x4e, 0x0e, 0xba, 0x41, 0x9a, 0xf6, 0x73, 0x98, 0x3f, 0xc6, 0xee, 0x01, 0xc6, 0x37, 0xb1, 0x64, 0xe5, 0xaa, 0xac, 0xc9, 0x9a, 0xde, 0xe9, 0xf4, 0x7d, 0x21, 0x92, 0x54, 0x69, 0x6c, 0x8f, 0xce, 0xec, 0x6c, 0x74, 0xac, 0x4e, 0x39, 0x05, 0x1e, 0x15, 0x26, 0x94, 0x01, 0x73, 0x82, 0x64, 0xf0, 0xca, 0x5b, 0xf1, 0x22, 0xc5, 0x5c, 0x9e, 0x5d, 0xd8, 0x47, 0xb1, 0xd5, 0x77, 0x4e, 0x74, 0x08, 0xc3, 0x68, 0x4a, 0xa9, 0x74, 0xb0, 0xba, 0xaf, 0x40, 0xed, 0xc2, 0x2a, 0x03, 0x57, 0xaf, 0x72, 0xc8, 0x16, 0xcf, 0x73, 0x1f, 0xcb, 0x63, 0x96, 0x53, 0x60, 0x69, 0x9f, 0x26, 0x99, 0x97, 0xb8, 0x48, 0x0f, 0x30, 0xa6, 0xb5, 0xd5, 0x7e, 0x12, 0xa5, 0xcc, 0x54, 0xec, 0x0c, 0x80, 0x5f, 0xdc, 0xf6 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.8", + /* Message */ + 9, + { 0x55, 0x61, 0x39, 0x59, 0x3e, 0xee, 0x8b, 0x6e, 0x87 } +, + /* Seed */ + 244, + { 0x2d, 0xe2, 0xa5, 0x72, 0x24, 0xf5, 0xf5, 0xb1, 0x2e, 0x22, 0x3e, 0xb5, 0xf8, 0x2b, 0x9f, 0x47, 0x24, 0x9d, 0x25, 0x55, 0x93, 0x79, 0x13, 0x6e, 0xaf, 0x18, 0xe2, 0xf6, 0xc8, 0x33, 0xe3, 0xf0, 0x1b, 0xde, 0xea, 0x9c, 0x30, 0x3b, 0xd9, 0x67, 0x7c, 0x2a, 0x85, 0x71, 0x7d, 0x59, 0x3a, 0x28, 0x02, 0xae, 0xcb, 0xc6, 0xb3, 0xb7, 0x1f, 0x2c, 0x79, 0x03, 0xff, 0x69, 0x0e, 0x3f, 0x3c, 0x49, 0x57, 0xdd, 0x74, 0xcc, 0x9c, 0x2a, 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fc, 0x20, 0x74, 0xc3, 0xf4, 0xf1, 0x35, 0x59, 0x70, 0x0b, 0x27, 0x08, 0xa0, 0xb7, 0x55, 0x78, 0x96, 0x70, 0xa3, 0x62, 0x6a, 0x14, 0x63, 0x88, 0x11, 0xbb, 0x18, 0xe1, 0x5b, 0x10, 0x25, 0xc3, 0xb9, 0xbe, 0xf1, 0x11, 0x17, 0x6b, 0xc1, 0xf2, 0x46, 0x9e, 0xa9, 0x9a, 0xad, 0x20, 0x86, 0x05, 0x73, 0xd6, 0xc6, 0xa1, 0xfe, 0x40, 0xdb, 0x51, 0xe3, 0x6f, 0xe3, 0x38, 0x00, 0x10, 0x1b, 0xda, 0x20 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.9", + /* Message */ + 49, + { 0x9a, 0x13, 0x96, 0x62, 0x2d, 0x06, 0x6c, 0x10, 0x56, 0x08, 0x58, 0xc2, 0xc4, 0xcd, 0x5c, 0x04, 0x44, 0x9e, 0x2b, 0x95, 0x50, 0xc5, 0xbc, 0x92, 0x93, 0x76, 0x1a, 0x91, 0x04, 0x41, 0x1d, 0xa1, 0x8a, 0x57, 0xd9, 0xb6, 0xa9, 0x97, 0x33, 0x3c, 0xdb, 0xce, 0x77, 0xe9, 0xfd, 0xbe, 0x6b, 0xb8, 0x31 } +, + /* Seed */ + 204, + { 0xf1, 0x78, 0x61, 0xac, 0xff, 0xb2, 0x4c, 0xac, 0xed, 0x90, 0xba, 0x38, 0xaa, 0x7e, 0xa0, 0xf2, 0xe5, 0x4e, 0xea, 0xa6, 0x2a, 0xe6, 0x64, 0x98, 0xf3, 0xc2, 0x8f, 0x99, 0x6b, 0xce, 0xe2, 0x53, 0xbe, 0xe8, 0x19, 0x9e, 0x3e, 0xb8, 0x0d, 0x62, 0x7f, 0xee, 0xb6, 0xe0, 0xb3, 0x94, 0x90, 0xed, 0xf7, 0x6d, 0x16, 0xa2, 0xa0, 0xbc, 0x20, 0x09, 0x32, 0x52, 0xa9, 0xd7, 0x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, 0x4f, 0x07, 0xcd, 0x4f, 0x5a, 0x82, 0xc7, 0x09, 0xf4, 0x94, 0xf1, 0xdf, 0x0f, 0x80, 0x3b, 0x6f, 0x64, 0xa7, 0x2f, 0xb9, 0xc4, 0x50, 0xff, 0xe2, 0x68, 0xfc, 0xab, 0x48, 0x7d, 0x4d, 0x63, 0x01, 0x3e, 0x41 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.10", + /* Message */ + 53, + { 0xb3, 0x82, 0x4f, 0xb5, 0x45, 0xa8, 0x3f, 0x82, 0xef, 0x82, 0x23, 0x11, 0x82, 0x84, 0xc5, 0x45, 0x6b, 0xab, 0x60, 0x0a, 0xdf, 0x79, 0xf5, 0x07, 0x33, 0xb6, 0x66, 0x8f, 0xbc, 0x51, 0x5d, 0xa5, 0x96, 0x31, 0x62, 0xa6, 0xd7, 0xd7, 0xe9, 0x6f, 0xf9, 0x1a, 0xff, 0x12, 0xeb, 0x3e, 0x93, 0x11, 0xe2, 0x21, 0xe7, 0x0b, 0xc0 } +, + /* Seed */ + 200, + { 0xb8, 0x26, 0x8e, 0x4b, 0xce, 0x7e, 0x53, 0xf2, 0xe8, 0xbe, 0x98, 0xb1, 0x92, 0xd6, 0x3a, 0xd0, 0x65, 0x44, 0xa8, 0x0d, 0x6e, 0x62, 0xd6, 0x32, 0x48, 0x6e, 0x15, 0xe5, 0x75, 0xba, 0x70, 0x6e, 0x3e, 0x76, 0x89, 0x30, 0xdc, 0x8e, 0x41, 0x1f, 0x8e, 0xeb, 0x0b, 0x6e, 0x8f, 0x06, 0x06, 0x29, 0xda, 0x8a, 0x24, 0x23, 0x68, 0xe4, 0x79, 0xcc, 0xb3, 0x31, 0x69, 0x70, 0x70, 0xb4, 0xb3, 0x52, 0x4e, 0x69, 0x16, 0x92, 0x76, 0xba, 0xb0, 0xa9, 0x45, 0x14, 0xcc, 0xd6, 0x60, 0x70, 0x25, 0x28, 0xed, 0x20, 0xb5, 0xd1, 0xdf, 0x07, 0x77, 0x9a, 0x62, 0xc6, 0x56, 0x86, 0xe7, 0xd6, 0x68, 0x46, 0x6f, 0xfc, 0x74, 0x8e, 0xb3, 0x43, 0x44, 0xca, 0x6f, 0x30, 0x5c, 0xda, 0x3d, 0xc3, 0xe8, 0xf0, 0x1c, 0x43, 0xea, 0x91, 0x79, 0xda, 0x46, 0x21, 0x47, 0xf4, 0xd3, 0xec, 0x92, 0xf8, 0x88, 0xb7, 0xee, 0xaa, 0x41, 0x0e, 0x12, 0xc8, 0x6d, 0x89, 0x42, 0xc7, 0xd0, 0x12, 0xf4, 0x5c, 0x61, 0xff, 0xa6, 0xe2, 0xb7, 0x8f, 0x84, 0x3e, 0x9a, 0x75, 0xd9, 0x67, 0x32, 0x14, 0xd5, 0x58, 0xca, 0xf0, 0x1b, 0x45, 0xf9, 0x36, 0x86, 0xee, 0xda, 0x54, 0x79, 0xdb, 0x80, 0x52, 0x79, 0x25, 0x59, 0xcc, 0x23, 0x6a, 0x4a, 0x1e, 0xe6, 0x5d, 0x3c, 0xa6, 0x0e, 0x09, 0xa3, 0xc1, 0x84, 0xd4, 0xb3, 0x95, 0xd7, 0x0b, 0x8e, 0xf8, 0x8d, 0x78, 0x09, 0x1a } +, + /* Encryption */ + 256, + { 0xc0, 0xe9, 0x8d, 0x50, 0x89, 0x4a, 0xda, 0x84, 0x9f, 0xce, 0x89, 0x83, 0xf6, 0xf8, 0x95, 0x74, 0x03, 0x4d, 0x6c, 0xf3, 0xb8, 0x35, 0x2b, 0xfc, 0x50, 0x72, 0x4a, 0x70, 0x3d, 0xd4, 0xf4, 0x2f, 0x40, 0x06, 0xae, 0x00, 0x8a, 0xd9, 0x72, 0x33, 0xce, 0xf6, 0xf1, 0x6c, 0xe1, 0xb4, 0x23, 0xf5, 0x2c, 0x6b, 0x67, 0x7e, 0xf0, 0x05, 0x13, 0x1b, 0xa9, 0x87, 0xf9, 0x8c, 0x72, 0x2f, 0xaa, 0x49, 0x42, 0xec, 0xce, 0x2c, 0x99, 0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d, 0x0a } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.11", + /* Message */ + 43, + { 0xa3, 0xa7, 0xda, 0x1b, 0xed, 0xb2, 0xca, 0x99, 0xfc, 0xde, 0xb7, 0xa4, 0x6d, 0x63, 0x3e, 0xca, 0x35, 0x06, 0x2d, 0xf2, 0x89, 0x6b, 0x69, 0x59, 0x07, 0xa7, 0xf9, 0x71, 0xd2, 0xcc, 0x50, 0xb6, 0xe3, 0xd2, 0xa3, 0x67, 0xd1, 0x6e, 0x72, 0x7f, 0x56, 0x97, 0xc0 } +, + /* Seed */ + 210, + { 0xf0, 0x18, 0xa9, 0xb1, 0x3f, 0xbe, 0x56, 0x0b, 0xfe, 0x95, 0x52, 0xed, 0x8a, 0x86, 0x06, 0xbe, 0xea, 0x90, 0x05, 0x5e, 0xd3, 0xf6, 0x2b, 0xb2, 0xaf, 0x07, 0xf6, 0x92, 0xcb, 0x60, 0xac, 0xfb, 0x6d, 0x59, 0x07, 0xd6, 0x0e, 0x0a, 0x59, 0x7a, 0x54, 0xca, 0xea, 0xf8, 0x44, 0x91, 0x1c, 0xdc, 0x87, 0x4f, 0xaf, 0x95, 0x69, 0x53, 0xa2, 0x7d, 0x30, 0x0e, 0x9b, 0x71, 0x5b, 0x10, 0x4d, 0xf3, 0xc2, 0x32, 0xc3, 0xc9, 0x63, 0x82, 0xcf, 0x5b, 0x5f, 0x3d, 0x07, 0xb2, 0x30, 0xb5, 0x25, 0xbb, 0x33, 0x0e, 0x31, 0x9d, 0x1a, 0x7c, 0x82, 0xd1, 0x53, 0xaf, 0x81, 0x7e, 0xf1, 0x1c, 0xf7, 0x2e, 0x76, 0xdd, 0x50, 0xb0, 0xd7, 0xe5, 0x56, 0x22, 0x65, 0xc8, 0x34, 0x5d, 0xa8, 0x29, 0xf5, 0x60, 0xd6, 0xa5, 0x4e, 0x6f, 0x1e, 0x28, 0x8a, 0x3d, 0xc2, 0x17, 0x6d, 0x19, 0xa6, 0x8a, 0x0b, 0x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 0x6a, 0xd6, 0xfb, 0x31, 0x99, 0x79, 0x0b, 0x3f, 0x4d, 0x6a, 0xd1, 0x9a, 0x0d, 0xf5, 0x02, 0x7f, 0xdb, 0x8f, 0x84, 0x66, 0x04, 0xe0, 0x2d, 0xaf, 0x33, 0x55, 0xd9, 0x56, 0x40, 0x77, 0x79, 0xaf, 0x15, 0x5a, 0xcf, 0xa5, 0xa3, 0x2e, 0x6d, 0x61, 0x74, 0xdc, 0x90, 0x13, 0x1d, 0xbd, 0x7a, 0xbe, 0x58, 0x5d, 0xd7, 0x59, 0xfa, 0x3c, 0xb7, 0xe9, 0xf7, 0x21, 0x45, 0x3f, 0x3e, 0x35, 0x4f, 0xe7, 0xbe, 0x0b, 0x11, 0x8e, 0xf5, 0xb8, 0x79, 0x42, 0xb5, 0xfe, 0xd4, 0xc3, 0x0d, 0x7a, 0x08, 0xfe, 0x24, 0x64, 0xeb, 0x79, 0xa3, 0xde, 0xba, 0xb3, 0x7b, 0x6d, 0x3a, 0x0a, 0xb3, 0x15, 0x77, 0xde, 0x7e, 0x93, 0x22, 0x9b, 0x49, 0xd1, 0xe8, 0xfd, 0x56, 0x32, 0xd0, 0x26, 0xd8, 0x3e, 0xe0, 0x6a, 0xa7, 0x85, 0x34, 0xce, 0xe3, 0x08, 0x1b, 0x22, 0x2e, 0xc4, 0xcd, 0x94, 0x88, 0xcc, 0xde, 0x4e, 0x15, 0x29, 0x05 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.13", + /* Message */ + 5, + { 0x12, 0x97, 0x5d, 0xb7, 0x3d } +, + /* Seed */ + 248, + { 0x6a, 0x4b, 0x4f, 0xb8, 0x05, 0x80, 0x72, 0x72, 0x96, 0x5b, 0xff, 0x2f, 0x4c, 0x80, 0x0f, 0x96, 0x4f, 0xa3, 0xae, 0xb9, 0xfb, 0x43, 0x3b, 0x40, 0xc8, 0xac, 0xc5, 0x98, 0xb4, 0x84, 0x02, 0x98, 0x93, 0xa2, 0x19, 0xc9, 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x2d, 0xa1, 0x89, 0x2c, 0x31, 0x20, 0xef, 0x99, 0x0d, 0x74, 0x61, 0x1d, 0xdd, 0x35, 0x66, 0xaf, 0x1a, 0xcd, 0x8b, 0x48, 0x50, 0x06, 0x1c, 0x91, 0x28, 0xf8, 0x2a, 0xd1, 0x12, 0xda, 0x9f, 0x68, 0xac, 0x88, 0x39, 0x3f, 0x9a, 0x5c, 0x2c, 0x10, 0x20, 0xaa, 0x77, 0xe9, 0xb6, 0x2e, 0x2d, 0x1e, 0x98, 0x5f, 0xef, 0x86, 0x4c, 0xc1, 0xae, 0xb4, 0x51, 0xac, 0x83, 0x9c, 0x72, 0x0c, 0xb9, 0x73, 0xe7, 0xb5, 0xdf, 0x24, 0xa9, 0x8c, 0xcb, 0x6e, 0x67, 0x72, 0x66, 0x29, 0xa3, 0x66, 0xfe, 0xa3, 0xf9, 0xa9, 0x52, 0x1d, 0xaa, 0x19, 0xb0, 0x44, 0x30, 0xe8, 0x10, 0xf2, 0xc4, 0x5a, 0x57, 0xd4, 0x25, 0x3b, 0xed, 0xb9, 0x1d, 0xa0 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.14", + /* Message */ + 46, + { 0x8d, 0xe0, 0xf5, 0xa4, 0x13, 0xa7, 0xf7, 0x86, 0x39, 0x6f, 0x09, 0xa4, 0x5e, 0x5e, 0x77, 0x4f, 0x3c, 0x60, 0x9c, 0xe6, 0xf1, 0xb4, 0x90, 0xdd, 0xe2, 0x22, 0xb3, 0x22, 0xd5, 0x34, 0x0e, 0x9b, 0x10, 0x55, 0x81, 0xf4, 0xc5, 0xbe, 0x44, 0xea, 0xbb, 0x3d, 0x1b, 0x23, 0xf8, 0x45 } +, + /* Seed */ + 207, + { 0xf8, 0x71, 0xa8, 0x97, 0xae, 0xe8, 0x45, 0xc3, 0xbb, 0x82, 0x69, 0x90, 0xb7, 0x31, 0xd2, 0x77, 0x7c, 0xf4, 0x76, 0xb5, 0xcf, 0xc5, 0x59, 0x6d, 0xf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, 0x63, 0x61, 0x69, 0x7f, 0x53, 0xcf, 0x24, 0x66, 0x16, 0x5c, 0x3f, 0xbd, 0x66, 0x2b, 0x83, 0x75, 0x80, 0xb7, 0x6d, 0x45, 0x9f, 0xf0, 0x44, 0x97, 0xe5, 0xfe, 0x1b, 0x3c, 0xd1, 0x8c, 0x4d, 0x58, 0xff, 0xed, 0xab, 0xdd, 0x04, 0xa8, 0xc1, 0x08, 0xd8, 0x59, 0xb6, 0x52, 0x98, 0x63, 0x9c, 0x3a, 0xf8, 0x0c, 0xd9, 0x4e, 0x23, 0x87, 0xa8, 0x69, 0x44, 0x09, 0xef, 0x9e, 0x0b, 0x78, 0xb6, 0xf4, 0x67, 0x39, 0x0b, 0xe1, 0x08, 0x57, 0x9c, 0x9b, 0x2c } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.15", + /* Message */ + 32, + { 0x9e, 0x78, 0xc8, 0x2b, 0xfd, 0x0f, 0x23, 0xd3, 0x91, 0xe7, 0x60, 0x01, 0x64, 0x01, 0x9a, 0xad, 0x28, 0xf5, 0x9b, 0x14, 0x15, 0x44, 0x04, 0xd9, 0xe9, 0x66, 0x13, 0x3c, 0x10, 0x3f, 0xc3, 0x7c } +, + /* Seed */ + 221, + { 0xbb, 0x42, 0x24, 0x7d, 0xb2, 0x40, 0xba, 0xca, 0xcb, 0xcb, 0xe8, 0xc6, 0x8c, 0xb0, 0xf7, 0x0e, 0x46, 0x0a, 0x49, 0x73, 0xda, 0xe6, 0x56, 0x99, 0x35, 0x8f, 0xef, 0x82, 0x70, 0xd6, 0x5c, 0x3d, 0x0c, 0x45, 0x5a, 0x37, 0x9c, 0x56, 0x3c, 0x59, 0x7b, 0x28, 0xf4, 0xff, 0xa0, 0x70, 0xe0, 0xec, 0x1e, 0xbb, 0x9e, 0xd4, 0x27, 0xfe, 0x89, 0xab, 0xcd, 0x47, 0x93, 0xc4, 0x22, 0xc3, 0x38, 0x87, 0x8c, 0x8b, 0x14, 0x5b, 0x46, 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 0x6e, 0x92, 0xb8, 0xb7, 0x91, 0x06, 0x69, 0x68, 0xe0, 0x0f, 0x8a, 0x17, 0x71, 0x61, 0x44, 0x0c, 0xe5, 0x38, 0x57, 0x97, 0x89, 0xc2, 0x91, 0x2e, 0xbd, 0x7a, 0xd0, 0x19, 0xbe, 0x29, 0x37, 0x6c, 0xad, 0xee, 0xc2, 0x99, 0x21, 0x07, 0xc9, 0xdb, 0x07, 0x60, 0x49 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.16", + /* Message */ + 47, + { 0x6d, 0x72, 0x08, 0xb2, 0xff, 0xb0, 0x1a, 0xd2, 0x36, 0x0c, 0x46, 0x09, 0xf3, 0xba, 0xd3, 0x15, 0x79, 0xc8, 0xd4, 0x00, 0x5c, 0xc9, 0x60, 0x14, 0x2e, 0x2b, 0x69, 0x6b, 0x26, 0xe9, 0x4f, 0x2d, 0x99, 0x98, 0x0b, 0xad, 0x38, 0x41, 0x05, 0xb1, 0x89, 0x95, 0x57, 0xaf, 0x89, 0x05, 0x25 } +, + /* Seed */ + 206, + { 0x72, 0xae, 0x49, 0x97, 0x18, 0x28, 0xba, 0x54, 0x23, 0xab, 0x96, 0x3c, 0xdb, 0x18, 0xf4, 0xbd, 0xfd, 0xbc, 0x74, 0x73, 0xcf, 0x70, 0xfb, 0x77, 0x21, 0x34, 0x41, 0xf1, 0xd4, 0x46, 0xae, 0x48, 0x10, 0x93, 0x03, 0xa2, 0x60, 0xc0, 0x91, 0xab, 0x51, 0x99, 0xd9, 0x64, 0xe6, 0x21, 0x63, 0xc2, 0x46, 0x57, 0x24, 0x71, 0x73, 0xcb, 0x05, 0x11, 0xb9, 0xcb, 0xb1, 0x63, 0x45, 0x9c, 0x95, 0x6f, 0x9c, 0x0b, 0x18, 0x83, 0xb6, 0x91, 0xb5, 0xe4, 0xea, 0xe0, 0x4f, 0x0a, 0xf2, 0x4e, 0xa3, 0x28, 0xc6, 0xde, 0x88, 0x2c, 0xeb, 0xc4, 0xf8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xa6, 0x99, 0xdb, 0xe5, 0xdd, 0xc8, 0x19, 0x3e, 0x2b, 0xf3, 0xd5, 0xb8, 0x40 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.17", + /* Message */ + 15, + { 0x7d, 0xeb, 0x6d, 0x40, 0x41, 0x48, 0x23, 0x2c, 0x48, 0x21, 0x63, 0x4d, 0x3d, 0xf9, 0xbc } +, + /* Seed */ + 238, + { 0xe6, 0xf8, 0x3c, 0x8c, 0x99, 0x3e, 0x60, 0x15, 0xaf, 0x43, 0x04, 0x09, 0x68, 0x4e, 0x62, 0x7f, 0x3d, 0x9b, 0x84, 0xad, 0x05, 0x55, 0xc6, 0xa6, 0xc0, 0x91, 0x13, 0xa7, 0x12, 0x47, 0x2a, 0xbb, 0x36, 0xf6, 0x11, 0x92, 0x32, 0x6c, 0xf8, 0x40, 0x82, 0xaa, 0xbd, 0x1e, 0xc9, 0x5f, 0x4d, 0x1a, 0x92, 0xd9, 0x10, 0x7e, 0x30, 0x61, 0x0c, 0x8d, 0x27, 0x59, 0x55, 0x6d, 0x5d, 0x61, 0x47, 0x5c, 0xa3, 0xf3, 0xcb, 0xd9, 0x49, 0xfa, 0xc2, 0x20, 0x3c, 0x42, 0x3d, 0x56, 0xc2, 0x75, 0x58, 0xe6, 0x11, 0x8f, 0xaa, 0x0f, 0x6f, 0x68, 0x4a, 0xda, 0x13, 0xc3, 0x15, 0x3f, 0x6d, 0x25, 0x53, 0x38, 0xbf, 0xf7, 0x34, 0xe9, 0x5f, 0x60, 0xad, 0x29, 0x19, 0xab, 0xf2, 0x88, 0x15, 0xd3, 0xcc, 0x0b, 0x1e, 0xfd, 0x38, 0x5d, 0x0d, 0x45, 0x81, 0xb0, 0xee, 0x84, 0x94, 0xf2, 0xbb, 0xe2, 0x99, 0x59, 0x91, 0xac, 0x1e, 0xa8, 0x15, 0x40, 0xcb, 0x7e, 0x88, 0x56, 0x68, 0xe5, 0xa5, 0x2e, 0xca, 0x90, 0x57, 0xed, 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0xdc, 0xda, 0x83, 0x5f, 0x9e, 0x92, 0x5f, 0x2e, 0x72, 0x46, 0x3f, 0xa8, 0x33, 0xa0, 0x8b, 0x93, 0x25, 0x3f, 0xdf, 0xe8, 0xcf, 0x4e, 0x5f, 0x3c, 0xfa, 0x91, 0x10, 0x77, 0x19, 0xa6, 0xa9, 0x46, 0x9a, 0xcd, 0x71, 0x25, 0xae, 0x67, 0xb2, 0xbd, 0x75, 0x85, 0x7c, 0x59, 0xbe, 0x0a, 0xbe, 0x98, 0x40, 0x74, 0xe2, 0x95, 0x47, 0x8a, 0xf2, 0x74, 0x0e, 0x25, 0x89, 0x4e, 0x56, 0xa6, 0x25, 0x0e, 0xf7, 0x36, 0x21, 0x94, 0x13, 0x81, 0x03, 0x74, 0x3c, 0xa9, 0x54, 0x47, 0x33, 0xd2, 0x50, 0x55, 0x71, 0xbe, 0xe0, 0x0f, 0x17, 0x8a, 0x2c, 0xfa, 0x38, 0xe1, 0xf8, 0xf2, 0x2f, 0xb2, 0x39, 0x30, 0xd6, 0xa7, 0x5d, 0xd1, 0x7c, 0x68, 0x9a, 0x47, 0x6d, 0x87, 0x15, 0x31, 0x85, 0x95, 0x10, 0x8f, 0xcc, 0xe8, 0x95, 0xe3, 0x44, 0x9e, 0xca, 0x97, 0xa7, 0xdd, 0xba, 0xe3, 0xe6, 0xd6, 0xf0, 0xe3, 0x5e, 0x66, 0x6d, 0x6f, 0xbd, 0x78, 0x78, 0x48, 0xf8, 0x68, 0x13, 0x37, 0xb1, 0xd4, 0xc5, 0x23, 0x8b, 0x1c, 0x24, 0xde, 0x77, 0xa7, 0xe6, 0x75, 0xe7, 0xae, 0xd8, 0xdc, 0x13, 0xdd, 0x9e, 0xb1, 0x06, 0x87, 0x98, 0x51, 0x7c, 0x0b, 0x6e } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.18", + /* Message */ + 30, + { 0x03, 0x1f, 0xc3, 0xa3, 0xea, 0xa4, 0x2b, 0x0d, 0x9f, 0x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74, 0x5f, 0x61, 0x6d, 0x51, 0x74, 0x8c, 0xc7, 0xa3, 0x7b, 0x48, 0xcb, 0x10, 0x97, 0x7e, 0x30, 0x3b, 0xbe, 0x10, 0xbf, 0x27, 0xc6, 0x9b, 0xdf, 0xf0, 0xba, 0x5c, 0xab, 0x8f, 0x62, 0xd0, 0x58, 0x7a, 0x09, 0xd6, 0xe0, 0x22, 0x82, 0x32, 0x33, 0xc8, 0xc7, 0xaa, 0x41, 0x87, 0x22, 0x23, 0xed, 0x15, 0xa7, 0x4a, 0xcc, 0xb0, 0xf1, 0xf8, 0x22, 0xf2, 0x4d, 0x75, 0x94, 0xed, 0x99, 0x25, 0xa1, 0xc6, 0xc0, 0xc0, 0xf9, 0xad, 0x0e, 0x07, 0x1e, 0xb6, 0xb5, 0xeb, 0xe1, 0xba, 0xb6, 0xba, 0x3b, 0x6d, 0x99, 0xa3, 0x16, 0x52, 0x04, 0x7f, 0x46, 0x92, 0x60, 0xbe, 0xe8, 0x71, 0x0e, 0x37, 0x0f, 0x04, 0xed, 0x70, 0x75, 0x93, 0x93, 0x7a, 0x08, 0xdd, 0x82, 0x26, 0x49, 0x92, 0x31, 0x1f, 0x4a, 0xf9, 0x88, 0x4c, 0xf8, 0xad, 0x34, 0xaf, 0xb9, 0xf6, 0x75, 0x99, 0x3c, 0x8a, 0xbf, 0x41, 0x51, 0x98, 0x39, 0xf7, 0x6f, 0xa1, 0xe9, 0x31, 0xbd, 0xae, 0x1d, 0x08, 0xa6, 0x34 } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.19", + /* Message */ + 43, + { 0xc9, 0xc9, 0x3a, 0xfe, 0xa9, 0x97, 0xb1, 0xee, 0x36, 0xfa, 0x72, 0x72, 0x03, 0x54, 0xc7, 0x04, 0x64, 0x9b, 0xc6, 0xef, 0x44, 0xf5, 0x18, 0x7c, 0x6c, 0x28, 0x54, 0x2b, 0x9a, 0xe9, 0x55, 0xa7, 0x19, 0x3f, 0xff, 0xec, 0x86,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xae, 0x5f, 0xf5, 0x24, 0xa8, 0x26, 0x6d, 0x76, 0x0e, 0x00, 0x51, 0x43, 0x3d, 0x18, 0x98, 0xff, 0xc2, 0x30, 0xe9, 0x6a, 0x2f, 0x0b, 0xfd, 0xf2, 0xb2, 0x44, 0x29, 0xad, 0xfa, 0x91, 0x8a, 0xba, 0x1a, 0x45, 0x0f, 0x76, 0x78, 0x34, 0x72, 0x30, 0x12, 0x93, 0x84, 0x8b, 0xd8, 0x2d, 0x5a, 0x33, 0x84, 0x31, 0xd6, 0xcb, 0x1c, 0x10, 0x6d, 0xc7, 0x41, 0xd2, 0x34, 0xbf, 0x5a, 0x80, 0xdb, 0xd3, 0x25, 0xda, 0x64, 0xa3, 0x94, 0xa0, 0x06, 0x5f, 0x22, 0x02, 0x8d, 0x0f, 0xdc, 0x5a, 0xdf, 0x0d, 0x0d, 0xe2, 0x9f, 0x22, 0xfb, 0x8c, 0x2a, 0x41, 0x33, 0x1f, 0xe1, 0xfc, 0xb6, 0x15, 0x89, 0xe0, 0xec, 0x75, 0x00, 0xed, 0x84, 0x42, 0xd6, 0x18, 0x46, 0xdf, 0x6c, 0xca, 0x46, 0xcc } + +} +, +{ + "PKCS#1 v1.5 Encryption Example 15.20", + /* Message */ + 22, + { 0x69, 0xb7, 0x64, 0x48, 0x55, 0xf9, 0x1d, 0x1c, 0x61, 0xc8, 0x49, 0x8e, 0x4b, 0xa1, 0xba, 0x4d, 0x84, 0x5b, 0xa8, 0x82, 0xb1, 0x73 } +, + /* Seed */ + 231, + { 0xb2, 0x2f, 0xc7, 0xde, 0x85, 0xc5, 0xf7, 0x5a, 0x2f, 0x32, 0xaf, 0x1b, 0xfb, 0xcd, 0x57, 0x89, 0x71, 0x56, 0x87, 0xde, 0x06, 0xe6, 0x6d, 0x06, 0x4a, 0xe3, 0xeb, 0x8d, 0xfb, 0x07, 0xa2, 0x57, 0x5b, 0xe0, 0xe9, 0xe6, 0xf2, 0x9f, 0x50, 0xd7, 0x39, 0x6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0xfb, 0xe9, 0x05, 0x69, 0xf6 } +, + /* Encryption */ + 256, + { 0xab, 0x42, 0x67, 0x97, 0x2c, 0x77, 0x96, 0x83, 0x93, 0x88, 0xd4, 0xad, 0x87, 0xde, 0xd7, 0x4b, 0xb6, 0x53, 0xe9, 0xa7, 0x05, 0x0e, 0x28, 0x2e, 0x82, 0x19, 0x28, 0x75, 0x68, 0x9f, 0x70, 0xee, 0x1d, 0xa1, 0x8a, 0x1f, 0x73, 0x22, 0x09, 0x2c, 0xd2, 0x9f, 0xd0, 0x01, 0x19, 0x92, 0x2a, 0x6d, 0xe1, 0x26, 0x01, 0x98, 0x0a, 0xa9, 0xfa, 0x6e, 0x61, 0x9e, 0x27, 0x75, 0xe8, 0x7a, 0xda, 0xe3, 0x16, 0x95, 0xc1, 0x30, 0x4e, 0x77, 0xf5, 0x2c, 0xce, 0x01, 0x66, 0x65, 0xf2, 0x26, 0x7c, 0x20, 0x76, 0x26, 0x43, 0xc6, 0x00, 0x3c, 0x01, 0x6d, 0x84, 0x80, 0x44, 0x3c, 0x70, 0x1d, 0xf6, 0xc1, 0xd8, 0xd6, 0x55, 0x54, 0x96, 0x00, 0xee, 0x45, 0x5b, 0x70, 0xe4, 0x73, 0x31, 0x9b, 0x0d, 0x44, 0x45, 0xe0, 0xb7, 0x55, 0x2a, 0x1f, 0x80, 0x8e, 0x88, 0xf3, 0x26, 0x48, 0x42, 0x73, 0x5a, 0xe6, 0x1d, 0xf0, 0x32, 0x5e, 0xd0, 0x36, 0x90, 0xd6, 0xd5, 0xd6, 0x93, 0xad, 0x1f, 0xed, 0x22, 0x66, 0x84, 0x50, 0x37, 0x9d, 0xb5, 0x32, 0x3d, 0xc0, 0x1c, 0x89, 0xaf, 0xfa, 0xe3, 0x69, 0xb9, 0xc3, 0x01, 0xc3, 0x19, 0xc3, 0x7d, 0xdf, 0x51, 0xed, 0xf4, 0x6e, 0x09, 0xb2, 0x1e, 0x5d, 0xe9, 0x14, 0x83, 0xe8, 0xe3, 0xcb, 0x21, 0xee, 0xb7, 0x05, 0x7b, 0xc2, 0xeb, 0xdc, 0x3a, 0xaa, 0x3d, 0x65, 0x00, 0xc9, 0x2f, 0x99, 0xb1, 0x7b, 0x31, 0x80, 0xbb, 0xa0, 0x47, 0xd7, 0x60, 0x73, 0x77, 0x63, 0x36, 0xb1, 0x5d, 0x05, 0x4d, 0x79, 0xa4, 0x40, 0xcc, 0x5e, 0x98, 0x5e, 0xa5, 0x43, 0xfc, 0xaa, 0x25, 0xdb, 0x1d, 0xd8, 0x92, 0xb7, 0x1b, 0xb7, 0x4a, 0x5c, 0xf6, 0x82, 0x63, 0xd8, 0xfd, 0x58, 0xf1, 0xa4, 0x8e, 0x6c, 0x2f, 0xcb, 0x8c, 0x0b, 0x71, 0xa2, 0x51, 0xcf, 0xc1, 0xa2, 0x01, 0x57 } + +} +, +} +}, +}; + diff --git a/testprof/makefile b/testprof/makefile index 6a81666e8..72ae3f798 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -8,7 +8,7 @@ endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o ifndef LIBTEST_S LIBTEST_S=libtomcrypt_prof.a diff --git a/testprof/makefile.icc b/testprof/makefile.icc index c101bf5c1..21c5807fa 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -4,7 +4,7 @@ CC?=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o ifndef LIBTEST_S LIBTEST_S = libtomcrypt_prof.a diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index 9e7f42f89..5ab7b5991 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -7,7 +7,7 @@ CFLAGS = $(CFLAGS_OPTS) -W -I../src/headers -I. -Wall -W OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o \ -pkcs_1_oaep_test.o pkcs_1_emsa_test.o +pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o default: $(LIBTEST_S) diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index 192bc6b6b..9f917e827 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -4,7 +4,7 @@ OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ rsa_test.obj store_test.obj test_driver.obj x86_prof.obj katja_test.obj \ dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj \ -pkcs_1_emsa_test.obj +pkcs_1_emsa_test.obj pkcs_1_eme_test.obj tomcrypt_prof.lib: $(OBJECTS) lib /out:tomcrypt_prof.lib $(OBJECTS) diff --git a/testprof/makefile.shared b/testprof/makefile.shared index 7240b2e44..35ade9ee1 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -9,7 +9,7 @@ CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-par OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o ifndef LIBTEST LIBTEST=libtomcrypt_prof.la diff --git a/testprof/pkcs_1_eme_test.c b/testprof/pkcs_1_eme_test.c new file mode 100644 index 000000000..da1818d8f --- /dev/null +++ b/testprof/pkcs_1_eme_test.c @@ -0,0 +1,69 @@ +#include + +#ifdef LTC_PKCS_1 + +#include "../notes/rsa-testvectors/pkcs1v15crypt-vectors.c" + + + +int pkcs_1_eme_test(void) +{ + int prng_idx = register_prng(&no_prng_desc); + int hash_idx = find_hash("sha1"); + unsigned int i; + + DO(prng_is_valid(prng_idx)); + DO(hash_is_valid(hash_idx)); + + for (i = 0; i < sizeof(testcases_eme)/sizeof(testcases_eme[0]); ++i) { + testcase_t* t = &testcases_eme[i]; + rsa_key k, *key = &k; + DOX(mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, + &key->dP, &key->qP, &key->p, &key->q, NULL), t->name); + + DOX(mp_read_unsigned_bin(key->e, t->rsa.e, t->rsa.e_l), t->name); + DOX(mp_read_unsigned_bin(key->d, t->rsa.d, t->rsa.d_l), t->name); + DOX(mp_read_unsigned_bin(key->N, t->rsa.n, t->rsa.n_l), t->name); + DOX(mp_read_unsigned_bin(key->dQ, t->rsa.dQ, t->rsa.dQ_l), t->name); + DOX(mp_read_unsigned_bin(key->dP, t->rsa.dP, t->rsa.dP_l), t->name); + DOX(mp_read_unsigned_bin(key->qP, t->rsa.qInv, t->rsa.qInv_l), t->name); + DOX(mp_read_unsigned_bin(key->q, t->rsa.q, t->rsa.q_l), t->name); + DOX(mp_read_unsigned_bin(key->p, t->rsa.p, t->rsa.p_l), t->name); + key->type = PK_PRIVATE; + + unsigned int j; + for (j = 0; j < sizeof(t->data)/sizeof(t->data[0]); ++j) { + rsaData_t* s = &t->data[j]; + unsigned char buf[256], obuf[256]; + unsigned long buflen = sizeof(buf), obuflen = sizeof(obuf); + int stat; + prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, NULL); + DOX(rsa_encrypt_key_ex(s->o1, s->o1_l, obuf, &obuflen, NULL, 0, NULL, prng_idx, -1, LTC_PKCS_1_V1_5, key), s->name); + DOX(obuflen == (unsigned long)s->o3_l?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + DOX(memcmp(s->o3, obuf, s->o3_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + DOX(rsa_decrypt_key_ex(obuf, obuflen, buf, &buflen, NULL, 0, -1, LTC_PKCS_1_V1_5, &stat, key), s->name); + DOX(stat == 1?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); + } /* for */ + + mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + } /* for */ + + unregister_prng(&no_prng_desc); + + return 0; +} + +#else + +int pkcs_1_eme_test(void) +{ + fprintf(stderr, "NOP"); + return 0; +} + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index e84acdbba..773d61c57 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -54,6 +54,7 @@ int pkcs_1_test(void); int pkcs_1_pss_test(void); int pkcs_1_oaep_test(void); int pkcs_1_emsa_test(void); +int pkcs_1_eme_test(void); int store_test(void); int rsa_test(void); int dh_test(void); From 2c69088be8e2448acde1b17bbb6418bd25d7abe6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 01:15:58 +0200 Subject: [PATCH 0271/1192] execute only one testcase per default --- notes/rsa-testvectors/rt.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/notes/rsa-testvectors/rt.py b/notes/rsa-testvectors/rt.py index 747cbb401..3f6ab7f39 100755 --- a/notes/rsa-testvectors/rt.py +++ b/notes/rsa-testvectors/rt.py @@ -114,8 +114,12 @@ def __init__(self, name, key, data): def __str__(self): res = "{{\n \"{0}\",\n{1},\n{{".format(self.name, str(self.key)) - for i in self.data: - res += str(i) + '\n' + for idx, d in enumerate(self.data, 1): + if idx == 2: + res += '#ifdef LTC_TEST_EXT\n' + res += str(d) + '\n' + if idx == ftype.numcases: + res += '#endif /* LTC_TEST_EXT */\n' res += '}\n},' return res @@ -225,7 +229,11 @@ def __init__(self, name): typedef struct testcase { const char* name; rsaKey_t rsa; +#ifdef LTC_TEST_EXT rsaData_t data[%d]; +#else + rsaData_t data[1]; +#endif /* LTC_TEST_EXT */ } testcase_t; testcase_t testcases_%s[] = From 7c10ec9dd2f66db9ff7c84e0a62f0ffe733892fd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 01:16:25 +0200 Subject: [PATCH 0272/1192] add makefile for rsa-testvectors --- notes/rsa-testvectors/makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 notes/rsa-testvectors/makefile diff --git a/notes/rsa-testvectors/makefile b/notes/rsa-testvectors/makefile new file mode 100644 index 000000000..dd84f4727 --- /dev/null +++ b/notes/rsa-testvectors/makefile @@ -0,0 +1,11 @@ +default: regen + +clean: + rm -f *.c + +regen: + python rt.py pss-vect.txt pss > pss-vect.c + python rt.py oaep-vect.txt oaep > oaep-vect.c + python rt.py pkcs1v15sign-vectors.txt emsa > pkcs1v15sign-vectors.c + python rt.py pkcs1v15crypt-vectors.txt eme > pkcs1v15crypt-vectors.c + From dc0c6ed9d986bc24827fa82231eeecb89362e67c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 01:16:50 +0200 Subject: [PATCH 0273/1192] regen rsa-testvectors --- notes/rsa-testvectors/oaep-vect.c | 24 +++++++++++++ notes/rsa-testvectors/pkcs1v15crypt-vectors.c | 34 +++++++++++++++++++ notes/rsa-testvectors/pkcs1v15sign-vectors.c | 34 +++++++++++++++++++ notes/rsa-testvectors/pss-vect.c | 24 +++++++++++++ 4 files changed, 116 insertions(+) diff --git a/notes/rsa-testvectors/oaep-vect.c b/notes/rsa-testvectors/oaep-vect.c index cd87a3dd3..dcbdbb00f 100644 --- a/notes/rsa-testvectors/oaep-vect.c +++ b/notes/rsa-testvectors/oaep-vect.c @@ -35,7 +35,11 @@ typedef struct rsaData { typedef struct testcase { const char* name; rsaKey_t rsa; +#ifdef LTC_TEST_EXT rsaData_t data[6]; +#else + rsaData_t data[1]; +#endif /* LTC_TEST_EXT */ } testcase_t; testcase_t testcases_oaep[] = @@ -93,6 +97,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 1.2", /* Message to be encrypted */ @@ -173,6 +178,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -228,6 +234,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 2.2", /* Message to be encrypted */ @@ -308,6 +315,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -363,6 +371,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 3.2", /* Message to be encrypted */ @@ -443,6 +452,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -498,6 +508,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 4.2", /* Message to be encrypted */ @@ -578,6 +589,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -633,6 +645,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 5.2", /* Message to be encrypted */ @@ -713,6 +726,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -768,6 +782,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 6.2", /* Message to be encrypted */ @@ -848,6 +863,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -903,6 +919,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 7.2", /* Message to be encrypted */ @@ -983,6 +1000,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1038,6 +1056,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 8.2", /* Message to be encrypted */ @@ -1118,6 +1137,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1173,6 +1193,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 9.2", /* Message to be encrypted */ @@ -1253,6 +1274,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1308,6 +1330,7 @@ testcase_t testcases_oaep[] = } , +#ifdef LTC_TEST_EXT { "RSAES-OAEP Encryption Example 10.2", /* Message to be encrypted */ @@ -1388,6 +1411,7 @@ testcase_t testcases_oaep[] = } , +#endif /* LTC_TEST_EXT */ } }, }; diff --git a/notes/rsa-testvectors/pkcs1v15crypt-vectors.c b/notes/rsa-testvectors/pkcs1v15crypt-vectors.c index b44601093..ce96cf28c 100644 --- a/notes/rsa-testvectors/pkcs1v15crypt-vectors.c +++ b/notes/rsa-testvectors/pkcs1v15crypt-vectors.c @@ -35,7 +35,11 @@ typedef struct rsaData { typedef struct testcase { const char* name; rsaKey_t rsa; +#ifdef LTC_TEST_EXT rsaData_t data[20]; +#else + rsaData_t data[1]; +#endif /* LTC_TEST_EXT */ } testcase_t; testcase_t testcases_eme[] = @@ -93,6 +97,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 1.2", /* Message */ @@ -397,6 +402,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -452,6 +458,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 2.2", /* Message */ @@ -756,6 +763,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -811,6 +819,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 3.2", /* Message */ @@ -1115,6 +1124,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1170,6 +1180,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 4.2", /* Message */ @@ -1474,6 +1485,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1529,6 +1541,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 5.2", /* Message */ @@ -1833,6 +1846,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1888,6 +1902,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 6.2", /* Message */ @@ -2192,6 +2207,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -2247,6 +2263,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 7.2", /* Message */ @@ -2551,6 +2568,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -2606,6 +2624,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 8.2", /* Message */ @@ -2910,6 +2929,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -2965,6 +2985,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 9.2", /* Message */ @@ -3269,6 +3290,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -3324,6 +3346,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 10.2", /* Message */ @@ -3628,6 +3651,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -3683,6 +3707,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 11.2", /* Message */ @@ -3987,6 +4012,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -4042,6 +4068,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 12.2", /* Message */ @@ -4346,6 +4373,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -4401,6 +4429,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 13.2", /* Message */ @@ -4705,6 +4734,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -4760,6 +4790,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 14.2", /* Message */ @@ -5064,6 +5095,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -5119,6 +5151,7 @@ testcase_t testcases_eme[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Encryption Example 15.2", /* Message */ @@ -5423,6 +5456,7 @@ testcase_t testcases_eme[] = } , +#endif /* LTC_TEST_EXT */ } }, }; diff --git a/notes/rsa-testvectors/pkcs1v15sign-vectors.c b/notes/rsa-testvectors/pkcs1v15sign-vectors.c index 0d7ff6983..0483c87ac 100644 --- a/notes/rsa-testvectors/pkcs1v15sign-vectors.c +++ b/notes/rsa-testvectors/pkcs1v15sign-vectors.c @@ -33,7 +33,11 @@ typedef struct rsaData { typedef struct testcase { const char* name; rsaKey_t rsa; +#ifdef LTC_TEST_EXT rsaData_t data[20]; +#else + rsaData_t data[1]; +#endif /* LTC_TEST_EXT */ } testcase_t; testcase_t testcases_emsa[] = @@ -87,6 +91,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 1.2", /* Message to be signed */ @@ -315,6 +320,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -366,6 +372,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 2.2", /* Message to be signed */ @@ -594,6 +601,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -645,6 +653,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 3.2", /* Message to be signed */ @@ -873,6 +882,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -924,6 +934,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 4.2", /* Message to be signed */ @@ -1152,6 +1163,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1203,6 +1215,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 5.2", /* Message to be signed */ @@ -1431,6 +1444,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1482,6 +1496,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 6.2", /* Message to be signed */ @@ -1710,6 +1725,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1761,6 +1777,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 7.2", /* Message to be signed */ @@ -1989,6 +2006,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -2040,6 +2058,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 8.2", /* Message to be signed */ @@ -2268,6 +2287,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -2319,6 +2339,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 9.2", /* Message to be signed */ @@ -2547,6 +2568,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -2598,6 +2620,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 10.2", /* Message to be signed */ @@ -2826,6 +2849,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -2877,6 +2901,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 11.2", /* Message to be signed */ @@ -3105,6 +3130,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -3156,6 +3182,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 12.2", /* Message to be signed */ @@ -3384,6 +3411,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -3435,6 +3463,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 13.2", /* Message to be signed */ @@ -3663,6 +3692,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -3714,6 +3744,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 14.2", /* Message to be signed */ @@ -3942,6 +3973,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -3993,6 +4025,7 @@ testcase_t testcases_emsa[] = } , +#ifdef LTC_TEST_EXT { "PKCS#1 v1.5 Signature Example 15.2", /* Message to be signed */ @@ -4221,6 +4254,7 @@ testcase_t testcases_emsa[] = } , +#endif /* LTC_TEST_EXT */ } }, }; diff --git a/notes/rsa-testvectors/pss-vect.c b/notes/rsa-testvectors/pss-vect.c index cf75af348..3db5f5b97 100644 --- a/notes/rsa-testvectors/pss-vect.c +++ b/notes/rsa-testvectors/pss-vect.c @@ -35,7 +35,11 @@ typedef struct rsaData { typedef struct testcase { const char* name; rsaKey_t rsa; +#ifdef LTC_TEST_EXT rsaData_t data[6]; +#else + rsaData_t data[1]; +#endif /* LTC_TEST_EXT */ } testcase_t; testcase_t testcases_pss[] = @@ -93,6 +97,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 1.2", /* Message to be signed */ @@ -173,6 +178,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -228,6 +234,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 2.2", /* Message to be signed */ @@ -308,6 +315,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -363,6 +371,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 3.2", /* Message to be signed */ @@ -443,6 +452,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -498,6 +508,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 4.2", /* Message to be signed */ @@ -578,6 +589,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -633,6 +645,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 5.2", /* Message to be signed */ @@ -713,6 +726,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -768,6 +782,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 6.2", /* Message to be signed */ @@ -848,6 +863,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -903,6 +919,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 7.2", /* Message to be signed */ @@ -983,6 +1000,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1038,6 +1056,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 8.2", /* Message to be signed */ @@ -1118,6 +1137,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1173,6 +1193,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 9.2", /* Message to be signed */ @@ -1253,6 +1274,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, { @@ -1308,6 +1330,7 @@ testcase_t testcases_pss[] = } , +#ifdef LTC_TEST_EXT { "RSASSA-PSS Signature Example 10.2", /* Message to be signed */ @@ -1388,6 +1411,7 @@ testcase_t testcases_pss[] = } , +#endif /* LTC_TEST_EXT */ } }, }; From c6dfef95ebd5ab8b8114cc0c457488c6a1aa0ec4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 14:52:58 +0200 Subject: [PATCH 0274/1192] testprof/rsa_test: add testcase for bleichenbacher signature attack --- testprof/rsa_test.c | 79 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 0366dc923..b1b05a8bf 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -105,7 +105,7 @@ int rsa_test(void) unsigned char in[1024], out[1024], tmp[1024]; rsa_key key, privKey, pubKey; int hash_idx, prng_idx, stat, stat2; - unsigned long rsa_msgsize, len, len2, cnt; + unsigned long rsa_msgsize, len, len2, len3, cnt, cnt2; static unsigned char lparam[] = { 0x01, 0x02, 0x03, 0x04 }; if (rsa_compat_test() != 0) { @@ -281,7 +281,7 @@ for (cnt = 0; cnt < len; ) { } /* verify with privKey */ - /* change a byte */ + /* change byte back to original */ in[0] ^= 1; DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat, &privKey)); /* change a byte */ @@ -297,7 +297,7 @@ for (cnt = 0; cnt < len; ) { } /* verify with pubKey */ - /* change a byte */ + /* change byte back to original */ in[0] ^= 1; DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat, &pubKey)); /* change a byte */ @@ -344,6 +344,79 @@ for (cnt = 0; cnt < len; ) { return 1; } + /* Testcase for Bleichenbacher attack + * + * (1) Create a valid signature + * (2) Check that it can be verified + * (3) Decrypt the package to fetch plain text + * (4) Forge the structure of PKCS#1-EMSA encoded data + * (4.1) Search for start and end of the padding string + * (4.2) Move the signature to the front of the padding string + * (4.3) Fill the message until the end with random data + * (5) Encrypt the package again + * (6) Profit :) + * Verification process should succeed, but result should not be valid + */ + + unsigned char* p = in; + unsigned char* p2 = out; + unsigned char* p3 = tmp; + len = sizeof(in); + len2 = sizeof(out); + cnt = rsa_get_size(&key); + /* (1) */ + DO(rsa_sign_hash_ex(p, 20, p2, &len2, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); + /* (2) */ + DOX(rsa_verify_hash_ex(p2, len2, p, 20, LTC_PKCS_1_V1_5, hash_idx, -1, &stat, &pubKey), "should succeed"); + DOX(stat == 1?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, "should succeed"); + len3 = sizeof(tmp); + /* (3) */ + DO(ltc_mp.rsa_me(p2, len2, p3, &len3, PK_PUBLIC, &key)); + /* (4) */ +#if 0 + printf("\nBefore:"); + for (cnt = 0; cnt < len3; ++cnt) { + if (cnt%32 == 0) + printf("\n%3d:", cnt); + printf(" %02x", p3[cnt]); + } +#endif + /* (4.1) */ + for (cnt = 0; cnt < len3; ++cnt) { + if (p3[cnt] == 0xff) + break; + } + for (cnt2 = cnt+1; cnt2 < len3; ++cnt2) { + if (p3[cnt2] != 0xff) + break; + } + /* (4.2) */ + memmove(&p3[cnt+1], &p3[cnt2], len3-cnt2); + /* (4.3) */ + for (cnt = cnt + len3-cnt2+1; cnt < len; ++cnt) { + do { + p3[cnt] = (unsigned char)rand(); + } while (p3[cnt] == 0); + } +#if 0 + printf("\nAfter:"); + for (cnt = 0; cnt < len3; ++cnt) { + if (cnt%32 == 0) + printf("\n%3d:", cnt); + printf(" %02x", p3[cnt]); + } + printf("\n"); +#endif + + len2 = sizeof(out); + /* (5) */ + DO(ltc_mp.rsa_me(p3, len3, p2, &len2, PK_PRIVATE, &key)); + + len3 = sizeof(tmp); + /* (6) */ + DOX(rsa_verify_hash_ex(p2, len2, p, 20, LTC_PKCS_1_V1_5, hash_idx, -1, &stat, &pubKey), "should succeed"); + DOX(stat == 0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, "should fail"); + /* free the key and return */ rsa_free(&key); rsa_free(&pubKey); From 5eb9743410ce4657e9d54fef26a2ee31a1b5dd09 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 6 Aug 2014 15:03:46 +0200 Subject: [PATCH 0275/1192] rsa_verify_hash: fix possible bleichenbacher signature attack --- src/pk/rsa/rsa_verify_hash.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 5639cd46f..fc000dee2 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -103,7 +103,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, } else { /* PKCS #1 v1.5 decode it */ unsigned char *out; - unsigned long outlen, loid[16]; + unsigned long outlen, loid[16], reallen; int decoded; ltc_asn1_list digestinfo[2], siginfo[2]; @@ -145,8 +145,14 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, goto bail_2; } + if ((err = der_length_sequence(siginfo, 2, &reallen)) != CRYPT_OK) { + XFREE(out); + goto bail_2; + } + /* test OID */ - if ((digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && + if ((reallen == outlen) && + (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && (XMEMCMP(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && (siginfo[1].size == hashlen) && (XMEMCMP(siginfo[1].data, hash, hashlen) == 0)) { From e227000578566d1a6aa5be3da1568e225fef164a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 19 Aug 2014 19:17:36 +0200 Subject: [PATCH 0276/1192] tests: remove surplus ';' in DO()/DOX() macros --- testprof/tomcrypt_test.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 773d61c57..c51b126d4 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -39,11 +39,11 @@ extern prng_state yarrow_prng; void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); #ifdef LTC_VERBOSE -#define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0); -#define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0); +#define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) +#define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) #else -#define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0); -#define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0); +#define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) +#define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) #endif /* TESTS */ From 2b3c603c6c66cda1761146779d218b593d27d466 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 19 Aug 2014 19:17:47 +0200 Subject: [PATCH 0277/1192] udpate bleichenbacher signature attack also test for too short padding strings --- testprof/rsa_test.c | 108 +++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 51 deletions(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index b1b05a8bf..c5792c541 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -104,7 +104,7 @@ int rsa_test(void) { unsigned char in[1024], out[1024], tmp[1024]; rsa_key key, privKey, pubKey; - int hash_idx, prng_idx, stat, stat2; + int hash_idx, prng_idx, stat, stat2, i; unsigned long rsa_msgsize, len, len2, len3, cnt, cnt2; static unsigned char lparam[] = { 0x01, 0x02, 0x03, 0x04 }; @@ -361,61 +361,67 @@ for (cnt = 0; cnt < len; ) { unsigned char* p = in; unsigned char* p2 = out; unsigned char* p3 = tmp; - len = sizeof(in); - len2 = sizeof(out); - cnt = rsa_get_size(&key); - /* (1) */ - DO(rsa_sign_hash_ex(p, 20, p2, &len2, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); - /* (2) */ - DOX(rsa_verify_hash_ex(p2, len2, p, 20, LTC_PKCS_1_V1_5, hash_idx, -1, &stat, &pubKey), "should succeed"); - DOX(stat == 1?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, "should succeed"); - len3 = sizeof(tmp); - /* (3) */ - DO(ltc_mp.rsa_me(p2, len2, p3, &len3, PK_PUBLIC, &key)); - /* (4) */ + for (i = 0; i < 9; ++i) { + len = sizeof(in); + len2 = sizeof(out); + cnt = rsa_get_size(&key); + /* (1) */ + DO(rsa_sign_hash_ex(p, 20, p2, &len2, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); + /* (2) */ + DOX(rsa_verify_hash_ex(p2, len2, p, 20, LTC_PKCS_1_V1_5, hash_idx, -1, &stat, &pubKey), "should succeed"); + DOX(stat == 1?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, "should succeed"); + len3 = sizeof(tmp); + /* (3) */ + DO(ltc_mp.rsa_me(p2, len2, p3, &len3, PK_PUBLIC, &key)); + /* (4) */ #if 0 - printf("\nBefore:"); - for (cnt = 0; cnt < len3; ++cnt) { - if (cnt%32 == 0) - printf("\n%3d:", cnt); - printf(" %02x", p3[cnt]); - } + printf("\nBefore:"); + for (cnt = 0; cnt < len3; ++cnt) { + if (cnt%32 == 0) + printf("\n%3d:", cnt); + printf(" %02x", p3[cnt]); + } #endif - /* (4.1) */ - for (cnt = 0; cnt < len3; ++cnt) { - if (p3[cnt] == 0xff) - break; - } - for (cnt2 = cnt+1; cnt2 < len3; ++cnt2) { - if (p3[cnt2] != 0xff) - break; - } - /* (4.2) */ - memmove(&p3[cnt+1], &p3[cnt2], len3-cnt2); - /* (4.3) */ - for (cnt = cnt + len3-cnt2+1; cnt < len; ++cnt) { - do { - p3[cnt] = (unsigned char)rand(); - } while (p3[cnt] == 0); - } + /* (4.1) */ + for (cnt = 0; cnt < len3; ++cnt) { + if (p3[cnt] == 0xff) + break; + } + for (cnt2 = cnt+1; cnt2 < len3; ++cnt2) { + if (p3[cnt2] != 0xff) + break; + } + /* (4.2) */ + memmove(&p3[cnt+i], &p3[cnt2], len3-cnt2); + /* (4.3) */ + for (cnt = cnt + len3-cnt2+i; cnt < len; ++cnt) { + do { + p3[cnt] = (unsigned char)rand(); + } while (p3[cnt] == 0); + } #if 0 - printf("\nAfter:"); - for (cnt = 0; cnt < len3; ++cnt) { - if (cnt%32 == 0) - printf("\n%3d:", cnt); - printf(" %02x", p3[cnt]); - } - printf("\n"); + printf("\nAfter:"); + for (cnt = 0; cnt < len3; ++cnt) { + if (cnt%32 == 0) + printf("\n%3d:", cnt); + printf(" %02x", p3[cnt]); + } + printf("\n"); #endif - len2 = sizeof(out); - /* (5) */ - DO(ltc_mp.rsa_me(p3, len3, p2, &len2, PK_PRIVATE, &key)); - - len3 = sizeof(tmp); - /* (6) */ - DOX(rsa_verify_hash_ex(p2, len2, p, 20, LTC_PKCS_1_V1_5, hash_idx, -1, &stat, &pubKey), "should succeed"); - DOX(stat == 0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, "should fail"); + len2 = sizeof(out); + /* (5) */ + DO(ltc_mp.rsa_me(p3, len3, p2, &len2, PK_PRIVATE, &key)); + + len3 = sizeof(tmp); + /* (6) */ + if (i < 8) + DOX(rsa_verify_hash_ex(p2, len2, p, 20, LTC_PKCS_1_V1_5, hash_idx, -1, &stat, &pubKey) + == CRYPT_INVALID_PACKET ? CRYPT_OK:CRYPT_INVALID_PACKET, "should fail"); + else + DOX(rsa_verify_hash_ex(p2, len2, p, 20, LTC_PKCS_1_V1_5, hash_idx, -1, &stat, &pubKey), "should succeed"); + DOX(stat == 0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, "should fail"); + } /* free the key and return */ rsa_free(&key); From d51715db728d99954219cc42b013db6e48db65c0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 19 Aug 2014 19:20:22 +0200 Subject: [PATCH 0278/1192] pkcs#1 v1.5 decode: fix missing check of PS length in EMSA mode --- src/pk/pkcs1/pkcs_1_v1_5_decode.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pk/pkcs1/pkcs_1_v1_5_decode.c b/src/pk/pkcs1/pkcs_1_v1_5_decode.c index a073da98c..5afbb80fc 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_decode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_decode.c @@ -65,9 +65,8 @@ int pkcs_1_v1_5_decode(const unsigned char *msg, } ps_len = i++ - 2; - if ((i >= modulus_len) || (ps_len < 8)) { - /* There was no octet with hexadecimal value 0x00 to separate ps from m, - * or the length of ps is less than 8 octets. + if (i >= modulus_len) { + /* There was no octet with hexadecimal value 0x00 to separate ps from m. */ result = CRYPT_INVALID_PACKET; goto bail; @@ -87,6 +86,14 @@ int pkcs_1_v1_5_decode(const unsigned char *msg, ps_len = i - 2; } + if (ps_len < 8) + { + /* The length of ps is less than 8 octets. + */ + result = CRYPT_INVALID_PACKET; + goto bail; + } + if (*outlen < (msglen - (2 + ps_len + 1))) { *outlen = msglen - (2 + ps_len + 1); result = CRYPT_BUFFER_OVERFLOW; From 536a1992034cfbdfc02227ec550f36913855207d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 21 Aug 2014 12:41:25 +0200 Subject: [PATCH 0279/1192] rsa_test: fix valgrind warnings --- testprof/rsa_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index c5792c541..648ed71e2 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -240,11 +240,13 @@ for (cnt = 0; cnt < len; ) { for (rsa_msgsize = 1; rsa_msgsize <= 117; rsa_msgsize++) { len = sizeof(out); len2 = rsa_msgsize; + /* make a random key/msg */ + yarrow_read(in, rsa_msgsize, &yarrow_prng); DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_PKCS_1_V1_5, &key)); len2 = rsa_msgsize; DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_PKCS_1_V1_5, &stat, &key)); - if (!(stat == 1 && stat2 == 0)) { + if (stat != 1) { fprintf(stderr, "rsa_decrypt_key_ex failed, %d, %d", stat, stat2); return 1; } From f86d36c676665993b207639ef66db7d8dbd11c66 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 21 Aug 2014 12:43:42 +0200 Subject: [PATCH 0280/1192] rsa_test: improve a bit --- testprof/rsa_test.c | 56 +++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 648ed71e2..df0027a15 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -100,6 +100,19 @@ static int rsa_compat_test(void) return 0; } +static void _rsa_testPrint(const char* what, const unsigned char* p, const unsigned long l) +{ + unsigned long x; + fprintf(stderr, "%s contents: \n", what); + for (x = 0; x < l; ) { + fprintf(stderr, "%02x ", p[x]); + if (!(++x % 16)) { + fprintf(stderr, "\n"); + } + } + fprintf(stderr, "\n"); +} + int rsa_test(void) { unsigned char in[1024], out[1024], tmp[1024]; @@ -186,24 +199,9 @@ for (cnt = 0; cnt < len; ) { return 1; } if (len2 != rsa_msgsize || memcmp(tmp, in, rsa_msgsize)) { - unsigned long x; fprintf(stderr, "\nrsa_decrypt_key mismatch, len %lu (second decrypt)\n", len2); - fprintf(stderr, "Original contents: \n"); - for (x = 0; x < rsa_msgsize; ) { - fprintf(stderr, "%02x ", in[x]); - if (!(++x % 16)) { - fprintf(stderr, "\n"); - } - } - fprintf(stderr, "\n"); - fprintf(stderr, "Output contents: \n"); - for (x = 0; x < rsa_msgsize; ) { - fprintf(stderr, "%02x ", out[x]); - if (!(++x % 16)) { - fprintf(stderr, "\n"); - } - } - fprintf(stderr, "\n"); + _rsa_testPrint("Original", in, rsa_msgsize); + _rsa_testPrint("Output", tmp, len2); return 1; } } @@ -232,6 +230,8 @@ for (cnt = 0; cnt < len; ) { } if (len2 != rsa_msgsize || memcmp(tmp, in, rsa_msgsize)) { fprintf(stderr, "rsa_decrypt_key mismatch len %lu", len2); + _rsa_testPrint("Original", in, rsa_msgsize); + _rsa_testPrint("Output", tmp, len2); return 1; } } @@ -250,10 +250,16 @@ for (cnt = 0; cnt < len; ) { fprintf(stderr, "rsa_decrypt_key_ex failed, %d, %d", stat, stat2); return 1; } - if (len2 != rsa_msgsize || memcmp(tmp, in, rsa_msgsize)) { + if (len2 != rsa_msgsize) { fprintf(stderr, "rsa_decrypt_key_ex mismatch len %lu", len2); return 1; } + if (memcmp(tmp, in, rsa_msgsize)) { + fprintf(stderr, "rsa_decrypt_key_ex mismatch data"); + _rsa_testPrint("Original", in, rsa_msgsize); + _rsa_testPrint("Output", tmp, rsa_msgsize); + return 1; + } } /* sign a message (unsalted, lower cholestorol and Atkins approved) now */ @@ -354,10 +360,12 @@ for (cnt = 0; cnt < len; ) { * (4) Forge the structure of PKCS#1-EMSA encoded data * (4.1) Search for start and end of the padding string * (4.2) Move the signature to the front of the padding string - * (4.3) Fill the message until the end with random data + * (4.3) Zero the message until the end * (5) Encrypt the package again * (6) Profit :) - * Verification process should succeed, but result should not be valid + * For PS lengths < 8: the verification process should fail + * For PS lengths >= 8: the verification process should succeed + * For all PS lengths: the result should not be valid */ unsigned char* p = in; @@ -380,7 +388,7 @@ for (cnt = 0; cnt < len; ) { printf("\nBefore:"); for (cnt = 0; cnt < len3; ++cnt) { if (cnt%32 == 0) - printf("\n%3d:", cnt); + printf("\n%3lu:", cnt); printf(" %02x", p3[cnt]); } #endif @@ -397,15 +405,13 @@ for (cnt = 0; cnt < len; ) { memmove(&p3[cnt+i], &p3[cnt2], len3-cnt2); /* (4.3) */ for (cnt = cnt + len3-cnt2+i; cnt < len; ++cnt) { - do { - p3[cnt] = (unsigned char)rand(); - } while (p3[cnt] == 0); + p3[cnt] = 0; } #if 0 printf("\nAfter:"); for (cnt = 0; cnt < len3; ++cnt) { if (cnt%32 == 0) - printf("\n%3d:", cnt); + printf("\n%3lu:", cnt); printf(" %02x", p3[cnt]); } printf("\n"); From 8ce125f8a8893959021186d99c4bf6d8bba81187 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Aug 2014 02:51:22 +0200 Subject: [PATCH 0281/1192] mp_rand() assumes the number of digits and not the bitsize as parameter --- src/pk/rsa/rsa_exptmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 63fe3e78f..5b5036734 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -76,7 +76,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, if (which == PK_PRIVATE) { #ifdef LTC_RSA_BLINDING /* do blinding */ - err = mp_rand(rnd, mp_count_bits(key->N)); + err = mp_rand(rnd, mp_get_digit_count(key->N)); if (err != CRYPT_OK) { goto error; } From 64f887e8f3958a9707a720a3d1fa8439c10d8d21 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Aug 2014 13:16:16 +0200 Subject: [PATCH 0282/1192] predictable rand() values please --- testprof/pkcs_1_test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testprof/pkcs_1_test.c b/testprof/pkcs_1_test.c index 8bcfe8cdd..792d024fd 100644 --- a/testprof/pkcs_1_test.c +++ b/testprof/pkcs_1_test.c @@ -2,6 +2,12 @@ #ifdef LTC_PKCS_1 +#ifdef LTC_TEST_REAL_RAND +#define LTC_TEST_RAND_SEED time(NULL) +#else +#define LTC_TEST_RAND_SEED 23 +#endif + int pkcs_1_test(void) { unsigned char buf[3][128]; @@ -18,7 +24,7 @@ int pkcs_1_test(void) return 1; } - srand(time(NULL)); + srand(LTC_TEST_RAND_SEED); /* do many tests */ for (x = 0; x < 100; x++) { zeromem(buf, sizeof(buf)); From efc6844f9c6bbdca5ebb9f8276e8f5b22a9f167d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Aug 2014 13:18:30 +0200 Subject: [PATCH 0283/1192] tests: add function print_hex() --- testprof/rsa_test.c | 25 ++++++------------------- testprof/tomcrypt_test.h | 1 + testprof/x86_prof.c | 13 +++++++++++++ 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index df0027a15..ae27ec106 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -100,19 +100,6 @@ static int rsa_compat_test(void) return 0; } -static void _rsa_testPrint(const char* what, const unsigned char* p, const unsigned long l) -{ - unsigned long x; - fprintf(stderr, "%s contents: \n", what); - for (x = 0; x < l; ) { - fprintf(stderr, "%02x ", p[x]); - if (!(++x % 16)) { - fprintf(stderr, "\n"); - } - } - fprintf(stderr, "\n"); -} - int rsa_test(void) { unsigned char in[1024], out[1024], tmp[1024]; @@ -200,8 +187,8 @@ for (cnt = 0; cnt < len; ) { } if (len2 != rsa_msgsize || memcmp(tmp, in, rsa_msgsize)) { fprintf(stderr, "\nrsa_decrypt_key mismatch, len %lu (second decrypt)\n", len2); - _rsa_testPrint("Original", in, rsa_msgsize); - _rsa_testPrint("Output", tmp, len2); + print_hex("Original", in, rsa_msgsize); + print_hex("Output", tmp, len2); return 1; } } @@ -230,8 +217,8 @@ for (cnt = 0; cnt < len; ) { } if (len2 != rsa_msgsize || memcmp(tmp, in, rsa_msgsize)) { fprintf(stderr, "rsa_decrypt_key mismatch len %lu", len2); - _rsa_testPrint("Original", in, rsa_msgsize); - _rsa_testPrint("Output", tmp, len2); + print_hex("Original", in, rsa_msgsize); + print_hex("Output", tmp, len2); return 1; } } @@ -256,8 +243,8 @@ for (cnt = 0; cnt < len; ) { } if (memcmp(tmp, in, rsa_msgsize)) { fprintf(stderr, "rsa_decrypt_key_ex mismatch data"); - _rsa_testPrint("Original", in, rsa_msgsize); - _rsa_testPrint("Output", tmp, rsa_msgsize); + print_hex("Original", in, rsa_msgsize); + print_hex("Output", tmp, rsa_msgsize); return 1; } } diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index c51b126d4..f6951fc1f 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -80,6 +80,7 @@ extern int no_results; extern const struct ltc_prng_descriptor no_prng_desc; #endif +void print_hex(const char* what, const unsigned char* p, const unsigned long l); int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index c60aa8201..9ade6b3da 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -2,6 +2,19 @@ prng_state yarrow_prng; +void print_hex(const char* what, const unsigned char* p, const unsigned long l) +{ + unsigned long x; + fprintf(stderr, "%s contents: \n", what); + for (x = 0; x < l; ) { + fprintf(stderr, "%02x ", p[x]); + if (!(++x % 16)) { + fprintf(stderr, "\n"); + } + } + fprintf(stderr, "\n"); +} + struct list results[100]; int no_results; int sorter(const void *a, const void *b) From 40714755583f67b502216703c754f7ec2ad2d8a1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Aug 2014 13:53:51 +0200 Subject: [PATCH 0284/1192] fix compiler warnings --- testprof/no_prng.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/testprof/no_prng.c b/testprof/no_prng.c index dfcb8310d..69c025991 100644 --- a/testprof/no_prng.c +++ b/testprof/no_prng.c @@ -28,6 +28,7 @@ static unsigned long no_prng_offset = 0; */ int no_prng_start(prng_state *prng) { + LTC_UNUSED_PARAM(prng); no_prng_len = 0; no_prng_offset = 0; @@ -43,6 +44,7 @@ int no_prng_start(prng_state *prng) */ int no_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { + LTC_UNUSED_PARAM(prng); LTC_ARGCHK(in != NULL); LTC_ARGCHK(inlen <= sizeof(no_prng_entropy)); @@ -75,6 +77,7 @@ int no_prng_ready(prng_state *prng) */ unsigned long no_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) { + LTC_UNUSED_PARAM(prng); LTC_ARGCHK(out != NULL); outlen = MIN(outlen, no_prng_len - no_prng_offset); @@ -91,6 +94,7 @@ unsigned long no_prng_read(unsigned char *out, unsigned long outlen, prng_state */ int no_prng_done(prng_state *prng) { + LTC_UNUSED_PARAM(prng); return CRYPT_OK; } @@ -103,6 +107,9 @@ int no_prng_done(prng_state *prng) */ int no_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { + LTC_UNUSED_PARAM(out); + LTC_UNUSED_PARAM(outlen); + LTC_UNUSED_PARAM(prng); return CRYPT_OK; } @@ -115,6 +122,9 @@ int no_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) */ int no_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { + LTC_UNUSED_PARAM(in); + LTC_UNUSED_PARAM(inlen); + LTC_UNUSED_PARAM(prng); return CRYPT_OK; } From 171eae53786ea15f280ba5370d0ac21fdb24e4b1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 22 Aug 2014 13:12:38 +0200 Subject: [PATCH 0285/1192] asn1: use LTC_SET_ASN1 macro to access ltc_asn1_list elements --- src/pk/asn1/der/sequence/der_decode_sequence_multi.c | 4 +--- src/pk/asn1/der/sequence/der_encode_sequence_multi.c | 4 +--- .../der/sequence/der_encode_subject_public_key_info.c | 9 ++------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index da25827fb..84814172e 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -112,9 +112,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_CHOICE: - list[x].type = type; - list[x].size = size; - list[x++].data = data; + LTC_SET_ASN1(list, x++, type, data, size); break; default: diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index abd045706..618d59d6d 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -113,9 +113,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_RAW_BIT_STRING: - list[x].type = type; - list[x].size = size; - list[x++].data = data; + LTC_SET_ASN1(list, x++, type, data, size); break; default: diff --git a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c index 6c1442f18..681a53fb3 100644 --- a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c @@ -49,13 +49,8 @@ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen return err; } - alg_id[0].data = oid.OID; - alg_id[0].size = oid.OIDlen; - alg_id[0].type = LTC_ASN1_OBJECT_IDENTIFIER; - - alg_id[1].data = parameters; - alg_id[1].size = parameters_len; - alg_id[1].type = parameters_type; + LTC_SET_ASN1(alg_id, 0, LTC_ASN1_OBJECT_IDENTIFIER, oid.OID, oid.OIDlen); + LTC_SET_ASN1(alg_id, 1, parameters_type, parameters, parameters_len); return der_encode_sequence_multi(out, outlen, LTC_ASN1_SEQUENCE, (unsigned long)sizeof(alg_id)/sizeof(alg_id[0]), alg_id, From 678b6d9641f8595dad23b6e19488c6b50e39e5fa Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Fri, 22 Aug 2014 12:40:32 -0700 Subject: [PATCH 0286/1192] fix constructed type identifier check --- src/pk/asn1/der/sequence/der_decode_sequence_flexi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index 057370a9c..ef05847d5 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -65,7 +65,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc ltc_asn1_list *l; unsigned long err, type, len, totlen, x, y; void *realloc_tmp; - int isConstructed; + int is_constructed; LTC_ARGCHK(in != NULL); LTC_ARGCHK(inlen != NULL); @@ -103,7 +103,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc l = l->next; } - if ((isConstructed = ((type & 0xE0) == 0xA0 ? 1 : 0))) { + if ((is_constructed = ((type & 0x20) ? 1 : 0))) { /* constructed, use the 'used' field to store the original tag number */ l->used = (type & 0x1F); /* treat constructed elements like SETs */ @@ -332,7 +332,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc case 0x31: /* SET */ /* init field */ - l->type = (isConstructed ? LTC_ASN1_CONSTRUCTED : ((type == 0x30) ? LTC_ASN1_SEQUENCE : LTC_ASN1_SET)); + l->type = (is_constructed ? LTC_ASN1_CONSTRUCTED : ((type == 0x30) ? LTC_ASN1_SEQUENCE : LTC_ASN1_SET)); /* we have to decode the SEQUENCE header and get it's length */ From 3cdb64eca65a3eeaab1c6834cb9d86e1ee33d421 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Fri, 22 Aug 2014 12:44:03 -0700 Subject: [PATCH 0287/1192] bypass constructed type identification for sets / sequences --- src/pk/asn1/der/sequence/der_decode_sequence_flexi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index ef05847d5..c074448d2 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -103,7 +103,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc l = l->next; } - if ((is_constructed = ((type & 0x20) ? 1 : 0))) { + if ((is_constructed = (((type & 0x20) && type != 0x30 && type != 0x31) ? 1 : 0))) { /* constructed, use the 'used' field to store the original tag number */ l->used = (type & 0x1F); /* treat constructed elements like SETs */ From 800182338e0e9fa573c8b73f6199c237cce09525 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Aug 2014 20:19:51 +0200 Subject: [PATCH 0288/1192] unwind conditional expressions I prefer readability --- .../der/sequence/der_decode_sequence_flexi.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index c074448d2..8bd3b5d15 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -103,12 +103,16 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc l = l->next; } - if ((is_constructed = (((type & 0x20) && type != 0x30 && type != 0x31) ? 1 : 0))) { + if ((type & 0x20) && (type != 0x30) && (type != 0x31)) { + is_constructed = 1; /* constructed, use the 'used' field to store the original tag number */ l->used = (type & 0x1F); /* treat constructed elements like SETs */ type = 0x31; } + else { + is_constructed = 0; + } /* now switch on type */ switch (type) { @@ -332,7 +336,15 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc case 0x31: /* SET */ /* init field */ - l->type = (is_constructed ? LTC_ASN1_CONSTRUCTED : ((type == 0x30) ? LTC_ASN1_SEQUENCE : LTC_ASN1_SET)); + if (is_constructed) { + l->type = LTC_ASN1_CONSTRUCTED; + } + else if (type == 0x30) { + l->type = LTC_ASN1_SEQUENCE; + } + else { + l->type = LTC_ASN1_SET; + } /* we have to decode the SEQUENCE header and get it's length */ From 00c111b1c8c28d2af910f52d95b77af299bd2dc6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 24 Aug 2014 14:54:05 +0200 Subject: [PATCH 0289/1192] add missing types to decode routines --- src/pk/asn1/der/choice/der_decode_choice.c | 32 +++++++++++++++++++ .../der/sequence/der_decode_sequence_ex.c | 12 +++++++ .../der/sequence/der_decode_sequence_multi.c | 4 +++ 3 files changed, 48 insertions(+) diff --git a/src/pk/asn1/der/choice/der_decode_choice.c b/src/pk/asn1/der/choice/der_decode_choice.c index ebadc5fe3..46c314ce1 100644 --- a/src/pk/asn1/der/choice/der_decode_choice.c +++ b/src/pk/asn1/der/choice/der_decode_choice.c @@ -51,6 +51,16 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, data = list[x].data; switch (list[x].type) { + case LTC_ASN1_BOOLEAN: + if (der_decode_boolean(in, *inlen, data) == CRYPT_OK) { + if (der_length_boolean(&z) == CRYPT_OK) { + list[x].used = 1; + *inlen = z; + return CRYPT_OK; + } + } + break; + case LTC_ASN1_INTEGER: if (der_decode_integer(in, *inlen, data) == CRYPT_OK) { if (der_length_integer(data, &z) == CRYPT_OK) { @@ -82,6 +92,17 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, } break; + case LTC_ASN1_RAW_BIT_STRING: + if (der_decode_raw_bit_string(in, *inlen, data, &size) == CRYPT_OK) { + if (der_length_bit_string(size, &z) == CRYPT_OK) { + list[x].used = 1; + list[x].size = size; + *inlen = z; + return CRYPT_OK; + } + } + break; + case LTC_ASN1_OCTET_STRING: if (der_decode_octet_string(in, *inlen, data, &size) == CRYPT_OK) { if (der_length_octet_string(size, &z) == CRYPT_OK) { @@ -112,6 +133,17 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, } break; + case LTC_ASN1_TELETEX_STRING: + if (der_decode_teletex_string(in, *inlen, data, &size) == CRYPT_OK) { + if (der_length_teletex_string(data, size, &z) == CRYPT_OK) { + list[x].used = 1; + list[x].size = size; + *inlen = z; + return CRYPT_OK; + } + } + break; + case LTC_ASN1_IA5_STRING: if (der_decode_ia5_string(in, *inlen, data, &size) == CRYPT_OK) { if (der_length_ia5_string(data, size, &z) == CRYPT_OK) { diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 27d66141d..492504107 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -187,6 +187,18 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } break; + case LTC_ASN1_TELETEX_STRING: + z = inlen; + if ((err = der_decode_teletex_string(in + x, z, data, &size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + list[i].size = size; + if ((err = der_length_teletex_string(data, size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + case LTC_ASN1_IA5_STRING: z = inlen; if ((err = der_decode_ia5_string(in + x, z, data, &size)) != CRYPT_OK) { diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index 84814172e..b8f2b3f5e 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -64,6 +64,8 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_SETOF: case LTC_ASN1_SEQUENCE: case LTC_ASN1_CHOICE: + case LTC_ASN1_RAW_BIT_STRING: + case LTC_ASN1_TELETEX_STRING: ++x; break; @@ -112,6 +114,8 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_CHOICE: + case LTC_ASN1_RAW_BIT_STRING: + case LTC_ASN1_TELETEX_STRING: LTC_SET_ASN1(list, x++, type, data, size); break; From 6bba3a2a7065286f79787fc4c98a719707cd28fe Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 24 Aug 2014 15:00:32 +0200 Subject: [PATCH 0290/1192] change the ASN1 type to be a typedef replace all 'default' cases in the switch statements --- src/headers/tomcrypt_pk.h | 6 +++--- src/pk/asn1/der/choice/der_decode_choice.c | 4 +++- .../der/sequence/der_decode_sequence_ex.c | 6 ++++-- .../der/sequence/der_decode_sequence_multi.c | 19 +++++++++---------- .../der/sequence/der_encode_sequence_ex.c | 13 ++++++++++--- .../der/sequence/der_encode_sequence_multi.c | 17 ++++++++++++----- 6 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index ef0a5f9ff..3621140ae 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -435,7 +435,7 @@ int dsa_shared_secret(void *private_key, void *base, #ifdef LTC_DER /* DER handling */ -enum { +typedef enum ltc_asn1_type_ { LTC_ASN1_EOL, LTC_ASN1_BOOLEAN, LTC_ASN1_INTEGER, @@ -455,12 +455,12 @@ enum { LTC_ASN1_RAW_BIT_STRING, LTC_ASN1_TELETEX_STRING, LTC_ASN1_CONSTRUCTED, -}; +} ltc_asn1_type; /** A LTC ASN.1 list type */ typedef struct ltc_asn1_list_ { /** The LTC ASN.1 enumerated type identifier */ - int type; + ltc_asn1_type type; /** The data to encode or place for decoding */ void *data; /** The size of the input or resulting output */ diff --git a/src/pk/asn1/der/choice/der_decode_choice.c b/src/pk/asn1/der/choice/der_decode_choice.c index 46c314ce1..17aa105a6 100644 --- a/src/pk/asn1/der/choice/der_decode_choice.c +++ b/src/pk/asn1/der/choice/der_decode_choice.c @@ -198,7 +198,9 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, } break; - default: + case LTC_ASN1_CHOICE: + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_EOL: return CRYPT_INVALID_ARG; } } diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 492504107..b23364140 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -31,7 +31,8 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, ltc_asn1_list *list, unsigned long outlen, int ordered) { - int err, type, i; + int err, i; + ltc_asn1_type type; unsigned long size, x, y, z, blksize; void *data; @@ -282,7 +283,8 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } break; - default: + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_EOL: err = CRYPT_INVALID_ARG; goto LBL_ERR; } diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index b8f2b3f5e..21699381c 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -28,7 +28,8 @@ */ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) { - int err, type; + int err; + ltc_asn1_type type; unsigned long size, x; void *data; va_list args; @@ -40,7 +41,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) va_start(args, inlen); x = 0; for (;;) { - type = va_arg(args, int); + type = va_arg(args, ltc_asn1_type); size = va_arg(args, unsigned long); data = va_arg(args, void*); @@ -69,7 +70,8 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) ++x; break; - default: + case LTC_ASN1_EOL: + case LTC_ASN1_CONSTRUCTED: va_end(args); return CRYPT_INVALID_ARG; } @@ -90,7 +92,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) va_start(args, inlen); x = 0; for (;;) { - type = va_arg(args, int); + type = va_arg(args, ltc_asn1_type); size = va_arg(args, unsigned long); data = va_arg(args, void*); @@ -118,17 +120,14 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_TELETEX_STRING: LTC_SET_ASN1(list, x++, type, data, size); break; - - default: - va_end(args); - err = CRYPT_INVALID_ARG; - goto LBL_ERR; + case LTC_ASN1_EOL: + case LTC_ASN1_CONSTRUCTED: + break; } } va_end(args); err = der_decode_sequence(in, inlen, list, x); -LBL_ERR: XFREE(list); return err; } diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index e05484041..10f4dbe14 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -31,7 +31,8 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, unsigned char *out, unsigned long *outlen, int type_of) { - int err, type; + int err; + ltc_asn1_type type; unsigned long size, x, y, z, i; void *data; @@ -135,7 +136,10 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, y += x; break; - default: + case LTC_ASN1_CHOICE: + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_EOL: + case LTC_ASN1_TELETEX_STRING: err = CRYPT_INVALID_ARG; goto LBL_ERR; } @@ -330,7 +334,10 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, *outlen -= z; break; - default: + case LTC_ASN1_CHOICE: + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_EOL: + case LTC_ASN1_TELETEX_STRING: err = CRYPT_INVALID_ARG; goto LBL_ERR; } diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index 618d59d6d..da5d37176 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -28,7 +28,8 @@ */ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) { - int err, type; + int err; + ltc_asn1_type type; unsigned long size, x; void *data; va_list args; @@ -41,7 +42,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) va_start(args, outlen); x = 0; for (;;) { - type = va_arg(args, int); + type = va_arg(args, ltc_asn1_type); size = va_arg(args, unsigned long); data = va_arg(args, void*); @@ -68,7 +69,10 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) ++x; break; - default: + case LTC_ASN1_CHOICE: + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_EOL: + case LTC_ASN1_TELETEX_STRING: va_end(args); return CRYPT_INVALID_ARG; } @@ -89,7 +93,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) va_start(args, outlen); x = 0; for (;;) { - type = va_arg(args, int); + type = va_arg(args, ltc_asn1_type); size = va_arg(args, unsigned long); data = va_arg(args, void*); @@ -116,7 +120,10 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) LTC_SET_ASN1(list, x++, type, data, size); break; - default: + case LTC_ASN1_CHOICE: + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_EOL: + case LTC_ASN1_TELETEX_STRING: va_end(args); err = CRYPT_INVALID_ARG; goto LBL_ERR; From b06270645e5077b82db66cb173baf72d7bb38114 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 25 Aug 2014 20:09:44 +0200 Subject: [PATCH 0291/1192] add missing check of the OID --- .../sequence/der_decode_subject_public_key_info.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 74522f72a..b0f2f94ad 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -46,6 +46,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in LTC_ARGCHK(in != NULL); LTC_ARGCHK(inlen != 0); + LTC_ARGCHK(public_key_len != NULL); err = pk_get_oid(algorithm, &oid); if (err != CRYPT_OK) { @@ -63,8 +64,8 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in LTC_SET_ASN1(alg_id, 0, LTC_ASN1_OBJECT_IDENTIFIER, tmpoid, sizeof(tmpoid)/sizeof(tmpoid[0])); LTC_SET_ASN1(alg_id, 1, parameters_type, parameters, parameters_len); - /* the actual format of the SSL DER key is odd, it stores a RSAPublicKey in a **BIT** string ... so we have to extract it - then proceed to convert bit to octet + /* the actual format of the SSL DER key is odd, it stores a RSAPublicKey + * in a **BIT** string ... so we have to extract it then proceed to convert bit to octet */ LTC_SET_ASN1(subject_pubkey, 0, LTC_ASN1_SEQUENCE, alg_id, 2); LTC_SET_ASN1(subject_pubkey, 1, LTC_ASN1_RAW_BIT_STRING, tmpbuf, MAX_RSA_SIZE*8); @@ -74,6 +75,13 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in goto LBL_ERR; } + if ((alg_id[0].size != oid.OIDlen) || + memcmp(oid.OID, alg_id[0].data, oid.OIDlen * sizeof(oid.OID[0]))) { + /* OID mismatch */ + err = CRYPT_PK_INVALID_TYPE; + goto LBL_ERR; + } + len = subject_pubkey[1].size/8; if (*public_key_len > len) { memcpy(public_key, subject_pubkey[1].data, len); From ddede01d167989a584d11d6360362e2664f32540 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Aug 2014 17:38:45 +0200 Subject: [PATCH 0292/1192] trim trailing spaces --- src/pk/asn1/der/set/der_encode_set.c | 30 +++++++++---------- .../der_decode_teletex_string.c | 4 +-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/pk/asn1/der/set/der_encode_set.c b/src/pk/asn1/der/set/der_encode_set.c index a2d01287d..c303d0f94 100644 --- a/src/pk/asn1/der/set/der_encode_set.c +++ b/src/pk/asn1/der/set/der_encode_set.c @@ -44,9 +44,9 @@ static int qsort_helper(const void *a, const void *b) { ltc_asn1_list *A = (ltc_asn1_list *)a, *B = (ltc_asn1_list *)b; int r; - + r = ltc_to_asn1(A->type) - ltc_to_asn1(B->type); - + /* for QSORT the order is UNDEFINED if they are "equal" which means it is NOT DETERMINISTIC. So we force it to be :-) */ if (r == 0) { /* their order in the original list now determines the position */ @@ -54,13 +54,13 @@ static int qsort_helper(const void *a, const void *b) } else { return r; } -} +} /* Encode a SET type @param list The list of items to encode @param inlen The number of items in the list - @param out [out] The destination + @param out [out] The destination @param outlen [in/out] The size of the output @return CRYPT_OK on success */ @@ -70,30 +70,30 @@ int der_encode_set(ltc_asn1_list *list, unsigned long inlen, ltc_asn1_list *copy; unsigned long x; int err; - + /* make copy of list */ copy = XCALLOC(inlen, sizeof(*copy)); if (copy == NULL) { return CRYPT_MEM; - } - + } + /* fill in used member with index so we can fully sort it */ for (x = 0; x < inlen; x++) { copy[x] = list[x]; copy[x].used = x; - } - + } + /* sort it by the "type" field */ - XQSORT(copy, inlen, sizeof(*copy), &qsort_helper); - + XQSORT(copy, inlen, sizeof(*copy), &qsort_helper); + /* call der_encode_sequence_ex() */ - err = der_encode_sequence_ex(copy, inlen, out, outlen, LTC_ASN1_SET); - + err = der_encode_sequence_ex(copy, inlen, out, outlen, LTC_ASN1_SET); + /* free list */ XFREE(copy); - + return err; -} +} #endif diff --git a/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c b/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c index 2dfc5c7c4..b935745b0 100644 --- a/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c +++ b/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c @@ -40,7 +40,7 @@ int der_decode_teletex_string(const unsigned char *in, unsigned long inlen, return CRYPT_INVALID_PACKET; } - /* check for 0x13 */ + /* check for 0x14 */ if ((in[0] & 0x1F) != 0x14) { return CRYPT_INVALID_PACKET; } @@ -87,7 +87,7 @@ int der_decode_teletex_string(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } - + #endif /* $Source$ */ From 7a5ea10e606aaf0331a2c598f96963fea7794c03 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Aug 2014 17:40:26 +0200 Subject: [PATCH 0293/1192] add missing ASN1 types in der_encode_set() --- src/pk/asn1/der/set/der_encode_set.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pk/asn1/der/set/der_encode_set.c b/src/pk/asn1/der/set/der_encode_set.c index c303d0f94..fdf55f819 100644 --- a/src/pk/asn1/der/set/der_encode_set.c +++ b/src/pk/asn1/der/set/der_encode_set.c @@ -18,27 +18,32 @@ #ifdef LTC_DER /* LTC define to ASN.1 TAG */ -static int ltc_to_asn1(int v) +static int ltc_to_asn1(ltc_asn1_type v) { switch (v) { case LTC_ASN1_BOOLEAN: return 0x01; case LTC_ASN1_INTEGER: case LTC_ASN1_SHORT_INTEGER: return 0x02; + case LTC_ASN1_RAW_BIT_STRING: case LTC_ASN1_BIT_STRING: return 0x03; case LTC_ASN1_OCTET_STRING: return 0x04; case LTC_ASN1_NULL: return 0x05; case LTC_ASN1_OBJECT_IDENTIFIER: return 0x06; case LTC_ASN1_UTF8_STRING: return 0x0C; case LTC_ASN1_PRINTABLE_STRING: return 0x13; + case LTC_ASN1_TELETEX_STRING: return 0x14; case LTC_ASN1_IA5_STRING: return 0x16; case LTC_ASN1_UTCTIME: return 0x17; case LTC_ASN1_SEQUENCE: return 0x30; case LTC_ASN1_SET: case LTC_ASN1_SETOF: return 0x31; - default: return -1; + case LTC_ASN1_CHOICE: + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_EOL: return -1; } -} - + return -1; +} + static int qsort_helper(const void *a, const void *b) { From e5fb4d5ebe2bd359d4581791c65a5d8f37446138 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Aug 2014 13:24:53 +0200 Subject: [PATCH 0294/1192] use DO() macro when calling API functions in tests --- testprof/der_tests.c | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index a99f7c0d5..c75e3d3b6 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -22,7 +22,6 @@ static void der_set_test(void) unsigned char strs[10][10], outbuf[128]; unsigned long x, val, outlen; - int err; /* make structure and encode it */ LTC_SET_ASN1(list, 0, LTC_ASN1_OCTET_STRING, oct_str, sizeof(oct_str)); @@ -31,21 +30,14 @@ static void der_set_test(void) /* encode it */ outlen = sizeof(outbuf); - if ((err = der_encode_set(list, 3, outbuf, &outlen)) != CRYPT_OK) { - fprintf(stderr, "error encoding set: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - + DO(der_encode_set(list, 3, outbuf, &outlen)); /* first let's test the set_decoder out of order to see what happens, we should get all the fields we expect even though they're in a diff order */ LTC_SET_ASN1(list, 0, LTC_ASN1_BIT_STRING, strs[1], sizeof(strs[1])); LTC_SET_ASN1(list, 1, LTC_ASN1_SHORT_INTEGER, &val, 1); LTC_SET_ASN1(list, 2, LTC_ASN1_OCTET_STRING, strs[0], sizeof(strs[0])); - if ((err = der_decode_set(outbuf, outlen, list, 3)) != CRYPT_OK) { - fprintf(stderr, "error decoding set using der_decode_set: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } + DO(der_decode_set(outbuf, outlen, list, 3)); /* now compare the items */ if (memcmp(strs[0], oct_str, sizeof(oct_str))) { @@ -79,20 +71,14 @@ static void der_set_test(void) } outlen = sizeof(outbuf); - if ((err = der_encode_setof(list, 10, outbuf, &outlen)) != CRYPT_OK) { - fprintf(stderr, "error encoding SET OF: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } + DO(der_encode_setof(list, 10, outbuf, &outlen)); for (x = 0; x < 10; x++) { LTC_SET_ASN1(list, x, LTC_ASN1_PRINTABLE_STRING, strs[x], sizeof(strs[x]) - 1); } XMEMSET(strs, 0, sizeof(strs)); - if ((err = der_decode_set(outbuf, outlen, list, 10)) != CRYPT_OK) { - fprintf(stderr, "error decoding SET OF: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } + DO(der_decode_set(outbuf, outlen, list, 10)); /* now compare */ for (x = 1; x < 10; x++) { @@ -143,7 +129,6 @@ static void der_flexi_test(void) unsigned char encode_buf[192]; unsigned long encode_buf_len, decode_len; - int err; ltc_asn1_list static_list[5][3], *decoded_list, *l; @@ -169,10 +154,7 @@ static void der_flexi_test(void) /* encode it */ encode_buf_len = sizeof(encode_buf); - if ((err = der_encode_sequence(&static_list[0][0], 3, encode_buf, &encode_buf_len)) != CRYPT_OK) { - fprintf(stderr, "Encoding static_list: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } + DO(der_encode_sequence(&static_list[0][0], 3, encode_buf, &encode_buf_len)); #if 0 { @@ -185,10 +167,7 @@ static void der_flexi_test(void) /* decode with flexi */ decode_len = encode_buf_len; - if ((err = der_decode_sequence_flexi(encode_buf, &decode_len, &decoded_list)) != CRYPT_OK) { - fprintf(stderr, "decoding static_list: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } + DO(der_decode_sequence_flexi(encode_buf, &decode_len, &decoded_list)); if (decode_len != encode_buf_len) { fprintf(stderr, "Decode len of %lu does not match encode len of %lu \n", decode_len, encode_buf_len); From ee4c00b7537af303166dde527c6e1d71889dde23 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 31 Aug 2014 18:26:14 +0200 Subject: [PATCH 0295/1192] some more ASN.1 fixes these should have been in #49 --- src/headers/tomcrypt_pk.h | 2 +- .../asn1/der/sequence/der_length_sequence.c | 27 +++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 3621140ae..8f6a1314f 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -519,7 +519,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) /* FLEXI DECODER handle unknown list decoder */ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc_asn1_list **out); -void der_free_sequence_flexi(ltc_asn1_list *list); +#define der_free_sequence_flexi der_sequence_free void der_sequence_free(ltc_asn1_list *in); /* BOOLEAN */ diff --git a/src/pk/asn1/der/sequence/der_length_sequence.c b/src/pk/asn1/der/sequence/der_length_sequence.c index bd7b9387f..37882d04d 100644 --- a/src/pk/asn1/der/sequence/der_length_sequence.c +++ b/src/pk/asn1/der/sequence/der_length_sequence.c @@ -18,16 +18,17 @@ #ifdef LTC_DER /** - Get the length of a DER sequence + Get the length of a DER sequence @param list The sequences of items in the SEQUENCE @param inlen The number of items - @param outlen [out] The length required in octets to store it + @param outlen [out] The length required in octets to store it @return CRYPT_OK on success */ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, - unsigned long *outlen) + unsigned long *outlen) { - int err, type; + int err; + ltc_asn1_type type; unsigned long size, x, y, i; void *data; @@ -41,7 +42,7 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, size = list[i].size; data = list[i].data; - if (type == LTC_ASN1_EOL) { + if (type == LTC_ASN1_EOL) { break; } @@ -52,7 +53,7 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, } y += x; break; - + case LTC_ASN1_INTEGER: if ((err = der_length_integer(data, &x)) != CRYPT_OK) { goto LBL_ERR; @@ -68,6 +69,7 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, break; case LTC_ASN1_BIT_STRING: + case LTC_ASN1_RAW_BIT_STRING: if ((err = der_length_bit_string(size, &x)) != CRYPT_OK) { goto LBL_ERR; } @@ -99,6 +101,13 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, y += x; break; + case LTC_ASN1_TELETEX_STRING: + if ((err = der_length_teletex_string(data, size, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + case LTC_ASN1_PRINTABLE_STRING: if ((err = der_length_printable_string(data, size, &x)) != CRYPT_OK) { goto LBL_ERR; @@ -129,8 +138,10 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, y += x; break; - - default: + + case LTC_ASN1_CHOICE: + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_EOL: err = CRYPT_INVALID_ARG; goto LBL_ERR; } From fff4fd15c4bbda6fff0d5a8b27d9f66d000992d9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 18 Apr 2013 16:40:56 +0200 Subject: [PATCH 0296/1192] build.sh: improve diff parameters --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 579012200..228affff3 100755 --- a/build.sh +++ b/build.sh @@ -21,7 +21,7 @@ echo -n "testing..." if [ -a test ] && [ -f test ] && [ -x test ]; then ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1) if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then - for f in *_tv.txt; do if (diff --ignore-case $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done + for f in *_tv.txt; do if (diff -i -w -B $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done fi fi if [ -a testok.txt ] && [ -f testok.txt ]; then From 67b9cd8a9576268899479a72d82b2dcafd2224ed Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 Sep 2014 02:17:43 +0200 Subject: [PATCH 0297/1192] trim trailing spaces --- src/misc/crypt/crypt.c | 1 - src/pk/ecc/ecc_test.c | 2 +- src/pk/ecc/ltc_ecc_mulmod.c | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index a5fbbca9c..61f4f8452 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -393,7 +393,6 @@ const char *crypt_build_settings = " LTC_ECC_SHAMIR " #endif "\n" - "\n\n\n" ; diff --git a/src/pk/ecc/ecc_test.c b/src/pk/ecc/ecc_test.c index 873e70b06..e371da981 100644 --- a/src/pk/ecc/ecc_test.c +++ b/src/pk/ecc/ecc_test.c @@ -19,7 +19,7 @@ /** @file ecc_test.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC diff --git a/src/pk/ecc/ltc_ecc_mulmod.c b/src/pk/ecc/ltc_ecc_mulmod.c index 28eebdcfb..c3e7cc5a2 100644 --- a/src/pk/ecc/ltc_ecc_mulmod.c +++ b/src/pk/ecc/ltc_ecc_mulmod.c @@ -62,7 +62,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) mp_clear(mu); return err; } - + /* alloc ram for window temps */ for (i = 0; i < 8; i++) { M[i] = ltc_ecc_new_point(); @@ -92,7 +92,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) } mp_clear(mu); mu = NULL; - + /* calc the M tab, which holds kG for k==8..15 */ /* M[0] == 8G */ if ((err = ltc_mp.ecc_ptdbl(tG, M[0], modulus, mp)) != CRYPT_OK) { goto done; } From 1793072c674ad6e7110236188ef87ea1fc73a484 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 10 Sep 2014 16:08:49 +0200 Subject: [PATCH 0298/1192] fix CC parameter given to make in testprof folder --- makefile.mingw | 2 +- makefile.shared | 2 +- makefile.unix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 2893aa207..28da819c4 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -210,7 +210,7 @@ library: $(LIBNAME) .PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): - $(MAKE) -C testprof -f makefile.mingw CFLAGS_OPTS="$(CFLAGS)" LIBTEST_S=$(LIBTEST) CC=$(CC) LD=$(LD) AR=$(AR) ARFLAGS=$(ARFLAGS) RANLIB=$(RANLIB) + $(MAKE) -C testprof -f makefile.mingw CFLAGS_OPTS="$(CFLAGS)" LIBTEST_S=$(LIBTEST) CC="$(CC)" LD=$(LD) AR=$(AR) ARFLAGS="$(ARFLAGS)" RANLIB=$(RANLIB) $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) diff --git a/makefile.shared b/makefile.shared index f54ecb057..96adb41ca 100644 --- a/makefile.shared +++ b/makefile.shared @@ -263,7 +263,7 @@ library: $(LIBNAME) .PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC=$(CC) make -f makefile.shared + cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC="$(CC)" make -f makefile.shared .c.o: $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< diff --git a/makefile.unix b/makefile.unix index 91af9b1dc..83abbcea8 100644 --- a/makefile.unix +++ b/makefile.unix @@ -210,7 +210,7 @@ library: $(LIBNAME) .PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE) + cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE) $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) From f597f29ece2bc413ec0872164ff3e594f8ec8749 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 10 Sep 2014 16:15:35 +0200 Subject: [PATCH 0299/1192] math: change get_digit() return value unsigned long is 32bit wide when compiling with the compiler flag "-mx32" but the digit size of the math libraries is still 64 bit which lead to the buggy ecc code. Therefore define a new type ltc_mp_digit with the correct width and use that as return value of get_digit() Has been tested with all three math providers --- src/headers/tomcrypt_cfg.h | 5 +++++ src/headers/tomcrypt_math.h | 2 +- src/math/gmp_desc.c | 2 +- src/math/ltm_desc.c | 2 +- src/math/tfm_desc.c | 2 +- src/pk/ecc/ltc_ecc_mulmod.c | 2 +- src/pk/ecc/ltc_ecc_mulmod_timing.c | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index c34169434..ab4397864 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -122,6 +122,11 @@ typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; #endif #endif +#ifdef ENDIAN_64BITWORD +typedef ulong64 ltc_mp_digit; +#else +typedef ulong32 ltc_mp_digit; +#endif #ifdef LTC_NO_FAST #ifdef LTC_FAST diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index f4f397a3a..c605283e7 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -80,7 +80,7 @@ typedef struct { @param n The number of the digit to fetch @return The bits_per_digit sized n'th digit of a */ - unsigned long (*get_digit)(void *a, int n); + ltc_mp_digit (*get_digit)(void *a, int n); /** Get the number of digits that represent the number @param a The number to count diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index c6082d263..87098807e 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -74,7 +74,7 @@ static unsigned long get_int(void *a) return mpz_get_ui(a); } -static unsigned long get_digit(void *a, int n) +static ltc_mp_digit get_digit(void *a, int n) { LTC_ARGCHK(a != NULL); return mpz_getlimbn(a, n); diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index 3c00aaf57..5ff8ff842 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -100,7 +100,7 @@ static unsigned long get_int(void *a) return mp_get_int(a); } -static unsigned long get_digit(void *a, int n) +static ltc_mp_digit get_digit(void *a, int n) { mp_int *A; LTC_ARGCHK(a != NULL); diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index 693b9261b..df4c63cdf 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -99,7 +99,7 @@ static unsigned long get_int(void *a) return A->used > 0 ? A->dp[0] : 0; } -static unsigned long get_digit(void *a, int n) +static ltc_mp_digit get_digit(void *a, int n) { fp_int *A; LTC_ARGCHK(a != NULL); diff --git a/src/pk/ecc/ltc_ecc_mulmod.c b/src/pk/ecc/ltc_ecc_mulmod.c index c3e7cc5a2..a0ca6ceb7 100644 --- a/src/pk/ecc/ltc_ecc_mulmod.c +++ b/src/pk/ecc/ltc_ecc_mulmod.c @@ -41,7 +41,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) ecc_point *tG, *M[8]; int i, j, err; void *mu, *mp; - unsigned long buf; + ltc_mp_digit buf; int first, bitbuf, bitcpy, bitcnt, mode, digidx; LTC_ARGCHK(k != NULL); diff --git a/src/pk/ecc/ltc_ecc_mulmod_timing.c b/src/pk/ecc/ltc_ecc_mulmod_timing.c index 9e819c82e..ce4d9a41f 100644 --- a/src/pk/ecc/ltc_ecc_mulmod_timing.c +++ b/src/pk/ecc/ltc_ecc_mulmod_timing.c @@ -39,7 +39,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) ecc_point *tG, *M[3]; int i, j, err; void *mu, *mp; - unsigned long buf; + ltc_mp_digit buf; int bitcnt, mode, digidx; LTC_ARGCHK(k != NULL); From afaef3993cababa8fd0ad681353d970670e2858e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 10 Sep 2014 16:16:46 +0200 Subject: [PATCH 0300/1192] fix compiler warning when compiling with GMP_DESC --- src/math/gmp_desc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 87098807e..16c1d9060 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -430,6 +430,7 @@ static int montgomery_reduce(void *a, void *b, void *c) /* clean up */ static void montgomery_deinit(void *a) { + LTC_UNUSED_PARAM(a); } static int exptmod(void *a, void *b, void *c, void *d) From 2bb3f0246f65e77dcce56527a1101c824745a745 Mon Sep 17 00:00:00 2001 From: Pascal Brand Date: Thu, 18 Sep 2014 02:12:59 +0200 Subject: [PATCH 0301/1192] RSA in case CRT optimization parameters are not populated rsa_exptmod(), ran on the private key, makes use of CRT optimization parameters. In some use-cases, the given key does not include the optimization parameters. This patch allows rsa_exptmod() to run without the CRT parameters, using directly mp_exptmod(). Signed-off-by: Pascal Brand --- src/pk/rsa/rsa_exptmod.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 5b5036734..b9f887020 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -100,19 +100,32 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, } #endif /* LTC_RSA_BLINDING */ - /* tmpa = tmp^dP mod p */ - if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto error; } - - /* tmpb = tmp^dQ mod q */ - if ((err = mp_exptmod(tmp, key->dQ, key->q, tmpb)) != CRYPT_OK) { goto error; } - - /* tmp = (tmpa - tmpb) * qInv (mod p) */ - if ((err = mp_sub(tmpa, tmpb, tmp)) != CRYPT_OK) { goto error; } - if ((err = mp_mulmod(tmp, key->qP, key->p, tmp)) != CRYPT_OK) { goto error; } - - /* tmp = tmpb + q * tmp */ - if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { goto error; } - if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { goto error; } + if (key->dP == NULL) { + /* + * In case CRT optimization parameters are provided, + * the private key is directly used + */ + LTC_ARGCHK(key->dQ == NULL); + LTC_ARGCHK(key->qP == NULL); + LTC_ARGCHK(key->p == NULL); + LTC_ARGCHK(key->q == NULL); + /* exptmod it */ + if ((err = mp_exptmod(tmp, key->d, key->N, tmp)) != CRYPT_OK) { goto error; } + } else { + /* tmpa = tmp^dP mod p */ + if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto error; } + + /* tmpb = tmp^dQ mod q */ + if ((err = mp_exptmod(tmp, key->dQ, key->q, tmpb)) != CRYPT_OK) { goto error; } + + /* tmp = (tmpa - tmpb) * qInv (mod p) */ + if ((err = mp_sub(tmpa, tmpb, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_mulmod(tmp, key->qP, key->p, tmp)) != CRYPT_OK) { goto error; } + + /* tmp = tmpb + q * tmp */ + if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { goto error; } + } #ifdef LTC_RSA_BLINDING /* unblind */ From a6e89d58d4fbb89a770be0e94f482bd7f4416b14 Mon Sep 17 00:00:00 2001 From: Pascal Brand Date: Thu, 18 Sep 2014 20:45:42 +0200 Subject: [PATCH 0302/1192] RSA in CRT optimization parameters are empty --- src/pk/rsa/rsa_exptmod.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index b9f887020..dcb036e7d 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -100,16 +100,11 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, } #endif /* LTC_RSA_BLINDING */ - if (key->dP == NULL) { + if ((key->dP == NULL) || (mp_get_digit_count(key->dP) == 0)) { /* - * In case CRT optimization parameters are provided, - * the private key is directly used + * In case CRT optimization parameters are not provided, + * the private key is directly used to exptmod it */ - LTC_ARGCHK(key->dQ == NULL); - LTC_ARGCHK(key->qP == NULL); - LTC_ARGCHK(key->p == NULL); - LTC_ARGCHK(key->q == NULL); - /* exptmod it */ if ((err = mp_exptmod(tmp, key->d, key->N, tmp)) != CRYPT_OK) { goto error; } } else { /* tmpa = tmp^dP mod p */ From 94363b601c66a006b29e800696205f3675c207a0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 28 Sep 2014 22:52:32 +0200 Subject: [PATCH 0303/1192] add testcase to verify that this patch is working --- testprof/rsa_test.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index ae27ec106..7e7e45cd3 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -291,6 +291,26 @@ for (cnt = 0; cnt < len; ) { return 1; } + /* verify with privKey but remove pointer to dP to test without CRT */ + + void* dP = privKey.dP; + privKey.dP = NULL; + /* change byte back to original */ + in[0] ^= 1; + DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat, &privKey)); + /* change a byte */ + in[0] ^= 1; + DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &privKey)); + + if (!(stat == 1 && stat2 == 0)) { + fprintf(stderr, "rsa_verify_hash (unsalted, privKey) failed, %d, %d", stat, stat2); + rsa_free(&key); + rsa_free(&pubKey); + rsa_free(&privKey); + return 1; + } + privKey.dP = dP; + /* verify with pubKey */ /* change byte back to original */ in[0] ^= 1; From adc54d08d0bef13f6baaa5e7f7204ecc569761b2 Mon Sep 17 00:00:00 2001 From: Pascal Brand Date: Thu, 18 Sep 2014 01:42:54 +0200 Subject: [PATCH 0304/1192] Enable multiple XTS encryption or decryption multiple xts_encrypt() cannot be performed because the tweak is not updated. That means that xts_encrypt(buffer1, tweak) xts_encrypt(buffer2, tweak) is not the same as xts_encrypt(concat(buffer1, buffer2), tweak) Current patch enables such functionalities by updating the tweak as output of the encryption. Note that the tweak is no more constant. The very same modification is performed on xts_decrypt() Signed-off-by: Pascal Brand --- src/headers/tomcrypt_cipher.h | 4 ++-- src/modes/xts/xts_decrypt.c | 7 ++++++- src/modes/xts/xts_encrypt.c | 7 ++++++- src/modes/xts/xts_test.c | 8 +++++--- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index a7142a0e0..edf25c049 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -884,12 +884,12 @@ int xts_start( int cipher, int xts_encrypt( const unsigned char *pt, unsigned long ptlen, unsigned char *ct, - const unsigned char *tweak, + unsigned char *tweak, symmetric_xts *xts); int xts_decrypt( const unsigned char *ct, unsigned long ptlen, unsigned char *pt, - const unsigned char *tweak, + unsigned char *tweak, symmetric_xts *xts); void xts_done(symmetric_xts *xts); diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index 3e46c535b..f73770de5 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -60,7 +60,7 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char */int xts_decrypt( const unsigned char *ct, unsigned long ptlen, unsigned char *pt, - const unsigned char *tweak, + unsigned char *tweak, symmetric_xts *xts) { unsigned char PP[16], CC[16], T[16]; @@ -130,6 +130,11 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char } } + /* Decrypt the tweak back */ + if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) { + return err; + } + return CRYPT_OK; } diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index ab53d3c99..6474b13d6 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -63,7 +63,7 @@ static int tweak_crypt(const unsigned char *P, unsigned char *C, unsigned char * int xts_encrypt( const unsigned char *pt, unsigned long ptlen, unsigned char *ct, - const unsigned char *tweak, + unsigned char *tweak, symmetric_xts *xts) { unsigned char PP[16], CC[16], T[16]; @@ -131,6 +131,11 @@ int xts_encrypt( } } + /* Decrypt the tweak back */ + if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) { + return err; + } + return err; } diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index b91e0f419..2973f0a5a 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -142,7 +142,7 @@ int xts_test(void) }, }; - unsigned char OUT[512], T[16]; + unsigned char OUT[512], Torg[16], T[16]; ulong64 seq; symmetric_xts xts; int i, err, idx; @@ -161,9 +161,10 @@ int xts_test(void) } seq = tests[i].seqnum; - STORE64L(seq,T); - XMEMSET(T+8, 0, 8); + STORE64L(seq,Torg); + XMEMSET(Torg+8, 0, 8); + XMEMCPY(T, Torg, sizeof(T)); err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); if (err != CRYPT_OK) { xts_done(&xts); @@ -175,6 +176,7 @@ int xts_test(void) return CRYPT_FAIL_TESTVECTOR; } + XMEMCPY(T, Torg, sizeof(T)); err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); if (err != CRYPT_OK) { xts_done(&xts); From 3d905ca17826f5ef4bcbd1a95e571636d797f2da Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 29 Sep 2014 19:47:18 +0200 Subject: [PATCH 0305/1192] add testcase for multiple XTS encryption/decryption --- src/modes/xts/xts_test.c | 131 ++++++++++++++++++++++++++++----------- 1 file changed, 94 insertions(+), 37 deletions(-) diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index 2973f0a5a..89f00b746 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -12,7 +12,11 @@ #ifdef LTC_XTS_MODE -/** +#if defined(LTC_XTS_TEST_DBG) && !defined(LTC_NO_TEST) +void print_hex(const char* what, const unsigned char* p, const unsigned long l); +#endif + +/** Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects Returns CRYPT_OK upon success. */ @@ -145,49 +149,102 @@ int xts_test(void) unsigned char OUT[512], Torg[16], T[16]; ulong64 seq; symmetric_xts xts; - int i, err, idx; + int i, j, err, idx; + unsigned long len; - /* AES can be under rijndael or aes... try to find it */ + /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { if ((idx = find_cipher("rijndael")) == -1) { return CRYPT_NOP; } } - for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { - err = xts_start(idx, tests[i].key1, tests[i].key2, tests[i].keylen/2, 0, &xts); - if (err != CRYPT_OK) { - return err; - } - - seq = tests[i].seqnum; - STORE64L(seq,Torg); - XMEMSET(Torg+8, 0, 8); - - XMEMCPY(T, Torg, sizeof(T)); - err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; - } - - if (XMEMCMP(OUT, tests[i].CTX, tests[i].PTLEN)) { - xts_done(&xts); - return CRYPT_FAIL_TESTVECTOR; - } - - XMEMCPY(T, Torg, sizeof(T)); - err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; - } - - if (XMEMCMP(OUT, tests[i].PTX, tests[i].PTLEN)) { - xts_done(&xts); - return CRYPT_FAIL_TESTVECTOR; - } - xts_done(&xts); + for (j = 0; j < 2; j++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { + /* skip the cases where + * the length is smaller than 2*blocklen + * or the length is not a multiple of 32 + */ + if ((j == 1) && ((tests[i].PTLEN < 32) || (tests[i].PTLEN % 32))) { + continue; + } + len = tests[i].PTLEN/2; + + err = xts_start(idx, tests[i].key1, tests[i].key2, tests[i].keylen/2, 0, &xts); + if (err != CRYPT_OK) { + return err; + } + + seq = tests[i].seqnum; + STORE64L(seq,Torg); + XMEMSET(Torg+8, 0, 8); + + XMEMCPY(T, Torg, sizeof(T)); + if (j == 0) { + err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + } + else { +#ifdef LTC_XTS_TEST_DBG + printf("\nTestcase #%d with original length %lu and half of it %lu\n", i, tests[i].PTLEN, len); +#endif + err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + err = xts_encrypt(&tests[i].PTX[len], len, &OUT[len], T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + } + + if (XMEMCMP(OUT, tests[i].CTX, tests[i].PTLEN)) { +#ifdef LTC_XTS_TEST_DBG + printf("\nencrypt\n"); + print_hex("should", tests[i].CTX, tests[i].PTLEN); + print_hex("is", OUT, tests[i].PTLEN); +#endif + xts_done(&xts); + return CRYPT_FAIL_TESTVECTOR; + } + + XMEMCPY(T, Torg, sizeof(T)); + if (j == 0) { + err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + } + else { + err = xts_decrypt(tests[i].CTX, len, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + err = xts_decrypt(&tests[i].CTX[len], len, &OUT[len], T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + } + + if (XMEMCMP(OUT, tests[i].PTX, tests[i].PTLEN)) { +#ifdef LTC_XTS_TEST_DBG + printf("\ndecrypt\n"); + print_hex("should", tests[i].PTX, tests[i].PTLEN); + print_hex("is", OUT, tests[i].PTLEN); +#endif + xts_done(&xts); + return CRYPT_FAIL_TESTVECTOR; + } + xts_done(&xts); + } } return CRYPT_OK; #endif From 23fb224e199ad5708bea80aaa33865afc98d712b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Aug 2014 18:17:51 +0200 Subject: [PATCH 0306/1192] add sha512/224 and sha512/256 --- src/hashes/sha2/sha512_224.c | 132 ++++++++++++++++++++++++++++++++++ src/hashes/sha2/sha512_256.c | 132 ++++++++++++++++++++++++++++++++++ src/headers/tomcrypt_custom.h | 2 + src/headers/tomcrypt_hash.h | 22 ++++++ 4 files changed, 288 insertions(+) create mode 100644 src/hashes/sha2/sha512_224.c create mode 100644 src/hashes/sha2/sha512_256.c diff --git a/src/hashes/sha2/sha512_224.c b/src/hashes/sha2/sha512_224.c new file mode 100644 index 000000000..98fba3ae1 --- /dev/null +++ b/src/hashes/sha2/sha512_224.c @@ -0,0 +1,132 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +/** + @param sha512_224.c + SHA512/224 hash included in sha512.c +*/ + +#include "tomcrypt.h" + +#if defined(LTC_SHA512_224) && defined(LTC_SHA512) + +const struct ltc_hash_descriptor sha512_224_desc = +{ + "sha512-224", + 15, + 28, + 128, + + /* OID */ + { 2, 16, 840, 1, 101, 3, 4, 2, 5, }, + 9, + + &sha512_224_init, + &sha512_process, + &sha512_224_done, + &sha512_224_test, + NULL +}; + +/** + Initialize the hash state + @param md The hash state you wish to initialize + @return CRYPT_OK if successful +*/ +int sha512_224_init(hash_state * md) +{ + LTC_ARGCHK(md != NULL); + + md->sha512.curlen = 0; + md->sha512.length = 0; + md->sha512.state[0] = CONST64(0x8C3D37C819544DA2); + md->sha512.state[1] = CONST64(0x73E1996689DCD4D6); + md->sha512.state[2] = CONST64(0x1DFAB7AE32FF9C82); + md->sha512.state[3] = CONST64(0x679DD514582F9FCF); + md->sha512.state[4] = CONST64(0x0F6D2B697BD44DA8); + md->sha512.state[5] = CONST64(0x77E36F7304C48942); + md->sha512.state[6] = CONST64(0x3F9D85A86A1D36C8); + md->sha512.state[7] = CONST64(0x1112E6AD91D692A1); + return CRYPT_OK; +} + +/** + Terminate the hash to get the digest + @param md The hash state + @param out [out] The destination of the hash (48 bytes) + @return CRYPT_OK if successful +*/ +int sha512_224_done(hash_state * md, unsigned char *out) +{ + unsigned char buf[64]; + + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(out != NULL); + + if (md->sha512.curlen >= sizeof(md->sha512.buf)) { + return CRYPT_INVALID_ARG; + } + + sha512_done(md, buf); + XMEMCPY(out, buf, 28); +#ifdef LTC_CLEAN_STACK + zeromem(buf, sizeof(buf)); +#endif + return CRYPT_OK; +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int sha512_224_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + static const struct { + char *msg; + unsigned char hash[28]; + } tests[] = { + { "abc", + { 0x46, 0x34, 0x27, 0x0F, 0x70, 0x7B, 0x6A, 0x54, + 0xDA, 0xAE, 0x75, 0x30, 0x46, 0x08, 0x42, 0xE2, + 0x0E, 0x37, 0xED, 0x26, 0x5C, 0xEE, 0xE9, 0xA4, + 0x3E, 0x89, 0x24, 0xAA } + }, + { "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", + { 0x23, 0xFE, 0xC5, 0xBB, 0x94, 0xD6, 0x0B, 0x23, + 0x30, 0x81, 0x92, 0x64, 0x0B, 0x0C, 0x45, 0x33, + 0x35, 0xD6, 0x64, 0x73, 0x4F, 0xE4, 0x0E, 0x72, + 0x68, 0x67, 0x4A, 0xF9 } + }, + }; + + int i; + unsigned char tmp[28]; + hash_state md; + + for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { + sha512_224_init(&md); + sha512_224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + sha512_224_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 28) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; + #endif +} + +#endif /* defined(LTC_SHA384) && defined(LTC_SHA512) */ + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/hashes/sha2/sha512_256.c b/src/hashes/sha2/sha512_256.c new file mode 100644 index 000000000..86e4bac47 --- /dev/null +++ b/src/hashes/sha2/sha512_256.c @@ -0,0 +1,132 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +/** + @param sha512_256.c + SHA512/256 hash included in sha512.c +*/ + +#include "tomcrypt.h" + +#if defined(LTC_SHA512_256) && defined(LTC_SHA512) + +const struct ltc_hash_descriptor sha512_256_desc = +{ + "sha512-256", + 16, + 32, + 128, + + /* OID */ + { 2, 16, 840, 1, 101, 3, 4, 2, 6, }, + 9, + + &sha512_256_init, + &sha512_process, + &sha512_256_done, + &sha512_256_test, + NULL +}; + +/** + Initialize the hash state + @param md The hash state you wish to initialize + @return CRYPT_OK if successful +*/ +int sha512_256_init(hash_state * md) +{ + LTC_ARGCHK(md != NULL); + + md->sha512.curlen = 0; + md->sha512.length = 0; + md->sha512.state[0] = CONST64(0x22312194FC2BF72C); + md->sha512.state[1] = CONST64(0x9F555FA3C84C64C2); + md->sha512.state[2] = CONST64(0x2393B86B6F53B151); + md->sha512.state[3] = CONST64(0x963877195940EABD); + md->sha512.state[4] = CONST64(0x96283EE2A88EFFE3); + md->sha512.state[5] = CONST64(0xBE5E1E2553863992); + md->sha512.state[6] = CONST64(0x2B0199FC2C85B8AA); + md->sha512.state[7] = CONST64(0x0EB72DDC81C52CA2); + return CRYPT_OK; +} + +/** + Terminate the hash to get the digest + @param md The hash state + @param out [out] The destination of the hash (48 bytes) + @return CRYPT_OK if successful +*/ +int sha512_256_done(hash_state * md, unsigned char *out) +{ + unsigned char buf[64]; + + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(out != NULL); + + if (md->sha512.curlen >= sizeof(md->sha512.buf)) { + return CRYPT_INVALID_ARG; + } + + sha512_done(md, buf); + XMEMCPY(out, buf, 32); +#ifdef LTC_CLEAN_STACK + zeromem(buf, sizeof(buf)); +#endif + return CRYPT_OK; +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int sha512_256_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + static const struct { + char *msg; + unsigned char hash[32]; + } tests[] = { + { "abc", + { 0x53, 0x04, 0x8E, 0x26, 0x81, 0x94, 0x1E, 0xF9, + 0x9B, 0x2E, 0x29, 0xB7, 0x6B, 0x4C, 0x7D, 0xAB, + 0xE4, 0xC2, 0xD0, 0xC6, 0x34, 0xFC, 0x6D, 0x46, + 0xE0, 0xE2, 0xF1, 0x31, 0x07, 0xE7, 0xAF, 0x23 } + }, + { "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", + { 0x39, 0x28, 0xE1, 0x84, 0xFB, 0x86, 0x90, 0xF8, + 0x40, 0xDA, 0x39, 0x88, 0x12, 0x1D, 0x31, 0xBE, + 0x65, 0xCB, 0x9D, 0x3E, 0xF8, 0x3E, 0xE6, 0x14, + 0x6F, 0xEA, 0xC8, 0x61, 0xE1, 0x9B, 0x56, 0x3A } + }, + }; + + int i; + unsigned char tmp[32]; + hash_state md; + + for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { + sha512_256_init(&md); + sha512_256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + sha512_256_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; + #endif +} + +#endif /* defined(LTC_SHA384) && defined(LTC_SHA512) */ + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 025fb8101..d271f8a61 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -226,6 +226,8 @@ #define LTC_CHC_HASH #define LTC_WHIRLPOOL #define LTC_SHA512 +#define LTC_SHA512_256 +#define LTC_SHA512_224 #define LTC_SHA384 #define LTC_SHA256 #define LTC_SHA224 diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index e750cb843..3129958ac 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -227,6 +227,28 @@ int sha384_test(void); extern const struct ltc_hash_descriptor sha384_desc; #endif +#ifdef LTC_SHA512_256 +#ifndef LTC_SHA512 + #error LTC_SHA512 is required for LTC_SHA512_256 +#endif +int sha512_256_init(hash_state * md); +#define sha512_256_process sha512_process +int sha512_256_done(hash_state * md, unsigned char *hash); +int sha512_256_test(void); +extern const struct ltc_hash_descriptor sha512_256_desc; +#endif + +#ifdef LTC_SHA512_224 +#ifndef LTC_SHA512 + #error LTC_SHA512 is required for LTC_SHA512_224 +#endif +int sha512_224_init(hash_state * md); +#define sha512_224_process sha512_process +int sha512_224_done(hash_state * md, unsigned char *hash); +int sha512_224_test(void); +extern const struct ltc_hash_descriptor sha512_224_desc; +#endif + #ifdef LTC_SHA256 int sha256_init(hash_state * md); int sha256_process(hash_state * md, const unsigned char *in, unsigned long inlen); From c58e2cae75f20f0928b678ba12b5b4e3fec2cddc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Aug 2014 18:21:24 +0200 Subject: [PATCH 0307/1192] add special build rules for sha512/224 and sha512/256 --- makefile | 2 ++ makefile.icc | 2 ++ makefile.mingw | 2 ++ makefile.shared | 2 ++ makefile.unix | 2 ++ 5 files changed, 10 insertions(+) diff --git a/makefile b/makefile index ebfee4eea..409553c83 100644 --- a/makefile +++ b/makefile @@ -280,6 +280,8 @@ src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c +src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c +src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. diff --git a/makefile.icc b/makefile.icc index 23ef4a30f..87f3c22bf 100644 --- a/makefile.icc +++ b/makefile.icc @@ -268,6 +268,8 @@ src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c +src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c +src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. diff --git a/makefile.mingw b/makefile.mingw index 28da819c4..4ca9e9381 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -203,6 +203,8 @@ src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c +src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c +src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. diff --git a/makefile.shared b/makefile.shared index 96adb41ca..b37c0ed68 100644 --- a/makefile.shared +++ b/makefile.shared @@ -256,6 +256,8 @@ src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c +src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c +src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. diff --git a/makefile.unix b/makefile.unix index 83abbcea8..a81c67906 100644 --- a/makefile.unix +++ b/makefile.unix @@ -203,6 +203,8 @@ src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c +src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c +src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. From 06321b8602b52e56778e17fd51a64620b9a969fe Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Aug 2014 18:21:46 +0200 Subject: [PATCH 0308/1192] update makefiles --- makefile | 54 ++++++++++++++++++++++++------------------------- makefile.icc | 54 ++++++++++++++++++++++++------------------------- makefile.mingw | 54 ++++++++++++++++++++++++------------------------- makefile.msvc | 54 ++++++++++++++++++++++++------------------------- makefile.shared | 54 ++++++++++++++++++++++++------------------------- makefile.unix | 54 ++++++++++++++++++++++++------------------------- 6 files changed, 162 insertions(+), 162 deletions(-) diff --git a/makefile b/makefile index 409553c83..6cd433a16 100644 --- a/makefile +++ b/makefile @@ -142,33 +142,33 @@ src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ -src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ -src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ -src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ +src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ +src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ +src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ +src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ +src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ +src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ +src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ +src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ diff --git a/makefile.icc b/makefile.icc index 87f3c22bf..fb9798e43 100644 --- a/makefile.icc +++ b/makefile.icc @@ -125,33 +125,33 @@ src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ -src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ -src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ -src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ +src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ +src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ +src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ +src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ +src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ +src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ +src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ +src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ diff --git a/makefile.mingw b/makefile.mingw index 4ca9e9381..3e3a52a6c 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -72,33 +72,33 @@ src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ -src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ -src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ -src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ +src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ +src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ +src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ +src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ +src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ +src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ +src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ +src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ diff --git a/makefile.msvc b/makefile.msvc index aabe8eb6c..d720cf418 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -30,33 +30,33 @@ src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj src/hashes/chc/chc.o src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \ src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \ src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \ -src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj src/hashes/sha2/sha512.obj \ -src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj \ -src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj \ -src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj \ -src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj \ -src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj \ -src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj \ -src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj src/mac/pelican/pelican_memory.obj \ -src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj src/mac/pmac/pmac_file.obj \ -src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj src/mac/pmac/pmac_memory_multi.obj \ -src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj src/mac/pmac/pmac_shift_xor.obj \ -src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj \ -src/mac/xcbc/xcbc_memory.obj src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj \ -src/mac/xcbc/xcbc_test.obj src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj \ -src/math/multi.obj src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj \ -src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj \ -src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj \ -src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_constants.obj \ -src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher.obj \ -src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash_any.obj \ -src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_id.obj \ -src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ -src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ -src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ -src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ -src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ -src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj src/hashes/sha2/sha512_224.obj \ +src/hashes/sha2/sha512_256.obj src/hashes/sha2/sha512.obj src/hashes/tiger.obj src/hashes/whirl/whirl.obj \ +src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj \ +src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj \ +src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj \ +src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj \ +src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj \ +src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj \ +src/mac/pelican/pelican.obj src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj \ +src/mac/pmac/pmac_done.obj src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ +src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \ +src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj \ +src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \ +src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \ +src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ +src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/base64/base64_decode.obj \ +src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crypt/crypt_argchk.obj \ +src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \ +src/misc/crypt/crypt_constants.obj src/misc/crypt/crypt_find_cipher_any.obj \ +src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_id.obj \ +src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash.obj \ +src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ +src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ +src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_inits.obj \ +src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \ +src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_register_cipher.obj \ +src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ src/misc/hkdf/hkdf_test.obj src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj \ diff --git a/makefile.shared b/makefile.shared index b37c0ed68..82d7e064e 100644 --- a/makefile.shared +++ b/makefile.shared @@ -127,33 +127,33 @@ src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ -src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ -src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ -src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ +src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ +src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ +src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ +src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ +src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ +src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ +src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ +src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ diff --git a/makefile.unix b/makefile.unix index a81c67906..a86cb32b0 100644 --- a/makefile.unix +++ b/makefile.unix @@ -66,33 +66,33 @@ src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o \ -src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o \ -src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o \ -src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ +src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ +src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ +src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ +src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ +src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ +src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ +src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ +src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ +src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ From 1924e6fd4746adb18c19263e6c3ca1f7773aad13 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 27 Aug 2014 14:38:56 +0200 Subject: [PATCH 0309/1192] add sha512/224 and sha512/256 to tests and crypt_build_settings --- src/misc/crypt/crypt.c | 6 ++++++ testprof/x86_prof.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 61f4f8452..c505ed4ab 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -130,9 +130,15 @@ const char *crypt_build_settings = #if defined(LTC_SHA384) " SHA-384\n" #endif +#if defined(LTC_SHA512_256) + " SHA-512/256\n" +#endif #if defined(LTC_SHA256) " SHA-256\n" #endif +#if defined(LTC_SHA512_224) + " SHA-512/224\n" +#endif #if defined(LTC_SHA224) " SHA-224\n" #endif diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 9ade6b3da..2227597a7 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -226,6 +226,12 @@ static void _unregister_all(void) #ifdef LTC_SHA512 unregister_hash(&sha512_desc); #endif +#ifdef LTC_SHA512_224 + unregister_hash(&sha512_224_desc); +#endif +#ifdef LTC_SHA512_256 + unregister_hash(&sha512_256_desc); +#endif #ifdef LTC_RIPEMD128 unregister_hash(&rmd128_desc); #endif @@ -352,6 +358,12 @@ void reg_algs(void) #ifdef LTC_SHA512 register_hash (&sha512_desc); #endif +#ifdef LTC_SHA512_224 + register_hash (&sha512_224_desc); +#endif +#ifdef LTC_SHA512_256 + register_hash (&sha512_256_desc); +#endif #ifdef LTC_RIPEMD128 register_hash (&rmd128_desc); #endif From 7842e338bfa6a13ac6affd3e7b33a84e2a3267d1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 29 Sep 2014 23:30:02 +0200 Subject: [PATCH 0310/1192] fix API of dynamic language helpers it is easier to handle 'int' than 'long' in the foreign language --- src/headers/tomcrypt_misc.h | 6 +++--- src/misc/crypt/crypt_constants.c | 10 +++++----- src/misc/crypt/crypt_sizes.c | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 503447c38..ad23c3914 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -51,10 +51,10 @@ int crypt_fsa(void *mp, ...); /* ---- Dynamic language support ---- */ int crypt_get_constant(const char* namein, int *valueout); -int crypt_list_all_constants(char *names_list, unsigned long *names_list_size); +int crypt_list_all_constants(char *names_list, unsigned int *names_list_size); -int crypt_get_size(const char* namein, int *sizeout); -int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size); +int crypt_get_size(const char* namein, unsigned int *sizeout); +int crypt_list_all_sizes(char *names_list, unsigned int *names_list_size); #ifdef LTM_DESC void init_LTM(void); diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index b0af4ddb3..03755b06f 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -22,7 +22,7 @@ typedef struct { const char *name; - const long value; + const int value; } crypt_constant; #define _C_STRINGIFY(s) { #s, s } @@ -179,9 +179,9 @@ int crypt_get_constant(const char* namein, int *valueout) { * written. * a -1 return value signifies insufficient space made available */ -int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { +int crypt_list_all_constants(char *names_list, unsigned int *names_list_size) { int i; - unsigned long total_len = 0; + unsigned int total_len = 0; char number[32]; int number_len; int count = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); @@ -190,7 +190,7 @@ int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { for (i=0; i= sizeof(number))) return -1; @@ -212,7 +212,7 @@ int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { strcpy(ptr, ","); ptr += 1; - number_len = snprintf(number, sizeof(number), "%ld", _crypt_constants[i].value); + number_len = snprintf(number, sizeof(number), "%d", _crypt_constants[i].value); strcpy(ptr, number); ptr += number_len; strcpy(ptr, "\n"); diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index c758dbe1a..187013048 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -22,7 +22,7 @@ typedef struct { const char *name; - const long size; + const unsigned int size; } crypt_size; #define _SZ_STRINGIFY_S(s) { #s, sizeof(struct s) } @@ -237,7 +237,7 @@ static const crypt_size _crypt_sizes[] = { * sizeout will be the size (bytes) of the named struct or union * return -1 if named item not found */ -int crypt_get_size(const char* namein, int *sizeout) { +int crypt_get_size(const char* namein, unsigned int *sizeout) { int i; int count = sizeof(_crypt_sizes) / sizeof(_crypt_sizes[0]); for (i=0; i= sizeof(number))) return -1; @@ -292,7 +292,7 @@ int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size) { strcpy(ptr, ","); ptr += 1; - number_len = snprintf(number, sizeof(number), "%ld", _crypt_sizes[i].size); + number_len = snprintf(number, sizeof(number), "%u", _crypt_sizes[i].size); strcpy(ptr, number); ptr += number_len; strcpy(ptr, "\n"); From b1f29539bef6c801212897143438cd507c3fcb21 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Aug 2014 18:06:15 +0200 Subject: [PATCH 0311/1192] Revert "removed testing of "stripped" rsa key" This reverts commit 496453f28920c6f5d657173ed8028d3a73fd5115. --- testprof/rsa_test.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 7e7e45cd3..da1e491bd 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -61,6 +61,18 @@ static const unsigned char openssl_public_rsa[] = { 0x60, 0x3f, 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x94, 0xa4, 0x44, 0xfd, 0x02, 0x03, 0x01, 0x00, 0x01, }; +/* same key but with extra headers stripped */ +static const unsigned char openssl_public_rsa_stripped[] = { + 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xcf, 0x9a, 0xde, + 0x64, 0x8a, 0xda, 0xc8, 0x33, 0x20, 0xa9, 0xd7, 0x83, 0x31, 0x19, 0x54, 0xb2, 0x9a, 0x85, 0xa7, + 0xa1, 0xb7, 0x75, 0x33, 0xb6, 0xa9, 0xac, 0x84, 0x24, 0xb3, 0xde, 0xdb, 0x7d, 0x85, 0x2d, 0x96, + 0x65, 0xe5, 0x3f, 0x72, 0x95, 0x24, 0x9f, 0x28, 0x68, 0xca, 0x4f, 0xdb, 0x44, 0x1c, 0x3e, 0x60, + 0x12, 0x8a, 0xdd, 0x26, 0xa5, 0xeb, 0xff, 0x0b, 0x5e, 0xd4, 0x88, 0x38, 0x49, 0x2a, 0x6e, 0x5b, + 0xbf, 0x12, 0x37, 0x47, 0xbd, 0x05, 0x6b, 0xbc, 0xdb, 0xf3, 0xee, 0xe4, 0x11, 0x8e, 0x41, 0x68, + 0x7c, 0x61, 0x13, 0xd7, 0x42, 0xc8, 0x80, 0xbe, 0x36, 0x8f, 0xdc, 0x08, 0x8b, 0x4f, 0xac, 0xa4, + 0xe2, 0x76, 0x0c, 0xc9, 0x63, 0x6c, 0x49, 0x58, 0x93, 0xed, 0xcc, 0xaa, 0xdc, 0x25, 0x3b, 0x0a, + 0x60, 0x3f, 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x94, 0xa4, 0x44, 0xfd, 0x02, 0x03, 0x01, + 0x00, 0x01, }; static int rsa_compat_test(void) { @@ -81,17 +93,27 @@ static int rsa_compat_test(void) len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa) || memcmp(buf, openssl_public_rsa, len)) { + if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { fprintf(stderr, "RSA(private) public export failed to match OpenSSL output\n"); return 1; } rsa_free(&key); + /* try reading the public key */ + DO(rsa_import(openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), &key)); + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PUBLIC, &key)); + if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { + fprintf(stderr, "RSA(public) stripped public import failed to match OpenSSL output\n"); + return 1; + } + rsa_free(&key); + /* try reading the public key */ DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa) || memcmp(buf, openssl_public_rsa, len)) { + if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { fprintf(stderr, "RSA(public) SSL public import failed to match OpenSSL output\n"); return 1; } From f58c87866e665de45d115620133f56d05f6f384c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 31 Aug 2014 14:57:35 +0200 Subject: [PATCH 0312/1192] add possibility to export RSA public key in SubjectPublicKeyInfo format --- src/headers/tomcrypt_pk.h | 3 +++ src/pk/rsa/rsa_export.c | 28 +++++++++++++++++++--------- testprof/rsa_test.c | 30 +++++++++++++++++++++--------- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 8f6a1314f..31d66c95f 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -5,6 +5,9 @@ enum { PK_PRIVATE=1 }; +/* Indicates standard output formats that can be read e.g. by OpenSSL or GnuTLS */ +#define PK_STD 0x1000 + int rand_prime(void *N, long len, prng_state *prng, int wprng); int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng); int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng); diff --git a/src/pk/rsa/rsa_export.c b/src/pk/rsa/rsa_export.c index 6d1cdf27f..f869ff63e 100644 --- a/src/pk/rsa/rsa_export.c +++ b/src/pk/rsa/rsa_export.c @@ -56,27 +56,37 @@ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key LTC_ASN1_EOL, 0UL, NULL); } else { /* public key */ - unsigned long tmplen = (mp_count_bits(key->N)/8)*2+8; - unsigned char* tmp = XMALLOC(tmplen); + unsigned long tmplen, *ptmplen; + unsigned char* tmp = NULL; - if (tmp == NULL) { - return CRYPT_MEM; + if (type & PK_STD) { + tmplen = (mp_count_bits(key->N)/8)*2+8; + tmp = XMALLOC(tmplen); + ptmplen = &tmplen; + if (tmp == NULL) { + return CRYPT_MEM; + } + } + else { + tmp = out; + ptmplen = outlen; } - err = der_encode_sequence_multi(tmp, &tmplen, + err = der_encode_sequence_multi(tmp, ptmplen, LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_INTEGER, 1UL, key->e, LTC_ASN1_EOL, 0UL, NULL); - if (err != CRYPT_OK) { - goto error; + if ((err != CRYPT_OK) || !(type & PK_STD)) { + goto finish; } err = der_encode_subject_public_key_info(out, outlen, PKA_RSA, tmp, tmplen, LTC_ASN1_NULL, NULL, 0); -error: - XFREE(tmp); +finish: + if (tmp != out) + XFREE(tmp); return err; } diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index da1e491bd..d5d3bf89a 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -63,15 +63,15 @@ static const unsigned char openssl_public_rsa[] = { /* same key but with extra headers stripped */ static const unsigned char openssl_public_rsa_stripped[] = { - 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xcf, 0x9a, 0xde, - 0x64, 0x8a, 0xda, 0xc8, 0x33, 0x20, 0xa9, 0xd7, 0x83, 0x31, 0x19, 0x54, 0xb2, 0x9a, 0x85, 0xa7, - 0xa1, 0xb7, 0x75, 0x33, 0xb6, 0xa9, 0xac, 0x84, 0x24, 0xb3, 0xde, 0xdb, 0x7d, 0x85, 0x2d, 0x96, - 0x65, 0xe5, 0x3f, 0x72, 0x95, 0x24, 0x9f, 0x28, 0x68, 0xca, 0x4f, 0xdb, 0x44, 0x1c, 0x3e, 0x60, - 0x12, 0x8a, 0xdd, 0x26, 0xa5, 0xeb, 0xff, 0x0b, 0x5e, 0xd4, 0x88, 0x38, 0x49, 0x2a, 0x6e, 0x5b, - 0xbf, 0x12, 0x37, 0x47, 0xbd, 0x05, 0x6b, 0xbc, 0xdb, 0xf3, 0xee, 0xe4, 0x11, 0x8e, 0x41, 0x68, - 0x7c, 0x61, 0x13, 0xd7, 0x42, 0xc8, 0x80, 0xbe, 0x36, 0x8f, 0xdc, 0x08, 0x8b, 0x4f, 0xac, 0xa4, - 0xe2, 0x76, 0x0c, 0xc9, 0x63, 0x6c, 0x49, 0x58, 0x93, 0xed, 0xcc, 0xaa, 0xdc, 0x25, 0x3b, 0x0a, - 0x60, 0x3f, 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x94, 0xa4, 0x44, 0xfd, 0x02, 0x03, 0x01, + 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xcf, 0x9a, 0xde, + 0x64, 0x8a, 0xda, 0xc8, 0x33, 0x20, 0xa9, 0xd7, 0x83, 0x31, 0x19, 0x54, 0xb2, 0x9a, 0x85, 0xa7, + 0xa1, 0xb7, 0x75, 0x33, 0xb6, 0xa9, 0xac, 0x84, 0x24, 0xb3, 0xde, 0xdb, 0x7d, 0x85, 0x2d, 0x96, + 0x65, 0xe5, 0x3f, 0x72, 0x95, 0x24, 0x9f, 0x28, 0x68, 0xca, 0x4f, 0xdb, 0x44, 0x1c, 0x3e, 0x60, + 0x12, 0x8a, 0xdd, 0x26, 0xa5, 0xeb, 0xff, 0x0b, 0x5e, 0xd4, 0x88, 0x38, 0x49, 0x2a, 0x6e, 0x5b, + 0xbf, 0x12, 0x37, 0x47, 0xbd, 0x05, 0x6b, 0xbc, 0xdb, 0xf3, 0xee, 0xe4, 0x11, 0x8e, 0x41, 0x68, + 0x7c, 0x61, 0x13, 0xd7, 0x42, 0xc8, 0x80, 0xbe, 0x36, 0x8f, 0xdc, 0x08, 0x8b, 0x4f, 0xac, 0xa4, + 0xe2, 0x76, 0x0c, 0xc9, 0x63, 0x6c, 0x49, 0x58, 0x93, 0xed, 0xcc, 0xaa, 0xdc, 0x25, 0x3b, 0x0a, + 0x60, 0x3f, 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x94, 0xa4, 0x44, 0xfd, 0x02, 0x03, 0x01, 0x00, 0x01, }; static int rsa_compat_test(void) @@ -119,6 +119,18 @@ static int rsa_compat_test(void) } rsa_free(&key); + /* try export in SubjectPublicKeyInfo format of the public key */ + DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key)); + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); + if (len != sizeof(openssl_public_rsa) || memcmp(buf, openssl_public_rsa, len)) { + fprintf(stderr, "RSA(public) SSL public X.509 export failed to match OpenSSL output\n"); + print_hex("should", openssl_public_rsa, sizeof(openssl_public_rsa)); + print_hex("is", buf, len); + return 1; + } + rsa_free(&key); + return 0; } From eea24fe2c01601728c6eada85722f57fac8578a4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 31 Aug 2014 16:29:24 +0200 Subject: [PATCH 0313/1192] bring back possibility to import/export old DSA key format --- src/pk/dsa/dsa_export.c | 89 ++++++++++++++++++----------- src/pk/dsa/dsa_import.c | 41 +++++++++++++- testprof/dsa_test.c | 121 +++++++++++++++++++++++++++++++++++++++- testprof/test_dsa.key | 12 ++++ 4 files changed, 227 insertions(+), 36 deletions(-) create mode 100644 testprof/test_dsa.key diff --git a/src/pk/dsa/dsa_export.c b/src/pk/dsa/dsa_export.c index 61a28afc6..60e8b6f66 100644 --- a/src/pk/dsa/dsa_export.c +++ b/src/pk/dsa/dsa_export.c @@ -28,12 +28,15 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key) { unsigned long zero=0; - int err; + int err, std; LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); + std = type & PK_STD; + type &= ~PK_STD; + /* can we store the static header? */ if (type == PK_PRIVATE && key->type != PK_PRIVATE) { return CRYPT_PK_TYPE_MISMATCH; @@ -43,45 +46,67 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key return CRYPT_INVALID_ARG; } - /* This encoding is different from the one in original - * libtomcrypt. It uses a compatible encoding with gnutls - * and openssl - */ - if (type == PK_PRIVATE) { - return der_encode_sequence_multi(out, outlen, - LTC_ASN1_SHORT_INTEGER, 1UL, &zero, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, - LTC_ASN1_INTEGER, 1UL, key->g, - LTC_ASN1_INTEGER, 1UL, key->y, - LTC_ASN1_INTEGER, 1UL, key->x, - LTC_ASN1_EOL, 0UL, NULL); + if (std) { + return der_encode_sequence_multi(out, outlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &zero, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_INTEGER, 1UL, key->y, + LTC_ASN1_INTEGER, 1UL, key->x, + LTC_ASN1_EOL, 0UL, NULL); + } + else { + unsigned char flags[1]; + flags[0] = 1; + return der_encode_sequence_multi(out, outlen, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->y, + LTC_ASN1_INTEGER, 1UL, key->x, + LTC_ASN1_EOL, 0UL, NULL); + } } else { - unsigned long tmplen = (mp_count_bits(key->y)/8)+8; - unsigned char* tmp = XMALLOC(tmplen); - ltc_asn1_list int_list[3]; + if (std) { + unsigned long tmplen = (mp_count_bits(key->y) / 8) + 8; + unsigned char* tmp = XMALLOC(tmplen); + ltc_asn1_list int_list[3]; - if (tmp == NULL) { - return CRYPT_MEM; - } + if (tmp == NULL) { + return CRYPT_MEM; + } - err = der_encode_integer(key->y, tmp, &tmplen); - if (err != CRYPT_OK) { - goto error; - } + err = der_encode_integer(key->y, tmp, &tmplen); + if (err != CRYPT_OK) { + goto error; + } - LTC_SET_ASN1(int_list, 0, LTC_ASN1_INTEGER, key->p, 1UL); - LTC_SET_ASN1(int_list, 1, LTC_ASN1_INTEGER, key->q, 1UL); - LTC_SET_ASN1(int_list, 2, LTC_ASN1_INTEGER, key->g, 1UL); + LTC_SET_ASN1(int_list, 0, LTC_ASN1_INTEGER, key->p, 1UL); + LTC_SET_ASN1(int_list, 1, LTC_ASN1_INTEGER, key->q, 1UL); + LTC_SET_ASN1(int_list, 2, LTC_ASN1_INTEGER, key->g, 1UL); - err = der_encode_subject_public_key_info(out, outlen, - PKA_DSA, tmp, tmplen, - LTC_ASN1_SEQUENCE, int_list, sizeof(int_list)/sizeof(int_list[0])); + err = der_encode_subject_public_key_info(out, outlen, PKA_DSA, tmp, + tmplen, LTC_ASN1_SEQUENCE, int_list, + sizeof(int_list) / sizeof(int_list[0])); error: - XFREE(tmp); - return err; + XFREE(tmp); + return err; + } + else { + unsigned char flags[1]; + flags[0] = 0; + return der_encode_sequence_multi(out, outlen, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->y, + LTC_ASN1_EOL, 0UL, NULL); + } } } diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index c43c40a84..401d3baa6 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -18,7 +18,7 @@ #ifdef LTC_MDSA /** - Import a DSA key + Import a DSA key @param in The binary packet to import from @param inlen The length of the binary packet @param key [out] Where to store the imported key @@ -29,6 +29,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) int err; unsigned long zero = 0; unsigned char* tmpbuf = NULL; + unsigned char flags[1]; LTC_ARGCHK(in != NULL); LTC_ARGCHK(key != NULL); @@ -39,6 +40,42 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) return CRYPT_MEM; } + /* try to match the old libtomcrypt format */ + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_EOL, 0UL, NULL)) == CRYPT_OK) { + /* private key */ + if (flags[0]) { + fprintf(stderr, "private key\n"); + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->y, + LTC_ASN1_INTEGER, 1UL, key->x, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + key->type = PK_PRIVATE; + goto LBL_OK; + } + /* public key */ + else { + fprintf(stderr, "public key\n"); + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->y, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + key->type = PK_PUBLIC; + goto LBL_OK; + } + } /* get key type */ if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_SHORT_INTEGER, 1UL, &zero, @@ -78,6 +115,8 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) XFREE(tmpbuf); key->type = PK_PUBLIC; } + +LBL_OK: key->qord = mp_unsigned_bin_size(key->q); if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || diff --git a/testprof/dsa_test.c b/testprof/dsa_test.c index 2398ba2d2..feb156257 100644 --- a/testprof/dsa_test.c +++ b/testprof/dsa_test.c @@ -2,6 +2,119 @@ #ifdef LTC_MDSA +/* This is the private key from test_dsa.key */ +static const unsigned char openssl_priv_dsa[] = { + 0x30, 0x82, 0x01, 0xbb, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xc5, + 0x0a, 0x37, 0x51, 0x5c, 0xab, 0xd6, 0x18, 0xd5, 0xa2, 0x70, 0xbd, 0x4a, + 0x6f, 0x6b, 0x4a, 0xf9, 0xe1, 0x39, 0x95, 0x0f, 0x2b, 0x99, 0x38, 0x7d, + 0x9a, 0x64, 0xd6, 0x4c, 0xb5, 0x96, 0x7a, 0xdc, 0xed, 0xac, 0xa8, 0xac, + 0xc6, 0x1b, 0x65, 0x5a, 0xde, 0xdb, 0x00, 0x61, 0x25, 0x1a, 0x18, 0x2c, + 0xee, 0xa1, 0x07, 0x90, 0x62, 0x5e, 0x4d, 0x12, 0x31, 0x90, 0xc7, 0x03, + 0x21, 0xfa, 0x09, 0xe7, 0xb1, 0x73, 0xd7, 0x8e, 0xaf, 0xdb, 0xfd, 0xbf, + 0xb3, 0xef, 0xad, 0xd1, 0xa1, 0x2a, 0x03, 0x6d, 0xe7, 0x06, 0x92, 0x4a, + 0x85, 0x2a, 0xff, 0x7a, 0x01, 0x66, 0x53, 0x1f, 0xea, 0xc6, 0x67, 0x41, + 0x84, 0x5a, 0xc0, 0x6c, 0xed, 0x62, 0xf9, 0xc2, 0x62, 0x62, 0x05, 0xa4, + 0xfa, 0x48, 0xa0, 0x66, 0xec, 0x35, 0xc9, 0xa8, 0x11, 0xfe, 0xb9, 0x81, + 0xab, 0xee, 0xbe, 0x31, 0xb6, 0xbf, 0xcf, 0x02, 0x15, 0x00, 0xaa, 0x5b, + 0xd7, 0xf4, 0xe5, 0x06, 0x24, 0x13, 0xe5, 0x88, 0x35, 0xca, 0x00, 0xc7, + 0xa6, 0x35, 0x71, 0x61, 0x94, 0xc5, 0x02, 0x81, 0x80, 0x3b, 0x92, 0xe4, + 0xff, 0x59, 0x29, 0x15, 0x0b, 0x08, 0x99, 0x5a, 0x7b, 0xf2, 0xad, 0x14, + 0x40, 0x55, 0x6f, 0xa0, 0x47, 0xff, 0x90, 0x99, 0xb3, 0x44, 0xb3, 0xd4, + 0xfc, 0x45, 0x15, 0x05, 0xae, 0x67, 0x22, 0x43, 0x9c, 0xba, 0x37, 0x10, + 0xa5, 0x89, 0x47, 0x37, 0xec, 0xcc, 0xf5, 0xae, 0xad, 0xa8, 0xb4, 0x7a, + 0x35, 0xcb, 0x9d, 0x93, 0x5c, 0xed, 0xe6, 0xb0, 0x7e, 0x96, 0x94, 0xc4, + 0xa6, 0x0c, 0x7d, 0xd6, 0x70, 0x8a, 0x09, 0x4f, 0x81, 0x4a, 0x0e, 0xc2, + 0x13, 0xfb, 0xeb, 0x16, 0xbf, 0xea, 0xa4, 0xf4, 0x56, 0xff, 0x72, 0x30, + 0x05, 0xde, 0x8a, 0x44, 0x3f, 0xbe, 0xc6, 0x85, 0x26, 0x55, 0xd6, 0x2d, + 0x1d, 0x1e, 0xdb, 0x15, 0xda, 0xa4, 0x45, 0x83, 0x3c, 0x17, 0x97, 0x98, + 0x0b, 0x8d, 0x87, 0xf3, 0x49, 0x0d, 0x90, 0xbd, 0xa9, 0xab, 0x67, 0x6e, + 0x87, 0x68, 0x72, 0x23, 0xdc, 0x02, 0x81, 0x80, 0x53, 0x16, 0xb0, 0xfb, + 0xbf, 0x59, 0x8a, 0x5e, 0x55, 0x95, 0xc1, 0x4f, 0xac, 0x43, 0xb8, 0x08, + 0x53, 0xe6, 0xcf, 0x0d, 0x92, 0x23, 0xfa, 0xb1, 0x84, 0x59, 0x52, 0x39, + 0xbf, 0xcb, 0xf2, 0x2d, 0x38, 0x3a, 0xdd, 0x93, 0x52, 0x05, 0x49, 0x7e, + 0x2b, 0x12, 0xc4, 0x61, 0x73, 0xe3, 0x6f, 0x54, 0xbd, 0x96, 0xe5, 0xa7, + 0xaa, 0xa9, 0x5a, 0x58, 0xa4, 0xb7, 0x67, 0xd2, 0xc0, 0xbd, 0xc8, 0x1e, + 0xb1, 0x3a, 0x12, 0x4f, 0x98, 0xc0, 0x05, 0xef, 0x39, 0x5d, 0x6a, 0xba, + 0xb7, 0x0b, 0x3b, 0xd8, 0xb7, 0x95, 0xdd, 0x79, 0x6e, 0xa2, 0xd2, 0x84, + 0x73, 0x47, 0x03, 0x88, 0xb4, 0x64, 0xd9, 0xb9, 0xb8, 0x4f, 0xf1, 0xc9, + 0x34, 0xbb, 0xf9, 0x73, 0x66, 0xf5, 0x7c, 0x2e, 0x11, 0xfe, 0xc3, 0x31, + 0xe6, 0x08, 0x38, 0x59, 0x67, 0x81, 0xeb, 0x6d, 0x41, 0x27, 0xd7, 0x0d, + 0x74, 0xaf, 0xa0, 0x35, 0x02, 0x15, 0x00, 0x99, 0x36, 0xe5, 0xe4, 0xe9, + 0xfb, 0x28, 0xbe, 0x91, 0xf5, 0x06, 0x5f, 0xe8, 0xc9, 0x35, 0xb3, 0xf5, + 0xd8, 0x1f, 0xc5 +}; + +/* The public part of test_dsa.key in SubjectPublicKeyInfo format */ +static const unsigned char openssl_pub_dsa[] = { + 0x30, 0x82, 0x01, 0xb6, 0x30, 0x82, 0x01, 0x2b, 0x06, 0x07, 0x2a, 0x86, + 0x48, 0xce, 0x38, 0x04, 0x01, 0x30, 0x82, 0x01, 0x1e, 0x02, 0x81, 0x81, + 0x00, 0xc5, 0x0a, 0x37, 0x51, 0x5c, 0xab, 0xd6, 0x18, 0xd5, 0xa2, 0x70, + 0xbd, 0x4a, 0x6f, 0x6b, 0x4a, 0xf9, 0xe1, 0x39, 0x95, 0x0f, 0x2b, 0x99, + 0x38, 0x7d, 0x9a, 0x64, 0xd6, 0x4c, 0xb5, 0x96, 0x7a, 0xdc, 0xed, 0xac, + 0xa8, 0xac, 0xc6, 0x1b, 0x65, 0x5a, 0xde, 0xdb, 0x00, 0x61, 0x25, 0x1a, + 0x18, 0x2c, 0xee, 0xa1, 0x07, 0x90, 0x62, 0x5e, 0x4d, 0x12, 0x31, 0x90, + 0xc7, 0x03, 0x21, 0xfa, 0x09, 0xe7, 0xb1, 0x73, 0xd7, 0x8e, 0xaf, 0xdb, + 0xfd, 0xbf, 0xb3, 0xef, 0xad, 0xd1, 0xa1, 0x2a, 0x03, 0x6d, 0xe7, 0x06, + 0x92, 0x4a, 0x85, 0x2a, 0xff, 0x7a, 0x01, 0x66, 0x53, 0x1f, 0xea, 0xc6, + 0x67, 0x41, 0x84, 0x5a, 0xc0, 0x6c, 0xed, 0x62, 0xf9, 0xc2, 0x62, 0x62, + 0x05, 0xa4, 0xfa, 0x48, 0xa0, 0x66, 0xec, 0x35, 0xc9, 0xa8, 0x11, 0xfe, + 0xb9, 0x81, 0xab, 0xee, 0xbe, 0x31, 0xb6, 0xbf, 0xcf, 0x02, 0x15, 0x00, + 0xaa, 0x5b, 0xd7, 0xf4, 0xe5, 0x06, 0x24, 0x13, 0xe5, 0x88, 0x35, 0xca, + 0x00, 0xc7, 0xa6, 0x35, 0x71, 0x61, 0x94, 0xc5, 0x02, 0x81, 0x80, 0x3b, + 0x92, 0xe4, 0xff, 0x59, 0x29, 0x15, 0x0b, 0x08, 0x99, 0x5a, 0x7b, 0xf2, + 0xad, 0x14, 0x40, 0x55, 0x6f, 0xa0, 0x47, 0xff, 0x90, 0x99, 0xb3, 0x44, + 0xb3, 0xd4, 0xfc, 0x45, 0x15, 0x05, 0xae, 0x67, 0x22, 0x43, 0x9c, 0xba, + 0x37, 0x10, 0xa5, 0x89, 0x47, 0x37,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x03, 0x88, 0xb4, 0x64, + 0xd9, 0xb9, 0xb8, 0x4f, 0xf1, 0xc9, 0x34, 0xbb, 0xf9, 0x73, 0x66, 0xf5, + 0x7c, 0x2e, 0x11, 0xfe, 0xc3, 0x31, 0xe6, 0x08, 0x38, 0x59, 0x67, 0x81, + 0xeb, 0x6d, 0x41, 0x27, 0xd7, 0x0d, 0x74, 0xaf, 0xa0, 0x35 +}; + +static int dsa_compat_test(void) +{ + dsa_key key; + unsigned char tmp[1024]; + unsigned long x; + + DO(dsa_import(openssl_priv_dsa, sizeof(openssl_priv_dsa), &key)); + + x = sizeof(tmp); + DO(dsa_export(tmp, &x, PK_PRIVATE | PK_STD, &key)); + DO((x == sizeof(openssl_priv_dsa))?CRYPT_OK:CRYPT_ERROR); + DO((memcmp(tmp, openssl_priv_dsa, sizeof(openssl_priv_dsa)) == 0)?CRYPT_OK:CRYPT_ERROR); + + x = sizeof(tmp); + DO(dsa_export(tmp, &x, PK_PUBLIC | PK_STD, &key)); + DO((x == sizeof(openssl_pub_dsa))?CRYPT_OK:CRYPT_ERROR); + DO((memcmp(tmp, openssl_pub_dsa, sizeof(openssl_pub_dsa)) == 0)?CRYPT_OK:CRYPT_ERROR); + dsa_free(&key); + + DO(dsa_import(openssl_pub_dsa, sizeof(openssl_pub_dsa), &key)); + + x = sizeof(tmp); + DO(dsa_export(tmp, &x, PK_PUBLIC | PK_STD, &key)); + DO((x == sizeof(openssl_pub_dsa))?CRYPT_OK:CRYPT_ERROR); + DO((memcmp(tmp, openssl_pub_dsa, sizeof(openssl_pub_dsa)) == 0)?CRYPT_OK:CRYPT_ERROR); + dsa_free(&key); + + return 0; +} + int dsa_test(void) { unsigned char msg[16], out[1024], out2[1024]; @@ -9,22 +122,24 @@ int dsa_test(void) int stat1, stat2; dsa_key key, key2; + dsa_compat_test(); + /* make a random key */ DO(dsa_make_key(&yarrow_prng, find_prng("yarrow"), 20, 128, &key)); /* verify it */ DO(dsa_verify_key(&key, &stat1)); if (stat1 == 0) { fprintf(stderr, "dsa_verify_key "); return 1; } - + /* encrypt a message */ for (x = 0; x < 16; x++) { msg[x] = x; } x = sizeof(out); DO(dsa_encrypt_key(msg, 16, out, &x, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), &key)); - + /* decrypt */ y = sizeof(out2); DO(dsa_decrypt_key(out, x, out2, &y, &key)); - + if (y != 16 || memcmp(out2, msg, 16)) { fprintf(stderr, "dsa_decrypt failed, y == %lu\n", y); return 1; diff --git a/testprof/test_dsa.key b/testprof/test_dsa.key new file mode 100644 index 000000000..2f026694c --- /dev/null +++ b/testprof/test_dsa.key @@ -0,0 +1,12 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIBuwIBAAKBgQDFCjdRXKvWGNWicL1Kb2tK+eE5lQ8rmTh9mmTWTLWWetztrKis +xhtlWt7bAGElGhgs7qEHkGJeTRIxkMcDIfoJ57Fz146v2/2/s++t0aEqA23nBpJK +hSr/egFmUx/qxmdBhFrAbO1i+cJiYgWk+kigZuw1yagR/rmBq+6+Mba/zwIVAKpb +1/TlBiQT5Yg1ygDHpjVxYZTFAoGAO5Lk/1kpFQsImVp78q0UQFVvoEf/kJmzRLPU +/EUVBa5nIkOcujcQpYlHN+zM9a6tqLR6Ncudk1zt5rB+lpTEpgx91nCKCU+BSg7C +E/vrFr/qpPRW/3IwBd6KRD++xoUmVdYtHR7bFdqkRYM8F5eYC42H80kNkL2pq2du +h2hyI9wCgYBTFrD7v1mKXlWVwU+sQ7gIU+bPDZIj+rGEWVI5v8vyLTg63ZNSBUl+ +KxLEYXPjb1S9luWnqqlaWKS3Z9LAvcgesToST5jABe85XWq6tws72LeV3XluotKE +c0cDiLRk2bm4T/HJNLv5c2b1fC4R/sMx5gg4WWeB621BJ9cNdK+gNQIVAJk25eTp ++yi+kfUGX+jJNbP12B/F +-----END DSA PRIVATE KEY----- From 1cc26da35c6638be9ca30eee93035793f9518232 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 30 Sep 2014 10:53:05 +0200 Subject: [PATCH 0314/1192] fix coverity script --- coverity.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/coverity.sh b/coverity.sh index 3230f780e..c8494613e 100755 --- a/coverity.sh +++ b/coverity.sh @@ -1,16 +1,28 @@ #!/bin/bash -if [ $# -lt 3 ] +if [ $# -lt 2 ] then - echo "usage is: ${0##*/} " - echo "e.g. \"${0##*/} \"/usr/local/bin/coverity\" \"/path/to/libtommath\" /path/to/libtommath/libtommath.a\"" + echo "usage is: ${0##*/} " + echo "e.g. \"${0##*/} \"/usr/local/bin/coverity\" \"-DLTM_DESC -I/path/to/libtommath/\"\"" exit -1 fi PATH=$PATH:$1/bin make clean -CFLAGS=" -O2 -DUSE_LTM -DLTM_DESC -I${2}" EXTRALIBS="${3}" cov-build --dir cov-int make -f makefile -j3 IGNORE_SPEED=1 1>gcc_1.txt +rm -r cov-int/ + +myCflags="" +myCflags="$myCflags -O2 ${2}" +myCflags="$myCflags -pipe -Werror -Wpointer-arith -Winit-self -Wextra -Wall -Wformat -Wformat-security" + +CFLAGS="$myCflags" cov-build --dir cov-int make -f makefile -j3 IGNORE_SPEED=1 1>gcc_1.txt + +if [ $? -ne 0 ] +then + echo "make failed" + exit -1 +fi # zipup everything tar caf libtomcrypt.lzma cov-int @@ -23,6 +35,6 @@ curl --form project=libtomcrypt \ --form token=${mytoken} \ --form email=${mymail} \ --form file=@libtomcrypt.lzma \ - --form version='"${myversion}"' \ - --form description='"libtomcrypt version ${myversion}"' \ + --form version=\"${myversion}\" \ + --form description=\"libtomcrypt version ${myversion}\" \ https://scan.coverity.com/builds?project=libtomcrypt From c1e81ad469eaac4197c0ec68ace9aa3a20714035 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 30 Sep 2014 13:26:18 +0200 Subject: [PATCH 0315/1192] minor changes print MP_DIGIT_BIT when running test der_test: improve error output of 'short integer' test --- demos/test.c | 1 + src/headers/tomcrypt_pk.h | 4 ++++ testprof/der_tests.c | 7 ++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/demos/test.c b/demos/test.c index 051cb8d2d..1ae530ecc 100644 --- a/demos/test.c +++ b/demos/test.c @@ -17,6 +17,7 @@ int main(void) #endif printf("build == \n%s\n", crypt_build_settings); + printf("MP_DIGIT_BIT = %d\n", MP_DIGIT_BIT); printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\nmisc_test....."); fflush(stdout); x = misc_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 31d66c95f..f8b934a7b 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -439,21 +439,25 @@ int dsa_shared_secret(void *private_key, void *base, /* DER handling */ typedef enum ltc_asn1_type_ { + /* 0 */ LTC_ASN1_EOL, LTC_ASN1_BOOLEAN, LTC_ASN1_INTEGER, LTC_ASN1_SHORT_INTEGER, LTC_ASN1_BIT_STRING, + /* 5 */ LTC_ASN1_OCTET_STRING, LTC_ASN1_NULL, LTC_ASN1_OBJECT_IDENTIFIER, LTC_ASN1_IA5_STRING, LTC_ASN1_PRINTABLE_STRING, + /* 10 */ LTC_ASN1_UTF8_STRING, LTC_ASN1_UTCTIME, LTC_ASN1_CHOICE, LTC_ASN1_SEQUENCE, LTC_ASN1_SET, + /* 15 */ LTC_ASN1_SETOF, LTC_ASN1_RAW_BIT_STRING, LTC_ASN1_TELETEX_STRING, diff --git a/testprof/der_tests.c b/testprof/der_tests.c index c75e3d3b6..eb47f2528 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -549,12 +549,12 @@ int der_tests(void) /* test short integer */ for (zz = 0; zz < 256; zz++) { for (z = 1; z < 4; z++) { - if (yarrow_read(buf[0], z, &yarrow_prng) != z) { + if (yarrow_read(buf[2], z, &yarrow_prng) != z) { fprintf(stderr, "Failed to read %lu bytes from yarrow\n", z); return 1; } /* encode with normal */ - DO(mp_read_unsigned_bin(a, buf[0], z)); + DO(mp_read_unsigned_bin(a, buf[2], z)); x = sizeof(buf[0]); DO(der_encode_integer(a, buf[0], &x)); @@ -563,7 +563,8 @@ int der_tests(void) y = sizeof(buf[1]); DO(der_encode_short_integer(mp_get_int(a), buf[1], &y)); if (x != y || memcmp(buf[0], buf[1], x)) { - fprintf(stderr, "DER INTEGER short encoding failed, %lu, %lu\n", x, y); + fprintf(stderr, "DER INTEGER short encoding failed, %lu, %lu, 0x%lX\n", x, y, mp_get_int(a)); + for (zz = 0; zz < z; zz++) fprintf(stderr, "%02x ", buf[2][zz]); fprintf(stderr, "\n"); for (z = 0; z < x; z++) fprintf(stderr, "%02x ", buf[0][z]); fprintf(stderr, "\n"); for (z = 0; z < y; z++) fprintf(stderr, "%02x ", buf[1][z]); fprintf(stderr, "\n"); mp_clear_multi(a, b, c, d, e, f, g, NULL); From 2e426e2d57f793c24d141585dc6fc41bb39a0210 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 30 Sep 2014 17:57:53 +0200 Subject: [PATCH 0316/1192] der test: add example of decoding a X.509 v3 cert with the flexi decoder you can define "LTC_DER_TESTS_PRINT_FLEXI" at compile time to print the decoded cert whenn running the test executable... well not all of it, since some parts of the cert are marked as "context-specific" so we would need to do some further digging ...these are the parts that are output as "EOL"... --- testprof/der_tests.c | 483 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 483 insertions(+) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index eb47f2528..7c622f4bd 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -13,6 +13,487 @@ int der_tests(void) #else +static const unsigned char _der_tests_cacert_root_cert[] = + "MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5M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iwiwovOVThrLm82asduycPAtStvY\ + sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T\ + SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF\ + CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum\ + GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk\ + zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW\ + omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD"; + +/* +SEQUENCE(3 elem) + SEQUENCE(8 elem) + [0](1) + INTEGER 2 + INTEGER 0 + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.1.4 + NULL + SEQUENCE(4 elem) + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.10 + PrintableString Root CA + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.11 + PrintableString http://www.cacert.org + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.3 + PrintableString CA Cert Signing Authority + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.9.1 + IA5String support@cacert.org + SEQUENCE(2 elem) + UTCTime03-03-30 12:29:49 UTC + UTCTime33-03-29 12:29:49 UTC + SEQUENCE(4 elem) + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.10 + PrintableString Root CA + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.11 + PrintableString http://www.cacert.org + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.3 + PrintableString CA Cert Signing Authority + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.9.1 + IA5String support@cacert.org + SEQUENCE(2 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.1.1 + NULL + BIT STRING(1 elem) + SEQUENCE(2 elem) + INTEGER (4096 bit) + INTEGER 65537 + [3](1) + SEQUENCE(7 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.29.14 + OCTET STRING(1 elem) + OCTET STRING(20 byte) 16B5321BD4C7F3E0E68EF3BDD2B03AEEB23918D1 + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.29.35 + OCTET STRING(1 elem) + SEQUENCE(3 elem) + [0] + [1](1) + [4](1) + SEQUENCE(4 elem) + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.10 + PrintableString Root CA + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.11 + PrintableString http://www.cacert.org + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.3 + PrintableString CA Cert Signing Authority + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.9.1 + IA5String support@cacert.org + [2] + SEQUENCE(3 elem) + OBJECT IDENTIFIER 2.5.29.19 + BOOLEAN true + OCTET STRING(1 elem) + SEQUENCE(1 elem) + BOOLEAN true + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.29.31 + OCTET STRING(1 elem) + SEQUENCE(1 elem) + SEQUENCE(1 elem) + [0](1) + [0](1) + [6] + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.16.840.1.113730.1.4 + OCTET STRING(1 elem) + IA5String https://www.cacert.org/revoke.crl + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.16.840.1.113730.1.8 + OCTET STRING(1 elem) + IA5String http://www.cacert.org/index.php?id=10 + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.16.840.1.113730.1.13 + OCTET STRING(1 elem) + IA5String To get your own certificate for FREE head over to http://www.cacert.org + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.1.4 + NULL + BIT STRING(4096 bit) + */ + +#define __ASN1_ERR(l) fprintf(stderr, "line: %d, type=%d, size=%lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, (l)->type, (l)->size, (l)->next, (l)->prev, (l)->parent, (l)->child); \ + exit(EXIT_FAILURE) + +#define __CHECK_ASN1_HAS(l, w) do { if ((l)->w == NULL) { \ + __ASN1_ERR(l);\ +} } while(0) + +#define __CHECK_ASN1_HAS_NO(l, w) do { if ((l)->w != NULL) { \ + __ASN1_ERR(l);\ +} } while(0) + + + +#define CHECK_ASN1_TYPE(l, t) do { if ((l)->type != (t)) { \ + __ASN1_ERR(l);\ +} } while(0) + +#define CHECK_ASN1_HAS_CHILD(l) __CHECK_ASN1_HAS(l, child) +#define CHECK_ASN1_HAS_NO_CHILD(l) __CHECK_ASN1_HAS_NO(l, child) +#define CHECK_ASN1_HAS_NEXT(l) __CHECK_ASN1_HAS(l, next) +#define CHECK_ASN1_HAS_NO_NEXT(l) __CHECK_ASN1_HAS_NO(l, next) + +#ifdef LTC_DER_TESTS_PRINT_FLEXI +static void _der_tests_print_flexi(ltc_asn1_list* l, unsigned int level) +{ + char buf[1024]; + char* name = NULL; + char* text = NULL; + ltc_asn1_list* ostring = NULL; + unsigned int n; + + switch (l->type) + { + case LTC_ASN1_EOL: + name = "EOL"; + text = ""; + break; + case LTC_ASN1_BOOLEAN: + name = "BOOLEAN"; + { + if (*(int*)l->data) + text = "true"; + else + text = "false"; + } + break; + case LTC_ASN1_INTEGER: + name = "INTEGER"; + break; + case LTC_ASN1_SHORT_INTEGER: + name = "SHORT INTEGER"; + break; + case LTC_ASN1_BIT_STRING: + name = "BIT STRING"; + break; + case LTC_ASN1_OCTET_STRING: + name = "OCTET STRING"; + { + unsigned long ostring_l = l->size; + /* sometimes there's another sequence in an octet string... + * try to decode that... if it fails print out the octet string + */ + if (der_decode_sequence_flexi(l->data, &ostring_l, &ostring) == CRYPT_OK) { + text = ""; + } + else { + int r; + char* s = buf; + int sz = sizeof(buf); + for (n = 0; n < l->size; ++n) { + r = snprintf(s, sz, "%02X", ((unsigned char*)l->data)[n]); + if (r < 0 || r >= sz) { + printf("Octet string boom"); + exit(EXIT_FAILURE); + } + s += r; + sz -= r; + } + text = buf; + } + } + break; + case LTC_ASN1_NULL: + name = "NULL"; + text = ""; + break; + case LTC_ASN1_OBJECT_IDENTIFIER: + name = "OBJECT IDENTIFIER"; + { + unsigned long i; + int r; + char* s = buf; + int sz = sizeof(buf); + for (i = 0; i < l->size; ++i) { + r = snprintf(s, sz, "%lu.", ((unsigned long*)l->data)[i]); + if (r < 0 || r >= sz) { + printf("OID boom"); + exit(EXIT_FAILURE); + } + s += r; + sz -= r; + } + /* replace the last . with a \0 */ + *(s - 1) = '\0'; + text = buf; + } + break; + case LTC_ASN1_IA5_STRING: + name = "IA5 STRING"; + text = l->data; + break; + case LTC_ASN1_PRINTABLE_STRING: + name = "PRINTABLE STRING"; + text = l->data; + break; + case LTC_ASN1_UTF8_STRING: + name = "UTF8 STRING"; + break; + case LTC_ASN1_UTCTIME: + name = "UTCTIME"; + { + ltc_utctime* ut = l->data; + snprintf(buf, sizeof(buf), "%02d-%02d-%02d %02d:%02d:%02d %c%02d:%02d", + ut->YY, ut->MM, ut->DD, ut->hh, ut->mm, ut->ss, + ut->off_dir ? '-' : '+', ut->off_hh, ut->off_mm); + text = buf; + } + break; + case LTC_ASN1_CHOICE: + name = "CHOICE"; + break; + case LTC_ASN1_SEQUENCE: + name = "SEQUENCE"; + text = ""; + break; + case LTC_ASN1_SET: + name = "SET"; + text = ""; + break; + case LTC_ASN1_SETOF: + name = "SETOF"; + text = ""; + break; + case LTC_ASN1_RAW_BIT_STRING: + name = "RAW BIT STRING"; + break; + case LTC_ASN1_TELETEX_STRING: + name = "TELETEX STRING"; + text = l->data; + break; + case LTC_ASN1_CONSTRUCTED: + name = "CONSTRUCTED"; + text = ""; + break; + } + + for (n = 0; n < level; ++n) { + printf(" "); + } + if (name) { + if (text) + printf("%s %s\n", name, text); + else + printf("%s \n", name); + } + else + printf("WTF type=%i\n", l->type); + + if (ostring) { + _der_tests_print_flexi(ostring, level + 1); + der_free_sequence_flexi(ostring); + } + + if (l->child) + _der_tests_print_flexi(l->child, level + 1); + + if (l->next) + _der_tests_print_flexi(l->next, level); +} +#endif + +static void der_cacert_test(void) +{ + unsigned char buf[sizeof(_der_tests_cacert_root_cert)]; + unsigned long len1 = sizeof(buf), len2; + + ltc_asn1_list *decoded_list, *l, *l1, *l2; + + DO(base64_decode(_der_tests_cacert_root_cert, sizeof(_der_tests_cacert_root_cert), buf, &len1)); + len2 = len1; + DO(der_decode_sequence_flexi(buf, &len2, &decoded_list)); + +#ifdef LTC_DER_TESTS_PRINT_FLEXI + printf("\n\n--- test print start ---\n\n"); + _der_tests_print_flexi(decoded_list, 0); + printf("\n\n--- test print end ---\n\n"); +#endif + + l = decoded_list; + + /* +SEQUENCE(3 elem) + SEQUENCE(8 elem) + */ + + CHECK_ASN1_TYPE(l, LTC_ASN1_SEQUENCE); + CHECK_ASN1_HAS_CHILD(l); + CHECK_ASN1_HAS_NO_NEXT(l); + + l = l->child; + + CHECK_ASN1_TYPE(l, LTC_ASN1_SEQUENCE); + CHECK_ASN1_HAS_CHILD(l); + CHECK_ASN1_HAS_NEXT(l); + + l1 = l->child; + + /* + [0](1) + INTEGER 2 + */ + + CHECK_ASN1_TYPE(l1, LTC_ASN1_CONSTRUCTED); + CHECK_ASN1_HAS_CHILD(l1); + CHECK_ASN1_HAS_NEXT(l1); + + l2 = l1->child; + + CHECK_ASN1_TYPE(l2, LTC_ASN1_INTEGER); + CHECK_ASN1_HAS_NO_CHILD(l2); + CHECK_ASN1_HAS_NO_NEXT(l2); + + l1 = l1->next; + + /* + INTEGER 0 + */ + + CHECK_ASN1_TYPE(l1, LTC_ASN1_INTEGER); + CHECK_ASN1_HAS_NO_CHILD(l1); + CHECK_ASN1_HAS_NEXT(l1); + + l1 = l1->next; + + /* + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.1.4 + NULL + */ + + CHECK_ASN1_TYPE(l1, LTC_ASN1_SEQUENCE); + CHECK_ASN1_HAS_CHILD(l1); + CHECK_ASN1_HAS_NEXT(l1); + + l2 = l1->child; + + CHECK_ASN1_TYPE(l2, LTC_ASN1_OBJECT_IDENTIFIER); + CHECK_ASN1_HAS_NO_CHILD(l2); + CHECK_ASN1_HAS_NEXT(l2); + + l2 = l2->next; + + CHECK_ASN1_TYPE(l2, LTC_ASN1_NULL); + CHECK_ASN1_HAS_NO_CHILD(l2); + CHECK_ASN1_HAS_NO_NEXT(l2); + + /* + SEQUENCE(4 elem) + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.10 + PrintableString Root CA + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.11 + PrintableString http://www.cacert.org + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 2.5.4.3 + PrintableString CA Cert Signing Authority + SET(1 elem) + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.9.1 + IA5String support@cacert.org + */ + + l = l->next; + + /* + SEQUENCE(2 elem) + OBJECT IDENTIFIER 1.2.840.113549.1.1.4 + NULL + */ + + CHECK_ASN1_TYPE(l, LTC_ASN1_SEQUENCE); + CHECK_ASN1_HAS_CHILD(l); + CHECK_ASN1_HAS_NEXT(l); + + l1 = l->child; + + CHECK_ASN1_TYPE(l1, LTC_ASN1_OBJECT_IDENTIFIER); + CHECK_ASN1_HAS_NO_CHILD(l1); + CHECK_ASN1_HAS_NEXT(l1); + + l1 = l1->next; + + CHECK_ASN1_TYPE(l1, LTC_ASN1_NULL); + CHECK_ASN1_HAS_NO_CHILD(l1); + CHECK_ASN1_HAS_NO_NEXT(l1); + + l = l->next; + + /* + BIT STRING(4096 bit) + */ + + CHECK_ASN1_TYPE(l, LTC_ASN1_BIT_STRING); + CHECK_ASN1_HAS_NO_CHILD(l); + CHECK_ASN1_HAS_NO_NEXT(l); + + der_free_sequence_flexi(decoded_list); +} + static void der_set_test(void) { ltc_asn1_list list[10]; @@ -519,6 +1000,8 @@ int der_tests(void) unsigned char utf8_buf[32]; wchar_t utf8_out[32]; + der_cacert_test(); + DO(mp_init_multi(&a, &b, &c, &d, &e, &f, &g, NULL)); for (zz = 0; zz < 16; zz++) { #ifdef USE_TFM From 3d1231ab154713e882757261e4264922d5b21a7d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Oct 2014 17:51:25 +0200 Subject: [PATCH 0317/1192] der flexi decoder: improve CONSTRUCTED type decoding remove all teh flags save the entire original identifier --- .../asn1/der/sequence/der_decode_sequence_flexi.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index 8bd3b5d15..fcf471aa8 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -65,7 +65,6 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc ltc_asn1_list *l; unsigned long err, type, len, totlen, x, y; void *realloc_tmp; - int is_constructed; LTC_ARGCHK(in != NULL); LTC_ARGCHK(inlen != NULL); @@ -104,14 +103,10 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc } if ((type & 0x20) && (type != 0x30) && (type != 0x31)) { - is_constructed = 1; - /* constructed, use the 'used' field to store the original tag number */ - l->used = (type & 0x1F); + /* constructed, use the 'used' field to store the original identifier */ + l->used = type; /* treat constructed elements like SETs */ - type = 0x31; - } - else { - is_constructed = 0; + type = 0x20; } /* now switch on type */ @@ -332,11 +327,12 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc } break; + case 0x20: /* Any CONSTRUCTED element that is neither SEQUENCE nor SET */ case 0x30: /* SEQUENCE */ case 0x31: /* SET */ /* init field */ - if (is_constructed) { + if (type == 0x20) { l->type = LTC_ASN1_CONSTRUCTED; } else if (type == 0x30) { From f0a12356145306d365d02643fedefee0d10025af Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Oct 2014 18:28:47 +0200 Subject: [PATCH 0318/1192] der flexi decoder: remove duplicate code --- .../der/sequence/der_decode_sequence_flexi.c | 47 ++++++------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index fcf471aa8..8d7f06288 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -17,24 +17,24 @@ #ifdef LTC_DER -static unsigned long fetch_length(const unsigned char *in, unsigned long inlen) +static unsigned long fetch_length(const unsigned char *in, unsigned long inlen, unsigned long *data_offset) { - unsigned long x, y, z; + unsigned long x, z; - y = 0; + *data_offset = 0; /* skip type and read len */ if (inlen < 2) { return 0xFFFFFFFF; } - ++in; ++y; + ++in; ++(*data_offset); /* read len */ - x = *in++; ++y; + x = *in++; ++(*data_offset); /* <128 means literal */ if (x < 128) { - return x+y; + return x+*data_offset; } x &= 0x7F; /* the lower 7 bits are the length of the length */ inlen -= 2; @@ -44,13 +44,13 @@ static unsigned long fetch_length(const unsigned char *in, unsigned long inlen) return 0xFFFFFFFF; } - y += x; + *data_offset += x; z = 0; while (x--) { z = (z<<8) | ((unsigned long)*in); ++in; } - return z+y; + return z+*data_offset; } /** @@ -63,7 +63,7 @@ static unsigned long fetch_length(const unsigned char *in, unsigned long inlen) int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc_asn1_list **out) { ltc_asn1_list *l; - unsigned long err, type, len, totlen, x, y; + unsigned long err, type, len, totlen, data_offset; void *realloc_tmp; LTC_ARGCHK(in != NULL); @@ -79,7 +79,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc type = *in; /* fetch length */ - len = fetch_length(in, *inlen); + len = fetch_length(in, *inlen, &data_offset); if (len > *inlen) { err = CRYPT_INVALID_PACKET; goto error; @@ -342,35 +342,18 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc l->type = LTC_ASN1_SET; } - /* we have to decode the SEQUENCE header and get it's length */ - - /* move past type */ - ++in; --(*inlen); - - /* read length byte */ - x = *in++; --(*inlen); - - /* smallest SEQUENCE/SET header */ - y = 2; - - /* now if it's > 127 the next bytes are the length of the length */ - if (x > 128) { - x &= 0x7F; - in += x; - *inlen -= x; - - /* update sequence header len */ - y += x; - } + /* jump to the start of the data */ + in += data_offset; + *inlen -= data_offset; + len = len - data_offset; /* Sequence elements go as child */ - len = len - y; if ((err = der_decode_sequence_flexi(in, &len, &(l->child))) != CRYPT_OK) { goto error; } /* len update */ - totlen += y; + totlen += data_offset; /* link them up y0 */ l->child->parent = l; From 2d8933e4f129d1a009bf634b013a1c359496c17c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Oct 2014 18:32:59 +0200 Subject: [PATCH 0319/1192] der: add new enum element for context-specific encodings --- src/headers/tomcrypt_pk.h | 1 + src/pk/asn1/der/choice/der_decode_choice.c | 1 + src/pk/asn1/der/sequence/der_decode_sequence_ex.c | 1 + src/pk/asn1/der/sequence/der_decode_sequence_multi.c | 2 ++ src/pk/asn1/der/sequence/der_encode_sequence_ex.c | 2 ++ src/pk/asn1/der/sequence/der_encode_sequence_multi.c | 2 ++ src/pk/asn1/der/sequence/der_length_sequence.c | 1 + src/pk/asn1/der/set/der_encode_set.c | 1 + 8 files changed, 11 insertions(+) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index f8b934a7b..e57156475 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -462,6 +462,7 @@ typedef enum ltc_asn1_type_ { LTC_ASN1_RAW_BIT_STRING, LTC_ASN1_TELETEX_STRING, LTC_ASN1_CONSTRUCTED, + LTC_ASN1_CONTEXT_SPECIFIC, } ltc_asn1_type; /** A LTC ASN.1 list type */ diff --git a/src/pk/asn1/der/choice/der_decode_choice.c b/src/pk/asn1/der/choice/der_decode_choice.c index 17aa105a6..e90e67afa 100644 --- a/src/pk/asn1/der/choice/der_decode_choice.c +++ b/src/pk/asn1/der/choice/der_decode_choice.c @@ -200,6 +200,7 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, case LTC_ASN1_CHOICE: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: case LTC_ASN1_EOL: return CRYPT_INVALID_ARG; } diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index b23364140..02aec22a7 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -284,6 +284,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, break; case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: case LTC_ASN1_EOL: err = CRYPT_INVALID_ARG; goto LBL_ERR; diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index 21699381c..80262fbf7 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -72,6 +72,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_EOL: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: va_end(args); return CRYPT_INVALID_ARG; } @@ -122,6 +123,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) break; case LTC_ASN1_EOL: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: break; } } diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index 10f4dbe14..677ce53fe 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -138,6 +138,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, case LTC_ASN1_CHOICE: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: case LTC_ASN1_EOL: case LTC_ASN1_TELETEX_STRING: err = CRYPT_INVALID_ARG; @@ -336,6 +337,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, case LTC_ASN1_CHOICE: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: case LTC_ASN1_EOL: case LTC_ASN1_TELETEX_STRING: err = CRYPT_INVALID_ARG; diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index da5d37176..1ffcfce8f 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -71,6 +71,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) case LTC_ASN1_CHOICE: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: case LTC_ASN1_EOL: case LTC_ASN1_TELETEX_STRING: va_end(args); @@ -122,6 +123,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) case LTC_ASN1_CHOICE: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: case LTC_ASN1_EOL: case LTC_ASN1_TELETEX_STRING: va_end(args); diff --git a/src/pk/asn1/der/sequence/der_length_sequence.c b/src/pk/asn1/der/sequence/der_length_sequence.c index 37882d04d..c7fec541c 100644 --- a/src/pk/asn1/der/sequence/der_length_sequence.c +++ b/src/pk/asn1/der/sequence/der_length_sequence.c @@ -141,6 +141,7 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, case LTC_ASN1_CHOICE: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: case LTC_ASN1_EOL: err = CRYPT_INVALID_ARG; goto LBL_ERR; diff --git a/src/pk/asn1/der/set/der_encode_set.c b/src/pk/asn1/der/set/der_encode_set.c index fdf55f819..ae87697b5 100644 --- a/src/pk/asn1/der/set/der_encode_set.c +++ b/src/pk/asn1/der/set/der_encode_set.c @@ -39,6 +39,7 @@ static int ltc_to_asn1(ltc_asn1_type v) case LTC_ASN1_SETOF: return 0x31; case LTC_ASN1_CHOICE: case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_CONTEXT_SPECIFIC: case LTC_ASN1_EOL: return -1; } return -1; From 6bd6319fb00fff28c89fda81c587882453430ea7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Oct 2014 18:41:01 +0200 Subject: [PATCH 0320/1192] der flexi decoder: implement decoding of context-specific data --- .../der/sequence/der_decode_sequence_flexi.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index 8d7f06288..46458af90 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -108,6 +108,12 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc /* treat constructed elements like SETs */ type = 0x20; } + else if ((type & 0xC0) == 0x80) { + /* context-specific, use the 'used' field to store the original identifier */ + l->used = type; + /* context-specific elements are treated as opaque data */ + type = 0x80; + } /* now switch on type */ switch (type) { @@ -359,6 +365,20 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc l->child->parent = l; break; + + case 0x80: /* Context-specific */ + l->type = LTC_ASN1_CONTEXT_SPECIFIC; + + if ((l->data = XCALLOC(1, len - data_offset)) == NULL) { + err = CRYPT_MEM; + goto error; + } + + XMEMCPY(l->data, in + data_offset, len - data_offset); + l->size = len - data_offset; + + break; + default: /* invalid byte ... this is a soft error */ /* remove link */ From 6da3b856d6b6526ac2e2a530e1d24f14021645af Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Oct 2014 18:52:19 +0200 Subject: [PATCH 0321/1192] der test: print list-element details on EOL EOL indicates an unitialized list-element --- testprof/der_tests.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 7c622f4bd..301f3f97d 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -171,7 +171,10 @@ SEQUENCE(3 elem) BIT STRING(4096 bit) */ -#define __ASN1_ERR(l) fprintf(stderr, "line: %d, type=%d, size=%lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, (l)->type, (l)->size, (l)->next, (l)->prev, (l)->parent, (l)->child); \ +#define __ASN1_FMTSTRING_FMT "line: %d, type=%d, size=%lu, data=%p, self=%p, next=%p, prev=%p, parent=%p, child=%p" +#define __ASN1_FMTSTRING_VAL(l) __LINE__, (l)->type, (l)->size, (l)->data, (l), (l)->next, (l)->prev, (l)->parent, (l)->child + +#define __ASN1_ERR(l) fprintf(stderr, __ASN1_FMTSTRING_FMT "\n", __ASN1_FMTSTRING_VAL(l)); \ exit(EXIT_FAILURE) #define __CHECK_ASN1_HAS(l, w) do { if ((l)->w == NULL) { \ @@ -206,7 +209,8 @@ static void _der_tests_print_flexi(ltc_asn1_list* l, unsigned int level) { case LTC_ASN1_EOL: name = "EOL"; - text = ""; + snprintf(buf, sizeof(buf),__ASN1_FMTSTRING_FMT "\n", __ASN1_FMTSTRING_VAL(l)); + text = buf; break; case LTC_ASN1_BOOLEAN: name = "BOOLEAN"; From f75b5ec8f49a8823a473cf88eb86247f8cca7cfd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Oct 2014 18:55:23 +0200 Subject: [PATCH 0322/1192] der tests: improve/implement handling of context-specific data no more "EOL" in the output as the flexi decoder handles now context-specific data --- testprof/der_tests.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 301f3f97d..128ee091c 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -326,8 +326,37 @@ static void _der_tests_print_flexi(ltc_asn1_list* l, unsigned int level) text = l->data; break; case LTC_ASN1_CONSTRUCTED: - name = "CONSTRUCTED"; - text = ""; + if (l->used & 0x80) + name = "CONTEXT SPECIFIC"; + else + name = "CONSTRUCTED"; + snprintf(buf, sizeof(buf), "[%d]", l->used & 0x1f); + text = buf; + break; + case LTC_ASN1_CONTEXT_SPECIFIC: + name = "CONTEXT SPECIFIC"; + { + int r; + char* s = buf; + int sz = sizeof(buf); + r = snprintf(s, sz, "[%d] ", l->used & 0x1f); + if (r < 0 || r >= sz) { + printf("Context Specific boom"); + exit(EXIT_FAILURE); + } + s += r; + sz -= r; + for (n = 0; n < l->size; ++n) { + r = snprintf(s, sz, "%02X", ((unsigned char*)l->data)[n]); + if (r < 0 || r >= sz) { + printf("Context Specific boom"); + exit(EXIT_FAILURE); + } + s += r; + sz -= r; + } + text = buf; + } break; } From ee1631f8b32f141e3c9fa7769a99c4c271dd5ac8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 6 Oct 2014 18:57:58 +0200 Subject: [PATCH 0323/1192] dsa import: no output on stderr please --- src/pk/dsa/dsa_import.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 401d3baa6..64083031b 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -46,7 +46,6 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) LTC_ASN1_EOL, 0UL, NULL)) == CRYPT_OK) { /* private key */ if (flags[0]) { - fprintf(stderr, "private key\n"); if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_INTEGER, 1UL, key->g, @@ -62,7 +61,6 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) } /* public key */ else { - fprintf(stderr, "public key\n"); if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_INTEGER, 1UL, key->g, From 3ecdd298479bda2b708d435d5644adf6a75da3df Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 10 Oct 2014 00:55:18 +0200 Subject: [PATCH 0324/1192] fix coverity script --- coverity.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coverity.sh b/coverity.sh index c8494613e..0c919388b 100755 --- a/coverity.sh +++ b/coverity.sh @@ -31,10 +31,10 @@ mytoken=$(cat .coverity_token) mymail=$(cat .coverity_mail) myversion=$(git describe --dirty) -curl --form project=libtomcrypt \ +curl -k --form project=libtomcrypt \ --form token=${mytoken} \ --form email=${mymail} \ --form file=@libtomcrypt.lzma \ --form version=\"${myversion}\" \ - --form description=\"libtomcrypt version ${myversion}\" \ - https://scan.coverity.com/builds?project=libtomcrypt + --form description="\"libtomcrypt version ${myversion}\"" \ + https://scan.coverity.com/builds?project=libtom%2Flibtomcrypt From e6b1c7101ef50ef127866c5b7e6ba91f4b9cd354 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 10 Oct 2014 00:56:23 +0200 Subject: [PATCH 0325/1192] der test: also run der_length_utf8_string() --- testprof/der_tests.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 128ee091c..b79a5ae32 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -1305,7 +1305,8 @@ tmp_time.off_hh); /* encode it */ x = sizeof(utf8_buf); DO(der_encode_utf8_string(utf8_1, sizeof(utf8_1) / sizeof(utf8_1[0]), utf8_buf, &x)); - if (x != sizeof(utf8_1_der) || memcmp(utf8_buf, utf8_1_der, x)) { + DO(der_length_utf8_string(utf8_1, sizeof(utf8_1) / sizeof(utf8_1[0]), &y)); + if (x != sizeof(utf8_1_der) || memcmp(utf8_buf, utf8_1_der, x) || x != y) { fprintf(stderr, "DER UTF8_1 encoded to %lu bytes\n", x); for (y = 0; y < x; y++) fprintf(stderr, "%02x ", (unsigned)utf8_buf[y]); fprintf(stderr, "\n"); return 1; From ed287038041abe9967b877359a13e33cf4fac43b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 10 Oct 2014 01:07:58 +0200 Subject: [PATCH 0326/1192] der_decode_sequence_multi: calm coverity --- src/pk/asn1/der/sequence/der_decode_sequence_multi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index 80262fbf7..f22ff8045 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -121,6 +121,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_TELETEX_STRING: LTC_SET_ASN1(list, x++, type, data, size); break; + /* coverity[dead_error_line] */ case LTC_ASN1_EOL: case LTC_ASN1_CONSTRUCTED: case LTC_ASN1_CONTEXT_SPECIFIC: From 992506cb49755025eb408c5a3ea5e067db0646b7 Mon Sep 17 00:00:00 2001 From: Pascal Brand Date: Fri, 17 Oct 2014 08:50:01 +0200 Subject: [PATCH 0327/1192] Add incremental CCM authentication processing CCM is only meant for packet mode where the length of the input is known in advance. Since it is a packet mode function, CCM only had one function that performs the protocol. However, incremental authentication is usefull in some usecases. It also ensure some kind of coherencies when processing with a given authentication mode or another. To achieve this aim, this commit adds the following functions: ccm_init() ccm_add_aad() cm_add_nonce() ccm_process() ccm_done() ccm_reset() as well as the data structure ccm_state Change-Id: I5225a42bb098708c4af07518b561bb00f85bc243 --- makefile | 2 + src/encauth/ccm/ccm_add_aad.c | 58 +++++++++++++++++ src/encauth/ccm/ccm_add_nonce.c | 108 ++++++++++++++++++++++++++++++++ src/encauth/ccm/ccm_done.c | 61 ++++++++++++++++++ src/encauth/ccm/ccm_init.c | 78 +++++++++++++++++++++++ src/encauth/ccm/ccm_process.c | 84 +++++++++++++++++++++++++ src/encauth/ccm/ccm_reset.c | 33 ++++++++++ src/headers/tomcrypt_mac.h | 38 +++++++++++ 8 files changed, 462 insertions(+) create mode 100644 src/encauth/ccm/ccm_add_aad.c create mode 100644 src/encauth/ccm/ccm_add_nonce.c create mode 100644 src/encauth/ccm/ccm_done.c create mode 100644 src/encauth/ccm/ccm_init.c create mode 100644 src/encauth/ccm/ccm_process.c create mode 100644 src/encauth/ccm/ccm_reset.c diff --git a/makefile b/makefile index 6cd433a16..a7c376d1f 100644 --- a/makefile +++ b/makefile @@ -121,6 +121,8 @@ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi. src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ +src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ +src/encauth/ccm/ccm_add_aad.o src/encauth/ccm/ccm_init.o src/encauth/ccm/ccm_add_nonce.o \ src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ diff --git a/src/encauth/ccm/ccm_add_aad.c b/src/encauth/ccm/ccm_add_aad.c new file mode 100644 index 000000000..9b0cf0c6e --- /dev/null +++ b/src/encauth/ccm/ccm_add_aad.c @@ -0,0 +1,58 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +#ifdef LTC_CCM_MODE + +/** + Add AAD to the CCM state + @param ccm The CCM state + @param adata The additional authentication data to add to the CCM state + @param adatalen The length of the AAD data. + @return CRYPT_OK on success + */ +int ccm_add_aad(ccm_state *ccm, + const unsigned char *adata, unsigned long adatalen) +{ + unsigned long y; + int err; + + if (ccm->aadlen < ccm->current_aadlen + adatalen) { + return CRYPT_INVALID_ARG; + } + ccm->current_aadlen += adatalen; + + /* now add the data */ + for (y = 0; y < adatalen; y++) { + if (ccm->x == 16) { + /* full block so let's encrypt it */ + if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { + return CRYPT_ERROR; + } + ccm->x = 0; + } + ccm->PAD[ccm->x++] ^= adata[y]; + } + + /* remainder? */ + if (ccm->aadlen == ccm->current_aadlen) { + if (ccm->x != 0) { + if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { + return CRYPT_ERROR; + } + } + ccm->x = 0; + } + + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/ccm/ccm_add_nonce.c b/src/encauth/ccm/ccm_add_nonce.c new file mode 100644 index 000000000..1cae548e2 --- /dev/null +++ b/src/encauth/ccm/ccm_add_nonce.c @@ -0,0 +1,108 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +#ifdef LTC_CCM_MODE + +/** + Add nonce data to the CCM state + @param ccm The CCM state + @param nonce The nonce data to add + @param noncelen The length of the nonce + @return CRYPT_OK on success + */ +int ccm_add_nonce(ccm_state *ccm, + const unsigned char *nonce, unsigned long noncelen) +{ + unsigned long x, y, len; + int err; + + /* increase L to match the nonce len */ + ccm->noncelen = (noncelen > 13) ? 13 : noncelen; + if ((15 - ccm->noncelen) > ccm->L) { + ccm->L = 15 - ccm->noncelen; + } + + /* decrease noncelen to match L */ + if ((ccm->noncelen + ccm->L) > 15) { + ccm->noncelen = 15 - ccm->L; + } + + /* form B_0 == flags | Nonce N | l(m) */ + x = 0; + ccm->PAD[x++] = (unsigned char)(((ccm->aadlen > 0) ? (1<<6) : 0) | + (((ccm->taglen - 2)>>1)<<3) | + (ccm->L-1)); + + /* nonce */ + for (y = 0; y < (16 - (ccm->L + 1)); y++) { + ccm->PAD[x++] = nonce[y]; + } + + /* store len */ + len = ccm->ptlen; + + /* shift len so the upper bytes of len are the contents of the length */ + for (y = ccm->L; y < 4; y++) { + len <<= 8; + } + + /* store l(m) (only store 32-bits) */ + for (y = 0; ccm->L > 4 && (ccm->L-y)>4; y++) { + ccm->PAD[x++] = 0; + } + for (; y < ccm->L; y++) { + ccm->PAD[x++] = (unsigned char)((len >> 24) & 255); + len <<= 8; + } + + /* encrypt PAD */ + if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { + return err; + } + + /* handle header */ + ccm->x = 0; + if (ccm->aadlen > 0) { + /* store length */ + if (ccm->aadlen < ((1UL<<16) - (1UL<<8))) { + ccm->PAD[ccm->x++] ^= (ccm->aadlen>>8) & 255; + ccm->PAD[ccm->x++] ^= ccm->aadlen & 255; + } else { + ccm->PAD[ccm->x++] ^= 0xFF; + ccm->PAD[ccm->x++] ^= 0xFE; + ccm->PAD[ccm->x++] ^= (ccm->aadlen>>24) & 255; + ccm->PAD[ccm->x++] ^= (ccm->aadlen>>16) & 255; + ccm->PAD[ccm->x++] ^= (ccm->aadlen>>8) & 255; + ccm->PAD[ccm->x++] ^= ccm->aadlen & 255; + } + } + + /* setup the ctr counter */ + x = 0; + + /* flags */ + ccm->ctr[x++] = (unsigned char)ccm->L-1; + + /* nonce */ + for (y = 0; y < (16 - (ccm->L+1)); ++y) { + ccm->ctr[x++] = nonce[y]; + } + /* offset */ + while (x < 16) { + ccm->ctr[x++] = 0; + } + + ccm->CTRlen = 16; + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/ccm/ccm_done.c b/src/encauth/ccm/ccm_done.c new file mode 100644 index 000000000..5ca6a7863 --- /dev/null +++ b/src/encauth/ccm/ccm_done.c @@ -0,0 +1,61 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +#ifdef LTC_CCM_MODE + +/** + Terminate a CCM stream + @param ccm The CCM state + @param tag [out] The destination for the MAC tag + @param taglen [in/out] The length of the MAC tag + @return CRYPT_OK on success + */ +int ccm_done(ccm_state *ccm, + unsigned char *tag, unsigned long *taglen) +{ + unsigned long x, y; + int err; + + /* Check all data have been processed */ + if (ccm->ptlen != ccm->current_ptlen) { + return CRYPT_ERROR; + } + + LTC_ARGCHK(tag != NULL); + LTC_ARGCHK(taglen != NULL); + + if (ccm->x != 0) { + if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { + return err; + } + } + + /* setup CTR for the TAG (zero the count) */ + for (y = 15; y > 15 - ccm->L; y--) { + ccm->ctr[y] = 0x00; + } + if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->ctr, ccm->CTRPAD, &ccm->K)) != CRYPT_OK) { + return err; + } + + cipher_descriptor[ccm->cipher].done(&ccm->K); + + /* store the TAG */ + for (x = 0; x < 16 && x < *taglen; x++) { + tag[x] = ccm->PAD[x] ^ ccm->CTRPAD[x]; + } + *taglen = x; + + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/ccm/ccm_init.c b/src/encauth/ccm/ccm_init.c new file mode 100644 index 000000000..4819bdaaa --- /dev/null +++ b/src/encauth/ccm/ccm_init.c @@ -0,0 +1,78 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +#ifdef LTC_CCM_MODE + +/** + Initialize a CCM state + @param ccm The CCM state to initialize + @param cipher The index of the cipher to use + @param key The secret key + @param keylen The length of the secret key + @param ptlen The length of the plain/cipher text that will be processed + @param taglen The max length of the MAC tag + @param aadlen The length of the AAD + + @return CRYPT_OK on success + */ +int ccm_init(ccm_state *ccm, int cipher, + const unsigned char *key, int keylen, int ptlen, int taglen, int aadlen) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(taglen != 0); + + memset(ccm, 0, sizeof(ccm_state)); + + /* check cipher input */ + if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { + return err; + } + if (cipher_descriptor[cipher].block_length != 16) { + return CRYPT_INVALID_CIPHER; + } + + /* make sure the taglen is even and <= 16 */ + ccm->taglen = taglen; + ccm->taglen &= ~1; + if (ccm->taglen > 16) { + ccm->taglen = 16; + } + + /* can't use < 4 */ + if (ccm->taglen < 4) { + return CRYPT_INVALID_ARG; + } + + /* schedule key */ + if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &ccm->K)) != CRYPT_OK) { + return err; + } + ccm->cipher = cipher; + + /* let's get the L value */ + ccm->ptlen = ptlen; + ccm->L = 0; + while (ptlen) { + ++ccm->L; + ptlen >>= 8; + } + if (ccm->L <= 1) { + ccm->L = 2; + } + + ccm->aadlen = aadlen; + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/ccm/ccm_process.c b/src/encauth/ccm/ccm_process.c new file mode 100644 index 000000000..f784473b7 --- /dev/null +++ b/src/encauth/ccm/ccm_process.c @@ -0,0 +1,84 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +#ifdef LTC_CCM_MODE + +/** + Process plaintext/ciphertext through CCM + @param ccm The CCM state + @param pt The plaintext + @param ptlen The plaintext length (ciphertext length is the same) + @param ct The ciphertext + @param direction Encrypt or Decrypt mode (CCM_ENCRYPT or CCM_DECRYPT) + @return CRYPT_OK on success + */ +int ccm_process(ccm_state *ccm, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + int direction) +{ + unsigned char y, z, b; + int err; + + /* Check aad has been correctly added */ + if (ccm->aadlen != ccm->current_aadlen) { + return CRYPT_ERROR; + } + + /* Check we do not process too much data */ + if (ccm->ptlen < ccm->current_ptlen + ptlen) { + return CRYPT_ERROR; + } + ccm->current_ptlen += ptlen; + + /* now handle the PT */ + if (ptlen > 0) { + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); + y = 0; + + for (; y < ptlen; y++) { + /* increment the ctr? */ + if (ccm->CTRlen == 16) { + for (z = 15; z > 15-ccm->L; z--) { + ccm->ctr[z] = (ccm->ctr[z] + 1) & 255; + if (ccm->ctr[z]) break; + } + if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->ctr, ccm->CTRPAD, &ccm->K)) != CRYPT_OK) { + return err; + } + ccm->CTRlen = 0; + } + + /* if we encrypt we add the bytes to the MAC first */ + if (direction == CCM_ENCRYPT) { + b = pt[y]; + ct[y] = b ^ ccm->CTRPAD[ccm->CTRlen++]; + } else { + b = ct[y] ^ ccm->CTRPAD[ccm->CTRlen++]; + pt[y] = b; + } + + if (ccm->x == 16) { + if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { + return err; + } + ccm->x = 0; + } + ccm->PAD[ccm->x++] ^= b; + } + } + + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/ccm/ccm_reset.c b/src/encauth/ccm/ccm_reset.c new file mode 100644 index 000000000..855789d6d --- /dev/null +++ b/src/encauth/ccm/ccm_reset.c @@ -0,0 +1,33 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +#ifdef LTC_CCM_MODE + +/** + Reset a CCM state to as if you just called ccm_init(). This saves the initialization time. + @param ccm The CCM state to reset + @return CRYPT_OK on success +*/ +int ccm_reset(ccm_state *ccm) +{ + LTC_ARGCHK(ccm != NULL); + zeromem(ccm->PAD, sizeof(ccm->PAD)); + zeromem(ccm->ctr, sizeof(ccm->ctr)); + zeromem(ccm->CTRPAD, sizeof(ccm->CTRPAD)); + ccm->CTRlen = 0; + ccm->current_ptlen = 0; + ccm->current_aadlen = 0; + + return CRYPT_OK; +} + +#endif diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 5d71af61d..fcee6333d 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -259,6 +259,44 @@ void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const #define CCM_ENCRYPT 0 #define CCM_DECRYPT 1 +typedef struct { + symmetric_key K; + int cipher, /* which cipher */ + taglen, /* length of the tag */ + x; /* index in PAD */ + + unsigned long L, /* L value */ + ptlen, /* length that will be enc / dec */ + current_ptlen, /* current processed length */ + aadlen, /* length of the aad */ + current_aadlen, /* length of the currently provided add */ + noncelen; /* length of the nonce */ + + unsigned char PAD[16], + ctr[16], + CTRPAD[16], + CTRlen; +} ccm_state; + +int ccm_init(ccm_state *ccm, int cipher, + const unsigned char *key, int keylen, int ptlen, int taglen, int aad_len); + +int ccm_reset(ccm_state *ccm); + +int ccm_add_nonce(ccm_state *ccm, + const unsigned char *nonce, unsigned long noncelen); + +int ccm_add_aad(ccm_state *ccm, + const unsigned char *adata, unsigned long adatalen); + +int ccm_process(ccm_state *ccm, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + int direction); + +int ccm_done(ccm_state *ccm, + unsigned char *tag, unsigned long *taglen); + int ccm_memory(int cipher, const unsigned char *key, unsigned long keylen, symmetric_key *uskey, From 53917750d873e133cf7192daf65f2307d7c6511a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 31 Oct 2014 19:38:47 +0100 Subject: [PATCH 0328/1192] trim trailing spaces --- src/encauth/ccm/ccm_test.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 9b63ffc5b..53fcb4e36 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -37,9 +37,9 @@ int ccm_test(void) /* 13 byte nonce, 8 byte auth, 23 byte pt */ { - { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF }, - { 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xA0, + { 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 }, 13, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }, @@ -57,20 +57,20 @@ int ccm_test(void) /* 13 byte nonce, 12 byte header, 19 byte pt */ { - { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF }, - { 0x00, 0x00, 0x00, 0x06, 0x05, 0x04, 0x03, 0xA0, + { 0x00, 0x00, 0x00, 0x06, 0x05, 0x04, 0x03, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 }, 13, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B }, 12, - { 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, - 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, + { 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, + 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E }, 19, - { 0xA2, 0x8C, 0x68, 0x65, 0x93, 0x9A, 0x9A, 0x79, - 0xFA, 0xAA, 0x5C, 0x4C, 0x2A, 0x9D, 0x4A, 0x91, + { 0xA2, 0x8C, 0x68, 0x65, 0x93, 0x9A, 0x9A, 0x79, + 0xFA, 0xAA, 0x5C, 0x4C, 0x2A, 0x9D, 0x4A, 0x91, 0xCD, 0xAC, 0x8C }, { 0x96, 0xC8, 0x61, 0xB9, 0xC9, 0xE6, 0x1E, 0xF1 }, 8 @@ -78,7 +78,7 @@ int ccm_test(void) /* supplied by Brian Gladman */ { - { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f }, { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 }, 7, @@ -92,21 +92,21 @@ int ccm_test(void) }, { - { 0xc9, 0x7c, 0x1f, 0x67, 0xce, 0x37, 0x11, 0x85, + { 0xc9, 0x7c, 0x1f, 0x67, 0xce, 0x37, 0x11, 0x85, 0x51, 0x4a, 0x8a, 0x19, 0xf2, 0xbd, 0xd5, 0x2f }, - { 0x00, 0x50, 0x30, 0xf1, 0x84, 0x44, 0x08, 0xb5, + { 0x00, 0x50, 0x30, 0xf1, 0x84, 0x44, 0x08, 0xb5, 0x03, 0x97, 0x76, 0xe7, 0x0c }, 13, - { 0x08, 0x40, 0x0f, 0xd2, 0xe1, 0x28, 0xa5, 0x7c, - 0x50, 0x30, 0xf1, 0x84, 0x44, 0x08, 0xab, 0xae, + { 0x08, 0x40, 0x0f, 0xd2, 0xe1, 0x28, 0xa5, 0x7c, + 0x50, 0x30, 0xf1, 0x84, 0x44, 0x08, 0xab, 0xae, 0xa5, 0xb8, 0xfc, 0xba, 0x00, 0x00 }, 22, - { 0xf8, 0xba, 0x1a, 0x55, 0xd0, 0x2f, 0x85, 0xae, - 0x96, 0x7b, 0xb6, 0x2f, 0xb6, 0xcd, 0xa8, 0xeb, + { 0xf8, 0xba, 0x1a, 0x55, 0xd0, 0x2f, 0x85, 0xae, + 0x96, 0x7b, 0xb6, 0x2f, 0xb6, 0xcd, 0xa8, 0xeb, 0x7e, 0x78, 0xa0, 0x50 }, 20, - { 0xf3, 0xd0, 0xa2, 0xfe, 0x9a, 0x3d, 0xbf, 0x23, - 0x42, 0xa6, 0x43, 0xe4, 0x32, 0x46, 0xe8, 0x0c, + { 0xf3, 0xd0, 0xa2, 0xfe, 0x9a, 0x3d, 0xbf, 0x23, + 0x42, 0xa6, 0x43, 0xe4, 0x32, 0x46, 0xe8, 0x0c, 0x3c, 0x04, 0xd0, 0x19 }, { 0x78, 0x45, 0xce, 0x0b, 0x16, 0xf9, 0x76, 0x23 }, 8 From 4efa27ead11540887b65748440dc0ed35557b280 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 31 Oct 2014 19:39:03 +0100 Subject: [PATCH 0329/1192] add missing pointer checks --- src/encauth/ccm/ccm_add_aad.c | 3 +++ src/encauth/ccm/ccm_add_nonce.c | 3 +++ src/encauth/ccm/ccm_done.c | 2 ++ src/encauth/ccm/ccm_init.c | 1 + src/encauth/ccm/ccm_process.c | 2 ++ 5 files changed, 11 insertions(+) diff --git a/src/encauth/ccm/ccm_add_aad.c b/src/encauth/ccm/ccm_add_aad.c index 9b0cf0c6e..3dcf3ff7d 100644 --- a/src/encauth/ccm/ccm_add_aad.c +++ b/src/encauth/ccm/ccm_add_aad.c @@ -25,6 +25,9 @@ int ccm_add_aad(ccm_state *ccm, unsigned long y; int err; + LTC_ARGCHK(ccm != NULL); + LTC_ARGCHK(adata != NULL); + if (ccm->aadlen < ccm->current_aadlen + adatalen) { return CRYPT_INVALID_ARG; } diff --git a/src/encauth/ccm/ccm_add_nonce.c b/src/encauth/ccm/ccm_add_nonce.c index 1cae548e2..fc4eafc27 100644 --- a/src/encauth/ccm/ccm_add_nonce.c +++ b/src/encauth/ccm/ccm_add_nonce.c @@ -25,6 +25,9 @@ int ccm_add_nonce(ccm_state *ccm, unsigned long x, y, len; int err; + LTC_ARGCHK(ccm != NULL); + LTC_ARGCHK(nonce != NULL); + /* increase L to match the nonce len */ ccm->noncelen = (noncelen > 13) ? 13 : noncelen; if ((15 - ccm->noncelen) > ccm->L) { diff --git a/src/encauth/ccm/ccm_done.c b/src/encauth/ccm/ccm_done.c index 5ca6a7863..64c9f9f45 100644 --- a/src/encauth/ccm/ccm_done.c +++ b/src/encauth/ccm/ccm_done.c @@ -25,6 +25,8 @@ int ccm_done(ccm_state *ccm, unsigned long x, y; int err; + LTC_ARGCHK(ccm != NULL); + /* Check all data have been processed */ if (ccm->ptlen != ccm->current_ptlen) { return CRYPT_ERROR; diff --git a/src/encauth/ccm/ccm_init.c b/src/encauth/ccm/ccm_init.c index 4819bdaaa..8a6dfbc5a 100644 --- a/src/encauth/ccm/ccm_init.c +++ b/src/encauth/ccm/ccm_init.c @@ -29,6 +29,7 @@ int ccm_init(ccm_state *ccm, int cipher, { int err; + LTC_ARGCHK(ccm != NULL); LTC_ARGCHK(key != NULL); LTC_ARGCHK(taglen != 0); diff --git a/src/encauth/ccm/ccm_process.c b/src/encauth/ccm/ccm_process.c index f784473b7..1f650caae 100644 --- a/src/encauth/ccm/ccm_process.c +++ b/src/encauth/ccm/ccm_process.c @@ -29,6 +29,8 @@ int ccm_process(ccm_state *ccm, unsigned char y, z, b; int err; + LTC_ARGCHK(ccm != NULL); + /* Check aad has been correctly added */ if (ccm->aadlen != ccm->current_aadlen) { return CRYPT_ERROR; From 943a858d6c1cbf91d8e70b0d47f1a8b3c1c6557b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 31 Oct 2014 19:41:14 +0100 Subject: [PATCH 0330/1192] also run testvectors on new CCM API [skip ci] --- src/encauth/ccm/ccm_test.c | 116 +++++++++++++++++++++++++++++-------- 1 file changed, 91 insertions(+), 25 deletions(-) diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 53fcb4e36..5ef4c0ac1 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -17,6 +17,10 @@ #ifdef LTC_CCM_MODE +#if defined(LTC_CCM_TEST_DBG) && !defined(LTC_NO_TEST) +void print_hex(const char* what, const unsigned char* p, const unsigned long l); +#endif + int ccm_test(void) { #ifndef LTC_TEST @@ -32,7 +36,7 @@ int ccm_test(void) int ptlen; unsigned char ct[64]; unsigned char tag[16]; - int taglen; + unsigned long taglen; } tests[] = { /* 13 byte nonce, 8 byte auth, 23 byte pt */ @@ -113,10 +117,11 @@ int ccm_test(void) }, }; - unsigned long taglen, x; + unsigned long taglen, x, y; unsigned char buf[64], buf2[64], tag2[16], tag[16]; int err, idx; symmetric_key skey; + ccm_state ccm; idx = find_cipher("aes"); if (idx == -1) { @@ -127,47 +132,108 @@ int ccm_test(void) } for (x = 0; x < (sizeof(tests)/sizeof(tests[0])); x++) { + for (y = 0; y < 2; y++) { taglen = tests[x].taglen; - if ((err = cipher_descriptor[idx].setup(tests[x].key, 16, 0, &skey)) != CRYPT_OK) { - return err; - } - - if ((err = ccm_memory(idx, - tests[x].key, 16, - &skey, - tests[x].nonce, tests[x].noncelen, - tests[x].header, tests[x].headerlen, - (unsigned char*)tests[x].pt, tests[x].ptlen, - buf, - tag, &taglen, 0)) != CRYPT_OK) { - return err; + if (y == 0) { + if ((err = cipher_descriptor[idx].setup(tests[x].key, 16, 0, &skey)) != CRYPT_OK) { + return err; + } + + if ((err = ccm_memory(idx, + tests[x].key, 16, + &skey, + tests[x].nonce, tests[x].noncelen, + tests[x].header, tests[x].headerlen, + (unsigned char*)tests[x].pt, tests[x].ptlen, + buf, + tag, &taglen, 0)) != CRYPT_OK) { + return err; + } + } else { + if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, 0)) != CRYPT_OK) { + return err; + } + if ((err = ccm_add_nonce(&ccm, tests[x].nonce, tests[x].noncelen)) != CRYPT_OK) { + return err; + } + if ((err = ccm_process(&ccm, (unsigned char*)tests[x].pt, tests[x].ptlen, buf, CCM_ENCRYPT)) != CRYPT_OK) { + return err; + } + if ((err = ccm_done(&ccm, tag, &taglen)) != CRYPT_OK) { + return err; + } } if (XMEMCMP(buf, tests[x].ct, tests[x].ptlen)) { +#if defined(LTC_CCM_TEST_DBG) + printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); + print_hex("ct is ", tag, taglen); + print_hex("ct should", tests[x].tag, taglen); +#endif + return CRYPT_FAIL_TESTVECTOR; + } + if (tests[x].taglen != taglen) { +#if defined(LTC_CCM_TEST_DBG) + printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); + printf("taglen %lu (is) %lu (should)\n", taglen, tests[x].taglen); +#endif return CRYPT_FAIL_TESTVECTOR; } if (XMEMCMP(tag, tests[x].tag, tests[x].taglen)) { +#if defined(LTC_CCM_TEST_DBG) + printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); + print_hex("tag is ", tag, taglen); + print_hex("tag should", tests[x].tag, taglen); +#endif return CRYPT_FAIL_TESTVECTOR; } - if ((err = ccm_memory(idx, - tests[x].key, 16, - NULL, - tests[x].nonce, tests[x].noncelen, - tests[x].header, tests[x].headerlen, - buf2, tests[x].ptlen, - buf, - tag2, &taglen, 1 )) != CRYPT_OK) { - return err; + if (y == 0) { + if ((err = ccm_memory(idx, + tests[x].key, 16, + NULL, + tests[x].nonce, tests[x].noncelen, + tests[x].header, tests[x].headerlen, + buf2, tests[x].ptlen, + buf, + tag2, &taglen, 1 )) != CRYPT_OK) { + return err; + } + } else { + if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, 0)) != CRYPT_OK) { + return err; + } + if ((err = ccm_add_nonce(&ccm, tests[x].nonce, tests[x].noncelen)) != CRYPT_OK) { + return err; + } + if ((err = ccm_process(&ccm, buf2, tests[x].ptlen, buf, CCM_DECRYPT)) != CRYPT_OK) { + return err; + } + if ((err = ccm_done(&ccm, tag2, &taglen)) != CRYPT_OK) { + return err; + } } if (XMEMCMP(buf2, tests[x].pt, tests[x].ptlen)) { +#if defined(LTC_CCM_TEST_DBG) + printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); + print_hex("pt is ", tag, taglen); + print_hex("pt should", tests[x].tag, taglen); +#endif return CRYPT_FAIL_TESTVECTOR; } if (XMEMCMP(tag2, tests[x].tag, tests[x].taglen)) { +#if defined(LTC_CCM_TEST_DBG) + printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); + print_hex("tag is ", tag, taglen); + print_hex("tag should", tests[x].tag, taglen); +#endif return CRYPT_FAIL_TESTVECTOR; } - cipher_descriptor[idx].done(&skey); + if (y == 0) { + cipher_descriptor[idx].done(&skey); + } + } } return CRYPT_OK; #endif From f2f8342c43d198cf5e4859603fd3c8845cc10c09 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 2 Nov 2014 17:01:56 +0100 Subject: [PATCH 0331/1192] ccm test: add missing AAD --- src/encauth/ccm/ccm_test.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 5ef4c0ac1..0d5556aa9 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -150,12 +150,15 @@ int ccm_test(void) return err; } } else { - if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, 0)) != CRYPT_OK) { + if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, tests[x].headerlen)) != CRYPT_OK) { return err; } if ((err = ccm_add_nonce(&ccm, tests[x].nonce, tests[x].noncelen)) != CRYPT_OK) { return err; } + if ((err = ccm_add_aad(&ccm, tests[x].header, tests[x].headerlen)) != CRYPT_OK) { + return err; + } if ((err = ccm_process(&ccm, (unsigned char*)tests[x].pt, tests[x].ptlen, buf, CCM_ENCRYPT)) != CRYPT_OK) { return err; } @@ -182,8 +185,8 @@ int ccm_test(void) if (XMEMCMP(tag, tests[x].tag, tests[x].taglen)) { #if defined(LTC_CCM_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("tag is ", tag, taglen); - print_hex("tag should", tests[x].tag, taglen); + print_hex("tag is ", tag, tests[x].taglen); + print_hex("tag should", tests[x].tag, tests[x].taglen); #endif return CRYPT_FAIL_TESTVECTOR; } @@ -200,12 +203,15 @@ int ccm_test(void) return err; } } else { - if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, 0)) != CRYPT_OK) { + if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, tests[x].headerlen)) != CRYPT_OK) { return err; } if ((err = ccm_add_nonce(&ccm, tests[x].nonce, tests[x].noncelen)) != CRYPT_OK) { return err; } + if ((err = ccm_add_aad(&ccm, tests[x].header, tests[x].headerlen)) != CRYPT_OK) { + return err; + } if ((err = ccm_process(&ccm, buf2, tests[x].ptlen, buf, CCM_DECRYPT)) != CRYPT_OK) { return err; } @@ -225,8 +231,8 @@ int ccm_test(void) if (XMEMCMP(tag2, tests[x].tag, tests[x].taglen)) { #if defined(LTC_CCM_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("tag is ", tag, taglen); - print_hex("tag should", tests[x].tag, taglen); + print_hex("tag is ", tag, tests[x].taglen); + print_hex("tag should", tests[x].tag, tests[x].taglen); #endif return CRYPT_FAIL_TESTVECTOR; } From 26c5d54e5ca4d4346ade555195bb6947b0acba83 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 12 Nov 2014 23:59:27 +0100 Subject: [PATCH 0332/1192] add constant-time memcmp() [skip ci] --- src/headers/tomcrypt_misc.h | 1 + src/misc/mem_neq.c | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 src/misc/mem_neq.c diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index ad23c3914..c5e4ab348 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -39,6 +39,7 @@ int hkdf(int hash_idx, #endif /* LTC_HKDF */ /* ---- MEM routines ---- */ +int mem_neq(const void *a, const void *b, size_t len); void zeromem(volatile void *dst, size_t len); void burn_stack(unsigned long len); diff --git a/src/misc/mem_neq.c b/src/misc/mem_neq.c new file mode 100644 index 000000000..f28e36d1f --- /dev/null +++ b/src/misc/mem_neq.c @@ -0,0 +1,55 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file mem_neq.c + Compare two blocks of memory for inequality. + Steffen Jaeckel +*/ + +/** + Compare two blocks of memory for inequality. + + The usage is similar to that of standard memcmp(), but you can only test + if the memory is equal or not - you can not determine by how much the + first different byte differs. + + @param a The first memory region + @param b The second memory region + @param len The length of the area to compare (octets) + + @return 0 when a and b are equal for len bytes, else they are not equal. +*/ +int mem_neq(const void *a, const void *b, size_t len) +{ + unsigned char ret = 0; + const unsigned char* pa; + const unsigned char* pb; + + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + + pa = a; + pb = b; + + while (len-- > 0) { + ret |= *pa ^ *pb; + ++pa; + ++pb; + } + + return ret; +} + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From d54425adb4a554f7c2a575ffe36d4af13830c5d3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 13 Nov 2014 22:09:20 +0100 Subject: [PATCH 0333/1192] update makefiles --- makefile | 10 +++++----- makefile.icc | 8 +++++--- makefile.mingw | 8 +++++--- makefile.msvc | 8 +++++--- makefile.shared | 8 +++++--- makefile.unix | 8 +++++--- 6 files changed, 30 insertions(+), 20 deletions(-) diff --git a/makefile b/makefile index a7c376d1f..81fb3100e 100644 --- a/makefile +++ b/makefile @@ -120,10 +120,10 @@ OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ -src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_add_aad.o src/encauth/ccm/ccm_init.o src/encauth/ccm/ccm_add_nonce.o \ -src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ +src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ +src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ @@ -173,7 +173,7 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ diff --git a/makefile.icc b/makefile.icc index fb9798e43..5aa092ffd 100644 --- a/makefile.icc +++ b/makefile.icc @@ -103,8 +103,10 @@ OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ -src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ +src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ +src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ @@ -154,7 +156,7 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ diff --git a/makefile.mingw b/makefile.mingw index 3e3a52a6c..76eb2c09b 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -50,8 +50,10 @@ OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ -src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ +src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ +src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ @@ -101,7 +103,7 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ diff --git a/makefile.msvc b/makefile.msvc index d720cf418..3e96bf1e7 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -8,8 +8,10 @@ OBJECTS=src/ciphers/aes/aes_enc.obj src/ciphers/aes/aes.obj src/ciphers/anubis.o src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \ src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \ src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/skipjack.obj \ -src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_memory.obj \ -src/encauth/ccm/ccm_memory_ex.obj src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj \ +src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_add_aad.obj \ +src/encauth/ccm/ccm_add_nonce.obj src/encauth/ccm/ccm_done.obj src/encauth/ccm/ccm_init.obj \ +src/encauth/ccm/ccm_memory.obj src/encauth/ccm/ccm_memory_ex.obj src/encauth/ccm/ccm_process.obj \ +src/encauth/ccm/ccm_reset.obj src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj \ src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ src/encauth/eax/eax_encrypt_authenticate_memory.obj src/encauth/eax/eax_encrypt.obj \ src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \ @@ -59,7 +61,7 @@ src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ -src/misc/hkdf/hkdf_test.obj src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj \ +src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj \ src/misc/pkcs5/pkcs_5_test.obj src/misc/pk_get_oid.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \ src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj \ src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj \ diff --git a/makefile.shared b/makefile.shared index 82d7e064e..8ebbfad3e 100644 --- a/makefile.shared +++ b/makefile.shared @@ -105,8 +105,10 @@ OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ -src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ +src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ +src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ @@ -156,7 +158,7 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ diff --git a/makefile.unix b/makefile.unix index a86cb32b0..00e2fe93c 100644 --- a/makefile.unix +++ b/makefile.unix @@ -44,8 +44,10 @@ OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ -src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \ -src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ +src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ +src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ @@ -95,7 +97,7 @@ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ From e57c92fd23b3f1c38bf18e302db7c1792d5a70d6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 13 Nov 2014 22:09:45 +0100 Subject: [PATCH 0334/1192] replace calls to standard memcmp with constant memcmp where necessary --- src/pk/pkcs1/pkcs_1_oaep_decode.c | 2 +- src/pk/pkcs1/pkcs_1_pss_decode.c | 2 +- src/pk/rsa/rsa_verify_hash.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pk/pkcs1/pkcs_1_oaep_decode.c b/src/pk/pkcs1/pkcs_1_oaep_decode.c index 3a87efe64..4801e0ea3 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -136,7 +136,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, } /* compare the lhash'es */ - if (XMEMCMP(seed, DB, hLen) != 0) { + if (mem_neq(seed, DB, hLen) != 0) { err = CRYPT_OK; goto LBL_ERR; } diff --git a/src/pk/pkcs1/pkcs_1_pss_decode.c b/src/pk/pkcs1/pkcs_1_pss_decode.c index 27aa21675..91f8c2b5e 100644 --- a/src/pk/pkcs1/pkcs_1_pss_decode.c +++ b/src/pk/pkcs1/pkcs_1_pss_decode.c @@ -151,7 +151,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, } /* mask == hash means valid signature */ - if (XMEMCMP(mask, hash, hLen) == 0) { + if (mem_neq(mask, hash, hLen) == 0) { *res = 1; } diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index fc000dee2..aaadba987 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -153,9 +153,9 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, /* test OID */ if ((reallen == outlen) && (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && - (XMEMCMP(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && + (mem_neq(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && (siginfo[1].size == hashlen) && - (XMEMCMP(siginfo[1].data, hash, hashlen) == 0)) { + (mem_neq(siginfo[1].data, hash, hashlen) == 0)) { *stat = 1; } From 1e9e98aa0d7801ce7e9429dba805bbf6cab2ed86 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 13 Nov 2014 22:26:59 +0100 Subject: [PATCH 0335/1192] make pkcs#1 decode functions constant-time as proposed in RFC 3447 only one error return code is used when there are errors while decoding the pkcs#1 format. also, all steps are executed and only the "output" is skipped if something went wrong. Sorry this could break backwards compatibility, since there's no more BUFFER_OVERFLOW messaging. Former error-handling code could also be affected because now there's only OK as return code in cases where "res" is also set to '1'. --- src/pk/pkcs1/pkcs_1_oaep_decode.c | 38 +++++++++++++++---------------- src/pk/pkcs1/pkcs_1_v1_5_decode.c | 25 +++++++++----------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/src/pk/pkcs1/pkcs_1_oaep_decode.c b/src/pk/pkcs1/pkcs_1_oaep_decode.c index 4801e0ea3..6c4da549c 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -28,7 +28,7 @@ @param out [out] Destination of decoding @param outlen [in/out] The max size and resulting size of the decoding @param res [out] Result of decoding, 1==valid, 0==invalid - @return CRYPT_OK if successful (even if invalid) + @return CRYPT_OK if successful */ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, const unsigned char *lparam, unsigned long lparamlen, @@ -38,7 +38,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, { unsigned char *DB, *seed, *mask; unsigned long hLen, x, y, modulus_len; - int err; + int err, ret; LTC_ARGCHK(msg != NULL); LTC_ARGCHK(out != NULL); @@ -85,10 +85,12 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, */ + err = CRYPT_OK; + ret = CRYPT_OK; + /* must have leading 0x00 byte */ if (msg[0] != 0x00) { - err = CRYPT_OK; - goto LBL_ERR; + ret = CRYPT_INVALID_PACKET; } /* now read the masked seed */ @@ -137,8 +139,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, /* compare the lhash'es */ if (mem_neq(seed, DB, hLen) != 0) { - err = CRYPT_OK; - goto LBL_ERR; + ret = CRYPT_INVALID_PACKET; } /* now zeroes before a 0x01 */ @@ -146,28 +147,27 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, /* step... */ } - /* error out if wasn't 0x01 */ + /* error if wasn't 0x01 */ if (x == (modulus_len - hLen - 1) || DB[x] != 0x01) { - err = CRYPT_INVALID_PACKET; - goto LBL_ERR; + ret = CRYPT_INVALID_PACKET; } /* rest is the message (and skip 0x01) */ if ((modulus_len - hLen - 1 - ++x) > *outlen) { - *outlen = modulus_len - hLen - 1 - x; - err = CRYPT_BUFFER_OVERFLOW; - goto LBL_ERR; + ret = CRYPT_INVALID_PACKET; } - /* copy message */ - *outlen = modulus_len - hLen - 1 - x; - XMEMCPY(out, DB + x, modulus_len - hLen - 1 - x); - x += modulus_len - hLen - 1; + if (ret == CRYPT_OK) { + /* copy message */ + *outlen = modulus_len - hLen - 1 - x; + XMEMCPY(out, DB + x, modulus_len - hLen - 1 - x); + x += modulus_len - hLen - 1; - /* valid packet */ - *res = 1; + /* valid packet */ + *res = 1; + } + err = ret; - err = CRYPT_OK; LBL_ERR: #ifdef LTC_CLEAN_STACK zeromem(DB, modulus_len); diff --git a/src/pk/pkcs1/pkcs_1_v1_5_decode.c b/src/pk/pkcs1/pkcs_1_v1_5_decode.c index 5afbb80fc..34bb434a0 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_decode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_decode.c @@ -27,7 +27,7 @@ * @param outlen [in/out] The max size and resulting size of the decoding * @param is_valid [out] Boolean whether the padding was valid * - * @return CRYPT_OK if successful (even if invalid) + * @return CRYPT_OK if successful */ int pkcs_1_v1_5_decode(const unsigned char *msg, unsigned long msglen, @@ -51,11 +51,12 @@ int pkcs_1_v1_5_decode(const unsigned char *msg, return CRYPT_PK_INVALID_SIZE; } + result = CRYPT_OK; + /* separate encoded message */ if ((msg[0] != 0x00) || (msg[1] != (unsigned char)block_type)) { result = CRYPT_INVALID_PACKET; - goto bail; } if (block_type == LTC_PKCS_1_EME) { @@ -69,7 +70,6 @@ int pkcs_1_v1_5_decode(const unsigned char *msg, /* There was no octet with hexadecimal value 0x00 to separate ps from m. */ result = CRYPT_INVALID_PACKET; - goto bail; } } else { for (i = 2; i < modulus_len - 1; i++) { @@ -80,7 +80,6 @@ int pkcs_1_v1_5_decode(const unsigned char *msg, if (msg[i] != 0) { /* There was no octet with hexadecimal value 0x00 to separate ps from m. */ result = CRYPT_INVALID_PACKET; - goto bail; } ps_len = i - 2; @@ -91,22 +90,20 @@ int pkcs_1_v1_5_decode(const unsigned char *msg, /* The length of ps is less than 8 octets. */ result = CRYPT_INVALID_PACKET; - goto bail; } if (*outlen < (msglen - (2 + ps_len + 1))) { - *outlen = msglen - (2 + ps_len + 1); - result = CRYPT_BUFFER_OVERFLOW; - goto bail; + result = CRYPT_INVALID_PACKET; } - *outlen = (msglen - (2 + ps_len + 1)); - XMEMCPY(out, &msg[2 + ps_len + 1], *outlen); + if (result == CRYPT_OK) { + *outlen = (msglen - (2 + ps_len + 1)); + XMEMCPY(out, &msg[2 + ps_len + 1], *outlen); + + /* valid packet */ + *is_valid = 1; + } - /* valid packet */ - *is_valid = 1; - result = CRYPT_OK; -bail: return result; } /* pkcs_1_v1_5_decode */ From 46c038f7d490811c3a2b78e6ed255541035da434 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 13 Nov 2014 22:30:07 +0100 Subject: [PATCH 0336/1192] adapt rsa_test() to modified pkcs#1 decoding routines --- testprof/rsa_test.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index d5d3bf89a..4d9e7ca92 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -138,7 +138,7 @@ int rsa_test(void) { unsigned char in[1024], out[1024], tmp[1024]; rsa_key key, privKey, pubKey; - int hash_idx, prng_idx, stat, stat2, i; + int hash_idx, prng_idx, stat, stat2, i, err; unsigned long rsa_msgsize, len, len2, len3, cnt, cnt2; static unsigned char lparam[] = { 0x01, 0x02, 0x03, 0x04 }; @@ -204,11 +204,12 @@ for (cnt = 0; cnt < len; ) { DO(rsa_encrypt_key(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, hash_idx, &key)); /* change a byte */ out[8] ^= 1; - DO(rsa_decrypt_key(out, len, tmp, &len2, NULL, 0, hash_idx, &stat2, &key)); + DOX((err = rsa_decrypt_key(out, len, tmp, &len2, NULL, 0, hash_idx, &stat2, &key)) + == CRYPT_INVALID_PACKET ? CRYPT_OK:err, "should fail"); /* change a byte back */ out[8] ^= 1; if (len2 != rsa_msgsize) { - fprintf(stderr, "\nrsa_decrypt_key mismatch len %lu (first decrypt)", len2); + fprintf(stderr, "\n%i:rsa_decrypt_key mismatch len %lu (first decrypt)", __LINE__, len2); return 1; } @@ -235,9 +236,10 @@ for (cnt = 0; cnt < len; ) { DO(rsa_encrypt_key(in, rsa_msgsize, out, &len, lparam, sizeof(lparam), &yarrow_prng, prng_idx, hash_idx, &key)); /* change a byte */ out[8] ^= 1; - DO(rsa_decrypt_key(out, len, tmp, &len2, lparam, sizeof(lparam), hash_idx, &stat2, &key)); + DOX((err = rsa_decrypt_key(out, len, tmp, &len2, lparam, sizeof(lparam), hash_idx, &stat2, &key)) + == CRYPT_INVALID_PACKET ? CRYPT_OK:err, "should fail"); if (len2 != rsa_msgsize) { - fprintf(stderr, "\nrsa_decrypt_key mismatch len %lu (first decrypt)", len2); + fprintf(stderr, "\n%i:rsa_decrypt_key mismatch len %lu (first decrypt)", __LINE__, len2); return 1; } /* change a byte back */ From 9782c09a3a64165100f1cd71c3f635d5af9fa225 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 28 Dec 2014 14:00:52 +0100 Subject: [PATCH 0337/1192] use XMEM{CMP, CPY, SET} macros instead of standard versions --- src/encauth/ccm/ccm_init.c | 2 +- src/encauth/ccm/ccm_memory_ex.c | 16 ++++++++-------- src/headers/tomcrypt_hash.h | 2 +- src/misc/pk_get_oid.c | 4 ++-- .../der_decode_subject_public_key_info.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/encauth/ccm/ccm_init.c b/src/encauth/ccm/ccm_init.c index 8a6dfbc5a..7e3bdf8af 100644 --- a/src/encauth/ccm/ccm_init.c +++ b/src/encauth/ccm/ccm_init.c @@ -33,7 +33,7 @@ int ccm_init(ccm_state *ccm, int cipher, LTC_ARGCHK(key != NULL); LTC_ARGCHK(taglen != 0); - memset(ccm, 0, sizeof(ccm_state)); + XMEMSET(ccm, 0, sizeof(ccm_state)); /* check cipher input */ if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c index af44f2fb8..f8e0aea29 100644 --- a/src/encauth/ccm/ccm_memory_ex.c +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -329,17 +329,17 @@ if (CTR == NULL) { } } -// grab the CTR -memcpy(ctrcopy, ctr, 16); + // grab the CTR + XMEMCPY(ctrcopy, ctr, 16); /* setup CTR for the TAG (zero the count) */ -if (CTR == NULL) { - for (y = 15; y > 15 - L; y--) { - ctr[y] = 0x00; + if (CTR == NULL) { + for (y = 15; y > 15 - L; y--) { + ctr[y] = 0x00; + } + } else { + XMEMCPY(ctr, CTR, 16); } -} else { - XMEMCPY(ctr, CTR, 16); -} if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { goto error; diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 3129958ac..c5a4d8187 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -386,7 +386,7 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen) inlen -= block_size; \ } else { \ n = MIN(inlen, (block_size - md-> state_var .curlen)); \ - memcpy(md-> state_var .buf + md-> state_var.curlen, in, (size_t)n); \ + XMEMCPY(md-> state_var .buf + md-> state_var.curlen, in, (size_t)n); \ md-> state_var .curlen += n; \ in += n; \ inlen -= n; \ diff --git a/src/misc/pk_get_oid.c b/src/misc/pk_get_oid.c index 807b5fa1e..c48049eb2 100644 --- a/src/misc/pk_get_oid.c +++ b/src/misc/pk_get_oid.c @@ -27,10 +27,10 @@ int pk_get_oid(int pk, oid_st *st) { switch (pk) { case PKA_RSA: - memcpy(st, &rsa_oid, sizeof(*st)); + XMEMCPY(st, &rsa_oid, sizeof(*st)); break; case PKA_DSA: - memcpy(st, &dsa_oid, sizeof(*st)); + XMEMCPY(st, &dsa_oid, sizeof(*st)); break; default: return CRYPT_INVALID_ARG; diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index b0f2f94ad..71009c694 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -76,7 +76,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in } if ((alg_id[0].size != oid.OIDlen) || - memcmp(oid.OID, alg_id[0].data, oid.OIDlen * sizeof(oid.OID[0]))) { + XMEMCMP(oid.OID, alg_id[0].data, oid.OIDlen * sizeof(oid.OID[0]))) { /* OID mismatch */ err = CRYPT_PK_INVALID_TYPE; goto LBL_ERR; @@ -84,7 +84,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in len = subject_pubkey[1].size/8; if (*public_key_len > len) { - memcpy(public_key, subject_pubkey[1].data, len); + XMEMCPY(public_key, subject_pubkey[1].data, len); *public_key_len = len; } else { *public_key_len = len; From 0b6915740c7fe986a16af2957e1622870cdb493d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jan 2015 22:39:00 +0100 Subject: [PATCH 0338/1192] saferp: enclose macros in do{}while(0) loop --- src/ciphers/safer/saferp.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/ciphers/safer/saferp.c b/src/ciphers/safer/saferp.c index 6ef6d40f2..27580b848 100644 --- a/src/ciphers/safer/saferp.c +++ b/src/ciphers/safer/saferp.c @@ -45,7 +45,7 @@ const struct ltc_cipher_descriptor saferp_desc = * array of 16 bytes b[0..15] which is the block of data */ -#define ROUND(b, i) \ +#define ROUND(b, i) do { \ b[0] = (safer_ebox[(b[0] ^ skey->saferp.K[i][0]) & 255] + skey->saferp.K[i+1][0]) & 255; \ b[1] = safer_lbox[(b[1] + skey->saferp.K[i][1]) & 255] ^ skey->saferp.K[i+1][1]; \ b[2] = safer_lbox[(b[2] + skey->saferp.K[i][2]) & 255] ^ skey->saferp.K[i+1][2]; \ @@ -61,10 +61,11 @@ const struct ltc_cipher_descriptor saferp_desc = b[12] = (safer_ebox[(b[12] ^ skey->saferp.K[i][12]) & 255] + skey->saferp.K[i+1][12]) & 255; \ b[13] = safer_lbox[(b[13] + skey->saferp.K[i][13]) & 255] ^ skey->saferp.K[i+1][13]; \ b[14] = safer_lbox[(b[14] + skey->saferp.K[i][14]) & 255] ^ skey->saferp.K[i+1][14]; \ - b[15] = (safer_ebox[(b[15] ^ skey->saferp.K[i][15]) & 255] + skey->saferp.K[i+1][15]) & 255; + b[15] = (safer_ebox[(b[15] ^ skey->saferp.K[i][15]) & 255] + skey->saferp.K[i+1][15]) & 255; \ +} while (0) /* This is one inverse key application */ -#define iROUND(b, i) \ +#define iROUND(b, i) do { \ b[0] = safer_lbox[(b[0] - skey->saferp.K[i+1][0]) & 255] ^ skey->saferp.K[i][0]; \ b[1] = (safer_ebox[(b[1] ^ skey->saferp.K[i+1][1]) & 255] - skey->saferp.K[i][1]) & 255; \ b[2] = (safer_ebox[(b[2] ^ skey->saferp.K[i+1][2]) & 255] - skey->saferp.K[i][2]) & 255; \ @@ -80,10 +81,11 @@ const struct ltc_cipher_descriptor saferp_desc = b[12] = safer_lbox[(b[12] - skey->saferp.K[i+1][12]) & 255] ^ skey->saferp.K[i][12]; \ b[13] = (safer_ebox[(b[13] ^ skey->saferp.K[i+1][13]) & 255] - skey->saferp.K[i][13]) & 255; \ b[14] = (safer_ebox[(b[14] ^ skey->saferp.K[i+1][14]) & 255] - skey->saferp.K[i][14]) & 255; \ - b[15] = safer_lbox[(b[15] - skey->saferp.K[i+1][15]) & 255] ^ skey->saferp.K[i][15]; + b[15] = safer_lbox[(b[15] - skey->saferp.K[i+1][15]) & 255] ^ skey->saferp.K[i][15]; \ +} while (0) /* This is a forward single layer PHT transform. */ -#define PHT(b) \ +#define PHT(b) do { \ b[0] = (b[0] + (b[1] = (b[0] + b[1]) & 255)) & 255; \ b[2] = (b[2] + (b[3] = (b[3] + b[2]) & 255)) & 255; \ b[4] = (b[4] + (b[5] = (b[5] + b[4]) & 255)) & 255; \ @@ -91,10 +93,11 @@ const struct ltc_cipher_descriptor saferp_desc = b[8] = (b[8] + (b[9] = (b[9] + b[8]) & 255)) & 255; \ b[10] = (b[10] + (b[11] = (b[11] + b[10]) & 255)) & 255; \ b[12] = (b[12] + (b[13] = (b[13] + b[12]) & 255)) & 255; \ - b[14] = (b[14] + (b[15] = (b[15] + b[14]) & 255)) & 255; + b[14] = (b[14] + (b[15] = (b[15] + b[14]) & 255)) & 255; \ +} while (0) /* This is an inverse single layer PHT transform */ -#define iPHT(b) \ +#define iPHT(b) do { \ b[15] = (b[15] - (b[14] = (b[14] - b[15]) & 255)) & 255; \ b[13] = (b[13] - (b[12] = (b[12] - b[13]) & 255)) & 255; \ b[11] = (b[11] - (b[10] = (b[10] - b[11]) & 255)) & 255; \ @@ -103,37 +106,42 @@ const struct ltc_cipher_descriptor saferp_desc = b[5] = (b[5] - (b[4] = (b[4] - b[5]) & 255)) & 255; \ b[3] = (b[3] - (b[2] = (b[2] - b[3]) & 255)) & 255; \ b[1] = (b[1] - (b[0] = (b[0] - b[1]) & 255)) & 255; \ + } while (0) /* This is the "Armenian" Shuffle. It takes the input from b and stores it in b2 */ -#define SHUF(b, b2) \ +#define SHUF(b, b2) do { \ b2[0] = b[8]; b2[1] = b[11]; b2[2] = b[12]; b2[3] = b[15]; \ b2[4] = b[2]; b2[5] = b[1]; b2[6] = b[6]; b2[7] = b[5]; \ b2[8] = b[10]; b2[9] = b[9]; b2[10] = b[14]; b2[11] = b[13]; \ - b2[12] = b[0]; b2[13] = b[7]; b2[14] = b[4]; b2[15] = b[3]; + b2[12] = b[0]; b2[13] = b[7]; b2[14] = b[4]; b2[15] = b[3]; \ +} while (0) /* This is the inverse shuffle. It takes from b and gives to b2 */ -#define iSHUF(b, b2) \ +#define iSHUF(b, b2) do { \ b2[0] = b[12]; b2[1] = b[5]; b2[2] = b[4]; b2[3] = b[15]; \ b2[4] = b[14]; b2[5] = b[7]; b2[6] = b[6]; b2[7] = b[13]; \ b2[8] = b[0]; b2[9] = b[9]; b2[10] = b[8]; b2[11] = b[1]; \ - b2[12] = b[2]; b2[13] = b[11]; b2[14] = b[10]; b2[15] = b[3]; + b2[12] = b[2]; b2[13] = b[11]; b2[14] = b[10]; b2[15] = b[3]; \ +} while (0) /* The complete forward Linear Transform layer. * Note that alternating usage of b and b2. * Each round of LT starts in 'b' and ends in 'b2'. */ -#define LT(b, b2) \ +#define LT(b, b2) do { \ PHT(b); SHUF(b, b2); \ PHT(b2); SHUF(b2, b); \ PHT(b); SHUF(b, b2); \ - PHT(b2); + PHT(b2); \ +} while (0) /* This is the inverse linear transform layer. */ -#define iLT(b, b2) \ +#define iLT(b, b2) do { \ iPHT(b); \ iSHUF(b, b2); iPHT(b2); \ iSHUF(b2, b); iPHT(b); \ - iSHUF(b, b2); iPHT(b2); + iSHUF(b, b2); iPHT(b2); \ +} while (0) #ifdef LTC_SMALL_CODE From e9f9c6fa557735cc08ef0194dbf88f4f2375afa0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jan 2015 22:41:27 +0100 Subject: [PATCH 0339/1192] create a makefile.include it contains all the preparation and targets for the static and shared lib --- makefile | 96 +++---------------------------------------- makefile.include | 103 +++++++++++++++++++++++++++++++++++++++++++++++ makefile.shared | 73 ++------------------------------- 3 files changed, 112 insertions(+), 160 deletions(-) create mode 100644 makefile.include diff --git a/makefile b/makefile index 81fb3100e..ed97a15e2 100644 --- a/makefile +++ b/makefile @@ -3,68 +3,24 @@ # Tom St Denis # Modified by Clay Culver +include makefile.include + +CFLAGS += -c + # The version VERSION=1.17 PLATFORM := $(shell uname | sed -e 's/_.*//') -# Compiler and Linker Names -ifndef PREFIX - PREFIX= -endif - -ifeq ($(CC),cc) - CC = $(PREFIX)gcc -endif -LD=$(PREFIX)ld -AR=$(PREFIX)ar - -# Archiver [makes .a files] -#AR=ar -#ARFLAGS=r - -ifndef MAKE - MAKE=make -endif - # ranlib tools ifndef RANLIB ifeq ($(PLATFORM), Darwin) -RANLIB=$(PREFIX)ranlib -c +RANLIB:=$(PREFIX)ranlib -c else -RANLIB=$(PREFIX)ranlib -endif -endif - -# Compilation flags. Note the += does not write over the user's CFLAGS! -CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -DLTC_SOURCE - -# additional warnings (newer GCC 3.4 and higher) -ifdef GCC_34 -CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wmissing-prototypes \ - -Wmissing-declarations -Wpointer-arith +RANLIB:=$(PREFIX)ranlib endif - -ifndef IGNORE_SPEED - -# optimize for SPEED -CFLAGS += -O3 -funroll-loops - -# add -fomit-frame-pointer. hinders debugging! -CFLAGS += -fomit-frame-pointer - -# optimize for SIZE -#CFLAGS += -Os -DLTC_SMALL_CODE - endif -# older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros -# define this to help -#CFLAGS += -DLTC_NO_ROLC - -# compile for DEBUGING (required for ccmalloc checking!!!) -#CFLAGS += -g3 -DLTC_NO_ASM - #Output filenames for various targets. ifndef LIBNAME LIBNAME=libtomcrypt.a @@ -74,46 +30,6 @@ ifndef LIBTEST endif LIBTEST_S=$(LIBTEST) -HASH=hashsum -CRYPT=encrypt -SMALL=small -TV=tv_gen -MULTI=multi -TIMING=timing -TEST=test -SIZES=sizes -CONSTANTS=constants - -#LIBPATH-The directory for libtomcrypt to be installed to. -#INCPATH-The directory to install the header files for libtomcrypt. -#DATAPATH-The directory to install the pdf docs. -ifndef DESTDIR - DESTDIR= -endif - -ifndef LIBPATH - LIBPATH=/usr/lib -endif -ifndef INCPATH - INCPATH=/usr/include -endif -ifndef DATAPATH - DATAPATH=/usr/share/doc/libtomcrypt/pdf -endif - -#Who do we install as? -ifdef INSTALL_USER -USER=$(INSTALL_USER) -else -USER=root -endif - -ifdef INSTALL_GROUP -GROUP=$(INSTALL_GROUP) -else -GROUP=wheel -endif - #List of objects to compile. #START_INS OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ diff --git a/makefile.include b/makefile.include new file mode 100644 index 000000000..4daafab66 --- /dev/null +++ b/makefile.include @@ -0,0 +1,103 @@ +# +# Include makefile for libtomcrypt +# + +# Compiler and Linker Names +ifndef PREFIX + PREFIX:= +endif + +ifeq ($(CC),cc) + CC := $(PREFIX)gcc +endif +LD:=$(PREFIX)ld +AR:=$(PREFIX)ar + +# Archiver [makes .a files] +#AR=ar +#ARFLAGS=r + +ifndef MAKE + MAKE:=make +endif + + +# Compilation flags. Note the += does not write over the user's CFLAGS! +CFLAGS += -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE + +ifdef OLD_GCC +CFLAGS += -W +# older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros +# define this to help +CFLAGS += -DLTC_NO_ROLC +else +CFLAGS += -Wextra +# additional warnings +CFLAGS += -Wsystem-headers -Wbad-function-cast -Wcast-align +CFLAGS += -Wstrict-prototypes -Wpointer-arith +#CFLAGS += -Wdeclaration-after-statement +endif + +CFLAGS += -Wno-type-limits + +ifdef LTC_DEBUG +# compile for DEBUGING (required for ccmalloc checking!!!) +CFLAGS += -g3 -DLTC_NO_ASM +else + +ifdef LTC_SMALL +# optimize for SIZE +CFLAGS += -Os -DLTC_SMALL_CODE +else + +ifndef IGNORE_SPEED +# optimize for SPEED +CFLAGS += -O3 -funroll-loops + +# add -fomit-frame-pointer. hinders debugging! +CFLAGS += -fomit-frame-pointer +endif + +endif # COMPILE_SMALL +endif # COMPILE_DEBUG + + +HASH=hashsum +CRYPT=encrypt +SMALL=small +TV=tv_gen +MULTI=multi +TIMING=timing +TEST=test +SIZES=sizes +CONSTANTS=constants + +#LIBPATH-The directory for libtomcrypt to be installed to. +#INCPATH-The directory to install the header files for libtomcrypt. +#DATAPATH-The directory to install the pdf docs. +ifndef DESTDIR + DESTDIR= +endif + +ifndef LIBPATH + LIBPATH=/usr/lib +endif +ifndef INCPATH + INCPATH=/usr/include +endif +ifndef DATAPATH + DATAPATH=/usr/share/doc/libtomcrypt/pdf +endif + +#Who do we install as? +ifdef INSTALL_USER +USER=$(INSTALL_USER) +else +USER=root +endif + +ifdef INSTALL_GROUP +GROUP=$(INSTALL_GROUP) +else +GROUP=wheel +endif diff --git a/makefile.shared b/makefile.shared index 8ebbfad3e..2aa205afa 100644 --- a/makefile.shared +++ b/makefile.shared @@ -5,48 +5,18 @@ # Thanks to Zed Shaw for helping debug this on BSD/OSX. # Tom St Denis +include makefile.include + # The version # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION=0:117 # http://www.gnu.org/software/libtool/manual/html_node/Release-numbers.html RELEASE=1.17 -# Compiler and Linker Names -ifeq ($(CC),cc) - CC = gcc -endif + LT ?= libtool LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) -# Compilation flags. Note the += does not write over the user's CFLAGS! -CFLAGS += -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE - -# additional warnings (newer GCC 3.4 and higher) -ifdef GCC_34 -CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wmissing-prototypes \ - -Wmissing-declarations -Wpointer-arith -endif - - -ifndef IGNORE_SPEED - -# optimize for SPEED -CFLAGS += -O3 -funroll-loops - -# add -fomit-frame-pointer. hinders debugging! -CFLAGS += -fomit-frame-pointer - -# optimize for SIZE -#CFLAGS += -Os -DLTC_SMALL_CODE - -endif - -# compile for DEBUGING (required for ccmalloc checking!!!) -#CFLAGS += -g3 - -# older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros -# define this to help -#CFLAGS += -DLTC_NO_ROLC #Output filenames for various targets. ifndef LIBTEST_S @@ -62,43 +32,6 @@ ifndef LIBNAME_S LIBNAME_S=libtomcrypt.a endif -HASH=hashsum -CRYPT=encrypt -SMALL=small -PROF=x86_prof -TV=tv_gen -TEST=test -TIMING=timing - -#LIBPATH-The directory for libtomcrypt to be installed to. -#INCPATH-The directory to install the header files for libtomcrypt. -#DATAPATH-The directory to install the pdf docs. -ifndef DESTDIR - DESTDIR= -endif -ifndef LIBPATH - LIBPATH=/usr/lib -endif -ifndef INCPATH - INCPATH=/usr/include -endif -ifndef DATAPATH - DATAPATH=/usr/share/doc/libtomcrypt/pdf -endif - -#Who do we install as? -ifdef INSTALL_USER -USER=$(INSTALL_USER) -else -USER=root -endif - -ifdef INSTALL_GROUP -GROUP=$(INSTALL_GROUP) -else -GROUP=wheel -endif - #List of objects to compile. #START_INS OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ From 62878de0c5dbb9f89474590d953bbdb339bd2f76 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sun, 4 Jan 2015 22:53:08 -0800 Subject: [PATCH 0340/1192] adjust inline asm requiring constants In order to ensure that the shift is within range, convert the inline assembly routines into macros with compound statements. --- src/headers/tomcrypt_macros.h | 62 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index c2832ab97..f0dcf682a 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -264,21 +264,22 @@ static inline ulong32 ROR(ulong32 word, int i) #ifndef LTC_NO_ROLC -static inline ulong32 ROLc(ulong32 word, const int i) -{ - asm ("roll %2,%0" - :"=r" (word) - :"0" (word),"I" (i)); - return word; -} - -static inline ulong32 RORc(ulong32 word, const int i) -{ - asm ("rorl %2,%0" - :"=r" (word) - :"0" (word),"I" (i)); - return word; -} +#define ROLc(word,i) ({ \ + ulong32 __ROLc_tmp = word; \ + __asm__ ("roll %2, %0" : \ + "=r" (__ROLc_tmp) : \ + "0" (__ROLc_tmp), \ + "I" (i)); \ + __ROLc_tmp; \ + }) +#define RORc(word,i) ({ \ + ulong32 __RORc_tmp = word; \ + __asm__ ("rorl %2, %0" : \ + "=r" (__RORc_tmp) : \ + "0" (__RORc_tmp), \ + "I" (i)); \ + __RORc_tmp; \ + }) #else @@ -363,21 +364,22 @@ static inline ulong64 ROR64(ulong64 word, int i) #ifndef LTC_NO_ROLC -static inline ulong64 ROL64c(ulong64 word, const int i) -{ - asm("rolq %2,%0" - :"=r" (word) - :"0" (word),"J" (i)); - return word; -} - -static inline ulong64 ROR64c(ulong64 word, const int i) -{ - asm("rorq %2,%0" - :"=r" (word) - :"0" (word),"J" (i)); - return word; -} +#define ROL64c(word,i) ({ \ + ulong64 __ROL64c_tmp = word; \ + __asm__ ("rolq %2, %0" : \ + "=r" (__ROL64c_tmp) : \ + "0" (__ROL64c_tmp), \ + "J" (i)); \ + __ROL64c_tmp; \ + }) +#define ROR64c(word,i) ({ \ + ulong64 __ROR64c_tmp = word; \ + __asm__ ("rorq %2, %0" : \ + "=r" (__ROR64c_tmp) : \ + "0" (__ROR64c_tmp), \ + "J" (i)); \ + __ROR64c_tmp; \ + }) #else /* LTC_NO_ROLC */ From 90e968a2023de6dd06da5f4cbf5d6d127f9c9729 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 15 Feb 2015 16:32:12 +0100 Subject: [PATCH 0341/1192] der_decode_subject_public_key_info: fix compile error also make it possible to define min/max RSA key sizes externally This closes #59 --- src/headers/tomcrypt_custom.h | 24 +++++++++++++++++++ src/headers/tomcrypt_pk.h | 4 ---- .../der_decode_subject_public_key_info.c | 4 ++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index d271f8a61..bf3e8f460 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -367,6 +367,30 @@ #endif /* LTC_NO_PK */ +/* define these PK sizes out of LTC_NO_PK + * to have them always defined + */ +#if defined(LTC_MRSA) +/* Min and Max RSA key sizes (in bits) */ +#ifndef MIN_RSA_SIZE +#define MIN_RSA_SIZE 1024 +#endif +#ifndef MAX_RSA_SIZE +#define MAX_RSA_SIZE 4096 +#endif +#endif + +/* in cases where you want ASN.1/DER functionality, but no + * RSA, you can define this externally if 1024 is not enough + */ +#if defined(LTC_MRSA) +#define LTC_DER_MAX_PUBKEY_SIZE MAX_RSA_SIZE +#elif !defined(LTC_DER_MAX_PUBKEY_SIZE) +/* this includes DSA */ +#define LTC_DER_MAX_PUBKEY_SIZE 1024 +#endif + + /* PKCS #1 (RSA) and #5 (Password Handling) stuff */ #ifndef LTC_NO_PKCS diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index e57156475..a474646a3 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -28,10 +28,6 @@ int pk_get_oid(int pk, oid_st *st); /* ---- RSA ---- */ #ifdef LTC_MRSA -/* Min and Max RSA key sizes (in bits) */ -#define MIN_RSA_SIZE 1024 -#define MAX_RSA_SIZE 4096 - /** RSA PKCS style key */ typedef struct Rsa_key { /** Type of key, PK_PRIVATE or PK_PUBLIC */ diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 71009c694..6731c66c5 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -54,7 +54,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in } /* see if the OpenSSL DER format RSA public key will work */ - tmpbuf = XCALLOC(1, MAX_RSA_SIZE*8); + tmpbuf = XCALLOC(1, LTC_DER_MAX_PUBKEY_SIZE*8); if (tmpbuf == NULL) { err = CRYPT_MEM; goto LBL_ERR; @@ -68,7 +68,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in * in a **BIT** string ... so we have to extract it then proceed to convert bit to octet */ LTC_SET_ASN1(subject_pubkey, 0, LTC_ASN1_SEQUENCE, alg_id, 2); - LTC_SET_ASN1(subject_pubkey, 1, LTC_ASN1_RAW_BIT_STRING, tmpbuf, MAX_RSA_SIZE*8); + LTC_SET_ASN1(subject_pubkey, 1, LTC_ASN1_RAW_BIT_STRING, tmpbuf, LTC_DER_MAX_PUBKEY_SIZE*8); err=der_decode_sequence(in, inlen, subject_pubkey, 2UL); if (err != CRYPT_OK) { From dfa938a4f630ee3690fb694def9a75c33944748e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 15 Feb 2015 17:25:45 +0100 Subject: [PATCH 0342/1192] verify outcome when defining LTC_NOTHING check that LTC_NOTHING really creates nothing but the libraries' basic API functions --- src/hashes/helper/hash_memory.c | 2 ++ src/hashes/helper/hash_memory_multi.c | 9 ++++++--- src/headers/tomcrypt_custom.h | 10 ++++++++++ src/math/rand_bn.c | 2 ++ src/misc/pk_get_oid.c | 2 ++ src/prngs/rng_get_bytes.c | 2 ++ src/prngs/rng_make_prng.c | 10 ++++++---- 7 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/hashes/helper/hash_memory.c b/src/hashes/helper/hash_memory.c index 853183a81..53caa5d61 100644 --- a/src/hashes/helper/hash_memory.c +++ b/src/hashes/helper/hash_memory.c @@ -10,6 +10,7 @@ */ #include "tomcrypt.h" +#ifdef LTC_HASH_HELPERS /** @file hash_memory.c Hash memory helper, Tom St Denis @@ -63,6 +64,7 @@ int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned return err; } +#endif /* #ifdef LTC_HASH_HELPERS */ /* $Source$ */ /* $Revision$ */ diff --git a/src/hashes/helper/hash_memory_multi.c b/src/hashes/helper/hash_memory_multi.c index ef39646f6..560d6f6f5 100644 --- a/src/hashes/helper/hash_memory_multi.c +++ b/src/hashes/helper/hash_memory_multi.c @@ -10,13 +10,15 @@ */ #include "tomcrypt.h" #include + +#ifdef LTC_HASH_HELPERS /** @file hash_memory_multi.c Hash (multiple buffers) memory helper, Tom St Denis */ /** - Hash multiple (non-adjacent) blocks of memory at once. + Hash multiple (non-adjacent) blocks of memory at once. @param hash The index of the hash you wish to use @param out [out] Where to store the digest @param outlen [in/out] Max size and resulting size of the digest @@ -24,7 +26,7 @@ @param inlen The length of the data to hash (octets) @param ... tuples of (data,len) pairs to hash, terminated with a (NULL,x) (x=don't care) @return CRYPT_OK if successful -*/ +*/ int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...) { @@ -57,7 +59,7 @@ int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, } va_start(args, inlen); - curptr = in; + curptr = in; curlen = inlen; for (;;) { /* process buf */ @@ -81,6 +83,7 @@ int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, va_end(args); return err; } +#endif /* #ifdef LTC_HASH_HELPERS */ /* $Source$ */ /* $Revision$ */ diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index bf3e8f460..3a2b0dd6e 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -77,6 +77,7 @@ #define LTC_NO_PK #define LTC_NO_PKCS #define LTC_NO_MISC + #define LTC_NO_FILE #endif /* LTC_NOTHING */ /* Easy button? */ @@ -98,6 +99,7 @@ #define LTC_SHA384 #define LTC_SHA256 #define LTC_SHA224 + #define LTC_HASH_HELPERS #define LTC_NO_MACS #define LTC_HMAC @@ -109,6 +111,8 @@ #define LTC_YARROW #define LTC_DEVRANDOM #define LTC_TRY_URANDOM_FIRST + #define LTC_RNG_GET_BYTES + #define LTC_RNG_MAKE_PRNG #define LTC_NO_PK #define LTC_MRSA @@ -241,6 +245,8 @@ #define LTC_RIPEMD256 #define LTC_RIPEMD320 +#define LTC_HASH_HELPERS + #endif /* LTC_NO_HASHES */ /* ---> MAC functions <--- */ @@ -307,6 +313,10 @@ #define LTC_DEVRANDOM /* try /dev/urandom before trying /dev/random */ #define LTC_TRY_URANDOM_FIRST +/* rng_get_bytes() */ +#define LTC_RNG_GET_BYTES +/* rng_make_prng() */ +#define LTC_RNG_MAKE_PRNG #endif /* LTC_NO_PRNGS */ diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c index 39ff73cf9..e7bddd9fb 100755 --- a/src/math/rand_bn.c +++ b/src/math/rand_bn.c @@ -9,6 +9,7 @@ */ #include "tomcrypt.h" +#ifdef LTC_MDSA /** Generate a random number N with given bitlength (note: MSB can be 0) */ @@ -67,3 +68,4 @@ int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng) return CRYPT_OK; } +#endif diff --git a/src/misc/pk_get_oid.c b/src/misc/pk_get_oid.c index c48049eb2..7d3a186c0 100644 --- a/src/misc/pk_get_oid.c +++ b/src/misc/pk_get_oid.c @@ -9,6 +9,7 @@ */ #include "tomcrypt.h" +#ifdef LTC_DER static const oid_st rsa_oid = { { 1, 2, 840, 113549, 1, 1, 1 }, 7, @@ -37,3 +38,4 @@ int pk_get_oid(int pk, oid_st *st) } return CRYPT_OK; } +#endif diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 90338cb8e..becb5bd1d 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -10,6 +10,7 @@ */ #include "tomcrypt.h" +#ifdef LTC_RNG_GET_BYTES /** @file rng_get_bytes.c portable way to get secure random bits to feed a PRNG (Tom St Denis) @@ -150,6 +151,7 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, #endif return 0; } +#endif /* #ifdef LTC_RNG_GET_BYTES */ /* $Source$ */ /* $Revision$ */ diff --git a/src/prngs/rng_make_prng.c b/src/prngs/rng_make_prng.c index 6ba2cbeaa..05af40598 100644 --- a/src/prngs/rng_make_prng.c +++ b/src/prngs/rng_make_prng.c @@ -10,7 +10,8 @@ */ #include "tomcrypt.h" -/** +#ifdef LTC_RNG_MAKE_PRNG +/** @file rng_make_prng.c portable way to get secure random bits to feed a PRNG (Tom St Denis) */ @@ -22,13 +23,13 @@ @param prng [out] PRNG state to initialize @param callback A pointer to a void function for when the RNG is slow, this can be NULL @return CRYPT_OK if successful -*/ -int rng_make_prng(int bits, int wprng, prng_state *prng, +*/ +int rng_make_prng(int bits, int wprng, prng_state *prng, void (*callback)(void)) { unsigned char buf[256]; int err; - + LTC_ARGCHK(prng != NULL); /* check parameter */ @@ -62,6 +63,7 @@ int rng_make_prng(int bits, int wprng, prng_state *prng, #endif return CRYPT_OK; } +#endif /* #ifdef LTC_RNG_MAKE_PRNG */ /* $Source$ */ From f20b5daf39ebd368db28a7a3877bdc0a888ad9a6 Mon Sep 17 00:00:00 2001 From: Pascal Brand Date: Thu, 26 Feb 2015 12:38:21 +0100 Subject: [PATCH 0343/1192] Use XMEM_NEQ instead of mem_neq mem_neq is no more used directly. XMEM_NEQ is used instead, in the same way XMEMCMP, XMEMCPY,... are. Signed-off-by: Pascal Brand --- src/headers/tomcrypt_custom.h | 3 +++ src/pk/pkcs1/pkcs_1_oaep_decode.c | 2 +- src/pk/pkcs1/pkcs_1_pss_decode.c | 2 +- src/pk/rsa/rsa_verify_hash.c | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 3a2b0dd6e..91143cc3b 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -45,6 +45,9 @@ #endif #define XMEMCMP memcmp #endif +#ifndef XMEM_NEQ +#define XMEM_NEQ mem_neq +#endif #ifndef XSTRCMP #ifdef strcmp #define LTC_NO_PROTOTYPES diff --git a/src/pk/pkcs1/pkcs_1_oaep_decode.c b/src/pk/pkcs1/pkcs_1_oaep_decode.c index 6c4da549c..2c768bbc0 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -138,7 +138,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, } /* compare the lhash'es */ - if (mem_neq(seed, DB, hLen) != 0) { + if (XMEM_NEQ(seed, DB, hLen) != 0) { ret = CRYPT_INVALID_PACKET; } diff --git a/src/pk/pkcs1/pkcs_1_pss_decode.c b/src/pk/pkcs1/pkcs_1_pss_decode.c index 91f8c2b5e..025a5d61b 100644 --- a/src/pk/pkcs1/pkcs_1_pss_decode.c +++ b/src/pk/pkcs1/pkcs_1_pss_decode.c @@ -151,7 +151,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, } /* mask == hash means valid signature */ - if (mem_neq(mask, hash, hLen) == 0) { + if (XMEM_NEQ(mask, hash, hLen) == 0) { *res = 1; } diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index aaadba987..9a425cdbd 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -153,9 +153,9 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, /* test OID */ if ((reallen == outlen) && (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && - (mem_neq(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && + (XMEM_NEQ(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && (siginfo[1].size == hashlen) && - (mem_neq(siginfo[1].data, hash, hashlen) == 0)) { + (XMEM_NEQ(siginfo[1].data, hash, hashlen) == 0)) { *stat = 1; } From d24e9cd32d854fbd560ed7c8933a3a995b4c4728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uli=20K=C3=B6hler?= Date: Fri, 27 Mar 2015 21:41:51 +0100 Subject: [PATCH 0344/1192] Fix config file reference --- src/headers/tomcrypt_argchk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_argchk.h b/src/headers/tomcrypt_argchk.h index f0994e40a..f25837ad6 100644 --- a/src/headers/tomcrypt_argchk.h +++ b/src/headers/tomcrypt_argchk.h @@ -1,5 +1,5 @@ /* Defines the LTC_ARGCHK macro used within the library */ -/* ARGTYPE is defined in mycrypt_cfg.h */ +/* ARGTYPE is defined in tomcrypt_cfg.h */ #if ARGTYPE == 0 #include From a8e91afb16d20eee20a44890523ac8748a4528bc Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 17 Apr 2015 08:50:38 +0200 Subject: [PATCH 0345/1192] cygwin/64bit related fix - added !defined(__x86_64__) --- src/headers/tomcrypt_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index ab4397864..cb41c9f24 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -56,7 +56,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); */ /* detect x86-32 machines somewhat */ -#if !defined(__STRICT_ANSI__) && !defined(_WIN64) && ((defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) +#if !defined(__STRICT_ANSI__) && !defined(__x86_64__) && !defined(_WIN64) && ((defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) #define ENDIAN_LITTLE #define ENDIAN_32BITWORD #define LTC_FAST From 6a257e15cd3d10e4d0a5003fef051ed5aca478e0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 17 Apr 2015 08:56:42 +0200 Subject: [PATCH 0346/1192] cygwin related fix - variable name B0 changed to B_0 as it caused collision when compiling libtomcrypt as a perl module (for some reason only on cygwin) --- src/encauth/ccm/ccm_memory_ex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c index f8e0aea29..026579464 100644 --- a/src/encauth/ccm/ccm_memory_ex.c +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -44,7 +44,7 @@ int ccm_memory_ex(int cipher, unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction, - const unsigned char *B0, + const unsigned char *B_0, const unsigned char *CTR, int ctrwidth) { @@ -144,7 +144,7 @@ int ccm_memory_ex(int cipher, /* form B_0 == flags | Nonce N | l(m) */ x = 0; -if (B0 == NULL) { +if (B_0 == NULL) { PAD[x++] = (unsigned char)(((headerlen > 0) ? (1<<6) : 0) | (((*taglen - 2)>>1)<<3) | (L-1)); @@ -172,8 +172,8 @@ if (B0 == NULL) { } } else { - // B0 != NULL - XMEMCPY(PAD, B0, 16); + // B_0 != NULL + XMEMCPY(PAD, B_0, 16); } /* encrypt PAD */ From aeaa6d4a515f390515c21f1678e11b52b81d1ada Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 17 Apr 2015 08:59:35 +0200 Subject: [PATCH 0347/1192] cygwin related fix - variable name B0 changed to B_0 (part 2) --- src/headers/tomcrypt_mac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index fcee6333d..d2518c4a7 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -316,7 +316,7 @@ int ccm_memory_ex(int cipher, unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction, - const unsigned char *B0, + const unsigned char *B_0, const unsigned char *CTR, int ctrwidth); From c28cc9e3e9109952657bb2cfc1bbce338934c94c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 7 May 2015 10:32:12 +0200 Subject: [PATCH 0348/1192] crypt_build_settings: remove build date and time --- src/misc/crypt/crypt.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index c505ed4ab..9d90dfef7 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -18,19 +18,18 @@ const char *crypt_build_settings = "LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n" "LibTomCrypt is public domain software.\n" - "Built on " __DATE__ " at " __TIME__ "\n\n\n" - "Endianness: " +#if defined(INCLUDE_BUILD_DATE) + "Built on " __DATE__ " at " __TIME__ "\n" +#endif + "\n\nEndianness: " #if defined(ENDIAN_NEUTRAL) "neutral\n" -#elif defined(ENDIAN_LITTLE) +#else +#if defined(ENDIAN_LITTLE) "little" - #if defined(ENDIAN_32BITWORD) - " (32-bit words)\n" - #else - " (64-bit words)\n" - #endif #elif defined(ENDIAN_BIG) "big" +#endif #if defined(ENDIAN_32BITWORD) " (32-bit words)\n" #else From 67973b04ae305277c9c1ac11f5465d99d37ba97d Mon Sep 17 00:00:00 2001 From: Sebastian Verschoor Date: Fri, 21 Aug 2015 14:41:41 +0200 Subject: [PATCH 0349/1192] fix #74 --- src/misc/mem_neq.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/misc/mem_neq.c b/src/misc/mem_neq.c index f28e36d1f..945cd90ed 100644 --- a/src/misc/mem_neq.c +++ b/src/misc/mem_neq.c @@ -47,6 +47,11 @@ int mem_neq(const void *a, const void *b, size_t len) ++pb; } + ret |= ret >> 4; + ret |= ret >> 2; + ret |= ret >> 1; + ret &= 1; + return ret; } From 7313d1e6b080d78718af34bc371bf58a012a8e61 Mon Sep 17 00:00:00 2001 From: Pascal Brand Date: Mon, 29 Jun 2015 16:26:42 +0200 Subject: [PATCH 0350/1192] Update ECC timing tests Signed-off-by: Pascal Brand --- testprof/x86_prof.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 2227597a7..aa7e86c93 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -1171,28 +1171,28 @@ void time_ecc(void) unsigned long i, w, x, y, z; int err, stat; static unsigned long sizes[] = { -#ifdef ECC112 +#ifdef LTC_ECC112 112/8, #endif -#ifdef ECC128 +#ifdef LTC_ECC128 128/8, #endif -#ifdef ECC160 +#ifdef LTC_ECC160 160/8, #endif -#ifdef ECC192 +#ifdef LTC_ECC192 192/8, #endif -#ifdef ECC224 +#ifdef LTC_ECC224 224/8, #endif -#ifdef ECC256 +#ifdef LTC_ECC256 256/8, #endif -#ifdef ECC384 +#ifdef LTC_ECC384 384/8, #endif -#ifdef ECC521 +#ifdef LTC_ECC521 521/8, #endif 100000}; From 3605983f09ba47db64cbfa38464f9e36cd91cd0d Mon Sep 17 00:00:00 2001 From: Pascal Brand Date: Tue, 30 Jun 2015 15:52:38 +0200 Subject: [PATCH 0351/1192] Introduce ECC raw algorithms for sign and verify As it is performed on dsa, raw sign and verify on ECC are introduced. Signed-off-by: Pascal Brand --- src/headers/tomcrypt_pk.h | 8 ++++ src/pk/ecc/ecc_sign_hash.c | 81 +++++++++++++++++++++++++--------- src/pk/ecc/ecc_verify_hash.c | 85 ++++++++++++++++++++++++++---------- 3 files changed, 129 insertions(+), 45 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index a474646a3..5b3525ee7 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -301,10 +301,18 @@ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, ecc_key *key); +int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, + void *r, void *s, + prng_state *prng, int wprng, ecc_key *key); + int ecc_sign_hash(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, prng_state *prng, int wprng, ecc_key *key); +int ecc_verify_hash_raw( void *r, void *s, + const unsigned char *hash, unsigned long hashlen, + int *stat, ecc_key *key); + int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, const unsigned char *hash, unsigned long hashlen, int *stat, ecc_key *key); diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index a01dfad37..59757817e 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -24,28 +24,28 @@ #ifdef LTC_MECC /** - Sign a message digest - @param in The message digest to sign - @param inlen The length of the digest - @param out [out] The destination for the signature - @param outlen [in/out] The max size and resulting size of the signature - @param prng An active PRNG state - @param wprng The index of the PRNG you wish to use - @param key A private ECC key + Sign a hash with ECC + @param in The hash to sign + @param inlen The length of the hash to sign + @param r The "r" integer of the signature (caller must initialize with mp_init() first) + @param s The "s" integer of the signature (caller must initialize with mp_init() first) + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param key A private ECC key @return CRYPT_OK if successful */ -int ecc_sign_hash(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, ecc_key *key) +int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, + void *r, void *s, + prng_state *prng, int wprng, ecc_key *key) { ecc_key pubkey; - void *r, *s, *e, *p; + void *e, *p; int err; - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(key != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(r != NULL); + LTC_ARGCHK(s != NULL); + LTC_ARGCHK(key != NULL); /* is this a private key? */ if (key->type != PK_PRIVATE) { @@ -63,7 +63,7 @@ int ecc_sign_hash(const unsigned char *in, unsigned long inlen, /* get the hash and load it as a bignum into 'e' */ /* init the bignums */ - if ((err = mp_init_multi(&r, &s, &p, &e, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&p, &e, NULL)) != CRYPT_OK) { return err; } if ((err = mp_read_radix(p, (char *)key->dp->order, 16)) != CRYPT_OK) { goto errnokey; } @@ -94,16 +94,55 @@ int ecc_sign_hash(const unsigned char *in, unsigned long inlen, } } + err = CRYPT_OK; + goto errnokey; + +error: + ecc_free(&pubkey); +errnokey: + mp_clear_multi(p, e, NULL); + return err; +} + +/** + Sign a message digest + @param in The message digest to sign + @param inlen The length of the digest + @param out [out] The destination for the signature + @param outlen [in/out] The max size and resulting size of the signature + @param prng An active PRNG state + @param wprng The index of the PRNG you wish to use + @param key A private ECC key + @return CRYPT_OK if successful +*/ +int ecc_sign_hash(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, ecc_key *key) +{ + void *r, *s; + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + + if (mp_init_multi(&r, &s, NULL) != CRYPT_OK) { + return CRYPT_MEM; + } + + if ((err = ecc_sign_hash_raw(in, inlen, r, s, prng, wprng, key)) != CRYPT_OK) { + goto error; + } + /* store as SEQUENCE { r, s -- integer } */ err = der_encode_sequence_multi(out, outlen, LTC_ASN1_INTEGER, 1UL, r, LTC_ASN1_INTEGER, 1UL, s, LTC_ASN1_EOL, 0UL, NULL); - goto errnokey; + error: - ecc_free(&pubkey); -errnokey: - mp_clear_multi(r, s, p, e, NULL); + mp_clear_multi(r, s, NULL); return err; } diff --git a/src/pk/ecc/ecc_verify_hash.c b/src/pk/ecc/ecc_verify_hash.c index ba7bba554..afa7f3960 100644 --- a/src/pk/ecc/ecc_verify_hash.c +++ b/src/pk/ecc/ecc_verify_hash.c @@ -34,25 +34,26 @@ */ /** - Verify an ECC signature - @param sig The signature to verify - @param siglen The length of the signature (octets) - @param hash The hash (message digest) that was signed - @param hashlen The length of the hash (octets) - @param stat Result of signature, 1==valid, 0==invalid - @param key The corresponding public ECC key - @return CRYPT_OK if successful (even if the signature is not valid) + Verify a ECC signature + @param r ECC "r" parameter + @param s ECC "s" parameter + @param hash The hash that was signed + @param hashlen The length of the hash that was signed + @param stat [out] The result of the signature verification, 1==valid, 0==invalid + @param key The corresponding public DH key + @return CRYPT_OK if successful (even if the signature is invalid) */ -int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, - int *stat, ecc_key *key) +int ecc_verify_hash_raw( void *r, void *s, + const unsigned char *hash, unsigned long hashlen, + int *stat, ecc_key *key) { ecc_point *mG, *mQ; - void *r, *s, *v, *w, *u1, *u2, *e, *p, *m; - void *mp; + void *v, *w, *u1, *u2, *e, *p, *m; + void *mp = NULL; int err; - LTC_ARGCHK(sig != NULL); + LTC_ARGCHK(r != NULL); + LTC_ARGCHK(s != NULL); LTC_ARGCHK(hash != NULL); LTC_ARGCHK(stat != NULL); LTC_ARGCHK(key != NULL); @@ -67,7 +68,7 @@ int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, } /* allocate ints */ - if ((err = mp_init_multi(&r, &s, &v, &w, &u1, &u2, &p, &e, &m, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&v, &w, &u1, &u2, &p, &e, &m, NULL)) != CRYPT_OK) { return CRYPT_MEM; } @@ -79,14 +80,6 @@ int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, goto error; } - /* parse header */ - if ((err = der_decode_sequence_multi(sig, siglen, - LTC_ASN1_INTEGER, 1UL, r, - LTC_ASN1_INTEGER, 1UL, s, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto error; - } - /* get the order */ if ((err = mp_read_radix(p, (char *)key->dp->order, 16)) != CRYPT_OK) { goto error; } @@ -151,13 +144,57 @@ int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, error: ltc_ecc_del_point(mG); ltc_ecc_del_point(mQ); - mp_clear_multi(r, s, v, w, u1, u2, p, e, m, NULL); + mp_clear_multi(v, w, u1, u2, p, e, m, NULL); if (mp != NULL) { mp_montgomery_free(mp); } return err; } +/** + Verify an ECC signature + @param sig The signature to verify + @param siglen The length of the signature (octets) + @param hash The hash (message digest) that was signed + @param hashlen The length of the hash (octets) + @param stat Result of signature, 1==valid, 0==invalid + @param key The corresponding public ECC key + @return CRYPT_OK if successful (even if the signature is not valid) +*/ + +int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, ecc_key *key) +{ + void *r, *s; + int err; + + LTC_ARGCHK(sig != NULL); + LTC_ARGCHK(hash != NULL); + LTC_ARGCHK(stat != NULL); + LTC_ARGCHK(key != NULL); + + /* allocate ints */ + if ((err = mp_init_multi(&r, &s, NULL)) != CRYPT_OK) { + return CRYPT_MEM; + } + + /* parse header */ + if ((err = der_decode_sequence_multi(sig, siglen, + LTC_ASN1_INTEGER, 1UL, r, + LTC_ASN1_INTEGER, 1UL, s, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto error; + } + + /* do the op */ + err = ecc_verify_hash_raw(r, s, hash, hashlen, stat, key); + +error: + mp_clear_multi(r, s, NULL); + return err; +} + #endif /* $Source$ */ /* $Revision$ */ From 1987a2f97592c592e2881fabd0331f96cf39d70e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 22 Aug 2015 17:29:46 +0200 Subject: [PATCH 0352/1192] add adler32 checksum algorithm --- src/headers/tomcrypt_custom.h | 2 + src/headers/tomcrypt_misc.h | 11 +++ src/misc/adler32.c | 135 ++++++++++++++++++++++++++++++++++ src/misc/crypt/crypt.c | 3 + src/misc/crypt/crypt_sizes.c | 4 + testprof/misc_test.c | 3 + 6 files changed, 158 insertions(+) create mode 100644 src/misc/adler32.c diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 91143cc3b..68b8f1228 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -430,6 +430,8 @@ #define LTC_HKDF #endif /* LTC_NO_HKDF */ +#define LTC_ADLER32 + #endif /* LTC_NO_MISC */ /* cleanup */ diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index c5e4ab348..407dd6576 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -69,6 +69,17 @@ void init_GMP(void); #endif */ +#ifdef LTC_ADLER32 +typedef struct adler32_state_s +{ + unsigned short s[2]; +} adler32_state; + +void adler32_init(adler32_state *ctx); +void adler32_update(adler32_state *ctx, const unsigned char *input, unsigned long length); +void adler32_finish(adler32_state *ctx, void *hash, unsigned long size); +int adler32_test(void); +#endif /* $Source$ */ /* $Revision$ */ diff --git a/src/misc/adler32.c b/src/misc/adler32.c new file mode 100644 index 000000000..3e6f4e546 --- /dev/null +++ b/src/misc/adler32.c @@ -0,0 +1,135 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file adler32.c + Adler-32 checksum algorithm + Written and placed in the public domain by Wei Dai + Adapted for libtomcrypt by Steffen Jaeckel +*/ +#ifdef LTC_ADLER32 + +static const unsigned long _adler32_base = 65521; + +void adler32_init(adler32_state *ctx) +{ + LTC_ARGCHKVD(ctx != NULL); + ctx->s[0] = 1; + ctx->s[1] = 0; +} + +void adler32_update(adler32_state *ctx, const unsigned char *input, unsigned long length) +{ + LTC_ARGCHKVD(ctx != NULL); + LTC_ARGCHKVD(input != NULL); + unsigned long s1 = ctx->s[0]; + unsigned long s2 = ctx->s[1]; + + if (length % 8 != 0) { + do { + s1 += *input++; + s2 += s1; + length--; + } while (length % 8 != 0); + + if (s1 >= _adler32_base) + s1 -= _adler32_base; + s2 %= _adler32_base; + } + + while (length > 0) { + s1 += input[0]; + s2 += s1; + s1 += input[1]; + s2 += s1; + s1 += input[2]; + s2 += s1; + s1 += input[3]; + s2 += s1; + s1 += input[4]; + s2 += s1; + s1 += input[5]; + s2 += s1; + s1 += input[6]; + s2 += s1; + s1 += input[7]; + s2 += s1; + + length -= 8; + input += 8; + + if (s1 >= _adler32_base) + s1 -= _adler32_base; + s2 %= _adler32_base; + } + + LTC_ARGCHKVD(s1 < _adler32_base); + LTC_ARGCHKVD(s2 < _adler32_base); + + ctx->s[0] = (unsigned short)s1; + ctx->s[1] = (unsigned short)s2; +} + +void adler32_finish(adler32_state *ctx, void *hash, unsigned long size) +{ + LTC_ARGCHKVD(ctx != NULL); + LTC_ARGCHKVD(hash != NULL); + + unsigned char* h = hash; + + switch (size) { + default: + h[3] = ctx->s[0] & 0x0ff; + /* no break */ + case 3: + h[2] = (ctx->s[0] >> 8) & 0x0ff; + /* no break */ + case 2: + h[1] = ctx->s[1] & 0x0ff; + /* no break */ + case 1: + h[0] = (ctx->s[1] >> 8) & 0x0ff; + /* no break */ + case 0: + ; + } +} + +int adler32_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + const void* in = "libtomcrypt"; + const unsigned char adler32[] = { 0x1b, 0xe8, 0x04, 0xba }; + unsigned char out[4]; + adler32_state ctx; + adler32_init(&ctx); + adler32_update(&ctx, in, strlen(in)); + adler32_finish(&ctx, &out, 4); + if (XMEMCMP(adler32, out, 4)) { +#ifdef LTC_TEST_DBG + ulong32 _out, _adler32; + LOAD32H(_out, out); + LOAD32H(_adler32, adler32); + printf("adler32 fail! Is: 0x%x Should: 0x%x\n", _out, _adler32); +#endif + return CRYPT_FAIL_TESTVECTOR; + } + return CRYPT_OK; +#endif +} +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 9d90dfef7..0c7dc1179 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -322,6 +322,9 @@ const char *crypt_build_settings = #endif "\nVarious others: " +#if defined(LTC_ADLER32) + " ADLER32 " +#endif #if defined(LTC_BASE64) " BASE64 " #endif diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 187013048..eecb80e29 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -231,6 +231,10 @@ static const crypt_size _crypt_sizes[] = { #endif // sprng has no state as it uses other potentially available sources // like /dev/random. See Developers Guide for more info. + +#ifdef LTC_ADLER32 + _SZ_STRINGIFY_T(adler32_state), +#endif }; /* crypt_get_size() diff --git a/testprof/misc_test.c b/testprof/misc_test.c index 242bb0132..2407ddba6 100644 --- a/testprof/misc_test.c +++ b/testprof/misc_test.c @@ -10,6 +10,9 @@ int misc_test(void) #endif #ifdef LTC_BASE64 DO(base64_test()); +#endif +#ifdef LTC_ADLER32 + DO(adler32_test()); #endif return 0; } From 9585faca2b0c7f08ed5f26f05ba9c1ec70bf140f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 23 Aug 2015 19:45:26 +0200 Subject: [PATCH 0353/1192] re-work debug output of some tests --- makefile.include | 8 ++++++-- src/encauth/ccm/ccm_test.c | 14 +++++--------- src/headers/tomcrypt_misc.h | 5 +++++ src/mac/hmac/hmac_test.c | 22 +++++++--------------- src/misc/pkcs5/pkcs_5_test.c | 26 +++++++++----------------- src/modes/xts/xts_test.c | 12 +++--------- 6 files changed, 35 insertions(+), 52 deletions(-) diff --git a/makefile.include b/makefile.include index 4daafab66..0f4af9487 100644 --- a/makefile.include +++ b/makefile.include @@ -41,8 +41,12 @@ endif CFLAGS += -Wno-type-limits ifdef LTC_DEBUG -# compile for DEBUGING (required for ccmalloc checking!!!) -CFLAGS += -g3 -DLTC_NO_ASM +# compile for DEBUGGING (required for ccmalloc checking!!!) +ifneq (,$(strip $(LTC_DEBUG))) +CFLAGS += -g3 -DLTC_NO_ASM -DLTC_TEST_DBG=$(LTC_DEBUG) +else +CFLAGS += -g3 -DLTC_NO_ASM -DLTC_TEST_DBG +endif else ifdef LTC_SMALL diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 0d5556aa9..f8eb3de54 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -17,10 +17,6 @@ #ifdef LTC_CCM_MODE -#if defined(LTC_CCM_TEST_DBG) && !defined(LTC_NO_TEST) -void print_hex(const char* what, const unsigned char* p, const unsigned long l); -#endif - int ccm_test(void) { #ifndef LTC_TEST @@ -168,7 +164,7 @@ int ccm_test(void) } if (XMEMCMP(buf, tests[x].ct, tests[x].ptlen)) { -#if defined(LTC_CCM_TEST_DBG) +#if defined(LTC_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); print_hex("ct is ", tag, taglen); print_hex("ct should", tests[x].tag, taglen); @@ -176,14 +172,14 @@ int ccm_test(void) return CRYPT_FAIL_TESTVECTOR; } if (tests[x].taglen != taglen) { -#if defined(LTC_CCM_TEST_DBG) +#if defined(LTC_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); printf("taglen %lu (is) %lu (should)\n", taglen, tests[x].taglen); #endif return CRYPT_FAIL_TESTVECTOR; } if (XMEMCMP(tag, tests[x].tag, tests[x].taglen)) { -#if defined(LTC_CCM_TEST_DBG) +#if defined(LTC_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); print_hex("tag is ", tag, tests[x].taglen); print_hex("tag should", tests[x].tag, tests[x].taglen); @@ -221,7 +217,7 @@ int ccm_test(void) } if (XMEMCMP(buf2, tests[x].pt, tests[x].ptlen)) { -#if defined(LTC_CCM_TEST_DBG) +#if defined(LTC_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); print_hex("pt is ", tag, taglen); print_hex("pt should", tests[x].tag, taglen); @@ -229,7 +225,7 @@ int ccm_test(void) return CRYPT_FAIL_TESTVECTOR; } if (XMEMCMP(tag2, tests[x].tag, tests[x].taglen)) { -#if defined(LTC_CCM_TEST_DBG) +#if defined(LTC_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); print_hex("tag is ", tag, tests[x].taglen); print_hex("tag should", tests[x].tag, tests[x].taglen); diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 407dd6576..1f286bda6 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -81,6 +81,11 @@ void adler32_finish(adler32_state *ctx, void *hash, unsigned long size); int adler32_test(void); #endif +/* yeah it's not exactly in misc in the library, but in testprof/x86_prof.c */ +#if defined(LTC_TEST) && defined(LTC_TEST_DBG) +void print_hex(const char* what, const unsigned char* p, const unsigned long l); +#endif + /* $Source$ */ /* $Revision$ */ /* $Date$ */ diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index adec51738..051ab469d 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -603,7 +603,7 @@ int hmac_test(void) ++tested; outlen = sizeof(digest); if((err = hmac_memory(hash, cases[i].key, cases[i].keylen, cases[i].data, cases[i].datalen, digest, &outlen)) != CRYPT_OK) { -#ifdef LTC_HMAC_TEST_DBG +#ifdef LTC_TEST_DBG printf("HMAC-%s test %s, %s\n", cases[i].algo, cases[i].num, error_to_string(err)); #endif return err; @@ -611,25 +611,17 @@ int hmac_test(void) if(XMEMCMP(digest, cases[i].digest, (size_t)hash_descriptor[hash].hashsize) != 0) { failed++; -#ifdef LTC_HMAC_TEST_DBG +#ifdef LTC_TEST_DBG { - unsigned int j; - printf("\nHMAC-%s test %s:\n", cases[i].algo, cases[i].num); - printf( "Result: 0x"); - for(j=0; j < hash_descriptor[hash].hashsize; j++) { - printf("%2x ", digest[j]); - } - printf("\nCorrect: 0x"); - for(j=0; j < hash_descriptor[hash].hashsize; j++) { - printf("%2x ", cases[i].digest[j]); - } - printf("\n"); + printf("\nHMAC-%s test %s: Failed\n", cases[i].algo, cases[i].num); + print_hex("is", digest, hash_descriptor[hash].hashsize); + print_hex("should", cases[i].digest, hash_descriptor[hash].hashsize); return CRYPT_FAIL_TESTVECTOR; } -#endif -#ifdef LTC_HMAC_TEST_DBG +#if LTC_TEST_DBG > 1 } else { printf("HMAC-%s test %s: Passed\n", cases[i].algo, cases[i].num); +#endif #endif } } diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index 85ccdfa42..c53e334cc 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -120,7 +120,7 @@ int pkcs_5_test (void) int hash = find_hash("sha1"); if (hash == -1) { -#ifdef LTC_PKCS_5_TEST_DBG +#ifdef LTC_TEST_DBG printf("PKCS#5 test: 'sha1' hash not found\n"); #endif return CRYPT_ERROR; @@ -132,7 +132,7 @@ int pkcs_5_test (void) (unsigned char*)cases_5_2[i].S, cases_5_2[i].S_len, cases_5_2[i].c, hash, DK, &dkLen)) != CRYPT_OK) { -#ifdef LTC_PKCS_5_TEST_DBG +#ifdef LTC_TEST_DBG printf("PKCS#5 test #%d: %s\n", i, error_to_string(err)); #endif return err; @@ -140,7 +140,7 @@ int pkcs_5_test (void) if (dkLen != cases_5_2[i].dkLen) { -#ifdef LTC_PKCS_5_TEST_DBG +#ifdef LTC_TEST_DBG printf("PKCS#5 test #%d: %lu != %lu\n", i, dkLen, cases_5_2[i].dkLen); #endif return CRYPT_FAIL_TESTVECTOR; @@ -148,25 +148,17 @@ int pkcs_5_test (void) if(XMEMCMP(DK, cases_5_2[i].DK, (size_t)cases_5_2[i].dkLen) != 0) { ++failed; -#ifdef LTC_PKCS_5_TEST_DBG +#ifdef LTC_TEST_DBG { - unsigned int j; - printf("\nPKCS#5 test #%d:\n", i); - printf( "Result: 0x"); - for(j=0; j < cases_5_2[i].dkLen; j++) { - printf("%02x ", DK[j]); - } - printf("\nCorrect: 0x"); - for(j=0; j < cases_5_2[i].dkLen; j++) { - printf("%02x ", cases_5_2[i].DK[j]); - } - printf("\n"); + printf("\nPKCS#5 test #%d: Failed\n", i); + print_hex("is", DK, cases_5_2[i].dkLen); + print_hex("should", cases_5_2[i].DK, cases_5_2[i].dkLen); return CRYPT_FAIL_TESTVECTOR; } -#endif -#ifdef LTC_PKCS_5_TEST_DBG +#if LTC_TEST_DBG > 1 } else { printf("PKCS#5 test #%d: Passed\n", i); +#endif #endif } } diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index 89f00b746..8b9cd4f63 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -12,10 +12,6 @@ #ifdef LTC_XTS_MODE -#if defined(LTC_XTS_TEST_DBG) && !defined(LTC_NO_TEST) -void print_hex(const char* what, const unsigned char* p, const unsigned long l); -#endif - /** Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects Returns CRYPT_OK upon success. @@ -188,9 +184,6 @@ int xts_test(void) } } else { -#ifdef LTC_XTS_TEST_DBG - printf("\nTestcase #%d with original length %lu and half of it %lu\n", i, tests[i].PTLEN, len); -#endif err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); if (err != CRYPT_OK) { xts_done(&xts); @@ -204,7 +197,8 @@ int xts_test(void) } if (XMEMCMP(OUT, tests[i].CTX, tests[i].PTLEN)) { -#ifdef LTC_XTS_TEST_DBG +#ifdef LTC_TEST_DBG + printf("\nTestcase #%d with original length %lu and half of it %lu\n", i, tests[i].PTLEN, len); printf("\nencrypt\n"); print_hex("should", tests[i].CTX, tests[i].PTLEN); print_hex("is", OUT, tests[i].PTLEN); @@ -235,7 +229,7 @@ int xts_test(void) } if (XMEMCMP(OUT, tests[i].PTX, tests[i].PTLEN)) { -#ifdef LTC_XTS_TEST_DBG +#ifdef LTC_TEST_DBG printf("\ndecrypt\n"); print_hex("should", tests[i].PTX, tests[i].PTLEN); print_hex("is", OUT, tests[i].PTLEN); From ee03c97cdeb869030d78b1da8c4268c2ddb574cf Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 23 Aug 2015 22:02:42 +0200 Subject: [PATCH 0354/1192] add crc32 --- src/headers/tomcrypt_custom.h | 2 + src/headers/tomcrypt_misc.h | 12 ++ src/misc/crc32.c | 205 ++++++++++++++++++++++++++++++++++ src/misc/crypt/crypt.c | 3 + src/misc/crypt/crypt_sizes.c | 3 + testprof/misc_test.c | 3 + 6 files changed, 228 insertions(+) create mode 100644 src/misc/crc32.c diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 68b8f1228..42a3e6ffd 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -432,6 +432,8 @@ #define LTC_ADLER32 +#define LTC_CRC32 + #endif /* LTC_NO_MISC */ /* cleanup */ diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 1f286bda6..d53807719 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -81,6 +81,18 @@ void adler32_finish(adler32_state *ctx, void *hash, unsigned long size); int adler32_test(void); #endif +#ifdef LTC_CRC32 +typedef struct crc32_state_s +{ + ulong32 crc; +} crc32_state; + +void crc32_init(crc32_state *ctx); +void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long length); +void crc32_finish(crc32_state *ctx, void *hash, unsigned long size); +int crc32_test(void); +#endif + /* yeah it's not exactly in misc in the library, but in testprof/x86_prof.c */ #if defined(LTC_TEST) && defined(LTC_TEST_DBG) void print_hex(const char* what, const unsigned char* p, const unsigned long l); diff --git a/src/misc/crc32.c b/src/misc/crc32.c new file mode 100644 index 000000000..d9072ea35 --- /dev/null +++ b/src/misc/crc32.c @@ -0,0 +1,205 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file crc.c + CRC-32 checksum algorithm + Written and placed in the public domain by Wei Dai + Adapted for libtomcrypt by Steffen Jaeckel +*/ +#ifdef LTC_CRC32 + +static const ulong32 _CRC32_NEGL = 0xffffffffUL; + +#if defined(ENDIAN_LITTLE) || defined(ENDIAN_NEUTRAL) +#define CRC32_INDEX(c) (c & 0xff) +#define CRC32_SHIFTED(c) (c >> 8) +#else +#define CRC32_INDEX(c) (c >> 24) +#define CRC32_SHIFTED(c) (c << 8) +#endif + + +/* Table of CRC-32's of all single byte values (made by makecrc.c) */ +static const ulong32 crc32_m_tab[] = +{ +#if defined(ENDIAN_LITTLE) || defined(ENDIAN_NEUTRAL) + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +#else + 0x00000000L, 0x96300777L, 0x2c610eeeL, 0xba510999L, 0x19c46d07L, + 0x8ff46a70L, 0x35a563e9L, 0xa395649eL, 0x3288db0eL, 0xa4b8dc79L, + 0x1ee9d5e0L, 0x88d9d297L, 0x2b4cb609L, 0xbd7cb17eL, 0x072db8e7L, + 0x911dbf90L, 0x6410b71dL, 0xf220b06aL, 0x4871b9f3L, 0xde41be84L, + 0x7dd4da1aL, 0xebe4dd6dL, 0x51b5d4f4L, 0xc785d383L, 0x56986c13L, + 0xc0a86b64L, 0x7af962fdL, 0xecc9658aL, 0x4f5c0114L, 0xd96c0663L, + 0x633d0ffaL, 0xf50d088dL, 0xc8206e3bL, 0x5e10694cL, 0xe44160d5L, + 0x727167a2L, 0xd1e4033cL, 0x47d4044bL, 0xfd850dd2L, 0x6bb50aa5L, + 0xfaa8b535L, 0x6c98b242L, 0xd6c9bbdbL, 0x40f9bcacL, 0xe36cd832L, + 0x755cdf45L, 0xcf0dd6dcL, 0x593dd1abL, 0xac30d926L, 0x3a00de51L, + 0x8051d7c8L, 0x1661d0bfL, 0xb5f4b421L, 0x23c4b356L, 0x9995bacfL, + 0x0fa5bdb8L, 0x9eb80228L, 0x0888055fL, 0xb2d90cc6L, 0x24e90bb1L, + 0x877c6f2fL, 0x114c6858L, 0xab1d61c1L, 0x3d2d66b6L, 0x9041dc76L, + 0x0671db01L, 0xbc20d298L, 0x2a10d5efL, 0x8985b171L, 0x1fb5b606L, + 0xa5e4bf9fL, 0x33d4b8e8L, 0xa2c90778L, 0x34f9000fL, 0x8ea80996L, + 0x18980ee1L, 0xbb0d6a7fL, 0x2d3d6d08L, 0x976c6491L, 0x015c63e6L, + 0xf4516b6bL, 0x62616c1cL, 0xd8306585L, 0x4e0062f2L, 0xed95066cL, + 0x7ba5011bL, 0xc1f40882L, 0x57c40ff5L, 0xc6d9b065L, 0x50e9b712L, + 0xeab8be8bL, 0x7c88b9fcL, 0xdf1ddd62L, 0x492dda15L, 0xf37cd38cL, + 0x654cd4fbL, 0x5861b24dL, 0xce51b53aL, 0x7400bca3L, 0xe230bbd4L, + 0x41a5df4aL, 0xd795d83dL, 0x6dc4d1a4L, 0xfbf4d6d3L, 0x6ae96943L, + 0xfcd96e34L, 0x468867adL, 0xd0b860daL, 0x732d0444L, 0xe51d0333L, + 0x5f4c0aaaL, 0xc97c0dddL, 0x3c710550L, 0xaa410227L, 0x10100bbeL, + 0x86200cc9L, 0x25b56857L, 0xb3856f20L, 0x09d466b9L, 0x9fe461ceL, + 0x0ef9de5eL, 0x98c9d929L, 0x2298d0b0L, 0xb4a8d7c7L, 0x173db359L, + 0x810db42eL, 0x3b5cbdb7L, 0xad6cbac0L, 0x2083b8edL, 0xb6b3bf9aL, + 0x0ce2b603L, 0x9ad2b174L, 0x3947d5eaL, 0xaf77d29dL, 0x1526db04L, + 0x8316dc73L, 0x120b63e3L, 0x843b6494L, 0x3e6a6d0dL, 0xa85a6a7aL, + 0x0bcf0ee4L, 0x9dff0993L, 0x27ae000aL, 0xb19e077dL, 0x44930ff0L, + 0xd2a30887L, 0x68f2011eL, 0xfec20669L, 0x5d5762f7L, 0xcb676580L, + 0x71366c19L, 0xe7066b6eL, 0x761bd4feL, 0xe02bd389L, 0x5a7ada10L, + 0xcc4add67L, 0x6fdfb9f9L, 0xf9efbe8eL, 0x43beb717L, 0xd58eb060L, + 0xe8a3d6d6L, 0x7e93d1a1L, 0xc4c2d838L, 0x52f2df4fL, 0xf167bbd1L, + 0x6757bca6L, 0xdd06b53fL, 0x4b36b248L, 0xda2b0dd8L, 0x4c1b0aafL, + 0xf64a0336L, 0x607a0441L, 0xc3ef60dfL, 0x55df67a8L, 0xef8e6e31L, + 0x79be6946L, 0x8cb361cbL, 0x1a8366bcL, 0xa0d26f25L, 0x36e26852L, + 0x95770cccL, 0x03470bbbL, 0xb9160222L, 0x2f260555L, 0xbe3bbac5L, + 0x280bbdb2L, 0x925ab42bL, 0x046ab35cL, 0xa7ffd7c2L, 0x31cfd0b5L, + 0x8b9ed92cL, 0x1daede5bL, 0xb0c2649bL, 0x26f263ecL, 0x9ca36a75L, + 0x0a936d02L, 0xa906099cL, 0x3f360eebL, 0x85670772L, 0x13570005L, + 0x824abf95L, 0x147ab8e2L, 0xae2bb17bL, 0x381bb60cL, 0x9b8ed292L, + 0x0dbed5e5L, 0xb7efdc7cL, 0x21dfdb0bL, 0xd4d2d386L, 0x42e2d4f1L, + 0xf8b3dd68L, 0x6e83da1fL, 0xcd16be81L, 0x5b26b9f6L, 0xe177b06fL, + 0x7747b718L, 0xe65a0888L, 0x706a0fffL, 0xca3b0666L, 0x5c0b0111L, + 0xff9e658fL, 0x69ae62f8L, 0xd3ff6b61L, 0x45cf6c16L, 0x78e20aa0L, + 0xeed20dd7L, 0x5483044eL, 0xc2b30339L, 0x612667a7L, 0xf71660d0L, + 0x4d476949L, 0xdb776e3eL, 0x4a6ad1aeL, 0xdc5ad6d9L, 0x660bdf40L, + 0xf03bd837L, 0x53aebca9L, 0xc59ebbdeL, 0x7fcfb247L, 0xe9ffb530L, + 0x1cf2bdbdL, 0x8ac2bacaL, 0x3093b353L, 0xa6a3b424L, 0x0536d0baL, + 0x9306d7cdL, 0x2957de54L, 0xbf67d923L, 0x2e7a66b3L, 0xb84a61c4L, + 0x021b685dL, 0x942b6f2aL, 0x37be0bb4L, 0xa18e0cc3L, 0x1bdf055aL, + 0x8def022dL +#endif +}; + +void crc32_init(crc32_state *ctx) +{ + LTC_ARGCHKVD(ctx != NULL); + ctx->crc = _CRC32_NEGL; +} + +void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long length) +{ + LTC_ARGCHKVD(ctx != NULL); + LTC_ARGCHKVD(input != NULL); + ulong32 crc = ctx->crc; + + while (length--) + crc = crc32_m_tab[CRC32_INDEX(crc) ^ *input++] ^ CRC32_SHIFTED(crc); + + ctx->crc = crc; +} + +void crc32_finish(crc32_state *ctx, void *hash, unsigned long size) +{ + LTC_ARGCHKVD(ctx != NULL); + LTC_ARGCHKVD(hash != NULL); + + unsigned char* h = hash; + unsigned long i; + + ulong32 crc = ctx->crc; + crc ^= _CRC32_NEGL; + for (i = 0; i < size; i++) { + h[i] = ((unsigned char*)&(crc))[i]; + } +} + +int crc32_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + const void* in = "libtomcrypt"; + const unsigned char crc32[] = { 0xef, 0x76, 0x73, 0xb3 }; + unsigned char out[4]; + crc32_state ctx; + crc32_init(&ctx); + crc32_update(&ctx, in, strlen(in)); + crc32_finish(&ctx, out, 4); + if (XMEMCMP(crc32, out, 4)) { +#ifdef LTC_TEST_DBG + ulong32 _out, _crc32; + LOAD32H(_out, out); + LOAD32H(_crc32, crc32); + printf("crc32 fail! Is: 0x%x Should: 0x%x\n", _out, _crc32); +#endif + return CRYPT_FAIL_TESTVECTOR; + } + return CRYPT_OK; +#endif +} +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 0c7dc1179..08ffee4a1 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -331,6 +331,9 @@ const char *crypt_build_settings = #if defined(LTC_BASE64_URL) " BASE64-URL-SAFE " #endif +#if defined(LTC_CRC32) + " CRC32 " +#endif #if defined(LTC_DER) " DER " #endif diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index eecb80e29..e6e752462 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -235,6 +235,9 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_ADLER32 _SZ_STRINGIFY_T(adler32_state), #endif +#ifdef LTC_CRC32 + _SZ_STRINGIFY_T(crc32_state), +#endif }; /* crypt_get_size() diff --git a/testprof/misc_test.c b/testprof/misc_test.c index 2407ddba6..007ad1112 100644 --- a/testprof/misc_test.c +++ b/testprof/misc_test.c @@ -13,6 +13,9 @@ int misc_test(void) #endif #ifdef LTC_ADLER32 DO(adler32_test()); +#endif +#ifdef LTC_CRC32 + DO(crc32_test()); #endif return 0; } From 61efc10852f48fb0b7a3ac3de0a12f8c79bd79ac Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 23 Aug 2015 22:03:55 +0200 Subject: [PATCH 0355/1192] update makefiles --- makefile | 25 +++++++++++++------------ makefile.icc | 25 +++++++++++++------------ makefile.mingw | 25 +++++++++++++------------ makefile.msvc | 25 +++++++++++++------------ makefile.shared | 25 +++++++++++++------------ makefile.unix | 25 +++++++++++++------------ 6 files changed, 78 insertions(+), 72 deletions(-) diff --git a/makefile b/makefile index ed97a15e2..af49335ad 100644 --- a/makefile +++ b/makefile @@ -75,18 +75,19 @@ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ diff --git a/makefile.icc b/makefile.icc index 5aa092ffd..b7594b23c 100644 --- a/makefile.icc +++ b/makefile.icc @@ -142,18 +142,19 @@ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ diff --git a/makefile.mingw b/makefile.mingw index 76eb2c09b..8e3624b14 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -89,18 +89,19 @@ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ diff --git a/makefile.msvc b/makefile.msvc index 3e96bf1e7..4c3621994 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -47,18 +47,19 @@ src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_don src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \ src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \ src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ -src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/base64/base64_decode.obj \ -src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crypt/crypt_argchk.obj \ -src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \ -src/misc/crypt/crypt_constants.obj src/misc/crypt/crypt_find_cipher_any.obj \ -src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_id.obj \ -src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash.obj \ -src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ -src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ -src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_inits.obj \ -src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \ -src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_register_cipher.obj \ -src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/adler32.obj \ +src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crc32.obj \ +src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj \ +src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_constants.obj \ +src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher.obj \ +src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash_any.obj \ +src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_id.obj \ +src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ +src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ +src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ +src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ +src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ +src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj \ diff --git a/makefile.shared b/makefile.shared index 2aa205afa..6ddeaf0e7 100644 --- a/makefile.shared +++ b/makefile.shared @@ -77,18 +77,19 @@ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ diff --git a/makefile.unix b/makefile.unix index 00e2fe93c..60ee70c04 100644 --- a/makefile.unix +++ b/makefile.unix @@ -83,18 +83,19 @@ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/base64/base64_decode.o \ -src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ From a13257094ea9cd3dc5f899b4b5daaec83c7e8d80 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 23 Aug 2015 22:58:30 +0200 Subject: [PATCH 0356/1192] handle LTC_NO_FAST before handling LTC_FAST --- src/headers/tomcrypt_cfg.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index cb41c9f24..c2aa3e15d 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -100,6 +100,10 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); typedef unsigned long ulong32; #endif +#ifdef LTC_NO_FAST + #undef LTC_FAST +#endif + #ifdef LTC_FAST #if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc nor icc */ #error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway @@ -128,12 +132,6 @@ typedef ulong64 ltc_mp_digit; typedef ulong32 ltc_mp_digit; #endif -#ifdef LTC_NO_FAST - #ifdef LTC_FAST - #undef LTC_FAST - #endif -#endif - /* No asm is a quick way to disable anything "not portable" */ #ifdef LTC_NO_ASM #undef ENDIAN_LITTLE From 99214b53f60ff15a0a07b174a1e8696cf14ea77b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 25 Aug 2015 23:58:08 +0200 Subject: [PATCH 0357/1192] add .clang-format --- .clang-format | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..686711f3f --- /dev/null +++ b/.clang-format @@ -0,0 +1,42 @@ +--- +AccessModifierOffset: -2 +ConstructorInitializerIndentWidth: 4 +AlignEscapedNewlinesLeft: false +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakTemplateDeclarations: false +AlwaysBreakBeforeMultilineStrings: false +BreakBeforeBinaryOperators: false +BreakConstructorInitializersBeforeComma: false +BinPackParameters: true +ColumnLimit: 120 +ConstructorInitializerAllOnOneLineOrOnePerLine: true +DerivePointerBinding: true +ExperimentalAutoDetectBinPacking: false +IndentCaseLabels: true +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCSpaceBeforeProtocolList: false +PenaltyBreakComment: 60 +PenaltyBreakString: 1000 +PenaltyBreakFirstLessLess: 120 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerBindsToType: false +SpacesBeforeTrailingComments: 1 +Cpp11BracedListStyle: false +Standard: Cpp03 +IndentWidth: 3 +TabWidth: 8 +UseTab: Never +BreakBeforeBraces: Linux +IndentFunctionDeclarationAfterType: false +SpacesInParentheses: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpaceAfterControlStatementKeyword: true +SpaceBeforeAssignmentOperators: true +... + From 5c3f177b3467ab7ec30f34c11238eb62d3d56b6a Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Tue, 7 Jul 2015 16:47:55 +0200 Subject: [PATCH 0358/1192] Add function pointers for accelerated XTS to ltc_cipher_descriptor Similar to what already exists for other modes. Signed-off-by: Jerome Forissier --- src/ciphers/aes/aes.c | 8 ++--- src/ciphers/anubis.c | 2 +- src/ciphers/blowfish.c | 2 +- src/ciphers/camellia.c | 2 +- src/ciphers/cast5.c | 2 +- src/ciphers/des.c | 4 +-- src/ciphers/kasumi.c | 2 +- src/ciphers/khazad.c | 2 +- src/ciphers/kseed.c | 2 +- src/ciphers/multi2.c | 2 +- src/ciphers/noekeon.c | 2 +- src/ciphers/rc2.c | 2 +- src/ciphers/rc5.c | 2 +- src/ciphers/rc6.c | 2 +- src/ciphers/safer/safer.c | 8 ++--- src/ciphers/safer/saferp.c | 2 +- src/ciphers/skipjack.c | 2 +- src/ciphers/twofish/twofish.c | 2 +- src/ciphers/xtea.c | 2 +- src/headers/tomcrypt_cipher.h | 30 ++++++++++++++++++ src/misc/crypt/crypt_cipher_descriptor.c | 2 +- src/modes/xts/xts_decrypt.c | 37 +++++++++++++++------- src/modes/xts/xts_encrypt.c | 40 +++++++++++++++++------- 23 files changed, 111 insertions(+), 50 deletions(-) diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index aea8e19d1..cc9d99f39 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -49,7 +49,7 @@ const struct ltc_cipher_descriptor rijndael_desc = 6, 16, 32, 16, 10, SETUP, ECB_ENC, ECB_DEC, ECB_TEST, ECB_DONE, ECB_KS, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; const struct ltc_cipher_descriptor aes_desc = @@ -58,7 +58,7 @@ const struct ltc_cipher_descriptor aes_desc = 6, 16, 32, 16, 10, SETUP, ECB_ENC, ECB_DEC, ECB_TEST, ECB_DONE, ECB_KS, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; #else @@ -74,7 +74,7 @@ const struct ltc_cipher_descriptor rijndael_enc_desc = 6, 16, 32, 16, 10, SETUP, ECB_ENC, NULL, NULL, ECB_DONE, ECB_KS, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; const struct ltc_cipher_descriptor aes_enc_desc = @@ -83,7 +83,7 @@ const struct ltc_cipher_descriptor aes_enc_desc = 6, 16, 32, 16, 10, SETUP, ECB_ENC, NULL, NULL, ECB_DONE, ECB_KS, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; #endif diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index 226a1900f..c3b3c2f52 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -29,7 +29,7 @@ const struct ltc_cipher_descriptor anubis_desc = { &anubis_test, &anubis_done, &anubis_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; #define MIN_N 4 diff --git a/src/ciphers/blowfish.c b/src/ciphers/blowfish.c index cbe694277..9a78733ab 100644 --- a/src/ciphers/blowfish.c +++ b/src/ciphers/blowfish.c @@ -27,7 +27,7 @@ const struct ltc_cipher_descriptor blowfish_desc = &blowfish_test, &blowfish_done, &blowfish_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const ulong32 ORIG_P[16 + 2] = { diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 3497cfa82..c152ff78b 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -28,7 +28,7 @@ const struct ltc_cipher_descriptor camellia_desc = { &camellia_test, &camellia_done, &camellia_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const ulong32 SP1110[] = { diff --git a/src/ciphers/cast5.c b/src/ciphers/cast5.c index 817ec5a06..f4f9154b6 100644 --- a/src/ciphers/cast5.c +++ b/src/ciphers/cast5.c @@ -27,7 +27,7 @@ const struct ltc_cipher_descriptor cast5_desc = { &cast5_test, &cast5_done, &cast5_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const ulong32 S1[256] = { diff --git a/src/ciphers/des.c b/src/ciphers/des.c index b706b074b..cd343b389 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -31,7 +31,7 @@ const struct ltc_cipher_descriptor des_desc = &des_test, &des_done, &des_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; const struct ltc_cipher_descriptor des3_desc = @@ -45,7 +45,7 @@ const struct ltc_cipher_descriptor des3_desc = &des3_test, &des3_done, &des3_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const ulong32 bytebit[8] = diff --git a/src/ciphers/kasumi.c b/src/ciphers/kasumi.c index c6113319d..61369e07f 100644 --- a/src/ciphers/kasumi.c +++ b/src/ciphers/kasumi.c @@ -33,7 +33,7 @@ const struct ltc_cipher_descriptor kasumi_desc = { &kasumi_test, &kasumi_done, &kasumi_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static u16 FI( u16 in, u16 subkey ) diff --git a/src/ciphers/khazad.c b/src/ciphers/khazad.c index 285e8b13e..1cea03c55 100644 --- a/src/ciphers/khazad.c +++ b/src/ciphers/khazad.c @@ -28,7 +28,7 @@ const struct ltc_cipher_descriptor khazad_desc = { &khazad_test, &khazad_done, &khazad_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; #define R 8 diff --git a/src/ciphers/kseed.c b/src/ciphers/kseed.c index e8f0fa891..003074ca7 100644 --- a/src/ciphers/kseed.c +++ b/src/ciphers/kseed.c @@ -29,7 +29,7 @@ const struct ltc_cipher_descriptor kseed_desc = { &kseed_test, &kseed_done, &kseed_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const ulong32 SS0[256] = { diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index 65249a3ba..d1e4a6c79 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -116,7 +116,7 @@ const struct ltc_cipher_descriptor multi2_desc = { &multi2_test, &multi2_done, &multi2_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; int multi2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index 40c07116e..f748d3e97 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -27,7 +27,7 @@ const struct ltc_cipher_descriptor noekeon_desc = &noekeon_test, &noekeon_done, &noekeon_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const ulong32 RC[] = { diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 87ccb6da8..dbe5696c3 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -36,7 +36,7 @@ const struct ltc_cipher_descriptor rc2_desc = { &rc2_test, &rc2_done, &rc2_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; /* 256-entry permutation table, probably derived somehow from pi */ diff --git a/src/ciphers/rc5.c b/src/ciphers/rc5.c index b267a5a39..bd964e2c9 100644 --- a/src/ciphers/rc5.c +++ b/src/ciphers/rc5.c @@ -29,7 +29,7 @@ const struct ltc_cipher_descriptor rc5_desc = &rc5_test, &rc5_done, &rc5_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const ulong32 stab[50] = { diff --git a/src/ciphers/rc6.c b/src/ciphers/rc6.c index 611c00cab..48d413dbe 100644 --- a/src/ciphers/rc6.c +++ b/src/ciphers/rc6.c @@ -28,7 +28,7 @@ const struct ltc_cipher_descriptor rc6_desc = &rc6_test, &rc6_done, &rc6_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const ulong32 stab[44] = { diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index 434a7db9f..865eee3db 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -45,7 +45,7 @@ const struct ltc_cipher_descriptor &safer_k64_test, &safer_done, &safer_64_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, safer_sk64_desc = { @@ -57,7 +57,7 @@ const struct ltc_cipher_descriptor &safer_sk64_test, &safer_done, &safer_64_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, safer_k128_desc = { @@ -69,7 +69,7 @@ const struct ltc_cipher_descriptor &safer_sk128_test, &safer_done, &safer_128_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, safer_sk128_desc = { @@ -81,7 +81,7 @@ const struct ltc_cipher_descriptor &safer_sk128_test, &safer_done, &safer_128_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; /******************* Constants ************************************************/ diff --git a/src/ciphers/safer/saferp.c b/src/ciphers/safer/saferp.c index 27580b848..e5f8bf39e 100644 --- a/src/ciphers/safer/saferp.c +++ b/src/ciphers/safer/saferp.c @@ -31,7 +31,7 @@ const struct ltc_cipher_descriptor saferp_desc = &saferp_test, &saferp_done, &saferp_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; /* ROUND(b,i) diff --git a/src/ciphers/skipjack.c b/src/ciphers/skipjack.c index 9b2e10192..4333a9f65 100644 --- a/src/ciphers/skipjack.c +++ b/src/ciphers/skipjack.c @@ -28,7 +28,7 @@ const struct ltc_cipher_descriptor skipjack_desc = &skipjack_test, &skipjack_done, &skipjack_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const unsigned char sbox[256] = { diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index be6c7d546..b443a7c15 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -35,7 +35,7 @@ const struct ltc_cipher_descriptor twofish_desc = &twofish_test, &twofish_done, &twofish_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; /* the two polynomials */ diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index 963824d33..4b3b52bdf 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -28,7 +28,7 @@ const struct ltc_cipher_descriptor xtea_desc = &xtea_test, &xtea_done, &xtea_keysize, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index edf25c049..da3a6b72d 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -553,6 +553,36 @@ extern struct ltc_cipher_descriptor { const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); + + /** Accelerated XTS encryption + @param pt Plaintext + @param ct Ciphertext + @param blocks The number of complete blocks to process + @param tweak The 128-bit encryption tweak (input/output). + The tweak should not be encrypted on input, but + next tweak will be copied encrypted on output. + @param skey1 The first scheduled key context + @param skey2 The second scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_xts_encrypt)(const unsigned char *pt, unsigned char *ct, + unsigned long blocks, unsigned char *tweak, symmetric_key *skey1, + symmetric_key *skey2); + + /** Accelerated XTS decryption + @param ct Ciphertext + @param pt Plaintext + @param blocks The number of complete blocks to process + @param tweak The 128-bit encryption tweak (input/output). + The tweak should not be encrypted on input, but + next tweak will be copied encrypted on output. + @param skey1 The first scheduled key context + @param skey2 The second scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_xts_decrypt)(const unsigned char *ct, unsigned char *pt, + unsigned long blocks, unsigned char *tweak, symmetric_key *skey1, + symmetric_key *skey2); } cipher_descriptor[]; #ifdef LTC_BLOWFISH diff --git a/src/misc/crypt/crypt_cipher_descriptor.c b/src/misc/crypt/crypt_cipher_descriptor.c index 20aac578a..2e35787af 100644 --- a/src/misc/crypt/crypt_cipher_descriptor.c +++ b/src/misc/crypt/crypt_cipher_descriptor.c @@ -16,7 +16,7 @@ */ struct ltc_cipher_descriptor cipher_descriptor[TAB_SIZE] = { -{ NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } +{ NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; LTC_MUTEX_GLOBAL(ltc_cipher_mutex) diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index f73770de5..453ea003d 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -87,22 +87,36 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char return CRYPT_INVALID_ARG; } - /* encrypt the tweak */ - if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) { - return err; - } - - /* for i = 0 to m-2 do */ if (mo == 0) { lim = m; } else { lim = m - 1; } - for (i = 0; i < lim; i++) { - err = tweak_uncrypt(ct, pt, T, xts); - ct += 16; - pt += 16; + if (cipher_descriptor[xts->cipher].accel_xts_encrypt && lim > 0) { + + /* use accelerated decryption for whole blocks */ + if ((err = cipher_descriptor[xts->cipher].accel_xts_decrypt(ct, pt, + lim, tweak, &xts->key1, &xts->key2) != CRYPT_OK)) { + return err; + } + ct += lim * 16; + pt += lim * 16; + + /* tweak is encrypted on output */ + XMEMCPY(T, tweak, sizeof(T)); + } else { + /* encrypt the tweak */ + if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, + &xts->key2)) != CRYPT_OK) { + return err; + } + + for (i = 0; i < lim; i++) { + err = tweak_uncrypt(ct, pt, T, xts); + ct += 16; + pt += 16; + } } /* if ptlen not divide 16 then */ @@ -131,7 +145,8 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char } /* Decrypt the tweak back */ - if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) { + if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, + &xts->key2)) != CRYPT_OK) { return err; } diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index 6474b13d6..136538bf3 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -85,27 +85,42 @@ int xts_encrypt( m = ptlen >> 4; mo = ptlen & 15; - /* must have at least one full block */ + /* must have at least one full block */ if (m == 0) { return CRYPT_INVALID_ARG; } - /* encrypt the tweak */ - if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) { - return err; - } - - /* for i = 0 to m-2 do */ if (mo == 0) { lim = m; } else { lim = m - 1; } - for (i = 0; i < lim; i++) { - err = tweak_crypt(pt, ct, T, xts); - ct += 16; - pt += 16; + if (cipher_descriptor[xts->cipher].accel_xts_encrypt && lim > 0) { + + /* use accelerated encryption for whole blocks */ + if ((err = cipher_descriptor[xts->cipher].accel_xts_encrypt(pt, ct, lim, + tweak, &xts->key1, &xts->key2) != CRYPT_OK)) { + return err; + } + ct += lim * 16; + pt += lim * 16; + + /* tweak is encrypted on output */ + XMEMCPY(T, tweak, sizeof(T)); + } else { + + /* encrypt the tweak */ + if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, + &xts->key2)) != CRYPT_OK) { + return err; + } + + for (i = 0; i < lim; i++) { + err = tweak_crypt(pt, ct, T, xts); + ct += 16; + pt += 16; + } } /* if ptlen not divide 16 then */ @@ -132,7 +147,8 @@ int xts_encrypt( } /* Decrypt the tweak back */ - if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) { + if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, + &xts->key2)) != CRYPT_OK) { return err; } From b25d04ed94658e8ba0434e3b73daf3e83232ceeb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 25 Aug 2015 23:07:47 +0200 Subject: [PATCH 0359/1192] fix pointer check --- src/modes/xts/xts_decrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index 453ea003d..90c2e368d 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -93,7 +93,7 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char lim = m - 1; } - if (cipher_descriptor[xts->cipher].accel_xts_encrypt && lim > 0) { + if (cipher_descriptor[xts->cipher].accel_xts_decrypt && lim > 0) { /* use accelerated decryption for whole blocks */ if ((err = cipher_descriptor[xts->cipher].accel_xts_decrypt(ct, pt, From 181d2f2df746bc696f6681ef1be226cc212b8803 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 26 Aug 2015 00:02:50 +0200 Subject: [PATCH 0360/1192] auto-format xts code --- src/modes/xts/xts_decrypt.c | 91 +++++++++++++++++------------------ src/modes/xts/xts_done.c | 5 +- src/modes/xts/xts_encrypt.c | 76 ++++++++++++++---------------- src/modes/xts/xts_init.c | 18 +++---- src/modes/xts/xts_mult_x.c | 25 +++++----- src/modes/xts/xts_test.c | 94 ++++++++++++++++++------------------- 6 files changed, 145 insertions(+), 164 deletions(-) diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index 90c2e368d..6afe93617 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** - Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects -*/ +/** + Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects + */ #ifdef LTC_XTS_MODE @@ -24,23 +24,23 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char /* tweak encrypt block i */ #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)&P[x]) = *((LTC_FAST_TYPE*)&C[x]) ^ *((LTC_FAST_TYPE*)&T[x]); + *((LTC_FAST_TYPE *)&P[x]) = *((LTC_FAST_TYPE *)&C[x]) ^ *((LTC_FAST_TYPE *)&T[x]); } #else for (x = 0; x < 16; x++) { - P[x] = C[x] ^ T[x]; + P[x] = C[x] ^ T[x]; } #endif - - err = cipher_descriptor[xts->cipher].ecb_decrypt(P, P, &xts->key1); + + err = cipher_descriptor[xts->cipher].ecb_decrypt(P, P, &xts->key1); #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)&P[x]) ^= *((LTC_FAST_TYPE*)&T[x]); + *((LTC_FAST_TYPE *)&P[x]) ^= *((LTC_FAST_TYPE *)&T[x]); } #else for (x = 0; x < 16; x++) { - P[x] = P[x] ^ T[x]; + P[x] = P[x] ^ T[x]; } #endif @@ -48,30 +48,28 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char xts_mult_x(T); return err; -} +} /** XTS Decryption - @param ct [in] Ciphertext - @param ptlen Length of plaintext (and ciphertext) - @param pt [out] Plaintext - @param tweak [in] The 128--bit encryption tweak (e.g. sector number) - @param xts The XTS structure - Returns CRYPT_OK upon success -*/int xts_decrypt( - const unsigned char *ct, unsigned long ptlen, - unsigned char *pt, - unsigned char *tweak, - symmetric_xts *xts) + @param ct [in] Ciphertext + @param ptlen Length of plaintext (and ciphertext) + @param pt [out] Plaintext + @param tweak [in] The 128--bit encryption tweak (e.g. sector number) + @param xts The XTS structure + Returns CRYPT_OK upon success + */ +int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, unsigned char *tweak, + symmetric_xts *xts) { unsigned char PP[16], CC[16], T[16]; unsigned long i, m, mo, lim; - int err; + int err; /* check inputs */ - LTC_ARGCHK(pt != NULL); - LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); LTC_ARGCHK(tweak != NULL); - LTC_ARGCHK(xts != NULL); + LTC_ARGCHK(xts != NULL); /* check if valid */ if ((err = cipher_is_valid(xts->cipher)) != CRYPT_OK) { @@ -79,7 +77,7 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char } /* get number of blocks */ - m = ptlen >> 4; + m = ptlen >> 4; mo = ptlen & 15; /* must have at least one full block */ @@ -95,30 +93,29 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char if (cipher_descriptor[xts->cipher].accel_xts_decrypt && lim > 0) { - /* use accelerated decryption for whole blocks */ - if ((err = cipher_descriptor[xts->cipher].accel_xts_decrypt(ct, pt, - lim, tweak, &xts->key1, &xts->key2) != CRYPT_OK)) { - return err; - } - ct += lim * 16; - pt += lim * 16; + /* use accelerated decryption for whole blocks */ + if ((err = cipher_descriptor[xts->cipher].accel_xts_decrypt(ct, pt, lim, tweak, &xts->key1, &xts->key2) != + CRYPT_OK)) { + return err; + } + ct += lim * 16; + pt += lim * 16; - /* tweak is encrypted on output */ - XMEMCPY(T, tweak, sizeof(T)); + /* tweak is encrypted on output */ + XMEMCPY(T, tweak, sizeof(T)); } else { /* encrypt the tweak */ - if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, - &xts->key2)) != CRYPT_OK) { - return err; + if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) { + return err; } for (i = 0; i < lim; i++) { - err = tweak_uncrypt(ct, pt, T, xts); - ct += 16; - pt += 16; + err = tweak_uncrypt(ct, pt, T, xts); + ct += 16; + pt += 16; } } - + /* if ptlen not divide 16 then */ if (mo > 0) { XMEMCPY(CC, T, 16); @@ -131,11 +128,11 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char /* Pm = first ptlen % 16 bytes of PP */ for (i = 0; i < mo; i++) { - CC[i] = ct[16+i]; - pt[16+i] = PP[i]; + CC[i] = ct[16 + i]; + pt[16 + i] = PP[i]; } for (; i < 16; i++) { - CC[i] = PP[i]; + CC[i] = PP[i]; } /* Pm-1 = Tweak uncrypt CC */ @@ -145,8 +142,7 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char } /* Decrypt the tweak back */ - if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, - &xts->key2)) != CRYPT_OK) { + if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) { return err; } @@ -158,4 +154,3 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char /* $Source$ */ /* $Revision$ */ /* $Date$ */ - diff --git a/src/modes/xts/xts_done.c b/src/modes/xts/xts_done.c index 7c04277a6..a7a85ed34 100644 --- a/src/modes/xts/xts_done.c +++ b/src/modes/xts/xts_done.c @@ -10,13 +10,13 @@ */ #include "tomcrypt.h" -/** +/** Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects */ #ifdef LTC_XTS_MODE -/** Terminate XTS state +/** Terminate XTS state @param XTS The state to terminate */ void xts_done(symmetric_xts *xts) @@ -31,4 +31,3 @@ void xts_done(symmetric_xts *xts) /* $Source$ */ /* $Revision$ */ /* $Date$ */ - diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index 136538bf3..4f114d7a2 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** - Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects -*/ +/** + Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects + */ #ifdef LTC_XTS_MODE @@ -24,25 +24,25 @@ static int tweak_crypt(const unsigned char *P, unsigned char *C, unsigned char * /* tweak encrypt block i */ #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)&C[x]) = *((LTC_FAST_TYPE*)&P[x]) ^ *((LTC_FAST_TYPE*)&T[x]); + *((LTC_FAST_TYPE *)&C[x]) = *((LTC_FAST_TYPE *)&P[x]) ^ *((LTC_FAST_TYPE *)&T[x]); } #else for (x = 0; x < 16; x++) { C[x] = P[x] ^ T[x]; } #endif - + if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(C, C, &xts->key1)) != CRYPT_OK) { return err; } #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)&C[x]) ^= *((LTC_FAST_TYPE*)&T[x]); + *((LTC_FAST_TYPE *)&C[x]) ^= *((LTC_FAST_TYPE *)&T[x]); } #else for (x = 0; x < 16; x++) { - C[x] = C[x] ^ T[x]; + C[x] = C[x] ^ T[x]; } #endif @@ -50,31 +50,28 @@ static int tweak_crypt(const unsigned char *P, unsigned char *C, unsigned char * xts_mult_x(T); return CRYPT_OK; -} +} /** XTS Encryption - @param pt [in] Plaintext - @param ptlen Length of plaintext (and ciphertext) - @param ct [out] Ciphertext - @param tweak [in] The 128--bit encryption tweak (e.g. sector number) - @param xts The XTS structure - Returns CRYPT_OK upon success -*/ -int xts_encrypt( - const unsigned char *pt, unsigned long ptlen, - unsigned char *ct, - unsigned char *tweak, - symmetric_xts *xts) + @param pt [in] Plaintext + @param ptlen Length of plaintext (and ciphertext) + @param ct [out] Ciphertext + @param tweak [in] The 128--bit encryption tweak (e.g. sector number) + @param xts The XTS structure + Returns CRYPT_OK upon success + */ +int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tweak, + symmetric_xts *xts) { unsigned char PP[16], CC[16], T[16]; unsigned long i, m, mo, lim; - int err; + int err; /* check inputs */ - LTC_ARGCHK(pt != NULL); - LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); LTC_ARGCHK(tweak != NULL); - LTC_ARGCHK(xts != NULL); + LTC_ARGCHK(xts != NULL); /* check if valid */ if ((err = cipher_is_valid(xts->cipher)) != CRYPT_OK) { @@ -82,7 +79,7 @@ int xts_encrypt( } /* get number of blocks */ - m = ptlen >> 4; + m = ptlen >> 4; mo = ptlen & 15; /* must have at least one full block */ @@ -99,9 +96,9 @@ int xts_encrypt( if (cipher_descriptor[xts->cipher].accel_xts_encrypt && lim > 0) { /* use accelerated encryption for whole blocks */ - if ((err = cipher_descriptor[xts->cipher].accel_xts_encrypt(pt, ct, lim, - tweak, &xts->key1, &xts->key2) != CRYPT_OK)) { - return err; + if ((err = cipher_descriptor[xts->cipher].accel_xts_encrypt(pt, ct, lim, tweak, &xts->key1, &xts->key2) != + CRYPT_OK)) { + return err; } ct += lim * 16; pt += lim * 16; @@ -111,18 +108,17 @@ int xts_encrypt( } else { /* encrypt the tweak */ - if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, - &xts->key2)) != CRYPT_OK) { - return err; + if ((err = cipher_descriptor[xts->cipher].ecb_encrypt(tweak, T, &xts->key2)) != CRYPT_OK) { + return err; } for (i = 0; i < lim; i++) { - err = tweak_crypt(pt, ct, T, xts); - ct += 16; - pt += 16; + err = tweak_crypt(pt, ct, T, xts); + ct += 16; + pt += 16; } } - + /* if ptlen not divide 16 then */ if (mo > 0) { /* CC = tweak encrypt block m-1 */ @@ -132,12 +128,12 @@ int xts_encrypt( /* Cm = first ptlen % 16 bytes of CC */ for (i = 0; i < mo; i++) { - PP[i] = pt[16+i]; - ct[16+i] = CC[i]; + PP[i] = pt[16 + i]; + ct[16 + i] = CC[i]; } for (; i < 16; i++) { - PP[i] = CC[i]; + PP[i] = CC[i]; } /* Cm-1 = Tweak encrypt PP */ @@ -147,8 +143,7 @@ int xts_encrypt( } /* Decrypt the tweak back */ - if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, - &xts->key2)) != CRYPT_OK) { + if ((err = cipher_descriptor[xts->cipher].ecb_decrypt(T, tweak, &xts->key2)) != CRYPT_OK) { return err; } @@ -160,4 +155,3 @@ int xts_encrypt( /* $Source$ */ /* $Revision$ */ /* $Date$ */ - diff --git a/src/modes/xts/xts_init.c b/src/modes/xts/xts_init.c index f38c01e93..687596e46 100644 --- a/src/modes/xts/xts_init.c +++ b/src/modes/xts/xts_init.c @@ -10,13 +10,12 @@ */ #include "tomcrypt.h" -/** +/** Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects */ #ifdef LTC_XTS_MODE - /** Start XTS mode @param cipher The index of the cipher to use @param key1 The encrypt key @@ -26,19 +25,15 @@ @param xts [out] XTS structure Returns CRYPT_OK upon success. */ -int xts_start( int cipher, - const unsigned char *key1, - const unsigned char *key2, - unsigned long keylen, - int num_rounds, - symmetric_xts *xts) +int xts_start(int cipher, const unsigned char *key1, const unsigned char *key2, unsigned long keylen, int num_rounds, + symmetric_xts *xts) { int err; /* check inputs */ - LTC_ARGCHK(key1 != NULL); - LTC_ARGCHK(key2 != NULL); - LTC_ARGCHK(xts != NULL); + LTC_ARGCHK(key1 != NULL); + LTC_ARGCHK(key2 != NULL); + LTC_ARGCHK(xts != NULL); /* check if valid */ if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { @@ -66,4 +61,3 @@ int xts_start( int cipher, /* $Source$ */ /* $Revision$ */ /* $Date$ */ - diff --git a/src/modes/xts/xts_mult_x.c b/src/modes/xts/xts_mult_x.c index e5b7c11f9..c1eecef2f 100644 --- a/src/modes/xts/xts_mult_x.c +++ b/src/modes/xts/xts_mult_x.c @@ -10,28 +10,28 @@ */ #include "tomcrypt.h" -/** +/** Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects */ #ifdef LTC_XTS_MODE -/** multiply by x +/** multiply by x @param I The value to multiply by x (LFSR shift) */ void xts_mult_x(unsigned char *I) { - int x; - unsigned char t, tt; + int x; + unsigned char t, tt; - for (x = t = 0; x < 16; x++) { - tt = I[x] >> 7; - I[x] = ((I[x] << 1) | t) & 0xFF; - t = tt; - } - if (tt) { - I[0] ^= 0x87; - } + for (x = t = 0; x < 16; x++) { + tt = I[x] >> 7; + I[x] = ((I[x] << 1) | t) & 0xFF; + t = tt; + } + if (tt) { + I[0] ^= 0x87; + } } #endif @@ -39,4 +39,3 @@ void xts_mult_x(unsigned char *I) /* $Source$ */ /* $Revision$ */ /* $Date$ */ - diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index 8b9cd4f63..e81d82447 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -14,6 +14,7 @@ /** Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects + Returns CRYPT_OK upon success. */ int xts_test(void) @@ -21,7 +22,8 @@ int xts_test(void) #ifdef LTC_NO_TEST return CRYPT_NOP; #else - static const struct { + static const struct + { int keylen; unsigned char key1[32]; unsigned char key2[32]; @@ -143,9 +145,9 @@ int xts_test(void) }; unsigned char OUT[512], Torg[16], T[16]; - ulong64 seq; + ulong64 seq; symmetric_xts xts; - int i, j, err, idx; + int i, j, err, idx; unsigned long len; /* AES can be under rijndael or aes... try to find it */ @@ -154,51 +156,51 @@ int xts_test(void) return CRYPT_NOP; } } - for (j = 0; j < 2; j++) { - for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { + for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { /* skip the cases where * the length is smaller than 2*blocklen * or the length is not a multiple of 32 */ if ((j == 1) && ((tests[i].PTLEN < 32) || (tests[i].PTLEN % 32))) { - continue; + continue; } - len = tests[i].PTLEN/2; + len = tests[i].PTLEN / 2; - err = xts_start(idx, tests[i].key1, tests[i].key2, tests[i].keylen/2, 0, &xts); + err = xts_start(idx, tests[i].key1, tests[i].key2, tests[i].keylen / 2, 0, &xts); if (err != CRYPT_OK) { return err; } seq = tests[i].seqnum; - STORE64L(seq,Torg); - XMEMSET(Torg+8, 0, 8); + STORE64L(seq, Torg); + XMEMSET(Torg + 8, 0, 8); XMEMCPY(T, Torg, sizeof(T)); if (j == 0) { - err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; - } - } - else { - err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; - } - err = xts_encrypt(&tests[i].PTX[len], len, &OUT[len], T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; - } + err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + } else { + err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + err = xts_encrypt(&tests[i].PTX[len], len, &OUT[len], T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } } if (XMEMCMP(OUT, tests[i].CTX, tests[i].PTLEN)) { #ifdef LTC_TEST_DBG - printf("\nTestcase #%d with original length %lu and half of it %lu\n", i, tests[i].PTLEN, len); + printf("\nTestcase #%d with original length %lu and half of it " + "%lu\n", + i, tests[i].PTLEN, len); printf("\nencrypt\n"); print_hex("should", tests[i].CTX, tests[i].PTLEN); print_hex("is", OUT, tests[i].PTLEN); @@ -209,23 +211,22 @@ int xts_test(void) XMEMCPY(T, Torg, sizeof(T)); if (j == 0) { - err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; - } - } - else { - err = xts_decrypt(tests[i].CTX, len, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; - } - err = xts_decrypt(&tests[i].CTX[len], len, &OUT[len], T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; - } + err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + } else { + err = xts_decrypt(tests[i].CTX, len, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + err = xts_decrypt(&tests[i].CTX[len], len, &OUT[len], T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } } if (XMEMCMP(OUT, tests[i].PTX, tests[i].PTLEN)) { @@ -238,7 +239,7 @@ int xts_test(void) return CRYPT_FAIL_TESTVECTOR; } xts_done(&xts); - } + } } return CRYPT_OK; #endif @@ -249,4 +250,3 @@ int xts_test(void) /* $Source$ */ /* $Revision$ */ /* $Date$ */ - From f9c8c9c229994649ba3a2ae11bd3e94a51a33f45 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 26 Aug 2015 00:05:07 +0200 Subject: [PATCH 0361/1192] also test XTS accelerators --- src/modes/xts/xts_test.c | 197 +++++++++++++++++++++++++-------------- 1 file changed, 129 insertions(+), 68 deletions(-) diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index e81d82447..e274eb021 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -12,6 +12,54 @@ #ifdef LTC_XTS_MODE +static int _xts_test_accel_xts_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long blocks, + unsigned char *tweak, symmetric_key *skey1, symmetric_key *skey2) +{ + int ret; + symmetric_xts xts; + + /* AES can be under rijndael or aes... try to find it */ + if ((xts.cipher = find_cipher("aes")) == -1) { + if ((xts.cipher = find_cipher("rijndael")) == -1) { + return CRYPT_NOP; + } + } + void *orig = cipher_descriptor[xts.cipher].accel_xts_encrypt; + cipher_descriptor[xts.cipher].accel_xts_encrypt = NULL; + + XMEMCPY(&xts.key1, skey1, sizeof(symmetric_key)); + XMEMCPY(&xts.key2, skey2, sizeof(symmetric_key)); + + ret = xts_encrypt(pt, blocks << 4, ct, tweak, &xts); + cipher_descriptor[xts.cipher].accel_xts_encrypt = orig; + + return ret; +} + +static int _xts_test_accel_xts_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long blocks, + unsigned char *tweak, symmetric_key *skey1, symmetric_key *skey2) +{ + int ret; + symmetric_xts xts; + + /* AES can be under rijndael or aes... try to find it */ + if ((xts.cipher = find_cipher("aes")) == -1) { + if ((xts.cipher = find_cipher("rijndael")) == -1) { + return CRYPT_NOP; + } + } + void *orig = cipher_descriptor[xts.cipher].accel_xts_decrypt; + cipher_descriptor[xts.cipher].accel_xts_decrypt = NULL; + + XMEMCPY(&xts.key1, skey1, sizeof(symmetric_key)); + XMEMCPY(&xts.key2, skey2, sizeof(symmetric_key)); + + ret = xts_decrypt(ct, blocks << 4, pt, tweak, &xts); + cipher_descriptor[xts.cipher].accel_xts_decrypt = orig; + + return ret; +} + /** Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects @@ -147,7 +195,7 @@ int xts_test(void) unsigned char OUT[512], Torg[16], T[16]; ulong64 seq; symmetric_xts xts; - int i, j, err, idx; + int i, j, k, err, idx; unsigned long len; /* AES can be under rijndael or aes... try to find it */ @@ -156,89 +204,102 @@ int xts_test(void) return CRYPT_NOP; } } - for (j = 0; j < 2; j++) { - for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { - /* skip the cases where - * the length is smaller than 2*blocklen - * or the length is not a multiple of 32 - */ - if ((j == 1) && ((tests[i].PTLEN < 32) || (tests[i].PTLEN % 32))) { - continue; - } - len = tests[i].PTLEN / 2; - - err = xts_start(idx, tests[i].key1, tests[i].key2, tests[i].keylen / 2, 0, &xts); - if (err != CRYPT_OK) { - return err; - } - - seq = tests[i].seqnum; - STORE64L(seq, Torg); - XMEMSET(Torg + 8, 0, 8); - - XMEMCPY(T, Torg, sizeof(T)); - if (j == 0) { - err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; + for (k = 0; k < 4; ++k) { + cipher_descriptor[idx].accel_xts_encrypt = NULL; + cipher_descriptor[idx].accel_xts_decrypt = NULL; + if (k & 0x1) { + cipher_descriptor[idx].accel_xts_encrypt = _xts_test_accel_xts_encrypt; + } + if (k & 0x2) { + cipher_descriptor[idx].accel_xts_decrypt = _xts_test_accel_xts_decrypt; + } + for (j = 0; j < 2; j++) { + for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { + /* skip the cases where + * the length is smaller than 2*blocklen + * or the length is not a multiple of 32 + */ + if ((j == 1) && ((tests[i].PTLEN < 32) || (tests[i].PTLEN % 32))) { + continue; } - } else { - err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; + if ((k > 0) && (j == 1)) { + continue; } - err = xts_encrypt(&tests[i].PTX[len], len, &OUT[len], T, &xts); + len = tests[i].PTLEN / 2; + + err = xts_start(idx, tests[i].key1, tests[i].key2, tests[i].keylen / 2, 0, &xts); if (err != CRYPT_OK) { - xts_done(&xts); return err; } - } - if (XMEMCMP(OUT, tests[i].CTX, tests[i].PTLEN)) { -#ifdef LTC_TEST_DBG - printf("\nTestcase #%d with original length %lu and half of it " - "%lu\n", - i, tests[i].PTLEN, len); - printf("\nencrypt\n"); - print_hex("should", tests[i].CTX, tests[i].PTLEN); - print_hex("is", OUT, tests[i].PTLEN); -#endif - xts_done(&xts); - return CRYPT_FAIL_TESTVECTOR; - } + seq = tests[i].seqnum; + STORE64L(seq, Torg); + XMEMSET(Torg + 8, 0, 8); - XMEMCPY(T, Torg, sizeof(T)); - if (j == 0) { - err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; + XMEMCPY(T, Torg, sizeof(T)); + if (j == 0) { + err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + } else { + err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + err = xts_encrypt(&tests[i].PTX[len], len, &OUT[len], T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } } - } else { - err = xts_decrypt(tests[i].CTX, len, OUT, T, &xts); - if (err != CRYPT_OK) { + + if (XMEMCMP(OUT, tests[i].CTX, tests[i].PTLEN)) { +#ifdef LTC_TEST_DBG + printf("\nTestcase #%d with original length %lu and half of it " + "%lu\n", + i, tests[i].PTLEN, len); + printf("\nencrypt\n"); + print_hex("should", tests[i].CTX, tests[i].PTLEN); + print_hex("is", OUT, tests[i].PTLEN); +#endif xts_done(&xts); - return err; + return CRYPT_FAIL_TESTVECTOR; } - err = xts_decrypt(&tests[i].CTX[len], len, &OUT[len], T, &xts); - if (err != CRYPT_OK) { - xts_done(&xts); - return err; + + XMEMCPY(T, Torg, sizeof(T)); + if (j == 0) { + err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + } else { + err = xts_decrypt(tests[i].CTX, len, OUT, T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } + err = xts_decrypt(&tests[i].CTX[len], len, &OUT[len], T, &xts); + if (err != CRYPT_OK) { + xts_done(&xts); + return err; + } } - } - if (XMEMCMP(OUT, tests[i].PTX, tests[i].PTLEN)) { + if (XMEMCMP(OUT, tests[i].PTX, tests[i].PTLEN)) { #ifdef LTC_TEST_DBG - printf("\ndecrypt\n"); - print_hex("should", tests[i].PTX, tests[i].PTLEN); - print_hex("is", OUT, tests[i].PTLEN); + printf("\ndecrypt\n"); + print_hex("should", tests[i].PTX, tests[i].PTLEN); + print_hex("is", OUT, tests[i].PTLEN); #endif + xts_done(&xts); + return CRYPT_FAIL_TESTVECTOR; + } xts_done(&xts); - return CRYPT_FAIL_TESTVECTOR; } - xts_done(&xts); } } return CRYPT_OK; From 25af184cd59b1769c0588678362adb5fd41a50ed Mon Sep 17 00:00:00 2001 From: Sebastian Verschoor Date: Fri, 21 Aug 2015 14:40:15 +0200 Subject: [PATCH 0362/1192] Quickfix for issue #73 The API of the function is changed (for decryption, tag is now an input parameter). With the old API it is impossible to confirm to the NIST specification and a timing sidechannel leak is inevitable. --- src/encauth/ccm/ccm_memory.c | 49 +++++++++++++++++++++++++----------- src/encauth/ccm/ccm_test.c | 16 +++++++----- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index 1b4328d2b..166b13ce7 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -20,7 +20,7 @@ /** CCM encrypt/decrypt and produce an authentication tag - *1 'pt' and 'ct' can both be 'in' or 'out', depending on 'direction' + *1 'pt', 'ct' and 'tag' can both be 'in' or 'out', depending on 'direction' @param cipher The index of the cipher desired @param key The secret key to use @@ -33,8 +33,8 @@ @param pt [*1] The plaintext @param ptlen The length of the plaintext (octets) @param ct [*1] The ciphertext - @param tag [out] The destination tag - @param taglen [in/out] The max size and resulting size of the authentication tag + @param tag [*1] The destination tag + @param taglen The max size and resulting size of the authentication tag @param direction Encrypt or Decrypt direction (0 or 1) @return CRYPT_OK if successful */ @@ -48,7 +48,7 @@ int ccm_memory(int cipher, unsigned char *tag, unsigned long *taglen, int direction) { - unsigned char PAD[16], ctr[16], CTRPAD[16], b; + unsigned char PAD[16], ctr[16], CTRPAD[16], ptTag[16], b; symmetric_key *skey; int err; unsigned long len, L, x, y, z, CTRlen; @@ -203,11 +203,9 @@ int ccm_memory(int cipher, PAD[x++] ^= header[y]; } - /* remainder? */ - if (x != 0) { - if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { - goto error; - } + /* remainder */ + if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { + goto error; } } @@ -254,7 +252,7 @@ int ccm_memory(int cipher, goto error; } } - } else { + } else { /* direction == CCM_DECRYPT */ for (; y < (ptlen & ~15); y += 16) { /* increment the ctr? */ for (z = 15; z > 15-L; z--) { @@ -328,11 +326,34 @@ int ccm_memory(int cipher, cipher_descriptor[cipher].done(skey); } - /* store the TAG */ - for (x = 0; x < 16 && x < *taglen; x++) { - tag[x] = PAD[x] ^ CTRPAD[x]; + if (direction == CCM_ENCRYPT) { + /* store the TAG */ + for (x = 0; x < 16 && x < *taglen; x++) { + tag[x] = PAD[x] ^ CTRPAD[x]; + } + *taglen = x; + } else { /* direction == CCM_DECRYPT */ + /* decrypt the tag */ + for (x = 0; x < 16 && x < *taglen; x++) { + ptTag[x] = tag[x] ^ CTRPAD[x]; + } + *taglen = x; + + /* check validity of the decrypted tag against the computed PAD (in constant time) */ + /* HACK: the boolean value of XMEM_NEQ becomes either 0 (CRYPT_OK) or 1 (CRYPT_ERR). + * there should be a better way of setting the correct error code in constant + * time. + */ + err = XMEM_NEQ(ptTag, PAD, *taglen); + + /* TODO: pt should not be revealed when the tag is invalid. However, resetting the + * memory should be done in constant time, which is not the case in the + * (commented) code below. + if (err != CRYPT_OK) { + zeromem(pt, ptlen); + } + */ } - *taglen = x; #ifdef LTC_CLEAN_STACK zeromem(skey, sizeof(*skey)); diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index f8eb3de54..d3b20e411 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -195,7 +195,7 @@ int ccm_test(void) tests[x].header, tests[x].headerlen, buf2, tests[x].ptlen, buf, - tag2, &taglen, 1 )) != CRYPT_OK) { + tests[x].tag, &taglen, 1 )) != CRYPT_OK) { return err; } } else { @@ -224,13 +224,17 @@ int ccm_test(void) #endif return CRYPT_FAIL_TESTVECTOR; } - if (XMEMCMP(tag2, tests[x].tag, tests[x].taglen)) { + /* Only check the tag if ccm_memory was not called: ccm_memory already + validates the tag */ + if (y != 0) { + if (XMEMCMP(tag2, tests[x].tag, tests[x].taglen)) { #if defined(LTC_TEST_DBG) - printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("tag is ", tag, tests[x].taglen); - print_hex("tag should", tests[x].tag, tests[x].taglen); + printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); + print_hex("tag is ", tag, tests[x].taglen); + print_hex("tag should", tests[x].tag, tests[x].taglen); #endif - return CRYPT_FAIL_TESTVECTOR; + return CRYPT_FAIL_TESTVECTOR; + } } if (y == 0) { cipher_descriptor[idx].done(&skey); From 6c11ca771b2d805989decf35ed210d4cf0555d0c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 21 Aug 2015 21:32:42 +0200 Subject: [PATCH 0363/1192] fix compile error of tests --- src/encauth/ccm/ccm_test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index d3b20e411..55e064e33 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -114,7 +114,7 @@ int ccm_test(void) }; unsigned long taglen, x, y; - unsigned char buf[64], buf2[64], tag2[16], tag[16]; + unsigned char buf[64], buf2[64], tag[16], tag2[16], tag3[16]; int err, idx; symmetric_key skey; ccm_state ccm; @@ -188,6 +188,9 @@ int ccm_test(void) } if (y == 0) { + + XMEMCPY(tag3, tests[x].tag, tests[x].taglen); + taglen = tests[x].taglen; if ((err = ccm_memory(idx, tests[x].key, 16, NULL, @@ -195,7 +198,7 @@ int ccm_test(void) tests[x].header, tests[x].headerlen, buf2, tests[x].ptlen, buf, - tests[x].tag, &taglen, 1 )) != CRYPT_OK) { + tag3, &taglen, 1 )) != CRYPT_OK) { return err; } } else { From 09e4b0ec9b46ac4db3fa904658821c54106a1d0e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 21 Aug 2015 21:47:43 +0200 Subject: [PATCH 0364/1192] don't reveal plaintext if authentication failed Create two buffers of the same size as the input data. Copy the input data to the first one and work with that version to hold the decrypted data, zeroize the second one. Copy depending on the verification result, either the zero-buffer or the real plaintext to the output buffer. --- src/encauth/ccm/ccm_memory.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index 166b13ce7..4b7de92bb 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -48,7 +48,8 @@ int ccm_memory(int cipher, unsigned char *tag, unsigned long *taglen, int direction) { - unsigned char PAD[16], ctr[16], CTRPAD[16], ptTag[16], b; + unsigned char PAD[16], ctr[16], CTRPAD[16], ptTag[16], b, *pt_real; + unsigned char *pt_work[2] = {0}; symmetric_key *skey; int err; unsigned long len, L, x, y, z, CTRlen; @@ -65,6 +66,8 @@ int ccm_memory(int cipher, LTC_ARGCHK(tag != NULL); LTC_ARGCHK(taglen != NULL); + pt_real = pt; + #ifdef LTC_FAST if (16 % sizeof(LTC_FAST_TYPE)) { return CRYPT_INVALID_ARG; @@ -140,6 +143,17 @@ int ccm_memory(int cipher, } else { skey = uskey; } + if (direction != CCM_ENCRYPT) { + pt_work[0] = XMALLOC(ptlen); + pt_work[1] = XCALLOC(1, ptlen); + + if ((pt_work[0] == NULL) || (pt_work[1] == NULL)) { + goto error; + } + + XMEMCPY(pt_work[0], pt, ptlen); + pt = pt_work[0]; + } /* form B_0 == flags | Nonce N | l(m) */ x = 0; @@ -346,13 +360,13 @@ int ccm_memory(int cipher, */ err = XMEM_NEQ(ptTag, PAD, *taglen); - /* TODO: pt should not be revealed when the tag is invalid. However, resetting the - * memory should be done in constant time, which is not the case in the - * (commented) code below. - if (err != CRYPT_OK) { - zeromem(pt, ptlen); - } - */ + /* Here err is 0 or 1, so we just copy either the real plaintext + * or the zeroized buffer. + */ + XMEMCPY(pt_real, pt_work[err], ptlen); +#ifdef LTC_CLEAN_STACK + zeromem(pt_work[0], ptlen); +#endif } #ifdef LTC_CLEAN_STACK @@ -361,6 +375,12 @@ int ccm_memory(int cipher, zeromem(CTRPAD, sizeof(CTRPAD)); #endif error: + if (pt_work[1]) { + XFREE(pt_work[1]); + } + if (pt_work[0]) { + XFREE(pt_work[0]); + } if (skey != uskey) { XFREE(skey); } From 75b114517a3f8db2075a45b0af87d4d74778ad66 Mon Sep 17 00:00:00 2001 From: Sebastian Verschoor Date: Tue, 25 Aug 2015 15:45:10 +0200 Subject: [PATCH 0365/1192] make sure no cache-based timing attack is possible instead of two different buffers, there is just one buffer. Based upon the verification result, a mask is applied to the buffer before it is written to the output buffer. --- src/encauth/ccm/ccm_memory.c | 55 +++++++++++++++++++----------- src/encauth/ccm/ccm_test.c | 65 ++++++++++++++++++++++++++---------- 2 files changed, 82 insertions(+), 38 deletions(-) diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index 4b7de92bb..5750f345f 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -49,10 +49,14 @@ int ccm_memory(int cipher, int direction) { unsigned char PAD[16], ctr[16], CTRPAD[16], ptTag[16], b, *pt_real; - unsigned char *pt_work[2] = {0}; + unsigned char *pt_work = NULL; symmetric_key *skey; int err; unsigned long len, L, x, y, z, CTRlen; +#ifdef LTC_FAST + LTC_FAST_TYPE fastMask = -1; /* initialize fastMask at all zeroes */ +#endif + unsigned char mask = 0xff; /* initialize mask at all zeroes */ if (uskey == NULL) { LTC_ARGCHK(key != NULL); @@ -143,16 +147,14 @@ int ccm_memory(int cipher, } else { skey = uskey; } - if (direction != CCM_ENCRYPT) { - pt_work[0] = XMALLOC(ptlen); - pt_work[1] = XCALLOC(1, ptlen); - - if ((pt_work[0] == NULL) || (pt_work[1] == NULL)) { + + /* initialize buffer for pt */ + if (direction == CCM_DECRYPT) { + pt_work = XMALLOC(ptlen); + if (pt_work == NULL) { goto error; } - - XMEMCPY(pt_work[0], pt, ptlen); - pt = pt_work[0]; + pt = pt_work; } /* form B_0 == flags | Nonce N | l(m) */ @@ -360,26 +362,39 @@ int ccm_memory(int cipher, */ err = XMEM_NEQ(ptTag, PAD, *taglen); - /* Here err is 0 or 1, so we just copy either the real plaintext - * or the zeroized buffer. - */ - XMEMCPY(pt_real, pt_work[err], ptlen); -#ifdef LTC_CLEAN_STACK - zeromem(pt_work[0], ptlen); + /* Zero the plaintext if the tag was invalid (in constant time) */ + if (ptlen > 0) { + y = 0; + mask *= 1 - err; /* mask = ( err ? 0 : 0xff ) */ +#ifdef LTC_FAST + fastMask *= 1 - err; + if (ptlen & ~15) { + for (; y < (ptlen & ~15); y += 16) { + for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { + *((LTC_FAST_TYPE*)(&pt_real[y+z])) = *((LTC_FAST_TYPE*)(&pt[y+z])) & fastMask; + } + } + } #endif + for (; y < ptlen; y++) { + pt_real[y] = pt[y] & mask; + } + } } #ifdef LTC_CLEAN_STACK + fastMask = 0; + mask = 0; zeromem(skey, sizeof(*skey)); zeromem(PAD, sizeof(PAD)); zeromem(CTRPAD, sizeof(CTRPAD)); + if (pt_work != NULL) { + zeromem(pt_work, ptlen); + } #endif error: - if (pt_work[1]) { - XFREE(pt_work[1]); - } - if (pt_work[0]) { - XFREE(pt_work[0]); + if (pt_work) { + XFREE(pt_work); } if (skey != uskey) { XFREE(skey); diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 55e064e33..7384151c8 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -114,10 +114,12 @@ int ccm_test(void) }; unsigned long taglen, x, y; - unsigned char buf[64], buf2[64], tag[16], tag2[16], tag3[16]; + unsigned char buf[64], buf2[64], tag[16], tag2[16], tag3[16], zero[64]; int err, idx; symmetric_key skey; ccm_state ccm; + + zeromem(zero, 64); idx = find_cipher("aes"); if (idx == -1) { @@ -166,8 +168,8 @@ int ccm_test(void) if (XMEMCMP(buf, tests[x].ct, tests[x].ptlen)) { #if defined(LTC_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("ct is ", tag, taglen); - print_hex("ct should", tests[x].tag, taglen); + print_hex("ct is ", buf, tests[x].ptlen); + print_hex("ct should", tests[x].ct, tests[x].ptlen); #endif return CRYPT_FAIL_TESTVECTOR; } @@ -188,10 +190,9 @@ int ccm_test(void) } if (y == 0) { - - XMEMCPY(tag3, tests[x].tag, tests[x].taglen); - taglen = tests[x].taglen; - if ((err = ccm_memory(idx, + XMEMCPY(tag3, tests[x].tag, tests[x].taglen); + taglen = tests[x].taglen; + if ((err = ccm_memory(idx, tests[x].key, 16, NULL, tests[x].nonce, tests[x].noncelen, @@ -222,28 +223,56 @@ int ccm_test(void) if (XMEMCMP(buf2, tests[x].pt, tests[x].ptlen)) { #if defined(LTC_TEST_DBG) printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("pt is ", tag, taglen); - print_hex("pt should", tests[x].tag, taglen); + print_hex("pt is ", buf2, tests[x].ptlen); + print_hex("pt should", tests[x].pt, tests[x].ptlen); #endif return CRYPT_FAIL_TESTVECTOR; } - /* Only check the tag if ccm_memory was not called: ccm_memory already - validates the tag */ - if (y != 0) { - if (XMEMCMP(tag2, tests[x].tag, tests[x].taglen)) { + if (y == 0) { + /* check if decryption with the wrong tag does not reveal the plaintext */ + XMEMCPY(tag3, tests[x].tag, tests[x].taglen); + tag3[0] ^= 0xff; /* set the tag to the wrong value */ + taglen = tests[x].taglen; + if ((err = ccm_memory(idx, + tests[x].key, 16, + NULL, + tests[x].nonce, tests[x].noncelen, + tests[x].header, tests[x].headerlen, + buf2, tests[x].ptlen, + buf, + tag3, &taglen, 1 )) != CRYPT_ERROR) { + return CRYPT_FAIL_TESTVECTOR; + } + if (XMEMCMP(buf2, zero, tests[x].ptlen)) { +#if defined(LTC_CCM_TEST_DBG) + printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); + print_hex("pt is ", buf2, tests[x].ptlen); + print_hex("pt should", zero, tests[x].ptlen); +#endif + return CRYPT_FAIL_TESTVECTOR; + } + } else { + /* FIXME: Only check the tag if ccm_memory was not called: ccm_memory already + validates the tag. ccm_process and ccm_done should somehow do the same, + although with current setup it is impossible to keep the plaintext hidden + if the tag is incorrect. + */ + if (XMEMCMP(tag2, tests[x].tag, tests[x].taglen)) { #if defined(LTC_TEST_DBG) - printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("tag is ", tag, tests[x].taglen); - print_hex("tag should", tests[x].tag, tests[x].taglen); + printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); + print_hex("tag is ", tag2, tests[x].taglen); + print_hex("tag should", tests[x].tag, tests[x].taglen); #endif - return CRYPT_FAIL_TESTVECTOR; - } + return CRYPT_FAIL_TESTVECTOR; + } } + if (y == 0) { cipher_descriptor[idx].done(&skey); } } } + return CRYPT_OK; #endif } From 8cb20e6059160f7fbbb71b704fc01ffe2deeb89d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 22 Jul 2015 14:09:41 +0200 Subject: [PATCH 0366/1192] add more DES test vectors --- src/ciphers/des.c | 173 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 172 insertions(+), 1 deletion(-) diff --git a/src/ciphers/des.c b/src/ciphers/des.c index cd343b389..ab8004b48 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -1750,7 +1750,178 @@ int des_test(void) { 0x0D, 0x9F, 0x27, 0x9B, 0xA5, 0xD8, 0x72, 0x60 } }, {10, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0xD9, 0x03, 0x1B, 0x02, 0x71, 0xBD, 0x5A, 0x0A } } + { 0xD9, 0x03, 0x1B, 0x02, 0x71, 0xBD, 0x5A, 0x0A } }, + +#ifdef LTC_TEST_EXT + { 0+11, 0, { 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x95, 0xA8, 0xD7, 0x28, 0x13, 0xDA, 0xA9, 0x4D } }, + { 1+11, 0, { 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x0E, 0xEC, 0x14, 0x87, 0xDD, 0x8C, 0x26, 0xD5 } }, + { 2+11, 0, { 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x7A, 0xD1, 0x6F, 0xFB, 0x79, 0xC4, 0x59, 0x26 } }, + { 3+11, 0, { 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xD3, 0x74, 0x62, 0x94, 0xCA, 0x6A, 0x6C, 0xF3 } }, + { 4+11, 0, { 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x80, 0x9F, 0x5F, 0x87, 0x3C, 0x1F, 0xD7, 0x61 } }, + { 5+11, 0, { 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xC0, 0x2F, 0xAF, 0xFE, 0xC9, 0x89, 0xD1, 0xFC } }, + { 6+11, 0, { 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x46, 0x15, 0xAA, 0x1D, 0x33, 0xE7, 0x2F, 0x10 } }, + { 7+11, 0, { 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x20, 0x55, 0x12, 0x33, 0x50, 0xC0, 0x08, 0x58 } }, + { 8+11, 0, { 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xDF, 0x3B, 0x99, 0xD6, 0x57, 0x73, 0x97, 0xC8 } }, + { 9+11, 0, { 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x31, 0xFE, 0x17, 0x36, 0x9B, 0x52, 0x88, 0xC9 } }, + {10+11, 0, { 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xDF, 0xDD, 0x3C, 0xC6, 0x4D, 0xAE, 0x16, 0x42 } }, + {11+11, 0, { 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x17, 0x8C, 0x83, 0xCE, 0x2B, 0x39, 0x9D, 0x94 } }, + {12+11, 0, { 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x50, 0xF6, 0x36, 0x32, 0x4A, 0x9B, 0x7F, 0x80 } }, + {13+11, 0, { 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xA8, 0x46, 0x8E, 0xE3, 0xBC, 0x18, 0xF0, 0x6D } }, + {14+11, 0, { 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xA2, 0xDC, 0x9E, 0x92, 0xFD, 0x3C, 0xDE, 0x92 } }, + {15+11, 0, { 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xCA, 0xC0, 0x9F, 0x79, 0x7D, 0x03, 0x12, 0x87 } }, + {16+11, 0, { 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x90, 0xBA, 0x68, 0x0B, 0x22, 0xAE, 0xB5, 0x25 } }, + {17+11, 0, { 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xCE, 0x7A, 0x24, 0xF3, 0x50, 0xE2, 0x80, 0xB6 } }, + {18+11, 0, { 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x88, 0x2B, 0xFF, 0x0A, 0xA0, 0x1A, 0x0B, 0x87 } }, + {19+11, 0, { 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x25, 0x61, 0x02, 0x88, 0x92, 0x45, 0x11, 0xC2 } }, + {20+11, 0, { 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xC7, 0x15, 0x16, 0xC2, 0x9C, 0x75, 0xD1, 0x70 } }, + {21+11, 0, { 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x51, 0x99, 0xC2, 0x9A, 0x52, 0xC9, 0xF0, 0x59 } }, + {22+11, 0, { 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xC2, 0x2F, 0x0A, 0x29, 0x4A, 0x71, 0xF2, 0x9F } }, + {23+11, 0, { 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xEE, 0x37, 0x14, 0x83, 0x71, 0x4C, 0x02, 0xEA } }, + {24+11, 0, { 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xA8, 0x1F, 0xBD, 0x44, 0x8F, 0x9E, 0x52, 0x2F } }, + {25+11, 0, { 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x4F, 0x64, 0x4C, 0x92, 0xE1, 0x92, 0xDF, 0xED } }, + {26+11, 0, { 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x1A, 0xFA, 0x9A, 0x66, 0xA6, 0xDF, 0x92, 0xAE } }, + {27+11, 0, { 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xB3, 0xC1, 0xCC, 0x71, 0x5C, 0xB8, 0x79, 0xD8 } }, + {28+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x19, 0xD0, 0x32, 0xE6, 0x4A, 0xB0, 0xBD, 0x8B } }, + {29+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x3C, 0xFA, 0xA7, 0xA7, 0xDC, 0x87, 0x20, 0xDC } }, + {30+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xB7, 0x26, 0x5F, 0x7F, 0x44, 0x7A, 0xC6, 0xF3 } }, + {31+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x9D, 0xB7, 0x3B, 0x3C, 0x0D, 0x16, 0x3F, 0x54 } }, + {32+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x81, 0x81, 0xB6, 0x5B, 0xAB, 0xF4, 0xA9, 0x75 } }, + {33+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x93, 0xC9, 0xB6, 0x40, 0x42, 0xEA, 0xA2, 0x40 } }, + {34+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x55, 0x70, 0x53, 0x08, 0x29, 0x70, 0x55, 0x92 } }, + {35+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x86, 0x38, 0x80, 0x9E, 0x87, 0x87, 0x87, 0xA0 } }, + {36+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x41, 0xB9, 0xA7, 0x9A, 0xF7, 0x9A, 0xC2, 0x08 } }, + {37+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x7A, 0x9B, 0xE4, 0x2F, 0x20, 0x09, 0xA8, 0x92 } }, + {38+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x29, 0x03, 0x8D, 0x56, 0xBA, 0x6D, 0x27, 0x45 } }, + {39+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x54, 0x95, 0xC6, 0xAB, 0xF1, 0xE5, 0xDF, 0x51 } }, + {40+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xAE, 0x13, 0xDB, 0xD5, 0x61, 0x48, 0x89, 0x33 } }, + {41+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x02, 0x4D, 0x1F, 0xFA, 0x89, 0x04, 0xE3, 0x89 } }, + {42+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xD1, 0x39, 0x97, 0x12, 0xF9, 0x9B, 0xF0, 0x2E } }, + {43+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x14, 0xC1, 0xD7, 0xC1, 0xCF, 0xFE, 0xC7, 0x9E } }, + {44+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x1D, 0xE5, 0x27, 0x9D, 0xAE, 0x3B, 0xED, 0x6F } }, + {45+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xE9, 0x41, 0xA3, 0x3F, 0x85, 0x50, 0x13, 0x03 } }, + {46+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xDA, 0x99, 0xDB, 0xBC, 0x9A, 0x03, 0xF3, 0x79 } }, + {47+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xB7, 0xFC, 0x92, 0xF9, 0x1D, 0x8E, 0x92, 0xE9 } }, + {48+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xAE, 0x8E, 0x5C, 0xAA, 0x3C, 0xA0, 0x4E, 0x85 } }, + {49+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x9C, 0xC6, 0x2D, 0xF4, 0x3B, 0x6E, 0xED, 0x74 } }, + {50+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xD8, 0x63, 0xDB, 0xB5, 0xC5, 0x9A, 0x91, 0xA0 } }, + {51+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xA1, 0xAB, 0x21, 0x90, 0x54, 0x5B, 0x91, 0xD7 } }, + {52+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x08, 0x75, 0x04, 0x1E, 0x64, 0xC5, 0x70, 0xF7 } }, + {53+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x5A, 0x59, 0x45, 0x28, 0xBE, 0xBE, 0xF1, 0xCC } }, + {54+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xFC, 0xDB, 0x32, 0x91, 0xDE, 0x21, 0xF0, 0xC0 } }, + {55+11, 0, { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x86, 0x9E, 0xFD, 0x7F, 0x9F, 0x26, 0x5A, 0x09 } }, +#endif /* LTC_TEST_EXT */ /*** more test cases you could add if you are not convinced (the above test cases aren't really too good): From 6ec93afa3cef0c919dcc42e8afe2ab2f1e44b852 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 1 Sep 2015 10:09:41 +0200 Subject: [PATCH 0367/1192] clean-up test-build and extend tomcrypt_custom.h added LTC_MINIMAL to be able do a build without nearly any functionality :) make sure timing resistant RSA & ECC are enabled if not said otherwise --- src/ciphers/des.c | 8 ++-- src/headers/tomcrypt_custom.h | 53 +++++++++++++++++++------- testprof/base64_test.c | 2 + testprof/modes_test.c | 70 +++++++++++++++++++---------------- testprof/x86_prof.c | 16 +++++++- 5 files changed, 99 insertions(+), 50 deletions(-) diff --git a/src/ciphers/des.c b/src/ciphers/des.c index ab8004b48..fbacf5c9f 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -12,7 +12,7 @@ /** @file des.c - LTC_DES code submitted by Dobes Vandermeer + DES code submitted by Dobes Vandermeer */ #ifdef LTC_DES @@ -1450,9 +1450,9 @@ static void _desfunc(ulong32 *block, const ulong32 *keys) for (cur_round = 0; cur_round < 8; cur_round++) { work = RORc(right, 4) ^ *keys++; leftt ^= SP7[work & 0x3fL] - ^ SP5[(work >> 8) & 0x3fL] - ^ SP3[(work >> 16) & 0x3fL] - ^ SP1[(work >> 24) & 0x3fL]; + ^ SP5[(work >> 8) & 0x3fL] + ^ SP3[(work >> 16) & 0x3fL] + ^ SP1[(work >> 24) & 0x3fL]; work = right ^ *keys++; leftt ^= SP8[ work & 0x3fL] ^ SP6[(work >> 8) & 0x3fL] diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 42a3e6ffd..680a2ca62 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -125,6 +125,19 @@ #define LTC_BASE64 #endif +/* The minimal set of functionality to run the tests */ +#ifdef LTC_MINIMAL + #define LTC_SHA256 + #define LTC_CTR_MODE + #define LTC_RNG_MAKE_PRNG + #define LTC_RNG_GET_BYTES + #define LTC_YARROW + #define LTC_DEVRANDOM + #define LTC_TRY_URANDOM_FIRST + + #undef LTC_NO_FILE +#endif + /* Enable self-test test vector checking */ #ifndef LTC_NO_TEST #define LTC_TEST @@ -252,6 +265,7 @@ #endif /* LTC_NO_HASHES */ + /* ---> MAC functions <--- */ #ifndef LTC_NO_MACS @@ -283,6 +297,7 @@ #endif /* LTC_NO_MACS */ + /* --> Pseudo Random Number Generators <--- */ #ifndef LTC_NO_PRNGS @@ -304,17 +319,14 @@ /* Fortuna PRNG */ #define LTC_FORTUNA -/* reseed every N calls to the read function */ -#define LTC_FORTUNA_WD 10 -/* number of pools (4..32) can save a bit of ram by lowering the count */ -#define LTC_FORTUNA_POOLS 32 /* Greg's LTC_SOBER128 PRNG ;-0 */ #define LTC_SOBER128 /* the *nix style /dev/random device */ #define LTC_DEVRANDOM -/* try /dev/urandom before trying /dev/random */ +/* try /dev/urandom before trying /dev/random + * are you sure you want to disable this? http://www.2uo.de/myths-about-urandom/ */ #define LTC_TRY_URANDOM_FIRST /* rng_get_bytes() */ #define LTC_RNG_GET_BYTES @@ -323,17 +335,27 @@ #endif /* LTC_NO_PRNGS */ +#ifdef LTC_FORTUNA + +#ifndef LTC_FORTUNA_WD +/* reseed every N calls to the read function */ +#define LTC_FORTUNA_WD 10 +#endif + +#ifndef LTC_FORTUNA_POOLS +/* number of pools (4..32) can save a bit of ram by lowering the count */ +#define LTC_FORTUNA_POOLS 32 +#endif + +#endif /* LTC_FORTUNA */ + + /* ---> Public Key Crypto <--- */ #ifndef LTC_NO_PK /* Include RSA support */ #define LTC_MRSA -#ifndef LTC_NO_RSA_BLINDING -/* Enable RSA blinding when doing private key operations by default */ -#define LTC_RSA_BLINDING -#endif /* LTC_NO_RSA_BLINDING */ - /* Include Diffie-Hellman support */ #ifndef GMP_DESC /* is_prime fails for GMP */ @@ -373,13 +395,18 @@ /* do we want fixed point ECC */ /* #define LTC_MECC_FP */ -#ifndef LTC_NO_ECC_TIMING_RESISTANT +#endif /* LTC_NO_PK */ + +#if defined(LTC_MRSA) && !defined(LTC_NO_RSA_BLINDING) +/* Enable RSA blinding when doing private key operations by default */ +#define LTC_RSA_BLINDING +#endif /* LTC_NO_RSA_BLINDING */ + +#if defined(LTC_MECC) && !defined(LTC_NO_ECC_TIMING_RESISTANT) /* Enable ECC timing resistant version by default */ #define LTC_ECC_TIMING_RESISTANT #endif -#endif /* LTC_NO_PK */ - /* define these PK sizes out of LTC_NO_PK * to have them always defined */ diff --git a/testprof/base64_test.c b/testprof/base64_test.c index e62786413..8c15d3c15 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -1,5 +1,6 @@ #include +#ifdef LTC_BASE64 int base64_test(void) { unsigned char in[64], out[256], tmp[64]; @@ -57,6 +58,7 @@ int base64_test(void) } return 0; } +#endif /* $Source$ */ /* $Revision$ */ diff --git a/testprof/modes_test.c b/testprof/modes_test.c index c1cd1c4d6..58a9fae6d 100644 --- a/testprof/modes_test.c +++ b/testprof/modes_test.c @@ -3,8 +3,7 @@ int modes_test(void) { - unsigned char pt[64], ct[64], tmp[64], key[16], iv[16], iv2[16]; - int cipher_idx; + int ret = CRYPT_NOP; #ifdef LTC_CBC_MODE symmetric_CBC cbc; #endif @@ -14,44 +13,48 @@ int modes_test(void) #ifdef LTC_OFB_MODE symmetric_OFB ofb; #endif +#if defined(LTC_CBC_MODE) || defined(LTC_CFB_MODE) || defined(LTC_OFB_MODE) + unsigned char pt[64], ct[64], tmp[64], key[16], iv[16], iv2[16]; + int cipher_idx; unsigned long l; - + /* make a random pt, key and iv */ yarrow_read(pt, 64, &yarrow_prng); yarrow_read(key, 16, &yarrow_prng); yarrow_read(iv, 16, &yarrow_prng); - + /* get idx of AES handy */ cipher_idx = find_cipher("aes"); if (cipher_idx == -1) { fprintf(stderr, "test requires AES"); return 1; } - +#endif + #ifdef LTC_F8_MODE - DO(f8_test_mode()); -#endif - + DO(ret = f8_test_mode()); +#endif + #ifdef LTC_LRW_MODE - DO(lrw_test()); + DO(ret = lrw_test()); #endif #ifdef LTC_CBC_MODE /* test CBC mode */ /* encode the block */ - DO(cbc_start(cipher_idx, iv, key, 16, 0, &cbc)); + DO(ret = cbc_start(cipher_idx, iv, key, 16, 0, &cbc)); l = sizeof(iv2); - DO(cbc_getiv(iv2, &l, &cbc)); + DO(ret = cbc_getiv(iv2, &l, &cbc)); if (l != 16 || memcmp(iv2, iv, 16)) { fprintf(stderr, "cbc_getiv failed"); return 1; } - DO(cbc_encrypt(pt, ct, 64, &cbc)); - + DO(ret = cbc_encrypt(pt, ct, 64, &cbc)); + /* decode the block */ - DO(cbc_setiv(iv2, l, &cbc)); + DO(ret = cbc_setiv(iv2, l, &cbc)); zeromem(tmp, sizeof(tmp)); - DO(cbc_decrypt(ct, tmp, 64, &cbc)); + DO(ret = cbc_decrypt(ct, tmp, 64, &cbc)); if (memcmp(tmp, pt, 64) != 0) { fprintf(stderr, "CBC failed"); return 1; @@ -61,56 +64,59 @@ int modes_test(void) #ifdef LTC_CFB_MODE /* test CFB mode */ /* encode the block */ - DO(cfb_start(cipher_idx, iv, key, 16, 0, &cfb)); + DO(ret = cfb_start(cipher_idx, iv, key, 16, 0, &cfb)); l = sizeof(iv2); - DO(cfb_getiv(iv2, &l, &cfb)); + DO(ret = cfb_getiv(iv2, &l, &cfb)); /* note we don't memcmp iv2/iv since cfb_start processes the IV for the first block */ if (l != 16) { fprintf(stderr, "cfb_getiv failed"); return 1; } - DO(cfb_encrypt(pt, ct, 64, &cfb)); - + DO(ret = cfb_encrypt(pt, ct, 64, &cfb)); + /* decode the block */ - DO(cfb_setiv(iv, l, &cfb)); + DO(ret = cfb_setiv(iv, l, &cfb)); zeromem(tmp, sizeof(tmp)); - DO(cfb_decrypt(ct, tmp, 64, &cfb)); + DO(ret = cfb_decrypt(ct, tmp, 64, &cfb)); if (memcmp(tmp, pt, 64) != 0) { fprintf(stderr, "CFB failed"); return 1; } #endif - + #ifdef LTC_OFB_MODE /* test OFB mode */ /* encode the block */ - DO(ofb_start(cipher_idx, iv, key, 16, 0, &ofb)); + DO(ret = ofb_start(cipher_idx, iv, key, 16, 0, &ofb)); l = sizeof(iv2); - DO(ofb_getiv(iv2, &l, &ofb)); + DO(ret = ofb_getiv(iv2, &l, &ofb)); if (l != 16 || memcmp(iv2, iv, 16)) { fprintf(stderr, "ofb_getiv failed"); return 1; } - DO(ofb_encrypt(pt, ct, 64, &ofb)); - + DO(ret = ofb_encrypt(pt, ct, 64, &ofb)); + /* decode the block */ - DO(ofb_setiv(iv2, l, &ofb)); + DO(ret = ofb_setiv(iv2, l, &ofb)); zeromem(tmp, sizeof(tmp)); - DO(ofb_decrypt(ct, tmp, 64, &ofb)); + DO(ret = ofb_decrypt(ct, tmp, 64, &ofb)); if (memcmp(tmp, pt, 64) != 0) { fprintf(stderr, "OFB failed"); return 1; } #endif -#ifdef LTC_CTR_MODE - DO(ctr_test()); +#if defined(LTC_CTR_MODE) && defined(LTC_RIJNDAEL) + DO(ret = ctr_test()); #endif #ifdef LTC_XTS_MODE - DO(xts_test()); + DO(ret = xts_test()); #endif - + + if (ret == CRYPT_NOP) + fprintf(stderr, "NOP"); + return 0; } diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index aa7e86c93..ba12db2dc 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -451,13 +451,14 @@ int time_keysched(void) int time_cipher(void) { + fprintf(stderr, "\n\nECB Time Trials for the Symmetric Ciphers:\n"); +#ifdef LTC_ECB_MODE unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; symmetric_ECB ecb; unsigned char key[MAXBLOCKSIZE], pt[4096]; int err; - fprintf(stderr, "\n\nECB Time Trials for the Symmetric Ciphers:\n"); no_results = 0; for (x = 0; cipher_descriptor[x].name != NULL; x++) { ecb_start(x, key, cipher_descriptor[x].min_key_length, 0, &ecb); @@ -516,6 +517,9 @@ int time_cipher(void) #undef DO1 } tally_results(1); +#else + fprintf(stderr, "NOP"); +#endif return 0; } @@ -1312,6 +1316,7 @@ void time_ecc(void) { fprintf(stderr, "NO ECC\n"); } void time_macs_(unsigned long MAC_SIZE) { +#if defined(LTC_OMAC) || defined(LTC_XCBC) || defined(LTC_F9_MODE) || defined(LTC_PMAC) || defined(LTC_PELICAN) || defined(LTC_HMAC) unsigned char *buf, key[16], tag[16]; ulong64 t1, t2; unsigned long x, z; @@ -1433,6 +1438,10 @@ void time_macs_(unsigned long MAC_SIZE) #endif XFREE(buf); +#else + LTC_UNUSED_PARAM(MAC_SIZE); + fprintf(stderr, "NO MACs\n"); +#endif } void time_macs(void) @@ -1444,6 +1453,7 @@ void time_macs(void) void time_encmacs_(unsigned long MAC_SIZE) { +#if defined(LTC_EAX_MODE) || defined(LTC_OCB_MODE) || defined(LTC_OCB3_MODE) || defined(LTC_CCM_MODE) || defined(LTC_GCM_MODE) unsigned char *buf, IV[16], key[16], tag[16]; ulong64 t1, t2; unsigned long x, z; @@ -1600,6 +1610,10 @@ __attribute__ ((aligned (16))) } #endif +#else + LTC_UNUSED_PARAM(MAC_SIZE); + fprintf(stderr, "NO ENCMACs\n"); +#endif } From fd94034ba7a610bdf6bc1cf89d7d90c7459f25bc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 1 Sep 2015 10:16:47 +0200 Subject: [PATCH 0368/1192] sort HEADERS in makefiles, so it doesn't change spontaneously --- genlist.sh | 2 +- makefile | 10 +++++----- makefile.icc | 10 +++++----- makefile.mingw | 10 +++++----- makefile.msvc | 10 +++++----- makefile.shared | 10 +++++----- makefile.unix | 10 +++++----- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/genlist.sh b/genlist.sh index e3b000682..33bf19e73 100755 --- a/genlist.sh +++ b/genlist.sh @@ -2,7 +2,7 @@ # aes_tab.o is a pseudo object as it's made from aes.o and MPI is optional export a=`echo -n "src/ciphers/aes/aes_enc.o " ; find ./src -type f -name "*.c" -not -name "*tab.c" | sort | sed -e 'sE\./EE' | sed -e 's/\.c/\.o/' | xargs` perl ./parsenames.pl OBJECTS "$a" -export a=`find src/headers -type f -name "*.h" | xargs` +export a=`find src/headers -type f -name "*.h" | sort | xargs` perl ./parsenames.pl HEADERS "$a" # $Source$ diff --git a/makefile b/makefile index af49335ad..3a96ecf06 100644 --- a/makefile +++ b/makefile @@ -163,11 +163,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ +src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.icc b/makefile.icc index b7594b23c..18143ee0f 100644 --- a/makefile.icc +++ b/makefile.icc @@ -230,11 +230,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ +src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.mingw b/makefile.mingw index 8e3624b14..68e80b5c2 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -177,11 +177,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ +src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.msvc b/makefile.msvc index 4c3621994..7c060ced7 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -135,11 +135,11 @@ src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/for src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ src/prngs/yarrow.obj -HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ +src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.shared b/makefile.shared index 6ddeaf0e7..a0d90ac16 100644 --- a/makefile.shared +++ b/makefile.shared @@ -165,11 +165,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ +src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.unix b/makefile.unix index 60ee70c04..6c6461b7d 100644 --- a/makefile.unix +++ b/makefile.unix @@ -171,11 +171,11 @@ src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_macros.h \ -src/headers/tomcrypt_pk.h src/headers/tomcrypt_cipher.h src/headers/tomcrypt_misc.h \ -src/headers/tomcrypt_hash.h src/headers/tomcrypt.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_prng.h src/headers/tomcrypt_mac.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_pkcs.h testprof/tomcrypt_test.h +HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ +src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS From 21ed315527c2e4e291fab2249eccf246a87d6a58 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Sep 2015 01:14:57 +0200 Subject: [PATCH 0369/1192] ignore output of 'make doxy' --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fe67ca53d..1538c9183 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ testok.txt test_*.txt tv.txt *_tv.txt +doxygen/ # *nix/windows test executables constants From 7db5760c91eed26b761debdd9acb83857c022cc1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 30 Aug 2015 17:17:05 +0200 Subject: [PATCH 0370/1192] add possibility to create combined coverage Define the environment variable LTC_COVERAGE to something, run testme.sh with all the coverage compile time options enabled and then 'make lcov' creates the combined coverage for all combinations of compile-time options handled in testme.sh. e.g. LTC_COVERAGE=1 ./testme.sh "makefile -j3" "-DUSE_LTM -DLTM_DESC -I../libtommath -fprofile-arcs -ftest-coverage" "../libtommath/libtommath.a -lgcov" --- .gitignore | 3 +++ build.sh | 5 +++++ makefile | 3 +++ 3 files changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index 1538c9183..2ac5901ec 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,9 @@ timing.exe *.gcno *.gcov +coverage/ +coverage*.info + # coverity intermediate directory etc. cov-int/ .coverity_* diff --git a/build.sh b/build.sh index 228affff3..9338caf22 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,12 @@ if [ -a test ] && [ -f test ] && [ -x test ]; then for f in *_tv.txt; do if (diff -i -w -B $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done fi fi + +lcov_opts="--capture --no-external --directory src -q" +lcov_out=$(echo coverage_$1_$2_$3 | tr ' -=+' '_')".info" + if [ -a testok.txt ] && [ -f testok.txt ]; then + [ "$LTC_COVERAGE" != "" ] && lcov $lcov_opts --output-file $lcov_out exit 0 fi exit 1 diff --git a/makefile b/makefile index 3a96ecf06..626da35de 100644 --- a/makefile +++ b/makefile @@ -275,6 +275,9 @@ profile: rm -f timing `find . -type f | grep [.][ao] | xargs` CFLAGS="$(CFLAGS) -fprofile-use" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" +lcov: + lcov `find -name 'coverage_*.info' -exec echo -n " -a {}" \;` -o coverage.info -q 2>/dev/null + genhtml coverage.info --output-directory coverage -q #This rule cleans the source tree of all compiled code, not including the pdf #documentation. From 19e2526b8249b955a2323b13f4e1a992354c5ccc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Sep 2015 02:11:43 +0200 Subject: [PATCH 0371/1192] add some make targets regarding code coverage --- makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/makefile b/makefile index 626da35de..097f72df8 100644 --- a/makefile +++ b/makefile @@ -275,10 +275,36 @@ profile: rm -f timing `find . -type f | grep [.][ao] | xargs` CFLAGS="$(CFLAGS) -fprofile-use" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" +# target that pre-processes all coverage data +lcov-single-create: + lcov --capture --no-external --directory src -q --output-file coverage_std.info + +# target that removes all coverage output +cleancov-clean: + rm -f `find . -type f -name "*.info" | xargs` + rm -rf coverage/ + +# generates html output from all coverage_*.info files lcov: lcov `find -name 'coverage_*.info' -exec echo -n " -a {}" \;` -o coverage.info -q 2>/dev/null genhtml coverage.info --output-directory coverage -q +# combines all necessary steps to create the coverage from a single testrun with e.g. +# CFLAGS="-DUSE_LTM -DLTM_DESC -I../libtommath" EXTRALIBS="../libtommath/libtommath.a" make coverage -j9 +lcov-single: | cleancov-clean lcov-single-create lcov + + +#cmake the code coverage of the library +coverage: CFLAGS += -fprofile-arcs -ftest-coverage +coverage: EXTRALIBS += -lgcov + +coverage: test + ./test + + +# cleans everything - coverage output and standard 'clean' +cleancov: cleancov-clean clean + #This rule cleans the source tree of all compiled code, not including the pdf #documentation. clean: From 01f184540232909646c635bc3aa745512da5c4ed Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Sep 2015 02:44:17 +0200 Subject: [PATCH 0372/1192] harden RSA CRT by implementing the proposed countermeasure ... from ch. 1.3 of [1] [1] https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf --- src/headers/tomcrypt_custom.h | 5 +++++ src/pk/rsa/rsa_exptmod.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 680a2ca62..3ed979b28 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -402,6 +402,11 @@ #define LTC_RSA_BLINDING #endif /* LTC_NO_RSA_BLINDING */ +#if defined(LTC_MRSA) && !defined(LTC_NO_RSA_CRT_HARDENING) +/* Enable RSA CRT hardening when doing private key operations by default */ +#define LTC_RSA_CRT_HARDENING +#endif /* LTC_NO_RSA_CRT_HARDENING */ + #if defined(LTC_MECC) && !defined(LTC_NO_ECC_TIMING_RESISTANT) /* Enable ECC timing resistant version by default */ #define LTC_ECC_TIMING_RESISTANT diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index dcb036e7d..78858fee9 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -38,7 +38,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, void *rnd, *rndi /* inverse of rnd */; #endif unsigned long x; - int err; + int err, no_crt; LTC_ARGCHK(in != NULL); LTC_ARGCHK(out != NULL); @@ -100,7 +100,9 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, } #endif /* LTC_RSA_BLINDING */ - if ((key->dP == NULL) || (mp_get_digit_count(key->dP) == 0)) { + no_crt = (key->dP == NULL) || (mp_get_digit_count(key->dP) == 0); + + if (no_crt) { /* * In case CRT optimization parameters are not provided, * the private key is directly used to exptmod it @@ -129,6 +131,14 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, goto error; } #endif + + #ifdef LTC_RSA_CRT_HARDENING + if (!no_crt) { + if ((err = mp_exptmod(tmp, key->e, key->N, tmpa)) != CRYPT_OK) { goto error; } + if ((err = mp_read_unsigned_bin(tmpb, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto error; } + if (mp_cmp(tmpa, tmpb) != LTC_MP_EQ) { err = CRYPT_ERROR; goto error; } + } + #endif } else { /* exptmod it */ if ((err = mp_exptmod(tmp, key->e, key->N, tmp)) != CRYPT_OK) { goto error; } From 733c52aa0047bc9b7f2a68d19ab728bc190f47a1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Sep 2015 21:04:33 +0200 Subject: [PATCH 0373/1192] add LTC_RSA_CRT_HARDENING to crypt_build_settings --- src/misc/crypt/crypt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 08ffee4a1..722fbf2eb 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -269,8 +269,12 @@ const char *crypt_build_settings = "\nPK Algs:\n" #if defined(LTC_MRSA) " RSA" -#if defined(LTC_RSA_BLINDING) +#if defined(LTC_RSA_BLINDING) && defined(LTC_RSA_CRT_HARDENING) + " (with blinding and CRT hardening)" +#elif defined(LTC_RSA_BLINDING) " (with blinding)" +#elif defined(LTC_RSA_CRT_HARDENING) + " (with CRT hardening)" #endif "\n" #endif From d4945ac52124d48f683e93faa0715ad769c5b50c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Sep 2015 21:09:49 +0200 Subject: [PATCH 0374/1192] add (nearly) all defines from tomcrypt_custom.h to crypt_build_settings ... and provide a new make target to check if something is missing --- makefile | 6 ++++++ src/misc/crypt/crypt.c | 27 +++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 097f72df8..048826308 100644 --- a/makefile +++ b/makefile @@ -387,6 +387,12 @@ zipup: no_oops docs mv -fv crypt* ~ ; rm -rf libtomcrypt-$(VERSION) +check_defines: + cat src/headers/tomcrypt_custom.h | grep '\#define[ \t]*LTC_' | sed -e 's@/\*@@g' -e 's@\*/@@g' -e 's@^[ \t]*@@g' \ + | cut -d' ' -f 2 | sed -e 's@(x)@@g' | sort | uniq \ + | grep -v -e 'LTC_ECC[0-9]*' -e 'LTC_DH[0-9]*' -e 'LTC_NO_' -e 'LTC_MUTEX' -e 'LTC_MPI' \ + | xargs -I '{}' sh -c 'grep -q -m 1 -o {} src/misc/crypt/crypt.c || echo {} not found' + # $Source$ # $Revision$ # $Date$ diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 722fbf2eb..dca18d0d7 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -14,6 +14,8 @@ @file crypt.c Build strings, Tom St Denis */ +#define NAME_VALUE(s) #s"="NAME(s) +#define NAME(s) #s const char *crypt_build_settings = "LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n" @@ -251,7 +253,7 @@ const char *crypt_build_settings = "\nPRNG:\n" #if defined(LTC_YARROW) - " Yarrow\n" + " Yarrow ("NAME_VALUE(LTC_YARROW_AES)")\n" #endif #if defined(LTC_SPRNG) " SPRNG\n" @@ -260,7 +262,7 @@ const char *crypt_build_settings = " RC4\n" #endif #if defined(LTC_FORTUNA) - " Fortuna\n" + " Fortuna (" NAME_VALUE(LTC_FORTUNA_POOLS) ", " NAME_VALUE(LTC_FORTUNA_WD) ")\n" #endif #if defined(LTC_SOBER128) " SOBER128\n" @@ -341,6 +343,9 @@ const char *crypt_build_settings = #if defined(LTC_DER) " DER " #endif +#if defined(LTC_DER_MAX_PUBKEY_SIZE) + " " NAME_VALUE(LTC_DER_MAX_PUBKEY_SIZE) " " +#endif #if defined(LTC_PKCS_1) " PKCS#1 " #endif @@ -353,12 +358,30 @@ const char *crypt_build_settings = #if defined(MPI) " MPI " #endif +#if defined(LTC_DEVRANDOM) + " LTC_DEVRANDOM " +#endif #if defined(LTC_TRY_URANDOM_FIRST) " LTC_TRY_URANDOM_FIRST " #endif +#if defined(LTC_RNG_GET_BYTES) + " LTC_RNG_GET_BYTES " +#endif +#if defined(LTC_RNG_MAKE_PRNG) + " LTC_RNG_MAKE_PRNG " +#endif +#if defined(LTC_HASH_HELPERS) + " LTC_HASH_HELPERS " +#endif +#if defined(LTC_VALGRIND) + " LTC_VALGRIND " +#endif #if defined(LTC_TEST) " LTC_TEST " #endif +#if defined(LTC_TEST_EXT) + " LTC_TEST_EXT " +#endif #if defined(LTC_SMALL_CODE) " LTC_SMALL_CODE " #endif From 16f397d55c9f4971a66a7ce9d87d0305ab45eaa7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 10 Sep 2015 19:17:42 +0200 Subject: [PATCH 0375/1192] prevent segfault in case we hit an empty sequence --- .../der/sequence/der_decode_sequence_flexi.c | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index 46458af90..caad48547 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -361,8 +361,11 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc /* len update */ totlen += data_offset; - /* link them up y0 */ - l->child->parent = l; + /* the flexi decoder can also do nothing, so make sure a child has been allocated */ + if (l->child) { + /* link them up y0 */ + l->child->parent = l; + } break; @@ -398,12 +401,15 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc outside: - /* rewind l please */ - while (l->prev != NULL || l->parent != NULL) { - if (l->parent != NULL) { - l = l->parent; - } else { - l = l->prev; + /* in case we processed anything */ + if (totlen) { + /* rewind l please */ + while (l->prev != NULL || l->parent != NULL) { + if (l->parent != NULL) { + l = l->parent; + } else { + l = l->prev; + } } } From 460b8716c9775edcca3dd8b6c778c9b4415465f8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 24 Oct 2015 16:22:28 +0200 Subject: [PATCH 0376/1192] fix clang-analyzer warnings This fixes #80 --- src/encauth/ccm/ccm_memory.c | 7 +------ src/headers/tomcrypt_argchk.h | 12 +++++++++--- src/mac/hmac/hmac_init.c | 10 ++++------ src/misc/crypt/crypt_argchk.c | 5 ++--- src/modes/xts/xts_decrypt.c | 4 +++- src/modes/xts/xts_encrypt.c | 4 +++- src/pk/asn1/der/integer/der_length_integer.c | 1 - src/pk/asn1/der/sequence/der_decode_sequence_multi.c | 2 ++ src/pk/asn1/der/sequence/der_encode_sequence_multi.c | 2 ++ src/pk/dh/dh_sys.c | 2 -- src/pk/pkcs1/pkcs_1_oaep_decode.c | 1 - src/pk/pkcs1/pkcs_1_pss_decode.c | 3 +-- src/pk/pkcs1/pkcs_1_pss_encode.c | 2 +- src/prngs/sober128.c | 1 - 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index 5750f345f..f12d212ef 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -127,11 +127,6 @@ int ccm_memory(int cipher, L = 15 - noncelen; } - /* decrease noncelen to match L */ - if ((noncelen + L) > 15) { - noncelen = 15 - L; - } - /* allocate mem for the symmetric key */ if (uskey == NULL) { skey = XMALLOC(sizeof(*skey)); @@ -147,7 +142,7 @@ int ccm_memory(int cipher, } else { skey = uskey; } - + /* initialize buffer for pt */ if (direction == CCM_DECRYPT) { pt_work = XMALLOC(ptlen); diff --git a/src/headers/tomcrypt_argchk.h b/src/headers/tomcrypt_argchk.h index f25837ad6..5cefc2d63 100644 --- a/src/headers/tomcrypt_argchk.h +++ b/src/headers/tomcrypt_argchk.h @@ -5,9 +5,15 @@ #include /* this is the default LibTomCrypt macro */ -void crypt_argchk(char *v, char *s, int d); -#define LTC_ARGCHK(x) if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } -#define LTC_ARGCHKVD(x) LTC_ARGCHK(x) +#if defined(__clang__) || defined(__GNUC_MINOR__) +#define NORETURN __attribute__ ((noreturn)) +#else +#define NORETURN +#endif + +void crypt_argchk(char *v, char *s, int d) NORETURN; +#define LTC_ARGCHK(x) do { if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } }while(0) +#define LTC_ARGCHKVD(x) do { if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } }while(0) #elif ARGTYPE == 1 diff --git a/src/mac/hmac/hmac_init.c b/src/mac/hmac/hmac_init.c index e43df24b4..2c887db85 100644 --- a/src/mac/hmac/hmac_init.c +++ b/src/mac/hmac/hmac_init.c @@ -68,15 +68,13 @@ int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned lon if ((err = hash_memory(hash, key, keylen, hmac->key, &z)) != CRYPT_OK) { goto LBL_ERR; } - if(hashsize < LTC_HMAC_BLOCKSIZE) { - zeromem((hmac->key) + hashsize, (size_t)(LTC_HMAC_BLOCKSIZE - hashsize)); - } keylen = hashsize; } else { XMEMCPY(hmac->key, key, (size_t)keylen); - if(keylen < LTC_HMAC_BLOCKSIZE) { - zeromem((hmac->key) + keylen, (size_t)(LTC_HMAC_BLOCKSIZE - keylen)); - } + } + + if(keylen < LTC_HMAC_BLOCKSIZE) { + zeromem((hmac->key) + keylen, (size_t)(LTC_HMAC_BLOCKSIZE - keylen)); } /* Create the initial vector for step (3) */ diff --git a/src/misc/crypt/crypt_argchk.c b/src/misc/crypt/crypt_argchk.c index 2301c2959..85888967c 100644 --- a/src/misc/crypt/crypt_argchk.c +++ b/src/misc/crypt/crypt_argchk.c @@ -13,15 +13,14 @@ /** @file crypt_argchk.c Perform argument checking, Tom St Denis -*/ +*/ #if (ARGTYPE == 0) -#include void crypt_argchk(char *v, char *s, int d) { fprintf(stderr, "LTC_ARGCHK '%s' failure on line %d of file %s\n", v, d, s); - (void)raise(SIGABRT); + abort(); } #endif diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index 6afe93617..1840b17d4 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -110,7 +110,9 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, } for (i = 0; i < lim; i++) { - err = tweak_uncrypt(ct, pt, T, xts); + if ((err = tweak_uncrypt(ct, pt, T, xts)) != CRYPT_OK) { + return err; + } ct += 16; pt += 16; } diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index 4f114d7a2..1f6dea387 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -113,7 +113,9 @@ int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, } for (i = 0; i < lim; i++) { - err = tweak_crypt(pt, ct, T, xts); + if ((err = tweak_crypt(pt, ct, T, xts)) != CRYPT_OK) { + return err; + } ct += 16; pt += 16; } diff --git a/src/pk/asn1/der/integer/der_length_integer.c b/src/pk/asn1/der/integer/der_length_integer.c index b8ff463a3..61584f7dc 100644 --- a/src/pk/asn1/der/integer/der_length_integer.c +++ b/src/pk/asn1/der/integer/der_length_integer.c @@ -46,7 +46,6 @@ int der_length_integer(void *num, unsigned long *outlen) } else { /* it's negative */ /* find power of 2 that is a multiple of eight and greater than count bits */ - leading_zero = 0; z = mp_count_bits(num); z = z + (8 - (z & 7)); if (((mp_cnt_lsb(num)+1)==mp_count_bits(num)) && ((mp_count_bits(num)&7)==0)) --z; diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index f22ff8045..8fa4ae0ed 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -44,6 +44,8 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) type = va_arg(args, ltc_asn1_type); size = va_arg(args, unsigned long); data = va_arg(args, void*); + LTC_UNUSED_PARAM(size); + LTC_UNUSED_PARAM(data); if (type == LTC_ASN1_EOL) { break; diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index 1ffcfce8f..cf17f7fae 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -45,6 +45,8 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) type = va_arg(args, ltc_asn1_type); size = va_arg(args, unsigned long); data = va_arg(args, void*); + LTC_UNUSED_PARAM(size); + LTC_UNUSED_PARAM(data); if (type == LTC_ASN1_EOL) { break; diff --git a/src/pk/dh/dh_sys.c b/src/pk/dh/dh_sys.c index 5f44c6a15..63cad6062 100644 --- a/src/pk/dh/dh_sys.c +++ b/src/pk/dh/dh_sys.c @@ -246,8 +246,6 @@ int dh_decrypt_key(const unsigned char *in, unsigned long inlen, if (inlen < keysize) { err = CRYPT_INVALID_PACKET; goto LBL_ERR; - } else { - inlen -= keysize; } if (keysize > *outlen) { diff --git a/src/pk/pkcs1/pkcs_1_oaep_decode.c b/src/pk/pkcs1/pkcs_1_oaep_decode.c index 2c768bbc0..587749849 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -85,7 +85,6 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, */ - err = CRYPT_OK; ret = CRYPT_OK; /* must have leading 0x00 byte */ diff --git a/src/pk/pkcs1/pkcs_1_pss_decode.c b/src/pk/pkcs1/pkcs_1_pss_decode.c index 025a5d61b..0fdf9262d 100644 --- a/src/pk/pkcs1/pkcs_1_pss_decode.c +++ b/src/pk/pkcs1/pkcs_1_pss_decode.c @@ -94,8 +94,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, /* copy out the hash */ XMEMCPY(hash, sig + x, hLen); - x += hLen; - + /* x += hLen; */ /* check the MSB */ if ((sig[0] & ~(0xFF >> ((modulus_len<<3) - (modulus_bitlen)))) != 0) { diff --git a/src/pk/pkcs1/pkcs_1_pss_encode.c b/src/pk/pkcs1/pkcs_1_pss_encode.c index d10c44d23..7766c7794 100644 --- a/src/pk/pkcs1/pkcs_1_pss_encode.c +++ b/src/pk/pkcs1/pkcs_1_pss_encode.c @@ -116,7 +116,7 @@ int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, x += modulus_len - saltlen - hLen - 2; DB[x++] = 0x01; XMEMCPY(DB + x, salt, saltlen); - x += saltlen; + /* x += saltlen; */ /* generate mask of length modulus_len - hLen - 1 from hash */ if ((err = pkcs_1_mgf1(hash_idx, hash, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) { diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index 7a45e1b5e..25a3b43f9 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -300,7 +300,6 @@ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state #endif c = &(prng->sober128); - t = 0; tlen = outlen; /* handle any previously buffered bytes */ From 318dbbccc35505f063ac61355af340598da0d3e8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 24 Oct 2015 16:31:24 +0200 Subject: [PATCH 0377/1192] fix wrongly used LTC_ARGCHK/LTC_ARGCHKVD macros --- src/pk/dh/dh.c | 6 +++--- src/pk/dh/dh_static.h | 2 +- src/pk/rsa/rsa_get_size.c | 2 +- src/pk/rsa/rsa_sign_saltlen_get.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index d2b970bea..ec14b6ddd 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -77,8 +77,8 @@ int dh_compat_test(void) void dh_sizes(int *low, int *high) { int x; - LTC_ARGCHK(low != NULL); - LTC_ARGCHK(high != NULL); + LTC_ARGCHKVD(low != NULL); + LTC_ARGCHKVD(high != NULL); *low = INT_MAX; *high = 0; for (x = 0; sets[x].size != 0; x++) { @@ -187,7 +187,7 @@ int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) */ void dh_free(dh_key *key) { - LTC_ARGCHK(key != NULL); + LTC_ARGCHKVD(key != NULL); if ( key->x ) { mp_clear( key->x ); key->x = NULL; diff --git a/src/pk/dh/dh_static.h b/src/pk/dh/dh_static.h index 6473c3eb0..273b1754a 100644 --- a/src/pk/dh/dh_static.h +++ b/src/pk/dh/dh_static.h @@ -71,7 +71,7 @@ static inline void packet_store_header (unsigned char *dst, int section, int subsection) { - LTC_ARGCHK(dst != NULL); + LTC_ARGCHKVD(dst != NULL); /* store version number */ dst[0] = (unsigned char)(CRYPT&255); diff --git a/src/pk/rsa/rsa_get_size.c b/src/pk/rsa/rsa_get_size.c index 79556fe8b..dfc82b079 100644 --- a/src/pk/rsa/rsa_get_size.c +++ b/src/pk/rsa/rsa_get_size.c @@ -25,7 +25,7 @@ int rsa_get_size(rsa_key *key) { int ret = INT_MAX; - LTC_ARGCHKVD(key != NULL); + LTC_ARGCHK(key != NULL); if (key) { diff --git a/src/pk/rsa/rsa_sign_saltlen_get.c b/src/pk/rsa/rsa_sign_saltlen_get.c index 5f0e68eb6..d549a4fac 100644 --- a/src/pk/rsa/rsa_sign_saltlen_get.c +++ b/src/pk/rsa/rsa_sign_saltlen_get.c @@ -27,7 +27,7 @@ int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key) { int ret = INT_MAX; - LTC_ARGCHKVD(key != NULL); + LTC_ARGCHK(key != NULL); if ((hash_is_valid(hash_idx) == CRYPT_OK) && (padding == LTC_PKCS_1_PSS)) From f5016d88dd5a9c651162c137ecade04da72a4705 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 16 Sep 2015 23:51:57 +0200 Subject: [PATCH 0378/1192] Prevent undefined behavior Don't call XMEMCPY() in case info (the source parameter to memcpy) is NULL as this would trigger UB --- src/misc/hkdf/hkdf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index b6f24a066..3682bf884 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -61,7 +61,9 @@ int hkdf_expand(int hash_idx, const unsigned char *info, unsigned long infolen, if (T == NULL) { return CRYPT_MEM; } - XMEMCPY(T + hashsize, info, infolen); + if (info != NULL) { + XMEMCPY(T + hashsize, info, infolen); + } /* HMAC data T(1) doesn't include a previous hash value */ dat = T + hashsize; From 012dfe8001ef2ad2855edf11285ffa5fcbddf027 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 5 Dec 2015 14:30:15 +0100 Subject: [PATCH 0379/1192] Make the build output cleaner so diagnostics are easier to spot Signed-off-by: Tom St Denis Signed-off-by: Steffen Jaeckel --- makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 048826308..00bed4da9 100644 --- a/makefile +++ b/makefile @@ -5,13 +5,23 @@ include makefile.include -CFLAGS += -c - # The version VERSION=1.17 PLATFORM := $(shell uname | sed -e 's/_.*//') +ifeq ($V,1) +silent= +else +silent=@ +endif + +%.o: %.c +ifneq ($V,1) + @echo " * ${CC} $@" +endif + ${silent} ${CC} ${CFLAGS} -c $< -o $@ + # ranlib tools ifndef RANLIB ifeq ($(PLATFORM), Darwin) @@ -190,9 +200,9 @@ COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip #The default rule for make builds the libtomcrypt library. default:library -#ciphers come in two flavours... enc+dec and enc +#AES comes in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o + ${silent} ${CC} ${CFLAGS} -DENCRYPT_ONLY -c $< -o $@ #These are the rules to make certain object files. src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c From 645a82d9e6fc81e2ff08abd6ed3f81ec9603d0c6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Jan 2016 23:24:47 +0100 Subject: [PATCH 0380/1192] travis: update local package index as first step --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0189968ea..5250d941e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,6 +73,7 @@ branches: only: - develop before_script: + - sudo apt-get update -qq - sudo apt-get install libtommath-dev - sudo pip install cpp-coveralls after_failure: From 7c2ff8ebfe1473ee81bad41d1a63316f303f7e5d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Jan 2016 23:55:06 +0100 Subject: [PATCH 0381/1192] show ROtate operator configuration in build settings [skip ci] --- src/headers/tomcrypt_macros.h | 3 +++ src/misc/crypt/crypt.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index f0dcf682a..2bb60cf77 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -235,6 +235,7 @@ do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \ /* 32-bit Rotates */ #if defined(_MSC_VER) +#define LTC_ROx_ASM /* instrinsic rotate */ #include @@ -245,6 +246,7 @@ do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \ #define ROLc(x,n) _lrotl(x,n) #elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM) +#define LTC_ROx_ASM static inline ulong32 ROL(ulong32 word, int i) { @@ -289,6 +291,7 @@ static inline ulong32 ROR(ulong32 word, int i) #endif #elif !defined(__STRICT_ANSI__) && defined(LTC_PPC32) +#define LTC_ROx_ASM static inline ulong32 ROL(ulong32 word, int i) { diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index dca18d0d7..d277901ad 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -400,6 +400,12 @@ const char *crypt_build_settings = #if defined(LTC_NO_ASM) " LTC_NO_ASM " #endif +#if defined(LTC_ROx_ASM) + " LTC_ROx_ASM " +#if defined(LTC_NO_ROLC) + " LTC_NO_ROLC " +#endif +#endif #if defined(LTC_NO_TEST) " LTC_NO_TEST " #endif From 8cf7eb1801bac66094a220af68997c091e917591 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 10 Jan 2016 18:45:04 +0100 Subject: [PATCH 0382/1192] fix for issue #91 - redefinition of macro "setbit" --- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index a7f355c95..ee8e9a4d1 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -18,7 +18,7 @@ #ifdef LTC_DER -#define setbit(v, n) (v=((unsigned char)(v) | (1U << (unsigned char)(n)))) +#define SETBIT(v, n) (v=((unsigned char)(v) | (1U << (unsigned char)(n)))) /** Store a BIT STRING @@ -87,7 +87,7 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, /* decode/store the bits */ for (y = 0; y < blen; y++) { if (in[x] & (1 << (7 - (y & 7)))) { - setbit(out[y/8], 7-(y%8)); + SETBIT(out[y/8], 7-(y%8)); } if ((y & 7) == 7) { ++x; From 42bad9f5806d80ed7a9f46af8ff87b141dca98de Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 10 Jan 2016 21:37:17 +0100 Subject: [PATCH 0383/1192] fix for issue #58 - possible overflow in ecc_ansi_x963_export --- src/pk/ecc/ecc_ansi_x963_export.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pk/ecc/ecc_ansi_x963_export.c b/src/pk/ecc/ecc_ansi_x963_export.c index 09dae070e..f195a8ec3 100644 --- a/src/pk/ecc/ecc_ansi_x963_export.c +++ b/src/pk/ecc/ecc_ansi_x963_export.c @@ -32,7 +32,7 @@ int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen) { unsigned char buf[ECC_BUF_SIZE]; - unsigned long numlen; + unsigned long numlen, xlen, ylen; LTC_ARGCHK(key != NULL); LTC_ARGCHK(out != NULL); @@ -42,6 +42,12 @@ int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen return CRYPT_INVALID_ARG; } numlen = key->dp->size; + xlen = mp_unsigned_bin_size(key->pubkey.x); + ylen = mp_unsigned_bin_size(key->pubkey.y); + + if (xlen > numlen || ylen > numlen || sizeof(buf) < numlen) { + return CRYPT_BUFFER_OVERFLOW; + } if (*outlen < (1 + 2*numlen)) { *outlen = 1 + 2*numlen; @@ -53,12 +59,12 @@ int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen /* pad and store x */ zeromem(buf, sizeof(buf)); - mp_to_unsigned_bin(key->pubkey.x, buf + (numlen - mp_unsigned_bin_size(key->pubkey.x))); + mp_to_unsigned_bin(key->pubkey.x, buf + (numlen - xlen)); XMEMCPY(out+1, buf, numlen); /* pad and store y */ zeromem(buf, sizeof(buf)); - mp_to_unsigned_bin(key->pubkey.y, buf + (numlen - mp_unsigned_bin_size(key->pubkey.y))); + mp_to_unsigned_bin(key->pubkey.y, buf + (numlen - ylen)); XMEMCPY(out+1+numlen, buf, numlen); *outlen = 1 + 2*numlen; From 10e577e24a89b9cc9ac3543dab58ec7b0920405e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 14 Jan 2016 21:32:33 +0100 Subject: [PATCH 0384/1192] there's no need to check out on function entry ...someone could then do something like this... unsigned char* out = NULL; unsigned long len = 0; while(ecc_ansi_x963_export(key, out, &len) == CRYPT_BUFFER_OVERFLOW && len == 0) { out = malloc(len); } ...as if someone would ever like to do something like that... --- src/pk/ecc/ecc_ansi_x963_export.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pk/ecc/ecc_ansi_x963_export.c b/src/pk/ecc/ecc_ansi_x963_export.c index f195a8ec3..e834c950f 100644 --- a/src/pk/ecc/ecc_ansi_x963_export.c +++ b/src/pk/ecc/ecc_ansi_x963_export.c @@ -19,7 +19,7 @@ /** @file ecc_ansi_x963_export.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC @@ -35,7 +35,6 @@ int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen unsigned long numlen, xlen, ylen; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); if (ltc_ecc_is_valid_idx(key->idx) == 0) { @@ -54,6 +53,8 @@ int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen return CRYPT_BUFFER_OVERFLOW; } + LTC_ARGCHK(out != NULL); + /* store byte 0x04 */ out[0] = 0x04; From 7c1e251e75a6d4193c3d5352944d6eecefe0e268 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 11 Jan 2016 09:55:29 +0100 Subject: [PATCH 0385/1192] avoid using declaration after statements --- src/prngs/rng_get_bytes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index becb5bd1d..723afbca1 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -21,14 +21,15 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len, void (*callback)(void)) { - LTC_UNUSED_PARAM(callback); #ifdef LTC_NO_FILE + LTC_UNUSED_PARAM(callback); LTC_UNUSED_PARAM(buf); LTC_UNUSED_PARAM(len); return 0; #else FILE *f; unsigned long x; + LTC_UNUSED_PARAM(callback); #ifdef LTC_TRY_URANDOM_FIRST f = fopen("/dev/urandom", "rb"); if (f == NULL) From 15b3f39a4f527e2c512f9ae6ceeed9eb1fc04ef3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Jan 2016 00:21:32 +0100 Subject: [PATCH 0386/1192] avoid using declaration after statements (rng_win32) --- src/prngs/rng_get_bytes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 723afbca1..457c26fb4 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -108,8 +108,8 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, static unsigned long rng_win32(unsigned char *buf, unsigned long len, void (*callback)(void)) { - LTC_UNUSED_PARAM(callback); HCRYPTPROV hProv = 0; + LTC_UNUSED_PARAM(callback); if (!CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, (CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET)) && !CryptAcquireContext (&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, From d0a534393abf0574747f937e84191256a0328b5a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 10 Jan 2016 18:49:13 +0100 Subject: [PATCH 0387/1192] fix for issue #92 - const is meaningless on cast type --- src/ciphers/camellia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index c152ff78b..d17229d40 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -190,7 +190,7 @@ static ulong64 F(ulong64 x) U = SP1110[(x >> loc(1)) & 0xFF] ^ SP0222[(x >> loc(2)) & 0xFF] ^ SP3033[(x >> loc(3)) & 0xFF] ^ SP4404[(x >> loc(4)) & 0xFF]; D ^= U; - U = D ^ ROR(U, (const int)8); + U = D ^ ROR(U, 8); return ((ulong64)U) | (((ulong64)D) << CONST64(32)); } From af77f1fae91ff8cd24207ebfd592b0bdc4c11e41 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Jan 2016 22:09:07 +0100 Subject: [PATCH 0388/1192] RORc instead of ROR --- src/ciphers/camellia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index d17229d40..558a585b5 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -190,7 +190,7 @@ static ulong64 F(ulong64 x) U = SP1110[(x >> loc(1)) & 0xFF] ^ SP0222[(x >> loc(2)) & 0xFF] ^ SP3033[(x >> loc(3)) & 0xFF] ^ SP4404[(x >> loc(4)) & 0xFF]; D ^= U; - U = D ^ ROR(U, 8); + U = D ^ RORc(U, 8); return ((ulong64)U) | (((ulong64)D) << CONST64(32)); } From 6905e4113f7192b3ff54d6467c0a61b9bb456f75 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 19 Jan 2016 00:38:05 +0100 Subject: [PATCH 0389/1192] make build process silent --- makefile | 10 ++++++++-- makefile.include | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 00bed4da9..503774c18 100644 --- a/makefile +++ b/makefile @@ -223,8 +223,14 @@ testprof/$(LIBTEST): cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE) $(LIBNAME): $(OBJECTS) - $(AR) $(ARFLAGS) $@ $(OBJECTS) - $(RANLIB) $@ +ifneq ($V,1) + @echo " * ${AR} $@" +endif + ${silent} $(AR) $(ARFLAGS) $@ $(OBJECTS) +ifneq ($V,1) + @echo " * ${RANLIB} $@" +endif + ${silent} $(RANLIB) $@ #This rule makes the hash program included with libtomcrypt hashsum: library $(HASHOBJECTS) diff --git a/makefile.include b/makefile.include index 0f4af9487..bcbdb7f7e 100644 --- a/makefile.include +++ b/makefile.include @@ -15,7 +15,7 @@ AR:=$(PREFIX)ar # Archiver [makes .a files] #AR=ar -#ARFLAGS=r +ARFLAGS:=r ifndef MAKE MAKE:=make From a6417387c0b619617405030085831ed5f80aeee9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 17:02:53 +0100 Subject: [PATCH 0390/1192] make check_defines silent --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 503774c18..e225e5794 100644 --- a/makefile +++ b/makefile @@ -404,7 +404,7 @@ zipup: no_oops docs check_defines: - cat src/headers/tomcrypt_custom.h | grep '\#define[ \t]*LTC_' | sed -e 's@/\*@@g' -e 's@\*/@@g' -e 's@^[ \t]*@@g' \ + ${silent} cat src/headers/tomcrypt_custom.h | grep '\#define[ \t]*LTC_' | sed -e 's@/\*@@g' -e 's@\*/@@g' -e 's@^[ \t]*@@g' \ | cut -d' ' -f 2 | sed -e 's@(x)@@g' | sort | uniq \ | grep -v -e 'LTC_ECC[0-9]*' -e 'LTC_DH[0-9]*' -e 'LTC_NO_' -e 'LTC_MUTEX' -e 'LTC_MPI' \ | xargs -I '{}' sh -c 'grep -q -m 1 -o {} src/misc/crypt/crypt.c || echo {} not found' From 966496ea1ac901078b03a730cc740c7a01e41a44 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 10 Jan 2016 21:56:23 +0100 Subject: [PATCH 0391/1192] fixing GCM troubles at HP-UX/IA64 --- src/encauth/gcm/gcm_gf_mult.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encauth/gcm/gcm_gf_mult.c b/src/encauth/gcm/gcm_gf_mult.c index 37d8a57a4..e8d8c2d12 100644 --- a/src/encauth/gcm/gcm_gf_mult.c +++ b/src/encauth/gcm/gcm_gf_mult.c @@ -83,7 +83,7 @@ static const unsigned char poly[] = { 0x00, 0xE1 }; void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *c) { unsigned char Z[16], V[16]; - unsigned x, y, z; + unsigned char x, y, z; zeromem(Z, 16); XMEMCPY(V, a, 16); From 7c9450084f17c235f0f5c7e5af5fe7e0f1e11cd2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 18:42:50 +0100 Subject: [PATCH 0392/1192] fix some compile errors --- demos/demo_crypt_constants.c | 4 ++-- demos/demo_crypt_sizes.c | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c index 9c41cf764..c55d6df17 100644 --- a/demos/demo_crypt_constants.c +++ b/demos/demo_crypt_constants.c @@ -31,11 +31,11 @@ int main(void) { // get and print the length of the names (and values) list char *names_list; - unsigned long names_list_len; + unsigned int names_list_len; if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE); - printf(" need to allocate %lu bytes \n\n", names_list_len); + printf(" need to allocate %u bytes \n\n", names_list_len); // get and print the names (and values) list if ((names_list = malloc(names_list_len)) == NULL) diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index ea1cef172..a2da0a734 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -19,24 +19,27 @@ int main(void) { - int rc; // given a specific size name, get and print its size char name[] = "ecc_key"; - int size; - rc = crypt_get_size(name, &size); - printf("\n size of '%s' is %d \n\n", name, size); + unsigned int size; + if(crypt_get_size(name, &size) != 0) + exit(EXIT_FAILURE); + printf("\n size of '%s' is %u \n\n", name, size); // get and print the length of the names (and sizes) list char *sizes_list; - unsigned long sizes_list_len; - rc = crypt_list_all_sizes(NULL, &sizes_list_len); - printf(" need to allocate %lu bytes \n\n", sizes_list_len); + unsigned int sizes_list_len; + if(crypt_list_all_sizes(NULL, &sizes_list_len) != 0) + exit(EXIT_FAILURE); + printf(" need to allocate %u bytes \n\n", sizes_list_len); // get and print the names (and sizes) list sizes_list = malloc(sizes_list_len); - rc = crypt_list_all_sizes(sizes_list, &sizes_list_len); + if(crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) + exit(EXIT_FAILURE); printf(" supported sizes:\n\n%s\n\n", sizes_list); + return 0; } From 4572357e876f7bd5de03139e255ae4e8380629e1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 18:59:30 +0100 Subject: [PATCH 0393/1192] make easily built demos in a template --- demos/{demo_crypt_constants.c => constants.c} | 0 demos/{encrypt.c => crypt.c} | 0 demos/{demo_crypt_sizes.c => sizes.c} | 0 makefile | 39 ++++++------------- 4 files changed, 11 insertions(+), 28 deletions(-) rename demos/{demo_crypt_constants.c => constants.c} (100%) rename demos/{encrypt.c => crypt.c} (100%) rename demos/{demo_crypt_sizes.c => sizes.c} (100%) diff --git a/demos/demo_crypt_constants.c b/demos/constants.c similarity index 100% rename from demos/demo_crypt_constants.c rename to demos/constants.c diff --git a/demos/encrypt.c b/demos/crypt.c similarity index 100% rename from demos/encrypt.c rename to demos/crypt.c diff --git a/demos/demo_crypt_sizes.c b/demos/sizes.c similarity index 100% rename from demos/demo_crypt_sizes.c rename to demos/sizes.c diff --git a/makefile b/makefile index e225e5794..285b37c81 100644 --- a/makefile +++ b/makefile @@ -181,15 +181,10 @@ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS -HASHOBJECTS=demos/hashsum.o -CRYPTOBJECTS=demos/encrypt.o -SMALLOBJECTS=demos/small.o -TVS=demos/tv_gen.o -MULTIS=demos/multi.o +DEMOS=hashsum crypt small tv_gen multi sizes constants + TIMINGS=demos/timing.o TESTS=demos/test.o -CRYPTSIZES=demos/demo_crypt_sizes.o -CRYPTCONSTANTS=demos/demo_crypt_constants.o #Files left over from making the crypt.pdf. LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof @@ -232,23 +227,16 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -#This rule makes the hash program included with libtomcrypt -hashsum: library $(HASHOBJECTS) - $(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) - -#makes the crypt program -crypt: library $(CRYPTOBJECTS) - $(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) - -#makes the small program -small: library $(SMALLOBJECTS) - $(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) - -tv_gen: library $(TVS) - $(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) +# build the demos from a template +define DEMO_template +$(1): demos/$(1).o library +ifneq ($V,1) + @echo " * $${CC} $$@" +endif + $${silent} $$(CC) $$< $$(LIBNAME) $$(EXTRALIBS) -o $(1) +endef -multi: library $(MULTIS) - $(CC) $(MULTIS) $(LIBNAME) $(EXTRALIBS) -o $(MULTI) +$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) timing: library testprof/$(LIBTEST) $(TIMINGS) $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) @@ -257,11 +245,6 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) -sizes: library $(CRYPTSIZES) - $(CC) $(LDFLAGS) $(CRYPTSIZES) $(LIBNAME) $(EXTRALIBS) -o $(SIZES) - -constants: library $(CRYPTCONSTANTS) - $(CC) $(LDFLAGS) $(CRYPTCONSTANTS) $(LIBNAME) $(EXTRALIBS) -o $(CONSTANTS) #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct From d1eeecb137a41c512f4f57886ee15cb437fb1838 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 18:59:44 +0100 Subject: [PATCH 0394/1192] fix some compiler warnings --- demos/crypt.c | 3 ++- demos/hashsum.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/demos/crypt.c b/demos/crypt.c index e5817225b..6bd14ac03 100644 --- a/demos/crypt.c +++ b/demos/crypt.c @@ -177,7 +177,8 @@ int main(int argc, char *argv[]) } printf("\nEnter key: "); - fgets((char *)tmpkey,sizeof(tmpkey), stdin); + if(fgets((char *)tmpkey,sizeof(tmpkey), stdin) == NULL) + exit(-1); outlen = sizeof(key); if ((errno = hash_memory(hash_idx,tmpkey,strlen((char *)tmpkey),key,&outlen)) != CRYPT_OK) { printf("Error hashing key: %s\n", error_to_string(errno)); diff --git a/demos/hashsum.c b/demos/hashsum.c index 4e315011b..78d636975 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -11,7 +11,7 @@ int errno; -void register_algs(); +void register_algs(void); int main(int argc, char **argv) { From 23cad077013aa8be3d8318db1ec7bbfce701fdca Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 19:00:23 +0100 Subject: [PATCH 0395/1192] refactor makefile a bit more --- makefile | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/makefile b/makefile index 285b37c81..e3c43b6d0 100644 --- a/makefile +++ b/makefile @@ -213,10 +213,6 @@ library: $(LIBNAME) $(OBJECTS): $(HEADERS) -.PHONY: testprof/$(LIBTEST) -testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE) - $(LIBNAME): $(OBJECTS) ifneq ($V,1) @echo " * ${AR} $@" @@ -227,6 +223,23 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ +.PHONY: testprof/$(LIBTEST) +testprof/$(LIBTEST): + CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" RANLIB="$(RANLIB)" V="$(V)" $(MAKE) -C testprof + +timing: library testprof/$(LIBTEST) $(TIMINGS) +ifneq ($V,1) + @echo " * ${CC} $@" +endif + ${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) + +.PHONY: test +test: library testprof/$(LIBTEST) $(TESTS) +ifneq ($V,1) + @echo " * ${CC} $@" +endif + ${silent} $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) + # build the demos from a template define DEMO_template $(1): demos/$(1).o library @@ -238,12 +251,6 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) -timing: library testprof/$(LIBTEST) $(TIMINGS) - $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) - -.PHONY: test -test: library testprof/$(LIBTEST) $(TESTS) - $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) #This rule installs the library and the header files. This must be run From 61d730323ad1d077e8edcade90147096f0410bf7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 19:04:22 +0100 Subject: [PATCH 0396/1192] introduce new all_test make-target --- build.sh | 2 +- makefile | 2 +- makefile.icc | 2 ++ makefile.mingw | 2 ++ makefile.msvc | 2 ++ makefile.shared | 2 ++ makefile.unix | 2 ++ 7 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 9338caf22..c4c209f67 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ make clean 1>/dev/null 2>/dev/null echo -n "building..." -CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt +CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -f $3 all_test 1>gcc_1.txt 2>gcc_2.txt mret=$? cnt=$(wc -l < gcc_2.txt) # ignore 2 lines since ar prints to stderr instead of stdout and ar is called for diff --git a/makefile b/makefile index e3c43b6d0..9a79f62d4 100644 --- a/makefile +++ b/makefile @@ -251,7 +251,7 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) - +all_test: test tv_gen $(DEMOS) #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct diff --git a/makefile.icc b/makefile.icc index 18143ee0f..9cec4ef76 100644 --- a/makefile.icc +++ b/makefile.icc @@ -308,6 +308,8 @@ timing: library $(TIMINGS) testprof/$(LIBTEST) test: library $(TESTS) testprof/$(LIBTEST) $(CC) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +all_test: test tv_gen hashsum crypt small timing + #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. diff --git a/makefile.mingw b/makefile.mingw index 68e80b5c2..4205b2960 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -246,6 +246,8 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +all_test: test tv_gen hashsum crypt small multi timing + install: library cmd /c if not exist "$(DESTDIR)$(LIBPATH)" mkdir "$(DESTDIR)$(LIBPATH)" cmd /c if not exist "$(DESTDIR)$(INCPATH)" mkdir "$(DESTDIR)$(INCPATH)" diff --git a/makefile.msvc b/makefile.msvc index 7c060ced7..5d97aec2a 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -168,6 +168,8 @@ test: demos/test.c library timing: demos/timing.c library cl $(CFLAGS) demos/timing.c testprof/tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) +all_test: test tv_gen hashsum timing + # $Source$ # $Revision$ # $Date$ diff --git a/makefile.shared b/makefile.shared index a0d90ac16..4222bd378 100644 --- a/makefile.shared +++ b/makefile.shared @@ -244,6 +244,8 @@ test: library testprof/$(LIBTEST) $(TESTS) timing: library testprof/$(LIBTEST) $(TIMINGS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) +all_test: test tv_gen hashsum crypt small timing + # $Source$ # $Revision$ # $Date$ diff --git a/makefile.unix b/makefile.unix index 6c6461b7d..87ad82281 100644 --- a/makefile.unix +++ b/makefile.unix @@ -246,6 +246,8 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +all_test: test tv_gen hashsum crypt small multi timing + #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. From 912eff4949f46c0b426d2180429a6fa4c1144f1d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 19:09:55 +0100 Subject: [PATCH 0397/1192] make testprof/makefile silent --- makefile | 2 +- testprof/makefile | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 9a79f62d4..46303983a 100644 --- a/makefile +++ b/makefile @@ -225,7 +225,7 @@ endif .PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): - CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" RANLIB="$(RANLIB)" V="$(V)" $(MAKE) -C testprof + ${silent} CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" RANLIB="$(RANLIB)" V="$(V)" $(MAKE) -C testprof timing: library testprof/$(LIBTEST) $(TIMINGS) ifneq ($V,1) diff --git a/testprof/makefile b/testprof/makefile index 72ae3f798..65ac817e0 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -5,6 +5,18 @@ ifndef RANLIB RANLIB=ranlib endif +ifeq ($V,1) +silent= +else +silent=@ +endif + +%.o: %.c +ifneq ($V,1) + @echo " * ${CC} $@" +endif + ${silent} ${CC} ${CFLAGS} -c $< -o $@ + OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ @@ -17,8 +29,14 @@ endif default: $(LIBTEST_S) $(LIBTEST_S): $(OBJECTS) - $(AR) $(ARFLAGS) $@ $(OBJECTS) - $(RANLIB) $@ +ifneq ($V,1) + @echo " * ${AR} $@" +endif + ${silent} $(AR) $(ARFLAGS) $@ $(OBJECTS) +ifneq ($V,1) + @echo " * ${RANLIB} $@" +endif + ${silent} $(RANLIB) $@ clean: rm -f *.o *.a *.gcov *.gcda *.gcno From 5d5694dbc4793029c709cc2e841b03ea3a8c2840 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 1 Apr 2016 09:26:28 +0200 Subject: [PATCH 0398/1192] install without USER and GROUP like in libtommath. really more friendly for packaging. --- makefile | 18 +++++++++--------- makefile.shared | 14 +++++++------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/makefile b/makefile index 46303983a..f603b81fc 100644 --- a/makefile +++ b/makefile @@ -261,19 +261,19 @@ install: library docs else install: library endif - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(DATAPATH) - install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH) - install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) + install -d $(DESTDIR)$(LIBPATH) + install -d $(DESTDIR)$(INCPATH) + install -d $(DESTDIR)$(DATAPATH) + install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH) + install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) ifndef NODOCS - install -g $(GROUP) -o $(USER) doc/crypt.pdf $(DESTDIR)$(DATAPATH) + install -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH) endif install_test: testprof/$(LIBTEST) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) - install -g $(GROUP) -o $(USER) testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) + install -d $(DESTDIR)$(LIBPATH) + install -d $(DESTDIR)$(INCPATH) + install -m 644 testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) profile: CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" diff --git a/makefile.shared b/makefile.shared index 4222bd378..2f60df8ab 100644 --- a/makefile.shared +++ b/makefile.shared @@ -210,18 +210,18 @@ $(LIBNAME): $(OBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) -release $(RELEASE) install: $(LIBNAME) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) + install -d $(DESTDIR)$(LIBPATH) $(LT) --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) - install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) + install -d $(DESTDIR)$(INCPATH) + install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) install -d $(DESTDIR)$(LIBPATH)/pkgconfig sed 's,@LIBDIR@,$(LIBPATH),g' libtomcrypt.pc.in > libtomcrypt.pc - install -m 0644 -g $(GROUP) -o $(USER) libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc + install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc install_test: testprof/$(LIBTEST) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) - cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) LT=$(LT) CC=$(CC) make -f makefile.shared install + install -d $(DESTDIR)$(LIBPATH) + install -d $(DESTDIR)$(INCPATH) + cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) LT=$(LT) CC=$(CC) make -f makefile.shared install #This rule makes the hash program included with libtomcrypt hashsum: library $(HASHOBJECTS) From 1c6c02e18de44a5e7e53c931bb196636c9b81e4a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Jan 2016 21:56:07 +0100 Subject: [PATCH 0399/1192] fix gitignore --- .gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2ac5901ec..e6f8df239 100644 --- a/.gitignore +++ b/.gitignore @@ -17,10 +17,12 @@ doxygen/ # *nix/windows test executables constants constants.exe -encrypt -encrypt.exe +crypt +crypt.exe hashsum hashsum.exe +multi +multi.exe sizes sizes.exe small From da3ade08077b16b31090225390772638e9ecea15 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Jan 2016 21:57:42 +0100 Subject: [PATCH 0400/1192] increase coverage by running 'sizes' and 'constants' --- coverage.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coverage.sh b/coverage.sh index 7aa7c43e8..601367c22 100755 --- a/coverage.sh +++ b/coverage.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e if [ -z "$(echo $CC | grep "gcc")" ]; then echo "no gcc detected, early exit success" @@ -17,6 +17,9 @@ else exit 1 fi +./sizes +./constants + cpp-coveralls -e 'demos/' -e 'testprof/' -e 'notes/' -e 'src/headers/' exit 0 From 892342c7695406d5c5863328bdae771b25772c18 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 26 Jan 2016 22:13:03 +0100 Subject: [PATCH 0401/1192] automatically determine the number of parallel make jobs for the tests --- build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index c4c209f67..43a447378 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,14 @@ make clean 1>/dev/null 2>/dev/null echo -n "building..." -CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -f $3 all_test 1>gcc_1.txt 2>gcc_2.txt +if [ -f /proc/cpuinfo ] +then + MAKE_JOBS=$(( ($(cat /proc/cpuinfo | grep -E '^processor[[:space:]]*:' | tail -n -1 | cut -d':' -f2) + 1) * 2 + 1 )) +else + MAKE_JOBS=8 +fi + +CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j$MAKE_JOBS -f $3 all_test 1>gcc_1.txt 2>gcc_2.txt mret=$? cnt=$(wc -l < gcc_2.txt) # ignore 2 lines since ar prints to stderr instead of stdout and ar is called for From bb56ef08eb80854e78011da1f99a35f7cb2411fd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 3 Apr 2016 17:45:16 +0200 Subject: [PATCH 0402/1192] bring coverage results near reality --- coverage.sh | 19 ++++++++++++++++--- makefile | 14 ++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/coverage.sh b/coverage.sh index 601367c22..fcdf53df8 100755 --- a/coverage.sh +++ b/coverage.sh @@ -1,4 +1,12 @@ -#!/bin/bash -e +#!/bin/bash + +set -e + +if [ "$#" != "5" ]; then + echo "Usage is: ${0} \"coverage\" \"\" \"\" \"\" " + echo "CC=gcc ${0} \"coverage\" \" \" \"makefile\" \"-DUSE_LTM -DLTM_DESC -I../libtommath\" ../libtommath/libtommath.a" + exit -1 +fi if [ -z "$(echo $CC | grep "gcc")" ]; then echo "no gcc detected, early exit success" @@ -8,7 +16,7 @@ fi # output version bash printinfo.sh -bash build.sh " $1" " $2" " $3 " "$4 -fprofile-arcs -ftest-coverage " "$5 -lgcov" +bash build.sh " $1" " $2" " $3 COVERAGE=1" "$4 -fprofile-arcs -ftest-coverage " "$5 -lgcov" if [ -a testok.txt ] && [ -f testok.txt ]; then echo else @@ -20,7 +28,12 @@ fi ./sizes ./constants -cpp-coveralls -e 'demos/' -e 'testprof/' -e 'notes/' -e 'src/headers/' +# if this was executed as './coverage.sh ...' create coverage locally +if [[ "${0%% *}" == "./${0##*/}" ]]; then + make lcov-single +else + cpp-coveralls -e 'demos/' -e 'testprof/' -e 'notes/' -e 'src/headers/' +fi exit 0 diff --git a/makefile b/makefile index f603b81fc..4652277e1 100644 --- a/makefile +++ b/makefile @@ -231,14 +231,14 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) + ${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) .PHONY: test test: library testprof/$(LIBTEST) $(TESTS) ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) + ${silent} $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TEST) # build the demos from a template define DEMO_template @@ -246,12 +246,16 @@ $(1): demos/$(1).o library ifneq ($V,1) @echo " * $${CC} $$@" endif - $${silent} $$(CC) $$< $$(LIBNAME) $$(EXTRALIBS) -o $(1) + $${silent} $$(CC) $$< $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) all_test: test tv_gen $(DEMOS) +ifeq ($(COVERAGE),1) +all_test: LIB_PRE = -Wl,--whole-archive +all_test: LIB_POST = -Wl,--no-whole-archive +endif #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct @@ -300,9 +304,11 @@ lcov: lcov-single: | cleancov-clean lcov-single-create lcov -#cmake the code coverage of the library +#make the code coverage of the library coverage: CFLAGS += -fprofile-arcs -ftest-coverage coverage: EXTRALIBS += -lgcov +coverage: LIB_PRE = -Wl,--whole-archive +coverage: LIB_POST = -Wl,--no-whole-archive coverage: test ./test From 6ad52252688bb34f90b5e79da4830a927e87b81f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 7 Jul 2016 15:03:33 +0200 Subject: [PATCH 0403/1192] removing forgotten debug comment --- src/pk/dsa/dsa_make_key.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 44ad2071c..0cca7a8b6 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -130,7 +130,6 @@ int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_siz /* p */ if ((err = mp_read_unsigned_bin(seedinc, sbuf, seedbytes)) != CRYPT_OK) { goto cleanup; } - /* printf("seed="); mp_fwrite(seedinc, 16, stdout); printf("\n"); //XXX-DEBUG */ if ((err = mp_add(q, q, t2q)) != CRYPT_OK) { goto cleanup; } for(counter=0; counter < 4*L && !found_p; counter++) { for(j=0; j<=n; j++) { From 7d418b34b3fe6d49354d5a9ef5a442c387a1bd06 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Sep 2016 20:17:53 +0200 Subject: [PATCH 0404/1192] Fix GCM counter reuse GCM should error out after processing (2^32)-1 blocks / (2^39)-256 bits --- src/encauth/gcm/gcm_process.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/encauth/gcm/gcm_process.c b/src/encauth/gcm/gcm_process.c index 08921dbce..d1f3fd1af 100644 --- a/src/encauth/gcm/gcm_process.c +++ b/src/encauth/gcm/gcm_process.c @@ -49,6 +49,11 @@ int gcm_process(gcm_state *gcm, return err; } + /* 0xFFFFFFFE0 = ((2^39)-256)/8 */ + if (gcm->pttotlen / 8 + (ulong64)gcm->buflen + (ulong64)ptlen >= CONST64(0xFFFFFFFE0)) { + return CRYPT_INVALID_ARG; + } + /* in AAD mode? */ if (gcm->mode == LTC_GCM_MODE_AAD) { /* let's process the AAD */ From 8fc1af1b7eea89e942c4af4ebcc7b8d8abfc8eff Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 15 Feb 2017 23:15:43 +0100 Subject: [PATCH 0405/1192] make implementation easier to read damn you negated logic... --- src/pk/rsa/rsa_exptmod.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 78858fee9..714bc52bb 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -38,7 +38,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, void *rnd, *rndi /* inverse of rnd */; #endif unsigned long x; - int err, no_crt; + int err, has_crt_parameters; LTC_ARGCHK(in != NULL); LTC_ARGCHK(out != NULL); @@ -100,9 +100,11 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, } #endif /* LTC_RSA_BLINDING */ - no_crt = (key->dP == NULL) || (mp_get_digit_count(key->dP) == 0); + has_crt_parameters = (key->dP != NULL) && (mp_get_digit_count(key->dP) != 0) && + (key->dQ != NULL) && (mp_get_digit_count(key->dQ) != 0) && + (key->qP != NULL) && (mp_get_digit_count(key->qP) != 0); - if (no_crt) { + if (!has_crt_parameters) { /* * In case CRT optimization parameters are not provided, * the private key is directly used to exptmod it @@ -133,7 +135,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, #endif #ifdef LTC_RSA_CRT_HARDENING - if (!no_crt) { + if (has_crt_parameters) { if ((err = mp_exptmod(tmp, key->e, key->N, tmpa)) != CRYPT_OK) { goto error; } if ((err = mp_read_unsigned_bin(tmpb, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto error; } if (mp_cmp(tmpa, tmpb) != LTC_MP_EQ) { err = CRYPT_ERROR; goto error; } From 08aabc7f8ca560b64f74b5652ee9bab02b586b60 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 3 Apr 2016 02:39:25 +0200 Subject: [PATCH 0406/1192] improve print_hex() prototype --- src/headers/tomcrypt_misc.h | 2 +- testprof/tomcrypt_test.h | 2 +- testprof/x86_prof.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index d53807719..2f670cc50 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -95,7 +95,7 @@ int crc32_test(void); /* yeah it's not exactly in misc in the library, but in testprof/x86_prof.c */ #if defined(LTC_TEST) && defined(LTC_TEST_DBG) -void print_hex(const char* what, const unsigned char* p, const unsigned long l); +void print_hex(const char* what, const void* p, const unsigned long l); #endif /* $Source$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index f6951fc1f..abb5fc82f 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -80,7 +80,7 @@ extern int no_results; extern const struct ltc_prng_descriptor no_prng_desc; #endif -void print_hex(const char* what, const unsigned char* p, const unsigned long l); +void print_hex(const char* what, const void* v, const unsigned long l); int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index ba12db2dc..baf03d26a 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -2,8 +2,9 @@ prng_state yarrow_prng; -void print_hex(const char* what, const unsigned char* p, const unsigned long l) +void print_hex(const char* what, const void* v, const unsigned long l) { + const unsigned char* p = v; unsigned long x; fprintf(stderr, "%s contents: \n", what); for (x = 0; x < l; ) { From fd99c3e3c05fc632893abdd5f481039fead8d3cd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 20 Feb 2017 18:58:20 +0100 Subject: [PATCH 0407/1192] remove duplicate define --- src/misc/hkdf/hkdf.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index 3682bf884..c4d69d1dd 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -6,10 +6,6 @@ #ifdef LTC_HKDF -#ifndef MIN -#define MIN(a,b) ((a)<(b))?(a):(b) -#endif - /* This is mostly just a wrapper around hmac_memory */ int hkdf_extract(int hash_idx, const unsigned char *salt, unsigned long saltlen, const unsigned char *in, unsigned long inlen, From 383f200cb60ef835aac37a640040e91f98e2af98 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 20 Feb 2017 19:19:44 +0100 Subject: [PATCH 0408/1192] fix LTC_MINIMAL --- src/headers/tomcrypt_custom.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 3ed979b28..99d8e0477 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -127,11 +127,13 @@ /* The minimal set of functionality to run the tests */ #ifdef LTC_MINIMAL + #define LTC_RIJNDAEL #define LTC_SHA256 + #define LTC_YARROW #define LTC_CTR_MODE + #define LTC_RNG_MAKE_PRNG #define LTC_RNG_GET_BYTES - #define LTC_YARROW #define LTC_DEVRANDOM #define LTC_TRY_URANDOM_FIRST @@ -172,11 +174,11 @@ /* TomsFastMath */ /* #define TFM_DESC */ -#endif /* LTC_NO_MATH */ - /* GNU Multiple Precision Arithmetic Library */ /* #define GMP_DESC */ +#endif /* LTC_NO_MATH */ + /* ---> Symmetric Block Ciphers <--- */ #ifndef LTC_NO_CIPHERS @@ -303,13 +305,6 @@ /* Yarrow */ #define LTC_YARROW -/* which descriptor of AES to use? */ -/* 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] */ -#ifdef ENCRYPT_ONLY - #define LTC_YARROW_AES 0 -#else - #define LTC_YARROW_AES 2 -#endif /* a PRNG that simply reads from an available system source */ #define LTC_SPRNG @@ -335,6 +330,18 @@ #endif /* LTC_NO_PRNGS */ +#ifdef LTC_YARROW + +/* which descriptor of AES to use? */ +/* 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] */ +#ifdef ENCRYPT_ONLY + #define LTC_YARROW_AES 0 +#else + #define LTC_YARROW_AES 2 +#endif + +#endif + #ifdef LTC_FORTUNA #ifndef LTC_FORTUNA_WD From 60bb5440fb9b666ed6723e998b0be3507ef0eca0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 18 Feb 2017 14:42:16 +0100 Subject: [PATCH 0409/1192] add compare_testvector() --- testprof/tomcrypt_test.h | 1 + testprof/x86_prof.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index abb5fc82f..776580ef6 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -81,6 +81,7 @@ extern const struct ltc_prng_descriptor no_prng_desc; #endif void print_hex(const char* what, const void* v, const unsigned long l); +int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index baf03d26a..451a58cf0 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -16,6 +16,23 @@ void print_hex(const char* what, const void* v, const unsigned long l) fprintf(stderr, "\n"); } +int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) +{ + int res = 0; + if(is_len != should_len) + res = is_len > should_len ? -1 : 1; + else + res = XMEMCMP(is, should, MAX(is_len, should_len)); + + if (res != 0) { + fprintf(stderr, "Testvector #%i of %s failed:\n", which, what); + print_hex("SHOULD", should, should_len); + print_hex("IS ", is, is_len); + } + + return res; +} + struct list results[100]; int no_results; int sorter(const void *a, const void *b) From 600004fecca1475a094d392286435056a67cdc58 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 21 Feb 2017 11:37:35 +0100 Subject: [PATCH 0410/1192] print ascii in print_hex() --- testprof/x86_prof.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 451a58cf0..f2bb9143e 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -5,15 +5,34 @@ prng_state yarrow_prng; void print_hex(const char* what, const void* v, const unsigned long l) { const unsigned char* p = v; - unsigned long x; + unsigned long x, y = 0, z; fprintf(stderr, "%s contents: \n", what); for (x = 0; x < l; ) { - fprintf(stderr, "%02x ", p[x]); - if (!(++x % 16)) { + fprintf(stderr, "%02X ", p[x]); + if (!(++x % 16) || x == l) { + if((x % 16) != 0) { + z = 16 - (x % 16); + if(z >= 8) + fprintf(stderr, " "); + for (; z != 0; --z) { + fprintf(stderr, " "); + } + } + fprintf(stderr, " | "); + for(; y < x; y++) { + if((y % 8) == 0) + fprintf(stderr, " "); + if(isgraph(p[y])) + fprintf(stderr, "%c", p[y]); + else + fprintf(stderr, "."); + } fprintf(stderr, "\n"); } + else if((x % 8) == 0) { + fprintf(stderr, " "); + } } - fprintf(stderr, "\n"); } int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) From c83763bd46103b4f131017b9b498950dce307a09 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 9 Jul 2016 19:20:33 -0500 Subject: [PATCH 0411/1192] fix tiny compile error in tomcrypt_pk.h macro An ARM compiler gives me this: libtomcrypt\pk\asn1\der\sequence\der_decode_subject_public_key_info.c(65,4): error #188-D: enumerated type mixed with another type Since der_decode_subject_public_key_info's parameters_type is of type 'unsigned long', an attempt to assign it to ltc_asn1_list's member 'ltc_asn1_type type' fails. My fix solves this in a simple way by casting it at the point of assignment. But while studying this I noticed there's no use of enum in the codebase other than a few PK-related things. Perhaps a more appropriate solution would be to remove these enums. I mean, enums seem like an OK enough idea, but I don't know anything about the practicality of using enums in archaic C dialects like libtomcrypt conforms (thankfully!) to... --- src/headers/tomcrypt_pk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 5b3525ee7..95e308053 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -487,7 +487,7 @@ typedef struct ltc_asn1_list_ { do { \ int LTC_MACRO_temp = (index); \ ltc_asn1_list *LTC_MACRO_list = (list); \ - LTC_MACRO_list[LTC_MACRO_temp].type = (Type); \ + LTC_MACRO_list[LTC_MACRO_temp].type = (ltc_asn1_type)(Type); \ LTC_MACRO_list[LTC_MACRO_temp].data = (void*)(Data); \ LTC_MACRO_list[LTC_MACRO_temp].size = (Size); \ LTC_MACRO_list[LTC_MACRO_temp].used = 0; \ From 793ff08986cff17b93d5ffc820cdbc18118e7f4e Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 30 Jul 2016 23:46:20 -0500 Subject: [PATCH 0412/1192] do it differently --- src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 6731c66c5..fc65e9565 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -62,7 +62,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in /* this includes the internal hash ID and optional params (NULL in this case) */ LTC_SET_ASN1(alg_id, 0, LTC_ASN1_OBJECT_IDENTIFIER, tmpoid, sizeof(tmpoid)/sizeof(tmpoid[0])); - LTC_SET_ASN1(alg_id, 1, parameters_type, parameters, parameters_len); + LTC_SET_ASN1(alg_id, 1, (ltc_asn1_type)parameters_type, parameters, parameters_len); /* the actual format of the SSL DER key is odd, it stores a RSAPublicKey * in a **BIT** string ... so we have to extract it then proceed to convert bit to octet From 32f19995f8c3beb1f115559c8850f58416b37026 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 30 Jul 2016 23:48:37 -0500 Subject: [PATCH 0413/1192] do it differently --- src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c index 681a53fb3..2a738644e 100644 --- a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c @@ -50,7 +50,7 @@ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen } LTC_SET_ASN1(alg_id, 0, LTC_ASN1_OBJECT_IDENTIFIER, oid.OID, oid.OIDlen); - LTC_SET_ASN1(alg_id, 1, parameters_type, parameters, parameters_len); + LTC_SET_ASN1(alg_id, 1, (ltc_asn1_type)parameters_type, parameters, parameters_len); return der_encode_sequence_multi(out, outlen, LTC_ASN1_SEQUENCE, (unsigned long)sizeof(alg_id)/sizeof(alg_id[0]), alg_id, From c341d36c6a5fe6fa5d38a31e1ed4aef5889a10bd Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 30 Jul 2016 23:49:48 -0500 Subject: [PATCH 0414/1192] do it differently --- src/headers/tomcrypt_pk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 95e308053..5b3525ee7 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -487,7 +487,7 @@ typedef struct ltc_asn1_list_ { do { \ int LTC_MACRO_temp = (index); \ ltc_asn1_list *LTC_MACRO_list = (list); \ - LTC_MACRO_list[LTC_MACRO_temp].type = (ltc_asn1_type)(Type); \ + LTC_MACRO_list[LTC_MACRO_temp].type = (Type); \ LTC_MACRO_list[LTC_MACRO_temp].data = (void*)(Data); \ LTC_MACRO_list[LTC_MACRO_temp].size = (Size); \ LTC_MACRO_list[LTC_MACRO_temp].used = 0; \ From d727b16898a932b11a152cf98e3e43dbb38b50f5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 26 Sep 2016 01:27:07 +0200 Subject: [PATCH 0415/1192] use proper defines as of [1] [1] http://predef.sourceforge.net --- src/prngs/rng_get_bytes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 457c26fb4..b1236c452 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -55,7 +55,7 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len, #endif /* LTC_DEVRANDOM */ /* on ANSI C platforms with 100 < CLOCKS_PER_SEC < 10000 */ -#if defined(CLOCKS_PER_SEC) && !defined(WINCE) +#if defined(CLOCKS_PER_SEC) && !defined(_WIN32_WCE) #define ANSI_RNG @@ -92,11 +92,11 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, #endif /* Try the Microsoft CSP */ -#if defined(WIN32) || defined(_WIN32) || defined(WINCE) +#if defined(_WIN32) || defined(_WIN32_WCE) #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif -#ifdef WINCE +#ifdef _WIN32_WCE #define UNDER_CE #define ARM #endif @@ -144,7 +144,7 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, #if defined(LTC_DEVRANDOM) x = rng_nix(out, outlen, callback); if (x != 0) { return x; } #endif -#if defined(WIN32) || defined(_WIN32) || defined(WINCE) +#if defined(_WIN32) || defined(_WIN32_WCE) x = rng_win32(out, outlen, callback); if (x != 0) { return x; } #endif #ifdef ANSI_RNG From b36e75b7f12c75bd852b8bcee36ea6bd9727d5c0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 26 Sep 2016 01:30:49 +0200 Subject: [PATCH 0416/1192] don't read from c:\dev\random on windows --- src/prngs/rng_get_bytes.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index b1236c452..2a66367e2 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -141,11 +141,10 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, LTC_ARGCHK(out != NULL); -#if defined(LTC_DEVRANDOM) - x = rng_nix(out, outlen, callback); if (x != 0) { return x; } -#endif #if defined(_WIN32) || defined(_WIN32_WCE) x = rng_win32(out, outlen, callback); if (x != 0) { return x; } +#elif defined(LTC_DEVRANDOM) + x = rng_nix(out, outlen, callback); if (x != 0) { return x; } #endif #ifdef ANSI_RNG x = rng_ansic(out, outlen, callback); if (x != 0) { return x; } From ecbac7324ea08e1712f63bb3d2133b92715f3f1e Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 10 Oct 2016 21:51:22 +0200 Subject: [PATCH 0417/1192] DSA: properly handle FIPS 186-4 (4.6 + 4.7) --- src/pk/dsa/dsa_sign_hash.c | 3 +++ src/pk/dsa/dsa_verify_hash.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/pk/dsa/dsa_sign_hash.c b/src/pk/dsa/dsa_sign_hash.c index 3ccfcf575..7ac3f54de 100644 --- a/src/pk/dsa/dsa_sign_hash.c +++ b/src/pk/dsa/dsa_sign_hash.c @@ -84,6 +84,9 @@ int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, if (mp_iszero(r) == LTC_MP_YES) { goto retry; } + /* FIPS 186-4 4.6: use leftmost min(bitlen(q), bitlen(hash)) */ + if (inlen > (unsigned long)(key->qord)) inlen = (unsigned long)(key->qord); + /* now find s = (in + xr)/k mod q */ if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, inlen)) != CRYPT_OK) { goto error; } if ((err = mp_mul(key->x, r, s)) != CRYPT_OK) { goto error; } diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index 59beec24e..55bb45429 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -54,6 +54,9 @@ int dsa_verify_hash_raw( void *r, void *s, goto error; } + /* FIPS 186-4 4.7: use leftmost min(bitlen(q), bitlen(hash)) bits of 'hash' */ + if (hashlen > (unsigned long)(key->qord)) hashlen = (unsigned long)(key->qord); + /* w = 1/s mod q */ if ((err = mp_invmod(s, key->q, w)) != CRYPT_OK) { goto error; } From bcf7753a26c10c28a21ea5c49db19b82e7fcda02 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 02:03:39 +0100 Subject: [PATCH 0418/1192] use MIN macro --- src/pk/dsa/dsa_sign_hash.c | 4 ++-- src/pk/dsa/dsa_verify_hash.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pk/dsa/dsa_sign_hash.c b/src/pk/dsa/dsa_sign_hash.c index 7ac3f54de..4d131b433 100644 --- a/src/pk/dsa/dsa_sign_hash.c +++ b/src/pk/dsa/dsa_sign_hash.c @@ -84,8 +84,8 @@ int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, if (mp_iszero(r) == LTC_MP_YES) { goto retry; } - /* FIPS 186-4 4.6: use leftmost min(bitlen(q), bitlen(hash)) */ - if (inlen > (unsigned long)(key->qord)) inlen = (unsigned long)(key->qord); + /* FIPS 186-4 4.6: use leftmost min(bitlen(q), bitlen(hash)) bits of 'hash'*/ + inlen = MIN(inlen, (unsigned long)(key->qord)); /* now find s = (in + xr)/k mod q */ if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, inlen)) != CRYPT_OK) { goto error; } diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index 55bb45429..6188164d0 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -55,7 +55,7 @@ int dsa_verify_hash_raw( void *r, void *s, } /* FIPS 186-4 4.7: use leftmost min(bitlen(q), bitlen(hash)) bits of 'hash' */ - if (hashlen > (unsigned long)(key->qord)) hashlen = (unsigned long)(key->qord); + hashlen = MIN(hashlen, (unsigned long)(key->qord)); /* w = 1/s mod q */ if ((err = mp_invmod(s, key->q, w)) != CRYPT_OK) { goto error; } From 10545366d2df9d8adadb77a49028745fd9c5a96c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 12:49:20 +0100 Subject: [PATCH 0419/1192] adding dsa_import_radix --- src/headers/tomcrypt_pk.h | 1 + src/pk/dsa/dsa_import_radix.c | 67 +++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100755 src/pk/dsa/dsa_import_radix.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 5b3525ee7..38e59b034 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -430,6 +430,7 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, dsa_key *key); +int dsa_import_radix(int radix, char *p, char *q, char *g, char *x, char *y, dsa_key *key); int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_verify_key(dsa_key *key, int *stat); diff --git a/src/pk/dsa/dsa_import_radix.c b/src/pk/dsa/dsa_import_radix.c new file mode 100755 index 000000000..ba9408d24 --- /dev/null +++ b/src/pk/dsa/dsa_import_radix.c @@ -0,0 +1,67 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + Import DSA public or private key from raw numbers + @param radix the radix the numbers are represented in (2-64, 16 = hexadecimal) + @param p DSA's p in radix representation + @param q DSA's q in radix representation + @param g DSA's g in radix representation + @param x DSA's x in radix representation (only private key, NULL for public key) + @param y DSA's y in radix representation + @param key [out] the destination for the imported key + @return CRYPT_OK if successful, upon error allocated memory is freed +*/ + +#ifdef LTC_MDSA + +int dsa_import_radix(int radix, char *p, char *q, char *g, char *x, char *y, dsa_key *key) +{ + int err; + + LTC_ARGCHK(p != NULL); + LTC_ARGCHK(q != NULL); + LTC_ARGCHK(g != NULL); + LTC_ARGCHK(y != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* init key */ + err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL); + if (err != CRYPT_OK) return err; + + if ((err = mp_read_radix(key->p , p , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->q , q , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->g , g , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->y , y , radix)) != CRYPT_OK) { goto LBL_ERR; } + if (x && strlen(x) > 0) { + key->type = PK_PRIVATE; + if ((err = mp_read_radix(key->x , x , radix)) != CRYPT_OK) { goto LBL_ERR; } + } + else { + key->type = PK_PUBLIC; + } + + key->qord = mp_unsigned_bin_size(key->q); + + if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || + (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + return CRYPT_OK; + +LBL_ERR: + mp_clear_multi(key->p, key->g, key->q, key->x, key->y, NULL); + return err; +} + +#endif From 43517bca8318408e8fd8a548b8d6ff328037eeee Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 21 Feb 2017 13:19:48 +0100 Subject: [PATCH 0420/1192] update makefiles --- makefile | 40 ++++++++++++++++++++-------------------- makefile.icc | 40 ++++++++++++++++++++-------------------- makefile.mingw | 40 ++++++++++++++++++++-------------------- makefile.msvc | 40 ++++++++++++++++++++-------------------- makefile.shared | 40 ++++++++++++++++++++-------------------- makefile.unix | 40 ++++++++++++++++++++-------------------- 6 files changed, 120 insertions(+), 120 deletions(-) diff --git a/makefile b/makefile index 4652277e1..28399adc2 100644 --- a/makefile +++ b/makefile @@ -152,26 +152,26 @@ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ -src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ -src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ -src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ -src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ -src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ -src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ -src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ -src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ +src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ +src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ +src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ +src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ +src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ +src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ +src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ +src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ +src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ +src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ +src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ +src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ +src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.icc b/makefile.icc index 9cec4ef76..a295978f9 100644 --- a/makefile.icc +++ b/makefile.icc @@ -209,26 +209,26 @@ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ -src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ -src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ -src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ -src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ -src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ -src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ -src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ -src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ +src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ +src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ +src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ +src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ +src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ +src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ +src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ +src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ +src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ +src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ +src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ +src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ +src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.mingw b/makefile.mingw index 4205b2960..1729c0437 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -156,26 +156,26 @@ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ -src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ -src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ -src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ -src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ -src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ -src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ -src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ -src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ +src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ +src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ +src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ +src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ +src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ +src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ +src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ +src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ +src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ +src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ +src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ +src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ +src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.msvc b/makefile.msvc index 5d97aec2a..b9e9387cf 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -114,26 +114,26 @@ src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_u src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \ src/pk/dh/dh.obj src/pk/dh/dh_static.obj src/pk/dh/dh_sys.obj src/pk/dsa/dsa_decrypt_key.obj \ src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \ -src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \ -src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc_ansi_x963_export.obj \ -src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc.obj src/pk/ecc/ecc_decrypt_key.obj \ -src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ -src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ -src/pk/ecc/ecc_sign_hash.obj src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \ -src/pk/ecc/ltc_ecc_is_valid_idx.obj src/pk/ecc/ltc_ecc_map.obj src/pk/ecc/ltc_ecc_mul2add.obj \ -src/pk/ecc/ltc_ecc_mulmod.obj src/pk/ecc/ltc_ecc_mulmod_timing.obj src/pk/ecc/ltc_ecc_points.obj \ -src/pk/ecc/ltc_ecc_projective_add_point.obj src/pk/ecc/ltc_ecc_projective_dbl_point.obj \ -src/pk/katja/katja_decrypt_key.obj src/pk/katja/katja_encrypt_key.obj src/pk/katja/katja_export.obj \ -src/pk/katja/katja_exptmod.obj src/pk/katja/katja_free.obj src/pk/katja/katja_import.obj \ -src/pk/katja/katja_make_key.obj src/pk/pkcs1/pkcs_1_i2osp.obj src/pk/pkcs1/pkcs_1_mgf1.obj \ -src/pk/pkcs1/pkcs_1_oaep_decode.obj src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/pkcs1/pkcs_1_os2ip.obj \ -src/pk/pkcs1/pkcs_1_pss_decode.obj src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj \ -src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj \ -src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj \ -src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj \ -src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj src/prngs/rc4.obj \ -src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ -src/prngs/yarrow.obj +src/pk/dsa/dsa_import_radix.obj src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj \ +src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj \ +src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc.obj \ +src/pk/ecc/ecc_decrypt_key.obj src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj \ +src/pk/ecc/ecc_get_size.obj src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj \ +src/pk/ecc/ecc_shared_secret.obj src/pk/ecc/ecc_sign_hash.obj src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj \ +src/pk/ecc/ecc_verify_hash.obj src/pk/ecc/ltc_ecc_is_valid_idx.obj src/pk/ecc/ltc_ecc_map.obj \ +src/pk/ecc/ltc_ecc_mul2add.obj src/pk/ecc/ltc_ecc_mulmod.obj src/pk/ecc/ltc_ecc_mulmod_timing.obj \ +src/pk/ecc/ltc_ecc_points.obj src/pk/ecc/ltc_ecc_projective_add_point.obj \ +src/pk/ecc/ltc_ecc_projective_dbl_point.obj src/pk/katja/katja_decrypt_key.obj \ +src/pk/katja/katja_encrypt_key.obj src/pk/katja/katja_export.obj src/pk/katja/katja_exptmod.obj \ +src/pk/katja/katja_free.obj src/pk/katja/katja_import.obj src/pk/katja/katja_make_key.obj \ +src/pk/pkcs1/pkcs_1_i2osp.obj src/pk/pkcs1/pkcs_1_mgf1.obj src/pk/pkcs1/pkcs_1_oaep_decode.obj \ +src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/pkcs1/pkcs_1_os2ip.obj src/pk/pkcs1/pkcs_1_pss_decode.obj \ +src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj src/pk/pkcs1/pkcs_1_v1_5_encode.obj \ +src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj src/pk/rsa/rsa_export.obj \ +src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj src/pk/rsa/rsa_import.obj \ +src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_sign_saltlen_get.obj \ +src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj src/prngs/rc4.obj src/prngs/rng_get_bytes.obj \ +src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj src/prngs/yarrow.obj HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.shared b/makefile.shared index 2f60df8ab..cf237003b 100644 --- a/makefile.shared +++ b/makefile.shared @@ -144,26 +144,26 @@ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ -src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ -src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ -src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ -src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ -src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ -src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ -src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ -src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ +src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ +src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ +src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ +src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ +src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ +src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ +src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ +src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ +src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ +src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ +src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ +src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ +src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.unix b/makefile.unix index 87ad82281..fd78ff691 100644 --- a/makefile.unix +++ b/makefile.unix @@ -150,26 +150,26 @@ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc_ansi_x963_export.o \ -src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ -src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ -src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ -src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ -src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ -src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ -src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ -src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ -src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ +src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ +src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ +src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ +src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ +src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ +src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ +src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ +src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ +src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ +src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ +src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ +src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ +src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ From ac6f69e8fe33e604dc3709b11498801f15ac23f9 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 16:06:53 +0100 Subject: [PATCH 0421/1192] adding dsa_import_radix tests --- testprof/dsa_test.c | 58 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/testprof/dsa_test.c b/testprof/dsa_test.c index feb156257..357dd027f 100644 --- a/testprof/dsa_test.c +++ b/testprof/dsa_test.c @@ -44,6 +44,20 @@ static const unsigned char openssl_priv_dsa[] = { 0xd8, 0x1f, 0xc5 }; +/* private key - raw hexadecimal numbers */ +char *hex_g = "3B92E4FF5929150B08995A7BF2AD1440556FA047FF9099B344B3D4FC451505AE6722439CBA3710A5894737ECCCF5AEADA8B47A35CB9D935CEDE6B07E9694C4A60C7DD6708A094F814A0EC213FBEB16BFEAA4F456FF723005DE8A443FBEC6852655D62D1D1EDB15DAA445833C1797980B8D87F3490D90BDA9AB676E87687223DC"; +char *hex_p = "C50A37515CABD618D5A270BD4A6F6B4AF9E139950F2B99387D9A64D64CB5967ADCEDACA8ACC61B655ADEDB0061251A182CEEA10790625E4D123190C70321FA09E7B173D78EAFDBFDBFB3EFADD1A12A036DE706924A852AFF7A0166531FEAC66741845AC06CED62F9C2626205A4FA48A066EC35C9A811FEB981ABEEBE31B6BFCF"; +char *hex_q = "AA5BD7F4E5062413E58835CA00C7A635716194C5"; +char *hex_x = "9936E5E4E9FB28BE91F5065FE8C935B3F5D81FC5"; +char *hex_y = "5316B0FBBF598A5E5595C14FAC43B80853E6CF0D9223FAB184595239BFCBF22D383ADD935205497E2B12C46173E36F54BD96E5A7AAA95A58A4B767D2C0BDC81EB13A124F98C005EF395D6ABAB70B3BD8B795DD796EA2D28473470388B464D9B9B84FF1C934BBF97366F57C2E11FEC331E60838596781EB6D4127D70D74AFA035"; + +/* private key - raw decimal numbers */ +char *dec_g = "41834149751984197912953436480983170533071735026506895442815002322147255782590882063707309354781506433716654796985480894012184326029507913813728323760888731712844346877576824916725534905000120412305763983626878322597033839508975868744887842375259196379140567488975525420966465471602331600963525846901216912348"; +char *dec_p = "138366127874251453574215823372867983172559870428080754538874699342292548213873551009389476481395012375639515165022292709776266658812209612126692196557051247870332681145778007636026326219557730049370214260237710845864302921876857532769906463917243319959886290876544710558897185626634470575981605420411381006287"; +char *dec_q = "972576611327916959546542817054443329226761409733"; +char *dec_x = "874699854785640347852049895863914110365034094533"; +char *dec_y = "58346825863862115220306694056113472976936045407556113559931032566376300411053620606958863235131122432665794570437845128216268156672161823000705623178942581094085367656740608001229642983928728905397237964247962716781137229394844332774819193277135681825866994604976120931444766148118918668354923664000689348661"; + /* The public part of test_dsa.key in SubjectPublicKeyInfo format */ static const unsigned char openssl_pub_dsa[] = { 0x30, 0x82, 0x01, 0xb6, 0x30, 0x82, 0x01, 0x2b, 0x06, 0x07, 0x2a, 0x86, @@ -88,8 +102,8 @@ static const unsigned char openssl_pub_dsa[] = { static int dsa_compat_test(void) { dsa_key key; - unsigned char tmp[1024]; - unsigned long x; + unsigned char tmp[1024], buf[1024]; + unsigned long x, len; DO(dsa_import(openssl_priv_dsa, sizeof(openssl_priv_dsa), &key)); @@ -112,6 +126,46 @@ static int dsa_compat_test(void) DO((memcmp(tmp, openssl_pub_dsa, sizeof(openssl_pub_dsa)) == 0)?CRYPT_OK:CRYPT_ERROR); dsa_free(&key); + /* try import private key from raw hexadecimal numbers */ + DO(dsa_import_radix(16, hex_p, hex_q, hex_g, hex_x, hex_y, &key)); + len = sizeof(buf); + DO(dsa_export(buf, &len, PK_PRIVATE | PK_STD, &key)); + if (len != sizeof(openssl_priv_dsa) || memcmp(buf, openssl_priv_dsa, len)) { + fprintf(stderr, "DSA private export failed to match dsa_import_radix(16, ..)\n"); + return 1; + } + dsa_free(&key); + + /* try import private key from raw decimal numbers */ + DO(dsa_import_radix(10, dec_p, dec_q, dec_g, dec_x, dec_y, &key)); + len = sizeof(buf); + DO(dsa_export(buf, &len, PK_PRIVATE | PK_STD, &key)); + if (len != sizeof(openssl_priv_dsa) || memcmp(buf, openssl_priv_dsa, len)) { + fprintf(stderr, "DSA private export failed to match dsa_import_radix(10, ..)\n"); + return 1; + } + dsa_free(&key); + + /* try import public key from raw hexadecimal numbers */ + DO(dsa_import_radix(16, hex_p, hex_q, hex_g, NULL, hex_y, &key)); + len = sizeof(buf); + DO(dsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); + if (len != sizeof(openssl_pub_dsa) || memcmp(buf, openssl_pub_dsa, len)) { + fprintf(stderr, "DSA public export failed to match dsa_import_radix(16, ..)\n"); + return 1; + } + dsa_free(&key); + + /* try import public key from raw decimal numbers */ + DO(dsa_import_radix(10, dec_p, dec_q, dec_g, NULL, dec_y, &key)); + len = sizeof(buf); + DO(dsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); + if (len != sizeof(openssl_pub_dsa) || memcmp(buf, openssl_pub_dsa, len)) { + fprintf(stderr, "DSA public export failed to match dsa_import_radix(10, ..)\n"); + return 1; + } + dsa_free(&key); + return 0; } From a2c87f54de75abe44547de6a50156998177008c3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 12:37:14 +0100 Subject: [PATCH 0422/1192] adding rsa_import_radix --- src/headers/tomcrypt_pk.h | 1 + src/pk/rsa/rsa_import_radix.c | 64 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100755 src/pk/rsa/rsa_import_radix.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 38e59b034..1366931f3 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -107,6 +107,7 @@ int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key); int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key); int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); +int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key); #endif /* ---- Katja ---- */ diff --git a/src/pk/rsa/rsa_import_radix.c b/src/pk/rsa/rsa_import_radix.c new file mode 100755 index 000000000..d9d4ec7ae --- /dev/null +++ b/src/pk/rsa/rsa_import_radix.c @@ -0,0 +1,64 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + Import RSA public or private key from raw numbers + @param radix the radix the numbers are represented in (2-64, 16 = hexadecimal) + @param N RSA's N in radix representation + @param e RSA's e in radix representation + @param d RSA's d in radix representation (only private key, NULL for public key) + @param p RSA's p in radix representation (only private key, NULL for public key) + @param q RSA's q in radix representation (only private key, NULL for public key) + @param dP RSA's dP in radix representation (only private key, NULL for public key) + @param dQ RSA's dQ in radix representation (only private key, NULL for public key) + @param qP RSA's qP in radix representation (only private key, NULL for public key) + @param key [out] the destination for the imported key + @return CRYPT_OK if successful, upon error allocated memory is freed +*/ + +#ifdef LTC_MRSA + +int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(N != NULL); + LTC_ARGCHK(e != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL); + if (err != CRYPT_OK) return err; + + if ((err = mp_read_radix(key->N , N , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->e , e , radix)) != CRYPT_OK) { goto LBL_ERR; } + if (d && p && q && dP && dQ && qP && strlen(d)>0 && strlen(p)>0 && + strlen(q)>0 && strlen(dP)>0 && strlen(dQ)>0 && strlen(qP)>0) { + if ((err = mp_read_radix(key->d , d , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->p , p , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->q , q , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->dP, dP, radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->dQ, dQ, radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->qP, qP, radix)) != CRYPT_OK) { goto LBL_ERR; } + key->type = PK_PRIVATE; + } + else { + key->type = PK_PUBLIC; + } + return CRYPT_OK; + +LBL_ERR: + mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + return err; +} + +#endif /* LTC_MRSA */ From bbbbf5f1d5a0223aaec415e8c5ac0b0c38ac8fc0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 15:26:49 +0100 Subject: [PATCH 0423/1192] adding rsa_import_radix tests --- testprof/rsa_test.c | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 4d9e7ca92..b6e3f39fe 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -46,6 +46,25 @@ static const unsigned char openssl_private_rsa[] = { 0x78, 0x18, 0x5a, 0x79, 0x3d, 0x2e, 0x8e, 0x7e, 0x86, 0x0a, 0xe6, 0xa8, 0x33, 0xc1, 0x04, 0x17, 0x4a, 0x9f, }; +/* private keay - hexadecimal */ +char *hex_d = "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881"; +char *hex_dP = "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089"; +char *hex_dQ = "AB9088FA600829509A438BA050CCD85AFE976463717422A320025ACFEBC6169554D1CBAB8D1AC600FA08929C71D552523596714B8B920CD0E9BFAD630BA5E9B1"; +char *hex_e = "010001"; +char *hex_N = "CF9ADE648ADAC83320A9D783311954B29A85A7A1B77533B6A9AC8424B3DEDB7D852D9665E53F7295249F2868CA4FDB441C3E60128ADD26A5EBFF0B5ED48838492A6E5BBF123747BD056BBCDBF3EEE4118E41687C6113D742C880BE368FDC088B4FACA4E2760CC9636C495893EDCCAADC253B0A603F8B543AC34D31E794A444FD"; +char *hex_p = "F7BE5E23C3323FBF8B8E3AEEFCFCCBE5F7F10BBC4282AED57A3ECAF7D5693F6425A21FB77575059242EBB8F1F30A05E394D1557835A036A09B7C92846CDDDC4D"; +char *hex_q = "D6860E85420B0408842160F00E0D88FD1E3610654F1E53B40872805C3F596617E698F2E96C7A064CAC763DED8CA1CEAD1BBDB47D28BCE30E388D99D805B5A371"; +char *hex_qP = "DCCC27C8E4DC6248D59BAFF5AB60F621FD53E2B75D09C91AA104A9FC612C5D04583A5A39F14A215667FDCC20A38F78185A793D2E8E7E860AE6A833C104174A9F"; + +/* private keay - decimal */ +char *dec_d = "140715588362011445903700789698620706303856890313846506579552319155852306603445626455616876267358538338151320072087950597426668358843246116141391746806252390039505422193715556188330352166601762210959618868365359433828069868584168017348772565936127608284367789455480066115411950431014508224203325089671253575809"; +char *dec_dP = "5757027123463051531073361217943880203685183318942602176865989327630429772398553254013771630974725523559703665512845231173916766336576994271809362147385481"; +char *dec_dQ = "8985566687080619280443708121716583572314829758991088624433980393739288226842152842353421251125477168722728289150354056572727675764519591179919295246625201"; +char *dec_e = "65537"; +char *dec_N = "145785157837445763858971808379627955816432214431353481009581718367907499729204464589803079767521523397316119124291441688063985017444589154155338311524887989148444674974298105211582428885045820631376256167593861203305479546421254276833052913791538765775697977909548553897629170045372476652935456198173974086909"; +char *dec_p = "12975386429272921390465467849934248466500992474501042673679976015025637113752114471707151502138750486193421113099777767227628554763059580218432153760685133"; +char *dec_q = "11235515692122231999359687466333538198133993435121038200055897831921312127192760781281669977582095991578071163376390471936482431583372835883432943212143473"; +char *dec_qP = "11564102464723136702427739477324729528451027211272900753079601723449664482225846595388433622640284454614991112736446376964904474099700895632145077333609119"; /*** openssl public RSA key in DER format */ static const unsigned char openssl_public_rsa[] = { @@ -119,6 +138,46 @@ static int rsa_compat_test(void) } rsa_free(&key); + /* try import private key from raw hexadecimal numbers */ + DO(rsa_import_radix(16, hex_N, hex_e, hex_d, hex_p, hex_q, hex_dP, hex_dQ, hex_qP, &key)); + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PRIVATE, &key)); + if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { + fprintf(stderr, "RSA private export failed to match rsa_import_radix(16, ..)\n"); + return 1; + } + rsa_free(&key); + + /* try import private key from raw decimal numbers */ + DO(rsa_import_radix(10, dec_N, dec_e, dec_d, dec_p, dec_q, dec_dP, dec_dQ, dec_qP, &key)); + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PRIVATE, &key)); + if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { + fprintf(stderr, "RSA private export failed to match rsa_import_radix(10, ..)\n"); + return 1; + } + rsa_free(&key); + + /* try import public key from raw hexadecimal numbers */ + DO(rsa_import_radix(16, hex_N, hex_e, NULL, NULL, NULL, NULL, NULL, NULL, &key)); + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PUBLIC, &key)); + if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { + fprintf(stderr, "RSA public export failed to match rsa_import_radix(16, ..)\n"); + return 1; + } + rsa_free(&key); + + /* try import public key from raw decimal numbers */ + DO(rsa_import_radix(10, dec_N, dec_e, NULL, NULL, NULL, NULL, NULL, NULL, &key)); + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PUBLIC, &key)); + if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { + fprintf(stderr, "RSA public export failed to match rsa_import_radix(10, ..)\n"); + return 1; + } + rsa_free(&key); + /* try export in SubjectPublicKeyInfo format of the public key */ DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key)); len = sizeof(buf); From 55776b0ac989894e2b8002cd860a63072d0d99eb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 21 Feb 2017 16:57:21 +0100 Subject: [PATCH 0424/1192] update makefiles --- makefile | 7 ++++--- makefile.icc | 7 ++++--- makefile.mingw | 7 ++++--- makefile.msvc | 7 ++++--- makefile.shared | 7 ++++--- makefile.unix | 7 ++++--- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/makefile b/makefile index 28399adc2..43faceef7 100644 --- a/makefile +++ b/makefile @@ -169,9 +169,10 @@ src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_ src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.icc b/makefile.icc index a295978f9..6d6769422 100644 --- a/makefile.icc +++ b/makefile.icc @@ -226,9 +226,10 @@ src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_ src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.mingw b/makefile.mingw index 1729c0437..bf5545cd6 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -173,9 +173,10 @@ src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_ src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.msvc b/makefile.msvc index b9e9387cf..a043ede57 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -131,9 +131,10 @@ src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/pkcs1/pkcs_1_os2ip.obj src/pk/pkcs1/p src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj src/pk/pkcs1/pkcs_1_v1_5_encode.obj \ src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj src/pk/rsa/rsa_export.obj \ src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj src/pk/rsa/rsa_import.obj \ -src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_sign_saltlen_get.obj \ -src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj src/prngs/rc4.obj src/prngs/rng_get_bytes.obj \ -src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj src/prngs/yarrow.obj +src/pk/rsa/rsa_import_radix.obj src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj \ +src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj src/prngs/rc4.obj \ +src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ +src/prngs/yarrow.obj HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.shared b/makefile.shared index cf237003b..bcc692b4e 100644 --- a/makefile.shared +++ b/makefile.shared @@ -161,9 +161,10 @@ src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_ src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.unix b/makefile.unix index fd78ff691..7eec9cd89 100644 --- a/makefile.unix +++ b/makefile.unix @@ -167,9 +167,10 @@ src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_ src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ From ef023f3329c44ec8afca29b9a56bae684daa88d9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 21 Feb 2017 17:32:30 +0100 Subject: [PATCH 0425/1192] fix rsa/dsa test duplicate symbols --- testprof/dsa_test.c | 20 ++++++++++---------- testprof/rsa_test.c | 32 ++++++++++++++++---------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/testprof/dsa_test.c b/testprof/dsa_test.c index 357dd027f..93b5b310a 100644 --- a/testprof/dsa_test.c +++ b/testprof/dsa_test.c @@ -45,18 +45,18 @@ static const unsigned char openssl_priv_dsa[] = { }; /* private key - raw hexadecimal numbers */ -char *hex_g = "3B92E4FF5929150B08995A7BF2AD1440556FA047FF9099B344B3D4FC451505AE6722439CBA3710A5894737ECCCF5AEADA8B47A35CB9D935CEDE6B07E9694C4A60C7DD6708A094F814A0EC213FBEB16BFEAA4F456FF723005DE8A443FBEC6852655D62D1D1EDB15DAA445833C1797980B8D87F3490D90BDA9AB676E87687223DC"; -char *hex_p = "C50A37515CABD618D5A270BD4A6F6B4AF9E139950F2B99387D9A64D64CB5967ADCEDACA8ACC61B655ADEDB0061251A182CEEA10790625E4D123190C70321FA09E7B173D78EAFDBFDBFB3EFADD1A12A036DE706924A852AFF7A0166531FEAC66741845AC06CED62F9C2626205A4FA48A066EC35C9A811FEB981ABEEBE31B6BFCF"; -char *hex_q = "AA5BD7F4E5062413E58835CA00C7A635716194C5"; -char *hex_x = "9936E5E4E9FB28BE91F5065FE8C935B3F5D81FC5"; -char *hex_y = "5316B0FBBF598A5E5595C14FAC43B80853E6CF0D9223FAB184595239BFCBF22D383ADD935205497E2B12C46173E36F54BD96E5A7AAA95A58A4B767D2C0BDC81EB13A124F98C005EF395D6ABAB70B3BD8B795DD796EA2D28473470388B464D9B9B84FF1C934BBF97366F57C2E11FEC331E60838596781EB6D4127D70D74AFA035"; +static char *hex_g = "3B92E4FF5929150B08995A7BF2AD1440556FA047FF9099B344B3D4FC451505AE6722439CBA3710A5894737ECCCF5AEADA8B47A35CB9D935CEDE6B07E9694C4A60C7DD6708A094F814A0EC213FBEB16BFEAA4F456FF723005DE8A443FBEC6852655D62D1D1EDB15DAA445833C1797980B8D87F3490D90BDA9AB676E87687223DC"; +static char *hex_p = "C50A37515CABD618D5A270BD4A6F6B4AF9E139950F2B99387D9A64D64CB5967ADCEDACA8ACC61B655ADEDB0061251A182CEEA10790625E4D123190C70321FA09E7B173D78EAFDBFDBFB3EFADD1A12A036DE706924A852AFF7A0166531FEAC66741845AC06CED62F9C2626205A4FA48A066EC35C9A811FEB981ABEEBE31B6BFCF"; +static char *hex_q = "AA5BD7F4E5062413E58835CA00C7A635716194C5"; +static char *hex_x = "9936E5E4E9FB28BE91F5065FE8C935B3F5D81FC5"; +static char *hex_y = "5316B0FBBF598A5E5595C14FAC43B80853E6CF0D9223FAB184595239BFCBF22D383ADD935205497E2B12C46173E36F54BD96E5A7AAA95A58A4B767D2C0BDC81EB13A124F98C005EF395D6ABAB70B3BD8B795DD796EA2D28473470388B464D9B9B84FF1C934BBF97366F57C2E11FEC331E60838596781EB6D4127D70D74AFA035"; /* private key - raw decimal numbers */ -char *dec_g = "41834149751984197912953436480983170533071735026506895442815002322147255782590882063707309354781506433716654796985480894012184326029507913813728323760888731712844346877576824916725534905000120412305763983626878322597033839508975868744887842375259196379140567488975525420966465471602331600963525846901216912348"; -char *dec_p = "138366127874251453574215823372867983172559870428080754538874699342292548213873551009389476481395012375639515165022292709776266658812209612126692196557051247870332681145778007636026326219557730049370214260237710845864302921876857532769906463917243319959886290876544710558897185626634470575981605420411381006287"; -char *dec_q = "972576611327916959546542817054443329226761409733"; -char *dec_x = "874699854785640347852049895863914110365034094533"; -char *dec_y = "58346825863862115220306694056113472976936045407556113559931032566376300411053620606958863235131122432665794570437845128216268156672161823000705623178942581094085367656740608001229642983928728905397237964247962716781137229394844332774819193277135681825866994604976120931444766148118918668354923664000689348661"; +static char *dec_g = "41834149751984197912953436480983170533071735026506895442815002322147255782590882063707309354781506433716654796985480894012184326029507913813728323760888731712844346877576824916725534905000120412305763983626878322597033839508975868744887842375259196379140567488975525420966465471602331600963525846901216912348"; +static char *dec_p = "138366127874251453574215823372867983172559870428080754538874699342292548213873551009389476481395012375639515165022292709776266658812209612126692196557051247870332681145778007636026326219557730049370214260237710845864302921876857532769906463917243319959886290876544710558897185626634470575981605420411381006287"; +static char *dec_q = "972576611327916959546542817054443329226761409733"; +static char *dec_x = "874699854785640347852049895863914110365034094533"; +static char *dec_y = "58346825863862115220306694056113472976936045407556113559931032566376300411053620606958863235131122432665794570437845128216268156672161823000705623178942581094085367656740608001229642983928728905397237964247962716781137229394844332774819193277135681825866994604976120931444766148118918668354923664000689348661"; /* The public part of test_dsa.key in SubjectPublicKeyInfo format */ static const unsigned char openssl_pub_dsa[] = { diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index b6e3f39fe..44272d880 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -47,24 +47,24 @@ static const unsigned char openssl_private_rsa[] = { 0x4a, 0x9f, }; /* private keay - hexadecimal */ -char *hex_d = "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881"; -char *hex_dP = "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089"; -char *hex_dQ = "AB9088FA600829509A438BA050CCD85AFE976463717422A320025ACFEBC6169554D1CBAB8D1AC600FA08929C71D552523596714B8B920CD0E9BFAD630BA5E9B1"; -char *hex_e = "010001"; -char *hex_N = "CF9ADE648ADAC83320A9D783311954B29A85A7A1B77533B6A9AC8424B3DEDB7D852D9665E53F7295249F2868CA4FDB441C3E60128ADD26A5EBFF0B5ED48838492A6E5BBF123747BD056BBCDBF3EEE4118E41687C6113D742C880BE368FDC088B4FACA4E2760CC9636C495893EDCCAADC253B0A603F8B543AC34D31E794A444FD"; -char *hex_p = "F7BE5E23C3323FBF8B8E3AEEFCFCCBE5F7F10BBC4282AED57A3ECAF7D5693F6425A21FB77575059242EBB8F1F30A05E394D1557835A036A09B7C92846CDDDC4D"; -char *hex_q = "D6860E85420B0408842160F00E0D88FD1E3610654F1E53B40872805C3F596617E698F2E96C7A064CAC763DED8CA1CEAD1BBDB47D28BCE30E388D99D805B5A371"; -char *hex_qP = "DCCC27C8E4DC6248D59BAFF5AB60F621FD53E2B75D09C91AA104A9FC612C5D04583A5A39F14A215667FDCC20A38F78185A793D2E8E7E860AE6A833C104174A9F"; +static char *hex_d = "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881"; +static char *hex_dP = "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089"; +static char *hex_dQ = "AB9088FA600829509A438BA050CCD85AFE976463717422A320025ACFEBC6169554D1CBAB8D1AC600FA08929C71D552523596714B8B920CD0E9BFAD630BA5E9B1"; +static char *hex_e = "010001"; +static char *hex_N = "CF9ADE648ADAC83320A9D783311954B29A85A7A1B77533B6A9AC8424B3DEDB7D852D9665E53F7295249F2868CA4FDB441C3E60128ADD26A5EBFF0B5ED48838492A6E5BBF123747BD056BBCDBF3EEE4118E41687C6113D742C880BE368FDC088B4FACA4E2760CC9636C495893EDCCAADC253B0A603F8B543AC34D31E794A444FD"; +static char *hex_p = "F7BE5E23C3323FBF8B8E3AEEFCFCCBE5F7F10BBC4282AED57A3ECAF7D5693F6425A21FB77575059242EBB8F1F30A05E394D1557835A036A09B7C92846CDDDC4D"; +static char *hex_q = "D6860E85420B0408842160F00E0D88FD1E3610654F1E53B40872805C3F596617E698F2E96C7A064CAC763DED8CA1CEAD1BBDB47D28BCE30E388D99D805B5A371"; +static char *hex_qP = "DCCC27C8E4DC6248D59BAFF5AB60F621FD53E2B75D09C91AA104A9FC612C5D04583A5A39F14A215667FDCC20A38F78185A793D2E8E7E860AE6A833C104174A9F"; /* private keay - decimal */ -char *dec_d = "140715588362011445903700789698620706303856890313846506579552319155852306603445626455616876267358538338151320072087950597426668358843246116141391746806252390039505422193715556188330352166601762210959618868365359433828069868584168017348772565936127608284367789455480066115411950431014508224203325089671253575809"; -char *dec_dP = "5757027123463051531073361217943880203685183318942602176865989327630429772398553254013771630974725523559703665512845231173916766336576994271809362147385481"; -char *dec_dQ = "8985566687080619280443708121716583572314829758991088624433980393739288226842152842353421251125477168722728289150354056572727675764519591179919295246625201"; -char *dec_e = "65537"; -char *dec_N = "145785157837445763858971808379627955816432214431353481009581718367907499729204464589803079767521523397316119124291441688063985017444589154155338311524887989148444674974298105211582428885045820631376256167593861203305479546421254276833052913791538765775697977909548553897629170045372476652935456198173974086909"; -char *dec_p = "12975386429272921390465467849934248466500992474501042673679976015025637113752114471707151502138750486193421113099777767227628554763059580218432153760685133"; -char *dec_q = "11235515692122231999359687466333538198133993435121038200055897831921312127192760781281669977582095991578071163376390471936482431583372835883432943212143473"; -char *dec_qP = "11564102464723136702427739477324729528451027211272900753079601723449664482225846595388433622640284454614991112736446376964904474099700895632145077333609119"; +static char *dec_d = "140715588362011445903700789698620706303856890313846506579552319155852306603445626455616876267358538338151320072087950597426668358843246116141391746806252390039505422193715556188330352166601762210959618868365359433828069868584168017348772565936127608284367789455480066115411950431014508224203325089671253575809"; +static char *dec_dP = "5757027123463051531073361217943880203685183318942602176865989327630429772398553254013771630974725523559703665512845231173916766336576994271809362147385481"; +static char *dec_dQ = "8985566687080619280443708121716583572314829758991088624433980393739288226842152842353421251125477168722728289150354056572727675764519591179919295246625201"; +static char *dec_e = "65537"; +static char *dec_N = "145785157837445763858971808379627955816432214431353481009581718367907499729204464589803079767521523397316119124291441688063985017444589154155338311524887989148444674974298105211582428885045820631376256167593861203305479546421254276833052913791538765775697977909548553897629170045372476652935456198173974086909"; +static char *dec_p = "12975386429272921390465467849934248466500992474501042673679976015025637113752114471707151502138750486193421113099777767227628554763059580218432153760685133"; +static char *dec_q = "11235515692122231999359687466333538198133993435121038200055897831921312127192760781281669977582095991578071163376390471936482431583372835883432943212143473"; +static char *dec_qP = "11564102464723136702427739477324729528451027211272900753079601723449664482225846595388433622640284454614991112736446376964904474099700895632145077333609119"; /*** openssl public RSA key in DER format */ static const unsigned char openssl_public_rsa[] = { From 76b289833c6e63174de32824d9566eac86c0b0e9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 20 Feb 2017 23:35:34 +0100 Subject: [PATCH 0426/1192] only define LTC_NO_PROTOTYPES on one point This closes #132 --- src/headers/tomcrypt_custom.h | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 99d8e0477..86f3db377 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -3,55 +3,31 @@ /* macros for various libc functions you can change for embedded targets */ #ifndef XMALLOC - #ifdef malloc - #define LTC_NO_PROTOTYPES - #endif #define XMALLOC malloc #endif #ifndef XREALLOC - #ifdef realloc - #define LTC_NO_PROTOTYPES - #endif #define XREALLOC realloc #endif #ifndef XCALLOC - #ifdef calloc - #define LTC_NO_PROTOTYPES - #endif #define XCALLOC calloc #endif #ifndef XFREE - #ifdef free - #define LTC_NO_PROTOTYPES - #endif #define XFREE free #endif #ifndef XMEMSET - #ifdef memset - #define LTC_NO_PROTOTYPES - #endif #define XMEMSET memset #endif #ifndef XMEMCPY - #ifdef memcpy - #define LTC_NO_PROTOTYPES - #endif #define XMEMCPY memcpy #endif #ifndef XMEMCMP - #ifdef memcmp - #define LTC_NO_PROTOTYPES - #endif #define XMEMCMP memcmp #endif #ifndef XMEM_NEQ #define XMEM_NEQ mem_neq #endif #ifndef XSTRCMP - #ifdef strcmp - #define LTC_NO_PROTOTYPES - #endif #define XSTRCMP strcmp #endif @@ -63,12 +39,15 @@ #endif #ifndef XQSORT - #ifdef qsort - #define LTC_NO_PROTOTYPES - #endif #define XQSORT qsort #endif +#if defined(malloc) || defined(realloc) || defined(calloc) || defined(free) || \ + defined(memset) || defined(memcpy) || defined(memcmp) || defined(strcmp) || \ + defined(clock) || defined(qsort) +#define LTC_NO_PROTOTYPES +#endif + /* shortcut to disable automatic inclusion */ #if defined LTC_NOTHING && !defined LTC_EASY #define LTC_NO_MATH From 3d5b90d24df69b75da31d2f58252e2c84ac8cb2a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 20:05:36 +0100 Subject: [PATCH 0427/1192] LTC_NO_PROTOTYPES related cosmetics --- src/headers/tomcrypt_custom.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 86f3db377..074ab4eb4 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -42,9 +42,9 @@ #define XQSORT qsort #endif -#if defined(malloc) || defined(realloc) || defined(calloc) || defined(free) || \ +#if ( defined(malloc) || defined(realloc) || defined(calloc) || defined(free) || \ defined(memset) || defined(memcpy) || defined(memcmp) || defined(strcmp) || \ - defined(clock) || defined(qsort) + defined(clock) || defined(qsort) ) && !defined(LTC_NO_PROTOTYPES) #define LTC_NO_PROTOTYPES #endif From 0c226834ccdb715705d0387eb714696299725110 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 2 Jan 2016 17:37:06 +0100 Subject: [PATCH 0428/1192] introducing LTC_INLINE --- src/headers/tomcrypt_cfg.h | 9 +++++++++ src/pk/dh/dh_static.h | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index c2aa3e15d..114aaccb4 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -43,6 +43,15 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #endif +/* some compilers do not like "inline" */ +#if defined(__HP_cc) + #define LTC_INLINE +#elif defined(_MSC_VER) + #define LTC_INLINE __inline +#else + #define LTC_INLINE inline +#endif + /* type of argument checking, 0=default, 1=fatal and 2=error+continue, 3=nothing */ #ifndef ARGTYPE #define ARGTYPE 0 diff --git a/src/pk/dh/dh_static.h b/src/pk/dh/dh_static.h index 273b1754a..5a47ee0c3 100644 --- a/src/pk/dh/dh_static.h +++ b/src/pk/dh/dh_static.h @@ -69,7 +69,7 @@ y += x; \ } -static inline void packet_store_header (unsigned char *dst, int section, int subsection) +static LTC_INLINE void packet_store_header (unsigned char *dst, int section, int subsection) { LTC_ARGCHKVD(dst != NULL); @@ -83,7 +83,7 @@ static inline void packet_store_header (unsigned char *dst, int section, int sub } -static inline int packet_valid_header (unsigned char *src, int section, int subsection) +static LTC_INLINE int packet_valid_header (unsigned char *src, int section, int subsection) { unsigned long ver; From 979e9a9d1542d2e59638889eeca52357eeac6c6d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 15 Jan 2016 08:56:32 +0100 Subject: [PATCH 0429/1192] fix for #90 ltc_ecc_mul2add.c integer sign issue (sjaeckel's way) --- src/pk/ecc/ltc_ecc_mul2add.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pk/ecc/ltc_ecc_mul2add.c b/src/pk/ecc/ltc_ecc_mul2add.c index a6d1aab8a..de4aac358 100644 --- a/src/pk/ecc/ltc_ecc_mul2add.c +++ b/src/pk/ecc/ltc_ecc_mul2add.c @@ -134,13 +134,14 @@ int ltc_ecc_mul2add(ecc_point *A, void *kA, bitbufB = tB[0]; /* for every byte of the multiplicands */ - for (x = -1;; ) { + for (x = 0;; ) { /* grab a nibble */ if (++nibble == 4) { - ++x; if (x == len) break; + if (x == len) break; bitbufA = tA[x]; bitbufB = tB[x]; nibble = 0; + ++x; } /* extract two bits from both, shift/update */ From ecb2402ba8d5f8f7fdacbbdf0e8e168d4c435ab5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 23 Feb 2017 23:37:53 +0100 Subject: [PATCH 0430/1192] remove [X]CLOCKS_PER_SEC --- src/headers/tomcrypt_custom.h | 3 --- src/prngs/rng_get_bytes.c | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 074ab4eb4..33e4bc08a 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -34,9 +34,6 @@ #ifndef XCLOCK #define XCLOCK clock #endif -#ifndef XCLOCKS_PER_SEC -#define XCLOCKS_PER_SEC CLOCKS_PER_SEC -#endif #ifndef XQSORT #define XQSORT qsort diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 2a66367e2..19c8a78ec 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -54,8 +54,7 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len, #endif /* LTC_DEVRANDOM */ -/* on ANSI C platforms with 100 < CLOCKS_PER_SEC < 10000 */ -#if defined(CLOCKS_PER_SEC) && !defined(_WIN32_WCE) +#if !defined(_WIN32_WCE) #define ANSI_RNG @@ -65,10 +64,6 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, clock_t t1; int l, acc, bits, a, b; - if (XCLOCKS_PER_SEC < 100 || XCLOCKS_PER_SEC > 10000) { - return 0; - } - l = len; bits = 8; acc = a = b = 0; From 7b48f4d5f77b65f979b859616dbc3998f713537a Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 19 Dec 2015 17:30:38 +0100 Subject: [PATCH 0431/1192] fix indentation --- src/ciphers/aes/aes.c | 22 ++++---- src/ciphers/anubis.c | 10 ++-- src/ciphers/camellia.c | 4 +- src/ciphers/des.c | 12 ++-- src/ciphers/kseed.c | 52 ++++++++--------- src/ciphers/noekeon.c | 10 ++-- src/ciphers/rc2.c | 42 +++++++------- src/ciphers/safer/safer.c | 23 ++++---- src/ciphers/twofish/twofish.c | 26 ++++----- src/encauth/ccm/ccm_memory.c | 4 +- src/encauth/ccm/ccm_test.c | 6 +- src/encauth/eax/eax_test.c | 4 +- src/encauth/gcm/gcm_add_aad.c | 4 +- src/encauth/gcm/gcm_add_iv.c | 2 +- src/encauth/gcm/gcm_init.c | 4 +- src/encauth/gcm/gcm_process.c | 2 +- src/encauth/ocb/ocb_init.c | 40 ++++++------- src/encauth/ocb3/ocb3_init.c | 56 +++++++++---------- src/hashes/sha2/sha512.c | 20 +++---- src/mac/f9/f9_process.c | 14 ++--- src/mac/pmac/pmac_init.c | 46 +++++++-------- src/mac/pmac/pmac_test.c | 4 +- src/mac/xcbc/xcbc_process.c | 14 ++--- src/modes/cbc/cbc_decrypt.c | 18 +++--- src/modes/cbc/cbc_encrypt.c | 30 +++++----- src/modes/lrw/lrw_start.c | 12 ++-- src/modes/lrw/lrw_test.c | 4 +- src/pk/asn1/der/bit/der_decode_bit_string.c | 4 +- .../asn1/der/bit/der_decode_raw_bit_string.c | 4 +- .../der_decode_object_identifier.c | 44 +++++++-------- .../der_encode_object_identifier.c | 52 ++++++++--------- .../der/sequence/der_decode_sequence_ex.c | 16 +++--- src/pk/asn1/der/set/der_encode_setof.c | 16 +++--- src/pk/dsa/dsa_import.c | 6 +- src/pk/ecc/ltc_ecc_mul2add.c | 14 ++--- src/pk/ecc/ltc_ecc_mulmod_timing.c | 6 +- src/prngs/sober128.c | 20 +++---- 37 files changed, 334 insertions(+), 333 deletions(-) diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index cc9d99f39..2bf7a005d 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -675,11 +675,11 @@ int ECB_TEST(void) } }; - symmetric_key key; - unsigned char tmp[2][16]; - int i, y; + symmetric_key key; + unsigned char tmp[2][16]; + int i, y; - for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { zeromem(&key, sizeof(key)); if ((err = rijndael_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) { return err; @@ -707,13 +707,13 @@ int ECB_TEST(void) return CRYPT_FAIL_TESTVECTOR; } - /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ - for (y = 0; y < 16; y++) tmp[0][y] = 0; - for (y = 0; y < 1000; y++) rijndael_ecb_encrypt(tmp[0], tmp[0], &key); - for (y = 0; y < 1000; y++) rijndael_ecb_decrypt(tmp[0], tmp[0], &key); - for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; - } - return CRYPT_OK; + /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ + for (y = 0; y < 16; y++) tmp[0][y] = 0; + for (y = 0; y < 1000; y++) rijndael_ecb_encrypt(tmp[0], tmp[0], &key); + for (y = 0; y < 1000; y++) rijndael_ecb_decrypt(tmp[0], tmp[0], &key); + for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; + } + return CRYPT_OK; #endif } diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index c3b3c2f52..f81942125 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -926,16 +926,16 @@ int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetri return CRYPT_INVALID_ROUNDS; } - /* - * map cipher key to initial key state (mu): - */ - for (i = 0, pos = 0; i < N; i++, pos += 4) { + /* + * map cipher key to initial key state (mu): + */ + for (i = 0, pos = 0; i < N; i++, pos += 4) { kappa[i] = (((ulong32)key[pos ]) << 24) ^ (((ulong32)key[pos + 1]) << 16) ^ (((ulong32)key[pos + 2]) << 8) ^ (((ulong32)key[pos + 3]) ); - } + } /* * generate R + 1 round keys: diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 558a585b5..e7910513c 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -686,8 +686,8 @@ int camellia_test(void) unsigned int x; for (x = 0; x < sizeof(tests)/sizeof(tests[0]); x++) { - zeromem(&skey, sizeof(skey)); - if ((err = camellia_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { + zeromem(&skey, sizeof(skey)); + if ((err = camellia_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { return err; } if ((err = camellia_ecb_encrypt(tests[x].pt, buf[0], &skey)) != CRYPT_OK) { diff --git a/src/ciphers/des.c b/src/ciphers/des.c index fbacf5c9f..712c1ae89 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -1983,12 +1983,12 @@ int des_test(void) return CRYPT_FAIL_TESTVECTOR; } - /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ - for (y = 0; y < 8; y++) tmp[y] = 0; - for (y = 0; y < 1000; y++) des_ecb_encrypt(tmp, tmp, &des); - for (y = 0; y < 1000; y++) des_ecb_decrypt(tmp, tmp, &des); - for (y = 0; y < 8; y++) if (tmp[y] != 0) return CRYPT_FAIL_TESTVECTOR; -} + /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ + for (y = 0; y < 8; y++) tmp[y] = 0; + for (y = 0; y < 1000; y++) des_ecb_encrypt(tmp, tmp, &des); + for (y = 0; y < 1000; y++) des_ecb_decrypt(tmp, tmp, &des); + for (y = 0; y < 8; y++) if (tmp[y] != 0) return CRYPT_FAIL_TESTVECTOR; + } return CRYPT_OK; #endif diff --git a/src/ciphers/kseed.c b/src/ciphers/kseed.c index 003074ca7..85b4f8a7b 100644 --- a/src/ciphers/kseed.c +++ b/src/ciphers/kseed.c @@ -201,41 +201,41 @@ static const ulong32 KCi[16] = { */ int kseed_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) { - int i; - ulong32 tmp, k1, k2, k3, k4; + int i; + ulong32 tmp, k1, k2, k3, k4; - if (keylen != 16) { - return CRYPT_INVALID_KEYSIZE; - } + if (keylen != 16) { + return CRYPT_INVALID_KEYSIZE; + } - if (num_rounds != 16 && num_rounds != 0) { - return CRYPT_INVALID_ROUNDS; - } + if (num_rounds != 16 && num_rounds != 0) { + return CRYPT_INVALID_ROUNDS; + } - /* load key */ - LOAD32H(k1, key); - LOAD32H(k2, key+4); - LOAD32H(k3, key+8); - LOAD32H(k4, key+12); + /* load key */ + LOAD32H(k1, key); + LOAD32H(k2, key+4); + LOAD32H(k3, key+8); + LOAD32H(k4, key+12); - for (i = 0; i < 16; i++) { - skey->kseed.K[2*i+0] = G(k1 + k3 - KCi[i]); - skey->kseed.K[2*i+1] = G(k2 - k4 + KCi[i]); - if (i&1) { - tmp = k3; - k3 = ((k3 << 8) | (k4 >> 24)) & 0xFFFFFFFF; - k4 = ((k4 << 8) | (tmp >> 24)) & 0xFFFFFFFF; - } else { - tmp = k1; - k1 = ((k1 >> 8) | (k2 << 24)) & 0xFFFFFFFF; - k2 = ((k2 >> 8) | (tmp << 24)) & 0xFFFFFFFF; + for (i = 0; i < 16; i++) { + skey->kseed.K[2*i+0] = G(k1 + k3 - KCi[i]); + skey->kseed.K[2*i+1] = G(k2 - k4 + KCi[i]); + if (i&1) { + tmp = k3; + k3 = ((k3 << 8) | (k4 >> 24)) & 0xFFFFFFFF; + k4 = ((k4 << 8) | (tmp >> 24)) & 0xFFFFFFFF; + } else { + tmp = k1; + k1 = ((k1 >> 8) | (k2 << 24)) & 0xFFFFFFFF; + k2 = ((k2 >> 8) | (tmp << 24)) & 0xFFFFFFFF; } /* reverse keys for decrypt */ skey->kseed.dK[2*(15-i)+0] = skey->kseed.K[2*i+0]; skey->kseed.dK[2*(15-i)+1] = skey->kseed.K[2*i+1]; - } + } - return CRYPT_OK; + return CRYPT_OK; } static void rounds(ulong32 *P, ulong32 *K) diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index f748d3e97..5b8d1c850 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -303,11 +303,11 @@ int noekeon_test(void) return CRYPT_FAIL_TESTVECTOR; } - /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ - for (y = 0; y < 16; y++) tmp[0][y] = 0; - for (y = 0; y < 1000; y++) noekeon_ecb_encrypt(tmp[0], tmp[0], &key); - for (y = 0; y < 1000; y++) noekeon_ecb_decrypt(tmp[0], tmp[0], &key); - for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; + /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ + for (y = 0; y < 16; y++) tmp[0][y] = 0; + for (y = 0; y < 1000; y++) noekeon_ecb_encrypt(tmp[0], tmp[0], &key); + for (y = 0; y < 1000; y++) noekeon_ecb_decrypt(tmp[0], tmp[0], &key); + for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; } return CRYPT_OK; #endif diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index dbe5696c3..a77853591 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -86,35 +86,35 @@ int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke } for (i = 0; i < keylen; i++) { - tmp[i] = key[i] & 255; + tmp[i] = key[i] & 255; } - /* Phase 1: Expand input key to 128 bytes */ - if (keylen < 128) { - for (i = keylen; i < 128; i++) { - tmp[i] = permute[(tmp[i - 1] + tmp[i - keylen]) & 255]; - } - } + /* Phase 1: Expand input key to 128 bytes */ + if (keylen < 128) { + for (i = keylen; i < 128; i++) { + tmp[i] = permute[(tmp[i - 1] + tmp[i - keylen]) & 255]; + } + } - /* Phase 2 - reduce effective key size to "bits" */ - bits = keylen<<3; - T8 = (unsigned)(bits+7)>>3; - TM = (255 >> (unsigned)(7 & -bits)); - tmp[128 - T8] = permute[tmp[128 - T8] & TM]; - for (i = 127 - T8; i >= 0; i--) { - tmp[i] = permute[tmp[i + 1] ^ tmp[i + T8]]; - } + /* Phase 2 - reduce effective key size to "bits" */ + bits = keylen<<3; + T8 = (unsigned)(bits+7)>>3; + TM = (255 >> (unsigned)(7 & -bits)); + tmp[128 - T8] = permute[tmp[128 - T8] & TM]; + for (i = 127 - T8; i >= 0; i--) { + tmp[i] = permute[tmp[i + 1] ^ tmp[i + T8]]; + } - /* Phase 3 - copy to xkey in little-endian order */ - for (i = 0; i < 64; i++) { - xkey[i] = (unsigned)tmp[2*i] + ((unsigned)tmp[2*i+1] << 8); - } + /* Phase 3 - copy to xkey in little-endian order */ + for (i = 0; i < 64; i++) { + xkey[i] = (unsigned)tmp[2*i] + ((unsigned)tmp[2*i+1] << 8); + } #ifdef LTC_CLEAN_STACK - zeromem(tmp, sizeof(tmp)); + zeromem(tmp, sizeof(tmp)); #endif - return CRYPT_OK; + return CRYPT_OK; } /**********************************************************************\ diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index 865eee3db..85af1f209 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -432,11 +432,11 @@ int safer_sk64_test(void) return CRYPT_FAIL_TESTVECTOR; } - /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ - for (y = 0; y < 8; y++) buf[0][y] = 0; - for (y = 0; y < 1000; y++) safer_ecb_encrypt(buf[0], buf[0], &skey); - for (y = 0; y < 1000; y++) safer_ecb_decrypt(buf[0], buf[0], &skey); - for (y = 0; y < 8; y++) if (buf[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; + /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ + for (y = 0; y < 8; y++) buf[0][y] = 0; + for (y = 0; y < 1000; y++) safer_ecb_encrypt(buf[0], buf[0], &skey); + for (y = 0; y < 1000; y++) safer_ecb_decrypt(buf[0], buf[0], &skey); + for (y = 0; y < 8; y++) if (buf[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; return CRYPT_OK; #endif @@ -475,12 +475,13 @@ int safer_sk128_test(void) return CRYPT_FAIL_TESTVECTOR; } - /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ - for (y = 0; y < 8; y++) buf[0][y] = 0; - for (y = 0; y < 1000; y++) safer_ecb_encrypt(buf[0], buf[0], &skey); - for (y = 0; y < 1000; y++) safer_ecb_decrypt(buf[0], buf[0], &skey); - for (y = 0; y < 8; y++) if (buf[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; - return CRYPT_OK; + /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ + for (y = 0; y < 8; y++) buf[0][y] = 0; + for (y = 0; y < 1000; y++) safer_ecb_encrypt(buf[0], buf[0], &skey); + for (y = 0; y < 1000; y++) safer_ecb_decrypt(buf[0], buf[0], &skey); + for (y = 0; y < 8; y++) if (buf[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; + + return CRYPT_OK; #endif } diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index b443a7c15..8db396c64 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -245,7 +245,7 @@ static void h_func(const unsigned char *in, unsigned char *out, unsigned char *M unsigned char y[4]; for (x = 0; x < 4; x++) { y[x] = in[x]; - } + } switch (k) { case 4: y[0] = (unsigned char)(sbox(1, (ulong32)y[0]) ^ M[4 * (6 + offset) + 0]); @@ -504,7 +504,7 @@ int twofish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_ke a = RORc(a ^ (t1 + k[2]), 1); b = ROLc(b, 1) ^ (t2 + t1 + k[3]); k += 4; - } + } /* output with "undo last swap" */ ta = c ^ skey->twofish.K[4]; @@ -646,11 +646,11 @@ int twofish_test(void) }; - symmetric_key key; - unsigned char tmp[2][16]; - int err, i, y; + symmetric_key key; + unsigned char tmp[2][16]; + int err, i, y; - for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { if ((err = twofish_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) { return err; } @@ -662,13 +662,13 @@ int twofish_test(void) #endif return CRYPT_FAIL_TESTVECTOR; } - /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ - for (y = 0; y < 16; y++) tmp[0][y] = 0; - for (y = 0; y < 1000; y++) twofish_ecb_encrypt(tmp[0], tmp[0], &key); - for (y = 0; y < 1000; y++) twofish_ecb_decrypt(tmp[0], tmp[0], &key); - for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; - } - return CRYPT_OK; + /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ + for (y = 0; y < 16; y++) tmp[0][y] = 0; + for (y = 0; y < 1000; y++) twofish_ecb_encrypt(tmp[0], tmp[0], &key); + for (y = 0; y < 1000; y++) twofish_ecb_decrypt(tmp[0], tmp[0], &key); + for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR; + } + return CRYPT_OK; #endif } diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index f12d212ef..cac7f46ab 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -283,8 +283,8 @@ int ccm_memory(int cipher, goto error; } } - } - } + } + } #endif for (; y < ptlen; y++) { diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 7384151c8..7d1353a0a 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -190,9 +190,9 @@ int ccm_test(void) } if (y == 0) { - XMEMCPY(tag3, tests[x].tag, tests[x].taglen); - taglen = tests[x].taglen; - if ((err = ccm_memory(idx, + XMEMCPY(tag3, tests[x].tag, tests[x].taglen); + taglen = tests[x].taglen; + if ((err = ccm_memory(idx, tests[x].key, 16, NULL, tests[x].nonce, tests[x].noncelen, diff --git a/src/encauth/eax/eax_test.c b/src/encauth/eax/eax_test.c index 5babef2ee..087755e59 100644 --- a/src/encauth/eax/eax_test.c +++ b/src/encauth/eax/eax_test.c @@ -270,8 +270,8 @@ int eax_test(void) return CRYPT_FAIL_TESTVECTOR; } - } - return CRYPT_OK; + } + return CRYPT_OK; #endif /* LTC_TEST */ } diff --git a/src/encauth/gcm/gcm_add_aad.c b/src/encauth/gcm/gcm_add_aad.c index f538009a0..e09981b9d 100644 --- a/src/encauth/gcm/gcm_add_aad.c +++ b/src/encauth/gcm/gcm_add_aad.c @@ -104,9 +104,9 @@ int gcm_add_aad(gcm_state *gcm, /* start adding AAD data to the state */ for (; x < adatalen; x++) { - gcm->X[gcm->buflen++] ^= *adata++; + gcm->X[gcm->buflen++] ^= *adata++; - if (gcm->buflen == 16) { + if (gcm->buflen == 16) { /* GF mult it */ gcm_mult_h(gcm, gcm->X); gcm->buflen = 0; diff --git a/src/encauth/gcm/gcm_add_iv.c b/src/encauth/gcm/gcm_add_iv.c index 7464f9a7c..af2b1b85b 100644 --- a/src/encauth/gcm/gcm_add_iv.c +++ b/src/encauth/gcm/gcm_add_iv.c @@ -72,7 +72,7 @@ int gcm_add_iv(gcm_state *gcm, for (; x < IVlen; x++) { gcm->buf[gcm->buflen++] = *IV++; - if (gcm->buflen == 16) { + if (gcm->buflen == 16) { /* GF mult it */ for (y = 0; y < 16; y++) { gcm->X[y] ^= gcm->buf[y]; diff --git a/src/encauth/gcm/gcm_init.c b/src/encauth/gcm/gcm_init.c index 8e1c496b3..2c6a5eb44 100644 --- a/src/encauth/gcm/gcm_init.c +++ b/src/encauth/gcm/gcm_init.c @@ -92,8 +92,8 @@ int gcm_init(gcm_state *gcm, int cipher, } gcm->PC[x][y][0] = gcm_shift_table[t<<1]; gcm->PC[x][y][1] ^= gcm_shift_table[(t<<1)+1]; - } - } + } + } #endif diff --git a/src/encauth/gcm/gcm_process.c b/src/encauth/gcm/gcm_process.c index d1f3fd1af..54fa1d16c 100644 --- a/src/encauth/gcm/gcm_process.c +++ b/src/encauth/gcm/gcm_process.c @@ -118,7 +118,7 @@ int gcm_process(gcm_state *gcm, return err; } } - } + } } #endif diff --git a/src/encauth/ocb/ocb_init.c b/src/encauth/ocb/ocb_init.c index 22b2f4653..393f282df 100644 --- a/src/encauth/ocb/ocb_init.c +++ b/src/encauth/ocb/ocb_init.c @@ -106,32 +106,32 @@ int ocb_init(ocb_state *ocb, int cipher, ocb->Ls[x][y] ^= polys[poly].poly_mul[y]; } } - } + } - /* find Lr = L / x */ - m = ocb->L[ocb->block_len-1] & 1; + /* find Lr = L / x */ + m = ocb->L[ocb->block_len-1] & 1; - /* shift right */ - for (x = ocb->block_len - 1; x > 0; x--) { - ocb->Lr[x] = ((ocb->L[x] >> 1) | (ocb->L[x-1] << 7)) & 255; - } - ocb->Lr[0] = ocb->L[0] >> 1; + /* shift right */ + for (x = ocb->block_len - 1; x > 0; x--) { + ocb->Lr[x] = ((ocb->L[x] >> 1) | (ocb->L[x-1] << 7)) & 255; + } + ocb->Lr[0] = ocb->L[0] >> 1; - if (m == 1) { - for (x = 0; x < ocb->block_len; x++) { - ocb->Lr[x] ^= polys[poly].poly_div[x]; - } - } + if (m == 1) { + for (x = 0; x < ocb->block_len; x++) { + ocb->Lr[x] ^= polys[poly].poly_div[x]; + } + } - /* set Li, checksum */ - zeromem(ocb->Li, ocb->block_len); - zeromem(ocb->checksum, ocb->block_len); + /* set Li, checksum */ + zeromem(ocb->Li, ocb->block_len); + zeromem(ocb->checksum, ocb->block_len); - /* set other params */ - ocb->block_index = 1; - ocb->cipher = cipher; + /* set other params */ + ocb->block_index = 1; + ocb->cipher = cipher; - return CRYPT_OK; + return CRYPT_OK; } #endif diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index 926288b76..c73cb9630 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -90,45 +90,45 @@ int ocb3_init(ocb3_state *ocb, int cipher, /* compute L_$, L_0, L_1, ... */ for (x = -1; x < 32; x++) { - if (x == -1) { /* gonna compute: L_$ = double(L_*) */ + if (x == -1) { /* gonna compute: L_$ = double(L_*) */ current = ocb->L_dollar; previous = ocb->L_star; - } - else if (x == 0) { /* gonna compute: L_0 = double(L_$) */ + } + else if (x == 0) { /* gonna compute: L_0 = double(L_$) */ current = ocb->L_[0]; previous = ocb->L_dollar; - } - else { /* gonna compute: L_i = double(L_{i-1}) for every integer i > 0 */ + } + else { /* gonna compute: L_i = double(L_{i-1}) for every integer i > 0 */ current = ocb->L_[x]; previous = ocb->L_[x-1]; - } - m = previous[0] >> 7; - for (y = 0; y < ocb->block_len-1; y++) { - current[y] = ((previous[y] << 1) | (previous[y+1] >> 7)) & 255; - } - current[ocb->block_len-1] = (previous[ocb->block_len-1] << 1) & 255; - if (m == 1) { - /* current[] = current[] XOR polys[poly].poly_mul[]*/ - ocb3_int_xor_blocks(current, current, polys[poly].poly_mul, ocb->block_len); - } - } + } + m = previous[0] >> 7; + for (y = 0; y < ocb->block_len-1; y++) { + current[y] = ((previous[y] << 1) | (previous[y+1] >> 7)) & 255; + } + current[ocb->block_len-1] = (previous[ocb->block_len-1] << 1) & 255; + if (m == 1) { + /* current[] = current[] XOR polys[poly].poly_mul[]*/ + ocb3_int_xor_blocks(current, current, polys[poly].poly_mul, ocb->block_len); + } + } - /* initialize ocb->Offset_current = Offset_0 */ - ocb3_int_calc_offset_zero(ocb, nonce, noncelen); + /* initialize ocb->Offset_current = Offset_0 */ + ocb3_int_calc_offset_zero(ocb, nonce, noncelen); - /* initialize checksum to all zeros */ - zeromem(ocb->checksum, ocb->block_len); + /* initialize checksum to all zeros */ + zeromem(ocb->checksum, ocb->block_len); - /* set block index */ - ocb->block_index = 1; + /* set block index */ + ocb->block_index = 1; - /* initialize AAD related stuff */ - ocb->ablock_index = 1; - ocb->adata_buffer_bytes = 0; - zeromem(ocb->aOffset_current, ocb->block_len); - zeromem(ocb->aSum_current, ocb->block_len); + /* initialize AAD related stuff */ + ocb->ablock_index = 1; + ocb->adata_buffer_bytes = 0; + zeromem(ocb->aOffset_current, ocb->block_len); + zeromem(ocb->aSum_current, ocb->block_len); - return CRYPT_OK; + return CRYPT_OK; } #endif diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index 2d6841624..44dd3e0d6 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -135,16 +135,16 @@ static int sha512_compress(hash_state * md, unsigned char *buf) d += t0; \ h = t0 + t1; - for (i = 0; i < 80; i += 8) { - RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0); - RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1); - RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2); - RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3); - RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4); - RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5); - RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6); - RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7); - } + for (i = 0; i < 80; i += 8) { + RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0); + RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1); + RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2); + RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3); + RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4); + RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5); + RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6); + RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7); + } #endif diff --git a/src/mac/f9/f9_process.c b/src/mac/f9/f9_process.c index b7a99f919..420bc4f26 100644 --- a/src/mac/f9/f9_process.c +++ b/src/mac/f9/f9_process.c @@ -53,21 +53,21 @@ int f9_process(f9_state *f9, const unsigned char *in, unsigned long inlen) in += f9->blocksize; inlen -= f9->blocksize; } - } + } #endif while (inlen) { - if (f9->buflen == f9->blocksize) { + if (f9->buflen == f9->blocksize) { cipher_descriptor[f9->cipher].ecb_encrypt(f9->IV, f9->IV, &f9->key); for (x = 0; x < f9->blocksize; x++) { f9->ACC[x] ^= f9->IV[x]; } f9->buflen = 0; - } - f9->IV[f9->buflen++] ^= *in++; - --inlen; - } - return CRYPT_OK; + } + f9->IV[f9->buflen++] ^= *in++; + --inlen; + } + return CRYPT_OK; } #endif diff --git a/src/mac/pmac/pmac_init.c b/src/mac/pmac/pmac_init.c index 81b7e851b..9a7192c50 100644 --- a/src/mac/pmac/pmac_init.c +++ b/src/mac/pmac/pmac_init.c @@ -110,37 +110,37 @@ int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned l } } - /* find Lr = L / x */ - m = L[pmac->block_len-1] & 1; + /* find Lr = L / x */ + m = L[pmac->block_len-1] & 1; - /* shift right */ - for (x = pmac->block_len - 1; x > 0; x--) { - pmac->Lr[x] = ((L[x] >> 1) | (L[x-1] << 7)) & 255; - } - pmac->Lr[0] = L[0] >> 1; + /* shift right */ + for (x = pmac->block_len - 1; x > 0; x--) { + pmac->Lr[x] = ((L[x] >> 1) | (L[x-1] << 7)) & 255; + } + pmac->Lr[0] = L[0] >> 1; - if (m == 1) { - for (x = 0; x < pmac->block_len; x++) { - pmac->Lr[x] ^= polys[poly].poly_div[x]; - } - } + if (m == 1) { + for (x = 0; x < pmac->block_len; x++) { + pmac->Lr[x] ^= polys[poly].poly_div[x]; + } + } - /* zero buffer, counters, etc... */ - pmac->block_index = 1; - pmac->cipher_idx = cipher; - pmac->buflen = 0; - zeromem(pmac->block, sizeof(pmac->block)); - zeromem(pmac->Li, sizeof(pmac->Li)); - zeromem(pmac->checksum, sizeof(pmac->checksum)); - err = CRYPT_OK; + /* zero buffer, counters, etc... */ + pmac->block_index = 1; + pmac->cipher_idx = cipher; + pmac->buflen = 0; + zeromem(pmac->block, sizeof(pmac->block)); + zeromem(pmac->Li, sizeof(pmac->Li)); + zeromem(pmac->checksum, sizeof(pmac->checksum)); + err = CRYPT_OK; error: #ifdef LTC_CLEAN_STACK - zeromem(L, pmac->block_len); + zeromem(L, pmac->block_len); #endif - XFREE(L); + XFREE(L); - return err; + return err; } #endif diff --git a/src/mac/pmac/pmac_test.c b/src/mac/pmac/pmac_test.c index 5d2e42a0c..fe91c646a 100644 --- a/src/mac/pmac/pmac_test.c +++ b/src/mac/pmac/pmac_test.c @@ -150,8 +150,8 @@ int pmac_test(void) #endif return CRYPT_FAIL_TESTVECTOR; } - } - return CRYPT_OK; + } + return CRYPT_OK; #endif /* LTC_TEST */ } diff --git a/src/mac/xcbc/xcbc_process.c b/src/mac/xcbc/xcbc_process.c index df5b741a8..c0798b384 100644 --- a/src/mac/xcbc/xcbc_process.c +++ b/src/mac/xcbc/xcbc_process.c @@ -53,18 +53,18 @@ int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen) in += xcbc->blocksize; inlen -= xcbc->blocksize; } - } + } #endif while (inlen) { - if (xcbc->buflen == xcbc->blocksize) { + if (xcbc->buflen == xcbc->blocksize) { cipher_descriptor[xcbc->cipher].ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); xcbc->buflen = 0; - } - xcbc->IV[xcbc->buflen++] ^= *in++; - --inlen; - } - return CRYPT_OK; + } + xcbc->IV[xcbc->buflen++] ^= *in++; + --inlen; + } + return CRYPT_OK; } #endif diff --git a/src/modes/cbc/cbc_decrypt.c b/src/modes/cbc/cbc_decrypt.c index d0766ed75..fb67cb854 100644 --- a/src/modes/cbc/cbc_decrypt.c +++ b/src/modes/cbc/cbc_decrypt.c @@ -69,17 +69,17 @@ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s /* xor IV against plaintext */ #if defined(LTC_FAST) - for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { + for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { tmpy = *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) ^ *((LTC_FAST_TYPE*)((unsigned char *)tmp + x)); - *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); - *((LTC_FAST_TYPE*)((unsigned char *)pt + x)) = tmpy; - } + *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); + *((LTC_FAST_TYPE*)((unsigned char *)pt + x)) = tmpy; + } #else - for (x = 0; x < cbc->blocklen; x++) { - tmpy = tmp[x] ^ cbc->IV[x]; - cbc->IV[x] = ct[x]; - pt[x] = tmpy; - } + for (x = 0; x < cbc->blocklen; x++) { + tmpy = tmp[x] ^ cbc->IV[x]; + cbc->IV[x] = ct[x]; + pt[x] = tmpy; + } #endif ct += cbc->blocklen; diff --git a/src/modes/cbc/cbc_encrypt.c b/src/modes/cbc/cbc_encrypt.c index f9c3941c6..380eb561a 100644 --- a/src/modes/cbc/cbc_encrypt.c +++ b/src/modes/cbc/cbc_encrypt.c @@ -58,13 +58,13 @@ int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s while (len) { /* xor IV against plaintext */ #if defined(LTC_FAST) - for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { + for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) ^= *((LTC_FAST_TYPE*)((unsigned char *)pt + x)); - } + } #else - for (x = 0; x < cbc->blocklen; x++) { - cbc->IV[x] ^= pt[x]; - } + for (x = 0; x < cbc->blocklen; x++) { + cbc->IV[x] ^= pt[x]; + } #endif /* encrypt */ @@ -72,21 +72,21 @@ int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s return err; } - /* store IV [ciphertext] for a future block */ + /* store IV [ciphertext] for a future block */ #if defined(LTC_FAST) - for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { + for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); - } + } #else - for (x = 0; x < cbc->blocklen; x++) { - cbc->IV[x] = ct[x]; - } + for (x = 0; x < cbc->blocklen; x++) { + cbc->IV[x] = ct[x]; + } #endif - ct += cbc->blocklen; - pt += cbc->blocklen; - len -= cbc->blocklen; - } + ct += cbc->blocklen; + pt += cbc->blocklen; + len -= cbc->blocklen; + } } return CRYPT_OK; } diff --git a/src/modes/lrw/lrw_start.c b/src/modes/lrw/lrw_start.c index bf9b27565..64014d2c8 100644 --- a/src/modes/lrw/lrw_start.c +++ b/src/modes/lrw/lrw_start.c @@ -41,10 +41,10 @@ int lrw_start( int cipher, int x, y, z, t; #endif - LTC_ARGCHK(IV != NULL); - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(tweak != NULL); - LTC_ARGCHK(lrw != NULL); + LTC_ARGCHK(IV != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(tweak != NULL); + LTC_ARGCHK(lrw != NULL); #ifdef LTC_FAST if (16 % sizeof(LTC_FAST_TYPE)) { @@ -88,8 +88,8 @@ int lrw_start( int cipher, } lrw->PC[x][y][0] = gcm_shift_table[t<<1]; lrw->PC[x][y][1] ^= gcm_shift_table[(t<<1)+1]; - } - } + } + } #endif /* generate first pad */ diff --git a/src/modes/lrw/lrw_test.c b/src/modes/lrw/lrw_test.c index 63e014a3b..2c9e0762a 100644 --- a/src/modes/lrw/lrw_test.c +++ b/src/modes/lrw/lrw_test.c @@ -122,8 +122,8 @@ int lrw_test(void) if ((err = lrw_done(&lrw)) != CRYPT_OK) { return err; } - } - return CRYPT_OK; + } + return CRYPT_OK; #endif } diff --git a/src/pk/asn1/der/bit/der_decode_bit_string.c b/src/pk/asn1/der/bit/der_decode_bit_string.c index bace8c8dc..d27af9f3f 100644 --- a/src/pk/asn1/der/bit/der_decode_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_bit_string.c @@ -45,8 +45,8 @@ int der_decode_bit_string(const unsigned char *in, unsigned long inlen, return CRYPT_INVALID_PACKET; } - /* offset in the data */ - x = 1; + /* offset in the data */ + x = 1; /* get the length of the data */ if (in[x] & 0x80) { diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index ee8e9a4d1..a4a3cb306 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -47,8 +47,8 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, return CRYPT_INVALID_PACKET; } - /* offset in the data */ - x = 1; + /* offset in the data */ + x = 1; /* get the length of the data */ if (in[x] & 0x80) { diff --git a/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c b/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c index 406acdc6e..b110908e2 100644 --- a/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c @@ -53,14 +53,14 @@ int der_decode_object_identifier(const unsigned char *in, unsigned long inle if (in[x] < 128) { len = in[x++]; } else { - if (in[x] < 0x81 || in[x] > 0x82) { - return CRYPT_INVALID_PACKET; - } - y = in[x++] & 0x7F; - len = 0; - while (y--) { - len = (len << 8) | (unsigned long)in[x++]; - } + if (in[x] < 0x81 || in[x] > 0x82) { + return CRYPT_INVALID_PACKET; + } + y = in[x++] & 0x7F; + len = 0; + while (y--) { + len = (len << 8) | (unsigned long)in[x++]; + } } if (len < 1 || (len + x) > inlen) { @@ -71,21 +71,21 @@ int der_decode_object_identifier(const unsigned char *in, unsigned long inle y = 0; t = 0; while (len--) { - t = (t << 7) | (in[x] & 0x7F); - if (!(in[x++] & 0x80)) { - /* store t */ - if (y >= *outlen) { - return CRYPT_BUFFER_OVERFLOW; - } - if (y == 0) { - words[0] = t / 40; - words[1] = t % 40; - y = 2; - } else { - words[y++] = t; + t = (t << 7) | (in[x] & 0x7F); + if (!(in[x++] & 0x80)) { + /* store t */ + if (y >= *outlen) { + return CRYPT_BUFFER_OVERFLOW; + } + if (y == 0) { + words[0] = t / 40; + words[1] = t % 40; + y = 2; + } else { + words[y++] = t; + } + t = 0; } - t = 0; - } } *outlen = y; diff --git a/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c b/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c index f018ba978..d9ebf8ea3 100644 --- a/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c @@ -71,33 +71,33 @@ int der_encode_object_identifier(unsigned long *words, unsigned long nwords, } /* store first byte */ - wordbuf = words[0] * 40 + words[1]; - for (i = 1; i < nwords; i++) { - /* store 7 bit words in little endian */ - t = wordbuf & 0xFFFFFFFF; - if (t) { - y = x; - mask = 0; - while (t) { - out[x++] = (unsigned char)((t & 0x7F) | mask); - t >>= 7; - mask |= 0x80; /* upper bit is set on all but the last byte */ - } - /* now swap bytes y...x-1 */ - z = x - 1; - while (y < z) { - t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t; - ++y; - --z; - } - } else { - /* zero word */ - out[x++] = 0x00; - } + wordbuf = words[0] * 40 + words[1]; + for (i = 1; i < nwords; i++) { + /* store 7 bit words in little endian */ + t = wordbuf & 0xFFFFFFFF; + if (t) { + y = x; + mask = 0; + while (t) { + out[x++] = (unsigned char)((t & 0x7F) | mask); + t >>= 7; + mask |= 0x80; /* upper bit is set on all but the last byte */ + } + /* now swap bytes y...x-1 */ + z = x - 1; + while (y < z) { + t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t; + ++y; + --z; + } + } else { + /* zero word */ + out[x++] = 0x00; + } - if (i < nwords - 1) { - wordbuf = words[i + 1]; - } + if (i < nwords - 1) { + wordbuf = words[i + 1]; + } } *outlen = x; diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 02aec22a7..d566e224d 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -72,19 +72,19 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, while (y--) { blksize = (blksize << 8) | (unsigned long)in[x++]; } - } + } - /* would this blksize overflow? */ - if (x + blksize > inlen) { - return CRYPT_INVALID_PACKET; - } + /* would this blksize overflow? */ + if (x + blksize > inlen) { + return CRYPT_INVALID_PACKET; + } /* mark all as unused */ for (i = 0; i < (int)outlen; i++) { list[i].used = 0; } - /* ok read data */ + /* ok read data */ inlen = blksize; for (i = 0; i < (int)outlen; i++) { z = 0; @@ -105,8 +105,8 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } if ((err = der_length_boolean(&z)) != CRYPT_OK) { goto LBL_ERR; - } - break; + } + break; case LTC_ASN1_INTEGER: z = inlen; diff --git a/src/pk/asn1/der/set/der_encode_setof.c b/src/pk/asn1/der/set/der_encode_setof.c index 022aca3ef..8add22b13 100644 --- a/src/pk/asn1/der/set/der_encode_setof.c +++ b/src/pk/asn1/der/set/der_encode_setof.c @@ -94,16 +94,16 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, } /* skip header */ - ptr = buf + 1; + ptr = buf + 1; - /* now skip length data */ - x = *ptr++; - if (x >= 0x80) { - ptr += (x & 0x7F); - } + /* now skip length data */ + x = *ptr++; + if (x >= 0x80) { + ptr += (x & 0x7F); + } - /* get the size of the static header */ - hdrlen = ptr - buf; + /* get the size of the static header */ + hdrlen = ptr - buf; /* scan for edges */ diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 64083031b..1793176a3 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -95,8 +95,8 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) tmpbuf = XCALLOC(1, tmpbuf_len); if (tmpbuf == NULL) { - err = CRYPT_MEM; - goto LBL_ERR; + err = CRYPT_MEM; + goto LBL_ERR; } err = der_decode_subject_public_key_info(in, inlen, @@ -112,7 +112,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) XFREE(tmpbuf); key->type = PK_PUBLIC; - } + } LBL_OK: key->qord = mp_unsigned_bin_size(key->q); diff --git a/src/pk/ecc/ltc_ecc_mul2add.c b/src/pk/ecc/ltc_ecc_mul2add.c index de4aac358..8b5932046 100644 --- a/src/pk/ecc/ltc_ecc_mul2add.c +++ b/src/pk/ecc/ltc_ecc_mul2add.c @@ -93,16 +93,16 @@ int ltc_ecc_mul2add(ecc_point *A, void *kA, } } - /* init montgomery reduction */ - if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { + /* init montgomery reduction */ + if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto ERR_P; - } - if ((err = mp_init(&mu)) != CRYPT_OK) { + } + if ((err = mp_init(&mu)) != CRYPT_OK) { goto ERR_MP; - } - if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { + } + if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto ERR_MU; - } + } /* copy ones ... */ if ((err = mp_mulmod(A->x, mu, modulus, precomp[1]->x)) != CRYPT_OK) { goto ERR_MU; } diff --git a/src/pk/ecc/ltc_ecc_mulmod_timing.c b/src/pk/ecc/ltc_ecc_mulmod_timing.c index ce4d9a41f..70182a3ca 100644 --- a/src/pk/ecc/ltc_ecc_mulmod_timing.c +++ b/src/pk/ecc/ltc_ecc_mulmod_timing.c @@ -61,8 +61,8 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) return err; } - /* alloc ram for window temps */ - for (i = 0; i < 3; i++) { + /* alloc ram for window temps */ + for (i = 0; i < 3; i++) { M[i] = ltc_ecc_new_point(); if (M[i] == NULL) { for (j = 0; j < i; j++) { @@ -72,7 +72,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) mp_montgomery_free(mp); return CRYPT_MEM; } - } + } /* make a copy of G incase R==G */ tG = ltc_ecc_new_point(); diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index 25a3b43f9..33d7f008d 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -311,8 +311,8 @@ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state } #ifndef LTC_SMALL_CODE - /* do lots at a time, if there's enough to do */ - while (outlen >= N*4) { + /* do lots at a time, if there's enough to do */ + while (outlen >= N*4) { SROUND(0); SROUND(1); SROUND(2); @@ -332,20 +332,20 @@ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state SROUND(16); out += 4*N; outlen -= 4*N; - } + } #endif - /* do small or odd size buffers the slow way */ - while (4 <= outlen) { + /* do small or odd size buffers the slow way */ + while (4 <= outlen) { cycle(c->R); t = nltap(c); XORWORD(t, out); out += 4; outlen -= 4; - } + } - /* handle any trailing bytes */ - if (outlen != 0) { + /* handle any trailing bytes */ + if (outlen != 0) { cycle(c->R); c->sbuf = nltap(c); c->nbuf = 32; @@ -355,9 +355,9 @@ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state c->nbuf -= 8; --outlen; } - } + } - return tlen; + return tlen; } /** From c22acc2d07bd9258579fc73c08faad055dc089e3 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 19 Dec 2015 17:34:25 +0100 Subject: [PATCH 0432/1192] remove useless include --- src/pk/asn1/der/sequence/der_decode_sequence_ex.c | 1 - src/pk/asn1/der/sequence/der_encode_sequence_ex.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index d566e224d..8a362b7ad 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -9,7 +9,6 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" -#include /** diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index 677ce53fe..0f17118bc 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -9,7 +9,6 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" -#include /** From 9749958fe59abb582e3ed32eea0fbaa9548e278d Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 19 Dec 2015 17:51:44 +0100 Subject: [PATCH 0433/1192] the comment FALLTHROUGH is common for several lint tool --- src/ciphers/multi2.c | 6 +++--- src/ciphers/twofish/twofish.c | 3 +++ src/misc/adler32.c | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index d1e4a6c79..d77c9a668 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -96,9 +96,9 @@ static void decrypt(ulong32 *p, int N, ulong32 *uk) int n, t; for (t = 4*(((N-1)>>2)&1), n = N; ; ) { switch (n<=4 ? n : ((n-1)%4)+1) { - case 4: pi4(p, uk+t); --n; - case 3: pi3(p, uk+t); --n; - case 2: pi2(p, uk+t); --n; + case 4: pi4(p, uk+t); --n; /* FALLTHROUGH */ + case 3: pi3(p, uk+t); --n; /* FALLTHROUGH */ + case 2: pi2(p, uk+t); --n; /* FALLTHROUGH */ case 1: pi1(p); --n; break; case 0: return; } diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index 8db396c64..b2b41bb20 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -252,16 +252,19 @@ static void h_func(const unsigned char *in, unsigned char *out, unsigned char *M y[1] = (unsigned char)(sbox(0, (ulong32)y[1]) ^ M[4 * (6 + offset) + 1]); y[2] = (unsigned char)(sbox(0, (ulong32)y[2]) ^ M[4 * (6 + offset) + 2]); y[3] = (unsigned char)(sbox(1, (ulong32)y[3]) ^ M[4 * (6 + offset) + 3]); + /* FALLTHROUGH */ case 3: y[0] = (unsigned char)(sbox(1, (ulong32)y[0]) ^ M[4 * (4 + offset) + 0]); y[1] = (unsigned char)(sbox(1, (ulong32)y[1]) ^ M[4 * (4 + offset) + 1]); y[2] = (unsigned char)(sbox(0, (ulong32)y[2]) ^ M[4 * (4 + offset) + 2]); y[3] = (unsigned char)(sbox(0, (ulong32)y[3]) ^ M[4 * (4 + offset) + 3]); + /* FALLTHROUGH */ case 2: y[0] = (unsigned char)(sbox(1, sbox(0, sbox(0, (ulong32)y[0]) ^ M[4 * (2 + offset) + 0]) ^ M[4 * (0 + offset) + 0])); y[1] = (unsigned char)(sbox(0, sbox(0, sbox(1, (ulong32)y[1]) ^ M[4 * (2 + offset) + 1]) ^ M[4 * (0 + offset) + 1])); y[2] = (unsigned char)(sbox(1, sbox(1, sbox(0, (ulong32)y[2]) ^ M[4 * (2 + offset) + 2]) ^ M[4 * (0 + offset) + 2])); y[3] = (unsigned char)(sbox(0, sbox(1, sbox(1, (ulong32)y[3]) ^ M[4 * (2 + offset) + 3]) ^ M[4 * (0 + offset) + 3])); + /* FALLTHROUGH */ } mds_mult(y, out); } diff --git a/src/misc/adler32.c b/src/misc/adler32.c index 3e6f4e546..48f404ccb 100644 --- a/src/misc/adler32.c +++ b/src/misc/adler32.c @@ -89,16 +89,16 @@ void adler32_finish(adler32_state *ctx, void *hash, unsigned long size) switch (size) { default: h[3] = ctx->s[0] & 0x0ff; - /* no break */ + /* FALLTHROUGH */ case 3: h[2] = (ctx->s[0] >> 8) & 0x0ff; - /* no break */ + /* FALLTHROUGH */ case 2: h[1] = ctx->s[1] & 0x0ff; - /* no break */ + /* FALLTHROUGH */ case 1: h[0] = (ctx->s[1] >> 8) & 0x0ff; - /* no break */ + /* FALLTHROUGH */ case 0: ; } From cebf33cdcedde158d3977cc14d42017450ac6b7a Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 19 Dec 2015 17:52:30 +0100 Subject: [PATCH 0434/1192] add some const --- src/ciphers/camellia.c | 2 +- src/misc/base64/base64_encode.c | 4 ++-- src/misc/error_to_string.c | 2 +- src/pk/asn1/der/utctime/der_encode_utctime.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index e7910513c..ad8f501c7 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -171,7 +171,7 @@ static const ulong32 SP4404[] = { 0x28280028, 0x7b7b007b, 0xc9c900c9, 0xc1c100c1, 0xe3e300e3, 0xf4f400f4, 0xc7c700c7, 0x9e9e009e, }; -static ulong64 key_sigma[] = { +static const ulong64 key_sigma[] = { CONST64(0xA09E667F3BCC908B), CONST64(0xB67AE8584CAA73B2), CONST64(0xC6EF372FE94F82BE), diff --git a/src/misc/base64/base64_encode.c b/src/misc/base64/base64_encode.c index 0e1a7c132..0ed0aa3e5 100644 --- a/src/misc/base64/base64_encode.c +++ b/src/misc/base64/base64_encode.c @@ -20,12 +20,12 @@ #if defined(LTC_BASE64) || defined (LTC_BASE64_URL) #if defined(LTC_BASE64) -static const char *codes_base64 = +static const char * const codes_base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; #endif /* LTC_BASE64 */ #if defined(LTC_BASE64_URL) -static const char *codes_base64url = +static const char * const codes_base64url = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; #endif /* LTC_BASE64_URL */ diff --git a/src/misc/error_to_string.c b/src/misc/error_to_string.c index 19f878191..7ebd89879 100644 --- a/src/misc/error_to_string.c +++ b/src/misc/error_to_string.c @@ -16,7 +16,7 @@ Convert error codes to ASCII strings, Tom St Denis */ -static const char *err_2_str[] = +static const char * const err_2_str[] = { "CRYPT_OK", "CRYPT_ERROR", diff --git a/src/pk/asn1/der/utctime/der_encode_utctime.c b/src/pk/asn1/der/utctime/der_encode_utctime.c index f8d0c5658..0dcac8a86 100644 --- a/src/pk/asn1/der/utctime/der_encode_utctime.c +++ b/src/pk/asn1/der/utctime/der_encode_utctime.c @@ -17,7 +17,7 @@ #ifdef LTC_DER -static const char *baseten = "0123456789"; +static const char * const baseten = "0123456789"; #define STORE_V(y) \ out[x++] = der_ia5_char_encode(baseten[(y/10) % 10]); \ From 9f8df116bee3b8f2b64e5b131f3ec636fb14a5cc Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 19 Dec 2015 17:53:07 +0100 Subject: [PATCH 0435/1192] remove useless code --- src/prngs/rng_get_bytes.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 19c8a78ec..f0536f6ee 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -80,7 +80,6 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len, acc = 0; bits = 8; } - acc = bits = a = b = 0; return l; } From 5d7036ebe2b458bbbcc2b3d1039e8021a9e1f253 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 20 Dec 2015 17:01:18 +0100 Subject: [PATCH 0436/1192] remove hard tab --- src/encauth/ccm/ccm_add_nonce.c | 4 +- src/encauth/ocb3/ocb3_test.c | 256 ++++++++++++++++---------------- src/headers/tomcrypt_hash.h | 2 +- src/headers/tomcrypt_pk.h | 4 +- src/math/fp/ltc_ecc_fp_mulmod.c | 12 +- src/pk/dh/dh.c | 8 +- 6 files changed, 143 insertions(+), 143 deletions(-) diff --git a/src/encauth/ccm/ccm_add_nonce.c b/src/encauth/ccm/ccm_add_nonce.c index fc4eafc27..0f67fc241 100644 --- a/src/encauth/ccm/ccm_add_nonce.c +++ b/src/encauth/ccm/ccm_add_nonce.c @@ -42,8 +42,8 @@ int ccm_add_nonce(ccm_state *ccm, /* form B_0 == flags | Nonce N | l(m) */ x = 0; ccm->PAD[x++] = (unsigned char)(((ccm->aadlen > 0) ? (1<<6) : 0) | - (((ccm->taglen - 2)>>1)<<3) | - (ccm->L-1)); + (((ccm->taglen - 2)>>1)<<3) | + (ccm->L-1)); /* nonce */ for (y = 0; y < (16 - (ccm->L + 1)); y++) { diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index ae0069c33..d59d005d0 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -35,134 +35,134 @@ int ocb3_test(void) unsigned char pt[64], aad[64], ct[64], tag[16]; } tests[] = { - { /* index:0 */ - 0, /* PLAINTEXT length */ - 0, /* AAD length */ - { }, /* PLAINTEXT */ - { }, /* AAD */ - { }, /* CIPHERTEXT */ - { 0x19,0x7b,0x9c,0x3c,0x44,0x1d,0x3c,0x83,0xea,0xfb,0x2b,0xef,0x63,0x3b,0x91,0x82 }, /* TAG */ - }, - { /* index:1 */ - 8, /* PLAINTEXT length */ - 8, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* AAD */ - { 0x92,0xb6,0x57,0x13,0x0a,0x74,0xb8,0x5a }, /* CIPHERTEXT */ - { 0x16,0xdc,0x76,0xa4,0x6d,0x47,0xe1,0xea,0xd5,0x37,0x20,0x9e,0x8a,0x96,0xd1,0x4e }, /* TAG */ - }, - { /* index:2 */ - 0, /* PLAINTEXT length */ - 8, /* AAD length */ - { }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* AAD */ - { }, /* CIPHERTEXT */ - { 0x98,0xb9,0x15,0x52,0xc8,0xc0,0x09,0x18,0x50,0x44,0xe3,0x0a,0x6e,0xb2,0xfe,0x21 }, /* TAG */ - }, - { /* index:3 */ - 8, /* PLAINTEXT length */ - 0, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* PLAINTEXT */ - { }, /* AAD */ - { 0x92,0xb6,0x57,0x13,0x0a,0x74,0xb8,0x5a }, /* CIPHERTEXT */ - { 0x97,0x1e,0xff,0xca,0xe1,0x9a,0xd4,0x71,0x6f,0x88,0xe8,0x7b,0x87,0x1f,0xbe,0xed }, /* TAG */ - }, - { /* index:4 */ - 16, /* PLAINTEXT length */ - 16, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* AAD */ - { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22 }, /* CIPHERTEXT */ - { 0x77,0x6c,0x99,0x24,0xd6,0x72,0x3a,0x1f,0xc4,0x52,0x45,0x32,0xac,0x3e,0x5b,0xeb }, /* TAG */ - }, - { /* index:5 */ - 0, /* PLAINTEXT length */ - 16, /* AAD length */ - { }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* AAD */ - { }, /* CIPHERTEXT */ - { 0x7d,0xdb,0x8e,0x6c,0xea,0x68,0x14,0x86,0x62,0x12,0x50,0x96,0x19,0xb1,0x9c,0xc6 }, /* TAG */ - }, - { /* index:6 */ - 16, /* PLAINTEXT length */ - 0, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* PLAINTEXT */ - { }, /* AAD */ - { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22 }, /* CIPHERTEXT */ - { 0x13,0xcc,0x8b,0x74,0x78,0x07,0x12,0x1a,0x4c,0xbb,0x3e,0x4b,0xd6,0xb4,0x56,0xaf }, /* TAG */ - }, - { /* index:7 */ - 24, /* PLAINTEXT length */ - 24, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* AAD */ - { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xfc,0xfc,0xee,0x7a,0x2a,0x8d,0x4d,0x48 }, /* CIPHERTEXT */ - { 0x5f,0xa9,0x4f,0xc3,0xf3,0x88,0x20,0xf1,0xdc,0x3f,0x3d,0x1f,0xd4,0xe5,0x5e,0x1c }, /* TAG */ - }, - { /* index:8 */ - 0, /* PLAINTEXT length */ - 24, /* AAD length */ - { }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* AAD */ - { }, /* CIPHERTEXT */ - { 0x28,0x20,0x26,0xda,0x30,0x68,0xbc,0x9f,0xa1,0x18,0x68,0x1d,0x55,0x9f,0x10,0xf6 }, /* TAG */ - }, - { /* index:9 */ - 24, /* PLAINTEXT length */ - 0, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* PLAINTEXT */ - { }, /* AAD */ - { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xfc,0xfc,0xee,0x7a,0x2a,0x8d,0x4d,0x48 }, /* CIPHERTEXT */ - { 0x6e,0xf2,0xf5,0x25,0x87,0xfd,0xa0,0xed,0x97,0xdc,0x7e,0xed,0xe2,0x41,0xdf,0x68 }, /* TAG */ - }, - { /* index:10 */ - 32, /* PLAINTEXT length */ - 32, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* AAD */ - { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb }, /* CIPHERTEXT */ - { 0xb2,0xa0,0x40,0xdd,0x3b,0xd5,0x16,0x43,0x72,0xd7,0x6d,0x7b,0xb6,0x82,0x42,0x40 }, /* TAG */ - }, - { /* index:11 */ - 0, /* PLAINTEXT length */ - 32, /* AAD length */ - { }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* AAD */ - { }, /* CIPHERTEXT */ - { 0xe1,0xe0,0x72,0x63,0x3b,0xad,0xe5,0x1a,0x60,0xe8,0x59,0x51,0xd9,0xc4,0x2a,0x1b }, /* TAG */ - }, - { /* index:12 */ - 32, /* PLAINTEXT length */ - 0, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* PLAINTEXT */ - { }, /* AAD */ - { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb }, /* CIPHERTEXT */ - { 0x4a,0x3b,0xae,0x82,0x44,0x65,0xcf,0xda,0xf8,0xc4,0x1f,0xc5,0x0c,0x7d,0xf9,0xd9 }, /* TAG */ - }, - { /* index:13 */ - 40, /* PLAINTEXT length */ - 40, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* AAD */ - { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb,0x68,0xc6,0x57,0x78,0xb0,0x58,0xa6,0x35 }, /* CIPHERTEXT */ - { 0x65,0x9c,0x62,0x32,0x11,0xde,0xea,0x0d,0xe3,0x0d,0x2c,0x38,0x18,0x79,0xf4,0xc8 }, /* TAG */ - }, - { /* index:14 */ - 0, /* PLAINTEXT length */ - 40, /* AAD length */ - { }, /* PLAINTEXT */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* AAD */ - { }, /* CIPHERTEXT */ - { 0x7a,0xeb,0x7a,0x69,0xa1,0x68,0x7d,0xd0,0x82,0xca,0x27,0xb0,0xd9,0xa3,0x70,0x96 }, /* TAG */ - }, - { /* index:15 */ - 40, /* PLAINTEXT length */ - 0, /* AAD length */ - { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* PLAINTEXT */ - { }, /* AAD */ - { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb,0x68,0xc6,0x57,0x78,0xb0,0x58,0xa6,0x35 }, /* CIPHERTEXT */ - { 0x06,0x0c,0x84,0x67,0xf4,0xab,0xab,0x5e,0x8b,0x3c,0x20,0x67,0xa2,0xe1,0x15,0xdc }, /* TAG */ - }, + { /* index:0 */ + 0, /* PLAINTEXT length */ + 0, /* AAD length */ + { }, /* PLAINTEXT */ + { }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x19,0x7b,0x9c,0x3c,0x44,0x1d,0x3c,0x83,0xea,0xfb,0x2b,0xef,0x63,0x3b,0x91,0x82 }, /* TAG */ + }, + { /* index:1 */ + 8, /* PLAINTEXT length */ + 8, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* AAD */ + { 0x92,0xb6,0x57,0x13,0x0a,0x74,0xb8,0x5a }, /* CIPHERTEXT */ + { 0x16,0xdc,0x76,0xa4,0x6d,0x47,0xe1,0xea,0xd5,0x37,0x20,0x9e,0x8a,0x96,0xd1,0x4e }, /* TAG */ + }, + { /* index:2 */ + 0, /* PLAINTEXT length */ + 8, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x98,0xb9,0x15,0x52,0xc8,0xc0,0x09,0x18,0x50,0x44,0xe3,0x0a,0x6e,0xb2,0xfe,0x21 }, /* TAG */ + }, + { /* index:3 */ + 8, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* PLAINTEXT */ + { }, /* AAD */ + { 0x92,0xb6,0x57,0x13,0x0a,0x74,0xb8,0x5a }, /* CIPHERTEXT */ + { 0x97,0x1e,0xff,0xca,0xe1,0x9a,0xd4,0x71,0x6f,0x88,0xe8,0x7b,0x87,0x1f,0xbe,0xed }, /* TAG */ + }, + { /* index:4 */ + 16, /* PLAINTEXT length */ + 16, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22 }, /* CIPHERTEXT */ + { 0x77,0x6c,0x99,0x24,0xd6,0x72,0x3a,0x1f,0xc4,0x52,0x45,0x32,0xac,0x3e,0x5b,0xeb }, /* TAG */ + }, + { /* index:5 */ + 0, /* PLAINTEXT length */ + 16, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x7d,0xdb,0x8e,0x6c,0xea,0x68,0x14,0x86,0x62,0x12,0x50,0x96,0x19,0xb1,0x9c,0xc6 }, /* TAG */ + }, + { /* index:6 */ + 16, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* PLAINTEXT */ + { }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22 }, /* CIPHERTEXT */ + { 0x13,0xcc,0x8b,0x74,0x78,0x07,0x12,0x1a,0x4c,0xbb,0x3e,0x4b,0xd6,0xb4,0x56,0xaf }, /* TAG */ + }, + { /* index:7 */ + 24, /* PLAINTEXT length */ + 24, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xfc,0xfc,0xee,0x7a,0x2a,0x8d,0x4d,0x48 }, /* CIPHERTEXT */ + { 0x5f,0xa9,0x4f,0xc3,0xf3,0x88,0x20,0xf1,0xdc,0x3f,0x3d,0x1f,0xd4,0xe5,0x5e,0x1c }, /* TAG */ + }, + { /* index:8 */ + 0, /* PLAINTEXT length */ + 24, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x28,0x20,0x26,0xda,0x30,0x68,0xbc,0x9f,0xa1,0x18,0x68,0x1d,0x55,0x9f,0x10,0xf6 }, /* TAG */ + }, + { /* index:9 */ + 24, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* PLAINTEXT */ + { }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xfc,0xfc,0xee,0x7a,0x2a,0x8d,0x4d,0x48 }, /* CIPHERTEXT */ + { 0x6e,0xf2,0xf5,0x25,0x87,0xfd,0xa0,0xed,0x97,0xdc,0x7e,0xed,0xe2,0x41,0xdf,0x68 }, /* TAG */ + }, + { /* index:10 */ + 32, /* PLAINTEXT length */ + 32, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb }, /* CIPHERTEXT */ + { 0xb2,0xa0,0x40,0xdd,0x3b,0xd5,0x16,0x43,0x72,0xd7,0x6d,0x7b,0xb6,0x82,0x42,0x40 }, /* TAG */ + }, + { /* index:11 */ + 0, /* PLAINTEXT length */ + 32, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0xe1,0xe0,0x72,0x63,0x3b,0xad,0xe5,0x1a,0x60,0xe8,0x59,0x51,0xd9,0xc4,0x2a,0x1b }, /* TAG */ + }, + { /* index:12 */ + 32, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* PLAINTEXT */ + { }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb }, /* CIPHERTEXT */ + { 0x4a,0x3b,0xae,0x82,0x44,0x65,0xcf,0xda,0xf8,0xc4,0x1f,0xc5,0x0c,0x7d,0xf9,0xd9 }, /* TAG */ + }, + { /* index:13 */ + 40, /* PLAINTEXT length */ + 40, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb,0x68,0xc6,0x57,0x78,0xb0,0x58,0xa6,0x35 }, /* CIPHERTEXT */ + { 0x65,0x9c,0x62,0x32,0x11,0xde,0xea,0x0d,0xe3,0x0d,0x2c,0x38,0x18,0x79,0xf4,0xc8 }, /* TAG */ + }, + { /* index:14 */ + 0, /* PLAINTEXT length */ + 40, /* AAD length */ + { }, /* PLAINTEXT */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* AAD */ + { }, /* CIPHERTEXT */ + { 0x7a,0xeb,0x7a,0x69,0xa1,0x68,0x7d,0xd0,0x82,0xca,0x27,0xb0,0xd9,0xa3,0x70,0x96 }, /* TAG */ + }, + { /* index:15 */ + 40, /* PLAINTEXT length */ + 0, /* AAD length */ + { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* PLAINTEXT */ + { }, /* AAD */ + { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb,0x68,0xc6,0x57,0x78,0xb0,0x58,0xa6,0x35 }, /* CIPHERTEXT */ + { 0x06,0x0c,0x84,0x67,0xf4,0xab,0xab,0x5e,0x8b,0x3c,0x20,0x67,0xa2,0xe1,0x15,0xdc }, /* TAG */ + }, }; diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index c5a4d8187..22b922ed0 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -373,7 +373,7 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen) if (md-> state_var .curlen > sizeof(md-> state_var .buf)) { \ return CRYPT_INVALID_ARG; \ } \ - if ((md-> state_var .length + inlen) < md-> state_var .length) { \ + if ((md-> state_var .length + inlen) < md-> state_var .length) { \ return CRYPT_HASH_OVERFLOW; \ } \ while (inlen > 0) { \ diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 1366931f3..c457ce8fa 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -261,8 +261,8 @@ typedef struct { /** Index into the ltc_ecc_sets[] for the parameters of this curve; if -1, then this key is using user supplied curve in dp */ int idx; - /** pointer to domain parameters; either points to NIST curves (identified by idx >= 0) or user supplied curve */ - const ltc_ecc_set_type *dp; + /** pointer to domain parameters; either points to NIST curves (identified by idx >= 0) or user supplied curve */ + const ltc_ecc_set_type *dp; /** The public key */ ecc_point pubkey; diff --git a/src/math/fp/ltc_ecc_fp_mulmod.c b/src/math/fp/ltc_ecc_fp_mulmod.c index b9819e370..87c128fc9 100644 --- a/src/math/fp/ltc_ecc_fp_mulmod.c +++ b/src/math/fp/ltc_ecc_fp_mulmod.c @@ -1363,7 +1363,7 @@ ltc_ecc_fp_add_point(ecc_point *g, void *modulus, int lock) if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto LBL_ERR; } - + /* build the LUT */ if ((err = build_lut(idx, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR; @@ -1429,9 +1429,9 @@ int ltc_ecc_fp_save_state(unsigned char **out, unsigned long *outlen) * */ /* - * The cache itself is a point (3 INTEGERS), - * the LUT as pairs of INTEGERS (2 * 1<x ) { - mp_clear( key->x ); - key->x = NULL; + mp_clear( key->x ); + key->x = NULL; } if ( key->y ) { - mp_clear( key->y ); - key->y = NULL; + mp_clear( key->y ); + key->y = NULL; } } From 58353f51e2949d9c7009f8231cc55357cc42ac9c Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 20 Dec 2015 17:05:58 +0100 Subject: [PATCH 0437/1192] remove trailing spaces --- src/encauth/ccm/ccm_test.c | 2 +- src/encauth/eax/eax_addheader.c | 10 +- src/encauth/eax/eax_decrypt.c | 8 +- src/encauth/eax/eax_decrypt_verify_memory.c | 4 +- src/encauth/eax/eax_done.c | 4 +- src/encauth/eax/eax_encrypt.c | 6 +- .../eax/eax_encrypt_authenticate_memory.c | 10 +- src/encauth/eax/eax_init.c | 32 +- src/encauth/eax/eax_test.c | 26 +- src/encauth/gcm/gcm_done.c | 2 +- src/encauth/gcm/gcm_gf_mult.c | 18 +- src/encauth/gcm/gcm_init.c | 2 +- src/encauth/gcm/gcm_memory.c | 8 +- src/encauth/gcm/gcm_reset.c | 2 +- src/encauth/gcm/gcm_test.c | 196 +-- src/encauth/ocb/ocb_decrypt.c | 4 +- src/encauth/ocb/ocb_decrypt_verify_memory.c | 12 +- src/encauth/ocb/ocb_done_decrypt.c | 6 +- src/encauth/ocb/ocb_done_encrypt.c | 4 +- src/encauth/ocb/ocb_encrypt.c | 2 +- .../ocb/ocb_encrypt_authenticate_memory.c | 4 +- src/encauth/ocb/ocb_init.c | 12 +- src/encauth/ocb/ocb_shift_xor.c | 4 +- src/encauth/ocb/ocb_test.c | 26 +- src/encauth/ocb/s_ocb_done.c | 16 +- src/hashes/helper/hash_file.c | 4 +- src/hashes/helper/hash_filehandle.c | 6 +- src/hashes/md2.c | 18 +- src/hashes/md4.c | 136 +- src/hashes/md5.c | 30 +- src/hashes/rmd128.c | 22 +- src/hashes/rmd160.c | 18 +- src/hashes/sha1.c | 18 +- src/hashes/sha2/sha256.c | 30 +- src/hashes/sha2/sha512.c | 52 +- src/hashes/tiger.c | 68 +- src/mac/f9/f9_done.c | 2 +- src/mac/f9/f9_file.c | 4 +- src/mac/f9/f9_init.c | 4 +- src/mac/f9/f9_memory.c | 4 +- src/mac/f9/f9_memory_multi.c | 10 +- src/mac/f9/f9_test.c | 4 +- src/mac/pelican/pelican_memory.c | 10 +- src/mac/pelican/pelican_test.c | 18 +- src/mac/pmac/pmac_done.c | 4 +- src/mac/pmac/pmac_file.c | 10 +- src/mac/pmac/pmac_memory.c | 10 +- src/mac/pmac/pmac_memory_multi.c | 12 +- src/mac/pmac/pmac_ntz.c | 4 +- src/mac/pmac/pmac_shift_xor.c | 4 +- src/mac/pmac/pmac_test.c | 14 +- src/mac/xcbc/xcbc_done.c | 2 +- src/mac/xcbc/xcbc_file.c | 6 +- src/mac/xcbc/xcbc_init.c | 8 +- src/mac/xcbc/xcbc_memory.c | 4 +- src/mac/xcbc/xcbc_memory_multi.c | 10 +- src/mac/xcbc/xcbc_test.c | 32 +- src/math/fp/ltc_ecc_fp_mulmod.c | 1258 ++++++++--------- src/math/rand_prime.c | 12 +- src/misc/crypt/crypt_find_cipher_any.c | 2 +- src/misc/crypt/crypt_find_hash_any.c | 2 +- src/misc/crypt/crypt_fsa.c | 6 +- src/misc/crypt/crypt_hash_descriptor.c | 2 +- src/misc/crypt/crypt_hash_is_valid.c | 2 +- src/misc/crypt/crypt_prng_descriptor.c | 2 +- src/misc/crypt/crypt_register_prng.c | 2 +- src/misc/error_to_string.c | 2 +- src/modes/cbc/cbc_done.c | 2 +- src/modes/cbc/cbc_setiv.c | 2 +- src/modes/cbc/cbc_start.c | 6 +- src/modes/cfb/cfb_decrypt.c | 2 +- src/modes/cfb/cfb_done.c | 2 +- src/modes/cfb/cfb_encrypt.c | 2 +- src/modes/cfb/cfb_setiv.c | 10 +- src/modes/cfb/cfb_start.c | 6 +- src/modes/ctr/ctr_done.c | 2 +- src/modes/ctr/ctr_setiv.c | 10 +- src/modes/ctr/ctr_start.c | 10 +- src/modes/ctr/ctr_test.c | 2 +- src/modes/ecb/ecb_done.c | 2 +- src/modes/ecb/ecb_start.c | 2 +- src/modes/f8/f8_decrypt.c | 2 +- src/modes/f8/f8_done.c | 2 +- src/modes/f8/f8_setiv.c | 2 +- src/modes/f8/f8_start.c | 18 +- src/modes/f8/f8_test_mode.c | 28 +- src/modes/lrw/lrw_done.c | 4 +- src/modes/lrw/lrw_encrypt.c | 2 +- src/modes/lrw/lrw_start.c | 6 +- src/modes/lrw/lrw_test.c | 2 +- src/modes/ofb/ofb_decrypt.c | 2 +- src/modes/ofb/ofb_done.c | 2 +- src/modes/ofb/ofb_encrypt.c | 4 +- src/modes/ofb/ofb_setiv.c | 2 +- src/modes/ofb/ofb_start.c | 4 +- src/pk/asn1/der/bit/der_decode_bit_string.c | 2 +- src/pk/asn1/der/bit/der_length_bit_string.c | 4 +- src/pk/asn1/der/boolean/der_decode_boolean.c | 6 +- src/pk/asn1/der/boolean/der_encode_boolean.c | 8 +- src/pk/asn1/der/boolean/der_length_boolean.c | 2 +- src/pk/asn1/der/ia5/der_decode_ia5_string.c | 2 +- src/pk/asn1/der/ia5/der_encode_ia5_string.c | 2 +- src/pk/asn1/der/ia5/der_length_ia5_string.c | 206 +-- src/pk/asn1/der/integer/der_decode_integer.c | 6 +- src/pk/asn1/der/integer/der_encode_integer.c | 6 +- .../der_decode_object_identifier.c | 6 +- .../der_encode_object_identifier.c | 8 +- .../der_length_object_identifier.c | 4 +- .../asn1/der/octet/der_decode_octet_string.c | 2 +- .../asn1/der/octet/der_encode_octet_string.c | 2 +- .../asn1/der/octet/der_length_octet_string.c | 2 +- .../der_decode_printable_string.c | 2 +- .../der_encode_printable_string.c | 2 +- .../der_length_printable_string.c | 154 +- src/pk/asn1/der/sequence/der_sequence_free.c | 14 +- .../short_integer/der_encode_short_integer.c | 6 +- .../short_integer/der_length_short_integer.c | 10 +- .../der_length_teletex_string.c | 226 +-- src/pk/asn1/der/utctime/der_decode_utctime.c | 4 +- src/pk/asn1/der/utctime/der_encode_utctime.c | 8 +- src/pk/asn1/der/utf8/der_decode_utf8_string.c | 6 +- src/pk/asn1/der/utf8/der_length_utf8_string.c | 2 +- src/pk/dsa/dsa_decrypt_key.c | 16 +- src/pk/dsa/dsa_encrypt_key.c | 20 +- src/pk/dsa/dsa_shared_secret.c | 6 +- src/pk/dsa/dsa_sign_hash.c | 8 +- src/pk/dsa/dsa_verify_hash.c | 12 +- src/pk/dsa/dsa_verify_key.c | 2 +- src/pk/ecc/ecc_ansi_x963_import.c | 8 +- src/pk/ecc/ecc_decrypt_key.c | 10 +- src/pk/ecc/ecc_encrypt_key.c | 16 +- src/pk/ecc/ecc_export.c | 4 +- src/pk/ecc/ecc_free.c | 2 +- src/pk/ecc/ecc_get_size.c | 4 +- src/pk/ecc/ecc_import.c | 20 +- src/pk/ecc/ecc_make_key.c | 4 +- src/pk/ecc/ecc_shared_secret.c | 2 +- src/pk/ecc/ecc_sign_hash.c | 10 +- src/pk/ecc/ecc_sizes.c | 2 +- src/pk/ecc/ecc_verify_hash.c | 12 +- src/pk/ecc/ltc_ecc_is_valid_idx.c | 4 +- src/pk/ecc/ltc_ecc_map.c | 4 +- src/pk/ecc/ltc_ecc_mul2add.c | 14 +- src/pk/ecc/ltc_ecc_points.c | 4 +- src/pk/katja/katja_free.c | 2 +- src/pk/katja/katja_make_key.c | 8 +- src/pk/pkcs1/pkcs_1_os2ip.c | 4 +- src/pk/rsa/rsa_free.c | 2 +- src/pk/rsa/rsa_sign_hash.c | 4 +- src/prngs/fortuna.c | 58 +- src/prngs/rc4.c | 36 +- 151 files changed, 1714 insertions(+), 1714 deletions(-) diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 7d1353a0a..51bc4afb5 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -118,7 +118,7 @@ int ccm_test(void) int err, idx; symmetric_key skey; ccm_state ccm; - + zeromem(zero, 64); idx = find_cipher("aes"); diff --git a/src/encauth/eax/eax_addheader.c b/src/encauth/eax/eax_addheader.c index d06e921c0..3c1d79b83 100644 --- a/src/encauth/eax/eax_addheader.c +++ b/src/encauth/eax/eax_addheader.c @@ -8,22 +8,22 @@ * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file eax_addheader.c - EAX implementation, add meta-data, by Tom St Denis + EAX implementation, add meta-data, by Tom St Denis */ #include "tomcrypt.h" #ifdef LTC_EAX_MODE -/** - add header (metadata) to the stream +/** + add header (metadata) to the stream @param eax The current EAX state @param header The header (meta-data) data you wish to add to the state @param length The length of the header data @return CRYPT_OK if successful */ -int eax_addheader(eax_state *eax, const unsigned char *header, +int eax_addheader(eax_state *eax, const unsigned char *header, unsigned long length) { LTC_ARGCHK(eax != NULL); diff --git a/src/encauth/eax/eax_decrypt.c b/src/encauth/eax/eax_decrypt.c index 185330ff4..512b5b708 100644 --- a/src/encauth/eax/eax_decrypt.c +++ b/src/encauth/eax/eax_decrypt.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file eax_decrypt.c EAX implementation, decrypt block, by Tom St Denis */ @@ -17,7 +17,7 @@ #ifdef LTC_EAX_MODE -/** +/** Decrypt data with the EAX protocol @param eax The EAX state @param ct The ciphertext @@ -25,11 +25,11 @@ @param length The length (octets) of the ciphertext @return CRYPT_OK if successful */ -int eax_decrypt(eax_state *eax, const unsigned char *ct, unsigned char *pt, +int eax_decrypt(eax_state *eax, const unsigned char *ct, unsigned char *pt, unsigned long length) { int err; - + LTC_ARGCHK(eax != NULL); LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); diff --git a/src/encauth/eax/eax_decrypt_verify_memory.c b/src/encauth/eax/eax_decrypt_verify_memory.c index 7956142f7..be07cf52d 100644 --- a/src/encauth/eax/eax_decrypt_verify_memory.c +++ b/src/encauth/eax/eax_decrypt_verify_memory.c @@ -77,7 +77,7 @@ int eax_decrypt_verify_memory(int cipher, if ((err = eax_decrypt(eax, ct, pt, ctlen)) != CRYPT_OK) { goto LBL_ERR; } - + buflen = taglen; if ((err = eax_done(eax, buf, &buflen)) != CRYPT_OK) { goto LBL_ERR; @@ -87,7 +87,7 @@ int eax_decrypt_verify_memory(int cipher, if (buflen >= taglen && XMEMCMP(buf, tag, taglen) == 0) { *stat = 1; } - + err = CRYPT_OK; LBL_ERR: #ifdef LTC_CLEAN_STACK diff --git a/src/encauth/eax/eax_done.c b/src/encauth/eax/eax_done.c index 0bb0b3324..cac609344 100644 --- a/src/encauth/eax/eax_done.c +++ b/src/encauth/eax/eax_done.c @@ -51,7 +51,7 @@ int eax_done(eax_state *eax, unsigned char *tag, unsigned long *taglen) /* finish ctomac */ len = MAXBLOCKSIZE; if ((err = omac_done(&eax->ctomac, ctmac, &len)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* finish headeromac */ @@ -59,7 +59,7 @@ int eax_done(eax_state *eax, unsigned char *tag, unsigned long *taglen) /* note we specifically don't reset len so the two lens are minimal */ if ((err = omac_done(&eax->headeromac, headermac, &len)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* terminate the CTR chain */ diff --git a/src/encauth/eax/eax_encrypt.c b/src/encauth/eax/eax_encrypt.c index 79f9dc568..29eb6ee88 100644 --- a/src/encauth/eax/eax_encrypt.c +++ b/src/encauth/eax/eax_encrypt.c @@ -11,7 +11,7 @@ /** @file eax_encrypt.c - EAX implementation, encrypt block by Tom St Denis + EAX implementation, encrypt block by Tom St Denis */ #include "tomcrypt.h" @@ -25,11 +25,11 @@ @param length The length of the plaintext (octets) @return CRYPT_OK if successful */ -int eax_encrypt(eax_state *eax, const unsigned char *pt, unsigned char *ct, +int eax_encrypt(eax_state *eax, const unsigned char *pt, unsigned char *ct, unsigned long length) { int err; - + LTC_ARGCHK(eax != NULL); LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); diff --git a/src/encauth/eax/eax_encrypt_authenticate_memory.c b/src/encauth/eax/eax_encrypt_authenticate_memory.c index fc58ce63e..4b4815f8a 100644 --- a/src/encauth/eax/eax_encrypt_authenticate_memory.c +++ b/src/encauth/eax/eax_encrypt_authenticate_memory.c @@ -53,15 +53,15 @@ int eax_encrypt_authenticate_memory(int cipher, eax = XMALLOC(sizeof(*eax)); if ((err = eax_init(eax, cipher, key, keylen, nonce, noncelen, header, headerlen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } if ((err = eax_encrypt(eax, pt, ct, ptlen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } - + if ((err = eax_done(eax, tag, taglen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } err = CRYPT_OK; @@ -72,7 +72,7 @@ int eax_encrypt_authenticate_memory(int cipher, XFREE(eax); - return err; + return err; } #endif diff --git a/src/encauth/eax/eax_init.c b/src/encauth/eax/eax_init.c index 563eabf9b..55d8df1b2 100644 --- a/src/encauth/eax/eax_init.c +++ b/src/encauth/eax/eax_init.c @@ -9,15 +9,15 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file eax_init.c - EAX implementation, initialized EAX state, by Tom St Denis + EAX implementation, initialized EAX state, by Tom St Denis */ #include "tomcrypt.h" #ifdef LTC_EAX_MODE -/** +/** Initialized an EAX state @param eax [out] The EAX state to initialize @param cipher The index of the desired cipher @@ -29,7 +29,7 @@ @param headerlen The header length (octets) @return CRYPT_OK if successful */ -int eax_init(eax_state *eax, int cipher, +int eax_init(eax_state *eax, int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *nonce, unsigned long noncelen, const unsigned char *header, unsigned long headerlen) @@ -69,21 +69,21 @@ int eax_init(eax_state *eax, int cipher, /* N = LTC_OMAC_0K(nonce) */ zeromem(buf, MAXBLOCKSIZE); if ((err = omac_init(omac, cipher, key, keylen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* omac the [0]_n */ if ((err = omac_process(omac, buf, blklen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* omac the nonce */ if ((err = omac_process(omac, nonce, noncelen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* store result */ len = sizeof(eax->N); if ((err = omac_done(omac, eax->N, &len)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* H = LTC_OMAC_1K(header) */ @@ -91,17 +91,17 @@ int eax_init(eax_state *eax, int cipher, buf[blklen - 1] = 1; if ((err = omac_init(&eax->headeromac, cipher, key, keylen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* omac the [1]_n */ if ((err = omac_process(&eax->headeromac, buf, blklen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* omac the header */ if (headerlen != 0) { if ((err = omac_process(&eax->headeromac, header, headerlen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } } @@ -109,19 +109,19 @@ int eax_init(eax_state *eax, int cipher, /* setup the CTR mode */ if ((err = ctr_start(cipher, eax->N, key, keylen, 0, CTR_COUNTER_BIG_ENDIAN, &eax->ctr)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } /* setup the LTC_OMAC for the ciphertext */ - if ((err = omac_init(&eax->ctomac, cipher, key, keylen)) != CRYPT_OK) { - goto LBL_ERR; + if ((err = omac_init(&eax->ctomac, cipher, key, keylen)) != CRYPT_OK) { + goto LBL_ERR; } /* omac [2]_n */ zeromem(buf, MAXBLOCKSIZE); buf[blklen-1] = 2; if ((err = omac_process(&eax->ctomac, buf, blklen)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } err = CRYPT_OK; @@ -137,7 +137,7 @@ int eax_init(eax_state *eax, int cipher, return err; } -#endif +#endif /* $Source$ */ /* $Revision$ */ diff --git a/src/encauth/eax/eax_test.c b/src/encauth/eax/eax_test.c index 087755e59..f5558ccd4 100644 --- a/src/encauth/eax/eax_test.c +++ b/src/encauth/eax/eax_test.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file eax_test.c EAX implementation, self-test, by Tom St Denis */ @@ -27,16 +27,16 @@ int eax_test(void) return CRYPT_NOP; #else static const struct { - int keylen, - noncelen, - headerlen, + int keylen, + noncelen, + headerlen, msglen; - unsigned char key[MAXBLOCKSIZE], - nonce[MAXBLOCKSIZE], - header[MAXBLOCKSIZE], + unsigned char key[MAXBLOCKSIZE], + nonce[MAXBLOCKSIZE], + header[MAXBLOCKSIZE], plaintext[MAXBLOCKSIZE], - ciphertext[MAXBLOCKSIZE], + ciphertext[MAXBLOCKSIZE], tag[MAXBLOCKSIZE]; } tests[] = { @@ -107,7 +107,7 @@ int eax_test(void) 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, /* nonce */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, /* header */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -134,7 +134,7 @@ int eax_test(void) 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, /* nonce */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e }, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e }, /* header */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d }, @@ -176,7 +176,7 @@ int eax_test(void) { 16, 16, 8, 2, - /* key */ + /* key */ { 0x91, 0x94, 0x5d, 0x3f, 0x4d, 0xcb, 0xee, 0x0b, 0xf4, 0x5e, 0xf5, 0x22, 0x55, 0xf0, 0x95, 0xa4 }, /* nonce */ @@ -210,14 +210,14 @@ int eax_test(void) /* Tag */ { 0x3a, 0x59, 0xf2, 0x38, 0xa2, 0x3e, 0x39, 0x19, 0x9d, 0xc9, 0x26, 0x66, 0x26, 0xc4, 0x0f, 0x80 } -} +} }; int err, x, idx, res; unsigned long len; unsigned char outct[MAXBLOCKSIZE], outtag[MAXBLOCKSIZE]; - /* AES can be under rijndael or aes... try to find it */ + /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { if ((idx = find_cipher("rijndael")) == -1) { return CRYPT_NOP; diff --git a/src/encauth/gcm/gcm_done.c b/src/encauth/gcm/gcm_done.c index bbc9bbe23..db950a566 100644 --- a/src/encauth/gcm/gcm_done.c +++ b/src/encauth/gcm/gcm_done.c @@ -24,7 +24,7 @@ @param taglen [in/out] The length of the MAC tag @return CRYPT_OK on success */ -int gcm_done(gcm_state *gcm, +int gcm_done(gcm_state *gcm, unsigned char *tag, unsigned long *taglen) { unsigned long x; diff --git a/src/encauth/gcm/gcm_gf_mult.c b/src/encauth/gcm/gcm_gf_mult.c index e8d8c2d12..1b3387f72 100644 --- a/src/encauth/gcm/gcm_gf_mult.c +++ b/src/encauth/gcm/gcm_gf_mult.c @@ -17,7 +17,7 @@ #if defined(LTC_GCM_TABLES) || defined(LTC_LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST)) -/* this is x*2^128 mod p(x) ... the results are 16 bytes each stored in a packed format. Since only the +/* this is x*2^128 mod p(x) ... the results are 16 bytes each stored in a packed format. Since only the * lower 16 bits are not zero'ed I removed the upper 14 bytes */ const unsigned char gcm_shift_table[256*2] = { 0x00, 0x00, 0x01, 0xc2, 0x03, 0x84, 0x02, 0x46, 0x07, 0x08, 0x06, 0xca, 0x04, 0x8c, 0x05, 0x4e, @@ -73,13 +73,13 @@ static void gcm_rightshift(unsigned char *a) static const unsigned char mask[] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; static const unsigned char poly[] = { 0x00, 0xE1 }; - + /** GCM GF multiplier (internal use only) bitserial @param a First value @param b Second value @param c Destination for a * b - */ + */ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *c) { unsigned char Z[16], V[16]; @@ -90,7 +90,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * for (x = 0; x < 128; x++) { if (b[x>>3] & mask[x&7]) { for (y = 0; y < 16; y++) { - Z[y] ^= V[y]; + Z[y] ^= V[y]; } } z = V[15] & 0x01; @@ -113,7 +113,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * @param a First value @param b Second value @param c Destination for a * b - */ + */ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *c) { int i, j, k, u; @@ -129,7 +129,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * LOAD32H(B[M(1)][i], a + (i<<2)); LOAD32L(pB[i], b + (i<<2)); } -#else +#else for (i = 0; i < 2; i++) { LOAD64H(B[M(1)][i], a + (i<<3)); LOAD64L(pB[i], b + (i<<3)); @@ -154,7 +154,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * B[M(9)][i] = B[M(1)][i] ^ B[M(8)][i]; B[M(10)][i] = B[M(2)][i] ^ B[M(8)][i]; B[M(12)][i] = B[M(8)][i] ^ B[M(4)][i]; - + /* now all 3 bit values and the only 4 bit value: 7, 11, 13, 14, 15 */ B[M(7)][i] = B[M(3)][i] ^ B[M(4)][i]; B[M(11)][i] = B[M(3)][i] ^ B[M(8)][i]; @@ -193,7 +193,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * for (i = 0; i < 8; i++) { STORE32H(tmp[i], pTmp + (i<<2)); } -#else +#else for (i = 0; i < 4; i++) { STORE64H(tmp[i], pTmp + (i<<3)); } @@ -218,4 +218,4 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * /* $Source$ */ /* $Revision$ */ /* $Date$ */ - + diff --git a/src/encauth/gcm/gcm_init.c b/src/encauth/gcm/gcm_init.c index 2c6a5eb44..65282c181 100644 --- a/src/encauth/gcm/gcm_init.c +++ b/src/encauth/gcm/gcm_init.c @@ -25,7 +25,7 @@ @param keylen The length of the secret key @return CRYPT_OK on success */ -int gcm_init(gcm_state *gcm, int cipher, +int gcm_init(gcm_state *gcm, int cipher, const unsigned char *key, int keylen) { int err; diff --git a/src/encauth/gcm/gcm_memory.c b/src/encauth/gcm/gcm_memory.c index 451e3fa4a..f85899282 100644 --- a/src/encauth/gcm/gcm_memory.c +++ b/src/encauth/gcm/gcm_memory.c @@ -22,7 +22,7 @@ @param cipher Index of cipher to use @param key The secret key @param keylen The length of the secret key - @param IV The initial vector + @param IV The initial vector @param IVlen The length of the initial vector @param adata The additional authentication data (header) @param adatalen The length of the adata @@ -39,7 +39,7 @@ int gcm_memory( int cipher, const unsigned char *IV, unsigned long IVlen, const unsigned char *adata, unsigned long adatalen, unsigned char *pt, unsigned long ptlen, - unsigned char *ct, + unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction) { @@ -50,9 +50,9 @@ int gcm_memory( int cipher, if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { return err; } - + if (cipher_descriptor[cipher].accel_gcm_memory != NULL) { - return + return cipher_descriptor[cipher].accel_gcm_memory (key, keylen, IV, IVlen, diff --git a/src/encauth/gcm/gcm_reset.c b/src/encauth/gcm/gcm_reset.c index c9e13d968..f9596b43f 100644 --- a/src/encauth/gcm/gcm_reset.c +++ b/src/encauth/gcm/gcm_reset.c @@ -33,7 +33,7 @@ int gcm_reset(gcm_state *gcm) gcm->buflen = 0; gcm->totlen = 0; gcm->pttotlen = 0; - + return CRYPT_OK; } diff --git a/src/encauth/gcm/gcm_test.c b/src/encauth/gcm/gcm_test.c index 7380c8109..fb37796f8 100644 --- a/src/encauth/gcm/gcm_test.c +++ b/src/encauth/gcm/gcm_test.c @@ -17,7 +17,7 @@ #ifdef LTC_GCM_MODE -/** +/** Test the GCM code @return CRYPT_OK on success */ @@ -100,18 +100,18 @@ int gcm_test(void) /* test case #3 */ { /* key */ - { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, + { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, }, 16, /* PT */ - { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, + { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55, }, 64, @@ -120,66 +120,66 @@ int gcm_test(void) 0, /* IV */ - { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, + { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88, }, 12, - + /* CT */ - { 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24, - 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c, - 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0, - 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e, - 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, - 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, - 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, + { 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24, + 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c, + 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0, + 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e, + 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, + 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, + 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85, }, /* TAG */ - { 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6, + { 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6, 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4, } }, /* test case #4 */ { /* key */ - { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, + { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, }, 16, /* PT */ - { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, + { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, 0xba, 0x63, 0x7b, 0x39, }, 60, /* ADATA */ - { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, + { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, + 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, 0xab, 0xad, 0xda, 0xd2, }, 20, /* IV */ - { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, + { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88, }, 12, /* CT */ - { 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24, - 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c, - 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0, - 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e, - 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, - 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, - 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, + { 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24, + 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c, + 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0, + 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e, + 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, + 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, + 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, 0x3d, 0x58, 0xe0, 0x91, }, /* TAG */ - { 0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb, + { 0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb, 0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47, } }, @@ -187,24 +187,24 @@ int gcm_test(void) /* test case #5 */ { /* key */ - { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, + { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, }, 16, /* PT */ - { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, + { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, 0xba, 0x63, 0x7b, 0x39, }, 60, /* ADATA */ - { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, + { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, + 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, 0xab, 0xad, 0xda, 0xd2, }, 20, @@ -213,112 +213,112 @@ int gcm_test(void) 8, /* CT */ - { 0x61, 0x35, 0x3b, 0x4c, 0x28, 0x06, 0x93, 0x4a, - 0x77, 0x7f, 0xf5, 0x1f, 0xa2, 0x2a, 0x47, 0x55, - 0x69, 0x9b, 0x2a, 0x71, 0x4f, 0xcd, 0xc6, 0xf8, - 0x37, 0x66, 0xe5, 0xf9, 0x7b, 0x6c, 0x74, 0x23, - 0x73, 0x80, 0x69, 0x00, 0xe4, 0x9f, 0x24, 0xb2, - 0x2b, 0x09, 0x75, 0x44, 0xd4, 0x89, 0x6b, 0x42, - 0x49, 0x89, 0xb5, 0xe1, 0xeb, 0xac, 0x0f, 0x07, + { 0x61, 0x35, 0x3b, 0x4c, 0x28, 0x06, 0x93, 0x4a, + 0x77, 0x7f, 0xf5, 0x1f, 0xa2, 0x2a, 0x47, 0x55, + 0x69, 0x9b, 0x2a, 0x71, 0x4f, 0xcd, 0xc6, 0xf8, + 0x37, 0x66, 0xe5, 0xf9, 0x7b, 0x6c, 0x74, 0x23, + 0x73, 0x80, 0x69, 0x00, 0xe4, 0x9f, 0x24, 0xb2, + 0x2b, 0x09, 0x75, 0x44, 0xd4, 0x89, 0x6b, 0x42, + 0x49, 0x89, 0xb5, 0xe1, 0xeb, 0xac, 0x0f, 0x07, 0xc2, 0x3f, 0x45, 0x98, }, /* TAG */ - { 0x36, 0x12, 0xd2, 0xe7, 0x9e, 0x3b, 0x07, 0x85, + { 0x36, 0x12, 0xd2, 0xe7, 0x9e, 0x3b, 0x07, 0x85, 0x56, 0x1b, 0xe1, 0x4a, 0xac, 0xa2, 0xfc, 0xcb, } }, /* test case #6 */ { /* key */ - { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, + { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, }, 16, /* PT */ - { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, - 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, - 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, - 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, - 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, - 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, - 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, + { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, + 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, + 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, + 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72, + 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53, + 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25, + 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, 0xba, 0x63, 0x7b, 0x39, }, 60, /* ADATA */ - { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, - 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, + { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, + 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, 0xab, 0xad, 0xda, 0xd2, }, 20, /* IV */ - { 0x93, 0x13, 0x22, 0x5d, 0xf8, 0x84, 0x06, 0xe5, - 0x55, 0x90, 0x9c, 0x5a, 0xff, 0x52, 0x69, 0xaa, - 0x6a, 0x7a, 0x95, 0x38, 0x53, 0x4f, 0x7d, 0xa1, - 0xe4, 0xc3, 0x03, 0xd2, 0xa3, 0x18, 0xa7, 0x28, - 0xc3, 0xc0, 0xc9, 0x51, 0x56, 0x80, 0x95, 0x39, - 0xfc, 0xf0, 0xe2, 0x42, 0x9a, 0x6b, 0x52, 0x54, - 0x16, 0xae, 0xdb, 0xf5, 0xa0, 0xde, 0x6a, 0x57, + { 0x93, 0x13, 0x22, 0x5d, 0xf8, 0x84, 0x06, 0xe5, + 0x55, 0x90, 0x9c, 0x5a, 0xff, 0x52, 0x69, 0xaa, + 0x6a, 0x7a, 0x95, 0x38, 0x53, 0x4f, 0x7d, 0xa1, + 0xe4, 0xc3, 0x03, 0xd2, 0xa3, 0x18, 0xa7, 0x28, + 0xc3, 0xc0, 0xc9, 0x51, 0x56, 0x80, 0x95, 0x39, + 0xfc, 0xf0, 0xe2, 0x42, 0x9a, 0x6b, 0x52, 0x54, + 0x16, 0xae, 0xdb, 0xf5, 0xa0, 0xde, 0x6a, 0x57, 0xa6, 0x37, 0xb3, 0x9b, }, 60, /* CT */ - { 0x8c, 0xe2, 0x49, 0x98, 0x62, 0x56, 0x15, 0xb6, - 0x03, 0xa0, 0x33, 0xac, 0xa1, 0x3f, 0xb8, 0x94, - 0xbe, 0x91, 0x12, 0xa5, 0xc3, 0xa2, 0x11, 0xa8, - 0xba, 0x26, 0x2a, 0x3c, 0xca, 0x7e, 0x2c, 0xa7, - 0x01, 0xe4, 0xa9, 0xa4, 0xfb, 0xa4, 0x3c, 0x90, - 0xcc, 0xdc, 0xb2, 0x81, 0xd4, 0x8c, 0x7c, 0x6f, - 0xd6, 0x28, 0x75, 0xd2, 0xac, 0xa4, 0x17, 0x03, + { 0x8c, 0xe2, 0x49, 0x98, 0x62, 0x56, 0x15, 0xb6, + 0x03, 0xa0, 0x33, 0xac, 0xa1, 0x3f, 0xb8, 0x94, + 0xbe, 0x91, 0x12, 0xa5, 0xc3, 0xa2, 0x11, 0xa8, + 0xba, 0x26, 0x2a, 0x3c, 0xca, 0x7e, 0x2c, 0xa7, + 0x01, 0xe4, 0xa9, 0xa4, 0xfb, 0xa4, 0x3c, 0x90, + 0xcc, 0xdc, 0xb2, 0x81, 0xd4, 0x8c, 0x7c, 0x6f, + 0xd6, 0x28, 0x75, 0xd2, 0xac, 0xa4, 0x17, 0x03, 0x4c, 0x34, 0xae, 0xe5, }, /* TAG */ - { 0x61, 0x9c, 0xc5, 0xae, 0xff, 0xfe, 0x0b, 0xfa, + { 0x61, 0x9c, 0xc5, 0xae, 0xff, 0xfe, 0x0b, 0xfa, 0x46, 0x2a, 0xf4, 0x3c, 0x16, 0x99, 0xd0, 0x50, } }, /* test case #46 from BG (catches the LTC bug of v1.15) */ { /* key */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 16, /* PT */ - { 0xa2, 0xaa, 0xb3, 0xad, 0x8b, 0x17, 0xac, 0xdd, - 0xa2, 0x88, 0x42, 0x6c, 0xd7, 0xc4, 0x29, 0xb7, - 0xca, 0x86, 0xb7, 0xac, 0xa0, 0x58, 0x09, 0xc7, + { 0xa2, 0xaa, 0xb3, 0xad, 0x8b, 0x17, 0xac, 0xdd, + 0xa2, 0x88, 0x42, 0x6c, 0xd7, 0xc4, 0x29, 0xb7, + 0xca, 0x86, 0xb7, 0xac, 0xa0, 0x58, 0x09, 0xc7, 0x0c, 0xe8, 0x2d, 0xb2, 0x57, 0x11, 0xcb, 0x53, - 0x02, 0xeb, 0x27, 0x43, 0xb0, 0x36, 0xf3, 0xd7, - 0x50, 0xd6, 0xcf, 0x0d, 0xc0, 0xac, 0xb9, 0x29, - 0x50, 0xd5, 0x46, 0xdb, 0x30, 0x8f, 0x93, 0xb4, + 0x02, 0xeb, 0x27, 0x43, 0xb0, 0x36, 0xf3, 0xd7, + 0x50, 0xd6, 0xcf, 0x0d, 0xc0, 0xac, 0xb9, 0x29, + 0x50, 0xd5, 0x46, 0xdb, 0x30, 0x8f, 0x93, 0xb4, 0xff, 0x24, 0x4a, 0xfa, 0x9d, 0xc7, 0x2b, 0xcd, 0x75, 0x8d, 0x2c }, 67, /* ADATA */ - { 0x68, 0x8e, 0x1a, 0xa9, 0x84, 0xde, 0x92, 0x6d, + { 0x68, 0x8e, 0x1a, 0xa9, 0x84, 0xde, 0x92, 0x6d, 0xc7, 0xb4, 0xc4, 0x7f, 0x44 }, - 13, + 13, /* IV */ - { 0xb7, 0x21, 0x38, 0xb5, 0xa0, 0x5f, 0xf5, 0x07, + { 0xb7, 0x21, 0x38, 0xb5, 0xa0, 0x5f, 0xf5, 0x07, 0x0e, 0x8c, 0xd9, 0x41, 0x83, 0xf7, 0x61, 0xd8 }, 16, /* CT */ - { 0xcb, 0xc8, 0xd2, 0xf1, 0x54, 0x81, 0xa4, 0xcc, - 0x7d, 0xd1, 0xe1, 0x9a, 0xaa, 0x83, 0xde, 0x56, - 0x78, 0x48, 0x3e, 0xc3, 0x59, 0xae, 0x7d, 0xec, + { 0xcb, 0xc8, 0xd2, 0xf1, 0x54, 0x81, 0xa4, 0xcc, + 0x7d, 0xd1, 0xe1, 0x9a, 0xaa, 0x83, 0xde, 0x56, + 0x78, 0x48, 0x3e, 0xc3, 0x59, 0xae, 0x7d, 0xec, 0x2a, 0xb8, 0xd5, 0x34, 0xe0, 0x90, 0x6f, 0x4b, - 0x46, 0x63, 0xfa, 0xff, 0x58, 0xa8, 0xb2, 0xd7, - 0x33, 0xb8, 0x45, 0xee, 0xf7, 0xc9, 0xb3, 0x31, - 0xe9, 0xe1, 0x0e, 0xb2, 0x61, 0x2c, 0x99, 0x5f, + 0x46, 0x63, 0xfa, 0xff, 0x58, 0xa8, 0xb2, 0xd7, + 0x33, 0xb8, 0x45, 0xee, 0xf7, 0xc9, 0xb3, 0x31, + 0xe9, 0xe1, 0x0e, 0xb2, 0x61, 0x2c, 0x99, 0x5f, 0xeb, 0x1a, 0xc1, 0x5a, 0x62, 0x86, 0xcc, 0xe8, 0xb2, 0x97, 0xa8 }, /* TAG */ - { 0x8d, 0x2d, 0x2a, 0x93, 0x72, 0x62, 0x6f, 0x6b, + { 0x8d, 0x2d, 0x2a, 0x93, 0x72, 0x62, 0x6f, 0x6b, 0xee, 0x85, 0x80, 0x27, 0x6a, 0x63, 0x66, 0xbf } } diff --git a/src/encauth/ocb/ocb_decrypt.c b/src/encauth/ocb/ocb_decrypt.c index 61003db03..33c425a74 100644 --- a/src/encauth/ocb/ocb_decrypt.c +++ b/src/encauth/ocb/ocb_decrypt.c @@ -11,7 +11,7 @@ /** @file ocb_decrypt.c - OCB implementation, decrypt data, by Tom St Denis + OCB implementation, decrypt data, by Tom St Denis */ #include "tomcrypt.h" @@ -38,7 +38,7 @@ int ocb_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned char *pt) return err; } LTC_ARGCHK(cipher_descriptor[ocb->cipher].ecb_decrypt != NULL); - + /* check length */ if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) { return CRYPT_INVALID_ARG; diff --git a/src/encauth/ocb/ocb_decrypt_verify_memory.c b/src/encauth/ocb/ocb_decrypt_verify_memory.c index 6644618c8..70c579a16 100644 --- a/src/encauth/ocb/ocb_decrypt_verify_memory.c +++ b/src/encauth/ocb/ocb_decrypt_verify_memory.c @@ -9,9 +9,9 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file ocb_decrypt_verify_memory.c - OCB implementation, helper to decrypt block of memory, by Tom St Denis + OCB implementation, helper to decrypt block of memory, by Tom St Denis */ #include "tomcrypt.h" @@ -33,7 +33,7 @@ */ int ocb_decrypt_verify_memory(int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, + const unsigned char *nonce, const unsigned char *ct, unsigned long ctlen, unsigned char *pt, const unsigned char *tag, unsigned long taglen, @@ -56,12 +56,12 @@ int ocb_decrypt_verify_memory(int cipher, } if ((err = ocb_init(ocb, cipher, key, keylen, nonce)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } while (ctlen > (unsigned long)ocb->block_len) { if ((err = ocb_decrypt(ocb, ct, pt)) != CRYPT_OK) { - goto LBL_ERR; + goto LBL_ERR; } ctlen -= ocb->block_len; pt += ocb->block_len; @@ -73,7 +73,7 @@ int ocb_decrypt_verify_memory(int cipher, #ifdef LTC_CLEAN_STACK zeromem(ocb, sizeof(ocb_state)); #endif - + XFREE(ocb); return err; diff --git a/src/encauth/ocb/ocb_done_decrypt.c b/src/encauth/ocb/ocb_done_decrypt.c index d604b36b1..8a119b632 100644 --- a/src/encauth/ocb/ocb_done_decrypt.c +++ b/src/encauth/ocb/ocb_done_decrypt.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file ocb_done_decrypt.c OCB implementation, terminate decryption, by Tom St Denis */ @@ -28,9 +28,9 @@ @param stat [out] The result of the tag comparison @return CRYPT_OK if the process was successful regardless if the tag is valid */ -int ocb_done_decrypt(ocb_state *ocb, +int ocb_done_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned long ctlen, - unsigned char *pt, + unsigned char *pt, const unsigned char *tag, unsigned long taglen, int *stat) { int err; diff --git a/src/encauth/ocb/ocb_done_encrypt.c b/src/encauth/ocb/ocb_done_encrypt.c index 276d50e91..3c3054f7d 100644 --- a/src/encauth/ocb/ocb_done_encrypt.c +++ b/src/encauth/ocb/ocb_done_encrypt.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file ocb_done_encrypt.c OCB implementation, terminate encryption, by Tom St Denis */ @@ -17,7 +17,7 @@ #ifdef LTC_OCB_MODE -/** +/** Terminate an encryption OCB state @param ocb The OCB state @param pt Remaining plaintext (if any) diff --git a/src/encauth/ocb/ocb_encrypt.c b/src/encauth/ocb/ocb_encrypt.c index 84afa66ee..24d22db02 100644 --- a/src/encauth/ocb/ocb_encrypt.c +++ b/src/encauth/ocb/ocb_encrypt.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file ocb_encrypt.c OCB implementation, encrypt data, by Tom St Denis */ diff --git a/src/encauth/ocb/ocb_encrypt_authenticate_memory.c b/src/encauth/ocb/ocb_encrypt_authenticate_memory.c index f81cc4b98..3c2317132 100644 --- a/src/encauth/ocb/ocb_encrypt_authenticate_memory.c +++ b/src/encauth/ocb/ocb_encrypt_authenticate_memory.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file ocb_encrypt_authenticate_memory.c OCB implementation, encrypt block of memory, by Tom St Denis */ @@ -32,7 +32,7 @@ */ int ocb_encrypt_authenticate_memory(int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, + const unsigned char *nonce, const unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tag, unsigned long *taglen) diff --git a/src/encauth/ocb/ocb_init.c b/src/encauth/ocb/ocb_init.c index 393f282df..2b2d09ed0 100644 --- a/src/encauth/ocb/ocb_init.c +++ b/src/encauth/ocb/ocb_init.c @@ -19,7 +19,7 @@ static const struct { int len; - unsigned char poly_div[MAXBLOCKSIZE], + unsigned char poly_div[MAXBLOCKSIZE], poly_mul[MAXBLOCKSIZE]; } polys[] = { { @@ -27,7 +27,7 @@ static const struct { { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B } }, { - 16, + 16, { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -44,7 +44,7 @@ static const struct { @param nonce The session nonce (length of the block size of the cipher) @return CRYPT_OK if successful */ -int ocb_init(ocb_state *ocb, int cipher, +int ocb_init(ocb_state *ocb, int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *nonce) { int poly, x, y, m, err; @@ -62,7 +62,7 @@ int ocb_init(ocb_state *ocb, int cipher, ocb->block_len = cipher_descriptor[cipher].block_length; x = (int)(sizeof(polys)/sizeof(polys[0])); for (poly = 0; poly < x; poly++) { - if (polys[poly].len == ocb->block_len) { + if (polys[poly].len == ocb->block_len) { break; } } @@ -71,13 +71,13 @@ int ocb_init(ocb_state *ocb, int cipher, } if (polys[poly].len != ocb->block_len) { return CRYPT_INVALID_ARG; - } + } /* schedule the key */ if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &ocb->key)) != CRYPT_OK) { return err; } - + /* find L = E[0] */ zeromem(ocb->L, ocb->block_len); if ((err = cipher_descriptor[cipher].ecb_encrypt(ocb->L, ocb->L, &ocb->key)) != CRYPT_OK) { diff --git a/src/encauth/ocb/ocb_shift_xor.c b/src/encauth/ocb/ocb_shift_xor.c index 145f4c423..48b76b61b 100644 --- a/src/encauth/ocb/ocb_shift_xor.c +++ b/src/encauth/ocb/ocb_shift_xor.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file ocb_shift_xor.c OCB implementation, internal function, by Tom St Denis */ @@ -19,7 +19,7 @@ /** Compute the shift/xor for OCB (internal function) - @param ocb The OCB state + @param ocb The OCB state @param Z The destination of the shift */ void ocb_shift_xor(ocb_state *ocb, unsigned char *Z) diff --git a/src/encauth/ocb/ocb_test.c b/src/encauth/ocb/ocb_test.c index 8de1a576e..ca0653fa9 100644 --- a/src/encauth/ocb/ocb_test.c +++ b/src/encauth/ocb/ocb_test.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file ocb_test.c OCB implementation, self-test by Tom St Denis */ @@ -17,7 +17,7 @@ #ifdef LTC_OCB_MODE -/** +/** Test the OCB protocol @return CRYPT_OK if successful */ @@ -52,7 +52,7 @@ int ocb_test(void) /* OCB-AES-128-3B */ { - 3, + 3, /* key */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -70,7 +70,7 @@ int ocb_test(void) /* OCB-AES-128-16B */ { - 16, + 16, /* key */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -90,7 +90,7 @@ int ocb_test(void) /* OCB-AES-128-20B */ { - 20, + 20, /* key */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -99,7 +99,7 @@ int ocb_test(void) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, /* pt */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13 }, /* ct */ { 0x01, 0xa0, 0x75, 0xf0, 0xd8, 0x15, 0xb1, 0xa4, @@ -112,7 +112,7 @@ int ocb_test(void) /* OCB-AES-128-32B */ { - 32, + 32, /* key */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -121,7 +121,7 @@ int ocb_test(void) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, /* pt */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, /* ct */ @@ -137,7 +137,7 @@ int ocb_test(void) /* OCB-AES-128-34B */ { - 34, + 34, /* key */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, @@ -146,7 +146,7 @@ int ocb_test(void) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, /* pt */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21 }, @@ -168,7 +168,7 @@ int ocb_test(void) unsigned long len; unsigned char outct[MAXBLOCKSIZE], outtag[MAXBLOCKSIZE]; - /* AES can be under rijndael or aes... try to find it */ + /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { if ((idx = find_cipher("rijndael")) == -1) { return CRYPT_NOP; @@ -181,7 +181,7 @@ int ocb_test(void) tests[x].nonce, tests[x].pt, tests[x].ptlen, outct, outtag, &len)) != CRYPT_OK) { return err; } - + if (XMEMCMP(outtag, tests[x].tag, len) || XMEMCMP(outct, tests[x].ct, tests[x].ptlen)) { #if 0 unsigned long y; @@ -200,7 +200,7 @@ int ocb_test(void) #endif return CRYPT_FAIL_TESTVECTOR; } - + if ((err = ocb_decrypt_verify_memory(idx, tests[x].key, 16, tests[x].nonce, outct, tests[x].ptlen, outct, tests[x].tag, len, &res)) != CRYPT_OK) { return err; diff --git a/src/encauth/ocb/s_ocb_done.c b/src/encauth/ocb/s_ocb_done.c index 37a7cb736..5cf9c73cd 100644 --- a/src/encauth/ocb/s_ocb_done.c +++ b/src/encauth/ocb/s_ocb_done.c @@ -9,7 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ -/** +/** @file s_ocb_done.c OCB implementation, internal helper, by Tom St Denis */ @@ -22,7 +22,7 @@ * is we XOR the final ciphertext into the checksum so we have to xor it * before we CTR [decrypt] or after [encrypt] * - * the names pt/ptlen/ct really just mean in/inlen/out but this is the way I wrote it... + * the names pt/ptlen/ct really just mean in/inlen/out but this is the way I wrote it... */ /** @@ -74,13 +74,13 @@ int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, } /* compute X[m] = len(pt[m]) XOR Lr XOR Z[m] */ - ocb_shift_xor(ocb, X); + ocb_shift_xor(ocb, X); XMEMCPY(Z, X, ocb->block_len); X[ocb->block_len-1] ^= (ptlen*8)&255; X[ocb->block_len-2] ^= ((ptlen*8)>>8)&255; for (x = 0; x < ocb->block_len; x++) { - X[x] ^= ocb->Lr[x]; + X[x] ^= ocb->Lr[x]; } /* Y[m] = E(X[m])) */ @@ -93,7 +93,7 @@ int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, /* xor C[m] into checksum */ for (x = 0; x < (int)ptlen; x++) { ocb->checksum[x] ^= ct[x]; - } + } } /* C[m] = P[m] xor Y[m] */ @@ -102,7 +102,7 @@ int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, } if (mode == 0) { - /* encrypt mode */ + /* encrypt mode */ /* xor C[m] into checksum */ for (x = 0; x < (int)ptlen; x++) { ocb->checksum[x] ^= ct[x]; @@ -113,7 +113,7 @@ int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, for (x = 0; x < ocb->block_len; x++) { ocb->checksum[x] ^= Y[x] ^ Z[x]; } - + /* encrypt checksum, er... tag!! */ if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(ocb->checksum, X, &ocb->key)) != CRYPT_OK) { goto error; @@ -132,7 +132,7 @@ int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, zeromem(Z, MAXBLOCKSIZE); zeromem(ocb, sizeof(*ocb)); #endif -error: +error: XFREE(X); XFREE(Y); XFREE(Z); diff --git a/src/hashes/helper/hash_file.c b/src/hashes/helper/hash_file.c index 4c184d830..bb899a18d 100644 --- a/src/hashes/helper/hash_file.c +++ b/src/hashes/helper/hash_file.c @@ -11,7 +11,7 @@ #include "tomcrypt.h" #ifndef LTC_NO_FILE -/** +/** @file hash_file.c Hash a file, Tom St Denis */ @@ -36,7 +36,7 @@ int hash_file(int hash, const char *fname, unsigned char *out, unsigned long *ou } in = fopen(fname, "rb"); - if (in == NULL) { + if (in == NULL) { return CRYPT_FILE_NOTFOUND; } diff --git a/src/hashes/helper/hash_filehandle.c b/src/hashes/helper/hash_filehandle.c index 6a6052f72..130553977 100644 --- a/src/hashes/helper/hash_filehandle.c +++ b/src/hashes/helper/hash_filehandle.c @@ -16,13 +16,13 @@ Hash open files, Tom St Denis */ -/** - Hash data from an open file handle. +/** + Hash data from an open file handle. @param hash The index of the hash you want to use @param in The FILE* handle of the file you want to hash @param out [out] The destination of the digest @param outlen [in/out] The max size and resulting size of the digest - @result CRYPT_OK if successful + @result CRYPT_OK if successful */ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outlen) { diff --git a/src/hashes/md2.c b/src/hashes/md2.c index 5a65d7ee4..0410923bd 100644 --- a/src/hashes/md2.c +++ b/src/hashes/md2.c @@ -12,7 +12,7 @@ /** @param md2.c - LTC_MD2 (RFC 1319) hash function implementation by Tom St Denis + LTC_MD2 (RFC 1319) hash function implementation by Tom St Denis */ #ifdef LTC_MD2 @@ -64,7 +64,7 @@ static void md2_update_chksum(hash_state *md) L = md->md2.chksum[15]; for (j = 0; j < 16; j++) { -/* caution, the RFC says its "C[j] = S[M[i*16+j] xor L]" but the reference source code [and test vectors] say +/* caution, the RFC says its "C[j] = S[M[i*16+j] xor L]" but the reference source code [and test vectors] say otherwise. */ L = (md->md2.chksum[j] ^= PI_SUBST[(int)(md->md2.buf[j] ^ L)] & 255); @@ -75,7 +75,7 @@ static void md2_compress(hash_state *md) { int j, k; unsigned char t; - + /* copy block */ for (j = 0; j < 16; j++) { md->md2.X[16+j] = md->md2.buf[j]; @@ -122,9 +122,9 @@ int md2_process(hash_state *md, const unsigned char *in, unsigned long inlen) unsigned long n; LTC_ARGCHK(md != NULL); LTC_ARGCHK(in != NULL); - if (md-> md2 .curlen > sizeof(md-> md2 .buf)) { - return CRYPT_INVALID_ARG; - } + if (md-> md2 .curlen > sizeof(md-> md2 .buf)) { + return CRYPT_INVALID_ARG; + } while (inlen > 0) { n = MIN(inlen, (16 - md->md2.curlen)); XMEMCPY(md->md2.buf + md->md2.curlen, in, (size_t)n); @@ -186,12 +186,12 @@ int md2_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int md2_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { char *msg; unsigned char md[16]; @@ -239,7 +239,7 @@ int md2_test(void) return CRYPT_FAIL_TESTVECTOR; } } - return CRYPT_OK; + return CRYPT_OK; #endif } diff --git a/src/hashes/md4.c b/src/hashes/md4.c index adf916b0c..b2527b585 100644 --- a/src/hashes/md4.c +++ b/src/hashes/md4.c @@ -12,7 +12,7 @@ /** @param md4.c - Submitted by Dobes Vandermeer (dobes@smartt.com) + Submitted by Dobes Vandermeer (dobes@smartt.com) */ #ifdef LTC_MD4 @@ -23,7 +23,7 @@ const struct ltc_hash_descriptor md4_desc = 6, 16, 64, - + /* OID */ { 1, 2, 840, 113549, 2, 4, }, 6, @@ -56,8 +56,8 @@ const struct ltc_hash_descriptor md4_desc = /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) ROLc(x, n) -/* FF, GG and HH are transformations for rounds 1, 2 and 3 */ -/* Rotation is separate from addition to prevent recomputation */ +/* FF, GG and HH are transformations for rounds 1, 2 and 3 */ +/* Rotation is separate from addition to prevent recomputation */ #define FF(a, b, c, d, x, s) { \ (a) += F ((b), (c), (d)) + (x); \ @@ -91,61 +91,61 @@ static int md4_compress(hash_state *md, unsigned char *buf) for (i = 0; i < 16; i++) { LOAD32L(x[i], buf + (4*i)); } - - /* Round 1 */ - FF (a, b, c, d, x[ 0], S11); /* 1 */ - FF (d, a, b, c, x[ 1], S12); /* 2 */ - FF (c, d, a, b, x[ 2], S13); /* 3 */ - FF (b, c, d, a, x[ 3], S14); /* 4 */ - FF (a, b, c, d, x[ 4], S11); /* 5 */ - FF (d, a, b, c, x[ 5], S12); /* 6 */ - FF (c, d, a, b, x[ 6], S13); /* 7 */ - FF (b, c, d, a, x[ 7], S14); /* 8 */ - FF (a, b, c, d, x[ 8], S11); /* 9 */ + + /* Round 1 */ + FF (a, b, c, d, x[ 0], S11); /* 1 */ + FF (d, a, b, c, x[ 1], S12); /* 2 */ + FF (c, d, a, b, x[ 2], S13); /* 3 */ + FF (b, c, d, a, x[ 3], S14); /* 4 */ + FF (a, b, c, d, x[ 4], S11); /* 5 */ + FF (d, a, b, c, x[ 5], S12); /* 6 */ + FF (c, d, a, b, x[ 6], S13); /* 7 */ + FF (b, c, d, a, x[ 7], S14); /* 8 */ + FF (a, b, c, d, x[ 8], S11); /* 9 */ FF (d, a, b, c, x[ 9], S12); /* 10 */ - FF (c, d, a, b, x[10], S13); /* 11 */ + FF (c, d, a, b, x[10], S13); /* 11 */ FF (b, c, d, a, x[11], S14); /* 12 */ FF (a, b, c, d, x[12], S11); /* 13 */ - FF (d, a, b, c, x[13], S12); /* 14 */ - FF (c, d, a, b, x[14], S13); /* 15 */ - FF (b, c, d, a, x[15], S14); /* 16 */ - - /* Round 2 */ - GG (a, b, c, d, x[ 0], S21); /* 17 */ - GG (d, a, b, c, x[ 4], S22); /* 18 */ - GG (c, d, a, b, x[ 8], S23); /* 19 */ - GG (b, c, d, a, x[12], S24); /* 20 */ - GG (a, b, c, d, x[ 1], S21); /* 21 */ - GG (d, a, b, c, x[ 5], S22); /* 22 */ - GG (c, d, a, b, x[ 9], S23); /* 23 */ - GG (b, c, d, a, x[13], S24); /* 24 */ - GG (a, b, c, d, x[ 2], S21); /* 25 */ - GG (d, a, b, c, x[ 6], S22); /* 26 */ - GG (c, d, a, b, x[10], S23); /* 27 */ - GG (b, c, d, a, x[14], S24); /* 28 */ - GG (a, b, c, d, x[ 3], S21); /* 29 */ - GG (d, a, b, c, x[ 7], S22); /* 30 */ - GG (c, d, a, b, x[11], S23); /* 31 */ - GG (b, c, d, a, x[15], S24); /* 32 */ - + FF (d, a, b, c, x[13], S12); /* 14 */ + FF (c, d, a, b, x[14], S13); /* 15 */ + FF (b, c, d, a, x[15], S14); /* 16 */ + + /* Round 2 */ + GG (a, b, c, d, x[ 0], S21); /* 17 */ + GG (d, a, b, c, x[ 4], S22); /* 18 */ + GG (c, d, a, b, x[ 8], S23); /* 19 */ + GG (b, c, d, a, x[12], S24); /* 20 */ + GG (a, b, c, d, x[ 1], S21); /* 21 */ + GG (d, a, b, c, x[ 5], S22); /* 22 */ + GG (c, d, a, b, x[ 9], S23); /* 23 */ + GG (b, c, d, a, x[13], S24); /* 24 */ + GG (a, b, c, d, x[ 2], S21); /* 25 */ + GG (d, a, b, c, x[ 6], S22); /* 26 */ + GG (c, d, a, b, x[10], S23); /* 27 */ + GG (b, c, d, a, x[14], S24); /* 28 */ + GG (a, b, c, d, x[ 3], S21); /* 29 */ + GG (d, a, b, c, x[ 7], S22); /* 30 */ + GG (c, d, a, b, x[11], S23); /* 31 */ + GG (b, c, d, a, x[15], S24); /* 32 */ + /* Round 3 */ - HH (a, b, c, d, x[ 0], S31); /* 33 */ - HH (d, a, b, c, x[ 8], S32); /* 34 */ - HH (c, d, a, b, x[ 4], S33); /* 35 */ - HH (b, c, d, a, x[12], S34); /* 36 */ - HH (a, b, c, d, x[ 2], S31); /* 37 */ - HH (d, a, b, c, x[10], S32); /* 38 */ - HH (c, d, a, b, x[ 6], S33); /* 39 */ - HH (b, c, d, a, x[14], S34); /* 40 */ - HH (a, b, c, d, x[ 1], S31); /* 41 */ - HH (d, a, b, c, x[ 9], S32); /* 42 */ - HH (c, d, a, b, x[ 5], S33); /* 43 */ - HH (b, c, d, a, x[13], S34); /* 44 */ - HH (a, b, c, d, x[ 3], S31); /* 45 */ - HH (d, a, b, c, x[11], S32); /* 46 */ - HH (c, d, a, b, x[ 7], S33); /* 47 */ - HH (b, c, d, a, x[15], S34); /* 48 */ - + HH (a, b, c, d, x[ 0], S31); /* 33 */ + HH (d, a, b, c, x[ 8], S32); /* 34 */ + HH (c, d, a, b, x[ 4], S33); /* 35 */ + HH (b, c, d, a, x[12], S34); /* 36 */ + HH (a, b, c, d, x[ 2], S31); /* 37 */ + HH (d, a, b, c, x[10], S32); /* 38 */ + HH (c, d, a, b, x[ 6], S33); /* 39 */ + HH (b, c, d, a, x[14], S34); /* 40 */ + HH (a, b, c, d, x[ 1], S31); /* 41 */ + HH (d, a, b, c, x[ 9], S32); /* 42 */ + HH (c, d, a, b, x[ 5], S33); /* 43 */ + HH (b, c, d, a, x[13], S34); /* 44 */ + HH (a, b, c, d, x[ 3], S31); /* 45 */ + HH (d, a, b, c, x[11], S32); /* 46 */ + HH (c, d, a, b, x[ 7], S33); /* 47 */ + HH (b, c, d, a, x[15], S34); /* 48 */ + /* Update our state */ md->md4.state[0] = md->md4.state[0] + a; @@ -242,43 +242,43 @@ int md4_done(hash_state * md, unsigned char *out) } #ifdef LTC_CLEAN_STACK zeromem(md, sizeof(hash_state)); -#endif +#endif return CRYPT_OK; } /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int md4_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct md4_test_case { char *input; unsigned char digest[16]; } cases[] = { - { "", + { "", {0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31, 0xb7, 0x3c, 0x59, 0xd7, 0xe0, 0xc0, 0x89, 0xc0} }, { "a", {0xbd, 0xe5, 0x2c, 0xb3, 0x1d, 0xe3, 0x3e, 0x46, 0x24, 0x5e, 0x05, 0xfb, 0xdb, 0xd6, 0xfb, 0x24} }, { "abc", - {0xa4, 0x48, 0x01, 0x7a, 0xaf, 0x21, 0xd8, 0x52, + {0xa4, 0x48, 0x01, 0x7a, 0xaf, 0x21, 0xd8, 0x52, 0x5f, 0xc1, 0x0a, 0xe8, 0x7a, 0xa6, 0x72, 0x9d} }, - { "message digest", - {0xd9, 0x13, 0x0a, 0x81, 0x64, 0x54, 0x9f, 0xe8, + { "message digest", + {0xd9, 0x13, 0x0a, 0x81, 0x64, 0x54, 0x9f, 0xe8, 0x18, 0x87, 0x48, 0x06, 0xe1, 0xc7, 0x01, 0x4b} }, - { "abcdefghijklmnopqrstuvwxyz", - {0xd7, 0x9e, 0x1c, 0x30, 0x8a, 0xa5, 0xbb, 0xcd, + { "abcdefghijklmnopqrstuvwxyz", + {0xd7, 0x9e, 0x1c, 0x30, 0x8a, 0xa5, 0xbb, 0xcd, 0xee, 0xa8, 0xed, 0x63, 0xdf, 0x41, 0x2d, 0xa9} }, - { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", - {0x04, 0x3f, 0x85, 0x82, 0xf2, 0x41, 0xdb, 0x35, + { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", + {0x04, 0x3f, 0x85, 0x82, 0xf2, 0x41, 0xdb, 0x35, 0x1c, 0xe6, 0x27, 0xe1, 0x53, 0xe7, 0xf0, 0xe4} }, - { "12345678901234567890123456789012345678901234567890123456789012345678901234567890", - {0xe3, 0x3b, 0x4d, 0xdc, 0x9c, 0x38, 0xf2, 0x19, + { "12345678901234567890123456789012345678901234567890123456789012345678901234567890", + {0xe3, 0x3b, 0x4d, 0xdc, 0x9c, 0x38, 0xf2, 0x19, 0x9c, 0x3e, 0x7b, 0x16, 0x4f, 0xcc, 0x05, 0x36} }, }; int i; diff --git a/src/hashes/md5.c b/src/hashes/md5.c index 4fa1e9e17..1d0ec9285 100644 --- a/src/hashes/md5.c +++ b/src/hashes/md5.c @@ -13,7 +13,7 @@ /** @file md5.c - LTC_MD5 hash function by Tom St Denis + LTC_MD5 hash function by Tom St Denis */ #ifdef LTC_MD5 @@ -95,7 +95,7 @@ static const ulong32 Korder[64] = { a = (a + I(b,c,d) + M + t); a = ROLc(a, s) + b; -#endif +#endif #ifdef LTC_CLEAN_STACK static int _md5_compress(hash_state *md, unsigned char *buf) @@ -112,7 +112,7 @@ static int md5_compress(hash_state *md, unsigned char *buf) for (i = 0; i < 16; i++) { LOAD32L(W[i], buf + (4*i)); } - + /* copy state */ a = md->md5.state[0]; b = md->md5.state[1]; @@ -309,37 +309,37 @@ int md5_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int md5_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { char *msg; unsigned char hash[16]; } tests[] = { { "", - { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, + { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e } }, { "a", - {0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8, + {0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8, 0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 } }, { "abc", - { 0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0, + { 0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0, 0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72 } }, - { "message digest", - { 0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d, - 0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0 } }, + { "message digest", + { 0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d, + 0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0 } }, { "abcdefghijklmnopqrstuvwxyz", - { 0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00, + { 0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00, 0x7d, 0xfb, 0x49, 0x6c, 0xca, 0x67, 0xe1, 0x3b } }, { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", - { 0xd1, 0x74, 0xab, 0x98, 0xd2, 0x77, 0xd9, 0xf5, + { 0xd1, 0x74, 0xab, 0x98, 0xd2, 0x77, 0xd9, 0xf5, 0xa5, 0x61, 0x1c, 0x2c, 0x9f, 0x41, 0x9d, 0x9f } }, { "12345678901234567890123456789012345678901234567890123456789012345678901234567890", - { 0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55, - 0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a } }, + { 0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55, + 0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a } }, { NULL, { 0 } } }; diff --git a/src/hashes/rmd128.c b/src/hashes/rmd128.c index 58ae92716..af16f1fae 100644 --- a/src/hashes/rmd128.c +++ b/src/hashes/rmd128.c @@ -13,7 +13,7 @@ /** @param rmd128.c RMD128 Hash function -*/ +*/ /* Implementation of LTC_RIPEMD-128 based on the source by Antoon Bosselaers, ESAT-COSIC * @@ -42,11 +42,11 @@ const struct ltc_hash_descriptor rmd128_desc = }; /* the four basic functions F(), G() and H() */ -#define F(x, y, z) ((x) ^ (y) ^ (z)) -#define G(x, y, z) (((x) & (y)) | (~(x) & (z))) +#define F(x, y, z) ((x) ^ (y) ^ (z)) +#define G(x, y, z) (((x) & (y)) | (~(x) & (z))) #define H(x, y, z) (((x) | ~(y)) ^ (z)) -#define I(x, y, z) (((x) & (z)) | ((y) & ~(z))) - +#define I(x, y, z) (((x) & (z)) | ((y) & ~(z))) + /* the eight basic operations FF() through III() */ #define FF(a, b, c, d, x, s) \ (a) += F((b), (c), (d)) + (x);\ @@ -88,7 +88,7 @@ static int rmd128_compress(hash_state *md, unsigned char *buf) { ulong32 aa,bb,cc,dd,aaa,bbb,ccc,ddd,X[16]; int i; - + /* load words X */ for (i = 0; i < 16; i++){ LOAD32L(X[i], buf + (4 * i)); @@ -117,7 +117,7 @@ static int rmd128_compress(hash_state *md, unsigned char *buf) FF(dd, aa, bb, cc, X[13], 7); FF(cc, dd, aa, bb, X[14], 9); FF(bb, cc, dd, aa, X[15], 8); - + /* round 2 */ GG(aa, bb, cc, dd, X[ 7], 7); GG(dd, aa, bb, cc, X[ 4], 6); @@ -173,7 +173,7 @@ static int rmd128_compress(hash_state *md, unsigned char *buf) II(bb, cc, dd, aa, X[ 2], 12); /* parallel round 1 */ - III(aaa, bbb, ccc, ddd, X[ 5], 8); + III(aaa, bbb, ccc, ddd, X[ 5], 8); III(ddd, aaa, bbb, ccc, X[14], 9); III(ccc, ddd, aaa, bbb, X[ 7], 9); III(bbb, ccc, ddd, aaa, X[ 0], 11); @@ -208,7 +208,7 @@ static int rmd128_compress(hash_state *md, unsigned char *buf) HHH(ccc, ddd, aaa, bbb, X[ 1], 13); HHH(bbb, ccc, ddd, aaa, X[ 2], 11); - /* parallel round 3 */ + /* parallel round 3 */ GGG(aaa, bbb, ccc, ddd, X[15], 9); GGG(ddd, aaa, bbb, ccc, X[ 5], 7); GGG(ccc, ddd, aaa, bbb, X[ 1], 15); @@ -342,13 +342,13 @@ int rmd128_done(hash_state * md, unsigned char *out) #ifdef LTC_CLEAN_STACK zeromem(md, sizeof(hash_state)); #endif - return CRYPT_OK; + return CRYPT_OK; } /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int rmd128_test(void) { #ifndef LTC_TEST diff --git a/src/hashes/rmd160.c b/src/hashes/rmd160.c index 1313e415f..ac41e5b95 100644 --- a/src/hashes/rmd160.c +++ b/src/hashes/rmd160.c @@ -13,7 +13,7 @@ /** @file rmd160.c RMD160 hash function -*/ +*/ /* Implementation of LTC_RIPEMD-160 based on the source by Antoon Bosselaers, ESAT-COSIC * @@ -42,12 +42,12 @@ const struct ltc_hash_descriptor rmd160_desc = }; /* the five basic functions F(), G() and H() */ -#define F(x, y, z) ((x) ^ (y) ^ (z)) -#define G(x, y, z) (((x) & (y)) | (~(x) & (z))) +#define F(x, y, z) ((x) ^ (y) ^ (z)) +#define G(x, y, z) (((x) & (y)) | (~(x) & (z))) #define H(x, y, z) (((x) | ~(y)) ^ (z)) -#define I(x, y, z) (((x) & (z)) | ((y) & ~(z))) +#define I(x, y, z) (((x) & (z)) | ((y) & ~(z))) #define J(x, y, z) ((x) ^ ((y) | ~(z))) - + /* the ten basic operations FF() through III() */ #define FF(a, b, c, d, e, x, s) \ (a) += F((b), (c), (d)) + (x);\ @@ -138,7 +138,7 @@ static int rmd160_compress(hash_state *md, unsigned char *buf) FF(cc, dd, ee, aa, bb, X[13], 7); FF(bb, cc, dd, ee, aa, X[14], 9); FF(aa, bb, cc, dd, ee, X[15], 8); - + /* round 2 */ GG(ee, aa, bb, cc, dd, X[ 7], 7); GG(dd, ee, aa, bb, cc, X[ 4], 6); @@ -230,7 +230,7 @@ static int rmd160_compress(hash_state *md, unsigned char *buf) JJJ(aaa, bbb, ccc, ddd, eee, X[12], 6); /* parallel round 2 */ - III(eee, aaa, bbb, ccc, ddd, X[ 6], 9); + III(eee, aaa, bbb, ccc, ddd, X[ 6], 9); III(ddd, eee, aaa, bbb, ccc, X[11], 13); III(ccc, ddd, eee, aaa, bbb, X[ 3], 15); III(bbb, ccc, ddd, eee, aaa, X[ 7], 7); @@ -265,7 +265,7 @@ static int rmd160_compress(hash_state *md, unsigned char *buf) HHH(eee, aaa, bbb, ccc, ddd, X[ 4], 7); HHH(ddd, eee, aaa, bbb, ccc, X[13], 5); - /* parallel round 4 */ + /* parallel round 4 */ GGG(ccc, ddd, eee, aaa, bbb, X[ 8], 15); GGG(bbb, ccc, ddd, eee, aaa, X[ 6], 5); GGG(aaa, bbb, ccc, ddd, eee, X[ 4], 8); @@ -407,7 +407,7 @@ int rmd160_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int rmd160_test(void) { #ifndef LTC_TEST diff --git a/src/hashes/sha1.c b/src/hashes/sha1.c index 8c846b089..96c3b93a9 100644 --- a/src/hashes/sha1.c +++ b/src/hashes/sha1.c @@ -12,7 +12,7 @@ /** @file sha1.c - LTC_SHA1 code by Tom St Denis + LTC_SHA1 code by Tom St Denis */ @@ -66,7 +66,7 @@ static int sha1_compress(hash_state *md, unsigned char *buf) /* expand it */ for (i = 16; i < 80; i++) { - W[i] = ROL(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1); + W[i] = ROL(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1); } /* compress */ @@ -75,9 +75,9 @@ static int sha1_compress(hash_state *md, unsigned char *buf) #define FF1(a,b,c,d,e,i) e = (ROLc(a, 5) + F1(b,c,d) + e + W[i] + 0x6ed9eba1UL); b = ROLc(b, 30); #define FF2(a,b,c,d,e,i) e = (ROLc(a, 5) + F2(b,c,d) + e + W[i] + 0x8f1bbcdcUL); b = ROLc(b, 30); #define FF3(a,b,c,d,e,i) e = (ROLc(a, 5) + F3(b,c,d) + e + W[i] + 0xca62c1d6UL); b = ROLc(b, 30); - + #ifdef LTC_SMALL_CODE - + for (i = 0; i < 20; ) { FF0(a,b,c,d,e,i++); t = e; e = d; d = c; c = b; b = a; a = t; } @@ -105,7 +105,7 @@ static int sha1_compress(hash_state *md, unsigned char *buf) } /* round two */ - for (; i < 40; ) { + for (; i < 40; ) { FF1(a,b,c,d,e,i++); FF1(e,a,b,c,d,i++); FF1(d,e,a,b,c,i++); @@ -114,7 +114,7 @@ static int sha1_compress(hash_state *md, unsigned char *buf) } /* round three */ - for (; i < 60; ) { + for (; i < 60; ) { FF2(a,b,c,d,e,i++); FF2(e,a,b,c,d,i++); FF2(d,e,a,b,c,i++); @@ -123,7 +123,7 @@ static int sha1_compress(hash_state *md, unsigned char *buf) } /* round four */ - for (; i < 80; ) { + for (; i < 80; ) { FF3(a,b,c,d,e,i++); FF3(e,a,b,c,d,i++); FF3(d,e,a,b,c,i++); @@ -241,12 +241,12 @@ int sha1_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int sha1_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { char *msg; unsigned char hash[20]; diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index 251ee6d52..255c7ec63 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -12,10 +12,10 @@ /** @file sha256.c - LTC_SHA256 by Tom St Denis + LTC_SHA256 by Tom St Denis */ -#ifdef LTC_SHA256 +#ifdef LTC_SHA256 const struct ltc_hash_descriptor sha256_desc = { @@ -56,7 +56,7 @@ static const ulong32 K[64] = { /* Various logical functions */ #define Ch(x,y,z) (z ^ (x & (y ^ z))) -#define Maj(x,y,z) (((x | y) & z) | (x & y)) +#define Maj(x,y,z) (((x | y) & z) | (x & y)) #define S(x, n) RORc((x),(n)) #define R(x, n) (((x)&0xFFFFFFFFUL)>>(n)) #define Sigma0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22)) @@ -90,10 +90,10 @@ static int sha256_compress(hash_state * md, unsigned char *buf) /* fill W[16..63] */ for (i = 16; i < 64; i++) { W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16]; - } + } /* Compress */ -#ifdef LTC_SMALL_CODE +#ifdef LTC_SMALL_CODE #define RND(a,b,c,d,e,f,g,h,i) \ t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ t1 = Sigma0(a) + Maj(a, b, c); \ @@ -102,10 +102,10 @@ static int sha256_compress(hash_state * md, unsigned char *buf) for (i = 0; i < 64; ++i) { RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i); - t = S[7]; S[7] = S[6]; S[6] = S[5]; S[5] = S[4]; + t = S[7]; S[7] = S[6]; S[6] = S[5]; S[5] = S[4]; S[4] = S[3]; S[3] = S[2]; S[2] = S[1]; S[1] = S[0]; S[0] = t; - } -#else + } +#else #define RND(a,b,c,d,e,f,g,h,i,ki) \ t0 = h + Sigma1(e) + Ch(e, f, g) + ki + W[i]; \ t1 = Sigma0(a) + Maj(a, b, c); \ @@ -177,9 +177,9 @@ static int sha256_compress(hash_state * md, unsigned char *buf) RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],62,0xbef9a3f7); RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],63,0xc67178f2); -#undef RND - -#endif +#undef RND + +#endif /* feedback */ for (i = 0; i < 8; i++) { @@ -287,12 +287,12 @@ int sha256_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int sha256_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { char *msg; unsigned char hash[32]; @@ -304,9 +304,9 @@ int sha256_test(void) 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad } }, { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", - { 0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8, + { 0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8, 0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39, - 0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67, + 0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67, 0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1 } }, }; diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index 44dd3e0d6..fbf14de3c 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -12,7 +12,7 @@ /** @param sha512.c - LTC_SHA512 by Tom St Denis + LTC_SHA512 by Tom St Denis */ #ifdef LTC_SHA512 @@ -37,51 +37,51 @@ const struct ltc_hash_descriptor sha512_desc = /* the K array */ static const ulong64 K[80] = { -CONST64(0x428a2f98d728ae22), CONST64(0x7137449123ef65cd), +CONST64(0x428a2f98d728ae22), CONST64(0x7137449123ef65cd), CONST64(0xb5c0fbcfec4d3b2f), CONST64(0xe9b5dba58189dbbc), -CONST64(0x3956c25bf348b538), CONST64(0x59f111f1b605d019), +CONST64(0x3956c25bf348b538), CONST64(0x59f111f1b605d019), CONST64(0x923f82a4af194f9b), CONST64(0xab1c5ed5da6d8118), -CONST64(0xd807aa98a3030242), CONST64(0x12835b0145706fbe), +CONST64(0xd807aa98a3030242), CONST64(0x12835b0145706fbe), CONST64(0x243185be4ee4b28c), CONST64(0x550c7dc3d5ffb4e2), -CONST64(0x72be5d74f27b896f), CONST64(0x80deb1fe3b1696b1), +CONST64(0x72be5d74f27b896f), CONST64(0x80deb1fe3b1696b1), CONST64(0x9bdc06a725c71235), CONST64(0xc19bf174cf692694), -CONST64(0xe49b69c19ef14ad2), CONST64(0xefbe4786384f25e3), +CONST64(0xe49b69c19ef14ad2), CONST64(0xefbe4786384f25e3), CONST64(0x0fc19dc68b8cd5b5), CONST64(0x240ca1cc77ac9c65), -CONST64(0x2de92c6f592b0275), CONST64(0x4a7484aa6ea6e483), +CONST64(0x2de92c6f592b0275), CONST64(0x4a7484aa6ea6e483), CONST64(0x5cb0a9dcbd41fbd4), CONST64(0x76f988da831153b5), -CONST64(0x983e5152ee66dfab), CONST64(0xa831c66d2db43210), +CONST64(0x983e5152ee66dfab), CONST64(0xa831c66d2db43210), CONST64(0xb00327c898fb213f), CONST64(0xbf597fc7beef0ee4), -CONST64(0xc6e00bf33da88fc2), CONST64(0xd5a79147930aa725), +CONST64(0xc6e00bf33da88fc2), CONST64(0xd5a79147930aa725), CONST64(0x06ca6351e003826f), CONST64(0x142929670a0e6e70), -CONST64(0x27b70a8546d22ffc), CONST64(0x2e1b21385c26c926), +CONST64(0x27b70a8546d22ffc), CONST64(0x2e1b21385c26c926), CONST64(0x4d2c6dfc5ac42aed), CONST64(0x53380d139d95b3df), -CONST64(0x650a73548baf63de), CONST64(0x766a0abb3c77b2a8), +CONST64(0x650a73548baf63de), CONST64(0x766a0abb3c77b2a8), CONST64(0x81c2c92e47edaee6), CONST64(0x92722c851482353b), CONST64(0xa2bfe8a14cf10364), CONST64(0xa81a664bbc423001), CONST64(0xc24b8b70d0f89791), CONST64(0xc76c51a30654be30), -CONST64(0xd192e819d6ef5218), CONST64(0xd69906245565a910), +CONST64(0xd192e819d6ef5218), CONST64(0xd69906245565a910), CONST64(0xf40e35855771202a), CONST64(0x106aa07032bbd1b8), -CONST64(0x19a4c116b8d2d0c8), CONST64(0x1e376c085141ab53), +CONST64(0x19a4c116b8d2d0c8), CONST64(0x1e376c085141ab53), CONST64(0x2748774cdf8eeb99), CONST64(0x34b0bcb5e19b48a8), -CONST64(0x391c0cb3c5c95a63), CONST64(0x4ed8aa4ae3418acb), +CONST64(0x391c0cb3c5c95a63), CONST64(0x4ed8aa4ae3418acb), CONST64(0x5b9cca4f7763e373), CONST64(0x682e6ff3d6b2b8a3), -CONST64(0x748f82ee5defb2fc), CONST64(0x78a5636f43172f60), +CONST64(0x748f82ee5defb2fc), CONST64(0x78a5636f43172f60), CONST64(0x84c87814a1f0ab72), CONST64(0x8cc702081a6439ec), -CONST64(0x90befffa23631e28), CONST64(0xa4506cebde82bde9), +CONST64(0x90befffa23631e28), CONST64(0xa4506cebde82bde9), CONST64(0xbef9a3f7b2c67915), CONST64(0xc67178f2e372532b), -CONST64(0xca273eceea26619c), CONST64(0xd186b8c721c0c207), +CONST64(0xca273eceea26619c), CONST64(0xd186b8c721c0c207), CONST64(0xeada7dd6cde0eb1e), CONST64(0xf57d4f7fee6ed178), -CONST64(0x06f067aa72176fba), CONST64(0x0a637dc5a2c898a6), +CONST64(0x06f067aa72176fba), CONST64(0x0a637dc5a2c898a6), CONST64(0x113f9804bef90dae), CONST64(0x1b710b35131c471b), -CONST64(0x28db77f523047d84), CONST64(0x32caab7b40c72493), +CONST64(0x28db77f523047d84), CONST64(0x32caab7b40c72493), CONST64(0x3c9ebe0a15c9bebc), CONST64(0x431d67c49c100d4c), -CONST64(0x4cc5d4becb3e42b6), CONST64(0x597f299cfc657e2a), +CONST64(0x4cc5d4becb3e42b6), CONST64(0x597f299cfc657e2a), CONST64(0x5fcb6fab3ad6faec), CONST64(0x6c44198c4a475817) }; /* Various logical functions */ #define Ch(x,y,z) (z ^ (x & (y ^ z))) -#define Maj(x,y,z) (((x | y) & z) | (x & y)) +#define Maj(x,y,z) (((x | y) & z) | (x & y)) #define S(x, n) ROR64c(x, n) #define R(x, n) (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)n)) #define Sigma0(x) (S(x, 28) ^ S(x, 34) ^ S(x, 39)) @@ -112,7 +112,7 @@ static int sha512_compress(hash_state * md, unsigned char *buf) /* fill W[16..79] */ for (i = 16; i < 80; i++) { W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16]; - } + } /* Compress */ #ifdef LTC_SMALL_CODE @@ -145,7 +145,7 @@ static int sha512_compress(hash_state * md, unsigned char *buf) RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6); RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7); } -#endif +#endif /* feedback */ @@ -232,7 +232,7 @@ int sha512_done(hash_state * md, unsigned char *out) md->sha512.curlen = 0; } - /* pad upto 120 bytes of zeroes + /* pad upto 120 bytes of zeroes * note: that from 112 to 120 is the 64 MSB of the length. We assume that you won't hash * > 2^64 bits of data... :-) */ @@ -257,12 +257,12 @@ int sha512_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int sha512_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { char *msg; unsigned char hash[64]; diff --git a/src/hashes/tiger.c b/src/hashes/tiger.c index 4d8c6594e..dcacb6441 100644 --- a/src/hashes/tiger.c +++ b/src/hashes/tiger.c @@ -558,16 +558,16 @@ static const ulong64 table[4*256] = { #ifdef _MSC_VER #define INLINE __inline #else - #define INLINE -#endif + #define INLINE +#endif /* one round of the hash function */ INLINE static void tiger_round(ulong64 *a, ulong64 *b, ulong64 *c, ulong64 x, int mul) { ulong64 tmp; - tmp = (*c ^= x); - *a -= t1[byte(tmp, 0)] ^ t2[byte(tmp, 2)] ^ t3[byte(tmp, 4)] ^ t4[byte(tmp, 6)]; - tmp = (*b += t4[byte(tmp, 1)] ^ t3[byte(tmp, 3)] ^ t2[byte(tmp,5)] ^ t1[byte(tmp,7)]); + tmp = (*c ^= x); + *a -= t1[byte(tmp, 0)] ^ t2[byte(tmp, 2)] ^ t3[byte(tmp, 4)] ^ t4[byte(tmp, 6)]; + tmp = (*b += t4[byte(tmp, 1)] ^ t3[byte(tmp, 3)] ^ t2[byte(tmp,5)] ^ t1[byte(tmp,7)]); switch (mul) { case 5: *b = (tmp << 2) + tmp; break; case 7: *b = (tmp << 3) - tmp; break; @@ -578,36 +578,36 @@ INLINE static void tiger_round(ulong64 *a, ulong64 *b, ulong64 *c, ulong64 x, in /* one complete pass */ static void pass(ulong64 *a, ulong64 *b, ulong64 *c, ulong64 *x, int mul) { - tiger_round(a,b,c,x[0],mul); - tiger_round(b,c,a,x[1],mul); - tiger_round(c,a,b,x[2],mul); - tiger_round(a,b,c,x[3],mul); - tiger_round(b,c,a,x[4],mul); - tiger_round(c,a,b,x[5],mul); - tiger_round(a,b,c,x[6],mul); - tiger_round(b,c,a,x[7],mul); -} + tiger_round(a,b,c,x[0],mul); + tiger_round(b,c,a,x[1],mul); + tiger_round(c,a,b,x[2],mul); + tiger_round(a,b,c,x[3],mul); + tiger_round(b,c,a,x[4],mul); + tiger_round(c,a,b,x[5],mul); + tiger_round(a,b,c,x[6],mul); + tiger_round(b,c,a,x[7],mul); +} /* The key mixing schedule */ -static void key_schedule(ulong64 *x) +static void key_schedule(ulong64 *x) { - x[0] -= x[7] ^ CONST64(0xA5A5A5A5A5A5A5A5); - x[1] ^= x[0]; - x[2] += x[1]; - x[3] -= x[2] ^ ((~x[1])<<19); - x[4] ^= x[3]; - x[5] += x[4]; - x[6] -= x[5] ^ ((~x[4])>>23); - x[7] ^= x[6]; - x[0] += x[7]; - x[1] -= x[0] ^ ((~x[7])<<19); - x[2] ^= x[1]; - x[3] += x[2]; - x[4] -= x[3] ^ ((~x[2])>>23); - x[5] ^= x[4]; - x[6] += x[5]; + x[0] -= x[7] ^ CONST64(0xA5A5A5A5A5A5A5A5); + x[1] ^= x[0]; + x[2] += x[1]; + x[3] -= x[2] ^ ((~x[1])<<19); + x[4] ^= x[3]; + x[5] += x[4]; + x[6] -= x[5] ^ ((~x[4])>>23); + x[7] ^= x[6]; + x[0] += x[7]; + x[1] -= x[0] ^ ((~x[7])<<19); + x[2] ^= x[1]; + x[3] += x[2]; + x[4] -= x[3] ^ ((~x[2])>>23); + x[5] ^= x[4]; + x[6] += x[5]; x[7] -= x[6] ^ CONST64(0x0123456789ABCDEF); -} +} #ifdef LTC_CLEAN_STACK static int _tiger_compress(hash_state *md, unsigned char *buf) @@ -709,7 +709,7 @@ int tiger_done(hash_state * md, unsigned char *out) /* pad upto 56 bytes of zeroes */ while (md->tiger.curlen < 56) { - md->tiger.buf[md->tiger.curlen++] = (unsigned char)0; + md->tiger.buf[md->tiger.curlen++] = (unsigned char)0; } /* store length */ @@ -730,12 +730,12 @@ int tiger_done(hash_state * md, unsigned char *out) /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled -*/ +*/ int tiger_test(void) { #ifndef LTC_TEST return CRYPT_NOP; - #else + #else static const struct { char *msg; unsigned char hash[24]; diff --git a/src/mac/f9/f9_done.c b/src/mac/f9/f9_done.c index 8da4c7325..9bcf1b572 100644 --- a/src/mac/f9/f9_done.c +++ b/src/mac/f9/f9_done.c @@ -62,7 +62,7 @@ int f9_done(f9_state *f9, unsigned char *out, unsigned long *outlen) out[x] = f9->ACC[x]; } *outlen = x; - + #ifdef LTC_CLEAN_STACK zeromem(f9, sizeof(*f9)); #endif diff --git a/src/mac/f9/f9_file.c b/src/mac/f9/f9_file.c index 88216a945..49d732b99 100644 --- a/src/mac/f9/f9_file.c +++ b/src/mac/f9/f9_file.c @@ -10,7 +10,7 @@ */ #include "tomcrypt.h" -/** +/** @file f9_file.c f9 support, process a file, Tom St Denis */ @@ -29,7 +29,7 @@ */ int f9_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE diff --git a/src/mac/f9/f9_init.c b/src/mac/f9/f9_init.c index b6b878f4e..ec026b968 100644 --- a/src/mac/f9/f9_init.c +++ b/src/mac/f9/f9_init.c @@ -45,12 +45,12 @@ int f9_init(f9_state *f9, int cipher, const unsigned char *key, unsigned long ke if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, &f9->key)) != CRYPT_OK) { goto done; } - + /* make the second key */ for (x = 0; (unsigned)x < keylen; x++) { f9->akey[x] = key[x] ^ 0xAA; } - + /* setup struct */ zeromem(f9->IV, cipher_descriptor[cipher].block_length); zeromem(f9->ACC, cipher_descriptor[cipher].block_length); diff --git a/src/mac/f9/f9_memory.c b/src/mac/f9/f9_memory.c index 0850dc342..e07a05cb2 100644 --- a/src/mac/f9/f9_memory.c +++ b/src/mac/f9/f9_memory.c @@ -17,7 +17,7 @@ #ifdef LTC_F9_MODE -/** f9-MAC a block of memory +/** f9-MAC a block of memory @param cipher Index of cipher to use @param key [in] Secret key @param keylen Length of key in octets @@ -27,7 +27,7 @@ @param outlen [in/out] Output size and final tag size Return CRYPT_OK on success. */ -int f9_memory(int cipher, +int f9_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) diff --git a/src/mac/f9/f9_memory_multi.c b/src/mac/f9/f9_memory_multi.c index 7a13ff953..6c8f2dcc9 100644 --- a/src/mac/f9/f9_memory_multi.c +++ b/src/mac/f9/f9_memory_multi.c @@ -11,7 +11,7 @@ #include "tomcrypt.h" #include -/** +/** @file f9_memory_multi.c f9 support, process multiple blocks of memory, Tom St Denis */ @@ -19,7 +19,7 @@ #ifdef LTC_F9_MODE /** - f9 multiple blocks of memory + f9 multiple blocks of memory @param cipher The index of the desired cipher @param key The secret key @param keylen The length of the secret key (octets) @@ -30,7 +30,7 @@ @param ... tuples of (data,len) pairs to f9, terminated with a (NULL,x) (x=don't care) @return CRYPT_OK if successful */ -int f9_memory_multi(int cipher, +int f9_memory_multi(int cipher, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...) @@ -57,7 +57,7 @@ int f9_memory_multi(int cipher, goto LBL_ERR; } va_start(args, inlen); - curptr = in; + curptr = in; curlen = inlen; for (;;) { /* process buf */ @@ -80,7 +80,7 @@ int f9_memory_multi(int cipher, #endif XFREE(f9); va_end(args); - return err; + return err; } #endif diff --git a/src/mac/f9/f9_test.c b/src/mac/f9/f9_test.c index b92c63064..d08f6d24c 100644 --- a/src/mac/f9/f9_test.c +++ b/src/mac/f9/f9_test.c @@ -12,7 +12,7 @@ /** @file f9_test.c - f9 Support, Test F9 mode + f9 Support, Test F9 mode */ #ifdef LTC_F9_MODE @@ -39,7 +39,7 @@ int f9_test(void) { 105, { 0x83, 0xFD, 0x23, 0xA2, 0x44, 0xA7, 0x4C, 0xF3, 0x58, 0xDA, 0x30, 0x19, 0xF1, 0x72, 0x26, 0x35 }, - { 0x36, 0xAF, 0x61, 0x44, 0x4F, 0x30, 0x2A, 0xD2, + { 0x36, 0xAF, 0x61, 0x44, 0x4F, 0x30, 0x2A, 0xD2, 0x35, 0xC6, 0x87, 0x16, 0x63, 0x3C, 0x66, 0xFB, 0x75, 0x0C, 0x26, 0x68, 0x65, 0xD5, 0x3C, 0x11, 0xEA, 0x05, 0xB1, 0xE9, 0xFA, 0x49, 0xC8, 0x39, 0x8D, 0x48, 0xE1, 0xEF, 0xA5, 0x90, 0x9D, 0x39, 0x47, 0x90, 0x28, 0x37, 0xF5, 0xAE, 0x96, 0xD5, 0xA0, 0x5B, 0xC8, 0xD6, 0x1C, 0xA8, 0xDB, 0xEF, 0x1B, 0x13, 0xA4, 0xB4, 0xAB, 0xFE, 0x4F, 0xB1, 0x00, 0x60, 0x45, 0xB6, 0x74, 0xBB, 0x54, 0x72, 0x93, 0x04, 0xC3, 0x82, 0xBE, 0x53, 0xA5, 0xAF, 0x05, 0x55, 0x61, 0x76, 0xF6, 0xEA, 0xA2, 0xEF, 0x1D, 0x05, 0xE4, 0xB0, 0x83, 0x18, 0x1E, 0xE6, 0x74, 0xCD, 0xA5, 0xA4, 0x85, 0xF7, 0x4D, 0x7A, diff --git a/src/mac/pelican/pelican_memory.c b/src/mac/pelican/pelican_memory.c index 6eabaa16a..f5e7b4a90 100644 --- a/src/mac/pelican/pelican_memory.c +++ b/src/mac/pelican/pelican_memory.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pelican_memory.c - Pelican MAC, MAC a block of memory, by Tom St Denis + Pelican MAC, MAC a block of memory, by Tom St Denis */ #ifdef LTC_PELICAN @@ -23,7 +23,7 @@ @param keylen The length of the key (octets) @param in The input to MAC @param inlen The length of the input (octets) - @param out [out] The output TAG + @param out [out] The output TAG @return CRYPT_OK on success */ int pelican_memory(const unsigned char *key, unsigned long keylen, @@ -34,7 +34,7 @@ int pelican_memory(const unsigned char *key, unsigned long keylen, int err; pel = XMALLOC(sizeof(*pel)); - if (pel == NULL) { + if (pel == NULL) { return CRYPT_MEM; } @@ -47,7 +47,7 @@ int pelican_memory(const unsigned char *key, unsigned long keylen, return err; } err = pelican_done(pel, out); - XFREE(pel); + XFREE(pel); return err; } diff --git a/src/mac/pelican/pelican_test.c b/src/mac/pelican/pelican_test.c index e743faa77..230026b3b 100644 --- a/src/mac/pelican/pelican_test.c +++ b/src/mac/pelican/pelican_test.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pelican_test.c - Pelican MAC, test, by Tom St Denis + Pelican MAC, test, by Tom St Denis */ #ifdef LTC_PELICAN @@ -31,7 +31,7 @@ int pelican_test(void) { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, { 0 }, - { 0xeb, 0x58, 0x37, 0x15, 0xf8, 0x34, 0xde, 0xe5, + { 0xeb, 0x58, 0x37, 0x15, 0xf8, 0x34, 0xde, 0xe5, 0xa4, 0xd1, 0x6e, 0xe4, 0xb9, 0xd7, 0x76, 0x0e, }, 16, 0 }, @@ -41,7 +41,7 @@ int pelican_test(void) { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, { 0x00, 0x01, 0x02 }, - { 0x1c, 0x97, 0x40, 0x60, 0x6c, 0x58, 0x17, 0x2d, + { 0x1c, 0x97, 0x40, 0x60, 0x6c, 0x58, 0x17, 0x2d, 0x03, 0x94, 0x19, 0x70, 0x81, 0xc4, 0x38, 0x54, }, 16, 3 }, @@ -52,7 +52,7 @@ int pelican_test(void) 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, - { 0x03, 0xcc, 0x46, 0xb8, 0xac, 0xa7, 0x9c, 0x36, + { 0x03, 0xcc, 0x46, 0xb8, 0xac, 0xa7, 0x9c, 0x36, 0x1e, 0x8c, 0x6e, 0xa6, 0x7b, 0x89, 0x32, 0x49, }, 16, 16 }, @@ -65,7 +65,7 @@ int pelican_test(void) 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }, - { 0x89, 0xcc, 0x36, 0x58, 0x1b, 0xdd, 0x4d, 0xb5, + { 0x89, 0xcc, 0x36, 0x58, 0x1b, 0xdd, 0x4d, 0xb5, 0x78, 0xbb, 0xac, 0xf0, 0xff, 0x8b, 0x08, 0x15, }, 16, 32 }, @@ -79,7 +79,7 @@ int pelican_test(void) 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x23 }, - { 0x4a, 0x7d, 0x45, 0x4d, 0xcd, 0xb5, 0xda, 0x8d, + { 0x4a, 0x7d, 0x45, 0x4d, 0xcd, 0xb5, 0xda, 0x8d, 0x48, 0x78, 0x16, 0x48, 0x5d, 0x45, 0x95, 0x99, }, 16, 35 }, @@ -87,8 +87,8 @@ int pelican_test(void) int x, err; unsigned char out[16]; pelican_state pel; - - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { + + for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { if ((err = pelican_init(&pel, tests[x].K, tests[x].keylen)) != CRYPT_OK) { return err; } diff --git a/src/mac/pmac/pmac_done.c b/src/mac/pmac/pmac_done.c index 88076c68e..6ad5646b5 100644 --- a/src/mac/pmac/pmac_done.c +++ b/src/mac/pmac/pmac_done.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pmac_done.c - PMAC implementation, terminate a session, by Tom St Denis + PMAC implementation, terminate a session, by Tom St Denis */ #ifdef LTC_PMAC diff --git a/src/mac/pmac/pmac_file.c b/src/mac/pmac/pmac_file.c index c7a9f74dc..c6849d743 100644 --- a/src/mac/pmac/pmac_file.c +++ b/src/mac/pmac/pmac_file.c @@ -10,15 +10,15 @@ */ #include "tomcrypt.h" -/** +/** @file pmac_file.c - PMAC implementation, process a file, by Tom St Denis + PMAC implementation, process a file, by Tom St Denis */ #ifdef LTC_PMAC /** - PMAC a file + PMAC a file @param cipher The index of the cipher desired @param key The secret key @param keylen The length of the secret key (octets) @@ -27,9 +27,9 @@ @param outlen [in/out] Max size and resulting size of the authentication tag @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled */ -int pmac_file(int cipher, +int pmac_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE diff --git a/src/mac/pmac/pmac_memory.c b/src/mac/pmac/pmac_memory.c index 70b961641..f73244a66 100644 --- a/src/mac/pmac/pmac_memory.c +++ b/src/mac/pmac/pmac_memory.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pmac_memory.c - PMAC implementation, process a block of memory, by Tom St Denis + PMAC implementation, process a block of memory, by Tom St Denis */ #ifdef LTC_PMAC @@ -28,7 +28,7 @@ @param outlen [in/out] The max size and resulting size of the authentication tag @return CRYPT_OK if successful */ -int pmac_memory(int cipher, +int pmac_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) @@ -46,7 +46,7 @@ int pmac_memory(int cipher, if (pmac == NULL) { return CRYPT_MEM; } - + if ((err = pmac_init(pmac, cipher, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } @@ -64,7 +64,7 @@ int pmac_memory(int cipher, #endif XFREE(pmac); - return err; + return err; } #endif diff --git a/src/mac/pmac/pmac_memory_multi.c b/src/mac/pmac/pmac_memory_multi.c index 36783d3ba..913840a06 100644 --- a/src/mac/pmac/pmac_memory_multi.c +++ b/src/mac/pmac/pmac_memory_multi.c @@ -11,9 +11,9 @@ #include "tomcrypt.h" #include -/** +/** @file pmac_memory_multi.c - PMAC implementation, process multiple blocks of memory, by Tom St Denis + PMAC implementation, process multiple blocks of memory, by Tom St Denis */ #ifdef LTC_PMAC @@ -30,7 +30,7 @@ @param ... tuples of (data,len) pairs to PMAC, terminated with a (NULL,x) (x=don't care) @return CRYPT_OK if successful */ -int pmac_memory_multi(int cipher, +int pmac_memory_multi(int cipher, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...) @@ -51,12 +51,12 @@ int pmac_memory_multi(int cipher, if (pmac == NULL) { return CRYPT_MEM; } - + if ((err = pmac_init(pmac, cipher, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } va_start(args, inlen); - curptr = in; + curptr = in; curlen = inlen; for (;;) { /* process buf */ @@ -79,7 +79,7 @@ int pmac_memory_multi(int cipher, #endif XFREE(pmac); va_end(args); - return err; + return err; } #endif diff --git a/src/mac/pmac/pmac_ntz.c b/src/mac/pmac/pmac_ntz.c index b5137da3c..2e649f908 100644 --- a/src/mac/pmac/pmac_ntz.c +++ b/src/mac/pmac/pmac_ntz.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pmac_ntz.c - PMAC implementation, internal function, by Tom St Denis + PMAC implementation, internal function, by Tom St Denis */ #ifdef LTC_PMAC diff --git a/src/mac/pmac/pmac_shift_xor.c b/src/mac/pmac/pmac_shift_xor.c index 122cadb53..27aa6cc43 100644 --- a/src/mac/pmac/pmac_shift_xor.c +++ b/src/mac/pmac/pmac_shift_xor.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pmac_shift_xor.c - PMAC implementation, internal function, by Tom St Denis + PMAC implementation, internal function, by Tom St Denis */ #ifdef LTC_PMAC diff --git a/src/mac/pmac/pmac_test.c b/src/mac/pmac/pmac_test.c index fe91c646a..253cb5f72 100644 --- a/src/mac/pmac/pmac_test.c +++ b/src/mac/pmac/pmac_test.c @@ -10,15 +10,15 @@ */ #include "tomcrypt.h" -/** +/** @file pmac_test.c - PMAC implementation, self-test, by Tom St Denis + PMAC implementation, self-test, by Tom St Denis */ #ifdef LTC_PMAC -/** +/** Test the LTC_OMAC implementation @return CRYPT_OK if successful, CRYPT_NOP if testing has been disabled */ @@ -27,7 +27,7 @@ int pmac_test(void) #if !defined(LTC_TEST) return CRYPT_NOP; #else - static const struct { + static const struct { int msglen; unsigned char key[16], msg[34], tag[16]; } tests[] = { @@ -125,7 +125,7 @@ int pmac_test(void) unsigned long len; unsigned char outtag[MAXBLOCKSIZE]; - /* AES can be under rijndael or aes... try to find it */ + /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { if ((idx = find_cipher("rijndael")) == -1) { return CRYPT_NOP; @@ -137,7 +137,7 @@ int pmac_test(void) if ((err = pmac_memory(idx, tests[x].key, 16, tests[x].msg, tests[x].msglen, outtag, &len)) != CRYPT_OK) { return err; } - + if (XMEMCMP(outtag, tests[x].tag, len)) { #if 0 unsigned long y; @@ -158,7 +158,7 @@ int pmac_test(void) #endif /* PMAC_MODE */ - + /* $Source$ */ /* $Revision$ */ diff --git a/src/mac/xcbc/xcbc_done.c b/src/mac/xcbc/xcbc_done.c index 6640eeb16..1573263e6 100644 --- a/src/mac/xcbc/xcbc_done.c +++ b/src/mac/xcbc/xcbc_done.c @@ -62,7 +62,7 @@ int xcbc_done(xcbc_state *xcbc, unsigned char *out, unsigned long *outlen) out[x] = xcbc->IV[x]; } *outlen = x; - + #ifdef LTC_CLEAN_STACK zeromem(xcbc, sizeof(*xcbc)); #endif diff --git a/src/mac/xcbc/xcbc_file.c b/src/mac/xcbc/xcbc_file.c index 3d75b4ec3..dd7767f5d 100644 --- a/src/mac/xcbc/xcbc_file.c +++ b/src/mac/xcbc/xcbc_file.c @@ -10,7 +10,7 @@ */ #include "tomcrypt.h" -/** +/** @file xcbc_file.c XCBC support, process a file, Tom St Denis */ @@ -27,9 +27,9 @@ @param outlen [in/out] The max size and resulting size of the authentication tag @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled */ -int xcbc_file(int cipher, +int xcbc_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE diff --git a/src/mac/xcbc/xcbc_init.c b/src/mac/xcbc/xcbc_init.c index 94c9d79f1..b4ad2e918 100644 --- a/src/mac/xcbc/xcbc_init.c +++ b/src/mac/xcbc/xcbc_init.c @@ -71,7 +71,7 @@ int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned l if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, skey)) != CRYPT_OK) { goto done; } - + /* make the three keys */ for (y = 0; y < 3; y++) { for (x = 0; x < cipher_descriptor[cipher].block_length; x++) { @@ -80,10 +80,10 @@ int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned l cipher_descriptor[cipher].ecb_encrypt(xcbc->K[y], xcbc->K[y], skey); } } - + /* setup K1 */ err = cipher_descriptor[cipher].setup(xcbc->K[0], k1, 0, &xcbc->key); - + /* setup struct */ zeromem(xcbc->IV, cipher_descriptor[cipher].block_length); xcbc->blocksize = cipher_descriptor[cipher].block_length; @@ -91,7 +91,7 @@ int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned l xcbc->buflen = 0; done: cipher_descriptor[cipher].done(skey); - if (skey != NULL) { + if (skey != NULL) { #ifdef LTC_CLEAN_STACK zeromem(skey, sizeof(*skey)); #endif diff --git a/src/mac/xcbc/xcbc_memory.c b/src/mac/xcbc/xcbc_memory.c index 124817ac2..aac9298d5 100644 --- a/src/mac/xcbc/xcbc_memory.c +++ b/src/mac/xcbc/xcbc_memory.c @@ -17,7 +17,7 @@ #ifdef LTC_XCBC -/** XCBC-MAC a block of memory +/** XCBC-MAC a block of memory @param cipher Index of cipher to use @param key [in] Secret key @param keylen Length of key in octets @@ -27,7 +27,7 @@ @param outlen [in/out] Output size and final tag size Return CRYPT_OK on success. */ -int xcbc_memory(int cipher, +int xcbc_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) diff --git a/src/mac/xcbc/xcbc_memory_multi.c b/src/mac/xcbc/xcbc_memory_multi.c index a23790704..994bdce1a 100644 --- a/src/mac/xcbc/xcbc_memory_multi.c +++ b/src/mac/xcbc/xcbc_memory_multi.c @@ -11,7 +11,7 @@ #include "tomcrypt.h" #include -/** +/** @file xcbc_memory_multi.c XCBC support, process multiple blocks of memory, Tom St Denis */ @@ -19,7 +19,7 @@ #ifdef LTC_XCBC /** - XCBC multiple blocks of memory + XCBC multiple blocks of memory @param cipher The index of the desired cipher @param key The secret key @param keylen The length of the secret key (octets) @@ -30,7 +30,7 @@ @param ... tuples of (data,len) pairs to XCBC, terminated with a (NULL,x) (x=don't care) @return CRYPT_OK if successful */ -int xcbc_memory_multi(int cipher, +int xcbc_memory_multi(int cipher, const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen, const unsigned char *in, unsigned long inlen, ...) @@ -57,7 +57,7 @@ int xcbc_memory_multi(int cipher, goto LBL_ERR; } va_start(args, inlen); - curptr = in; + curptr = in; curlen = inlen; for (;;) { /* process buf */ @@ -80,7 +80,7 @@ int xcbc_memory_multi(int cipher, #endif XFREE(xcbc); va_end(args); - return err; + return err; } #endif diff --git a/src/mac/xcbc/xcbc_test.c b/src/mac/xcbc/xcbc_test.c index 1bd584083..f7610b254 100644 --- a/src/mac/xcbc/xcbc_test.c +++ b/src/mac/xcbc/xcbc_test.c @@ -31,64 +31,64 @@ int xcbc_test(void) } tests[] = { { 0, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0 }, - { 0x75, 0xf0, 0x25, 0x1d, 0x52, 0x8a, 0xc0, 0x1c, + { 0x75, 0xf0, 0x25, 0x1d, 0x52, 0x8a, 0xc0, 0x1c, 0x45, 0x73, 0xdf, 0xd5, 0x84, 0xd7, 0x9f, 0x29 } }, { 3, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0x00, 0x01, 0x02 }, - { 0x5b, 0x37, 0x65, 0x80, 0xae, 0x2f, 0x19, 0xaf, + { 0x5b, 0x37, 0x65, 0x80, 0xae, 0x2f, 0x19, 0xaf, 0xe7, 0x21, 0x9c, 0xee, 0xf1, 0x72, 0x75, 0x6f } }, { 16, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, - { 0xd2, 0xa2, 0x46, 0xfa, 0x34, 0x9b, 0x68, 0xa7, + { 0xd2, 0xa2, 0x46, 0xfa, 0x34, 0x9b, 0x68, 0xa7, 0x99, 0x98, 0xa4, 0x39, 0x4f, 0xf7, 0xa2, 0x63 } }, { 32, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, - { 0xf5, 0x4f, 0x0e, 0xc8, 0xd2, 0xb9, 0xf3, 0xd3, + { 0xf5, 0x4f, 0x0e, 0xc8, 0xd2, 0xb9, 0xf3, 0xd3, 0x68, 0x07, 0x73, 0x4b, 0xd5, 0x28, 0x3f, 0xd4 } }, { 34, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, - { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21 }, - { 0xbe, 0xcb, 0xb3, 0xbc, 0xcd, 0xb5, 0x18, 0xa3, + { 0xbe, 0xcb, 0xb3, 0xbc, 0xcd, 0xb5, 0x18, 0xa3, 0x06, 0x77, 0xd5, 0x48, 0x1f, 0xb6, 0xb4, 0xd8 }, }, @@ -99,7 +99,7 @@ int xcbc_test(void) unsigned long taglen; int err, x, idx; - /* AES can be under rijndael or aes... try to find it */ + /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { if ((idx = find_cipher("rijndael")) == -1) { return CRYPT_NOP; diff --git a/src/math/fp/ltc_ecc_fp_mulmod.c b/src/math/fp/ltc_ecc_fp_mulmod.c index 87c128fc9..0e6237577 100644 --- a/src/math/fp/ltc_ecc_fp_mulmod.c +++ b/src/math/fp/ltc_ecc_fp_mulmod.c @@ -13,7 +13,7 @@ /** @file ltc_ecc_fp_mulmod.c ECC Crypto, Tom St Denis -*/ +*/ #if defined(LTC_MECC) && defined(LTC_MECC_FP) #include @@ -30,12 +30,12 @@ #if (FP_LUT > 12) || (FP_LUT < 2) #error FP_LUT must be between 2 and 12 inclusively -#endif +#endif /** Our FP cache */ static struct { ecc_point *g, /* cached COPY of base point */ - *LUT[1U< 6 - { 1, 0, 0 }, { 2, 1, 64 }, { 2, 2, 64 }, { 3, 3, 64 }, { 2, 4, 64 }, { 3, 5, 64 }, { 3, 6, 64 }, { 4, 7, 64 }, - { 2, 8, 64 }, { 3, 9, 64 }, { 3, 10, 64 }, { 4, 11, 64 }, { 3, 12, 64 }, { 4, 13, 64 }, { 4, 14, 64 }, { 5, 15, 64 }, - { 2, 16, 64 }, { 3, 17, 64 }, { 3, 18, 64 }, { 4, 19, 64 }, { 3, 20, 64 }, { 4, 21, 64 }, { 4, 22, 64 }, { 5, 23, 64 }, - { 3, 24, 64 }, { 4, 25, 64 }, { 4, 26, 64 }, { 5, 27, 64 }, { 4, 28, 64 }, { 5, 29, 64 }, { 5, 30, 64 }, { 6, 31, 64 }, - { 2, 32, 64 }, { 3, 33, 64 }, { 3, 34, 64 }, { 4, 35, 64 }, { 3, 36, 64 }, { 4, 37, 64 }, { 4, 38, 64 }, { 5, 39, 64 }, - { 3, 40, 64 }, { 4, 41, 64 }, { 4, 42, 64 }, { 5, 43, 64 }, { 4, 44, 64 }, { 5, 45, 64 }, { 5, 46, 64 }, { 6, 47, 64 }, - { 3, 48, 64 }, { 4, 49, 64 }, { 4, 50, 64 }, { 5, 51, 64 }, { 4, 52, 64 }, { 5, 53, 64 }, { 5, 54, 64 }, { 6, 55, 64 }, - { 4, 56, 64 }, { 5, 57, 64 }, { 5, 58, 64 }, { 6, 59, 64 }, { 5, 60, 64 }, { 6, 61, 64 }, { 6, 62, 64 }, { 7, 63, 64 }, + { 1, 0, 0 }, { 2, 1, 64 }, { 2, 2, 64 }, { 3, 3, 64 }, { 2, 4, 64 }, { 3, 5, 64 }, { 3, 6, 64 }, { 4, 7, 64 }, + { 2, 8, 64 }, { 3, 9, 64 }, { 3, 10, 64 }, { 4, 11, 64 }, { 3, 12, 64 }, { 4, 13, 64 }, { 4, 14, 64 }, { 5, 15, 64 }, + { 2, 16, 64 }, { 3, 17, 64 }, { 3, 18, 64 }, { 4, 19, 64 }, { 3, 20, 64 }, { 4, 21, 64 }, { 4, 22, 64 }, { 5, 23, 64 }, + { 3, 24, 64 }, { 4, 25, 64 }, { 4, 26, 64 }, { 5, 27, 64 }, { 4, 28, 64 }, { 5, 29, 64 }, { 5, 30, 64 }, { 6, 31, 64 }, + { 2, 32, 64 }, { 3, 33, 64 }, { 3, 34, 64 }, { 4, 35, 64 }, { 3, 36, 64 }, { 4, 37, 64 }, { 4, 38, 64 }, { 5, 39, 64 }, + { 3, 40, 64 }, { 4, 41, 64 }, { 4, 42, 64 }, { 5, 43, 64 }, { 4, 44, 64 }, { 5, 45, 64 }, { 5, 46, 64 }, { 6, 47, 64 }, + { 3, 48, 64 }, { 4, 49, 64 }, { 4, 50, 64 }, { 5, 51, 64 }, { 4, 52, 64 }, { 5, 53, 64 }, { 5, 54, 64 }, { 6, 55, 64 }, + { 4, 56, 64 }, { 5, 57, 64 }, { 5, 58, 64 }, { 6, 59, 64 }, { 5, 60, 64 }, { 6, 61, 64 }, { 6, 62, 64 }, { 7, 63, 64 }, #if FP_LUT > 7 - { 1, 0, 0 }, { 2, 1, 128 }, { 2, 2, 128 }, { 3, 3, 128 }, { 2, 4, 128 }, { 3, 5, 128 }, { 3, 6, 128 }, { 4, 7, 128 }, - { 2, 8, 128 }, { 3, 9, 128 }, { 3, 10, 128 }, { 4, 11, 128 }, { 3, 12, 128 }, { 4, 13, 128 }, { 4, 14, 128 }, { 5, 15, 128 }, - { 2, 16, 128 }, { 3, 17, 128 }, { 3, 18, 128 }, { 4, 19, 128 }, { 3, 20, 128 }, { 4, 21, 128 }, { 4, 22, 128 }, { 5, 23, 128 }, - { 3, 24, 128 }, { 4, 25, 128 }, { 4, 26, 128 }, { 5, 27, 128 }, { 4, 28, 128 }, { 5, 29, 128 }, { 5, 30, 128 }, { 6, 31, 128 }, - { 2, 32, 128 }, { 3, 33, 128 }, { 3, 34, 128 }, { 4, 35, 128 }, { 3, 36, 128 }, { 4, 37, 128 }, { 4, 38, 128 }, { 5, 39, 128 }, - { 3, 40, 128 }, { 4, 41, 128 }, { 4, 42, 128 }, { 5, 43, 128 }, { 4, 44, 128 }, { 5, 45, 128 }, { 5, 46, 128 }, { 6, 47, 128 }, - { 3, 48, 128 }, { 4, 49, 128 }, { 4, 50, 128 }, { 5, 51, 128 }, { 4, 52, 128 }, { 5, 53, 128 }, { 5, 54, 128 }, { 6, 55, 128 }, - { 4, 56, 128 }, { 5, 57, 128 }, { 5, 58, 128 }, { 6, 59, 128 }, { 5, 60, 128 }, { 6, 61, 128 }, { 6, 62, 128 }, { 7, 63, 128 }, - { 2, 64, 128 }, { 3, 65, 128 }, { 3, 66, 128 }, { 4, 67, 128 }, { 3, 68, 128 }, { 4, 69, 128 }, { 4, 70, 128 }, { 5, 71, 128 }, - { 3, 72, 128 }, { 4, 73, 128 }, { 4, 74, 128 }, { 5, 75, 128 }, { 4, 76, 128 }, { 5, 77, 128 }, { 5, 78, 128 }, { 6, 79, 128 }, - { 3, 80, 128 }, { 4, 81, 128 }, { 4, 82, 128 }, { 5, 83, 128 }, { 4, 84, 128 }, { 5, 85, 128 }, { 5, 86, 128 }, { 6, 87, 128 }, - { 4, 88, 128 }, { 5, 89, 128 }, { 5, 90, 128 }, { 6, 91, 128 }, { 5, 92, 128 }, { 6, 93, 128 }, { 6, 94, 128 }, { 7, 95, 128 }, - { 3, 96, 128 }, { 4, 97, 128 }, { 4, 98, 128 }, { 5, 99, 128 }, { 4, 100, 128 }, { 5, 101, 128 }, { 5, 102, 128 }, { 6, 103, 128 }, - { 4, 104, 128 }, { 5, 105, 128 }, { 5, 106, 128 }, { 6, 107, 128 }, { 5, 108, 128 }, { 6, 109, 128 }, { 6, 110, 128 }, { 7, 111, 128 }, - { 4, 112, 128 }, { 5, 113, 128 }, { 5, 114, 128 }, { 6, 115, 128 }, { 5, 116, 128 }, { 6, 117, 128 }, { 6, 118, 128 }, { 7, 119, 128 }, - { 5, 120, 128 }, { 6, 121, 128 }, { 6, 122, 128 }, { 7, 123, 128 }, { 6, 124, 128 }, { 7, 125, 128 }, { 7, 126, 128 }, { 8, 127, 128 }, + { 1, 0, 0 }, { 2, 1, 128 }, { 2, 2, 128 }, { 3, 3, 128 }, { 2, 4, 128 }, { 3, 5, 128 }, { 3, 6, 128 }, { 4, 7, 128 }, + { 2, 8, 128 }, { 3, 9, 128 }, { 3, 10, 128 }, { 4, 11, 128 }, { 3, 12, 128 }, { 4, 13, 128 }, { 4, 14, 128 }, { 5, 15, 128 }, + { 2, 16, 128 }, { 3, 17, 128 }, { 3, 18, 128 }, { 4, 19, 128 }, { 3, 20, 128 }, { 4, 21, 128 }, { 4, 22, 128 }, { 5, 23, 128 }, + { 3, 24, 128 }, { 4, 25, 128 }, { 4, 26, 128 }, { 5, 27, 128 }, { 4, 28, 128 }, { 5, 29, 128 }, { 5, 30, 128 }, { 6, 31, 128 }, + { 2, 32, 128 }, { 3, 33, 128 }, { 3, 34, 128 }, { 4, 35, 128 }, { 3, 36, 128 }, { 4, 37, 128 }, { 4, 38, 128 }, { 5, 39, 128 }, + { 3, 40, 128 }, { 4, 41, 128 }, { 4, 42, 128 }, { 5, 43, 128 }, { 4, 44, 128 }, { 5, 45, 128 }, { 5, 46, 128 }, { 6, 47, 128 }, + { 3, 48, 128 }, { 4, 49, 128 }, { 4, 50, 128 }, { 5, 51, 128 }, { 4, 52, 128 }, { 5, 53, 128 }, { 5, 54, 128 }, { 6, 55, 128 }, + { 4, 56, 128 }, { 5, 57, 128 }, { 5, 58, 128 }, { 6, 59, 128 }, { 5, 60, 128 }, { 6, 61, 128 }, { 6, 62, 128 }, { 7, 63, 128 }, + { 2, 64, 128 }, { 3, 65, 128 }, { 3, 66, 128 }, { 4, 67, 128 }, { 3, 68, 128 }, { 4, 69, 128 }, { 4, 70, 128 }, { 5, 71, 128 }, + { 3, 72, 128 }, { 4, 73, 128 }, { 4, 74, 128 }, { 5, 75, 128 }, { 4, 76, 128 }, { 5, 77, 128 }, { 5, 78, 128 }, { 6, 79, 128 }, + { 3, 80, 128 }, { 4, 81, 128 }, { 4, 82, 128 }, { 5, 83, 128 }, { 4, 84, 128 }, { 5, 85, 128 }, { 5, 86, 128 }, { 6, 87, 128 }, + { 4, 88, 128 }, { 5, 89, 128 }, { 5, 90, 128 }, { 6, 91, 128 }, { 5, 92, 128 }, { 6, 93, 128 }, { 6, 94, 128 }, { 7, 95, 128 }, + { 3, 96, 128 }, { 4, 97, 128 }, { 4, 98, 128 }, { 5, 99, 128 }, { 4, 100, 128 }, { 5, 101, 128 }, { 5, 102, 128 }, { 6, 103, 128 }, + { 4, 104, 128 }, { 5, 105, 128 }, { 5, 106, 128 }, { 6, 107, 128 }, { 5, 108, 128 }, { 6, 109, 128 }, { 6, 110, 128 }, { 7, 111, 128 }, + { 4, 112, 128 }, { 5, 113, 128 }, { 5, 114, 128 }, { 6, 115, 128 }, { 5, 116, 128 }, { 6, 117, 128 }, { 6, 118, 128 }, { 7, 119, 128 }, + { 5, 120, 128 }, { 6, 121, 128 }, { 6, 122, 128 }, { 7, 123, 128 }, { 6, 124, 128 }, { 7, 125, 128 }, { 7, 126, 128 }, { 8, 127, 128 }, #if FP_LUT > 8 - { 1, 0, 0 }, { 2, 1, 256 }, { 2, 2, 256 }, { 3, 3, 256 }, { 2, 4, 256 }, { 3, 5, 256 }, { 3, 6, 256 }, { 4, 7, 256 }, - { 2, 8, 256 }, { 3, 9, 256 }, { 3, 10, 256 }, { 4, 11, 256 }, { 3, 12, 256 }, { 4, 13, 256 }, { 4, 14, 256 }, { 5, 15, 256 }, - { 2, 16, 256 }, { 3, 17, 256 }, { 3, 18, 256 }, { 4, 19, 256 }, { 3, 20, 256 }, { 4, 21, 256 }, { 4, 22, 256 }, { 5, 23, 256 }, - { 3, 24, 256 }, { 4, 25, 256 }, { 4, 26, 256 }, { 5, 27, 256 }, { 4, 28, 256 }, { 5, 29, 256 }, { 5, 30, 256 }, { 6, 31, 256 }, - { 2, 32, 256 }, { 3, 33, 256 }, { 3, 34, 256 }, { 4, 35, 256 }, { 3, 36, 256 }, { 4, 37, 256 }, { 4, 38, 256 }, { 5, 39, 256 }, - { 3, 40, 256 }, { 4, 41, 256 }, { 4, 42, 256 }, { 5, 43, 256 }, { 4, 44, 256 }, { 5, 45, 256 }, { 5, 46, 256 }, { 6, 47, 256 }, - { 3, 48, 256 }, { 4, 49, 256 }, { 4, 50, 256 }, { 5, 51, 256 }, { 4, 52, 256 }, { 5, 53, 256 }, { 5, 54, 256 }, { 6, 55, 256 }, - { 4, 56, 256 }, { 5, 57, 256 }, { 5, 58, 256 }, { 6, 59, 256 }, { 5, 60, 256 }, { 6, 61, 256 }, { 6, 62, 256 }, { 7, 63, 256 }, - { 2, 64, 256 }, { 3, 65, 256 }, { 3, 66, 256 }, { 4, 67, 256 }, { 3, 68, 256 }, { 4, 69, 256 }, { 4, 70, 256 }, { 5, 71, 256 }, - { 3, 72, 256 }, { 4, 73, 256 }, { 4, 74, 256 }, { 5, 75, 256 }, { 4, 76, 256 }, { 5, 77, 256 }, { 5, 78, 256 }, { 6, 79, 256 }, - { 3, 80, 256 }, { 4, 81, 256 }, { 4, 82, 256 }, { 5, 83, 256 }, { 4, 84, 256 }, { 5, 85, 256 }, { 5, 86, 256 }, { 6, 87, 256 }, - { 4, 88, 256 }, { 5, 89, 256 }, { 5, 90, 256 }, { 6, 91, 256 }, { 5, 92, 256 }, { 6, 93, 256 }, { 6, 94, 256 }, { 7, 95, 256 }, - { 3, 96, 256 }, { 4, 97, 256 }, { 4, 98, 256 }, { 5, 99, 256 }, { 4, 100, 256 }, { 5, 101, 256 }, { 5, 102, 256 }, { 6, 103, 256 }, - { 4, 104, 256 }, { 5, 105, 256 }, { 5, 106, 256 }, { 6, 107, 256 }, { 5, 108, 256 }, { 6, 109, 256 }, { 6, 110, 256 }, { 7, 111, 256 }, - { 4, 112, 256 }, { 5, 113, 256 }, { 5, 114, 256 }, { 6, 115, 256 }, { 5, 116, 256 }, { 6, 117, 256 }, { 6, 118, 256 }, { 7, 119, 256 }, - { 5, 120, 256 }, { 6, 121, 256 }, { 6, 122, 256 }, { 7, 123, 256 }, { 6, 124, 256 }, { 7, 125, 256 }, { 7, 126, 256 }, { 8, 127, 256 }, - { 2, 128, 256 }, { 3, 129, 256 }, { 3, 130, 256 }, { 4, 131, 256 }, { 3, 132, 256 }, { 4, 133, 256 }, { 4, 134, 256 }, { 5, 135, 256 }, - { 3, 136, 256 }, { 4, 137, 256 }, { 4, 138, 256 }, { 5, 139, 256 }, { 4, 140, 256 }, { 5, 141, 256 }, { 5, 142, 256 }, { 6, 143, 256 }, - { 3, 144, 256 }, { 4, 145, 256 }, { 4, 146, 256 }, { 5, 147, 256 }, { 4, 148, 256 }, { 5, 149, 256 }, { 5, 150, 256 }, { 6, 151, 256 }, - { 4, 152, 256 }, { 5, 153, 256 }, { 5, 154, 256 }, { 6, 155, 256 }, { 5, 156, 256 }, { 6, 157, 256 }, { 6, 158, 256 }, { 7, 159, 256 }, - { 3, 160, 256 }, { 4, 161, 256 }, { 4, 162, 256 }, { 5, 163, 256 }, { 4, 164, 256 }, { 5, 165, 256 }, { 5, 166, 256 }, { 6, 167, 256 }, - { 4, 168, 256 }, { 5, 169, 256 }, { 5, 170, 256 }, { 6, 171, 256 }, { 5, 172, 256 }, { 6, 173, 256 }, { 6, 174, 256 }, { 7, 175, 256 }, - { 4, 176, 256 }, { 5, 177, 256 }, { 5, 178, 256 }, { 6, 179, 256 }, { 5, 180, 256 }, { 6, 181, 256 }, { 6, 182, 256 }, { 7, 183, 256 }, - { 5, 184, 256 }, { 6, 185, 256 }, { 6, 186, 256 }, { 7, 187, 256 }, { 6, 188, 256 }, { 7, 189, 256 }, { 7, 190, 256 }, { 8, 191, 256 }, - { 3, 192, 256 }, { 4, 193, 256 }, { 4, 194, 256 }, { 5, 195, 256 }, { 4, 196, 256 }, { 5, 197, 256 }, { 5, 198, 256 }, { 6, 199, 256 }, - { 4, 200, 256 }, { 5, 201, 256 }, { 5, 202, 256 }, { 6, 203, 256 }, { 5, 204, 256 }, { 6, 205, 256 }, { 6, 206, 256 }, { 7, 207, 256 }, - { 4, 208, 256 }, { 5, 209, 256 }, { 5, 210, 256 }, { 6, 211, 256 }, { 5, 212, 256 }, { 6, 213, 256 }, { 6, 214, 256 }, { 7, 215, 256 }, - { 5, 216, 256 }, { 6, 217, 256 }, { 6, 218, 256 }, { 7, 219, 256 }, { 6, 220, 256 }, { 7, 221, 256 }, { 7, 222, 256 }, { 8, 223, 256 }, - { 4, 224, 256 }, { 5, 225, 256 }, { 5, 226, 256 }, { 6, 227, 256 }, { 5, 228, 256 }, { 6, 229, 256 }, { 6, 230, 256 }, { 7, 231, 256 }, - { 5, 232, 256 }, { 6, 233, 256 }, { 6, 234, 256 }, { 7, 235, 256 }, { 6, 236, 256 }, { 7, 237, 256 }, { 7, 238, 256 }, { 8, 239, 256 }, - { 5, 240, 256 }, { 6, 241, 256 }, { 6, 242, 256 }, { 7, 243, 256 }, { 6, 244, 256 }, { 7, 245, 256 }, { 7, 246, 256 }, { 8, 247, 256 }, - { 6, 248, 256 }, { 7, 249, 256 }, { 7, 250, 256 }, { 8, 251, 256 }, { 7, 252, 256 }, { 8, 253, 256 }, { 8, 254, 256 }, { 9, 255, 256 }, + { 1, 0, 0 }, { 2, 1, 256 }, { 2, 2, 256 }, { 3, 3, 256 }, { 2, 4, 256 }, { 3, 5, 256 }, { 3, 6, 256 }, { 4, 7, 256 }, + { 2, 8, 256 }, { 3, 9, 256 }, { 3, 10, 256 }, { 4, 11, 256 }, { 3, 12, 256 }, { 4, 13, 256 }, { 4, 14, 256 }, { 5, 15, 256 }, + { 2, 16, 256 }, { 3, 17, 256 }, { 3, 18, 256 }, { 4, 19, 256 }, { 3, 20, 256 }, { 4, 21, 256 }, { 4, 22, 256 }, { 5, 23, 256 }, + { 3, 24, 256 }, { 4, 25, 256 }, { 4, 26, 256 }, { 5, 27, 256 }, { 4, 28, 256 }, { 5, 29, 256 }, { 5, 30, 256 }, { 6, 31, 256 }, + { 2, 32, 256 }, { 3, 33, 256 }, { 3, 34, 256 }, { 4, 35, 256 }, { 3, 36, 256 }, { 4, 37, 256 }, { 4, 38, 256 }, { 5, 39, 256 }, + { 3, 40, 256 }, { 4, 41, 256 }, { 4, 42, 256 }, { 5, 43, 256 }, { 4, 44, 256 }, { 5, 45, 256 }, { 5, 46, 256 }, { 6, 47, 256 }, + { 3, 48, 256 }, { 4, 49, 256 }, { 4, 50, 256 }, { 5, 51, 256 }, { 4, 52, 256 }, { 5, 53, 256 }, { 5, 54, 256 }, { 6, 55, 256 }, + { 4, 56, 256 }, { 5, 57, 256 }, { 5, 58, 256 }, { 6, 59, 256 }, { 5, 60, 256 }, { 6, 61, 256 }, { 6, 62, 256 }, { 7, 63, 256 }, + { 2, 64, 256 }, { 3, 65, 256 }, { 3, 66, 256 }, { 4, 67, 256 }, { 3, 68, 256 }, { 4, 69, 256 }, { 4, 70, 256 }, { 5, 71, 256 }, + { 3, 72, 256 }, { 4, 73, 256 }, { 4, 74, 256 }, { 5, 75, 256 }, { 4, 76, 256 }, { 5, 77, 256 }, { 5, 78, 256 }, { 6, 79, 256 }, + { 3, 80, 256 }, { 4, 81, 256 }, { 4, 82, 256 }, { 5, 83, 256 }, { 4, 84, 256 }, { 5, 85, 256 }, { 5, 86, 256 }, { 6, 87, 256 }, + { 4, 88, 256 }, { 5, 89, 256 }, { 5, 90, 256 }, { 6, 91, 256 }, { 5, 92, 256 }, { 6, 93, 256 }, { 6, 94, 256 }, { 7, 95, 256 }, + { 3, 96, 256 }, { 4, 97, 256 }, { 4, 98, 256 }, { 5, 99, 256 }, { 4, 100, 256 }, { 5, 101, 256 }, { 5, 102, 256 }, { 6, 103, 256 }, + { 4, 104, 256 }, { 5, 105, 256 }, { 5, 106, 256 }, { 6, 107, 256 }, { 5, 108, 256 }, { 6, 109, 256 }, { 6, 110, 256 }, { 7, 111, 256 }, + { 4, 112, 256 }, { 5, 113, 256 }, { 5, 114, 256 }, { 6, 115, 256 }, { 5, 116, 256 }, { 6, 117, 256 }, { 6, 118, 256 }, { 7, 119, 256 }, + { 5, 120, 256 }, { 6, 121, 256 }, { 6, 122, 256 }, { 7, 123, 256 }, { 6, 124, 256 }, { 7, 125, 256 }, { 7, 126, 256 }, { 8, 127, 256 }, + { 2, 128, 256 }, { 3, 129, 256 }, { 3, 130, 256 }, { 4, 131, 256 }, { 3, 132, 256 }, { 4, 133, 256 }, { 4, 134, 256 }, { 5, 135, 256 }, + { 3, 136, 256 }, { 4, 137, 256 }, { 4, 138, 256 }, { 5, 139, 256 }, { 4, 140, 256 }, { 5, 141, 256 }, { 5, 142, 256 }, { 6, 143, 256 }, + { 3, 144, 256 }, { 4, 145, 256 }, { 4, 146, 256 }, { 5, 147, 256 }, { 4, 148, 256 }, { 5, 149, 256 }, { 5, 150, 256 }, { 6, 151, 256 }, + { 4, 152, 256 }, { 5, 153, 256 }, { 5, 154, 256 }, { 6, 155, 256 }, { 5, 156, 256 }, { 6, 157, 256 }, { 6, 158, 256 }, { 7, 159, 256 }, + { 3, 160, 256 }, { 4, 161, 256 }, { 4, 162, 256 }, { 5, 163, 256 }, { 4, 164, 256 }, { 5, 165, 256 }, { 5, 166, 256 }, { 6, 167, 256 }, + { 4, 168, 256 }, { 5, 169, 256 }, { 5, 170, 256 }, { 6, 171, 256 }, { 5, 172, 256 }, { 6, 173, 256 }, { 6, 174, 256 }, { 7, 175, 256 }, + { 4, 176, 256 }, { 5, 177, 256 }, { 5, 178, 256 }, { 6, 179, 256 }, { 5, 180, 256 }, { 6, 181, 256 }, { 6, 182, 256 }, { 7, 183, 256 }, + { 5, 184, 256 }, { 6, 185, 256 }, { 6, 186, 256 }, { 7, 187, 256 }, { 6, 188, 256 }, { 7, 189, 256 }, { 7, 190, 256 }, { 8, 191, 256 }, + { 3, 192, 256 }, { 4, 193, 256 }, { 4, 194, 256 }, { 5, 195, 256 }, { 4, 196, 256 }, { 5, 197, 256 }, { 5, 198, 256 }, { 6, 199, 256 }, + { 4, 200, 256 }, { 5, 201, 256 }, { 5, 202, 256 }, { 6, 203, 256 }, { 5, 204, 256 }, { 6, 205, 256 }, { 6, 206, 256 }, { 7, 207, 256 }, + { 4, 208, 256 }, { 5, 209, 256 }, { 5, 210, 256 }, { 6, 211, 256 }, { 5, 212, 256 }, { 6, 213, 256 }, { 6, 214, 256 }, { 7, 215, 256 }, + { 5, 216, 256 }, { 6, 217, 256 }, { 6, 218, 256 }, { 7, 219, 256 }, { 6, 220, 256 }, { 7, 221, 256 }, { 7, 222, 256 }, { 8, 223, 256 }, + { 4, 224, 256 }, { 5, 225, 256 }, { 5, 226, 256 }, { 6, 227, 256 }, { 5, 228, 256 }, { 6, 229, 256 }, { 6, 230, 256 }, { 7, 231, 256 }, + { 5, 232, 256 }, { 6, 233, 256 }, { 6, 234, 256 }, { 7, 235, 256 }, { 6, 236, 256 }, { 7, 237, 256 }, { 7, 238, 256 }, { 8, 239, 256 }, + { 5, 240, 256 }, { 6, 241, 256 }, { 6, 242, 256 }, { 7, 243, 256 }, { 6, 244, 256 }, { 7, 245, 256 }, { 7, 246, 256 }, { 8, 247, 256 }, + { 6, 248, 256 }, { 7, 249, 256 }, { 7, 250, 256 }, { 8, 251, 256 }, { 7, 252, 256 }, { 8, 253, 256 }, { 8, 254, 256 }, { 9, 255, 256 }, #if FP_LUT > 9 - { 1, 0, 0 }, { 2, 1, 512 }, { 2, 2, 512 }, { 3, 3, 512 }, { 2, 4, 512 }, { 3, 5, 512 }, { 3, 6, 512 }, { 4, 7, 512 }, - { 2, 8, 512 }, { 3, 9, 512 }, { 3, 10, 512 }, { 4, 11, 512 }, { 3, 12, 512 }, { 4, 13, 512 }, { 4, 14, 512 }, { 5, 15, 512 }, - { 2, 16, 512 }, { 3, 17, 512 }, { 3, 18, 512 }, { 4, 19, 512 }, { 3, 20, 512 }, { 4, 21, 512 }, { 4, 22, 512 }, { 5, 23, 512 }, - { 3, 24, 512 }, { 4, 25, 512 }, { 4, 26, 512 }, { 5, 27, 512 }, { 4, 28, 512 }, { 5, 29, 512 }, { 5, 30, 512 }, { 6, 31, 512 }, - { 2, 32, 512 }, { 3, 33, 512 }, { 3, 34, 512 }, { 4, 35, 512 }, { 3, 36, 512 }, { 4, 37, 512 }, { 4, 38, 512 }, { 5, 39, 512 }, - { 3, 40, 512 }, { 4, 41, 512 }, { 4, 42, 512 }, { 5, 43, 512 }, { 4, 44, 512 }, { 5, 45, 512 }, { 5, 46, 512 }, { 6, 47, 512 }, - { 3, 48, 512 }, { 4, 49, 512 }, { 4, 50, 512 }, { 5, 51, 512 }, { 4, 52, 512 }, { 5, 53, 512 }, { 5, 54, 512 }, { 6, 55, 512 }, - { 4, 56, 512 }, { 5, 57, 512 }, { 5, 58, 512 }, { 6, 59, 512 }, { 5, 60, 512 }, { 6, 61, 512 }, { 6, 62, 512 }, { 7, 63, 512 }, - { 2, 64, 512 }, { 3, 65, 512 }, { 3, 66, 512 }, { 4, 67, 512 }, { 3, 68, 512 }, { 4, 69, 512 }, { 4, 70, 512 }, { 5, 71, 512 }, - { 3, 72, 512 }, { 4, 73, 512 }, { 4, 74, 512 }, { 5, 75, 512 }, { 4, 76, 512 }, { 5, 77, 512 }, { 5, 78, 512 }, { 6, 79, 512 }, - { 3, 80, 512 }, { 4, 81, 512 }, { 4, 82, 512 }, { 5, 83, 512 }, { 4, 84, 512 }, { 5, 85, 512 }, { 5, 86, 512 }, { 6, 87, 512 }, - { 4, 88, 512 }, { 5, 89, 512 }, { 5, 90, 512 }, { 6, 91, 512 }, { 5, 92, 512 }, { 6, 93, 512 }, { 6, 94, 512 }, { 7, 95, 512 }, - { 3, 96, 512 }, { 4, 97, 512 }, { 4, 98, 512 }, { 5, 99, 512 }, { 4, 100, 512 }, { 5, 101, 512 }, { 5, 102, 512 }, { 6, 103, 512 }, - { 4, 104, 512 }, { 5, 105, 512 }, { 5, 106, 512 }, { 6, 107, 512 }, { 5, 108, 512 }, { 6, 109, 512 }, { 6, 110, 512 }, { 7, 111, 512 }, - { 4, 112, 512 }, { 5, 113, 512 }, { 5, 114, 512 }, { 6, 115, 512 }, { 5, 116, 512 }, { 6, 117, 512 }, { 6, 118, 512 }, { 7, 119, 512 }, - { 5, 120, 512 }, { 6, 121, 512 }, { 6, 122, 512 }, { 7, 123, 512 }, { 6, 124, 512 }, { 7, 125, 512 }, { 7, 126, 512 }, { 8, 127, 512 }, - { 2, 128, 512 }, { 3, 129, 512 }, { 3, 130, 512 }, { 4, 131, 512 }, { 3, 132, 512 }, { 4, 133, 512 }, { 4, 134, 512 }, { 5, 135, 512 }, - { 3, 136, 512 }, { 4, 137, 512 }, { 4, 138, 512 }, { 5, 139, 512 }, { 4, 140, 512 }, { 5, 141, 512 }, { 5, 142, 512 }, { 6, 143, 512 }, - { 3, 144, 512 }, { 4, 145, 512 }, { 4, 146, 512 }, { 5, 147, 512 }, { 4, 148, 512 }, { 5, 149, 512 }, { 5, 150, 512 }, { 6, 151, 512 }, - { 4, 152, 512 }, { 5, 153, 512 }, { 5, 154, 512 }, { 6, 155, 512 }, { 5, 156, 512 }, { 6, 157, 512 }, { 6, 158, 512 }, { 7, 159, 512 }, - { 3, 160, 512 }, { 4, 161, 512 }, { 4, 162, 512 }, { 5, 163, 512 }, { 4, 164, 512 }, { 5, 165, 512 }, { 5, 166, 512 }, { 6, 167, 512 }, - { 4, 168, 512 }, { 5, 169, 512 }, { 5, 170, 512 }, { 6, 171, 512 }, { 5, 172, 512 }, { 6, 173, 512 }, { 6, 174, 512 }, { 7, 175, 512 }, - { 4, 176, 512 }, { 5, 177, 512 }, { 5, 178, 512 }, { 6, 179, 512 }, { 5, 180, 512 }, { 6, 181, 512 }, { 6, 182, 512 }, { 7, 183, 512 }, - { 5, 184, 512 }, { 6, 185, 512 }, { 6, 186, 512 }, { 7, 187, 512 }, { 6, 188, 512 }, { 7, 189, 512 }, { 7, 190, 512 }, { 8, 191, 512 }, - { 3, 192, 512 }, { 4, 193, 512 }, { 4, 194, 512 }, { 5, 195, 512 }, { 4, 196, 512 }, { 5, 197, 512 }, { 5, 198, 512 }, { 6, 199, 512 }, - { 4, 200, 512 }, { 5, 201, 512 }, { 5, 202, 512 }, { 6, 203, 512 }, { 5, 204, 512 }, { 6, 205, 512 }, { 6, 206, 512 }, { 7, 207, 512 }, - { 4, 208, 512 }, { 5, 209, 512 }, { 5, 210, 512 }, { 6, 211, 512 }, { 5, 212, 512 }, { 6, 213, 512 }, { 6, 214, 512 }, { 7, 215, 512 }, - { 5, 216, 512 }, { 6, 217, 512 }, { 6, 218, 512 }, { 7, 219, 512 }, { 6, 220, 512 }, { 7, 221, 512 }, { 7, 222, 512 }, { 8, 223, 512 }, - { 4, 224, 512 }, { 5, 225, 512 }, { 5, 226, 512 }, { 6, 227, 512 }, { 5, 228, 512 }, { 6, 229, 512 }, { 6, 230, 512 }, { 7, 231, 512 }, - { 5, 232, 512 }, { 6, 233, 512 }, { 6, 234, 512 }, { 7, 235, 512 }, { 6, 236, 512 }, { 7, 237, 512 }, { 7, 238, 512 }, { 8, 239, 512 }, - { 5, 240, 512 }, { 6, 241, 512 }, { 6, 242, 512 }, { 7, 243, 512 }, { 6, 244, 512 }, { 7, 245, 512 }, { 7, 246, 512 }, { 8, 247, 512 }, - { 6, 248, 512 }, { 7, 249, 512 }, { 7, 250, 512 }, { 8, 251, 512 }, { 7, 252, 512 }, { 8, 253, 512 }, { 8, 254, 512 }, { 9, 255, 512 }, - { 2, 256, 512 }, { 3, 257, 512 }, { 3, 258, 512 }, { 4, 259, 512 }, { 3, 260, 512 }, { 4, 261, 512 }, { 4, 262, 512 }, { 5, 263, 512 }, - { 3, 264, 512 }, { 4, 265, 512 }, { 4, 266, 512 }, { 5, 267, 512 }, { 4, 268, 512 }, { 5, 269, 512 }, { 5, 270, 512 }, { 6, 271, 512 }, - { 3, 272, 512 }, { 4, 273, 512 }, { 4, 274, 512 }, { 5, 275, 512 }, { 4, 276, 512 }, { 5, 277, 512 }, { 5, 278, 512 }, { 6, 279, 512 }, - { 4, 280, 512 }, { 5, 281, 512 }, { 5, 282, 512 }, { 6, 283, 512 }, { 5, 284, 512 }, { 6, 285, 512 }, { 6, 286, 512 }, { 7, 287, 512 }, - { 3, 288, 512 }, { 4, 289, 512 }, { 4, 290, 512 }, { 5, 291, 512 }, { 4, 292, 512 }, { 5, 293, 512 }, { 5, 294, 512 }, { 6, 295, 512 }, - { 4, 296, 512 }, { 5, 297, 512 }, { 5, 298, 512 }, { 6, 299, 512 }, { 5, 300, 512 }, { 6, 301, 512 }, { 6, 302, 512 }, { 7, 303, 512 }, - { 4, 304, 512 }, { 5, 305, 512 }, { 5, 306, 512 }, { 6, 307, 512 }, { 5, 308, 512 }, { 6, 309, 512 }, { 6, 310, 512 }, { 7, 311, 512 }, - { 5, 312, 512 }, { 6, 313, 512 }, { 6, 314, 512 }, { 7, 315, 512 }, { 6, 316, 512 }, { 7, 317, 512 }, { 7, 318, 512 }, { 8, 319, 512 }, - { 3, 320, 512 }, { 4, 321, 512 }, { 4, 322, 512 }, { 5, 323, 512 }, { 4, 324, 512 }, { 5, 325, 512 }, { 5, 326, 512 }, { 6, 327, 512 }, - { 4, 328, 512 }, { 5, 329, 512 }, { 5, 330, 512 }, { 6, 331, 512 }, { 5, 332, 512 }, { 6, 333, 512 }, { 6, 334, 512 }, { 7, 335, 512 }, - { 4, 336, 512 }, { 5, 337, 512 }, { 5, 338, 512 }, { 6, 339, 512 }, { 5, 340, 512 }, { 6, 341, 512 }, { 6, 342, 512 }, { 7, 343, 512 }, - { 5, 344, 512 }, { 6, 345, 512 }, { 6, 346, 512 }, { 7, 347, 512 }, { 6, 348, 512 }, { 7, 349, 512 }, { 7, 350, 512 }, { 8, 351, 512 }, - { 4, 352, 512 }, { 5, 353, 512 }, { 5, 354, 512 }, { 6, 355, 512 }, { 5, 356, 512 }, { 6, 357, 512 }, { 6, 358, 512 }, { 7, 359, 512 }, - { 5, 360, 512 }, { 6, 361, 512 }, { 6, 362, 512 }, { 7, 363, 512 }, { 6, 364, 512 }, { 7, 365, 512 }, { 7, 366, 512 }, { 8, 367, 512 }, - { 5, 368, 512 }, { 6, 369, 512 }, { 6, 370, 512 }, { 7, 371, 512 }, { 6, 372, 512 }, { 7, 373, 512 }, { 7, 374, 512 }, { 8, 375, 512 }, - { 6, 376, 512 }, { 7, 377, 512 }, { 7, 378, 512 }, { 8, 379, 512 }, { 7, 380, 512 }, { 8, 381, 512 }, { 8, 382, 512 }, { 9, 383, 512 }, - { 3, 384, 512 }, { 4, 385, 512 }, { 4, 386, 512 }, { 5, 387, 512 }, { 4, 388, 512 }, { 5, 389, 512 }, { 5, 390, 512 }, { 6, 391, 512 }, - { 4, 392, 512 }, { 5, 393, 512 }, { 5, 394, 512 }, { 6, 395, 512 }, { 5, 396, 512 }, { 6, 397, 512 }, { 6, 398, 512 }, { 7, 399, 512 }, - { 4, 400, 512 }, { 5, 401, 512 }, { 5, 402, 512 }, { 6, 403, 512 }, { 5, 404, 512 }, { 6, 405, 512 }, { 6, 406, 512 }, { 7, 407, 512 }, - { 5, 408, 512 }, { 6, 409, 512 }, { 6, 410, 512 }, { 7, 411, 512 }, { 6, 412, 512 }, { 7, 413, 512 }, { 7, 414, 512 }, { 8, 415, 512 }, - { 4, 416, 512 }, { 5, 417, 512 }, { 5, 418, 512 }, { 6, 419, 512 }, { 5, 420, 512 }, { 6, 421, 512 }, { 6, 422, 512 }, { 7, 423, 512 }, - { 5, 424, 512 }, { 6, 425, 512 }, { 6, 426, 512 }, { 7, 427, 512 }, { 6, 428, 512 }, { 7, 429, 512 }, { 7, 430, 512 }, { 8, 431, 512 }, - { 5, 432, 512 }, { 6, 433, 512 }, { 6, 434, 512 }, { 7, 435, 512 }, { 6, 436, 512 }, { 7, 437, 512 }, { 7, 438, 512 }, { 8, 439, 512 }, - { 6, 440, 512 }, { 7, 441, 512 }, { 7, 442, 512 }, { 8, 443, 512 }, { 7, 444, 512 }, { 8, 445, 512 }, { 8, 446, 512 }, { 9, 447, 512 }, - { 4, 448, 512 }, { 5, 449, 512 }, { 5, 450, 512 }, { 6, 451, 512 }, { 5, 452, 512 }, { 6, 453, 512 }, { 6, 454, 512 }, { 7, 455, 512 }, - { 5, 456, 512 }, { 6, 457, 512 }, { 6, 458, 512 }, { 7, 459, 512 }, { 6, 460, 512 }, { 7, 461, 512 }, { 7, 462, 512 }, { 8, 463, 512 }, - { 5, 464, 512 }, { 6, 465, 512 }, { 6, 466, 512 }, { 7, 467, 512 }, { 6, 468, 512 }, { 7, 469, 512 }, { 7, 470, 512 }, { 8, 471, 512 }, - { 6, 472, 512 }, { 7, 473, 512 }, { 7, 474, 512 }, { 8, 475, 512 }, { 7, 476, 512 }, { 8, 477, 512 }, { 8, 478, 512 }, { 9, 479, 512 }, - { 5, 480, 512 }, { 6, 481, 512 }, { 6, 482, 512 }, { 7, 483, 512 }, { 6, 484, 512 }, { 7, 485, 512 }, { 7, 486, 512 }, { 8, 487, 512 }, - { 6, 488, 512 }, { 7, 489, 512 }, { 7, 490, 512 }, { 8, 491, 512 }, { 7, 492, 512 }, { 8, 493, 512 }, { 8, 494, 512 }, { 9, 495, 512 }, - { 6, 496, 512 }, { 7, 497, 512 }, { 7, 498, 512 }, { 8, 499, 512 }, { 7, 500, 512 }, { 8, 501, 512 }, { 8, 502, 512 }, { 9, 503, 512 }, - { 7, 504, 512 }, { 8, 505, 512 }, { 8, 506, 512 }, { 9, 507, 512 }, { 8, 508, 512 }, { 9, 509, 512 }, { 9, 510, 512 }, { 10, 511, 512 }, + { 1, 0, 0 }, { 2, 1, 512 }, { 2, 2, 512 }, { 3, 3, 512 }, { 2, 4, 512 }, { 3, 5, 512 }, { 3, 6, 512 }, { 4, 7, 512 }, + { 2, 8, 512 }, { 3, 9, 512 }, { 3, 10, 512 }, { 4, 11, 512 }, { 3, 12, 512 }, { 4, 13, 512 }, { 4, 14, 512 }, { 5, 15, 512 }, + { 2, 16, 512 }, { 3, 17, 512 }, { 3, 18, 512 }, { 4, 19, 512 }, { 3, 20, 512 }, { 4, 21, 512 }, { 4, 22, 512 }, { 5, 23, 512 }, + { 3, 24, 512 }, { 4, 25, 512 }, { 4, 26, 512 }, { 5, 27, 512 }, { 4, 28, 512 }, { 5, 29, 512 }, { 5, 30, 512 }, { 6, 31, 512 }, + { 2, 32, 512 }, { 3, 33, 512 }, { 3, 34, 512 }, { 4, 35, 512 }, { 3, 36, 512 }, { 4, 37, 512 }, { 4, 38, 512 }, { 5, 39, 512 }, + { 3, 40, 512 }, { 4, 41, 512 }, { 4, 42, 512 }, { 5, 43, 512 }, { 4, 44, 512 }, { 5, 45, 512 }, { 5, 46, 512 }, { 6, 47, 512 }, + { 3, 48, 512 }, { 4, 49, 512 }, { 4, 50, 512 }, { 5, 51, 512 }, { 4, 52, 512 }, { 5, 53, 512 }, { 5, 54, 512 }, { 6, 55, 512 }, + { 4, 56, 512 }, { 5, 57, 512 }, { 5, 58, 512 }, { 6, 59, 512 }, { 5, 60, 512 }, { 6, 61, 512 }, { 6, 62, 512 }, { 7, 63, 512 }, + { 2, 64, 512 }, { 3, 65, 512 }, { 3, 66, 512 }, { 4, 67, 512 }, { 3, 68, 512 }, { 4, 69, 512 }, { 4, 70, 512 }, { 5, 71, 512 }, + { 3, 72, 512 }, { 4, 73, 512 }, { 4, 74, 512 }, { 5, 75, 512 }, { 4, 76, 512 }, { 5, 77, 512 }, { 5, 78, 512 }, { 6, 79, 512 }, + { 3, 80, 512 }, { 4, 81, 512 }, { 4, 82, 512 }, { 5, 83, 512 }, { 4, 84, 512 }, { 5, 85, 512 }, { 5, 86, 512 }, { 6, 87, 512 }, + { 4, 88, 512 }, { 5, 89, 512 }, { 5, 90, 512 }, { 6, 91, 512 }, { 5, 92, 512 }, { 6, 93, 512 }, { 6, 94, 512 }, { 7, 95, 512 }, + { 3, 96, 512 }, { 4, 97, 512 }, { 4, 98, 512 }, { 5, 99, 512 }, { 4, 100, 512 }, { 5, 101, 512 }, { 5, 102, 512 }, { 6, 103, 512 }, + { 4, 104, 512 }, { 5, 105, 512 }, { 5, 106, 512 }, { 6, 107, 512 }, { 5, 108, 512 }, { 6, 109, 512 }, { 6, 110, 512 }, { 7, 111, 512 }, + { 4, 112, 512 }, { 5, 113, 512 }, { 5, 114, 512 }, { 6, 115, 512 }, { 5, 116, 512 }, { 6, 117, 512 }, { 6, 118, 512 }, { 7, 119, 512 }, + { 5, 120, 512 }, { 6, 121, 512 }, { 6, 122, 512 }, { 7, 123, 512 }, { 6, 124, 512 }, { 7, 125, 512 }, { 7, 126, 512 }, { 8, 127, 512 }, + { 2, 128, 512 }, { 3, 129, 512 }, { 3, 130, 512 }, { 4, 131, 512 }, { 3, 132, 512 }, { 4, 133, 512 }, { 4, 134, 512 }, { 5, 135, 512 }, + { 3, 136, 512 }, { 4, 137, 512 }, { 4, 138, 512 }, { 5, 139, 512 }, { 4, 140, 512 }, { 5, 141, 512 }, { 5, 142, 512 }, { 6, 143, 512 }, + { 3, 144, 512 }, { 4, 145, 512 }, { 4, 146, 512 }, { 5, 147, 512 }, { 4, 148, 512 }, { 5, 149, 512 }, { 5, 150, 512 }, { 6, 151, 512 }, + { 4, 152, 512 }, { 5, 153, 512 }, { 5, 154, 512 }, { 6, 155, 512 }, { 5, 156, 512 }, { 6, 157, 512 }, { 6, 158, 512 }, { 7, 159, 512 }, + { 3, 160, 512 }, { 4, 161, 512 }, { 4, 162, 512 }, { 5, 163, 512 }, { 4, 164, 512 }, { 5, 165, 512 }, { 5, 166, 512 }, { 6, 167, 512 }, + { 4, 168, 512 }, { 5, 169, 512 }, { 5, 170, 512 }, { 6, 171, 512 }, { 5, 172, 512 }, { 6, 173, 512 }, { 6, 174, 512 }, { 7, 175, 512 }, + { 4, 176, 512 }, { 5, 177, 512 }, { 5, 178, 512 }, { 6, 179, 512 }, { 5, 180, 512 }, { 6, 181, 512 }, { 6, 182, 512 }, { 7, 183, 512 }, + { 5, 184, 512 }, { 6, 185, 512 }, { 6, 186, 512 }, { 7, 187, 512 }, { 6, 188, 512 }, { 7, 189, 512 }, { 7, 190, 512 }, { 8, 191, 512 }, + { 3, 192, 512 }, { 4, 193, 512 }, { 4, 194, 512 }, { 5, 195, 512 }, { 4, 196, 512 }, { 5, 197, 512 }, { 5, 198, 512 }, { 6, 199, 512 }, + { 4, 200, 512 }, { 5, 201, 512 }, { 5, 202, 512 }, { 6, 203, 512 }, { 5, 204, 512 }, { 6, 205, 512 }, { 6, 206, 512 }, { 7, 207, 512 }, + { 4, 208, 512 }, { 5, 209, 512 }, { 5, 210, 512 }, { 6, 211, 512 }, { 5, 212, 512 }, { 6, 213, 512 }, { 6, 214, 512 }, { 7, 215, 512 }, + { 5, 216, 512 }, { 6, 217, 512 }, { 6, 218, 512 }, { 7, 219, 512 }, { 6, 220, 512 }, { 7, 221, 512 }, { 7, 222, 512 }, { 8, 223, 512 }, + { 4, 224, 512 }, { 5, 225, 512 }, { 5, 226, 512 }, { 6, 227, 512 }, { 5, 228, 512 }, { 6, 229, 512 }, { 6, 230, 512 }, { 7, 231, 512 }, + { 5, 232, 512 }, { 6, 233, 512 }, { 6, 234, 512 }, { 7, 235, 512 }, { 6, 236, 512 }, { 7, 237, 512 }, { 7, 238, 512 }, { 8, 239, 512 }, + { 5, 240, 512 }, { 6, 241, 512 }, { 6, 242, 512 }, { 7, 243, 512 }, { 6, 244, 512 }, { 7, 245, 512 }, { 7, 246, 512 }, { 8, 247, 512 }, + { 6, 248, 512 }, { 7, 249, 512 }, { 7, 250, 512 }, { 8, 251, 512 }, { 7, 252, 512 }, { 8, 253, 512 }, { 8, 254, 512 }, { 9, 255, 512 }, + { 2, 256, 512 }, { 3, 257, 512 }, { 3, 258, 512 }, { 4, 259, 512 }, { 3, 260, 512 }, { 4, 261, 512 }, { 4, 262, 512 }, { 5, 263, 512 }, + { 3, 264, 512 }, { 4, 265, 512 }, { 4, 266, 512 }, { 5, 267, 512 }, { 4, 268, 512 }, { 5, 269, 512 }, { 5, 270, 512 }, { 6, 271, 512 }, + { 3, 272, 512 }, { 4, 273, 512 }, { 4, 274, 512 }, { 5, 275, 512 }, { 4, 276, 512 }, { 5, 277, 512 }, { 5, 278, 512 }, { 6, 279, 512 }, + { 4, 280, 512 }, { 5, 281, 512 }, { 5, 282, 512 }, { 6, 283, 512 }, { 5, 284, 512 }, { 6, 285, 512 }, { 6, 286, 512 }, { 7, 287, 512 }, + { 3, 288, 512 }, { 4, 289, 512 }, { 4, 290, 512 }, { 5, 291, 512 }, { 4, 292, 512 }, { 5, 293, 512 }, { 5, 294, 512 }, { 6, 295, 512 }, + { 4, 296, 512 }, { 5, 297, 512 }, { 5, 298, 512 }, { 6, 299, 512 }, { 5, 300, 512 }, { 6, 301, 512 }, { 6, 302, 512 }, { 7, 303, 512 }, + { 4, 304, 512 }, { 5, 305, 512 }, { 5, 306, 512 }, { 6, 307, 512 }, { 5, 308, 512 }, { 6, 309, 512 }, { 6, 310, 512 }, { 7, 311, 512 }, + { 5, 312, 512 }, { 6, 313, 512 }, { 6, 314, 512 }, { 7, 315, 512 }, { 6, 316, 512 }, { 7, 317, 512 }, { 7, 318, 512 }, { 8, 319, 512 }, + { 3, 320, 512 }, { 4, 321, 512 }, { 4, 322, 512 }, { 5, 323, 512 }, { 4, 324, 512 }, { 5, 325, 512 }, { 5, 326, 512 }, { 6, 327, 512 }, + { 4, 328, 512 }, { 5, 329, 512 }, { 5, 330, 512 }, { 6, 331, 512 }, { 5, 332, 512 }, { 6, 333, 512 }, { 6, 334, 512 }, { 7, 335, 512 }, + { 4, 336, 512 }, { 5, 337, 512 }, { 5, 338, 512 }, { 6, 339, 512 }, { 5, 340, 512 }, { 6, 341, 512 }, { 6, 342, 512 }, { 7, 343, 512 }, + { 5, 344, 512 }, { 6, 345, 512 }, { 6, 346, 512 }, { 7, 347, 512 }, { 6, 348, 512 }, { 7, 349, 512 }, { 7, 350, 512 }, { 8, 351, 512 }, + { 4, 352, 512 }, { 5, 353, 512 }, { 5, 354, 512 }, { 6, 355, 512 }, { 5, 356, 512 }, { 6, 357, 512 }, { 6, 358, 512 }, { 7, 359, 512 }, + { 5, 360, 512 }, { 6, 361, 512 }, { 6, 362, 512 }, { 7, 363, 512 }, { 6, 364, 512 }, { 7, 365, 512 }, { 7, 366, 512 }, { 8, 367, 512 }, + { 5, 368, 512 }, { 6, 369, 512 }, { 6, 370, 512 }, { 7, 371, 512 }, { 6, 372, 512 }, { 7, 373, 512 }, { 7, 374, 512 }, { 8, 375, 512 }, + { 6, 376, 512 }, { 7, 377, 512 }, { 7, 378, 512 }, { 8, 379, 512 }, { 7, 380, 512 }, { 8, 381, 512 }, { 8, 382, 512 }, { 9, 383, 512 }, + { 3, 384, 512 }, { 4, 385, 512 }, { 4, 386, 512 }, { 5, 387, 512 }, { 4, 388, 512 }, { 5, 389, 512 }, { 5, 390, 512 }, { 6, 391, 512 }, + { 4, 392, 512 }, { 5, 393, 512 }, { 5, 394, 512 }, { 6, 395, 512 }, { 5, 396, 512 }, { 6, 397, 512 }, { 6, 398, 512 }, { 7, 399, 512 }, + { 4, 400, 512 }, { 5, 401, 512 }, { 5, 402, 512 }, { 6, 403, 512 }, { 5, 404, 512 }, { 6, 405, 512 }, { 6, 406, 512 }, { 7, 407, 512 }, + { 5, 408, 512 }, { 6, 409, 512 }, { 6, 410, 512 }, { 7, 411, 512 }, { 6, 412, 512 }, { 7, 413, 512 }, { 7, 414, 512 }, { 8, 415, 512 }, + { 4, 416, 512 }, { 5, 417, 512 }, { 5, 418, 512 }, { 6, 419, 512 }, { 5, 420, 512 }, { 6, 421, 512 }, { 6, 422, 512 }, { 7, 423, 512 }, + { 5, 424, 512 }, { 6, 425, 512 }, { 6, 426, 512 }, { 7, 427, 512 }, { 6, 428, 512 }, { 7, 429, 512 }, { 7, 430, 512 }, { 8, 431, 512 }, + { 5, 432, 512 }, { 6, 433, 512 }, { 6, 434, 512 }, { 7, 435, 512 }, { 6, 436, 512 }, { 7, 437, 512 }, { 7, 438, 512 }, { 8, 439, 512 }, + { 6, 440, 512 }, { 7, 441, 512 }, { 7, 442, 512 }, { 8, 443, 512 }, { 7, 444, 512 }, { 8, 445, 512 }, { 8, 446, 512 }, { 9, 447, 512 }, + { 4, 448, 512 }, { 5, 449, 512 }, { 5, 450, 512 }, { 6, 451, 512 }, { 5, 452, 512 }, { 6, 453, 512 }, { 6, 454, 512 }, { 7, 455, 512 }, + { 5, 456, 512 }, { 6, 457, 512 }, { 6, 458, 512 }, { 7, 459, 512 }, { 6, 460, 512 }, { 7, 461, 512 }, { 7, 462, 512 }, { 8, 463, 512 }, + { 5, 464, 512 }, { 6, 465, 512 }, { 6, 466, 512 }, { 7, 467, 512 }, { 6, 468, 512 }, { 7, 469, 512 }, { 7, 470, 512 }, { 8, 471, 512 }, + { 6, 472, 512 }, { 7, 473, 512 }, { 7, 474, 512 }, { 8, 475, 512 }, { 7, 476, 512 }, { 8, 477, 512 }, { 8, 478, 512 }, { 9, 479, 512 }, + { 5, 480, 512 }, { 6, 481, 512 }, { 6, 482, 512 }, { 7, 483, 512 }, { 6, 484, 512 }, { 7, 485, 512 }, { 7, 486, 512 }, { 8, 487, 512 }, + { 6, 488, 512 }, { 7, 489, 512 }, { 7, 490, 512 }, { 8, 491, 512 }, { 7, 492, 512 }, { 8, 493, 512 }, { 8, 494, 512 }, { 9, 495, 512 }, + { 6, 496, 512 }, { 7, 497, 512 }, { 7, 498, 512 }, { 8, 499, 512 }, { 7, 500, 512 }, { 8, 501, 512 }, { 8, 502, 512 }, { 9, 503, 512 }, + { 7, 504, 512 }, { 8, 505, 512 }, { 8, 506, 512 }, { 9, 507, 512 }, { 8, 508, 512 }, { 9, 509, 512 }, { 9, 510, 512 }, { 10, 511, 512 }, #if FP_LUT > 10 - { 1, 0, 0 }, { 2, 1, 1024 }, { 2, 2, 1024 }, { 3, 3, 1024 }, { 2, 4, 1024 }, { 3, 5, 1024 }, { 3, 6, 1024 }, { 4, 7, 1024 }, - { 2, 8, 1024 }, { 3, 9, 1024 }, { 3, 10, 1024 }, { 4, 11, 1024 }, { 3, 12, 1024 }, { 4, 13, 1024 }, { 4, 14, 1024 }, { 5, 15, 1024 }, - { 2, 16, 1024 }, { 3, 17, 1024 }, { 3, 18, 1024 }, { 4, 19, 1024 }, { 3, 20, 1024 }, { 4, 21, 1024 }, { 4, 22, 1024 }, { 5, 23, 1024 }, - { 3, 24, 1024 }, { 4, 25, 1024 }, { 4, 26, 1024 }, { 5, 27, 1024 }, { 4, 28, 1024 }, { 5, 29, 1024 }, { 5, 30, 1024 }, { 6, 31, 1024 }, - { 2, 32, 1024 }, { 3, 33, 1024 }, { 3, 34, 1024 }, { 4, 35, 1024 }, { 3, 36, 1024 }, { 4, 37, 1024 }, { 4, 38, 1024 }, { 5, 39, 1024 }, - { 3, 40, 1024 }, { 4, 41, 1024 }, { 4, 42, 1024 }, { 5, 43, 1024 }, { 4, 44, 1024 }, { 5, 45, 1024 }, { 5, 46, 1024 }, { 6, 47, 1024 }, - { 3, 48, 1024 }, { 4, 49, 1024 }, { 4, 50, 1024 }, { 5, 51, 1024 }, { 4, 52, 1024 }, { 5, 53, 1024 }, { 5, 54, 1024 }, { 6, 55, 1024 }, - { 4, 56, 1024 }, { 5, 57, 1024 }, { 5, 58, 1024 }, { 6, 59, 1024 }, { 5, 60, 1024 }, { 6, 61, 1024 }, { 6, 62, 1024 }, { 7, 63, 1024 }, - { 2, 64, 1024 }, { 3, 65, 1024 }, { 3, 66, 1024 }, { 4, 67, 1024 }, { 3, 68, 1024 }, { 4, 69, 1024 }, { 4, 70, 1024 }, { 5, 71, 1024 }, - { 3, 72, 1024 }, { 4, 73, 1024 }, { 4, 74, 1024 }, { 5, 75, 1024 }, { 4, 76, 1024 }, { 5, 77, 1024 }, { 5, 78, 1024 }, { 6, 79, 1024 }, - { 3, 80, 1024 }, { 4, 81, 1024 }, { 4, 82, 1024 }, { 5, 83, 1024 }, { 4, 84, 1024 }, { 5, 85, 1024 }, { 5, 86, 1024 }, { 6, 87, 1024 }, - { 4, 88, 1024 }, { 5, 89, 1024 }, { 5, 90, 1024 }, { 6, 91, 1024 }, { 5, 92, 1024 }, { 6, 93, 1024 }, { 6, 94, 1024 }, { 7, 95, 1024 }, - { 3, 96, 1024 }, { 4, 97, 1024 }, { 4, 98, 1024 }, { 5, 99, 1024 }, { 4, 100, 1024 }, { 5, 101, 1024 }, { 5, 102, 1024 }, { 6, 103, 1024 }, - { 4, 104, 1024 }, { 5, 105, 1024 }, { 5, 106, 1024 }, { 6, 107, 1024 }, { 5, 108, 1024 }, { 6, 109, 1024 }, { 6, 110, 1024 }, { 7, 111, 1024 }, - { 4, 112, 1024 }, { 5, 113, 1024 }, { 5, 114, 1024 }, { 6, 115, 1024 }, { 5, 116, 1024 }, { 6, 117, 1024 }, { 6, 118, 1024 }, { 7, 119, 1024 }, - { 5, 120, 1024 }, { 6, 121, 1024 }, { 6, 122, 1024 }, { 7, 123, 1024 }, { 6, 124, 1024 }, { 7, 125, 1024 }, { 7, 126, 1024 }, { 8, 127, 1024 }, - { 2, 128, 1024 }, { 3, 129, 1024 }, { 3, 130, 1024 }, { 4, 131, 1024 }, { 3, 132, 1024 }, { 4, 133, 1024 }, { 4, 134, 1024 }, { 5, 135, 1024 }, - { 3, 136, 1024 }, { 4, 137, 1024 }, { 4, 138, 1024 }, { 5, 139, 1024 }, { 4, 140, 1024 }, { 5, 141, 1024 }, { 5, 142, 1024 }, { 6, 143, 1024 }, - { 3, 144, 1024 }, { 4, 145, 1024 }, { 4, 146, 1024 }, { 5, 147, 1024 }, { 4, 148, 1024 }, { 5, 149, 1024 }, { 5, 150, 1024 }, { 6, 151, 1024 }, - { 4, 152, 1024 }, { 5, 153, 1024 }, { 5, 154, 1024 }, { 6, 155, 1024 }, { 5, 156, 1024 }, { 6, 157, 1024 }, { 6, 158, 1024 }, { 7, 159, 1024 }, - { 3, 160, 1024 }, { 4, 161, 1024 }, { 4, 162, 1024 }, { 5, 163, 1024 }, { 4, 164, 1024 }, { 5, 165, 1024 }, { 5, 166, 1024 }, { 6, 167, 1024 }, - { 4, 168, 1024 }, { 5, 169, 1024 }, { 5, 170, 1024 }, { 6, 171, 1024 }, { 5, 172, 1024 }, { 6, 173, 1024 }, { 6, 174, 1024 }, { 7, 175, 1024 }, - { 4, 176, 1024 }, { 5, 177, 1024 }, { 5, 178, 1024 }, { 6, 179, 1024 }, { 5, 180, 1024 }, { 6, 181, 1024 }, { 6, 182, 1024 }, { 7, 183, 1024 }, - { 5, 184, 1024 }, { 6, 185, 1024 }, { 6, 186, 1024 }, { 7, 187, 1024 }, { 6, 188, 1024 }, { 7, 189, 1024 }, { 7, 190, 1024 }, { 8, 191, 1024 }, - { 3, 192, 1024 }, { 4, 193, 1024 }, { 4, 194, 1024 }, { 5, 195, 1024 }, { 4, 196, 1024 }, { 5, 197, 1024 }, { 5, 198, 1024 }, { 6, 199, 1024 }, - { 4, 200, 1024 }, { 5, 201, 1024 }, { 5, 202, 1024 }, { 6, 203, 1024 }, { 5, 204, 1024 }, { 6, 205, 1024 }, { 6, 206, 1024 }, { 7, 207, 1024 }, - { 4, 208, 1024 }, { 5, 209, 1024 }, { 5, 210, 1024 }, { 6, 211, 1024 }, { 5, 212, 1024 }, { 6, 213, 1024 }, { 6, 214, 1024 }, { 7, 215, 1024 }, - { 5, 216, 1024 }, { 6, 217, 1024 }, { 6, 218, 1024 }, { 7, 219, 1024 }, { 6, 220, 1024 }, { 7, 221, 1024 }, { 7, 222, 1024 }, { 8, 223, 1024 }, - { 4, 224, 1024 }, { 5, 225, 1024 }, { 5, 226, 1024 }, { 6, 227, 1024 }, { 5, 228, 1024 }, { 6, 229, 1024 }, { 6, 230, 1024 }, { 7, 231, 1024 }, - { 5, 232, 1024 }, { 6, 233, 1024 }, { 6, 234, 1024 }, { 7, 235, 1024 }, { 6, 236, 1024 }, { 7, 237, 1024 }, { 7, 238, 1024 }, { 8, 239, 1024 }, - { 5, 240, 1024 }, { 6, 241, 1024 }, { 6, 242, 1024 }, { 7, 243, 1024 }, { 6, 244, 1024 }, { 7, 245, 1024 }, { 7, 246, 1024 }, { 8, 247, 1024 }, - { 6, 248, 1024 }, { 7, 249, 1024 }, { 7, 250, 1024 }, { 8, 251, 1024 }, { 7, 252, 1024 }, { 8, 253, 1024 }, { 8, 254, 1024 }, { 9, 255, 1024 }, - { 2, 256, 1024 }, { 3, 257, 1024 }, { 3, 258, 1024 }, { 4, 259, 1024 }, { 3, 260, 1024 }, { 4, 261, 1024 }, { 4, 262, 1024 }, { 5, 263, 1024 }, - { 3, 264, 1024 }, { 4, 265, 1024 }, { 4, 266, 1024 }, { 5, 267, 1024 }, { 4, 268, 1024 }, { 5, 269, 1024 }, { 5, 270, 1024 }, { 6, 271, 1024 }, - { 3, 272, 1024 }, { 4, 273, 1024 }, { 4, 274, 1024 }, { 5, 275, 1024 }, { 4, 276, 1024 }, { 5, 277, 1024 }, { 5, 278, 1024 }, { 6, 279, 1024 }, - { 4, 280, 1024 }, { 5, 281, 1024 }, { 5, 282, 1024 }, { 6, 283, 1024 }, { 5, 284, 1024 }, { 6, 285, 1024 }, { 6, 286, 1024 }, { 7, 287, 1024 }, - { 3, 288, 1024 }, { 4, 289, 1024 }, { 4, 290, 1024 }, { 5, 291, 1024 }, { 4, 292, 1024 }, { 5, 293, 1024 }, { 5, 294, 1024 }, { 6, 295, 1024 }, - { 4, 296, 1024 }, { 5, 297, 1024 }, { 5, 298, 1024 }, { 6, 299, 1024 }, { 5, 300, 1024 }, { 6, 301, 1024 }, { 6, 302, 1024 }, { 7, 303, 1024 }, - { 4, 304, 1024 }, { 5, 305, 1024 }, { 5, 306, 1024 }, { 6, 307, 1024 }, { 5, 308, 1024 }, { 6, 309, 1024 }, { 6, 310, 1024 }, { 7, 311, 1024 }, - { 5, 312, 1024 }, { 6, 313, 1024 }, { 6, 314, 1024 }, { 7, 315, 1024 }, { 6, 316, 1024 }, { 7, 317, 1024 }, { 7, 318, 1024 }, { 8, 319, 1024 }, - { 3, 320, 1024 }, { 4, 321, 1024 }, { 4, 322, 1024 }, { 5, 323, 1024 }, { 4, 324, 1024 }, { 5, 325, 1024 }, { 5, 326, 1024 }, { 6, 327, 1024 }, - { 4, 328, 1024 }, { 5, 329, 1024 }, { 5, 330, 1024 }, { 6, 331, 1024 }, { 5, 332, 1024 }, { 6, 333, 1024 }, { 6, 334, 1024 }, { 7, 335, 1024 }, - { 4, 336, 1024 }, { 5, 337, 1024 }, { 5, 338, 1024 }, { 6, 339, 1024 }, { 5, 340, 1024 }, { 6, 341, 1024 }, { 6, 342, 1024 }, { 7, 343, 1024 }, - { 5, 344, 1024 }, { 6, 345, 1024 }, { 6, 346, 1024 }, { 7, 347, 1024 }, { 6, 348, 1024 }, { 7, 349, 1024 }, { 7, 350, 1024 }, { 8, 351, 1024 }, - { 4, 352, 1024 }, { 5, 353, 1024 }, { 5, 354, 1024 }, { 6, 355, 1024 }, { 5, 356, 1024 }, { 6, 357, 1024 }, { 6, 358, 1024 }, { 7, 359, 1024 }, - { 5, 360, 1024 }, { 6, 361, 1024 }, { 6, 362, 1024 }, { 7, 363, 1024 }, { 6, 364, 1024 }, { 7, 365, 1024 }, { 7, 366, 1024 }, { 8, 367, 1024 }, - { 5, 368, 1024 }, { 6, 369, 1024 }, { 6, 370, 1024 }, { 7, 371, 1024 }, { 6, 372, 1024 }, { 7, 373, 1024 }, { 7, 374, 1024 }, { 8, 375, 1024 }, - { 6, 376, 1024 }, { 7, 377, 1024 }, { 7, 378, 1024 }, { 8, 379, 1024 }, { 7, 380, 1024 }, { 8, 381, 1024 }, { 8, 382, 1024 }, { 9, 383, 1024 }, - { 3, 384, 1024 }, { 4, 385, 1024 }, { 4, 386, 1024 }, { 5, 387, 1024 }, { 4, 388, 1024 }, { 5, 389, 1024 }, { 5, 390, 1024 }, { 6, 391, 1024 }, - { 4, 392, 1024 }, { 5, 393, 1024 }, { 5, 394, 1024 }, { 6, 395, 1024 }, { 5, 396, 1024 }, { 6, 397, 1024 }, { 6, 398, 1024 }, { 7, 399, 1024 }, - { 4, 400, 1024 }, { 5, 401, 1024 }, { 5, 402, 1024 }, { 6, 403, 1024 }, { 5, 404, 1024 }, { 6, 405, 1024 }, { 6, 406, 1024 }, { 7, 407, 1024 }, - { 5, 408, 1024 }, { 6, 409, 1024 }, { 6, 410, 1024 }, { 7, 411, 1024 }, { 6, 412, 1024 }, { 7, 413, 1024 }, { 7, 414, 1024 }, { 8, 415, 1024 }, - { 4, 416, 1024 }, { 5, 417, 1024 }, { 5, 418, 1024 }, { 6, 419, 1024 }, { 5, 420, 1024 }, { 6, 421, 1024 }, { 6, 422, 1024 }, { 7, 423, 1024 }, - { 5, 424, 1024 }, { 6, 425, 1024 }, { 6, 426, 1024 }, { 7, 427, 1024 }, { 6, 428, 1024 }, { 7, 429, 1024 }, { 7, 430, 1024 }, { 8, 431, 1024 }, - { 5, 432, 1024 }, { 6, 433, 1024 }, { 6, 434, 1024 }, { 7, 435, 1024 }, { 6, 436, 1024 }, { 7, 437, 1024 }, { 7, 438, 1024 }, { 8, 439, 1024 }, - { 6, 440, 1024 }, { 7, 441, 1024 }, { 7, 442, 1024 }, { 8, 443, 1024 }, { 7, 444, 1024 }, { 8, 445, 1024 }, { 8, 446, 1024 }, { 9, 447, 1024 }, - { 4, 448, 1024 }, { 5, 449, 1024 }, { 5, 450, 1024 }, { 6, 451, 1024 }, { 5, 452, 1024 }, { 6, 453, 1024 }, { 6, 454, 1024 }, { 7, 455, 1024 }, - { 5, 456, 1024 }, { 6, 457, 1024 }, { 6, 458, 1024 }, { 7, 459, 1024 }, { 6, 460, 1024 }, { 7, 461, 1024 }, { 7, 462, 1024 }, { 8, 463, 1024 }, - { 5, 464, 1024 }, { 6, 465, 1024 }, { 6, 466, 1024 }, { 7, 467, 1024 }, { 6, 468, 1024 }, { 7, 469, 1024 }, { 7, 470, 1024 }, { 8, 471, 1024 }, - { 6, 472, 1024 }, { 7, 473, 1024 }, { 7, 474, 1024 }, { 8, 475, 1024 }, { 7, 476, 1024 }, { 8, 477, 1024 }, { 8, 478, 1024 }, { 9, 479, 1024 }, - { 5, 480, 1024 }, { 6, 481, 1024 }, { 6, 482, 1024 }, { 7, 483, 1024 }, { 6, 484, 1024 }, { 7, 485, 1024 }, { 7, 486, 1024 }, { 8, 487, 1024 }, - { 6, 488, 1024 }, { 7, 489, 1024 }, { 7, 490, 1024 }, { 8, 491, 1024 }, { 7, 492, 1024 }, { 8, 493, 1024 }, { 8, 494, 1024 }, { 9, 495, 1024 }, - { 6, 496, 1024 }, { 7, 497, 1024 }, { 7, 498, 1024 }, { 8, 499, 1024 }, { 7, 500, 1024 }, { 8, 501, 1024 }, { 8, 502, 1024 }, { 9, 503, 1024 }, - { 7, 504, 1024 }, { 8, 505, 1024 }, { 8, 506, 1024 }, { 9, 507, 1024 }, { 8, 508, 1024 }, { 9, 509, 1024 }, { 9, 510, 1024 }, { 10, 511, 1024 }, - { 2, 512, 1024 }, { 3, 513, 1024 }, { 3, 514, 1024 }, { 4, 515, 1024 }, { 3, 516, 1024 }, { 4, 517, 1024 }, { 4, 518, 1024 }, { 5, 519, 1024 }, - { 3, 520, 1024 }, { 4, 521, 1024 }, { 4, 522, 1024 }, { 5, 523, 1024 }, { 4, 524, 1024 }, { 5, 525, 1024 }, { 5, 526, 1024 }, { 6, 527, 1024 }, - { 3, 528, 1024 }, { 4, 529, 1024 }, { 4, 530, 1024 }, { 5, 531, 1024 }, { 4, 532, 1024 }, { 5, 533, 1024 }, { 5, 534, 1024 }, { 6, 535, 1024 }, - { 4, 536, 1024 }, { 5, 537, 1024 }, { 5, 538, 1024 }, { 6, 539, 1024 }, { 5, 540, 1024 }, { 6, 541, 1024 }, { 6, 542, 1024 }, { 7, 543, 1024 }, - { 3, 544, 1024 }, { 4, 545, 1024 }, { 4, 546, 1024 }, { 5, 547, 1024 }, { 4, 548, 1024 }, { 5, 549, 1024 }, { 5, 550, 1024 }, { 6, 551, 1024 }, - { 4, 552, 1024 }, { 5, 553, 1024 }, { 5, 554, 1024 }, { 6, 555, 1024 }, { 5, 556, 1024 }, { 6, 557, 1024 }, { 6, 558, 1024 }, { 7, 559, 1024 }, - { 4, 560, 1024 }, { 5, 561, 1024 }, { 5, 562, 1024 }, { 6, 563, 1024 }, { 5, 564, 1024 }, { 6, 565, 1024 }, { 6, 566, 1024 }, { 7, 567, 1024 }, - { 5, 568, 1024 }, { 6, 569, 1024 }, { 6, 570, 1024 }, { 7, 571, 1024 }, { 6, 572, 1024 }, { 7, 573, 1024 }, { 7, 574, 1024 }, { 8, 575, 1024 }, - { 3, 576, 1024 }, { 4, 577, 1024 }, { 4, 578, 1024 }, { 5, 579, 1024 }, { 4, 580, 1024 }, { 5, 581, 1024 }, { 5, 582, 1024 }, { 6, 583, 1024 }, - { 4, 584, 1024 }, { 5, 585, 1024 }, { 5, 586, 1024 }, { 6, 587, 1024 }, { 5, 588, 1024 }, { 6, 589, 1024 }, { 6, 590, 1024 }, { 7, 591, 1024 }, - { 4, 592, 1024 }, { 5, 593, 1024 }, { 5, 594, 1024 }, { 6, 595, 1024 }, { 5, 596, 1024 }, { 6, 597, 1024 }, { 6, 598, 1024 }, { 7, 599, 1024 }, - { 5, 600, 1024 }, { 6, 601, 1024 }, { 6, 602, 1024 }, { 7, 603, 1024 }, { 6, 604, 1024 }, { 7, 605, 1024 }, { 7, 606, 1024 }, { 8, 607, 1024 }, - { 4, 608, 1024 }, { 5, 609, 1024 }, { 5, 610, 1024 }, { 6, 611, 1024 }, { 5, 612, 1024 }, { 6, 613, 1024 }, { 6, 614, 1024 }, { 7, 615, 1024 }, - { 5, 616, 1024 }, { 6, 617, 1024 }, { 6, 618, 1024 }, { 7, 619, 1024 }, { 6, 620, 1024 }, { 7, 621, 1024 }, { 7, 622, 1024 }, { 8, 623, 1024 }, - { 5, 624, 1024 }, { 6, 625, 1024 }, { 6, 626, 1024 }, { 7, 627, 1024 }, { 6, 628, 1024 }, { 7, 629, 1024 }, { 7, 630, 1024 }, { 8, 631, 1024 }, - { 6, 632, 1024 }, { 7, 633, 1024 }, { 7, 634, 1024 }, { 8, 635, 1024 }, { 7, 636, 1024 }, { 8, 637, 1024 }, { 8, 638, 1024 }, { 9, 639, 1024 }, - { 3, 640, 1024 }, { 4, 641, 1024 }, { 4, 642, 1024 }, { 5, 643, 1024 }, { 4, 644, 1024 }, { 5, 645, 1024 }, { 5, 646, 1024 }, { 6, 647, 1024 }, - { 4, 648, 1024 }, { 5, 649, 1024 }, { 5, 650, 1024 }, { 6, 651, 1024 }, { 5, 652, 1024 }, { 6, 653, 1024 }, { 6, 654, 1024 }, { 7, 655, 1024 }, - { 4, 656, 1024 }, { 5, 657, 1024 }, { 5, 658, 1024 }, { 6, 659, 1024 }, { 5, 660, 1024 }, { 6, 661, 1024 }, { 6, 662, 1024 }, { 7, 663, 1024 }, - { 5, 664, 1024 }, { 6, 665, 1024 }, { 6, 666, 1024 }, { 7, 667, 1024 }, { 6, 668, 1024 }, { 7, 669, 1024 }, { 7, 670, 1024 }, { 8, 671, 1024 }, - { 4, 672, 1024 }, { 5, 673, 1024 }, { 5, 674, 1024 }, { 6, 675, 1024 }, { 5, 676, 1024 }, { 6, 677, 1024 }, { 6, 678, 1024 }, { 7, 679, 1024 }, - { 5, 680, 1024 }, { 6, 681, 1024 }, { 6, 682, 1024 }, { 7, 683, 1024 }, { 6, 684, 1024 }, { 7, 685, 1024 }, { 7, 686, 1024 }, { 8, 687, 1024 }, - { 5, 688, 1024 }, { 6, 689, 1024 }, { 6, 690, 1024 }, { 7, 691, 1024 }, { 6, 692, 1024 }, { 7, 693, 1024 }, { 7, 694, 1024 }, { 8, 695, 1024 }, - { 6, 696, 1024 }, { 7, 697, 1024 }, { 7, 698, 1024 }, { 8, 699, 1024 }, { 7, 700, 1024 }, { 8, 701, 1024 }, { 8, 702, 1024 }, { 9, 703, 1024 }, - { 4, 704, 1024 }, { 5, 705, 1024 }, { 5, 706, 1024 }, { 6, 707, 1024 }, { 5, 708, 1024 }, { 6, 709, 1024 }, { 6, 710, 1024 }, { 7, 711, 1024 }, - { 5, 712, 1024 }, { 6, 713, 1024 }, { 6, 714, 1024 }, { 7, 715, 1024 }, { 6, 716, 1024 }, { 7, 717, 1024 }, { 7, 718, 1024 }, { 8, 719, 1024 }, - { 5, 720, 1024 }, { 6, 721, 1024 }, { 6, 722, 1024 }, { 7, 723, 1024 }, { 6, 724, 1024 }, { 7, 725, 1024 }, { 7, 726, 1024 }, { 8, 727, 1024 }, - { 6, 728, 1024 }, { 7, 729, 1024 }, { 7, 730, 1024 }, { 8, 731, 1024 }, { 7, 732, 1024 }, { 8, 733, 1024 }, { 8, 734, 1024 }, { 9, 735, 1024 }, - { 5, 736, 1024 }, { 6, 737, 1024 }, { 6, 738, 1024 }, { 7, 739, 1024 }, { 6, 740, 1024 }, { 7, 741, 1024 }, { 7, 742, 1024 }, { 8, 743, 1024 }, - { 6, 744, 1024 }, { 7, 745, 1024 }, { 7, 746, 1024 }, { 8, 747, 1024 }, { 7, 748, 1024 }, { 8, 749, 1024 }, { 8, 750, 1024 }, { 9, 751, 1024 }, - { 6, 752, 1024 }, { 7, 753, 1024 }, { 7, 754, 1024 }, { 8, 755, 1024 }, { 7, 756, 1024 }, { 8, 757, 1024 }, { 8, 758, 1024 }, { 9, 759, 1024 }, - { 7, 760, 1024 }, { 8, 761, 1024 }, { 8, 762, 1024 }, { 9, 763, 1024 }, { 8, 764, 1024 }, { 9, 765, 1024 }, { 9, 766, 1024 }, { 10, 767, 1024 }, - { 3, 768, 1024 }, { 4, 769, 1024 }, { 4, 770, 1024 }, { 5, 771, 1024 }, { 4, 772, 1024 }, { 5, 773, 1024 }, { 5, 774, 1024 }, { 6, 775, 1024 }, - { 4, 776, 1024 }, { 5, 777, 1024 }, { 5, 778, 1024 }, { 6, 779, 1024 }, { 5, 780, 1024 }, { 6, 781, 1024 }, { 6, 782, 1024 }, { 7, 783, 1024 }, - { 4, 784, 1024 }, { 5, 785, 1024 }, { 5, 786, 1024 }, { 6, 787, 1024 }, { 5, 788, 1024 }, { 6, 789, 1024 }, { 6, 790, 1024 }, { 7, 791, 1024 }, - { 5, 792, 1024 }, { 6, 793, 1024 }, { 6, 794, 1024 }, { 7, 795, 1024 }, { 6, 796, 1024 }, { 7, 797, 1024 }, { 7, 798, 1024 }, { 8, 799, 1024 }, - { 4, 800, 1024 }, { 5, 801, 1024 }, { 5, 802, 1024 }, { 6, 803, 1024 }, { 5, 804, 1024 }, { 6, 805, 1024 }, { 6, 806, 1024 }, { 7, 807, 1024 }, - { 5, 808, 1024 }, { 6, 809, 1024 }, { 6, 810, 1024 }, { 7, 811, 1024 }, { 6, 812, 1024 }, { 7, 813, 1024 }, { 7, 814, 1024 }, { 8, 815, 1024 }, - { 5, 816, 1024 }, { 6, 817, 1024 }, { 6, 818, 1024 }, { 7, 819, 1024 }, { 6, 820, 1024 }, { 7, 821, 1024 }, { 7, 822, 1024 }, { 8, 823, 1024 }, - { 6, 824, 1024 }, { 7, 825, 1024 }, { 7, 826, 1024 }, { 8, 827, 1024 }, { 7, 828, 1024 }, { 8, 829, 1024 }, { 8, 830, 1024 }, { 9, 831, 1024 }, - { 4, 832, 1024 }, { 5, 833, 1024 }, { 5, 834, 1024 }, { 6, 835, 1024 }, { 5, 836, 1024 }, { 6, 837, 1024 }, { 6, 838, 1024 }, { 7, 839, 1024 }, - { 5, 840, 1024 }, { 6, 841, 1024 }, { 6, 842, 1024 }, { 7, 843, 1024 }, { 6, 844, 1024 }, { 7, 845, 1024 }, { 7, 846, 1024 }, { 8, 847, 1024 }, - { 5, 848, 1024 }, { 6, 849, 1024 }, { 6, 850, 1024 }, { 7, 851, 1024 }, { 6, 852, 1024 }, { 7, 853, 1024 }, { 7, 854, 1024 }, { 8, 855, 1024 }, - { 6, 856, 1024 }, { 7, 857, 1024 }, { 7, 858, 1024 }, { 8, 859, 1024 }, { 7, 860, 1024 }, { 8, 861, 1024 }, { 8, 862, 1024 }, { 9, 863, 1024 }, - { 5, 864, 1024 }, { 6, 865, 1024 }, { 6, 866, 1024 }, { 7, 867, 1024 }, { 6, 868, 1024 }, { 7, 869, 1024 }, { 7, 870, 1024 }, { 8, 871, 1024 }, - { 6, 872, 1024 }, { 7, 873, 1024 }, { 7, 874, 1024 }, { 8, 875, 1024 }, { 7, 876, 1024 }, { 8, 877, 1024 }, { 8, 878, 1024 }, { 9, 879, 1024 }, - { 6, 880, 1024 }, { 7, 881, 1024 }, { 7, 882, 1024 }, { 8, 883, 1024 }, { 7, 884, 1024 }, { 8, 885, 1024 }, { 8, 886, 1024 }, { 9, 887, 1024 }, - { 7, 888, 1024 }, { 8, 889, 1024 }, { 8, 890, 1024 }, { 9, 891, 1024 }, { 8, 892, 1024 }, { 9, 893, 1024 }, { 9, 894, 1024 }, { 10, 895, 1024 }, - { 4, 896, 1024 }, { 5, 897, 1024 }, { 5, 898, 1024 }, { 6, 899, 1024 }, { 5, 900, 1024 }, { 6, 901, 1024 }, { 6, 902, 1024 }, { 7, 903, 1024 }, - { 5, 904, 1024 }, { 6, 905, 1024 }, { 6, 906, 1024 }, { 7, 907, 1024 }, { 6, 908, 1024 }, { 7, 909, 1024 }, { 7, 910, 1024 }, { 8, 911, 1024 }, - { 5, 912, 1024 }, { 6, 913, 1024 }, { 6, 914, 1024 }, { 7, 915, 1024 }, { 6, 916, 1024 }, { 7, 917, 1024 }, { 7, 918, 1024 }, { 8, 919, 1024 }, - { 6, 920, 1024 }, { 7, 921, 1024 }, { 7, 922, 1024 }, { 8, 923, 1024 }, { 7, 924, 1024 }, { 8, 925, 1024 }, { 8, 926, 1024 }, { 9, 927, 1024 }, - { 5, 928, 1024 }, { 6, 929, 1024 }, { 6, 930, 1024 }, { 7, 931, 1024 }, { 6, 932, 1024 }, { 7, 933, 1024 }, { 7, 934, 1024 }, { 8, 935, 1024 }, - { 6, 936, 1024 }, { 7, 937, 1024 }, { 7, 938, 1024 }, { 8, 939, 1024 }, { 7, 940, 1024 }, { 8, 941, 1024 }, { 8, 942, 1024 }, { 9, 943, 1024 }, - { 6, 944, 1024 }, { 7, 945, 1024 }, { 7, 946, 1024 }, { 8, 947, 1024 }, { 7, 948, 1024 }, { 8, 949, 1024 }, { 8, 950, 1024 }, { 9, 951, 1024 }, - { 7, 952, 1024 }, { 8, 953, 1024 }, { 8, 954, 1024 }, { 9, 955, 1024 }, { 8, 956, 1024 }, { 9, 957, 1024 }, { 9, 958, 1024 }, { 10, 959, 1024 }, - { 5, 960, 1024 }, { 6, 961, 1024 }, { 6, 962, 1024 }, { 7, 963, 1024 }, { 6, 964, 1024 }, { 7, 965, 1024 }, { 7, 966, 1024 }, { 8, 967, 1024 }, - { 6, 968, 1024 }, { 7, 969, 1024 }, { 7, 970, 1024 }, { 8, 971, 1024 }, { 7, 972, 1024 }, { 8, 973, 1024 }, { 8, 974, 1024 }, { 9, 975, 1024 }, - { 6, 976, 1024 }, { 7, 977, 1024 }, { 7, 978, 1024 }, { 8, 979, 1024 }, { 7, 980, 1024 }, { 8, 981, 1024 }, { 8, 982, 1024 }, { 9, 983, 1024 }, - { 7, 984, 1024 }, { 8, 985, 1024 }, { 8, 986, 1024 }, { 9, 987, 1024 }, { 8, 988, 1024 }, { 9, 989, 1024 }, { 9, 990, 1024 }, { 10, 991, 1024 }, - { 6, 992, 1024 }, { 7, 993, 1024 }, { 7, 994, 1024 }, { 8, 995, 1024 }, { 7, 996, 1024 }, { 8, 997, 1024 }, { 8, 998, 1024 }, { 9, 999, 1024 }, - { 7, 1000, 1024 }, { 8, 1001, 1024 }, { 8, 1002, 1024 }, { 9, 1003, 1024 }, { 8, 1004, 1024 }, { 9, 1005, 1024 }, { 9, 1006, 1024 }, { 10, 1007, 1024 }, - { 7, 1008, 1024 }, { 8, 1009, 1024 }, { 8, 1010, 1024 }, { 9, 1011, 1024 }, { 8, 1012, 1024 }, { 9, 1013, 1024 }, { 9, 1014, 1024 }, { 10, 1015, 1024 }, - { 8, 1016, 1024 }, { 9, 1017, 1024 }, { 9, 1018, 1024 }, { 10, 1019, 1024 }, { 9, 1020, 1024 }, { 10, 1021, 1024 }, { 10, 1022, 1024 }, { 11, 1023, 1024 }, + { 1, 0, 0 }, { 2, 1, 1024 }, { 2, 2, 1024 }, { 3, 3, 1024 }, { 2, 4, 1024 }, { 3, 5, 1024 }, { 3, 6, 1024 }, { 4, 7, 1024 }, + { 2, 8, 1024 }, { 3, 9, 1024 }, { 3, 10, 1024 }, { 4, 11, 1024 }, { 3, 12, 1024 }, { 4, 13, 1024 }, { 4, 14, 1024 }, { 5, 15, 1024 }, + { 2, 16, 1024 }, { 3, 17, 1024 }, { 3, 18, 1024 }, { 4, 19, 1024 }, { 3, 20, 1024 }, { 4, 21, 1024 }, { 4, 22, 1024 }, { 5, 23, 1024 }, + { 3, 24, 1024 }, { 4, 25, 1024 }, { 4, 26, 1024 }, { 5, 27, 1024 }, { 4, 28, 1024 }, { 5, 29, 1024 }, { 5, 30, 1024 }, { 6, 31, 1024 }, + { 2, 32, 1024 }, { 3, 33, 1024 }, { 3, 34, 1024 }, { 4, 35, 1024 }, { 3, 36, 1024 }, { 4, 37, 1024 }, { 4, 38, 1024 }, { 5, 39, 1024 }, + { 3, 40, 1024 }, { 4, 41, 1024 }, { 4, 42, 1024 }, { 5, 43, 1024 }, { 4, 44, 1024 }, { 5, 45, 1024 }, { 5, 46, 1024 }, { 6, 47, 1024 }, + { 3, 48, 1024 }, { 4, 49, 1024 }, { 4, 50, 1024 }, { 5, 51, 1024 }, { 4, 52, 1024 }, { 5, 53, 1024 }, { 5, 54, 1024 }, { 6, 55, 1024 }, + { 4, 56, 1024 }, { 5, 57, 1024 }, { 5, 58, 1024 }, { 6, 59, 1024 }, { 5, 60, 1024 }, { 6, 61, 1024 }, { 6, 62, 1024 }, { 7, 63, 1024 }, + { 2, 64, 1024 }, { 3, 65, 1024 }, { 3, 66, 1024 }, { 4, 67, 1024 }, { 3, 68, 1024 }, { 4, 69, 1024 }, { 4, 70, 1024 }, { 5, 71, 1024 }, + { 3, 72, 1024 }, { 4, 73, 1024 }, { 4, 74, 1024 }, { 5, 75, 1024 }, { 4, 76, 1024 }, { 5, 77, 1024 }, { 5, 78, 1024 }, { 6, 79, 1024 }, + { 3, 80, 1024 }, { 4, 81, 1024 }, { 4, 82, 1024 }, { 5, 83, 1024 }, { 4, 84, 1024 }, { 5, 85, 1024 }, { 5, 86, 1024 }, { 6, 87, 1024 }, + { 4, 88, 1024 }, { 5, 89, 1024 }, { 5, 90, 1024 }, { 6, 91, 1024 }, { 5, 92, 1024 }, { 6, 93, 1024 }, { 6, 94, 1024 }, { 7, 95, 1024 }, + { 3, 96, 1024 }, { 4, 97, 1024 }, { 4, 98, 1024 }, { 5, 99, 1024 }, { 4, 100, 1024 }, { 5, 101, 1024 }, { 5, 102, 1024 }, { 6, 103, 1024 }, + { 4, 104, 1024 }, { 5, 105, 1024 }, { 5, 106, 1024 }, { 6, 107, 1024 }, { 5, 108, 1024 }, { 6, 109, 1024 }, { 6, 110, 1024 }, { 7, 111, 1024 }, + { 4, 112, 1024 }, { 5, 113, 1024 }, { 5, 114, 1024 }, { 6, 115, 1024 }, { 5, 116, 1024 }, { 6, 117, 1024 }, { 6, 118, 1024 }, { 7, 119, 1024 }, + { 5, 120, 1024 }, { 6, 121, 1024 }, { 6, 122, 1024 }, { 7, 123, 1024 }, { 6, 124, 1024 }, { 7, 125, 1024 }, { 7, 126, 1024 }, { 8, 127, 1024 }, + { 2, 128, 1024 }, { 3, 129, 1024 }, { 3, 130, 1024 }, { 4, 131, 1024 }, { 3, 132, 1024 }, { 4, 133, 1024 }, { 4, 134, 1024 }, { 5, 135, 1024 }, + { 3, 136, 1024 }, { 4, 137, 1024 }, { 4, 138, 1024 }, { 5, 139, 1024 }, { 4, 140, 1024 }, { 5, 141, 1024 }, { 5, 142, 1024 }, { 6, 143, 1024 }, + { 3, 144, 1024 }, { 4, 145, 1024 }, { 4, 146, 1024 }, { 5, 147, 1024 }, { 4, 148, 1024 }, { 5, 149, 1024 }, { 5, 150, 1024 }, { 6, 151, 1024 }, + { 4, 152, 1024 }, { 5, 153, 1024 }, { 5, 154, 1024 }, { 6, 155, 1024 }, { 5, 156, 1024 }, { 6, 157, 1024 }, { 6, 158, 1024 }, { 7, 159, 1024 }, + { 3, 160, 1024 }, { 4, 161, 1024 }, { 4, 162, 1024 }, { 5, 163, 1024 }, { 4, 164, 1024 }, { 5, 165, 1024 }, { 5, 166, 1024 }, { 6, 167, 1024 }, + { 4, 168, 1024 }, { 5, 169, 1024 }, { 5, 170, 1024 }, { 6, 171, 1024 }, { 5, 172, 1024 }, { 6, 173, 1024 }, { 6, 174, 1024 }, { 7, 175, 1024 }, + { 4, 176, 1024 }, { 5, 177, 1024 }, { 5, 178, 1024 }, { 6, 179, 1024 }, { 5, 180, 1024 }, { 6, 181, 1024 }, { 6, 182, 1024 }, { 7, 183, 1024 }, + { 5, 184, 1024 }, { 6, 185, 1024 }, { 6, 186, 1024 }, { 7, 187, 1024 }, { 6, 188, 1024 }, { 7, 189, 1024 }, { 7, 190, 1024 }, { 8, 191, 1024 }, + { 3, 192, 1024 }, { 4, 193, 1024 }, { 4, 194, 1024 }, { 5, 195, 1024 }, { 4, 196, 1024 }, { 5, 197, 1024 }, { 5, 198, 1024 }, { 6, 199, 1024 }, + { 4, 200, 1024 }, { 5, 201, 1024 }, { 5, 202, 1024 }, { 6, 203, 1024 }, { 5, 204, 1024 }, { 6, 205, 1024 }, { 6, 206, 1024 }, { 7, 207, 1024 }, + { 4, 208, 1024 }, { 5, 209, 1024 }, { 5, 210, 1024 }, { 6, 211, 1024 }, { 5, 212, 1024 }, { 6, 213, 1024 }, { 6, 214, 1024 }, { 7, 215, 1024 }, + { 5, 216, 1024 }, { 6, 217, 1024 }, { 6, 218, 1024 }, { 7, 219, 1024 }, { 6, 220, 1024 }, { 7, 221, 1024 }, { 7, 222, 1024 }, { 8, 223, 1024 }, + { 4, 224, 1024 }, { 5, 225, 1024 }, { 5, 226, 1024 }, { 6, 227, 1024 }, { 5, 228, 1024 }, { 6, 229, 1024 }, { 6, 230, 1024 }, { 7, 231, 1024 }, + { 5, 232, 1024 }, { 6, 233, 1024 }, { 6, 234, 1024 }, { 7, 235, 1024 }, { 6, 236, 1024 }, { 7, 237, 1024 }, { 7, 238, 1024 }, { 8, 239, 1024 }, + { 5, 240, 1024 }, { 6, 241, 1024 }, { 6, 242, 1024 }, { 7, 243, 1024 }, { 6, 244, 1024 }, { 7, 245, 1024 }, { 7, 246, 1024 }, { 8, 247, 1024 }, + { 6, 248, 1024 }, { 7, 249, 1024 }, { 7, 250, 1024 }, { 8, 251, 1024 }, { 7, 252, 1024 }, { 8, 253, 1024 }, { 8, 254, 1024 }, { 9, 255, 1024 }, + { 2, 256, 1024 }, { 3, 257, 1024 }, { 3, 258, 1024 }, { 4, 259, 1024 }, { 3, 260, 1024 }, { 4, 261, 1024 }, { 4, 262, 1024 }, { 5, 263, 1024 }, + { 3, 264, 1024 }, { 4, 265, 1024 }, { 4, 266, 1024 }, { 5, 267, 1024 }, { 4, 268, 1024 }, { 5, 269, 1024 }, { 5, 270, 1024 }, { 6, 271, 1024 }, + { 3, 272, 1024 }, { 4, 273, 1024 }, { 4, 274, 1024 }, { 5, 275, 1024 }, { 4, 276, 1024 }, { 5, 277, 1024 }, { 5, 278, 1024 }, { 6, 279, 1024 }, + { 4, 280, 1024 }, { 5, 281, 1024 }, { 5, 282, 1024 }, { 6, 283, 1024 }, { 5, 284, 1024 }, { 6, 285, 1024 }, { 6, 286, 1024 }, { 7, 287, 1024 }, + { 3, 288, 1024 }, { 4, 289, 1024 }, { 4, 290, 1024 }, { 5, 291, 1024 }, { 4, 292, 1024 }, { 5, 293, 1024 }, { 5, 294, 1024 }, { 6, 295, 1024 }, + { 4, 296, 1024 }, { 5, 297, 1024 }, { 5, 298, 1024 }, { 6, 299, 1024 }, { 5, 300, 1024 }, { 6, 301, 1024 }, { 6, 302, 1024 }, { 7, 303, 1024 }, + { 4, 304, 1024 }, { 5, 305, 1024 }, { 5, 306, 1024 }, { 6, 307, 1024 }, { 5, 308, 1024 }, { 6, 309, 1024 }, { 6, 310, 1024 }, { 7, 311, 1024 }, + { 5, 312, 1024 }, { 6, 313, 1024 }, { 6, 314, 1024 }, { 7, 315, 1024 }, { 6, 316, 1024 }, { 7, 317, 1024 }, { 7, 318, 1024 }, { 8, 319, 1024 }, + { 3, 320, 1024 }, { 4, 321, 1024 }, { 4, 322, 1024 }, { 5, 323, 1024 }, { 4, 324, 1024 }, { 5, 325, 1024 }, { 5, 326, 1024 }, { 6, 327, 1024 }, + { 4, 328, 1024 }, { 5, 329, 1024 }, { 5, 330, 1024 }, { 6, 331, 1024 }, { 5, 332, 1024 }, { 6, 333, 1024 }, { 6, 334, 1024 }, { 7, 335, 1024 }, + { 4, 336, 1024 }, { 5, 337, 1024 }, { 5, 338, 1024 }, { 6, 339, 1024 }, { 5, 340, 1024 }, { 6, 341, 1024 }, { 6, 342, 1024 }, { 7, 343, 1024 }, + { 5, 344, 1024 }, { 6, 345, 1024 }, { 6, 346, 1024 }, { 7, 347, 1024 }, { 6, 348, 1024 }, { 7, 349, 1024 }, { 7, 350, 1024 }, { 8, 351, 1024 }, + { 4, 352, 1024 }, { 5, 353, 1024 }, { 5, 354, 1024 }, { 6, 355, 1024 }, { 5, 356, 1024 }, { 6, 357, 1024 }, { 6, 358, 1024 }, { 7, 359, 1024 }, + { 5, 360, 1024 }, { 6, 361, 1024 }, { 6, 362, 1024 }, { 7, 363, 1024 }, { 6, 364, 1024 }, { 7, 365, 1024 }, { 7, 366, 1024 }, { 8, 367, 1024 }, + { 5, 368, 1024 }, { 6, 369, 1024 }, { 6, 370, 1024 }, { 7, 371, 1024 }, { 6, 372, 1024 }, { 7, 373, 1024 }, { 7, 374, 1024 }, { 8, 375, 1024 }, + { 6, 376, 1024 }, { 7, 377, 1024 }, { 7, 378, 1024 }, { 8, 379, 1024 }, { 7, 380, 1024 }, { 8, 381, 1024 }, { 8, 382, 1024 }, { 9, 383, 1024 }, + { 3, 384, 1024 }, { 4, 385, 1024 }, { 4, 386, 1024 }, { 5, 387, 1024 }, { 4, 388, 1024 }, { 5, 389, 1024 }, { 5, 390, 1024 }, { 6, 391, 1024 }, + { 4, 392, 1024 }, { 5, 393, 1024 }, { 5, 394, 1024 }, { 6, 395, 1024 }, { 5, 396, 1024 }, { 6, 397, 1024 }, { 6, 398, 1024 }, { 7, 399, 1024 }, + { 4, 400, 1024 }, { 5, 401, 1024 }, { 5, 402, 1024 }, { 6, 403, 1024 }, { 5, 404, 1024 }, { 6, 405, 1024 }, { 6, 406, 1024 }, { 7, 407, 1024 }, + { 5, 408, 1024 }, { 6, 409, 1024 }, { 6, 410, 1024 }, { 7, 411, 1024 }, { 6, 412, 1024 }, { 7, 413, 1024 }, { 7, 414, 1024 }, { 8, 415, 1024 }, + { 4, 416, 1024 }, { 5, 417, 1024 }, { 5, 418, 1024 }, { 6, 419, 1024 }, { 5, 420, 1024 }, { 6, 421, 1024 }, { 6, 422, 1024 }, { 7, 423, 1024 }, + { 5, 424, 1024 }, { 6, 425, 1024 }, { 6, 426, 1024 }, { 7, 427, 1024 }, { 6, 428, 1024 }, { 7, 429, 1024 }, { 7, 430, 1024 }, { 8, 431, 1024 }, + { 5, 432, 1024 }, { 6, 433, 1024 }, { 6, 434, 1024 }, { 7, 435, 1024 }, { 6, 436, 1024 }, { 7, 437, 1024 }, { 7, 438, 1024 }, { 8, 439, 1024 }, + { 6, 440, 1024 }, { 7, 441, 1024 }, { 7, 442, 1024 }, { 8, 443, 1024 }, { 7, 444, 1024 }, { 8, 445, 1024 }, { 8, 446, 1024 }, { 9, 447, 1024 }, + { 4, 448, 1024 }, { 5, 449, 1024 }, { 5, 450, 1024 }, { 6, 451, 1024 }, { 5, 452, 1024 }, { 6, 453, 1024 }, { 6, 454, 1024 }, { 7, 455, 1024 }, + { 5, 456, 1024 }, { 6, 457, 1024 }, { 6, 458, 1024 }, { 7, 459, 1024 }, { 6, 460, 1024 }, { 7, 461, 1024 }, { 7, 462, 1024 }, { 8, 463, 1024 }, + { 5, 464, 1024 }, { 6, 465, 1024 }, { 6, 466, 1024 }, { 7, 467, 1024 }, { 6, 468, 1024 }, { 7, 469, 1024 }, { 7, 470, 1024 }, { 8, 471, 1024 }, + { 6, 472, 1024 }, { 7, 473, 1024 }, { 7, 474, 1024 }, { 8, 475, 1024 }, { 7, 476, 1024 }, { 8, 477, 1024 }, { 8, 478, 1024 }, { 9, 479, 1024 }, + { 5, 480, 1024 }, { 6, 481, 1024 }, { 6, 482, 1024 }, { 7, 483, 1024 }, { 6, 484, 1024 }, { 7, 485, 1024 }, { 7, 486, 1024 }, { 8, 487, 1024 }, + { 6, 488, 1024 }, { 7, 489, 1024 }, { 7, 490, 1024 }, { 8, 491, 1024 }, { 7, 492, 1024 }, { 8, 493, 1024 }, { 8, 494, 1024 }, { 9, 495, 1024 }, + { 6, 496, 1024 }, { 7, 497, 1024 }, { 7, 498, 1024 }, { 8, 499, 1024 }, { 7, 500, 1024 }, { 8, 501, 1024 }, { 8, 502, 1024 }, { 9, 503, 1024 }, + { 7, 504, 1024 }, { 8, 505, 1024 }, { 8, 506, 1024 }, { 9, 507, 1024 }, { 8, 508, 1024 }, { 9, 509, 1024 }, { 9, 510, 1024 }, { 10, 511, 1024 }, + { 2, 512, 1024 }, { 3, 513, 1024 }, { 3, 514, 1024 }, { 4, 515, 1024 }, { 3, 516, 1024 }, { 4, 517, 1024 }, { 4, 518, 1024 }, { 5, 519, 1024 }, + { 3, 520, 1024 }, { 4, 521, 1024 }, { 4, 522, 1024 }, { 5, 523, 1024 }, { 4, 524, 1024 }, { 5, 525, 1024 }, { 5, 526, 1024 }, { 6, 527, 1024 }, + { 3, 528, 1024 }, { 4, 529, 1024 }, { 4, 530, 1024 }, { 5, 531, 1024 }, { 4, 532, 1024 }, { 5, 533, 1024 }, { 5, 534, 1024 }, { 6, 535, 1024 }, + { 4, 536, 1024 }, { 5, 537, 1024 }, { 5, 538, 1024 }, { 6, 539, 1024 }, { 5, 540, 1024 }, { 6, 541, 1024 }, { 6, 542, 1024 }, { 7, 543, 1024 }, + { 3, 544, 1024 }, { 4, 545, 1024 }, { 4, 546, 1024 }, { 5, 547, 1024 }, { 4, 548, 1024 }, { 5, 549, 1024 }, { 5, 550, 1024 }, { 6, 551, 1024 }, + { 4, 552, 1024 }, { 5, 553, 1024 }, { 5, 554, 1024 }, { 6, 555, 1024 }, { 5, 556, 1024 }, { 6, 557, 1024 }, { 6, 558, 1024 }, { 7, 559, 1024 }, + { 4, 560, 1024 }, { 5, 561, 1024 }, { 5, 562, 1024 }, { 6, 563, 1024 }, { 5, 564, 1024 }, { 6, 565, 1024 }, { 6, 566, 1024 }, { 7, 567, 1024 }, + { 5, 568, 1024 }, { 6, 569, 1024 }, { 6, 570, 1024 }, { 7, 571, 1024 }, { 6, 572, 1024 }, { 7, 573, 1024 }, { 7, 574, 1024 }, { 8, 575, 1024 }, + { 3, 576, 1024 }, { 4, 577, 1024 }, { 4, 578, 1024 }, { 5, 579, 1024 }, { 4, 580, 1024 }, { 5, 581, 1024 }, { 5, 582, 1024 }, { 6, 583, 1024 }, + { 4, 584, 1024 }, { 5, 585, 1024 }, { 5, 586, 1024 }, { 6, 587, 1024 }, { 5, 588, 1024 }, { 6, 589, 1024 }, { 6, 590, 1024 }, { 7, 591, 1024 }, + { 4, 592, 1024 }, { 5, 593, 1024 }, { 5, 594, 1024 }, { 6, 595, 1024 }, { 5, 596, 1024 }, { 6, 597, 1024 }, { 6, 598, 1024 }, { 7, 599, 1024 }, + { 5, 600, 1024 }, { 6, 601, 1024 }, { 6, 602, 1024 }, { 7, 603, 1024 }, { 6, 604, 1024 }, { 7, 605, 1024 }, { 7, 606, 1024 }, { 8, 607, 1024 }, + { 4, 608, 1024 }, { 5, 609, 1024 }, { 5, 610, 1024 }, { 6, 611, 1024 }, { 5, 612, 1024 }, { 6, 613, 1024 }, { 6, 614, 1024 }, { 7, 615, 1024 }, + { 5, 616, 1024 }, { 6, 617, 1024 }, { 6, 618, 1024 }, { 7, 619, 1024 }, { 6, 620, 1024 }, { 7, 621, 1024 }, { 7, 622, 1024 }, { 8, 623, 1024 }, + { 5, 624, 1024 }, { 6, 625, 1024 }, { 6, 626, 1024 }, { 7, 627, 1024 }, { 6, 628, 1024 }, { 7, 629, 1024 }, { 7, 630, 1024 }, { 8, 631, 1024 }, + { 6, 632, 1024 }, { 7, 633, 1024 }, { 7, 634, 1024 }, { 8, 635, 1024 }, { 7, 636, 1024 }, { 8, 637, 1024 }, { 8, 638, 1024 }, { 9, 639, 1024 }, + { 3, 640, 1024 }, { 4, 641, 1024 }, { 4, 642, 1024 }, { 5, 643, 1024 }, { 4, 644, 1024 }, { 5, 645, 1024 }, { 5, 646, 1024 }, { 6, 647, 1024 }, + { 4, 648, 1024 }, { 5, 649, 1024 }, { 5, 650, 1024 }, { 6, 651, 1024 }, { 5, 652, 1024 }, { 6, 653, 1024 }, { 6, 654, 1024 }, { 7, 655, 1024 }, + { 4, 656, 1024 }, { 5, 657, 1024 }, { 5, 658, 1024 }, { 6, 659, 1024 }, { 5, 660, 1024 }, { 6, 661, 1024 }, { 6, 662, 1024 }, { 7, 663, 1024 }, + { 5, 664, 1024 }, { 6, 665, 1024 }, { 6, 666, 1024 }, { 7, 667, 1024 }, { 6, 668, 1024 }, { 7, 669, 1024 }, { 7, 670, 1024 }, { 8, 671, 1024 }, + { 4, 672, 1024 }, { 5, 673, 1024 }, { 5, 674, 1024 }, { 6, 675, 1024 }, { 5, 676, 1024 }, { 6, 677, 1024 }, { 6, 678, 1024 }, { 7, 679, 1024 }, + { 5, 680, 1024 }, { 6, 681, 1024 }, { 6, 682, 1024 }, { 7, 683, 1024 }, { 6, 684, 1024 }, { 7, 685, 1024 }, { 7, 686, 1024 }, { 8, 687, 1024 }, + { 5, 688, 1024 }, { 6, 689, 1024 }, { 6, 690, 1024 }, { 7, 691, 1024 }, { 6, 692, 1024 }, { 7, 693, 1024 }, { 7, 694, 1024 }, { 8, 695, 1024 }, + { 6, 696, 1024 }, { 7, 697, 1024 }, { 7, 698, 1024 }, { 8, 699, 1024 }, { 7, 700, 1024 }, { 8, 701, 1024 }, { 8, 702, 1024 }, { 9, 703, 1024 }, + { 4, 704, 1024 }, { 5, 705, 1024 }, { 5, 706, 1024 }, { 6, 707, 1024 }, { 5, 708, 1024 }, { 6, 709, 1024 }, { 6, 710, 1024 }, { 7, 711, 1024 }, + { 5, 712, 1024 }, { 6, 713, 1024 }, { 6, 714, 1024 }, { 7, 715, 1024 }, { 6, 716, 1024 }, { 7, 717, 1024 }, { 7, 718, 1024 }, { 8, 719, 1024 }, + { 5, 720, 1024 }, { 6, 721, 1024 }, { 6, 722, 1024 }, { 7, 723, 1024 }, { 6, 724, 1024 }, { 7, 725, 1024 }, { 7, 726, 1024 }, { 8, 727, 1024 }, + { 6, 728, 1024 }, { 7, 729, 1024 }, { 7, 730, 1024 }, { 8, 731, 1024 }, { 7, 732, 1024 }, { 8, 733, 1024 }, { 8, 734, 1024 }, { 9, 735, 1024 }, + { 5, 736, 1024 }, { 6, 737, 1024 }, { 6, 738, 1024 }, { 7, 739, 1024 }, { 6, 740, 1024 }, { 7, 741, 1024 }, { 7, 742, 1024 }, { 8, 743, 1024 }, + { 6, 744, 1024 }, { 7, 745, 1024 }, { 7, 746, 1024 }, { 8, 747, 1024 }, { 7, 748, 1024 }, { 8, 749, 1024 }, { 8, 750, 1024 }, { 9, 751, 1024 }, + { 6, 752, 1024 }, { 7, 753, 1024 }, { 7, 754, 1024 }, { 8, 755, 1024 }, { 7, 756, 1024 }, { 8, 757, 1024 }, { 8, 758, 1024 }, { 9, 759, 1024 }, + { 7, 760, 1024 }, { 8, 761, 1024 }, { 8, 762, 1024 }, { 9, 763, 1024 }, { 8, 764, 1024 }, { 9, 765, 1024 }, { 9, 766, 1024 }, { 10, 767, 1024 }, + { 3, 768, 1024 }, { 4, 769, 1024 }, { 4, 770, 1024 }, { 5, 771, 1024 }, { 4, 772, 1024 }, { 5, 773, 1024 }, { 5, 774, 1024 }, { 6, 775, 1024 }, + { 4, 776, 1024 }, { 5, 777, 1024 }, { 5, 778, 1024 }, { 6, 779, 1024 }, { 5, 780, 1024 }, { 6, 781, 1024 }, { 6, 782, 1024 }, { 7, 783, 1024 }, + { 4, 784, 1024 }, { 5, 785, 1024 }, { 5, 786, 1024 }, { 6, 787, 1024 }, { 5, 788, 1024 }, { 6, 789, 1024 }, { 6, 790, 1024 }, { 7, 791, 1024 }, + { 5, 792, 1024 }, { 6, 793, 1024 }, { 6, 794, 1024 }, { 7, 795, 1024 }, { 6, 796, 1024 }, { 7, 797, 1024 }, { 7, 798, 1024 }, { 8, 799, 1024 }, + { 4, 800, 1024 }, { 5, 801, 1024 }, { 5, 802, 1024 }, { 6, 803, 1024 }, { 5, 804, 1024 }, { 6, 805, 1024 }, { 6, 806, 1024 }, { 7, 807, 1024 }, + { 5, 808, 1024 }, { 6, 809, 1024 }, { 6, 810, 1024 }, { 7, 811, 1024 }, { 6, 812, 1024 }, { 7, 813, 1024 }, { 7, 814, 1024 }, { 8, 815, 1024 }, + { 5, 816, 1024 }, { 6, 817, 1024 }, { 6, 818, 1024 }, { 7, 819, 1024 }, { 6, 820, 1024 }, { 7, 821, 1024 }, { 7, 822, 1024 }, { 8, 823, 1024 }, + { 6, 824, 1024 }, { 7, 825, 1024 }, { 7, 826, 1024 }, { 8, 827, 1024 }, { 7, 828, 1024 }, { 8, 829, 1024 }, { 8, 830, 1024 }, { 9, 831, 1024 }, + { 4, 832, 1024 }, { 5, 833, 1024 }, { 5, 834, 1024 }, { 6, 835, 1024 }, { 5, 836, 1024 }, { 6, 837, 1024 }, { 6, 838, 1024 }, { 7, 839, 1024 }, + { 5, 840, 1024 }, { 6, 841, 1024 }, { 6, 842, 1024 }, { 7, 843, 1024 }, { 6, 844, 1024 }, { 7, 845, 1024 }, { 7, 846, 1024 }, { 8, 847, 1024 }, + { 5, 848, 1024 }, { 6, 849, 1024 }, { 6, 850, 1024 }, { 7, 851, 1024 }, { 6, 852, 1024 }, { 7, 853, 1024 }, { 7, 854, 1024 }, { 8, 855, 1024 }, + { 6, 856, 1024 }, { 7, 857, 1024 }, { 7, 858, 1024 }, { 8, 859, 1024 }, { 7, 860, 1024 }, { 8, 861, 1024 }, { 8, 862, 1024 }, { 9, 863, 1024 }, + { 5, 864, 1024 }, { 6, 865, 1024 }, { 6, 866, 1024 }, { 7, 867, 1024 }, { 6, 868, 1024 }, { 7, 869, 1024 }, { 7, 870, 1024 }, { 8, 871, 1024 }, + { 6, 872, 1024 }, { 7, 873, 1024 }, { 7, 874, 1024 }, { 8, 875, 1024 }, { 7, 876, 1024 }, { 8, 877, 1024 }, { 8, 878, 1024 }, { 9, 879, 1024 }, + { 6, 880, 1024 }, { 7, 881, 1024 }, { 7, 882, 1024 }, { 8, 883, 1024 }, { 7, 884, 1024 }, { 8, 885, 1024 }, { 8, 886, 1024 }, { 9, 887, 1024 }, + { 7, 888, 1024 }, { 8, 889, 1024 }, { 8, 890, 1024 }, { 9, 891, 1024 }, { 8, 892, 1024 }, { 9, 893, 1024 }, { 9, 894, 1024 }, { 10, 895, 1024 }, + { 4, 896, 1024 }, { 5, 897, 1024 }, { 5, 898, 1024 }, { 6, 899, 1024 }, { 5, 900, 1024 }, { 6, 901, 1024 }, { 6, 902, 1024 }, { 7, 903, 1024 }, + { 5, 904, 1024 }, { 6, 905, 1024 }, { 6, 906, 1024 }, { 7, 907, 1024 }, { 6, 908, 1024 }, { 7, 909, 1024 }, { 7, 910, 1024 }, { 8, 911, 1024 }, + { 5, 912, 1024 }, { 6, 913, 1024 }, { 6, 914, 1024 }, { 7, 915, 1024 }, { 6, 916, 1024 }, { 7, 917, 1024 }, { 7, 918, 1024 }, { 8, 919, 1024 }, + { 6, 920, 1024 }, { 7, 921, 1024 }, { 7, 922, 1024 }, { 8, 923, 1024 }, { 7, 924, 1024 }, { 8, 925, 1024 }, { 8, 926, 1024 }, { 9, 927, 1024 }, + { 5, 928, 1024 }, { 6, 929, 1024 }, { 6, 930, 1024 }, { 7, 931, 1024 }, { 6, 932, 1024 }, { 7, 933, 1024 }, { 7, 934, 1024 }, { 8, 935, 1024 }, + { 6, 936, 1024 }, { 7, 937, 1024 }, { 7, 938, 1024 }, { 8, 939, 1024 }, { 7, 940, 1024 }, { 8, 941, 1024 }, { 8, 942, 1024 }, { 9, 943, 1024 }, + { 6, 944, 1024 }, { 7, 945, 1024 }, { 7, 946, 1024 }, { 8, 947, 1024 }, { 7, 948, 1024 }, { 8, 949, 1024 }, { 8, 950, 1024 }, { 9, 951, 1024 }, + { 7, 952, 1024 }, { 8, 953, 1024 }, { 8, 954, 1024 }, { 9, 955, 1024 }, { 8, 956, 1024 }, { 9, 957, 1024 }, { 9, 958, 1024 }, { 10, 959, 1024 }, + { 5, 960, 1024 }, { 6, 961, 1024 }, { 6, 962, 1024 }, { 7, 963, 1024 }, { 6, 964, 1024 }, { 7, 965, 1024 }, { 7, 966, 1024 }, { 8, 967, 1024 }, + { 6, 968, 1024 }, { 7, 969, 1024 }, { 7, 970, 1024 }, { 8, 971, 1024 }, { 7, 972, 1024 }, { 8, 973, 1024 }, { 8, 974, 1024 }, { 9, 975, 1024 }, + { 6, 976, 1024 }, { 7, 977, 1024 }, { 7, 978, 1024 }, { 8, 979, 1024 }, { 7, 980, 1024 }, { 8, 981, 1024 }, { 8, 982, 1024 }, { 9, 983, 1024 }, + { 7, 984, 1024 }, { 8, 985, 1024 }, { 8, 986, 1024 }, { 9, 987, 1024 }, { 8, 988, 1024 }, { 9, 989, 1024 }, { 9, 990, 1024 }, { 10, 991, 1024 }, + { 6, 992, 1024 }, { 7, 993, 1024 }, { 7, 994, 1024 }, { 8, 995, 1024 }, { 7, 996, 1024 }, { 8, 997, 1024 }, { 8, 998, 1024 }, { 9, 999, 1024 }, + { 7, 1000, 1024 }, { 8, 1001, 1024 }, { 8, 1002, 1024 }, { 9, 1003, 1024 }, { 8, 1004, 1024 }, { 9, 1005, 1024 }, { 9, 1006, 1024 }, { 10, 1007, 1024 }, + { 7, 1008, 1024 }, { 8, 1009, 1024 }, { 8, 1010, 1024 }, { 9, 1011, 1024 }, { 8, 1012, 1024 }, { 9, 1013, 1024 }, { 9, 1014, 1024 }, { 10, 1015, 1024 }, + { 8, 1016, 1024 }, { 9, 1017, 1024 }, { 9, 1018, 1024 }, { 10, 1019, 1024 }, { 9, 1020, 1024 }, { 10, 1021, 1024 }, { 10, 1022, 1024 }, { 11, 1023, 1024 }, #if FP_LUT > 11 - { 1, 0, 0 }, { 2, 1, 2048 }, { 2, 2, 2048 }, { 3, 3, 2048 }, { 2, 4, 2048 }, { 3, 5, 2048 }, { 3, 6, 2048 }, { 4, 7, 2048 }, - { 2, 8, 2048 }, { 3, 9, 2048 }, { 3, 10, 2048 }, { 4, 11, 2048 }, { 3, 12, 2048 }, { 4, 13, 2048 }, { 4, 14, 2048 }, { 5, 15, 2048 }, - { 2, 16, 2048 }, { 3, 17, 2048 }, { 3, 18, 2048 }, { 4, 19, 2048 }, { 3, 20, 2048 }, { 4, 21, 2048 }, { 4, 22, 2048 }, { 5, 23, 2048 }, - { 3, 24, 2048 }, { 4, 25, 2048 }, { 4, 26, 2048 }, { 5, 27, 2048 }, { 4, 28, 2048 }, { 5, 29, 2048 }, { 5, 30, 2048 }, { 6, 31, 2048 }, - { 2, 32, 2048 }, { 3, 33, 2048 }, { 3, 34, 2048 }, { 4, 35, 2048 }, { 3, 36, 2048 }, { 4, 37, 2048 }, { 4, 38, 2048 }, { 5, 39, 2048 }, - { 3, 40, 2048 }, { 4, 41, 2048 }, { 4, 42, 2048 }, { 5, 43, 2048 }, { 4, 44, 2048 }, { 5, 45, 2048 }, { 5, 46, 2048 }, { 6, 47, 2048 }, - { 3, 48, 2048 }, { 4, 49, 2048 }, { 4, 50, 2048 }, { 5, 51, 2048 }, { 4, 52, 2048 }, { 5, 53, 2048 }, { 5, 54, 2048 }, { 6, 55, 2048 }, - { 4, 56, 2048 }, { 5, 57, 2048 }, { 5, 58, 2048 }, { 6, 59, 2048 }, { 5, 60, 2048 }, { 6, 61, 2048 }, { 6, 62, 2048 }, { 7, 63, 2048 }, - { 2, 64, 2048 }, { 3, 65, 2048 }, { 3, 66, 2048 }, { 4, 67, 2048 }, { 3, 68, 2048 }, { 4, 69, 2048 }, { 4, 70, 2048 }, { 5, 71, 2048 }, - { 3, 72, 2048 }, { 4, 73, 2048 }, { 4, 74, 2048 }, { 5, 75, 2048 }, { 4, 76, 2048 }, { 5, 77, 2048 }, { 5, 78, 2048 }, { 6, 79, 2048 }, - { 3, 80, 2048 }, { 4, 81, 2048 }, { 4, 82, 2048 }, { 5, 83, 2048 }, { 4, 84, 2048 }, { 5, 85, 2048 }, { 5, 86, 2048 }, { 6, 87, 2048 }, - { 4, 88, 2048 }, { 5, 89, 2048 }, { 5, 90, 2048 }, { 6, 91, 2048 }, { 5, 92, 2048 }, { 6, 93, 2048 }, { 6, 94, 2048 }, { 7, 95, 2048 }, - { 3, 96, 2048 }, { 4, 97, 2048 }, { 4, 98, 2048 }, { 5, 99, 2048 }, { 4, 100, 2048 }, { 5, 101, 2048 }, { 5, 102, 2048 }, { 6, 103, 2048 }, - { 4, 104, 2048 }, { 5, 105, 2048 }, { 5, 106, 2048 }, { 6, 107, 2048 }, { 5, 108, 2048 }, { 6, 109, 2048 }, { 6, 110, 2048 }, { 7, 111, 2048 }, - { 4, 112, 2048 }, { 5, 113, 2048 }, { 5, 114, 2048 }, { 6, 115, 2048 }, { 5, 116, 2048 }, { 6, 117, 2048 }, { 6, 118, 2048 }, { 7, 119, 2048 }, - { 5, 120, 2048 }, { 6, 121, 2048 }, { 6, 122, 2048 }, { 7, 123, 2048 }, { 6, 124, 2048 }, { 7, 125, 2048 }, { 7, 126, 2048 }, { 8, 127, 2048 }, - { 2, 128, 2048 }, { 3, 129, 2048 }, { 3, 130, 2048 }, { 4, 131, 2048 }, { 3, 132, 2048 }, { 4, 133, 2048 }, { 4, 134, 2048 }, { 5, 135, 2048 }, - { 3, 136, 2048 }, { 4, 137, 2048 }, { 4, 138, 2048 }, { 5, 139, 2048 }, { 4, 140, 2048 }, { 5, 141, 2048 }, { 5, 142, 2048 }, { 6, 143, 2048 }, - { 3, 144, 2048 }, { 4, 145, 2048 }, { 4, 146, 2048 }, { 5, 147, 2048 }, { 4, 148, 2048 }, { 5, 149, 2048 }, { 5, 150, 2048 }, { 6, 151, 2048 }, - { 4, 152, 2048 }, { 5, 153, 2048 }, { 5, 154, 2048 }, { 6, 155, 2048 }, { 5, 156, 2048 }, { 6, 157, 2048 }, { 6, 158, 2048 }, { 7, 159, 2048 }, - { 3, 160, 2048 }, { 4, 161, 2048 }, { 4, 162, 2048 }, { 5, 163, 2048 }, { 4, 164, 2048 }, { 5, 165, 2048 }, { 5, 166, 2048 }, { 6, 167, 2048 }, - { 4, 168, 2048 }, { 5, 169, 2048 }, { 5, 170, 2048 }, { 6, 171, 2048 }, { 5, 172, 2048 }, { 6, 173, 2048 }, { 6, 174, 2048 }, { 7, 175, 2048 }, - { 4, 176, 2048 }, { 5, 177, 2048 }, { 5, 178, 2048 }, { 6, 179, 2048 }, { 5, 180, 2048 }, { 6, 181, 2048 }, { 6, 182, 2048 }, { 7, 183, 2048 }, - { 5, 184, 2048 }, { 6, 185, 2048 }, { 6, 186, 2048 }, { 7, 187, 2048 }, { 6, 188, 2048 }, { 7, 189, 2048 }, { 7, 190, 2048 }, { 8, 191, 2048 }, - { 3, 192, 2048 }, { 4, 193, 2048 }, { 4, 194, 2048 }, { 5, 195, 2048 }, { 4, 196, 2048 }, { 5, 197, 2048 }, { 5, 198, 2048 }, { 6, 199, 2048 }, - { 4, 200, 2048 }, { 5, 201, 2048 }, { 5, 202, 2048 }, { 6, 203, 2048 }, { 5, 204, 2048 }, { 6, 205, 2048 }, { 6, 206, 2048 }, { 7, 207, 2048 }, - { 4, 208, 2048 }, { 5, 209, 2048 }, { 5, 210, 2048 }, { 6, 211, 2048 }, { 5, 212, 2048 }, { 6, 213, 2048 }, { 6, 214, 2048 }, { 7, 215, 2048 }, - { 5, 216, 2048 }, { 6, 217, 2048 }, { 6, 218, 2048 }, { 7, 219, 2048 }, { 6, 220, 2048 }, { 7, 221, 2048 }, { 7, 222, 2048 }, { 8, 223, 2048 }, - { 4, 224, 2048 }, { 5, 225, 2048 }, { 5, 226, 2048 }, { 6, 227, 2048 }, { 5, 228, 2048 }, { 6, 229, 2048 }, { 6, 230, 2048 }, { 7, 231, 2048 }, - { 5, 232, 2048 }, { 6, 233, 2048 }, { 6, 234, 2048 }, { 7, 235, 2048 }, { 6, 236, 2048 }, { 7, 237, 2048 }, { 7, 238, 2048 }, { 8, 239, 2048 }, - { 5, 240, 2048 }, { 6, 241, 2048 }, { 6, 242, 2048 }, { 7, 243, 2048 }, { 6, 244, 2048 }, { 7, 245, 2048 }, { 7, 246, 2048 }, { 8, 247, 2048 }, - { 6, 248, 2048 }, { 7, 249, 2048 }, { 7, 250, 2048 }, { 8, 251, 2048 }, { 7, 252, 2048 }, { 8, 253, 2048 }, { 8, 254, 2048 }, { 9, 255, 2048 }, - { 2, 256, 2048 }, { 3, 257, 2048 }, { 3, 258, 2048 }, { 4, 259, 2048 }, { 3, 260, 2048 }, { 4, 261, 2048 }, { 4, 262, 2048 }, { 5, 263, 2048 }, - { 3, 264, 2048 }, { 4, 265, 2048 }, { 4, 266, 2048 }, { 5, 267, 2048 }, { 4, 268, 2048 }, { 5, 269, 2048 }, { 5, 270, 2048 }, { 6, 271, 2048 }, - { 3, 272, 2048 }, { 4, 273, 2048 }, { 4, 274, 2048 }, { 5, 275, 2048 }, { 4, 276, 2048 }, { 5, 277, 2048 }, { 5, 278, 2048 }, { 6, 279, 2048 }, - { 4, 280, 2048 }, { 5, 281, 2048 }, { 5, 282, 2048 }, { 6, 283, 2048 }, { 5, 284, 2048 }, { 6, 285, 2048 }, { 6, 286, 2048 }, { 7, 287, 2048 }, - { 3, 288, 2048 }, { 4, 289, 2048 }, { 4, 290, 2048 }, { 5, 291, 2048 }, { 4, 292, 2048 }, { 5, 293, 2048 }, { 5, 294, 2048 }, { 6, 295, 2048 }, - { 4, 296, 2048 }, { 5, 297, 2048 }, { 5, 298, 2048 }, { 6, 299, 2048 }, { 5, 300, 2048 }, { 6, 301, 2048 }, { 6, 302, 2048 }, { 7, 303, 2048 }, - { 4, 304, 2048 }, { 5, 305, 2048 }, { 5, 306, 2048 }, { 6, 307, 2048 }, { 5, 308, 2048 }, { 6, 309, 2048 }, { 6, 310, 2048 }, { 7, 311, 2048 }, - { 5, 312, 2048 }, { 6, 313, 2048 }, { 6, 314, 2048 }, { 7, 315, 2048 }, { 6, 316, 2048 }, { 7, 317, 2048 }, { 7, 318, 2048 }, { 8, 319, 2048 }, - { 3, 320, 2048 }, { 4, 321, 2048 }, { 4, 322, 2048 }, { 5, 323, 2048 }, { 4, 324, 2048 }, { 5, 325, 2048 }, { 5, 326, 2048 }, { 6, 327, 2048 }, - { 4, 328, 2048 }, { 5, 329, 2048 }, { 5, 330, 2048 }, { 6, 331, 2048 }, { 5, 332, 2048 }, { 6, 333, 2048 }, { 6, 334, 2048 }, { 7, 335, 2048 }, - { 4, 336, 2048 }, { 5, 337, 2048 }, { 5, 338, 2048 }, { 6, 339, 2048 }, { 5, 340, 2048 }, { 6, 341, 2048 }, { 6, 342, 2048 }, { 7, 343, 2048 }, - { 5, 344, 2048 }, { 6, 345, 2048 }, { 6, 346, 2048 }, { 7, 347, 2048 }, { 6, 348, 2048 }, { 7, 349, 2048 }, { 7, 350, 2048 }, { 8, 351, 2048 }, - { 4, 352, 2048 }, { 5, 353, 2048 }, { 5, 354, 2048 }, { 6, 355, 2048 }, { 5, 356, 2048 }, { 6, 357, 2048 }, { 6, 358, 2048 }, { 7, 359, 2048 }, - { 5, 360, 2048 }, { 6, 361, 2048 }, { 6, 362, 2048 }, { 7, 363, 2048 }, { 6, 364, 2048 }, { 7, 365, 2048 }, { 7, 366, 2048 }, { 8, 367, 2048 }, - { 5, 368, 2048 }, { 6, 369, 2048 }, { 6, 370, 2048 }, { 7, 371, 2048 }, { 6, 372, 2048 }, { 7, 373, 2048 }, { 7, 374, 2048 }, { 8, 375, 2048 }, - { 6, 376, 2048 }, { 7, 377, 2048 }, { 7, 378, 2048 }, { 8, 379, 2048 }, { 7, 380, 2048 }, { 8, 381, 2048 }, { 8, 382, 2048 }, { 9, 383, 2048 }, - { 3, 384, 2048 }, { 4, 385, 2048 }, { 4, 386, 2048 }, { 5, 387, 2048 }, { 4, 388, 2048 }, { 5, 389, 2048 }, { 5, 390, 2048 }, { 6, 391, 2048 }, - { 4, 392, 2048 }, { 5, 393, 2048 }, { 5, 394, 2048 }, { 6, 395, 2048 }, { 5, 396, 2048 }, { 6, 397, 2048 }, { 6, 398, 2048 }, { 7, 399, 2048 }, - { 4, 400, 2048 }, { 5, 401, 2048 }, { 5, 402, 2048 }, { 6, 403, 2048 }, { 5, 404, 2048 }, { 6, 405, 2048 }, { 6, 406, 2048 }, { 7, 407, 2048 }, - { 5, 408, 2048 }, { 6, 409, 2048 }, { 6, 410, 2048 }, { 7, 411, 2048 }, { 6, 412, 2048 }, { 7, 413, 2048 }, { 7, 414, 2048 }, { 8, 415, 2048 }, - { 4, 416, 2048 }, { 5, 417, 2048 }, { 5, 418, 2048 }, { 6, 419, 2048 }, { 5, 420, 2048 }, { 6, 421, 2048 }, { 6, 422, 2048 }, { 7, 423, 2048 }, - { 5, 424, 2048 }, { 6, 425, 2048 }, { 6, 426, 2048 }, { 7, 427, 2048 }, { 6, 428, 2048 }, { 7, 429, 2048 }, { 7, 430, 2048 }, { 8, 431, 2048 }, - { 5, 432, 2048 }, { 6, 433, 2048 }, { 6, 434, 2048 }, { 7, 435, 2048 }, { 6, 436, 2048 }, { 7, 437, 2048 }, { 7, 438, 2048 }, { 8, 439, 2048 }, - { 6, 440, 2048 }, { 7, 441, 2048 }, { 7, 442, 2048 }, { 8, 443, 2048 }, { 7, 444, 2048 }, { 8, 445, 2048 }, { 8, 446, 2048 }, { 9, 447, 2048 }, - { 4, 448, 2048 }, { 5, 449, 2048 }, { 5, 450, 2048 }, { 6, 451, 2048 }, { 5, 452, 2048 }, { 6, 453, 2048 }, { 6, 454, 2048 }, { 7, 455, 2048 }, - { 5, 456, 2048 }, { 6, 457, 2048 }, { 6, 458, 2048 }, { 7, 459, 2048 }, { 6, 460, 2048 }, { 7, 461, 2048 }, { 7, 462, 2048 }, { 8, 463, 2048 }, - { 5, 464, 2048 }, { 6, 465, 2048 }, { 6, 466, 2048 }, { 7, 467, 2048 }, { 6, 468, 2048 }, { 7, 469, 2048 }, { 7, 470, 2048 }, { 8, 471, 2048 }, - { 6, 472, 2048 }, { 7, 473, 2048 }, { 7, 474, 2048 }, { 8, 475, 2048 }, { 7, 476, 2048 }, { 8, 477, 2048 }, { 8, 478, 2048 }, { 9, 479, 2048 }, - { 5, 480, 2048 }, { 6, 481, 2048 }, { 6, 482, 2048 }, { 7, 483, 2048 }, { 6, 484, 2048 }, { 7, 485, 2048 }, { 7, 486, 2048 }, { 8, 487, 2048 }, - { 6, 488, 2048 }, { 7, 489, 2048 }, { 7, 490, 2048 }, { 8, 491, 2048 }, { 7, 492, 2048 }, { 8, 493, 2048 }, { 8, 494, 2048 }, { 9, 495, 2048 }, - { 6, 496, 2048 }, { 7, 497, 2048 }, { 7, 498, 2048 }, { 8, 499, 2048 }, { 7, 500, 2048 }, { 8, 501, 2048 }, { 8, 502, 2048 }, { 9, 503, 2048 }, - { 7, 504, 2048 }, { 8, 505, 2048 }, { 8, 506, 2048 }, { 9, 507, 2048 }, { 8, 508, 2048 }, { 9, 509, 2048 }, { 9, 510, 2048 }, { 10, 511, 2048 }, - { 2, 512, 2048 }, { 3, 513, 2048 }, { 3, 514, 2048 }, { 4, 515, 2048 }, { 3, 516, 2048 }, { 4, 517, 2048 }, { 4, 518, 2048 }, { 5, 519, 2048 }, - { 3, 520, 2048 }, { 4, 521, 2048 }, { 4, 522, 2048 }, { 5, 523, 2048 }, { 4, 524, 2048 }, { 5, 525, 2048 }, { 5, 526, 2048 }, { 6, 527, 2048 }, - { 3, 528, 2048 }, { 4, 529, 2048 }, { 4, 530, 2048 }, { 5, 531, 2048 }, { 4, 532, 2048 }, { 5, 533, 2048 }, { 5, 534, 2048 }, { 6, 535, 2048 }, - { 4, 536, 2048 }, { 5, 537, 2048 }, { 5, 538, 2048 }, { 6, 539, 2048 }, { 5, 540, 2048 }, { 6, 541, 2048 }, { 6, 542, 2048 }, { 7, 543, 2048 }, - { 3, 544, 2048 }, { 4, 545, 2048 }, { 4, 546, 2048 }, { 5, 547, 2048 }, { 4, 548, 2048 }, { 5, 549, 2048 }, { 5, 550, 2048 }, { 6, 551, 2048 }, - { 4, 552, 2048 }, { 5, 553, 2048 }, { 5, 554, 2048 }, { 6, 555, 2048 }, { 5, 556, 2048 }, { 6, 557, 2048 }, { 6, 558, 2048 }, { 7, 559, 2048 }, - { 4, 560, 2048 }, { 5, 561, 2048 }, { 5, 562, 2048 }, { 6, 563, 2048 }, { 5, 564, 2048 }, { 6, 565, 2048 }, { 6, 566, 2048 }, { 7, 567, 2048 }, - { 5, 568, 2048 }, { 6, 569, 2048 }, { 6, 570, 2048 }, { 7, 571, 2048 }, { 6, 572, 2048 }, { 7, 573, 2048 }, { 7, 574, 2048 }, { 8, 575, 2048 }, - { 3, 576, 2048 }, { 4, 577, 2048 }, { 4, 578, 2048 }, { 5, 579, 2048 }, { 4, 580, 2048 }, { 5, 581, 2048 }, { 5, 582, 2048 }, { 6, 583, 2048 }, - { 4, 584, 2048 }, { 5, 585, 2048 }, { 5, 586, 2048 }, { 6, 587, 2048 }, { 5, 588, 2048 }, { 6, 589, 2048 }, { 6, 590, 2048 }, { 7, 591, 2048 }, - { 4, 592, 2048 }, { 5, 593, 2048 }, { 5, 594, 2048 }, { 6, 595, 2048 }, { 5, 596, 2048 }, { 6, 597, 2048 }, { 6, 598, 2048 }, { 7, 599, 2048 }, - { 5, 600, 2048 }, { 6, 601, 2048 }, { 6, 602, 2048 }, { 7, 603, 2048 }, { 6, 604, 2048 }, { 7, 605, 2048 }, { 7, 606, 2048 }, { 8, 607, 2048 }, - { 4, 608, 2048 }, { 5, 609, 2048 }, { 5, 610, 2048 }, { 6, 611, 2048 }, { 5, 612, 2048 }, { 6, 613, 2048 }, { 6, 614, 2048 }, { 7, 615, 2048 }, - { 5, 616, 2048 }, { 6, 617, 2048 }, { 6, 618, 2048 }, { 7, 619, 2048 }, { 6, 620, 2048 }, { 7, 621, 2048 }, { 7, 622, 2048 }, { 8, 623, 2048 }, - { 5, 624, 2048 }, { 6, 625, 2048 }, { 6, 626, 2048 }, { 7, 627, 2048 }, { 6, 628, 2048 }, { 7, 629, 2048 }, { 7, 630, 2048 }, { 8, 631, 2048 }, - { 6, 632, 2048 }, { 7, 633, 2048 }, { 7, 634, 2048 }, { 8, 635, 2048 }, { 7, 636, 2048 }, { 8, 637, 2048 }, { 8, 638, 2048 }, { 9, 639, 2048 }, - { 3, 640, 2048 }, { 4, 641, 2048 }, { 4, 642, 2048 }, { 5, 643, 2048 }, { 4, 644, 2048 }, { 5, 645, 2048 }, { 5, 646, 2048 }, { 6, 647, 2048 }, - { 4, 648, 2048 }, { 5, 649, 2048 }, { 5, 650, 2048 }, { 6, 651, 2048 }, { 5, 652, 2048 }, { 6, 653, 2048 }, { 6, 654, 2048 }, { 7, 655, 2048 }, - { 4, 656, 2048 }, { 5, 657, 2048 }, { 5, 658, 2048 }, { 6, 659, 2048 }, { 5, 660, 2048 }, { 6, 661, 2048 }, { 6, 662, 2048 }, { 7, 663, 2048 }, - { 5, 664, 2048 }, { 6, 665, 2048 }, { 6, 666, 2048 }, { 7, 667, 2048 }, { 6, 668, 2048 }, { 7, 669, 2048 }, { 7, 670, 2048 }, { 8, 671, 2048 }, - { 4, 672, 2048 }, { 5, 673, 2048 }, { 5, 674, 2048 }, { 6, 675, 2048 }, { 5, 676, 2048 }, { 6, 677, 2048 }, { 6, 678, 2048 }, { 7, 679, 2048 }, - { 5, 680, 2048 }, { 6, 681, 2048 }, { 6, 682, 2048 }, { 7, 683, 2048 }, { 6, 684, 2048 }, { 7, 685, 2048 }, { 7, 686, 2048 }, { 8, 687, 2048 }, - { 5, 688, 2048 }, { 6, 689, 2048 }, { 6, 690, 2048 }, { 7, 691, 2048 }, { 6, 692, 2048 }, { 7, 693, 2048 }, { 7, 694, 2048 }, { 8, 695, 2048 }, - { 6, 696, 2048 }, { 7, 697, 2048 }, { 7, 698, 2048 }, { 8, 699, 2048 }, { 7, 700, 2048 }, { 8, 701, 2048 }, { 8, 702, 2048 }, { 9, 703, 2048 }, - { 4, 704, 2048 }, { 5, 705, 2048 }, { 5, 706, 2048 }, { 6, 707, 2048 }, { 5, 708, 2048 }, { 6, 709, 2048 }, { 6, 710, 2048 }, { 7, 711, 2048 }, - { 5, 712, 2048 }, { 6, 713, 2048 }, { 6, 714, 2048 }, { 7, 715, 2048 }, { 6, 716, 2048 }, { 7, 717, 2048 }, { 7, 718, 2048 }, { 8, 719, 2048 }, - { 5, 720, 2048 }, { 6, 721, 2048 }, { 6, 722, 2048 }, { 7, 723, 2048 }, { 6, 724, 2048 }, { 7, 725, 2048 }, { 7, 726, 2048 }, { 8, 727, 2048 }, - { 6, 728, 2048 }, { 7, 729, 2048 }, { 7, 730, 2048 }, { 8, 731, 2048 }, { 7, 732, 2048 }, { 8, 733, 2048 }, { 8, 734, 2048 }, { 9, 735, 2048 }, - { 5, 736, 2048 }, { 6, 737, 2048 }, { 6, 738, 2048 }, { 7, 739, 2048 }, { 6, 740, 2048 }, { 7, 741, 2048 }, { 7, 742, 2048 }, { 8, 743, 2048 }, - { 6, 744, 2048 }, { 7, 745, 2048 }, { 7, 746, 2048 }, { 8, 747, 2048 }, { 7, 748, 2048 }, { 8, 749, 2048 }, { 8, 750, 2048 }, { 9, 751, 2048 }, - { 6, 752, 2048 }, { 7, 753, 2048 }, { 7, 754, 2048 }, { 8, 755, 2048 }, { 7, 756, 2048 }, { 8, 757, 2048 }, { 8, 758, 2048 }, { 9, 759, 2048 }, - { 7, 760, 2048 }, { 8, 761, 2048 }, { 8, 762, 2048 }, { 9, 763, 2048 }, { 8, 764, 2048 }, { 9, 765, 2048 }, { 9, 766, 2048 }, { 10, 767, 2048 }, - { 3, 768, 2048 }, { 4, 769, 2048 }, { 4, 770, 2048 }, { 5, 771, 2048 }, { 4, 772, 2048 }, { 5, 773, 2048 }, { 5, 774, 2048 }, { 6, 775, 2048 }, - { 4, 776, 2048 }, { 5, 777, 2048 }, { 5, 778, 2048 }, { 6, 779, 2048 }, { 5, 780, 2048 }, { 6, 781, 2048 }, { 6, 782, 2048 }, { 7, 783, 2048 }, - { 4, 784, 2048 }, { 5, 785, 2048 }, { 5, 786, 2048 }, { 6, 787, 2048 }, { 5, 788, 2048 }, { 6, 789, 2048 }, { 6, 790, 2048 }, { 7, 791, 2048 }, - { 5, 792, 2048 }, { 6, 793, 2048 }, { 6, 794, 2048 }, { 7, 795, 2048 }, { 6, 796, 2048 }, { 7, 797, 2048 }, { 7, 798, 2048 }, { 8, 799, 2048 }, - { 4, 800, 2048 }, { 5, 801, 2048 }, { 5, 802, 2048 }, { 6, 803, 2048 }, { 5, 804, 2048 }, { 6, 805, 2048 }, { 6, 806, 2048 }, { 7, 807, 2048 }, - { 5, 808, 2048 }, { 6, 809, 2048 }, { 6, 810, 2048 }, { 7, 811, 2048 }, { 6, 812, 2048 }, { 7, 813, 2048 }, { 7, 814, 2048 }, { 8, 815, 2048 }, - { 5, 816, 2048 }, { 6, 817, 2048 }, { 6, 818, 2048 }, { 7, 819, 2048 }, { 6, 820, 2048 }, { 7, 821, 2048 }, { 7, 822, 2048 }, { 8, 823, 2048 }, - { 6, 824, 2048 }, { 7, 825, 2048 }, { 7, 826, 2048 }, { 8, 827, 2048 }, { 7, 828, 2048 }, { 8, 829, 2048 }, { 8, 830, 2048 }, { 9, 831, 2048 }, - { 4, 832, 2048 }, { 5, 833, 2048 }, { 5, 834, 2048 }, { 6, 835, 2048 }, { 5, 836, 2048 }, { 6, 837, 2048 }, { 6, 838, 2048 }, { 7, 839, 2048 }, - { 5, 840, 2048 }, { 6, 841, 2048 }, { 6, 842, 2048 }, { 7, 843, 2048 }, { 6, 844, 2048 }, { 7, 845, 2048 }, { 7, 846, 2048 }, { 8, 847, 2048 }, - { 5, 848, 2048 }, { 6, 849, 2048 }, { 6, 850, 2048 }, { 7, 851, 2048 }, { 6, 852, 2048 }, { 7, 853, 2048 }, { 7, 854, 2048 }, { 8, 855, 2048 }, - { 6, 856, 2048 }, { 7, 857, 2048 }, { 7, 858, 2048 }, { 8, 859, 2048 }, { 7, 860, 2048 }, { 8, 861, 2048 }, { 8, 862, 2048 }, { 9, 863, 2048 }, - { 5, 864, 2048 }, { 6, 865, 2048 }, { 6, 866, 2048 }, { 7, 867, 2048 }, { 6, 868, 2048 }, { 7, 869, 2048 }, { 7, 870, 2048 }, { 8, 871, 2048 }, - { 6, 872, 2048 }, { 7, 873, 2048 }, { 7, 874, 2048 }, { 8, 875, 2048 }, { 7, 876, 2048 }, { 8, 877, 2048 }, { 8, 878, 2048 }, { 9, 879, 2048 }, - { 6, 880, 2048 }, { 7, 881, 2048 }, { 7, 882, 2048 }, { 8, 883, 2048 }, { 7, 884, 2048 }, { 8, 885, 2048 }, { 8, 886, 2048 }, { 9, 887, 2048 }, - { 7, 888, 2048 }, { 8, 889, 2048 }, { 8, 890, 2048 }, { 9, 891, 2048 }, { 8, 892, 2048 }, { 9, 893, 2048 }, { 9, 894, 2048 }, { 10, 895, 2048 }, - { 4, 896, 2048 }, { 5, 897, 2048 }, { 5, 898, 2048 }, { 6, 899, 2048 }, { 5, 900, 2048 }, { 6, 901, 2048 }, { 6, 902, 2048 }, { 7, 903, 2048 }, - { 5, 904, 2048 }, { 6, 905, 2048 }, { 6, 906, 2048 }, { 7, 907, 2048 }, { 6, 908, 2048 }, { 7, 909, 2048 }, { 7, 910, 2048 }, { 8, 911, 2048 }, - { 5, 912, 2048 }, { 6, 913, 2048 }, { 6, 914, 2048 }, { 7, 915, 2048 }, { 6, 916, 2048 }, { 7, 917, 2048 }, { 7, 918, 2048 }, { 8, 919, 2048 }, - { 6, 920, 2048 }, { 7, 921, 2048 }, { 7, 922, 2048 }, { 8, 923, 2048 }, { 7, 924, 2048 }, { 8, 925, 2048 }, { 8, 926, 2048 }, { 9, 927, 2048 }, - { 5, 928, 2048 }, { 6, 929, 2048 }, { 6, 930, 2048 }, { 7, 931, 2048 }, { 6, 932, 2048 }, { 7, 933, 2048 }, { 7, 934, 2048 }, { 8, 935, 2048 }, - { 6, 936, 2048 }, { 7, 937, 2048 }, { 7, 938, 2048 }, { 8, 939, 2048 }, { 7, 940, 2048 }, { 8, 941, 2048 }, { 8, 942, 2048 }, { 9, 943, 2048 }, - { 6, 944, 2048 }, { 7, 945, 2048 }, { 7, 946, 2048 }, { 8, 947, 2048 }, { 7, 948, 2048 }, { 8, 949, 2048 }, { 8, 950, 2048 }, { 9, 951, 2048 }, - { 7, 952, 2048 }, { 8, 953, 2048 }, { 8, 954, 2048 }, { 9, 955, 2048 }, { 8, 956, 2048 }, { 9, 957, 2048 }, { 9, 958, 2048 }, { 10, 959, 2048 }, - { 5, 960, 2048 }, { 6, 961, 2048 }, { 6, 962, 2048 }, { 7, 963, 2048 }, { 6, 964, 2048 }, { 7, 965, 2048 }, { 7, 966, 2048 }, { 8, 967, 2048 }, - { 6, 968, 2048 }, { 7, 969, 2048 }, { 7, 970, 2048 }, { 8, 971, 2048 }, { 7, 972, 2048 }, { 8, 973, 2048 }, { 8, 974, 2048 }, { 9, 975, 2048 }, - { 6, 976, 2048 }, { 7, 977, 2048 }, { 7, 978, 2048 }, { 8, 979, 2048 }, { 7, 980, 2048 }, { 8, 981, 2048 }, { 8, 982, 2048 }, { 9, 983, 2048 }, - { 7, 984, 2048 }, { 8, 985, 2048 }, { 8, 986, 2048 }, { 9, 987, 2048 }, { 8, 988, 2048 }, { 9, 989, 2048 }, { 9, 990, 2048 }, { 10, 991, 2048 }, - { 6, 992, 2048 }, { 7, 993, 2048 }, { 7, 994, 2048 }, { 8, 995, 2048 }, { 7, 996, 2048 }, { 8, 997, 2048 }, { 8, 998, 2048 }, { 9, 999, 2048 }, - { 7, 1000, 2048 }, { 8, 1001, 2048 }, { 8, 1002, 2048 }, { 9, 1003, 2048 }, { 8, 1004, 2048 }, { 9, 1005, 2048 }, { 9, 1006, 2048 }, { 10, 1007, 2048 }, - { 7, 1008, 2048 }, { 8, 1009, 2048 }, { 8, 1010, 2048 }, { 9, 1011, 2048 }, { 8, 1012, 2048 }, { 9, 1013, 2048 }, { 9, 1014, 2048 }, { 10, 1015, 2048 }, - { 8, 1016, 2048 }, { 9, 1017, 2048 }, { 9, 1018, 2048 }, { 10, 1019, 2048 }, { 9, 1020, 2048 }, { 10, 1021, 2048 }, { 10, 1022, 2048 }, { 11, 1023, 2048 }, - { 2, 1024, 2048 }, { 3, 1025, 2048 }, { 3, 1026, 2048 }, { 4, 1027, 2048 }, { 3, 1028, 2048 }, { 4, 1029, 2048 }, { 4, 1030, 2048 }, { 5, 1031, 2048 }, - { 3, 1032, 2048 }, { 4, 1033, 2048 }, { 4, 1034, 2048 }, { 5, 1035, 2048 }, { 4, 1036, 2048 }, { 5, 1037, 2048 }, { 5, 1038, 2048 }, { 6, 1039, 2048 }, - { 3, 1040, 2048 }, { 4, 1041, 2048 }, { 4, 1042, 2048 }, { 5, 1043, 2048 }, { 4, 1044, 2048 }, { 5, 1045, 2048 }, { 5, 1046, 2048 }, { 6, 1047, 2048 }, - { 4, 1048, 2048 }, { 5, 1049, 2048 }, { 5, 1050, 2048 }, { 6, 1051, 2048 }, { 5, 1052, 2048 }, { 6, 1053, 2048 }, { 6, 1054, 2048 }, { 7, 1055, 2048 }, - { 3, 1056, 2048 }, { 4, 1057, 2048 }, { 4, 1058, 2048 }, { 5, 1059, 2048 }, { 4, 1060, 2048 }, { 5, 1061, 2048 }, { 5, 1062, 2048 }, { 6, 1063, 2048 }, - { 4, 1064, 2048 }, { 5, 1065, 2048 }, { 5, 1066, 2048 }, { 6, 1067, 2048 }, { 5, 1068, 2048 }, { 6, 1069, 2048 }, { 6, 1070, 2048 }, { 7, 1071, 2048 }, - { 4, 1072, 2048 }, { 5, 1073, 2048 }, { 5, 1074, 2048 }, { 6, 1075, 2048 }, { 5, 1076, 2048 }, { 6, 1077, 2048 }, { 6, 1078, 2048 }, { 7, 1079, 2048 }, - { 5, 1080, 2048 }, { 6, 1081, 2048 }, { 6, 1082, 2048 }, { 7, 1083, 2048 }, { 6, 1084, 2048 }, { 7, 1085, 2048 }, { 7, 1086, 2048 }, { 8, 1087, 2048 }, - { 3, 1088, 2048 }, { 4, 1089, 2048 }, { 4, 1090, 2048 }, { 5, 1091, 2048 }, { 4, 1092, 2048 }, { 5, 1093, 2048 }, { 5, 1094, 2048 }, { 6, 1095, 2048 }, - { 4, 1096, 2048 }, { 5, 1097, 2048 }, { 5, 1098, 2048 }, { 6, 1099, 2048 }, { 5, 1100, 2048 }, { 6, 1101, 2048 }, { 6, 1102, 2048 }, { 7, 1103, 2048 }, - { 4, 1104, 2048 }, { 5, 1105, 2048 }, { 5, 1106, 2048 }, { 6, 1107, 2048 }, { 5, 1108, 2048 }, { 6, 1109, 2048 }, { 6, 1110, 2048 }, { 7, 1111, 2048 }, - { 5, 1112, 2048 }, { 6, 1113, 2048 }, { 6, 1114, 2048 }, { 7, 1115, 2048 }, { 6, 1116, 2048 }, { 7, 1117, 2048 }, { 7, 1118, 2048 }, { 8, 1119, 2048 }, - { 4, 1120, 2048 }, { 5, 1121, 2048 }, { 5, 1122, 2048 }, { 6, 1123, 2048 }, { 5, 1124, 2048 }, { 6, 1125, 2048 }, { 6, 1126, 2048 }, { 7, 1127, 2048 }, - { 5, 1128, 2048 }, { 6, 1129, 2048 }, { 6, 1130, 2048 }, { 7, 1131, 2048 }, { 6, 1132, 2048 }, { 7, 1133, 2048 }, { 7, 1134, 2048 }, { 8, 1135, 2048 }, - { 5, 1136, 2048 }, { 6, 1137, 2048 }, { 6, 1138, 2048 }, { 7, 1139, 2048 }, { 6, 1140, 2048 }, { 7, 1141, 2048 }, { 7, 1142, 2048 }, { 8, 1143, 2048 }, - { 6, 1144, 2048 }, { 7, 1145, 2048 }, { 7, 1146, 2048 }, { 8, 1147, 2048 }, { 7, 1148, 2048 }, { 8, 1149, 2048 }, { 8, 1150, 2048 }, { 9, 1151, 2048 }, - { 3, 1152, 2048 }, { 4, 1153, 2048 }, { 4, 1154, 2048 }, { 5, 1155, 2048 }, { 4, 1156, 2048 }, { 5, 1157, 2048 }, { 5, 1158, 2048 }, { 6, 1159, 2048 }, - { 4, 1160, 2048 }, { 5, 1161, 2048 }, { 5, 1162, 2048 }, { 6, 1163, 2048 }, { 5, 1164, 2048 }, { 6, 1165, 2048 }, { 6, 1166, 2048 }, { 7, 1167, 2048 }, - { 4, 1168, 2048 }, { 5, 1169, 2048 }, { 5, 1170, 2048 }, { 6, 1171, 2048 }, { 5, 1172, 2048 }, { 6, 1173, 2048 }, { 6, 1174, 2048 }, { 7, 1175, 2048 }, - { 5, 1176, 2048 }, { 6, 1177, 2048 }, { 6, 1178, 2048 }, { 7, 1179, 2048 }, { 6, 1180, 2048 }, { 7, 1181, 2048 }, { 7, 1182, 2048 }, { 8, 1183, 2048 }, - { 4, 1184, 2048 }, { 5, 1185, 2048 }, { 5, 1186, 2048 }, { 6, 1187, 2048 }, { 5, 1188, 2048 }, { 6, 1189, 2048 }, { 6, 1190, 2048 }, { 7, 1191, 2048 }, - { 5, 1192, 2048 }, { 6, 1193, 2048 }, { 6, 1194, 2048 }, { 7, 1195, 2048 }, { 6, 1196, 2048 }, { 7, 1197, 2048 }, { 7, 1198, 2048 }, { 8, 1199, 2048 }, - { 5, 1200, 2048 }, { 6, 1201, 2048 }, { 6, 1202, 2048 }, { 7, 1203, 2048 }, { 6, 1204, 2048 }, { 7, 1205, 2048 }, { 7, 1206, 2048 }, { 8, 1207, 2048 }, - { 6, 1208, 2048 }, { 7, 1209, 2048 }, { 7, 1210, 2048 }, { 8, 1211, 2048 }, { 7, 1212, 2048 }, { 8, 1213, 2048 }, { 8, 1214, 2048 }, { 9, 1215, 2048 }, - { 4, 1216, 2048 }, { 5, 1217, 2048 }, { 5, 1218, 2048 }, { 6, 1219, 2048 }, { 5, 1220, 2048 }, { 6, 1221, 2048 }, { 6, 1222, 2048 }, { 7, 1223, 2048 }, - { 5, 1224, 2048 }, { 6, 1225, 2048 }, { 6, 1226, 2048 }, { 7, 1227, 2048 }, { 6, 1228, 2048 }, { 7, 1229, 2048 }, { 7, 1230, 2048 }, { 8, 1231, 2048 }, - { 5, 1232, 2048 }, { 6, 1233, 2048 }, { 6, 1234, 2048 }, { 7, 1235, 2048 }, { 6, 1236, 2048 }, { 7, 1237, 2048 }, { 7, 1238, 2048 }, { 8, 1239, 2048 }, - { 6, 1240, 2048 }, { 7, 1241, 2048 }, { 7, 1242, 2048 }, { 8, 1243, 2048 }, { 7, 1244, 2048 }, { 8, 1245, 2048 }, { 8, 1246, 2048 }, { 9, 1247, 2048 }, - { 5, 1248, 2048 }, { 6, 1249, 2048 }, { 6, 1250, 2048 }, { 7, 1251, 2048 }, { 6, 1252, 2048 }, { 7, 1253, 2048 }, { 7, 1254, 2048 }, { 8, 1255, 2048 }, - { 6, 1256, 2048 }, { 7, 1257, 2048 }, { 7, 1258, 2048 }, { 8, 1259, 2048 }, { 7, 1260, 2048 }, { 8, 1261, 2048 }, { 8, 1262, 2048 }, { 9, 1263, 2048 }, - { 6, 1264, 2048 }, { 7, 1265, 2048 }, { 7, 1266, 2048 }, { 8, 1267, 2048 }, { 7, 1268, 2048 }, { 8, 1269, 2048 }, { 8, 1270, 2048 }, { 9, 1271, 2048 }, - { 7, 1272, 2048 }, { 8, 1273, 2048 }, { 8, 1274, 2048 }, { 9, 1275, 2048 }, { 8, 1276, 2048 }, { 9, 1277, 2048 }, { 9, 1278, 2048 }, { 10, 1279, 2048 }, - { 3, 1280, 2048 }, { 4, 1281, 2048 }, { 4, 1282, 2048 }, { 5, 1283, 2048 }, { 4, 1284, 2048 }, { 5, 1285, 2048 }, { 5, 1286, 2048 }, { 6, 1287, 2048 }, - { 4, 1288, 2048 }, { 5, 1289, 2048 }, { 5, 1290, 2048 }, { 6, 1291, 2048 }, { 5, 1292, 2048 }, { 6, 1293, 2048 }, { 6, 1294, 2048 }, { 7, 1295, 2048 }, - { 4, 1296, 2048 }, { 5, 1297, 2048 }, { 5, 1298, 2048 }, { 6, 1299, 2048 }, { 5, 1300, 2048 }, { 6, 1301, 2048 }, { 6, 1302, 2048 }, { 7, 1303, 2048 }, - { 5, 1304, 2048 }, { 6, 1305, 2048 }, { 6, 1306, 2048 }, { 7, 1307, 2048 }, { 6, 1308, 2048 }, { 7, 1309, 2048 }, { 7, 1310, 2048 }, { 8, 1311, 2048 }, - { 4, 1312, 2048 }, { 5, 1313, 2048 }, { 5, 1314, 2048 }, { 6, 1315, 2048 }, { 5, 1316, 2048 }, { 6, 1317, 2048 }, { 6, 1318, 2048 }, { 7, 1319, 2048 }, - { 5, 1320, 2048 }, { 6, 1321, 2048 }, { 6, 1322, 2048 }, { 7, 1323, 2048 }, { 6, 1324, 2048 }, { 7, 1325, 2048 }, { 7, 1326, 2048 }, { 8, 1327, 2048 }, - { 5, 1328, 2048 }, { 6, 1329, 2048 }, { 6, 1330, 2048 }, { 7, 1331, 2048 }, { 6, 1332, 2048 }, { 7, 1333, 2048 }, { 7, 1334, 2048 }, { 8, 1335, 2048 }, - { 6, 1336, 2048 }, { 7, 1337, 2048 }, { 7, 1338, 2048 }, { 8, 1339, 2048 }, { 7, 1340, 2048 }, { 8, 1341, 2048 }, { 8, 1342, 2048 }, { 9, 1343, 2048 }, - { 4, 1344, 2048 }, { 5, 1345, 2048 }, { 5, 1346, 2048 }, { 6, 1347, 2048 }, { 5, 1348, 2048 }, { 6, 1349, 2048 }, { 6, 1350, 2048 }, { 7, 1351, 2048 }, - { 5, 1352, 2048 }, { 6, 1353, 2048 }, { 6, 1354, 2048 }, { 7, 1355, 2048 }, { 6, 1356, 2048 }, { 7, 1357, 2048 }, { 7, 1358, 2048 }, { 8, 1359, 2048 }, - { 5, 1360, 2048 }, { 6, 1361, 2048 }, { 6, 1362, 2048 }, { 7, 1363, 2048 }, { 6, 1364, 2048 }, { 7, 1365, 2048 }, { 7, 1366, 2048 }, { 8, 1367, 2048 }, - { 6, 1368, 2048 }, { 7, 1369, 2048 }, { 7, 1370, 2048 }, { 8, 1371, 2048 }, { 7, 1372, 2048 }, { 8, 1373, 2048 }, { 8, 1374, 2048 }, { 9, 1375, 2048 }, - { 5, 1376, 2048 }, { 6, 1377, 2048 }, { 6, 1378, 2048 }, { 7, 1379, 2048 }, { 6, 1380, 2048 }, { 7, 1381, 2048 }, { 7, 1382, 2048 }, { 8, 1383, 2048 }, - { 6, 1384, 2048 }, { 7, 1385, 2048 }, { 7, 1386, 2048 }, { 8, 1387, 2048 }, { 7, 1388, 2048 }, { 8, 1389, 2048 }, { 8, 1390, 2048 }, { 9, 1391, 2048 }, - { 6, 1392, 2048 }, { 7, 1393, 2048 }, { 7, 1394, 2048 }, { 8, 1395, 2048 }, { 7, 1396, 2048 }, { 8, 1397, 2048 }, { 8, 1398, 2048 }, { 9, 1399, 2048 }, - { 7, 1400, 2048 }, { 8, 1401, 2048 }, { 8, 1402, 2048 }, { 9, 1403, 2048 }, { 8, 1404, 2048 }, { 9, 1405, 2048 }, { 9, 1406, 2048 }, { 10, 1407, 2048 }, - { 4, 1408, 2048 }, { 5, 1409, 2048 }, { 5, 1410, 2048 }, { 6, 1411, 2048 }, { 5, 1412, 2048 }, { 6, 1413, 2048 }, { 6, 1414, 2048 }, { 7, 1415, 2048 }, - { 5, 1416, 2048 }, { 6, 1417, 2048 }, { 6, 1418, 2048 }, { 7, 1419, 2048 }, { 6, 1420, 2048 }, { 7, 1421, 2048 }, { 7, 1422, 2048 }, { 8, 1423, 2048 }, - { 5, 1424, 2048 }, { 6, 1425, 2048 }, { 6, 1426, 2048 }, { 7, 1427, 2048 }, { 6, 1428, 2048 }, { 7, 1429, 2048 }, { 7, 1430, 2048 }, { 8, 1431, 2048 }, - { 6, 1432, 2048 }, { 7, 1433, 2048 }, { 7, 1434, 2048 }, { 8, 1435, 2048 }, { 7, 1436, 2048 }, { 8, 1437, 2048 }, { 8, 1438, 2048 }, { 9, 1439, 2048 }, - { 5, 1440, 2048 }, { 6, 1441, 2048 }, { 6, 1442, 2048 }, { 7, 1443, 2048 }, { 6, 1444, 2048 }, { 7, 1445, 2048 }, { 7, 1446, 2048 }, { 8, 1447, 2048 }, - { 6, 1448, 2048 }, { 7, 1449, 2048 }, { 7, 1450, 2048 }, { 8, 1451, 2048 }, { 7, 1452, 2048 }, { 8, 1453, 2048 }, { 8, 1454, 2048 }, { 9, 1455, 2048 }, - { 6, 1456, 2048 }, { 7, 1457, 2048 }, { 7, 1458, 2048 }, { 8, 1459, 2048 }, { 7, 1460, 2048 }, { 8, 1461, 2048 }, { 8, 1462, 2048 }, { 9, 1463, 2048 }, - { 7, 1464, 2048 }, { 8, 1465, 2048 }, { 8, 1466, 2048 }, { 9, 1467, 2048 }, { 8, 1468, 2048 }, { 9, 1469, 2048 }, { 9, 1470, 2048 }, { 10, 1471, 2048 }, - { 5, 1472, 2048 }, { 6, 1473, 2048 }, { 6, 1474, 2048 }, { 7, 1475, 2048 }, { 6, 1476, 2048 }, { 7, 1477, 2048 }, { 7, 1478, 2048 }, { 8, 1479, 2048 }, - { 6, 1480, 2048 }, { 7, 1481, 2048 }, { 7, 1482, 2048 }, { 8, 1483, 2048 }, { 7, 1484, 2048 }, { 8, 1485, 2048 }, { 8, 1486, 2048 }, { 9, 1487, 2048 }, - { 6, 1488, 2048 }, { 7, 1489, 2048 }, { 7, 1490, 2048 }, { 8, 1491, 2048 }, { 7, 1492, 2048 }, { 8, 1493, 2048 }, { 8, 1494, 2048 }, { 9, 1495, 2048 }, - { 7, 1496, 2048 }, { 8, 1497, 2048 }, { 8, 1498, 2048 }, { 9, 1499, 2048 }, { 8, 1500, 2048 }, { 9, 1501, 2048 }, { 9, 1502, 2048 }, { 10, 1503, 2048 }, - { 6, 1504, 2048 }, { 7, 1505, 2048 }, { 7, 1506, 2048 }, { 8, 1507, 2048 }, { 7, 1508, 2048 }, { 8, 1509, 2048 }, { 8, 1510, 2048 }, { 9, 1511, 2048 }, - { 7, 1512, 2048 }, { 8, 1513, 2048 }, { 8, 1514, 2048 }, { 9, 1515, 2048 }, { 8, 1516, 2048 }, { 9, 1517, 2048 }, { 9, 1518, 2048 }, { 10, 1519, 2048 }, - { 7, 1520, 2048 }, { 8, 1521, 2048 }, { 8, 1522, 2048 }, { 9, 1523, 2048 }, { 8, 1524, 2048 }, { 9, 1525, 2048 }, { 9, 1526, 2048 }, { 10, 1527, 2048 }, - { 8, 1528, 2048 }, { 9, 1529, 2048 }, { 9, 1530, 2048 }, { 10, 1531, 2048 }, { 9, 1532, 2048 }, { 10, 1533, 2048 }, { 10, 1534, 2048 }, { 11, 1535, 2048 }, - { 3, 1536, 2048 }, { 4, 1537, 2048 }, { 4, 1538, 2048 }, { 5, 1539, 2048 }, { 4, 1540, 2048 }, { 5, 1541, 2048 }, { 5, 1542, 2048 }, { 6, 1543, 2048 }, - { 4, 1544, 2048 }, { 5, 1545, 2048 }, { 5, 1546, 2048 }, { 6, 1547, 2048 }, { 5, 1548, 2048 }, { 6, 1549, 2048 }, { 6, 1550, 2048 }, { 7, 1551, 2048 }, - { 4, 1552, 2048 }, { 5, 1553, 2048 }, { 5, 1554, 2048 }, { 6, 1555, 2048 }, { 5, 1556, 2048 }, { 6, 1557, 2048 }, { 6, 1558, 2048 }, { 7, 1559, 2048 }, - { 5, 1560, 2048 }, { 6, 1561, 2048 }, { 6, 1562, 2048 }, { 7, 1563, 2048 }, { 6, 1564, 2048 }, { 7, 1565, 2048 }, { 7, 1566, 2048 }, { 8, 1567, 2048 }, - { 4, 1568, 2048 }, { 5, 1569, 2048 }, { 5, 1570, 2048 }, { 6, 1571, 2048 }, { 5, 1572, 2048 }, { 6, 1573, 2048 }, { 6, 1574, 2048 }, { 7, 1575, 2048 }, - { 5, 1576, 2048 }, { 6, 1577, 2048 }, { 6, 1578, 2048 }, { 7, 1579, 2048 }, { 6, 1580, 2048 }, { 7, 1581, 2048 }, { 7, 1582, 2048 }, { 8, 1583, 2048 }, - { 5, 1584, 2048 }, { 6, 1585, 2048 }, { 6, 1586, 2048 }, { 7, 1587, 2048 }, { 6, 1588, 2048 }, { 7, 1589, 2048 }, { 7, 1590, 2048 }, { 8, 1591, 2048 }, - { 6, 1592, 2048 }, { 7, 1593, 2048 }, { 7, 1594, 2048 }, { 8, 1595, 2048 }, { 7, 1596, 2048 }, { 8, 1597, 2048 }, { 8, 1598, 2048 }, { 9, 1599, 2048 }, - { 4, 1600, 2048 }, { 5, 1601, 2048 }, { 5, 1602, 2048 }, { 6, 1603, 2048 }, { 5, 1604, 2048 }, { 6, 1605, 2048 }, { 6, 1606, 2048 }, { 7, 1607, 2048 }, - { 5, 1608, 2048 }, { 6, 1609, 2048 }, { 6, 1610, 2048 }, { 7, 1611, 2048 }, { 6, 1612, 2048 }, { 7, 1613, 2048 }, { 7, 1614, 2048 }, { 8, 1615, 2048 }, - { 5, 1616, 2048 }, { 6, 1617, 2048 }, { 6, 1618, 2048 }, { 7, 1619, 2048 }, { 6, 1620, 2048 }, { 7, 1621, 2048 }, { 7, 1622, 2048 }, { 8, 1623, 2048 }, - { 6, 1624, 2048 }, { 7, 1625, 2048 }, { 7, 1626, 2048 }, { 8, 1627, 2048 }, { 7, 1628, 2048 }, { 8, 1629, 2048 }, { 8, 1630, 2048 }, { 9, 1631, 2048 }, - { 5, 1632, 2048 }, { 6, 1633, 2048 }, { 6, 1634, 2048 }, { 7, 1635, 2048 }, { 6, 1636, 2048 }, { 7, 1637, 2048 }, { 7, 1638, 2048 }, { 8, 1639, 2048 }, - { 6, 1640, 2048 }, { 7, 1641, 2048 }, { 7, 1642, 2048 }, { 8, 1643, 2048 }, { 7, 1644, 2048 }, { 8, 1645, 2048 }, { 8, 1646, 2048 }, { 9, 1647, 2048 }, - { 6, 1648, 2048 }, { 7, 1649, 2048 }, { 7, 1650, 2048 }, { 8, 1651, 2048 }, { 7, 1652, 2048 }, { 8, 1653, 2048 }, { 8, 1654, 2048 }, { 9, 1655, 2048 }, - { 7, 1656, 2048 }, { 8, 1657, 2048 }, { 8, 1658, 2048 }, { 9, 1659, 2048 }, { 8, 1660, 2048 }, { 9, 1661, 2048 }, { 9, 1662, 2048 }, { 10, 1663, 2048 }, - { 4, 1664, 2048 }, { 5, 1665, 2048 }, { 5, 1666, 2048 }, { 6, 1667, 2048 }, { 5, 1668, 2048 }, { 6, 1669, 2048 }, { 6, 1670, 2048 }, { 7, 1671, 2048 }, - { 5, 1672, 2048 }, { 6, 1673, 2048 }, { 6, 1674, 2048 }, { 7, 1675, 2048 }, { 6, 1676, 2048 }, { 7, 1677, 2048 }, { 7, 1678, 2048 }, { 8, 1679, 2048 }, - { 5, 1680, 2048 }, { 6, 1681, 2048 }, { 6, 1682, 2048 }, { 7, 1683, 2048 }, { 6, 1684, 2048 }, { 7, 1685, 2048 }, { 7, 1686, 2048 }, { 8, 1687, 2048 }, - { 6, 1688, 2048 }, { 7, 1689, 2048 }, { 7, 1690, 2048 }, { 8, 1691, 2048 }, { 7, 1692, 2048 }, { 8, 1693, 2048 }, { 8, 1694, 2048 }, { 9, 1695, 2048 }, - { 5, 1696, 2048 }, { 6, 1697, 2048 }, { 6, 1698, 2048 }, { 7, 1699, 2048 }, { 6, 1700, 2048 }, { 7, 1701, 2048 }, { 7, 1702, 2048 }, { 8, 1703, 2048 }, - { 6, 1704, 2048 }, { 7, 1705, 2048 }, { 7, 1706, 2048 }, { 8, 1707, 2048 }, { 7, 1708, 2048 }, { 8, 1709, 2048 }, { 8, 1710, 2048 }, { 9, 1711, 2048 }, - { 6, 1712, 2048 }, { 7, 1713, 2048 }, { 7, 1714, 2048 }, { 8, 1715, 2048 }, { 7, 1716, 2048 }, { 8, 1717, 2048 }, { 8, 1718, 2048 }, { 9, 1719, 2048 }, - { 7, 1720, 2048 }, { 8, 1721, 2048 }, { 8, 1722, 2048 }, { 9, 1723, 2048 }, { 8, 1724, 2048 }, { 9, 1725, 2048 }, { 9, 1726, 2048 }, { 10, 1727, 2048 }, - { 5, 1728, 2048 }, { 6, 1729, 2048 }, { 6, 1730, 2048 }, { 7, 1731, 2048 }, { 6, 1732, 2048 }, { 7, 1733, 2048 }, { 7, 1734, 2048 }, { 8, 1735, 2048 }, - { 6, 1736, 2048 }, { 7, 1737, 2048 }, { 7, 1738, 2048 }, { 8, 1739, 2048 }, { 7, 1740, 2048 }, { 8, 1741, 2048 }, { 8, 1742, 2048 }, { 9, 1743, 2048 }, - { 6, 1744, 2048 }, { 7, 1745, 2048 }, { 7, 1746, 2048 }, { 8, 1747, 2048 }, { 7, 1748, 2048 }, { 8, 1749, 2048 }, { 8, 1750, 2048 }, { 9, 1751, 2048 }, - { 7, 1752, 2048 }, { 8, 1753, 2048 }, { 8, 1754, 2048 }, { 9, 1755, 2048 }, { 8, 1756, 2048 }, { 9, 1757, 2048 }, { 9, 1758, 2048 }, { 10, 1759, 2048 }, - { 6, 1760, 2048 }, { 7, 1761, 2048 }, { 7, 1762, 2048 }, { 8, 1763, 2048 }, { 7, 1764, 2048 }, { 8, 1765, 2048 }, { 8, 1766, 2048 }, { 9, 1767, 2048 }, - { 7, 1768, 2048 }, { 8, 1769, 2048 }, { 8, 1770, 2048 }, { 9, 1771, 2048 }, { 8, 1772, 2048 }, { 9, 1773, 2048 }, { 9, 1774, 2048 }, { 10, 1775, 2048 }, - { 7, 1776, 2048 }, { 8, 1777, 2048 }, { 8, 1778, 2048 }, { 9, 1779, 2048 }, { 8, 1780, 2048 }, { 9, 1781, 2048 }, { 9, 1782, 2048 }, { 10, 1783, 2048 }, - { 8, 1784, 2048 }, { 9, 1785, 2048 }, { 9, 1786, 2048 }, { 10, 1787, 2048 }, { 9, 1788, 2048 }, { 10, 1789, 2048 }, { 10, 1790, 2048 }, { 11, 1791, 2048 }, - { 4, 1792, 2048 }, { 5, 1793, 2048 }, { 5, 1794, 2048 }, { 6, 1795, 2048 }, { 5, 1796, 2048 }, { 6, 1797, 2048 }, { 6, 1798, 2048 }, { 7, 1799, 2048 }, - { 5, 1800, 2048 }, { 6, 1801, 2048 }, { 6, 1802, 2048 }, { 7, 1803, 2048 }, { 6, 1804, 2048 }, { 7, 1805, 2048 }, { 7, 1806, 2048 }, { 8, 1807, 2048 }, - { 5, 1808, 2048 }, { 6, 1809, 2048 }, { 6, 1810, 2048 }, { 7, 1811, 2048 }, { 6, 1812, 2048 }, { 7, 1813, 2048 }, { 7, 1814, 2048 }, { 8, 1815, 2048 }, - { 6, 1816, 2048 }, { 7, 1817, 2048 }, { 7, 1818, 2048 }, { 8, 1819, 2048 }, { 7, 1820, 2048 }, { 8, 1821, 2048 }, { 8, 1822, 2048 }, { 9, 1823, 2048 }, - { 5, 1824, 2048 }, { 6, 1825, 2048 }, { 6, 1826, 2048 }, { 7, 1827, 2048 }, { 6, 1828, 2048 }, { 7, 1829, 2048 }, { 7, 1830, 2048 }, { 8, 1831, 2048 }, - { 6, 1832, 2048 }, { 7, 1833, 2048 }, { 7, 1834, 2048 }, { 8, 1835, 2048 }, { 7, 1836, 2048 }, { 8, 1837, 2048 }, { 8, 1838, 2048 }, { 9, 1839, 2048 }, - { 6, 1840, 2048 }, { 7, 1841, 2048 }, { 7, 1842, 2048 }, { 8, 1843, 2048 }, { 7, 1844, 2048 }, { 8, 1845, 2048 }, { 8, 1846, 2048 }, { 9, 1847, 2048 }, - { 7, 1848, 2048 }, { 8, 1849, 2048 }, { 8, 1850, 2048 }, { 9, 1851, 2048 }, { 8, 1852, 2048 }, { 9, 1853, 2048 }, { 9, 1854, 2048 }, { 10, 1855, 2048 }, - { 5, 1856, 2048 }, { 6, 1857, 2048 }, { 6, 1858, 2048 }, { 7, 1859, 2048 }, { 6, 1860, 2048 }, { 7, 1861, 2048 }, { 7, 1862, 2048 }, { 8, 1863, 2048 }, - { 6, 1864, 2048 }, { 7, 1865, 2048 }, { 7, 1866, 2048 }, { 8, 1867, 2048 }, { 7, 1868, 2048 }, { 8, 1869, 2048 }, { 8, 1870, 2048 }, { 9, 1871, 2048 }, - { 6, 1872, 2048 }, { 7, 1873, 2048 }, { 7, 1874, 2048 }, { 8, 1875, 2048 }, { 7, 1876, 2048 }, { 8, 1877, 2048 }, { 8, 1878, 2048 }, { 9, 1879, 2048 }, - { 7, 1880, 2048 }, { 8, 1881, 2048 }, { 8, 1882, 2048 }, { 9, 1883, 2048 }, { 8, 1884, 2048 }, { 9, 1885, 2048 }, { 9, 1886, 2048 }, { 10, 1887, 2048 }, - { 6, 1888, 2048 }, { 7, 1889, 2048 }, { 7, 1890, 2048 }, { 8, 1891, 2048 }, { 7, 1892, 2048 }, { 8, 1893, 2048 }, { 8, 1894, 2048 }, { 9, 1895, 2048 }, - { 7, 1896, 2048 }, { 8, 1897, 2048 }, { 8, 1898, 2048 }, { 9, 1899, 2048 }, { 8, 1900, 2048 }, { 9, 1901, 2048 }, { 9, 1902, 2048 }, { 10, 1903, 2048 }, - { 7, 1904, 2048 }, { 8, 1905, 2048 }, { 8, 1906, 2048 }, { 9, 1907, 2048 }, { 8, 1908, 2048 }, { 9, 1909, 2048 }, { 9, 1910, 2048 }, { 10, 1911, 2048 }, - { 8, 1912, 2048 }, { 9, 1913, 2048 }, { 9, 1914, 2048 }, { 10, 1915, 2048 }, { 9, 1916, 2048 }, { 10, 1917, 2048 }, { 10, 1918, 2048 }, { 11, 1919, 2048 }, - { 5, 1920, 2048 }, { 6, 1921, 2048 }, { 6, 1922, 2048 }, { 7, 1923, 2048 }, { 6, 1924, 2048 }, { 7, 1925, 2048 }, { 7, 1926, 2048 }, { 8, 1927, 2048 }, - { 6, 1928, 2048 }, { 7, 1929, 2048 }, { 7, 1930, 2048 }, { 8, 1931, 2048 }, { 7, 1932, 2048 }, { 8, 1933, 2048 }, { 8, 1934, 2048 }, { 9, 1935, 2048 }, - { 6, 1936, 2048 }, { 7, 1937, 2048 }, { 7, 1938, 2048 }, { 8, 1939, 2048 }, { 7, 1940, 2048 }, { 8, 1941, 2048 }, { 8, 1942, 2048 }, { 9, 1943, 2048 }, - { 7, 1944, 2048 }, { 8, 1945, 2048 }, { 8, 1946, 2048 }, { 9, 1947, 2048 }, { 8, 1948, 2048 }, { 9, 1949, 2048 }, { 9, 1950, 2048 }, { 10, 1951, 2048 }, - { 6, 1952, 2048 }, { 7, 1953, 2048 }, { 7, 1954, 2048 }, { 8, 1955, 2048 }, { 7, 1956, 2048 }, { 8, 1957, 2048 }, { 8, 1958, 2048 }, { 9, 1959, 2048 }, - { 7, 1960, 2048 }, { 8, 1961, 2048 }, { 8, 1962, 2048 }, { 9, 1963, 2048 }, { 8, 1964, 2048 }, { 9, 1965, 2048 }, { 9, 1966, 2048 }, { 10, 1967, 2048 }, - { 7, 1968, 2048 }, { 8, 1969, 2048 }, { 8, 1970, 2048 }, { 9, 1971, 2048 }, { 8, 1972, 2048 }, { 9, 1973, 2048 }, { 9, 1974, 2048 }, { 10, 1975, 2048 }, - { 8, 1976, 2048 }, { 9, 1977, 2048 }, { 9, 1978, 2048 }, { 10, 1979, 2048 }, { 9, 1980, 2048 }, { 10, 1981, 2048 }, { 10, 1982, 2048 }, { 11, 1983, 2048 }, - { 6, 1984, 2048 }, { 7, 1985, 2048 }, { 7, 1986, 2048 }, { 8, 1987, 2048 }, { 7, 1988, 2048 }, { 8, 1989, 2048 }, { 8, 1990, 2048 }, { 9, 1991, 2048 }, - { 7, 1992, 2048 }, { 8, 1993, 2048 }, { 8, 1994, 2048 }, { 9, 1995, 2048 }, { 8, 1996, 2048 }, { 9, 1997, 2048 }, { 9, 1998, 2048 }, { 10, 1999, 2048 }, - { 7, 2000, 2048 }, { 8, 2001, 2048 }, { 8, 2002, 2048 }, { 9, 2003, 2048 }, { 8, 2004, 2048 }, { 9, 2005, 2048 }, { 9, 2006, 2048 }, { 10, 2007, 2048 }, - { 8, 2008, 2048 }, { 9, 2009, 2048 }, { 9, 2010, 2048 }, { 10, 2011, 2048 }, { 9, 2012, 2048 }, { 10, 2013, 2048 }, { 10, 2014, 2048 }, { 11, 2015, 2048 }, - { 7, 2016, 2048 }, { 8, 2017, 2048 }, { 8, 2018, 2048 }, { 9, 2019, 2048 }, { 8, 2020, 2048 }, { 9, 2021, 2048 }, { 9, 2022, 2048 }, { 10, 2023, 2048 }, - { 8, 2024, 2048 }, { 9, 2025, 2048 }, { 9, 2026, 2048 }, { 10, 2027, 2048 }, { 9, 2028, 2048 }, { 10, 2029, 2048 }, { 10, 2030, 2048 }, { 11, 2031, 2048 }, - { 8, 2032, 2048 }, { 9, 2033, 2048 }, { 9, 2034, 2048 }, { 10, 2035, 2048 }, { 9, 2036, 2048 }, { 10, 2037, 2048 }, { 10, 2038, 2048 }, { 11, 2039, 2048 }, - { 9, 2040, 2048 }, { 10, 2041, 2048 }, { 10, 2042, 2048 }, { 11, 2043, 2048 }, { 10, 2044, 2048 }, { 11, 2045, 2048 }, { 11, 2046, 2048 }, { 12, 2047, 2048 }, + { 1, 0, 0 }, { 2, 1, 2048 }, { 2, 2, 2048 }, { 3, 3, 2048 }, { 2, 4, 2048 }, { 3, 5, 2048 }, { 3, 6, 2048 }, { 4, 7, 2048 }, + { 2, 8, 2048 }, { 3, 9, 2048 }, { 3, 10, 2048 }, { 4, 11, 2048 }, { 3, 12, 2048 }, { 4, 13, 2048 }, { 4, 14, 2048 }, { 5, 15, 2048 }, + { 2, 16, 2048 }, { 3, 17, 2048 }, { 3, 18, 2048 }, { 4, 19, 2048 }, { 3, 20, 2048 }, { 4, 21, 2048 }, { 4, 22, 2048 }, { 5, 23, 2048 }, + { 3, 24, 2048 }, { 4, 25, 2048 }, { 4, 26, 2048 }, { 5, 27, 2048 }, { 4, 28, 2048 }, { 5, 29, 2048 }, { 5, 30, 2048 }, { 6, 31, 2048 }, + { 2, 32, 2048 }, { 3, 33, 2048 }, { 3, 34, 2048 }, { 4, 35, 2048 }, { 3, 36, 2048 }, { 4, 37, 2048 }, { 4, 38, 2048 }, { 5, 39, 2048 }, + { 3, 40, 2048 }, { 4, 41, 2048 }, { 4, 42, 2048 }, { 5, 43, 2048 }, { 4, 44, 2048 }, { 5, 45, 2048 }, { 5, 46, 2048 }, { 6, 47, 2048 }, + { 3, 48, 2048 }, { 4, 49, 2048 }, { 4, 50, 2048 }, { 5, 51, 2048 }, { 4, 52, 2048 }, { 5, 53, 2048 }, { 5, 54, 2048 }, { 6, 55, 2048 }, + { 4, 56, 2048 }, { 5, 57, 2048 }, { 5, 58, 2048 }, { 6, 59, 2048 }, { 5, 60, 2048 }, { 6, 61, 2048 }, { 6, 62, 2048 }, { 7, 63, 2048 }, + { 2, 64, 2048 }, { 3, 65, 2048 }, { 3, 66, 2048 }, { 4, 67, 2048 }, { 3, 68, 2048 }, { 4, 69, 2048 }, { 4, 70, 2048 }, { 5, 71, 2048 }, + { 3, 72, 2048 }, { 4, 73, 2048 }, { 4, 74, 2048 }, { 5, 75, 2048 }, { 4, 76, 2048 }, { 5, 77, 2048 }, { 5, 78, 2048 }, { 6, 79, 2048 }, + { 3, 80, 2048 }, { 4, 81, 2048 }, { 4, 82, 2048 }, { 5, 83, 2048 }, { 4, 84, 2048 }, { 5, 85, 2048 }, { 5, 86, 2048 }, { 6, 87, 2048 }, + { 4, 88, 2048 }, { 5, 89, 2048 }, { 5, 90, 2048 }, { 6, 91, 2048 }, { 5, 92, 2048 }, { 6, 93, 2048 }, { 6, 94, 2048 }, { 7, 95, 2048 }, + { 3, 96, 2048 }, { 4, 97, 2048 }, { 4, 98, 2048 }, { 5, 99, 2048 }, { 4, 100, 2048 }, { 5, 101, 2048 }, { 5, 102, 2048 }, { 6, 103, 2048 }, + { 4, 104, 2048 }, { 5, 105, 2048 }, { 5, 106, 2048 }, { 6, 107, 2048 }, { 5, 108, 2048 }, { 6, 109, 2048 }, { 6, 110, 2048 }, { 7, 111, 2048 }, + { 4, 112, 2048 }, { 5, 113, 2048 }, { 5, 114, 2048 }, { 6, 115, 2048 }, { 5, 116, 2048 }, { 6, 117, 2048 }, { 6, 118, 2048 }, { 7, 119, 2048 }, + { 5, 120, 2048 }, { 6, 121, 2048 }, { 6, 122, 2048 }, { 7, 123, 2048 }, { 6, 124, 2048 }, { 7, 125, 2048 }, { 7, 126, 2048 }, { 8, 127, 2048 }, + { 2, 128, 2048 }, { 3, 129, 2048 }, { 3, 130, 2048 }, { 4, 131, 2048 }, { 3, 132, 2048 }, { 4, 133, 2048 }, { 4, 134, 2048 }, { 5, 135, 2048 }, + { 3, 136, 2048 }, { 4, 137, 2048 }, { 4, 138, 2048 }, { 5, 139, 2048 }, { 4, 140, 2048 }, { 5, 141, 2048 }, { 5, 142, 2048 }, { 6, 143, 2048 }, + { 3, 144, 2048 }, { 4, 145, 2048 }, { 4, 146, 2048 }, { 5, 147, 2048 }, { 4, 148, 2048 }, { 5, 149, 2048 }, { 5, 150, 2048 }, { 6, 151, 2048 }, + { 4, 152, 2048 }, { 5, 153, 2048 }, { 5, 154, 2048 }, { 6, 155, 2048 }, { 5, 156, 2048 }, { 6, 157, 2048 }, { 6, 158, 2048 }, { 7, 159, 2048 }, + { 3, 160, 2048 }, { 4, 161, 2048 }, { 4, 162, 2048 }, { 5, 163, 2048 }, { 4, 164, 2048 }, { 5, 165, 2048 }, { 5, 166, 2048 }, { 6, 167, 2048 }, + { 4, 168, 2048 }, { 5, 169, 2048 }, { 5, 170, 2048 }, { 6, 171, 2048 }, { 5, 172, 2048 }, { 6, 173, 2048 }, { 6, 174, 2048 }, { 7, 175, 2048 }, + { 4, 176, 2048 }, { 5, 177, 2048 }, { 5, 178, 2048 }, { 6, 179, 2048 }, { 5, 180, 2048 }, { 6, 181, 2048 }, { 6, 182, 2048 }, { 7, 183, 2048 }, + { 5, 184, 2048 }, { 6, 185, 2048 }, { 6, 186, 2048 }, { 7, 187, 2048 }, { 6, 188, 2048 }, { 7, 189, 2048 }, { 7, 190, 2048 }, { 8, 191, 2048 }, + { 3, 192, 2048 }, { 4, 193, 2048 }, { 4, 194, 2048 }, { 5, 195, 2048 }, { 4, 196, 2048 }, { 5, 197, 2048 }, { 5, 198, 2048 }, { 6, 199, 2048 }, + { 4, 200, 2048 }, { 5, 201, 2048 }, { 5, 202, 2048 }, { 6, 203, 2048 }, { 5, 204, 2048 }, { 6, 205, 2048 }, { 6, 206, 2048 }, { 7, 207, 2048 }, + { 4, 208, 2048 }, { 5, 209, 2048 }, { 5, 210, 2048 }, { 6, 211, 2048 }, { 5, 212, 2048 }, { 6, 213, 2048 }, { 6, 214, 2048 }, { 7, 215, 2048 }, + { 5, 216, 2048 }, { 6, 217, 2048 }, { 6, 218, 2048 }, { 7, 219, 2048 }, { 6, 220, 2048 }, { 7, 221, 2048 }, { 7, 222, 2048 }, { 8, 223, 2048 }, + { 4, 224, 2048 }, { 5, 225, 2048 }, { 5, 226, 2048 }, { 6, 227, 2048 }, { 5, 228, 2048 }, { 6, 229, 2048 }, { 6, 230, 2048 }, { 7, 231, 2048 }, + { 5, 232, 2048 }, { 6, 233, 2048 }, { 6, 234, 2048 }, { 7, 235, 2048 }, { 6, 236, 2048 }, { 7, 237, 2048 }, { 7, 238, 2048 }, { 8, 239, 2048 }, + { 5, 240, 2048 }, { 6, 241, 2048 }, { 6, 242, 2048 }, { 7, 243, 2048 }, { 6, 244, 2048 }, { 7, 245, 2048 }, { 7, 246, 2048 }, { 8, 247, 2048 }, + { 6, 248, 2048 }, { 7, 249, 2048 }, { 7, 250, 2048 }, { 8, 251, 2048 }, { 7, 252, 2048 }, { 8, 253, 2048 }, { 8, 254, 2048 }, { 9, 255, 2048 }, + { 2, 256, 2048 }, { 3, 257, 2048 }, { 3, 258, 2048 }, { 4, 259, 2048 }, { 3, 260, 2048 }, { 4, 261, 2048 }, { 4, 262, 2048 }, { 5, 263, 2048 }, + { 3, 264, 2048 }, { 4, 265, 2048 }, { 4, 266, 2048 }, { 5, 267, 2048 }, { 4, 268, 2048 }, { 5, 269, 2048 }, { 5, 270, 2048 }, { 6, 271, 2048 }, + { 3, 272, 2048 }, { 4, 273, 2048 }, { 4, 274, 2048 }, { 5, 275, 2048 }, { 4, 276, 2048 }, { 5, 277, 2048 }, { 5, 278, 2048 }, { 6, 279, 2048 }, + { 4, 280, 2048 }, { 5, 281, 2048 }, { 5, 282, 2048 }, { 6, 283, 2048 }, { 5, 284, 2048 }, { 6, 285, 2048 }, { 6, 286, 2048 }, { 7, 287, 2048 }, + { 3, 288, 2048 }, { 4, 289, 2048 }, { 4, 290, 2048 }, { 5, 291, 2048 }, { 4, 292, 2048 }, { 5, 293, 2048 }, { 5, 294, 2048 }, { 6, 295, 2048 }, + { 4, 296, 2048 }, { 5, 297, 2048 }, { 5, 298, 2048 }, { 6, 299, 2048 }, { 5, 300, 2048 }, { 6, 301, 2048 }, { 6, 302, 2048 }, { 7, 303, 2048 }, + { 4, 304, 2048 }, { 5, 305, 2048 }, { 5, 306, 2048 }, { 6, 307, 2048 }, { 5, 308, 2048 }, { 6, 309, 2048 }, { 6, 310, 2048 }, { 7, 311, 2048 }, + { 5, 312, 2048 }, { 6, 313, 2048 }, { 6, 314, 2048 }, { 7, 315, 2048 }, { 6, 316, 2048 }, { 7, 317, 2048 }, { 7, 318, 2048 }, { 8, 319, 2048 }, + { 3, 320, 2048 }, { 4, 321, 2048 }, { 4, 322, 2048 }, { 5, 323, 2048 }, { 4, 324, 2048 }, { 5, 325, 2048 }, { 5, 326, 2048 }, { 6, 327, 2048 }, + { 4, 328, 2048 }, { 5, 329, 2048 }, { 5, 330, 2048 }, { 6, 331, 2048 }, { 5, 332, 2048 }, { 6, 333, 2048 }, { 6, 334, 2048 }, { 7, 335, 2048 }, + { 4, 336, 2048 }, { 5, 337, 2048 }, { 5, 338, 2048 }, { 6, 339, 2048 }, { 5, 340, 2048 }, { 6, 341, 2048 }, { 6, 342, 2048 }, { 7, 343, 2048 }, + { 5, 344, 2048 }, { 6, 345, 2048 }, { 6, 346, 2048 }, { 7, 347, 2048 }, { 6, 348, 2048 }, { 7, 349, 2048 }, { 7, 350, 2048 }, { 8, 351, 2048 }, + { 4, 352, 2048 }, { 5, 353, 2048 }, { 5, 354, 2048 }, { 6, 355, 2048 }, { 5, 356, 2048 }, { 6, 357, 2048 }, { 6, 358, 2048 }, { 7, 359, 2048 }, + { 5, 360, 2048 }, { 6, 361, 2048 }, { 6, 362, 2048 }, { 7, 363, 2048 }, { 6, 364, 2048 }, { 7, 365, 2048 }, { 7, 366, 2048 }, { 8, 367, 2048 }, + { 5, 368, 2048 }, { 6, 369, 2048 }, { 6, 370, 2048 }, { 7, 371, 2048 }, { 6, 372, 2048 }, { 7, 373, 2048 }, { 7, 374, 2048 }, { 8, 375, 2048 }, + { 6, 376, 2048 }, { 7, 377, 2048 }, { 7, 378, 2048 }, { 8, 379, 2048 }, { 7, 380, 2048 }, { 8, 381, 2048 }, { 8, 382, 2048 }, { 9, 383, 2048 }, + { 3, 384, 2048 }, { 4, 385, 2048 }, { 4, 386, 2048 }, { 5, 387, 2048 }, { 4, 388, 2048 }, { 5, 389, 2048 }, { 5, 390, 2048 }, { 6, 391, 2048 }, + { 4, 392, 2048 }, { 5, 393, 2048 }, { 5, 394, 2048 }, { 6, 395, 2048 }, { 5, 396, 2048 }, { 6, 397, 2048 }, { 6, 398, 2048 }, { 7, 399, 2048 }, + { 4, 400, 2048 }, { 5, 401, 2048 }, { 5, 402, 2048 }, { 6, 403, 2048 }, { 5, 404, 2048 }, { 6, 405, 2048 }, { 6, 406, 2048 }, { 7, 407, 2048 }, + { 5, 408, 2048 }, { 6, 409, 2048 }, { 6, 410, 2048 }, { 7, 411, 2048 }, { 6, 412, 2048 }, { 7, 413, 2048 }, { 7, 414, 2048 }, { 8, 415, 2048 }, + { 4, 416, 2048 }, { 5, 417, 2048 }, { 5, 418, 2048 }, { 6, 419, 2048 }, { 5, 420, 2048 }, { 6, 421, 2048 }, { 6, 422, 2048 }, { 7, 423, 2048 }, + { 5, 424, 2048 }, { 6, 425, 2048 }, { 6, 426, 2048 }, { 7, 427, 2048 }, { 6, 428, 2048 }, { 7, 429, 2048 }, { 7, 430, 2048 }, { 8, 431, 2048 }, + { 5, 432, 2048 }, { 6, 433, 2048 }, { 6, 434, 2048 }, { 7, 435, 2048 }, { 6, 436, 2048 }, { 7, 437, 2048 }, { 7, 438, 2048 }, { 8, 439, 2048 }, + { 6, 440, 2048 }, { 7, 441, 2048 }, { 7, 442, 2048 }, { 8, 443, 2048 }, { 7, 444, 2048 }, { 8, 445, 2048 }, { 8, 446, 2048 }, { 9, 447, 2048 }, + { 4, 448, 2048 }, { 5, 449, 2048 }, { 5, 450, 2048 }, { 6, 451, 2048 }, { 5, 452, 2048 }, { 6, 453, 2048 }, { 6, 454, 2048 }, { 7, 455, 2048 }, + { 5, 456, 2048 }, { 6, 457, 2048 }, { 6, 458, 2048 }, { 7, 459, 2048 }, { 6, 460, 2048 }, { 7, 461, 2048 }, { 7, 462, 2048 }, { 8, 463, 2048 }, + { 5, 464, 2048 }, { 6, 465, 2048 }, { 6, 466, 2048 }, { 7, 467, 2048 }, { 6, 468, 2048 }, { 7, 469, 2048 }, { 7, 470, 2048 }, { 8, 471, 2048 }, + { 6, 472, 2048 }, { 7, 473, 2048 }, { 7, 474, 2048 }, { 8, 475, 2048 }, { 7, 476, 2048 }, { 8, 477, 2048 }, { 8, 478, 2048 }, { 9, 479, 2048 }, + { 5, 480, 2048 }, { 6, 481, 2048 }, { 6, 482, 2048 }, { 7, 483, 2048 }, { 6, 484, 2048 }, { 7, 485, 2048 }, { 7, 486, 2048 }, { 8, 487, 2048 }, + { 6, 488, 2048 }, { 7, 489, 2048 }, { 7, 490, 2048 }, { 8, 491, 2048 }, { 7, 492, 2048 }, { 8, 493, 2048 }, { 8, 494, 2048 }, { 9, 495, 2048 }, + { 6, 496, 2048 }, { 7, 497, 2048 }, { 7, 498, 2048 }, { 8, 499, 2048 }, { 7, 500, 2048 }, { 8, 501, 2048 }, { 8, 502, 2048 }, { 9, 503, 2048 }, + { 7, 504, 2048 }, { 8, 505, 2048 }, { 8, 506, 2048 }, { 9, 507, 2048 }, { 8, 508, 2048 }, { 9, 509, 2048 }, { 9, 510, 2048 }, { 10, 511, 2048 }, + { 2, 512, 2048 }, { 3, 513, 2048 }, { 3, 514, 2048 }, { 4, 515, 2048 }, { 3, 516, 2048 }, { 4, 517, 2048 }, { 4, 518, 2048 }, { 5, 519, 2048 }, + { 3, 520, 2048 }, { 4, 521, 2048 }, { 4, 522, 2048 }, { 5, 523, 2048 }, { 4, 524, 2048 }, { 5, 525, 2048 }, { 5, 526, 2048 }, { 6, 527, 2048 }, + { 3, 528, 2048 }, { 4, 529, 2048 }, { 4, 530, 2048 }, { 5, 531, 2048 }, { 4, 532, 2048 }, { 5, 533, 2048 }, { 5, 534, 2048 }, { 6, 535, 2048 }, + { 4, 536, 2048 }, { 5, 537, 2048 }, { 5, 538, 2048 }, { 6, 539, 2048 }, { 5, 540, 2048 }, { 6, 541, 2048 }, { 6, 542, 2048 }, { 7, 543, 2048 }, + { 3, 544, 2048 }, { 4, 545, 2048 }, { 4, 546, 2048 }, { 5, 547, 2048 }, { 4, 548, 2048 }, { 5, 549, 2048 }, { 5, 550, 2048 }, { 6, 551, 2048 }, + { 4, 552, 2048 }, { 5, 553, 2048 }, { 5, 554, 2048 }, { 6, 555, 2048 }, { 5, 556, 2048 }, { 6, 557, 2048 }, { 6, 558, 2048 }, { 7, 559, 2048 }, + { 4, 560, 2048 }, { 5, 561, 2048 }, { 5, 562, 2048 }, { 6, 563, 2048 }, { 5, 564, 2048 }, { 6, 565, 2048 }, { 6, 566, 2048 }, { 7, 567, 2048 }, + { 5, 568, 2048 }, { 6, 569, 2048 }, { 6, 570, 2048 }, { 7, 571, 2048 }, { 6, 572, 2048 }, { 7, 573, 2048 }, { 7, 574, 2048 }, { 8, 575, 2048 }, + { 3, 576, 2048 }, { 4, 577, 2048 }, { 4, 578, 2048 }, { 5, 579, 2048 }, { 4, 580, 2048 }, { 5, 581, 2048 }, { 5, 582, 2048 }, { 6, 583, 2048 }, + { 4, 584, 2048 }, { 5, 585, 2048 }, { 5, 586, 2048 }, { 6, 587, 2048 }, { 5, 588, 2048 }, { 6, 589, 2048 }, { 6, 590, 2048 }, { 7, 591, 2048 }, + { 4, 592, 2048 }, { 5, 593, 2048 }, { 5, 594, 2048 }, { 6, 595, 2048 }, { 5, 596, 2048 }, { 6, 597, 2048 }, { 6, 598, 2048 }, { 7, 599, 2048 }, + { 5, 600, 2048 }, { 6, 601, 2048 }, { 6, 602, 2048 }, { 7, 603, 2048 }, { 6, 604, 2048 }, { 7, 605, 2048 }, { 7, 606, 2048 }, { 8, 607, 2048 }, + { 4, 608, 2048 }, { 5, 609, 2048 }, { 5, 610, 2048 }, { 6, 611, 2048 }, { 5, 612, 2048 }, { 6, 613, 2048 }, { 6, 614, 2048 }, { 7, 615, 2048 }, + { 5, 616, 2048 }, { 6, 617, 2048 }, { 6, 618, 2048 }, { 7, 619, 2048 }, { 6, 620, 2048 }, { 7, 621, 2048 }, { 7, 622, 2048 }, { 8, 623, 2048 }, + { 5, 624, 2048 }, { 6, 625, 2048 }, { 6, 626, 2048 }, { 7, 627, 2048 }, { 6, 628, 2048 }, { 7, 629, 2048 }, { 7, 630, 2048 }, { 8, 631, 2048 }, + { 6, 632, 2048 }, { 7, 633, 2048 }, { 7, 634, 2048 }, { 8, 635, 2048 }, { 7, 636, 2048 }, { 8, 637, 2048 }, { 8, 638, 2048 }, { 9, 639, 2048 }, + { 3, 640, 2048 }, { 4, 641, 2048 }, { 4, 642, 2048 }, { 5, 643, 2048 }, { 4, 644, 2048 }, { 5, 645, 2048 }, { 5, 646, 2048 }, { 6, 647, 2048 }, + { 4, 648, 2048 }, { 5, 649, 2048 }, { 5, 650, 2048 }, { 6, 651, 2048 }, { 5, 652, 2048 }, { 6, 653, 2048 }, { 6, 654, 2048 }, { 7, 655, 2048 }, + { 4, 656, 2048 }, { 5, 657, 2048 }, { 5, 658, 2048 }, { 6, 659, 2048 }, { 5, 660, 2048 }, { 6, 661, 2048 }, { 6, 662, 2048 }, { 7, 663, 2048 }, + { 5, 664, 2048 }, { 6, 665, 2048 }, { 6, 666, 2048 }, { 7, 667, 2048 }, { 6, 668, 2048 }, { 7, 669, 2048 }, { 7, 670, 2048 }, { 8, 671, 2048 }, + { 4, 672, 2048 }, { 5, 673, 2048 }, { 5, 674, 2048 }, { 6, 675, 2048 }, { 5, 676, 2048 }, { 6, 677, 2048 }, { 6, 678, 2048 }, { 7, 679, 2048 }, + { 5, 680, 2048 }, { 6, 681, 2048 }, { 6, 682, 2048 }, { 7, 683, 2048 }, { 6, 684, 2048 }, { 7, 685, 2048 }, { 7, 686, 2048 }, { 8, 687, 2048 }, + { 5, 688, 2048 }, { 6, 689, 2048 }, { 6, 690, 2048 }, { 7, 691, 2048 }, { 6, 692, 2048 }, { 7, 693, 2048 }, { 7, 694, 2048 }, { 8, 695, 2048 }, + { 6, 696, 2048 }, { 7, 697, 2048 }, { 7, 698, 2048 }, { 8, 699, 2048 }, { 7, 700, 2048 }, { 8, 701, 2048 }, { 8, 702, 2048 }, { 9, 703, 2048 }, + { 4, 704, 2048 }, { 5, 705, 2048 }, { 5, 706, 2048 }, { 6, 707, 2048 }, { 5, 708, 2048 }, { 6, 709, 2048 }, { 6, 710, 2048 }, { 7, 711, 2048 }, + { 5, 712, 2048 }, { 6, 713, 2048 }, { 6, 714, 2048 }, { 7, 715, 2048 }, { 6, 716, 2048 }, { 7, 717, 2048 }, { 7, 718, 2048 }, { 8, 719, 2048 }, + { 5, 720, 2048 }, { 6, 721, 2048 }, { 6, 722, 2048 }, { 7, 723, 2048 }, { 6, 724, 2048 }, { 7, 725, 2048 }, { 7, 726, 2048 }, { 8, 727, 2048 }, + { 6, 728, 2048 }, { 7, 729, 2048 }, { 7, 730, 2048 }, { 8, 731, 2048 }, { 7, 732, 2048 }, { 8, 733, 2048 }, { 8, 734, 2048 }, { 9, 735, 2048 }, + { 5, 736, 2048 }, { 6, 737, 2048 }, { 6, 738, 2048 }, { 7, 739, 2048 }, { 6, 740, 2048 }, { 7, 741, 2048 }, { 7, 742, 2048 }, { 8, 743, 2048 }, + { 6, 744, 2048 }, { 7, 745, 2048 }, { 7, 746, 2048 }, { 8, 747, 2048 }, { 7, 748, 2048 }, { 8, 749, 2048 }, { 8, 750, 2048 }, { 9, 751, 2048 }, + { 6, 752, 2048 }, { 7, 753, 2048 }, { 7, 754, 2048 }, { 8, 755, 2048 }, { 7, 756, 2048 }, { 8, 757, 2048 }, { 8, 758, 2048 }, { 9, 759, 2048 }, + { 7, 760, 2048 }, { 8, 761, 2048 }, { 8, 762, 2048 }, { 9, 763, 2048 }, { 8, 764, 2048 }, { 9, 765, 2048 }, { 9, 766, 2048 }, { 10, 767, 2048 }, + { 3, 768, 2048 }, { 4, 769, 2048 }, { 4, 770, 2048 }, { 5, 771, 2048 }, { 4, 772, 2048 }, { 5, 773, 2048 }, { 5, 774, 2048 }, { 6, 775, 2048 }, + { 4, 776, 2048 }, { 5, 777, 2048 }, { 5, 778, 2048 }, { 6, 779, 2048 }, { 5, 780, 2048 }, { 6, 781, 2048 }, { 6, 782, 2048 }, { 7, 783, 2048 }, + { 4, 784, 2048 }, { 5, 785, 2048 }, { 5, 786, 2048 }, { 6, 787, 2048 }, { 5, 788, 2048 }, { 6, 789, 2048 }, { 6, 790, 2048 }, { 7, 791, 2048 }, + { 5, 792, 2048 }, { 6, 793, 2048 }, { 6, 794, 2048 }, { 7, 795, 2048 }, { 6, 796, 2048 }, { 7, 797, 2048 }, { 7, 798, 2048 }, { 8, 799, 2048 }, + { 4, 800, 2048 }, { 5, 801, 2048 }, { 5, 802, 2048 }, { 6, 803, 2048 }, { 5, 804, 2048 }, { 6, 805, 2048 }, { 6, 806, 2048 }, { 7, 807, 2048 }, + { 5, 808, 2048 }, { 6, 809, 2048 }, { 6, 810, 2048 }, { 7, 811, 2048 }, { 6, 812, 2048 }, { 7, 813, 2048 }, { 7, 814, 2048 }, { 8, 815, 2048 }, + { 5, 816, 2048 }, { 6, 817, 2048 }, { 6, 818, 2048 }, { 7, 819, 2048 }, { 6, 820, 2048 }, { 7, 821, 2048 }, { 7, 822, 2048 }, { 8, 823, 2048 }, + { 6, 824, 2048 }, { 7, 825, 2048 }, { 7, 826, 2048 }, { 8, 827, 2048 }, { 7, 828, 2048 }, { 8, 829, 2048 }, { 8, 830, 2048 }, { 9, 831, 2048 }, + { 4, 832, 2048 }, { 5, 833, 2048 }, { 5, 834, 2048 }, { 6, 835, 2048 }, { 5, 836, 2048 }, { 6, 837, 2048 }, { 6, 838, 2048 }, { 7, 839, 2048 }, + { 5, 840, 2048 }, { 6, 841, 2048 }, { 6, 842, 2048 }, { 7, 843, 2048 }, { 6, 844, 2048 }, { 7, 845, 2048 }, { 7, 846, 2048 }, { 8, 847, 2048 }, + { 5, 848, 2048 }, { 6, 849, 2048 }, { 6, 850, 2048 }, { 7, 851, 2048 }, { 6, 852, 2048 }, { 7, 853, 2048 }, { 7, 854, 2048 }, { 8, 855, 2048 }, + { 6, 856, 2048 }, { 7, 857, 2048 }, { 7, 858, 2048 }, { 8, 859, 2048 }, { 7, 860, 2048 }, { 8, 861, 2048 }, { 8, 862, 2048 }, { 9, 863, 2048 }, + { 5, 864, 2048 }, { 6, 865, 2048 }, { 6, 866, 2048 }, { 7, 867, 2048 }, { 6, 868, 2048 }, { 7, 869, 2048 }, { 7, 870, 2048 }, { 8, 871, 2048 }, + { 6, 872, 2048 }, { 7, 873, 2048 }, { 7, 874, 2048 }, { 8, 875, 2048 }, { 7, 876, 2048 }, { 8, 877, 2048 }, { 8, 878, 2048 }, { 9, 879, 2048 }, + { 6, 880, 2048 }, { 7, 881, 2048 }, { 7, 882, 2048 }, { 8, 883, 2048 }, { 7, 884, 2048 }, { 8, 885, 2048 }, { 8, 886, 2048 }, { 9, 887, 2048 }, + { 7, 888, 2048 }, { 8, 889, 2048 }, { 8, 890, 2048 }, { 9, 891, 2048 }, { 8, 892, 2048 }, { 9, 893, 2048 }, { 9, 894, 2048 }, { 10, 895, 2048 }, + { 4, 896, 2048 }, { 5, 897, 2048 }, { 5, 898, 2048 }, { 6, 899, 2048 }, { 5, 900, 2048 }, { 6, 901, 2048 }, { 6, 902, 2048 }, { 7, 903, 2048 }, + { 5, 904, 2048 }, { 6, 905, 2048 }, { 6, 906, 2048 }, { 7, 907, 2048 }, { 6, 908, 2048 }, { 7, 909, 2048 }, { 7, 910, 2048 }, { 8, 911, 2048 }, + { 5, 912, 2048 }, { 6, 913, 2048 }, { 6, 914, 2048 }, { 7, 915, 2048 }, { 6, 916, 2048 }, { 7, 917, 2048 }, { 7, 918, 2048 }, { 8, 919, 2048 }, + { 6, 920, 2048 }, { 7, 921, 2048 }, { 7, 922, 2048 }, { 8, 923, 2048 }, { 7, 924, 2048 }, { 8, 925, 2048 }, { 8, 926, 2048 }, { 9, 927, 2048 }, + { 5, 928, 2048 }, { 6, 929, 2048 }, { 6, 930, 2048 }, { 7, 931, 2048 }, { 6, 932, 2048 }, { 7, 933, 2048 }, { 7, 934, 2048 }, { 8, 935, 2048 }, + { 6, 936, 2048 }, { 7, 937, 2048 }, { 7, 938, 2048 }, { 8, 939, 2048 }, { 7, 940, 2048 }, { 8, 941, 2048 }, { 8, 942, 2048 }, { 9, 943, 2048 }, + { 6, 944, 2048 }, { 7, 945, 2048 }, { 7, 946, 2048 }, { 8, 947, 2048 }, { 7, 948, 2048 }, { 8, 949, 2048 }, { 8, 950, 2048 }, { 9, 951, 2048 }, + { 7, 952, 2048 }, { 8, 953, 2048 }, { 8, 954, 2048 }, { 9, 955, 2048 }, { 8, 956, 2048 }, { 9, 957, 2048 }, { 9, 958, 2048 }, { 10, 959, 2048 }, + { 5, 960, 2048 }, { 6, 961, 2048 }, { 6, 962, 2048 }, { 7, 963, 2048 }, { 6, 964, 2048 }, { 7, 965, 2048 }, { 7, 966, 2048 }, { 8, 967, 2048 }, + { 6, 968, 2048 }, { 7, 969, 2048 }, { 7, 970, 2048 }, { 8, 971, 2048 }, { 7, 972, 2048 }, { 8, 973, 2048 }, { 8, 974, 2048 }, { 9, 975, 2048 }, + { 6, 976, 2048 }, { 7, 977, 2048 }, { 7, 978, 2048 }, { 8, 979, 2048 }, { 7, 980, 2048 }, { 8, 981, 2048 }, { 8, 982, 2048 }, { 9, 983, 2048 }, + { 7, 984, 2048 }, { 8, 985, 2048 }, { 8, 986, 2048 }, { 9, 987, 2048 }, { 8, 988, 2048 }, { 9, 989, 2048 }, { 9, 990, 2048 }, { 10, 991, 2048 }, + { 6, 992, 2048 }, { 7, 993, 2048 }, { 7, 994, 2048 }, { 8, 995, 2048 }, { 7, 996, 2048 }, { 8, 997, 2048 }, { 8, 998, 2048 }, { 9, 999, 2048 }, + { 7, 1000, 2048 }, { 8, 1001, 2048 }, { 8, 1002, 2048 }, { 9, 1003, 2048 }, { 8, 1004, 2048 }, { 9, 1005, 2048 }, { 9, 1006, 2048 }, { 10, 1007, 2048 }, + { 7, 1008, 2048 }, { 8, 1009, 2048 }, { 8, 1010, 2048 }, { 9, 1011, 2048 }, { 8, 1012, 2048 }, { 9, 1013, 2048 }, { 9, 1014, 2048 }, { 10, 1015, 2048 }, + { 8, 1016, 2048 }, { 9, 1017, 2048 }, { 9, 1018, 2048 }, { 10, 1019, 2048 }, { 9, 1020, 2048 }, { 10, 1021, 2048 }, { 10, 1022, 2048 }, { 11, 1023, 2048 }, + { 2, 1024, 2048 }, { 3, 1025, 2048 }, { 3, 1026, 2048 }, { 4, 1027, 2048 }, { 3, 1028, 2048 }, { 4, 1029, 2048 }, { 4, 1030, 2048 }, { 5, 1031, 2048 }, + { 3, 1032, 2048 }, { 4, 1033, 2048 }, { 4, 1034, 2048 }, { 5, 1035, 2048 }, { 4, 1036, 2048 }, { 5, 1037, 2048 }, { 5, 1038, 2048 }, { 6, 1039, 2048 }, + { 3, 1040, 2048 }, { 4, 1041, 2048 }, { 4, 1042, 2048 }, { 5, 1043, 2048 }, { 4, 1044, 2048 }, { 5, 1045, 2048 }, { 5, 1046, 2048 }, { 6, 1047, 2048 }, + { 4, 1048, 2048 }, { 5, 1049, 2048 }, { 5, 1050, 2048 }, { 6, 1051, 2048 }, { 5, 1052, 2048 }, { 6, 1053, 2048 }, { 6, 1054, 2048 }, { 7, 1055, 2048 }, + { 3, 1056, 2048 }, { 4, 1057, 2048 }, { 4, 1058, 2048 }, { 5, 1059, 2048 }, { 4, 1060, 2048 }, { 5, 1061, 2048 }, { 5, 1062, 2048 }, { 6, 1063, 2048 }, + { 4, 1064, 2048 }, { 5, 1065, 2048 }, { 5, 1066, 2048 }, { 6, 1067, 2048 }, { 5, 1068, 2048 }, { 6, 1069, 2048 }, { 6, 1070, 2048 }, { 7, 1071, 2048 }, + { 4, 1072, 2048 }, { 5, 1073, 2048 }, { 5, 1074, 2048 }, { 6, 1075, 2048 }, { 5, 1076, 2048 }, { 6, 1077, 2048 }, { 6, 1078, 2048 }, { 7, 1079, 2048 }, + { 5, 1080, 2048 }, { 6, 1081, 2048 }, { 6, 1082, 2048 }, { 7, 1083, 2048 }, { 6, 1084, 2048 }, { 7, 1085, 2048 }, { 7, 1086, 2048 }, { 8, 1087, 2048 }, + { 3, 1088, 2048 }, { 4, 1089, 2048 }, { 4, 1090, 2048 }, { 5, 1091, 2048 }, { 4, 1092, 2048 }, { 5, 1093, 2048 }, { 5, 1094, 2048 }, { 6, 1095, 2048 }, + { 4, 1096, 2048 }, { 5, 1097, 2048 }, { 5, 1098, 2048 }, { 6, 1099, 2048 }, { 5, 1100, 2048 }, { 6, 1101, 2048 }, { 6, 1102, 2048 }, { 7, 1103, 2048 }, + { 4, 1104, 2048 }, { 5, 1105, 2048 }, { 5, 1106, 2048 }, { 6, 1107, 2048 }, { 5, 1108, 2048 }, { 6, 1109, 2048 }, { 6, 1110, 2048 }, { 7, 1111, 2048 }, + { 5, 1112, 2048 }, { 6, 1113, 2048 }, { 6, 1114, 2048 }, { 7, 1115, 2048 }, { 6, 1116, 2048 }, { 7, 1117, 2048 }, { 7, 1118, 2048 }, { 8, 1119, 2048 }, + { 4, 1120, 2048 }, { 5, 1121, 2048 }, { 5, 1122, 2048 }, { 6, 1123, 2048 }, { 5, 1124, 2048 }, { 6, 1125, 2048 }, { 6, 1126, 2048 }, { 7, 1127, 2048 }, + { 5, 1128, 2048 }, { 6, 1129, 2048 }, { 6, 1130, 2048 }, { 7, 1131, 2048 }, { 6, 1132, 2048 }, { 7, 1133, 2048 }, { 7, 1134, 2048 }, { 8, 1135, 2048 }, + { 5, 1136, 2048 }, { 6, 1137, 2048 }, { 6, 1138, 2048 }, { 7, 1139, 2048 }, { 6, 1140, 2048 }, { 7, 1141, 2048 }, { 7, 1142, 2048 }, { 8, 1143, 2048 }, + { 6, 1144, 2048 }, { 7, 1145, 2048 }, { 7, 1146, 2048 }, { 8, 1147, 2048 }, { 7, 1148, 2048 }, { 8, 1149, 2048 }, { 8, 1150, 2048 }, { 9, 1151, 2048 }, + { 3, 1152, 2048 }, { 4, 1153, 2048 }, { 4, 1154, 2048 }, { 5, 1155, 2048 }, { 4, 1156, 2048 }, { 5, 1157, 2048 }, { 5, 1158, 2048 }, { 6, 1159, 2048 }, + { 4, 1160, 2048 }, { 5, 1161, 2048 }, { 5, 1162, 2048 }, { 6, 1163, 2048 }, { 5, 1164, 2048 }, { 6, 1165, 2048 }, { 6, 1166, 2048 }, { 7, 1167, 2048 }, + { 4, 1168, 2048 }, { 5, 1169, 2048 }, { 5, 1170, 2048 }, { 6, 1171, 2048 }, { 5, 1172, 2048 }, { 6, 1173, 2048 }, { 6, 1174, 2048 }, { 7, 1175, 2048 }, + { 5, 1176, 2048 }, { 6, 1177, 2048 }, { 6, 1178, 2048 }, { 7, 1179, 2048 }, { 6, 1180, 2048 }, { 7, 1181, 2048 }, { 7, 1182, 2048 }, { 8, 1183, 2048 }, + { 4, 1184, 2048 }, { 5, 1185, 2048 }, { 5, 1186, 2048 }, { 6, 1187, 2048 }, { 5, 1188, 2048 }, { 6, 1189, 2048 }, { 6, 1190, 2048 }, { 7, 1191, 2048 }, + { 5, 1192, 2048 }, { 6, 1193, 2048 }, { 6, 1194, 2048 }, { 7, 1195, 2048 }, { 6, 1196, 2048 }, { 7, 1197, 2048 }, { 7, 1198, 2048 }, { 8, 1199, 2048 }, + { 5, 1200, 2048 }, { 6, 1201, 2048 }, { 6, 1202, 2048 }, { 7, 1203, 2048 }, { 6, 1204, 2048 }, { 7, 1205, 2048 }, { 7, 1206, 2048 }, { 8, 1207, 2048 }, + { 6, 1208, 2048 }, { 7, 1209, 2048 }, { 7, 1210, 2048 }, { 8, 1211, 2048 }, { 7, 1212, 2048 }, { 8, 1213, 2048 }, { 8, 1214, 2048 }, { 9, 1215, 2048 }, + { 4, 1216, 2048 }, { 5, 1217, 2048 }, { 5, 1218, 2048 }, { 6, 1219, 2048 }, { 5, 1220, 2048 }, { 6, 1221, 2048 }, { 6, 1222, 2048 }, { 7, 1223, 2048 }, + { 5, 1224, 2048 }, { 6, 1225, 2048 }, { 6, 1226, 2048 }, { 7, 1227, 2048 }, { 6, 1228, 2048 }, { 7, 1229, 2048 }, { 7, 1230, 2048 }, { 8, 1231, 2048 }, + { 5, 1232, 2048 }, { 6, 1233, 2048 }, { 6, 1234, 2048 }, { 7, 1235, 2048 }, { 6, 1236, 2048 }, { 7, 1237, 2048 }, { 7, 1238, 2048 }, { 8, 1239, 2048 }, + { 6, 1240, 2048 }, { 7, 1241, 2048 }, { 7, 1242, 2048 }, { 8, 1243, 2048 }, { 7, 1244, 2048 }, { 8, 1245, 2048 }, { 8, 1246, 2048 }, { 9, 1247, 2048 }, + { 5, 1248, 2048 }, { 6, 1249, 2048 }, { 6, 1250, 2048 }, { 7, 1251, 2048 }, { 6, 1252, 2048 }, { 7, 1253, 2048 }, { 7, 1254, 2048 }, { 8, 1255, 2048 }, + { 6, 1256, 2048 }, { 7, 1257, 2048 }, { 7, 1258, 2048 }, { 8, 1259, 2048 }, { 7, 1260, 2048 }, { 8, 1261, 2048 }, { 8, 1262, 2048 }, { 9, 1263, 2048 }, + { 6, 1264, 2048 }, { 7, 1265, 2048 }, { 7, 1266, 2048 }, { 8, 1267, 2048 }, { 7, 1268, 2048 }, { 8, 1269, 2048 }, { 8, 1270, 2048 }, { 9, 1271, 2048 }, + { 7, 1272, 2048 }, { 8, 1273, 2048 }, { 8, 1274, 2048 }, { 9, 1275, 2048 }, { 8, 1276, 2048 }, { 9, 1277, 2048 }, { 9, 1278, 2048 }, { 10, 1279, 2048 }, + { 3, 1280, 2048 }, { 4, 1281, 2048 }, { 4, 1282, 2048 }, { 5, 1283, 2048 }, { 4, 1284, 2048 }, { 5, 1285, 2048 }, { 5, 1286, 2048 }, { 6, 1287, 2048 }, + { 4, 1288, 2048 }, { 5, 1289, 2048 }, { 5, 1290, 2048 }, { 6, 1291, 2048 }, { 5, 1292, 2048 }, { 6, 1293, 2048 }, { 6, 1294, 2048 }, { 7, 1295, 2048 }, + { 4, 1296, 2048 }, { 5, 1297, 2048 }, { 5, 1298, 2048 }, { 6, 1299, 2048 }, { 5, 1300, 2048 }, { 6, 1301, 2048 }, { 6, 1302, 2048 }, { 7, 1303, 2048 }, + { 5, 1304, 2048 }, { 6, 1305, 2048 }, { 6, 1306, 2048 }, { 7, 1307, 2048 }, { 6, 1308, 2048 }, { 7, 1309, 2048 }, { 7, 1310, 2048 }, { 8, 1311, 2048 }, + { 4, 1312, 2048 }, { 5, 1313, 2048 }, { 5, 1314, 2048 }, { 6, 1315, 2048 }, { 5, 1316, 2048 }, { 6, 1317, 2048 }, { 6, 1318, 2048 }, { 7, 1319, 2048 }, + { 5, 1320, 2048 }, { 6, 1321, 2048 }, { 6, 1322, 2048 }, { 7, 1323, 2048 }, { 6, 1324, 2048 }, { 7, 1325, 2048 }, { 7, 1326, 2048 }, { 8, 1327, 2048 }, + { 5, 1328, 2048 }, { 6, 1329, 2048 }, { 6, 1330, 2048 }, { 7, 1331, 2048 }, { 6, 1332, 2048 }, { 7, 1333, 2048 }, { 7, 1334, 2048 }, { 8, 1335, 2048 }, + { 6, 1336, 2048 }, { 7, 1337, 2048 }, { 7, 1338, 2048 }, { 8, 1339, 2048 }, { 7, 1340, 2048 }, { 8, 1341, 2048 }, { 8, 1342, 2048 }, { 9, 1343, 2048 }, + { 4, 1344, 2048 }, { 5, 1345, 2048 }, { 5, 1346, 2048 }, { 6, 1347, 2048 }, { 5, 1348, 2048 }, { 6, 1349, 2048 }, { 6, 1350, 2048 }, { 7, 1351, 2048 }, + { 5, 1352, 2048 }, { 6, 1353, 2048 }, { 6, 1354, 2048 }, { 7, 1355, 2048 }, { 6, 1356, 2048 }, { 7, 1357, 2048 }, { 7, 1358, 2048 }, { 8, 1359, 2048 }, + { 5, 1360, 2048 }, { 6, 1361, 2048 }, { 6, 1362, 2048 }, { 7, 1363, 2048 }, { 6, 1364, 2048 }, { 7, 1365, 2048 }, { 7, 1366, 2048 }, { 8, 1367, 2048 }, + { 6, 1368, 2048 }, { 7, 1369, 2048 }, { 7, 1370, 2048 }, { 8, 1371, 2048 }, { 7, 1372, 2048 }, { 8, 1373, 2048 }, { 8, 1374, 2048 }, { 9, 1375, 2048 }, + { 5, 1376, 2048 }, { 6, 1377, 2048 }, { 6, 1378, 2048 }, { 7, 1379, 2048 }, { 6, 1380, 2048 }, { 7, 1381, 2048 }, { 7, 1382, 2048 }, { 8, 1383, 2048 }, + { 6, 1384, 2048 }, { 7, 1385, 2048 }, { 7, 1386, 2048 }, { 8, 1387, 2048 }, { 7, 1388, 2048 }, { 8, 1389, 2048 }, { 8, 1390, 2048 }, { 9, 1391, 2048 }, + { 6, 1392, 2048 }, { 7, 1393, 2048 }, { 7, 1394, 2048 }, { 8, 1395, 2048 }, { 7, 1396, 2048 }, { 8, 1397, 2048 }, { 8, 1398, 2048 }, { 9, 1399, 2048 }, + { 7, 1400, 2048 }, { 8, 1401, 2048 }, { 8, 1402, 2048 }, { 9, 1403, 2048 }, { 8, 1404, 2048 }, { 9, 1405, 2048 }, { 9, 1406, 2048 }, { 10, 1407, 2048 }, + { 4, 1408, 2048 }, { 5, 1409, 2048 }, { 5, 1410, 2048 }, { 6, 1411, 2048 }, { 5, 1412, 2048 }, { 6, 1413, 2048 }, { 6, 1414, 2048 }, { 7, 1415, 2048 }, + { 5, 1416, 2048 }, { 6, 1417, 2048 }, { 6, 1418, 2048 }, { 7, 1419, 2048 }, { 6, 1420, 2048 }, { 7, 1421, 2048 }, { 7, 1422, 2048 }, { 8, 1423, 2048 }, + { 5, 1424, 2048 }, { 6, 1425, 2048 }, { 6, 1426, 2048 }, { 7, 1427, 2048 }, { 6, 1428, 2048 }, { 7, 1429, 2048 }, { 7, 1430, 2048 }, { 8, 1431, 2048 }, + { 6, 1432, 2048 }, { 7, 1433, 2048 }, { 7, 1434, 2048 }, { 8, 1435, 2048 }, { 7, 1436, 2048 }, { 8, 1437, 2048 }, { 8, 1438, 2048 }, { 9, 1439, 2048 }, + { 5, 1440, 2048 }, { 6, 1441, 2048 }, { 6, 1442, 2048 }, { 7, 1443, 2048 }, { 6, 1444, 2048 }, { 7, 1445, 2048 }, { 7, 1446, 2048 }, { 8, 1447, 2048 }, + { 6, 1448, 2048 }, { 7, 1449, 2048 }, { 7, 1450, 2048 }, { 8, 1451, 2048 }, { 7, 1452, 2048 }, { 8, 1453, 2048 }, { 8, 1454, 2048 }, { 9, 1455, 2048 }, + { 6, 1456, 2048 }, { 7, 1457, 2048 }, { 7, 1458, 2048 }, { 8, 1459, 2048 }, { 7, 1460, 2048 }, { 8, 1461, 2048 }, { 8, 1462, 2048 }, { 9, 1463, 2048 }, + { 7, 1464, 2048 }, { 8, 1465, 2048 }, { 8, 1466, 2048 }, { 9, 1467, 2048 }, { 8, 1468, 2048 }, { 9, 1469, 2048 }, { 9, 1470, 2048 }, { 10, 1471, 2048 }, + { 5, 1472, 2048 }, { 6, 1473, 2048 }, { 6, 1474, 2048 }, { 7, 1475, 2048 }, { 6, 1476, 2048 }, { 7, 1477, 2048 }, { 7, 1478, 2048 }, { 8, 1479, 2048 }, + { 6, 1480, 2048 }, { 7, 1481, 2048 }, { 7, 1482, 2048 }, { 8, 1483, 2048 }, { 7, 1484, 2048 }, { 8, 1485, 2048 }, { 8, 1486, 2048 }, { 9, 1487, 2048 }, + { 6, 1488, 2048 }, { 7, 1489, 2048 }, { 7, 1490, 2048 }, { 8, 1491, 2048 }, { 7, 1492, 2048 }, { 8, 1493, 2048 }, { 8, 1494, 2048 }, { 9, 1495, 2048 }, + { 7, 1496, 2048 }, { 8, 1497, 2048 }, { 8, 1498, 2048 }, { 9, 1499, 2048 }, { 8, 1500, 2048 }, { 9, 1501, 2048 }, { 9, 1502, 2048 }, { 10, 1503, 2048 }, + { 6, 1504, 2048 }, { 7, 1505, 2048 }, { 7, 1506, 2048 }, { 8, 1507, 2048 }, { 7, 1508, 2048 }, { 8, 1509, 2048 }, { 8, 1510, 2048 }, { 9, 1511, 2048 }, + { 7, 1512, 2048 }, { 8, 1513, 2048 }, { 8, 1514, 2048 }, { 9, 1515, 2048 }, { 8, 1516, 2048 }, { 9, 1517, 2048 }, { 9, 1518, 2048 }, { 10, 1519, 2048 }, + { 7, 1520, 2048 }, { 8, 1521, 2048 }, { 8, 1522, 2048 }, { 9, 1523, 2048 }, { 8, 1524, 2048 }, { 9, 1525, 2048 }, { 9, 1526, 2048 }, { 10, 1527, 2048 }, + { 8, 1528, 2048 }, { 9, 1529, 2048 }, { 9, 1530, 2048 }, { 10, 1531, 2048 }, { 9, 1532, 2048 }, { 10, 1533, 2048 }, { 10, 1534, 2048 }, { 11, 1535, 2048 }, + { 3, 1536, 2048 }, { 4, 1537, 2048 }, { 4, 1538, 2048 }, { 5, 1539, 2048 }, { 4, 1540, 2048 }, { 5, 1541, 2048 }, { 5, 1542, 2048 }, { 6, 1543, 2048 }, + { 4, 1544, 2048 }, { 5, 1545, 2048 }, { 5, 1546, 2048 }, { 6, 1547, 2048 }, { 5, 1548, 2048 }, { 6, 1549, 2048 }, { 6, 1550, 2048 }, { 7, 1551, 2048 }, + { 4, 1552, 2048 }, { 5, 1553, 2048 }, { 5, 1554, 2048 }, { 6, 1555, 2048 }, { 5, 1556, 2048 }, { 6, 1557, 2048 }, { 6, 1558, 2048 }, { 7, 1559, 2048 }, + { 5, 1560, 2048 }, { 6, 1561, 2048 }, { 6, 1562, 2048 }, { 7, 1563, 2048 }, { 6, 1564, 2048 }, { 7, 1565, 2048 }, { 7, 1566, 2048 }, { 8, 1567, 2048 }, + { 4, 1568, 2048 }, { 5, 1569, 2048 }, { 5, 1570, 2048 }, { 6, 1571, 2048 }, { 5, 1572, 2048 }, { 6, 1573, 2048 }, { 6, 1574, 2048 }, { 7, 1575, 2048 }, + { 5, 1576, 2048 }, { 6, 1577, 2048 }, { 6, 1578, 2048 }, { 7, 1579, 2048 }, { 6, 1580, 2048 }, { 7, 1581, 2048 }, { 7, 1582, 2048 }, { 8, 1583, 2048 }, + { 5, 1584, 2048 }, { 6, 1585, 2048 }, { 6, 1586, 2048 }, { 7, 1587, 2048 }, { 6, 1588, 2048 }, { 7, 1589, 2048 }, { 7, 1590, 2048 }, { 8, 1591, 2048 }, + { 6, 1592, 2048 }, { 7, 1593, 2048 }, { 7, 1594, 2048 }, { 8, 1595, 2048 }, { 7, 1596, 2048 }, { 8, 1597, 2048 }, { 8, 1598, 2048 }, { 9, 1599, 2048 }, + { 4, 1600, 2048 }, { 5, 1601, 2048 }, { 5, 1602, 2048 }, { 6, 1603, 2048 }, { 5, 1604, 2048 }, { 6, 1605, 2048 }, { 6, 1606, 2048 }, { 7, 1607, 2048 }, + { 5, 1608, 2048 }, { 6, 1609, 2048 }, { 6, 1610, 2048 }, { 7, 1611, 2048 }, { 6, 1612, 2048 }, { 7, 1613, 2048 }, { 7, 1614, 2048 }, { 8, 1615, 2048 }, + { 5, 1616, 2048 }, { 6, 1617, 2048 }, { 6, 1618, 2048 }, { 7, 1619, 2048 }, { 6, 1620, 2048 }, { 7, 1621, 2048 }, { 7, 1622, 2048 }, { 8, 1623, 2048 }, + { 6, 1624, 2048 }, { 7, 1625, 2048 }, { 7, 1626, 2048 }, { 8, 1627, 2048 }, { 7, 1628, 2048 }, { 8, 1629, 2048 }, { 8, 1630, 2048 }, { 9, 1631, 2048 }, + { 5, 1632, 2048 }, { 6, 1633, 2048 }, { 6, 1634, 2048 }, { 7, 1635, 2048 }, { 6, 1636, 2048 }, { 7, 1637, 2048 }, { 7, 1638, 2048 }, { 8, 1639, 2048 }, + { 6, 1640, 2048 }, { 7, 1641, 2048 }, { 7, 1642, 2048 }, { 8, 1643, 2048 }, { 7, 1644, 2048 }, { 8, 1645, 2048 }, { 8, 1646, 2048 }, { 9, 1647, 2048 }, + { 6, 1648, 2048 }, { 7, 1649, 2048 }, { 7, 1650, 2048 }, { 8, 1651, 2048 }, { 7, 1652, 2048 }, { 8, 1653, 2048 }, { 8, 1654, 2048 }, { 9, 1655, 2048 }, + { 7, 1656, 2048 }, { 8, 1657, 2048 }, { 8, 1658, 2048 }, { 9, 1659, 2048 }, { 8, 1660, 2048 }, { 9, 1661, 2048 }, { 9, 1662, 2048 }, { 10, 1663, 2048 }, + { 4, 1664, 2048 }, { 5, 1665, 2048 }, { 5, 1666, 2048 }, { 6, 1667, 2048 }, { 5, 1668, 2048 }, { 6, 1669, 2048 }, { 6, 1670, 2048 }, { 7, 1671, 2048 }, + { 5, 1672, 2048 }, { 6, 1673, 2048 }, { 6, 1674, 2048 }, { 7, 1675, 2048 }, { 6, 1676, 2048 }, { 7, 1677, 2048 }, { 7, 1678, 2048 }, { 8, 1679, 2048 }, + { 5, 1680, 2048 }, { 6, 1681, 2048 }, { 6, 1682, 2048 }, { 7, 1683, 2048 }, { 6, 1684, 2048 }, { 7, 1685, 2048 }, { 7, 1686, 2048 }, { 8, 1687, 2048 }, + { 6, 1688, 2048 }, { 7, 1689, 2048 }, { 7, 1690, 2048 }, { 8, 1691, 2048 }, { 7, 1692, 2048 }, { 8, 1693, 2048 }, { 8, 1694, 2048 }, { 9, 1695, 2048 }, + { 5, 1696, 2048 }, { 6, 1697, 2048 }, { 6, 1698, 2048 }, { 7, 1699, 2048 }, { 6, 1700, 2048 }, { 7, 1701, 2048 }, { 7, 1702, 2048 }, { 8, 1703, 2048 }, + { 6, 1704, 2048 }, { 7, 1705, 2048 }, { 7, 1706, 2048 }, { 8, 1707, 2048 }, { 7, 1708, 2048 }, { 8, 1709, 2048 }, { 8, 1710, 2048 }, { 9, 1711, 2048 }, + { 6, 1712, 2048 }, { 7, 1713, 2048 }, { 7, 1714, 2048 }, { 8, 1715, 2048 }, { 7, 1716, 2048 }, { 8, 1717, 2048 }, { 8, 1718, 2048 }, { 9, 1719, 2048 }, + { 7, 1720, 2048 }, { 8, 1721, 2048 }, { 8, 1722, 2048 }, { 9, 1723, 2048 }, { 8, 1724, 2048 }, { 9, 1725, 2048 }, { 9, 1726, 2048 }, { 10, 1727, 2048 }, + { 5, 1728, 2048 }, { 6, 1729, 2048 }, { 6, 1730, 2048 }, { 7, 1731, 2048 }, { 6, 1732, 2048 }, { 7, 1733, 2048 }, { 7, 1734, 2048 }, { 8, 1735, 2048 }, + { 6, 1736, 2048 }, { 7, 1737, 2048 }, { 7, 1738, 2048 }, { 8, 1739, 2048 }, { 7, 1740, 2048 }, { 8, 1741, 2048 }, { 8, 1742, 2048 }, { 9, 1743, 2048 }, + { 6, 1744, 2048 }, { 7, 1745, 2048 }, { 7, 1746, 2048 }, { 8, 1747, 2048 }, { 7, 1748, 2048 }, { 8, 1749, 2048 }, { 8, 1750, 2048 }, { 9, 1751, 2048 }, + { 7, 1752, 2048 }, { 8, 1753, 2048 }, { 8, 1754, 2048 }, { 9, 1755, 2048 }, { 8, 1756, 2048 }, { 9, 1757, 2048 }, { 9, 1758, 2048 }, { 10, 1759, 2048 }, + { 6, 1760, 2048 }, { 7, 1761, 2048 }, { 7, 1762, 2048 }, { 8, 1763, 2048 }, { 7, 1764, 2048 }, { 8, 1765, 2048 }, { 8, 1766, 2048 }, { 9, 1767, 2048 }, + { 7, 1768, 2048 }, { 8, 1769, 2048 }, { 8, 1770, 2048 }, { 9, 1771, 2048 }, { 8, 1772, 2048 }, { 9, 1773, 2048 }, { 9, 1774, 2048 }, { 10, 1775, 2048 }, + { 7, 1776, 2048 }, { 8, 1777, 2048 }, { 8, 1778, 2048 }, { 9, 1779, 2048 }, { 8, 1780, 2048 }, { 9, 1781, 2048 }, { 9, 1782, 2048 }, { 10, 1783, 2048 }, + { 8, 1784, 2048 }, { 9, 1785, 2048 }, { 9, 1786, 2048 }, { 10, 1787, 2048 }, { 9, 1788, 2048 }, { 10, 1789, 2048 }, { 10, 1790, 2048 }, { 11, 1791, 2048 }, + { 4, 1792, 2048 }, { 5, 1793, 2048 }, { 5, 1794, 2048 }, { 6, 1795, 2048 }, { 5, 1796, 2048 }, { 6, 1797, 2048 }, { 6, 1798, 2048 }, { 7, 1799, 2048 }, + { 5, 1800, 2048 }, { 6, 1801, 2048 }, { 6, 1802, 2048 }, { 7, 1803, 2048 }, { 6, 1804, 2048 }, { 7, 1805, 2048 }, { 7, 1806, 2048 }, { 8, 1807, 2048 }, + { 5, 1808, 2048 }, { 6, 1809, 2048 }, { 6, 1810, 2048 }, { 7, 1811, 2048 }, { 6, 1812, 2048 }, { 7, 1813, 2048 }, { 7, 1814, 2048 }, { 8, 1815, 2048 }, + { 6, 1816, 2048 }, { 7, 1817, 2048 }, { 7, 1818, 2048 }, { 8, 1819, 2048 }, { 7, 1820, 2048 }, { 8, 1821, 2048 }, { 8, 1822, 2048 }, { 9, 1823, 2048 }, + { 5, 1824, 2048 }, { 6, 1825, 2048 }, { 6, 1826, 2048 }, { 7, 1827, 2048 }, { 6, 1828, 2048 }, { 7, 1829, 2048 }, { 7, 1830, 2048 }, { 8, 1831, 2048 }, + { 6, 1832, 2048 }, { 7, 1833, 2048 }, { 7, 1834, 2048 }, { 8, 1835, 2048 }, { 7, 1836, 2048 }, { 8, 1837, 2048 }, { 8, 1838, 2048 }, { 9, 1839, 2048 }, + { 6, 1840, 2048 }, { 7, 1841, 2048 }, { 7, 1842, 2048 }, { 8, 1843, 2048 }, { 7, 1844, 2048 }, { 8, 1845, 2048 }, { 8, 1846, 2048 }, { 9, 1847, 2048 }, + { 7, 1848, 2048 }, { 8, 1849, 2048 }, { 8, 1850, 2048 }, { 9, 1851, 2048 }, { 8, 1852, 2048 }, { 9, 1853, 2048 }, { 9, 1854, 2048 }, { 10, 1855, 2048 }, + { 5, 1856, 2048 }, { 6, 1857, 2048 }, { 6, 1858, 2048 }, { 7, 1859, 2048 }, { 6, 1860, 2048 }, { 7, 1861, 2048 }, { 7, 1862, 2048 }, { 8, 1863, 2048 }, + { 6, 1864, 2048 }, { 7, 1865, 2048 }, { 7, 1866, 2048 }, { 8, 1867, 2048 }, { 7, 1868, 2048 }, { 8, 1869, 2048 }, { 8, 1870, 2048 }, { 9, 1871, 2048 }, + { 6, 1872, 2048 }, { 7, 1873, 2048 }, { 7, 1874, 2048 }, { 8, 1875, 2048 }, { 7, 1876, 2048 }, { 8, 1877, 2048 }, { 8, 1878, 2048 }, { 9, 1879, 2048 }, + { 7, 1880, 2048 }, { 8, 1881, 2048 }, { 8, 1882, 2048 }, { 9, 1883, 2048 }, { 8, 1884, 2048 }, { 9, 1885, 2048 }, { 9, 1886, 2048 }, { 10, 1887, 2048 }, + { 6, 1888, 2048 }, { 7, 1889, 2048 }, { 7, 1890, 2048 }, { 8, 1891, 2048 }, { 7, 1892, 2048 }, { 8, 1893, 2048 }, { 8, 1894, 2048 }, { 9, 1895, 2048 }, + { 7, 1896, 2048 }, { 8, 1897, 2048 }, { 8, 1898, 2048 }, { 9, 1899, 2048 }, { 8, 1900, 2048 }, { 9, 1901, 2048 }, { 9, 1902, 2048 }, { 10, 1903, 2048 }, + { 7, 1904, 2048 }, { 8, 1905, 2048 }, { 8, 1906, 2048 }, { 9, 1907, 2048 }, { 8, 1908, 2048 }, { 9, 1909, 2048 }, { 9, 1910, 2048 }, { 10, 1911, 2048 }, + { 8, 1912, 2048 }, { 9, 1913, 2048 }, { 9, 1914, 2048 }, { 10, 1915, 2048 }, { 9, 1916, 2048 }, { 10, 1917, 2048 }, { 10, 1918, 2048 }, { 11, 1919, 2048 }, + { 5, 1920, 2048 }, { 6, 1921, 2048 }, { 6, 1922, 2048 }, { 7, 1923, 2048 }, { 6, 1924, 2048 }, { 7, 1925, 2048 }, { 7, 1926, 2048 }, { 8, 1927, 2048 }, + { 6, 1928, 2048 }, { 7, 1929, 2048 }, { 7, 1930, 2048 }, { 8, 1931, 2048 }, { 7, 1932, 2048 }, { 8, 1933, 2048 }, { 8, 1934, 2048 }, { 9, 1935, 2048 }, + { 6, 1936, 2048 }, { 7, 1937, 2048 }, { 7, 1938, 2048 }, { 8, 1939, 2048 }, { 7, 1940, 2048 }, { 8, 1941, 2048 }, { 8, 1942, 2048 }, { 9, 1943, 2048 }, + { 7, 1944, 2048 }, { 8, 1945, 2048 }, { 8, 1946, 2048 }, { 9, 1947, 2048 }, { 8, 1948, 2048 }, { 9, 1949, 2048 }, { 9, 1950, 2048 }, { 10, 1951, 2048 }, + { 6, 1952, 2048 }, { 7, 1953, 2048 }, { 7, 1954, 2048 }, { 8, 1955, 2048 }, { 7, 1956, 2048 }, { 8, 1957, 2048 }, { 8, 1958, 2048 }, { 9, 1959, 2048 }, + { 7, 1960, 2048 }, { 8, 1961, 2048 }, { 8, 1962, 2048 }, { 9, 1963, 2048 }, { 8, 1964, 2048 }, { 9, 1965, 2048 }, { 9, 1966, 2048 }, { 10, 1967, 2048 }, + { 7, 1968, 2048 }, { 8, 1969, 2048 }, { 8, 1970, 2048 }, { 9, 1971, 2048 }, { 8, 1972, 2048 }, { 9, 1973, 2048 }, { 9, 1974, 2048 }, { 10, 1975, 2048 }, + { 8, 1976, 2048 }, { 9, 1977, 2048 }, { 9, 1978, 2048 }, { 10, 1979, 2048 }, { 9, 1980, 2048 }, { 10, 1981, 2048 }, { 10, 1982, 2048 }, { 11, 1983, 2048 }, + { 6, 1984, 2048 }, { 7, 1985, 2048 }, { 7, 1986, 2048 }, { 8, 1987, 2048 }, { 7, 1988, 2048 }, { 8, 1989, 2048 }, { 8, 1990, 2048 }, { 9, 1991, 2048 }, + { 7, 1992, 2048 }, { 8, 1993, 2048 }, { 8, 1994, 2048 }, { 9, 1995, 2048 }, { 8, 1996, 2048 }, { 9, 1997, 2048 }, { 9, 1998, 2048 }, { 10, 1999, 2048 }, + { 7, 2000, 2048 }, { 8, 2001, 2048 }, { 8, 2002, 2048 }, { 9, 2003, 2048 }, { 8, 2004, 2048 }, { 9, 2005, 2048 }, { 9, 2006, 2048 }, { 10, 2007, 2048 }, + { 8, 2008, 2048 }, { 9, 2009, 2048 }, { 9, 2010, 2048 }, { 10, 2011, 2048 }, { 9, 2012, 2048 }, { 10, 2013, 2048 }, { 10, 2014, 2048 }, { 11, 2015, 2048 }, + { 7, 2016, 2048 }, { 8, 2017, 2048 }, { 8, 2018, 2048 }, { 9, 2019, 2048 }, { 8, 2020, 2048 }, { 9, 2021, 2048 }, { 9, 2022, 2048 }, { 10, 2023, 2048 }, + { 8, 2024, 2048 }, { 9, 2025, 2048 }, { 9, 2026, 2048 }, { 10, 2027, 2048 }, { 9, 2028, 2048 }, { 10, 2029, 2048 }, { 10, 2030, 2048 }, { 11, 2031, 2048 }, + { 8, 2032, 2048 }, { 9, 2033, 2048 }, { 9, 2034, 2048 }, { 10, 2035, 2048 }, { 9, 2036, 2048 }, { 10, 2037, 2048 }, { 10, 2038, 2048 }, { 11, 2039, 2048 }, + { 9, 2040, 2048 }, { 10, 2041, 2048 }, { 10, 2042, 2048 }, { 11, 2043, 2048 }, { 10, 2044, 2048 }, { 11, 2045, 2048 }, { 11, 2046, 2048 }, { 12, 2047, 2048 }, #endif #endif #endif @@ -614,9 +614,9 @@ static int find_base(ecc_point *g) { int x; for (x = 0; x < FP_ENTRIES; x++) { - if (fp_cache[x].g != NULL && - mp_cmp(fp_cache[x].g->x, g->x) == LTC_MP_EQ && - mp_cmp(fp_cache[x].g->y, g->y) == LTC_MP_EQ && + if (fp_cache[x].g != NULL && + mp_cmp(fp_cache[x].g->x, g->x) == LTC_MP_EQ && + mp_cmp(fp_cache[x].g->y, g->y) == LTC_MP_EQ && mp_cmp(fp_cache[x].g->z, g->z) == LTC_MP_EQ) { break; } @@ -645,7 +645,7 @@ static int add_entry(int idx, ecc_point *g) ltc_ecc_del_point(fp_cache[idx].g); fp_cache[idx].g = NULL; return CRYPT_MEM; - } + } for (x = 0; x < (1U<x, mu, modulus, fp_cache[idx].LUT[1]->x) != CRYPT_OK) || - (mp_mulmod(fp_cache[idx].g->y, mu, modulus, fp_cache[idx].LUT[1]->y) != CRYPT_OK) || + if ((mp_mulmod(fp_cache[idx].g->x, mu, modulus, fp_cache[idx].LUT[1]->x) != CRYPT_OK) || + (mp_mulmod(fp_cache[idx].g->y, mu, modulus, fp_cache[idx].LUT[1]->y) != CRYPT_OK) || (mp_mulmod(fp_cache[idx].g->z, mu, modulus, fp_cache[idx].LUT[1]->z) != CRYPT_OK)) { goto ERR; } - + /* make all single bit entries */ for (x = 1; x < FP_LUT; x++) { - if ((mp_copy(fp_cache[idx].LUT[1<<(x-1)]->x, fp_cache[idx].LUT[1<x) != CRYPT_OK) || - (mp_copy(fp_cache[idx].LUT[1<<(x-1)]->y, fp_cache[idx].LUT[1<y) != CRYPT_OK) || + if ((mp_copy(fp_cache[idx].LUT[1<<(x-1)]->x, fp_cache[idx].LUT[1<x) != CRYPT_OK) || + (mp_copy(fp_cache[idx].LUT[1<<(x-1)]->y, fp_cache[idx].LUT[1<y) != CRYPT_OK) || (mp_copy(fp_cache[idx].LUT[1<<(x-1)]->z, fp_cache[idx].LUT[1<z) != CRYPT_OK)) { goto ERR; } - + /* now double it bitlen/FP_LUT times */ for (y = 0; y < lut_gap; y++) { if ((err = ltc_mp.ecc_ptdbl(fp_cache[idx].LUT[1<z, modulus, mp)) != CRYPT_OK) { goto ERR; } - + /* invert it */ if ((err = mp_invmod(fp_cache[idx].LUT[x]->z, modulus, fp_cache[idx].LUT[x]->z)) != CRYPT_OK) { goto ERR; } /* now square it */ if ((err = mp_sqrmod(fp_cache[idx].LUT[x]->z, modulus, tmp)) != CRYPT_OK) { goto ERR; } - + /* fix x */ if ((err = mp_mulmod(fp_cache[idx].LUT[x]->x, tmp, modulus, fp_cache[idx].LUT[x]->x)) != CRYPT_OK) { goto ERR; } @@ -755,10 +755,10 @@ static int build_lut(int idx, void *modulus, void *mp, void *mu) } mp_clear(tmp); - return CRYPT_OK; + return CRYPT_OK; ERR: err = CRYPT_MEM; -DONE: +DONE: for (y = 0; y < (1U< (sizeof(kb) - 2)) { if (tk != k) { mp_clear(tk); - } + } return CRYPT_BUFFER_OVERFLOW; } - + /* store k */ zeromem(kb, sizeof(kb)); if ((err = mp_to_unsigned_bin(tk, kb)) != CRYPT_OK) { if (tk != k) { mp_clear(tk); - } + } return err; } - + /* let's reverse kb so it's little endian */ x = 0; y = mp_unsigned_bin_size(tk) - 1; if (tk != k) { mp_clear(tk); - } + } while ((unsigned)x < y) { z = kb[x]; kb[x] = kb[y]; kb[y] = z; ++x; --y; - } - + } + /* at this point we can start, yipee */ first = 1; for (x = lut_gap-1; x >= 0; x--) { @@ -867,26 +867,26 @@ static int accel_fp_mul(int idx, void *k, ecc_point *R, void *modulus, void *mp, z |= ((kb[bitpos>>3] >> (bitpos&7)) & 1) << y; bitpos += lut_gap; /* it's y*lut_gap + x, but here we can avoid the mult in each loop */ } - + /* double if not first */ if (!first) { if ((err = ltc_mp.ecc_ptdbl(R, R, modulus, mp)) != CRYPT_OK) { return err; } } - - /* add if not first, otherwise copy */ + + /* add if not first, otherwise copy */ if (!first && z) { if ((err = ltc_mp.ecc_ptadd(R, fp_cache[idx].LUT[z], R, modulus, mp)) != CRYPT_OK) { return err; } } else if (z) { - if ((mp_copy(fp_cache[idx].LUT[z]->x, R->x) != CRYPT_OK) || - (mp_copy(fp_cache[idx].LUT[z]->y, R->y) != CRYPT_OK) || + if ((mp_copy(fp_cache[idx].LUT[z]->x, R->x) != CRYPT_OK) || + (mp_copy(fp_cache[idx].LUT[z]->y, R->y) != CRYPT_OK) || (mp_copy(fp_cache[idx].mu, R->z) != CRYPT_OK)) { return CRYPT_MEM; } - first = 0; + first = 0; } - } + } z = 0; zeromem(kb, sizeof(kb)); /* map R back from projective space */ @@ -900,7 +900,7 @@ static int accel_fp_mul(int idx, void *k, ecc_point *R, void *modulus, void *mp, #ifdef LTC_ECC_SHAMIR /* perform a fixed point ECC mulmod */ -static int accel_fp_mul2add(int idx1, int idx2, +static int accel_fp_mul2add(int idx1, int idx2, void *kA, void *kB, ecc_point *R, void *modulus, void *mp) { @@ -916,13 +916,13 @@ static int accel_fp_mul2add(int idx1, int idx2, for (x = 0; ltc_ecc_sets[x].size; x++) { if (y <= (unsigned)ltc_ecc_sets[x].size) break; } - + /* back off if we are on the 521 bit curve */ if (y == 66) --x; - + if ((err = mp_init(&order)) != CRYPT_OK) { return err; - } + } if ((err = mp_read_radix(order, ltc_ecc_sets[x].order, 16)) != CRYPT_OK) { mp_clear(&order); return err; @@ -945,7 +945,7 @@ static int accel_fp_mul2add(int idx1, int idx2, mp_clear(order); } else { tka = kA; - } + } /* if it's smaller than modulus we fine */ if (mp_unsigned_bin_size(kB) > mp_unsigned_bin_size(modulus)) { @@ -954,13 +954,13 @@ static int accel_fp_mul2add(int idx1, int idx2, for (x = 0; ltc_ecc_sets[x].size; x++) { if (y <= (unsigned)ltc_ecc_sets[x].size) break; } - + /* back off if we are on the 521 bit curve */ if (y == 66) --x; - + if ((err = mp_init(&order)) != CRYPT_OK) { return err; - } + } if ((err = mp_read_radix(order, ltc_ecc_sets[x].order, 16)) != CRYPT_OK) { mp_clear(&order); return err; @@ -983,55 +983,55 @@ static int accel_fp_mul2add(int idx1, int idx2, mp_clear(order); } else { tkb = kB; - } + } /* get bitlen and round up to next multiple of FP_LUT */ bitlen = mp_unsigned_bin_size(modulus) << 3; x = bitlen % FP_LUT; if (x) { bitlen += FP_LUT - x; - } + } lut_gap = bitlen / FP_LUT; - + /* get the k value */ if ((mp_unsigned_bin_size(tka) > (sizeof(kb[0]) - 2)) || (mp_unsigned_bin_size(tkb) > (sizeof(kb[0]) - 2)) ) { if (tka != kA) { mp_clear(tka); - } + } if (tkb != kB) { mp_clear(tkb); - } + } return CRYPT_BUFFER_OVERFLOW; } - + /* store k */ zeromem(kb, sizeof(kb)); if ((err = mp_to_unsigned_bin(tka, kb[0])) != CRYPT_OK) { if (tka != kA) { mp_clear(tka); - } + } if (tkb != kB) { mp_clear(tkb); - } + } return err; } - + /* let's reverse kb so it's little endian */ x = 0; y = mp_unsigned_bin_size(tka) - 1; if (tka != kA) { mp_clear(tka); - } + } while ((unsigned)x < y) { z = kb[0][x]; kb[0][x] = kb[0][y]; kb[0][y] = z; ++x; --y; - } - + } + /* store b */ if ((err = mp_to_unsigned_bin(tkb, kb[1])) != CRYPT_OK) { if (tkb != kB) { mp_clear(tkb); - } + } return err; } @@ -1039,11 +1039,11 @@ static int accel_fp_mul2add(int idx1, int idx2, y = mp_unsigned_bin_size(tkb) - 1; if (tkb != kB) { mp_clear(tkb); - } + } while ((unsigned)x < y) { z = kb[1][x]; kb[1][x] = kb[1][y]; kb[1][y] = z; ++x; --y; - } + } /* at this point we can start, yipee */ first = 1; @@ -1055,15 +1055,15 @@ static int accel_fp_mul2add(int idx1, int idx2, zB |= ((kb[1][bitpos>>3] >> (bitpos&7)) & 1) << y; bitpos += lut_gap; /* it's y*lut_gap + x, but here we can avoid the mult in each loop */ } - + /* double if not first */ if (!first) { if ((err = ltc_mp.ecc_ptdbl(R, R, modulus, mp)) != CRYPT_OK) { return err; } } - - /* add if not first, otherwise copy */ + + /* add if not first, otherwise copy */ if (!first) { if (zA) { if ((err = ltc_mp.ecc_ptadd(R, fp_cache[idx1].LUT[zA], R, modulus, mp)) != CRYPT_OK) { @@ -1077,10 +1077,10 @@ static int accel_fp_mul2add(int idx1, int idx2, } } else { if (zA) { - if ((mp_copy(fp_cache[idx1].LUT[zA]->x, R->x) != CRYPT_OK) || - (mp_copy(fp_cache[idx1].LUT[zA]->y, R->y) != CRYPT_OK) || + if ((mp_copy(fp_cache[idx1].LUT[zA]->x, R->x) != CRYPT_OK) || + (mp_copy(fp_cache[idx1].LUT[zA]->y, R->y) != CRYPT_OK) || (mp_copy(fp_cache[idx1].mu, R->z) != CRYPT_OK)) { return CRYPT_MEM; } - first = 0; + first = 0; } if (zB && first == 0) { if (zB) { @@ -1089,13 +1089,13 @@ static int accel_fp_mul2add(int idx1, int idx2, } } } else if (zB && first == 1) { - if ((mp_copy(fp_cache[idx2].LUT[zB]->x, R->x) != CRYPT_OK) || - (mp_copy(fp_cache[idx2].LUT[zB]->y, R->y) != CRYPT_OK) || + if ((mp_copy(fp_cache[idx2].LUT[zB]->x, R->x) != CRYPT_OK) || + (mp_copy(fp_cache[idx2].LUT[zB]->y, R->y) != CRYPT_OK) || (mp_copy(fp_cache[idx2].mu, R->z) != CRYPT_OK)) { return CRYPT_MEM; } - first = 0; + first = 0; } } - } + } zeromem(kb, sizeof(kb)); return ltc_ecc_map(R, modulus, mp); } @@ -1107,16 +1107,16 @@ static int accel_fp_mul2add(int idx1, int idx2, @param B Second point to multiply @param kB What to multiple B by @param C [out] Destination point (can overlap with A or B) - @param modulus Modulus for curve + @param modulus Modulus for curve @return CRYPT_OK on success -*/ +*/ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, ecc_point *B, void *kB, ecc_point *C, void *modulus) { int idx1, idx2, err; void *mp, *mu; - + mp = NULL; mu = NULL; LTC_MUTEX_LOCK(<c_ecc_fp_lock); @@ -1165,12 +1165,12 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, } if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto LBL_ERR; - } - + } + /* build the LUT */ if ((err = build_lut(idx1, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR;; - } + } } /* if it's 2 build the LUT, if it's higher just use the LUT */ @@ -1185,13 +1185,13 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, } if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto LBL_ERR; - } + } } - + /* build the LUT */ if ((err = build_lut(idx2, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR;; - } + } } @@ -1208,10 +1208,10 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, LTC_MUTEX_UNLOCK(<c_ecc_fp_lock); if (mp != NULL) { mp_montgomery_free(mp); - } + } if (mu != NULL) { mp_clear(mu); - } + } return err; } #endif @@ -1223,12 +1223,12 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, @param modulus The modulus for the curve @param map [boolean] If non-zero maps the point back to affine co-ordinates, otherwise it's left in jacobian-montgomery form @return CRYPT_OK if successful -*/ +*/ int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) { int idx, err; void *mp, *mu; - + mp = NULL; mu = NULL; LTC_MUTEX_LOCK(<c_ecc_fp_lock); @@ -1251,7 +1251,7 @@ int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int ma ++(fp_cache[idx].lru_count); } - + /* if it's 2 build the LUT, if it's higher just use the LUT */ if (idx >= 0 && fp_cache[idx].lru_count == 2) { /* compute mp */ @@ -1263,12 +1263,12 @@ int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int ma } if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto LBL_ERR; - } - + } + /* build the LUT */ if ((err = build_lut(idx, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR;; - } + } } if (idx >= 0 && fp_cache[idx].lru_count >= 2) { @@ -1284,10 +1284,10 @@ int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int ma LTC_MUTEX_UNLOCK(<c_ecc_fp_lock); if (mp != NULL) { mp_montgomery_free(mp); - } + } if (mu != NULL) { mp_clear(mu); - } + } return err; } @@ -1309,9 +1309,9 @@ static void ltc_ecc_fp_free_cache(void) } fp_cache[x].lru_count = 0; fp_cache[x].lock = 0; - } + } } -} +} /** Free the Fixed Point cache */ void ltc_ecc_fp_free(void) @@ -1323,7 +1323,7 @@ void ltc_ecc_fp_free(void) /** Add a point to the cache and initialize the LUT @param g The point to add - @param modulus Modulus for curve + @param modulus Modulus for curve @param lock Flag to indicate if this entry should be locked into the cache or not @return CRYPT_OK on success */ @@ -1362,26 +1362,26 @@ ltc_ecc_fp_add_point(ecc_point *g, void *modulus, int lock) } if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto LBL_ERR; - } - + } + /* build the LUT */ if ((err = build_lut(idx, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR; - } + } fp_cache[idx].lru_count = 2; fp_cache[idx].lock = lock; LBL_ERR: LTC_MUTEX_UNLOCK(<c_ecc_fp_lock); if (mp != NULL) { mp_montgomery_free(mp); - } + } if (mu != NULL) { mp_clear(mu); - } + } return err; } -/** Prevent/permit the FP cache from being updated +/** Prevent/permit the FP cache from being updated @param flag If flag is 0, remove cache lock (unlock), otherwise lock it */ void ltc_ecc_fp_tablelock(int lock) @@ -1416,7 +1416,7 @@ int ltc_ecc_fp_save_state(unsigned char **out, unsigned long *outlen) LTC_MUTEX_LOCK(<c_ecc_fp_lock); /* - * build the list; + * build the list; Cache DEFINITIONS ::= BEGIN CacheDump ::= SEQUENCE { @@ -1426,7 +1426,7 @@ int ltc_ecc_fp_save_state(unsigned char **out, unsigned long *outlen) cache SEQUENCE OF INTEGER } END - * + * */ /* * The cache itself is a point (3 INTEGERS), @@ -1492,7 +1492,7 @@ int ltc_ecc_fp_restore_state(unsigned char *in, unsigned long inlen) LTC_ARGCHK(in != NULL); if (inlen == 0) { return CRYPT_INVALID_ARG; - } + } /* zero indecies */ i = 0; @@ -1512,7 +1512,7 @@ int ltc_ecc_fp_restore_state(unsigned char *in, unsigned long inlen) * * use standard decoding for the first part, then flexible for the second */ - if((err = der_decode_sequence_multi(in, inlen, + if((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_SHORT_INTEGER, 1, &num_entries, LTC_ASN1_SHORT_INTEGER, 1, &fp_entries, LTC_ASN1_SHORT_INTEGER, 1, &fp_lut, @@ -1540,7 +1540,7 @@ int ltc_ecc_fp_restore_state(unsigned char *in, unsigned long inlen) LTC_SET_ASN1(asn1_list, j++, LTC_ASN1_INTEGER, fp_cache[i].g->y, 1); LTC_SET_ASN1(asn1_list, j++, LTC_ASN1_INTEGER, fp_cache[i].g->z, 1); for (x = 0; x < (1U< 512) { + if (len < 2 || len > 512) { return CRYPT_INVALID_PRIME_SIZE; } - + /* valid PRNG? Better be! */ if ((err = prng_is_valid(wprng)) != CRYPT_OK) { - return err; + return err; } /* allocate buffer to work with */ @@ -60,7 +60,7 @@ int rand_prime(void *N, long len, prng_state *prng, int wprng) /* munge bits */ buf[0] |= 0x80 | 0x40; buf[len-1] |= 0x01 | ((type & USE_BBS) ? 0x02 : 0x00); - + /* load value */ if ((err = mp_read_unsigned_bin(N, buf, len)) != CRYPT_OK) { XFREE(buf); @@ -81,7 +81,7 @@ int rand_prime(void *N, long len, prng_state *prng, int wprng) XFREE(buf); return CRYPT_OK; } - + #endif /* LTC_NO_MATH */ diff --git a/src/misc/crypt/crypt_find_cipher_any.c b/src/misc/crypt/crypt_find_cipher_any.c index c528e6e6d..34cd8f008 100644 --- a/src/misc/crypt/crypt_find_cipher_any.c +++ b/src/misc/crypt/crypt_find_cipher_any.c @@ -16,7 +16,7 @@ */ /** - Find a cipher flexibly. First by name then if not present by block and key size + Find a cipher flexibly. First by name then if not present by block and key size @param name The name of the cipher desired @param blocklen The minimum length of the block cipher desired (octets) @param keylen The minimum length of the key size desired (octets) diff --git a/src/misc/crypt/crypt_find_hash_any.c b/src/misc/crypt/crypt_find_hash_any.c index 65ecce792..777ce0877 100644 --- a/src/misc/crypt/crypt_find_hash_any.c +++ b/src/misc/crypt/crypt_find_hash_any.c @@ -16,7 +16,7 @@ */ /** - Find a hash flexibly. First by name then if not present by digest size + Find a hash flexibly. First by name then if not present by digest size @param name The name of the hash desired @param digestlen The minimum length of the digest size (octets) @return >= 0 if found, -1 if not present diff --git a/src/misc/crypt/crypt_fsa.c b/src/misc/crypt/crypt_fsa.c index 9960ec9a9..e177f9aaa 100644 --- a/src/misc/crypt/crypt_fsa.c +++ b/src/misc/crypt/crypt_fsa.c @@ -14,7 +14,7 @@ /** @file crypt_fsa.c LibTomCrypt FULL SPEED AHEAD!, Tom St Denis -*/ +*/ /* format is ltc_mp, cipher_desc, [cipher_desc], NULL, hash_desc, [hash_desc], NULL, prng_desc, [prng_desc], NULL */ int crypt_fsa(void *mp, ...) @@ -26,7 +26,7 @@ int crypt_fsa(void *mp, ...) if (mp != NULL) { XMEMCPY(<c_mp, mp, sizeof(ltc_mp)); } - + while ((p = va_arg(args, void*)) != NULL) { if (register_cipher(p) == -1) { va_end(args); @@ -49,7 +49,7 @@ int crypt_fsa(void *mp, ...) } va_end(args); - return CRYPT_OK; + return CRYPT_OK; } diff --git a/src/misc/crypt/crypt_hash_descriptor.c b/src/misc/crypt/crypt_hash_descriptor.c index a0c3c1a4f..4e8bce1f9 100644 --- a/src/misc/crypt/crypt_hash_descriptor.c +++ b/src/misc/crypt/crypt_hash_descriptor.c @@ -12,7 +12,7 @@ /** @file crypt_hash_descriptor.c - Stores the hash descriptor table, Tom St Denis + Stores the hash descriptor table, Tom St Denis */ struct ltc_hash_descriptor hash_descriptor[TAB_SIZE] = { diff --git a/src/misc/crypt/crypt_hash_is_valid.c b/src/misc/crypt/crypt_hash_is_valid.c index 011f829a5..dbab714e4 100644 --- a/src/misc/crypt/crypt_hash_is_valid.c +++ b/src/misc/crypt/crypt_hash_is_valid.c @@ -13,7 +13,7 @@ /** @file crypt_hash_is_valid.c Determine if hash is valid, Tom St Denis -*/ +*/ /* Test if a hash index is valid diff --git a/src/misc/crypt/crypt_prng_descriptor.c b/src/misc/crypt/crypt_prng_descriptor.c index 3af9df542..926f3bb68 100644 --- a/src/misc/crypt/crypt_prng_descriptor.c +++ b/src/misc/crypt/crypt_prng_descriptor.c @@ -13,7 +13,7 @@ /** @file crypt_prng_descriptor.c Stores the PRNG descriptors, Tom St Denis -*/ +*/ struct ltc_prng_descriptor prng_descriptor[TAB_SIZE] = { { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; diff --git a/src/misc/crypt/crypt_register_prng.c b/src/misc/crypt/crypt_register_prng.c index 1724df0a0..faebb180b 100644 --- a/src/misc/crypt/crypt_register_prng.c +++ b/src/misc/crypt/crypt_register_prng.c @@ -14,7 +14,7 @@ @file crypt_register_prng.c Register a PRNG, Tom St Denis */ - + /** Register a PRNG with the descriptor table @param prng The PRNG you wish to register diff --git a/src/misc/error_to_string.c b/src/misc/error_to_string.c index 7ebd89879..2ca14923e 100644 --- a/src/misc/error_to_string.c +++ b/src/misc/error_to_string.c @@ -68,7 +68,7 @@ const char *error_to_string(int err) return "Invalid error code."; } else { return err_2_str[err]; - } + } } diff --git a/src/modes/cbc/cbc_done.c b/src/modes/cbc/cbc_done.c index 75b974237..48249404f 100644 --- a/src/modes/cbc/cbc_done.c +++ b/src/modes/cbc/cbc_done.c @@ -33,7 +33,7 @@ int cbc_done(symmetric_CBC *cbc) return CRYPT_OK; } - + #endif diff --git a/src/modes/cbc/cbc_setiv.c b/src/modes/cbc/cbc_setiv.c index cd2e32eaa..3d0209369 100644 --- a/src/modes/cbc/cbc_setiv.c +++ b/src/modes/cbc/cbc_setiv.c @@ -36,7 +36,7 @@ int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc) return CRYPT_OK; } -#endif +#endif /* $Source$ */ diff --git a/src/modes/cbc/cbc_start.c b/src/modes/cbc/cbc_start.c index 832e77afa..71b6fa834 100644 --- a/src/modes/cbc/cbc_start.c +++ b/src/modes/cbc/cbc_start.c @@ -21,17 +21,17 @@ Initialize a CBC context @param cipher The index of the cipher desired @param IV The initial vector - @param key The secret key + @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) @param cbc The CBC state to initialize @return CRYPT_OK if successful */ -int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, +int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, int keylen, int num_rounds, symmetric_CBC *cbc) { int x, err; - + LTC_ARGCHK(IV != NULL); LTC_ARGCHK(key != NULL); LTC_ARGCHK(cbc != NULL); diff --git a/src/modes/cfb/cfb_decrypt.c b/src/modes/cfb/cfb_decrypt.c index 13ac5a698..0c08c7454 100644 --- a/src/modes/cfb/cfb_decrypt.c +++ b/src/modes/cfb/cfb_decrypt.c @@ -52,7 +52,7 @@ int cfb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s } cfb->pad[cfb->padlen] = *ct; *pt = *ct ^ cfb->IV[cfb->padlen]; - ++pt; + ++pt; ++ct; ++(cfb->padlen); } diff --git a/src/modes/cfb/cfb_done.c b/src/modes/cfb/cfb_done.c index 1ee9a9800..bacfa2872 100644 --- a/src/modes/cfb/cfb_done.c +++ b/src/modes/cfb/cfb_done.c @@ -33,7 +33,7 @@ int cfb_done(symmetric_CFB *cfb) return CRYPT_OK; } - + #endif diff --git a/src/modes/cfb/cfb_encrypt.c b/src/modes/cfb/cfb_encrypt.c index 8ac5f5c06..e76214303 100644 --- a/src/modes/cfb/cfb_encrypt.c +++ b/src/modes/cfb/cfb_encrypt.c @@ -51,7 +51,7 @@ int cfb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s cfb->padlen = 0; } cfb->pad[cfb->padlen] = (*ct = *pt ^ cfb->IV[cfb->padlen]); - ++pt; + ++pt; ++ct; ++(cfb->padlen); } diff --git a/src/modes/cfb/cfb_setiv.c b/src/modes/cfb/cfb_setiv.c index 0fc87573d..4a221100a 100644 --- a/src/modes/cfb/cfb_setiv.c +++ b/src/modes/cfb/cfb_setiv.c @@ -13,7 +13,7 @@ /** @file cfb_setiv.c CFB implementation, set IV, Tom St Denis -*/ +*/ #ifdef LTC_CFB_MODE @@ -27,24 +27,24 @@ int cfb_setiv(const unsigned char *IV, unsigned long len, symmetric_CFB *cfb) { int err; - + LTC_ARGCHK(IV != NULL); LTC_ARGCHK(cfb != NULL); if ((err = cipher_is_valid(cfb->cipher)) != CRYPT_OK) { return err; } - + if (len != (unsigned long)cfb->blocklen) { return CRYPT_INVALID_ARG; } - + /* force next block */ cfb->padlen = 0; return cipher_descriptor[cfb->cipher].ecb_encrypt(IV, cfb->IV, &cfb->key); } -#endif +#endif /* $Source$ */ diff --git a/src/modes/cfb/cfb_start.c b/src/modes/cfb/cfb_start.c index a8e5b8bc6..b42c97f84 100644 --- a/src/modes/cfb/cfb_start.c +++ b/src/modes/cfb/cfb_start.c @@ -22,13 +22,13 @@ Initialize a CFB context @param cipher The index of the cipher desired @param IV The initial vector - @param key The secret key + @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) @param cfb The CFB state to initialize @return CRYPT_OK if successful */ -int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, +int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, int keylen, int num_rounds, symmetric_CFB *cfb) { int x, err; @@ -40,7 +40,7 @@ int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { return err; } - + /* copy data */ cfb->cipher = cipher; diff --git a/src/modes/ctr/ctr_done.c b/src/modes/ctr/ctr_done.c index 26391fdfa..77d888bdd 100644 --- a/src/modes/ctr/ctr_done.c +++ b/src/modes/ctr/ctr_done.c @@ -33,7 +33,7 @@ int ctr_done(symmetric_CTR *ctr) return CRYPT_OK; } - + #endif diff --git a/src/modes/ctr/ctr_setiv.c b/src/modes/ctr/ctr_setiv.c index 56a3c9793..50c653987 100644 --- a/src/modes/ctr/ctr_setiv.c +++ b/src/modes/ctr/ctr_setiv.c @@ -14,7 +14,7 @@ @file ctr_setiv.c CTR implementation, set IV, Tom St Denis */ - + #ifdef LTC_CTR_MODE /** @@ -27,7 +27,7 @@ int ctr_setiv(const unsigned char *IV, unsigned long len, symmetric_CTR *ctr) { int err; - + LTC_ARGCHK(IV != NULL); LTC_ARGCHK(ctr != NULL); @@ -35,20 +35,20 @@ int ctr_setiv(const unsigned char *IV, unsigned long len, symmetric_CTR *ctr) if ((err = cipher_is_valid(ctr->cipher)) != CRYPT_OK) { return err; } - + if (len != (unsigned long)ctr->blocklen) { return CRYPT_INVALID_ARG; } /* set IV */ XMEMCPY(ctr->ctr, IV, len); - + /* force next block */ ctr->padlen = 0; return cipher_descriptor[ctr->cipher].ecb_encrypt(IV, ctr->pad, &ctr->key); } -#endif +#endif /* $Source$ */ diff --git a/src/modes/ctr/ctr_start.c b/src/modes/ctr/ctr_start.c index b27bed03b..8544636a7 100644 --- a/src/modes/ctr/ctr_start.c +++ b/src/modes/ctr/ctr_start.c @@ -22,16 +22,16 @@ Initialize a CTR context @param cipher The index of the cipher desired @param IV The initial vector - @param key The secret key + @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) @param ctr_mode The counter mode (CTR_COUNTER_LITTLE_ENDIAN or CTR_COUNTER_BIG_ENDIAN) @param ctr The CTR state to initialize @return CRYPT_OK if successful */ -int ctr_start( int cipher, - const unsigned char *IV, - const unsigned char *key, int keylen, +int ctr_start( int cipher, + const unsigned char *IV, + const unsigned char *key, int keylen, int num_rounds, int ctr_mode, symmetric_CTR *ctr) { @@ -91,7 +91,7 @@ int ctr_start( int cipher, } } - return cipher_descriptor[ctr->cipher].ecb_encrypt(ctr->ctr, ctr->pad, &ctr->key); + return cipher_descriptor[ctr->cipher].ecb_encrypt(ctr->ctr, ctr->pad, &ctr->key); } #endif diff --git a/src/modes/ctr/ctr_test.c b/src/modes/ctr/ctr_test.c index 9962afd5a..6c97174f2 100644 --- a/src/modes/ctr/ctr_test.c +++ b/src/modes/ctr/ctr_test.c @@ -52,7 +52,7 @@ int ctr_test(void) unsigned char buf[64]; symmetric_CTR ctr; - /* AES can be under rijndael or aes... try to find it */ + /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { if ((idx = find_cipher("rijndael")) == -1) { return CRYPT_NOP; diff --git a/src/modes/ecb/ecb_done.c b/src/modes/ecb/ecb_done.c index 961ec97be..9199eaeea 100644 --- a/src/modes/ecb/ecb_done.c +++ b/src/modes/ecb/ecb_done.c @@ -33,7 +33,7 @@ int ecb_done(symmetric_ECB *ecb) return CRYPT_OK; } - + #endif diff --git a/src/modes/ecb/ecb_start.c b/src/modes/ecb/ecb_start.c index cec583a05..67061cae1 100644 --- a/src/modes/ecb/ecb_start.c +++ b/src/modes/ecb/ecb_start.c @@ -21,7 +21,7 @@ /** Initialize a ECB context @param cipher The index of the cipher desired - @param key The secret key + @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) @param ecb The ECB state to initialize diff --git a/src/modes/f8/f8_decrypt.c b/src/modes/f8/f8_decrypt.c index 9c4525d36..6279eee05 100644 --- a/src/modes/f8/f8_decrypt.c +++ b/src/modes/f8/f8_decrypt.c @@ -36,7 +36,7 @@ int f8_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, sy #endif - + /* $Source$ */ /* $Revision$ */ diff --git a/src/modes/f8/f8_done.c b/src/modes/f8/f8_done.c index 867d6032e..6173a0a8c 100644 --- a/src/modes/f8/f8_done.c +++ b/src/modes/f8/f8_done.c @@ -33,7 +33,7 @@ int f8_done(symmetric_F8 *f8) return CRYPT_OK; } - + #endif diff --git a/src/modes/f8/f8_setiv.c b/src/modes/f8/f8_setiv.c index d1cafcf06..5d2cb88c7 100644 --- a/src/modes/f8/f8_setiv.c +++ b/src/modes/f8/f8_setiv.c @@ -44,7 +44,7 @@ int f8_setiv(const unsigned char *IV, unsigned long len, symmetric_F8 *f8) return cipher_descriptor[f8->cipher].ecb_encrypt(IV, f8->IV, &f8->key); } -#endif +#endif /* $Source$ */ diff --git a/src/modes/f8/f8_start.c b/src/modes/f8/f8_start.c index 4cd58de2c..f4543673d 100644 --- a/src/modes/f8/f8_start.c +++ b/src/modes/f8/f8_start.c @@ -22,7 +22,7 @@ Initialize an F8 context @param cipher The index of the cipher desired @param IV The initial vector - @param key The secret key + @param key The secret key @param keylen The length of the secret key (octets) @param salt_key The salting key for the IV @param skeylen The length of the salting key (octets) @@ -30,8 +30,8 @@ @param f8 The F8 state to initialize @return CRYPT_OK if successful */ -int f8_start( int cipher, const unsigned char *IV, - const unsigned char *key, int keylen, +int f8_start( int cipher, const unsigned char *IV, + const unsigned char *key, int keylen, const unsigned char *salt_key, int skeylen, int num_rounds, symmetric_F8 *f8) { @@ -58,7 +58,7 @@ int f8_start( int cipher, const unsigned char *IV, f8->cipher = cipher; f8->blocklen = cipher_descriptor[cipher].block_length; f8->padlen = f8->blocklen; - + /* now get key ^ salt_key [extend salt_ket with 0x55 as required to match length] */ zeromem(tkey, sizeof(tkey)); for (x = 0; x < keylen && x < (int)sizeof(tkey); x++) { @@ -66,16 +66,16 @@ int f8_start( int cipher, const unsigned char *IV, } for (x = 0; x < skeylen && x < (int)sizeof(tkey); x++) { tkey[x] ^= salt_key[x]; - } + } for (; x < keylen && x < (int)sizeof(tkey); x++) { tkey[x] ^= 0x55; } - + /* now encrypt with tkey[0..keylen-1] the IV and use that as the IV */ if ((err = cipher_descriptor[cipher].setup(tkey, keylen, num_rounds, &f8->key)) != CRYPT_OK) { return err; } - + /* encrypt IV */ if ((err = cipher_descriptor[f8->cipher].ecb_encrypt(IV, f8->MIV, &f8->key)) != CRYPT_OK) { cipher_descriptor[f8->cipher].done(&f8->key); @@ -83,10 +83,10 @@ int f8_start( int cipher, const unsigned char *IV, } zeromem(tkey, sizeof(tkey)); zeromem(f8->IV, sizeof(f8->IV)); - + /* terminate this cipher */ cipher_descriptor[f8->cipher].done(&f8->key); - + /* init the cipher */ return cipher_descriptor[cipher].setup(key, keylen, num_rounds, &f8->key); } diff --git a/src/modes/f8/f8_test_mode.c b/src/modes/f8/f8_test_mode.c index 5cc391bc1..39f549661 100644 --- a/src/modes/f8/f8_test_mode.c +++ b/src/modes/f8/f8_test_mode.c @@ -23,36 +23,36 @@ int f8_test_mode(void) #ifndef LTC_TEST return CRYPT_NOP; #else - static const unsigned char key[16] = { 0x23, 0x48, 0x29, 0x00, 0x84, 0x67, 0xbe, 0x18, + static const unsigned char key[16] = { 0x23, 0x48, 0x29, 0x00, 0x84, 0x67, 0xbe, 0x18, 0x6c, 0x3d, 0xe1, 0x4a, 0xae, 0x72, 0xd6, 0x2c }; static const unsigned char salt[4] = { 0x32, 0xf2, 0x87, 0x0d }; - static const unsigned char IV[16] = { 0x00, 0x6e, 0x5c, 0xba, 0x50, 0x68, 0x1d, 0xe5, + static const unsigned char IV[16] = { 0x00, 0x6e, 0x5c, 0xba, 0x50, 0x68, 0x1d, 0xe5, 0x5c, 0x62, 0x15, 0x99, 0xd4, 0x62, 0x56, 0x4a }; - static const unsigned char pt[39] = { 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x72, 0x61, + static const unsigned char pt[39] = { 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x6e, 0x65, 0x73, 0x73, - 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x20, 0x62, 0x65, 0x73, 0x74, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67 }; - static const unsigned char ct[39] = { 0x01, 0x9c, 0xe7, 0xa2, 0x6e, 0x78, 0x54, 0x01, + static const unsigned char ct[39] = { 0x01, 0x9c, 0xe7, 0xa2, 0x6e, 0x78, 0x54, 0x01, 0x4a, 0x63, 0x66, 0xaa, 0x95, 0xd4, 0xee, 0xfd, - 0x1a, 0xd4, 0x17, 0x2a, 0x14, 0xf9, 0xfa, 0xf4, + 0x1a, 0xd4, 0x17, 0x2a, 0x14, 0xf9, 0xfa, 0xf4, 0x55, 0xb7, 0xf1, 0xd4, 0xb6, 0x2b, 0xd0, 0x8f, 0x56, 0x2c, 0x0e, 0xef, 0x7c, 0x48, 0x02 }; unsigned char buf[39]; symmetric_F8 f8; int err, idx; - + idx = find_cipher("aes"); if (idx == -1) { idx = find_cipher("rijndael"); if (idx == -1) return CRYPT_NOP; - } - + } + /* initialize the context */ if ((err = f8_start(idx, IV, key, sizeof(key), salt, sizeof(salt), 0, &f8)) != CRYPT_OK) { return err; } - + /* encrypt block */ if ((err = f8_encrypt(pt, buf, sizeof(pt), &f8)) != CRYPT_OK) { f8_done(&f8); @@ -63,11 +63,11 @@ int f8_test_mode(void) /* compare */ if (XMEMCMP(buf, ct, sizeof(ct))) { return CRYPT_FAIL_TESTVECTOR; - } - + } + return CRYPT_OK; -#endif -} +#endif +} #endif diff --git a/src/modes/lrw/lrw_done.c b/src/modes/lrw/lrw_done.c index e123d28f3..ce51f636a 100644 --- a/src/modes/lrw/lrw_done.c +++ b/src/modes/lrw/lrw_done.c @@ -22,12 +22,12 @@ @param lrw The state to terminate @return CRYPT_OK if successful */ -int lrw_done(symmetric_LRW *lrw) +int lrw_done(symmetric_LRW *lrw) { int err; LTC_ARGCHK(lrw != NULL); - + if ((err = cipher_is_valid(lrw->cipher)) != CRYPT_OK) { return err; } diff --git a/src/modes/lrw/lrw_encrypt.c b/src/modes/lrw/lrw_encrypt.c index d84cbdd92..16833309f 100644 --- a/src/modes/lrw/lrw_encrypt.c +++ b/src/modes/lrw/lrw_encrypt.c @@ -16,7 +16,7 @@ */ #ifdef LTC_LRW_MODE - + /** LRW encrypt blocks @param pt The plaintext diff --git a/src/modes/lrw/lrw_start.c b/src/modes/lrw/lrw_start.c index 64014d2c8..fc052db71 100644 --- a/src/modes/lrw/lrw_start.c +++ b/src/modes/lrw/lrw_start.c @@ -19,9 +19,9 @@ /** Initialize the LRW context - @param cipher The cipher desired, must be a 128-bit block cipher + @param cipher The cipher desired, must be a 128-bit block cipher @param IV The index value, must be 128-bits - @param key The cipher key + @param key The cipher key @param keylen The length of the cipher key in octets @param tweak The tweak value (second key), must be 128-bits @param num_rounds The number of rounds for the cipher (0 == default) @@ -32,7 +32,7 @@ int lrw_start( int cipher, const unsigned char *IV, const unsigned char *key, int keylen, const unsigned char *tweak, - int num_rounds, + int num_rounds, symmetric_LRW *lrw) { int err; diff --git a/src/modes/lrw/lrw_test.c b/src/modes/lrw/lrw_test.c index 2c9e0762a..0abde9877 100644 --- a/src/modes/lrw/lrw_test.c +++ b/src/modes/lrw/lrw_test.c @@ -105,7 +105,7 @@ int lrw_test(void) } /* process block */ - if ((err = lrw_setiv(tests[x].IV, 16, &lrw)) != CRYPT_OK) { + if ((err = lrw_setiv(tests[x].IV, 16, &lrw)) != CRYPT_OK) { lrw_done(&lrw); return err; } diff --git a/src/modes/ofb/ofb_decrypt.c b/src/modes/ofb/ofb_decrypt.c index 2c8780ef5..b741887a3 100644 --- a/src/modes/ofb/ofb_decrypt.c +++ b/src/modes/ofb/ofb_decrypt.c @@ -36,7 +36,7 @@ int ofb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s #endif - + /* $Source$ */ /* $Revision$ */ diff --git a/src/modes/ofb/ofb_done.c b/src/modes/ofb/ofb_done.c index 10506b39b..412b4d1f7 100644 --- a/src/modes/ofb/ofb_done.c +++ b/src/modes/ofb/ofb_done.c @@ -33,7 +33,7 @@ int ofb_done(symmetric_OFB *ofb) return CRYPT_OK; } - + #endif diff --git a/src/modes/ofb/ofb_encrypt.c b/src/modes/ofb/ofb_encrypt.c index 8c97a4d08..f32fd3941 100644 --- a/src/modes/ofb/ofb_encrypt.c +++ b/src/modes/ofb/ofb_encrypt.c @@ -34,13 +34,13 @@ int ofb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s if ((err = cipher_is_valid(ofb->cipher)) != CRYPT_OK) { return err; } - + /* is blocklen/padlen valid? */ if (ofb->blocklen < 0 || ofb->blocklen > (int)sizeof(ofb->IV) || ofb->padlen < 0 || ofb->padlen > (int)sizeof(ofb->IV)) { return CRYPT_INVALID_ARG; } - + while (len-- > 0) { if (ofb->padlen == ofb->blocklen) { if ((err = cipher_descriptor[ofb->cipher].ecb_encrypt(ofb->IV, ofb->IV, &ofb->key)) != CRYPT_OK) { diff --git a/src/modes/ofb/ofb_setiv.c b/src/modes/ofb/ofb_setiv.c index 826caa900..77a96add9 100644 --- a/src/modes/ofb/ofb_setiv.c +++ b/src/modes/ofb/ofb_setiv.c @@ -44,7 +44,7 @@ int ofb_setiv(const unsigned char *IV, unsigned long len, symmetric_OFB *ofb) return cipher_descriptor[ofb->cipher].ecb_encrypt(IV, ofb->IV, &ofb->key); } -#endif +#endif /* $Source$ */ diff --git a/src/modes/ofb/ofb_start.c b/src/modes/ofb/ofb_start.c index cf875456f..f701d69af 100644 --- a/src/modes/ofb/ofb_start.c +++ b/src/modes/ofb/ofb_start.c @@ -22,13 +22,13 @@ Initialize a OFB context @param cipher The index of the cipher desired @param IV The initial vector - @param key The secret key + @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) @param ofb The OFB state to initialize @return CRYPT_OK if successful */ -int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, +int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, int keylen, int num_rounds, symmetric_OFB *ofb) { int x, err; diff --git a/src/pk/asn1/der/bit/der_decode_bit_string.c b/src/pk/asn1/der/bit/der_decode_bit_string.c index d27af9f3f..05d19cb64 100644 --- a/src/pk/asn1/der/bit/der_decode_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_bit_string.c @@ -67,7 +67,7 @@ int der_decode_bit_string(const unsigned char *in, unsigned long inlen, /* short format */ dlen = in[x++] & 0x7F; } - + /* is the data len too long or too short? */ if ((dlen == 0) || (dlen + x > inlen)) { return CRYPT_INVALID_PACKET; diff --git a/src/pk/asn1/der/bit/der_length_bit_string.c b/src/pk/asn1/der/bit/der_length_bit_string.c index 3ec5f5870..45472e9e1 100644 --- a/src/pk/asn1/der/bit/der_length_bit_string.c +++ b/src/pk/asn1/der/bit/der_length_bit_string.c @@ -17,7 +17,7 @@ #ifdef LTC_DER /** - Gets length of DER encoding of BIT STRING + Gets length of DER encoding of BIT STRING @param nbits The number of bits in the string to encode @param outlen [out] The length of the DER encoding for the given string @return CRYPT_OK if successful @@ -29,7 +29,7 @@ int der_length_bit_string(unsigned long nbits, unsigned long *outlen) /* get the number of the bytes */ nbytes = (nbits >> 3) + ((nbits & 7) ? 1 : 0) + 1; - + if (nbytes < 128) { /* 03 LL PP DD DD DD ... */ *outlen = 2 + nbytes; diff --git a/src/pk/asn1/der/boolean/der_decode_boolean.c b/src/pk/asn1/der/boolean/der_decode_boolean.c index 874622fc7..4e25012a6 100644 --- a/src/pk/asn1/der/boolean/der_decode_boolean.c +++ b/src/pk/asn1/der/boolean/der_decode_boolean.c @@ -30,13 +30,13 @@ int der_decode_boolean(const unsigned char *in, unsigned long inlen, { LTC_ARGCHK(in != NULL); LTC_ARGCHK(out != NULL); - + if (inlen < 3 || in[0] != 0x01 || in[1] != 0x01 || (in[2] != 0x00 && in[2] != 0xFF)) { return CRYPT_INVALID_ARG; } - + *out = (in[2]==0xFF) ? 1 : 0; - + return CRYPT_OK; } diff --git a/src/pk/asn1/der/boolean/der_encode_boolean.c b/src/pk/asn1/der/boolean/der_encode_boolean.c index b40fae614..48e9090ec 100644 --- a/src/pk/asn1/der/boolean/der_encode_boolean.c +++ b/src/pk/asn1/der/boolean/der_encode_boolean.c @@ -25,22 +25,22 @@ @param outlen [in/out] The max size and resulting size of the DER BOOLEAN @return CRYPT_OK if successful */ -int der_encode_boolean(int in, +int der_encode_boolean(int in, unsigned char *out, unsigned long *outlen) { LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(out != NULL); - + if (*outlen < 3) { *outlen = 3; return CRYPT_BUFFER_OVERFLOW; } - + *outlen = 3; out[0] = 0x01; out[1] = 0x01; out[2] = in ? 0xFF : 0x00; - + return CRYPT_OK; } diff --git a/src/pk/asn1/der/boolean/der_length_boolean.c b/src/pk/asn1/der/boolean/der_length_boolean.c index 543703152..fa1906449 100644 --- a/src/pk/asn1/der/boolean/der_length_boolean.c +++ b/src/pk/asn1/der/boolean/der_length_boolean.c @@ -17,7 +17,7 @@ #ifdef LTC_DER /** - Gets length of DER encoding of a BOOLEAN + Gets length of DER encoding of a BOOLEAN @param outlen [out] The length of the DER encoding @return CRYPT_OK if successful */ diff --git a/src/pk/asn1/der/ia5/der_decode_ia5_string.c b/src/pk/asn1/der/ia5/der_decode_ia5_string.c index 1880ada64..4699e3110 100644 --- a/src/pk/asn1/der/ia5/der_decode_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_decode_ia5_string.c @@ -88,7 +88,7 @@ int der_decode_ia5_string(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } - + #endif /* $Source$ */ diff --git a/src/pk/asn1/der/ia5/der_encode_ia5_string.c b/src/pk/asn1/der/ia5/der_encode_ia5_string.c index 6009dbc98..42b3f58e0 100644 --- a/src/pk/asn1/der/ia5/der_encode_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_encode_ia5_string.c @@ -37,7 +37,7 @@ int der_encode_ia5_string(const unsigned char *in, unsigned long inlen, /* get the size */ if ((err = der_length_ia5_string(in, inlen, &len)) != CRYPT_OK) { - return err; + return err; } /* too big? */ diff --git a/src/pk/asn1/der/ia5/der_length_ia5_string.c b/src/pk/asn1/der/ia5/der_length_ia5_string.c index f10c1b849..04debaf07 100644 --- a/src/pk/asn1/der/ia5/der_length_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_length_ia5_string.c @@ -21,106 +21,106 @@ static const struct { int code, value; } ia5_table[] = { { '\0', 0 }, -{ '\a', 7 }, -{ '\b', 8 }, -{ '\t', 9 }, -{ '\n', 10 }, -{ '\f', 12 }, -{ '\r', 13 }, -{ ' ', 32 }, -{ '!', 33 }, -{ '"', 34 }, -{ '#', 35 }, -{ '$', 36 }, -{ '%', 37 }, -{ '&', 38 }, -{ '\'', 39 }, -{ '(', 40 }, -{ ')', 41 }, -{ '*', 42 }, -{ '+', 43 }, -{ ',', 44 }, -{ '-', 45 }, -{ '.', 46 }, -{ '/', 47 }, -{ '0', 48 }, -{ '1', 49 }, -{ '2', 50 }, -{ '3', 51 }, -{ '4', 52 }, -{ '5', 53 }, -{ '6', 54 }, -{ '7', 55 }, -{ '8', 56 }, -{ '9', 57 }, -{ ':', 58 }, -{ ';', 59 }, -{ '<', 60 }, -{ '=', 61 }, -{ '>', 62 }, -{ '?', 63 }, -{ '@', 64 }, -{ 'A', 65 }, -{ 'B', 66 }, -{ 'C', 67 }, -{ 'D', 68 }, -{ 'E', 69 }, -{ 'F', 70 }, -{ 'G', 71 }, -{ 'H', 72 }, -{ 'I', 73 }, -{ 'J', 74 }, -{ 'K', 75 }, -{ 'L', 76 }, -{ 'M', 77 }, -{ 'N', 78 }, -{ 'O', 79 }, -{ 'P', 80 }, -{ 'Q', 81 }, -{ 'R', 82 }, -{ 'S', 83 }, -{ 'T', 84 }, -{ 'U', 85 }, -{ 'V', 86 }, -{ 'W', 87 }, -{ 'X', 88 }, -{ 'Y', 89 }, -{ 'Z', 90 }, -{ '[', 91 }, -{ '\\', 92 }, -{ ']', 93 }, -{ '^', 94 }, -{ '_', 95 }, -{ '`', 96 }, -{ 'a', 97 }, -{ 'b', 98 }, -{ 'c', 99 }, -{ 'd', 100 }, -{ 'e', 101 }, -{ 'f', 102 }, -{ 'g', 103 }, -{ 'h', 104 }, -{ 'i', 105 }, -{ 'j', 106 }, -{ 'k', 107 }, -{ 'l', 108 }, -{ 'm', 109 }, -{ 'n', 110 }, -{ 'o', 111 }, -{ 'p', 112 }, -{ 'q', 113 }, -{ 'r', 114 }, -{ 's', 115 }, -{ 't', 116 }, -{ 'u', 117 }, -{ 'v', 118 }, -{ 'w', 119 }, -{ 'x', 120 }, -{ 'y', 121 }, -{ 'z', 122 }, -{ '{', 123 }, -{ '|', 124 }, -{ '}', 125 }, +{ '\a', 7 }, +{ '\b', 8 }, +{ '\t', 9 }, +{ '\n', 10 }, +{ '\f', 12 }, +{ '\r', 13 }, +{ ' ', 32 }, +{ '!', 33 }, +{ '"', 34 }, +{ '#', 35 }, +{ '$', 36 }, +{ '%', 37 }, +{ '&', 38 }, +{ '\'', 39 }, +{ '(', 40 }, +{ ')', 41 }, +{ '*', 42 }, +{ '+', 43 }, +{ ',', 44 }, +{ '-', 45 }, +{ '.', 46 }, +{ '/', 47 }, +{ '0', 48 }, +{ '1', 49 }, +{ '2', 50 }, +{ '3', 51 }, +{ '4', 52 }, +{ '5', 53 }, +{ '6', 54 }, +{ '7', 55 }, +{ '8', 56 }, +{ '9', 57 }, +{ ':', 58 }, +{ ';', 59 }, +{ '<', 60 }, +{ '=', 61 }, +{ '>', 62 }, +{ '?', 63 }, +{ '@', 64 }, +{ 'A', 65 }, +{ 'B', 66 }, +{ 'C', 67 }, +{ 'D', 68 }, +{ 'E', 69 }, +{ 'F', 70 }, +{ 'G', 71 }, +{ 'H', 72 }, +{ 'I', 73 }, +{ 'J', 74 }, +{ 'K', 75 }, +{ 'L', 76 }, +{ 'M', 77 }, +{ 'N', 78 }, +{ 'O', 79 }, +{ 'P', 80 }, +{ 'Q', 81 }, +{ 'R', 82 }, +{ 'S', 83 }, +{ 'T', 84 }, +{ 'U', 85 }, +{ 'V', 86 }, +{ 'W', 87 }, +{ 'X', 88 }, +{ 'Y', 89 }, +{ 'Z', 90 }, +{ '[', 91 }, +{ '\\', 92 }, +{ ']', 93 }, +{ '^', 94 }, +{ '_', 95 }, +{ '`', 96 }, +{ 'a', 97 }, +{ 'b', 98 }, +{ 'c', 99 }, +{ 'd', 100 }, +{ 'e', 101 }, +{ 'f', 102 }, +{ 'g', 103 }, +{ 'h', 104 }, +{ 'i', 105 }, +{ 'j', 106 }, +{ 'k', 107 }, +{ 'l', 108 }, +{ 'm', 109 }, +{ 'n', 110 }, +{ 'o', 111 }, +{ 'p', 112 }, +{ 'q', 113 }, +{ 'r', 114 }, +{ 's', 115 }, +{ 't', 116 }, +{ 'u', 117 }, +{ 'v', 118 }, +{ 'w', 119 }, +{ 'x', 120 }, +{ 'y', 121 }, +{ 'z', 122 }, +{ '{', 123 }, +{ '|', 124 }, +{ '}', 125 }, { '~', 126 } }; @@ -145,10 +145,10 @@ int der_ia5_value_decode(int v) } return -1; } - + /** - Gets length of DER encoding of IA5 STRING - @param octets The values you want to encode + Gets length of DER encoding of IA5 STRING + @param octets The values you want to encode @param noctets The number of octets in the string to encode @param outlen [out] The length of the DER encoding for the given string @return CRYPT_OK if successful diff --git a/src/pk/asn1/der/integer/der_decode_integer.c b/src/pk/asn1/der/integer/der_decode_integer.c index 0ed8ad77a..768e28a4a 100644 --- a/src/pk/asn1/der/integer/der_decode_integer.c +++ b/src/pk/asn1/der/integer/der_decode_integer.c @@ -54,7 +54,7 @@ int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num) if (x + z > inlen) { return CRYPT_INVALID_PACKET; } - + /* no so read it */ if ((err = mp_read_unsigned_bin(num, (unsigned char *)in + x, z)) != CRYPT_OK) { return err; @@ -62,7 +62,7 @@ int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num) } else { /* long form */ z &= 0x7F; - + /* will number of length bytes overflow? (or > 4) */ if (((x + z) > inlen) || (z > 4) || (z == 0)) { return CRYPT_INVALID_PACKET; @@ -97,7 +97,7 @@ int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num) return CRYPT_MEM; } mp_clear(tmp); - } + } return CRYPT_OK; diff --git a/src/pk/asn1/der/integer/der_encode_integer.c b/src/pk/asn1/der/integer/der_encode_integer.c index e80bb3ced..544bfb07d 100644 --- a/src/pk/asn1/der/integer/der_encode_integer.c +++ b/src/pk/asn1/der/integer/der_encode_integer.c @@ -27,7 +27,7 @@ @return CRYPT_OK if successful */ int der_encode_integer(void *num, unsigned char *out, unsigned long *outlen) -{ +{ unsigned long tmplen, y; int err, leading_zero; @@ -97,7 +97,7 @@ int der_encode_integer(void *num, unsigned char *out, unsigned long *outlen) } } else if (mp_iszero(num) != LTC_MP_YES) { void *tmp; - + /* negative */ if (mp_init(&tmp) != CRYPT_OK) { return CRYPT_MEM; @@ -119,7 +119,7 @@ int der_encode_integer(void *num, unsigned char *out, unsigned long *outlen) } /* we good */ - *outlen = tmplen; + *outlen = tmplen; return CRYPT_OK; } diff --git a/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c b/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c index b110908e2..47547f0fd 100644 --- a/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c @@ -48,10 +48,10 @@ int der_decode_object_identifier(const unsigned char *in, unsigned long inle if ((in[x++] & 0x1F) != 0x06) { return CRYPT_INVALID_PACKET; } - + /* get the length */ if (in[x] < 128) { - len = in[x++]; + len = in[x++]; } else { if (in[x] < 0x81 || in[x] > 0x82) { return CRYPT_INVALID_PACKET; @@ -87,7 +87,7 @@ int der_decode_object_identifier(const unsigned char *in, unsigned long inle t = 0; } } - + *outlen = y; return CRYPT_OK; } diff --git a/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c b/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c index d9ebf8ea3..ccecd9859 100644 --- a/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c @@ -55,7 +55,7 @@ int der_encode_object_identifier(unsigned long *words, unsigned long nwords, } /* store header + length */ - x = 0; + x = 0; out[x++] = 0x06; if (z < 128) { out[x++] = (unsigned char)z; @@ -71,7 +71,7 @@ int der_encode_object_identifier(unsigned long *words, unsigned long nwords, } /* store first byte */ - wordbuf = words[0] * 40 + words[1]; + wordbuf = words[0] * 40 + words[1]; for (i = 1; i < nwords; i++) { /* store 7 bit words in little endian */ t = wordbuf & 0xFFFFFFFF; @@ -87,14 +87,14 @@ int der_encode_object_identifier(unsigned long *words, unsigned long nwords, z = x - 1; while (y < z) { t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t; - ++y; + ++y; --z; } } else { /* zero word */ out[x++] = 0x00; } - + if (i < nwords - 1) { wordbuf = words[i + 1]; } diff --git a/src/pk/asn1/der/object_identifier/der_length_object_identifier.c b/src/pk/asn1/der/object_identifier/der_length_object_identifier.c index ccb1e6dd1..3b6826a20 100644 --- a/src/pk/asn1/der/object_identifier/der_length_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_length_object_identifier.c @@ -32,14 +32,14 @@ unsigned long der_object_identifier_bits(unsigned long x) /** Gets length of DER encoding of Object Identifier - @param nwords The number of OID words + @param nwords The number of OID words @param words The actual OID words to get the size of @param outlen [out] The length of the DER encoding for the given string @return CRYPT_OK if successful */ int der_length_object_identifier(unsigned long *words, unsigned long nwords, unsigned long *outlen) { - unsigned long y, z, t, wordbuf; + unsigned long y, z, t, wordbuf; LTC_ARGCHK(words != NULL); LTC_ARGCHK(outlen != NULL); diff --git a/src/pk/asn1/der/octet/der_decode_octet_string.c b/src/pk/asn1/der/octet/der_decode_octet_string.c index 952d73995..a656b256e 100644 --- a/src/pk/asn1/der/octet/der_decode_octet_string.c +++ b/src/pk/asn1/der/octet/der_decode_octet_string.c @@ -83,7 +83,7 @@ int der_decode_octet_string(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } - + #endif /* $Source$ */ diff --git a/src/pk/asn1/der/octet/der_encode_octet_string.c b/src/pk/asn1/der/octet/der_encode_octet_string.c index 9a16c3b5b..23d337dc4 100644 --- a/src/pk/asn1/der/octet/der_encode_octet_string.c +++ b/src/pk/asn1/der/octet/der_encode_octet_string.c @@ -38,7 +38,7 @@ int der_encode_octet_string(const unsigned char *in, unsigned long inlen, /* get the size */ if ((err = der_length_octet_string(inlen, &len)) != CRYPT_OK) { - return err; + return err; } /* too big? */ diff --git a/src/pk/asn1/der/octet/der_length_octet_string.c b/src/pk/asn1/der/octet/der_length_octet_string.c index 07da0587d..6e37ca7ed 100644 --- a/src/pk/asn1/der/octet/der_length_octet_string.c +++ b/src/pk/asn1/der/octet/der_length_octet_string.c @@ -17,7 +17,7 @@ #ifdef LTC_DER /** - Gets length of DER encoding of OCTET STRING + Gets length of DER encoding of OCTET STRING @param noctets The number of octets in the string to encode @param outlen [out] The length of the DER encoding for the given string @return CRYPT_OK if successful diff --git a/src/pk/asn1/der/printable_string/der_decode_printable_string.c b/src/pk/asn1/der/printable_string/der_decode_printable_string.c index 56bf3762a..726387d76 100644 --- a/src/pk/asn1/der/printable_string/der_decode_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_decode_printable_string.c @@ -88,7 +88,7 @@ int der_decode_printable_string(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } - + #endif /* $Source$ */ diff --git a/src/pk/asn1/der/printable_string/der_encode_printable_string.c b/src/pk/asn1/der/printable_string/der_encode_printable_string.c index 7d7cfd2a6..21fa511d8 100644 --- a/src/pk/asn1/der/printable_string/der_encode_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_encode_printable_string.c @@ -37,7 +37,7 @@ int der_encode_printable_string(const unsigned char *in, unsigned long inlen, /* get the size */ if ((err = der_length_printable_string(in, inlen, &len)) != CRYPT_OK) { - return err; + return err; } /* too big? */ diff --git a/src/pk/asn1/der/printable_string/der_length_printable_string.c b/src/pk/asn1/der/printable_string/der_length_printable_string.c index 9f78f20e5..64d960892 100644 --- a/src/pk/asn1/der/printable_string/der_length_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_length_printable_string.c @@ -20,80 +20,80 @@ static const struct { int code, value; } printable_table[] = { -{ ' ', 32 }, -{ '\'', 39 }, -{ '(', 40 }, -{ ')', 41 }, -{ '+', 43 }, -{ ',', 44 }, -{ '-', 45 }, -{ '.', 46 }, -{ '/', 47 }, -{ '0', 48 }, -{ '1', 49 }, -{ '2', 50 }, -{ '3', 51 }, -{ '4', 52 }, -{ '5', 53 }, -{ '6', 54 }, -{ '7', 55 }, -{ '8', 56 }, -{ '9', 57 }, -{ ':', 58 }, -{ '=', 61 }, -{ '?', 63 }, -{ 'A', 65 }, -{ 'B', 66 }, -{ 'C', 67 }, -{ 'D', 68 }, -{ 'E', 69 }, -{ 'F', 70 }, -{ 'G', 71 }, -{ 'H', 72 }, -{ 'I', 73 }, -{ 'J', 74 }, -{ 'K', 75 }, -{ 'L', 76 }, -{ 'M', 77 }, -{ 'N', 78 }, -{ 'O', 79 }, -{ 'P', 80 }, -{ 'Q', 81 }, -{ 'R', 82 }, -{ 'S', 83 }, -{ 'T', 84 }, -{ 'U', 85 }, -{ 'V', 86 }, -{ 'W', 87 }, -{ 'X', 88 }, -{ 'Y', 89 }, -{ 'Z', 90 }, -{ 'a', 97 }, -{ 'b', 98 }, -{ 'c', 99 }, -{ 'd', 100 }, -{ 'e', 101 }, -{ 'f', 102 }, -{ 'g', 103 }, -{ 'h', 104 }, -{ 'i', 105 }, -{ 'j', 106 }, -{ 'k', 107 }, -{ 'l', 108 }, -{ 'm', 109 }, -{ 'n', 110 }, -{ 'o', 111 }, -{ 'p', 112 }, -{ 'q', 113 }, -{ 'r', 114 }, -{ 's', 115 }, -{ 't', 116 }, -{ 'u', 117 }, -{ 'v', 118 }, -{ 'w', 119 }, -{ 'x', 120 }, -{ 'y', 121 }, -{ 'z', 122 }, +{ ' ', 32 }, +{ '\'', 39 }, +{ '(', 40 }, +{ ')', 41 }, +{ '+', 43 }, +{ ',', 44 }, +{ '-', 45 }, +{ '.', 46 }, +{ '/', 47 }, +{ '0', 48 }, +{ '1', 49 }, +{ '2', 50 }, +{ '3', 51 }, +{ '4', 52 }, +{ '5', 53 }, +{ '6', 54 }, +{ '7', 55 }, +{ '8', 56 }, +{ '9', 57 }, +{ ':', 58 }, +{ '=', 61 }, +{ '?', 63 }, +{ 'A', 65 }, +{ 'B', 66 }, +{ 'C', 67 }, +{ 'D', 68 }, +{ 'E', 69 }, +{ 'F', 70 }, +{ 'G', 71 }, +{ 'H', 72 }, +{ 'I', 73 }, +{ 'J', 74 }, +{ 'K', 75 }, +{ 'L', 76 }, +{ 'M', 77 }, +{ 'N', 78 }, +{ 'O', 79 }, +{ 'P', 80 }, +{ 'Q', 81 }, +{ 'R', 82 }, +{ 'S', 83 }, +{ 'T', 84 }, +{ 'U', 85 }, +{ 'V', 86 }, +{ 'W', 87 }, +{ 'X', 88 }, +{ 'Y', 89 }, +{ 'Z', 90 }, +{ 'a', 97 }, +{ 'b', 98 }, +{ 'c', 99 }, +{ 'd', 100 }, +{ 'e', 101 }, +{ 'f', 102 }, +{ 'g', 103 }, +{ 'h', 104 }, +{ 'i', 105 }, +{ 'j', 106 }, +{ 'k', 107 }, +{ 'l', 108 }, +{ 'm', 109 }, +{ 'n', 110 }, +{ 'o', 111 }, +{ 'p', 112 }, +{ 'q', 113 }, +{ 'r', 114 }, +{ 's', 115 }, +{ 't', 116 }, +{ 'u', 117 }, +{ 'v', 118 }, +{ 'w', 119 }, +{ 'x', 120 }, +{ 'y', 121 }, +{ 'z', 122 }, }; int der_printable_char_encode(int c) @@ -117,10 +117,10 @@ int der_printable_value_decode(int v) } return -1; } - + /** - Gets length of DER encoding of Printable STRING - @param octets The values you want to encode + Gets length of DER encoding of Printable STRING + @param octets The values you want to encode @param noctets The number of octets in the string to encode @param outlen [out] The length of the DER encoding for the given string @return CRYPT_OK if successful diff --git a/src/pk/asn1/der/sequence/der_sequence_free.c b/src/pk/asn1/der/sequence/der_sequence_free.c index 77e263a83..e84948326 100644 --- a/src/pk/asn1/der/sequence/der_sequence_free.c +++ b/src/pk/asn1/der/sequence/der_sequence_free.c @@ -20,13 +20,13 @@ /** Free memory allocated by der_decode_sequence_flexi() @param in The list to free -*/ +*/ void der_sequence_free(ltc_asn1_list *in) { ltc_asn1_list *l; if (!in) return; - + /* walk to the start of the chain */ while (in->prev != NULL || in->parent != NULL) { if (in->parent != NULL) { @@ -35,7 +35,7 @@ void der_sequence_free(ltc_asn1_list *in) in = in->prev; } } - + /* now walk the list and free stuff */ while (in != NULL) { /* is there a child? */ @@ -44,20 +44,20 @@ void der_sequence_free(ltc_asn1_list *in) in->child->parent = NULL; der_sequence_free(in->child); } - - switch (in->type) { + + switch (in->type) { case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_SEQUENCE: break; case LTC_ASN1_INTEGER : if (in->data != NULL) { mp_clear(in->data); } break; default : if (in->data != NULL) { XFREE(in->data); } } - + /* move to next and free current */ l = in->next; XFREE(in); in = l; - } + } } #endif diff --git a/src/pk/asn1/der/short_integer/der_encode_short_integer.c b/src/pk/asn1/der/short_integer/der_encode_short_integer.c index 903ceb49e..7b4f527b1 100644 --- a/src/pk/asn1/der/short_integer/der_encode_short_integer.c +++ b/src/pk/asn1/der/short_integer/der_encode_short_integer.c @@ -26,10 +26,10 @@ @return CRYPT_OK if successful */ int der_encode_short_integer(unsigned long num, unsigned char *out, unsigned long *outlen) -{ +{ unsigned long len, x, y, z; int err; - + LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); @@ -86,7 +86,7 @@ int der_encode_short_integer(unsigned long num, unsigned char *out, unsigned lon /* we good */ *outlen = x; - + return CRYPT_OK; } diff --git a/src/pk/asn1/der/short_integer/der_length_short_integer.c b/src/pk/asn1/der/short_integer/der_length_short_integer.c index 0b8fdcf80..f248e64c8 100644 --- a/src/pk/asn1/der/short_integer/der_length_short_integer.c +++ b/src/pk/asn1/der/short_integer/der_length_short_integer.c @@ -18,8 +18,8 @@ #ifdef LTC_DER /** - Gets length of DER encoding of num - @param num The integer to get the size of + Gets length of DER encoding of num + @param num The integer to get the size of @param outlen [out] The length of the DER encoding for the given integer @return CRYPT_OK if successful */ @@ -39,7 +39,7 @@ int der_length_short_integer(unsigned long num, unsigned long *outlen) ++z; y >>= 8; } - + /* handle zero */ if (z == 0) { z = 1; @@ -58,8 +58,8 @@ int der_length_short_integer(unsigned long num, unsigned long *outlen) len += (num&(1UL<<((z<<3) - 1))) ? 1 : 0; /* return length */ - *outlen = len; - + *outlen = len; + return CRYPT_OK; } diff --git a/src/pk/asn1/der/teletex_string/der_length_teletex_string.c b/src/pk/asn1/der/teletex_string/der_length_teletex_string.c index 85cd1a487..b5ae8b4e4 100644 --- a/src/pk/asn1/der/teletex_string/der_length_teletex_string.c +++ b/src/pk/asn1/der/teletex_string/der_length_teletex_string.c @@ -28,116 +28,116 @@ static const struct { { '\v', 11 }, { '\f', 12 }, { '\r', 13 }, -{ ' ', 32 }, -{ '!', 33 }, -{ '"', 34 }, -{ '%', 37 }, -{ '&', 38 }, -{ '\'', 39 }, -{ '(', 40 }, -{ ')', 41 }, -{ '+', 43 }, -{ ',', 44 }, -{ '-', 45 }, -{ '.', 46 }, -{ '/', 47 }, -{ '0', 48 }, -{ '1', 49 }, -{ '2', 50 }, -{ '3', 51 }, -{ '4', 52 }, -{ '5', 53 }, -{ '6', 54 }, -{ '7', 55 }, -{ '8', 56 }, -{ '9', 57 }, -{ ':', 58 }, -{ ';', 59 }, -{ '<', 60 }, -{ '=', 61 }, -{ '>', 62 }, -{ '?', 63 }, -{ '@', 64 }, -{ 'A', 65 }, -{ 'B', 66 }, -{ 'C', 67 }, -{ 'D', 68 }, -{ 'E', 69 }, -{ 'F', 70 }, -{ 'G', 71 }, -{ 'H', 72 }, -{ 'I', 73 }, -{ 'J', 74 }, -{ 'K', 75 }, -{ 'L', 76 }, -{ 'M', 77 }, -{ 'N', 78 }, -{ 'O', 79 }, -{ 'P', 80 }, -{ 'Q', 81 }, -{ 'R', 82 }, -{ 'S', 83 }, -{ 'T', 84 }, -{ 'U', 85 }, -{ 'V', 86 }, -{ 'W', 87 }, -{ 'X', 88 }, -{ 'Y', 89 }, -{ 'Z', 90 }, -{ '[', 91 }, -{ ']', 93 }, -{ '_', 95 }, -{ 'a', 97 }, -{ 'b', 98 }, -{ 'c', 99 }, -{ 'd', 100 }, -{ 'e', 101 }, -{ 'f', 102 }, -{ 'g', 103 }, -{ 'h', 104 }, -{ 'i', 105 }, -{ 'j', 106 }, -{ 'k', 107 }, -{ 'l', 108 }, -{ 'm', 109 }, -{ 'n', 110 }, -{ 'o', 111 }, -{ 'p', 112 }, -{ 'q', 113 }, -{ 'r', 114 }, -{ 's', 115 }, -{ 't', 116 }, -{ 'u', 117 }, -{ 'v', 118 }, -{ 'w', 119 }, -{ 'x', 120 }, -{ 'y', 121 }, -{ 'z', 122 }, -{ '|', 124 }, -{ ' ', 160 }, -{ 0xa1, 161 }, -{ 0xa2, 162 }, -{ 0xa3, 163 }, -{ '$', 164 }, -{ 0xa5, 165 }, -{ '#', 166 }, -{ 0xa7, 167 }, -{ 0xa4, 168 }, -{ 0xab, 171 }, -{ 0xb0, 176 }, -{ 0xb1, 177 }, -{ 0xb2, 178 }, -{ 0xb3, 179 }, -{ 0xd7, 180 }, -{ 0xb5, 181 }, -{ 0xb6, 182 }, -{ 0xb7, 183 }, -{ 0xf7, 184 }, -{ 0xbb, 187 }, -{ 0xbc, 188 }, -{ 0xbd, 189 }, -{ 0xbe, 190 }, -{ 0xbf, 191 }, +{ ' ', 32 }, +{ '!', 33 }, +{ '"', 34 }, +{ '%', 37 }, +{ '&', 38 }, +{ '\'', 39 }, +{ '(', 40 }, +{ ')', 41 }, +{ '+', 43 }, +{ ',', 44 }, +{ '-', 45 }, +{ '.', 46 }, +{ '/', 47 }, +{ '0', 48 }, +{ '1', 49 }, +{ '2', 50 }, +{ '3', 51 }, +{ '4', 52 }, +{ '5', 53 }, +{ '6', 54 }, +{ '7', 55 }, +{ '8', 56 }, +{ '9', 57 }, +{ ':', 58 }, +{ ';', 59 }, +{ '<', 60 }, +{ '=', 61 }, +{ '>', 62 }, +{ '?', 63 }, +{ '@', 64 }, +{ 'A', 65 }, +{ 'B', 66 }, +{ 'C', 67 }, +{ 'D', 68 }, +{ 'E', 69 }, +{ 'F', 70 }, +{ 'G', 71 }, +{ 'H', 72 }, +{ 'I', 73 }, +{ 'J', 74 }, +{ 'K', 75 }, +{ 'L', 76 }, +{ 'M', 77 }, +{ 'N', 78 }, +{ 'O', 79 }, +{ 'P', 80 }, +{ 'Q', 81 }, +{ 'R', 82 }, +{ 'S', 83 }, +{ 'T', 84 }, +{ 'U', 85 }, +{ 'V', 86 }, +{ 'W', 87 }, +{ 'X', 88 }, +{ 'Y', 89 }, +{ 'Z', 90 }, +{ '[', 91 }, +{ ']', 93 }, +{ '_', 95 }, +{ 'a', 97 }, +{ 'b', 98 }, +{ 'c', 99 }, +{ 'd', 100 }, +{ 'e', 101 }, +{ 'f', 102 }, +{ 'g', 103 }, +{ 'h', 104 }, +{ 'i', 105 }, +{ 'j', 106 }, +{ 'k', 107 }, +{ 'l', 108 }, +{ 'm', 109 }, +{ 'n', 110 }, +{ 'o', 111 }, +{ 'p', 112 }, +{ 'q', 113 }, +{ 'r', 114 }, +{ 's', 115 }, +{ 't', 116 }, +{ 'u', 117 }, +{ 'v', 118 }, +{ 'w', 119 }, +{ 'x', 120 }, +{ 'y', 121 }, +{ 'z', 122 }, +{ '|', 124 }, +{ ' ', 160 }, +{ 0xa1, 161 }, +{ 0xa2, 162 }, +{ 0xa3, 163 }, +{ '$', 164 }, +{ 0xa5, 165 }, +{ '#', 166 }, +{ 0xa7, 167 }, +{ 0xa4, 168 }, +{ 0xab, 171 }, +{ 0xb0, 176 }, +{ 0xb1, 177 }, +{ 0xb2, 178 }, +{ 0xb3, 179 }, +{ 0xd7, 180 }, +{ 0xb5, 181 }, +{ 0xb6, 182 }, +{ 0xb7, 183 }, +{ 0xf7, 184 }, +{ 0xbb, 187 }, +{ 0xbc, 188 }, +{ 0xbd, 189 }, +{ 0xbe, 190 }, +{ 0xbf, 191 }, }; int der_teletex_char_encode(int c) @@ -161,10 +161,10 @@ int der_teletex_value_decode(int v) } return -1; } - + /** - Gets length of DER encoding of teletex STRING - @param octets The values you want to encode + Gets length of DER encoding of teletex STRING + @param octets The values you want to encode @param noctets The number of octets in the string to encode @param outlen [out] The length of the DER encoding for the given string @return CRYPT_OK if successful diff --git a/src/pk/asn1/der/utctime/der_decode_utctime.c b/src/pk/asn1/der/utctime/der_decode_utctime.c index c86bc752f..ca1279978 100644 --- a/src/pk/asn1/der/utctime/der_decode_utctime.c +++ b/src/pk/asn1/der/utctime/der_decode_utctime.c @@ -73,7 +73,7 @@ int der_decode_utctime(const unsigned char *in, unsigned long *inlen, *inlen = 2 + x; - /* possible encodings are + /* possible encodings are YYMMDDhhmmZ YYMMDDhhmm+hh'mm' YYMMDDhhmm-hh'mm' @@ -81,7 +81,7 @@ YYMMDDhhmmssZ YYMMDDhhmmss+hh'mm' YYMMDDhhmmss-hh'mm' - So let's do a trivial decode upto [including] mm + So let's do a trivial decode upto [including] mm */ x = 0; diff --git a/src/pk/asn1/der/utctime/der_encode_utctime.c b/src/pk/asn1/der/utctime/der_encode_utctime.c index 0dcac8a86..92fffe5ed 100644 --- a/src/pk/asn1/der/utctime/der_encode_utctime.c +++ b/src/pk/asn1/der/utctime/der_encode_utctime.c @@ -30,12 +30,12 @@ static const char * const baseten = "0123456789"; @param outlen [in/out] The length of the DER encoding @return CRYPT_OK if successful */ -int der_encode_utctime(ltc_utctime *utctime, +int der_encode_utctime(ltc_utctime *utctime, unsigned char *out, unsigned long *outlen) { unsigned long x, tmplen; int err; - + LTC_ARGCHK(utctime != NULL); LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); @@ -47,7 +47,7 @@ int der_encode_utctime(ltc_utctime *utctime, *outlen = tmplen; return CRYPT_BUFFER_OVERFLOW; } - + /* store header */ out[0] = 0x17; @@ -70,7 +70,7 @@ int der_encode_utctime(ltc_utctime *utctime, /* store length */ out[1] = (unsigned char)(x - 2); - + /* all good let's return */ *outlen = x; return CRYPT_OK; diff --git a/src/pk/asn1/der/utf8/der_decode_utf8_string.c b/src/pk/asn1/der/utf8/der_decode_utf8_string.c index d9cbdaf39..d67362ae2 100644 --- a/src/pk/asn1/der/utf8/der_decode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_decode_utf8_string.c @@ -73,10 +73,10 @@ int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, for (y = 0; x < inlen; ) { /* get first byte */ tmp = in[x++]; - + /* count number of bytes */ for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF); - + if (z > 4 || (x + (z - 1) > inlen)) { return CRYPT_INVALID_PACKET; } @@ -103,7 +103,7 @@ int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, return CRYPT_OK; } - + #endif /* $Source$ */ diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index 3321f945e..2ce2ca49b 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -35,7 +35,7 @@ unsigned long der_utf8_charsize(const wchar_t c) } /** - Gets length of DER encoding of UTF8 STRING + Gets length of DER encoding of UTF8 STRING @param in The characters to measure the length of @param noctets The number of octets in the string to encode @param outlen [out] The length of the DER encoding for the given string diff --git a/src/pk/dsa/dsa_decrypt_key.c b/src/pk/dsa/dsa_decrypt_key.c index c622c78d2..f971e6e0e 100644 --- a/src/pk/dsa/dsa_decrypt_key.c +++ b/src/pk/dsa/dsa_decrypt_key.c @@ -13,7 +13,7 @@ /** @file dsa_decrypt_key.c DSA Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MDSA @@ -27,7 +27,7 @@ @return CRYPT_OK if successful */ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, + unsigned char *out, unsigned long *outlen, dsa_key *key) { unsigned char *skey, *expt; @@ -45,21 +45,21 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, if (key->type != PK_PRIVATE) { return CRYPT_PK_NOT_PRIVATE; } - + /* decode to find out hash */ LTC_SET_ASN1(decode, 0, LTC_ASN1_OBJECT_IDENTIFIER, hashOID, sizeof(hashOID)/sizeof(hashOID[0])); - + if ((err = der_decode_sequence(in, inlen, decode, 1)) != CRYPT_OK) { return err; } - hash = find_hash_oid(hashOID, decode[0].size); + hash = find_hash_oid(hashOID, decode[0].size); if (hash_is_valid(hash) != CRYPT_OK) { return CRYPT_INVALID_PACKET; } /* we now have the hash! */ - + if ((err = mp_init(&g_pub)) != CRYPT_OK) { return err; } @@ -77,7 +77,7 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, mp_clear(g_pub); return CRYPT_MEM; } - + LTC_SET_ASN1(decode, 1, LTC_ASN1_INTEGER, g_pub, 1UL); LTC_SET_ASN1(decode, 2, LTC_ASN1_OCTET_STRING, skey, MAXBLOCKSIZE); @@ -125,7 +125,7 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, XFREE(expt); XFREE(skey); - + mp_clear(g_pub); return err; diff --git a/src/pk/dsa/dsa_encrypt_key.c b/src/pk/dsa/dsa_encrypt_key.c index 92be479d4..a7e9ed2bc 100644 --- a/src/pk/dsa/dsa_encrypt_key.c +++ b/src/pk/dsa/dsa_encrypt_key.c @@ -13,7 +13,7 @@ /** @file dsa_encrypt_key.c DSA Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MDSA @@ -24,14 +24,14 @@ @param out [out] The destination for the ciphertext @param outlen [in/out] The max size and resulting size of the ciphertext @param prng An active PRNG state - @param wprng The index of the PRNG you wish to use - @param hash The index of the hash you want to use + @param wprng The index of the PRNG you wish to use + @param hash The index of the hash you want to use @param key The DSA key you want to encrypt to @return CRYPT_OK if successful */ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, int hash, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, dsa_key *key) { unsigned char *expt, *skey; @@ -61,7 +61,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, if ((err = mp_init_multi(&g_pub, &g_priv, NULL)) != CRYPT_OK) { return err; } - + expt = XMALLOC(mp_unsigned_bin_size(key->p) + 1); skey = XMALLOC(MAXBLOCKSIZE); if (expt == NULL || skey == NULL) { @@ -74,7 +74,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, mp_clear_multi(g_pub, g_priv, NULL); return CRYPT_MEM; } - + /* make a random g_priv, g_pub = g^x pair */ qbits = mp_count_bits(key->q); do { @@ -88,7 +88,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, if ((err = mp_exptmod(key->g, g_priv, key->p, g_pub)) != CRYPT_OK) { goto LBL_ERR; } - + /* make random key */ x = mp_unsigned_bin_size(key->p) + 1; if ((err = dsa_shared_secret(g_priv, key->y, key, expt, &x)) != CRYPT_OK) { @@ -99,7 +99,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, if ((err = hash_memory(hash, expt, x, skey, &y)) != CRYPT_OK) { goto LBL_ERR; } - + /* Encrypt key */ for (x = 0; x < inlen; x++) { skey[x] ^= in[x]; @@ -120,7 +120,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, XFREE(skey); XFREE(expt); - + mp_clear_multi(g_pub, g_priv, NULL); return err; } diff --git a/src/pk/dsa/dsa_shared_secret.c b/src/pk/dsa/dsa_shared_secret.c index 5adaa5fbd..8ae9d4de3 100644 --- a/src/pk/dsa/dsa_shared_secret.c +++ b/src/pk/dsa/dsa_shared_secret.c @@ -13,14 +13,14 @@ /** @file dsa_shared_secret.c DSA Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MDSA /** Create a DSA shared secret between two keys @param private_key The private DSA key (the exponent) - @param base The base of the exponentiation (allows this to be used for both encrypt and decrypt) + @param base The base of the exponentiation (allows this to be used for both encrypt and decrypt) @param public_key The public key @param out [out] Destination of the shared secret @param outlen [in/out] The max size and resulting size of the shared secret @@ -48,7 +48,7 @@ int dsa_shared_secret(void *private_key, void *base, mp_clear(res); return err; } - + x = (unsigned long)mp_unsigned_bin_size(res); if (*outlen < x) { *outlen = x; diff --git a/src/pk/dsa/dsa_sign_hash.c b/src/pk/dsa/dsa_sign_hash.c index 4d131b433..c9da8cf72 100644 --- a/src/pk/dsa/dsa_sign_hash.c +++ b/src/pk/dsa/dsa_sign_hash.c @@ -96,7 +96,7 @@ int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, if (mp_iszero(s) == LTC_MP_YES) { goto retry; } err = CRYPT_OK; -error: +error: mp_clear_multi(k, kinv, tmp, NULL); ERRBUF: #ifdef LTC_CLEAN_STACK @@ -137,9 +137,9 @@ int dsa_sign_hash(const unsigned char *in, unsigned long inlen, goto error; } - err = der_encode_sequence_multi(out, outlen, - LTC_ASN1_INTEGER, 1UL, r, - LTC_ASN1_INTEGER, 1UL, s, + err = der_encode_sequence_multi(out, outlen, + LTC_ASN1_INTEGER, 1UL, r, + LTC_ASN1_INTEGER, 1UL, s, LTC_ASN1_EOL, 0UL, NULL); error: diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index 6188164d0..d2473915c 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -29,7 +29,7 @@ @return CRYPT_OK if successful (even if the signature is invalid) */ int dsa_verify_hash_raw( void *r, void *s, - const unsigned char *hash, unsigned long hashlen, + const unsigned char *hash, unsigned long hashlen, int *stat, dsa_key *key) { void *w, *v, *u1, *u2; @@ -53,7 +53,7 @@ int dsa_verify_hash_raw( void *r, void *s, err = CRYPT_INVALID_PACKET; goto error; } - + /* FIPS 186-4 4.7: use leftmost min(bitlen(q), bitlen(hash)) bits of 'hash' */ hashlen = MIN(hashlen, (unsigned long)(key->qord)); @@ -65,7 +65,7 @@ int dsa_verify_hash_raw( void *r, void *s, if ((err = mp_mulmod(u1, w, key->q, u1)) != CRYPT_OK) { goto error; } /* u2 = r*w mod q */ - if ((err = mp_mulmod(r, w, key->q, u2)) != CRYPT_OK) { goto error; } + if ((err = mp_mulmod(r, w, key->q, u2)) != CRYPT_OK) { goto error; } /* v = g^u1 * y^u2 mod p mod q */ if ((err = mp_exptmod(key->g, u1, key->p, u1)) != CRYPT_OK) { goto error; } @@ -95,7 +95,7 @@ int dsa_verify_hash_raw( void *r, void *s, @return CRYPT_OK if successful (even if the signature is invalid) */ int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, + const unsigned char *hash, unsigned long hashlen, int *stat, dsa_key *key) { int err; @@ -107,8 +107,8 @@ int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, /* decode the sequence */ if ((err = der_decode_sequence_multi(sig, siglen, - LTC_ASN1_INTEGER, 1UL, r, - LTC_ASN1_INTEGER, 1UL, s, + LTC_ASN1_INTEGER, 1UL, r, + LTC_ASN1_INTEGER, 1UL, s, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index fa839ef6a..5afdb3b35 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -89,7 +89,7 @@ int dsa_verify_key(dsa_key *key, int *stat) /* at this point we are out of tests ;-( */ err = CRYPT_OK; *stat = 1; -error: +error: mp_clear_multi(tmp, tmp2, NULL); return err; } diff --git a/src/pk/ecc/ecc_ansi_x963_import.c b/src/pk/ecc/ecc_ansi_x963_import.c index ec34245f8..3c70dc896 100644 --- a/src/pk/ecc/ecc_ansi_x963_import.c +++ b/src/pk/ecc/ecc_ansi_x963_import.c @@ -19,11 +19,11 @@ /** @file ecc_ansi_x963_import.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC -/** Import an ANSI X9.63 format public key +/** Import an ANSI X9.63 format public key @param in The input data to read @param inlen The length of the input data @param key [out] destination to store imported key \ @@ -36,10 +36,10 @@ int ecc_ansi_x963_import(const unsigned char *in, unsigned long inlen, ecc_key * int ecc_ansi_x963_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, ltc_ecc_set_type *dp) { int x, err; - + LTC_ARGCHK(in != NULL); LTC_ARGCHK(key != NULL); - + /* must be odd */ if ((inlen & 1) == 0) { return CRYPT_INVALID_ARG; diff --git a/src/pk/ecc/ecc_decrypt_key.c b/src/pk/ecc/ecc_decrypt_key.c index 6e09e6165..1d292912b 100644 --- a/src/pk/ecc/ecc_decrypt_key.c +++ b/src/pk/ecc/ecc_decrypt_key.c @@ -19,7 +19,7 @@ /** @file ecc_decrypt_key.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC @@ -33,7 +33,7 @@ @return CRYPT_OK if successful */ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, + unsigned char *out, unsigned long *outlen, ecc_key *key) { unsigned char *ecc_shared, *skey, *pub_expt; @@ -51,15 +51,15 @@ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, if (key->type != PK_PRIVATE) { return CRYPT_PK_NOT_PRIVATE; } - + /* decode to find out hash */ LTC_SET_ASN1(decode, 0, LTC_ASN1_OBJECT_IDENTIFIER, hashOID, sizeof(hashOID)/sizeof(hashOID[0])); - + if ((err = der_decode_sequence(in, inlen, decode, 1)) != CRYPT_OK) { return err; } - hash = find_hash_oid(hashOID, decode[0].size); + hash = find_hash_oid(hashOID, decode[0].size); if (hash_is_valid(hash) != CRYPT_OK) { return CRYPT_INVALID_PACKET; } diff --git a/src/pk/ecc/ecc_encrypt_key.c b/src/pk/ecc/ecc_encrypt_key.c index a74d50f21..b46986b69 100644 --- a/src/pk/ecc/ecc_encrypt_key.c +++ b/src/pk/ecc/ecc_encrypt_key.c @@ -19,25 +19,25 @@ /** @file ecc_encrypt_key.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC /** - Encrypt a symmetric key with ECC + Encrypt a symmetric key with ECC @param in The symmetric key you want to encrypt @param inlen The length of the key to encrypt (octets) @param out [out] The destination for the ciphertext @param outlen [in/out] The max size and resulting size of the ciphertext @param prng An active PRNG state - @param wprng The index of the PRNG you wish to use - @param hash The index of the hash you want to use + @param wprng The index of the PRNG you wish to use + @param hash The index of the hash you want to use @param key The ECC key you want to encrypt to @return CRYPT_OK if successful */ int ecc_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, int hash, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, ecc_key *key) { unsigned char *pub_expt, *ecc_shared, *skey; @@ -90,7 +90,7 @@ int ecc_encrypt_key(const unsigned char *in, unsigned long inlen, ecc_free(&pubkey); goto LBL_ERR; } - + /* make random key */ x = ECC_BUF_SIZE; if ((err = ecc_shared_secret(&pubkey, key, ecc_shared, &x)) != CRYPT_OK) { @@ -102,7 +102,7 @@ int ecc_encrypt_key(const unsigned char *in, unsigned long inlen, if ((err = hash_memory(hash, ecc_shared, x, skey, &y)) != CRYPT_OK) { goto LBL_ERR; } - + /* Encrypt key */ for (x = 0; x < inlen; x++) { skey[x] ^= in[x]; diff --git a/src/pk/ecc/ecc_export.c b/src/pk/ecc/ecc_export.c index b6c34853b..51c9bf20b 100644 --- a/src/pk/ecc/ecc_export.c +++ b/src/pk/ecc/ecc_export.c @@ -19,7 +19,7 @@ /** @file ecc_export.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC @@ -40,7 +40,7 @@ int ecc_export(unsigned char *out, unsigned long *outlen, int type, ecc_key *key LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); - + /* type valid? */ if (key->type != PK_PRIVATE && type == PK_PRIVATE) { return CRYPT_PK_TYPE_MISMATCH; diff --git a/src/pk/ecc/ecc_free.c b/src/pk/ecc/ecc_free.c index c9e5d6cd0..8e8455bfa 100644 --- a/src/pk/ecc/ecc_free.c +++ b/src/pk/ecc/ecc_free.c @@ -19,7 +19,7 @@ /** @file ecc_free.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC diff --git a/src/pk/ecc/ecc_get_size.c b/src/pk/ecc/ecc_get_size.c index a824aa494..b01b81318 100644 --- a/src/pk/ecc/ecc_get_size.c +++ b/src/pk/ecc/ecc_get_size.c @@ -19,13 +19,13 @@ /** @file ecc_get_size.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC /** Get the size of an ECC key - @param key The key to get the size of + @param key The key to get the size of @return The size (octets) of the key or INT_MAX on error */ int ecc_get_size(ecc_key *key) diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index efb1d7062..9ee97a1a0 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -19,7 +19,7 @@ /** @file ecc_import.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC @@ -27,26 +27,26 @@ static int is_point(ecc_key *key) { void *prime, *b, *t1, *t2; int err; - + if ((err = mp_init_multi(&prime, &b, &t1, &t2, NULL)) != CRYPT_OK) { return err; } - + /* load prime and b */ if ((err = mp_read_radix(prime, key->dp->prime, 16)) != CRYPT_OK) { goto error; } if ((err = mp_read_radix(b, key->dp->B, 16)) != CRYPT_OK) { goto error; } - + /* compute y^2 */ if ((err = mp_sqr(key->pubkey.y, t1)) != CRYPT_OK) { goto error; } - + /* compute x^3 */ if ((err = mp_sqr(key->pubkey.x, t2)) != CRYPT_OK) { goto error; } if ((err = mp_mod(t2, prime, t2)) != CRYPT_OK) { goto error; } if ((err = mp_mul(key->pubkey.x, t2, t2)) != CRYPT_OK) { goto error; } - + /* compute y^2 - x^3 */ if ((err = mp_sub(t1, t2, t1)) != CRYPT_OK) { goto error; } - + /* compute y^2 - x^3 + 3x */ if ((err = mp_add(t1, key->pubkey.x, t1)) != CRYPT_OK) { goto error; } if ((err = mp_add(t1, key->pubkey.x, t1)) != CRYPT_OK) { goto error; } @@ -58,14 +58,14 @@ static int is_point(ecc_key *key) while (mp_cmp(t1, prime) != LTC_MP_LT) { if ((err = mp_sub(t1, prime, t1)) != CRYPT_OK) { goto error; } } - + /* compare to b */ if (mp_cmp(t1, b) != LTC_MP_EQ) { err = CRYPT_INVALID_PACKET; } else { err = CRYPT_OK; } - + error: mp_clear_multi(prime, b, t1, t2, NULL); return err; @@ -153,7 +153,7 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co } /* set z */ if ((err = mp_set(key->pubkey.z, 1)) != CRYPT_OK) { goto done; } - + /* is it a point on the curve? */ if ((err = is_point(key)) != CRYPT_OK) { goto done; diff --git a/src/pk/ecc/ecc_make_key.c b/src/pk/ecc/ecc_make_key.c index 9bbeb44d6..7dc44f91d 100644 --- a/src/pk/ecc/ecc_make_key.c +++ b/src/pk/ecc/ecc_make_key.c @@ -19,12 +19,12 @@ /** @file ecc_make_key.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC /** - Make a new ECC key + Make a new ECC key @param prng An active PRNG state @param wprng The index of the PRNG you wish to use @param keysize The keysize for the new key (in octets from 20 to 65 bytes) diff --git a/src/pk/ecc/ecc_shared_secret.c b/src/pk/ecc/ecc_shared_secret.c index 5aece5e34..5215fc96a 100644 --- a/src/pk/ecc/ecc_shared_secret.c +++ b/src/pk/ecc/ecc_shared_secret.c @@ -19,7 +19,7 @@ /** @file ecc_shared_secret.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index 59757817e..4b8d4b2bc 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -19,7 +19,7 @@ /** @file ecc_sign_hash.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC @@ -51,12 +51,12 @@ int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, if (key->type != PK_PRIVATE) { return CRYPT_PK_NOT_PRIVATE; } - + /* is the IDX valid ? */ if (ltc_ecc_is_valid_idx(key->idx) != 1) { return CRYPT_PK_INVALID_TYPE; } - + if ((err = prng_is_valid(wprng)) != CRYPT_OK) { return err; } @@ -80,7 +80,7 @@ int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, if (mp_iszero(r) == LTC_MP_YES) { ecc_free(&pubkey); - } else { + } else { /* find s = (e + xr)/k */ if ((err = mp_invmod(pubkey.k, p, pubkey.k)) != CRYPT_OK) { goto error; } /* k = 1/k */ if ((err = mp_mulmod(key->k, r, p, s)) != CRYPT_OK) { goto error; } /* s = xr */ @@ -143,7 +143,7 @@ int ecc_sign_hash(const unsigned char *in, unsigned long inlen, error: mp_clear_multi(r, s, NULL); - return err; + return err; } #endif diff --git a/src/pk/ecc/ecc_sizes.c b/src/pk/ecc/ecc_sizes.c index b02a9f9ea..eb3a3775e 100644 --- a/src/pk/ecc/ecc_sizes.c +++ b/src/pk/ecc/ecc_sizes.c @@ -19,7 +19,7 @@ /** @file ecc_sizes.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC diff --git a/src/pk/ecc/ecc_verify_hash.c b/src/pk/ecc/ecc_verify_hash.c index afa7f3960..cd9f65aa0 100644 --- a/src/pk/ecc/ecc_verify_hash.c +++ b/src/pk/ecc/ecc_verify_hash.c @@ -19,14 +19,14 @@ /** @file ecc_verify_hash.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC -/* verify +/* verify * * w = s^-1 mod n - * u1 = xw + * u1 = xw * u2 = rw * X = u1*G + u2*Q * v = X_x1 mod n @@ -117,13 +117,13 @@ int ecc_verify_hash_raw( void *r, void *s, if (ltc_mp.ecc_mul2add == NULL) { if ((err = ltc_mp.ecc_ptmul(u1, mG, mG, m, 0)) != CRYPT_OK) { goto error; } if ((err = ltc_mp.ecc_ptmul(u2, mQ, mQ, m, 0)) != CRYPT_OK) { goto error; } - + /* find the montgomery mp */ if ((err = mp_montgomery_setup(m, &mp)) != CRYPT_OK) { goto error; } /* add them */ if ((err = ltc_mp.ecc_ptadd(mQ, mG, mG, m, mp)) != CRYPT_OK) { goto error; } - + /* reduce */ if ((err = ltc_mp.ecc_map(mG, m, mp)) != CRYPT_OK) { goto error; } } else { @@ -145,7 +145,7 @@ int ecc_verify_hash_raw( void *r, void *s, ltc_ecc_del_point(mG); ltc_ecc_del_point(mQ); mp_clear_multi(v, w, u1, u2, p, e, m, NULL); - if (mp != NULL) { + if (mp != NULL) { mp_montgomery_free(mp); } return err; diff --git a/src/pk/ecc/ltc_ecc_is_valid_idx.c b/src/pk/ecc/ltc_ecc_is_valid_idx.c index 4a0206888..2e9d8f2ee 100644 --- a/src/pk/ecc/ltc_ecc_is_valid_idx.c +++ b/src/pk/ecc/ltc_ecc_is_valid_idx.c @@ -19,14 +19,14 @@ /** @file ltc_ecc_is_valid_idx.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC /** Returns whether an ECC idx is valid or not @param n The idx number to check @return 1 if valid, 0 if not -*/ +*/ int ltc_ecc_is_valid_idx(int n) { int x; diff --git a/src/pk/ecc/ltc_ecc_map.c b/src/pk/ecc/ltc_ecc_map.c index 4f3ec09c7..c6ec9b547 100644 --- a/src/pk/ecc/ltc_ecc_map.c +++ b/src/pk/ecc/ltc_ecc_map.c @@ -19,7 +19,7 @@ /** @file ltc_ecc_map.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC @@ -48,7 +48,7 @@ int ltc_ecc_map(ecc_point *P, void *modulus, void *mp) /* get 1/z */ if ((err = mp_invmod(P->z, modulus, t1)) != CRYPT_OK) { goto done; } - + /* get 1/z^2 and 1/z^3 */ if ((err = mp_sqr(t1, t2)) != CRYPT_OK) { goto done; } if ((err = mp_mod(t2, modulus, t2)) != CRYPT_OK) { goto done; } diff --git a/src/pk/ecc/ltc_ecc_mul2add.c b/src/pk/ecc/ltc_ecc_mul2add.c index 8b5932046..73e8217cc 100644 --- a/src/pk/ecc/ltc_ecc_mul2add.c +++ b/src/pk/ecc/ltc_ecc_mul2add.c @@ -19,7 +19,7 @@ /** @file ltc_ecc_mul2add.c ECC Crypto, Shamir's Trick, Tom St Denis -*/ +*/ #ifdef LTC_MECC @@ -31,9 +31,9 @@ @param B Second point to multiply @param kB What to multiple B by @param C [out] Destination point (can overlap with A or B - @param modulus Modulus for curve + @param modulus Modulus for curve @return CRYPT_OK on success -*/ +*/ int ltc_ecc_mul2add(ecc_point *A, void *kA, ecc_point *B, void *kB, ecc_point *C, @@ -44,7 +44,7 @@ int ltc_ecc_mul2add(ecc_point *A, void *kA, unsigned char *tA, *tB; int err, first; void *mp, *mu; - + /* argchks */ LTC_ARGCHK(A != NULL); LTC_ARGCHK(B != NULL); @@ -126,7 +126,7 @@ int ltc_ecc_mul2add(ecc_point *A, void *kA, for (y = 1; y < 4; y++) { if ((err = ltc_mp.ecc_ptadd(precomp[x], precomp[(y<<2)], precomp[x+(y<<2)], modulus, mp)) != CRYPT_OK) { goto ERR_MU; } } - } + } nibble = 3; first = 1; @@ -147,8 +147,8 @@ int ltc_ecc_mul2add(ecc_point *A, void *kA, /* extract two bits from both, shift/update */ nA = (bitbufA >> 6) & 0x03; nB = (bitbufB >> 6) & 0x03; - bitbufA = (bitbufA << 2) & 0xFF; - bitbufB = (bitbufB << 2) & 0xFF; + bitbufA = (bitbufA << 2) & 0xFF; + bitbufB = (bitbufB << 2) & 0xFF; /* if both zero, if first, continue */ if ((nA == 0) && (nB == 0) && (first == 1)) { diff --git a/src/pk/ecc/ltc_ecc_points.c b/src/pk/ecc/ltc_ecc_points.c index 9be9eff72..df38c1909 100644 --- a/src/pk/ecc/ltc_ecc_points.c +++ b/src/pk/ecc/ltc_ecc_points.c @@ -19,13 +19,13 @@ /** @file ltc_ecc_points.c ECC Crypto, Tom St Denis -*/ +*/ #ifdef LTC_MECC /** Allocate a new ECC point - @return A newly allocated point or NULL on error + @return A newly allocated point or NULL on error */ ecc_point *ltc_ecc_new_point(void) { diff --git a/src/pk/katja/katja_free.c b/src/pk/katja/katja_free.c index 767486a47..4f0b69822 100644 --- a/src/pk/katja/katja_free.c +++ b/src/pk/katja/katja_free.c @@ -13,7 +13,7 @@ /** @file katja_free.c Free an Katja key, Tom St Denis -*/ +*/ #ifdef LTC_MKAT diff --git a/src/pk/katja/katja_make_key.c b/src/pk/katja/katja_make_key.c index 86b4c1a97..d592eac98 100644 --- a/src/pk/katja/katja_make_key.c +++ b/src/pk/katja/katja_make_key.c @@ -13,11 +13,11 @@ /** @file katja_make_key.c Katja key generation, Tom St Denis -*/ +*/ #ifdef LTC_MKAT -/** +/** Create a Katja key @param prng An active PRNG state @param wprng The index of the PRNG desired @@ -29,7 +29,7 @@ int katja_make_key(prng_state *prng, int wprng, int size, katja_key *key) { void *p, *q, *tmp1, *tmp2; int err; - + LTC_ARGCHK(key != NULL); LTC_ARGCHK(ltc_mp.name != NULL); @@ -68,7 +68,7 @@ int katja_make_key(prng_state *prng, int wprng, int size, katja_key *key) if ((err = mp_copy( p, key->p)) != CRYPT_OK) { goto error2; } if ((err = mp_copy( q, key->q)) != CRYPT_OK) { goto error2; } if ((err = mp_mul(key->p, key->q, key->pq)) != CRYPT_OK) { goto error2; } /* tmp1 = pq */ - if ((err = mp_mul(key->pq, key->p, key->N)) != CRYPT_OK) { goto error2; } /* N = p^2q */ + if ((err = mp_mul(key->pq, key->p, key->N)) != CRYPT_OK) { goto error2; } /* N = p^2q */ if ((err = mp_sub_d( p, 1, tmp1)) != CRYPT_OK) { goto error2; } /* tmp1 = q-1 */ if ((err = mp_sub_d( q, 1, tmp2)) != CRYPT_OK) { goto error2; } /* tmp2 = p-1 */ if ((err = mp_lcm(tmp1, tmp2, key->d)) != CRYPT_OK) { goto error2; } /* tmp1 = lcd(p-1,q-1) */ diff --git a/src/pk/pkcs1/pkcs_1_os2ip.c b/src/pk/pkcs1/pkcs_1_os2ip.c index 2df757487..5fe97eaea 100644 --- a/src/pk/pkcs1/pkcs_1_os2ip.c +++ b/src/pk/pkcs1/pkcs_1_os2ip.c @@ -10,9 +10,9 @@ */ #include "tomcrypt.h" -/** +/** @file pkcs_1_os2ip.c - Octet to Integer OS2IP, Tom St Denis + Octet to Integer OS2IP, Tom St Denis */ #ifdef LTC_PKCS_1 diff --git a/src/pk/rsa/rsa_free.c b/src/pk/rsa/rsa_free.c index bb6daefcd..702116a11 100644 --- a/src/pk/rsa/rsa_free.c +++ b/src/pk/rsa/rsa_free.c @@ -13,7 +13,7 @@ /** @file rsa_free.c Free an RSA key, Tom St Denis -*/ +*/ #ifdef LTC_MRSA diff --git a/src/pk/rsa/rsa_sign_hash.c b/src/pk/rsa/rsa_sign_hash.c index f66b9f46a..46d5c9f36 100644 --- a/src/pk/rsa/rsa_sign_hash.c +++ b/src/pk/rsa/rsa_sign_hash.c @@ -88,12 +88,12 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, return CRYPT_INVALID_ARG; } - /* construct the SEQUENCE + /* construct the SEQUENCE SEQUENCE { SEQUENCE {hashoid OID blah NULL } - hash OCTET STRING + hash OCTET STRING } */ LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, hash_descriptor[hash_idx].OID, hash_descriptor[hash_idx].OIDlen); diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index 51a1c7d09..173deea5c 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -14,14 +14,14 @@ @file fortuna.c Fortuna PRNG, Tom St Denis */ - -/* Implementation of Fortuna by Tom St Denis + +/* Implementation of Fortuna by Tom St Denis We deviate slightly here for reasons of simplicity [and to fit in the API]. First all "sources" -in the AddEntropy function are fixed to 0. Second since no reliable timer is provided +in the AddEntropy function are fixed to 0. Second since no reliable timer is provided we reseed automatically when len(pool0) >= 64 or every LTC_FORTUNA_WD calls to the read function */ -#ifdef LTC_FORTUNA +#ifdef LTC_FORTUNA /* requries LTC_SHA256 and AES */ #if !(defined(LTC_RIJNDAEL) && defined(LTC_SHA256)) @@ -79,11 +79,11 @@ static int fortuna_reseed(prng_state *prng) } for (x = 0; x < LTC_FORTUNA_POOLS; x++) { - if (x == 0 || ((prng->fortuna.reset_cnt >> (x-1)) & 1) == 0) { + if (x == 0 || ((prng->fortuna.reset_cnt >> (x-1)) & 1) == 0) { /* terminate this hash */ if ((err = sha256_done(&prng->fortuna.pool[x], tmp)) != CRYPT_OK) { sha256_done(&md, tmp); - return err; + return err; } /* add it to the string */ if ((err = sha256_process(&md, tmp, 32)) != CRYPT_OK) { @@ -102,7 +102,7 @@ static int fortuna_reseed(prng_state *prng) /* finish key */ if ((err = sha256_done(&md, prng->fortuna.K)) != CRYPT_OK) { - return err; + return err; } if ((err = rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey)) != CRYPT_OK) { return err; @@ -126,14 +126,14 @@ static int fortuna_reseed(prng_state *prng) Start the PRNG @param prng [out] The PRNG state to initialize @return CRYPT_OK if successful -*/ +*/ int fortuna_start(prng_state *prng) { int err, x, y; unsigned char tmp[MAXBLOCKSIZE]; LTC_ARGCHK(prng != NULL); - + /* initialize the pools */ for (x = 0; x < LTC_FORTUNA_POOLS; x++) { if ((err = sha256_init(&prng->fortuna.pool[x])) != CRYPT_OK) { @@ -155,9 +155,9 @@ int fortuna_start(prng_state *prng) return err; } zeromem(prng->fortuna.IV, 16); - + LTC_MUTEX_INIT(&prng->fortuna.prng_lock) - + return CRYPT_OK; } @@ -167,7 +167,7 @@ int fortuna_start(prng_state *prng) @param inlen Length of the data to add @param prng PRNG state to update @return CRYPT_OK if successful -*/ +*/ int fortuna_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { unsigned char tmp[2]; @@ -210,7 +210,7 @@ int fortuna_add_entropy(const unsigned char *in, unsigned long inlen, prng_state Make the PRNG ready to read from @param prng The PRNG to make active @return CRYPT_OK if successful -*/ +*/ int fortuna_ready(prng_state *prng) { return fortuna_reseed(prng); @@ -222,7 +222,7 @@ int fortuna_ready(prng_state *prng) @param outlen Length of output @param prng The active PRNG to read from @return Number of octets read -*/ +*/ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state *prng) { unsigned char tmp[16]; @@ -259,14 +259,14 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state XMEMCPY(out, tmp, outlen); fortuna_update_iv(prng); } - + /* generate new key */ - rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K , &prng->fortuna.skey); + rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K , &prng->fortuna.skey); fortuna_update_iv(prng); - - rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K+16, &prng->fortuna.skey); + + rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K+16, &prng->fortuna.skey); fortuna_update_iv(prng); - + if (rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); return 0; @@ -277,13 +277,13 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state #endif LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); return tlen; -} +} /** Terminate the PRNG @param prng The PRNG to terminate @return CRYPT_OK if successful -*/ +*/ int fortuna_done(prng_state *prng) { int err, x; @@ -296,7 +296,7 @@ int fortuna_done(prng_state *prng) for (x = 0; x < LTC_FORTUNA_POOLS; x++) { if ((err = sha256_done(&(prng->fortuna.pool[x]), tmp)) != CRYPT_OK) { LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return err; + return err; } } /* call cipher done when we invent one ;-) */ @@ -315,7 +315,7 @@ int fortuna_done(prng_state *prng) @param outlen [in/out] Max size and resulting size of the state @param prng The PRNG to export @return CRYPT_OK if successful -*/ +*/ int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { int x, err; @@ -340,9 +340,9 @@ int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng) return CRYPT_MEM; } - /* to emit the state we copy each pool, terminate it then hash it again so - * an attacker who sees the state can't determine the current state of the PRNG - */ + /* to emit the state we copy each pool, terminate it then hash it again so + * an attacker who sees the state can't determine the current state of the PRNG + */ for (x = 0; x < LTC_FORTUNA_POOLS; x++) { /* copy the PRNG */ XMEMCPY(md, &(prng->fortuna.pool[x]), sizeof(*md)); @@ -374,14 +374,14 @@ int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng) LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); return err; } - + /** Import a PRNG state @param in The PRNG state @param inlen Size of the state @param prng The PRNG to import @return CRYPT_OK if successful -*/ +*/ int fortuna_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { int err, x; @@ -407,7 +407,7 @@ int fortuna_import(const unsigned char *in, unsigned long inlen, prng_state *prn /** PRNG self-test @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled -*/ +*/ int fortuna_test(void) { #ifndef LTC_TEST diff --git a/src/prngs/rc4.c b/src/prngs/rc4.c index 15c74e31d..2583451f9 100644 --- a/src/prngs/rc4.c +++ b/src/prngs/rc4.c @@ -13,11 +13,11 @@ /** @file rc4.c LTC_RC4 PRNG, Tom St Denis -*/ +*/ #ifdef LTC_RC4 -const struct ltc_prng_descriptor rc4_desc = +const struct ltc_prng_descriptor rc4_desc = { "rc4", 32, &rc4_start, @@ -34,14 +34,14 @@ const struct ltc_prng_descriptor rc4_desc = Start the PRNG @param prng [out] The PRNG state to initialize @return CRYPT_OK if successful -*/ +*/ int rc4_start(prng_state *prng) { LTC_ARGCHK(prng != NULL); /* set keysize to zero */ prng->rc4.x = 0; - + return CRYPT_OK; } @@ -51,12 +51,12 @@ int rc4_start(prng_state *prng) @param inlen Length of the data to add @param prng PRNG state to update @return CRYPT_OK if successful -*/ +*/ int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); - + /* trim as required */ if (prng->rc4.x + inlen > 256) { if (prng->rc4.x == 256) { @@ -65,7 +65,7 @@ int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *pr } else { /* only accept part of it */ inlen = 256 - prng->rc4.x; - } + } } while (inlen--) { @@ -73,14 +73,14 @@ int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *pr } return CRYPT_OK; - + } /** Make the PRNG ready to read from @param prng The PRNG to make active @return CRYPT_OK if successful -*/ +*/ int rc4_ready(prng_state *prng) { unsigned char key[256], tmp, *s; @@ -101,7 +101,7 @@ int rc4_ready(prng_state *prng) for (j = x = y = 0; x < 256; x++) { y = (y + prng->rc4.buf[x] + key[j++]) & 255; if (j == keylen) { - j = 0; + j = 0; } tmp = s[x]; s[x] = s[y]; s[y] = tmp; } @@ -121,7 +121,7 @@ int rc4_ready(prng_state *prng) @param outlen Length of output @param prng The active PRNG to read from @return Number of octets read -*/ +*/ unsigned long rc4_read(unsigned char *out, unsigned long outlen, prng_state *prng) { unsigned char x, y, *s, tmp; @@ -154,7 +154,7 @@ unsigned long rc4_read(unsigned char *out, unsigned long outlen, prng_state *prn Terminate the PRNG @param prng The PRNG to terminate @return CRYPT_OK if successful -*/ +*/ int rc4_done(prng_state *prng) { LTC_ARGCHK(prng != NULL); @@ -167,7 +167,7 @@ int rc4_done(prng_state *prng) @param outlen [in/out] Max size and resulting size of the state @param prng The PRNG to export @return CRYPT_OK if successful -*/ +*/ int rc4_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { LTC_ARGCHK(outlen != NULL); @@ -186,14 +186,14 @@ int rc4_export(unsigned char *out, unsigned long *outlen, prng_state *prng) return CRYPT_OK; } - + /** Import a PRNG state @param in The PRNG state @param inlen Size of the state @param prng The PRNG to import @return CRYPT_OK if successful -*/ +*/ int rc4_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { int err; @@ -203,7 +203,7 @@ int rc4_import(const unsigned char *in, unsigned long inlen, prng_state *prng) if (inlen != 32) { return CRYPT_INVALID_ARG; } - + if ((err = rc4_start(prng)) != CRYPT_OK) { return err; } @@ -213,7 +213,7 @@ int rc4_import(const unsigned char *in, unsigned long inlen, prng_state *prng) /** PRNG self-test @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled -*/ +*/ int rc4_test(void) { #if !defined(LTC_TEST) || defined(LTC_VALGRIND) @@ -250,7 +250,7 @@ int rc4_test(void) if (XMEMCMP(dst, tests[x].ct, 8)) { #if 0 int y; - printf("\n\nLTC_RC4 failed, I got:\n"); + printf("\n\nLTC_RC4 failed, I got:\n"); for (y = 0; y < 8; y++) printf("%02x ", dst[y]); printf("\n"); #endif From 649ef0faefce468b3e37c3dc7432c09c29ea4209 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 24 Feb 2017 16:54:01 +0100 Subject: [PATCH 0438/1192] forgotten trailing space --- src/hashes/sha2/sha256.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index 255c7ec63..13ec9e67f 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -27,7 +27,7 @@ const struct ltc_hash_descriptor sha256_desc = /* OID */ { 2, 16, 840, 1, 101, 3, 4, 2, 1, }, 9, - + &sha256_init, &sha256_process, &sha256_done, From 203087d6d7c6eff5d348bb55f752448628a54db0 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 19 Dec 2015 17:50:02 +0100 Subject: [PATCH 0439/1192] bug: wrong parentheses in condition with assignment --- src/modes/xts/xts_decrypt.c | 4 ++-- src/modes/xts/xts_encrypt.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index 1840b17d4..d1be2c19f 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -94,8 +94,8 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, if (cipher_descriptor[xts->cipher].accel_xts_decrypt && lim > 0) { /* use accelerated decryption for whole blocks */ - if ((err = cipher_descriptor[xts->cipher].accel_xts_decrypt(ct, pt, lim, tweak, &xts->key1, &xts->key2) != - CRYPT_OK)) { + if ((err = cipher_descriptor[xts->cipher].accel_xts_decrypt(ct, pt, lim, tweak, &xts->key1, &xts->key2)) != + CRYPT_OK) { return err; } ct += lim * 16; diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index 1f6dea387..77c7e8c2e 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -96,8 +96,8 @@ int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, if (cipher_descriptor[xts->cipher].accel_xts_encrypt && lim > 0) { /* use accelerated encryption for whole blocks */ - if ((err = cipher_descriptor[xts->cipher].accel_xts_encrypt(pt, ct, lim, tweak, &xts->key1, &xts->key2) != - CRYPT_OK)) { + if ((err = cipher_descriptor[xts->cipher].accel_xts_encrypt(pt, ct, lim, tweak, &xts->key1, &xts->key2)) != + CRYPT_OK) { return err; } ct += lim * 16; From 31f88a9c9b68e7481c76299748b6b3fe7566e261 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 18 Dec 2015 16:26:07 +0100 Subject: [PATCH 0440/1192] default for switch --- src/math/ltm_desc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index 5ff8ff842..22937e83c 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -126,8 +126,8 @@ static int compare(void *a, void *b) case MP_LT: return LTC_MP_LT; case MP_EQ: return LTC_MP_EQ; case MP_GT: return LTC_MP_GT; + default: return 0; } - return 0; } static int compare_d(void *a, unsigned long b) @@ -139,8 +139,8 @@ static int compare_d(void *a, unsigned long b) case MP_LT: return LTC_MP_LT; case MP_EQ: return LTC_MP_EQ; case MP_GT: return LTC_MP_GT; + default: return 0; } - return 0; } static int count_bits(void *a) From 79d6e61aca49d3abf52b3350f879e098b63edf03 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Mon, 25 Jul 2016 18:18:18 +0200 Subject: [PATCH 0441/1192] use the variable 'err' --- src/encauth/ccm/ccm_add_aad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encauth/ccm/ccm_add_aad.c b/src/encauth/ccm/ccm_add_aad.c index 3dcf3ff7d..43a3d5374 100644 --- a/src/encauth/ccm/ccm_add_aad.c +++ b/src/encauth/ccm/ccm_add_aad.c @@ -38,7 +38,7 @@ int ccm_add_aad(ccm_state *ccm, if (ccm->x == 16) { /* full block so let's encrypt it */ if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { - return CRYPT_ERROR; + return err; } ccm->x = 0; } @@ -49,7 +49,7 @@ int ccm_add_aad(ccm_state *ccm, if (ccm->aadlen == ccm->current_aadlen) { if (ccm->x != 0) { if ((err = cipher_descriptor[ccm->cipher].ecb_encrypt(ccm->PAD, ccm->PAD, &ccm->K)) != CRYPT_OK) { - return CRYPT_ERROR; + return err; } } ccm->x = 0; From b0f06ed1ec667030dce47f754b11016d005d4f99 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 19 Dec 2015 17:36:22 +0100 Subject: [PATCH 0442/1192] add parenthese in macro --- src/hashes/whirl/whirl.c | 4 ++-- src/headers/tomcrypt_macros.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hashes/whirl/whirl.c b/src/hashes/whirl/whirl.c index af5625a7e..525d75bed 100644 --- a/src/hashes/whirl/whirl.c +++ b/src/hashes/whirl/whirl.c @@ -45,14 +45,14 @@ const struct ltc_hash_descriptor whirlpool_desc = /* shortcut macro to perform three functions at once */ #define theta_pi_gamma(a, i) \ - SB0(GB(a, i-0, 7)) ^ \ + (SB0(GB(a, i-0, 7)) ^ \ SB1(GB(a, i-1, 6)) ^ \ SB2(GB(a, i-2, 5)) ^ \ SB3(GB(a, i-3, 4)) ^ \ SB4(GB(a, i-4, 3)) ^ \ SB5(GB(a, i-5, 2)) ^ \ SB6(GB(a, i-6, 1)) ^ \ - SB7(GB(a, i-7, 0)) + SB7(GB(a, i-7, 0))) #ifdef LTC_CLEAN_STACK static int _whirlpool_compress(hash_state *md, unsigned char *buf) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 2bb60cf77..39cf1182b 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -267,7 +267,7 @@ static inline ulong32 ROR(ulong32 word, int i) #ifndef LTC_NO_ROLC #define ROLc(word,i) ({ \ - ulong32 __ROLc_tmp = word; \ + ulong32 __ROLc_tmp = (word); \ __asm__ ("roll %2, %0" : \ "=r" (__ROLc_tmp) : \ "0" (__ROLc_tmp), \ @@ -275,7 +275,7 @@ static inline ulong32 ROR(ulong32 word, int i) __ROLc_tmp; \ }) #define RORc(word,i) ({ \ - ulong32 __RORc_tmp = word; \ + ulong32 __RORc_tmp = (word); \ __asm__ ("rorl %2, %0" : \ "=r" (__RORc_tmp) : \ "0" (__RORc_tmp), \ From fc55a8fd1b10f8b11f3686b10f9d62b3c936dbb1 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 20 Dec 2015 17:05:58 +0100 Subject: [PATCH 0443/1192] remove trailing spaces --- src/pk/ecc/ecc_import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index 9ee97a1a0..124b1b187 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -107,7 +107,7 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co } /* find out what type of key it is */ - if ((err = der_decode_sequence_multi(in, inlen, + if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, &flags, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto done; From 477d6212247fb9644152b908f7a6e51af23c3193 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 24 Feb 2017 20:31:48 +0100 Subject: [PATCH 0444/1192] more trailing spaces + tabs in src --- src/misc/hkdf/hkdf_test.c | 4 ++-- src/pk/dsa/dsa_import_radix.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index 0447d2867..c740b58a9 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -48,9 +48,9 @@ int hkdf_test(void) unsigned char info[80]; unsigned long info_l; unsigned char PRK[32]; - unsigned long PRK_l; + unsigned long PRK_l; unsigned char OKM[82]; - unsigned long OKM_l; + unsigned long OKM_l; } cases[] = { #ifdef LTC_SHA256 /* diff --git a/src/pk/dsa/dsa_import_radix.c b/src/pk/dsa/dsa_import_radix.c index ba9408d24..03e1ba789 100755 --- a/src/pk/dsa/dsa_import_radix.c +++ b/src/pk/dsa/dsa_import_radix.c @@ -37,7 +37,7 @@ int dsa_import_radix(int radix, char *p, char *q, char *g, char *x, char *y, dsa /* init key */ err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL); if (err != CRYPT_OK) return err; - + if ((err = mp_read_radix(key->p , p , radix)) != CRYPT_OK) { goto LBL_ERR; } if ((err = mp_read_radix(key->q , q , radix)) != CRYPT_OK) { goto LBL_ERR; } if ((err = mp_read_radix(key->g , g , radix)) != CRYPT_OK) { goto LBL_ERR; } From 953080bcea1b4fe6965727033b4a2392aae57536 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 24 Feb 2017 20:50:37 +0100 Subject: [PATCH 0445/1192] more trailing spaces + tabs outside of "src" dir --- build.sh | 2 +- coverage.sh | 10 ++-- demos/constants.c | 108 ++++++++++++++++++------------------ demos/demo_dynamic.py | 74 ++++++++++++------------ demos/sizes.c | 96 ++++++++++++++++---------------- parsenames.pl | 6 +- printinfo.sh | 4 +- run.sh | 18 +++--- testme.sh | 6 +- testprof/cipher_hash_test.c | 8 +-- testprof/katja_test.c | 24 ++++---- testprof/mac_test.c | 12 ++-- testprof/makefile.icc | 2 +- testprof/x86_prof.c | 8 +-- 14 files changed, 189 insertions(+), 189 deletions(-) diff --git a/build.sh b/build.sh index 43a447378..7731b3f32 100755 --- a/build.sh +++ b/build.sh @@ -15,7 +15,7 @@ fi CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j$MAKE_JOBS -f $3 all_test 1>gcc_1.txt 2>gcc_2.txt mret=$? cnt=$(wc -l < gcc_2.txt) -# ignore 2 lines since ar prints to stderr instead of stdout and ar is called for +# ignore 2 lines since ar prints to stderr instead of stdout and ar is called for # $(LIBNAME) and testprof/$(LIBTEST_S) if [[ $mret -ne 0 ]] || [[ $cnt -gt 2 ]]; then echo "build $1 failed! printing gcc_2.txt now for convenience" diff --git a/coverage.sh b/coverage.sh index fcdf53df8..cb6c839d0 100755 --- a/coverage.sh +++ b/coverage.sh @@ -20,9 +20,9 @@ bash build.sh " $1" " $2" " $3 COVERAGE=1" "$4 -fprofile-arcs -ftest-coverage " if [ -a testok.txt ] && [ -f testok.txt ]; then echo else - echo - echo "Test failed" - exit 1 + echo + echo "Test failed" + exit 1 fi ./sizes @@ -30,9 +30,9 @@ fi # if this was executed as './coverage.sh ...' create coverage locally if [[ "${0%% *}" == "./${0##*/}" ]]; then - make lcov-single + make lcov-single else - cpp-coveralls -e 'demos/' -e 'testprof/' -e 'notes/' -e 'src/headers/' + cpp-coveralls -e 'demos/' -e 'testprof/' -e 'notes/' -e 'src/headers/' fi exit 0 diff --git a/demos/constants.c b/demos/constants.c index c55d6df17..b1d611226 100644 --- a/demos/constants.c +++ b/demos/constants.c @@ -1,54 +1,54 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org - */ -#include "tomcrypt.h" - -/** - @file demo_crypt_constants.c - - Demo how to get various constants to dynamic languages - like Python - - Larry Bugbee, February 2013 -*/ - - -int main(void) { - // given a specific constant name, get and print its value - char name[] = "CTR_COUNTER_BIG_ENDIAN"; - int value; - - if (crypt_get_constant(name, &value) != 0) - exit(EXIT_FAILURE); - printf("\n %s is %d \n\n", name, value); - - // get and print the length of the names (and values) list - char *names_list; - unsigned int names_list_len; - - if (crypt_list_all_constants(NULL, &names_list_len) != 0) - exit(EXIT_FAILURE); - printf(" need to allocate %u bytes \n\n", names_list_len); - - // get and print the names (and values) list - if ((names_list = malloc(names_list_len)) == NULL) - exit(EXIT_FAILURE); - if (crypt_list_all_constants(names_list, &names_list_len) != 0) - exit(EXIT_FAILURE); - printf(" supported constants:\n\n%s\n\n", names_list); - free(names_list); - - return 0; -} - - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file demo_crypt_constants.c + + Demo how to get various constants to dynamic languages + like Python + + Larry Bugbee, February 2013 +*/ + + +int main(void) { + // given a specific constant name, get and print its value + char name[] = "CTR_COUNTER_BIG_ENDIAN"; + int value; + + if (crypt_get_constant(name, &value) != 0) + exit(EXIT_FAILURE); + printf("\n %s is %d \n\n", name, value); + + // get and print the length of the names (and values) list + char *names_list; + unsigned int names_list_len; + + if (crypt_list_all_constants(NULL, &names_list_len) != 0) + exit(EXIT_FAILURE); + printf(" need to allocate %u bytes \n\n", names_list_len); + + // get and print the names (and values) list + if ((names_list = malloc(names_list_len)) == NULL) + exit(EXIT_FAILURE); + if (crypt_list_all_constants(names_list, &names_list_len) != 0) + exit(EXIT_FAILURE); + printf(" supported constants:\n\n%s\n\n", names_list); + free(names_list); + + return 0; +} + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index 81f6f8b75..97e4855aa 100755 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -1,42 +1,42 @@ -""" +""" demo_dynamic.py v1 - - This program demonstrates Python's use of the dynamic - language support additions to LTC, namely access to LTC - constants, struct and union sizes, and the binding of a - math package to LTC. Also provided are simple code - fragments to illustrate how one might write a Python - wrapper for LTC and how an app might call the wrapper. - This or a similar model should work for Ruby and other + + This program demonstrates Python's use of the dynamic + language support additions to LTC, namely access to LTC + constants, struct and union sizes, and the binding of a + math package to LTC. Also provided are simple code + fragments to illustrate how one might write a Python + wrapper for LTC and how an app might call the wrapper. + This or a similar model should work for Ruby and other dynamic languages. - - This instance uses Python's ctypes and requires a single - .dylib linking together LTC and a math library. Building - a single .dylib is needed because LTC wants a fairly tight - relationship between itself and the mathlib. (ctypes can - load multiple .dylibs, but it does not support this level + + This instance uses Python's ctypes and requires a single + .dylib linking together LTC and a math library. Building + a single .dylib is needed because LTC wants a fairly tight + relationship between itself and the mathlib. (ctypes can + load multiple .dylibs, but it does not support this level of tight coupling between otherwise independent libraries.) - + My .dylib was created on OSX with the following steps: - + 1- compile LTC to a .a static lib: CFLAGS="-DLTM_DESC -DUSE_LTM" make - + 2- link LTC and LTM into a single .dylib: ar2dylib_with tomcrypt tommath - where ar2dylib_with is a shell script that combines + where ar2dylib_with is a shell script that combines the LTC .a with the LTM .dylib - + Reminder: you don't need to bind in a math library unless - you are going to use LTC functions that depend - on a mathlib. For example, public key crypto - needs a mathlib; hashing and symmetric encryption + you are going to use LTC functions that depend + on a mathlib. For example, public key crypto + needs a mathlib; hashing and symmetric encryption do not. - + This code was written for Python 2.7. - + Larry Bugbee March 2014 @@ -65,34 +65,34 @@ #--------------------------------------------------------------- -# get list of all supported constants followed by a list of all -# supported sizes. One alternative: these lists may be parsed +# get list of all supported constants followed by a list of all +# supported sizes. One alternative: these lists may be parsed # and used as needed. if 1: print ' all supported constants and their values:' - + # get size to allocate for constants output list str_len = c_int(0) ret = LTC.crypt_list_all_constants(None, byref(str_len)) print ' need to allocate %d bytes \n' % str_len.value - + # allocate that size and get (name, size) pairs, each pair # separated by a newline char. names_sizes = c_buffer(str_len.value) ret = LTC.crypt_list_all_constants(names_sizes, byref(str_len)) print names_sizes.value print - - + + if 1: print ' all supported sizes:' - + # get size to allocate for sizes output list str_len = c_int(0) ret = LTC.crypt_list_all_sizes(None, byref(str_len)) print ' need to allocate %d bytes \n' % str_len.value - + # allocate that size and get (name, size) pairs, each pair # separated by a newline char. names_sizes = c_buffer(str_len.value) @@ -107,7 +107,7 @@ # print selected constants if 1: print '\n selected constants:' - + names = [ 'ENDIAN_LITTLE', 'ENDIAN_64BITWORD', @@ -124,7 +124,7 @@ # print selected sizes if 1: print '\n selected sizes:' - + names = [ 'rijndael_key', 'rsa_key', @@ -143,7 +143,7 @@ #--------------------------------------------------------------- #--------------------------------------------------------------- -# ctypes getting a list of this build's supported algorithms +# ctypes getting a list of this build's supported algorithms # and compiler switches def get_named_string(lib, name): @@ -160,7 +160,7 @@ def get_named_string(lib, name): #--------------------------------------------------------------- #--------------------------------------------------------------- -# here is an example of how a wrapper can make Python access +# here is an example of how a wrapper can make Python access # more Pythonic # - - - - - - - - - - - - - diff --git a/demos/sizes.c b/demos/sizes.c index a2da0a734..cacf5c635 100644 --- a/demos/sizes.c +++ b/demos/sizes.c @@ -1,48 +1,48 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org - */ -#include "tomcrypt.h" - -/** - @file demo_crypt_sizes.c - - Demo how to get various sizes to dynamic languages - like Python - Larry Bugbee, February 2013 -*/ - - -int main(void) { - - // given a specific size name, get and print its size - char name[] = "ecc_key"; - unsigned int size; - if(crypt_get_size(name, &size) != 0) - exit(EXIT_FAILURE); - printf("\n size of '%s' is %u \n\n", name, size); - - // get and print the length of the names (and sizes) list - char *sizes_list; - unsigned int sizes_list_len; - if(crypt_list_all_sizes(NULL, &sizes_list_len) != 0) - exit(EXIT_FAILURE); - printf(" need to allocate %u bytes \n\n", sizes_list_len); - - // get and print the names (and sizes) list - sizes_list = malloc(sizes_list_len); - if(crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) - exit(EXIT_FAILURE); - printf(" supported sizes:\n\n%s\n\n", sizes_list); - return 0; -} - - -/* $Source: $ */ -/* $Revision: $ */ -/* $Date: $ */ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file demo_crypt_sizes.c + + Demo how to get various sizes to dynamic languages + like Python - Larry Bugbee, February 2013 +*/ + + +int main(void) { + + // given a specific size name, get and print its size + char name[] = "ecc_key"; + unsigned int size; + if(crypt_get_size(name, &size) != 0) + exit(EXIT_FAILURE); + printf("\n size of '%s' is %u \n\n", name, size); + + // get and print the length of the names (and sizes) list + char *sizes_list; + unsigned int sizes_list_len; + if(crypt_list_all_sizes(NULL, &sizes_list_len) != 0) + exit(EXIT_FAILURE); + printf(" need to allocate %u bytes \n\n", sizes_list_len); + + // get and print the names (and sizes) list + sizes_list = malloc(sizes_list_len); + if(crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) + exit(EXIT_FAILURE); + printf(" supported sizes:\n\n%s\n\n", sizes_list); + return 0; +} + + +/* $Source: $ */ +/* $Revision: $ */ +/* $Date: $ */ diff --git a/parsenames.pl b/parsenames.pl index 385e6f2cd..8e6bc5ed2 100755 --- a/parsenames.pl +++ b/parsenames.pl @@ -1,8 +1,8 @@ #!/usr/bin/perl # -# Splits the list of files and outputs for makefile type files -# wrapped at 80 chars -# +# Splits the list of files and outputs for makefile type files +# wrapped at 80 chars +# # Tom St Denis @a = split(" ", $ARGV[1]); $b = "$ARGV[0]="; diff --git a/printinfo.sh b/printinfo.sh index 1249e090a..e6b7312c3 100644 --- a/printinfo.sh +++ b/printinfo.sh @@ -3,7 +3,7 @@ version=$(git describe --tags --always --dirty 2>/dev/null) if [ ! -e ".git" ] || [ -z $version ] then - version=$(grep "^VERSION=" makefile | sed "s/.*=//") + version=$(grep "^VERSION=" makefile | sed "s/.*=//") fi echo "Testing version:" $version #grep "VERSION=" makefile | perl -e "@a = split('=', <>); print @a[1];"` @@ -14,7 +14,7 @@ echo "uname="`uname -a` # get gcc name if [ -z ${CC} ] then - CC="gcc" + CC="gcc" fi echo "${CC}="`${CC} -dumpversion` echo diff --git a/run.sh b/run.sh index 22a8332ba..8d778b367 100755 --- a/run.sh +++ b/run.sh @@ -7,9 +7,9 @@ bash build.sh " $1" "$2 -O2" "$3 IGNORE_SPEED=1" "$4" "$5" if [ -a testok.txt ] && [ -f testok.txt ]; then echo else - echo - echo "Test failed" - exit 1 + echo + echo "Test failed" + exit 1 fi rm -f testok.txt @@ -17,9 +17,9 @@ bash build.sh " $1" "$2 -Os" " $3 IGNORE_SPEED=1 LTC_SMALL=1" "$4" "$5" if [ -a testok.txt ] && [ -f testok.txt ]; then echo else - echo - echo "Test failed" - exit 1 + echo + echo "Test failed" + exit 1 fi rm -f testok.txt @@ -27,9 +27,9 @@ bash build.sh " $1" " $2" " $3 " "$4" "$5" if [ -a testok.txt ] && [ -f testok.txt ]; then echo else - echo - echo "Test failed" - exit 1 + echo + echo "Test failed" + exit 1 fi exit 0 diff --git a/testme.sh b/testme.sh index d2e9e74df..873ad45ab 100755 --- a/testme.sh +++ b/testme.sh @@ -55,6 +55,6 @@ bash testbuild.sh "NOTEST" "-DLTC_NO_TEST" "$1" "$2" "$3" || exit 1 # test build with no file routines bash testbuild.sh "NOFILE" "-DLTC_NO_FILE" "$1" "$2" "$3" || exit 1 -# $Source$ -# $Revision$ -# $Date$ +# $Source$ +# $Revision$ +# $Date$ diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index dba7d9adc..6dd04daec 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -8,17 +8,17 @@ int cipher_hash_test(void) unsigned char buf[4096]; unsigned long n; prng_state nprng; - + /* test ciphers */ for (x = 0; cipher_descriptor[x].name != NULL; x++) { DOX(cipher_descriptor[x].test(), cipher_descriptor[x].name); } - + /* test hashes */ for (x = 0; hash_descriptor[x].name != NULL; x++) { DOX(hash_descriptor[x].test(), hash_descriptor[x].name); } - + /* test prngs (test, import/export */ for (x = 0; prng_descriptor[x].name != NULL; x++) { DOX(prng_descriptor[x].test(), prng_descriptor[x].name); @@ -36,7 +36,7 @@ int cipher_hash_test(void) } prng_descriptor[x].done(&nprng); } - + return 0; } diff --git a/testprof/katja_test.c b/testprof/katja_test.c index a59789251..68f19a3d8 100644 --- a/testprof/katja_test.c +++ b/testprof/katja_test.c @@ -18,7 +18,7 @@ int katja_test(void) } for (size = 1024; size <= 2048; size += 256) { - + /* make 10 random key */ for (cnt = 0; cnt < 10; cnt++) { DO(katja_make_key(&yarrow_prng, prng_idx, size/8, &key)); @@ -65,7 +65,7 @@ for (cnt = 0; cnt < len; ) { len = sizeof(out); len2 = kat_msgsize; - + DO(katja_encrypt_key(in, kat_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, hash_idx, &key)); /* change a byte */ out[8] ^= 1; @@ -86,7 +86,7 @@ for (cnt = 0; cnt < len; ) { if (len2 != kat_msgsize || memcmp(tmp, in, kat_msgsize)) { unsigned long x; fprintf(stderr, "\nkatja_decrypt_key mismatch, len %lu (second decrypt)\n", len2); - fprintf(stderr, "Original contents: \n"); + fprintf(stderr, "Original contents: \n"); for (x = 0; x < kat_msgsize; ) { fprintf(stderr, "%02x ", in[x]); if (!(++x % 16)) { @@ -94,13 +94,13 @@ for (cnt = 0; cnt < len; ) { } } fprintf(stderr, "\n"); - fprintf(stderr, "Output contents: \n"); + fprintf(stderr, "Output contents: \n"); for (x = 0; x < kat_msgsize; ) { fprintf(stderr, "%02x ", out[x]); if (!(++x % 16)) { fprintf(stderr, "\n"); } - } + } fprintf(stderr, "\n"); return 1; } @@ -142,8 +142,8 @@ for (cnt = 0; cnt < len; ) { /* export key and import as both private and public */ len2 = sizeof(tmp); - DO(katja_export(tmp, &len2, PK_PRIVATE, &key)); - DO(katja_import(tmp, len2, &privKey)); + DO(katja_export(tmp, &len2, PK_PRIVATE, &key)); + DO(katja_import(tmp, len2, &privKey)); len2 = sizeof(tmp); DO(katja_export(tmp, &len2, PK_PUBLIC, &key)); DO(katja_import(tmp, len2, &pubKey)); @@ -153,7 +153,7 @@ for (cnt = 0; cnt < len; ) { /* change a byte */ in[0] ^= 1; DO(katja_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &key)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "katja_verify_hash (unsalted, origKey) failed, %d, %d", stat, stat2); katja_free(&key); @@ -169,7 +169,7 @@ for (cnt = 0; cnt < len; ) { /* change a byte */ in[0] ^= 1; DO(katja_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &privKey)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "katja_verify_hash (unsalted, privKey) failed, %d, %d", stat, stat2); katja_free(&key); @@ -185,7 +185,7 @@ for (cnt = 0; cnt < len; ) { /* change a byte */ in[0] ^= 1; DO(katja_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &pubKey)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "katja_verify_hash (unsalted, pubkey) failed, %d, %d", stat, stat2); katja_free(&key); @@ -201,7 +201,7 @@ for (cnt = 0; cnt < len; ) { /* change a byte */ in[0] ^= 1; DO(katja_verify_hash(out, len, in, 20, hash_idx, 8, &stat2, &pubKey)); - + if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "katja_verify_hash (salted) failed, %d, %d", stat, stat2); katja_free(&key); @@ -215,7 +215,7 @@ for (cnt = 0; cnt < len; ) { katja_free(&pubKey); katja_free(&privKey); } - + /* free the key and return */ return 0; } diff --git a/testprof/mac_test.c b/testprof/mac_test.c index f2fa9da36..d6666b2df 100644 --- a/testprof/mac_test.c +++ b/testprof/mac_test.c @@ -4,13 +4,13 @@ int mac_test(void) { #ifdef LTC_HMAC - DO(hmac_test()); + DO(hmac_test()); #endif #ifdef LTC_PMAC - DO(pmac_test()); + DO(pmac_test()); #endif #ifdef LTC_OMAC - DO(omac_test()); + DO(omac_test()); #endif #ifdef LTC_XCBC DO(xcbc_test()); @@ -19,13 +19,13 @@ int mac_test(void) DO(f9_test()); #endif #ifdef LTC_EAX_MODE - DO(eax_test()); + DO(eax_test()); #endif #ifdef LTC_OCB_MODE - DO(ocb_test()); + DO(ocb_test()); #endif #ifdef LTC_OCB3_MODE - DO(ocb3_test()); + DO(ocb3_test()); #endif #ifdef LTC_CCM_MODE DO(ccm_test()); diff --git a/testprof/makefile.icc b/testprof/makefile.icc index 21c5807fa..f80cd1d9e 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -1,4 +1,4 @@ -CFLAGS += -I../src/headers -I./ +CFLAGS += -I../src/headers -I./ CC?=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index f2bb9143e..3d8787ca9 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -1099,7 +1099,7 @@ void time_rsa(void) t2 <<= 8; break; #endif - } + } t2 >>= 8; fprintf(stderr, "RSA-%lu sign_hash took %15"PRI64"u cycles\n", x, t2); @@ -1121,7 +1121,7 @@ void time_rsa(void) t2 <<= 11; break; #endif - } + } t2 >>= 11; fprintf(stderr, "RSA-%lu verify_hash took %15"PRI64"u cycles\n", x, t2); fprintf(stderr, "\n\n"); @@ -1317,7 +1317,7 @@ void time_ecc(void) t2 <<= 8; break; #endif - } + } t2 >>= 8; fprintf(stderr, "ECC-%lu sign_hash took %15"PRI64"u cycles\n", x*8, t2); @@ -1339,7 +1339,7 @@ void time_ecc(void) t2 <<= 8; break; #endif - } + } t2 >>= 8; fprintf(stderr, "ECC-%lu verify_hash took %15"PRI64"u cycles\n", x*8, t2); From c911427cf24e82eab1e1511e42f3218f90bb4e6b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 24 Feb 2017 20:51:31 +0100 Subject: [PATCH 0446/1192] check-source.pl script for checking whitespace related troubles --- check-source.pl | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 check-source.pl diff --git a/check-source.pl b/check-source.pl new file mode 100755 index 000000000..e8cbd202b --- /dev/null +++ b/check-source.pl @@ -0,0 +1,45 @@ +#!/usr/bin/env perl + +# tests source files for unwanted issues: +# - CRLF newlines +# - tabs \t +# - trailing spaces +# - unresolved merge conflicts + +use strict; +use warnings; + +use Test::More; +use File::Find 'find'; +use File::Basename 'basename'; +use File::Glob 'bsd_glob'; + +sub read_file { + my $f = shift; + open my $fh, "<:raw", $f or die "FATAL: read_rawfile() cannot open file '$f': $!"; + return do { local $/; <$fh> }; +} + +my @all_files = (bsd_glob("makefile*"), bsd_glob("*.sh"), bsd_glob("*.pl")); +find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src testprof demos/); + +my $fails = 0; +for my $file (sort @all_files) { + next unless $file =~ /\.(c|h|pl|py|sh)$/ || basename($file) =~ /^makefile/i; + my $troubles = {}; + my $lineno = 1; + my $content = read_file($file); + push @{$troubles->{crlf_line_end}}, '?' if $content =~ /\r/; + for my $l (split /\n/, $content) { + push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/; + push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/; + push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i; + $lineno++; + } + for my $k (sort keys %$troubles) { + warn "FAIL: [$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n"; + $fails++; + } +} + +warn $fails > 0 ? "FAILED $fails\n" : "PASS\n"; \ No newline at end of file From 824f3af98c68880ba2d186d0632996730dd58a98 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 24 Feb 2017 20:57:47 +0100 Subject: [PATCH 0447/1192] check-source.pl cosmetics --- check-source.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check-source.pl b/check-source.pl index e8cbd202b..a81ce24c0 100755 --- a/check-source.pl +++ b/check-source.pl @@ -42,4 +42,5 @@ sub read_file { } } -warn $fails > 0 ? "FAILED $fails\n" : "PASS\n"; \ No newline at end of file +die "FAILED $fails\n" if $fails > 0; +warn "PASS\n"; From 4349993ad38eaa9a3f1fec622343b02d0501ee07 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 24 Feb 2017 18:10:08 +0100 Subject: [PATCH 0448/1192] Suspicious use of & (part 2) --- src/misc/adler32.c | 2 +- src/pk/ecc/ecc_import.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/adler32.c b/src/misc/adler32.c index 48f404ccb..dd1010fa2 100644 --- a/src/misc/adler32.c +++ b/src/misc/adler32.c @@ -115,7 +115,7 @@ int adler32_test(void) adler32_state ctx; adler32_init(&ctx); adler32_update(&ctx, in, strlen(in)); - adler32_finish(&ctx, &out, 4); + adler32_finish(&ctx, out, 4); if (XMEMCMP(adler32, out, 4)) { #ifdef LTC_TEST_DBG ulong32 _out, _adler32; diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index 124b1b187..e40865aaf 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -108,7 +108,7 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co /* find out what type of key it is */ if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_BIT_STRING, 1UL, &flags, + LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto done; } From 7246ab50dae2c2a8dbb5b49d9b774b050fa1c55d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 24 Feb 2017 21:22:53 +0100 Subject: [PATCH 0449/1192] fix coverity finding: cbc_decrypt out-of-bound read --- src/modes/cbc/cbc_decrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modes/cbc/cbc_decrypt.c b/src/modes/cbc/cbc_decrypt.c index fb67cb854..5948f213e 100644 --- a/src/modes/cbc/cbc_decrypt.c +++ b/src/modes/cbc/cbc_decrypt.c @@ -45,7 +45,7 @@ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s } /* is blocklen valid? */ - if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV)) { + if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV) || cbc->blocklen > (int)sizeof(tmp)) { return CRYPT_INVALID_ARG; } From e187f4cbf4b2bf8bb74b8a0c5cc1d1045b190130 Mon Sep 17 00:00:00 2001 From: Matt Kelly Date: Tue, 28 Jun 2016 00:34:37 -0400 Subject: [PATCH 0450/1192] Fix all warnings from -Wcast-align --- src/encauth/ccm/ccm_memory.c | 10 +++++----- src/encauth/ccm/ccm_memory_ex.c | 8 ++++---- src/encauth/gcm/gcm_add_aad.c | 2 +- src/encauth/gcm/gcm_add_iv.c | 2 +- src/encauth/gcm/gcm_mult_h.c | 2 +- src/encauth/gcm/gcm_process.c | 8 ++++---- src/headers/tomcrypt_cfg.h | 1 + src/mac/f9/f9_process.c | 4 ++-- src/mac/omac/omac_process.c | 2 +- src/mac/pelican/pelican.c | 2 +- src/mac/pmac/pmac_process.c | 4 ++-- src/mac/pmac/pmac_shift_xor.c | 4 ++-- src/mac/xcbc/xcbc_process.c | 2 +- src/modes/cbc/cbc_decrypt.c | 6 +++--- src/modes/cbc/cbc_encrypt.c | 4 ++-- src/modes/ctr/ctr_encrypt.c | 4 ++-- src/modes/f8/f8_encrypt.c | 4 ++-- src/modes/lrw/lrw_process.c | 6 +++--- src/modes/lrw/lrw_setiv.c | 2 +- src/modes/xts/xts_decrypt.c | 4 ++-- src/modes/xts/xts_encrypt.c | 4 ++-- testprof/store_test.c | 2 +- 22 files changed, 44 insertions(+), 43 deletions(-) diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index cac7f46ab..eb41f99b3 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -256,8 +256,8 @@ int ccm_memory(int cipher, /* xor the PT against the pad first */ for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&PAD[z])) ^= *((LTC_FAST_TYPE*)(&pt[y+z])); - *((LTC_FAST_TYPE*)(&ct[y+z])) = *((LTC_FAST_TYPE*)(&pt[y+z])) ^ *((LTC_FAST_TYPE*)(&CTRPAD[z])); + *(LTC_FAST_TYPE_PTR_CAST(&PAD[z])) ^= *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])); + *(LTC_FAST_TYPE_PTR_CAST(&ct[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) ^ *(LTC_FAST_TYPE_PTR_CAST(&CTRPAD[z])); } if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { goto error; @@ -276,8 +276,8 @@ int ccm_memory(int cipher, /* xor the PT against the pad last */ for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&pt[y+z])) = *((LTC_FAST_TYPE*)(&ct[y+z])) ^ *((LTC_FAST_TYPE*)(&CTRPAD[z])); - *((LTC_FAST_TYPE*)(&PAD[z])) ^= *((LTC_FAST_TYPE*)(&pt[y+z])); + *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&ct[y+z])) ^ *(LTC_FAST_TYPE_PTR_CAST(&CTRPAD[z])); + *(LTC_FAST_TYPE_PTR_CAST(&PAD[z])) ^= *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])); } if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { goto error; @@ -366,7 +366,7 @@ int ccm_memory(int cipher, if (ptlen & ~15) { for (; y < (ptlen & ~15); y += 16) { for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&pt_real[y+z])) = *((LTC_FAST_TYPE*)(&pt[y+z])) & fastMask; + *(LTC_FAST_TYPE_PTR_CAST(&pt_real[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) & fastMask; } } } diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c index 026579464..4b09ddc57 100644 --- a/src/encauth/ccm/ccm_memory_ex.c +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -260,8 +260,8 @@ if (CTR == NULL) { /* xor the PT against the pad first */ for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&PAD[z])) ^= *((LTC_FAST_TYPE*)(&pt[y+z])); - *((LTC_FAST_TYPE*)(&ct[y+z])) = *((LTC_FAST_TYPE*)(&pt[y+z])) ^ *((LTC_FAST_TYPE*)(&CTRPAD[z])); + *(LTC_FAST_TYPE_PTR_CAST(&PAD[z])) ^= *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])); + *(LTC_FAST_TYPE_PTR_CAST(&ct[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) ^ *(LTC_FAST_TYPE_PTR_CAST(&CTRPAD[z])); } if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { goto error; @@ -280,8 +280,8 @@ if (CTR == NULL) { /* xor the PT against the pad last */ for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&pt[y+z])) = *((LTC_FAST_TYPE*)(&ct[y+z])) ^ *((LTC_FAST_TYPE*)(&CTRPAD[z])); - *((LTC_FAST_TYPE*)(&PAD[z])) ^= *((LTC_FAST_TYPE*)(&pt[y+z])); + *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&ct[y+z])) ^ *(LTC_FAST_TYPE_PTR_CAST(&CTRPAD[z])); + *(LTC_FAST_TYPE_PTR_CAST(&PAD[z])) ^= *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])); } if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { goto error; diff --git a/src/encauth/gcm/gcm_add_aad.c b/src/encauth/gcm/gcm_add_aad.c index e09981b9d..b9eb2dfe2 100644 --- a/src/encauth/gcm/gcm_add_aad.c +++ b/src/encauth/gcm/gcm_add_aad.c @@ -92,7 +92,7 @@ int gcm_add_aad(gcm_state *gcm, if (gcm->buflen == 0) { for (x = 0; x < (adatalen & ~15); x += 16) { for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&gcm->X[y])) ^= *((LTC_FAST_TYPE*)(&adata[x + y])); + *(LTC_FAST_TYPE_PTR_CAST(&gcm->X[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&adata[x + y])); } gcm_mult_h(gcm, gcm->X); gcm->totlen += 128; diff --git a/src/encauth/gcm/gcm_add_iv.c b/src/encauth/gcm/gcm_add_iv.c index af2b1b85b..bf0871a01 100644 --- a/src/encauth/gcm/gcm_add_iv.c +++ b/src/encauth/gcm/gcm_add_iv.c @@ -59,7 +59,7 @@ int gcm_add_iv(gcm_state *gcm, if (gcm->buflen == 0) { for (x = 0; x < (IVlen & ~15); x += 16) { for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&gcm->X[y])) ^= *((LTC_FAST_TYPE*)(&IV[x + y])); + *(LTC_FAST_TYPE_PTR_CAST(&gcm->X[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&IV[x + y])); } gcm_mult_h(gcm, gcm->X); gcm->totlen += 128; diff --git a/src/encauth/gcm/gcm_mult_h.c b/src/encauth/gcm/gcm_mult_h.c index c3bff572c..8eee28010 100644 --- a/src/encauth/gcm/gcm_mult_h.c +++ b/src/encauth/gcm/gcm_mult_h.c @@ -38,7 +38,7 @@ void gcm_mult_h(gcm_state *gcm, unsigned char *I) for (x = 1; x < 16; x++) { #ifdef LTC_FAST for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)(T + y)) ^= *((LTC_FAST_TYPE *)(&gcm->PC[x][I[x]][y])); + *(LTC_FAST_TYPE_PTR_CAST(T + y)) ^= *(LTC_FAST_TYPE_PTR_CAST(&gcm->PC[x][I[x]][y])); } #else for (y = 0; y < 16; y++) { diff --git a/src/encauth/gcm/gcm_process.c b/src/encauth/gcm/gcm_process.c index 54fa1d16c..4116db8a7 100644 --- a/src/encauth/gcm/gcm_process.c +++ b/src/encauth/gcm/gcm_process.c @@ -86,8 +86,8 @@ int gcm_process(gcm_state *gcm, for (x = 0; x < (ptlen & ~15); x += 16) { /* ctr encrypt */ for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&ct[x + y])) = *((LTC_FAST_TYPE*)(&pt[x+y])) ^ *((LTC_FAST_TYPE*)(&gcm->buf[y])); - *((LTC_FAST_TYPE*)(&gcm->X[y])) ^= *((LTC_FAST_TYPE*)(&ct[x+y])); + *(LTC_FAST_TYPE_PTR_CAST(&ct[x + y])) = *(LTC_FAST_TYPE_PTR_CAST(&pt[x+y])) ^ *(LTC_FAST_TYPE_PTR_CAST(&gcm->buf[y])); + *(LTC_FAST_TYPE_PTR_CAST(&gcm->X[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&ct[x+y])); } /* GMAC it */ gcm->pttotlen += 128; @@ -104,8 +104,8 @@ int gcm_process(gcm_state *gcm, for (x = 0; x < (ptlen & ~15); x += 16) { /* ctr encrypt */ for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&gcm->X[y])) ^= *((LTC_FAST_TYPE*)(&ct[x+y])); - *((LTC_FAST_TYPE*)(&pt[x + y])) = *((LTC_FAST_TYPE*)(&ct[x+y])) ^ *((LTC_FAST_TYPE*)(&gcm->buf[y])); + *(LTC_FAST_TYPE_PTR_CAST(&gcm->X[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&ct[x+y])); + *(LTC_FAST_TYPE_PTR_CAST(&pt[x + y])) = *(LTC_FAST_TYPE_PTR_CAST(&ct[x+y])) ^ *(LTC_FAST_TYPE_PTR_CAST(&gcm->buf[y])); } /* GMAC it */ gcm->pttotlen += 128; diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 114aaccb4..b0094294c 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -122,6 +122,7 @@ typedef ulong64 __attribute__((__may_alias__)) LTC_FAST_TYPE; #else typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; #endif +#define LTC_FAST_TYPE_PTR_CAST(x) ((LTC_FAST_TYPE*)(void*)(x)) #endif #endif /* LTC_FAST */ diff --git a/src/mac/f9/f9_process.c b/src/mac/f9/f9_process.c index 420bc4f26..42027fda6 100644 --- a/src/mac/f9/f9_process.c +++ b/src/mac/f9/f9_process.c @@ -44,11 +44,11 @@ int f9_process(f9_state *f9, const unsigned char *in, unsigned long inlen) if (f9->buflen == 0) { while (inlen >= (unsigned long)f9->blocksize) { for (x = 0; x < f9->blocksize; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)&(f9->IV[x])) ^= *((LTC_FAST_TYPE*)&(in[x])); + *(LTC_FAST_TYPE_PTR_CAST(&(f9->IV[x]))) ^= *(LTC_FAST_TYPE_PTR_CAST(&(in[x]))); } cipher_descriptor[f9->cipher].ecb_encrypt(f9->IV, f9->IV, &f9->key); for (x = 0; x < f9->blocksize; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)&(f9->ACC[x])) ^= *((LTC_FAST_TYPE*)&(f9->IV[x])); + *(LTC_FAST_TYPE_PTR_CAST(&(f9->ACC[x]))) ^= *(LTC_FAST_TYPE_PTR_CAST(&(f9->IV[x]))); } in += f9->blocksize; inlen -= f9->blocksize; diff --git a/src/mac/omac/omac_process.c b/src/mac/omac/omac_process.c index 8ecac0db5..df9420877 100644 --- a/src/mac/omac/omac_process.c +++ b/src/mac/omac/omac_process.c @@ -49,7 +49,7 @@ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen) unsigned long y; for (x = 0; x < (inlen - blklen); x += blklen) { for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y])); + *(LTC_FAST_TYPE_PTR_CAST(&omac->prev[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&in[y])); } in += blklen; if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) { diff --git a/src/mac/pelican/pelican.c b/src/mac/pelican/pelican.c index 8622f55f1..95af87e0d 100644 --- a/src/mac/pelican/pelican.c +++ b/src/mac/pelican/pelican.c @@ -114,7 +114,7 @@ int pelican_process(pelican_state *pelmac, const unsigned char *in, unsigned lon while (inlen & ~15) { int x; for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)((unsigned char *)pelmac->state + x)) ^= *((LTC_FAST_TYPE*)((unsigned char *)in + x)); + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pelmac->state + x)) ^= *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)in + x)); } four_rounds(pelmac); in += 16; diff --git a/src/mac/pmac/pmac_process.c b/src/mac/pmac/pmac_process.c index 78100630c..9c2678389 100644 --- a/src/mac/pmac/pmac_process.c +++ b/src/mac/pmac/pmac_process.c @@ -48,13 +48,13 @@ int pmac_process(pmac_state *pmac, const unsigned char *in, unsigned long inlen) for (x = 0; x < (inlen - 16); x += 16) { pmac_shift_xor(pmac); for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&Z[y])) = *((LTC_FAST_TYPE*)(&in[y])) ^ *((LTC_FAST_TYPE*)(&pmac->Li[y])); + *(LTC_FAST_TYPE_PTR_CAST(&Z[y])) = *(LTC_FAST_TYPE_PTR_CAST(&in[y])) ^ *(LTC_FAST_TYPE_PTR_CAST(&pmac->Li[y])); } if ((err = cipher_descriptor[pmac->cipher_idx].ecb_encrypt(Z, Z, &pmac->key)) != CRYPT_OK) { return err; } for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&pmac->checksum[y])) ^= *((LTC_FAST_TYPE*)(&Z[y])); + *(LTC_FAST_TYPE_PTR_CAST(&pmac->checksum[y])) ^= *(LTC_FAST_TYPE_PTR_CAST(&Z[y])); } in += 16; } diff --git a/src/mac/pmac/pmac_shift_xor.c b/src/mac/pmac/pmac_shift_xor.c index 27aa6cc43..ac3c12f1e 100644 --- a/src/mac/pmac/pmac_shift_xor.c +++ b/src/mac/pmac/pmac_shift_xor.c @@ -27,8 +27,8 @@ void pmac_shift_xor(pmac_state *pmac) y = pmac_ntz(pmac->block_index++); #ifdef LTC_FAST for (x = 0; x < pmac->block_len; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)((unsigned char *)pmac->Li + x)) ^= - *((LTC_FAST_TYPE*)((unsigned char *)pmac->Ls[y] + x)); + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pmac->Li + x)) ^= + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pmac->Ls[y] + x)); } #else for (x = 0; x < pmac->block_len; x++) { diff --git a/src/mac/xcbc/xcbc_process.c b/src/mac/xcbc/xcbc_process.c index c0798b384..dca321a5b 100644 --- a/src/mac/xcbc/xcbc_process.c +++ b/src/mac/xcbc/xcbc_process.c @@ -47,7 +47,7 @@ int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen) if (xcbc->buflen == 0) { while (inlen > (unsigned long)xcbc->blocksize) { for (x = 0; x < xcbc->blocksize; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)&(xcbc->IV[x])) ^= *((LTC_FAST_TYPE*)&(in[x])); + *(LTC_FAST_TYPE_PTR_CAST(&(xcbc->IV[x]))) ^= *(LTC_FAST_TYPE_PTR_CAST(&(in[x]))); } cipher_descriptor[xcbc->cipher].ecb_encrypt(xcbc->IV, xcbc->IV, &xcbc->key); in += xcbc->blocksize; diff --git a/src/modes/cbc/cbc_decrypt.c b/src/modes/cbc/cbc_decrypt.c index 5948f213e..b4fa466bb 100644 --- a/src/modes/cbc/cbc_decrypt.c +++ b/src/modes/cbc/cbc_decrypt.c @@ -70,9 +70,9 @@ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s /* xor IV against plaintext */ #if defined(LTC_FAST) for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { - tmpy = *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) ^ *((LTC_FAST_TYPE*)((unsigned char *)tmp + x)); - *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); - *((LTC_FAST_TYPE*)((unsigned char *)pt + x)) = tmpy; + tmpy = *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) ^ *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)tmp + x)); + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) = *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)ct + x)); + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pt + x)) = tmpy; } #else for (x = 0; x < cbc->blocklen; x++) { diff --git a/src/modes/cbc/cbc_encrypt.c b/src/modes/cbc/cbc_encrypt.c index 380eb561a..f304d0e57 100644 --- a/src/modes/cbc/cbc_encrypt.c +++ b/src/modes/cbc/cbc_encrypt.c @@ -59,7 +59,7 @@ int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s /* xor IV against plaintext */ #if defined(LTC_FAST) for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) ^= *((LTC_FAST_TYPE*)((unsigned char *)pt + x)); + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) ^= *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pt + x)); } #else for (x = 0; x < cbc->blocklen; x++) { @@ -75,7 +75,7 @@ int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s /* store IV [ciphertext] for a future block */ #if defined(LTC_FAST) for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)cbc->IV + x)) = *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)ct + x)); } #else for (x = 0; x < cbc->blocklen; x++) { diff --git a/src/modes/ctr/ctr_encrypt.c b/src/modes/ctr/ctr_encrypt.c index 56eb9ce26..611778562 100644 --- a/src/modes/ctr/ctr_encrypt.c +++ b/src/modes/ctr/ctr_encrypt.c @@ -89,8 +89,8 @@ int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s #ifdef LTC_FAST if (ctr->padlen == 0 && len >= (unsigned long)ctr->blocklen) { for (x = 0; x < ctr->blocklen; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)((unsigned char *)ct + x)) = *((LTC_FAST_TYPE*)((unsigned char *)pt + x)) ^ - *((LTC_FAST_TYPE*)((unsigned char *)ctr->pad + x)); + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)ct + x)) = *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pt + x)) ^ + *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)ctr->pad + x)); } pt += ctr->blocklen; ct += ctr->blocklen; diff --git a/src/modes/f8/f8_encrypt.c b/src/modes/f8/f8_encrypt.c index e510e6766..207063a98 100644 --- a/src/modes/f8/f8_encrypt.c +++ b/src/modes/f8/f8_encrypt.c @@ -64,8 +64,8 @@ int f8_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, sy STORE32H(f8->blockcnt, (buf+(f8->blocklen-4))); ++(f8->blockcnt); for (x = 0; x < f8->blocklen; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&ct[x])) = *((LTC_FAST_TYPE*)(&pt[x])) ^ *((LTC_FAST_TYPE*)(&f8->IV[x])); - *((LTC_FAST_TYPE*)(&f8->IV[x])) ^= *((LTC_FAST_TYPE*)(&f8->MIV[x])) ^ *((LTC_FAST_TYPE*)(&buf[x])); + *(LTC_FAST_TYPE_PTR_CAST(&ct[x])) = *(LTC_FAST_TYPE_PTR_CAST(&pt[x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&f8->IV[x])); + *(LTC_FAST_TYPE_PTR_CAST(&f8->IV[x])) ^= *(LTC_FAST_TYPE_PTR_CAST(&f8->MIV[x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&buf[x])); } if ((err = cipher_descriptor[f8->cipher].ecb_encrypt(f8->IV, f8->IV, &f8->key)) != CRYPT_OK) { return err; diff --git a/src/modes/lrw/lrw_process.c b/src/modes/lrw/lrw_process.c index 8a4fd1a77..321f7c1d0 100644 --- a/src/modes/lrw/lrw_process.c +++ b/src/modes/lrw/lrw_process.c @@ -60,7 +60,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i for (; x < 16; x++) { #ifdef LTC_FAST for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)(lrw->pad + y)) ^= *((LTC_FAST_TYPE *)(&lrw->PC[x][lrw->IV[x]][y])) ^ *((LTC_FAST_TYPE *)(&lrw->PC[x][(lrw->IV[x]-1)&255][y])); + *(LTC_FAST_TYPE_PTR_CAST(lrw->pad + y)) ^= *(LTC_FAST_TYPE_PTR_CAST(&lrw->PC[x][lrw->IV[x]][y])) ^ *(LTC_FAST_TYPE_PTR_CAST(&lrw->PC[x][(lrw->IV[x]-1)&255][y])); } #else for (y = 0; y < 16; y++) { @@ -75,7 +75,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i /* xor prod */ #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)(ct + x)) = *((LTC_FAST_TYPE *)(pt + x)) ^ *((LTC_FAST_TYPE *)(prod + x)); + *(LTC_FAST_TYPE_PTR_CAST(ct + x)) = *(LTC_FAST_TYPE_PTR_CAST(pt + x)) ^ *(LTC_FAST_TYPE_PTR_CAST(prod + x)); } #else for (x = 0; x < 16; x++) { @@ -97,7 +97,7 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i /* xor prod */ #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)(ct + x)) = *((LTC_FAST_TYPE *)(ct + x)) ^ *((LTC_FAST_TYPE *)(prod + x)); + *(LTC_FAST_TYPE_PTR_CAST(ct + x)) = *(LTC_FAST_TYPE_PTR_CAST(ct + x)) ^ *(LTC_FAST_TYPE_PTR_CAST(prod + x)); } #else for (x = 0; x < 16; x++) { diff --git a/src/modes/lrw/lrw_setiv.c b/src/modes/lrw/lrw_setiv.c index d2e21d368..121086a4a 100644 --- a/src/modes/lrw/lrw_setiv.c +++ b/src/modes/lrw/lrw_setiv.c @@ -56,7 +56,7 @@ int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw) for (x = 1; x < 16; x++) { #ifdef LTC_FAST for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)(T + y)) ^= *((LTC_FAST_TYPE *)(&lrw->PC[x][IV[x]][y])); + *(LTC_FAST_TYPE_PTR_CAST(T + y)) ^= *(LTC_FAST_TYPE_PTR_CAST(&lrw->PC[x][IV[x]][y])); } #else for (y = 0; y < 16; y++) { diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index d1be2c19f..47476d5fb 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -24,7 +24,7 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char /* tweak encrypt block i */ #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)&P[x]) = *((LTC_FAST_TYPE *)&C[x]) ^ *((LTC_FAST_TYPE *)&T[x]); + *(LTC_FAST_TYPE_PTR_CAST(&P[x])) = *(LTC_FAST_TYPE_PTR_CAST(&C[x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&T[x])); } #else for (x = 0; x < 16; x++) { @@ -36,7 +36,7 @@ static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)&P[x]) ^= *((LTC_FAST_TYPE *)&T[x]); + *(LTC_FAST_TYPE_PTR_CAST(&P[x])) ^= *(LTC_FAST_TYPE_PTR_CAST(&T[x])); } #else for (x = 0; x < 16; x++) { diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index 77c7e8c2e..1b3899483 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -24,7 +24,7 @@ static int tweak_crypt(const unsigned char *P, unsigned char *C, unsigned char * /* tweak encrypt block i */ #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)&C[x]) = *((LTC_FAST_TYPE *)&P[x]) ^ *((LTC_FAST_TYPE *)&T[x]); + *(LTC_FAST_TYPE_PTR_CAST(&C[x])) = *(LTC_FAST_TYPE_PTR_CAST(&P[x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&T[x])); } #else for (x = 0; x < 16; x++) { @@ -38,7 +38,7 @@ static int tweak_crypt(const unsigned char *P, unsigned char *C, unsigned char * #ifdef LTC_FAST for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE *)&C[x]) ^= *((LTC_FAST_TYPE *)&T[x]); + *(LTC_FAST_TYPE_PTR_CAST(&C[x])) ^= *(LTC_FAST_TYPE_PTR_CAST(&T[x])); } #else for (x = 0; x < 16; x++) { diff --git a/testprof/store_test.c b/testprof/store_test.c index 71666ba13..f8e047b4c 100644 --- a/testprof/store_test.c +++ b/testprof/store_test.c @@ -61,7 +61,7 @@ int store_test(void) /* now XOR it word for word */ for (x = 0; x < y; x += sizeof(LTC_FAST_TYPE)) { - *((LTC_FAST_TYPE*)(&buf[3*y+z+x])) = *((LTC_FAST_TYPE*)(&buf[z+x])) ^ *((LTC_FAST_TYPE*)(&buf[z+y+x])); + *(LTC_FAST_TYPE_PTR_CAST(&buf[3*y+z+x])) = *(LTC_FAST_TYPE_PTR_CAST(&buf[z+x])) ^ *(LTC_FAST_TYPE_PTR_CAST(&buf[z+y+x])); } if (memcmp(&buf[2*y+z], &buf[3*y+z], y)) { From ce1043c55dd8b1136f945ecb49eb7079b4295b5b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 18 Feb 2017 14:39:32 +0100 Subject: [PATCH 0451/1192] ignore warnings of clang created by my stdlib --- makefile.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makefile.include b/makefile.include index bcbdb7f7e..4a3dac425 100644 --- a/makefile.include +++ b/makefile.include @@ -66,6 +66,11 @@ endif # COMPILE_SMALL endif # COMPILE_DEBUG +ifneq ($(findstring clang,$(CC)),) +CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare +endif + + HASH=hashsum CRYPT=encrypt SMALL=small From 1e260eeaae433d0dbaf4e12f4804b7972414c5ce Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 24 Feb 2017 21:13:22 +0100 Subject: [PATCH 0452/1192] fir coverity finding: dsa_import double free --- src/pk/dsa/dsa_import.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 1793176a3..54361cb00 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -103,10 +103,12 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) PKA_DSA, tmpbuf, &tmpbuf_len, LTC_ASN1_SEQUENCE, params, 3); if (err != CRYPT_OK) { + XFREE(tmpbuf); goto LBL_ERR; } if ((err=der_decode_integer(tmpbuf, tmpbuf_len, key->y)) != CRYPT_OK) { + XFREE(tmpbuf); goto LBL_ERR; } @@ -125,7 +127,6 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) return CRYPT_OK; LBL_ERR: - XFREE(tmpbuf); mp_clear_multi(key->p, key->g, key->q, key->x, key->y, NULL); return err; } From faa18e71c8ca4222994003aa5e6e4602e0adc481 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 25 Feb 2017 20:07:08 +0100 Subject: [PATCH 0453/1192] tuning indentation --- src/pk/dsa/dsa_import.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 54361cb00..ca522c7bc 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -99,9 +99,9 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) goto LBL_ERR; } - err = der_decode_subject_public_key_info(in, inlen, - PKA_DSA, tmpbuf, &tmpbuf_len, - LTC_ASN1_SEQUENCE, params, 3); + err = der_decode_subject_public_key_info(in, inlen, PKA_DSA, + tmpbuf, &tmpbuf_len, + LTC_ASN1_SEQUENCE, params, 3); if (err != CRYPT_OK) { XFREE(tmpbuf); goto LBL_ERR; From b10f9502f88c930a114a9e184bdad795d099d5f5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 13:09:56 +0100 Subject: [PATCH 0454/1192] add RFC4648 base64 decoding compliance --- src/headers/tomcrypt_custom.h | 5 +++++ src/headers/tomcrypt_misc.h | 10 ++++++---- src/misc/base64/base64_decode.c | 21 +++++++++++++-------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 33e4bc08a..c8bc69087 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -476,6 +476,11 @@ #define LTC_PKCS_1 #endif +#if (defined(LTC_BASE64) || defined(LTC_BASE64_URL)) && !defined(LTC_BASE64_STRICT) + /* By default we're doing strict decoding now */ + #define LTC_BASE64_STRICT 1 +#endif + #if defined(TFM_DESC) && defined(LTC_RSA_BLINDING) #warning RSA blinding currently not supported in combination with TFM #undef LTC_RSA_BLINDING diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 2f670cc50..17aec209a 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -3,16 +3,18 @@ int base64_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); -int base64_decode(const unsigned char *in, unsigned long len, - unsigned char *out, unsigned long *outlen); +#define base64_decode(i, il, o, ol) base64_decode_ex(i, il, o, ol, LTC_BASE64_STRICT) +int base64_decode_ex(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen, int strict); #endif #ifdef LTC_BASE64_URL int base64url_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); -int base64url_decode(const unsigned char *in, unsigned long len, - unsigned char *out, unsigned long *outlen); +#define base64url_decode(i, il, o, ol) base64_decode_ex(i, il, o, ol, LTC_BASE64_STRICT) +int base64url_decode_ex(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen, int strict); #endif /* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 423dc435d..18f5aa579 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -73,7 +73,7 @@ static const unsigned char map_base64url[256] = { static int _base64_decode_internal(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, - const unsigned char *map) + const unsigned char *map, int strict) { unsigned long t, x, y, z; unsigned char c; @@ -86,7 +86,12 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen g = 3; for (x = y = z = t = 0; x < inlen; x++) { c = map[in[x]&0xFF]; - if (c == 255) continue; + if (c == 255) { + if (strict) + return CRYPT_INVALID_PACKET; + else + continue; + } /* the final = symbols are read and used to trim the remaining bytes */ if (c == 254) { c = 0; @@ -127,10 +132,10 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen @param outlen [in/out] The max size and resulting size of the decoded data @return CRYPT_OK if successful */ -int base64_decode(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen) +int base64_decode_ex(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, int strict) { - return _base64_decode_internal(in, inlen, out, outlen, map_base64); + return _base64_decode_internal(in, inlen, out, outlen, map_base64, strict); } #endif /* LTC_BASE64 */ @@ -143,10 +148,10 @@ int base64_decode(const unsigned char *in, unsigned long inlen, @param outlen [in/out] The max size and resulting size of the decoded data @return CRYPT_OK if successful */ -int base64url_decode(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen) +int base64url_decode_ex(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, int strict) { - return _base64_decode_internal(in, inlen, out, outlen, map_base64url); + return _base64_decode_internal(in, inlen, out, outlen, map_base64url, strict); } #endif /* LTC_BASE64_URL */ From 1c0edfdeaded15fa972bd50e75adc6b00e0f3e8e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 13:14:50 +0100 Subject: [PATCH 0455/1192] add/fix tests add explicit strict&loose base64-decode tests --- testprof/base64_test.c | 16 ++++++++++++++++ testprof/der_tests.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 8c15d3c15..4b0ac893a 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -56,6 +56,22 @@ int base64_test(void) return 1; } } + + x--; + memmove(&out[11], &out[10], l1 - 10); + out[10] = '\0'; + l1++; + l2 = sizeof(tmp); + DO(base64_decode_ex(out, l1, tmp, &l2, 0)); + if (l2 != x || memcmp(tmp, in, x)) { + fprintf(stderr, "loose base64 decoding failed %lu %lu %lu", x, l1, l2); + print_hex("is ", tmp, l2); + print_hex("should", in, x); + print_hex("input ", out, l1); + return 1; + } + l2 = sizeof(tmp); + DO(base64_decode_ex(out, l1, tmp, &l2, 1) == CRYPT_INVALID_PACKET ? CRYPT_OK : CRYPT_INVALID_PACKET); return 0; } #endif diff --git a/testprof/der_tests.c b/testprof/der_tests.c index b79a5ae32..322b49a55 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -392,7 +392,7 @@ static void der_cacert_test(void) ltc_asn1_list *decoded_list, *l, *l1, *l2; - DO(base64_decode(_der_tests_cacert_root_cert, sizeof(_der_tests_cacert_root_cert), buf, &len1)); + DO(base64_decode_ex(_der_tests_cacert_root_cert, sizeof(_der_tests_cacert_root_cert), buf, &len1, 0)); len2 = len1; DO(der_decode_sequence_flexi(buf, &len2, &decoded_list)); From 063bac396d7537acf66d9a843a881a8d72e8bc23 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Jan 2016 17:04:53 +0100 Subject: [PATCH 0456/1192] add LTC_BASE64_STRICT to crypt_build_settings and crypt_constants --- src/misc/crypt/crypt.c | 3 +++ src/misc/crypt/crypt_constants.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index d277901ad..fc1116a63 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -337,6 +337,9 @@ const char *crypt_build_settings = #if defined(LTC_BASE64_URL) " BASE64-URL-SAFE " #endif +#if defined(LTC_BASE64) || defined(LTC_BASE64_URL) + " "NAME_VALUE(LTC_BASE64_STRICT)" " +#endif #if defined(LTC_CRC32) " CRC32 " #endif diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 03755b06f..79c6e0ca7 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -89,6 +89,10 @@ static const crypt_constant _crypt_constants[] = { {"LTC_CTR_MODE", 0}, #endif +#if defined(LTC_BASE64) || defined(LTC_BASE64_URL) + _C_STRINGIFY(LTC_BASE64_STRICT), +#endif + _C_STRINGIFY(MAXBLOCKSIZE), _C_STRINGIFY(TAB_SIZE), _C_STRINGIFY(ARGTYPE), From bc16c149fc6ab45c4f265f3b325c6b706ed7c4d5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 3 Apr 2016 14:11:11 +0200 Subject: [PATCH 0457/1192] fix base64[url] strict/relaxed decode --- src/headers/tomcrypt_misc.h | 2 +- src/misc/base64/base64_decode.c | 8 +++++++- testprof/base64_test.c | 30 +++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 17aec209a..3acb6a3f8 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -12,7 +12,7 @@ int base64_decode_ex(const unsigned char *in, unsigned long len, int base64url_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); -#define base64url_decode(i, il, o, ol) base64_decode_ex(i, il, o, ol, LTC_BASE64_STRICT) +#define base64url_decode(i, il, o, ol) base64url_decode_ex(i, il, o, ol, LTC_BASE64_STRICT) int base64url_decode_ex(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen, int strict); #endif diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 18f5aa579..922bc5068 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -117,7 +117,11 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen } } if (y != 0) { - return CRYPT_INVALID_PACKET; + if (y == 1 || map != map_base64url || strict == 1) return CRYPT_INVALID_PACKET; + t = t << (6 * (4 - y)); + if (z + y - 1 > *outlen) return CRYPT_BUFFER_OVERFLOW; + if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255); + if (y == 3) out[z++] = (unsigned char) ((t >> 8) & 255); } *outlen = z; return CRYPT_OK; @@ -130,6 +134,7 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen @param inlen The length of the base64 data @param out [out] The destination of the binary decoded data @param outlen [in/out] The max size and resulting size of the decoded data + @param strict Strict[1] or relaxed[0] decoding of the input @return CRYPT_OK if successful */ int base64_decode_ex(const unsigned char *in, unsigned long inlen, @@ -146,6 +151,7 @@ int base64_decode_ex(const unsigned char *in, unsigned long inlen, @param inlen The length of the base64 data @param out [out] The destination of the binary decoded data @param outlen [in/out] The max size and resulting size of the decoded data + @param strict Strict[1] or relaxed[0] decoding of the input @return CRYPT_OK if successful */ int base64url_decode_ex(const unsigned char *in, unsigned long inlen, diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 4b0ac893a..1de0f7c06 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -5,6 +5,9 @@ int base64_test(void) { unsigned char in[64], out[256], tmp[64]; unsigned long x, l1, l2, slen1; + const char special_case[] = + { 0xbe, 0xe8, 0x92, 0x3c, 0xa2, 0x25, 0xf0, 0xf8, 0x91, 0xe4, 0xef, 0xab, + 0x0b, 0x8c, 0xfd, 0xff, 0x14, 0xd0, 0x29, 0x9d }; /* TEST CASES SOURCE: @@ -24,7 +27,18 @@ int base64_test(void) {"foo", "Zm9v" }, {"foob", "Zm9vYg==" }, {"fooba", "Zm9vYmE=" }, - {"foobar", "Zm9vYmFy"} + {"foobar", "Zm9vYmFy"}, + {special_case,"vuiSPKIl8PiR5O+rC4z9/xTQKZ0="} + }; + + const struct { + const char* s; + int mode; + } url_cases[] = { + {"vuiSPKIl8PiR5O-rC4z9_xTQKZ0", 0}, + {"vuiSPKIl8PiR5O-rC4z9_xTQKZ0=", 1}, + {"vuiS*PKIl8P*iR5O-rC4*z9_xTQKZ0", 0}, + {"vuiS*PKIl8P*iR5O-rC4*z9_xTQKZ0=", 0}, }; for (x = 0; x < sizeof(cases)/sizeof(cases[0]); ++x) { @@ -45,6 +59,20 @@ int base64_test(void) } } + for (x = 0; x < sizeof(url_cases)/sizeof(url_cases[0]); ++x) { + slen1 = strlen(url_cases[x].s); + l1 = sizeof(out); + DO(base64url_decode_ex((unsigned char*)url_cases[x].s, slen1, out, &l1, url_cases[x].mode)); + if (l1 != sizeof(special_case) || memcmp(out, special_case, l1)) { + fprintf(stderr, "\nbase64url failed case %lu: %s", x, url_cases[x].s); + print_hex("\nbase64url should", special_case, sizeof(special_case)); + out[sizeof(out)-1] = '\0'; + print_hex("\nbase64url is", out, l1); + return 1; + } + } + + for (x = 0; x < 64; x++) { yarrow_read(in, x, &yarrow_prng); l1 = sizeof(out); From 53359ccfc6a1c9384bd0cdd6a4c627f46068f987 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 24 Sep 2016 16:45:48 +0200 Subject: [PATCH 0458/1192] fix failing test --- testprof/base64_test.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 1de0f7c06..5177fbc82 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -5,9 +5,10 @@ int base64_test(void) { unsigned char in[64], out[256], tmp[64]; unsigned long x, l1, l2, slen1; - const char special_case[] = - { 0xbe, 0xe8, 0x92, 0x3c, 0xa2, 0x25, 0xf0, 0xf8, 0x91, 0xe4, 0xef, 0xab, - 0x0b, 0x8c, 0xfd, 0xff, 0x14, 0xd0, 0x29, 0x9d }; + const char special_case[] = { + 0xbe, 0xe8, 0x92, 0x3c, 0xa2, 0x25, 0xf0, 0xf8, + 0x91, 0xe4, 0xef, 0xab, 0x0b, 0x8c, 0xfd, 0xff, + 0x14, 0xd0, 0x29, 0x9d, 0x00 }; /* TEST CASES SOURCE: @@ -63,9 +64,9 @@ int base64_test(void) slen1 = strlen(url_cases[x].s); l1 = sizeof(out); DO(base64url_decode_ex((unsigned char*)url_cases[x].s, slen1, out, &l1, url_cases[x].mode)); - if (l1 != sizeof(special_case) || memcmp(out, special_case, l1)) { + if (l1 != strlen(special_case) || memcmp(out, special_case, l1)) { fprintf(stderr, "\nbase64url failed case %lu: %s", x, url_cases[x].s); - print_hex("\nbase64url should", special_case, sizeof(special_case)); + print_hex("\nbase64url should", special_case, strlen(special_case)); out[sizeof(out)-1] = '\0'; print_hex("\nbase64url is", out, l1); return 1; From c1dd1cbe309eb2c8fca2a1c489819975f665da3a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 17 Feb 2017 11:18:58 +0100 Subject: [PATCH 0459/1192] re-work strict/relaxed base64 decoding implementation Instead of one API function with an option parameter, provide two API functions. Instead of defaulting to strict decoding, default to relaxed decoding. --- src/headers/tomcrypt_custom.h | 5 ---- src/headers/tomcrypt_misc.h | 14 +++++----- src/misc/base64/base64_decode.c | 45 ++++++++++++++++++++++++-------- src/misc/crypt/crypt.c | 3 --- src/misc/crypt/crypt_constants.c | 4 --- testprof/base64_test.c | 13 +++++---- testprof/der_tests.c | 2 +- 7 files changed, 51 insertions(+), 35 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index c8bc69087..33e4bc08a 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -476,11 +476,6 @@ #define LTC_PKCS_1 #endif -#if (defined(LTC_BASE64) || defined(LTC_BASE64_URL)) && !defined(LTC_BASE64_STRICT) - /* By default we're doing strict decoding now */ - #define LTC_BASE64_STRICT 1 -#endif - #if defined(TFM_DESC) && defined(LTC_RSA_BLINDING) #warning RSA blinding currently not supported in combination with TFM #undef LTC_RSA_BLINDING diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 3acb6a3f8..092c6255d 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -3,18 +3,20 @@ int base64_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); -#define base64_decode(i, il, o, ol) base64_decode_ex(i, il, o, ol, LTC_BASE64_STRICT) -int base64_decode_ex(const unsigned char *in, unsigned long len, - unsigned char *out, unsigned long *outlen, int strict); +int base64_decode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); +int base64_strict_decode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); #endif #ifdef LTC_BASE64_URL int base64url_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); -#define base64url_decode(i, il, o, ol) base64url_decode_ex(i, il, o, ol, LTC_BASE64_STRICT) -int base64url_decode_ex(const unsigned char *in, unsigned long len, - unsigned char *out, unsigned long *outlen, int strict); +int base64url_decode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); +int base64url_strict_decode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); #endif /* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */ diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 922bc5068..410bc01f0 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -71,9 +71,14 @@ static const unsigned char map_base64url[256] = { 255, 255, 255, 255 }; #endif /* LTC_BASE64_URL */ +enum { + relaxed = 0, + strict = 1 +}; + static int _base64_decode_internal(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, - const unsigned char *map, int strict) + const unsigned char *map, int is_strict) { unsigned long t, x, y, z; unsigned char c; @@ -87,7 +92,7 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen for (x = y = z = t = 0; x < inlen; x++) { c = map[in[x]&0xFF]; if (c == 255) { - if (strict) + if (is_strict) return CRYPT_INVALID_PACKET; else continue; @@ -117,7 +122,7 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen } } if (y != 0) { - if (y == 1 || map != map_base64url || strict == 1) return CRYPT_INVALID_PACKET; + if (y == 1 || map != map_base64url || is_strict == 1) return CRYPT_INVALID_PACKET; t = t << (6 * (4 - y)); if (z + y - 1 > *outlen) return CRYPT_BUFFER_OVERFLOW; if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255); @@ -129,18 +134,31 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen #if defined(LTC_BASE64) /** - base64 decode a block of memory + Relaxed base64 decode a block of memory + @param in The base64 data to decode + @param inlen The length of the base64 data + @param out [out] The destination of the binary decoded data + @param outlen [in/out] The max size and resulting size of the decoded data + @return CRYPT_OK if successful +*/ +int base64_decode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + return _base64_decode_internal(in, inlen, out, outlen, map_base64, relaxed); +} + +/** + Strict base64 decode a block of memory @param in The base64 data to decode @param inlen The length of the base64 data @param out [out] The destination of the binary decoded data @param outlen [in/out] The max size and resulting size of the decoded data - @param strict Strict[1] or relaxed[0] decoding of the input @return CRYPT_OK if successful */ -int base64_decode_ex(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, int strict) +int base64_strict_decode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) { - return _base64_decode_internal(in, inlen, out, outlen, map_base64, strict); + return _base64_decode_internal(in, inlen, out, outlen, map_base64, strict); } #endif /* LTC_BASE64 */ @@ -151,11 +169,16 @@ int base64_decode_ex(const unsigned char *in, unsigned long inlen, @param inlen The length of the base64 data @param out [out] The destination of the binary decoded data @param outlen [in/out] The max size and resulting size of the decoded data - @param strict Strict[1] or relaxed[0] decoding of the input @return CRYPT_OK if successful */ -int base64url_decode_ex(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, int strict) +int base64url_decode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + return _base64_decode_internal(in, inlen, out, outlen, map_base64url, relaxed); +} + +int base64url_strict_decode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) { return _base64_decode_internal(in, inlen, out, outlen, map_base64url, strict); } diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index fc1116a63..d277901ad 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -337,9 +337,6 @@ const char *crypt_build_settings = #if defined(LTC_BASE64_URL) " BASE64-URL-SAFE " #endif -#if defined(LTC_BASE64) || defined(LTC_BASE64_URL) - " "NAME_VALUE(LTC_BASE64_STRICT)" " -#endif #if defined(LTC_CRC32) " CRC32 " #endif diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 79c6e0ca7..03755b06f 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -89,10 +89,6 @@ static const crypt_constant _crypt_constants[] = { {"LTC_CTR_MODE", 0}, #endif -#if defined(LTC_BASE64) || defined(LTC_BASE64_URL) - _C_STRINGIFY(LTC_BASE64_STRICT), -#endif - _C_STRINGIFY(MAXBLOCKSIZE), _C_STRINGIFY(TAB_SIZE), _C_STRINGIFY(ARGTYPE), diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 5177fbc82..484507c65 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -34,7 +34,7 @@ int base64_test(void) const struct { const char* s; - int mode; + int is_strict; } url_cases[] = { {"vuiSPKIl8PiR5O-rC4z9_xTQKZ0", 0}, {"vuiSPKIl8PiR5O-rC4z9_xTQKZ0=", 1}, @@ -63,7 +63,10 @@ int base64_test(void) for (x = 0; x < sizeof(url_cases)/sizeof(url_cases[0]); ++x) { slen1 = strlen(url_cases[x].s); l1 = sizeof(out); - DO(base64url_decode_ex((unsigned char*)url_cases[x].s, slen1, out, &l1, url_cases[x].mode)); + if(url_cases[x].is_strict) + DO(base64url_strict_decode((unsigned char*)url_cases[x].s, slen1, out, &l1)); + else + DO(base64url_decode((unsigned char*)url_cases[x].s, slen1, out, &l1)); if (l1 != strlen(special_case) || memcmp(out, special_case, l1)) { fprintf(stderr, "\nbase64url failed case %lu: %s", x, url_cases[x].s); print_hex("\nbase64url should", special_case, strlen(special_case)); @@ -91,16 +94,16 @@ int base64_test(void) out[10] = '\0'; l1++; l2 = sizeof(tmp); - DO(base64_decode_ex(out, l1, tmp, &l2, 0)); + DO(base64_decode(out, l1, tmp, &l2)); if (l2 != x || memcmp(tmp, in, x)) { - fprintf(stderr, "loose base64 decoding failed %lu %lu %lu", x, l1, l2); + fprintf(stderr, "relaxed base64 decoding failed %lu %lu %lu", x, l1, l2); print_hex("is ", tmp, l2); print_hex("should", in, x); print_hex("input ", out, l1); return 1; } l2 = sizeof(tmp); - DO(base64_decode_ex(out, l1, tmp, &l2, 1) == CRYPT_INVALID_PACKET ? CRYPT_OK : CRYPT_INVALID_PACKET); + DO(base64_strict_decode(out, l1, tmp, &l2) == CRYPT_INVALID_PACKET ? CRYPT_OK : CRYPT_INVALID_PACKET); return 0; } #endif diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 322b49a55..b79a5ae32 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -392,7 +392,7 @@ static void der_cacert_test(void) ltc_asn1_list *decoded_list, *l, *l1, *l2; - DO(base64_decode_ex(_der_tests_cacert_root_cert, sizeof(_der_tests_cacert_root_cert), buf, &len1, 0)); + DO(base64_decode(_der_tests_cacert_root_cert, sizeof(_der_tests_cacert_root_cert), buf, &len1)); len2 = len1; DO(der_decode_sequence_flexi(buf, &len2, &decoded_list)); From ff3a03a1d09ba0b16231cc19546a716dcc74788b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 20 Feb 2017 23:26:10 +0100 Subject: [PATCH 0460/1192] tuning base64 decoding implementation --- src/misc/base64/base64_decode.c | 41 ++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 410bc01f0..86060f642 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -88,41 +88,38 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); - g = 3; + g = 0; /* '=' counter */ for (x = y = z = t = 0; x < inlen; x++) { c = map[in[x]&0xFF]; + if (c == 254) { + g++; + continue; + } + else if (is_strict && g > 0) { + /* we only allow '=' to be at the end */ + return CRYPT_INVALID_PACKET; + } if (c == 255) { if (is_strict) return CRYPT_INVALID_PACKET; else continue; } - /* the final = symbols are read and used to trim the remaining bytes */ - if (c == 254) { - c = 0; - /* prevent g < 0 which would potentially allow an overflow later */ - if (--g < 0) { - return CRYPT_INVALID_PACKET; - } - } else if (g != 3) { - /* we only allow = to be at the end */ - return CRYPT_INVALID_PACKET; - } t = (t<<6)|c; if (++y == 4) { - if (z + g > *outlen) { - return CRYPT_BUFFER_OVERFLOW; - } + if (z + 3 > *outlen) return CRYPT_BUFFER_OVERFLOW; out[z++] = (unsigned char)((t>>16)&255); - if (g > 1) out[z++] = (unsigned char)((t>>8)&255); - if (g > 2) out[z++] = (unsigned char)(t&255); + out[z++] = (unsigned char)((t>>8)&255); + out[z++] = (unsigned char)(t&255); y = t = 0; } } + if (y != 0) { - if (y == 1 || map != map_base64url || is_strict == 1) return CRYPT_INVALID_PACKET; + if (y == 1) return CRYPT_INVALID_PACKET; + if ((y + g) != 4 && is_strict) return CRYPT_INVALID_PACKET; t = t << (6 * (4 - y)); if (z + y - 1 > *outlen) return CRYPT_BUFFER_OVERFLOW; if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255); @@ -177,6 +174,14 @@ int base64url_decode(const unsigned char *in, unsigned long inlen, return _base64_decode_internal(in, inlen, out, outlen, map_base64url, relaxed); } +/** + Strict base64 (URL Safe, RFC 4648 section 5) decode a block of memory + @param in The base64 data to decode + @param inlen The length of the base64 data + @param out [out] The destination of the binary decoded data + @param outlen [in/out] The max size and resulting size of the decoded data + @return CRYPT_OK if successful +*/ int base64url_strict_decode(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) { From 006c601efb298786f85b82fd4ebb2d12c198e4b4 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 01:51:12 +0100 Subject: [PATCH 0461/1192] no trailing = for base64url --- src/misc/base64/base64_decode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 86060f642..1babfbcbc 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -119,7 +119,7 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen if (y != 0) { if (y == 1) return CRYPT_INVALID_PACKET; - if ((y + g) != 4 && is_strict) return CRYPT_INVALID_PACKET; + if ((y + g) != 4 && is_strict && map != map_base64url) return CRYPT_INVALID_PACKET; t = t << (6 * (4 - y)); if (z + y - 1 > *outlen) return CRYPT_BUFFER_OVERFLOW; if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255); @@ -161,7 +161,7 @@ int base64_strict_decode(const unsigned char *in, unsigned long inlen, #if defined(LTC_BASE64_URL) /** - base64 (URL Safe, RFC 4648 section 5) decode a block of memory + Relaxed base64 (URL Safe, RFC 4648 section 5) decode a block of memory @param in The base64 data to decode @param inlen The length of the base64 data @param out [out] The destination of the binary decoded data From eee936d7528d327bc5ddccddbefab29f050a60a3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 21 Feb 2017 00:37:16 +0100 Subject: [PATCH 0462/1192] add base64url_strict_encode() --- src/headers/tomcrypt_misc.h | 2 ++ src/misc/base64/base64_encode.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 092c6255d..4f5e8faf9 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -12,6 +12,8 @@ int base64_strict_decode(const unsigned char *in, unsigned long len, #ifdef LTC_BASE64_URL int base64url_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); +int base64url_strict_encode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); int base64url_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); diff --git a/src/misc/base64/base64_encode.c b/src/misc/base64/base64_encode.c index 0ed0aa3e5..c87f302ee 100644 --- a/src/misc/base64/base64_encode.c +++ b/src/misc/base64/base64_encode.c @@ -110,6 +110,12 @@ int base64url_encode(const unsigned char *in, unsigned long inlen, { return _base64_encode_internal(in, inlen, out, outlen, codes_base64url, 0); } + +int base64url_strict_encode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + return _base64_encode_internal(in, inlen, out, outlen, codes_base64url, 1); +} #endif /* LTC_BASE64_URL */ #endif From abf0a18290eafb3cf662a5eaa6f04461ed0cdd87 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 21 Feb 2017 00:39:10 +0100 Subject: [PATCH 0463/1192] add some testcases --- testprof/base64_test.c | 47 +++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 484507c65..9868a0fc4 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -40,22 +40,24 @@ int base64_test(void) {"vuiSPKIl8PiR5O-rC4z9_xTQKZ0=", 1}, {"vuiS*PKIl8P*iR5O-rC4*z9_xTQKZ0", 0}, {"vuiS*PKIl8P*iR5O-rC4*z9_xTQKZ0=", 0}, + {"vuiS*PKIl8P*iR5O-rC4*z9_xTQKZ0==", 0}, + {"vuiS*PKIl8P*iR5O-rC4*z9_xTQKZ0===", 0}, + {"vuiS*PKIl8P*iR5O-rC4*z9_xTQKZ0====", 0}, + {"vuiS*=PKIl8P*iR5O-rC4*z9_xTQKZ0=", 0}, + {"vuiS*==PKIl8P*iR5O-rC4*z9_xTQKZ0=", 0}, + {"vuiS*===PKIl8P*iR5O-rC4*z9_xTQKZ0=", 0}, }; for (x = 0; x < sizeof(cases)/sizeof(cases[0]); ++x) { + memset(out, 0, sizeof(out)); + memset(tmp, 0, sizeof(tmp)); slen1 = strlen(cases[x].s); l1 = sizeof(out); DO(base64_encode((unsigned char*)cases[x].s, slen1, out, &l1)); l2 = sizeof(tmp); - DO(base64_decode(out, l1, tmp, &l2)); - if (l2 != slen1 || l1 != strlen(cases[x].b64) || memcmp(tmp, cases[x].s, l2) || memcmp(out, cases[x].b64, l1)) { - fprintf(stderr, "\nbase64 failed case %lu", x); - fprintf(stderr, "\nbase64 should: %s", cases[x].b64); - out[sizeof(out)-1] = '\0'; - fprintf(stderr, "\nbase64 is: %s", out); - fprintf(stderr, "\nplain should: %s", cases[x].s); - tmp[sizeof(tmp)-1] = '\0'; - fprintf(stderr, "\nplain is: %s\n", tmp); + DO(base64_strict_decode(out, l1, tmp, &l2)); + if (compare_testvector(out, l1, cases[x].b64, strlen(cases[x].b64), "base64 encode", x) || + compare_testvector(tmp, l2, cases[x].s, slen1, "base64 decode", x)) { return 1; } } @@ -67,15 +69,22 @@ int base64_test(void) DO(base64url_strict_decode((unsigned char*)url_cases[x].s, slen1, out, &l1)); else DO(base64url_decode((unsigned char*)url_cases[x].s, slen1, out, &l1)); - if (l1 != strlen(special_case) || memcmp(out, special_case, l1)) { - fprintf(stderr, "\nbase64url failed case %lu: %s", x, url_cases[x].s); - print_hex("\nbase64url should", special_case, strlen(special_case)); - out[sizeof(out)-1] = '\0'; - print_hex("\nbase64url is", out, l1); + if (compare_testvector(out, l1, special_case, strlen(special_case), "base64url decode", x)) { return 1; } + if(x < 2) { + l2 = sizeof(tmp); + if(x == 0) + DO(base64url_encode(out, l1, tmp, &l2)); + else + DO(base64url_strict_encode(out, l1, tmp, &l2)); + if (compare_testvector(tmp, l2, url_cases[x].s, strlen(url_cases[x].s), "base64url encode", x)) { + return 1; + } + } } + DO(base64url_strict_decode((unsigned char*)url_cases[4].s, slen1, out, &l1) == CRYPT_INVALID_PACKET ? CRYPT_OK : CRYPT_INVALID_PACKET); for (x = 0; x < 64; x++) { yarrow_read(in, x, &yarrow_prng); @@ -83,22 +92,18 @@ int base64_test(void) DO(base64_encode(in, x, out, &l1)); l2 = sizeof(tmp); DO(base64_decode(out, l1, tmp, &l2)); - if (l2 != x || memcmp(tmp, in, x)) { - fprintf(stderr, "base64 failed %lu %lu %lu", x, l1, l2); + if (compare_testvector(tmp, x, in, x, "random base64", x)) { return 1; } } x--; memmove(&out[11], &out[10], l1 - 10); - out[10] = '\0'; + out[10] = '='; l1++; l2 = sizeof(tmp); DO(base64_decode(out, l1, tmp, &l2)); - if (l2 != x || memcmp(tmp, in, x)) { - fprintf(stderr, "relaxed base64 decoding failed %lu %lu %lu", x, l1, l2); - print_hex("is ", tmp, l2); - print_hex("should", in, x); + if (compare_testvector(tmp, l2, in, l2, "relaxed base64 decoding", -1)) { print_hex("input ", out, l1); return 1; } From 88412a9fc2b545a348329e7648af4f2a33b60237 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 28 Feb 2017 11:30:19 +0100 Subject: [PATCH 0464/1192] conversion related troubles (int, size_t, ptrdiff_t ..) --- src/hashes/helper/hash_filehandle.c | 2 +- src/mac/f9/f9_file.c | 5 +++-- src/mac/omac/omac_file.c | 5 +++-- src/mac/pmac/pmac_file.c | 5 +++-- src/mac/xcbc/xcbc_file.c | 5 +++-- src/misc/base64/base64_encode.c | 2 +- src/pk/asn1/der/set/der_encode_setof.c | 2 +- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/hashes/helper/hash_filehandle.c b/src/hashes/helper/hash_filehandle.c index 130553977..41832fdff 100644 --- a/src/hashes/helper/hash_filehandle.c +++ b/src/hashes/helper/hash_filehandle.c @@ -50,7 +50,7 @@ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outle *outlen = hash_descriptor[hash].hashsize; do { x = fread(buf, 1, sizeof(buf), in); - if ((err = hash_descriptor[hash].process(&md, buf, x)) != CRYPT_OK) { + if ((err = hash_descriptor[hash].process(&md, buf, (unsigned long)x)) != CRYPT_OK) { return err; } } while (x == sizeof(buf)); diff --git a/src/mac/f9/f9_file.c b/src/mac/f9/f9_file.c index 49d732b99..5d885fb58 100644 --- a/src/mac/f9/f9_file.c +++ b/src/mac/f9/f9_file.c @@ -35,7 +35,8 @@ int f9_file(int cipher, #ifdef LTC_NO_FILE return CRYPT_NOP; #else - int err, x; + size_t x; + int err; f9_state f9; FILE *in; unsigned char buf[512]; @@ -57,7 +58,7 @@ int f9_file(int cipher, do { x = fread(buf, 1, sizeof(buf), in); - if ((err = f9_process(&f9, buf, x)) != CRYPT_OK) { + if ((err = f9_process(&f9, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); return err; } diff --git a/src/mac/omac/omac_file.c b/src/mac/omac/omac_file.c index d36871e82..bbff793d6 100644 --- a/src/mac/omac/omac_file.c +++ b/src/mac/omac/omac_file.c @@ -35,7 +35,8 @@ int omac_file(int cipher, #ifdef LTC_NO_FILE return CRYPT_NOP; #else - int err, x; + size_t x; + int err; omac_state omac; FILE *in; unsigned char buf[512]; @@ -57,7 +58,7 @@ int omac_file(int cipher, do { x = fread(buf, 1, sizeof(buf), in); - if ((err = omac_process(&omac, buf, x)) != CRYPT_OK) { + if ((err = omac_process(&omac, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); return err; } diff --git a/src/mac/pmac/pmac_file.c b/src/mac/pmac/pmac_file.c index c6849d743..b484400f1 100644 --- a/src/mac/pmac/pmac_file.c +++ b/src/mac/pmac/pmac_file.c @@ -35,7 +35,8 @@ int pmac_file(int cipher, #ifdef LTC_NO_FILE return CRYPT_NOP; #else - int err, x; + size_t x; + int err; pmac_state pmac; FILE *in; unsigned char buf[512]; @@ -58,7 +59,7 @@ int pmac_file(int cipher, do { x = fread(buf, 1, sizeof(buf), in); - if ((err = pmac_process(&pmac, buf, x)) != CRYPT_OK) { + if ((err = pmac_process(&pmac, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); return err; } diff --git a/src/mac/xcbc/xcbc_file.c b/src/mac/xcbc/xcbc_file.c index dd7767f5d..bba0d48e3 100644 --- a/src/mac/xcbc/xcbc_file.c +++ b/src/mac/xcbc/xcbc_file.c @@ -35,7 +35,8 @@ int xcbc_file(int cipher, #ifdef LTC_NO_FILE return CRYPT_NOP; #else - int err, x; + size_t x; + int err; xcbc_state xcbc; FILE *in; unsigned char buf[512]; @@ -57,7 +58,7 @@ int xcbc_file(int cipher, do { x = fread(buf, 1, sizeof(buf), in); - if ((err = xcbc_process(&xcbc, buf, x)) != CRYPT_OK) { + if ((err = xcbc_process(&xcbc, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); return err; } diff --git a/src/misc/base64/base64_encode.c b/src/misc/base64/base64_encode.c index c87f302ee..ea3eaddd3 100644 --- a/src/misc/base64/base64_encode.c +++ b/src/misc/base64/base64_encode.c @@ -75,7 +75,7 @@ static int _base64_encode_internal(const unsigned char *in, unsigned long inlen *p = '\0'; /* return ok */ - *outlen = p - out; + *outlen = (unsigned long)(p - out); return CRYPT_OK; } diff --git a/src/pk/asn1/der/set/der_encode_setof.c b/src/pk/asn1/der/set/der_encode_setof.c index 8add22b13..d4001f913 100644 --- a/src/pk/asn1/der/set/der_encode_setof.c +++ b/src/pk/asn1/der/set/der_encode_setof.c @@ -140,7 +140,7 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, XMEMCPY(out, buf, hdrlen); /* copy+sort using edges+indecies to output from buffer */ - for (y = hdrlen, x = 0; x < inlen; x++) { + for (y = (unsigned long)hdrlen, x = 0; x < inlen; x++) { XMEMCPY(out+y, edges[x].start, edges[x].size); y += edges[x].size; } From efbd73fbc8cf578746051faf5c54e3622273cb8f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 28 Feb 2017 16:11:42 +0100 Subject: [PATCH 0465/1192] move declarations at the block beginning (ANSI C) --- src/misc/adler32.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/misc/adler32.c b/src/misc/adler32.c index dd1010fa2..987931bf3 100644 --- a/src/misc/adler32.c +++ b/src/misc/adler32.c @@ -29,10 +29,12 @@ void adler32_init(adler32_state *ctx) void adler32_update(adler32_state *ctx, const unsigned char *input, unsigned long length) { + unsigned long s1, s2; + LTC_ARGCHKVD(ctx != NULL); LTC_ARGCHKVD(input != NULL); - unsigned long s1 = ctx->s[0]; - unsigned long s2 = ctx->s[1]; + s1 = ctx->s[0]; + s2 = ctx->s[1]; if (length % 8 != 0) { do { @@ -81,10 +83,12 @@ void adler32_update(adler32_state *ctx, const unsigned char *input, unsigned lon void adler32_finish(adler32_state *ctx, void *hash, unsigned long size) { + unsigned char* h; + LTC_ARGCHKVD(ctx != NULL); LTC_ARGCHKVD(hash != NULL); - unsigned char* h = hash; + h = hash; switch (size) { default: From 6c8d00d1fd94ba69386af4121603f912998668f7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 28 Feb 2017 17:35:57 +0100 Subject: [PATCH 0466/1192] part of feature/doc changes --- README.md | 6 +++++- makefile | 10 +++++----- run.sh | 4 ++-- src/pk/pkcs1/pkcs_1_mgf1.c | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b1858cf2b..1cf505bfa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ libtomcrypt ========== -See doc/crypt.pdf for a detailed documentation +See `doc/crypt.pdf` for a detailed documentation Project Status -------------- @@ -13,6 +13,10 @@ Submitting patches Please branch off from develop if you want to submit a patch. +Patch integration will be faster if tests and documentation are included. + +Please update the makefiles in a separate commit. To update them simply run the `updatemakes.sh` script. + Branches -------- diff --git a/makefile b/makefile index 43faceef7..5bf5241bc 100644 --- a/makefile +++ b/makefile @@ -357,10 +357,10 @@ docs: crypt.tex rm -f doc/crypt.pdf $(LEFTOVERS) cp crypt.tex crypt.bak touch --reference=crypt.tex crypt.bak - (echo "\\def\\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex - echo "\\pdfinfo{" >> crypt-deterministic.tex - echo "/CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex - echo "/ModDate (\fixedpdfdate) }" >> crypt-deterministic.tex + (printf "%s" "\def\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex + printf "%s\n" "\pdfinfo{" >> crypt-deterministic.tex + printf "%s\n" " /CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex + printf "%s\n}\n" " /ModDate (\fixedpdfdate)" >> crypt-deterministic.tex cat crypt.tex >> crypt-deterministic.tex mv crypt-deterministic.tex crypt.tex touch --reference=crypt.bak crypt.tex @@ -369,7 +369,7 @@ docs: crypt.tex latex crypt > /dev/null makeindex crypt.idx > /dev/null perl fixupind.pl - pdflatex crypt + pdflatex crypt > /dev/null sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf mv -ivf crypt.pdf doc/crypt.pdf mv crypt.bak crypt.tex diff --git a/run.sh b/run.sh index 8d778b367..5c5b3922b 100755 --- a/run.sh +++ b/run.sh @@ -13,7 +13,7 @@ else fi rm -f testok.txt -bash build.sh " $1" "$2 -Os" " $3 IGNORE_SPEED=1 LTC_SMALL=1" "$4" "$5" +bash build.sh " $1" "$2 -Os" "$3 IGNORE_SPEED=1 LTC_SMALL=1" "$4" "$5" if [ -a testok.txt ] && [ -f testok.txt ]; then echo else @@ -23,7 +23,7 @@ else fi rm -f testok.txt -bash build.sh " $1" " $2" " $3 " "$4" "$5" +bash build.sh " $1" "$2" "$3" "$4" "$5" if [ -a testok.txt ] && [ -f testok.txt ]; then echo else diff --git a/src/pk/pkcs1/pkcs_1_mgf1.c b/src/pk/pkcs1/pkcs_1_mgf1.c index c7c2b5bc6..a063128e1 100644 --- a/src/pk/pkcs1/pkcs_1_mgf1.c +++ b/src/pk/pkcs1/pkcs_1_mgf1.c @@ -19,9 +19,9 @@ /** Perform PKCS #1 MGF1 (internal) + @param hash_idx The index of the hash desired @param seed The seed for MGF1 @param seedlen The length of the seed - @param hash_idx The index of the hash desired @param mask [out] The destination @param masklen The length of the mask desired @return CRYPT_OK if successful From 808616d40692dbcf37a0aab0551d0fe78f91a19e Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 25 Feb 2017 15:14:35 +0100 Subject: [PATCH 0467/1192] sanitize some Perl scripts (Perl4 is gone) --- filter.pl | 30 +++++++++++++++--------------- fixupind.pl | 21 +++++++++++++-------- makefile | 3 +++ parsenames.pl | 21 +++++++++++++-------- 4 files changed, 44 insertions(+), 31 deletions(-) diff --git a/filter.pl b/filter.pl index 11ba62fba..58b75840c 100755 --- a/filter.pl +++ b/filter.pl @@ -2,29 +2,29 @@ # we want to filter every between START_INS and END_INS out and then insert crap from another file (this is fun) -$dst = shift; -$ins = shift; +use strict; +use warnings; -open(SRC,"<$dst"); -open(INS,"<$ins"); -open(TMP,">tmp.delme"); +open(my $src, '<', shift); +open(my $ins, '<', shift); +open(my $tmp, '>', 'tmp.delme'); -$l = 0; -while () { +my $l = 0; +while (<$src>) { if ($_ =~ /START_INS/) { - print TMP $_; + print {$tmp} $_; $l = 1; - while () { - print TMP $_; + while (<$ins>) { + print {$tmp} $_; } - close INS; + close $ins; } elsif ($_ =~ /END_INS/) { - print TMP $_; + print {$tmp} $_; $l = 0; } elsif ($l == 0) { - print TMP $_; + print {$tmp} $_; } } -close TMP; -close SRC; +close $tmp; +close $src; diff --git a/fixupind.pl b/fixupind.pl index 543ae967d..ddefbd76a 100755 --- a/fixupind.pl +++ b/fixupind.pl @@ -1,11 +1,16 @@ -open(IN,"crypt.ind.tmp"); -$a = ; -print OUT "$a\n\\addcontentsline{toc}{chapter}{Index}\n"; -while () { - print OUT $_; +#!/usr/bin/perl + +use strict; +use warnings; + +open(my $in, '<', 'crypt.ind'); +open(my $out, '>', 'crypt.ind.tmp'); +my $a = <$in>; +print {$out} "$a\n\\addcontentsline{toc}{chapter}{Index}\n"; +while (<$in>) { + print {$out} $_; } -close OUT; -close IN; +close $out; +close $in; system("mv -f crypt.ind.tmp crypt.ind"); diff --git a/makefile b/makefile index 5bf5241bc..2641a8328 100644 --- a/makefile +++ b/makefile @@ -406,6 +406,9 @@ check_defines: | grep -v -e 'LTC_ECC[0-9]*' -e 'LTC_DH[0-9]*' -e 'LTC_NO_' -e 'LTC_MUTEX' -e 'LTC_MPI' \ | xargs -I '{}' sh -c 'grep -q -m 1 -o {} src/misc/crypt/crypt.c || echo {} not found' +perlcritic: + perlcritic *.pl + # $Source$ # $Revision$ # $Date$ diff --git a/parsenames.pl b/parsenames.pl index 8e6bc5ed2..cc2abed82 100755 --- a/parsenames.pl +++ b/parsenames.pl @@ -4,20 +4,25 @@ # wrapped at 80 chars # # Tom St Denis -@a = split(" ", $ARGV[1]); -$b = "$ARGV[0]="; -$len = length($b); +use strict; +use warnings; + +my @a = split ' ', $ARGV[1]; +my $b = $ARGV[0] . '='; +my $len = length $b; print $b; foreach my $obj (@a) { - $len = $len + length($obj); + $len = $len + length $obj; $obj =~ s/\*/\$/; if ($len > 100) { - printf "\\\n"; - $len = length($obj); + print "\\\n"; + $len = length $obj; } - print "$obj "; + print $obj . ' '; +} +if ($ARGV[0] eq 'HEADERS') { + print 'testprof/tomcrypt_test.h'; } -if ($ARGV[0] eq "HEADERS") { print "testprof/tomcrypt_test.h"; } print "\n\n"; From 344620a0e74775fde51c57e76b5cd315b35c12d1 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 20:23:10 +0100 Subject: [PATCH 0468/1192] fixes #135 RC2 min keylen 40bit (was 64bit) --- crypt.tex | 2 +- src/ciphers/rc2.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypt.tex b/crypt.tex index 7e854a700..041baac21 100644 --- a/crypt.tex +++ b/crypt.tex @@ -609,7 +609,7 @@ \subsection{Simple Encryption Demonstration} \hline \textbf{Name} & \textbf{Descriptor Name} & \textbf{Block Size} & \textbf{Key Range} & \textbf{Rounds} \\ \hline Blowfish & blowfish\_desc & 8 & 8 $\ldots$ 56 & 16 \\ \hline X-Tea & xtea\_desc & 8 & 16 & 32 \\ - \hline RC2 & rc2\_desc & 8 & 8 $\ldots$ 128 & 16 \\ + \hline RC2 & rc2\_desc & 8 & 5 $\ldots$ 128 & 16 \\ \hline RC5-32/12/b & rc5\_desc & 8 & 8 $\ldots$ 128 & 12 $\ldots$ 24 \\ \hline RC6-32/20/b & rc6\_desc & 16 & 8 $\ldots$ 128 & 20 \\ \hline SAFER+ & saferp\_desc &16 & 16, 24, 32 & 8, 12, 16 \\ diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index a77853591..2520b8374 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -77,7 +77,7 @@ int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke LTC_ARGCHK(key != NULL); LTC_ARGCHK(skey != NULL); - if (keylen < 8 || keylen > 128) { + if (keylen < 5 || keylen > 128) { return CRYPT_INVALID_KEYSIZE; } @@ -345,7 +345,7 @@ void rc2_done(symmetric_key *skey) int rc2_keysize(int *keysize) { LTC_ARGCHK(keysize != NULL); - if (*keysize < 8) { + if (*keysize < 5) { return CRYPT_INVALID_KEYSIZE; } else if (*keysize > 128) { *keysize = 128; From 19c81bbbee89c56a261cf0d40642c6fc2b4d9657 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 18 Feb 2017 14:41:54 +0100 Subject: [PATCH 0469/1192] fix typo --- src/ciphers/rc2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 2520b8374..222eda4c3 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -22,7 +22,7 @@ /** @file rc2.c - Implementation of LTC_RC2 + Implementation of RC2 with fixed effective key length of 64bits */ #ifdef LTC_RC2 @@ -60,7 +60,7 @@ static const unsigned char permute[256] = { }; /** - Initialize the LTC_RC2 block cipher + Initialize the RC2 block cipher @param key The symmetric key you wish to pass @param keylen The key length in bytes @param num_rounds The number of rounds desired (0 for default) @@ -121,7 +121,7 @@ int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke * Encrypt an 8-byte block of plaintext using the given key. * \**********************************************************************/ /** - Encrypts a block of text with LTC_RC2 + Encrypts a block of text with RC2 @param pt The input plaintext (8 bytes) @param ct The output ciphertext (8 bytes) @param skey The key as scheduled @@ -199,7 +199,7 @@ int rc2_ecb_encrypt( const unsigned char *pt, * Decrypt an 8-byte block of ciphertext using the given key. * \**********************************************************************/ /** - Decrypts a block of text with LTC_RC2 + Decrypts a block of text with RC2 @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) @param skey The key as scheduled @@ -275,7 +275,7 @@ int rc2_ecb_decrypt( const unsigned char *ct, #endif /** - Performs a self-test of the LTC_RC2 block cipher + Performs a self-test of the RC2 block cipher @return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled */ int rc2_test(void) From 952caf3cd7004a582726a372299ad32dbfae8bd0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 27 Feb 2017 20:11:20 +0100 Subject: [PATCH 0470/1192] add testvectors for smaller RC2 keysizes originates from rfc2268 1 byte keylen is commented --- src/ciphers/rc2.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 222eda4c3..2eebde258 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -288,12 +288,25 @@ int rc2_test(void) unsigned char key[16], pt[8], ct[8]; } tests[] = { +#if 0 + { 1, + { 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x61, 0xa8, 0xa2, 0x44, 0xad, 0xac, 0xcc, 0xf0 } + }, +#endif + { 7, + { 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x6c, 0xcf, 0x43, 0x08, 0x97, 0x4c, 0x26, 0x7f } + }, { 8, { 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, { 0x30, 0x64, 0x9e, 0xdf, 0x9b, 0xe7, 0xd2, 0xc2 } - }, { 16, { 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x7f, @@ -315,7 +328,8 @@ int rc2_test(void) rc2_ecb_encrypt(tests[x].pt, tmp[0], &skey); rc2_ecb_decrypt(tmp[0], tmp[1], &skey); - if (XMEMCMP(tmp[0], tests[x].ct, 8) != 0 || XMEMCMP(tmp[1], tests[x].pt, 8) != 0) { + if (compare_testvector(tmp[0], 8, tests[x].ct, 8, "RC2 CT", x) != 0 || + compare_testvector(tmp[1], 8, tests[x].pt, 8, "RC2 PT", x) != 0) { return CRYPT_FAIL_TESTVECTOR; } From 43c50423ade4f9c639b7aa28e7302bd2c903a490 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 27 Feb 2017 20:52:16 +0100 Subject: [PATCH 0471/1192] add yet another testvector --- src/ciphers/rc2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 2eebde258..8253e87a3 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -302,6 +302,12 @@ int rc2_test(void) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x6c, 0xcf, 0x43, 0x08, 0x97, 0x4c, 0x26, 0x7f } }, + { 8, + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + { 0x27, 0x8b, 0x27, 0xe4, 0x2e, 0x2f, 0x0d, 0x49 } + }, { 8, { 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, From 9a29428f8e10c8b42747832c5b2ed8c5c0b284a4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 27 Feb 2017 22:30:18 +0100 Subject: [PATCH 0472/1192] Add secondary rc2 setup function ...to be able to pass the effective key length. --- src/ciphers/rc2.c | 78 +++++++++++++++++++++++++---------- src/headers/tomcrypt_cipher.h | 1 + 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 8253e87a3..46a916bf2 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -63,23 +63,27 @@ static const unsigned char permute[256] = { Initialize the RC2 block cipher @param key The symmetric key you wish to pass @param keylen The key length in bytes + @param bits The effective key length in bits @param num_rounds The number of rounds desired (0 for default) @param skey The key in as scheduled by this function. @return CRYPT_OK if successful */ -int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) +int rc2_setup_ex(const unsigned char *key, int keylen, int bits, int num_rounds, symmetric_key *skey) { unsigned *xkey = skey->rc2.xkey; unsigned char tmp[128]; unsigned T8, TM; - int i, bits; + int i; LTC_ARGCHK(key != NULL); LTC_ARGCHK(skey != NULL); - if (keylen < 5 || keylen > 128) { + if (keylen == 0 || keylen > 128 || bits > 1024) { return CRYPT_INVALID_KEYSIZE; } + if (bits == 0) { + bits = 1024; + } if (num_rounds != 0 && num_rounds != 16) { return CRYPT_INVALID_ROUNDS; @@ -97,7 +101,6 @@ int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke } /* Phase 2 - reduce effective key size to "bits" */ - bits = keylen<<3; T8 = (unsigned)(bits+7)>>3; TM = (255 >> (unsigned)(7 & -bits)); tmp[128 - T8] = permute[tmp[128 - T8] & TM]; @@ -117,6 +120,22 @@ int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_ke return CRYPT_OK; } +/** + Initialize the RC2 block cipher + + The effective key length is here always keylen * 8 + + @param key The symmetric key you wish to pass + @param keylen The key length in bytes + @param num_rounds The number of rounds desired (0 for default) + @param skey The key in as scheduled by this function. + @return CRYPT_OK if successful +*/ +int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) +{ + return rc2_setup_ex(key, keylen, keylen * 8, num_rounds, skey); +} + /**********************************************************************\ * Encrypt an 8-byte block of plaintext using the given key. * \**********************************************************************/ @@ -284,37 +303,47 @@ int rc2_test(void) return CRYPT_NOP; #else static const struct { - int keylen; + int keylen, bits; unsigned char key[16], pt[8], ct[8]; } tests[] = { -#if 0 - { 1, - { 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + { 8, 63, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x61, 0xa8, 0xa2, 0x44, 0xad, 0xac, 0xcc, 0xf0 } + { 0xeb, 0xb7, 0x73, 0xf9, 0x93, 0x27, 0x8e, 0xff } }, -#endif - { 7, - { 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - { 0x6c, 0xcf, 0x43, 0x08, 0x97, 0x4c, 0x26, 0x7f } - }, - { 8, + { 8, 64, { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, { 0x27, 0x8b, 0x27, 0xe4, 0x2e, 0x2f, 0x0d, 0x49 } }, - { 8, + { 8, 64, { 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, { 0x30, 0x64, 0x9e, 0xdf, 0x9b, 0xe7, 0xd2, 0xc2 } }, - { 16, + { 1, 64, + { 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x61, 0xa8, 0xa2, 0x44, 0xad, 0xac, 0xcc, 0xf0 } + }, + { 7, 64, + { 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x6c, 0xcf, 0x43, 0x08, 0x97, 0x4c, 0x26, 0x7f } + }, + { 16, 64, + { 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x7f, + 0x0f, 0x79, 0xc3, 0x84, 0x62, 0x7b, 0xaf, 0xb2 }, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + { 0x1a, 0x80, 0x7d, 0x27, 0x2b, 0xbe, 0x5d, 0xb1 } + }, + { 16, 128, { 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x7f, 0x0f, 0x79, 0xc3, 0x84, 0x62, 0x7b, 0xaf, 0xb2 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, @@ -327,8 +356,15 @@ int rc2_test(void) for (x = 0; x < (int)(sizeof(tests) / sizeof(tests[0])); x++) { zeromem(tmp, sizeof(tmp)); - if ((err = rc2_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { - return err; + if (tests[x].bits == (tests[x].keylen * 8)) { + if ((err = rc2_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { + return err; + } + } + else { + if ((err = rc2_setup_ex(tests[x].key, tests[x].keylen, tests[x].bits, 0, &skey)) != CRYPT_OK) { + return err; + } } rc2_ecb_encrypt(tests[x].pt, tmp[0], &skey); diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index da3a6b72d..c9c68322f 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -617,6 +617,7 @@ extern const struct ltc_cipher_descriptor rc6_desc; #ifdef LTC_RC2 int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int rc2_setup_ex(const unsigned char *key, int keylen, int bits, int num_rounds, symmetric_key *skey); int rc2_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); int rc2_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); int rc2_test(void); From 03f0674985806efe55791511d3f30ce9cc6ec7f5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 01:29:45 +0100 Subject: [PATCH 0473/1192] add compare_testvector() prototype to tomcrypt_misc.h --- src/headers/tomcrypt_misc.h | 6 +++++- testprof/tomcrypt_test.h | 2 ++ testprof/x86_prof.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 4f5e8faf9..91f87c5c7 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -101,7 +101,11 @@ int crc32_test(void); /* yeah it's not exactly in misc in the library, but in testprof/x86_prof.c */ #if defined(LTC_TEST) && defined(LTC_TEST_DBG) -void print_hex(const char* what, const void* p, const unsigned long l); +void print_hex(const char* what, const void* v, const unsigned long l); +int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); +#else +#define compare_testvector(is, is_len, should, should_len, what, which) \ + (((is_len) != (should_len)) || (XMEMCMP((is), (should), (is_len)) != 0)) #endif /* $Source$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 776580ef6..ce9bfeba8 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -81,7 +81,9 @@ extern const struct ltc_prng_descriptor no_prng_desc; #endif void print_hex(const char* what, const void* v, const unsigned long l); +#ifndef compare_testvector int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); +#endif int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 3d8787ca9..46ae43ab4 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -35,6 +35,7 @@ void print_hex(const char* what, const void* v, const unsigned long l) } } +#ifndef compare_testvector int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) { int res = 0; @@ -51,6 +52,7 @@ int compare_testvector(const void* is, const unsigned long is_len, const void* s return res; } +#endif struct list results[100]; int no_results; From 05f85c3e6d74f701a0397979de2e88f5fec40f41 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 28 Feb 2017 20:20:51 +0100 Subject: [PATCH 0474/1192] RS2 remove 40bit limit --- src/ciphers/rc2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 46a916bf2..328889ab2 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -401,7 +401,7 @@ void rc2_done(symmetric_key *skey) int rc2_keysize(int *keysize) { LTC_ARGCHK(keysize != NULL); - if (*keysize < 5) { + if (*keysize < 1) { return CRYPT_INVALID_KEYSIZE; } else if (*keysize > 128) { *keysize = 128; From 4bd327a4cc0a001a796413148e1fbded36fb6ec8 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 28 Feb 2017 16:29:25 +0100 Subject: [PATCH 0475/1192] better handling wchar_t when __WCHAR_MAX__ is 0xFFFF (2 bytes only) --- src/headers/tomcrypt_pk.h | 1 + src/pk/asn1/der/utf8/der_encode_utf8_string.c | 4 +-- src/pk/asn1/der/utf8/der_length_utf8_string.c | 26 ++++++++++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index c457ce8fa..cd3d02121 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -619,6 +619,7 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, wchar_t *out, unsigned long *outlen); unsigned long der_utf8_charsize(const wchar_t c); +int der_utf8_valid_char(const wchar_t c); int der_length_utf8_string(const wchar_t *in, unsigned long noctets, unsigned long *outlen); diff --git a/src/pk/asn1/der/utf8/der_encode_utf8_string.c b/src/pk/asn1/der/utf8/der_encode_utf8_string.c index 7a782f126..ab7ab5432 100644 --- a/src/pk/asn1/der/utf8/der_encode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_encode_utf8_string.c @@ -37,9 +37,7 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, /* get the size */ for (x = len = 0; x < inlen; x++) { - if (in[x] < 0 || in[x] > 0x1FFFF) { - return CRYPT_INVALID_ARG; - } + if (!der_utf8_valid_char(in[x])) return CRYPT_INVALID_ARG; len += der_utf8_charsize(in[x]); } diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index 2ce2ca49b..1135accf9 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -27,11 +27,33 @@ unsigned long der_utf8_charsize(const wchar_t c) return 1; } else if (c <= 0x7FF) { return 2; +#if __WCHAR_MAX__ == 0xFFFF + } else { + return 3; + } +#else } else if (c <= 0xFFFF) { return 3; } else { return 4; } +#endif +} + +/** + Test whether the given code point is valid character + @param c The UTF-8 character to test + @return 1 - valid, 0 - invalid +*/ +int der_utf8_valid_char(const wchar_t c) +{ +#if !defined(__WCHAR_MAX__) || __WCHAR_MAX__ > 0xFFFF + if (in[x] > 0x10FFFF) return 0; +#endif +#if !defined(__WCHAR_MAX__) || __WCHAR_MAX__ != 0xFFFF && __WCHAR_MAX__ != 0xFFFFFFFF + if (in[x] < 0) return 0; +#endif + return 1; } /** @@ -50,9 +72,7 @@ int der_length_utf8_string(const wchar_t *in, unsigned long noctets, unsigned lo len = 0; for (x = 0; x < noctets; x++) { - if (in[x] < 0 || in[x] > 0x10FFFF) { - return CRYPT_INVALID_ARG; - } + if (!der_utf8_valid_char(in[x])) return CRYPT_INVALID_ARG; len += der_utf8_charsize(in[x]); } From 3dbd250bc9143e48c6d33d7d1ee1f618180e36df Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 01:33:17 +0100 Subject: [PATCH 0476/1192] Add clang to the travis build matrix --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5250d941e..88d7fe745 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: c compiler: - gcc + - clang script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a" env: - | From acfd16c60aa917389cf9ea0f617f0710d2f5346a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 21:23:39 +0100 Subject: [PATCH 0477/1192] fix compile error --- src/pk/asn1/der/utf8/der_length_utf8_string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index 1135accf9..3a8ef0689 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -48,10 +48,10 @@ unsigned long der_utf8_charsize(const wchar_t c) int der_utf8_valid_char(const wchar_t c) { #if !defined(__WCHAR_MAX__) || __WCHAR_MAX__ > 0xFFFF - if (in[x] > 0x10FFFF) return 0; + if (c > 0x10FFFF) return 0; #endif #if !defined(__WCHAR_MAX__) || __WCHAR_MAX__ != 0xFFFF && __WCHAR_MAX__ != 0xFFFFFFFF - if (in[x] < 0) return 0; + if (c < 0) return 0; #endif return 1; } From 27280b86b35e5a8e0b892a8a99626f0ae18d6fc4 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 20 Dec 2015 16:31:56 +0100 Subject: [PATCH 0478/1192] static functions --- src/hashes/chc/chc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index 332d02580..31e63e619 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -156,8 +156,8 @@ static int chc_compress(hash_state *md, unsigned char *buf) } /* function for processing blocks */ -int _chc_process(hash_state * md, const unsigned char *buf, unsigned long len); -HASH_PROCESS(_chc_process, chc_compress, chc, (unsigned long)cipher_blocksize) +static int _chc_process(hash_state * md, const unsigned char *buf, unsigned long len); +static HASH_PROCESS(_chc_process, chc_compress, chc, (unsigned long)cipher_blocksize) /** Process a block of memory though the hash From eca2290b1e0ae48b27bd05655d77affc6689a350 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Tue, 28 Feb 2017 18:05:58 +0100 Subject: [PATCH 0479/1192] missing prototypes --- src/headers/tomcrypt_pk.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index cd3d02121..cfd7657ef 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -404,6 +404,11 @@ typedef struct { } dsa_key; int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); + +int dsa_make_key_ex(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key, char* p_hex, char* q_hex, char* g_hex); + +int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g); + void dsa_free(dsa_key *key); int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, From 50aedb099c997b2ed24ce41d2c5f2b0056dc07eb Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 28 Feb 2017 23:20:19 +0100 Subject: [PATCH 0480/1192] fixing warning introduced by __WCHAR_MAX__ patch --- src/pk/asn1/der/utf8/der_length_utf8_string.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index 3a8ef0689..7d0f60c61 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -47,6 +47,7 @@ unsigned long der_utf8_charsize(const wchar_t c) */ int der_utf8_valid_char(const wchar_t c) { + LTC_UNUSED_PARAM(c); #if !defined(__WCHAR_MAX__) || __WCHAR_MAX__ > 0xFFFF if (c > 0x10FFFF) return 0; #endif From 6cfc27d3107aff250f329e53977c3089ccd21aca Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 21:19:27 +0100 Subject: [PATCH 0481/1192] add EASY build to tests --- .travis.yml | 4 ++++ testme.sh | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 88d7fe745..287a58595 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,10 @@ env: BUILDSCRIPT="run.sh" BUILDNAME="STOCK" BUILDOPTIONS=" " + - | + BUILDSCRIPT="run.sh" + BUILDNAME="EASY" + BUILDOPTIONS="-DLTC_EASY" - | BUILDSCRIPT="run.sh" BUILDNAME="SMALL" diff --git a/testme.sh b/testme.sh index 873ad45ab..d50fae5c2 100755 --- a/testme.sh +++ b/testme.sh @@ -13,6 +13,9 @@ echo "date="`date` # stock build bash run.sh "STOCK" " " "$1" "$2" "$3" || exit 1 +# EASY build +bash run.sh "EASY" "-DLTC_EASY" "$1" "$2" "$3" || exit 1 + # SMALL code bash run.sh "SMALL" "-DLTC_SMALL_CODE" "$1" "$2" "$3" || exit 1 From 0b79bbaf5bf063b50dfd63797d8185e236ac2928 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 21:21:39 +0100 Subject: [PATCH 0482/1192] fix missing symbol rand_prime --- src/math/rand_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/rand_prime.c b/src/math/rand_prime.c index 1c779acb8..9dd737bf3 100644 --- a/src/math/rand_prime.c +++ b/src/math/rand_prime.c @@ -10,7 +10,7 @@ */ #include "tomcrypt.h" -#if !defined LTC_NO_MATH && !defined LTC_NO_PRNGS +#if defined(LTC_MRSA) || (!defined(LTC_NO_MATH) && !defined(LTC_NO_PRNGS)) /** @file rand_prime.c From 00308d8651820b0f4c645aacc03da72012cb5523 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 21:23:16 +0100 Subject: [PATCH 0483/1192] fix base64url related errors when only LTC_BASE64 is defined --- src/misc/base64/base64_decode.c | 5 +++-- testprof/base64_test.c | 38 ++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 1babfbcbc..d3b89b12f 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -45,8 +45,8 @@ static const unsigned char map_base64[256] = { 255, 255, 255, 255 }; #endif /* LTC_BASE64 */ +static const unsigned char map_base64url[] = { #if defined(LTC_BASE64_URL) -static const unsigned char map_base64url[256] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -68,8 +68,9 @@ static const unsigned char map_base64url[256] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, -255, 255, 255, 255 }; +255, 255, 255, 255 #endif /* LTC_BASE64_URL */ +}; enum { relaxed = 0, diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 9868a0fc4..251822bac 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -1,10 +1,12 @@ #include -#ifdef LTC_BASE64 +#if defined(LTC_BASE64) || defined(LTC_BASE64_URL) int base64_test(void) { unsigned char in[64], out[256], tmp[64]; unsigned long x, l1, l2, slen1; + +#if defined(LTC_BASE64) const char special_case[] = { 0xbe, 0xe8, 0x92, 0x3c, 0xa2, 0x25, 0xf0, 0xf8, 0x91, 0xe4, 0xef, 0xab, 0x0b, 0x8c, 0xfd, 0xff, @@ -31,7 +33,9 @@ int base64_test(void) {"foobar", "Zm9vYmFy"}, {special_case,"vuiSPKIl8PiR5O+rC4z9/xTQKZ0="} }; +#endif +#ifdef LTC_BASE64_URL const struct { const char* s; int is_strict; @@ -48,20 +52,6 @@ int base64_test(void) {"vuiS*===PKIl8P*iR5O-rC4*z9_xTQKZ0=", 0}, }; - for (x = 0; x < sizeof(cases)/sizeof(cases[0]); ++x) { - memset(out, 0, sizeof(out)); - memset(tmp, 0, sizeof(tmp)); - slen1 = strlen(cases[x].s); - l1 = sizeof(out); - DO(base64_encode((unsigned char*)cases[x].s, slen1, out, &l1)); - l2 = sizeof(tmp); - DO(base64_strict_decode(out, l1, tmp, &l2)); - if (compare_testvector(out, l1, cases[x].b64, strlen(cases[x].b64), "base64 encode", x) || - compare_testvector(tmp, l2, cases[x].s, slen1, "base64 decode", x)) { - return 1; - } - } - for (x = 0; x < sizeof(url_cases)/sizeof(url_cases[0]); ++x) { slen1 = strlen(url_cases[x].s); l1 = sizeof(out); @@ -85,6 +75,22 @@ int base64_test(void) } DO(base64url_strict_decode((unsigned char*)url_cases[4].s, slen1, out, &l1) == CRYPT_INVALID_PACKET ? CRYPT_OK : CRYPT_INVALID_PACKET); +#endif + +#if defined(LTC_BASE64) + for (x = 0; x < sizeof(cases)/sizeof(cases[0]); ++x) { + memset(out, 0, sizeof(out)); + memset(tmp, 0, sizeof(tmp)); + slen1 = strlen(cases[x].s); + l1 = sizeof(out); + DO(base64_encode((unsigned char*)cases[x].s, slen1, out, &l1)); + l2 = sizeof(tmp); + DO(base64_strict_decode(out, l1, tmp, &l2)); + if (compare_testvector(out, l1, cases[x].b64, strlen(cases[x].b64), "base64 encode", x) || + compare_testvector(tmp, l2, cases[x].s, slen1, "base64 decode", x)) { + return 1; + } + } for (x = 0; x < 64; x++) { yarrow_read(in, x, &yarrow_prng); @@ -109,6 +115,8 @@ int base64_test(void) } l2 = sizeof(tmp); DO(base64_strict_decode(out, l1, tmp, &l2) == CRYPT_INVALID_PACKET ? CRYPT_OK : CRYPT_INVALID_PACKET); +#endif + return 0; } #endif From dde11de78117624d484d43442cb52b269857697d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 1 Mar 2017 11:48:39 +0100 Subject: [PATCH 0484/1192] fixing compile failure in demos for -DLTC_EASY --- demos/hashsum.c | 1 + demos/multi.c | 5 ++++- demos/tv_gen.c | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 78d636975..8f94af55e 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -67,6 +67,7 @@ int main(int argc, char **argv) void register_algs(void) { int err; + LTC_UNUSED_PARAM(err); #ifdef LTC_TIGER register_hash (&tiger_desc); diff --git a/demos/multi.c b/demos/multi.c index 82d543f85..84d413676 100644 --- a/demos/multi.c +++ b/demos/multi.c @@ -56,6 +56,7 @@ int main(void) } /* LTC_OMAC */ +#ifdef LTC_OMAC len = sizeof(buf[0]); omac_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len); len2 = sizeof(buf[0]); @@ -76,8 +77,10 @@ int main(void) printf("Failed: %d %lu %lu\n", __LINE__, len, len2); return EXIT_FAILURE; } +#endif /* PMAC */ +#ifdef LTC_PMAC len = sizeof(buf[0]); pmac_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len); len2 = sizeof(buf[0]); @@ -98,7 +101,7 @@ int main(void) printf("Failed: %d %lu %lu\n", __LINE__, len, len2); return EXIT_FAILURE; } - +#endif printf("All passed\n"); return EXIT_SUCCESS; diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 1a6a6a107..f84bcfe4a 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -3,6 +3,7 @@ void reg_algs(void) { int err; + LTC_UNUSED_PARAM(err); #ifdef LTC_RIJNDAEL register_cipher (&aes_desc); @@ -340,6 +341,7 @@ void omac_gen(void) void pmac_gen(void) { +#ifdef LTC_PMAC unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], input[MAXBLOCKSIZE*2+2]; int err, x, y, z, kl; FILE *out; @@ -391,10 +393,12 @@ void pmac_gen(void) fprintf(out, "\n"); } fclose(out); +#endif } void eax_gen(void) { +#ifdef LTC_EAX_MODE int err, kl, x, y1, z; FILE *out; unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], header[MAXBLOCKSIZE*2], @@ -451,10 +455,12 @@ void eax_gen(void) fprintf(out, "\n"); } fclose(out); +#endif } void ocb_gen(void) { +#ifdef LTC_OCB_MODE int err, kl, x, y1, z; FILE *out; unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], @@ -514,10 +520,12 @@ void ocb_gen(void) fprintf(out, "\n"); } fclose(out); +#endif } void ocb3_gen(void) { +#ifdef LTC_OCB3_MODE int err, kl, x, y1, z; FILE *out; unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], @@ -577,10 +585,12 @@ void ocb3_gen(void) fprintf(out, "\n"); } fclose(out); +#endif } void ccm_gen(void) { +#ifdef LTC_CCM_MODE int err, kl, x, y1, z; FILE *out; unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], @@ -640,10 +650,12 @@ void ccm_gen(void) fprintf(out, "\n"); } fclose(out); +#endif } void gcm_gen(void) { +#ifdef LTC_GCM_MODE int err, kl, x, y1, z; FILE *out; unsigned char key[MAXBLOCKSIZE], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE]; @@ -697,6 +709,7 @@ void gcm_gen(void) fprintf(out, "\n"); } fclose(out); +#endif } void base64_gen(void) @@ -764,6 +777,7 @@ void ecc_gen(void) void lrw_gen(void) { +#ifdef LTC_LRW_MODE FILE *out; unsigned char tweak[16], key[16], iv[16], buf[1024]; int x, y, err; @@ -825,6 +839,7 @@ void lrw_gen(void) lrw_done(&lrw); } fclose(out); +#endif } int main(void) From 856be9cae8a994812107232dd0c9076bf06f58ff Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 1 Mar 2017 12:09:50 +0100 Subject: [PATCH 0485/1192] tv_gen needs more #ifdefs --- demos/tv_gen.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index f84bcfe4a..a4903af11 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -286,6 +286,7 @@ void hmac_gen(void) void omac_gen(void) { +#ifdef LTC_OMAC unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], input[MAXBLOCKSIZE*2+2]; int err, x, y, z, kl; FILE *out; @@ -337,6 +338,7 @@ void omac_gen(void) fprintf(out, "\n"); } fclose(out); +#endif } void pmac_gen(void) @@ -848,17 +850,33 @@ int main(void) printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n"); printf("Generating cipher vectors..."); fflush(stdout); cipher_gen(); printf("done\n"); printf("Generating HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n"); +#ifdef LTC_OMAC printf("Generating OMAC vectors..."); fflush(stdout); omac_gen(); printf("done\n"); +#endif +#ifdef LTC_PMAC printf("Generating PMAC vectors..."); fflush(stdout); pmac_gen(); printf("done\n"); +#endif +#ifdef LTC_EAX_MODE printf("Generating EAX vectors..."); fflush(stdout); eax_gen(); printf("done\n"); +#endif +#ifdef LTC_OCB_MODE printf("Generating OCB vectors..."); fflush(stdout); ocb_gen(); printf("done\n"); +#endif +#ifdef LTC_OCB3_MODE printf("Generating OCB3 vectors..."); fflush(stdout); ocb3_gen(); printf("done\n"); +#endif +#ifdef LTC_CCM_MODE printf("Generating CCM vectors..."); fflush(stdout); ccm_gen(); printf("done\n"); +#endif +#ifdef LTC_GCM_MODE printf("Generating GCM vectors..."); fflush(stdout); gcm_gen(); printf("done\n"); +#endif printf("Generating BASE64 vectors..."); fflush(stdout); base64_gen(); printf("done\n"); printf("Generating MATH vectors..."); fflush(stdout); math_gen(); printf("done\n"); printf("Generating ECC vectors..."); fflush(stdout); ecc_gen(); printf("done\n"); +#ifdef LTC_LRW_MODE printf("Generating LRW vectors..."); fflush(stdout); lrw_gen(); printf("done\n"); +#endif return 0; } From be9c66ab431fb68a4a2cb9c4195c7816068fa3cf Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 1 Mar 2017 13:35:19 +0100 Subject: [PATCH 0486/1192] tuning build.sh to handle -DLTC_EASY --- build.sh | 17 ++++++++++++++++- check-source.pl | 3 +-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 7731b3f32..82e61ce86 100755 --- a/build.sh +++ b/build.sh @@ -3,6 +3,11 @@ echo "$1 ($2, $3)..." make clean 1>/dev/null 2>/dev/null +if [ -f check-source.pl ] ; then + echo "checking white spaces..." + perl check-source.pl || exit 1 +fi + echo -n "building..." if [ -f /proc/cpuinfo ] @@ -28,7 +33,17 @@ echo -n "testing..." if [ -a test ] && [ -f test ] && [ -x test ]; then ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1) if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then - for f in *_tv.txt; do if (diff -i -w -B $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done + for f in *_tv.txt; do + # check for lines starting with '<' ($f might be a subset of notes/$f) + difftroubles=$(diff -i -w -B $f notes/$f | grep '^<') + if [ -n "$difftroubles" ]; then + echo "FAILURE: $f" + diff -i -w -B $f notes/$f + echo "tv_gen $f failed" && rm -f testok.txt && exit 1 + else + true + fi + done fi fi diff --git a/check-source.pl b/check-source.pl index a81ce24c0..cfd9a8cf4 100755 --- a/check-source.pl +++ b/check-source.pl @@ -9,7 +9,6 @@ use strict; use warnings; -use Test::More; use File::Find 'find'; use File::Basename 'basename'; use File::Glob 'bsd_glob'; @@ -37,7 +36,7 @@ sub read_file { $lineno++; } for my $k (sort keys %$troubles) { - warn "FAIL: [$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n"; + warn "[$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n"; $fails++; } } From 631a11cd35dbe816a4f1d92442078dfcf7da83fe Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 1 Mar 2017 14:00:45 +0100 Subject: [PATCH 0487/1192] removing "checking white spaces" part from build.sh --- build.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build.sh b/build.sh index 82e61ce86..94f27bf8b 100755 --- a/build.sh +++ b/build.sh @@ -3,11 +3,6 @@ echo "$1 ($2, $3)..." make clean 1>/dev/null 2>/dev/null -if [ -f check-source.pl ] ; then - echo "checking white spaces..." - perl check-source.pl || exit 1 -fi - echo -n "building..." if [ -f /proc/cpuinfo ] From 4f120531ab5f97d412e1bb223f4b8615b607bfab Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 1 Mar 2017 14:09:08 +0100 Subject: [PATCH 0488/1192] add separate CHECK_SOURCES build target --- .travis.yml | 4 ++++ check_source.sh | 17 +++++++++++++++++ testme.sh | 3 +++ 3 files changed, 24 insertions(+) create mode 100755 check_source.sh diff --git a/.travis.yml b/.travis.yml index 287a58595..3b95cb23a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ compiler: - clang script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a" env: + - | + BUILDSCRIPT="check_source.sh" + BUILDNAME="CHECK_SOURCES" + BUILDOPTIONS=" " - | BUILDSCRIPT="coverage.sh" BUILDNAME="COVERAGE" diff --git a/check_source.sh b/check_source.sh new file mode 100755 index 000000000..b1e9afdcd --- /dev/null +++ b/check_source.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# output version +bash printinfo.sh + +make clean > /dev/null + +if [ -f check-source.pl ] ; then + echo "checking white spaces..." + perl check-source.pl || exit 1 +fi + +exit 0 + +# $Source$ +# $Revision$ +# $Date$ diff --git a/testme.sh b/testme.sh index d50fae5c2..c1b3c238d 100755 --- a/testme.sh +++ b/testme.sh @@ -10,6 +10,9 @@ fi # date echo "date="`date` +# check sources +bash check_source.sh "CHECK_SOURCES" " " "$1" "$2" "$3" || exit 1 + # stock build bash run.sh "STOCK" " " "$1" "$2" "$3" || exit 1 From 90924708431c1ee3dc293d458ab79350991fcc03 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 20:46:12 +0100 Subject: [PATCH 0489/1192] fix doxygen warnings --- src/headers/tomcrypt_pk.h | 2 +- src/misc/crc32.c | 2 +- src/modes/xts/xts_done.c | 2 +- .../der_decode_subject_public_key_info.c | 17 +++++++++++------ .../der_encode_subject_public_key_info.c | 17 +++++++++++------ src/pk/rsa/rsa_sign_saltlen_get.c | 2 +- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index cfd7657ef..aba31f89f 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -12,7 +12,7 @@ int rand_prime(void *N, long len, prng_state *prng, int wprng); int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng); int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng); -enum { +enum public_key_algorithms { PKA_RSA, PKA_DSA }; diff --git a/src/misc/crc32.c b/src/misc/crc32.c index d9072ea35..8f9ca9731 100644 --- a/src/misc/crc32.c +++ b/src/misc/crc32.c @@ -11,7 +11,7 @@ #include "tomcrypt.h" /** - @file crc.c + @file crc32.c CRC-32 checksum algorithm Written and placed in the public domain by Wei Dai Adapted for libtomcrypt by Steffen Jaeckel diff --git a/src/modes/xts/xts_done.c b/src/modes/xts/xts_done.c index a7a85ed34..fbb163a44 100644 --- a/src/modes/xts/xts_done.c +++ b/src/modes/xts/xts_done.c @@ -17,7 +17,7 @@ #ifdef LTC_XTS_MODE /** Terminate XTS state - @param XTS The state to terminate + @param xts The state to terminate */ void xts_done(symmetric_xts *xts) { diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index fc65e9565..61d6f1fee 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -9,7 +9,7 @@ */ #include "tomcrypt.h" /** - @file der_encode_sequence_multi.c + @file der_decode_subject_public_key_info.c ASN.1 DER, encode a Subject Public Key structure --nmav */ @@ -26,11 +26,16 @@ * } */ /** - Encode a SEQUENCE type using a VA list - @param out [out] Destination for data - @param outlen [in/out] Length of buffer and resulting length of output - @remark <...> is of the form (int, unsigned long, void*) - @return CRYPT_OK on success + Decode a subject public key info + @param in The input buffer + @param inlen The length of the input buffer + @param algorithm One out of the enum #public_key_algorithms + @param public_key The buffer for the public key + @param public_key_len [in/out] The length of the public key buffer and the written length + @param parameters_type The parameters' type out of the enum #ltc_asn1_type + @param parameters The parameters to include + @param parameters_len The number of parameters to include + @return CRYPT_OK on success */ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long inlen, unsigned int algorithm, void* public_key, unsigned long* public_key_len, diff --git a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c index 2a738644e..0578d5348 100644 --- a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c @@ -10,7 +10,7 @@ #include "tomcrypt.h" /** - @file der_encode_sequence_multi.c + @file der_encode_subject_public_key_info.c ASN.1 DER, encode a Subject Public Key structure --nmav */ @@ -27,11 +27,16 @@ * } */ /** - Encode a SEQUENCE type using a VA list - @param out [out] Destination for data - @param outlen [in/out] Length of buffer and resulting length of output - @remark <...> is of the form (int, unsigned long, void*) - @return CRYPT_OK on success + Encode a subject public key info + @param out The output buffer + @param outlen [in/out] Length of buffer and resulting length of output + @param algorithm One out of the enum #public_key_algorithms + @param public_key The buffer for the public key + @param public_key_len The length of the public key buffer + @param parameters_type The parameters' type out of the enum #ltc_asn1_type + @param parameters The parameters to include + @param parameters_len The number of parameters to include + @return CRYPT_OK on success */ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen, unsigned int algorithm, void* public_key, unsigned long public_key_len, diff --git a/src/pk/rsa/rsa_sign_saltlen_get.c b/src/pk/rsa/rsa_sign_saltlen_get.c index d549a4fac..9f5cadb8c 100644 --- a/src/pk/rsa/rsa_sign_saltlen_get.c +++ b/src/pk/rsa/rsa_sign_saltlen_get.c @@ -11,7 +11,7 @@ #include "tomcrypt.h" /** - @file rsa_sign_saltlen_get_ex.c + @file rsa_sign_saltlen_get.c Retrieve the maximum size of the salt, Steffen Jaeckel. */ From 1a1addcefdade540e0f355126e6a8f84a1d88596 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 28 Feb 2017 23:59:30 +0100 Subject: [PATCH 0490/1192] move declarations at the block beginning (ANSI C) --- src/misc/crc32.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/misc/crc32.c b/src/misc/crc32.c index 8f9ca9731..1099af2ae 100644 --- a/src/misc/crc32.c +++ b/src/misc/crc32.c @@ -149,9 +149,10 @@ void crc32_init(crc32_state *ctx) void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long length) { + ulong32 crc; LTC_ARGCHKVD(ctx != NULL); LTC_ARGCHKVD(input != NULL); - ulong32 crc = ctx->crc; + crc = ctx->crc; while (length--) crc = crc32_m_tab[CRC32_INDEX(crc) ^ *input++] ^ CRC32_SHIFTED(crc); @@ -161,14 +162,18 @@ void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long le void crc32_finish(crc32_state *ctx, void *hash, unsigned long size) { + unsigned char* h; + unsigned long i; + ulong32 crc; + LTC_ARGCHKVD(ctx != NULL); LTC_ARGCHKVD(hash != NULL); - unsigned char* h = hash; - unsigned long i; - - ulong32 crc = ctx->crc; + h = hash; + crc = ctx->crc; crc ^= _CRC32_NEGL; + + if (size > 4) size = 4; for (i = 0; i < size; i++) { h[i] = ((unsigned char*)&(crc))[i]; } From 2df86d65e87c40a709837e7714ad148a8bcbdf01 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 10 Oct 2016 13:00:20 +0200 Subject: [PATCH 0491/1192] don't execute coverage script for private travis --- coverage.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coverage.sh b/coverage.sh index cb6c839d0..1c374ff63 100755 --- a/coverage.sh +++ b/coverage.sh @@ -2,8 +2,12 @@ set -e +if [ "$TRAVIS_CI" == "private" ]; then + exit 0 +fi + if [ "$#" != "5" ]; then - echo "Usage is: ${0} \"coverage\" \"\" \"\" \"\" " + echo "Usage is: ${0} \"coverage\" \"\" \"\" \"\" " echo "CC=gcc ${0} \"coverage\" \" \" \"makefile\" \"-DUSE_LTM -DLTM_DESC -I../libtommath\" ../libtommath/libtommath.a" exit -1 fi From 199ff63e5f25aba1e32e920391dd84f03145e33a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 1 Mar 2017 16:00:13 +0100 Subject: [PATCH 0492/1192] add '-c' option to updatemakes.sh --- updatemakes.sh | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/updatemakes.sh b/updatemakes.sh index cbf174f65..5fd4775d5 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -1,29 +1,26 @@ #!/bin/bash -bash genlist.sh > tmplist - -perl filter.pl makefile tmplist -sed -e 's/ *$//' < tmp.delme > makefile -rm -f tmp.delme - -perl filter.pl makefile.icc tmplist -sed -e 's/ *$//' < tmp.delme > makefile.icc -rm -f tmp.delme +makefiles=(makefile makefile.icc makefile.shared makefile.unix makefile.mingw) -perl filter.pl makefile.shared tmplist -sed -e 's/ *$//' < tmp.delme > makefile.shared -rm -f tmp.delme +function update_makefile() { + perl filter.pl $1 tmplist + sed -e 's/ *$//' < tmp.delme > $1 + rm -f tmp.delme +} -perl filter.pl makefile.unix tmplist -sed -e 's/ *$//' < tmp.delme > makefile.unix -rm -f tmp.delme +bash genlist.sh > tmplist -perl filter.pl makefile.mingw tmplist -sed -e 's/ *$//' < tmp.delme > makefile.mingw -rm -f tmp.delme +for i in "${makefiles[@]}" +do + update_makefile "$i" +done perl filter.pl makefile.msvc tmplist sed -e 's/\.o /.obj /g' -e 's/ *$//' < tmp.delme > makefile.msvc rm -f tmp.delme rm -f tmplist + +if [ $# -eq 1 ] && [ "$1" == "-c" ]; then + git add ${makefiles[@]} makefile.msvc && git commit -m 'Update makefiles' +fi From 1e977e662fc7f853e7f72ec1813eae85e75df26d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 1 Mar 2017 17:52:05 +0100 Subject: [PATCH 0493/1192] fix updatemakes.sh indentation --- updatemakes.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/updatemakes.sh b/updatemakes.sh index 5fd4775d5..b5d24e40c 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -3,9 +3,9 @@ makefiles=(makefile makefile.icc makefile.shared makefile.unix makefile.mingw) function update_makefile() { - perl filter.pl $1 tmplist - sed -e 's/ *$//' < tmp.delme > $1 - rm -f tmp.delme + perl filter.pl $1 tmplist + sed -e 's/ *$//' < tmp.delme > $1 + rm -f tmp.delme } bash genlist.sh > tmplist From 61ae75a823bed237fbdedba58ba26f6778496a36 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 1 Mar 2017 22:07:28 +0100 Subject: [PATCH 0494/1192] sort filenames on perl level during updatemakes.sh --- parsenames.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsenames.pl b/parsenames.pl index cc2abed82..66160297d 100755 --- a/parsenames.pl +++ b/parsenames.pl @@ -11,7 +11,7 @@ my $b = $ARGV[0] . '='; my $len = length $b; print $b; -foreach my $obj (@a) { +foreach my $obj (sort @a) { $len = $len + length $obj; $obj =~ s/\*/\$/; if ($len > 100) { From 8c90cba6f6277488f8d2386dcdf4b5633f4ee1f5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 2 Mar 2017 11:27:39 +0100 Subject: [PATCH 0495/1192] install libtommath-dev from debian sid --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3b95cb23a..c9aeb0519 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,9 +81,14 @@ matrix: branches: only: - develop +addons: + apt: + sources: + - debian-sid + packages: + - libtommath-dev before_script: - sudo apt-get update -qq - - sudo apt-get install libtommath-dev - sudo pip install cpp-coveralls after_failure: - cat test_std.txt From f94ee4a5a779995e3afb84a77d01af75948474e0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 2 Mar 2017 11:41:01 +0100 Subject: [PATCH 0496/1192] location of new libtommath.a has changed --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c9aeb0519..7edd85c2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: c compiler: - gcc - clang -script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a" +script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" env: - | BUILDSCRIPT="check_source.sh" From 2277b420f004702491aca95298f524c634612ad3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 2 Mar 2017 12:18:47 +0100 Subject: [PATCH 0497/1192] also install binutils from debian-sid --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7edd85c2b..576a6bea0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,6 +86,7 @@ addons: sources: - debian-sid packages: + - binutils - libtommath-dev before_script: - sudo apt-get update -qq From 081ee457120c4e0df7f174968f3682e73dbf4054 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 6 Mar 2017 10:43:39 +0100 Subject: [PATCH 0498/1192] move declaration at block beginning --- src/modes/xts/xts_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index e274eb021..0b887adcf 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -17,6 +17,7 @@ static int _xts_test_accel_xts_encrypt(const unsigned char *pt, unsigned char *c { int ret; symmetric_xts xts; + void *orig; /* AES can be under rijndael or aes... try to find it */ if ((xts.cipher = find_cipher("aes")) == -1) { @@ -24,7 +25,7 @@ static int _xts_test_accel_xts_encrypt(const unsigned char *pt, unsigned char *c return CRYPT_NOP; } } - void *orig = cipher_descriptor[xts.cipher].accel_xts_encrypt; + orig = cipher_descriptor[xts.cipher].accel_xts_encrypt; cipher_descriptor[xts.cipher].accel_xts_encrypt = NULL; XMEMCPY(&xts.key1, skey1, sizeof(symmetric_key)); @@ -41,6 +42,7 @@ static int _xts_test_accel_xts_decrypt(const unsigned char *ct, unsigned char *p { int ret; symmetric_xts xts; + void *orig; /* AES can be under rijndael or aes... try to find it */ if ((xts.cipher = find_cipher("aes")) == -1) { @@ -48,7 +50,7 @@ static int _xts_test_accel_xts_decrypt(const unsigned char *ct, unsigned char *p return CRYPT_NOP; } } - void *orig = cipher_descriptor[xts.cipher].accel_xts_decrypt; + orig = cipher_descriptor[xts.cipher].accel_xts_decrypt; cipher_descriptor[xts.cipher].accel_xts_decrypt = NULL; XMEMCPY(&xts.key1, skey1, sizeof(symmetric_key)); From fb749199db3ecc2edf10e25ce15f9ff83255bdd6 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 6 Mar 2017 19:51:46 +0100 Subject: [PATCH 0499/1192] moving declaration to block beginning --- src/misc/crypt/crypt_constants.c | 4 ++-- src/misc/crypt/crypt_sizes.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 03755b06f..68e9aae23 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -182,7 +182,7 @@ int crypt_get_constant(const char* namein, int *valueout) { int crypt_list_all_constants(char *names_list, unsigned int *names_list_size) { int i; unsigned int total_len = 0; - char number[32]; + char number[32], *ptr; int number_len; int count = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); @@ -205,7 +205,7 @@ int crypt_list_all_constants(char *names_list, unsigned int *names_list_size) { return -1; } /* build the names list */ - char *ptr = names_list; + ptr = names_list; for (i=0; i Date: Mon, 6 Mar 2017 19:53:04 +0100 Subject: [PATCH 0500/1192] msvc 2008 does not like { } initialization --- src/encauth/ocb3/ocb3_test.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index d59d005d0..011ded74f 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -38,9 +38,9 @@ int ocb3_test(void) { /* index:0 */ 0, /* PLAINTEXT length */ 0, /* AAD length */ - { }, /* PLAINTEXT */ - { }, /* AAD */ - { }, /* CIPHERTEXT */ + { 0 }, /* PLAINTEXT */ + { 0 }, /* AAD */ + { 0 }, /* CIPHERTEXT */ { 0x19,0x7b,0x9c,0x3c,0x44,0x1d,0x3c,0x83,0xea,0xfb,0x2b,0xef,0x63,0x3b,0x91,0x82 }, /* TAG */ }, { /* index:1 */ @@ -54,16 +54,16 @@ int ocb3_test(void) { /* index:2 */ 0, /* PLAINTEXT length */ 8, /* AAD length */ - { }, /* PLAINTEXT */ + { 0 }, /* PLAINTEXT */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* AAD */ - { }, /* CIPHERTEXT */ + { 0 }, /* CIPHERTEXT */ { 0x98,0xb9,0x15,0x52,0xc8,0xc0,0x09,0x18,0x50,0x44,0xe3,0x0a,0x6e,0xb2,0xfe,0x21 }, /* TAG */ }, { /* index:3 */ 8, /* PLAINTEXT length */ 0, /* AAD length */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }, /* PLAINTEXT */ - { }, /* AAD */ + { 0 }, /* AAD */ { 0x92,0xb6,0x57,0x13,0x0a,0x74,0xb8,0x5a }, /* CIPHERTEXT */ { 0x97,0x1e,0xff,0xca,0xe1,0x9a,0xd4,0x71,0x6f,0x88,0xe8,0x7b,0x87,0x1f,0xbe,0xed }, /* TAG */ }, @@ -78,16 +78,16 @@ int ocb3_test(void) { /* index:5 */ 0, /* PLAINTEXT length */ 16, /* AAD length */ - { }, /* PLAINTEXT */ + { 0 }, /* PLAINTEXT */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* AAD */ - { }, /* CIPHERTEXT */ + { 0 }, /* CIPHERTEXT */ { 0x7d,0xdb,0x8e,0x6c,0xea,0x68,0x14,0x86,0x62,0x12,0x50,0x96,0x19,0xb1,0x9c,0xc6 }, /* TAG */ }, { /* index:6 */ 16, /* PLAINTEXT length */ 0, /* AAD length */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }, /* PLAINTEXT */ - { }, /* AAD */ + { 0 }, /* AAD */ { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22 }, /* CIPHERTEXT */ { 0x13,0xcc,0x8b,0x74,0x78,0x07,0x12,0x1a,0x4c,0xbb,0x3e,0x4b,0xd6,0xb4,0x56,0xaf }, /* TAG */ }, @@ -102,16 +102,16 @@ int ocb3_test(void) { /* index:8 */ 0, /* PLAINTEXT length */ 24, /* AAD length */ - { }, /* PLAINTEXT */ + { 0 }, /* PLAINTEXT */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* AAD */ - { }, /* CIPHERTEXT */ + { 0 }, /* CIPHERTEXT */ { 0x28,0x20,0x26,0xda,0x30,0x68,0xbc,0x9f,0xa1,0x18,0x68,0x1d,0x55,0x9f,0x10,0xf6 }, /* TAG */ }, { /* index:9 */ 24, /* PLAINTEXT length */ 0, /* AAD length */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17 }, /* PLAINTEXT */ - { }, /* AAD */ + { 0 }, /* AAD */ { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xfc,0xfc,0xee,0x7a,0x2a,0x8d,0x4d,0x48 }, /* CIPHERTEXT */ { 0x6e,0xf2,0xf5,0x25,0x87,0xfd,0xa0,0xed,0x97,0xdc,0x7e,0xed,0xe2,0x41,0xdf,0x68 }, /* TAG */ }, @@ -126,16 +126,16 @@ int ocb3_test(void) { /* index:11 */ 0, /* PLAINTEXT length */ 32, /* AAD length */ - { }, /* PLAINTEXT */ + { 0 }, /* PLAINTEXT */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* AAD */ - { }, /* CIPHERTEXT */ + { 0 }, /* CIPHERTEXT */ { 0xe1,0xe0,0x72,0x63,0x3b,0xad,0xe5,0x1a,0x60,0xe8,0x59,0x51,0xd9,0xc4,0x2a,0x1b }, /* TAG */ }, { /* index:12 */ 32, /* PLAINTEXT length */ 0, /* AAD length */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f }, /* PLAINTEXT */ - { }, /* AAD */ + { 0 }, /* AAD */ { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb }, /* CIPHERTEXT */ { 0x4a,0x3b,0xae,0x82,0x44,0x65,0xcf,0xda,0xf8,0xc4,0x1f,0xc5,0x0c,0x7d,0xf9,0xd9 }, /* TAG */ }, @@ -150,16 +150,16 @@ int ocb3_test(void) { /* index:14 */ 0, /* PLAINTEXT length */ 40, /* AAD length */ - { }, /* PLAINTEXT */ + { 0 }, /* PLAINTEXT */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* AAD */ - { }, /* CIPHERTEXT */ + { 0 }, /* CIPHERTEXT */ { 0x7a,0xeb,0x7a,0x69,0xa1,0x68,0x7d,0xd0,0x82,0xca,0x27,0xb0,0xd9,0xa3,0x70,0x96 }, /* TAG */ }, { /* index:15 */ 40, /* PLAINTEXT length */ 0, /* AAD length */ { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }, /* PLAINTEXT */ - { }, /* AAD */ + { 0 }, /* AAD */ { 0xbe,0xa5,0xe8,0x79,0x8d,0xbe,0x71,0x10,0x03,0x1c,0x14,0x4d,0xa0,0xb2,0x61,0x22,0xce,0xaa,0xb9,0xb0,0x5d,0xf7,0x71,0xa6,0x57,0x14,0x9d,0x53,0x77,0x34,0x63,0xcb,0x68,0xc6,0x57,0x78,0xb0,0x58,0xa6,0x35 }, /* CIPHERTEXT */ { 0x06,0x0c,0x84,0x67,0xf4,0xab,0xab,0x5e,0x8b,0x3c,0x20,0x67,0xa2,0xe1,0x15,0xdc }, /* TAG */ }, From ac3f55fd92170848e1556023ec0423f9cf0ec013 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 6 Mar 2017 19:54:43 +0100 Subject: [PATCH 0501/1192] there is no snprintf before Visual C++ 2015 --- src/headers/tomcrypt_macros.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 39cf1182b..52ca9402a 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -430,6 +430,11 @@ static inline ulong64 ROR64(ulong64 word, int i) #define byte(x, n) (((x) >> (8 * (n))) & 255) #endif +/* there is no snprintf before Visual C++ 2015 */ +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define snprintf _snprintf +#endif + /* $Source$ */ /* $Revision$ */ /* $Date$ */ From 90da7e71e1dcb2ed1911524f85c7d8e14b396d2f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 1 Mar 2017 14:31:02 +0100 Subject: [PATCH 0502/1192] There's no need running the same test multiple times If there would be some random input okay, but like that it's just running the same functionality over and over again. --- testprof/ecc_test.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/testprof/ecc_test.c b/testprof/ecc_test.c index 60512afb7..b95fa930f 100644 --- a/testprof/ecc_test.c +++ b/testprof/ecc_test.c @@ -112,10 +112,6 @@ int ecc_tests (void) int stat, stat2; ecc_key usera, userb, pubKey, privKey; - DO(ecc_test ()); - DO(ecc_test ()); - DO(ecc_test ()); - DO(ecc_test ()); DO(ecc_test ()); for (s = 0; s < (sizeof(sizes)/sizeof(sizes[0])); s++) { From ea1228d3abe059474d547e8e3b6d3a0d9ab8cc5a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 1 Mar 2017 15:00:04 +0100 Subject: [PATCH 0503/1192] I like aligned output :) ...and I dislike c&p'ed code --- demos/test.c | 69 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/demos/test.c b/demos/test.c index 1ae530ecc..23e8be1f3 100644 --- a/demos/test.c +++ b/demos/test.c @@ -1,8 +1,34 @@ #include +#define LTC_TEST_FN(f) { f, #f } + +static const struct { + int (*fn)(void); + const char* name; +} test_functions[] = +{ + LTC_TEST_FN(store_test), + LTC_TEST_FN(misc_test), + LTC_TEST_FN(cipher_hash_test), + LTC_TEST_FN(mac_test), + LTC_TEST_FN(modes_test), + LTC_TEST_FN(der_tests), + LTC_TEST_FN(pkcs_1_test), + LTC_TEST_FN(pkcs_1_pss_test), + LTC_TEST_FN(pkcs_1_oaep_test), + LTC_TEST_FN(pkcs_1_emsa_test), + LTC_TEST_FN(pkcs_1_eme_test), + LTC_TEST_FN(rsa_test), + LTC_TEST_FN(dh_test), + LTC_TEST_FN(ecc_tests), + LTC_TEST_FN(dsa_test), + LTC_TEST_FN(katja_test), +}; + int main(void) { int x; + size_t fn_len, i, dots; reg_algs(); #ifdef USE_LTM @@ -18,22 +44,33 @@ int main(void) printf("build == \n%s\n", crypt_build_settings); printf("MP_DIGIT_BIT = %d\n", MP_DIGIT_BIT); - printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\nmisc_test....."); fflush(stdout); x = misc_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\nmodes_test...."); fflush(stdout); x = modes_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\nder_test......"); fflush(stdout); x = der_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\npkcs_1_pss_test...."); fflush(stdout); x = pkcs_1_pss_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\npkcs_1_oaep_test...."); fflush(stdout); x = pkcs_1_oaep_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\npkcs_1_emsa_test...."); fflush(stdout); x = pkcs_1_emsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\npkcs_1_eme_test...."); fflush(stdout); x = pkcs_1_eme_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\ndh_test......."); fflush(stdout); x = dh_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\ndsa_test......"); fflush(stdout); x = dsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); - printf("\nkatja_test...."); fflush(stdout); x = katja_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE); + + fn_len = 0; + for (i = 0; i < sizeof(test_functions)/sizeof(test_functions[0]); ++i) { + size_t len = strlen(test_functions[i].name); + if (fn_len < len) fn_len = len; + } + + fn_len = fn_len + (4 - (fn_len % 4)); + + for (i = 0; i < sizeof(test_functions)/sizeof(test_functions[0]); ++i) { + dots = fn_len - strlen(test_functions[i].name); + + printf("\n%s", test_functions[i].name); + while(dots--) printf("."); + fflush(stdout); + + x = test_functions[i].fn(); + + if (x) { + printf("failed\n"); + exit(EXIT_FAILURE); + } + else { + printf("passed"); + } + } + printf("\n"); return EXIT_SUCCESS; } From 421a241ccf09b017e4b8fa515ab851b4b5ad606d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 2 Mar 2017 09:05:40 +0100 Subject: [PATCH 0504/1192] travis script - check wheather makefiles are updated --- check-source.pl | 45 -------------- check_source.sh | 6 +- filter.pl | 30 ---------- genlist.sh | 10 ---- helper.pl | 152 ++++++++++++++++++++++++++++++++++++++++++++++++ makefile | 90 ++++++++++++++-------------- makefile.icc | 90 ++++++++++++++-------------- makefile.mingw | 88 ++++++++++++++-------------- makefile.msvc | 88 ++++++++++++++-------------- makefile.shared | 90 ++++++++++++++-------------- makefile.unix | 88 ++++++++++++++-------------- parsenames.pl | 31 ---------- updatemakes.sh | 25 +------- 13 files changed, 417 insertions(+), 416 deletions(-) delete mode 100755 check-source.pl delete mode 100755 filter.pl delete mode 100755 genlist.sh create mode 100755 helper.pl delete mode 100755 parsenames.pl diff --git a/check-source.pl b/check-source.pl deleted file mode 100755 index cfd9a8cf4..000000000 --- a/check-source.pl +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env perl - -# tests source files for unwanted issues: -# - CRLF newlines -# - tabs \t -# - trailing spaces -# - unresolved merge conflicts - -use strict; -use warnings; - -use File::Find 'find'; -use File::Basename 'basename'; -use File::Glob 'bsd_glob'; - -sub read_file { - my $f = shift; - open my $fh, "<:raw", $f or die "FATAL: read_rawfile() cannot open file '$f': $!"; - return do { local $/; <$fh> }; -} - -my @all_files = (bsd_glob("makefile*"), bsd_glob("*.sh"), bsd_glob("*.pl")); -find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src testprof demos/); - -my $fails = 0; -for my $file (sort @all_files) { - next unless $file =~ /\.(c|h|pl|py|sh)$/ || basename($file) =~ /^makefile/i; - my $troubles = {}; - my $lineno = 1; - my $content = read_file($file); - push @{$troubles->{crlf_line_end}}, '?' if $content =~ /\r/; - for my $l (split /\n/, $content) { - push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/; - push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/; - push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i; - $lineno++; - } - for my $k (sort keys %$troubles) { - warn "[$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n"; - $fails++; - } -} - -die "FAILED $fails\n" if $fails > 0; -warn "PASS\n"; diff --git a/check_source.sh b/check_source.sh index b1e9afdcd..005674720 100755 --- a/check_source.sh +++ b/check_source.sh @@ -5,10 +5,8 @@ bash printinfo.sh make clean > /dev/null -if [ -f check-source.pl ] ; then - echo "checking white spaces..." - perl check-source.pl || exit 1 -fi +echo "checking..." +./helper.pl --check-source --check-makefiles || exit 1 exit 0 diff --git a/filter.pl b/filter.pl deleted file mode 100755 index 58b75840c..000000000 --- a/filter.pl +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/perl - -# we want to filter every between START_INS and END_INS out and then insert crap from another file (this is fun) - -use strict; -use warnings; - -open(my $src, '<', shift); -open(my $ins, '<', shift); -open(my $tmp, '>', 'tmp.delme'); - -my $l = 0; -while (<$src>) { - if ($_ =~ /START_INS/) { - print {$tmp} $_; - $l = 1; - while (<$ins>) { - print {$tmp} $_; - } - close $ins; - } elsif ($_ =~ /END_INS/) { - print {$tmp} $_; - $l = 0; - } elsif ($l == 0) { - print {$tmp} $_; - } -} - -close $tmp; -close $src; diff --git a/genlist.sh b/genlist.sh deleted file mode 100755 index 33bf19e73..000000000 --- a/genlist.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# aes_tab.o is a pseudo object as it's made from aes.o and MPI is optional -export a=`echo -n "src/ciphers/aes/aes_enc.o " ; find ./src -type f -name "*.c" -not -name "*tab.c" | sort | sed -e 'sE\./EE' | sed -e 's/\.c/\.o/' | xargs` -perl ./parsenames.pl OBJECTS "$a" -export a=`find src/headers -type f -name "*.h" | sort | xargs` -perl ./parsenames.pl HEADERS "$a" - -# $Source$ -# $Revision$ -# $Date$ diff --git a/helper.pl b/helper.pl new file mode 100755 index 000000000..680a69bb5 --- /dev/null +++ b/helper.pl @@ -0,0 +1,152 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Getopt::Long; +use File::Find 'find'; +use File::Basename 'basename'; +use File::Glob 'bsd_glob'; + +sub read_file { + my $f = shift; + open my $fh, "<", $f or die "FATAL: read_rawfile() cannot open file '$f': $!"; + binmode $fh; + return do { local $/; <$fh> }; +} + +sub write_file { + my ($f, $data) = @_; + die "FATAL: write_file() no data" unless defined $data; + open my $fh, ">", $f or die "FATAL: write_file() cannot open file '$f': $!"; + binmode $fh; + print $fh $data or die "FATAL: write_file() cannot write to '$f': $!"; + close $fh or die "FATAL: write_file() cannot close '$f': $!"; + return; +} + +sub check_source { + my @all_files = (bsd_glob("makefile*"), bsd_glob("*.sh"), bsd_glob("*.pl")); + find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src testprof demos/); + + my $fails = 0; + for my $file (sort @all_files) { + next unless $file =~ /\.(c|h|pl|py|sh)$/ || basename($file) =~ /^makefile/i; + my $troubles = {}; + my $lineno = 1; + my $content = read_file($file); + push @{$troubles->{crlf_line_end}}, '?' if $content =~ /\r/; + for my $l (split /\n/, $content) { + push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/; + push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/; + push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i; + push @{$troubles->{non_ascii_char}}, $lineno if $l =~ /[^[:ascii:]]/; + $lineno++; + } + for my $k (sort keys %$troubles) { + warn "[$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n"; + $fails++; + } + } + + warn( $fails > 0 ? "check-source: FAIL $fails\n" : "check-source: PASS\n" ); + return $fails; +} + +sub prepare_variable { + my ($varname, @list) = @_; + my $output = "$varname="; + my $len = length($output); + foreach my $obj (sort @list) { + $len = $len + length $obj; + $obj =~ s/\*/\$/; + if ($len > 100) { + $output .= "\\\n"; + $len = length $obj; + } + $output .= $obj . ' '; + } + $output =~ s/ $//; + return $output; +} + +sub patch_makefile { + my ($in_ref, $out_ref, $data) = @_; + open(my $src, '<', $in_ref); + open(my $dst, '>', $out_ref); + my $l = 0; + while (<$src>) { + if ($_ =~ /START_INS/) { + print {$dst} $_; + $l = 1; + print {$dst} $data; + } elsif ($_ =~ /END_INS/) { + print {$dst} $_; + $l = 0; + } elsif ($l == 0) { + print {$dst} $_; + } + } + close $dst; + close $src; +} + +sub process_makefiles { + my $write = shift; + my @c = (); + find({ no_chdir => 1, wanted => sub { push @c, $_ if -f $_ && $_ =~ /\.c$/ && $_ !~ /tab.c$/ } }, 'src'); + my @h = (); + find({ no_chdir => 1, wanted => sub { push @h, $_ if -f $_ && $_ =~ /\.h$/ && $_ !~ /dh_static.h$/ } }, 'src'); + + my @o = sort ('src/ciphers/aes/aes_enc.o', map { $_ =~ s/\.c$/.o/; $_ } @c); + my $var_o = prepare_variable("OBJECTS", @o); + (my $var_obj = $var_o) =~ s/\.o\b/.obj/sg; + my $var_h = prepare_variable("HEADERS", (sort @h, 'testprof/tomcrypt_test.h')); + + my @makefiles = qw( makefile makefile.icc makefile.shared makefile.unix makefile.mingw makefile.msvc ); + my $changed_count = 0; + for my $m (@makefiles) { + my $old = read_file($m); + my $new; + if ($m eq 'makefile.msvc') { + patch_makefile(\$old, \$new, "$var_obj\n\n$var_h\n\n"); + } + else { + patch_makefile(\$old, \$new, "$var_o\n\n$var_h\n\n"); + } + if ($old ne $new) { + write_file($m, $new) if $write; + warn "changed: $m\n"; + $changed_count++; + } + } + if ($write) { + return 0; # no failures + } + else { + warn( $changed_count > 0 ? "check-makefiles: FAIL $changed_count\n" : "check-makefiles: PASS\n" ); + return $changed_count; + } +} + +sub die_usage { + die <<"MARKER"; + usage: $0 --check-source + $0 --check-makefiles + $0 --update-makefiles +MARKER +} + +GetOptions( "check-source" => \my $check_source, + "check-makefiles" => \my $check_makefiles, + "update-makefiles" => \my $update_makefiles, + "help" => \my $help + ) or die_usage; + +my $failure; +$failure ||= check_source() if $check_source; +$failure ||= process_makefiles(0) if $check_makefiles; +$failure ||= process_makefiles(1) if $update_makefiles; + +die_usage unless defined $failure; +exit $failure ? 1 : 0; diff --git a/makefile b/makefile index 2641a8328..5c2e7616e 100644 --- a/makefile +++ b/makefile @@ -42,7 +42,7 @@ LIBTEST_S=$(LIBTEST) #List of objects to compile. #START_INS -OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ +OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ @@ -51,30 +51,29 @@ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_i src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ -src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -87,11 +86,11 @@ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_t src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -100,8 +99,8 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ -src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ @@ -153,31 +152,30 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ -src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ -src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ -src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ -src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ -src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ -src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ -src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ -src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ -src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ -src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ -src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ -src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ -src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o - -HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ +src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ +src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ +src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ +src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ +src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ +src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ +src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ +src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ +src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ +src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ +src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ +src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ +src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o + +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.icc b/makefile.icc index 6d6769422..97f192d96 100644 --- a/makefile.icc +++ b/makefile.icc @@ -99,7 +99,7 @@ endif #List of objects to compile. #START_INS -OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ +OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ @@ -108,30 +108,29 @@ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_i src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ -src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -144,11 +143,11 @@ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_t src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -157,8 +156,8 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ -src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ @@ -210,31 +209,30 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ -src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ -src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ -src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ -src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ -src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ -src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ -src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ -src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ -src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ -src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ -src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ -src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ -src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o - -HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ +src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ +src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ +src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ +src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ +src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ +src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ +src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ +src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ +src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ +src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ +src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ +src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ +src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o + +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.mingw b/makefile.mingw index bf5545cd6..2aa473584 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -46,7 +46,7 @@ INCPATH=$(INSTPREFIX)\include #List of objects to compile. #START_INS -OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ +OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ @@ -55,30 +55,29 @@ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_i src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ -src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -91,11 +90,11 @@ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_t src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -104,8 +103,8 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ -src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ @@ -157,31 +156,30 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ -src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ -src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ -src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ -src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ -src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ -src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ -src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ -src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ -src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ -src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ -src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ -src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ -src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ +src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ +src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ +src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ +src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ +src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ +src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ +src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ +src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ +src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ +src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ +src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ +src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ +src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.msvc b/makefile.msvc index a043ede57..915d80468 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -4,7 +4,7 @@ CFLAGS = /Isrc/headers/ /Itestprof/ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ $(CF) #START_INS -OBJECTS=src/ciphers/aes/aes_enc.obj src/ciphers/aes/aes.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \ +OBJECTS=src/ciphers/aes/aes.obj src/ciphers/aes/aes_enc.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \ src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \ src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \ src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/skipjack.obj \ @@ -13,30 +13,29 @@ src/encauth/ccm/ccm_add_nonce.obj src/encauth/ccm/ccm_done.obj src/encauth/ccm/c src/encauth/ccm/ccm_memory.obj src/encauth/ccm/ccm_memory_ex.obj src/encauth/ccm/ccm_process.obj \ src/encauth/ccm/ccm_reset.obj src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj \ src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ -src/encauth/eax/eax_encrypt_authenticate_memory.obj src/encauth/eax/eax_encrypt.obj \ +src/encauth/eax/eax_encrypt.obj src/encauth/eax/eax_encrypt_authenticate_memory.obj \ src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \ src/encauth/gcm/gcm_add_iv.obj src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj \ src/encauth/gcm/gcm_init.obj src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj \ src/encauth/gcm/gcm_process.obj src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj \ +src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \ +src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj \ +src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj \ src/encauth/ocb3/ocb3_add_aad.obj src/encauth/ocb3/ocb3_decrypt.obj src/encauth/ocb3/ocb3_decrypt_last.obj \ src/encauth/ocb3/ocb3_decrypt_verify_memory.obj src/encauth/ocb3/ocb3_done.obj \ -src/encauth/ocb3/ocb3_encrypt_authenticate_memory.obj src/encauth/ocb3/ocb3_encrypt.obj \ +src/encauth/ocb3/ocb3_encrypt.obj src/encauth/ocb3/ocb3_encrypt_authenticate_memory.obj \ src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj \ src/encauth/ocb3/ocb3_int_aad_add_block.obj src/encauth/ocb3/ocb3_int_calc_offset_zero.obj \ src/encauth/ocb3/ocb3_int_ntz.obj src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj \ -src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \ -src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_encrypt.obj \ -src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj src/encauth/ocb/ocb_shift_xor.obj \ -src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj src/hashes/chc/chc.obj \ -src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \ -src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \ -src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \ -src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj src/hashes/sha2/sha512_224.obj \ -src/hashes/sha2/sha512_256.obj src/hashes/sha2/sha512.obj src/hashes/tiger.obj src/hashes/whirl/whirl.obj \ -src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj \ -src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj \ -src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj \ +src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj \ +src/hashes/helper/hash_memory.obj src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj \ +src/hashes/md5.obj src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj \ +src/hashes/sha1.obj src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj \ +src/hashes/sha2/sha512.obj src/hashes/sha2/sha512_224.obj src/hashes/sha2/sha512_256.obj src/hashes/tiger.obj \ +src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj \ +src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj \ +src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj \ src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj \ src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj \ src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj \ @@ -49,11 +48,11 @@ src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xc src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/adler32.obj \ src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crc32.obj \ -src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj \ +src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt_cipher_descriptor.obj \ src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_constants.obj \ -src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher.obj \ -src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash_any.obj \ -src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_id.obj \ +src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_any.obj \ +src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash.obj \ +src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash_id.obj \ src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ @@ -62,8 +61,8 @@ src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ -src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj \ -src/misc/pkcs5/pkcs_5_test.obj src/misc/pk_get_oid.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \ +src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pk_get_oid.obj src/misc/pkcs5/pkcs_5_1.obj \ +src/misc/pkcs5/pkcs_5_2.obj src/misc/pkcs5/pkcs_5_test.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \ src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj \ src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj \ src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj \ @@ -115,31 +114,30 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_ src/pk/dh/dh.obj src/pk/dh/dh_static.obj src/pk/dh/dh_sys.obj src/pk/dsa/dsa_decrypt_key.obj \ src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \ src/pk/dsa/dsa_import_radix.obj src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj \ -src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj \ -src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc.obj \ -src/pk/ecc/ecc_decrypt_key.obj src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj \ -src/pk/ecc/ecc_get_size.obj src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj \ -src/pk/ecc/ecc_shared_secret.obj src/pk/ecc/ecc_sign_hash.obj src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj \ -src/pk/ecc/ecc_verify_hash.obj src/pk/ecc/ltc_ecc_is_valid_idx.obj src/pk/ecc/ltc_ecc_map.obj \ -src/pk/ecc/ltc_ecc_mul2add.obj src/pk/ecc/ltc_ecc_mulmod.obj src/pk/ecc/ltc_ecc_mulmod_timing.obj \ -src/pk/ecc/ltc_ecc_points.obj src/pk/ecc/ltc_ecc_projective_add_point.obj \ -src/pk/ecc/ltc_ecc_projective_dbl_point.obj src/pk/katja/katja_decrypt_key.obj \ -src/pk/katja/katja_encrypt_key.obj src/pk/katja/katja_export.obj src/pk/katja/katja_exptmod.obj \ -src/pk/katja/katja_free.obj src/pk/katja/katja_import.obj src/pk/katja/katja_make_key.obj \ -src/pk/pkcs1/pkcs_1_i2osp.obj src/pk/pkcs1/pkcs_1_mgf1.obj src/pk/pkcs1/pkcs_1_oaep_decode.obj \ -src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/pkcs1/pkcs_1_os2ip.obj src/pk/pkcs1/pkcs_1_pss_decode.obj \ -src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj src/pk/pkcs1/pkcs_1_v1_5_encode.obj \ -src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj src/pk/rsa/rsa_export.obj \ -src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj src/pk/rsa/rsa_import.obj \ -src/pk/rsa/rsa_import_radix.obj src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj \ -src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj src/prngs/rc4.obj \ -src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ -src/prngs/yarrow.obj +src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ +src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ +src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ +src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ +src/pk/ecc/ecc_sign_hash.obj src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \ +src/pk/ecc/ltc_ecc_is_valid_idx.obj src/pk/ecc/ltc_ecc_map.obj src/pk/ecc/ltc_ecc_mul2add.obj \ +src/pk/ecc/ltc_ecc_mulmod.obj src/pk/ecc/ltc_ecc_mulmod_timing.obj src/pk/ecc/ltc_ecc_points.obj \ +src/pk/ecc/ltc_ecc_projective_add_point.obj src/pk/ecc/ltc_ecc_projective_dbl_point.obj \ +src/pk/katja/katja_decrypt_key.obj src/pk/katja/katja_encrypt_key.obj src/pk/katja/katja_export.obj \ +src/pk/katja/katja_exptmod.obj src/pk/katja/katja_free.obj src/pk/katja/katja_import.obj \ +src/pk/katja/katja_make_key.obj src/pk/pkcs1/pkcs_1_i2osp.obj src/pk/pkcs1/pkcs_1_mgf1.obj \ +src/pk/pkcs1/pkcs_1_oaep_decode.obj src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/pkcs1/pkcs_1_os2ip.obj \ +src/pk/pkcs1/pkcs_1_pss_decode.obj src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj \ +src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj \ +src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj \ +src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_radix.obj src/pk/rsa/rsa_make_key.obj \ +src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj \ +src/prngs/fortuna.obj src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj \ +src/prngs/sober128.obj src/prngs/sprng.obj src/prngs/yarrow.obj -HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.shared b/makefile.shared index bcc692b4e..3d4fa5973 100644 --- a/makefile.shared +++ b/makefile.shared @@ -34,7 +34,7 @@ endif #List of objects to compile. #START_INS -OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ +OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ @@ -43,30 +43,29 @@ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_i src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ -src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -79,11 +78,11 @@ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_t src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -92,8 +91,8 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ -src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ @@ -145,31 +144,30 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ -src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ -src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ -src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ -src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ -src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ -src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ -src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ -src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ -src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ -src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ -src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ -src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ -src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o - -HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ +src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ +src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ +src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ +src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ +src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ +src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ +src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ +src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ +src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ +src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ +src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ +src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ +src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o + +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/makefile.unix b/makefile.unix index 7eec9cd89..ff5880159 100644 --- a/makefile.unix +++ b/makefile.unix @@ -40,7 +40,7 @@ GROUP=wheel #List of objects to compile. #START_INS -OBJECTS=src/ciphers/aes/aes_enc.o src/ciphers/aes/aes.o src/ciphers/anubis.o src/ciphers/blowfish.o \ +OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ @@ -49,30 +49,29 @@ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_i src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o src/encauth/ocb3/ocb3_encrypt.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o src/encauth/ocb/ocb_shift_xor.o \ -src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o src/hashes/chc/chc.o \ -src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512_224.o \ -src/hashes/sha2/sha512_256.o src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o \ -src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o \ -src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o \ -src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ +src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ +src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ +src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ +src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ +src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ +src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ +src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ @@ -85,11 +84,11 @@ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_t src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ @@ -98,8 +97,8 @@ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ -src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ @@ -151,31 +150,30 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o \ -src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o \ -src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o \ -src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o \ -src/pk/ecc/ltc_ecc_mul2add.o src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o \ -src/pk/ecc/ltc_ecc_points.o src/pk/ecc/ltc_ecc_projective_add_point.o \ -src/pk/ecc/ltc_ecc_projective_dbl_point.o src/pk/katja/katja_decrypt_key.o \ -src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o src/pk/katja/katja_exptmod.o \ -src/pk/katja/katja_free.o src/pk/katja/katja_import.o src/pk/katja/katja_make_key.o \ -src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \ -src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \ -src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o src/pk/pkcs1/pkcs_1_v1_5_encode.o \ -src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o \ -src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o src/pk/rsa/rsa_import.o \ -src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ -src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ +src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ +src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ +src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ +src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ +src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ +src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ +src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ +src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ +src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ +src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ +src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ +src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ +src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o -HEADERS=src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_cipher.h \ -src/headers/tomcrypt_custom.h src/headers/tomcrypt.h src/headers/tomcrypt_hash.h \ +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_pk.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS diff --git a/parsenames.pl b/parsenames.pl deleted file mode 100755 index 66160297d..000000000 --- a/parsenames.pl +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/perl -# -# Splits the list of files and outputs for makefile type files -# wrapped at 80 chars -# -# Tom St Denis -use strict; -use warnings; - -my @a = split ' ', $ARGV[1]; -my $b = $ARGV[0] . '='; -my $len = length $b; -print $b; -foreach my $obj (sort @a) { - $len = $len + length $obj; - $obj =~ s/\*/\$/; - if ($len > 100) { - print "\\\n"; - $len = length $obj; - } - print $obj . ' '; -} -if ($ARGV[0] eq 'HEADERS') { - print 'testprof/tomcrypt_test.h'; -} - -print "\n\n"; - -# $Source$ -# $Revision$ -# $Date$ diff --git a/updatemakes.sh b/updatemakes.sh index b5d24e40c..6ecd60573 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -1,26 +1,5 @@ #!/bin/bash -makefiles=(makefile makefile.icc makefile.shared makefile.unix makefile.mingw) +./helper.pl --update-makefiles || exit 1 -function update_makefile() { - perl filter.pl $1 tmplist - sed -e 's/ *$//' < tmp.delme > $1 - rm -f tmp.delme -} - -bash genlist.sh > tmplist - -for i in "${makefiles[@]}" -do - update_makefile "$i" -done - -perl filter.pl makefile.msvc tmplist -sed -e 's/\.o /.obj /g' -e 's/ *$//' < tmp.delme > makefile.msvc -rm -f tmp.delme - -rm -f tmplist - -if [ $# -eq 1 ] && [ "$1" == "-c" ]; then - git add ${makefiles[@]} makefile.msvc && git commit -m 'Update makefiles' -fi +exit 0 \ No newline at end of file From 58375b0287ac32804aba890997326bf744f7072a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 6 Mar 2017 20:10:43 +0100 Subject: [PATCH 0505/1192] updatemakes.sh now updates MS Visual C++ projects as well --- helper.pl | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/helper.pl b/helper.pl index 680a69bb5..c0f7d1f01 100755 --- a/helper.pl +++ b/helper.pl @@ -70,6 +70,76 @@ sub prepare_variable { return $output; } +sub prepare_msvc_files_xml { + my ($all, $exclude_re, $targets) = @_; + my $last = []; + my $depth = 2; + my $files = "\r\n"; + for my $full (@$all) { + my @items = split /\//, $full; # split by '/' + $full =~ s|/|\\|g; # replace '/' bt '\' + #XXXXXXXXXXXXX + shift @items; + pop @items; # drop last one + my $current = \@items; + if (join(':', @$current) ne join(':', @$last)) { + my $common = 0; + $common++ while ($last->[$common] && $current->[$common] && $last->[$common] eq $current->[$common]); + my $back = @$last - $common; + if ($back > 0) { + $files .= ("\t" x --$depth) . "\r\n" for (1..$back); + } + my $fwd = [ @$current ]; splice(@$fwd, 0, $common); + for my $i (0..scalar(@$fwd) - 1) { + $files .= ("\t" x $depth) . "[$i]\"\r\n"; + $files .= ("\t" x $depth) . "\t>\r\n"; + $depth++; + } + $last = $current; + } + $files .= ("\t" x $depth) . "\r\n"; + if ($full =~ $exclude_re) { + for (@$targets) { + $files .= ("\t" x $depth) . "\t\r\n"; + $files .= ("\t" x $depth) . "\t\t\r\n"; + $files .= ("\t" x $depth) . "\t\r\n"; + } + } + if ($full eq 'src\ciphers\aes\aes.c') { #hack + my %cmd = ( + 'Debug|Win32' => [ 'Debug/aes.obj;Debug/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c $(InputPath) cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/aes_enc.obj" /Fd"Debug/" /FD /GZ /c $(InputPath) ' ], + 'Release|Win32' => [ 'Release/aes.obj;Release/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/" /Fd"Release/" /FD /GZ /c $(InputPath) cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/aes_enc.obj" /Fd"Release/" /FD /GZ /c $(InputPath) ' ], + ); + for (@$targets) { + next unless $cmd{$_}; + $files .= ("\t" x $depth) . "\t\r\n"; + $files .= ("\t" x $depth) . "\t\t\r\n"; + $files .= ("\t" x $depth) . "\t\r\n"; + } + } + $files .= ("\t" x $depth) . "\r\n"; + } + $files .= ("\t" x --$depth) . "\r\n" for (@$last); + $files .= "\t"; + return $files; +} + sub patch_makefile { my ($in_ref, $out_ref, $data) = @_; open(my $src, '<', $in_ref); @@ -93,18 +163,32 @@ sub patch_makefile { sub process_makefiles { my $write = shift; + my $changed_count = 0; my @c = (); find({ no_chdir => 1, wanted => sub { push @c, $_ if -f $_ && $_ =~ /\.c$/ && $_ !~ /tab.c$/ } }, 'src'); my @h = (); find({ no_chdir => 1, wanted => sub { push @h, $_ if -f $_ && $_ =~ /\.h$/ && $_ !~ /dh_static.h$/ } }, 'src'); + my @all = (); + find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src'); my @o = sort ('src/ciphers/aes/aes_enc.o', map { $_ =~ s/\.c$/.o/; $_ } @c); my $var_o = prepare_variable("OBJECTS", @o); (my $var_obj = $var_o) =~ s/\.o\b/.obj/sg; my $var_h = prepare_variable("HEADERS", (sort @h, 'testprof/tomcrypt_test.h')); + my $msvc_files = prepare_msvc_files_xml(\@all, qr/tab\.c$/, ['Debug|Win32', 'Release|Win32']); + for my $m (qw/libtomcrypt_VS2008.vcproj libtomcrypt_VS2005.vcproj/) { + my $old = read_file($m); + my $new = $old; + $new =~ s|.*|$msvc_files|s; + if ($old ne $new) { + write_file($m, $new) if $write; + warn "changed: $m\n"; + $changed_count++; + } + } + my @makefiles = qw( makefile makefile.icc makefile.shared makefile.unix makefile.mingw makefile.msvc ); - my $changed_count = 0; for my $m (@makefiles) { my $old = read_file($m); my $new; From 2711e40309f3c61e323d491875557e826b67635d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 6 Mar 2017 20:11:21 +0100 Subject: [PATCH 0506/1192] updatet MSVC projects --- libtomcrypt_VS2005.vcproj | 5916 ++--------------------------------- libtomcrypt_VS2008.vcproj | 6100 +++---------------------------------- 2 files changed, 713 insertions(+), 11303 deletions(-) diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index 9eeb4f888..89c3dc42d 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -173,310 +173,62 @@ - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2729,112 +959,26 @@ - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + + - - - - - - + + - - - - - - + + - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - + + @@ -3614,134 +1182,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4756,112 +1424,22 @@ - - - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + - - - - - - @@ -7123,112 +1955,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 3e1e8516c..137dd0175 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -175,314 +175,62 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - @@ -2739,112 +961,26 @@ - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - @@ -2877,143 +995,43 @@ Name="misc" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - + + @@ -3606,134 +1184,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4748,76 +1426,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + RelativePath="src\pk\ecc\ecc_ansi_x963_import.c" + > + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + RelativePath="src\pk\katja\katja_make_key.c" + > + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - @@ -7015,112 +1957,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 8c831e1e3097f6e9ae48180033305a546ea03e23 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 7 Mar 2017 19:59:38 +0100 Subject: [PATCH 0507/1192] no aes_enc on ms windows --- helper.pl | 18 ------------------ libtomcrypt_VS2005.vcproj | 18 ------------------ libtomcrypt_VS2008.vcproj | 18 ------------------ 3 files changed, 54 deletions(-) diff --git a/helper.pl b/helper.pl index c0f7d1f01..a1d8c3752 100755 --- a/helper.pl +++ b/helper.pl @@ -115,24 +115,6 @@ sub prepare_msvc_files_xml { $files .= ("\t" x $depth) . "\t\r\n"; } } - if ($full eq 'src\ciphers\aes\aes.c') { #hack - my %cmd = ( - 'Debug|Win32' => [ 'Debug/aes.obj;Debug/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c $(InputPath) cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/aes_enc.obj" /Fd"Debug/" /FD /GZ /c $(InputPath) ' ], - 'Release|Win32' => [ 'Release/aes.obj;Release/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/" /Fd"Release/" /FD /GZ /c $(InputPath) cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/aes_enc.obj" /Fd"Release/" /FD /GZ /c $(InputPath) ' ], - ); - for (@$targets) { - next unless $cmd{$_}; - $files .= ("\t" x $depth) . "\t\r\n"; - $files .= ("\t" x $depth) . "\t\t\r\n"; - $files .= ("\t" x $depth) . "\t\r\n"; - } - } $files .= ("\t" x $depth) . "\r\n"; } $files .= ("\t" x --$depth) . "\r\n" for (@$last); diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index 89c3dc42d..57281459e 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -236,24 +236,6 @@ - - - - - - - - - - - - Date: Tue, 7 Mar 2017 23:56:29 +0100 Subject: [PATCH 0508/1192] ordering file list whe generating msvc.proj --- helper.pl | 7 +- libtomcrypt_VS2005.vcproj | 214 +++++++++++++++++++------------------- libtomcrypt_VS2008.vcproj | 214 +++++++++++++++++++------------------- 3 files changed, 217 insertions(+), 218 deletions(-) diff --git a/helper.pl b/helper.pl index a1d8c3752..58cd71e64 100755 --- a/helper.pl +++ b/helper.pl @@ -75,12 +75,11 @@ sub prepare_msvc_files_xml { my $last = []; my $depth = 2; my $files = "\r\n"; - for my $full (@$all) { + for my $full (sort @$all) { my @items = split /\//, $full; # split by '/' $full =~ s|/|\\|g; # replace '/' bt '\' - #XXXXXXXXXXXXX - shift @items; - pop @items; # drop last one + shift @items; # drop first one (src) + pop @items; # drop last one (filename.ext) my $current = \@items; if (join(':', @$current) ne join(':', @$last)) { my $common = 0; diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index 57281459e..b4e38051f 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -170,6 +170,38 @@ + + + + + + + + + + + + @@ -222,23 +254,15 @@ RelativePath="src\ciphers\rc6.c" > - - - - - - - - - - - - - - - - + + @@ -330,6 +326,10 @@ + + + + + + + + + + + + + + + + @@ -598,38 +626,6 @@ RelativePath="src\hashes\sha1.c" > - - - - - - - - - - - - - - - - @@ -658,6 +654,10 @@ > + + @@ -938,6 +938,14 @@ + + + + @@ -962,14 +970,6 @@ RelativePath="src\math\tfm_desc.c" > - - - - - - - - - - - - - - - - @@ -1014,6 +990,14 @@ > + + + + @@ -1126,6 +1110,10 @@ > + + @@ -1138,6 +1126,14 @@ > + + + + @@ -1154,6 +1150,10 @@ > + + + + + + + + + + + + + + @@ -224,23 +256,15 @@ RelativePath="src\ciphers\rc6.c" > - - - - - - - - - - - - - - - - + + @@ -332,6 +328,10 @@ + + + + + + + + + + + + + + + + @@ -600,38 +628,6 @@ RelativePath="src\hashes\sha1.c" > - - - - - - - - - - - - - - - - @@ -660,6 +656,10 @@ > + + @@ -940,6 +940,14 @@ + + + + @@ -964,14 +972,6 @@ RelativePath="src\math\tfm_desc.c" > - - - - - - - - - - - - - - - - @@ -1016,6 +992,14 @@ > + + + + @@ -1128,6 +1112,10 @@ > + + @@ -1140,6 +1128,14 @@ > + + + + @@ -1156,6 +1152,10 @@ > + + Date: Wed, 8 Mar 2017 00:25:23 +0100 Subject: [PATCH 0509/1192] msvc sorting hack --- helper.pl | 15 ++- libtomcrypt_VS2005.vcproj | 208 ++++++++++++++++++------------------- libtomcrypt_VS2008.vcproj | 212 +++++++++++++++++++------------------- 3 files changed, 224 insertions(+), 211 deletions(-) diff --git a/helper.pl b/helper.pl index 58cd71e64..c3ecfcbac 100755 --- a/helper.pl +++ b/helper.pl @@ -74,8 +74,21 @@ sub prepare_msvc_files_xml { my ($all, $exclude_re, $targets) = @_; my $last = []; my $depth = 2; + + # sort files in the same order as visual studio (ugly, I know) + my @parts = (); + for my $orig (@$all) { + my $p = $orig; + $p =~ s|/|/~|g; + $p =~ s|/~([^/]+)$|/$1|g; + # now we have: 'src/pk/rsa/rsa_verify_hash.c' > 'src/~pk/~rsa/rsa_verify_hash.c' + my @l = map { sprintf "% -99s", $_ } split /\//, $p; + push @parts, [ $orig, join(':', @l) ]; + } + my @sorted = map { $_->[0] } sort { $a->[1] cmp $b->[1] } @parts; + my $files = "\r\n"; - for my $full (sort @$all) { + for my $full (@sorted) { my @items = split /\//, $full; # split by '/' $full =~ s|/|\\|g; # replace '/' bt '\' shift @items; # drop first one (src) diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index b4e38051f..05649eba5 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -170,38 +170,6 @@ - - - - - - - - - - - - @@ -254,6 +222,46 @@ RelativePath="src\ciphers\rc6.c" > + + + + + + + + + + + + + + + + @@ -290,10 +298,6 @@ > - - @@ -326,10 +330,6 @@ - - - - - - - - - - - - - - - - @@ -626,6 +598,38 @@ RelativePath="src\hashes\sha1.c" > + + + + + + + + + + + + + + + + @@ -654,10 +658,6 @@ > - - @@ -938,14 +938,6 @@ - - - - @@ -970,6 +962,14 @@ RelativePath="src\math\tfm_desc.c" > + + + + + + + + + + + + + + + + @@ -990,14 +1014,6 @@ > - - - - @@ -1110,10 +1126,6 @@ > - - @@ -1126,14 +1138,6 @@ > - - - - @@ -1150,10 +1154,6 @@ > - - - - - - - - - - - - - - @@ -256,6 +224,46 @@ RelativePath="src\ciphers\rc6.c" > + + + + + + + + + + + + + + + + @@ -292,10 +300,6 @@ > - - @@ -328,10 +332,6 @@ - - - - - - - - - - - - - - - - @@ -628,6 +600,38 @@ RelativePath="src\hashes\sha1.c" > + + + + + + + + + + + + + + + + @@ -656,10 +660,6 @@ > - - @@ -940,14 +940,6 @@ - - - - @@ -972,6 +964,14 @@ RelativePath="src\math\tfm_desc.c" > + + + + + + + + + + + + + + + + @@ -992,14 +1016,6 @@ > - - - - @@ -1112,10 +1128,6 @@ > - - @@ -1128,14 +1140,6 @@ > - - - - @@ -1152,10 +1156,6 @@ > - - Date: Thu, 9 Mar 2017 20:17:40 +0100 Subject: [PATCH 0510/1192] comment with aes_enc "hack" (but still disabled for MS Win *.vcproj builds) --- helper.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/helper.pl b/helper.pl index c3ecfcbac..18b12ff07 100755 --- a/helper.pl +++ b/helper.pl @@ -127,6 +127,25 @@ sub prepare_msvc_files_xml { $files .= ("\t" x $depth) . "\t\r\n"; } } +########### aes_enc "hack" disabled - discussion: https://github.com/libtom/libtomcrypt/pull/158 +# if ($full eq 'src\ciphers\aes\aes.c') { #hack +# my %cmd = ( +# 'Debug|Win32' => [ 'Debug/aes.obj;Debug/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c $(InputPath) cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/aes_enc.obj" /Fd"Debug/" /FD /GZ /c $(InputPath) ' ], +# 'Release|Win32' => [ 'Release/aes.obj;Release/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/" /Fd"Release/" /FD /GZ /c $(InputPath) cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/aes_enc.obj" /Fd"Release/" /FD /GZ /c $(InputPath) ' ], +# ); +# for (@$targets) { +# next unless $cmd{$_}; +# $files .= ("\t" x $depth) . "\t\r\n"; +# $files .= ("\t" x $depth) . "\t\t\r\n"; +# $files .= ("\t" x $depth) . "\t\r\n"; +# } +# } $files .= ("\t" x $depth) . "\r\n"; } $files .= ("\t" x --$depth) . "\r\n" for (@$last); From 84f2557cc29bd51c1eeca0977c043aa674cb9cc1 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 9 Mar 2017 20:18:46 +0100 Subject: [PATCH 0511/1192] updatemakes.sh newline at end of file --- updatemakes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatemakes.sh b/updatemakes.sh index 6ecd60573..c5e622983 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -2,4 +2,4 @@ ./helper.pl --update-makefiles || exit 1 -exit 0 \ No newline at end of file +exit 0 From a4d61e0beadcae6ebe324f4363f1af5b2473a01b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Feb 2017 20:29:13 +0100 Subject: [PATCH 0512/1192] fixes #122 adler32 vs. crc32 inconsistency (bad byte order) --- src/misc/crc32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/crc32.c b/src/misc/crc32.c index 1099af2ae..4045af503 100644 --- a/src/misc/crc32.c +++ b/src/misc/crc32.c @@ -175,7 +175,7 @@ void crc32_finish(crc32_state *ctx, void *hash, unsigned long size) if (size > 4) size = 4; for (i = 0; i < size; i++) { - h[i] = ((unsigned char*)&(crc))[i]; + h[i] = ((unsigned char*)&(crc))[size-i-1]; } } @@ -185,7 +185,7 @@ int crc32_test(void) return CRYPT_NOP; #else const void* in = "libtomcrypt"; - const unsigned char crc32[] = { 0xef, 0x76, 0x73, 0xb3 }; + const unsigned char crc32[] = { 0xb3, 0x73, 0x76, 0xef }; unsigned char out[4]; crc32_state ctx; crc32_init(&ctx); From 2f9c4264875f95f69d26ea3fbfb300738f6397f0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 6 Mar 2017 12:17:27 +0100 Subject: [PATCH 0513/1192] fix wchar_t related warnings on Visual Studio 2008 --- src/pk/asn1/der/utf8/der_encode_utf8_string.c | 2 ++ src/pk/asn1/der/utf8/der_length_utf8_string.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pk/asn1/der/utf8/der_encode_utf8_string.c b/src/pk/asn1/der/utf8/der_encode_utf8_string.c index ab7ab5432..ca4bfce5d 100644 --- a/src/pk/asn1/der/utf8/der_encode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_encode_utf8_string.c @@ -87,7 +87,9 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, case 1: out[x++] = (unsigned char)in[y]; break; case 2: out[x++] = 0xC0 | ((in[y] >> 6) & 0x1F); out[x++] = 0x80 | (in[y] & 0x3F); break; case 3: out[x++] = 0xE0 | ((in[y] >> 12) & 0x0F); out[x++] = 0x80 | ((in[y] >> 6) & 0x3F); out[x++] = 0x80 | (in[y] & 0x3F); break; +#if !defined(__WCHAR_MAX__) && !defined(WCHAR_MAX) || __WCHAR_MAX__ > 0xFFFF || WCHAR_MAX > 0xFFFF case 4: out[x++] = 0xF0 | ((in[y] >> 18) & 0x07); out[x++] = 0x80 | ((in[y] >> 12) & 0x3F); out[x++] = 0x80 | ((in[y] >> 6) & 0x3F); out[x++] = 0x80 | (in[y] & 0x3F); break; +#endif } } diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index 7d0f60c61..85eec06d9 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -27,7 +27,7 @@ unsigned long der_utf8_charsize(const wchar_t c) return 1; } else if (c <= 0x7FF) { return 2; -#if __WCHAR_MAX__ == 0xFFFF +#if __WCHAR_MAX__ == 0xFFFF || WCHAR_MAX == 0xFFFF } else { return 3; } @@ -48,10 +48,10 @@ unsigned long der_utf8_charsize(const wchar_t c) int der_utf8_valid_char(const wchar_t c) { LTC_UNUSED_PARAM(c); -#if !defined(__WCHAR_MAX__) || __WCHAR_MAX__ > 0xFFFF +#if !defined(__WCHAR_MAX__) && !defined(WCHAR_MAX) || __WCHAR_MAX__ > 0xFFFF || WCHAR_MAX > 0xFFFF if (c > 0x10FFFF) return 0; #endif -#if !defined(__WCHAR_MAX__) || __WCHAR_MAX__ != 0xFFFF && __WCHAR_MAX__ != 0xFFFFFFFF +#if !defined(__WCHAR_MAX__) && !defined(WCHAR_MAX) || __WCHAR_MAX__ != 0xFFFF && __WCHAR_MAX__ != 0xFFFFFFFF && WCHAR_MAX != 0xFFFF && WCHAR_MAX != 0xFFFFFFFF if (c < 0) return 0; #endif return 1; From 7ab76a464e5c7c499fbd0f863f866c70c8b556d5 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 9 Mar 2017 13:08:58 +0100 Subject: [PATCH 0514/1192] introducing LTC_WCHAR_MAX --- src/headers/tomcrypt_pk.h | 8 +++++++- src/pk/asn1/der/utf8/der_encode_utf8_string.c | 2 +- src/pk/asn1/der/utf8/der_length_utf8_string.c | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index aba31f89f..cae4119d1 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -612,10 +612,16 @@ int der_printable_char_encode(int c); int der_printable_value_decode(int v); /* UTF-8 */ -#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined (__WCHAR_TYPE__)) && !defined(LTC_NO_WCHAR) +#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(__WCHAR_MAX__) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined (__WCHAR_TYPE__)) && !defined(LTC_NO_WCHAR) #include +#if defined(__WCHAR_MAX__) +#define LTC_WCHAR_MAX __WCHAR_MAX__ +#elif defined(WCHAR_MAX) +#define LTC_WCHAR_MAX WCHAR_MAX +#endif #else typedef ulong32 wchar_t; +#define LTC_WCHAR_MAX 0xFFFFFFFF #endif int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, diff --git a/src/pk/asn1/der/utf8/der_encode_utf8_string.c b/src/pk/asn1/der/utf8/der_encode_utf8_string.c index ca4bfce5d..ef0e6eba7 100644 --- a/src/pk/asn1/der/utf8/der_encode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_encode_utf8_string.c @@ -87,7 +87,7 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, case 1: out[x++] = (unsigned char)in[y]; break; case 2: out[x++] = 0xC0 | ((in[y] >> 6) & 0x1F); out[x++] = 0x80 | (in[y] & 0x3F); break; case 3: out[x++] = 0xE0 | ((in[y] >> 12) & 0x0F); out[x++] = 0x80 | ((in[y] >> 6) & 0x3F); out[x++] = 0x80 | (in[y] & 0x3F); break; -#if !defined(__WCHAR_MAX__) && !defined(WCHAR_MAX) || __WCHAR_MAX__ > 0xFFFF || WCHAR_MAX > 0xFFFF +#if !defined(LTC_WCHAR_MAX) || LTC_WCHAR_MAX > 0xFFFF case 4: out[x++] = 0xF0 | ((in[y] >> 18) & 0x07); out[x++] = 0x80 | ((in[y] >> 12) & 0x3F); out[x++] = 0x80 | ((in[y] >> 6) & 0x3F); out[x++] = 0x80 | (in[y] & 0x3F); break; #endif } diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index 85eec06d9..4cbd27dad 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -27,7 +27,7 @@ unsigned long der_utf8_charsize(const wchar_t c) return 1; } else if (c <= 0x7FF) { return 2; -#if __WCHAR_MAX__ == 0xFFFF || WCHAR_MAX == 0xFFFF +#if LTC_WCHAR_MAX == 0xFFFF } else { return 3; } @@ -48,10 +48,10 @@ unsigned long der_utf8_charsize(const wchar_t c) int der_utf8_valid_char(const wchar_t c) { LTC_UNUSED_PARAM(c); -#if !defined(__WCHAR_MAX__) && !defined(WCHAR_MAX) || __WCHAR_MAX__ > 0xFFFF || WCHAR_MAX > 0xFFFF +#if !defined(LTC_WCHAR_MAX) || LTC_WCHAR_MAX > 0xFFFF if (c > 0x10FFFF) return 0; #endif -#if !defined(__WCHAR_MAX__) && !defined(WCHAR_MAX) || __WCHAR_MAX__ != 0xFFFF && __WCHAR_MAX__ != 0xFFFFFFFF && WCHAR_MAX != 0xFFFF && WCHAR_MAX != 0xFFFFFFFF +#if !defined(LTC_WCHAR_MAX) || LTC_WCHAR_MAX != 0xFFFF && LTC_WCHAR_MAX != 0xFFFFFFFF if (c < 0) return 0; #endif return 1; From 02b92405e28be8c91544ff6e347cf3f8884318cc Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 9 Mar 2017 17:40:12 +0100 Subject: [PATCH 0515/1192] simplified #ifdef --- src/pk/asn1/der/utf8/der_length_utf8_string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index 4cbd27dad..2bab44559 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -51,7 +51,7 @@ int der_utf8_valid_char(const wchar_t c) #if !defined(LTC_WCHAR_MAX) || LTC_WCHAR_MAX > 0xFFFF if (c > 0x10FFFF) return 0; #endif -#if !defined(LTC_WCHAR_MAX) || LTC_WCHAR_MAX != 0xFFFF && LTC_WCHAR_MAX != 0xFFFFFFFF +#if LTC_WCHAR_MAX != 0xFFFF && LTC_WCHAR_MAX != 0xFFFFFFFF if (c < 0) return 0; #endif return 1; From 591ef19c7a02dbb578a718d6f4c85cd8311a8ebd Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 9 Mar 2017 20:05:50 +0100 Subject: [PATCH 0516/1192] comment: it might happen that LTC_WCHAR_MAX is undefined --- src/headers/tomcrypt_pk.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index cae4119d1..ad5efc03a 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -619,6 +619,7 @@ int der_printable_value_decode(int v); #elif defined(WCHAR_MAX) #define LTC_WCHAR_MAX WCHAR_MAX #endif +/* please note that it might happen that LTC_WCHAR_MAX is undefined */ #else typedef ulong32 wchar_t; #define LTC_WCHAR_MAX 0xFFFFFFFF From e26078d2f73f5631b98d4efafa2630004f6d0ad9 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 23 Feb 2017 15:44:43 +0100 Subject: [PATCH 0517/1192] fix #109 - improved arch/endianness detection + tomcrypt_cfg.h facelift --- src/headers/tomcrypt_cfg.h | 180 ++++++++++++++++++++++++---------- src/headers/tomcrypt_macros.h | 6 +- src/misc/crc32.c | 12 +-- src/misc/crypt/crypt.c | 9 +- 4 files changed, 139 insertions(+), 68 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index b0094294c..ccfb78bec 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -8,15 +8,13 @@ #define TOMCRYPT_CFG_H #if defined(_WIN32) || defined(_MSC_VER) -#define LTC_CALL __cdecl -#else -#ifndef LTC_CALL + #define LTC_CALL __cdecl +#elif !defined(LTC_CALL) #define LTC_CALL #endif -#endif #ifndef LTC_EXPORT -#define LTC_EXPORT + #define LTC_EXPORT #endif /* certain platforms use macros for these, making the prototypes broken */ @@ -63,35 +61,122 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); * The x86 platforms allow this but some others [ARM for instance] do not. On those platforms you **MUST** * use the portable [slower] macros. */ +/* detect x86/i386 32bit */ +#if defined(__i386__) || defined(__i386) || defined(_M_IX86) + #define ENDIAN_LITTLE + #define ENDIAN_32BITWORD + #define LTC_FAST +#endif -/* detect x86-32 machines somewhat */ -#if !defined(__STRICT_ANSI__) && !defined(__x86_64__) && !defined(_WIN64) && ((defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) +/* detect amd64/x64 */ +#if defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) #define ENDIAN_LITTLE + #define ENDIAN_64BITWORD + #define LTC_FAST +#endif + +/* detect PPC32 */ +#if defined(LTC_PPC32) + #define ENDIAN_BIG #define ENDIAN_32BITWORD #define LTC_FAST #endif /* detects MIPS R5900 processors (PS2) */ #if (defined(__R5900) || defined(R5900) || defined(__R5900__)) && (defined(_mips) || defined(__mips__) || defined(mips)) - #define ENDIAN_LITTLE #define ENDIAN_64BITWORD + #if defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) + #define ENDIAN_BIG + #endif + #define ENDIAN_LITTLE + #endif #endif -/* detect amd64 */ -#if !defined(__STRICT_ANSI__) && defined(__x86_64__) - #define ENDIAN_LITTLE +/* detect AIX */ +#if defined(_AIX) && defined(_BIG_ENDIAN) + #define ENDIAN_BIG + #if defined(__LP64__) || defined(_ARCH_PPC64) + #define ENDIAN_64BITWORD + #else + #define ENDIAN_32BITWORD + #endif +#endif + +/* detect HP-UX */ +#if defined(__hpux) || defined(__hpux__) + #define ENDIAN_BIG + #if defined(__ia64) || defined(__ia64__) || defined(__LP64__) + #define ENDIAN_64BITWORD + #else + #define ENDIAN_32BITWORD + #endif +#endif + +/* detect Apple OS X */ +#if defined(__APPLE__) && defined(__MACH__) + #if defined(__LITTLE_ENDIAN__) || defined(__x86_64__) + #define ENDIAN_LITTLE + #else + #define ENDIAN_BIG + #endif + #if defined(__LP64__) || defined(__x86_64__) + #define ENDIAN_64BITWORD + #else + #define ENDIAN_32BITWORD + #endif +#endif + +/* detect SPARC and SPARC64 */ +#if defined(__sparc__) || defined(__sparc) + #define ENDIAN_BIG + #if defined(__arch64__) || defined(__sparcv9) || defined(__sparc_v9__) + #define ENDIAN_64BITWORD + #else + #define ENDIAN_32BITWORD + #endif +#endif + +/* detect IBM S390(x) */ +#if defined(__s390x__) || defined(__s390__) + #define ENDIAN_BIG + #if defined(__s390x__) + #define ENDIAN_64BITWORD + #else + #define ENDIAN_32BITWORD + #endif +#endif + +/* detect PPC64 */ +#if defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) #define ENDIAN_64BITWORD + #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + #define ENDIAN_BIG + #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + #define ENDIAN_LITTLE + #endif #define LTC_FAST #endif -/* detect PPC32 */ -#if !defined(__STRICT_ANSI__) && defined(LTC_PPC32) - #define ENDIAN_BIG - #define ENDIAN_32BITWORD - #define LTC_FAST +/* endianness fallback */ +#if !defined(ENDIAN_BIG) && !defined(ENDIAN_LITTLE) + #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \ + defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || \ + defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN) || \ + defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ + defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) + #define ENDIAN_BIG + #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \ + defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || \ + defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN) || \ + defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \ + defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) + #define ENDIAN_LITTLE + #else + #error Cannot detect endianness + #endif #endif -/* fix for MSVC ...evil! */ +/* ulong64: 64-bit data type */ #ifdef _MSC_VER #define CONST64(n) n ## ui64 typedef unsigned __int64 ulong64; @@ -100,40 +185,36 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); typedef unsigned long long ulong64; #endif -/* this is the "32-bit at least" data type - * Re-define it to suit your platform but it must be at least 32-bits - */ -#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) +/* ulong32: "32-bit at least" data type */ +#if defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) || \ + defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || \ + defined(__s390x__) || defined(__arch64__) || defined(__aarch64__) || \ + defined(__sparcv9) || defined(__sparc_v9__) || defined(__sparc64__) || \ + defined(__ia64) || defined(__ia64__) || defined(__itanium__) || defined(_M_IA64) || \ + defined(__LP64__) || defined(_LP64) || defined(__64BIT__) typedef unsigned ulong32; + #if !defined(ENDIAN_64BITWORD) && !defined(ENDIAN_32BITWORD) + #define ENDIAN_64BITWORD + #endif #else typedef unsigned long ulong32; + #if !defined(ENDIAN_64BITWORD) && !defined(ENDIAN_32BITWORD) + #define ENDIAN_32BITWORD + #endif #endif -#ifdef LTC_NO_FAST +/* No LTC_FAST if: explicitly disabled OR non-gcc/non-clang compiler OR old gcc OR using -ansi -std=c99 */ +#if defined(LTC_NO_FAST) || (__GNUC__ < 4) || defined(__STRICT_ANSI__) #undef LTC_FAST #endif #ifdef LTC_FAST -#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc nor icc */ -#error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway -#else -#ifdef ENDIAN_64BITWORD -typedef ulong64 __attribute__((__may_alias__)) LTC_FAST_TYPE; -#else -typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; -#endif -#define LTC_FAST_TYPE_PTR_CAST(x) ((LTC_FAST_TYPE*)(void*)(x)) -#endif -#endif /* LTC_FAST */ - -/* detect sparc and sparc64 */ -#if defined(__sparc__) - #define ENDIAN_BIG - #if defined(__arch64__) - #define ENDIAN_64BITWORD - #else - #define ENDIAN_32BITWORD - #endif + #define LTC_FAST_TYPE_PTR_CAST(x) ((LTC_FAST_TYPE*)(void*)(x)) + #ifdef ENDIAN_64BITWORD + typedef ulong64 __attribute__((__may_alias__)) LTC_FAST_TYPE; + #else + typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; + #endif #endif #ifdef ENDIAN_64BITWORD @@ -144,8 +225,7 @@ typedef ulong32 ltc_mp_digit; /* No asm is a quick way to disable anything "not portable" */ #ifdef LTC_NO_ASM - #undef ENDIAN_LITTLE - #undef ENDIAN_BIG + #define ENDIAN_NEUTRAL #undef ENDIAN_32BITWORD #undef ENDIAN_64BITWORD #undef LTC_FAST @@ -154,13 +234,7 @@ typedef ulong32 ltc_mp_digit; #define LTC_NO_BSWAP #endif -/* #define ENDIAN_LITTLE */ -/* #define ENDIAN_BIG */ - -/* #define ENDIAN_32BITWORD */ -/* #define ENDIAN_64BITWORD */ - -#if (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD)) +#if !defined(ENDIAN_NEUTRAL) && (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD)) #error You must specify a word size as well as endianess in tomcrypt_cfg.h #endif @@ -169,7 +243,7 @@ typedef ulong32 ltc_mp_digit; #endif #if (defined(ENDIAN_32BITWORD) && defined(ENDIAN_64BITWORD)) - #error Can not be 32 and 64 bit words... + #error Cannot be 32 and 64 bit words... #endif /* gcc 4.3 and up has a bswap builtin; detect it by gcc version. @@ -188,8 +262,6 @@ typedef ulong32 ltc_mp_digit; #define LTC_HAVE_BSWAP_BUILTIN #endif -#endif - /* $Source$ */ /* $Revision$ */ diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 52ca9402a..91153f2a7 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -46,9 +46,8 @@ do { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16) | \ (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } while(0) -#endif /* ENDIAN_NEUTRAL */ -#ifdef ENDIAN_LITTLE +#elif defined(ENDIAN_LITTLE) #ifdef LTC_HAVE_BSWAP_BUILTIN @@ -167,9 +166,8 @@ do { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ #endif /* ENDIAN_64BITWORD */ -#endif /* ENDIAN_LITTLE */ +#elif defined(ENDIAN_BIG) -#ifdef ENDIAN_BIG #define STORE32L(x, y) \ do { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) diff --git a/src/misc/crc32.c b/src/misc/crc32.c index 4045af503..8228c2929 100644 --- a/src/misc/crc32.c +++ b/src/misc/crc32.c @@ -20,19 +20,20 @@ static const ulong32 _CRC32_NEGL = 0xffffffffUL; -#if defined(ENDIAN_LITTLE) || defined(ENDIAN_NEUTRAL) +#if defined(ENDIAN_LITTLE) #define CRC32_INDEX(c) (c & 0xff) #define CRC32_SHIFTED(c) (c >> 8) -#else +#elif defined(ENDIAN_BIG) #define CRC32_INDEX(c) (c >> 24) #define CRC32_SHIFTED(c) (c << 8) +#else +#error The existing CRC32 implementation only works properly when the endianness of the target platform is known. #endif - /* Table of CRC-32's of all single byte values (made by makecrc.c) */ static const ulong32 crc32_m_tab[] = { -#if defined(ENDIAN_LITTLE) || defined(ENDIAN_NEUTRAL) +#if defined(ENDIAN_LITTLE) 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, @@ -162,10 +163,9 @@ void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long le void crc32_finish(crc32_state *ctx, void *hash, unsigned long size) { - unsigned char* h; unsigned long i; + unsigned char* h; ulong32 crc; - LTC_ARGCHKVD(ctx != NULL); LTC_ARGCHKVD(hash != NULL); diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index d277901ad..7d03cfac4 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -25,8 +25,8 @@ const char *crypt_build_settings = #endif "\n\nEndianness: " #if defined(ENDIAN_NEUTRAL) - "neutral\n" -#else + "neutral/" +#endif #if defined(ENDIAN_LITTLE) "little" #elif defined(ENDIAN_BIG) @@ -34,10 +34,11 @@ const char *crypt_build_settings = #endif #if defined(ENDIAN_32BITWORD) " (32-bit words)\n" - #else + #elif defined(ENDIAN_64BITWORD) " (64-bit words)\n" + #else + " (no wordsize defined)\n" #endif -#endif "Clean stack: " #if defined(LTC_CLEAN_STACK) "enabled\n" From c7d6c3ad2827c93d87cabdb7708f7b753140e078 Mon Sep 17 00:00:00 2001 From: BJ Black Date: Wed, 2 Dec 2015 16:54:09 -0800 Subject: [PATCH 0518/1192] Add OpenSSL-compatible PKCS#5v1 KDF, demo of OpenSSL-compatible aes-256-cbc command. --- crypt.tex | 13 ++ demos/openssl-enc.c | 381 ++++++++++++++++++++++++++++++++++++ src/headers/tomcrypt_pkcs.h | 8 + src/misc/pkcs5/pkcs_5_1.c | 139 ++++++++++--- 4 files changed, 513 insertions(+), 28 deletions(-) create mode 100644 demos/openssl-enc.c diff --git a/crypt.tex b/crypt.tex index 041baac21..8ac054cdd 100644 --- a/crypt.tex +++ b/crypt.tex @@ -5070,6 +5070,8 @@ \subsection{PKCS \#5} is made up of two algorithms, Algorithm One and Algorithm Two. Algorithm One is the older fairly limited algorithm which has been implemented for completeness. Algorithm Two is a bit more modern and more flexible to work with. +The OpenSSL project implemented an extension to Algorithm One that allows for arbitrary keylengths; we have a compatible implementation described below. + \subsection{Algorithm One} Algorithm One accepts as input a password, an 8--byte salt, and an iteration counter. The iteration counter is meant to act as delay for people trying to brute force guess the password. The higher the iteration counter the longer the delay. This algorithm also requires a hash @@ -5092,6 +5094,17 @@ \subsection{Algorithm One} The output of length up to \textit{outlen} is stored in \textit{out}. If \textit{outlen} is initially larger than the size of the hash functions output it is set to the number of bytes stored. If it is smaller than not all of the hash output is stored in \textit{out}. +\index{pkcs\_5\_alg1\_openssl()} +\begin{alltt} +int pkcs_5_alg1_openssl(const unsigned char *password, + unsigned long password_len, + const unsigned char *salt, + int iteration_count, + int hash_idx, + unsigned char *out, + unsigned long *outlen) +\end{alltt} +As above, but we generate as many bytes as requested in outlen per the OpenSSL extension to Algorithm One. If you are trying to be compatible with OpenSSL's EVP\_BytesToKey() or the "openssl enc" command line (or variants such as perl's Crypt::CBC), then use this function with MD5 as your hash (ick!) and iteration\_count=1 (double-ick!!). \subsection{Algorithm Two} Algorithm Two is the recommended algorithm for this task. It allows variable length salts, and can produce outputs larger than the diff --git a/demos/openssl-enc.c b/demos/openssl-enc.c new file mode 100644 index 000000000..7d43390ad --- /dev/null +++ b/demos/openssl-enc.c @@ -0,0 +1,381 @@ +/* + * Demo to do the rough equivalent of: + * + * openssl enc -aes-256-cbc -pass pass:foobar -in infile -out outfile -p + * + * Compilation: + * + * $(CC) -I /path/to/headers -L .../libs \ + * -o openssl-enc \ + * openssl-enc.c -ltomcrypt + * + * Usage: + * + * ./openssl-enc infile outfile "passphrase" [salt] + * + * If provided, the salt must be EXACTLY a 16-char hex string. + * + * Demo is an example of: + * + * - (When decrypting) yanking salt out of the OpenSSL "Salted__..." header + * - OpenSSL-compatible key derivation (in OpenSSL's modified PKCS#5v1 approach) + * - Grabbing an Initialization Vector from the key generator + * - Performing simple block encryption using AES + * - PKCS#7-type padding (which hopefully can get ripped out of this demo and + * made a libtomcrypt thing someday). + * + * This program is free for all purposes without any express guarantee it + * works. If you really want to see a license here, assume the WTFPL :-) + * + * BJ Black, bblack@barracuda.com, https://wjblack.com + * + * BUGS: + * Passing a password on a command line is a HORRIBLE idea. Don't use + * this program for serious work! + */ + +#include + +#ifndef LTC_RIJNDAEL +#error Cannot compile this demo; Rijndael (AES) required +#endif +#ifndef LTC_CBC_MODE +#error Cannot compile this demo; CBC mode required +#endif +#ifndef LTC_PKCS_5 +#error Cannot compile this demo; PKCS5 required +#endif +#ifndef LTC_RNG_GET_BYTES +#error Cannot compile this demo; random generator required +#endif + +/* OpenSSL by default only runs one hash round */ +#define OPENSSL_ITERATIONS 1 +/* Use aes-256-cbc, so 256 bits of key, 128 of IV */ +#define KEY_LENGTH (256>>3) +#define IV_LENGTH (128>>3) +/* PKCS#5v1 requires exactly an 8-byte salt */ +#define SALT_LENGTH 8 +/* The header OpenSSL puts on an encrypted file */ +static char salt_header[] = { 'S', 'a', 'l', 't', 'e', 'd', '_', '_' }; + +#include +#include +#include + +/* A simple way to handle the possibility that a block may increase in size + after padding. */ +union paddable { + char unpad[1024]; + char pad[1024+MAXBLOCKSIZE]; +}; + +/* + * Print usage and exit with a bad status (and perror() if any errno). + * + * Input: argv[0] and the error string + * Output: + * Side Effects: print messages and barf (does exit(3)) + */ +void barf(char *pname, char *err) +{ + printf("Usage: %s infile outfile [salt]\n", pname); + printf("\n"); + printf(" # encrypts infile->outfile, random salt\n"); + printf(" %s enc infile outfile \"passphrase\"\n", pname); + printf("\n"); + printf(" # encrypts infile->outfile, salt from cmdline\n"); + printf(" %s enc infile outfile pass 0123456789abcdef\n", pname); + printf("\n"); + printf(" # decrypts infile->outfile, pulls salt from infile\n"); + printf(" %s dec infile outfile pass\n", pname); + printf("\n"); + printf(" # decrypts infile->outfile, salt specified\n"); + printf(" # (don't try to read the salt from infile)\n"); + printf(" %s dec infile outfile pass 0123456789abcdef" + "\n", pname); + printf("\n"); + printf("Application Error: %s\n", err); + if(errno) + perror(" System Error"); + exit(-1); +} + +/* + * Parse a salt value passed in on the cmdline. + * + * Input: string passed in and a buf to put it in (exactly 8 bytes!) + * Output: CRYPT_OK if parsed OK, CRYPT_ERROR if not + * Side Effects: none + */ +int parse_hex_salt(unsigned char *in, unsigned char *out) +{ + int idx; + for(idx=0; idxpad+nb, padval, padval); + return nb+padval; + } else { + /* We are UNPADDING this block (and removing bytes) + We really just need to verify that the pad bytes are correct, + so start at the end of the string and work backwards. */ + + /* Figure out what the padlength should be by looking at the + last byte */ + idx = nb-1; + padval = buf->pad[idx]; + + /* padval must be nonzero and <= block length */ + if(padval <= 0 || padval > block_length) + return -1; + + /* First byte's accounted for; do the rest */ + idx--; + + while(idx >= nb-padval) + if(buf->pad[idx] != padval) + return -1; + else + idx--; + + /* If we got here, the pad checked out, so return a smaller + number of bytes than nb (basically where we left off+1) */ + return idx+1; + } +} + +/* + * Perform an encrypt/decrypt operation to/from files using AES+CBC+PKCS7 pad. + * Set encrypt to 1 to encrypt, 0 to decrypt. + * + * Input: in/out files, key, iv, and mode + * Output: CRYPT_OK if no error + * Side Effects: bytes slurped from infile, pushed to outfile, fds updated. + */ +int do_crypt(FILE *infd, FILE *outfd, unsigned char *key, unsigned char *iv, + int encrypt) +{ + union paddable inbuf, outbuf; + int cipher, ret; + symmetric_CBC cbc; + size_t nb; + + /* Register your cipher! */ + cipher = register_cipher(&aes_desc); + if(cipher == -1) + return CRYPT_INVALID_CIPHER; + + /* Start a CBC session with cipher/key/val params */ + ret = cbc_start(cipher, iv, key, KEY_LENGTH, 0, &cbc); + if( ret != CRYPT_OK ) + return -1; + + do { + /* Get bytes from the source */ + nb = fread(inbuf.unpad, 1, sizeof(inbuf.unpad), infd); + if(!nb) + return encrypt ? CRYPT_OK : CRYPT_ERROR; + + /* Barf if we got a read error */ + if(ferror(infd)) + return CRYPT_ERROR; + + if(encrypt) { + /* We're encrypting, so pad first (if at EOF) and then + crypt */ + if(feof(infd)) + nb = pkcs7_pad(&inbuf, nb, + aes_desc.block_length, 1); + + ret = cbc_encrypt(inbuf.pad, outbuf.pad, nb, &cbc); + if(ret != CRYPT_OK) + return ret; + + } else { + /* We're decrypting, so decrypt and then unpad if at + EOF */ + ret = cbc_decrypt(inbuf.unpad, outbuf.unpad, nb, &cbc); + if( ret != CRYPT_OK ) + return ret; + + if( feof(infd) ) + nb = pkcs7_pad(&outbuf, nb, + aes_desc.block_length, 0); + if(nb < 0) + /* The file didn't decrypt correctly */ + return CRYPT_ERROR; + + } + + /* Push bytes to outfile */ + if(fwrite(outbuf.unpad, 1, nb, outfd) != nb) + return CRYPT_ERROR; + + } while(!feof(infd)); + + /* Close up */ + cbc_done(&cbc); + + return CRYPT_OK; +} + +/* Convenience macro for the various barfable places below */ +#define BARF(a) { \ + if(infd) fclose(infd); \ + if(outfd) { fclose(outfd); remove(argv[3]); } \ + barf(argv[0], a); \ +} +/* + * The main routine. Mostly validate cmdline params, open files, run the KDF, + * and do the crypt. + */ +int main(int argc, char *argv[]) { + unsigned char salt[SALT_LENGTH]; + FILE *infd = NULL, *outfd = NULL; + int encrypt = -1; + int hash = -1; + int ret; + unsigned char keyiv[KEY_LENGTH + IV_LENGTH]; + unsigned long keyivlen = (KEY_LENGTH + IV_LENGTH); + unsigned char *key, *iv; + + /* Check proper number of cmdline args */ + if(argc < 5 || argc > 6) + BARF("Invalid number of arguments"); + + /* Check proper mode of operation */ + if (!strncmp(argv[1], "enc", sizeof("enc"))) + encrypt = 1; + else if(!strncmp(argv[1], "dec", sizeof("dec"))) + encrypt = 0; + else + BARF("Bad command name"); + + /* Check we can open infile/outfile */ + infd = fopen(argv[2], "rb"); + if(infd == NULL) + BARF("Could not open infile"); + outfd = fopen(argv[3], "wb"); + if(outfd == NULL) + BARF("Could not open outfile"); + + /* Get the salt from wherever */ + if(argc == 6) { + /* User-provided */ + if(parse_hex_salt((unsigned char*) argv[5], salt) != CRYPT_OK) + BARF("Bad user-specified salt"); + } else if(!strncmp(argv[1], "enc", sizeof("enc"))) { + /* Encrypting; get from RNG */ + if(rng_get_bytes(salt, sizeof(salt), NULL) != sizeof(salt)) + BARF("Not enough random data"); + } else { + /* Parse from infile (decrypt only) */ + if(parse_openssl_header(infd, salt) != CRYPT_OK) + BARF("Invalid OpenSSL header in infile"); + } + + /* Fetch the MD5 hasher for PKCS#5 */ + hash = register_hash(&md5_desc); + if(hash == -1) + BARF("Could not register MD5 hash"); + + /* Set things to a sane initial state */ + zeromem(keyiv, sizeof(keyiv)); + key = keyiv + 0; /* key comes first */ + iv = keyiv + KEY_LENGTH; /* iv comes next */ + + /* Run the key derivation from the provided passphrase. This gets us + the key and iv. */ + ret = pkcs_5_alg1_openssl(argv[4], strlen(argv[4]), salt, + OPENSSL_ITERATIONS, hash, keyiv, &keyivlen ); + if(ret != CRYPT_OK) + BARF("Could not derive key/iv from passphrase"); + + /* Display the salt/key/iv like OpenSSL cmdline does when -p */ + printf("salt="); dump_bytes(salt, sizeof(salt)); printf("\n"); + printf("key="); dump_bytes(key, KEY_LENGTH); printf("\n"); + printf("iv ="); dump_bytes(iv, IV_LENGTH ); printf("\n"); + + /* If we're encrypting, write the salt header as OpenSSL does */ + if(!strncmp(argv[1], "enc", sizeof("enc"))) { + if(fwrite(salt_header, 1, sizeof(salt_header), outfd) != + sizeof(salt_header) ) + BARF("Error writing salt header to outfile"); + if(fwrite(salt, 1, sizeof(salt), outfd) != sizeof(salt)) + BARF("Error writing salt to outfile"); + } + + /* At this point, the files are open, the salt has been figured out, + and we're ready to pump data through crypt. */ + + /* Do the crypt operation */ + if(do_crypt(infd, outfd, key, iv, encrypt) != CRYPT_OK) + BARF("Error during crypt operation"); + + /* Clean up */ + fclose(infd); fclose(outfd); + return 0; +} diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index 31344a12e..dae34902f 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -76,6 +76,14 @@ int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen); +/* Algorithm #1 - OpenSSL-compatible variant for arbitrarily-long keys. + Compatible with EVP_BytesToKey() */ +int pkcs_5_alg1_openssl(const unsigned char *password, + unsigned long password_len, + const unsigned char *salt, + int iteration_count, int hash_idx, + unsigned char *out, unsigned long *outlen); + /* Algorithm #2 (new) */ int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, const unsigned char *salt, unsigned long salt_len, diff --git a/src/misc/pkcs5/pkcs_5_1.c b/src/misc/pkcs5/pkcs_5_1.c index d225447e4..2ebdf2f7d 100644 --- a/src/misc/pkcs5/pkcs_5_1.c +++ b/src/misc/pkcs5/pkcs_5_1.c @@ -16,7 +16,17 @@ */ #ifdef LTC_PKCS_5 /** - Execute PKCS #5 v1 + Execute PKCS #5 v1 in strict or OpenSSL EVP_BytesToKey()-compat mode. + + PKCS#5 v1 specifies that the output key length can be no larger than + the hash output length. OpenSSL unilaterally extended that by repeating + the hash process on a block-by-block basis for as long as needed to make + bigger keys. If you want to be compatible with KDF for e.g. "openssl enc", + you'll want that. + + If you want strict PKCS behavior, turn openssl_compat off. Or (more + likely), use one of the convenience functions below. + @param password The password (or key) @param password_len The length of the password (octet) @param salt The salt (or nonce) which is 8 octets long @@ -24,17 +34,24 @@ @param hash_idx The index of the hash desired @param out [out] The destination for this algorithm @param outlen [in/out] The max size and resulting size of the algorithm output + @param openssl_compat [in] Whether or not to grow the key to the buffer size ala OpenSSL @return CRYPT_OK if successful */ -int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, - const unsigned char *salt, - int iteration_count, int hash_idx, - unsigned char *out, unsigned long *outlen) +static int _pkcs_5_alg1_common(const unsigned char *password, + unsigned long password_len, + const unsigned char *salt, + int iteration_count, int hash_idx, + unsigned char *out, unsigned long *outlen, + int openssl_compat) { int err; unsigned long x; hash_state *md; unsigned char *buf; + /* Storage vars in case we need to support > hashsize (OpenSSL compat) */ + unsigned long block = 0, iter; + /* How many bytes to put in the outbut buffer (convenience calc) */ + unsigned long outidx = 0, nb = 0; LTC_ARGCHK(password != NULL); LTC_ARGCHK(salt != NULL); @@ -59,33 +76,55 @@ int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, return CRYPT_MEM; } - /* hash initial password + salt */ - if ((err = hash_descriptor[hash_idx].init(md)) != CRYPT_OK) { - goto LBL_ERR; - } - if ((err = hash_descriptor[hash_idx].process(md, password, password_len)) != CRYPT_OK) { - goto LBL_ERR; - } - if ((err = hash_descriptor[hash_idx].process(md, salt, 8)) != CRYPT_OK) { - goto LBL_ERR; - } - if ((err = hash_descriptor[hash_idx].done(md, buf)) != CRYPT_OK) { - goto LBL_ERR; - } + while(block * hash_descriptor[hash_idx].hashsize < *outlen) { - while (--iteration_count) { - /* code goes here. */ - x = MAXBLOCKSIZE; - if ((err = hash_memory(hash_idx, buf, hash_descriptor[hash_idx].hashsize, buf, &x)) != CRYPT_OK) { - goto LBL_ERR; + /* hash initial (maybe previous hash) + password + salt */ + if ((err = hash_descriptor[hash_idx].init(md)) != CRYPT_OK) { + goto LBL_ERR; + } + /* in OpenSSL mode, we first hash the previous result for blocks 2-n */ + if (openssl_compat && block) { + if ((err = hash_descriptor[hash_idx].process(md, buf, hash_descriptor[hash_idx].hashsize)) != CRYPT_OK) { + goto LBL_ERR; + } + } + if ((err = hash_descriptor[hash_idx].process(md, password, password_len)) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = hash_descriptor[hash_idx].process(md, salt, 8)) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = hash_descriptor[hash_idx].done(md, buf)) != CRYPT_OK) { + goto LBL_ERR; } - } - /* copy upto outlen bytes */ - for (x = 0; x < hash_descriptor[hash_idx].hashsize && x < *outlen; x++) { - out[x] = buf[x]; + iter = iteration_count; + while (--iter) { + /* code goes here. */ + x = MAXBLOCKSIZE; + if ((err = hash_memory(hash_idx, buf, hash_descriptor[hash_idx].hashsize, buf, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + } + + /* limit the size of the copy to however many bytes we have left in + the output buffer (and how many bytes we have to copy) */ + outidx = block*hash_descriptor[hash_idx].hashsize; + nb = hash_descriptor[hash_idx].hashsize; + if(outidx+nb > *outlen) + nb = *outlen - outidx; + if(nb > 0) + XMEMCPY(out+outidx, buf, nb); + + block++; + if (!openssl_compat) + break; } - *outlen = x; + /* In strict mode, we always return the hashsize, in compat we filled it + as much as was requested, so we leave it alone. */ + if(!openssl_compat) + *outlen = hash_descriptor[hash_idx].hashsize; + err = CRYPT_OK; LBL_ERR: #ifdef LTC_CLEAN_STACK @@ -99,6 +138,50 @@ int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, return err; } +/** + Execute PKCS #5 v1 - Strict mode (no OpenSSL-compatible extension) + @param password The password (or key) + @param password_len The length of the password (octet) + @param salt The salt (or nonce) which is 8 octets long + @param iteration_count The PKCS #5 v1 iteration count + @param hash_idx The index of the hash desired + @param out [out] The destination for this algorithm + @param outlen [in/out] The max size and resulting size of the algorithm output + @return CRYPT_OK if successful +*/ +int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, + const unsigned char *salt, + int iteration_count, int hash_idx, + unsigned char *out, unsigned long *outlen) +{ + return _pkcs_5_alg1_common(password, password_len, salt, iteration_count, + hash_idx, out, outlen, 0); +} + +/** + Execute PKCS #5 v1 - OpenSSL-extension-compatible mode + + Use this one if you need to derive keys as "openssl enc" does by default. + OpenSSL (for better or worse), uses MD5 as the hash and iteration_count=1. + @param password The password (or key) + @param password_len The length of the password (octet) + @param salt The salt (or nonce) which is 8 octets long + @param iteration_count The PKCS #5 v1 iteration count + @param hash_idx The index of the hash desired + @param out [out] The destination for this algorithm + @param outlen [in/out] The max size and resulting size of the algorithm output + @return CRYPT_OK if successful +*/ +int pkcs_5_alg1_openssl(const unsigned char *password, + unsigned long password_len, + const unsigned char *salt, + int iteration_count, int hash_idx, + unsigned char *out, unsigned long *outlen) +{ + return _pkcs_5_alg1_common(password, password_len, salt, iteration_count, + hash_idx, out, outlen, 1); +} + #endif /* $Source$ */ From 0e9b3da3ea6f0318b9b1da85ac1f4d2b31d588a4 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 9 Mar 2017 19:57:49 +0100 Subject: [PATCH 0519/1192] PKCS#5 alg1 tests --- src/misc/pkcs5/pkcs_5_test.c | 146 +++++++++++++++++++++++++++-------- 1 file changed, 115 insertions(+), 31 deletions(-) diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index c53e334cc..61f8f38cc 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -34,15 +34,17 @@ int pkcs_5_test (void) return CRYPT_NOP; #else - static const struct { + typedef struct { char* P; unsigned long P_len; char* S; unsigned long S_len; int c; unsigned long dkLen; - unsigned char DK[25]; - } cases_5_2[] = { + unsigned char DK[40]; + } case_item; + + static const case_item cases_5_2[] = { { "password", 8, @@ -113,6 +115,45 @@ int pkcs_5_test (void) #endif /* LTC_TEST_EXT */ }; + static const case_item cases_5_1[] = { + { + "password", + 8, + "saltsalt", /* must be 8 octects */ + 8, /* ignored by alg1 */ + 1, + 20, + { 0xca, 0xb8, 0x6d, 0xd6, 0x26, 0x17, 0x10, 0x89, 0x1e, 0x8c, + 0xb5, 0x6e, 0xe3, 0x62, 0x56, 0x91, 0xa7, 0x5d, 0xf3, 0x44 } + }, + }; + + static const case_item cases_5_1o[] = { + { + "password", + 8, + "saltsalt", /* must be 8 octects */ + 8, /* ignored by alg1_openssl */ + 1, + 20, + { 0xca, 0xb8, 0x6d, 0xd6, 0x26, 0x17, 0x10, 0x89, 0x1e, 0x8c, + 0xb5, 0x6e, 0xe3, 0x62, 0x56, 0x91, 0xa7, 0x5d, 0xf3, 0x44 } + + }, + { + "password", + 8, + "saltsalt", /* must be 8 octects */ + 8, /* ignored by alg1_openssl */ + 1, + 30, + { 0xca, 0xb8, 0x6d, 0xd6, 0x26, 0x17, 0x10, 0x89, 0x1e, 0x8c, + 0xb5, 0x6e, 0xe3, 0x62, 0x56, 0x91, 0xa7, 0x5d, 0xf3, 0x44, + 0xf0, 0xbf, 0xf4, 0xc1, 0x2c, 0xf3, 0x59, 0x6f, 0xc0, 0x0b } + + } + }; + unsigned char DK[25]; unsigned long dkLen; int i, err; @@ -120,11 +161,11 @@ int pkcs_5_test (void) int hash = find_hash("sha1"); if (hash == -1) { -#ifdef LTC_TEST_DBG - printf("PKCS#5 test: 'sha1' hash not found\n"); -#endif + printf("PKCS#5 test failed: 'sha1' hash not found\n"); return CRYPT_ERROR; } + + /* testing alg 2 */ for(i=0; i < (int)(sizeof(cases_5_2) / sizeof(cases_5_2[0])); i++) { ++tested; dkLen = cases_5_2[i].dkLen; @@ -132,42 +173,85 @@ int pkcs_5_test (void) (unsigned char*)cases_5_2[i].S, cases_5_2[i].S_len, cases_5_2[i].c, hash, DK, &dkLen)) != CRYPT_OK) { -#ifdef LTC_TEST_DBG - printf("PKCS#5 test #%d: %s\n", i, error_to_string(err)); -#endif - return err; - } - - if (dkLen != cases_5_2[i].dkLen) - { -#ifdef LTC_TEST_DBG - printf("PKCS#5 test #%d: %lu != %lu\n", i, dkLen, cases_5_2[i].dkLen); -#endif - return CRYPT_FAIL_TESTVECTOR; + printf("\nPKCS#5_2 test #%d: Failed/1\n", i); + printf("err=%d\n", err); + ++failed; } - - if(XMEMCMP(DK, cases_5_2[i].DK, (size_t)cases_5_2[i].dkLen) != 0) { + else if (dkLen != cases_5_2[i].dkLen) { + printf("\nPKCS#5_2 test #%d: Failed/2\n", i); + printf("len is %d\n", (int)dkLen); + printf("len should %d\n", (int)cases_5_2[i].dkLen); ++failed; -#ifdef LTC_TEST_DBG - { - printf("\nPKCS#5 test #%d: Failed\n", i); + } + else if(XMEMCMP(DK, cases_5_2[i].DK, (size_t)cases_5_2[i].dkLen) != 0) { + printf("\nPKCS#5_2 test #%d: Failed/3\n", i); +#if LTC_TEST_DBG print_hex("is", DK, cases_5_2[i].dkLen); print_hex("should", cases_5_2[i].DK, cases_5_2[i].dkLen); - return CRYPT_FAIL_TESTVECTOR; - } -#if LTC_TEST_DBG > 1 +#endif + ++failed; +#if LTC_TEST_DBG } else { - printf("PKCS#5 test #%d: Passed\n", i); + printf("PKCS#5_2 test #%d: Passed\n", i); #endif + } + } + + /* testing alg 1 */ + for(i=0; i < (int)(sizeof(cases_5_1) / sizeof(case_item)); i++, tested++) { + dkLen = cases_5_1[i].dkLen; + if((err = pkcs_5_alg1((unsigned char*)cases_5_1[i].P, cases_5_1[i].P_len, + (unsigned char*)cases_5_1[i].S, + cases_5_1[i].c, hash, + DK, &dkLen)) != CRYPT_OK) { + printf("\nPKCS#5_1 test #%d: Failed/1\n", i); + printf("err=%d\n", err); + ++failed; + } + else if (dkLen != cases_5_1[i].dkLen) { + printf("\nPKCS#5_1 test #%d: Failed/2\n", i); + printf("len is %d\n", (int)dkLen); + printf("len should %d\n", (int)cases_5_1[i].dkLen); + ++failed; + } + else if (XMEMCMP(DK, cases_5_1[i].DK, (size_t)cases_5_1[i].dkLen) != 0) { + printf("\nPKCS#5_1 test #%d: Failed/3\n", i); +#if LTC_TEST_DBG + print_hex("is", DK, cases_5_1[i].dkLen); + print_hex("should", cases_5_1[i].DK, cases_5_1[i].dkLen); #endif + ++failed; } } - if (failed != 0) { - return CRYPT_FAIL_TESTVECTOR; - } else { - return CRYPT_OK; + /* testing alg 1_openssl */ + for(i = 0; i < (int)(sizeof(cases_5_1o) / sizeof(cases_5_1o[0])); i++, tested++) { + dkLen = cases_5_1o[i].dkLen; + if ((err = pkcs_5_alg1_openssl((unsigned char*)cases_5_1o[i].P, cases_5_1o[i].P_len, + (unsigned char*)cases_5_1o[i].S, + cases_5_1o[i].c, hash, + DK, &dkLen)) != CRYPT_OK) { + printf("\nPKCS#5_1o test #%d: Failed/1\n", i); + printf("err=%d\n", err); + ++failed; + } + else if (dkLen != cases_5_1o[i].dkLen) { + printf("\nPKCS#5_1o test #%d: Failed/2\n", i); + printf("len is %d\n", (int)dkLen); + printf("len should %d\n", (int)cases_5_1o[i].dkLen); + ++failed; + } + else if (XMEMCMP(DK, cases_5_1o[i].DK, (size_t)cases_5_1o[i].dkLen) != 0) { + printf("\nPKCS#5_1o test #%d: Failed/3\n", i); +#if LTC_TEST_DBG + print_hex("is", DK, cases_5_1o[i].dkLen); + print_hex("should", cases_5_1o[i].DK, cases_5_1o[i].dkLen); +#endif + ++failed; + } } + + return (failed != 0) ? CRYPT_FAIL_TESTVECTOR : CRYPT_OK; #endif } From 4503868da28c5d52f1d11140b458f8f99a6652d8 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 9 Mar 2017 22:04:35 +0100 Subject: [PATCH 0520/1192] fix pkcs_5_test crash --- src/misc/pkcs5/pkcs_5_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index 61f8f38cc..fc33c73e7 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -154,7 +154,7 @@ int pkcs_5_test (void) } }; - unsigned char DK[25]; + unsigned char DK[40]; unsigned long dkLen; int i, err; int tested=0, failed=0; From 937f186db193bb128f92ae9d89b3b54a5866673e Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Wed, 15 Mar 2017 06:54:21 +0100 Subject: [PATCH 0521/1192] use #ifdef instead of #if --- src/misc/pkcs5/pkcs_5_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index fc33c73e7..46a8931e9 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -185,12 +185,12 @@ int pkcs_5_test (void) } else if(XMEMCMP(DK, cases_5_2[i].DK, (size_t)cases_5_2[i].dkLen) != 0) { printf("\nPKCS#5_2 test #%d: Failed/3\n", i); -#if LTC_TEST_DBG +#ifdef LTC_TEST_DBG print_hex("is", DK, cases_5_2[i].dkLen); print_hex("should", cases_5_2[i].DK, cases_5_2[i].dkLen); #endif ++failed; -#if LTC_TEST_DBG +#ifdef LTC_TEST_DBG } else { printf("PKCS#5_2 test #%d: Passed\n", i); #endif @@ -216,7 +216,7 @@ int pkcs_5_test (void) } else if (XMEMCMP(DK, cases_5_1[i].DK, (size_t)cases_5_1[i].dkLen) != 0) { printf("\nPKCS#5_1 test #%d: Failed/3\n", i); -#if LTC_TEST_DBG +#ifdef LTC_TEST_DBG print_hex("is", DK, cases_5_1[i].dkLen); print_hex("should", cases_5_1[i].DK, cases_5_1[i].dkLen); #endif @@ -243,7 +243,7 @@ int pkcs_5_test (void) } else if (XMEMCMP(DK, cases_5_1o[i].DK, (size_t)cases_5_1o[i].dkLen) != 0) { printf("\nPKCS#5_1o test #%d: Failed/3\n", i); -#if LTC_TEST_DBG +#ifdef LTC_TEST_DBG print_hex("is", DK, cases_5_1o[i].dkLen); print_hex("should", cases_5_1o[i].DK, cases_5_1o[i].dkLen); #endif From 3396513e814d13e165b5b92a3d2a8007a6ed2538 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 15 Mar 2017 08:59:49 +0100 Subject: [PATCH 0522/1192] improving demos/openssl-enc.c --- demos/openssl-enc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/demos/openssl-enc.c b/demos/openssl-enc.c index 7d43390ad..a974c5543 100644 --- a/demos/openssl-enc.c +++ b/demos/openssl-enc.c @@ -66,8 +66,8 @@ static char salt_header[] = { 'S', 'a', 'l', 't', 'e', 'd', '_', '_' }; /* A simple way to handle the possibility that a block may increase in size after padding. */ union paddable { - char unpad[1024]; - char pad[1024+MAXBLOCKSIZE]; + unsigned char unpad[1024]; + unsigned char pad[1024+MAXBLOCKSIZE]; }; /* @@ -112,7 +112,7 @@ int parse_hex_salt(unsigned char *in, unsigned char *out) { int idx; for(idx=0; idxpad+nb, padval, padval); + memset(buf->pad+nb, padval, padval); return nb+padval; } else { /* We are UNPADDING this block (and removing bytes) @@ -195,7 +195,7 @@ size_t pkcs7_pad(union paddable *buf, size_t nb, int block_length, /* First byte's accounted for; do the rest */ idx--; - while(idx >= nb-padval) + while(idx >= (off_t)(nb-padval)) if(buf->pad[idx] != padval) return -1; else @@ -264,7 +264,7 @@ int do_crypt(FILE *infd, FILE *outfd, unsigned char *key, unsigned char *iv, if( feof(infd) ) nb = pkcs7_pad(&outbuf, nb, aes_desc.block_length, 0); - if(nb < 0) + if(nb == -1) /* The file didn't decrypt correctly */ return CRYPT_ERROR; @@ -307,9 +307,9 @@ int main(int argc, char *argv[]) { BARF("Invalid number of arguments"); /* Check proper mode of operation */ - if (!strncmp(argv[1], "enc", sizeof("enc"))) + if (!strncmp(argv[1], "enc", 3)) encrypt = 1; - else if(!strncmp(argv[1], "dec", sizeof("dec"))) + else if(!strncmp(argv[1], "dec", 3)) encrypt = 0; else BARF("Bad command name"); @@ -327,7 +327,7 @@ int main(int argc, char *argv[]) { /* User-provided */ if(parse_hex_salt((unsigned char*) argv[5], salt) != CRYPT_OK) BARF("Bad user-specified salt"); - } else if(!strncmp(argv[1], "enc", sizeof("enc"))) { + } else if(!strncmp(argv[1], "enc", 3)) { /* Encrypting; get from RNG */ if(rng_get_bytes(salt, sizeof(salt), NULL) != sizeof(salt)) BARF("Not enough random data"); @@ -349,7 +349,7 @@ int main(int argc, char *argv[]) { /* Run the key derivation from the provided passphrase. This gets us the key and iv. */ - ret = pkcs_5_alg1_openssl(argv[4], strlen(argv[4]), salt, + ret = pkcs_5_alg1_openssl((unsigned char*)argv[4], strlen(argv[4]), salt, OPENSSL_ITERATIONS, hash, keyiv, &keyivlen ); if(ret != CRYPT_OK) BARF("Could not derive key/iv from passphrase"); @@ -360,7 +360,7 @@ int main(int argc, char *argv[]) { printf("iv ="); dump_bytes(iv, IV_LENGTH ); printf("\n"); /* If we're encrypting, write the salt header as OpenSSL does */ - if(!strncmp(argv[1], "enc", sizeof("enc"))) { + if(!strncmp(argv[1], "enc", 3)) { if(fwrite(salt_header, 1, sizeof(salt_header), outfd) != sizeof(salt_header) ) BARF("Error writing salt header to outfile"); From 54a26525dca650ba5a7ecce6fc60a67952d86bf2 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 15 Mar 2017 13:06:23 +0100 Subject: [PATCH 0523/1192] avoid C++ style comments --- demos/constants.c | 6 +++--- demos/sizes.c | 6 +++--- helper.pl | 1 + src/encauth/ccm/ccm_memory_ex.c | 4 ++-- src/mac/hmac/hmac_test.c | 10 +++++----- src/math/gmp_desc.c | 4 ++-- src/misc/crypt/crypt_sizes.c | 20 ++++++++++---------- testprof/der_tests.c | 2 +- 8 files changed, 27 insertions(+), 26 deletions(-) diff --git a/demos/constants.c b/demos/constants.c index b1d611226..ffa223e6b 100644 --- a/demos/constants.c +++ b/demos/constants.c @@ -21,7 +21,7 @@ int main(void) { - // given a specific constant name, get and print its value + /* given a specific constant name, get and print its value */ char name[] = "CTR_COUNTER_BIG_ENDIAN"; int value; @@ -29,7 +29,7 @@ int main(void) { exit(EXIT_FAILURE); printf("\n %s is %d \n\n", name, value); - // get and print the length of the names (and values) list + /* get and print the length of the names (and values) list */ char *names_list; unsigned int names_list_len; @@ -37,7 +37,7 @@ int main(void) { exit(EXIT_FAILURE); printf(" need to allocate %u bytes \n\n", names_list_len); - // get and print the names (and values) list + /* get and print the names (and values) list */ if ((names_list = malloc(names_list_len)) == NULL) exit(EXIT_FAILURE); if (crypt_list_all_constants(names_list, &names_list_len) != 0) diff --git a/demos/sizes.c b/demos/sizes.c index cacf5c635..b544372b8 100644 --- a/demos/sizes.c +++ b/demos/sizes.c @@ -20,21 +20,21 @@ int main(void) { - // given a specific size name, get and print its size + /* given a specific size name, get and print its size */ char name[] = "ecc_key"; unsigned int size; if(crypt_get_size(name, &size) != 0) exit(EXIT_FAILURE); printf("\n size of '%s' is %u \n\n", name, size); - // get and print the length of the names (and sizes) list + /* get and print the length of the names (and sizes) list */ char *sizes_list; unsigned int sizes_list_len; if(crypt_list_all_sizes(NULL, &sizes_list_len) != 0) exit(EXIT_FAILURE); printf(" need to allocate %u bytes \n\n", sizes_list_len); - // get and print the names (and sizes) list + /* get and print the names (and sizes) list */ sizes_list = malloc(sizes_list_len); if(crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) exit(EXIT_FAILURE); diff --git a/helper.pl b/helper.pl index 18b12ff07..3b0406d25 100755 --- a/helper.pl +++ b/helper.pl @@ -41,6 +41,7 @@ sub check_source { push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/; push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i; push @{$troubles->{non_ascii_char}}, $lineno if $l =~ /[^[:ascii:]]/; + push @{$troubles->{cpp_comment}}, $lineno if $file =~ /\.(c|h)$/ && ($l =~ /\s\/\// || $l =~ /\/\/\s/); $lineno++; } for my $k (sort keys %$troubles) { diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c index 4b09ddc57..0fbdd0933 100644 --- a/src/encauth/ccm/ccm_memory_ex.c +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -172,7 +172,7 @@ if (B_0 == NULL) { } } else { - // B_0 != NULL + /* B_0 != NULL */ XMEMCPY(PAD, B_0, 16); } @@ -329,7 +329,7 @@ if (CTR == NULL) { } } - // grab the CTR + /* grab the CTR */ XMEMCPY(ctrcopy, ctr, 16); /* setup CTR for the TAG (zero the count) */ diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index 051ab469d..0c311c6b1 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -61,26 +61,26 @@ int hmac_test(void) int i; static const unsigned char hmac_test_case_keys[][136] = { - { // 1 + { /* 1 */ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, #ifdef LTC_TEST_EXT - { // 2 + { /* 2 */ 0x4a, 0x65, 0x66, 0x65 }, - { // 4 + { /* 4 */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 }, - { // 5 + { /* 5 */ 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, - { // 3, 6, 7 + { /* 3, 6, 7 */ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 16c1d9060..0a23e996b 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -167,7 +167,7 @@ static int read_radix(void *a, const char *b, int radix) } if (i == 64) { XFREE (tmp); - // printf ("c = '%c'\n", c); + /* printf ("c = '%c'\n", c); */ return CRYPT_ERROR; } *q++ = '0' + (i / 8); @@ -175,7 +175,7 @@ static int read_radix(void *a, const char *b, int radix) } *q = 0; ret = mpz_set_str(a, tmp, 8); - // printf ("ret = %d for '%s'\n", ret, tmp); + /* printf ("ret = %d for '%s'\n", ret, tmp); */ XFREE (tmp); } else { ret = mpz_set_str(a, b, radix); diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 69304dc40..32b04ba4f 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -29,7 +29,7 @@ typedef struct { #define _SZ_STRINGIFY_T(s) { #s, sizeof(s) } static const crypt_size _crypt_sizes[] = { - // hash state sizes + /* hash state sizes */ _SZ_STRINGIFY_S(ltc_hash_descriptor), _SZ_STRINGIFY_T(hash_state), #ifdef LTC_SHA256 @@ -72,7 +72,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_S(chc_state), #endif - // block cipher key sizes + /* block cipher key sizes */ _SZ_STRINGIFY_S(ltc_cipher_descriptor), _SZ_STRINGIFY_T(symmetric_key), #ifdef LTC_ANUBIS @@ -134,7 +134,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_S(twofish_key), #endif - // mode sizes + /* mode sizes */ #ifdef LTC_CBC_MODE _SZ_STRINGIFY_T(symmetric_CBC), #endif @@ -157,7 +157,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(symmetric_OFB), #endif - // MAC sizes -- no states for ccm, lrw + /* MAC sizes -- no states for ccm, lrw */ #ifdef LTC_F9_MODE _SZ_STRINGIFY_T(f9_state), #endif @@ -189,13 +189,13 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(eax_state), #endif #ifdef LTC_CCM_MODE -// not defined +/* not defined */ #endif #ifdef LRW_MODE -// not defined +/* not defined */ #endif - // asymmetric keys + /* asymmetric keys */ #ifdef LTC_MRSA _SZ_STRINGIFY_T(rsa_key), #endif @@ -214,7 +214,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(katja_key), #endif - // prng state sizes + /* prng state sizes */ _SZ_STRINGIFY_S(ltc_prng_descriptor), _SZ_STRINGIFY_T(prng_state), #ifdef LTC_FORTUNA @@ -229,8 +229,8 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_YARROW _SZ_STRINGIFY_S(yarrow_prng), #endif - // sprng has no state as it uses other potentially available sources - // like /dev/random. See Developers Guide for more info. + /* sprng has no state as it uses other potentially available sources */ + /* like /dev/random. See Developers Guide for more info. */ #ifdef LTC_ADLER32 _SZ_STRINGIFY_T(adler32_state), diff --git a/testprof/der_tests.c b/testprof/der_tests.c index b79a5ae32..7ce6273be 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -620,7 +620,7 @@ static void der_set_test(void) OID { 1, 2, 840, 113549 } NULL SET OF { - PRINTABLE "333" // WILL GET SORTED + PRINTABLE "333" -- WILL GET SORTED PRINTABLE "222" } } From 9babf374ee0ca89c3acf27c89b26507068abde2d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 15 Mar 2017 22:21:53 +0100 Subject: [PATCH 0524/1192] add '-c' option (again) to updatemakes.sh --- updatemakes.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/updatemakes.sh b/updatemakes.sh index c5e622983..070bab358 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -2,4 +2,11 @@ ./helper.pl --update-makefiles || exit 1 +makefiles=(makefile makefile.icc makefile.shared makefile.unix makefile.mingw makefile.msvc) +vcproj=(libtomcrypt_VS2008.vcproj libtomcrypt_VS2005.vcproj) + +if [ $# -eq 1 ] && [ "$1" == "-c" ]; then + git add ${makefiles[@]} ${vcproj[@]} && git commit -m 'Update makefiles' +fi + exit 0 From 39425a94c50ab29570c586860ac1521ea87f9531 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 15 Mar 2017 21:29:09 +0100 Subject: [PATCH 0525/1192] improved source checks --- check_source.sh | 2 +- helper.pl | 39 ++++++++++++++++++++++++++++---- makefile | 7 ------ src/encauth/ccm/ccm_memory_ex.c | 2 +- src/misc/crypt/crypt_constants.c | 2 +- src/misc/crypt/crypt_sizes.c | 2 +- src/misc/mem_neq.c | 2 +- 7 files changed, 39 insertions(+), 17 deletions(-) diff --git a/check_source.sh b/check_source.sh index 005674720..cc5865732 100755 --- a/check_source.sh +++ b/check_source.sh @@ -6,7 +6,7 @@ bash printinfo.sh make clean > /dev/null echo "checking..." -./helper.pl --check-source --check-makefiles || exit 1 +./helper.pl --check-source --check-makefiles --check-defines|| exit 1 exit 0 diff --git a/helper.pl b/helper.pl index 3b0406d25..8088b0e8e 100755 --- a/helper.pl +++ b/helper.pl @@ -37,11 +37,23 @@ sub check_source { my $content = read_file($file); push @{$troubles->{crlf_line_end}}, '?' if $content =~ /\r/; for my $l (split /\n/, $content) { - push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/; - push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/; - push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i; - push @{$troubles->{non_ascii_char}}, $lineno if $l =~ /[^[:ascii:]]/; - push @{$troubles->{cpp_comment}}, $lineno if $file =~ /\.(c|h)$/ && ($l =~ /\s\/\// || $l =~ /\/\/\s/); + push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/; + push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/; + push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i; + push @{$troubles->{non_ascii_char}}, $lineno if $l =~ /[^[:ascii:]]/; + push @{$troubles->{cpp_comment}}, $lineno if $file =~ /\.(c|h)$/ && ($l =~ /\s\/\// || $l =~ /\/\/\s/); + # in ./src we prefer using XMEMCPY, XMALLOC, XFREE ... + push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcpy\s*\(/; + push @{$troubles->{unwanted_malloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmalloc\s*\(/; + push @{$troubles->{unwanted_realloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\brealloc\s*\(/; + push @{$troubles->{unwanted_calloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bcalloc\s*\(/; + push @{$troubles->{unwanted_free}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bfree\s*\(/; + push @{$troubles->{unwanted_memset}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemset\s*\(/; + push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcpy\s*\(/; + push @{$troubles->{unwanted_memcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcmp\s*\(/; + push @{$troubles->{unwanted_strcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bstrcmp\s*\(/; + push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bclock\s*\(/; + push @{$troubles->{unwanted_qsort}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bqsort\s*\(/; $lineno++; } for my $k (sort keys %$troubles) { @@ -54,6 +66,21 @@ sub check_source { return $fails; } +sub check_defines { + my $fails = 0; + my $cust_h = read_file("src/headers/tomcrypt_custom.h"); + my $cryp_c = read_file("src/misc/crypt/crypt.c"); + $cust_h =~ s|/\*.*?\*/||sg; # remove comments + $cryp_c =~ s|/\*.*?\*/||sg; # remove comments + my %def = map { $_ => 1 } map { $_ =~ s/^\s*#define\s+(LTC_\S+).*$/$1/; $_ } grep { /^\s*#define\s+LTC_\S+/ } split /\n/, $cust_h; + for my $d (sort keys %def) { + next if $d =~ /^LTC_(DH\d+|ECC\d+|ECC_\S+|MPI|MUTEX_\S+\(x\)|NO_\S+)$/; + warn "$d missing in src/misc/crypt/crypt.c\n" and $fails++ if $cryp_c !~ /\Q$d\E/; + } + warn( $fails > 0 ? "check-defines: FAIL $fails\n" : "check-defines: PASS\n" ); + return $fails; +} + sub prepare_variable { my ($varname, @list) = @_; my $output = "$varname="; @@ -236,6 +263,7 @@ sub die_usage { } GetOptions( "check-source" => \my $check_source, + "check-defines" => \my $check_defines, "check-makefiles" => \my $check_makefiles, "update-makefiles" => \my $update_makefiles, "help" => \my $help @@ -243,6 +271,7 @@ sub die_usage { my $failure; $failure ||= check_source() if $check_source; +$failure ||= check_defines() if $check_defines; $failure ||= process_makefiles(0) if $check_makefiles; $failure ||= process_makefiles(1) if $update_makefiles; diff --git a/makefile b/makefile index 5c2e7616e..c62633989 100644 --- a/makefile +++ b/makefile @@ -397,13 +397,6 @@ zipup: no_oops docs gpg -b -a crypt-$(VERSION).tar.bz2 ; gpg -b -a crypt-$(VERSION).zip ; \ mv -fv crypt* ~ ; rm -rf libtomcrypt-$(VERSION) - -check_defines: - ${silent} cat src/headers/tomcrypt_custom.h | grep '\#define[ \t]*LTC_' | sed -e 's@/\*@@g' -e 's@\*/@@g' -e 's@^[ \t]*@@g' \ - | cut -d' ' -f 2 | sed -e 's@(x)@@g' | sort | uniq \ - | grep -v -e 'LTC_ECC[0-9]*' -e 'LTC_DH[0-9]*' -e 'LTC_NO_' -e 'LTC_MUTEX' -e 'LTC_MPI' \ - | xargs -I '{}' sh -c 'grep -q -m 1 -o {} src/misc/crypt/crypt.c || echo {} not found' - perlcritic: perlcritic *.pl diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c index 0fbdd0933..1110abbff 100644 --- a/src/encauth/ccm/ccm_memory_ex.c +++ b/src/encauth/ccm/ccm_memory_ex.c @@ -360,7 +360,7 @@ if (CTR != NULL) { ctrcopy[z] = (ctrcopy[z] + 1) & 255; if (ctrcopy[z]) break; } - memcpy(CTR, ctrcopy, 16); + XMEMCPY(CTR, ctrcopy, 16); } #ifdef LTC_CLEAN_STACK diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 68e9aae23..a6b49b78f 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -161,7 +161,7 @@ int crypt_get_constant(const char* namein, int *valueout) { int i; int _crypt_constants_len = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); for (i=0; i<_crypt_constants_len; i++) { - if (strcmp(_crypt_constants[i].name, namein) == 0) { + if (XSTRCMP(_crypt_constants[i].name, namein) == 0) { *valueout = _crypt_constants[i].value; return 0; } diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 32b04ba4f..20fbdd1ce 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -248,7 +248,7 @@ int crypt_get_size(const char* namein, unsigned int *sizeout) { int i; int count = sizeof(_crypt_sizes) / sizeof(_crypt_sizes[0]); for (i=0; i Date: Tue, 21 Mar 2017 19:56:43 +0100 Subject: [PATCH 0526/1192] improving helper.pl --- helper.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/helper.pl b/helper.pl index 8088b0e8e..8eeb02a1a 100755 --- a/helper.pl +++ b/helper.pl @@ -257,7 +257,9 @@ sub process_makefiles { sub die_usage { die <<"MARKER"; usage: $0 --check-source + $0 --check-defines $0 --check-makefiles + $0 --check-all $0 --update-makefiles MARKER } @@ -265,14 +267,15 @@ sub die_usage { GetOptions( "check-source" => \my $check_source, "check-defines" => \my $check_defines, "check-makefiles" => \my $check_makefiles, + "check-all" => \my $check_all, "update-makefiles" => \my $update_makefiles, "help" => \my $help ) or die_usage; my $failure; -$failure ||= check_source() if $check_source; -$failure ||= check_defines() if $check_defines; -$failure ||= process_makefiles(0) if $check_makefiles; +$failure ||= check_source() if $check_all || $check_source; +$failure ||= check_defines() if $check_all || $check_defines; +$failure ||= process_makefiles(0) if $check_all || $check_makefiles; $failure ||= process_makefiles(1) if $update_makefiles; die_usage unless defined $failure; From f7bd454dd50d14eeb31080c5c4e26722f83b77f5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 21 Mar 2017 17:30:18 +0100 Subject: [PATCH 0527/1192] Revert "add release flag to makefile.shared" This reverts commit 14272976d0615b546e9e0215ec4e2f01854a2dc9. This is neither a 'package-internal library' nor one 'whose interfaces change very frequently' so we remove the release information again from the shared library. --- makefile.shared | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/makefile.shared b/makefile.shared index 3d4fa5973..8a2fdf000 100644 --- a/makefile.shared +++ b/makefile.shared @@ -10,8 +10,6 @@ include makefile.include # The version # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION=0:117 -# http://www.gnu.org/software/libtool/manual/html_node/Release-numbers.html -RELEASE=1.17 LT ?= libtool @@ -206,7 +204,7 @@ testprof/$(LIBTEST): $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< $(LIBNAME): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) -release $(RELEASE) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) install: $(LIBNAME) install -d $(DESTDIR)$(LIBPATH) From a00aba83709b6757f4df2c2bd5db56d052be1608 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 22 Mar 2017 11:21:49 +0100 Subject: [PATCH 0528/1192] add pre-commit hook --- hooks/pre-commit | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ makefile | 3 +++ 2 files changed, 52 insertions(+) create mode 100755 hooks/pre-commit diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 000000000..8a82f12d0 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ascii filenames set this variable to true. +allownonascii=$(git config hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ascii filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + echo "Error: Attempt to add a non-ascii file name." + echo + echo "This can cause problems if you want to work" + echo "with people on other platforms." + echo + echo "To be portable it is advisable to rename the file ..." + echo + echo "If you know what you are doing you can disable this" + echo "check using:" + echo + echo " git config hooks.allownonascii true" + echo + exit 1 +fi + +exec perl helper.pl --check-all diff --git a/makefile b/makefile index c62633989..df60f899d 100644 --- a/makefile +++ b/makefile @@ -278,6 +278,9 @@ install_test: testprof/$(LIBTEST) install -d $(DESTDIR)$(INCPATH) install -m 644 testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) +install_hooks: + for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done + profile: CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" ./timing From fe7c4e39933443b423d22085d2dc23ec4d93c7ce Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Sep 2015 21:13:17 +0200 Subject: [PATCH 0529/1192] add ltc_rng function pointer the idea is to be able to easily provide a plug-in rng for a specific platform without the need to touch the library. --- src/headers/tomcrypt_prng.h | 3 +++ src/misc/crypt/crypt_prng_rng_descriptor.c | 13 +++++++++++++ src/prngs/rng_get_bytes.c | 7 +++++++ 3 files changed, 23 insertions(+) create mode 100644 src/misc/crypt/crypt_prng_rng_descriptor.c diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 4880b0531..2bfe82006 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -193,6 +193,9 @@ unsigned long rng_get_bytes(unsigned char *out, int rng_make_prng(int bits, int wprng, prng_state *prng, void (*callback)(void)); +extern unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen, + void (*callback)(void)); + /* $Source$ */ /* $Revision$ */ diff --git a/src/misc/crypt/crypt_prng_rng_descriptor.c b/src/misc/crypt/crypt_prng_rng_descriptor.c new file mode 100644 index 000000000..14f36ffb8 --- /dev/null +++ b/src/misc/crypt/crypt_prng_rng_descriptor.c @@ -0,0 +1,13 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void)); diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index f0536f6ee..7430febdb 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -135,6 +135,13 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, LTC_ARGCHK(out != NULL); + if (ltc_rng) { + x = ltc_rng(out, outlen, callback); + if (x != 0) { + return x; + } + } + #if defined(_WIN32) || defined(_WIN32_WCE) x = rng_win32(out, outlen, callback); if (x != 0) { return x; } #elif defined(LTC_DEVRANDOM) From fcae7e2c49274ad2327f39f493720394685a15eb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 11 Sep 2015 00:30:02 +0200 Subject: [PATCH 0530/1192] test the ltc_rng --- testprof/x86_prof.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 46ae43ab4..4aee85cdd 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -302,8 +302,23 @@ static void _unregister_all(void) #endif } /* _cleanup() */ +static unsigned long my_test_rng_read; + +static unsigned long my_test_rng(unsigned char *buf, unsigned long len, + void (*callback)(void)) +{ + unsigned long n; + LTC_UNUSED_PARAM(callback); + for (n = 0; n < len; ++n) { + buf[n] = 4; + } + my_test_rng_read += n; + return n; +} + void reg_algs(void) { + unsigned long before; int err; atexit(_unregister_all); @@ -441,6 +456,21 @@ register_prng(&rc4_desc); register_prng(&sober128_desc); #endif + ltc_rng = my_test_rng; + + before = my_test_rng_read; + if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { + fprintf(stderr, "rng_make_prng with 'my_test_rng' failed: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + + if (before == my_test_rng_read) { + fprintf(stderr, "somehow there was no read from the ltc_rng! %lu == %lu\n", before, my_test_rng_read); + exit(EXIT_FAILURE); + } + + ltc_rng = NULL; + if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err)); exit(EXIT_FAILURE); From cd08a8cec3854670082e3715be32c442b0fa8650 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 15 Mar 2017 22:12:49 +0100 Subject: [PATCH 0531/1192] disable ltc_rng by default --- src/headers/tomcrypt_custom.h | 3 +++ src/headers/tomcrypt_prng.h | 2 ++ src/misc/crypt/crypt.c | 3 +++ src/misc/crypt/crypt_prng_rng_descriptor.c | 2 ++ src/prngs/rng_get_bytes.c | 2 ++ testprof/x86_prof.c | 6 ++++++ 6 files changed, 18 insertions(+) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 33e4bc08a..6d6f4f33b 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -304,6 +304,9 @@ /* rng_make_prng() */ #define LTC_RNG_MAKE_PRNG +/* enable the ltc_rng hook to integrate e.g. embedded hardware RNG's easily */ +/* #define LTC_PRNG_ENABLE_LTC_RNG */ + #endif /* LTC_NO_PRNGS */ #ifdef LTC_YARROW diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 2bfe82006..dc2cc7e04 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -193,8 +193,10 @@ unsigned long rng_get_bytes(unsigned char *out, int rng_make_prng(int bits, int wprng, prng_state *prng, void (*callback)(void)); +#ifdef LTC_PRNG_ENABLE_LTC_RNG extern unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void)); +#endif /* $Source$ */ diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 7d03cfac4..aef292f29 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -371,6 +371,9 @@ const char *crypt_build_settings = #if defined(LTC_RNG_MAKE_PRNG) " LTC_RNG_MAKE_PRNG " #endif +#if defined(LTC_PRNG_ENABLE_LTC_RNG) + " LTC_PRNG_ENABLE_LTC_RNG " +#endif #if defined(LTC_HASH_HELPERS) " LTC_HASH_HELPERS " #endif diff --git a/src/misc/crypt/crypt_prng_rng_descriptor.c b/src/misc/crypt/crypt_prng_rng_descriptor.c index 14f36ffb8..bf31781ac 100644 --- a/src/misc/crypt/crypt_prng_rng_descriptor.c +++ b/src/misc/crypt/crypt_prng_rng_descriptor.c @@ -10,4 +10,6 @@ */ #include "tomcrypt.h" +#ifdef LTC_PRNG_ENABLE_LTC_RNG unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void)); +#endif diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 7430febdb..28e8585ee 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -135,12 +135,14 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, LTC_ARGCHK(out != NULL); +#ifdef LTC_PRNG_ENABLE_LTC_RNG if (ltc_rng) { x = ltc_rng(out, outlen, callback); if (x != 0) { return x; } } +#endif #if defined(_WIN32) || defined(_WIN32_WCE) x = rng_win32(out, outlen, callback); if (x != 0) { return x; } diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 4aee85cdd..2d4700f31 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -302,6 +302,8 @@ static void _unregister_all(void) #endif } /* _cleanup() */ +#ifdef LTC_PRNG_ENABLE_LTC_RNG + static unsigned long my_test_rng_read; static unsigned long my_test_rng(unsigned char *buf, unsigned long len, @@ -316,6 +318,8 @@ static unsigned long my_test_rng(unsigned char *buf, unsigned long len, return n; } +#endif + void reg_algs(void) { unsigned long before; @@ -456,6 +460,7 @@ register_prng(&rc4_desc); register_prng(&sober128_desc); #endif +#ifdef LTC_PRNG_ENABLE_LTC_RNG ltc_rng = my_test_rng; before = my_test_rng_read; @@ -470,6 +475,7 @@ register_prng(&sober128_desc); } ltc_rng = NULL; +#endif if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err)); From 27f8e8bf75980d4ab329cde3d6aa7c00ffcb0448 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 15 Mar 2017 22:19:52 +0100 Subject: [PATCH 0532/1192] Update makefiles --- libtomcrypt_VS2005.vcproj | 4 ++++ libtomcrypt_VS2008.vcproj | 4 ++++ makefile | 4 ++-- makefile.icc | 4 ++-- makefile.mingw | 4 ++-- makefile.msvc | 4 ++-- makefile.shared | 4 ++-- makefile.unix | 4 ++-- 8 files changed, 20 insertions(+), 12 deletions(-) diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index 05649eba5..fb3a12b5a 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -1097,6 +1097,10 @@ RelativePath="src\misc\crypt\crypt_prng_is_valid.c" > + + diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index cf631df67..2d9f84f55 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -1099,6 +1099,10 @@ RelativePath="src\misc\crypt\crypt_prng_is_valid.c" > + + diff --git a/makefile b/makefile index df60f899d..b10e2cb05 100644 --- a/makefile +++ b/makefile @@ -95,8 +95,8 @@ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/c src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.icc b/makefile.icc index 97f192d96..1456dcc29 100644 --- a/makefile.icc +++ b/makefile.icc @@ -152,8 +152,8 @@ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/c src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.mingw b/makefile.mingw index 2aa473584..3af944e76 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -99,8 +99,8 @@ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/c src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.msvc b/makefile.msvc index 915d80468..5277a6702 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -57,8 +57,8 @@ src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/mi src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ -src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ -src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/misc/crypt/crypt_prng_rng_descriptor.obj src/misc/crypt/crypt_register_cipher.obj \ +src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pk_get_oid.obj src/misc/pkcs5/pkcs_5_1.obj \ diff --git a/makefile.shared b/makefile.shared index 8a2fdf000..b7e1e1969 100644 --- a/makefile.shared +++ b/makefile.shared @@ -85,8 +85,8 @@ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/c src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.unix b/makefile.unix index ff5880159..5b58c44cb 100644 --- a/makefile.unix +++ b/makefile.unix @@ -93,8 +93,8 @@ src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/c src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ From 15db3eab5933e4aebf13cb4dc3c5e8dda0c968d7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Mar 2017 20:04:02 +0100 Subject: [PATCH 0533/1192] fix travis failure --- testprof/x86_prof.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 2d4700f31..fe203a0a7 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -322,7 +322,9 @@ static unsigned long my_test_rng(unsigned char *buf, unsigned long len, void reg_algs(void) { +#ifdef LTC_PRNG_ENABLE_LTC_RNG unsigned long before; +#endif int err; atexit(_unregister_all); From b465881b585596e3fb384212606bfc074446bb59 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 24 Mar 2017 10:17:02 +0100 Subject: [PATCH 0534/1192] fix "declaration-after-statement" warnings (tests only) --- testprof/pkcs_1_eme_test.c | 2 +- testprof/pkcs_1_emsa_test.c | 2 +- testprof/pkcs_1_oaep_test.c | 2 +- testprof/pkcs_1_pss_test.c | 2 +- testprof/rsa_test.c | 12 ++++++++---- testprof/x86_prof.c | 10 +++++----- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/testprof/pkcs_1_eme_test.c b/testprof/pkcs_1_eme_test.c index da1818d8f..2950b2803 100644 --- a/testprof/pkcs_1_eme_test.c +++ b/testprof/pkcs_1_eme_test.c @@ -11,6 +11,7 @@ int pkcs_1_eme_test(void) int prng_idx = register_prng(&no_prng_desc); int hash_idx = find_hash("sha1"); unsigned int i; + unsigned int j; DO(prng_is_valid(prng_idx)); DO(hash_is_valid(hash_idx)); @@ -31,7 +32,6 @@ int pkcs_1_eme_test(void) DOX(mp_read_unsigned_bin(key->p, t->rsa.p, t->rsa.p_l), t->name); key->type = PK_PRIVATE; - unsigned int j; for (j = 0; j < sizeof(t->data)/sizeof(t->data[0]); ++j) { rsaData_t* s = &t->data[j]; unsigned char buf[256], obuf[256]; diff --git a/testprof/pkcs_1_emsa_test.c b/testprof/pkcs_1_emsa_test.c index c9941a89f..e6d2cc2b4 100644 --- a/testprof/pkcs_1_emsa_test.c +++ b/testprof/pkcs_1_emsa_test.c @@ -10,6 +10,7 @@ int pkcs_1_emsa_test(void) { int hash_idx = find_hash("sha1"); unsigned int i; + unsigned int j; DO(hash_is_valid(hash_idx)); @@ -29,7 +30,6 @@ int pkcs_1_emsa_test(void) DOX(mp_read_unsigned_bin(key->p, t->rsa.p, t->rsa.p_l), t->name); key->type = PK_PRIVATE; - unsigned int j; for (j = 0; j < sizeof(t->data)/sizeof(t->data[0]); ++j) { rsaData_t* s = &t->data[j]; unsigned char buf[20], obuf[256]; diff --git a/testprof/pkcs_1_oaep_test.c b/testprof/pkcs_1_oaep_test.c index bb606cff0..42a4dbd64 100644 --- a/testprof/pkcs_1_oaep_test.c +++ b/testprof/pkcs_1_oaep_test.c @@ -11,6 +11,7 @@ int pkcs_1_oaep_test(void) int prng_idx = register_prng(&no_prng_desc); int hash_idx = find_hash("sha1"); unsigned int i; + unsigned int j; DO(prng_is_valid(prng_idx)); DO(hash_is_valid(hash_idx)); @@ -31,7 +32,6 @@ int pkcs_1_oaep_test(void) DOX(mp_read_unsigned_bin(key->p, t->rsa.p, t->rsa.p_l), t->name); key->type = PK_PRIVATE; - unsigned int j; for (j = 0; j < sizeof(t->data)/sizeof(t->data[0]); ++j) { rsaData_t* s = &t->data[j]; unsigned char buf[256], obuf[256]; diff --git a/testprof/pkcs_1_pss_test.c b/testprof/pkcs_1_pss_test.c index fe3a126ad..d3363d8d0 100644 --- a/testprof/pkcs_1_pss_test.c +++ b/testprof/pkcs_1_pss_test.c @@ -11,6 +11,7 @@ int pkcs_1_pss_test(void) int prng_idx = register_prng(&no_prng_desc); int hash_idx = find_hash("sha1"); unsigned int i; + unsigned int j; DO(prng_is_valid(prng_idx)); DO(hash_is_valid(hash_idx)); @@ -31,7 +32,6 @@ int pkcs_1_pss_test(void) DOX(mp_read_unsigned_bin(key->p, t->rsa.p, t->rsa.p_l), t->name); key->type = PK_PRIVATE; - unsigned int j; for (j = 0; j < sizeof(t->data)/sizeof(t->data[0]); ++j) { rsaData_t* s = &t->data[j]; unsigned char buf[20], obuf[256]; diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 44272d880..c7f1dcbf8 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -200,6 +200,10 @@ int rsa_test(void) int hash_idx, prng_idx, stat, stat2, i, err; unsigned long rsa_msgsize, len, len2, len3, cnt, cnt2; static unsigned char lparam[] = { 0x01, 0x02, 0x03, 0x04 }; + void* dP; + unsigned char* p; + unsigned char* p2; + unsigned char* p3; if (rsa_compat_test() != 0) { return 1; @@ -388,7 +392,7 @@ for (cnt = 0; cnt < len; ) { /* verify with privKey but remove pointer to dP to test without CRT */ - void* dP = privKey.dP; + dP = privKey.dP; privKey.dP = NULL; /* change byte back to original */ in[0] ^= 1; @@ -470,9 +474,9 @@ for (cnt = 0; cnt < len; ) { * For all PS lengths: the result should not be valid */ - unsigned char* p = in; - unsigned char* p2 = out; - unsigned char* p3 = tmp; + p = in; + p2 = out; + p3 = tmp; for (i = 0; i < 9; ++i) { len = sizeof(in); len2 = sizeof(out); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index fe203a0a7..751644efd 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -526,16 +526,16 @@ int time_keysched(void) return 0; } +#ifdef LTC_ECB_MODE int time_cipher(void) { - fprintf(stderr, "\n\nECB Time Trials for the Symmetric Ciphers:\n"); -#ifdef LTC_ECB_MODE unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; symmetric_ECB ecb; unsigned char key[MAXBLOCKSIZE], pt[4096]; int err; + fprintf(stderr, "\n\nECB Time Trials for the Symmetric Ciphers:\n"); no_results = 0; for (x = 0; cipher_descriptor[x].name != NULL; x++) { ecb_start(x, key, cipher_descriptor[x].min_key_length, 0, &ecb); @@ -594,12 +594,12 @@ int time_cipher(void) #undef DO1 } tally_results(1); -#else - fprintf(stderr, "NOP"); -#endif return 0; } +#else +int time_cipher(void) { fprintf(stderr, "NO ECB\n"); return 0; } +#endif #ifdef LTC_CBC_MODE int time_cipher2(void) From ba338eced89a694df54b4c5fc57acf3b12c0e7c3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 23 Mar 2017 01:13:43 +0100 Subject: [PATCH 0535/1192] also build executables in makefile.shared from template --- makefile | 5 ----- makefile.include | 5 +++++ makefile.shared | 34 +++++++++++++--------------------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/makefile b/makefile index b10e2cb05..c6f006494 100644 --- a/makefile +++ b/makefile @@ -180,11 +180,6 @@ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS -DEMOS=hashsum crypt small tv_gen multi sizes constants - -TIMINGS=demos/timing.o -TESTS=demos/test.o - #Files left over from making the crypt.pdf. LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof diff --git a/makefile.include b/makefile.include index 4a3dac425..b64632056 100644 --- a/makefile.include +++ b/makefile.include @@ -81,6 +81,11 @@ TEST=test SIZES=sizes CONSTANTS=constants +DEMOS=hashsum crypt small tv_gen multi sizes constants + +TIMINGS=demos/timing.o +TESTS=demos/test.o + #LIBPATH-The directory for libtomcrypt to be installed to. #INCPATH-The directory to install the header files for libtomcrypt. #DATAPATH-The directory to install the pdf docs. diff --git a/makefile.shared b/makefile.shared index b7e1e1969..2b724441a 100644 --- a/makefile.shared +++ b/makefile.shared @@ -170,13 +170,6 @@ src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h #END_INS -HASHOBJECTS=demos/hashsum.o -CRYPTOBJECTS=demos/encrypt.o -SMALLOBJECTS=demos/small.o -TVS=demos/tv_gen.o -TESTS=demos/test.o -TIMINGS=demos/timing.o - #The default rule for make builds the libtomcrypt library. default:library @@ -220,19 +213,6 @@ install_test: testprof/$(LIBTEST) install -d $(DESTDIR)$(INCPATH) cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) LT=$(LT) CC=$(CC) make -f makefile.shared install -#This rule makes the hash program included with libtomcrypt -hashsum: library $(HASHOBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(HASH) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) - -#makes the crypt program -crypt: library $(CRYPTOBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(CRYPT) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) - -small: library $(SMALLOBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(SMALL) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) - -tv_gen: library $(TVS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TV) $(TVS) $(LIBNAME) $(EXTRALIBS) .PHONY: test test: library testprof/$(LIBTEST) $(TESTS) @@ -241,7 +221,19 @@ test: library testprof/$(LIBTEST) $(TESTS) timing: library testprof/$(LIBTEST) $(TIMINGS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -all_test: test tv_gen hashsum crypt small timing + +# build the demos from a template +define DEMO_template +$(1): demos/$(1).o library +ifneq ($V,1) + @echo " * $${CC} $$@" +endif + $$(LT) --mode=link --tag=CC $$(CC) $$(CFLAGS) $$(CPPFLAGS) $$(LDFLAGS) -o $(1) $$< $$(LIBNAME) $$(EXTRALIBS) +endef + +$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) + +all_test: test tv_gen $(DEMOS) # $Source$ # $Revision$ From ea355dbc7953a008b9e4fd155c97f4a471520a58 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 24 Mar 2017 16:58:04 +0100 Subject: [PATCH 0536/1192] there's no reason to disable DH when using GMP as MPI provider --- src/headers/tomcrypt_custom.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 6d6f4f33b..fda79f770 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -343,7 +343,6 @@ #define LTC_MRSA /* Include Diffie-Hellman support */ -#ifndef GMP_DESC /* is_prime fails for GMP */ #define LTC_MDH /* Supported Key Sizes */ @@ -360,7 +359,6 @@ #define LTC_DH3072 #define LTC_DH4096 #endif -#endif /* Include Katja (a Rabin variant like RSA) */ /* #define LTC_MKAT */ From 7885c91af3a5fb653e2f2640afb2724c24314df1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 26 Mar 2017 15:46:41 +0200 Subject: [PATCH 0537/1192] print math provider when running tests --- demos/test.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/demos/test.c b/demos/test.c index 23e8be1f3..0892032e3 100644 --- a/demos/test.c +++ b/demos/test.c @@ -31,18 +31,22 @@ int main(void) size_t fn_len, i, dots; reg_algs(); + printf("build == \n%s\n", crypt_build_settings); + #ifdef USE_LTM ltc_mp = ltm_desc; + printf("math provider = libtommath\n"); #elif defined(USE_TFM) ltc_mp = tfm_desc; + printf("math provider = tomsfastmath\n"); #elif defined(USE_GMP) ltc_mp = gmp_desc; + printf("math provider = gnump\n"); #else extern ltc_math_descriptor EXT_MATH_LIB; ltc_mp = EXT_MATH_LIB; + printf("math provider = EXT_MATH_LIB\n"); #endif - - printf("build == \n%s\n", crypt_build_settings); printf("MP_DIGIT_BIT = %d\n", MP_DIGIT_BIT); fn_len = 0; From 101a7a71ae1d63a2284b89b86664f011c463bc68 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 26 Mar 2017 19:30:18 +0200 Subject: [PATCH 0538/1192] enable -Wdeclaration-after-statement by default --- makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile.include b/makefile.include index b64632056..4d710004e 100644 --- a/makefile.include +++ b/makefile.include @@ -35,7 +35,7 @@ CFLAGS += -Wextra # additional warnings CFLAGS += -Wsystem-headers -Wbad-function-cast -Wcast-align CFLAGS += -Wstrict-prototypes -Wpointer-arith -#CFLAGS += -Wdeclaration-after-statement +CFLAGS += -Wdeclaration-after-statement endif CFLAGS += -Wno-type-limits From 862a02767d2df1466733b2a2f59b2de86ed8a98d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 26 Mar 2017 21:38:02 +0200 Subject: [PATCH 0539/1192] fix constants and sizes demo --- demos/constants.c | 4 ++-- demos/sizes.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/constants.c b/demos/constants.c index ffa223e6b..841995724 100644 --- a/demos/constants.c +++ b/demos/constants.c @@ -24,14 +24,14 @@ int main(void) { /* given a specific constant name, get and print its value */ char name[] = "CTR_COUNTER_BIG_ENDIAN"; int value; + char *names_list; + unsigned int names_list_len; if (crypt_get_constant(name, &value) != 0) exit(EXIT_FAILURE); printf("\n %s is %d \n\n", name, value); /* get and print the length of the names (and values) list */ - char *names_list; - unsigned int names_list_len; if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE); diff --git a/demos/sizes.c b/demos/sizes.c index b544372b8..88463646c 100644 --- a/demos/sizes.c +++ b/demos/sizes.c @@ -23,13 +23,13 @@ int main(void) { /* given a specific size name, get and print its size */ char name[] = "ecc_key"; unsigned int size; + char *sizes_list; + unsigned int sizes_list_len; if(crypt_get_size(name, &size) != 0) exit(EXIT_FAILURE); printf("\n size of '%s' is %u \n\n", name, size); /* get and print the length of the names (and sizes) list */ - char *sizes_list; - unsigned int sizes_list_len; if(crypt_list_all_sizes(NULL, &sizes_list_len) != 0) exit(EXIT_FAILURE); printf(" need to allocate %u bytes \n\n", sizes_list_len); From e5aa2bd4537243868e0c5eb232e3afbf1cfb804b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 27 Mar 2017 19:32:05 +0200 Subject: [PATCH 0540/1192] added rotate_test --- demos/test.c | 1 + testprof/makefile | 2 +- testprof/makefile.icc | 2 +- testprof/makefile.mingw | 2 +- testprof/makefile.msvc | 2 +- testprof/makefile.shared | 2 +- testprof/rotate_test.c | 404 +++++++++++++++++++++++++++++++++++++++ testprof/tomcrypt_test.h | 1 + 8 files changed, 411 insertions(+), 5 deletions(-) create mode 100644 testprof/rotate_test.c diff --git a/demos/test.c b/demos/test.c index 0892032e3..c93a69005 100644 --- a/demos/test.c +++ b/demos/test.c @@ -8,6 +8,7 @@ static const struct { } test_functions[] = { LTC_TEST_FN(store_test), + LTC_TEST_FN(rotate_test), LTC_TEST_FN(misc_test), LTC_TEST_FN(cipher_hash_test), LTC_TEST_FN(mac_test), diff --git a/testprof/makefile b/testprof/makefile index 65ac817e0..25f805b41 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -19,7 +19,7 @@ endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ +store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o ifndef LIBTEST_S diff --git a/testprof/makefile.icc b/testprof/makefile.icc index f80cd1d9e..c60e257c2 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -3,7 +3,7 @@ CC?=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ +store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o ifndef LIBTEST_S diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index 5ab7b5991..347116d6f 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -6,7 +6,7 @@ CFLAGS = $(CFLAGS_OPTS) -W -I../src/headers -I. -Wall -W OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o \ +store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o \ pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o default: $(LIBTEST_S) diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index 9f917e827..617a162e2 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -2,7 +2,7 @@ CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ -rsa_test.obj store_test.obj test_driver.obj x86_prof.obj katja_test.obj \ +rsa_test.obj store_test.obj rotate_test.obj test_driver.obj x86_prof.obj katja_test.obj \ dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj \ pkcs_1_emsa_test.obj pkcs_1_eme_test.obj diff --git a/testprof/makefile.shared b/testprof/makefile.shared index 35ade9ee1..35620e5cd 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -8,7 +8,7 @@ CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-par OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ +store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o ifndef LIBTEST diff --git a/testprof/rotate_test.c b/testprof/rotate_test.c new file mode 100644 index 000000000..870e2db8a --- /dev/null +++ b/testprof/rotate_test.c @@ -0,0 +1,404 @@ +#include + +/* Test rotate macros */ +int rotate_test(void) +{ + ulong32 L32 = 0x12345678UL; + ulong64 L64 = CONST64(0x1122334455667788); + int err = 0; + + /* ROR */ + if (ROR(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROR 0 failed\n"); err++; } + if (ROR(L32, 1 ) != 0x091a2b3cUL) { fprintf(stderr, "ROR 1 failed\n"); err++; } + if (ROR(L32, 2 ) != 0x048d159eUL) { fprintf(stderr, "ROR 2 failed\n"); err++; } + if (ROR(L32, 3 ) != 0x02468acfUL) { fprintf(stderr, "ROR 3 failed\n"); err++; } + if (ROR(L32, 4 ) != 0x81234567UL) { fprintf(stderr, "ROR 4 failed\n"); err++; } + if (ROR(L32, 5 ) != 0xc091a2b3UL) { fprintf(stderr, "ROR 5 failed\n"); err++; } + if (ROR(L32, 6 ) != 0xe048d159UL) { fprintf(stderr, "ROR 6 failed\n"); err++; } + if (ROR(L32, 7 ) != 0xf02468acUL) { fprintf(stderr, "ROR 7 failed\n"); err++; } + if (ROR(L32, 8 ) != 0x78123456UL) { fprintf(stderr, "ROR 8 failed\n"); err++; } + if (ROR(L32, 9 ) != 0x3c091a2bUL) { fprintf(stderr, "ROR 9 failed\n"); err++; } + if (ROR(L32, 10) != 0x9e048d15UL) { fprintf(stderr, "ROR 10 failed\n"); err++; } + if (ROR(L32, 11) != 0xcf02468aUL) { fprintf(stderr, "ROR 11 failed\n"); err++; } + if (ROR(L32, 12) != 0x67812345UL) { fprintf(stderr, "ROR 12 failed\n"); err++; } + if (ROR(L32, 13) != 0xb3c091a2UL) { fprintf(stderr, "ROR 13 failed\n"); err++; } + if (ROR(L32, 14) != 0x59e048d1UL) { fprintf(stderr, "ROR 14 failed\n"); err++; } + if (ROR(L32, 15) != 0xacf02468UL) { fprintf(stderr, "ROR 15 failed\n"); err++; } + if (ROR(L32, 16) != 0x56781234UL) { fprintf(stderr, "ROR 16 failed\n"); err++; } + if (ROR(L32, 17) != 0x2b3c091aUL) { fprintf(stderr, "ROR 17 failed\n"); err++; } + if (ROR(L32, 18) != 0x159e048dUL) { fprintf(stderr, "ROR 18 failed\n"); err++; } + if (ROR(L32, 19) != 0x8acf0246UL) { fprintf(stderr, "ROR 19 failed\n"); err++; } + if (ROR(L32, 20) != 0x45678123UL) { fprintf(stderr, "ROR 20 failed\n"); err++; } + if (ROR(L32, 21) != 0xa2b3c091UL) { fprintf(stderr, "ROR 21 failed\n"); err++; } + if (ROR(L32, 22) != 0xd159e048UL) { fprintf(stderr, "ROR 22 failed\n"); err++; } + if (ROR(L32, 23) != 0x68acf024UL) { fprintf(stderr, "ROR 23 failed\n"); err++; } + if (ROR(L32, 24) != 0x34567812UL) { fprintf(stderr, "ROR 24 failed\n"); err++; } + if (ROR(L32, 25) != 0x1a2b3c09UL) { fprintf(stderr, "ROR 25 failed\n"); err++; } + if (ROR(L32, 26) != 0x8d159e04UL) { fprintf(stderr, "ROR 26 failed\n"); err++; } + if (ROR(L32, 27) != 0x468acf02UL) { fprintf(stderr, "ROR 27 failed\n"); err++; } + if (ROR(L32, 28) != 0x23456781UL) { fprintf(stderr, "ROR 28 failed\n"); err++; } + if (ROR(L32, 29) != 0x91a2b3c0UL) { fprintf(stderr, "ROR 29 failed\n"); err++; } + if (ROR(L32, 30) != 0x48d159e0UL) { fprintf(stderr, "ROR 30 failed\n"); err++; } + if (ROR(L32, 31) != 0x2468acf0UL) { fprintf(stderr, "ROR 31 failed\n"); err++; } + /* ROR64 */ + if (ROR64(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64 0 failed\n"); err++; } + if (ROR64(L64, 1 ) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROR64 1 failed\n"); err++; } + if (ROR64(L64, 2 ) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROR64 2 failed\n"); err++; } + if (ROR64(L64, 3 ) != CONST64(0x022446688aaccef1)) { fprintf(stderr, "ROR64 3 failed\n"); err++; } + if (ROR64(L64, 4 ) != CONST64(0x8112233445566778)) { fprintf(stderr, "ROR64 4 failed\n"); err++; } + if (ROR64(L64, 5 ) != CONST64(0x4089119a22ab33bc)) { fprintf(stderr, "ROR64 5 failed\n"); err++; } + if (ROR64(L64, 6 ) != CONST64(0x204488cd115599de)) { fprintf(stderr, "ROR64 6 failed\n"); err++; } + if (ROR64(L64, 7 ) != CONST64(0x1022446688aaccef)) { fprintf(stderr, "ROR64 7 failed\n"); err++; } + if (ROR64(L64, 8 ) != CONST64(0x8811223344556677)) { fprintf(stderr, "ROR64 8 failed\n"); err++; } + if (ROR64(L64, 9 ) != CONST64(0xc4089119a22ab33b)) { fprintf(stderr, "ROR64 9 failed\n"); err++; } + if (ROR64(L64, 10) != CONST64(0xe204488cd115599d)) { fprintf(stderr, "ROR64 10 failed\n"); err++; } + if (ROR64(L64, 11) != CONST64(0xf1022446688aacce)) { fprintf(stderr, "ROR64 11 failed\n"); err++; } + if (ROR64(L64, 12) != CONST64(0x7881122334455667)) { fprintf(stderr, "ROR64 12 failed\n"); err++; } + if (ROR64(L64, 13) != CONST64(0xbc4089119a22ab33)) { fprintf(stderr, "ROR64 13 failed\n"); err++; } + if (ROR64(L64, 14) != CONST64(0xde204488cd115599)) { fprintf(stderr, "ROR64 14 failed\n"); err++; } + if (ROR64(L64, 15) != CONST64(0xef1022446688aacc)) { fprintf(stderr, "ROR64 15 failed\n"); err++; } + if (ROR64(L64, 16) != CONST64(0x7788112233445566)) { fprintf(stderr, "ROR64 16 failed\n"); err++; } + if (ROR64(L64, 17) != CONST64(0x3bc4089119a22ab3)) { fprintf(stderr, "ROR64 17 failed\n"); err++; } + if (ROR64(L64, 18) != CONST64(0x9de204488cd11559)) { fprintf(stderr, "ROR64 18 failed\n"); err++; } + if (ROR64(L64, 19) != CONST64(0xcef1022446688aac)) { fprintf(stderr, "ROR64 19 failed\n"); err++; } + if (ROR64(L64, 20) != CONST64(0x6778811223344556)) { fprintf(stderr, "ROR64 20 failed\n"); err++; } + if (ROR64(L64, 21) != CONST64(0x33bc4089119a22ab)) { fprintf(stderr, "ROR64 21 failed\n"); err++; } + if (ROR64(L64, 22) != CONST64(0x99de204488cd1155)) { fprintf(stderr, "ROR64 22 failed\n"); err++; } + if (ROR64(L64, 23) != CONST64(0xccef1022446688aa)) { fprintf(stderr, "ROR64 23 failed\n"); err++; } + if (ROR64(L64, 24) != CONST64(0x6677881122334455)) { fprintf(stderr, "ROR64 24 failed\n"); err++; } + if (ROR64(L64, 25) != CONST64(0xb33bc4089119a22a)) { fprintf(stderr, "ROR64 25 failed\n"); err++; } + if (ROR64(L64, 26) != CONST64(0x599de204488cd115)) { fprintf(stderr, "ROR64 26 failed\n"); err++; } + if (ROR64(L64, 27) != CONST64(0xaccef1022446688a)) { fprintf(stderr, "ROR64 27 failed\n"); err++; } + if (ROR64(L64, 28) != CONST64(0x5667788112233445)) { fprintf(stderr, "ROR64 28 failed\n"); err++; } + if (ROR64(L64, 29) != CONST64(0xab33bc4089119a22)) { fprintf(stderr, "ROR64 29 failed\n"); err++; } + if (ROR64(L64, 30) != CONST64(0x5599de204488cd11)) { fprintf(stderr, "ROR64 30 failed\n"); err++; } + if (ROR64(L64, 31) != CONST64(0xaaccef1022446688)) { fprintf(stderr, "ROR64 31 failed\n"); err++; } + if (ROR64(L64, 32) != CONST64(0x5566778811223344)) { fprintf(stderr, "ROR64 32 failed\n"); err++; } + if (ROR64(L64, 33) != CONST64(0x2ab33bc4089119a2)) { fprintf(stderr, "ROR64 33 failed\n"); err++; } + if (ROR64(L64, 34) != CONST64(0x15599de204488cd1)) { fprintf(stderr, "ROR64 34 failed\n"); err++; } + if (ROR64(L64, 35) != CONST64(0x8aaccef102244668)) { fprintf(stderr, "ROR64 35 failed\n"); err++; } + if (ROR64(L64, 36) != CONST64(0x4556677881122334)) { fprintf(stderr, "ROR64 36 failed\n"); err++; } + if (ROR64(L64, 37) != CONST64(0x22ab33bc4089119a)) { fprintf(stderr, "ROR64 37 failed\n"); err++; } + if (ROR64(L64, 38) != CONST64(0x115599de204488cd)) { fprintf(stderr, "ROR64 38 failed\n"); err++; } + if (ROR64(L64, 39) != CONST64(0x88aaccef10224466)) { fprintf(stderr, "ROR64 39 failed\n"); err++; } + if (ROR64(L64, 40) != CONST64(0x4455667788112233)) { fprintf(stderr, "ROR64 40 failed\n"); err++; } + if (ROR64(L64, 41) != CONST64(0xa22ab33bc4089119)) { fprintf(stderr, "ROR64 41 failed\n"); err++; } + if (ROR64(L64, 42) != CONST64(0xd115599de204488c)) { fprintf(stderr, "ROR64 42 failed\n"); err++; } + if (ROR64(L64, 43) != CONST64(0x688aaccef1022446)) { fprintf(stderr, "ROR64 43 failed\n"); err++; } + if (ROR64(L64, 44) != CONST64(0x3445566778811223)) { fprintf(stderr, "ROR64 44 failed\n"); err++; } + if (ROR64(L64, 45) != CONST64(0x9a22ab33bc408911)) { fprintf(stderr, "ROR64 45 failed\n"); err++; } + if (ROR64(L64, 46) != CONST64(0xcd115599de204488)) { fprintf(stderr, "ROR64 46 failed\n"); err++; } + if (ROR64(L64, 47) != CONST64(0x6688aaccef102244)) { fprintf(stderr, "ROR64 47 failed\n"); err++; } + if (ROR64(L64, 48) != CONST64(0x3344556677881122)) { fprintf(stderr, "ROR64 48 failed\n"); err++; } + if (ROR64(L64, 49) != CONST64(0x19a22ab33bc40891)) { fprintf(stderr, "ROR64 49 failed\n"); err++; } + if (ROR64(L64, 50) != CONST64(0x8cd115599de20448)) { fprintf(stderr, "ROR64 50 failed\n"); err++; } + if (ROR64(L64, 51) != CONST64(0x46688aaccef10224)) { fprintf(stderr, "ROR64 51 failed\n"); err++; } + if (ROR64(L64, 52) != CONST64(0x2334455667788112)) { fprintf(stderr, "ROR64 52 failed\n"); err++; } + if (ROR64(L64, 53) != CONST64(0x119a22ab33bc4089)) { fprintf(stderr, "ROR64 53 failed\n"); err++; } + if (ROR64(L64, 54) != CONST64(0x88cd115599de2044)) { fprintf(stderr, "ROR64 54 failed\n"); err++; } + if (ROR64(L64, 55) != CONST64(0x446688aaccef1022)) { fprintf(stderr, "ROR64 55 failed\n"); err++; } + if (ROR64(L64, 56) != CONST64(0x2233445566778811)) { fprintf(stderr, "ROR64 56 failed\n"); err++; } + if (ROR64(L64, 57) != CONST64(0x9119a22ab33bc408)) { fprintf(stderr, "ROR64 57 failed\n"); err++; } + if (ROR64(L64, 58) != CONST64(0x488cd115599de204)) { fprintf(stderr, "ROR64 58 failed\n"); err++; } + if (ROR64(L64, 59) != CONST64(0x2446688aaccef102)) { fprintf(stderr, "ROR64 59 failed\n"); err++; } + if (ROR64(L64, 60) != CONST64(0x1223344556677881)) { fprintf(stderr, "ROR64 60 failed\n"); err++; } + if (ROR64(L64, 61) != CONST64(0x89119a22ab33bc40)) { fprintf(stderr, "ROR64 61 failed\n"); err++; } + if (ROR64(L64, 62) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROR64 62 failed\n"); err++; } + if (ROR64(L64, 63) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROR64 63 failed\n"); err++; } + /* ROL */ + if (ROL(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROL 0 failed\n"); err++; } + if (ROL(L32, 1 ) != 0x2468acf0UL) { fprintf(stderr, "ROL 1 failed\n"); err++; } + if (ROL(L32, 2 ) != 0x48d159e0UL) { fprintf(stderr, "ROL 2 failed\n"); err++; } + if (ROL(L32, 3 ) != 0x91a2b3c0UL) { fprintf(stderr, "ROL 3 failed\n"); err++; } + if (ROL(L32, 4 ) != 0x23456781UL) { fprintf(stderr, "ROL 4 failed\n"); err++; } + if (ROL(L32, 5 ) != 0x468acf02UL) { fprintf(stderr, "ROL 5 failed\n"); err++; } + if (ROL(L32, 6 ) != 0x8d159e04UL) { fprintf(stderr, "ROL 6 failed\n"); err++; } + if (ROL(L32, 7 ) != 0x1a2b3c09UL) { fprintf(stderr, "ROL 7 failed\n"); err++; } + if (ROL(L32, 8 ) != 0x34567812UL) { fprintf(stderr, "ROL 8 failed\n"); err++; } + if (ROL(L32, 9 ) != 0x68acf024UL) { fprintf(stderr, "ROL 9 failed\n"); err++; } + if (ROL(L32, 10) != 0xd159e048UL) { fprintf(stderr, "ROL 10 failed\n"); err++; } + if (ROL(L32, 11) != 0xa2b3c091UL) { fprintf(stderr, "ROL 11 failed\n"); err++; } + if (ROL(L32, 12) != 0x45678123UL) { fprintf(stderr, "ROL 12 failed\n"); err++; } + if (ROL(L32, 13) != 0x8acf0246UL) { fprintf(stderr, "ROL 13 failed\n"); err++; } + if (ROL(L32, 14) != 0x159e048dUL) { fprintf(stderr, "ROL 14 failed\n"); err++; } + if (ROL(L32, 15) != 0x2b3c091aUL) { fprintf(stderr, "ROL 15 failed\n"); err++; } + if (ROL(L32, 16) != 0x56781234UL) { fprintf(stderr, "ROL 16 failed\n"); err++; } + if (ROL(L32, 17) != 0xacf02468UL) { fprintf(stderr, "ROL 17 failed\n"); err++; } + if (ROL(L32, 18) != 0x59e048d1UL) { fprintf(stderr, "ROL 18 failed\n"); err++; } + if (ROL(L32, 19) != 0xb3c091a2UL) { fprintf(stderr, "ROL 19 failed\n"); err++; } + if (ROL(L32, 20) != 0x67812345UL) { fprintf(stderr, "ROL 20 failed\n"); err++; } + if (ROL(L32, 21) != 0xcf02468aUL) { fprintf(stderr, "ROL 21 failed\n"); err++; } + if (ROL(L32, 22) != 0x9e048d15UL) { fprintf(stderr, "ROL 22 failed\n"); err++; } + if (ROL(L32, 23) != 0x3c091a2bUL) { fprintf(stderr, "ROL 23 failed\n"); err++; } + if (ROL(L32, 24) != 0x78123456UL) { fprintf(stderr, "ROL 24 failed\n"); err++; } + if (ROL(L32, 25) != 0xf02468acUL) { fprintf(stderr, "ROL 25 failed\n"); err++; } + if (ROL(L32, 26) != 0xe048d159UL) { fprintf(stderr, "ROL 26 failed\n"); err++; } + if (ROL(L32, 27) != 0xc091a2b3UL) { fprintf(stderr, "ROL 27 failed\n"); err++; } + if (ROL(L32, 28) != 0x81234567UL) { fprintf(stderr, "ROL 28 failed\n"); err++; } + if (ROL(L32, 29) != 0x02468acfUL) { fprintf(stderr, "ROL 29 failed\n"); err++; } + if (ROL(L32, 30) != 0x048d159eUL) { fprintf(stderr, "ROL 30 failed\n"); err++; } + if (ROL(L32, 31) != 0x091a2b3cUL) { fprintf(stderr, "ROL 31 failed\n"); err++; } + /* ROL64 */ + if (ROL64(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64 0 failed\n"); err++; } + if (ROL64(L64, 1 ) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROL64 1 failed\n"); err++; } + if (ROL64(L64, 2 ) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROL64 2 failed\n"); err++; } + if (ROL64(L64, 3 ) != CONST64(0x89119a22ab33bc40)) { fprintf(stderr, "ROL64 3 failed\n"); err++; } + if (ROL64(L64, 4 ) != CONST64(0x1223344556677881)) { fprintf(stderr, "ROL64 4 failed\n"); err++; } + if (ROL64(L64, 5 ) != CONST64(0x2446688aaccef102)) { fprintf(stderr, "ROL64 5 failed\n"); err++; } + if (ROL64(L64, 6 ) != CONST64(0x488cd115599de204)) { fprintf(stderr, "ROL64 6 failed\n"); err++; } + if (ROL64(L64, 7 ) != CONST64(0x9119a22ab33bc408)) { fprintf(stderr, "ROL64 7 failed\n"); err++; } + if (ROL64(L64, 8 ) != CONST64(0x2233445566778811)) { fprintf(stderr, "ROL64 8 failed\n"); err++; } + if (ROL64(L64, 9 ) != CONST64(0x446688aaccef1022)) { fprintf(stderr, "ROL64 9 failed\n"); err++; } + if (ROL64(L64, 10) != CONST64(0x88cd115599de2044)) { fprintf(stderr, "ROL64 10 failed\n"); err++; } + if (ROL64(L64, 11) != CONST64(0x119a22ab33bc4089)) { fprintf(stderr, "ROL64 11 failed\n"); err++; } + if (ROL64(L64, 12) != CONST64(0x2334455667788112)) { fprintf(stderr, "ROL64 12 failed\n"); err++; } + if (ROL64(L64, 13) != CONST64(0x46688aaccef10224)) { fprintf(stderr, "ROL64 13 failed\n"); err++; } + if (ROL64(L64, 14) != CONST64(0x8cd115599de20448)) { fprintf(stderr, "ROL64 14 failed\n"); err++; } + if (ROL64(L64, 15) != CONST64(0x19a22ab33bc40891)) { fprintf(stderr, "ROL64 15 failed\n"); err++; } + if (ROL64(L64, 16) != CONST64(0x3344556677881122)) { fprintf(stderr, "ROL64 16 failed\n"); err++; } + if (ROL64(L64, 17) != CONST64(0x6688aaccef102244)) { fprintf(stderr, "ROL64 17 failed\n"); err++; } + if (ROL64(L64, 18) != CONST64(0xcd115599de204488)) { fprintf(stderr, "ROL64 18 failed\n"); err++; } + if (ROL64(L64, 19) != CONST64(0x9a22ab33bc408911)) { fprintf(stderr, "ROL64 19 failed\n"); err++; } + if (ROL64(L64, 20) != CONST64(0x3445566778811223)) { fprintf(stderr, "ROL64 20 failed\n"); err++; } + if (ROL64(L64, 21) != CONST64(0x688aaccef1022446)) { fprintf(stderr, "ROL64 21 failed\n"); err++; } + if (ROL64(L64, 22) != CONST64(0xd115599de204488c)) { fprintf(stderr, "ROL64 22 failed\n"); err++; } + if (ROL64(L64, 23) != CONST64(0xa22ab33bc4089119)) { fprintf(stderr, "ROL64 23 failed\n"); err++; } + if (ROL64(L64, 24) != CONST64(0x4455667788112233)) { fprintf(stderr, "ROL64 24 failed\n"); err++; } + if (ROL64(L64, 25) != CONST64(0x88aaccef10224466)) { fprintf(stderr, "ROL64 25 failed\n"); err++; } + if (ROL64(L64, 26) != CONST64(0x115599de204488cd)) { fprintf(stderr, "ROL64 26 failed\n"); err++; } + if (ROL64(L64, 27) != CONST64(0x22ab33bc4089119a)) { fprintf(stderr, "ROL64 27 failed\n"); err++; } + if (ROL64(L64, 28) != CONST64(0x4556677881122334)) { fprintf(stderr, "ROL64 28 failed\n"); err++; } + if (ROL64(L64, 29) != CONST64(0x8aaccef102244668)) { fprintf(stderr, "ROL64 29 failed\n"); err++; } + if (ROL64(L64, 30) != CONST64(0x15599de204488cd1)) { fprintf(stderr, "ROL64 30 failed\n"); err++; } + if (ROL64(L64, 31) != CONST64(0x2ab33bc4089119a2)) { fprintf(stderr, "ROL64 31 failed\n"); err++; } + if (ROL64(L64, 32) != CONST64(0x5566778811223344)) { fprintf(stderr, "ROL64 32 failed\n"); err++; } + if (ROL64(L64, 33) != CONST64(0xaaccef1022446688)) { fprintf(stderr, "ROL64 33 failed\n"); err++; } + if (ROL64(L64, 34) != CONST64(0x5599de204488cd11)) { fprintf(stderr, "ROL64 34 failed\n"); err++; } + if (ROL64(L64, 35) != CONST64(0xab33bc4089119a22)) { fprintf(stderr, "ROL64 35 failed\n"); err++; } + if (ROL64(L64, 36) != CONST64(0x5667788112233445)) { fprintf(stderr, "ROL64 36 failed\n"); err++; } + if (ROL64(L64, 37) != CONST64(0xaccef1022446688a)) { fprintf(stderr, "ROL64 37 failed\n"); err++; } + if (ROL64(L64, 38) != CONST64(0x599de204488cd115)) { fprintf(stderr, "ROL64 38 failed\n"); err++; } + if (ROL64(L64, 39) != CONST64(0xb33bc4089119a22a)) { fprintf(stderr, "ROL64 39 failed\n"); err++; } + if (ROL64(L64, 40) != CONST64(0x6677881122334455)) { fprintf(stderr, "ROL64 40 failed\n"); err++; } + if (ROL64(L64, 41) != CONST64(0xccef1022446688aa)) { fprintf(stderr, "ROL64 41 failed\n"); err++; } + if (ROL64(L64, 42) != CONST64(0x99de204488cd1155)) { fprintf(stderr, "ROL64 42 failed\n"); err++; } + if (ROL64(L64, 43) != CONST64(0x33bc4089119a22ab)) { fprintf(stderr, "ROL64 43 failed\n"); err++; } + if (ROL64(L64, 44) != CONST64(0x6778811223344556)) { fprintf(stderr, "ROL64 44 failed\n"); err++; } + if (ROL64(L64, 45) != CONST64(0xcef1022446688aac)) { fprintf(stderr, "ROL64 45 failed\n"); err++; } + if (ROL64(L64, 46) != CONST64(0x9de204488cd11559)) { fprintf(stderr, "ROL64 46 failed\n"); err++; } + if (ROL64(L64, 47) != CONST64(0x3bc4089119a22ab3)) { fprintf(stderr, "ROL64 47 failed\n"); err++; } + if (ROL64(L64, 48) != CONST64(0x7788112233445566)) { fprintf(stderr, "ROL64 48 failed\n"); err++; } + if (ROL64(L64, 49) != CONST64(0xef1022446688aacc)) { fprintf(stderr, "ROL64 49 failed\n"); err++; } + if (ROL64(L64, 50) != CONST64(0xde204488cd115599)) { fprintf(stderr, "ROL64 50 failed\n"); err++; } + if (ROL64(L64, 51) != CONST64(0xbc4089119a22ab33)) { fprintf(stderr, "ROL64 51 failed\n"); err++; } + if (ROL64(L64, 52) != CONST64(0x7881122334455667)) { fprintf(stderr, "ROL64 52 failed\n"); err++; } + if (ROL64(L64, 53) != CONST64(0xf1022446688aacce)) { fprintf(stderr, "ROL64 53 failed\n"); err++; } + if (ROL64(L64, 54) != CONST64(0xe204488cd115599d)) { fprintf(stderr, "ROL64 54 failed\n"); err++; } + if (ROL64(L64, 55) != CONST64(0xc4089119a22ab33b)) { fprintf(stderr, "ROL64 55 failed\n"); err++; } + if (ROL64(L64, 56) != CONST64(0x8811223344556677)) { fprintf(stderr, "ROL64 56 failed\n"); err++; } + if (ROL64(L64, 57) != CONST64(0x1022446688aaccef)) { fprintf(stderr, "ROL64 57 failed\n"); err++; } + if (ROL64(L64, 58) != CONST64(0x204488cd115599de)) { fprintf(stderr, "ROL64 58 failed\n"); err++; } + if (ROL64(L64, 59) != CONST64(0x4089119a22ab33bc)) { fprintf(stderr, "ROL64 59 failed\n"); err++; } + if (ROL64(L64, 60) != CONST64(0x8112233445566778)) { fprintf(stderr, "ROL64 60 failed\n"); err++; } + if (ROL64(L64, 61) != CONST64(0x022446688aaccef1)) { fprintf(stderr, "ROL64 61 failed\n"); err++; } + if (ROL64(L64, 62) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROL64 62 failed\n"); err++; } + if (ROL64(L64, 63) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROL64 63 failed\n"); err++; } + /* RORc */ + if (RORc(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "RORc 0 failed\n"); err++; } + if (RORc(L32, 1 ) != 0x091a2b3cUL) { fprintf(stderr, "RORc 1 failed\n"); err++; } + if (RORc(L32, 2 ) != 0x048d159eUL) { fprintf(stderr, "RORc 2 failed\n"); err++; } + if (RORc(L32, 3 ) != 0x02468acfUL) { fprintf(stderr, "RORc 3 failed\n"); err++; } + if (RORc(L32, 4 ) != 0x81234567UL) { fprintf(stderr, "RORc 4 failed\n"); err++; } + if (RORc(L32, 5 ) != 0xc091a2b3UL) { fprintf(stderr, "RORc 5 failed\n"); err++; } + if (RORc(L32, 6 ) != 0xe048d159UL) { fprintf(stderr, "RORc 6 failed\n"); err++; } + if (RORc(L32, 7 ) != 0xf02468acUL) { fprintf(stderr, "RORc 7 failed\n"); err++; } + if (RORc(L32, 8 ) != 0x78123456UL) { fprintf(stderr, "RORc 8 failed\n"); err++; } + if (RORc(L32, 9 ) != 0x3c091a2bUL) { fprintf(stderr, "RORc 9 failed\n"); err++; } + if (RORc(L32, 10) != 0x9e048d15UL) { fprintf(stderr, "RORc 10 failed\n"); err++; } + if (RORc(L32, 11) != 0xcf02468aUL) { fprintf(stderr, "RORc 11 failed\n"); err++; } + if (RORc(L32, 12) != 0x67812345UL) { fprintf(stderr, "RORc 12 failed\n"); err++; } + if (RORc(L32, 13) != 0xb3c091a2UL) { fprintf(stderr, "RORc 13 failed\n"); err++; } + if (RORc(L32, 14) != 0x59e048d1UL) { fprintf(stderr, "RORc 14 failed\n"); err++; } + if (RORc(L32, 15) != 0xacf02468UL) { fprintf(stderr, "RORc 15 failed\n"); err++; } + if (RORc(L32, 16) != 0x56781234UL) { fprintf(stderr, "RORc 16 failed\n"); err++; } + if (RORc(L32, 17) != 0x2b3c091aUL) { fprintf(stderr, "RORc 17 failed\n"); err++; } + if (RORc(L32, 18) != 0x159e048dUL) { fprintf(stderr, "RORc 18 failed\n"); err++; } + if (RORc(L32, 19) != 0x8acf0246UL) { fprintf(stderr, "RORc 19 failed\n"); err++; } + if (RORc(L32, 20) != 0x45678123UL) { fprintf(stderr, "RORc 20 failed\n"); err++; } + if (RORc(L32, 21) != 0xa2b3c091UL) { fprintf(stderr, "RORc 21 failed\n"); err++; } + if (RORc(L32, 22) != 0xd159e048UL) { fprintf(stderr, "RORc 22 failed\n"); err++; } + if (RORc(L32, 23) != 0x68acf024UL) { fprintf(stderr, "RORc 23 failed\n"); err++; } + if (RORc(L32, 24) != 0x34567812UL) { fprintf(stderr, "RORc 24 failed\n"); err++; } + if (RORc(L32, 25) != 0x1a2b3c09UL) { fprintf(stderr, "RORc 25 failed\n"); err++; } + if (RORc(L32, 26) != 0x8d159e04UL) { fprintf(stderr, "RORc 26 failed\n"); err++; } + if (RORc(L32, 27) != 0x468acf02UL) { fprintf(stderr, "RORc 27 failed\n"); err++; } + if (RORc(L32, 28) != 0x23456781UL) { fprintf(stderr, "RORc 28 failed\n"); err++; } + if (RORc(L32, 29) != 0x91a2b3c0UL) { fprintf(stderr, "RORc 29 failed\n"); err++; } + if (RORc(L32, 30) != 0x48d159e0UL) { fprintf(stderr, "RORc 30 failed\n"); err++; } + if (RORc(L32, 31) != 0x2468acf0UL) { fprintf(stderr, "RORc 31 failed\n"); err++; } + /* ROR64c */ + if (ROR64c(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64c 0 failed\n"); err++; } + if (ROR64c(L64, 1 ) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROR64c 1 failed\n"); err++; } + if (ROR64c(L64, 2 ) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROR64c 2 failed\n"); err++; } + if (ROR64c(L64, 3 ) != CONST64(0x022446688aaccef1)) { fprintf(stderr, "ROR64c 3 failed\n"); err++; } + if (ROR64c(L64, 4 ) != CONST64(0x8112233445566778)) { fprintf(stderr, "ROR64c 4 failed\n"); err++; } + if (ROR64c(L64, 5 ) != CONST64(0x4089119a22ab33bc)) { fprintf(stderr, "ROR64c 5 failed\n"); err++; } + if (ROR64c(L64, 6 ) != CONST64(0x204488cd115599de)) { fprintf(stderr, "ROR64c 6 failed\n"); err++; } + if (ROR64c(L64, 7 ) != CONST64(0x1022446688aaccef)) { fprintf(stderr, "ROR64c 7 failed\n"); err++; } + if (ROR64c(L64, 8 ) != CONST64(0x8811223344556677)) { fprintf(stderr, "ROR64c 8 failed\n"); err++; } + if (ROR64c(L64, 9 ) != CONST64(0xc4089119a22ab33b)) { fprintf(stderr, "ROR64c 9 failed\n"); err++; } + if (ROR64c(L64, 10) != CONST64(0xe204488cd115599d)) { fprintf(stderr, "ROR64c 10 failed\n"); err++; } + if (ROR64c(L64, 11) != CONST64(0xf1022446688aacce)) { fprintf(stderr, "ROR64c 11 failed\n"); err++; } + if (ROR64c(L64, 12) != CONST64(0x7881122334455667)) { fprintf(stderr, "ROR64c 12 failed\n"); err++; } + if (ROR64c(L64, 13) != CONST64(0xbc4089119a22ab33)) { fprintf(stderr, "ROR64c 13 failed\n"); err++; } + if (ROR64c(L64, 14) != CONST64(0xde204488cd115599)) { fprintf(stderr, "ROR64c 14 failed\n"); err++; } + if (ROR64c(L64, 15) != CONST64(0xef1022446688aacc)) { fprintf(stderr, "ROR64c 15 failed\n"); err++; } + if (ROR64c(L64, 16) != CONST64(0x7788112233445566)) { fprintf(stderr, "ROR64c 16 failed\n"); err++; } + if (ROR64c(L64, 17) != CONST64(0x3bc4089119a22ab3)) { fprintf(stderr, "ROR64c 17 failed\n"); err++; } + if (ROR64c(L64, 18) != CONST64(0x9de204488cd11559)) { fprintf(stderr, "ROR64c 18 failed\n"); err++; } + if (ROR64c(L64, 19) != CONST64(0xcef1022446688aac)) { fprintf(stderr, "ROR64c 19 failed\n"); err++; } + if (ROR64c(L64, 20) != CONST64(0x6778811223344556)) { fprintf(stderr, "ROR64c 20 failed\n"); err++; } + if (ROR64c(L64, 21) != CONST64(0x33bc4089119a22ab)) { fprintf(stderr, "ROR64c 21 failed\n"); err++; } + if (ROR64c(L64, 22) != CONST64(0x99de204488cd1155)) { fprintf(stderr, "ROR64c 22 failed\n"); err++; } + if (ROR64c(L64, 23) != CONST64(0xccef1022446688aa)) { fprintf(stderr, "ROR64c 23 failed\n"); err++; } + if (ROR64c(L64, 24) != CONST64(0x6677881122334455)) { fprintf(stderr, "ROR64c 24 failed\n"); err++; } + if (ROR64c(L64, 25) != CONST64(0xb33bc4089119a22a)) { fprintf(stderr, "ROR64c 25 failed\n"); err++; } + if (ROR64c(L64, 26) != CONST64(0x599de204488cd115)) { fprintf(stderr, "ROR64c 26 failed\n"); err++; } + if (ROR64c(L64, 27) != CONST64(0xaccef1022446688a)) { fprintf(stderr, "ROR64c 27 failed\n"); err++; } + if (ROR64c(L64, 28) != CONST64(0x5667788112233445)) { fprintf(stderr, "ROR64c 28 failed\n"); err++; } + if (ROR64c(L64, 29) != CONST64(0xab33bc4089119a22)) { fprintf(stderr, "ROR64c 29 failed\n"); err++; } + if (ROR64c(L64, 30) != CONST64(0x5599de204488cd11)) { fprintf(stderr, "ROR64c 30 failed\n"); err++; } + if (ROR64c(L64, 31) != CONST64(0xaaccef1022446688)) { fprintf(stderr, "ROR64c 31 failed\n"); err++; } + if (ROR64c(L64, 32) != CONST64(0x5566778811223344)) { fprintf(stderr, "ROR64c 32 failed\n"); err++; } + if (ROR64c(L64, 33) != CONST64(0x2ab33bc4089119a2)) { fprintf(stderr, "ROR64c 33 failed\n"); err++; } + if (ROR64c(L64, 34) != CONST64(0x15599de204488cd1)) { fprintf(stderr, "ROR64c 34 failed\n"); err++; } + if (ROR64c(L64, 35) != CONST64(0x8aaccef102244668)) { fprintf(stderr, "ROR64c 35 failed\n"); err++; } + if (ROR64c(L64, 36) != CONST64(0x4556677881122334)) { fprintf(stderr, "ROR64c 36 failed\n"); err++; } + if (ROR64c(L64, 37) != CONST64(0x22ab33bc4089119a)) { fprintf(stderr, "ROR64c 37 failed\n"); err++; } + if (ROR64c(L64, 38) != CONST64(0x115599de204488cd)) { fprintf(stderr, "ROR64c 38 failed\n"); err++; } + if (ROR64c(L64, 39) != CONST64(0x88aaccef10224466)) { fprintf(stderr, "ROR64c 39 failed\n"); err++; } + if (ROR64c(L64, 40) != CONST64(0x4455667788112233)) { fprintf(stderr, "ROR64c 40 failed\n"); err++; } + if (ROR64c(L64, 41) != CONST64(0xa22ab33bc4089119)) { fprintf(stderr, "ROR64c 41 failed\n"); err++; } + if (ROR64c(L64, 42) != CONST64(0xd115599de204488c)) { fprintf(stderr, "ROR64c 42 failed\n"); err++; } + if (ROR64c(L64, 43) != CONST64(0x688aaccef1022446)) { fprintf(stderr, "ROR64c 43 failed\n"); err++; } + if (ROR64c(L64, 44) != CONST64(0x3445566778811223)) { fprintf(stderr, "ROR64c 44 failed\n"); err++; } + if (ROR64c(L64, 45) != CONST64(0x9a22ab33bc408911)) { fprintf(stderr, "ROR64c 45 failed\n"); err++; } + if (ROR64c(L64, 46) != CONST64(0xcd115599de204488)) { fprintf(stderr, "ROR64c 46 failed\n"); err++; } + if (ROR64c(L64, 47) != CONST64(0x6688aaccef102244)) { fprintf(stderr, "ROR64c 47 failed\n"); err++; } + if (ROR64c(L64, 48) != CONST64(0x3344556677881122)) { fprintf(stderr, "ROR64c 48 failed\n"); err++; } + if (ROR64c(L64, 49) != CONST64(0x19a22ab33bc40891)) { fprintf(stderr, "ROR64c 49 failed\n"); err++; } + if (ROR64c(L64, 50) != CONST64(0x8cd115599de20448)) { fprintf(stderr, "ROR64c 50 failed\n"); err++; } + if (ROR64c(L64, 51) != CONST64(0x46688aaccef10224)) { fprintf(stderr, "ROR64c 51 failed\n"); err++; } + if (ROR64c(L64, 52) != CONST64(0x2334455667788112)) { fprintf(stderr, "ROR64c 52 failed\n"); err++; } + if (ROR64c(L64, 53) != CONST64(0x119a22ab33bc4089)) { fprintf(stderr, "ROR64c 53 failed\n"); err++; } + if (ROR64c(L64, 54) != CONST64(0x88cd115599de2044)) { fprintf(stderr, "ROR64c 54 failed\n"); err++; } + if (ROR64c(L64, 55) != CONST64(0x446688aaccef1022)) { fprintf(stderr, "ROR64c 55 failed\n"); err++; } + if (ROR64c(L64, 56) != CONST64(0x2233445566778811)) { fprintf(stderr, "ROR64c 56 failed\n"); err++; } + if (ROR64c(L64, 57) != CONST64(0x9119a22ab33bc408)) { fprintf(stderr, "ROR64c 57 failed\n"); err++; } + if (ROR64c(L64, 58) != CONST64(0x488cd115599de204)) { fprintf(stderr, "ROR64c 58 failed\n"); err++; } + if (ROR64c(L64, 59) != CONST64(0x2446688aaccef102)) { fprintf(stderr, "ROR64c 59 failed\n"); err++; } + if (ROR64c(L64, 60) != CONST64(0x1223344556677881)) { fprintf(stderr, "ROR64c 60 failed\n"); err++; } + if (ROR64c(L64, 61) != CONST64(0x89119a22ab33bc40)) { fprintf(stderr, "ROR64c 61 failed\n"); err++; } + if (ROR64c(L64, 62) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROR64c 62 failed\n"); err++; } + if (ROR64c(L64, 63) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROR64c 63 failed\n"); err++; } + /* ROLc */ + if (ROLc(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROLc 0 failed\n"); err++; } + if (ROLc(L32, 1 ) != 0x2468acf0UL) { fprintf(stderr, "ROLc 1 failed\n"); err++; } + if (ROLc(L32, 2 ) != 0x48d159e0UL) { fprintf(stderr, "ROLc 2 failed\n"); err++; } + if (ROLc(L32, 3 ) != 0x91a2b3c0UL) { fprintf(stderr, "ROLc 3 failed\n"); err++; } + if (ROLc(L32, 4 ) != 0x23456781UL) { fprintf(stderr, "ROLc 4 failed\n"); err++; } + if (ROLc(L32, 5 ) != 0x468acf02UL) { fprintf(stderr, "ROLc 5 failed\n"); err++; } + if (ROLc(L32, 6 ) != 0x8d159e04UL) { fprintf(stderr, "ROLc 6 failed\n"); err++; } + if (ROLc(L32, 7 ) != 0x1a2b3c09UL) { fprintf(stderr, "ROLc 7 failed\n"); err++; } + if (ROLc(L32, 8 ) != 0x34567812UL) { fprintf(stderr, "ROLc 8 failed\n"); err++; } + if (ROLc(L32, 9 ) != 0x68acf024UL) { fprintf(stderr, "ROLc 9 failed\n"); err++; } + if (ROLc(L32, 10) != 0xd159e048UL) { fprintf(stderr, "ROLc 10 failed\n"); err++; } + if (ROLc(L32, 11) != 0xa2b3c091UL) { fprintf(stderr, "ROLc 11 failed\n"); err++; } + if (ROLc(L32, 12) != 0x45678123UL) { fprintf(stderr, "ROLc 12 failed\n"); err++; } + if (ROLc(L32, 13) != 0x8acf0246UL) { fprintf(stderr, "ROLc 13 failed\n"); err++; } + if (ROLc(L32, 14) != 0x159e048dUL) { fprintf(stderr, "ROLc 14 failed\n"); err++; } + if (ROLc(L32, 15) != 0x2b3c091aUL) { fprintf(stderr, "ROLc 15 failed\n"); err++; } + if (ROLc(L32, 16) != 0x56781234UL) { fprintf(stderr, "ROLc 16 failed\n"); err++; } + if (ROLc(L32, 17) != 0xacf02468UL) { fprintf(stderr, "ROLc 17 failed\n"); err++; } + if (ROLc(L32, 18) != 0x59e048d1UL) { fprintf(stderr, "ROLc 18 failed\n"); err++; } + if (ROLc(L32, 19) != 0xb3c091a2UL) { fprintf(stderr, "ROLc 19 failed\n"); err++; } + if (ROLc(L32, 20) != 0x67812345UL) { fprintf(stderr, "ROLc 20 failed\n"); err++; } + if (ROLc(L32, 21) != 0xcf02468aUL) { fprintf(stderr, "ROLc 21 failed\n"); err++; } + if (ROLc(L32, 22) != 0x9e048d15UL) { fprintf(stderr, "ROLc 22 failed\n"); err++; } + if (ROLc(L32, 23) != 0x3c091a2bUL) { fprintf(stderr, "ROLc 23 failed\n"); err++; } + if (ROLc(L32, 24) != 0x78123456UL) { fprintf(stderr, "ROLc 24 failed\n"); err++; } + if (ROLc(L32, 25) != 0xf02468acUL) { fprintf(stderr, "ROLc 25 failed\n"); err++; } + if (ROLc(L32, 26) != 0xe048d159UL) { fprintf(stderr, "ROLc 26 failed\n"); err++; } + if (ROLc(L32, 27) != 0xc091a2b3UL) { fprintf(stderr, "ROLc 27 failed\n"); err++; } + if (ROLc(L32, 28) != 0x81234567UL) { fprintf(stderr, "ROLc 28 failed\n"); err++; } + if (ROLc(L32, 29) != 0x02468acfUL) { fprintf(stderr, "ROLc 29 failed\n"); err++; } + if (ROLc(L32, 30) != 0x048d159eUL) { fprintf(stderr, "ROLc 30 failed\n"); err++; } + if (ROLc(L32, 31) != 0x091a2b3cUL) { fprintf(stderr, "ROLc 31 failed\n"); err++; } + /* ROL64c */ + if (ROL64c(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64c 0 failed\n"); err++; } + if (ROL64c(L64, 1 ) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROL64c 1 failed\n"); err++; } + if (ROL64c(L64, 2 ) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROL64c 2 failed\n"); err++; } + if (ROL64c(L64, 3 ) != CONST64(0x89119a22ab33bc40)) { fprintf(stderr, "ROL64c 3 failed\n"); err++; } + if (ROL64c(L64, 4 ) != CONST64(0x1223344556677881)) { fprintf(stderr, "ROL64c 4 failed\n"); err++; } + if (ROL64c(L64, 5 ) != CONST64(0x2446688aaccef102)) { fprintf(stderr, "ROL64c 5 failed\n"); err++; } + if (ROL64c(L64, 6 ) != CONST64(0x488cd115599de204)) { fprintf(stderr, "ROL64c 6 failed\n"); err++; } + if (ROL64c(L64, 7 ) != CONST64(0x9119a22ab33bc408)) { fprintf(stderr, "ROL64c 7 failed\n"); err++; } + if (ROL64c(L64, 8 ) != CONST64(0x2233445566778811)) { fprintf(stderr, "ROL64c 8 failed\n"); err++; } + if (ROL64c(L64, 9 ) != CONST64(0x446688aaccef1022)) { fprintf(stderr, "ROL64c 9 failed\n"); err++; } + if (ROL64c(L64, 10) != CONST64(0x88cd115599de2044)) { fprintf(stderr, "ROL64c 10 failed\n"); err++; } + if (ROL64c(L64, 11) != CONST64(0x119a22ab33bc4089)) { fprintf(stderr, "ROL64c 11 failed\n"); err++; } + if (ROL64c(L64, 12) != CONST64(0x2334455667788112)) { fprintf(stderr, "ROL64c 12 failed\n"); err++; } + if (ROL64c(L64, 13) != CONST64(0x46688aaccef10224)) { fprintf(stderr, "ROL64c 13 failed\n"); err++; } + if (ROL64c(L64, 14) != CONST64(0x8cd115599de20448)) { fprintf(stderr, "ROL64c 14 failed\n"); err++; } + if (ROL64c(L64, 15) != CONST64(0x19a22ab33bc40891)) { fprintf(stderr, "ROL64c 15 failed\n"); err++; } + if (ROL64c(L64, 16) != CONST64(0x3344556677881122)) { fprintf(stderr, "ROL64c 16 failed\n"); err++; } + if (ROL64c(L64, 17) != CONST64(0x6688aaccef102244)) { fprintf(stderr, "ROL64c 17 failed\n"); err++; } + if (ROL64c(L64, 18) != CONST64(0xcd115599de204488)) { fprintf(stderr, "ROL64c 18 failed\n"); err++; } + if (ROL64c(L64, 19) != CONST64(0x9a22ab33bc408911)) { fprintf(stderr, "ROL64c 19 failed\n"); err++; } + if (ROL64c(L64, 20) != CONST64(0x3445566778811223)) { fprintf(stderr, "ROL64c 20 failed\n"); err++; } + if (ROL64c(L64, 21) != CONST64(0x688aaccef1022446)) { fprintf(stderr, "ROL64c 21 failed\n"); err++; } + if (ROL64c(L64, 22) != CONST64(0xd115599de204488c)) { fprintf(stderr, "ROL64c 22 failed\n"); err++; } + if (ROL64c(L64, 23) != CONST64(0xa22ab33bc4089119)) { fprintf(stderr, "ROL64c 23 failed\n"); err++; } + if (ROL64c(L64, 24) != CONST64(0x4455667788112233)) { fprintf(stderr, "ROL64c 24 failed\n"); err++; } + if (ROL64c(L64, 25) != CONST64(0x88aaccef10224466)) { fprintf(stderr, "ROL64c 25 failed\n"); err++; } + if (ROL64c(L64, 26) != CONST64(0x115599de204488cd)) { fprintf(stderr, "ROL64c 26 failed\n"); err++; } + if (ROL64c(L64, 27) != CONST64(0x22ab33bc4089119a)) { fprintf(stderr, "ROL64c 27 failed\n"); err++; } + if (ROL64c(L64, 28) != CONST64(0x4556677881122334)) { fprintf(stderr, "ROL64c 28 failed\n"); err++; } + if (ROL64c(L64, 29) != CONST64(0x8aaccef102244668)) { fprintf(stderr, "ROL64c 29 failed\n"); err++; } + if (ROL64c(L64, 30) != CONST64(0x15599de204488cd1)) { fprintf(stderr, "ROL64c 30 failed\n"); err++; } + if (ROL64c(L64, 31) != CONST64(0x2ab33bc4089119a2)) { fprintf(stderr, "ROL64c 31 failed\n"); err++; } + if (ROL64c(L64, 32) != CONST64(0x5566778811223344)) { fprintf(stderr, "ROL64c 32 failed\n"); err++; } + if (ROL64c(L64, 33) != CONST64(0xaaccef1022446688)) { fprintf(stderr, "ROL64c 33 failed\n"); err++; } + if (ROL64c(L64, 34) != CONST64(0x5599de204488cd11)) { fprintf(stderr, "ROL64c 34 failed\n"); err++; } + if (ROL64c(L64, 35) != CONST64(0xab33bc4089119a22)) { fprintf(stderr, "ROL64c 35 failed\n"); err++; } + if (ROL64c(L64, 36) != CONST64(0x5667788112233445)) { fprintf(stderr, "ROL64c 36 failed\n"); err++; } + if (ROL64c(L64, 37) != CONST64(0xaccef1022446688a)) { fprintf(stderr, "ROL64c 37 failed\n"); err++; } + if (ROL64c(L64, 38) != CONST64(0x599de204488cd115)) { fprintf(stderr, "ROL64c 38 failed\n"); err++; } + if (ROL64c(L64, 39) != CONST64(0xb33bc4089119a22a)) { fprintf(stderr, "ROL64c 39 failed\n"); err++; } + if (ROL64c(L64, 40) != CONST64(0x6677881122334455)) { fprintf(stderr, "ROL64c 40 failed\n"); err++; } + if (ROL64c(L64, 41) != CONST64(0xccef1022446688aa)) { fprintf(stderr, "ROL64c 41 failed\n"); err++; } + if (ROL64c(L64, 42) != CONST64(0x99de204488cd1155)) { fprintf(stderr, "ROL64c 42 failed\n"); err++; } + if (ROL64c(L64, 43) != CONST64(0x33bc4089119a22ab)) { fprintf(stderr, "ROL64c 43 failed\n"); err++; } + if (ROL64c(L64, 44) != CONST64(0x6778811223344556)) { fprintf(stderr, "ROL64c 44 failed\n"); err++; } + if (ROL64c(L64, 45) != CONST64(0xcef1022446688aac)) { fprintf(stderr, "ROL64c 45 failed\n"); err++; } + if (ROL64c(L64, 46) != CONST64(0x9de204488cd11559)) { fprintf(stderr, "ROL64c 46 failed\n"); err++; } + if (ROL64c(L64, 47) != CONST64(0x3bc4089119a22ab3)) { fprintf(stderr, "ROL64c 47 failed\n"); err++; } + if (ROL64c(L64, 48) != CONST64(0x7788112233445566)) { fprintf(stderr, "ROL64c 48 failed\n"); err++; } + if (ROL64c(L64, 49) != CONST64(0xef1022446688aacc)) { fprintf(stderr, "ROL64c 49 failed\n"); err++; } + if (ROL64c(L64, 50) != CONST64(0xde204488cd115599)) { fprintf(stderr, "ROL64c 50 failed\n"); err++; } + if (ROL64c(L64, 51) != CONST64(0xbc4089119a22ab33)) { fprintf(stderr, "ROL64c 51 failed\n"); err++; } + if (ROL64c(L64, 52) != CONST64(0x7881122334455667)) { fprintf(stderr, "ROL64c 52 failed\n"); err++; } + if (ROL64c(L64, 53) != CONST64(0xf1022446688aacce)) { fprintf(stderr, "ROL64c 53 failed\n"); err++; } + if (ROL64c(L64, 54) != CONST64(0xe204488cd115599d)) { fprintf(stderr, "ROL64c 54 failed\n"); err++; } + if (ROL64c(L64, 55) != CONST64(0xc4089119a22ab33b)) { fprintf(stderr, "ROL64c 55 failed\n"); err++; } + if (ROL64c(L64, 56) != CONST64(0x8811223344556677)) { fprintf(stderr, "ROL64c 56 failed\n"); err++; } + if (ROL64c(L64, 57) != CONST64(0x1022446688aaccef)) { fprintf(stderr, "ROL64c 57 failed\n"); err++; } + if (ROL64c(L64, 58) != CONST64(0x204488cd115599de)) { fprintf(stderr, "ROL64c 58 failed\n"); err++; } + if (ROL64c(L64, 59) != CONST64(0x4089119a22ab33bc)) { fprintf(stderr, "ROL64c 59 failed\n"); err++; } + if (ROL64c(L64, 60) != CONST64(0x8112233445566778)) { fprintf(stderr, "ROL64c 60 failed\n"); err++; } + if (ROL64c(L64, 61) != CONST64(0x022446688aaccef1)) { fprintf(stderr, "ROL64c 61 failed\n"); err++; } + if (ROL64c(L64, 62) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROL64c 62 failed\n"); err++; } + if (ROL64c(L64, 63) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROL64c 63 failed\n"); err++; } + + return err; +} diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index ce9bfeba8..9627dcba4 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -56,6 +56,7 @@ int pkcs_1_oaep_test(void); int pkcs_1_emsa_test(void); int pkcs_1_eme_test(void); int store_test(void); +int rotate_test(void); int rsa_test(void); int dh_test(void); int katja_test(void); From 82080f0b87d76c62480bfe06f3fb59f1911828b2 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 27 Mar 2017 22:03:33 +0200 Subject: [PATCH 0541/1192] fix rotate_test to pass rotate by zero with LTC_NO_ASM --- testprof/rotate_test.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testprof/rotate_test.c b/testprof/rotate_test.c index 870e2db8a..c86b59429 100644 --- a/testprof/rotate_test.c +++ b/testprof/rotate_test.c @@ -5,10 +5,10 @@ int rotate_test(void) { ulong32 L32 = 0x12345678UL; ulong64 L64 = CONST64(0x1122334455667788); - int err = 0; + int err = 0, ze = 0; /* ROR */ - if (ROR(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROR 0 failed\n"); err++; } + if (ROR(L32, ze) != 0x12345678UL) { fprintf(stderr, "ROR 0 failed\n"); err++; } if (ROR(L32, 1 ) != 0x091a2b3cUL) { fprintf(stderr, "ROR 1 failed\n"); err++; } if (ROR(L32, 2 ) != 0x048d159eUL) { fprintf(stderr, "ROR 2 failed\n"); err++; } if (ROR(L32, 3 ) != 0x02468acfUL) { fprintf(stderr, "ROR 3 failed\n"); err++; } @@ -41,7 +41,7 @@ int rotate_test(void) if (ROR(L32, 30) != 0x48d159e0UL) { fprintf(stderr, "ROR 30 failed\n"); err++; } if (ROR(L32, 31) != 0x2468acf0UL) { fprintf(stderr, "ROR 31 failed\n"); err++; } /* ROR64 */ - if (ROR64(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64 0 failed\n"); err++; } + if (ROR64(L64, ze) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64 0 failed\n"); err++; } if (ROR64(L64, 1 ) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROR64 1 failed\n"); err++; } if (ROR64(L64, 2 ) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROR64 2 failed\n"); err++; } if (ROR64(L64, 3 ) != CONST64(0x022446688aaccef1)) { fprintf(stderr, "ROR64 3 failed\n"); err++; } @@ -106,7 +106,7 @@ int rotate_test(void) if (ROR64(L64, 62) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROR64 62 failed\n"); err++; } if (ROR64(L64, 63) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROR64 63 failed\n"); err++; } /* ROL */ - if (ROL(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROL 0 failed\n"); err++; } + if (ROL(L32, ze) != 0x12345678UL) { fprintf(stderr, "ROL 0 failed\n"); err++; } if (ROL(L32, 1 ) != 0x2468acf0UL) { fprintf(stderr, "ROL 1 failed\n"); err++; } if (ROL(L32, 2 ) != 0x48d159e0UL) { fprintf(stderr, "ROL 2 failed\n"); err++; } if (ROL(L32, 3 ) != 0x91a2b3c0UL) { fprintf(stderr, "ROL 3 failed\n"); err++; } @@ -139,7 +139,7 @@ int rotate_test(void) if (ROL(L32, 30) != 0x048d159eUL) { fprintf(stderr, "ROL 30 failed\n"); err++; } if (ROL(L32, 31) != 0x091a2b3cUL) { fprintf(stderr, "ROL 31 failed\n"); err++; } /* ROL64 */ - if (ROL64(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64 0 failed\n"); err++; } + if (ROL64(L64, ze) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64 0 failed\n"); err++; } if (ROL64(L64, 1 ) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROL64 1 failed\n"); err++; } if (ROL64(L64, 2 ) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROL64 2 failed\n"); err++; } if (ROL64(L64, 3 ) != CONST64(0x89119a22ab33bc40)) { fprintf(stderr, "ROL64 3 failed\n"); err++; } @@ -204,7 +204,7 @@ int rotate_test(void) if (ROL64(L64, 62) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROL64 62 failed\n"); err++; } if (ROL64(L64, 63) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROL64 63 failed\n"); err++; } /* RORc */ - if (RORc(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "RORc 0 failed\n"); err++; } + if (RORc(L32, ze) != 0x12345678UL) { fprintf(stderr, "RORc 0 failed\n"); err++; } if (RORc(L32, 1 ) != 0x091a2b3cUL) { fprintf(stderr, "RORc 1 failed\n"); err++; } if (RORc(L32, 2 ) != 0x048d159eUL) { fprintf(stderr, "RORc 2 failed\n"); err++; } if (RORc(L32, 3 ) != 0x02468acfUL) { fprintf(stderr, "RORc 3 failed\n"); err++; } @@ -237,7 +237,7 @@ int rotate_test(void) if (RORc(L32, 30) != 0x48d159e0UL) { fprintf(stderr, "RORc 30 failed\n"); err++; } if (RORc(L32, 31) != 0x2468acf0UL) { fprintf(stderr, "RORc 31 failed\n"); err++; } /* ROR64c */ - if (ROR64c(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64c 0 failed\n"); err++; } + if (ROR64c(L64, ze) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64c 0 failed\n"); err++; } if (ROR64c(L64, 1 ) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROR64c 1 failed\n"); err++; } if (ROR64c(L64, 2 ) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROR64c 2 failed\n"); err++; } if (ROR64c(L64, 3 ) != CONST64(0x022446688aaccef1)) { fprintf(stderr, "ROR64c 3 failed\n"); err++; } @@ -302,7 +302,7 @@ int rotate_test(void) if (ROR64c(L64, 62) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROR64c 62 failed\n"); err++; } if (ROR64c(L64, 63) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROR64c 63 failed\n"); err++; } /* ROLc */ - if (ROLc(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROLc 0 failed\n"); err++; } + if (ROLc(L32, ze) != 0x12345678UL) { fprintf(stderr, "ROLc 0 failed\n"); err++; } if (ROLc(L32, 1 ) != 0x2468acf0UL) { fprintf(stderr, "ROLc 1 failed\n"); err++; } if (ROLc(L32, 2 ) != 0x48d159e0UL) { fprintf(stderr, "ROLc 2 failed\n"); err++; } if (ROLc(L32, 3 ) != 0x91a2b3c0UL) { fprintf(stderr, "ROLc 3 failed\n"); err++; } @@ -335,7 +335,7 @@ int rotate_test(void) if (ROLc(L32, 30) != 0x048d159eUL) { fprintf(stderr, "ROLc 30 failed\n"); err++; } if (ROLc(L32, 31) != 0x091a2b3cUL) { fprintf(stderr, "ROLc 31 failed\n"); err++; } /* ROL64c */ - if (ROL64c(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64c 0 failed\n"); err++; } + if (ROL64c(L64, ze) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64c 0 failed\n"); err++; } if (ROL64c(L64, 1 ) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROL64c 1 failed\n"); err++; } if (ROL64c(L64, 2 ) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROL64c 2 failed\n"); err++; } if (ROL64c(L64, 3 ) != CONST64(0x89119a22ab33bc40)) { fprintf(stderr, "ROL64c 3 failed\n"); err++; } From 70ee598c5e100091643887fb0b271f3cc215f43e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Mar 2017 21:13:31 +0200 Subject: [PATCH 0542/1192] fix LTC_NO_ASM rotate macros when compiling with clang --- src/headers/tomcrypt_macros.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 91153f2a7..27d76d162 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -336,10 +336,10 @@ static inline ulong32 RORc(ulong32 word, const int i) #else /* rotates the hard way */ -#define ROL(x, y) ( (((ulong32)(x)<<(ulong32)((y)&31)) | (((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)(32-((y)&31)))) & 0xFFFFFFFFUL) -#define ROR(x, y) ( ((((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((y)&31)) | ((ulong32)(x)<<(ulong32)(32-((y)&31)))) & 0xFFFFFFFFUL) -#define ROLc(x, y) ( (((ulong32)(x)<<(ulong32)((y)&31)) | (((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)(32-((y)&31)))) & 0xFFFFFFFFUL) -#define RORc(x, y) ( ((((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((y)&31)) | ((ulong32)(x)<<(ulong32)(32-((y)&31)))) & 0xFFFFFFFFUL) +#define ROL(x, y) ( (((ulong32)(x)<<(ulong32)((y)&31)) | (((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((32-((y)&31))&31))) & 0xFFFFFFFFUL) +#define ROR(x, y) ( ((((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((y)&31)) | ((ulong32)(x)<<(ulong32)((32-((y)&31))&31))) & 0xFFFFFFFFUL) +#define ROLc(x, y) ( (((ulong32)(x)<<(ulong32)((y)&31)) | (((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((32-((y)&31))&31))) & 0xFFFFFFFFUL) +#define RORc(x, y) ( ((((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((y)&31)) | ((ulong32)(x)<<(ulong32)((32-((y)&31))&31))) & 0xFFFFFFFFUL) #endif @@ -393,19 +393,19 @@ static inline ulong64 ROR64(ulong64 word, int i) #define ROL64(x, y) \ ( (((x)<<((ulong64)(y)&63)) | \ - (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)64-((y)&63)))) & CONST64(0xFFFFFFFFFFFFFFFF)) + (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>(((ulong64)64-((y)&63))&63))) & CONST64(0xFFFFFFFFFFFFFFFF)) #define ROR64(x, y) \ ( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)(y)&CONST64(63))) | \ - ((x)<<((ulong64)(64-((y)&CONST64(63)))))) & CONST64(0xFFFFFFFFFFFFFFFF)) + ((x)<<(((ulong64)64-((y)&63))&63))) & CONST64(0xFFFFFFFFFFFFFFFF)) #define ROL64c(x, y) \ ( (((x)<<((ulong64)(y)&63)) | \ - (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)64-((y)&63)))) & CONST64(0xFFFFFFFFFFFFFFFF)) + (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>(((ulong64)64-((y)&63))&63))) & CONST64(0xFFFFFFFFFFFFFFFF)) #define ROR64c(x, y) \ ( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)(y)&CONST64(63))) | \ - ((x)<<((ulong64)(64-((y)&CONST64(63)))))) & CONST64(0xFFFFFFFFFFFFFFFF)) + ((x)<<(((ulong64)64-((y)&63))&63))) & CONST64(0xFFFFFFFFFFFFFFFF)) #endif From 8518b56dbfa2c456d35e1f57343c6ed71d7c9721 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Mar 2017 21:13:59 +0200 Subject: [PATCH 0543/1192] Revert "fix rotate_test to pass rotate by zero with LTC_NO_ASM" This reverts commit 82080f0b87d76c62480bfe06f3fb59f1911828b2. --- testprof/rotate_test.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testprof/rotate_test.c b/testprof/rotate_test.c index c86b59429..870e2db8a 100644 --- a/testprof/rotate_test.c +++ b/testprof/rotate_test.c @@ -5,10 +5,10 @@ int rotate_test(void) { ulong32 L32 = 0x12345678UL; ulong64 L64 = CONST64(0x1122334455667788); - int err = 0, ze = 0; + int err = 0; /* ROR */ - if (ROR(L32, ze) != 0x12345678UL) { fprintf(stderr, "ROR 0 failed\n"); err++; } + if (ROR(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROR 0 failed\n"); err++; } if (ROR(L32, 1 ) != 0x091a2b3cUL) { fprintf(stderr, "ROR 1 failed\n"); err++; } if (ROR(L32, 2 ) != 0x048d159eUL) { fprintf(stderr, "ROR 2 failed\n"); err++; } if (ROR(L32, 3 ) != 0x02468acfUL) { fprintf(stderr, "ROR 3 failed\n"); err++; } @@ -41,7 +41,7 @@ int rotate_test(void) if (ROR(L32, 30) != 0x48d159e0UL) { fprintf(stderr, "ROR 30 failed\n"); err++; } if (ROR(L32, 31) != 0x2468acf0UL) { fprintf(stderr, "ROR 31 failed\n"); err++; } /* ROR64 */ - if (ROR64(L64, ze) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64 0 failed\n"); err++; } + if (ROR64(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64 0 failed\n"); err++; } if (ROR64(L64, 1 ) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROR64 1 failed\n"); err++; } if (ROR64(L64, 2 ) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROR64 2 failed\n"); err++; } if (ROR64(L64, 3 ) != CONST64(0x022446688aaccef1)) { fprintf(stderr, "ROR64 3 failed\n"); err++; } @@ -106,7 +106,7 @@ int rotate_test(void) if (ROR64(L64, 62) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROR64 62 failed\n"); err++; } if (ROR64(L64, 63) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROR64 63 failed\n"); err++; } /* ROL */ - if (ROL(L32, ze) != 0x12345678UL) { fprintf(stderr, "ROL 0 failed\n"); err++; } + if (ROL(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROL 0 failed\n"); err++; } if (ROL(L32, 1 ) != 0x2468acf0UL) { fprintf(stderr, "ROL 1 failed\n"); err++; } if (ROL(L32, 2 ) != 0x48d159e0UL) { fprintf(stderr, "ROL 2 failed\n"); err++; } if (ROL(L32, 3 ) != 0x91a2b3c0UL) { fprintf(stderr, "ROL 3 failed\n"); err++; } @@ -139,7 +139,7 @@ int rotate_test(void) if (ROL(L32, 30) != 0x048d159eUL) { fprintf(stderr, "ROL 30 failed\n"); err++; } if (ROL(L32, 31) != 0x091a2b3cUL) { fprintf(stderr, "ROL 31 failed\n"); err++; } /* ROL64 */ - if (ROL64(L64, ze) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64 0 failed\n"); err++; } + if (ROL64(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64 0 failed\n"); err++; } if (ROL64(L64, 1 ) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROL64 1 failed\n"); err++; } if (ROL64(L64, 2 ) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROL64 2 failed\n"); err++; } if (ROL64(L64, 3 ) != CONST64(0x89119a22ab33bc40)) { fprintf(stderr, "ROL64 3 failed\n"); err++; } @@ -204,7 +204,7 @@ int rotate_test(void) if (ROL64(L64, 62) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROL64 62 failed\n"); err++; } if (ROL64(L64, 63) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROL64 63 failed\n"); err++; } /* RORc */ - if (RORc(L32, ze) != 0x12345678UL) { fprintf(stderr, "RORc 0 failed\n"); err++; } + if (RORc(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "RORc 0 failed\n"); err++; } if (RORc(L32, 1 ) != 0x091a2b3cUL) { fprintf(stderr, "RORc 1 failed\n"); err++; } if (RORc(L32, 2 ) != 0x048d159eUL) { fprintf(stderr, "RORc 2 failed\n"); err++; } if (RORc(L32, 3 ) != 0x02468acfUL) { fprintf(stderr, "RORc 3 failed\n"); err++; } @@ -237,7 +237,7 @@ int rotate_test(void) if (RORc(L32, 30) != 0x48d159e0UL) { fprintf(stderr, "RORc 30 failed\n"); err++; } if (RORc(L32, 31) != 0x2468acf0UL) { fprintf(stderr, "RORc 31 failed\n"); err++; } /* ROR64c */ - if (ROR64c(L64, ze) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64c 0 failed\n"); err++; } + if (ROR64c(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROR64c 0 failed\n"); err++; } if (ROR64c(L64, 1 ) != CONST64(0x089119a22ab33bc4)) { fprintf(stderr, "ROR64c 1 failed\n"); err++; } if (ROR64c(L64, 2 ) != CONST64(0x04488cd115599de2)) { fprintf(stderr, "ROR64c 2 failed\n"); err++; } if (ROR64c(L64, 3 ) != CONST64(0x022446688aaccef1)) { fprintf(stderr, "ROR64c 3 failed\n"); err++; } @@ -302,7 +302,7 @@ int rotate_test(void) if (ROR64c(L64, 62) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROR64c 62 failed\n"); err++; } if (ROR64c(L64, 63) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROR64c 63 failed\n"); err++; } /* ROLc */ - if (ROLc(L32, ze) != 0x12345678UL) { fprintf(stderr, "ROLc 0 failed\n"); err++; } + if (ROLc(L32, 0 ) != 0x12345678UL) { fprintf(stderr, "ROLc 0 failed\n"); err++; } if (ROLc(L32, 1 ) != 0x2468acf0UL) { fprintf(stderr, "ROLc 1 failed\n"); err++; } if (ROLc(L32, 2 ) != 0x48d159e0UL) { fprintf(stderr, "ROLc 2 failed\n"); err++; } if (ROLc(L32, 3 ) != 0x91a2b3c0UL) { fprintf(stderr, "ROLc 3 failed\n"); err++; } @@ -335,7 +335,7 @@ int rotate_test(void) if (ROLc(L32, 30) != 0x048d159eUL) { fprintf(stderr, "ROLc 30 failed\n"); err++; } if (ROLc(L32, 31) != 0x091a2b3cUL) { fprintf(stderr, "ROLc 31 failed\n"); err++; } /* ROL64c */ - if (ROL64c(L64, ze) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64c 0 failed\n"); err++; } + if (ROL64c(L64, 0 ) != CONST64(0x1122334455667788)) { fprintf(stderr, "ROL64c 0 failed\n"); err++; } if (ROL64c(L64, 1 ) != CONST64(0x22446688aaccef10)) { fprintf(stderr, "ROL64c 1 failed\n"); err++; } if (ROL64c(L64, 2 ) != CONST64(0x4488cd115599de20)) { fprintf(stderr, "ROL64c 2 failed\n"); err++; } if (ROL64c(L64, 3 ) != CONST64(0x89119a22ab33bc40)) { fprintf(stderr, "ROL64c 3 failed\n"); err++; } From 8af93d1d0df61379b4ada57f20b2b6244e9e4efe Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Mar 2017 21:44:36 +0200 Subject: [PATCH 0544/1192] Remove ccm_memory_ex() --- src/encauth/ccm/ccm_memory_ex.c | 383 -------------------------------- src/headers/tomcrypt_mac.h | 13 -- 2 files changed, 396 deletions(-) delete mode 100644 src/encauth/ccm/ccm_memory_ex.c diff --git a/src/encauth/ccm/ccm_memory_ex.c b/src/encauth/ccm/ccm_memory_ex.c deleted file mode 100644 index 1110abbff..000000000 --- a/src/encauth/ccm/ccm_memory_ex.c +++ /dev/null @@ -1,383 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org - */ -#include "tomcrypt.h" - -/** - @file ccm_memory.c - CCM support, process a block of memory, Tom St Denis -*/ - -#if defined LTC_CCM_MODE && 0 - -/** - CCM encrypt/decrypt and produce an authentication tag - @param cipher The index of the cipher desired - @param key The secret key to use - @param keylen The length of the secret key (octets) - @param uskey A previously scheduled key [optional can be NULL] - @param nonce The session nonce [use once] - @param noncelen The length of the nonce - @param header The header for the session - @param headerlen The length of the header (octets) - @param pt [out] The plaintext - @param ptlen The length of the plaintext (octets) - @param ct [out] The ciphertext - @param tag [out] The destination tag - @param taglen [in/out] The max size and resulting size of the authentication tag - @param direction Encrypt or Decrypt direction (0 or 1) - @return CRYPT_OK if successful -*/ -int ccm_memory_ex(int cipher, - const unsigned char *key, unsigned long keylen, - symmetric_key *uskey, - const unsigned char *nonce, unsigned long noncelen, - const unsigned char *header, unsigned long headerlen, - unsigned char *pt, unsigned long ptlen, - unsigned char *ct, - unsigned char *tag, unsigned long *taglen, - int direction, - const unsigned char *B_0, - const unsigned char *CTR, - int ctrwidth) -{ - unsigned char PAD[16], ctr[16], CTRPAD[16], ctrcopy[16], b; - symmetric_key *skey; - int err; - unsigned long len, L, x, y, z, CTRlen; - - if (uskey == NULL) { - LTC_ARGCHK(key != NULL); - } - LTC_ARGCHK(nonce != NULL); - if (headerlen > 0) { - LTC_ARGCHK(header != NULL); - } - LTC_ARGCHK(pt != NULL); - LTC_ARGCHK(ct != NULL); - LTC_ARGCHK(tag != NULL); - LTC_ARGCHK(taglen != NULL); - -#ifdef LTC_FAST - if (16 % sizeof(LTC_FAST_TYPE)) { - return CRYPT_INVALID_ARG; - } -#endif - - /* check cipher input */ - if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { - return err; - } - if (cipher_descriptor[cipher].block_length != 16) { - return CRYPT_INVALID_CIPHER; - } - - /* make sure the taglen is even and <= 16 */ - *taglen &= ~1; - if (*taglen > 16) { - *taglen = 16; - } - - /* can't use < 4 */ - if (*taglen < 4) { - return CRYPT_INVALID_ARG; - } - - /* is there an accelerator? */ - if (cipher_descriptor[cipher].accel_ccm_memory != NULL) { - return cipher_descriptor[cipher].accel_ccm_memory( - key, keylen, - uskey, - nonce, noncelen, - header, headerlen, - pt, ptlen, - ct, - tag, taglen, - direction); - } - - /* let's get the L value */ - len = ptlen; - L = 0; - while (len) { - ++L; - len >>= 8; - } - if (L <= 1) { - L = 2; - } - - /* increase L to match the nonce len */ - noncelen = (noncelen > 13) ? 13 : noncelen; - if ((15 - noncelen) > L) { - L = 15 - noncelen; - } - - /* decrease noncelen to match L */ - if ((noncelen + L) > 15) { - noncelen = 15 - L; - } - - /* allocate mem for the symmetric key */ - if (uskey == NULL) { - skey = XMALLOC(sizeof(*skey)); - if (skey == NULL) { - return CRYPT_MEM; - } - - /* initialize the cipher */ - if ((err = cipher_descriptor[cipher].setup(key, keylen, 0, skey)) != CRYPT_OK) { - XFREE(skey); - return err; - } - } else { - skey = uskey; - } - - /* form B_0 == flags | Nonce N | l(m) */ - x = 0; - -if (B_0 == NULL) { - PAD[x++] = (unsigned char)(((headerlen > 0) ? (1<<6) : 0) | - (((*taglen - 2)>>1)<<3) | - (L-1)); - - /* nonce */ - for (y = 0; y < (16 - (L + 1)); y++) { - PAD[x++] = nonce[y]; - } - - /* store len */ - len = ptlen; - - /* shift len so the upper bytes of len are the contents of the length */ - for (y = L; y < 4; y++) { - len <<= 8; - } - - /* store l(m) (only store 32-bits) */ - for (y = 0; L > 4 && (L-y)>4; y++) { - PAD[x++] = 0; - } - for (; y < L; y++) { - PAD[x++] = (unsigned char)((len >> 24) & 255); - len <<= 8; - } - -} else { - /* B_0 != NULL */ - XMEMCPY(PAD, B_0, 16); -} - - /* encrypt PAD */ - if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { - goto error; - } - - /* handle header */ - if (headerlen > 0) { - x = 0; - -#if 0 - /* store length */ - if (headerlen < ((1UL<<16) - (1UL<<8))) { - PAD[x++] ^= (headerlen>>8) & 255; - PAD[x++] ^= headerlen & 255; - } else { - PAD[x++] ^= 0xFF; - PAD[x++] ^= 0xFE; - PAD[x++] ^= (headerlen>>24) & 255; - PAD[x++] ^= (headerlen>>16) & 255; - PAD[x++] ^= (headerlen>>8) & 255; - PAD[x++] ^= headerlen & 255; - } -#endif - - /* now add the data */ - for (y = 0; y < headerlen; y++) { - if (x == 16) { - /* full block so let's encrypt it */ - if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { - goto error; - } - x = 0; - } - PAD[x++] ^= header[y]; - } - - /* remainder? */ - if (x != 0) { - if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { - goto error; - } - } - } - - /* setup the ctr counter */ -if (CTR == NULL) { - x = 0; - - /* flags */ - ctr[x++] = (unsigned char)L-1; - - /* nonce */ - for (y = 0; y < (16 - (L+1)); ++y) { - ctr[x++] = nonce[y]; - } - /* offset */ - while (x < 16) { - ctr[x++] = 0; - } -} else { - XMEMCPY(ctr, CTR, 16); -} - - x = 0; - CTRlen = 16; - - /* now handle the PT */ - if (ptlen > 0) { - y = 0; -#ifdef LTC_FAST2 - if (ptlen & ~15) { - if (direction == CCM_ENCRYPT) { - for (; y < (ptlen & ~15); y += 16) { - /* increment the ctr? */ - for (z = 15; (int)z > (int)(15-ctrwidth); z--) { - ctr[z] = (ctr[z] + 1) & 255; - if (ctr[z]) break; - } - if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { - goto error; - } - - /* xor the PT against the pad first */ - for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { - *(LTC_FAST_TYPE_PTR_CAST(&PAD[z])) ^= *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])); - *(LTC_FAST_TYPE_PTR_CAST(&ct[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) ^ *(LTC_FAST_TYPE_PTR_CAST(&CTRPAD[z])); - } - if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { - goto error; - } - } - } else { - for (; y < (ptlen & ~15); y += 16) { - /* increment the ctr? */ - for (z = 15; (int)z > (int)(15-ctrwidth); z--) { - ctr[z] = (ctr[z] + 1) & 255; - if (ctr[z]) break; - } - if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { - goto error; - } - - /* xor the PT against the pad last */ - for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { - *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&ct[y+z])) ^ *(LTC_FAST_TYPE_PTR_CAST(&CTRPAD[z])); - *(LTC_FAST_TYPE_PTR_CAST(&PAD[z])) ^= *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])); - } - if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { - goto error; - } - } - } - } -#endif - - for (; y < ptlen; y++) { - /* increment the ctr? */ - if (CTRlen == 16) { - for (z = 15; (int)z > (int)(15-ctrwidth); z--) { - ctr[z] = (ctr[z] + 1) & 255; - if (ctr[z]) break; - } - if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { - goto error; - } - CTRlen = 0; - } - - /* if we encrypt we add the bytes to the MAC first */ - if (direction == CCM_ENCRYPT) { - b = pt[y]; - ct[y] = b ^ CTRPAD[CTRlen++]; - } else { - b = ct[y] ^ CTRPAD[CTRlen++]; - pt[y] = b; - } - - if (x == 16) { - if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { - goto error; - } - x = 0; - } - PAD[x++] ^= b; - } - - if (x != 0) { - if ((err = cipher_descriptor[cipher].ecb_encrypt(PAD, PAD, skey)) != CRYPT_OK) { - goto error; - } - } - } - - /* grab the CTR */ - XMEMCPY(ctrcopy, ctr, 16); - - /* setup CTR for the TAG (zero the count) */ - if (CTR == NULL) { - for (y = 15; y > 15 - L; y--) { - ctr[y] = 0x00; - } - } else { - XMEMCPY(ctr, CTR, 16); - } - - if ((err = cipher_descriptor[cipher].ecb_encrypt(ctr, CTRPAD, skey)) != CRYPT_OK) { - goto error; - } - - if (skey != uskey) { - cipher_descriptor[cipher].done(skey); - } - - /* store the TAG */ - for (x = 0; x < 16 && x < *taglen; x++) { - tag[x] = PAD[x] ^ CTRPAD[x]; - } - *taglen = x; - -if (CTR != NULL) { - for (z = 15; (int)z > (int)(15-ctrwidth); z--) { - ctrcopy[z] = (ctrcopy[z] + 1) & 255; - if (ctrcopy[z]) break; - } - XMEMCPY(CTR, ctrcopy, 16); -} - -#ifdef LTC_CLEAN_STACK - zeromem(skey, sizeof(*skey)); - zeromem(PAD, sizeof(PAD)); - zeromem(CTRPAD, sizeof(CTRPAD)); -#endif -error: - if (skey != uskey) { - XFREE(skey); - } - - return err; -} - -#endif - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index d2518c4a7..1486aad39 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -307,19 +307,6 @@ int ccm_memory(int cipher, unsigned char *tag, unsigned long *taglen, int direction); -int ccm_memory_ex(int cipher, - const unsigned char *key, unsigned long keylen, - symmetric_key *uskey, - const unsigned char *nonce, unsigned long noncelen, - const unsigned char *header, unsigned long headerlen, - unsigned char *pt, unsigned long ptlen, - unsigned char *ct, - unsigned char *tag, unsigned long *taglen, - int direction, - const unsigned char *B_0, - const unsigned char *CTR, - int ctrwidth); - int ccm_test(void); #endif /* LTC_CCM_MODE */ From d153d1303a567af046b09008d7f5fb29e508d700 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Mar 2017 21:44:45 +0200 Subject: [PATCH 0545/1192] Update makefiles --- libtomcrypt_VS2005.vcproj | 4 ---- libtomcrypt_VS2008.vcproj | 4 ---- makefile | 20 ++++++++++---------- makefile.icc | 20 ++++++++++---------- makefile.mingw | 20 ++++++++++---------- makefile.msvc | 20 ++++++++++---------- makefile.shared | 20 ++++++++++---------- makefile.unix | 20 ++++++++++---------- 8 files changed, 60 insertions(+), 68 deletions(-) diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index fb3a12b5a..cbc302f29 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -357,10 +357,6 @@ RelativePath="src\encauth\ccm\ccm_memory.c" > - - diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 2d9f84f55..7908a9990 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -359,10 +359,6 @@ RelativePath="src\encauth\ccm\ccm_memory.c" > - - diff --git a/makefile b/makefile index c6f006494..6769bc5b2 100644 --- a/makefile +++ b/makefile @@ -48,16 +48,16 @@ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ -src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ -src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ -src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ -src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ -src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ -src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ -src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ +src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ +src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ +src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ +src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ +src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ +src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ +src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ +src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ diff --git a/makefile.icc b/makefile.icc index 1456dcc29..e2a21022e 100644 --- a/makefile.icc +++ b/makefile.icc @@ -105,16 +105,16 @@ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ -src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ -src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ -src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ -src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ -src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ -src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ -src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ +src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ +src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ +src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ +src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ +src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ +src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ +src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ +src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ diff --git a/makefile.mingw b/makefile.mingw index 3af944e76..6f19124fb 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -52,16 +52,16 @@ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ -src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ -src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ -src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ -src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ -src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ -src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ -src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ +src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ +src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ +src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ +src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ +src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ +src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ +src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ +src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ diff --git a/makefile.msvc b/makefile.msvc index 5277a6702..8f2d39b1c 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -10,16 +10,16 @@ src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/skipjack.obj \ src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_add_aad.obj \ src/encauth/ccm/ccm_add_nonce.obj src/encauth/ccm/ccm_done.obj src/encauth/ccm/ccm_init.obj \ -src/encauth/ccm/ccm_memory.obj src/encauth/ccm/ccm_memory_ex.obj src/encauth/ccm/ccm_process.obj \ -src/encauth/ccm/ccm_reset.obj src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj \ -src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ -src/encauth/eax/eax_encrypt.obj src/encauth/eax/eax_encrypt_authenticate_memory.obj \ -src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \ -src/encauth/gcm/gcm_add_iv.obj src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj \ -src/encauth/gcm/gcm_init.obj src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj \ -src/encauth/gcm/gcm_process.obj src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj \ -src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \ -src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \ +src/encauth/ccm/ccm_memory.obj src/encauth/ccm/ccm_process.obj src/encauth/ccm/ccm_reset.obj \ +src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj src/encauth/eax/eax_decrypt.obj \ +src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj src/encauth/eax/eax_encrypt.obj \ +src/encauth/eax/eax_encrypt_authenticate_memory.obj src/encauth/eax/eax_init.obj \ +src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj src/encauth/gcm/gcm_add_iv.obj \ +src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj src/encauth/gcm/gcm_init.obj \ +src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj src/encauth/gcm/gcm_process.obj \ +src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj src/encauth/ocb/ocb_decrypt.obj \ +src/encauth/ocb/ocb_decrypt_verify_memory.obj src/encauth/ocb/ocb_done_decrypt.obj \ +src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \ src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj \ src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj \ src/encauth/ocb3/ocb3_add_aad.obj src/encauth/ocb3/ocb3_decrypt.obj src/encauth/ocb3/ocb3_decrypt_last.obj \ diff --git a/makefile.shared b/makefile.shared index 2b724441a..3fde59c16 100644 --- a/makefile.shared +++ b/makefile.shared @@ -38,16 +38,16 @@ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ -src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ -src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ -src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ -src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ -src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ -src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ -src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ +src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ +src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ +src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ +src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ +src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ +src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ +src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ +src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ diff --git a/makefile.unix b/makefile.unix index 5b58c44cb..5e6f3cd60 100644 --- a/makefile.unix +++ b/makefile.unix @@ -46,16 +46,16 @@ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ -src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_memory_ex.o src/encauth/ccm/ccm_process.o \ -src/encauth/ccm/ccm_reset.o src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o \ -src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ -src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ -src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ -src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ -src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ +src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ +src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ +src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ +src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ +src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ +src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ +src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ +src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ +src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ From 7bb7bdde1d508ce1eadfbcac981bc3498a23a904 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 14 Mar 2017 23:09:14 +0100 Subject: [PATCH 0546/1192] improving MS Windows builds (msvc) --- .gitignore | 1 + helper.pl | 4 +- libtomcrypt.dsp | 1639 ------------------------------ libtomcrypt_VS2005.sln | 20 - libtomcrypt_VS2008.sln | 6 + libtomcrypt_VS2008.vcproj | 299 +++++- makefile.mingw | 30 +- makefile.msvc | 19 +- src/misc/crypt/crypt_constants.c | 2 +- src/misc/crypt/crypt_sizes.c | 4 +- testprof/makefile.mingw | 5 +- testprof/makefile.msvc | 5 +- 12 files changed, 325 insertions(+), 1709 deletions(-) delete mode 100644 libtomcrypt.dsp delete mode 100644 libtomcrypt_VS2005.sln diff --git a/.gitignore b/.gitignore index e6f8df239..b0e2a9b37 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.l[oa] [Dd]ebug/ [Rr]elease/ +/MSVC_* .libs/ # suppress output of build process diff --git a/helper.pl b/helper.pl index 8eeb02a1a..2f61234bc 100755 --- a/helper.pl +++ b/helper.pl @@ -217,8 +217,8 @@ sub process_makefiles { (my $var_obj = $var_o) =~ s/\.o\b/.obj/sg; my $var_h = prepare_variable("HEADERS", (sort @h, 'testprof/tomcrypt_test.h')); - my $msvc_files = prepare_msvc_files_xml(\@all, qr/tab\.c$/, ['Debug|Win32', 'Release|Win32']); - for my $m (qw/libtomcrypt_VS2008.vcproj libtomcrypt_VS2005.vcproj/) { + my $msvc_files = prepare_msvc_files_xml(\@all, qr/tab\.c$/, ['Debug|Win32', 'Release|Win32', 'Debug|x64', 'Release|x64']); + for my $m (qw/libtomcrypt_VS2008.vcproj/) { my $old = read_file($m); my $new = $old; $new =~ s|.*|$msvc_files|s; diff --git a/libtomcrypt.dsp b/libtomcrypt.dsp deleted file mode 100644 index 83b4af9c1..000000000 --- a/libtomcrypt.dsp +++ /dev/null @@ -1,1639 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libtomcrypt" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libtomcrypt - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libtomcrypt.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libtomcrypt.mak" CFG="libtomcrypt - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libtomcrypt - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libtomcrypt - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "libtomcrypt" -# PROP Scc_LocalPath "." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libtomcrypt - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "src\headers" /I "..\libtommath" /D "NDEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Release\tomcrypt.lib" - -!ELSEIF "$(CFG)" == "libtomcrypt - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Debug\tomcrypt.lib" - -!ENDIF - -# Begin Target - -# Name "libtomcrypt - Win32 Release" -# Name "libtomcrypt - Win32 Debug" -# Begin Group "ciphers" - -# PROP Default_Filter "" -# Begin Group "aes" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\ciphers\aes\aes.c - -!IF "$(CFG)" == "libtomcrypt - Win32 Release" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build -InputPath=.\src\ciphers\aes\aes.c - -BuildCmds= \ - cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/" /Fd"Release/" /FD /GZ /c $(InputPath) \ - cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/aes_enc.obj" /Fd"Release/" /FD /GZ /c $(InputPath) \ - - -"Release/aes.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"Release/aes_enc.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "libtomcrypt - Win32 Debug" - -# PROP Ignore_Default_Tool 1 -# Begin Custom Build -InputPath=.\src\ciphers\aes\aes.c - -BuildCmds= \ - cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c $(InputPath) \ - cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/aes_enc.obj" /Fd"Debug/" /FD /GZ /c $(InputPath) \ - - -"Debug/aes.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"Debug/aes_enc.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\aes\aes_tab.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "safer" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\ciphers\safer\safer.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\safer\safer_tab.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\safer\saferp.c -# End Source File -# End Group -# Begin Group "twofish" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\ciphers\twofish\twofish.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\twofish\twofish_tab.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\ciphers\anubis.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\blowfish.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\cast5.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\des.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\kasumi.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\khazad.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\kseed.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\multi2.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\noekeon.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\rc2.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\rc5.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\rc6.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\skipjack.c -# End Source File -# Begin Source File - -SOURCE=.\src\ciphers\xtea.c -# End Source File -# End Group -# Begin Group "encauth" - -# PROP Default_Filter "" -# Begin Group "ccm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\encauth\ccm\ccm_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ccm\ccm_test.c -# End Source File -# End Group -# Begin Group "eax" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_addheader.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_decrypt_verify_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_encrypt_authenticate_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\eax\eax_test.c -# End Source File -# End Group -# Begin Group "gcm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_add_aad.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_add_iv.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_gf_mult.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_mult_h.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_reset.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\gcm\gcm_test.c -# End Source File -# End Group -# Begin Group "ocb" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_decrypt_verify_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_done_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_done_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_encrypt_authenticate_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_ntz.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_shift_xor.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\ocb_test.c -# End Source File -# Begin Source File - -SOURCE=.\src\encauth\ocb\s_ocb_done.c -# End Source File -# End Group -# End Group -# Begin Group "hashes" - -# PROP Default_Filter "" -# Begin Group "helper" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\hashes\helper\hash_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\helper\hash_filehandle.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\helper\hash_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\helper\hash_memory_multi.c -# End Source File -# End Group -# Begin Group "sha2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\hashes\sha2\sha224.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\sha2\sha256.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\sha2\sha384.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\sha2\sha512.c -# End Source File -# End Group -# Begin Group "whirl" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\hashes\whirl\whirl.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\whirl\whirltab.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\hashes\chc\chc.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\md2.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\md4.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\md5.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\rmd128.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\rmd160.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\rmd256.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\rmd320.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\sha1.c -# End Source File -# Begin Source File - -SOURCE=.\src\hashes\tiger.c -# End Source File -# End Group -# Begin Group "mac" - -# PROP Default_Filter "" -# Begin Group "f9" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\f9\f9_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\f9\f9_test.c -# End Source File -# End Group -# Begin Group "hmac" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\hmac\hmac_test.c -# End Source File -# End Group -# Begin Group "omac" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\omac\omac_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\omac\omac_test.c -# End Source File -# End Group -# Begin Group "pelican" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\pelican\pelican.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pelican\pelican_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pelican\pelican_test.c -# End Source File -# End Group -# Begin Group "pmac" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_ntz.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_shift_xor.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\pmac\pmac_test.c -# End Source File -# End Group -# Begin Group "xcbc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_file.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_memory.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_memory_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\mac\xcbc\xcbc_test.c -# End Source File -# End Group -# End Group -# Begin Group "math" - -# PROP Default_Filter "" -# Begin Group "fp" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\math\fp\ltc_ecc_fp_mulmod.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\math\gmp_desc.c -# End Source File -# Begin Source File - -SOURCE=.\src\math\ltm_desc.c -# End Source File -# Begin Source File - -SOURCE=.\src\math\multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\math\rand_prime.c -# End Source File -# Begin Source File - -SOURCE=.\src\math\tfm_desc.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Group "base64" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\misc\base64\base64_decode.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\base64\base64_encode.c -# End Source File -# End Group -# Begin Group "crypt" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_argchk.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_cipher_descriptor.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_cipher_is_valid.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_cipher.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_cipher_any.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_cipher_id.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_hash_any.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_hash_id.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_hash_oid.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_find_prng.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_fsa.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_hash_descriptor.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_hash_is_valid.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_ltc_mp_descriptor.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_prng_descriptor.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_prng_is_valid.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_register_cipher.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_register_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_register_prng.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_unregister_cipher.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_unregister_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\crypt\crypt_unregister_prng.c -# End Source File -# End Group -# Begin Group "pkcs" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\misc\pkcs5\pkcs_5_1.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\pkcs5\pkcs_5_2.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\misc\burn_stack.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\error_to_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\misc\zeromem.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\src\misc\hkdf\hkdf.c -# End Source File -# End Group -# Begin Group "modes" - -# PROP Default_Filter "" -# Begin Group "cbc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cbc\cbc_start.c -# End Source File -# End Group -# Begin Group "cfb" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\cfb\cfb_start.c -# End Source File -# End Group -# Begin Group "ctr" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_start.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ctr\ctr_test.c -# End Source File -# End Group -# Begin Group "ecb" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\ecb\ecb_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ecb\ecb_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ecb\ecb_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ecb\ecb_start.c -# End Source File -# End Group -# Begin Group "f8" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\f8\f8_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_start.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\f8\f8_test_mode.c -# End Source File -# End Group -# Begin Group "lrw" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_process.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_start.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\lrw\lrw_test.c -# End Source File -# End Group -# Begin Group "ofb" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_getiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_setiv.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\ofb\ofb_start.c -# End Source File -# End Group -# Begin Group "xts" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\modes\xts\xts_decrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_done.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_encrypt.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_init.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_mult_x.c -# End Source File -# Begin Source File - -SOURCE=.\src\modes\xts\xts_test.c -# End Source File -# End Group -# End Group -# Begin Group "pk" - -# PROP Default_Filter "" -# Begin Group "asn1" - -# PROP Default_Filter "" -# Begin Group "der" - -# PROP Default_Filter "" -# Begin Group "bit" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\bit\der_decode_bit_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\bit\der_encode_bit_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\bit\der_length_bit_string.c -# End Source File -# End Group -# Begin Group "boolean" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\boolean\der_decode_boolean.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\boolean\der_encode_boolean.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\boolean\der_length_boolean.c -# End Source File -# End Group -# Begin Group "choice" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\choice\der_decode_choice.c -# End Source File -# End Group -# Begin Group "ia5" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\ia5\der_decode_ia5_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\ia5\der_encode_ia5_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\ia5\der_length_ia5_string.c -# End Source File -# End Group -# Begin Group "integer" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\integer\der_decode_integer.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\integer\der_encode_integer.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\integer\der_length_integer.c -# End Source File -# End Group -# Begin Group "object_identifier" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\object_identifier\der_decode_object_identifier.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\object_identifier\der_encode_object_identifier.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\object_identifier\der_length_object_identifier.c -# End Source File -# End Group -# Begin Group "octet" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\octet\der_decode_octet_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\octet\der_encode_octet_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\octet\der_length_octet_string.c -# End Source File -# End Group -# Begin Group "printable_string" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\printable_string\der_decode_printable_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\printable_string\der_encode_printable_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\printable_string\der_length_printable_string.c -# End Source File -# End Group -# Begin Group "sequence" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_ex.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_flexi.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_decode_sequence_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_encode_sequence_ex.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_encode_sequence_multi.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_length_sequence.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\sequence\der_sequence_free.c -# End Source File -# End Group -# Begin Group "set" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\set\der_encode_set.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\set\der_encode_setof.c -# End Source File -# End Group -# Begin Group "short_integer" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\short_integer\der_decode_short_integer.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\short_integer\der_encode_short_integer.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\short_integer\der_length_short_integer.c -# End Source File -# End Group -# Begin Group "utctime" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utctime\der_decode_utctime.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utctime\der_encode_utctime.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utctime\der_length_utctime.c -# End Source File -# End Group -# Begin Group "utf8" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utf8\der_decode_utf8_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utf8\der_encode_utf8_string.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\asn1\der\utf8\der_length_utf8_string.c -# End Source File -# End Group -# End Group -# End Group -# Begin Group "dsa" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_decrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_encrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_free.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_make_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_shared_secret.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_sign_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_verify_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\dsa\dsa_verify_key.c -# End Source File -# End Group -# Begin Group "ecc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_ansi_x963_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_ansi_x963_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_decrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_encrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_free.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_get_size.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_make_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_shared_secret.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_sign_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_sizes.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_test.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ecc_verify_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_is_valid_idx.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_map.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_mul2add.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_mulmod.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_mulmod_timing.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_points.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_projective_add_point.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\ecc\ltc_ecc_projective_dbl_point.c -# End Source File -# End Group -# Begin Group "katja" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\katja\katja_decrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_encrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_exptmod.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_free.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\katja\katja_make_key.c -# End Source File -# End Group -# Begin Group "pkcs1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_i2osp.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_mgf1.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_oaep_decode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_oaep_encode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_os2ip.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_pss_decode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_pss_encode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_v1_5_decode.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\pkcs1\pkcs_1_v1_5_encode.c -# End Source File -# End Group -# Begin Group "rsa" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_decrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_encrypt_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_export.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_exptmod.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_free.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_import.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_make_key.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_sign_hash.c -# End Source File -# Begin Source File - -SOURCE=.\src\pk\rsa\rsa_verify_hash.c -# End Source File -# End Group -# End Group -# Begin Group "prngs" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\prngs\fortuna.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\rc4.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\rng_get_bytes.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\rng_make_prng.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\sober128.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\sober128tab.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\sprng.c -# End Source File -# Begin Source File - -SOURCE=.\src\prngs\yarrow.c -# End Source File -# End Group -# Begin Group "headers" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\src\headers\tomcrypt.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_argchk.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_cfg.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_cipher.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_custom.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_hash.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_mac.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_macros.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_math.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_misc.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_pk.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_pkcs.h -# End Source File -# Begin Source File - -SOURCE=.\src\headers\tomcrypt_prng.h -# End Source File -# End Group -# End Target -# End Project diff --git a/libtomcrypt_VS2005.sln b/libtomcrypt_VS2005.sln deleted file mode 100644 index 527c06020..000000000 --- a/libtomcrypt_VS2005.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtomcrypt", "libtomcrypt_VS2005.vcproj", "{3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}.Debug|Win32.ActiveCfg = Debug|Win32 - {3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}.Debug|Win32.Build.0 = Debug|Win32 - {3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}.Release|Win32.ActiveCfg = Release|Win32 - {3EBCE29D-8BCC-4DDC-BEA3-60A0081579BB}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libtomcrypt_VS2008.sln b/libtomcrypt_VS2008.sln index 2424d8858..1508689e3 100644 --- a/libtomcrypt_VS2008.sln +++ b/libtomcrypt_VS2008.sln @@ -6,13 +6,19 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|Win32.ActiveCfg = Debug|Win32 {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|Win32.Build.0 = Debug|Win32 + {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|x64.ActiveCfg = Debug|x64 + {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|x64.Build.0 = Debug|x64 {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|Win32.ActiveCfg = Release|Win32 {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|Win32.Build.0 = Release|Win32 + {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|x64.ActiveCfg = Release|x64 + {E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 7908a9990..d0a23f137 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -11,19 +11,21 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -686,6 +905,26 @@ PreprocessorDefinitions="" /> + + + + + + @@ -1979,6 +2218,26 @@ PreprocessorDefinitions="" /> + + + + + + = sizeof(number))) return -1; - total_len += strlen(number) + 1; + total_len += (unsigned int)strlen(number) + 1; /* this last +1 is for newlines (and ending NULL) */ } diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index 347116d6f..456df230b 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -2,7 +2,7 @@ # BEWARE: do not run make from testprof directory, run 'gmake ... test' from libtomcrypt root dir -CFLAGS = $(CFLAGS_OPTS) -W -I../src/headers -I. -Wall -W +CFLAGS = $(CFLAGS_OPTS) -I../src/headers -I../../libtommath -I. -Wall -Wextra -DUSE_LTM -DLTM_DESC OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ @@ -11,6 +11,9 @@ pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o default: $(LIBTEST_S) +%.o: %.c + ${CC} ${CFLAGS} -c $< -o $@ + $(LIBTEST_S): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) $(RANLIB) $@ diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index 617a162e2..2f64462cb 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -1,4 +1,4 @@ -CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /W3 /Fo$@ +CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /DUSE_LTM /W3 OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ @@ -6,6 +6,9 @@ rsa_test.obj store_test.obj rotate_test.obj test_driver.obj x86_prof.obj katja_t dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj \ pkcs_1_emsa_test.obj pkcs_1_eme_test.obj +.c.obj: + $(CC) $(CFLAGS) /c $< /Fo$@ + tomcrypt_prof.lib: $(OBJECTS) lib /out:tomcrypt_prof.lib $(OBJECTS) From c6a0362c88131ce5ccf269b6b97e3f45f979073f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 22 Mar 2017 21:22:00 +0100 Subject: [PATCH 0547/1192] SHA3 --- demos/tv_gen.c | 6 + libtomcrypt_VS2005.vcproj | 8 + libtomcrypt_VS2008.vcproj | 8 + makefile | 19 +- makefile.icc | 19 +- makefile.mingw | 19 +- makefile.msvc | 19 +- makefile.shared | 19 +- makefile.unix | 19 +- notes/hash_tv.txt | 1036 +++++++++++++++++++++++++++++++++ notes/hmac_tv.txt | 1036 +++++++++++++++++++++++++++++++++ src/hashes/sha3.c | 298 ++++++++++ src/hashes/sha3_test.c | 420 +++++++++++++ src/headers/tomcrypt_custom.h | 2 + src/headers/tomcrypt_hash.h | 38 ++ src/misc/crypt/crypt.c | 3 + src/misc/crypt/crypt_sizes.c | 3 + testprof/cipher_hash_test.c | 3 + testprof/x86_prof.c | 12 + 19 files changed, 2933 insertions(+), 54 deletions(-) create mode 100644 src/hashes/sha3.c create mode 100644 src/hashes/sha3_test.c diff --git a/demos/tv_gen.c b/demos/tv_gen.c index a4903af11..b9fe6b5a7 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -85,6 +85,12 @@ void reg_algs(void) #ifdef LTC_SHA512 register_hash (&sha512_desc); #endif +#ifdef LTC_SHA3 + register_hash (&sha3_224_desc); + register_hash (&sha3_256_desc); + register_hash (&sha3_384_desc); + register_hash (&sha3_512_desc); +#endif #ifdef LTC_RIPEMD128 register_hash (&rmd128_desc); #endif diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index cbc302f29..5f16e83cc 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -594,6 +594,14 @@ RelativePath="src\hashes\sha1.c" > + + + + diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index d0a23f137..887f726d4 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -815,6 +815,14 @@ RelativePath="src\hashes\sha1.c" > + + + + diff --git a/makefile b/makefile index 6769bc5b2..6432b3f1f 100644 --- a/makefile +++ b/makefile @@ -70,15 +70,16 @@ src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_fileha src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ +src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ diff --git a/makefile.icc b/makefile.icc index e2a21022e..44664b0e6 100644 --- a/makefile.icc +++ b/makefile.icc @@ -127,15 +127,16 @@ src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_fileha src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ +src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ diff --git a/makefile.mingw b/makefile.mingw index b9f325794..c905256ff 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -63,15 +63,16 @@ src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_fileha src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ +src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ diff --git a/makefile.msvc b/makefile.msvc index 335131341..2b5724617 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -37,15 +37,16 @@ src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj src/hashes/helper/hash_fi src/hashes/helper/hash_memory.obj src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj \ src/hashes/md5.obj src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj \ src/hashes/sha1.obj src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj \ -src/hashes/sha2/sha512.obj src/hashes/sha2/sha512_224.obj src/hashes/sha2/sha512_256.obj src/hashes/tiger.obj \ -src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj \ -src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj \ -src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj \ -src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj \ -src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj \ -src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj \ -src/mac/pelican/pelican.obj src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj \ -src/mac/pmac/pmac_done.obj src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ +src/hashes/sha2/sha512.obj src/hashes/sha2/sha512_224.obj src/hashes/sha2/sha512_256.obj src/hashes/sha3.obj \ +src/hashes/sha3_test.obj src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj \ +src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj \ +src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj \ +src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj \ +src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj \ +src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj \ +src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj \ +src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj \ +src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \ src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj \ src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \ diff --git a/makefile.shared b/makefile.shared index 3fde59c16..763397c2c 100644 --- a/makefile.shared +++ b/makefile.shared @@ -60,15 +60,16 @@ src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_fileha src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ +src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ diff --git a/makefile.unix b/makefile.unix index 5e6f3cd60..9e7c8f930 100644 --- a/makefile.unix +++ b/makefile.unix @@ -68,15 +68,16 @@ src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_fileha src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/tiger.o \ -src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o src/mac/f9/f9_init.o \ -src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o src/mac/f9/f9_test.o \ -src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \ -src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \ -src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \ -src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \ -src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \ -src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ +src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ diff --git a/notes/hash_tv.txt b/notes/hash_tv.txt index 4f2714d30..0e581354c 100644 --- a/notes/hash_tv.txt +++ b/notes/hash_tv.txt @@ -1341,6 +1341,1042 @@ Hash: sha512 255: 15025C9D135861FF5A549DF0BFD6C398FD126613496D4E97627651E68B7B1F80407F187D7978464F0F78BFEEA787600FAAEBBE991EDDB60671CD0CE874F0A744 256: 1E7B80BC8EDC552C8FEEB2780E111477E5BC70465FAC1A77B29B35980C3F0CE4A036A6C9462036824BD56801E62AF7E9FEBA5C22ED8A5AF877BF7DE117DCAC6D +Hash: sha3_224 + 0: 6B4E03423667DBB73B6E15454F0EB1ABD4597F9A1B078E3F5B5A6BC7 + 1: BDD5167212D2DC69665F5A8875AB87F23D5CE7849132F56371A19096 + 2: 334CDA37A26C0669CC7A5074452F033FD57FD96AE0729582B69F865E + 3: 5FB2B598EE40EF6F46E82CB8264984AAEE891C680D89AF5C3C36ED45 + 4: 4FB067ED1266B8F487F609F12350AE92CCDA9A197D7DA4A831724D7D + 5: 365C10987F3C57DCA7B9C1FD7158C0E52A394A8FB0ABD43D738893B2 + 6: 911029D5B740DC8F65661C3A137296D9E05C3315D8F52F1FDF632462 + 7: 45C40E1C9601FFB8E7D024968E48581CE067EA33B0EFCF25F85E627A + 8: 2FF69F46EA70C729F349DBCC9A0B5D6166031321AF70833B2FACAA72 + 9: 7AC8B0AFEEFF883AF3896371FAD034386F88941E9C14371FDCEEA996 + 10: E38CF337E48CDB4B64A746B994BE20781E51F4547A4C39240599DCBA + 11: 5891AFA32A2C7435728F0627820908F20A339267E42119D5A7910573 + 12: D78D4B95DB37CAEEC81ECBA9568EB35EBD5B11E134E974267B294636 + 13: 207002605B91D5225A8F89DEE317C747A2D8688AF13CE0E3204979C5 + 14: 61FEAA9DCE58B63BAB08455026AAA94E620BC03F1DACB6A2F75121A0 + 15: 6999702B14328604DD71D59285D3E82ED3E5E7CC44169B21E975A849 + 16: 31F77B0C661546DC776A938983A2A10A2EADBC8D33D4A82863933F12 + 17: DE09A5443FF8A9F87D667C88005D06061D4DC716B29265B278A590C4 + 18: 8B53AC4F3F6ECC2707EE6B404A17996A75B2B3251B2D0078636D679B + 19: 0371C2A70002358F54FC14E5AA4B7F65D825FFEF5A0A4E3C9ABA5793 + 20: 6775D26C17A4065ED4DF905506B42E59E7F40307395BA33E5C4CED1C + 21: 7AA468C9554A9B1DF5F3E01A95678D9E7910EC9B9A6B824DDC28871C + 22: 5640D599AB3226854D178F163FA42818E59B309D56C5A827C172835B + 23: D7FBECD514F2E707020FA059E600A857635E3F7FAF5759B5800AAC96 + 24: 8FD2B6843C0C2D668607FF71C7F34F19F7FB75ADAC806B66C6C7B448 + 25: B81788863F8B00FFC7E1E7EA429616A92EC89EB559A11FB4BF5DE286 + 26: 9E987B34BABEEC98886B1002A5D42778D76BCA5330A03CF032672C10 + 27: EBA0716D82672CFE5900F7AB0BB35FEE3D8FFC95E2DF1BB61354236D + 28: 97E5E7D260B9799D5F315C3FF429EE9C86550394CE833D792C6ED1D7 + 29: 04CB508569475BE9527B16B4C43FF664175CF9F4A387A23D49391375 + 30: C82B33A8CEFCEF6AA1B38C658C066AFCBD38E6F814B0209B5053C3F8 + 31: 2457BF71C2BB07328BA31A109AE3298A6603BA56DE537542DEE8A128 + 32: BFC9C1E8939AEE953CA0D425A2F0CBDD2D18025D5D6B798F1C8150B9 + 33: 6568AE0FA4A34C7E229EFB54A763BE00B843436CF2D19C2B6BAC75E6 + 34: A40955AFC5E1756A35F7EEBFC03B769186D6C48EBB38E4DE613431C4 + 35: 3F1B508FBC4DC40BC4DA2009367ED5188611DB2337E581316BB51F32 + 36: 27DF7FC47C4DE0B861EAFE748BFF5C1C522FDB029247D7A000D19500 + 37: F6EFE4FD3D4F7C8DEEC783E891F9250BD3E86BBEDEDBE6F5CD5B86C8 + 38: 44976B957E6CC5157F46BF52C46855E49687B7FA3102F0043F251FC7 + 39: 221553ADAFE51AA810C853CEEED84EC0A2EAA0635ECCE9BE354D0BC8 + 40: 0E2FBB87B0CA6BD9FB85A32E357465CE68E0ED40A3FDAA36BED423C2 + 41: 1FCB5DB23D17C53D75D03FE26EC2EA74CDB1BF308A5D0B8A18F3A563 + 42: A24830A72AFB30EADF4EFBDB94DEF365744D0F151627EB9BC97D3003 + 43: AC2C3F390F0173B228C73C9AF69FD2D2A425FFC0883886514335EDAC + 44: CE009DCD1C90325762707024C06B19E9E98F3AE645BEC1BFB133327D + 45: E3F3F6EB37420DE23EA22C13D4B5B01D2E29594AB6E3103D0EA80CD0 + 46: 0966D9A5D07F5E2CA13699C46A77502251F802646E5D5C1A4AEEA70B + 47: B9E10F41CC2FBB430D370E20E5081C00C659D6B6A9ED2634CEB25D33 + 48: D05325556666453175764F98A08679952AEC0C9649353E592131FB9D + 49: A4F03909FE084AA3F0E5511E1DDEC77A026E5280B2D6C417BF662418 + 50: 446B0071F21FFB63BFA6054A96F44FD4996F30CB4D398190B42C6F43 + 51: 9F048B051AF10E08DAA0C9FA417CA690A65870718DE161C511C29D9F + 52: BEB65AA59119AB5F8F75D0B64859028D3BCCDC8EEF764D27B70E9F5D + 53: 3E5C923999C5D50A8C414BF627DC53834BBC2C0DB765C8087B287DE7 + 54: 9E9105787BDD3D4E585C2FF029C181F1CA04934607FBB14D1236FE33 + 55: 10681E293CCE004E088BE7C67426F50D6AACC7E31447B0F73A425C35 + 56: FC95D44E806CBBD484E379882238F555FDA923878C443ABE4CE4CDD6 + 57: 1E348592E91C1FE6AD862AD5311868830075C4189334E04EC22CA930 + 58: A7154F3DC5490F0D0751AA68536377DF56D8F2C9FB46496B79AC4B65 + 59: 93D13ACE1B752CD34122C3FF5BA26AB96A72282082AF34E40242E36B + 60: BDA4464722E003C1B8B150051E39E5106E8F05E53397C6B411ED960C + 61: BB19BEDB5FF28577B732BD0BFABAA9F18AE10BCFD193448CBCB89B82 + 62: F2E6C2BA4D6E085BD900BCC499C8ED8341C613AD721C28B3020A9978 + 63: 05E05C93D7F8B002EB5FAB6958A32D124E000143B63835DDF64E48FA + 64: FE7C26EE7D8A00D407EFC65DCD88809F25F8E37395148733E6EFC3B5 + 65: C5C12A29147A04DA59CE54CC657A26AD2B7E65E679F64684915BE492 + 66: C29AF1E7B8F818AC1815CEB1DFA5A8A177AA98B5DC2803ADA079047F + 67: 2E5265A1D7556CAA6F355C36A3E726BFEC40725FBB1088BE2DAB08D9 + 68: 07742BE70320B1D87628531D521E6744282A8F70180CD8B5EBB5AA59 + 69: BB41C858301CB57230FD85083BA5C76044282170123A990F461E3B14 + 70: C885E6C9BE4A56615ADC88657907B0449FF80A0B14459096CAA14999 + 71: 5E31D4BC8904E6E77531E6B975D3DCDD4330C03620E5204BC047CE2E + 72: 0FDD8265D5382246A4EB6580DF2452FFC3918CF04EDD9FED88F566AA + 73: B1D7EDC8A77C2457DD67597772EF2EB3360D6F2C48CE599CBD81F2CB + 74: 5798BE75376773997CE6B43A82BD323D3A5171176D349F0AA91BB18C + 75: 0F8BF99981EC3363F6FD917BDB1B3802761E6383675C249866F6C28E + 76: 7FE009BEFB156B7582BC1173871BFBF611E23D90C7B495E8FC94D7CC + 77: 449702E349D61A6391648DB4244D8B104836D856FA7B18B32F764BE5 + 78: 4F80419266A26D02B97DC83AACC2298775E061D30DAC8C6CCD9AEA7B + 79: 431C1D7A3B1DB04141C4D4C0A3C56468380E1A8810ED72DBF6851E5C + 80: D89AC3CFF48F7F73861ED16DB3FF239559BA8F04D4E9C46F7ABB20CD + 81: 7259CD78031B5012BFACFEF147D52A8FBCFDC5EC1A5E54B38014F6F3 + 82: 0E5BDF794984DE3C5082E8A9BF5F83056FE28990791707979350CCAF + 83: D49E2A8D59F3F60CA46180250742E74AF7C3E6356FE8D4B9FD145193 + 84: C4F63E763E463357642AC06CFD84DAFC4578D36AB63766726EE56320 + 85: 0C91B9E9B50B98FC31D4F70545692BF861E148DED0C6E712F710D81E + 86: A65ACC6242A0C8DEBA233A3F1FE4B9DC0B4012D45766CC22EC2EC96A + 87: A5208843BA4F129C0129323CDD22303DFD25A1F6D9063C2BF4FD08DE + 88: F6F6420C9DE252D2203641D4D68E7C6C14F8BA7B5E159F05179420D4 + 89: 82C4894ED849BF4D18672865D98A35FE504284E574C06E4310CC9354 + 90: DD61E5602720B1C1885CE5DFA61B7333259DCEF201A5FB7274FC948A + 91: B37608E84CCEFFA667E5EAAA925ECF00286C3A6DD97EB620B300C7EC + 92: 1C6005AD8414EB5FDB90FD8F8F241B781C6E78922BD5F155EB8066BA + 93: C79E89E33C99CBC50BA0D1781C45A1F2692A2FEBD162AF590E390753 + 94: 6B7CF9DCEA9126FCBD0694BF5376F4428F197E5BCA5AF957457549D3 + 95: 9E2FE74F3D509A5E0FF21517F5ED277D010AABFC8EE6DC8DE589882C + 96: 3FAC97532617C7CA76E2648958C9470A3AAF37AE74C28E5C95FE884D + 97: C855C493D7ED05F8D871AF38F66B3EF6FB6BB4E9ED45D1D23AF0FFA6 + 98: 490CB3DCD9A9CADFA1C590C9EB8695CE5F4787213CED5B7593CEC26E + 99: 8EFD1D71D36A31A799403596BD1189A25DBDD3ADC5E2425AE952B25F +100: 21649AC9D0430D74D5F5261653DA46C87AC1560540B4579101083461 +101: 03B96617EDF75C33E4949E2B462EB75828546A2EB8308BDD4C0859CF +102: C556DB7B33E53BF1736D9BC84F30AA936A8EA4AFCC590D70FBE647AB +103: 8B59FEFCAF88187D29EB7B887F5C066475168A4348DEAC4F34993D63 +104: 2027BB84E1A588623F3F5DDED0663BBFF3B93D46C65578CA892F6D91 +105: 9F2AE8EB1AD97E9B3DE8EC65BE32908225505B249F8A7A01405F2E82 +106: 3FB6E70E2AFF0D7E0FABE4A4C93B689F72D27DA6B79FB195EB790BE3 +107: A805C623242A8C03376E463285999AAFBA952369D6E87124827514A1 +108: 1A8C1E9940FD32E203065A840071FE7B4F92E51F119783A356849F12 +109: E9BE39172FC3D85C099484FC1854351A1850232F12BCC98C90ACC290 +110: 598B9E288D05E0D7F3739967C706BF888BFA4128A32543C662709D4C +111: 4FA336790D224B4A79FE2992C5A2B604988A8DBF85A76068DC5CF3F1 +112: FC8B641FE0A9268A14BC1CE81587B80F31A7BBC8D5600E310F70BC9F +113: DFC4ED11AF8646B394E816DC1EFABD6908E6ED5ADFA1CD911C905DBA +114: 2E2AECBD2EEFF11F2B904B57F514C6F26FCA9BAFA7431BF1E74158A6 +115: A7B03A76C3FAB1D2391F527FC1FD071BF2E1E98F8BB09AABCBA17727 +116: 1C9FF49680486878EFFB763A10DD1FCBEBEBB8B947086AAD5670F019 +117: 1AA1ABDB490CBC83DD173FF2F893C1E28554C5A87669171A388ACC91 +118: D708FC237FAA908E445B0E5C037558E0A30134C7171489F2EEA3B34B +119: 0509BC607ABB229F4F9328159195249390630860534528D260BE452E +120: 28EEB96CC2A73ACFCF6D7A4B8017315291AF31BDEF2DF8B09B8A107D +121: 0684AEC742C636A0A2415DD0D710B9142A4FC45E8EA5CD2226B26F6E +122: 8EA838B2DF09920001FC3D86C2DA985C5D456E2C555AFA3C2C94153A +123: 7E9584A788305A9C6CE95AE9F6E6214FB068D6421356FDEB9472C681 +124: ED232D89C157749B47A1A0CB1EDD71D7C863BC8822192921A551D15E +125: 2013B0AF19BD61CF2DDABBB7D45FAF04784103210DB6697DE37CD63E +126: 5F20F121AC27794E25A8058ED9840EF36D8668EA360F82CA64664C8B +127: E0AB99E85CC24D5AA35B2B2D5A80F15CC70FE6443FA8ED433F9DD8E2 +128: 935982770B8E39A960C38939824E4236085FCAB2EC5C00D72FBF1C78 +129: F95558A7F2A0E7A5B6F205F1D7570AE7AA08D3D50FF137CFFB5201C9 +130: 6F1D54B0F0730DA6F13E7B1ABDD301F278A979295EDA0CC9857F7DAC +131: C743E948DDE59240651706C46B8CC6D931305DCB7CEFD70BD0653368 +132: 8C26212B2F2CB047C94A2E4C312D92768A1A05936FA9D8E0DCB5175B +133: 67DD1365E9E2EC75F4D96A8460A0A9BF686827920E2B7FBBB0EF2925 +134: 6D8A43354B6C4E4E28E93AD60E16DF666EECA61B360F718009C445A1 +135: 3174E5126280625ECDFDB238D6A10D1C8B071031870ED197640CAD90 +136: 5D633F7E245E4338FA2698EF8B0CF98B129B5CC99622F770E3BA0CB6 +137: 7098DDCFF44C0AE3E0802D8D60FE7BEA8D0D3219CE28660AF1AEE40C +138: D6537CB1962DA8CE6415A92512FDC03BA319C9AF89EA795C2EA962B0 +139: 5BBE5C79373CAAF7F79F3012E96BF5AC0BAB10E324DFBAC3D29BF374 +140: 8EB136B9F46C1F40F82DD7609E65BCBFC45E641CD0262003DA81997A +141: A8DF4DBDC4C5D535EB3F590DD7E097E0B1B3ACE931447D987AC25E94 +142: 4353E7ED38EB9CC41ABBF0709C6AB707DE70D759E5D6EEDF09043FD0 +143: 64D0E8A1BE3CF30EF6727B30A6E428F7F068D44634C943D277AD8E7F +144: 5BE75E6A08F19913A1D8036C056CC4556B98DC90AECA3F2A0664DEDC +145: 90B861AC1B1598459AD8337AFA9933CE2F1A6F972C57DAF8FC2737E4 +146: BF0135795B4CFF740ECA130C323F8B44F663B0C4F9DD4A753E6D19C6 +147: 5046B58A09C9D4F0B46557C1BD29C681E1D8E6753A98E321FEF9E668 +148: A500B780B184DB8CEFA4431EDCA414D36096D69A257200BD58DA50F5 +149: 23543FCC62111C1576B4B66E27E08188AA4F428D80EDD0E296FBB93F +150: 179BF2290B46260D60D729DC9FB547A67A25BAA7B250D81B42473888 +151: 93DBC78BB8581796D80A799867EB7433A76C1112D041A43832F46AB9 +152: 86B38BEFB99A0C37BD562EAEDF416CC98D37FD76EA6841AF2BFA00CF +153: 586E75D5C595020D039B905BC0C72549F1F0F263F383071873B1A3F4 +154: 228D798D4B715B2CC5ADC9FF00FB6123A6EE5DCAB09C62CBE0F13610 +155: 4731F0557591E5F2BD5F4A82B2867217D2F187170BA434DBF3655D72 +156: AD2EB6EA86FDC83E7DE7AB85C8EE63E3F74B8C45E2F17F3DE5AAEDEA +157: 4F866857ED64EC4489465BE797D6E32DEE4866842A35EB0C3EE9DAC6 +158: 2F50B9307F67E63151C216D66DA5A14AF9AC3752B4D8C27C202D5CE9 +159: 7F034FE5B2F0109FAC7449B46DABA20944102E25A31A0C346B7DD1B2 +160: B227E462031692D03AA4784E7DBF6A5A18FFB070389D5B245957C911 +161: 1F66E24E59F472BDAF073E38CCA1FE9F0E3FD3158C0E340E1737D8BB +162: 579C94ACDD161130A3314BC21E9174A02EB8A58287450804EEAEE246 +163: 59BFEC1D1B9CD922BA82955069CFE9C69114EA87ED78057FE38ECA49 +164: 08A9164451C41B3B3D8858A9E54CDBDE2E871305FC7342C79D4291A4 +165: 2A749643D6F831532AB07A1FA9736857CB1BF699B0D88B75DBAD4D99 +166: FDD6D5D0A8014CD0E62D02703E252A32A7B3485E406A77E026AF666D +167: 3E78E02F6BCD8CF59D7F633F1A9FD522FBE6CC8914247B6171694B69 +168: 58E2D8551F4CB53E9CE8CDFBA50A81FD14E0B112A42007B03737372C +169: 44C06523FCD275B5CEFCE7D0FAD88ED27F984EF8BAA6C58E6BBFAE73 +170: 0D1EB14CE7A3923AEEEA1BB0BB547A66B7FFD35622B41A7762D44D63 +171: 29FBF6234371C81A48E85BA79527F1EDAC02B6AC990EEE8C0B2A8DD5 +172: 46F9D06D9D45A89CF79ADA602F77F39236114945E41ABBA656A122CB +173: C1754BFE1269ADA378D3805DCD05BFF68631DBF37F52A758EC447007 +174: E36A81BCED4D94D6ED0541E2E4C2754E2EB94DEEA20717A916B929FE +175: A83197194F2B4255053CBFC3F62728700A7D0A9E1DBACD047393083F +176: BB8F93DBE385D8165517FC5A3846C29C9E53BBF029E208DC99AEDE9C +177: EE83F2E05ACB846430EE4B48C00AA052117DB078B308F055814B7420 +178: 033254B2F0A9B570372D5464F9DB0248620D7D1892CF75B9E41E2A76 +179: 8EA210E4AE717107C1D01B8375E7D367F784B780F56D53D58C123690 +180: 1BE8C13BCF3907FC49D2077E50B41505E140C3DC6FB3955D098C46FD +181: CA7A249693D61CAD10F8E5F4CADC950F13ADEBCB54601D5420E5E14B +182: 724F8866C5A1920D2E44665D7A78AA651A752D02BC9540EAC624CF02 +183: FD16C06F8DCA7C4F8672315718A491E210EDCBA5046B890F36C59C33 +184: 8A43F3FA567A4A713335CF4F6827F74F4B2BE277F1A9D3DE8C38207B +185: E897112CB41BDC0CE459888212EA5F4D41123EED5FC45B80FCFED66D +186: 56C37A47857DB340CD58BCED82D7D5BD9690D6003AEDBC69960ECB2E +187: 7CEB4DF1D46918CC5066AE697DF9569EB847270F3011CBC681ABC64F +188: 3BD6FDB78946EF324512CD5A0DF1FB34DDD68F4DDA07732E9B4344DA +189: D442C6E9324A1A4DFADD0580E3AFB33C669A12777BC1A990B7848D9A +190: 0342DBC2248C6D2B283CFE82F7ECADAEF526363C88AAD70663408EB1 +191: B14CB26E7A5205BE06851D63B07270DB7815315CD5D9D53A87B9A43E +192: C8C45C35677C8B0A8E0F69A058C2B6E8684F302BC2903EE0C79430B4 +193: 11653C5C30DBA94F142056AE704EBC82CBD1F4E2A1CA120004EB7DD5 +194: 19BEC341BB47355CF06A30AB8171FF41112B5A14DCE42A6F28CED997 +195: 00DC3930079D7BCF1BFF3F76A90901F0CD528E233D0A2831FD6672D5 +196: 21D48FCED6A0C14B580C2A82F2380E70578AA22C6C50CB6BFE76BC72 +197: F5CE6EAFD6224F02CCC0AAF5DE793EBAAE2128AF4877476F8358028E +198: BF329FEE8039E89E0970053EE509EDDDE096F026A8BFCBA6D99856C7 +199: 75EFF28580619BC6992DBA34062399CACBB7F96FFE361B240E36D930 +200: 8BCD90DBC5379549B5E78A1FBE24AE120D92CAEF17750461262B1E97 +201: 0DE753D613321A4EC586FB8D4A5330A35FF2D08C32D434457C58ED38 +202: 5196805B5900643580CA19E464D276DBA36C651AD53700FCB8AAC114 +203: D2A3342D9187CA1E54457264F61E3F63B08FE6C1486C6FA27D93F372 +204: 4671BEC428BD36E0A0D9B741A8F312AB73629861731F43622397D9F4 +205: 04D3C3FB6359A09FBF9179A3E83B147A2C32274151670FDFE768B26F +206: 85F8B6BCD8364CB1F86929BE5F0C8E8CD7395508A35A28721F2005D9 +207: 05069F1D874DEDDFFDA67A3C74DEB39BA64AB26B9A288DF18EAAAAFE +208: E512D3088E41C157F4C31081D835061E78368ECB995F0F865AE7C8DD +209: 99CB5E3B68E4CEF44E7BCE89FEC5D3AD0BED68A341C4F26685A91435 +210: 257B54153499D81573E680442AEA471B48A2051AA2A87CA85B97034D +211: 027E48B8B02932BCBDBB2EE048A65AE28C348F55EC739357938C2CEF +212: 0937C69C2B9FDF13C58D5F80B627B29E2B4A00A6EA43D39303EA36F0 +213: 15F0894B40AA70EBA1BC28B7413B0FDC248DD83A7C057F1A3C857380 +214: 5C5100F771A361BDE3DA81CDD785D5EA906676D54CE6F37673D95411 +215: 4BEDD88CAB661DB3621608DAFA55424F00580E35A158EE9502878964 +216: 4B6B3E4E23805ADBD9520D65D01E6F132343DC203F97584F067761B4 +217: 4CD16EC65628AEA9E2857A339E957DD1987E0598119F58FEC84C53A4 +218: A6230282773A972AA88F8749D42E78E51089198506EF5B4D44E6B077 +219: C1CC1E77014B6CEE035C07217B2711CE0592F199B896BD9BBA8C36DE +220: 5B3D971F3BD1CD65D2D6888A044CDF4C099581690278354FB384C34C +221: C3D7CFE6AECABFED12C1D90D499910F8C98C7FF6EB1E59A4ED5F5161 +222: 01DCF63DF396168A5D79178E9C609DBF2AFA3576F5BA13E0336217A4 +223: DB2C60B5EFD3CBAEE94F9DB5069208258B2514702850ECA5B4D0CD2C +224: 6456D3B2001892E582221E5E1BA665750D0A26C977EC81086A1F2AE0 +225: BD46D6833E96998C8FF2772CA72AFEE2F6BF01B90FC4CEDB0342474C +226: B0CE5949761859192C151C57013B68ACB0E6F3280F2D01AB64D73937 +227: E4F9DA1C2B99AD60674868BD8637C183800929533663E65930593765 +228: 8A8DB3F904FB73D78C0F10412F9D5157D99BF04CEB9E2098092D3085 +229: 53F138AE00F3D4C70ECB02448F611A7AF28C8A8BF5C780C6AC418728 +230: C2B4AB66B72F8FAD6DE82CF448FB3D3364A010FD5684E782A11B9DCA +231: 36E9942DA297F65F32401003AF92650F98B9A63CF551AB4110D9F51C +232: 5B118A50CF4709C2145D0BAD449995201E813947B48DDEFC9AE91CBD +233: EFC6640A100DEBBA66807F4FA5C77EB39E961E10996B79AFD264559C +234: EF44CDCB35BE9006C8C870A459C5E9F682C133C7289FBC48D070D5B6 +235: 792F9656C76CFFF751CA61E613BC76F5B2499AF2A0D3CFBD66847C09 +236: F95E7CF33801C2DB385D9D4A2000E2E28CF90A6C6036E7D82BB0B2B2 +237: 188480C0CC9B923758036F585935647B59E172A33CA76F3CAB672105 +238: 8F15F5E14B5084D1146F050BA70363C50E0C8E5BDC49CF9215B857EF +239: D42EEAD6ECB82E4303CFB175BB4CCB02580632315B2C73DD9EE1943F +240: 14FB7CFE5D96DAC71EAA91CAFDC59A9B08FF9C064EF649BFE36D1F4D +241: 7A8D5880A965339E9F0B8E319F7EE943255949C828D7CFCC1F19709C +242: 250DDCFF230F88A6D7B5B27F489D2136598E7D99DA718EF84980C2E9 +243: 3F4259960EA3755BE7F75B42FFAFBA24238CD0A38D97C27B613A3058 +244: 40E0FCB308F152E25BC1E51C8C5FD925AE796A8CBA3C97B0AD35A19D +245: 92E16111D49BC6C2896E4C0A71585A0131B40CDAFB85D3C8E08AF23C +246: 34FB6BAFD5EC3F8911E2ADA599AF82E089106BAC823AB55B2AD9ACA7 +247: BDCEDFCB39AC3C7D206323C934B3B729AA9236AF276A1AB50D418946 +248: 981279B006F56E6E061206FD2FB31CFAC9F3096F2EA5DF2C63EF92CC +249: E9BA3E2410344DB27DA1441D36CB38A7A85FBE7A0E3C5E15EECEF990 +250: E44FDB52FCE67EA1B385A3A8572E30FA5355D07803069059B9B8BFB3 +251: 8814FD9C42084E846B56B2E648279CAFB8B68CE256BC2307AC52E229 +252: 16704FD498F3198D6A1E92CA301FEA97F303CE815B5F26EF83113786 +253: 40721B0F061E5A69413A957A876C15ED3A4892D6A471522D82516DFB +254: A525CA4BAD5D45931E9D86F95F152C7BA6685BBA7EEDDDE6A0E5E4AA +255: D95C168E8F666375A1C7D574686D36293FCFD3717D79B212D47D97B7 +256: BD34C1FAA03A01DB5E0C3A3D5E0440D6E5E361060F3DC9D149A26812 + +Hash: sha3_256 + 0: A7FFC6F8BF1ED76651C14756A061D662F580FF4DE43B49FA82D80A4B80F8434A + 1: 5D53469F20FEF4F8EAB52B88044EDE69C77A6A68A60728609FC4A65FF531E7D0 + 2: 76AB70DC46775B641A8E71507B07145AED11AE5EFC0BAA94AC06876AF2B3BF5C + 3: 1186D49A4AD620618F760F29DA2C593B2EC2CC2CED69DC16817390D861E62253 + 4: 33BAD5430899ED6F8BEAF3E732B2A2CAD1D40B7C9DE0CFCDC7E0BC0756803A10 + 5: 8305D46643F04116DDC816F91544B7DCDC2A2CD34A0255498BEFCE0795E21205 + 6: ED2479F84980D846CD12447F241059AC1679AC30584443D40222FB7E1639414C + 7: 59B1ADD388B7D625D2797894A4D88C7554A796A5A3D8AE232BF5F86BD72D5756 + 8: EB4D0F2ADD0F6D0B26F0C65DBE71FE617CC6B43FB403649E82CC8BAB41195F4E + 9: 5257E34D7BB964F59AE4A46B3BA5921E04A550C2B1E04F268B297E358EAB1362 + 10: 605A0514059192E26DBF06CFAB86F3E9BBB9A69363D4BE925B2246DCD8659A95 + 11: 4585AE166873F94A8930881014FFD14EBCDAC1A0D599DC57EFB4989B44472095 + 12: 4ACBD92D310FC38697084C1BC7A79516A9BE20701DAE8EB36C643F07F45EDBD6 + 13: 154E8759089D17DDA455F74BBF702BE99F678D58AE442EBE16264A7822A8A048 + 14: 85A3D4E61229DA1490E64093E6118A733E3021B4678256335F437251F7D222C5 + 15: 89C25ECFDAEA85B2F360C15A2ECF31F0BD59A0CE821A1AAC31E2F73093DC4CD8 + 16: 39462D2A2320F8DA572A97B0B39473D4312E0228B23E2C2FE0AE9B6C67F2343C + 17: 6A37657A32560869154EAA9CA59FB648F3A96B62F5BDADD604BDFE0133783048 + 18: 636E904C72670EF3D78D9F0E121BB2B5EAE69E806FA02314688D65600424349D + 19: 6AD0DB215FBD30E7AE5E22C2841357624D5605B1FC9FDB96882BD42529E6A994 + 20: DB32380ABE23EF51F0547AC0FC4D095A2A16445A00FD8CE2E52628E189BA562D + 21: 331CC1C851DF863EB365860B2BC76E7E1E928261BAC6F1A4EC0A25ED00D0E2C9 + 22: 9F5577BA75324007CD66F9D7F16BA6E74313D853E791FC865AACFCF63C561799 + 23: F0E872C81033E67EFC37DC258435966A0D1504BD14C2750276092ABD0F9B0169 + 24: 2AADE36CEB570D6D3A92FE79DCD612CFCD3226F020F205A74FB1213244EC4857 + 25: 5BE74AA323CC1092D1A73A574496658CBB4809F4125AD275FC112E990BB8C1C8 + 26: B6FE46E0DCAB352BD9D4DCA77CDC88B733001ADCB089596330769CC6BEFC1BCE + 27: 5E080231CF3A92393C287EF7B5950D0394774700F82F2A0BAFF7EA82524223F6 + 28: 646DADA5A492B9EB649E576F976A0CC76280111F767A63921DD29C09CD4AB434 + 29: 2022202E664AE6B9E468706B45CBEA851CD7A352D6378236AC6E0DA2924E9AB2 + 30: 7909BBD61FF6C4D0552562E3A57E61F23FB82AEA99C9B2E004D94FC21A3F49CF + 31: BE29B022732A2E397FE039EC17766DA33A16D25555502775B0577BACBCA40625 + 32: 050A48733BD5C2756BA95C5828CC83EE16FABCD3C086885B7744F84A0F9E0D94 + 33: F7B83039FF915EE67C8586BA2D4B9C348733D9C75863056EFA4581E80A09B66E + 34: BD6D450C1E2072E614152D5E6344A0CF14FFB16AC8658D68176E3AF0F737C9A3 + 35: 89C2C6A69690335F7B475C47C62F930C8BC58F6AE92A99AFD4D9743CB23A832C + 36: 50B5D09F74A3FB9B07EDC08A62BF546A143A1AD234FCFEF0A386B78A4869191F + 37: 8E17112C6CB1399A06443509CCC95366C29CD72DAD72198C2395685C56FD5F1F + 38: 4910E2311E19D30748F38E265A1AAD54E0ACC89111572EA548C1B71E28C74B29 + 39: 850103B8D08D566159D0BBFC175987F991790FEC8D2905F9EE38796301CC8FF9 + 40: 02BA324D30AC854791579BEF4D356A6CA0B7729905D241058B8E5A726E74B0F3 + 41: 1BF232E67BA8ED72F1BBB4903B2589CBDFA880292AADEB416B30093439FF2477 + 42: 5D5A49DE3537A39CFC5F67716608A5012A003D5ECE5416A37DEF8E663110106D + 43: 2D3BB57730B167157EB825F3853971583F182456B91FBDD75014DC271887397F + 44: 40ED8D3D40DCED5DDE358163F73A2B4BE35C609522620830880CF6381EAEDD23 + 45: C7B82C4199A88162D5B04A4279F9A59DFCF97239D5BBBF4CDEECF3B475CC4A8B + 46: F338292A6F44F97546774EE97C578815F2A7BED5AFE036952DA0677F92F3FE1A + 47: B2E6C01E2D03B78BD71C3E246A85FB076B30F83159AA43AC18E33ED9CC232982 + 48: 8E7A856365F79E42004AA1A47A3B83E8E6D0EBDBB602F62793E574139B9F2A17 + 49: A25B6AD8226FA9A9318CB86CC7714CB0BEBFDE6C20572BAD7B89925F0D09A7E1 + 50: 57FA0A179B510246B3F8D195ACB103CDC86D8315588325EF536C47FFF2772658 + 51: 5CF520297C9B06AAD67483986D4C018A70C67173059B9EC20DE0C4F58278FFD3 + 52: 667E55FA3D3D6AFD3CA3AF6A60016598EBF2B1E98B59C702209C247B3360394B + 53: 5233028F23B5BAB4005CB86EA31B16435EC1F6C8FCF357580F6789DD795F1E29 + 54: 81EB9DBFF576E3236776D43B5CAC9DBA10685CA4FEBDB0DBA8160D5468F109DA + 55: A91A138E3374D2D8FA4791B83A93A311A06A2926EF70153428CF6E1B239C10D4 + 56: D192F5964DC70118FCAC64BF0EB838009B816D344F67B04E8E78D5BDE783E54A + 57: 6ADC19A25346D39409C264466AC7EF7EFE4A88E765A8BEAA191266791A906064 + 58: 275AA07CE6D62F62FD66E479F300C00544F697250B6D773F91BF06E206F88925 + 59: 15876B15FB6B696F89E78A040AC70BACF0EF0EC18389A5C4CA5D6D2406C22454 + 60: 3CB8D033AD71B9951AC09797B306540AF9BA7819CFED6793E9DDA6C93A0D3458 + 61: 829824766EDD820E8947845C98130D19DB0E286FB465344936326B6DA5633A44 + 62: 8FFD849312CF58640B1DF47AE8FEE5F438CCC3DE342E92A87A4F6E69EC27087A + 63: BA7AF58D214BB604BCAAD40AD55CCA7D9815E7535F1C9837BE8FB8FEE2519560 + 64: C8AD478F4E1DD9D47DFC3B985708D92DB1F8DB48FE9CDDD459E63C321F490402 + 65: 9A11F135D2231BE8EE824D1E9D3204018870DEFC2F469F34EF5969B4815CEC3C + 66: 0BBECA7B5BF86D84E697C0E52DA482B9F0B8BB90C74C59C6358DA5458527355F + 67: CD0E763F87C88CD162FE971F2F07AC888362CCC33272C2E79E4DB84C891E7123 + 68: AD93C686DBEA416E5069CAD1CA9D627B2A040E9C3D9CD148C93DF58DD01B1E03 + 69: ED379E9012F1D3A4FEF5096688A2557B3CEB68C619245BFFCF05A14A5A846FD9 + 70: 97A26B0E8066F35D400B7F12A6AE62A290BC1CA68660B4DA8BF17AFAD6B8C948 + 71: 881AD9FFBD7F090EFA51CBDFE93DA23A0401F4446F7ADF150D1C226851CBFFF2 + 72: FE58866B2893C6C40EE832CE40FB6EB4C70FF7C4794380D95C2EBEEC62DECD31 + 73: 797061B3AAD8E724740C79DC697EF3DE4C96C4DB4483DBA4E56F852222C72474 + 74: 6A3543B82C9A14D8597B2BB3916159CF54A4F3332AE55EC9706979BABC206752 + 75: D46DBEEDD389BEC862EF7431F929CEDF81BD0A20573B539E11C8BE957D6B286F + 76: 64430AFB89B5D3B944FF085D344A96F514441962E2B2808943E8159378FDE2FA + 77: 98FB8AC5EF7A58F079D41815484B19650084E4CA68D1540D90CDDF536FA470BC + 78: E939BA431C6E703F7D26FD0EB511EF41A37F6EB386E80848EABA2C3D5BE01F62 + 79: 80AAC0531BF27D1B0E3E746C34A86DB09503636E211E59C54F9952BB4E43684E + 80: 0E34AE32D043275B50E9A9E0DD024AB024213F096CA6E5B7F16B524F0B37C271 + 81: CEAA5666FC5BD015360A31EFF0499D2AA8E7FA8391A0C490E806D785A9F80C5A + 82: 6E85589621FE2ABC1214A841B22FF667E0B797C04EE736DA819ADACCF4176CB1 + 83: 0259B91E342828924911DB5071C10D890FD65C28703A000CE2EAB3485D5CAEC5 + 84: 1711B6B8E196B2BD188B71B3207AE2B03D9B2CE42D6593F816D7127567B31D3D + 85: 63F7BD481657A2C0DA9B8C5D4BC37952AA568362CD27055049C1B43BC3BDE48C + 86: 9F8D2B19AB069CAFA57FAA67D3A7796F880F35E95AC71EF4663123616F585242 + 87: D95375FF4E6BE80944AFDA92819794259C7DA31B1A952A309D7EBADA4A78EAC1 + 88: 9FD373552C93A6D904BFB67D45F7B174530C3EF7B9E71E84CBFB32DFED34831E + 89: 832BF41E6C3A51C07B9E21C17056587D07A45012CDB5FF21A9ED7F5777E2A3E6 + 90: 8F35ADF849B78A97A5F71EBF17C102521DCD86D9D20246B6EB47F78BF577809E + 91: F4C82DAF9218F14C37ECFB50FE222644FAE96F439998E990B1A8492E7BDEF13B + 92: 60B070C296CC64968EE5E4F65617D00BE43F2E77AF4994A12D6A28110C586C16 + 93: F94996D82141AF533F903BE6F0611D2DEA7584A895BE7096B2DC35097B18E2A0 + 94: 805E1F47D06244283D88F32B046CA95554AD4018076C7480DED3CE7DD393BC82 + 95: 7804AF4E51E0C1CDAF0F0A6FAC6671B260434081F7CE05070BEDA63BDAC9BACA + 96: 2BE0AF9221BFCDACB4B88321D8CCC9CEBCC53188ECDB4E97813CD1D4C775C541 + 97: E500BB02AB9FF69F068E9CCAD41F0BF7A5C176F41119FA700791DB12092AB7C4 + 98: 0F50C9F3538F0E35645720BB51D9191138A6CAC64D9F83660957D4412ABCEC83 + 99: 05186DEBA22777FE7652D51F24ADE28F18493B809236DBD60976D213575E2F86 +100: 8C46D8901AE6919EB001CD4A9907A22AAA47954630099A473D2D5336EA7689E1 +101: AF504DD36FEB666B16FE553116ADBDD604E449CA783E54A83171AEE7DDC7E7B1 +102: 986B81944604EF3A1F26032A04537777C0ECD1CB66B37E3CA6E9B108BEFAF56C +103: 120A055C592D237C0F535EEBFC05673374FE4A50E1330293EF2C1AB611E0D0BA +104: 22892EC826B20680C8462ED416E15D402E567FF4E084B08274D702FD2411F40A +105: 1D867E60B657511E28C15C100B07B62AF37CB4240C67354CA29373029B55BABD +106: 30E02DE534005D7F3064E57AC79EBAAD483ADFBDC1CB227B889F0BD66751ADBE +107: BA6B3EB9EA0CF9247B596E0BFB1129789046FA539C068B6255F21920A14672DE +108: 9581220D4D55C622420719224DA4D72ED27C5A9083FCC6C9754E0B45E89263FF +109: D2082A60F6EFE8B4DE35E6956DB4772CC74007A3C1588D6A1475DE5EC6079388 +110: 607CA9672E3C4692E094257CE00B332962EE247541D187B6135498A2F61B6D59 +111: B08646567D09C477939EA7F417FA307EC0D522A41D4F8E7AAB4D9A889EC67FEF +112: 575F18078B5874147ECD662F4260CDB3548756081EC3D2E7BED2397F67888622 +113: 9213EE952527591E3C10FE51DE916C10B72D90B234BD366BF2D3DA89C660678E +114: 80E7DD3D16B56C9038B9A7F078199CF3BA76841E9B8264AC3E103C24D3C8871C +115: FC9BF0A78CF7BC1407ADE5D07995CE2ECE2467482BC5D04F27BEE116E33B26AD +116: 0CB94A64118CA106B5D62B7B0323085551B7688ABB99FC47AD6F46AEF79AD0E7 +117: 20B54EBF368456150152F2181E5CCE7FADD18C41CD4764236C68E4FE0D49F775 +118: 398F0CBE7FBBDC6E5C88F5A6E58DA25968705D4704FE9B16BFF7BEBF39F7838F +119: A226DEFF22F92E994B1818026D923B9C93A72F8D5B4F2CC3CF622D6492373DB3 +120: DE05697A0743D511B0049E4055A7618CEF7A3F54AB2ED031EC6D2F75C5416AD9 +121: 6F2DC08E4A30CE8C74D175BB4D8F7A32F88AA145F190BA863D146D3047E01CEE +122: B722090B50928B07B1FA3D457CFFDAF70D04FDBF3EFA1D7ED4067DBE925B4F7A +123: 6C278930B0DFB48E7D9BD095C01DFD5DFF859760CB5AAFFFF939907673F44448 +124: 35C6C370972BF0F42EBD123B4FDCEAAAC4557689037249B3D64B67F034B74774 +125: 4A36E7BAEEE661BF9E8750C48ABDAADF969A83E22A91CF7D299496367CA7EBBE +126: EE257791809CA409757BC9A21F81CBD85ADA03D6EDBB5CF4171CFF2CEC87DD7B +127: C66018E60C774D770CC6539D42C023FA974C29E3FE2DB5925F226B9CC5CF8B05 +128: BEC3EBFBA06834F224543CCA2A427CB9329147BE93E19AEB0E33A7119C7F63EF +129: 0F41A20921BCBC39EE382DFB54DAF2DB373CE6B178833111E22F45266124F3CC +130: 1CEF9A7D66905E25EC17517DB9FFD91EA71F05C11BA66D9AB11E6A46753ED617 +131: 99EC5EB5856241C7AEFBFF8EF9E245D32FBA82E5A99610549C41CF27F3AC0D53 +132: C89B4AABF8E4D1C37CA932F488DDC2803334BCDCC76953900AD630AF70511761 +133: 721F0E936B3B93C0384F970C07680A8A6293E5012295E83615EA4657ED5D7E17 +134: 644E15224F5597351AEF5C4BDD22B27CA0C19DB2244431534C2A4A0BEBFDF39C +135: FDED8FD9D6551C601EEB3B7C6BC5E5CFD8AAD1D015B7E9AAA9C9B9475231D5E2 +136: CF3CCFF92480A29160C2D38317C430E14749BFEE1788106957DFE73F8C4930E5 +137: CE9D7DC90913EE5D92745019479A5352C6D6279BEF18ED07DC0A83EE8084DACA +138: 14914E322770698E090B44531062424057B3DCB0FBDFA93229D21788CAA29A6C +139: D0AF074A51AB3138DB0581170B2F4E02F464095E9AD62CBE68A48C6938F34B47 +140: 3A81A47EE2720F109E7D1CB54A36F77B64DD465803F9717264A5E5F131DF5E12 +141: 4134FA637CC87AC52320F311F4A681EF740B58DA8CE2C09C721EEDD720179C4F +142: 4996D371ABD506E72178B4CBEA8E9F5AD781A5A566543D97F89A4EFB13D5BB5F +143: 295FEF4D46110EE21FBA0D1798A1BB7C1BBC88306BC9B7661B18ACE7170F02AE +144: A32AEB728CD50069F906559158F1D0A9DF3A8C6795E5CBAFDE00C632F08BADE3 +145: 93657342BB49BC9E242C4F5573EF621D6CD90F4A2082B14FEF85BC9884D00AC9 +146: 34462E1B472269BC270A6DBF09D9075FE9CB5350CC4B74380D17AC19D580D125 +147: C1BBBC82E8512BBBDFBCB9D9A68552BD4EF3B7953541451C82F3BC92AC8C4BF9 +148: 962CF8107DF385B4E1B1B3FE3694BBC731D21FAAAFBC2B48EA1504CE07F19173 +149: 078748DDE5FE38CF8AF48260CB531BF8EF68F2700437C1DB3E210DECB757417B +150: ADAA23CA1ED892AD1CF028CD40BA8AE2BFD3D7DF1289C3F2319072106F587A98 +151: EC656CDE6ABC81A8C85C5F682D392737C495DC871303DC3D11FC651765AD99BC +152: BC744E374FD83CDF6EDD709689C4F3BCDE56BA612469F331789AC4E738F804B4 +153: 4CD9A50E3F427A64E312A1ACD8BC39D47030EE1EAC173E84C75C481D3CF13911 +154: EF5A980E76E92C94BC43C5DB34AE25B990B1B8A4CC28E834EB4CA4A27757FE6F +155: A59526AE178AAA3CD3D1849F9AEEB914FC555CA790C18EC1EA63814E45480189 +156: 92915B3078DA2EC31978123691517835AF47EEC12D9162D269900D0DDA0EC58E +157: 81B7076D3EC489393A1752F4B72C51C9CAD0BDE0F2AEC6F402739E9C20359674 +158: 3BCCD5439FC7C4BD3025675F7A9C39FF87C8CFDBEADA0B6DD29EB179629A689C +159: 764BF722DAF72E8F04AE830B10313C836667676DD9E8A072E4A1C0482EA682F4 +160: 3BDEE46E603BC40A719E84A9913468D790EE33157195217C1A723596A9708A9B +161: E55AAAF6F51D43A5336BA4D29AF2128C3DC3BC3D9D70B3E41950F445BEB1E5A9 +162: F071BE09184E4849ED48F3F71CB254A9D792C1A37BA8F61119BE4AE5F5C5E9BE +163: B9F6E53FF9892DB0A04805270E5D60B3C62F72BCCCF2052CBABA2AE2CB732C78 +164: 576E9DD4F7CE4E9432D456D02C5AB77E15A1DBF74E60F4632F80061A756BC201 +165: 67D11A37491421224C1ED64B3D2AF9C3B45C413FA0FBEDB0ED1BED26126703DD +166: 4FEE7968E68B1DC75C14E23C16C4CDDB9FBA10AE7EDAEF32345D7D9450F05CD8 +167: CAC5458D48E6163CC843D5F18E263E3CE03290CBD5A866BD3B7D02DFF2DA413E +168: 369A33BADFA618D58D16AADDEAFF98D66B30A70C2DEEE42FC809B9721DC1C524 +169: 6D9EF22B871F8518D91FE5FD48BAF514F1165ECA0A145F8975EB4B40898DAB7C +170: 92E47248A9591F77D39067359B91FBA0F011F1C753E9284C50BA10FA436CADE1 +171: 98AC409C2E9FA2DAA81A36EBD188CEBA0B1997F9C8776C73AF360A5C9D6B89D7 +172: A9317975E935A13C8E86E5C2DBD9C829936A7A222A28B52D6607E99FAA362AA4 +173: B8C8D53BCCF1F1B65DCA8F701853E6FB575A0929C9DD7C0BCDC3381EC4E8BC80 +174: 8EB9F83DBCDB9CB9FEFAA713EA6BD300389BD5F85FB63AEB60BBF39F0072A115 +175: C913434C625FB9B9969ECDD5FC622B53152B812F605C1274A7554EE18BC26BBD +176: 2A3C05080E904EACB025774D56D60C44E7716B90ED705D8640975A1C752D6EAC +177: D4C19D7ECD62C298FC6FCFB4256ED7208D4CBB01F81CA1C1F7C36C9A55667F80 +178: BB5F95132BEC7C4DA72BC38C221CB8BE458F90233CF7A5DA470A89AAFF8057BD +179: 87F6F39CC3FCA24CE71440CF4EF792C8FCA0D72291044849A256BC7BF7A59950 +180: E05AA3289774E9C934BA4B6A621A1602BC8D52D2AAA88411AADFAC36E259DEDF +181: A104B60CA8E7B09AA4B21625A6FFCD60560889736A368DED1F4BA8EAD8EE732A +182: 07F03CB0615479FA964632E84A12A7AAFDF2B0B6E76C9AA1FABCAEB0FD89FCE0 +183: 7580655A0445669030CCEC133CB73E83A628B8E1F50C3B933C889E7CB3F83AA7 +184: A0C0169EA227CBC67D8E5942118B4A3A7B4654668E86F4C332013067DD0F2014 +185: 33BD57010692128148B62E21A1A435097F01BDD21739E1231D6E79B227AE8287 +186: 4C5A425ADF6EC2CF5B50B443E014D9043659304DA510BB841FD014F04FB955BF +187: 1AFF2039CD670EF2ED07E69858CDE39BCB0890A98725D1FB2D1DFC4CD2DC545A +188: A3007F2155E2B7314B3685E848F249CF3F32F17E0CAE736F8515F1EE8468B06B +189: D4569F3356C8B426421B2F15F6DCE14C406216A1CDF2AAE78E99AE765003D53C +190: 69AA9378F0A17E0B88CF85171AF22F569C321F66CAF3193C8DE130B007AC561E +191: 8658173321B8E1A1DB6C55192851CB681B17F0B89B10D4D5766AC0EFE389DB62 +192: B86BFBEA7E3F8D0AA23A1D1F6E38DE98C0A1046274664AD1863CF2FF9A7F9565 +193: 961450E75313537FA23B0E3EA10A231CCE0DF3ED2E5FF4EF0F73C26776CFD7B4 +194: C72220672365514B8D738D9849A029BBF0B14C4D18E7A3B27AA7E90A5DA015E3 +195: 947A1BD610A6C54D7DF166EC235ECC3A686A0AB8143EC49BEA754F12C03461C8 +196: 9F40C233C2D868926FF9016820DB5E6244028B1A041A62BAE105AFFC85A643C6 +197: 30726EFCFC02ADDD0F812300BE33ADC6D64DF47AEA20C0AA09197A80DDB24DCD +198: E3CB59A416CEB3811EF17978D65B57C16705F205D21BDB7F5B958EB09D21B758 +199: F1B4BC516891C3FA44F1070ADC05E1164080FBA3F7A17840C25B1E3584C11540 +200: 5F728F63BF5EE48C77F453C0490398FA645B8D4C4E56BE9A41CFEC344D6CA899 +201: 0E24131245B6AE634ABC4C47DC9FB3E9B97966077F7311C5CE6B26E049E68D40 +202: 3F994BCC3057EF299827D6CFA47482F17B2CADC44524D5614A5BE17D61D4E751 +203: 1288DCA8F28CFBF811695EBC38D9684EA00C5F13937A527C43CAAC3C0BD29DEA +204: 22DE73FF852BE6332DD1037F00758B975B4CB6711D515248DCEB39637385D44A +205: 397CACCAF3F87F387CFED460282AFC0D24AB5A5998EAFD93E1FF984BED007840 +206: 63E8EF934181B14EA2F6C24A92BE4D65E394F512766884D37FCB9EF0B39840E1 +207: 39E999E70DF9431DA86325DB192916A2B18FBF52DCF62026310C903CACEFDD2A +208: 81DD116578D0F4E21E9296583C816C3B4E25EBCEEAB5BD1DE6E3493E409ADB50 +209: 9E29F96453F474D2811D780AB43FF74C2D768EF89DCC8E7DF05BFAC1D9C755F1 +210: 6E4E7B7E819793A3DE17FA3D49C5754E15436FAAF43E6472261B67FC49F57942 +211: A2F86FF99DAA5BCADC9217C0995FE6E06CE3E4D67E1ADD5BCE963788B9813EC0 +212: FEDE7FF8A5C4D7EDC3DB3A20B95AEF722E916D67F64BAF89A7C774FBF080474B +213: 41C05C7B1277C17C9F6E8F2C8CCBA36166770DB970DC04F84A8525B188B5FFE4 +214: 4DFCB2FAB5314BC06C2E41D837EBB4777F861BE295FCED434552E12DDAAD2BBC +215: 078FCFC3A29207AB4F251C94705EDBD0143E8FF1B9D5E69535B80971CB409826 +216: 34EEEA9B1987A580003329CC86C40BCE5D95846CDD6EE84E6A35ABA20702B7CE +217: 056D21D6F895B9BA9BF16253EB40524B66E761767C65F41B2994F7026284F273 +218: 33D0A4BD4DA19BBC49C064680E8B224C3B5A95D93CB831E6592C8F700C69DE58 +219: A3B8D55EA1BDF8C4FA4D22593836DEEC66F9637AC9B68FEF94570F2320970680 +220: 87CC4433FFC8E7CFE0757CC80DA93FA28A78395C8CE283874695F4CC7BA1F13B +221: 99D5C39A60F94C428942C050F025B6706440B1A044D852E733FF783AC38337B1 +222: CDE4A1D28164159632243BC896F29324769BAA4A303A381F01BCCD73F05654DD +223: F1B740B5C0EBB657E0B6A28AC7F669ED8397C340AA13B25DBD5C98B8113A830E +224: B735B5CE9A81446AEDFD313E492E7C11B91E71888C5A52962ADABCD9D7905C73 +225: E44FABB0A710F907C940F87987F46641A83C5693EEF1D9CE7D82E6708B3E3994 +226: 1D515AEC5C3816F3243CDD56F5ED51A70692C08F76733914F24344487E84B195 +227: F1769B5D39F07A4ABA832F5B2F845BDC8A39A4ACE27B3E9A4F843C8133B785E0 +228: E15EE3D9F169CC495ECF40DA59780B8662E773111ADCEBB9C81F06001C377AE8 +229: 13FCE1FD10B9296B31F04E9AB153C10B6C2575FBB814605D18B9C32E9CE4A306 +230: 76D4EA81772EDE0DA191154F21F0B89B8891F2347ED8C38D83B5FB82C59D73BA +231: A592228A56F858F462243D6D63C16F14E863393C9CB1F3569E7C07033129746F +232: 7C78BD9E41844375848566C240143AAB57D8E67351150462EA36707B1772B9D9 +233: D0EFF015852746AC03A445EA89D8F620578F4D8C20CD0A376C5292C8DB399E68 +234: BAFFF987F15215490FE09394EDEE3CCA219649568ACD5081E5BDADA980534136 +235: 0AF5A64DE4FBE093C163C20F22554A41350B86133E1E869239DFE28CBEE8CE42 +236: 99AF837FCFF053E2E1A406113F87C4975D6490D557CF3991A13C288BBE4E476A +237: BC11D588F1944ADCF6B73CA650CBCC0E23A82802026E3A23C217DAC1DB2300E0 +238: 8D5A9CBF73F51658AF588FC3A09D5E51C945BB01C269A360DEB506D965B74DD6 +239: 66424CD8971E43F2F47A166654ED3F601AF764151F69A1F80E75D9CF2A94C8B8 +240: 6C6F549299C69EC48681C6B9688E4AEC022E16F70DBA705D562789D045CB7163 +241: 5F37D2952EC1F9804C27123075E61BF6BC000B2E016952CED4F7DF6EE1406596 +242: 70C9E969E885D65BB4C29C9925CD8CCE4E9B4C3DEA81F8ED88AF987090130002 +243: 558A870CC4A5A17B0313804C7C6691A318BA2A6D54EF34800BF7B50C90EE3AC7 +244: D84090A202B531317C1476EA4CC824106D635B4BD41FBC081B0D942525DF733E +245: 127A74A849A390D8FF6005170ADBCC5673734CFCA276EED5468C3436D1E4E957 +246: 51368D1EBEDDFE8A9005A5D9627BC2FFF5EF100D28E246EEB6AEA6F93027E45F +247: 0ED91BE319464EA50C9405105A75367182134E7AC3D2E5E305453376BABEE919 +248: 3D4BC2BF5E8CB5B70098714EE09E16BA9BE125DF702D0E5B80D027B30989A154 +249: 2F238528F30336D00EA4933528862654549C800427C43AEBB74675EEE827B5F5 +250: C5C52F5B2EB5DDEC9C37C8922DE4EE8FFA8B674870917C20E4E862DF8CD090A9 +251: 8C94F6ECD3E33433D04E634A26C4CED1184B9BC6AF47562C4459309494A9F574 +252: D3036F099414A9187B79D3AED2F54FD068EB2FAB2322A79C0D46B8A8CB777E2E +253: 2507450731C11644F2DE23B9720BCD71A827725F8FB11A622194EBBBE16233BF +254: 6EBBC54EAC2E9506E5A6B35E09C899A6878ACBD3F7F9CEE602982F479F7BCE66 +255: CEB94E2E8BD45BBB4AF2A3AAA05CC3F7BC010A6C68E242923CE3731A108DF8E1 +256: 9B04C091DA96B997AFB8F2585D608AEBE9C4A904F7D52C8F28C7E4D2DD9FBA5F + +Hash: sha3_384 + 0: 0C63A75B845E4F7D01107D852E4C2485C51A50AAAA94FC61995E71BBEE983A2AC3713831264ADB47FB6BD1E058D5F004 + 1: 127677F8B66725BBCB7C3EAE9698351CA41E0EB6D66C784BD28DCDB3B5FB12D0C8E840342DB03AD1AE180B92E3504933 + 2: 6A4E8EE496C5FACE43BFB748253EF689F1709986EDA8ABEF8ABD5674A0A9ED2B36A31EE29ACB146DB15F36A32B3F2D63 + 3: 427EB9311DB30F28BC248174A913C1E5A7948ABF0859E522D5B99E29672B3DBBC45FB0F538EE3C98B728CC47396F6998 + 4: 0F555B913FE5BCF7A9D3E3C3DB63EBA5EF404C3CF386A9C145C4021569DAF66BD374806C1FC5915BB0C27468F47044F2 + 5: 45D4F929FBD0CD5FBA12164CA2ADCA2222D924DE218753D31FBCDD847E735811F84FF4977B6B190E53BEF9324EDF3356 + 6: D990EBFD7654E00C1E29DFE6C4250B36B9A17B71F03086FF61F7EAC792E03C10C4A759E1539C8CBAB72DA794A35D76B9 + 7: 4CA74FCA7427EE6B1761EED920CEDA439C78DAEFC6BBBA71A0689F0F4427E5C4FDCAAA52B4914CAC70BE64954A6CF684 + 8: 4E3FD32584A399E2635A17B74B3AD3DD5B827FB0D6332288BE09103DC691EEBCCF083C7C6FEBFEE10F295067B88DA1C5 + 9: 8FF05682F7E10BAC763DDD2EA1A236231254CEE6153E431A450B2D2EF36DE5E42E254C5332D5C6D58907F8473251765D + 10: 43D220837F55B8A0058C5728E0255DC0B0075A6CE69D5FCA704BCE5CDAE189634D660B736D7BC71B32CEDA6CCCEF8EDE + 11: AF48BB366B53FBB3C046532F7FBFBF8F813AACEF151028D4E1B140C3654C6E9D5A9815DC33447DD49715A124E3CF9C76 + 12: F35855F43EA37F0C41C156ED3B56C8EE337BC2FF343F571952DD26B67019261397EB840A2FFD540AEC2623E2D4AB3781 + 13: 952817A26D4534B94EBA43FB88BABD63DA1BE5C63671CB2CB475E0ECF2A8DB9668D5772B00329FB6E570B4AF9390CBA0 + 14: 31E1FCCFB404608F0F72DBD60048EFBCBE9B1D4453A8A24E14FE7B65E910BE3FAB37BECB9B9E4C98FEC79554296005A3 + 15: 580A37B961A4C6CD76C0467BCF68C281011A03A5198F28CF98F599A4D5E9AC433CE2839A071429344E716DF4E861E6A2 + 16: 788BE9032A1EA3DEA20F24AC5197342274C8AFFC9AD07CBBE37BF1CDB32DC3A70A1C447C81ABFA49210D8C1724EA2941 + 17: 07C6E7ECBEEED331245ECD219837A4031D9FC4EF02BA10273079941BD4F7709184B06DC084D24B5F09F6096DA30D2C32 + 18: 9AAAF441D0661DD007E198795F025B7E6F76743418044E90FB949310842EAF3A78BD781E2BC9758A359C28336056BC7C + 19: A7D568F94E74086B83FF05AA32D9150CFC6E477F762244FEBA12E2CFBEE67861AB63CB443AFE04B5CD2251EB56014709 + 20: 06691A7F9CA061D4BC80E4F6A84C77F7A3214AB9849A333DEDA40DCEE95336DE1C6202AE1A235B304412DCEF03506CB3 + 21: AFD3FFA73E7D3D24747915BCAA13FFFEC26B2BB7605431C302BC0EC66DE11389C892890DE043FD114F7C778AE9CD369D + 22: 68E1608FCA35CEF6FDA2E98355CA92FFE4881F9B63AB1F6744B192C09C160B2EF23AC19379BA0443263541080007B20B + 23: E7907160D99FD530D19FCA90A1AB5927D51DC02EC39015C53279F0A0855508CB3FABC74E404F2C07A9144989DE88A869 + 24: 3AE1A7E6F8E0007F53167B85C478203B8445AC2B7B092DA29046C49BF3D9DA7541965AA2C78B7A0253CDD59659AAF7CF + 25: CC78688C451D9576B021329785D34BA871FE4F4EEA517ADA3C45615F875666C0CD090DC2456800AC7F6500D4E75197B1 + 26: 15F2E7C8944B16E99C855A5272B8FC0A38CE1F2D2D12C17FF1C667F392A5811D408D82122FC21593EC836F25A02093AF + 27: B4FBE81EED8250ECDD9DD3590AA882D2C71C9B1D0A203716270A8B83BB1701A6C32F584BE1471AAB8A7FD92FAE21272D + 28: 6633732CD2666600233B24FC6CB067503632A9CA6D0CBED03855535064DE061FA2D01E28B1D9DD47663207C8E4BD77EA + 29: 6D02805A80F7EDFB1CF91D61904F6B18B3B1274F6F11447DAA68252BB4A6D9614A527B1AC69456134CEDFCE3AABC5322 + 30: 6F9F419C1A77C4F3E4DD4AABC872C415CECF23BB28704580B17482325AB0627FE5CF6C77D6F98F7168FEBC57CEA15093 + 31: 19B75DA5D63A8BD3646DDDB644C7705F2869662A1A69B2A53422B5CADCC5EEECEE452940E1C98ADD64CDAFA853BE51E6 + 32: E086A2B6A69BB6FAE37CAA70735723E7CC8AE2183788FBB4A5F1CCACD83226852CA6FAFF503E12FF95423F94F872DDA3 + 33: EB9ABC6D96A2E5BE1BC45F2EFEFEF95D06E27E29FE0817757FB404F14C18549D12BBBAF81F43613A0151FEF81F9478BC + 34: 73E74BEF021CE493DE3FCEC13E29731F31030585462A0F243105F1879EB951A6DD51CD1F3175853956726147670B2D09 + 35: D8E03406F43A864BD81CCE2E86D454F72A3C0BF581B7003A6E74F0C5EF59D2582822FC523B385FE3C82F952B3AE1506A + 36: F807C4241853A8129613C004A59ADBD404A8A925AE7DE53025ABFD9F1C21FE7C90B7F6B1456B74974D20BF00CEDA0943 + 37: 5B42CC6A0B43D9F6AF81508AFCC8C48F6030D32820DF756A8B24870ED967113D19FDFF67C54263C61C190121330FFD06 + 38: 7F0FB5D4A81102B14C899BCB53D12B8DB092021873F610E813E64B4ECF789D5728AEC725BFC88F9C584E8B2CC612A8E8 + 39: 4287487DAC605A7CA671D1B4D320023E3323AE92F868CA9779B1719ABF9ACDBF63943D125525265130DEBB36B16B99B2 + 40: 531F055E0C4CBF7B5B12C75F0E345DEB8842144DE7B567171CB4018B148EBFAF487BF516D04B25E4E9DAF7D115149A3F + 41: 5AE617D89D5FAEE633E088EE6E4B33B20CDA06D9B13D4B9D3977AC6ECDBCCF52C6287F42718C8A8D96C4CE256CBCFC54 + 42: 44E0703455BBFC23E9D679C3AB36999ED0E5D740CB610409FBB0D171A2E48E82DD0B127BEFE8DAA97E9681B4E6E1FCA4 + 43: 9A67A07470AE13E23D86A3380FC19BF16FADA592C46E1F74ED847EBE7743B9F1EE6731E5ADB9DBC7A8311C630BAE196C + 44: 2FF7CDB8D4CD5C1114F3C501EFDE8462A900003AE406F15B2F471889330F32076C5B85ED7036B5425B54333AC707CD42 + 45: BD26DB7A72ED88F8723001E57E2BA9A9FC5C4E2B5E1FABFFF50DE2B294DC4C334932996093368E3F2E2C174D1463ECFC + 46: 3B2BA4FBCF43847AF48F9E49E6AD7C58809393D342B0761B6F95845E9847B5108C07B4A164B7C5134A108165E545EC40 + 47: 2A65F9DD13E44ABF4A784CF49CB986FBA576E04545CAAD665757F3C153EF7C21EB9AB70F444D8A9D13BEEFFEDA05E849 + 48: EB865E953547BD5FC68B1553CBCE1D3F46C761116EE881EA1A62E909A73BCAB32A898EC93FD1128E8FC603419C2D2D5F + 49: 836E4E947DBCF89A7CFA651AE678B9096590FE6B12DEA601C85D11A3EC9FBA4EDD4FC5745E50EB88A0CEFE8A80A48AFD + 50: 96165224C6EFE359842F6B1243A5D7FAF1EF426F5D519A5B4F4F7640380F22C7368AE71074649E3B8C38229AE26626A4 + 51: F069917F615F432BF15BD9C7E924EAC631F997C4C5A2AC8E00EB11E72C7958C3C3F6D73EBFEA6F43F2193FC5174AAD02 + 52: 25D362142CB9610002CE07BDFCC1F5CFB3E6200C07F80C3081E875C9DAADFD571C17D98E315D3020E92E5029E12B9689 + 53: A3B2ADD23AE5432F1CA23CA42CE6EFD0B9E30076BAB13B5E208834AABB4C44F9764EA76EEE48B5BEAFEB1DECC1010038 + 54: 58F8319D720468259175A7089512D3AA405D6C761573B112E90C4D96A588CFC82F6D38CDA680F6668C2370658F5B5F32 + 55: A9FB298676F605C92C722FB6AB428A0E8739D019EB7C11728627128C7C94B66ED5D85FC95852CC4CAE72B809600D6B27 + 56: D21E03C7C28B25E16E92C070361FE0A66D7038FEFB67F1684DA7CD498325F837018C92EC8009ED6CF75B94FDC758EE2E + 57: 1ABCE3D5590BFCE73548209E667A8DE7A17B8999BE5089BCADC8B0C76F2B2A3DE8B6950FB55CC9D0505A3D1F860CA4AF + 58: EA5E4595961E82F5D01CBE7B5430541F5EDE2E70C59CCFDAAD00E6F2E69DEDA1C74259AEBF914A1A250E20E79113E514 + 59: B2BC4CA8ABEEEBDD49EA57C0B1589F5DE56128259BD7B533DB877F27B4FE700F4536D611A422DE1591874B32AB5627BC + 60: 7EDA9D065472B813052506E71214917050D854FE5E73FEB3FADCACCD2DC640EC1D627FF99DB8BA055CFE616BFC6989EF + 61: C07811A5C2114DBBC250AF41D45AFD43E75CD109D14759C14AE32DB7904A96BC1FDA849D98591C8D43EF9279708E52FA + 62: 042DD9712B07795FE9AC327B74B17C49588CAB803ABB3C775FDA744B251C5CA982F3DE574EC37760B3234FCCEB15FB91 + 63: 327F97EE34EA7DDCE677A4F7CF3531FC5D47F57394A0E62B8E86DD5FD0690286EE28E6235E8FD296070EF2813C816AED + 64: ADF2EC9D4C135C64DDD796AF90462FF4EC1D3542CC7002DD8CFC20FAC50A0FAE01A65D35B000D191398A5EC57A1954E4 + 65: 75D6EA64D59EC622BDA970ED8BF034EF19840E1797426651198982FBD8899F6907CA3A5910E2CB44AA48ADC149D07B43 + 66: ECA433A801082C9B767C6F2E7817E0CD01B807DF6C2B3A3FD26EB283E771550AB722923A9440D2A68CBA7868B19485A8 + 67: 1792DBB0259E6C4BE6C5317F3D48E1E43B6F7F5AF6D12F24A523017C7B46924B24B0BCAFD85B10A92BDEA796232129E9 + 68: C282467400D993300EFFB83B189F4DCD1D1EF2A32EF5ECBA4AD23B6F455DCAB8EA3D6F16482DBFE286EBEF594D587AD7 + 69: 71007B69C9B15FA519AF8CAB73514A8B92534513AA19153E7723E56AB54C34BCE618BAFEF9AB92D13298BD35CB6E692A + 70: F82EAB30F732330E9692860682EA083586216EE761EA08C014C8A8DD2DC08FC9901942F311F63F63BF3AB8B4DAB14975 + 71: 4BB4DB01AC1C1D1A5DE657436ACA5275E4CAE772BD6AB9B358E0ED094202BE9600724A5BDFEF0461BA7F1DC2427CF155 + 72: 240914A09175AD5BED4CC2486F1CB2160EE182E3B71E17EFE5B82DFC0C8F0A8AD30C1E1A03CE42F31E5EA64074CD6F66 + 73: 8F8EAD15C47CD6F89ED7110D454759903DF4E1FF3E2229597893776CFF5195DE326080B897A3833C20325A3A127F9064 + 74: B815CCD36BD92DB0F74CAE305B7B77182EA6741E729FEF0BED0919C42E04329C2602535784C22E35BF8622468FF0E5C2 + 75: 0FBDE2B10A882163D2B52AE4FE609FCE18DCE971241FE9AB5DA3D486BD51E1445B14B65B841A4F262B994C2ABB588FF5 + 76: 3CE139E2B58F5E0CCAB2E4D3DAF8DB4CCAE348E97B9D87F5C9EEC91508DCCA697E85F8CC6CB399FEC80BA084528B9EB3 + 77: A9469B079964D0F8CF27E36762BD3F8E9F1904B4993AE622AE01AE4AE926E2563BD36F960E3E59341F92846F253580AC + 78: AA5FB18258FBF838FEDC3898B421A9A1A742EBF0BA7E8A8947545CFF5922EB0E2F92D8959002DB97121C93861DDB9643 + 79: DCF1486489AC46EDE14EE46C0642B9456E370B45A52C8611714CFD618CCCA42E63A61384DD7615F4042F36719099C761 + 80: 849BE67D56B19F08667FC7A6CC7EC5A5813BA6EBAB51BA30B5B1EEC99A7CE364C6B3DC588F389C830B174BD946EE6913 + 81: F67D9CB19E53910982C73B72F1894ACB02F902E25CF6050E4289A695365A3CEB482AF6215CD0323B4E587FB5BAB392C2 + 82: FA36BD7CFE938653150FD74A4042BC93A8A822E9F8173571A94ADBC1DC3429D5C531F516D04228539D11E496B984DDFC + 83: 861A3A316AE078F5DBB8104A20840D578D68B3301753F08D831D077A71C7665D104766E50959D2549ECE4680F9F7274A + 84: 6D313D3151483C6DDC5CF8CD6AA184A397EAD7698BFF1E133942C4325B5341D4DB01ACEA6372D893A4F9998039B80294 + 85: 2B330544810368EC3889068A58317A0E33867F60F80CAECE9DD1C10F0BE08C3D128881048E4401ED3EEC7F4AD72CD88A + 86: 7CF48A30A434E6CADECEEB13E1012E6E96388F1E70B1398DF1C1D698DCA96A54D93BAF256D2356FF37B8E6512F35C969 + 87: 8157A2A24F2B087872084B40C14CE8EA874C5F3CF99CC7EAEA5B20F129D2D77C79C6EA42B12C2C6CC557E2CE0DBCC1E4 + 88: D4CBE9A60C7EAC9FBDB9AC13442A0F8D49141B11D3F9239E2318024A501C72D2DD9ECA5401E7F97A7569F905F414A8F0 + 89: 94145EDD14EE5941B0640ED98C6966333779D21B51E3EECC046E1833210924F2B4A113A7E6810E2B670FA28BCEA84817 + 90: DC5F8BC7D2AE1B645833C72C4DFE753ED9E742D006D20490BB52954BE27D8556099484E5C432D598496C6372059B6B2B + 91: B629CDEE3C53958792CE699FE35B2678BABA9BC6F48CB5FDB8A575F180C72301CD6ADD8690E02412E6B8CE8327358F52 + 92: F26B761B5F75F407D5AC984C3B81F14CBF198A76C7DE0692253603D422EF8C4926B018C0ED210ED8549AC78BB543C64F + 93: A88234F5311E7438E76AB5DB42EC62878DE377B74A1E951168A2D5B1D00E2C2AD7F9AD322F438C58E6E879CF045C390F + 94: B153A0BBF5BA9447B0BC53FC71AC652C279015579917BEED4BDB5225BF592D63F871034C93A88518A98D0DF5490E82CC + 95: 4024BF283702055A9460F24EFFE8963468FABC1D54EE4172231F786652BC9D45CDAC121C88F92F4B4A707670D89E4F05 + 96: D6E266970A3FDCD4A833DA861599179A060B576959E993B4698529304EE38C23C7102A7084C4D568B1D95523D14077E7 + 97: D7992EDABD2897203B1FF128271AD5464ED507900D9AD3D0701CD4896AB93E76DBA918E43155AB908E6812FA40C09DA0 + 98: 7833168F67222DAFFC2CA272904E248063BAB4F8973C69D0F85CB665323389F15D533C2F3E8B55F0C3E71D59A709F9DA + 99: 43917A5FEC80AA876D11919AB0C739681F912A998A190B051F75854388F1908BF5306231D33F4E30E50994D0FE7D949B +100: F433C88078C2BAF1A5818887F8C36D34FA62561CE3DB34EB3C9F8331A357895DD29DC98286A0ECB64601B177873FF813 +101: 1C3A5CCC5DC4030BA16305A85F59DCED8CB5023DB4479E8B3749A7004AE77BB18996931AF4C16409EFCC0C72CAA4C1A1 +102: EE8A6C983DAAEC5976CB0ED4446494D348D0D571EB4C77FD8CF7EEBDAA0733F96DE2BDD8CDD0C70F5FA4391A336107B9 +103: 1F91EE551AD18F268876D1FC262F137FE196580216C5193819A95EC5222537D2A658DD129C3D8080E65EC7460F1F4704 +104: 5B8D0D5CF8B41BE507BE8FCBFCBDBAC3A28EB368D430FED6780AAA78A93A8DA4A6C50485949CA344F228BE91A96005A3 +105: 4A2F0A8F2F1F4CC4605CC2537E0BE28CF8B465C30F0A54B494A7128EC54EE4E85706B5E47A5697344D15CBF85680CD40 +106: A29BF5A49ADCB475A13C656F4A9D529CB7CC586B1D931646DA6172D7D673EFD745EF16040099F435E96168B0F4363E62 +107: 8A6E85CC4BD8B2C161C2AD6DD96B494A33F6F5839A7236D0D9A0747B888484742B8BDB1A6CEFBB4DA774B8F5A1059CD9 +108: FDD86101B1DBCDFA8514CB2668728EEB47BAEEE250794DFA7955693A3C316B2A95532F11BECD8359D6EDA99912DC059F +109: 3410059B9C81DAF99CA10CBDB58D6EF9301682AF4B75BCDD5B50A36127E7A2EF4CD185F10AA707C57B5F0D9FD6B6D18F +110: 60D28961A90F79CC60D2085357DA8411F6BEEC0C9FE1CB3FDBC2D80D737DD83449D6A6E3D347A6E286629DAF87B66178 +111: BCB12B36F8BC6D74E23736D19008D07AD6A9CA3E29FC17F5D505BCCABD0F2309D7BA11BA421F14286ADAA5575FCB83AF +112: AD107FFFD282B3F49F01AB1C88F62E88F779671721FACFB7F969DF1D96E942FFE13E1629B8DF9BF4C4B13B218FDBDF3A +113: E65FF7BDA6A992B32D4C6F8A13481CA6CD80161D6F44780D1244B02F8B06533ED0630DADB4954CD7B88AB6FFC35399CA +114: 123ABDF1D6B601CD040090006D6F80A9831AFB48C95DF4065E1581D334F207F66360E57720354C76AA33C57AAA7CD706 +115: F04B9EE00D64D6882A32B7F1191B1B30F814C69153143ADE1DEE49A710088E938639945AA20FC9C6737415F44E3CB9DC +116: 6F7C0F4892E676B880D4207020F41E0FC4A2F307697A25E69529C0B9B5F8CC0F1425577BE5F783D3C8A02A465DE18556 +117: D821A2E3EF04C924B3FD7D953E72675933B82847A4891FE260C6B8D53B2DC5AC5AF0BDD2B37D979024E91521EF60D877 +118: A7E97286C045A4BE5063079029360D07BEA0D325A70BDCE30076E761B34D363B3E061D33BBBF1BB26D65BE918DB4E767 +119: 00AF631F808431398E9EF320E97EE5C28110AA9FC9DD9365D536E8170A7CF3F36699A0B99E15BD7DB8E2CE614268D9FA +120: A160CC9D12716DE4020C02B259FF712A7C4CE3488A8D22871CF5CC13B79F110EB35C6377046268E9237016641F51099B +121: DDF7D046DE9C741C67E4C6B65F4EE6790EDF7F76A3AF7A997EDF23BC1C7650B4311E53C921B56520B95AD52B505A357D +122: 5DAD82A9A04DAEE4E7636E42801A1FB9248F3F0FC8D7337C3838B3DD4AE5F08583A00A3295FCACC1435A9D0E670C1654 +123: C193DCFAD7E89FE66E7E3D2664C541B407DDEC921EDD35100393EE4BCDDAA9F086C2D023E161A604695A8333BCAAD4A2 +124: F4421A9C548AB2485507FB2C2ACDDFCA6E9481D10E9057B96A0BA6909E308405ADEF66D8586C1A91AF25BC4DF4F349A9 +125: C250A60DBAC9DC3AA06DC752D6ABB5BED93FAC50BEB8A2C52FF86C71331C55A1D3BE05E4136B2DE811990BA28D1CAE36 +126: 750211AD5768DC4F99A236908DC832191AE16F65C616CBA0C0F53E60B98CA65C5AB2E0D1B7086B8E1001BA85AABBC883 +127: EC728F56EAEFC03913FD2540AA1EA2D10BC4631A074A793AA8DB687E9C3FE8B6581C37445AA6C2C90BF76A489B62D2C2 +128: 77C4B75F9E92EB8DB8E3F9074C3D3ABDF06BABC9868B11F789112FF5822F6115421E0EC1627AB580B830E6C12DB692E5 +129: 5E7ACA003B911F6CB318C1182631D9252F90750F901A377F5F4FBB87BF2A55DDD11D87B1D6A51658B3A20B1BAAA296C0 +130: D33BCE776E6D67139EAB8DFF9FAE5A7F012EABA15BD35EA1D630830E6A7032A9F2E277711FB5BCAC6AFEA7F390A876D8 +131: 060858A71D11780D60E48B47C1FC6357AA0AB77974A38D1247DE8003368E5721C5A3B289F7AB2DD42EBF2C42282F5624 +132: F3CB3F6C05914501C89FE8536163EB0CCFD2D9E63A1591698DE7AC0E3CE38835A9F623A208DF37687E1956115CA2E1F0 +133: 72D7F791DD6B7E70CB118634B458BF6977A64B1A6C27A136464AE12DB9E7ECC5CB2D7D73C8FAF07D4D93D1B2E2F1C0DA +134: 0DD4000D8A25D0CFFDFE2B7151FC610CB5BF25D9249D855CE8D0D647D2151235A12092A75233EFA7820FCDFEDC59041F +135: 25D2BE1F5A681F8135992E0CC18A7B0758D1A880EB3C64D9C722F80D68B744BB3A89C223A0C38164CF4A423F91F8A533 +136: CED899B993A69F66251A7872FBB87F8BE5967857B2693E3FEB032B3440DD94B78CAB782DEBFA10956642AE536A8241E9 +137: EF446C45F31F98FE3AA92392EE4198D8C797128CB87DA84AD008AAD1E1D972D0C6D98EF74E99B4BC5B97AE92BE53EE27 +138: 1A7EB818F91840BE12AAF24D39D5C81051FAF5814BB64DFE697F23B2822BD3537C1E7623DD9EA6C06CD2693F054B3E24 +139: 0F35DF35342D118F3372E3682BD702B04C420F239106C611219DE4E0B1D7121CC9484478A7F4BC3B5C0389BB82C8046B +140: 0E10FEC501B24CFC5DF22085FC8B7D43638DBF65709304FB3A6A1BDA7815F2D0C58EC6BF257D6B16B087C415AD35C1E7 +141: CB6B185E7F5E232DB435F2D02F6E8BF16DB60F895FC92CBC7FBAD356807C5D693853FE638305C4D163D7B35D51B9041C +142: ABE7A3A2309B13851157043658589D3F011CF2B58DED164CEFC56654146F1884ED73D195C5176EA879F7821E9C332B3A +143: F25214F92D3B1CCC162C46A74AD8FAFD33E00ABDCB3048744D93D36BC77F2796F92D91CEA8946B357F14F249792DD8DE +144: 2FE2A7AB6DFD014F013C662E4D669AC595F7D80BF8056D156BBD0135DE841C17E7E544AABE568DAA2650EB58C0506413 +145: 16F18F6D08B03AD95691DEB59615BBB7330FE8F75DCD5F7B314BC022D3E27821083EA37EC2AFF3A22431305BFB315342 +146: A2294C64B7941B21124AE0B3A73D54D139D67965021201FD46F4F59BF7113001BA8C76B0E6C29143070A40966D24D9A0 +147: 6D1E58EF4EC828467268A92EEE3F622FE475DE8B1CEF0A38031C9CDBC7DB3804A683FCB9257415E904883EDA4D8B93DD +148: 8D6482ED3C1B5B1903D921D9B32B197CDEA5ADE41BE202CCDBC5709DE4D6AF80E11CC2724FEDF2C2D77BD8831A61C339 +149: F726B44377CBAABCDC3B4875D4B369769EF8F2C11D28F23ACF196A202BD3364ECFDC4B032F3E05E8088498D6F32ADCBE +150: 12560A76E0A4A4222AC89EC18ACE2843BEDBE0EEC4CA689C6A9E8C71C64DF0311BA4C14957C54CBD190CA095E386811D +151: 144E9531CB3D3379A6B1A11F335BCD21C712BE8C6B4511EAE05EA802AF5D78CA049BE38F886777A8FF9449B02C4E0E8D +152: F8E53817BFF912A42876FD20E35FD064A05F39CE42DEABEFB435DCFA2466B4ADB3C23765F13BD31E3DBB0005D695055B +153: CD728182C73A391043CA41BD05614CBA964919588017F3C7BEDCAB9DB3F618250FA3418C60F3BB0835E27B9F8964BBEF +154: 02636722F4F0E21728201ABA1C86B6BA79B57E4C3AEDAB300A7D03F973B938A74044EFE7A477684C4715E8D9335B6188 +155: C9917BB005AD6158EF50A2A2B1C3680F88796C70C9D3F87963E5D652853A4EFFDF26645811756981132C09FB855B00F8 +156: D21D724FE7C4064144A2159EEDE9331354998F631F9975317732FD5BA049095B741D9B200C027CEF5D870F1C9DB52EE2 +157: D417B70CEA7FAE4CC1CB195A5159FADCE9A8642F9B229EF1403AA8AAC3C3799C4E9474356BBD2B7860B74E55142FE048 +158: CECA34BE220603EA5BEB301A360255314AF963E0D0FDD0626E578C0B42A5F44686C7F15B5062089B7809CEA61DE6394A +159: E7C2C9E69810413212B0DF7BA4B361431D4F3D20AC8730FECEC454EBE12F18866B9A4B5227989DC61C862D29786B6595 +160: FF19F7FD7BA1617E7F31397D0D1308E035860042DB2DF5AF812895CF2C9EA36AF9234D730D2A633D87C8D836B1729BB8 +161: 672D8E8F7E7AD6BCBB602F1F7F15DE7D59AD72F441778C061E4961A40A991D26E151E7A5026C2DF69707D19BA1A4219E +162: 10381CAF7829383AADAA9569CCD84ABE6505D78817FCCD44252D71D1A6620509318C26F4F1193CB6EBCB0450C9BE9CA3 +163: DEAB3596909B7463E53801F6748DFADBCD615FF8C77AC2F78D12ED230B758CA717F157A4A551B7BE42D95EAE41424363 +164: 3E44362375F671109371AB12C4E21DF3B4F69FCD0B22B5B408D52DCA65886A335AA02C119B1D4DDE5DE316A0426762AB +165: E289F3866AACC5FA881B43A44699D69887AF10D96CEBB47D20713EB49C50B3D1F9D71DA9EA4F8D75B194A84738E7A7BD +166: C93A6A3F09E1A61FA86309398663486E96CAB9D6FBC630B3CB53F520EA77E18806597944CB780193EA79D4AEFD65E20D +167: 12442EC232A21DA5FB424E8C51416FEB6E1EDCFF3476875A80F7F2237CC873BF85EE0AFD93C3F7BE5C1B33D184FBCD4C +168: A4F7BAC5ADF27C96BFCB084091D93C51B4E6E8442A7A1D473171C2D5A73F97EA8FBC4D619FCAA642D3B3AA97C9D7CBC6 +169: 6858BABFDD40FB2890E6EFD2D32A06C5C9579C1ED70ACA8796BD1B512E61233B0A3114CF78EF02CD9B2407C9D26447FA +170: 75A5AF9FBA49DF9E0774B77B60BE134A9779DFA560AF54FC632E0275284DF5A006ED485095D8EA57A358D748B778A111 +171: C8BCFA5A29CB50F7DE56E258806F0E40BC8D4008EECF765F444506534FBA43B1560CC5B925CC825AC23FE540A5223225 +172: 3D8CC6117A23AA303ECB4596C85C070F87335EBEB1CD0C0FB78455EE271E299E5D68E43545162A12B1B31D4C89200BA9 +173: FF4033A73D1615DE86C770E25D05919C0CD18FFB50F3E8F832BCF0D65DCF91FEF57C3C336807A07708F243946091C6B1 +174: 2020043B473B8A878548E2D90844C0AF4F51FAA8BFA7C4A80573336840C8D599E328EE197688443584C57C9B0CF2B67C +175: 977197E70CC7B75161AEA543971E09280E04ACF639B031D954BE8993CC72FCCB50FF1BB8EBC7A9BED365EC65E7F0B923 +176: E954B99371301C4E29225E93BE7A8C42864ADE844857B25F14A42854D568155398AA69936DA49FD268776DAEE2EAE75B +177: B6DAC53FF0058619CECED87E7F0A8DECFDCD44EF201695EFD744970B53C2110B34A42FFD8FC3ED385D22515A5DD7FA00 +178: 338D89616AD5FE0C81FF4D64CA274F29FA2BB15BD1C03D551180EE545D7588B961EE59B6A841BC107473A5AD9D3003D4 +179: 26D29BE4726EAB64D207EBF0B0A653C5BDB49D4BE0E3D085381007182DED1F4ED1575BD3D951711D6D49830F4B736B1D +180: B4E2F98F6CF352EEF41148459B3AA81AF033EB4EAEE10517DCFB05D84EF9552241080A2CC78C60034BCE5760821249C5 +181: 659E63335B9E946685B923447F6E08950DC97736214D38DCB0A1F46CCCCF474C204A5BB3702E76504C3BBA59C238DDA9 +182: 64451295F7CE5D38916B81812E4B10E5D2663C311A43F02F927FA0105247571755C5F9931F3F521F4616B45108164AF9 +183: C8B6B136BD8E8EDDCEE3637C3872B9955C63CB62DA669ED5C664AD31B9A77D8A91F8E504C0B51DC03E30CA59F45AA967 +184: 9E0BB33CEAAEA09F3805B152A2DA475972A8886539B45B3F016728364083A11E345A2E32976277D322DE576A660696F9 +185: 86CAF7B9DFB6BA1B79ABE881DA5891EC98E61ABBD4B7F889CF5B4F01D9C3AFCD0F8AE5FE9C0D967D3F1E6106BA99C7A0 +186: 83B69D4D2F1182AD64F5DAC98AF3EB4B8817A8DE9B9D3C1159B3D1D1AC4BB763B9CFAB6E89B1BE6C289C04A7983B2958 +187: 693F93EFE5AE69C773B6BC623FADF4B8247086EBB424CD393742DCF2003242C85A843D28D98394DFB9FC45EF297E310E +188: A272286F6C14202359290D5503C385C7A09318541F27122CFC1E008EFA1AA5F8E86A7B89A799D9171FA91FB1B4FB79D0 +189: 4B0AF4F1AA4F03B1A12034328D2588635E3CE69C92A4A23B99F9E9EAF53CB80FE24964AE5CDC80F82D2C4F6B1204EC69 +190: 79BEC27CDF535873FC2094929ABEAD60945390DE5D1B0B6F978B9856F1EDA2230E7D44458810CDB6EBF9E1FD1D769903 +191: D2D19D934FF6AC59743FD35E538155CFE3402DB68116E8F0C5AC883302D2D916A8E704F4860F4BB8439A4D8A2DD188AC +192: F47FEEAF14CBDFD7A1A41CF15A1D819095AA673142EBAE96F43E27C04990B1A8E88D85E3DE952C01F931A32964F74B71 +193: 5899BAF4ADE7284EFD3E985E20145FB8E1B8D37B26A0D8A286C342D27BF65BDC96078E81802AAA0E9817AC38B6CBE259 +194: 45210363539CAF8ECE76FCDEF07053C23DB49A4298089BC06B001F2D03712AA565A4E3DF20828D251CAD574E1BD4CF09 +195: 68C4994FFD5DAED4071AD382A1F5D3692AE12BC12974A13E4EC458916000F4699DE8C41DD53492860AFC6FC32EF3394C +196: FB1922DF64C07983F8B288602BA7FBF81285B0A4367BB18047ED2D520B90776819CC900169D38367D3E3056D3AF15916 +197: E26F2631DA328E3475A4ECBC2CEE90FF6C07E60DF1C630164193FEA932109B8493EE6CF95C3E4EAD01CD159FBE2D6338 +198: AC80E42D1F3CECC2C55CAA648E6E28C4676F4FFABDAF1F91C652AA44265CF1E261842308B19378F14A035D80ABBAE5FB +199: D66C1CA84D69B546D2E54313DE3DAC651B0AC696C2AA9909A6EBA20736716D9262E0163573F6F1C3F179E9F1559F0EFD +200: B13FEBB1B3C54A7C6B69367F693A1D1F3145709B6DDEF23FF15874133EA1FB9CFA48EE7FF4EC9AA987DEA641E33CCDF7 +201: E1ADC09F58F561140C959A1F1B8945E1098DC62272073CC2209B65A089CD714E0A472A1325BD2F6B40E4343F933D62D7 +202: 499C8B1AB4D590B225F5E7C6B85691C4FDED5BEAED16968FF3AB9B25FF1412AE970C153584B731CB763AC7DD6BA3D785 +203: 0C9EB9EB4F3C025488CA6526A6B503EC466B62719557F00055064708A819E76FFD24F90A1F9D6851A6FCADD52E0499E9 +204: D359A919FFAC6B0041AB766E9F2D0B02ABB5E7CC491AEA8A0EEF81AAA58ECA52E1262C58925D9FA4C59E73E948E5AA54 +205: CFFFC9AFAF1FECD47E4554C3C94FA6F4D08887F1DCE53D9E78A4F224AE38AF650812334E1845CF60BBFC9F8A72F0B949 +206: 2DA46ECD91373DEB9675C75901D3BE59ADA8580BC8F71DF2A3FF1AE02310F23681B6C6FC840B492E59E017686EBAC7DD +207: 05C54EBCCE483360359D63BF0AAFD97E2B15B00EA40C6152B3BBAC80285711CD0B00FC234CDC214251E0AA13E38A0008 +208: 13A929EB9E4AC18A07DE84B17E79BB420A86924B9DC4CD80038DD61F17770FC42460F2A0A717DD26FB6B6B4DE357AE02 +209: 4A40DD56C8A2EFB2E3DE6F05FC8FE00DF8AF8869A66AFF4FE734F9A6CB0DB930D547FC0F3F213F6B8A172DB13B15EC5C +210: B34FB3B13D1EBB9D330E6E3FA5EDDCB8BB3119502B1216A28D39CDC265638703B4C163F6D9FD063CD42741251D8BBD86 +211: 6E6001A3A9CC8A306C3AAB6D6D233D1158B95282B7E39B512E6BFBD5F2B08F1E7A0D77F97325BE4372A184CD7D0FC826 +212: DF6879C1388A1F05DDF772F3AC998FFDF74C88B56CDD359F0A597C66D64848E972AC5B4DF7AB4242B90941CE36AC5F69 +213: 77268B4535A9333ABE05E59C82086F89F0A712F4BE2A1BBE12F54CDB1FD62A27D952E7EE05B73998167E03CFEC1D61AD +214: 58CC7C573FED2FBC55BE05E8ADCBEAD1DDF510307D2F268EC7D0D33167C782BA494FDD6E3AD7FCF4DBADAA3B99955655 +215: 52AA81CE8BDA97989DC2759F7EBDFDFA2AAC37C130C0173846B15C17B9FA4257EC13AF3FC2A9B4B7F9C93812871203AD +216: 90C856EFF09CA0F5BAE42412D1D85FE717784FD065F185D85CB3A7DD2C2390860989E21E9BF4F978B75293682473D76A +217: 2FD4E398CE75C93218B139AA3D9AA526ACBCF8F0CD9E158A2207743DA9CDD5CB0E8F198C7F58395391EACE180D3BDEE3 +218: 57BACBA8E5F281DE6239901F674AC8DBFAAD70EDD47B0954920826C65170183189144A3FBE9BC9C1E019D4F50FCE9D85 +219: A53EC67CDD6BB96AC0D170F2C3D00864BA299A5378620891A8EEF134E5EEBA57387C80DF4EC7688BFFFD02B1886F868B +220: 800B15DDFBDEAA51EA113F50F5BD908D94C817B9135A753FCB863B1BEBCEC83B7B6501D448B2028927EE0DB39739934A +221: D9152BC50B4B65E6C839071D1BA8E4C6F7BA36F0CFF4EB312F25D193273C7DE56D49D491271BAF8A1966FF825D708499 +222: C6713760D2C7882B4A4AE56016A9CEDA8E79181DDBB56D71DB51D5F0D3549B3864DD7A9C5A1E116E3AA44899D219291C +223: F83D07855D1CE216BD5EB9DBA928A7199EED848EE558BC1B37B1B9FFE58AD92639C3BEA792CC0F5DD13F53E5A7B6327F +224: FBCBE362486F498A664400D2A384D1FA441D17BC6FD67CD8C058E1EB4FE9EFE5CD7DB9AD5EC72B2AB3C68F4C89BF0936 +225: 2C1D8DA9529FBBCEBF9E90142FB60D31D89B0C12A0E7671139DB2FBAF20C660085160127BA552DFC86D4D5A49312434C +226: 10877E052C3BD934695E0AC5B7AB3C9F98C315D230AFA68033D8C148401E9EE1F227480A66A04AFB971F57A18AE1D901 +227: D9638758043DE836FE6422FBB320CAB640CA59E184411DE5251A57D9ED10E3EF7F905F45468B5107329BD9447E3B77AD +228: 5A2D786E50EC7123028F0F7C0AF353F53C388A38AAE924A2AEFA8434E9248C7D3DFBE1F64FBB441FDE8E5CAC8BD3D946 +229: 62CB74247A5D9FBBC44B80F84B1C101255FC0DEDFEA35F67E58294BB40419715E0BD46DF3F678D1B0F927227F34F018B +230: ED75860E2E54F435C2DBEC981DF9BA0C85854364116CAEB16EDD3AA2DA7F5DE6B59A6A514CD4924922E0E49D05D645C7 +231: 9227286B1D157927BDE9B7F1D0EC282D4FEE5616AC69C795D87AF5ECC636ADB551A1D6EE998AA450EE036F9F996B5D62 +232: 3154CA9AF38CA7FEA5AA150A789E3B6DBE5453B8A9965972B7DD868972D26328D1F8FCAC89F02E88C24610FFBBE309DA +233: 9896F65C76FD486749F4645EA59DB2A110BF563C90A08A557481C7B88224AF5A55687B9DECB5D421836B8689F6C24B4D +234: ACA8E1C888B06AA00BA77F99AD584131414199AF483438E5914D33BE53929563911392D330187DA3062B382AA2275F2B +235: 90586C742D2CD88BF21CD78FA33A20702F7C92C7F151E69B0D1354E94242F8D1698EB94B95455DE8287EBAE36ECAFD3A +236: B30A1C6479ED2A9BCB9C6F4B96708E4A3DA2AABC32B70AC66ADD8C1EC7EF8902140B8AAB4131CE0DC12B444654492279 +237: 52004ACCA2FCC007F28E62AFE5EC878CA73DA8A2D5AE0322C3A33427EEAD0EFABC29DA9DA638CC9840DE43B481E3F95A +238: E5BC6D54DBA698C8E0048B096B8BB6A6F2C726939344C0148BD9578DCF17AF17A8179CC8437D0A6314B7E01976440FCD +239: 8E6657E3957E757DCEC0B9E895D1CBD1E9D51F72E3ABFBE09342D029BF89EF03B6D2CFE84BF36DE29F224C7C148B63B1 +240: 3293CD451F851B8A796E59B4A984E7135DA9D71C4ACCAF883CF637A11418D891617C1D90D5B77574B453CDCD76164BA7 +241: 1E7A7CDB8BFC2755806A3A49D75E4336214CCEE5321311C66BE7DB906C0434D4C2B300B83FFCF17F6CA67E28123C998D +242: 9D65F66674459F0AFFDD582C7100E54FB255E16B3C8A237B5F5D025E0478982983C146C0E3D0C57BED0FBCB336B97765 +243: 79D76C8BBABCC33429C5768A17C50FB8CC79178A204110E0721D1F244B752E87869D8A7BC9BB635B7D9A01B7351D2B14 +244: FC2068814A0CD0E8D67D82F6332F9F7C1840F79B998E8F413B3580F8C3897F25CFD7DA579C4E4B34BE9D1BCA7B40C633 +245: C3E654D188E54C4E177EE284E3BD54693C744E82FC0096F2DEAF245BF27AE587F0303B6F2BCD74F908272FDEFE6BBDA1 +246: 2D24B99C1E072C27B52FC8CFC4C1200777BE28EB50423F40B99BFD99A86C03D4D1509A2A9A870584555C9B731BF24E48 +247: 1861A6A2F336A5C2C8242B62437DDA687BFF1A45C7CB2A3B3367C27D6DF5B508079B076D106BC8CC8B6BEB0AEE13E907 +248: 7154735277744484C4CC0DE816744C9AF4A206760D9C68B016E6291E31AEBB120026F97D1F5E698CB33DDCD3690F9D60 +249: ADD47723704F546991DED4E9C46B13E8F768A214A1045A8EB94E9BF914416A04FB214DB8AD321CC036065424C7135C4A +250: 0E6650FD76A99E9E9C6A1CC23BE7D53C2B3AD7819E9447ABC11B80B167DE169433C530602904486DCDA00F18CBF69ABB +251: 45B27C1ABE0D787D3DB33E183E8699CF5A2CEA99B058648285D129A8D6574ECFFF8E66EBE05579FDA8BB4C088FB8E1B2 +252: BEAE990C7DB7B18DDFE21D7962C4656994F4C5299A3731AABDE2EE244B69D221FDB622D5BAA0DD4F85AA672F4A7BE8F1 +253: 5FA02AE2D4A47B7DF5C661318DE49E99CE807CF9C1EE00238B08CD45C982A20CC9DD0EDE10D97BEFD2E5B4E07821D10B +254: CB9794934F56A155BE01B7B0E41EE00AC3A081438F3A66B7BDD7FF123F54D93705C630224F4D76B51F4D30D70D108904 +255: F5CC4DE5026A9359382B096635EA02874262DC3E657FD8EB10E297DF8A77326EF8F73220F4564AB23C092F24E68FDA76 +256: E834031D7BAB82AC00905187335595E020C5BD3220924F4F551D7485931D2CB9EFE90B6574FC46B63265314781DE017A + +Hash: sha3_512 + 0: A69F73CCA23A9AC5C8B567DC185A756E97C982164FE25859E0D1DCC1475C80A615B2123AF1F5F94C11E3E9402C3AC558F500199D95B6D3E301758586281DCD26 + 1: 7127AAB211F82A18D06CF7578FF49D5089017944139AA60D8BEE057811A15FB55A53887600A3ECEBA004DE51105139F32506FE5B53E1913BFA6B32E716FE97DA + 2: 23A5743EA4136810A2DD503252708D35151259C859BCB7AC46F5F120429983D14736FFBEC6BF8F174977B44B0C5B73378EA88A4EC1F7AA295C04B5DB9017CA48 + 3: 123119AD1D6E168E0F20A3AF1FB2E29C76BC3F83711CF3EE3122AE37EF6A1C2E094BD4BC53B7F9A45C9DB1F900F87A3759327A659DE341EF1A7B1787AFBE9EBC + 4: 8A012A2D7FFA17EAB1B63C2E6CCEAB1597623362E7CFF2F1D81BB1D1813D27AB344EED9987E55FCB4315C4F8004D4C541A0CFF1AD050E5B1D39EC91BF68CF5E7 + 5: D18F88E32C65381463856DF34FB0ACB1AEEC7FC21941B628534CBBC44CF23BDA195B46A8B4CEDA76175FF1875B194E453479D66C7E51C8ECA9E79A1E5E35020E + 6: FA6BBD204ACB2A0E44E3330BEF3AB905CCD5D86B2FE7E07DCE2A8C484B676C8317B5EDEB3896D9B7AAA3250059B91AEFED0CA628E8548AEA63106E4758D56BD9 + 7: 598D98ADD2FC26B551E9E7385551F760898230A51F0E507C567FD502317A521E8FFDCC062302286C975811478B89046CDE9D148814BB4EFC21B5C901EFF0E151 + 8: 44D125F785E8EDF22739FE0ECAF0902969131B0A66B93091119B8F3BA16BAD118FF2DF4CD47D2639FFD180D5E6491CF957E6D346D6C7D914B810E4560C7E662C + 9: 3A1B39B1F0FAB64D4AB06F1082C9BCB72B6DB81CF391363B56F2EDA562B55E50406ED946A4D18777A46E6A6984A561A35A0179C6091BBCEB890570017E3F3C4B + 10: 3C5249D4D814A0ECCB3269F5024F3BCF102784E043A06A6A6A9BCBFD20F753BBFC5DA0808E34F8836DF428AB9F2541DFECB36DF288112CE0268902DBE510598E + 11: 6206D8EC11289EF46456F35E483DE20FE0AABF6261FD634473108375A63D5BABC27143ED51EAE3C4D8B7649638DC794AE63810903ABD4BB303700804ACCBED32 + 12: 06E9C5BDE5128B27926B475874B371F7D8352FEDD18BF29F9C7C1F7BC1AD267E93FB5562D3E0FEB47CE10089ADA5B67D6BBB225A5181BE3789D539D2368DDCB2 + 13: 628012B90C121454C02CC2937A47A87C7F96D1B91AA42589022941720D6F6A8B6905C489364250D21308A13D7B00529DD4F303E95918EDCA0682E64F1C3832A5 + 14: B99F8D912D10ED113884391C27032E4A92475F6363F5A7D8B08ECE569EC628A0F1DCD51E0AF640972D56C7BB570A97E67E9DB59811BE6A8FC6EB66611026F98F + 15: AE8359EDE5BF78C10A72A484FEFA47164AED963E458AC880DE4FB65604355655FD8211B11E549E925B3A28D7E288FAF5FFF8CE15CF992586434D10CC5A8927CE + 16: B1241C96B35EE185E39A58E5B481925BE53B3EC31B5D082366021B5D7DF5B832E0951A239CD0A337DBBA6DE2D3A0948105C3120A074A450799AA2547E700EB1C + 17: 38B94B9A3FFA22F622AE3508152AB5F576A20A3B55FD7521849A6C8ECDD06C132F41583258E572DCD003087EA92EF835CFF2FA5EF3634D0D55C2E66B1ADE8F20 + 18: 1E77FB17AD950D28E4C498C5697E46F70F1649131E6B61CA90F32AF38F342C108CC33BC63825EF8EDD539B4C25E21AC5B3DEFFCECC53C0A570831031A4F225AE + 19: B8AF5686985A34CDDF4B850F3A92B55C34C6F1B418C4225F4BA8CBD8A6BCD53338F635B376F37F9E434E716B7D4CBB4B240A2AB8AF1C9B8E33FADCC84B79F0AA + 20: 1F0529210804655F91186C04E0A94F4AFF12681B13728DA70725F9FA3680DF14539F37601C47CF0C6CC0B42EDD810EF6E5913C3FB199AF7EC8E38D62CB6BB2C0 + 21: CDEDA0FB94EC6D9155EB049DF7F379E537F500BC42048D46B4A0959B4F2F148F7F39D6C8A46101E64023EF37ABB101FB3E1567D55C1E872442E4175415D1B8F6 + 22: 97E5AF6C72FF3AB6941A11D321310C4BC6C510C57AE480BD74B13B4CA0D2CA08067FA4D101D3998AB637680271F61748365777B7C9075366217433C8ED14BF3B + 23: 171C2B53C78491921D7CED8EC5FCD6C420FBF509A9C46B13743F3921356FE439194767B24A7002AE1C5D20B16AF2FF16113AE64353EFDC198C085C0A83EB8A6B + 24: BDA138CC4264EA65BC361CACDDFC24F7F2932490569E1BBBBC6DBAABB2A439FA4C59D9E848462C99F4A3E904AE4D77359220DFC0C4109005220FBF5EE68E501D + 25: 89483F3ED6CE89576702D1AC3D3441E51CD1E4989B8D3D01B92BBC22CE7E4EFEC53F3FB7EA9EA392366E30B50EE72A71700C9F2F36A0374D07DC724EF5A7071C + 26: 22D09DBA077F3CA703A5C3118981B4E6E0BF9ECF644E8A50CCD9F9A8BBD201B5AEB8F44876B54FAE4814E2CA8DD8B65CEA0390822CD00FB804F6535005CD939B + 27: 4FEF39AAA693F0B425E261E448D1D4BD9C09CC213F249AEF6BF57EC20E83BDA5DFA0D5073276DD6F55E03D537AC6E41B7DA24E39C446B98A1205CF0E172E779C + 28: C2919E494C333E510EDF5EAB888F5872399D6F6F9B2669708CCFA6F3622202F514C4F65166B93CFDF13D5ED4057FBEBC3DADB50E9F88BE4270077968042144C8 + 29: 41DD097AC338442C76407A100FE4CA941BFF3CBD645ADAE50505B8B0D6B41901940EB8C2E3142C2C765488C9283D8247A9AF011BA9E4BCE11B9BB3CBB6750159 + 30: 455304D0B290FE4160D66D78F5DA2492E538D15089C74031DBB2CA3E8C820C723A89BB85F90FD0CD22AD6AB005AF0CD87C4DB3EB463BB5E35A06650C6C39DC17 + 31: 2F09F6DD601CBC8A0F8B324099C13089DAC3009BF9B0063817438C1055E7593D27822B1854A2560E664FE23362921072BA2EC4A6B28FC234B017C55A077AFAA5 + 32: CBD3F6EEBA676B21E0F2C47522292482FD830F330C1D84A794BB94728B2D93FEBE4C18EAE5A7E017E35FA090DE24262E70951AD1D7DFB3A8C96D1134FB1879F2 + 33: F55D3AA4A656D91B04900111A8EDFF4C7AA7EBEF8717F9679BE4C2852FA098ED8050E70477869E8AD13F62F70436E429E83DD9C268CC1F4D6E410004317A10AA + 34: D448BDB045C8E0AA4DF423222A8ACEC37DA81BF020CEACC49C93AE374F2051981406B736388DE716F126D77385A051783833AD6EC3EC293137DA493198C46C7A + 35: 75A0C701E69724627AFCCB915B63235E1E20B6A63E7B54B1ACF7EB82A37D437DB5FCA2CC9FBFD55C60018F22153582F846B2AF1761A369613FEFC7DF645E714F + 36: 3497BF2EABAEE843AFED140E204B88C48E3D1CDF99F1EE5B3F281A39EEC554AA169C5940EEB44B732667C3F9BFF4BC12A7B8431216653CB06A88D9D91E207245 + 37: F0657DCA8FEC2873E4788FAAB46CBB528A850D2E5C36A301D3C5E0AB2FBA04A28298F8E3455143687C86AF48B7090F18574A39ABB47CA6C2010F79A9AEA16528 + 38: 8A0DCBBA20DD46CCD073DBBBD38362A7C7806D9D3EEECB7BB75F9344C607AA3401AF20A1176BE3786ACB804A74CD2FEFCE00325CE9D9826B1F18E9D37872DA6F + 39: 3A91610D901532F12DE112D6690720B91F8004E31A4319B66BB9A9B2D345E1FBC214D3D9A3C2640AEAB1CEB876ADD27B90DCFCE3002227847AE5DE747BCFF162 + 40: 413A59AFE0BCDAB6478BE0CED2351BC7AD833EA07B08C7A58F5050030969080EB96C1ED37FD480FA57AA09B152E74193E247EBDFD8F3DA5F19AF5EED19761CE8 + 41: CB368E0D768F9DAD380B9F1FAE3CEC41739DA61FF9DA3DE813A76D65A7694D05AE89C280456954CA0472AF3BDC01326066F30EA643A4E0FEC67DC530681912F5 + 42: A0E331A70EF82DF3E913EE97B210B4E0AE47C3B950F1C9B1ADF66FD1602831BB584F661863F4592EB152119A63B1517068B339911BEE5557CF17E6FC937D921E + 43: CC9EBF97C234A6CF2B08100343C2845CBDEEB27F5968BF39F6519072E22CD07E4C81D11F43552AD78AA4E38808DCDE7A9C917B6567DCF3FCA60CC1153F9596B2 + 44: 6536411A996F5692A4F4DB792D6DE5F73E0B68F919AA551644F07CD5FBAC1331F27D902B8EC9F33D882E5B6638F013E4F08642EF91EEF7AB868998960836633C + 45: 76F62D8BC869E64476AF4C87D720EEDDE7D8B79A0E78D4688BD27F329A0065B6C3F8FD87D8CD2AEC493BCB5F88CFFEA341EC88486D2671E99ABCC4A61C271EB1 + 46: 11EA3F12DC7483B0A9D133951165E696E992AE88AE1C98FB77A66238570E59F9ACA5079FF3F3A226CF8DC93AE3589E4EEAFB7F48C38640AE18DD05FB9AAD5CFB + 47: 74BC2C69D958135E73EDC4703FEED12E89B8B5889927B87A9E35CFEEC1CF1B1B6F4913F3F5D97976DFC859E64A98D48BA0CA4F89069B84383C66F2B2870CB313 + 48: F1CFED99556434ECC9AA170228C2BA5709EDD8EA68AB9ADC118036AE5F49677EA9E2F7EB003FCE763FA35E58687BA6CC9BED2ABEE386D91D975FB9AC8D1A2E3B + 49: E5B20D257A021E4835C06DCCB770EF003657E8BD5BA79B64B55A0A8542CFC3657705DBE5AAB0D5FEC34999938CE5F66D497445F8E522BEAAEAC7CB0A679CCC7C + 50: 20E0DD49444601FF9C6237D5F94F4EC8196F9C917C37E1EAD04E814802EDE40F8A8AA9C55015602A6D53D87A0D4119B6996813F90BF984B6FE571B79DC5BCF73 + 51: C8319ED403C57E18A7D2668A9B6621DF11A34FBC54BFBCCCA63701A2F50D3BBDDEFD603F0262AA2DFBCB5D82056E9034CC51FF1D69996BB985E6C782C82F3BAE + 52: 867926EB86AF82183123664835D7D4B941D6BA4C8988F3A2A17DB8A4439C6180ED8DD14910738920E1A3FC8F6214FE05BA218345B9079CCA662AAE480519D2C0 + 53: E9FC3C407E282BD9A6BCAF1E50E3A738F843830C6F9CB1D4F1C34CD8ECDC7397C5D4D3C482896BEC7383EDC4350CE40AD700BA5400B956F2CC1585DDD7129420 + 54: E1CF4D1704A9D37DE70F3F56A0D521A41293095A1F99BA928B3A3DE90DB1E2BF2F74EBDA9A90CA9D79BBEFCBF9BA6D140E1418AC46965DD4F59017E1ACFCD459 + 55: 355541FA3EECD27B1DCA8D596B3C41F0C60D85034F8811E2D15FA8977E25433F297C5C14775A0E5C26429062B952BE7DC2DAB84A69A56FFAB826CDCB49AAB4AB + 56: 2CB606CD80F35FCB14183916DD04C4508EB0AC03CC24CF0DA485248758BF0910084CE6C503ACFC76962564C13D9EEEC408C3CEA22EEFF9C7D41B206ED8F74F10 + 57: 0BC7A701FE7AE86E7186D27F85435D088385269FC333D124C17AC32C10A38E494291007532B06114199245CEBE8B4B83AE85C435CD2983A2C342AF893A161169 + 58: 69B557C3824DF67B6CDA58E107D82A3295C3C888EED24432E002E312D4BEDA1FEA72DD4419FCAF751C11BE33BE6499FFC3A3C239327B7D781859358855216148 + 59: CC0F4C0BFA00891BDE18E07B766FC52BF19A26186F56D7DDFB5C9683BBF814BB15104DD999CD70FB310D8757B938EBCEEE59E42A62E4D654CB106BF50F1283EB + 60: 2F3E29791BF2FC175F6E3ABDCE41FEBA2B77C5F016BF076692C51ECDE344D0E1F21187F6EC0D958D6A1373639D1CFB64BE4E9C36D3E5EA1B9F0BE3ACBBF6063E + 61: 3615F2BBDC87E8AC38B03C3A73D671A855FBA02D81C204C2EF8EAF24F7F4D4DD0B6DDA1631D884F4B6F05C1D1E324DF2E4ED63430B43AAA42F87DEC2D4C7E6E3 + 62: 97B59ECB6C17B829147729D80391E09A399F7E49F781038F3DC1FF195D90677CD3CC9F723AAF309B4B8911D25720E4E399070353BE01A218FBDAC460C3AF22EC + 63: 6A930B07A37E9F0C62E2A220FFCE9DEA8D8E34BA52C0A7311C5F4090A253F16C9281BC0DE528E5EF86F187C3185F2ED244352A5DDF5FC09E99B4008FEAFC584C + 64: CB29601EFBEE71F4DFBB7F1C2BDAEAFDB212DF6AE35F8BB1EE6C0A245B99F3F35A82957567A30CFB01AE28B94C7223A62C5C786E8624B8FADDCB913E3AB2CE71 + 65: C4D102C41B4F588324E3C9E880ADDF370874B30FB6C814ECE42B599EB8C1563D88E89225E7BB5CF4DC8CAEC9E7B729664D421E5AD72B94552D57FD04B254D551 + 66: 4E91B0F1107CE978BDFFE2AB3A6A67A2C4233A0AAB518DB2D4BF243A88FAB5AFF06058CC13DAF54A7E41281AB1D411E618D73FF1115517D49ABBC1A1821F2A0C + 67: DFA65C9356EBE3265151D84993C9246A8FCB9FEB9844D8B4DC7C04689035FD2966611CA81DA600559C9533E6370861C00D23C9DB16F1E715CF4838538307E403 + 68: 9B0E7F19F3E03C425F7A29C95A8417F23A3A64C18E423F7F8717558A5D8FA1AD4ABCAEC7FBA83D216D8B66BCFCFE50FC6FBE6BEE2EB054ECD3EEB71828B44293 + 69: 65E34948011BF0715855139BD03AFCD01C10A0CBA4A6C237CF38A79977080EACE8F47E1E9EE14E7D60DCC2A9FE2E9DAB47DA5BD0EA1CD3932FA788F07E04D7A0 + 70: 351164E46DA292FD3D75132545401498D8983BE9D143732DE2DF21FBF975A5E2C81584D90A773D34D7895D4CECE328637AD2FFA973E21D4B6D03F39141CF44C8 + 71: 3CCC850D53A1287AF7B4560B2EF0D43EB5D9A80D62A0E9CF1DBC040135921104D4395168E90BFC871773EBB34BCA1BD67056E1CC7DC7A48FF7C3167D389F117C + 72: 5D63F2BBE971A983AC6847480106E4E1264EE3A0BEFD79954914E1D86E795B2E18238F12FC5E46CB9CC78EFDEC610A93647CC04E1C23D8CAAA6A58C21DD26C07 + 73: 921D9B7B2B0F3066A1646DBB058C979CB3925DEC0F8C269FAAA7F9648E73465AE55EC527257D5D5E1CFDBF5D6799BEA1004B6186F5108C74E3B92FE924166558 + 74: 88725980B5A5BC5CE6E69E9CFE128BE2FAEBCD8A5B9FC2E17C614F81367788EE6DEAD64EF02AB4141E369879E38D4E1ADDB5E678347D4CB86F8DD698631B6643 + 75: 469F61487EB859EC7E80F3B6992A9C335B4CA864CA1BC7081155A882CF2E64EE787779EA251EA3EF781F4FF42ADA9CB93DDB96E9A07EB06A793F737F2C6C12F6 + 76: 8014AE3EA99C4551E214BE2A075FD7FC2A048152FF874DEFC66E22437B8410427DA8FB5BB594E09562C403D14595C921908DDC45E270B3208B2125AAAA53C191 + 77: 74E6B15025353113071735919571F765F098622730A59779D021AE39D7B0E62A887388E3064B16D3C7A1564BA5F823870A7C318D00FE484CFA919046939E7023 + 78: 2709C7DFAF46D985813EC7B14CF8357B6C9D0F0BD206A716E5DA419F1B54C0A4F6CB1CCEEB9A1CC22A6D398B641D7AB10489084365931F961BE24EF31544B425 + 79: 02384A7707E913992BA30267BB1A07081A82C97F0C8127974B16E783E4F788B2E207B91F9385A3417D339AE468E935EB31FCFE7CE78EC03569710564525C6A34 + 80: 5B4FA98001A5B76CD19A8B11C5F47BE9615A1124FDEDCCEF6E247797371A5950810283D4C2695524749F96F6E5F11B2B17810AF4B527634C56EBEDFDC956F9F1 + 81: 245DEE786EE305DDD0F6C592830B463049A702916BCED916A29F20553ADB5F160021D2A0CE50B5CB5F9EC7B342E10E63C9C643499542786B0F13C75FE662F181 + 82: C500CEF078A00D242D6A8DBD36BFC8BBF4D16FE63AFBB2DCFF0E745737AFB65728557FF624FA1C70ECA3F7318E82B3454C22D929CC2E03427A3EB92832E2B826 + 83: 86CF47EDCA1807430CFBDC87E9CCF646299285E7A89A22C44D948959F678E3956EEE32F7724C82B832A6211FB17057418DD307EFC877EBF47B05869AE4FEC59E + 84: A22EDD54BD66968FBB5B0CBD690216BA9372DFC73C652F1A059585BA4A4172E484710741E7DAE28EF32A3188D4FE227B864724DFDD6661058B62ACB29A5B6DEF + 85: 529D168D19A280DDCD507EC1C9AAB9D622C168ED4847CAC2146CEB4A8EC3E32FBEEC137A8B975ECF60FB297702D4EFC987A2862EBCAFE4FBFC8A040BE5BAB2E3 + 86: 96C78098873B4D7842CC9D3CC7C36C872CDC0EE4DDCDF8290060A64FEB04FC55EB453337E7E77B6BE081CC5D8F2821782F82F98BE8CF290F1CB8BC6CC1314D2E + 87: A6CDBFE071376FFD6B1C3C90C9D8DEB49D46CEFE9177AA84E5D8DA9B3ED5449F507F5A972C97E1CCD258381B54A3FA8C087590D7EE85B6533795DF91DB8A58B3 + 88: 2B472A62AE504DB117D77E244C36C2B6793D26E89108F34ADCF5AE51D6F5EC08CD021BFAE4C80A4C1090FA2CA83182ACDF1957FC2C21F360852C2C8C14C2A39D + 89: 6882290FDF4829B5E8BDEBDAA9BC11826CE1B751758C9DCFE5DB84A0403948EB1BA23A5A899109C91925ABC44BAAEB57BC88DEE3383C456CAA030B4EE2072118 + 90: FD0243F8D7BF9B02002664100B0B6B228C9A11D7BE648DDDF279D147C8C4B57321F348DFACDF7E40010D1F4F960355479B7CE81EC481492952B864815648B890 + 91: 348978B95213EA28BC3B01A457173D2784D1A301886891B40E7825C627D449785B1596D1FFE81EDA8F487314F56B96265230E465CEB6B49D6D58D07C195C1F7D + 92: 85D3B3427C0F58CC5D9A1CAD73F9D66F2CA0AFAF37089519CB1E3B082C96EA1E08E67A0F692B79752BC7914D636EAFCE4281F2C4E1F1A7C80EC56584C6BF023A + 93: CE2C2B9A13F55A2700199BEA8210591DB80AD51DD5227A2E34D0722661376702B0A46AF3A3AF00C9B1B0A254299D77E568448B3BC8865BE13F8EAE6B0E714A36 + 94: 552A8EE6F26E9E1CE87ACCF9674FC96A4722F30035869194DC56843A12A986F368A760EE740E6D22DDD08461B33947A6D4C5197F5877E4FA9BDDA08F9B904C53 + 95: 5DF5B514C10744318B104C4F2790EC18070A8401B5427D06CC44CF9320F110B5FEB176CD5CEFCA31AC57567C677418D065C6AF2C6E8BEFD4688DFD8F7B3C93B5 + 96: ED4BE3D733CABFDE4659B2F6D6ED16B9C69AB46D0949BF1290F360A6AC358EB9F9FB3560582C52AEBBEAAE73B04D8D040621723521FC95A143E322258056742B + 97: A070428BF846D27696D9CE6A24CB58DA841015D0CAC74BF481270AEB2980A1F92A20733CCE4BE4D9226428E9B691B8D2E41385B836C612ED969832D14E43061A + 98: 8B0CAA5B47BD3A6881DD9FE3A9C617BA4229153F7825467E16E05A19E9277466DD002040B1897569F26F0C30D8C21E554DAD7A0042E9737EF217131AF8D72BE3 + 99: 2282F0F5B13224B66AAA946889F6DA0721515CC41988754B5075FBA46EAD1A54E6B641FF536CD061923505075EE872742E748C45E01E375F8278E5F9DB3499E9 +100: 6286A3E2A02236F45739BE74F1D1D83CC55C7DCA0018F852AC52B5F5ED9B3D1728FA4EB2087E87F16FBBDD64ABEF783F1953F20D06CF271B8F2FCE2A3BEB76FF +101: C8560C1F73D8F309676B71C239C06FCF16A7A8FC710C593B0F83B32606D6D7C85B66F9AD987A4C24BAD2F4A03A20DA89D5F1F0987F60FC97F40F306E221EDBEF +102: 9D6DF09DB9028FB57B45E346886FC0A6BA37D81607BF21B4C7E5EF811197E01EEFD4BE9C22E68A1B7C714F8F7924F2EA699B0E83A3C95379F7E8DD0CE20CA8B6 +103: C2204BC64DEEF9249AB2E29187E31DB863002B0AB130C1189D76D8E41F40AAB95606B1CC3955788FD6E377D438C2C88C4AECF8F2096A5C8D214863CFBAA3EF5E +104: D29281937684621D1473A7E7EDB80B7C9D80B0842E9D801B718A13B847B9EC4F17D1082E90EF5244D2DF629786D1F0F3F4ABF9C457B348D899A66D389D91D6F7 +105: 0A320F94BA79AEDE56D0574064050A247D8F2DFFFB8E00980C7A2523B879CA2E6A077B66DB538BB707372F81DA453072EA7C1972BDAA968974945058B768FF14 +106: 95A45FA111B186AEA2B9F4C20D8E50CBF008435DDEFB07CD11A87FA84D918CDDB35CEE7A9F4EC44D072369531712D0BB82996E16F81353DBA7AB5229D16FCB85 +107: E29FE5FD5CCA695A65944360C09BA2A361613C231A79A3995BFE552F3F1A6B77E34257F58EA53CEB86FE3F90FE078DCC66374886A1239DEF364D13F26A9782F8 +108: BC433FBC25C91C23829A411CE6A15BB068E7415BFBB8A6FA9C28D786DF721FE9BFBE68B04FB0EC74378F2156D1DD77C35376528FFBC2092DA00397B5BD74065F +109: 127612CE5CA9DF6918EA8BC7E9F4A2F2650E7471C9C0422E90891382F93E89F247D36348AD57CBAE703B898B846BD610E796C81BE5ACC0FD72636D46371BDA6A +110: 0381B5E3463509BFB578EF20C4ABD824EB6D7AC97A0447CE917910475AC58D2568B0EF6C1FD91EC1692F6ADE94E9D8BA82F6DCA14CF3447587F4EF627FD92DAE +111: 265CC0491A1AE6071EDB97771EE58406C0670DEC9C531DD0B44E8B7111FE51FDC6D44C3547D350E134116F9FA75D9836E6C38BC78C099A98E476A3A7CB955C8B +112: B44E1E6A3B4C597CC576754772B57904BEA0CC132520A265CFEBF27079F494073ED2520DA03B5370404AC5CD342C1253D261A60A8ECBB04F453F0C9972863004 +113: 287AC1401EF422FB02AA9CBD63D6D9B1F4CE54E468385822AEB353517A1322F04489C632891A261E9E24D4EDDFD9B603EF9E3854B8E41AC96A6B9BD7F995D04D +114: 158676AA01E5254B4F26D3C0A5D6517608EA8C237627C536268DEB7239531527BE936DD3D79140713FFFEB6131EF731281F5C76507FB09B110AE5F2E567FBF34 +115: 2A5FC3C6FBF1F885C21728A6095E7057D35750546EB26A04E3736D251177765EB40D21B7D36EC3AC2A8A4093A860D6BCA57667D8E86D0A1DB0ABE76A997826BC +116: 932C41E642771EECCB6AA135C5E14069EE073A21352AEC401688B630140E8AEF14734B748E28229B0B55B62349FB4247A910B155A0D5FFBDDCC9573A6DEA68AB +117: 3B89D3C164A814F8FB65B773E5775BD326AB6D2AE331499E8DF49EA15F8849442B916C9146B5078E8C736414DBB67062F18AE37B33320C4AE9514B294326E1B0 +118: 66997E8892D06568F993EC906F6D6F7C7186D954FD9646C9660F04358E08DA2CE47008900B38B83E8AAC014BA33C0AE6A541D26222055A8E9ADD10D41CEEDFB3 +119: DFB1AE03E491E5C637DEF10AEE4A668A35C5D3EA13E02C626F5527399FAFB1625FB93BA389813CC2D728FD6BEE207DA07847CCD13AA1A7B7DCE7FDDA30FA9AFE +120: 7A1D68CD4CC8DFDA9D181D639A2A96F15E7B8545AAF0E7EDE62865AC5352145ABD0429D54F3FB58B54D227AE70959D99F972425F606429B0BCC9F7299348BB3B +121: ACE2480F467F60566E3383091C0609A80D673BE13855C451B857E0E4C496C13074928A725C2EA59206965B5C7F834446683E17FDD1505FA3A49BC13C753CDA16 +122: E9E9986D2428A2CFA74A72836AFA3B2FECC1608E0AC9445E66E3AF8538D3385D7348B04AC1D446EB624F890018EDB59CD70FD97B245010B3DA87C1A8AF3D5DFB +123: D1D57CF31AD59B2D6EDCDF8C1B68AF68E3AAEC415C4F2FA00174D56394D71F70A276492C800B2A2D899EEAD95B849123C934188444FBB959C72C3002F2276BED +124: 1FDB3B4AD20BF1AE27DAFE88FB86FC52BE5EE12DEF74120674443672042A2B662D7560655700206737165AA866685B2633FAA5FD63DADC559AF412525527B132 +125: 4E773E49D0A95C02CBE48AA80D12C54EED596931D3E230DEECD012D623ADD3AC42F2771D14F4B4511A69EDA3A719B06B0A23C9CF15A4EDD72AD0EE3DFB453CAE +126: 9606F242AD1EA9046807BE0F95F3B3FEA36FE68A1DCADE5EB181003494F4A16D125F7A2372A45EFA4751DC676E3E67B1703FDBA3DDC457C362A7AA80D900F381 +127: 73BB20BA4987E427DB00B5D42E431B3A37232F41CA4D29591758F26E73788A3B3468EACC9415F4BCE5BA6AECDA14750080EDE3F0D1017727359D215A770F76D0 +128: 989C1995DA9D2D341F993C2E2CA695F3477075061BFBD2CDF0BE75CF7BA99FBE33D8D2C4DCC31FA89917786B883E6C9D5B02ED81B7483A4CB3EA98671588F745 +129: 4D8F28EA5211C66A28B6A0F98B34B45E9C51CA6759193FF52D10EE579D64441D9B240A40C3660F39AF600A9FD15F137C635ED13494FC26A5E27A23F04242BD3F +130: ADAB2304D128965FC499DA1D5955EEAD869A9E6B33D9CF03C02AE7A22AE277F35F45C45D9BC6297DD7EA49664EB213780C97688C3241443CD7FEA04BADD5726A +131: F4A3DB8BFEE2F2D0E5F9287137BEF902D1B78C474445CA56DFD0E8C5769AC90BD427408353BF9440901931F65FBB727A91966CEBF229233236E1203641FF06D7 +132: AA9B9D3091580D39BC893BFC28358CBEE8C9B6DD2BCE64856633E5BBB08CB9BE457DEE04F7735969B2E991555824F12AE3CD3E1553786FCF0D0A8368F4FC322D +133: DF7F2A48B2D154DE7D3ADF710CDD3D1528EBCB06371A72AE607E6E6836163B179800E1EF1BA08649ED405637C6617D6600B0AFCDFD7FD9E39A1240F45C21FF96 +134: 76DC7B65F9C314C810C75A7C7A520CA9BC750D14FB4984F982E86E4BB1E46F3DF3CE529BFA7B52366884EC66A1FB6DCDB9EC04A72D9405E0AF9FA1BDE9054A32 +135: D942DF0DF09AC042CD3B641144C98D8FDA0980BB037FC5C0E7F2E9A073B073DC4BB8A8C1F4CB5B45F5805C6523741ED0571D6779B15829B2FAA280FC60B50645 +136: AD8EDFF4F1B7AA1C63BBE49728AB9B165F7245B3D7102E6F99C261FC15D2D0BF6AFEF6A491720454A1349FBF5D848854875AC83A1156FD7F6E2A37AF26C07FB2 +137: 3F827E5D7DDBD54EA1DBA28CAE0154EB5FF8D8D973770865861B7CDF5F091040889D55C0E74B672CEAD274FAC1D4A559FD9185BE898AB8969B5E78681527660D +138: CB36F942BEB4E689E03249E1339A4C038970DA2EBEFEEC52522EAFC0673C1DC8919121D8D9D5D2C71E437FF4A6640784DC4D2CB84F8AAEFD32B9B9F2BD3D31BA +139: 9D6BBD48EE6103734BCD763BB2C2A586975DF08F1A49C59645651A6FC641A2D93A3D8E0A09A596F585DE9F700AF2BA4B0C6A7383EBAB422745E129472330481E +140: 6CC31CEAEF178C8526794C1FA47154264258731148AEB3694D443B11A59FE756E540CC662BA862D0D6745F75C542DD2614D8E27B25E0C56D0AF5CE6475BC13A6 +141: 3E92887FF9919469C7927CFC56523492ABDCFDA14D7FAD2BF1DE875FA05E2416674AE1793799B7A0703D4DA88CF67D09AC64004DC4E332ADB6B199BA6EE52479 +142: 64E5A4E32097CF9EEB8170B582503AF020076F2856D7E67C0ACB4C53C5F7FCB6BED9E330BCAAC7C9229D7875EFBE233877D5D3A43A25376EAF7804320599676E +143: EB9748309C6B70FFE82820052AD26EA99F43968D2AF359ADC804B2A76741A62EA8D710F018EA113C2259D0BD6687E3838602AE6C1DFF727AE985F059141C7217 +144: E1951B8BCB58CA75A34AF80A7A2B765CAD4257FE383A79B55BF21F180B75F6E5B08F09598851EEEA7D13486387618D6C6BF88CF23C0088A3F783F59A06D60493 +145: 1ABEC62DCE93A6775CD2EC0098D7264676A21E644C7C1B80580C305CFDE31B7D5848C63AF4D0E7CFEDA2E5076A32DBD632665FBB1E7F06651B2ED4D7341AC844 +146: CA5091C6725FE00F228E6BA2AA0315ACFA6EEA06960ADB4DC05458238FB06CCE22445295D8F2B05A84BF6EB40B4EF868D8E15F2CF768CAF909DD477A4658DD1B +147: A683424798949251FB8625E2A52ACF592AB6800292E3A98B5006038647ED54A9E4D6E6479E7A55646FEB509739286DC8A7966F745D73C3D3EA579AF32E52890A +148: DDD146DC9D10D91342125E8058427333F1D09EA09D6A4FE602937294B0CEB22B217762E2712508E8E04E70D63BEE64D4AAAE32E78B73BD815AC9E2840FCA571D +149: F77ABCD2C2D511BDBAEE36C2DE35A642E51FECD812F3A032A7380C8B338AACF10E17B5E95D7AD5867EF24238A671646C9B500317EA39CD71CB201A8C092455F8 +150: C1A65C8F589E6B6448A1FCF0B08542516D7E0FA6BF2577403C1F41E61936BA49AA267B08E4F3D5D0F432EB0F4F540CC1DD498EFBA236499AAC9C506A6801D327 +151: A352EB1537BCF28197CED8583C4DBA109F0D841B62EAD5A48E3CE37AA2F5EFE36E3D27687599724109A1880780BE9AA29EC894617FC8AFE3FC8D66F62105E3EC +152: 26172B6E190BF17CDE4C2EBE670A2EAB2A7469CA6CDCBA5B6446EA0EBE108730292B9E3BB40CAF26E6451B94A45A5EE264B467F4D8D879CBA3AF8095E859B722 +153: C924F57D066418F055B2CBD1333FBE033545FDD0BFEC31FF668043C3C131785A820037B78EE69EC653596AD820B4DC949F9E737EA10E57B5975EA53B4E1DF6E3 +154: A9DD4632B539F80A8CEEADA0FA3661F16C0718B3E506896B71560F0345220533F5EEF5F1ECE12815B488FCDE1D28E419EC602DD3796ED393953CF68BF18C00A2 +155: 3EC4C4E48C74DA575E50CDCC2FBF8DBD06BDC15DBE21CB74EF3A9DE029366D7FC11513B1D879AB289551BC4D551ACC0444210BF5C8E3FB775E84FE27FD95FD6E +156: E6EDBC0C351FB5067DE0421359423289D1EBFAECA872D8F583428893AA42096EF6579D51D80582D92993B5BD4DF39342E786B612FCC685CD6DD028BFB686F419 +157: 87E035C7043B81150392EE06314E7FC8692BBB1A545763E7990C67B7F6E9AFC9655E6C203F3E33E5528CB742E8E788639193A7A6A734745076481ACF0C59EA4D +158: 2321ECA247118312D0DFE8A90081E48B370BE7BC68CF287AE88FDB7509B0839B5DA0005488E157470B80E9805C9713BCB76AB4081869B7F15E35823B631459F3 +159: 3E6ED52D078CA9CD5F0725B22CB64F11A7C717F82BC6BCCF6E00698B39C03DD2D597C931181AC88C3983EAF693CCABF25E06CDE5110D34108ED8748EE9B5C976 +160: F03A59A37E516F64A6F7FE28B9670D039E6376085735777876EA55E97BF2102F61438D66242CE0C84C1F39AED71DE9AA9416CB373F4C102BAC11DB994C708696 +161: 31896A7717BFDA2DDF0428241BE9941B654338715E30AEAAC6B1EE3DD6A806764AD01BEEE75D31FA0B8FC99DD6669043C7FE2BC94CE835C8A90DFC5B4B63A739 +162: 66DCC6F0224D7E88CC24E38E3FF5C4CFA751B85B1CF048BF98D099F57D2E643C24EB88C43470C73A77E3E3554C7CD9B8C5B0EB7E56E05D34A6FAE618F2C16122 +163: EA57F647CC4FAF53895D5B81B7952CD79D6460E1402B39644389BB23ACB96DA9B77FD01AED5D90D76A104EABAD3BBA41B59D6529E6E50629BA72C1CB6EDAB390 +164: 674F3F150CBCCC59720B9405247E5892B3963CF872C8DC80EA8F6A35AC1E01292FD00E8ED428DF84D4170A353772638F2E6F164100D5F9946A099E7018989DF2 +165: A9E10FFE76BEB4D30A38CB0BE36BF635F3F42B1D32A471EEB78305B5B95E2E1CF6772025B52D0F660222F2F660C2553CC794B32B35287B43021687869930B0B5 +166: 6370B696770B12D5E0F48E2D8D065F9D9305AD1863E4899CF72DA6FB67EC1CB5BB860850D7B605A43D056251EDCE89A4CAFC3B751412F61B1EAEC9512FAEF142 +167: 77AEB7615194D38076E9CD4C4F7361D76E96D7856FF6CC8C0D88E198CB62445D4A2DBA863DC5ABBAEFE09715C8A69A0A0B382FEBE29E64AC773A0A3D0ED05624 +168: 9567F47A24E5C3B934777516554D4875DE4B1D8A59E18B6983827DD9BF394414EEFDCCF8F6B10ACD3C08AFA951BE34A31D11065CCD486E71B530F33B7EF263E0 +169: 90334A76F71E06E0BE572822109E7595F5EBCEDBC668A863E50667AA79F372EC108F2ECF760E9439F2F212FA2BDA28DBE4F1C69750D7DDCAE9DF2CD8AA813CD9 +170: 1C52F3B96180CF3B0135B2A7F434454D7A199D7E3A29D2D6A146FDF95E7B35FE4A23F18E29D88E93AA55BCADD4E3F4146593144E5558CBB7E74B29EDBC6B0052 +171: 3C7C90062468A78D6CBA0AB4D0590231C97A1B0366189354FEB0AE6364CE7872046F812C84EC0692D7E6A6D9D3262C5CB0DEDBF57677B85461AD8CEF823ECE2D +172: F0E571152DEE3D52793983A014F87FFB1B29B35DA5BC192E1536BDBBD4D07DEED3D98B78DC8919359CE005AC5DA2A431E348F0B402322B5E81C38E1589F88210 +173: B4DFB79C8B64487A6C3C69DD474CE8568CF78D3193CEE229AE886754AFDB749D0A0AD054F3724543A5FF49500C9C5D8FDCD6ACBB65B1183E54745DFF2E068A06 +174: 3F692D86221CFF8537FEE95F933CA79CD608B182C528876BC93AD594E5A161A2D24C43ED8860F6C24B5EA4BDB3092B693CAA999661F059C3E9E2C31A9DC57177 +175: 4989728989349551515A27051B2A1BF9A7718F0F6386F08FB1A2A83CFB50D0361C0BC8345228FF4075410A08619FBAA45D9E89C452B6113F5C1876099AC9C9EB +176: A4AC9D88193B4625FDB8C9B04A724EF9BD870FAD5FF50AFE3BF52387FBB5F10821CC6EC1B3E59BBFC7F5EB27DE0C685B920F02507AF8F358B01874099B52610D +177: 8D59DB0152AA38B13EA9CDC76A1261D071C3FABA387FEC8753057425CAABCF9A676140E830A80BEAD0AA32ADDB2668DE185D080D56002B050AA3BA5B48D4A9D0 +178: D4929078B980F0694EB69D4850989F0C2C263D62C4BE2AB25C124F059B8CEA785D43DED46EEF3F1EF68C04938D2D0E97EB485D483D6487F1A0181D696B00301F +179: D7D9850E918A3FA9AA82A8BC51743BF751A1C2AEF157EDA61655B194E15EFF6A61DA2FF4D094DC2B07E668750723AF47BC584F1A113E2A259ECDDCCCB684EC03 +180: 463270F7735C96783A61A924F7D71871DFB4A74C942B6766F8A1F24EDC631287A38E6FC906212E41D4422392422CEB9ED067D8E57CBB3842C6A2E06926157AC6 +181: DD31BA6314F84199C5C08CA7FE5E5F3BECD2379635CEB509F26BDB939F17F7E52035F644CE4DCA267C84985B4B3F6A8A4439764E2E49199746FCE25A968351DE +182: 528DE42A978E262EF32E744E54F07AD799FA6CE46965F745FC5430C3C08804A5A97AAF4AE7ABB235B223740FB1C9B216A0681A5D9E34C407756B71DA2C3E5E8C +183: AF73CCBC4F1C6013E90752C407550696C8A63E4B063540D23069DBA4ABBF4350F90432CAE20ACF209981CA3FEA97B9954DEA6CD322B8C304D4CE0904F7A5BA12 +184: 2293FAF74636614F2903F0D9D2F7419A67813D5CB7D5329C7076C427C40AAD6CE5CC8968037A9D1F0C2E3FD7B6E8A13C86D07C59CFBE7E0DCBA3988B715C97B2 +185: C0A8653314E2C8AFC45EB374A194D295A725E3BB0C90F315A37F63FE4BE62C92D790552C56BDBD282B5D0B7A44F7F26C3A555C3040C1C9BFEB4033E789A9BD8B +186: 1B13A32EA35F8DD3722D086ACB2D490C6C0CF559644B59851799F7D0FDDA736E6CA516E8C252D59348B62AA97ED9B9D16684B6A7795235424FBA23AB5EE1EAA8 +187: A7EEA4D613F53A93F39CB45B7FD34F9D5E746DC24C686F83B1A3ED32A7968E89EF5EB263723783F32FDA29ED685F236A531D27314A5A3AB470BBF0DEBA2F5582 +188: CD909EEEE155267F298E31CD5DF0F178EE3F9B919350914336F31EF2FA89FFCF330D308BCEAD8FE13C5C7D0E86CEF4099907E409AD67800D9F2C457DA816A053 +189: B9C95E3A4C932D18C47D800B27BCA8A4883C7CAF1B1156218611DC29BFE4A8A9BC5986ACD1FD57953739C90E0399F386291FB173C16F16B60D715D5BF2380FB5 +190: 7F4C4A05AB2F19B2658F4C39A2FF128CF11A9431695C2F7F9928F8ED1209F35F4A7C158E64246EC3CE4C2CEBB40E6192EE8EEFD29FEDD36E894FBDB0FC180897 +191: 53AD1DB32F4627C15E1B2704EB4FDCA319E6161C3E118C9CC2F2749F060BF45A9DF2FD8F097864B7E5424167DD23C8C25C15B3B39647FE3CEC8F07F1E0F31FBA +192: DAC3C1A8A682D2B017F7AF5BDE43CD4BE3D0E68551DF08AEF1317B4D03141F154141E76FEE1548A63C6E04659B6F0EEE8F28E8DF40588442657C4F8976B6E2ED +193: 37A945C369CCE2B05B5070BC3BC18005711AA4AFC282CF88358C689863E0019218F7B2CA1CB37CD18F1B254FED35E35EB0DCEAF5762C5B7ABC02195FA024FE52 +194: A35487A60B6426CA8545D660EA1F689BA2634DA3F8BFAEB3932BC7D9E6BB869A963B88B0C18798A3295709B58A26C31818EE07133CA69C7E349B93F9315AEF9A +195: F83654A1E0173053213D61586F7ED1F955824C556047AE0C2432E2134A2119AB96E1CEEC98E882582DBD268C995FEAD1DB68341466AEC7123E3558A3FADAF629 +196: 57FF950EF2FE81D4E715C2C60F7A2520333D44C8C65C6ADF7657A69490DB90DCD54DF16D53AAFAD388B91A41BA08C9A5C461919447BDC23B3C81BB14618DA20C +197: 58907BBABB3CB98F9F4DF82FB904144EB3C08A6973C3A9FD5EB893B0D41529C2DEB804540468B85A17DE22C0B9F378E7F403F20083D94E851ED58A8D2366B3EF +198: E24BB11AC9FD54381708FEC20110C59CC12107452F95C9A91FB847737B17E127FE6F8129B79CFE134AE1188E0CF124D96D815587C291F87454731B5FED94C9C3 +199: 504B1AC969480C6813875F22A726EA1A0F21A7759EDDF8E2D4F4A3B5D730219666741C629B9C10D822DB0CE9176A4B9D8B2B5B0B5C5A44F457109D98CCA7E0B7 +200: EA5D05F19348DD589793354793A15F37A73B4C0BB4E750B9A00757DFCE2F8B65A64191BB9B137DE00FEEF6474CFD47ABF7880EFBC51614A5715DF12CFE0CAEE3 +201: C978AFA528241389A962E41BCA2F962058DBB22FDB0ADED61BD8586CB7F856451CB502FDFB2C11EA641FAA57B6CAAA3ED5043A7D47FB1492D073BF9EAEDD4427 +202: C065EE248FD6391E9EDA280CA11CF1A1B6FDFC097C8E4898FAF0B95E938D7CB96B4EA3F0DE893892A72290EC342D8F389581168B8FECC93B0372D1BA572EEB5A +203: 897C46763249C5403EE207B6D7DD5D4F2F34784A52BFBE171476B0D73C56CC3DE14F1AB45FCA8560E012D0B62DE723CCE8F0838A0E6F48F38C71DB2B16E2373D +204: 8BE61D1B4B85EAC0D82A43188D12604E57F817592AEFF697CFF69C4047227035B20393ED3CB0E9A4B3968C5F8F985341444865D7EB1D067DCC550EA30BD9BE37 +205: C77D8929543D7423956CFF582865D2E75FE2386F69C3D0873CE7C041C1BD8D6C05F34FA0C8007000279A5C4E0ABE2147D699EC19C23EDBC8CF3914FDA12ABE6E +206: 147586AC3A20E8068D38CFB4567FFD4E2F8A721F6529AC22F98C57099E8994478C0F06D609C19442305B7EBF37EADFF9434EF05984C1A5FC0D7DAD746FED3EAB +207: 35DE1D7A685CF18085AFECA7033846672B5865A5BC907B3EB1535B57659C4945EC87D68B22B19EAA557A531A7652728BEB689236E18F7D90C357138741EBAD26 +208: 09D66AB1F275A2345F77BCCF568DE8A6DD22A3C427A5DCE792CDA87A11E976694BA5640CF3960C9E20249548872F310125AA7EDEB1AA1023C5A3C96182054572 +209: D27554B33BC79C9388819752B26805A60ACDE0519C23602A48B21563F4672D70CDE0F319911D3937EA2B386262BD4E17C0DA59D98273D24D2522F311FB423158 +210: A28A725FCB3798B5EB342DE186FB0435171AE345605B6D47FD81507B5E14F114B7D01330ED8FB7F105324EE031404FE5A3016B13BD254CFC8C3303273D6AA629 +211: 46BCB65BFE5766247E0F3A6B3F8467B29D6ACE2D252E7F05874C0CEA59B81843F07DC790640B449DC469D3BED7697AF7AB5EB2CA4F1210144121F764E5504AB0 +212: ABBC7A55AC334E9BB0C9A9BD8D83618F11197EDD6D12AA48D9F38662BB90756A7B68C073FF7393A4417C43B48676F5F3DAD4B5F1E1FD94E125EB366F3BEE12EA +213: 9F2354E4296C58E4B99200EC32489E032A4A1E1B48ECFEC897B8BEF2C963901450282EB7E99B44EF82AEF2C011F6ECC4B471F581E369A78698A48C128D203D75 +214: 643749B9CDE3D8D3D6411FD82E5C13C8C540340088ADE75F228B66CBA8B9CB870D60CC62C96F42D5BFA15A18B475C9C55AFEBCD916F60D2570D1A27B5974A67B +215: 5C68EDCEC7F61F64470C42086F2D6107FAB421BFEE6EB17FFB6339F9E02C4A0EEB0D39FFD0E5A3CD35456D61DE22BB64C2BA87CAC564AE49472D541558662E3F +216: 84B0D25E746127686FB471B0F42CE1DA910292114757CAFB8D3F820804D2DFEE9222AE807844405B72ED167BBEEA667C8818BE96B4A9D78F65F1771ED31CEE24 +217: DE1DCF3CC8444E9C5F67C26599565F91CC1BD8C0C33B42EDA2B6F99AA0960C8A447C5FDB5009AE89228B32AD7654D99934B768BEEF4019590AFF0AF2B7F5FC66 +218: 497525C9BD087C5CEB38EB7E47F0888F9594269892B065A481F5B04FB7B1A2A5A5BDD79EFC4B072E7885E9F332233F12DC14364B41FF1202E88FA1D1B806BC93 +219: 512FFFAB6D01263A49452F6D81CBCEDE231716D7EB9FC7749AC995A57692576CF8FB82908D8139B98880186913D9DF95690A25CD315DCF34A9B19A6A6A283B3E +220: A8D8F5B99C2434C8CDDB886B7916EA512AEBEFAD868A7BB07717C1FAC5B0B2CAA260403769A1A0C69768F534414AD9FA7F12B3D02D1F442A65E5556F3EFE777F +221: 732A6F8A8CF3067E35869DD05E63AEC915F8497BB3F61A1D2A9098BB77CE9F9DE7FAC952470DC6FE2862D0E5C5C976D2E33F27C07BFC6E9F1C283CBFA31511FC +222: 18F0D205E3C2DBF2D48D5602A5FABB089A4B9D9A564578E68E5F41768B123E4755DC5B12F1B103AF2D8EDCE6BBD7BE6C333480C82B9AC24D731084FE85A71FDC +223: 7D9389AFD77FABC28A3C3E2C06ADC63EA861F86AD9B68E491BDCA03481CB3E954A37B9C1C7AEE7DC4B8DC72853DBA80F4B7A837334A3A7495A845406F4E5C099 +224: F1106BADD214947E9FC8953FC85A0F0F84B796C391F155E1EC2C17C0612BEE5F229BFBD2C107700A1BB0321B8677B1AEBAE65D50BDAB57839A637E859DC05DD0 +225: 3745B81A669451501190E3C2C5F03B3E25DA4B41BD022D523F878A886EE1E301B34A6BA336A2D78DABCF6A2D6A94C3CA8FB131901804C3784FF0FC9E873D61C2 +226: 891D7C0855B78E182AC4746D1DCC71D6F5D1F836ED7CC142C8FD1CC1E4702FDEDA515636747C4CB13C0E0B469FA2A2983265F5E62AC400E06D95D6ABDCF0804C +227: 4DFB981DAE289FD7FBE4DE0B3FFFA3B7C4861EE30C9A0600D7CB87F5E7DAD039AA9332921CA8765F0043588CA77B38EDE12A1C4C222F52611D35DC764890F5DD +228: D647059297820F21ECC2E9759DE4BF5D025E72DF5D29E4EDA4916152E8E4D300CDF249A40CF7B97BB5BC187708CDA3B86DC7F6EFC5D60D3446A90245BA7D9735 +229: 2C358B7BB7D0C6EB3D708D1DC7010395D3D52576A267BCB6B7163B0ADC751A540646F8CDD337C2F530EA8B3B81E259E0916B706271CD37B451BBD9C6C2928E45 +230: A5D6022A341485D5B404348A4D29090DE38DFAB64A3DFB0C3D966213B898DF63F17E6B818D05EE761815306DC3A5116A459158119F817B2C1D368FB7D37711C5 +231: C267F3F3DB07132E5D6D272A510F70C753F460F26E6D2AC777FDC7EBAC6E3BE24C45E5C28FCB1FFDD83652577CB7AEE722FFC41ED02D1157448DF8C5BDDCA656 +232: EE90F712311A783539DEE6D6F2D231565D04A5BF3E3B6E351DDFF8BBDD3DAD0CF5F9C360897EBD83E8C285D63530FA5059AC1FFC0E2BFC9DA73ABE87F2942678 +233: 45AE7BE8B9E827DD4C36F7B77B0E19A915C0A12F5FC22E9F8A6C3625BB06C312D026B2CBC7DA82DAB5157D8661935A028BF8ABB00F8C3926F14B6CD7BD0E5C2E +234: 98DE68402510A98F17EC7122E2D7AFBC7C27566B48B3A2A8AB22376B301C887DA7051073383485B5A43A39405F0A6269AA09F7A7DD91C303802A5AA3BA54E0F4 +235: 9BA9CFEAEBA63417100B96C725C0631523CD2BECC74438BC80F9A1022D828954F93E6EE5002D35B8575DD592156F43BCEA4A71C9646E03075D2F0092F1C9B863 +236: 6A6C866AAF1ADE8F6F5A2630E44918055D18D1103BBCAF3E51446B7B51398581927C7DB21601079620AC8AF652C454DDDCC1F277E14C1244B37E5B35FE9D812D +237: 2801DE5A07ED78C19B00A56F3DA9881499BD2EE9F9BB7DF9191CBD34F9B4C47D2E05A23864923E30205A8110D2EDAA85A29964F1AE1EE1AE05727CDACB191396 +238: F20D1FF110142C73F057F5FE12A039A2E60B6DF59331CC81DF335779280BBEF21FC7C0A5B3464B7B06C553E6A28838D36AA92FA21B25B1C1DF22B2990E033EF4 +239: E954FAAC6E3E1A067351A7D19506A35E65F32692BF59021E99C6E04680EF36CE0226C4995ADE20354E800B2C2EEC617C6A436DC53B6C176B3A8AB93D0A0C4FED +240: D6918491B2ADAF571B1F93DEAA2B19BD71A65A25E787ACE57B488B796499BA25B410ADE9218575836E99F295DDE2EEF5843C29B361F886B1826C31D6BFDABF6A +241: 8522B040EB01F398950D028A7FA9BD74FD3C41562B3106E9AA68FE322FC6D11078CCE7286C4FC8AE25C95780B6D8177DF1EE20E1C22BF6DC6169F9D12A62ABCD +242: EFB7240E4E3003968A5243570E684B97DE987EFB4C9BB1955A92F46E3804D68C3272111002C5A741B6E0F79C72436DED03149B78484041E8ED547DD22DDC82BE +243: DCB85DB22E13D9CD9AAD37139A9FB9FEEBA58075E77551FC02BEB7828D6837EAD98ACC97EF1947C9B2990C7E8028D31B8DF1067DB4ED4D92EDF49AF51AB9DB69 +244: 868B3A08CE08B282CDDEFB6BA266346BB73454ED5A060F5AF9EB404B6C0AFBCF58AFD81FDF8E2B9B5C6A1E1F6760051C88A19197D46D8C46986FF7FB2FA82E8D +245: F61CD4D4463E786D159B9773264DB6D9FDACAA0C43920F09279C39CB42E3DEFF8DFA4FA8B26357F942CE048C5DB8926F799E9E64D64192B44FA17B6245B673B5 +246: DAA2E68B83561B224327ED460F484E7027C0F860E4C8D33E05215883875F6311F6E7636253B08BEBD6B729F00523634277B13A3DED45C4DE2900E249DCE133F7 +247: 8506BB692ABECB87A4D5D8456D06A27BEDD06A3F3539BC1BFBD59E8E7A7ACAC5082A6DA639C589FA495FA4ADF3B2598CF14F8691FFD00037D52441867E5A6F84 +248: 8FF91F48A82AF183695AB70B599C10E5806B09447A67FB2B1AC025A406473B8349845A47652D082028129502370E43E09BD551DDBC8A89C850F17B6DCFBCFBB8 +249: 1102294CDC5A09FEA025DC364DBF0599A229F717A80A7AE1DCDE00D2DEAFA7CBB2773D251D3F6D9FC7D80DE1450466348A46ED6B150E8856373C3EACBB06009D +250: 49E0C6F0F7BEB7F287C401F67035DEE84B0FA65FDCFB27CDB3E7B502B32674E6119E8339074BF82318F78F5309E3E8B82FE4DEA51E5148B28434F58837620899 +251: 0FFC5485EAB086ED2DD466A82E7447A3670CE693C39ED199FF672C4E25F4ABE7BBD99D703E3F9260D424D7F16D666A2FD1C29890BF0EA34B9452CFC16948FF5D +252: 50922E82E11E9D1B5E31DD76C91189F6D342BE64C6EDDABA089CE6E08E1BA35EE28AD09BFDF0543DA5865540F9ED8377978CE7BFB74145D3598D360E960E6B88 +253: 057E7A8047AAF98EDE5497557542FA974FF0A68B0881CF2D6DE7FF9C31060604002C63328175EA3FC8F942B4E5D703C75B6658CC58668EA5C8AB26C1A5E88C0F +254: 56D893ABA2CBC9D8FF3108F43E1A9F903EF30DECC9B8D53333AC0CF282D42BD1F2B8425E7F44A8D361C2E7BB601C7318A908CC065DD0471ECC898FAF24656AF9 +255: 800D31CEC315A30CF647DF7736BC2A57DF5B82CAE0FCE83EDFED4B5F3C34A44DFEBE79D35D89439D8208D26B69A0A9D050F7D3966A03D77A7B1111772DBB9B69 +256: 3A843AF1F872928F0BBBB513207A1A8E14E3D911269FFF521292D07DBD5E2E520D6C2634292801184FFA54FD5F1E992CCFDAFF8162F5C5F6D1EA79DBCAE97E1D + Hash: rmd128 0: CDF26213A150DC3ECB610F18F6B38B46 1: F069A435C14A8D4B02A7BBAEE02D0BC3 diff --git a/notes/hmac_tv.txt b/notes/hmac_tv.txt index 18edd70a3..6508c9905 100644 --- a/notes/hmac_tv.txt +++ b/notes/hmac_tv.txt @@ -1341,6 +1341,1042 @@ HMAC-sha512 255: E8702ADD4B9034BCA0590FF897C10022C56D08FC4EEE0A43BA85E9E9C2086616B1BE7B6F928A3C53755506ED2D9D62DF5BA4A1862FBCDBA20683931A2244AFBE 256: 6E6A3CDE12F2CB3A42EC8A5D21B435C4DA4DF6CA7E41537D361D8169158287BF1D2241581DE07F88FE92F5AE4E96EB9C489FC3B258EA3842EA2D511CE883883E +HMAC-sha3_224 + 0: 097615C6977516D579CA50AC3DDBEDDDA8A9EA75DD1456D93C426D61 + 1: C9794AAB2FD0E1E876B0967BA56469EE3470228B21AFB446F75DB0C0 + 2: 160F43A44A0D5AD957A97141C117B3CDE7079E2B093FBC2F7BFFB88C + 3: FB50ED43199BF7F66691FD164A555710CCA10DE329783CAA45CBA495 + 4: D5C2BB61DBE1762022DE1E5ADDEF911DF0272EF1CBE3B04C0DBF7E5B + 5: 94157EF3DB95B35E6702B602202AA30ECBFD6398B66B6DC067909419 + 6: 946B79F47A21BE210C46C9456BF5BC325224114496063BED93AD6783 + 7: A24D1211452F6CA4DE9FF1AC098411BD65BC4835CBADD2E20F12EED8 + 8: 84D81E1A0C641DCFACCD6AD993E8A7E3DEA2173234CE01619041472C + 9: 0CFD74632D2CD0E5E8724B5B9C20CC2D672F1CEE66460DB6C8487897 + 10: 58FFC2AC722004D45473374F76673C1C146D6D187A37E423990CF1A1 + 11: A77DE120FEA8503183027E91C62AAA07FB6111A9FBD583CAF4BB7FE9 + 12: 1E7CDF60882A177ADA37855A8CE4157F35DF83B5CFBA4486DAC36304 + 13: 11CC5AEBCC914B65020D01AC041E0F93B214E42F0E10110D1015D7E7 + 14: D1BED6AC2210E3CE4F6CD1AB10160D9F2EA6A8D85532E9EF71537010 + 15: 73E2565BFCBF4C86957FA222BDB2846899B8D7A6B800C64A08A11CA9 + 16: 935980DD5CE48AFD1C588C329A7D4DEBEDCBA593F7C799BE6457970C + 17: E0B66DF1917E8F69E2B453519EF8AE5AD12DB20198B6E848E122F086 + 18: 8C01E74E0F06A7051ECEBAE3ECFDC091DB37A8D7DAFDCB888B2B5A70 + 19: AB8A2B02347F341221DCECEFA373BAA3A1CB78AEDDF63187C4C59084 + 20: FC73EEBDA9ED3BAD1A21F40D1D494CD65FA8732020B2E14685519F28 + 21: 72570AE15255A57125B7AA1F73C2088DD7311C1B61D5F471D725CBD5 + 22: D634A5B137AD63628E6B6D8D3D5A0CAA17D08FC3FB94BA8A40C0E1F8 + 23: BA405F7C97B41973A797E79CEFBA2C74F4AC81ABE2A4550D3934B26F + 24: C8DE7DE51B309847277F1F1C8CAB94BAB58AEB0AB4142FA0920CE724 + 25: 3869A91DEBE06A4C454A56D26C93C5CDE3D59629678557BA8F156500 + 26: 4F9053E777513A479BB6DEE90F78A11FBEDFB8E989C1C50FBD3A81A2 + 27: 23FFB250B1CFADFB5721D3A6E18CDD703C035CD5E3F85942137E57A4 + 28: 84F31C6106F2C23E6AFA6E43A32CC10D2AD931237AD7E1DC32CCAB10 + 29: 4C3D3DC177F4617B6414870BA835E414CD6F36F3919098A4A3B0FBC3 + 30: FA91BEA1E47A36C47BF76D80E961A58EC2013F8CA709E15D4B87D1F3 + 31: 784DC7661BF0EFE56A4E0095F494B363B1150355212640C687435B40 + 32: FC283C25B6811F5227330F8BBEE4533859E9C77495505B37736950DF + 33: 01A425B2F2AB379F49CE4311B80B81BA649D53843C94AEABDE0745AA + 34: 0240DD0E935E5A0F5F353B35A5B9B95405EF4E4784582AA18F41F59C + 35: 38062619A45BB1F7F174B8EB7E3F07FF4D31D5D22BC6C6EF919DD78C + 36: 0C31757EC9974A26C90C72DB255EA3B0BC7F8E5364E2FEEF671752D4 + 37: F2C71A5F3B0932821A0B6017DB88A1D84E93F194F833A4C3BB56E597 + 38: 64CC004A73D9FF77D2874EE41B95CC7269092712CD9B47BAAF8CF13C + 39: 7B9AD5DC5BE0F8D1F97BECFDFA42C9DAF405630DEB9F326E0C013047 + 40: 7638BE5891521095C29629CB63A19B14A5749CC6A9412B9CBCDBA31D + 41: 50943C86F806E189577C8FC51299BE47A11E89939C33905876363023 + 42: D1307185009E5DC16A0FD30321F4290730D69830B55AEC5735FFFBFC + 43: D6C9FF28F0D4F417A2F1DEC4D79BFE9ED2E4EA7D7651483B0AD87B58 + 44: DD194C330C4B966A0A2ADBB20F700ACB9CA52C23CAFE1EC31383674F + 45: E33E4E21CDA8F1567050A80C77E89C5F30304281AC810800E78CA033 + 46: 115D6156875100D66D4CB8486DCB42EFB71FD0246D73DA85205BB96D + 47: BC7D5960345DEFA0EFEE9EFCBC9C6C10046DA4133FB2CD6F0E7A1B9A + 48: E7DABAA091C153FC708F5B7ABD971932DFD0CFF166B9189779174B57 + 49: 088DA5CB192C5F002E02B3D0ED91CCEAA53E35D15A527360557492FA + 50: 4DD3E73BA2761B66DD014BC22862D91D9D93E6187E06A9E951DF59F3 + 51: 08D52A19E31E81770735F121BE11D6DCE1E2067F717C68701FE4134C + 52: 41C0B51AEEDB254D812BEE8242868BD8E5537567E6D3A2524BCF78CE + 53: 5DB277ADC688F7AFF48ACB77A129567F9E300E0F8673455186571709 + 54: 4244EC7906F35C30C04F7F0B4DA4D6EFBC8E42E35AFAF5E153614340 + 55: F497E8AEAE476B95949C9D7AA84ABF86DC83D0F085CE336256E6EBD2 + 56: 43062AAEEEA22DD5B8C76DAC7BB62CB72F7CA8AF58A3F33374D29BE2 + 57: D277516040450CB807BA92469BB8A0264B0D0974CCDEEBF2F853609B + 58: 459E43DD1B01E9A34561FE650A9CC1AD8C7E7B1BFF4002A5DAF185C3 + 59: F47BEEA645CD32CD4B450A04CE7E2F9DBDBAFBF1848CEA3C6D955BBF + 60: 84A2C7F60B896A2C31AE510A807FAE3F3FA01FDC390B685157BCE4B4 + 61: F2B647EA655D3FBFB70E8A3FAD895F82F838BEC323D815C75F1BAA3A + 62: 4ACA2CC14DA429852A4C8455D5F542D6452A6D9DA903EECA228770A3 + 63: A4D7CBD298733C27271E48F476EDFABFC9FB3E1DDC173D68B19A25C6 + 64: 08A7DBEC6660A636C36586A566251C4D1CB5C73684D3FE497E460BDB + 65: 585E1749FEC59E2F7634728A2216C0FDFDEBACB07A8D4D0DAD582DF6 + 66: 3859554FD1C4E591E5F35771161D805583C972A39825F7F89277C30D + 67: 7FE2F288ABBD9BC7F0AEED46E9E36A524F36C019BC0AD6C2EE8C0323 + 68: 38A976E6AFC92422A05F49085D708FB509B06131469EFFAF6015DD15 + 69: 0B2FF6BF50EA38290BC25BE9ADD88D605C2E0CE332966AD3D6F7DB46 + 70: 0C8BC9785348E0EE64B2B38DA4BF4E208D91CC96594D2A26F9ADBCAA + 71: D67977263EB1CFE9B2CB9C48C3A055DDFE93CB7BAE030D4330FF86EC + 72: E11A58F8C15D90AAA497026D10AC2BAE3A187C4C8E44F333A8405B7C + 73: FC291D39E6CDB794BF209743F11BDF99AC85C553AFD3F52FC1B5AFEE + 74: FA195483311682AFEDE46606B83296C04982CA86750BA46AFE5C2D9D + 75: 62B71ABE5C9D828418A529EB1E78BAA49F5F3A1693CD5A17DC803B8E + 76: 74B68FF53436F05AC7A6C330A527B76272FF9C3E95C606AD6A663389 + 77: A774514265883F2E55F58BD89329291C1C3846CDAB8A4191F781C755 + 78: 20F0F51E03EC83D02B96BA8211CD2D39122839D763AAD605D59EA8A1 + 79: 25B388FA15247E00A6D1129387136731FA6B3167425D32CF4AA17B5F + 80: 729AA367E6FC995157DA1E759E4693EDF3E4306DB0052B4D70C30C49 + 81: 5EED7BAA9FF62B4C1B83B0EDCE305BD5FCC45133C42F47E99B7EB24A + 82: 444ECBF69074DB7ACC6A4D6542910A890CA8A413429657AE9B088149 + 83: E8C054137F34739736C7FF2A24B8802EE1DFC6FB275971D61BA2F629 + 84: BF6D962C0D1E10408FC12D935E8CA6EBC00097E418EFF6DFC8C0C8DB + 85: DD5AFE2213D544BEE1C55FEB73644A40B69B6C2E1AD6F7CFE87102F8 + 86: B69BE06267E2055EA5269A659A781ABA5484B9717AC6007D1A6F417C + 87: 01AB67F5C6168C4AE5A71DF520D0E596DF21821BDD3075298CD61AEA + 88: E7395FE0F87F8474B5E38623438876B26E4BB9B4C059DF1D341D206D + 89: BD7C568928C76056E4B077CC2169E65BDA1FD8B4CEA9F21CB81D28E0 + 90: C691676566A965F0554ED4346859DD8251965F34A3F1457993594107 + 91: 203DA7C0D9B04AF98337F68A95C5D4506746DB18E7FED364294FCA3F + 92: 42924973495C3C89FB76ACC2F4DD5EF9C4D3D0DC6D0181D15BFA7594 + 93: 8C497CDAE794198AAE0EA921210B6F8CBE0EE125626D2E59C4817388 + 94: 82C8DA8C932C6E97089F0055DCC8B7D823A81BB5C1AAFF7662247EF1 + 95: 232FA9F715F9F5E4A045E5B734AC482EFA7604918C0372CC2E6D724E + 96: 77D9C629D917D1D3781B43114539F7B1DAE22DE35929D5FDAB96041A + 97: 50D1E00B4138392CBF45CC5F1FE5FDEE3609D95C4ACB61104357F576 + 98: 8897718FB4A615CEA922EAD50431CC7AB6EC597C6B603E7DFF295D2F + 99: 204397BFCAE5B460F1E1CF476E0A90C86AC98684EBEA34C35C1EAB37 +100: 6D7DBA498A5F6D8EA571C625C8EF16C731D8839797913F4601A67012 +101: 0C35A9D6B430B5EA24C5730C3B4B31B458F01720BAA2949AC9FDBF32 +102: 3E748096959E0B65FC7FF05F69226DEF4FB3D7E0D3C1FD950020D7CB +103: 72D325CA20F9786E0D9DF3C45201148C749DC27275487E82802E4A6F +104: DFD095E41F27BB2A36117DA2F467C14FD830B5D85B9FDACDCCEB8EC1 +105: 96BBD2BB58BAAC5941EFB9009A185F02974E8A1666BC433636C71E0F +106: CCBB2D27CC2131A98ABE66734A4CCA0F39F00E3D027CB1AF562724E2 +107: 46A251D71FF0411022B8B5101941121EF12190F8925476D3AB9A0F89 +108: 00E07EBD7D93B5463D90DCC3128D364D27BC6EE469ABAAA995E0D61A +109: 3DA7D46D89665638BA8B782B368F2B6BFD92536FAD283C7F16D88D82 +110: 0AE416DE46CCE1FB81E355C47E5C82F7437087C86716AB0D2DBA5367 +111: 50372B56DB52DC6586D7655C7BD761DB4B2197AD24F468DC8A43767A +112: A9882EE039ADBD531481FE2767B0509BB632915FD360E5EA0E553197 +113: E400BFAE9567DFA961CD18B6210B90725419CF4B0F96D4CB8766F6E6 +114: 6D39BBC5A1F105E6CD30A551383B2B2D3BB3563F0B2EC2F972DA4259 +115: 699B021A0314291E1419DA1D1755C03B747801BCD4F02E2AA69C887E +116: 2116D89EE053669175C2F16E044BEF8104F9153481325F71FBAFE76F +117: 09F424C64F19035B6120EF9DF5E15EC08B6DE8140B29B0ABE71593C9 +118: 6433BF7CC6FCA8B6F8044A31759D50640D6278DB20B91B446EA024B2 +119: E0F6D8F39D5DD581694F39F5C5892B2434E09C55FC3D1858DCA9E12C +120: CD39A6AA4EB0EDE619792690C7768E0A4BCE1D05436D418A28BB2CD3 +121: B99F6AF07033B45D2C48ABEE5E363EB6A9DA99E7FA95104E78417340 +122: 04DEC92E7AC23797A935CEDA92513B4CD0F6928095AA8F0C87FDF0ED +123: 82B22EDB152AA39440994884B6DFEDC33D9D39AA147D9B001B2B550B +124: 5407085F03090EEB4ADA422FA7D22DFC6FB7DBE935571852EDDA732A +125: C752CC9B71C73D314366AE32D8AC3B4C2177830E6D51ADC7BE05703F +126: 5A351F5DAE73A29B4C215D0BE487DEC480F968ECC71E329BD4BD898F +127: E9C88C0B2E7F202ABA17A0E05C2B664BACEEB6B6FE2F134314CAA3CB +128: 7B8E19DD2C63E738E29161275536D3FFC6CC3EFAC3F70DCD5AE2D317 +129: DB5668185A86BC65D92CFA3B16F5AC66E759CED54C826F757954FE64 +130: 9852824895A95CDA26C8B6A86BF1E09AC4A96A48893EC06161C84E62 +131: EB6D57A3CFCA48FDED32D6EE5AA946A9DFDC8BBD35BAECD91BA0AC19 +132: C3462D182AD091D5E3FBCEB351C36A142A88A85D39A43B8BE1CA7A87 +133: 980FCCAB11B0C283E4532FBAF63B10556876E00FAD0282B42C525267 +134: CA9D423A057644BE80C6CF32C43AA211F22631546B260F53E640E6D0 +135: 8056452F33B792C5F266EE894EAEC216CFFF2C45A19CE77D4ABCC6AD +136: E5BADEDCD25F0E33E730970E7C87053706DDF4E7FDA6CC3F5712ADD7 +137: 022F37134DEB450BDA907E32525B163A54D9B6C2512FD51F820957C7 +138: 7327F1925B54BD5A236B9CD430DD655FA3D307A73C022809DAA51C12 +139: 9726B3482CE3C4B6F23DFA789602F43A5383B183B2C2FB3E2144C28B +140: 704276B004E299BC79749BE400689C003443F2F230EFD1D7A584CB81 +141: E665C11F7BAA49E7C959471B2416CA37D7021C25D6C5C250C5E39E7C +142: E223DBA5621C2A1A609FCEFE16F140B6D2240E6198F3624E5D536FDC +143: 838CC4C804B05A5842754C8D5FA50D663EB0231E36E969F0F7E66BF6 +144: 204AFE7362FED22501D55F0709DA4009048BC6AEE7AF9D627E53C4E0 +145: 7436B6720540805B9D33ABAF6FCBFD7EEDCF1A18173E9A709DC3F13E +146: 21A36F695FD8C283803EDA01FD259F9ED0F1007E178DE0C1F8585D96 +147: 1116C341466D509DF0E7BC1450C50B604E64486CE1BD54F6D825F622 +148: FBB269C51502C3B0B9592C832AB993A7C59682B221A6ECB3C28B870F +149: 52AD5B7ECC7A15F277ABA046CC299D3C5CCDCCC9114D62C795BA72D3 +150: C16FE5617C0E3F0B679AA1A332DB6C2F66511DA3A3AF92414FEF1497 +151: 5C74F412034F56D2A73D82CC7DE2924DA0485DBF7D8EC438AFA1C36B +152: 7419A1BEAD1CC3901D29250FD995B13A78C2F5AB74542C01780A9671 +153: F4C156C23CA915939CBEE80CB95297ABD5BE045B85F27BFA733D968F +154: 0BE039C7F5C8151FDF57617BF2E11BE212B7BE3ED67CF888C2A46FDB +155: AD6A547A0C219253F280B598A7846E1D34FAC5B32BB7AB4EAD416971 +156: B50FAE8ECAC96C5CCBF85509099592D9247A117D02811F4B3F415F92 +157: A143814823A05EDCA5F971F50BCB919EBE1D0C238302F9C8E71D9AB1 +158: 6FD6F1DA975BB1E33929969B13B2B520FBACA86B1BA004C2F776518F +159: AEA9B12B31FD47BB1DDEA7CC3D3BF2A4A6147A48FD5DD6F78E434570 +160: EB65AB477774C3374940C9C7EEBE1A1ABA0FB8336288FD6B72C17ECB +161: 14EE85C2B046D13C6A120D0611E329CBAA3BCA9D894BE60EE210351A +162: 2701796DD9804CB0075E2A2BC1CE490E30AE308CD4F3F789F166E334 +163: 3252E5EAA80B5774A1B38E7F7706C0F91CFC8211F2C698DFAAC0D832 +164: 12EC85B910B408289B393E5C5B31810E6312F9B213E493335826D8D3 +165: 7B92477A9211E2E104D9B98C1FAF26D8F5399DD8CE4D2B74E298E1FF +166: 0E84F77A0C6BB7DCB19FBE9066B77F4445929BAA876B8E9883C2AC7A +167: AE7018A08C1F7FED878F42A9C91B78B607DD52CA597D8257ED8BB760 +168: 6A58BD0F50F1F82FE012A1E792E9BE29959B1767AC33164B9599F613 +169: 86472A37D4350FF268A7F4BAC7E57BA7685F5E40B74AB644978DBF50 +170: 68E87659EAF4FDFE6549F449F5E74B3A1E3082DAA283AD70D021A51F +171: 46877F1F0801AA312D78D82E7F514A6615A5A787A5B461149F211B64 +172: 877C5B0DDB9B40EF3C0842F10BC561A28EA7DC9C69A5D3753F3CECB6 +173: 3A99440F00F73087B6A779CFFDF7ABC10BFE9A783ADD4279C1720703 +174: DA352068FDAEAC17FFEA900C09C318C24A3BC7710056196A209009E5 +175: 48163EBD543A95BBA7647A66D69140EC3976F8314E331B3650E9D697 +176: E073F662B3445CB3A4EC8951BCEFC2405C9969B8F2F01A6DA141FDB2 +177: 46435E7CC881A3A35DD816B391A7ADF76502B7BF6B57672A3E9F10A0 +178: 7E8187D82A3D80D47FCED04CD35997792C379508F2F2B7C87F4D3748 +179: 71CA7932ACEB0DEE5A7147E5A4DA2BE29899F370FC508A608B08F13F +180: 6651ADE6034652FB58A7A2A1572E04150B88C297EC963030A538D3C6 +181: 577372D179FC1E39909E0FB7C2854C20A15F94A17E20D6B246C9890D +182: 68B234D614E1CDEC5C6A5E479A5F886911D5A736D48910F8EF924114 +183: A6E5312D49D272442A8DB0C6DE684949FDF8C8CA851B6017E35DE553 +184: 099C249C7F170E68B5B469477686DD3CB681CA875C8DA72EAEEF409D +185: 07FA8034ADA718B886ED59F11627794C7F3AA13F829A5CAE11B274E1 +186: 8F2638FEB41258412FFD1F86F0136BFD6E96EC45418C1143AF9FCD37 +187: 2BF2F51ACB3B962F43B60E8FACBA0277243171710EA2B286D7A4FB84 +188: 70D1B65C834F7D15AC3D6D535C844F840D53100C30059518936BA325 +189: 71A39FCDC3A5D0E80FE5C6223AC34FD88C40DAC90B758FE6D7E85AAD +190: 7347930AD8DA6BE2D04254BB41349FBB02DA5D054E2CFD893F62FB6F +191: D3FA33D581A2374795AF6656B4906503C58E5C4B8E245DFBDC63F267 +192: B19A586C91F015F766CD54D5EBD486B7C00699559B0E1BFEB607C5DC +193: CA2E20C59ACEC1A9336BF9FD2544715F8BF1124F88A62928C863D793 +194: D3549AB3BEDA538F5A73905069030F4EC5666F78BC50F3646A1E23BF +195: DEC5501BFFE8E3D3A88B0B3CDD733F02ED7DDFA9759709B27ACA1D37 +196: 1DF31E059EDB4835E0DA8E669B3E871DEB1F849BDC18D2828EBC5BE7 +197: F14BBD6E93E5BA5304637694A870E4D485E918CE7162276C48406C1A +198: 322F2D980781EBBB3A3DCF948D85D6B8E7D7906E8A42AA419ECC5DCA +199: 67C618EBAC4318A733D2C1E5BF9AF77471D4441A18E6F912A95929BB +200: 5E9394AFF6C00598800EC66C50C9CCFCBEAB11CAF81FF8B157BCA40C +201: DD0F89830C8988389459B10DA93D26A1C667DB591DEDD78DC76BBD4E +202: 711C1968E03F16C1872EFA1722DABD77787A3CE30DB70AFB090B7489 +203: 94CD49D950AC2C889F51062000DFAD97E62DDB4113B8D16E8B579474 +204: 36B2A0335907A3AE4475B249826636A277786AE45CE457571D058512 +205: 04A561B216083EAAA700C3261EF705E860EBDF8D021BDFE5590B8671 +206: E9B488DD6BE045956D4411658D1785517E554D59810273B375A97E04 +207: F966DB4A4C57B926B98435B942F7B0932304383367B1A5DF9A9D9619 +208: B778C4270B255E5FEA41342EE57E098F24E6891B90860CE370E4CB22 +209: C3B55C7059882BC1A389D423DCE6584E7BE56CEDE7E1599D98FB5CF4 +210: 4D1F3659098CA1AE5770CF9888905DA62E3A2AF709168CF874B5D922 +211: 93B5A5167915F0BFC2478F0B172825B530CC4DB86BF63AB6C916531A +212: 0A1E9972967D3A5A83305FF0382DB03162254321927E364DC32BAF27 +213: 8048BB46B486FF86D057108B9A67CA383AF9BE92E64166DB6410D4F5 +214: 859C51B18B6B18F790309528C5D30E153A6AEEECD17101D23F66F08D +215: 5C067C5AE14E26991F80D1CC40EB800AC8B242D5ED0B2F08166ACAFC +216: B64F460F3C2351CBE556A13A7C40B292DFD2469CF35FBE010BF3F1E9 +217: C68BD0D676DAB7052A787EEA2223403CA6806E9C4E94C3834851E5E9 +218: E510F11EF9EC9430F6033D899B570D175FD59C521DC9532B85FAAD82 +219: B591AC6C1440AFE6CADA99500FE316E215A654363F16F3A1F7568848 +220: 9F9576C326566C9C6F595AAFEC14C04D99D6FA8E833794C32AA195E5 +221: 654245D71920A9318ABEBA114B7D56BA92A0BAD870EE86C487534F07 +222: F310D2B61553E1204CF981DB7D9E51AD97197C0ABA531C4F1F11B1DE +223: DE092B0DD0CCF39B9EF8FE5B9F560459E8ED2EE43136D582D73EC483 +224: B0AF3AA9BA6C23CA611010166AD1FF42C8D897A302D668E5A7725536 +225: C4C624D82ACC89C77B547FBD3205729585EFB14F3E855E605BB32E27 +226: 81BFB8C45D8BBB884D3D55596E686B7CBAD08C420770148CFB5A9841 +227: 8A69C4E69C681196F8265DA0F9F0D9DEB9836278959CA739097218B6 +228: 78A44CB1DFC0690A3FC5F07FCA63CF8BDCD42F7104DA7823552EA9BE +229: 4960925CB622A7A3127A83ED003210040558AC3C742C7E3F8FB4D653 +230: A4D0448314A5921210C1205A156E17A2F676C98B1887E404D15874DB +231: 8E80288F71DD2C6A78180641A7106691E3AE5B35C96E23EA93FB14B2 +232: D0CDBD78C5231820A0E5E37EB5683587EC2CFFF8D69A9F4843C6E627 +233: A555E947F2590C3E5B2A0100FA8D2E3021551A9952F3F3C957ED1359 +234: 0C5C53C69C55855D2579E1DCCC42EEE3B4E2BA9BDDBCB5F5EDD1C6CB +235: 185C2B2F3485672F57E48B60D476C2E66F8843289CC7DF19622C9670 +236: 28BAD1819C7DD8F32414D4F93DB28B162992035B687114AA2E0F8371 +237: C8994398BA0AF6A085BBE9A00FDC73FDDC4F96DDA7ABD732F4E4B234 +238: 1808177059AC27202CC032760B26585976476EE807A0C7CE9BAE9A25 +239: DB5542BCF2F2D64715042FEF4A0810BEFE752F3FDF7CE4474CF9D9BE +240: DB577569F9BDD7AB727AA0749EBB3A881C5E00C8847C50E3364CBCB0 +241: 319D204554A85FEBFEEF7581873BFA1950D751FE918C3344B1F4942D +242: 43D0086B54B200A9BC27B823CAAE1C819BB2DB51DB8DFE639C1D6327 +243: 5786259974219D8EA1170D14BDE4B55A3F1F9EA4957A981BCB25ADB0 +244: 7E166AD9F1F07239C6A0EDAEE8E2AF3D969E096FB1ADA8CD94695200 +245: C8D7E4742EA823C0233D9F9BF2AAE88FCBDF4425F1540D5A9F8ADF2A +246: 193FC64B4112511DEC27A51EB53886AA0296E7F1261F81127E262447 +247: 233A93D202F844EB36F8500009D6BB14992044BA3F7E912E6738CBF2 +248: 5A4C232861AE50B14473EE3B65534165C64C752060D38457DF6DCA58 +249: E29952E0DFD55F033E6A82F92F27477D455375FEB59FB0E0B6DCD3C0 +250: 053A3CE2B5FAE20901132875E503B950B2E9F99C95510543E04948B6 +251: 1BE4620B7CB48F456C3F76D715E5E6B46509E3B457BC82D771276D23 +252: 96F789484E6440CAE88F56B0AF72301159D6D4E58D5A50B8275B2A77 +253: DAE299F0FE3A7960BCFE4787B239F2DAB1CA5806EE73B1B465CC7EC2 +254: CECA92C774ABB4E8C6F7DF3A4439AE1602A7D9FCF5A4A3A60E7DA9D8 +255: CDDF05CF01FBAD632586BFB8C453021CBC44EAAF7EA155673CC4C110 +256: 2E0A0B3D18D78CD2A8F21221C370057E2C2C98FE1AA75FF7381F5622 + +HMAC-sha3_256 + 0: B3AD6507ABF79F2775C8724FF0659861665296472853A25E1ABD9CEE858A47A8 + 1: C4C1AC7AE45ED7AA1E6CCC92855E1E034357D4113E59F6F4C588E8A3C310DAA0 + 2: 91A1098068E71CFDB0F7058087D30C39DA45AF732D6DA46BAE30883043CCB803 + 3: D334A7DC02262C0C7BB15202B721C7958E3C6F615E29EC2A2899F4E4DBE7AA18 + 4: B63B033527852E6087BB42CB0CC871AC64FE8EE97D8E7F19F3E89D22B24DF940 + 5: B6EB80FF6D5F4ECEBA2BC07B2F93A87735E0348F7AD41141B6A3374ACA821613 + 6: CB0AC7D42D6A7BBDE056745DFBBE14498D5D5300A499D5701F260FFD05B8CBBE + 7: 2FCA5930AD587F285B8776B17863F48451CCDDC5B4FFD725BCE2A347F212A940 + 8: DF164B418324209452E194ECFE355F8F93D038A0D1932329E79B3B5730DD1955 + 9: 4A15811C39B3981C66C499E86541020A121781908404B71BD7378BBB5219D09F + 10: 5B4FABDBEE2DADE011046E1192B5B24E552EC627459F0F82972F2C03B7D264C4 + 11: AB107CD1829A4D0D9813E77A3C6A1CDCCF14F26670BA42FA5EC9D73D0CD1C089 + 12: 59E3800F33483CCF33AD954E0724EAF61DFDA6E14A806EAC96C0A1F72D31FEBF + 13: 606A44A1FD532766DAB61AB852EC618DFA9DCD01F032D927ABC150B7E6B8B94F + 14: 6855F1F198E2927A9B906FB1D7B30449BF3F016CBA65499E63C64F0E8E02D346 + 15: 03C3FCF520F4138A6D09BFD04F0CAAF4CB110146F7EE66C01EE029A96850EB2D + 16: 8BCFF11301500DA4C08CF076FA45D6A4B4F76E7FFECAC612E8C2D3E243127B29 + 17: E16CF5EEBA857C9EBF5D82800DD18B9632419E6FA388377F1C0233519055B6A6 + 18: 06FC3884F6BA6A99215248DEA300F8EE4E393A3485C7D8D86D4A3EE46074FC3E + 19: 4BD3D637432FCF6DD0FAA7A966B91D2F0DA4EE6070320C3F3B39512B31B1FE27 + 20: 7C7D24D456DD908DB1F368FD61DCBFC67DA6DCBA95AE66ABF0F006C0040DA1B4 + 21: 0DEC60BD664B55131BBD99472330AF4DA30681DB71F4ECA32D069073E18AD520 + 22: 2659134BC53F7928626CE401A66ADF137CD7ACE2E6C894A63E3F6255A27E79B6 + 23: 707C1B406866DB7B19748E5925F2B6DD54993BB5AE7C3536AC6AC242D043FBB5 + 24: 105E458F3A9377FC4A8C614CC37D9B73BD6F8127830EA3DE00743929332D5C75 + 25: 4333A8230C55461D27B688B69B70EAFDD2083154327F2CA6AD34CE7B644E2FE0 + 26: C86FECB284DC338AD73533A9AB973ABB67ACC2DCA2B2BE850A4C6C022F15CFA1 + 27: BCB695C127FBC3C9C024F3818CA44FEFBCED0EB998391AC39BACCD7893972AE7 + 28: 49C28B6306FB1327AB2604F712263B79DB774F99A8BDABA82D83082B8E5E40E9 + 29: AC6FAA9DD432F9084469F9BACAABE65B0CD9B33A829E9A744BED1100B2140DC5 + 30: 1FD400F2698FED91F47320D5E626EC4A37F7E49E7EAB26DCD169BD57867EE79B + 31: 1DF27229043E5495D4248B6F2D13523F037276A0FBC7A2068D563B8766AA222C + 32: E912B7B84ED6951DF3120DA8E5D3334E30E637D7254DE2DF79960154C1F7987A + 33: 4124017890482F7D482E4266A0D0AC4A24D21437DE47DFB126CCBC4D505A5683 + 34: 35D7D1F94D8740CED1849C3F26A61E117C3A5952DE2AEE7AABC6DF46834A3178 + 35: 2EF97001134CB598C56B901D265B278F538CACEEF5C81936396BF852ADD5A470 + 36: 9915739C64F18BED76C5C5D146A391B91AD105A8115E6440678A0EA221B4C567 + 37: 6CD7E1F49F26057EC2CEAA5818D9F1BC0B183D298E3F96AACE004598D3C3E164 + 38: 5078B41DD5B300E72215DB81A4C4521A3E0ACD84AD9999EBB07417708FDA0FD6 + 39: 0528415C01ACBF5963A10E18EECEE5DEB3996BA83F31C16F332DA70C6C7AA31A + 40: A77E2F0F2A1DF65FB0353C9F389819C9BBD8610D7E09335609CE52091309EEF7 + 41: 0D80EFE65F21F3E7CE49EEA09051827B9DBB3BF8365E99EAE9BFD1A7384ABF3B + 42: 3C9C68ED0FC262E820F9C466902938D442F68810F5BA10A928A1FD50B6016016 + 43: B393EB5239EDB51FCF9D24419054456892400B115705BD980903521A685D1A59 + 44: 42C62F603B9CC9639DD05B171964C6919497C1C646B4E42A97A3A854884FEDD9 + 45: 94F7F1FC81AF7E45ECE4998032C415F6448C207EE3AD24495BC73DB6CC56F7EC + 46: 51E1C90FA50D28213FB916C12B8D593926534A3D2DBAC6418B1DB09DA371DFC1 + 47: 7B57018B4BFCC9C90FCAF32F758C5B9D18781CB39A569A5E8F3B929C8A26BDE1 + 48: C88EE5B1DA000CFB9286502DFF4C73A1246284C291A383796C37750D65B6A777 + 49: B65BD768EF2605B5ADA07B825B85CB8BFCD80A56721B6939F1B7C474C9F01838 + 50: 654F3ACCC1223F38AD945E3F5B2C0B9C7242DBF1940C8EE98E88CFEBDCD35635 + 51: 60B8E14AA5E0623871C9A557A7266D739ABCEB0F725500EEAB939711AB69BD5D + 52: EBD38E564B3E3148BB9C1F229C7A700B069E9C5F16F3855815D5B56309A2F38A + 53: 32657C9FBD5FEB9549C3A7C178765333AEA2192EC67E2348B5A7693EC6E10B9E + 54: 64E69B60C2B31084913EA3686F258203B8A605A3B482880680D673DBB985F152 + 55: 6FC4AAED6E1D7A7CB32D4EFDB8348AB74245DB76DD721083BE7A06C5431B72BD + 56: B35A05E64EF9B4D36A2F1FE0C441272E8B18A29A2224428C4BFC5AB554BAB77D + 57: 785977C980AA8A68C83437946922C53DDEB715E091C772B0CC3E1C3981DF9DCC + 58: 08FCEF667E68A9ECAA65379E468366EDCFF7A636D2B548F4817E5DDAD134167B + 59: 1DDB17C5C8CA2F8C71D26607181851071DBFE086C60DBC92F84D149E498274D4 + 60: D68C84FCAB6F2B323527951C6919AA8DFA454A1142FE9C7950355C2B864BB025 + 61: 504CADC4843F49B859F17DA7EA55085107830D685B1845A6F8C63EB97ED8E333 + 62: 66930741317BA41FF7DDB771116F47BF0C0FEBBA09425915ECA2429DE89C5259 + 63: C2C136E88F567CA317932967B692ACC0A179728C71972B7ACE1BAF3AAA19DBB8 + 64: 7504C9E1065D65871299AC50AEF21F41DEA62046B187FA82DE10E4097ACE5861 + 65: 10FDC645C6A39A3BCFA05C984A195423F9EDE20F56771D8BAD59CC9C3060B56D + 66: E14A677836528DA46DFAB4381F0BFCB52D6AA340BA013E2A2A29678138457823 + 67: D52FA94B84BEAA21E8F667BDC383B58B123C82A144E5D50DFD48F34B89975754 + 68: 1EA5CB0DB75E2D153915FA316875A039CFC32CCB4948288EB1897C981F2D0CBF + 69: DA2209AFF7E586F2D2F913D813C3C86C4C9B4FDEC707373A61771C356A938F8E + 70: D680424FA26115C4CD57360BDF1F3DF1F1837578CC5D4257B00FF7812C4CCB83 + 71: 77FC92AC4BB214BA0EFB4366592E010386BE0C7901AB348DAC878AF51AD07542 + 72: 14E1561991DD2AD2E2FD9EA6EE0F4E759CC32D851FC876DB42580C880A90DAC6 + 73: E29BD112194230315C73F232DEA143D5654DDDC67A33CC959238DE9C0E2EC22C + 74: 60AB7F214F506B628083AD7A17574104E5BCE4DEA2552CB1C20207AAA24E0298 + 75: C92ED34A47B4486CB3A53E83B332392C0D6A50C99CE6148BCB1F520CB3A1AB58 + 76: 02A1660D529B6EBB3032FC0E4F17998297D81A54E4520009F98B6DBEB1C29F77 + 77: 9DEEBF0C27DE7A8C24DED0D31C4EDB80E589BFB8551820C517F1790D19F0C226 + 78: 3860C11250A0C6D047419B4B8A9B065A61FE9639C3CC762D73A0252E2B8334B7 + 79: 42AAE95514CB751318F19A1DE14B01ABC8473EE137B68009E88188CB4EE30C41 + 80: BFE08A80C0064BC986C017FE93CC41D766834F2BACA9A5CDDEF38373B8B743DF + 81: 781B0C582287AE15442371C7D06172857419C85A83265DAAADACBFFD9DD1CFBC + 82: 27F6493BBBB249373189D47D46E51B9E48D22AF83DA94F9E761BB9A6279BF5A6 + 83: 63CFF39E683B970446D8E7CB318D094BAFD27065C87494734A76099412012534 + 84: 974E56E1EF3E6A928CA05A4FD24CB9C27ED33EE6B5F898CDC3BF72624C875069 + 85: 38C0261D73FB6397D0CA3092A3D4B692D3BE254E42B7A33AA0CA4CCE952CD402 + 86: 9E40C81898EEFFF2637B7BE096F79C30F5DAEF608CB0047EC3574E0A9F0D7D1C + 87: 10D3ACD548E6C8526EEF1C5AD6D1397DCEB365074413BEF05052226E261A9714 + 88: 8EC8F8A23DA9EE2E9254A78AEF7AAF8A7E32F407814BCE1A887BC8BCB1AFC479 + 89: 36B6C6EB3128C8868F5AB2C91C40FDB589C763A769CEAD1857E95DC57BECB639 + 90: D35C893E1504A877ABDF5A5E275728E59401513040087AFABFDA21389F72F65B + 91: 6898D506DAE87F598CC253C0FF0EDB301B8D3245C05D7DDEA9268620AD892A44 + 92: 8BE033F43E635BF448EA08F19FC3DA99274345CD69A27525180A6C9CA6D0A7CB + 93: 722845B218C6F1644761C17C8FDB9360BEC53F047011E2CEDE6399ABD4EEAC94 + 94: 89909DBB48820D2BCA2DFF0FD4E18A818E337A1EC5C7FEFD095FFB02977BC470 + 95: CC37C78823A24BB2F7E7B2C05E0F8D89C283E947904AC2C3CABAA1ABBC0DD86B + 96: CB36A57B9D1E09DEFEAFDF743D3DACCC76A26A0813E69C8A8C89A7617D2C16A1 + 97: 5E4C0EA1DBE96F62DEB6707C8C3C5B7CD87F29075319FC9934611BB9C7231728 + 98: 8FD2B02324869DD78727C09E3C2E1CC5955D9E754656E2F48CBE16EBA2522BF0 + 99: C0D2EF11ACF0D0A94E7A322CB8399E5F6EFC2017CE5772B63A9BD83824D6944F +100: C9F4EA21639B2560ADF63B708E385E981C39FDEC3FF2018144CC34429EE49334 +101: BCB5778CC6ACBC7EF117BB56DB706D0C8725D7A87D897D1DF184724126291C58 +102: 2F4EEDAFAFC784194C15D44B23FFFE956313A74DE0F67CD7ADDA60448787B87C +103: 1B68890D3E6CDF038410BC3AC1759F543E77B73827456FD18AE25B0DE46A2B92 +104: 0B992972ABEC719F10407E918208ECBA541CC9E2B015E348C3CFF70DAA8E704D +105: F914399241D0B7A4793A9024201608BB3A37D777877F305608EA68096F40CE94 +106: 088F28A84B960B1BB2D4AFD935C4083CCEAE4AC27D1973F920F44EDA2A9E92B0 +107: 6B9A358A1B290806923D3C79DDE6777DEB4DD84FCA256A99FFAD5A1670F2FB54 +108: 0EA1E0D4C5F657F64708DB7EFC223841FE3E1F206B835932680A29839A8C0CA1 +109: 7511136A11814EA62D34BC60C119C13C9F952000ADC73BB2C0DF484171C1B8DA +110: 82968F6ED342405A424E95338B42D75736169D0737E722A397B88C9088F26196 +111: 929D898E7EBC383A76C99D71A8CBE0B9EEA1BA842C839F059B3BBFB546D21A8C +112: C6E48E8370297FA5ACD015454C973848C7D1C57361FBD23C1990E08AD854FCA6 +113: 4DE021575121FDFBDD72241DD0EC1B3EE72DF1FE9DD7497F51A44C28787C108A +114: 481F10C0D9E41BCA9DA7CB98550C918798637CA85858EC328575015A666B964E +115: F8491F80B45D5529483195747349FEEE8C23F086B992C5D1726EFD6CAFFE8E68 +116: 92DBC43CD451DF7D4987595EEE2C10DDE6AC57DE8BC57FAD59CAE524A0C6450A +117: 89B648A7810B99C4553A999B5880B54392891BCCE5777E25C1AAD657AEA428DE +118: F4A16B6F37C441D07311E3BE6D2710874FF53FEA8CBD92FA063F2B7100B74F2D +119: 4AC2F930640D17BA5DD0DE3DA4EFA789A204DB62BE347D2EBB05A48A31F550DB +120: DA0ED911B0E81612A5A05C86223CAED16A6D796F3CA05B5FB596F74EED05D72C +121: 79A224014C1DB67B4F15003E919C23810E1F7514AF3CDC64FD33EA016F48F292 +122: 63929B3330CA34680DA780122E38A0DDF9B3319CBD08CC3373329553A7BB570C +123: 0A8F6476A9FD5B192CE4788AC43A5C6EDA9FDC3C1886B15940A01EB47BC1CE3E +124: 009789114ABAFC90186BE578059B49215F3C2D2D65A9EEE7043DB9B50FDB385B +125: B7D065FFAED0629A422D9B14536F0557C960F96D4A4375FC5D9C1291C5D57696 +126: 5E0A982B1F30DF37BEFEF2ED9A726CC5433F5F8D63E80B958645C06FF5BB8E77 +127: E3642238844C5F312993B0AD11C7E2FA656F07C4F46EFC00D958CF64441D177C +128: 4616E411E374199144C6A5E212E55DA87673D4748A145B344FAF55440CCE7313 +129: 0638AA80FC93FC0000171B6DEDEEB9E4932D47E512F20E99A0B351E43769ACCB +130: 7D4749A41998911CDC3A18E315A62233F7BC1D0D84BE484E91558F7266C8FCBD +131: 1291DEBA3DB61100DAD46BEC0CB8D6C430C3CEFA29C36BDDDA3B2E861C6D974A +132: B096A7C232B0CA5C02A5F2836B394E1A7DE64A39C1801CB6C54ECEBC84BF4553 +133: 2F8CB40D337586D6CDEB7579F33A041116B44FDA39490E00FAFF5544222DB638 +134: F547C48497B8717FFD076DFCBF8700F089B3BB9D7F916E44A829F1CA038FB72A +135: 1A5BE1C9D2DD27442DCA302250123F1BB249CB4E1CAB9D0BFCE54180063BF3F3 +136: 154C3B3963ABF5C795BE987BF3148343C9EFF04070232DAD2BD1C1BA7BB9CD66 +137: D64A1692B27D9A71E0C28B181CCC677BCC6811E942DDA83BD7CE30E829644E40 +138: D0ABBF8ACA5A715F8D315F3EFBBD1FD8F809BB751678D4FCC3E4937808D7B5FE +139: 43999B55E2785548CA91F8FBF6AB67705D682B24C8C3FE12D8C69B3A44FAFD8E +140: FC150A1CC9E8F2CA449EAB6E8124FE86B90355E0CAF0242F64AC108405C37408 +141: E587CEAFCFD1C2698A6F00D3C4013D7F65D0CBA483BFC1E26F88421FE04B81BF +142: 194F6DE892D854AD35F7FF14247894102DD3ABF52ADD542C28ADA83CD8DD7708 +143: 5D8D0A180F6EABA30C4F91FB711B6E08A4A42FB8F98335CF250B43FEE766A150 +144: 155C60467E98B4A465EF3400486D94E45B3889965D4987F5406C63E4134E5454 +145: 2C423AE1C4B78F80EE8B7D9A791FFA748BD4B610DFF8303736F5915D8C30C1FC +146: E3C790D4FFC93DB2B726DB7D97A52DF2F7B3860AA9D3BF63C330EF7DF252AEAA +147: 8B055BB720C79F9D52CF3F465B8AAB2AF0D7AAE63EC6F557FDFC36A1380C35C2 +148: 4DE3194B11046A219F51460CE17BB255896468D5F604BF386C3DEB7CA99B4C6F +149: DD77B9F6F835FD676A5F32C8EF417A4773239B9E2DC6F1CB353F7136BEB34068 +150: F6587F32FC8C48E50853E4592A16090FE5E3C90678985DC4CC066C9610BF3FC2 +151: 5FF9C45FE2A45EFE59D58BF6DC3CDDBFC18577705BB3188024ECD15A2CD4E05C +152: 2BB199D0DDE430299EC719909AD4B7ADB15FB56D899C5DB47318263E40686384 +153: B9924E87788FB3A73547B6A1850D2ADB41ED50DB307A406B2B86BFC2E3C94B7A +154: B4CF4AF4F60DF1504AA1DC8062BE0EB0730A1F614919109689C25B594D69D586 +155: 3263ED3B51E75DFF9F1E97168C4FB68A0E4C4FD035A84F2B6D19098F21F5E100 +156: CAD5C8C816E75CF4FEEA342B3DBDC75B3AC5BF64AF7ECF70743D57CEEA57ED17 +157: 5355F06A4609F7998A6D5E2346DB0849AF76B3EF709C9306C4A6039F8F165C65 +158: C6E0E9AD7DB06939397C5B77D32216207467060C1A9C312AFEF6DB3805666E8D +159: F0661828F2728BCF62602F35C34E4D7BAABFFCF8B8FD786EA5B46E9C77D95C0C +160: 131ED3451C5BB9FDFDD965C9668750AAA87E79FB9AC28C48F9E8126AFFEDD670 +161: BCB647981059B6F5049B564D637A5F63F7BF2760EED28CAD82CCB2D79E15F5FE +162: FB44E2138F28AB54C87E9E299A8B1881265E45F85426BCAA231A0823CFA3DBA1 +163: 207CD7F532C9D9F3B3BDE27025379EDBE3BB46FEDB8FF932077E03BDE4CE5380 +164: 834FD865CBD34798FD097AF769910902CEDC471C7877DBA6F185781168021C3C +165: D7546FDABB0B648A70F7F1B995BA623A7E5B016CE194B4A1B7EAFE691D609822 +166: 6B045096CBD1A2663A7FC06366FE4CE9D450830BD6C880D680DF0D66703F1707 +167: D1288A020CA678BA446875F998B267C25511460CC7E2CA95D7EBC97B6CF102E5 +168: 8DFCD489AB07C38C43C920ADA2B159E62CED79458AF7FED8C97B76234AAEA9C1 +169: 2D9BBEEDD0281D600D03B3E4DB0997BAA19113250D6D3FD40F7AA9E05228FEB6 +170: AAC7EBB2591423065B07025477B9997594246FB08B3405AED0CCE412C6AC9214 +171: BCD043C1C209FCB07353DEC35BB8BA3116F700BEAFFBBFF30745195D48B2AA82 +172: 201038851336CF24108710EC1F4696E1875867BAF477F41460D03D7F9E1339F4 +173: FEED0FD1121A237AB3058F12FD5B4F08FB4D362F4FC28B97494B944D31E0FED2 +174: D1C577A98C501DEBA803ABDC64FB49B02D76AB81C76D8C12BFBC0A43D6A8E3DA +175: CEE52C1FF9AF5439273F810E4CB7366564E56CF00B3B58F8CBED0EB31F32BD68 +176: BA8B608E728B8A71A6E904FBD54C3B8F0435681F6B1EE6BB4AB2F40D4CFB92F9 +177: 56E4A1B1D1AF0FEDD2C77B59E4528DCE5CB77928AEA53090976FD25A59850F6B +178: F7A235AC72B413BEC3135C0BFB6C075269F412B09A9D0EF6B311EDCB5C6303C2 +179: DCABE91DDBCA147F518024B3AE6C17EEF9F3C89C292816EBD375E5D53BD037BD +180: EDC25CCD2A4ADF09CE245C9A3496C5DA5D582623BEA5A351367D4F351BDD70DB +181: 62AE87092E7410789C08B7AB77AC95619A7ABE3824E3241B46D36B12E2799354 +182: 3C3FE897D722DB898F61C4FC2EDF5D045637D339BCB49B773B47B0476B6A4005 +183: 14FDC1D4A665372410A8BBD7E7E24AE0F61DE6E450CA321B77500C333C72267D +184: 818363F15386FB271B3CD04D226BFCA10066405F88200E20E69CA7D642A7D7D7 +185: FE6D705EA3A305667E63582B6E82F0BDAA73C9B7248D6153830A6D5CB62D3A9A +186: 4CB2006E9DBF1D9DC225DB8A576965AE504A044FDB4D4189023BDB13EADBABCB +187: 9BE3982CDD8431207AB11D90F49A9ABDEC135D55F178C26759568996BDCBE1F9 +188: 5E0FDE59447E35222963773EE6F43F1EFBBBCB55D5813DEE08154B3AC7FAE13A +189: 7AA8D0CF3978AC1456ED9C731A3B398CC7A47E1538D67D26410EDC783712970F +190: A81DD2744CC55FBD9898F1F81B43C081DA00C30A7015A81C806237B0FDA0D8FB +191: 4F9C7892E55E9A182223CBC0084D2659A19035B5E9A11C88D5292C1A90ADEA24 +192: 41AD8BEA1C0501C09BAD8BD6F4FC48D8298376DB1D18204405422B6563D25F7F +193: 11C114E08DE9B976DB94E1F48AE644E9AB6C5908136DD5ED478C2DA145D6C3B3 +194: 6B170BC4DDCDAD16E1C082AB4AB9307243060F848005EE32D648013BE5C3AE5D +195: 1EDEEE0C7C6BE71524866D685E7528EE3E77D258B5E53BF7C45C52B49485B7CC +196: 14105DD844929D0755373BE69E4B5B2B5978B7B7FABF5B8F80ED5EDC7F8C44F5 +197: 0DDF11C61F66D5A21331A95A372A00058B558BD59A6E22FEDF80C2F198EE2118 +198: 294DDF8C45DB1AFAB44D0E594E4C4605351EDB6080F1BBF5239CE896BC95408A +199: C764C96E67DEF32EB9AB277E73B112CC9C22D58CA3CF984C7569EC6F92E57582 +200: 0469C328DE820AE8BF706C7AFCBB9C819C642114F9FD0508F4C0CCC0ED6ED58A +201: B419C0F9EC9D932B4EB742521AC4B6A2DB6E7ED5A17CA90B3D838D65A3F1CBE4 +202: 2DBFE05D2B7D724A0132443F98349BE229E98505053E8FF9EB542EAFE5E8E3FE +203: 3CDF69FDD73DC6E657390BCCFFC0FB8016DB55F56C6BDC55FA24072E56939357 +204: DC9413CBC6556AF8BC2B57F60C941A904B4EC21A81D5696D137E43D7D6BDD287 +205: D26E6BD472C3567D8A6AF283FFFBF04B7B8396A491E9CE72C1B316C8D228F658 +206: 86D31A992AD26F07492712A572964135DE89C159FD0057A08469F6A5E4F4D1D3 +207: 451702955D2E10C22F3630936833AB20F16CD709F0401EAB08C022B9D2603420 +208: BC7D39CBFE1F95A7D4D0BDF1BF2E8C8556496DF1E2E4D3807222428A976922E8 +209: EF070C91E16390A0F234311F183ADDBBD2D75E80128E77B18A4ABE54A83BBD65 +210: E1B93DAB79FFCA076F06072ED14E219E97629EFCC81522BECBB3898B91ECAB44 +211: 5C0E15B358BB37E7DFD269A3B57B355C47B9BF184C469BF390656D4408B53BD1 +212: 5EA5B542231D106D27590E71B3199051D3CFBC04D772AE5351CA7A401C5A6E83 +213: 983BADCEE389753C926A8C5094F53F03144324DEF006E274E4F575C4C8F921A8 +214: 8C651BA22784F5B9F115214193ACCF44705B6045CE4C2829A50CC458D190E778 +215: 77F438DFB5DB8825FEFBA65EDB3AD4004B9D7A2348F2CEBF01E68830ABAF5C3A +216: 4204022F27F8B948E03637A6A9BBA474146230F96BAA1AA30BFF62A020B65496 +217: 05FD4D7B3E3B7947659055A6F12CE8576D34D3E6874B240C5932B566D63CE658 +218: C576E1DB815DBCA4CDE0C0C13A6285BBD036470F9B65EB5FF9BBA84D564A8CEF +219: 5D2ED497CF194DF14A768DC65B5227C1996F72A754841BB54E33737786CDE651 +220: 18ACCDD6A0D6C81440B516B65BC77896C85A5507FC5AA557DD8C56857BA00976 +221: E6DCF4BF4488352C025FB380686E4FC6162454E7804AB1D4705A56BEA2CA27D2 +222: 8241E1CBCCCA065B20709FA7A05A6C4F4BB8260947249700CD0B0817C6C789C9 +223: BE7C2D246C1A7EF7EF04F3DF64CBFD0117562134A598C63A88BDE724ADA909D8 +224: 66B0E970A22B2B459CFD724CC58060B97FE63CD8B0F482CEC971AEE9340D5926 +225: 1EB3747B67585BE0FD77CBE9F42CCF11C233F3DE1C3EB523333A43E2459A2EF6 +226: AFDE639376FAE910705C301104EBA4B95625DE4CA6BFFBE14E2CC1B1FF65185E +227: 7DA74AB6AA9F3ED93646FD0FF9A501D80FFAEFF48EE9D40FE24A2B1DEB207924 +228: 0A159A159E7D1D2B7CAA1689396D5E9701A3E43D4BB4837868910BD7E365CC26 +229: 0577C427ED0A21DAB68A3C604DC25262F76B2525CD883DB9C1A6AF91A329619F +230: D616AF2E38CBEB8DC1B61D39E38C017C710352CA99812B0B05D4962A96FBBD5C +231: AC6414BF8C1D3A38154A5483E53AE940DE6DA655144CF41C4CEBA0F1A3A04799 +232: 2773E852E02DF80FB70F25F4184D575D3044CFB0EDE9305C61746416F7DA4854 +233: D31D4D9A97A5B7D87CC779FE7716D2D2B92616BC1D8A78F94D8F2CA22BC37361 +234: 1068604B565F6FFCE3B4A4CE88D4FA924C7DD0F7ADBD5EA13F7D8FE57C135BAE +235: 1D194CF7FE7531BEE69AB6DDE69DB3B81337BE92B12C7CC6CC20383F1DD314D5 +236: DC7D8DD7FAE3C90CC347ACEAD769D5ABCC9448D263567BFE7024513E79F8E1EB +237: 2B13526EF533F8E0CDD0BA72307748010C3C22E49A4E6E22679DD3EFBDAEBCF1 +238: 669504BC76757D7E402FE491A432B04EEB6C86463A6885B7F76EE5F0576F11E0 +239: 0DF50EB91091AAE7500AFAF85A85EF8D4B795D6F8E209D4F06392DA54C273491 +240: 3B8A44E86EE392B4EAE4168C4ED8E0F762955EB78C4A917D00597953919986D1 +241: FA3B14933E2EEB8AD655CD0AB86BA43CDDFD4612A18CD9F243139804D2A2EF6C +242: 5479CC3E249AF0A6CFF058B45970D40E4522E4C5C0B9873BCA4464D27971C2E8 +243: 382EC35568E54E3EE0855E6D9DC75B371DA53414A08FA396EB4EEA4E3FABBF84 +244: 043DFB7662DA21D68AAD8CF18988F63E91D3C9607D7B7383E3984871A484982B +245: EFDD12A8060E769459FBA945E5E5AD0564355E17A733A06BE5BFCE80E37DA29F +246: 5DC62B7EA527CD548D1CAC9890DA574A27B6FF708AD5D1B4DA7EA6871DE809AA +247: CFC272F06683CF8696B6E9EA69D9BE999E8048882957B489DD4ABC0BCD1940AA +248: B11C09B9B80CEB3122F9309AF65805C44472FBF504686C7982261F9118230F88 +249: 0C7F68B52135C3A70F8EBC38CF15208F16C4147E600AA15A75A45803E0AB1006 +250: 7A306A30738756627F84F50B0200B0583733E92322D6EAF7AB2F2B055963BBC5 +251: 77C0456B04A997ED2B0ABE8EA752091AF81E7513428979610113538D38E23993 +252: DD86B19BA096F08826CCC79CE03A9FCD3B3CAB5EDFE11387B25023EF9E1B27BF +253: EAF1EC1D98CC33BB7754C132CB9D6B597C5A376F7CB0F18A8E5F069DF25BD17B +254: A7910F4E8FC978BEF4E1D494EA44A3328367D2E8AB9FF7C4093D014223005E74 +255: 23F29724A5E3DF649EFA1E76E1F7315E4F1AB2B9F6DE9992A7DB3FAB62D19F10 +256: 6BB2FF61EF113873D4CF3B131853F2469353A2B1D47FE80DE2FAF576C455212B + +HMAC-sha3_384 + 0: 676CD697B065FAAD4707FBB834A0FDA2D40625AE7ECA830E8EC4F37A200DAA5679825BDFF7AFE8FA1F31541D3E6751CF + 1: D612288B7131DD6CD179E30BB8E7D22C90C60A9AB3D3DF0D36CA134C724D73755B45C432AE3CAD077368771F7442391D + 2: 458CD8A7953C21794EF452522ACB3506F6276D453D2F73F39B26F531327D00E6A0ACD6FECE7275CF86DD9AC30E56BA2A + 3: D048848AE891C3641E1BB83A414CF07610D30C225198CB233B397C74CBE3263855B04A551DE7803915324323AC5BA815 + 4: A752C9AC1AC2235F254CBDD500B739AD323011FB66D359F197D8D4FE5EC9550A98689B5B5482CDD0B10CE437C5715C6E + 5: 8C91AD7BCF1BEA877905D780ADFB85DF84C59B392D609AF19F997ABB8660D1E156645253B3112C2DC54607F4FFC89D8D + 6: 6311529E3CABB018EEB7E844E7385386EBA249FEE8C4533542B1DBFE079487FFBECC7C6753090D05E51D2C7CF6381AC2 + 7: B6F62F15EFB241C87B9A06A95F349AE3E7B98076DA1B73F43D59BF08B2F74DEC039928CDCF80219E90D621C72B940971 + 8: BF354D5894D07940EB57072273E984EA160B158A2E632131B740D9BDFDE751E4DBA54E4E457DB7DBA303799D2A42DA94 + 9: 9BE89843A07FB99CC902AC0A2EED14A2268DB12D5DC41B06CBFC30CA0ADF25989C3997DB0868EDCD48B2A3E9CA938AC8 + 10: 13F894829DB5417C60609004C5FCBBC5B971495657AA4DB68FF0B4DB379B3073D44EDB40A7A0E03137708D0E412FBA98 + 11: 50C4153319C0483EF30289BB5CF6EE6BC4596BB9994143C435A6761EC0E0B65F013930A7A14251571422DEC5F40B455A + 12: 981D055278DD37941D6F998048B266E635ABA03A343BE549203D7373369FEAD0DCED7865F768F08009B3955577DD2727 + 13: B0762DF5457F16ED558599071C5F068BFA855240D60CADCD8FD8A4F8233073D470B0A849CE79E601161A4CC6FDB4F009 + 14: EF85C3FF3F38473E1666319F5431FDF010A5F59D8D02700DD72FFA92A8456FF7A6DD83EDC58FA0D98AA5111B809461CE + 15: 0A3C2A305D66F94F3FE534C849B971828FC3C94A8F91964175E4201801878369FA14687B63279B2327B9099D6D3A4E4B + 16: 57E0AF3C6DC5498159DEB0BBE28440362B49D89B7BDB77298B75FEEBFDAC79087C3762364EB370E505205FD02838F415 + 17: C40EA31DB67CFB64597B6AAD9A6A81F3513892A3367B198D989A007F00B48AC32D3CBC9DCFC45B028FB17DD7E69AD00C + 18: C0E8270E7A790F53B010CF5F0F2CE09597734FCE5503B10A4A82D69A6A96039F1763A261C39E7A43448098D6E4526912 + 19: 9C48CFD72A61057AD372FA6827E4A8B0E87D22DD4BEB958681F13D4ECB4131FC30CF8921A3493EB80AF12ED622166CC5 + 20: 04475B7DBF650CC1156C7E222813EC6D143B2208D780F29D4E8704C062B06D70C38DF21A91B044CF26BDE9558A23A5F8 + 21: 01451A46E5F558123110C85517933731E64FFDB121ECE4944AE6F18736023D2EE0F9233503D3AC00D97AF041552D94E4 + 22: B63C69818DEDE1005EE91099E85FA2DD112091344DF2244F0AB61B061860323C3F1D8FAD62A5E3058F8C2ADECAE1F4B4 + 23: D04BED25F1CF1FEF0E3F861EA8DF01B7DB71F2405F099969584C911E8BFB839F0D53C3EEC2E6BEE5691CDDB486F03D75 + 24: 507164DFA88343A513E713F1A545D90F2644C5D525584E6354352D9AB98184235BFD46457338E498B7F0794AF66BC5F1 + 25: EBE69134B2C52A101A6F3689CBBCB029D103C2C0588AF5E4120723C9EC6D94AFAFF8AAC1E5F194C5EF709FBA273E9A58 + 26: 97CA8CBE22D225E2598D4ECA459646452BF205D6EFD78C521402D5BBDE3D51D763D59300101E1508E3BD92CB57DB2C59 + 27: F607A838D61A111FBB2D3BDF86B80DB8DF0DBFC4C2216ACB921502E0E0EF735B02362497ACE0BDC725EC416B84FB2850 + 28: 195C85A7358EF01446671D9D7A8CE4FF81730B1E4BFDC22E2E99245386C04162138F39274636363B119CA20152D13C9D + 29: 4C1AAF76C7FCBB7A2CCC6C63D0904426516F9E910B4E3BC3AE2BEF186454E0B2F0E10D6F2D7BF9F75F8DA868319347A1 + 30: 73FD9DEF5633D37BD6FC2BE3E0F15E8D161643B8CDC16EAC8ED24E27FF2FC039892B77208D8026FE7B00C23A7A1519C2 + 31: 2FB92F71FA3E2C33F10333B4ED9C2805B2A15BBD95DDAFA82D78D0E1AC3DF64C935839025887256C12792EBF0A2964D3 + 32: 4B45F3080B771020D6112846F6D55D0C8D7DACF08B54E6D57AAA27353C2CC468DB0C537EEB76B083461E46DF92D49327 + 33: 0469E7436113735D5E8107BCB686AA3031FCD7F3BCFACC4320BB52772FBE7BD9CF71F9103E9CDEC972E0297AAB0A9CAF + 34: B17F9A1707CA505679C2D29AD022AE26F1EC787DB7CB7DA69A0B116CAB15B20E7B69058C57BBED4D07FA263C30AD2AF1 + 35: 5DE4AE5BC0E690F537D48968C1DBAC744B0EC5E7032B60A3DF01AB545E263E2E0DAA5CDBBFEB5BC1C115CE73260CDFD8 + 36: D5CE152D44E35194F81C9DF9AA760C354FA085623CD378968D1423DEE0FBA7E05391D3A163A0F07EA7347CD2899C345B + 37: 356F77E4929EB101A61B1347C6B5ABD3EBF7F286758562C86B61CEFAA6E2A54687372917EDCA9222A1A3ABAB88EAF71A + 38: 1708058C56869884FAC9BAD9C0DACF213ADB35CFEDFB904AB4EDDABFD905F30B382D4D7DEDC89D46E3677E7965A3FA3C + 39: 254C4F10DC039EE5FEB12BC48FBAB8F9713E0711D2FDBBC1633604962026E79A3D675C5A8212BA7CFCE71B90C8E3818C + 40: C2F517DF7D51DCE2823B9A7EF8961127B8D6919FF026CEA944C289B988BDBBDFFA26D533DAC00F920439A10CD17A97FA + 41: 55428EF177BC64945B2969D20D1126BE994F8CE7A0194C79B1C80BCFA2DE86848805697B6B84D2C0F6AC54706431A601 + 42: A850ABD4FBFE4D64C38C0CC8427D189C2A13F49FBEAC2C2F1A4AA53EC81F5B6D0E0877F89DEECFA8DD785F1F25164D50 + 43: 6095A9C01D290E6FA9C48E699DCBFF94E2E83F27E8FE82822851AA5789CEA8DF57811329CF5937FEC7D38BE403AECC12 + 44: AE6C8A4F581C6E7A3F103A713E9959ACDBD6CE568781B2AD5C21ACBF473C4D710BBE6A30C7834DB87DD2B0C32E1EB52C + 45: 6A2F870E356E009E73E9A0532D709432B52DA51F39C78E706AE313422C39884753778A9EC73B1E5378B5D3A9F75AA688 + 46: 96BA7FE8A2CC456864F00F8E544C570D671DAF8EDF8A0E3F203F4656084650C2708B5A11059D41C04531A8CD809D7424 + 47: 405234D0F995CF2029286F9DE888F7302D802861CEE709C55577677AE3F72DA24DB4EC8E93DA88E6C04BAB2752C12063 + 48: 4C3F2731AFB4C233DC80B30B2959F3CCA8841D4C15849125534AF85F8482CC1B272F6BC3D96C5E7002E24D2A5B505F98 + 49: 8BE65BE982A9CE1FBF510D94BDD8958BF67DCF05C62A48AA37637E97CCE774968681AC4C3A342457F13EFD8C2BC5123D + 50: E6766B3A2F7E6F16695DF27A00C2E483575F0D6CAEBCE87F22AE97430C23A9EB01763FD86E1AE9887F0BF2DF72C31892 + 51: 093EB9AA3160B0EDD5F6FFDB92C73C06582EFCCC109899E41A254254906170CC009DA3A34C29FEC9E0E29FCEE55B8E7A + 52: 94E471D490C96FF4377D0E13D2057810EC7E1871D6E61C6905C863B3EC18A2A4A91ED5465B165341C901971DBF95F23E + 53: E631591D10DF6ED15188D97C79A9BC43973B482D02C687743837A2AF7D040E915663242AF05D1B8B946724A1E37280D7 + 54: E9B750F8E9E0D9FDC0263DF6AE6BBE4D7BA8C797F2E52F9137271BCF866BD59C985DAC8F13BCD7514069E13109A369BD + 55: 2D2A882A4C911B1FEAA5EC35A94D843DAC9B23F4F62B007D0C2262E522BD9F461D42214EC0C2FB2A18E03C4A4A1D8C73 + 56: FD979C4052DD58C9CEB26C96739AF13D72E1F98CDE677451FEE596A45A6983F92CC9702A16B31CFFEB6C7F252DE86CE7 + 57: AAC98F574214FB8B2A76E2FEAB3BB7CDEFFC2181CCEC9AAFC71E3291B394A3DEC46C48581DD1C5B9F5A4D891F148F62D + 58: EDE626CD64E58BD68D5DAA52B068BB46F2D6F98BDD9DEDAA4BC696359F8C744B8EBCE02E3A45C4DDE23B747F572F7836 + 59: 6FF50446F6BBB670C064EFBAF424CBD0ABB95D3EF868250F25A971C83C09C8ABA65552287676C248B4E1F18E77E2279C + 60: 07BDDE896993E9E44EFE0BF6DA30673BADED9DCE91F5BD3F042133734B7063CE33E99F65957B09346DF8B7DA6580C623 + 61: C72E892CD7331AE5A439B7D1133E8B812A1456AAAEBA273DF0B7F34A205E80AD83AE76A19DA148C89B0D56A5867579DF + 62: 1B9EEC8A5CE1D846C083793A111B4EBD52A61C669B01DCB84E2A7E1DD09F03A3CE20D0AB4704E8FA8D1624779204993E + 63: 02044A9AB98F46DAED71CF3DEB627199DF2E71142FF7B3815996AA96528733739BE918D2FD9361A18F85C2AC98AF1FBF + 64: C94B164FA56260CD4DC82A6E39785F588DE82CA9B63C491A6298D6E5DE49AC64BD98AF60A9A8567962BF1CFC3F73626F + 65: F496E22814E6D63F654DE0D6292621FAB80AE759C1BC10CB6777DCF5CF3FA7EC6CBE07E6131C62371CE8EA34401BE862 + 66: F2DE8C3B4CDF43DC483BEF5748BD7635C161C9A0CDD0F0378D110F5E9F5EC1AD7337018AFAFFFE207F8CB7FCB9654C00 + 67: F247C083B68F167084B03F0823717C0FB9B5E16AAC1EFEE4CB569996BC5A02AD7E8EE4A25609E857FD6DED84C3A9C68A + 68: D9E890CD62B84E3A9F68EC8ED7DEE79DDB9D382F36F688EC1EE5E66D5908C263F0A5AC4CD77FA11F3E2630676B17D3EC + 69: C5E1A5984A8D0177E2C85E1DBA1906F598B96CA5B4F700614F804A257CE9171FC83EEC2EC3E083489F34FF5ADDECDDD1 + 70: 56453D03702D8D0423B66B275BDDFFBE7CF1763C7DC6B0406AA499250034F5CE749551B7E51330A3B1B6757250A53973 + 71: BD8107AFD3CAAA57ADCD1FEDD4B12FBB613645FAA065FB39BBDC35CE12812D727D4653E1E720ECC9D50E754D94D84171 + 72: D54626574F35731D355CC7AEBC4114BD258F7B8FB2FADD46166E97629E2F20E769078FA34A5851D74B1F261F49CF8C8B + 73: 01C57CF7E1B3D7E172563ED002AE30DD1CB0D837207843EFD122F9015EB878AB5BC39342D5F615912CF03F2334549E7F + 74: 2313FA34D757E0B429A5C36507CCD070079EEF6251874FD19E0E49BAB4A2790AE68F9A1E19DA5EF9C08BAB491470B038 + 75: 6A5AFEF49CF6C92669F90C201660E96855425F8F6FE310C5B9FF48C6C86D95EA247D387991A853113EDA94CC5DFA5F37 + 76: A0FEE9D28C63203809C042F421B3F8255F4E885D557DE02F817D7CD26208F168FAF1D0F878BD20D30B30A6EF5F60A0C2 + 77: 0446D3F0CE2A01ADDE37F35DEC1733A14C99AB77716155D136F18FD5E028A57D0D46CECED557BAA5976795379B832567 + 78: 213C083AE411F292FBCCB54C696D48395FA645B5EB76B917B28A7B11C023958F172ED7DBB77079E1296B03D28F746D90 + 79: 6D8AA84402374D749244DDE2A9774B913B6CE7AABFC5F434F91AAB1D1D64D130E33B642CF8FC905D965435482DEFB00F + 80: 0D2EA41D81D6D82B760A6FE6CD8F46C94890F4C49F8ADC8D508F6F1E2063AD451F0043DA4EE9CCA0BDE77912DF04E061 + 81: 1D97E5C3F219BE8591286AEADE807BD6B1ABC0975B72549F7E51D9673D463E3561C735A6B163141259E232AD47AB0068 + 82: 22FC98F40B39D17EE73E6971D32FDC2657FD9C25F8E3BE0F4369B9AB3CBC2FE6F2E0C7B3113697FD9D95575B239F1A06 + 83: 809ACF2AB6D1BDF4FD0BA9CE0A25594E52D5BBC1A7707CFE844A7D5419B320A427E5A8B24A2F622D770EC65E6D72CE51 + 84: 3794DBB6BEB8049775DCE7593F9D2FC740E1767A80930CF044B6D16B52FD961FC906C65E0C7B76F2F5E9C3EA1F60AC62 + 85: 45563B39E6766CF81D63DE9814D752E1AEE00C16BF8A4F68717F40EFB27287A8ACB35386F96C96E8897A9EC77C0BDEED + 86: F77FCEA0AEDC53211667C98E378CB045B68D547DFE4C3677C57FCE77C39F43CA4D3B24E92E1F560E00BE4B7FCA02E3B8 + 87: E490836AEA47D58256762E74FCB7A9A315E5D0401ABC40B7A5804CC1C82F668DA73389C26B18DABF27A5833B3BFF6821 + 88: FE7B9C4262F61E7A16E21C3EEADA40EED5044D6810D886111562B2C74DDFD05C4E093DA0D73DA979C2799ECB6B86D092 + 89: CBBB64359508C7492929535EB969E3ADF0E7C10485897D5B9357BC8E913FFEAB2D9AE1B40C079BA2B3A8E31DAD8965BE + 90: 1E0B855AFCE15786C7402EF66640752870F56B38C447862CE61192BC52AF30E21D5797D1385545759074A698CEBE5350 + 91: 028CFCAF262E04219B823590AA188FC26B23074D57C8468560CE44FF83331F0BEAD7515BD688B454B21C77951E1FEDCE + 92: 0A6DC2EC9749FFA13BEB98E8B278315389D93918006D5047288CB882E386B59C48E37C506645166EB1C7D2A4E71744AC + 93: A847272AADC310B08D64AEF55461D3C8A80D897D49885816746509EC49AA893DB5B023F1E9B7DEA324050E65D1590BC8 + 94: 01E23AB34C9EABC12BF57930F12A1E9F636B148ACD6AB390FE8F4BF2759C8FDFE4A4D4BFF079081C4B0DBEFD7DFCDDCA + 95: 986D9BED2D75F8760F40CAE67623E3D1B76C53E017FFAB8755DF90B8B84B3AEB52C2F8D1C82360FF52996A0F790E4F7F + 96: 2B8F6F8180BF43BF8D03F5F28DA76400BBB864D3BB21496C3ECD9238B4AEFD25A717E34E1E9F90B3CB3610928CDBFA09 + 97: 8961A846FAA8C8D1774ACA5BD577CBABF1DB616619C3870EF7856CEF4180251BE663CC15F563EF07277A99A858AC5C53 + 98: E8B2E9E721A0F5301C606699FC7F18B1370419961CF03D9F10ED3E300ABF1DE0DB73421814BDD0EFA0A02B0532BD13FB + 99: 7E720225338C5D4A5DCB1247494DA78D066FCB9AD0EEFA423FCB8B2F96D795326DAEAAD72147F9FF3FC0CEFFE37888DB +100: 4C9456905A9BFE0378F89C14115F08D82313CAB442D5DBD3658CFB369F9ECBF6741352CFE2BF5216B635DB97922E4950 +101: A9FD160F2B449CD876B034384A24F168E8847AD3C56F4CEABD87130A6428BB2CD762C3A0EFCE0E01ABFDF059986FA05C +102: 1C5C85399ABDA5CA6FD827E8129FD0C2F5B61952B346716CA7F0DA2BED7ED11DFB4BF904B818D2DBBEB6C3857F142245 +103: 2D54FB5C4E3A943BE8321C9B334964747513A11A72DAA7F50A5BADAD4C188E8561C8414DAE2C35F5460360C0E6A41325 +104: ED61AB840B22221C1E8D6D282F4E31B51A7982BFD46DDBE505310C793610AA816B1792F6B90B91301DD9CBD7E2C51393 +105: AB1A17D3763EE6771F92E3E13CAF0744161D6FBD2DA94B01741D5F062FC92B0B4C527DB962B8FD2B2434502457128C5C +106: 975845FF6B4DDADC94608402E2C684C4A385C0DC3A725B4A6F6CEF28BCDE3CEC6C374F1B772180B5B321FC3717E4E818 +107: E8B8FD05D670F8ACDBFEC30DDF90A427D95D110B38FD96A3ACC0835A2BC2AC951AC6FEEEB6CAC26020868C84EBC290A4 +108: E9BF7610862D73EA489279F142988C4DEEF8A5D1314F882EA47FC96C3782A6D4E5E1807FF6EF187A61EECE6BB656196E +109: 5A290D3EF90FEBD90F4C0E576B3EB2151B29B400172851A38AF9C585823A343C7A4679836D9720186400CDAEF0D351FF +110: 0D439BEC8BBCA82DC2E81E8878D30AB2F3DA2B2D061C90946EF6709DD822FB96F3EC86C0B8B686AA1CED98CD38A0EB87 +111: B54AE1BCFF7C7B44FECC1A83E06D81EDD3AC236BA4E9830DD7021843C9193237282CAD236B150254916590BBB3E8117C +112: DB6B0397E42D95C2BB6B42FBD67DDB41E1DDFB2EBF48F79F876B8FB4BC249F1162E8DCF587A28114F0715A5A072422F6 +113: 5045D78AAF857299163362891E59012497013C07A820DDF9206A1AEA262370B7669FCA9F0351F6E768C702372BA8DF25 +114: 7A1BED21EDE4249978D99BA93730A82D0C6D1ABF6E82B8A97AFC6B79C83F1815686E52C212A725ABEA48D4870A6F2FAE +115: C1C12B4E3E6F7EC621F1CC802B4BDDF20A3CFD2EBAF642ED0DE01A084E20CD9A97C646A41DF3FD1E3168080C82D43E36 +116: 3264814B387DE6FE158446728A16C2007A7B2348226F2C6663C153326D822CFD49EEC0494590E8BC67FCBD75945C7953 +117: 78054152D38A9336B7F0C3E2A66365BF66EEC645213D3DA65A55B41C17166EAFB8DCD23453050E3E3CF3299B09AA8B79 +118: 38B2AEBA6EAB4DD835A02D90F4EB73DF015E1C566B9656BC783FD342025BCA2F89279CDCB5BA601B3DBFF4EB38051A97 +119: 9BB0BC35B44D89C398E629059047CC010DD637B4B4D8A9007278127EAF9C2D355551C4E5FE46E13C5B8F07A20A8E9147 +120: 53E9F86423A738CDA840ED6936D1D05ACFE89CB817760A90CB79FEAE9BABCBBAC097A157EBA8072CF92EECA523E2F7CC +121: 49D598EBD819DEB45D217F1C7722732A30D7D69A8C6B721A8FAFBC328D368E30AA9A1D73808B117B035A3E3E742E6249 +122: CE4E93E5C3DD46AB786B76ABED65C28B53EC7F477124FD2A560C2BC81D4CE0629601DC0CD8595307080CF840DDB01F76 +123: 3D5E54EE4892FAD756271D6DF0F190717E0256608ECE591C4369162BEBE19058DEB588B6BBCBEBAA2F5C89429D855966 +124: 9758EFE7EB10E073164333F3C7A98142498CCA8CD1138E5E46D555B1F4C0A2CEF3ADE60D6F9FB302B24CD9A5F5EB5248 +125: 0EA4BA2E6B956C9C180BE8E7A2A8F28C72D90927F936714518A51286E68963129DE6F1907B21AA4307CD0A51F940A645 +126: D37DAB858A1276BA1AF4ECFC3CFC68FC6E3B0C600F0EED2CF61A8729582D7D78A177B4507B3B08F3C8CDBAEEE3168B72 +127: D475F17493633F39CA0C20022179608F555907802F2A098DA9D37E4A9CDDE143258FA42CF21A6005591B7E247F1549F3 +128: CC1FE2F893B8C7E79ACC7485A2893552AB708AFD763304B0D0CB0D68FB468821EA0BD41180233728B6BC957BE36F95ED +129: B2A468B8A5D619FC19E1D87D54A23DE374A6E4F90E7018B5C4ADC1ADA769206D4C853F5021112C15F2C49CB877EAAADB +130: ACCAC149F57E4285070273E76C098765ADE86B7EA3EEEE290A60B0E621E60F6BA675B4701F982750F85DED0EB72323BF +131: BECC9B67EC89BD582A38AB61D4CB5200919EEC0019B3DBA4C78C0436F84C56716406F1AC4EE53543F6D342ADD6A1F6B2 +132: 85F336C640A2CD9A38C454F31F4547F43F3243B2D75B36239E2A7831EC3A6E9824CAC07849CE2228BAFB87FF1DFA30DB +133: BF7201D3F25D4F3CF069D136D2EACE2CE6688809C98702607353553813A6BE23271FF1100116B6D9EADA27387F512D63 +134: C2E97D6CCE89DC35D94907957EF3D3D77FB9E3238663FC7FE44D193DA3940CA64262EA6FF812804A9954EEDE045AAF33 +135: D3AE4D151071D88784F6D4415BF2C92912E19721028295C655A1E49C84E328C85EF1BA89C94CF3BD0DAF46D52E4EA5E5 +136: 1BD99D5294B393A54025D5B9473E188098A22BB6A2D03CDDF2E41151DDBE0CCE79B7B0DA85CC40583B56128AE5410B42 +137: 39B30AE096C60F39E44AFF316FADF453C12374A47000A943FF30D564DFFBD697BEDCB54B8AB883114BA479AF7B10E918 +138: 6527B916254D43E2A5B54CA6B2BD0A93D91EF910320B1B7FAA4DCAF56D781D1A65344D908444954F327BE1038490197E +139: 3DB4BE56FF596895FD0A2BB7145722CE4047B204E687989787985A89DFCA334DAC117CD39F3AABE28A1C4E6CB2A74597 +140: 6B49E05A792DA5E8BCEA6AB5E013149A1B4BF296A6722AED1A85D1146742B5EA345E56BD9FE851DEECE646E075D24C70 +141: 73AA1E1B0896F5B0796360E228F00F4A9B5D523C7085F616A179B523BD9BEEB392879262AFD9C6C9CDA12C22E6C42551 +142: 580C04BC005AEF998C09C280133E78E0AE688D6236ECF16FD2AE16E86BF1DA4CA08282B7F6F0634F14C1BE460878367F +143: F02AD5DC66823CDC4B9BAEEB093CF2ADEB528C9DD9FEA299600D24E7D4979B1056F849F96BB343BDD19AA7D0E9B6F393 +144: 08F88EFE74D2283347ECFFB2E150EBAC79267398A5AD5B6D6585C22570842533828D27A54F841D2402B8176361AD904C +145: 211EFB8221648E1DB410C8BB9CF24FCEED7209DF784E0DF62051557A57B3EA603AC6D483C74172872C3C73FCB8F308C5 +146: 61AA50E124DBDDAD89A9B9AEFD7D02F7559B1B43C9FD5A6E6B8FC40C608639AB2DB6F5D3DF6718A07F0C7910AC7E6C8F +147: DC41BA755E5AAF770E3B5B7115826D65785A4C490C3D32A3B7434141BC4182D8F9FD3F7C738BC06459C07A8B7C0DDE7D +148: ED3741C566A4116DC8798176390EEB7AEAB015690D8650E93A5694666A0265688C96EF65076CA9F99AAE294FE169B987 +149: 1C89B24924FED42F8B2D3AF503E0D9443F451BB9FEB6509B241BA36FD5DB180C7114453490B7BBD0183F61E711809C8C +150: A0F542AAD295D3D074AA823B90851FD8B9572EAFBC9B9EF097936AF12F9FCEF8DB00AAB8957842CD52DA681837FF66E5 +151: AD3D70108A11010C0F9DF6FED5F9812ECC78339FB50845923418B65E20EA8BD9F11BC4A8082F0740D2BBC068AA8D7940 +152: FD4D8F2189D32AA7F2A9FCCBC0C7F53C8AEA9BFE2AF2E52DBFF7B1854C1B19D01E54B7C1D4C12CBF493AC52841D5A63A +153: 2CFDAC8E186EF001D167E344632998E10FF97A315ECF37ADDE92F5153CA8B95D650298A69101EE96D9DA05B2B5EEE5C5 +154: E4B6572871367D92B3F909DE08991CB8EDBA6706E78F2931238637255F661AA17A81A3313ACF7E14D2B9C7BE973AF430 +155: 28AC347B4B429F0DC015BE88DDCD6190D87053F89AE26308CF28796032D4E8EF6B1F258C741247F36D18138605A6E680 +156: 2E815243B9F6490B69D6E2E2D5D15E7AC59F0F969C1BC7F87E7B617500CDB6FC6D87904C4C2C4719059DAF6F60EC743C +157: FC1DB9E635FDFEFE916E516D49F73344990841AD0A75BCC845DC2B1DDD37FF55EF836A2CB5F96BB798C070CA432628B8 +158: E75B013B15F999E174E7006E05B0F39BE975722816687A48EABDBA09D6DAE4B66FF7826CBF2612F901A560AFB638194E +159: C1170B81C0F5EE8B332107EB2570C71E282515AF3979942A3255D363E812DF31589BBCBD0E5E313845AC6A0B013D38CD +160: 09F1F129FAF4D317982BFB8AEC63300837AC853E169F6118CFC575ED0C019405D231A82E3D8070E236F6E884A5E66546 +161: B98F0FDA9B75EC9012BFB004644B75BEE4F33AB33F2A27824DEF01F61D63DFA52C87E0B4EA2FE188BF144AA3F5EDD00E +162: E29B80EAC61E284B56F7FB1329B29D259078222E45B292DBF50BC3A41972A87A7E123F40842ECC7488645F7A0AD3CAD0 +163: FE36DA859A938D9E69F24C029F726A25177ADBCC1F635F2EB2C0E4F20F3CE40D262E3CE4A9C2A24E49ACF96279440D91 +164: 2837D9EE0AD5F579866796A756F8AF412FD591E058124F355A33ED6B2FFC797BAECFAFF7E9667FC9CE9D80487BF92BB0 +165: BC9F22BD1531931BD838CA1E83787835F561A0E6A09FE5F7CF3EA49D63F972CCCCC19ED5D2086A51CE381C917BA35DB1 +166: 503B2F784CCC09E134806980F0CDE5735E60FDF8C7FB6BF8B709D7F7094AAAFF3265C0632F1DF821E90E5FA742EA1393 +167: 6F88ED128E80A3C50A7FF0410C9310D9BB3A8B5C54B4E43D109AD3237A723885A20B71ECF4C5E0F7C6BC2FE1125776BE +168: 90945255F841B21C2836D293BC26BCF425F059660D92E710FC9571C850BBA7A2305E0023C9E5F2322E0C7F115FA78D9C +169: C66BB05AAC10175B8E5AD2E71E4F8091E3722D6A73513A838BF9D80D35CBE74124C655FC3870EE467FC9F2C219504E49 +170: F9125CEB1977B66CFF55C7A03D07E49FEC44EC9989A19E604063E0B78440FDFDA00528E098023805E322377BC0F83A53 +171: 88601A246CD06AF7C69189BCFA78C39F11416A9288434D420B1347C004614E78C9AD226440B083430FAEA2BC3E66BACA +172: 50A6AE4309F26AD9CB58220960794963E95E7AB9D2022A22D4BA2A8B5B08AD304A76DE3A541DBDA56149963071120EFA +173: CBD8D329CC505A30BD39440FED40038957B9DC0308AA60487C887DC5F5231E0318757FF1B73A75EA645FF961A41212E1 +174: 21D74AEC18687B173413326380E96DB5DECA6D555812DF5E39118E8573D1049C0DDFE1B96BD300B32A2C25DFFB9D5A97 +175: 84910F7495F5A098F0D2983F5406CF4B5595CFD4C8C6604B612A3CD54C4862815D0253D7C209D9F40A769408F078EFE1 +176: C883159FE8F7DCB2482C63F9CD73F249E40594D2B5F785630AD665416CD818A15D4811EF8204B0393C663F3D85279904 +177: A827E11EBA8736928664781DF5BA360D94CCF2C58879E92E745FE2525782E0A80B8C185DDF6E5CE88D2259076FB8C163 +178: E31F47B15117A232BA80B2097C3847E568D7ADC78747D73F7CAA5F1457B2981398A961616A60A0703C5AA9C086C4DE8F +179: 1E16DB38C8DD6045DD554E8EB9065E50934F4CB9630CEDA1210CA497A7FE4DAECBBFA2E7BF33AE9D7CC93160CDDE04B4 +180: 35DB427EA4086FF7D56A41DBB722E5A8427AB86AF73FFBF82D7BBAC9FAFEBC54BE96B70DC7E87EC65A4D2C40492DB461 +181: 99DAA0F34F7274A3E1F3C23AE84A0B7DFCFD5D8B6941F6FA6C09E0FC42343887FAC187A5AE122ACCD65E3CB50901B25C +182: BCF3038739043BB511935A8F4AF62B5BB552CFFB1E8C77B7DD20D97A22673882AF9C040C6EC6B31F82BE590F409C508C +183: 1B524EBBDF23F1A26A9D9B5CEC6F7F49AC96A818D1FDD079F481408909DA097B7733C03D852DE1162303B002A88DCCDD +184: 08188379DBBE205949D45C5CFED1AA17F67C7C4A0D4B5CF1419825DF880E0AC82166654CBD266746A41D0268CC3DB2A9 +185: D8C1C00619F814119B7E0868572913E45EA949DAE21B4FE87F29DEB86D448E20B67913E1220A94DFA830094DC811BB13 +186: 937A14296E71207538AADBDDB855DBD9BADACE52DD74226B4D6E5F62D0F3F812C8DDD6AA0C15904068AD81BEEA7C3E2D +187: 056A1395F6A822EA7BC33BEB947D53FC8B1A1B29E3DD4619A48306066F0C2B1DBA78400280F0A273951417C07B6656BE +188: D95EAE973A9634267AF4E486E0C4B26A76D8274954D2BA8A71553FBDD51FA9ABE95F84D4BD2D206038A6A8F87184C0C3 +189: 3FE8BE6F7F24834891F3E3D2B197773E85079E032005D73F0114EF30D204AC44C372B701BE94DE6D40A87EAF947FAD0D +190: 7CD35344DC640D98458C18888B78BFF9B639763E7746424F34749A9712B993FB590591A26421D9D5CAC408AB0A160BE7 +191: F66399236ACC3F2C6B4EC18D9D0D6940CAD454760B99F4AEC857D95CEF244DB47980969C60BD0C31AB4299F9C5E8FD52 +192: 6123876D82A64DBB96C541B69CD74AA95AC298401AEEA96F0C19F006BC5394AE55510C9ACEFFA288B818D1D0D93C84EE +193: 5DD46A8FA5AF32B43EB4B30DB3FBD66DC455048CFC5BB3DC96C14BD78CBBE96BA05F5613DF26848254ED5EB23E252D4E +194: 18419F2804265A8E0C2AB49BCB5D0F67512FEF51E4276A2D0534CE675DD9226796C348156B04A06C5629EB60A1DA883C +195: C741F19584EEFA9796496F355978A33A7E95C015C3195030715EB160AD13FAF3ECBA024DF6BD80AFD1B3B8D368AE88EC +196: 7D81ABC363BB0936DBF73D3775860C7C59733F7B7D327AFBB4D6DB0F3D9F09542881DFB83878C320C3FDA697346AD1C8 +197: 57086864407F2C2881D4871781A2C63767F3634E59365554501D105EA0BFB7BAF6764AE61ECED7861289D3C7B0E4E07D +198: 90CBB60ED6E2D89F1448F2083EA82638D9C2389FA11DD424695870248A378CD6FFBDDD3831EEE31550DDBB36057B12BB +199: 91D7420DA5228FDB7660F1AE7E165C67D8499B4EDF17AA673E78565D0F50ACCC69FB805AC26B97E0362BB085D2CCFCEB +200: 045E8258D41695C2F86CD97FB8D2993FD152A1C361F6BBA8C04ADD08870D357380E9B818D110059171D9FD51BC638378 +201: 60405ABD469BBF579B8883EB18D598B01540DD102626BDB17DEBDEC4AF879311176C55A84FBFC9E36324B8FD8928B607 +202: 4B1301A97E106C51E986DE5EA51F44D3A987F2BC44BC30BE437C9AC56630EC4455878F7880F9A7CC50F4F4FBAEE5A282 +203: 038535B34E658D395EC3D6150C4A21EED7534FEACC487137B42E26F7F7C3DE0FC05B4CF0100A9C70215198DEF7B49F78 +204: 1BDF2CE35879E663B96C993C469F37A656B53004448172AF9E9BE800BE9E6826ED4151DC0883314D7D81C572CD175D49 +205: C985EC17FFB0A51B9BD737CB332F5D91E95A1BB6B526218DAC7BD6644495B29777504F939F344D15408FEB4447674788 +206: 7F6261BA733D72E058285233A52FAE46C83A7FBF07A4BEDDA0A1598E3CF6B685810794723826E6B10FD331E9E24A5E4C +207: 9076F2C997E9611AF92ED3B87905C843FA8C54CCAF504723B6271A824537D74888865C134EC887B2FD0A7FADA825B615 +208: BC0B0830F2F30D2CE6EA7989992B87217874CD0368FC23271CEA41DD59732D4E05B4A241624BE37942B2815B6098E2BA +209: 66D9EE9D16E9278949394BE54B89A3AA20517DA3278BE1E051A51817CFA366C12E65DF19FB14F3CAB3C74B63B1D81248 +210: 4751DDB40700E0DC8DB2FDBE0D52C84D163AC1E553543657B3E03F1D8DC4C46CB317551BF779B2442FE766957EF93177 +211: CD512B3A9FD23FDA9A18EB71156673396DA35877C885C7DCF8DD47D13F3F21009119A742C28E2D4432D9721A3FB95D0E +212: C6A83B661684C299407CF7C3D236C4BDC9564A58809F246E9494C70FE9CE662E4C18AFB6CA7499357679E50FDA6BC8A8 +213: D7B71968C6B45A25CBB17397ED7F0CFA080E3F5A3C8BC804E5D414895580DBE45C42FEA555C213AC1A126E53B04DF60F +214: 5CA0667241817DB574E29CCE13BCD330B3F567505ACB54ECFC0AB8506C4B60EA199F599BA9126B567BA1FB8F841476F3 +215: 424EFB620DE0ED103039FE755ECE9333D7D17CA145E335EA41508DCD4B1189FEDFDC1E95CD19A9D932964DBBD7BB4D8D +216: 6F650FD541B29181F214B54E34791FC883E833CD13D4398CAC953C9D5047BCC39852535D3E866A6F568724F0575154FD +217: C99370A995774EF0738160EC00F638ABA47F718E92B340FB2BAF629029A0F510160A34FE64E49C69944749D9CC5836E5 +218: BDEC983F8C5483F7056C333AA1D8C25E96F64F185CE9E46B6B2E45BFFDAC5AE8EF22E25F2BE1F794F66565F2938B6A06 +219: 994C09D692FA75341E8B9E8C95D4D078178AC92EDE91995F3F1688F915B749609C83BA6DDCDB1761BE3CA5B69BDE32E4 +220: D2DA76C4BEF2952D8EDDFC21F057FAA6FCAA1A6A6C3262618DAC6716A4C28854C25CA155D411E94FFA91C8D7BBA1AB71 +221: 1853B5083F198EA25C238EB6B1E5FBDF61BBB0F3D0EBE45B33423D76A9BD4102CAB6AF3F994C00C4476B61FC98B0F731 +222: 48AEEEC8A8E55A37951728E900526797D45F18E3000883C7D16F23E2B1D2AB059058D13A6869D67EF20B7301D8990BDB +223: A0B1D985D009B7613AA25EE35741EFD6F8513A0F94B97092BE1B4DFDA3D814678A0F03FF1D264AFCB736111A79E59A82 +224: AFCF1A33C1F33C2AA89B5205036698475F8557CE00BD94DDBF6EEDF17E8D579947263768F958CBD851DDD0A9FB29A8D0 +225: AEB56F4631ADCF0CF219FCDC8BEC779C636CC19FCE94D289B1EB012C47F4BD38EB4562A03676FC4BFAD09B2A2994B523 +226: 4408BEFB3A353F8D78C5675F99CDAE1BD5632EC118687893FE5CAA76DD69C6B6514E5CF545A6F66A8242D227846BD359 +227: 94B0D3D67A9DCE3E8A63FD8A5C58A8A3052ED00DC55601F6A9B009CC9AFA82FB2FFF0C9CCCAC7F22DCCE1EA563AFDBB4 +228: F8EC8C5533E122D8E076EC231449DD1D80F8C37B8B553CEBC0C8512D4268525D398B8C310D40EE69D596781F5FDF75CC +229: 8EC6DDB7A830BD4689BDC5FCC10B592FC6B56654357BA2C3E9A0D31F5AA828A536B3E9581D5D928F3125DB88FF3288CD +230: 7016521262517879824A3DA49FBC20457AA84FE50D09FE9C3E59D391D2C117E5B59A79423DFD729A30060F7B5D3BD551 +231: CBF21EEDB86B32DB55E1398897A27935F270BAD833C3FE4F820591814C678EDC93BF18EC7D54823FB5EC7C818F586613 +232: 575FCCD5C78DFB1D6ECACFD4061D15EB61D179FF148EBB359F7CBE871884E7808D1B46FD23E20D7DCE3D10458BAA7078 +233: 71B49A94A2F3FBEF45D416299EB833FD94E6FDE8064242AFE35BA98F27126F450230E90F5F7E7042CC7D2DFD1C30966D +234: EEFACAEA3FD38E9EE09D58437CC6212CD47D5BC54E2C5F305AA99CC442DA3546BDD97DB4B39316B538DC4DA359AA64F1 +235: 129F54F055E200ACDDF8B5BE99069F8E56D6184CDE075E3888C1FD0298F66203508CACE8EF644F73760B4EA50879BB48 +236: AB13644CD907A302D6EC98F5479D6BC583C9E152D337DBCC59F12741CECF5673B70F7E8A4E5AFBFDE45493A67FC831AE +237: 27B0E68E804156D35DFEB49A7200C091F4CC4BEC9508175DBBC056FB90613C5928F942091B9589FE2DE396FC19C3F206 +238: B39898C084C7119549F9EF28BECACB19F6390C0456D0878858C09C021ED1B825E35AEDCE2C4FC84C888F893CFD26A8BE +239: 3F9C2678A0870B487B35B6A3FE926BAEA9380CBAE92A2AC4782FB33EE6A9CFFB096D247E8A746DC633BD210A17DAF943 +240: 2262677F339BEAB0F15BCF2A981299A96E199E157630A4A14D1AF2CD2F87E3D8C57A3DB76C28668B3AFAA081C3F34155 +241: B9647F9241DD424BD438B5490AF6E098BA9161145D864ACB3441D4C11150F42D05D0A618ABC000DF78E77F7ACE709243 +242: 33B19C692411663E3B0FA12D9FE9B3CE120F9531FD357C166A6328E7E5229D45DA954419070F477CF39E309782F4FBDB +243: 126AC770CCFCA5D62849F48DEE8CA66ABC2FF435AA1AA6553436B77F50AE2F823931D8621863EF74A52D61ADE490E1D6 +244: 9EFE7D513910401F7D2BD221EDE6551BDF0D0D9E5D6727C9A31DA37605056591003D26E791040A9079F8D4244F1BC0CF +245: 7952372BB59A94F4AC2140A658887096BF3F8EF62702DC01EB443291118B2EC13E100AC1D48DB72696DBFACDF97EBB07 +246: B898033224FD42835DB1D951E7209366EEC29F2203B5346E1DE0F2FE9BFCC9E874A32F2F284D8E95EE384768F2409D96 +247: 6243099EB6983FD55DD8FFF19F13DBF3822EDFE2E5C37C9888892E9F696A407BC5A4271B9B982BDA55588D56915DF9D3 +248: 385B8BBB2D63865B778DE869A3A84908221F4697EE87EEB75C8F571838B9EC622F7FAB845EF0AEDCE73E329D0E1CD59A +249: 9083F88D02752704090F8C5A36A0DAA3AD2A243C39BBF9F22DE049C1684D2AC3EB7BA4FC5FE807331F496474EECB63F2 +250: 4D3065C188C2CD9195A4DC471390709D899A0BC8A867307B7EA0FFA2324B2B6D12C0FF360813636536999739969D735F +251: 8E135678101EB0AF32F4B57C340E1D9ECA779111A8350E13D80289D34960FB7721599BCAC71230915CE6B9CFEC6107E2 +252: E1AB3C164939774822ACFBE3EF5D9D826EA1ABBD85FB84469C97CFACE198C642051F5B30BAE434E1C36D4AA33D5BC8B9 +253: A7973BCACA3FF2941E838C97084C3CD92965C1A03D84671A02CC0878DBAADFB21A455F25099F7B9BF0216B9AF1A10001 +254: 8BA6263CE0E15241D709C71E335010071831F0B5CA4E0B2E100B60D486D4659494930821BA2EA71E1FCC9A36C722D15E +255: 2889B249B1941269219272B80770D48D8C6979ADA372DB1EA4C81099E33E6088DFC2DC90526824645D709E79860CCAE9 +256: FD717F226A8CDBC52BC9F07BB8DE64F68A2B9C7EDDEAB862A31D2D37E49110254CC3F71091BAB53E988D8E143EC249A0 + +HMAC-sha3_512 + 0: AA692ACEB6F1BF8F1289D248D78C43F4DEBF46A7CD64F94399E70A788BC60A712AEF1481CD71A431E26484F2C0D93ECD5283BBA8F03870BB3E3A65A1F4B14DE9 + 1: E01FAED8659C115933FD2CC4050B77C8D51DD79887DA05DFC33716AF581C8E206715D707FD51CC51D1750720B74E88DA39D5BD73736A5D03A968D6AA2BB8C273 + 2: 9D8246D2A869E8670E9BA80A7B07274AF7EDB693815EC9D6D256AB49746A18F798A46D79F5317DB4BCA94BD51CEEAE32807B0F586A99E106A4A692BE4D00FCD0 + 3: E02A33BD237DCBD7C72F37EBFD987F094E68AE76E7105A48D9E5FB63E7A7B4A5366D6D1F5478621CE23378E06BF5AD0EE9E86A9AF74683AEFCEFAB570946663C + 4: 3359FAAFD816C7E15D4AB5454EC0BAE6CB22E74A73DB3FBAF1EBF9F44F6BC3515A079E400A80E8D4F9B8043A077637AD58EB25121847A18DB83C869579DE8E6D + 5: 33CE50B62D0B9E7779BB34F8F58AF27CDA9CED85C09B4B7CCB36ED024E7B232FD370E8DCF6B0E40FC3CAFA84B66D42FFBEB2E3760F9B36891C5B1468027D692B + 6: 156C37E9F2628A2563F8EA8F83AB17CD9D46AEB3191B3D2DD90F7E374B3332481E1670E3869E76C602678BC093F473F871879B6E629C2B09BC27B891151B821C + 7: 6D0453AE5C80DDBD3E98E323ABF12BE6115BBF5DC5D53336441C98487A74284595A8628C9FBB4DF8159693F240EF774EE7A932361EE7C69A1A17A0C819AD1EFC + 8: 1AD67F1A3FD04F500B336FBDF463B79A7F2D4C0B5AFBB35421F4039294B86740283DFF2A726FDB684B95E33163BDF63158F12074927F7766F1A23B8EA985BEA5 + 9: 8F266025C22C36636B7615A2A7EDEF6F0447095F4EB2A192F88729A1DB46157EB20533B404EAE8C8EBA7CB429D0CC75BEB09870438B9F5CB9B988D852DB05A6E + 10: 72F986B2498E9383D7690AC58698CD1EB8895B0946F0258F447320E88EBBAA892C478DB2A95CF6B3B07D3102AE46BF22509B9801E950BE3303792E4F088D1824 + 11: E761DD5ECBE9C8A853317A6B0C7DC868468BD8C5931127DFF08EB37E9E12184998F149BDDC733A353DB3CE1E016E84603C73FACB1D20E8D8B8C89389AD39999A + 12: 2113D189B4CB8341B92699C3B6F52CEEB226F13016D069D2D16DDD15F1EDA09EF5DC37CA133C4C3E7B40D723046A81A1D3FEA129F7FFA8EF49378B4990B22E0F + 13: 90D0D7640482C9BA9FB6E60B1FDE1B4789642F2FE50ECE05EA8F23B073349E0EB2584AB4BDF1BC35BF09FE1CEEFEAD6F0A5F1A0D82EFBE15ABF7B9391C351CBB + 14: DC0C452603B841D629F62B25D6D95816295ADABBE7D0081C0031024E92D2BFD3FCC9A924DA90AA2CE4FA6FFB64F5C534F362E9CAA35E9CF6051C18C81FA776B8 + 15: A58C1D7EABA54A8BDB0CBF1C9CE38065F28FD7BD0D43DEDE363466E05D80A9328DC21CDDB4CDB085A212ABC6D13FBA7868ECFD93CD2EDC98B62E053BED5FBFDE + 16: 175611CB531C274F3D803706FB8D9B9D7FAFE1D91985E8C043055E758144DFAE7B65E6DFDAC62FC4C251F3C5CAAE5ECDAFCE4652629430CCB26636BFE4FD023C + 17: 49F5ED02F5B799FA1D75395851396713BCC614F84AB3561B3092DFDDF78FBA32493EDBF5702CD0EE92211D9A1E82BCE327744D620F6D66515D73AFC6BAAE990F + 18: 8BFBF0E66354F4538E096D76833E2C2FEA21D65BFBE64B18F79409AA9D73B4C6AADD797BFB9CBC25DD2BE10094723DC6A0756B774CA48BC567E10BC6FE21BB04 + 19: 58F43A652F4D473A8D74A4213B08B6C9040BFCB9AAFCC222216C5C438FE31219FD7B5BDFFB016DCB034D9B2120CDCFF6FF25D79EF7D32EA883E6728FD4FA1C88 + 20: AB2D8F14729F68D8662152FB99F1D570EC0C9E17B4E744641F01FA4D00BC88BCA763C92CA40CE8F1C79F43221FD307AA9A0206A4F41406BDD4F179A606D0E766 + 21: 718887B2E81D6B0766B05D150B7495C5B8D6F61478CEB03251D9D91FCB129849B842BE21FC2BA9B6422E93D3EF5ECAE8FE3FD630FC793D969E89A5CEC5837DE0 + 22: DFC343B7EA2751DE94AED07E6F10B0299F023715172871CC02802963AED1FD38E7EF2AF84D34A3D6D6295D3E321514E6E7F52576DD046F58833C39DF48DDDE97 + 23: BBDB04C9327C06411BD34B714A4FF559AC82DEF3AD083430F66D3EF0090BEE7EF30315AE67E988E33453F0C297E32FBEB82E90B21A4C60C809475B9CF7B28424 + 24: 3E5B1FC9B9003545C3A6E6D128A7D8CBFF198EDD61C4D3A4A23E657888507F29160CB487490AE7BF031A48E8BA7078165703DB8FDC95FA2007DB00CE0FD27765 + 25: 332C643ABB317943043758DEABC1D2541C1616A4AE1AFBF45AEACCFB1910116432DF0F39DC95C6DC7AA1786781C8250DC347991E6B3FC939A2229DF73BD1D194 + 26: 95186FC201FB3FFF37F875EBCC4058F61103A63B9A2DE5914DC25E1942B5CE0B80400A261DFC10BD642268496CCCBFE7DAE20360A6C187577DEC1F8DF7AD8B7D + 27: ED997AD449CBF355D7BB8B947986C88E977EC2B7FC9E726479CCDD968F9A26629C163B35306CE6130EC34207B06EC70A03F906DAC3F31F81F7931D0779066D53 + 28: 6AA15CDC8E3EED080BD4F2741BDBE5594B0B6BF3F66C63F1BF971371D1D10195892712E510F1053290D180B0CE96C8C67ACC725BF3375CB7F3480C4EAB7F33EA + 29: CF161E3841C602E6A95081B783B4067049B063A428EDDA17AC78224BECF36A73A67364741BCDE8A1C32EC60365FA41A8932D97032E6B776FBC1780E47C13365D + 30: 04AC490CDABE19DB468EF1CE9C4D34229F7896922FCDBE745AE4A2BE687BA95E2384D6FCA22BEF2FBFDDDB163B980EECEBDE138FAE2A9745995EDFF56166FA1F + 31: 59836733769E93D5F649785ED981BB2F36A6581CE0A6B980FF8A1C5DD5C3AFE1FA8A2EB958A97FF0AC83C3C822F4601AC8B1C9A05CF3A1DE2B3DA0812CC32FAF + 32: E8A22F2979B475652BD71807785E65DD5A422422667628C1BC3397B1137590A5FD3D82FB137DCB40AA031C33511E4BC65B6BD8711143138D60738429E5ADC30F + 33: 4BB8535F28DCC8584FFEC93C9B9FAE82D4E05AD034C47329AF8F2F4DCF38259C55878FC079FC4136B1E29A5A9AFFEA97A09609886C168A75A84835035ACFC7AA + 34: 50CC49C437B95099AE0E3DCCD09A5ADF00EF81040D532291EDC843A9CD3E5A02CE8197CE1F8DF7D252DC43EB305F7CE7644948BC0ED4017730DB0CCBDA60697D + 35: 0E15B3D89CE82BB7FEB4A7EEA4DAF8DD7B5611CC5A7A6EEEF980876FDD82FCA58750EAA6EC58B3973D051F151E05BE34E38375BEE76F4CAFA3789327816125A4 + 36: 2093E2AE907DA6D35DC9933542AB19150340480FFCC104FF6BC9908C9C4C412BB26E135A2D30C00BD9159B5D8E5E8E42B097575E548499863AEA765C2B44A5F4 + 37: CBF1638638D21C0D9254BA19BF2CF3895CB12091D1E8B7A77630B48F10725867BD1FCED563F00E2A6BE59998F8FE78FBF817DC2A2C0910B860E3F09BA99253C3 + 38: 3E00836F37432C69FC9F642046839AB23865DFA0EF73AF3FF4F807FB6575F29A68AB1687906899FAA3DE9685F60E4E718D7AF0058548CD7A218181FF5C27829F + 39: 576FDB97266193E15EBD154748680B0A465FAF6BACCB4B0348A1F5C8F04CA71F3066DF2D0A099A54687A757C74522A3883C5FDD3D570F48326F517E019975664 + 40: 2CDACEBEEB29D3BDE63E2281DDB064D3D775540631B6472563F579AF22A43C007E0CD0DD5CA953B9FB42DB1DEB45178C88F79848BF822F81C41F6478859C9CE0 + 41: 0B4544D8DC32543D46B8886D6BF4C1B48C6CFE0B023BF2860E79341E3324339F3D4A59495E019A289173E0A44747CA239704E4A8B4A4754545A3774DA7AA50BB + 42: 942FF914AE138B3BB86FA6B8861D1123B1D2F9B9FE58F7D57BBF75CC6D64B952BBC14FCB8AB4F7B56F63DA976933CC3449DE0E9F8EFD489939AEB8C24AD2BBB1 + 43: E194C7FC80320D03346E6D973300C5D082F7970640467DE58623A7F18E6BEDEDCBF7EBD53A8C37331192E2B8110830705A86979B00D8E8368B99D0C4B606069C + 44: F9E72D5C4A6CE19B1A4736F928D65DDC0B1132C3ADB3855356B348A8B97BE0930B830CF0CAF8FB68C69C2D02A46D06E878DD01E0EAB411C7C748AFC1BA56E19D + 45: 1E8B6DB851BC52B9763A986659094E67879AC205527E963A727EB51443578242872B16A2AC85443BB7167A2789857D644F3ACEBFAFC7863C5D95040ADEE9932A + 46: 3CD091FAC887D859F489C171B1B700ED07976312CAF4ECA21FD9BD8A231C631669DBC06253B1E647776B3C5F196D3CBAA51717EC3E4F3FEEFDFAC1FF93E4D6FA + 47: 2A02BF21B005498078CC6FC8A493BA532FE143FE8F82B17503048F022DF786C38F6778FCC5EDB5A0FC3AA55A80B5E48A0E28E90F0D406F31BD7FB5048DF3F9BC + 48: 7904B7357AFCEE7F36B3064F319E623B3B8269E320EBBC7087353C45D856623EC64850D105C4623D3930326057A243584D4F36A7AE84FCFC80E6E4D2AB4538A8 + 49: 27E8F4BF2928FC41216CF1FAA60B2C3A16CCB0F467544781FF16F25020D743242D55114B92B620DA3C37388BC871C5A87980DCE22C2607339C4969B20F438787 + 50: 31F247E0C5A751D3C9D9F5D20B85F762DD64E7D608F80EBA2AE9F42FA0F7C3492EB20386C884D0795D6E10F17FED6AC9A382CFC38497D6DCF8F1BC647952557D + 51: 2A9246AD25BC1B95200A387ADF3888F9CEDD071CC5B9DE7368C59526CDB04DB989D90D74E4015A428C031D14E70039B7D0AC57DF1808C49140E8D28B694FCFF8 + 52: 5D846FD3164DA1107E95E03AB91F2296424C8A841C792899EAB9769FE38B3CA61284C6D8E9D61BA74A094563512B87890A4D2BB09A2202863891E362432AA199 + 53: 2D16F250BDB558B21C3553F7FEA6408A4BC3D9998E019362624F5075596C86B7E2CAF05E85374E1E348418921605B71D2D4B39D2D2B1E03C68F8F9B8F97A2FB5 + 54: 7D1C5EB1F9F4CF3CC587F421A18A272E929FC4B9E92758E71F2CDE75DA7FD3EEE88841233E9DCFD178525E0FF1F7A2E45FD2803446E3D63F36A38165BF704E26 + 55: 01231379C46C718895B8A104354FFDD6BA1ACE47FBC8DA89B2D08BA0AA023EEB7C48682CB0933E6C1F5DDC02508B962CAB70C778F3A1CE4A542F1343D54008E7 + 56: 78560BC1256B5CFAE8DD95D61ACFACE06C2A8F841A20B8BB656BA7B8D0B0CE07AB7856EF0A71C43EECA794A91AE94B038A4DA59FF01894CDEC65C70F520E8371 + 57: 661C4125690EB67ECBEC21C7FB759098AD8C222D78D3F9FE67CFFC86CB089A8CBC3ED5DFED893366A8BC1C721F572DA650867DA4BF6CB0672110254B3AA19D1B + 58: D29CFD035212BD754B40B7486766E118AC8B562A1B8C16A607D687AAA3969C1CD81FAC07C84CC4271EC7AA7EE0CEAC6019125C7D88C7B4BD52115B9363B50D6E + 59: 99F628DFB5F03BB7F2F9CC13365F4410E2D33310D7132603F609C8E765102B29B544093536C9745E8BB500A6886786BBF8D2484B565B7E6BAD75BABABD047359 + 60: FD7C8FC8776723263169BEC6BFC0534A1F83B2E5C08D99B1FC5E7B999F81AEE24C2E0F2F45530F8B2FAECAD1FEE5ED580268D35CDB43BF3FFC73C99403C80F92 + 61: 08807451543E4630FC935EAEB08A7BDB20DAF0519F1AD1AF3F3092810E44BC6B5A69E4CDBADFE47AD2B4D1D77E8C5B03E0B357E06892182120A098FDB6BFB5E3 + 62: 883DB1331C1075537F83FFBC3FB9AAD16B2880FE709D959C9CE06EE97FC2E9F9AD30686BA65749C4333B26A7129CBC8FFF5480A169CED0B984D3C2A8DB7259B2 + 63: E2954934BAA5E2FC9DCF083A213022C727EFF2BE3B768655B0B22D9D89CAE7996132F3D38DED57D306141DB41FCDC635F8FAB7BCD30A5DCEE4A8616579A61112 + 64: A81826D0FB13828C36E564FE67C3105C5002DBB725F76B42AC0FCC23C343D42DEA959301510800AD6FFF85BE725F4AF2308619A3E49D938D13D15B523F827624 + 65: 85BCC80E1EC5D0E612D06FC52C73F09C048EFD1364FEDC4C60A09684A76B136955D3BDAE9E4F3FE01034ABB5FEB42E4BC3A429AC547E864708DDB33ACF055391 + 66: 7D57580BF35E1DD2580C0CBFEC5F7862E24E4D873CCB23D2C4C3A8D4A02365505395F4B5C3213384D7034E08228E31EB0B371A7EEE77E5AC6A8BF401FE20BAD6 + 67: E32FCAD5F7BB5818E7A6B41BD85A16681B3F2C23B35A2118E8C30E63B2BF084225460B1304219413D3BF69E96BABFF6C0B3408DF00F5D8DC9140CDDE4A1DD925 + 68: 0709773412441D643B5323E6E88C3FA4B8B5E5A92E0816AA5DD0F1A996424E2CE68CF99C4B8FDE929494013F8759E5A301699017F521398DEB728E5C1F21A14D + 69: DA2011672D9A6E5322307F9954B181DD4E3BA2333D64F40B3219AE0F0EAE5BCDF36F3D13007963FD85C8518B2DA4C78C60F10102C8FA3C30ECE7088113900A94 + 70: 2CC22B46D538CABE8EA51D5A05895CC764EF581F6EB1DBEC5A838BC16D4440D708314BA5C2269FA78ECC3E5D4894CF921FC6E2769044E0594CB600172486DF56 + 71: 321324050EF73AF3524FFCC630A02894262D853DFCB55B5D11C03027F735D31617588816AE58FA3E8B2146A9946EE7E6E0F0CD2F372E5D76CFA2379F66B0460D + 72: 5CE315D250B325E5EFD511256F0531FCF9C3F105EB59A366FF6154D8F6414246486E30CCBAC5C1CDF81A59451F1F397B6C669ABAAF342695DB7863FFC72D5CA2 + 73: DC689AB04769C8F366772CBCB258986CD41E4BDA9A2422C9C62A1205C761B10ED880700761126E52CD33DDE83D2EBD2F57011AB93007B9F1599E27CD3D86C74A + 74: 935D1D0508E325934890C44206D0ED7A3211D1D253AE35C44619717E8E1A54019E634D71BE35996AC88F21ABD5688A6A5F693BECDE344212847E3F6AE0B26D38 + 75: C58D7B11281B00C3863CA2AE31306BB1AD4B52E48C6E51E9DACEA891446CA9A25B7A7237C345515647799BD3D285F442C3C06EBE55B425AC796CBF3A2784EF6A + 76: 260BB58150FE0F230E85F58733E42B7C33BBEDEC7F4DCB7CA4A837F3098331DDC52A80C93B78CD092481BE40F39173C14586825B579288B6E06ED05B7A3E53A7 + 77: AC6950E4F6168F39038CAA4FE8FDAEBBD09D719D9A829D5C0FDED16539F2772BA513F43ACB686CD138F3FCF0F4C35F6B8A48E03C0BECD7136955089546CC1C96 + 78: F8E3882C60B50A16863A485F0104B60E5A3F8377F807BF0EE53A6E78F1BFC6178B2676C9D97F0801CB08D33BA7869AAE54B9CCEAF1432ADDB7C7F0F8D598AC39 + 79: 9573783EB3FB01F01F6226C773D8A60A1E8857528E07CF5A116542D90B5700E45F201EF03B7BDE12DA335E7980EFC600E122880618521894FF8DD4DC961D152A + 80: 90376407D9CCA53593D6AC1384DAC7454314CD1E7AE16B493626664470A33A11FEDE48E142626D0A481F992373E74D1D714F7A9AADD5145C9C52D9F6277B1C40 + 81: B17CDC1596A406E0F52F30A0E4092D7721186B57B7C20E9B0CC1FCC9AB60E1D8DB1491218F80F5C49E4403F0D2F1F76E26D9B4C5A3295215685A31EC05DA772E + 82: 0E93FC6EE2053D8454BAF2B711DE1792CFB39B9B080B39F2663224656303FA1D601FA62F9D1DF0478CA97C3CD11CEC380981CCBD2D3F5581F90A291393628A53 + 83: 7E998F39CC39594CF31D0507854ACB1961E29DBF146456A9CCC719FC953C9683B1D2A8AE214F9FB9ABCD42BF2512B178BB531F0998318C8A80CC144741BDE5FC + 84: 5843FBE53A1ACE0A8ED7DA7F11798980F2E5D609FD0EB3D63E6302C90B4CF10F5A428B768B0912319B84185AE24813BF3E2C7D103F542A6C69B7E85599DB2CEA + 85: 1670EA99A80D1F3D8B02AEB82D301F3DC87AF53DC402A985E585B146D771AD6A8969A9B9AC9A3928C1DDE28F9BEA6DF7E1373B926D356595D326294E76526DDF + 86: 4890C109136F3E3283A63DB6F032F9BC686622DA55B76A64D10BD04322909F16E3611BF732FE68531AAB42D29DB65769BA6960B0CADB3A86CAD4FC2C4F16342C + 87: 5F2EA34541D39E2E6FA3B8E88FBBE4DAE89BC70C7F40A63145C94B172CFD43F86515BD55BEDE975061211141093608AB15D8D9E5585EC1CD636E16A30FC9339D + 88: EA1C544F926A298D6E5B05E2BEF13E6E072BE3558E50D1AFA6D8CDC75F11F73C45331267B15E60EBA8045B9CD03AF95621A2048F5E08CA1BD17631C590E7E777 + 89: 8D8AE88A1F16B9450AB6A713C05DCE0631553027C5CADB97624E9FED5E3E5CD443E6015F37C0809656AAEFAA1D76805EC36C0E6726B9107D63A59C2E5B7C911C + 90: 72299C50945DF6A2A01CD14C3FB6435558DD0858618FD5A8492E4BA94573E9014AD2BC17D8C829872498E53F7138E568B9FE0270AE2D2F69C9D4D3B9DCB23453 + 91: 4E3B9C62D4E4F04F148E4AB0C5229CB7EC08ED6801E970F1AAB019F7C5853C68F8E8DED21A96CBC882133E85DE28A11AC58E2F2436E10171E328B23F0B6425BB + 92: 974463BC6208664B2BE790FB9F60AB81DDC9FB88F4F2281095F47F7602010E748ACE4F8A3AD8B69B54AE8440B664D3F6A82F278BB14C03311F9659CEF970CF0C + 93: AB965EAC6AB890DA277EF319B0E93C1225C7E6DF49D0E7F45A0BBBC40925136FB20066156C5342AC9417E5F1D97C7200532623C3B9BFAC766A8A17BEA17DFD65 + 94: 8340A0E60C200665A5A26B0785880BA92A74FB43FF75A5A9D23E45707531753CF4A22C38DD059772A6A04672F5F42C55D7EDFED94003707FA06F8364FD886524 + 95: D0A46A5914AD1881525C375E5646013FEAE62DCC403D01A4342649B876C8B35D0D63D42C23247AEEE49E34E11B2BAA990DF4BC30100B135CA56CA78D22E5319D + 96: 001B3101631A9A7B0600CCCFC435164A4DB773B2C8265632A1230BE15C974240E139665F41D5E7600A7C94966136ECC2CBDEE6F35195E562261607045BB2B3C9 + 97: 06A37DBA1A836C3F8FFC14E8BF2BD6B9C53B453CF15658FD265EAEAF8E418D5174A2A37E5010E318041E28467B70A9CBE9EAD07B55E25A607DFA337140807821 + 98: 0A3C3432F8582823AE551E575321AF7FDD0DA715FF2D52D2121AD5EC6EFAD84DD50DE681DCA10705D87B37DC786A4802E8D6D5497304DA53C5A9A2C85D75FECE + 99: FA5463D7AD8B2569E87B778FDF862E8396F683EAA72BE15F99AAD1166C5459E1679BE993431C8FDC53855BDA60240E6F4D97FCB9072818B5B693260ED2767D42 +100: 7E3704176F67A08EF25FCEFB83986B2726619933F7B5C7365E74145F6D361E391F622CD1829F2BA2C70C0793D7A155CEAB3A3044B0C5B6AA6857AC6CE1C1A6FE +101: 4BD1DB8B6B1011271A598E07B9A2ADAD1423FBAE0519865A6B362A5166AEEF894AF5ACCB277B2FABFEC4C2B4D7D203628AA5DAC6CF437265076B35E59EE4A7C3 +102: F26812665D25E63283561C9A8C98271F43375CB3C45DBA5289B783E62F0A8165A44B89DAA6822D939252A25C9890A1F3905D2CDEEBCB8DF86CBCB8E9B1F2DABC +103: 6FDA01C6711FDC5ED87B767CA09DB32E628B1065E0A03ADF6E79CADC07D06FECE27429C14F152018E09D4C917B6777EB4C826C650C129AE10E9E8193B2CF2379 +104: 6ADE9BEF5755C5D7732B93B9512B630FF38D3D09109AE092D25E79C34D8F06938E1C767E34DA6156CFFCC8F2F9E13CC71640FDF390337C57705AD7326BEF907C +105: 8E01F9CEAD159C70C01AB6104727C93FF22B4A549D77111D69247E31C8C3B60DEA1B54FB96AD7DC573A60D720230DD2A364DCBE4374483B788132C2FA31CC3FA +106: 93D54BED85CDED9C9C5D77637221866F43442C78C91AA0A3FB98DD1F671A96E8B05DE2FE76E530864F3ACF3857D81F2E56E9647F8862CD19EDD12322C0F46480 +107: 6886B636DC89EAAB1B10AC45A15B9D4BAC5E974C6F0FD28892BA48D6512C44F3EAFFDF9E3282F85F80FD4633D07B3A7A1F6EC68CDD749F71BAFC2AB7844FF053 +108: 59367CAE8D36602BAA37DF41B9B02B602B4C6B6FFA9BE6D0FC873C4F017646920C8646BAACB3E9E6F83E8E04B8BB649E54CC79C8860B6E098BE8D45FAA857464 +109: 71BB858DF896A8AE3B9E4F54EF13F42E7BF9890306E79F5161ACF4B2C8DD715E4AD1C77DFE3833BFCA22E3FC1C13195AE7A3CF2397C16DD9B6AC164C1D799407 +110: 1220F0332DB08B8F968E9D9FF1E6852E6311E3F6ABFE68E14BBB218E1B34C772F5A6C22B0C793FC1162A15569BBCDC84D5CF80CFE6DA6B2441E42D38C245B872 +111: 72CF05C361D3B2B7FEC182C7965623F45605DE6C7A9031078BB34B86BF0BB0A872E6FC73E4BC8B8BB4465025052488AE3E34143F3F77630FB2D1885DCE73E0BA +112: 9AB61F7752AFF9981BCB633413F8219E0D323EA41EEE3573F7C847C1A6832814649E812AF41A009449323272CC277830694C3C38555893E47602A0962BCF5C30 +113: 0585366FE71A4A9DD4148CAD397306D02B927178444E35B0EEF36D4E6186136CA0484D9AF63D7B2F81F40CD46E65586000BAF90F69CC9D2954913438F17EA8BB +114: AC97B5F2017F621C9C7197B96638DFA8DDB7BF5EEDD5806B6C9C790C0E23734FB67737DE174ECF298F42BAA202D3BBDB990454D307164A38F5975B1E3CD39952 +115: 8D3AB9FF466EF62E7BC1D9A83A595DD779C8D70E0BD61D26947294DEB593F787E1FE8B19718E7071203762CD61F3A7765EE9B1641BDD6D664843D42C10E9B159 +116: 1AAF4ECBFA558BF7455ED90BF57288EE10DD963A641A44A8D7CB3318A994A15CE9590115E1F6DA04B36883856AB4689BD5224D77D71A547253F026B63F7B1B38 +117: 0D5ECF40C3C16DC9027D4BD140DFE7189AD46089461F3FFB675F35E3B144EFC0E43E78EB180A663962DD086D5559B89A2CB55AC980B0B0BF9EB4854BD2EBBCDF +118: CCA5A173C3C0B85D751011128095944CFE9BF37618F6617ACF204741EC728BC4F7B0A8ECB483ACF159314C14616FB865E7612ECED802B775A958FFA3BF03306D +119: 13BB03415A36977EEBAF5993091AABC2E2427FA785AB8EFB1AE7CADB1251D41B9F3F64522C9BBC3E2FF40928DB8CDCCF358778D72FD9C1EEBB712B5172348924 +120: 90588400754BD97329AE43E4701B64DAA7A783C79996863BAA7E5706AE29624924A77DCF5C2FC4DCFF49B2C0D845EB31410D3C5050B6BAE7E4B0E857DE5E08AF +121: 0EBFDD8D6D3F88326733C2ED4BE0969601FB2D077FEC961B2CF9CCA45CF24A2D1664271006DC26EC2AF694931BFDA6A3489F4F544E328E1A20F1EB724C78B2A8 +122: EDC4E0BF61FD8C7B9D625F7DF1874CD127C182E919E5760BFC2C9504D53EF7074A9FA1DE60F57049889B473F1B99182EFEC4F059920D86C3669DC89DB93EE233 +123: 71E9A08A851A8F239CC4241D48823AEC65FE446164D161B9032962AAF8C465347B76306C7966DDF9EC223493FF385782CED510AFE7DD392A169EBDFE7AF979CA +124: B767BEBDE21B413E50BBC78696B158EFCB5A38073EA97D9ACABA332BC6A2FB77856D4C33ECAF075A7170F3B2F9D9A7292D5714EAA95A7691578889EC311930B3 +125: 382250209D8B0F3436B6BD44C7BAA8A95C5A9037B5DD10CB3C9D36CFDC80CA624DF0A9A6603FC5FF88C4F160C19BCC62E31F6071696FB76B78157A44500AD97D +126: 60D8593BDA68D7FBCD0CE43F30134767AC477FEC671F03C8B1D97AE6E0606AD80924783145415F93410F9FB4952EB1A1F069A0F0270403EC2D7C4D3586A4AC08 +127: CC58AC1BA1A6EC7F765B6F4258572A4C892C0B98A36CBB5761468724FA63E42379A0A4FAE0A9D49CA796FAE78456D2161F3C8216C1DFB8705FA5EDA90F5D4CC3 +128: 842496941AFF12C6E2ABFE711ED4EA3345DFE21FADF81604F1D1C66B5BBC79E22D2F07A16AACFFA24593810F9D4C04C8D821284B6ED03F3AB7041AF0FAD995CE +129: 05DFC799A2DD3A4AB4364670058641DC3F5F26A640A19CEF8D3AA9E02A8B1FDCA9BDE30728DE4E41F8A2DD42C355F5044879EA094749C539DE08E8B6AE020AF2 +130: 6F033C2D99EDF24AE0063AE8322F81EAD289194C64CF5ED581F8FAB8DD452423ACE1A59CC8D3793CFFA3010168B7BD8DFB508BCF6F5FC75AB8E887D68BC37237 +131: 3FF091593BCFEF7278AFF22A9C190FFF7476826A822495018BDA2BD638E38DC3DBF1400CCA2F9AD0EBDFA1426871116F1D50E0CB17D799EF47E567700F9FC18C +132: 2B1907375949E70D38CED5CAB738924D4BB16CF77D811C4F36F02D1887FA2FB6297130AE9C053E2EED3D584FB4F03FA9A7FE0EDCEAEA8928722CADF4BC5FFE03 +133: 1E4C22E1EB1D3FA08F92DACC7AE108649D2A8B6EC2DE86D11494FE87EA4B78EA647D6E9F33C38D0406754E7640FC2B229945A3B8BE112ACC878AE04F2B446E6F +134: 3A2A370781FBD8965C5549EBA4DCE29D046D6B380C72269ED1A686299C15D0AE972415518BEA26F042052209241DC7D85B14E6C2BBA25E391B0510B2DFEF95ED +135: 563DCFCB7D3E8612A4B82870E5EF03BD833C9BAD5BE56A254CDD3DB6EE4D9DDFB5582DD2465B366F1AD4BC6C3DDAEA0BBCE783BE20DCB31E62F22EE87EF5D5B8 +136: D643B761381FAD698E74A4A6C729842FC2F299B052605656DD89A9605F32007BFA3F16B2FB472F4E517555712B6E996532C0A992A72F27DD940BDEA416A32169 +137: A5732791CF01829C13DA5CDC9D3DBE8E111A811998F0A8C26C29263D02D2725CEABC2CB63E1D45144201042A52B3967E207CAB774F7A8B7DE54BF5AE8CBB87C0 +138: F952E40D2A809D55B27E3E186C9FA6F006DEA42DFCF7F32C8CE80A8E46D419F3E5220BD72D769485BA43C7F672792093EDB31DD0A67976095BF84B4E955251A2 +139: 1BA525FA7BCCB4FC0DAC09728A8CBAB66977AEF21A89D8FF2A25746D6B92C8F7C1DB3C302D75828A42D93236F9DB85F4C4DE25D8BBA278C08982BC3FE7292576 +140: 48634972259562823E58B8B278AEE5130C4839BD4CB99C6D2E6A2C051212970AC37373D8B2493EACE1097293B435A699C79A3EC3614179D603021246CD7B2CF4 +141: 594DA53BB2B09A128B05B7168F4AE3A5AC65874348A1B2F80250613332A7D25590C5F9496B1DEBFB496025336BDBA3AC3530D9F378319572600926D4458D2163 +142: FBCAB73A5A37AAA0A77567F7DF43460133EB123240FF790C0588ECD27678D69F846DB33BCDFC41606CAC86193E9362E4B32FC234A39030457532F624C4A66BE7 +143: 2D4A5D34850C81F80A3B9ED81679F24ABFED1C37D83C8F30C85193CEE7D31EC36FB8031A937C9F945DC4EDFCC81E916C64834774E0A373F2E5E2F5A4C9F75474 +144: 44FE1C50E9B946F1695D6DB15D4477B1C449A0AF0E724603DDFC847D2DAC8E013D0C08B42EBFCF6052BAB75BA348F23127CB0104D7FB9BBF57181D5A739537CA +145: 708B0E9763BF9652872C66EE33DB052C7AA58A241A92F0203426A92772F928846D2D13108D56E5BC0AC87AC5E4AF059E04CA971BA0BB6071A179DF5D8E9D17D6 +146: EEA9427692774927624AB77297B2C38AC72EABEC3FFC0EAAFBEF0B73AE262410590534CE1D3101BBDAF2D1A58726D9B0CAF40E8A00BE6507689B822FB2482C91 +147: 52655511C1E297D95BDB66E471113690DA533DF2FA5D14A4F339046D07CC121232CF949BB4BF42281F9CBD853398958AFF9F204E08AC653725D84CB4ABAEEF4B +148: AF03BA37F76911934CE0443606E3AA0E0B2216DCCDBBAC0A06D21D641A6FD4307395E7563633905DA6AEE64C6A4E72290348E0B5DDE9338F8226ED93294DE201 +149: 1D54F7EAC95CCB2374109D505C0B0A74075F43002ED5D0903908E546DC7AA4885A2790DF781CE9726D49CE1BA4AF01350ED4F77270A52DA9B4D715FBC34AFF6B +150: 732ACCC7F623F8E7F3FE29ACAC831BB9E5102EC218FFFB153036C9BF0F59C0EFDE0BCDA4B942ED766A47EC169E08B38842AF2EF05B0416B5F41E138580B0AF65 +151: 951F270F67FE7532CFCE113C4A744940D54E9BC446B598FE113DD08797FCEF5EFDF3F375BF26A206B903E304484D8B1E4FC0AA0461206F9CF31C313499DDFB99 +152: C21F70C09D3C9C62AE4F3985E7C09252DAB8074CDDE8ACECA2500E84BCF1A55D1169F1766C0D86D290EEB8C21184D6BE87EBB6F719928C0ABB2A22EB58DC2EFC +153: B4D4B0EE87D9A6D3FAA43A41151FCC14FA02733129699B13AED15EA1E6035A70CD34FB1563158AFB52F7A05AA7C1F49B46F5C3721819AFE28DB429C8130D5B71 +154: 71825C1F65C832AF8EFD48A211BA1017F517378FF4EA4FA858EE9D15199B0D01B9043BDAFAC541C7038A8F005C4ACB505AF54D7F8014326C8DA4EA12DF0AADDB +155: CFB4A7A6F5AC83FED07CEEC5E8A6EFD267F9C556CF3204A1CFD207001BF0EF0EDC3C0C501EC57388FD500290C5CEAB0664E9CBBDB0A80779E93740D34E72FF3A +156: 176C652CE62212E61921B19D46ACA9BD0EBCF2FC43D6DF772E9A901619AFA7F7713585C7E83E373842DA97BFF31D80A8FD5E964DC4AB873C1C23097FE82F4784 +157: 205CE4589AF6AB2DB615C63743897B2560A24D38CFFD8C526BDA5DD58960ACA1F4708C0ABA72EECA307FD762C3799AC3D4C3644B75098CF6C95EC8FCACED897D +158: 5C527D823E0AC333C184587625B0B9BE93091F686D74C9B533567FEABA96F5F51FD617FA7209A6BFAA6D9B5AFAAD49FD6D5BEBE44EE6AA68209BBA59720DA58E +159: FD39B7C7F56BBBC8EEFE25A61512AFB25E88C0CEBBFE56B61EB6D9870DED6CB2B0E6367E80C7C3CC72B1B4B3BA11FF3B668BBB43B5BC2988241AF5C789B121AE +160: 0A1A313FE4E8AEBDC98E70BFD4E2B56F1668B894208F1018F20F0696BFDAB782322C9976CD46AD79C95106A88C1E311D8449F3BA2FD373ADF5AD58E02A38471B +161: 9C4544E0314AEAC080D762885E49ADF0805EFFB8595C2D10F15E0A8BC29AD9C63A260DA17C2AB7DC06ABFAE455BA77E10D6370F18F51F013B803EF1EE84AD4A1 +162: D66B079D283CF4502FFD2281A56523A5D44A3182F5BB83026ADABE5CD14A8B33325401C78EE89059AA79507F57FED259C491BC5FE78227773A129F612CA2142F +163: 231269F3E1F22C60CCE9A520C608DFE15F55BCF6F408B46A180B8D40171C80CE314BCA8E9231EDBFE55855A74803F5887A1F7638D05232F36C041A88CFF10B24 +164: 52FAE1659B5C0C04D98DE2A651047CD3438173BEA92142D0DB2FBDD43FBC3FF2B95535821F486732CDD3CDA9173C301495DE425288A4EF807C260EF9277CF4C5 +165: 33AB63A80D58B58AD7D7EE436C22E59AF5DFAB2E98F304623879601134EA190829AF79F76F04EACC3E22F7180ABF96EB18A72FB84B84B0D29AEC735394E05429 +166: 9CDC04D1776DAF022366ADC745F5AEEF62A0611010B4170E5170A5779CE9EA9CF8E5B11B39EF8271BDCA5432DEA2E133FC564CA98BB0547DA45FB4FAF635016A +167: F7A296CFD9E7867FB669D5D25C7BE49AF0ECF1652276A34D1BEFE1E4B07FE28C9E4ACE0604725036D2A3D9DF8496DB7E8E2576D4BC31A5DC7A97BE828B42FA1B +168: C072709657C234714202E1D2796157454FDE512FF560D60B1EE4D8B5DA26C47329AAA87E2F6AF9C57012692945E3D6E5D779E2B7C8438A601B9E7F5DCBF16638 +169: 110323177E1D773CC9B0E6A346F73006F61BF85B0A2BB388BFD1A539422240086077F56F86ABDEA4C94B07A7D5CB570E42577921AB3B79F8E7F9BF3B3AF274F5 +170: 6094ABA13E8FB244DD27BA84212E8F806B950063E0139E6BDD4F489DFF1DEA7DC4B366A5285306BB270C6FC585F46980B675CDA31B963D3BBBCA0C61FB42D7E4 +171: F46E6CBDA68B85680DEB517D550BDE3F57F9E1E339D5015864AD4D00729FB9DFD2BC24F73FC9BB7F1A890BD178404465B944942ABD41364EFB8E30277DA791D2 +172: 3FF4CFA95A3BC50FC734A00D65076A8A50154A1479848530EE6979FE06BDE85BE8543DA2A9F52C6EEDC743A5CAFECCE37D011D3188673910A4C00A63D254203D +173: 5C121A313D7AF60E49D0992A207596E4C0CE21DE701671945ED685BBA3DC37F632A1C734E649D54E9B30CA7AFE8285840BA181679354A6B1DC61264B8EE902B3 +174: 2C5566FA69861FDCA4F09661D483AA56DA00F9BB4441BB57E8ADC7FD0453215AF06FC8B35476BDC337F0B233C7FDBC7B162B2CF2A570096531539F89B8E45F51 +175: 963EA75C68C5CAC16BDC38FF42CD1F9177839FACEFFC7C69B9AC805551DDA608004453FAC71D74802242842DD597E9BDCA6CA32673A2262D7402BF9295B518CA +176: 51F956D5AD1E5000D7A0FD8F7A3F8BEF6448287E903001669CCFE20B489C17D283ACEA14AE62B035A738B8AFD75E637121B3FD2B3D9D54C2D946F39F58395CFA +177: 1E2AEA79A4117044407FCAB88D50CB5AB75BC1F7F0C2FCA98C0F7C9E20C371BEA66A0D938E556D50C182E5997C88FEC924170BA8CD82E510277B17C8A4CC1E3C +178: FA97CCF637C87407E409F583DF642364332BF609F4B6DDB473122EB2E93078C69A8FC7639D8AED31CAE3F0BAA008557E4C077A1466482E2CDD84B933A65955DE +179: 0E278A88834AF4D4BA26E53BC51E9FC897C856D626B3ADBDE9A425BC8E723DD4EE684134AC19C9E4ABC7DE47AD43301B14086966A0D78039C8C6D3A71696FB3F +180: C453F3ABB340217D8C4673400D02F5E4E878E0D6E5146E446CDD88BF5D4AE2EBBF76FBBE691E4C146E62A04E8066C2141F289FC263C7D701FDC79B936DAA6F4A +181: E7532F7E9E21DD4B721B2DABBA23453E6E02383B980E38D7D3BAA4ECC466344C811FC910E7CD913190A87FF47FB3057956988DD171AB87AE6E05F66A0FA12F1E +182: AFED63BDCC1D9657F1F55594E703A62B2069DD7E5BCF00FE3119912A748BC8793CC1309F9057B16732316ABF69EB0FD3944326FFE289C8DE6C350CF63478A76B +183: 8D18B5C68214CB23CA2D1AB5CD3B3CFCDCE41C78275B83375BC7EE5E6584C7F1F46059FE92C722AA20A2C5EBD859C3EA88B9ED958F4F1B957D4BDB8DD6419764 +184: 8D5B317D15BFACC8B838D363ABDCFF180AC3690310E4B1091E2FB45034B79A85895DA36F93E483609713F5DE10C269E333063257AEBD26A0A3D2FDFC660E9156 +185: 076F9BF8AE38CE0620BDBBF6989083C1AB6489266D53E73ACBEF45B41672CCD77CBD3DC102590764628A0680B41D6D437CC33C8091C8B06FB952B5807E451EC4 +186: 04A5D01D3A0FF1E3F85508717C87607598D931176A34A1D56BDA9F2EF39FF11A3A25E9C317BF2BBD6CCF6D6B7B6C5F87ED82E619B0FD12EDF7344E43DC4A0043 +187: B98B85AC4F3A8454FDF1FA2D82AA031BFB34293CB113998B8A216EBE371170C5ED84CE11EBE282551D528F981B493E9B0A4C75D6E6E0C9790BE3F27093E034EB +188: A40B5EFCB07B001193422D72B701BCD73AEB5DEAC274436D4EF604FB3B9A19C955B5C2523F4BE1758B2309619D0CDC44E650F4B3E2D1ABB80CE2E7525FC184CF +189: 10834D68D1C9A85BC9F79ED41DA784FFFA7F956D8DEE0C31CF44B1E86AEC64F253024CF3348021581818F3654385F726119B2AAE441758BF4765877E87831DB3 +190: 4D5AFFF97313A1519A17B964C900624CC38530620FD5089A7C4AE7D3D8777D0ED50B3F93B6D06143F87D9245A25C1EC301B815F45D88917AB64ED45C452260D3 +191: 132ABB5A3459897581E880D1A351C39434EDBFECBDFB24A519DB296D88A154B2E80393F6FA401F61339CAE10E94FD1589279D6966BB0E7A55DE99F1E289E741A +192: 9F57C4510EDAB1C435ED0010C8C4CBAFA5823E59E07E99038CB0B6375C579AA162A97202D6E68831EAF1776E7C8D1ABBD0EFEBE0EFB5EED2BB4BEA437DAEC6C0 +193: 098EC905673B190289A649E3A2816F8A25A8B2A30D3D49DC6E1501E3A27663F3C718822945B1F2E8604D7C3C841803939C34920C9D74889D0C8C02257971FFD6 +194: 47A6DD9961A5755EDF068BC00438AE837795557A0F87786120987AA8E7599726D6472476240423918EA2A923AE844E062C607962AB5A03BD0F03192911092EBE +195: DC6F64E9D54D5CC72AB2727BEF701A26B1158D6499F402779FDFA364C7BE78B7B99CD767E0CC33944ECC3B4C2F743D9B16118316AC411FD804AB211D0FCF1A58 +196: 19D0844F7779DA700D08C341E535A155E8AE4FC6D3E0D627AD9F663CC71C5AF23251ED46A0DCF1327400581037619E5307578AD161D5C7223E1C55E5896144CE +197: D7BE57844B959F7B20F052A069B2BD34E9183AD4B086862FA31118FE5892A5C41E81B0A4B7797966267CB1B3D1D8F032CB87A21A14BB13EEA131E5407A96E45A +198: F5301ACB1C9F7B98CB844F3BBC998F1FB94FB8FAE67D74818823DCEE8ADB32E1546C28913B0D404C7BC6C3A894E2EC3F9ADEBFC53488B8404E9322202DFB725C +199: EA73F31674E8B2CDB1F89AD43CF3E6083CEFB806F7E1600BA5035DCAB33D8425ACEBE9FCCD6F8A70C1DA0932534CA46F38184BA7DB7C7100B5AE77E08A136112 +200: 044E04AA24C213E528E3465653389DD2745F06A79B4D5CE0D973FA42CDE328829A5A1E79947F4D58B191C69A4867651EDA06D38568F71604723D9A69D6C48E87 +201: 72EBF5CBAE73CEC5C852166754BDF12A171CB4FAE3ACE001F46C1BCFDEC8B3FFEF3A1161FDAAE0D1CFCED019DDD02F4C3EDCE8C773FF42368FF3828CC7D5E2D5 +202: 19B95D500A97E2C7F49199BB3EA702B607170E64A86520A527BEB2EE7D4D92CC5979067C021DCEDCC12B06AA607BD293CAE860E4CE3D1808443AD2F5AE5E10AE +203: 292D2C9D68C070682122E9906F1B354A8ED8A5C0FF8848C2639567FE4B4F5EB5DDAA253D57A2DAC07416ED851EB09D9E10225ED9F6EAF109398585C21D59CB9F +204: B53471C16E8E440E01173A628C159973D6B4570F567B72ECB2D6B14F2BD5AFB7898DD43DEA64107AAC08EAECE57F826A0F61231D82AC031D6B47E1F96C9A8630 +205: ADB1943433C931E95BFED5F91CBB90BF28A0C51FCD9F8FF393873AC3898646D9BEF539B042C3636BBCF171D3057280B9CA0189716225A93CA5431DD46862BDE6 +206: FCAA4459DA339659B8755357F0BA879534EEDC1A615C66FAE37B21EDEC349979EF67005F368DBD4BDB7D84F6A47273A416525390BB3CA4198ADB93CB29324EE1 +207: 97C8A96CDF16CFBFD7502E0840B79A17E419A0ABDDF8334F6D8588C948A634D7350A9F5E3596BA2BA786274B836BF126DFF7DE141C2746A1D9D4E00743F9575C +208: 15A8C79D16036940E487AF3FA634A94279570D9ADF6029026C6234CAE46455B19A52278C37C1F60EA1836FE8200746B3DED1963DCBCD204F43F1925709D94150 +209: 8E3368C8D4146AC186407AA8CABF9DBB913375FE5C9729F28503D6AAA2898F4B9DB6CE6D6DDFC31DF33D190F4F9A764C63D4843525E01086D8DF202AC6A7BAAF +210: 27FC876DB0C9AB45A8F6F3E7660C9BC93183F0DE22E99ED08B8DF45F18AE52A4B25187B899BF069E5B85E8BBF616F9A5DC5EF8EF42E12E24B4141E17CE726EB6 +211: 3DF7239C5549BF2FF377786B45DC9A6349BAE893ACD7C1B515D44402519C9904A6303A30FB7EA86F4B77D32ED3AFD7D49926E33450126DCEA0674B647FD7623F +212: 2C9742F4A2A1C5D5753FE03A1D95ABD416A91D65764F4E94791DEC2396A2B740F4818872C3C0002671BD5E0B30A5EE5FE5EE13A42887BC2A91A282BD40E4F407 +213: F76D04AC19BD3ED5ABA28613CFBF67DC455D6565A430636A52B9A6712E6E1D7569F0C2E6136332611F07A38952CA81ADB4E05F6EFABCB12B7E28BE90A6EA8DC9 +214: 1DFA23847A63F7B4C797A46C5927ACA615764751428FC92963F53FD4E0DDD36AF575C5B50098243843A40A981FD15A020C392F5A8EC54F4894C749C97F55B843 +215: 635E02E96D9E05F2BC172B1328BD2E1806886C0681A0EEFACC554E99CA604549B6A561E8D04DA70D381CC7736F3D0A00D029F35F9DD99587216D267FB9AB5872 +216: 2B0C2461BF89765F2F7D9F6196EBD4CE2651C2091C1B4BBB1B53B94EADB6B18A92B12CE5D9A64211F0A26B0856356A86552CEC95D144297ACE4748DCA02169DF +217: 81586A97406CFE0ADB0732FA751776C7873B3634C72FDE1B0611A2F0D3636F984AA1FE956A29E4D00AFE39F8D2BCAB8C1530FE53204F23B0BA448AF8A66410D3 +218: DFC2F01251AB3342731144B4108468FB53C746C2EB98F6B4A5C0F147DB6082822B3FB929E4231DF27EDE7B0860BDEEEE3633AE2293820DFBB548715A9C2AFD46 +219: A1FBB95CEBC644D11E871468CA758B89380EBCA5E8075CFC448D9A9B14E7AC53C2B794D92009B9432AC2865D4D04113B9FA5C73FBDE17E7B5F65F7354C0CE7A6 +220: D956C6618AEBDF6A0EDF28120AB2C428A173BCC4D07D05364892CF1C668385A9C3C0918CD62F6701D358FCB353831399E4AD069E0A207B0A7E6F97A0B1E4DD16 +221: 01CB20694C6DB1F96C1C95E1A4AE6090D15C60B1459866DE81AA9E2091F7EF2A05EC0069D3BDA71A84C02F3598AA2A5162CCDA0C123835E079C35123CAA9A030 +222: F7BDC78E1A7C12BDD0E2897774064B622AED64F822BEC805ED1184F9B7F342CC78F633BD8F31FFEE3F03CDA55087DAB88D9A28E635CAA18419CB5D5B9B9D4565 +223: 2DC8859E504903EE3EA0760E869866A319EE0CBA8F0F463882160FE1D68B43ABD93E61428FE9844014EED1C27214899B7A05E38648BBFB3AF7EFC489A9FCB2F2 +224: 199CBDA125FA02137EBDCEECF580A737F5AABD811956B6B56536C22070BDC6CA18CE6B8657BCD36C681DB6E3CDDE6F6F2B7F2D756C8080B33A07ED299C48ED8D +225: 38B7812743D6F54A62D25B8AABA1A48126E53B433876071C36F46F1096869CED217BF321DA782D531A5E6129352BEF5F5C093E148B4CC919F5A1C95CF445AA38 +226: 3BE4639A823298AEEDDDC344DE703F521EF7DA38CF721CD67340B4B479F625AA9D5054B9CC252E43C81E5D3FAA97395C7CFF6AFB02E55C1552AA6DE1B0659163 +227: 140FE13EE668C69E3B35E480FB143231EFCF2588CFEB1A948F1250DBA4070DD1F9ED74DADCCC77E0FF9449DDFCDD15A2C47F53F826D0A52C2FD2B23145A4A2F5 +228: 1EC897C52268FFBC665BB1E9B9100528142BE097C3D46AB40721A6F3D2DE9E8B458CE16825DEF61E6789C99FD77E508699B0E4545BF698F0605C2D0267D25B26 +229: 3EDDB754D74136489698B1E31BB05CF46B7B764A85E7CE7AA420951349DCD6DF098E3A09FD83B3998BA966A922EC12185A15472E90DD87A0C15CCA83D248750D +230: E1B2A0B946BFE06417B8AA9160E1C0A536B36D6FD73F2F679546ADF12B9E961E227E31BE639E85355E9D6DCAEAF13D3B5DE0B6A558F80EA63F05244BC8E8667F +231: 425B3A65D79F68FD1CBAF3DF920B9105BD2EE58D07B8A16C4612895B5E9CBE2E9281BF6388AD46D9580CEE2035A3079276A1FAFF3F15A243A4ABCE2655EDFB56 +232: 7729C8D1CDB7BF9D87574CC2BAE4CD83EDE031951C921B641F69B4A04A2E887E3A8DB5074CA6A2DBA43F59A088B2499D7DF53D7B72ADF7EF748DFB2A20B6C0E7 +233: 071C8547CB5D6F2CAB46B0FBD4E9F52500889BEBC00D424086572D9A6E287E7149919EE583F8448B25341CD0519A3482F890FBC77F535C02E6903A6CA298AD7F +234: 4858F57CE77A14D656B21B83A9B153D3704A4B48CE4A261BF7C0B3B3CB9B3A5A390827B74C45613B5027C88E8BB7DE71A0876CA7AEAFEA5791B320351FC40B4C +235: 2C7AFE2F8990C918E5758561C75FBF617CE30BDA4CEAE5FD2E1813A1CF49EA0380C95ED0A2F3C109707FC5D3308C9BCBC7ED24DE7C503599CEE10CCBD9E5EC22 +236: 40181A5C896868AF8537693C80FDE0C85D994934E83D9248943B4CFF3323C57167125C4AAECB56F2A1FA74D45850604B0DEAD97B73582CABA52B5EE453056503 +237: 5E396BEA1E085341E14E67319FAF16BC0CFD8AE103650132166DFBFCEA6E52C93D16869BCBB15306E4B8136D2002F18979962A6AF51694BA2541E6E4ACBF24BE +238: DA85B5AF094D2748D4C6297F4241AF6906AE9C76A11E8F93DB0D789738594F2EAF1FD61F40A50FD68F19A4773E363FE137AE9B28ED8EB6130070482960208152 +239: 8208544F38490752C209C1816B6F39E3F6A402AEC41787A800C3208717CB165BDAD86A95E0A4380E432450080E7F19BD0BB51B006D154E5586DDD011346E1AB4 +240: 2A531C5E4B10985C870386C548D88F6E71703EAA6B071E035DED8FAD7C87CA839B59CA77B8A598CA3034E61D38F7107293726D2343B94D49B4D7E1EEFB8B2F08 +241: 07051CD7EECBFA592D4A4793EB7C24470AF6A7B35961909C6218D0D67FF464B2F793AA91AE19599D542E47CA3B05345630EC679153607C44E82F22F875753ACF +242: 31D175CBDE13877D899E57BA99C2338444017D800DB7BE90F57B366BD2B68BCB375574E24F84E60D86C923B2D1A291B7B57E0DDE99E4E110E4DE95A140219CA0 +243: 0AFA92679D7A96F42CC4C512E015D5DFC42B0536D03325093861E52A14FF8AE1B80EDF79B37B55D16057A063E3565AE95270DF1F28092628F72E705A8FA1BFC1 +244: 7CE302D1B173E3F4A7BC850527CFD9765683DFE5BC5F5CFDAC70B26FCAB845DDFEF25488057F69559914382293E44E0380907A7B8820C90436611CB57C9C823F +245: 0DC690FB1154C7C9320CEC47B57301E57EB8E27E7F28ECB3DF94F2535F9CC36878B10CBFBF3000F4953E0745D51FA49332914631FF74FDBB54FB609FF98D2CA1 +246: 93BC37F267410E084F7BFEE3A8637772A685C73C8E26733E7B65070EA1DCC0661EF258199799FBE556987DF4F617470709A572608707FE04F9809C02FA6CECA9 +247: C9B2A72F89C133746A0AA2EDF12760A4804CB1713FCCA77823616BC0BD1D1DE976B0508DF15DA2E73B05C3288A3C558915581C6C5AE010D33D7B0A7C55864C84 +248: A2AC76E9900DF987230DD95C34F527761C878935BC70F15C6B1943C659E60182972565697072A7DC8BD7DF49A289509A00E7A87BADFF2316C5BC01E6E829D566 +249: E0E71A27FC2D63D6A3E0ED04390CC8AD0DB1EB6C377FD0AB882C0488D7DF36EE7F37E82907F8B27D259EC8CD65042D5383B1A143326FD99EA942D19DE0E67E2B +250: 08FAAECC5576E944DA606C17298FD6C76203DC6844136616D0C7F7CE77FE20ED4FC2F116680F6C1A9CA4D03A1903E2D463E8CA9734ADB791FB2D1A7E133FDA7D +251: A814121E45B50CF231AB7A787758776674172D6217DAF043E23B31E5D325C76BAB2C18F3076BD0A974EFA1C45641A264C6A7FBC342470D4C15E4184986C29323 +252: 724DF6BB5B2F73A21C18C6E0E623A2CD742E86251A29676475840AB85527059000C3471A961C5562E2DC3F5CB45E798C9A78CEEEF528CD4E27610517B2FEB304 +253: 5EDA70685C01EA6A98FB1A25F201C6433E3422CA59EE34D71A7AC1BB6914369CCA1801A22F5106815ED737375F6D9C87DF58AF222C14F5D4CFCC43E569DAECA9 +254: 4DF2050321CC654EE71A1A8CEC9A7E31E6E9CA6A2AA22E5513202C349E536B33E57EEA41D851D833A842935F1884DB41BEF079756737107D8C85BBE3A4DD50D8 +255: C978E9D3849490CF7A8E49B108275B2A65F5A4D60FFBD500ABF75DA3DF0C169EB3E37D17C34A3C82C5825FEF660E96440EDBE0D2208190EC61F86FAA4D8A1D3D +256: 22F5E401B8D1AE517FDA2C9791972FDD925623F338CB8167722B899B2348A0ED8AE87AEA36DE3DD44394D0ED9217D6A8F91CF218A92E1409097F39FAB199B74C + HMAC-rmd128 0: E9BF401EB338AE9ECE9F2DE9CC104A5C 1: 9536B19B029E60F979B3A6B3052685BE diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c new file mode 100644 index 000000000..fbe12df11 --- /dev/null +++ b/src/hashes/sha3.c @@ -0,0 +1,298 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* based on https://github.com/brainhub/SHA3IUF (public domain) */ + +#include "tomcrypt.h" + +#ifdef LTC_SHA3 + +const struct ltc_hash_descriptor sha3_224_desc = +{ + "sha3_224", /* name of hash */ + 17, /* internal ID */ + 28, /* Size of digest in octets */ + 128, /* Input block size in octets */ + { 2,16,840,1,101,3,4,2,7 }, /* ASN.1 OID */ + 9, /* Length OID */ + &sha3_224_init, + &sha3_process, + &sha3_done, + &sha3_224_test, + NULL +}; + +const struct ltc_hash_descriptor sha3_256_desc = +{ + "sha3_256", /* name of hash */ + 18, /* internal ID */ + 32, /* Size of digest in octets */ + 128, /* Input block size in octets */ + { 2,16,840,1,101,3,4,2,8 }, /* ASN.1 OID */ + 9, /* Length OID */ + &sha3_256_init, + &sha3_process, + &sha3_done, + &sha3_256_test, + NULL +}; + +const struct ltc_hash_descriptor sha3_384_desc = +{ + "sha3_384", /* name of hash */ + 19, /* internal ID */ + 48, /* Size of digest in octets */ + 128, /* Input block size in octets */ + { 2,16,840,1,101,3,4,2,9 }, /* ASN.1 OID */ + 9, /* Length OID */ + &sha3_384_init, + &sha3_process, + &sha3_done, + &sha3_384_test, + NULL +}; + +const struct ltc_hash_descriptor sha3_512_desc = +{ + "sha3_512", /* name of hash */ + 20, /* internal ID */ + 64, /* Size of digest in octets */ + 128, /* Input block size in octets */ + { 2,16,840,1,101,3,4,2,10 }, /* ASN.1 OID */ + 9, /* Length OID */ + &sha3_512_init, + &sha3_process, + &sha3_done, + &sha3_512_test, + NULL +}; + +#define SHA3_KECCAK_SPONGE_WORDS 25 /* 1600 bits > 200 bytes > 25 x ulong64 */ +#define SHA3_KECCAK_ROUNDS 24 + +static const ulong64 keccakf_rndc[24] = { + CONST64(0x0000000000000001), CONST64(0x0000000000008082), + CONST64(0x800000000000808a), CONST64(0x8000000080008000), + CONST64(0x000000000000808b), CONST64(0x0000000080000001), + CONST64(0x8000000080008081), CONST64(0x8000000000008009), + CONST64(0x000000000000008a), CONST64(0x0000000000000088), + CONST64(0x0000000080008009), CONST64(0x000000008000000a), + CONST64(0x000000008000808b), CONST64(0x800000000000008b), + CONST64(0x8000000000008089), CONST64(0x8000000000008003), + CONST64(0x8000000000008002), CONST64(0x8000000000000080), + CONST64(0x000000000000800a), CONST64(0x800000008000000a), + CONST64(0x8000000080008081), CONST64(0x8000000000008080), + CONST64(0x0000000080000001), CONST64(0x8000000080008008) +}; + +static const unsigned keccakf_rotc[24] = { + 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14, 27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44 +}; + +static const unsigned keccakf_piln[24] = { + 10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4, 15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1 +}; + +static void keccakf(ulong64 s[25]) +{ + int i, j, round; + ulong64 t, bc[5]; + + for(round = 0; round < SHA3_KECCAK_ROUNDS; round++) { + /* Theta */ + for(i = 0; i < 5; i++) + bc[i] = s[i] ^ s[i + 5] ^ s[i + 10] ^ s[i + 15] ^ s[i + 20]; + + for(i = 0; i < 5; i++) { + t = bc[(i + 4) % 5] ^ ROL64(bc[(i + 1) % 5], 1); + for(j = 0; j < 25; j += 5) + s[j + i] ^= t; + } + /* Rho Pi */ + t = s[1]; + for(i = 0; i < 24; i++) { + j = keccakf_piln[i]; + bc[0] = s[j]; + s[j] = ROL64(t, keccakf_rotc[i]); + t = bc[0]; + } + /* Chi */ + for(j = 0; j < 25; j += 5) { + for(i = 0; i < 5; i++) + bc[i] = s[j + i]; + for(i = 0; i < 5; i++) + s[j + i] ^= (~bc[(i + 1) % 5]) & bc[(i + 2) % 5]; + } + /* Iota */ + s[0] ^= keccakf_rndc[round]; + } +} + +/* Public Inteface */ + +int sha3_224_init(hash_state *md) +{ + LTC_ARGCHK(md != NULL); + XMEMSET(&md->sha3, 0, sizeof(md->sha3)); + md->sha3.capacity_words = 2 * 224 / (8 * sizeof(ulong64)); + return CRYPT_OK; +} + +int sha3_256_init(hash_state *md) +{ + LTC_ARGCHK(md != NULL); + XMEMSET(&md->sha3, 0, sizeof(md->sha3)); + md->sha3.capacity_words = 2 * 256 / (8 * sizeof(ulong64)); + return CRYPT_OK; +} + +int sha3_384_init(hash_state *md) +{ + LTC_ARGCHK(md != NULL); + XMEMSET(&md->sha3, 0, sizeof(md->sha3)); + md->sha3.capacity_words = 2 * 384 / (8 * sizeof(ulong64)); + return CRYPT_OK; +} + +int sha3_512_init(hash_state *md) +{ + LTC_ARGCHK(md != NULL); + XMEMSET(&md->sha3, 0, sizeof(md->sha3)); + md->sha3.capacity_words = 2 * 512 / (8 * sizeof(ulong64)); + return CRYPT_OK; +} + +int sha3_shake_init(hash_state *md, int num) +{ + LTC_ARGCHK(md != NULL); + if (num != 128 && num != 256) return CRYPT_INVALID_ARG; + XMEMSET(&md->sha3, 0, sizeof(md->sha3)); + md->sha3.capacity_words = 2 * num / (8 * sizeof(ulong64)); + return CRYPT_OK; +} + +int sha3_process(hash_state *md, const unsigned char *in, unsigned long inlen) +{ + /* 0...7 -- how much is needed to have a word */ + unsigned old_tail = (8 - md->sha3.byte_index) & 7; + + unsigned long words; + unsigned tail; + unsigned long i; + + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(in != NULL); + + if(inlen < old_tail) { /* have no complete word or haven't started the word yet */ + while (inlen--) md->sha3.saved |= (ulong64) (*(in++)) << ((md->sha3.byte_index++) * 8); + return CRYPT_OK; + } + + if(old_tail) { /* will have one word to process */ + inlen -= old_tail; + while (old_tail--) md->sha3.saved |= (ulong64) (*(in++)) << ((md->sha3.byte_index++) * 8); + /* now ready to add saved to the sponge */ + md->sha3.s[md->sha3.word_index] ^= md->sha3.saved; + md->sha3.byte_index = 0; + md->sha3.saved = 0; + if(++md->sha3.word_index == (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words)) { + keccakf(md->sha3.s); + md->sha3.word_index = 0; + } + } + + /* now work in full words directly from input */ + words = inlen / sizeof(ulong64); + tail = inlen - words * sizeof(ulong64); + + for(i = 0; i < words; i++, in += sizeof(ulong64)) { + ulong64 t; + LOAD64L(t, in); + md->sha3.s[md->sha3.word_index] ^= t; + if(++md->sha3.word_index == (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words)) { + keccakf(md->sha3.s); + md->sha3.word_index = 0; + } + } + + /* finally, save the partial word */ + while (tail--) { + md->sha3.saved |= (ulong64) (*(in++)) << ((md->sha3.byte_index++) * 8); + } + return CRYPT_OK; +} + +int sha3_done(hash_state *md, unsigned char *hash) +{ + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(hash != NULL); + + md->sha3.s[md->sha3.word_index] ^= (md->sha3.saved ^ (CONST64(0x06) << (md->sha3.byte_index * 8))); + md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); + keccakf(md->sha3.s); + +#ifndef ENDIAN_LITTLE + { + unsigned i; + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); + const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); + STORE32L(t1, md->sha3.sb + i * 8); + STORE32L(t2, md->sha3.sb + i * 8 + 4); + } + } +#endif + + XMEMCPY(hash, md->sha3.sb, md->sha3.capacity_words * 4); + return CRYPT_OK; +} + +int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) +{ + unsigned long i = 0; + /* sha3_shake_done can be called many times */ + + if (outlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(out != NULL); + + if (!md->sha3.xof_flag) { + /* shake_xof operation must be done only once */ + md->sha3.s[md->sha3.word_index] ^= (md->sha3.saved ^ (CONST64(0x1F) << (md->sha3.byte_index * 8))); + md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); + keccakf(md->sha3.s); + md->sha3.byte_index = 0; + md->sha3.xof_flag = 1; + } + + while (i < outlen) { + if(md->sha3.byte_index >= (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words) * 8) { + keccakf(md->sha3.s); + md->sha3.byte_index = 0; + } + out[i++] = md->sha3.sb[md->sha3.byte_index++]; + } + return CRYPT_OK; +} + +int sha3_shake_memory(int num, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen) +{ + hash_state md; + int err; + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + if ((err = sha3_shake_init(&md, num)) != CRYPT_OK) return err; + if ((err = sha3_shake_process(&md, in, inlen)) != CRYPT_OK) return err; + if ((err = sha3_shake_done(&md, out, *outlen)) != CRYPT_OK) return err; + return CRYPT_OK; +} + +#endif diff --git a/src/hashes/sha3_test.c b/src/hashes/sha3_test.c new file mode 100644 index 000000000..b4b3d8d4a --- /dev/null +++ b/src/hashes/sha3_test.c @@ -0,0 +1,420 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* based on https://github.com/brainhub/SHA3IUF (public domain) */ + +#include "tomcrypt.h" + +#ifdef LTC_SHA3 + +int sha3_224_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned char buf[200], hash[200]; + int i; + hash_state c; + const unsigned char c1 = 0xa3; + + const unsigned char sha3_224_empty[224 / 8] = { + 0x6b, 0x4e, 0x03, 0x42, 0x36, 0x67, 0xdb, 0xb7, + 0x3b, 0x6e, 0x15, 0x45, 0x4f, 0x0e, 0xb1, 0xab, + 0xd4, 0x59, 0x7f, 0x9a, 0x1b, 0x07, 0x8e, 0x3f, + 0x5b, 0x5a, 0x6b, 0xc7 + }; + + const unsigned char sha3_224_0xa3_200_times[224 / 8] = { + 0x93, 0x76, 0x81, 0x6a, 0xba, 0x50, 0x3f, 0x72, + 0xf9, 0x6c, 0xe7, 0xeb, 0x65, 0xac, 0x09, 0x5d, + 0xee, 0xe3, 0xbe, 0x4b, 0xf9, 0xbb, 0xc2, 0xa1, + 0xcb, 0x7e, 0x11, 0xe0 + }; + + XMEMSET(buf, c1, sizeof(buf)); + + /* SHA3-224 on an empty buffer */ + sha3_224_init(&c); + sha3_done(&c, hash); + if(XMEMCMP(sha3_224_empty, hash, sizeof(sha3_224_empty)) != 0) { + printf("SHA3-224() failed\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-224 in two steps. [FIPS 202] */ + sha3_224_init(&c); + sha3_process(&c, buf, sizeof(buf) / 2); + sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); + sha3_done(&c, hash); + if(XMEMCMP(sha3_224_0xa3_200_times, hash, sizeof(sha3_224_0xa3_200_times)) != 0) { + printf("SHA3-224( 0xa3 ... [200 times] ) failed (2 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-224 byte-by-byte: 200 steps. [FIPS 202] */ + i = 200; + sha3_224_init(&c); + while (i--) { + sha3_process(&c, &c1, 1); + } + sha3_done(&c, hash); + if(XMEMCMP(sha3_224_0xa3_200_times, hash, sizeof(sha3_224_0xa3_200_times)) != 0) { + printf("SHA3-224( 0xa3 ... [200 times] ) failed (200 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + return CRYPT_OK; +#endif +} + +int sha3_256_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned char buf[200], hash[200]; + int i; + hash_state c; + const unsigned char c1 = 0xa3; + + const unsigned char sha3_256_empty[256 / 8] = { + 0xa7, 0xff, 0xc6, 0xf8, 0xbf, 0x1e, 0xd7, 0x66, + 0x51, 0xc1, 0x47, 0x56, 0xa0, 0x61, 0xd6, 0x62, + 0xf5, 0x80, 0xff, 0x4d, 0xe4, 0x3b, 0x49, 0xfa, + 0x82, 0xd8, 0x0a, 0x4b, 0x80, 0xf8, 0x43, 0x4a + }; + const unsigned char sha3_256_0xa3_200_times[256 / 8] = { + 0x79, 0xf3, 0x8a, 0xde, 0xc5, 0xc2, 0x03, 0x07, + 0xa9, 0x8e, 0xf7, 0x6e, 0x83, 0x24, 0xaf, 0xbf, + 0xd4, 0x6c, 0xfd, 0x81, 0xb2, 0x2e, 0x39, 0x73, + 0xc6, 0x5f, 0xa1, 0xbd, 0x9d, 0xe3, 0x17, 0x87 + }; + + XMEMSET(buf, c1, sizeof(buf)); + + /* SHA3-256 on an empty buffer */ + sha3_256_init(&c); + sha3_done(&c, hash); + if(XMEMCMP(sha3_256_empty, hash, sizeof(sha3_256_empty)) != 0) { + printf("SHA3-256() failed\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-256 as a single buffer. [FIPS 202] */ + sha3_256_init(&c); + sha3_process(&c, buf, sizeof(buf)); + sha3_done(&c, hash); + if(XMEMCMP(sha3_256_0xa3_200_times, hash, sizeof(sha3_256_0xa3_200_times)) != 0) { + printf("SHA3-256( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-256 in two steps. [FIPS 202] */ + sha3_256_init(&c); + sha3_process(&c, buf, sizeof(buf) / 2); + sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); + sha3_done(&c, hash); + if(XMEMCMP(sha3_256_0xa3_200_times, hash, sizeof(sha3_256_0xa3_200_times)) != 0) { + printf("SHA3-256( 0xa3 ... [200 times] ) failed (2 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-256 byte-by-byte: 200 steps. [FIPS 202] */ + i = 200; + sha3_256_init(&c); + while (i--) { + sha3_process(&c, &c1, 1); + } + sha3_done(&c, hash); + if(XMEMCMP(sha3_256_0xa3_200_times, hash, sizeof(sha3_256_0xa3_200_times)) != 0) { + printf("SHA3-256( 0xa3 ... [200 times] ) failed (200 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-256 byte-by-byte: 135 bytes. Input from [Keccak]. Output + * matched with sha3sum. */ + sha3_256_init(&c); + sha3_process(&c, (unsigned char*) + "\xb7\x71\xd5\xce\xf5\xd1\xa4\x1a" + "\x93\xd1\x56\x43\xd7\x18\x1d\x2a" + "\x2e\xf0\xa8\xe8\x4d\x91\x81\x2f" + "\x20\xed\x21\xf1\x47\xbe\xf7\x32" + "\xbf\x3a\x60\xef\x40\x67\xc3\x73" + "\x4b\x85\xbc\x8c\xd4\x71\x78\x0f" + "\x10\xdc\x9e\x82\x91\xb5\x83\x39" + "\xa6\x77\xb9\x60\x21\x8f\x71\xe7" + "\x93\xf2\x79\x7a\xea\x34\x94\x06" + "\x51\x28\x29\x06\x5d\x37\xbb\x55" + "\xea\x79\x6f\xa4\xf5\x6f\xd8\x89" + "\x6b\x49\xb2\xcd\x19\xb4\x32\x15" + "\xad\x96\x7c\x71\x2b\x24\xe5\x03" + "\x2d\x06\x52\x32\xe0\x2c\x12\x74" + "\x09\xd2\xed\x41\x46\xb9\xd7\x5d" + "\x76\x3d\x52\xdb\x98\xd9\x49\xd3" + "\xb0\xfe\xd6\xa8\x05\x2f\xbb", 1080 / 8); + sha3_done(&c, hash); + if(XMEMCMP(hash, "\xa1\x9e\xee\x92\xbb\x20\x97\xb6" + "\x4e\x82\x3d\x59\x77\x98\xaa\x18" + "\xbe\x9b\x7c\x73\x6b\x80\x59\xab" + "\xfd\x67\x79\xac\x35\xac\x81\xb5", 256 / 8) != 0) { + printf("SHA3-256( b771 ... ) doesn't match the known answer\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + return CRYPT_OK; +#endif +} + +int sha3_384_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned char buf[200], hash[200]; + int i; + hash_state c; + const unsigned char c1 = 0xa3; + + const unsigned char sha3_384_0xa3_200_times[384 / 8] = { + 0x18, 0x81, 0xde, 0x2c, 0xa7, 0xe4, 0x1e, 0xf9, + 0x5d, 0xc4, 0x73, 0x2b, 0x8f, 0x5f, 0x00, 0x2b, + 0x18, 0x9c, 0xc1, 0xe4, 0x2b, 0x74, 0x16, 0x8e, + 0xd1, 0x73, 0x26, 0x49, 0xce, 0x1d, 0xbc, 0xdd, + 0x76, 0x19, 0x7a, 0x31, 0xfd, 0x55, 0xee, 0x98, + 0x9f, 0x2d, 0x70, 0x50, 0xdd, 0x47, 0x3e, 0x8f + }; + + XMEMSET(buf, c1, sizeof(buf)); + + /* SHA3-384 as a single buffer. [FIPS 202] */ + sha3_384_init(&c); + sha3_process(&c, buf, sizeof(buf)); + sha3_done(&c, hash); + if(XMEMCMP(sha3_384_0xa3_200_times, hash, sizeof(sha3_384_0xa3_200_times)) != 0) { + printf("SHA3-384( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-384 in two steps. [FIPS 202] */ + sha3_384_init(&c); + sha3_process(&c, buf, sizeof(buf) / 2); + sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); + sha3_done(&c, hash); + if(XMEMCMP(sha3_384_0xa3_200_times, hash, sizeof(sha3_384_0xa3_200_times)) != 0) { + printf("SHA3-384( 0xa3 ... [200 times] ) failed (2 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-384 byte-by-byte: 200 steps. [FIPS 202] */ + i = 200; + sha3_384_init(&c); + while (i--) { + sha3_process(&c, &c1, 1); + } + sha3_done(&c, hash); + if(XMEMCMP(sha3_384_0xa3_200_times, hash, sizeof(sha3_384_0xa3_200_times)) != 0) { + printf("SHA3-384( 0xa3 ... [200 times] ) failed (200 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + return CRYPT_OK; +#endif +} + +int sha3_512_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned char buf[200], hash[200]; + int i; + hash_state c; + const unsigned char c1 = 0xa3; + + const unsigned char sha3_512_0xa3_200_times[512 / 8] = { + 0xe7, 0x6d, 0xfa, 0xd2, 0x20, 0x84, 0xa8, 0xb1, + 0x46, 0x7f, 0xcf, 0x2f, 0xfa, 0x58, 0x36, 0x1b, + 0xec, 0x76, 0x28, 0xed, 0xf5, 0xf3, 0xfd, 0xc0, + 0xe4, 0x80, 0x5d, 0xc4, 0x8c, 0xae, 0xec, 0xa8, + 0x1b, 0x7c, 0x13, 0xc3, 0x0a, 0xdf, 0x52, 0xa3, + 0x65, 0x95, 0x84, 0x73, 0x9a, 0x2d, 0xf4, 0x6b, + 0xe5, 0x89, 0xc5, 0x1c, 0xa1, 0xa4, 0xa8, 0x41, + 0x6d, 0xf6, 0x54, 0x5a, 0x1c, 0xe8, 0xba, 0x00 + }; + + XMEMSET(buf, c1, sizeof(buf)); + + /* SHA3-512 as a single buffer. [FIPS 202] */ + sha3_512_init(&c); + sha3_process(&c, buf, sizeof(buf)); + sha3_done(&c, hash); + if(XMEMCMP(sha3_512_0xa3_200_times, hash, sizeof(sha3_512_0xa3_200_times)) != 0) { + printf("SHA3-512( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-512 in two steps. [FIPS 202] */ + sha3_512_init(&c); + sha3_process(&c, buf, sizeof(buf) / 2); + sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); + sha3_done(&c, hash); + if(XMEMCMP(sha3_512_0xa3_200_times, hash, sizeof(sha3_512_0xa3_200_times)) != 0) { + printf("SHA3-512( 0xa3 ... [200 times] ) failed (2 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHA3-512 byte-by-byte: 200 steps. [FIPS 202] */ + i = 200; + sha3_512_init(&c); + while (i--) { + sha3_process(&c, &c1, 1); + } + sha3_done(&c, hash); + if(XMEMCMP(sha3_512_0xa3_200_times, hash, sizeof(sha3_512_0xa3_200_times)) != 0) { + printf("SHA3-512( 0xa3 ... [200 times] ) failed (200 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + return CRYPT_OK; +#endif +} + +int sha3_shake_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned char buf[200], hash[512]; + int i; + hash_state c; + const unsigned char c1 = 0xa3; + unsigned long len; + + const unsigned char shake256_empty[32] = { + 0xab, 0x0b, 0xae, 0x31, 0x63, 0x39, 0x89, 0x43, + 0x04, 0xe3, 0x58, 0x77, 0xb0, 0xc2, 0x8a, 0x9b, + 0x1f, 0xd1, 0x66, 0xc7, 0x96, 0xb9, 0xcc, 0x25, + 0x8a, 0x06, 0x4a, 0x8f, 0x57, 0xe2, 0x7f, 0x2a + }; + const unsigned char shake256_0xa3_200_times[32] = { + 0x6a, 0x1a, 0x9d, 0x78, 0x46, 0x43, 0x6e, 0x4d, + 0xca, 0x57, 0x28, 0xb6, 0xf7, 0x60, 0xee, 0xf0, + 0xca, 0x92, 0xbf, 0x0b, 0xe5, 0x61, 0x5e, 0x96, + 0x95, 0x9d, 0x76, 0x71, 0x97, 0xa0, 0xbe, 0xeb + }; + const unsigned char shake128_empty[32] = { + 0x43, 0xe4, 0x1b, 0x45, 0xa6, 0x53, 0xf2, 0xa5, + 0xc4, 0x49, 0x2c, 0x1a, 0xdd, 0x54, 0x45, 0x12, + 0xdd, 0xa2, 0x52, 0x98, 0x33, 0x46, 0x2b, 0x71, + 0xa4, 0x1a, 0x45, 0xbe, 0x97, 0x29, 0x0b, 0x6f + }; + const unsigned char shake128_0xa3_200_times[32] = { + 0x44, 0xc9, 0xfb, 0x35, 0x9f, 0xd5, 0x6a, 0xc0, + 0xa9, 0xa7, 0x5a, 0x74, 0x3c, 0xff, 0x68, 0x62, + 0xf1, 0x7d, 0x72, 0x59, 0xab, 0x07, 0x52, 0x16, + 0xc0, 0x69, 0x95, 0x11, 0x64, 0x3b, 0x64, 0x39 + }; + + XMEMSET(buf, c1, sizeof(buf)); + + /* SHAKE256 on an empty buffer */ + sha3_shake_init(&c, 256); + for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ + if(XMEMCMP(shake256_empty, hash, sizeof(shake256_empty)) != 0) { + printf("SHAKE256('') failed\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE256 via sha3_shake_memory [FIPS 202] */ + len = 512; + sha3_shake_memory(256, buf, sizeof(buf), hash, &len); + if(XMEMCMP(shake256_0xa3_200_times, hash + 480, sizeof(shake256_0xa3_200_times)) != 0) { + printf("SHAKE256( 0xa3 ... [200 times] ) failed (sha3_shake_memory)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE256 as a single buffer. [FIPS 202] */ + sha3_shake_init(&c, 256); + sha3_shake_process(&c, buf, sizeof(buf)); + for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ + if(XMEMCMP(shake256_0xa3_200_times, hash, sizeof(shake256_0xa3_200_times)) != 0) { + printf("SHAKE256( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE256 in two steps. [FIPS 202] */ + sha3_shake_init(&c, 256); + sha3_shake_process(&c, buf, sizeof(buf) / 2); + sha3_shake_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); + for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ + if(XMEMCMP(shake256_0xa3_200_times, hash, sizeof(shake256_0xa3_200_times)) != 0) { + printf("SHAKE256( 0xa3 ... [200 times] ) failed (2 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE256 byte-by-byte: 200 steps. [FIPS 202] */ + i = 200; + sha3_shake_init(&c, 256); + while (i--) sha3_shake_process(&c, &c1, 1); + for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ + if(XMEMCMP(shake256_0xa3_200_times, hash, sizeof(shake256_0xa3_200_times)) != 0) { + printf("SHAKE256( 0xa3 ... [200 times] ) failed (200 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE128 on an empty buffer */ + sha3_shake_init(&c, 128); + for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ + if(XMEMCMP(shake128_empty, hash, sizeof(shake128_empty)) != 0) { + printf("SHAKE128() failed\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE128 via sha3_shake_memory [FIPS 202] */ + len = 512; + sha3_shake_memory(128, buf, sizeof(buf), hash, &len); + if(XMEMCMP(shake128_0xa3_200_times, hash + 480, sizeof(shake128_0xa3_200_times)) != 0) { + printf("SHAKE128( 0xa3 ... [200 times] ) failed (sha3_shake_memory)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE128 as a single buffer. [FIPS 202] */ + sha3_shake_init(&c, 128); + sha3_shake_process(&c, buf, sizeof(buf)); + for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ + if(XMEMCMP(shake128_0xa3_200_times, hash, sizeof(shake128_0xa3_200_times)) != 0) { + printf("SHAKE128( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE128 in two steps. [FIPS 202] */ + sha3_shake_init(&c, 128); + sha3_shake_process(&c, buf, sizeof(buf) / 2); + sha3_shake_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); + for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ + if(XMEMCMP(shake128_0xa3_200_times, hash, sizeof(shake128_0xa3_200_times)) != 0) { + printf("SHAKE128( 0xa3 ... [200 times] ) failed (2 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + /* SHAKE128 byte-by-byte: 200 steps. [FIPS 202] */ + i = 200; + sha3_shake_init(&c, 128); + while (i--) sha3_shake_process(&c, &c1, 1); + for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ + if(XMEMCMP(shake128_0xa3_200_times, hash, sizeof(shake128_0xa3_200_times)) != 0) { + printf("SHAKE128( 0xa3 ... [200 times] ) failed (200 steps)\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + return CRYPT_OK; +#endif +} + +#endif diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index fda79f770..8b8ad6178 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -74,6 +74,7 @@ #define LTC_NO_HASHES #define LTC_SHA1 + #define LTC_SHA3 #define LTC_SHA512 #define LTC_SHA384 #define LTC_SHA256 @@ -223,6 +224,7 @@ #define LTC_CHC_HASH #define LTC_WHIRLPOOL +#define LTC_SHA3 #define LTC_SHA512 #define LTC_SHA512_256 #define LTC_SHA512_224 diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 22b922ed0..2d763002c 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -1,4 +1,15 @@ /* ---- HASH FUNCTIONS ---- */ +#ifdef LTC_SHA3 +struct sha3_state { + ulong64 saved; /* the portion of the input message that we didn't consume yet */ + union { ulong64 s[25]; unsigned char sb[25 * 8]; }; + unsigned short byte_index; /* 0..7--the next byte after the set one (starts from 0; 0--none are buffered) */ + unsigned short word_index; /* 0..24--the next word to integrate input (starts from 0) */ + unsigned short capacity_words; /* the double size of the hash output in words (e.g. 16 for Keccak 512) */ + unsigned short xof_flag; +}; +#endif + #ifdef LTC_SHA512 struct sha512_state { ulong64 length, state[8]; @@ -110,6 +121,9 @@ typedef union Hash_state { #ifdef LTC_WHIRLPOOL struct whirlpool_state whirlpool; #endif +#ifdef LTC_SHA3 + struct sha3_state sha3; +#endif #ifdef LTC_SHA512 struct sha512_state sha512; #endif @@ -208,6 +222,30 @@ int whirlpool_test(void); extern const struct ltc_hash_descriptor whirlpool_desc; #endif +#ifdef LTC_SHA3 +int sha3_512_init(hash_state * md); +int sha3_512_test(void); +extern const struct ltc_hash_descriptor sha3_512_desc; +int sha3_384_init(hash_state * md); +int sha3_384_test(void); +extern const struct ltc_hash_descriptor sha3_384_desc; +int sha3_256_init(hash_state * md); +int sha3_256_test(void); +extern const struct ltc_hash_descriptor sha3_256_desc; +int sha3_224_init(hash_state * md); +int sha3_224_test(void); +extern const struct ltc_hash_descriptor sha3_224_desc; +/* process + done are the same for all variants */ +int sha3_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int sha3_done(hash_state *md, unsigned char *hash); +/* SHAKE128 + SHAKE256 */ +int sha3_shake_init(hash_state *md, int num); +#define sha3_shake_process(a,b,c) sha3_process(a,b,c) +int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen); +int sha3_shake_test(void); +int sha3_shake_memory(int num, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); +#endif + #ifdef LTC_SHA512 int sha512_init(hash_state * md); int sha512_process(hash_state * md, const unsigned char *in, unsigned long inlen); diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index aef292f29..192cad20a 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -126,6 +126,9 @@ const char *crypt_build_settings = #endif "\nHashes built-in:\n" +#if defined(LTC_SHA3) + " SHA3\n" +#endif #if defined(LTC_SHA512) " SHA-512\n" #endif diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 7a225d83d..9a5cdd9c7 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -35,6 +35,9 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_SHA256 _SZ_STRINGIFY_S(sha256_state), #endif +#ifdef LTC_SHA3 + _SZ_STRINGIFY_S(sha3_state), +#endif #ifdef LTC_SHA512 _SZ_STRINGIFY_S(sha512_state), #endif diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index 6dd04daec..36d19886e 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -19,6 +19,9 @@ int cipher_hash_test(void) DOX(hash_descriptor[x].test(), hash_descriptor[x].name); } + /* SHAKE128 + SHAKE256 tests are a bit special */ + DOX(sha3_shake_test(), "sha3_shake"); + /* test prngs (test, import/export */ for (x = 0; prng_descriptor[x].name != NULL; x++) { DOX(prng_descriptor[x].test(), prng_descriptor[x].name); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 751644efd..3d94231a2 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -271,6 +271,12 @@ static void _unregister_all(void) #ifdef LTC_SHA512_256 unregister_hash(&sha512_256_desc); #endif +#ifdef LTC_SHA3 + unregister_hash(&sha3_224_desc); + unregister_hash(&sha3_256_desc); + unregister_hash(&sha3_384_desc); + unregister_hash(&sha3_512_desc); +#endif #ifdef LTC_RIPEMD128 unregister_hash(&rmd128_desc); #endif @@ -424,6 +430,12 @@ void reg_algs(void) #ifdef LTC_SHA512_256 register_hash (&sha512_256_desc); #endif +#ifdef LTC_SHA3 + register_hash (&sha3_224_desc); + register_hash (&sha3_256_desc); + register_hash (&sha3_384_desc); + register_hash (&sha3_512_desc); +#endif #ifdef LTC_RIPEMD128 register_hash (&rmd128_desc); #endif From 4874430dec7f4238acbec17477132d475c5ccf92 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 30 Mar 2017 15:49:04 +0200 Subject: [PATCH 0548/1192] send travis notifications to #libtom-notifications --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 576a6bea0..c62c21a30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,4 +97,4 @@ after_failure: after_script: - cat gcc_2.txt notifications: - irc: "chat.freenode.net#libtom" + irc: "chat.freenode.net#libtom-notifications" From 2a2968ae9254a6cfb250566e07c46ad8a551ce65 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 29 Mar 2017 20:52:30 +0200 Subject: [PATCH 0549/1192] demos/test facelift --- demos/test.c | 38 ++++++++++++++++++++++++++++++-------- testprof/katja_test.c | 3 +-- testprof/tomcrypt_test.h | 1 + testprof/x86_prof.c | 27 +++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 10 deletions(-) diff --git a/demos/test.c b/demos/test.c index c93a69005..6263247fd 100644 --- a/demos/test.c +++ b/demos/test.c @@ -26,10 +26,12 @@ static const struct { LTC_TEST_FN(katja_test), }; -int main(void) +int main(int argc, char **argv) { - int x; + int x, pass = 0, fail = 0, nop = 0; size_t fn_len, i, dots; + char *single_test = NULL; + ulong64 ts, dur = 0; reg_algs(); printf("build == \n%s\n", crypt_build_settings); @@ -58,26 +60,46 @@ int main(void) fn_len = fn_len + (4 - (fn_len % 4)); + /* single test name from commandline */ + if (argc > 1) single_test = argv[1]; + for (i = 0; i < sizeof(test_functions)/sizeof(test_functions[0]); ++i) { + if (single_test && strcmp(test_functions[i].name, single_test)) { + continue; + } dots = fn_len - strlen(test_functions[i].name); printf("\n%s", test_functions[i].name); while(dots--) printf("."); fflush(stdout); + ts = epoch_usec(); x = test_functions[i].fn(); + ts = epoch_usec() - ts; + dur += ts; - if (x) { - printf("failed\n"); - exit(EXIT_FAILURE); + if (x == CRYPT_OK) { + printf("passed %10.3fms", (double)(ts)/1000); + pass++; + } + else if (x == CRYPT_NOP) { + printf("nop"); + nop++; } else { - printf("passed"); + printf("failed %10.3fms", (double)(ts)/1000); + fail++; } } - printf("\n"); - return EXIT_SUCCESS; + if (fail > 0 || fail+pass+nop == 0) { + printf("\n\nFAILURE: passed=%d failed=%d nop=%d duration=%.1fsec\n", pass, fail, nop, (double)(dur)/(1000*1000)); + return EXIT_FAILURE; + } + else { + printf("\n\nSUCCESS: passed=%d failed=%d nop=%d duration=%.1fsec\n", pass, fail, nop, (double)(dur)/(1000*1000)); + return EXIT_SUCCESS; + } } /* $Source$ */ diff --git a/testprof/katja_test.c b/testprof/katja_test.c index 68f19a3d8..dd5be64ec 100644 --- a/testprof/katja_test.c +++ b/testprof/katja_test.c @@ -224,8 +224,7 @@ for (cnt = 0; cnt < len; ) { int katja_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 9627dcba4..60572b725 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -88,6 +88,7 @@ int compare_testvector(const void* is, const unsigned long is_len, const void* s int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); +ulong64 epoch_usec(void); void t_start(void); ulong64 t_read(void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 3d94231a2..0d2e0fc1a 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -1,5 +1,32 @@ #include +#if defined(_WIN32) + #include /* GetSystemTimeAsFileTime */ +#else + #include +#endif + +/* microseconds since 1970 (UNIX epoch) */ +ulong64 epoch_usec(void) +{ +#if defined(LTC_NO_TEST_TIMING) + return 0; +#elif defined(_WIN32) + FILETIME CurrentTime; + ulong64 cur_time; + GetSystemTimeAsFileTime(&CurrentTime); + cur_time = ((ulong64)CurrentTime.dwHighDateTime << 32) + (ulong64)CurrentTime.dwLowDateTime; + cur_time -= 116444736000000000LL; /* subtract epoch in microseconds */ + cur_time /= 10; /* nanoseconds > microseconds */ + return cur_time; +#else + struct timeval tv; + struct timezone tz; + gettimeofday(&tv, &tz); + return (ulong64)(tv.tv_sec) * 1000000 + (ulong64)(tv.tv_usec); /* get microseconds */ +#endif +} + prng_state yarrow_prng; void print_hex(const char* what, const void* v, const unsigned long l) From 7ddce245b8c1485c1d3e59e651929145e326e2d6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 10 Sep 2015 22:38:39 +0200 Subject: [PATCH 0550/1192] save the plain constructed-, sequence- or set-data details --- src/pk/asn1/der/sequence/der_decode_sequence_flexi.c | 9 +++++++++ src/pk/asn1/der/sequence/der_sequence_free.c | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index caad48547..62ca40c2b 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -348,6 +348,15 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc l->type = LTC_ASN1_SET; } + if ((l->data = XMALLOC(len)) == NULL) { + err = CRYPT_MEM; + goto error; + } + + XMEMCPY(l->data, in, len); + l->size = len; + + /* jump to the start of the data */ in += data_offset; *inlen -= data_offset; diff --git a/src/pk/asn1/der/sequence/der_sequence_free.c b/src/pk/asn1/der/sequence/der_sequence_free.c index e84948326..4600d5f04 100644 --- a/src/pk/asn1/der/sequence/der_sequence_free.c +++ b/src/pk/asn1/der/sequence/der_sequence_free.c @@ -46,9 +46,7 @@ void der_sequence_free(ltc_asn1_list *in) } switch (in->type) { - case LTC_ASN1_SET: - case LTC_ASN1_SETOF: - case LTC_ASN1_SEQUENCE: break; + case LTC_ASN1_SETOF: break; case LTC_ASN1_INTEGER : if (in->data != NULL) { mp_clear(in->data); } break; default : if (in->data != NULL) { XFREE(in->data); } } From 2e822a80a8cfa3145f37d6041245f62bf04a4a89 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 10 Sep 2015 23:28:20 +0200 Subject: [PATCH 0551/1192] add der_sequence_shrink() in case you want to keep a sequence over a longer time, but you don't need all the raw constructed, set or sequence data --- src/headers/tomcrypt_pk.h | 1 + .../asn1/der/sequence/der_sequence_shrink.c | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/pk/asn1/der/sequence/der_sequence_shrink.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index ad5efc03a..f1be25603 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -540,6 +540,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc_asn1_list **out); #define der_free_sequence_flexi der_sequence_free void der_sequence_free(ltc_asn1_list *in); +void der_sequence_shrink(ltc_asn1_list *in); /* BOOLEAN */ int der_length_boolean(unsigned long *outlen); diff --git a/src/pk/asn1/der/sequence/der_sequence_shrink.c b/src/pk/asn1/der/sequence/der_sequence_shrink.c new file mode 100644 index 000000000..227576dc5 --- /dev/null +++ b/src/pk/asn1/der/sequence/der_sequence_shrink.c @@ -0,0 +1,52 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file der_sequence_shrink.c + Free memory allocated for CONSTRUCTED, SET or SEQUENCE elements by der_decode_sequence_flexi(), Steffen Jaeckel +*/ + +#ifdef LTC_DER + +/** + Free memory allocated for CONSTRUCTED, + SET or SEQUENCE elements by der_decode_sequence_flexi() + @param in The list to shrink +*/ +void der_sequence_shrink(ltc_asn1_list *in) +{ + if (!in) return; + + /* now walk the list and free stuff */ + while (in != NULL) { + /* is there a child? */ + if (in->child) { + der_sequence_shrink(in->child); + } + + switch (in->type) { + case LTC_ASN1_CONSTRUCTED: + case LTC_ASN1_SET: + case LTC_ASN1_SEQUENCE : if (in->data != NULL) { XFREE(in->data); in->data = NULL; } break; + default: break; + } + + /* move to next and free current */ + in = in->next; + } +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ From f9bce83329d239a3a9c9f93d6b0a1cb64c708089 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 10 Sep 2015 23:29:10 +0200 Subject: [PATCH 0552/1192] add possibility to rsa_import() the public key of an x.509 certificate --- src/pk/rsa/rsa_import.c | 50 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index efd5afbfb..34c457383 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -29,7 +29,8 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) int err; void *zero; unsigned char *tmpbuf=NULL; - unsigned long tmpbuf_len; + unsigned long tmpbuf_len, tmp_inlen; + ltc_asn1_list *decoded_list = NULL, *l; LTC_ARGCHK(in != NULL); LTC_ARGCHK(key != NULL); @@ -53,6 +54,53 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) PKA_RSA, tmpbuf, &tmpbuf_len, LTC_ASN1_NULL, NULL, 0); + tmp_inlen = inlen; + if (err != CRYPT_OK && + der_decode_sequence_flexi(in, &tmp_inlen, &decoded_list) == CRYPT_OK) { + l = decoded_list; + /* Move 2 levels up in the tree + SEQUENCE + SEQUENCE + ... + */ + if (l->type == LTC_ASN1_SEQUENCE && l->child) { + l = l->child; + if (l->type == LTC_ASN1_SEQUENCE && l->child) { + l = l->child; + + /* Move forward in the tree until we find this combination + ... + SEQUENCE + SEQUENCE + OBJECT IDENTIFIER 1.2.840.113549.1.1.1 + NULL + BIT STRING + */ + do { + /* The additional check for l->data is there to make sure + * we won't try to decode a list that has been 'shrunk' + */ + if (l->type == LTC_ASN1_SEQUENCE && l->data && l->child && + l->child->type == LTC_ASN1_SEQUENCE && l->child->child && + l->child->child->type == LTC_ASN1_OBJECT_IDENTIFIER && l->child->next && + l->child->next->type == LTC_ASN1_BIT_STRING) { + err = der_decode_subject_public_key_info(l->data, l->size, + PKA_RSA, tmpbuf, &tmpbuf_len, + LTC_ASN1_NULL, NULL, 0); + if (err == CRYPT_OK) { + break; + } + } + l = l->next; + } while(l); + } + } + } + + if (decoded_list) { + der_free_sequence_flexi(decoded_list); + } + if (err == CRYPT_OK) { /* SubjectPublicKeyInfo format */ /* now it should be SEQUENCE { INTEGER, INTEGER } */ From 39b2a8daca823562cf447919e90a7fae9b379782 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 10 Sep 2015 23:31:02 +0200 Subject: [PATCH 0553/1192] add tests for new functionality of der_encode_flexi() and rsa_import() --- testprof/der_tests.c | 12 +++++++++++- testprof/rsa_test.c | 10 +++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 7ce6273be..a0cbc0255 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -13,7 +13,7 @@ int der_tests(void) #else -static const unsigned char _der_tests_cacert_root_cert[] = +const unsigned char _der_tests_cacert_root_cert[] = "MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\ IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\ IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA\ @@ -53,6 +53,7 @@ static const unsigned char _der_tests_cacert_root_cert[] = GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk\ zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW\ omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD"; +const unsigned long _der_tests_cacert_root_cert_size = sizeof(_der_tests_cacert_root_cert); /* SEQUENCE(3 elem) @@ -195,6 +196,8 @@ SEQUENCE(3 elem) #define CHECK_ASN1_HAS_NO_CHILD(l) __CHECK_ASN1_HAS_NO(l, child) #define CHECK_ASN1_HAS_NEXT(l) __CHECK_ASN1_HAS(l, next) #define CHECK_ASN1_HAS_NO_NEXT(l) __CHECK_ASN1_HAS_NO(l, next) +#define CHECK_ASN1_HAS_DATA(l) __CHECK_ASN1_HAS(l, data) +#define CHECK_ASN1_HAS_NO_DATA(l) __CHECK_ASN1_HAS_NO(l, data) #ifdef LTC_DER_TESTS_PRINT_FLEXI static void _der_tests_print_flexi(ltc_asn1_list* l, unsigned int level) @@ -395,6 +398,13 @@ static void der_cacert_test(void) DO(base64_decode(_der_tests_cacert_root_cert, sizeof(_der_tests_cacert_root_cert), buf, &len1)); len2 = len1; DO(der_decode_sequence_flexi(buf, &len2, &decoded_list)); + CHECK_ASN1_TYPE(decoded_list, LTC_ASN1_SEQUENCE); + CHECK_ASN1_HAS_DATA(decoded_list); + + der_sequence_shrink(decoded_list); + + CHECK_ASN1_TYPE(decoded_list, LTC_ASN1_SEQUENCE); + CHECK_ASN1_HAS_NO_DATA(decoded_list); #ifdef LTC_DER_TESTS_PRINT_FLEXI printf("\n\n--- test print start ---\n\n"); diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index c7f1dcbf8..5795ac48b 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -93,6 +93,9 @@ static const unsigned char openssl_public_rsa_stripped[] = { 0x60, 0x3f, 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x94, 0xa4, 0x44, 0xfd, 0x02, 0x03, 0x01, 0x00, 0x01, }; +extern const unsigned char _der_tests_cacert_root_cert[]; +extern const unsigned long _der_tests_cacert_root_cert_size; + static int rsa_compat_test(void) { rsa_key key; @@ -195,7 +198,7 @@ static int rsa_compat_test(void) int rsa_test(void) { - unsigned char in[1024], out[1024], tmp[1024]; + unsigned char in[1024], out[1024], tmp[3072]; rsa_key key, privKey, pubKey; int hash_idx, prng_idx, stat, stat2, i, err; unsigned long rsa_msgsize, len, len2, len3, cnt, cnt2; @@ -537,6 +540,11 @@ for (cnt = 0; cnt < len; ) { DOX(stat == 0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, "should fail"); } + len3 = sizeof(tmp); + DO(base64_decode(_der_tests_cacert_root_cert, _der_tests_cacert_root_cert_size, tmp, &len3)); + + DO(rsa_import(tmp, len3, &key)); + /* free the key and return */ rsa_free(&key); rsa_free(&pubKey); From 27722734b2f94884ea900a01269cae72875e0726 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 10 Sep 2015 19:06:01 +0200 Subject: [PATCH 0554/1192] let's use an empty list element to signal an empty sequence --- .../der/sequence/der_decode_sequence_flexi.c | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index 62ca40c2b..5435381cd 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -53,6 +53,25 @@ static unsigned long fetch_length(const unsigned char *in, unsigned long inlen, return z+*data_offset; } +static int new_element(ltc_asn1_list **l) +{ + /* alloc new link */ + if (*l == NULL) { + *l = XCALLOC(1, sizeof(ltc_asn1_list)); + if (*l == NULL) { + return CRYPT_MEM; + } + } else { + (*l)->next = XCALLOC(1, sizeof(ltc_asn1_list)); + if ((*l)->next == NULL) { + return CRYPT_MEM; + } + (*l)->next->prev = *l; + *l = (*l)->next; + } + return CRYPT_OK; +} + /** ASN.1 DER Flexi(ble) decoder will decode arbitrary DER packets and create a linked list of the decoded elements. @param in The input buffer @@ -73,6 +92,13 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc l = NULL; totlen = 0; + if (*inlen == 0) { + /* alloc new link */ + if ((err = new_element(&l)) != CRYPT_OK) { + goto error; + } + } + /* scan the input and and get lengths and what not */ while (*inlen) { /* read the type byte */ @@ -86,20 +112,8 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc } /* alloc new link */ - if (l == NULL) { - l = XCALLOC(1, sizeof(*l)); - if (l == NULL) { - err = CRYPT_MEM; - goto error; - } - } else { - l->next = XCALLOC(1, sizeof(*l)); - if (l->next == NULL) { - err = CRYPT_MEM; - goto error; - } - l->next->prev = l; - l = l->next; + if ((err = new_element(&l)) != CRYPT_OK) { + goto error; } if ((type & 0x20) && (type != 0x30) && (type != 0x31)) { From 019a9e9850ad50603985df1dd014c84736ce7ef1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Mar 2017 22:33:22 +0200 Subject: [PATCH 0555/1192] add stinky certificate --- testprof/der_tests.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index a0cbc0255..dcaf1b2a2 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -13,6 +13,35 @@ int der_tests(void) #else +static const unsigned char _der_tests_stinky_root_cert[] = + "MIIFETCCA/mgAwIBAgIQbv53JNmv518t5lkCHE272jANBgkqhkiG9w0BAQUFADCB\ + lTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug\ + Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho\ + dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAbBgNVBAMTFFVUTi1VU0VSRmlyc3Qt\ + T2JqZWN0MB4XDTA4MDQyOTAwMDAwMFoXDTEwMDQyOTIzNTk1OVowgbUxCzAJBgNV\ + BAYTAlVTMQ4wDAYDVQQRDAU0NDE0MzELMAkGA1UECAwCT0gxGTAXBgNVBAcMEE1h\ + eWZpZWxkIFZpbGxhZ2UxEDAOBgNVBAkMB1N1aXRlIEExFDASBgNVBAkMCzc2NyBC\ + ZXRhIERyMSIwIAYDVQQKDBlQcmVlbXB0aXZlIFNvbHV0aW9ucywgTExDMSIwIAYD\ + VQQ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Gxi\ + FC/KWNKedTNraW95xlg8NTlL2yRP7TMsjvBxgLmkbaFUoXzPTbQWmtovIagIT8GC\ + JeXwdFaRjbamiz3Irl+u7x/mhxdza6RvgBYylXRFMudANpeGsV7gDXlnfzpFDKHQ\ + niVwB7P5sbPFIlmIc+4/xRItkLIRjCVXaepgN9KYu3VOgiSDI6wXiTwP44/LUXQM\ + hetwa7s="; const unsigned char _der_tests_cacert_root_cert[] = "MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\ IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\ @@ -395,6 +424,12 @@ static void der_cacert_test(void) ltc_asn1_list *decoded_list, *l, *l1, *l2; + DO(base64_decode(_der_tests_stinky_root_cert, sizeof(_der_tests_stinky_root_cert), buf, &len1)); + len2 = len1; + DO(der_decode_sequence_flexi(buf, &len2, &decoded_list)); + der_free_sequence_flexi(decoded_list); + + len1 = sizeof(buf); DO(base64_decode(_der_tests_cacert_root_cert, sizeof(_der_tests_cacert_root_cert), buf, &len1)); len2 = len1; DO(der_decode_sequence_flexi(buf, &len2, &decoded_list)); From ec327b3d8686af4b6bb0f1e9a3b7645f4b41ebf7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Mar 2017 23:41:12 +0200 Subject: [PATCH 0556/1192] move x509 processing to rsa_import_x509() --- src/headers/tomcrypt_pk.h | 1 + src/pk/rsa/rsa_import.c | 50 +-------------- src/pk/rsa/rsa_import_x509.c | 120 +++++++++++++++++++++++++++++++++++ testprof/rsa_test.c | 2 +- 4 files changed, 123 insertions(+), 50 deletions(-) create mode 100644 src/pk/rsa/rsa_import_x509.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index f1be25603..be19bad2c 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -107,6 +107,7 @@ int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key); int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key); int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); +int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key); #endif diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index 34c457383..efd5afbfb 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -29,8 +29,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) int err; void *zero; unsigned char *tmpbuf=NULL; - unsigned long tmpbuf_len, tmp_inlen; - ltc_asn1_list *decoded_list = NULL, *l; + unsigned long tmpbuf_len; LTC_ARGCHK(in != NULL); LTC_ARGCHK(key != NULL); @@ -54,53 +53,6 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) PKA_RSA, tmpbuf, &tmpbuf_len, LTC_ASN1_NULL, NULL, 0); - tmp_inlen = inlen; - if (err != CRYPT_OK && - der_decode_sequence_flexi(in, &tmp_inlen, &decoded_list) == CRYPT_OK) { - l = decoded_list; - /* Move 2 levels up in the tree - SEQUENCE - SEQUENCE - ... - */ - if (l->type == LTC_ASN1_SEQUENCE && l->child) { - l = l->child; - if (l->type == LTC_ASN1_SEQUENCE && l->child) { - l = l->child; - - /* Move forward in the tree until we find this combination - ... - SEQUENCE - SEQUENCE - OBJECT IDENTIFIER 1.2.840.113549.1.1.1 - NULL - BIT STRING - */ - do { - /* The additional check for l->data is there to make sure - * we won't try to decode a list that has been 'shrunk' - */ - if (l->type == LTC_ASN1_SEQUENCE && l->data && l->child && - l->child->type == LTC_ASN1_SEQUENCE && l->child->child && - l->child->child->type == LTC_ASN1_OBJECT_IDENTIFIER && l->child->next && - l->child->next->type == LTC_ASN1_BIT_STRING) { - err = der_decode_subject_public_key_info(l->data, l->size, - PKA_RSA, tmpbuf, &tmpbuf_len, - LTC_ASN1_NULL, NULL, 0); - if (err == CRYPT_OK) { - break; - } - } - l = l->next; - } while(l); - } - } - } - - if (decoded_list) { - der_free_sequence_flexi(decoded_list); - } - if (err == CRYPT_OK) { /* SubjectPublicKeyInfo format */ /* now it should be SEQUENCE { INTEGER, INTEGER } */ diff --git a/src/pk/rsa/rsa_import_x509.c b/src/pk/rsa/rsa_import_x509.c new file mode 100644 index 000000000..cf4a19ffc --- /dev/null +++ b/src/pk/rsa/rsa_import_x509.c @@ -0,0 +1,120 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file rsa_import.c + Import an RSA key from a X.509 certificate, Steffen Jaeckel +*/ + +#ifdef LTC_MRSA + +/** + Import an RSA key from a X.509 certificate + @param in The packet to import from + @param inlen It's length (octets) + @param key [out] Destination for newly imported key + @return CRYPT_OK if successful, upon error allocated memory is freed +*/ +int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key) +{ + int err; + unsigned char *tmpbuf=NULL; + unsigned long tmpbuf_len, tmp_inlen; + ltc_asn1_list *decoded_list = NULL, *l; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* init key */ + if ((err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, + &key->dP, &key->qP, &key->p, &key->q, NULL)) != CRYPT_OK) { + return err; + } + + tmpbuf_len = MAX_RSA_SIZE * 8; + tmpbuf = XCALLOC(1, tmpbuf_len); + if (tmpbuf == NULL) { + err = CRYPT_MEM; + goto LBL_ERR; + } + + tmp_inlen = inlen; + if ((err = der_decode_sequence_flexi(in, &tmp_inlen, &decoded_list)) == CRYPT_OK) { + l = decoded_list; + /* Move 2 levels up in the tree + SEQUENCE + SEQUENCE + ... + */ + if (l->type == LTC_ASN1_SEQUENCE && l->child) { + l = l->child; + if (l->type == LTC_ASN1_SEQUENCE && l->child) { + l = l->child; + + err = CRYPT_ERROR; + + /* Move forward in the tree until we find this combination + ... + SEQUENCE + SEQUENCE + OBJECT IDENTIFIER 1.2.840.113549.1.1.1 + NULL + BIT STRING + */ + do { + /* The additional check for l->data is there to make sure + * we won't try to decode a list that has been 'shrunk' + */ + if (l->type == LTC_ASN1_SEQUENCE && l->data && l->child && + l->child->type == LTC_ASN1_SEQUENCE && l->child->child && + l->child->child->type == LTC_ASN1_OBJECT_IDENTIFIER && l->child->next && + l->child->next->type == LTC_ASN1_BIT_STRING) { + err = der_decode_subject_public_key_info(l->data, l->size, + PKA_RSA, tmpbuf, &tmpbuf_len, + LTC_ASN1_NULL, NULL, 0); + if (err == CRYPT_OK) { + /* now it should be SEQUENCE { INTEGER, INTEGER } */ + if ((err = der_decode_sequence_multi(tmpbuf, tmpbuf_len, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->e, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + key->type = PK_PUBLIC; + err = CRYPT_OK; + goto LBL_FREE; + } + } + l = l->next; + } while(l); + } + } + } + + +LBL_ERR: + rsa_free(key); + +LBL_FREE: + if (decoded_list) der_free_sequence_flexi(decoded_list); + if (tmpbuf != NULL) XFREE(tmpbuf); + + return err; +} + +#endif /* LTC_MRSA */ + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 5795ac48b..8bc372f91 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -543,7 +543,7 @@ for (cnt = 0; cnt < len; ) { len3 = sizeof(tmp); DO(base64_decode(_der_tests_cacert_root_cert, _der_tests_cacert_root_cert_size, tmp, &len3)); - DO(rsa_import(tmp, len3, &key)); + DO(rsa_import_x509(tmp, len3, &key)); /* free the key and return */ rsa_free(&key); From 856d542a1c39cce9696166ecc13e132e60040ab6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Mar 2017 23:42:51 +0200 Subject: [PATCH 0557/1192] turn around the order when free'ing an rsa_key struct --- src/pk/rsa/rsa_free.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_free.c b/src/pk/rsa/rsa_free.c index 702116a11..57da74c1f 100644 --- a/src/pk/rsa/rsa_free.c +++ b/src/pk/rsa/rsa_free.c @@ -24,7 +24,7 @@ void rsa_free(rsa_key *key) { LTC_ARGCHKVD(key != NULL); - mp_clear_multi(key->e, key->d, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + mp_clear_multi(key->q, key->p, key->qP, key->dP, key->dQ, key->N, key->d, key->e, NULL); } #endif From ac7915ed131211947b32d3f90b819ab2fcc3c860 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 29 Mar 2017 00:23:51 +0200 Subject: [PATCH 0558/1192] Update makefiles --- libtomcrypt_VS2005.vcproj | 8 ++++++++ libtomcrypt_VS2008.vcproj | 8 ++++++++ makefile | 12 ++++++------ makefile.icc | 12 ++++++------ makefile.mingw | 12 ++++++------ makefile.msvc | 12 ++++++------ makefile.shared | 12 ++++++------ makefile.unix | 12 ++++++------ 8 files changed, 52 insertions(+), 36 deletions(-) diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index 5f16e83cc..ec611293e 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -1575,6 +1575,10 @@ RelativePath="src\pk\asn1\der\sequence\der_sequence_free.c" > + + + + diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 887f726d4..26c0efbd3 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -1816,6 +1816,10 @@ RelativePath="src\pk\asn1\der\sequence\der_sequence_free.c" > + + + + diff --git a/makefile b/makefile index 6432b3f1f..140ef2b50 100644 --- a/makefile +++ b/makefile @@ -141,8 +141,8 @@ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ -src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ -src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ +src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ src/pk/asn1/der/short_integer/der_length_short_integer.o \ src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ @@ -168,10 +168,10 @@ src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ -src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ -src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ -src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.icc b/makefile.icc index 44664b0e6..e16d71c8d 100644 --- a/makefile.icc +++ b/makefile.icc @@ -198,8 +198,8 @@ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ -src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ -src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ +src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ src/pk/asn1/der/short_integer/der_length_short_integer.o \ src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ @@ -225,10 +225,10 @@ src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ -src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ -src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ -src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.mingw b/makefile.mingw index c905256ff..12d4de241 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -134,8 +134,8 @@ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ -src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ -src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ +src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ src/pk/asn1/der/short_integer/der_length_short_integer.o \ src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ @@ -161,10 +161,10 @@ src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ -src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ -src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ -src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.msvc b/makefile.msvc index 2b5724617..80ac0ccc6 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -108,8 +108,8 @@ src/pk/asn1/der/sequence/der_encode_sequence_ex.obj \ src/pk/asn1/der/sequence/der_encode_sequence_multi.obj \ src/pk/asn1/der/sequence/der_encode_subject_public_key_info.obj \ src/pk/asn1/der/sequence/der_length_sequence.obj src/pk/asn1/der/sequence/der_sequence_free.obj \ -src/pk/asn1/der/set/der_encode_set.obj src/pk/asn1/der/set/der_encode_setof.obj \ -src/pk/asn1/der/short_integer/der_decode_short_integer.obj \ +src/pk/asn1/der/sequence/der_sequence_shrink.obj src/pk/asn1/der/set/der_encode_set.obj \ +src/pk/asn1/der/set/der_encode_setof.obj src/pk/asn1/der/short_integer/der_decode_short_integer.obj \ src/pk/asn1/der/short_integer/der_encode_short_integer.obj \ src/pk/asn1/der/short_integer/der_length_short_integer.obj \ src/pk/asn1/der/teletex_string/der_decode_teletex_string.obj \ @@ -135,10 +135,10 @@ src/pk/pkcs1/pkcs_1_oaep_decode.obj src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/p src/pk/pkcs1/pkcs_1_pss_decode.obj src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj \ src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj \ src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj \ -src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_radix.obj src/pk/rsa/rsa_make_key.obj \ -src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj \ -src/prngs/fortuna.obj src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj \ -src/prngs/sober128.obj src/prngs/sprng.obj src/prngs/yarrow.obj +src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_radix.obj src/pk/rsa/rsa_import_x509.obj \ +src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_sign_saltlen_get.obj \ +src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj src/prngs/rc4.obj src/prngs/rng_get_bytes.obj \ +src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj src/prngs/yarrow.obj HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.shared b/makefile.shared index 763397c2c..0393caa23 100644 --- a/makefile.shared +++ b/makefile.shared @@ -131,8 +131,8 @@ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ -src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ -src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ +src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ src/pk/asn1/der/short_integer/der_length_short_integer.o \ src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ @@ -158,10 +158,10 @@ src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ -src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ -src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ -src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.unix b/makefile.unix index 9e7c8f930..59a3481f1 100644 --- a/makefile.unix +++ b/makefile.unix @@ -139,8 +139,8 @@ src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ -src/pk/asn1/der/set/der_encode_set.o src/pk/asn1/der/set/der_encode_setof.o \ -src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ +src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ src/pk/asn1/der/short_integer/der_encode_short_integer.o \ src/pk/asn1/der/short_integer/der_length_short_integer.o \ src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ @@ -166,10 +166,10 @@ src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_make_key.o \ -src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o \ -src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o \ -src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ +src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ From f7cb199066dc45b96858f2923a82fab25e4aef25 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 29 Mar 2017 12:03:53 +0200 Subject: [PATCH 0559/1192] add test proposed by @karel-m --- testprof/rsa_test.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 8bc372f91..55db8423e 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -46,6 +46,22 @@ static const unsigned char openssl_private_rsa[] = { 0x78, 0x18, 0x5a, 0x79, 0x3d, 0x2e, 0x8e, 0x7e, 0x86, 0x0a, 0xe6, 0xa8, 0x33, 0xc1, 0x04, 0x17, 0x4a, 0x9f, }; +static const unsigned char x509_public_rsa[] = + "MIICdTCCAd4CCQCYjCwz0l9JpjANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJD\ + WjEPMA0GA1UECAwGTW9yYXZhMQ0wCwYDVQQHDARCcm5vMRAwDgYDVQQKDAdMVEMg\ + THRkMQ8wDQYDVQQLDAZDcnlwdG8xEjAQBgNVBAMMCVRlc3QgQ2VydDEYMBYGCSqG\ + SIb3DQEJARYJdGVzdEBjZXJ0MCAXDTE3MDMwOTIzNDMzOVoYDzIyOTAxMjIyMjM0\ + MzM5WjB+MQswCQYDVQQGEwJDWjEPMA0GA1UECAwGTW9yYXZhMQ0wCwYDVQQHDARC\ + cm5vMRAwDgYDVQQKDAdMVEMgTHRkMQ8wDQYDVQQLDAZDcnlwdG8xEjAQBgNVBAMM\ + CVRlc3QgQ2VydDEYMBYGCSqGSIb3DQEJARYJdGVzdEBjZXJ0MIGfMA0GCSqGSIb3\ + DQEBAQUAA4GNADCBiQKBgQDPmt5kitrIMyCp14MxGVSymoWnobd1M7aprIQks97b\ + fYUtlmXlP3KVJJ8oaMpP20QcPmASit0mpev/C17UiDhJKm5bvxI3R70Fa7zb8+7k\ + EY5BaHxhE9dCyIC+No/cCItPrKTidgzJY2xJWJPtzKrcJTsKYD+LVDrDTTHnlKRE\ + /QIDAQABMA0GCSqGSIb3DQEBCwUAA4GBAApwWqupmmLGHeKOLFLcthQpAXXYep6T\ + 3S3e8X7fIG6TGhfvn5DHn+/V/C4184oOCwImI+VYRokdXdQ1AMGfVUomHJxsFPia\ + bv5Aw3hiKsIG3jigKHwmMScgkl3yn+8hLkx6thNbqQoa6Yyo20RqaEFBwlZ5G8lF\ + rZsdeO84SeCH"; + /* private keay - hexadecimal */ static char *hex_d = "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881"; static char *hex_dP = "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089"; @@ -539,6 +555,19 @@ for (cnt = 0; cnt < len; ) { DOX(rsa_verify_hash_ex(p2, len2, p, 20, LTC_PKCS_1_V1_5, hash_idx, -1, &stat, &pubKey), "should succeed"); DOX(stat == 0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, "should fail"); } + rsa_free(&key); + + /* try reading the public RSA key from a X509 certificate */ + len3 = sizeof(tmp); + DO(base64_decode(x509_public_rsa, sizeof(x509_public_rsa), tmp, &len3)); + DO(rsa_import_x509(tmp, len3, &key)); + len = sizeof(tmp); + DO(rsa_export(tmp, &len, PK_PUBLIC, &key)); + if (len != sizeof(openssl_public_rsa_stripped) || memcmp(tmp, openssl_public_rsa_stripped, len)) { + fprintf(stderr, "RSA public export failed to match rsa_import_x509\n"); + return 1; + } + rsa_free(&key); len3 = sizeof(tmp); DO(base64_decode(_der_tests_cacert_root_cert, _der_tests_cacert_root_cert_size, tmp, &len3)); From 2bd517307c13ce579d7d7388aab93febee8af0f4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 30 Mar 2017 18:58:21 +0200 Subject: [PATCH 0560/1192] add GeneralizedTime DER en-/decode --- src/headers/tomcrypt.h | 2 +- src/headers/tomcrypt_pk.h | 21 +++ src/pk/asn1/der/choice/der_decode_choice.c | 9 ++ .../der_decode_generalizedtime.c | 131 ++++++++++++++++++ .../der_encode_generalizedtime.c | 103 ++++++++++++++ .../der_length_generalizedtime.c | 53 +++++++ .../der/sequence/der_decode_sequence_ex.c | 8 ++ .../der/sequence/der_decode_sequence_flexi.c | 19 +++ .../der/sequence/der_decode_sequence_multi.c | 2 + .../der/sequence/der_encode_sequence_ex.c | 16 +++ .../der/sequence/der_encode_sequence_multi.c | 2 + .../asn1/der/sequence/der_length_sequence.c | 7 + src/pk/asn1/der/set/der_encode_set.c | 1 + testprof/der_tests.c | 13 ++ 14 files changed, 386 insertions(+), 1 deletion(-) create mode 100644 src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c create mode 100644 src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c create mode 100644 src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index d38a7c7e8..6f661c798 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -55,7 +55,7 @@ enum { CRYPT_FILE_NOTFOUND, /* File Not Found */ CRYPT_PK_INVALID_TYPE, /* Invalid type of PK key */ - CRYPT_PK_INVALID_SYSTEM,/* Invalid PK system specified */ + CRYPT_OVERFLOW, /* An overflow of a value was prevented */ CRYPT_PK_DUP, /* Duplicate key already in key ring */ CRYPT_PK_NOT_FOUND, /* Key not found in keyring */ CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */ diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index be19bad2c..a39f5b808 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -475,6 +475,8 @@ typedef enum ltc_asn1_type_ { LTC_ASN1_TELETEX_STRING, LTC_ASN1_CONSTRUCTED, LTC_ASN1_CONTEXT_SPECIFIC, + /* 20 */ + LTC_ASN1_GENERALIZEDTIME, } ltc_asn1_type; /** A LTC ASN.1 list type */ @@ -662,6 +664,25 @@ int der_decode_utctime(const unsigned char *in, unsigned long *inlen, int der_length_utctime(ltc_utctime *utctime, unsigned long *outlen); +/* GeneralizedTime */ +typedef struct { + unsigned YYYY, /* year */ + MM, /* month */ + DD, /* day */ + hh, /* hour */ + mm, /* minute */ + ss, /* second */ + fs; /* fractional seconds */ +} ltc_generalizedtime; + +int der_encode_generalizedtime(ltc_generalizedtime *gtime, + unsigned char *out, unsigned long *outlen); + +int der_decode_generalizedtime(const unsigned char *in, unsigned long *inlen, + ltc_generalizedtime *out); + +int der_length_generalizedtime(ltc_generalizedtime *gtime, unsigned long *outlen); + #endif diff --git a/src/pk/asn1/der/choice/der_decode_choice.c b/src/pk/asn1/der/choice/der_decode_choice.c index e90e67afa..eb715130a 100644 --- a/src/pk/asn1/der/choice/der_decode_choice.c +++ b/src/pk/asn1/der/choice/der_decode_choice.c @@ -186,6 +186,15 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, } break; + case LTC_ASN1_GENERALIZEDTIME: + z = *inlen; + if (der_decode_generalizedtime(in, &z, data) == CRYPT_OK) { + list[x].used = 1; + *inlen = z; + return CRYPT_OK; + } + break; + case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_SEQUENCE: diff --git a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c new file mode 100644 index 000000000..0fd55791f --- /dev/null +++ b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c @@ -0,0 +1,131 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file der_decode_generalizedtime.c + ASN.1 DER, decode a GeneralizedTime, Steffen Jaeckel + Based on der_decode_utctime.c +*/ + +#ifdef LTC_DER + +static int char_to_int(unsigned char x) +{ + switch (x) { + case '0': return 0; + case '1': return 1; + case '2': return 2; + case '3': return 3; + case '4': return 4; + case '5': return 5; + case '6': return 6; + case '7': return 7; + case '8': return 8; + case '9': return 9; + } + return 100; +} + +#define DECODE_V(y, max) do {\ + y = char_to_int(buf[x])*10 + char_to_int(buf[x+1]); \ + if (y >= max) return CRYPT_INVALID_PACKET; \ + x += 2; \ +} while(0) + +#define DECODE_V4(y, max) do {\ + y = char_to_int(buf[x])*1000 + char_to_int(buf[x+1])*100 + char_to_int(buf[x+2])*10 + char_to_int(buf[x+3]); \ + if (y >= max) return CRYPT_INVALID_PACKET; \ + x += 4; \ +} while(0) + +/** + Decodes a Generalized time structure in DER format (reads all 6 valid encoding formats) + @param in Input buffer + @param inlen Length of input buffer in octets + @param out [out] Destination of Generalized time structure + @return CRYPT_OK if successful +*/ +int der_decode_generalizedtime(const unsigned char *in, unsigned long *inlen, + ltc_generalizedtime *out) +{ + unsigned char buf[32]; + unsigned long x; + int y; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen != NULL); + LTC_ARGCHK(out != NULL); + + /* check header */ + if (*inlen < 2UL || (in[1] >= sizeof(buf)) || ((in[1] + 2UL) > *inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* decode the string */ + for (x = 0; x < in[1]; x++) { + y = der_ia5_value_decode(in[x+2]); + if (y == -1) { + return CRYPT_INVALID_PACKET; + } + if (!((y >= '0' && y <= '9') || y == 'Z')) { + return CRYPT_INVALID_PACKET; + } + buf[x] = y; + } + *inlen = 2 + x; + + if (x < 15) { + return CRYPT_INVALID_PACKET; + } + + /* possible encodings are +YYYYMMDDhhmmssZ +YYYYMMDDhhmmss.[0-9]*Z + + So let's do a trivial decode upto [including] ss + */ + + x = 0; + DECODE_V4(out->YYYY, 10000); + DECODE_V(out->MM, 13); + DECODE_V(out->DD, 32); + DECODE_V(out->hh, 24); + DECODE_V(out->mm, 60); + DECODE_V(out->ss, 60); + + /* clear fractional seconds info */ + out->fs = 0; + + /* now is it Z or . */ + if (buf[x] == 'Z') { + return CRYPT_OK; + } else if (buf[x] == '.') { + x++; + while (buf[x] != 'Z') { + unsigned fs = out->fs; + if (x >= sizeof(buf)) return CRYPT_INVALID_PACKET; + out->fs *= 10; + out->fs += char_to_int(buf[x]); + if (fs < out->fs) return CRYPT_OVERFLOW; + x++; + } + return CRYPT_OK; + } else { + return CRYPT_INVALID_PACKET; + } +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c new file mode 100644 index 000000000..4852684ce --- /dev/null +++ b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c @@ -0,0 +1,103 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file der_encode_utctime.c + ASN.1 DER, encode a GeneralizedTime, Steffen Jaeckel + Based on der_encode_utctime.c +*/ + +#ifdef LTC_DER + +static const char * const baseten = "0123456789"; + +#define STORE_V(y) do {\ + out[x++] = der_ia5_char_encode(baseten[(y/10) % 10]); \ + out[x++] = der_ia5_char_encode(baseten[y % 10]); \ +} while(0) + +#define STORE_V4(y) do {\ + out[x++] = der_ia5_char_encode(baseten[(y/1000) % 10]); \ + out[x++] = der_ia5_char_encode(baseten[(y/100) % 10]); \ + out[x++] = der_ia5_char_encode(baseten[(y/10) % 10]); \ + out[x++] = der_ia5_char_encode(baseten[y % 10]); \ +} while(0) + +/** + Encodes a Generalized time structure in DER format + @param utctime The UTC time structure to encode + @param out The destination of the DER encoding of the UTC time structure + @param outlen [in/out] The length of the DER encoding + @return CRYPT_OK if successful +*/ +int der_encode_generalizedtime(ltc_generalizedtime *gtime, + unsigned char *out, unsigned long *outlen) +{ + unsigned long x, tmplen; + int err; + + LTC_ARGCHK(gtime != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + if ((err = der_length_generalizedtime(gtime, &tmplen)) != CRYPT_OK) { + return err; + } + if (tmplen > *outlen) { + *outlen = tmplen; + return CRYPT_BUFFER_OVERFLOW; + } + + /* store header */ + out[0] = 0x18; + + /* store values */ + x = 2; + STORE_V4(gtime->YYYY); + STORE_V(gtime->MM); + STORE_V(gtime->DD); + STORE_V(gtime->hh); + STORE_V(gtime->mm); + STORE_V(gtime->ss); + + if (gtime->fs) { + unsigned long div; + unsigned fs = gtime->fs; + unsigned len = 0; + out[x++] = der_ia5_char_encode('.'); + div = 1; + do { + fs /= 10; + div *= 10; + len++; + } while(fs != 0); + while (len-- > 1) { + out[x++] = der_ia5_char_encode(baseten[(gtime->fs/div) % 10]); + div /= 10; + } + out[x++] = der_ia5_char_encode(baseten[gtime->fs % 10]); + } + out[x++] = der_ia5_char_encode('Z'); + + /* store length */ + out[1] = (unsigned char)(x - 2); + + /* all good let's return */ + *outlen = x; + return CRYPT_OK; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c new file mode 100644 index 000000000..eff3948b5 --- /dev/null +++ b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c @@ -0,0 +1,53 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file der_length_utctime.c + ASN.1 DER, get length of GeneralizedTime, Steffen Jaeckel + Based on der_length_utctime.c +*/ + +#ifdef LTC_DER + +/** + Gets length of DER encoding of GeneralizedTime + @param utctime The UTC time structure to get the size of + @param outlen [out] The length of the DER encoding + @return CRYPT_OK if successful +*/ +int der_length_generalizedtime(ltc_generalizedtime *gtime, unsigned long *outlen) +{ + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(gtime != NULL); + + if (gtime->fs == 0) { + /* we encode as YYYYMMDDhhmmssZ */ + *outlen = 2 + 15; + } else { + /* we encode as YYYYMMDDhhmmss.fsZ */ + unsigned long len = 2 + 17; + unsigned fs = gtime->fs; + do { + fs /= 10; + len++; + } while(fs != 0); + *outlen = len; + } + + return CRYPT_OK; +} + +#endif + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 8a362b7ad..26e0e7120 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -244,6 +244,14 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, } break; + case LTC_ASN1_GENERALIZEDTIME: + z = inlen; + if ((err = der_decode_generalizedtime(in + x, &z, data)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + break; + case LTC_ASN1_SET: z = inlen; if ((err = der_decode_set(in + x, z, data, size)) != CRYPT_OK) { diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index 5435381cd..d76f4036e 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -347,6 +347,25 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc } break; + case 0x18: + l->type = LTC_ASN1_GENERALIZEDTIME; + l->size = len; + + if ((l->data = XCALLOC(1, sizeof(ltc_generalizedtime))) == NULL) { + err = CRYPT_MEM; + goto error; + } + + if ((err = der_decode_generalizedtime(in, &len, l->data)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_generalizedtime(l->data, &len)) != CRYPT_OK) { + goto error; + } + + break; + case 0x20: /* Any CONSTRUCTED element that is neither SEQUENCE nor SET */ case 0x30: /* SEQUENCE */ case 0x31: /* SET */ diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index 8fa4ae0ed..ba2341277 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -69,6 +69,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_CHOICE: case LTC_ASN1_RAW_BIT_STRING: case LTC_ASN1_TELETEX_STRING: + case LTC_ASN1_GENERALIZEDTIME: ++x; break; @@ -121,6 +122,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) case LTC_ASN1_CHOICE: case LTC_ASN1_RAW_BIT_STRING: case LTC_ASN1_TELETEX_STRING: + case LTC_ASN1_GENERALIZEDTIME: LTC_SET_ASN1(list, x++, type, data, size); break; /* coverity[dead_error_line] */ diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index 0f17118bc..e7332073b 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -126,6 +126,13 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, y += x; break; + case LTC_ASN1_GENERALIZEDTIME: + if ((err = der_length_generalizedtime(data, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_SEQUENCE: @@ -307,6 +314,15 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, *outlen -= z; break; + case LTC_ASN1_GENERALIZEDTIME: + z = *outlen; + if ((err = der_encode_generalizedtime(data, out + x, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + x += z; + *outlen -= z; + break; + case LTC_ASN1_SET: z = *outlen; if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) { diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index cf17f7fae..3bd76bfc0 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -68,6 +68,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_RAW_BIT_STRING: + case LTC_ASN1_GENERALIZEDTIME: ++x; break; @@ -120,6 +121,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) case LTC_ASN1_SET: case LTC_ASN1_SETOF: case LTC_ASN1_RAW_BIT_STRING: + case LTC_ASN1_GENERALIZEDTIME: LTC_SET_ASN1(list, x++, type, data, size); break; diff --git a/src/pk/asn1/der/sequence/der_length_sequence.c b/src/pk/asn1/der/sequence/der_length_sequence.c index c7fec541c..99e427a39 100644 --- a/src/pk/asn1/der/sequence/der_length_sequence.c +++ b/src/pk/asn1/der/sequence/der_length_sequence.c @@ -122,6 +122,13 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, y += x; break; + case LTC_ASN1_GENERALIZEDTIME: + if ((err = der_length_generalizedtime(data, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + case LTC_ASN1_UTF8_STRING: if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) { goto LBL_ERR; diff --git a/src/pk/asn1/der/set/der_encode_set.c b/src/pk/asn1/der/set/der_encode_set.c index ae87697b5..75de23452 100644 --- a/src/pk/asn1/der/set/der_encode_set.c +++ b/src/pk/asn1/der/set/der_encode_set.c @@ -34,6 +34,7 @@ static int ltc_to_asn1(ltc_asn1_type v) case LTC_ASN1_TELETEX_STRING: return 0x14; case LTC_ASN1_IA5_STRING: return 0x16; case LTC_ASN1_UTCTIME: return 0x17; + case LTC_ASN1_GENERALIZEDTIME: return 0x18; case LTC_ASN1_SEQUENCE: return 0x30; case LTC_ASN1_SET: case LTC_ASN1_SETOF: return 0x31; diff --git a/testprof/der_tests.c b/testprof/der_tests.c index dcaf1b2a2..420ac0078 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -335,6 +335,19 @@ static void _der_tests_print_flexi(ltc_asn1_list* l, unsigned int level) text = buf; } break; + case LTC_ASN1_GENERALIZEDTIME: + name = "GENERALIZED TIME"; + { + ltc_generalizedtime* gt = l->data; + if(gt->fs) + snprintf(buf, sizeof(buf), "%04d-%02d-%02d %02d:%02d:%02d.%02dZ", + gt->YYYY, gt->MM, gt->DD, gt->hh, gt->mm, gt->ss, gt->fs); + else + snprintf(buf, sizeof(buf), "%04d-%02d-%02d %02d:%02d:%02dZ", + gt->YYYY, gt->MM, gt->DD, gt->hh, gt->mm, gt->ss); + text = buf; + } + break; case LTC_ASN1_CHOICE: name = "CHOICE"; break; From 59b4026fa7d19febe34e891d6e20f15affd35858 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 30 Mar 2017 18:58:28 +0200 Subject: [PATCH 0561/1192] Update makefiles --- libtomcrypt_VS2005.vcproj | 16 ++++++++++++++++ libtomcrypt_VS2008.vcproj | 16 ++++++++++++++++ makefile | 3 +++ makefile.icc | 3 +++ makefile.mingw | 3 +++ makefile.msvc | 3 +++ makefile.shared | 3 +++ makefile.unix | 3 +++ 8 files changed, 50 insertions(+) diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj index ec611293e..7658587b7 100644 --- a/libtomcrypt_VS2005.vcproj +++ b/libtomcrypt_VS2005.vcproj @@ -1456,6 +1456,22 @@ > + + + + + + + + diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 26c0efbd3..24f12d1f0 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -1697,6 +1697,22 @@ > + + + + + + + + diff --git a/makefile b/makefile index 140ef2b50..d3b80d59e 100644 --- a/makefile +++ b/makefile @@ -122,6 +122,9 @@ src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_b src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ diff --git a/makefile.icc b/makefile.icc index e16d71c8d..f7589e01d 100644 --- a/makefile.icc +++ b/makefile.icc @@ -179,6 +179,9 @@ src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_b src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ diff --git a/makefile.mingw b/makefile.mingw index 12d4de241..c18e362f5 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -115,6 +115,9 @@ src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_b src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ diff --git a/makefile.msvc b/makefile.msvc index 80ac0ccc6..cb325b101 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -89,6 +89,9 @@ src/pk/asn1/der/bit/der_decode_raw_bit_string.obj src/pk/asn1/der/bit/der_encode src/pk/asn1/der/bit/der_encode_raw_bit_string.obj src/pk/asn1/der/bit/der_length_bit_string.obj \ src/pk/asn1/der/boolean/der_decode_boolean.obj src/pk/asn1/der/boolean/der_encode_boolean.obj \ src/pk/asn1/der/boolean/der_length_boolean.obj src/pk/asn1/der/choice/der_decode_choice.obj \ +src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.obj \ +src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.obj \ +src/pk/asn1/der/generalizedtime/der_length_generalizedtime.obj \ src/pk/asn1/der/ia5/der_decode_ia5_string.obj src/pk/asn1/der/ia5/der_encode_ia5_string.obj \ src/pk/asn1/der/ia5/der_length_ia5_string.obj src/pk/asn1/der/integer/der_decode_integer.obj \ src/pk/asn1/der/integer/der_encode_integer.obj src/pk/asn1/der/integer/der_length_integer.obj \ diff --git a/makefile.shared b/makefile.shared index 0393caa23..d59c0dcb8 100644 --- a/makefile.shared +++ b/makefile.shared @@ -112,6 +112,9 @@ src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_b src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ diff --git a/makefile.unix b/makefile.unix index 59a3481f1..310bb1c15 100644 --- a/makefile.unix +++ b/makefile.unix @@ -120,6 +120,9 @@ src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_b src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ From 83780d4764d1c04c748b8d0446617981cccd3a2b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 30 Mar 2017 22:48:42 +0200 Subject: [PATCH 0562/1192] add timezone-offset support to GeneralizedTime this also fixes a bug in the length generation --- src/headers/tomcrypt_pk.h | 5 ++++- .../generalizedtime/der_decode_generalizedtime.c | 11 ++++++++++- .../generalizedtime/der_encode_generalizedtime.c | 9 ++++++++- .../generalizedtime/der_length_generalizedtime.c | 13 ++++++++++--- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index a39f5b808..60a11a9f5 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -672,7 +672,10 @@ typedef struct { hh, /* hour */ mm, /* minute */ ss, /* second */ - fs; /* fractional seconds */ + fs, /* fractional seconds */ + off_dir, /* timezone offset direction 0 == +, 1 == - */ + off_hh, /* timezone offset hours */ + off_mm; /* timezone offset minutes */ } ltc_generalizedtime; int der_encode_generalizedtime(ltc_generalizedtime *gtime, diff --git a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c index 0fd55791f..1f0713e28 100644 --- a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c @@ -110,7 +110,7 @@ YYYYMMDDhhmmss.[0-9]*Z return CRYPT_OK; } else if (buf[x] == '.') { x++; - while (buf[x] != 'Z') { + while (buf[x] >= '0' && buf[x] <= '9') { unsigned fs = out->fs; if (x >= sizeof(buf)) return CRYPT_INVALID_PACKET; out->fs *= 10; @@ -118,6 +118,15 @@ YYYYMMDDhhmmss.[0-9]*Z if (fs < out->fs) return CRYPT_OVERFLOW; x++; } + } + + /* now is it Z, +, - */ + if (buf[x] == 'Z') { + return CRYPT_OK; + } else if (buf[x] == '+' || buf[x] == '-') { + out->off_dir = (buf[x++] == '+') ? 0 : 1; + DECODE_V(out->off_hh, 24); + DECODE_V(out->off_mm, 60); return CRYPT_OK; } else { return CRYPT_INVALID_PACKET; diff --git a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c index 4852684ce..afb26c8f6 100644 --- a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c @@ -86,7 +86,14 @@ int der_encode_generalizedtime(ltc_generalizedtime *gtime, } out[x++] = der_ia5_char_encode(baseten[gtime->fs % 10]); } - out[x++] = der_ia5_char_encode('Z'); + + if (gtime->off_mm || gtime->off_hh) { + out[x++] = der_ia5_char_encode(gtime->off_dir ? '-' : '+'); + STORE_V(gtime->off_hh); + STORE_V(gtime->off_mm); + } else { + out[x++] = der_ia5_char_encode('Z'); + } /* store length */ out[1] = (unsigned char)(x - 2); diff --git a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c index eff3948b5..e5abf9f4a 100644 --- a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c @@ -31,15 +31,22 @@ int der_length_generalizedtime(ltc_generalizedtime *gtime, unsigned long *outlen if (gtime->fs == 0) { /* we encode as YYYYMMDDhhmmssZ */ - *outlen = 2 + 15; + *outlen = 2 + 14 + 1; } else { - /* we encode as YYYYMMDDhhmmss.fsZ */ - unsigned long len = 2 + 17; + unsigned long len = 2 + 14 + 1; unsigned fs = gtime->fs; do { fs /= 10; len++; } while(fs != 0); + if (gtime->off_hh == 0 && gtime->off_mm == 0) { + /* we encode as YYYYMMDDhhmmss.fsZ */ + len += 1; + } + else { + /* we encode as YYYYMMDDhhmmss.fs{+|-}hh'mm' */ + len += 5; + } *outlen = len; } From 1f0daf1eff8c8b5734d5299a5c1b683b8099e268 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 31 Mar 2017 00:57:22 +0200 Subject: [PATCH 0563/1192] fix compiler warning --- .../der/generalizedtime/der_encode_generalizedtime.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c index afb26c8f6..12b65e370 100644 --- a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c @@ -70,19 +70,19 @@ int der_encode_generalizedtime(ltc_generalizedtime *gtime, STORE_V(gtime->ss); if (gtime->fs) { - unsigned long div; + unsigned long divisor; unsigned fs = gtime->fs; unsigned len = 0; out[x++] = der_ia5_char_encode('.'); - div = 1; + divisor = 1; do { fs /= 10; - div *= 10; + divisor *= 10; len++; } while(fs != 0); while (len-- > 1) { - out[x++] = der_ia5_char_encode(baseten[(gtime->fs/div) % 10]); - div /= 10; + out[x++] = der_ia5_char_encode(baseten[(gtime->fs/divisor) % 10]); + divisor /= 10; } out[x++] = der_ia5_char_encode(baseten[gtime->fs % 10]); } From 08503a02f5612cfab79d415797e0418bc9ffaae9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 31 Mar 2017 15:12:12 +0200 Subject: [PATCH 0564/1192] update error codes This closes #180 --- src/headers/tomcrypt.h | 9 ++++++--- src/misc/error_to_string.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 6f661c798..40584e7aa 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -55,9 +55,12 @@ enum { CRYPT_FILE_NOTFOUND, /* File Not Found */ CRYPT_PK_INVALID_TYPE, /* Invalid type of PK key */ - CRYPT_OVERFLOW, /* An overflow of a value was prevented */ - CRYPT_PK_DUP, /* Duplicate key already in key ring */ - CRYPT_PK_NOT_FOUND, /* Key not found in keyring */ + + CRYPT_OVERFLOW, /* An overflow of a value was detected/prevented */ + + CRYPT_UNUSED1, /* UNUSED1 */ + CRYPT_UNUSED2, /* UNUSED2 */ + CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */ CRYPT_INVALID_PRIME_SIZE,/* Invalid size of prime requested */ diff --git a/src/misc/error_to_string.c b/src/misc/error_to_string.c index 2ca14923e..c3d08727f 100644 --- a/src/misc/error_to_string.c +++ b/src/misc/error_to_string.c @@ -45,9 +45,12 @@ static const char * const err_2_str[] = "File Not Found", "Invalid PK type.", - "Invalid PK system.", - "Duplicate PK key found on keyring.", - "Key not found in keyring.", + + "An overflow of a value was detected/prevented.", + + "UNUSED1.", + "UNUSED2.", + "Invalid sized parameter.", "Invalid size for prime.", From 2c52bf75f417e3f619da178ac0aa094d00e380b4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 31 Mar 2017 15:12:38 +0200 Subject: [PATCH 0565/1192] bugfixing --- .../der/generalizedtime/der_decode_generalizedtime.c | 12 +++++++++--- .../der/generalizedtime/der_encode_generalizedtime.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c index 1f0713e28..f8997ee91 100644 --- a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c @@ -76,7 +76,9 @@ int der_decode_generalizedtime(const unsigned char *in, unsigned long *inlen, if (y == -1) { return CRYPT_INVALID_PACKET; } - if (!((y >= '0' && y <= '9') || y == 'Z')) { + if (!((y >= '0' && y <= '9') + || y == 'Z' || y == '.' + || y == '+' || y == '-')) { return CRYPT_INVALID_PACKET; } buf[x] = y; @@ -89,7 +91,11 @@ int der_decode_generalizedtime(const unsigned char *in, unsigned long *inlen, /* possible encodings are YYYYMMDDhhmmssZ -YYYYMMDDhhmmss.[0-9]*Z +YYYYMMDDhhmmss+hh'mm' +YYYYMMDDhhmmss-hh'mm' +YYYYMMDDhhmmss.fsZ +YYYYMMDDhhmmss.fs+hh'mm' +YYYYMMDDhhmmss.fs-hh'mm' So let's do a trivial decode upto [including] ss */ @@ -115,7 +121,7 @@ YYYYMMDDhhmmss.[0-9]*Z if (x >= sizeof(buf)) return CRYPT_INVALID_PACKET; out->fs *= 10; out->fs += char_to_int(buf[x]); - if (fs < out->fs) return CRYPT_OVERFLOW; + if (fs > out->fs) return CRYPT_OVERFLOW; x++; } } diff --git a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c index 12b65e370..b2198d92e 100644 --- a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c @@ -81,8 +81,8 @@ int der_encode_generalizedtime(ltc_generalizedtime *gtime, len++; } while(fs != 0); while (len-- > 1) { - out[x++] = der_ia5_char_encode(baseten[(gtime->fs/divisor) % 10]); divisor /= 10; + out[x++] = der_ia5_char_encode(baseten[(gtime->fs/divisor) % 10]); } out[x++] = der_ia5_char_encode(baseten[gtime->fs % 10]); } From 78a32430d4fd73bf825fd9f84614eb5691029b51 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 31 Mar 2017 18:21:13 +0200 Subject: [PATCH 0566/1192] more tests --- testprof/der_tests.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 420ac0078..faa3b3bce 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -671,6 +671,7 @@ static void der_set_test(void) SEQUENCE { INTEGER 12345678 UTCTIME { 91, 5, 6, 16, 45, 40, 1, 7, 0 } + GENERALIZEDTIME { 2017, 03, 21, 10, 21, 12, 4, 1, 2, 0 } SEQUENCE { OCTET STRING { 1, 2, 3, 4 } BIT STRING { 1, 0, 0, 1 } @@ -695,6 +696,7 @@ static void der_flexi_test(void) static const char ia5_str[] = "ia5"; static const unsigned long int_val = 12345678UL; static const ltc_utctime utctime = { 91, 5, 6, 16, 45, 40, 1, 7, 0 }; + static const ltc_generalizedtime gtime = { 2017, 03, 21, 10, 21, 12, 421, 1, 2, 0 }; static const unsigned char oct_str[] = { 1, 2, 3, 4 }; static const unsigned char bit_str[] = { 1, 0, 0, 1 }; static const unsigned long oid_str[] = { 1, 2, 840, 113549 }; @@ -702,16 +704,17 @@ static void der_flexi_test(void) unsigned char encode_buf[192]; unsigned long encode_buf_len, decode_len; - ltc_asn1_list static_list[5][3], *decoded_list, *l; + ltc_asn1_list static_list[5][4], *decoded_list, *l; /* build list */ LTC_SET_ASN1(static_list[0], 0, LTC_ASN1_PRINTABLE_STRING, (void *)printable_str, strlen(printable_str)); LTC_SET_ASN1(static_list[0], 1, LTC_ASN1_IA5_STRING, (void *)ia5_str, strlen(ia5_str)); - LTC_SET_ASN1(static_list[0], 2, LTC_ASN1_SEQUENCE, static_list[1], 3); + LTC_SET_ASN1(static_list[0], 2, LTC_ASN1_SEQUENCE, static_list[1], 4); LTC_SET_ASN1(static_list[1], 0, LTC_ASN1_SHORT_INTEGER, (void *)&int_val, 1); LTC_SET_ASN1(static_list[1], 1, LTC_ASN1_UTCTIME, (void *)&utctime, 1); - LTC_SET_ASN1(static_list[1], 2, LTC_ASN1_SEQUENCE, static_list[2], 3); + LTC_SET_ASN1(static_list[1], 2, LTC_ASN1_GENERALIZEDTIME, (void *)>ime, 1); + LTC_SET_ASN1(static_list[1], 3, LTC_ASN1_SEQUENCE, static_list[2], 3); LTC_SET_ASN1(static_list[2], 0, LTC_ASN1_OCTET_STRING, (void *)oct_str, 4); LTC_SET_ASN1(static_list[2], 1, LTC_ASN1_BIT_STRING, (void *)bit_str, 4); @@ -854,6 +857,26 @@ static void der_flexi_test(void) /* move to next */ l = l->next; + /* GeneralizedTime */ + + if (l->next == NULL || l->child != NULL) { + fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); + exit(EXIT_FAILURE); + } + + if (l->type != LTC_ASN1_GENERALIZEDTIME) { + fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); + exit(EXIT_FAILURE); + } + + if (memcmp(l->data, >ime, sizeof(gtime))) { + fprintf(stderr, "(%d), %d, %lu, next=%p, prev=%p, parent=%p, child=%p\n", __LINE__, l->type, l->size, l->next, l->prev, l->parent, l->child); + exit(EXIT_FAILURE); + } + + /* move to next */ + l = l->next; + /* expect child anve move down */ if (l->next != NULL || l->child == NULL) { @@ -1008,6 +1031,7 @@ static int der_choice_test(void) unsigned long integer, oidbuf[10], outlen, inlen, x, y; void *mpinteger; ltc_utctime utctime = { 91, 5, 6, 16, 45, 40, 1, 7, 0 }; + ltc_generalizedtime gtime = { 2038, 01, 19, 3, 14, 8, 0, 0, 0, 0 }; /* setup variables */ for (x = 0; x < sizeof(bitbuf); x++) { bitbuf[x] = x & 1; } @@ -1030,7 +1054,11 @@ static int der_choice_test(void) LTC_SET_ASN1(types, 4, LTC_ASN1_INTEGER, mpinteger, 1); } LTC_SET_ASN1(types, 5, LTC_ASN1_OBJECT_IDENTIFIER, oidbuf, sizeof(oidbuf)/sizeof(oidbuf[0])); - LTC_SET_ASN1(types, 6, LTC_ASN1_UTCTIME, &utctime, 1); + if (x > 7) { + LTC_SET_ASN1(types, 6, LTC_ASN1_UTCTIME, &utctime, 1); + } else { + LTC_SET_ASN1(types, 6, LTC_ASN1_GENERALIZEDTIME, >ime, 1); + } LTC_SET_ASN1(host, 0, LTC_ASN1_CHOICE, types, 7); From df733f79fa806f1a305b044c3108e2b7cabf9805 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 2 Apr 2017 17:42:22 +0200 Subject: [PATCH 0567/1192] removing VS2005 residual that should be removed in #168 --- libtomcrypt_VS2005.vcproj | 2025 ------------------------------------- 1 file changed, 2025 deletions(-) delete mode 100644 libtomcrypt_VS2005.vcproj diff --git a/libtomcrypt_VS2005.vcproj b/libtomcrypt_VS2005.vcproj deleted file mode 100644 index 7658587b7..000000000 --- a/libtomcrypt_VS2005.vcproj +++ /dev/null @@ -1,2025 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 6844275e82d2da20973c2a169e86cd29e19e7619 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 2 Apr 2017 17:42:28 +0200 Subject: [PATCH 0568/1192] silence MSVC compiler warning --- src/hashes/sha3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index fbe12df11..1724b697e 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -173,7 +173,7 @@ int sha3_shake_init(hash_state *md, int num) LTC_ARGCHK(md != NULL); if (num != 128 && num != 256) return CRYPT_INVALID_ARG; XMEMSET(&md->sha3, 0, sizeof(md->sha3)); - md->sha3.capacity_words = 2 * num / (8 * sizeof(ulong64)); + md->sha3.capacity_words = (unsigned short)(2 * num / (8 * sizeof(ulong64))); return CRYPT_OK; } From ff6abc776c80cb7d93a02986c8252c8028186293 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 21 Mar 2017 19:42:54 +0100 Subject: [PATCH 0569/1192] RFC 7539 - ChaCha20 and Poly1305 + chacha based PRNG --- libtomcrypt_VS2008.vcproj | 100 +++++++ makefile | 34 ++- makefile.icc | 34 ++- makefile.mingw | 34 ++- makefile.msvc | 34 ++- makefile.shared | 34 ++- makefile.unix | 34 ++- .../chachapoly/chacha20poly1305_add_aad.c | 34 +++ .../chachapoly/chacha20poly1305_decrypt.c | 44 +++ .../chachapoly/chacha20poly1305_done.c | 41 +++ .../chachapoly/chacha20poly1305_encrypt.c | 44 +++ .../chachapoly/chacha20poly1305_init.c | 26 ++ .../chachapoly/chacha20poly1305_memory.c | 70 +++++ .../chachapoly/chacha20poly1305_setiv.c | 64 +++++ .../chacha20poly1305_setiv_rfc7905.c | 36 +++ .../chachapoly/chacha20poly1305_test.c | 70 +++++ src/headers/tomcrypt_cipher.h | 21 ++ src/headers/tomcrypt_custom.h | 8 + src/headers/tomcrypt_mac.h | 50 ++++ src/headers/tomcrypt_prng.h | 24 ++ src/mac/poly1305/poly1305.c | 264 ++++++++++++++++++ src/mac/poly1305/poly1305_file.c | 70 +++++ src/mac/poly1305/poly1305_memory.c | 49 ++++ src/mac/poly1305/poly1305_memory_multi.c | 63 +++++ src/mac/poly1305/poly1305_test.c | 50 ++++ src/misc/crypt/crypt.c | 9 + src/misc/crypt/crypt_sizes.c | 3 + src/prngs/chacha.c | 214 ++++++++++++++ src/stream/chacha/chacha_crypt.c | 90 ++++++ src/stream/chacha/chacha_ivctr32.c | 42 +++ src/stream/chacha/chacha_ivctr64.c | 42 +++ src/stream/chacha/chacha_keystream.c | 34 +++ src/stream/chacha/chacha_setup.c | 60 ++++ src/stream/chacha/chacha_test.c | 60 ++++ testprof/cipher_hash_test.c | 5 + testprof/mac_test.c | 6 + testprof/x86_prof.c | 6 + 37 files changed, 1831 insertions(+), 72 deletions(-) create mode 100644 src/encauth/chachapoly/chacha20poly1305_add_aad.c create mode 100644 src/encauth/chachapoly/chacha20poly1305_decrypt.c create mode 100644 src/encauth/chachapoly/chacha20poly1305_done.c create mode 100644 src/encauth/chachapoly/chacha20poly1305_encrypt.c create mode 100644 src/encauth/chachapoly/chacha20poly1305_init.c create mode 100644 src/encauth/chachapoly/chacha20poly1305_memory.c create mode 100644 src/encauth/chachapoly/chacha20poly1305_setiv.c create mode 100644 src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c create mode 100644 src/encauth/chachapoly/chacha20poly1305_test.c create mode 100644 src/mac/poly1305/poly1305.c create mode 100644 src/mac/poly1305/poly1305_file.c create mode 100644 src/mac/poly1305/poly1305_memory.c create mode 100644 src/mac/poly1305/poly1305_memory_multi.c create mode 100644 src/mac/poly1305/poly1305_test.c create mode 100644 src/prngs/chacha.c create mode 100644 src/stream/chacha/chacha_crypt.c create mode 100644 src/stream/chacha/chacha_ivctr32.c create mode 100644 src/stream/chacha/chacha_ivctr64.c create mode 100644 src/stream/chacha/chacha_keystream.c create mode 100644 src/stream/chacha/chacha_setup.c create mode 100644 src/stream/chacha/chacha_test.c diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 24f12d1f0..3214b22f4 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -591,6 +591,46 @@ > + + + + + + + + + + + + + + + + + + + + @@ -1147,6 +1187,30 @@ > + + + + + + + + + + + + @@ -2207,6 +2271,10 @@ + + @@ -2280,6 +2348,38 @@ > + + + + + + + + + + + + + + + + diff --git a/makefile b/makefile index d3b80d59e..afe08d054 100644 --- a/makefile +++ b/makefile @@ -49,15 +49,20 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ -src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ -src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ -src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ -src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ -src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ -src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ +src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ +src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ +src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ +src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ +src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ +src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ +src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ +src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ @@ -81,7 +86,9 @@ src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ @@ -173,8 +180,11 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ +src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ +src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.icc b/makefile.icc index f7589e01d..cc24d302d 100644 --- a/makefile.icc +++ b/makefile.icc @@ -106,15 +106,20 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ -src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ -src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ -src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ -src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ -src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ -src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ +src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ +src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ +src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ +src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ +src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ +src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ +src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ +src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ @@ -138,7 +143,9 @@ src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ @@ -230,8 +237,11 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ +src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ +src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.mingw b/makefile.mingw index c18e362f5..253c2829c 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -42,15 +42,20 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ -src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ -src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ -src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ -src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ -src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ -src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ +src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ +src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ +src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ +src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ +src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ +src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ +src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ +src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ @@ -74,7 +79,9 @@ src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ @@ -166,8 +173,11 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ +src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ +src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.msvc b/makefile.msvc index cb325b101..786c8d6c7 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -16,15 +16,20 @@ src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_add_aad.obj \ src/encauth/ccm/ccm_add_nonce.obj src/encauth/ccm/ccm_done.obj src/encauth/ccm/ccm_init.obj \ src/encauth/ccm/ccm_memory.obj src/encauth/ccm/ccm_process.obj src/encauth/ccm/ccm_reset.obj \ -src/encauth/ccm/ccm_test.obj src/encauth/eax/eax_addheader.obj src/encauth/eax/eax_decrypt.obj \ -src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj src/encauth/eax/eax_encrypt.obj \ -src/encauth/eax/eax_encrypt_authenticate_memory.obj src/encauth/eax/eax_init.obj \ -src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj src/encauth/gcm/gcm_add_iv.obj \ -src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj src/encauth/gcm/gcm_init.obj \ -src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj src/encauth/gcm/gcm_process.obj \ -src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj src/encauth/ocb/ocb_decrypt.obj \ -src/encauth/ocb/ocb_decrypt_verify_memory.obj src/encauth/ocb/ocb_done_decrypt.obj \ -src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \ +src/encauth/ccm/ccm_test.obj src/encauth/chachapoly/chacha20poly1305_add_aad.obj \ +src/encauth/chachapoly/chacha20poly1305_decrypt.obj src/encauth/chachapoly/chacha20poly1305_done.obj \ +src/encauth/chachapoly/chacha20poly1305_encrypt.obj src/encauth/chachapoly/chacha20poly1305_init.obj \ +src/encauth/chachapoly/chacha20poly1305_memory.obj src/encauth/chachapoly/chacha20poly1305_setiv.obj \ +src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.obj \ +src/encauth/chachapoly/chacha20poly1305_test.obj src/encauth/eax/eax_addheader.obj \ +src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \ +src/encauth/eax/eax_encrypt.obj src/encauth/eax/eax_encrypt_authenticate_memory.obj \ +src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \ +src/encauth/gcm/gcm_add_iv.obj src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj \ +src/encauth/gcm/gcm_init.obj src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj \ +src/encauth/gcm/gcm_process.obj src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj \ +src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \ +src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \ src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj \ src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj \ src/encauth/ocb3/ocb3_add_aad.obj src/encauth/ocb3/ocb3_decrypt.obj src/encauth/ocb3/ocb3_decrypt_last.obj \ @@ -48,7 +53,9 @@ src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj src/mac/pelican/pelican src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj \ src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \ -src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/xcbc/xcbc_done.obj \ +src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/poly1305/poly1305.obj \ +src/mac/poly1305/poly1305_file.obj src/mac/poly1305/poly1305_memory.obj \ +src/mac/poly1305/poly1305_memory_multi.obj src/mac/poly1305/poly1305_test.obj src/mac/xcbc/xcbc_done.obj \ src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \ src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \ src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ @@ -140,8 +147,11 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rs src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj \ src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_radix.obj src/pk/rsa/rsa_import_x509.obj \ src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_sign_saltlen_get.obj \ -src/pk/rsa/rsa_verify_hash.obj src/prngs/fortuna.obj src/prngs/rc4.obj src/prngs/rng_get_bytes.obj \ -src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj src/prngs/yarrow.obj +src/pk/rsa/rsa_verify_hash.obj src/prngs/chacha.obj src/prngs/fortuna.obj src/prngs/rc4.obj \ +src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ +src/prngs/yarrow.obj src/stream/chacha/chacha_crypt.obj src/stream/chacha/chacha_ivctr32.obj \ +src/stream/chacha/chacha_ivctr64.obj src/stream/chacha/chacha_keystream.obj \ +src/stream/chacha/chacha_setup.obj src/stream/chacha/chacha_test.obj HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.shared b/makefile.shared index d59c0dcb8..795204715 100644 --- a/makefile.shared +++ b/makefile.shared @@ -39,15 +39,20 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ -src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ -src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ -src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ -src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ -src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ -src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ +src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ +src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ +src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ +src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ +src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ +src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ +src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ +src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ @@ -71,7 +76,9 @@ src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ @@ -163,8 +170,11 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ +src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ +src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.unix b/makefile.unix index 310bb1c15..884d13fa8 100644 --- a/makefile.unix +++ b/makefile.unix @@ -47,15 +47,20 @@ src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphe src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \ -src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \ -src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \ -src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \ -src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \ -src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o src/encauth/gcm/gcm_process.o \ -src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o \ -src/encauth/ocb/ocb_decrypt_verify_memory.o src/encauth/ocb/ocb_done_decrypt.o \ -src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ +src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ +src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ +src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ +src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ +src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ +src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ +src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ +src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ @@ -79,7 +84,9 @@ src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ @@ -171,8 +178,11 @@ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_en src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ -src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o +src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ +src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ +src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/src/encauth/chachapoly/chacha20poly1305_add_aad.c b/src/encauth/chachapoly/chacha20poly1305_add_aad.c new file mode 100644 index 000000000..f840d2899 --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_add_aad.c @@ -0,0 +1,34 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +/** + Add AAD to the ChaCha20Poly1305 state + @param st The ChaCha20Poly1305 state + @param in The additional authentication data to add to the ChaCha20Poly1305 state + @param inlen The length of the ChaCha20Poly1305 data. + @return CRYPT_OK on success + */ +int chacha20poly1305_add_aad(chachapoly_state *st, const unsigned char *in, unsigned long inlen) +{ + int err; + + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(st != NULL); + + if (st->aadflg == 0) return CRYPT_ERROR; + if ((err = poly1305_process(&st->poly, in, inlen)) != CRYPT_OK) return err; + st->aadlen += (ulong64)inlen; + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/chachapoly/chacha20poly1305_decrypt.c b/src/encauth/chachapoly/chacha20poly1305_decrypt.c new file mode 100644 index 000000000..e62dd6a51 --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_decrypt.c @@ -0,0 +1,44 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +/** + Decrypt bytes of ciphertext with ChaCha20Poly1305 + @param st The ChaCha20Poly1305 state + @param in The ciphertext + @param inlen The length of the input (octets) + @param out [out] The plaintext (length inlen) + @return CRYPT_OK if successful +*/ +int chacha20poly1305_decrypt(chachapoly_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) +{ + unsigned char padzero[16] = { 0 }; + unsigned long padlen; + int err; + + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(st != NULL); + + if (st->aadflg) { + if ((padlen = 16 - (st->aadlen % 16)) < 16) { + if ((err = poly1305_process(&st->poly, padzero, padlen)) != CRYPT_OK) return err; + } + st->aadflg = 0; /* no more AAD */ + } + if (st->aadflg) st->aadflg = 0; /* no more AAD */ + if ((err = poly1305_process(&st->poly, in, inlen)) != CRYPT_OK) return err; + if ((err = chacha_crypt(&st->chacha, in, inlen, out)) != CRYPT_OK) return err; + st->ctlen += (ulong64)inlen; + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/chachapoly/chacha20poly1305_done.c b/src/encauth/chachapoly/chacha20poly1305_done.c new file mode 100644 index 000000000..fe25ab574 --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_done.c @@ -0,0 +1,41 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +/** + Terminate a ChaCha20Poly1305 stream + @param st The ChaCha20Poly1305 state + @param tag [out] The destination for the MAC tag + @param taglen [in/out] The length of the MAC tag + @return CRYPT_OK on success + */ +int chacha20poly1305_done(chachapoly_state *st, unsigned char *tag, unsigned long *taglen) +{ + unsigned char padzero[16] = { 0 }; + unsigned long padlen; + unsigned char buf[16]; + int err; + + LTC_ARGCHK(st != NULL); + + padlen = 16 - (st->ctlen % 16); + if (padlen < 16) { + if ((err = poly1305_process(&st->poly, padzero, padlen)) != CRYPT_OK) return err; + } + STORE64L(st->aadlen, buf); + STORE64L(st->ctlen, buf + 8); + if ((err = poly1305_process(&st->poly, buf, 16)) != CRYPT_OK) return err; + if ((err = poly1305_done(&st->poly, tag, taglen)) != CRYPT_OK) return err; + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/chachapoly/chacha20poly1305_encrypt.c b/src/encauth/chachapoly/chacha20poly1305_encrypt.c new file mode 100644 index 000000000..b1c1adc66 --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_encrypt.c @@ -0,0 +1,44 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +/** + Encrypt bytes of ciphertext with ChaCha20Poly1305 + @param st The ChaCha20Poly1305 state + @param in The plaintext + @param inlen The length of the input (octets) + @param out [out] The ciphertext (length inlen) + @return CRYPT_OK if successful +*/ +int chacha20poly1305_encrypt(chachapoly_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) +{ + unsigned char padzero[16] = { 0 }; + unsigned long padlen; + int err; + + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(st != NULL); + + if ((err = chacha_crypt(&st->chacha, in, inlen, out)) != CRYPT_OK) return err; + if (st->aadflg) { + padlen = 16 - (st->aadlen % 16); + if (padlen < 16) { + if ((err = poly1305_process(&st->poly, padzero, padlen)) != CRYPT_OK) return err; + } + st->aadflg = 0; /* no more AAD */ + } + if ((err = poly1305_process(&st->poly, out, inlen)) != CRYPT_OK) return err; + st->ctlen += (ulong64)inlen; + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/chachapoly/chacha20poly1305_init.c b/src/encauth/chachapoly/chacha20poly1305_init.c new file mode 100644 index 000000000..7cea6aa93 --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_init.c @@ -0,0 +1,26 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +/** + Initialize an ChaCha20Poly1305 context (only the key) + @param st [out] The destination of the ChaCha20Poly1305 state + @param key The secret key + @param keylen The length of the secret key (octets) + @return CRYPT_OK if successful +*/ +int chacha20poly1305_init(chachapoly_state *st, const unsigned char *key, unsigned long keylen) +{ + return chacha_setup(&st->chacha, key, keylen, 20); +} + +#endif diff --git a/src/encauth/chachapoly/chacha20poly1305_memory.c b/src/encauth/chachapoly/chacha20poly1305_memory.c new file mode 100644 index 000000000..09ee01fbb --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_memory.c @@ -0,0 +1,70 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +/** + Process an entire GCM packet in one call. + @param key The secret key + @param keylen The length of the secret key + @param iv The initial vector + @param ivlen The length of the initial vector + @param aad The additional authentication data (header) + @param aadlen The length of the aad + @param in The plaintext + @param inlen The length of the plaintext (ciphertext length is the same) + @param out The ciphertext + @param tag [out] The MAC tag + @param taglen [in/out] The MAC tag length + @param direction Encrypt or Decrypt mode (CHCHA20POLY1305_ENCRYPT or CHCHA20POLY1305_DECRYPT) + @return CRYPT_OK on success + */ +int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen, + const unsigned char *iv, unsigned long ivlen, + const unsigned char *aad, unsigned long aadlen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, + unsigned char *tag, unsigned long *taglen, + int direction) +{ + chachapoly_state st; + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(iv != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(tag != NULL); + + if ((err = chacha20poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = chacha20poly1305_setiv(&st, iv, ivlen)) != CRYPT_OK) { goto LBL_ERR; } + if (aad && aadlen > 0) { + if ((err = chacha20poly1305_add_aad(&st, aad, aadlen)) != CRYPT_OK) { goto LBL_ERR; } + } + if (direction == CHCHA20POLY1305_ENCRYPT) { + if ((err = chacha20poly1305_encrypt(&st, in, inlen, out)) != CRYPT_OK) { goto LBL_ERR; } + } + else if (direction == CHCHA20POLY1305_DECRYPT) { + if ((err = chacha20poly1305_decrypt(&st, in, inlen, out)) != CRYPT_OK) { goto LBL_ERR; } + } + else { + err = CRYPT_INVALID_ARG; + goto LBL_ERR; + } + err = chacha20poly1305_done(&st, tag, taglen); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(chachapoly_state)); +#endif + return err; +} + +#endif diff --git a/src/encauth/chachapoly/chacha20poly1305_setiv.c b/src/encauth/chachapoly/chacha20poly1305_setiv.c new file mode 100644 index 000000000..43c116bbd --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_setiv.c @@ -0,0 +1,64 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +/** + Set IV + counter data to the ChaCha20Poly1305 state and reset the context + @param st The ChaCha20Poly1305 state + @param iv The IV data to add + @param inlen The length of the IV (must be 12 or 8) + @return CRYPT_OK on success + */ +int chacha20poly1305_setiv(chachapoly_state *st, const unsigned char *iv, unsigned long ivlen) +{ + chacha_state tmp_st; + int i, err; + unsigned char polykey[32]; + + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(iv != NULL); + LTC_ARGCHK(ivlen == 12 || ivlen == 8); + + /* set IV for chacha20 */ + if (ivlen == 12) { + /* IV 96bit */ + if ((err = chacha_ivctr32(&st->chacha, iv, ivlen, 1)) != CRYPT_OK) return err; + } + else { + /* IV 64bit */ + if ((err = chacha_ivctr64(&st->chacha, iv, ivlen, 1)) != CRYPT_OK) return err; + } + + /* copy chacha20 key to temporary state */ + for(i = 0; i < 12; i++) tmp_st.input[i] = st->chacha.input[i]; + tmp_st.rounds = 20; + /* set IV */ + if (ivlen == 12) { + /* IV 32bit */ + if ((err = chacha_ivctr32(&tmp_st, iv, ivlen, 0)) != CRYPT_OK) return err; + } + else { + /* IV 64bit */ + if ((err = chacha_ivctr64(&tmp_st, iv, ivlen, 0)) != CRYPT_OK) return err; + } + /* (re)generate new poly1305 key */ + if ((err = chacha_keystream(&tmp_st, polykey, 32)) != CRYPT_OK) return err; + /* (re)initialise poly1305 */ + if ((err = poly1305_init(&st->poly, polykey, 32)) != CRYPT_OK) return err; + st->ctlen = 0; + st->aadlen = 0; + st->aadflg = 1; + + return CRYPT_OK; +} + +#endif diff --git a/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c b/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c new file mode 100644 index 000000000..5bb215636 --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c @@ -0,0 +1,36 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +/** + Set IV + counter data (with RFC7905-magic) to the ChaCha20Poly1305 state and reset the context + @param st The ChaCha20Poly1305 state + @param iv The IV data to add + @param inlen The length of the IV (must be 12 or 8) + @param sequence_number 64bit sequence number which is incorporated into IV as described in RFC7905 + @return CRYPT_OK on success + */ +int chacha20poly1305_setiv_rfc7905(chachapoly_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 sequence_number) +{ + int i; + unsigned char combined_iv[12] = { 0 }; + + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(iv != NULL); + LTC_ARGCHK(ivlen == 12); + + STORE64L(sequence_number, combined_iv + 4); + for (i = 0; i < 12; i++) combined_iv[i] = iv[i] ^ combined_iv[i]; + return chacha20poly1305_setiv(st, combined_iv, 12); +} + +#endif diff --git a/src/encauth/chachapoly/chacha20poly1305_test.c b/src/encauth/chachapoly/chacha20poly1305_test.c new file mode 100644 index 000000000..ab5360b9b --- /dev/null +++ b/src/encauth/chachapoly/chacha20poly1305_test.c @@ -0,0 +1,70 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA20POLY1305_MODE + +int chacha20poly1305_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + chachapoly_state st1, st2; + unsigned char k[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f }; + unsigned char iv[] = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47 }; + unsigned char aad[] = { 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 }; + unsigned char enc[] = { 0xD3, 0x1A, 0x8D, 0x34, 0x64, 0x8E, 0x60, 0xDB, 0x7B, 0x86, 0xAF, 0xBC, 0x53, 0xEF, 0x7E, 0xC2, + 0xA4, 0xAD, 0xED, 0x51, 0x29, 0x6E, 0x08, 0xFE, 0xA9, 0xE2, 0xB5, 0xA7, 0x36, 0xEE, 0x62, 0xD6, + 0x3D, 0xBE, 0xA4, 0x5E, 0x8C, 0xA9, 0x67, 0x12, 0x82, 0xFA, 0xFB, 0x69, 0xDA, 0x92, 0x72, 0x8B, + 0x1A, 0x71, 0xDE, 0x0A, 0x9E, 0x06, 0x0B, 0x29, 0x05, 0xD6, 0xA5, 0xB6, 0x7E, 0xCD, 0x3B, 0x36, + 0x92, 0xDD, 0xBD, 0x7F, 0x2D, 0x77, 0x8B, 0x8C, 0x98, 0x03, 0xAE, 0xE3, 0x28, 0x09, 0x1B, 0x58, + 0xFA, 0xB3, 0x24, 0xE4, 0xFA, 0xD6, 0x75, 0x94, 0x55, 0x85, 0x80, 0x8B, 0x48, 0x31, 0xD7, 0xBC, + 0x3F, 0xF4, 0xDE, 0xF0, 0x8E, 0x4B, 0x7A, 0x9D, 0xE5, 0x76, 0xD2, 0x65, 0x86, 0xCE, 0xC6, 0x4B, + 0x61, 0x16 }; + unsigned char tag[] = { 0x1A, 0xE1, 0x0B, 0x59, 0x4F, 0x09, 0xE2, 0x6A, 0x7E, 0x90, 0x2E, 0xCB, 0xD0, 0x60, 0x06, 0x91 }; + char m[] = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."; + unsigned long mlen = strlen(m); + unsigned long len; + unsigned char ct[1000], pt[1000], emac[16], dmac[16]; + + /* encrypt */ + chacha20poly1305_init(&st1, k, sizeof(k)); + chacha20poly1305_setiv(&st1, iv, sizeof(iv)); + chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); + /* encrypt piece by piece */ + chacha20poly1305_encrypt(&st1, (unsigned char *)m, 25, ct); + chacha20poly1305_encrypt(&st1, (unsigned char *)m + 25, 10, ct + 25); + chacha20poly1305_encrypt(&st1, (unsigned char *)m + 35, 35, ct + 35); + chacha20poly1305_encrypt(&st1, (unsigned char *)m + 70, 5, ct + 70); + chacha20poly1305_encrypt(&st1, (unsigned char *)m + 75, 5, ct + 75); + chacha20poly1305_encrypt(&st1, (unsigned char *)m + 80, mlen - 80, ct + 80); + len = sizeof(emac); + chacha20poly1305_done(&st1, emac, &len); + + if (compare_testvector(ct, mlen, enc, sizeof(enc), "ENC-CT", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(emac, len, tag, sizeof(tag), "ENC-TAG", 2) != 0) return CRYPT_FAIL_TESTVECTOR; + + /* decrypt */ + chacha20poly1305_init(&st2, k, len = sizeof(k)); + chacha20poly1305_setiv(&st2, iv, len = sizeof(iv)); + chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad)); + chacha20poly1305_decrypt(&st2, ct, 21, pt); + chacha20poly1305_decrypt(&st2, ct + 21, mlen - 21, pt + 21); + len = sizeof(dmac); + chacha20poly1305_done(&st2, dmac, &len); + + if (compare_testvector(pt, mlen, m, mlen, "DEC-PT", 3) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(dmac, len, tag, sizeof(tag), "DEC-TAG", 4) != 0) return CRYPT_FAIL_TESTVECTOR; + + return CRYPT_OK; +#endif +}; + +#endif diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index c9c68322f..36d0c0cc0 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -937,6 +937,27 @@ int cipher_is_valid(int idx); LTC_MUTEX_PROTO(ltc_cipher_mutex) +/* ---- stream ciphers ---- */ + +#ifdef LTC_CHACHA + +typedef struct { + ulong32 input[16]; + unsigned char kstream[64]; + unsigned long ksleft; + unsigned long ivlen; + int rounds; +} chacha_state; + +int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keylen, int rounds); +int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong32 counter); +int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 counter); +int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int chacha_keystream(chacha_state *st, unsigned char *out, unsigned long outlen); +int chacha_test(void); + +#endif /* LTC_CHACHA */ + /* $Source$ */ /* $Revision$ */ /* $Date$ */ diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 8b8ad6178..1d55322b8 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -189,6 +189,8 @@ #define LTC_KASUMI #define LTC_MULTI2 #define LTC_CAMELLIA +/* ChaCha is special (a stream cipher) */ +#define LTC_CHACHA #endif /* LTC_NO_CIPHERS */ @@ -255,6 +257,7 @@ #define LTC_XCBC #define LTC_F9_MODE #define LTC_PELICAN +#define LTC_POLY1305 /* ---> Encrypt + Authenticate Modes <--- */ @@ -264,6 +267,7 @@ #define LTC_OCB3_MODE #define LTC_CCM_MODE #define LTC_GCM_MODE +#define LTC_CHACHA20POLY1305_MODE /* Use 64KiB tables */ #ifndef LTC_NO_TABLES @@ -504,6 +508,10 @@ #error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled #endif +#if defined(LTC_CHACHA20POLY1305_MODE) && (!defined(LTC_CHACHA) || !defined(LTC_POLY1305)) + #error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA + LTC_POLY1305 +#endif + /* THREAD management */ #ifdef LTC_PTHREAD diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 1486aad39..e2b4a9f7a 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -96,6 +96,26 @@ void pmac_shift_xor(pmac_state *pmac); #endif /* PMAC */ +#ifdef LTC_POLY1305 +typedef struct { + ulong32 r[5]; + ulong32 h[5]; + ulong32 pad[4]; + unsigned long leftover; + unsigned char buffer[16]; + int final; +} poly_state; + +int poly1305_init(poly_state *st, const unsigned char *key, unsigned long keylen); +int poly1305_process(poly_state *st, const unsigned char *in, unsigned long inlen); +int poly1305_done(poly_state *st, unsigned char *mac, unsigned long *maclen); +int poly1305_test(void); +int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); +int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); +int poly1305_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); +int poly1305_test(void); +#endif /* LTC_POLY1305 */ + #ifdef LTC_EAX_MODE #if !(defined(LTC_OMAC) && defined(LTC_CTR_MODE)) @@ -477,6 +497,36 @@ int f9_test(void); #endif +#ifdef LTC_CHACHA20POLY1305_MODE + +typedef struct { + poly_state poly; + chacha_state chacha; + ulong64 aadlen; + ulong64 ctlen; + int aadflg; +} chachapoly_state; + +#define CHCHA20POLY1305_ENCRYPT 0 +#define CHCHA20POLY1305_DECRYPT 1 + +int chacha20poly1305_init(chachapoly_state *st, const unsigned char *key, unsigned long keylen); +int chacha20poly1305_setiv(chachapoly_state *st, const unsigned char *iv, unsigned long ivlen); +int chacha20poly1305_setiv_rfc7905(chachapoly_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 sequence_number); +int chacha20poly1305_add_aad(chachapoly_state *st, const unsigned char *in, unsigned long inlen); +int chacha20poly1305_encrypt(chachapoly_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int chacha20poly1305_decrypt(chachapoly_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int chacha20poly1305_done(chachapoly_state *st, unsigned char *tag, unsigned long *taglen); +int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen, + const unsigned char *iv, unsigned long ivlen, + const unsigned char *aad, unsigned long aadlen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, + unsigned char *tag, unsigned long *taglen, + int direction); +int chacha20poly1305_test(void); + +#endif /* LTC_CHACHA20POLY1305_MODE */ /* $Source$ */ /* $Revision$ */ diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index dc2cc7e04..e50f06c9b 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -15,6 +15,15 @@ struct rc4_prng { }; #endif +#ifdef LTC_CHACHA +struct chacha_prng { + chacha_state s; /* chacha state */ + unsigned char ent[40]; /* entropy buffer */ + unsigned long idx; /* entropy counter */ + short ready; /* ready flag 0-1 */ +}; +#endif + #ifdef LTC_FORTUNA struct fortuna_prng { hash_state pool[LTC_FORTUNA_POOLS]; /* the pools */ @@ -55,6 +64,9 @@ typedef union Prng_state { #ifdef LTC_RC4 struct rc4_prng rc4; #endif +#ifdef LTC_CHACHA + struct chacha_prng chacha; +#endif #ifdef LTC_FORTUNA struct fortuna_prng fortuna; #endif @@ -154,6 +166,18 @@ int rc4_test(void); extern const struct ltc_prng_descriptor rc4_desc; #endif +#ifdef LTC_CHACHA +int chacha_prng_start(prng_state *prng); +int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); +int chacha_prng_ready(prng_state *prng); +unsigned long chacha_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng); +int chacha_prng_done(prng_state *prng); +int chacha_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng); +int chacha_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng); +int chacha_prng_test(void); +extern const struct ltc_prng_descriptor chacha_prng_desc; +#endif + #ifdef LTC_SPRNG int sprng_start(prng_state *prng); int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); diff --git a/src/mac/poly1305/poly1305.c b/src/mac/poly1305/poly1305.c new file mode 100644 index 000000000..abb0f335a --- /dev/null +++ b/src/mac/poly1305/poly1305.c @@ -0,0 +1,264 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * Public Domain poly1305 from Andrew Moon + * https://github.com/floodyberry/poly1305-donna + */ + +#include "tomcrypt.h" + +#ifdef LTC_POLY1305 + +/* internal only */ +static void _poly1305_block(poly_state *st, const unsigned char *in, unsigned long inlen) +{ + const unsigned long hibit = (st->final) ? 0 : (1UL << 24); /* 1 << 128 */ + ulong32 r0,r1,r2,r3,r4; + ulong32 s1,s2,s3,s4; + ulong32 h0,h1,h2,h3,h4; + ulong32 tmp; + ulong64 d0,d1,d2,d3,d4; + ulong32 c; + + r0 = st->r[0]; + r1 = st->r[1]; + r2 = st->r[2]; + r3 = st->r[3]; + r4 = st->r[4]; + + s1 = r1 * 5; + s2 = r2 * 5; + s3 = r3 * 5; + s4 = r4 * 5; + + h0 = st->h[0]; + h1 = st->h[1]; + h2 = st->h[2]; + h3 = st->h[3]; + h4 = st->h[4]; + + while (inlen >= 16) { + /* h += in[i] */ + LOAD32L(tmp, in+ 0); h0 += (tmp ) & 0x3ffffff; + LOAD32L(tmp, in+ 3); h1 += (tmp >> 2) & 0x3ffffff; + LOAD32L(tmp, in+ 6); h2 += (tmp >> 4) & 0x3ffffff; + LOAD32L(tmp, in+ 9); h3 += (tmp >> 6) & 0x3ffffff; + LOAD32L(tmp, in+12); h4 += (tmp >> 8) | hibit; + + /* h *= r */ + d0 = ((ulong64)h0 * r0) + ((ulong64)h1 * s4) + ((ulong64)h2 * s3) + ((ulong64)h3 * s2) + ((ulong64)h4 * s1); + d1 = ((ulong64)h0 * r1) + ((ulong64)h1 * r0) + ((ulong64)h2 * s4) + ((ulong64)h3 * s3) + ((ulong64)h4 * s2); + d2 = ((ulong64)h0 * r2) + ((ulong64)h1 * r1) + ((ulong64)h2 * r0) + ((ulong64)h3 * s4) + ((ulong64)h4 * s3); + d3 = ((ulong64)h0 * r3) + ((ulong64)h1 * r2) + ((ulong64)h2 * r1) + ((ulong64)h3 * r0) + ((ulong64)h4 * s4); + d4 = ((ulong64)h0 * r4) + ((ulong64)h1 * r3) + ((ulong64)h2 * r2) + ((ulong64)h3 * r1) + ((ulong64)h4 * r0); + + /* (partial) h %= p */ + c = (ulong32)(d0 >> 26); h0 = (ulong32)d0 & 0x3ffffff; + d1 += c; c = (ulong32)(d1 >> 26); h1 = (ulong32)d1 & 0x3ffffff; + d2 += c; c = (ulong32)(d2 >> 26); h2 = (ulong32)d2 & 0x3ffffff; + d3 += c; c = (ulong32)(d3 >> 26); h3 = (ulong32)d3 & 0x3ffffff; + d4 += c; c = (ulong32)(d4 >> 26); h4 = (ulong32)d4 & 0x3ffffff; + h0 += c * 5; c = (h0 >> 26); h0 = h0 & 0x3ffffff; + h1 += c; + + in += 16; + inlen -= 16; + } + + st->h[0] = h0; + st->h[1] = h1; + st->h[2] = h2; + st->h[3] = h3; + st->h[4] = h4; +} + +/** + Initialize an POLY1305 context. + @param st The POLY1305 state + @param key The secret key + @param keylen The length of the secret key (octets) + @return CRYPT_OK if successful +*/ +int poly1305_init(poly_state *st, const unsigned char *key, unsigned long keylen) +{ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(keylen == 32); + + /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */ + LOAD32L(st->r[0], key + 0); st->r[0] = (st->r[0] ) & 0x3ffffff; + LOAD32L(st->r[1], key + 3); st->r[1] = (st->r[1] >> 2) & 0x3ffff03; + LOAD32L(st->r[2], key + 6); st->r[2] = (st->r[2] >> 4) & 0x3ffc0ff; + LOAD32L(st->r[3], key + 9); st->r[3] = (st->r[3] >> 6) & 0x3f03fff; + LOAD32L(st->r[4], key + 12); st->r[4] = (st->r[4] >> 8) & 0x00fffff; + + /* h = 0 */ + st->h[0] = 0; + st->h[1] = 0; + st->h[2] = 0; + st->h[3] = 0; + st->h[4] = 0; + + /* save pad for later */ + LOAD32L(st->pad[0], key + 16); + LOAD32L(st->pad[1], key + 20); + LOAD32L(st->pad[2], key + 24); + LOAD32L(st->pad[3], key + 28); + + st->leftover = 0; + st->final = 0; + return CRYPT_OK; +} + +/** + Process data through POLY1305 + @param st The POLY1305 state + @param in The data to send through HMAC + @param inlen The length of the data to HMAC (octets) + @return CRYPT_OK if successful +*/ +int poly1305_process(poly_state *st, const unsigned char *in, unsigned long inlen) +{ + unsigned long i; + + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(in != NULL); + + /* handle leftover */ + if (st->leftover) { + unsigned long want = (16 - st->leftover); + if (want > inlen) want = inlen; + for (i = 0; i < want; i++) st->buffer[st->leftover + i] = in[i]; + inlen -= want; + in += want; + st->leftover += want; + if (st->leftover < 16) return CRYPT_OK; + _poly1305_block(st, st->buffer, 16); + st->leftover = 0; + } + + /* process full blocks */ + if (inlen >= 16) { + unsigned long want = (inlen & ~(16 - 1)); + _poly1305_block(st, in, want); + in += want; + inlen -= want; + } + + /* store leftover */ + if (inlen) { + for (i = 0; i < inlen; i++) st->buffer[st->leftover + i] = in[i]; + st->leftover += inlen; + } + return CRYPT_OK; +} + +/** + Terminate a POLY1305 session + @param st The POLY1305 state + @param out [out] The destination of the POLY1305 authentication tag + @param outlen [in/out] The max size and resulting size of the POLY1305 authentication tag + @return CRYPT_OK if successful +*/ +int poly1305_done(poly_state *st, unsigned char *mac, unsigned long *maclen) +{ + ulong32 h0,h1,h2,h3,h4,c; + ulong32 g0,g1,g2,g3,g4; + ulong64 f; + ulong32 mask; + + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + LTC_ARGCHK(*maclen >= 16); + + /* process the remaining block */ + if (st->leftover) { + unsigned long i = st->leftover; + st->buffer[i++] = 1; + for (; i < 16; i++) st->buffer[i] = 0; + st->final = 1; + _poly1305_block(st, st->buffer, 16); + } + + /* fully carry h */ + h0 = st->h[0]; + h1 = st->h[1]; + h2 = st->h[2]; + h3 = st->h[3]; + h4 = st->h[4]; + + c = h1 >> 26; h1 = h1 & 0x3ffffff; + h2 += c; c = h2 >> 26; h2 = h2 & 0x3ffffff; + h3 += c; c = h3 >> 26; h3 = h3 & 0x3ffffff; + h4 += c; c = h4 >> 26; h4 = h4 & 0x3ffffff; + h0 += c * 5; c = h0 >> 26; h0 = h0 & 0x3ffffff; + h1 += c; + + /* compute h + -p */ + g0 = h0 + 5; c = g0 >> 26; g0 &= 0x3ffffff; + g1 = h1 + c; c = g1 >> 26; g1 &= 0x3ffffff; + g2 = h2 + c; c = g2 >> 26; g2 &= 0x3ffffff; + g3 = h3 + c; c = g3 >> 26; g3 &= 0x3ffffff; + g4 = h4 + c - (1UL << 26); + + /* select h if h < p, or h + -p if h >= p */ + mask = (g4 >> 31) - 1; + g0 &= mask; + g1 &= mask; + g2 &= mask; + g3 &= mask; + g4 &= mask; + mask = ~mask; + h0 = (h0 & mask) | g0; + h1 = (h1 & mask) | g1; + h2 = (h2 & mask) | g2; + h3 = (h3 & mask) | g3; + h4 = (h4 & mask) | g4; + + /* h = h % (2^128) */ + h0 = ((h0 ) | (h1 << 26)) & 0xffffffff; + h1 = ((h1 >> 6) | (h2 << 20)) & 0xffffffff; + h2 = ((h2 >> 12) | (h3 << 14)) & 0xffffffff; + h3 = ((h3 >> 18) | (h4 << 8)) & 0xffffffff; + + /* mac = (h + pad) % (2^128) */ + f = (ulong64)h0 + st->pad[0] ; h0 = (ulong32)f; + f = (ulong64)h1 + st->pad[1] + (f >> 32); h1 = (ulong32)f; + f = (ulong64)h2 + st->pad[2] + (f >> 32); h2 = (ulong32)f; + f = (ulong64)h3 + st->pad[3] + (f >> 32); h3 = (ulong32)f; + + STORE32L(h0, mac + 0); + STORE32L(h1, mac + 4); + STORE32L(h2, mac + 8); + STORE32L(h3, mac + 12); + + /* zero out the state */ + st->h[0] = 0; + st->h[1] = 0; + st->h[2] = 0; + st->h[3] = 0; + st->h[4] = 0; + st->r[0] = 0; + st->r[1] = 0; + st->r[2] = 0; + st->r[3] = 0; + st->r[4] = 0; + st->pad[0] = 0; + st->pad[1] = 0; + st->pad[2] = 0; + st->pad[3] = 0; + + *maclen = 16; + return CRYPT_OK; +} + +#endif diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c new file mode 100644 index 000000000..f11854e15 --- /dev/null +++ b/src/mac/poly1305/poly1305_file.c @@ -0,0 +1,70 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * Public Domain poly1305 from Andrew Moon + * https://github.com/floodyberry/poly1305-donna + */ + +#include "tomcrypt.h" + +#ifdef LTC_POLY1305 + +/** + POLY1305 a file + @param fname The name of the file you wish to POLY1305 + @param key The secret key + @param keylen The length of the secret key + @param out [out] The POLY1305 authentication tag + @param outlen [in/out] The max size and resulting size of the authentication tag + @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled +*/ +int poly1305_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen) +{ +#ifdef LTC_NO_FILE + return CRYPT_NOP; +#else + poly_state st; + FILE *in; + unsigned char *buf; + size_t x; + int err; + + LTC_ARGCHK(fname != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + if ((in = fopen(fname, "rb")) == NULL) { return CRYPT_FILE_NOTFOUND; } + if ((buf = XMALLOC(8196)) == NULL) { return CRYPT_MEM; } + if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + + do { + x = fread(buf, 1, sizeof(buf), in); + if ((err = poly1305_process(&st, buf, (unsigned long)x)) != CRYPT_OK) { + fclose(in); + goto LBL_ERR; + } + } while (x == sizeof(buf)); + if (fclose(in) != 0) { + err = CRYPT_ERROR; + goto LBL_ERR; + } + err = poly1305_done(&st, mac, maclen); + +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(poly_state)); +#endif + XFREE(buf); + return err; +#endif +}; + +#endif diff --git a/src/mac/poly1305/poly1305_memory.c b/src/mac/poly1305/poly1305_memory.c new file mode 100644 index 000000000..4ff2fe1ae --- /dev/null +++ b/src/mac/poly1305/poly1305_memory.c @@ -0,0 +1,49 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * Public Domain poly1305 from Andrew Moon + * https://github.com/floodyberry/poly1305-donna + */ + +#include "tomcrypt.h" + +#ifdef LTC_POLY1305 + +/** + POLY1305 a block of memory to produce the authentication tag + @param key The secret key + @param keylen The length of the secret key (octets) + @param in The data to POLY1305 + @param inlen The length of the data to POLY1305 (octets) + @param mac [out] Destination of the authentication tag + @param maclen [in/out] Max size and resulting size of authentication tag + @return CRYPT_OK if successful +*/ +int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen) +{ + poly_state st; + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = poly1305_process(&st, in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + err = poly1305_done(&st, mac, maclen); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(poly_state)); +#endif + return err; +}; + +#endif diff --git a/src/mac/poly1305/poly1305_memory_multi.c b/src/mac/poly1305/poly1305_memory_multi.c new file mode 100644 index 000000000..a8daec89f --- /dev/null +++ b/src/mac/poly1305/poly1305_memory_multi.c @@ -0,0 +1,63 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * Public Domain poly1305 from Andrew Moon + * https://github.com/floodyberry/poly1305-donna + */ + +#include "tomcrypt.h" +#include + +#ifdef LTC_POLY1305 + +/** + POLY1305 multiple blocks of memory to produce the authentication tag + @param key The secret key + @param keylen The length of the secret key (octets) + @param out [out] Destination of the authentication tag + @param outlen [in/out] Max size and resulting size of authentication tag + @param in The data to POLY1305 + @param inlen The length of the data to POLY1305 (octets) + @param ... tuples of (data,len) pairs to POLY1305, terminated with a (NULL,x) (x=don't care) + @return CRYPT_OK if successful +*/ +int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...) +{ + poly_state st; + int err; + va_list args; + const unsigned char *curptr; + unsigned long curlen; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + va_start(args, inlen); + curptr = in; + curlen = inlen; + if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + for (;;) { + if ((err = poly1305_process(&st, curptr, curlen)) != CRYPT_OK) { goto LBL_ERR; } + curptr = va_arg(args, const unsigned char*); + if (curptr == NULL) break; + curlen = va_arg(args, unsigned long); + } + err = poly1305_done(&st, mac, maclen); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(poly_state)); +#endif + va_end(args); + return err; +}; + +#endif diff --git a/src/mac/poly1305/poly1305_test.c b/src/mac/poly1305/poly1305_test.c new file mode 100644 index 000000000..218ee2e2c --- /dev/null +++ b/src/mac/poly1305/poly1305_test.c @@ -0,0 +1,50 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * Public Domain poly1305 from Andrew Moon + * https://github.com/floodyberry/poly1305-donna + */ + +#include "tomcrypt.h" + +#ifdef LTC_POLY1305 + +int poly1305_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + /* https://tools.ietf.org/html/rfc7539#section-2.5.2 */ + unsigned char k[] = { 0x85, 0xd6, 0xbe, 0x78, 0x57, 0x55, 0x6d, 0x33, 0x7f, 0x44, 0x52, 0xfe, 0x42, 0xd5, 0x06, 0xa8, 0x01, 0x03, 0x80, 0x8a, 0xfb, 0x0d, 0xb2, 0xfd, 0x4a, 0xbf, 0xf6, 0xaf, 0x41, 0x49, 0xf5, 0x1b }; + unsigned char tag[] = { 0xA8, 0x06, 0x1D, 0xC1, 0x30, 0x51, 0x36, 0xC6, 0xC2, 0x2B, 0x8B, 0xAF, 0x0C, 0x01, 0x27, 0xA9 }; + char m[] = "Cryptographic Forum Research Group"; + unsigned long len = 16, mlen = strlen(m); + unsigned char out[1000]; + poly_state st; + /* process piece by piece */ + poly1305_init(&st, k, 32); + poly1305_process(&st, (unsigned char*)m, 5); + poly1305_process(&st, (unsigned char*)m + 5, 4); + poly1305_process(&st, (unsigned char*)m + 9, 3); + poly1305_process(&st, (unsigned char*)m + 12, 2); + poly1305_process(&st, (unsigned char*)m + 14, 1); + poly1305_process(&st, (unsigned char*)m + 15, mlen - 15); + poly1305_done(&st, out, &len); + if (compare_testvector(out, len, tag, sizeof(tag), "POLY1305-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + /* process in one go */ + poly1305_init(&st, k, 32); + poly1305_process(&st, (unsigned char*)m, mlen); + poly1305_done(&st, out, &len); + if (compare_testvector(out, len, tag, sizeof(tag), "POLY1305-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + return CRYPT_OK; +#endif +}; + +#endif diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 192cad20a..d97d101db 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -124,6 +124,9 @@ const char *crypt_build_settings = #if defined(LTC_CAMELLIA) " Camellia\n" #endif +#if defined(LTC_CHACHA) + " ChaCha\n" +#endif "\nHashes built-in:\n" #if defined(LTC_SHA3) @@ -230,6 +233,9 @@ const char *crypt_build_settings = #if defined(LTC_F9_MODE) " F9\n" #endif +#if defined(LTC_POLY1305) + " POLY1305\n" +#endif "\nENC + AUTH modes:\n" #if defined(LTC_EAX_MODE) @@ -254,6 +260,9 @@ const char *crypt_build_settings = #endif "\n" #endif +#if defined(LTC_CHACHA20POLY1305_MODE) + " CHACHA20POLY1305\n" +#endif "\nPRNG:\n" #if defined(LTC_YARROW) diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 9a5cdd9c7..15b437fc2 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -223,6 +223,9 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_FORTUNA _SZ_STRINGIFY_S(fortuna_prng), #endif +#ifdef LTC_CHACHA + _SZ_STRINGIFY_S(chacha_prng), +#endif #ifdef LTC_RC4 _SZ_STRINGIFY_S(rc4_prng), #endif diff --git a/src/prngs/chacha.c b/src/prngs/chacha.c new file mode 100644 index 000000000..2d2d28682 --- /dev/null +++ b/src/prngs/chacha.c @@ -0,0 +1,214 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA + +const struct ltc_prng_descriptor chacha_prng_desc = +{ + "chacha", + sizeof(chacha_state), + &chacha_prng_start, + &chacha_prng_add_entropy, + &chacha_prng_ready, + &chacha_prng_read, + &chacha_prng_done, + &chacha_prng_export, + &chacha_prng_import, + &chacha_prng_test +}; + +/** + Start the PRNG + @param prng[out] The PRNG state to initialize + @return CRYPT_OK if successful +*/ +int chacha_prng_start(prng_state *prng) +{ + LTC_ARGCHK(prng != NULL); + prng->chacha.ready = 0; + XMEMSET(&prng->chacha.ent, 0, 40); + prng->chacha.idx = 0; + return CRYPT_OK; +} + +/** + Add entropy to the PRNG state + @param in The data to add + @param inlen Length of the data to add + @param prng PRNG state to update + @return CRYPT_OK if successful +*/ +int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) +{ + unsigned char buf[40]; + unsigned long i; + int err; + + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen > 0); + + if (prng->chacha.ready) { + /* chacha_prng_ready() was already called, do "rekey" operation */ + if ((err = chacha_keystream(&prng->chacha.s, buf, 40)) != CRYPT_OK) return err; + for(i = 0; i < inlen; i++) buf[i % 40] ^= in[i]; + /* key 32 bytes, 20 rounds */ + if ((err = chacha_setup(&prng->chacha.s, buf, 32, 20)) != CRYPT_OK) return err; + /* iv 8 bytes */ + if ((err = chacha_ivctr64(&prng->chacha.s, buf + 32, 8, 0)) != CRYPT_OK) return err; + } + else { + /* chacha_prng_ready() was not called yet, add entropy to ent buffer */ + while (inlen--) prng->chacha.ent[prng->chacha.idx++ % 40] ^= *in++; + } + + return CRYPT_OK; +} + +/** + Make the PRNG ready to read from + @param prng The PRNG to make active + @return CRYPT_OK if successful +*/ +int chacha_prng_ready(prng_state *prng) +{ + int err; + + LTC_ARGCHK(prng != NULL); + + /* key 32 bytes, 20 rounds */ + if ((err = chacha_setup(&prng->chacha.s, prng->chacha.ent, 32, 20)) != CRYPT_OK) return err; + /* iv 8 bytes */ + if ((err = chacha_ivctr64(&prng->chacha.s, prng->chacha.ent + 32, 8, 0)) != CRYPT_OK) return err; + XMEMSET(&prng->chacha.ent, 0, 40); + prng->chacha.ready = 1; + prng->chacha.idx = 0; + return CRYPT_OK; +} + +/** + Read from the PRNG + @param out Destination + @param outlen Length of output + @param prng The active PRNG to read from + @return Number of octets read +*/ +unsigned long chacha_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) +{ + if (chacha_keystream(&prng->chacha.s, out, outlen) != CRYPT_OK) return 0; + return outlen; +} + +/** + Terminate the PRNG + @param prng The PRNG to terminate + @return CRYPT_OK if successful +*/ +int chacha_prng_done(prng_state *prng) +{ + LTC_UNUSED_PARAM(prng); + prng->chacha.ready = 0; + XMEMSET(&prng->chacha.s, 0, sizeof(chacha_state)); + return CRYPT_OK; +} + +/** + Export the PRNG state + @param out [out] Destination + @param outlen [in/out] Max size and resulting size of the state + @param prng The PRNG to export + @return CRYPT_OK if successful +*/ +int chacha_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) +{ + unsigned long len = sizeof(chacha_state); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(prng != NULL); + + if (!prng->chacha.ready) { + return CRYPT_ERROR; + } + if (*outlen < len) { + *outlen = len; + return CRYPT_BUFFER_OVERFLOW; + } + XMEMCPY(out, &prng->chacha.s, len); + *outlen = len; + return CRYPT_OK; +} + +/** + Import a PRNG state + @param in The PRNG state + @param inlen Size of the state + @param prng The PRNG to import + @return CRYPT_OK if successful +*/ +int chacha_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) +{ + unsigned long len = sizeof(chacha_state); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(prng != NULL); + + if (inlen != len) return CRYPT_INVALID_ARG; + XMEMCPY(&prng->chacha.s, in, inlen); + prng->chacha.ready = 1; + return CRYPT_OK; +} + +/** + PRNG self-test + @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled +*/ +int chacha_prng_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + prng_state st; + unsigned char en[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, + 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32 }; + unsigned char dmp[300]; + unsigned long dmplen = sizeof(dmp); + unsigned char out[500]; + unsigned char t1[] = { 0x59, 0xb2, 0x26, 0x95, 0x2b, 0x01, 0x8f, 0x05, 0xbe, 0xd8 }; + unsigned char t2[] = { 0x30, 0x34, 0x5c, 0x6e, 0x56, 0x18, 0x8c, 0x46, 0xbe, 0x8a }; + + chacha_prng_start(&st); + chacha_prng_add_entropy(en, sizeof(en), &st); /* add entropy to uninitialized prng */ + chacha_prng_ready(&st); + chacha_prng_read(out, 10, &st); /* 10 bytes for testing */ + if (compare_testvector(out, 10, t1, sizeof(t1), "CHACHA-PRNG", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + chacha_prng_read(out, 500, &st); + chacha_prng_add_entropy(en, sizeof(en), &st); /* add entropy to already initialized prng */ + chacha_prng_read(out, 500, &st); + chacha_prng_export(dmp, &dmplen, &st); + chacha_prng_read(out, 500, &st); /* skip 500 bytes */ + chacha_prng_read(out, 10, &st); /* 10 bytes for testing */ + if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 2) != 0) return CRYPT_FAIL_TESTVECTOR; + chacha_prng_done(&st); + + XMEMSET(&st, 0xFF, sizeof(st)); /* just to be sure */ + chacha_prng_import(dmp, dmplen, &st); + chacha_prng_read(out, 500, &st); /* skip 500 bytes */ + chacha_prng_read(out, 10, &st); /* 10 bytes for testing */ + if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 3) != 0) return CRYPT_FAIL_TESTVECTOR; + chacha_prng_done(&st); + + return CRYPT_OK; +#endif +} + +#endif diff --git a/src/stream/chacha/chacha_crypt.c b/src/stream/chacha/chacha_crypt.c new file mode 100644 index 000000000..dbd7e9cb3 --- /dev/null +++ b/src/stream/chacha/chacha_crypt.c @@ -0,0 +1,90 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * chacha-ref.c version 20080118 + * Public domain from D. J. Bernstein + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA + +#define QUARTERROUND(a,b,c,d) \ + x[a] += x[b]; x[d] = ROL(x[d] ^ x[a], 16); \ + x[c] += x[d]; x[b] = ROL(x[b] ^ x[c], 12); \ + x[a] += x[b]; x[d] = ROL(x[d] ^ x[a], 8); \ + x[c] += x[d]; x[b] = ROL(x[b] ^ x[c], 7); + +static void _chacha_block(unsigned char *output, const ulong32 *input, int rounds) +{ + ulong32 x[16]; + int i; + XMEMCPY(x, input, sizeof(x)); + for (i = rounds; i > 0; i -= 2) { + QUARTERROUND(0, 4, 8,12) + QUARTERROUND(1, 5, 9,13) + QUARTERROUND(2, 6,10,14) + QUARTERROUND(3, 7,11,15) + QUARTERROUND(0, 5,10,15) + QUARTERROUND(1, 6,11,12) + QUARTERROUND(2, 7, 8,13) + QUARTERROUND(3, 4, 9,14) + } + for (i = 0; i < 16; ++i) { + x[i] += input[i]; + STORE32L(x[i], output + 4 * i); + } +} + +/** + Encrypt (or decrypt) bytes of ciphertext (or plaintext) with ChaCha + @param st The ChaCha state + @param in The plaintext (or ciphertext) + @param inlen The length of the input (octets) + @param out [out] The ciphertext (or plaintext), length inlen + @return CRYPT_OK if successful +*/ +int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) +{ + unsigned char buf[64]; + unsigned long i, j; + + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + + if (st->ksleft > 0) { + j = MIN(st->ksleft, inlen); + for (i = 0; i < j; ++i, st->ksleft--) out[i] = in[i] ^ st->kstream[64 - st->ksleft]; + inlen -= j; + if (inlen == 0) return CRYPT_OK; + out += j; + in += j; + } + for (;;) { + _chacha_block(buf, st->input, st->rounds); + /* increment the counter */ + if (!++st->input[12] && !++st->input[13] && !++st->input[14]) { ++st->input[15]; } + if (inlen <= 64) { + for (i = 0; i < inlen; ++i) out[i] = in[i] ^ buf[i]; + st->ksleft = 64 - inlen; + for (i = inlen; i < 64; ++i) st->kstream[i] = buf[i]; + return CRYPT_OK; + } + for (i = 0; i < 64; ++i) out[i] = in[i] ^ buf[i]; + inlen -= 64; + out += 64; + in += 64; + } + return CRYPT_OK; +}; + +#endif diff --git a/src/stream/chacha/chacha_ivctr32.c b/src/stream/chacha/chacha_ivctr32.c new file mode 100644 index 000000000..64dc83853 --- /dev/null +++ b/src/stream/chacha/chacha_ivctr32.c @@ -0,0 +1,42 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * chacha-ref.c version 20080118 + * Public domain from D. J. Bernstein + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA + +/** + Set IV + counter data to the ChaCha state + @param st The ChaCha20 state + @param iv The IV data to add + @param inlen The length of the IV (must be 12) + @param counter 32bit (unsigned) initial counter value + @return CRYPT_OK on success + */ +int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong32 counter) +{ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(iv != NULL); + /* 96bit IV + 32bit counter */ + LTC_ARGCHK(ivlen == 12); + + st->input[12] = counter; + LOAD32L(st->input[13], iv + 0); + LOAD32L(st->input[14], iv + 4); + LOAD32L(st->input[15], iv + 8); + st->ksleft = 0; + return CRYPT_OK; +}; + +#endif diff --git a/src/stream/chacha/chacha_ivctr64.c b/src/stream/chacha/chacha_ivctr64.c new file mode 100644 index 000000000..c2826bb75 --- /dev/null +++ b/src/stream/chacha/chacha_ivctr64.c @@ -0,0 +1,42 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * chacha-ref.c version 20080118 + * Public domain from D. J. Bernstein + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA + +/** + Set IV + counter data to the ChaCha state + @param st The ChaCha20 state + @param iv The IV data to add + @param inlen The length of the IV (must be 8) + @param counter 64bit (unsigned) initial counter value + @return CRYPT_OK on success + */ +int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 counter) +{ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(iv != NULL); + /* 64bit IV + 64bit counter */ + LTC_ARGCHK(ivlen == 8); + + st->input[12] = (ulong32)(counter & 0xFFFFFFFF); + st->input[13] = (ulong32)(counter >> 32); + LOAD32L(st->input[14], iv + 0); + LOAD32L(st->input[15], iv + 4); + st->ksleft = 0; + return CRYPT_OK; +}; + +#endif diff --git a/src/stream/chacha/chacha_keystream.c b/src/stream/chacha/chacha_keystream.c new file mode 100644 index 000000000..b45323f2f --- /dev/null +++ b/src/stream/chacha/chacha_keystream.c @@ -0,0 +1,34 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * chacha-ref.c version 20080118 + * Public domain from D. J. Bernstein + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA + +/** + Generate a stream of random bytes via ChaCha + @param st The ChaCha20 state + @param out [out] The output buffer + @param outlen The output length + @return CRYPT_OK on success + */ +int chacha_keystream(chacha_state *st, unsigned char *out, unsigned long outlen) +{ + if (outlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(out != NULL); + XMEMSET(out, 0, outlen); + return chacha_crypt(st, out, outlen, out); +} + +#endif diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c new file mode 100644 index 000000000..f56f667ac --- /dev/null +++ b/src/stream/chacha/chacha_setup.c @@ -0,0 +1,60 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * chacha-ref.c version 20080118 + * Public domain from D. J. Bernstein + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA + +static const char sigma[16] = "expand 32-byte k"; +static const char tau[16] = "expand 16-byte k"; + +/** + Initialize an ChaCha context (only the key) + @param st [out] The destination of the ChaCha state + @param key The secret key + @param keylen The length of the secret key (octets) + @param rounds Number of rounds (e.g. 20 for ChaCha20) + @return CRYPT_OK if successful +*/ +int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keylen, int rounds) +{ + const char *constants; + + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(keylen == 32 || keylen == 16); + + LOAD32L(st->input[4], key + 0); + LOAD32L(st->input[5], key + 4); + LOAD32L(st->input[6], key + 8); + LOAD32L(st->input[7], key + 12); + if (keylen == 32) { /* 256bit */ + key += 16; + constants = sigma; + } else { /* 128bit */ + constants = tau; + } + LOAD32L(st->input[8], key + 0); + LOAD32L(st->input[9], key + 4); + LOAD32L(st->input[10], key + 8); + LOAD32L(st->input[11], key + 12); + LOAD32L(st->input[0], constants + 0); + LOAD32L(st->input[1], constants + 4); + LOAD32L(st->input[2], constants + 8); + LOAD32L(st->input[3], constants + 12); + st->rounds = rounds; /* e.g. 20 for chacha20 */ + return CRYPT_OK; +}; + +#endif diff --git a/src/stream/chacha/chacha_test.c b/src/stream/chacha/chacha_test.c new file mode 100644 index 000000000..49a35f543 --- /dev/null +++ b/src/stream/chacha/chacha_test.c @@ -0,0 +1,60 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * chacha-ref.c version 20080118 + * Public domain from D. J. Bernstein + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA + +int chacha_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned long len; + unsigned char out[1000]; + /* https://tools.ietf.org/html/rfc7539#section-2.4.2 */ + unsigned char k[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; + unsigned char n[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00 }; + unsigned char ct[] = { 0x6E, 0x2E, 0x35, 0x9A, 0x25, 0x68, 0xF9, 0x80, 0x41, 0xBA, 0x07, 0x28, 0xDD, 0x0D, 0x69, 0x81, + 0xE9, 0x7E, 0x7A, 0xEC, 0x1D, 0x43, 0x60, 0xC2, 0x0A, 0x27, 0xAF, 0xCC, 0xFD, 0x9F, 0xAE, 0x0B, + 0xF9, 0x1B, 0x65, 0xC5, 0x52, 0x47, 0x33, 0xAB, 0x8F, 0x59, 0x3D, 0xAB, 0xCD, 0x62, 0xB3, 0x57, + 0x16, 0x39, 0xD6, 0x24, 0xE6, 0x51, 0x52, 0xAB, 0x8F, 0x53, 0x0C, 0x35, 0x9F, 0x08, 0x61, 0xD8, + 0x07, 0xCA, 0x0D, 0xBF, 0x50, 0x0D, 0x6A, 0x61, 0x56, 0xA3, 0x8E, 0x08, 0x8A, 0x22, 0xB6, 0x5E, + 0x52, 0xBC, 0x51, 0x4D, 0x16, 0xCC, 0xF8, 0x06, 0x81, 0x8C, 0xE9, 0x1A, 0xB7, 0x79, 0x37, 0x36, + 0x5A, 0xF9, 0x0B, 0xBF, 0x74, 0xA3, 0x5B, 0xE6, 0xB4, 0x0B, 0x8E, 0xED, 0xF2, 0x78, 0x5E, 0x42, + 0x87, 0x4D }; + char pt[] = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."; + chacha_state st; + + len = strlen(pt); + /* crypt piece by piece */ + chacha_setup(&st, k, sizeof(k), 20); + chacha_ivctr32(&st, n, sizeof(n), 1); + chacha_crypt(&st, (unsigned char*)pt, 35, out); + chacha_crypt(&st, (unsigned char*)pt + 35, 35, out + 35); + chacha_crypt(&st, (unsigned char*)pt + 70, 5, out + 70); + chacha_crypt(&st, (unsigned char*)pt + 75, 5, out + 75); + chacha_crypt(&st, (unsigned char*)pt + 80, len - 80, out + 80); + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + /* crypt in one go */ + chacha_setup(&st, k, sizeof(k), 20); + chacha_ivctr32(&st, n, sizeof(n), 1); + chacha_crypt(&st, (unsigned char*)pt, len, out); + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + return CRYPT_OK; +#endif +} + +#endif diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index 36d19886e..d7f582abc 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -14,6 +14,11 @@ int cipher_hash_test(void) DOX(cipher_descriptor[x].test(), cipher_descriptor[x].name); } +#ifdef LTC_CHACHA + /* ChaCha is a special case (stream cipher) */ + DO(chacha_test()); +#endif + /* test hashes */ for (x = 0; hash_descriptor[x].name != NULL; x++) { DOX(hash_descriptor[x].test(), hash_descriptor[x].name); diff --git a/testprof/mac_test.c b/testprof/mac_test.c index d6666b2df..e8897cac1 100644 --- a/testprof/mac_test.c +++ b/testprof/mac_test.c @@ -35,6 +35,12 @@ int mac_test(void) #endif #ifdef LTC_PELICAN DO(pelican_test()); +#endif +#ifdef LTC_POLY1305 + DO(poly1305_test()); +#endif +#ifdef LTC_CHACHA20POLY1305_MODE + DO(chacha20poly1305_test()); #endif return 0; } diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 0d2e0fc1a..d4c6fe6cd 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -330,6 +330,9 @@ static void _unregister_all(void) #ifdef LTC_RC4 unregister_prng(&rc4_desc); #endif +#ifdef LTC_CHACHA + unregister_prng(&chacha_prng_desc); +#endif #ifdef LTC_SOBER128 unregister_prng(&sober128_desc); #endif @@ -497,6 +500,9 @@ register_prng(&fortuna_desc); #ifdef LTC_RC4 register_prng(&rc4_desc); #endif +#ifdef LTC_CHACHA +register_prng(&chacha_prng_desc); +#endif #ifdef LTC_SOBER128 register_prng(&sober128_desc); #endif From c8cb714e086df31a55df75e044fb7d0200e6a0e7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 29 Mar 2017 19:50:53 +0200 Subject: [PATCH 0570/1192] added chacha_done --- .../chachapoly/chacha20poly1305_done.c | 1 + src/headers/tomcrypt_cipher.h | 1 + src/prngs/chacha.c | 7 ++--- src/stream/chacha/chacha_done.c | 31 +++++++++++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 src/stream/chacha/chacha_done.c diff --git a/src/encauth/chachapoly/chacha20poly1305_done.c b/src/encauth/chachapoly/chacha20poly1305_done.c index fe25ab574..efe98b902 100644 --- a/src/encauth/chachapoly/chacha20poly1305_done.c +++ b/src/encauth/chachapoly/chacha20poly1305_done.c @@ -35,6 +35,7 @@ int chacha20poly1305_done(chachapoly_state *st, unsigned char *tag, unsigned lon STORE64L(st->ctlen, buf + 8); if ((err = poly1305_process(&st->poly, buf, 16)) != CRYPT_OK) return err; if ((err = poly1305_done(&st->poly, tag, taglen)) != CRYPT_OK) return err; + if ((err = chacha_done(&st->chacha)) != CRYPT_OK) return err; return CRYPT_OK; } diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index 36d0c0cc0..03cf80d4b 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -954,6 +954,7 @@ int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivle int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 counter); int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); int chacha_keystream(chacha_state *st, unsigned char *out, unsigned long outlen); +int chacha_done(chacha_state *st); int chacha_test(void); #endif /* LTC_CHACHA */ diff --git a/src/prngs/chacha.c b/src/prngs/chacha.c index 2d2d28682..5a2ad557e 100644 --- a/src/prngs/chacha.c +++ b/src/prngs/chacha.c @@ -103,6 +103,7 @@ int chacha_prng_ready(prng_state *prng) */ unsigned long chacha_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) { + LTC_ARGCHK(prng != NULL); if (chacha_keystream(&prng->chacha.s, out, outlen) != CRYPT_OK) return 0; return outlen; } @@ -114,10 +115,8 @@ unsigned long chacha_prng_read(unsigned char *out, unsigned long outlen, prng_st */ int chacha_prng_done(prng_state *prng) { - LTC_UNUSED_PARAM(prng); - prng->chacha.ready = 0; - XMEMSET(&prng->chacha.s, 0, sizeof(chacha_state)); - return CRYPT_OK; + LTC_ARGCHK(prng != NULL); + return chacha_done(&prng->chacha.s); } /** diff --git a/src/stream/chacha/chacha_done.c b/src/stream/chacha/chacha_done.c new file mode 100644 index 000000000..0fbff2026 --- /dev/null +++ b/src/stream/chacha/chacha_done.c @@ -0,0 +1,31 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* The implementation is based on: + * chacha-ref.c version 20080118 + * Public domain from D. J. Bernstein + */ + +#include "tomcrypt.h" + +#ifdef LTC_CHACHA + +/** + Terminate and clear ChaCha state + @param st The ChaCha state + @return CRYPT_OK on success +*/ +int chacha_done(chacha_state *st) +{ + LTC_ARGCHK(st != NULL); + XMEMSET(st, 0, sizeof(chacha_state)); + return CRYPT_OK; +}; + +#endif From 3cfb58c2f42c0480f031bed59dfa276995cd1209 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 22:37:32 +0200 Subject: [PATCH 0571/1192] update makefiles --- libtomcrypt_VS2008.vcproj | 4 ++++ makefile | 6 +++--- makefile.icc | 6 +++--- makefile.mingw | 6 +++--- makefile.msvc | 6 +++--- makefile.shared | 6 +++--- makefile.unix | 6 +++--- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 3214b22f4..ba4d548c5 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2358,6 +2358,10 @@ RelativePath="src\stream\chacha\chacha_crypt.c" > + + diff --git a/makefile b/makefile index afe08d054..cbcdb82e8 100644 --- a/makefile +++ b/makefile @@ -182,9 +182,9 @@ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509 src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ -src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ -src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.icc b/makefile.icc index cc24d302d..7f3d83833 100644 --- a/makefile.icc +++ b/makefile.icc @@ -239,9 +239,9 @@ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509 src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ -src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ -src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.mingw b/makefile.mingw index 253c2829c..4d5b669df 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -175,9 +175,9 @@ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509 src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ -src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ -src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.msvc b/makefile.msvc index 786c8d6c7..cd556c3c2 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -149,9 +149,9 @@ src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_radix.obj src/pk/rsa/rsa_import_ src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_sign_saltlen_get.obj \ src/pk/rsa/rsa_verify_hash.obj src/prngs/chacha.obj src/prngs/fortuna.obj src/prngs/rc4.obj \ src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ -src/prngs/yarrow.obj src/stream/chacha/chacha_crypt.obj src/stream/chacha/chacha_ivctr32.obj \ -src/stream/chacha/chacha_ivctr64.obj src/stream/chacha/chacha_keystream.obj \ -src/stream/chacha/chacha_setup.obj src/stream/chacha/chacha_test.obj +src/prngs/yarrow.obj src/stream/chacha/chacha_crypt.obj src/stream/chacha/chacha_done.obj \ +src/stream/chacha/chacha_ivctr32.obj src/stream/chacha/chacha_ivctr64.obj \ +src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/stream/chacha/chacha_test.obj HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.shared b/makefile.shared index 795204715..8ff756420 100644 --- a/makefile.shared +++ b/makefile.shared @@ -172,9 +172,9 @@ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509 src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ -src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ -src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.unix b/makefile.unix index 884d13fa8..e7d37128c 100644 --- a/makefile.unix +++ b/makefile.unix @@ -180,9 +180,9 @@ src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509 src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha.o src/prngs/fortuna.o src/prngs/rc4.o \ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_ivctr32.o \ -src/stream/chacha/chacha_ivctr64.o src/stream/chacha/chacha_keystream.o \ -src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ From a517db251471c6fe834f2d858e44216b6eaff22d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 29 Mar 2017 19:54:01 +0200 Subject: [PATCH 0572/1192] cosmetics --- src/stream/chacha/chacha_done.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/stream/chacha/chacha_done.c b/src/stream/chacha/chacha_done.c index 0fbff2026..2e25177b3 100644 --- a/src/stream/chacha/chacha_done.c +++ b/src/stream/chacha/chacha_done.c @@ -7,11 +7,6 @@ * guarantee it works. */ -/* The implementation is based on: - * chacha-ref.c version 20080118 - * Public domain from D. J. Bernstein - */ - #include "tomcrypt.h" #ifdef LTC_CHACHA From 53c00d14e590d7a1c1a2d444fb8d026688dbedf7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 17:38:46 +0200 Subject: [PATCH 0573/1192] test for chacha_ivctr64 --- src/stream/chacha/chacha_test.c | 36 +++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/stream/chacha/chacha_test.c b/src/stream/chacha/chacha_test.c index 49a35f543..9e17b9323 100644 --- a/src/stream/chacha/chacha_test.c +++ b/src/stream/chacha/chacha_test.c @@ -24,17 +24,25 @@ int chacha_test(void) unsigned long len; unsigned char out[1000]; /* https://tools.ietf.org/html/rfc7539#section-2.4.2 */ - unsigned char k[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; - unsigned char n[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00 }; - unsigned char ct[] = { 0x6E, 0x2E, 0x35, 0x9A, 0x25, 0x68, 0xF9, 0x80, 0x41, 0xBA, 0x07, 0x28, 0xDD, 0x0D, 0x69, 0x81, - 0xE9, 0x7E, 0x7A, 0xEC, 0x1D, 0x43, 0x60, 0xC2, 0x0A, 0x27, 0xAF, 0xCC, 0xFD, 0x9F, 0xAE, 0x0B, - 0xF9, 0x1B, 0x65, 0xC5, 0x52, 0x47, 0x33, 0xAB, 0x8F, 0x59, 0x3D, 0xAB, 0xCD, 0x62, 0xB3, 0x57, - 0x16, 0x39, 0xD6, 0x24, 0xE6, 0x51, 0x52, 0xAB, 0x8F, 0x53, 0x0C, 0x35, 0x9F, 0x08, 0x61, 0xD8, - 0x07, 0xCA, 0x0D, 0xBF, 0x50, 0x0D, 0x6A, 0x61, 0x56, 0xA3, 0x8E, 0x08, 0x8A, 0x22, 0xB6, 0x5E, - 0x52, 0xBC, 0x51, 0x4D, 0x16, 0xCC, 0xF8, 0x06, 0x81, 0x8C, 0xE9, 0x1A, 0xB7, 0x79, 0x37, 0x36, - 0x5A, 0xF9, 0x0B, 0xBF, 0x74, 0xA3, 0x5B, 0xE6, 0xB4, 0x0B, 0x8E, 0xED, 0xF2, 0x78, 0x5E, 0x42, - 0x87, 0x4D }; + unsigned char k[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; + unsigned char n[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00 }; + unsigned char ct[] = { 0x6E, 0x2E, 0x35, 0x9A, 0x25, 0x68, 0xF9, 0x80, 0x41, 0xBA, 0x07, 0x28, 0xDD, 0x0D, 0x69, 0x81, + 0xE9, 0x7E, 0x7A, 0xEC, 0x1D, 0x43, 0x60, 0xC2, 0x0A, 0x27, 0xAF, 0xCC, 0xFD, 0x9F, 0xAE, 0x0B, + 0xF9, 0x1B, 0x65, 0xC5, 0x52, 0x47, 0x33, 0xAB, 0x8F, 0x59, 0x3D, 0xAB, 0xCD, 0x62, 0xB3, 0x57, + 0x16, 0x39, 0xD6, 0x24, 0xE6, 0x51, 0x52, 0xAB, 0x8F, 0x53, 0x0C, 0x35, 0x9F, 0x08, 0x61, 0xD8, + 0x07, 0xCA, 0x0D, 0xBF, 0x50, 0x0D, 0x6A, 0x61, 0x56, 0xA3, 0x8E, 0x08, 0x8A, 0x22, 0xB6, 0x5E, + 0x52, 0xBC, 0x51, 0x4D, 0x16, 0xCC, 0xF8, 0x06, 0x81, 0x8C, 0xE9, 0x1A, 0xB7, 0x79, 0x37, 0x36, + 0x5A, 0xF9, 0x0B, 0xBF, 0x74, 0xA3, 0x5B, 0xE6, 0xB4, 0x0B, 0x8E, 0xED, 0xF2, 0x78, 0x5E, 0x42, + 0x87, 0x4D }; + unsigned char ct2[] = { 0x6E, 0x2E, 0x35, 0x9A, 0x25, 0x68, 0xF9, 0x80, 0x41, 0xBA, 0x07, 0x28, 0xDD, 0x0D, 0x69, 0x81, + 0xE9, 0x7E, 0x7A, 0xEC, 0x1D, 0x43, 0x60, 0xC2, 0x0A, 0x27, 0xAF, 0xCC, 0xFD, 0x9F, 0xAE, 0x0B, + 0xF9, 0x1B, 0x65, 0xC5, 0x52, 0x47, 0x33, 0xAB, 0x8F, 0x59, 0x3D, 0xAB, 0xCD, 0x62, 0xB3, 0x57, + 0x16, 0x39, 0xD6, 0x24, 0xE6, 0x51, 0x52, 0xAB, 0x8F, 0x53, 0x0C, 0x35, 0x9F, 0x08, 0x61, 0xD8, + 0x07, 0xCA, 0x0D, 0xBF, 0x50, 0x0D, 0x6A, 0x61, 0x56, 0xA3, 0x8E, 0x08, 0x8A, 0x22, 0xB6, 0x5E, + 0x52, 0xBC, 0x51, 0x4D, 0x16, 0xCC, 0xF8, 0x06, 0x81, 0x8C, 0xE9, 0x1A, 0xB7, 0x79, 0x37, 0x36, + 0x5A, 0xF9, 0x0B, 0xBF, 0x74, 0xA3, 0x5B, 0xE6, 0xB4, 0x0B, 0x8E, 0xED, 0xF2, 0x78, 0x5E, 0x42, + 0x87, 0x4D }; char pt[] = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."; chacha_state st; @@ -53,6 +61,12 @@ int chacha_test(void) chacha_ivctr32(&st, n, sizeof(n), 1); chacha_crypt(&st, (unsigned char*)pt, len, out); if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + /* crypt in one go - using chacha_ivctr64() */ + chacha_setup(&st, k, sizeof(k), 20); + chacha_ivctr64(&st, n + 4, sizeof(n) - 4, 1); + chacha_crypt(&st, (unsigned char*)pt, len, out); + if (compare_testvector(out, len, ct2, sizeof(ct2), "CHACHA-TV3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + return CRYPT_OK; #endif } From 5797b0cc1e54d093c38e800d6c10c4ed28ce600b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 17:40:18 +0200 Subject: [PATCH 0574/1192] test for chacha_ivctr64 (2) --- src/stream/chacha/chacha_test.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/stream/chacha/chacha_test.c b/src/stream/chacha/chacha_test.c index 9e17b9323..9894204f4 100644 --- a/src/stream/chacha/chacha_test.c +++ b/src/stream/chacha/chacha_test.c @@ -24,25 +24,17 @@ int chacha_test(void) unsigned long len; unsigned char out[1000]; /* https://tools.ietf.org/html/rfc7539#section-2.4.2 */ - unsigned char k[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; - unsigned char n[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00 }; - unsigned char ct[] = { 0x6E, 0x2E, 0x35, 0x9A, 0x25, 0x68, 0xF9, 0x80, 0x41, 0xBA, 0x07, 0x28, 0xDD, 0x0D, 0x69, 0x81, - 0xE9, 0x7E, 0x7A, 0xEC, 0x1D, 0x43, 0x60, 0xC2, 0x0A, 0x27, 0xAF, 0xCC, 0xFD, 0x9F, 0xAE, 0x0B, - 0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9, 0x0B, 0xBF, 0x74, 0xA3, 0x5B, 0xE6, 0xB4, 0x0B, 0x8E, 0xED, 0xF2, 0x78, 0x5E, 0x42, - 0x87, 0x4D }; + unsigned char k[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; + unsigned char n[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00 }; + unsigned char ct[] = { 0x6E, 0x2E, 0x35, 0x9A, 0x25, 0x68, 0xF9, 0x80, 0x41, 0xBA, 0x07, 0x28, 0xDD, 0x0D, 0x69, 0x81, + 0xE9, 0x7E, 0x7A, 0xEC, 0x1D, 0x43, 0x60, 0xC2, 0x0A, 0x27, 0xAF, 0xCC, 0xFD, 0x9F, 0xAE, 0x0B, + 0xF9, 0x1B, 0x65, 0xC5, 0x52, 0x47, 0x33, 0xAB, 0x8F, 0x59, 0x3D, 0xAB, 0xCD, 0x62, 0xB3, 0x57, + 0x16, 0x39, 0xD6, 0x24, 0xE6, 0x51, 0x52, 0xAB, 0x8F, 0x53, 0x0C, 0x35, 0x9F, 0x08, 0x61, 0xD8, + 0x07, 0xCA, 0x0D, 0xBF, 0x50, 0x0D, 0x6A, 0x61, 0x56, 0xA3, 0x8E, 0x08, 0x8A, 0x22, 0xB6, 0x5E, + 0x52, 0xBC, 0x51, 0x4D, 0x16, 0xCC, 0xF8, 0x06, 0x81, 0x8C, 0xE9, 0x1A, 0xB7, 0x79, 0x37, 0x36, + 0x5A, 0xF9, 0x0B, 0xBF, 0x74, 0xA3, 0x5B, 0xE6, 0xB4, 0x0B, 0x8E, 0xED, 0xF2, 0x78, 0x5E, 0x42, + 0x87, 0x4D }; char pt[] = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."; chacha_state st; @@ -65,7 +57,7 @@ int chacha_test(void) chacha_setup(&st, k, sizeof(k), 20); chacha_ivctr64(&st, n + 4, sizeof(n) - 4, 1); chacha_crypt(&st, (unsigned char*)pt, len, out); - if (compare_testvector(out, len, ct2, sizeof(ct2), "CHACHA-TV3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; return CRYPT_OK; #endif From 31b52a354d35b7eb35255a40f162841882c1dd91 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 17:42:15 +0200 Subject: [PATCH 0575/1192] padlen in chacha20poly1305_decrypt --- src/encauth/chachapoly/chacha20poly1305_decrypt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/encauth/chachapoly/chacha20poly1305_decrypt.c b/src/encauth/chachapoly/chacha20poly1305_decrypt.c index e62dd6a51..bc8b6c144 100644 --- a/src/encauth/chachapoly/chacha20poly1305_decrypt.c +++ b/src/encauth/chachapoly/chacha20poly1305_decrypt.c @@ -29,7 +29,8 @@ int chacha20poly1305_decrypt(chachapoly_state *st, const unsigned char *in, unsi LTC_ARGCHK(st != NULL); if (st->aadflg) { - if ((padlen = 16 - (st->aadlen % 16)) < 16) { + padlen = 16 - (st->aadlen % 16); + if (padlen < 16) { if ((err = poly1305_process(&st->poly, padzero, padlen)) != CRYPT_OK) return err; } st->aadflg = 0; /* no more AAD */ From 39028bbeed9c2cf3cc99f99b3d59fc469d0675f5 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 20:21:33 +0200 Subject: [PATCH 0576/1192] more tests in chacha20poly1305_test --- .../chachapoly/chacha20poly1305_test.c | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/encauth/chachapoly/chacha20poly1305_test.c b/src/encauth/chachapoly/chacha20poly1305_test.c index ab5360b9b..006c096c8 100644 --- a/src/encauth/chachapoly/chacha20poly1305_test.c +++ b/src/encauth/chachapoly/chacha20poly1305_test.c @@ -32,6 +32,9 @@ int chacha20poly1305_test(void) char m[] = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."; unsigned long mlen = strlen(m); unsigned long len; + unsigned char rfc7905_pt[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + unsigned char rfc7905_enc[] = { 0xE4, 0x62, 0x85, 0xB4, 0x29, 0x95, 0x34, 0x96, 0xAB, 0xFB, 0x67, 0xCD, 0xAE, 0xAC, 0x94, 0x1E }; + unsigned char rfc7905_tag[] = { 0x16, 0x2C, 0x92, 0x48, 0x2A, 0xDB, 0xD3, 0x5D, 0x48, 0xBE, 0xC6, 0xFF, 0x10, 0x9C, 0xBA, 0xE4 }; unsigned char ct[1000], pt[1000], emac[16], dmac[16]; /* encrypt */ @@ -63,6 +66,42 @@ int chacha20poly1305_test(void) if (compare_testvector(pt, mlen, m, mlen, "DEC-PT", 3) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(dmac, len, tag, sizeof(tag), "DEC-TAG", 4) != 0) return CRYPT_FAIL_TESTVECTOR; + /* chacha20poly1305_memory - encrypt */ + len = sizeof(emac); + chacha20poly1305_memory(k, sizeof(k), iv, sizeof(iv), aad, sizeof(aad), + (unsigned char *)m, mlen, ct, emac, &len, CHCHA20POLY1305_ENCRYPT); + if (compare_testvector(ct, mlen, enc, sizeof(enc), "ENC-CT2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(emac, len, tag, sizeof(tag), "ENC-TAG2", 2) != 0) return CRYPT_FAIL_TESTVECTOR; + + /* chacha20poly1305_memory - decrypt */ + len = sizeof(dmac); + chacha20poly1305_memory(k, sizeof(k), iv, sizeof(iv), aad, sizeof(aad), + ct, mlen, pt, dmac, &len, CHCHA20POLY1305_DECRYPT); + if (compare_testvector(pt, mlen, m, mlen, "DEC-PT2", 3) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(dmac, len, tag, sizeof(tag), "DEC-TAG2", 4) != 0) return CRYPT_FAIL_TESTVECTOR; + + /* encrypt - rfc7905 */ + chacha20poly1305_init(&st1, k, sizeof(k)); + chacha20poly1305_setiv_rfc7905(&st1, iv, sizeof(iv), CONST64(0x1122334455667788)); + chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); + chacha20poly1305_encrypt(&st1, rfc7905_pt, 16, ct); + len = sizeof(emac); + chacha20poly1305_done(&st1, emac, &len); + + if (compare_testvector(ct, 16, rfc7905_enc, 16, "ENC-CT3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(emac, len, rfc7905_tag, 16, "ENC-TAG3", 2) != 0) return CRYPT_FAIL_TESTVECTOR; + + /* decrypt - rfc7905 */ + chacha20poly1305_init(&st1, k, sizeof(k)); + chacha20poly1305_setiv_rfc7905(&st1, iv, sizeof(iv), CONST64(0x1122334455667788)); + chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); + chacha20poly1305_decrypt(&st1, ct, 16, pt); + len = sizeof(dmac); + chacha20poly1305_done(&st1, dmac, &len); + + if (compare_testvector(pt, 16, rfc7905_pt, 16, "DEC-CT3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(dmac, len, rfc7905_tag, 16, "DEC-TAG3", 2) != 0) return CRYPT_FAIL_TESTVECTOR; + return CRYPT_OK; #endif }; From 11a9dc50b3b1fda65c12ed227c49040d3db185ab Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 20:26:44 +0200 Subject: [PATCH 0577/1192] poly_state > poly1305_state --- src/headers/tomcrypt_mac.h | 10 +++++----- src/mac/poly1305/poly1305.c | 8 ++++---- src/mac/poly1305/poly1305_file.c | 4 ++-- src/mac/poly1305/poly1305_memory.c | 4 ++-- src/mac/poly1305/poly1305_memory_multi.c | 4 ++-- src/mac/poly1305/poly1305_test.c | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index e2b4a9f7a..4adc7c0c1 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -104,11 +104,11 @@ typedef struct { unsigned long leftover; unsigned char buffer[16]; int final; -} poly_state; +} poly1305_state; -int poly1305_init(poly_state *st, const unsigned char *key, unsigned long keylen); -int poly1305_process(poly_state *st, const unsigned char *in, unsigned long inlen); -int poly1305_done(poly_state *st, unsigned char *mac, unsigned long *maclen); +int poly1305_init(poly1305_state *st, const unsigned char *key, unsigned long keylen); +int poly1305_process(poly1305_state *st, const unsigned char *in, unsigned long inlen); +int poly1305_done(poly1305_state *st, unsigned char *mac, unsigned long *maclen); int poly1305_test(void); int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); @@ -500,7 +500,7 @@ int f9_test(void); #ifdef LTC_CHACHA20POLY1305_MODE typedef struct { - poly_state poly; + poly1305_state poly; chacha_state chacha; ulong64 aadlen; ulong64 ctlen; diff --git a/src/mac/poly1305/poly1305.c b/src/mac/poly1305/poly1305.c index abb0f335a..369341b61 100644 --- a/src/mac/poly1305/poly1305.c +++ b/src/mac/poly1305/poly1305.c @@ -17,7 +17,7 @@ #ifdef LTC_POLY1305 /* internal only */ -static void _poly1305_block(poly_state *st, const unsigned char *in, unsigned long inlen) +static void _poly1305_block(poly1305_state *st, const unsigned char *in, unsigned long inlen) { const unsigned long hibit = (st->final) ? 0 : (1UL << 24); /* 1 << 128 */ ulong32 r0,r1,r2,r3,r4; @@ -86,7 +86,7 @@ static void _poly1305_block(poly_state *st, const unsigned char *in, unsigned lo @param keylen The length of the secret key (octets) @return CRYPT_OK if successful */ -int poly1305_init(poly_state *st, const unsigned char *key, unsigned long keylen) +int poly1305_init(poly1305_state *st, const unsigned char *key, unsigned long keylen) { LTC_ARGCHK(st != NULL); LTC_ARGCHK(key != NULL); @@ -124,7 +124,7 @@ int poly1305_init(poly_state *st, const unsigned char *key, unsigned long keylen @param inlen The length of the data to HMAC (octets) @return CRYPT_OK if successful */ -int poly1305_process(poly_state *st, const unsigned char *in, unsigned long inlen) +int poly1305_process(poly1305_state *st, const unsigned char *in, unsigned long inlen) { unsigned long i; @@ -168,7 +168,7 @@ int poly1305_process(poly_state *st, const unsigned char *in, unsigned long inle @param outlen [in/out] The max size and resulting size of the POLY1305 authentication tag @return CRYPT_OK if successful */ -int poly1305_done(poly_state *st, unsigned char *mac, unsigned long *maclen) +int poly1305_done(poly1305_state *st, unsigned char *mac, unsigned long *maclen) { ulong32 h0,h1,h2,h3,h4,c; ulong32 g0,g1,g2,g3,g4; diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index f11854e15..92ff2aa7b 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -30,7 +30,7 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key #ifdef LTC_NO_FILE return CRYPT_NOP; #else - poly_state st; + poly1305_state st; FILE *in; unsigned char *buf; size_t x; @@ -60,7 +60,7 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(&st, sizeof(poly_state)); + zeromem(&st, sizeof(poly1305_state)); #endif XFREE(buf); return err; diff --git a/src/mac/poly1305/poly1305_memory.c b/src/mac/poly1305/poly1305_memory.c index 4ff2fe1ae..2f7a8e046 100644 --- a/src/mac/poly1305/poly1305_memory.c +++ b/src/mac/poly1305/poly1305_memory.c @@ -28,7 +28,7 @@ */ int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen) { - poly_state st; + poly1305_state st; int err; LTC_ARGCHK(key != NULL); @@ -41,7 +41,7 @@ int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsign err = poly1305_done(&st, mac, maclen); LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(&st, sizeof(poly_state)); + zeromem(&st, sizeof(poly1305_state)); #endif return err; }; diff --git a/src/mac/poly1305/poly1305_memory_multi.c b/src/mac/poly1305/poly1305_memory_multi.c index a8daec89f..047f5fd76 100644 --- a/src/mac/poly1305/poly1305_memory_multi.c +++ b/src/mac/poly1305/poly1305_memory_multi.c @@ -30,7 +30,7 @@ */ int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...) { - poly_state st; + poly1305_state st; int err; va_list args; const unsigned char *curptr; @@ -54,7 +54,7 @@ int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsign err = poly1305_done(&st, mac, maclen); LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(&st, sizeof(poly_state)); + zeromem(&st, sizeof(poly1305_state)); #endif va_end(args); return err; diff --git a/src/mac/poly1305/poly1305_test.c b/src/mac/poly1305/poly1305_test.c index 218ee2e2c..8f7c1e250 100644 --- a/src/mac/poly1305/poly1305_test.c +++ b/src/mac/poly1305/poly1305_test.c @@ -27,7 +27,7 @@ int poly1305_test(void) char m[] = "Cryptographic Forum Research Group"; unsigned long len = 16, mlen = strlen(m); unsigned char out[1000]; - poly_state st; + poly1305_state st; /* process piece by piece */ poly1305_init(&st, k, 32); poly1305_process(&st, (unsigned char*)m, 5); From 3a05f0331d86b60e27e8600e6a1673f7ce38215f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 20:29:41 +0200 Subject: [PATCH 0578/1192] chachapoly_state > chacha20poly1305_state --- .../chachapoly/chacha20poly1305_add_aad.c | 2 +- .../chachapoly/chacha20poly1305_decrypt.c | 2 +- src/encauth/chachapoly/chacha20poly1305_done.c | 2 +- .../chachapoly/chacha20poly1305_encrypt.c | 2 +- src/encauth/chachapoly/chacha20poly1305_init.c | 2 +- src/encauth/chachapoly/chacha20poly1305_memory.c | 4 ++-- src/encauth/chachapoly/chacha20poly1305_setiv.c | 2 +- .../chachapoly/chacha20poly1305_setiv_rfc7905.c | 2 +- src/encauth/chachapoly/chacha20poly1305_test.c | 2 +- src/headers/tomcrypt_mac.h | 16 ++++++++-------- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/encauth/chachapoly/chacha20poly1305_add_aad.c b/src/encauth/chachapoly/chacha20poly1305_add_aad.c index f840d2899..8d530a113 100644 --- a/src/encauth/chachapoly/chacha20poly1305_add_aad.c +++ b/src/encauth/chachapoly/chacha20poly1305_add_aad.c @@ -18,7 +18,7 @@ @param inlen The length of the ChaCha20Poly1305 data. @return CRYPT_OK on success */ -int chacha20poly1305_add_aad(chachapoly_state *st, const unsigned char *in, unsigned long inlen) +int chacha20poly1305_add_aad(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen) { int err; diff --git a/src/encauth/chachapoly/chacha20poly1305_decrypt.c b/src/encauth/chachapoly/chacha20poly1305_decrypt.c index bc8b6c144..2677affd2 100644 --- a/src/encauth/chachapoly/chacha20poly1305_decrypt.c +++ b/src/encauth/chachapoly/chacha20poly1305_decrypt.c @@ -19,7 +19,7 @@ @param out [out] The plaintext (length inlen) @return CRYPT_OK if successful */ -int chacha20poly1305_decrypt(chachapoly_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) +int chacha20poly1305_decrypt(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) { unsigned char padzero[16] = { 0 }; unsigned long padlen; diff --git a/src/encauth/chachapoly/chacha20poly1305_done.c b/src/encauth/chachapoly/chacha20poly1305_done.c index efe98b902..1b4158963 100644 --- a/src/encauth/chachapoly/chacha20poly1305_done.c +++ b/src/encauth/chachapoly/chacha20poly1305_done.c @@ -18,7 +18,7 @@ @param taglen [in/out] The length of the MAC tag @return CRYPT_OK on success */ -int chacha20poly1305_done(chachapoly_state *st, unsigned char *tag, unsigned long *taglen) +int chacha20poly1305_done(chacha20poly1305_state *st, unsigned char *tag, unsigned long *taglen) { unsigned char padzero[16] = { 0 }; unsigned long padlen; diff --git a/src/encauth/chachapoly/chacha20poly1305_encrypt.c b/src/encauth/chachapoly/chacha20poly1305_encrypt.c index b1c1adc66..511f24b32 100644 --- a/src/encauth/chachapoly/chacha20poly1305_encrypt.c +++ b/src/encauth/chachapoly/chacha20poly1305_encrypt.c @@ -19,7 +19,7 @@ @param out [out] The ciphertext (length inlen) @return CRYPT_OK if successful */ -int chacha20poly1305_encrypt(chachapoly_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) +int chacha20poly1305_encrypt(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) { unsigned char padzero[16] = { 0 }; unsigned long padlen; diff --git a/src/encauth/chachapoly/chacha20poly1305_init.c b/src/encauth/chachapoly/chacha20poly1305_init.c index 7cea6aa93..5195d12b0 100644 --- a/src/encauth/chachapoly/chacha20poly1305_init.c +++ b/src/encauth/chachapoly/chacha20poly1305_init.c @@ -18,7 +18,7 @@ @param keylen The length of the secret key (octets) @return CRYPT_OK if successful */ -int chacha20poly1305_init(chachapoly_state *st, const unsigned char *key, unsigned long keylen) +int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, unsigned long keylen) { return chacha_setup(&st->chacha, key, keylen, 20); } diff --git a/src/encauth/chachapoly/chacha20poly1305_memory.c b/src/encauth/chachapoly/chacha20poly1305_memory.c index 09ee01fbb..759e70489 100644 --- a/src/encauth/chachapoly/chacha20poly1305_memory.c +++ b/src/encauth/chachapoly/chacha20poly1305_memory.c @@ -35,7 +35,7 @@ int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen, unsigned char *tag, unsigned long *taglen, int direction) { - chachapoly_state st; + chacha20poly1305_state st; int err; LTC_ARGCHK(key != NULL); @@ -62,7 +62,7 @@ int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen, err = chacha20poly1305_done(&st, tag, taglen); LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(&st, sizeof(chachapoly_state)); + zeromem(&st, sizeof(chacha20poly1305_state)); #endif return err; } diff --git a/src/encauth/chachapoly/chacha20poly1305_setiv.c b/src/encauth/chachapoly/chacha20poly1305_setiv.c index 43c116bbd..e5d41c9e6 100644 --- a/src/encauth/chachapoly/chacha20poly1305_setiv.c +++ b/src/encauth/chachapoly/chacha20poly1305_setiv.c @@ -18,7 +18,7 @@ @param inlen The length of the IV (must be 12 or 8) @return CRYPT_OK on success */ -int chacha20poly1305_setiv(chachapoly_state *st, const unsigned char *iv, unsigned long ivlen) +int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen) { chacha_state tmp_st; int i, err; diff --git a/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c b/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c index 5bb215636..6bb4e5819 100644 --- a/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c +++ b/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c @@ -19,7 +19,7 @@ @param sequence_number 64bit sequence number which is incorporated into IV as described in RFC7905 @return CRYPT_OK on success */ -int chacha20poly1305_setiv_rfc7905(chachapoly_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 sequence_number) +int chacha20poly1305_setiv_rfc7905(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 sequence_number) { int i; unsigned char combined_iv[12] = { 0 }; diff --git a/src/encauth/chachapoly/chacha20poly1305_test.c b/src/encauth/chachapoly/chacha20poly1305_test.c index 006c096c8..4d53d26ca 100644 --- a/src/encauth/chachapoly/chacha20poly1305_test.c +++ b/src/encauth/chachapoly/chacha20poly1305_test.c @@ -16,7 +16,7 @@ int chacha20poly1305_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - chachapoly_state st1, st2; + chacha20poly1305_state st1, st2; unsigned char k[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f }; unsigned char iv[] = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47 }; unsigned char aad[] = { 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 }; diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 4adc7c0c1..2feefbabb 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -505,18 +505,18 @@ typedef struct { ulong64 aadlen; ulong64 ctlen; int aadflg; -} chachapoly_state; +} chacha20poly1305_state; #define CHCHA20POLY1305_ENCRYPT 0 #define CHCHA20POLY1305_DECRYPT 1 -int chacha20poly1305_init(chachapoly_state *st, const unsigned char *key, unsigned long keylen); -int chacha20poly1305_setiv(chachapoly_state *st, const unsigned char *iv, unsigned long ivlen); -int chacha20poly1305_setiv_rfc7905(chachapoly_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 sequence_number); -int chacha20poly1305_add_aad(chachapoly_state *st, const unsigned char *in, unsigned long inlen); -int chacha20poly1305_encrypt(chachapoly_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int chacha20poly1305_decrypt(chachapoly_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int chacha20poly1305_done(chachapoly_state *st, unsigned char *tag, unsigned long *taglen); +int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, unsigned long keylen); +int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen); +int chacha20poly1305_setiv_rfc7905(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 sequence_number); +int chacha20poly1305_add_aad(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen); +int chacha20poly1305_encrypt(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int chacha20poly1305_decrypt(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int chacha20poly1305_done(chacha20poly1305_state *st, unsigned char *tag, unsigned long *taglen); int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen, const unsigned char *iv, unsigned long ivlen, const unsigned char *aad, unsigned long aadlen, From 2656a040e048951411f41b81a21253a33b264581 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 20:32:14 +0200 Subject: [PATCH 0579/1192] chacha_prng > chacha20_prng --- src/headers/tomcrypt_prng.h | 4 ++-- src/misc/crypt/crypt_sizes.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index e50f06c9b..7661d3fa9 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -16,7 +16,7 @@ struct rc4_prng { #endif #ifdef LTC_CHACHA -struct chacha_prng { +struct chacha20_prng { chacha_state s; /* chacha state */ unsigned char ent[40]; /* entropy buffer */ unsigned long idx; /* entropy counter */ @@ -65,7 +65,7 @@ typedef union Prng_state { struct rc4_prng rc4; #endif #ifdef LTC_CHACHA - struct chacha_prng chacha; + struct chacha20_prng chacha; #endif #ifdef LTC_FORTUNA struct fortuna_prng fortuna; diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 15b437fc2..65265d38e 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -224,7 +224,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_S(fortuna_prng), #endif #ifdef LTC_CHACHA - _SZ_STRINGIFY_S(chacha_prng), + _SZ_STRINGIFY_S(chacha20_prng), #endif #ifdef LTC_RC4 _SZ_STRINGIFY_S(rc4_prng), From ff5b02d3711d19e5d1d47067364e5e4df25b25a6 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 20:44:39 +0200 Subject: [PATCH 0580/1192] LTC_CHACHA vs. LTC_CHACHA20_PRNG --- src/headers/tomcrypt_custom.h | 7 +++++++ src/headers/tomcrypt_prng.h | 6 +++--- src/misc/crypt/crypt.c | 3 +++ src/misc/crypt/crypt_sizes.c | 2 +- src/prngs/chacha.c | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 1d55322b8..503911346 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -294,6 +294,9 @@ /* The LTC_RC4 stream cipher */ #define LTC_RC4 +/* The ChaCha20 stream cipher based PRNG */ +#define LTC_CHACHA20_PRNG + /* Fortuna PRNG */ #define LTC_FORTUNA @@ -512,6 +515,10 @@ #error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA + LTC_POLY1305 #endif +#if defined(LTC_CHACHA20_PRNG) && !defined(LTC_CHACHA) + #error LTC_CHACHA20_PRNG requires LTC_CHACHA +#endif + /* THREAD management */ #ifdef LTC_PTHREAD diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 7661d3fa9..93ae36658 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -15,7 +15,7 @@ struct rc4_prng { }; #endif -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA20_PRNG struct chacha20_prng { chacha_state s; /* chacha state */ unsigned char ent[40]; /* entropy buffer */ @@ -64,7 +64,7 @@ typedef union Prng_state { #ifdef LTC_RC4 struct rc4_prng rc4; #endif -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA20_PRNG struct chacha20_prng chacha; #endif #ifdef LTC_FORTUNA @@ -166,7 +166,7 @@ int rc4_test(void); extern const struct ltc_prng_descriptor rc4_desc; #endif -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA20_PRNG int chacha_prng_start(prng_state *prng); int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); int chacha_prng_ready(prng_state *prng); diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index d97d101db..7cca541f7 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -274,6 +274,9 @@ const char *crypt_build_settings = #if defined(LTC_RC4) " RC4\n" #endif +#if defined(LTC_CHACHA20_PRNG) + " ChaCha20\n" +#endif #if defined(LTC_FORTUNA) " Fortuna (" NAME_VALUE(LTC_FORTUNA_POOLS) ", " NAME_VALUE(LTC_FORTUNA_WD) ")\n" #endif diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 65265d38e..ae5b308b2 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -223,7 +223,7 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_FORTUNA _SZ_STRINGIFY_S(fortuna_prng), #endif -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA20_PRNG _SZ_STRINGIFY_S(chacha20_prng), #endif #ifdef LTC_RC4 diff --git a/src/prngs/chacha.c b/src/prngs/chacha.c index 5a2ad557e..4ce67476a 100644 --- a/src/prngs/chacha.c +++ b/src/prngs/chacha.c @@ -9,7 +9,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA20_PRNG const struct ltc_prng_descriptor chacha_prng_desc = { From 06b1582de6d676e8e9cda2a6a19bf2db0081115c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 21:23:20 +0200 Subject: [PATCH 0581/1192] new #define FILE_READ_BUFSIZE --- src/headers/tomcrypt_custom.h | 5 ++++- src/mac/poly1305/poly1305_file.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 503911346..61eafd239 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -550,7 +550,10 @@ #endif - +#ifndef LTC_NO_FILE + /* buffer size for reading from a file via fread(..) */ + #define FILE_READ_BUFSIZE 8192 +#endif /* $Source$ */ /* $Revision$ */ diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index 92ff2aa7b..bca5ceb5a 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -42,7 +42,7 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key LTC_ARGCHK(maclen != NULL); if ((in = fopen(fname, "rb")) == NULL) { return CRYPT_FILE_NOTFOUND; } - if ((buf = XMALLOC(8196)) == NULL) { return CRYPT_MEM; } + if ((buf = XMALLOC(FILE_READ_BUFSIZE)) == NULL) { return CRYPT_MEM; } if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } do { From 883db95da2d4dad540d82b17a4054b99840dd798 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 22:19:49 +0200 Subject: [PATCH 0582/1192] FILE_READ_BUFSIZE > LTC_FILE_READ_BUFSIZE --- src/headers/tomcrypt_custom.h | 4 +++- src/mac/poly1305/poly1305_file.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 61eafd239..bfe1f7bb7 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -552,7 +552,9 @@ #ifndef LTC_NO_FILE /* buffer size for reading from a file via fread(..) */ - #define FILE_READ_BUFSIZE 8192 + #ifndef LTC_FILE_READ_BUFSIZE + #define LTC_FILE_READ_BUFSIZE 8192 + #endif #endif /* $Source$ */ diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index bca5ceb5a..02f2c43d6 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -42,7 +42,7 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key LTC_ARGCHK(maclen != NULL); if ((in = fopen(fname, "rb")) == NULL) { return CRYPT_FILE_NOTFOUND; } - if ((buf = XMALLOC(FILE_READ_BUFSIZE)) == NULL) { return CRYPT_MEM; } + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { return CRYPT_MEM; } if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } do { From 08a028ab04eb854c2d1a722de4266e941535baae Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 31 Mar 2017 07:35:13 +0200 Subject: [PATCH 0583/1192] missing LTC_FILE_READ_BUFSIZE in crypt.c --- src/misc/crypt/crypt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 7cca541f7..433140619 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -407,6 +407,9 @@ const char *crypt_build_settings = #if defined(LTC_NO_FILE) " LTC_NO_FILE " #endif +#if defined(LTC_FILE_READ_BUFSIZE) + " " NAME_VALUE(LTC_FILE_READ_BUFSIZE) " " +#endif #if defined(LTC_FAST) " LTC_FAST " #endif From ce37498ec65232f028ba5fd33e3a13779529f79d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 3 Apr 2017 19:52:03 +0200 Subject: [PATCH 0584/1192] chacha_prng_desc > chacha20_prng_desc --- src/headers/tomcrypt_prng.h | 2 +- src/prngs/chacha.c | 2 +- testprof/x86_prof.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 93ae36658..47968e259 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -175,7 +175,7 @@ int chacha_prng_done(prng_state *prng); int chacha_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng); int chacha_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng); int chacha_prng_test(void); -extern const struct ltc_prng_descriptor chacha_prng_desc; +extern const struct ltc_prng_descriptor chacha20_prng_desc; #endif #ifdef LTC_SPRNG diff --git a/src/prngs/chacha.c b/src/prngs/chacha.c index 4ce67476a..1dde944a0 100644 --- a/src/prngs/chacha.c +++ b/src/prngs/chacha.c @@ -11,7 +11,7 @@ #ifdef LTC_CHACHA20_PRNG -const struct ltc_prng_descriptor chacha_prng_desc = +const struct ltc_prng_descriptor chacha20_prng_desc = { "chacha", sizeof(chacha_state), diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index d4c6fe6cd..cff316bbc 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -331,7 +331,7 @@ static void _unregister_all(void) unregister_prng(&rc4_desc); #endif #ifdef LTC_CHACHA - unregister_prng(&chacha_prng_desc); + unregister_prng(&chacha20_prng_desc); #endif #ifdef LTC_SOBER128 unregister_prng(&sober128_desc); @@ -501,7 +501,7 @@ register_prng(&fortuna_desc); register_prng(&rc4_desc); #endif #ifdef LTC_CHACHA -register_prng(&chacha_prng_desc); +register_prng(&chacha20_prng_desc); #endif #ifdef LTC_SOBER128 register_prng(&sober128_desc); From 7b93f043903e9a17efbed4978b2f1cece935ed00 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 3 Apr 2017 19:54:51 +0200 Subject: [PATCH 0585/1192] wrong use of sizeof(buf) --- src/mac/poly1305/poly1305_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index 02f2c43d6..e119b9242 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -46,12 +46,12 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } do { - x = fread(buf, 1, sizeof(buf), in); + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = poly1305_process(&st, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); goto LBL_ERR; } - } while (x == sizeof(buf)); + } while (x == LTC_FILE_READ_BUFSIZE); if (fclose(in) != 0) { err = CRYPT_ERROR; goto LBL_ERR; From 2520e6c0618d561abc64e1df875af7e56d8aa021 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 3 Apr 2017 20:04:00 +0200 Subject: [PATCH 0586/1192] add link to arc4random.c which was the inspiration for chacha_prng --- src/prngs/chacha.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/prngs/chacha.c b/src/prngs/chacha.c index 1dde944a0..4a86af52d 100644 --- a/src/prngs/chacha.c +++ b/src/prngs/chacha.c @@ -7,6 +7,10 @@ * guarantee it works. */ + /* the idea of re-keying loosely follows the approach used in: + * http://bxr.su/OpenBSD/lib/libc/crypt/arc4random.c + */ + #include "tomcrypt.h" #ifdef LTC_CHACHA20_PRNG @@ -64,6 +68,8 @@ int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_s if ((err = chacha_setup(&prng->chacha.s, buf, 32, 20)) != CRYPT_OK) return err; /* iv 8 bytes */ if ((err = chacha_ivctr64(&prng->chacha.s, buf + 32, 8, 0)) != CRYPT_OK) return err; + /* clear KEY + IV */ + XMEMSET(buf, 0, 40); } else { /* chacha_prng_ready() was not called yet, add entropy to ent buffer */ From bfe9484a3d85214d431e961bb1bfa9a985366e7b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 3 Apr 2017 22:52:17 +0200 Subject: [PATCH 0587/1192] renaming chacha_prng > chacha20_prng --- src/headers/tomcrypt_prng.h | 16 ++++----- src/prngs/chacha.c | 66 ++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 47968e259..1b91ec6e1 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -167,14 +167,14 @@ extern const struct ltc_prng_descriptor rc4_desc; #endif #ifdef LTC_CHACHA20_PRNG -int chacha_prng_start(prng_state *prng); -int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); -int chacha_prng_ready(prng_state *prng); -unsigned long chacha_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng); -int chacha_prng_done(prng_state *prng); -int chacha_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng); -int chacha_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng); -int chacha_prng_test(void); +int chacha20_prng_start(prng_state *prng); +int chacha20_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); +int chacha20_prng_ready(prng_state *prng); +unsigned long chacha20_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng); +int chacha20_prng_done(prng_state *prng); +int chacha20_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng); +int chacha20_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng); +int chacha20_prng_test(void); extern const struct ltc_prng_descriptor chacha20_prng_desc; #endif diff --git a/src/prngs/chacha.c b/src/prngs/chacha.c index 4a86af52d..e98a72fd6 100644 --- a/src/prngs/chacha.c +++ b/src/prngs/chacha.c @@ -19,14 +19,14 @@ const struct ltc_prng_descriptor chacha20_prng_desc = { "chacha", sizeof(chacha_state), - &chacha_prng_start, - &chacha_prng_add_entropy, - &chacha_prng_ready, - &chacha_prng_read, - &chacha_prng_done, - &chacha_prng_export, - &chacha_prng_import, - &chacha_prng_test + &chacha20_prng_start, + &chacha20_prng_add_entropy, + &chacha20_prng_ready, + &chacha20_prng_read, + &chacha20_prng_done, + &chacha20_prng_export, + &chacha20_prng_import, + &chacha20_prng_test }; /** @@ -34,7 +34,7 @@ const struct ltc_prng_descriptor chacha20_prng_desc = @param prng[out] The PRNG state to initialize @return CRYPT_OK if successful */ -int chacha_prng_start(prng_state *prng) +int chacha20_prng_start(prng_state *prng) { LTC_ARGCHK(prng != NULL); prng->chacha.ready = 0; @@ -50,7 +50,7 @@ int chacha_prng_start(prng_state *prng) @param prng PRNG state to update @return CRYPT_OK if successful */ -int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) +int chacha20_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { unsigned char buf[40]; unsigned long i; @@ -61,7 +61,7 @@ int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_s LTC_ARGCHK(inlen > 0); if (prng->chacha.ready) { - /* chacha_prng_ready() was already called, do "rekey" operation */ + /* chacha20_prng_ready() was already called, do "rekey" operation */ if ((err = chacha_keystream(&prng->chacha.s, buf, 40)) != CRYPT_OK) return err; for(i = 0; i < inlen; i++) buf[i % 40] ^= in[i]; /* key 32 bytes, 20 rounds */ @@ -72,7 +72,7 @@ int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_s XMEMSET(buf, 0, 40); } else { - /* chacha_prng_ready() was not called yet, add entropy to ent buffer */ + /* chacha20_prng_ready() was not called yet, add entropy to ent buffer */ while (inlen--) prng->chacha.ent[prng->chacha.idx++ % 40] ^= *in++; } @@ -84,7 +84,7 @@ int chacha_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_s @param prng The PRNG to make active @return CRYPT_OK if successful */ -int chacha_prng_ready(prng_state *prng) +int chacha20_prng_ready(prng_state *prng) { int err; @@ -107,7 +107,7 @@ int chacha_prng_ready(prng_state *prng) @param prng The active PRNG to read from @return Number of octets read */ -unsigned long chacha_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) +unsigned long chacha20_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) { LTC_ARGCHK(prng != NULL); if (chacha_keystream(&prng->chacha.s, out, outlen) != CRYPT_OK) return 0; @@ -119,7 +119,7 @@ unsigned long chacha_prng_read(unsigned char *out, unsigned long outlen, prng_st @param prng The PRNG to terminate @return CRYPT_OK if successful */ -int chacha_prng_done(prng_state *prng) +int chacha20_prng_done(prng_state *prng) { LTC_ARGCHK(prng != NULL); return chacha_done(&prng->chacha.s); @@ -132,7 +132,7 @@ int chacha_prng_done(prng_state *prng) @param prng The PRNG to export @return CRYPT_OK if successful */ -int chacha_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) +int chacha20_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { unsigned long len = sizeof(chacha_state); LTC_ARGCHK(outlen != NULL); @@ -158,7 +158,7 @@ int chacha_prng_export(unsigned char *out, unsigned long *outlen, prng_state *pr @param prng The PRNG to import @return CRYPT_OK if successful */ -int chacha_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) +int chacha20_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { unsigned long len = sizeof(chacha_state); LTC_ARGCHK(in != NULL); @@ -174,7 +174,7 @@ int chacha_prng_import(const unsigned char *in, unsigned long inlen, prng_state PRNG self-test @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled */ -int chacha_prng_test(void) +int chacha20_prng_test(void) { #ifndef LTC_TEST return CRYPT_NOP; @@ -191,26 +191,26 @@ int chacha_prng_test(void) unsigned char t1[] = { 0x59, 0xb2, 0x26, 0x95, 0x2b, 0x01, 0x8f, 0x05, 0xbe, 0xd8 }; unsigned char t2[] = { 0x30, 0x34, 0x5c, 0x6e, 0x56, 0x18, 0x8c, 0x46, 0xbe, 0x8a }; - chacha_prng_start(&st); - chacha_prng_add_entropy(en, sizeof(en), &st); /* add entropy to uninitialized prng */ - chacha_prng_ready(&st); - chacha_prng_read(out, 10, &st); /* 10 bytes for testing */ + chacha20_prng_start(&st); + chacha20_prng_add_entropy(en, sizeof(en), &st); /* add entropy to uninitialized prng */ + chacha20_prng_ready(&st); + chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ if (compare_testvector(out, 10, t1, sizeof(t1), "CHACHA-PRNG", 1) != 0) return CRYPT_FAIL_TESTVECTOR; - chacha_prng_read(out, 500, &st); - chacha_prng_add_entropy(en, sizeof(en), &st); /* add entropy to already initialized prng */ - chacha_prng_read(out, 500, &st); - chacha_prng_export(dmp, &dmplen, &st); - chacha_prng_read(out, 500, &st); /* skip 500 bytes */ - chacha_prng_read(out, 10, &st); /* 10 bytes for testing */ + chacha20_prng_read(out, 500, &st); + chacha20_prng_add_entropy(en, sizeof(en), &st); /* add entropy to already initialized prng */ + chacha20_prng_read(out, 500, &st); + chacha20_prng_export(dmp, &dmplen, &st); + chacha20_prng_read(out, 500, &st); /* skip 500 bytes */ + chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 2) != 0) return CRYPT_FAIL_TESTVECTOR; - chacha_prng_done(&st); + chacha20_prng_done(&st); XMEMSET(&st, 0xFF, sizeof(st)); /* just to be sure */ - chacha_prng_import(dmp, dmplen, &st); - chacha_prng_read(out, 500, &st); /* skip 500 bytes */ - chacha_prng_read(out, 10, &st); /* 10 bytes for testing */ + chacha20_prng_import(dmp, dmplen, &st); + chacha20_prng_read(out, 500, &st); /* skip 500 bytes */ + chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 3) != 0) return CRYPT_FAIL_TESTVECTOR; - chacha_prng_done(&st); + chacha20_prng_done(&st); return CRYPT_OK; #endif From eefb8dc4798cea905bd2b26af99b8d827976e5c1 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 3 Apr 2017 22:54:27 +0200 Subject: [PATCH 0588/1192] renaming prngs/chacha.c prngs/chacha20.c --- libtomcrypt_VS2008.vcproj | 2 +- makefile | 2 +- makefile.icc | 2 +- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.shared | 2 +- makefile.unix | 2 +- src/prngs/{chacha.c => chacha20.c} | 0 8 files changed, 7 insertions(+), 7 deletions(-) rename src/prngs/{chacha.c => chacha20.c} (100%) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index ba4d548c5..c2b2d5443 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2272,7 +2272,7 @@ Name="prngs" > Date: Wed, 5 Apr 2017 09:28:32 +0200 Subject: [PATCH 0589/1192] misuse of compare_testvector --- src/ciphers/rc2.c | 4 ++-- src/prngs/chacha20.c | 6 +++--- src/stream/chacha/chacha_test.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 328889ab2..e0e05d179 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -370,8 +370,8 @@ int rc2_test(void) rc2_ecb_encrypt(tests[x].pt, tmp[0], &skey); rc2_ecb_decrypt(tmp[0], tmp[1], &skey); - if (compare_testvector(tmp[0], 8, tests[x].ct, 8, "RC2 CT", x) != 0 || - compare_testvector(tmp[1], 8, tests[x].pt, 8, "RC2 PT", x) != 0) { + if (compare_testvector(tmp[0], 8, tests[x].ct, 8, "RC2 CT", x) || + compare_testvector(tmp[1], 8, tests[x].pt, 8, "RC2 PT", x)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/prngs/chacha20.c b/src/prngs/chacha20.c index e98a72fd6..45d554b28 100644 --- a/src/prngs/chacha20.c +++ b/src/prngs/chacha20.c @@ -195,21 +195,21 @@ int chacha20_prng_test(void) chacha20_prng_add_entropy(en, sizeof(en), &st); /* add entropy to uninitialized prng */ chacha20_prng_ready(&st); chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ - if (compare_testvector(out, 10, t1, sizeof(t1), "CHACHA-PRNG", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, 10, t1, sizeof(t1), "CHACHA-PRNG", 1)) return CRYPT_FAIL_TESTVECTOR; chacha20_prng_read(out, 500, &st); chacha20_prng_add_entropy(en, sizeof(en), &st); /* add entropy to already initialized prng */ chacha20_prng_read(out, 500, &st); chacha20_prng_export(dmp, &dmplen, &st); chacha20_prng_read(out, 500, &st); /* skip 500 bytes */ chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ - if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 2) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 2)) return CRYPT_FAIL_TESTVECTOR; chacha20_prng_done(&st); XMEMSET(&st, 0xFF, sizeof(st)); /* just to be sure */ chacha20_prng_import(dmp, dmplen, &st); chacha20_prng_read(out, 500, &st); /* skip 500 bytes */ chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ - if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 3) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 3)) return CRYPT_FAIL_TESTVECTOR; chacha20_prng_done(&st); return CRYPT_OK; diff --git a/src/stream/chacha/chacha_test.c b/src/stream/chacha/chacha_test.c index 9894204f4..d48cd4799 100644 --- a/src/stream/chacha/chacha_test.c +++ b/src/stream/chacha/chacha_test.c @@ -47,17 +47,17 @@ int chacha_test(void) chacha_crypt(&st, (unsigned char*)pt + 70, 5, out + 70); chacha_crypt(&st, (unsigned char*)pt + 75, 5, out + 75); chacha_crypt(&st, (unsigned char*)pt + 80, len - 80, out + 80); - if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV1", 1)) return CRYPT_FAIL_TESTVECTOR; /* crypt in one go */ chacha_setup(&st, k, sizeof(k), 20); chacha_ivctr32(&st, n, sizeof(n), 1); chacha_crypt(&st, (unsigned char*)pt, len, out); - if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV2", 1)) return CRYPT_FAIL_TESTVECTOR; /* crypt in one go - using chacha_ivctr64() */ chacha_setup(&st, k, sizeof(k), 20); chacha_ivctr64(&st, n + 4, sizeof(n) - 4, 1); chacha_crypt(&st, (unsigned char*)pt, len, out); - if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV3", 1)) return CRYPT_FAIL_TESTVECTOR; return CRYPT_OK; #endif From 08415d37f352b7bff647a900dd7194ae9f7c5f1d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 6 Apr 2017 22:47:36 +0200 Subject: [PATCH 0590/1192] fix compare_testvector() macro --- src/headers/tomcrypt_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 91f87c5c7..76f4f6bc9 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -105,7 +105,7 @@ void print_hex(const char* what, const void* v, const unsigned long l); int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); #else #define compare_testvector(is, is_len, should, should_len, what, which) \ - (((is_len) != (should_len)) || (XMEMCMP((is), (should), (is_len)) != 0)) + ((((is_len) != (should_len)) || (XMEMCMP((is), (should), (is_len)) != 0)) ? 1 : 0) #endif /* $Source$ */ From 9941648125efad604de451b09bbf903bce6ac41c Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 7 Apr 2017 00:17:43 +0200 Subject: [PATCH 0591/1192] remove suspicious ; --- src/encauth/chachapoly/chacha20poly1305_test.c | 2 +- src/mac/poly1305/poly1305_file.c | 2 +- src/mac/poly1305/poly1305_memory.c | 2 +- src/mac/poly1305/poly1305_memory_multi.c | 2 +- src/mac/poly1305/poly1305_test.c | 2 +- src/stream/chacha/chacha_crypt.c | 2 +- src/stream/chacha/chacha_done.c | 2 +- src/stream/chacha/chacha_ivctr32.c | 2 +- src/stream/chacha/chacha_ivctr64.c | 2 +- src/stream/chacha/chacha_setup.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/encauth/chachapoly/chacha20poly1305_test.c b/src/encauth/chachapoly/chacha20poly1305_test.c index 4d53d26ca..36d512927 100644 --- a/src/encauth/chachapoly/chacha20poly1305_test.c +++ b/src/encauth/chachapoly/chacha20poly1305_test.c @@ -104,6 +104,6 @@ int chacha20poly1305_test(void) return CRYPT_OK; #endif -}; +} #endif diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index e119b9242..1c3e61e42 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -65,6 +65,6 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key XFREE(buf); return err; #endif -}; +} #endif diff --git a/src/mac/poly1305/poly1305_memory.c b/src/mac/poly1305/poly1305_memory.c index 2f7a8e046..b948efb35 100644 --- a/src/mac/poly1305/poly1305_memory.c +++ b/src/mac/poly1305/poly1305_memory.c @@ -44,6 +44,6 @@ int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsign zeromem(&st, sizeof(poly1305_state)); #endif return err; -}; +} #endif diff --git a/src/mac/poly1305/poly1305_memory_multi.c b/src/mac/poly1305/poly1305_memory_multi.c index 047f5fd76..0ac122e58 100644 --- a/src/mac/poly1305/poly1305_memory_multi.c +++ b/src/mac/poly1305/poly1305_memory_multi.c @@ -58,6 +58,6 @@ int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsign #endif va_end(args); return err; -}; +} #endif diff --git a/src/mac/poly1305/poly1305_test.c b/src/mac/poly1305/poly1305_test.c index 8f7c1e250..57501a5e2 100644 --- a/src/mac/poly1305/poly1305_test.c +++ b/src/mac/poly1305/poly1305_test.c @@ -45,6 +45,6 @@ int poly1305_test(void) if (compare_testvector(out, len, tag, sizeof(tag), "POLY1305-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; return CRYPT_OK; #endif -}; +} #endif diff --git a/src/stream/chacha/chacha_crypt.c b/src/stream/chacha/chacha_crypt.c index dbd7e9cb3..59e087afa 100644 --- a/src/stream/chacha/chacha_crypt.c +++ b/src/stream/chacha/chacha_crypt.c @@ -85,6 +85,6 @@ int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, in += 64; } return CRYPT_OK; -}; +} #endif diff --git a/src/stream/chacha/chacha_done.c b/src/stream/chacha/chacha_done.c index 2e25177b3..4d6e278b0 100644 --- a/src/stream/chacha/chacha_done.c +++ b/src/stream/chacha/chacha_done.c @@ -21,6 +21,6 @@ int chacha_done(chacha_state *st) LTC_ARGCHK(st != NULL); XMEMSET(st, 0, sizeof(chacha_state)); return CRYPT_OK; -}; +} #endif diff --git a/src/stream/chacha/chacha_ivctr32.c b/src/stream/chacha/chacha_ivctr32.c index 64dc83853..14780f87b 100644 --- a/src/stream/chacha/chacha_ivctr32.c +++ b/src/stream/chacha/chacha_ivctr32.c @@ -37,6 +37,6 @@ int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivle LOAD32L(st->input[15], iv + 8); st->ksleft = 0; return CRYPT_OK; -}; +} #endif diff --git a/src/stream/chacha/chacha_ivctr64.c b/src/stream/chacha/chacha_ivctr64.c index c2826bb75..6a6c43df7 100644 --- a/src/stream/chacha/chacha_ivctr64.c +++ b/src/stream/chacha/chacha_ivctr64.c @@ -37,6 +37,6 @@ int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivle LOAD32L(st->input[15], iv + 4); st->ksleft = 0; return CRYPT_OK; -}; +} #endif diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c index f56f667ac..8a20e9019 100644 --- a/src/stream/chacha/chacha_setup.c +++ b/src/stream/chacha/chacha_setup.c @@ -55,6 +55,6 @@ int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keyle LOAD32L(st->input[3], constants + 12); st->rounds = rounds; /* e.g. 20 for chacha20 */ return CRYPT_OK; -}; +} #endif From 0be45a63413c7e51dceae9892b1bb5b2ea690e83 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 7 Apr 2017 10:54:41 +0200 Subject: [PATCH 0592/1192] remove unreachable code --- src/stream/chacha/chacha_crypt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stream/chacha/chacha_crypt.c b/src/stream/chacha/chacha_crypt.c index 59e087afa..de42a1069 100644 --- a/src/stream/chacha/chacha_crypt.c +++ b/src/stream/chacha/chacha_crypt.c @@ -84,7 +84,6 @@ int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, out += 64; in += 64; } - return CRYPT_OK; } #endif From b6c27c2f08e20c8eecaafdd97eee96ec95d9b7c0 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 7 Apr 2017 11:02:17 +0200 Subject: [PATCH 0593/1192] no room for nul terminator --- src/stream/chacha/chacha_setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c index 8a20e9019..04c43b85d 100644 --- a/src/stream/chacha/chacha_setup.c +++ b/src/stream/chacha/chacha_setup.c @@ -16,8 +16,8 @@ #ifdef LTC_CHACHA -static const char sigma[16] = "expand 32-byte k"; -static const char tau[16] = "expand 16-byte k"; +static const char * const sigma = "expand 32-byte k"; +static const char * const tau = "expand 16-byte k"; /** Initialize an ChaCha context (only the key) From 68296e0608450a71a80c5fae872406b0e1d9f5e4 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 7 Apr 2017 20:47:44 -0400 Subject: [PATCH 0594/1192] blake2s hash --- src/hashes/blake2s.c | 496 ++++++++++++++++++++++++++++++++++ src/headers/tomcrypt_custom.h | 1 + src/headers/tomcrypt_hash.h | 43 +++ 3 files changed, 540 insertions(+) create mode 100644 src/hashes/blake2s.c diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c new file mode 100644 index 000000000..ef986e4e7 --- /dev/null +++ b/src/hashes/blake2s.c @@ -0,0 +1,496 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* based on https://github.com/BLAKE2/BLAKE2/blob/master/ref/blake2s-ref.c public domain/cc0 */ +/* see also https://www.ietf.org/rfc/rfc7693.txt */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2S + +enum blake2s_constant { + BLAKE2S_BLOCKBYTES = 64, + BLAKE2S_OUTBYTES = 32, + BLAKE2S_KEYBYTES = 32, + BLAKE2S_SALTBYTES = 8, + BLAKE2S_PERSONALBYTES = 8 +}; + + +struct blake2s_param { + unsigned char digest_length; + unsigned char key_length; + unsigned char fanout; + unsigned char depth; + ulong32 leaf_length; + unsigned char node_offset[6]; + unsigned char node_depth; + unsigned char inner_length; + unsigned char salt[BLAKE2S_SALTBYTES]; + unsigned char personal[BLAKE2S_PERSONALBYTES]; +}; + + + +const struct ltc_hash_descriptor blake2s_256_desc = +{ + "blake2s_256", + 0, + 32, + 64, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 8 }, + 11, + &blake2s_256_init, + &blake2s_process, + &blake2s_done, + &blake2s_256_test, + NULL +}; + + +const struct ltc_hash_descriptor blake2s_224_desc = +{ + "blake2s_224", + 0, + 32, + 64, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 7 }, + 11, + &blake2s_224_init, + &blake2s_process, + &blake2s_done, + &blake2s_224_test, + NULL +}; + +const struct ltc_hash_descriptor blake2s_160_desc = +{ + "blake2s_160", + 0, + 32, + 64, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 5 }, + 11, + &blake2s_160_init, + &blake2s_process, + &blake2s_done, + &blake2s_160_test, + NULL +}; + + +const struct ltc_hash_descriptor blake2s_128_desc = +{ + "blake2s_128", + 0, + 16, + 64, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 4 }, + 11, + &blake2s_128_init, + &blake2s_process, + &blake2s_done, + &blake2s_128_test, + NULL +}; + + + +static const ulong32 blake2s_IV[8] = { + 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, + 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL +}; + +static const unsigned char blake2s_sigma[10][16] = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, +}; + +static inline int blake2s_set_lastnode(struct blake2s_state *S) +{ + S->f[1] = ~0U; + return 0; +} + +/* Some helper functions, not necessarily useful */ +static inline int blake2s_set_lastblock(struct blake2s_state *S) +{ + if (S->last_node) + blake2s_set_lastnode(S); + + S->f[0] = ~0U; + return 0; +} + +static inline int blake2s_increment_counter(struct blake2s_state *S, const ulong32 inc) +{ + S->t[0] += inc; + S->t[1] += (S->t[0] < inc); + return 0; +} + +static inline int blake2s_init0(struct blake2s_state *S) +{ + XMEMSET(S, 0, sizeof(struct blake2s_state)); + + for (int i = 0; i < 8; ++i) + S->h[i] = blake2s_IV[i]; + + return CRYPT_OK; +} + +/* init2 xors IV with input parameter block */ +static int blake2s_init_param(struct blake2s_state *S, const struct blake2s_param *P) +{ + blake2s_init0(S); + ulong32 *p = (ulong32 *)(P); + + /* IV XOR ParamBlock */ + for (size_t i = 0; i < 8; ++i) { + ulong32 tmp; + LOAD32L(tmp, &p[i]); + S->h[i] ^= tmp; + } + + S->outlen = P->digest_length; + return 0; +} + +/* Sequential blake2s initialization */ +int blake2s_init(hash_state *md, size_t outlen) +{ + struct blake2s_param P[1]; + LTC_ARGCHK(md != NULL); + + XMEMSET(P, 0, sizeof(P)); + + if ((!outlen) || (outlen > BLAKE2S_OUTBYTES)) + return CRYPT_INVALID_ARG; + + P->digest_length = (unsigned char)outlen; + + P->fanout = 1; + P->depth = 1; + + return blake2s_init_param(&md->blake2s, P); +} + +int blake2s_256_init(hash_state *md) { return blake2s_init(md, 32); } + +int blake2s_224_init(hash_state *md) { return blake2s_init(md, 28); } + +int blake2s_160_init(hash_state *md) { return blake2s_init(md, 20); } + +int blake2s_128_init(hash_state *md) { return blake2s_init(md, 16); } + + +#define G(r,i,a,b,c,d) \ + do { \ + a = a + b + m[blake2s_sigma[r][2*i+0]]; \ + d = ROR(d ^ a, 16); \ + c = c + d; \ + b = ROR(b ^ c, 12); \ + a = a + b + m[blake2s_sigma[r][2*i+1]]; \ + d = ROR(d ^ a, 8); \ + c = c + d; \ + b = ROR(b ^ c, 7); \ + } while(0) +#define ROUND(r) \ + do { \ + G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ + G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ + G(r,2,v[ 2],v[ 6],v[10],v[14]); \ + G(r,3,v[ 3],v[ 7],v[11],v[15]); \ + G(r,4,v[ 0],v[ 5],v[10],v[15]); \ + G(r,5,v[ 1],v[ 6],v[11],v[12]); \ + G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ + G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ + } while(0) + + +#ifdef LTC_CLEAN_STACK +static int _blake2s_compress(hash_state *md, unsigned char *buf) +#else +static int blake2s_compress(hash_state *md, unsigned char *buf) +#endif +{ + ulong32 m[16]; + ulong32 v[16]; + + for (size_t i = 0; i < 16; ++i) { + LOAD32L(m[i], buf + i * sizeof(m[i])); + } + + for (size_t i = 0; i < 8; ++i) + v[i] = md->blake2s.h[i]; + + v[8] = blake2s_IV[0]; + v[9] = blake2s_IV[1]; + v[10] = blake2s_IV[2]; + v[11] = blake2s_IV[3]; + v[12] = md->blake2s.t[0] ^ blake2s_IV[4]; + v[13] = md->blake2s.t[1] ^ blake2s_IV[5]; + v[14] = md->blake2s.f[0] ^ blake2s_IV[6]; + v[15] = md->blake2s.f[1] ^ blake2s_IV[7]; + + + ROUND(0); + ROUND(1); + ROUND(2); + ROUND(3); + ROUND(4); + ROUND(5); + ROUND(6); + ROUND(7); + ROUND(8); + ROUND(9); + + for (size_t i = 0; i < 8; ++i) + md->blake2s.h[i] = md->blake2s.h[i] ^ v[i] ^ v[i + 8]; + + + return 0; +} +#undef G +#undef ROUND + + +#ifdef LTC_CLEAN_STACK +static int blake2s_compress(hash_state *md, unsigned char *buf) +{ + int err; + err = _blake2s_compress(md, buf); + burn_stack(sizeof(ulong32) * 32); + return err; +} +#endif + +int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen) +{ + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(in != NULL); + + if (md->blake2s.curlen > sizeof(md->blake2s.buf)) { + return CRYPT_INVALID_ARG; + } + + while (inlen > 0) { + ulong32 left = md->blake2s.curlen; + ulong32 fill = 2 * BLAKE2S_BLOCKBYTES - left; + + if (inlen > fill) { + XMEMCPY(md->blake2s.buf + left, in, fill); + md->blake2s.curlen += fill; + blake2s_increment_counter(&md->blake2s, BLAKE2S_BLOCKBYTES); + blake2s_compress(md, md->blake2s.buf); + XMEMCPY(md->blake2s.buf, md->blake2s.buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES); + md->blake2s.curlen -= BLAKE2S_BLOCKBYTES; + in += fill; + inlen -= fill; + } else /* inlen <= fill */ + { + XMEMCPY(md->blake2s.buf + left, in, inlen); + md->blake2s.curlen += (ulong32)inlen; /* Be lazy, do not compress */ + in += inlen; + inlen -= inlen; + } + } + + return CRYPT_OK; +} + +int blake2s_done(hash_state *md, unsigned char *out) +{ + unsigned char buffer[BLAKE2S_OUTBYTES]; + size_t i; + + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(out != NULL); + + /* if(S->outlen != outlen) return CRYPT_INVALID_ARG; */ + + if (md->blake2s.curlen > BLAKE2S_BLOCKBYTES) { + blake2s_increment_counter(&md->blake2s, BLAKE2S_BLOCKBYTES); + blake2s_compress(md, md->blake2s.buf); + md->blake2s.curlen -= BLAKE2S_BLOCKBYTES; + XMEMCPY(md->blake2s.buf, md->blake2s.buf + BLAKE2S_BLOCKBYTES, md->blake2s.curlen); + } + + blake2s_increment_counter(&md->blake2s, (ulong32)md->blake2s.curlen); + blake2s_set_lastblock(&md->blake2s); + XMEMSET(md->blake2s.buf + md->blake2s.curlen, 0, 2 * BLAKE2S_BLOCKBYTES - md->blake2s.curlen); /* Padding */ + blake2s_compress(md, md->blake2s.buf); + + for (i = 0; i < 8; ++i) /* Output full hash to temp buffer */ + STORE32L(md->blake2s.h[i], buffer + sizeof(md->blake2s.h[i]) * i); + + XMEMCPY(out, buffer, md->blake2s.outlen); + return CRYPT_OK; +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int blake2s_256_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + static const struct { + char *msg; + unsigned char hash[32]; + } tests[] = { + { "", + { 0x69, 0x21, 0x7a, 0x30, 0x79, 0x90, 0x80, 0x94, + 0xe1, 0x11, 0x21, 0xd0, 0x42, 0x35, 0x4a, 0x7c, + 0x1f, 0x55, 0xb6, 0x48, 0x2c, 0xa1, 0xa5, 0x1e, + 0x1b, 0x25, 0x0d, 0xfd, 0x1e, 0xd0, 0xee, 0xf9 } }, + + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[32]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + blake2s_256_init(&md); + blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + blake2s_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; + #endif +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int blake2s_224_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + static const struct { + char *msg; + unsigned char hash[28]; + } tests[] = { + { "", + { 0x1f, 0xa1, 0x29, 0x1e, 0x65, 0x24, 0x8b, 0x37, + 0xb3, 0x43, 0x34, 0x75, 0xb2, 0xa0, 0xdd, 0x63, + 0xd5, 0x4a, 0x11, 0xec, 0xc4, 0xe3, 0xe0, 0x34, + 0xe7, 0xbc, 0x1e, 0xf4 } }, + + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[28]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + blake2s_224_init(&md); + blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + blake2s_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 28) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; + #endif +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int blake2s_160_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + static const struct { + char *msg; + unsigned char hash[20]; + } tests[] = { + { "", + { 0x35, 0x4c, 0x9c, 0x33, 0xf7, 0x35, 0x96, 0x24, + 0x18, 0xbd, 0xac, 0xb9, 0x47, 0x98, 0x73, 0x42, + 0x9c, 0x34, 0x91, 0x6f} }, + + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[20]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + blake2s_160_init(&md); + blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + blake2s_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 20) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; + #endif +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int blake2s_128_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + static const struct { + char *msg; + unsigned char hash[16]; + } tests[] = { + { "", + { 0x64, 0x55, 0x0d, 0x6f, 0xfe, 0x2c, 0x0a, 0x01, + 0xa1, 0x4a, 0xba, 0x1e, 0xad, 0xe0, 0x20, 0x0c } }, + + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[16]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + blake2s_128_init(&md); + blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + blake2s_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 16) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; + #endif +} + + + +#endif diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index bfe1f7bb7..376e38d5e 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -242,6 +242,7 @@ #define LTC_RIPEMD160 #define LTC_RIPEMD256 #define LTC_RIPEMD320 +#define LTC_BLAKE2S #define LTC_HASH_HELPERS diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 2d763002c..7d6f0d190 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -113,6 +113,21 @@ struct chc_state { }; #endif + +#ifdef LTC_BLAKE2S + + struct blake2s_state { + ulong32 h[8]; + ulong32 t[2]; + ulong32 f[2]; + unsigned char buf[2 * 64]; + ulong32 curlen; + unsigned char outlen; + unsigned char last_node; + }; + +#endif + typedef union Hash_state { char dummy[1]; #ifdef LTC_CHC_HASH @@ -157,6 +172,11 @@ typedef union Hash_state { #ifdef LTC_RIPEMD320 struct rmd320_state rmd320; #endif + +#ifdef LTC_BLAKE2S + struct blake2s_state blake2s; +#endif + void *data; } hash_state; @@ -314,6 +334,29 @@ int sha1_test(void); extern const struct ltc_hash_descriptor sha1_desc; #endif +#ifdef LTC_BLAKE2S +extern const struct ltc_hash_descriptor blake2s_256_desc; +int blake2s_256_init(hash_state * md); +int blake2s_256_test(void); + +extern const struct ltc_hash_descriptor blake2s_224_desc; +int blake2s_224_init(hash_state * md); +int blake2s_224_test(void); + +extern const struct ltc_hash_descriptor blake2s_160_desc; +int blake2s_160_init(hash_state * md); +int blake2s_160_test(void); + +extern const struct ltc_hash_descriptor blake2s_128_desc; +int blake2s_128_init(hash_state * md); +int blake2s_128_test(void); + +int blake2s_init(hash_state * md, size_t outlen); +int blake2s_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int blake2s_done(hash_state * md, unsigned char *hash); +#endif + + #ifdef LTC_MD5 int md5_init(hash_state * md); int md5_process(hash_state * md, const unsigned char *in, unsigned long inlen); From 647b53d880136dcfc879038d7ef0ef08153281b0 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 7 Apr 2017 20:50:28 -0400 Subject: [PATCH 0595/1192] add blake2s to various places. --- src/misc/crypt/crypt.c | 3 +++ src/misc/crypt/crypt_sizes.c | 3 +++ testprof/x86_prof.c | 12 ++++++++++++ 3 files changed, 18 insertions(+) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 433140619..d3cb1c77c 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -180,6 +180,9 @@ const char *crypt_build_settings = #if defined(LTC_WHIRLPOOL) " WHIRLPOOL\n" #endif +#if defined(LTC_BLAKE2S) + " BLAKE2S\n" +#endif #if defined(LTC_CHC_HASH) " CHC_HASH\n" #endif diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index ae5b308b2..82b98a601 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -71,6 +71,9 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_TIGER _SZ_STRINGIFY_S(tiger_state), #endif +#ifdef LTC_BLAKE2S + _SZ_STRINGIFY_S(blake2s_state), +#endif #ifdef LTC_CHC_HASH _SZ_STRINGIFY_S(chc_state), #endif diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index cff316bbc..1ba14553a 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -319,6 +319,12 @@ static void _unregister_all(void) #ifdef LTC_WHIRLPOOL unregister_hash(&whirlpool_desc); #endif +#ifdef LTC_BLAKE2S + unregister_hash(&blake2s_128_desc); + unregister_hash(&blake2s_160_desc); + unregister_hash(&blake2s_224_desc); + unregister_hash(&blake2s_256_desc); +#endif #ifdef LTC_CHC_HASH unregister_hash(&chc_desc); #endif @@ -481,6 +487,12 @@ void reg_algs(void) #ifdef LTC_WHIRLPOOL register_hash (&whirlpool_desc); #endif +#ifdef LTC_BLAKE2S + register_hash(&blake2s_128_desc); + register_hash(&blake2s_160_desc); + register_hash(&blake2s_224_desc); + register_hash(&blake2s_256_desc); +#endif #ifdef LTC_CHC_HASH register_hash(&chc_desc); if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) { From 51f6b063d601f6d86ed6e2110d97851fa6b4cf9e Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 7 Apr 2017 21:12:54 -0400 Subject: [PATCH 0596/1192] clang format --- src/hashes/blake2s.c | 191 +++++++++++++++++++++---------------------- 1 file changed, 92 insertions(+), 99 deletions(-) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index ef986e4e7..3fe8e0451 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -15,11 +15,11 @@ #ifdef LTC_BLAKE2S enum blake2s_constant { - BLAKE2S_BLOCKBYTES = 64, - BLAKE2S_OUTBYTES = 32, - BLAKE2S_KEYBYTES = 32, - BLAKE2S_SALTBYTES = 8, - BLAKE2S_PERSONALBYTES = 8 + BLAKE2S_BLOCKBYTES = 64, + BLAKE2S_OUTBYTES = 32, + BLAKE2S_KEYBYTES = 32, + BLAKE2S_SALTBYTES = 8, + BLAKE2S_PERSONALBYTES = 8 }; @@ -122,35 +122,35 @@ static const unsigned char blake2s_sigma[10][16] = { static inline int blake2s_set_lastnode(struct blake2s_state *S) { - S->f[1] = ~0U; - return 0; + S->f[1] = ~0U; + return 0; } /* Some helper functions, not necessarily useful */ static inline int blake2s_set_lastblock(struct blake2s_state *S) { - if (S->last_node) - blake2s_set_lastnode(S); + if (S->last_node) + blake2s_set_lastnode(S); - S->f[0] = ~0U; - return 0; + S->f[0] = ~0U; + return 0; } static inline int blake2s_increment_counter(struct blake2s_state *S, const ulong32 inc) { - S->t[0] += inc; - S->t[1] += (S->t[0] < inc); - return 0; + S->t[0] += inc; + S->t[1] += (S->t[0] < inc); + return 0; } static inline int blake2s_init0(struct blake2s_state *S) { - XMEMSET(S, 0, sizeof(struct blake2s_state)); + XMEMSET(S, 0, sizeof(struct blake2s_state)); - for (int i = 0; i < 8; ++i) - S->h[i] = blake2s_IV[i]; + for (int i = 0; i < 8; ++i) + S->h[i] = blake2s_IV[i]; - return CRYPT_OK; + return CRYPT_OK; } /* init2 xors IV with input parameter block */ @@ -197,35 +197,33 @@ int blake2s_160_init(hash_state *md) { return blake2s_init(md, 20); } int blake2s_128_init(hash_state *md) { return blake2s_init(md, 16); } - -#define G(r,i,a,b,c,d) \ - do { \ - a = a + b + m[blake2s_sigma[r][2*i+0]]; \ - d = ROR(d ^ a, 16); \ - c = c + d; \ - b = ROR(b ^ c, 12); \ - a = a + b + m[blake2s_sigma[r][2*i+1]]; \ - d = ROR(d ^ a, 8); \ - c = c + d; \ - b = ROR(b ^ c, 7); \ - } while(0) -#define ROUND(r) \ - do { \ - G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ - G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ - G(r,2,v[ 2],v[ 6],v[10],v[14]); \ - G(r,3,v[ 3],v[ 7],v[11],v[15]); \ - G(r,4,v[ 0],v[ 5],v[10],v[15]); \ - G(r,5,v[ 1],v[ 6],v[11],v[12]); \ - G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ - G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ - } while(0) - +#define G(r, i, a, b, c, d) \ + do { \ + a = a + b + m[blake2s_sigma[r][2 * i + 0]]; \ + d = ROR(d ^ a, 16); \ + c = c + d; \ + b = ROR(b ^ c, 12); \ + a = a + b + m[blake2s_sigma[r][2 * i + 1]]; \ + d = ROR(d ^ a, 8); \ + c = c + d; \ + b = ROR(b ^ c, 7); \ + } while (0) +#define ROUND(r) \ + do { \ + G(r, 0, v[0], v[4], v[8], v[12]); \ + G(r, 1, v[1], v[5], v[9], v[13]); \ + G(r, 2, v[2], v[6], v[10], v[14]); \ + G(r, 3, v[3], v[7], v[11], v[15]); \ + G(r, 4, v[0], v[5], v[10], v[15]); \ + G(r, 5, v[1], v[6], v[11], v[12]); \ + G(r, 6, v[2], v[7], v[8], v[13]); \ + G(r, 7, v[3], v[4], v[9], v[14]); \ + } while (0) #ifdef LTC_CLEAN_STACK static int _blake2s_compress(hash_state *md, unsigned char *buf) #else -static int blake2s_compress(hash_state *md, unsigned char *buf) +static int blake2s_compress(hash_state *md, unsigned char *buf) #endif { ulong32 m[16]; @@ -247,7 +245,6 @@ static int blake2s_compress(hash_state *md, unsigned char *buf) v[14] = md->blake2s.f[0] ^ blake2s_IV[6]; v[15] = md->blake2s.f[1] ^ blake2s_IV[7]; - ROUND(0); ROUND(1); ROUND(2); @@ -262,13 +259,11 @@ static int blake2s_compress(hash_state *md, unsigned char *buf) for (size_t i = 0; i < 8; ++i) md->blake2s.h[i] = md->blake2s.h[i] ^ v[i] ^ v[i + 8]; - return 0; } #undef G #undef ROUND - #ifdef LTC_CLEAN_STACK static int blake2s_compress(hash_state *md, unsigned char *buf) { @@ -284,9 +279,9 @@ int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen LTC_ARGCHK(md != NULL); LTC_ARGCHK(in != NULL); - if (md->blake2s.curlen > sizeof(md->blake2s.buf)) { - return CRYPT_INVALID_ARG; - } + if (md->blake2s.curlen > sizeof(md->blake2s.buf)) { + return CRYPT_INVALID_ARG; + } while (inlen > 0) { ulong32 left = md->blake2s.curlen; @@ -346,12 +341,12 @@ int blake2s_done(hash_state *md, unsigned char *out) Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled */ -int blake2s_256_test(void) +int blake2s_256_test(void) { - #ifndef LTC_TEST - return CRYPT_NOP; - #else - static const struct { +#ifndef LTC_TEST + return CRYPT_NOP; +#else + static const struct { char *msg; unsigned char hash[32]; } tests[] = { @@ -364,32 +359,32 @@ int blake2s_256_test(void) { NULL, { 0 } } }; - int i; - unsigned char tmp[32]; - hash_state md; + int i; + unsigned char tmp[32]; + hash_state md; - for (i = 0; tests[i].msg != NULL; i++) { + for (i = 0; tests[i].msg != NULL; i++) { blake2s_256_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { return CRYPT_FAIL_TESTVECTOR; } - } - return CRYPT_OK; - #endif + } + return CRYPT_OK; +#endif } /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled */ -int blake2s_224_test(void) +int blake2s_224_test(void) { - #ifndef LTC_TEST - return CRYPT_NOP; - #else - static const struct { +#ifndef LTC_TEST + return CRYPT_NOP; +#else + static const struct { char *msg; unsigned char hash[28]; } tests[] = { @@ -402,32 +397,32 @@ int blake2s_224_test(void) { NULL, { 0 } } }; - int i; - unsigned char tmp[28]; - hash_state md; + int i; + unsigned char tmp[28]; + hash_state md; - for (i = 0; tests[i].msg != NULL; i++) { + for (i = 0; tests[i].msg != NULL; i++) { blake2s_224_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); if (XMEMCMP(tmp, tests[i].hash, 28) != 0) { return CRYPT_FAIL_TESTVECTOR; } - } - return CRYPT_OK; - #endif + } + return CRYPT_OK; +#endif } /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled */ -int blake2s_160_test(void) +int blake2s_160_test(void) { - #ifndef LTC_TEST - return CRYPT_NOP; - #else - static const struct { +#ifndef LTC_TEST + return CRYPT_NOP; +#else + static const struct { char *msg; unsigned char hash[20]; } tests[] = { @@ -439,32 +434,32 @@ int blake2s_160_test(void) { NULL, { 0 } } }; - int i; - unsigned char tmp[20]; - hash_state md; + int i; + unsigned char tmp[20]; + hash_state md; - for (i = 0; tests[i].msg != NULL; i++) { + for (i = 0; tests[i].msg != NULL; i++) { blake2s_160_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); if (XMEMCMP(tmp, tests[i].hash, 20) != 0) { return CRYPT_FAIL_TESTVECTOR; } - } - return CRYPT_OK; - #endif + } + return CRYPT_OK; +#endif } /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled */ -int blake2s_128_test(void) +int blake2s_128_test(void) { - #ifndef LTC_TEST - return CRYPT_NOP; - #else - static const struct { +#ifndef LTC_TEST + return CRYPT_NOP; +#else + static const struct { char *msg; unsigned char hash[16]; } tests[] = { @@ -475,22 +470,20 @@ int blake2s_128_test(void) { NULL, { 0 } } }; - int i; - unsigned char tmp[16]; - hash_state md; + int i; + unsigned char tmp[16]; + hash_state md; - for (i = 0; tests[i].msg != NULL; i++) { + for (i = 0; tests[i].msg != NULL; i++) { blake2s_128_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); if (XMEMCMP(tmp, tests[i].hash, 16) != 0) { return CRYPT_FAIL_TESTVECTOR; } - } - return CRYPT_OK; - #endif + } + return CRYPT_OK; +#endif } - - #endif From 1b5ae955d2d1fa90f675de67689439e0f99fd9d4 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 7 Apr 2017 21:23:10 -0400 Subject: [PATCH 0597/1192] moe clang-format --- src/hashes/blake2s.c | 27 ++++++++++----------------- src/headers/tomcrypt_hash.h | 6 ++---- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 3fe8e0451..221dc0a3e 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -22,22 +22,19 @@ enum blake2s_constant { BLAKE2S_PERSONALBYTES = 8 }; - struct blake2s_param { - unsigned char digest_length; - unsigned char key_length; - unsigned char fanout; - unsigned char depth; - ulong32 leaf_length; - unsigned char node_offset[6]; - unsigned char node_depth; - unsigned char inner_length; - unsigned char salt[BLAKE2S_SALTBYTES]; - unsigned char personal[BLAKE2S_PERSONALBYTES]; + unsigned char digest_length; + unsigned char key_length; + unsigned char fanout; + unsigned char depth; + ulong32 leaf_length; + unsigned char node_offset[6]; + unsigned char node_depth; + unsigned char inner_length; + unsigned char salt[BLAKE2S_SALTBYTES]; + unsigned char personal[BLAKE2S_PERSONALBYTES]; }; - - const struct ltc_hash_descriptor blake2s_256_desc = { "blake2s_256", @@ -53,7 +50,6 @@ const struct ltc_hash_descriptor blake2s_256_desc = NULL }; - const struct ltc_hash_descriptor blake2s_224_desc = { "blake2s_224", @@ -84,7 +80,6 @@ const struct ltc_hash_descriptor blake2s_160_desc = NULL }; - const struct ltc_hash_descriptor blake2s_128_desc = { "blake2s_128", @@ -100,8 +95,6 @@ const struct ltc_hash_descriptor blake2s_128_desc = NULL }; - - static const ulong32 blake2s_IV[8] = { 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 7d6f0d190..062489ea3 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -115,8 +115,7 @@ struct chc_state { #ifdef LTC_BLAKE2S - - struct blake2s_state { +struct blake2s_state { ulong32 h[8]; ulong32 t[2]; ulong32 f[2]; @@ -124,8 +123,7 @@ struct chc_state { ulong32 curlen; unsigned char outlen; unsigned char last_node; - }; - +}; #endif typedef union Hash_state { From 4449cdcea3b798f031bf3ae4408c4f32a6369001 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 7 Apr 2017 23:45:49 -0400 Subject: [PATCH 0598/1192] sort and number the ltc_hash_descriptors. --- src/hashes/blake2s.c | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 221dc0a3e..a33c639df 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -35,63 +35,63 @@ struct blake2s_param { unsigned char personal[BLAKE2S_PERSONALBYTES]; }; -const struct ltc_hash_descriptor blake2s_256_desc = +const struct ltc_hash_descriptor blake2s_128_desc = { - "blake2s_256", - 0, - 32, + "blake2s_128", + 21, + 16, 64, - { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 8 }, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 4 }, 11, - &blake2s_256_init, + &blake2s_128_init, &blake2s_process, &blake2s_done, - &blake2s_256_test, + &blake2s_128_test, NULL }; -const struct ltc_hash_descriptor blake2s_224_desc = +const struct ltc_hash_descriptor blake2s_160_desc = { - "blake2s_224", - 0, + "blake2s_160", + 22, 32, 64, - { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 7 }, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 5 }, 11, - &blake2s_224_init, + &blake2s_160_init, &blake2s_process, &blake2s_done, - &blake2s_224_test, + &blake2s_160_test, NULL }; -const struct ltc_hash_descriptor blake2s_160_desc = +const struct ltc_hash_descriptor blake2s_224_desc = { - "blake2s_160", - 0, + "blake2s_224", + 23, 32, 64, - { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 5 }, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 7 }, 11, - &blake2s_160_init, + &blake2s_224_init, &blake2s_process, &blake2s_done, - &blake2s_160_test, + &blake2s_224_test, NULL }; -const struct ltc_hash_descriptor blake2s_128_desc = +const struct ltc_hash_descriptor blake2s_256_desc = { - "blake2s_128", - 0, - 16, + "blake2s_256", + 24, + 32, 64, - { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 4 }, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 8 }, 11, - &blake2s_128_init, + &blake2s_256_init, &blake2s_process, &blake2s_done, - &blake2s_128_test, + &blake2s_256_test, NULL }; From 063df0bffe7183564f8ca9a4650b8b78d84b44a4 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 7 Apr 2017 23:46:17 -0400 Subject: [PATCH 0599/1192] more tests. --- src/hashes/blake2s.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index a33c639df..61e421d6b 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -348,6 +348,11 @@ int blake2s_256_test(void) 0xe1, 0x11, 0x21, 0xd0, 0x42, 0x35, 0x4a, 0x7c, 0x1f, 0x55, 0xb6, 0x48, 0x2c, 0xa1, 0xa5, 0x1e, 0x1b, 0x25, 0x0d, 0xfd, 0x1e, 0xd0, 0xee, 0xf9 } }, + { "abc", + { 0x50, 0x8c, 0x5e, 0x8c, 0x32, 0x7c, 0x14, 0xe2, + 0xe1, 0xa7, 0x2b, 0xa3, 0x4e, 0xeb, 0x45, 0x2f, + 0x37, 0x45, 0x8b, 0x20, 0x9e, 0xd6, 0x3a, 0x29, + 0x4d, 0x99, 0x9b, 0x4c, 0x86, 0x67, 0x59, 0x82 } }, { NULL, { 0 } } }; @@ -386,6 +391,11 @@ int blake2s_224_test(void) 0xb3, 0x43, 0x34, 0x75, 0xb2, 0xa0, 0xdd, 0x63, 0xd5, 0x4a, 0x11, 0xec, 0xc4, 0xe3, 0xe0, 0x34, 0xe7, 0xbc, 0x1e, 0xf4 } }, + { "abc", + { 0x0b, 0x03, 0x3f, 0xc2, 0x26, 0xdf, 0x7a, 0xbd, + 0xe2, 0x9f, 0x67, 0xa0, 0x5d, 0x3d, 0xc6, 0x2c, + 0xf2, 0x71, 0xef, 0x3d, 0xfe, 0xa4, 0xd3, 0x87, + 0x40, 0x7f, 0xbd, 0x55 } }, { NULL, { 0 } } }; @@ -423,6 +433,10 @@ int blake2s_160_test(void) { 0x35, 0x4c, 0x9c, 0x33, 0xf7, 0x35, 0x96, 0x24, 0x18, 0xbd, 0xac, 0xb9, 0x47, 0x98, 0x73, 0x42, 0x9c, 0x34, 0x91, 0x6f} }, + { "abc", + { 0x5a, 0xe3, 0xb9, 0x9b, 0xe2, 0x9b, 0x01, 0x83, + 0x4c, 0x3b, 0x50, 0x85, 0x21, 0xed, 0xe6, 0x04, + 0x38, 0xf8, 0xde, 0x17 } }, { NULL, { 0 } } }; @@ -459,6 +473,9 @@ int blake2s_128_test(void) { "", { 0x64, 0x55, 0x0d, 0x6f, 0xfe, 0x2c, 0x0a, 0x01, 0xa1, 0x4a, 0xba, 0x1e, 0xad, 0xe0, 0x20, 0x0c } }, + { "abc", + { 0xaa, 0x49, 0x38, 0x11, 0x9b, 0x1d, 0xc7, 0xb8, + 0x7c, 0xba, 0xd0, 0xff, 0xd2, 0x00, 0xd0, 0xae } }, { NULL, { 0 } } }; From 51075724c1a6276bd604b28222d67f41db521e0f Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 7 Apr 2017 23:46:52 -0400 Subject: [PATCH 0600/1192] use hash_state * for all arguments. --- src/hashes/blake2s.c | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 61e421d6b..35b0352ef 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -113,73 +113,73 @@ static const unsigned char blake2s_sigma[10][16] = { { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, }; -static inline int blake2s_set_lastnode(struct blake2s_state *S) +static inline int blake2s_set_lastnode(hash_state *md) { - S->f[1] = ~0U; + md->blake2s.f[1] = ~0U; return 0; } /* Some helper functions, not necessarily useful */ -static inline int blake2s_set_lastblock(struct blake2s_state *S) +static inline int blake2s_set_lastblock(hash_state *md) { - if (S->last_node) - blake2s_set_lastnode(S); + if (md->blake2s.last_node) + blake2s_set_lastnode(md); - S->f[0] = ~0U; + md->blake2s.f[0] = ~0U; return 0; } -static inline int blake2s_increment_counter(struct blake2s_state *S, const ulong32 inc) +static inline int blake2s_increment_counter(hash_state *md, const ulong32 inc) { - S->t[0] += inc; - S->t[1] += (S->t[0] < inc); + md->blake2s.t[0] += inc; + md->blake2s.t[1] += (md->blake2s.t[0] < inc); return 0; } -static inline int blake2s_init0(struct blake2s_state *S) +static inline int blake2s_init0(hash_state *md) { - XMEMSET(S, 0, sizeof(struct blake2s_state)); + XMEMSET(&md->blake2s, 0, sizeof(struct blake2s_state)); for (int i = 0; i < 8; ++i) - S->h[i] = blake2s_IV[i]; + md->blake2s.h[i] = blake2s_IV[i]; return CRYPT_OK; } /* init2 xors IV with input parameter block */ -static int blake2s_init_param(struct blake2s_state *S, const struct blake2s_param *P) +static int blake2s_init_param(hash_state *md, const struct blake2s_param *P) { - blake2s_init0(S); + blake2s_init0(md); ulong32 *p = (ulong32 *)(P); /* IV XOR ParamBlock */ for (size_t i = 0; i < 8; ++i) { ulong32 tmp; LOAD32L(tmp, &p[i]); - S->h[i] ^= tmp; + md->blake2s.h[i] ^= tmp; } - S->outlen = P->digest_length; + md->blake2s.outlen = P->digest_length; return 0; } /* Sequential blake2s initialization */ int blake2s_init(hash_state *md, size_t outlen) { - struct blake2s_param P[1]; + struct blake2s_param P; LTC_ARGCHK(md != NULL); - XMEMSET(P, 0, sizeof(P)); + XMEMSET(&P, 0, sizeof(P)); if ((!outlen) || (outlen > BLAKE2S_OUTBYTES)) return CRYPT_INVALID_ARG; - P->digest_length = (unsigned char)outlen; + P.digest_length = (unsigned char)outlen; - P->fanout = 1; - P->depth = 1; + P.fanout = 1; + P.depth = 1; - return blake2s_init_param(&md->blake2s, P); + return blake2s_init_param(md, &P); } int blake2s_256_init(hash_state *md) { return blake2s_init(md, 32); } @@ -283,7 +283,7 @@ int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen if (inlen > fill) { XMEMCPY(md->blake2s.buf + left, in, fill); md->blake2s.curlen += fill; - blake2s_increment_counter(&md->blake2s, BLAKE2S_BLOCKBYTES); + blake2s_increment_counter(md, BLAKE2S_BLOCKBYTES); blake2s_compress(md, md->blake2s.buf); XMEMCPY(md->blake2s.buf, md->blake2s.buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES); md->blake2s.curlen -= BLAKE2S_BLOCKBYTES; @@ -309,17 +309,17 @@ int blake2s_done(hash_state *md, unsigned char *out) LTC_ARGCHK(md != NULL); LTC_ARGCHK(out != NULL); - /* if(S->outlen != outlen) return CRYPT_INVALID_ARG; */ + /* if(md->blake2s.outlen != outlen) return CRYPT_INVALID_ARG; */ if (md->blake2s.curlen > BLAKE2S_BLOCKBYTES) { - blake2s_increment_counter(&md->blake2s, BLAKE2S_BLOCKBYTES); + blake2s_increment_counter(md, BLAKE2S_BLOCKBYTES); blake2s_compress(md, md->blake2s.buf); md->blake2s.curlen -= BLAKE2S_BLOCKBYTES; XMEMCPY(md->blake2s.buf, md->blake2s.buf + BLAKE2S_BLOCKBYTES, md->blake2s.curlen); } - blake2s_increment_counter(&md->blake2s, (ulong32)md->blake2s.curlen); - blake2s_set_lastblock(&md->blake2s); + blake2s_increment_counter(md, (ulong32)md->blake2s.curlen); + blake2s_set_lastblock(md); XMEMSET(md->blake2s.buf + md->blake2s.curlen, 0, 2 * BLAKE2S_BLOCKBYTES - md->blake2s.curlen); /* Padding */ blake2s_compress(md, md->blake2s.buf); From b0e9a23e3116ac5adbf39c3700fce9fae6e6955a Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 7 Apr 2017 23:47:16 -0400 Subject: [PATCH 0601/1192] makefile updates. --- libtomcrypt_VS2008.vcproj | 4 +++ makefile | 69 ++++++++++++++++++++------------------- makefile.icc | 69 ++++++++++++++++++++------------------- makefile.mingw | 69 ++++++++++++++++++++------------------- makefile.msvc | 69 ++++++++++++++++++++------------------- makefile.shared | 69 ++++++++++++++++++++------------------- makefile.unix | 69 ++++++++++++++++++++------------------- 7 files changed, 214 insertions(+), 204 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index c2b2d5443..c19ca8655 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -823,6 +823,10 @@ + + diff --git a/makefile b/makefile index dc58606f1..77e0ff19d 100644 --- a/makefile +++ b/makefile @@ -71,40 +71,41 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ -src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ -src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ -src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ +src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ +src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ +src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ +src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ +src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ +src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ +src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.icc b/makefile.icc index b7b7eb7c0..813fce5ae 100644 --- a/makefile.icc +++ b/makefile.icc @@ -128,40 +128,41 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ -src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ -src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ -src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ +src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ +src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ +src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ +src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ +src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ +src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ +src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.mingw b/makefile.mingw index fd338ecea..459dcab8b 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -64,40 +64,41 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ -src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ -src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ -src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ +src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ +src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ +src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ +src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ +src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ +src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ +src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.msvc b/makefile.msvc index ab879bf45..5617925a5 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -38,40 +38,41 @@ src/encauth/ocb3/ocb3_encrypt.obj src/encauth/ocb3/ocb3_encrypt_authenticate_mem src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj \ src/encauth/ocb3/ocb3_int_aad_add_block.obj src/encauth/ocb3/ocb3_int_calc_offset_zero.obj \ src/encauth/ocb3/ocb3_int_ntz.obj src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj \ -src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj src/hashes/helper/hash_filehandle.obj \ -src/hashes/helper/hash_memory.obj src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj \ -src/hashes/md5.obj src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj \ -src/hashes/sha1.obj src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj \ -src/hashes/sha2/sha512.obj src/hashes/sha2/sha512_224.obj src/hashes/sha2/sha512_256.obj src/hashes/sha3.obj \ -src/hashes/sha3_test.obj src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj \ -src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj \ -src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj \ -src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj \ -src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj \ -src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj \ -src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj \ -src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj \ -src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ -src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \ -src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/poly1305/poly1305.obj \ -src/mac/poly1305/poly1305_file.obj src/mac/poly1305/poly1305_memory.obj \ -src/mac/poly1305/poly1305_memory_multi.obj src/mac/poly1305/poly1305_test.obj src/mac/xcbc/xcbc_done.obj \ -src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \ -src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \ -src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ -src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/adler32.obj \ -src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crc32.obj \ -src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt_cipher_descriptor.obj \ -src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_constants.obj \ -src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_any.obj \ -src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash.obj \ -src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash_id.obj \ -src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ -src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ -src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ -src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ -src/misc/crypt/crypt_prng_rng_descriptor.obj src/misc/crypt/crypt_register_cipher.obj \ -src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/hashes/blake2s.obj src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj \ +src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \ +src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \ +src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \ +src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj src/hashes/sha2/sha512.obj \ +src/hashes/sha2/sha512_224.obj src/hashes/sha2/sha512_256.obj src/hashes/sha3.obj src/hashes/sha3_test.obj \ +src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj \ +src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj \ +src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj \ +src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj \ +src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj \ +src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj \ +src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj src/mac/pelican/pelican_memory.obj \ +src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj src/mac/pmac/pmac_file.obj \ +src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj src/mac/pmac/pmac_memory_multi.obj \ +src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj src/mac/pmac/pmac_shift_xor.obj \ +src/mac/pmac/pmac_test.obj src/mac/poly1305/poly1305.obj src/mac/poly1305/poly1305_file.obj \ +src/mac/poly1305/poly1305_memory.obj src/mac/poly1305/poly1305_memory_multi.obj \ +src/mac/poly1305/poly1305_test.obj src/mac/xcbc/xcbc_done.obj src/mac/xcbc/xcbc_file.obj \ +src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj src/mac/xcbc/xcbc_memory_multi.obj \ +src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj src/math/fp/ltc_ecc_fp_mulmod.obj \ +src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj src/math/rand_bn.obj src/math/rand_prime.obj \ +src/math/tfm_desc.obj src/misc/adler32.obj src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj \ +src/misc/burn_stack.obj src/misc/crc32.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj \ +src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \ +src/misc/crypt/crypt_constants.obj src/misc/crypt/crypt_find_cipher.obj \ +src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher_id.obj \ +src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_any.obj \ +src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ +src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ +src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_inits.obj \ +src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \ +src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_prng_rng_descriptor.obj \ +src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ +src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pk_get_oid.obj src/misc/pkcs5/pkcs_5_1.obj \ diff --git a/makefile.shared b/makefile.shared index 7b90e0f67..4b751e836 100644 --- a/makefile.shared +++ b/makefile.shared @@ -61,40 +61,41 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ -src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ -src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ -src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ +src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ +src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ +src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ +src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ +src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ +src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ +src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.unix b/makefile.unix index 44a38a03c..ba26c80ee 100644 --- a/makefile.unix +++ b/makefile.unix @@ -69,40 +69,41 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \ -src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \ -src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o \ -src/hashes/sha1.o src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o \ -src/hashes/sha2/sha512.o src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o \ -src/hashes/sha3_test.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ -src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ -src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ +src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ +src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ +src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ +src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ +src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ +src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ +src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ +src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ +src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ +src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ +src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ +src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ +src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ +src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ +src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ +src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ +src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ From 5924bd43e6c4dd1542f8c2d2f443555102a1b7bd Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 8 Apr 2017 15:39:48 -0400 Subject: [PATCH 0602/1192] tweak source to conform a little better --- src/hashes/blake2s.c | 51 +++++++++++++++++++++++-------------- src/headers/tomcrypt_hash.h | 2 +- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 35b0352ef..49aa24cde 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -7,7 +7,20 @@ * guarantee it works. */ -/* based on https://github.com/BLAKE2/BLAKE2/blob/master/ref/blake2s-ref.c public domain/cc0 */ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ /* see also https://www.ietf.org/rfc/rfc7693.txt */ #include "tomcrypt.h" @@ -113,27 +126,24 @@ static const unsigned char blake2s_sigma[10][16] = { { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, }; -static inline int blake2s_set_lastnode(hash_state *md) +static inline void blake2s_set_lastnode(hash_state *md) { md->blake2s.f[1] = ~0U; - return 0; } /* Some helper functions, not necessarily useful */ -static inline int blake2s_set_lastblock(hash_state *md) +static inline void blake2s_set_lastblock(hash_state *md) { if (md->blake2s.last_node) blake2s_set_lastnode(md); md->blake2s.f[0] = ~0U; - return 0; } -static inline int blake2s_increment_counter(hash_state *md, const ulong32 inc) +static inline void blake2s_increment_counter(hash_state *md, const ulong32 inc) { md->blake2s.t[0] += inc; md->blake2s.t[1] += (md->blake2s.t[0] < inc); - return 0; } static inline int blake2s_init0(hash_state *md) @@ -153,18 +163,18 @@ static int blake2s_init_param(hash_state *md, const struct blake2s_param *P) ulong32 *p = (ulong32 *)(P); /* IV XOR ParamBlock */ - for (size_t i = 0; i < 8; ++i) { + for (unsigned long i = 0; i < 8; ++i) { ulong32 tmp; LOAD32L(tmp, &p[i]); md->blake2s.h[i] ^= tmp; } md->blake2s.outlen = P->digest_length; - return 0; + return CRYPT_OK; } /* Sequential blake2s initialization */ -int blake2s_init(hash_state *md, size_t outlen) +int blake2s_init(hash_state *md, unsigned long outlen) { struct blake2s_param P; LTC_ARGCHK(md != NULL); @@ -182,13 +192,13 @@ int blake2s_init(hash_state *md, size_t outlen) return blake2s_init_param(md, &P); } -int blake2s_256_init(hash_state *md) { return blake2s_init(md, 32); } - -int blake2s_224_init(hash_state *md) { return blake2s_init(md, 28); } +int blake2s_128_init(hash_state *md) { return blake2s_init(md, 16); } int blake2s_160_init(hash_state *md) { return blake2s_init(md, 20); } -int blake2s_128_init(hash_state *md) { return blake2s_init(md, 16); } +int blake2s_224_init(hash_state *md) { return blake2s_init(md, 28); } + +int blake2s_256_init(hash_state *md) { return blake2s_init(md, 32); } #define G(r, i, a, b, c, d) \ do { \ @@ -222,11 +232,11 @@ static int blake2s_compress(hash_state *md, unsigned char *buf) ulong32 m[16]; ulong32 v[16]; - for (size_t i = 0; i < 16; ++i) { + for (unsigned long i = 0; i < 16; ++i) { LOAD32L(m[i], buf + i * sizeof(m[i])); } - for (size_t i = 0; i < 8; ++i) + for (unsigned long i = 0; i < 8; ++i) v[i] = md->blake2s.h[i]; v[8] = blake2s_IV[0]; @@ -249,10 +259,10 @@ static int blake2s_compress(hash_state *md, unsigned char *buf) ROUND(8); ROUND(9); - for (size_t i = 0; i < 8; ++i) + for (unsigned long i = 0; i < 8; ++i) md->blake2s.h[i] = md->blake2s.h[i] ^ v[i] ^ v[i + 8]; - return 0; + return CRYPT_OK; } #undef G #undef ROUND @@ -304,7 +314,7 @@ int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen int blake2s_done(hash_state *md, unsigned char *out) { unsigned char buffer[BLAKE2S_OUTBYTES]; - size_t i; + unsigned long i; LTC_ARGCHK(md != NULL); LTC_ARGCHK(out != NULL); @@ -327,6 +337,9 @@ int blake2s_done(hash_state *md, unsigned char *out) STORE32L(md->blake2s.h[i], buffer + sizeof(md->blake2s.h[i]) * i); XMEMCPY(out, buffer, md->blake2s.outlen); +#ifdef LTC_CLEAN_STACK + zeromem(md, sizeof(hash_state)); +#endif return CRYPT_OK; } diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 062489ea3..2fd6de954 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -349,7 +349,7 @@ extern const struct ltc_hash_descriptor blake2s_128_desc; int blake2s_128_init(hash_state * md); int blake2s_128_test(void); -int blake2s_init(hash_state * md, size_t outlen); +int blake2s_init(hash_state * md, unsigned long outlen); int blake2s_process(hash_state * md, const unsigned char *in, unsigned long inlen); int blake2s_done(hash_state * md, unsigned char *hash); #endif From 7c5fef9b717d869c250c344a34747f2dfb7f931b Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 8 Apr 2017 15:40:56 -0400 Subject: [PATCH 0603/1192] add blake2b hash --- src/hashes/blake2b.c | 546 ++++++++++++++++++++++++++++++++++ src/headers/tomcrypt_custom.h | 1 + src/headers/tomcrypt_hash.h | 38 ++- src/misc/crypt/crypt.c | 3 + src/misc/crypt/crypt_sizes.c | 3 + testprof/x86_prof.c | 12 + 6 files changed, 601 insertions(+), 2 deletions(-) create mode 100644 src/hashes/blake2b.c diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c new file mode 100644 index 000000000..29a7c90e0 --- /dev/null +++ b/src/hashes/blake2b.c @@ -0,0 +1,546 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +/* see also https://www.ietf.org/rfc/rfc7693.txt */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2B + + enum blake2b_constant + { + BLAKE2B_BLOCKBYTES = 128, + BLAKE2B_OUTBYTES = 64, + BLAKE2B_KEYBYTES = 64, + BLAKE2B_SALTBYTES = 16, + BLAKE2B_PERSONALBYTES = 16 + }; + + +struct blake2b_param +{ + unsigned char digest_length; + unsigned char key_length; + unsigned char fanout; + unsigned char depth; + ulong32 leaf_length; + ulong32 node_offset; + ulong32 xof_length; + unsigned char node_depth; + unsigned char inner_length; + unsigned char reserved[14]; + unsigned char salt[BLAKE2B_SALTBYTES]; + unsigned char personal[BLAKE2B_PERSONALBYTES]; +}; + + +const struct ltc_hash_descriptor blake2b_160_desc = +{ + "blake2b_160", + 25, + 20, + 128, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 1, 5 }, + 11, + &blake2b_160_init, + &blake2b_process, + &blake2b_done, + &blake2b_160_test, + NULL +}; + +const struct ltc_hash_descriptor blake2b_256_desc = +{ + "blake2b_256", + 26, + 32, + 128, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 1, 8 }, + 11, + &blake2b_256_init, + &blake2b_process, + &blake2b_done, + &blake2b_256_test, + NULL +}; + +const struct ltc_hash_descriptor blake2b_384_desc = +{ + "blake2b_384", + 27, + 48, + 128, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 1, 12 }, + 11, + &blake2b_384_init, + &blake2b_process, + &blake2b_done, + &blake2b_384_test, + NULL +}; + +const struct ltc_hash_descriptor blake2b_512_desc = +{ + "blake2b_512", + 28, + 64, + 128, + { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 1, 16 }, + 11, + &blake2b_512_init, + &blake2b_process, + &blake2b_done, + &blake2b_512_test, + NULL +}; + +static const ulong64 blake2b_IV[8] = +{ + CONST64(0x6a09e667f3bcc908), CONST64(0xbb67ae8584caa73b), + CONST64(0x3c6ef372fe94f82b), CONST64(0xa54ff53a5f1d36f1), + CONST64(0x510e527fade682d1), CONST64(0x9b05688c2b3e6c1f), + CONST64(0x1f83d9abfb41bd6b), CONST64(0x5be0cd19137e2179) +}; + +static const unsigned char blake2b_sigma[12][16] = +{ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } +}; + + +static void blake2b_set_lastnode( hash_state *md ) +{ + md->blake2b.f[1] = CONST64(0xffffffffffffffff); +} + +/* Some helper functions, not necessarily useful */ +static int blake2b_is_lastblock( const hash_state *md ) +{ + return md->blake2b.f[0] != 0; +} + +static void blake2b_set_lastblock( hash_state *md ) +{ + if( md->blake2b.last_node ) blake2b_set_lastnode( md ); + + md->blake2b.f[0] = CONST64(0xffffffffffffffff); +} + +static void blake2b_increment_counter( hash_state *md, ulong64 inc ) +{ + md->blake2b.t[0] += inc; + md->blake2b.t[1] += ( md->blake2b.t[0] < inc ); +} + +static void blake2b_init0( hash_state *md ) +{ + unsigned long i; + XMEMSET( &md->blake2b, 0, sizeof( md->blake2b ) ); + + for( i = 0; i < 8; ++i ) md->blake2b.h[i] = blake2b_IV[i]; +} + +/* init xors IV with input parameter block */ +int blake2b_init_param( hash_state *md, const struct blake2b_param *P ) +{ + const unsigned char *p = ( const unsigned char * )( P ); + unsigned long i; + + blake2b_init0( md ); + + /* IV XOR ParamBlock */ + for( i = 0; i < 8; ++i ) { + ulong64 tmp; + LOAD64L(tmp, p + sizeof( md->blake2b.h[i] ) * i ); + md->blake2b.h[i] ^= tmp; + } + + md->blake2b.outlen = P->digest_length; + return CRYPT_OK; +} + + + +int blake2b_init( hash_state *md, unsigned long outlen ) +{ + struct blake2b_param P; + + LTC_ARGCHK(md != NULL); + + if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) + return CRYPT_INVALID_ARG; + + XMEMSET(&P, 0, sizeof(P)); + + P.digest_length = (unsigned char)outlen; + P.fanout = 1; + P.depth = 1; + return blake2b_init_param( md, &P ); +} + +int blake2b_160_init(hash_state *md) { return blake2b_init(md, 20); } + +int blake2b_256_init(hash_state *md) { return blake2b_init(md, 32); } + +int blake2b_384_init(hash_state *md) { return blake2b_init(md, 48); } + +int blake2b_512_init(hash_state *md) { return blake2b_init(md, 64); } + + + + +#define G(r,i,a,b,c,d) \ + do { \ + a = a + b + m[blake2b_sigma[r][2*i+0]]; \ + d = ROR64(d ^ a, 32); \ + c = c + d; \ + b = ROR64(b ^ c, 24); \ + a = a + b + m[blake2b_sigma[r][2*i+1]]; \ + d = ROR64(d ^ a, 16); \ + c = c + d; \ + b = ROR64(b ^ c, 63); \ + } while(0) + +#define ROUND(r) \ + do { \ + G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ + G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ + G(r,2,v[ 2],v[ 6],v[10],v[14]); \ + G(r,3,v[ 3],v[ 7],v[11],v[15]); \ + G(r,4,v[ 0],v[ 5],v[10],v[15]); \ + G(r,5,v[ 1],v[ 6],v[11],v[12]); \ + G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ + G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ + } while(0) + +#ifdef LTC_CLEAN_STACK +static int _blake2b_compress(hash_state *md, const unsigned char *buf) +#else +static int blake2b_compress(hash_state *md, const unsigned char *buf) +#endif +{ + ulong64 m[16]; + ulong64 v[16]; + unsigned long i; + + for( i = 0; i < 16; ++i ) { + LOAD64L(m[i], buf + i * sizeof( m[i] ) ); + } + + for( i = 0; i < 8; ++i ) { + v[i] = md->blake2b.h[i]; + } + + v[ 8] = blake2b_IV[0]; + v[ 9] = blake2b_IV[1]; + v[10] = blake2b_IV[2]; + v[11] = blake2b_IV[3]; + v[12] = blake2b_IV[4] ^ md->blake2b.t[0]; + v[13] = blake2b_IV[5] ^ md->blake2b.t[1]; + v[14] = blake2b_IV[6] ^ md->blake2b.f[0]; + v[15] = blake2b_IV[7] ^ md->blake2b.f[1]; + + ROUND( 0 ); + ROUND( 1 ); + ROUND( 2 ); + ROUND( 3 ); + ROUND( 4 ); + ROUND( 5 ); + ROUND( 6 ); + ROUND( 7 ); + ROUND( 8 ); + ROUND( 9 ); + ROUND( 10 ); + ROUND( 11 ); + + for( i = 0; i < 8; ++i ) { + md->blake2b.h[i] = md->blake2b.h[i] ^ v[i] ^ v[i + 8]; + } + return CRYPT_OK; +} + +#undef G +#undef ROUND + +#ifdef LTC_CLEAN_STACK +static int blake2b_compress(hash_state *md, const unsigned char *buf) +{ + int err; + err = _blake2b_compress(md, buf); + burn_stack(sizeof(ulong32) * (32 + 2)); + return err; +} +#endif + +int blake2b_process( hash_state *md, const unsigned char *in, unsigned long inlen ) +{ + if( inlen > 0 ) + { + unsigned long left = md->blake2b.curlen; + unsigned long fill = BLAKE2B_BLOCKBYTES - left; + if( inlen > fill ) + { + md->blake2b.curlen = 0; + XMEMCPY( md->blake2b.buf + left, in, fill ); /* Fill buffer */ + blake2b_increment_counter( md, BLAKE2B_BLOCKBYTES ); + blake2b_compress( md, md->blake2b.buf ); /* Compress */ + in += fill; inlen -= fill; + while(inlen > BLAKE2B_BLOCKBYTES) { + blake2b_increment_counter(md, BLAKE2B_BLOCKBYTES); + blake2b_compress( md, in ); + in += BLAKE2B_BLOCKBYTES; + inlen -= BLAKE2B_BLOCKBYTES; + } + } + XMEMCPY( md->blake2b.buf + md->blake2b.curlen, in, inlen ); + md->blake2b.curlen += inlen; + } + return CRYPT_OK; +} + +int blake2b_done( hash_state *md, unsigned char *out) +{ + unsigned char buffer[BLAKE2B_OUTBYTES] = {0}; + unsigned long i; + + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(out != NULL); + + /* if(md->blakebs.outlen != outlen) return CRYPT_INVALID_ARG; */ + + + if( blake2b_is_lastblock( md ) ) + return CRYPT_ERROR; + + blake2b_increment_counter( md, md->blake2b.curlen ); + blake2b_set_lastblock( md ); + XMEMSET( md->blake2b.buf + md->blake2b.curlen, 0, BLAKE2B_BLOCKBYTES - md->blake2b.curlen ); /* Padding */ + blake2b_compress( md, md->blake2b.buf ); + + for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ + STORE64L( md->blake2b.h[i], buffer + sizeof( md->blake2b.h[i] ) * i ); + + XMEMCPY( out, buffer, md->blake2b.outlen ); +#ifdef LTC_CLEAN_STACK + zeromem(buffer, sizeof(buffer)); + zeromem(md, sizeof(hash_state)); +#endif + return CRYPT_OK; +} + + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int blake2b_512_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + static const struct { + char *msg; + unsigned char hash[64]; + } tests[] = { + { "", + { 0x78, 0x6a, 0x02, 0xf7, 0x42, 0x01, 0x59, 0x03, + 0xc6, 0xc6, 0xfd, 0x85, 0x25, 0x52, 0xd2, 0x72, + 0x91, 0x2f, 0x47, 0x40, 0xe1, 0x58, 0x47, 0x61, + 0x8a, 0x86, 0xe2, 0x17, 0xf7, 0x1f, 0x54, 0x19, + 0xd2, 0x5e, 0x10, 0x31, 0xaf, 0xee, 0x58, 0x53, + 0x13, 0x89, 0x64, 0x44, 0x93, 0x4e, 0xb0, 0x4b, + 0x90, 0x3a, 0x68, 0x5b, 0x14, 0x48, 0xb7, 0x55, + 0xd5, 0x6f, 0x70, 0x1a, 0xfe, 0x9b, 0xe2, 0xce } }, + { "abc", + { 0xba, 0x80, 0xa5, 0x3f, 0x98, 0x1c, 0x4d, 0x0d, + 0x6a, 0x27, 0x97, 0xb6, 0x9f, 0x12, 0xf6, 0xe9, + 0x4c, 0x21, 0x2f, 0x14, 0x68, 0x5a, 0xc4, 0xb7, + 0x4b, 0x12, 0xbb, 0x6f, 0xdb, 0xff, 0xa2, 0xd1, + 0x7d, 0x87, 0xc5, 0x39, 0x2a, 0xab, 0x79, 0x2d, + 0xc2, 0x52, 0xd5, 0xde, 0x45, 0x33, 0xcc, 0x95, + 0x18, 0xd3, 0x8a, 0xa8, 0xdb, 0xf1, 0x92, 0x5a, + 0xb9, 0x23, 0x86, 0xed, 0xd4, 0x00, 0x99, 0x23 } }, + + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[64]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + blake2b_512_init(&md); + blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + blake2b_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 64) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; +#endif +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int blake2b_384_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + static const struct { + char *msg; + unsigned char hash[48]; + } tests[] = { + { "", + { 0xb3, 0x28, 0x11, 0x42, 0x33, 0x77, 0xf5, 0x2d, + 0x78, 0x62, 0x28, 0x6e, 0xe1, 0xa7, 0x2e, 0xe5, + 0x40, 0x52, 0x43, 0x80, 0xfd, 0xa1, 0x72, 0x4a, + 0x6f, 0x25, 0xd7, 0x97, 0x8c, 0x6f, 0xd3, 0x24, + 0x4a, 0x6c, 0xaf, 0x04, 0x98, 0x81, 0x26, 0x73, + 0xc5, 0xe0, 0x5e, 0xf5, 0x83, 0x82, 0x51, 0x00 } }, + { "abc", + { 0x6f, 0x56, 0xa8, 0x2c, 0x8e, 0x7e, 0xf5, 0x26, + 0xdf, 0xe1, 0x82, 0xeb, 0x52, 0x12, 0xf7, 0xdb, + 0x9d, 0xf1, 0x31, 0x7e, 0x57, 0x81, 0x5d, 0xbd, + 0xa4, 0x60, 0x83, 0xfc, 0x30, 0xf5, 0x4e, 0xe6, + 0xc6, 0x6b, 0xa8, 0x3b, 0xe6, 0x4b, 0x30, 0x2d, + 0x7c, 0xba, 0x6c, 0xe1, 0x5b, 0xb5, 0x56, 0xf4 } }, + + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[48]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + blake2b_384_init(&md); + blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + blake2b_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 48) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; +#endif +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int blake2b_256_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + static const struct { + char *msg; + unsigned char hash[32]; + } tests[] = { + { "", + { 0x0e, 0x57, 0x51, 0xc0, 0x26, 0xe5, 0x43, 0xb2, + 0xe8, 0xab, 0x2e, 0xb0, 0x60, 0x99, 0xda, 0xa1, + 0xd1, 0xe5, 0xdf, 0x47, 0x77, 0x8f, 0x77, 0x87, + 0xfa, 0xab, 0x45, 0xcd, 0xf1, 0x2f, 0xe3, 0xa8 } }, + { "abc", + { 0xbd, 0xdd, 0x81, 0x3c, 0x63, 0x42, 0x39, 0x72, + 0x31, 0x71, 0xef, 0x3f, 0xee, 0x98, 0x57, 0x9b, + 0x94, 0x96, 0x4e, 0x3b, 0xb1, 0xcb, 0x3e, 0x42, + 0x72, 0x62, 0xc8, 0xc0, 0x68, 0xd5, 0x23, 0x19 } }, + + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[32]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + blake2b_256_init(&md); + blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + blake2b_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; +#endif +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int blake2b_160_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + static const struct { + char *msg; + unsigned char hash[20]; + } tests[] = { + { "", + { 0x33, 0x45, 0x52, 0x4a, 0xbf, 0x6b, 0xbe, 0x18, + 0x09, 0x44, 0x92, 0x24, 0xb5, 0x97, 0x2c, 0x41, + 0x79, 0x0b, 0x6c, 0xf2 } }, + { "abc", + { 0x38, 0x42, 0x64, 0xf6, 0x76, 0xf3, 0x95, 0x36, + 0x84, 0x05, 0x23, 0xf2, 0x84, 0x92, 0x1c, 0xdc, + 0x68, 0xb6, 0x84, 0x6b } }, + + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[20]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + blake2b_160_init(&md); + blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + blake2b_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 20) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; +#endif +} + + +#endif diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 376e38d5e..e7de39360 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -243,6 +243,7 @@ #define LTC_RIPEMD256 #define LTC_RIPEMD320 #define LTC_BLAKE2S +#define LTC_BLAKE2B #define LTC_HASH_HELPERS diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 2fd6de954..e45f290b2 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -113,7 +113,6 @@ struct chc_state { }; #endif - #ifdef LTC_BLAKE2S struct blake2s_state { ulong32 h[8]; @@ -126,6 +125,18 @@ struct blake2s_state { }; #endif +#ifdef LTC_BLAKE2B +struct blake2b_state { + ulong64 h[8]; + ulong64 t[2]; + ulong64 f[2]; + unsigned char buf[128]; + unsigned long curlen; + unsigned long outlen; + unsigned char last_node; +}; +#endif + typedef union Hash_state { char dummy[1]; #ifdef LTC_CHC_HASH @@ -170,10 +181,12 @@ typedef union Hash_state { #ifdef LTC_RIPEMD320 struct rmd320_state rmd320; #endif - #ifdef LTC_BLAKE2S struct blake2s_state blake2s; #endif +#ifdef LTC_BLAKE2B + struct blake2b_state blake2b; +#endif void *data; } hash_state; @@ -354,6 +367,27 @@ int blake2s_process(hash_state * md, const unsigned char *in, unsigned long inle int blake2s_done(hash_state * md, unsigned char *hash); #endif +#ifdef LTC_BLAKE2B +extern const struct ltc_hash_descriptor blake2b_512_desc; +int blake2b_512_init(hash_state * md); +int blake2b_512_test(void); + +extern const struct ltc_hash_descriptor blake2b_384_desc; +int blake2b_384_init(hash_state * md); +int blake2b_384_test(void); + +extern const struct ltc_hash_descriptor blake2b_256_desc; +int blake2b_256_init(hash_state * md); +int blake2b_256_test(void); + +extern const struct ltc_hash_descriptor blake2b_160_desc; +int blake2b_160_init(hash_state * md); +int blake2b_160_test(void); + +int blake2b_init(hash_state * md, unsigned long outlen); +int blake2b_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int blake2b_done(hash_state * md, unsigned char *hash); +#endif #ifdef LTC_MD5 int md5_init(hash_state * md); diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index d3cb1c77c..50379b100 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -183,6 +183,9 @@ const char *crypt_build_settings = #if defined(LTC_BLAKE2S) " BLAKE2S\n" #endif +#if defined(LTC_BLAKE2B) + " BLAKE2B\n" +#endif #if defined(LTC_CHC_HASH) " CHC_HASH\n" #endif diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 82b98a601..0ca1e441f 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -74,6 +74,9 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_BLAKE2S _SZ_STRINGIFY_S(blake2s_state), #endif +#ifdef LTC_BLAKE2B + _SZ_STRINGIFY_S(blake2b_state), +#endif #ifdef LTC_CHC_HASH _SZ_STRINGIFY_S(chc_state), #endif diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 1ba14553a..b3ec43a81 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -325,6 +325,12 @@ static void _unregister_all(void) unregister_hash(&blake2s_224_desc); unregister_hash(&blake2s_256_desc); #endif +#ifdef LTC_BLAKE2B + unregister_hash(&blake2b_160_desc); + unregister_hash(&blake2b_256_desc); + unregister_hash(&blake2b_384_desc); + unregister_hash(&blake2b_512_desc); +#endif #ifdef LTC_CHC_HASH unregister_hash(&chc_desc); #endif @@ -493,6 +499,12 @@ void reg_algs(void) register_hash(&blake2s_224_desc); register_hash(&blake2s_256_desc); #endif +#ifdef LTC_BLAKE2S + register_hash(&blake2b_160_desc); + register_hash(&blake2b_256_desc); + register_hash(&blake2b_384_desc); + register_hash(&blake2b_512_desc); +#endif #ifdef LTC_CHC_HASH register_hash(&chc_desc); if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) { From 6f6e2d30a851e02aee57e51cd4ac28274960620e Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 8 Apr 2017 15:43:38 -0400 Subject: [PATCH 0604/1192] clang-format --- src/hashes/blake2b.c | 299 ++++++++++++++++++++----------------------- 1 file changed, 141 insertions(+), 158 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 29a7c90e0..9b6ce5544 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -27,18 +27,15 @@ #ifdef LTC_BLAKE2B - enum blake2b_constant - { - BLAKE2B_BLOCKBYTES = 128, - BLAKE2B_OUTBYTES = 64, - BLAKE2B_KEYBYTES = 64, - BLAKE2B_SALTBYTES = 16, - BLAKE2B_PERSONALBYTES = 16 - }; - +enum blake2b_constant { + BLAKE2B_BLOCKBYTES = 128, + BLAKE2B_OUTBYTES = 64, + BLAKE2B_KEYBYTES = 64, + BLAKE2B_SALTBYTES = 16, + BLAKE2B_PERSONALBYTES = 16 +}; -struct blake2b_param -{ +struct blake2b_param { unsigned char digest_length; unsigned char key_length; unsigned char fanout; @@ -138,75 +135,68 @@ static const unsigned char blake2b_sigma[12][16] = { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } }; - -static void blake2b_set_lastnode( hash_state *md ) -{ - md->blake2b.f[1] = CONST64(0xffffffffffffffff); -} +static void blake2b_set_lastnode(hash_state *md) { md->blake2b.f[1] = CONST64(0xffffffffffffffff); } /* Some helper functions, not necessarily useful */ -static int blake2b_is_lastblock( const hash_state *md ) -{ - return md->blake2b.f[0] != 0; -} +static int blake2b_is_lastblock(const hash_state *md) { return md->blake2b.f[0] != 0; } -static void blake2b_set_lastblock( hash_state *md ) +static void blake2b_set_lastblock(hash_state *md) { - if( md->blake2b.last_node ) blake2b_set_lastnode( md ); + if (md->blake2b.last_node) + blake2b_set_lastnode(md); - md->blake2b.f[0] = CONST64(0xffffffffffffffff); + md->blake2b.f[0] = CONST64(0xffffffffffffffff); } -static void blake2b_increment_counter( hash_state *md, ulong64 inc ) +static void blake2b_increment_counter(hash_state *md, ulong64 inc) { - md->blake2b.t[0] += inc; - md->blake2b.t[1] += ( md->blake2b.t[0] < inc ); + md->blake2b.t[0] += inc; + md->blake2b.t[1] += (md->blake2b.t[0] < inc); } -static void blake2b_init0( hash_state *md ) +static void blake2b_init0(hash_state *md) { - unsigned long i; - XMEMSET( &md->blake2b, 0, sizeof( md->blake2b ) ); + unsigned long i; + XMEMSET(&md->blake2b, 0, sizeof(md->blake2b)); - for( i = 0; i < 8; ++i ) md->blake2b.h[i] = blake2b_IV[i]; + for (i = 0; i < 8; ++i) + md->blake2b.h[i] = blake2b_IV[i]; } /* init xors IV with input parameter block */ -int blake2b_init_param( hash_state *md, const struct blake2b_param *P ) +int blake2b_init_param(hash_state *md, const struct blake2b_param *P) { - const unsigned char *p = ( const unsigned char * )( P ); - unsigned long i; + const unsigned char *p = (const unsigned char *)(P); + unsigned long i; - blake2b_init0( md ); + blake2b_init0(md); - /* IV XOR ParamBlock */ - for( i = 0; i < 8; ++i ) { - ulong64 tmp; - LOAD64L(tmp, p + sizeof( md->blake2b.h[i] ) * i ); - md->blake2b.h[i] ^= tmp; - } + /* IV XOR ParamBlock */ + for (i = 0; i < 8; ++i) { + ulong64 tmp; + LOAD64L(tmp, p + sizeof(md->blake2b.h[i]) * i); + md->blake2b.h[i] ^= tmp; + } - md->blake2b.outlen = P->digest_length; - return CRYPT_OK; + md->blake2b.outlen = P->digest_length; + return CRYPT_OK; } - - -int blake2b_init( hash_state *md, unsigned long outlen ) +int blake2b_init(hash_state *md, unsigned long outlen) { - struct blake2b_param P; + struct blake2b_param P; - LTC_ARGCHK(md != NULL); + LTC_ARGCHK(md != NULL); - if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) - return CRYPT_INVALID_ARG; + if ((!outlen) || (outlen > BLAKE2B_OUTBYTES)) + return CRYPT_INVALID_ARG; - XMEMSET(&P, 0, sizeof(P)); + XMEMSET(&P, 0, sizeof(P)); - P.digest_length = (unsigned char)outlen; - P.fanout = 1; - P.depth = 1; - return blake2b_init_param( md, &P ); + P.digest_length = (unsigned char)outlen; + P.fanout = 1; + P.depth = 1; + return blake2b_init_param(md, &P); } int blake2b_160_init(hash_state *md) { return blake2b_init(md, 20); } @@ -217,32 +207,29 @@ int blake2b_384_init(hash_state *md) { return blake2b_init(md, 48); } int blake2b_512_init(hash_state *md) { return blake2b_init(md, 64); } - - - -#define G(r,i,a,b,c,d) \ - do { \ - a = a + b + m[blake2b_sigma[r][2*i+0]]; \ - d = ROR64(d ^ a, 32); \ - c = c + d; \ - b = ROR64(b ^ c, 24); \ - a = a + b + m[blake2b_sigma[r][2*i+1]]; \ - d = ROR64(d ^ a, 16); \ - c = c + d; \ - b = ROR64(b ^ c, 63); \ - } while(0) - -#define ROUND(r) \ - do { \ - G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ - G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ - G(r,2,v[ 2],v[ 6],v[10],v[14]); \ - G(r,3,v[ 3],v[ 7],v[11],v[15]); \ - G(r,4,v[ 0],v[ 5],v[10],v[15]); \ - G(r,5,v[ 1],v[ 6],v[11],v[12]); \ - G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ - G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ - } while(0) +#define G(r, i, a, b, c, d) \ + do { \ + a = a + b + m[blake2b_sigma[r][2 * i + 0]]; \ + d = ROR64(d ^ a, 32); \ + c = c + d; \ + b = ROR64(b ^ c, 24); \ + a = a + b + m[blake2b_sigma[r][2 * i + 1]]; \ + d = ROR64(d ^ a, 16); \ + c = c + d; \ + b = ROR64(b ^ c, 63); \ + } while (0) + +#define ROUND(r) \ + do { \ + G(r, 0, v[0], v[4], v[8], v[12]); \ + G(r, 1, v[1], v[5], v[9], v[13]); \ + G(r, 2, v[2], v[6], v[10], v[14]); \ + G(r, 3, v[3], v[7], v[11], v[15]); \ + G(r, 4, v[0], v[5], v[10], v[15]); \ + G(r, 5, v[1], v[6], v[11], v[12]); \ + G(r, 6, v[2], v[7], v[8], v[13]); \ + G(r, 7, v[3], v[4], v[9], v[14]); \ + } while (0) #ifdef LTC_CLEAN_STACK static int _blake2b_compress(hash_state *md, const unsigned char *buf) @@ -250,44 +237,44 @@ static int _blake2b_compress(hash_state *md, const unsigned char *buf) static int blake2b_compress(hash_state *md, const unsigned char *buf) #endif { - ulong64 m[16]; - ulong64 v[16]; - unsigned long i; - - for( i = 0; i < 16; ++i ) { - LOAD64L(m[i], buf + i * sizeof( m[i] ) ); - } - - for( i = 0; i < 8; ++i ) { - v[i] = md->blake2b.h[i]; - } - - v[ 8] = blake2b_IV[0]; - v[ 9] = blake2b_IV[1]; - v[10] = blake2b_IV[2]; - v[11] = blake2b_IV[3]; - v[12] = blake2b_IV[4] ^ md->blake2b.t[0]; - v[13] = blake2b_IV[5] ^ md->blake2b.t[1]; - v[14] = blake2b_IV[6] ^ md->blake2b.f[0]; - v[15] = blake2b_IV[7] ^ md->blake2b.f[1]; - - ROUND( 0 ); - ROUND( 1 ); - ROUND( 2 ); - ROUND( 3 ); - ROUND( 4 ); - ROUND( 5 ); - ROUND( 6 ); - ROUND( 7 ); - ROUND( 8 ); - ROUND( 9 ); - ROUND( 10 ); - ROUND( 11 ); - - for( i = 0; i < 8; ++i ) { - md->blake2b.h[i] = md->blake2b.h[i] ^ v[i] ^ v[i + 8]; - } - return CRYPT_OK; + ulong64 m[16]; + ulong64 v[16]; + unsigned long i; + + for (i = 0; i < 16; ++i) { + LOAD64L(m[i], buf + i * sizeof(m[i])); + } + + for (i = 0; i < 8; ++i) { + v[i] = md->blake2b.h[i]; + } + + v[8] = blake2b_IV[0]; + v[9] = blake2b_IV[1]; + v[10] = blake2b_IV[2]; + v[11] = blake2b_IV[3]; + v[12] = blake2b_IV[4] ^ md->blake2b.t[0]; + v[13] = blake2b_IV[5] ^ md->blake2b.t[1]; + v[14] = blake2b_IV[6] ^ md->blake2b.f[0]; + v[15] = blake2b_IV[7] ^ md->blake2b.f[1]; + + ROUND(0); + ROUND(1); + ROUND(2); + ROUND(3); + ROUND(4); + ROUND(5); + ROUND(6); + ROUND(7); + ROUND(8); + ROUND(9); + ROUND(10); + ROUND(11); + + for (i = 0; i < 8; ++i) { + md->blake2b.h[i] = md->blake2b.h[i] ^ v[i] ^ v[i + 8]; + } + return CRYPT_OK; } #undef G @@ -303,63 +290,60 @@ static int blake2b_compress(hash_state *md, const unsigned char *buf) } #endif -int blake2b_process( hash_state *md, const unsigned char *in, unsigned long inlen ) +int blake2b_process(hash_state *md, const unsigned char *in, unsigned long inlen) { - if( inlen > 0 ) - { - unsigned long left = md->blake2b.curlen; - unsigned long fill = BLAKE2B_BLOCKBYTES - left; - if( inlen > fill ) - { - md->blake2b.curlen = 0; - XMEMCPY( md->blake2b.buf + left, in, fill ); /* Fill buffer */ - blake2b_increment_counter( md, BLAKE2B_BLOCKBYTES ); - blake2b_compress( md, md->blake2b.buf ); /* Compress */ - in += fill; inlen -= fill; - while(inlen > BLAKE2B_BLOCKBYTES) { - blake2b_increment_counter(md, BLAKE2B_BLOCKBYTES); - blake2b_compress( md, in ); - in += BLAKE2B_BLOCKBYTES; - inlen -= BLAKE2B_BLOCKBYTES; + if (inlen > 0) { + unsigned long left = md->blake2b.curlen; + unsigned long fill = BLAKE2B_BLOCKBYTES - left; + if (inlen > fill) { + md->blake2b.curlen = 0; + XMEMCPY(md->blake2b.buf + left, in, fill); /* Fill buffer */ + blake2b_increment_counter(md, BLAKE2B_BLOCKBYTES); + blake2b_compress(md, md->blake2b.buf); /* Compress */ + in += fill; + inlen -= fill; + while (inlen > BLAKE2B_BLOCKBYTES) { + blake2b_increment_counter(md, BLAKE2B_BLOCKBYTES); + blake2b_compress(md, in); + in += BLAKE2B_BLOCKBYTES; + inlen -= BLAKE2B_BLOCKBYTES; + } } - } - XMEMCPY( md->blake2b.buf + md->blake2b.curlen, in, inlen ); - md->blake2b.curlen += inlen; - } - return CRYPT_OK; + XMEMCPY(md->blake2b.buf + md->blake2b.curlen, in, inlen); + md->blake2b.curlen += inlen; + } + return CRYPT_OK; } -int blake2b_done( hash_state *md, unsigned char *out) +int blake2b_done(hash_state *md, unsigned char *out) { - unsigned char buffer[BLAKE2B_OUTBYTES] = {0}; - unsigned long i; + unsigned char buffer[BLAKE2B_OUTBYTES] = { 0 }; + unsigned long i; LTC_ARGCHK(md != NULL); LTC_ARGCHK(out != NULL); /* if(md->blakebs.outlen != outlen) return CRYPT_INVALID_ARG; */ + if (blake2b_is_lastblock(md)) + return CRYPT_ERROR; - if( blake2b_is_lastblock( md ) ) - return CRYPT_ERROR; - - blake2b_increment_counter( md, md->blake2b.curlen ); - blake2b_set_lastblock( md ); - XMEMSET( md->blake2b.buf + md->blake2b.curlen, 0, BLAKE2B_BLOCKBYTES - md->blake2b.curlen ); /* Padding */ - blake2b_compress( md, md->blake2b.buf ); + blake2b_increment_counter(md, md->blake2b.curlen); + blake2b_set_lastblock(md); + XMEMSET(md->blake2b.buf + md->blake2b.curlen, 0, BLAKE2B_BLOCKBYTES - md->blake2b.curlen); /* Padding */ + blake2b_compress(md, md->blake2b.buf); - for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ - STORE64L( md->blake2b.h[i], buffer + sizeof( md->blake2b.h[i] ) * i ); + for (i = 0; i < 8; ++i) /* Output full hash to temp buffer */ + STORE64L(md->blake2b.h[i], buffer + sizeof(md->blake2b.h[i]) * i); - XMEMCPY( out, buffer, md->blake2b.outlen ); + XMEMCPY(out, buffer, md->blake2b.outlen); #ifdef LTC_CLEAN_STACK - zeromem(buffer, sizeof(buffer)); - zeromem(md, sizeof(hash_state)); + zeromem(buffer, sizeof(buffer)); + zeromem(md, sizeof(hash_state)); #endif - return CRYPT_OK; + return CRYPT_OK; } - /** Self-test the hash @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled @@ -542,5 +526,4 @@ int blake2b_160_test(void) #endif } - #endif From b412ab539ade24231624306b7a302780dcacff57 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 8 Apr 2017 15:44:30 -0400 Subject: [PATCH 0605/1192] update makefiles for blake2b. --- libtomcrypt_VS2008.vcproj | 4 ++++ makefile | 2 +- makefile.icc | 2 +- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.shared | 2 +- makefile.unix | 2 +- 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index c19ca8655..1946401ba 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -823,6 +823,10 @@ + + diff --git a/makefile b/makefile index 77e0ff19d..b02fe0f23 100644 --- a/makefile +++ b/makefile @@ -71,7 +71,7 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ diff --git a/makefile.icc b/makefile.icc index 813fce5ae..214b602b7 100644 --- a/makefile.icc +++ b/makefile.icc @@ -128,7 +128,7 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ diff --git a/makefile.mingw b/makefile.mingw index 459dcab8b..d7fd2db8a 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -64,7 +64,7 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ diff --git a/makefile.msvc b/makefile.msvc index 5617925a5..d01c4cbe7 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -38,7 +38,7 @@ src/encauth/ocb3/ocb3_encrypt.obj src/encauth/ocb3/ocb3_encrypt_authenticate_mem src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj \ src/encauth/ocb3/ocb3_int_aad_add_block.obj src/encauth/ocb3/ocb3_int_calc_offset_zero.obj \ src/encauth/ocb3/ocb3_int_ntz.obj src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj \ -src/hashes/blake2s.obj src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj \ +src/hashes/blake2b.obj src/hashes/blake2s.obj src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj \ src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \ src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \ src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \ diff --git a/makefile.shared b/makefile.shared index 4b751e836..a2708ee2f 100644 --- a/makefile.shared +++ b/makefile.shared @@ -61,7 +61,7 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ diff --git a/makefile.unix b/makefile.unix index ba26c80ee..5c58b4309 100644 --- a/makefile.unix +++ b/makefile.unix @@ -69,7 +69,7 @@ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memor src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ From 268c87e33db496f4dc9b0e8534d4a6e2dd6787f5 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 8 Apr 2017 17:00:39 -0400 Subject: [PATCH 0606/1192] add LTC_ARGCHK for blake2b_process. --- src/hashes/blake2b.c | 7 +++++++ src/hashes/blake2s.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 9b6ce5544..fadd6b271 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -292,6 +292,13 @@ static int blake2b_compress(hash_state *md, const unsigned char *buf) int blake2b_process(hash_state *md, const unsigned char *in, unsigned long inlen) { + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(in != NULL); + + if (md->blake2b.curlen > sizeof(md->blake2b.buf)) { + return CRYPT_INVALID_ARG; + } + if (inlen > 0) { unsigned long left = md->blake2b.curlen; unsigned long fill = BLAKE2B_BLOCKBYTES - left; diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 49aa24cde..5eec43c19 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -179,11 +179,11 @@ int blake2s_init(hash_state *md, unsigned long outlen) struct blake2s_param P; LTC_ARGCHK(md != NULL); - XMEMSET(&P, 0, sizeof(P)); - if ((!outlen) || (outlen > BLAKE2S_OUTBYTES)) return CRYPT_INVALID_ARG; + XMEMSET(&P, 0, sizeof(P)); + P.digest_length = (unsigned char)outlen; P.fanout = 1; From b4594ab3c68676eb80c4083a1963bc710be8f699 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 9 Apr 2017 17:22:42 -0400 Subject: [PATCH 0607/1192] remove inline and c99 variable declarations. --- src/hashes/blake2s.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 5eec43c19..db960fe93 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -126,13 +126,13 @@ static const unsigned char blake2s_sigma[10][16] = { { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, }; -static inline void blake2s_set_lastnode(hash_state *md) +static void blake2s_set_lastnode(hash_state *md) { md->blake2s.f[1] = ~0U; } /* Some helper functions, not necessarily useful */ -static inline void blake2s_set_lastblock(hash_state *md) +static void blake2s_set_lastblock(hash_state *md) { if (md->blake2s.last_node) blake2s_set_lastnode(md); @@ -140,13 +140,13 @@ static inline void blake2s_set_lastblock(hash_state *md) md->blake2s.f[0] = ~0U; } -static inline void blake2s_increment_counter(hash_state *md, const ulong32 inc) +static void blake2s_increment_counter(hash_state *md, const ulong32 inc) { md->blake2s.t[0] += inc; md->blake2s.t[1] += (md->blake2s.t[0] < inc); } -static inline int blake2s_init0(hash_state *md) +static int blake2s_init0(hash_state *md) { XMEMSET(&md->blake2s, 0, sizeof(struct blake2s_state)); @@ -159,11 +159,13 @@ static inline int blake2s_init0(hash_state *md) /* init2 xors IV with input parameter block */ static int blake2s_init_param(hash_state *md, const struct blake2s_param *P) { - blake2s_init0(md); + unsigned long i; ulong32 *p = (ulong32 *)(P); + blake2s_init0(md); + /* IV XOR ParamBlock */ - for (unsigned long i = 0; i < 8; ++i) { + for (i = 0; i < 8; ++i) { ulong32 tmp; LOAD32L(tmp, &p[i]); md->blake2s.h[i] ^= tmp; @@ -229,14 +231,15 @@ static int _blake2s_compress(hash_state *md, unsigned char *buf) static int blake2s_compress(hash_state *md, unsigned char *buf) #endif { + unsigned long i; ulong32 m[16]; ulong32 v[16]; - for (unsigned long i = 0; i < 16; ++i) { + for (i = 0; i < 16; ++i) { LOAD32L(m[i], buf + i * sizeof(m[i])); } - for (unsigned long i = 0; i < 8; ++i) + for (i = 0; i < 8; ++i) v[i] = md->blake2s.h[i]; v[8] = blake2s_IV[0]; @@ -259,7 +262,7 @@ static int blake2s_compress(hash_state *md, unsigned char *buf) ROUND(8); ROUND(9); - for (unsigned long i = 0; i < 8; ++i) + for (i = 0; i < 8; ++i) md->blake2s.h[i] = md->blake2s.h[i] ^ v[i] ^ v[i + 8]; return CRYPT_OK; From afc6e8d37075b763d74e8c041a86582b8d8d1086 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 10 Apr 2017 10:21:51 -0400 Subject: [PATCH 0608/1192] minor cleanup. --- src/hashes/blake2b.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index fadd6b271..78089d602 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -135,7 +135,10 @@ static const unsigned char blake2b_sigma[12][16] = { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } }; -static void blake2b_set_lastnode(hash_state *md) { md->blake2b.f[1] = CONST64(0xffffffffffffffff); } +static void blake2b_set_lastnode(hash_state *md) +{ + md->blake2b.f[1] = CONST64(0xffffffffffffffff); +} /* Some helper functions, not necessarily useful */ static int blake2b_is_lastblock(const hash_state *md) { return md->blake2b.f[0] != 0; } @@ -164,7 +167,7 @@ static void blake2b_init0(hash_state *md) } /* init xors IV with input parameter block */ -int blake2b_init_param(hash_state *md, const struct blake2b_param *P) +static int blake2b_init_param(hash_state *md, const struct blake2b_param *P) { const unsigned char *p = (const unsigned char *)(P); unsigned long i; @@ -174,7 +177,7 @@ int blake2b_init_param(hash_state *md, const struct blake2b_param *P) /* IV XOR ParamBlock */ for (i = 0; i < 8; ++i) { ulong64 tmp; - LOAD64L(tmp, p + sizeof(md->blake2b.h[i]) * i); + LOAD64L(tmp, p + i * 8); md->blake2b.h[i] ^= tmp; } @@ -341,7 +344,7 @@ int blake2b_done(hash_state *md, unsigned char *out) blake2b_compress(md, md->blake2b.buf); for (i = 0; i < 8; ++i) /* Output full hash to temp buffer */ - STORE64L(md->blake2b.h[i], buffer + sizeof(md->blake2b.h[i]) * i); + STORE64L(md->blake2b.h[i], buffer + i * 8); XMEMCPY(out, buffer, md->blake2b.outlen); #ifdef LTC_CLEAN_STACK From 6acdfe9a558aad1c5c91b34597321fb358eeaf3a Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 10 Apr 2017 10:22:50 -0400 Subject: [PATCH 0609/1192] cleanup, resins with updated reference source --- src/hashes/blake2s.c | 68 ++++++++++++++++++------------------- src/headers/tomcrypt_hash.h | 6 ++-- 2 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index db960fe93..2ed079802 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -128,16 +128,18 @@ static const unsigned char blake2s_sigma[10][16] = { static void blake2s_set_lastnode(hash_state *md) { - md->blake2s.f[1] = ~0U; + md->blake2s.f[1] = 0xffffffffUL; } /* Some helper functions, not necessarily useful */ +static int blake2s_is_lastblock(const hash_state *md) { return md->blake2s.f[0] != 0; } + static void blake2s_set_lastblock(hash_state *md) { if (md->blake2s.last_node) blake2s_set_lastnode(md); - md->blake2s.f[0] = ~0U; + md->blake2s.f[0] = 0xffffffffUL; } static void blake2s_increment_counter(hash_state *md, const ulong32 inc) @@ -148,9 +150,10 @@ static void blake2s_increment_counter(hash_state *md, const ulong32 inc) static int blake2s_init0(hash_state *md) { + int i; XMEMSET(&md->blake2s, 0, sizeof(struct blake2s_state)); - for (int i = 0; i < 8; ++i) + for (i = 0; i < 8; ++i) md->blake2s.h[i] = blake2s_IV[i]; return CRYPT_OK; @@ -160,14 +163,14 @@ static int blake2s_init0(hash_state *md) static int blake2s_init_param(hash_state *md, const struct blake2s_param *P) { unsigned long i; - ulong32 *p = (ulong32 *)(P); + unsigned char *p = (unsigned char *)(P); blake2s_init0(md); /* IV XOR ParamBlock */ for (i = 0; i < 8; ++i) { ulong32 tmp; - LOAD32L(tmp, &p[i]); + LOAD32L(tmp, p + i * 4); md->blake2s.h[i] ^= tmp; } @@ -226,9 +229,9 @@ int blake2s_256_init(hash_state *md) { return blake2s_init(md, 32); } } while (0) #ifdef LTC_CLEAN_STACK -static int _blake2s_compress(hash_state *md, unsigned char *buf) +static int _blake2s_compress(hash_state *md, const unsigned char *buf) #else -static int blake2s_compress(hash_state *md, unsigned char *buf) +static int blake2s_compress(hash_state *md, const unsigned char *buf) #endif { unsigned long i; @@ -275,7 +278,7 @@ static int blake2s_compress(hash_state *md, unsigned char *buf) { int err; err = _blake2s_compress(md, buf); - burn_stack(sizeof(ulong32) * 32); + burn_stack(sizeof(ulong32) * (32 + 2)); return err; } #endif @@ -289,34 +292,32 @@ int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen return CRYPT_INVALID_ARG; } - while (inlen > 0) { - ulong32 left = md->blake2s.curlen; - ulong32 fill = 2 * BLAKE2S_BLOCKBYTES - left; - + if (inlen > 0) { + unsigned long left = md->blake2s.curlen; + unsigned long fill = BLAKE2S_BLOCKBYTES - left; if (inlen > fill) { - XMEMCPY(md->blake2s.buf + left, in, fill); - md->blake2s.curlen += fill; + md->blake2s.curlen = 0; + XMEMCPY(md->blake2s.buf + left, in, fill); /* Fill buffer */ blake2s_increment_counter(md, BLAKE2S_BLOCKBYTES); - blake2s_compress(md, md->blake2s.buf); - XMEMCPY(md->blake2s.buf, md->blake2s.buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES); - md->blake2s.curlen -= BLAKE2S_BLOCKBYTES; + blake2s_compress(md, md->blake2s.buf); /* Compress */ in += fill; inlen -= fill; - } else /* inlen <= fill */ - { - XMEMCPY(md->blake2s.buf + left, in, inlen); - md->blake2s.curlen += (ulong32)inlen; /* Be lazy, do not compress */ - in += inlen; - inlen -= inlen; + while (inlen > BLAKE2S_BLOCKBYTES) { + blake2s_increment_counter(md, BLAKE2S_BLOCKBYTES); + blake2s_compress(md, in); + in += BLAKE2S_BLOCKBYTES; + inlen -= BLAKE2S_BLOCKBYTES; + } } + XMEMCPY(md->blake2s.buf + md->blake2s.curlen, in, inlen); + md->blake2s.curlen += inlen; } - return CRYPT_OK; } int blake2s_done(hash_state *md, unsigned char *out) { - unsigned char buffer[BLAKE2S_OUTBYTES]; + unsigned char buffer[BLAKE2S_OUTBYTES] = { 0 }; unsigned long i; LTC_ARGCHK(md != NULL); @@ -324,24 +325,21 @@ int blake2s_done(hash_state *md, unsigned char *out) /* if(md->blake2s.outlen != outlen) return CRYPT_INVALID_ARG; */ - if (md->blake2s.curlen > BLAKE2S_BLOCKBYTES) { - blake2s_increment_counter(md, BLAKE2S_BLOCKBYTES); - blake2s_compress(md, md->blake2s.buf); - md->blake2s.curlen -= BLAKE2S_BLOCKBYTES; - XMEMCPY(md->blake2s.buf, md->blake2s.buf + BLAKE2S_BLOCKBYTES, md->blake2s.curlen); - } + if (blake2s_is_lastblock(md)) + return CRYPT_ERROR; - blake2s_increment_counter(md, (ulong32)md->blake2s.curlen); + blake2s_increment_counter(md, md->blake2s.curlen); blake2s_set_lastblock(md); - XMEMSET(md->blake2s.buf + md->blake2s.curlen, 0, 2 * BLAKE2S_BLOCKBYTES - md->blake2s.curlen); /* Padding */ + XMEMSET(md->blake2s.buf + md->blake2s.curlen, 0, BLAKE2S_BLOCKBYTES - md->blake2s.curlen); /* Padding */ blake2s_compress(md, md->blake2s.buf); for (i = 0; i < 8; ++i) /* Output full hash to temp buffer */ - STORE32L(md->blake2s.h[i], buffer + sizeof(md->blake2s.h[i]) * i); + STORE32L(md->blake2s.h[i], buffer + i * 4); XMEMCPY(out, buffer, md->blake2s.outlen); #ifdef LTC_CLEAN_STACK - zeromem(md, sizeof(hash_state)); + zeromem(buffer, sizeof(buffer)); + zeromem(md, sizeof(hash_state)); #endif return CRYPT_OK; } diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index e45f290b2..0f0986164 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -118,9 +118,9 @@ struct blake2s_state { ulong32 h[8]; ulong32 t[2]; ulong32 f[2]; - unsigned char buf[2 * 64]; - ulong32 curlen; - unsigned char outlen; + unsigned char buf[64]; + unsigned long curlen; + unsigned long outlen; unsigned char last_node; }; #endif From 6b46b447b5e38d8a2f951e7bf0a19c3c1e6abfb5 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 10 Apr 2017 10:40:20 -0400 Subject: [PATCH 0610/1192] replace packed parameter struct with offsets into a unsigned char buffer. --- src/hashes/blake2b.c | 41 +++++++++++++++++++++++++++++------------ src/hashes/blake2s.c | 42 ++++++++++++++++++++++++++++++------------ 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 78089d602..430888f71 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -32,9 +32,27 @@ enum blake2b_constant { BLAKE2B_OUTBYTES = 64, BLAKE2B_KEYBYTES = 64, BLAKE2B_SALTBYTES = 16, - BLAKE2B_PERSONALBYTES = 16 + BLAKE2B_PERSONALBYTES = 16, + BLAKE2B_PARAM_SIZE = 64 }; +/* param offsets */ +enum { + O_DIGEST_LENGTH = 0, + O_KEY_LENGTH = 1, + O_FANOUT = 2, + O_DEPTH = 3, + O_LEAF_LENGTH = 4, + O_NODE_OFFSET = 8, + O_XOF_LENGTH = 12, + O_NODE_DEPTH = 16, + O_INNER_LENGTH = 17, + O_RESERVED = 18, + O_SALT = 32, + O_PERSONAL = 48 +}; + +/* struct blake2b_param { unsigned char digest_length; unsigned char key_length; @@ -49,7 +67,7 @@ struct blake2b_param { unsigned char salt[BLAKE2B_SALTBYTES]; unsigned char personal[BLAKE2B_PERSONALBYTES]; }; - +*/ const struct ltc_hash_descriptor blake2b_160_desc = { @@ -167,9 +185,8 @@ static void blake2b_init0(hash_state *md) } /* init xors IV with input parameter block */ -static int blake2b_init_param(hash_state *md, const struct blake2b_param *P) +static int blake2b_init_param(hash_state *md, const unsigned char *P) { - const unsigned char *p = (const unsigned char *)(P); unsigned long i; blake2b_init0(md); @@ -177,29 +194,29 @@ static int blake2b_init_param(hash_state *md, const struct blake2b_param *P) /* IV XOR ParamBlock */ for (i = 0; i < 8; ++i) { ulong64 tmp; - LOAD64L(tmp, p + i * 8); + LOAD64L(tmp, P + i * 8); md->blake2b.h[i] ^= tmp; } - md->blake2b.outlen = P->digest_length; + md->blake2b.outlen = P[O_DIGEST_LENGTH]; return CRYPT_OK; } int blake2b_init(hash_state *md, unsigned long outlen) { - struct blake2b_param P; + unsigned char P[BLAKE2B_PARAM_SIZE]; LTC_ARGCHK(md != NULL); if ((!outlen) || (outlen > BLAKE2B_OUTBYTES)) return CRYPT_INVALID_ARG; - XMEMSET(&P, 0, sizeof(P)); + XMEMSET(P, 0, sizeof(P)); - P.digest_length = (unsigned char)outlen; - P.fanout = 1; - P.depth = 1; - return blake2b_init_param(md, &P); + P[O_DIGEST_LENGTH] = (unsigned char)outlen; + P[O_FANOUT] = 1; + P[O_DEPTH] = 1; + return blake2b_init_param(md, P); } int blake2b_160_init(hash_state *md) { return blake2b_init(md, 20); } diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 2ed079802..bf3690cb9 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -32,21 +32,40 @@ enum blake2s_constant { BLAKE2S_OUTBYTES = 32, BLAKE2S_KEYBYTES = 32, BLAKE2S_SALTBYTES = 8, - BLAKE2S_PERSONALBYTES = 8 + BLAKE2S_PERSONALBYTES = 8, + BLAKE2S_PARAM_SIZE = 32 }; +/* param offsets */ +enum { + O_DIGEST_LENGTH = 0, + O_KEY_LENGTH = 1, + O_FANOUT = 2, + O_DEPTH = 3, + O_LEAF_LENGTH = 4, + O_NODE_OFFSET = 8, + O_XOF_LENGTH = 12, + O_NODE_DEPTH = 14, + O_INNER_LENGTH = 15, + O_SALT = 16, + O_PERSONAL = 24 +}; + +/* struct blake2s_param { unsigned char digest_length; unsigned char key_length; unsigned char fanout; unsigned char depth; ulong32 leaf_length; - unsigned char node_offset[6]; + ulong32 node_offset; + ushort16 xof_length; unsigned char node_depth; unsigned char inner_length; unsigned char salt[BLAKE2S_SALTBYTES]; unsigned char personal[BLAKE2S_PERSONALBYTES]; }; +*/ const struct ltc_hash_descriptor blake2s_128_desc = { @@ -160,41 +179,40 @@ static int blake2s_init0(hash_state *md) } /* init2 xors IV with input parameter block */ -static int blake2s_init_param(hash_state *md, const struct blake2s_param *P) +static int blake2s_init_param(hash_state *md, const unsigned char *P) { unsigned long i; - unsigned char *p = (unsigned char *)(P); blake2s_init0(md); /* IV XOR ParamBlock */ for (i = 0; i < 8; ++i) { ulong32 tmp; - LOAD32L(tmp, p + i * 4); + LOAD32L(tmp, P + i * 4); md->blake2s.h[i] ^= tmp; } - md->blake2s.outlen = P->digest_length; + md->blake2s.outlen = P[O_DIGEST_LENGTH]; return CRYPT_OK; } /* Sequential blake2s initialization */ int blake2s_init(hash_state *md, unsigned long outlen) { - struct blake2s_param P; + unsigned char P[BLAKE2S_PARAM_SIZE]; LTC_ARGCHK(md != NULL); if ((!outlen) || (outlen > BLAKE2S_OUTBYTES)) return CRYPT_INVALID_ARG; - XMEMSET(&P, 0, sizeof(P)); + XMEMSET(P, 0, sizeof(P)); - P.digest_length = (unsigned char)outlen; + P[O_DIGEST_LENGTH] = (unsigned char)outlen; - P.fanout = 1; - P.depth = 1; + P[O_FANOUT] = 1; + P[O_DEPTH] = 1; - return blake2s_init_param(md, &P); + return blake2s_init_param(md, P); } int blake2s_128_init(hash_state *md) { return blake2s_init(md, 16); } From dfbdb626c39ef60869a6100326469fe8685853c7 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 10 Apr 2017 10:50:34 -0400 Subject: [PATCH 0611/1192] add missing const. --- src/hashes/blake2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index bf3690cb9..3fb1d8bc4 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -292,7 +292,7 @@ static int blake2s_compress(hash_state *md, const unsigned char *buf) #undef ROUND #ifdef LTC_CLEAN_STACK -static int blake2s_compress(hash_state *md, unsigned char *buf) +static int blake2s_compress(hash_state *md, const unsigned char *buf) { int err; err = _blake2s_compress(md, buf); From ea8dde7f638f22d740a16922e652e3fb336269a3 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 10 Apr 2017 11:34:59 -0400 Subject: [PATCH 0612/1192] formatting --- src/hashes/blake2b.c | 5 +---- src/hashes/blake2s.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 430888f71..3e7dd1017 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -153,10 +153,7 @@ static const unsigned char blake2b_sigma[12][16] = { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } }; -static void blake2b_set_lastnode(hash_state *md) -{ - md->blake2b.f[1] = CONST64(0xffffffffffffffff); -} +static void blake2b_set_lastnode(hash_state *md) { md->blake2b.f[1] = CONST64(0xffffffffffffffff); } /* Some helper functions, not necessarily useful */ static int blake2b_is_lastblock(const hash_state *md) { return md->blake2b.f[0] != 0; } diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 3fb1d8bc4..1c4164e02 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -145,10 +145,7 @@ static const unsigned char blake2s_sigma[10][16] = { { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, }; -static void blake2s_set_lastnode(hash_state *md) -{ - md->blake2s.f[1] = 0xffffffffUL; -} +static void blake2s_set_lastnode(hash_state *md) { md->blake2s.f[1] = 0xffffffffUL; } /* Some helper functions, not necessarily useful */ static int blake2s_is_lastblock(const hash_state *md) { return md->blake2s.f[0] != 0; } From 55450078eab105b51069f240fd767705f1280d23 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 10 Apr 2017 12:00:22 -0400 Subject: [PATCH 0613/1192] use compare_testvector in tests. --- src/hashes/blake2b.c | 12 ++++-------- src/hashes/blake2s.c | 15 +++++++-------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 3e7dd1017..fa2e21d78 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -411,9 +411,8 @@ int blake2b_512_test(void) blake2b_512_init(&md); blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2b_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 64) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_512", i)) return CRYPT_FAIL_TESTVECTOR; - } } return CRYPT_OK; #endif @@ -458,9 +457,8 @@ int blake2b_384_test(void) blake2b_384_init(&md); blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2b_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 48) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_384", i)) return CRYPT_FAIL_TESTVECTOR; - } } return CRYPT_OK; #endif @@ -501,9 +499,8 @@ int blake2b_256_test(void) blake2b_256_init(&md); blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2b_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_256", i)) return CRYPT_FAIL_TESTVECTOR; - } } return CRYPT_OK; #endif @@ -542,9 +539,8 @@ int blake2b_160_test(void) blake2b_160_init(&md); blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2b_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 20) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_160", i)) return CRYPT_FAIL_TESTVECTOR; - } } return CRYPT_OK; #endif diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 1c4164e02..d39d45b58 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -394,9 +394,9 @@ int blake2s_256_test(void) blake2s_256_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_256", i)) return CRYPT_FAIL_TESTVECTOR; - } + } return CRYPT_OK; #endif @@ -437,9 +437,9 @@ int blake2s_224_test(void) blake2s_224_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 28) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_224", i)) return CRYPT_FAIL_TESTVECTOR; - } + } return CRYPT_OK; #endif @@ -478,9 +478,9 @@ int blake2s_160_test(void) blake2s_160_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 20) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_160", i)) return CRYPT_FAIL_TESTVECTOR; - } + } return CRYPT_OK; #endif @@ -517,9 +517,8 @@ int blake2s_128_test(void) blake2s_128_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 16) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_128", i)) return CRYPT_FAIL_TESTVECTOR; - } } return CRYPT_OK; #endif From 0f97bb741540670494f2aad64864fa8e13fb301c Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 10 Apr 2017 16:37:34 -0400 Subject: [PATCH 0614/1192] fix burn blake2b stack size. --- src/hashes/blake2b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index fa2e21d78..3765b2306 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -302,7 +302,7 @@ static int blake2b_compress(hash_state *md, const unsigned char *buf) { int err; err = _blake2b_compress(md, buf); - burn_stack(sizeof(ulong32) * (32 + 2)); + burn_stack(sizeof(ulong64) * (32 + 1)); return err; } #endif From 4ee9d767bb3807ed728a016d1a1527a1d1d7a53b Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 10 Apr 2017 18:29:51 -0400 Subject: [PATCH 0615/1192] add key/keylen parameters to blake2x_init --- src/hashes/blake2b.c | 35 ++++++++++++++++++++++++++++------- src/hashes/blake2s.c | 36 +++++++++++++++++++++++++++--------- src/headers/tomcrypt_hash.h | 4 ++-- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 3765b2306..20a36e869 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -199,30 +199,51 @@ static int blake2b_init_param(hash_state *md, const unsigned char *P) return CRYPT_OK; } -int blake2b_init(hash_state *md, unsigned long outlen) +int blake2b_init(hash_state *md, unsigned long outlen, const unsigned char *key, unsigned long keylen) { unsigned char P[BLAKE2B_PARAM_SIZE]; + int err; LTC_ARGCHK(md != NULL); if ((!outlen) || (outlen > BLAKE2B_OUTBYTES)) return CRYPT_INVALID_ARG; + if ((key && !keylen) || (keylen && !key) || (keylen > BLAKE2B_KEYBYTES)) + return CRYPT_INVALID_ARG; + XMEMSET(P, 0, sizeof(P)); P[O_DIGEST_LENGTH] = (unsigned char)outlen; + P[O_KEY_LENGTH] = (unsigned char)keylen; P[O_FANOUT] = 1; P[O_DEPTH] = 1; - return blake2b_init_param(md, P); + + err = blake2b_init_param(md, P); + if (err != CRYPT_OK) return err; + + if (key) { + unsigned char block[BLAKE2B_BLOCKBYTES]; + + XMEMSET(block, 0, BLAKE2B_BLOCKBYTES); + XMEMCPY(block, key, keylen); + blake2b_process(md, block, BLAKE2B_BLOCKBYTES); + +#ifdef LTC_CLEAN_STACK + zeromem(block, sizeof(block)); +#endif + } + + return CRYPT_OK; } -int blake2b_160_init(hash_state *md) { return blake2b_init(md, 20); } +int blake2b_160_init(hash_state *md) { return blake2b_init(md, 20, NULL, 0); } -int blake2b_256_init(hash_state *md) { return blake2b_init(md, 32); } +int blake2b_256_init(hash_state *md) { return blake2b_init(md, 32, NULL, 0); } -int blake2b_384_init(hash_state *md) { return blake2b_init(md, 48); } +int blake2b_384_init(hash_state *md) { return blake2b_init(md, 48, NULL, 0); } -int blake2b_512_init(hash_state *md) { return blake2b_init(md, 64); } +int blake2b_512_init(hash_state *md) { return blake2b_init(md, 64, NULL, 0); } #define G(r, i, a, b, c, d) \ do { \ @@ -302,7 +323,7 @@ static int blake2b_compress(hash_state *md, const unsigned char *buf) { int err; err = _blake2b_compress(md, buf); - burn_stack(sizeof(ulong64) * (32 + 1)); + burn_stack(sizeof(ulong64) * 32 + sizeof(unsigned long)); return err; } #endif diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index d39d45b58..c385c7ad5 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -193,32 +193,50 @@ static int blake2s_init_param(hash_state *md, const unsigned char *P) return CRYPT_OK; } -/* Sequential blake2s initialization */ -int blake2s_init(hash_state *md, unsigned long outlen) +int blake2s_init(hash_state *md, unsigned long outlen, const unsigned char *key, unsigned long keylen) { unsigned char P[BLAKE2S_PARAM_SIZE]; + int err; + LTC_ARGCHK(md != NULL); if ((!outlen) || (outlen > BLAKE2S_OUTBYTES)) return CRYPT_INVALID_ARG; + if ((key && !keylen) || (keylen && !key) || (keylen > BLAKE2S_KEYBYTES)) + return CRYPT_INVALID_ARG; + XMEMSET(P, 0, sizeof(P)); P[O_DIGEST_LENGTH] = (unsigned char)outlen; - + P[O_KEY_LENGTH] = (unsigned char)keylen; P[O_FANOUT] = 1; P[O_DEPTH] = 1; - return blake2s_init_param(md, P); + err = blake2s_init_param(md, P); + if (err != CRYPT_OK) return err; + + if (key) { + unsigned char block[BLAKE2S_BLOCKBYTES]; + + XMEMSET(block, 0, BLAKE2S_BLOCKBYTES); + XMEMCPY(block, key, keylen); + blake2s_process(md, block, BLAKE2S_BLOCKBYTES); + +#ifdef LTC_CLEAN_STACK + zeromem(block, sizeof(block)); +#endif + } + return CRYPT_OK; } -int blake2s_128_init(hash_state *md) { return blake2s_init(md, 16); } +int blake2s_128_init(hash_state *md) { return blake2s_init(md, 16, NULL, 0); } -int blake2s_160_init(hash_state *md) { return blake2s_init(md, 20); } +int blake2s_160_init(hash_state *md) { return blake2s_init(md, 20, NULL, 0); } -int blake2s_224_init(hash_state *md) { return blake2s_init(md, 28); } +int blake2s_224_init(hash_state *md) { return blake2s_init(md, 28, NULL, 0); } -int blake2s_256_init(hash_state *md) { return blake2s_init(md, 32); } +int blake2s_256_init(hash_state *md) { return blake2s_init(md, 32, NULL, 0); } #define G(r, i, a, b, c, d) \ do { \ @@ -293,7 +311,7 @@ static int blake2s_compress(hash_state *md, const unsigned char *buf) { int err; err = _blake2s_compress(md, buf); - burn_stack(sizeof(ulong32) * (32 + 2)); + burn_stack(sizeof(ulong32) * (32) + sizeof(unsigned long)); return err; } #endif diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 0f0986164..a07cbc80c 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -362,7 +362,7 @@ extern const struct ltc_hash_descriptor blake2s_128_desc; int blake2s_128_init(hash_state * md); int blake2s_128_test(void); -int blake2s_init(hash_state * md, unsigned long outlen); +int blake2s_init(hash_state * md, unsigned long outlen, const unsigned char *key, unsigned long keylen); int blake2s_process(hash_state * md, const unsigned char *in, unsigned long inlen); int blake2s_done(hash_state * md, unsigned char *hash); #endif @@ -384,7 +384,7 @@ extern const struct ltc_hash_descriptor blake2b_160_desc; int blake2b_160_init(hash_state * md); int blake2b_160_test(void); -int blake2b_init(hash_state * md, unsigned long outlen); +int blake2b_init(hash_state * md, unsigned long outlen, const unsigned char *key, unsigned long keylen); int blake2b_process(hash_state * md, const unsigned char *in, unsigned long inlen); int blake2b_done(hash_state * md, unsigned char *hash); #endif From 2dc574d4772c15ecc2685095e3b35e63e8ec14ab Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 19 Apr 2017 16:46:36 -0400 Subject: [PATCH 0616/1192] use - in hash descriptors. --- src/hashes/blake2b.c | 8 ++++---- src/hashes/blake2s.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 20a36e869..76d2d35be 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -71,7 +71,7 @@ struct blake2b_param { const struct ltc_hash_descriptor blake2b_160_desc = { - "blake2b_160", + "blake2b-160", 25, 20, 128, @@ -86,7 +86,7 @@ const struct ltc_hash_descriptor blake2b_160_desc = const struct ltc_hash_descriptor blake2b_256_desc = { - "blake2b_256", + "blake2b-256", 26, 32, 128, @@ -101,7 +101,7 @@ const struct ltc_hash_descriptor blake2b_256_desc = const struct ltc_hash_descriptor blake2b_384_desc = { - "blake2b_384", + "blake2b-384", 27, 48, 128, @@ -116,7 +116,7 @@ const struct ltc_hash_descriptor blake2b_384_desc = const struct ltc_hash_descriptor blake2b_512_desc = { - "blake2b_512", + "blake2b-512", 28, 64, 128, diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index c385c7ad5..5169eb50e 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -69,7 +69,7 @@ struct blake2s_param { const struct ltc_hash_descriptor blake2s_128_desc = { - "blake2s_128", + "blake2s-128", 21, 16, 64, @@ -84,7 +84,7 @@ const struct ltc_hash_descriptor blake2s_128_desc = const struct ltc_hash_descriptor blake2s_160_desc = { - "blake2s_160", + "blake2s-160", 22, 32, 64, @@ -99,7 +99,7 @@ const struct ltc_hash_descriptor blake2s_160_desc = const struct ltc_hash_descriptor blake2s_224_desc = { - "blake2s_224", + "blake2s-224", 23, 32, 64, @@ -114,7 +114,7 @@ const struct ltc_hash_descriptor blake2s_224_desc = const struct ltc_hash_descriptor blake2s_256_desc = { - "blake2s_256", + "blake2s-256", 24, 32, 64, From c65d24222e1ebe9d6f89993e390bd547e47fb385 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 19 Apr 2017 16:47:03 -0400 Subject: [PATCH 0617/1192] always zeromem hash_state when done --- src/hashes/blake2b.c | 2 +- src/hashes/blake2s.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 76d2d35be..2d602eaaf 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -382,9 +382,9 @@ int blake2b_done(hash_state *md, unsigned char *out) STORE64L(md->blake2b.h[i], buffer + i * 8); XMEMCPY(out, buffer, md->blake2b.outlen); + zeromem(md, sizeof(hash_state)); #ifdef LTC_CLEAN_STACK zeromem(buffer, sizeof(buffer)); - zeromem(md, sizeof(hash_state)); #endif return CRYPT_OK; } diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 5169eb50e..a26b8ce08 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -370,9 +370,9 @@ int blake2s_done(hash_state *md, unsigned char *out) STORE32L(md->blake2s.h[i], buffer + i * 4); XMEMCPY(out, buffer, md->blake2s.outlen); + zeromem(md, sizeof(hash_state)); #ifdef LTC_CLEAN_STACK zeromem(buffer, sizeof(buffer)); - zeromem(md, sizeof(hash_state)); #endif return CRYPT_OK; } From 4905232eda39fda9f3b803d64f4ac6b3c3a8a530 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 19 Apr 2017 16:50:34 -0400 Subject: [PATCH 0618/1192] more tests. --- demos/hashsum.c | 12 ++++++++++++ src/hashes/blake2b.c | 10 ++++++++++ src/hashes/blake2s.c | 10 ++++++++++ 3 files changed, 32 insertions(+) diff --git a/demos/hashsum.c b/demos/hashsum.c index 8f94af55e..9951a8554 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -105,6 +105,18 @@ void register_algs(void) #ifdef LTC_WHIRLPOOL register_hash (&whirlpool_desc); #endif +#ifdef LTC_BLAKE2S + register_hash (&blake2s_128_desc); + register_hash (&blake2s_160_desc); + register_hash (&blake2s_224_desc); + register_hash (&blake2s_256_desc); +#endif +#ifdef LTC_BLAKE2B + register_hash (&blake2b_160_desc); + register_hash (&blake2b_256_desc); + register_hash (&blake2b_384_desc); + register_hash (&blake2b_512_desc); +#endif #ifdef LTC_CHC_HASH register_hash(&chc_desc); if ((err = chc_register(register_cipher(&aes_enc_desc))) != CRYPT_OK) { diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 2d602eaaf..e41906a93 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -508,6 +508,16 @@ int blake2b_256_test(void) 0x31, 0x71, 0xef, 0x3f, 0xee, 0x98, 0x57, 0x9b, 0x94, 0x96, 0x4e, 0x3b, 0xb1, 0xcb, 0x3e, 0x42, 0x72, 0x62, 0xc8, 0xc0, 0x68, 0xd5, 0x23, 0x19 } }, + { "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890", + { 0x0f, 0x6e, 0x01, 0x8d, 0x38, 0xd6, 0x3f, 0x08, + 0x4d, 0x58, 0xe3, 0x0c, 0x90, 0xfb, 0xa2, 0x41, + 0x5f, 0xca, 0x17, 0xfa, 0x66, 0x26, 0x49, 0xf3, + 0x8a, 0x30, 0x41, 0x7c, 0x57, 0xcd, 0xa8, 0x14 } }, { NULL, { 0 } } }; diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index a26b8ce08..ec5520646 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -400,6 +400,16 @@ int blake2s_256_test(void) 0xe1, 0xa7, 0x2b, 0xa3, 0x4e, 0xeb, 0x45, 0x2f, 0x37, 0x45, 0x8b, 0x20, 0x9e, 0xd6, 0x3a, 0x29, 0x4d, 0x99, 0x9b, 0x4c, 0x86, 0x67, 0x59, 0x82 } }, + { "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890", + { 0xa3, 0x78, 0x8b, 0x5b, 0x59, 0xee, 0xe4, 0x41, + 0x95, 0x23, 0x58, 0x00, 0xa4, 0xf9, 0xfa, 0x41, + 0x86, 0x0c, 0x7b, 0x1c, 0x35, 0xa2, 0x42, 0x70, + 0x50, 0x80, 0x79, 0x56, 0xe3, 0xbe, 0x31, 0x74 } }, { NULL, { 0 } } }; From 0109e3ca7827d10095235ecc3b015a675866e52b Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 19 Apr 2017 17:03:34 -0400 Subject: [PATCH 0619/1192] update tv_gen.c --- demos/tv_gen.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index b9fe6b5a7..8469b3a3a 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -100,6 +100,18 @@ void reg_algs(void) #ifdef LTC_WHIRLPOOL register_hash (&whirlpool_desc); #endif +#ifdef LTC_BLAKE2S + register_hash (&blake2s_128_desc); + register_hash (&blake2s_160_desc); + register_hash (&blake2s_224_desc); + register_hash (&blake2s_256_desc); +#endif +#ifdef LTC_BLAKE2B + register_hash (&blake2b_160_desc); + register_hash (&blake2b_256_desc); + register_hash (&blake2b_384_desc); + register_hash (&blake2b_512_desc); +#endif #ifdef LTC_CHC_HASH register_hash(&chc_desc); if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) { From 4f7264135fd72bb4ca9858a4ddcc6ff8013eb65c Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 20 Apr 2017 08:51:53 -0400 Subject: [PATCH 0620/1192] update test vectors --- notes/hash_tv.txt | 1560 +++++++++++++++++++++++++++++++++++++++++++++ notes/hmac_tv.txt | 1560 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3120 insertions(+) diff --git a/notes/hash_tv.txt b/notes/hash_tv.txt index 0e581354c..a7a795f1d 100644 --- a/notes/hash_tv.txt +++ b/notes/hash_tv.txt @@ -2770,6 +2770,1566 @@ Hash: whirlpool 127: 3C9A7F387B7104DF19CF264B0B5821B2E46E44ADC79262546E98FFA113EB3D45799EAC78CCA4643C937FCC3C1D249A212FACB34C63D45EEC81069095D7CDCE7B 128: 803A3B37C89E84FBBEC75BEE3D00DD728FFC4246B5A5E989DC8DC2CD0F7937966AB78C79E1D4648EE6EB40F3D70491CB46B8AB42E155672E2AB8374FCF70DD79 +Hash: blake2s-128 + 0: 64550D6FFE2C0A01A14ABA1EADE0200C + 1: 9F31F3EC588C6064A8E1F9051AEAB90A + 2: F52B4FC6BE5AC0FE16B72622653EB56F + 3: C41561EDB251DF8F3C9523524D60A707 + 4: 51725A57BE12698E2E0D7E98910780A0 + 5: CC08C41EAFF7842C4D0FA1C64E45F1FB + 6: 2C00C87B2FF353A0C365D857F6D4F3C5 + 7: 46F26ED5863A347052CCDDCB71266D6D + 8: 873AD9CE57FB6D239970A38E0D92CD8E + 9: B044DBE06680312DB797F66F8F27165B + 10: 33B42203E0347DDA0524EEF98C549520 + 11: 1A717B76A9D588DF20A139FEB8700A7C + 12: 24375C055F615A9C0DC0EFF1311A5793 + 13: 59C26B0674069026C8FC5E40430AA282 + 14: 823CF141A111D66024B4C82AC33215D7 + 15: 7CFFAEFB9840EAC8962A67CF944D1F72 + 16: DC6772000E3E9567BCFBC92971D67816 + 17: 4398E7D6EF08141A842C26156A9A8A48 + 18: 43819E64E9B7F6CC8472C1B6B68EA581 + 19: 447BB325970AF8FD500ACA7C176ADEBC + 20: F7E75644ACEFDDC9D0547C3CE3FE3F6B + 21: F5D21AAE342B3505373AD3EC5780B447 + 22: 4100572CECDC30AEE55FD5F53BF62A21 + 23: A25F936F82C608D74A4ABC84EF708BFF + 24: 2CCB218B584B721C60607A1B9C4E9F33 + 25: 0072DEF78710F1590F26620AE20DE4C7 + 26: AB0E6C1DCBDB90C92156AA02B36F9A51 + 27: 132362DCA6248CF3D6FB6FCBFDCB4B86 + 28: 193A98A19AFC803105AB43F206F8CAFC + 29: A6C088A5D8142C015770224B3A072DE2 + 30: 25B136277F00BB182E4BB0BCC4200181 + 31: 5B7D0CCBF06C4CA454BE26866C513CEC + 32: 68B96E07FA73966CCEFD87CCAD489984 + 33: 45149912910D47C800FF4E81B0950222 + 34: 651C7F67076CB90849DB32EAE2F79D3A + 35: 9C593BA0329E86C74AE579A6DB7293F9 + 36: 61B1EC51D5066BEBB9D998B9958B363F + 37: 84E835F9A85374098C79FF250F66A7E5 + 38: 6E638958112E8D6214F8DCB9C8282D64 + 39: 02F4BF9AEC321B31762C78D925BCED17 + 40: FC80DE93148DE2CA60A05A8F37C477FC + 41: E38ACF89451884610D983EC19FD57087 + 42: DABACBE6DC653B782B05E5CBBB937413 + 43: FD86FB2467D49C061DFEB1D8E9EAC01B + 44: 07A6516B3A9776542D2309E8497D92C0 + 45: 50BF654DA910A62D1DE7D5D99ED62292 + 46: C66BB047226FE0A8CFD0E66248E950DA + 47: C7C4DBFDF0C3F654396C51688246D95F + 48: 8D9BCFB54B78C2B087C363C2C56225B2 + 49: 425BCD6D6BF3266FDCEC5D98AA85E09A + 50: 5D8355BD197259C37FE9DC2CDD182E85 + 51: BC0EA42B5670AE36052A12A26B109729 + 52: E410D3852089501841E25C84EA73200D + 53: C03EFEEA95B308DB60676C352788819E + 54: 3EE75BA9D3B2D38F2A8DFBA57E28C228 + 55: CE44DC306DFF56ED00A657FB7B25D20C + 56: 081B0E61DBE0EA09128BF93BA7ED8EDC + 57: 3E1338B231B4539CED2D544EA4E36EF8 + 58: 9ACD12EE98341CD766DC19DB927B42C0 + 59: F9DEB66F1A5099D99FFA93D1F3B36990 + 60: 9C9B2E4E368FED54222FBCF50E9DCCE7 + 61: 4349C4260FB9E6E0902EA098502F293D + 62: FCFBE4782A28AF1AFB5DAEFA9599438D + 63: 4006430A2D313751A9ECE24FCCB52DE5 + 64: DC66CA8F03865801B0FFE06ED8A1A90E + 65: 399D3E92CCFCEDCDDE9BF4C2BE14CF8C + 66: 38C73D61E72531B3AC0CDCF871C7DC8A + 67: 8A085A96DE26DE17BA55CC7476F16660 + 68: 12C7C53778F67388EB23191C74283EA8 + 69: 5D441FC807AE9884C83F49C525FED6F0 + 70: 31690A560023F81B096FF943A9838AE9 + 71: 55AF48053A29C3EC6D5B8633F42F0500 + 72: 7181837F0225C7ACB3ACBBAAB1CC6FAF + 73: B1492F0BA13EED356AE769E193B5C967 + 74: 48425DED4E98B96B4A21F8DF8ACF7CE6 + 75: 56C366C91B0994E7DCE0CFCAF1AD2E35 + 76: D85FA654A309770440100767AEB1B225 + 77: 9F21184BF396A5F3ACA9B26DD1433941 + 78: 1ECE3C33C566EA55C5E0D570A48D4722 + 79: 8389E086D81C1A08B81E2A4CE752D58D + 80: F2065C23188121333D580AB95027A834 + 81: 7FFC1056F79C0226E568DDFDEDB68D10 + 82: 91D77F2607100D2EFD10364AA221A512 + 83: BCE2E5CC780AF0CB8487C676B6C57958 + 84: CE7A9493264224636EEE4BD4228D3501 + 85: B79A73B6BAAA83BA4200C13600FB4A29 + 86: 5E175C8D9402168B081021AC4AAE5E98 + 87: 1684969736689A062365D08B2EBA4448 + 88: 3740022A6174BDE156C7880003364907 + 89: B5A1D9C73759DD4965F3A2CEDFE6AD89 + 90: 8C2EAC9298148FD6C259EE2530BD8326 + 91: DC57AD06873459EF69D3530B4F9EE73F + 92: 649619FCBF2D303DD458EBD66969FB6B + 93: 6D6A17605BD1AF230EE9898E0D8B704C + 94: 763F0C908954913C34BDAB019C143582 + 95: B65DA22F1F0F82AECEBE91E1D3CF8C80 + 96: FF04AA06DA3E342AB335E9C1F2201C1F + 97: EBC7F4AC87CFC9CDC9DC13BE494E16D8 + 98: 68C0C171AF8C661AF6AE2E958102247A + 99: F0C587EB6C6AC5E1C34DB3BB3920B56B +100: 666A861D60A4C86BF684FE089CFBA8CC +101: 9CE84B0F08E03DC38BBC89F889D53AA1 +102: C767CC2F8F867551F210DC2616A7978A +103: 8970A7DCB77D9264596EAC8CDB86AE16 +104: 6CE407E9F51D6949B0AC6931EE6BE7D9 +105: C96EE2F5911549E44A1DBBBDFADE9B9F +106: 4ED2790B30C24F0E4D25494313667CB6 +107: 76E535A3B57CD085E8F75925C458083B +108: FDFFA482F90B1A788ACC57169508ADC5 +109: DA54C33D148DAB92D70C8BED79F352BC +110: 2030C26D92D0732A5E45716052147AAD +111: 0760E13DB7921CDBA669C67E88C3A7D1 +112: 73D5A76FB7D704856C0DAA9EC40E75CE +113: 76C45083E3405EEA53EA2884496C80B4 +114: 1EB92DD78744D9C383DCB52BBB418835 +115: 342C06AAC7B367193619B247DD04B0D0 +116: CABDB99087F2227BA327A19DC8052028 +117: 1A693513B7838CD492B7A4708F2CE04A +118: D1FBF911AF9246FC36BDF7D26F85E549 +119: 9D20CA08AD292E41F4F4C0D496E43903 +120: 6DDC8ABD8A94C66B62E6BE297B38CE20 +121: E36B24346B30DEB928D52C20AE068839 +122: D422522FF476B3C8E5D8DC92CFFE49BC +123: 8CF8C2D76AEEEB6C7A72A05448FA14AE +124: 28EF0EA3F71B1F1C024CB77531E6DB95 +125: C8A7768B284F5568F8926518F09C787C +126: 52A7C5E8CC60E4AA0935BF2303A8DD30 +127: 5D3541BE0CE9B6D8F9315862AC0198C5 +128: 7A3B3FA888B60095E7B305EFCF3C3DBC + +Hash: blake2s-160 + 0: 354C9C33F735962418BDACB9479873429C34916FB5A5E989DC8DC2CD0F793796 + 1: 63A5F3DBA42C1EE9CE4147C1B22E0B61F4C7A17AB5A5E989DC8DC2CD0F793796 + 2: D7E7E6E5A94FB0B0319212F4376E60C0BE1E7604B5A5E989DC8DC2CD0F793796 + 3: 5F70714603428963ABE2EA507C1D0A7C3D67A8E4B5A5E989DC8DC2CD0F793796 + 4: D2EB068A022B036AD8F46AD5DB018DF76331BAB1B5A5E989DC8DC2CD0F793796 + 5: 9B76C33F4F273950A4CF51FF337D00E7FC61DD23B5A5E989DC8DC2CD0F793796 + 6: 4309F8371A6AC414FF37D1D52EF1776C95A20789B5A5E989DC8DC2CD0F793796 + 7: B4F2034937EDB13E5B2ACA648274F662E3F284FFB5A5E989DC8DC2CD0F793796 + 8: 55AF018D4764BFB68D6A1157F1CEEC211E1885EAB5A5E989DC8DC2CD0F793796 + 9: 28356DD720151A6F60845D7F0E2364A720AA6E8DB5A5E989DC8DC2CD0F793796 + 10: 92BAE8F308BFAD697E5AEB54A465DA37F9D24425B5A5E989DC8DC2CD0F793796 + 11: 9BFD39BE442702851DD618737A05830E3AA40894B5A5E989DC8DC2CD0F793796 + 12: E2ACC08A5D25D268595EFFCFE34EE1BF3AE884F1B5A5E989DC8DC2CD0F793796 + 13: D899B80BD2B851D721760B03DDD6E6A37F1F074DB5A5E989DC8DC2CD0F793796 + 14: 440DD02BBF5B49139D5A4885F0C923131AD3D3C5B5A5E989DC8DC2CD0F793796 + 15: CA6F08E03BD4580C89A1E341CC248A2847C52F9BB5A5E989DC8DC2CD0F793796 + 16: 7FA3AA4D8C97FF99A6BC5D16613D859E52F026C1B5A5E989DC8DC2CD0F793796 + 17: AF0BECB1E358C5CA393586DF9180EE065A837A22B5A5E989DC8DC2CD0F793796 + 18: 6E7DC6203623F33A98CFC0C05B96A9B3F368FD54B5A5E989DC8DC2CD0F793796 + 19: 9E65CB46384717BF5F6A16D4C8357DC232C9FC3FB5A5E989DC8DC2CD0F793796 + 20: 985ED9932A7529791CC7535AD0FBABC3BE4EF1F3B5A5E989DC8DC2CD0F793796 + 21: 98171FF82492AAFB7FEF5D1C3D2DFC9D2B67AA2FB5A5E989DC8DC2CD0F793796 + 22: 8904388C800814EFEB7ADE5EEC2D19A3908B0779B5A5E989DC8DC2CD0F793796 + 23: 717B89BFE07E2D64391B315603B2AFA849595F8CB5A5E989DC8DC2CD0F793796 + 24: 027EC32547E076CB8AA0645C7F6C3A916339FA29B5A5E989DC8DC2CD0F793796 + 25: 47A86EAAFF8E2C9E72E8352E13907C4625B88C18B5A5E989DC8DC2CD0F793796 + 26: C1688EBF848D91A22499FB6C4126869F2B45C715B5A5E989DC8DC2CD0F793796 + 27: 3B38DA6BC7706A551A2C554653BCE5F88BDFA3DEB5A5E989DC8DC2CD0F793796 + 28: 45F888CFFDDDDE987FAE61A5FA1CA6C0461AB265B5A5E989DC8DC2CD0F793796 + 29: DFEA3AB50EE3D5878F165ECAA9CC497DB82927E4B5A5E989DC8DC2CD0F793796 + 30: 1AB376D7E1A479032F26BC158F698CDD905871CCB5A5E989DC8DC2CD0F793796 + 31: 6E0C39AC0442DC1A6C05ED1602806E64A6EF82E1B5A5E989DC8DC2CD0F793796 + 32: F73E3143C51B27F4E4605613948AA1DD3DB1AD77B5A5E989DC8DC2CD0F793796 + 33: 758D383DFCF4E44D440879E14A16D1303CD4F014B5A5E989DC8DC2CD0F793796 + 34: 439CE5842CADDAC3DEC67A2C47CE3566D8982DF8B5A5E989DC8DC2CD0F793796 + 35: 0483C39E9616A1AE7083CCCD5700C4F8FAD23307B5A5E989DC8DC2CD0F793796 + 36: 8EE9EF037310BA9174217C4921EF32620179D04BB5A5E989DC8DC2CD0F793796 + 37: 1C0BD65FE618575F0750D2E3B08E2E718C8B7970B5A5E989DC8DC2CD0F793796 + 38: F0256B86A8E9EB359F950FF0A5E16596F253BEE4B5A5E989DC8DC2CD0F793796 + 39: 8D7BFFBC634762D0FB5222E4BB0A8719E9B7D081B5A5E989DC8DC2CD0F793796 + 40: 27E1D09CEFD270ADB81599B71A47ABA8E17CE4F9B5A5E989DC8DC2CD0F793796 + 41: C5A52EC4DF672DED31983299F56FE7B389975988B5A5E989DC8DC2CD0F793796 + 42: C9813921DB8760016DA939BF7EC2E34E30A8BB3AB5A5E989DC8DC2CD0F793796 + 43: 7B1D1B8933557B22DE1A9A5FCAE805F52CD30CA4B5A5E989DC8DC2CD0F793796 + 44: F192A8F9A94BD34DF766692A2CDAA63DD0BDDBFDB5A5E989DC8DC2CD0F793796 + 45: 39E6ED136B56D8319DE6D51B3211A035042FFED1B5A5E989DC8DC2CD0F793796 + 46: 5E9930F1EC9066C20296AF7122CBBA72B25A2A93B5A5E989DC8DC2CD0F793796 + 47: 793030A738EB909568471EE20340D32BEA78403AB5A5E989DC8DC2CD0F793796 + 48: 2E8DC80084C5A2E64245E974AFC408C2EBF89D19B5A5E989DC8DC2CD0F793796 + 49: 006869129561FDC6549A03C0B5214B9A76238F92B5A5E989DC8DC2CD0F793796 + 50: 11170463304E748E8DB1449F55191E9D153ED1BDB5A5E989DC8DC2CD0F793796 + 51: 1A0B05555FB77D2F9C074FA3E83BB283F95BE537B5A5E989DC8DC2CD0F793796 + 52: 5F5F8FF3CE86AF33C1415C60F76CB2C25BDE6728B5A5E989DC8DC2CD0F793796 + 53: EC7675D6B24FE54113EE502F4B9C434AE2D510B8B5A5E989DC8DC2CD0F793796 + 54: F6D1E8931D28A492C487FE2B62684B4DEE9606ADB5A5E989DC8DC2CD0F793796 + 55: 2C0AE504B7674099048042CE546844DD06E32EFBB5A5E989DC8DC2CD0F793796 + 56: 81DED6F4245B0BC4C055D5B7940D4A82DFEA329AB5A5E989DC8DC2CD0F793796 + 57: 0285CCF80282440FB7E66B16DCF53D6C530EC3BCB5A5E989DC8DC2CD0F793796 + 58: C617F39AB2446324C5E42D8B24C773AAA55CF624B5A5E989DC8DC2CD0F793796 + 59: C2378D825E5E8D9C98AE33DAED09DB42D8BE0A40B5A5E989DC8DC2CD0F793796 + 60: 62B4DCAAB72D70A77806A9B96C099AC76D04D72CB5A5E989DC8DC2CD0F793796 + 61: 1D9CAAA74E54F3CA2D685C74211C6A4310E66D9DB5A5E989DC8DC2CD0F793796 + 62: 6B190C2ABC4C181FF207099CB51C3DF5C944CE15B5A5E989DC8DC2CD0F793796 + 63: 3D0034E3E070CED4C8555CC592D019AF6155B086B5A5E989DC8DC2CD0F793796 + 64: 68C18B80DD398444AA9FD4272ECFA8E71B31EE8AB5A5E989DC8DC2CD0F793796 + 65: 20EB8EEE0C703A44779298F35F92DA38F2B4F0BFB5A5E989DC8DC2CD0F793796 + 66: EF4CD91D8F64838A042C07FB47F2736E68B66809B5A5E989DC8DC2CD0F793796 + 67: E2F5974DF791223616B42D5DA419DF26F2E128C0B5A5E989DC8DC2CD0F793796 + 68: 06C2DBF070561DC936212A3ADC877C94D6C4A5D0B5A5E989DC8DC2CD0F793796 + 69: 14B0EBC0735758C60EC1EF0DB2DE0E2763801370B5A5E989DC8DC2CD0F793796 + 70: 3D389052DC609E219CCF557B6667F8976B82B782B5A5E989DC8DC2CD0F793796 + 71: ED2B645B593417C11431E55E646D26E92DE1CFB3B5A5E989DC8DC2CD0F793796 + 72: 7150F391010A2F175621D5FFBCF7A6EDFFC8FE1FB5A5E989DC8DC2CD0F793796 + 73: F4B6B92EBE81533243053EF7C44C993F50983B3EB5A5E989DC8DC2CD0F793796 + 74: 36E34AE33E41722AF099E6A57CFD466A5631057AB5A5E989DC8DC2CD0F793796 + 75: 1FBE85FFF071FD6C98F6F1A519E2D64F475ED76AB5A5E989DC8DC2CD0F793796 + 76: 1C6C18D0FC578FB74B92EC0AF23CB61C8E6CF595B5A5E989DC8DC2CD0F793796 + 77: 240240245C8BDB34F0A52656644593BAAE08A5EBB5A5E989DC8DC2CD0F793796 + 78: 2F3320A1E36B4E3CBFF7085B2599752FC830C78DB5A5E989DC8DC2CD0F793796 + 79: 10FCC5E7FE1927674730A94CEC96BF2F0BD9DFCCB5A5E989DC8DC2CD0F793796 + 80: 2E33E68B08D61675372CF6DA84AB69F2EC707B00B5A5E989DC8DC2CD0F793796 + 81: 9729F628CE9C027774A643F3CEF26DA829F36592B5A5E989DC8DC2CD0F793796 + 82: 1EF72D087EF5E79D104396D63579BD6F98CF4C1EB5A5E989DC8DC2CD0F793796 + 83: 69B9DFD3ECC5560FACCFAF2A402F949F76EEAF84B5A5E989DC8DC2CD0F793796 + 84: 12EE430ED6E37CD3B9FE0318F134390F11BB99FBB5A5E989DC8DC2CD0F793796 + 85: 0D491088429004B2ECB84788FB045EAD3F7B6E54B5A5E989DC8DC2CD0F793796 + 86: 0A755ACE4673E9A2A083E9B7E412E0F21C4E8D18B5A5E989DC8DC2CD0F793796 + 87: 38FE0BEA8C3B5D105A6D6BB7D241E4345893FE36B5A5E989DC8DC2CD0F793796 + 88: F94971CFF90543B01DD32C5589032B0C05AC179FB5A5E989DC8DC2CD0F793796 + 89: 720F5741BDC10B4599E67F86C1A14C0116B1C69AB5A5E989DC8DC2CD0F793796 + 90: CB82A141D54DE5386D032C87E417240C2FEAEA5AB5A5E989DC8DC2CD0F793796 + 91: DBDC7A6B1A2EA4CA3275871FECAB399BB2C91065B5A5E989DC8DC2CD0F793796 + 92: 2DF5156607D295E207A31FF08F0CFE7B5659ABD9B5A5E989DC8DC2CD0F793796 + 93: 338F3C5DF3EC240F5310F826EB17E86BA05C4E49B5A5E989DC8DC2CD0F793796 + 94: 60CFC1A154C1D98B44F0DE61090D49E71979D992B5A5E989DC8DC2CD0F793796 + 95: FC9B059E0B22B699387F2DAE43949A56EA395514B5A5E989DC8DC2CD0F793796 + 96: 18BF054303412DA7FEB896C7940D2AE0EA4DD8B8B5A5E989DC8DC2CD0F793796 + 97: C1942585DDFBD73AFBC7F1F8A2FE54EC9DB1DBE9B5A5E989DC8DC2CD0F793796 + 98: A0A46EFE86E0438226977955E5BB92454AC0EDC1B5A5E989DC8DC2CD0F793796 + 99: 5EB5F8576B9D35EABDC5377802F02FF9E121B435B5A5E989DC8DC2CD0F793796 +100: 680D1A3BDA75F684618CBDC2863A76719155EE53B5A5E989DC8DC2CD0F793796 +101: A2923C7BD0EE1A2BE98BA750571B4A95DCD53F67B5A5E989DC8DC2CD0F793796 +102: CA57C775ABB2082BC165CC102BDC54F8F3F2896FB5A5E989DC8DC2CD0F793796 +103: AED1F4A1172389137FFDDB36CED33E70E0AF111BB5A5E989DC8DC2CD0F793796 +104: FE6297DB2444ED4C50860BD0266978C314724920B5A5E989DC8DC2CD0F793796 +105: B522FE23A986B6A911AA575590675DC80A0608F7B5A5E989DC8DC2CD0F793796 +106: 49380F56DFD3E20B1517374304814A8F351B71B9B5A5E989DC8DC2CD0F793796 +107: 9053188745A526DF0431EC4BF836F329B2AD54F3B5A5E989DC8DC2CD0F793796 +108: EBA715AED607617D90340C144D4E9059A80FD465B5A5E989DC8DC2CD0F793796 +109: CB1ABE32A735C49164A068EF87120B49C7EAAB2BB5A5E989DC8DC2CD0F793796 +110: 7081B36DEF56C5FBB541C8C0AD8BB324C29ABE88B5A5E989DC8DC2CD0F793796 +111: AACABE58BF3FCD680DEB8FE8C7D8D74798E9081DB5A5E989DC8DC2CD0F793796 +112: E660714F551A3EAEBF8BF334AF6415152B86E485B5A5E989DC8DC2CD0F793796 +113: 2C425922F0E11972DBD91E4394282E1570BB25A2B5A5E989DC8DC2CD0F793796 +114: 45C24A1C263432568573075A2162CC8098CCA18EB5A5E989DC8DC2CD0F793796 +115: 7847103CF22ABC8C2FC0AD911FEBB7B14943C9B5B5A5E989DC8DC2CD0F793796 +116: C5147A4590DD4C1426E212156E01F608DBD66D69B5A5E989DC8DC2CD0F793796 +117: 965FE7D1837B971EDAB15F7E67EBA9A2E6914F40B5A5E989DC8DC2CD0F793796 +118: 741E306EAD4D955C33052B0ED20F5C5AB20F2101B5A5E989DC8DC2CD0F793796 +119: DB5207DF29623C33809DAC6E43F475D30A72A911B5A5E989DC8DC2CD0F793796 +120: 71EDF00F043A71BA57F6B5E1B68A6789DD546F1DB5A5E989DC8DC2CD0F793796 +121: 8662782A37C5750197139141A9727141552F3ED9B5A5E989DC8DC2CD0F793796 +122: FEE742A0F8B086265397D6F1BBCBBDC0A06BAA02B5A5E989DC8DC2CD0F793796 +123: 79AB45D0C1993E96A5513CB71E90B6CE6534255DB5A5E989DC8DC2CD0F793796 +124: 81941D21C28A57C91B9912A0530393C5EC4B847EB5A5E989DC8DC2CD0F793796 +125: D751DCCD29D33981DF4014FE866B04029BF79370B5A5E989DC8DC2CD0F793796 +126: 247DC8D47CA83F3B852BFBD5C1100E5EA7DB9A8FB5A5E989DC8DC2CD0F793796 +127: B326E5F0E03512E436F31111DF9C378DCA2B3171B5A5E989DC8DC2CD0F793796 +128: FB7B50DB11A7A2ACECF57AA08636DF85EEAAC736B5A5E989DC8DC2CD0F793796 + +Hash: blake2s-224 + 0: 1FA1291E65248B37B3433475B2A0DD63D54A11ECC4E3E034E7BC1EF40F793796 + 1: 61B94EC94622A391D2AE42E6456C9012D5800797B8865AFC482197BB0F793796 + 2: B354A3A86CCB9D779E2CCA139D231DBE9ABF798F167FEA6E3F5778670F793796 + 3: F366ACA9739FDDA59DC11280B6E6D10DB6286B503E1D0A922326307A0F793796 + 4: 42ABB6E970408779166B9EB742FE0621B03F77794A8881FC398F97B30F793796 + 5: 01F21AA3E522547A29784118863AA2A1954E295F42529C3DE06008350F793796 + 6: 4DED466648D01276EAD4A77882C05602F7E92B198E84810A52FF11A80F793796 + 7: D2FC4A9F2B1CC35D2ED8A7C24A91A68C86FBD326574B079C66E411960F793796 + 8: 9903423028C41511FABD3366A07AAF7E480D2B6FC0457EEF7C11A8240F793796 + 9: D664024F8A94368DCCE909495E2CD6BBF1BB02390F8066545D0107010F793796 + 10: 976C9034E79937B253F7D9CEBF6F7E81B57CF27C97551E88FB95168A0F793796 + 11: 314B02060FA7ED987F3C566783A6B325D30F17A6D5F3724E23C466330F793796 + 12: 0C7F28E829AA9484F2AFF0605535404B8E845EC763439FAD1BF860240F793796 + 13: 3C12AE2CB1489D1E962A1D171173628B3D6BE0590C3ADE492C3987B70F793796 + 14: 55B6D6D04513E811CC41F656DA633E7DC9555BDFF733F735ADB531EC0F793796 + 15: 90C14B6F15AB39F0623A092C25171DB744DCEC78BCAC1C5F722C4B560F793796 + 16: 9384BC14A81DA3BBCA13D0CF2A876711545EE8C3A87C191A4169F7270F793796 + 17: 49B6BDF2ED04E5D76A19CAC2BAEF08AAD16A3B4A31B2765781593AF80F793796 + 18: 5AA9C3AABE961DE67A16AFF35B0AABB7E734C26E2EE42C76A46299CD0F793796 + 19: FEB584CF41462363372F82999262AB93F154EBEEB644F58B4713202C0F793796 + 20: E17CA71ADA6B48CBBB8399D9CAEA26D0F2B7F5B1C9BD4924E6A6A4940F793796 + 21: F5BE4A4A44421D403F7A154366311D61E415F6169516E72DB426A4C60F793796 + 22: 2C347252DD3B7B99FEF9038B72E7961799C7DCD7CD9D22BEE98E57200F793796 + 23: D5A11E41B9FF2562A8A93D62B1CC9DE2A734C2C14D7AC5C818B1D2250F793796 + 24: BB2F2A95B9A695091D79CBB7DDB60E6344EE6A1A0A00506F8D4E81A60F793796 + 25: 4C676307A506243B96B8765274D9696C41332EBCACDDCFEF51ED98B20F793796 + 26: EBF674014A0EC1513A522B13CCE542E7E8E4A5C4915A8545DB9A28E90F793796 + 27: 03308AC3021B1F36500A53A14D472C669D03135DA7477E636D3814120F793796 + 28: 9F7194D71D515EBC1E15DDB382D218FB35D91485F7967D9961CCEDCC0F793796 + 29: 8F6809F5F9ADD0562C0D7F70583AC71A24C6C1885EE1D5F572D3D9730F793796 + 30: 00AFC8B9B4F0C30625E53D4F2064F6BFF05EDF46FEEFAC6EA6CB73340F793796 + 31: 4D42ABA3D1D12AF74A8524114B17D6D1957FB24753DDE2E28E9DA3900F793796 + 32: A19C4CA01CE34CD61408E9EC9946E3DAA98AD1B7D77C087782E6827F0F793796 + 33: 800559FD51E93E4BC2FDDFB26964343AF7C0DD343AA3D36D40857F970F793796 + 34: 3656E7DB967CDFC7F3D7BA099827449E9AC38AE992A02D446706CF5C0F793796 + 35: DC690F1B322291B741D0CE2D9639F8DB85FDF5FDE1E41701BFD8A4060F793796 + 36: C0EBB37BB3E12CBD7888255E8C3A8F1EB6AE5A9582455D7A0772BBE50F793796 + 37: 32B16E5D5EDD71424DD8C8E1E23A651322CA06AF13E3FB7E56EA97330F793796 + 38: 20D5B7C0B52320AB1A1FBF7D47626BD758138E07B74B4FB2B846E1860F793796 + 39: C4A7603DFA81B43D36E9F5B0D1423DE4686327F7A4415D62777514280F793796 + 40: 1ECBF4EA964E9B3855A9E9293F3D2D2BE1E251D9204B54B6837800A90F793796 + 41: 9C9440E097BEAD44FA7B968818FF557D41D2AB29EF48212C975378E30F793796 + 42: 97D936C85DA801F053AD2C7EE6D7B4ABFB43D2563FA5CFA76A3660550F793796 + 43: DEF0FA3658530B7BBC0E6D5A30AF8B48ED780C73D947BD267DB36E2F0F793796 + 44: 6C26BA6D96EF33EA6977943D2BDE04AE3BAB13CD7329D7CF304A091E0F793796 + 45: D5E49A864104B862020251F91E917E33F77208797F4FA7FEC2618C180F793796 + 46: 59F3C5D276DD45FD1B1A512094E6F7CB8946D26B6DE0B16659E865050F793796 + 47: C5F52A98EDBA4700EB18E7855EE8DD1A427FC7184FF4259B3DF09B910F793796 + 48: 69A7C96A17478FB971E907399C125E39E7DA329D231C4A1ACFEEE1F50F793796 + 49: F97C42B005A40AC713CD1201544058C332FE83D6A5DFFCB3F7A26DF70F793796 + 50: 080519CB017B2953003725848DD739C9B39AE9D9E6E7E9006103A8520F793796 + 51: 267AEF7F39ED64DCA288F25B01F9AD5478599E1B91B496840A1DF1D60F793796 + 52: 52240CD9B35403B8832680EE72FDDCF37E51897E9E4E46B55D3ACBED0F793796 + 53: 63DA0BF0FBDBA65430F5BBC099A4B7F868672BC3FAD71ED31F5F77B20F793796 + 54: 5EE73E709A1661971150CF31099124CD42A9F9D6FFF6F9078BE631540F793796 + 55: 5CD64A9845375020F2331C72CB955821CFE11D06A3B63D8A1D1187E20F793796 + 56: 8522AB2D20CDF3CA0F85EA5A18E5C385F1BB3E9B0A4FDC07324C98B00F793796 + 57: FE16ABA3459844E3299FB7E0B47A8DC6337C8209CD6220407BF296820F793796 + 58: 86B4C6EF1783701C6F6DC237A8FF45035B61FD7F3FBDA61EF37B79D80F793796 + 59: 2A4A292DC2ACE8BD3729332332AA8757A7DEF68A181DF8CC512669100F793796 + 60: 36410AE1CDAA027F85A4ED1C8892B70E0B4FD541C2A14CC1411D67F00F793796 + 61: 21E5E7CCADB0A287A37C10E4CE258B2658DF29A0E7356C88A3E92C200F793796 + 62: 027B16F4E0F5A5C17A46EA3B51DC50B368EA094F5EF196E615FE8B3D0F793796 + 63: 8D88168937A3B44E45C1408C03DF60835DF2794E8B55ECA1FD1E266A0F793796 + 64: 0F3CD451360AAD6BD7C9CBC1497771315BC0E0F34C82D1F4E1052B1E0F793796 + 65: C4ED166EC8CCB80A236767111FA75498A0666901226B549DE011D5760F793796 + 66: 8CDD99B9C3E2F417C7DD334AD50AF32F220CAC25731C667BA6CFB4FF0F793796 + 67: 19415845A2F27872B881191381DAEA10E24A6DC1214B994DCE330F1E0F793796 + 68: 9973F64635A408C840C1DC2667BA0E9C2BDAFA8E86E584BF2642076B0F793796 + 69: 5041DA88DB2F7478EB5AC630FFB77BE46328891A5BA940141E2344BF0F793796 + 70: 7FD3930B4100F6A6E97B64EFC6BF77E23DA925E1C488FD89C618E03E0F793796 + 71: 4BFA0D8F207926ACAAA0E04A4EA269D822875A5FBB462C72936BFDF40F793796 + 72: FCA9E83CF144083FE82C39CA58341DEC32CEBBEAA87E728689C8C6E80F793796 + 73: 1F152AEAED0107E3F1D7317BCF61FBBBE9756D9C1D3A998ACCE73B190F793796 + 74: 5ECC27D88DC605A4C30CE046CD93C252E646CC5D1303C3A1F80193710F793796 + 75: B44C388E1CFF293242A783EC000E9CF1D977812255009CB35917FD5F0F793796 + 76: E3C4B860A91C6DEDBD796EA5EF957453A41BBD477E5C5327A23C4D870F793796 + 77: B61901A9BA1AB20128DE4832923742E01BA41A648EF09FE5D0FC64E00F793796 + 78: 562B90D86AF640C3835F76B24FB1DB7F509DE8091E15D52FD62837470F793796 + 79: 5704A0A9B316400692431460D45F64C52FF939CD33AC93EE239273520F793796 + 80: 222395B8C1DAD60F29E1B02E9E944CADDA56A61027F46025F893239D0F793796 + 81: FFD94C26439196ACBD2E9C225E522F2825588BDC67053BBF3F0D3A580F793796 + 82: 0F2C8AA114D3A687F143EB35EEBE32FD1CA325AC5B8818024AFB35540F793796 + 83: 00402EC26EFEAAC7E376EB294CC3F1A5ACF55B8B2D06B581194473DA0F793796 + 84: A504DF8BA4C46C6D0923C67DF94169F057A63192A17623FC7B20B1890F793796 + 85: 654954B063729D09A562598A9537EACCC0D98B9BB1FBB34172960F190F793796 + 86: EE5773C670FE153A969B1F3A54F155A28AF9E25BDFEE02285940FF260F793796 + 87: A5FCA2FCE745A8FED0338C747797539CE96998F0678758679BDC7A840F793796 + 88: F2761BB7E85BB2953FB99AFF5F2EC50C6799B140359165035333C8F90F793796 + 89: BD5FE527CD74ADAF6A646C6C35E0B891744CA78098224EC8E4CD5CB80F793796 + 90: 886E3D5B274CF83C5CE6D16E4C3A8D3382A3486A3F447EC70526EE170F793796 + 91: 23E6611E54C8D767D3C0B007F05815E5FACA2DC11A27D5EE5D3F8EAD0F793796 + 92: A09DA0A8EE1DEB0B41C6F50BCE7446A7F6CE60886B5E289EE86F70080F793796 + 93: 60382D65E2FC987AF43757FC7AAA777F82F885C98EA07F650C52A3A10F793796 + 94: D2033BF9C929E13F39A0033669F7B270983CAE1491588D6765BFFCFF0F793796 + 95: 278F3962EB35495F08C04DAC7C2DC972550B5E8125DE7B2DEF30D67A0F793796 + 96: 54501DD2B4B14AE335F0DAA6DE33C862532A9C7D895A33582001BF880F793796 + 97: D14803662A73E03B0EC08DB76877E8EBF614A7B2E48800536032A3290F793796 + 98: 4669600EFB4AB6D1653AA0470F6E35005F961A9A0896F2F3D6A2A5CD0F793796 + 99: 20EE59D9CC85FF096A6C209EE25A9D9D7B01BF6A0FCF3FE512573BB20F793796 +100: D578424CA09A3900792DC6F4D3DD0282B80C39415C0DB9283806A07B0F793796 +101: 047BF849300AF65A5E5A0037A2F03236D78F18AE96C760D084683EE30F793796 +102: 66E2C5DC229AD1318A39E5E38276181E4BEF8467A3EF99CAAD842EF90F793796 +103: FBBA003032683675DFA34448CB70F50F9D52B3FAD23BAAF4E9D810AA0F793796 +104: 87147164C725A5C17F0C108315AB67266D2F748C4F97F3A4A5450C530F793796 +105: 808E48C1FF44EAE1289F2B460E8F5694E65F1F71F08C7F09281B20240F793796 +106: 4D8A491E0F4E265C71A7FD993E94B187B69053D4DC4A45EEFCA667630F793796 +107: 4B93C4B9DF00FB64A1E5D00A7130253B438DD30CF132C1FFA8B494580F793796 +108: FA77DD5A05385B4F08787EC821A4D9643E66570F5ADDCC95C558E9160F793796 +109: BA2E4C01D2C80EEAB1C1D76C3348C37D88EDBE52D2322B38AA4B25530F793796 +110: 50232F65130808FF427EE791C0D7F4B0D80A5428E6D153970462138E0F793796 +111: 6E3DF733DCB232D9742DEAB44A6CC9CE75B52D677599DE018BE80A020F793796 +112: 589286CE5D448B9B6A727AE3E24DEB9E8141FEDB1E8E853556A63A030F793796 +113: E48768C63384D8C29736969B1F2934D57EABE67D80EC1B05C74607CF0F793796 +114: D243C7B0EA86D4286FC46217A4DBACAB02D47B553E500F41225A6F9E0F793796 +115: 5048ADFB6091292878E21F2D40682F385B130294BC61216133B7F28D0F793796 +116: 2400C769610FB06F9BE1810F202E325F5984289533595D5252DB52B80F793796 +117: B64166E2678CB7BED689CD28F0C06969559FFF3F8C31564BF68C07410F793796 +118: D8160C3E3AAC9FE0368FACB3190AB11ECF545DF83F6A60D058A069080F793796 +119: AC993AF05709DE0C7516C09F505562D8F10C643690ADF3DC1EB128030F793796 +120: 8D3221FFC272D7FD44D4EA0AF6AE4AF7D5E0BE1E48F305B7EFB1BC6D0F793796 +121: F14EAFFA4F73354329CD49634836E3A69DE1A89C80262BF40668F2CC0F793796 +122: F4DE293C01AF09BFA4E7417488EA8D599FA854C6305E8D638AC831460F793796 +123: BFC807EFE5CF0C5C7F71E337E68BA974F137DF299D01DC7E57F053D00F793796 +124: B943A8B8EC482F68977BD6FEFD3FDEB1FCADFB84B3B5A8442CBF4F0B0F793796 +125: 01D45AD3FF542DB030F7EE00F80342EE397DB480737A3A17098C08040F793796 +126: 11FAE1A284C26D0475026225741EE11E10E96453B92FAA72FF4DBD470F793796 +127: A5CE0FF6222E2669FC425EF4D5CDAED1870BF1C384A560E4DD86F5B30F793796 +128: 784E4D4A1465F11253D1812C9C865C99581656086F4F2B7EE7FFDBB60F793796 + +Hash: blake2s-256 + 0: 69217A3079908094E11121D042354A7C1F55B6482CA1A51E1B250DFD1ED0EEF9 + 1: E34D74DBAF4FF4C6ABD871CC220451D2EA2648846C7757FBAAC82FE51AD64BEA + 2: DDAD9AB15DAC4549BA42F49D262496BEF6C0BAE1DD342A8808F8EA267C6E210C + 3: E8F91C6EF232A041452AB0E149070CDD7DD1769E75B3A5921BE37876C45C9900 + 4: 0CC70E00348B86BA2944D0C32038B25C55584F90DF2304F55FA332AF5FB01E20 + 5: EC1964191087A4FE9DF1C795342A02FFC191A5B251764856AE5B8B5769F0C6CD + 6: E1FA51618D7DF4EB70CF0D5A9E906F806E9D19F7F4F01E3B621288E4120405D6 + 7: 598001FAFBE8F94EC66DC827D012CFCBBA2228569F448E89EA2208C8BF769293 + 8: C7E887B546623635E93E0495598F1726821996C2377705B93A1F636F872BFA2D + 9: C315A437DD28062A770D481967136B1B5EB88B21EE53D0329C5897126E9DB02C + 10: BB473DEDDC055FEA6228F207DA575347BB00404CD349D38C18026307A224CBFF + 11: 687E1873A8277591BB33D9ADF9A13912EFEFE557CAFC39A7952623E47255F16D + 12: 1AC7BA754D6E2F94E0E86C46BFB262ABBB74F450EF456D6B4D97AA80CE6DA767 + 13: 012C97809614816B5D9494477D4B687D15B96EB69C0E8074A8516F31224B5C98 + 14: 91FFD26CFA4DA5134C7EA262F7889C329F61F6A657225CC212F40056D986B3F4 + 15: D97C828D8182A72180A06A78268330673F7C4E0635947C04C02323FD45C0A52D + 16: EFC04CDC391C7E9119BD38668A534E65FE31036D6A62112E44EBEB11F9C57080 + 17: 992CF5C053442A5FBC4FAF583E04E50BB70D2F39FBB6A503F89E56A63E18578A + 18: 38640E9F21983E67B539CACCAE5ECF615AE2764F75A09C9C59B76483C1FBC735 + 19: 213DD34C7EFE4FB27A6B35F6B4000D1FE03281AF3C723E5C9F94747A5F31CD3B + 20: EC246EEEB9CED3F7AD33ED28660DD9BB0732513DB4E2FA278B60CDE3682A4CCD + 21: AC9B61D446648C3005D7892BF3A8719F4C8181CFDCBC2B79FEF10A279B911095 + 22: 7BF8B22959E34E3A43F7079223E83A9754617D391E213DFD808E41B9BEAD4CE7 + 23: 68D4B5D4FA0E302B64CCC5AF792913AC4C88EC95C07DDF40694256EB88CE9F3D + 24: B2C2420F05F9ABE36315919336B37E4E0FA33FF7E76A492767006FDB5D935462 + 25: 134F61BBD0BBB69AED5343904551A3E6C1AA7DCDD77E903E7023EB7C60320AA7 + 26: 4693F9BFF7D4F3986A7D176E6E06F72AD1490D805C99E25347B8DE77B4DB6D9B + 27: 853E26F741953B0FD5BDB424E8AB9E8B3750EAA8EF61E47902C91E554E9C73B9 + 28: F7DE536361ABAA0E158156CF0EA4F63A99B5E4054F8FA4C9D45F6285CAD55694 + 29: 4C230608860A99AE8D7BD5C2CC17FA52096B9A61BEDB17CB7617864AD29CA7A6 + 30: AEB920EA87952DADB1FB759291E3388139A872865001886ED84752E93C250C2A + 31: ABA4AD9B480B9DF3D08CA5E87B0C2440D4E4EA21224C2EB42CBAE469D089B931 + 32: 05825607D7FDF2D82EF4C3C8C2AEA961AD98D60EDFF7D018983E21204C0D93D1 + 33: A742F8B6AF82D8A6CA2357C5F1CF91DEFBD066267D75C048B352366585025962 + 34: 2BCAC89599000B42C95AE23835A713704ED79789C84FEF149A874FF733F017A2 + 35: AC1ED07D048F105A9E5B7AB85B09A492D5BAFF14B8BFB0E9FD789486EEA2B974 + 36: E48D0ECFAF497D5B27C25D99E156CB0579D440D6E31FB62473696DBF95E010E4 + 37: 12A91FADF8B21644FD0F934F3C4A8F62BA862FFD20E8E961154C15C13884ED3D + 38: 7CBEE96E139897DC98FBEF3BE81AD4D964D235CB12141FB66727E6E5DF73A878 + 39: EBF66ABB597AE572A7297CB0871E355ACCAFAD8377B8E78BF164CE2A18DE4BAF + 40: 71B933B07E4FF7818CE059D008829E453C6FF02EC0A7DB393FC2D870F37A7286 + 41: 7CF7C51331220B8D3EBAED9C29398A16D98156E2613CB088F2B0E08A1BE4CF4F + 42: 3E41A108E0F64AD276B979E1CE068279E16F7BC7E4AA1D211E17B81161DF1602 + 43: 886502A82AB47BA8D86710AA9DE3D46EA65C47AF6EE8DE450CCEB8B11B045F50 + 44: C021BC5F0954FEE94F46EA09487E10A84840D02F64810BC08D9E551F7D416814 + 45: 2030516E8A5FE19AE79C336FCE26382A749D3FD0EC91E537D4BD2358C12DFB22 + 46: 556698DAC8317FD36DFBDF25A79CB112D5425860605CBAF507F23BF7E9F42AFE + 47: 2F867BA67773FDC3E92FCED99A6409AD39D0B880FDE8F109A81730C4451D0178 + 48: 172EC218F119DFAE98896DFF29DD9876C94AF87417F9AE4C7014BB4E4B96AFC7 + 49: 3F85814A18195F879AA962F95D26BD82A278F2B82320218F6B3BD6F7F667A6D9 + 50: 1B618FBAA566B3D498C12E982C9EC52E4DA85A8C54F38F34C090394F23C184C1 + 51: 0C758FB5692FFD41A3575D0AF00CC7FBF2CBE5905A58323A88AE4244F6E4C993 + 52: A931360CAD628C7F12A6C1C4B753B0F4062AEF3CE65A1AE3F19369DADF3AE23D + 53: CBAC7D773B1E3B3C6691D7ABB7E9DF045C8BA19268DED153207F5E804352EC5D + 54: 23A196D3802ED3C1B384019A82325840D32F71950C4580B03445E0898E14053C + 55: F4495470F226C8C214BE08FDFAD4BC4A2A9DBEA9136A210DF0D4B64929E6FC14 + 56: E290DD270B467F34AB1C002D340FA016257FF19E5833FDBBF2CB401C3B2817DE + 57: 9FC7B5DED3C15042B2A6582DC39BE016D24A682D5E61AD1EFF9C63309848F706 + 58: 8CCA67A36D17D5E6341CB592FD7BEF9926C9E3AA1027EA11A7D8BD260B576E04 + 59: 409392F560F86831DA4373EE5E0074260595D7BC24183B60ED700D4583D3F6F0 + 60: 2802165DE090915546F3398CD849164A19F92ADBC361ADC99B0F20C8EA071054 + 61: AD839168D9F8A4BE95BA9EF9A692F07256AE43FE6F9864E290691B0256CE50A9 + 62: 75FDAA5038C284B86D6E8AFFE8B2807E467B86600E79AF3689FBC06328CBF894 + 63: E57CB79487DD57902432B250733813BD96A84EFCE59F650FAC26E6696AEFAFC3 + 64: 56F34E8B96557E90C1F24B52D0C89D51086ACF1B00F634CF1DDE9233B8EAAA3E + 65: 1B53EE94AAF34E4B159D48DE352C7F0661D0A40EDFF95A0B1639B4090E974472 + 66: 05705E2A81757C14BD383EA98DDA544EB10E6BC07BAE435E2518DBE133525375 + 67: D8B2866E8A309DB53E529EC32911D82F5CA16CFF76216891A9676AA31AAA6C42 + 68: F5041C241270EB04C71EC2C95D4C38D803B1237B0F29FD4DB3EB397669E88699 + 69: 9A4CE077C349322F595E0EE79ED0DA5FAB66752CBFEF8F87D0E9D0723C7530DD + 70: 657B09F3D0F52B5B8F2F97163A0EDF0C04F075408A07BBEB3A4101A891990D62 + 71: 1E3F7BD5A58FA533344AA8ED3AC122BB9E70D4EF50D004530821948F5FE6315A + 72: 80DCCF3FD83DFD0D35AA28585922AB89D5313997673EAF905CEA9C0B225C7B5F + 73: 8A0D0FBF6377D83BB08B514B4B1C43ACC95D751714F8925645CB6BC856CA150A + 74: 9FA5B487738AD2844CC6348A901918F659A3B89E9C0DFEEAD30DD94BCF42EF8E + 75: 80832C4A1677F5EA2560F668E9354DD36997F03728CFA55E1B38337C0C9EF818 + 76: AB37DDB683137E74080D026B590B96AE9BB447722F305A5AC570EC1DF9B1743C + 77: 3EE735A694C2559B693AA68629361E15D12265AD6A3DEDF488B0B00FAC9754BA + 78: D6FCD23219B647E4CBD5EB2D0AD01EC8838A4B2901FC325CC3701981CA6C888B + 79: 0520EC2F5BF7A755DACB50C6BF233E3515434763DB0139CCD9FAEFBB8207612D + 80: AFF3B75F3F581264D7661662B92F5AD37C1D32BD45FF81A4ED8ADC9EF30DD989 + 81: D0DD650BEFD3BA63DC25102C627C921B9CBEB0B130686935B5C927CB7CCD5E3B + 82: E1149816B10A8514FB3E2CAB2C08BEE9F73CE76221701246A589BBB67302D8A9 + 83: 7DA3F441DE9054317E72B5DBF979DA01E6BCEEBB8478EAE6A22849D90292635C + 84: 1230B1FC8A7D9215EDC2D4A2DECBDD0A6E216C924278C91FC5D10E7D60192D94 + 85: 5750D716B4808F751FEBC38806BA170BF6D5199A7816BE514E3F932FBE0CB871 + 86: 6FC59B2F10FEBA954AA6820B3CA987EE81D5CC1DA3C63CE827301C569DFB39CE + 87: C7C3FE1EEBDC7B5A939326E8DDB83E8BF2B780B65678CB62F208B040ABDD35E2 + 88: 0C75C1A15CF34A314EE478F4A5CE0B8A6B36528EF7A820696C3E4246C5A15864 + 89: 216DC12A108569A3C7CDDE4AED43A6C330139DDA3CCC4A108905DB3861899050 + 90: A57BE6AE6756F28B02F59DADF7E0D7D8807F10FA15CED1AD3585521A1D995A89 + 91: 816AEF875953716CD7A581F732F53DD435DAB66D09C361D2D6592DE17755D8A8 + 92: 9A76893226693B6EA97E6A738F9D10FB3D0B43AE0E8B7D8123EA76CE97989C7E + 93: 8DAEDB9A271529DBB7DC3B607FE5EB2D3211770758DD3B0A3593D2D7954E2D5B + 94: 16DBC0AA5DD2C774F505100F733786D8A175FCBBB59C43E1FBFF3E1EAF31CB4A + 95: 8606CB899C6AEAF51B9DB0FE4924A9FD5DABC19F8826F2BC1C1D7DA14D2C2C99 + 96: 8479731AEDA57BD37EADB51A507E307F3BD95E69DBCA94F3BC21726066AD6DFD + 97: 58473A9EA82EFA3F3B3D8FC83ED8863127B33AE8DEAE6307201EDB6DDE61DE29 + 98: 9A9255D53AF116DE8BA27CE35B4C7E15640657A0FCB888C70D95431DACD8F830 + 99: 9EB05FFBA39FD8596A45493E18D2510BF3EF065C51D6E13ABE66AA57E05CFDB7 +100: 81DCC3A505EACE3F879D8F702776770F9DF50E521D1428A85DAF04F9AD2150E0 +101: E3E3C4AA3ACBBC85332AF9D564BC24165E1687F6B1ADCBFAE77A8F03C72AC28C +102: 6746C80B4EB56AEA45E64E7289BBA3EDBF45ECF8206481FF6302122984CD526A +103: 2B628E52764D7D62C0868B212357CDD12D9149822F4E9845D918A08D1AE990C0 +104: E4BFE80D58C91994613909DC4B1A12496896C004AF7B5701483DE45D2823D78E +105: EBB4BA150CEF2734345B5D641BBED03A21EAFAE933C99E009212EF04574A8530 +106: 3966EC73B154ACC697AC5CF5B24B40BDB0DB9E398836D76D4B880E3B2AF1AA27 +107: EF7E4831B3A84636518D6E4BFCE64A43DB2A5DDA9CCA2B44F39033BDC40D6243 +108: 7ABF6ACF5C8E549DDBB15AE8D8B388C1C197E698737C9785501ED1F94930B7D9 +109: 88018DED66813F0CA95DEF474C630692019967B9E36888DADD94124719B682F6 +110: 3930876B9FC7529036B008B1B8BB997522A441635A0C25EC02FB6D9026E55A97 +111: 0A4049D57E833B5695FAC93DD1FBEF3166B44B12AD11248662383AE051E15827 +112: 81DCC0678BB6A765E48C3209654FE90089CE44FF5618477E39AB286476DF052B +113: E69B3A36A4461912DC08346B11DDCB9DB796F885FD01936E662FE29297B099A4 +114: 5AC6503B0D8DA6917646E6DCC87EDC58E94245324CC204F4DD4AF01563ACD427 +115: DF6DDA21359A30BC271780971C1ABD56A6EF167E480887888E73A86D3BF605E9 +116: E8E6E47071E7B7DF2580F225CFBBEDF84CE67746626628D33097E4B7DC571107 +117: 53E40EAD62051E19CB9BA8133E3E5C1CE00DDCAD8ACF342A224360B0ACC14777 +118: 9CCD53FE80BE786AA984638462FB28AFDF122B34D78F4687EC632BB19DE2371A +119: CBD48052C48D788466A3E8118C56C97FE146E5546FAAF93E2BC3C47E45939753 +120: 256883B14E2AF44DADB28E1B34B2AC0F0F4C91C34EC9169E29036158ACAA95B9 +121: 4471B91AB42DB7C4DD8490AB95A2EE8D04E3EF5C3D6FC71AC74B2B26914D1641 +122: A5EB08038F8F1155ED86E631906FC13095F6BBA41DE5D4E795758EC8C8DF8AF1 +123: DC1DB64ED8B48A910E060A6B866374C578784E9AC49AB2774092AC71501934AC +124: 285413B2F2EE873D34319EE0BBFBB90F32DA434CC87E3DB5ED121BB398ED964B +125: 0216E0F81F750F26F1998BC3934E3E124C9945E685A60B25E8FBD9625AB6B599 +126: 38C410F5B9D4072050755B31DCA89FD5395C6785EEB3D790F320FF941C5A93BF +127: F18417B39D617AB1C18FDF91EBD0FC6D5516BB34CF39364037BCE81FA04CECB1 +128: 1FA877DE67259D19863A2A34BCC6962A2B25FCBF5CBECD7EDE8F1FA36688A796 + +Hash: blake2b-160 + 0: 3345524ABF6BBE1809449224B5972C41790B6CF2 + 1: 082AD992FB76871C33A1B9993A082952FEACA5E6 + 2: D9BA03C1E5CCF9083FCB21F7AE01D20BC0A61116 + 3: 147420788D27F83264EB55BAD410D304540A21D9 + 4: 72D1B592354DFFD34B9A33A1D9696BE6B2A76162 + 5: 6BE786CBE2439FEBEE399618309831D8CCF8E68D + 6: 508A9AF9195DB76523F32DFE0DEE2615C4EAB892 + 7: 83A00152738C9C2D0CE6980BC093C73ADDA0A707 + 8: F422108C43BAD02773C989E90A027729B0FD3B8C + 9: DCFFC21F7D90B79C7E4D72CE1CB68E9393707A0B + 10: B673B12C3BF35B84553157DDE2D64F01D53170F7 + 11: 24A88757AE5A6AFB6F09E4D4BC0C0D1F7784E693 + 12: 444C019756D384677D54F4DE70E3708EEC20BCA3 + 13: D6A974E117A3B5397082A2638586CFEE6F94DAA1 + 14: 9F2FFE2B4CE9318159CD214811E856A2EB1996C1 + 15: 9729578C9F0012170273AD01920D69F5CADECB59 + 16: 2DED4F07D5B7E830711976338C12D66087F41E34 + 17: CC6A494DBAE2D0C782B9647F5E268D20C89DA8E0 + 18: D913843A8FE13C412FE21736DA128C4F6E5149E9 + 19: 6AFF7DBB8AC24568ABD268442FD2A3210B5A6FBF + 20: 52498636C61D58BD46D8BAD4C06B572BD08FF983 + 21: B91DF3153932F20DAC48D405689DDF5A3C379559 + 22: 3F6DCE460E8AE23C222EEA45BFEC0FA65E3D118F + 23: 75B340DE05638C190C1345F1823A12DC019F439A + 24: 8CEADFCD30B82A4686621E570F3A97025246C411 + 25: 362412D1AED48F91084715F30787107902601FD2 + 26: A09C9A7A20AE73A689FEBAB171C585AB0549F807 + 27: 9D33DDDEB1A31DF8C33C4F4BE8A3DD7EB99611EF + 28: 30F738CABC5598A35655D7E727AB009BB546B84A + 29: 318919F5F5CC9DB7E15C67D1BAA1FA660BFF2AE6 + 30: 0F2A40B3D3C8E9C6825218FDECEE51B65FE1F261 + 31: C9F4187E8EDBB4CD82ABE892BB0353C4DCA32390 + 32: B1B133B99F516E6C82CEDA892EF5AF50FA4B4E71 + 33: FEFF72EB10133687CC4BA345A409491346E4DDB4 + 34: AB2EBD942C73370C568A092CDD52441FD7427065 + 35: AF56FEBC670729FC0B945B30EC5FD4054D433B1E + 36: E0608B977EAA078A4ABD485A802AF1C52F44754A + 37: 6100835CA6FC89D1890A65CC01C322D195B23CF2 + 38: 25824CA722292042AA1182186BFA9863EAE3D1F4 + 39: 63445DA5519800A2CFBA55FF6C365BE2A9899618 + 40: 6BC0EEA6FD440873D7AC2A6A6D3F3651BDFBEADF + 41: EEE860BF14DF86BA903E1F62146F891820FF2CB4 + 42: F443B28F036AF2B79A2187912156129DBE28B943 + 43: C6A3BB461788D74D06EC8C58BFE9D3DDC5178BE3 + 44: EFC5B57327FCEFB5AE21FF75F65101D1ABAC09D9 + 45: 623AA14E42E6F3B8C4CEA1E5E1A49BD668F27BB6 + 46: 42098F0935B568DECD5E172321504A06820BA543 + 47: 96EA35D6AD0C91C65752562CC523E0F66E6E6DA9 + 48: 9B3BF9CDFF4CC55957AC4FB77F5BBA5CC94E4BBA + 49: 500F61E1F6BD816ECFE76B0A499FAB1A945BFDC7 + 50: 2338D3A37BAB81B165FB9B0D96774366AC1A5518 + 51: EACF1749527B99280B7A3108A8B9B79E58421F68 + 52: E80BBA9842ADAEAABB298CAA14435EBAE9F5B0A1 + 53: B1F5257EFDEE106309CE66B6F59F4C138C7B73B5 + 54: E61F350020AA8E4A83D2AC0635ABA5666B75BFFE + 55: 716A0F2CF96F308233E6C68150A1AB2A661C3DA7 + 56: E640F12A22189A12AC432BC56B24B1E4EDB0FF80 + 57: 32FC87D32E3CFC5CFF05144634DC78F8F02687A1 + 58: 137421D9E5BD9B351ABC465D61A22B2815D9F259 + 59: 045A2FD55DF2CCCA08CACDC0003FE1A026AECDAA + 60: 36DBCF4C47E0257A5A7DE43422CD55644EC22F39 + 61: EAF8D4A6B16B0DD1AC6279FEDC2B49FE742974A5 + 62: 4BA44618105A50075E3ECCF9535A1A7E758626F9 + 63: 1CB62C8F6CC806DCD161F08C81E704AE32AD5B3A + 64: 11CC6661E922B0E407E0A57249C38D4FF76D8EC8 + 65: 7E8D79A50A0FBD8BFA2C605E5AB883DB8B4EA2C6 + 66: 556938179EC873CB5F36B2F415C05EE14E3AF19C + 67: 214F921517DDE6F4E7613C99BABA4F2A7B7E086D + 68: 46685E91EB0402558744A0C9EB9F1E9B2C09E835 + 69: 976CF4208EF2432FD746EA12CC6CDFA2AD8C400E + 70: B414D0C48CE5A10DCFFEA9E625E0B4D890350145 + 71: C863CCDB88168D400BD01FAEE59BDEB3B1100ECD + 72: BCBBBB50F8D8495C0A76974C593611EF11118B76 + 73: 5D55F85EA7290C9AFEC642BBD8CDB087D96235E8 + 74: 7CE4700EABB3554168F3442D53DFAA87273A75BF + 75: 9F2CAA037876C0714A3C4F0EE93638266215B74F + 76: 326D352FD19B1E1D6EDFFC370BCCAA5B65265583 + 77: 17784225DEA6523A218939BB2C7FD800E8F901FA + 78: 64202454E538279B21CEA0F5A7688BE656F8F484 + 79: F434B89C355F32288849E69C831C43A1D1A973BC + 80: 892EF8517F0623D92778F0B85B7656F42EBDC8EB + 81: B4C72E5BCB122487DE719986D2A64D165FA2ED5A + 82: 625F82C023CF34C8E387322F254592A79A6ECCDA + 83: DF802769136C3A61B5F52602D6C9B73752716C97 + 84: 910FB3FBB922399F9C62E56ECA482D99E5795454 + 85: 0FBF8429F92927FEE97DC2BA4EAB76BEB862CFE8 + 86: D5E38C9B12ED4A35DCA2990B8D47180AD449BBB0 + 87: 2D9606C1F5981F54F1D6C2ADB5A809052805F550 + 88: C5B9110BFB2DA0CE0A55BA3F2BE0AAAB233C5A14 + 89: EAF391F4C3BF6F37F67CFA86CB3284196778F18D + 90: 3EA61BBE4F6BBD04DA75F18F5BFAB2C9CAF41611 + 91: C65BE6423EB531EAFF051098FF974168DEFFB39A + 92: 6E01FD16DDA5A7A2379FCD63778F55A8629B42CB + 93: 51A8BA40AB41BA72EE4B29B47BBCFB36868C9813 + 94: C495CE12562AAC6B126A8A131705C272D4969864 + 95: 08C93C1D82DE592963BABF7E3B8BF68CAD21C286 + 96: 732B3B39A2D7D9C69FCDCF4A9DA9D1CB4277EC3B + 97: EB7BF339D86B6F1E1ECB0D2CC3F1075DD1FEFB80 + 98: 36974AA1E83255AC9171AEA642351742005D7654 + 99: 60D55DCD8E9DC4159D840E57601D1AB937EE04BC +100: 54709EB6472DE7CAF362B93FBAB834A7A609F2A2 +101: A1BDE91C5A50CE658D9B812CCC7550BDECE3CD63 +102: 6001F23118F26AD0A177546BF788B917C81996B5 +103: 5B9147BDDF6072345DF9C1A2C1BA138F28C079C4 +104: 816C7C3ECEA245AD5FF19F59F27FBE346A54B469 +105: FA44AA7F1670D3B4158BA23C4CCF0651512406BF +106: F4337F09A0ECC6F79B837EC512AFCC2A9DF79B49 +107: 41D0368270C0346A974784BE3DF07DF66EC11D85 +108: 6E59AB52A972C60FE6CFD20615D9CB9517503C00 +109: 721D857AC832372BC36D6B38929538E2661D51B2 +110: 84DC2CD71FD10A4FC5FCAFD521E5496A157BF870 +111: 139105BC993171DE9FFF828B5E8A3FFD15297DF6 +112: 866CF68F16E920CCCC4770602C4F4952AFA6A238 +113: CB740B92FD7A86874A2E31DEA72210A41143C1D0 +114: 0F21249127C64FB12E327C57CE6C36B337298AEF +115: C4C939B4C886EB83DCBCB2EA59100143A094888B +116: 8D8B95E3506414341DC90BC7F24678373B4489B5 +117: 2B8EBA1D0B9400A865378AF46E9D9E088C21CB6F +118: 35E0E3246C15E153C12F7F0F2CC7EB54B836B193 +119: 9DE8DE7278578E387580FBF2547FC7EA34096A36 +120: C1D62B446D90A6F6AB19862E37B9BA2BB36545E8 +121: 98DE812D22A091F511537A32765F6413D4D9AD7E +122: E324F1547791E8B833E68C8C54F0407B54978275 +123: 63F4926B58D517D676813076F8ACB722CD7A01E3 +124: 872CFA83AA4A9A8E6868CD68897DB04970F8E215 +125: D5A0E33125F65896D1E02F94F6E7B2249AFBD7D5 +126: A5EE27706E706856298547F5DDC5C84FB4B998FF +127: 535975C8D8C5DD9ED14A9204757B06783DD7B1FB +128: E6992372AB022447B34F6D6032FBAB707A11ADEF +129: A7BF25F1599102AB631E3052E8303A2C097D1A7E +130: 44C843A35F07FBACB9F7819CD11CAD0359A7A6B4 +131: 86859704A90DBD20F8C6365353292BE6AEF4675A +132: 7E42D899823F55C07620599AE2EA9F61D200DAFC +133: 16F26BBC5A68AA21F97E1E847A7D8500122FDEFF +134: 982C6A68E68D5A692A4EC82B4C318887FE85FF6E +135: F036FC6B3A9D6DA82B52ECF4DE3D82BC8E38D075 +136: BE941DE2A77DAE6763E6143DD3689DBF18831E9E +137: FAEE2E5227EF4A6EA64446F1C2B5220B815981C2 +138: C667456AE916041AEEA1A358516A8C781AA6D17F +139: 43103A30BF5B2AAD39AA6864B4DC255CD4716418 +140: 9EDF855E4E411589D5C6BA1FC5D1C6AEC709E664 +141: 11E94407FBB164313ADF4DC5DA6CCF382A72C6D5 +142: 9B0ECAAF97D7724A49A70958F52EF78EFB07F1AB +143: 0D72CF6D0351BAE24D684238CF2F35EB78891828 +144: DAEB6FC65CC55220F2856E859B18E34B1AEECF8C +145: 8FCB3B9085D5FE4C3311D7B8251DE553C58F25BA +146: 37F740BC58504E705B9BA7D817963000EAE6786C +147: C69222050BA9A1DD7BA144A4B2A4385D0DCF0E8E +148: C9A7364BF1F15951585EA8E18A7DC7F34E7CF807 +149: FC6D567415981FC5D4198D899794313065A92551 +150: 6CAE5BCA89D61886E992C41E8BD2F8FF7E20BFEA +151: 806A1FDB3213323C1BB6F71EF59EB24A8E5C51BF +152: E672AFA75F19AF93124EEFEEBDD1BA7C6F3C4145 +153: 32AF925E77B58DD3BD0B5EB7F1A01584ABA6C5F7 +154: 8F2454474E0168717AC71327A5D478C4A629D7BA +155: 690C8FE73AF60FA9EFB53EA7DF43BE8FE07459E6 +156: F6D81BE22841D8CA69662342AE1D4A9A7F6F2277 +157: BC37FF42B2636850455A360F54E8658FFC6CAF1B +158: 7E6652237F861B6163B488D7FBFD0BC62A103582 +159: 94E6827AF3EE1E51C1F0B9F1A5235FB8FB70E96A +160: 52305B52403FD43054EA48937FFFA73BD2645E85 +161: 6E76DD51661F45C77A23C1C779D461AAB7A7C22F +162: 61849C549D3D38DBA2BF7E98C412F9C9ACD513B1 +163: 39813928E21F4DAF72E3285544A318ECF98D813C +164: 9C94A2F324147F03ADA5EACBFB802644D7EDFA65 +165: 8A2C08E547BF37BAA4AF6B6A30922979DDBB9766 +166: A8A876D38284AB64396DE23F1237FD34C2FD4A63 +167: 078C9EF520D26927309642117136DE00CB00992A +168: C44F0EF88C20FDB32AAFA6B0294A2CCCEAF8612B +169: 064DE4C0318AA79BC00F9CB22BD6A2E7DA535B9C +170: 8931F72588D1E6614832236EADC2997A5691EFAF +171: E9902550836A48950BDF5A63E37F117FD45B3C32 +172: 96D97FC0F694249A747FE88C9439FF26BC0CB83F +173: 2E204242469BF511FEE24C5B8A5B052C9857ABD2 +174: 96F4755AE3CC7D6387368E9367B1E174475F5ED9 +175: 26DCE87C191AFD557869175DDDF850B4035016E7 +176: A0D9CE9E4D5B55C45AFDFFC703A031BE9BB29ACF +177: 09BDF1C2FFE11FFE1D4E03FE5D808FE874743279 +178: ABBAEF9016CCC804A4FCD0DFFE1025793185F864 +179: E6B721A78CB4B9E25D100738D8202C317C73CC15 +180: 5B0E055B51EEB39B67B45E1A3E2B1475DBD22729 +181: F5CF64788C5FFDC9AEB83AFE55E1C470DFA601C6 +182: CB06E8743280ACAF9E55AD5541AACDFE3EB1BFA3 +183: CCCAFB4941602D4790A0A6ECCE6D0069F02030A8 +184: E36A5D027AB9E9DB157EFCFBCC8F17712245CFDA +185: E416E2CE9DD29D2188F03E4B2073E9DADE25D215 +186: F6235F265CC28B1BED62469D316A6109C133FE5E +187: FC70536DE716C655ED333451B9C5416F4EED07C7 +188: 69AFF1A75E074106762CAFA28EBD52B6B5D90A49 +189: 9C48186EAC0FADDE94185045875702B7C9478AC8 +190: 12644FFE3C39EC3C9CCA3A661A13A1D7CBD34F9D +191: 6CE8BBCACC200E7A78843D479ED931D4BE1622E9 +192: 3807D7BA0B12F14510C36CD3DC867BEA4A24C5F3 +193: CC621CB0A8A4573C5330EC70C455270265E3CFD4 +194: 464AB86E899FCB9FB7101BF97448AFDA4C9919AE +195: 11E7B2A04E3C271068D6F15C7FE87D06D990D3D7 +196: 5EE7F04DF2B361C5328D191CFC037C1259DD2B1A +197: E3CBFFA5DACC1BCE117ADC4CCE95D15D9E0329E2 +198: 9D3D4521501FDB4B6007EFD7885164EE8872A579 +199: 3CBC27AFC4872BF7BC98CD354E7AD8996F947168 +200: B83A5733CE63F2DD8266EA8EC93333D7935142CF +201: 7E7E2058A18ABEDC54DC4EF8B9CD797FF95E6DCC +202: E6E0046460CFB3B1DA4CB9A19B6BB5F31F978E28 +203: 8EE11462985FE95EB711F7D941C816DDED7C95C6 +204: 5132D140BF66D8BCBC58B1DC34A972575DDB51AE +205: 3EB18CF69D5435CAA7BA4C7FD7EC3555E9B3E725 +206: B42B17372AC5B3036D8E067E693F73E935BD9D45 +207: 5DEE6C27BE536C94B2A9E9228F6AAA4C781C5588 +208: CEB13F3FA99D2D9892B0F704422318B77BBC5F85 +209: CD5053DFA04346625229D8CCC398E032D0D0628A +210: 2D824961BBA32C43FD507787BB0CF0FB55CE4D19 +211: BC2A382DE0B9C4A315428954F09B77ECA75DAA48 +212: 173FC391D4955EA415E52B3D0399CCE2D719F764 +213: 8B528FF527889A99E4B0A591324E62A2F3118214 +214: 5B715BAE5A69DA3FB9A83163BFB947606936F73A +215: 89D83102EBDCAAEF3543EA3834851DB22029C09D +216: EC8802D14CFA38FE98FE63E6B3F1BDB3E7D21553 +217: 936644C0577DC88B2859B6171A0FF1C0CAA69F09 +218: 52E58F4975ADF680F4EA8FF6035EFCD8B5872D22 +219: AE824F652DB88351BCE104D0F3B8078897D82D5D +220: EE6001EFC8EBEE26639414C4D89D50DCEFDC8D94 +221: D0AC69294328955D4A656E8A1948519225ECA936 +222: 5CA8C4943132208E1A4917C14916A9C7DB14146C +223: D5DA697B560D31914A52E540D46AB971B7AEB81C +224: 7965F11D207997CF686AB4C480AA510BC53F1CB7 +225: DEBCB67C707B013472844E54B19F0FE2599CE0C2 +226: D4D2813A7A8361D0FF6984C1A2D2714B5DC13C7D +227: A5F5DB114ACBDA81E269B5BCCA6FA1CDAF60A636 +228: 75E5F2A2E56586AD611D86D619FF01CC1DBEA46E +229: 5AA68D13040B18872E8E96DF8DC779C9C88BC8D8 +230: B0A2F03F4DE93A00C520658B58BC41233109DF52 +231: 6F386F4D127D2FA1F2F4A8ED3E8A41509DF84CA1 +232: 8A9B7BA28D741469F2AC8B4AA8580991BBC5BBE3 +233: 608B8724F4A5024DC2CFF7A9A52F455B45CA5679 +234: 664C7DCAB4DC789844F04DB2CACAA1868E59B8B1 +235: FA506330D1337AA6FF8FF0BA22FCE87CD6389253 +236: 03DF08E3C2DA86552577A64FBC8E8497B77D9784 +237: 27C35B1CEB3F40EA76230702E78A52E7C7F34EA1 +238: 9DD6A68BEDB58B9E88B89638E98543FF118836A5 +239: 86347CD4FE48B0E6059E8A6A0EC8DED0A9AF85B4 +240: 1EA41C7B2FA4D908F5337D1FA5E1E8CB3B21C8BA +241: D57129319BD0C4F30221A64305512FFB239A7AB2 +242: A9343153196BA3E98E639EECF62D5795613E50B9 +243: 11F7D62D79F0C06A6D016F36B15173D6A1C25F19 +244: 98774533C0C6CDFE0CA3147BB624D65F2A61107D +245: 873D52BEA652DDC833F271295511BFB164912BFF +246: E6039C14618A04E095F517A38BAF1C205F7ED2E5 +247: 3642188C11E50C54AF7F975322631EE43AFAE0B2 +248: 9C8B66B38DB900EFF221D1848E3104D134D85476 +249: 2DA1BFF1134CC8B6A690B1070F7B159940550470 +250: 4513CC83DC564FC1174B83DEB513BF5DF045560D +251: 65AFDA952D796653E1674F877D44AC22C3A0E10A +252: C49BE08EB9F989F69F05152EDD2AFC2CDDF3DEA3 +253: B1A310B7CE162B481B9A275CBA17A7B57E8B6672 +254: 4B8F017B6C1AAB7BA3466B2C6EE28DEE9DC3978F +255: DB5A3CE0593548C3931B518DA2F02C0550694841 +256: 2433AF65183F411941345962733A8860DF650139 + +Hash: blake2b-256 + 0: 0E5751C026E543B2E8AB2EB06099DAA1D1E5DF47778F7787FAAB45CDF12FE3A8 + 1: 03170A2E7597B7B7E3D84C05391D139A62B157E78786D8C082F29DCF4C111314 + 2: 01CF79DA4945C370C68B265EF70641AAA65EAA8F5953E3900D97724C2C5AA095 + 3: 3D8C3D594928271F44AAD7A04B177154806867BCF918E1549C0BC16F9DA2B09B + 4: E1EAE5A8ADAE652EC9AF9677346A9D60ECED61E3A0A69BFACF518DB31F86E36B + 5: 663694AC6520BDCE7CAAB1CF3929FFE78CB2FEA67A3DFC8559753A9F512A0C85 + 6: 274327D0E2A207844988FAC0B39E071422E3F621913D69A5CFEF23B38601A56F + 7: 9DF14B7248764A869197C35E392D2A6D6FDC5B79D597297920FD3F1491B442D2 + 8: 77065D25B622A8251094D869EDF6B4E9BA0708A8DB1F239CB68E4EEB45851621 + 9: 8660231B62CE1D61FC8BE93BD6ACDB43FF61A7AB4CC9494F0CC803362360B07B + 10: 8B57A796A5D07CB04CC1614DFC2ACB3F73EDC712D7F433619CA3BBE66BB15F49 + 11: CC932BEE351BE391849C87925F2E00A83051419DC310B288D4304D4ADEA3D0E0 + 12: 99BD72C73BEA193F7040AC279BD656CDEC7FD35E097A657B6C03B4FA967223ED + 13: 695E93B723E0A08E8DD8DD4656389363519564DAF4CDE5FE95A6A0CA71D3705E + 14: 4CCE7128E4F659BA41EE163C45280D468163ADC8C76C4937A0BBFA0CF3BDEAE7 + 15: 929CEC40E9E746E771C6AD05CFCF37641254EF5E802FA71A02F8982F525F2B00 + 16: C7CB5D1A1A214F1D833A21FE6C7B2420E417C2F220784CBE90072975131BC367 + 17: CED0CD609F3C8FF85B9CEC93BBA556DBE3CAA996AC5BEB629D4512473D6B31AE + 18: 584C9CB4DA3BE635D86E803C9EEBCCFD27FBED4AAE27B0207CE3C934A0043AA4 + 19: 9B508680D1F75D5F1E5306FBFAF7E88621CEBF39F7F5CBF9E2DBB7EBB88504D4 + 20: 5D597F201EAD11DAA0687185C579EFD702E288D5BD72B6B21238A4ECB52D288A + 21: 85B8AFD95165D04681AB948F2F0545C47A8D11D9D1866CB7ECC88BC31A634891 + 22: 93C541C87FB52D506B1B262E49ED71689A15B745E8F3E003893C8C59CFC669FE + 23: 395D6A5E3B41B6151411B9B22F07FCBAE6C7C30DF59C10CA2DFCFE333AC8E3FB + 24: 8D71AEB3137041D31ED42466EA5FDCA2EC7A35C7701D142CCB813F8C614CECA2 + 25: 3B0B9B4027203DAEB62F4FF868AC6CDD78A5CBBF7664725421A613794702F4F4 + 26: 7384C8812F6803D8649BED21A3ACBBF36239BBD17274D249369DD65E6329FD84 + 27: 3890962F7D604FE0FCADE7D8FC03C7E6285DA2035BAC5A9362C1D68A353D5350 + 28: 9DC0B41D6A6A6C194D04336EB383AC7F4EA537700D5926346DFB1379E9453460 + 29: BD78E1C368D70B968E194DCA2C6FBDA605A67D5E52824289E058C93EEE073EF5 + 30: 4CC3E428D63DC132471D3135D406F8D6E30D2480D571BFFBD64957BBB090F582 + 31: 9ADF65B53153B1CAEC84CD717E00E01C2000D0569704CE38D065180ADEE5D964 + 32: CB2F5160FC1F7E05A55EF49D340B48DA2E5A78099D53393351CD579DD42503D6 + 33: B7634FE13C7ACA3914EE896E22CFABC9DA5B4F13E72A2CCBECB6D44BBDA95BCC + 34: 9BADDDEBF24552CB1F66D32990476594E5249A729254F7B5C840728A42749A45 + 35: 13891B823D3A2CFE0D1A5E60FE89D8C091524F994CDC3241C4DA19C4BB3C2C6B + 36: C1B7EB8D130D705C5FA9EE8061076A3151F2E36E42D9C9289D85065B9AB343DD + 37: EE6A288C4FCAE34572FC6DBA3E0B7D698BEF65DCC63BF28EBD74207A2065718A + 38: 1B5AD5F31E4061F423EE11E3DE88FEF05DFED9393C268FD360D05FE4465FE40A + 39: 87C40636D0EE94687FDF020E3D165F4E45F21D62FA04AA2B9103A8187DA6E64A + 40: 70A3082DFC7582B9D252939A474338DB1F94A6DCC7724709377797D17FF51AC5 + 41: 109036D1DECE657AC6471F7F7ED33846986FDCB9DAE8A73EA0881607E5E45F13 + 42: DEDA4F3E98E58392ADAEE3C2E7B91D172551C50945A8AE9E9E1AD10C2AE510A8 + 43: 2A82CABBBB09956D212D182CFAF7CDE2F55FA33F96E3A1AB19FCCFDB668CE2F2 + 44: 4A21B38C69F755C016EBB4A66EB76B4F9D4087A02FC8C3C257C1183EFEBDA824 + 45: D3ECAA4853A092755C3692CAC3FEA5D9CCFACA2D32B59CCAE151705333359E79 + 46: 0AB5250248686AFE6ECA3F3ED89E061C0B3AE2A13454B907BBDB643A72B25A66 + 47: 2FB57AB5FC0927E8301B6933325530E90FA7A94EAEA95BAD7C3F2F1052032900 + 48: 48DE881E6C1DC35253D9C8D56E773743640F097BB7274B80EC090F1B33D1DC2E + 49: 71745158A70425E25A8446122DDA82FCFEB6BFCB593B25D79C539C6B989C526D + 50: 45D3D95F04F304BE5A61EF38357BD01E61F9BB7F8C9979458D846D9899436167 + 51: D5AFEBAD633B7D595E6C8482D8C9A429091F58ACBD84725ADBAC12E8BE80ADA9 + 52: 06BBB3B17EA95E7E00AC21B8632F84615F11456FABCDA9D99CBF079E3134CFE5 + 53: 02B8E881B5F78B451995F07116AF3549066CBCE498497F546A9772981779D908 + 54: 370C5EFE99822C30460A123467E8F151F012065BA3639BC0407ED3B3609E5D56 + 55: ACE7DB9E8F298E823B7B265BBCD004577E0029256C48684B2D7A7CDFCBFF5E47 + 56: A6C1D35F74218E57B4DBD4ED467B41981208666738FFA0D9DC53D3DE96BE702A + 57: 25E44457F063AE4EA799502C38D66EEEFB46F520B4FC9A298DF9826C9D62EEA9 + 58: 1B35B64CF659D6D7D0CA933C9A52FB0E67FBA76A304FADB7C47DD8FF6B6FF0FA + 59: A72DE68FF63BBE9CCFACCFA6859AF660BB413F9E5D0200106100919C10301EF8 + 60: CFE37AB9C02BF84AFA7A734A10317150479B791A27EFC374DD669F4EF67A801D + 61: A55A2C06F3DB74C95B33D1E962DA18772C3601EB13FE0B86A78667B2B9F9DF86 + 62: 1B8A9195724AC01AD7DA4A76C2545D2F3DC223A0242537050D7395F588748079 + 63: 29E41A64FBDD2FD27612228623C0702222BF367451E7324287F181CB3DCF7237 + 64: 10D8E6D534B00939843FE9DCC4DAE48CDF008F6B8B2B82B156F5404D874887F5 + 65: 84C04AB082C8AE24206561F77397704B627892089A05887A2A1996472BCFE15D + 66: 2B684BABA4A7245E38C3263D85B5524A51BAA8CA18444AF1B5958596BC30D424 + 67: 1D59FA9501213440975A0B27E4B52EEA7274F8794EC35B8EE4824F7B00897ED7 + 68: 60669608711B9DF3715B631B474D5206179A81D054EF5494612899728B55E103 + 69: 46060CB9DC6BE177BAFE5425C4F84F9143B71CFC75DD958E15FF7A26CC92859B + 70: E7F909C8E018BC36B59A8E7848D16C05D6BDB0EBB91FB9BAF54CC328192CC362 + 71: 7A9F75439C68869A6595EB63C61DB2BC213D3EF067EC0CB3F25E02E554FCE2A9 + 72: ADB39B3E53A791DFD32ECA83191EB82FDEF4321AC504539B257C3376DA240ACA + 73: 240CA19B3671DCC5EF174331FB0DD24B845DFCD01B0FBE52FA72A29BCAEF1373 + 74: EBAE0805FD52D3E9F5F29AEB33B6BE8CAB0F28E668990D3CB95444D9EF90B932 + 75: EA7C3C052928F0FA3B8D86B19C87DEE905E8A4B26A0A23B3C8E8DC7255EA82D6 + 76: 4AD32C1F2D18C8B7DC29D1526D7C751B89B86882FB12AA3CC9C6EDDB7991D266 + 77: C61F81C3E6B899D0501B05DF1DE32099A7B0E878689DC2A3FD5583DE90A74164 + 78: 068A8A0B96076A2773A8E00E00E57EEF4FB26886B521285A6C747130850792D7 + 79: EFAB0151162523B18147CBA89679BDAB2D9B670F5AE222A34C360C094AF1D441 + 80: 066DE1009DACA2B8390A9DC734BCE547AC4E3CC4531645BB8B9CBC0070941D88 + 81: 9FBB33B95E79C5C1683AB09A6ABFF6612FFFB4458543DC8BBC7723A6DC2BF2ED + 82: 88FEA89237618CFC0270CBCD08E7FFDAA8933607C0DBCCB8DD075B84FBA83B11 + 83: B1960BEAA4FED01453679C7D6CF78D25442BDF92AE51BE479DAB18E1B2B922D3 + 84: A7D6821A97BC57CF6B5E25953C689439BEDA79364C903A3E64B6671DC9ECEB2F + 85: 90CA93ECD3E0E7C839E4FC0F2E4748954A89B2C7338E55FC18A53CCD08ABED2E + 86: 58FE5F45B9915A5B177F4256B51CE5781662352A2DD620A946B8755213FBD61F + 87: D109C8EC77E2253B5E7C761F59B184815E46B06CC5132A92511A93DEAD6315C2 + 88: FD9664ECB814785C8474188706E6AB0952925F9B9D8E351665CED12E84D92FAD + 89: 81342700C48F41EC5B54180D560E73E5AD6782717B2D3320B42280BE11F0873E + 90: 523CF9A356076FE8C3538BDD752BC43712C7D28F29499AAAE7812F1E4167840E + 91: 9706D70E28A9E99DB15974B1C01635868A62C6567EB40903ADAE58D417B882F2 + 92: 2216F01255FF24422E18D906C64506924940451E09D4EC17E4DBC8EA6D14EF59 + 93: 64AD22E77FC9F8A03AD6E06A067ADD9F0E0360D4533014FA286CCDF40DCEB231 + 94: 9908418A2BB564AB9607D2F863B841DD4FE47EE370DDE05A9368E400F7F9904B + 95: 981A7989084E74F6D5FD8870321E860991729EED88E60D85AB5FDAA769BE6FD2 + 96: 6528EA458EFD23391E968E0DD3A40202AC94E3854D1A4642CBBE0D13A15CB849 + 97: 767FDCD43CF16CBF980FD560DFC55F67BE20510F9A0C8FCD5C749DA8EF23FD7B + 98: 90AFC4E366BCEE748591D93BA9F7C2E05A1FDA261B58D094F8F0450C8A31FFB8 + 99: 660F9F5D430BF89F5946FD4649AD41F806937641C808A80DA70660F53179A941 +100: 5AC86383DEC1DB602FDBC2C978C3FE1BF4328FEA1E1B495B68BE2C3B67BA033B +101: 7C15CDF3705457EB6B8EDD79FB75BF568692CCB778F85FA2E1D462F48EE55C4F +102: A8DF989766FC245EDBB4B7268AFB7380E4EA3F7123802B72AE2ADB938211C9F9 +103: 707AA875C6162027AC2829894C0BE750F5EE8FE8A64465080025F708DC200F0E +104: 6EFD41538FEC50459B6C2583ADE5754C86617580EEF3071D38723AAF743F93C7 +105: 5C22D6A56A4FBDB85AA70994B4E118224BB6DB2AFD017A98C2B992CE26EA8925 +106: A4A9739A1C83135BAB3334990B470164ED81F633D7FE79722B3AC6E65DADD38E +107: F1AC1AD3348EA6C949FDE09CBEE706EA0AECF3A93FC51A8A7E2BDB8CD7400B01 +108: 492D9EAE92F27ECCE118D3FD8DF63158CF709ED5069502263B8BE1C105196EA3 +109: 8691C32810F3220C0DF76816AF0A73B3FADE2594CBCC711B855E2CD81DBDEC95 +110: CAB341F7059D974CBC620BC423B02F58B5E1A899F416B0858AE1A736D4681162 +111: E08B3D16F0A3B663F319DA999DB897488D1677048A38FA7B4F1F783E4F1974E6 +112: D5587E0B33166A320DD69417ADB01CB1129AFF5506A2F655574CF2E264636BDB +113: 5A69194C22AF2B7040A8488738F96C901AE215965D611A572932464261539FC8 +114: D8E7D58CD37ACAD505940843A8BB046971C43E4D0593C6BB946B07926644F78F +115: 46B07CC026B633E6245661813D5ACA2BCC295D0B8AB01F27F517B4F2823D0B3E +116: FC169B3E5480E72057D828702F9DA4F08D141A178EB8ADEF03CA0708C1A10DF7 +117: AE3E241C1C394190FBAC7FCCB3DF0D0BC317C6E1A15993330E9B648C80264066 +118: F430AEEF864823D8C8B448F2D25452EA3ED7ABE2966ADC8C42636B69D0A1BAD9 +119: B0D6518AFA4E3590746AA5FD1E58F7EC06A347981177737AD6631B22C53B6617 +120: 16684DDD272DFC18DD40C16A7F57CECCA70DF0A96C4A066B97646953E7C7691A +121: E8208DE0982F3D8E9AC258EB26EB3F130CED7331797B625D6B65BA4BA2064C9C +122: 8ECD4BDC226FB29DD486CD77B566723E44C77194BA7A000734736DBB76F61C7C +123: 153D5C1D5EDB08F51F6353B6B7BDD48A9BBA14068923B8991BE59346A4F932F7 +124: 60E555A694396B48273D2D778709C208C0757CD15697A43CF0C2115599C80E68 +125: 7A4A15B47029005972A6B814D5E7F2C86C616BD98E6A06BD95CBED2F47400C67 +126: 3DE5ADB8E3BF8DFABB41AFE53C58FAD23427A148755148011B5C12B88ABA3DC0 +127: F2FE67FF342E21B8F45E8F2E0BCD1D9243245D50EE6C78042E9C491388791C72 +128: C3582F71EBB2BE66FA5DD750F80BAAE97554F3B015663C8BE377CFCB2488C1D1 +129: F7F3C46BA2564FF4C4C162DA1F5B605F9F1C4AA6A20652A9F9A337C1A2F5B9C9 +130: D3B11B4CBE513EC7B6F4BB5FF0C411DE405A8641CF221493447A35927CA3AEA7 +131: 62323574C7CDAACA448FCBC7091AE4AF3E04DECB0D3C7C55636BAA0A99C88699 +132: 89B7D0203387E0332622CA84A879BDDBCFF155A213997560FC05428E79E06891 +133: BE5CCE3E365FBBB139F68A3DA3367E42AA8BD79B15F5252F7C08C3C8F0DCAB27 +134: 7AE7702BC025692F2EA5AB0C2EB6552C7975A57C5ACB93FF115D303F341A579C +135: F7C4EFACC0A4CB5836F170EA0BF5DC5CE36FE2D88E76A9F259EAAB71AEF0FF13 +136: 6A35D3DADC62DFE7819519F92181B2F8D38F5E0ED3D51A22CF8A133AB628D6F4 +137: BACECC2948C41BEB73C815CA7CEE6C7DBF2E4219190936EDAC5E4680500DD4D2 +138: 2DCE89F76F4F37472AE6374B0825A9CD61619A995C7F49733F62B606A7CE905A +139: 7B65E63A0D17D68C798B5D5631F17C35FAFF70DBE90006589CA89277DBEEAFC0 +140: 9477E374453099D2F8679E1D9B167B5F1C4E3CC66F32BDD9A3748A10876A27B3 +141: 448437ADAD41878E6529FCC2FAD9BBDB13697B6CBB2669FC8150D3AA7E0418B8 +142: CE4936743020825F508CA72C8355C88224A52C348A21567E65526FF8F82632FD +143: 556A195BF23CBA5C3193FBBE472F1CD5478EA4CAD2DC6D6A193102A2ABD0FAC4 +144: E15DC6238E2E58E9EA212B0D7ABFD700DA3AE5120D4D601341CE9E424A7C5828 +145: A22022450276C5018D51CD321E0E195A0ADD003E33ECAA97028D6974B5712187 +146: 044CABB79E57DA22B772249C332BFB43C5D1C9B683D1B2D2B75F4C5E6773A216 +147: 766E1167593896BDC8793FB7CCDB1D35DC430AAEAFE1E7A96ABA870416587E7E +148: E19D72CA8438477DB71E1BFA48924C4E75EE4F84C7AA9B0911521C60A2BA6440 +149: 512EE7AA89497A761F0798C29A1DD37D1D86F1C0870519A0AAB69D265DF118C0 +150: 80C199310A2AB7AF6A808F6D68843136C30E9228A766618632D4E1210EDF365C +151: 43FDFFD19C692B6EF87C103CAD9B80FB86919E6ECDCB73364D260DA29A5F28D3 +152: 1D1DC1909A6A8E552A0F8964601102D0EDC89F5A02D3ACCED71826BBC5CA37AF +153: FA77DAC317E8C531246E14265ED42A87ADE6FC3CE351652E6AD9290F8A157617 +154: 5BBC0F8B1A52732ED548E600865AE53360F0642A5674ECC7C6185F2CDEEB6601 +155: 89C5FCBAF3A61D6FA4FA33C3ECA8761EBAB3C3467ABA7D255394A0E70811EF3F +156: 9B3ECEC85FA5BA5E0F1542085FFF46BB2262163979879C9565294B2C56842A28 +157: 4E301B852D473B5D12271209BDC350B4EC615C99CB07BDC2B379F86679B465BB +158: B306FBBB65EEDBD07AEA67A6490DB9158A768D8223772D9414B124FE184098BA +159: DE9FC91112BA62A5B732D4B708D6CC27A4B77D88E8F9C50DB361C6F27295B46C +160: F3AAC26DC5197EA8DC068D6BFC9E3EE2217D908DF5115FD236BA31828637AB7A +161: 3A0126EC4DB7BD8C0C44E5197A84465C9C97C45F9D1FB8AB256EB5681DC25000 +162: 7B6B55E2623A8EB6D70FA0913012E3DB03CEA4A6DDC0F5B875673A225F95D86E +163: BE3ED738F221B53726D8A54AB7171189D77700BCA86A2C614F5FEFBCA37EB5B0 +164: C90BCB90AEA0AB6A2331ECC17F4E68507B544910F3561D20A41916D8ABB421DB +165: 72F18A50776C9EFBBB1D360342235BF28AB259648DBC08480390333314E02672 +166: 2F1C635728444B5189540CF99D92A77057AED5A8C6FD7DEADBBF9D86815CF5F9 +167: C372E87D3540FB30E7316AF85B65378384DE4664A04E51B30ADA778E3A226D85 +168: D244F4CE129EF1C84EB40D30DA099A2D65682E025E132B94F630FA3FDBDA05AF +169: 930A3E1F69EF7BCF3B9A81C1FEB9758F60F9086B331FC170E6FA20B2A5738540 +170: 84C3E0415A9D4DA972A4FD9EE82D63B00099A2620889BC274ECB8606912CF92F +171: 6D0D4CDE9886218E9240A0C956836EA3939B558B8DA0B309CA686F3C631F4942 +172: 86E476F2F8BACABC996360A0D6D57F0E045C9D3085FFE06D2305601C30D2340C +173: 6CA5FCF07D2D4B1449924C8C84AD2C2E432A1F923DD365D81D9FDE3C4985724F +174: 9A7E1A3B1E01F24FCE4D115EB98E2BB9EEF349CF0D40493B8AB33727C9A1CCC8 +175: 165509739C09EC3486143B0C7C009D5B588736AFF2813A2DBBFD733D5840EF98 +176: AD191A623337F01563824B493BD735BEE26833E9224D971A67B453D6E113D96A +177: F99E6D680BCBC6BB384290A5F966B18D4DB38951ABE695C6444C319058BB8904 +178: 20E7E81E12C9AD28B7D65D3917051C327031F334A2F82B1F746CBCD7DC41F87D +179: 14675C8FE5CBE514491F7093AAD58E9DCF8DD33AB22F3A8BCA1CA5130D5E5BEA +180: E105BE1CAF056CF599B91423DF3CC1FB2808E0C6A50DA68FC9DB5693D1E0A9DC +181: 8FCADE674361487F88D58330ACB439A4B3E717341615BA691370BECF4905E057 +182: 70251DCDF7C899BDDD4BC745597B998506C34BEBC5DE115D4FE85AF2AA420171 +183: D987826931A47B9FF871A0F2A8F10BBB659598DA57D8ABF81714B48A475A1356 +184: FEA31B338415F503DCB3708D68F377C4267E96345158E7B88D24EC8C232EF2B7 +185: 3F2084DEBFEAFA75D0C078BED7EDA160459A3792A440C3718FB5C14C118E3263 +186: E55583BD588FB053F040C541DB36603E4959A7421D6281FCA88454720DA34C17 +187: 0F433DE1BBCA62440BE5D1CEAEC8138A2154B374921D17E2D6493F85529A5EE2 +188: 39CC27D72466D2D63F70F28C59950A0665005B4BC8CFAAA662AEEAF34A19601F +189: E7A556EFDAC11394B6058496B06DAD0EB7315CAE4CBD509E77E496C85F202AA4 +190: B90CF1FD5DBEE8A9C18764962BFF431DC560E113073828D839E11929D7D602FF +191: 62B227EFFE8222299E757A065F1B64AB73FE6D2AAC5D762303DB956BC82B78CE +192: 7B8F54247422C43A6D36977260E195D06E1DBBA44C392B3FE76DCF4A96C433D5 +193: D1400C9E8C7758B19E29C38E356EBC7ABE8C0887741B845426821C7F74EBD35E +194: 9C557316EBD1E9CDE622271E48F654553067C08D58986190BD3108D8BF54F130 +195: F005478FB35B7A389377B35FB6193AAB0E9F3C4138127D0905E488A3E5ED1BD6 +196: F62114D69C3BFA8493061F44DF01566E3A932E83B050B94ECA7A1F7F189D6471 +197: FD915AE6A50C06BA3917BB6D001A4B84C2FF8A906813BA78E80B043A91E7D1D6 +198: 2176A39525E6A57CEED2F28EDA5179172EC4F5A15BE41B6CECE8AB140FF1194C +199: BB831D2653AF40B4E8A1048309C1F058D21334AA20C78DC63B8EB74A56FBDE3C +200: 63C3D97A9F8894D5E043A707B0FEE7F7EC4C049A23BBF1079DF20B4165F9E22D +201: 3E53214E700694863284E7DC8DEC3B98C1EAF97ADD0C1431E3BD321D6742A586 +202: CB4E69B8ADACDCB20DD2D79655117DE489030ECC86C210A268B9985126CA9DF3 +203: 33EB4A42F46198EB7B52F8FD556FEE08430872D3AD16FC3FCA466A2D63CC4932 +204: 4FB1C07CD6E6ED8DBFAC72210F3FF9707293DAD1F8A4AA19F0AC8FF6C80F3CE9 +205: 22349AA35ACBCFFA6C84AB0E0231199D8353ADDE248CA1FF91010234886C94DE +206: 4DDF8CB3D4E80C9971A9AB171F9BC29FA4FD23ECEED01E3BC297892DE389D6F7 +207: 69BE23136E4AF5F52BB333DEB3F32F76610B9FD9DAC9EDE75B2EF0491BF218AB +208: 0B5CE2869EBBBC91BCC4D2E9560BCC21F4DA20FFFC96CD4EEC422B795641C808 +209: 82C17CE6066F792DF2DCE06EACD03AB4D202185A0A531E4AF9A1A2D7B2D43DEF +210: 97B1B2E7E7AA6A9D1821EE2AD6C8062AF397072EB9A8547C75817D0F0AD1659E +211: 5AA4D29AF9903050D5D329D4D7F3A657CCD038543DA764ED931560F799690A50 +212: C78B17FF5EA603A809668BC06DBD99B78561B37FF615F6F5E5B86165A442EC2C +213: 2D1F5FB13901A205B158C5DC01BF54A5BFA9914C6B19AB66F501DA64975E3A4D +214: EF7D3F61C537CAC2A217CC214CD9D3E80F4ADAAC8431768F9DB88A6571D3A57D +215: B23A6EB1184E297B5E9EC2E3AEEAEC3C8DE411DC614F2979DE285CE4D3802E18 +216: 6598F5924005CD92E779A5525636FB061A1CFE4E7AFE97D468EB3106817D6C7A +217: F0AEC1C2872DFF14F3592C5F7E83C0DC4D299F94A7CFB247D0A4B95B9B0FC077 +218: 709DA24C1CA042C055A3CFF57280D72F2B50094BBF029D9AED1DCCA3288022C8 +219: AFB0ABB463999CC9AB124C95993D62E839BF7409D91D1C377912A895523C3125 +220: 049EB53D4BC939E817C9572A5F0DEF95E4E38B4614969D866E738E3AE6E24936 +221: 1F9DF26FB5219482437297326737C0558EB557DA4EB6374805DD9A30F842AAE4 +222: 11151481E2199BE550F9AE696CBD9DDC9BE9686DBC77B619C005D0FB5AEF9B89 +223: 0767C2DE1353F58B416E3FA492173C9C39792DE46A34C6153D5878BA01E5F07D +224: 46D743927EC8AD5E403C9E20405200481961E7335E90C4EA9C5AD35B77F3681C +225: D5FFD30325257614674DE0B40F7B2DED3A287F48AE229B02C91DD2BE28404171 +226: C36F10F2463B839F4BBE7130C8F3ABF29A56608BDF767199FACCADECC8245631 +227: 4265605E9D5B02FC438C15823BDD01CBCEC073D57AD7A699D0126312FDBE4322 +228: 829F989B205831D3C5C002EBF8CEA1B5FBA3DAF966539E3B421B6C2C768F7554 +229: 406A227D2D1767E0CF417D6BF7CA58A262C79460F421B9C155513714187D10D2 +230: ADF7D0028E41121E47AEF77DCA9DE82FEF7FE4F4C82F2D6DF253ADB4E756F2EC +231: B9A11305F92002DE551314DE53739B1C7E31C257149AEE21F3A5BA4AF068215D +232: 49F9ABBE9007E85091827B49256730F552E4A2170A7B6F9CC461483BD8AE0D52 +233: 98EBCE2D0B548D9FB99FBD63D842C119F2CE671317CD080EE036FA69457FCCDA +234: 779042D9184C626289868DC73662E71F413C1DF4FECD2F08B0EDF40BD8D520F4 +235: F8AD01320E4BBAB09282A97511598384089A447F9A6A8FA298B65A82F1731806 +236: 1D799E024FD1627CC0395C68BEC456631153BFFAEB625CDA58411B9CBE137B34 +237: A9BA7072400DAC24052EF744CA60C8273D743AF357C851A7016CAFD599225672 +238: B02147BF83730CC51219F660FE93C63A7463C765395B6721BB842E3EF230E6F5 +239: B642374D57AFA89053DCB7F6E1E72680FB96E3F28ADAAF5AED89AB4CFC78214A +240: 546B4BE370BA614A1761FE8CEF8C023D6A7F968981E23A1E8E1168B25CCE2EFA +241: 72DAB9724F6E174D48E6B8CAF489747995D649828A1B1D7A6E8527D9A01523A4 +242: 30B611734127B847BED5C68A867BCDED79B2B9DA0A358DBE15C4DD578F81E6C0 +243: 986317B1D1AFD4692DD533A712718196D412F46A6F3166F417EF01306AB695DD +244: DB6329F783ADF7CF5A10E47369FE03C95BCF523558F3AEDF18B51A355A252517 +245: 54BB60A43C1E045644420916BAC42CC72F86649FE8EFEEC866CD8E8128A88DEF +246: 802875948F79EEFB707094E323A0FAA2D6D88949A08C044ED3757174492BD2EB +247: FFC9E261842E1AFDAED9F364F125301F20AC8FB0EEA556DB975211C7DB281DAA +248: EDFE0AA71067C62E894A516A72DD4BEF8C3917E46EB22D39626EA826B90804E9 +249: 98832102B93BAB4F82EE872D1DC96D2651CCC9E908C3CF25A56B59CCE20319DF +250: 1248D2D1736F1C125C6928BF893F581EA25BE6E6E3D3C46081C557DE591D6C6C +251: 7A01651D8FFA44F6695270C73066CA9D61733AE3C181E3477D11E7C9563594A3 +252: CED595397CFD128AADBF451002457FF5B0FC2AC3993CABD47F0FC3DDBC6D0F32 +253: 8797DB8DD8DDD1ECBEE1F1D71AED5D41ADCA8345277A7BC0B12DF75BB4536722 +254: 369B09E04BE27275DF75C180D7283C083162F35456152F0B16AE680DDA5195BC +255: 1D0850EE9BCA0ABC9601E9DEABE1418FEDEC2FB6AC4150BD5302D2430F9BE943 +256: 39A7EB9FEDC19AABC83425C6755DD90E6F9D0C804964A1F4AAEEA3B9FB599835 + +Hash: blake2b-384 + 0: B32811423377F52D7862286EE1A72EE540524380FDA1724A6F25D7978C6FD3244A6CAF0498812673C5E05EF583825100 + 1: CC01088536F784F0BB769E41C4957B6D0CDE1FCC8CF1D91FC477D4DD6E3FBFCD43D1698D146F348B2C36A339682BEC3F + 2: 7AA1310D573ABED36C22FF582DD50F1DCBECE6617A402BACCBAA2B71D6FE1379C317FF80C15216D6DA64186ACDF89EB3 + 3: DACC5FDE6F28330BE86BCB13BE11032485C6FD2EB8DBE9EB9FA217F4583FF9A564BB354DD768A672BDF46A2E1465D515 + 4: AD4955474387FBD0FBD0384A8569FDC80DC55FD99B5AB37718C38D471DE31798DF9D287473CF2BF7965E025C97743EC3 + 5: 3B1DB9196F040256579DAB7044E829FF12D49C0062F65A99307286A03A43E08962CC65B431EDEAFDECE0FAC3F637081D + 6: 5446F0F8400A98B847C7C99D303A948220E62272C33F25A2C55DFB50C8FF04586F9834E1F2E7CBFC928473711088E725 + 7: 7917C2E9694CA3A8527B3848FAB9D93F54FE77EC5246398F49FB970ECD2FA3E7639B9D0DC1E93CF9A2A31752F26F734B + 8: 8EDA71FCD7AFA16D333D5897026E2628E6C272E78ACAF021A3FAB244AEE81F8A6DBE68ADF9B649C90536D621067A01BC + 9: 68D136924ADEA6DE85BD5C010277B0B62EFB7D1351EE20273946156ED9D5EDCAAA284C1FD25CE1B0BAC547F126454336 + 10: 57EBE1BEA284B150F9E15F8D58CB2606FA37AEA4BF96668304B896A7CC9CB3F5EB02DAB3058E1A26E94E59799C227984 + 11: 516BBE48CF3F244CE0A2EAFF66D09A7162A5E338AD3151A527940E27E66A159838A99962AB85A9164C2A035794B57D1D + 12: C301D5B04393D60AE2DFA5E5985EC36C37B1E58AED5753246DD8E7FC36212E0183558CCB66D3CB97DC6E6FEB9BC5CFB7 + 13: 1521E9AE85DD32E9A903A72DCF1C969173648DEB84C991E3C4914649801286BDCE85CF59E7BF15D53D84E832B0E9A1FD + 14: D52238289F07E2864591953DD6AA4657C60335BE4AFDD3D9D65A3C5BED85165EAF59EF577196770B27533B3569BD2BB4 + 15: 0558EE75B48030065F6F53D1770521BAB938CEDF8EDEA3DA43D8670836E674DF97B0F01A65EB2151D1BF7341CE1E1018 + 16: 7DBFE0CF53262764CA067721002A7A16A10D6CB22F6DC554591EE8E008E1BD26CFCD125DE7BE3EF5A80FE5E5A7C9EA34 + 17: 971E429E3E7EC82B2DFAB160EE2607CC57F6839412DDE8E23DBB744A126B1EAE250021E800B9F40812B7EF44D82A8FC5 + 18: A11C06EFB06D8A01153B06E9827A7F209A6202864AE18AB984E89E98E77FF32C3CCF5F5D40FA1CC09336E40303D05EFF + 19: BF3BF737BDDB8FA7D4055177D8F06AD9228C6BD7AA2C8D0C2B3DA435F3C9D485486712EAC07CD456C16B0A03785A2610 + 20: 094B7F217646F1637A26076C749C40BD1DD57106501342C8DF8ECB30EFC44A6F8A6155FB77CEE476DC126E88BF1BA0EA + 21: 195AED3C477C98901175BFABAAB4834D559C3E93B6849B6C7006F2E44C73B30985C56BAB7415B4AB7F872913605C4993 + 22: 2029007DB07004086EC1DE9A61EB9597B8AD2A5273D28AB7B46A0E2337CFF1C66672F76E7330E3FBEF1A26C2A4541E65 + 23: E01514C4D1B44F784FF6FB4051F38197C2223AC510A80E01D13F701F6A0486780C72430FBD7C8DD4F8FC19C0D04D94AC + 24: E991FBFC45C40FFAA3AAB7C9884BAF823C03EA63A4A4CCC4FD5D6A6805BFEEF007E0460D221B65D28314010A75D0D930 + 25: 8B331E2E7EDA24D8DEA1CB4C1AB41FF75FD0C6506413DBA04E300EDA8324D56B8ABDAAF5F3D1E05515FB51145FE7F6F3 + 26: B7AECB3B1DD4E1EADADC97510A604FBF64C60C4068C44D7B33E74D065145DA6929EFDAD333A92EB98CB7DA20FCD39D38 + 27: ECA0856AA7F204653BE5EA42AAFC91306B3019C42E8581F52E76EFCF4D023BDCF57F73A8E5DC15A497B65FE1B139D5C0 + 28: 215C2D6D58DB2FA8FDFB1C2EA3692E9ACD68C6929F15DD751B1FE056E0F3792D46D0427BCD3AF72779E8EF304254C778 + 29: C22E73ADE37B480AB20F7EC31F1844E36E5C3064F4B60B4FF5715D8D84292348B5BF482CBBA3D09032B83A1377962374 + 30: 9E661F0789728B4A7118715C19FBD272C2C5C0BBB8F4543E81133888CC38B17554687753D193131B35319F1743CCEB9B + 31: E440945BCE0807DC2FE07018E086ED53751B9BC3C0052CD039CB48EE1A80A0FD72F38C90D9A7280C9082B9F52C8A039B + 32: 7DF0B7BE6C29A965D6C3A8056CC72BF36DD8849EB73FC1F23A3AA1902B869E0C8EE99663887EA76893E239C9E45988F7 + 33: 8116547B404D20AA0459B97AF4E75D44703EE8E41084F10080F68FC6FA76C38C1047B5E17CA388DED34B5A83C87043C0 + 34: F7D5B22F0A2409ABC271202B06CE4FCC70FA9C1D725A24CEABAFE241E9F6789668AAA797F414D560F479B9AF3156A265 + 35: D2C5E302EB59E8B2F532B37435557C6BAB3E87B3B768C22EC6EE867235D3AED81335C6A8DEAF009DCE362718EB4905B3 + 36: C07401041428648F80F11E0F5BC7572A0E25198A2AFA1F9F97B575E58ECB4CB6022A643665EF5E1820801D8C1B54A7C8 + 37: 5CA967220BCD51FE2243E456725856B1F3112EC7CDFDA93DA7CB1B1F6C672CAFEE4E17AF5B57790261D1385AE9783B6E + 38: 82378F12C4AC4EE4CF23F13E6DFFE15817183D4AA354C9A14FA352CAF7DDC114663E8185A25B76E21C8FE6B9E3486E3F + 39: AFFEE2FFE4287228EED3D9332FFDBD3CD807FB1BFAC1DDE4999E0A249D7D063B492D48ADD72CF4B906510BEA724458E9 + 40: 2C455A23E456EF7209A73DB89902BAF67DAC313147C337409FF5085423A571DBBC79AAD3C09BDDCF30CEBD4E2E975EE7 + 41: CAA00F63A96D68CA39B213ECAE9204861256CC0CF19ECB1048DA9213F3ACC56202C5D0C95544E8B70B655F610EE45721 + 42: C2B4602F2BBB0F9A35DA3C4510E430B9385B8198239E45F5E2FC3BD39C7B6D9AB8AEF8E7F30615C93CB811D3E0FAE6C6 + 43: 86C274D20B1D5E2CD36100711FDCAA8835185A899FB0A34CFF37279466329299A57EBB346A55009844B88B1CF788FEF6 + 44: 0C5F57B0D24D37F3CEB925156B11C6784BAAABE196774033010033D7E2495B157F9F238F774DF3FEC6F86117E2F3712F + 45: 49048770429D040EC90B9DBC11CCB2EDE463A5B263C12C3DC529B1E28B01398992051DE4AD9FE598CF8EC5F1589FA2E5 + 46: 2BBA965E13AD32B3832A2AD0DC5DADE3EB21DCB6A919E0CF18E08E6EC7CB5BDF1B87A0347AB8D4930FCA5E612003D439 + 47: A01DE48A297DA53FB1BBC9C43EFACB7F4FA47D95265A8211451F6D18B97D56CC19962ABED9D275034C0DA48ADDA002C7 + 48: AA8339E709CE63EC6597401E71F130D615B830D3ACD50A8F61ED68DF50CEAC4621DDAA12DD68267878CD4AB7A2BA6975 + 49: 5544A73DCDB9E814896E78793D6E149C407BD334CD802193FA8DC3459A4A776713F45C8DF3AD59B8F5005930AAACCB7B + 50: DB71BCF0B95791F47A586BE936FC88B538124904E39FA99E04BBD0E7A1456B614975ACFC05EFD5684D43ABC464390F5C + 51: 87AF4B918713FC85E73C10AB6304D5A4AC64CC96FA1B62A404A4AFDC56694038631794083117FCEF571175DBA4DDA404 + 52: B0B4DFE92CB69C0CB1264907B0843D588803B1CD9F024FEF2BA61AAA8AF0E60F584C754143FDE0E551B739DAD526BD2C + 53: 3F0E22A4790A955DBBE8C557B2299BFDD9D1A472DC9FA0E16AE573AE27C14D6BEDF6C3B368D8A3E99E394FBF1E0B09DE + 54: 3B08FF3536EC029B03D7664479F33B01DE1831623834A925433F002BDB071129B89109790E1E0DA2FE6D2F5D8C5FB749 + 55: 1A27A6C9A0C6F493D66E567061980FB0EB5819461C4976D5D30CC91B3C5DE1118E89CD2E00176322C42BFEBAC3508CA3 + 56: 40FE3F1E4F60AE955D7EBCE290DC3C867557650620F512EC42689D999F7FE6CF51459A361D688225D43903BF67197483 + 57: D7C98F147ACA01767A630CAE9F73A03C0E12870E79A715229E23EA6E98B8ED666D0B79B318E5F63E7869F07F52329242 + 58: 5D48009FA2A03966BC9AB3604B68E86F097F6E7B54B33446A52C11A9ABC447AB60781E8EB2F7706FBC1F9D75C18FF50F + 59: 2F6BD98F71F935EEB12216F11964171DE85A9BA01EF4770BBB1B9C1C27C51A50354FECB5F1C37C7E207D940355A1F099 + 60: 99DE86DE7A2973FE64726E216891F5EBBC64F2F6931F0E15082BF3EAC044C9BCEB2FABD3DC1CCCEDBC7F80313BE5B5F6 + 61: C148F35C0FB796AC801F5FBD4ACE22C52E86013E123A65F2946EBCB0BE7B020019AE4E3EDE83AF60628E076CBA4BC4FF + 62: EB059F7B0CE4C6A2BABDF8C8B0CD9E1E17AF300AA403CD35A6A98A5A73CCEEC80DFC80B6F76BECA4D634A4E0B996E1A8 + 63: 16BB371B2BCCA20F406442146AB47467ED37A24D1E51115C2ED5C10B31435BB9FB5CD4025156E428B5A57701EC5DBF3C + 64: 11C8E1A6AD99F75BD0B8DF1530549C6BF2E72D64E6703535AD06512417B0F335DFE07E63CCB8C5CF99D76EE1F653F609 + 65: 31466A2F0FF943F08D69924B1049181670949CECC738075F410A6EF41A8E25BD2A8DF14829701637ABA4C97199EFF213 + 66: A1390F24E088B0EFDCFB6B4E92F5086EDC10B6C217D629FE81A1C0A52481BF018341B183A48E1ABFD710FA1F61887E57 + 67: D00AFAECF9006508F47E6AD3D9E575EF5DFC358B0D2576AFA98C965943376910DC8BDC23CEB47D485B933BEF350AD788 + 68: D2AD61644DD08EBB11133FD86F973DD55DE4E67EA347B53E5A8A9091D7095F5F63C332673F291FA2CC0F9A924B60CB58 + 69: 6CEA68549CAD3A2729AF0F3D2E468FD95BAEFFBDB1BEDFFE5116A97938E49A6F1224B6F5090CC8288EDC176A8D925ABD + 70: 7A261025C8CD21B6FF423139C14DA4F880B56991F11C39BB9B21FDDE2072C4D572534ED9AE3F1E3FE4959E977E78BCB4 + 71: B3C46D3661B30BD2B66494B2DF909BD10D0E9FE4147DF4287EACDF3C2D88074E15E4284C9F9DEB326CA22E6AB35458E6 + 72: 09DCA1ADAE2FCF98AB4BCA7AFD2ABC68300E23FFA14345FE4057EE75E362E602EDB5A3F08055410ED5E93AD8B944DE38 + 73: 1FAEF87632ECCBA883117E6C1480B5042324071F509755CF6DA179987DB08E47F41C37B1097627750970EC6C72F7A02D + 74: D3135CCCE3CD1B90288DAB286F143E05BD02703DBDC4AF12335F23258B6399B80A8E12650A933D4262B419F973F4B72E + 75: 6B9709CF76D2C68D0EC2F8DD34CDC700356143A61A3BD0646F9BE30EFF9102F59A5D0ABC5B5306ED6701115C39FDB96E + 76: BA648F2BCD568F5D498D9505D2A0CD86B9A073C99AB85D9976E4844BDFE801FAD3AA22515A9FF08EB72FE16FAF4DC81D + 77: 433B7557735704CC1E47AAAF1C7C53141E5E2FF6420E3570181524724A09CE73BFE11EA2A7B059C7E18BEE7E5D928125 + 78: A3DE980310B14F269FEC07D5AD8D0F9CEAB17EDE99F97849F976877027FAA37DD0B492198467C0DE17649167FC80C9CC + 79: 363900E86CF859C978F1A7E860AB872BD9AFDBA445EDF044364313BC29BCCFF9C912D065E55288976B5804D0861D1708 + 80: 5DF4164BE6F6706D8A3A2FC157725565CABBD520B0B198CC25D3CFBCF2C5FC14D98EC46A226A61C72AA213284FE880FF + 81: DAF3B3602A2B6A0E918C78D72885FCD9B24377879A2E8CBA72DCE8BE3C36FF5DE39D01ADEB4D7DCA8773A3438EA415B3 + 82: 8F9751EA2DA27AA11FBCCB55960A5A5D648D34C81A36EDFC9123255A4529A018AB9230FD07551236422E1B53B06A8BE6 + 83: DA5E38532DB4AFBE5C38BDC272889FD8B18B249C9658C6806F8BE25743E89AFA06860C117E1DF6067CDE4E2AA5A359D2 + 84: E1B0A43B0F121293EBB439C828ABDCADBDAFED717796CD0A8107237158D1F55E77422212B7450CF230CDC49B78F55A09 + 85: E0415562EE8DBF78FA3A543D0BCF8823BF3240419ADB0339DBA53AEB565D861448879740051D2831DFB0791D5F537CB6 + 86: 2061E08844332CBEE5C5C81C8DB9FCFCBAA9D1B4FDC14FEA69BCB2D4B7CBA02D4D179EF0BAF4D12530584F9AA83EDBC6 + 87: 8EB1C337D49DB5ABF181CA2D1EB0D5A3B530BEA1720504C7ECBCF46FE1B0DFE5365EFD119C0BDAE6D92A1F3BFE62F4D8 + 88: 5389909A11359D68263875199B2D53BC2C473D44BD5ECCC562634DDAED80C6075A35BDA179AA3129EAEC1A11B87AF6A8 + 89: E4991FF9FEA81EA2C32583CB642941BDD7677B1680B63825F2873515C632BAAF313447BC291F03F5F493FDD66DBBC462 + 90: 8CAC77097F7412CE765BC20B900A8DA83BDD561E6F0BCAD987C677A428A42D1D289E0D8B2861135F33FD6AB3F593F4BF + 91: 38C9510779D5AE1F114D0C3C3015C9869923FFC39E38660048735E7ADC4BFC073FD90505754692C3FCCACF40BD5E61E2 + 92: 4B1D3D0763BB619F0E898E0DD6F06020BE5D1828A798277553D607F273C74498CE505F160F2961B995A1D4959C3D0A69 + 93: 8820CA3444593CA1896328D90A836B768A271410BAA29D1588D22EF68F2D0F647BD2637279F2C4469FE7DF2625EE1DA3 + 94: F5BE62D7CF77289C4D3D656BC1328ED6D32A43B2DC2A9F2615D7C8F97FF3EE28ABED0CA6EE02E9966AE16BD0337E25E6 + 95: CCD1AE814F18CE64E176D8895364C8B600CE901573079DBC7EEBAD25CA1FCC23B48E7E352BDDB625DF03B2168F097F20 + 96: 447502E039A85D13DAC5EC5D009B3D9607D6F0E37BB15A0AF7D1513D63D2DDDDDF4386F642D6D7B2B47DAFC8ACBB4297 + 97: EF3C7F9D484601A79908B61B8A58049F63A0FE6B33AF31706332C5C4D5003A93D2C4DE7BDEC5EDE6E9A9CF4362BD1CA8 + 98: BB7E3FD37861E3210AAAE39E2F2F3985B6143BB872BAD077D71E2545D2E9F95A898930BF6EA2C48F2411437D08AF93B1 + 99: ED83072604C544B7B8BA03E61D6F9EDE575FB35DB4261B7783773F3DB5B1944D6D9AD484582FC78A0F7505988B5F1A07 +100: 313B0350C45772FF6787F1E2831CAFC6C8D77162BE100819E5142F1F398BB0FB3A3123FBFF2C94927F7196386952067C +101: C746055CCDC870C9FD92D249E19641C35C4908EAF0158284562897B21255A84D9051D71E9F3C0C6B5B107D7F080A765B +102: 39D7DEF4679233C60A2F2AD6C5AB9EFB8741E330A533D15F912BAC27C61C6B26936D6B70FB8723B916FAA61CD0949306 +103: 32DA7CC15BE7214D99C928E817C13B87C23837D0F4A0949E8CCCDCF66AD9D66E7329ADEBF4F8322E4737A765E4E5B69A +104: D847BBB38306F215A96B2D991AE3ED8165BD9E25561DDC000582D968D54318D82F0FE0E331E933CF2BEB9D31DD3EA4A9 +105: CB186B1873DF28A7341697806DD13B3A79032BDC9DE6CFD5F8DABB380AA7C7CAE453BC6CC53FE0ADBB2A13861F9915AD +106: 03C82565471F18CE9EA9BC5C945179D1B05AC9D1B7D42213E4C6D331E98019F5429CD4C68449E20E17112628E35B449C +107: BEDBBB184452D605455FF4C247C349B589CE3BD2D9548CF7D70C33347BC3EC90656E3A4D8C9AFEFC42356240A4B396EF +108: B9227B25C189C98256B061A0EB3A9B95CB65A1EADA1CF7F99EFFEA0A3D13153CDD0FA6C5187C6EA3BC6358BEE389DA76 +109: F66BEA2EDF972A29C888BB2E213E30C3583F07D2FC4231A4FF39CA1B8AFE14C4F7702D6F24CB69CC119A5709AA32DCBD +110: F1D96469C28B5B74EB4451F775813DF3512C212B9B9B07A3215FCD3C98A392EDF752FF95D0FA8D991E82B5EB3C62219E +111: D443F41B6461562048765AE37FEB6C63683800C4C7AD7DC4C8D7D6B67A689F8435FBB2940506D6722A09C0F3E46D6C64 +112: 40790C95C391EB482BB315E6153838AB6622BB651EBFE979B09B7456EF021C811FB216027D063732C5B83F0AD639EBC3 +113: 55985DE48CFD269E07E5D2610D64FE61F14E874098E60B681C95393B7F2576A0842F086DA49CB392195CC1333166EB2A +114: AFBD441595F4AF79546D0F56B17CA57A3991ECDAC87A029E3A51FF4150856F19DC7D97DF9AF3E92A3E75ED5993D1F259 +115: B3D06CC9DFF506E46701E6E66B69CF0B47167E46407AA348522CD913CABC0DBF1E0CDE6AA1FD0FD986C65393272CCBCD +116: 0FFD81EAC822E16262F242DEFEAF1FBC864F7BAEB4C75DF2A6D6B88F72C8CF7314F8C57463D27B85D123C1F5E0ECBDB0 +117: 4F2717491FF76CEBD2F5F2387B16DAE119F584C8EF4C503CC4CA980B0C780F7EE8D74200EA147F0E2443D194293CD0B6 +118: 926BE35284BB3E56620FAB3224B5213E06FBAEC1D3C8642E8ED86066AE531E6B0547320CD8266CCB14E8595AC2AAE69B +119: EDDE7C594252AC8FF98A48E682D6290B0381C53835373F4F9F2BB5923DC020878D83F2FDF3B9412424D5C70EA1BF183F +120: 2460963A3BA372E93A397D0BAB1CF3E4141785818AAA7BF92AC3658E45B6B55D1C9D1705D46ABC69E0F2EBCEA48A0464 +121: F699225B801D19D3A7BB057B657A8BFD2D7E5AA8CB858EF05551319D4BE76D25865928CDC4C53464AA6D12785B870EA0 +122: E4CA222F516E44719D874BEF8622C600DDBC475F8C80D664329D79372AA070900D84912C885F1EAC370D13C28D12FB04 +123: BD05EF18A7914C1C7747568B9E5FD61F7B0384E0B43FE3DFDE6C01E38A503AC98F9F4D8150B2EB2DA889A3F4B10B256D +124: 6C701A9BE9FEA1EEA3B702A3183C35BCE6B890BC623E8FAF3CD086DFE563AA7879B4ABF639FED909307F03AE4E7D65A8 +125: E87693FE710A95FBE1B6DFF46B54AFC430D290B2C7FDBC0BF551C1E8F4F40B44B68CEED6A18B0D7C4A48648ED97FCA99 +126: B371595A7AF71BF1E8FD22BD950DDAB0FD642F5D3FED006A6E66D1E71E47867CC74A7018BE3FCA6829053454A52DF1F6 +127: 0C046DCE7C3ED50A4BE7ECA79FDEB9D821EBE28F5D82ACADAC3D7449E6892789313679018034A2CE6B42F006C02F19EE +128: A2C2ACF7CE4079C02B7F38E2EF33BFF531A31A7C7EFFE712C5348B4D616C0CBA9B152679317984EC632D0C70EB11EECE +129: A95DB6E5CCD191793AD20179BFD63E8C7AEDF0CC1084549F73127E3FCCC738B405AC2A93D692E76214320089121073E5 +130: 6ED4BDD216425D5E91458C254152ACBFE8F4751BE0045401C1CBE1E2979ACFAB8384E66816D1CDE56418A9FECBE76B3F +131: 18391E55459C665CC076D3152EE0CFAA5C498595298C4D82E2E160C7ACEA15D7FD749E1D5566A104E7F24344E0BC142E +132: 0C841025777221D8F7E1271E03687A380250B269236CF5535D5CBD77A480FCE6872E4885F62DDA17136C9AE05F07FAA4 +133: 0E6A87DDCA034B11F6D221F17F53052D85B22968ED7A2E2DFCD13DC1DE64C27639A1DDF29ABEBFDF02DFAAF687E3108F +134: 8CAB0302A4402B1E9CE08E4D87F6B9D82F17424C5DDA59A2670FC29DD8F504CC7B15474BA179DB20DCF3D3580EBAAFCB +135: 17BFC685EE89A404752DDCCD0BED6B9B0696C0F968A2D96749A2BEDE10BBF8E57F4B1AEDC9E8DE723FFCC22E3F309C81 +136: ADF0CC27BB9D359090D277C3A47A3C96E1F0C6598E9ABF460ED128BD39565AE464B39CD6A75DBCA75298181AF1356C94 +137: 02AF7C886E86140E74F6635431732ED6CF9FA4EA8D27174FDBAE9A4D92EB03383F0419B26508C556D6A0A1E0777EF38F +138: 806150B2F09CAAC8311C4E1BDBE6A1FDE29693AFE7DD49C9929A85E593F2184CC27C895633FAB658C7D20C6EE545B827 +139: D0A7B0CA39327EE0BD4AE02B870903A1400B7A8D28016834B4F0F4C49A5F62581D4D4A8FE658111B80E6A6C1F2C9B691 +140: DC19DAEC1D86ECD2D9FAE6A1BD4BFE3A7C4EDD941DEFD83A92AB50C2C48DF2B9911ABF2B91CFFA11BB839692BD80B2DA +141: ABB814006D0908D4BA2CFE11B589BDADD4A17CE1E799B55E44600A7B2A0225E6BF6AFAC61D8C7958060D1F28579BF129 +142: 63F83790ED5882A85BEA456CA446A2401644E3C9BFE3D4F8A54210DBD6BB807F60F9641AEEB994D4CC8A6090F8D58871 +143: 185FE5D0E6764C660BFDF8D581CDCE8F118232BA58CDC4BEE4C021FBA072C6D04250C8CE3DA4DE58FE43C8D0172B612C +144: 57D66CB0A11F02127FD13D435B6CB6195E30EA2562E92C88B9F5DAAC5EC3E86F738F05C9C949D66F04D4665F942EC991 +145: EAF6A0121B3B4BECB5EC1163FFCC4ACCE76330D4236427646767487E0B5F1DD938204B3F3848082313C2170B3FD7F06C +146: E6793995C6B7F03BDFEDB7C41BF75FA223030E33E47AE9FB75CDAAB46AB9E5A580E864301E94A10C87EFA08AF4CE0ACE +147: 616846974DD72FD90BC27DA07485D4E55BADFAAFDDF09E0CB48B7494280DC0CC20A524BD3BC60E28723F939F915B838B +148: ACEFB24F02371015638A8D2D1F8D0CEE4CC71959F328D7B443F61BE497E1AE5D934BC47B7C3611418862820F6F2CA27B +149: 2F3F1757EAFA15BCA9E5A463D68AA56EAF59BAD93542B89FE7C733F3991640595298CF0447A35A207388F0160BE3FE21 +150: 2604AEC3CC0CC8A5F3C51D4B7977341751D35EBC4157A4CC3A5915B65370DAC58E0F7C8A5E3517A12EAFF69FAE323CD0 +151: CCD7214BE7EEBF6B1B203675A6C2A77646469794DB7841511B88A6BB95570773B1F30D494CA56320A6591F55FE011F7E +152: FEAB9CBB082877BFA8D1215C098BD9131E9C22B8F4ED666D1571F467771EC03FE0BDE78D7E24EDC5C9F14B9488D24966 +153: 90948F9AE3B1C195005D81BCAC2F3F32629B1D512F922E4376456782BCB5D916AAC5BAC7AFBF6DF03974AEF73C48CA5B +154: 2FDE1A345A9874CDDD1C966413F518D3DB91AFCBF253EC5F6F90228C904977F65B24C1039055E6AC94A7111CE00C0EF3 +155: 285F4FE6AAE37FB6DE5318AC8F07E1CFD678C8EB42D408323989589CE4D50AB96684BF399FD5EE775B4EA583C6DC4BCF +156: AC29B1F850E3FBF0CBF88EB04A23DF73E966C2D9F10259AC87240B740B94814F42C1D9EC460C5353D4518ABF4FF72A3C +157: E56BDFE4DE330B91B58DD9AAD2CD203A74FA71CC2B7973F5A055390D99A498A7C71844EE711D2989C29A481A526482E0 +158: EF6A9215377AEC65A6382C6775F7A703E0C56665B3E71F877DF5B00BAAE6E0C5E963B2C29D7E57241A6EDDB338683CA8 +159: 2AADD60F700F29CF5F1739ACF5888CC137AC0D57FC113549D1153881287C0E598728D88E19CC37C4BE1BD9E1AA2B510F +160: 1407E4D4E7E572DB091E06E73D4F0D59D67A97B861716318CEBF80AED598F26CF1BBE0EC52918D3A78A434094939E2E7 +161: EA5733A41647AB8A1A717550B41FC53AB1CA49CC28DF772B229D94727E5CA98FB18663EB0EDA37F81FBA387A8A4F4BCB +162: 9915D517A86107E27B1F78AF6E7B0896E3D2E90C7A917CF16C9F68AD4F17DCC736F0F2D8CE5C7B634BF297B197D235C9 +163: 5D9E3D02EC4088C2F3D514FDFBE27A9DB53B0037CC3FFF615B4AFB3EEF279DD7A0B8882F0DF5E125F06302BE9A30C1C7 +164: 0627AA95EB148A7682118D502CAD7ABB8BD83E13008364F5E8B8732EC3E648C0D0B78B7B3B0E2E5A58103DBB7F56E4AF +165: 51BAFAFA927821102EE620D2DABFD4F9B18C365707569E161C9A7A33B3C433E16783C87DC2A949732683E951E538C3E4 +166: 08D9894DCD5C8FF0B4A8339A75FA95E9E88C68427CD8DBAD9297ABF02598BB6ED3FAF8F7B51470514B3BB9A6C74A0137 +167: 594B4CF5BE4B482A8F23F610F7E57493C708B269207B246E628516CA66D91C7965F9D830E1A245BA191113BB2E2D19BF +168: 02FDDB82B56E4550B8DE39C7013BA1B3B8E1EF0186A1EE899FEFEABB5B83BEF41C76CD276657E69FFBF131D78FEAD875 +169: E1420C71511116DE6BD3225DFDCF54D6242DE8E84DB032E698A5548F5311D306B6B3AE57417193EDFBBB9BAF516AD804 +170: 9616D9830ADC19D61EFAF62B3B0BDDCA2182A3F9A340BAD5E347A780716A73D2195C00C5BA4783C41006D2B43FAE98A3 +171: 1A5816F33CEB8F566AD383C47850387535E020A8D0B24DE45135ABF217599664E6E78A492ABD367A7B04A44CD1B8912C +172: 5547E5190F50DCAAFC3CED495AD238852EDAB167F092FDA5648EBE8A602F073849F925B3F76D4E5506FD671885B236FA +173: 5D6A6082AF10CDB8323202F11A79FAC522AD32BE9620F77C24C809970F1F80D7E5468BB11FDD63788C8FA46F553F9B23 +174: F9AF7AD6AA566D2E80478B50B043DFCDA40256A2724351BEF6CE819039F541D8BD88DEF486CA1E2256B18417BA0F5472 +175: C3106AAB2E9F2A4C772274FE1A36BA98F3A9AA94BAD93B54ADDCFA72CFB084640BC3A6881BE9A2783AE191BE13A7E85C +176: 713B25A0A73DE00F72FB93E440DE6828D6FC1B4FE631F27538A4B37A1DD6E1F4C7928A96912590F750B04BBAE0132B96 +177: EF3AD97AFF769E1450656A161B0BD0D6B251ABE681F0EB0EC856D125E2DCB5B0D04D787232FC9D941271AA62E7CC28A7 +178: 6B3052F9304DDBD0EAE8ABE5FAF982641A5FE98D89F531373C74CC6E068C1D9A7E57994C2856EC490F607A1C421DEE9F +179: D28F0C437E0F812CFD4068F7FED2068E2C16FA89D3FED5E43FF06CB6A9EABDE3C81F585EF0CCB9CB4EB1D3BFDE7AADA8 +180: 4A7EDFD099BAE536F39D27E28EEE09683B4381A237ED49B152490108FBCB5B008B452509184F24E2C15BFF448C4222AE +181: 389B32D6503D04B43A0F608D171F79DDED2CC8F82919FED673084DAC52315A72177FEE73A489B0344EA3FA4DA2F7B82C +182: 335F0D7D2EBEA7236E1A15D892923FC92F184E112FCF749E173C3109FA4C33FE9E4B0353DBEDC0C9974A51EBF3A9620E +183: 7A2F48F490C5649A4875ADCC8B37A06A3D76D08ADD0613119E7D752D3E39E3C4D9F28E55230B1D0F0FD411685671C9E5 +184: 064EFC6A149C8BD56B889BB0D0C427C47349F72A57655B97897BFF17B3C997C3217E03F63F90E6FCDD94847FF243B6F4 +185: 1AC5D8B018C1981AF1CF0FF849C5819C42B0015B83A0111C313F3425F9B6389D7309DB7E5A7B17BB50DE72F4B4F7CE03 +186: A8D496F68517A880B7C27BB2A7DF5EECD65A79355F15645385EAF830F95B14F72C57C60E030610B6263E7A9430602222 +187: 551345C9934FD4ECFE647A7EFB9E6F094FEB70F3935A6C81A33325CB8B15A4816D3FD1AD3FFC88DD0F47CB143E8B5EAB +188: 11EE22A28D7F0B7BF6E8110A12E3413B58FB6A0BEF872744F579CBC44990AD83BDFB13FF5C1177839590312DAC646AD0 +189: A9BE399F1C9D3DD12EB61E69E0BA0AD878FF86C9A81DB6F36DA6F29B53B6FEBD998889E3DA5D1E65B35276056D019307 +190: CA0299A194825AC60197E2017618A656D8CE4973C6B2FF434DCCC202A3692373BC05BE34CC5F4E7BBC133D32D3A7D17C +191: FA0B8D238239F40622207F0CB6B08ED33DBA359ACB9FE7FF26EA0E1893F909D695AE7BFB87ED74199DC23C9E68CBBDA4 +192: FD7ACCB685C639F49D4D21AE57E2D3971A902D1892737220BFEDDA0FD89B33A97D8B96B18773910220D268A61CCDD070 +193: C62FE53E61FED07C1718A5BBB3FC65141F4F294BFF1CAB291EF62DB856953EFFD0FAB5F3BD20F8E4AAF48DDC71F3EFDB +194: D0882A9FB46B0C8D2C70DE5EFC5569027B516450835E3AD9C5FFB7A86962B55436B692B4E930B66D0CDCE2FE3BCE25C5 +195: 8DF5F9265406DEB1DCA57AB46E423AE7E9D5EAA1E650EF9B399DE74C175C694324BAEC0386AEA2AF0C75F2AAA1F4D421 +196: 3887E609D8841E57CE7415CCF815C34D7A9A31C2A1A29B9007E4D826BDA8EFF5EB8D8DBB6F9496FD2565B83ADD400DD7 +197: 0694FF8371961712D8A35970009BE8E3953E09E54F119EDFE4B947B11CFAF078ED961AE1F335BB17FC389A9EA35F7EE1 +198: 99A8EC7449A5E51B5FB4F6E086714960ED74ADF8FEFE89C1F49054CD34C3A86E673CE92154BC7DBB1DD4F780969EEC3D +199: B138AAC5B451C7558D02C518636FC80BF49FAAA6AA972D68981A684F500C43E9DDA171AE6168BA8EC2B52D0428FAB4F5 +200: C3FB89D604F306FC6EE2AAFEBEFBF69D26B21DBBDC055166858D527A4501FF479894B533398334379C182AD6747BD1AF +201: 5AF5504C1F18EDF72C918A40EBCDC51B898FA45C42CBB23A64B2BCE44F74716E7BA9465EE8E347E33C3A6DD6C1ED78D1 +202: BAABBDC830ECD27BE8B089AF00D4CC0C9225533721AEF1D24070CAFA20789407FB3CDF27D2AF1FE0058D0BFC85183E09 +203: 917496B4E3D0D4780A6480FCB04B998A035047BEE524ECB437FB2558A093DB8E1A62E62B0C2B82E73463F7E630DCB197 +204: 24CE0EB4A3ED509348442C252E7B173108A20AE8C5042DAB97431CBBB07C5A473B14E44CC5BCFD2101C8EA4DD88E336C +205: 82E9F843BEB8669C9E9A05B4F8F51B59EC6454659E5753CB6327749E8D3940DDD8593ECDBD608A6564B1D638F581D2A0 +206: 9ACDFCF2BCE50A32B083A69418B2814B10571AE455FD5179480AA02A488962B28CED5D7F54DF3569DB34E11B6276E984 +207: E83BF11E8469A7F17EE92CA39BBCC34BE04316C71DC698C008B85B5D578BCE3E3528A4001C4A39DBE0BB24B97973AEC7 +208: 8A1A5287F1875B39342B60DEA85ACB93BBB3A4DA75C13D15A88253BA0591C7308646264150B19A2B698C288419813759 +209: BFB72AF495427F4DA2663D7A71F2CFB08AAA195E9F27064B4360256AC4CF243ED69BBB5DE791F058BB2BC80149B71295 +210: 47BE392C89A6A1E9FE451B5E869BFBDA0A9A23453C66D81FF3E716DA65F6E4CCDCB6CFC1315D627B7A4D0938E04FBB89 +211: FF110E7ABE253D27C0109FD1A4AF2A89290828BBF06F3233C1E0CD979C1372F1235216B66D0BAF3F9FE1E503C6983746 +212: BAD05016EC91AB339F8F5790A86938AAB9F9A96C317F61344BE0E49FC17F49B47F11E35DFDE96D1AFC74D73F42E73712 +213: 5DC02FB03284E604C66F38F61936A1557AB265423C36AC4C66CC5AF4BD282BFFC2EE33EC924FCD47C8B771695494B487 +214: BE13DF098FA3CE6C0BC1EE8551D28FAB56989C41BC273F1E5289204A172266C294F12E631841AE8ABF90DDF15C9C9993 +215: 3EE39B0127853E2B42ABEAA2C3CAAB17A8474945CC140EE09146F2B2A9844D8490AEA003FDB7329525F4E3E49D222F8B +216: 313B503A0480DDD1387A8CB1DA3FBA0773C465964AA49DB3893B973FE2345402BFA062532B3D90FC5A679C95FE97C1FD +217: 3A59FA6049CF57C5F0459B4DE0AA3EA727A223E63B9098177D9ECB6BBDB59DDEDE8E0DFD798DCFFE9B641BEA32629745 +218: F5F5695B468E89E150B8D0769D5866FAE28D2F4B74EB01DF91744F06D88088681EED0CDBAAEEAFCEF069680FDAD53CC6 +219: 9F3217D32F0399547A5F5476FDCDC45D60ADB4EC3ACA0C9AFB12E3B914F5A3E6A42E673A3156F842C482C9AED6F452F7 +220: DC10EB95F4A95C62A62361277E3B7B4EBD26A0CFB4D40BD9B60124A718E64138F634797C4AF404E38CDCA2AF1F891E8A +221: 58B9D8007536A0ADE76CD798928830E8B2454565BFBB9B9CB4F212C423CC01B2707F23FC1B98B153E453AFF75228BFF6 +222: 96588A4D0EAFA475F6C5EF4A541057F2B42CB39A80D9304CC42FF36E52F4ED01E59477468D1C4A4E76689EE63CF3F2F6 +223: 75F4E8ABE2665CAC88D4AF0B5965E553667D44F735BB6FBF50C200EF72F842BEEF8247561898258CE1B91B03FA181BEB +224: 01F15A3254772AF6633FF9071244E79F2A5A5245B01DE8EA96BB83D4EEA7358BF2A5D605D9444E8FBB603A93E3FA3533 +225: 23CB6BF2EDE9199F57324CB43E9DB7A1E8FADF8997295DAB095297108DE429A6594DD9B80EB8BEA86E5D5D3C16A3E8FA +226: BAAA44617DEB6EC6F686D609337BFA50278CFD4E7DDC18F674A604151EB26D1D2904BEF0F928CB45E263321B0EAD96B6 +227: 2869DE18E00085B176BCBD60DB172EC57B6DF786F0E6AD675773F5923516B35F87868579DFCB7C640CB350ACF4BA661E +228: C71EC380475733D52C6D05F37A5356DD4B695C83B7893EE1F46DCE48AFB039112C5A23A11A8898AC5C7F9149C2681608 +229: 4BA5FCBB593DF2612912E0910DD1B42CA8566F643B7F80BB92B79079C42F787936E0CD4CBD12C2315B1D4264B4D40C20 +230: 3252104DB29CC76745BA21B7F77F994E68780C7A0C3679C291C7F02BD8A9719A0F7ADEC42930B6EC3DBEA0F1723016A5 +231: DA9B50C254272DE5EF502DB79D01D7685097C469B523910842213034458E9051A74C3E040778AFCD75D8598E636EA184 +232: 5D075E4C4B7A0CFDC184A2EAFD1B3E9223E21020DD04DF20F5964A8233C5A7FFC5C623AAC2AB5A1F02EA8D1A5031F593 +233: 16129C669BD55B939C1FB73215E79D43D47052A1EF756D439814B4DCC6C7FEE6E8A8925758CC9EFA3AEEE49989590554 +234: 06173DEE9A8BE76CDE992894F06D26A70A5284F120AB05BD887F6024B518A6137DE60D0158D7C34F4E1F85A6DDC20AB7 +235: 2E5468C9269C522E7A246039CE96F0491F97643776F41A2A70C8958E139D2FD106B952E8A5D766783FDC7A740F0958FA +236: 893C17BE1F39231F4C98321B0473B04E2CB421E5F6A0D9A22FF1D6E0B46884A52CB8721014280B39C5DA17E5F6CC5EB6 +237: FE61D7BAC3A3159E2F76D090871529ED846584D5710048912D75BB99674E595FD3D483B665287A86AAC5A58D6B1138D5 +238: 2ABC3C3D615EDCCC0235D36815DB403378E957BFF9AB44E4D2C94B9D5890BEB3F6C58C4BC6161D302E70AFE6B8736482 +239: 4C592636F932BCCEE6B161ABF1A565543A89CA6C7CABD2E3A3547267D1AA0732C76FE1677AE9888DD919B00A14C3F5FC +240: 1B06997AA47379409CA92F969366FF92AE888201B22ECADFB644EF6B3F8417AC220FA338F4CD6C9B08996F0CBFDEE947 +241: 8917996EFCA60051306B4D1992911CDFF4926746BFB41768A5EB407A2F2A492869F1C404EFF07B3FFBA03C928195EA3A +242: 5FC13C39D40A4528EEBEC469AE57F32F1BC8C4E36555CE49618CFD3E74ADE57CB8D023A07B8B599076ADAB673073390A +243: F66A41D3FDC709E33E6511E329799164BB18FAA44930F47BD6DF4472C5BABB1A41A514BA76F89825265C43DE407EAD03 +244: 7B23F639B5704B57AB3459FFBAE5434D6E1D913494C64081A51613B147C94E6585C8DD0C2E887835BD147DD59BBF72DB +245: 10E3C81532095BD18D7252708CD19FA796A43EE417721CFFD047FF54598C38A69389B357E14AFE69703A5863336660D7 +246: 6C015B143565592127A5D9E9C90766946CBF83388817B0C26E605C03A4637BCA7F3975BD34712177B4B7A5313BE4ED5A +247: C8F8F0A269FACC4D325F1388CA71998FF730415D6E34B76E3ED046B6CA3066B26F0C355417CD261BEF4898E0567C05D2 +248: DF7F3CD66B7DCDCC6089E2D51C27561AC5FDD261B61ECE80ED067C35B146610998BCF693FE3466DAD5C92BCE663D18EC +249: 30EBA9B4F06B52C4A2C4791972588AA2F2DA6D606D6445FBFFC00477BD69D5106070F5049A0B5CEDAA93506AD7E0B84D +250: 82A241F49733D9909BC3B7881E7337AD00CE85FD8BF7D8B8F531767E48EEA606A04FA75E038692E98B89BD8D673CFA82 +251: E9B1E02B6F1E2EF5902BFDE2A3327F960AA97B5D585CCF621F1A509FA02C280EC6BFCC13B293975AE9727A818A7658F9 +252: D931609260468BF52988D10632B2844FCADBB1410536FE332301107E0512DBDF48159C6928A7E05D4018D2B474EBF927 +253: E401AF666582970D7EEFEF6CDC74101859CF6A14371F4E650D1CA5C0E50E5D960B6D5835F170DA9274C3E55BA6BDF6A4 +254: 98154F1CF4569B9C64DBDC42C629637185CFA820502B4262B1EA6C0F782F9A1187D23D300F7B9DA8AEA07FE985490F81 +255: CBC5A8273028CE5CF0EBE5651C5910ECF16B6F18E4DD28749A72C0DCF2110DCA0A7BEA48512A9EE96277AB0F8A12A3CB +256: 9BD2B1BF7A89613FDCC76A3E02DABE81772A97BD5E6274FD9FE72E219BFFE88C5E6F681A31481485DCB85DFA34BDC657 + +Hash: blake2b-512 + 0: 786A02F742015903C6C6FD852552D272912F4740E15847618A86E217F71F5419D25E1031AFEE585313896444934EB04B903A685B1448B755D56F701AFE9BE2CE + 1: 2FA3F686DF876995167E7C2E5D74C4C7B6E48F8068FE0E44208344D480F7904C36963E44115FE3EB2A3AC8694C28BCB4F5A0F3276F2E79487D8219057A506E4B + 2: 1C08798DC641ABA9DEE435E22519A4729A09B2BFE0FF00EF2DCD8ED6F8A07D15EAF4AEE52BBF18AB5608A6190F70B90486C8A7D4873710B1115D3DEBBB4327B5 + 3: 40A374727302D9A4769C17B5F409FF32F58AA24FF122D7603E4FDA1509E919D4107A52C57570A6D94E50967AEA573B11F86F473F537565C66F7039830A85D186 + 4: 77DDF4B14425EB3D053C1E84E3469D92C4CD910ED20F92035E0C99D8A7A86CECAF69F9663C20A7AA230BC82F60D22FB4A00B09D3EB8FC65EF547FE63C8D3DDCE + 5: CBAA0BA7D482B1F301109AE41051991A3289BC1198005AF226C5E4F103B66579F461361044C8BA3439FF12C515FB29C52161B7EB9C2837B76A5DC33F7CB2E2E8 + 6: F95D45CF69AF5C2023BDB505821E62E85D7CAEDF7BEDA12C0248775B0C88205EEB35AF3A90816F6608CE7DD44EC28DB1140614E1DDEBF3AA9CD1843E0FAD2C36 + 7: 8F945BA700F2530E5C2A7DF7D5DCE0F83F9EFC78C073FE71AE1F88204A4FD1CF70A073F5D1F942ED623AA16E90A871246C90C45B621B3401A5DDBD9DF6264165 + 8: E998E0DC03EC30EB99BB6BFAAF6618ACC620320D7220B3AF2B23D112D8E9CB1262F3C0D60D183B1EE7F096D12DAE42C958418600214D04F5ED6F5E718BE35566 + 9: 6A9A090C61B3410AEDE7EC9138146CEB2C69662F460C3DA53C6515C1EB31F41CA3D280E567882F95CF664A94147D78F42CFC714A40D22EF19470E053493508A2 + 10: 29102511D749DB3CC9B4E335FA1F5E8FACA8421D558F6A3F3321D50D044A248BA595CFC3EFD3D2ADC97334DA732413F5CBF4751C362BA1D53862AC1E8DABEEE8 + 11: C97A4779D47E6F77729B5917D0138ABB35980AB641BD73A8859EB1AC98C05362ED7D608F2E9587D6BA9E271D343125D40D933A8ED04EC1FE75EC407C7A53C34E + 12: 10F0DC91B9F845FB95FAD6860E6CE1ADFA002C7FC327116D44D047CD7D5870D772BB12B5FAC00E02B08AC2A0174D0446C36AB35F14CA31894CD61C78C849B48A + 13: DEA9101CAC62B8F6A3C650F90EEA5BFAE2653A4EAFD63A6D1F0F132DB9E4F2B1B662432EC85B17BCAC41E775637881F6AAB38DD66DCBD080F0990A7A6E9854FE + 14: 441FFAA08CD79DFF4AFC9B9E5B5620EEC086730C25F661B1D6FBFBD1CEC3148DD72258C65641F2FCA5EB155FADBCABB13C6E21DC11FAF72C2A281B7D56145F19 + 15: 444B240FE3ED86D0E2EF4CE7D851EDDE22155582AA0914797B726CD058B6F45932E0E129516876527B1DD88FC66D7119F4AB3BED93A61A0E2D2D2AEAC336D958 + 16: BFBABBEF45554CCFA0DC83752A19CC35D5920956B301D558D772282BC867009168E9E98606BB5BA73A385DE5749228C925A85019B71F72FE29B3CD37CA52EFE6 + 17: 9C4D0C3E1CDBBF485BEC86F41CEC7C98373F0E09F392849AAA229EBFBF397B22085529CB7EF39F9C7C2222A514182B1EFFAA178CC3687B1B2B6CBCB6FDEB96F8 + 18: 477176B3BFCBADD7657C23C24625E4D0D674D1868F006006398AF97AA41877C8E70D3D14C3BBC9BBCDCEA801BD0E1599AF1F3EEC67405170F4E26C964A57A8B7 + 19: A78C490EDA3173BB3F10DEE52F110FB1C08E0302230B85DDD7C11257D92DE148785EF00C039C0BB8EB9808A35B2D8C080F572859714C9D4069C5BCAF090E898E + 20: 58D023397BEB5B4145CB2255B07D74290B36D9FD1E594AFBD8EEA47C205B2EFBFE6F46190FAF95AF504AB072E36F6C85D767A321BFD7F22687A4ABBF494A689C + 21: 4001EC74D5A46FD29C2C3CDBE5D1B9F20E51A941BE98D2A4E1E2FBF866A672121DB6F81A514CFD10E7358D571BDBA48E4CE708B9D124894BC0B5ED554935F73A + 22: CCD1B22DAB6511225D2401EA2D8625D206A12473CC732B615E5640CEFFF0A4ADF971B0E827A619E0A80F5DB9CCD0962329010D07E34A2064E731C520817B2183 + 23: B4A0A9E3574EDB9E1E72AA31E39CC5F30DBF943F8CABC408449654A39131E66D718A18819143E3EA96B4A1895988A1C0056CF2B6E04F9AC19D657383C2910C44 + 24: 447BECAB16630608D39F4F058B16F7AF95B85A76AA0FA7CEA2B80755FB76E9C804F2CA78F02643C915FBF2FCE5E19DE86000DE03B18861815A83126071F8A37B + 25: 54E6DAB9977380A5665822DB93374EDA528D9BEB626F9B94027071CB26675E112B4A7FEC941EE60A81E4D2EA3FF7BC52CFC45DFBFE735A1C646B2CF6D6A49B62 + 26: 3EA62625949E3646704D7E3C906F82F6C028F540F5F72A794B0C57BF97B7649BFEB90B01D3CA3E829DE21B3826E6F87014D3C77350CB5A15FF5D468A81BEC160 + 27: 213CFE145C54A33691569980E5938C8883A46D84D149C8FF1A67CD287B4D49C6DA69D3A035443DB085983D0EFE63706BD5B6F15A7DA459E8D50A19093DB55E80 + 28: 5716C4A38F38DB104E494A0A27CBE89A26A6BB6F499EC01C8C01AA7CB88497E75148CD6EEE12A7168B6F78AB74E4BE749251A1A74C38C86D6129177E2889E0B6 + 29: 030460A98BDF9FF17CD96404F28FC304F2B7C04EAADE53677FD28F788CA22186B8BC80DD21D17F8549C711AFF0E514E19D4E15F5990252A03E082F28DC2052F6 + 30: 19E7F1CCEE88A10672333E390CF22013A8C734C6CB9EAB41F17C3C8032A2E4ACA0569EA36F0860C7A1AF28FA476840D66011168859334A9E4EF9CC2E61A0E29E + 31: 29F8B8C78C80F2FCB4BDF7825ED90A70D625FF785D262677E250C04F3720C888D03F8045E4EDF3F5285BD39D928A10A7D0A5DF00B8484AC2868142A1E8BEA351 + 32: 5C52920A7263E39D57920CA0CB752AC6D79A04FEF8A7A216A1ECB7115CE06D89FD7D735BD6F4272555DBA22C2D1C96E6352322C62C5630FDE0F4777A76C3DE2C + 33: 83B098F262251BF660064A9D3511CE7687A09E6DFBB878299C30E93DFB43A9314DB9A600337DB26EBEEDAF2256A96DABE9B29E7573AD11C3523D874DDE5BE7ED + 34: 9447D98AA5C9331352F43D3E56D0A9A9F9581865998E2885CC56DD0A0BD5A7B50595BD10F7529BCD31F37DC16A1465D594079667DA2A3FCB70401498837CEDEB + 35: 867732F2FEEB23893097561AC710A4BFF453BE9CFBEDBA8BA324F9D312A82D732E1B83B829FDCD177B882CA0C1BF544B223BE529924A246A63CF059BFDC50A1B + 36: F15AB26D4CDFCF56E196BB6BA170A8FCCC414DE9285AFD98A3D3CF2FB88FCBC0F19832AC433A5B2CC2392A4CE34332987D8D2C2BEF6C3466138DB0C6E42FA47B + 37: 2813516D68ED4A08B39D648AA6AACD81E9D655ECD5F0C13556C60FDF0D333EA38464B36C02BACCD746E9575E96C63014F074AE34A0A25B320F0FBEDD6ACF7665 + 38: D3259AFCA8A48962FA892E145ACF547F26923AE8D4924C8A531581526B04B44C7AF83C643EF5A0BC282D36F3FB04C84E28B351F40C74B69DC7840BC717B6F15F + 39: F14B061AE359FA31B989E30332BFE8DE8CC8CDB568E14BE214A2223B84CAAB7419549ECFCC96CE2ACEC119485D87D157D3A8734FC426597D64F36570CEAF224D + 40: 55E70B01D1FBF8B23B57FB62E26C2CE54F13F8FA2464E6EB98D16A6117026D8B90819012496D4071EBE2E59557ECE3519A7AA45802F9615374877332B73490B3 + 41: 25261EB296971D6E4A71B2928E64839C67D422872BF9F3C31993615222DE9F8F0B2C4BE8548559B4B354E736416E3218D4E8A1E219A4A6D43E1A9A521D0E75FC + 42: 08307F347C41294E34BB54CB42B1522D22F824F7B6E5DB50FDA096798E181A8F026FA27B4AE45D52A62CAF9D5198E24A4913C6671775B2D723C1239BFBF016D7 + 43: 1E5C62E7E9BFA1B118747A2DE08B3CA10112AF96A46E4B22C3FC06F9BFEE4EB5C49E057A4A4886234324572576BB9B5ECFDE0D99B0DE4F98EC16E4D1B85FA947 + 44: C74A77395FB8BC126447454838E561E962853DC7EB49A1E3CB67C3D0851F3E39517BE8C350AC910903D49CD2BFDF545C99316D0346170B739F0ADD5D533C2CFC + 45: 0DD57B423CC01EB2861391EB886A0D17079B933FC76EB3FC08A19F8A74952CB68F6BCDC644F77370966E4D13E80560BCF082EF0479D48FBBAB4DF03B53A4E178 + 46: 4D8DC3923EDCCDFCE70072398B8A3DA5C31FCB3EE3B645C85F717CBAEB4B673A19394425A585BFB464D92F1597D0B754D163F97CED343B25DB5A70EF48EBB34F + 47: F0A50553E4DFB0C4E3E3D3BA82034857E3B1E50918F5B8A7D698E10D242B0FB544AF6C92D0C3AAF9932220416117B4E78ECB8A8F430E13B82A5915290A5819C5 + 48: B15543F3F736086627CC5365E7E8988C2EF155C0FD4F428961B00D1526F04D6D6A658B4B8ED32C5D8621E7F4F8E8A933D9ECC9DD1B8333CBE28CFC37D9719E1C + 49: 7B4FA158E415FEF023247264CBBE15D16D91A44424A8DB707EB1E2033C30E9E1E7C8C0864595D2CB8C580EB47E9D16ABBD7E44E824F7CEDB7DEF57130E52CFE9 + 50: 60424FF23234C34DC9687AD502869372CC31A59380186BC2361C835D972F49666EB1AC69629DE646F03F9B4DB9E2ACE093FBFDF8F20AB5F98541978BE8EF549F + 51: 7406018CE704D84F5EB9C79FEA97DA345699468A350EE0B2D0F3A4BF2070304EA862D72A51C57D3064947286F531E0EAF7563702262E6C724ABF5ED8C8398D17 + 52: 14EF5C6D647B3BD1E6E32006C231199810DE5C4DC88E70240273B0EA18E651A3EB4F5CA3114B8A56716969C7CDA27E0C8DB832AD5E89A2DC6CB0ADBE7D93ABD1 + 53: 38CF6C24E3E08BCF1F6CF3D1B1F65B905239A3118033249E448113EC632EA6DC346FEEB2571C38BD9A7398B2221280328002B23E1A45ADAFFE66D93F6564EAA2 + 54: 6CD7208A4BC7E7E56201BBBA02A0F489CD384ABE40AFD4222F158B3D986EE72A54C50FB64FD4ED2530EDA2C8AF2928A0DA6D4F830AE1C9DB469DFD970F12A56F + 55: 659858F0B5C9EDAB5B94FD732F6E6B17C51CC096104F09BEB3AFC3AA467C2ECF885C4C6541EFFA9023D3B5738AE5A14D867E15DB06FE1F9D1127B77E1AABB516 + 56: 26CCA0126F5D1A813C62E5C71001C046F9C92095704550BE5873A495A999AD010A4F79491F24F286500ADCE1A137BC2084E4949F5B7294CEFE51ECAFF8E95CBA + 57: 4147C1F55172788C5567C561FEEF876F621FFF1CE87786B8467637E70DFBCD0DBDB6415CB600954AB9C04C0E457E625B407222C0FE1AE21B2143688ADA94DC58 + 58: 5B1BF154C62A8AF6E93D35F18F7F90ABB16A6EF0E8D1AECD118BF70167BAB2AF08935C6FDC0663CE74482D17A8E54B546D1C296631C65F3B522A515839D43D71 + 59: 9F600419A4E8F4FB834C24B0F7FC13BF4E279D98E8A3C765EE934917403E3A66097182EA21453CB63EBBE8B73A9C2167596446438C57627F330BADD4F569F7D6 + 60: 457EF6466A8924FD8011A34471A5A1AC8CCD9BD0D07A97414AC943021CE4B9E4B9C8DB0A28F016ED43B1542481990022147B313E194671131E708DD43A3ED7DC + 61: 9997B2194D9AF6DFCB9143F41C0ED83D3A3F4388361103D38C2A49B280A581212715FD908D41C651F5C715CA38C0CE2830A37E00E508CED1BCDC320E5E4D1E2E + 62: 5C6BBF16BAA180F986BD40A1287ED4C549770E7284858FC47BC21AB95EBBF3374B4EE3FD9F2AF60F3395221B2ACC76F2D34C132954049F8A3A996F1E32EC84E5 + 63: D10BF9A15B1C9FC8D41F89BB140BF0BE08D2F3666176D13BAAC4D381358AD074C9D4748C300520EB026DAEAEA7C5B158892FDE4E8EC17DC998DCD507DF26EB63 + 64: 2FC6E69FA26A89A5ED269092CB9B2A449A4409A7A44011EECAD13D7C4B0456602D402FA5844F1A7A758136CE3D5D8D0E8B86921FFFF4F692DD95BDC8E5FF0052 + 65: FCBE8BE7DCB49A32DBDF239459E26308B84DFF1EA480DF8D104EEFF34B46FAE98627B450C2267D48C0946A697C5B59531452AC0484F1C84E3A33D0C339BB2E28 + 66: A19093A6E3BCF5952F850F2030F69B9606F147F90B8BAEE3362DA71D9F35B44EF9D8F0A7712BA1877FDDCD2D8EA8F1E5A773D0B745D4725605983A2DE901F803 + 67: 3C2006423F73E268FA59D2920377EB29A4F9A8B462BE15983EE3B85AE8A78E992633581A9099893B63DB30241C34F643027DC878279AF5850D7E2D4A2653073A + 68: D0F2F2E3787653F77CCE2FA24835785BBD0C433FC779465A115149905A9DD1CB827A628506D457FCF124A0C2AEF9CE2D2A0A0F63545570D8667FF9E2EBA07334 + 69: 78A9FC048E25C6DCB5DE45667DE8FFDD3A93711141D594E9FA62A959475DA6075EA8F0916E84E45AD911B75467077EE52D2C9AEBF4D58F20CE4A3A00458B05D4 + 70: 45813F441769AB6ED37D349FF6E72267D76AE6BB3E3C612EC05C6E02A12AF5A37C918B52BF74267C3F6A3F183A8064FF84C07B193D08066789A01ACCDB6F9340 + 71: 956DA1C68D83A7B881E01B9A966C3C0BF27F68606A8B71D457BD016D4C41DD8A380C709A296CB4C6544792920FD788835771A07D4A16FB52ED48050331DC4C8B + 72: DF186C2DC09CAA48E14E942F75DE5AC1B7A21E4F9F072A5B371E09E07345B0740C76177B01278808FEC025EDED9822C122AFD1C63E6F0CE2E32631041063145C + 73: 87475640966A9FDCD6D3A3B5A2CCA5C08F0D882B10243C0EC1BF3C6B1C37F2CD3212F19A057864477D5EAF8FAED73F2937C768A0AF415E84BBCE6BD7DE23B660 + 74: C3B573BBE10949A0FBD4FF884C446F2229B76902F9DFDBB8A0353DA5C83CA14E8151BBAAC82FD1576A009ADC6F1935CF26EDD4F1FB8DA483E6C5CD9D8923ADC3 + 75: B09D8D0BBA8A7286E43568F7907550E42036D674E3C8FC34D8CA46F771D6466B70FB605875F6A863C877D12F07063FDC2E90CCD459B1910DCD52D8F10B2B0A15 + 76: AF3A22BF75B21ABFB0ACD54422BA1B7300A952EFF02EBEB65B5C234471A98DF32F4F9643CE1904108A168767924280BD76C83F8C82D9A79D9259B195362A2A04 + 77: BF4FF2221B7E6957A724CD964AA3D5D0D9941F540413752F4699D8101B3E537508BF09F8508B317736FFD265F2847AA7D84BD2D97569C49D632AED9945E5FA5E + 78: 9C6B6B78199B1BDACB4300E31479FA622A6B5BC80D4678A6078F88A8268CD7206A2799E8D4621A464EF6B43DD8ADFFE97CAF221B22B6B8778B149A822AEFBB09 + 79: 890656F09C99D280B5ECB381F56427B813751BC652C7828078B23A4AF83B4E3A61FDBAC61F89BEE84EA6BEE760C047F25C6B0A201C69A38FD6FD971AF18588BB + 80: 31A046F7882FFE6F83CE472E9A0701832EC7B3F76FBCFD1DF60FE3EA48FDE1651254247C3FD95E100F9172731E17FD5297C11F4BB328363CA361624A81AF797C + 81: 27A60B2D00E7A671D47D0AEC2A686A0AC04B52F40AB6629028EB7D13F4BAA99AC0FE46EE6C814944F2F4B4D20E9378E4847EA44C13178091E277B87EA7A55711 + 82: 8B5CCEF194162C1F19D68F91E0B0928F289EC5283720840C2F73D253111238DCFE94AF2B59C2C1CA2591901A7BC060E7459B6C47DF0F71701A35CC0AA831B5B6 + 83: 57AB6C4B2229AEB3B70476D803CD63812F107CE6DA17FED9B17875E8F86C724F49E024CBF3A1B8B119C50357652B81879D2ADE2D588B9E4F7CEDBA0E4644C9EE + 84: 0190A8DAC320A739F322E15731AA140DDAF5BED294D5C82E54FEF29F214E18AAFAA84F8BE99AF62950266B8F901F15DD4C5D35516FC35B4CAB2E96E4695BBE1C + 85: D14D7C4C415EEB0E10B159224BEA127EBD84F9591C702A330F5BB7BB7AA44EA39DE6ED01F18DA7ADF40CFB97C5D152C27528824B21E239526AF8F36B214E0CFB + 86: BE28C4BE706970488FAC7D29C3BD5C4E986085C4C3332F1F3FD30973DB614164BA2F31A78875FFDC150325C88327A9443ED04FDFE5BE93876D1628560C764A80 + 87: 031DA1069E3A2E9C3382E436FFD79DF74B1CA6A8ADB2DEABE676AB45994CBC054F037D2F0EACE858D32C14E2D1C8B46077308E3BDC2C1B53172ECF7A8C14E349 + 88: 4665CEF8BA4DB4D0ACB118F2987F0BB09F8F86AA445AA3D5FC9A8B346864787489E8FCECC125D17E9B56E12988EAC5ECC7286883DB0661B8FF05DA2AFFF30FE4 + 89: 63B7032E5F930CC9939517F9E986816CFBEC2BE59B9568B13F2EAD05BAE7777CAB620C6659404F7409E4199A3BE5F7865AA7CBDF8C4253F7E8219B1BD5F46FEA + 90: 9F09BF093A2B0FF8C2634B49E37F1B2135B447AA9144C9787DBFD92129316C99E88AAB8A21FDEF2372D1189AEC500F95775F1F92BFB45545E4259FB9B7B02D14 + 91: F9F8493C68088807DF7F6A2693D64EA59F03E9E05A223E68524CA32195A4734B654FCEA4D2734C866CF95C889FB10C49159BE2F5043DC98BB55E02EF7BDCB082 + 92: 3C9A7359AB4FEBCE07B20AC447B06A240B7FE1DAE5439C49B60B5819F7812E4C172406C1AAC316713CF0DDED1038077258E2EFF5B33913D9D95CAEB4E6C6B970 + 93: AD6AAB8084510E822CFCE8625D62CF4DE655F4763884C71E80BAB9AC9D5318DBA4A6033ED29084E65216C031606CA17615DCFE3BA11D26851AE0999CA6E232CF + 94: 156E9E6261374C9DC884F36E70F0FE1AB9297997B836FA7D170A9C9EBF575B881E7BCEA44D6C0248D35597907154828955BE19135852F9228815ECA024A8ADFB + 95: 4215407633F4CCA9B6788BE93E6AA3D963C7D6CE4B147247099F46A3ACB500A30038CB3E788C3D29F132AD844E80E9E99251F6DB96ACD8A091CFC770AF53847B + 96: 1C077E279DE6548523502B6DF800FFDAB5E2C3E9442EB838F58C295F3B147CEF9D701C41C321283F00C71AFFA0619310399126295B78DD4D1A74572EF9ED5135 + 97: F07A555F49FE481CF4CD0A87B71B82E4A95064D06677FDD90A0EB598877BA1C83D4677B393C3A3B6661C421F5B12CB99D20376BA7275C2F3A8F5A9B7821720DA + 98: B5911B380D20C7B04323E4026B38E200F534259233B581E02C1E3E2D8438D6C66D5A4EB201D5A8B75072C4EC29106334DA70BC79521B0CED2CFD533F5FF84F95 + 99: 01F070A09BAE911296361F91AA0E8E0D09A7725478536D9D48C5FE1E5E7C3C5B9B9D6EB07796F6DA57AE562A7D70E882E37ADFDE83F0C433C2CD363536BB22C8 +100: 6F793EB4374A48B0775ACAF9ADCF8E45E54270C9475F004AD8D5973E2ACA52747FF4ED04AE967275B9F9EB0E1FF75FB4F794FA8BE9ADD7A41304868D103FAB10 +101: 965F20F139765FCC4CE4BA3794675863CAC24DB472CD2B799D035BCE3DBEA502DA7B524865F6B811D8C5828D3A889646FE64A380DA1AA7C7044E9F245DCED128 +102: EC295B5783601244C30E4641E3B45BE222C4DCE77A58700F53BC8EC52A941690B4D0B087FB6FCB3F39832B9DE8F75EC20BD43079811749CDC907EDB94157D180 +103: 61C72F8CCC91DBB54CA6750BC489672DE09FAEDB8FDD4F94FF2320909A303F5D5A98481C0BC1A625419FB4DEBFBF7F8A53BB07EC3D985E8EA11E72D559940780 +104: AFD8145B259EEFC8D12620C3C5B03E1ED8FD2CCEFE0365078C80FD42C1770E28B44948F27E65A1886690110DB814397B68E43D80D1BA16DFA358E739C898CFA3 +105: 552FC7893CF1CE933ADA35C0DA98844E41545E244C3157A1428D7B4C21F9CD7E4071AED77B7CA9F1C38FBA32237412EF21A342742EC8324378F21E507FAFDD88 +106: 467A33FBADF5EBC52596EF86AAAEFC6FABA8EE651B1CE04DE368A03A5A9040EF2835E00ADB09ABB3FBD2BCE818A2413D0B0253B5BDA4FC5B2F6F85F3FD5B55F2 +107: 22EFF8E6DD5236F5F57D94EDE874D6C9428E8F5D566F17CD6D1848CD752FE13C655CB10FBAAFF76872F2BF2DA99E15DC624075E1EC2F58A3F64072121838569E +108: 9CEC6BBF62C4BCE4138ABAE1CBEC8DAD31950444E90321B1347196834C114B864AF3F3CC3508F83751FFB4EDA7C84D140734BB4263C3625C00F04F4C8068981B +109: A8B60FA4FC2442F6F1514AD7402626920CC7C2C9F72124B8CBA8EE2CB7C4586F658A4410CFFCC0AB88343955E094C6AF0D20D0C714FB0A988F543F300F58D389 +110: 8271CC45DFA5E4170E847E8630B952CF9C2AA777D06F26A7585B8381F188DACC7337391CFCC94B053DC4EC29CC17F077870428F1AC23FDDDA165EF5A3F155F39 +111: BF23C0C25C8060E4F6995F1623A3BEBECAA96E308680000A8AA3CD56BB1A6DA099E10D9231B37F4519B2EFD2C24DE72F31A5F19535241B4A59FA3C03CEB790E7 +112: 877FD652C05281009C0A5250E7A3A671F8B18C108817FE4A874DE22DA8E45DB11958A600C5F62E67D36CBF84474CF244A9C2B03A9FB9DC711CD1A2CAB6F3FAE0 +113: 29DF4D87EA444BAF5BCDF5F4E41579E28A67DE84149F06C03F110EA84F572A9F676ADDD04C4878F49C5C00ACCDA441B1A387CACEB2E993BB7A10CD8C2D6717E1 +114: 710DACB166844639CD7B637C274209424E2449DC35D790BBFA4F76177054A36B3B76FAC0CA6E61DF1E687000678AC0746DF75D0A3954897681FD393A155A1BB4 +115: C1D5F93B8DEA1F2571BABCCBC01764541A0CDA87E444D673C50966CA559C33354B3ACB26E5D5781FFB28847A4B4754D77008C62A835835F500DEA7C3B58BDAE2 +116: A41E41271CDAB8AF4D72B104BFB2AD041AC4DF14677DA671D85640C4B187F50C2B66513C4619FBD5D5DC4FE65DD37B9042E9848DDA556A504CAA2B1C6AFE4730 +117: E7BCBACDC379C43D81EBADCB37781552FC1D753E8CF310D968392D06C91F1D64CC9E90CE1D22C32D277FC6CDA433A4D442C762E9EACF2C259F32D64CF9DA3A22 +118: 51755B4AC5456B13218A19C5B9242F57C4A981E4D4ECDCE09A3193362B808A579345D4881C2607A56534DD7F21956AFF72C2F4173A6E7B6CC2212BA0E3DAEE1F +119: DCC2C4BEB9C1F2607B786C20C631972347034C1CC02FCC7D02FF01099CFE1C6989840AC213923629113AA8BAD713CCF0FE4CE13264FB32B8B0FE372DA382544A +120: 3D55176ACEA4A7E3A65FFA9FB10A7A1767199CF077CEE9F71532D67CD7C73C9F93CFC37CCDCC1FDEF50AAD46A504A650D298D597A3A9FA95C6C40CB71FA5E725 +121: D07713C005DE96DD21D2EB8BBECA66746EA51A31AE922A3E74864889540A48DB27D7E4C90311638B224BF0201B501891754848113C266108D0ADB13DB71909C7 +122: 58983C21433D950CAA23E4BC18543B8E601C204318532152DAF5E159A0CD1480183D29285C05F129CB0CC3164687928086FFE380158DF1D394C6AC0D4288BCA8 +123: 8100A8DC528D2B682AB4250801BA33F02A3E94C54DAC0AE1482AA21F51EF3A82F3807E6FACB0AEB05947BF7AA2ADCB034356F90FA4560EDE02201A37E411EC1A +124: 07025F1BB6C784F3FE49DE5C14B936A5ACACACAAB33F6AC4D0E00AB6A12483D6BEC00B4FE67C7CA5CC508C2A53EFB5BFA5398769D843FF0D9E8B14D36A01A77F +125: BA6AEFD972B6186E027A76273A4A723321A3F580CFA894DA5A9CE8E721C828552C64DACEE3A7FD2D743B5C35AD0C8EFA71F8CE99BF96334710E2C2346E8F3C52 +126: E0721E02517AEDFA4E7E9BA503E025FD46E714566DC889A84CBFE56A55DFBE2FC4938AC4120588335DEAC8EF3FA229ADC9647F54AD2E3472234F9B34EFC46543 +127: B6292669CCD38D5F01CAAE96BA272C76A879A45743AFA0725D83B9EBB26665B731F1848C52F11972B6644F554C064FA90780DBBBF3A89D4FC31F67DF3E5857EF +128: 2319E3789C47E2DAA5FE807F61BEC2A1A6537FA03F19FF32E87EECBFD64B7E0E8CCFF439AC333B040F19B0C4DDD11A61E24AC1FE0F10A039806C5DCC0DA3D115 +129: F59711D44A031D5F97A9413C065D1E614C417EDE998590325F49BAD2FD444D3E4418BE19AEC4E11449AC1A57207898BC57D76A1BCF3566292C20C683A5C4648F +130: DF0A9D0C212843A6A934E3902B2DD30D17FBA5F969D2030B12A546D8A6A45E80CF5635F071F0452E9C919275DA99BED51EB1173C1AF0518726B75B0EC3BAE2B5 +131: A3EB6E6C7BF2FB8B28BFE8B15E15BB500F781ECC86F778C3A4E655FC5869BF2846A245D4E33B7B14436A17E63BE79B36655C226A50FFBC7124207B0202342DB5 +132: 56D4CBCD070563426A017069425C2CD2AE540668287A5FB9DAC432EB8AB1A353A30F2FE1F40D83333AFE696A267795408A92FE7DA07A0C1814CF77F36E105EE8 +133: E59B9987D428B3EDA37D80ABDB16CD2B0AEF674C2B1DDA4432EA91EE6C935C684B48B4428A8CC740E579A30DEFF35A803013820DD23F14AE1D8413B5C8672AEC +134: CD9FCC99F99D4CC16D031900B2A736E1508DB4B586814E6345857F354A70CCECB1DF3B50A19ADAF43C278EFA423FF4BB6C523EC7FD7859B97B168A7EBFF8467C +135: 0602185D8C3A78738B99164B8BC6FFB21C7DEBEBBF806372E0DA44D121545597B9C662A255DC31542CF995ECBE6A50FB5E6E0EE4EF240FE557EDED1188087E86 +136: C08AFA5B927BF08097AFC5FFF9CA4E7800125C1F52F2AF3553FA2B89E1E3015C4F87D5E0A48956AD31450B083DAD147FFB5EC03434A26830CF37D103AB50C5DA +137: 36F1E1C11D6EF6BC3B536D505D544A871522C5C2A253067EC9933B6EC25464DAF985525F5B9560A16D890259AC1BB5CC67C0C469CDE133DEF000EA1D686F4F5D +138: BF2AB2E2470F5438C3B689E66E7686FFFA0CB1E1798AD3A86FF99075BF6138E33D9C0CE59AFB24AC67A02AF34428191A9A0A6041C07471B7C3B1A752D6FC0B8B +139: D400601F9728CCC4C92342D9787D8D28AB323AF375CA5624B4BB91D17271FBAE862E413BE73F1F68E615B8C5C391BE0DBD9144746EB339AD541547BA9C468A17 +140: 79FE2FE157EB85A038ABB8EBBC647731D2C83F51B0AC6EE14AA284CB6A3549A4DCCEB300740A825F52F5FB30B03B8C4D8B0F4AA67A63F4A94E3303C4EDA4C02B +141: 75351313B52A8529298D8C186B1768666DCCA8595317D7A4816EB88C062020C0C8EFC554BB341B64688DB5CCAFC35F3C3CD09D6564B36D7B04A248E146980D4B +142: E3128B1D311D02179D7F25F97A5A8BEE2CC8C86303644FCD664E157D1FEF00F23E46F9A5E8E5C890CE565BB6ABD4302CE06469D52A5BD53E1C5A54D04649DC03 +143: C2382A72D2D3ACE9D5933D00B60827ED380CDA08D0BA5F6DD41E29EE6DBE8ECB9235F06BE95D83B6816A2FB7A5AD47035E8A4B69A4884B99E4BECE58CAB25D44 +144: 6B1C69460BBD50AC2ED6F32E6E887CFED407D47DCF0AAA60387FE320D780BD03EAB6D7BAEB2A07D10CD552A300341354EA9A5F03183A623F92A2D4D9F00926AF +145: 6CDA206C80CDC9C44BA990E0328C314F819B142D00630404C48C05DC76D1B00CE4D72FC6A48E1469DDEF609412C364820854214B4869AF090F00D3C1BA443E1B +146: 7FFC8C26FBD6A0F7A609E6E1939F6A9EDF1B0B066641FB76C4F9602ED748D11602496B35355B1AA255850A509D2F8EE18C8F3E1D7DCBC37A136598F56A59ED17 +147: 70DE1F08DD4E09D5FC151F17FC991A23ABFC05104290D50468882EFAF582B6EC2F14F577C0D68C3AD06626916E3C86E6DAAB6C53E5163E82B6BD0CE49FC0D8DF +148: 4F81935756ED35EE2058EE0C6A6110D6FAC5CB6A4F46AA9411603F99965823B6DA4838276C5C06BC7880E376D92758369EE7305BCEC8D3CFD28CCABB7B4F0579 +149: ABCB61CB3683D18F27AD527908ED2D32A0426CB7BB4BF18061903A7DC42E7E76F982382304D18AF8C80D91DD58DD47AF76F8E2C36E28AF2476B4BCCF82E89FDF +150: 02D261AD56A526331B643DD2186DE9A82E72A58223CD1E723686C53D869B83B94632B7B647AB2AFC0D522E29DA3A5615B741D82852E0DF41B66007DBCBA90543 +151: C5832741FA30C5436823015383D297FF4C4A5D7276C3F902122066E04BE5431B1A85FAF73B918434F9300963D1DEA9E8AC3924EF490226EDEEA5F743E410669F +152: CFAEAB268CD075A5A6AED515023A032D54F2F2FF733CE0CBC78DB51DB4504D675923F82746D6594606AD5D67734B11A67CC6A468C2032E43CA1A94C6273A985E +153: 860850F92EB268272B67D133609BD64E34F61BF03F4C1738645C17FEC818465D7ECD2BE2907641130025FDA79470AB731646E7F69440E8367EA76AC4CEE8A1DF +154: 84B154ED29BBEDEFA648286839046F4B5AA34430E2D67F7496E4C39F2C7EA78995F69E1292200016F16AC3B37700E6C7E7861AFC396B64A59A1DBF47A55C4BBC +155: AEEEC260A5D8EFF5CCAB8B95DA435A63ED7A21EA7FC7559413FD617E33609F8C290E64BBACC528F6C080262288B0F0A3219BE223C991BEE92E72349593E67638 +156: 8AD78A9F26601D127E8D2F2F976E63D19A054A17DCF59E0F013AB54A6887BBDFFDE7AAAE117E0FBF3271016595B9D9C712C01B2C53E9655A382BC4522E616645 +157: 8934159DADE1AC74147DFA282C75954FCEF443EF25F80DFE9FB6EA633B8545111D08B34EF43FFF17026C7964F5DEAC6D2B3C29DACF2747F022DF5967DFDC1A0A +158: CD36DD0B240614CF2FA2B9E959679DCDD72EC0CD58A43DA3790A92F6CDEB9E1E795E478A0A47D371100D340C5CEDCDBBC9E68B3F460818E5BDFF7B4CDA4C2744 +159: 00DF4E099B807137A85990F49D3A94315E5A5F7F7A6076B303E96B056FB93800111F479628E2F8DB59AEB6AC70C3B61F51F9B46E80FFDEAE25EBDDB4AF6CB4EE +160: 2B9C955E6CAED4B7C9E246B86F9A1726E810C59D126CEE66ED71BF015B83558A4B6D84D18DC3FF4620C2FFB722359FDEF85BA0D4E2D22ECBE0ED784F99AFE587 +161: 181DF0A261A2F7D29EA5A15772715105D450A4B6C236F699F462D60CA76487FEEDFC9F5EB92DF838E8FB5DC3694E84C5E0F4A10B761F506762BE052C745A6EE8 +162: 21FB203458BF3A7E9A80439F9A902899CD5DE0139DFD56F7110C9DEC8437B26BDA63DE2F565926D85EDB1D6C6825669743DD9992653D13979544D5DC8228BFAA +163: EF021F29C5FFB830E64B9AA9058DD660FD2FCB81C497A7E698BCFBF59DE5AD4A86FF93C10A4B9D1AE5774725F9072DCDE9E1F199BAB91F8BFF921864AA502EEE +164: B3CFDA40526B7F1D37569BDFCDF911E5A6EFE6B2EC90A0454C47B2C046BF130FC3B352B34DF4813D48D33AB8E269B69B075676CB6D00A8DCF9E1F967EC191B2C +165: B4C6C3B267071EEFB9C8C72E0E2B941293641F8673CB70C1CC26AD1E73CF141755860AD19B34C2F34ED35BB52EC4507CC1FE59047743A5F0C6FEBDE625E26091 +166: 57A34F2BCCA60D4B85103B830C9D7952A416BE5263AE429C9E5E53FE8590A8F78EC65A51109EA85DCDF7B6223F9F2B340539FAD81923DBF8EDABF95129E4DFF6 +167: 9CF46662FCD61A232277B685663B8B5DA832DFD9A3B8CCFEEC993EC6AC415AD07E048ADFE414DF272770DBA867DA5C1224C6FD0AA0C2187D426AC647E9887361 +168: 5CE1042AB4D542C2F9EE9D17262AF8164098935BEF173D0E18489B04841746CD2F2DF866BD7DA6E5EF9024C648023EC723AB9C62FD80285739D84F15D2AB515A +169: 8488396BD4A8729B7A473178F232DADF3F0F8E22678BA5A43E041E72DA1E2CF82194C307207A54CB8156293339EAEC693FF66BFCD5EFC65E95E4ECAF54530ABD +170: F598DA901C3835BCA560779037DFDE9F0C51DC61C0B760FC1522D7B470EE63F5BDC6498476E86049AD86E4E21AF2854A984CC905427D2F17F66B1F41C3DA6F61 +171: 5F93269798CF02132107337660A8D7A177354C0212EB93E555E7C37A08AEF3D8DCE01217011CD965C04DD2C105F2E2B6CAE5E4E6BCAF09DFBEE3E0A6A6357C37 +172: 0ECF581D47BAC9230986FAABD70C2F5B80E91066F0EC55A842937882286D2CA007BB4E973B0B091D52167FF7C4009C7AB4AD38FFF1DCEACDB7BE81EF4A452952 +173: 5AECA8ABE1528582B2A307B4009585498A3D467CA6101CB0C5126F9976056E9FFC123CC20C302B2A737F492C75D21F01512C90CA0541DFA56E950A321DCB28D8 +174: 732FBF8F1CB2B8329263EDE27858FE46F8D3354D376BCDA0548E7CE1FA9DD11F85EB661FE950B543AA635CA4D3F04EDE5B32D6B656E5CE1C44D35C4A6C56CFF8 +175: D5E938735D63788C80100AEFD18648D18CF272F69F20FF24CFE2895C088AD08B0104DA1672A4EB26FC52545CC7D7A01B266CF546C403C45BD129EB41BDD9200B +176: 65A245B49352EE297D91AF8C8BE00528AC6E046DD83AC7BD465A98816DD68F3E00E1AE8F895327A7E9A8C9326598379A29C9FC91EC0C6EEF08F3E2B216C11008 +177: C95654B63019130AB45DD0FB4941B98AEB3AF2A123913ECA2CE99B3E97410A7BF8661CC7FBAA2BC1CF2B13113B1ED40A0118B88E5FFFC3542759EA007ED4C58D +178: 1EB262F38FA494431F017DAD44C0DFB69324AC032F04B657FC91A88647BB74760F24E7C956514F0CF002990B182C1642B9B2426E96A61187E4E012F00E217D84 +179: 3B955AEEBFA5151AC1AB8E3F5CC1E3767084C842A575D36269836E97353D41622B731DDDCD5F269550A3A5B87BE1E90326340B6E0E62555815D9600597AC6EF9 +180: 68289F6605473BA0E4F241BAF7477A9885426A858F19EF2A18B0D40EF8E41282ED5526B519799E270F13881327918278755711071D8511FE963E3B5606AA3716 +181: 80A33787542612C38F6BCD7CD86CAB460227509B1CBAD5EC408A91413D51155A0476DADBF3A2518E4A6E77CC346622E347A469BF8BAA5F04EB2D98705355D063 +182: 34629BC6D831391C4CDF8AF1B4B7B6B8E8EE17CF98C70E5DD586CD99F14B11DF945166236A9571E6D591BB83EE4D164D46F6B9D8EF86FF865A81BFB91B00424B +183: 8B7CC339163863BB4383E542B0EF0E7CF36B84AD932CDF5A80419EC9AD692E7A7E784D2C7CB3796A18B8F800035F3AA06C824100611120A7BDEB35618CCB81B7 +184: 4F084E4939DD5A7F5A658FAD58A18A15C25C32EC1C7FD5C5C6C3E892B3971AEAAC308304EF17B1C47239EA4BB398B3FD6D4528D8DE8E768AE0F1A5A5C6B5C297 +185: 48F407A1AF5B8009B2051742E8CF5CD5656669E7D722EE8E7BD202060849442168D8FACC117C012BFB7BF449D99BEFFF6A34AEA203F1D8D352722BE5014EC818 +186: A6AA82CD1E426F9A73BFA39A29037876114655B8C22D6D3FF8B638AE7DEA6B17843E09E52EB66FA1E475E4A8A3DE429B7D0F4A776FCB8BDC9B9FEDE7D52E815F +187: 5817027D6BDD00C5DD10AC593CD560372270775A18526D7E6F13872A2E20EAB664625BE7168AC4BD7C9E0CE7FC4099E0F48442E2C767191C6E1284E9B2CCEA8C +188: 08E41028340A45C74E4052B3A8D6389E22E043A1ADAB5E28D97619450D723469B620CAA519B81C14523854F619FD3027E3847BD03276E60604A80DDB4DE876D6 +189: 130B8420537EB07D72ABDA07C85ACBD8B9A44F16321DD0422145F809673D30F2B5321326E2BFF317EF3FEF983C51C4F8AB24A325D298E34AFCE569A82555774C +190: AC49B844AFAA012E31C474CA263648844FD2F6307992C2F752ACA02C3828965175794DEEE2D2EE95C61CD284F6B5A2D75E2EF2B29EE8149E77FB81447B2FD04B +191: B9D7CA81CC60BB9578E44024E5A0A0BE80F27336A6A9F4E53DF3999CB191280B090E2AC2D29C5BAAD9D71415BDC129E69AA2667AF6A7FD5E189FCCDCEE817340 +192: A755E113386572C75CED61D719706070B9146048E42A9F8CD35667A088B42F08808ABDF77E618ABD959AFC757379CA2C00BCC1A48390FA2BFF618B1E0078A613 +193: A73C7DEBED326F1C0DB0795EE7D6E3946894B826B1F8101C56C823BA17168312E7F53FC7DBE52C3E11E69852C40485E2EF182477862EA6A34EC136E2DFEEA6F4 +194: 6CB8F9D52C56D82CAC28F39EA1593E8BB2506293AC0D68376A1709B62A46DF14A4AE64B2D8FAB76733A1CED2D548E3F3C6FCB49D40C3D5808E449CD83D1C2AA2 +195: 683FA2B2369A10162C1C1C7B24BC970EE67DA220564F32203F625696C0352A0B9AD96624362D952D84463C1106A2DBA7A092599884B35A0B89C8F1B6A9B5A61E +196: AAD9AD44610118B77D508AEB1BBCD1C1B7D0171397FB510A401BBC0EC34623670D86A2DC3C8F3AB5A2044DF730256727545F0860CE21A1EAC717DFC48F5D228E +197: C42578DE23B4C987D5E1AC4D689ED5DE4B0417F9704BC6BCE969FA13471585D62C2CB1212A944F397FC9CA2C3747C3BEB694EC4C5BE68828DDA53EF43FAEC6C0 +198: 470F00841EE8244E63ED2C7EA30E2E419897C197462ECCCECF713B42A5065FFF5914BC9B79AFFE8F6B657875E789AE213BD914CD35BD174D46E9D18BD843773D +199: 34FC4213730F47A5E9A3580F643E12945CFCB31BF206F6AD450CE528DA3FA432E005D6B0ECCE10DCA7C5995F6AACC5150E1B009E19751E8309F8859531844374 +200: FB3C1F0F56A56F8E316FDF5D853C8C872C39635D083634C3904FC3AC07D1B578E85FF0E480E92D44ADE33B62E893EE32343E79DDF6EF292E89B582D312502314 +201: C7C97FC65DD2B9E3D3D607D31598D3F84261E9919251E9C8E57BB5F829377D5F73EABBED55C6C381180F29AD02E5BE797FFEC7E57BDECBC50AD3D062F0993AB0 +202: A57A49CDBE67AE7D9F797BB5CC7EFC2DF07F4E1B15955F85DAE74B76E2ECB85AFB6CD9EEED8888D5CA3EC5AB65D27A7B19E578475760A045AC3C92E13A938E77 +203: C7143FCE9614A17FD653AEB140726DC9C3DBB1DE6CC581B2726897EC24B7A50359AD492243BE66D9EDD8C933B5B80E0B91BB61EA98056006516976FAE8D99A35 +204: 65BB58D07F937E2D3C7E65385F9C54730B704105CCDB691F6E146D4EE8F6C086F49511035110A9AD6031FDCEB943E0F9613BCB276DD40F0624EF0F924F809783 +205: E540277F683B1186DD3B5B3F61433396581A35FEB12002BE8C6A6231FC40FFA70F08081BC58B2D94F7649543614A435FAA2D62110E13DABC7B86629B63AF9C24 +206: 418500878C5FBCB584C432F4285E05E49F2E3E075399A0DBFCF874EBF8C03D02BF16BC6989D161C77CA0786B05053C6C709433712319192128835CF0B660595B +207: 889090DBB1944BDC9433EE5EF1010C7A4A24A8E71ECEA8E12A31318CE49DCAB0ACA5C3802334AAB2CC84B14C6B9321FE586BF3F876F19CD406EB1127FB944801 +208: 53B6A28910AA92E27E536FB549CF9B9918791060898E0B9FE183577FF43B5E9C7689C745B32E412269837C31B89E6CC12BF76E13CAD366B74ECE48BB85FD09E9 +209: 7C092080C6A80D672409D081D3D177106BCD63567785140719490950AE07AE8FCAABBAAAB330CFBCF7374482C220AF2EADEEB73DCBB35ED823344E144E7D4899 +210: 9CCDE566D2400509181111F32DDE4CD63209FE59A30C114546AD2776D889A41BAD8FA1BB468CB2F9D42CA9928A7770FEF8E8BA4D0C812D9A1E75C3D8D2CCD75A +211: 6E293BF5D03FE43977CFE3F57CCDB3AE282A85455DCA33F37F4B74F8398CC612433D755CBEC412F8F82A3BD3BC4A278F7ECD0DFA9BBDC40BE7A787C8F159B2DF +212: C56546FB2178456F336164C18B90DEFFC83AE2B5A3ACA77B6884D36D2C1DB39501B3E65E36C758C66E3188451FDB3515EE162C001F06C3E8CB573ADF30F7A101 +213: 6F82F89F299EBCA2FE014B59BFFE1AA84E88B1915FE256AFB646FD8448AF2B8891A7FAB37A4EA6F9A50E6C317039D8CF878F4C8E1A0DD464F0B4D6FF1C7EA853 +214: 2B8599FF9C3D6198637AD51E57D1998B0D75313FE2DD61A533C964A6DD9607C6F723E9452CE46E014B1C1D6DE77BA5B88C914D1C597BF1EAE13474B4290E89B2 +215: 08BF346D38E1DF06C8260EDB1DA75579275948D5C0A0AA9ED2886F8856DE5417A156998758F5B17E52F101CA957A71137473DFD18D7D209C4C10D9233C93691D +216: 6DF2156D773114D310B63DB9EE5350D77E6BCF25B05FCD910F9B31BC42BB13FE8225EBCB2A23A62280777B6BF74E2CD0917C7640B43DEFE468CD1E18C943C66A +217: 7C7038BC13A91151828A5BA82B4A96040F258A4DFB1B1373F0D359168AFB0517A20B28A12D3644046BE66B8D08D8AE7F6A923EA1C00187C6D11DC502BAC71305 +218: BCD1B30D808FB739B987CBF154BEA00DA9D40380B861D4C1D6377122DADD61C0E59018B71941CFB62E00DCD70AEB9ABF0473E80F0A7ECA6B6DEA246AB229DD2B +219: 7ED4468D968530FE7AB2C33540B26D8C3BD3ED44B34FBE8C2A9D7F805B5ADA0EA252EEADE4FCE97F89728AD85BC8BB2430B1BEF2CDDD32C8446E59B8E8BA3C67 +220: 6D30B7C6CE8A3236C0CA2F8D728B1088CA06983A8043E621D5DCF0C537D13B08791EDEB01A3CF0943EC1C890AB6E29B146A236CD46BCB9D93BF516FB67C63FE5 +221: 97FE03CEF31438508911BDED975980A66029305DC5E3FA8AD1B4FB22FCDF5A19A733320327D8F71CCF496CB3A44A77AF56E3DDE73D3A5F176896CC57C9A5AD99 +222: 785A9D0FBD21136DBCE8FA7EAFD63C9DAD220052978416B31D9753EAA149097847ED9B30A65C70507EFF01879149ED5CF0471D37798EDC05ABD56AD4A2CCCB1D +223: AD408D2ABDDFD37B3BF34794C1A3371D928ED7FC8D966225333584C5665817832A37C07F0DC7CB5AA874CD7D20FE8FAB8EABCB9B33D2E0841F6E200960899D95 +224: 97668F745B6032FC815D9579322769DCCD9501A5080029B8AE826BEFB6742331BD9F76EFEB3E2B8E81A9786B282F5068A3A2424697A77C41876B7E753F4C7767 +225: 26BB985F47E7FEE0CFD252D4EF96BED42B9C370C1C6A3E8C9EB04EF7F7818B833A0D1F043EBAFB911DC779E02740A02A44D3A1EA45ED4AD55E686C927CAFE97E +226: 5BFE2B1DCF7FE9B95088ACEDB575C19016C743B2E763BF5851AC407C9EDA43715EDFA48B4825492C5179593FFF21351B76E8B7E034E4C53C79F61F29C479BD08 +227: C76509EF72F4A6F9C9C40618ED52B2084F83502232E0AC8BDAF3264368E4D0180F6854C4ABF4F6509C79CAAFC44CF3194AFC57BD077BD7B3C9BDA3D4B8775816 +228: D66F2BEAB990E354CCB910E4E9C7AC618C7B63EF292A96B552341DE78DC46D3EC8CFABC699B50AF41FDA39CF1B0173660923510AD67FAEDEF5207CFFE8641D20 +229: 7D8F0672992B79BE3A364D8E5904F4AB713BBC8AB01B4F309AD8CCF223CE1034A860DCB0B00550612CC2FA17F2969E18F22E1427D254B4A82B3A03A3EB394ADF +230: A56D6725BFB3DE47C1414ADF25FC8F0FC9846F6987722BC06366D5CA4E89722925EBBC881418844075397A0CA89842C7B9E9E07E1D9D183EBEB39E120B483BF7 +231: AF5E03D7FE60C67E10313344434E79485A03A758D6DCE985574745763C1C5C77D4FB3E6FB12230368370993BF90FEED0C5D1607524562D7C09C0C210ED393D7C +232: 7A20540CC07BF72B582421FC342E82F52134B69841EC28ED189E2EA6A29DD2F82A640352D222B52F2911DC72A7DAB31CAADD80C6118F13C56B2A1E4373BE0EA3 +233: 486F02C63E5467EA1FDDE7E82BFACC2C1BA5D636D9F3D08B210DA3F372F706EC218CC17FF60AEF703BBE0C15C38AE55D286A684F864C78211CCAB4178C92ADBA +234: 1C7A5C1DEDCD04A921788F7EB23361CA1953B04B9C7AEC35D65EA3E4996DB26F281278EA4AE666AD81027D98AF57262CDBFA4C085F4210568C7E15EEC7805114 +235: 9CE3FA9A860BDBD5378FD6D7B8B671C6CB7692910CE8F9B6CB4122CBCBE6AC06CA0422CEF1225935053B7D193A81B9E972EB85A1D3074F14CBB5EC9F0573892D +236: A91187BE5C371C4265C174FD4653B8AB708551F83D1FEE1CC1479581BC006D6FB78FCC9A5DEE1DB3666F508F9780A37593EBCCCF5FBED39667DC6361E921F779 +237: 4625767D7B1D3D3ED2FBC674AF14E0244152F2A4021FCF3311505D89BD81E2F9F9A500C3B199914DB49500B3C98D03EA93286751A686A3B875DAAB0CCD63B44F +238: 43DFDFE1B014FED3A2ACABB7F3E9A182F2AA18019D27E3E6CDCF31A15B428E91E7B08CF5E5C376FCE2D8A28FF85AB0A0A1656EDB4A0A91532620096D9A5A652D +239: 279E3202BE3989BA3112772585177487E4FE3EE3EAB49C2F7FA7FE87CFE7B80D3E0355EDFF6D031E6C96C795DB1C6F041880EC3824DEFACF9263820A8E7327DE +240: EA2D066AC229D4D4B616A8BEDEC734325224E4B4E58F1AE6DAD7E40C2DA29196C3B1EA9571DACC81E87328CAA0211E09027B0524AA3F4A849917B3586747EBBB +241: 49F014F5C61822C899AB5CAE51BE4044A4495E777DEB7DA9B6D8490EFBB87530ADF293DAF079F94C33B7044EF62E2E5BB3EB11E17304F8453EE6CE24F033DDB0 +242: 9233490344E5B0DC5912671B7AE54CEE7730DBE1F4C7D92A4D3E3AAB50571708DB51DCF9C2944591DB651DB32D22935B86944969BE77D5B5FEAE6C3840A8DB26 +243: B6E75E6F4C7F453B7465D25B5AC8C7196902EAA953875228C8634E16E2AE1F38BC3275304335F5989ECCC1E34167D4E68D7719968FBA8E2FE67947C35C48E806 +244: CC14CA665AF1483EFBC3AF80080E650D5046A3932F4F51F3FE90A0705EC25104ADF07839265DC51D43401411246E474F0D5E5637AF94767283D53E0617E981F4 +245: 230A1C857CB2E7852E41B647E90E4585D2D881E1734DC38955356E8DD7BFF39053092C6B38E236E1899525647073DDDF6895D64206325E7647F275567B255909 +246: CBB65321AC436E2FFDAB2936359CE49023F7DEE7614EF28D173C3D27C5D1BFFA51553D433F8EE3C9E49C05A2B883CCE954C9A8093B80612A0CDD4732E041F995 +247: 3E7E570074337275EFB51315588034C3CF0DDDCA20B4612E0BD5B881E7E5476D319CE4FE9F19186E4C0826F44F131EB048E65BE242B1172C63BADB123AB0CBE8 +248: D32E9EC02D38D4E1B8249DF8DCB00C5B9C68EB8922672E3505393B6A210BA56F9496E5EE0490EF387C3CDEC061F06BC0382D9304CAFBB8E0CD33D57029E62DF2 +249: 8C1512466089F05B3775C262B62D22B83854A83218130B4EC91B3CCBD293D2A54302CECAAB9B100C68D1E6DDC8F07CDDBDFE6FDAAAF099CC09D6B725879C6369 +250: 91A7F61C97C2911E4C812EF71D780AD8FA788794561D08303FD1C1CB608A46A12563086EC5B39D471AED94FB0F6C678A43B8792932F9028D772A22768EA23A9B +251: 4F6BB222A395E8B18F6BA155477AED3F0729AC9E83E16D31A2A8BC655422B837C891C6199E6F0D75799E3B691525C581953517F252C4B9E3A27A28FBAF49644C +252: 5D06C07E7A646C413A501C3F4BB2FC38127DE7509B7077C4D9B5613201C1AA02FD5F79D2745915DD57FBCB4CE08695F6EFC0CB3D2D330E19B4B0E6004EA6471E +253: B96756E57909968F14B796A5D30F4C9D671472CF82C8CFB2CACA7AC7A44CA0A14C9842D00C82E337502C94D5960ACA4C492EA7B0DF919DDF1AADA2A275BB10D4 +254: FF0A015E98DB9C99F03977710AAC3E658C0D896F6D71D618BA79DC6CF72AC75B7C038EB6862DEDE4543E145413A6368D69F5722C827BA3EF25B6AE6440D39276 +255: 5B21C5FD8868367612474FA2E70E9CFA2201FFEEE8FAFAB5797AD58FEFA17C9B5B107DA4A3DB6320BAAF2C8617D5A51DF914AE88DA3867C2D41F0CC14FA67928 +256: 1ECC896F34D3F9CAC484C73F75F6A5FB58EE6784BE41B35F46067B9C65C63A6794D3D744112C653F73DD7DEB6666204C5A9BFA5B46081FC10FDBE7884FA5CBF8 + Hash: chc_hash 0: 4047929F1F572643B55F829EB3291D11 1: 8898FD04F810507740E7A8DBF44C18E8 diff --git a/notes/hmac_tv.txt b/notes/hmac_tv.txt index 6508c9905..98dba80ff 100644 --- a/notes/hmac_tv.txt +++ b/notes/hmac_tv.txt @@ -2770,6 +2770,1566 @@ HMAC-whirlpool 127: 1D8B2525E519A3FF8BDAAF31E80EE695F5914B78E7DAB801729B5D84C3A7A2B36A33803F5E0723981CF8A9586EC1BEABC58154EFD919AFF08935FBD756327AAB 128: 4AABF1C3F24C20FFAA61D6106E32EF1BB7CDEB607354BD4B6251893941730054244E198EECD4943C77082CC9B406A2E12271BCA455DF15D3613336615C36B22E +HMAC-blake2s-128 + 0: D9A6509D3D2811A6EA00396B532E2B04 + 1: F79B6C460ADB138E9A3078D30CF1CF41 + 2: D03AF0A5D31238C70BF2FF9932178EC2 + 3: FF4505DB5B00CE433974EBFBFA9C61F3 + 4: 0D746A6E87F39DB33368405D4C725C01 + 5: 4E9971E0DD79E62594064E7B8555288C + 6: ECFE8163755587A22EE56B5282358D79 + 7: 530A343749AF55CE7C6E21AE417B0B0A + 8: 6692708FCBC74B441F9ADBE2724438AD + 9: F9938A73391B5BE81FAB9D08917D536E + 10: 2F9C62131AA9FCA8EE9E6958A07E9AE6 + 11: 0B995D0EEA8E157BE7282CE0CF4B1A7A + 12: EADA065A4846CD66DC33A43035F3E125 + 13: DEBD58E85794350D2D29E28A548E6796 + 14: 1CD3F6862568B0B734871C2E161020FB + 15: 93AD9B9E2E48D9D58DE3588479CF20C1 + 16: 54FCE32A581D99F8AFEB9F87078F3037 + 17: 45D33CE2809663503A2C064F34FCD6C5 + 18: 642129A619B3E550394E5A95B5711158 + 19: 866ED5891E4C7FFF22D3FB3E55CBAB5F + 20: 91DDB23B639D178D58DB3DF6E995CC3D + 21: B503D9288A68CECB4166CE7BAEC03CB9 + 22: A936BC69C1A57B4FBB1CF832824DF2B9 + 23: 9C5CB33108D044572C40BD0F1F4063FB + 24: 7842BAD82BA10245E8CE9DB4BA05AF2D + 25: F5E149656E3FAF650452B2F61DBDC4F1 + 26: FE874FFC33088BB88DB4C6672B86C0FE + 27: 2CD8160DCF17084BA9C4F25A6908CE61 + 28: 4BA2EA1C10D004AAAD91324C6D088ACB + 29: 5474FE93522CC4A91037E1EC2A79CB9E + 30: A32A423D018B336AD461D45A4E25E403 + 31: 8C15330F714B2FAC8326CAB9BCF5E8B2 + 32: 52C43169125A66E41A673741D8CA9890 + 33: F74AA0F375061D11DF081DE41523753F + 34: 155F2BCF9D479F09C1B60A0CAE587B54 + 35: DB082767BC6DA25719D60B1DA4D8C82B + 36: 7DBC0D6181091DAC48E055638B766502 + 37: ABBF20F9E6A9D6A834AF1636C043393B + 38: 987B018335999FDC01C4545E1894B89C + 39: 5C2DCEEA6A6EF1F382C2436CDA5DB39A + 40: 300FE9F65DC929990F54492F00F8DA6A + 41: CC93C2599F152E82422A272EEC7B5363 + 42: 08710B279972CEA381D34994983620DA + 43: 72CFDEC6CFD987A9B6F3E350344CE619 + 44: 67B8FF6BD7C7B216E5C69FE5D2B4A955 + 45: B97D8DB2B5FE62306D78C2ECBCAB5FFD + 46: 97D29FBBBC0480DD21E6DCD8F76E729A + 47: 5448B03820B7B8C6B8B8558D3905FE4E + 48: 2F9C61A414B7AB3BFBB59D5C98062404 + 49: ADFAAA1CED2D0AAF10663A9C92168FF8 + 50: F04A37FD9663CFC7AA3AD27E641B1C7F + 51: BE05676DD21A5B29C1898D7D8E30B508 + 52: 0EC95105B257D094E83630F4D51ED8F7 + 53: D64ADE612C45364F4125E7FAE80A1E8F + 54: 893155E369AB94CA09732ECC2349603C + 55: F96FF508E46787820E7035E13A55876D + 56: 3387E19C2F26DB6159431F3390FAC491 + 57: 09FCFD1E0F9A282B6BA3A32EFCBB838B + 58: 95849C47F985C3B23637654EE42A3B15 + 59: B137865CFCF7505E21926C5AF8886AD6 + 60: 776F6F212B550961E8581F761E9AAB95 + 61: 1A2B49AC03F4FACD72BEA5D042EFB0AF + 62: FDE5B32633BF9F8F46BCA20377FDCEC2 + 63: 7D889B6E843B5FC92168F8C0571E0F28 + 64: 4C9BFB112352331A367D43E47D1584CC + 65: 95057CE969E8FE681BC1CBCF3F785870 + 66: 098339C9520F932DDA9FE62879637041 + 67: 876F5E05C1DDBB7BE6FEC34B41B07206 + 68: D4B502B77B416602F8C272DCA6F41F5D + 69: 3C15591D5644C185C7AFEE486583ACB6 + 70: EFC75F9FEE23778758483FA86E72B9B3 + 71: 6A4A75DCB183D833492ED7030F6BF99D + 72: 3E48F7484C176C406E78D29C5D48CE7E + 73: 04E67CB957B943BC0C20FEFB7E931201 + 74: 20AD75B9967D16771F6F6758BD48AF67 + 75: 90441BB7795A9D2E35ECACD53DBE7AFF + 76: 4A9417219786E65BD1A486C80B8A71CB + 77: 347DBA5AC5EA0D6F47C8BF91F3B878E7 + 78: 1B82F56FBC1C864F32C81A8D8A5C0BD6 + 79: 133321AFFB4F5B842A9BF8934F63FF4F + 80: 61DEBABD5788061B94FC2462A952F8F4 + 81: 555B2DF9BEEEF2EE96B90F46CEEA662C + 82: 02C1172F35B9E0F2914AC0336069A109 + 83: EE51CE9BC05E37F0F60159DF809C33F9 + 84: F3FCA58EFAC56340BB44A9679E4BE8EC + 85: DF97300079E2E0BD4D4A2508B202B55E + 86: 070E813FD6E2B36A23F21C4394C5D875 + 87: A16CB8D0EEB5C505B629565FBB32FE9A + 88: 06AAAABA7537BD2C85E31D65610F100B + 89: 283DDB4E8911B66C62F68989FBEC6802 + 90: D7416094ADB17FC6C33D3CEBD898C352 + 91: EBDB4E928266BF1C61DCE73370076FEA + 92: FFE60DCE45DE101B5251C912BC1B39CC + 93: 2C969B49F0CEEA3E63DCC917A1D649ED + 94: 0450FA648005EB1BB0B2AA361346A154 + 95: BE1BEFCE99A2C1F550F2308BAC66D932 + 96: 341A60C4D0A71B673B01F3BF87C7960B + 97: 17E2AFDA05A94BDFF080488B1C2B9F9B + 98: 23A6551851E4D71EC261A7CA132CEF06 + 99: 8B10BBDDC7B02DB662FE5493C4546E43 +100: 361CEAD587523282C13AE8C39DA1FDD7 +101: 68F5509C807278A39397F1A5F18FC97B +102: 36F9D2AC6FA67FDF0628BB6BF89C8028 +103: 28C042DB70B923CF5B2CBEADED4DB367 +104: 60CA4E8EE11CD597ECC8C07C223D384D +105: D9BB79B4907142546BD52AEBE3E1049E +106: 29E0BFF2E1883595EE198D5DCBF525D1 +107: 149ABA37AE99875E152E1BF4FF412E2F +108: 02390B64373CF88D274E939C355E8B20 +109: 34DF13EADA0F3B2C71CAA3FCAF086AA3 +110: 34B6FF7256A3B56B839A77672D8BB8A5 +111: 9F0EB9BA6E35208F4BCC2A3343ACB884 +112: E2367A2625BA78A6398315D1FCB56FE9 +113: AEBCE64E2B7D9647A1247EFE8C824496 +114: DBEB7E590480AE646D874D1D1F8F7F43 +115: 23C64273CBDB4CFB849A37DC8F975E53 +116: FC5BA814D687219021C32A850F1C0324 +117: 54475DF428B168985B858BBA5A322BB1 +118: 8C1AC0F39B9333BD5A5E3B4E966E0F58 +119: A2038AB9D9E3AFFE495FC944ECEEA4A6 +120: 1B7E712D61E86B625F82A5E770B01FD7 +121: C012695ACFD62E23F28BB6558FDFAC95 +122: 5AB61590EE427A2AA7A2361E44710BCE +123: 0DF020970F09FE19C86CD889FCC7BE88 +124: AFFFADC4A74B8CB6B4316C8222C07BB9 +125: 9FD53F054EF4B5AF3CAC470A510CB267 +126: FD217F750FA45E0B7D5C9C73454CE1A2 +127: 6DF8FB94D774E2A294FC9D6D3EFB4C8B +128: 1F73E062BD976C36CEACD5BD777B4E62 + +HMAC-blake2s-160 + 0: 0C1D8F8D105A510111E008828B34BD016661704A48494A4B4445464740414243 + 1: DBFD42F41D6A3E3783ECA2BF20C4D5D286433CA61415161718191A1B1C1D1E1F + 2: F54EFB9EB58087B6B4526E00D9949FA574FE3DDE48494A4B4445464740414243 + 3: F0D4EB4871B5E9EE5FF24D72B6982DA8D6A2B68D1415161718191A1B1C1D1E1F + 4: F8DB3D275770130B1F44FE9BDBF06AEDE693A08A48494A4B4445464740414243 + 5: 38F2E65040EA3476A7DB683F8B960661AA18F05A1415161718191A1B1C1D1E1F + 6: 0FFE7511A80AD0A1BB346D43BE1EA86E9548B84F48494A4B4445464740414243 + 7: 1B26403BE806D619AAE870F0B56BF87964D079FC1415161718191A1B1C1D1E1F + 8: 19259559C513D23402796C81848F3ED52295CFD848494A4B4445464740414243 + 9: F6E3427455E58F6A334DD60F802E3422E73D91251415161718191A1B1C1D1E1F + 10: 50CE99A8AF7028ADF273E29DAF82F7443D5C3B6848494A4B4445464740414243 + 11: 624EEC36899BAA5C469F72625BEC5B5504E2CD921415161718191A1B1C1D1E1F + 12: E4C8CF7B3669767F2DD67DC9B5CBCCF69D9EE91748494A4B4445464740414243 + 13: 09787A5F60342A86C46B1C80D689716CFC66E2FC1415161718191A1B1C1D1E1F + 14: E0D995E7CB1DD1B50D4A4C5150AE70C99C8EE31F48494A4B4445464740414243 + 15: 5E33894B2C18DA37D36A73FADD23B11C5088253B1415161718191A1B1C1D1E1F + 16: 224BAF87E1C94BEFAA83142569032CD95285C69048494A4B4445464740414243 + 17: 89A7D28CB3E11E0DB50422110BCB37DE3B97F4F41415161718191A1B1C1D1E1F + 18: 674FB37F47FE84940A6A6C1EF3F88B87D77BD22048494A4B4445464740414243 + 19: 3BD010BFB29B0982CE5680F3B6BAB934A519CDA81415161718191A1B1C1D1E1F + 20: 674F3135A1E80CA9A03FDFBE5F499E54516FCCD048494A4B4445464740414243 + 21: D6C3B4794557570429D3B4FD403D26CA38B7F4FC1415161718191A1B1C1D1E1F + 22: DD1F49EE8397D060186DB7FAB58597CEC39D1A0048494A4B4445464740414243 + 23: 42BEBB4637FC45998EC8C3A7BA444BA1C2A49B1E1415161718191A1B1C1D1E1F + 24: 938B3A192BF9350BD3620BF236E0E4223658F8E648494A4B4445464740414243 + 25: 1E614B2B1561BEDE4F744B36B9C8B410F116AC481415161718191A1B1C1D1E1F + 26: FA45BDAC77BD4077AD8746D6A2B88429A924786048494A4B4445464740414243 + 27: 1287CD0466009D1A9B4968901588E590D75776EE1415161718191A1B1C1D1E1F + 28: 0A480F52E809DCDA19A20F8241AB6C67AECF035548494A4B4445464740414243 + 29: 2558ABE04AF7B982070BCA05774EF8861E0288851415161718191A1B1C1D1E1F + 30: 90F1E7ED1AED355EB08E1C95EEA6D7678048B44548494A4B4445464740414243 + 31: 564739AC2D8C6723993A4325BAF22F66265C6A991415161718191A1B1C1D1E1F + 32: 49624233C6C7D43DB1EE4099F490A4BE9947DBB248494A4B4445464740414243 + 33: 695EFF44807D62AD21DA1A0D4F9F3E94D7FE91191415161718191A1B1C1D1E1F + 34: B9FC7584FF5B476E5C34B35C1B91048CE4E206C748494A4B4445464740414243 + 35: DE87288D9C2F49835BE0D672E83E125FCAA3A3E81415161718191A1B1C1D1E1F + 36: 2BA1CE8F339A79680922F6FB72D9CCF0E42A483C48494A4B4445464740414243 + 37: E44602E1A2E2BAE5F06C72E8A21818F19E6974F11415161718191A1B1C1D1E1F + 38: 268DBD8634A85AFBF61D1B9540D8F8A640A5661048494A4B4445464740414243 + 39: 93779E480C7AADE13EC72124592B66944F3CD8BB1415161718191A1B1C1D1E1F + 40: E9B431A2D220942FCFED752B573DEBF95996554048494A4B4445464740414243 + 41: 1E4285A190B25CBA7DA4DE4C4ECA93811F7178B01415161718191A1B1C1D1E1F + 42: 0B1AECC0E11BD2AB0090F346EFC695D3EE6EAB9948494A4B4445464740414243 + 43: D829C7145EE78C7F2503E818F6DD6FBE02BF55611415161718191A1B1C1D1E1F + 44: B9FEE2A25F2E3D24C92DF9166392BD238F3CA79648494A4B4445464740414243 + 45: 7D4A159E53DD93F676B27F0362F7BFAC2969FD8B1415161718191A1B1C1D1E1F + 46: 903FF190485D39B2086483028C3A08D5A8B6A3A048494A4B4445464740414243 + 47: 7BB63A056A947677102B2D2E392EBD9C2C6287421415161718191A1B1C1D1E1F + 48: C507D08028CD0E3C3008E1EAF7267E3CD7D2150E48494A4B4445464740414243 + 49: 9EBAE019AE16190634F165932C88726382C5C61B1415161718191A1B1C1D1E1F + 50: 48C506A1BE474A3F1E8C74D24A935E1C44204B3A48494A4B4445464740414243 + 51: 11E0B9EA2FB5C58EB9D72DBF30BF879C8305344A1415161718191A1B1C1D1E1F + 52: B6618642195803138A2752C50629C5DB2805284748494A4B4445464740414243 + 53: 3F9E7B5A76DA0515E3E8613AA5C38F572D1EACDA1415161718191A1B1C1D1E1F + 54: 94016156C7E24905091C16EA343BFD1867E36EFD48494A4B4445464740414243 + 55: 3F0D335C903EC4C9779CD3931CC180220CEE7B6C1415161718191A1B1C1D1E1F + 56: 3CFE46D363DD7E4C32F24F92598E7BB2EF2C0AA148494A4B4445464740414243 + 57: CE48A5F4A173D418FB36FBFB0111E0B5E786F6C81415161718191A1B1C1D1E1F + 58: 3C578B6FDC46BD7BD9ADA5122B1C31C7D5D7690D48494A4B4445464740414243 + 59: 075EF478AAD27156E32E47B6D7EC462994906ADD1415161718191A1B1C1D1E1F + 60: 2DAE66FB4130143C21BE41CB7CBBC1AA2ADFAB8C48494A4B4445464740414243 + 61: 412C76A94179946C815648D46C6BD55FC6AA18AB1415161718191A1B1C1D1E1F + 62: 0E5284F30A43CD432CF024A91399E23BAFA84B5A48494A4B4445464740414243 + 63: 9AB2339A7968267C4B48380586F6F90C386BDDA01415161718191A1B1C1D1E1F + 64: 85D96931EFB8098D8D8874F1B6F064CC7E08AB5A48494A4B4445464740414243 + 65: 90C0071CC1120F5E906A99D4F0386D7AC28BD1621415161718191A1B1C1D1E1F + 66: 9541B01E774DFBE0121D01818E298CBEBE9D682E48494A4B4445464740414243 + 67: 54FDC0AA918214C64CD6C236EB3D151ECF4C04131415161718191A1B1C1D1E1F + 68: 03C22369CB47EE62A0D91CE44C7342BDD710314948494A4B4445464740414243 + 69: 63E329E528375F9338532AD2042878259C37161C1415161718191A1B1C1D1E1F + 70: 83AC0387E47F9B7990342940ACEB7D3BA8DA0F0A48494A4B4445464740414243 + 71: 6DAC37F69C8D41544EFA19C34B3919C46EFB67E61415161718191A1B1C1D1E1F + 72: 3BE0B7F89E666B410DBDD40F94EE614B80194BB548494A4B4445464740414243 + 73: 7A31FA40393C921F17788BD7F16AEBAABB570C8D1415161718191A1B1C1D1E1F + 74: B30B66A456852C539615CB39B15F081799E61CC748494A4B4445464740414243 + 75: A9D58A6E8AE1BC00482C20D596ED0AAFCF125FA91415161718191A1B1C1D1E1F + 76: ECB589136A28E4599C6FDDF1BF968B6850D9BF2E48494A4B4445464740414243 + 77: 0F3D8EDEA304A72E43AF0EA865840D99B1F6159D1415161718191A1B1C1D1E1F + 78: 7C8788A9724F446F96F28046ED48465DECC4DE0248494A4B4445464740414243 + 79: D132809E7509BB2FFEADE12018D6DD3F6093D16C1415161718191A1B1C1D1E1F + 80: 06867B353EAE39150F257A4D86E2E909DA065D2048494A4B4445464740414243 + 81: 2CB0FFE9AFF1D14954759AC5E392B15752A77F991415161718191A1B1C1D1E1F + 82: 947C9803507CD432CD824C2766378488F89FBE2C48494A4B4445464740414243 + 83: FFE8F94654B8DB0C5DF8B579643C79AB9A322C5E1415161718191A1B1C1D1E1F + 84: 18C088B7E653CFAAA902E7BDF58332ACE02EA4A948494A4B4445464740414243 + 85: CACC1BD6750A244C770750AFF4041E9FFE17E6DD1415161718191A1B1C1D1E1F + 86: 3650661A8AE0813531071B6CC7AA6C46A47CCE2548494A4B4445464740414243 + 87: 214D46C9293F8DCB10B3C7A74E962053C764CDE01415161718191A1B1C1D1E1F + 88: C83024814C58E2167839623E06E7BA292A58655E48494A4B4445464740414243 + 89: E0011C43D57D41C524C480943C378BEB7918FECE1415161718191A1B1C1D1E1F + 90: B0EDE853F99D5251281E188D6EBA06789458627748494A4B4445464740414243 + 91: 80ED10DD7633BEBD77DB0E96F38AF0924C27FB111415161718191A1B1C1D1E1F + 92: 729A6EC167D781012C4790DAE24566D5DAA45EEF48494A4B4445464740414243 + 93: 187E7B6504CFB87FFC419790475A82755B19BB041415161718191A1B1C1D1E1F + 94: A0F5E63791F14FED0AEF03726BCBCDF90895F91E48494A4B4445464740414243 + 95: F767FDD3886BA7375BBB07F6F13DB2BEAA9638271415161718191A1B1C1D1E1F + 96: 5C1DD3E68635CDB47F87919AEB638D5F78B1668148494A4B4445464740414243 + 97: 2132F16CB0B075273145878F83F0E2D4A7CF354A1415161718191A1B1C1D1E1F + 98: 28DD1BA35A3FA8D1F817BFCBA6182648D321CCE248494A4B4445464740414243 + 99: 87C4DD4A14CC4AF8815EC20DBC309B7662D605EA1415161718191A1B1C1D1E1F +100: E7FC7FEBF84F1FE261382721E0E682997A26E6C048494A4B4445464740414243 +101: 9524B63674BD28BD870E74D5AA4AC5C46C6BD2011415161718191A1B1C1D1E1F +102: C1FE988C3C0AF78E3B97DC35637E0B92A3E4552748494A4B4445464740414243 +103: F3F0230E7C97C74822D6E8D295EE0088812301161415161718191A1B1C1D1E1F +104: 49B3DF1D76A4FCF2CF69EECB58FD507A365826B148494A4B4445464740414243 +105: CC0424358B56F2BCA315AB3B742E0BACA7874D511415161718191A1B1C1D1E1F +106: C9384CCFE0AF23C5F193D969A41DECB2426D422148494A4B4445464740414243 +107: 53B85E61A00AE334132DF87E8FB87EAF117767FD1415161718191A1B1C1D1E1F +108: 48392D9096746A7E3C3E154B96889D0BB0E70E0D48494A4B4445464740414243 +109: E10EE351AB62E80EF84C68AF536033A828E4D59D1415161718191A1B1C1D1E1F +110: F489EF81EC417A68CE3D6B4AF05708A0C3A6920748494A4B4445464740414243 +111: 2D5EF8DFBB70E676276F9CB613EF045BF99B49161415161718191A1B1C1D1E1F +112: FE102E8CCE28E3D320EE82B84B434DFE5C66078248494A4B4445464740414243 +113: 58CE2B43F1FD6DE8E39014A012D64C26DE2B0BEA1415161718191A1B1C1D1E1F +114: 862CA44C01F8D4A72E544F90E3AF8F48A271849648494A4B4445464740414243 +115: BE2CB30148E0026DBA3F428C1E3AE9ECA85C5D221415161718191A1B1C1D1E1F +116: 23BBCF9CCAF7D6EEE73869B0659605529A1F08B448494A4B4445464740414243 +117: 50CE3283943C76440288376CBECE9AE3167522031415161718191A1B1C1D1E1F +118: 363D9526C92EFCD925AEAE8BBE9607D60AD2B4F948494A4B4445464740414243 +119: D04E479493C29190649EF6F665143587682E12381415161718191A1B1C1D1E1F +120: 7AD2477D39F525889C6788A050B9BCFF21658E7A48494A4B4445464740414243 +121: 051D76FDDF57C6932F82C5B128806C8683BA03F71415161718191A1B1C1D1E1F +122: 687EB51A74B52D13B1C4E324B735BEFEBE51CE6248494A4B4445464740414243 +123: 3E8EC4207FD47A5268AA9D0548FC0C6C772D0F4E1415161718191A1B1C1D1E1F +124: FC2501A108A8A2EF6F9AD89152386A4C25D1D0D048494A4B4445464740414243 +125: BCFECF9F5B7AE54FCF2CD4E8CDF18258A772A3091415161718191A1B1C1D1E1F +126: 569E914D0DAE44C610BD1F69732B193FF59A4FCB48494A4B4445464740414243 +127: 163436BC625953260D96388A64CA2BB1E331D7E91415161718191A1B1C1D1E1F +128: 7F264426C7ADC6643D3091567549353780D0717648494A4B4445464740414243 + +HMAC-blake2s-224 + 0: 1F317EB26F313D0A41D03544402DFF7874B96E312043732E515ED17D40414243 + 1: E3FD8515BB1010BF31D0489519EC3BA98E7937542D9192302C65751E1C1D1E1F + 2: DB02B57D4BB32A4D0A7A7D91D7BD02E9A8D16A3BB60E8C2C0B3DD28240414243 + 3: EA6E072F4AC41C20F323F1ABACA32B2B84AD1B5C12CF1AFA86326A9C1C1D1E1F + 4: FF7EE41A1DBB32D659DC32153CFD93EA00BBA8EF0E8651CB40FF25C740414243 + 5: 9EF374E1BB7A76F835EE96856AB557ACA35DD208BA1742A0433E09BC1C1D1E1F + 6: 7E7F06AE6F044BDDF0A4AF62AB7CB269D227AC861EE547C8EE7145C140414243 + 7: 16E1813525D3B988FE37D860CAEB082F7DED30CDAF99DF6D9DE8723E1C1D1E1F + 8: 3948D4750CDA6BDED056940009CD50C6F51ED2E3F3355C2F607FFC0940414243 + 9: B77A6E5D589CE028EFD31B30561B9A841A0DD25AC21F5CE0F3153D731C1D1E1F + 10: D17ADBF5BE7F02CC3567E8EE114AB798A9A8535E073CC8841A9184DD40414243 + 11: 7EB0EAE4AE08CD79C229BAB1C32A84F81A72C6D2AF498571E7B4C5471C1D1E1F + 12: C0C71F4FB5492AB067CC604025F9ED0EDF92842424921A92F2A739C240414243 + 13: AC76293D72B2ED01ABB36DA63AED2B4403F770435498EC252FCF71AD1C1D1E1F + 14: F4FC1BD2FBB667890B62EA5AA0C85826A5F356B1A1D600C58F15CB9E40414243 + 15: 78610278A9153858CB12C5771FBB13F47DFB766A75F16A429F7CC6011C1D1E1F + 16: 1859B656D16C380B78CA047DB91FF61BE7F84CF54BECCD967DD6568040414243 + 17: AEA23CEC5AA57560068E5E804D7205696077F666D11F7EEEDCCADC1D1C1D1E1F + 18: EDCAD57646060A581846A6E11187DF2F72A477C5DB2685D5F14ABFA940414243 + 19: CF305F85972E3657FBF78BE898F8E1364C0E87385B9CD5D2E0DC58A61C1D1E1F + 20: E63B5BEB244F360DD9739EC2069D22669BCC3C0F2F3EAA70C8D616F940414243 + 21: 940437A20BB098592AA1044F007B8D1A4C796CBC9D40639967A68C961C1D1E1F + 22: EC7DDC2F230854126A9CC8A80AF8915223D17E87709BDCEE807A564740414243 + 23: B46B8B565CD6B8CE33F3EFC476B7AB14196E3E74A49F14E91A67AAAA1C1D1E1F + 24: 5D4BA049FA9B11A7480CD314EE319E8F68066AAA5810A366A82CED9740414243 + 25: 10FAFEE1E4FC1900583DFEC56D5D3DBCD5DDA5CFB47934101398E1111C1D1E1F + 26: FBB39490484CCCEC0B7BE3F9F4701B46AD9CE49D5A5ED616BA9136D140414243 + 27: FA577BA5223CEB7F434B59BBADFF968F1BA8E0857FAEC77E4050DBD71C1D1E1F + 28: FFFACB88E1F567645635411F54F92A5C84DCB67B7F1F01E82167498640414243 + 29: EB0015DFA5D525F066C2CC92D71EB2D9E6A23B3A49837338AE4A92561C1D1E1F + 30: 5D86AF18789CFF85C8BB549CAFF6EC0414C1E24255934EA10196906E40414243 + 31: 6DD5E4F880D49F3795289FEA43CE902AF0D81425BB3EC9FAEF36730C1C1D1E1F + 32: 4757B3A0F8A08E3AB2E1BCD7F832F3AB31055AE3B279210DC46A987540414243 + 33: 5E3EF4542D1D0F8005850E00471C8DDD84B78D7059F40774F5C463931C1D1E1F + 34: 1AC3822515448DB6D641B22BC433B3685CA6308F4F0BEC76BC22E6E840414243 + 35: F712A41E7C3750A8C980B80B465C24DD5709CF44393FEF562CDC2D481C1D1E1F + 36: AFAD836FFD37522DE3D5F0FDD1FB0EBC416FE584C2A5020B6198E18740414243 + 37: 16A5BEA3D615E41BB0EA3384A9B6E87F4FAF068B1E73AA49B70F7BCB1C1D1E1F + 38: 556BA7669EB9C9F1AE2A87E3F977DBDE2225479D2C1F853C412B6F2D40414243 + 39: 374ED340EED73A41CAB7188652DA4B602D589D1EB1E514384CECE8931C1D1E1F + 40: A2C357F4D8E010D4FD49C67461B573EAD02911B999B1044C44AB517740414243 + 41: 2B913575ADD28357216C2636E7329A87BCA37F66A34CDE74A5A4E5F91C1D1E1F + 42: 1055CB0C5CBF2E98BE636834E07DB4DE9D250FD3B507FFD15585F1C240414243 + 43: ED3A19D27AFAAD9C7C0CA0E4374B40F12FD4A70209C2731C7A4997961C1D1E1F + 44: D7983941358E9C569B00D60097A349003769140253A53EDDCE0CC74940414243 + 45: 2BBEE59C607F03DB81A236B7148CD1F9CC2567A4B4C00DD9225E7A3D1C1D1E1F + 46: D127102FC0255464F73C1CD6148166F31456F19CE6FD5BD5666E634F40414243 + 47: 7112B9915F9BE5316DA325DF350BE9EBB705A10C4F3DED54A5E593C41C1D1E1F + 48: F391F097C1C47FD88A340CB8C5C32D66C940CA2D42D693396BD4F16340414243 + 49: 454AA513DB4451242AA5CD00F143802D8F954D2687A96D4CB150262F1C1D1E1F + 50: F96BBFE2230EE0459F115A4ABFB3B1124B2E751F1707074F4F0CC36340414243 + 51: BC12BCB1F7F5CCB8ED16D9816876EA511A7CD97C4027C8A1CFC8C6601C1D1E1F + 52: 1E51E76FED2156AB9F88A624AC20DA2C0E56B3EFFFC165F48985ED4540414243 + 53: 7DD5818DECBD6D4C3C6BAD4966DB5E16E6B119D9BE257D86FFA1DA471C1D1E1F + 54: D50AEF810B05F1F96EA52A72DE0B51696BBA9B74F0F99E1C6C3F03F540414243 + 55: 1BAF8B8048676DF283E3C14B758F768E983EF9571AFC893B561BF49E1C1D1E1F + 56: 3CACAEDD65319A0331F925092DC932C76008A8E82714947E569FB85640414243 + 57: 38CA224E3A04C1E21F6EAEB2CAC0915A177FA2FFA4AF253760815BE81C1D1E1F + 58: CAA87AB4F073E9EEC7E01698ED27A73DFA23837464E2C7B0FCDF3A7940414243 + 59: 91789519BFDA5CAA0AA9B7AB186381422D9E4A0167055B71FA285AA91C1D1E1F + 60: 66208DDA2EF2181732226920C2E0ACB9D256A2E0D3256573ABCC12E240414243 + 61: F8D5DFB9BC154A681C6A3CA6CD3A30976CB52A505A2834CDFE40DD491C1D1E1F + 62: 05FA3F00EB091FBE45AF783735F86F302DC0557AA08D37D9AA52AEFD40414243 + 63: 220EE3AE51A0A8E83E302EFABBE5284D5FD20A9BB2AAB021262633791C1D1E1F + 64: BB075D9FDF012666C362FB282080FFE7C10B05233EE03563DCD08A4040414243 + 65: C216DF6E2880D5BB59FA43AE8C8291EDE8A8390AC9281E3F1698CC891C1D1E1F + 66: DB5514FD0300CD3C7CBC5A91AADAC88456DBEC6048608801C7A67C2640414243 + 67: F30DF8CD00E2F1EE73933886262913CC4874D5998085C9DC7CE883D61C1D1E1F + 68: 4CD001D9DC2DDFA6172EC5B68183103ED00A7C29D0CCE8310C76617740414243 + 69: F8C711B1570E4ED566E379C3752AF2FA50FE69F0DA2A6E36808CAFFF1C1D1E1F + 70: 5535C858669A1C21C2354A987AE8FF8B7700ADED8ED287EAA085E09640414243 + 71: EA9505BCF566114302232B96BFE59DE6D5791C867916802BCC9B03561C1D1E1F + 72: 8F1B7BC30A39E12E05CB47A52E55BC588FDA822D12BD06C7F7E71D0140414243 + 73: D86873DE094D2228FB2CE2C78CB5163A913BE9F8C3C07377A15CFB551C1D1E1F + 74: 28C647AFBEBF004A13FA86385E76A7E09DEFD71C4FA882E73CFF7C3740414243 + 75: 5C598F57395550033920E0C5827A2CB0E8998BC301D2FF140957A1241C1D1E1F + 76: 6F7ECB608307096B3A798BA037514F42AD5E0A43CB05ED7D3C8467D040414243 + 77: FA3F11D2E51E9CBED4CA0B7826D903660A5FFAAEA1B3696FA7D452CF1C1D1E1F + 78: 2230DD3594013CDD2E736AEA3EE1123B361CD0568980516CE2A8C79640414243 + 79: 6187B8EDC2A8B0E9098CD85268C000E09F0D83646A838E7BCD3709D21C1D1E1F + 80: 892DD73E6F5402D499A3B4CDAC01598CAEF1B8221B12D6EAC067796640414243 + 81: 1BB653720EFAE89499F939A06000730766B178D640C2EED148B9EB6E1C1D1E1F + 82: C9812BE72D3FF8A6083D49213AA97B5D2F2634404FEB429D1CADDB6740414243 + 83: DD19B26E1A3FA215902AB3043F6C6E995BD5CD571DDB289C3A6916091C1D1E1F + 84: F5F5E7037354AE52B55C0F2884FAF3389163CF03976266DED038D89A40414243 + 85: CA0AB6D18CFD5ADA2F2E8EB9CF5707EB787731F4D9C0BEAEF29A71BB1C1D1E1F + 86: 441DCA701DF32E6FABBE512031E4E1AFA438869242F14C2DDE7A523240414243 + 87: CD29E63AD3CB4871650C6ABAE6E78CAE96976FD67E98BAC1CA9C669D1C1D1E1F + 88: 0452080192DA8BA4F768AF3342C9C97DD573FE10339CFBC055A4CF3640414243 + 89: CBB3BB76CB0CD1402EF38A27E82331A1D6E28731672506220F441EE51C1D1E1F + 90: 20627B2AFDFFB0CFA88CB8057035B479C00BFB9B3E1977565E91139E40414243 + 91: 7FB30A0D24F88B9A0FEBE6B87E70627F16C19A2079F1FAB899669AD71C1D1E1F + 92: 5CD716BC50E5039C50838DF636DE6DA98B138FF11C6B9D6218ED9C3240414243 + 93: 91A588A51D8E91EA0CD2342C97D48D5EE4B040A32BD4AA6187FAD23C1C1D1E1F + 94: B41B1C9CD29271AC6D0AADDF7AC4BB58C6DA63860046D6954965D7BC40414243 + 95: F9CD0ADC6211B8B5F79AF3600845E64BA7B1F1F4B185C7B5E63AA24B1C1D1E1F + 96: C4E460C17783277D54F26CC382F3A45FCEEA8E95C12B4593C2A5194840414243 + 97: BF8ADEAB77ABAF6AEA3F854088D34785DBA9AD6960AA5A5611C0D5611C1D1E1F + 98: 212A96C0E8B73DF377EEF0478F84D04D76C89F717A64C5CCACF65F2A40414243 + 99: DBAA846580E2A7FD7D405A14BA11E5630F8EBFA7A10FB92373F053F81C1D1E1F +100: B80CE5F8C203910FE1F584939A1D768E50E7BCC5107652D7FD31BEFD40414243 +101: 19990EFFDB751F3E869BEF080D38D8F050F419C538E408C172484E741C1D1E1F +102: 00865C1F8D5D962259EA8B3E81E9C6A0F5F7B6996FA99C36815B797C40414243 +103: 510A7F30745523A2FD5D6AA2BCC215C9F606401413EF8BB615BF5F471C1D1E1F +104: 68CAF9FA244F7AF7CE4E8EB777EE8536A2514682FCC41A88BA34930B40414243 +105: CD78E5A82F60A83201E2A1CA1791508B5CF889D020CC9FAFFAA0997C1C1D1E1F +106: 217E819234EF90F44AD07656FBD2AE9C256735C08E2399F61D96859A40414243 +107: 03805678325BA452D70B7288AF53C8FF0B3A4FDAC4E2AB1708A6D8F51C1D1E1F +108: 3E8762AF6186FC49144ED9139E1CBDB5F2C5E4A3BAA6634F0555FD0E40414243 +109: DE059AA672441A7A77353746FEE57529DBFA465B0181F74CD18F5BD61C1D1E1F +110: 8BECCCF5481FD49D75CF103968DAEFF014A422C539CF71078457ABFB40414243 +111: A96CD3AF9FC4BFEFCF060983DFB5B0106761FD82C1339382535CC46C1C1D1E1F +112: 5D2E21F79A46435257887468512C5C35F2CEB285919160E641D0C3F540414243 +113: 07A469455FD015F03E8528316FE9C55A11B325F49DC29A3F6D6A8B351C1D1E1F +114: 9CF0660C1F856B42F4EF4D1F8E685305F5C6AEDE97DF9955A2650E6C40414243 +115: 6CC16767EDA6199608FD59E0543D5990D92DF656DBE524E81D123A0E1C1D1E1F +116: 7E3DD1E42A7CB6DA5D21FDF6ACDFA98875D9CA99E592FF83841FC38E40414243 +117: ADD8FD1F498F5CDD7182FC5D76997AFBABE6891D1F55169164226D401C1D1E1F +118: 8881EC2799073AF67DCD1DDBD634E906C7802CA099620EB1001697D040414243 +119: C9FC515D1058021F42CBAA76182DEC93E752A2ACFC27D201D34D53741C1D1E1F +120: 3D2B6A8040F71B12C0A60D458901E54632C5EC85128C494B1DCE8E2B40414243 +121: 31B076531196033249483772DEB73C37DB5814C175C877BD16282E4B1C1D1E1F +122: 2A9A6E51742323B9151A744631D7C138367F523717B42366156E06C240414243 +123: 983EFE318F3B4B83F81C2C39970C45049DD40C2662EFB1B1AC87EB7E1C1D1E1F +124: E813EF4553AE091EED7887C1BCB3E5768F2604BE132E5A2F8EED2FD740414243 +125: 6133D80288AAF21EDB47696F77DEF406E81F4EE74C7AE4E1214BB6821C1D1E1F +126: 25FB628B8B6C3675CD21339479E684E75FE342523999C53465BF66BC40414243 +127: 07FBADB3BD843A0405AB5683A9D75B82CF708FA4C1335A8DC9C034BE1C1D1E1F +128: B02947A8481D0793F7CD556865E03FCCBEE6A790FA37D54AD5189F5940414243 + +HMAC-blake2s-256 + 0: E2641D24DFA8DD89E8CB77F1CDC77D8C006E5BEBDFC4D6A3A3A6F8D5B7586FB0 + 1: 6FB4EF46D33615E0186611FE54E26F1AC9165C0BDD779CC9B607D5851B3436BC + 2: ADD5D8CA3B6722D6141B268F36E823D10B3528DEAF34037E59257D8375BA8D36 + 3: 0AFB3DD812202A50D5CAA79B11F4FABF00DF15A8804B1937D581CFE4B6B075DC + 4: C170A746498F559F9420328A9CDABE0BD3B642056763C221EA8B0F8DAA94E045 + 5: 27153E6F8BBF2F2993E0DDAB90A8E0C489718C7DD36478846BC91BCF7948B04A + 6: 72E6B7E7AC538D5B2300B6F4155E129F3B292CA6DAE759A31ED235D4B51F17DD + 7: 4893848EBA7D64F98FB7C0A3250B08EDB57F51CCC07BF535510CDC6C448C2545 + 8: 90D1E212F3441600D5D64CA71884C48638B0FF5320FF4222E47003CF672AB09A + 9: 7E6BCFFA924CA6E8EB2168A496EB34E9FC5657318730C0D0A401F25D8F583D97 + 10: C403DC0963B7756F4B654C5F1EAACF4847FE32CC08F5BA4AB9B2EF3AC81F703C + 11: E9EB6574BA8D9FAE0BE95982E08DCFB674D24B887F2BB431F13547C8F99B71E0 + 12: 8BB7CCF6920D1F2BAE01E36C3EE740C2FA7D2FB3AACD1C67C01F5047CC75A605 + 13: A2549706D003F66A03796CCDB0704D343C63F779DA4F1A96ACCC8E0FF5BF1AC6 + 14: C95281FA6BFAF36C5E93F4853F8C08E13A0CF6EA8CB046937907EAAACE5F7103 + 15: 6AF95F7C442BB215F8C9CC56A5854B26711D480AD1F5877452BE426FF288F057 + 16: 49B3E7D802276CC9CDD5336B83AFD6131759C320D2D37854ED18D186EE8DA474 + 17: C125D1A259314E1F3316BF743F80CE01ACF8F3A57898070BAC2A79518002B957 + 18: 877D8B722417933FF97402A1617F724681FAEF960FD412499CFF5968E5311B8E + 19: DD3290905622873CD48E0295CD9E0DF494D4FBC0ED16E7CFB518854B290F3410 + 20: FC08D9B1E2EBE42A97CDD89321980D1980BCD75026BD5856391E1CA5BA6068E6 + 21: B526A243275DF3351E0834A62FF7629612627537FF3873A5A955B61F74E87340 + 22: F0FC1B236E7995C28A411F3DC7E9482F68B18EBA5F45612113F1E8E5A0EB9590 + 23: 29BD2B1501B3AED43D54804DC04D8A4B6AAB5CFC49D0C8F8BFEACD9986525649 + 24: 0927998739FAEB8FFBB317D03B0D7C9EE9DB56AE1131FA087F45EE86288B9293 + 25: 244EC26D5D6E886B06533940F7DBB40FDB18BE3A615E1DDFEF499E4A45FBFCFF + 26: 725F88DD0D86103E3043A47047224A5C07DD793DBE7EFC9BBC42BC9D9E73D6E1 + 27: 4D4C4F0600D4496CCB896108B5142035E9F0278E969996625265F56A13D9F2A7 + 28: 384D9C0D90753BB78A6609A69EA6368ECB789B77AB752484640DFECC9517E179 + 29: 49BB5A53DC021574C8A30C9ABED461609AC27876E8214ECF2DE7BE51D46A8DE8 + 30: 11D4AF98A21E5BF150353E1DAE2FD86156D335A8287A658512B6458BAD4749DD + 31: A4524D264137A4969F966064914251D8CC3835FC777F60DB86AAA08BF27B88D5 + 32: 63A1CE651B924BF6D00E220970816A9F40329D91B66BC141F683C147FC39FB48 + 33: 79891957F958050595300C02ACD64C653683D4F93B68A329ABA0E2F943503767 + 34: CA3D41EB14C5DEA17011F5063C9E6088900BEA37774C180D85C364E323ABAF7B + 35: F98F40AE387C389542F162155A315D4BA964AEC0D4E3E6ECEE14E5298DF63CFF + 36: BAED2BB0CFA7704E960D4C682DBD64E0E4411C4818E0DB04BF3959B706B09449 + 37: A89B07949F8E2726EFCFE8784FE9D8C41B1F9EE0A586F01CD9214866082F5F1B + 38: 4C0AB34AB27CC7BA096E9B2EDF576C3097814A9348A5B9AE0B86CFD479635574 + 39: 7EF645A6E6353231580F84EF977B8574E2DA8D8306311FE84F0822CA722D0BA3 + 40: B2D5F87DEC52BD5AAB1134441CCFF3F4FDADD02EF13281E637713970B3790C5E + 41: FBBAB146A1AC28AC41BFA01409A44771E206FFE435B8884E5C358BC1A28CB92B + 42: 77F762764D910FEC8C41930D2194DF3C27A414F688E4DFC5D936FC5030BCBDE8 + 43: 55ADC8A400FF3BF1D40FCDB83A5D26FC4352450C91D208DE3FBB4B03480971C1 + 44: AFD9D6AC75C8AE98D16A15D61C7AFDC22EFE2728FE01EB1D5B9D6C8168047782 + 45: BED58BB8F8581B92E34E4B770A2824BDA96E2E623DDFA0C2556DB49E54FB1888 + 46: 865B7876492C12AC7996C79D913B541F29F986E1CAD8CB2FE40FF838FC20C3FF + 47: D539F39F77BF62F7ABF2E6765BD285ABA9256CCAC70F86661F997CA5FAD4270B + 48: 5C4839FE704DB64128920CAE3CA4016E4A7D31B1BBB508F06A72D4DD570B1914 + 49: 801F1994C3074B6A468206579B3B78A94F431EF2A48EEC405A03BF496BC0DE06 + 50: 551D30E7AEDED675AF8BD47B26A025698C3AE0C7D32855EE5FA83F41F303150A + 51: A70E7A90060B0E965114F336C28BF9153FF2AEE6563A5C45AB913927082CA371 + 52: 82F12D40A669DB72DACCF7DF9C2AB2AF10FE952D8CE3EEAB4B89AAE130F28143 + 53: 78CF324171569F7DEF4400ADAE179E985315F8CABFCBD84F1062694566B85BA2 + 54: 70BAF36BEE54DD98B3BB75806D2BD159DFA597B9673C9CEFAB5BA985046EECE2 + 55: 0242878D7169446373B64D121C1195593FE22DBB8872DBF85FB6227662C41C87 + 56: BC3BAA6ED2E3D2A0E6E053960D2F58A4DBDCCFB93BBD14BB39CB65B4288820A5 + 57: 2BA48F57028C00D3EB2A432815CE1F8194437BF82DB761BE4432613457C2013B + 58: D752B097DD421BF28C8AD861CD55D67F15C20B36071FDE187189D04804CD44FD + 59: 1722F41EA907AA96C0D7117CA66B479F1A38E6D3B55C3F58D9671761A5C3F46E + 60: DFFC2E28B130B95969CD2D13840DEDB7C2B7BBC4A1323BE5669661F62F25447C + 61: 5883F44E26496E9AC3821CF991832F9A6E9217CA2F095A63DE0DFA95AD42A054 + 62: 12973B879E2F1810ADD0FA069FA8DE24359003008CF6F0AE86CAC5DBC261378E + 63: 39CE700048B22E5861FD32D9802F585F5DB4140C6DB25E0E96E3B2D9063F116B + 64: EFB921010B511146BA22454CFFE9FE6A95B11458FDFEAB11B8DF90357E0C2338 + 65: 9E768E700187B04C9F04F2FD39EC4C31CE5D5D4510EB284C34021AD68303AFE2 + 66: 27C89697649C72BC616B9BCCA390DAC87BDA1724CA8905D981EB38861DAE2EEF + 67: 0F393204FE1943E4074CC20030AE4D1778DF745DCA0C85C16AE190929A223473 + 68: 8D2C439A7F8AC1503469D5B0A5615FA1EF76DABF46F4199E55BDD7CAF4299B8B + 69: F078B8EB782766E8910763A8B21794B788F9E76BE8DF491AA9E7D3CF4F5776BF + 70: FC593EA587568051450BB1E951D5481EFF200478798D9EC50B6B02E83252F9D2 + 71: 247E82E689C55077F0C1BF7E652E72C0B373C189C5867189B8B9E3DE3664B897 + 72: 119CB9A78C023F674AAED82BFE1E9028A6D550A39AC22CBA0F6FF6DB05D05F43 + 73: 5237847916449649C2B6CF12771755093359850BFC7FBA157ADE79E5E2822B40 + 74: BB80C4B2485C7DBA5E73035AAEEDFB973FFAF67FA2E691E300412A7712FA55C8 + 75: 34B23D5707123EE7513D08E03BC5121E45986DDF508E8616ECD1349D40B2D8E1 + 76: 3D91F3216ECD7D45714ADE20457AE23F6C92AC7BA301A54ACED35F8416868572 + 77: FFE85878BA61569DE803F1361FD7CCEED5939140CF71CFA371E11D6F4CE4F708 + 78: D8403D5015C025EF2F1273558AEC3927835FF2B4B2F52427C2FED2AA15AEB3EB + 79: 0161395718F3A2171699FAB377A82F9AB16B1C3BE9CED6D3EAD22C19F2EFC537 + 80: 27E55DE15A0AFE7018F6F09F3601F2957801DE3F2BEA807206B4E7CED2DB8199 + 81: C19756D0FD605D62322080E22C100A0B7101A3818A39568602E052855F4304FC + 82: E3F162CA1D5E431FB8CDEA00A8BB0ECAA555ADF4113EE837337434B2C43E7408 + 83: E4AE78BB9B42109273D433E5BC67D918CC8348B81D22F639C16FDFF6A0A9D748 + 84: 9D599C8AA519D1EBD121D8F826794D79B359C37D59215B4187A4A716126C0F07 + 85: 793081487DCF188411C0513FBE7C9F350147B3E09B285258ACC163C703232913 + 86: E68F8985FD2E56173E7A1CF65955738536C80858B30751F62B91B773DF0C1EE0 + 87: 01B7FEBF76A44BFAB141DBA09308E5D0BAF9510834D21C3C76D0ED30592877FC + 88: 0D17E976859100842621144A76DF72BB29F95A836A72B23C47BD1CAAE60A85F5 + 89: 340650F975C051A499E2C5DA305516129126F8AA3C73E8BE04BE4958CAE42F63 + 90: 1BCD66C88670AECFBF705F49ED86D2090A89ABA5FC0F078CA4C029FCDBC13DFE + 91: 9B3F9D66E901759F0798B8E6C99FE952DA0C9A18DBC02D3B811BC1A309FA0F6A + 92: EC2396E05B1151102C5825F6442D8B8E911C5E303FF783D5FFB26004C996892F + 93: C084E091A7ABF6927B63385CAEC91032B8594DC1AC394A512475E27F9099AA89 + 94: 786CCF4D13341FFDC5E17CD6A8A4A449BCD78FD884E4413F8B25BA2042AB5F9D + 95: CD7BDAA224DDF56470CA9B7D8ED3EE2EBD431522107397322B34A4326652B462 + 96: AA736484E1C2955D67FA1D320EDFBAAEAFB4D6C68743D1B4594735545E51F123 + 97: C0AD0BA65438149769DF2D1DCAAA50C05A5C40CFD4B60A7CD689825804A0D8AA + 98: 903717621993168AF13BE2B16F0008DA37885D8A36B748E263A9CA779767E2F9 + 99: 031C7059879885D6EDFC2E17475172469F560C90B1D9EF555446662B291DD394 +100: 65DEC0535DBBCBEE8D5F6343A42D00108E6F3F68BD46EC13AA0A6E0A42475A30 +101: F6530D19FC8CA5D78D60AF7B2B8C19CBF59DA0B71E7457A80DC031AA77ACE615 +102: 2D00D07CFC276203D8DEFF66D954AB1EE422B1689E7E23838213A26023F82EDB +103: 6796A084FF352743D41A750426E7AAFBE5412702D087C2CD9E560FBD5E8C33F1 +104: A9E8884926115E815C51CDD480D636DAA75C2D400DA2D659F2813E6161C13672 +105: 6E631CFE75CFC9C6939EAC7232B0B2862FFD471C53A40388A5CD7808DB78F1DC +106: 9DD2F27BCACFF12C3447D0CF5208B597FBEE4A967E910080AF2175CF5E2FE9F2 +107: 08B2333D3F833D7CB9F599400D194BD807460E6E8AB9783767BDEAA108AF7D38 +108: 6CCA37F73B7AA93D948A467E6866FA5C150484C32726E7B6D2F23685379692E3 +109: 5BB12131D1C2F7F668034817BC7EDC8D3F08A932BCE993B7E270983C98533063 +110: C4214BA35FCB5F77EDC916B5954772FD90A8746BBA61797E3CC196C73CE817CD +111: A286E879ADC84DE575A6B59645825E4D4F55246A7ECF169D8554A65F62BF2D87 +112: 4C0890D5BCFDE5F01909056FE49666D4ECFA7DD56DEBA11A84516DFF5B5F1E37 +113: 23D88A6441492B08F932430FFE8E92B39F2598B46BBF974C96761390388C0F1A +114: F03BD6F980D353F6A4BEE16EA6F95EADF814D82E64D47D5FF28F7CA3B11C61A6 +115: 12DD7EE2672C3A876694C05BD350D466647F0ED32A039F1917FD1109F007A473 +116: 582DD21F7CDF4DCB58BC8882D181C87B78A3AB0691C7ECE77C239137C0A5D85D +117: 8C8BB083C161A1EF9F161C6143159FFB1E993B568042D1DBC440ED363EE0843C +118: DA72596544E494A795420712FCDD1B5B184D80860285D449921E25E2AAC87F0F +119: B14227DFE83491CBF4096B66CD30F6D582FDF508658B5DB0DBA566E04459E443 +120: 5E2AC117C01471B83179F09D6569E733FB6012FE82EEBE6E0A284378EA98DC4A +121: 7964D042B2E63053D39983B25B91FC40D0A79F2C0A7AE9B17DAF958A746C2BF2 +122: 2F3B1982F6F036B3113A5EDB83C330DA70DCB7029C897C0F4C5957A38D3F47A9 +123: BB9531D4EDDBE2D9A1ECD3AB11AE50CBA7C9952E159F2985173CC0C5065B972F +124: 5366BAD10FEAFBFA174EAE88B6452D23EF2EDD40D581B7A3A650DD50E224F5B9 +125: 4E22C02BB28FA26FCB45018ADF49A89DEBE1845A97BE92466C0744FD3D7B08EB +126: 997E86FC2E5A561EA8BAFDD9BCE086D3E8E206B5C27AA497845AB62E0139CDCB +127: 46925B5311894DE6CC0A42F439B958EEE32537BF73A96D4B6886A83B1A373D5D +128: D04D93977FA94A57D95E476034103827AC21B65132AD34658844D06CA923FA3B + +HMAC-blake2b-160 + 0: 91B41F36F10A5F9A3BD170E02E517BFFE5331384 + 1: 5D5CFB715ED31E9137447075BD5B549C07B3FDDA + 2: 3CE156D7DEEA2048BF356E8F6C8B59F5AF04AFA6 + 3: 92F836EF5726EDD58DB9E4B4FDEBC597BEDBA589 + 4: 218C4DD898B801320678F6FFDDF87FE56FC786C0 + 5: D96E3A018BCF20C9FDDEF1930C06951AF345C818 + 6: 91FA0CCBEF27B754E2C64ECFE6844814F6BE8620 + 7: DDCFDC2D726A97FBA4CD317CD3F551FAD3331045 + 8: 45ED295E5338B2AE02FB952DA9BB61BFA6071CAA + 9: 61A9AD603F3695B8D29A2FD2A4C363CADC0A7BEF + 10: 1A773798A5925F28F93BD56FC7BBF50E1EF2D721 + 11: 0426696949AB75F41C73EFF0F30ED3E286F677A5 + 12: 5B83AA227BBCF05C6C4484FE244B16CAD49B839D + 13: 1777DEC2CA55AD6BE3E492135EAC2C4D56906707 + 14: 4870BF4800CCB03AB2421FA1FB391E7D60C2D97F + 15: 0C469D4F28620CF7F90B20078356989470243D49 + 16: 2287F572BFBB2ECD49A50F3EADB2A3B9E4B4876A + 17: 83432F240A8987F3FE97D81384A417977E5B01D7 + 18: D2D705511C9301F107C133898380F07EE64F4B46 + 19: B517EFF65145A0EA914F4D8A9A0C3BA99837C622 + 20: 07A27E7D51B28D64E9F4E86EC4BAC2B4CFEE4F71 + 21: E3001AFB1FB326FB56E9BC266995FCA21E585D1F + 22: 3F01F2A087489B17E266C046F96D770DAA75B32A + 23: A47CAAB757105BE824943485CD4E5A894DA4B2EE + 24: C79F3C3E44A2CA66E68D15490E708FC888C656DD + 25: 3811AD9174A05E89FA6985D1AA67CE719ECE86D2 + 26: 0EF02F1D60910E439A169D5CF2CF88ED49F977D9 + 27: D783EB1CACD38317F6DE37AC4B4BEDE6145EE0E5 + 28: 1416396D5439FE809A924B0048C37F7C49C581CA + 29: 810C7E4204C9C2D0F2C54C0532DC6CBEFAB89044 + 30: A436140726FCEC72AF39434914FE4D534329CC73 + 31: 8B86710154FA4CE04C0C748750B2FC86CA8CD5E1 + 32: 5367509112CA9EF7263E2C50FFB2605E7C870E48 + 33: 47D269F4DDC5DEDD79A055406065D28FFAEDBD8F + 34: E9C48F8AA577628AF49C4E21BC370C25EE632E94 + 35: 8409505C22BA85040F3FFF39A7B1CC7FA9D0602B + 36: 77B6482AF6217DFFCCD25A9934C9FD878AF5CD0A + 37: E9E6AC21B91805468E121293949689F7FC4C0294 + 38: 1B9C111D6604A97C246DD502A30C44E667AE20C5 + 39: 4EAC3E4BED6EBA2E7ADC66DFD32D06449E7D575B + 40: 951800DA1CCF5431D017DB2D6B4D8ACCE8D97841 + 41: DA506076CB4737E3EEB985DC7AA8CF3DCCD45EF1 + 42: E427D5314F4C672AF8C4DD932D1554FA66F9AF0A + 43: 95BB99ADA3CC66D2249FA70EC21A1DEBA8F33AA8 + 44: 791EED39EE89CAB25C590BC940C085374AC07E14 + 45: EC9BBDD1468C2E7BA180FFA1744FA55AC83CAADC + 46: D61BDBBE513ED4E97207109BCB457C2C4C6C1B1F + 47: 08829726D269A4DF0455746FDA30900EA89BF85F + 48: A5A730B7BC19A473271EF8103CBD702E2C690EB7 + 49: F889A18589FF7BD39C9240613CCEBFB8506C1888 + 50: 6A11150B2411A7EF49B6323150D57893713C4DE3 + 51: 3D21C0233D6A7BCA5D3840DBD3DE630BD11CFF0F + 52: 2B389884899C1CE9E38232F668B89AC19E11B371 + 53: 2476925F06549A759CB450DD30312A216EADA4C3 + 54: 15DAD84EED1986A004107068C9A0D4AF6C86EE5D + 55: D8B2B9A72EF637651249DC810E094BC398FB7E69 + 56: CD0E577D787A997EE2D45261182237C950027707 + 57: 517510E731D667B2565BAE6F53B8A5ECA13990D6 + 58: C2EB5066908336DAE8CC85F9264677F00B01C5E5 + 59: 697E197A467585A9235AE463BE3ED974DAA6B7AC + 60: F60DDCC3D5BFA9C09DFEB824D910F7798BBB9709 + 61: 381F8CDBF7B84B0D90B6AFA5A542058CD712FB23 + 62: 5FCBE74DD172AEF23454731AA292549159FD1C2D + 63: 1022AF30F8AE25F92257571AA901F641A1A0C161 + 64: C8E9A2E2804B45F4A1133CC35EEB686714FB06E1 + 65: 7827A6CB25970BA6E957D6B870C30548C08E1D13 + 66: 8CD063D29160B06519D94F269A7E63D10C9D083E + 67: 391032B2A264C4516C349DEBBB92FF457B0EBDE3 + 68: 47237083EF729524980E750D8DBA10940A31C87F + 69: EF3823E526FE0BFA96A59AA01202A1D9ADF5F6FE + 70: 39C00C41CC48A0C12FAA771910C140C979889DA3 + 71: 3CA776F737A36BF88ADD6F0873AA4CD79B7AC08B + 72: B5505CB70728B304E562F830D1B541330EC09641 + 73: 164B95A64F6AC4AB7778AE3271758E57D68BC0F0 + 74: F737117005CC32C9CF75149866FF62C666712302 + 75: 3325BA34AC267A2C070DBB6DE0AA14140D43B98C + 76: F7BE840F96EC0E7C1A563858E08DC4A8C05739FD + 77: 779DEB8903688378E81E7596C841EBA80C020D75 + 78: 24A55B6FF3A5982771ACCB01FDAC787C127DB872 + 79: C97B5306FA9B6D6F0F1F86B9BC82D80AEE710C06 + 80: 8D4C0AC8828FCBC9FEA4B8D389906F5447BD7841 + 81: A1DD2E5E8E9108D29E875346D7F5DC0A8BB88E21 + 82: FA80CDB34733FDA40CFF883185905E818FE99906 + 83: 53622AFDB64A6B314250D449533332CE50E54D44 + 84: 0B678F2320733983ABC2740A816FC3AF6320F6BA + 85: D8BE658D14F67C6ACC8C69328605C35B9D63ACA1 + 86: 0C0D0F9C1E1D83C652BDD74007E34636AB33669A + 87: E619A83C29304ACDD171CDA3AAE6F9DC872FF53C + 88: DE9725D99551CFF1377578BAD64A815F1070017B + 89: FF21E0F39C91DEE778A4F06FB02B92FC657C177D + 90: 5B1021479562EEC8B6D3BBFF04497029C97237E9 + 91: 0020D098252AA355C0F0F4CD8EB34DBC0B73DCBA + 92: F8F35EC61D590D228645336C1F815300289CD898 + 93: 60F638CD649A5EC518EEEA5A4B2D638DE2DDC7B1 + 94: 6C78A0C129AFEF245F7D66A6FE57FAFC3E28E10F + 95: 9013B5174394CE01ABC175F8F688E234A4FD16DD + 96: 34783C4C0F4F9321014CA6DF7DF766E54F5C96C3 + 97: 3636D4F6E5C61EEE4A86E14ECE023F5CDB15D46C + 98: 4E1F4AC9F841B95B2E594BF6AF760180DA1D03AF + 99: D6EB0C8996370720C5F9C220E9E68FDE34380E30 +100: 5F7A0112511E35F4273C4BF2F1F7E724D4522DD5 +101: E5FA55649943517931FCC903A4CE4CD4F491289A +102: 9F53F1332F91029DBD32BEBF5DAA6C0DEA537DC5 +103: 4B8715D7E8ADC51077A29D787E48B11557408204 +104: EBDDB13C99F58B6E5EF9DD448B1895CCEC019E69 +105: 027651A8CDA7E31B876B9D3F0510CE0E4AC7A63F +106: 8D38DBFB024629BD83D7E37CD81B4E194B18977E +107: 4D1ED53492885F6E071A66374A01C765A10A8630 +108: 3AF73ED62231B543A258BA74CC9E892434527D0C +109: 1F30A0AE1401CDD15E6D0D1464B14B0B25F9E8E2 +110: 57D86CA815F8CF4C0506ECA8453C4015FE252C74 +111: EAC5D0315CC5E63DAFD7E6AC42BFB6731FD5B90F +112: EC7F3E81D1C76792A984A590A447427D55B9BBFB +113: 46965A3E137CC0DA820228F24D2FE48A51EBA32E +114: C952D772005A7C5A51F421D97C4E8E13CA49F294 +115: 4F294AC35EC97A70D9F26A26451FE8777A15924C +116: 64763832C0EED10678DB46465E0542CF3D561CCC +117: F3D2E5FAC9EB7FB5F2A6D4815621F9CF4421C450 +118: 66BD63901F59268CC04A184919DB0002CFC86741 +119: 15A0694D1D2192BB38253058EA2087D5F18EA4D6 +120: 92F0CA14F48B5831C797BB11CEB01AB09DDDED30 +121: D2B881D1AAFCFD3EA7C345D98644EF9028988FB3 +122: 89CF09EB477226E70A192C6261252EE50FD2F262 +123: 23766C1705A6C84F9C09936BE5D89DFAD33C70B2 +124: E5AB4272EFC7E534987DF0D1DB00AFCE0B610BB5 +125: BA1533A83360E295A5B02916415F19A74BCCFDE4 +126: BCA0F491597C809528F51509295F86BD0E1AE5B1 +127: 96EDC04327A391951BB3B3B9912C40E11C7E20D7 +128: 9E34D0C76C1C208007C79FC2E9F537F717B6BBFE +129: 24F6D1D900DCD8F836828DFCDC40C861AB73B552 +130: 8CB4AED9E93F93FC018C854BF3AF63684FE2BAC2 +131: FFFD7638161CFAFE2CB4041D04DE867D9974F0D7 +132: 56B919EEC4B494D665D3DC49C10F30FF58A78626 +133: F85ECE077F8C8EBD4FF96A6E42093880EBA0B832 +134: 6D94794B606FD67A2760A6A9F7768B778DCC9F5A +135: 7025DC803EA0CE00F533D265753C0EC443393501 +136: BEC1349BD4E8B0D456B2E808D7E19FB38A938637 +137: 10D6EC94DCD27FB67DFB07595EEB8791C1C98DEA +138: D1D3BF08EBE9BC2C9543CADFFD6B31C235EAC392 +139: 4CF6B180C42BC7D00A56044A94594F22296C1FDA +140: 504427586B8AC7BB3B511CD0E7620281D88B9947 +141: 385A73AC9A075E3989234C60EF77C1B2600ACCA1 +142: 0D1696063C5BE42C71AD36F478B4CE0BF4F54D68 +143: B524145D384980E983B98D31DF80CE097B5BC235 +144: 500C8200FCD89A14A3D2AD625F57AD0B93007D4C +145: 860B11F1A6CB6B8598CC8428EAF7B1633FD8BF0B +146: 6C0FC9148016A8B1E6513B8338BD81FAC9B5F6FD +147: 7793209C2613B32D2B410507E0FA115A660BF47D +148: 849E1B1FDB5C6AA9E7CDFFBF7434DEA043C94B60 +149: 99784ACE6D1CC66E3EDD4460D223529B7C41C6AF +150: 2E7973AD078A82630CDA2D30B4C4B0F220CF04E2 +151: B6B46BE8A7ABC4F33D0EA4BA705C9AAFB3120DAB +152: 94F8DA30825AC75342B21C3AA461C2FA09124C68 +153: 8A9D1A8F07A517740E966687FFCFF37BE79032E2 +154: 6BDD89F93E8EB17A0C4C25C312D656F4EA73697A +155: 695D4B4361A4726EEE929064218CE25EA2993189 +156: 160F8EB2FE3C12D993DE2E0C8122157E42B64467 +157: 22D444366FED25B20132D00F531495E1250DF2FA +158: B73BF87C324BF91F55E6E82DE291385958505094 +159: 70555E62D15441B430845D2439287A46E44E65AD +160: 902CBC04D89F2CA95FFCDB28B3CF612D5AC60FD1 +161: 4DDBEC1B9CDFCDC316BB109C14B981FE3AA79005 +162: 35527A466446126080A7D5BC4EDBBF7263208FBC +163: EF9A850245574AC3BC03BC523D0BF11A946BB43C +164: 81A62BA66250C0E4FB6F3413608F953282028F71 +165: C77D5612686519CCFA2E9626D0E3B729858B128B +166: 02472059AF034DCE8F2DB835BF861E5B03E11F1C +167: BFF3366670E2A9B4CCEB3EFB73AAB6C6A9CF31EC +168: 6E124CC3C5E8E7048A1AE272B1A98756053F35F4 +169: 38F00373D0E0BB5C3B51FE9E83674E9E3DCBAA63 +170: D7ADFDB44F0B48F6DDE1BADD51E71CEC4A54F746 +171: 8369F354D0C03BDD25002FBAEB4097C82FC6FFF3 +172: 1CFBEB3357B96141ABE3174D3747531FA7CEEDDC +173: 2892004E23D054F5F201F5163E160E2B3F5F434F +174: FE5ACEF4E51944EF26556D31432536B583FF3718 +175: 430E9A5C642E858C83BED9845BCCB3BF597B4ACF +176: 026A695AEC601C04A68FC249775B3F658DB56522 +177: 73A8AE5A09963B90256F7000D745E4B405657BF8 +178: 39D7BC6FBE317218A3067520A93770348B7D06C2 +179: 9F6725C5C9824C2551BA41B7A1BE8E7CD3877C61 +180: 4FCF1A8A95223AC44316D1CE8D1CFF05A9094C4B +181: 55EC2376C84494232706401A5EE935506AB3593C +182: 53067496DF6FE64135343EC9CE7652F0AE17AA4C +183: 1E7E857E68CDECEEEE2F1D9F53E2A25DA86396FC +184: C1600FAB2CF3231E8A4820314F8BD1FE182B2F9D +185: 02CFD49DBC6492781E28C0E43D9ACE3B3EDD8D87 +186: DDCC26D3E8458B3269D4A39AB485207139A514D0 +187: DF1515CA3E20978147CF4E62224C88F9A78E6C05 +188: D05EBA45E23870CBD4C32556A5CFF731469B96C0 +189: 4DEB7F6DD512E7C3761C3B274C4DECFC0E4551C3 +190: 239D8D8F1B7B012ACF916F168A449721EBEA86D8 +191: 7ED39DF9F3C7EB62B3E70CEE8AD80D28EC52CF09 +192: CE70BD3603CFC7E1C55A7B775CB94D992E941AFB +193: FAB476B601B3C1E3A47A1FE1DA96A0AF71880A71 +194: 29DEFED7BDAF54DA7EBB500FA159CA55042B2A67 +195: 12E0903B289CEBCE694695A50A3BAF4ED3230FE2 +196: F41294C939F0ACC186401EC0E1C1B6B9324B9D4A +197: 0B3E7BA883D7909F78E5585D377C6140F31BDDD9 +198: 70495AF1F81FC652718FAD74EAE3D8842F8BB55D +199: 735B1966FFD58D5741EF34E52CCD960E548FE0E2 +200: D2A39D17077D2D973585B7118A60BED4418F9D2F +201: 4065C3B1AE063E44942F21F74456D31389CB375E +202: C3CACF4093FF3A77762EDCE18789631D5E9114BB +203: 87977AAF6F78987EE4A729F6B1069352C03B8259 +204: 17BCEB4E0C773A0EAD196D259AC15C81530A44DE +205: D50896BCCA9B69A14C8F96F3B7D514875FAE91AD +206: DD947612B02A2B3E9E1A2AABD4A7F4B630B18021 +207: 78797676313EDB42996D08982F1ECD3E1A9DDB85 +208: D3CF1E2A8166CFA5B2EF1A6935633956C46997D8 +209: 1DDE50AD80DCF35167B1ECC7A3A0AE07B7BCDA2F +210: D2E7085ABA3FF996D46D61407B9A1FCEC77E3591 +211: DA2FB91F8F2C30BF0BF419A297D230C7C2974A6A +212: 56E79F5620F97221F40770398AD56F3DB7326370 +213: 639FBE4B78BB4BAE556E4B5E39F7A09CED54ACC7 +214: E7A4E2EC2A58779FD15B7371FF2B8C9464DBC60C +215: FA0226413C1E39C40CA6924F88FDA62B3659929D +216: F3FBA413EFF99AD1AAA832A7E4E91A5DB92F0A60 +217: 3D1BC9D1E3936C5C8A56ABAC688A7931E74A5447 +218: 12332C438A1032D1E0310238AD8616CE90AE1076 +219: 0094AE3A0140D6F41183A3D71F513B7D37D7523E +220: E0501598D086F7A749489A1E94E58B39B20B0E41 +221: 0414FE449C5BBC58915C8134565E14145A9C6B22 +222: 27F2323EB75D2BF455AF1A4B8844809E4F6C7561 +223: 69124FC993FF512968D1DD2C66DE6995661C6A76 +224: 2E908ED58CB6F6715E43EC988826F811D74AF159 +225: 19F815F7E9ABEA2C4C8C781C13D4511E6C9B9C99 +226: B63DE59953555718DE5DAF2D35F096B7C6E9AB69 +227: D002F14EA3C14233C1AA1F990F14F377F2E50705 +228: 234D683CEF16842ADF236077E7BFAF59F1805852 +229: D8BDA8BCCF7850293F9F7F82C9866AAD9BA27BA6 +230: 57BB61352B23FA9B3CD11587CC83E9B7547065C9 +231: 81F3664801DEB387B8391D13A45D4E0576A5B8D9 +232: 89CF0B3DED84D683F6A8176F48A830491F83BB77 +233: ED66834EAA82BDAF54B13E00D1EE46D716A3C806 +234: FB52313807A161C4BF1FCB6201366A44E5BCC655 +235: 6D8B84A35B48E2F3DC16D4B7E73F74BAA16EEECA +236: A3319BD60DCDF72BF076CEFA347D2D4C5BB60CC0 +237: 17DB152295D410B56B70934C6279DBF897BE3CAB +238: 73F5C199C45D70A15DEDF9E5116BF5FDB29B5A5F +239: 26734C86594D1549A4E5C93F0567194F03159A08 +240: AB7B14F5D55B55B68C981B3FCFF47ED615709CA8 +241: DADC35B7D37732C14665089103AF7D83F55CC896 +242: 9C0E3FEA3FB98BF4BF56207F6205F6440BDD2559 +243: C1473E91A846DF6E6F5132E01DA171A3622AFAD6 +244: 9C83212F49441F0E7FFFBE594341CD1E7EC9D75B +245: 93EF7E3D20709433612485F96EA910F71097D329 +246: 7078DC3CA059352719F5592E3B5E89BF2F632296 +247: BBEDD4C77DE663C50757B3D5FC490D2B8B9DBCDE +248: 0461A77102B4EAAD2F5794F596DC71A564A8FA16 +249: 3E27194189DC0C843D41E325BD4BB4984EA7A09D +250: EB144A3DED47B5DF4CE7160918AF579AF44A6819 +251: B495B9C4225D1F2CCFDBD13439F9899E537C7DEF +252: 39C768C21766380111A8B44052AEC0CBFC5F0499 +253: 424F9A6A2A68FEF9FF958BD6F88FCD71563572E1 +254: B31B3AD109D63B575A3E4EA61CA899CCCCD1D520 +255: 85B745185F67197DB09114B5AF11261FC1BAD1B8 +256: A9E4967F95AB2566784755FE625366E7CE4AAA57 + +HMAC-blake2b-256 + 0: 652C4818A846DD289D18D38C934FF0A06B2A78C3A1A4548D8CCA2F2B38C35683 + 1: 965C0BD4B4C5B060859C6943860F11BC438FD1A7133876851B33C470225247CF + 2: 81B04471DA1B28D80043C6299986FDE0F227BBCF873EE065AD2B850C8D6FA7B3 + 3: 4363D8674B928239DF975199E42F65F249872183352BCB7B16B1D25CFE9227F1 + 4: 03BC4B9048EBBE83D915106D2A25E80FB50E24E2163C6BF50FC5D160FF680FC7 + 5: 6F3B2A87E4170B4366D591D29A6C4148C41D600294FBCEEE176325CB0BCB9048 + 6: E97E6318DCAD9B53B8FDF2D697D874488C3D8717DE35352AFDBC7B845783D091 + 7: 8522A943DAB9883F729094178EE0A70E8141EDD2831DC6098642CC55559D0F45 + 8: CCCF2B73708CE2C824A5C46A6450486FF56181883C7F1EC3B61320CE890EA8C7 + 9: E241F9C373DDE0A81E5A8EE770BB249646BE00DE0A0C387A173FDCC3518F8254 + 10: 7AD7D93BBA15644E3E6E0FCB3052C61A3B2CA4DCF522FBC38FAC897B9A2152E3 + 11: 91F4B49D5E9975D809A834EC74BCF60BF1728C33F331FE2EF7E1D36A4F957FEE + 12: CEDB595778F1A2305351FF5F844804D1D6A28CBC5E72459DB1361AEAEF0A7EFB + 13: DFB2B31F9C964BA9123D6D1226D76EC00BE21F3939838A8C404070CA8C0DDFB5 + 14: 4EECF16EB573FF2F6A86A0F982E6572A0FBF8FB81253BD33990190CFA90C9107 + 15: D4D71A7D58806AEBB87F5B04CFC8339B2AA9E2A850EE7A996EB99785482DA370 + 16: 6172B2551C40957D3D602323D73159E2A90212E9703E7CE2065C234ED4F1F319 + 17: 6B099A1383B3FCC7F4B81E98AF3398AA988A7EE729E7005A5DC56BD3F907263F + 18: 9A2C6C3C285BEB4576C6281D3B17D308CA97CAC24EF55760308E3C4A0A25433E + 19: C6F865EB1164450115BEFE90F73D03F2AF950D606E86F81396D0E23B2ABAD49F + 20: C99EBAAD53DC254027637332BB816E246A6CA2BD8719C77A36DF9AFE610E9603 + 21: 1B6027BF1495A715EE232A26B6856D398F38899FA7F81696D87046C1706A1D10 + 22: C5F87692C84132ED72D8C3F666B583496A17B427AA5A55C3727E706C0C74BE39 + 23: 1601E725B874792CB56AEFF94650F40398AAC1FE02F67B30C86CF247162B6749 + 24: A79ED034F708504C7C14916A918E214E9D2665C40FAC7E5A407953C4B73871FD + 25: 3F7E96EB8A8AF85A1D88E286948697B85070F60FF651A51673790E580810F984 + 26: 21A6A1BB4F45A11FFFF69300B23B00FA6B97E728BBF1EEC99F7ED49BAF1F9F16 + 27: DF2E45C35B53323DDD4C6990BE090658AB6148E84C91A1EFA41498F8A8863CA3 + 28: 1A276A6BF0917FFB7D731269C384AC1AD33C3F6B468A2DF5B2B09F89A3D30EFA + 29: 3A3415215764F985B347DF8195BA50B495CAE26D73D497968FDA48C8F6C20891 + 30: D3F0E1CB156DA0339BE0C438E440A01C36AE1C3D979006CCDD9B4C04DF45276C + 31: 29F96F3085637A80AE4DE432B4DA434A2C721E3ED1D88A14B16AEC9856CA7E80 + 32: 81B0EA26A21E8640549739AF8F8906CD31B51B69630386D63922C8F90CA67AFB + 33: CD8B95E8F45A448467A2A510D1189AE5004F92021F2D019411694BFC1A286B2A + 34: A514AF45CBE2947F23E9CC96AA4D65C227C56BF3A05B37A9B77F35BD6658BB77 + 35: A40A55D992DA46508EF9ABD209E14D290C640B36315EA99E82B7FFD3AA216805 + 36: 890D418DF1DB48670A9C911518D166B02A78478D8950BC238BC73BF55B9C6A99 + 37: 888E57FCCAAF5CE6D44B0DB22DF86022CCD297274CA327C050335B7E68A58E69 + 38: 9D309D8F7ED42B570E66C33C647CE19B99BA34930B5C19E53DB1984262FEB3A0 + 39: F63409B60932B087C4D8BF3B7ECD3594A78E6B16A4A51D9D304883D340DAD98C + 40: 770B12D90238C8FEB8940947BC9448BCC9D19DB4D4D3B62CC277354C1FD9C6A7 + 41: A3661CC87A5A2E959A426CC3C2EE15DE0DB7A5177F2BE4A340E79CD3CAFA3057 + 42: EC2F7AEA80A24DE936105B15DB6B0FCF63FA1802D00313540DBB4296781BF80E + 43: F506A21EE73C5289EDECF0C3916AA0D0A2803C64613129484C22A8877D2F766E + 44: 00327A62D4FF46E6BF985BE450673900B1F2C58EB1BBCB08D6FAE06A42B32A79 + 45: 680780C2B502E7347772F7B7156706221E081A20F04A8B4D59113D12BFF3C12A + 46: F1CDA40ABB756C358B9F8E08F38494AD7CE16D9E1DB10EB6F61A54B2742E1FC1 + 47: F4A5DDA9C79FFC2754C14AE60082BFC7736B70BD4C3A1A2A0780365F17708EDD + 48: 6DB26F90FD7459F3D50F6B53A420124FB679C200C28559CD9F73BEA9D1F3F6E7 + 49: 4CF34A6CDFF48275804B90C9D29842C741215150330FAC49A33BECF4FCB5694C + 50: 3E7A195C034BE44BF7645009EAA1F4A4549BE3E6AF239CAEC3083B88EA15E7A7 + 51: B83A639653CFEFE2960545BD00201B68FBFDBC230029816DEDACB2A339A65A4C + 52: E5B93DE67B8AF0E7B7877EF60725363F02353ECB7AA1B15719CF72618DB5722D + 53: 9259AE1B51CF93D13BDD0E66DABF52C353CB560FB78F4121A06F37E34BA60572 + 54: 7682B67AC15ACB47A74B6B252E0A07DB3267A5F30B25C76345024020641455A0 + 55: 873C71811DB064C74C952AE0210D035A10CE45066390C6E28880A4F3D113789B + 56: 8B3BFA589ACEB6EFB39D987E0B6C9E51B889B16B04C83CAFAED3473DBD028B8A + 57: 270334E92C8CB85A995F05B2B712F8CF76113CB609BB967400BF69A199BAA29A + 58: E310245DDCAEF03C50B6EEAE895A4D5CC3911B55C41684F8E3599C10A9AC5094 + 59: 23CB6BF0F634DE484960738B1E5C16B758C4DB6850D4ABA906E1B146F591065D + 60: E8ED01354FEF6718FFCDB083DA60547800735E2FC2EFE4B902C030C0B8FCFF1C + 61: B1F135BF0FA659A289A5910FDC993D727AFB90DC2D06B3CEC2A4E68F5606603D + 62: B363B808582E1ECD288BFE85D91EBB2E258509A2F4A0B8AECDDD5E6CE454CA5D + 63: 51093E531663A8C26967F6665177F5781BF62B292282966B56E0C3CF81885D58 + 64: 9538A7FBFC83E631773CBE148CFB43B064BA117D4F1686A1F1402DF7D806DC4B + 65: C7E03CFF242283FBAA23F20DB7E60CD70564967C2319A183EAD34E51DC8E3D6A + 66: A4C7A4560BAACB777F48D651C5FFEF55F44048313CEAE44A1869674C1873F9BC + 67: 9CAF35E553DADCB73A42FC606C66AE4A7C68EA4C8D6D0D5D70E03B514A9D89BD + 68: E9B66A6260F9EB9526AE6335A9D6AABD1C1C63980202338B3282CD9AAAC9A7A6 + 69: B684F469236F7421FC7211B57F6FFA6EBC29D1535FBBEBDF6964EB086E9513F8 + 70: E44168C8E6511E675CA471CC753418C2A04DAAEC60061EB4F687627CA3C1C460 + 71: F857E2E3E27E1B9481A3A4E261DFB06EC1A5A2FD39AA8D884A35B7DB84CBC25D + 72: 48EDBC181098C90101D479E9F577ADCEA5A26F0C4D202F2B84B91642439803E0 + 73: AFD5652C7E77CCE446B8FF5CA27DC18B41E35FAE1AE3865F55F1B7E2B4F26A36 + 74: 325B27B3F9EA7C643A46DE798E7189462EB82BBB4888CA4A78E9F21B9869D7E6 + 75: 15E6CFAF067D81AEA560D19D470C985C4DBB89F04C1FA801732BD0B3D9FEA70E + 76: 9EF6C16174701CA971DE17D8BD23231279CA95F70C3E3016A90F281FAF204564 + 77: 149F55663BDEEFBA13C6F3F48F578B6BF2EB8D1AF19E8C2B351ED46173A19C4E + 78: 474ABA1288EEDFA0138F8233AAE5F7ECD82BFA11A19C15B022B346BAC1217F50 + 79: 8FEE8749037FB69499BCB71B0B2EC679D739173B572C8F15A336D6C06602A69B + 80: 2FF471E60F81EB1D917E8056D338CF1EBC622B9EBD7B35C95F43182068F9D274 + 81: 23A766EDB11B74B7B9E879C298B025512798161279DF6ABF55443C6F099A30E8 + 82: F4B2E6671B1D071374C9A7E8C0AE53AF8058B238C0025CF465B8761138A37712 + 83: B280A33C87A019503BBB1846570105394EDFD76F6F8799AFAE95C345CDB12B5A + 84: 0F7F6389A99AE5BAB88B8D51E61DB4C8E77FEDFEE37803D603A3E9D35A060F9E + 85: 931FA282297E4F58BE0DF321F63BEADC7AD6AE0E982761AAF0286C6953660E8C + 86: A48F1FD5E913903FBF7FBB358882F038C192AEA188C310AF9D1ECFD5B4FB6CA6 + 87: CCA246F0CBE873C03EDA960459B8B6AF9F3BD10876D3331C0700FFA2C4CE6288 + 88: 0C568638D74B33CC25731A957CB731D30D1049C95392C8EDA7935109DF6AC3AB + 89: 0798E48F92A7FEF84D8CABDC310EDC38BF44D0081E384DF8E2DBA637ED274E04 + 90: 7338FA2AA1D8735969B5D8C778CBA17DC6234ED6F1D3EDCC797741E28EDAF411 + 91: AA02110433C8783CA4B6DB389835891D2AE48E82398EB61CEE785FFD342C28C6 + 92: 4C275EFF43C9B3018192AB748072E428D031DAA0AFB71C95157869D4CA6517E0 + 93: 4412EFFFEB9E5BE84A3708B33FF8FD3FC86C6B09F612D810E22DACABDFDB40EE + 94: C151D878B550D714EBC8146901A35AD9FA6928254125EE5857DE9454FF687A2F + 95: A8422D9D607364547B01965CF4603433F50D3F5CCD2C0AD73C19D9491C19B7DB + 96: E0585BAC140FF99A8C5FE7875959B4D9A27973BA1DF7770F3719FEF753DDC25D + 97: 4D3F23D5E360476F80FA716A11201C7E38E4F47FFB34B744D8C2E5FA82B39AA7 + 98: 8A485EBE048F00B75F71E8838DB18E885420D34B90040D3DA3E99DDE9F7DD31F + 99: F00EAE59CA91F43107640051BA7AABEA8D218290A5EEE59D541F4ED0C6F6F23F +100: 1D0872D72C7C958794A0A306139E5333F101AD9425B3A444AD599302CA1D38EB +101: B9F85AA3FEF079601570849E21BF0A008DFCF50C5F8C3D475C9A4FED80D6EA41 +102: C7675E7B2DAA88D6F56587CEA4ECCFBF0F73E6E2F485049D6F634139108F18A6 +103: 961D2FAF25AAE2C828C693013795942E649FB60A3F4AB99A4C726176DD9E6800 +104: 0D72573A496CBE9FCF413E5A94D66AC6283F58BE1B2A00DEEA84928369C7538F +105: 547500C06C4225C9D21C5EFCA39A4FFAF2BCA5B90981901D468F5D357BDBD439 +106: 3A06651F91CECC35704958C77C428223815DB5A646DD2B5C23EFA80B55C98A59 +107: 681859EBBA0ADF350D3264A0034D7ED9B1A4C7AB76490DC58A774523489C9913 +108: E718F2E0345000CEA3645C15F02870B6E665622E6E7D3E7850813878953ED58C +109: 6892D4FC7F2EA6E20F45C8C1595038D1CC6F07DD0211839A5FAE2941B241F258 +110: BAC5688E05FD132E95A16CF72FCCA6D72EB9D184ABA08B657A48670B54B99D28 +111: 7E6DB1B204A2B7957D8B19F1D730734CECC7D235F1F88F949CD58652F5474DC5 +112: 88360E8D857C28E27865BAEC5EB248119A82E5D1BFA76A48E4CEF9F35E0EAEFF +113: 686A6987DF516693A84ACE8B9BC45D8D6DAA07A6395136CB8BA8EA2E9C1988E2 +114: 9050DFAE4F11A9CCD86EB77A51284D5110BDD75A234D9A8D0A9D096D50BAB6BC +115: 535925FC039F5126DCDF8BA3D0763C8F6819DB907AD2F5699A678153D144C559 +116: 4D25BCBA0A075EF30A38164CDD958965C1F0D915DB18C9DA0307A27FE7BBAD52 +117: CE930CF1D4125932CF246E58E5F1D452BBF8ACF3FEF65380B1B06F78838E9AB2 +118: C61E02A0380806339FFB8F3626CB60F0EDB4686479920D701BF827A572E06943 +119: 93B85986C608575566151530611633159888D84FBD545F9438045F22FC76B28B +120: EF4E34C9ADD7233AA57BC0BC3E3D5AD9F3B62ECBBBEB55C683F137CA35188F31 +121: C2A2091063D6DBD7D84EFE71A0302D6FD8B7F705E3FA313B2B4A7CB9DB96FF43 +122: F473842DF6449B5CA01ECEF2141B2371825D0B36F8F2C5103D0C03324F1B5ED5 +123: A21664BD6737E38EA567960E8080388DC7125580E12E1FFC7566195A85B59F41 +124: A095FCF6E3CC2024BAF5E3FAA22264F6E3BBF020F64C7DD3702E5A441E28FD1F +125: 8526919DC55187817F283A25D35D259E7690BD7897C5A54602749CECA53A4B2E +126: 18049FA72D1ED3A5DA6FDBC611F7AB6EA448C62D27E6EA11786799E9284AD393 +127: 0C03D92F1C2D3A13E202E4CDE765E8E7144157D2791801CA5B4E3DE52AF86686 +128: 058B4C17D5D9CFF1B6B654C25986312A39FBFAF6FB3099CE616E1D46385EF20E +129: 6D55D957FA582356FCFCA8E88E8841C9AD6210625CCB59AEFC092730D11E3E31 +130: 95A4F42399987CA35F9D09B89C769DAAA65AC76041D468FC83E177A14A36210C +131: B8640187180F1EDFFC017A1D9F0ADCAC9833C4271E68AFE37D2D0428B7300C9D +132: 83052B99D772BF42E02E6BA292116EF9B8614F742A26D4890F4FE47258A7A53F +133: 5412A8E71968A250B28A110ADEF902222F2112DC481FB1F47E8AA523533AF3F1 +134: BA8B9104AF732E5A1C864D40C7637AA9CE4D690F63A80C2163504D3F8434EE01 +135: 4F0238902BBB09F15E51DE6C49638E8265AAD173A814ACC00F329536D483A57F +136: A3560CCBB7E20C5DB74AF7CF9D48D7A6334E3DDAA18BA3B90E666AC8D66F8BC0 +137: 032EBC519F073776FEF325B7076F210DC84B704769F067FB1BD1CBD7B2EE3892 +138: E2FF8A40F4C200ACC4D7FD2B3D1FC29BF6C9E4E196BFC86E2E7DB74D85334623 +139: F66A5B3538F21010BE15C44BE69E705043528E13B81F139A4C9B0262B25EA87B +140: 22F707EAEAA4400B321327CFAA6DEC5964CE05FEB0612207DA32315D5DA0DF8F +141: 9DD31599464A2670E87ED158D582125855D71C3E1F9E6B051E3E3C5FFF638636 +142: B4320C714FDA01F8AB0E5D223E54DBD666208E7DB4A34DE4C6B5CC45974FABE4 +143: FDBEAC0713D8D592F1B22DFCAA8D1BD7985827191BE54F1A854E69E0B0BAEBA7 +144: AFA02143102B6AD8CE430C51F206A2C554B0E82F23121C98D70CDFC6DAE882AC +145: A0559B660C738B0093517DA09B7D25A8025050E380A060B57A14FE64F1B534F4 +146: D0CE6A96815C6C929DAE41F04981AA424AD18709008D852E6A3E207306E52E94 +147: 9E10B97312AF7829D553890065C066F6845A13E1F6B9E2EC079BB25EC6E68CE6 +148: 9D78F59940A631AFDE274E928E79550F2123335B67DE99BCD8ACF8898EE5F4CC +149: 47726D6D2460187ABBC09A6819E36BA156B673A5F07921FBFA8AE589CD6A95B4 +150: 5F02C7A0B8B845A1C98FDD443F19A501AF4520A78B559F542CE61B19F8391A12 +151: 7F7941C5702C58B5340444434BEC2D2A1B5A3BB7D40DCE192E700FB88C836B0B +152: BC9AD4682A38F65B08F8A37488799EC2F8224C069C8694E42F2353C7B50AD0D1 +153: 785A82F878A742F02714DD2DC9DC32F4CEDBB873A0887552BFDC023261BB992D +154: D1E291366B74BB0CDD2E258CA27ED44028648536668A2B043C0A56DC1B88C707 +155: 15924860AABBAEAB0094A497A621B76377F809D58C550872443B573BB3A401B3 +156: FBCA0E151017C6F6E2151B754E97AE4A8B9BC347BDB30CA10A2228A6F1FA00E3 +157: F6E32E251EE0D95C0D08DD36E56D3637E4E4505770EBCDC30246A714D3945378 +158: CA659B2FD6F8EE865DF19619AE25CAD7945F6BDAB220926CCB89C945E1470632 +159: BAEEBE9BFC97BDD6D6834D8F1B392A64DAA8660311734E38B3D3A7AE51E45C51 +160: 3FDF504C0AC62302DFC8BAEA4FFA97820B57A77DB8FCFF05ED00B8AA7347A8F9 +161: 3C1DD10F7DCAE111DA82BC7306E230B632DD0F9E01DADF93CAE02DFE77A5279C +162: 3E0CB421A440B65404E647444BC5F953C17B625CD7A8697649B56DDD41039FE9 +163: D6BDA19BB5226B9CB27624E1A85B09282F254318DD3B53E385A0C5C1045708F5 +164: AF7C85956E56D7C835002A80F4C63E5D57E724A852DA3B8ECCD60B201FB8283C +165: CBF8BA797D8759F4F1027971325D7578E5B7C5372DB230892E5E99D931B7497A +166: 52614D2D03741BD372BE7595893166EEAC8D13B7507C821B6D5AFB9A1B233509 +167: A9369AFDF31C080D94F35E73FCB7B6835BAAD7888224E170FC3EAEF3B4026458 +168: 7C248161FF7B1A21EEE44D5A60A4237B4A9F3247FC0A519EBF4DFC165C67AEE0 +169: 9AD8BA1036DC3ED58658BCBA3C18061A7F027E26A8CD4C838E9084A045989CA2 +170: F48906B1852A988D6070A1B5CDFC2E1CBE295217B4FE1D94B1E9A65C4F2FAF19 +171: 0DD50FA788B20A9788E76D10342E398E7095AAEA11C759307CECB9BD846E91FE +172: F9F0ADD2CEDCD4D376741A07C530B6030A4A3610F2DD7ECDAB898118248E1F75 +173: 24DD0F41BD9636D959065DC0315E64DDCE95738CB4EB90CAA74BE03290CD3A40 +174: DC9ADC7C7D69617151F76AB75BF851CD54797DE4D90CCA0F67340425E1603E9E +175: 1401A7D314153215C2DBF25B41CA224A3A27CBC39A76374761319D1A7CAFB463 +176: E6A57EAD08E98D535761CDBB160EA13656F23B9760FD93F6095FED19E3648011 +177: FDFA142853F6E104E26872F40EE1AB57D5DA5DE9CE08F7326FD5C15AED5AD6B1 +178: E90A354AD2DB7D682F62ACD9A5B75917386F200EDAFD7C9F0DF6837C23144BE8 +179: CB25CC7B01D042A730794C0EE610059F469E999B9BC641FE8293555B89F3B015 +180: 5562C634F2E1C294069BBD12D44338DABB0518B21E62C8685994298B41E44D07 +181: AEBCBE009C5D6D639D7857DA88AD5F20A9B8CCFFF405D6C0F29BAF50BF00A206 +182: 503CBC282FF75F2A7DE92EAAE48396C8EC5DDBF48A21770F04A0A60B66C7CF09 +183: B87D972905E0604A5BA0DF448870F66015A30DF7C6DDE7682D6F79E8D313B83D +184: CF6B864A2E53E537BF87CC32061198272036723098F0891EF4E8AEE561E89069 +185: B9198B4C8025B49D8BDA72671B89392A8A4D8845CE79025EA3015CD539F2BFCF +186: AC27C2EE2D6C7C2D45B670050B33964149F14F9108D139E615D90B9261AFA8C9 +187: F4DB7AF3909D161DC6213140246D57590F23C86657E726CAD85C21B6FFF7AD09 +188: 38AA92E98FB4C6F98542496138A076320988932574FAEE2BF040FBCFDD60B693 +189: 070A3F8627A515FC1BEC92186D660D8CDB6F5778CECBF33506ECFBC1E5400A0E +190: D3780DD5C62EA78363037964AD68EDA5362E8AA3B7679D6C6C26C1F0ED4D5884 +191: E8AF6E7FEEAF5F1DE4B904F2D4C4499EF5249F704BE4CA9B540B3549BA007F5E +192: 5F34F18A4AAF3B9F4F646549CD96C154358A403865D497C85571A0A7077E03EB +193: 7E443D2AC1B19FE376BDA10C3D31FEB9039442B6872931F5073DC2981484CFA4 +194: 59A92EE3CEFC188B013412DA75A59951E0E945F3ACADFB4C6FD22F0933793F1C +195: 3876E1CC66B21B9250416D8A7CBE554B6FA61E02AC70A7392938D18FFF09E6EF +196: 44D7ADD7CA5152AF8D9CEBB58253DEF1C39951D1189C9947D02167DDFC922DF1 +197: C11EB21A420DCE67B467245B95AEC47B4C40EA2B5BFC35B5BEF07E8C80668B9F +198: B2A180A0F912A7923551DF1C4CE7B9C90CF87A4CCDB0AE4C210742B1A7ED3D7A +199: A11B004FE0A23CB1F54BA33996B3EED22DA616451F461F44C09EB01BA2BFEEE7 +200: 7EFA86E792DDAA6D10AF6C2C3A27FB4EDCDC605DB11F76D9779F42D485B94211 +201: 46EE4AF99A12FC546A85D9E58A6092E8F6E78FC7014FE20F2F39521E0D2D0AF4 +202: E0D145FD4AFACAE2ADD87D9522A3AB77FF37F0E66A888C3DADDE74DBCB412684 +203: 623DD2D7B396FAF9C283E6DED3B9AFFCC79D13DBAAACD82A71C19DA9B4537215 +204: 67BB86B0689AA3095811EF9EBA3671B3CEE163EE528FCA81EE1247A752F5B11A +205: 9424163ADC8543A5C6403F158AC85873480956DCA34858F40149C939396EE6A3 +206: 5282724162B1661F158DB6587E328DD04FF453538604FA5DE3A80B5C29CF6545 +207: B103FD9C2F5343634F5805BD42561A6133408D7A922852627F3306A2EC6D9106 +208: 32706E4DDF5A2B907F1480B9678542891969DD3B7B7936AAC47A240BC1A51B66 +209: B6653AA2B3B78F3BDC9E06EC471E39248F5D3B8BA9F52C1DFE6024C41AC71B95 +210: 5342C7BF84541ED96233EBB89C53E27AC14C29D89C6E5782D2161162EA50F9D6 +211: D388F59DD69ABA52BCD11007381C00F713917984D9A144612E13CC2C8CF115B2 +212: C0C16BB30E0D3D31DC0446915A76857D1C27D25D17D03AE9927AF918D07690B4 +213: 27E8AE37383AA1D694DA48A8DEFB40E2E42F7D31913019EAF789F7E6F9663C5B +214: A4E87F8DC999BFA61A0465C709A26424A7EB818E5FBB410906FC0C83D1FCC84F +215: 379CD9ACA503B76BDDBA948CAF3FB82C1592EE5D3C802217939C76199BEF3904 +216: F19DABCD220AA5E5E98AF1131F9EC102DDE4789DB4A38042928585321AD40C5C +217: 28B21329EC4B3CB8E0EA6746A5CEEA12791296CCAA3F97F53D9F6DE3E7BAC66D +218: 388CEC5E252477AE29B23EF8C4D5CFF1BB843F2C192E04C5014E92AB1D5017C5 +219: 5056F18069B17BFED7B61FD337086FB375A097256DF36C37D60E8A8F0E01C9AA +220: 54B9DEC9696893B55C43F470BE594B9AF87E141C859460F7DA90FF112C429D4B +221: F85C7DBCA458D5A3AA22E5E44027DECE7D75A70DF4AC39D86AA6320212045A07 +222: FC450EF487E482BCDA6B79B6F88D77A3066694DCFA89DA79A1F26076D73462A9 +223: A76C7C989685AA3E508EA2DEEC1235907F6821A358366522EDD003BD20C9C199 +224: 1E340C35C5C6EB2D6A62164DE4FD99842E92566F5CE4EF1F0384DE876FBB05DC +225: 0B1FCB640D1CBF4D9586E35F734F6259DF1EA2D372CDC3BEF62CCA5A52A8DD22 +226: 0F84DC8527810DAEB94D3BD1965FC6F77DD55675431432301C84FD80A61F9DF3 +227: 1F3DA5BBB4493E7790663A708CDBA1520166649C2F7CC96592EA32717B056994 +228: EEDCC857926971C6753D1D6285E05B528C93DF22BF2C34667E0758B2A280A023 +229: 7CEAF3F9A496F48C59B36CE8227BAF6D77F06D0221FDC1824508A6E22C420A09 +230: 1999B52C1BBE44FF1880482F5C1388B97C054446293D2CCEC1A7DBFB41A9D5A1 +231: D854312B1C7D31FA1B05361D9A6F1732EAAAF2D6489869AA5F1F007123D3064C +232: 205821682182D86398E9ED127B1566FBD15EC53DA9B0848C44BCA4D1A7E0C2D6 +233: 8A187B6F5296DF4474F76501BB153706EAD16437C07B93F8B402C9064A9F2C56 +234: 295F177719C762667615E2F0BD877AC8D335B972C73122C268BE3781EC73F877 +235: B755C081544DFFB214E159CA9EACF5B0F8D832D66600C8FCEDA81E7BF73BB3E9 +236: AAD1EB3F56EB324BD148D11C0D30E73E469E5795AC6E5CF316963FB6D9D56268 +237: 7F85ABC4476718C75AF6ACE5E23D81801F3BF1C5C1106EBF166F93929DF1F5FA +238: 4375AE509D1850EBA1816CE1B0F23D5A1C88FA91824265E7471C30C51C8387C7 +239: 0C42D27AA14279BF6144CF3017B436E5926C857CF692F12F0A163F7F1C1423D6 +240: F48221F68C29DB5A0FBEFDA5A1DC1449B7C7E8A31CB667225779541C5D0D0819 +241: C73BE1389C322116F57610ECF2EEEF4398FEC3691EF89828AAE53FF48F9B1880 +242: 53F24E53C474E330ACF2AD97CADD0008BEB454DFBE95D014ED02E56ADA24D354 +243: DF2DD00644AEE3AB992A8A035A6CA1E06104CBD8A25F9091400C7B3F6BB56051 +244: C9D71CCB24A1CBB0AA78C0EE036DEF475CCA27DB5556D46CE48A9F1B7AA23707 +245: 2FE92B5B626A9CF044B8F6B05A8D4863F4C330CF2D617A1DA393CA4DFC6EFA54 +246: 2F77323013D451A104E704D5FEE77ACE42264CC12B1211C51B56EEA583F251CF +247: 95CA18CDC55CB5D71D9B115225DA6EA45ECD52C40063A4021216394917D59486 +248: D701032302AC49213B359D36942AE08FC0A8214AFF5436E637F6FF2400F9A693 +249: DCF14089BF74ADCDFC21F9E7A077673442AC402B6BEEC534DA9D33BCB88F4240 +250: 29F98AB76037295069E290227B73D6AC616511D9E184B6DFD8011B19FB804B7E +251: BF68C07AC316F6995BB27EBCC5BAE4F3223F9E19B286C467CEF3A5C7AF82013C +252: 831507A1E5747CA5F7CF8FB3760A0934B8FE1A2697844BCDDC2D6BD5659A9D18 +253: 266353552C65FB658782EA5FAC93F3D849E8D9C08320A339F7ADBCDFE865D5FA +254: 1F5A45E4B8B2AA9D2F17686BFAF092ABA5A5611E02DB2D9322F04F6BB4D6D5BA +255: 37ABE39ACA0BCAB14D8F5D2CFC80B467260D2EBD8DA8F1496B4288F3ED807642 +256: 3A217E5A5BC1C3F7AD21B4441A9D1EADBA6E7907835C152A86319A96CB197160 + +HMAC-blake2b-384 + 0: E2EFD6339FB7959727D9394D3BFE5B2B8043C2517755C8ED4E8CE1C4AD4D9B6F594755BE8ED6332CD2D417CD60820EB9 + 1: FD62DC26DCFD3869F9845B7BC4977C831FF6F3E20CC9791BCAC252C6CDE33F6D993A24015AD1DEEA622D8F088987CB35 + 2: 0C2EC4D9B0CFCC5BB5E2137ADFCD2F4429E8945383BAB333F826302E129C446B8CF26FE463BF743B4311E439B0A8BED7 + 3: 951F25322784C0E17CC3A62CFD3E6B99007B054B388C652BB27A81FEFDC4630F38A4C32A06FDB5867F995D4B9B0150C6 + 4: 8F3DBEE1E20D7A77311B80EA60AD0D15D42CC54DD20843C796D924830D5E9962A017430A7C376DA09D9D83CC9C6621C1 + 5: CD1C60CD6578E8DD546E4D483784047D17579685EEE611C32117CC66549B8FB43840BBA4ACFA29F6DE67994DD27F2891 + 6: 14CB6315C646EA25FC3A8BF9D4691A556EDDA84550A25A1A816911247F324C36A5670F2BA6E59AD8CC4A1C30F80ED48D + 7: D0250AD3CDA040D2911A6838A0F35BD6C2D4D19BF39F2323CFB3FF59CC6FCC90218FE5EC06EE52D2C91DAA4C4810D479 + 8: D8B4DD44DA0D235B67834A9EF3AD533F0E38E7EFF4B1366D23217379430D84F6115EB5999E1EACCAB9822039078F6CDD + 9: 656F582FC042F2D574F26CBDBD813F0D8E775B6617A704310BB217195FE11CC8339447FEF682B5576EE09AA39F452114 + 10: F3A8E62D047926615BEA73DFABA6036AC1F5AACA8EDA40F7A30AC8E23429D32CCD6EC3B5E7AD488CB9AD75AA95C3DF86 + 11: 8E356BB747AC4AF327B979889B7FBF3D70EEAFA6FB4100F353CE42894DC97DD2A295D8128339B7742FDEEFED545532B4 + 12: D711E147489BF1418BE3637806E2421564F56DA8E8205F3E3707EDC79FB4EFC4B552A3DBCD498D556251D913E359783E + 13: 55183AFE384C4ADEC219E10448977E93A720F06A26583107AC624021A2C3BA3F0CE6C694D8D69FB4C357420666F299CB + 14: D5629C962AAD7BA82A2076A977B736462A4CAC3D5BCEBEE944DE43586A0CA688BBD3C6A7CBD8743A7E1CA06BAD45F2AE + 15: 60B6E1F3D563E2AC844F4F01807DD6B37BCE8E89920C34B3B24D3D30559C25ABC5C68E2A60B0A3CA6F4CB51C0DC0FDA6 + 16: 2E21AF74537A5CD07C9CB69E02CAB0EA59D600151F3E3F8CE8447FC0A8EBEB8A5CCE2E8383CE4DCA5CAF7F56971BCF8D + 17: FCE5B5B9391E25F7C71804426ADA428779EF3E67425B73981D04EE9B12AA2502BD0E70CCB126F7DD1AD762BBDC5D66BA + 18: 8295A41CFF43C778C0830AEC1518047B51421EB215669D0579EB49786C2421BC2E30ABE56F1207F2309064B21FEB106E + 19: 8774D065D3E5C1FDD7B9763F64D0976AF704A45AD75C9E647B85515997DA5DEB802598FC6A2B04E3F7EE1124107B64E4 + 20: 7358E8FBF71BC83F52544FA1B41F22BDD7D675C00FAA02C473B2CFF4DF582EF58C1E11D04DB173F821C429AA55DE7A67 + 21: 54ABD134B7DE8B9741C505C6E71FA0B10E9940D4A62E4D66F61FFB92A781DF0A3E63DFA99C8CC7EB151C006D25A128BD + 22: EC04EFFEF79926F1520B7D70002CF4ECCB5E8939CBD9F63D0085012D064AA4FEB5D9C67D9C188998B1125D85EB8CE6D9 + 23: 71DFB1FF9D2D3B675C36346CA16A65E0BD00A4F029FF717BEB993D08B1ADCB540E3D41ADF0DAECD16D978DD2E7CDC886 + 24: BD7F33F6E1E572DEE240B05987B3E6D5545B75E05A3E8281339A50B176AF9E89559FBF899F84C45C5F786312E25F0379 + 25: 3A68CCE9E521FD57507084FB92F35D077A56157FAA231822A355CA576EDCAEBC0F7A3410B06BDDE917077698AD38EEAB + 26: C53B66A6C2A6A951537DCB2220748C965C2A11A9AB2A99E15F2994BD0DAE3F31816FC66900D27C00D1FA643E565A8E7A + 27: EDF535F33B45509BBD1302681765E4EB60DFC2561C6372A407A30DAFFAF49636710AD6CC3962EC7AAB239A91B1B1FE5D + 28: 9501840F8943F6B671956D1FA8F1F0355AF41E5ADF88355925820A19A82CFD94D0C09A56F559E769A1249A3C26757258 + 29: F923B9B2F79FFC3006FD4772E22319EECAE52E5969160E8FCE672D4463BD7AC5CD6CDE6FB055A57E024B1DB1CB7A839D + 30: DC03F6713B343E5B3886A224214783085FF487471744C2077BB9D2C19512AFF81615D88DFAE47610B8F9E5C2E953F856 + 31: CBA5DD27F5ADB6896E182B8BA92EED8E8B52CD2809F2694E20EFEA37C09396B879AA0865F08FFFE79161381B8260C0F5 + 32: 631FA80DB857E519ADF0D1F71C120A577A861F8492220A33A884B3FCF56984A124ADA91EE45CC882AE6DBEA323116012 + 33: 8378A6764A26E8A12B9949C106900F02DCE3E492E3EEE8E5B04C82A2DF481C7EA56D7866965814CBCF26A9F793F84EA0 + 34: 4DE1AB2139C4718278990A935A27799E0E4EA9C8EA887D3697F7CB557B84A3B2EF546E96BA0827C103BD1476438F0EF3 + 35: 38EC7AF1950EC2AA8DD21239B1A47E3D6A12ADBD9A6EF4185ECB08BB91832B3DC8B1B8047E2806F312FF67C478FF8201 + 36: F319814A42B9EFDDFBD646820BA4D5839993B749A4C46D3DB4F3D7E60BEB7E865FF86E2F67698F507DF6586643F234FF + 37: 0EC1F4BC8E7CE1CFEC574C42F2321B86C99D0400B6EBB1C450AB6580DAB94FF55433C96874CBD42479127DFD901FB0B1 + 38: 79E1E5EE2E7C7AF254F5909D782424ABAB27C2950F88A9E4C43F9B6A9921B52836F9C8C81968E1C4777B34EF377B8F3F + 39: 441462C5CC0C88BB195C16FFB9EA98C0C11407CB4E8E6DF54417B6EC0348489B2C65CA9EF1A915DD8BE90EBCDE868286 + 40: FA3D1D50BAAF3D9D76C5A7A5E04DB89D87CFF66520B08FA494BECE2B9719E42512C2C486248679F29F1011DDB966EC7A + 41: B8BE44C7FEB0B1FB157C53EC1312EA39E946A4E18E8CC36B844CB56EA33414996B9B6EC75A32347A922A2C42DB97759F + 42: ECDD3FC94B8E383C630E10F898F5168EC45535296486898AC1DB918B216F21964EB8AAA22F7213E5DA541DD814EF5DD9 + 43: 3C8829344F9291A7820FB6028CE6902C1882B02F5E9CD953795CD475AF99424F26A46F191FEE305C91B3D19F9D0E5893 + 44: 1FB699939257BFE62AF561050E015C8A25F1517BE45FC7D09D8AB6F9E7BBBD731B6F8E3A37A7D0E9FC53F102E6B5AD8E + 45: 2924B05C3BD1D90F5EB35CC80294689BC24438C953133F0A2952E633A75C66A03032C5F7E58687A88F6DBBE28F8231CF + 46: A504DC744A59DAD43D39C4BAC7D82242A859DF9810A2E4332FD5B92E251990CD2A7211872A3F8251C225B6EF29810114 + 47: 6517D9EFC8D9913A9DE719B19956C233636502B227D40CC392CCF701B04AE380FAE6267F7FDE2DE9ECF52BC9FED82C92 + 48: 7BCC833628CBC705490F8F78D181F44922B87397262D5F733A8734BB2CAC417505B1298E66F91AC7EC528A51B171CC40 + 49: CFD45DD9FA9F81998DBCB5D4E8AD4919E72F5B45449772F4337B1196DB3B1EBD88F5F386771E130B442EB76E8102E59D + 50: EDF591D79A4B8FEEB4279A7BCBA1AB707807BE65F1C079E220889E02EFCBE50B875532DF7F2632F59DD84C67E67590FF + 51: DA6D781D7EAA9EF0AA2EE8B37CB3053720F1854CD3C52042241D2111DBCA50403897741F2758340033A4D5D9829F3873 + 52: CE9ED86F39D72B58572887E90AE9820536C19C83FDD6331E87E9D7F4EA8C30E3AA73634B37784A9105757A1DBDE3071A + 53: CFBE3DC40F9DFC95C182EAE98CE49112EE1B53039C8ED5CFA4CEA89EAD3C4704E1A0BF10DB265616D3AECCBC7E882376 + 54: 75641A027A75259077AA0C2A88CC3E2D3F080FE85A4BA57BA6E1380CF706AB7483A186E0C5D37A0DF1001DC019FB23C5 + 55: 0361A72AB610005DBF2A462CED61C373F2F974A198AA48E0201A10866263A37A2E7BC1F73F9CB9A01AAEECB87A5F2063 + 56: 79F4CB0E66F83D5E263402745A659D01CBAB5FA3445837DCA117DF8BFE5404BE3DD13991791C3D95282F74878DF48D79 + 57: 588E0535C5AD19DB03A6B372C961DFD92780AFCCC4EF735F171551403F5DF39B3864705AAC7EA328C0D64142AD74691C + 58: 37225AD3FE0A9D2D1990AB1D3BECE6C8F2C7A33340CE9ADBD07808118023FF0F586136D44F5ACC2866D5E4FC9B8AE697 + 59: 414514AE03092F33676BCB4AB8D28CDF2922550BBA91C817D84FC09A172EDEC6F0ED39917D0625C039CE6214F2DBE41F + 60: EA0B5F0ACD91D5B69E6BF1F63C68196F83098CBEFBBDAC5658058235C792D23AD36167B8F55DF80670B96EF12ACB29E5 + 61: 362E8BB7017240FAE5A2F99A5EF1331A725A9DC6BF56394328712018946EEC09283E883E784E9809F8A78F635D7EB6DD + 62: B4354FEB9077B24A3EF0B3B81E61E3E566638BF565E512975D5FEDF5E4799CB9B81FF63E50ADBBAFFAD2748C8F2639F9 + 63: 9AB65961D0469D4589FD4F9A48963380A8B17FF59DD43212F1A00D77FA2DEE2380357CF565E0529B97486EC3A2053DF7 + 64: 527C5B164C63EFDE3A2E939770E090FBE854ACE750CAF785FBEDB0372800A2D46A3F0350B9FF16F41C9FAA92531F01FA + 65: 035FC236D413F377297023DA1D546EDD411206DF534B84A92E6B9BD69F2E1F274A16B0DF4748415538922FCB7F79389C + 66: 8088A71692CAB6CD37E2A42F45FF42A3544BD46A6D15F7F5387F330BF319BB471C0D35F3B0A8D6432D3A8502E425C125 + 67: 7AF755B9F4A083A3CAA0FBEC99EEA92605A1068D7558A7F0FD9D6DE307373DA5914A2F9A0447477B53A5394C058192EC + 68: E6147AF3B75BC28BEA40801A1AA392727C2E5316B689497A1F4A1762A1C4B5FBCE6965447B8DAB64CCEA58E09FC0952F + 69: 9B6E4D670B58892239F008A36B5149AFDCC30BFE06DE660ED5A753601B24DCF454E9AAE4916FA01256F30DC6E3877640 + 70: 7C5F4C73736DB27312F808C82A2198B43B2383DC45C7CD2157A007347A71AC720B670DF8125DB55B483179207B2EFE14 + 71: DB313F2FA18EA1043352BC51BFDB34979EE7CCB2CC044FEE81AC6728CCE3F70A1BBF09B5266CDC3B7FFFDA5E4DE03639 + 72: 55B092DEA6591D4F86589EC88B141171D5FC0CC84CC228A97B7A6304A0883B12917FB8760AB9F60B94E62AC1A3DC103D + 73: AEBB75AF53EEE9308955252437EC885AEBBE0478438FF547872E467381D0BAC5F4BBE4137FA639DC50B24BAD50DAB32B + 74: E340E236ABBDDCFD0C0A1228142598FBE100C99A0589D0CEE53B5D40DE3517F9B906AAEBAC2937911F226691E211F751 + 75: 736F6C28068FFC1D44AFE915EF2B2E7080AE5D7AD12E14F6E1EBE9561898CF3B2539B5975B59D9BE7DC5838D9B914710 + 76: B05D067F50C57324684DB5496D4C562C4F924C183366E7AD758C860A96674231A85A2C5677DE42166EEB1FDD46B761F1 + 77: 5D452939CA0ACC60CFDEAD461341E5156B0AF6C60246A57ED74B58DD7F56FEADB3ACCBAF5E3F1CCED95117E6E863B4E1 + 78: DBD083E3803651EB26A8B3BA59CC305514C431C9B2E6A3E5A856AC1885743F4989B8ECA528050881F78318F8D0A729B2 + 79: 9161AE833EC63E004C746C22424BF948DAEBEAA4707AE86E280B8F862B0C24CE44E234238AC0908A249A2D1BFB5EC0EF + 80: 471482F5D21D9A9221A48B1DBEC3839886A6F5068A34B71703DD17B3C3D2DEF2B75EE6C4B4504111CFD5FB3DA053A0B0 + 81: 44A184362D8C177EA74FE67EB320739A0B925FF2801A18311AD66CFA278958AFAA33730332FF77EBE365ED25746C5321 + 82: 7927B2779A8D6ACACBE4358424CB3C64F2EA07A80E4DD285357CD419323A5881772478C2F02FEFD75ACAB12D08AE2DA9 + 83: F765DF552FB090EC0F8B09213956F33A06B431069D21482154697BB8B12610C33D49977EA17197B329605042CDAD0939 + 84: CEE62CE137FD4BEE1D2AEFD6960570381215A80F26F64B9CE8E5B14A856E709A73E4FE49992305D85D049990833E6DF1 + 85: D971969FC958394FF1EB2EAB642F150215B299771545F8D284A0EEDE5D682786342583E10D9915F1DD52392D856E3A68 + 86: 8299EB80F7BBDE6BEF9DF9C672BCC5D337159BDA98D31ED12E05D817FA13E845FC6DD35474C5160F6750FD588157E6D6 + 87: F0AE246C4B3F76F5521F436E520F643549172A6EAFBBC4936C9BC65C9BCB08811F49E4A846948E487222AA50BFCCF226 + 88: FC3F42840F420C1600A626B62EC755AA0D9132CDCA6DC813AE33760BFEE7F7A94AAE90A0D341E192BF76E3F9D0EC88D8 + 89: A180318386F38442BA5CB295DEE7B141E14AE9B1F92A4F9FF06ED05A7E79845B4A3150666E1503354E4EFD3C9570F3E4 + 90: E8D9F18BDB8E8352629B37EF7739A8BCFBBF6AB3A45F0C6CCE01DAC73C2E4C8D509496910765EA597D2EB30317B665F7 + 91: 6BBF88EA3C5F2FEF60C3EBE7FFF3785B408ECA7DB302DFD901FCFA2FA62A79BEC17CFE5D5C77AC8F38BEC89C93CA5CC0 + 92: 8C67839CDAFE394B0FCA9F451816897BD2DA79D6239AC6BA3EE2814200D397149139EB0AC9B40B463300F4DB17D60EE8 + 93: 8C1D27302D2E863724F2A43CA315E116875BD0EF5763BAAB6BEDFD4076A79BFFAAC92C58BD0113DF2A06305050A39D6F + 94: 680A61EE50A7EE05C3ED32978700EAF343681D1D5C4DB809D7A57F2CAE74DD2053C95BDC4B0ACFF8237F523C23B19F38 + 95: D529A04670F78BB2534AF1DB96DC30089E008C4288C5DA568E86DCF03691D3C3598CA8D120D62429B44FBC70BAE524F2 + 96: DD92A0E9F336F5DB5FA020AAE917DFF397DCC2202207FC740A9524FFBD8F526D5C263327935CE661631FB94D4501E2F9 + 97: 5913C2E17C0A96E6DF7A7E96FC9BF322BB9F7AF52A854561851DE0F1B3AD1BD34C00FC64CF1588084B06FAB7A7050892 + 98: B451025F6B29E5BD2706DB48C8650BA52C09FDDED4DD10354AA7B216DB0CE892ADDACE734369D06A70B5292F60E5BBCB + 99: C734F13F7F8A7CD01FF83C227AB3B7610D1A0C2E9916E1581FC742CD48DDA5939D054ED3D8A9246C2DCC50E65188FFEC +100: 9D5FFCB1CE848F3625A19CE0DB23CC503D4883080A01D7B66AA259FD5C35C72DE514E6606827C0C9533031E2C43EED1A +101: 8A573FFEA77CF501014B3B9221D6F99F8053CD21AC1AE88BA8B14F021AB746B3B8EC29B390A8118D3DA399F9EA03BFCE +102: 41EAAC7D7256DEEA1086BD42FB9F5A56B7DF5A72B421B6864C24E4D8A0FF3B4F0474B3F0D9DB8B9C6B4B6D214676C297 +103: BBB30E99F1AF1FFD99F379794F1E648A0BF31B0F0BF54BADA75AE5805F56A62D8DEEB540D836822D958803EEB7221BB1 +104: 701454FE6BB3D850425A69EE6F704066D8B2B0C46BFB751F8326BE50B79976DF6BE26D531CF0E2AC972AF7CD38A90075 +105: 3B740773341FD606188A15645D651BAA30B099D118CB3AE776A90DAF104AE909D2A600C2E3913E40151D7C181C94390B +106: F8745B6F95C5C1C6FB38A5200BD2A3764FE204D95042D450BE2D7FF736DB233277091873EA3C6D81E6DC0474C6E62D41 +107: 8CD48174E2AF8284AA1F9A9CB6A292D34B6033C131C7B515A76B031BCF6FD31D61E1A741565F249DD02BB8B261501364 +108: B36763DAD5203A088DA3D7FF5A0EB55395B2DF84F9EE9F80D026712509DCEC082658DA4F1EB56F73420445BFD7247360 +109: 24974EE4EF4FFEE37AF1468F0344510F06B3C70D144EB104C65F6114068CF0B0511AABB683F272831CF07E843FAA2675 +110: A4ED01EC7592E6D0098B94C6127DE2FCE4966A3F5DFE1B8BCAE3753AB2F35CDC5A5E106708ADFE841FBD05088634297B +111: DFEAA792C52A87331AE508DFBDB4F22BD78A4C8EA7E47432CFCBFB5D863C73967CA55BC08EB8A29B1740301D4C8C020B +112: 634C76310A58733639B2FE35B9415B44B48B7B9EAE420CF7A726D7F2A9F709B1656F8F2299462006DDCAF9310B642313 +113: C1A3D84BB1EA2E84D6F5E7D9F496175B03F4836ECEC2FC6E3FB3BD6AFF10869BD2DB83340CC0583D76DC6C39F8F2266D +114: 84866B02820563FD6FC8F0F7A207D0A0C1F2C9730B8EAD40538857BDFA430AF4F38CBCBA18820CCB9EF10CF280691EAE +115: 9027038D0229A8492D1860E324D355E0BB0213065267974E535E8B1C717B43A390849010A08F4E3BC17470E1F4B8DF2B +116: A11B02D14B6245A7078D014B3C1414D1AE525197562AC231BB65E657AA4C55D8B7E3207F05235625EC978F9E0F66AAC2 +117: DDC3FCE5EC879B40F357383EE8AF8C03E7D5D52D973AC5001C100F203EEBB50CC9079413F35527D7BEE94ABF9A84E111 +118: 1D82DA0FD448E244CB1D0613A427708A7112BE6439106D82C55BF43A9A042037A003BBFDC8FE3F0C441CBB86AA15BACC +119: A3FBD7034E0ECA79C7A700F8172C5EDF4B7744575EFF569D0BF30F3BCEE4FF7E840983314503134F0EB3195D84A77576 +120: C098DB022B3ACFAF41B8F7F80CB2B9342B92D5F29F0E7D4C94B3766DBE9199959EA26C918C9880624AE5BC397A517368 +121: 314BCA818DEA9348AA65C7763C2AAD9AE264EAB16D703558C02FC2AF51698264C931D7043EB3887607134939013512BE +122: 089ED8BB4FB29435D5335F69EFD141EDA4AEDE8915CFE9E977CA07BF4013522D033783BCDCA2383A78AD6A845454F39A +123: AE35563CAD3B5D3C89460738CC67CC5084C1156F4EDAAAA392528EAB775767BE3D170E9BC46727DCFA92D3C01020B8DA +124: 7C9DCB28F423EC18C5C20A5382C8A9156C66418D5561EFE536A075783CFB575451B3C8CFF49CA0227CE10B89D5E11832 +125: 727C87FBF18D07759FC2345521EDF2F2E6C2B6D6172384AA29AFF14B35DDE8C7FFD317C98067686F0E9D2E7E92DDD8E2 +126: 91834D962C8B21D76488C34C723D54A9BBD8B8221146F47B31E4258540728F13C562A7854AE441D815F9F65FBC3368D9 +127: 1EB88488E2E551B7982129358B58EAE0337CC576FBEAFF70CDB61B6D6AB3803EFD6BC54493625CBAD64C282DEE0E7858 +128: 19ED96EC83E9E28E9404EAA475970BAB64DBE0896EF0DB8D95EA616BE31A45CAC84DAFCC8BAA70755B04F6DC0D945021 +129: 2054B86EDB891F52780CD84FFA0EAC642260BD8CA09C918D1F71FE3C27956813DE031AB48366501D5D9E0CB65598A4AC +130: 4257868D9F21A3E2BAABCE4DBADB6DC3468300816EB50D6C58837B1FA4A304488AAA0F5D349B258F7078D11616B41789 +131: A755057935E507328C1BE2C725EB3EE67A4FB717FE606FDCC0DA64BE7C8838377980D86AA5E97E201C2F01215BF094BA +132: 42711D9C6AD4B94ECCC7C533EDDB55946535A448924CDFFAC10C0BCBAC306035BA1110128A189C03E50DA32979A97ABD +133: A821B802D1AEAFA0F18A357667D9A1DA42B4E6B2D282113948853EC920A00B0A72EA4C03565D2EC8DB1512B414A830FE +134: E2AED5057A1575F4585931DC8CCA533FB6968874677AE582341B36FFE048E827B6E56446172930A54C1E80BA7944B921 +135: 7E9DB44CF172ECB6098D18BF4B6C7AF30860CB188E007121772C025698869B44F4601EB19F4ACD729CC53020AE638F4A +136: F2070221325B3A7EF6C293D72A424434E7CA170D692698EB9B579709639AAAA6A7A7154336BB10A476E97FB4ED6C345F +137: 31F32411B9503FD8CD62EEC12B918983C54362B37C7D6F5ADF83A567EAA07063831AF2CADCBE9A111BFF5161AD51146B +138: A85AC180EBAC3E1A9618D1E0EEA6B0DA5B27C68D2D88E295E73AF0697CF2D3B885C1DD06AC5BFA70DC6B9E0F965BBDC3 +139: C42214804ED73A5F1FD4A338551407B6D8360434B361689BB52109A599786E9421E90DA2815117E541D472FDAB15C42A +140: E539B20117D2CF436BEA76DFC2188DB326F934199A80920E20AD586CB509590DFC9959CFFC19DBB37908810E4F2E9512 +141: B74FC4881EF4CE3E23B82DEC18234EBE8800F42346A817D981F89B8DF36BB9F0E1B487746D9167574B8540E6948CBD01 +142: A71ECF63F4070A97088CE45B133178B1F016AB4EB1E1492E9550ED1F70A9B6F93B7B465F06BBF56459D45B92C08D7DAC +143: CA3B2259775466D0D61600405AAC2016DE7F429DD0CC38A53033038EB3C0E5439D94CA05086E0788F1178130642D61C1 +144: 8FA70E0E92CD8ACA06E90A1ED458F855B6E34854864B00CDB3C8A4B5C0580F233DC0E3A0A937B3BCF73CEFF9F4CC0FB8 +145: CAC112F9253C329E563F39234C60D0884C7134151FCD223408FCB170F2EEFCA99DD44DBBB52EAC3EE0A6462607D715C7 +146: A24082FA7E582205C3D5FA5C7EBC59B4BCB8B186967A6D452CDF8054DB66E3F3886EC2201E481AEF11D52D5D3904F51A +147: 36FB3AB6EA1D963E78505810BA6DD59E6620C252E36C6F67923DBA86FFEA645B6F66E01D8DAED25E4770EFDED3A56D58 +148: DBDADEDAE3CCAFDA613FB76E3A226B6051DA4EF8E3573F8A58812263EEA08C5AC2A0EE9B0E688417AEB2E46932382E15 +149: 4E464DAEFAE2FE0BF15713A05BB2F1B029A30CB02FF310D38AF90061CEBD9B58990265AD11515D6E6582480CBDBB6BE0 +150: CA8FF99C97F003EE17D0186A0354E63021B6D27C93A30F1C4C7F3ABD3DCED4F909648B16D3D5635D80D6985A4631575D +151: 61477F9D04A7D6A3CFCCEFFD2460E62B5C60E938CBB67FE615578C0F0E4D410961AC4A9541C32F30BDAA431CFD85C53E +152: 6F7257CA336EB5E1E6BE568AE1536D1A289518242B8DCEEDC4F9A25F461608AEF58263F8233C7D3CEACF7B354D6BC75B +153: 9BCD41E8645B7C76100F06F9AC3069EB27F403D2B6F1E69FAB86806EC2B822C3D1673CC4E05FBF3FEE93903D6B3C0424 +154: 69664A375C8B9CBE6ECBEB7E74B3139E9A3A3A097BBBF3CAC1E13A4C4E48DE877363FCDF907A99C69A4F52FFEAF53547 +155: CBA3D3ECB94A89CAF7591086355C79BF4DD67AD3E472BDBB7C59C51760C195283EF45A1F9A8A4615C9514A46921358B4 +156: 4D9697E846D03F1AAF7A08A2C0A9B4A9F4CC546F3433CC0773568803E050A977FA14DC2BFDC3D2C04FF29629939D02CF +157: 1C67DD9FAACE24FB125657CAFA6AC6A77D20BB6B90E5EA6037D3909283F6C53EB23E8BB55C2E67B05C8FBB9ABFF27458 +158: 0366F13C0469677D6B2B26830D47B56F2BB01F4CF46650B68C378174AF0BB130F848EB8F5960C43F76A8793C4AF1FF28 +159: CD76F0332A14D4504DAFD5A61FD33FAE07F5EFB6EFDD2625922CD34C1E9544DF8B5E5DDD9642450484729BD56D6A2746 +160: 2DAC6B918E8DD8B0D132E13A6877EA03B3966CE8DE035F36E63EBD97B8A00939B8672225394405BD3D8B36FD33013AA1 +161: 97E443DBF8E9E7FCFD85BCFB168F8BAD57E54514671EC1558815AC2DFDF9E0D4DBAD3DBBEF59DC04151B1FCDE5C7F13C +162: E56C2FE55C0D1577D6B36A6F60A32EDA3E57D42A8252CCF96E974E0AB5CBC27F235E6746B53919228BB8F682D6D5EE7F +163: 2D6AD4813885ACF91F86C480A2DD8BBE880AAC61E7158296BDA71927A2E3998E999B71707156DA2B8230EB81DFB631B8 +164: 9FEA4C7D949C7F5F29EF07DED769A6C2572E9C66199D1E7F12FD00FF08D21EF0AAEE8A1BCADCD954D704EF18D030390E +165: 2CB43085FDA800D08F45795FE6C637A5F5FC7794C37FC5C3C04403C7D4B4070F7202A7573D5CA59E6771F38CCEE33036 +166: E320A25015B14E2E8D617F79BFB84A7196F3DB1499D55072878267E5ACC39D34AFC08C18613F5EF8DAF4090CF27FFCFE +167: 29D4FFC8F46DF51A64E3F791AD25C83B0B0D371DD1866B869B8D56C67EB13518D6A4AB3AC35E6A1C2852298B46D37E61 +168: A1D665304B97463D8F8A112268C1497492279DC444BCDAF027898849C1C18620DC153A97DDD414975034FCE74E3E4218 +169: D885891B5B53C7F5BDAF932AC9D7C1C1FB3A6B70C62D4F87DDDA96E275441076BC78BD973E62710C9DEB0DA086BB6D89 +170: 655D51B2657DA6BE1DC25480DE76891D272D46DA414C42CE71DFFC7B286E338E65139E408696B6CB85B1900329D9DBE0 +171: E51462E37921130A0F606FDCEE5BB3A249B585EC58A6682E5FED0F9923B3C9A32F22662A9598D98D385C5E102A75A5B7 +172: 2C5AF48686B5E76874216A75E476932320F9CB51E9531C8A2AC6E8CE9BDA572277BA622582AF47DFFC15BBCB38AB8E4D +173: FEE7759324DEBFA2396958EFDC3160BB13C64EBE55E508734C52088CF3232AC947F33BC008C0BD243F22950C047AEC4E +174: BEDFA50FAAC1F34D293A8D98E3A4405D72CD1872374730380FA3B698E3442920AD79EAAC275CD677019F0D1DDABC1294 +175: F56A79F5B5E92A2A5FC65A346998F295902A8A053A746F8510C4E69F2A35C3FAEFD5E3C67FDFB4707EBEA31F89317906 +176: EA5053634CE6D8DD0F7B79D8ED76D5F74E2A431F030D8D1316BFAB2C951CE16BECD0F64EB658F88BD79D516D0467AC65 +177: C8E5C1CADB69B1EE867FE5B04B45E9FA902DC1925A43485D85AD4A277443C00A8F944193D82B3C7CD58D7FEE76025E40 +178: BCDC2C7F802C5BD9EB938EBC2019523C4371F880FC7AF0554A4721EF239E5E2281152F778E83CAB0A8CD53ED7FC00A75 +179: CFA7A667D2698673845AB3A9C9DD75499F9EF73390B217E705915D020B162F8C27DBB9AB86373067E7C07A3936C237F9 +180: 63137A5EB0EF084FF9E5C9D0C74BA377CD451475C7AF9957505E740EB0A92FC9AA98E9D9C6A03DFD12B28EB7D33CD200 +181: C7CE724583E363C93849FE094E92396CC84DE4E4BD044C5F30B218B8ED94507F6150F288F0AAB05E1A30819CB246C72D +182: D5A720A6565CE2AEF83F526E3F170BED3FEBAD5F8B61FC7FE49EE530E00A4FC6F5ACE0A515543EC7CCCD3596F3451203 +183: F5734A0233687B2033247BE55A785ABC456F3F6A5A98A473CA2879CD7A6C4C662AA3B2C3C274102DC86534A4523E95D5 +184: 2131B69D8CB775BE7D6A2290088673736516690CFA274133134A75CE921BF44E3AA37DDFD1A25D9ED479349F29F31DC0 +185: 6BBB74C46FCECE23643A6B84E604697F6959975F7FC2B27D11143627C97429F0D25AA89975867E17F4F66B8F14856F9A +186: F15F4198C827AD8E11F960E7BF0A4FAD2A8E9B307DF2B0C2F25E2DA96A2659C19B89E41FF6BBFC5F5BB1518E5B3F829E +187: 3DADBAFC2AB64BBD16CF0AE08F4BAE514FB74DF35873F7E49A96FE2A84B43D926A485EBFD5581B061729700A6398F87F +188: CDDE4E482B559A0881F04D6DD84DA1E66FF1E81CDEAC1337C3FD413EA870F87A50A4345C85D624709116ED13DCEB0C63 +189: BBFF34A1A43ED451B4E9C68E4399E99C6620D2686541076BA3DE9279B12D973E6056C467F8A4C3446AE23A5C261A4B63 +190: 6D0A63CC63C5B4E5B517ED860BBE4723F4FFAE2934EEB7F59B2C943C9373FDE8DBCBD325218AB377CA19EBEB3D932BDC +191: CD2CACD736EAD27492B8C3D2BDFC78AD9C61A090FB78B6C4B9116336352B238BFD1DA6C0A5093ED726B4FAF8E974E034 +192: A0D37AB9D467FC6219B7FB93D9171D0AF03767535608FFBE0A575245B63E088D3C0DF387B0421B4FB7CE28BEC98D2761 +193: FCA0DDFAB1CE1E7C30EF3B7C6F9F248C0F19E926B4E5769EBCABCBEDA8A4D3A66F344E52024F51BBFB2C275492AA6DB2 +194: 74E588693CC883FD65993D6938DC75BD257D8E7CB4E6958B4FD9A0214F24D43F08CE55AE4BF4C819142DE23C617ADD3F +195: B6945DD17122105CB807F571900C1416C3AEF9CACB76142E99A8C689CC58065E80693E0314D327D1DE144608B913497D +196: 0C58F4426E2C98FF2770DFD52DDF155F842CAAAE70FC759F7D9304C7477400EB263F6A208F1DD9462516BC27C18A1AE9 +197: F47D69B24FC88DEBF4B4060F7C5702D57AA2C84F25CA128E0E99D7DB0ED45629EE90C5B998E64076EF7BA288CD69D815 +198: 82671175BFDD5105D1C71EFF4411C0C8FF39199004D23B0287F0044902398284D6CE8AEE33BCFF12376F54FB38FC64B5 +199: 10A389495C6C70DF373C08959C8561705AB0EDBB8F0277B43E7D0EC3B6039EDC6E64BC94E5967CA05A24FCEAF312C898 +200: 6D5EE1DA84548AE17ED5B8AE43D2CA3EB1FBEDFAD17867B32A4DC33B60C937C76D27209B4D17C940C512776537951A60 +201: EB4128D7F8D3558BA72C46D2DDBF9B1569DC86ACC44AB2BF7158D9F36C85434C3C7AEBFF63F0EB5A7EC46067903AF21B +202: 068852BDB5B1739D3AC05D827A1D04B8532C00AAF960850E38B86C80CF52B78D6AEAFAAC087CDC8F95E2953B917BC042 +203: ADB26C7180B8DDD5A18A1785B17AE145EA9490262472E59B7210E456C838B02B3FF85C37396C9DD4491999DF5714EB53 +204: 1F8BFFCFC5BC86711F30E890A28EE15D628805533EF977B0B7ECDB6458CF5AB670254571244D245F20A115AA72678850 +205: AF9E79C1B7C82583172AEBFBCF70CDBBBC5A34145287E48ADB0B0CDD1494E9223B2EAE0DC5E3544DA2907924A52C57D1 +206: 320E6240B59F41A42F2E402388137E70BDA609B7FED4805FC8DF568389C7F14A014ADF4B736E07DCE3A81F62A5936ECD +207: A01B5AD0EB7AEAEC76AA74ED3FC833D02CEFBAFBD9A684A743A05EF066B5169610FF25014CF4E3C9C09830872AF16061 +208: E3AD4F0E10B9C30E2AA3A092E4F7A30A89F3BA81E1B19E9FAE6C6A5A0177AC757D6698AD7FFC783A82D73236A73A056E +209: DC0FBEF72A7825E19F0860E60F0A930DAE3110D10FDB4CFE54C272F0C21D5EE1B1141318C689525E9850AFDE95FDFD7A +210: E40DEF10CBD64A69BD099D78599260636E8B4D5CF9CF03E44B878BD6FBC40AAF723E5D2C7030F05C44BDB513A294F008 +211: 56921133E67F37BA68B8E29199CF4A106FD7433572EDC0CB6440E9EF383C4D0963EF5739C3388B7ADD10D226786AC559 +212: 05111EE07C8CA9012300DC99E2225D4C5F392A04D4577C6238B2572B0F97BE66FA51D364234BA6DC39A8720B04C0BABC +213: 779B5A94AFFBA7EAF658EABF146CAFCB0F2C3F5C9213C11FF8C776A622C098C92B97655BE378042D2336084135832246 +214: A411430E3130F45F2860037C0E2B8D1983E90E766C75978886FAA3EF890383E382FDDC9B0D597BCD428048B3CF38ADBE +215: 9F0FA131949F9F24EE83F648F582F0ED55F684E23C9D71E726B53CFC74F83D6E5A7026D0728BE1139771B4FA04C7183A +216: 54BFE6A248940016B6596A18BDA3A5992AE03786AEECCE79B1B0D4B4E08985BD1D0C23DCCBFD1B2C89D5CB32849E93E9 +217: A7CAD24AEFB8133CC76199EEE5B8C789F7B37F3B43EF0B275C777735634A698305E4E975D0348564269CEDB846EA69B8 +218: 350D613190376D013DA493FCC24C51CA33285C7189E9AEFA9961B3F44F738ADCDF8B2586E9D89775FC920C2ADC4A89A5 +219: AD0A4640DE8ECFD31F506A6275094A677EC0CB6D9541079044B43B447573461B58EAE5CDF02D2F3AAC15D2D931EE9139 +220: BFF1485E7ED73F9F69BF067B11A7CC4DB314F4DE84E938A13DD38D8F67378D0419EC3C8BC8710851CA65841F3D938907 +221: F9FB1B3A553E5C5E8A00821765EC588A241AACF5CBC1CCFC53FB67E3F7E7B906CEDE21AEAAE6746B9D5CD12BD87B4198 +222: BEFE21A4D11E36CB1ED0261EA4509BBD6D28154B1379E20FECE905398EA671E8A3B856CCEEDED52818041D33D6505DD8 +223: 3DFC0D4F04F06E6EFBFAB1A5B4F9A363920E05B7CD6634DC9B8CFBA0B7AFE3A5C1CCC259C14B3E678A047FFFB1C42B56 +224: 5E64363560488187AA20814DB407E1A9A0E725DACBDB54FEB4E1102723961D01D3E9CB4A1023D1DF8FF131BF1E13E305 +225: BB35B77698B4819B0805AAD6363F65D597733DF0BC963B682082598E8D62BEA4BEE6952600B3A2E5B03993A5074777A7 +226: 4A8A2D66731901AAC2F900F9F94E21A661A63797AE5B51F8DA52C455EE498AC85C02CB5525F1266F43FDC67C6DA6163E +227: 707398E730674378D3242D5FD94DB93EFB0D93985F28159095AACB46503C3282AE93915379F9FA9DBC366AA8B4FA62CE +228: A59EB986281305BECD1703D1B4B00EB973B568106F04D6BED0A50CEFE312244EF5B3DACCFAC22B5890C3D6BB4D920848 +229: 7AE5FB1CDA1A4D7EC9A3A377A65F3A5F2F5BC800CDE0914CF18351952F197F130BD07AD53E16F613D9AB49B03B56DB8F +230: 8BF00DEB53F777780F77FCF14A524D53E2C3696F9C92EF54A5EC2777BCDAFAE1325EF562000250BA030ADFB27ABC0592 +231: E893ECF629A4C56CB45348FBF5FA126E95E3A60A0E590E75AC5FF7DF22BA609E72B7612996A84E8699F479DF8BB19442 +232: 88133645942997BBDC2CEF36E1742959869DE7494BD334CD7FEA8C7FC736FBB61E1DD952B43E4749381F440526201B70 +233: 8D6ED566DAB6634E1CE4F84C36A0112818218F4807FB7DC5ECE8F3C0055EBD5B325D496A52142519CCC3C769C3B65340 +234: BA2E0551EFC0A796AFEDCA3DC46010BF00D57CBF6B47ACDEC02DF67ADD7FF48EF4CC9B448C2E1014BED0133DF36237E5 +235: 3198B778718E3993EDDCEA855914FFF73DAC1BA04AB4B88461478D367EC4298BEE008F124B8AA142D314AE6188B0CCD6 +236: 532CF7749CA59217C79A83552A3DFDFB0A49C568D109BE4DD84462CE6508E7D64C0C2455D583A8FDE0D3A62289BCE552 +237: BBBD757D7887BBBABD88C247E748417C99F9AF1150E863F214264573C3905E3F85D1B715EC10899288BDAAF03060C329 +238: 7016FA50616A7EFB191520C1E1C4D2ADB5C5EFB295CE5CA387D5C786EE26E04BD71F5A3E0A3DBEEF6443E788DE35C5B0 +239: 9D41893CF2B96B4F488E4F693EFFB7F8DFADF78046EDD8595A457798ADFCB93F54525D5BEF065C66DB04084D855E2886 +240: B1770A7CEF9AF476931A16FF8C75F202CD9DD93C8A0BC7253B3DC72C7B44A9A9084BF393566526672F5AB383418C16B3 +241: 0A7285626ADF287631579108B09C4A8824D26882718FAD2EFC16C52DA6572760609DC05C683C31BDD88B63986750868A +242: 3CD0CFA89227FCCABE4069EBBC1F9124589CF5746BF5E2C34B7A0117D66E03CEE6F2874DDE05F02E3C33244567BAB346 +243: 9770ADFB0521D8E48134B11130B0A3F7729A24E44969AADF8A420737227E89E5EBD3DD4173F44781E2E0AA8DBAC2E7D4 +244: E15EDA14B3D4C927A427B0965BC1F3902D30E432457F74A303AA1B93DC81577800AA553EB5A94C474E62EAB1CE511055 +245: F2CC8075B56A3E5D4EDB69BD5F4091277A8470A2212A8E38053EE2F138B18BA815BFA57FA46943F47825E0E45F2EAFEB +246: B12C0FC3E3F3E03398979D0346022860091F94F15E452B58F3FB4748A84A5569ED15A66A0F0A553F60859E8F02A74C4A +247: 9968DBBF29BC7B469CFB8F7E3558AB75DE232876807E81F350D50A7B617D823E6A3E853AED696C1B2622892277080227 +248: 7DDAAAF3991EA439E6454FF0652F37F81722C4806C643B7AE8EB4E5EDA5B026BC0B7703D065A9DC12E2AE86B65873F7B +249: 093A0374C170E26EF7743289AC8915FBC5E5B07C0D5FF56D954DD256C78B4A926DAA64C110603391B545AF1AEDCAF707 +250: EEABCF9609F48CE7E2949C681EB97657C0879DBCEC1EADDCC8DD60DE1892BC7CEE2B49F53A7875D30E6A7036D5D7B3F4 +251: 4B1890B53340E5CF63CF9BF573E61A920DBB727FE7C6218BDE80E8941F47F0A107C24B84EB74762CF56CEDE7F047CC3D +252: 2F6F38086C248DA50D5D68209A45C1E1282ADFF048474AA3E6A7B85CD204645C93014A4AF2B7AE7BC8DFC9BCE7A8CCB3 +253: DAE7D19125E0D9B2FE039BDAE417AB942B0A66C98AF0A42070AED682BC8F173689EA99A1538729937B62F4E92D63134D +254: F5C90E2C857EEB7FEDDCC8C99885FF26AC095EB18FAAAE1602824FF7A83EEFECAA577018E104EEA421660CA1FCCF2C97 +255: 0C402634FCEE1DA322C680FE914FE9AE7A38C6E371B7B42B06DDB65424062BD6BD9497104C10BC5997C78775768F5DFE +256: D8B3B2F4C0679825244A53DDC8A39EC9A6AA800EC77086A834E040FC6A6AD42693B42E6D2BBAA78F0C0FCD24090EE430 + +HMAC-blake2b-512 + 0: EA1896AB7C8319A824482F757C038B70089765501B1F8BDB78153D195915BD330BDE7A8C0FB6DBF3DE09277662BA661FDE80017DC277309EEDFE05BDF5B27E18 + 1: 7682E08FF9DFA80E3C9883FEB9065452832084DD32C72FC4815D73906701C8DB39883BE4A3B7AFBBFF33597CA3A9D7EBD34916D2D3FAAD999EC2656A210EB76A + 2: 87E79C4A27B2094AFBFA6EE60FA1D083BAF46521E03EF7B2A487BDC5060BD3D0D86E28B5762AEB0A99B79733214137AB83C5FA7812E337051044B974C67D7E5C + 3: 649BEEB90C41F477487DB04BC6EF791065BFBBE78C916E0668C32A0D8A4805DDD1E415B33FA63F11D1463811757CCFA5317CBFCE2D4A0008D886EAB615A822B1 + 4: 23C6F2FD46B257655DD220650D4E04681BFA1B30AE76F38E15FA2B5E0D338ADE7D420A303CD8DFAD35BBB317079A55A90B958956960F8ABC43D5D20D9CF0B6FE + 5: D79F7E43E4C2C9654A1992354BBF0FE4800377FA600D6E065568B4E27DABC521A210EDB1ACE4EE5EE298F03BDAB769C2235D07C2A02191E1A7DA36D22863DBFF + 6: 71FEABE49DBA07EE415CFE4E490DF7234D5DFE275830F36ABD224AABC32D2AC3059BF23F784A38A3C9145441417D3042E0F95B74E9F831AF11CCC3AABBA977DB + 7: 0EA5FD2CB481CFD4A7B27AF1F89D139F881367A32CC76E7EA5DE5AD683A926BF3B5A5BC57C2D48F729DEE2AB9353228AC2FDB04DC31B0E4671B1503ACFED6315 + 8: 476969CF5B495F6278B815098A58C4E2BA4B50F6D7FE1DBDD67184713B37016E2DB6FE95D394215EA2C8363ACD4A98806FE788204BEC951FF8C4EFC0625508A6 + 9: 21169FCAC853B78E5FA01416A8E545C0C4EF610818A033889C3795B290D12E6FD024594860339459A730DCE43205E41B76C6A0CCF24CF331C77E9EEB657C4932 + 10: 6CDFD03A2D929FA3E174A576C2B26A89CA8EF57A9E40203E39AD660B16C3B70748B1D06FC40447F77E9D14F4A036E0204958AD0838D8359C724BF0DE536FDF96 + 11: E136FCD211EDC9C4A8E5D5088848101899328F2F7090888F78EE33CB10332E0D79658F6EA6A8080A858940F0E3335BEC44A5BD7B4AE0926F855CFEEE38AFDCF9 + 12: 591BAF602D92E369397BCF6AF04EB6E6CA5B36C16D93895614DF1F5EB3F784D1747DFE286A268280DA87D27C11CCFC67ACBC828DAFAB97ABAA16B748C0A87463 + 13: 472E91515238A4D76C71844A3C78A455BB3F6E017738E4EDBCF105AADEC7A636649F92AECFD2E36038DEBB9EA4298AF61A6EF8A9CD95BB2C0FC98C94D7DE4C60 + 14: 16C2FBB590F613F1D6C54548A86C242AA3AD5CBB842286EF3C5421647DD1CEE2D35FADEBF74BE8489A98403AD3BC74F1362262E355D9B63AA1B6CC5D8DE48B86 + 15: 6EDAB004AD8122442550F5827FFF5E37441F5389A19D8E2060B630B3B52F3514190C586FDD1F2B3BAAC228F479CCAD4A96E18D5FC2EB7AAA0BE642671DFA618D + 16: E7A23AD0444BCA20B5F660B83982F53AB231BF9EF7F0C8B7CDFEF389301CC9C9F16EFC95AB505592EA5CFB0F62873C7996443B70CA0B128EB99D830DA7D12BFB + 17: 0956D4C7D398CB4CE1A1513B676B4EDC958B4736E96275F0B26399EAA74069B8D907177F27DFFD0F3A103F12DEAF336DAE351203AD4E2F65FEC8B932EC804149 + 18: 5D8A510635022D7F4BE55D07023E279411FE3EBA43132BF4D0521BD23EE056BA04F3F01B5E1C395AFAFF32AC92F5AB507EE08CD7B122E03C98C75D295BA48F0A + 19: 1365357BC665858FBCCBE9C08722F870A010B501697927D07A57B6BCA6261CA4180CBDD77FF95B16390526DB966E23650A8F89968BA4CD768BCDDD27B206AA69 + 20: FA19E8206FB8FB96BE76D9996470CB9EB16E5E9B86F2A798F332FC82C540BCBB9C1FA09DAFA06B7CCD6FA50448A20BEE92FA7C74A06517A140942451D706FB27 + 21: 9366C4B12223645C6F39F63278CF87CC8455040ACFFEDA3ABA223BA76F350F0099991CC9703DB6D35FC5D91C88C0292A7483DB44FC3BD46CFA6F0E4E47F31279 + 22: 7B1E389354327EC217901DD0475267B709220FCC354EC2546A3B3EA3BAE0C3F3BAD55F032A18467EEDC7D798E107F4949C5DE6AB77A3825604FF2F8E36809C2F + 23: F07670D48E17914017DB563AD7216E682F6D5BCD1CE2FD9263F989F498B4E13178E2D6CACD6ACAF824D3001A89E0423AF0356832A855DA7D8EDA8043BA59BD00 + 24: 47EC9E45471621B338C0D508AC94A63656E24FD215DDD77E9E0B4E1510C5C1E8FB93F5090F2E0D86565A614E491CB5076C49E909254965D65774B6526A0E8323 + 25: E58B90B65E06FFAC887FEF9AE0F2C1357E020485A311C3E00F039A430D6151DEA79A25AF63827B0D055081335E350C6E41D2B66470B41712565C3877D185CA04 + 26: E9761CEFE922E0221700FB347AEDB4448FC65ED5A7C2502F290991EA22D18A0F4D788DF5D95B4ED2E00CDA37BBB6C28CA037B9D2A57C03851435B0E034156A78 + 27: 6368F5B7ED851155FD112A41A75E2E25E538F1775854B5AD73B9A7A27A754B044186EBEDA486AAB3487106E36FCBB07BA8EB2DE3B76D499609A89A7B8689BA78 + 28: 0DE1C2BFA7FDDFA1A463B0BBD79DD7342D3DD174CED3C707D8825F9DBABC336BA7CAED3F0C0C0FD39A4706FA03CF8991B44F0CE18FB8F797D12C7BEC44E91EE6 + 29: F1B7DD52C4EFF89AF0429DD389CA7B5FBB15B74564D92CF8BC8B531F9E9451B90745FA524BBC4AF716BE9E53390D290EF15408843768495CADD670D059FC669C + 30: E040E6CDF252A6A89F50758CF82B9B7A62A156EBFCA178A32A72E39F1285F5534860B9F8DF07D2A64DF110EFD11246CF9728FA76D0C9362ADAB3D95289832BA9 + 31: 58D724946DED80DCC21871147E9213FA4B16A4D3B0ACD90D827716D534A2B38DF9FEC3BE944637A60769203986F99E2967B80FDE5886A3139FC1697EFCDF051D + 32: 297F1658C7924E4D5B3F0D0F56E0C86116AF25068EAABF05D7F3F32CC4E388A59A34D4C3C42A661A062EF17C83F9731D42D75638FBF5F501566D3D2696585179 + 33: AFE015CD1034EF25D3ED02859A4AF0D1B0189996BCAFAA669D8AFBC5F49DF268090C43367A888C52398F6DE3E09C9C090F54228D791F6185B74EA081B8F0509F + 34: A52E1C2150929A7372A00C6319D2B4A990CCE3E9A2DABC6E04C137C49FE8554B0FA36E093803E9C0CCCCC86851FCCFA32C4012F3D39CD2D814FC266273A5BCA6 + 35: FEDF9EDABF14820FE5B9635C957AA059A48B65CAD0C54D6D3B67EEF3F1F3309D67F9976013F0337C7E454709B627EF8B7BA93DA5901C165BA82614A499A69845 + 36: 69AD3CC53F0831AD0DCB19EE1E35FFFCE4AA4F2ADFAA9FBD53F3B7EE8ABAB637B3BE7DAAE15D2FE9A710DEE69CC19D4508ECF82CF482337BDEC0A16190A0D9F2 + 37: 3A987894E507233D2C164C091AE4D111046C76226E618695C32A3A0879193B374F7216AB2B16DB0B495C9DED7EFAD242E06BCC4DB97344859BA1282898145AFC + 38: 1BF4443856163CD7A183FC55F365E2AED194B67C5FDAF12F3A0D088F5C0CE187509E6F384100982B7390CEA04D95E64B3BF6FE5A2FEBD462F381277333C06561 + 39: 9281DB83E58419D13ADDF1162A853C8C151518314904874E221B90CE60FEDFB407114889D5880CA912835D6B189CB0D01233EE3637992EB56A482C3061AD1967 + 40: 2A435825FE4D75D8AE4F8B79FD77CF54449005964DEBC4068BE8B837887AA985209FD2345E8379581013078AAAB3C02F4D462B4426D8C242FF6EF206CD128C81 + 41: E9A130DB46ACEF338D57FC079735BA36FA6BCA5068199BD26E915914548942245D0C77F4A62EF84F94FF60AF2404EB184DACA4A5A710C77311A52EDAF3E3A81E + 42: F4940C62561D58CF7433590476685E7561D9FD6C412EACF4E016C71E4717A62F4F4EC571099ABA6C61959044D49C73CC89617817B90D39610AEA94711760BBF9 + 43: A6BE0CC944D188AB2C90C998B19B9984BAC2BD1BBD6ECDAC02CB92911E3155BB8318A2651C353E1F711A2F41E8A920FCDC6A424CED5499FDA3BF97DAC1F394C0 + 44: 3B45666CA25E284F85562605F7D4061BF33C8E7A22EA7EB5646A720FFAD6D4B6517BF6A843C73A483892F943500624EF9A986E2DD3979866E50681E875CE3F55 + 45: C888CC593668B67B1CCA7F372A1C456711DE06EF694316FE4F890D67D3D8CE1064E4E5665EF49CF506FE1913A6498F5786014633A63AB547346DFA411050BB21 + 46: 46C223EB818C5E2E0B08C13C11FBC9E050910C266DFB1EB265BEDCC530B53157B8D1A17F889D69A29AEBFD41770471612213F8D218595EBBAE61A26301A38109 + 47: 58844F9F72070295F5D2E75B72089777551FD5C2AB782B552605DE096F30FD21A5D5D51EAD24E41084D6C52389F0E6D70370AA51225642A80D355E47DEA7A909 + 48: 6D507E4980327BDD63EA1148EACB9CAE281833F6849B681258FF26836197309729833D153AE18FB9A4DE8590E1D4673ABB7A3ECDD2AB88AD6ED3D7948412D3A7 + 49: 1DEE62031BF73CC3D028E1D5C0BD0484DB066EA7E1137767E7AE5E4BACEB52F43A516D1B4AA5D032900A27E447113E5823C99089D492D1B80C6F1787A296EFD9 + 50: 4D3A53873D325C506A5755D5A0AB9A1C1311C0930EC9CA627B612337407358D6568FD5D16B13954382FDAF42CD6506CA74E33D8F6C59D77D5CE108633D276502 + 51: 8C97A0BB3E2E34D4970F619C9902836A4BF36A2929093E605397B6FA4644CC48507E1B6DAC36D26046600C2A8535E7957C25B5B601AF9C7401A5E749D7CF83FB + 52: 4634F95A268F0D0BCD6DEC3A5E4908942E8C46C89227721BDB39763A7096695D1C0D9528801D6AA325FB2DE721C797B082E86BCC414FC7030C35CB332220F56A + 53: 35959C0AFF4C14AAEF9688E283C7E86215EA7D360C123843C4E644212642A669B82834B492BE2182A8699B4CE6D87618E07A2ADD6E356E2E1C6EDD5F2EBC51DD + 54: 8121AAD5122F9A3640FC0C902AEBC0F2C7F12FC4491518874D634D8157ADE473F91346E936C72A7CA512965417E850FC5E7DEC98CD29F2AE28556E3401AC910D + 55: 2C1885E35DB27B5C81E75B3605F2E488C431419B65305238E90046F963E0339B57EA10383F61B7167978B3CF25F8E51A419D464D11D5114AF37E1342630F1C9A + 56: 02632A6BECCF2E11456ACF45D7A8B63CDD5E8BEE24E6251D3B50E8112BA65AFDE80A10EF405AD311F999F6756BD12EAA8444FEF4D4B5C3981FDF1178308A6A65 + 57: 7DC7297BA07D74EA280C53A5F30C98366DD07F426B505D30A5F8C57A89B4729D3A5CAC997554EA6A06B5502F407786D3BB2E1BECA98C16FE1A7D67CB3F08E7DC + 58: A774D76D68FE1B3490E952750BD1F80824848FDDE6690FD797919FE1F5A7064B31CCEDFECB45F93592FC2AA0BCDF463674020CF667D754D7B3F730AE04BB7F73 + 59: 7A1A9BD45F66FC19828658070B1354132A192A492BC65023C9C4F32EEB14C2E6E81634C860D8A90188AD195F067E7A64DF8C4782647FDDEE50AF1349415428FC + 60: 07C0D5BE89A951224BC9957EF39BD383D584C8BD3A9D59913B52B92E3A889DC69957BC6B22E2F0C62D9841DB1D4938DE96A9434BD227CF3F5D550645E6066513 + 61: 9B319B6F1CE1A0A3905ECBC7034CFAA45EC0BF7615DBEA2396A435685C69C03C4BBC4A347D7CB153D7368C893DE3656C9E05BEA29656E61008AEC91DD3D748E8 + 62: DEE7DB214040C7DD6905943C7B9FAB2230B0EDA4955C22AC11ED0E3AD737348683498A835873CFD5F1623ABCD7354612F86B52D1C676D87B73BC4BA58A33B353 + 63: 0624D89083E73B452C33F62D48BF4EAF360E91CD9576EA7513230E2B3569B7A98AF9027C96FC5A4C7E2E3A0746593D126339355F368346217D0B92CF62B1B702 + 64: 12EF9F4F6B7A1D9B10193AF01C0B28E4408A64A54FEBFC449BEF4FD5D492D22ECF135EE37EF82BBE7F8F02B18776904FC1EECA6B8D2BEF3AA0C2F9EC542E607A + 65: AE31C0D73FE69FD9BD35CBC43EA97B75BB46A3E9ED6FD2D753E2C4D5B861733897FC9DF7B06BA818C9045AF7F88D39549116980E874D736F256514889A9648A6 + 66: C30F0ACFD60B1703ECF123AE381B9E18AE50B7AF7FC239F07B40852693AB70C09613B9092CF93789A94C7BF1E4184F9EAC9761D609B9138ECAC78301C08E7638 + 67: 3DE94D2F0A782A9793A077CBF8B4E597D9266DFB1BCB022E107EA00D9E975823F74981D506546D18D8EC3DC617D58F86E55599B5EC057070A0C7703355E9491F + 68: 1838A42C24B0D92DA5DFEDE6396794D5CE31B4AAED261CA2F54F8DB980AB71EBB7ED1F49C3D13A598028632C8E9B4FE4660B981779FA67CD40B8152860A2BEAB + 69: A032E7ECD1E85AA177E495E5364365F4402A302B24B0A38AEF3585653180CEE6D4AC442E5A9B3A8D84E95FA267689B4CD698F3865AA5787FEF95B765FBB975F2 + 70: BCC3B2AA991198658D7B12F9047A8E1D5FEB4AABAA3D16D1B1AE6CA3495AE8894658B531689F68CE8DB6F8E6F86532D0623B39CE904BBF8B1CF63B68773DA0E5 + 71: BC90C3EFD52CE813B53F3D11EA819C83519461D849E4DF91B0A0252429593964611D8235F720F5AE56329C3BF5DED84F3DF47DF673E4BE9181E2744B81C8C07B + 72: 0A7EFF404D4B50805C91562E78B87106C58D32CB5A21BAA42DAC5D74A86AC32EEB0F974BD7FE6537A184FD87067E3A40BD3A123B5E20BB564CF7AD00AA70AF0F + 73: 516C165F28DB4123CED152A365A39787AA38E970DB9E288AAF3714CDC43C5CD11F962CD55B6CA9D7170CA0F4386BC0C3984EB523F6EAF20AF194490732D4ECAD + 74: 02D68726E79914803D2EF3CC38E15257EFA876F2F5F66F2673DE7DFD43B06CBB646B7258E2C6EB048823D7B4B68E5C473128CAADD356D0B66FA557F22A856589 + 75: 6322C5416A2A4D7AB31FB298ABE6D080427339A78D99F61B3D417FCB8F45EEB21A4032C3E48F760C5CAEAACBE5324445A99E56E26E4970F8CDFA4264C5EB074C + 76: CDE1C7BB34341FD7D275607A64CCC4EC66BF9B1335012E2F496EA325C0CFCCEE91EF7A953C643A6C76FA2DE5F6E227B99E248147C03DE567BB72803ECDF076AC + 77: 6F1523C339675F50EDFEDABBA7A0EE24F921A6AA093E9400C03C48512B33B51619ED5471490F83A09195624E457C9AAFD4756ABD80D80D9E4BE1F4717356DDFF + 78: 409EDA0D7ED32186054C732CF126D66B09C5D393C0FA060936AC93CE08049BA6D95E5865B7CEE777482C24F0FBA9B3FFA993457BA007FD98526A91842A9B1909 + 79: C4A0A183DD67D4907C663556E40E4F77E44DFFDF3849F1A39EFC2847399FAE6BA9D7E39E529136C7B2898408AB96FC4BF985B8E172040A22F8D94AD8386AE2AD + 80: 307509EAC26FB8CC68EA06DC7F8EC70AB15A1EA764D23DE26D471524F1535D3A0F74BA977DC0C3C821C7763E81ECDFCEF23808B87116FB03C15A9C0091B76967 + 81: 8A4197EA831F582FE31EC5C5C7491BE844132F0F6939742E8D0022C8A989ACA28F34770D2AC60751E680ADC951865A5486497E3E15104F58B0003B9730E45431 + 82: 99303E9ABE4962EBB2688B533985C3F40F552B1394F20FC87443B4B0329BAB4C83548AEDBD430CDDB296F7AFB4F1DF7952CC6F8266D4CFC9A5D35DAD4DBA4EB4 + 83: B253B044D70E45480D3B985F0C3BAAF3E39546C5D349AC5863E154C90B2632A2F7D7A5C884DB438AF0C96EE5E316BC82C1E198FD367CE79BF51A5EC0BB87609D + 84: FD7664FB39C69DE4507D1FA4568B148357CB8694B33C92960058F68B2EE04CE8BDA2ADAF4DA3CC12C3AAE2C0A33917ACD5E61DFFF11B898C4FE81264D4EE84A0 + 85: 66157A9B96104FC2F77BF8DA20821C01FAEA348919FF9CAA1821FD953F1D5728B737713FC838C65F9D623743CDA79EC4CE0F32D8C9EF4CA4CA1A1D7ED6C3C34A + 86: B4B1D500113852ABB0768423620723D3076E740773E03ECDD60E205742B0E441ACB03D88E15D0B008BEF3D3FF5C737C7EB5889223F1DCA7095FDBAC534A1BD4D + 87: C3EFFDF2C3D14C674DD619B3025B8539BE53445BFE6276D0C6A67E903BD73D76E9A7C68C6033FB76970783802585160D0643A7C49A15A114CBA578D2CA3CB1E2 + 88: AAA4842E9A21214360F774AA1FA92E7E4A100D9711F0CCAB8A2A25FD62F6CE5733D840B16B90E6ECAC19853BEC9C4FF6F7C762790907EA9E4857344AF54AE664 + 89: D3F27867BE6334A88980473459A4F7345D3723D7B60D0B29B0CC254280437E7CF4BB0E8CB4905FA773B33954CBADBF37D6C92EB252D8A54DF1B240AECE2D7028 + 90: 43EA5969F02CC21F4460D1C48B44E18777A48DB1E43C4FD2315830DCDB90AFE45540405B2141A4C7724173869595AB50A3369B953CE758F6C54DAF8579DB1092 + 91: 839E018A7B3C2EEF20E23966A4E5896A5A76720BA5B96A7BF58594F792BF79F8D847EF0B6604313D4C2E3AA16CD529F48D5043E2A17E9C665707B9100C29D71D + 92: 70F131D422CB59B0E8AB2F2153FE84D2A78CF757B50073BB2DCC42850A10F495357E9D8304CB870F946E97C9DF2D9314F333847120ECFA8E2D39FA96A2F6E1F4 + 93: 947CC741E6BDB17121F3F8AE0E5C29D4C0D1655A5CB5690FCB0F162D123031CB170EABDD2CBD7299F682162D1CC30B51B7B168597EFEA695FF50813D1C5EB2F9 + 94: 757D4C28D2A4D195CD4D0D6763BBDE5F47B8E4B618A3B6288EB928CF848F881894EB277B8134CF049CB231658FCE8AB2CFE5D01A8D4E9AE1E25995AE98CCB901 + 95: 7A905DABBAD8A3686853F36B89A1F1CDED0C1D182D18C18FBCF07B96887DA95876E910EF1C2534A5E002756C22798B0E56BA187C114BBC57E780C1C9C6400482 + 96: D5EB414C1E39592C02E464607335720C3E5C2D1D657B636CC14DA3CEA517149FEA6B7E3CB77245860746702C347A0A1565EF4162670D1CFE054EC426B1B1EE1F + 97: BBA74C30CDF61CDB3B8EC5A0EEFA4D6488DF5014DEAC77792FFFBDA5B611976276D5EFE3472076DDCE1EC982869F6B56E283B5C3F3F07465CAA4C2240DEEC3B1 + 98: FF08B16224CBD0C07489063EA843B864667CAF3460B5FAC806577A0DE2BE45D451410C21457FDFB084B84796C9D1AEF0E8221DF0DBDE77E62CC36761C5A64C37 + 99: 4FEAF081BEC94D5064F3E2D5ACE753827DFF8A61648798587FA379C44BEE4F60F9103CC62282EA2D5C54CCC40BA70B5C9D109796915BFDC04603746541C164D5 +100: 207D9ED6ABBDBD1480A647CF1ED5EE377714B6B15064D243BBD88C8EF5453F1B13541480031258099D76445D9F0BE03E16D1F6B50160F07B37381F57C267DCDB +101: 4DB8B7C7A483C206EE70A5A2BD8CFE8C4EC02336BBEDED4EE1131BE5DBA426E04B26F965E675DA8F590F9066BC09FB0BF4DDF842F98F4C3F1FAB76B4A5E4BF32 +102: 80079A4F4BC288147E3871AF1BF4F284EA40E67E0FD8154E1E246A62520192F20F7DA3A27E6E691724F5BE4AFAFF0E0CEAB8D509EDA8CE96103493099B44DB7E +103: 901D93B51E0FBB6E56FDBE7EEE09C79AF5EC2EAEDA634D196D1DCD42DB54628EFF7D6F61554253667DD0F1FFD3B58834B831138243F3B494CC337881D41BD56A +104: 3CCCF5A353C25AE6035632DF94DED5577B75350883B20A682E74C800965F508DB3885BA3DF13022A5410593380430825ADB3AD2AAF85063A49DCD555AB001333 +105: A18FB80876F663B3896131769D062C9CD210EB6623F818DCEB026D5F9723ECD4804D7DC3284D0D877C655AFC95E9B29BF38787D84D72C22C1B8651BB8E2598BD +106: 7AAC6A8BBE683187AFB0B84E8B4DC454EE296656C42F04F6132DC1965909E4F728A2267D320E9D1815365773B5A44273A2B51B70FC1447E40162FB8D82530031 +107: 345B6D3EFE8E80496E56DAEBF4FB3993CA8793EE93EB62BFE3CC008A0D22FF7CA1CBEDF8041AB4AC09FC217965BB73C20517498B7B8DA880CF0AFFF9025F761E +108: 59BA98D091D97A1F8B3D5C307F433B90D46DC8BC14A00959171FBCA8A31C15E38461FF9AE9A0DB36B9E1E0E491F42B53632BE731F10650E5A150E6BC414C0F53 +109: DA8E2676F88A764BDCC8297AFAE841993BF432054D24F6B62C79112AE79E1D6A0689F14759BEDB338E58428DDA56AA161C9C568F93479EC9C0554DD97CAF824C +110: 9119108F59A0C428103E86A35460B81102F3513AB143FC3BD4B9854C86CDCB19A06D1841C52C1C0C1DC775A1BC65E9C8C7E3C3D1F18F7056AD2D001F4E5683F2 +111: 5D5344389FF8B760019D4DD8C850051E6899E97B3E1A0496FDC23B6172B4D944E628E6F4689EA75CCD72230DC44AFF3CF5BD780D83F91EDE28185E49A17376D4 +112: C3F6E19EB5B02555B59B089C2DC57892B325EFB3334A0567769CD09228609813E7E62137693507084AE4479297023B52BD5C303D06F8705543E86575BD814C4F +113: 5380EC375AD10AFC684153BA5368968B8680252C4C20DA44948C83D6EA7BFD4C3C06F421D041B2ADEC9B9C59D00A8BBB63B55721A5E33FB3A58D503AC6E4C435 +114: 8E71FE96B7435EA16B4964C00035F280B1A3E8CC3CE5D3B5A4786DC4070C83E5264426D54232DDA57C141F14DFE7439A30315341461226F1A5359576FE43F2EA +115: E313EA73FA31952BB64995BE1E3D4F820A5FDDD775FC86CC817AC168BC5D79B4C594E1802A56963D1D3DB3190B50B8E049CB4DC89FD1F81B7F32B10931A8C96E +116: E89C70262573BEF710E6CB9CA20A600DCE52752F5A9B50C440CE94F9B498C8B8D029DD768E98F0CC0D5A05C84FAF8043A4659A3F37229791D5518651CD062EA8 +117: D0C6B3FC6B59118E9122574115299D47698A42D73897F0638E3566BB498AC2461A7635AB4C1670B64406732197110C7FBE2E383548801BBB0152ABB1153F495A +118: 295F030512CE6D3361657401DBD1BE01FCEE58DBD83B1419D22795FC5AC0551509398A55B2373BA606144CE433C3045741096222DE1ACEDFCE027A4BF5BAB60C +119: 57419208636AB909E3C86BCB79CC971398F41310B25B7E7E07F502EC4DC2C328BC050B0BDDCFE1D8101A4D34EA0B4EC794B82BD2379AF2350AEE6611D272DE55 +120: 4092620F2AA9B337D09DA7D437F75210B9E8DD7B86916BD7E2F4F53AB14B01ACFBBD574B22D0F75DEBD7C2E24D9EB230FC7801D03B58B656218AE72E9A3D6074 +121: B8310583B8699BBAED86F734263A24F294CEBA0A4607CE6D2FB1DA125E5C29BB6D82C0D46AD13F4659EB9596BFFF85050BF318A912CFD0C7B0727363CD3BF945 +122: 43ECD72003EA43024B62420CA77B5D867FA3308321F26F3A67409542E7C14F7CD3062D6D0901BEC5E3A6FD2A2226D9CC8D321999F3824347720A28E681DD570E +123: A94F03F37206896D82135E491823EB24660E0AB97167D5760023176BF41961DB4B61BD7D3125066502A5BC16B8822D3CCE174D401FD154BA69A39C55A1DC2828 +124: 0A3602BD0205F614CE1ADFA35CE854DE914A46BD6186B14FC43F19FB00E34D81ADFA50CA512DA062DD98626DC05EFDFC3939082563F48678CA6694F0EF3F0BBB +125: FE6CF04D96D04778A27918451067083026D8EC299EB3AF1EC358C4471CD031656304F1C699A50AD3603454D9C840FE94A1CDB2A4E1E0AB7FA63997646CE12592 +126: CD5AA685BD788389284F7A66A7ECBEA1E91869C1F91CB2530AADF1C459C26B8C8C0138B122CEB0FFD6D20C1DDC4D6D83075B490C2BA36BE7409F3584A7A8AA04 +127: 65486D5C1BE12DEC14B560590A989065F635EE6F00497D892922FDB2A0D0BCAFDDC2650430CF0E06948A52FABAFE6BBB77C2B263FEB7A51D06D6BC6C4751D9BD +128: A44655F4B4680AB484AE8B0E4ACB42715D52A7DB30F1873BB17DAC82578B95E5A9408DD7F9B71B8C623DCBDCC39B3BC09E0F9392E5B00719494E28263B4956EB +129: 228E98C35B738C92E3B3702CE22CD54B0E5E906C7E0D973763BEEEFA1CF3F965743302C6A1CE1F64D89ACC61FCB18C61316B9F939969FF02512697ABA801767C +130: BEEC3A4379AA56B3DEE94B85DF95695AF84C30031C7F9DA21D55387C1450461FBA0B53B39AFDE37333631607F6A28D50DC181AF5A77A2007EE9BD7F14F3B00C6 +131: 6FABF195097F95D3B699B7095F0237E4528955BBD649841BEA404CDBDD86C72BCCC537DF5442DC6B6583980380B3D30F4296322B8C76DCCA1AED12261A4A2527 +132: 8989AA87A728EC695D684E330F14854C64EA9698087F56EC574B1ADA2857D5275F9B7C6FC44E3A26BB132011F434C8A440D2BB44995CC2A86BFB6B6E0C8A6747 +133: 207882DF2DA14E1C9603D4E18CE948C5E5476605FBBF035F44629DC2D19E249CB24D6C0027D9BDBCA761C3A8B281BF7850A628FC2C10DDA6983C53A6CFB0A7E4 +134: 287E99C768F3B717AD10843AC1F73804AF90A008ECFC877E44CFAC6D02D59A5A777A58209D88928DDBE4383666F0878914C79F08EC55C05D9F30B0CDDAE0B4F1 +135: F660DF06604C41189E61A26F1E7F8FD0DA6A41F59753100435CA46001673BF280400E6B7A7A3ED1CA0DC1E65D0365787BAFFC170C4836719DF1713B028C10D24 +136: 16BBBC5713F35D9DCC789F0FBE572C12DEE482B1A05FE49074F75A2C650A6394682F7DF2B4DC8EE4CA7E6FC62B42A1ED906C50CF0E6904DE68AFD678785FBF7B +137: D86ABA8BE95A657F33402E2ED70BE9FD707DCA2D9562A386FD0A783524D912B010883510C80708E8427BEE01D013AD935534316B331210E303376A9E16831E08 +138: 7813B00974EACFDBB8D768E2A9C178B0F5C4EA9233A9C442E30EFEE86CFBB0E2F6C36129492909457920FE9E6D6D540CC4B7FC2158167A56687E52C42B5DB35B +139: F075A524D625DDC0181569D34B4FF4FE290CBCF88134FF0325E11A843AEDD59DBA24E27A89615096610F153D9506E03B1BC680EBE00294E6051051D0B5C32B3C +140: 26FA214DCDF29754047B2FFFB587B64E8987FBE76DC600065F47A411868F9AE47585111460E39810D5E841AC47274EAFB305874411E086C1FF43EDD7B2A6A385 +141: 0022A06E328D2A2082DE5FC5EC69E52BE33242E2A47B6E6C405A82118CBA955F6B0E71305DF8D06F98F209529D0143638161663407E28794FCF9A78ECD8B359B +142: D29F32657442D25AE034A4DB00BB957A74725618E2609EC0DE9B6E6D49BE61AA2EDB5699E482C4ABEF7F173453C6AF96AE86B30AF271B2032926028234CEE8AD +143: 37D8BCF9AC9B658F38D6A64C47AC07EF5FA5B033B1CCD40CA0782E9676C4AFD58EB757B758333E5BC516D4706EAAAD8CE915E92B4B317541BECF5E1BB6EC8577 +144: 04ACBA5562C9038131AFE06CEF8CBD0D4DAC374ED4DF9DA6A47E5532A527CF8CA4A4EA4062E9F5CACA63594E0030253DDC2347954DC8517972C433D1A16EDE29 +145: 6117AF6A6F1F0C4D1790EADAA532DD4453337CA61B5E2D996188B3B4C1F6C9376C6066846360B1A6D3CDDDEFDE592AE251A81403EF54882FFDA0F0C380E7F55D +146: A5AE946658C6898922EE5C92268AC994CD2417E2F631A0396C8EF6CC67E4F2812F6B794D969C306994E01C759F1AA0EFF81F196C4C2488A0A3A638D88E2EFCD4 +147: 0422AF0A73064F54D423DFC8D2C93849B029B25C296101C894DEC4B702660C70D9ED585EBC81DF8CF64A689BB586E75943D57984FCCBB1D9761E64B22D22A912 +148: FA4ABD456CCEB8130E9D6B451DDAB71D6D683F22D97CEE91848B8A0D9A6C17BA721FD944B179ADD6A77939D624F2354821CC1BAE4879D2367A58C1F41A8EC4D7 +149: F1BDEDE21D8A9FEFB115AB33911D733C53320843D16E0090315EB31E1CDAFCFC896DE46EE638171B59E0552D0795E64863FA74C02CBA70FC76F0DA6EB836621A +150: D08D5BE3B9D15B365FA7031B8AA29041521619FD6993E9E2F828BAD1A29048A0251837216EFF5004C4C11D332098F0ACCC15E0E6F3B52931D3EC0B79D2BDC48D +151: 77161D3C18445679EF0F208E307275D979FCBA8B55FDCB06B60CF99A9BEA2E1D9A397C612F9CF24D90AAA1BBE821DB5FAB2E039611764547D3CEBE3B4D2571A1 +152: C6017E7F5EA1239BE480A5A730AF6E464045CEC024DB8A2D0B5B5D569F4C0F043F22FE56BF03CF3D0EB743A14236B4DFA4B3232FC2B841947ED166A526789924 +153: EDB10C3A3695FE4E4B791F953739FB16E4444F202AAD171B800D96CF85AFC69E728EF6D8A391C769F1ABDB8546AD8050D13D15A0883262DC947D8E842F1372D5 +154: 9E1BE52AACFE0D2D2B4C4C506ED23AD54C0525D07627F0C222C6AE49FA2D4476C4611D94753EA6C134F4ECDEC3C6F614D5FCA283D43BA65AB89388C1D20DBB73 +155: C0572A42CBF5636C35B1214F22D60268A1692C3DA29FC85FC48C454FE1685DFBAAACD693CEB7FF0F2DB4DCE66DA7FE14A404C30BEFAA03CF3638E1344DCA4220 +156: 1023B73A74252B510E1ABD3FBC1D317BC4F17109635FC8866A378EF02FC7999D2088E7DD1F994F41AD3D4D01B86FBFED6663AE5343BE28459BE9884A30199E38 +157: 79308924CFB5C1BB96B5B75FF0120BFE5AE9402FF4C983674885403152C47E0835E2A152D0F3C612A651A87B3F0AFBD5875695CF2CFAAA72DAA9B95432B37902 +158: B8F6EF849EE2F312FAF44876DDF2EEF4A37FAB8A7495E27C43EC3FB0B008E14D5DAFBBABF6CEFD09BAC89EE3980E8B761DBE35947D95F985B5E0A0B4FC42C872 +159: 91B5CDB070E4C6527305E0F73DF0177EC0DB352D0F5F39F7D46DD7B5BC59B64D7C830163FF344ECDB1F46E22B27A7C7AB3CEF9204D90B8751F4A347DF32EB262 +160: A95B6038C9F4D8AD16CF9726352030A0EFB957BA58162F8F21A63DD9BD3608B8BDA02F4F23EB05D16D51353AA84242C9A20296C2B72D3982CEFFCDF5E82F2EAA +161: 65DE94F2089A3F9D3CF6DD8388BB10640D8BD05B807D5BA08C9DF8B5D552448CAFD991867AB025D1E27F2E562624596D12D049B5BF2E5F897C465E42F04978F8 +162: 9BA6F31C3CCDA57A5470E2591E6E43C5D3C6E6E5D0822CADE1CBBB91D3A45E1F61576C427B80D77A57188ECDA04EBDD78162F574AAB92EB65E65C09E48FB5B5F +163: F123D3068AB2FFADABF06D98AF6B756B6ECF03AC85A98684E0964092BBFA53E56A2811E1A7802C17F838870D91EC0FBACE6AE5ED882D2B532AE5922A6849C9FE +164: C25AE90AE52FE770F4EAAE7DFCB798B7CC77FD9EDE79C12831239A966C012B1FA8DE50D4814AD415E5B94DEEDFAAC8DD86F28A40DBAB7535B941484534FCBF55 +165: D642150F3F76A9357F2DB6FE19055D522777FFFE137FE2277E5C7BD974E21FED05B76BA1DB0EC9CA0D438DAAA029E9F1DE1BFFAF17FC96B12099E94F31ECF304 +166: C90A604694CD5B694F271212E0356EA291961492AB836DF257646239131485C4606565BA17F73F1C36E23B35A31A35B34A6B9EE32E2403D061011967586BC771 +167: 05603DE1E9BA4B580437D9CDFA3E55691B46AD17EB7570A8D0C6B93A15FD3F18BBDA9E9157CE48D2531D20CB4BF429C41C201F4ADDAA5A5C9FEA23189C5529D7 +168: 772696481C283004B659C32927EBDCE11264DA372FA5C17CA59053310083D9DFA55A8F6E40DAD12FBFA27B9B6A0A0495CA86C61FEBBC5F0EC2009088717941B2 +169: C0AD90C7F6D748BC371C1EA022B76C0FAA83D81C3A2B29E951A00D4E92CD9D0AFD3B7A5F8DEB7541A7876774CC29F6EC8FA5C954A3069778FF1CA384CAE2F2E2 +170: 350277196BA7D1A3D60492A03323276CA437107BAE847A3A48032FA9E8399249C34D13B5A0356DDBBB91A6901B39F222F7C4389291E7B02C7FE49DF24B7CA44C +171: A600B600956764A530E609CDF5C9F863049B642C8467BFF33CD6DBE92F3413323FB0DA55CAAF9CA5F7FF8D437C985B292C3B17AED4FBB1312559C953F6E26F70 +172: 27E5B647D5DBF77FE8E56B7ADC2FD4A8CC724571012C5A1BE8F29DDF09CC37747852B18BEE585F2B2D640E9C2DDBBE33F00130E5C5C5C150F14306F41DF9AD60 +173: 438D1976A4217A18E0741EDF05B2B58FC67D2CCAF7DFDDED9310A5697960EC5BB8CBCCB649075454AD4AC11088E56118EF5E6ECAB4657A8152E886C901F95FED +174: BD10B1E5F03A2582BB83BD560B2F9245DC9CDBF709A03A4619E02ECBFA2D0EAC5AC9C1C08B7EC72F098A21AAA7BA9385866C4943561AD94E23EBDCF802D3CC87 +175: FAEA995E3E4C662F779D526062FCB3281B7EFC1F5564189D26196EB327EE99AE747479348616EAC982ADA9608DD7063B6F38327560B466694A4E6BF65A863193 +176: 40B841A26B90843175D4013784C2F1D3D3F9D1BFF4626431D2E7A54D2F07BBFE8E6558AE0AFD6502D75D2B0F24FB7F61D778DCAA9CB6A5BADB358564BBC3CCAB +177: A2143CAD931E75B65FFADC158E0D7C2D805472BF82ACF3E091C0E5322B50E156F3CEE474A8DDBD693135A08204AC4DBD3999EAD8A97B3EF2EBCE35CA5C158378 +178: AFBA7D6AA8DF58681666E911307A6870698D6F8C5B6A5D186CEF35867A65584AA0501E1478C3CD66D0FAE8137A994DF62425E2981F1C733E853F157CF304E46D +179: 9231A406995AE03B62C1CEF89853A3EC315725DCB40D927EC1413399F425402FD5628555A6F0351AF9E0B3C47F7F8450792001C876D1086767A89D180D1721BC +180: C56AD16C7BFEFDCA88CAC3BA609A43126953B2C450EBCA87CBF92397F7CAE12A20870FB3C81386C7E2A1F967559E5EB7A3E494704870308A5F5CE756BAB9CC6D +181: 10F5BBC7588661BA9D4B1350830863F3CF63A596026DBE72542DE7EB8C56CC79140E0DD99C3D3DC7093589BAC74F5E6572C58535ABF64C81FC6CD8859AED7CC0 +182: E487FCB67519A06F109D0C27235599B5BA09ED02B2518C923DEBF5F9CDFA5C9EB59A3D059AD5C4A7B42F36473217B370A3D71951CF38B36178ABF00CD39D2FC6 +183: 5DA067697E72B521373DE0BF8A6AEF324BC21347812986237988A092F75BB9813AEF6C7992E0CC325CF30EAF0D586231FC8FC2350FBC7644BB9A7FAC9DC3FACD +184: 0C1E455BC16F7A32211E463969646329B0EAA3B08E1136A63A7D0A91F8238FA0BF7D2AAA7DC19356DF8FB3B0EC2AE7F199A62856AE58D3913B5B53E66D2533E7 +185: 586086132A2BEAD42C017BF2AA833DF668B2A55338AC19F2A3BB0634A9EA95C64B7E751D74E07E7BCCF2BC959F1AC1947CD67B684A2090A456469D251864749D +186: 92F031794AB95444A7129125B18FE70DEC5A76215473E9FC155679E2B7CC7A31E3202F69478CF07AB8D206AC1B5EA905D12F2987175EBCB3DC7761EC3E7F32E2 +187: E03B50D3250913B4F1AD62662A9B83D557B2314A9373EA2F28F58940B2C91D96745F6A4A371B9929F023AE92857FFE814A2057F44E58724B57056FD33224842D +188: 55FF8EA6E624AE5E8A3AF14E389915AB792541D32D5797369E5A76699FC4C7CA188F44882579A9A436C4C0784A5A3A0FA99E5FD988A79EEB423D96CE194D411B +189: C1FCD5551181C3FCFB3CB866F9EC64340175047EDD2766440A0CC34E3EC6B90524DF1890E216A2A72849D39A94ECA1CB3B38A0DFC847798535A07BA7786B9B9A +190: 5A54D9F2A83C3D2883D3CC3BC7259387A6359F787F6CDDCC2D2209292FDCFBF2D97423B47A070A48616ABFBF12E2DA489C84BE0B82ADED5F55AFD19CB6601273 +191: 332C9B6DD8D96738302633674A4742BAE44C7BF814AB4901D24A2BFD9532668360FFEE81C3C419BF90215FD1C600B6FCA87B44C4ACA0591965C2F2E636945A83 +192: 7F58B35E7FC62D1B6DE9ED0073D65E80DD663F8E84C2456D36FE4F0F894C5C07464EDFBB0B9E9900333AE97864ECA28BA289E577928D12197F6C9E753F03A714 +193: 8D2DCC233B5CF142C3C1B9D18E0ED6D0FEBBB3AE85727C36D4E646C901394A60931D412FD0D501F7513AF14DA68B2EF89692E2265011A085C9D71BE48CF0B800 +194: A8599ACFD7915F199139764521DBC6E1298C4E1AE835A96C7A3DD3651FB47B469D24DA4FDF0089089612D14E0B4D5D874A26D560CE293F4F4C0F197E0F49DC18 +195: 95FB01F0837E2EAD37BED14FC8891962B462D2EE28792C32E11AF99EB423B37EB087EEA60D0121612BF0265ACA0B7D38AFCDD1B2AA1C0B32E1E6EBE85849C131 +196: 9957A95CC23B0B60A9C4D7BF3D18E435538A64E86F9550FE4003B987B103B4D81947D2FC312B228BE4D5400E4F7F4253F6D2729B64675B9F42F08B5ECE486690 +197: F4E171384ED49755AA2281D45C1D4969E9C16AD9667E12365AF248C32C4F5F81161C428EC566DE21F1765D46CF1527C42479DDB3BAC74478FCCF8ECFF0CB8F89 +198: 3148E6C8106E1B4D0AC1A60071BBC61D3E219AD2C385B4C584B00EEC4715DC6F470E0C385EACAA5DE172DEB86D03FE8521335417F993244162DF5477AB3673C6 +199: 834B39B087C0AD092F5D17034CF8C3907BDAE858E48637F43BD302CD64B764012408B86424795B4B60A1EB8B8AA41E1F6E280AE4CB550BC6B5E2B8FC969B420D +200: 7F6BC2F4FBD6508ABB9BC1BD358A660A174393C1C07C62FE76F50EA82A08902D38EFBB3975A9B4F29EC500F8AF40A2CB0A224235D6C56B9EA48A0568FEADA32B +201: E3A368B056D9D409D447C85A6F3050283DB26C916D8BC2BAD5BEC5B60FB91B93B9186CB165ECB0A63F49F8FB8E227C82250EE4D969C85780CC28FE1D255E2832 +202: 0161BE50DDF3E016FA68FBB642894E9F7B4782045022A2203FED43F3262DA985E4DCE2A4422777EDF22AD873209C8DAC0532D264E9874D50E33B54F9BA8CEF6C +203: FD9920E438B41AB3D1FD62CF89652FFBEA82E291038C0A16A18190E9AB27283894753CD42BCDDC60B554FA19881463DB049BF924631D85F7065E2ED40387178C +204: 3A97B803CFCDAC445DD9A8AF654B9A98B664E84FCEE56D9B097B6448625894BBCC7007061BE4D2DF8B874D60F977A0B9A36B782DFD4740109E858DDB13BB761D +205: 520AA1AA599358C3524CC24F86FCE8142E19C4FC4E6BA3C00BE80AF4AC9D0F84743FA30D9DB9410A5DDBB6C4A66D30335DD5CFC8FF09C128773F9412EC9A7D02 +206: DF64EB972A7E1C0C74414D0D71C327A6275977E2D5E0878A657B7D64FC82FDE26AC5D0FBABA412ECA47ED35F03218B009C816B85B4547978102F7CD2987088E6 +207: 46A3AB0D690B6F15F905C3E58D0C317B5437F115AB7EB81E88BECD1ED5715122B7A32250898528490E66B0D9B411DB00979FD2DEB44A06AB32E4DC91A1DC454A +208: CE9DEC64B3568EAFBEFD8CFC223289A5F6D783A54BAC6D6CBC52E276D3FA15437E0BDE4D872BF1C1E2378C97CBFD6B9523B46E8A66353C25AABF43336DA834D8 +209: 525FA87377436BA644C9E6ED794AB64C2B617869F87E1522D046693003AC67ABA395951273B0361AE6FB0BCE53B7A074F21430627D69C47DEA17E35980D053A3 +210: C312700BB7F49C6618D757B23BD0B0EC07AA21E7BCF2093E5CEC062CF4416F8C54C76DE9F50D4E436290669CD33223A74357AEAB6D9CE05233419556E5EC4E7D +211: 92DE52D6EC34E35E66FCFFA0EFAF0F683C7907CDCE69CF001266FA15E3B62D9037175F055E460F4A1A788F0D088531D914392CD1BE5FF11D8261E2C4C9865723 +212: 314EAFF5A5AB71A6825F8659B7020C24E891281E376D0F0FB7A5DFAA8C97E1D2AEB4293602B074B568F4F93EFD507C035EADF7E88479A02FD449B397D1B15718 +213: 0C3E9AD8E481E64CB0B55F30B817340BCC99A480BFEB6F870A94DDBE8971A0299A3915C3B68E05AA13907EF57D1F307E9FB1B8A8717C824B308F98828DD261DA +214: BF9EDD790DE164C4006B25A65835C69C9F92B7106D451FA251798DCA4362796E4C7AA2C1D8451A04D5BE2118E81F778663AE6F132D1178BC22A825FFA929F15A +215: C137755FD583558D753EA58F7036C6B7AC80A79935288B2E4317777FA129487B38A0A26D95E63B5372BDCB97775902A0238B75FC28BD19959CC7A43C87FFB438 +216: E57F8DC55B423E037948BE4F84D48D3F5822572638960FA751EAC23AA33783059341C6B52FC065E3C1889809432CA0BE2FC071BC817DCEBBD318B116AC057A24 +217: 95172BDACD164CCC6B584291EAA1E553269CD88DB3A5C588D149B67662AB709169EA6FB9C4432498223DF844A0FF94C9E21CDDE47247442498FCEDE16B5DBEEE +218: 225AAEE28945824A84E7D9DC34D96B4B364B5591E0027727D16475BC95D864E154B8144D6F24D646F45A0547FAB18D556B4F452E71FF68D1783CABE48EE5D454 +219: 4F60A23917E9C6D893EF478477CF915C96DB18FFD1026832F35AFC4BFDF88519A964907CA540BCA7C63B22D364F43FF2F2412ECDF8C902B1722A0EEF317986B4 +220: E06B2F54AA30F3DF6EAD09846B3306EC363D6C64F208B4B3E58FF9EFA8C20E712AF5794BDE5246173773555B0AD521D9BA2B11B5107C069D26ECF3E70FE0A5D8 +221: F6B508AEFC60906F372B0431DFB031921E3E375073173EACC520E5713CD321FE07160B3EACDD08BF0730CEEC700EEF0F0FCFAE2A75994015E4C88B9D68C34867 +222: 8FE24769308A276C5C4CC58FA0D685EC094D500E40D6A5EBE5F937A0957F78A08E252DD5D45419EFDBA4E8CCFDA17D2BC6A9F26001E28599AB38A93BD7872D22 +223: C4E02FE649BEBFE96E502375F750BA7A1CDB6E006CBD2656A79BD170E4AF4E36B7B0AD80D143AB19B779E9A244774007FCB6AA8C06A24AF16C9D570F9FF918A0 +224: 45F51AF830CA71C313056B03B393EF641AF65CA504C0DA4F6E427FC1786CF78E9ECC782E21CD3B4B3BD28D4E0A753A66D7A9264467030BA9980B7DD540B799F2 +225: AE255B5B24BC9B489F1023D39321B0BF9D84C1F441EDA7CB77CA0D53FDDD80D6F80D6120AF297FDD9175E6B338774815F7CF997BF994F1E87D4A79245080232C +226: 3ECF82334C27C67B668B97AC47520F93C481F4499A308862FD0D8191463C020E4E17BC7A67262D60C35468B03287A38511C54CBC9AF6B502A6EA7D29E3068A0B +227: DE7FF24EE533C3F936C919A909DDB9748F3ABE91FBE97F1968EBB703CBC7A016F606DDDCCEABAB8FDC0534016F5293452D49F21E1873EF5B8D0A639AC953DEA8 +228: E6F6DBB1DCA85478722B125454B7A93D61E3E5FF1ABA4093FBD051950B2F51E6F7A914F50504441350A636480AE8D78469C9B4F3F03DD205B7EB6327A35A1A9B +229: 0816F780830F24BDC1BDCE3E1437F26B92C945D7A5B5155E056901931D750C98FFE263075B35AAEB2EA570CCBC457C706853BCF8D5C8955AE6860CDCBF3D6604 +230: 82DABF1BE59AD176355DFF33E8BA2943A4D68FA4E8A9DCD9FD49AC11E9A10134F8D253729CF3D8D744A0C8780313B45D937BBBD8C5D71DD8BB3906EE1C2BFC62 +231: CFCC30863449DB6F79F2B72F14862AD9642CE246925DA581ED102BDE19ACE44BB037BCE6B64806C75028B3F6C0703AA8483B11B413BA24EE58837A0E5911AD8D +232: BB7D666E3CA3B2DE9BBAF96BB8AB462C3EF948284086FAE23C3EED6EFD1B8A94DB002221BB869642B6394199A9219AA993D193E7FFEDC2AEA46B70264F52BD33 +233: 5E8F1A1E011B0ECD7C3828F63EBF166B883BBFB4CBA4251CE5E8A50BFD83128A412E1DF68319BC57B6836ACDC0E87E6C9704E393650D2496C42CF01301E72528 +234: 014D86AE49429F6983350EC1D460DDE2ADDDD2A8A8CA9144205C7264A0C899A05DAA33A2960700CB85E13AADA0A2D04E6A04B7AA9A7BB8EC2E44728579781A16 +235: DB2C4EC897D0A8E5700FAC5BB4681DCB608E14DAB0DE8DCD62A390BE8C48D87B83F23CC2B2FC2F60763CD8951733623FA8D9C9074FD6B535E324CF489E993FC3 +236: F8A6627C3DE6B36D81F955FAC80648A83F05BEB9D00471BAE703D626D432D86064FEC8A926701202F4A86C33A6ECC7C5F283A956E5B7DABA71FB5E9DAB22FA00 +237: 5E93BB2C80B0612F6C5C5416272142CB0BFCD27766D8A9DFBB78CDD9131A752BA4BD1193EED1EDFF1344DB272B0CADAD051C2D641F0569B05BD9FBC22C48B06B +238: 3B53B57A749E41D62E5CE9FAACDD5F69A21F279D413C1EAAEF2A083B85BDCDE563D0442695DF09D40EE5CABE8B7C830FD01A2BEFFFAD4A7BF76B94E6B910B6BD +239: 1D8749F262A4B1FC9EEEB4F7F495BD8A7DAD04B96FD090C8841526AA8CEB2B7FDAAD4F179A9D3BBADDADAC7EFB54175AFCCA04B1FB4EA3DD740FBE0099ECA53E +240: 14D325D202F3EADCC84DBBAC419E5080E13A58FEAC139F664558EF9372145F18C2171605516DFE95446A2534F329C1665846909E3B94DB88BBD19AC364BB520D +241: B86D647CD938D94AC573F15D5B08FEB37FF87BF12E5BE2DDD2B817D1FAD8D4128D075FBE0FB6A51E308F414ABBD793BB6BBFB8242DDF8EBA7EA029CCEAD7FBF3 +242: 9B7016D41D186E2402F63A6B2FD42F60771FE635DB5F6158A2256A757C8F99780B73D8216DBDED6D1F3957505C7786A5885BE37C601AA8E5E9BA36885FE88B90 +243: 5A2CBBC693244B2BB4762765BFBDA28CBE960AA3B53FC1878CF06E490E452FB1674EF1E12E2C3C97B5103A7073C48D0AA3895085E6A0D74E47CA89BFB03EC9AA +244: 87C2A89F195633DF49AC8834D9B0013A3F83120C68F77A21D5AA37916762A6736D4CC4038B9C9FD3E99189236A684D2E574248499184BAF0A016607BCE7D01BF +245: A45B32D86A108F8DFACE9FDA5CE5EDCAC8A64AE5CB21D9F5E5648DD45385A8429E733D160B67BB3625D5B115AACDF2A56BA5584B12A2896A47C48D8181309C0B +246: 38425A1BACAEDEBB152D8F8D6C85DF75FFA0CCBCFCCABD8C1FE0985E25FD87C73DB913635B412BCBD4C5765A4C1E6F128F3471F31A382A62C14B8CE7B666004C +247: 02EA28A9BC3BE646B63272D9012FACC7C4A8CD4C97EDC3D9AF7BC06729860E3B97B1C9AC343C440C53CB0F2DA2B0413F058F7D6B77EA967C0113F6D2D91C4D34 +248: 5DDA7766393EBED0EBD886A3E0CEDC649C6462BF0D3FC3D80F4FC5F0E2DA8E501368A74008D3AF8A18764B3A610BFA73F8911F633E7DA9D6E389C11E8FCB273C +249: 4AE1B047CEE7896CED4280CC1C8A158C44A8261D17AF3025B27E4264ED412926E9639907851CB7380CDA60478049A153E2E8DE7EB8248944574B4C8CF5863BD0 +250: 3314E24E918A04DECD180AF7EEE35CBA18461CB618C183892B63284CEB569432F047CA4397EC3B31C435ED35A61276D0981A74A49FD7DBD7BB5D70016282EB21 +251: 848F85FBFBA1BF084CB7854B93600EFE343913ECE967B57D3FC46E02787F108A5D7966B0F16B3CF698523C3F6B38586E37AB92DF15987C5FAEFA759BD9B64288 +252: 94730C832C9B4B88BA9565C58DC451D1C93861342310ADCBCA66CF4C0AF2BB7D5A28EC6DD51399728190D6BF10EDA505D0A8EF7A3DA726106DAEB9377773094F +253: EFE6917B94F6C55127A1974D39148EF6F9B331F081659999E0EEFC15EBC198EC9568C328393216A7E5F30342A20DB76504D1A90FF0121840A7FD8C96C20E306C +254: 483F3DA2F6BF5794BC5A3BF856004E35D311EF70F392EE59BA5857A2FA1A777281CA22119668CB2F49F0253B6F661E5F099B15EE6704DD4BB44B9535B9D4612B +255: 2B72B3BAAA241F977917BDF8BB019DEBE7444559A1CD329274377154B00E0BEB78CCD9B13F8733388EA7B23245BF3233414754CF0AFB1932E0879DF415133A4A +256: C21D6454682743DAA662B443FF48FD57A493950E7D2F8CAD749E5FB398DAC7AB7D0D9EFC3E6ADC3B66DC45D59A95551AA0A928C676D0FF2E09FAB8C77954FD1E + HMAC-chc_hash 0: 0607F24D43AA98A86FCC45B53DA04F9D 1: BE4FB5E0BC4BD8132DB14BCBD7E4CD10 From 56a2efa729e0cd118a1c4dab492fd2d03d50d7e3 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 20 Apr 2017 11:22:16 -0400 Subject: [PATCH 0621/1192] fix blake2s-160/224 hash sizes. --- notes/hmac_tv.txt | 516 +++++++++++++++++++++---------------------- src/hashes/blake2s.c | 4 +- 2 files changed, 260 insertions(+), 260 deletions(-) diff --git a/notes/hmac_tv.txt b/notes/hmac_tv.txt index 98dba80ff..c2f1ca9c2 100644 --- a/notes/hmac_tv.txt +++ b/notes/hmac_tv.txt @@ -2902,266 +2902,266 @@ HMAC-blake2s-128 128: 1F73E062BD976C36CEACD5BD777B4E62 HMAC-blake2s-160 - 0: 0C1D8F8D105A510111E008828B34BD016661704A48494A4B4445464740414243 - 1: DBFD42F41D6A3E3783ECA2BF20C4D5D286433CA61415161718191A1B1C1D1E1F - 2: F54EFB9EB58087B6B4526E00D9949FA574FE3DDE48494A4B4445464740414243 - 3: F0D4EB4871B5E9EE5FF24D72B6982DA8D6A2B68D1415161718191A1B1C1D1E1F - 4: F8DB3D275770130B1F44FE9BDBF06AEDE693A08A48494A4B4445464740414243 - 5: 38F2E65040EA3476A7DB683F8B960661AA18F05A1415161718191A1B1C1D1E1F - 6: 0FFE7511A80AD0A1BB346D43BE1EA86E9548B84F48494A4B4445464740414243 - 7: 1B26403BE806D619AAE870F0B56BF87964D079FC1415161718191A1B1C1D1E1F - 8: 19259559C513D23402796C81848F3ED52295CFD848494A4B4445464740414243 - 9: F6E3427455E58F6A334DD60F802E3422E73D91251415161718191A1B1C1D1E1F - 10: 50CE99A8AF7028ADF273E29DAF82F7443D5C3B6848494A4B4445464740414243 - 11: 624EEC36899BAA5C469F72625BEC5B5504E2CD921415161718191A1B1C1D1E1F - 12: E4C8CF7B3669767F2DD67DC9B5CBCCF69D9EE91748494A4B4445464740414243 - 13: 09787A5F60342A86C46B1C80D689716CFC66E2FC1415161718191A1B1C1D1E1F - 14: E0D995E7CB1DD1B50D4A4C5150AE70C99C8EE31F48494A4B4445464740414243 - 15: 5E33894B2C18DA37D36A73FADD23B11C5088253B1415161718191A1B1C1D1E1F - 16: 224BAF87E1C94BEFAA83142569032CD95285C69048494A4B4445464740414243 - 17: 89A7D28CB3E11E0DB50422110BCB37DE3B97F4F41415161718191A1B1C1D1E1F - 18: 674FB37F47FE84940A6A6C1EF3F88B87D77BD22048494A4B4445464740414243 - 19: 3BD010BFB29B0982CE5680F3B6BAB934A519CDA81415161718191A1B1C1D1E1F - 20: 674F3135A1E80CA9A03FDFBE5F499E54516FCCD048494A4B4445464740414243 - 21: D6C3B4794557570429D3B4FD403D26CA38B7F4FC1415161718191A1B1C1D1E1F - 22: DD1F49EE8397D060186DB7FAB58597CEC39D1A0048494A4B4445464740414243 - 23: 42BEBB4637FC45998EC8C3A7BA444BA1C2A49B1E1415161718191A1B1C1D1E1F - 24: 938B3A192BF9350BD3620BF236E0E4223658F8E648494A4B4445464740414243 - 25: 1E614B2B1561BEDE4F744B36B9C8B410F116AC481415161718191A1B1C1D1E1F - 26: FA45BDAC77BD4077AD8746D6A2B88429A924786048494A4B4445464740414243 - 27: 1287CD0466009D1A9B4968901588E590D75776EE1415161718191A1B1C1D1E1F - 28: 0A480F52E809DCDA19A20F8241AB6C67AECF035548494A4B4445464740414243 - 29: 2558ABE04AF7B982070BCA05774EF8861E0288851415161718191A1B1C1D1E1F - 30: 90F1E7ED1AED355EB08E1C95EEA6D7678048B44548494A4B4445464740414243 - 31: 564739AC2D8C6723993A4325BAF22F66265C6A991415161718191A1B1C1D1E1F - 32: 49624233C6C7D43DB1EE4099F490A4BE9947DBB248494A4B4445464740414243 - 33: 695EFF44807D62AD21DA1A0D4F9F3E94D7FE91191415161718191A1B1C1D1E1F - 34: B9FC7584FF5B476E5C34B35C1B91048CE4E206C748494A4B4445464740414243 - 35: DE87288D9C2F49835BE0D672E83E125FCAA3A3E81415161718191A1B1C1D1E1F - 36: 2BA1CE8F339A79680922F6FB72D9CCF0E42A483C48494A4B4445464740414243 - 37: E44602E1A2E2BAE5F06C72E8A21818F19E6974F11415161718191A1B1C1D1E1F - 38: 268DBD8634A85AFBF61D1B9540D8F8A640A5661048494A4B4445464740414243 - 39: 93779E480C7AADE13EC72124592B66944F3CD8BB1415161718191A1B1C1D1E1F - 40: E9B431A2D220942FCFED752B573DEBF95996554048494A4B4445464740414243 - 41: 1E4285A190B25CBA7DA4DE4C4ECA93811F7178B01415161718191A1B1C1D1E1F - 42: 0B1AECC0E11BD2AB0090F346EFC695D3EE6EAB9948494A4B4445464740414243 - 43: D829C7145EE78C7F2503E818F6DD6FBE02BF55611415161718191A1B1C1D1E1F - 44: B9FEE2A25F2E3D24C92DF9166392BD238F3CA79648494A4B4445464740414243 - 45: 7D4A159E53DD93F676B27F0362F7BFAC2969FD8B1415161718191A1B1C1D1E1F - 46: 903FF190485D39B2086483028C3A08D5A8B6A3A048494A4B4445464740414243 - 47: 7BB63A056A947677102B2D2E392EBD9C2C6287421415161718191A1B1C1D1E1F - 48: C507D08028CD0E3C3008E1EAF7267E3CD7D2150E48494A4B4445464740414243 - 49: 9EBAE019AE16190634F165932C88726382C5C61B1415161718191A1B1C1D1E1F - 50: 48C506A1BE474A3F1E8C74D24A935E1C44204B3A48494A4B4445464740414243 - 51: 11E0B9EA2FB5C58EB9D72DBF30BF879C8305344A1415161718191A1B1C1D1E1F - 52: B6618642195803138A2752C50629C5DB2805284748494A4B4445464740414243 - 53: 3F9E7B5A76DA0515E3E8613AA5C38F572D1EACDA1415161718191A1B1C1D1E1F - 54: 94016156C7E24905091C16EA343BFD1867E36EFD48494A4B4445464740414243 - 55: 3F0D335C903EC4C9779CD3931CC180220CEE7B6C1415161718191A1B1C1D1E1F - 56: 3CFE46D363DD7E4C32F24F92598E7BB2EF2C0AA148494A4B4445464740414243 - 57: CE48A5F4A173D418FB36FBFB0111E0B5E786F6C81415161718191A1B1C1D1E1F - 58: 3C578B6FDC46BD7BD9ADA5122B1C31C7D5D7690D48494A4B4445464740414243 - 59: 075EF478AAD27156E32E47B6D7EC462994906ADD1415161718191A1B1C1D1E1F - 60: 2DAE66FB4130143C21BE41CB7CBBC1AA2ADFAB8C48494A4B4445464740414243 - 61: 412C76A94179946C815648D46C6BD55FC6AA18AB1415161718191A1B1C1D1E1F - 62: 0E5284F30A43CD432CF024A91399E23BAFA84B5A48494A4B4445464740414243 - 63: 9AB2339A7968267C4B48380586F6F90C386BDDA01415161718191A1B1C1D1E1F - 64: 85D96931EFB8098D8D8874F1B6F064CC7E08AB5A48494A4B4445464740414243 - 65: 90C0071CC1120F5E906A99D4F0386D7AC28BD1621415161718191A1B1C1D1E1F - 66: 9541B01E774DFBE0121D01818E298CBEBE9D682E48494A4B4445464740414243 - 67: 54FDC0AA918214C64CD6C236EB3D151ECF4C04131415161718191A1B1C1D1E1F - 68: 03C22369CB47EE62A0D91CE44C7342BDD710314948494A4B4445464740414243 - 69: 63E329E528375F9338532AD2042878259C37161C1415161718191A1B1C1D1E1F - 70: 83AC0387E47F9B7990342940ACEB7D3BA8DA0F0A48494A4B4445464740414243 - 71: 6DAC37F69C8D41544EFA19C34B3919C46EFB67E61415161718191A1B1C1D1E1F - 72: 3BE0B7F89E666B410DBDD40F94EE614B80194BB548494A4B4445464740414243 - 73: 7A31FA40393C921F17788BD7F16AEBAABB570C8D1415161718191A1B1C1D1E1F - 74: B30B66A456852C539615CB39B15F081799E61CC748494A4B4445464740414243 - 75: A9D58A6E8AE1BC00482C20D596ED0AAFCF125FA91415161718191A1B1C1D1E1F - 76: ECB589136A28E4599C6FDDF1BF968B6850D9BF2E48494A4B4445464740414243 - 77: 0F3D8EDEA304A72E43AF0EA865840D99B1F6159D1415161718191A1B1C1D1E1F - 78: 7C8788A9724F446F96F28046ED48465DECC4DE0248494A4B4445464740414243 - 79: D132809E7509BB2FFEADE12018D6DD3F6093D16C1415161718191A1B1C1D1E1F - 80: 06867B353EAE39150F257A4D86E2E909DA065D2048494A4B4445464740414243 - 81: 2CB0FFE9AFF1D14954759AC5E392B15752A77F991415161718191A1B1C1D1E1F - 82: 947C9803507CD432CD824C2766378488F89FBE2C48494A4B4445464740414243 - 83: FFE8F94654B8DB0C5DF8B579643C79AB9A322C5E1415161718191A1B1C1D1E1F - 84: 18C088B7E653CFAAA902E7BDF58332ACE02EA4A948494A4B4445464740414243 - 85: CACC1BD6750A244C770750AFF4041E9FFE17E6DD1415161718191A1B1C1D1E1F - 86: 3650661A8AE0813531071B6CC7AA6C46A47CCE2548494A4B4445464740414243 - 87: 214D46C9293F8DCB10B3C7A74E962053C764CDE01415161718191A1B1C1D1E1F - 88: C83024814C58E2167839623E06E7BA292A58655E48494A4B4445464740414243 - 89: E0011C43D57D41C524C480943C378BEB7918FECE1415161718191A1B1C1D1E1F - 90: B0EDE853F99D5251281E188D6EBA06789458627748494A4B4445464740414243 - 91: 80ED10DD7633BEBD77DB0E96F38AF0924C27FB111415161718191A1B1C1D1E1F - 92: 729A6EC167D781012C4790DAE24566D5DAA45EEF48494A4B4445464740414243 - 93: 187E7B6504CFB87FFC419790475A82755B19BB041415161718191A1B1C1D1E1F - 94: A0F5E63791F14FED0AEF03726BCBCDF90895F91E48494A4B4445464740414243 - 95: F767FDD3886BA7375BBB07F6F13DB2BEAA9638271415161718191A1B1C1D1E1F - 96: 5C1DD3E68635CDB47F87919AEB638D5F78B1668148494A4B4445464740414243 - 97: 2132F16CB0B075273145878F83F0E2D4A7CF354A1415161718191A1B1C1D1E1F - 98: 28DD1BA35A3FA8D1F817BFCBA6182648D321CCE248494A4B4445464740414243 - 99: 87C4DD4A14CC4AF8815EC20DBC309B7662D605EA1415161718191A1B1C1D1E1F -100: E7FC7FEBF84F1FE261382721E0E682997A26E6C048494A4B4445464740414243 -101: 9524B63674BD28BD870E74D5AA4AC5C46C6BD2011415161718191A1B1C1D1E1F -102: C1FE988C3C0AF78E3B97DC35637E0B92A3E4552748494A4B4445464740414243 -103: F3F0230E7C97C74822D6E8D295EE0088812301161415161718191A1B1C1D1E1F -104: 49B3DF1D76A4FCF2CF69EECB58FD507A365826B148494A4B4445464740414243 -105: CC0424358B56F2BCA315AB3B742E0BACA7874D511415161718191A1B1C1D1E1F -106: C9384CCFE0AF23C5F193D969A41DECB2426D422148494A4B4445464740414243 -107: 53B85E61A00AE334132DF87E8FB87EAF117767FD1415161718191A1B1C1D1E1F -108: 48392D9096746A7E3C3E154B96889D0BB0E70E0D48494A4B4445464740414243 -109: E10EE351AB62E80EF84C68AF536033A828E4D59D1415161718191A1B1C1D1E1F -110: F489EF81EC417A68CE3D6B4AF05708A0C3A6920748494A4B4445464740414243 -111: 2D5EF8DFBB70E676276F9CB613EF045BF99B49161415161718191A1B1C1D1E1F -112: FE102E8CCE28E3D320EE82B84B434DFE5C66078248494A4B4445464740414243 -113: 58CE2B43F1FD6DE8E39014A012D64C26DE2B0BEA1415161718191A1B1C1D1E1F -114: 862CA44C01F8D4A72E544F90E3AF8F48A271849648494A4B4445464740414243 -115: BE2CB30148E0026DBA3F428C1E3AE9ECA85C5D221415161718191A1B1C1D1E1F -116: 23BBCF9CCAF7D6EEE73869B0659605529A1F08B448494A4B4445464740414243 -117: 50CE3283943C76440288376CBECE9AE3167522031415161718191A1B1C1D1E1F -118: 363D9526C92EFCD925AEAE8BBE9607D60AD2B4F948494A4B4445464740414243 -119: D04E479493C29190649EF6F665143587682E12381415161718191A1B1C1D1E1F -120: 7AD2477D39F525889C6788A050B9BCFF21658E7A48494A4B4445464740414243 -121: 051D76FDDF57C6932F82C5B128806C8683BA03F71415161718191A1B1C1D1E1F -122: 687EB51A74B52D13B1C4E324B735BEFEBE51CE6248494A4B4445464740414243 -123: 3E8EC4207FD47A5268AA9D0548FC0C6C772D0F4E1415161718191A1B1C1D1E1F -124: FC2501A108A8A2EF6F9AD89152386A4C25D1D0D048494A4B4445464740414243 -125: BCFECF9F5B7AE54FCF2CD4E8CDF18258A772A3091415161718191A1B1C1D1E1F -126: 569E914D0DAE44C610BD1F69732B193FF59A4FCB48494A4B4445464740414243 -127: 163436BC625953260D96388A64CA2BB1E331D7E91415161718191A1B1C1D1E1F -128: 7F264426C7ADC6643D3091567549353780D0717648494A4B4445464740414243 + 0: 13F3871F0D9CB982359D9C6E977871688BC2B15E + 1: 45BD7321877A211224FFDF26FE226E4C6B4F04E1 + 2: 2D9D50A09858649136D611F612EC1554FE52EC75 + 3: 431A1116DD8B4E788E13B1D2D5431ED054537FFA + 4: 472C89AF44BB957CB4B6C66AFA43BDD35B7DA029 + 5: 5C5E9B4C1506CA3394023D745F187B1857C8B96E + 6: 0FD11DE5FD818743D86F3B2663A3DAC2204FAF82 + 7: 4313DA2BE7D104331786FDEF496ED257BA0C18D8 + 8: 1B759614B1C5018FD6515797503E73CCC0AFDBF6 + 9: D8A3FC6BCD0D2D92CBB60A8493EAE480EBB54D75 + 10: 17884E85D98766DA6F70A3274B5D3F91AF424716 + 11: B38DDB510E744D029715B14FBC50F90BBCF9163C + 12: 15CDF174E9278E8FBDB1281FE25A653E6E8DF9FB + 13: DE5D5E0589683457EC47D4D8EC0A7C70F255C53C + 14: 220432AAFC2A9CE96E79E248D2134C8F7ABA268A + 15: 7CDC604CC967D9A7D3146C2ECFC3038710A614C6 + 16: BA34F85698412D54A544285C4E1487BFEC35644B + 17: 6DBCE7E42E0B721A33C46CE1E5ED20A9CCB8496C + 18: F8BE2E683773F2DFDFB6B0DCDCD00A304854A13E + 19: 6DF711C49955C45E89FFD62FF0007854936B602F + 20: 03E8EED5288F7EBF15E016C2190EBE8893544798 + 21: 0299CA8ED87A763F94819898AD719366DBE71477 + 22: 3154F3E94D5DA8E8503DAFE32F117D0D202F9917 + 23: A184481D1081DF8B79F3474BCFD45D47300FC06B + 24: 610BDF5276E71C5D6B50DF19236E33D93BBD2D1C + 25: 8B541603B954683BD30421969E04FAD9F70F8334 + 26: 225FF6D4C37F8F8B2D006D764972B11D850DE20B + 27: 2A0341A49812AEBC18E22E8BC67053E90C0BFC92 + 28: 3E1A346BCFDEEB2B406D8952B43B19E42D693F5B + 29: 69A55CBF75DD84C628327A44B029E920BF73F5E4 + 30: 0E802994CA8E45C9FDC89EE21F78B89C3E6D2123 + 31: 6AA819DE26733AA35EC8C0F697ED8870A47C777B + 32: 2FCF9BDD9E9C46F3B4C34A315C22C7E4189CFE0F + 33: 353DDAFBD05691C0BCBF99260ED8604FE84DC6D7 + 34: 44DF49D9B9727BDBD4573FE184D8A5216B359D21 + 35: FCF21A74F868919F8AA7B0C72F17D5C159071C56 + 36: 12479686B6F46C277C6705070BD1D32F8DAB67BC + 37: AD8B56B9547CC7AE42770D37A349306FF8594D2A + 38: 8D3107FC59D43C818DEFFFBCA70AB1E17565BC30 + 39: 2458744B470CB3BB73EB0A966288462A87A75BD2 + 40: 6D94FFC6446FC1D2862A1AC089B010AB16AA9884 + 41: 198D66A09D7B4794FCE770CC622EE104FE237B3D + 42: B26EB75B76AAB6BD3C95ACE957EA77BB18A64DD9 + 43: 0E0761261FBA216C90F23425BB0297D577E1FEF8 + 44: 7CDF4EA63F6995EE7767BC4A643BEB80B21F3F81 + 45: F6C45B24451512BAD9B3A950A068BEA2F4085D09 + 46: 5793A84D61C180D4C4A8BB1505786EA7547379DF + 47: 10FD9FD1B2A2FA69B0BC48D22E80061BEB939392 + 48: A5EED67A0FB6645CD4F9E60E47EC4F32006FF294 + 49: BDB6F95279A63916B1D2F265544AA46E2582E87C + 50: F9ED46687EA2A5F314378835950865204AB97B83 + 51: 8309367D55BBDF584688B296AC823175B2DE00D3 + 52: D624E2F09BF9E49548BDCA56B6CD5AA36B4FD82D + 53: CAF70D309CDC3849BED6D2E1D0BE85D6F075CF9F + 54: C444C9241B3EC18464C9C120995B557FCE322CA3 + 55: 181A25606A0FEE681E5F8173F0BC11449CE2DD00 + 56: 55B5D5F5565D1CB029FB5E2071A523E106523D7E + 57: E67FFF4F7976FCC844AA52CFA8802F6DCFC8818C + 58: CB4E986F509B3BC5D771F0AE6CB2ABD3B9073FB1 + 59: 1D3419C2DF81BC6EF958E03786BE4C08A8945C09 + 60: CA787B50AE2CF4F7E1386D718B0F79E10C1455CE + 61: 5E1639DBF4EE1453D92C62339891AE53D54BFE70 + 62: A6BE68706BAEB0496C1D8F5455064DF3832EF7EC + 63: CF31170D3A3E21013FD2ECEBA82B95B8D6C68BF3 + 64: 32C0B83FD0ECC9F9DA771E03D18C36804943862D + 65: 2C5F427C54D2112430ABA277BB204FA74BF410A5 + 66: 32122F82FEA075A354DFD69A692053F4DCC53A3E + 67: 9F2D35F1A4CF26A9FD54EDF6E623DF9A2B01A276 + 68: 9D0DCCA8B4E85C6FCC5F70BFBB3F900B6A5145E8 + 69: B2F33A492AB22CFB7BA8B2A903569C432C1C3211 + 70: 96417071EE4AF48C70C8F8BFF466F573B0152A83 + 71: 24E31AD9DEBDE1F615A625C029F74A65B441B8F0 + 72: 66B01AC99DE64EF441048FF3F8FE6798EFC09420 + 73: 890E31D986B987495D535C186FC8AF5D9BAE5356 + 74: 1989FA5828C28150294C057F51DDF6C20985F6DF + 75: 95E1227E21BC69CE3EE9BBBD0CDD4C0BC5DCF853 + 76: 9050C21DCCFAB8E6107C2710A43E19B0243F14A6 + 77: 42ED194DFA1F029169FEDB5F6A39D297881F308D + 78: BDD8E2C229A618BACBB7EB00AB0B864382F9D013 + 79: 8D28748367A93D8B70F3CDF43605095114D0A6D1 + 80: 47404E643AC3A58615017B93A415FC888BC386E1 + 81: F547D5C21279FD77C477445A8C3BBF9111B124C4 + 82: 38E5AC1244F786D9A0537C0CA15C5D24F1162DA4 + 83: 27CB8F3CB3203D5494D97ACE99C3F9BEF1DB1461 + 84: 74E3ED28A84FA9832CC21E1C91C5D55F4FEB4763 + 85: 4CC6263C2374DD2A169A52A087C9465F32C93F42 + 86: EA7CFCC877A793D7298A0A37BBCC7EBD16830D48 + 87: D9283B0A1125042728347496AECF3AC57D5457F5 + 88: 00CFEB2968E55D43F9929D7BEF8F4B376351481A + 89: 8BF5DF0E161B65E7C820D6895245CF9777A0874E + 90: 617E10AEC765B114D315005EA0701A9EFFAC1D4E + 91: D2D3857C808897D2571C0DF9B49F533EE01A1F7A + 92: D98B3217C162160ADFAAD4C804EEA894C6C07A71 + 93: E01D6CF694DA97F9900738001949A5CA7009F74C + 94: 1926C8288F6EA0D5BA42E9D1BA35AED6EE53C1EA + 95: 66FD124F7BE58F3F423795EEC14BA840E4ADA226 + 96: DDD3BB5C542D29983AEFC9EB50EEA092E7F81D82 + 97: CDA58BBB569BC8D0DCC78DA3A94C23AED30925C1 + 98: FFE43B5314FAF5049A9316271F25CD4D559341F5 + 99: D752D4BA2CC1E5509D1A778D5C8B695A24F15242 +100: 3BD42DBB774E91983B59892CF9F1D8DB9CA49017 +101: 63040AFF4F6258E5B37A567DE56E0E900F9C1BA4 +102: E4E6A8CFB1FFBA2CC875C316FF31427108A22E53 +103: 6254A2D74CD029F6E0E5AA5420D979F979A0CBF0 +104: 326287DC568844E00CAF2E2443CA01C5A466B725 +105: 67D4982DE0B34D9E507E9BC3A89DEEFDDC06B676 +106: 5FD61FBB0AFF30DBD6DF1CAD3913DDDA7D040AED +107: 795CAFB0CCD44A0BAB188226CFCC9EF6FEC2BE4D +108: BE677F528276571CA00E82ED116ADD504BEB3CE0 +109: CBF1FBC02ED8FECA99D0D86F245F23B3F5A3AB45 +110: 2C5E356A47417DBECA2BEF23B17B05918711989C +111: 0D2D96A78A64740C4CFFEC632A018A270FCA88B2 +112: 77261CFDEA5AF0451F08C5096385FD425312B294 +113: 0C9D743B956F5711B156DE7936BC39460BE60F24 +114: 45B1444EF8899FF57C57874F0886E2D065144DE6 +115: 2E807E3D0F571F4A0D16E44DCBB3F916B78104E2 +116: EC9E3D0929AE03F116D3B328F1987E60A2A33487 +117: 924BF678E1586A719153E534821F91D301D4DCC0 +118: 5408020E4D0269543144B383C66EAF9AE542FB03 +119: 2C54AF352A4CDABD85E1317D2715D2DF1620D51F +120: 6DF7964DD06CC04AC27B92ED0C0359BBAAEDC203 +121: DF3D341855D2A06FF878A77F65D021FE425E3382 +122: A5022518C6145D5F749C09D869C46999302F6DBD +123: 0D94E7B2C49CE48C0E7DD92F3BCD98885D70E386 +124: 7E2CBB2929F1863B67C4EFCD92BD7772DF674812 +125: EA87DB318C7B965C6B5AF8D554A9138EBB06BE24 +126: 668530500F952A0FC14D6B01E174ECA3D1E02C23 +127: 83ACDD54FA0CEE4F748DF552F8B23D0ADE1C5A82 +128: BC6F09510B16CBD54F5BBE43368244806E1DBC7C HMAC-blake2s-224 - 0: 1F317EB26F313D0A41D03544402DFF7874B96E312043732E515ED17D40414243 - 1: E3FD8515BB1010BF31D0489519EC3BA98E7937542D9192302C65751E1C1D1E1F - 2: DB02B57D4BB32A4D0A7A7D91D7BD02E9A8D16A3BB60E8C2C0B3DD28240414243 - 3: EA6E072F4AC41C20F323F1ABACA32B2B84AD1B5C12CF1AFA86326A9C1C1D1E1F - 4: FF7EE41A1DBB32D659DC32153CFD93EA00BBA8EF0E8651CB40FF25C740414243 - 5: 9EF374E1BB7A76F835EE96856AB557ACA35DD208BA1742A0433E09BC1C1D1E1F - 6: 7E7F06AE6F044BDDF0A4AF62AB7CB269D227AC861EE547C8EE7145C140414243 - 7: 16E1813525D3B988FE37D860CAEB082F7DED30CDAF99DF6D9DE8723E1C1D1E1F - 8: 3948D4750CDA6BDED056940009CD50C6F51ED2E3F3355C2F607FFC0940414243 - 9: B77A6E5D589CE028EFD31B30561B9A841A0DD25AC21F5CE0F3153D731C1D1E1F - 10: D17ADBF5BE7F02CC3567E8EE114AB798A9A8535E073CC8841A9184DD40414243 - 11: 7EB0EAE4AE08CD79C229BAB1C32A84F81A72C6D2AF498571E7B4C5471C1D1E1F - 12: C0C71F4FB5492AB067CC604025F9ED0EDF92842424921A92F2A739C240414243 - 13: AC76293D72B2ED01ABB36DA63AED2B4403F770435498EC252FCF71AD1C1D1E1F - 14: F4FC1BD2FBB667890B62EA5AA0C85826A5F356B1A1D600C58F15CB9E40414243 - 15: 78610278A9153858CB12C5771FBB13F47DFB766A75F16A429F7CC6011C1D1E1F - 16: 1859B656D16C380B78CA047DB91FF61BE7F84CF54BECCD967DD6568040414243 - 17: AEA23CEC5AA57560068E5E804D7205696077F666D11F7EEEDCCADC1D1C1D1E1F - 18: EDCAD57646060A581846A6E11187DF2F72A477C5DB2685D5F14ABFA940414243 - 19: CF305F85972E3657FBF78BE898F8E1364C0E87385B9CD5D2E0DC58A61C1D1E1F - 20: E63B5BEB244F360DD9739EC2069D22669BCC3C0F2F3EAA70C8D616F940414243 - 21: 940437A20BB098592AA1044F007B8D1A4C796CBC9D40639967A68C961C1D1E1F - 22: EC7DDC2F230854126A9CC8A80AF8915223D17E87709BDCEE807A564740414243 - 23: B46B8B565CD6B8CE33F3EFC476B7AB14196E3E74A49F14E91A67AAAA1C1D1E1F - 24: 5D4BA049FA9B11A7480CD314EE319E8F68066AAA5810A366A82CED9740414243 - 25: 10FAFEE1E4FC1900583DFEC56D5D3DBCD5DDA5CFB47934101398E1111C1D1E1F - 26: FBB39490484CCCEC0B7BE3F9F4701B46AD9CE49D5A5ED616BA9136D140414243 - 27: FA577BA5223CEB7F434B59BBADFF968F1BA8E0857FAEC77E4050DBD71C1D1E1F - 28: FFFACB88E1F567645635411F54F92A5C84DCB67B7F1F01E82167498640414243 - 29: EB0015DFA5D525F066C2CC92D71EB2D9E6A23B3A49837338AE4A92561C1D1E1F - 30: 5D86AF18789CFF85C8BB549CAFF6EC0414C1E24255934EA10196906E40414243 - 31: 6DD5E4F880D49F3795289FEA43CE902AF0D81425BB3EC9FAEF36730C1C1D1E1F - 32: 4757B3A0F8A08E3AB2E1BCD7F832F3AB31055AE3B279210DC46A987540414243 - 33: 5E3EF4542D1D0F8005850E00471C8DDD84B78D7059F40774F5C463931C1D1E1F - 34: 1AC3822515448DB6D641B22BC433B3685CA6308F4F0BEC76BC22E6E840414243 - 35: F712A41E7C3750A8C980B80B465C24DD5709CF44393FEF562CDC2D481C1D1E1F - 36: AFAD836FFD37522DE3D5F0FDD1FB0EBC416FE584C2A5020B6198E18740414243 - 37: 16A5BEA3D615E41BB0EA3384A9B6E87F4FAF068B1E73AA49B70F7BCB1C1D1E1F - 38: 556BA7669EB9C9F1AE2A87E3F977DBDE2225479D2C1F853C412B6F2D40414243 - 39: 374ED340EED73A41CAB7188652DA4B602D589D1EB1E514384CECE8931C1D1E1F - 40: A2C357F4D8E010D4FD49C67461B573EAD02911B999B1044C44AB517740414243 - 41: 2B913575ADD28357216C2636E7329A87BCA37F66A34CDE74A5A4E5F91C1D1E1F - 42: 1055CB0C5CBF2E98BE636834E07DB4DE9D250FD3B507FFD15585F1C240414243 - 43: ED3A19D27AFAAD9C7C0CA0E4374B40F12FD4A70209C2731C7A4997961C1D1E1F - 44: D7983941358E9C569B00D60097A349003769140253A53EDDCE0CC74940414243 - 45: 2BBEE59C607F03DB81A236B7148CD1F9CC2567A4B4C00DD9225E7A3D1C1D1E1F - 46: D127102FC0255464F73C1CD6148166F31456F19CE6FD5BD5666E634F40414243 - 47: 7112B9915F9BE5316DA325DF350BE9EBB705A10C4F3DED54A5E593C41C1D1E1F - 48: F391F097C1C47FD88A340CB8C5C32D66C940CA2D42D693396BD4F16340414243 - 49: 454AA513DB4451242AA5CD00F143802D8F954D2687A96D4CB150262F1C1D1E1F - 50: F96BBFE2230EE0459F115A4ABFB3B1124B2E751F1707074F4F0CC36340414243 - 51: BC12BCB1F7F5CCB8ED16D9816876EA511A7CD97C4027C8A1CFC8C6601C1D1E1F - 52: 1E51E76FED2156AB9F88A624AC20DA2C0E56B3EFFFC165F48985ED4540414243 - 53: 7DD5818DECBD6D4C3C6BAD4966DB5E16E6B119D9BE257D86FFA1DA471C1D1E1F - 54: D50AEF810B05F1F96EA52A72DE0B51696BBA9B74F0F99E1C6C3F03F540414243 - 55: 1BAF8B8048676DF283E3C14B758F768E983EF9571AFC893B561BF49E1C1D1E1F - 56: 3CACAEDD65319A0331F925092DC932C76008A8E82714947E569FB85640414243 - 57: 38CA224E3A04C1E21F6EAEB2CAC0915A177FA2FFA4AF253760815BE81C1D1E1F - 58: CAA87AB4F073E9EEC7E01698ED27A73DFA23837464E2C7B0FCDF3A7940414243 - 59: 91789519BFDA5CAA0AA9B7AB186381422D9E4A0167055B71FA285AA91C1D1E1F - 60: 66208DDA2EF2181732226920C2E0ACB9D256A2E0D3256573ABCC12E240414243 - 61: F8D5DFB9BC154A681C6A3CA6CD3A30976CB52A505A2834CDFE40DD491C1D1E1F - 62: 05FA3F00EB091FBE45AF783735F86F302DC0557AA08D37D9AA52AEFD40414243 - 63: 220EE3AE51A0A8E83E302EFABBE5284D5FD20A9BB2AAB021262633791C1D1E1F - 64: BB075D9FDF012666C362FB282080FFE7C10B05233EE03563DCD08A4040414243 - 65: C216DF6E2880D5BB59FA43AE8C8291EDE8A8390AC9281E3F1698CC891C1D1E1F - 66: DB5514FD0300CD3C7CBC5A91AADAC88456DBEC6048608801C7A67C2640414243 - 67: F30DF8CD00E2F1EE73933886262913CC4874D5998085C9DC7CE883D61C1D1E1F - 68: 4CD001D9DC2DDFA6172EC5B68183103ED00A7C29D0CCE8310C76617740414243 - 69: F8C711B1570E4ED566E379C3752AF2FA50FE69F0DA2A6E36808CAFFF1C1D1E1F - 70: 5535C858669A1C21C2354A987AE8FF8B7700ADED8ED287EAA085E09640414243 - 71: EA9505BCF566114302232B96BFE59DE6D5791C867916802BCC9B03561C1D1E1F - 72: 8F1B7BC30A39E12E05CB47A52E55BC588FDA822D12BD06C7F7E71D0140414243 - 73: D86873DE094D2228FB2CE2C78CB5163A913BE9F8C3C07377A15CFB551C1D1E1F - 74: 28C647AFBEBF004A13FA86385E76A7E09DEFD71C4FA882E73CFF7C3740414243 - 75: 5C598F57395550033920E0C5827A2CB0E8998BC301D2FF140957A1241C1D1E1F - 76: 6F7ECB608307096B3A798BA037514F42AD5E0A43CB05ED7D3C8467D040414243 - 77: FA3F11D2E51E9CBED4CA0B7826D903660A5FFAAEA1B3696FA7D452CF1C1D1E1F - 78: 2230DD3594013CDD2E736AEA3EE1123B361CD0568980516CE2A8C79640414243 - 79: 6187B8EDC2A8B0E9098CD85268C000E09F0D83646A838E7BCD3709D21C1D1E1F - 80: 892DD73E6F5402D499A3B4CDAC01598CAEF1B8221B12D6EAC067796640414243 - 81: 1BB653720EFAE89499F939A06000730766B178D640C2EED148B9EB6E1C1D1E1F - 82: C9812BE72D3FF8A6083D49213AA97B5D2F2634404FEB429D1CADDB6740414243 - 83: DD19B26E1A3FA215902AB3043F6C6E995BD5CD571DDB289C3A6916091C1D1E1F - 84: F5F5E7037354AE52B55C0F2884FAF3389163CF03976266DED038D89A40414243 - 85: CA0AB6D18CFD5ADA2F2E8EB9CF5707EB787731F4D9C0BEAEF29A71BB1C1D1E1F - 86: 441DCA701DF32E6FABBE512031E4E1AFA438869242F14C2DDE7A523240414243 - 87: CD29E63AD3CB4871650C6ABAE6E78CAE96976FD67E98BAC1CA9C669D1C1D1E1F - 88: 0452080192DA8BA4F768AF3342C9C97DD573FE10339CFBC055A4CF3640414243 - 89: CBB3BB76CB0CD1402EF38A27E82331A1D6E28731672506220F441EE51C1D1E1F - 90: 20627B2AFDFFB0CFA88CB8057035B479C00BFB9B3E1977565E91139E40414243 - 91: 7FB30A0D24F88B9A0FEBE6B87E70627F16C19A2079F1FAB899669AD71C1D1E1F - 92: 5CD716BC50E5039C50838DF636DE6DA98B138FF11C6B9D6218ED9C3240414243 - 93: 91A588A51D8E91EA0CD2342C97D48D5EE4B040A32BD4AA6187FAD23C1C1D1E1F - 94: B41B1C9CD29271AC6D0AADDF7AC4BB58C6DA63860046D6954965D7BC40414243 - 95: F9CD0ADC6211B8B5F79AF3600845E64BA7B1F1F4B185C7B5E63AA24B1C1D1E1F - 96: C4E460C17783277D54F26CC382F3A45FCEEA8E95C12B4593C2A5194840414243 - 97: BF8ADEAB77ABAF6AEA3F854088D34785DBA9AD6960AA5A5611C0D5611C1D1E1F - 98: 212A96C0E8B73DF377EEF0478F84D04D76C89F717A64C5CCACF65F2A40414243 - 99: DBAA846580E2A7FD7D405A14BA11E5630F8EBFA7A10FB92373F053F81C1D1E1F -100: B80CE5F8C203910FE1F584939A1D768E50E7BCC5107652D7FD31BEFD40414243 -101: 19990EFFDB751F3E869BEF080D38D8F050F419C538E408C172484E741C1D1E1F -102: 00865C1F8D5D962259EA8B3E81E9C6A0F5F7B6996FA99C36815B797C40414243 -103: 510A7F30745523A2FD5D6AA2BCC215C9F606401413EF8BB615BF5F471C1D1E1F -104: 68CAF9FA244F7AF7CE4E8EB777EE8536A2514682FCC41A88BA34930B40414243 -105: CD78E5A82F60A83201E2A1CA1791508B5CF889D020CC9FAFFAA0997C1C1D1E1F -106: 217E819234EF90F44AD07656FBD2AE9C256735C08E2399F61D96859A40414243 -107: 03805678325BA452D70B7288AF53C8FF0B3A4FDAC4E2AB1708A6D8F51C1D1E1F -108: 3E8762AF6186FC49144ED9139E1CBDB5F2C5E4A3BAA6634F0555FD0E40414243 -109: DE059AA672441A7A77353746FEE57529DBFA465B0181F74CD18F5BD61C1D1E1F -110: 8BECCCF5481FD49D75CF103968DAEFF014A422C539CF71078457ABFB40414243 -111: A96CD3AF9FC4BFEFCF060983DFB5B0106761FD82C1339382535CC46C1C1D1E1F -112: 5D2E21F79A46435257887468512C5C35F2CEB285919160E641D0C3F540414243 -113: 07A469455FD015F03E8528316FE9C55A11B325F49DC29A3F6D6A8B351C1D1E1F -114: 9CF0660C1F856B42F4EF4D1F8E685305F5C6AEDE97DF9955A2650E6C40414243 -115: 6CC16767EDA6199608FD59E0543D5990D92DF656DBE524E81D123A0E1C1D1E1F -116: 7E3DD1E42A7CB6DA5D21FDF6ACDFA98875D9CA99E592FF83841FC38E40414243 -117: ADD8FD1F498F5CDD7182FC5D76997AFBABE6891D1F55169164226D401C1D1E1F -118: 8881EC2799073AF67DCD1DDBD634E906C7802CA099620EB1001697D040414243 -119: C9FC515D1058021F42CBAA76182DEC93E752A2ACFC27D201D34D53741C1D1E1F -120: 3D2B6A8040F71B12C0A60D458901E54632C5EC85128C494B1DCE8E2B40414243 -121: 31B076531196033249483772DEB73C37DB5814C175C877BD16282E4B1C1D1E1F -122: 2A9A6E51742323B9151A744631D7C138367F523717B42366156E06C240414243 -123: 983EFE318F3B4B83F81C2C39970C45049DD40C2662EFB1B1AC87EB7E1C1D1E1F -124: E813EF4553AE091EED7887C1BCB3E5768F2604BE132E5A2F8EED2FD740414243 -125: 6133D80288AAF21EDB47696F77DEF406E81F4EE74C7AE4E1214BB6821C1D1E1F -126: 25FB628B8B6C3675CD21339479E684E75FE342523999C53465BF66BC40414243 -127: 07FBADB3BD843A0405AB5683A9D75B82CF708FA4C1335A8DC9C034BE1C1D1E1F -128: B02947A8481D0793F7CD556865E03FCCBEE6A790FA37D54AD5189F5940414243 + 0: E159B76803B9082D1EE0EA6076E364CAAB41416AE670CE4BD5DC2FD5 + 1: 20E48E9BE3B788B443CD264409A004216DAC3F993748798079A71801 + 2: D9517495324F2DDF138573659E1E90C72051D5F7D1F566D057F58B0E + 3: 2A74016D8C02B9D1A8832A28F33162379680642F976B1D4AFE21CC6A + 4: 3F97704DCE5C28B91532AD38E4E5D31C865B8DFF2593163784F32841 + 5: D89FDB81CF226C37347E934FF55F8D659DF5479E74504EAF70506C34 + 6: A033764DAEE71BDE3E1B0D8AB3CB02EB5B5F367F025B73A56CDDAFEE + 7: E33B119FD8A73153EB4F9307C77685BE4045EF648D7820A8AE5685FC + 8: 4A493F11945339BE6358C78C2D991824BD1236BA7B2F22E97DB42D09 + 9: 5868C49313029648169041FA48C3163CCB9CE1BE6F52A64982BB553C + 10: BA1935A2582D3872106A5CC405C9DACFED33B1491F99ED3CFA19ABC6 + 11: 7B63271FC7071598349967C0DB69F270A4C5432997BFA5D0E7FC0E5D + 12: C05D09455FBBCFDF863653624CCBDF0DCE8DCC778C0F8D1555493EA2 + 13: 037D0A46B07AE8B8432AB0FD1285D6D2F97C218C8FDF5E604362C351 + 14: 22C72A472AF33D2C085F6EC9C1D7298A51B58562F348ABBB3EC09002 + 15: F728FD2C29A3B6535BA745E8215342298413E182B513EF76FFFB1902 + 16: 6718028861CA19236FCD4527B23EE27E7F6F4DADCD310F054CD09E87 + 17: A7999E45B997697005521E2ED6F3FC0B99E4204077A3931BC3D65301 + 18: D73FEA06275E1C2FC5E51434CB26EB0482CDFF08707C2A845A1F800D + 19: 79ED0DED96891FF6392AACBD9AC93A7673825B34364DD4F554144EB5 + 20: 4B676CDA46340E50F289DE37DE0E7D52722FCD08262B20B825E1C04F + 21: 0703C8269084531A722F71F807BC0EA810B8E03E9A642934A0F789F8 + 22: D2F1F83BAFAA05D0CB82E5E7F09A0F048FF9718F90256E20B058E1FC + 23: 45E4DCCE998C78934ABF36B18E26F90072781AEF5B6DF4AECE64FFCC + 24: B6477AFE98E6894CC3724FCFDD1E63FF586F6E1C063086EA7C2D698D + 25: 383A90915A864B37FDC8F64EAC4707926E202910E00345C3DB842A00 + 26: 5D428CBC8BF57A747917A365D7A3B5A3D4BC338870B3D654DF53A30F + 27: 3CEDF4101DA588D887CCAA4FE82122A650DA8CD82CD1678864620E47 + 28: 7B89C1F194AF6C8454D9B25143116014330606ADE3A3FECE960339E8 + 29: A7F40B968707F814F5329BAD52245A833AE1A72AE941B84C814F982C + 30: 0EEBC427F65A41852A42A632EBA73CA53DFE8EA95371A190E75D25B1 + 31: C78B7F0EA77A00D174C7181036748EFF7361250D671FDBF77C9EA761 + 32: E80067ED5A5925884E5DC7D2B47AA38847530537761E953623A1F997 + 33: C8E7BE0F691DB2CD44189A20005A160CFA744825A54E6A528110E2D4 + 34: 9DDCE1AC38B64D911C0FCBFD4715BB77AF5225617A8CFFE9101E7B7B + 35: E984EAE61CFC72946D2F38B894C87B5AECF939387C64022EB06CFFB9 + 36: 9BDFCD633185BC5F58AAB28E200C5B3F58A9E5D3357113A61E5F0F38 + 37: 980D355164A35C4C7D863D9A81EA053DF327C83375FCF21B9B5E1108 + 38: 5F0E7CBEB83A12F0493491A444A29F0B7C74500D8E17E2000B852298 + 39: 2CF803E0BBDD31A55B1BB1C449C507A2B43F56E3950B0F72F909B666 + 40: 1531DD3C6B0320A16291EE79DD6DB42ACAEFA1D54AA1B0B5E011BE71 + 41: AEB0016B0C2A8DCCE0C74B8794C2FF578966139920700EB921A75315 + 42: 8F93BF8DBF1411D4EFD4C2489DB975D4604F1801A5AACCFD55FC26ED + 43: 085B7720050058BB86FBD6A301C3654993791AC8ADA2EA773DCF7A7E + 44: 8712014F67738E3B9D8E2417B793076BDBD418CF34C674244A84FA6D + 45: 357F78A327A2D207AF16A868A84C595B11B51D02FE604F9F32407362 + 46: 8EE37BDBD1703D8A5EF22562E0384A204B89CD81E80946DD483F276E + 47: B1DDF7E03D60D2DA4DC5BDA1607C6A112C88779DB84128B80DA34ACC + 48: D318FB0A0196A20B99B012CE1D5E5554D426178DF81087531A8CBC68 + 49: 6263D8968CB45E33D327929A29ED404C7ABBCD11D860AE9B57E44E24 + 50: 69D9C85B4F8BFD68D9823E0B0E862D09668B0F99204944A98BC2C8BF + 51: D43E655C0DACF1C8FF7A00C7C5FA26234BEF45F2BA2378757BB9FFD3 + 52: AC39886893C7433953682793127364FA8D0C65C6531C343B91915DFD + 53: 94E7B5DCC1EB3DB23776D20C894803A51E5DA837C29BBAFC2DB7F127 + 54: B98E665D9703C394E46725B3D557A59C7FFEA4098C8BEC9B9D98C0CB + 55: 414FAAF92795DCBE7B4537296FB891422952E3E1B14CE6E1A6D3C2E4 + 56: 8FE87554FEFEA050E6E49D50D13CBD18B37B1729326962BDCDBA2EE8 + 57: E9D2BB16779A81D445C97F38B64CA363DEE0858D285015E4282B5F8C + 58: 538283E0B06AE7EBAC01541BABF4AD1C8409647893C73312D5BB4133 + 59: 5727EA1EFEA020A7E9AAF26D0EA8B16FA71EA58732E16AE592E5B204 + 60: C62949534E0272DCDEAFE82001AF1D88CE8FDF8F85A6C47FC65F3B74 + 61: 8F6F09CD73B1791829413D6493749B7C83920DA0B58FD6D4043DB4D5 + 62: 4C7AF80CC670F8419C609FFFA8CF483E1245F248BC032CF63EF24DDB + 63: 66CC1E00C4E08B9E451EB5E2953C668746D5803604D7D3A7D8F33D4E + 64: D0DB0A43354F5690B543393347E5ED07CB92AD674E81A41F9D4986CF + 65: 15268F39426D908D8CBC137E635D9FA8520DB3B8C2198D81DC12248F + 66: 3F9451F5B86B5A92014579538A8C5D6FCD141D9E9D7E164816D86132 + 67: 9F5C754F844532FB8EBB7B2B42B18F8A8D42A2FC202539C8C0B07BC9 + 68: ED84024F1431C0638BF483A88E18018676F2A3026FF1B04532E0DF81 + 69: 0CBA1F3EEB60BCE64F68425914D95C596F53F98BFD0AC9922B486C79 + 70: 52E1226DE12E3CCF06A3DBFA4E4A73483425FE58D8A8FF0C219C670F + 71: F81CA60FA66A5141718FBE0655BEB8B6BAE82519462A700B8E89D313 + 72: 2363D70502A9AD10CA559E69616F36DCA94E3699681471DFD43937CB + 73: 066E85EE1FC687364B5CC8B06E1FCB1DFA081F15C832483C4E173195 + 74: 9F6A853D85ECF3798A7D7AB7CC7AA2C67DDCA2281041B58E2E19DB57 + 75: 00FB321AC5A37AB44010B11FC26008C4189D1DD628FEF47B4B91A059 + 76: 3E10854699C685F6CEADEB3FA00B811C72D9A354930487FCFBBCAD92 + 77: E9A1EA97563B106093C5E1FDF52535A0FEAFB5CC641D7F1820A7F07B + 78: EC08202707E6B2538FA9AD7A29CD473B90F3BA039E96957B5AFB5824 + 79: 34DEDB11038A874291CA6F5C5304BA957B3435DAC69641CFB7CC941C + 80: D5C33BD6B1E40891B50C6D68BFA531FA02AF781AC2E32B39C36804AB + 81: 107B1DD009BF49268C93EE41E755A4CC5F0D6C5154C806CF0FC7D2E2 + 82: 47C80D97FBF6980D189A19F2A2F5EA69BC3A83C35C625894E8A7256D + 83: 0A2278622C518159F0AEFF8EE396C7501CD7BD475FC2F5A36BFD8A30 + 84: 7783B6A5BE2F808D2B5305880F82B63E22F5A7D44D30ABF93AC5B69D + 85: 5E98037E7CA8E0734899B42FBE757BB678F5734F174DCDC89DF4C074 + 86: B50F43E0378667370FFC7B7399692FA3EDBE63B5857883D7605A6C58 + 87: 09F24F3343A161DC5CBFB97DFE6041437A96E0C6232BF6559019B4B7 + 88: 814DE5F235CB237F92DA4362FE5828A44CF5C6F6496432BD47D73C12 + 89: 7A67C5000C65582EDB7DB43C201EA60125FA4FE26A9C5B32DB180FA2 + 90: 9E4618777DAC670BE99DBFECC5FA2C8772935BC5AC85BC048D1E1157 + 91: 8136C3E222E66017ECC63F3A4CD02CC59BEF5D090BD7C15F9DD0A0DF + 92: 99E3D6F7F5F7A8A464B18B8C150CC0676BAAD90671C8385BDF565CB9 + 93: 88D1D864A9742D5EAB92941711412A846154B63A9F39398BE3579117 + 94: 1AC73C137447509A568F38418649CC4FDBE17DAB3C8EC211EE2EA66D + 95: 7C4732A0233A824C14C8824344C4D48BBE25DF760276E4297419E246 + 96: 3AD94BA3AE1687AC841994D7F256C5323F8472F866C73E3BA7996439 + 97: E2D1ED6A5CA2417953B93B4382053C8565CEE9587E225F981EA578B8 + 98: CFCFE1AF2BD7F04F71D8A3E693D99CD6A8AA6672E7219C43937571CD + 99: 0ED5F3CF3C8BB43A1092B88ED5DF2D6E6F205900C7A58D1DB12255E3 +100: 6874E421B75321F9557AD33321C953FB347752FAB4248948F6968FF5 +101: 89F6846EBFFF7ED93331EEF430CA76B8BA07B2C45A8800BC4FCE0CD8 +102: 26EDB14A61CF9CC8CB47B52132E8EBB9F6F74659B837D1CA2CDC69EF +103: AEF05C596B9DC0D5B4DE5EB1C5B4E0D1CA7F2AA7263A15ECBEB8F21B +104: 8F9C483F86B936DCC362F7D2355D1B9D7FC871A94D0AA600E1C0E7A0 +105: A6F87051E521EF4508A257D4F8A1234067C2793B81ED6B12C9A78E6C +106: 2F14EC6CE17DEF3303E4AF12402CB993DB6F744C98496C8DFD314739 +107: 47534461C68F5845ED81B321D01C3AF799B90685AF1CBEEE94FE21FB +108: 47E9F55B20DF65269B8518F2FF3E86A64F6218EB6D4B5D4E31286BE6 +109: 710A584F1F5C90F87476EACC55E5B3A69D98CFD99411DDDE9A920D93 +110: 04232108D28C257C3B7CBEBD89D0217A5B9493C6C55D98389B1B25E5 +111: 52C8204FE1858787F42C06A88366310DA1581E4EA8B37C6072C4453A +112: 9DBD83A2D053C9AA450C71BC1F6F14D5D19A43665269FE074FED27F8 +113: 31E2DFECB3A2898DF67AB5BCDA7882C6FEE1007B433139D2C8BFAFD5 +114: 72CE843B10640D421D75B68FC142BAF968B016BAA63469AE07358FD1 +115: AD5F0911A6B64C5474264A448F3F8FA38D368859A1BC130AF1E1FE69 +116: B0A85CF422723A819C7C79EA504AA9FC5EC181833CAB5F28CBFC1934 +117: C6B7143FC9463E927D2DFDC84EA04FEABCCBB687A9773C71C3D05BD4 +118: 1D2348211ACEF40B47418D01B56E4C2628D0C37A2ED12D449606E901 +119: 39595A28C162B245FCD5C67B4680FCFFF2A94328E226D1D94F338EF1 +120: 7D7F67564EC1E1C7CA7A700868B5E6924C7E0B2602616D98661D831A +121: 6BFD3795DDBEC718FB494F82EBDBDFABA96D03F95A6BD314D8BD6B83 +122: 2EB81E4366A2AB7D8A45B40F18B0379E9F88C40A921A26982D3EB005 +123: 33C2EB7848A12A83AA6E481B304B87C481A7C67C783A46E727DDFE51 +124: 0E2A18CE135A59AAEBC4A0005C297ED95AF8CB4D5A45CB24DC4E306A +125: 5538F4C2AB53987351F6B1368CE067E0DF71680D127C46EE5932B78F +126: E2072202C04D503488F8409C74BBE058766104CA8489C75555AE6B1C +127: 8E6149B225A64643FDCBD6E6D23836B422E7DED4998D38FC1FD199A3 +128: 1413ED73BEBF067429D7DA342B26E249BE9298E2A401FE18384C93D6 HMAC-blake2s-256 0: E2641D24DFA8DD89E8CB77F1CDC77D8C006E5BEBDFC4D6A3A3A6F8D5B7586FB0 diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index ec5520646..eb2ac2806 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -86,7 +86,7 @@ const struct ltc_hash_descriptor blake2s_160_desc = { "blake2s-160", 22, - 32, + 20, 64, { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 5 }, 11, @@ -101,7 +101,7 @@ const struct ltc_hash_descriptor blake2s_224_desc = { "blake2s-224", 23, - 32, + 28, 64, { 1, 3, 6, 1, 4, 1, 1722, 12, 2, 2, 7 }, 11, From 609d0afd00c8c709b3d54fc3df8a652d59bd1af6 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 20 Apr 2017 12:28:38 -0400 Subject: [PATCH 0622/1192] updated hash_tv.txt --- notes/hash_tv.txt | 516 +++++++++++++++++++++++----------------------- 1 file changed, 258 insertions(+), 258 deletions(-) diff --git a/notes/hash_tv.txt b/notes/hash_tv.txt index a7a795f1d..99417e600 100644 --- a/notes/hash_tv.txt +++ b/notes/hash_tv.txt @@ -2902,266 +2902,266 @@ Hash: blake2s-128 128: 7A3B3FA888B60095E7B305EFCF3C3DBC Hash: blake2s-160 - 0: 354C9C33F735962418BDACB9479873429C34916FB5A5E989DC8DC2CD0F793796 - 1: 63A5F3DBA42C1EE9CE4147C1B22E0B61F4C7A17AB5A5E989DC8DC2CD0F793796 - 2: D7E7E6E5A94FB0B0319212F4376E60C0BE1E7604B5A5E989DC8DC2CD0F793796 - 3: 5F70714603428963ABE2EA507C1D0A7C3D67A8E4B5A5E989DC8DC2CD0F793796 - 4: D2EB068A022B036AD8F46AD5DB018DF76331BAB1B5A5E989DC8DC2CD0F793796 - 5: 9B76C33F4F273950A4CF51FF337D00E7FC61DD23B5A5E989DC8DC2CD0F793796 - 6: 4309F8371A6AC414FF37D1D52EF1776C95A20789B5A5E989DC8DC2CD0F793796 - 7: B4F2034937EDB13E5B2ACA648274F662E3F284FFB5A5E989DC8DC2CD0F793796 - 8: 55AF018D4764BFB68D6A1157F1CEEC211E1885EAB5A5E989DC8DC2CD0F793796 - 9: 28356DD720151A6F60845D7F0E2364A720AA6E8DB5A5E989DC8DC2CD0F793796 - 10: 92BAE8F308BFAD697E5AEB54A465DA37F9D24425B5A5E989DC8DC2CD0F793796 - 11: 9BFD39BE442702851DD618737A05830E3AA40894B5A5E989DC8DC2CD0F793796 - 12: E2ACC08A5D25D268595EFFCFE34EE1BF3AE884F1B5A5E989DC8DC2CD0F793796 - 13: D899B80BD2B851D721760B03DDD6E6A37F1F074DB5A5E989DC8DC2CD0F793796 - 14: 440DD02BBF5B49139D5A4885F0C923131AD3D3C5B5A5E989DC8DC2CD0F793796 - 15: CA6F08E03BD4580C89A1E341CC248A2847C52F9BB5A5E989DC8DC2CD0F793796 - 16: 7FA3AA4D8C97FF99A6BC5D16613D859E52F026C1B5A5E989DC8DC2CD0F793796 - 17: AF0BECB1E358C5CA393586DF9180EE065A837A22B5A5E989DC8DC2CD0F793796 - 18: 6E7DC6203623F33A98CFC0C05B96A9B3F368FD54B5A5E989DC8DC2CD0F793796 - 19: 9E65CB46384717BF5F6A16D4C8357DC232C9FC3FB5A5E989DC8DC2CD0F793796 - 20: 985ED9932A7529791CC7535AD0FBABC3BE4EF1F3B5A5E989DC8DC2CD0F793796 - 21: 98171FF82492AAFB7FEF5D1C3D2DFC9D2B67AA2FB5A5E989DC8DC2CD0F793796 - 22: 8904388C800814EFEB7ADE5EEC2D19A3908B0779B5A5E989DC8DC2CD0F793796 - 23: 717B89BFE07E2D64391B315603B2AFA849595F8CB5A5E989DC8DC2CD0F793796 - 24: 027EC32547E076CB8AA0645C7F6C3A916339FA29B5A5E989DC8DC2CD0F793796 - 25: 47A86EAAFF8E2C9E72E8352E13907C4625B88C18B5A5E989DC8DC2CD0F793796 - 26: C1688EBF848D91A22499FB6C4126869F2B45C715B5A5E989DC8DC2CD0F793796 - 27: 3B38DA6BC7706A551A2C554653BCE5F88BDFA3DEB5A5E989DC8DC2CD0F793796 - 28: 45F888CFFDDDDE987FAE61A5FA1CA6C0461AB265B5A5E989DC8DC2CD0F793796 - 29: DFEA3AB50EE3D5878F165ECAA9CC497DB82927E4B5A5E989DC8DC2CD0F793796 - 30: 1AB376D7E1A479032F26BC158F698CDD905871CCB5A5E989DC8DC2CD0F793796 - 31: 6E0C39AC0442DC1A6C05ED1602806E64A6EF82E1B5A5E989DC8DC2CD0F793796 - 32: F73E3143C51B27F4E4605613948AA1DD3DB1AD77B5A5E989DC8DC2CD0F793796 - 33: 758D383DFCF4E44D440879E14A16D1303CD4F014B5A5E989DC8DC2CD0F793796 - 34: 439CE5842CADDAC3DEC67A2C47CE3566D8982DF8B5A5E989DC8DC2CD0F793796 - 35: 0483C39E9616A1AE7083CCCD5700C4F8FAD23307B5A5E989DC8DC2CD0F793796 - 36: 8EE9EF037310BA9174217C4921EF32620179D04BB5A5E989DC8DC2CD0F793796 - 37: 1C0BD65FE618575F0750D2E3B08E2E718C8B7970B5A5E989DC8DC2CD0F793796 - 38: F0256B86A8E9EB359F950FF0A5E16596F253BEE4B5A5E989DC8DC2CD0F793796 - 39: 8D7BFFBC634762D0FB5222E4BB0A8719E9B7D081B5A5E989DC8DC2CD0F793796 - 40: 27E1D09CEFD270ADB81599B71A47ABA8E17CE4F9B5A5E989DC8DC2CD0F793796 - 41: C5A52EC4DF672DED31983299F56FE7B389975988B5A5E989DC8DC2CD0F793796 - 42: C9813921DB8760016DA939BF7EC2E34E30A8BB3AB5A5E989DC8DC2CD0F793796 - 43: 7B1D1B8933557B22DE1A9A5FCAE805F52CD30CA4B5A5E989DC8DC2CD0F793796 - 44: F192A8F9A94BD34DF766692A2CDAA63DD0BDDBFDB5A5E989DC8DC2CD0F793796 - 45: 39E6ED136B56D8319DE6D51B3211A035042FFED1B5A5E989DC8DC2CD0F793796 - 46: 5E9930F1EC9066C20296AF7122CBBA72B25A2A93B5A5E989DC8DC2CD0F793796 - 47: 793030A738EB909568471EE20340D32BEA78403AB5A5E989DC8DC2CD0F793796 - 48: 2E8DC80084C5A2E64245E974AFC408C2EBF89D19B5A5E989DC8DC2CD0F793796 - 49: 006869129561FDC6549A03C0B5214B9A76238F92B5A5E989DC8DC2CD0F793796 - 50: 11170463304E748E8DB1449F55191E9D153ED1BDB5A5E989DC8DC2CD0F793796 - 51: 1A0B05555FB77D2F9C074FA3E83BB283F95BE537B5A5E989DC8DC2CD0F793796 - 52: 5F5F8FF3CE86AF33C1415C60F76CB2C25BDE6728B5A5E989DC8DC2CD0F793796 - 53: EC7675D6B24FE54113EE502F4B9C434AE2D510B8B5A5E989DC8DC2CD0F793796 - 54: F6D1E8931D28A492C487FE2B62684B4DEE9606ADB5A5E989DC8DC2CD0F793796 - 55: 2C0AE504B7674099048042CE546844DD06E32EFBB5A5E989DC8DC2CD0F793796 - 56: 81DED6F4245B0BC4C055D5B7940D4A82DFEA329AB5A5E989DC8DC2CD0F793796 - 57: 0285CCF80282440FB7E66B16DCF53D6C530EC3BCB5A5E989DC8DC2CD0F793796 - 58: C617F39AB2446324C5E42D8B24C773AAA55CF624B5A5E989DC8DC2CD0F793796 - 59: C2378D825E5E8D9C98AE33DAED09DB42D8BE0A40B5A5E989DC8DC2CD0F793796 - 60: 62B4DCAAB72D70A77806A9B96C099AC76D04D72CB5A5E989DC8DC2CD0F793796 - 61: 1D9CAAA74E54F3CA2D685C74211C6A4310E66D9DB5A5E989DC8DC2CD0F793796 - 62: 6B190C2ABC4C181FF207099CB51C3DF5C944CE15B5A5E989DC8DC2CD0F793796 - 63: 3D0034E3E070CED4C8555CC592D019AF6155B086B5A5E989DC8DC2CD0F793796 - 64: 68C18B80DD398444AA9FD4272ECFA8E71B31EE8AB5A5E989DC8DC2CD0F793796 - 65: 20EB8EEE0C703A44779298F35F92DA38F2B4F0BFB5A5E989DC8DC2CD0F793796 - 66: EF4CD91D8F64838A042C07FB47F2736E68B66809B5A5E989DC8DC2CD0F793796 - 67: E2F5974DF791223616B42D5DA419DF26F2E128C0B5A5E989DC8DC2CD0F793796 - 68: 06C2DBF070561DC936212A3ADC877C94D6C4A5D0B5A5E989DC8DC2CD0F793796 - 69: 14B0EBC0735758C60EC1EF0DB2DE0E2763801370B5A5E989DC8DC2CD0F793796 - 70: 3D389052DC609E219CCF557B6667F8976B82B782B5A5E989DC8DC2CD0F793796 - 71: ED2B645B593417C11431E55E646D26E92DE1CFB3B5A5E989DC8DC2CD0F793796 - 72: 7150F391010A2F175621D5FFBCF7A6EDFFC8FE1FB5A5E989DC8DC2CD0F793796 - 73: F4B6B92EBE81533243053EF7C44C993F50983B3EB5A5E989DC8DC2CD0F793796 - 74: 36E34AE33E41722AF099E6A57CFD466A5631057AB5A5E989DC8DC2CD0F793796 - 75: 1FBE85FFF071FD6C98F6F1A519E2D64F475ED76AB5A5E989DC8DC2CD0F793796 - 76: 1C6C18D0FC578FB74B92EC0AF23CB61C8E6CF595B5A5E989DC8DC2CD0F793796 - 77: 240240245C8BDB34F0A52656644593BAAE08A5EBB5A5E989DC8DC2CD0F793796 - 78: 2F3320A1E36B4E3CBFF7085B2599752FC830C78DB5A5E989DC8DC2CD0F793796 - 79: 10FCC5E7FE1927674730A94CEC96BF2F0BD9DFCCB5A5E989DC8DC2CD0F793796 - 80: 2E33E68B08D61675372CF6DA84AB69F2EC707B00B5A5E989DC8DC2CD0F793796 - 81: 9729F628CE9C027774A643F3CEF26DA829F36592B5A5E989DC8DC2CD0F793796 - 82: 1EF72D087EF5E79D104396D63579BD6F98CF4C1EB5A5E989DC8DC2CD0F793796 - 83: 69B9DFD3ECC5560FACCFAF2A402F949F76EEAF84B5A5E989DC8DC2CD0F793796 - 84: 12EE430ED6E37CD3B9FE0318F134390F11BB99FBB5A5E989DC8DC2CD0F793796 - 85: 0D491088429004B2ECB84788FB045EAD3F7B6E54B5A5E989DC8DC2CD0F793796 - 86: 0A755ACE4673E9A2A083E9B7E412E0F21C4E8D18B5A5E989DC8DC2CD0F793796 - 87: 38FE0BEA8C3B5D105A6D6BB7D241E4345893FE36B5A5E989DC8DC2CD0F793796 - 88: F94971CFF90543B01DD32C5589032B0C05AC179FB5A5E989DC8DC2CD0F793796 - 89: 720F5741BDC10B4599E67F86C1A14C0116B1C69AB5A5E989DC8DC2CD0F793796 - 90: CB82A141D54DE5386D032C87E417240C2FEAEA5AB5A5E989DC8DC2CD0F793796 - 91: DBDC7A6B1A2EA4CA3275871FECAB399BB2C91065B5A5E989DC8DC2CD0F793796 - 92: 2DF5156607D295E207A31FF08F0CFE7B5659ABD9B5A5E989DC8DC2CD0F793796 - 93: 338F3C5DF3EC240F5310F826EB17E86BA05C4E49B5A5E989DC8DC2CD0F793796 - 94: 60CFC1A154C1D98B44F0DE61090D49E71979D992B5A5E989DC8DC2CD0F793796 - 95: FC9B059E0B22B699387F2DAE43949A56EA395514B5A5E989DC8DC2CD0F793796 - 96: 18BF054303412DA7FEB896C7940D2AE0EA4DD8B8B5A5E989DC8DC2CD0F793796 - 97: C1942585DDFBD73AFBC7F1F8A2FE54EC9DB1DBE9B5A5E989DC8DC2CD0F793796 - 98: A0A46EFE86E0438226977955E5BB92454AC0EDC1B5A5E989DC8DC2CD0F793796 - 99: 5EB5F8576B9D35EABDC5377802F02FF9E121B435B5A5E989DC8DC2CD0F793796 -100: 680D1A3BDA75F684618CBDC2863A76719155EE53B5A5E989DC8DC2CD0F793796 -101: A2923C7BD0EE1A2BE98BA750571B4A95DCD53F67B5A5E989DC8DC2CD0F793796 -102: CA57C775ABB2082BC165CC102BDC54F8F3F2896FB5A5E989DC8DC2CD0F793796 -103: AED1F4A1172389137FFDDB36CED33E70E0AF111BB5A5E989DC8DC2CD0F793796 -104: FE6297DB2444ED4C50860BD0266978C314724920B5A5E989DC8DC2CD0F793796 -105: B522FE23A986B6A911AA575590675DC80A0608F7B5A5E989DC8DC2CD0F793796 -106: 49380F56DFD3E20B1517374304814A8F351B71B9B5A5E989DC8DC2CD0F793796 -107: 9053188745A526DF0431EC4BF836F329B2AD54F3B5A5E989DC8DC2CD0F793796 -108: EBA715AED607617D90340C144D4E9059A80FD465B5A5E989DC8DC2CD0F793796 -109: CB1ABE32A735C49164A068EF87120B49C7EAAB2BB5A5E989DC8DC2CD0F793796 -110: 7081B36DEF56C5FBB541C8C0AD8BB324C29ABE88B5A5E989DC8DC2CD0F793796 -111: AACABE58BF3FCD680DEB8FE8C7D8D74798E9081DB5A5E989DC8DC2CD0F793796 -112: E660714F551A3EAEBF8BF334AF6415152B86E485B5A5E989DC8DC2CD0F793796 -113: 2C425922F0E11972DBD91E4394282E1570BB25A2B5A5E989DC8DC2CD0F793796 -114: 45C24A1C263432568573075A2162CC8098CCA18EB5A5E989DC8DC2CD0F793796 -115: 7847103CF22ABC8C2FC0AD911FEBB7B14943C9B5B5A5E989DC8DC2CD0F793796 -116: C5147A4590DD4C1426E212156E01F608DBD66D69B5A5E989DC8DC2CD0F793796 -117: 965FE7D1837B971EDAB15F7E67EBA9A2E6914F40B5A5E989DC8DC2CD0F793796 -118: 741E306EAD4D955C33052B0ED20F5C5AB20F2101B5A5E989DC8DC2CD0F793796 -119: DB5207DF29623C33809DAC6E43F475D30A72A911B5A5E989DC8DC2CD0F793796 -120: 71EDF00F043A71BA57F6B5E1B68A6789DD546F1DB5A5E989DC8DC2CD0F793796 -121: 8662782A37C5750197139141A9727141552F3ED9B5A5E989DC8DC2CD0F793796 -122: FEE742A0F8B086265397D6F1BBCBBDC0A06BAA02B5A5E989DC8DC2CD0F793796 -123: 79AB45D0C1993E96A5513CB71E90B6CE6534255DB5A5E989DC8DC2CD0F793796 -124: 81941D21C28A57C91B9912A0530393C5EC4B847EB5A5E989DC8DC2CD0F793796 -125: D751DCCD29D33981DF4014FE866B04029BF79370B5A5E989DC8DC2CD0F793796 -126: 247DC8D47CA83F3B852BFBD5C1100E5EA7DB9A8FB5A5E989DC8DC2CD0F793796 -127: B326E5F0E03512E436F31111DF9C378DCA2B3171B5A5E989DC8DC2CD0F793796 -128: FB7B50DB11A7A2ACECF57AA08636DF85EEAAC736B5A5E989DC8DC2CD0F793796 + 0: 354C9C33F735962418BDACB9479873429C34916F + 1: 63A5F3DBA42C1EE9CE4147C1B22E0B61F4C7A17A + 2: D7E7E6E5A94FB0B0319212F4376E60C0BE1E7604 + 3: 5F70714603428963ABE2EA507C1D0A7C3D67A8E4 + 4: D2EB068A022B036AD8F46AD5DB018DF76331BAB1 + 5: 9B76C33F4F273950A4CF51FF337D00E7FC61DD23 + 6: 4309F8371A6AC414FF37D1D52EF1776C95A20789 + 7: B4F2034937EDB13E5B2ACA648274F662E3F284FF + 8: 55AF018D4764BFB68D6A1157F1CEEC211E1885EA + 9: 28356DD720151A6F60845D7F0E2364A720AA6E8D + 10: 92BAE8F308BFAD697E5AEB54A465DA37F9D24425 + 11: 9BFD39BE442702851DD618737A05830E3AA40894 + 12: E2ACC08A5D25D268595EFFCFE34EE1BF3AE884F1 + 13: D899B80BD2B851D721760B03DDD6E6A37F1F074D + 14: 440DD02BBF5B49139D5A4885F0C923131AD3D3C5 + 15: CA6F08E03BD4580C89A1E341CC248A2847C52F9B + 16: 7FA3AA4D8C97FF99A6BC5D16613D859E52F026C1 + 17: AF0BECB1E358C5CA393586DF9180EE065A837A22 + 18: 6E7DC6203623F33A98CFC0C05B96A9B3F368FD54 + 19: 9E65CB46384717BF5F6A16D4C8357DC232C9FC3F + 20: 985ED9932A7529791CC7535AD0FBABC3BE4EF1F3 + 21: 98171FF82492AAFB7FEF5D1C3D2DFC9D2B67AA2F + 22: 8904388C800814EFEB7ADE5EEC2D19A3908B0779 + 23: 717B89BFE07E2D64391B315603B2AFA849595F8C + 24: 027EC32547E076CB8AA0645C7F6C3A916339FA29 + 25: 47A86EAAFF8E2C9E72E8352E13907C4625B88C18 + 26: C1688EBF848D91A22499FB6C4126869F2B45C715 + 27: 3B38DA6BC7706A551A2C554653BCE5F88BDFA3DE + 28: 45F888CFFDDDDE987FAE61A5FA1CA6C0461AB265 + 29: DFEA3AB50EE3D5878F165ECAA9CC497DB82927E4 + 30: 1AB376D7E1A479032F26BC158F698CDD905871CC + 31: 6E0C39AC0442DC1A6C05ED1602806E64A6EF82E1 + 32: F73E3143C51B27F4E4605613948AA1DD3DB1AD77 + 33: 758D383DFCF4E44D440879E14A16D1303CD4F014 + 34: 439CE5842CADDAC3DEC67A2C47CE3566D8982DF8 + 35: 0483C39E9616A1AE7083CCCD5700C4F8FAD23307 + 36: 8EE9EF037310BA9174217C4921EF32620179D04B + 37: 1C0BD65FE618575F0750D2E3B08E2E718C8B7970 + 38: F0256B86A8E9EB359F950FF0A5E16596F253BEE4 + 39: 8D7BFFBC634762D0FB5222E4BB0A8719E9B7D081 + 40: 27E1D09CEFD270ADB81599B71A47ABA8E17CE4F9 + 41: C5A52EC4DF672DED31983299F56FE7B389975988 + 42: C9813921DB8760016DA939BF7EC2E34E30A8BB3A + 43: 7B1D1B8933557B22DE1A9A5FCAE805F52CD30CA4 + 44: F192A8F9A94BD34DF766692A2CDAA63DD0BDDBFD + 45: 39E6ED136B56D8319DE6D51B3211A035042FFED1 + 46: 5E9930F1EC9066C20296AF7122CBBA72B25A2A93 + 47: 793030A738EB909568471EE20340D32BEA78403A + 48: 2E8DC80084C5A2E64245E974AFC408C2EBF89D19 + 49: 006869129561FDC6549A03C0B5214B9A76238F92 + 50: 11170463304E748E8DB1449F55191E9D153ED1BD + 51: 1A0B05555FB77D2F9C074FA3E83BB283F95BE537 + 52: 5F5F8FF3CE86AF33C1415C60F76CB2C25BDE6728 + 53: EC7675D6B24FE54113EE502F4B9C434AE2D510B8 + 54: F6D1E8931D28A492C487FE2B62684B4DEE9606AD + 55: 2C0AE504B7674099048042CE546844DD06E32EFB + 56: 81DED6F4245B0BC4C055D5B7940D4A82DFEA329A + 57: 0285CCF80282440FB7E66B16DCF53D6C530EC3BC + 58: C617F39AB2446324C5E42D8B24C773AAA55CF624 + 59: C2378D825E5E8D9C98AE33DAED09DB42D8BE0A40 + 60: 62B4DCAAB72D70A77806A9B96C099AC76D04D72C + 61: 1D9CAAA74E54F3CA2D685C74211C6A4310E66D9D + 62: 6B190C2ABC4C181FF207099CB51C3DF5C944CE15 + 63: 3D0034E3E070CED4C8555CC592D019AF6155B086 + 64: 68C18B80DD398444AA9FD4272ECFA8E71B31EE8A + 65: 20EB8EEE0C703A44779298F35F92DA38F2B4F0BF + 66: EF4CD91D8F64838A042C07FB47F2736E68B66809 + 67: E2F5974DF791223616B42D5DA419DF26F2E128C0 + 68: 06C2DBF070561DC936212A3ADC877C94D6C4A5D0 + 69: 14B0EBC0735758C60EC1EF0DB2DE0E2763801370 + 70: 3D389052DC609E219CCF557B6667F8976B82B782 + 71: ED2B645B593417C11431E55E646D26E92DE1CFB3 + 72: 7150F391010A2F175621D5FFBCF7A6EDFFC8FE1F + 73: F4B6B92EBE81533243053EF7C44C993F50983B3E + 74: 36E34AE33E41722AF099E6A57CFD466A5631057A + 75: 1FBE85FFF071FD6C98F6F1A519E2D64F475ED76A + 76: 1C6C18D0FC578FB74B92EC0AF23CB61C8E6CF595 + 77: 240240245C8BDB34F0A52656644593BAAE08A5EB + 78: 2F3320A1E36B4E3CBFF7085B2599752FC830C78D + 79: 10FCC5E7FE1927674730A94CEC96BF2F0BD9DFCC + 80: 2E33E68B08D61675372CF6DA84AB69F2EC707B00 + 81: 9729F628CE9C027774A643F3CEF26DA829F36592 + 82: 1EF72D087EF5E79D104396D63579BD6F98CF4C1E + 83: 69B9DFD3ECC5560FACCFAF2A402F949F76EEAF84 + 84: 12EE430ED6E37CD3B9FE0318F134390F11BB99FB + 85: 0D491088429004B2ECB84788FB045EAD3F7B6E54 + 86: 0A755ACE4673E9A2A083E9B7E412E0F21C4E8D18 + 87: 38FE0BEA8C3B5D105A6D6BB7D241E4345893FE36 + 88: F94971CFF90543B01DD32C5589032B0C05AC179F + 89: 720F5741BDC10B4599E67F86C1A14C0116B1C69A + 90: CB82A141D54DE5386D032C87E417240C2FEAEA5A + 91: DBDC7A6B1A2EA4CA3275871FECAB399BB2C91065 + 92: 2DF5156607D295E207A31FF08F0CFE7B5659ABD9 + 93: 338F3C5DF3EC240F5310F826EB17E86BA05C4E49 + 94: 60CFC1A154C1D98B44F0DE61090D49E71979D992 + 95: FC9B059E0B22B699387F2DAE43949A56EA395514 + 96: 18BF054303412DA7FEB896C7940D2AE0EA4DD8B8 + 97: C1942585DDFBD73AFBC7F1F8A2FE54EC9DB1DBE9 + 98: A0A46EFE86E0438226977955E5BB92454AC0EDC1 + 99: 5EB5F8576B9D35EABDC5377802F02FF9E121B435 +100: 680D1A3BDA75F684618CBDC2863A76719155EE53 +101: A2923C7BD0EE1A2BE98BA750571B4A95DCD53F67 +102: CA57C775ABB2082BC165CC102BDC54F8F3F2896F +103: AED1F4A1172389137FFDDB36CED33E70E0AF111B +104: FE6297DB2444ED4C50860BD0266978C314724920 +105: B522FE23A986B6A911AA575590675DC80A0608F7 +106: 49380F56DFD3E20B1517374304814A8F351B71B9 +107: 9053188745A526DF0431EC4BF836F329B2AD54F3 +108: EBA715AED607617D90340C144D4E9059A80FD465 +109: CB1ABE32A735C49164A068EF87120B49C7EAAB2B +110: 7081B36DEF56C5FBB541C8C0AD8BB324C29ABE88 +111: AACABE58BF3FCD680DEB8FE8C7D8D74798E9081D +112: E660714F551A3EAEBF8BF334AF6415152B86E485 +113: 2C425922F0E11972DBD91E4394282E1570BB25A2 +114: 45C24A1C263432568573075A2162CC8098CCA18E +115: 7847103CF22ABC8C2FC0AD911FEBB7B14943C9B5 +116: C5147A4590DD4C1426E212156E01F608DBD66D69 +117: 965FE7D1837B971EDAB15F7E67EBA9A2E6914F40 +118: 741E306EAD4D955C33052B0ED20F5C5AB20F2101 +119: DB5207DF29623C33809DAC6E43F475D30A72A911 +120: 71EDF00F043A71BA57F6B5E1B68A6789DD546F1D +121: 8662782A37C5750197139141A9727141552F3ED9 +122: FEE742A0F8B086265397D6F1BBCBBDC0A06BAA02 +123: 79AB45D0C1993E96A5513CB71E90B6CE6534255D +124: 81941D21C28A57C91B9912A0530393C5EC4B847E +125: D751DCCD29D33981DF4014FE866B04029BF79370 +126: 247DC8D47CA83F3B852BFBD5C1100E5EA7DB9A8F +127: B326E5F0E03512E436F31111DF9C378DCA2B3171 +128: FB7B50DB11A7A2ACECF57AA08636DF85EEAAC736 Hash: blake2s-224 - 0: 1FA1291E65248B37B3433475B2A0DD63D54A11ECC4E3E034E7BC1EF40F793796 - 1: 61B94EC94622A391D2AE42E6456C9012D5800797B8865AFC482197BB0F793796 - 2: B354A3A86CCB9D779E2CCA139D231DBE9ABF798F167FEA6E3F5778670F793796 - 3: F366ACA9739FDDA59DC11280B6E6D10DB6286B503E1D0A922326307A0F793796 - 4: 42ABB6E970408779166B9EB742FE0621B03F77794A8881FC398F97B30F793796 - 5: 01F21AA3E522547A29784118863AA2A1954E295F42529C3DE06008350F793796 - 6: 4DED466648D01276EAD4A77882C05602F7E92B198E84810A52FF11A80F793796 - 7: D2FC4A9F2B1CC35D2ED8A7C24A91A68C86FBD326574B079C66E411960F793796 - 8: 9903423028C41511FABD3366A07AAF7E480D2B6FC0457EEF7C11A8240F793796 - 9: D664024F8A94368DCCE909495E2CD6BBF1BB02390F8066545D0107010F793796 - 10: 976C9034E79937B253F7D9CEBF6F7E81B57CF27C97551E88FB95168A0F793796 - 11: 314B02060FA7ED987F3C566783A6B325D30F17A6D5F3724E23C466330F793796 - 12: 0C7F28E829AA9484F2AFF0605535404B8E845EC763439FAD1BF860240F793796 - 13: 3C12AE2CB1489D1E962A1D171173628B3D6BE0590C3ADE492C3987B70F793796 - 14: 55B6D6D04513E811CC41F656DA633E7DC9555BDFF733F735ADB531EC0F793796 - 15: 90C14B6F15AB39F0623A092C25171DB744DCEC78BCAC1C5F722C4B560F793796 - 16: 9384BC14A81DA3BBCA13D0CF2A876711545EE8C3A87C191A4169F7270F793796 - 17: 49B6BDF2ED04E5D76A19CAC2BAEF08AAD16A3B4A31B2765781593AF80F793796 - 18: 5AA9C3AABE961DE67A16AFF35B0AABB7E734C26E2EE42C76A46299CD0F793796 - 19: FEB584CF41462363372F82999262AB93F154EBEEB644F58B4713202C0F793796 - 20: E17CA71ADA6B48CBBB8399D9CAEA26D0F2B7F5B1C9BD4924E6A6A4940F793796 - 21: F5BE4A4A44421D403F7A154366311D61E415F6169516E72DB426A4C60F793796 - 22: 2C347252DD3B7B99FEF9038B72E7961799C7DCD7CD9D22BEE98E57200F793796 - 23: D5A11E41B9FF2562A8A93D62B1CC9DE2A734C2C14D7AC5C818B1D2250F793796 - 24: BB2F2A95B9A695091D79CBB7DDB60E6344EE6A1A0A00506F8D4E81A60F793796 - 25: 4C676307A506243B96B8765274D9696C41332EBCACDDCFEF51ED98B20F793796 - 26: EBF674014A0EC1513A522B13CCE542E7E8E4A5C4915A8545DB9A28E90F793796 - 27: 03308AC3021B1F36500A53A14D472C669D03135DA7477E636D3814120F793796 - 28: 9F7194D71D515EBC1E15DDB382D218FB35D91485F7967D9961CCEDCC0F793796 - 29: 8F6809F5F9ADD0562C0D7F70583AC71A24C6C1885EE1D5F572D3D9730F793796 - 30: 00AFC8B9B4F0C30625E53D4F2064F6BFF05EDF46FEEFAC6EA6CB73340F793796 - 31: 4D42ABA3D1D12AF74A8524114B17D6D1957FB24753DDE2E28E9DA3900F793796 - 32: A19C4CA01CE34CD61408E9EC9946E3DAA98AD1B7D77C087782E6827F0F793796 - 33: 800559FD51E93E4BC2FDDFB26964343AF7C0DD343AA3D36D40857F970F793796 - 34: 3656E7DB967CDFC7F3D7BA099827449E9AC38AE992A02D446706CF5C0F793796 - 35: DC690F1B322291B741D0CE2D9639F8DB85FDF5FDE1E41701BFD8A4060F793796 - 36: C0EBB37BB3E12CBD7888255E8C3A8F1EB6AE5A9582455D7A0772BBE50F793796 - 37: 32B16E5D5EDD71424DD8C8E1E23A651322CA06AF13E3FB7E56EA97330F793796 - 38: 20D5B7C0B52320AB1A1FBF7D47626BD758138E07B74B4FB2B846E1860F793796 - 39: C4A7603DFA81B43D36E9F5B0D1423DE4686327F7A4415D62777514280F793796 - 40: 1ECBF4EA964E9B3855A9E9293F3D2D2BE1E251D9204B54B6837800A90F793796 - 41: 9C9440E097BEAD44FA7B968818FF557D41D2AB29EF48212C975378E30F793796 - 42: 97D936C85DA801F053AD2C7EE6D7B4ABFB43D2563FA5CFA76A3660550F793796 - 43: DEF0FA3658530B7BBC0E6D5A30AF8B48ED780C73D947BD267DB36E2F0F793796 - 44: 6C26BA6D96EF33EA6977943D2BDE04AE3BAB13CD7329D7CF304A091E0F793796 - 45: D5E49A864104B862020251F91E917E33F77208797F4FA7FEC2618C180F793796 - 46: 59F3C5D276DD45FD1B1A512094E6F7CB8946D26B6DE0B16659E865050F793796 - 47: C5F52A98EDBA4700EB18E7855EE8DD1A427FC7184FF4259B3DF09B910F793796 - 48: 69A7C96A17478FB971E907399C125E39E7DA329D231C4A1ACFEEE1F50F793796 - 49: F97C42B005A40AC713CD1201544058C332FE83D6A5DFFCB3F7A26DF70F793796 - 50: 080519CB017B2953003725848DD739C9B39AE9D9E6E7E9006103A8520F793796 - 51: 267AEF7F39ED64DCA288F25B01F9AD5478599E1B91B496840A1DF1D60F793796 - 52: 52240CD9B35403B8832680EE72FDDCF37E51897E9E4E46B55D3ACBED0F793796 - 53: 63DA0BF0FBDBA65430F5BBC099A4B7F868672BC3FAD71ED31F5F77B20F793796 - 54: 5EE73E709A1661971150CF31099124CD42A9F9D6FFF6F9078BE631540F793796 - 55: 5CD64A9845375020F2331C72CB955821CFE11D06A3B63D8A1D1187E20F793796 - 56: 8522AB2D20CDF3CA0F85EA5A18E5C385F1BB3E9B0A4FDC07324C98B00F793796 - 57: FE16ABA3459844E3299FB7E0B47A8DC6337C8209CD6220407BF296820F793796 - 58: 86B4C6EF1783701C6F6DC237A8FF45035B61FD7F3FBDA61EF37B79D80F793796 - 59: 2A4A292DC2ACE8BD3729332332AA8757A7DEF68A181DF8CC512669100F793796 - 60: 36410AE1CDAA027F85A4ED1C8892B70E0B4FD541C2A14CC1411D67F00F793796 - 61: 21E5E7CCADB0A287A37C10E4CE258B2658DF29A0E7356C88A3E92C200F793796 - 62: 027B16F4E0F5A5C17A46EA3B51DC50B368EA094F5EF196E615FE8B3D0F793796 - 63: 8D88168937A3B44E45C1408C03DF60835DF2794E8B55ECA1FD1E266A0F793796 - 64: 0F3CD451360AAD6BD7C9CBC1497771315BC0E0F34C82D1F4E1052B1E0F793796 - 65: C4ED166EC8CCB80A236767111FA75498A0666901226B549DE011D5760F793796 - 66: 8CDD99B9C3E2F417C7DD334AD50AF32F220CAC25731C667BA6CFB4FF0F793796 - 67: 19415845A2F27872B881191381DAEA10E24A6DC1214B994DCE330F1E0F793796 - 68: 9973F64635A408C840C1DC2667BA0E9C2BDAFA8E86E584BF2642076B0F793796 - 69: 5041DA88DB2F7478EB5AC630FFB77BE46328891A5BA940141E2344BF0F793796 - 70: 7FD3930B4100F6A6E97B64EFC6BF77E23DA925E1C488FD89C618E03E0F793796 - 71: 4BFA0D8F207926ACAAA0E04A4EA269D822875A5FBB462C72936BFDF40F793796 - 72: FCA9E83CF144083FE82C39CA58341DEC32CEBBEAA87E728689C8C6E80F793796 - 73: 1F152AEAED0107E3F1D7317BCF61FBBBE9756D9C1D3A998ACCE73B190F793796 - 74: 5ECC27D88DC605A4C30CE046CD93C252E646CC5D1303C3A1F80193710F793796 - 75: B44C388E1CFF293242A783EC000E9CF1D977812255009CB35917FD5F0F793796 - 76: E3C4B860A91C6DEDBD796EA5EF957453A41BBD477E5C5327A23C4D870F793796 - 77: B61901A9BA1AB20128DE4832923742E01BA41A648EF09FE5D0FC64E00F793796 - 78: 562B90D86AF640C3835F76B24FB1DB7F509DE8091E15D52FD62837470F793796 - 79: 5704A0A9B316400692431460D45F64C52FF939CD33AC93EE239273520F793796 - 80: 222395B8C1DAD60F29E1B02E9E944CADDA56A61027F46025F893239D0F793796 - 81: FFD94C26439196ACBD2E9C225E522F2825588BDC67053BBF3F0D3A580F793796 - 82: 0F2C8AA114D3A687F143EB35EEBE32FD1CA325AC5B8818024AFB35540F793796 - 83: 00402EC26EFEAAC7E376EB294CC3F1A5ACF55B8B2D06B581194473DA0F793796 - 84: A504DF8BA4C46C6D0923C67DF94169F057A63192A17623FC7B20B1890F793796 - 85: 654954B063729D09A562598A9537EACCC0D98B9BB1FBB34172960F190F793796 - 86: EE5773C670FE153A969B1F3A54F155A28AF9E25BDFEE02285940FF260F793796 - 87: A5FCA2FCE745A8FED0338C747797539CE96998F0678758679BDC7A840F793796 - 88: F2761BB7E85BB2953FB99AFF5F2EC50C6799B140359165035333C8F90F793796 - 89: BD5FE527CD74ADAF6A646C6C35E0B891744CA78098224EC8E4CD5CB80F793796 - 90: 886E3D5B274CF83C5CE6D16E4C3A8D3382A3486A3F447EC70526EE170F793796 - 91: 23E6611E54C8D767D3C0B007F05815E5FACA2DC11A27D5EE5D3F8EAD0F793796 - 92: A09DA0A8EE1DEB0B41C6F50BCE7446A7F6CE60886B5E289EE86F70080F793796 - 93: 60382D65E2FC987AF43757FC7AAA777F82F885C98EA07F650C52A3A10F793796 - 94: D2033BF9C929E13F39A0033669F7B270983CAE1491588D6765BFFCFF0F793796 - 95: 278F3962EB35495F08C04DAC7C2DC972550B5E8125DE7B2DEF30D67A0F793796 - 96: 54501DD2B4B14AE335F0DAA6DE33C862532A9C7D895A33582001BF880F793796 - 97: D14803662A73E03B0EC08DB76877E8EBF614A7B2E48800536032A3290F793796 - 98: 4669600EFB4AB6D1653AA0470F6E35005F961A9A0896F2F3D6A2A5CD0F793796 - 99: 20EE59D9CC85FF096A6C209EE25A9D9D7B01BF6A0FCF3FE512573BB20F793796 -100: D578424CA09A3900792DC6F4D3DD0282B80C39415C0DB9283806A07B0F793796 -101: 047BF849300AF65A5E5A0037A2F03236D78F18AE96C760D084683EE30F793796 -102: 66E2C5DC229AD1318A39E5E38276181E4BEF8467A3EF99CAAD842EF90F793796 -103: FBBA003032683675DFA34448CB70F50F9D52B3FAD23BAAF4E9D810AA0F793796 -104: 87147164C725A5C17F0C108315AB67266D2F748C4F97F3A4A5450C530F793796 -105: 808E48C1FF44EAE1289F2B460E8F5694E65F1F71F08C7F09281B20240F793796 -106: 4D8A491E0F4E265C71A7FD993E94B187B69053D4DC4A45EEFCA667630F793796 -107: 4B93C4B9DF00FB64A1E5D00A7130253B438DD30CF132C1FFA8B494580F793796 -108: FA77DD5A05385B4F08787EC821A4D9643E66570F5ADDCC95C558E9160F793796 -109: BA2E4C01D2C80EEAB1C1D76C3348C37D88EDBE52D2322B38AA4B25530F793796 -110: 50232F65130808FF427EE791C0D7F4B0D80A5428E6D153970462138E0F793796 -111: 6E3DF733DCB232D9742DEAB44A6CC9CE75B52D677599DE018BE80A020F793796 -112: 589286CE5D448B9B6A727AE3E24DEB9E8141FEDB1E8E853556A63A030F793796 -113: E48768C63384D8C29736969B1F2934D57EABE67D80EC1B05C74607CF0F793796 -114: D243C7B0EA86D4286FC46217A4DBACAB02D47B553E500F41225A6F9E0F793796 -115: 5048ADFB6091292878E21F2D40682F385B130294BC61216133B7F28D0F793796 -116: 2400C769610FB06F9BE1810F202E325F5984289533595D5252DB52B80F793796 -117: B64166E2678CB7BED689CD28F0C06969559FFF3F8C31564BF68C07410F793796 -118: D8160C3E3AAC9FE0368FACB3190AB11ECF545DF83F6A60D058A069080F793796 -119: AC993AF05709DE0C7516C09F505562D8F10C643690ADF3DC1EB128030F793796 -120: 8D3221FFC272D7FD44D4EA0AF6AE4AF7D5E0BE1E48F305B7EFB1BC6D0F793796 -121: F14EAFFA4F73354329CD49634836E3A69DE1A89C80262BF40668F2CC0F793796 -122: F4DE293C01AF09BFA4E7417488EA8D599FA854C6305E8D638AC831460F793796 -123: BFC807EFE5CF0C5C7F71E337E68BA974F137DF299D01DC7E57F053D00F793796 -124: B943A8B8EC482F68977BD6FEFD3FDEB1FCADFB84B3B5A8442CBF4F0B0F793796 -125: 01D45AD3FF542DB030F7EE00F80342EE397DB480737A3A17098C08040F793796 -126: 11FAE1A284C26D0475026225741EE11E10E96453B92FAA72FF4DBD470F793796 -127: A5CE0FF6222E2669FC425EF4D5CDAED1870BF1C384A560E4DD86F5B30F793796 -128: 784E4D4A1465F11253D1812C9C865C99581656086F4F2B7EE7FFDBB60F793796 + 0: 1FA1291E65248B37B3433475B2A0DD63D54A11ECC4E3E034E7BC1EF4 + 1: 61B94EC94622A391D2AE42E6456C9012D5800797B8865AFC482197BB + 2: B354A3A86CCB9D779E2CCA139D231DBE9ABF798F167FEA6E3F577867 + 3: F366ACA9739FDDA59DC11280B6E6D10DB6286B503E1D0A922326307A + 4: 42ABB6E970408779166B9EB742FE0621B03F77794A8881FC398F97B3 + 5: 01F21AA3E522547A29784118863AA2A1954E295F42529C3DE0600835 + 6: 4DED466648D01276EAD4A77882C05602F7E92B198E84810A52FF11A8 + 7: D2FC4A9F2B1CC35D2ED8A7C24A91A68C86FBD326574B079C66E41196 + 8: 9903423028C41511FABD3366A07AAF7E480D2B6FC0457EEF7C11A824 + 9: D664024F8A94368DCCE909495E2CD6BBF1BB02390F8066545D010701 + 10: 976C9034E79937B253F7D9CEBF6F7E81B57CF27C97551E88FB95168A + 11: 314B02060FA7ED987F3C566783A6B325D30F17A6D5F3724E23C46633 + 12: 0C7F28E829AA9484F2AFF0605535404B8E845EC763439FAD1BF86024 + 13: 3C12AE2CB1489D1E962A1D171173628B3D6BE0590C3ADE492C3987B7 + 14: 55B6D6D04513E811CC41F656DA633E7DC9555BDFF733F735ADB531EC + 15: 90C14B6F15AB39F0623A092C25171DB744DCEC78BCAC1C5F722C4B56 + 16: 9384BC14A81DA3BBCA13D0CF2A876711545EE8C3A87C191A4169F727 + 17: 49B6BDF2ED04E5D76A19CAC2BAEF08AAD16A3B4A31B2765781593AF8 + 18: 5AA9C3AABE961DE67A16AFF35B0AABB7E734C26E2EE42C76A46299CD + 19: FEB584CF41462363372F82999262AB93F154EBEEB644F58B4713202C + 20: E17CA71ADA6B48CBBB8399D9CAEA26D0F2B7F5B1C9BD4924E6A6A494 + 21: F5BE4A4A44421D403F7A154366311D61E415F6169516E72DB426A4C6 + 22: 2C347252DD3B7B99FEF9038B72E7961799C7DCD7CD9D22BEE98E5720 + 23: D5A11E41B9FF2562A8A93D62B1CC9DE2A734C2C14D7AC5C818B1D225 + 24: BB2F2A95B9A695091D79CBB7DDB60E6344EE6A1A0A00506F8D4E81A6 + 25: 4C676307A506243B96B8765274D9696C41332EBCACDDCFEF51ED98B2 + 26: EBF674014A0EC1513A522B13CCE542E7E8E4A5C4915A8545DB9A28E9 + 27: 03308AC3021B1F36500A53A14D472C669D03135DA7477E636D381412 + 28: 9F7194D71D515EBC1E15DDB382D218FB35D91485F7967D9961CCEDCC + 29: 8F6809F5F9ADD0562C0D7F70583AC71A24C6C1885EE1D5F572D3D973 + 30: 00AFC8B9B4F0C30625E53D4F2064F6BFF05EDF46FEEFAC6EA6CB7334 + 31: 4D42ABA3D1D12AF74A8524114B17D6D1957FB24753DDE2E28E9DA390 + 32: A19C4CA01CE34CD61408E9EC9946E3DAA98AD1B7D77C087782E6827F + 33: 800559FD51E93E4BC2FDDFB26964343AF7C0DD343AA3D36D40857F97 + 34: 3656E7DB967CDFC7F3D7BA099827449E9AC38AE992A02D446706CF5C + 35: DC690F1B322291B741D0CE2D9639F8DB85FDF5FDE1E41701BFD8A406 + 36: C0EBB37BB3E12CBD7888255E8C3A8F1EB6AE5A9582455D7A0772BBE5 + 37: 32B16E5D5EDD71424DD8C8E1E23A651322CA06AF13E3FB7E56EA9733 + 38: 20D5B7C0B52320AB1A1FBF7D47626BD758138E07B74B4FB2B846E186 + 39: C4A7603DFA81B43D36E9F5B0D1423DE4686327F7A4415D6277751428 + 40: 1ECBF4EA964E9B3855A9E9293F3D2D2BE1E251D9204B54B6837800A9 + 41: 9C9440E097BEAD44FA7B968818FF557D41D2AB29EF48212C975378E3 + 42: 97D936C85DA801F053AD2C7EE6D7B4ABFB43D2563FA5CFA76A366055 + 43: DEF0FA3658530B7BBC0E6D5A30AF8B48ED780C73D947BD267DB36E2F + 44: 6C26BA6D96EF33EA6977943D2BDE04AE3BAB13CD7329D7CF304A091E + 45: D5E49A864104B862020251F91E917E33F77208797F4FA7FEC2618C18 + 46: 59F3C5D276DD45FD1B1A512094E6F7CB8946D26B6DE0B16659E86505 + 47: C5F52A98EDBA4700EB18E7855EE8DD1A427FC7184FF4259B3DF09B91 + 48: 69A7C96A17478FB971E907399C125E39E7DA329D231C4A1ACFEEE1F5 + 49: F97C42B005A40AC713CD1201544058C332FE83D6A5DFFCB3F7A26DF7 + 50: 080519CB017B2953003725848DD739C9B39AE9D9E6E7E9006103A852 + 51: 267AEF7F39ED64DCA288F25B01F9AD5478599E1B91B496840A1DF1D6 + 52: 52240CD9B35403B8832680EE72FDDCF37E51897E9E4E46B55D3ACBED + 53: 63DA0BF0FBDBA65430F5BBC099A4B7F868672BC3FAD71ED31F5F77B2 + 54: 5EE73E709A1661971150CF31099124CD42A9F9D6FFF6F9078BE63154 + 55: 5CD64A9845375020F2331C72CB955821CFE11D06A3B63D8A1D1187E2 + 56: 8522AB2D20CDF3CA0F85EA5A18E5C385F1BB3E9B0A4FDC07324C98B0 + 57: FE16ABA3459844E3299FB7E0B47A8DC6337C8209CD6220407BF29682 + 58: 86B4C6EF1783701C6F6DC237A8FF45035B61FD7F3FBDA61EF37B79D8 + 59: 2A4A292DC2ACE8BD3729332332AA8757A7DEF68A181DF8CC51266910 + 60: 36410AE1CDAA027F85A4ED1C8892B70E0B4FD541C2A14CC1411D67F0 + 61: 21E5E7CCADB0A287A37C10E4CE258B2658DF29A0E7356C88A3E92C20 + 62: 027B16F4E0F5A5C17A46EA3B51DC50B368EA094F5EF196E615FE8B3D + 63: 8D88168937A3B44E45C1408C03DF60835DF2794E8B55ECA1FD1E266A + 64: 0F3CD451360AAD6BD7C9CBC1497771315BC0E0F34C82D1F4E1052B1E + 65: C4ED166EC8CCB80A236767111FA75498A0666901226B549DE011D576 + 66: 8CDD99B9C3E2F417C7DD334AD50AF32F220CAC25731C667BA6CFB4FF + 67: 19415845A2F27872B881191381DAEA10E24A6DC1214B994DCE330F1E + 68: 9973F64635A408C840C1DC2667BA0E9C2BDAFA8E86E584BF2642076B + 69: 5041DA88DB2F7478EB5AC630FFB77BE46328891A5BA940141E2344BF + 70: 7FD3930B4100F6A6E97B64EFC6BF77E23DA925E1C488FD89C618E03E + 71: 4BFA0D8F207926ACAAA0E04A4EA269D822875A5FBB462C72936BFDF4 + 72: FCA9E83CF144083FE82C39CA58341DEC32CEBBEAA87E728689C8C6E8 + 73: 1F152AEAED0107E3F1D7317BCF61FBBBE9756D9C1D3A998ACCE73B19 + 74: 5ECC27D88DC605A4C30CE046CD93C252E646CC5D1303C3A1F8019371 + 75: B44C388E1CFF293242A783EC000E9CF1D977812255009CB35917FD5F + 76: E3C4B860A91C6DEDBD796EA5EF957453A41BBD477E5C5327A23C4D87 + 77: B61901A9BA1AB20128DE4832923742E01BA41A648EF09FE5D0FC64E0 + 78: 562B90D86AF640C3835F76B24FB1DB7F509DE8091E15D52FD6283747 + 79: 5704A0A9B316400692431460D45F64C52FF939CD33AC93EE23927352 + 80: 222395B8C1DAD60F29E1B02E9E944CADDA56A61027F46025F893239D + 81: FFD94C26439196ACBD2E9C225E522F2825588BDC67053BBF3F0D3A58 + 82: 0F2C8AA114D3A687F143EB35EEBE32FD1CA325AC5B8818024AFB3554 + 83: 00402EC26EFEAAC7E376EB294CC3F1A5ACF55B8B2D06B581194473DA + 84: A504DF8BA4C46C6D0923C67DF94169F057A63192A17623FC7B20B189 + 85: 654954B063729D09A562598A9537EACCC0D98B9BB1FBB34172960F19 + 86: EE5773C670FE153A969B1F3A54F155A28AF9E25BDFEE02285940FF26 + 87: A5FCA2FCE745A8FED0338C747797539CE96998F0678758679BDC7A84 + 88: F2761BB7E85BB2953FB99AFF5F2EC50C6799B140359165035333C8F9 + 89: BD5FE527CD74ADAF6A646C6C35E0B891744CA78098224EC8E4CD5CB8 + 90: 886E3D5B274CF83C5CE6D16E4C3A8D3382A3486A3F447EC70526EE17 + 91: 23E6611E54C8D767D3C0B007F05815E5FACA2DC11A27D5EE5D3F8EAD + 92: A09DA0A8EE1DEB0B41C6F50BCE7446A7F6CE60886B5E289EE86F7008 + 93: 60382D65E2FC987AF43757FC7AAA777F82F885C98EA07F650C52A3A1 + 94: D2033BF9C929E13F39A0033669F7B270983CAE1491588D6765BFFCFF + 95: 278F3962EB35495F08C04DAC7C2DC972550B5E8125DE7B2DEF30D67A + 96: 54501DD2B4B14AE335F0DAA6DE33C862532A9C7D895A33582001BF88 + 97: D14803662A73E03B0EC08DB76877E8EBF614A7B2E48800536032A329 + 98: 4669600EFB4AB6D1653AA0470F6E35005F961A9A0896F2F3D6A2A5CD + 99: 20EE59D9CC85FF096A6C209EE25A9D9D7B01BF6A0FCF3FE512573BB2 +100: D578424CA09A3900792DC6F4D3DD0282B80C39415C0DB9283806A07B +101: 047BF849300AF65A5E5A0037A2F03236D78F18AE96C760D084683EE3 +102: 66E2C5DC229AD1318A39E5E38276181E4BEF8467A3EF99CAAD842EF9 +103: FBBA003032683675DFA34448CB70F50F9D52B3FAD23BAAF4E9D810AA +104: 87147164C725A5C17F0C108315AB67266D2F748C4F97F3A4A5450C53 +105: 808E48C1FF44EAE1289F2B460E8F5694E65F1F71F08C7F09281B2024 +106: 4D8A491E0F4E265C71A7FD993E94B187B69053D4DC4A45EEFCA66763 +107: 4B93C4B9DF00FB64A1E5D00A7130253B438DD30CF132C1FFA8B49458 +108: FA77DD5A05385B4F08787EC821A4D9643E66570F5ADDCC95C558E916 +109: BA2E4C01D2C80EEAB1C1D76C3348C37D88EDBE52D2322B38AA4B2553 +110: 50232F65130808FF427EE791C0D7F4B0D80A5428E6D153970462138E +111: 6E3DF733DCB232D9742DEAB44A6CC9CE75B52D677599DE018BE80A02 +112: 589286CE5D448B9B6A727AE3E24DEB9E8141FEDB1E8E853556A63A03 +113: E48768C63384D8C29736969B1F2934D57EABE67D80EC1B05C74607CF +114: D243C7B0EA86D4286FC46217A4DBACAB02D47B553E500F41225A6F9E +115: 5048ADFB6091292878E21F2D40682F385B130294BC61216133B7F28D +116: 2400C769610FB06F9BE1810F202E325F5984289533595D5252DB52B8 +117: B64166E2678CB7BED689CD28F0C06969559FFF3F8C31564BF68C0741 +118: D8160C3E3AAC9FE0368FACB3190AB11ECF545DF83F6A60D058A06908 +119: AC993AF05709DE0C7516C09F505562D8F10C643690ADF3DC1EB12803 +120: 8D3221FFC272D7FD44D4EA0AF6AE4AF7D5E0BE1E48F305B7EFB1BC6D +121: F14EAFFA4F73354329CD49634836E3A69DE1A89C80262BF40668F2CC +122: F4DE293C01AF09BFA4E7417488EA8D599FA854C6305E8D638AC83146 +123: BFC807EFE5CF0C5C7F71E337E68BA974F137DF299D01DC7E57F053D0 +124: B943A8B8EC482F68977BD6FEFD3FDEB1FCADFB84B3B5A8442CBF4F0B +125: 01D45AD3FF542DB030F7EE00F80342EE397DB480737A3A17098C0804 +126: 11FAE1A284C26D0475026225741EE11E10E96453B92FAA72FF4DBD47 +127: A5CE0FF6222E2669FC425EF4D5CDAED1870BF1C384A560E4DD86F5B3 +128: 784E4D4A1465F11253D1812C9C865C99581656086F4F2B7EE7FFDBB6 Hash: blake2s-256 0: 69217A3079908094E11121D042354A7C1F55B6482CA1A51E1B250DFD1ED0EEF9 From 336c52ca5f83540d5246246d4c2f8003752c02ba Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 21 Apr 2017 16:11:22 +0200 Subject: [PATCH 0623/1192] Facelift of *_file functions --- src/hashes/helper/hash_filehandle.c | 26 +++++++++------ src/mac/f9/f9_file.c | 51 +++++++++++++++++------------ src/mac/hmac/hmac_file.c | 43 +++++++++++++----------- src/mac/omac/omac_file.c | 39 +++++++++++++--------- src/mac/pmac/pmac_file.c | 39 +++++++++++++--------- src/mac/poly1305/poly1305_file.c | 30 ++++++++++++----- src/mac/xcbc/xcbc_file.c | 39 +++++++++++++--------- 7 files changed, 163 insertions(+), 104 deletions(-) diff --git a/src/hashes/helper/hash_filehandle.c b/src/hashes/helper/hash_filehandle.c index 41832fdff..e1d037e82 100644 --- a/src/hashes/helper/hash_filehandle.c +++ b/src/hashes/helper/hash_filehandle.c @@ -27,7 +27,7 @@ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outlen) { hash_state md; - unsigned char buf[512]; + unsigned char *buf; size_t x; int err; @@ -35,30 +35,36 @@ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outle LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(in != NULL); + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; + } + if ((err = hash_is_valid(hash)) != CRYPT_OK) { - return err; + goto LBL_ERR; } if (*outlen < hash_descriptor[hash].hashsize) { *outlen = hash_descriptor[hash].hashsize; - return CRYPT_BUFFER_OVERFLOW; + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_ERR; } if ((err = hash_descriptor[hash].init(&md)) != CRYPT_OK) { - return err; + goto LBL_ERR; } *outlen = hash_descriptor[hash].hashsize; do { - x = fread(buf, 1, sizeof(buf), in); + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = hash_descriptor[hash].process(&md, buf, (unsigned long)x)) != CRYPT_OK) { - return err; + goto LBL_CLEANBUF; } - } while (x == sizeof(buf)); + } while (x == LTC_FILE_READ_BUFSIZE); err = hash_descriptor[hash].done(&md, out); -#ifdef LTC_CLEAN_STACK - zeromem(buf, sizeof(buf)); -#endif +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); +LBL_ERR: + XFREE(buf); return err; } #endif /* #ifndef LTC_NO_FILE */ diff --git a/src/mac/f9/f9_file.c b/src/mac/f9/f9_file.c index 5d885fb58..c99d7a39a 100644 --- a/src/mac/f9/f9_file.c +++ b/src/mac/f9/f9_file.c @@ -22,14 +22,14 @@ @param cipher The index of the cipher desired @param key The secret key @param keylen The length of the secret key (octets) - @param filename The name of the file you wish to f9 + @param fname The name of the file you wish to f9 @param out [out] Where the authentication tag is to be stored @param outlen [in/out] The max size and resulting size of the authentication tag @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled */ int f9_file(int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *fname, unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE @@ -39,41 +39,50 @@ int f9_file(int cipher, int err; f9_state f9; FILE *in; - unsigned char buf[512]; + unsigned char *buf; - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(filename != NULL); - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(fname != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); - in = fopen(filename, "rb"); - if (in == NULL) { - return CRYPT_FILE_NOTFOUND; + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; } if ((err = f9_init(&f9, cipher, key, keylen)) != CRYPT_OK) { - fclose(in); - return err; + goto LBL_ERR; + } + + in = fopen(fname, "rb"); + if (in == NULL) { + err = CRYPT_FILE_NOTFOUND; + goto LBL_ERR; } do { - x = fread(buf, 1, sizeof(buf), in); + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = f9_process(&f9, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); - return err; + goto LBL_CLEANBUF; } - } while (x == sizeof(buf)); - fclose(in); + } while (x == LTC_FILE_READ_BUFSIZE); - if ((err = f9_done(&f9, out, outlen)) != CRYPT_OK) { - return err; + if (fclose(in) != 0) { + err = CRYPT_ERROR; + goto LBL_CLEANBUF; } + err = f9_done(&f9, out, outlen); + +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); +LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(buf, sizeof(buf)); + zeromem(&f9, sizeof(f9_state)); #endif - - return CRYPT_OK; + XFREE(buf); + return err; #endif } diff --git a/src/mac/hmac/hmac_file.c b/src/mac/hmac/hmac_file.c index 8558c2ac6..f74505c04 100644 --- a/src/mac/hmac/hmac_file.c +++ b/src/mac/hmac/hmac_file.c @@ -36,7 +36,7 @@ int hmac_file(int hash, const char *fname, #else hmac_state hmac; FILE *in; - unsigned char buf[512]; + unsigned char *buf; size_t x; int err; @@ -45,49 +45,52 @@ int hmac_file(int hash, const char *fname, LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); - if((err = hash_is_valid(hash)) != CRYPT_OK) { - return err; + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; + } + + if ((err = hash_is_valid(hash)) != CRYPT_OK) { + goto LBL_ERR; } if ((err = hmac_init(&hmac, hash, key, keylen)) != CRYPT_OK) { - return err; + goto LBL_ERR; } in = fopen(fname, "rb"); if (in == NULL) { - return CRYPT_FILE_NOTFOUND; + err = CRYPT_FILE_NOTFOUND; + goto LBL_ERR; } - /* process the file contents */ do { - x = fread(buf, 1, sizeof(buf), in); + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = hmac_process(&hmac, buf, (unsigned long)x)) != CRYPT_OK) { - /* we don't trap this error since we're already returning an error! */ - fclose(in); - return err; + fclose(in); /* we don't trap this error since we're already returning an error! */ + goto LBL_CLEANBUF; } - } while (x == sizeof(buf)); + } while (x == LTC_FILE_READ_BUFSIZE); if (fclose(in) != 0) { - return CRYPT_ERROR; + err = CRYPT_ERROR; + goto LBL_CLEANBUF; } - /* get final hmac */ - if ((err = hmac_done(&hmac, out, outlen)) != CRYPT_OK) { - return err; - } + err = hmac_done(&hmac, out, outlen); +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); +LBL_ERR: #ifdef LTC_CLEAN_STACK - /* clear memory */ - zeromem(buf, sizeof(buf)); + zeromem(&hmac, sizeof(hmac_state)); #endif - return CRYPT_OK; + XFREE(buf); + return err; #endif } #endif - /* $Source$ */ /* $Revision$ */ /* $Date$ */ diff --git a/src/mac/omac/omac_file.c b/src/mac/omac/omac_file.c index bbff793d6..51c67b784 100644 --- a/src/mac/omac/omac_file.c +++ b/src/mac/omac/omac_file.c @@ -39,41 +39,50 @@ int omac_file(int cipher, int err; omac_state omac; FILE *in; - unsigned char buf[512]; + unsigned char *buf; LTC_ARGCHK(key != NULL); LTC_ARGCHK(filename != NULL); LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); - in = fopen(filename, "rb"); - if (in == NULL) { - return CRYPT_FILE_NOTFOUND; + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; } if ((err = omac_init(&omac, cipher, key, keylen)) != CRYPT_OK) { - fclose(in); - return err; + goto LBL_ERR; + } + + in = fopen(filename, "rb"); + if (in == NULL) { + err = CRYPT_FILE_NOTFOUND; + goto LBL_ERR; } do { - x = fread(buf, 1, sizeof(buf), in); + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = omac_process(&omac, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); - return err; + goto LBL_CLEANBUF; } - } while (x == sizeof(buf)); - fclose(in); + } while (x == LTC_FILE_READ_BUFSIZE); - if ((err = omac_done(&omac, out, outlen)) != CRYPT_OK) { - return err; + if (fclose(in) != 0) { + err = CRYPT_ERROR; + goto LBL_CLEANBUF; } + err = omac_done(&omac, out, outlen); + +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); +LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(buf, sizeof(buf)); + zeromem(&omac, sizeof(omac_state)); #endif - - return CRYPT_OK; + XFREE(buf); + return err; #endif } diff --git a/src/mac/pmac/pmac_file.c b/src/mac/pmac/pmac_file.c index b484400f1..c7d9877df 100644 --- a/src/mac/pmac/pmac_file.c +++ b/src/mac/pmac/pmac_file.c @@ -39,7 +39,7 @@ int pmac_file(int cipher, int err; pmac_state pmac; FILE *in; - unsigned char buf[512]; + unsigned char *buf; LTC_ARGCHK(key != NULL); @@ -47,34 +47,43 @@ int pmac_file(int cipher, LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); - in = fopen(filename, "rb"); - if (in == NULL) { - return CRYPT_FILE_NOTFOUND; + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; } if ((err = pmac_init(&pmac, cipher, key, keylen)) != CRYPT_OK) { - fclose(in); - return err; + goto LBL_ERR; + } + + in = fopen(filename, "rb"); + if (in == NULL) { + err = CRYPT_FILE_NOTFOUND; + goto LBL_ERR; } do { - x = fread(buf, 1, sizeof(buf), in); + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = pmac_process(&pmac, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); - return err; + goto LBL_CLEANBUF; } - } while (x == sizeof(buf)); - fclose(in); + } while (x == LTC_FILE_READ_BUFSIZE); - if ((err = pmac_done(&pmac, out, outlen)) != CRYPT_OK) { - return err; + if (fclose(in) != 0) { + err = CRYPT_ERROR; + goto LBL_CLEANBUF; } + err = pmac_done(&pmac, out, outlen); + +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); +LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(buf, sizeof(buf)); + zeromem(&pmac, sizeof(pmac_state)); #endif - - return CRYPT_OK; + XFREE(buf); + return err; #endif } diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index 1c3e61e42..42afdc3e3 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -21,8 +21,8 @@ @param fname The name of the file you wish to POLY1305 @param key The secret key @param keylen The length of the secret key - @param out [out] The POLY1305 authentication tag - @param outlen [in/out] The max size and resulting size of the authentication tag + @param mac [out] The POLY1305 authentication tag + @param maclen [in/out] The max size and resulting size of the authentication tag @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled */ int poly1305_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen) @@ -41,23 +41,37 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key LTC_ARGCHK(mac != NULL); LTC_ARGCHK(maclen != NULL); - if ((in = fopen(fname, "rb")) == NULL) { return CRYPT_FILE_NOTFOUND; } - if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { return CRYPT_MEM; } - if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; + } + + if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { + goto LBL_ERR; + } + + in = fopen(fname, "rb"); + if (in == NULL) { + err = CRYPT_FILE_NOTFOUND; + goto LBL_ERR; + } do { x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = poly1305_process(&st, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); - goto LBL_ERR; + goto LBL_CLEANBUF; } } while (x == LTC_FILE_READ_BUFSIZE); - if (fclose(in) != 0) { + + if (fclose(in) != 0) { err = CRYPT_ERROR; - goto LBL_ERR; + goto LBL_CLEANBUF; } + err = poly1305_done(&st, mac, maclen); +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); LBL_ERR: #ifdef LTC_CLEAN_STACK zeromem(&st, sizeof(poly1305_state)); diff --git a/src/mac/xcbc/xcbc_file.c b/src/mac/xcbc/xcbc_file.c index bba0d48e3..c8119f9a1 100644 --- a/src/mac/xcbc/xcbc_file.c +++ b/src/mac/xcbc/xcbc_file.c @@ -39,41 +39,50 @@ int xcbc_file(int cipher, int err; xcbc_state xcbc; FILE *in; - unsigned char buf[512]; + unsigned char *buf; LTC_ARGCHK(key != NULL); LTC_ARGCHK(filename != NULL); LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); - in = fopen(filename, "rb"); - if (in == NULL) { - return CRYPT_FILE_NOTFOUND; + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; } if ((err = xcbc_init(&xcbc, cipher, key, keylen)) != CRYPT_OK) { - fclose(in); - return err; + goto LBL_ERR; + } + + in = fopen(filename, "rb"); + if (in == NULL) { + err = CRYPT_FILE_NOTFOUND; + goto LBL_ERR; } do { - x = fread(buf, 1, sizeof(buf), in); + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = xcbc_process(&xcbc, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); - return err; + goto LBL_CLEANBUF; } - } while (x == sizeof(buf)); - fclose(in); + } while (x == LTC_FILE_READ_BUFSIZE); - if ((err = xcbc_done(&xcbc, out, outlen)) != CRYPT_OK) { - return err; + if (fclose(in) != 0) { + err = CRYPT_ERROR; + goto LBL_CLEANBUF; } + err = xcbc_done(&xcbc, out, outlen); + +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); +LBL_ERR: #ifdef LTC_CLEAN_STACK - zeromem(buf, sizeof(buf)); + zeromem(&xcbc, sizeof(xcbc_state)); #endif - - return CRYPT_OK; + XFREE(buf); + return err; #endif } From d1ae2889ae78777bccd1fc1a702884c6a75f14f5 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 21 Apr 2017 16:12:18 +0200 Subject: [PATCH 0624/1192] add file_test() --- demos/test.c | 1 + testprof/file_test.c | 85 ++++++++++++++++++++++++++++++++++++++++ testprof/tomcrypt_test.h | 1 + 3 files changed, 87 insertions(+) create mode 100644 testprof/file_test.c diff --git a/demos/test.c b/demos/test.c index 6263247fd..ac812c224 100644 --- a/demos/test.c +++ b/demos/test.c @@ -24,6 +24,7 @@ static const struct { LTC_TEST_FN(ecc_tests), LTC_TEST_FN(dsa_test), LTC_TEST_FN(katja_test), + LTC_TEST_FN(file_test), }; int main(int argc, char **argv) diff --git a/testprof/file_test.c b/testprof/file_test.c new file mode 100644 index 000000000..862683aa1 --- /dev/null +++ b/testprof/file_test.c @@ -0,0 +1,85 @@ +/* test file related functions */ + +#include + +int file_test(void) +{ +#ifdef LTC_NO_FILE + return CRYPT_NOP; +#else + unsigned char key[32] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; + unsigned char buf[200]; + unsigned long len; + char *fname = "testprof/test.key"; + FILE *in; + int err, isha256, iaes; + + /* expected results */ + unsigned char exp_sha256[32] = { 0x76, 0xEC, 0x7F, 0xAE, 0xBD, 0xC4, 0x2A, 0x4D, 0xE3, 0x5C, 0xA7, 0x00, 0x24, 0xC2, 0xD2, 0x73, + 0xE9, 0xF7, 0x85, 0x6C, 0xA6, 0x16, 0x12, 0xE8, 0x9F, 0x5F, 0x66, 0x35, 0x0B, 0xA8, 0xCF, 0x5F }; + isha256 = find_hash("sha256"); + iaes = find_cipher("aes"); + + len = sizeof(buf); + if ((in = fopen(fname, "rb")) == NULL) return CRYPT_FILE_NOTFOUND; + if ((err = hash_filehandle(isha256, in, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_sha256, 32, "hash_filehandle", 1)) return 1; + + len = sizeof(buf); + if ((err = hash_file(isha256, fname, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_sha256, 32, "hash_file", 1)) return 1; + +#ifdef LTC_HMAC + { + unsigned char exp_hmacsha256[32] = { 0xE4, 0x07, 0x74, 0x95, 0xF1, 0xF8, 0x5B, 0xB5, 0xF1, 0x4F, 0x7D, 0x4F, 0x59, 0x8E, 0x4B, 0xBC, + 0x8F, 0x68, 0xCF, 0xBA, 0x2E, 0xAD, 0xC4, 0x63, 0x9D, 0x7F, 0x02, 0x99, 0x8C, 0x08, 0xAC, 0xC0 }; + len = sizeof(buf); + if ((err = hmac_file(isha256, fname, key, 32, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_hmacsha256, 32, "hmac_file", 1)) return 1; + } +#endif +#ifdef LTC_OMAC + { + unsigned char exp_omacaes[16] = { 0x50, 0xB4, 0x6C, 0x62, 0xE9, 0xCA, 0x48, 0xFC, 0x38, 0x8D, 0xF4, 0xA2, 0x7D, 0x6A, 0x1E, 0xD8 }; + len = sizeof(buf); + if ((err = omac_file(iaes, key, 32, fname, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_omacaes, 16, "omac_file", 1)) return 1; + } +#endif +#ifdef LTC_PMAC + { + unsigned char exp_pmacaes[16] = { 0x7D, 0x65, 0xF0, 0x75, 0x4F, 0x8D, 0xE2, 0xB0, 0xE4, 0xFA, 0x54, 0x4E, 0x45, 0x01, 0x36, 0x1B }; + len = sizeof(buf); + if ((err = pmac_file(iaes, key, 32, fname, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_pmacaes, 16, "pmac_file", 1)) return 1; + } +#endif +#ifdef LTC_XCBC + { + unsigned char exp_xcbcaes[16] = { 0x9C, 0x73, 0xA2, 0xD7, 0x90, 0xA5, 0x86, 0x25, 0x4D, 0x3C, 0x8A, 0x6A, 0x24, 0x6D, 0xD1, 0xAB }; + len = sizeof(buf); + if ((err = xcbc_file(iaes, key, 32, fname, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_xcbcaes, 16, "xcbc_file", 1)) return 1; + } +#endif +#ifdef LTC_F9_MODE + { + unsigned char exp_f9aes[16] = { 0x6B, 0x6A, 0x18, 0x34, 0x13, 0x8E, 0x01, 0xEF, 0x33, 0x8E, 0x7A, 0x3F, 0x5B, 0x9A, 0xA6, 0x7A }; + len = sizeof(buf); + if ((err = f9_file(iaes, key, 32, fname, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_f9aes, 16, "f9_file", 1)) return 1; + } +#endif +#ifdef LTC_POLY1305 + { + unsigned char exp_poly1305[16] = { 0xD0, 0xC7, 0xFB, 0x13, 0xA8, 0x87, 0x84, 0x23, 0x21, 0xCC, 0xA9, 0x43, 0x81, 0x18, 0x75, 0xBE }; + len = sizeof(buf); + if ((err = poly1305_file(fname, key, 32, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_poly1305, 16, "poly1305_file", 1)) return 1; + } +#endif + + return CRYPT_OK; +#endif +} diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 60572b725..9e4dce4c7 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -65,6 +65,7 @@ int dsa_test(void); int der_tests(void); int misc_test(void); int base64_test(void); +int file_test(void); /* timing */ #define KTIMES 25 From dae70f9ba49c3b0b7835ed641f131b25cd819494 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 21 Apr 2017 16:12:41 +0200 Subject: [PATCH 0625/1192] update testprof/makefile* --- testprof/makefile | 2 +- testprof/makefile.icc | 2 +- testprof/makefile.mingw | 2 +- testprof/makefile.msvc | 2 +- testprof/makefile.shared | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/testprof/makefile b/testprof/makefile index 25f805b41..78d54c842 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -17,7 +17,7 @@ ifneq ($V,1) endif ${silent} ${CC} ${CFLAGS} -c $< -o $@ -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o diff --git a/testprof/makefile.icc b/testprof/makefile.icc index c60e257c2..acd90c7a8 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -1,7 +1,7 @@ CFLAGS += -I../src/headers -I./ CC?=icc -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index 456df230b..b454d12dc 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -4,7 +4,7 @@ CFLAGS = $(CFLAGS_OPTS) -I../src/headers -I../../libtommath -I. -Wall -Wextra -DUSE_LTM -DLTM_DESC -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o \ pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index 2f64462cb..1b361a646 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -1,6 +1,6 @@ CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /DUSE_LTM /W3 -OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj \ +OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj file_test.obj \ dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ rsa_test.obj store_test.obj rotate_test.obj test_driver.obj x86_prof.obj katja_test.obj \ dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj \ diff --git a/testprof/makefile.shared b/testprof/makefile.shared index 35620e5cd..e0302365f 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -6,7 +6,7 @@ LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o \ +OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o From 290926fe8a5870fa505c53175737d610287e1361 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 18 Apr 2017 16:05:11 +0200 Subject: [PATCH 0626/1192] include CFLAGS when building demos --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index b02fe0f23..dc53d68db 100644 --- a/makefile +++ b/makefile @@ -255,7 +255,7 @@ $(1): demos/$(1).o library ifneq ($V,1) @echo " * $${CC} $$@" endif - $${silent} $$(CC) $$< $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) + $${silent} $$(CC) $$(CFLAGS) $$< $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) From 75f2529cdfa37a1dbb3731f6a8dfb219c5bdfd43 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 21 Apr 2017 19:45:44 +0200 Subject: [PATCH 0627/1192] also run multi for coverage --- coverage.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/coverage.sh b/coverage.sh index 1c374ff63..b76a3bb1f 100755 --- a/coverage.sh +++ b/coverage.sh @@ -31,6 +31,7 @@ fi ./sizes ./constants +./multi # if this was executed as './coverage.sh ...' create coverage locally if [[ "${0%% *}" == "./${0##*/}" ]]; then From 6d404afc97b7d3cd2784445ee778c8b0337cdaa7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 21 Apr 2017 17:03:16 +0200 Subject: [PATCH 0628/1192] helper.pl --check-hashes + related fixes --- demos/hashsum.c | 18 ++ demos/tv_gen.c | 12 + helper.pl | 21 ++ notes/hash_tv.txt | 780 ++++++++++++++++++++++++++++++++++++++++++++++ notes/hmac_tv.txt | 780 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1611 insertions(+) diff --git a/demos/hashsum.c b/demos/hashsum.c index 9951a8554..44f3e10ef 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -96,12 +96,30 @@ void register_algs(void) #ifdef LTC_SHA512 register_hash (&sha512_desc); #endif +#ifdef LTC_SHA512_224 + register_hash (&sha512_224_desc); +#endif +#ifdef LTC_SHA512_256 + register_hash (&sha512_256_desc); +#endif +#ifdef LTC_SHA3 + register_hash (&sha3_224_desc); + register_hash (&sha3_256_desc); + register_hash (&sha3_384_desc); + register_hash (&sha3_512_desc); +#endif #ifdef LTC_RIPEMD128 register_hash (&rmd128_desc); #endif #ifdef LTC_RIPEMD160 register_hash (&rmd160_desc); #endif +#ifdef LTC_RIPEMD256 + register_hash (&rmd256_desc); +#endif +#ifdef LTC_RIPEMD320 + register_hash (&rmd320_desc); +#endif #ifdef LTC_WHIRLPOOL register_hash (&whirlpool_desc); #endif diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 8469b3a3a..1541367f6 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -85,6 +85,12 @@ void reg_algs(void) #ifdef LTC_SHA512 register_hash (&sha512_desc); #endif +#ifdef LTC_SHA512_224 + register_hash (&sha512_224_desc); +#endif +#ifdef LTC_SHA512_256 + register_hash (&sha512_256_desc); +#endif #ifdef LTC_SHA3 register_hash (&sha3_224_desc); register_hash (&sha3_256_desc); @@ -97,6 +103,12 @@ void reg_algs(void) #ifdef LTC_RIPEMD160 register_hash (&rmd160_desc); #endif +#ifdef LTC_RIPEMD256 + register_hash (&rmd256_desc); +#endif +#ifdef LTC_RIPEMD320 + register_hash (&rmd320_desc); +#endif #ifdef LTC_WHIRLPOOL register_hash (&whirlpool_desc); #endif diff --git a/helper.pl b/helper.pl index 2f61234bc..95b59a642 100755 --- a/helper.pl +++ b/helper.pl @@ -81,6 +81,25 @@ sub check_defines { return $fails; } +sub check_hashes { + my @src; + my @descriptors; + find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, './src/hashes/'); + for my $f (@src) { + my @n = map { $_ =~ s/^.*?ltc_hash_descriptor\s+(\S+).*$/$1/; $_ } grep { $_ =~ /ltc_hash_descriptor/ } split /\n/, read_file($f); + push @descriptors, @n if @n; + } + my $fails = 0; + for my $d (@descriptors) { + for my $f (qw{ demos/tv_gen.c demos/hashsum.c testprof/x86_prof.c }) { + my $txt = read_file($f); + warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/; + } + } + warn( $fails > 0 ? "check-hashes: FAIL $fails\n" : "check-hashes: PASS\n" ); + return $fails; +} + sub prepare_variable { my ($varname, @list) = @_; my $output = "$varname="; @@ -266,6 +285,7 @@ sub die_usage { GetOptions( "check-source" => \my $check_source, "check-defines" => \my $check_defines, + "check-hashes" => \my $check_hashes, "check-makefiles" => \my $check_makefiles, "check-all" => \my $check_all, "update-makefiles" => \my $update_makefiles, @@ -275,6 +295,7 @@ sub die_usage { my $failure; $failure ||= check_source() if $check_all || $check_source; $failure ||= check_defines() if $check_all || $check_defines; +$failure ||= check_hashes() if $check_all || $check_hashes; $failure ||= process_makefiles(0) if $check_all || $check_makefiles; $failure ||= process_makefiles(1) if $update_makefiles; diff --git a/notes/hash_tv.txt b/notes/hash_tv.txt index 99417e600..9de0852d7 100644 --- a/notes/hash_tv.txt +++ b/notes/hash_tv.txt @@ -1341,6 +1341,524 @@ Hash: sha512 255: 15025C9D135861FF5A549DF0BFD6C398FD126613496D4E97627651E68B7B1F80407F187D7978464F0F78BFEEA787600FAAEBBE991EDDB60671CD0CE874F0A744 256: 1E7B80BC8EDC552C8FEEB2780E111477E5BC70465FAC1A77B29B35980C3F0CE4A036A6C9462036824BD56801E62AF7E9FEBA5C22ED8A5AF877BF7DE117DCAC6D +Hash: sha512-224 + 0: 6ED0DD02806FA89E25DE060C19D3AC86CABB87D6A0DDD05C333B84F4 + 1: 283BB59AF7081ED08197227D8F65B9591FFE1155BE43E9550E57F941 + 2: 0A07690C7F1FEEE3D8C36114E0564D43CF0E710642E90BBFF1E9B7C3 + 3: 00FEC611D324972280D5B8D125BD43DD6EA2515CE38C3B888E613A07 + 4: 6E30A312ED1B6D4C7B31D269BCC7B0E6A29F0BF8AC223049732B35F4 + 5: D44BF9D6D04191EC944F8310B785991F4EF45EC090F35E847BE4621E + 6: 94EF12F2B3A28BA5E6CE4650386E4427A4BD28D2843F9D1E5B32048A + 7: CA5456E523DF159636695D94717801CDD968904348197A4FB5AC5119 + 8: 5A00A59D3FE5B7BA5B3FE011F8181487EAF7201ECE9802E424C61E88 + 9: 1666206F4D64AF32793D51D33DE4F268AA54E7D112F048356F317BD0 + 10: 069BBC329DAD3C93089EAFBB937C5A632A4319262EB1A6E2DC1E6A77 + 11: D0A05731CA8F7931F6982102E4400BA30C54F168AC16EA775E7C4421 + 12: 2613FB4EE8451FDD2CE06DCDE74D6BC07ED02EB14C1C10C0D3D363FA + 13: B667F676EC45176BF778C82B74784F49CD39190D100A09EEAF80BFA8 + 14: 1EE61F074B90106665F1D5F14ADA3EBBD85A90A1F86480A826BCACDF + 15: 0B0687B2E11D2F895E409CF2BB740A6955CF1BFD92FB6506AD842E2F + 16: 65B59A2E9935695519257ED5732C4CBA8DAEB3FFBEEBCD76ABBF780C + 17: 39933CF59CD76093DFBB32D3F22A2C625C01E27EAA08D6384AB3000D + 18: 04D4F72C5D27DF6C14A7094510B51FC1B3DD00B6B8ED4C075036E367 + 19: 559769278E6162D83151E400A271D430D679F4CF31E56318A292FFD1 + 20: EA3D6A5A59D4FB0F91EA5BE140F10EF016FF3F329C0D249B4335BB8B + 21: F47B5C68134BC28B322D79D3AC6C972BD0F399EFFDE08D63E51CE934 + 22: 4B15656266A2978EDBA018E1B2179A1AA5CE391D4C6BC519B3D00C49 + 23: 28CF753FF5C3638223730CF084FD174A241ED388733AF557CBAA7DAF + 24: D0B182ABEF413BA386AB674EF13D6645AAD072966439C05026E033C5 + 25: CDE0DAB321334986FB8D0979F91E8DA4F124A50CCF36C1E141072886 + 26: 70C12305B10FD9F7988AE80DE76C12312F5A1358CC8F501F7559A1FC + 27: 329BFD0CFDF2F12CAD586117A963E70027A4012D2E34FD48BEC23837 + 28: 0557344CB868836E365BD8D9744270FA985D68C6C26D93B800453050 + 29: D92467142FCF76D631683D3FCBE57A8B9FDD345D6B89DF1608008D74 + 30: B330CCC7206F6783B7D99DD15EED88C5ED55FA68105DE4A4B8B97361 + 31: D89725A75707E3CC1A7EABA0B6062D7EB3851BC1C49B3B237375235C + 32: CF2FC8B204143A496C4151113069636B288874D2CD9BEA3BD41B8495 + 33: 6F2B418FF1162E8EBADB34988E1FFCC412DE7613F3DC8E7C1C9523AD + 34: 0F3B76A501630F8E04214DEC93C3D019EB8F544112FDE69F77D1B342 + 35: D149A08A586593EFBAA96AE24171F962695DE0A55DB97F9AC936EC14 + 36: F3FDCC88C022ACBBC1F0BC7C738290768811A817B9A9B80B6C04B0A4 + 37: E5C962AE7DC60812C96041F20C5AD6E65B46DD55430EA0541F98E704 + 38: F22C11EC64A1BB8A883773A6CE9C435BE2B788807EEE19A19B9D940A + 39: BA5DE0946DF38400AC68EDF0A86A4DD8BF9594400FD239B8D1741044 + 40: 7802075428B0077420E37020D6932A24635C2D3AADAB7502098623DD + 41: 488268FD1A6D83CFA6EAC8685979C5F7D30933EE06A75E691871DA49 + 42: C1E30EED85DD23DE56C0897D04B8A8A4D22743ED39CF336B5338FAF7 + 43: 92813F2CD4D5AB56426D3E0B555D842E257CB0BF0C2A5393CBF35DB4 + 44: EE1FF9E3606625D954283059A3216464B5FBAA6DC64D8301B4777587 + 45: C6A59E3BF7EE5B5BF84F0F64AB196DA82686323D5213BE64F0F0808D + 46: 7A893130DFFA5DB80A087CC5CF58241A887E12D24C49F57A0CF446AA + 47: 2947CA00789EAC5FD4CB15AB516DA2BE7E728F35192F5F50A273AA69 + 48: F465139CB305691F5825A29E56F6D5E40AE1E041D3EB6E40A62FE854 + 49: 930FF6177F2A43D1A68565AFA65D85B7C335B50EC7E539F2FE44807C + 50: 3A758B9ACF4FBBEF5E4C31C181C82772AB9FAB097E3F9845F5EEF502 + 51: 570B4A6CF0CB0D96A6F285B8E0572DE4C0C9141BD78629790FBE0C13 + 52: 80AA23B431AAC8FB8DDB2291F574191BA1A66CB6F59271A6FE425ED5 + 53: 0208987B33EEDE4C081D624D50D621B6E57573A502DD3893CB89D9F5 + 54: 14433D01D241AA9EAB872098E505514E77AFD9F2FA2C64B62C9B5BC2 + 55: 4BC333B55C3237ED85AC21B6B3DFB70987C33CE04E20C2DE6142D681 + 56: DF1BB702813C49110142BC858073E618AB22AF52FAF8D5F0403D3FF0 + 57: F32287421B005CDB31B9B010A0F5A4AB12E161C2273BF69C738AB94B + 58: 26368FCAF3E938A8F144382227E1007CD58DCCA9726C74A677E2EF43 + 59: 54E346CBCB5AC8D3D5FB2D23014F485D966124F55F4866B2A3071467 + 60: 64650D072F1AEB7D3125598F96EDAFDF1EDC9F32BC09EB93E1DD687B + 61: 37240528FF0A13E4D0B1554A241BF2E658EDEB29BAAF9435C0ECA091 + 62: D233C35B97D0C77A0D925341193C664987E95CEA687EB76A473C73B6 + 63: 4544175B79234F008606D6071D74DE7483FF0BDC1DC8C99A89BCEEF0 + 64: 9E2437140847453434ACB859BC4F842E9FB4A4B55BD9DC164B74CEA4 + 65: AD09C080E71D330C7AF75C34CCFDCDC103C548EBAD3A058BF638AB01 + 66: CF9FE51BB566173AF5DCF3224C37D54801B3D8D99981D21E567A789C + 67: 58CEDB734F792A83905A7E76A014D6AFDB0C156AA08E0FEB1DC6F737 + 68: 69FE39435F7D2E63EDB3F8C43EA850DD9A89107309B72FFAF459F65F + 69: F164038057287964A01C51255DCC0BE0F2C42882598C1C2E0EF9A28B + 70: 57A8EA1F84E6653455CE70B8AFBB7CAC715B9D566250F7BD7A568E82 + 71: 424F87E867ED6A9FD34AB5B14BFF195E7BB65F70CB19D3B50510D380 + 72: A5BA006B30F2378CD1AB2E5DBB9FE130BE7F504A7A7AE51A09839229 + 73: 67386EDC9643345A4A7B060CAF230748B72CDFAD644AA1A69B846731 + 74: A48F0E00C1649D75E8D1927ED977EC333F904D97C2664B37819BF99C + 75: 1EEEAEFC4BAB0A232580116E8AB9C24BC35781E11D35562CCC97107C + 76: BE3D716B6DB628B4BB50F4472AD316FB906B5CA7DADA244D29E5FB8B + 77: A731A30796C89F3C37C99027F487979CD23B9FDCB5F03B4399A52778 + 78: D99A36476A13D2E1F4798C03E083FDF3E883401EF99C89B3D1FE7DFA + 79: 2154E08A409998272A3B7D2662BF10D30866AE0765F2AA1437983753 + 80: E0B6566F1F80ED434158B87807CBCD92BD28AC05D686C150DD67D1E7 + 81: 97DE2D154454C4693C3B09F7DED9F24D82095F0F59A49009A622CB90 + 82: 10CDECBFA161F69EDCFBAD57C10077E3DBD7356AED8CF00826554D61 + 83: 25DFC75815DD0995241F2EB0BF3899A2F70FF161C4C8913ECEFEA31C + 84: E87B6D729D9B12434CEFB32AB0F3CDDD98CAF531CE0F1C0A4EA3C594 + 85: DA64DBDD17C06E5BCA25B29FC9BD3E807FBBF85B88457C5007A29420 + 86: 2B354F454796AC6B73D4DCB61B245068857FC0AF370F7B810D998E29 + 87: D413BF567E46384C50F1C8F6D04E15EDFE49A23A9CF8FB3BA5366C0E + 88: D34D30F424F8966AEC100295D38F50BA202B7870D9F563DCAE7E53EF + 89: 4C92C6C9AC7AB81AEACD86FAB38CA0F14CBFD04F7ED2209F658C2C3E + 90: 0881AA04F7029CD296BB0956DCF148F4781F7C3FB651C6EF939C74AD + 91: D31507F6253787BB9565B114D98002010996F2930E32FAA8F5D50C57 + 92: 172205CD782DBAB95A449FAB59ACF89B3331FC060F9CF2DF94DC8D84 + 93: 0E631B1F9C604BA237CE9CC935ECC7966C35C8E847D8AF79EA7A6780 + 94: 5C632A21E6FBF71026B1BD8E89A58105A9231449F865F433121C9996 + 95: E5E6B8C1208E9F82FE16837AB87CBC3D0AEF9E424515239EA8992720 + 96: 24F4D45951C40A39A37BD5BB7FD48CB6773CA6489EBF50B396597ED4 + 97: 8807B743D38F491DA0C30FBB81C15037AD05FCE775211EB4F71677B9 + 98: D807E6C39F1F6136D03B2C64398482F8F0E34615591509EBC003EF7B + 99: 6B7514EC3320B8FD441D76AB9F7BC79257A5E6371A3F20C0A19B2233 +100: B8ABE8559D4921712A44815B8C4EACBE2B8D6E93DF96602534CEF852 +101: 3562AC37EC2EDB9D49363661B4C2A466F673D51D9081867A3D871359 +102: B35D3621C09E9C61D4B7DAC784AB12F7E08786F5F191E30A368CD68D +103: 090AA07690C305101F7943C57585F66F972B1299F5C7801971F70D23 +104: CECA8AF862A236CF08C7BEE7B938A822BE0DADDD36F52DA9832100B6 +105: B5C2B958BEAC3EF67F6352F2814F12DBB1BA548ED8C388148310852D +106: B14FAE5CC21CA79DA51DE208F74C12C1DD242E91141BBC2DF6F445FC +107: 0FC57C8D7F410CF551DA8591FD90F31F678AA10667221A4E3745130B +108: FCE9C580498A5D331A5769C7B0E28EA269DC38DC96EE653E89BA994D +109: 15628C95775984C37CDA5E240ED7469BFDA805F7837CA2B701AEB46D +110: 4F18E2DBFC15C957E51C15CBC834CFEC545C5B49BFB754A7C5C08A9C +111: F8810EE322210D0F4CBD7A4E92E7D7E72B63D2777DCB531E13DDD690 +112: 8099918892EBBD31215C9BB5E4E53C0B52927B000CED0720D2C65A22 +113: 8AA886CFB7357D802E9043498BB9CA36C80A79DCBFE06C9324F8C027 +114: 5E15C489124F3F4F1608B715B997F7965E83C025EED250E3F9590D72 +115: A0438519E0D17BAEC7D598ABF5F803F87D6B1646B1E0F7FC4D2B7FB9 +116: E09144D128BCF27B515888A761FE0C75AFC0F3C62AD49FF7EF1B7FC4 +117: 0F53884CA788693D5F51582A9A26568EE143884711E6A4502504D4D6 +118: 8255D5A16DA27ABA30904E22C13FC6D8014FBA31CEE8BC10D79ADFE5 +119: 091688FD3B855964A303EEE8F09F3A04B211B8A31B1729451A0458A6 +120: 3055CC455C76A920206971189DADE9A78A53E2455C12865C4ED36CE3 +121: A7F4D536F9028234EE7256853B95B9B984DD8CAE189C085380C70087 +122: 91CC350F8D813330D99061090A43349B57735675EEAA86C9AF9FD081 +123: 2FA22BBA6349E2F41D7AD06204547CA0D8C75DCDEA49A2BCE81F4F0F +124: 848183EA80864E016D5C5568B4A843B5E5748DE89E572169206CCF3E +125: BA1784E1FFC8B17E4E1849A54C469622482B12334A4AD620E2C5D99D +126: 35F29C25C39B50D886B398E6F654504CEE6A71B7F886D5FE9A71BFC9 +127: 29D2C4166A36E07B2DCD3A7C988DCB14776DC187040F6A733162EFB7 +128: 49A64B72A88A3C93432B6E4C59A1B4908403F70E46E13BF7494FBE88 +129: AA05964C59A40BB5140F3F1B9CA03C3EEE0A1044BBD3FE84E5936877 +130: 38E7B198B7D65953C36F24AE14A1476F4B6273D0F551B0BB46AB62AF +131: 7B95414DAB33D2063E798ACE54EBC3B59734089BD90782098B493518 +132: 3D6B803BAAB3DCB33FBF41C9A0A26AB4ABCF9B6130A1767FE8D92EA6 +133: E39B41308DE4E09EDF225ECD70773019DF360659C00788EDA15A3B09 +134: C061ECF6E38881252E65522B3244FD013700D4E0FEAB8FDBA5963C44 +135: B95387AFFDD9040046D28CC9B90CA83547C73F8AE774918FAF17112A +136: AB4D30FE79907AB6BF4153FF2E15ACFD3FA851C59918C6D1BDAFB8AA +137: ABE3E517600C412DF53B002CBCA6741DC1ECFBEA68B595EECEBDC2D3 +138: 1A5BEBAE3CF1B4C02C8B8A177801AEBBF11D194B5ED274BFFD2B0E70 +139: F87D97F5BA0D6D6C5BA279D5A803DA48E38981594517D03DDF0667AA +140: 98C4579B3C3FB17BA3A9693B6CC38184E66C6CDE8CE6B572B9DA27E0 +141: E08A209E340A496289C67BFD38EE96A84FCFA4413B3B545AE847D8E9 +142: 8AB4CFBA58F12EFF33B19D57DF495591983C39FF014DFDADEDB12837 +143: 3A85A696BC2E82456C682ADCEA5B2BEEB0A11E9FCC363D9C25124ADC +144: CF6E901A2A18C002E75E535B34812AB027E32384EA0271CA6ADFD07D +145: 1FFE5D64C7D229344ED0FFCD0FC1F87ED80F097A5F16F27E89BE2414 +146: FB238E7E0F64DAB7101050E2A594C12AF572DDA5FB5DDCF0A81EF7C8 +147: 413F330049C3A309E746A6B6D24BF40CA430D107A18227AE7BB60165 +148: CDDA7B929096FCE42B07E19C72913BF37569C75FC5183419E0FB070E +149: 07F9A28D87B98482C0053E187881D02FB15ACC321ABA51B9ED5D1F4E +150: 666CC5B7FCB82C1CA6582309CC4CFF989D4316101003CEA5897254E3 +151: CE161DD7D8AC4DD45EF0F511EA206F5D78539314C4B44A7A4F4A403E +152: 5AD4DA1DE62D6B012259C3FE1573E2F6BAB8CEC85FB6AF4CCD1B4EED +153: E9E64E30A48783FEBFDD8347837B52CE7D5287E5FA4B7A3F7F66C013 +154: DB14B1F354735C9DDF4230C844D5E184D6BDA7FB8C8E0623A4416590 +155: B394B4D91411B38C4BC98DE63940CF6393E19EC229F4767D130E1F03 +156: 904369E594C39ED6A32DBCF5D3743FD31992430BBF126CBE2E8E5788 +157: 221533E80E5B43D2F817283CB611EA92E02A1A6B31B26F1F9B5F2DC3 +158: A16564159AE18130B912A694F8311BC6F769837A5E07E46622375228 +159: C7462633CBA1DAA4C0827EDDF9632A4FABA2DC07ED45668A2D012174 +160: A002A7A6A4F75840A5A94610E7CFD2E9CE165E5F5177EC20E2211C07 +161: E12C0157BD545EBD67B907954E3A25D95A42A5626E6665BD1285AEEF +162: 0B8F3327D09BEDFFBFBAAB6D863510F7D54A81791C4DD66B7C5FACBB +163: 0BD97B63D7D8F0A4B90330A5A00444CC3941292138F2CA6BBA76CC8E +164: 5E1209A29CFF68B4DB004D0C7CDE223A0E8801C25AF560ADBBE2F27D +165: 4D458E8F2F68B901C13EE4AF463141617DC1D0D8E62F6991C6A07658 +166: 174C92CE40F01DA75C57DBEBE8114997D2B931F2B1E94BE5D99E987E +167: BB9D18ADAC9261895FCC5D1D209742EBCE546C3F68918AF614BB80D3 +168: 85A49A9C7034746587671B8DDF543CB9358C2FE4C75DDF332BC695D0 +169: 5D618C15A9044D6E5D461F8FD0896020ADE117E8DB7270E602C86B3B +170: 8B9723D842504419E29EB9F8B222D3C5C1D8D90FC02E4930FE1729AF +171: FAB6F7BC8105A9E107A5FF6CB408616197A5EC8FC8DCAD975A628CAD +172: 2D66807292855E8D11BAFD680D59BAA5B9E6D8BD360D6086CE12EA95 +173: 1F2936B3C91E9A3C17C11091DA7D4D42581CC3D9EE9192497FC3CD18 +174: 337575215CB0B37A843063867FE6AA322222F8B0F096FFAE69E385F9 +175: 002EDCA2423B16D8A84DD7B01CDF53C330A16A58A03B74D906D6EF62 +176: 37B20A60AAF4FEA526B217BE0DDDFB8CF8880ABBE5E444432B579003 +177: 975D4F979EAC80F42F7CD3789C0A18057AB0593BB78626A52B15BB8C +178: D1D7C4A4ABEC252B300560D3B95F2A8747B2B554F19542FF44B9AE9F +179: D4B36857F9DFC1F6A530767E9AE20C18123789C81CDCA6413AF990D0 +180: 853181CA65B54A26F0090111266FAB58A9F0B80DB49F89B284661A80 +181: 003337BDB25A835BD9A7141A6A35924CB47A0C404F79E9E5C1454AE1 +182: 55DE6261871747A96075A5FF81B17C65054B923FEEADACBC62DEBF99 +183: 3BB872FF69DD7B319FC39E2D6ADCAA724751339AA98EAD9B63E31C7F +184: 72BAE6681B59CC556D50204FC7A4B286E95DECF54E699C35C4C1E46B +185: F87A12A8A2C62C34126544DF55ED1C299A835AEBA148AA79D29433D3 +186: 4FE245B12D8312645AFD30E764061DF8C95E80244ADAE3853CBAC5E9 +187: ED824E6CB63CD58B9FD9C5DA0DE419AAE4AFA07D356C6D594E6C7602 +188: 5684C0B9736B43B25FEE8F75E24EF479AA28C4EDF8D3F8EC3EC1B18A +189: 516F0991FC66A910B24AC719E31EEE08972E430A08EC3E487520E6A8 +190: 02F935F3979AC59B7179F8F149B39526D9203333678E37CCBFA81AF7 +191: 487E604E36E13BCE0145C659C2018935E706AA910A4DF2F248E94AE4 +192: D3E164E063FB6FFB4F0210D91CDFCF9C1E73990D36EE98169C12C566 +193: A9ACEF6A6203186CB946133A9EE86F414937DC81B1E95EF4FFB8F6D6 +194: DCDD529CC2B0DDBAC1AA5C5581E39E129B73A3DDE04403358310544A +195: E8C8A1557D51C2B0F7E7ADFD65DB10B751E1C66400FA56C72E632EC3 +196: DDD60F8795A5C74AE07F4BDF7CF8C1EA7F617978F0D12EF2783E06AA +197: 7C13B11A3BA5A3C74BA9FDF6F10F14D1822A248E823BCE8248610433 +198: F9AC0A30F4394E8C8D07F10F03DEEFDDDDA27C1DF74B80300B1FCBCF +199: C2022C77451889454208B56284CC50CCB4126D0E44EBB3C8FE6D857A +200: 45455AC9539E497062D4D0023CB5591AF4ACED509E2465C2DA57B466 +201: 41983FDFA1EA3C3956940C1704827605AFCB16CA89EE83F4BEC0407F +202: 0B8BA25FF9E897D29F545A367453A35E86457E8C84FF4067AB3FB26A +203: 754AB63712BBE28A7BBE70E4C3071A09E13EE3D4EFF11E3EFADE3177 +204: 6026F011FB67B4C00CC20C4415AA0095E4DCED5B5BEA7EB3E3602144 +205: CBB7AAC645A32503574225E6707C28C99E35B88DE840117FFC0915EE +206: 954451525EE5B1B66B5FB3C5F087ECB9B194073804474F7CF01C4057 +207: 0357EB8AB9026850FEA61551A5487DB50245143312837BED6FE66C60 +208: 1D6CF1413CCEBC8E408888624854E7CB335EB97816E39E6BCDFEB35F +209: 6D1D954AC353DB3F79E163AC4B56776881AB10CC659A01BEFCA695CA +210: 7FDC69BDDF3C6E430EEFA3DE553BF51FD440EF85DDD34A2A49DCEC11 +211: 8703C4A16397D2E70E4E26FE49456F1EC0902AE2C02045980E8B8869 +212: 3289D50B0C47E66061711E63C249C87B364741B62DAD2320F551E13C +213: 56DB3E8CCB6000AF46A0C1219E5E56FD26A3BE542D05F2BA2901526E +214: E0B7236D6E547C20962D3E95E62006E536220CA828F96AF51D8BAE37 +215: CE3BF25BF54317D8F30D9937B14CF817A8EF6666F0C5DC88A08EEF2F +216: EB421F51CEB230081C16CD4E33DDC5472C6A0B35C623AC47734E203B +217: 7C696551EF2E84C27504678BFBF530CE978302E0B8CBF41404CAF902 +218: D96CF6D20FC6288923541976A80FAB2CBC634376A02B6A681C3E7F27 +219: A2C6217991958BB799751E34CCDBCF9E492D4623F9BFE0B791B9B0C8 +220: FC6B5B15F2AF1C3CD1B9C3C1D08DFD12E4B852217CDDE4E19DA54565 +221: 553B8F6031057F7D2B7854AC04E55D6201B15FC3540AC32B54434B11 +222: 67B0B63C5D6C16E86E19BCBDA02821B96890CBFD662B9AC796F58602 +223: CE68A9C14D4F6A0D4351FC3D1E46F323DB4EC7DCAE0E59D726246913 +224: FDB91DED054711B9DB1A93CF852650BAE3EB08B158B189D241903A5E +225: FBA7CFD46FD05633D8B5C0D9F5DA6D42A881E493054B032728FB6861 +226: A1E4C1644E91993B281A82515422B2449F364ED8E3AD3A54B37CD874 +227: CC9157FFC6FDC62AD86D826FDE2DC78BE93469B21AD7D1ECCD37B6D5 +228: 93A505763CA81F90D1D8C366D63DC9317DDE8EEE264F3700421820B8 +229: 46D41897B31707443AB817F55797FF8CB52ED791340244B3713C2D6F +230: E7928E3AFE6416915E697E356D885AA7A33D43D4766BA920405BEE75 +231: 967265670BFEEAF3B188FBD501A7AEDD79F8CE24B65538A56A6D053F +232: 7E549C75FBA3B16E0BA6C3BE6E3CAA9F5C45A78DDE6CC5E1EE90D853 +233: 9A795A0F33C4D7FCFA58249D36DF648DE3BEE61ACAA2131371B131A1 +234: 9BF0F8A0A2919F1A52B39672DFF3405FE59138051E67E0D7609C3FEE +235: 6ACAF1122C142526B46EAE5B859BE5D62CE7E54C6991EBE6EF0E0934 +236: F179211E88FB303D8A074019664F5009BFBD1DC86EE34F1582C1C72C +237: D335C48021FB0585DB327D67FB12554C65E4755B466476D3E10E10AE +238: DF08D65DD48136B07E0E7F5B6C39E1B10FE95212C3DF0CA10E00F53D +239: 5F3FD8A5A4EF847D833B2FAAA74A30FE51D22C68244298A25302B7ED +240: 181DBAE9308B111D4AE06A6229D6038C4AFFFB93A0EAFDA9CF1E83AA +241: 671D5CE9A1DBFFB15B4449CDE3DD91569F875D4BDF427E0B42DE0974 +242: 799583432083CEC377826EEA43B35F5CB5261D091F2BEC4B2EF2DA54 +243: 574DF003B08BDC906325FE2160907347104E664645BD4A9AA16FF74A +244: C8B29DDD1610D96D26F213FF883CEA12EBF19C943EB50BEB895A89F6 +245: 2C57878E2CF8C2FF0FD014392C843341D78FF741489D672285FBC5CF +246: 56B4B8AEFEA02BE5BBFD3D032C71BCFB8CE204B4CA89E22919E11B5E +247: DC5172956E9A8C86E4CC6F2B13D8BC600BCAFDC673842AEA711589D1 +248: 2B762DAD2B6591F4E60BECFC43214EF34D5D435A3DF85E091B30A47D +249: 1DF0613C3E109CD3716BE1D8D7C326FB4837AFAFCB36A6C8DCE14E70 +250: 543DA47D5E9462DEF4AF0118D4B69869E7ECB7AAA6F3E2039E1FE8E4 +251: 0872386B43F3AE3D652EA4575F7F91329413E6A67C16B419FF6E3CE0 +252: AA50752B4CD3D84C98E6883422C15D75AAA99EDE7DE3F81F754897AA +253: 367174DB2317D0E294D768BBCE69F60BBAEAEDAF755C5B2B03F76285 +254: 34ED7159891BBCEC9DF0D24C50F6209B8ED3E5380A34CE0C68C621CC +255: 9E31B671E498E8160BA558AAFACD05DEFD252B2C7D8BA8E9E618FBF1 +256: F8B6E6398B49C87678A1A3235C078D8DB93FF50271D6EA36647F7F00 + +Hash: sha512-256 + 0: C672B8D1EF56ED28AB87C3622C5114069BDD3AD7B8F9737498D0C01ECEF0967A + 1: 10BAAD1713566AC2333467BDDB0597DEC9066120DD72AC2DCB8394221DCBE43D + 2: 2E753E709156F4820A27D9CEB7908D180DD0AF1793D37130379C5FF9C9345F4C + 3: DACA0762A6678E4E26CB8A893D71D72CF3239E29CC837629590B84625DEC14AF + 4: 6DC06B8AE0CB304B1808731BD5E77B0BEFEC809F6E02379623EE0F00C10B6586 + 5: F48B764B5D6EFE72FCC9C113668A8AD8837D9245832948CDA1E77743C9C501BC + 6: A697459F59F222B055E111E791211DA13A050EE577711B4EFF2AEB7B2A6E7BA0 + 7: 39783BC9E859E0982346A792CF315BF81B492E25A12E279EE845BA6BD14435DD + 8: 20971D26D0FB904D66029DEA021A24BF8BA096493561EF86A3F75E84D3091406 + 9: A42515266DCA56240A7E09683880C0ED5AEE04221D7DFC635107A2762864706F + 10: 5F9310E9D1D72BDFD98FD0F3F442F316E5107B46FBC67E162350756B061DDBD5 + 11: C19109201CE9314D5BF1873B9B98185B0F742DEB8D6D2AFD526B8095371A752E + 12: 0A850EF082ABECF9899A6E6C5701649C7A4C41584105315C1BC0628A0F736BE6 + 13: 0EC705FB202BE5AB4CD22A5BB60142EB33A4C4F0E4DA11F3E7CD2A76BA109704 + 14: 3C33C4E6DAFB97D45F403BC662F76B5505365218FC63F23FA49772219CFDC806 + 15: 7A9A6B0575546936A59DDEBA71D76FF145478076906EFD5E0D4129901102F526 + 16: 4725E7C23DD68B8B2D722F2D370F4340D13A0AF42BF574F741AB8A89FABA6CA6 + 17: 29EBFBB5E153E98CE0FFFF83F39590685207BEEA613746496C75D984FEDE6A43 + 18: 81ED8980C1D6623A2A14C07898D0AAB69A5E89CDFE756439BF544F12CBAAB96D + 19: B08B0DE05F73D0BB40F152556ACB7413DCE4CAC59C57F95FA30F5574F5A01EDB + 20: F2C93A59085DFA0E71D7E962FAE74C8B643867F8799D16C1413225AD4CEE2F49 + 21: D35E6DC12DE337F89840A707838BE9D5CE13C839A85F8D82F92CFF2FBCF28B37 + 22: 55511CA658E7001FF7BBC193AA94006917D41996D8D0597280DAA155AB2AAD76 + 23: 925619C01E78B771F68401E5BB1ED1FFA698AC541FB88AABD7DE53973E20BF0D + 24: A2572A13D58039EAA827086B83092D235510025B3E96E214DC848B42488C46A9 + 25: F7C0B4561BE28A8BA941BCC03E7E004D6479234AFF2FB7D5CA2B48F059D1A16C + 26: 34D424317805ABFE78585C9F1C1AC0A29F1DC899D0BE57338167FF9F9B473AE5 + 27: 27BD8B29EC37CA761B9A51003F5DEE9767F7FE8155113C39796C379058624D36 + 28: 17CE5B8FDE3BE708F1AA0620998FD7CBF9173283D5432C3B4AA0213D466B544D + 29: 3A8EE8804B61227C32240859188830215D61D8179DBD4789EEBDB94781DC91BA + 30: B4A6473F90CA2E87FB330996A826916374515ADF7B7BB81334007D05DDD2B00A + 31: 82B7DF49A1D7BDB09CF1183372122339CF3FC28EF9743B98FD193609297313A8 + 32: B1915EAE84B12616CE51D7E259B7AEC3798D427A735BB13226D07119F651E981 + 33: F0DAD0EDF6A7C761E9A4EB3C8C22CBDD7F82F391B74F929DF0AD7A73D39C4491 + 34: 35CADAD79D50C2A3BB0D5D86727A3BE9E6093A2BF8CCEB0BBEDA3023F7BFA1F5 + 35: 73F5C99BA298515D9407E042C2A544907FEEC14722D22BC51A0D2D19750265BF + 36: 40FF68F9B5E4D61CA671AEF51B9972713A324E9852AA733FAFD03E0A1E7A2483 + 37: 43F79EC5D92316181F4671B464B5069F68FCCC5D87031D273A47C6E3BADB2F09 + 38: A6A8BD5CE9C76B21443C0A076ED0E059B50981A540F37586AA41BFBFA6EAF449 + 39: 161CE872D1771C378CA7208E8990776B88EE4C5B7DF327D7B68C5781A677A2FA + 40: CAB370E6ACC494A41655B487848528AFB55D884FAC6A404775FB5D4C305552C9 + 41: 6224B54ECA83BF2517E862CCEDA851D78E3BE0C9BED185B8195D0EBC85449C48 + 42: 42DA7812A177FDDABFB5EF5705542AAC732B2C9B8D7349F4150704BC5186948C + 43: 5C51E81BE0EC3817465E968AA07F049BFF7CF7A67B1D355E1E254EDFDA222F71 + 44: 9A18455A2460C62F4436E27CB08B385ECDFC3451AAC79E27A62B2A6A8EE00358 + 45: EC5A90362A75A517EB65D7120C05194E643378E6DC259B5009C6E7279C23B8E1 + 46: CA5F388E039F5E0E74158E959B0282B266AB4C8DD81223031882524297402D7F + 47: D20DCA54AE6FB42A967FF2A9AE686335A3C2262A1FA4F3E219487131D645DB0C + 48: 2D3D934745D397067D63F0B05DECB78D5392E08904D5ACC8287B0CDB697E191E + 49: AE4279312B901FB98AB0F83730EBEB0C30ECDA2E1D1AAAB62008BA5384A30BFA + 50: AC308FA5DCF85624EA186DE4081B3BF0B9EB754F8C938E992668263A87AC03BD + 51: 99EE8024BA8C355AB416B7DF162910975246F61323061EEA67ECC9C1A000FD2D + 52: 7773B4CE08E9DF85FB0B138F99A76ED421668ED19D0EF9766C5252BF9AFCE4A3 + 53: 72B6D710DECDF097D4F7FBD42DD9B9E5595D97C81D436DBA2FEC96D0D720A992 + 54: ACD22160D881277F0010D2575AE3667B0B17099E65FE34CCA75D576A721E53D7 + 55: 7DD58A7C3285D6436F4B8876A4E3CE63BAE92A11A5453C46A6032C5E469BF40C + 56: C06D2D4F6D22414491B36E215DE341782922EC36900CFCA39F4A707A5379F51A + 57: 9B0810A0330E06AF78DC08CA491BD248FE6E36A1E89FF7B9BF65AAC9E760580F + 58: E97AD0EC164712E8103CEEADFC6CD3F71F0940351617D39726EA5EF512A75E87 + 59: 79322D79A95B60F46F2EA43F94378C59B661E433B4BBD3595734586FD354E93E + 60: B5254E8E1E349B60040C76F6FE3BF9B81FC83F3B4249F5FC020D1BD182C1F818 + 61: 9B7A90CDEB29791070A3C22B14DCB04554A802A5A441EBD0A553D2C71464CB6D + 62: D0919ABDA514C7F246DDC9E6F104D61CC7B57336E3E8A658D9DE814994207B36 + 63: 53B53EC7C0D980B7980C16A40D3F7FF83C1038D0300B7313584DE5A5EAE4497A + 64: C9E483B9622515E83259E1E075746B70142CB1217863FB8C85FAE33256F4188A + 65: 9A1983429845A7FCF3191B15EDFCB8A068200DE6224FDE6791DA4C97FA6258DF + 66: 17D3846C20485DAFE0C807D0EECF5AC19A1D7DFE5EB27D569DF16CBEA52E981A + 67: 79B96A06D61A8C08B9E3A2053A3D990963E1D4CBF7CCF3160E474A3528F5CB2B + 68: 58482B747195814BE99F0ED34AF9AA171184FC2596BB147142A7863FD18D2B33 + 69: D5B79F2B49B6B50DD99AB886A3597913C561CB0ED370DCA6FDF3A3FA005709E4 + 70: F9CAB181A422478F977D5504F9BD824C30824AACE2A1D6B9F1F909841AAF9E12 + 71: DFD1598FD7C9BEB3C4653DEA2D4B480C87E33A7D0CEB1D97DEB4C5963DF53D16 + 72: 400F5322C0FF43DC5200620BC37FF4A9E24AEE56133CF7EBD145A39EC251A2FD + 73: 742E35F513B7C9728D99A11E92371D8BA6E896FEAC9D8A0D39E4495CC256D927 + 74: AAB4949E557839802A695377680D05503AC6D3CD75DB9C1F8E8A9EAB38073191 + 75: 5CB8F1894FD53479E32A37807EA634DE2E40B27D010D0EFB51A9D72056AABEEF + 76: BADBE2E21FA08388E3D8370CE52C4B238FF609467A210B55E85A294EA8A742C8 + 77: F5A95E8A2DB33C41E27C6311C38072855A449A46764CB06E83E2009F55A99690 + 78: C4F85961E3573BAA0D7A641C54FD823E1CB14AD0A80EB39EC51520C3811971B2 + 79: E5EDCEA3EF14F62971F2A7AF9844BA087FB1B788A71D45B2F742DAFEA4BB1995 + 80: EF2C5202301B45464FBBB20B620E1DA64DD3BCFC9CF70C4730034E3454FAF167 + 81: 7B634D4FC438A677BD4E870F6B032FFB560BF0B8C3DD725D9E8EDEEC215EC548 + 82: 83A722BED1883050623713ECB5579582798F2DC57E005B71260C524477EE202E + 83: 8EB021C8C8AA70F7C4AD48870014CC7C1E145584440CD43588908532C92B7BFD + 84: 6022BC8D846AF68A4657F2D6BE72DCF61B1CE43383D23444B95B2AAF145A7079 + 85: 47547F2B77898B1DB71CC4565ABFE511DDF9B965FAF8FE522B346D5B236B692F + 86: 5BA80C644AFAB98CEB9C006077DA110E52CC63C341F0941228A5992BE8D1DD65 + 87: A6B25F4E9F3AC57169CE0382D90B01F4DCC0F8C32C27ACA4A2F7907A013D33FD + 88: D851BD49FB420914B48EE013820E1C687063280292FC3DB19BA1736DD6DAF398 + 89: 5B975A34E73FF6566C891DED0CB8C7DE4AFF692BAA0927242098EBE7DB3C9D89 + 90: F2C574E2D8CBB04A7D40E5C3D135667B1C87876D0D2D6BBB60D4DD7C5685E9BC + 91: 1B337E6A77B5A12F75E971300C3D45A58B3C03C7185F2A3483B5A96CBAC4DCAB + 92: 4AF936D81988008315F97C57198E004E005C397F5AF713B4DE91C362ADEEEA27 + 93: 723108E510BB95B6B81096E9ADD1F4172746B11EE25B20EC0D7024EDA98FAFF7 + 94: 441B54654FCA74D21B181EE09949FFD08467FDB46809F5483DCB4A22155C19ED + 95: 0526880DE16DF38A3694017D726C488BA91A367987668D37A941B302127F9EBB + 96: C4242192953036ABE19D07719D2F1CBB8FF0088753D25C58632C9E2C600F5600 + 97: 1FD87DA597469DBDBD93D81DA9FB3678EE01B6B5E897BED5DEC5B17A077040BA + 98: D77403931FFF61B28384CDFC3A9857272D3452633B9ACEF703B668E564487E3C + 99: 19488ADA94F1C4CEABBE07C407BFD59A5F52E4F8EE964CBA6442636DFF12C925 +100: 1E6871799BDF2B3937F8458D124C4AE55AE5B4298EF6A83B8763070F4E2A0F3F +101: B3529A093CAE29DF5E4EECE729AE053FBF4579276DE2F90859C57D9579FAF6D5 +102: 7EA44D126CB99EEB4F985709BAF62015AA9802442D9D352D21FC75ED23450F54 +103: B52563C175057965565F8F6345282F5048846CBCB4DC920664CBEC585AED5DF4 +104: C2282AC6771F2651161B09D48DEF64CC305ABC98644C6F670D2F0E210FC9D16F +105: 54491B482182FC0C0D7B3B684AD8AB29166D007DCA103F0B2459E6834FFBDD9E +106: 1B673FB33D5A8C78E5EE95B8D7DBB22689E6644CC3AFD634A65BA79EFB47DCD5 +107: BF844D58767FA5C221422E7E12A8D33B7E529E6FC54B71813099686ADAE01938 +108: DD48C0124465C585979B4D874EBF2D62A0DDA994FDA7B7DB7A54352B3C04D9AA +109: F9B4586DB8320E1A08293C5C362C0234BA5B897D9A24303FF15309E34712B89D +110: DBF58866CDC3A0F11EB0C8AF7908C4FEFD4C1D1C2D16EECE2EC67A72E3D599F1 +111: BD209F60B0D04102A09175297FD255367E54B5A5605B928635C606306914363F +112: 2CAFEB0882CC405167E9A255B8581A66DC683212474902DD453DBCA20A94E61A +113: 3222333BE019DC995E5DD1496D5859DDAA491E03E7DF81A659D5E74957BF3B53 +114: 2CB19434BCBEDB42C79311C0F54AEDE574CD7541897075031D3A5061EAB75E84 +115: 544468938A91832E1491727D68C4D882E45E4C53CF2E94D6FA972D97B9383B66 +116: 7EC78AAB48E24164F2F4BFE5C98449A864C21E6548866A921DBB41C1E56338AD +117: 291D160ECEC8BB0A7555FDCE7BC0310066950B168CD6222F70B28F1EA2781D77 +118: 0EA887F7B2FF29215486DCFFB6336FAD698DFDE84FAAA7819C3229025760309F +119: 6FDCC1A442CC8391D7DD5A0DB6601EFAEE9A4954056C78A64038C36BF7ACB368 +120: BE74A90ABBC2EA03FF56DEDAE4EDA154BA6CF24D73A515903356283B653F5109 +121: ABECAF3391F6ED54820DEDD40221A6A2D034632B5CFD99F0E415F2D0C487C2B9 +122: 1B62C738AD0890B7EF86253EEA5BA612F65F9C106A04EF7F8F8D0DA2BDE1A436 +123: ED19094777D33AF6FBBF59170E3299CFFA2C7CEAA394B639DEE7E6691F7F23B2 +124: 715DE0E8C09E5FDE6BDA64971E9992A11A229DC1EBA3DBECA89CF1DA76757F39 +125: 3B963901747A3256269D07A476E4E3E6C74CEF45AEDCA3EF39897A3E83307C52 +126: 1DBB2537F9D1C789D59B43C188F0148C4FF00E4545F15EEF5FCFDB5B9C771A9D +127: C26BC7E9315E62AB0DC6AEB577724D07C09B0C6FDFC0A9F08D8548047C032248 +128: 2FF11194B2AEC1F943CB5F130BA647C151334068083194D7281A55D607AE255F +129: C4A3BBF841ED2A289E5109FB392229C80DB61C72FD92079B5A4F0441F095A111 +130: E9ED1482130F49D78F1FDDEEB30C8A8E255F917DAAE9553907E95B8242554C4E +131: 662F168860670C947B0954E99DFAFAABE57CEFE784D4852BD8B2F8F0118A2D6F +132: A492C90A1674016E0A2A4D47A9090C0BB496DAA57B57405E34BED2A596AC5D08 +133: 5B468AF710143DD99336EBE35CEC44D47281147F117A061279AC60A238FDF0F4 +134: C84140048F97A2B07831BC654821B316A1286A04CECEECCC172F0CA0039A886E +135: 9D4C1DAF06FC13D4E6AA4439AF56591E86302F5468ED2FD83DF5DCEC3EB5B741 +136: 744B6DED6880EA488FA1D63D52F1E5A49A8340A706C49AD81C017988AF20D2A0 +137: 89CB7DA333B0FDE45AE45950667A550E47EA40EE5E90F24CD76E0EEF8C524C4F +138: 7ED320CC648E71F703645E24DCC138CCD709B2CC301C2DB5C3AE5A12DC7D42B9 +139: 5AFAD9784B470924013641DE8B3D022C181BCD54D809F0A64FEDB2C4568997A6 +140: E503143A958D963BF71095D20C61DE3344017A745654EFD640C89FE5E07A1B70 +141: E332887A707F2A38BF12301B029A5D6472962D937C4056844E3224EC80D57B67 +142: EA6D40311804EB72D7B28C81FEDB6F926B7232AC8C66811AD1382A8BD4C4F840 +143: C83F8EA193498359183EB8A66958348E5DCBFCFADBAADD28C7020238BBC0B339 +144: 449043A396B3A48EB3467612981A8E666D60DDE6691A54CEED7ACB0E6E901CA3 +145: 978BA98ABD7DA915CB82FFD68E6C72EE336160809A9C98D0B73F6D4A5A2D539B +146: B7FE297A5A8EEF8BC273F104D7EAB6A346773BAA0C83BE78CEA1073EE6B3B611 +147: 3CD2AC21566B717D67B7CC2AC13F7883C2F05D6871F0A59FA2BE8DB5A11391EE +148: 276C34FD66A673BEB30E90B37ADD5EB27D8C07A61D7BACAB8B948B2650A97AD6 +149: ADC4756A2C775692463B9E25D3DDBE7679355F1CD7C0A63CC5B880C9EACC3763 +150: 251CFFD321CF37D9B80090EC1AE296A450B05B8DD151D60BA1C9CD63E0C5EDCA +151: 50550008EBBB5C82F774B0C6F2BA1E10CE411F44B67475515D7D515741A1FF19 +152: 7EF41372147DC56403B8EDDE2927CF7ED9C2AC755D24CFBB3A792F02A7E1E9B9 +153: 29BA190962830BE08A9D26DBD06B39F4098DFBAF63689FB732047C3EFA4227FE +154: 69943757A8848DCCF71ACEE24030DB8BF32A4C5799EA0188BDEA6F85915E530A +155: CFB235AA688E22CB7082C938A4C1FF0AC8D2F0888058A6B783EBFE538D36C439 +156: 9FA588A94CAFB1B9253AF2B2043BEE45B11C22F25939AEBA723B18C8B523155B +157: D5826F6F131A682F6E6C3EC66F00C451DE9976A74221F031E6541F9ED96E649D +158: B7586F758A8D392648F8FAEB8AC1769632F812512D07DEC1B8AC4110EF932028 +159: 7EBBE53085A0ECF3319884CE0DB4F8EC76473783E1AB2FFA953F25C6E1E76A20 +160: B301C3CC815CD2366E0B31074EBC06119400FDB8935B713CA6A44507AB88AD3F +161: E45D33110C77AB146E69D214CFC29B8521027F318A20A617D0F17D90E598F6A5 +162: 5CD02E62E506B8BD6D00BC2A7D4CE8FCE52103B7F2C3AF0A85D1FEE52D736C97 +163: C5F15519B2A71222265DA310E521CAEB50CABB221E3BCD6766D0037EBE76838C +164: 8F619377F20A94158D0ABEAA076FC591F44B1DC917524CDFA6E8A46D56D677A8 +165: C80FDE1BCB0A393E5CB79C418565E1DA15B2520CFFBDBF9D8A078F1E3DA3051B +166: 145AA28DFD7C22E2146EDDA61582E59CDFB3461C034E21A7021DFE9A87EB4F02 +167: 87CB225B33F0D1E4342CCA75D0B6838F3B5E3639605DDB6C34ADFD1F000F3628 +168: 6723FA46D8E660D58DF08ABC7B8ECCA5687BDCFCDE075DD262F351033F29B3C9 +169: 318DE82AA52B2786D92DE178B3685664D17C081937803792CD8E58D15B0436E1 +170: 1829CD424106FDBFA4CB062AA7B55BD0933EFC9DE2FD1B3CE9513A213F76051B +171: 36E31B4B7CCBF484C4A1E5D169DE9F726E3846344D9C2D7FA0D09BFDB6C26DF2 +172: A67DDC415E7AC24088C728A0C90B5718965AD380790B937584F34ACE41EC599B +173: 408517C5E891A82958F1FB2357AD46668ADBE9C9A62497E625FA99DBC9B39DD5 +174: F78CD14A1F44BCCB28D054965946DCE4EC830AEB10DB7D57453B0096354C764B +175: E7E19357A66DFAF638014FA2F68F97A61774391C0DE6D44BC8B04FD73A074194 +176: 2F43764BB6DE5F371DE70D5D321422D139E68036CCF4BEF548CEB24DD0E8F7F2 +177: 842FAD62A0B5A057DD95D8A18EBBB38DDB94E2D8BE8CBE8CB143035226F3D3DC +178: D2B5E100E50507A5CFA81D82B1675B346CD472192E781B2AF427404D6CB7DB27 +179: 05480D17248024985EBE22CBC9BC4FECF680D1C98849A45EEF652692C85E5124 +180: 44866966D06C8FCDF4E07074E1309B9DA6C498C5F624FA71DA12EA90F5659994 +181: E66A0FBA1939B25E533EFB1DA1E509111B1B2F135E2B395DC7411F1C5983958F +182: 7CFDBA5EFC5EB2C562293BC1102F9CCFF778CAB78145A3D2BDCFD4C29C5F80D9 +183: CDF05F2A14BD01139E731C82E8821AA4094971C95CC6A08C7EB4643742A3B871 +184: 52F30234CC6F24B7637DEC71243AA70C3130BC74593AC6C794EB6D5AF563B11A +185: 7A7933C4B7ABFECB8D7D1FD331A15AF98512A3AD7D9D9C3F23BF99F189A1C78B +186: 85A9BB602894578AE83F18E1ADCB63EF6F9A3C13828BF212C751A285B30EBDEC +187: 9C4D7E27B201D6B4571F897C2AFB7E95075951CC96E31C01DC224BA904A6ACC1 +188: ABB898DE6B19F043D9481E69DD97069061916E05F3415DCFB5766847A923F9AB +189: 8CF262389D731135956603DE1429E35290478239163F17BE26D92852D5B3B612 +190: BA6D869CEE76015F45212B41613A567985D9C30D363E968948A07190841F3B5A +191: 5520437CFB0246D7279CA01AFF3C8B87A7B228309A0C0C64313BA54812DE6FD2 +192: F2CEE575D139DA5D0C49A888EC3A573F3D28496699FC0F3C82C69B2FF2CC8FD9 +193: 3256ADE32D4D17F167179A11BB42888A78B0F169E0F900406E2E6527F83410FA +194: 0430205B244020D13A4E99F927EDE6363E69CEAB486F899676F092FE100C8E26 +195: 6B6B0908E9C1FEE98B95AAE59BDA5EB6F2EF14EBB49747175F0224F16A7268D0 +196: 5CC244BB87F8B09058DEC56B3F92FDA0A5C5FFD375C45D4B2C6259D9E7341494 +197: 8505317F0760F36B40A6781DBF6095BEE4A4C3C207491107C2A8F76368578250 +198: C76F387DAE210C7FD030E591F35D735258882C72C847ABE2B7BD7E0B42A8A23F +199: 2AC2E952027767245AA4EAC553E531B3EFFE92582924FCB21D9E6E7E67054209 +200: E511AA65D4E53C0BB6065C9E1D2882248307FC4987E67FCA18D7E3C77017DF65 +201: EDF8F5A95B1A6F3FF8AB66E2C6A19A8AB40743A079E936510F40148AC735BF10 +202: 053AEC7A30D83DBE469D8F2681C13147F79FD0DD9F1A1A0BE497708451905D2D +203: 21433FBA9B1939EF2C4AFA26BEAE530E2025DA29EA0F6EA68C0BE12433517BC3 +204: 52ECFE9A21C46E99B5CD93BE95C823C5833BC31CAB438609418B4D7F9F8563CF +205: 95BD806F45711A55AEE76D774CD61EB525B6C0BF30204F4D8032E3551C986F42 +206: B3B55F8CC17DEE54BB1244FBB2F8CEC30442A5B40EA1841D365ADE811B2AA782 +207: E1BDBF67EB54ACE9E283DFF0F8483CFE372362EAB502439F960ABF5D67465300 +208: D47DB397436F5F0A2A7A2E8BE41AA9422E269B9ED7885D36143ABDC43DFD6700 +209: 7BB4C3B85AF25263FFE1D275E32874F7F1A9D1EF9D1D60FB4823D6BFA7E264A9 +210: C9C929BE3E43739965C7E0674BDD1C6EA72C50297747D3BF3AAD42DB47E2FF8E +211: 12E101B96C9CBB6FF3CAF705C6CBFB89FC23AA4C9677DC5ADEA067B6F0A07F93 +212: A01A6ED04C9AC88BD6B635DC1EA960F24A1861673C6C8AEFBFCF5F395E9DBB00 +213: F32769B2C875B9FF94BDBA4967D43E9A8FD057DB6E6C30AF73D193B7043CC71B +214: 9DFBABF53ADEA41DF013F7DE81E0CB3FB45460D0EA05A4A118F94734B5C46108 +215: C64F0999F72491D5D231934F61852D4A80515D8B433919BC428A97460CAC706C +216: 727F38B67AAC9F8769C6A6DC8FB5DDEE59EB1D72F151384A3EF84B0D002A95D7 +217: 2F3752B1856A41A771463FE86D33691FCE73658B4F4D0618267850175425FA57 +218: 4A98E1098631E00F4EF84982671723616230BEDEFE262F4B85529410A1610341 +219: 531C4689A799EFD30CE2A2D7E402DC4112662E2CBD09147550BAC74F9B710E4B +220: E9AAF8A14AEA7B7095B68DF1E63BF61ECF23DE3336CD949CD7009011E26875CC +221: 5D601683D4AA736661BC2AD3DB8EBCD805782733495A973F3952BA5CFA272A85 +222: A322AFFFCCF4EBFC1235A2DF3EF4037D3F88A002D221D2658A5A813A4499850C +223: EC30D001273482A2DC2D362CB5F6A33C2156E923E2B250CA385713D4C0B01D78 +224: 2A6ED14E53950B0CC3AE36C157829AB67D8968EC2313368FED1277EC96C20197 +225: 01090CA95E440A43638AF490BDDA94E1AEA7B043DECB75797E2CAC04F7DB0640 +226: A18334813457B25623E0C90CFE5B7FB78BB8F3B02BB3EF1E60F2B5C466FBC4BF +227: 3F89302B5AFB23AC66C5C55DE02880B66EC8559D67852B66E754A819835BE501 +228: 85B211803476C33B845FA83E88FA79185C197254A72A413EDC568D1F6849CC32 +229: 08A363B5C2637D0F22E6A252C850612D66156FF2786E3D467E8076722B49B95C +230: C100CD4D709925FCCA80E4D9A173C5607638182C174458208AFEFF23B4B3C206 +231: 373EA0C75488AED51804B6E6C1C80413C234C13FF75D19BCBAB9864EBB7C2C90 +232: AC1C350458F207DD58DFB3B7EA27EB66D677E57B090FB2AACE98C85B9536E7B3 +233: A16FF8306C0F4E7C98AA5D522874AD88C465D8E1A156A3D9D951886BEEB2C5E5 +234: A4BD343B59F5AB8851FA2BA52CDC0D66FAE5C0C17C108DC8F78C2524D2F92D53 +235: 3BCE52BA2BF56215AD45CC66AAFBC61E0A32EAD8B5C0B52CAF78B7F47BE118B0 +236: C6AA797F5D490128E8ECB7828EF565605D38DAC5D2532B87B98E01B82B590159 +237: 40F2369A8409A9E373AE61F39F98754419257B8D602E89BD6646145CCFDCDF7D +238: 72CB3D5F5474F0FD2AD89B5811A13F9FCA5AC514C850A19A27984BAFB571E0A1 +239: B81472D255D80182E196481E5866AA207761A152302A0237E242EB88C577A428 +240: 6CA13C55886B74A5CA2AC9782C4B9A49FE3AEEEFDFC0CEFC34984872FB4C54FD +241: 1A488E47268942A41B5733238286FB218AE45D4BD9B59B48E1C20478410943F6 +242: 98DD6E9B848D21D02947BD75B6D220C9AAAE20AF0597C50D70896B5F494ADCC1 +243: A8DAE0682E2A7A5A7D7BAC33F409D4A2377BB7454DA5B4708F37F7435B52687D +244: 21CCDC5EFF5BDD96C32D279D5134666F5B3B3E5AF86D0A56E1496DEBCE229D82 +245: 69F37D48186A4D243267D8DD064BFC54989177834A0FEACFBDF22160D6A8C2DC +246: CACD4179F2C2AA00207A70DB4B1397C2B0F278B5F926EB6A32EA349DACCB9CDC +247: D8D16C8EA78D7F3E047016273B4B145D82ADEFA1017B07D25B36CEACF5266B7C +248: 5AE8021E842AB071A0918438CFA7D1522581994D421838B61F53331E5832137C +249: E3872214CCEA7FA48B5B32FCDFEB5389E0AFE6C1F842CD47BCEBE52FCE5F3D4A +250: 153EFE4642407F27A595C3B78AB2535F34FFD7DA8200E81E3AF8027DE8F237C3 +251: 076410D63654626C4ADA16A8911918A203FE3345628D4237CB6EADEA67A8A070 +252: 031C022F234308A9AA5C9532ACF563F299F9A63D8353F294FD8C46D1BBD67D4A +253: 718E33A2A762F99E7F1146D5A3A1E96156593ECAD1878911EFEA11AD15B5FC12 +254: D0CFB8A40E130BC70905903D1EA8EFC7A1DD0DF7E35810472DFAB302C9480C44 +255: FD932614F375BF71420530A690CB16E52C08E99CFE741AC8436FCA8C8BFD5676 +256: 0837A11D994D5AA860D06917A8A0F63E3111B95633DEEB15EED9949376F37D36 + Hash: sha3_224 0: 6B4E03423667DBB73B6E15454F0EB1ABD4597F9A1B078E3F5B5A6BC7 1: BDD5167212D2DC69665F5A8875AB87F23D5CE7849132F56371A19096 @@ -2639,6 +3157,268 @@ Hash: rmd160 127: 2BE8E565E24A87171F0700ECAFA3C2942C97023E 128: 7C4D36070C1E1176B2960A1B0DD2319D547CF8EB +Hash: rmd256 + 0: 02BA4C4E5F8ECD1877FC52D64D30E37A2D9774FB1E5D026380AE0168E3C5522D + 1: 1D8ACF74B1E573CD18F674A656CBB42D2775F552C1DB4E53AAD13CA11BD6C7B2 + 2: F3F828573917AC450BADC76346959631AA2F95BBD81A11385E6F5ADA37CDBA72 + 3: 5F7E44B9139D312DF5D1BB993D18C81A4F0D4F3C838CEC281FB2705BB794BCE7 + 4: 85C61A4E83F6729898C7B314D5BAFDFF52A74E56D250F93CD5897D9784BAD6B9 + 5: A991B5F7AEA42AE89AEDE9388B36ADA18197FB01191BB6FD0CC60430CC28D14B + 6: 77A1FF436C780DBAEA30FCD6AD8CC5E885F906BA6C47E063306A4F55318E08F0 + 7: 444B048799BEC6B27F4610F84B39068C07887D08D2BEB86658D697FA6BDCA072 + 8: 590094FA91A424568DA2A36A59AD6278FAB52B1D3A6DB54F15101C6561521C47 + 9: 081CB429EEE586A5343067B92717F6B5A9848C418C9B401639C46C548335A9A9 + 10: 027E1BD9B94E8574EC015D61B89DC1CA4DE0C1F5FA2766FE3AF785106F41487C + 11: 8D04CF38DD51CBACEA243750F8D070354994F7CE7BEA0453B7FF5A775882C6D0 + 12: D216F5F19DF91D8F429F3E37B24870137CA103719ACDC0C8DEC38C84E7E632F5 + 13: 9F9DD490AE25CB5DE2AA5154BAFB77BA2275769ABEA7A67DCEF35D24FE9CCD33 + 14: 9457BD492CF1818BD1ED0E19A21B01C37610F7F8EC64580B5A9957E53ADB1040 + 15: BB66CEC86F7424A681EC72BCEDEC52A2094CEA413ED3EBFCC0B294BDC698668E + 16: C7A379F7F6C0A7E6CDB840659061DF3C16323979FC562D82455B56AEEB6EA300 + 17: 4E602340A2910B6CEE248D90574182184BE342097CF009C9D628197A8EA140C1 + 18: 0D1398C0B19C77C052E867F6E7CF807097466FF2510CDF113DF512DBED51D062 + 19: FD6D66506EAF6FCF8E2099B2933AB66E44508E7801BBCCEFE56FF5AF981AACA1 + 20: 97D651CDF20DB8AEC9C1521FECFC05E4B0F889FA9EB66EF1A871A5AE808C19C9 + 21: 6408DC8B2ADD72618AA428F75263E71B154544F67E760CF60AC55E4DD0D6F2D6 + 22: 911189A4A9AE158CE040BB42D943AE34446146ED6193110E7B1142D164BEAD80 + 23: D3C083CA2E210C4C2724597F32FA7B3DA19CA65C9871D683C4901C671EE1C642 + 24: 9A615D37A2D1371F556381FA0485DF637C22EEA2837F25477BB177D9DE869118 + 25: D910ECFF8056B3E394CBCF0B645B3008AAE92CCD547FA44A519CBF920D403B7F + 26: 1A87170F5A18669EB41E69CAB585FA327B1CAA37300C5CA78F5E39C51627C402 + 27: 4D12DDC6142978448CD7B5381BFD8FDC847AD1E80510C3115BF13BBC6603CAB1 + 28: 22ADE8ECB7F3CB38A902FEAEF0BEC86842D87AB8239A366C992D3A528518B48B + 29: 9F44A733B43134FB6414E974B5CFA51F030AE7E3D88FA87811FCBA68963DE6DD + 30: 220E600CE4D7B7B6E55942503A92A5BB5A465089FF714FC2396844D8F82D9DEE + 31: 66452A4168710FDB3324159BCD216621D68C8226A2C72EF532D99AA32F3510BB + 32: 0961108443DB15095E5B77B907A71152171A1A38DE987F48FB692B63E6F8366A + 33: F03CE07C4A208AEB939C525756898ECF0112931B941DFB9D10DB9CF1677016DD + 34: 4F5237018B528C16E7E3557B5DAB9C0B2CF9ECF2AB5D4AFC7364034096EA1EAD + 35: 31DE8243507EE06F570517D356BBA08144519FF02BC192ED6C5B72BEE636D242 + 36: DFBF28278232BF83ECF5655B3A98A295606B36D50623D87309A9E41F38F07DC8 + 37: A672BF18447A7B38A8070D81E20137D17D1B6F12EF7807EC2B502F26B2FDFD88 + 38: 08BA1B06319AF152118617949424DD56D8A5B25B3CD548762C885BF3F0B5B804 + 39: 4414D6FD839FA2F59B7191CEC9D64C638C4FFA68B5ACE58397BF9F5E03452D1E + 40: DC4689B0403652290006DC4616A2CD910C9D0CCBC9C3FDED752EDDD5E8B30CAC + 41: 65E220527C2E30668BE29950094D32958526FE61282719E755B77A9D0964F62D + 42: 1D9C633609BD66C9D79BD6D15F92A855389F2AC86746521E867D4CEC477FD8D4 + 43: BB1580974F0DFC2C43DD5AC6574476247AFC77C7659619D3ACCBF82F7B02DA67 + 44: 20EA480E09BF0DB5005719FAC0D6418704E94F8A36DC5D035FD0B0F33B1EC31A + 45: 430FE91156DD28552E37F2608CFF0EB966C6320EB402FE4BDE0EC10F280FC9FD + 46: A83A95DAFE6FE47DBD1AE9A730D62D791853A66EDECE3CD3A5D79D5EA2E852CC + 47: 94EC24274FA110FBE2FBF01EE05B6A41F7FDABB284D422DF0AD97B8878544DE8 + 48: 5A311B318E82E776228D5A31306647AE14658499B6B1F678AC68D6AC7A794C79 + 49: EECD9C706520AF15E960CCD22513F985861A7243A7DC93106E968652ACE5E577 + 50: B1841ACE57E67FEEE2E0B6EF269074B367FD65944C9A05F4637C7D44503EF88D + 51: 2D6B88A5FF09116C87CDE17BE3AEAF6A587474089EF1034298DC6BE800320FAF + 52: ADCE72E8A1066B4C73CF42431EE141B611682528A7730ACEDE6503D3FF3AE0A8 + 53: 8A8C37E1747D1BC9EFF92EF59FAA6B734C62EB78C2B3DB43F93CD97F8BE41887 + 54: 816617922335B1E5C12B92954B0463ACE6F5537B2033C9A51F0359A137849689 + 55: A7E0D9BFB62FB1E4A88F127F0664CE655B363DF17910783643A5F790EBA43F1B + 56: F961DBA8C62FA522B19FB6A376D2E2D3071E8C71E899708E4763879A369A1186 + 57: A8E7CD5B63463A2E58382B76D0D3E0188EA0D3D1AAC5965ECA6B2C746D751B59 + 58: 98FAE21943227464F26767A74F725FB35DD81E599D8B34625770A140497F9B27 + 59: 550DADC0C1FAB6C6F1F304BAAF9A43AC3C3E7A713FA5AC413556278DD91196D5 + 60: 1092B070AC7D87C2E373B34C93EC3FC58DAC222A19CE62F5F2EAC8E0F374915F + 61: DA8D53A8D17E1D4EA20EAC427E1F0BC3E3D71ADE1E15D1FE8862F2EB41CE499A + 62: 029247B7BF14EA7816155149753FB10DE170A22A050B91A03C1321827BDA1629 + 63: 0162A083B666069A0FAD1C3336B994D72026E8AB433045523366BCA9CE07325C + 64: F4FFF1BBD2086BBE13A46A8F281CBCC725D882BB783A8B2FBADE2EC969D4343D + 65: 0A8E1887EE60CD0DE01C34BE1B0C3ACB93C2A4BEC05CCF2F8117CA58C5E087C5 + 66: 90739857F831403806F7330808859E0DF94EDB2741ECD0F0171A35C6AD94F4CD + 67: 91C2AAFCAE4A8B23BAE0CE181286441BD1CEC4472DF6A53EC2BD7DDC6FA1B2C0 + 68: BB0BAA63AE67E84CB1F055D412AFFA0E8211046F0D759EAB05A706BD1CC5E604 + 69: FCC28D2003B96A3C07A70FF6B2C0C4D4390E0DB493F6D832069E73844C8FB750 + 70: 9A37D338881200153A65CB5308FB12D3A576C465A37A68173E7624121CFE4D9F + 71: F56AF9784668814B6B4326B013F7BC69A68C63A3998134B227D88EA0434C7D0B + 72: D741060526894DBFD6B79B705CAE79A2A219C934393D0499CCD3FF53B5C11FD2 + 73: 2EA96E5A9F0EB649325922072BE2555DEA2B0044D425777347D0ED1E146CF332 + 74: 7864EE22092803D666BF2458E0E2A1CDA24B60E57341B0816FD66374F2AD16D9 + 75: 50A0D061EAE67B68CA787319D60F7239728331D8644D9365B883B29DEE474E13 + 76: D73F80BBE9587C1E345BB11CF92374753B36471A39F5EFD64AABCDD0DB8222B6 + 77: 1091B151A973BA2C8D34CC05F826721ECE522EAD452569EB65EF9B7BEA530959 + 78: 635E1E849CA811275F2800E224A7702424BF219EFA77A3CCE720136E485C8B81 + 79: 51EE28464F294096221B0E3F4B7B9712A5354C4922737BCF1223DFB596D09549 + 80: 41CD03FB9EEB650CE9FC69DA04577DA1DCB81EBBA33F60A665A49FD1C2C0FD89 + 81: 7FB09C813FC022E082D9A83B4E998DA4934C64F50F0BDCD94A877DA6D4BD0655 + 82: 4CDE469AAC8792070C5C487AB3179C4C15304EF467CE24EDF5AA38DA592A9328 + 83: CA603B9165734CA8447E62D7EB813E0F1B15BCA80EB9F377BC945C20CC80197F + 84: AAE4396316AFAA2AD67468DB5471A6C20082A6162E0B91D28C5A3EFF80C15C78 + 85: 215BF71CF7FC1CC55D625727F8988576692840536D0394DF5636BD5268213919 + 86: D3F6447DC4C7E7873C017BF395327278B91C4A0F2087842921CB91C40B949C42 + 87: 59FEEDF8C57A70CD074EC8CED25059AE7E540C89F777F761A427BE4A34F99664 + 88: A789680F986CB3DAB6ABB403B9697F202AF4346EE70F0C12A7BA5A74EB42DE5D + 89: FD3335E382AA232FE743E0922A2C0A9B3203C2F5A9B2FE1B9AE54F99D9602EE9 + 90: C37B4817A90A2F72F3CFB2B76007304D954C56ABB95A8C8D8446AFD330E5CEC8 + 91: 8CC0EA382E5EBE80CB390C49DA953B8334684D2BA84D80DAF20E33A0C6A566F8 + 92: 25B5D534BA632BBD1B30416163DC1BBB3F2E3B67B823D0E98F1C975A3DAF01BB + 93: 0978AD3D43E754145B69EF750F6F7E824181A3E6383F975D3496EF66FA75F416 + 94: 263BB5B3084B1091A0E645E18AC1308AF7F62BB2B6E653A862598BC6948BDDC3 + 95: 3A930BB5919F12303BF381B59D104E928CAA96B99F8A78803B465A53EC3A3389 + 96: 2723841C4FCCAF40C397D1833FACB5927B96C8AE6C09A699913A29604725E9D6 + 97: 09679C9CDBCB196456D8FE1792CB65F5544E6575EC2B8E073C89C0D8D744B498 + 98: CEC63D082A50A7C81AFB946E87770ABF0E4C38D184F78E1003641ED0815DAA55 + 99: 671A3D948B0BE9BED110B2565E57DC126572AC82AE7DCFB65BF1B51349822E59 +100: C9DB0D4CCE88093A0809F61C6013EE42429461CCFD713CD0C66053F07294B26A +101: 54FD082DE3F67D3C04565644F169615999A2D69CF8DDF1BCBE6D8EC8A41DBD04 +102: A60C2EB5A44D7F0CBBB1120EC9299D130EBD6D635EC7A2C5B37AB15C058BFEB0 +103: 28050EB0E18F339F1B4E9F1F8A5284B4A0B2844D7518AE193CCE4B87A7000B7D +104: BE27C28206567C3ABE4D6F7D852BA0709707F5CA4BA0A3B01D11A051CF5B3615 +105: 120B73D6BC62FC2572269BA7325FD136EE5249CF073195413CE34F2A512A2AB9 +106: 7C5F4EDF9358098AFA928CB67FCB32C01ACB87B59DD522F6418A1E2181C5C97D +107: 90CAB395134B7B03A1202B3547D1D478F3FBE503D844E16566729AE29F11FD1B +108: 50D2C02A061A1A192E3EEB3B0BC24BB6EA7AA9580B2AE060C32989E81BC16FA9 +109: 61A147DBADD4FCDDFA52935E703EF0C6ECA883CC9D1E328CC72C30D375920927 +110: 498FE79B7F5DAA6C8C53A84E502E6B685A20AFF7F455B1D5D0090FBE28C830F9 +111: E625994E6ABECACE3D83E27E2979BCF696C3BDD761A7EAF33754EB9023A7113A +112: 7AB2DB3A9F6448FE0E4F2CF9BB5CE8CDEEF9EE52CB6A471286B6F89EB155C3BB +113: 62C2C2C5F240211DB4841A7500FE05B6DDA262E0DE2C75CDAFC7E95EA29DAF44 +114: 743A3B50D63DA1440A172DF952C23FA0FEC9A9AE208581B1AA6478B8F5D90C11 +115: 471617F452E5FEFEDBB2C86E60772D5BB68725E7317E416F312D9ADB1D5EE842 +116: 7B834E0663064F049AFF80C221221D400FA42C30DBBC2E3044DA31E86B9AE032 +117: 40DD593D41BB4B546D51DF3DDE0FC6CD2B2BD233C88562A05D1912519D7F0E78 +118: 08063E168FDA50E7F4AC535C9637CCAFA048518D41D10887EB0FB0C8AA8F0ED7 +119: 7D0B85895BB085F9E1C28B0BFE63683E57CBE1EE98F6A9F439542940AE91EF82 +120: 1842A9925914E3C2D799DEADF6BAA3A8BF3ED139954FAAE0E399F54F3429E6D4 +121: 254AF4A1815E6FB33D52554988A0E3F534B029155DA84A8E6F58D14B3CD56FEC +122: D4A7E0BE95FB6D084A552217E50812CC0318478CD70F7CB45A48C00A5C9EEEFC +123: D481D7F2543050CEEE34CD048938503463993719586792434F5D12E8EDD92456 +124: EE1D0F8F574EF0131DEA4AA39416FBFF031F461E7FAB8250D5DF8E4091375063 +125: 44232B4083D59327E587BA035F690FE6A8C76AC098E747E2463D0DB446C1E11F +126: FD3A67059C103328CBA0AEDA33FBBBF717AD5B3A328AAA1A76AA1120FC7B85DC +127: 9A2F5D8C138EBB3B420EF4F98A2DF1E8C65488C6AB842023C9B53A7A13D6ABF7 +128: CDBB22E28AE05A82CA0E4AEA774DF5932443CE9A4C76D05B5171FF9FE4092FB1 + +Hash: rmd320 + 0: 22D65D5661536CDC75C1FDF5C6DE7B41B9F27325EBC61E8557177D705A0EC880151C3A32A00899B8 + 1: D15DF650542C206F970C18117BC74E041E89697493726DA37A6F3F0FB3DAD8728D00FB27F0A84D52 + 2: 9571FD2B984A5BC36B4000DC8114AB76C8EEAAB8A091F2AC14A0201AD02D8FD0DA714EF47AB5DD94 + 3: EE9966717FB23EE89758E0B4038840161C7AB7A88D876058712231F4F810B945BBF5B5B9D3B3A1E2 + 4: 849C84A4355CF2F9D64D28B57ED754068A16F9573B3012D982143E916D1607E2EEA28939AB77E37C + 5: 5A94801E82D72AED7E836D10EA1B65448347E9591D4FA217797972F337DDD3067D55A60D56136A18 + 6: 28F83FBF908DE50967A51A4E074C5D80ADD2AFD54DF75653CB6A11FE77E885FF871EE4C854DA201D + 7: CF5842C46723387FC1DCE1A77AD1F7D8A875A3D1BA453820BDDE30930E3151D341E50556D8756853 + 8: 7087CCEA4A4CED84B48E5477C5048833767D55264BF859D8883E1ACCDD60750BD07A21DC8ECCD246 + 9: 7C2ECCDC632D902330B78467008F19C2F16D0FA60B27713A5CBC2688838107874EA68465453B1F16 + 10: 12AD7F5DAA2099A980DD9DBC5970235C25C3D1381EF0A85D79FC0358C5AE9942BB8BE4B0D03C2A90 + 11: DC3477B69D2797AF620A21C8436F42EBC1D79008E2C7DD581588AA9E3D5FAFDAA3384702DA10EE67 + 12: 5FC1E422DD5D5A86883F3402EF706F4195D25861C3133E6F242C765F0DA67FD9ABB423FDAD60AF45 + 13: 3C26026E3E873CF80F3E2962656CA15F7E4E269D7FCDDE6FBF01A447E68D87DF0B22CEBB55F924BF + 14: 5BC3C7E2B201783DEF03CB4063464A299569B0EF84A8FF99A23F305E659856FBFA96078D1B083A3A + 15: 21CBE4305CB6C2EC8F952BF4A46D1C403D21F3CD43C97CC60C799EE4B7A85586AEEFF906A9B0370A + 16: 006B6C4529FBDE25A4F4A3AF5FB78825BA02C6C2E56558A5685F48BDBED9365AE7CCAD528BF8DE31 + 17: 473B8F7641056D324C2C73698E2176B5D8E65E8C58D2F30E2A9F84E8896AC5A65B6292197FF3A938 + 18: 7F058B60F44F9A7F5360557EBE887CC8C3BD1A7395BA08736A8DB6FDA66D4EE84D14466861245AD0 + 19: C2F30D08093FC48571BD09DC6B1A2201760E11A30CC680DB49A34AE081DC036D4E56D364F85ED0FA + 20: 41713664A255F0B7156E679EE476665DE0DC05D52A6E2A14A66FA3DEEE5B36BC6CF4D6D6BE688F1F + 21: 953069C5FA9C7A4E0F7554FA33AFB943774144562EF3E9533E6122BD4FAC02188020F5B2C3049F06 + 22: BD069BA97BF14702CCD6175AFD685D0D5D811EBAE7FBF2D6B0840916E1DE278489165825D784FA29 + 23: D656C4AFF568971D09313C2EE38365986649093CB2F97523BE008677098933880A4C082F365EFC86 + 24: DE1B0B3A42710EAB3FD6111D24D5C425F47E38737D647BB7A6DD01E4D0909FD9D65876DF7B476DF0 + 25: 843F522FB630B5C69295746907E6F62105EF1897F1E833909CFAB1443BC2453D42E332DD0A792EB9 + 26: 22D6C4B5DA1EAE94258FFAA4FF919EDE1B1C78156F79009241A8D4072ECC193A299B228F0EF65CC0 + 27: DCE0CD9F9F86CA9D1768B6D82C46F5CF5A9CA3DD06B9CF423443D6A5B65DD76A20C3565F4D90688E + 28: D63452D7A5D2F4C997C71BC1C3DDD7CF1EA1C2942A67939A14B6012E77D6A44C4754FD104737C32A + 29: 5F7F890560B601ECED41AF54CD070B6BFEFA48483CCFFBA224D467D8420422FB1B732A5A4C30D902 + 30: 520B822D935CA48E80307D17C5C1B63F3074A9732251B8A52158F8BEE8CE8804EA611D3385ECE604 + 31: 746AB0B6625CCCD9F9F2770A7F5AA79DF5C0B00222122C5CE341D51E0341F9F10633A6BA3192CCD5 + 32: 164422906D6B607E562C23DD26A51DC2359A8AC9A97E2B90554417971E0B512659423A6239C72958 + 33: 9E7CDB5A2F9622AA49B04F6246AB486F324D175DF993CA048FDB05AB5EDF02F9F185F110BE2A90EC + 34: ABC057543ACCE8B001B06729D6149B1A74C635FAE0935ECA260DF910570BA94853517DC7E824BF6B + 35: 9A95F9664803DB3A898BC783376C03E96B5178E649CF467A0119CA8B89093566924E58CF3AD8BBC2 + 36: 772B1827AD20991D649688FF4F44FB551B2985F0E3B24DB243856A6389B56741C9C1FF2DDC4A7AC8 + 37: AFF7C444FB955F20EB094DD44AF2E1E0E85D903ADB872CCEA43D975108C3816BF528B7F4E069F5FC + 38: FFB8124321A8296B9CE714DE88AB623D61A284B6053926209FDE0EBB015F6995036A6A2B5D0BEB05 + 39: 2FF330120122CCEBA3D520DE3DCFDB60E514F6361C7C768B6FBE49FFD0D836D2E2793E9EA268FCE5 + 40: 72794B555A99BA139DA8034F6D159A3B3FCCFD65D70335778853AB803432EB28711B3EF8FF6F7978 + 41: 7B7956BC244501F15C1AA6CE66FAB61CFB2A0CE674C5534B964209889ADD73B637DC5D4934F06547 + 42: 595FF7EB667277D6CAE46F87D9903A978EBEC466E03A4A42215A46100964ADAF95546FF9D7A7A6B7 + 43: 653C057A495EFA2895FC74A79C6726132BDB8A5D3842F6768CC9918108CE5A5FB2C5982C90346141 + 44: DD880C0F514B3C5EBEB7DA070804D31C52F5EF47558FDEDE9B416828D5990C12FFC436F0407F52E5 + 45: 8E802DFC8821965F611B2BD3995EBB6D88D758804E785F933082BAB5A217EE21ECF7D0BF25D080A5 + 46: 11E49D104BF0A76A912FE1EB92CE5A87BEEBA1DDB606207C9C11F6749CDA1E378CE4D2B87EA90A6D + 47: 7189DFC591B0F89C5C947F752FF91C4C0BA40E8E1A12EA58E82DCF1C3222DF34D4617D281496C0FE + 48: 96083047284B452EE0C3E68FA169CABFCE4CD6B29D5773FD8ABEF6D3CA8F9B47032AD11F08384EB3 + 49: 27646497C0E50D41474FFE6871B3C5391420B7B753FA97BC606A770343BFB758B927329B1B950136 + 50: 9C74209F16B73DE0F9EFC3E0D29B58E3B97871807AF3FCE5F9954BCF083BE09FAB615368ED48C888 + 51: 0D44E094F2A99854C86BB1008BDFD2BF66B7A608C2FD62AFC2078B638D83F8AEEE4216C05A587B10 + 52: 979725BBC062B011B6751B68F21AB22BB0F8BF1DF10FD6D1E239B55FFA8B1D29EF5C33F193DD846E + 53: 1661FD3D05468A4A2270DF667AFF347EF8F98C38A61B2DFC482563C09FB5E789697E4A5834444971 + 54: 7B67035C8D55CFC6F0A82CE2000EA51AEC95EBC94149AF23B86BE465A0D9256CAE24FC983F60B315 + 55: D5383387F99FEF6732967302F2AFF4B8F694B43235768E151BFDA508D6170133EE44C4D1BF19D1FF + 56: A092A11FB22676778C6720BA1539B3EF72F7E25B1E75AAD307CE3D1A1FBC9962D95D1B6E8BD19148 + 57: D36B21E8609F2EE9067EE719FDE8CEBE8C23C026C133AA1831DF87F3974B6C79CC1318794B5D8360 + 58: A020799E188BE3E788AC671D338F124CBCF1A9E3FC855EB69DC0769E114C6F38DD5602A3AE0E6751 + 59: 7C0A6943329F210EF9DD005D36AC330261B6D5D01ECD0950D195219DE2137B6E67BCDD8EFFF8EF2B + 60: AC849447899C070133FD84BD9FD0755464A0CA543B20C0A8CA6E5B1EBCA0EB2F155F5CEB9B0D37D2 + 61: D692FD2DAA2A162C3EB09AAFF9A1BDBC2A9A37F39D3BD1E53927948EFF0CCF945B89EE6BB40A82E8 + 62: 35C531330A8889051467B9D9892B7A964350EF59B14301905E6C645971253BE3173845CD770559BA + 63: C8E2F8B3B8CD1127152218237982F72F4C930CE663A232231CF7A83D1F833843BE5966AEB40252C4 + 64: 8DA29DE9049DF2855CF8F26594C03275B9A216CCA012A8245818BB63B0EE6E4AB2DC069B393270CF + 65: 389AFAF1F9B4616A4FD9269A9500AB82C3B65D26546A2D6D10DE741351F96761A4337012BC2844C7 + 66: A9589DB6937A5F1F8F5BE81299F57019D06F7754079C8E7DC3E2A45AD265AF5349930282DFDA5DDE + 67: 989CF19EFFA226DC8EEC1E3EDB1A9F0436414D77CA5F4508B98378A9EEAFDFB562B54D24D55796CD + 68: 2F48B7C774572D9E2FD21AA1DF9C575F6BBF68FAB12505FC38D2B5C47289FEAC9F6D595A10024349 + 69: 48C7A6904D11F412517131C718B0D32A6DFCF05308C17802D44847C8B81778FBF67946FF4F551E64 + 70: 4E9962FBBA06B56FE8CA0CAACAA144CE1BBE30B7ABE0917A268C9D86E59042A2A343DFA8624D6757 + 71: 5B573A2AAC688FCFDE4408F647DD4965C402FCC82784C822262D15F69599D94F86DCCF42054A2886 + 72: F0A0F0D04052B3429592823CFFC713137E0833B9E776D9143213200209C214FA4E5F700B2C77889C + 73: 52F471056DD15F895C07186055791D6E688644BE41E8470DEC1F4D1BBE741D08C12BC7DFF0766E7D + 74: D1EFD8F68D3F2954C8935CE0C04F6F428DDD79A39D5B7A86C7900D21D139F20FD9AFA1B2943ABA9D + 75: 76E2F2A2BBE58D7B26E358214C8B244843F7DFC1A2C413F8F06B0ADA18D7F54E3A59F577C742EE18 + 76: 197E2B2BDC7F9DA53AC2256A8A74CD132847A3631084F4D6E95991E83B6091C0384F0AC9345DBB97 + 77: C788B723815260FE8040EADDC011B9458835942D9A9F92FC0C3BC936AE60C8EC77D9B6471DB6184F + 78: 70741225CE46A008A59CC695D9A4835689A446F378AC72611CC0344468C788752E03EEAD7D467337 + 79: 354D7204D60332E3CEBE5EAABD63E850054847F579E6175FA54EA4FC97839266034A161DB9CB0DC9 + 80: D1860BBED9848936E7AF61512FD38FE2DE3BEF4D827E18B1338C0F7EFF526C0004C5C5387C851F8F + 81: C1C866DE0D4AFC09CBBA4045089BB6D3CB914800A7F123089D9DBF29B891DDE99F170A86D2D6CB29 + 82: 751DF91EA356622D934A7E577EEBC076F97B3C82B517C20F5FEADE2679CE41C8F3BC23C659CC3D16 + 83: 2B1BB63A71808AA22C935BF7259DC253AD475239CFD072D9484CDB46541E38C7468E223E465A974C + 84: 0F05A15A2928F2E5C179C0BDC48501ECA8409440D78979A06BF6F5AF345D3D2364A4212CCFF7FA44 + 85: F1B9FB2C7E1597A57E80F7E072BE3ABA785D44EA19E5AA687B8C953C1BF62945454E15138F7E6371 + 86: 4DDDFCAA087E7747462CFE5633DDCBBEA6762F8E5755DD8384C2028070FA73960097B106CF21B12A + 87: 8E2E498EB086D591A8A1F0ED7A8192BDE00F3DF59B1DF842F3D122454F081B02A6673D937EDB5D59 + 88: 9911573F54CF6D10996AC34E5ABFC0E4B198D7B20ECCD07261665B70BD1F26B1142DB089584BFD95 + 89: CA46D0B9EEC92CBB97FFB9C358284CD79CD7C5BB1323804CDA6FE1053724DE0A1E260C9BC2201957 + 90: BB58BCEE9C19A05239237D482A9441C5D3B4F20C73F8C052AC0C86506F17534938E1F5A98E4174EA + 91: 3089F3A1C0CC73E2B31FF5F0168F78275386F9BA794D17F90DAD9055E328EBB1E2CD711F2519FA69 + 92: 6669BD24D20CFD12E8B26CDF567024513F02E6EDD5CC1FBFED6CA2C4C16A364F47B820917A39F8FE + 93: F94A8DBE7246CEEB1495764D4F029D018A1F59370A5107791A729E4C6E0D0EEEC66B96CA8CDF1EEA + 94: 857E4DAFBF430CB3183F9735700C1B7F44CCB76196E269C749AA1F39634A0EFD626F465CB4F8CB24 + 95: 250FB59132DC632527BE41D334FDC6E25C90254405FE46E3FB80C9DACFDCED35AF28FE0E62630B79 + 96: 8001B80CB6C9E446830FAABEA5F8A7CA47554FFC921DE56E7D0C3315CD14BEEF5CF1770F06A5F95F + 97: CAD6EDA223A5779FCE361EFE0666305326327BC3246AE2A7068475D67D4950B39D379F5B6B9251F2 + 98: 07BFC31731F8F076AE65894115F88204CB51C3D79C67F2699B439E2FBF133F2D0977DBEDC10363F0 + 99: 69C2279628C29A7930573D58C3C6E81714F04231316616B58104E1ACD57C038A992039111392108C +100: 558684FE7E011378CE133B7C17231B73F54CDB33D77B93668BB9994BDFEBB92D96AC84CB4CB6EB3E +101: 77FF6744C4FFBE4D4144E732850FE27BE7BB0BCCBE72B970BF38B7AF5D7FE40E0B12C1CB8E5DE42A +102: AB7ADC40BA0F9E02BBC83D933AEAA964FACF93D7AE29AA4923BC7221A8A7613CD3CC688BED4393B0 +103: EB7BE1B8110E23CD725886A7D9B8995158B166600E4440DCECFDE15A0EE426947AFCCF6CB029F1A7 +104: B45A685ABB285D8E29B471E07CFA7674420175843F4D0142D8B9A0E7664AA8B3E3D63896F8270D16 +105: E931F6602A3957C3033D243D7DAE2871F1B92698426836F4D3D06EB246B880F50CA25EE2328A6810 +106: 86DC16B09A768560DD2D985286BCE2AA9D8721397064F5521DA60746E46231AEE50C4FD7B2E6F04B +107: 9B30C031660007BCBDC3ABB3C10D063D90307DDCAE853972DDE47FBB6A4F320F5F1EDD040713C73B +108: 488F5EFC7B0A09965D1689E3456475A0B90B647FDFE38D609384BFF01D46B6C169B75F4DCF74B316 +109: E2FF3FD214B03BE527DA2CDA8F0B67D14D47F6A08FE309690A7F3E705EC26D497EC23BEDE64CA76C +110: 30606CA65C5484567BD569230183A77679B085B438BABA9A59C00888D43249161D836B870486A143 +111: 90278C79CF7129EC87620C6A1E1CEFF81361B9FF7234F1202C3CF9903E3842A09A511E27639BF037 +112: A67689A579055F4BAEC45289F5F7C2A8236196F241A84EF721A2B8FE3F7AABED17A50754A3791813 +113: B1A74D37FC23A5B0CDD60E153D988227AEFD32F2CBDE72BAA40FDB1492BA01947D607D11AADC16B1 +114: 4DF43237C8D10DC4CF90E7987059F4D77637286F8F26FE16B95A004F842FCFBD03BB667F88BE10E0 +115: BD5F268BDE9707B085E73975576BA07A71722B5EDB2CC4F7BC16C75E94CA239497161512E52E6FEA +116: 777B474F4DC1E7E7181363299506DAD103EB625F758AF9602DC5761DE3E5A4CD93D8E245BC59655F +117: E4BE803DE4CBC3CCCB32761C0BF51B4048E8326C6F2610F347AC7D6CEA89273FAF613396341A662C +118: C0F07D8589EB941D78D3B07F270905CCD19A62040C2DD5B5172187D0F6E4B919089667CAC24AD57E +119: 99DA1F25A48709E3051C52CCB417FCEADACB3B2742583E95B0BEC05E651D4F59D8169206B45A0F15 +120: A368B02B9D6ED249290CF6BCB225F6636D4E226B472F07C80B39416AD30FCB84EBD45178B95A2DEC +121: 53BF8DDAECD3022222369ED66C20B1A1C6739556DC4874A0DCE63C2818817E09D9F611031ECC4769 +122: 9EBE33A767738B7DE55A0193FEA6C76C718EA9B3D4FCBADEA37DDE743D052D1C1B2991DD7DB8B57A +123: 38FFAE3C7C07F168887997BA0AC8AAE8FE9F5CB14A87A8FEABC4642FAA5323DF94CF73A962C8AAC5 +124: 13DEBFCAE09B0FF90DA06B49D6330813AA487C606D00D3161C8283CB62A661DADABF2CA5CA4E7230 +125: ABCD79732983370AD0E130D3BE29BF19548F57CB744A4B8D3F2BBE295930DBBC484EA45FA7DC99A0 +126: D2CF766816B1592D91D66FEED7FA9D5FEDD93EC85ECAC455EE0CC1413DCB53B2A6F5D6A7BFBBF26A +127: 78E78895B7E5AFD95D4FCAEB84F89F04FBF83B51FEE8C1F7B342BE0096DC010A1748F60B57839AC6 +128: 05E40364D0466B7C46755EB198F02BFF8F4F1D584AFC27B900654A528454CF692E2792CBAB60CF8D + Hash: whirlpool 0: 19FA61D75522A4669B44E39C1D2E1726C530232130D407F89AFEE0964997F7A73E83BE698B288FEBCF88E3E03C4F0757EA8964E59B63D93708B138CC42A66EB3 1: 4D9444C212955963D425A410176FCCFB74161E6839692B4C11FDE2ED6EB559EFE0560C39A7B61D5A8BCABD6817A3135AF80F342A4942CCAAE745ABDDFB6AFED0 diff --git a/notes/hmac_tv.txt b/notes/hmac_tv.txt index c2f1ca9c2..3e01ad037 100644 --- a/notes/hmac_tv.txt +++ b/notes/hmac_tv.txt @@ -1341,6 +1341,524 @@ HMAC-sha512 255: E8702ADD4B9034BCA0590FF897C10022C56D08FC4EEE0A43BA85E9E9C2086616B1BE7B6F928A3C53755506ED2D9D62DF5BA4A1862FBCDBA20683931A2244AFBE 256: 6E6A3CDE12F2CB3A42EC8A5D21B435C4DA4DF6CA7E41537D361D8169158287BF1D2241581DE07F88FE92F5AE4E96EB9C489FC3B258EA3842EA2D511CE883883E +HMAC-sha512-224 + 0: 48EFBD72991A1B6C1A276D5F37B62E55DEADDBE0BD107E4BFA366C66 + 1: 839952295D1158120AC85ECE73C3983626390813FD983578BFB34101 + 2: DDE748FF9F9784F23BE861CC2C7FA01DF6AE97AB5E40BE7DB4941DCC + 3: CBC29E8C2E20F04D9AA8758F19D960287A5A31EBB6056DD31F69AF43 + 4: 23D379745B258F1CFB81E084AC79473E9DC5733E63DAB944FB929F2B + 5: 3A3A791D93D0C8817090E28192D3449BE494EEF54337BED209936746 + 6: 1B33D31AB9FD79D0A93EB9A50E8E7A4E78B448A05DD3CF93D9A36B75 + 7: 3C89FF579EC0521AADE48B00C7DD2ABFA936A4C5455688870B4121E5 + 8: 2F8520FEA211192EA7B5A1BEE7F27832AE7CC411F8FAAFF8FC573016 + 9: EB45FE092721B4190C63BE24D696F81FC84AFD6CF6E1412A90B8CE9D + 10: B25214D1058F6ABADB544B638AFD69DA778447D1EC58277215DAE60A + 11: 96B714CC79B11CF9B0B8B903AA195BDE97B84AF8EBB3C20A6CC1F163 + 12: 3ADCA3DC4F0BF937F0C01D277D448A46DE7E3AFF807926D2F608BC37 + 13: 0EF449E66BFAA6E5000271077D0B9FEC85203C63EF3A555DE2518B06 + 14: 022B7F16DBC27E933AAB75E36220BBDDE629422DE52FE52F7CB5AADC + 15: 2B8BDB3ED8FF84D18E69933E83C545FAB236A7506F025BCBBFC304E7 + 16: B338B15B48E49B4E8597E477EB64C9AEA29F1AC96E33AFDFE528CC60 + 17: 9DA6C657C280547E17BB72E307F8751077124E7CE31937F19D783CD8 + 18: 683FEA80E1AACC175488E0547F98AC771A255E92CFB22C1D95393451 + 19: 5FC8148383C08015F483C1073AC5CA9746886B88669428A3FD3FFFBA + 20: C0CF0B758B58F0E2DE2340C57192BB158E72D2FC126DC34F8AACE2EE + 21: 65469E3C95382569C40CCDE30BD09C822EE017F4A8D9306E8469DFBA + 22: 08AC0A7EC2DCE74AC22243DEA716D0279D7E3F8D4ACEF1679A37CB50 + 23: 6576D56228261D1F42BBD95C096D134E15747F4EF505AFB1D292DCFE + 24: 1E35DD06C89A8DB1536A95584B4319D56D5E58567F49F30B9532319B + 25: 6923F40994B9773B31CFFAB037F50F934E65F376A250D884B1135E4B + 26: DFA27EF85E5EE8DED1D20E090200E8917F6E7854766AE3C6E587DD6B + 27: 600F788C7B71CB72E10F5C4A8E92B77EA6DC8CA5A973647FCBE7BB5A + 28: 3ECC120D2BD6AB1A12517D85C7BEBB5C5A84DD946101C444D2B0C966 + 29: C2E8D1FAEF0F22A3DA726142FA32EE59F21C32628D6F3A19A97C3D3E + 30: 66A1CE87C65EB602284EF6DDF3F4C21F45A7929E99BED1969A63C5A2 + 31: 7F19B1FDBFDF53F80D96F5E6C9F332BB6288CCBAA4332CA48D828F92 + 32: 6C0FE6A2C4684AFBE80A8115B9D2DA15E6B4252A7CB3743261D5366C + 33: 37E4D09EFEBA5F9B93DE66EF903995CED65DD257DBE75AD83B33496A + 34: 8DA8F60B56EC0E251BD622DD811E1E872043F6CF08ECB3624E15BED2 + 35: 8FE24873322EE8118DD2A7E5F86B0D97B9F0C4CAFE90D0B0EA297DE8 + 36: 8CFA8029966C1CFA41B298072E673F8762C205D31F62952F45B31BB2 + 37: 53276A17E8351255D48E6CE6BAB2AE7F4D538F58A7F107C2CAC6EF56 + 38: FAE09DD82A2038B168D4BC23F2A52FE4D2E532BFCCF3109849624CA5 + 39: B37B81213E623D6744914F859C08C020C36A0B266651691ABDD9FB4D + 40: E0E584B70EFCD22727489D86C13BFD5B11218BECFFD12224AFE8BBDB + 41: BC9C6FED305BD9882D74533E3082782F58BBB9CE71F3507A4F928F0F + 42: 12411F98581BE2230EB7A0865149779D259A4CC5D9C2F4E792180B10 + 43: 56133ECEA7994F5216DA535BCB81CA193FF523C0FCB10E5E6593EA31 + 44: 97FD2C66D1D594B943BDE7E3F157B65B0CF8D6EAA08BAD0A218D96EF + 45: 2734BDAB39E9D243043B81FF4C6618AF7794F7D566487598A44110F9 + 46: 6D9E305E16377873B49FC8408BE1AC42BF1AA4609E7BBD83464903AA + 47: EBB237E61FD7E8D0003A4F4DB1AEB887073282311729BB56F4958E12 + 48: 9A85D05C61B90B5C18E8E4B3FA1197A1895B794BD40AA01624415DEA + 49: 05D7C140A6A20BD82D97812B48DDA409871EC57FB0847F0DAF26A9B8 + 50: 71D65BC13FF4AA3F679617C83D90689BA33C428209B59F279DF8C672 + 51: 0F2045E03869ABD13798D62D34F4F6059157C9533999F32244933458 + 52: C4E9037696D5E82E949DCA2715990A8460E0FE63928E4AC1EDF38F02 + 53: F41678F54F797944E043594234B92A7A918D32411C5E200C02C15F81 + 54: 244FA5F5A7981357358EB2825A8E48FD7F2691891D9D6A0D1E2CEC38 + 55: 605EE444B396FBD3A53EEEBF790A3B77F11FA06AAD253F2D12314C19 + 56: E7020C2C0F0950D713A006C1C577374D791F09B76F7E35A0606BAAEC + 57: AF1D23B0BC656709B57BCF069AB307E479C69F175238A190E2AAC393 + 58: 9A6260BE8242701E865CD781298586BC2C224723BF4E0A8F1DC50E9B + 59: 206C7CB8CBBFE79E1FA25A33E49DF7AD9673C8ACC1AA730EA2BA2A68 + 60: 7AE765E266FAA21812AAC4338000AFA44E0F80C2ABB325DA010548BD + 61: 9D17B8886D68652CAC09151912BB5969F399FC698A83BF0BF3C74FA8 + 62: F4EC709C89274BE6D36800FDDACCC6638F83FD058FD356E86A320123 + 63: 82892F3D1F6EED960E4814A04545115CC7BCD918606F4A150C60327D + 64: 2B97508B1FCF1C00A1D7646C93E196048A9216C80A7DBE128B087A42 + 65: 0CB2102EB19C395C3DFA52671E18DFB818246C97FE5A0C18544AC98E + 66: 040E1B2E46E2DAE8AF799386F341766384817826CE7664C726B248B7 + 67: 07225AF0EA6AC19945A07FC8BD67FC825A37ECF41C5A86060FC5B5FE + 68: 0A476E60506A019458032F6392CAE63D69B1DD8BCC67C3F867A04BDE + 69: 6FC8CAC1A00E57EC0E59D73104A5C3517CAD3F0CA1A2832C08EB66F9 + 70: 34C8FF46550C16BD8A0DF97C6AE857791F327597A1AF412D4B260536 + 71: D518FD80AA92B3FB7A48C74E136C98D63070DA11B8558FD1506EBA35 + 72: 7744B4CA11C338EB81BCF4202CAFD3B1B997AD63089E9612E10E1C7B + 73: 0D2CE3B5C63F05424B7534E5541C821B21216EA38140975D01D798F4 + 74: 7FEF76C6AA4975C98F1B0F491A4E7F2760E4742F697D3B2BB36B3355 + 75: 48974ADBA6926A3AC726872C0A2E86B6B92FDB86721E16F33AF898D6 + 76: 6AD0D4DFCB43BFB8EB86D71E46185C13871A64C53D74C0C22A7B6C31 + 77: 57720B3205D3062D7E07079CC74A41D4396FF6B6A64B0B09333F0404 + 78: B8154B62DEAEBD4D8DD0B9141629CDB565F37DE9F97FCA1B4A25EDF8 + 79: 3EC327CD667208DFF7991BF9E4F6CF5056F7AD587C7C284E70076978 + 80: 83C505DCD265C6D694D8713404BF2AD7D5650E5DAC5213601B598C4E + 81: D1162BD2E8E32CB7084C6DB435A3E579DD48A09A6C5FB9462594FAF6 + 82: 2A4B3B272D6DF409C785784442067548A3EA21DA8D87432CCA8D4FBA + 83: E4F2F49F66551F2D3502E369B3D30E82DA681E1675BE6E467855716A + 84: D0DF577E51FA006C54BC10087DD8EC1F2C5BCA01D18C76ACF8497901 + 85: 5C750D859A10B9860D051ED996B5715BF1435EE3F79AAD28702BCF2A + 86: C81980EB158DD340B404B4E8EF86B9DF685EAA3DA7C836DE9BE3A6CC + 87: 189CE82411AF0612CCF224DE13BBB34167E24253BB5D0A2271861ECA + 88: DC6FF0AEEFBCA6F550ECFDBC2D53A8A6EFF92DB62BEBEF3A490A5512 + 89: 55644C0BED38F73039F8F367E3D17E5D009F14AFDDC89245AA20E2EB + 90: 7F137F0AE9566665B86F466FF000C36A3ECF2158E448C44FDE9B685F + 91: F455FA8E060CEA12A3DF67D66E73D766B4AB82D7647362F103D95950 + 92: 687D5B52A2179DE3768F47A676CB4973FB1AA806002E2A2B3949A62E + 93: F9EA2922CAA3FF38FEBBDC41C49A25A2D11E65E9BEDCFDECB74716D2 + 94: DEC3626E3022A697CBBFD35DCF2AA593311B839B62B618C395F8FABC + 95: 799B4021680661DFC94A87EF06E8EC2CC9C5CA9CA6582016C40DFBF0 + 96: A7C44F66C5D7A1B5FE63E5C9032037F1D7E5BCE4E782E8733502892C + 97: 7824BAF4BAAB467C66206D60072752913D4C4664DBA9197289528ECB + 98: E5A0166B21D133CDDD7ADD2F000F0C97DB9E02C15E6C0D7E3761D08C + 99: 26B94C44E3B082C083C507976DC5271D64FEB19DBFBF7C38967E424D +100: 4502E140EF20B35E73DF874AFD5C83993DBC395B19197EB321C1A1FD +101: 4B098D373B6ED0E643F4D7AD71465154386457A62F409E6BE5523687 +102: 7E2F229DEBB0C08F1E7C1623F68854F9BAE2142E44EAD46CC560AAC6 +103: 685919BA2AC4826513E2A80AA3A68625E1E04B7B82510FCE0A0F80F8 +104: D77057551DDE8539059F810E1E5D1EA0F9BD3C5057D3720D25D6496D +105: 7CA61B2940A9E015C4BEACD10A2A5B5B6A1480A1BB79FBD0AA40E0E2 +106: E8B27E9AEEF6DFABFCE02989003FF965E24B888B912EA0C98C44114A +107: BE7CE40509391771AF7D8C652620520D19792BA902565910CF19ED06 +108: 2FEAE129B5A74B9EC26359553E051C09A02812F81958E8BE90326DE7 +109: 4BCE3E62A8939372CA71E83661D2D1B297B5F9EA76474BA1E5D15BEA +110: 9519D5CA28959768E59BB4C698F77EA1752B9C9F5BC6DAA684980FEE +111: 44B228490D8AE1FA0867F59C950F6B28DAF012A11D83A81A295AF2E4 +112: 595447B547F45C74D1014AFCBDB5922B10D2554E134D335597BFD351 +113: 829C4F36A1B49D658AF8366AE2B4500586625C849A3F8B03498C0271 +114: 32DF56524AB646F3DA2CB8F16FD5B4B5B12BEDFC8C525BE30B892125 +115: FE03ED2B0E48E730DF1C929E0D85FADA7E063285AC70832BEDC7B110 +116: E37C4E201A5B500915F63DC7C4A2C8D1585A893636E22C349C379A0F +117: 6994EAABD9981D8D47E4C0141FFA90E715E91CD0E784169427468DE0 +118: F00CDFB559A1E5DAC4CE58F160A59AABF1C52ECFC033FD2A249CAFF7 +119: 898B07C76126051871DC47558B53B50C626947F4F33A28C5337E1255 +120: BD063BE62F249B9A2FB1A0436616FBFCB5B2AD8A5DF1E7ABFE7A329F +121: 2D146FBDE27D9B602B77D407120CEB2CAE9D28B11D1EC346D5B1D3C6 +122: 8DFAE64D860BDF213F2A4270002C148BE8E84D0311BEB38DC5F2249C +123: 06052EC65A786D16765D2AB54389C7E85339C36A5545A853E055AE6D +124: 14CF06FCB039E3710EC182B1F5E18312B5E11EC93E0AE84D7A5BCA5D +125: 67C4256494E9291E1460AD0536102E41091F04A1AA44C78D47D6D1A0 +126: D9803698CCC34B0D46590CF24C5FCF2F36BC51FD2686A96D88D2BCE1 +127: 6914FAA3532F1AC05CC4EDD495D6912C3F5965987D9D1D4AA4B21E00 +128: 00A9DC95039BF57918AC31B1E373D77D285A84D44DBDFF9ABFBE7466 +129: 1C6B4EDEC9F9CCB58DCFF50C802BE10E79501B8792FBA8DCE52B2CA9 +130: FEDFBFE3C8172E1834E44A6752A01AFB6C8246C2353787FCF1A6BC62 +131: 27D852515A2B6B1C02D0E4D736D2DE326D5C904EEEDCCD64FDA6FBD6 +132: E3E80979EFBD933792258193F413F3E55315BB46F74A538474DE3565 +133: D151F247C1316BA8ECABB0FBADF9D4CEFBAA93EFE2C89C6C8EFFFA6A +134: 96E250A71B2521197C570EE60509BEAA3D0FB1B2338DACE0094ABC46 +135: EAB4CFCAB47A7C813A99577745A96D806B8EFDD5BC6F8EE9767267C4 +136: BAAC26619C1C10A9F9F3777D199E5FDB737DE32EE00B866FFF7F16A3 +137: D07F3979AF9EAEE82F6157E41348C259AA2D36889EAE8D002C4790C4 +138: 8EAABFC87D6C6AD10B783B54AAAA03A5F3BDE35A04F4DA9ACFF38772 +139: 7706344CC31F387CD703FD3348D2207879BF467E61A3E1CD9F567056 +140: 1412F87D074B582A81193D0F70F5C22229C51E2DE00045CBB05DDAD9 +141: 6193E659A599F54CB0B349B0E869010F257D9ADBC25514C6084F3273 +142: 4382099F2F015954D7C9E586C539A0786E58A723F95ACC9239CC68A2 +143: 3A520462C8DAEACBB88F1D68AC2DC49E337835F9E453C3004306F78D +144: DFBA194E4FC14F2B9605DBEA44F5C06D4FBA6FCA32051788FC009B37 +145: 30E504ECD4F40AD31886EE5E4571FBC5C54F6BAC96008171FE2B5275 +146: 68331004646EE0FC06565E191A5852BA6E45236B516DA9B87A442DE0 +147: FA9B8009638947DB8F7AC40D67743AA26302415FD66A73DFC983CB3D +148: B6A32174525E96186EDB85E3BB2F0B45B25D6977B7096E5DDECDD934 +149: AC09A3F072A7BAA0EC985DDFF5CE34BA31FD87981A41ED35F4E38FCF +150: C9946B4FF4245FEA0D40EC5F9439638B9AF0E886E1D5C8A9F04C874E +151: 3310303B0138A108453729DE4F075B61E8CD6FB59997CDEFF4736E38 +152: 53BA121A4A0D61468F22850DD658D31ADA31E0AF737E5E2B6F2F04E9 +153: F7213DBE2423D88FDC42890FB1CBB5E59B11641E67FCC093DDACADE2 +154: 4961A8695490DD6FE0748FDE2042D55B49176D3C450E323672BB2277 +155: 6BF7C3FCB97ED327987B17356B6D3041239392D5645664BE3DF56248 +156: D70C01960B95A2448F1F2EF31266DCFFEF4B71AE1A3C1FEB10B37324 +157: 2EBC7AB719A8DDDF75E4F1B3DC89C44B79C6AEA1D14F718462CAEB93 +158: E05E69B2B3254EE44406588B57754E295F783252C0813EFFD7B5C3AC +159: AE95B902D1D103DF530DDB7F23B5042B00DC3547C3F984D5EF622237 +160: 8EB2792098081D060698CAAFE89A17E619152856757AA70693615F65 +161: 41E0519DC9ED139EE6643D74553D44BA64E2970269C8F156C2D41CA4 +162: BE04EBF4F3BCDF671435F2D0058E2E2B924C7E8D5645DBE5F6B1BC1B +163: 927C73F4F7A760FD54383D7FD65556DB111E26D36107D4C58314E17F +164: 1A38B77BD45EF0661411CC1F5E8C2468188FEE7D8768AD4BF55F7412 +165: 7E5DCCBBAE6D0F628E409C1BCC266ACD824A6FDF01D39EA0E006887B +166: AB5A3611FBD94A61F6822F428462B69E20F660763FC116F10DF90ECB +167: 6428DFAD5C80BAE31173B0169B87DB88B9B55FD722A6BA8216C8B01B +168: 2836EEEEB3A8739F1098E8F0C14B070E40942F721EF3CF2DF29DBEE2 +169: E616758FEF5F6BD6E3A73C6A4BEB058956D3BEE8FAE489D8D548C881 +170: 2F7F4B3E1F57D94581054F05DBDA5848AA05F459C32C1ED0983C48C5 +171: 491E9FE109C7E0232DE1FD44F29AE728889CBF63F28AACFFD87E94DB +172: AE228F17075D696C6721F424A5D86ABC9F030A716FEC12353885AE1E +173: ECFBE1037F707D02849C032653FBC1B9D25BD353D10E9CEA44EF9513 +174: D6AB30DFCE87BA4F2C476FFD309B8869E393AB2FF4CD2132B64A74D9 +175: CB2FA4084BE1A1FC46B0A69091C9DD87D632CBC7684125DDB9AC6A64 +176: B1C2761E7652D38A04B819CB16EC6215B5D2479E86F7BE0085CA8B0D +177: B1BF4F1C96B3BD7D255052014E6F4D73A684BCA6F0A461310F47D8D5 +178: 8F294514DAA7CB978B8B0C5D76DC2006EA2008BDFDCEF0EDEB446B9F +179: 816A65E12EFD71A1113C4B819B88D67112401C9EFD4D855EF1092DEF +180: 6767EEAB8829B5F5BFE1BE604726C6C20FA0E54EAB0CE234FF5952E2 +181: C3C4C35690B0F28D329DFD061AAEDE2106BE2250FF537742E40EC41F +182: ECDEE6D9F4E121FC76B7F0C9B102960C69B6A1049191A11C2C7B8C90 +183: D8EF5B01A28D78949F0C58F8BE3D3BD3A74ED5DE0028BA42ED2B1140 +184: B43C43A6B6C73CD2D9D595BA20F2EC247B4D19B16A561EB26DBA59BE +185: EB7D7A248124057B9F74FC12916E559ACA75F20ECA1EB4E30FD2527A +186: FC707C7C06CE750695075E848E973EEDC9F85EB5BAF214FAC3C5AD4C +187: 678A5893561582CDEFE346CA10C16369DEFA9A17507B99ACF216E59F +188: 40765BAD0CB7932AE3B7A192E0B388D63C54EA63CAFE26AEE429033F +189: 3CAC08B9CB39953D3E3954EBBFA7A5811BCC99D9577DBAEE374771ED +190: DEDEBB105FC7B21F135DF6B69DE66D2664682946D1CABEEA1CAFAB72 +191: 79CDCB8D656F38CB7B4D8DA5EB65E6FFDF832060E9A823CAFB3C1B58 +192: 101385B6E5CB65126A27A7DB748A9290E77E0F9BEE449C1AB290D246 +193: 97BB59A5DB5AFC83E0A0D6DFE9587A960D0C8AF59308841F766D5A9D +194: ED222485EA7671E80A4109150E338D6BD2FABA6A700B4F7333C42AE8 +195: 06B50BFA5AB26627BAE25B98E382A1ACDCB21A7873B739E12F77522D +196: A815DE10C82C38D34B39BB405BDFD3B16D6C0261FF02325E81659A98 +197: 9538A95A5EDC58B478EBB83AA16983DEBA545A92159982BB1DD218E6 +198: 2E3AF5AF5E3ECD587CC91358E9C3DE5F361F124D72346728297D7D16 +199: F2B67A6B7465AD65E6F6AAEC246A37F5C430C9CC52BFB7D7B68F69E5 +200: 1A03820B8A7022C591C534613B23EB02641D95612A182FE49097715E +201: CFBCF8E23B47BB32FEC6EFE26F678A6616E6DED024F3C83ABDC32492 +202: 4922FD1B573E4A3F12067A9E516C3551F83661AB36AF1D317B3507BE +203: 21CA53A40B827CB28615D47E54AFA773A238D6370C528D6E51DCFB5E +204: 6594B5C299912FC4369F4756E55028CF82BB2BECD85814F91C0B036C +205: FE5B06D55E84F9EFB694A61C3460E55AEE34A6B4650649BADA886EBF +206: C7D15364B9CAABC921FD901A55070E6D305D1D1E8C903A142FDA20B7 +207: 92652A66541BBE1821B9CEEE55D2A4831BBFB4E9D5A35601F3482F5E +208: 1142C3CAC5A6F4F59D8A0B95BA49F7DD81FF647D6A46C8C80040925C +209: 9DF44B3DB1C6B138B346A101E6E25C308D2093E895837E7A8F4273EA +210: 036E6B3C4FE95959D73E5652B5AF98E8EFAD9A8ED6BFC8FF159B68F2 +211: 0E3CBED5EBB9230149847388DB06FD4A749902F391DC627C47E4C6DB +212: 938092819682B577C13904D3686027EA542E25B7C88ED3664D59E557 +213: B570AD6CD024E1E01FADFD2DDD9F8BA9B9F8A72B4CBAEA44C59EA8B7 +214: 7C8F6185886F1CF378D8DEDED86576C6AE8F8ADA692D82EF1E14713C +215: 5B2D3BF41C123656B34AFE19D446832EF3C7CC4EBA94AB1D0050830A +216: 8B4D91A13761BD006E792BD955BFE63F08BA94B0CA51773239B64853 +217: 041F9FA170274090D0D0C95C4604A7D3CB48E97773459169057E8F7B +218: CAE6C451053AA714E4BC801CCB87DD3E2C1E3553423995167C1BFAE7 +219: 16F92E470EB0DE652A96122647E22947645D65AE1F92D039A2B8CDC7 +220: DD1DBD6E91A1D240C8218033BEAC675A8E3EF0A7CDE00DEDB783F465 +221: BFA2D188941AE6AC2490359A0343802970D67A15DA7345EDC78181EF +222: DAB74C5A79E18B36A31E526538D0C9FFF9EEA0E45D0D7A93982D4841 +223: A7C6AAD2CFA553900C878B45FD0D7E7DA905746F9FF86B006998ECBF +224: 269B6DBD5748A95F9EA533E4348C7DC75148C41C89DC5F9C371D40B2 +225: 4FE2D39FC6F0E04EBC4A75308E59C9201F35162C264F373C17227092 +226: DC1C083866A3E5EB22A640B44F85ADF93FE649E6C76DC03906DC3A81 +227: 2B59775AD1C37F5679569987BA7920FCACF100FD3FFEB94A8995F431 +228: D8EB02B089C120E6ABA2E2642358AD4BF9EE19D263A8BBEF7B5721C1 +229: 0723AAE2214B61F78A977E1953D83C5B08127F6B9A2723163FE11318 +230: B0776EAC2CC0CB1875D42525608BAF1D64CE4B23D6E134C56727B979 +231: FC5AE9AB94A0153920EC376C1DF064782F377BB2648C0F49D5848CC6 +232: 7DC27D88145EF5E81AB5D2774408BE4E0C815BAC81ADD394E0BF6CBA +233: BF9665A989BE534A1C185AACC5E476F96E3104E1F7478F9E413D0485 +234: 8BF6BAEFD10C0DED1E3F3D4FCBCAF0591F17B986C41D45A32B18FFFB +235: 7A6F1DA4E356B3AD16B8BD2D96229A87E722B34CCFA2E425D3ADB4C4 +236: 13DA7382CA771F747E6FFF0999B5787B8FAEA91875A0871E05753141 +237: 329B5833BD5DBB13847A863E882EC388B014BB32EA31FAC004A0F0D7 +238: A1FD939A3214721E46CAE26974477C940D9AF79C2AD1DDDA270F663D +239: D4FA32047199341AB1D4B0D84C071B4E8B301F6F71A2E4D02E430589 +240: AAE0BA62DD736A105469FE5311C7F9BD5CA913FECD094D80D7E85E14 +241: 202AF230416873B89307D67CA8E8114FB9404A72F83F5F1043050C27 +242: B8D66FAD9C34E46609EF24DCFB92EA40B32C4769B02B1FCD2A424FF3 +243: 6B27A103D5DB1632650AF52160A2307CAF6B58713FDE11A0FE2F093D +244: 656DE776B94BC467B688D0B5F5C628EFB42C77897EE266E1A2D5079A +245: A4A3CA586E387F73A5275752D5FD0CEFDCE0A38E8B34C52E7FA93451 +246: 040C523CD7CC33FE5E6F8D0CCEA9046C31B4A3077B801F45811FA81C +247: D69E643B91B93592A43EAF560186B7469978CF51268092A0D1E64693 +248: 905B9304B5942D9283DEBEED6258E81DFD035AE77E6096E3F721B02E +249: E4558D0B406D536B5776C15CB0DB97A5BAF44D1C9902DA8C4B67D37A +250: 5C057CFD6953175A25A39A4291FB2E792C3B237D08F1BF4C7E0E8D9E +251: 1CC817A93A8F4926C95B33F6140C2B6DCC844A5942E5CB1B449197F3 +252: 7BABF3D47D61366A5EB605649E20EC498733189C8C51AD1853AE8FFE +253: 13D09996FC0A93BB28F340BD0CF30D8908F68B3758FC17190C625BCA +254: 8FB08B94C1B0EAE82852713641CC2FE0696727013877E4041A48C4A6 +255: 413EC6FB4311E11A44C6C031785A759F5BC9BBB65BBFD3266B7B3B3E +256: 80E0A2C5EEF95C7CFA8AB1FBD6F0E8D7C892D5B3BFE1390F2D4B7999 + +HMAC-sha512-256 + 0: 62D06962DD2C4114A07D0B1EF16DF27CC5F2D9C80FC246E8A9EF7B9B7C59AACC + 1: D5CFF98822CDDD2E92B6D0F71C612502A3DF7E3FF8790CE9C8BBFCCE717C4C9D + 2: CFAF93B7AB7525F116A0D130C9B19CE0032F8BFAC2FE49CF093C911AA5961A59 + 3: C95F7A592F833DF1E12A7A418AAE9740A55EE7991AB3D684B3F12732CA95D045 + 4: 4B0B3D921555F7DC2768F6AE7BB9EDC0E0C7F96926E282245BC46955DE8DBBF1 + 5: EE50DCC0EFE8B7D6E56747A7D38BF3F17FCF13C43995B003FFFD3B44AC6B5A7A + 6: 724F97FF36BC550BAF236C85F5E955ADAD4DA34EC7BCF5A2218D4BAE6DB970C7 + 7: DD6C61DEC4A5D57F67BF8A3937605E2B495D5AB730B461BC2CA9923EA98192EE + 8: F4344FC58C223BDFB4D7ABBBB22184B3838A00AA9F32B73034EB6D0B92B36DBC + 9: 2ACDC752DD983717AB43916E08DE084AC7C76FAA12F492955829267B5B364B8D + 10: D1941B1C3C82DAA71372B920C130C567F71EA2C7B74FFD147D9D47A6AA0DFE05 + 11: 7EAC8D2402006AC547DF468CACE2A0958BC1C6AF4FACCAB833E6ECEE4D9F7D42 + 12: 155CA430670C06DBA5D435030E0AEE85A334837CC1C283E00407CCB58C175C45 + 13: A1319AC88783DEAA14A49A4FEB9AE8A67141B1009E2CE03CFD4E74B6D05353FE + 14: 5166B9CA51BEB6D6F34C8149426538B1A4F67467C9BF48033E0CF0227767DCB0 + 15: 9B135D0A184BD1FAE7432F5DC5622FE8AE4C2346B5B7CCE49BF6A1040F39623C + 16: 4FDEE5ED2D03A4CBFE861D22036301E93C0418C56D40CA3B965E55B73B8E18DA + 17: 2B3AC5E1ED76494EFF814680BBEB4D9A9F4EC5D0CA7456F2D5FAD0585AD90ABA + 18: 4D37D3509A392000235D550A8419D0A6EFAEFD0EA63957FBF4FE40A2EFB5A763 + 19: BE6E4FEC5AC49092A42E868DCF26324BE91E3986C184BCBED4DA7CE7EDC97F22 + 20: 01E8CE2DE5E2FA9466F61673023A4C975914A10587BB81219F8D7FB304E9BACE + 21: F5964929973A3F8A160939D18387191D06CB63C077342CA3B1AF4DD28D956B7A + 22: 833BB2EC2996850A1A31BEBE5299F4C3B1F6D02A2A3A211F9FB24C1D41ADE3F8 + 23: D3730A1546F9B49995DC70CE5D855A1AF7DCF18CAC51765C3BEB8839D72A66DF + 24: 8D45D51CEFABF7617592B008F37A37BE2448446418721EE175044D965043C730 + 25: E67DA5D21A665C76232EA4EFC75DBCF3F50101B1244141DD56D739114B4BB6C5 + 26: C47D610C3CE0FDF34CB0DFF91FFAC8ABCD865B4E9606DA4B3E4568B615889975 + 27: 698CD86CCC14863A46EC599C070160C18F7368A9EF6430DE39597C554885D961 + 28: 942187A9236DFB636ECFFE0F9FF766962C81209CC3F3379ADA75D1C2357AF368 + 29: 5F3258F6E99F02322BF9C2E3AA04334F282A57F02D73E86E372D6C3EDD954E51 + 30: 19F4AF814C178BD81A515F0277E06DC028F791E7F6D0427EED563DD7FC35041D + 31: 60AAFF144C8DC8E9768A35EC713DC4F3146F322F66E29C5090AFD8441BD68476 + 32: E3A9AF6573D66861012B6DCB257F5DF8FD4ABBA279AB07ED2E021FE066F09F47 + 33: 711AA63ACBC51025CBE3ADEA8E3D68B95DD73D74E292CC57F62FE9FEF4D8C4F4 + 34: F3EB05A23BF0FA9D13913C033610BE9C7C7769FEFF271B5FA2850986FF75A40A + 35: FD9E5DD2C9E0102EB8A51E1306B3470CB67B6832C711A63156A63D82888B32BD + 36: EA7213FEACA19B5EEE7BBFBA7EEBA25E130222328CC21EF270F80D7DB942BCA2 + 37: 30D371E80BAEC1402B932E3856C15EB2E9F31C8A1D6B5A6E90EBB83AD57B7825 + 38: E8EDB9CD99D83B841C4DB9D0030BA4A4D9B5EEF2783F476316F0E641C4FFB04F + 39: 74D250A28418972D22B70DD6AA2B76DB45E29FEA64FE0B8A7129D54975ECB755 + 40: 51E3A878516AB35205E0D07E4D3932A1EDA5DFC4BC7570CE2060E72DB26AF119 + 41: C34B6F11F7BA6EC028833FDF934ABE864D1C8BD159C0D30C9E6FE12DF73522BB + 42: E59CFBABB73AC08DF99A7A2D79817B85BB0F2AA0E27527BBA4B63FB3A4F1343E + 43: EF7DAA4BDB64EDA5A5281658DFE834253F045C9594F9B488D982C031E68B9BA8 + 44: 1CE7C3AF27EB4453B4DAD5DE87520F0FB83EDFBD07EB82F2C923F22CA94E2D7B + 45: 905E951CC4D99611B6B9EB871FEC52E67B75BB37B3EAB72D0ED313D2298BBFE7 + 46: 762E0642564E2AADED03C6F9D11C375BBA7F483E88031242C1B9C9D05A4070FA + 47: A6EB16F4CC40698FCBA75C296A4B065728B156128B87DBE1AF318148FA6DF659 + 48: 0541B930547BD029B1134F95C7EC45FE3203495D0F4F4DD079D505F3FF1144E5 + 49: 84CC81D678843782D9AC7B1E04012502F9E40BFC42F4CAAB26FE078BAAEF323F + 50: 6319DB86D3DBAC66015D9446BAFA42F212EE88BEC3C4569FC871B16DD92ADE8E + 51: D7130A64E78D8FD210FD26AEE52D1E45F81440A2D7D264CF94E8136F349EA535 + 52: 9927214BB0CC3E83203395F3130AE2249F0EFED925AEA84BC38D67E768B4CEF9 + 53: 261E626722A5F3C64BB8761FA0EFC445FE718A58F4939C459D234021EB18F90A + 54: F5507EF69EC2DE971E14B2B730BAEE32FE34B96B526B9A20829C04B693CD35DD + 55: AAD06972EB603D7767EB9820BED94D13B88CA4E42DB448B410C84FF7FC94C3B5 + 56: D905F27415F62D83C9F6F260C60498A7C43610EC85503AF4667B8C21BC0C97ED + 57: 570281833310E1759DC98388BDF344F1CD71E7DC943580BCEC1EB788F126685F + 58: C279A6821C57EE9E9422CEEEF8940E1DA455D6AAE3ED8FD1AB634F517B2EF480 + 59: E91F2D38B1DA92A76E067DBFCE038EE74CD0E81C0F31E2C3CB473784305A9381 + 60: 50650CFBEE6D4D0F6657B8D064434FE6A629D64AB2D763BA4D4DA19CB65220B2 + 61: 8416B58785C68C7422935EFC970EC08091A8351A33EFF6F59EBAD35FAAD81122 + 62: D4740FEE1536246927B7FDC146AE453C20BBED8B08FDE899F1FDAAF02F5A1270 + 63: 375ACD1D1B00C50EAF0CA05DF92C111DABA5853450441C57D6F639A31D8F99F0 + 64: C143C3F81C9824880C2F0291B15F6A58103B391328D53F88DFC8A0E73F55A820 + 65: 8F418A5DCC1D51D2B5451E11D187060E65FA71455AD967ADCCEA266CC0D94C9F + 66: 09BAD687ED53A5642B29E580B8487AF0C976AFD2567056961A76A3199D05CE0B + 67: 2B0066FE122FF187FF7AC64299EE457CE53BBB52B9D0C572564F989220CFE904 + 68: EA5D252BD1BCD007440D51052C0BA8092ABF6046AF8C96ABA25C21B9F9C32FF0 + 69: 1D7FD07AA53F2E3C6907026CECF5A9574978C3968DD7E926826D8C899556E85C + 70: 2EA43F94BB6924C3931B2CEF0090C8FB3053E1B29302CD16AD9AD766354798FA + 71: D0917C2E81945607C65E049EA71D36A9B42FFDD7CC93ABDCC826EB454847B8C7 + 72: 3575BA4282ECD011D18979AE1FA0AEEA5F72008428CCACF69855402BFFB95639 + 73: 631ECE31A53741DE4A227583888A1970631E100E9BDAEC7A7A1C804225AACA16 + 74: 6265F73189AA56468FE4DBA9BDFE4DC099720F2264CF1B5CB2FD364F433F782C + 75: 19DD20D128FB5018E5C7F31C73FBF11DC64892ABF872EA0D9CFCD7A9712DF9BD + 76: 4CEC1A3D891422F40B76748AC3D5790ABD3CEC9FC51152F2E26C4BEE4A139300 + 77: C16832D1D80B9397613B54B422A1487E9771A98D99FEBB4D475026C4D4242BF4 + 78: 837072B871964FF66990EF5C933D233EA35CDB5E9C09893DE179BECC96FA2805 + 79: C0366D34EE34FBBC6B026661F60786C9146EC538CC91CB2A49DC334E467C0095 + 80: 95115429B0A8DB0C48072D4322FC02AB8251CA18F19C5AB6605E53FFBF35749F + 81: 1D64BF116FA874D17090FF12AD1C1B1FC3AB084A285602AD29962B4AC85EE0F7 + 82: 87D2628E605BF73210CEEC796EAA7333B0B24A41F014B70111B5FBD1991DCFD6 + 83: B8B7B0B1A8EE5B516F851A9B43FCE17BB830811D063D6752BB291D367F7428B2 + 84: 1DA0BD60DFA12621C8447B7B19552C6B87BF22C3B748CCC2354C29E5B2D265BA + 85: C297A0F40E8A4AF8DB006CD7E862017322CD39C1A2B0EF10F99F1B5660AEEC30 + 86: F50D782C19A217720EE223D3DADBB6843BEAB1ED5468D2A958C38713ABAB9A42 + 87: DFC5D6B5138917A3AA5B088E348D0420AACD1CEE9A43850F23766106006827E4 + 88: 5F45DCA7854D4EBD2FC11A82BB8C47FDD920E0F20842027CB8F145800275B60F + 89: 86CA61CA3FD5334623FC01D8DFDC94E41D6FEBE1A06EA6D08783AE9BC7C7F821 + 90: 30664B052BC7367F4ADBDAAB52341B71CC906DF45A61CFEC79D763C739E899D4 + 91: F789B39DFFFB627D25FF42A04AF26EA96D9288026F7950171ED75160D764744D + 92: 619E52054C59FCE2B032D61FFB8F70958A438E89EB59F568E259371D69C4F854 + 93: 5BEA7D888A08712C314E584A3C3B20165D67512A47E2FED3240208ADB11FBFA7 + 94: DC4678EB90EB26C435D1989D1D38619266DA3B8E8D4B1EB7EFFECBE3AB96D0C8 + 95: 050A9C3D445E040BAF5E0EDEFD4DF5F4113201E98F38C87AE922B910BBB67A5A + 96: 595B24A9A01E2D9EC587B3947366AA6E86191735A96B3B888310D74C06B07B6D + 97: 9FA11A915581FCC02394E1467B98D587891E2472431ECBB849158DAF7D15B85E + 98: B53026FB6233B0C18B8BD3AA2F7A6DFCE0E2648A7B883E25EC3725D6AE39C9F3 + 99: F747B648165C851B200962FD189CDCDBB9192CB897826B28C67292A39D7DED1F +100: 01192493F79FD2C509E21F8BB1572CCD9B12CA0868CE8DD5C2E6E6BF1A380D35 +101: FC152F8A4273AF47AC10906C4C89A7C1272241BDC0F5135BE8BE3C84CA050D2D +102: 5827B96117C981BCDC8E25AE0434B9924E5DA32B1953A5379D08686DE5B1435C +103: 80A8B745779BB0E9760E524D7184ED2007C849CAF124F7502779F81C473066FC +104: 75B6DAA37B64913714AA35769D7680CA70BD0553B329626A28102E78C4FFB44E +105: A56908C0AF0567D7BF2CB7F8C9F0F4E404F978B073BFC053D76A588ED45F60D3 +106: 27CC97CC666301E50887FC3ABA3695FE13C7EFE865753194301AFC42EB19B4BC +107: B41FF0483DADF4D5E08D46A3556C9A49F961AF83EB28A90A9D5B0F1C9C8EBEB5 +108: D90489ED5C6EE39911739EA5D996002F8B0DD032C8055B0C2138266253947991 +109: D0BA2D613005FA04A6D6644A16401A4899C7A294807FF1A0CBD9656694D4D20A +110: 16F6FC4FA936ACD8A229E402F026D2D09A3FB9F1F27691E600922324209FA122 +111: CC13CBC8627968D28C96A963252F4829E1D907CC2DDD6333D669AAE391EC6139 +112: D3534E8A1FC18B0CA58B46096D1C131FCD2996EFAA2E5747C1B0FE9A5930D888 +113: 753D70B35D6C7BC01A3DD3B0BCF982583BFEA16027BA4A253B1B50657EFBF641 +114: 925CAA043690E3940F04A3519C15D85C411DBA3E44CB1EEDC39E3ED1404608BD +115: 46557CD8F58B89363413583BEE5C0A4F4F31B441AB29EFF3DD626BF89AEFFD64 +116: A6609BDEDDD1C85887935332428F0C5946614DE71C045D728766779A3E1112F6 +117: 80D0F9D2C252750AAF9DF0F52BEAF3B0D19B14019DB0AEDEABB5FAAB1B663F42 +118: 9BF5C904C30831F6817B07AFFFEC8DA539A332692E0FC66E3E9452EAA926C63D +119: 889EA18D6681B77F7DD7242983CE546B3AC7DDD05C416D28AAAF3418DB5818A7 +120: EAC6ED423CB979D5D98FD9DB50552DF09AB1EF269D9ABF5B02A2769143148A43 +121: F25134457768D42CB631BE8965ACC3EB1AC21AFF354BD35C2B814D060B1A220F +122: 9E22D3BE6959123CE7DA07B66075F81ECF67D551143C1ED3101E1F12870B8855 +123: 00DF80AB54D23502D1BB02819D08C83DDAEB13BC13E9601BE5D012AA9BC4D657 +124: 3FE7390736A6B78870C581DA3C14ADFC27C73CE4E8CA06935B0BCD9D8E6659BD +125: D3E3877AE4D5866DAAA09AEC36CFA21B5314E7032D38D5FC94D84AD90C0D223B +126: 24E2A8BFEBF80BF94073537F686DF034F8A10566847A5B0086F8B76E414F9086 +127: 8DC9FC9060E27D4EF5456A08F86AB81D3BB98136A0AC4105991E2B1F71D889FE +128: B875753B5076ED9DEB7525581AC282F7348B5A63411E880518138567F506DE43 +129: 981AAF85A335E206350D1A4D15DAA926DE7D0AEE9F1F5BA79015D511644B0F0C +130: 6598102C7DA37CF6B7334B00CD906A222C7563580ED3D3B39F9F11D0B0AF0301 +131: 3479EF6A54DE9370A0A1BA3F8BAA1454FC9FA862CE9FFB4F79F8187F2125BE27 +132: 878217BFBC9338C6502FBDA1C923DF806D052DFB9DA271790A9A1B85B39F5EAD +133: 60733D591BF2A04D669068D04461759EA90A0FA68A0EC82265D64744508DA56E +134: C11ACD60E124C3BD50243ABE6D4768D742D29F9415C3AD90A3AD9DD903E86F0D +135: 67F415C2F36F67E99D0EDDAD87496672699EEBC7EBEBAFE89E9D47EEBBC80574 +136: D95CBD9586DBF532A636E4FCFC0DEC46CB670F199198AAF4BE6788D5F7FB9D12 +137: 19C034F7B948C723D1DDD04A5A77E1F9D6F85CD4DADC2D07D7BFD48BB39405F9 +138: 45020399009DE79A761BCBECB0F7347C5EE794DF231D63C132969F90AE9AB8E1 +139: 0EE2789FBE5A12E370F1393624252E8C0FB51C65C5067B8A8844D51837FA39DF +140: 7E0290CF18B4BDE787EA81CCD101D483F3CB1F2A6380FFCB32E062853467DC81 +141: 09B1A981FF43B2D4B5FDB193CB222D8C4E8C5C66AD1E5D3C21D436BE50C8D9C0 +142: FD24C2C0B6278DA18D09DB33B4ABEFC118761998394DFCB8C4D0E006B0ABAA1B +143: A441E7AC72C25365366C324B457E1D6AB791B4CE8880D25790A22A6B6C2969EB +144: 53DCF635B001F853E4830C0B6D6B7AA925BD5F14F838637DDA3A4EE718C059EB +145: D1038CE5E372A6D0D95E486C80364DC8EC540717C59E2140590E4B502D17EA15 +146: 7F4DD9F3EC6AE4DEC08681377D3AC840B0099D25C2626719D7223698BAA262D9 +147: B495BE63F7FA74F93C34CF159F5A6623876299FA622BDA58439D78F7DC972C46 +148: B218ABCB244F2FA345D394C0D3BA9EAF2F83FCE79B461C6A30C308341D5AED60 +149: 2899CAEEBADACDABEB171C3D9B9A070BC42B1D17C7F941BDA9E846F90C3C0BD0 +150: 3E64F541FC5A7EBFA2EFBDD96C6EF665983821444BBB2EB79FA0BB5B76C51A02 +151: ABE8E109AA5F1E401273D85A355B8168442FF8629C3E41E706FFE430CCB87275 +152: 2DD4680471AFFFF9B78807DDB04E055A1F7EB48948C269DE7D81B2BA9CA07C27 +153: 8BB77361122763D51C586DAC6106F2989E74B7F85AD70DB463BB10EE910E6522 +154: 11B701F336BBF2B08F9A7BE583FBDAADA074EF0CE3A547BC2E87970C9FB0D59E +155: 6054881D240814B10B89DACF686B25F6785B1A235209B2D3FFFAE1D4752746F2 +156: B4ADC9DB316A5B4E35D856DA551D1AA6B25E6FE40D77E636975E51005E460998 +157: 5432D73961F4A5AD1899267EB5DE9F2D032970AADA38968210AA8905B5A95E37 +158: 5368C8DAC0C3E84D3109E0B0E5CF5C53C17015310FF59282925487493399536B +159: E632C4E53E53222091D88E2DEC84B2C0EE356A5947AB2508258AEAE4B4FA4206 +160: 656171B95B0DB501E91A175C51BC974F1470AA1042F4576FF58545A50E91AA16 +161: C432FCB7B414B23B569496EFEB7C6FB995F15D9119FBEFD705C91D1D8D08002B +162: 022B5C7DEF3834AB569EF6F8C1DA7E58F49F2F30D045FFF569E4ECD52330FC63 +163: D028B5CBE31CE3D25D12806584E350B73D6D81B823D7D3472A7E7F3FA54FF0E8 +164: F4AC80D5B3DE0EAC631E596E03F7C20A56A23524A5FD85E0F70DD3D6CCB9B0F8 +165: 10747FD771470FA9FD57B9CB43B3EDB8D12C3CBA06F85305939953A7E2715D15 +166: D08EA8C5743A86287A3DD2C81340D38028F0CF2A51E3F1A0458BEC6AABBE291D +167: 7465B5B805CFAA8C948D5812E00F6486C0D186E131250B00834688150FE3107A +168: 92D7513E2A74050A33E46FDCB7D070ABC87D3A586B7A4621DAA71F5BF7E4E11E +169: 6431A79635A219DF89E6C3B5A6012FDCDAAF87E7A3590DB10CB8031FE2C6A005 +170: 0BE055F4704ACC45F2F215930A107187D1DC9C1562B0FFF5139E2B7E321AE97E +171: B2AE10C38C34C3FC2C89B599CD528EEB12B237E3AD2DC577A4BFE6033C8F9528 +172: A32466E6273476A64B0734E439D3FAA4D8F38D3CFC6252E44551DBC5B3B810D8 +173: 9B7E21B4021C97D05FBB65E5FA90A181D4B6EAFA49704855360C02F6C09C5A78 +174: D829ECE0A8F238D772CE5BF5871A2197843F315B16ED2D1EB37DCA96EA013703 +175: 023167EB4223BC883E7D8C7C38ADE42AF3821FB7E371A25455F497C7E127622C +176: 753F711CF07F275DC3E1A23E9630B81FDC068532085C5838A10C46CB34926FBF +177: D0AED3F462D1CAA85CC02F8A6B3A2EA636609BFC628420725C7441614F7EDAC6 +178: 3F4417BFB429566969030D1AA978CCC330E5023655902002D6C4AFADA4099348 +179: A98928F7845882D43142E88E87240D9EE137DAE61B98C5D39B789AD8590E114D +180: 6306DA7B223D3898AD01DCE8E637B1F2DD13AF50241471A216D1BB0BEA5A54FC +181: B2DAE5E3A185150A2B80CD23B8FFFE9AFF074F17E6192E1C24DEBB4518508C4C +182: 1223D7B034597FD7EBE35AB15157762CA92415281094DA7E145C2DA04B08427F +183: D663AC54B4330826E172AA7081271388071B5FBEB252D7506EB4678D54854A54 +184: 3E0802B55C89390B80CB8BD49F35507234F3223D7B21BC31C7A2A9CB699038BF +185: DD4A8FBAC932E409A61F3970B425CABA4A08B4901B1FF8AF78AB63473B12A4F8 +186: CAF1FD8E9C4ECEF6D12D3133C4CB99AA939547217808119BD5471C7E30336618 +187: 40050745910EFE4809D40652FF752EAAE800A271D6C4CAFB375C7F060E9107E9 +188: FE6A5F4AFEE97491B231AF7BDA8EE79FB9FD6F42154613700EBF58F1BFB7DBE8 +189: BBFCF14DA0B02C4BBCF087BA314A69A5CCB01EB6A926816191067532BC003593 +190: 1EA4A74EE88FB70537AA17ECCCC968FFE276FA48D3D852A8063B1D75369EBFC8 +191: 9BD73C3279E7047B8D392527C393F53A75D5F037D3E2D725471735215DF39621 +192: 89B90929270CD6D9AC58779CA9D955EECE0D251E02FECA2067652D31098E92DC +193: B9C571C728CDD03D17119788E1B7073B1148237839E5E8756FDB85E3A1D85E53 +194: E6583FE8ED9C4A6063FC7BB08836736F1294BBA9696FE18770C5A01CDF9E24EB +195: BE93441336B80550495326F81CBF037860ADD5D9C28EA4E05F46030EC10082AA +196: F9459FFB122EA907D7F39253B3B7E06A37045C32F33F751D60DF5842730100BB +197: 63277D26B37209609627198B131BE3382C8DCEAFBC65C2697FDA17C1F3A18D9E +198: DAB9A0AD0B85A48DD50883E5B23C01F1EAE1768D2D1ACE9F2D8020C79E716E96 +199: EA9BD268257F630C1A31ACE736279066B0D1D680EE5C7D4CC6DCF91D9210E501 +200: 17B7A3E7CCC6478DAAE7837C4E18685AACC5702FCFC7F926D0685EF52A083E46 +201: 19126EAF099A9C27B5683CC0C4939B469AAD0706D14E23FCB613E0CC8AF923B0 +202: 3FE1B40BF38C37810110A5AF99A719479825CC08B672AE3146CE61D1985AE248 +203: E08DE3A1463963E314BD7A1772FAFDF45A36062CF14B20A31F1F36DDB5A78CA8 +204: 78647D2B2E362F1200407AF2E5831BF41F09929E4ED66A17BCDB5D7A862CAE9B +205: 7DAB1FA44671926588657945796FA9CB990C691874D5179A9D5CBCFAFDAED21C +206: 7954B56A5C9D3BC80C4B17E79475749F0126CDEF9E9336443E9B1764C5651689 +207: 44D8383683C2B65AD284A99412E29AED2CEE73F0EF34E13B3745BC9D0731A6C7 +208: 71D4B6ABBB26296DE2E9F6E303ADD0F93C3638B1BB83B3B2677D02F48286DABA +209: 985A55982E58B96820DC94A848B479AD5AE1AF95FFE0188C6645134C31CCC07F +210: 269EE8535D5E1676BD7EFB324F5A54ED36D70CFE85F38931A04DCF66616E70F7 +211: 1460A0EFF458E46A8A9523670B93A6E9579E587C183AA9BEED0980F7DF368B62 +212: 81591F9C463F7C22792DD42D250E81C9010DB82C98680DE31D951AB1829E2E4B +213: A23042543083EDD57A4EC79D2C5A43C34C9B6433BC3C199A38C0DF86C92A7238 +214: 8C536BEAD517911541360CCAFE2E8BC2249B43B67BF8B1A2D09836E73238B225 +215: B2308B84E852F8BA58044C901BCD745579F83EFD178CD23FD85650CE53FF632A +216: 8742852257FD8188F9F04BF096ACC7F50FF3437F03D4882800CE64E1A2137C36 +217: C0DBAB7B7203575790E33BD58AA2D1E25A406F1D4088B3FE9EC850EA147E8C96 +218: D9B08D97D4E1B55AA52EF2E99FAA6E63D86DA3CC78A8CA8E45EF58EF49563F65 +219: F5C8CFAB1450530E2F645AE99A8BAA5D7F0143476AD41B4D5BE624F50CE0AD07 +220: 0526969FEA08C93BEE59510A9C4B1E70A26501426174A5C06D042AED823AEE4D +221: 3ABC7667B6063F836C6525C065D5143039F28E0B1731853AEF74ECFB6E01C03D +222: CAACFDA0DD1665CDAE0E1398094E269C46F1E976E05F5F775583DBA2F71197E2 +223: 70E9049F0B0E6FFFDC3521B5FE8361C355FB7E67A801926CB176980ABAB663CE +224: 8A410AB325AA49506162BC8B8116CCBC311A49A73B0916A466949BC72B85821A +225: 862413698EABACEF0C2C70C19AA49943C02DEF683DD6B78E7EAD43794FCC3441 +226: 1B95CB4BBB837A882868C5C6A08FB66218521A544AEB02154BA6081CA40CAE17 +227: 5C931BC92FF7DC3896B4081E41893603A06998481BD60BB82FCFE2E6887466F4 +228: 689C32BD98B033997F1D2A9AF746E63A0A5B79DE6D4D6E858CE8EF6755EC2FC8 +229: A7D22F18F09F2EC693CE318BCBF2E681E78F8907D3533544B38DED54E3D2D932 +230: EA289C980A1491D824A44C8AE9D73C5FBEC8C43AA48766E19843C1A00C762239 +231: 21B1986825371A5FA3E5EA257B3C7E39E5AA0649504251DD2163479220B84835 +232: DD5357464DBB7279BBC7A7A327AABF146ED11845A9DFC623BD39E70C650BB7DA +233: FE9E957CF1DB65A9C0768D090D46CA915F0170D1EBB0EC342F20F968EBA7C2A9 +234: CA0D3C522B886721763CFE4D5459901895624E09AF3F7E7F9566FB645DABEEC7 +235: 77879963E67A88D3354130D647E0FCFC9F57484460143F045FB1AC61957FA110 +236: 4EA2D24F2823A68EE835CCFDBC8FFCF2B417ABFD2E779EF443CE8069C90E5511 +237: 0B530EF2C4B2620BF122E645711E8A47596660E8464E7B2C1C8F420C903941FB +238: 19F115D6D9251413FE31D26A0AEE9CFF59BF52B8CA97B69D2FE764CF6DFB1AB2 +239: A59EB6FAFECD4601471BC24F3E1EA7C1BA5FD9EDF7D84A4C8034F08DAB436370 +240: CAA3A67FD134ABCAFDDACF5023BE2C032708FD211FECDF507486C8B58CE24D61 +241: C02805AA8BAA274D3A66FA440C0C426D1D78E53E6CCA833BAF98B8A4EAB1E5D1 +242: 58F27145A4E702C8E95F9A9517B98CE298DDDA3C0D5A61F3081941284E0F94D1 +243: 86838562B139DD0F2CCAF07C4125D45E7D59FA203B18E0F574F2AF9F31E9C3CA +244: 34E1EDB16414E3AA2131C6B3FC938C08EE426FDA8987A1E19A90EE9C311F31A0 +245: 5CC30D04370BAB8066F0640F1CF723909EA9E1C3A6A04103BFA39B11C3BBA77C +246: 8341D11F1491E460809591D5607563EE03C1BF09169E4F1E64A8013B14CE99AB +247: 39510EE3A27837C0611FC1D5A8C14D7D9759071E6944B0428AC9A7563032EBEA +248: FA4C5F21DB0F426DEC292A9DC7F752BF3C665CAF99AA776F658FC74868418C8F +249: C14DE83F707BE65DC6F9400ACC62AE57BA277BA82E00EC01DE3F34354F6EC89A +250: D7D91BAF0DE69A7548EE02EEE2638A357586F79DB52080ED4C36D7BE5158846A +251: 20005E8B31506A9C45EB81BFDB01E48328F5C679E8F8957786F610977806B806 +252: 8A2512FFA079FDCF44DEB445718DC45DE45B1EF23885CF7764F25505E42B0D8E +253: 4DCC6BC7AF9F767E7B955474682FA2E9E1F70691D146E1A6806CEC84F6EC2D08 +254: DA53E85ACBC931DD0084D0076FFA7F4410C1F34702E5CF12D45763E46C9D8BCD +255: 2BE7933119BE1B6E7D90983F9475EC3EAD2BEDCFB0C688F92749D05954F93566 +256: 4C1E9FE65A4635CF336D6F15BB33142C7940AD8352ED45869BD2D34C1E70AE60 + HMAC-sha3_224 0: 097615C6977516D579CA50AC3DDBEDDDA8A9EA75DD1456D93C426D61 1: C9794AAB2FD0E1E876B0967BA56469EE3470228B21AFB446F75DB0C0 @@ -2639,6 +3157,268 @@ HMAC-rmd160 127: B107A8B0C7B68581969A0F6DB95DB2F790098F1D 128: AD090CC9A6B381C0B3D87035274FBC056012A4E6 +HMAC-rmd256 + 0: 59D94522E81F74D4C37E3C514CE2477617E7ED8CC7133305D285327765C89A0E + 1: 75980FB31DA5B955AB7EF6FAB481CED360AA322D71CDAA64179251A17CB0358E + 2: BFF0C3DA5DFBB29CC1313FAE9EE58C0E8FDD3E3A2EE3FB374CFFA9E498787CB5 + 3: E98081F243E53171F2C9562ADF1E53D1F322C8D76CC7086F90F9CE0AF9E319DA + 4: A60C1EF331862AAA1F47D6A6377696AAEF2828465D18019FC582B6110073FB0C + 5: 491B655A0FD121CD87F950AFCA83C3DED05DF39E747372E4B9C5271552D4DCA7 + 6: 7FA04715742FFE61A4ED085A21A1BA9A63E17D3E33E2D8006E6C4BF4D9BB9EC2 + 7: 6398A004C0F89F0A52D4180C49DD394B6BD37FBF3CB259DB5C450192DA639DBE + 8: 93BEBF56DAD2FF3ABF415541A809FF7DAC28040E4F656AC2B14298DC66ED04DF + 9: 676A915B47F3DB14B35F405940A11AC1CADE15CAE594A40F0F9A29E7C92AE9B5 + 10: 51C880C47FDE7D78D5523F950C2EE332C0CBE566C95A407222A3A01A982D13F5 + 11: 5593F9026A907782C798DFE13F7E573A2DB5DE41522A0475396CFC07DFC8EBD6 + 12: 38332F721A408B59D5B9A85637281A96FC0C7AE266393C09BAF5541955F47AAB + 13: 22BFC946B9671CEAD2C66C1C478067623119E300AAFD0E142D7DF0A259A617FE + 14: 24035649A8956EBA507AB486C1BBB1F1398D1D876EA2686ABA27BA547F7A4435 + 15: 5DDE881A48F95FB52D1FD5EE45ABF2B25B80891C4D036342DEF2122FC0746775 + 16: 6DD359B22FD77402923F8E92B1D2E9B119D8A894834CDC13DC966F45A906A0EF + 17: E2F50D31A720D286DEAA3E598051B205CFD623A80EBB4CB6042B8A610E9CCB5A + 18: C4E50900A180457BF1C6E75F414688480B634B52646527FAE04088883D7FFDD4 + 19: F1EFD15C461DBA0C4B417C7C09E4D56612917611684094BF5F61A945ECE5E0C0 + 20: 3CB5B196F02A9537BA5808FA7EB151596F0992741F637AFC28AA4B4AD2E52B7A + 21: 6BA6B2F421EA4192ABEB66C8A38354014431EA15D0BDD20F83DBC491E13539AC + 22: 922B2DF01EA6C2ACE9BA72E7FBE2AD77760F0DC33ACE013585D1FD5372BD0142 + 23: 04C6EA875E83A76BDE1A324C593CC17548B142051A8E266E55F6FFCB5D7B2ED9 + 24: 34CA6F4642FE68DEB9A3EB9A301F8CB401A486AAA5A0A1099664B60168DC805D + 25: 6176A9B45D37B3A4F919D4393CFAA20D289A011261D6B43A171D739248E6E4B8 + 26: 8A6DB176856A5F056CC519BCE162E0B64530BA97948FF91F364DF1F761372545 + 27: 8E3844CF5864EF0B8C417597EB761D5D9DEF6F1784AC88E6A52C4FFCC7A06DCB + 28: FBE4E41F7C1746FEADD678FD8C456116CC2FE7F41B24D8005E6699C99B8C95C6 + 29: 0FF3C4A9932270DC01A218B4D5EBE0EAC1189830CE0AAAC7FC1EF67C7E3725C1 + 30: 11B971796B7DCDD1F9E3D4641223B44F411C63288C1F85416D36632D0C25E792 + 31: 483736D5568DA459557B8384CC21C59FDAF4489F51E7A816F6E4ADC3D7331EA4 + 32: AA78DB7F399A3326F62A7AF0EC199A4CF1B6CE52B608FBBFC2584CABF8E46701 + 33: 15F3DCBDF7C97406C479D71FD2798C14C6892A1BA7B7C5EDD83D7CA52D14A4A3 + 34: 34E93739BCA8932A7CCB757C023ABE537F537449D278C8106746A737563CC4CA + 35: A9388CB84641DA774B18429786542D4DF82335832F942500260A51C2BB90D4EE + 36: 5E569935BAF5DB6C44092A5D4870DD9C69484510443683A5B590F7AD02D26F77 + 37: 3C55225603F73D1A135D2143286A239C38F94659D0E28A53DFB097E131298855 + 38: 4B7A827E471A17844360BD522CFD4455F47AF5CD63FE575DC1559E6E0C814D66 + 39: 00DA43B21187235560EE862252E2C7497E93192A51B430D2ED9F604D2905FE6D + 40: 509E9AA816CCB27C4754F90321A9E09F967BB93E8E4205616E7F972F7950FCBC + 41: 643DA409BAB43312B22B6A56D529B0C665DE4688565A3F01FE4157E060315645 + 42: 25FAA6FA3896C1BADEC9FDCA8FCCB33AFD9B9A8653CAC3C3F5135D5B5043FCC0 + 43: C6E25EE5372792571917815AA36D7FDE94DB57DBA3AB6876E1F887E33D298AFA + 44: AB3DDFD7E4EA3F200633AEE0B187AB99E8795B50077B589FE531D0CBCEBB33C6 + 45: 4B495DE93E9531F6EAD6BD4AE86BE1DCB0BE281297EC093D470FE0BE5EB26BF7 + 46: 3CF453F7D39D4AAF5B492117CCBAFE34226B377923A6E7634BCBE4DF9C0AEC38 + 47: 7C3DEF494B0BE7E4C5ACBC50AC970BD39757C0D4207767E89528BBA7F3CB69C4 + 48: A5976310EC943895C4A87C6EC1250F370470271A67980A9B604DD1FF6A7C4087 + 49: 21447E7DCF689F222AB2BC32D10791CFCA3A2F56FAD95270E68062F68DDB2864 + 50: 150B6DFF8E507BCF77057F8691AB415EABE640C3E3FDD1DD1E6C1E8C83ABC766 + 51: 1D39B1B97F6B39D084B0F0A6F6596D981BE9B6CAED9E0D49C288C99895953AAA + 52: 33343026C17653A14110FC9327CEE22BA1851D8DEDFEBA4DDECF776ABB275BB0 + 53: D1C7141769B2B1F5B822DA545AC3690E309E496C8DDAEB9263FC703F43A8CEC2 + 54: 296903ED4C460C34EF5AF4DC27BAFC3CE27E0B737DF3654ED1E2F55205AD54A5 + 55: DDEC62CCCAEC19389F4B06813E8079CBE26BDC17548D61EE6A3B066A929D3227 + 56: 2311552BEBC2A60BB449326AF743EEE659F4208459880E4070BBD9DB52C2DA27 + 57: 2CA872DC8158C404FB906F14082AD79F00B4C9344ABDDF214AE8819D3D66138A + 58: 9A722F58F6F78A51DACD98FD80E339CB31F80A2A52821F3BBE3EC99CD3DCB8D3 + 59: C37F6C6838DB764C27679C1A6F9CD95CB3A8527AEE7D7A92E7B5CEFF7F6AB0DD + 60: 553C9F658CBE292BDEC762F92E931F7B0E29EFEF2089A598B251BA9CACAA9DF0 + 61: EFC42E9A5DF177057708A364A996EA959211228B1E10C814960C5BAE25AC79CA + 62: 64B282D748E22535180011D1E18817073BF2735ABE2DB39DAE23DB1DF40F1900 + 63: 993222620F8ABE4B5285EE4B75F5F6970B9D1B5DCFE758A57650CAA413299D62 + 64: BA9A74F29B76CEA63D4535E5AF807B1D8A8FBD105B9A6D6ADD424193B0B033C2 + 65: 621EF37F2FCFE2AC7363224B28871D2F28431D1621353AB07E18DDE5EF482ED6 + 66: B2CF89D5896A1A754E2BFA2A313D2F2FEF4FA871D5424090108F5E2C92DCC489 + 67: F591B64DCE89C0E785EF9BC286D6D7C9D34EC413110DD6B7A7A55D6C9F11ABEE + 68: 5A5037CEE64C29FFCBE51C0F9A4F1A9B8F5BF3B96844F66FFC6E91EAC6ED4196 + 69: A5CD484B9FEB758550A2AD0606439A5497845A65D409EA6EB013581B7399B83C + 70: A467C992FE57B26E79B2797BBF1B8AF1B823967C78D34C4B87DC5B73635CFDB4 + 71: ACAFC2F7508FA9480740B82A1559EA9920C620E1F13885D7B20F4E0A07D24DA0 + 72: 542150A182052AD17AE6750A7F65A1CB30CC1CA0E2828B5AF578FC7D94176808 + 73: 2DBAEC413AD340511269F2E5D875AD94E416FE4F8E207E8CA9A9AF3A9B7CE37D + 74: A0A8C9BD72C37C79DDE4158812ECBE8C967A95DC24E90492C2F69311E93C224A + 75: 0A8A77A972DD2E6D4456478877E6B79C39EAB34D353C0CC61C28B2802B81767B + 76: B602FA82C2B8D5CD187CDB4F35979D2E5D62BA25F34ADEC877A647259C870DAF + 77: BD9C07ACEF9235F011E6A73B3A15778B3B94CCAC18D2656239588C666ACF9D49 + 78: 53BBC0CE653A0C9A1D0CC9050B04C7D9988E009BDE2A68DC7A4B463F09BBF7F6 + 79: 0AA89E39EE1F29F5AA38BED023DE510DDA2F647A166ABD42E4B457BB7C850A59 + 80: 66D14665A97D848892318A7353A931464731AABAF79BFABA31C7A376A377C259 + 81: BD5F75E35938B891C9E049DC8A24C8E20920AE8703C2D65541C67C469DB9CE31 + 82: DCD90C771CD1586F58A9C3B0CAE4031B1827CDBBF8F8BA1E6BF4428F60A8439B + 83: 3DA4EC80ED0DC078AA082332F9258638D80D806453ADE1E5065FFCCD929B5C0C + 84: B6601F93B52F406FEC2ABA78D67DBD464499D255DB3FAC26923E80916B633D33 + 85: E83A6830308DBB72FCBE0936409C6BF556937A3A19D45BDF1EA61F8E4FD88A28 + 86: C06C09A0C727566B81D8858A489F23386DB036E67383DAEDB4F07973779B8BF6 + 87: 973271C0A71C38D1059A2E67D8F01D88C3DA8857A130E8F8537CBA7FB123540E + 88: A394A56C69C8B02F18F62FE7B6D7771B14CDF962B871BBA164811519E11850DB + 89: 3EC44F2894C6170D0995AEBFC43D182F7C4F45A39EC9CE28FC8032DC3AAAA7C7 + 90: 186EAC056FABC2F88F2AD2152A30994DC3CAB6C90545CA662B7FF59F57E73EA8 + 91: 03B9DAA373AA3C9BEF969C64DD0A54A512AAE317385E956F8C14A078201F9C69 + 92: 46EEA803CD185BBFF9A621176EA362A89D9BA277B5845703FCA216A3D09F7CDA + 93: EA58A619E011F8FB240F7949B3BD72A4D74DDDDD39848A1F8721C7D7F72F77FE + 94: 3D21A5B4EE13A362D4191D7126D62290F516DDF8D5A0F10BD130BE19A0808F25 + 95: 4C7444891287880768F84925F262EA12A01C659B635ECFCA3FD91C6EE36E0838 + 96: 27EA80057F0101DEF3355C97864AC92449DECFCC49EB4082174106B91CFC027F + 97: 9268A7E69417810E40B589A92899FD38818C0A1C95C45FA211A3AF03F155C09A + 98: 1E48B801D8107593C2BF886EBDDD19EF03DA463C2C0BB3F517530B025115A710 + 99: DE025B408B848ABE14FEF508D2F9DA921B8E9168BADB3B09B104B2426BA2DD36 +100: 42854A2F179C5A23B8347210C027E87E2943438220A6EC50AED23848D5AB8B21 +101: 265527373FD4F600EA78CE9D7B4D11E5168B7A10D091D827495F0D58572D36D5 +102: 64DE6A36BBCB296C7D216F8D003E206B5A612AC919B4255DD2D63AE65EB7F024 +103: B3FBB1442BBE6178079BC275F7FA9805C52734B90901834EF98536F22F80926F +104: 92A8C765207FE0DCA22D251A7570642A28F0BD5502311352F6E9A9CA75BD2AC6 +105: EBB7E317B38BA41012B872342610FBC1EA6DB09409A46C64C61F3677A5B78F25 +106: B43AA7CDBD939977AB7C8FED49E40D9AAC21CEB98049F316CCC7DC04893B6199 +107: C07639CF7817F04B7728AF815E04BA0C331E79CDD7B292DE7C4AF1ADF90DC636 +108: 134AE721E2094F9E4FA953B53A680D61603CB9963C20930DA027D0AF0E4FAD9F +109: 128A649C96B60203F0EC2C3A996628702F776763CDB22877E7B0B907729AC848 +110: BBCE42FDCF9A8D8D04D1EF37CBE4F9042A5691F429FC6C39C2755D060009E2BE +111: 3AF2C22079E6E52FA0BDE3B80F57FB0D1550DEEB2AB369F5D02D8C432D8CCFFB +112: A84361A8796B82E8E2B30A2D933A45011090180C07D42BBCC9E72395EF7EB140 +113: 89C12CE213A67AD8661A720749A61550CB059B885D22CB4177663420624E4D71 +114: 2F22F53A1D44F6B867A7C6417525A914E05C50996F64542FFBF37D8AE4807E19 +115: DE5A4C424E20D3C318EDE55409E1C85464F8D7D003F9E35E5B7B5A768C79AE3D +116: 9E87ECD7C672F00B59FF568B8AA9FD56539E46EEDDE94436083AB6DEB83AA199 +117: E12433F1D81F60189C50FDCE7FD53D0C819DB533A5EADD0F1E1FD521E4BB3B42 +118: 4C7CDB3FB90E745D83FA08D726AA2F7E2E31B2A501C9E7BB47CA8163DA5FF74B +119: DAAE1C5FE8CAAC347D7B054D3D9F9EC7C4D454D5E119E014EB0298978385ABE8 +120: E4BCE53EB683B770AB162A3AD630E3A7A689DB1DD27AD3877C7994DE337FDD83 +121: 410EAEC6033749B341FDB60305174E7F462315AAC28FBE05EBEA2A2A03A34EA7 +122: 3AFF9691776D8C1CE721E03EB46A3DCDED894F3624CD992778DBB91F148E6E97 +123: E10A1376446F2906B28922CA87427246B6F04CF15F4700A13CF6C487E14875D7 +124: 72ED1CE89A1BC850EDB6CCFA7551B09CCD5707CB3C0DA787FEEC08DACF35EBF8 +125: 2F2BA57B7232266F6E673866EEDC6CA1D07BC00F20D0145D59D121508233ED90 +126: 051374EBC0F6BE3AC550E7B7EC8903972EA87762479A5C112D80BF0E3843AB9E +127: 75BEC020ABA76ECAB07C5B4A8BE94DA2A42958AAE79D3E2799CF1D748724AF3D +128: 774E9572A3D3C3F96BB90D2FB91941B34AEAEB5548AE9F6CE41A63EE8F0553B5 + +HMAC-rmd320 + 0: 6BB314BEC5001997F31DE90C60F79399239D990B45372225929B434D5B696EC48F6EC2C4735F372A + 1: 798E82821DBBFD7B34F53B8407C1330E7CA0CBB66C99CCD513E0DD5A08AA0D380D16A78ADB0271BF + 2: E4D7BC694B251914E631112D6CEA4B29271B83109D7E8DA8E03A92A49A9F055A017FD30EEE186FF4 + 3: 2D947F3147ED5A68480D0A565CCBFB1DA181B04B7FB3BFC8A74275D235BDD9A1BCB465CC54460D64 + 4: B79D315D272E933DB98666C192F860A20B8471D449A4745489EED72617163A1E8F727F56F876889A + 5: A417489F3F98D5D8A408B7789D2F8457110E0AB95358C27CD9C81D7774F31952F1B4BACB26F5374F + 6: 7BB776ED9A6022839A3037FB70741D9406B3C50ED0BA73F9E762561E398C67C6B45975B0DE85B5EC + 7: 7E375E18F2F29FE221B262D1E8A0726748CD1E199257186A896E0A7B1E0FFD75AE5357104A179088 + 8: 60BD273642B504D1F31E7C5C3A6D6ACA22C7ABAC992E51595588F116B87DB81331185195F34C99BB + 9: 4EDDD02A8CF75B93C07A1FA732AF3DE3027FEE6BDD8564A03222269AD2C2FA327FDF7D59D8AD5856 + 10: 1AE3C26098F28EC4D5A3440B35CA1A45A104606DF34B98D15E8BBF95A6BAEC4C9723292DE1EA5834 + 11: 589D63167C20AD3DEB5766F7EE04B164F23DDC49F7B4A2F1C9892CB50AABD7998F22A0002012B719 + 12: 8A465B4BA95E864304D58D9693156FCE2452FF5F51D13862FF73D021E42D49B86AAE2AAE4D767468 + 13: 93FDF311E9A19571F56C729C9927EB26426B2A5451F6992918A9D2089AD1F77E08140DAFB20A88BC + 14: 761DB9147A2B72C9EA422164DC50945CFBC32BF1A04901CA19FB5E2A5FA564CC3FAD559FC0E3FD03 + 15: F1DDE31A584036312AF2EDCC7D0D03D25884C4A2BF681D2CBEF82CE669F826DCA47DEBA37558B83C + 16: 39E5ECBA876455DAA4A3D40488F0AAF07AF70B17600E79070FF95E208CB4F951D33550461EB613F6 + 17: CA1A452109245FB116C6266FF690AC37DA25CD57CD0E2E75F1A8B5547781860FA7E73FFEF75DF136 + 18: 94A5EF723D68468030C880B61BDBC7255F69B507D0CDB6B2FB21BDEE95D6B7C0A957922875FBE848 + 19: E041DDB6B8AF59697C14AF917CDF6B58C22F056D09F975408714E279ED203533D027B3562FF038F5 + 20: DC76B8F8C10BC843BB72E2A81A13EC96B40AC4922B3E18EC6DA326D8B3B88D5363F14B8181296023 + 21: 81E86006B92EB73887118394828F35923E5BB8A56D78A90BA69A157B6C1CEFFDDB5D0AA37477520D + 22: 67F975C805364CC898C90A4B080D2A99CDBAB174E572900A1B16AE3B0D6371247C81A216F295803D + 23: 4B60A0A089776065C394553B0A656577E28C7C8A3B91CFBD8A77382FD6ED9878C1ACB44E8407DB1F + 24: D042070EEC507747301CC94F3946C20B06E2393E9E390B22A219618A916435F441010FA41DD928D7 + 25: 085C7DF0D8EF339C86362BA78D9E57BE4FDE0391075E4279271355E14E3001953D3A3514D551F269 + 26: FCC923DACCB76AEFB583A4DE84C494AF5116A39CC14ADC7355EC42AA4349928C906CD205F56DF3CB + 27: F544AA58C8216300BEFD81DD33B583082C10EB4E7C50DE319330359835BC0F25646CDB413D64A668 + 28: B90B4C339ED9C060BFDA64C34435E47B7C35F8DCB2F1B3330C40D7DFD10A01FF23E37DA2B995C7FE + 29: 085C91FE6DA876348A67857D87A28759262015BF4F5ABD44CF24FA1392F12D34DF61110317945D6A + 30: AB770E7FB347BAA164C66A2CE4D884554E23DDA0B51C75C7E1EB277AC0771757C7EA27EDC0D769F3 + 31: 2D0DA3F543CF787F01F52BCF02A534032E536444253F50B5553EC959D73E111B592E48628F9C255E + 32: 7FADB0E3D3053BDD762EDA1876471BC98E0E7CD50BB72F05FDFB5BE7D9703CE2909060159B4E48C2 + 33: 8BAAD87A1D5E786B57BC03B50F93ADD6C470BF113A4D6019E59AE9EC8CE0616F0D9C5145A3A2550E + 34: 885B843E252E320D55CCE929CA160DB74E5FE3221385CE6DAD3138648BBB2B593153468570675C2F + 35: 0D0592EADC5E67CCF74CC21C7277C1212DB2ACF02FB3A508C77E1A2DD58B77F195BDA70DC5E29DAB + 36: 4798AB6C9B0840B17B12E20F3212DC92655F365905A563B1027C6699A745D6E063491CB9D7F4A571 + 37: 20318E2FED8E7885005DAC59811AEECF1E1BDB2DBA9C14599903AA484C033C9E54EAFFE042E9C0FE + 38: B01B287BA0808277512D8FB2461AC19A9093C497543B58757946B0873C0C5FD2D144A3E70D9DA1D6 + 39: 267A806596127FD0175E96BF26704F07C220014AB64D430BB379B315B953CB46D5136D2E6D1F52E3 + 40: AB4230A4D10BDA68F3B66FD95B151367DD5D3CB2179FAD56B857BB16AFCAAE72FCAF0D5032A4656E + 41: 029490B3A1D5B12A9C500B30DFF6BE09A85F232681E9F90FAE22341FED751141D15427C428FF8B27 + 42: 1EED80F1774A580A4D5E3BED52FB8C0C8E5AD1E3EF242F0C4050AA10A269B010A4E48DD9CFE49099 + 43: F85C413166FAF8F0093DB7D3933A2292DE0F33BCFCD3A98EC32BD8E9DB53B0FC524603AAD42F0D64 + 44: 4A38A4345E6308ECB0151B09B53EC23E0759353AE0ACE5D64074F3C8230E712CDD2EE5DDCEC2BF6A + 45: 269621A01A6529C8907A8087D404A93511F41EA3B9FCC29B2009F2225F19A56345B54B2D75D534EB + 46: F1A6B2F6C73293AD7B96A34A9A05D0BB2A2B0CD00F35318AFA0CFCC0DEFEAA7991B250C153A8FA31 + 47: 7C70C8A59BE27854F6A10423DB923AEFB1ECAF1EC79C7A27DBE7D21D7A799B16E8518B457968F727 + 48: 78432BA93CE7919435DF8BBF67D38CA0B593958A78F9CC9D62251C21D7C887AF610D4F6C6CE184C0 + 49: 30879619A02379E089099887B60C62919A8466669B18669CA4C15DE6B2FCD86C26AC9AE81B46DD8F + 50: 79E029F4F43548FE2812B40EC820B8976BB4B8E28847B2BB6B4E7A8D2B1C88E3A8068071526C551B + 51: 171D1DB475617F58229CE6F1C47E3DA6089712EA53FCF083EC3FCBA5082CA4127FE5459311C791B4 + 52: 0BDE5B4882677F6A9FA7649FE011EBED390BBC3E97234A5584161D529388E624E7640F7CF58C9DC1 + 53: 06229FBC2766AF708181DE0EA6AFAED25FDFDC72569CB7B40A83FA7A762E24A4CC9A37CAD39A4BF3 + 54: 1D1ACA8D58D2AFA6AD8A255E8207318B72EDEF9A90CFB6AA6E26EB0265D3F26B6446DECA46BAFE1B + 55: 6D11997DBBBC11DE6911FAA890223D0E7A8C715405F39295A0E07E2E34327AF22950E20232DE1FC1 + 56: F8867E791006CEE84BDF1B8D2C2B697AA7065209D38B3F60011EA83A2F9C770F21EA57698059DF88 + 57: B06A67F93CB85A2D65FD549EECA5E13299B209E077CA5DBDA6E7D3027A4AC1DB58CE2EA131849C2C + 58: AB600BD8835C2F98C1AE73D52F2C188AA2F2BB33DAB1114843D414C202516287E7C3E023B7CC5CD9 + 59: E3117F1AF08AB8690D112D8C53A683CF8117D9ED594AEE69E54447D5DE852EFF0EF0D71C5BD22900 + 60: 424D992BAFDA125B094064336CE620F8F9C8154185580019A1B581E5187C1058B6A61A65F2FFDE92 + 61: 58BB0D6634024C18BFA08A45C5382E6151A26EECFC8D8B16A4440E32055E9249F5B2829D972A2C35 + 62: 219085E65E688663849B415B335BB7628B1EA4EB04AECEB41A9F09C59A5D1BB737BF1D899A9F7A7B + 63: 98D900253BB8EF2D886B5C71F5B2AE5229FB68818BF58FDFAF75191DD9942D15738EDDC975B4034A + 64: 7032D6661227095A6A7E6B5F1AC45675FB2F0347A8597A58B715C99CD2441E2857A32E1017C1C7D8 + 65: C6DE00BD52E2FE7DAEFAB1E3410556AAD23D5FB43C86105BD928C2FC68405EDC5AB2A74A17C9C32A + 66: C50B407AE3D9FABF9E185881B89F94638B067EFAECDDE349A5024217BF6A00B48AFFC85736CAC75C + 67: 9A4D2FEDC6F9BC6C322E2CDE21605CD9D8CCF1B87FE27B1361E1916EC443077B6DC751F2CF677682 + 68: 224A1604745BE2D9E451CF3A90831EBFC3167E8D581CBA8FFA37A3A65363FA8399D72974730EF213 + 69: 19E7D976BE38FE1A3A9842C0A453BCB79242A5E0CB7514BF23942606278993EA31C31D6EE422AD98 + 70: 8514F6461280FE7EBBE1ECCDF08CCC1238CF0A2F0D248987D52C9565FAB8DC359217DC27AAF33038 + 71: 73CAD4AC2B14B27F35F65876DEDDC68837743DE3D7DA16EE546D166EDFCAAF0CFAD4313A4ED3BE20 + 72: 4B394CA698A8BBA23C9058BE76E41B9EBBDC199B1F586A0C0D2823E954C1C0AD393B8175D1043987 + 73: A104492FAD9FEC60F46EC4CDB8A76548254F60EF8F527D642DF4C8FCD0657D593A2EA0D68B491929 + 74: 95DBD131492620169B931F3380CE81CA21B8B7A24FFDE14BEB138EF37E3E82682F7C43C28CE69FA8 + 75: 2118E9456D6FFB475BAB84A45A77E1146DCC29EAE15BE88D282A9FB6D8C0D276FB46145367F578C5 + 76: EF61D525B9F715071307E135259E5BA8E19ABF8BF7E7025BD2180B263E1BC9C805FDE5013BD04278 + 77: 98B374C8CB3EF9FAB79E5C1442B210AD11B294C7904E2A48CFC3B71065CE6124D8FAD2C6A59167B1 + 78: C4238927DFF50B42A232D5FCD5B6C3937F2DFB2172A5C8830CAED90F0F3F7A3E9AEC16BDF6250ABB + 79: 85116B15837AFF5C066124B962FDEE740271D5B78C13D7B26070920BBD6C6F86F8068F5751C376B5 + 80: 9C10D8274E4C24E39F755BD9A8932DA00FC07855ECA01A1443D915221C1ACCF669EF5B59030C32E0 + 81: 8DA2CC33EA181D2DC917AB2A83C91EF35748A8DFE4CC49813B79A57A1C3DB777E9FB544EE9A97F12 + 82: 3D97C075746C74D2EE5DFBDBBEFED73D5C0F45D533D41EA71014604D066F11543F3ADBBB0F5914BC + 83: 9CDDB4D0A43995EEEB7E3BE7C8F6B00F89CEBB82FD29684AC53588FF463DB62BB7B3364D43BC55A0 + 84: 8AD4FE46CFD443AC7CF50EE17B59EEB31356CC286E6FA58943884942B8C72A21F47DEF8DC6570B21 + 85: 7BF233C1100766FA2C2E4DFA60634720E48DF93D0A309CB91E2827EB375E2DE6714BBE6D5400B100 + 86: 6FC30072CE402DA07F48CBFB6666E4332CDE4E91A9D2703BEC137337E1BA573E3FD11C662F022A70 + 87: BBFB1B50F80FD8FF1F0AC361FC7D18F798D162B09538E8954EC5F976C2021757FC377534E83A96F3 + 88: 0CBA5096A62AFA90AABB8C96CE685E38A556BD3BA605E128B3A38CE4573F182B9C3687362EB9B624 + 89: E8899744EA6EBC9D4E7219CB44AFD8338773848129058DE95F0845C9A8A80B8B2FDC281B2415F492 + 90: 97CF03B2F452319AF31F703EAA3D35EC25C4AF324526ADCAAD9C2994B8EE53C710FF2526B34FA1E2 + 91: 3F471E6848B2D18A6BC714F18C28A306CB0AF5BD4CFE60CD02F59D9587F9127DB68170A11E1119D0 + 92: CB39FF820CBAE0A0B633FA81CC0D57E88AF717AC7C86D3908052E8BE9EDAA546661A88ED8DEB2EE7 + 93: B675B7B8E056F246FE9B8258CCB96C0BAFF1E6F4EEF43003EB6463FD027B9EBDB4875B56022ADB3A + 94: B94A823E0C2A1C4317F81239A5D8BD59BC995EF5D69AA1BF402BED31A7FDCA92F54C2F7BF43429E6 + 95: F066FFC74CFF306E79226BFE333B518745D93F770620BCFE0CDF901317810EDC70E112C7E88BD815 + 96: A9E94157D8D4761A70C5F6FD1D0455785A4A9A110F935765B8ACD2831177305B04556B17D12D01F3 + 97: EB5E300BE6D90DF92E0BC094202485AF4EB26CE0B8DB98D3044F76D47ED312454F20AE14FB68C12B + 98: F9C8B99A97F9987B64816CA6CC00203D186CAD4AC2C3661C114242BCDE403BB3F3E7A706515DFAB6 + 99: C9970011DFF67A72D5FF5E0F60218D2E98F35030DBE72D435FF1F9159C78C7544E07EFE655593854 +100: 17C3BA5BA65214182BBC95BB8D4E07D02EB7A37DF36DAE715EC6FB8D3D4690EC8BD02A7A57E8AB19 +101: A7227681F0D673E7126CD8253A7378002FA25E5392A9E24579F3767AB35D4C8831B9209142E6E776 +102: 8D28CF4BDF88665DD6BC35D7E9535341822298C1CC62E9733668B471CE5FF2ACFA19DB59D089AC43 +103: F8E1AAF0F8D39E35C8C84D89751D79296DBCCB7B3FCBA5CB56DB2392E9F10ABA6218BEE5A9F174FD +104: 4111B0C5067C81391C32E3E8BD91408A88C3C6C793B60688180ECAD3D7141C477BEE20D1E3D2EC90 +105: DBC4B2C5E17CA81888B674C7420955827A415C840FB23EE559A49667081555429C16FB5CCD86552F +106: EE4FC2FBC4F9C83E2C7E953B4A886EB5F8DEEBE999A9C2BACF2BDB06C667B9DD85AEBA24A6C8F0C4 +107: FE6E3C557695182C187DD32E72DCD9026E234C9DC4AD5839D586633B207F9D4B2C8547A48D93B929 +108: 51354C2EDB9BE21E6CC36740846D68E46E7E7C4F760A8F9AA05D5C4A949A87EF23D710E2BF3FA87A +109: 134A2795887A51348B9506790B97DC5670AAA2AD8F9A41AB6AB03CBE4C5BAEFFA4B643EDFD2E0181 +110: 6A31F6F9BEAEFEF32C5BDF790423699FCB7B2D819A24BE4FE3F54AD95F7A41F1FCB0B79AF0A5EBCA +111: 234236F8CD036E05CA2B6852350B819447E3F983F20879E94FFEF7AE6D28EFB984B67F6E0A4ED39E +112: F152513EA12A563C4076A2458F661A19945664852936C68FDC3385DD11141405581FF0C097C58023 +113: 7A81F710EA1DCAB08636B33CE8C8B960902F32CB278A142385D4BCAE50F636AEB24A83FE9DB13361 +114: DFC9843B0614466312DC05C5834A1A8EBA0C95A2525E780ABADFF7232BF283FB0B71DB29F6061E59 +115: 6C11CEA5DCD9CA78955B65F3382115922D0A43D4DE81BA38C3A57D652A7F94CD521E65585B19C147 +116: 58D2C0B7F570BB389C196895FB966B74CDBD52DA42F11D11003C2D37B44E188003A4EC5A43E53C1C +117: 46149B68DCC3BC2CCDF7793022EFDFA7AF4FDDC23EFC067201D04841E2A7B9B682B60C4E5884C706 +118: D41A6E7699735ECC2FC0024CE6B3A61B06451A8998238C7F9797BEA77D80C3A435D5F6F940DF08DB +119: 23E219B422EFF356426CD7B4D175F8FD3E52310C09949157F404FB62EB37A139CA1E074BE140ECBD +120: 490D9B7A0D2CA906A329559958538B1DBE8DA8BEF33F943F79C8F2ED79126918664268A7AD48B6E6 +121: 6AD73A16893954259ECA9913AC83B80DB1815B7037438C6D885321531B97C40AB6DACC25155FE05E +122: 2760B5EECD5D7E53366CF55E7F4A19BA06FE50BD2DD03B78D0160162C24916960615AC25918DC030 +123: C751EB15AFA4119BFE84FF425BD38108257DDCC50AAC93DBA73C4051D6243A50D02BE0F3B930422C +124: F6C5CDA89B7111614B439578B9650EA676DBC9C67AB5197998F195320AA6EAEA80C97DA35ACB79E4 +125: 9B63CC8479312BC44FBEF8B39A7B73B30E19303EC352488DB3ECED0EAE7A0E64D0E013DDEAB7D97F +126: 3C2FA4A747A64F5DE9461C04A30BF2C56145A90964C65B1F3B25AA6A360734291ACC10A4B20EC283 +127: 74519D4C3430C954CF68C916BE147CEF18B8AEB730BF6F9E01EC3E3254D20F37C01E8AA30A2242E1 +128: ED76E76F98E7BE04796DE0797E60C6E0659A274C7A9804358FE40804E2BC68D88E60ADC29D40592F + HMAC-whirlpool 0: 5C36BE24B458FD3713761955F28353E433B1B818C8EF90F5B7582E249ED0F8C7C518ECF713410885E3FA2B1987B5DEE0FBAC210A007DA0FE995717F8FEA98995 1: 30C66EA7CE95764F4CFCFBBE4C166E80A1F23E8C88D2DB7FAC118BCA9EE28299778610D94CD545C18C114A2A144F9E933CD80238E9F1AC737F7149BA232FB846 From 7a83cea4db0db461df1608518f9f4c1b17e53b7b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 22 Apr 2017 16:20:04 +0200 Subject: [PATCH 0629/1192] use appropriate names for sha3 hashes --- notes/hash_tv.txt | 8 ++++---- notes/hmac_tv.txt | 8 ++++---- src/hashes/sha3.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/notes/hash_tv.txt b/notes/hash_tv.txt index 9de0852d7..80bfe42f9 100644 --- a/notes/hash_tv.txt +++ b/notes/hash_tv.txt @@ -1859,7 +1859,7 @@ Hash: sha512-256 255: FD932614F375BF71420530A690CB16E52C08E99CFE741AC8436FCA8C8BFD5676 256: 0837A11D994D5AA860D06917A8A0F63E3111B95633DEEB15EED9949376F37D36 -Hash: sha3_224 +Hash: sha3-224 0: 6B4E03423667DBB73B6E15454F0EB1ABD4597F9A1B078E3F5B5A6BC7 1: BDD5167212D2DC69665F5A8875AB87F23D5CE7849132F56371A19096 2: 334CDA37A26C0669CC7A5074452F033FD57FD96AE0729582B69F865E @@ -2118,7 +2118,7 @@ Hash: sha3_224 255: D95C168E8F666375A1C7D574686D36293FCFD3717D79B212D47D97B7 256: BD34C1FAA03A01DB5E0C3A3D5E0440D6E5E361060F3DC9D149A26812 -Hash: sha3_256 +Hash: sha3-256 0: A7FFC6F8BF1ED76651C14756A061D662F580FF4DE43B49FA82D80A4B80F8434A 1: 5D53469F20FEF4F8EAB52B88044EDE69C77A6A68A60728609FC4A65FF531E7D0 2: 76AB70DC46775B641A8E71507B07145AED11AE5EFC0BAA94AC06876AF2B3BF5C @@ -2377,7 +2377,7 @@ Hash: sha3_256 255: CEB94E2E8BD45BBB4AF2A3AAA05CC3F7BC010A6C68E242923CE3731A108DF8E1 256: 9B04C091DA96B997AFB8F2585D608AEBE9C4A904F7D52C8F28C7E4D2DD9FBA5F -Hash: sha3_384 +Hash: sha3-384 0: 0C63A75B845E4F7D01107D852E4C2485C51A50AAAA94FC61995E71BBEE983A2AC3713831264ADB47FB6BD1E058D5F004 1: 127677F8B66725BBCB7C3EAE9698351CA41E0EB6D66C784BD28DCDB3B5FB12D0C8E840342DB03AD1AE180B92E3504933 2: 6A4E8EE496C5FACE43BFB748253EF689F1709986EDA8ABEF8ABD5674A0A9ED2B36A31EE29ACB146DB15F36A32B3F2D63 @@ -2636,7 +2636,7 @@ Hash: sha3_384 255: F5CC4DE5026A9359382B096635EA02874262DC3E657FD8EB10E297DF8A77326EF8F73220F4564AB23C092F24E68FDA76 256: E834031D7BAB82AC00905187335595E020C5BD3220924F4F551D7485931D2CB9EFE90B6574FC46B63265314781DE017A -Hash: sha3_512 +Hash: sha3-512 0: A69F73CCA23A9AC5C8B567DC185A756E97C982164FE25859E0D1DCC1475C80A615B2123AF1F5F94C11E3E9402C3AC558F500199D95B6D3E301758586281DCD26 1: 7127AAB211F82A18D06CF7578FF49D5089017944139AA60D8BEE057811A15FB55A53887600A3ECEBA004DE51105139F32506FE5B53E1913BFA6B32E716FE97DA 2: 23A5743EA4136810A2DD503252708D35151259C859BCB7AC46F5F120429983D14736FFBEC6BF8F174977B44B0C5B73378EA88A4EC1F7AA295C04B5DB9017CA48 diff --git a/notes/hmac_tv.txt b/notes/hmac_tv.txt index 3e01ad037..7a3919b59 100644 --- a/notes/hmac_tv.txt +++ b/notes/hmac_tv.txt @@ -1859,7 +1859,7 @@ HMAC-sha512-256 255: 2BE7933119BE1B6E7D90983F9475EC3EAD2BEDCFB0C688F92749D05954F93566 256: 4C1E9FE65A4635CF336D6F15BB33142C7940AD8352ED45869BD2D34C1E70AE60 -HMAC-sha3_224 +HMAC-sha3-224 0: 097615C6977516D579CA50AC3DDBEDDDA8A9EA75DD1456D93C426D61 1: C9794AAB2FD0E1E876B0967BA56469EE3470228B21AFB446F75DB0C0 2: 160F43A44A0D5AD957A97141C117B3CDE7079E2B093FBC2F7BFFB88C @@ -2118,7 +2118,7 @@ HMAC-sha3_224 255: CDDF05CF01FBAD632586BFB8C453021CBC44EAAF7EA155673CC4C110 256: 2E0A0B3D18D78CD2A8F21221C370057E2C2C98FE1AA75FF7381F5622 -HMAC-sha3_256 +HMAC-sha3-256 0: B3AD6507ABF79F2775C8724FF0659861665296472853A25E1ABD9CEE858A47A8 1: C4C1AC7AE45ED7AA1E6CCC92855E1E034357D4113E59F6F4C588E8A3C310DAA0 2: 91A1098068E71CFDB0F7058087D30C39DA45AF732D6DA46BAE30883043CCB803 @@ -2377,7 +2377,7 @@ HMAC-sha3_256 255: 23F29724A5E3DF649EFA1E76E1F7315E4F1AB2B9F6DE9992A7DB3FAB62D19F10 256: 6BB2FF61EF113873D4CF3B131853F2469353A2B1D47FE80DE2FAF576C455212B -HMAC-sha3_384 +HMAC-sha3-384 0: 676CD697B065FAAD4707FBB834A0FDA2D40625AE7ECA830E8EC4F37A200DAA5679825BDFF7AFE8FA1F31541D3E6751CF 1: D612288B7131DD6CD179E30BB8E7D22C90C60A9AB3D3DF0D36CA134C724D73755B45C432AE3CAD077368771F7442391D 2: 458CD8A7953C21794EF452522ACB3506F6276D453D2F73F39B26F531327D00E6A0ACD6FECE7275CF86DD9AC30E56BA2A @@ -2636,7 +2636,7 @@ HMAC-sha3_384 255: 2889B249B1941269219272B80770D48D8C6979ADA372DB1EA4C81099E33E6088DFC2DC90526824645D709E79860CCAE9 256: FD717F226A8CDBC52BC9F07BB8DE64F68A2B9C7EDDEAB862A31D2D37E49110254CC3F71091BAB53E988D8E143EC249A0 -HMAC-sha3_512 +HMAC-sha3-512 0: AA692ACEB6F1BF8F1289D248D78C43F4DEBF46A7CD64F94399E70A788BC60A712AEF1481CD71A431E26484F2C0D93ECD5283BBA8F03870BB3E3A65A1F4B14DE9 1: E01FAED8659C115933FD2CC4050B77C8D51DD79887DA05DFC33716AF581C8E206715D707FD51CC51D1750720B74E88DA39D5BD73736A5D03A968D6AA2BB8C273 2: 9D8246D2A869E8670E9BA80A7B07274AF7EDB693815EC9D6D256AB49746A18F798A46D79F5317DB4BCA94BD51CEEAE32807B0F586A99E106A4A692BE4D00FCD0 diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index 1724b697e..a52971606 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -15,7 +15,7 @@ const struct ltc_hash_descriptor sha3_224_desc = { - "sha3_224", /* name of hash */ + "sha3-224", /* name of hash */ 17, /* internal ID */ 28, /* Size of digest in octets */ 128, /* Input block size in octets */ @@ -30,7 +30,7 @@ const struct ltc_hash_descriptor sha3_224_desc = const struct ltc_hash_descriptor sha3_256_desc = { - "sha3_256", /* name of hash */ + "sha3-256", /* name of hash */ 18, /* internal ID */ 32, /* Size of digest in octets */ 128, /* Input block size in octets */ @@ -45,7 +45,7 @@ const struct ltc_hash_descriptor sha3_256_desc = const struct ltc_hash_descriptor sha3_384_desc = { - "sha3_384", /* name of hash */ + "sha3-384", /* name of hash */ 19, /* internal ID */ 48, /* Size of digest in octets */ 128, /* Input block size in octets */ @@ -60,7 +60,7 @@ const struct ltc_hash_descriptor sha3_384_desc = const struct ltc_hash_descriptor sha3_512_desc = { - "sha3_512", /* name of hash */ + "sha3-512", /* name of hash */ 20, /* internal ID */ 64, /* Size of digest in octets */ 128, /* Input block size in octets */ From 4ddee31de76f0674373425fc128f0a089c96ff41 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 23 Apr 2017 16:10:01 +0200 Subject: [PATCH 0630/1192] run hashsum for all hash algorithms --- coverage.sh | 9 +++++++++ notes/hashsum_tv.txt | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 notes/hashsum_tv.txt diff --git a/coverage.sh b/coverage.sh index b76a3bb1f..14dcd5a49 100755 --- a/coverage.sh +++ b/coverage.sh @@ -32,6 +32,15 @@ fi ./sizes ./constants ./multi +for i in $(./hashsum | tail -n +3 | awk '{print $1}' | sort); do echo -n "$i: " && ./hashsum $i testprof/test.key ; done > hashsum_tv.txt +difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true +if [ -n "$difftroubles" ]; then + echo "FAILURE: hashsum_tv.tx" + diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt + echo "hashsum failed" && rm -f testok.txt && exit 1 +else + echo "hashsum okay" +fi # if this was executed as './coverage.sh ...' create coverage locally if [[ "${0%% *}" == "./${0##*/}" ]]; then diff --git a/notes/hashsum_tv.txt b/notes/hashsum_tv.txt new file mode 100644 index 000000000..e76261200 --- /dev/null +++ b/notes/hashsum_tv.txt @@ -0,0 +1,29 @@ +blake2b-160: 684b540eb245ebba2cd66b7814fe6d787868a5bb testprof/test.key +blake2b-256: 3aaa08120aa0174c105fd1f3412e3da30c3bbb9073569b0b8ae458b34de7780e testprof/test.key +blake2b-384: c33f39ab19099d5dea6789479e23447857803a3f45361ea58dd69c7b8037c8697544b6a741e236215adcb8b38fa0cfc4 testprof/test.key +blake2b-512: a2daabae6996e3bbfb76c5d277fb881107037c756173f510d83a78f669cf0b70a5088b971e30ca2168381568ea3d30b80a7b500944a5e2e3294f25aed4c3a5f1 testprof/test.key +blake2s-128: 7e1f9b6de11a3c597308f9d8aacd7321 testprof/test.key +blake2s-160: 3d1c9ae1a0afe8a6ef8b61d5380de7b061cd353c testprof/test.key +blake2s-224: 95dacd83d0421b2d69a52d92ee54143bb97c91a61450d917a88d4388 testprof/test.key +blake2s-256: 92ac6dc88b9ce4a75b2a54783435a37919303f713396db0e9ccd976d8c55f1cf testprof/test.key +chc_hash: d50da1ea9b53c0b891c8bcb0a4c6e5e0 testprof/test.key +md2: 0b327a17a102580ccde8081c18f137c7 testprof/test.key +md4: 6df7b3c1f7fbcbf6b8246dc0046e9d6b testprof/test.key +md5: 48fd9ed11c633069c3cf721611696a73 testprof/test.key +rmd128: a78170e11d56605eb0f5e05e6a218e61 testprof/test.key +rmd160: 56236b14cd15958c58136a295fa2b07c5edee009 testprof/test.key +rmd256: a0a658b25b8841f20be8151eb5e2c1229f085dd5cf7aa8bef4c8e07ea5738913 testprof/test.key +rmd320: 2ec15ca947f29dd8cef4782aeaeb4541ac00dc29e1649c4f5f4578ef0287091e513f9da423ce7319 testprof/test.key +sha1: c17a11eef02d7a2ad7250bc2ee22bdf37ed21f0f testprof/test.key +sha224: b226daa069512c849d55866470c23543d87e1fb768171efdcc6ab59a testprof/test.key +sha256: 76ec7faebdc42a4de35ca70024c2d273e9f7856ca61612e89f5f66350ba8cf5f testprof/test.key +sha3-224: 09525d6410c462e00e72ccd4304290bc59ff2b1b8e5322dbc197e169 testprof/test.key +sha3-256: b9016fc9976545ad0183775d88f20df5295d40b31db00d85f6916333260b8ae2 testprof/test.key +sha3-384: 5452977763b602df4185bbe7cce193346b09ee20d4a45a780fd44237e335ceaa71b9da06242621e159d796db9043c9be testprof/test.key +sha3-512: 1fadf63073c8613d38d5c944e2e3f7e086d94d93dceb2eec1e9693fd44158f3127c90cbaa8a13035cc9ff9b3572c9dce836bea15c92e8a78b036ec382caceb0f testprof/test.key +sha384: 7cc080c662524617e56d5a49f1c185909e9b1858a86684161ddd97fc5426f693b53f59d779de16da25dcb1259df879e5 testprof/test.key +sha512: f90afe4d254716a9770fd2c4f29ca544f2975f961cbd7fa207117383e4e48f7a2e1ade4aac333a2cb8c227dd6af2fff4d87c31c2a3916ae24d507c7c94c21818 testprof/test.key +sha512-224: 64ec566b5c2de736eab1b4e8542dc110f736819ea7f8f48e3712fbad testprof/test.key +sha512-256: db880bce4beb7246510febb961c7595aab57a15de6f90cd079f145e476b5d773 testprof/test.key +tiger: 97d713850e7affac30a642572c1ee7b18793d5b9e0ef5932 testprof/test.key +whirlpool: d7d41c755e0f28313f254cb198e0bfa42f56670595d97b80dceec754825d69938a9c11e5bf16e9a3809a62a09bddf021f3dbff4302ceec7ba46c88b41772b711 testprof/test.key From a6b8e52c432b22addb63f1fdd3b89d78d9735b5c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 23 Apr 2017 17:32:21 +0200 Subject: [PATCH 0631/1192] make output equal to output of sha1sum etc. --- demos/hashsum.c | 4 +-- notes/hashsum_tv.txt | 58 ++++++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 44f3e10ef..497d6bde5 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -47,7 +47,7 @@ int main(int argc, char **argv) for (x = 0; x < (int)hash_descriptor[idx].hashsize; x++) { printf("%02x",hash_buffer[x]); } - printf(" (stdin)\n"); + printf(" *-\n"); } else { for (z = 2; z < argc; z++) { w = sizeof(hash_buffer); @@ -57,7 +57,7 @@ int main(int argc, char **argv) for (x = 0; x < (int)hash_descriptor[idx].hashsize; x++) { printf("%02x",hash_buffer[x]); } - printf(" %s\n", argv[z]); + printf(" *%s\n", argv[z]); } } } diff --git a/notes/hashsum_tv.txt b/notes/hashsum_tv.txt index e76261200..c2a58b491 100644 --- a/notes/hashsum_tv.txt +++ b/notes/hashsum_tv.txt @@ -1,29 +1,29 @@ -blake2b-160: 684b540eb245ebba2cd66b7814fe6d787868a5bb testprof/test.key -blake2b-256: 3aaa08120aa0174c105fd1f3412e3da30c3bbb9073569b0b8ae458b34de7780e testprof/test.key -blake2b-384: c33f39ab19099d5dea6789479e23447857803a3f45361ea58dd69c7b8037c8697544b6a741e236215adcb8b38fa0cfc4 testprof/test.key -blake2b-512: a2daabae6996e3bbfb76c5d277fb881107037c756173f510d83a78f669cf0b70a5088b971e30ca2168381568ea3d30b80a7b500944a5e2e3294f25aed4c3a5f1 testprof/test.key -blake2s-128: 7e1f9b6de11a3c597308f9d8aacd7321 testprof/test.key -blake2s-160: 3d1c9ae1a0afe8a6ef8b61d5380de7b061cd353c testprof/test.key -blake2s-224: 95dacd83d0421b2d69a52d92ee54143bb97c91a61450d917a88d4388 testprof/test.key -blake2s-256: 92ac6dc88b9ce4a75b2a54783435a37919303f713396db0e9ccd976d8c55f1cf testprof/test.key -chc_hash: d50da1ea9b53c0b891c8bcb0a4c6e5e0 testprof/test.key -md2: 0b327a17a102580ccde8081c18f137c7 testprof/test.key -md4: 6df7b3c1f7fbcbf6b8246dc0046e9d6b testprof/test.key -md5: 48fd9ed11c633069c3cf721611696a73 testprof/test.key -rmd128: a78170e11d56605eb0f5e05e6a218e61 testprof/test.key -rmd160: 56236b14cd15958c58136a295fa2b07c5edee009 testprof/test.key -rmd256: a0a658b25b8841f20be8151eb5e2c1229f085dd5cf7aa8bef4c8e07ea5738913 testprof/test.key -rmd320: 2ec15ca947f29dd8cef4782aeaeb4541ac00dc29e1649c4f5f4578ef0287091e513f9da423ce7319 testprof/test.key -sha1: c17a11eef02d7a2ad7250bc2ee22bdf37ed21f0f testprof/test.key -sha224: b226daa069512c849d55866470c23543d87e1fb768171efdcc6ab59a testprof/test.key -sha256: 76ec7faebdc42a4de35ca70024c2d273e9f7856ca61612e89f5f66350ba8cf5f testprof/test.key -sha3-224: 09525d6410c462e00e72ccd4304290bc59ff2b1b8e5322dbc197e169 testprof/test.key -sha3-256: b9016fc9976545ad0183775d88f20df5295d40b31db00d85f6916333260b8ae2 testprof/test.key -sha3-384: 5452977763b602df4185bbe7cce193346b09ee20d4a45a780fd44237e335ceaa71b9da06242621e159d796db9043c9be testprof/test.key -sha3-512: 1fadf63073c8613d38d5c944e2e3f7e086d94d93dceb2eec1e9693fd44158f3127c90cbaa8a13035cc9ff9b3572c9dce836bea15c92e8a78b036ec382caceb0f testprof/test.key -sha384: 7cc080c662524617e56d5a49f1c185909e9b1858a86684161ddd97fc5426f693b53f59d779de16da25dcb1259df879e5 testprof/test.key -sha512: f90afe4d254716a9770fd2c4f29ca544f2975f961cbd7fa207117383e4e48f7a2e1ade4aac333a2cb8c227dd6af2fff4d87c31c2a3916ae24d507c7c94c21818 testprof/test.key -sha512-224: 64ec566b5c2de736eab1b4e8542dc110f736819ea7f8f48e3712fbad testprof/test.key -sha512-256: db880bce4beb7246510febb961c7595aab57a15de6f90cd079f145e476b5d773 testprof/test.key -tiger: 97d713850e7affac30a642572c1ee7b18793d5b9e0ef5932 testprof/test.key -whirlpool: d7d41c755e0f28313f254cb198e0bfa42f56670595d97b80dceec754825d69938a9c11e5bf16e9a3809a62a09bddf021f3dbff4302ceec7ba46c88b41772b711 testprof/test.key +blake2b-160: 684b540eb245ebba2cd66b7814fe6d787868a5bb *testprof/test.key +blake2b-256: 3aaa08120aa0174c105fd1f3412e3da30c3bbb9073569b0b8ae458b34de7780e *testprof/test.key +blake2b-384: c33f39ab19099d5dea6789479e23447857803a3f45361ea58dd69c7b8037c8697544b6a741e236215adcb8b38fa0cfc4 *testprof/test.key +blake2b-512: a2daabae6996e3bbfb76c5d277fb881107037c756173f510d83a78f669cf0b70a5088b971e30ca2168381568ea3d30b80a7b500944a5e2e3294f25aed4c3a5f1 *testprof/test.key +blake2s-128: 7e1f9b6de11a3c597308f9d8aacd7321 *testprof/test.key +blake2s-160: 3d1c9ae1a0afe8a6ef8b61d5380de7b061cd353c *testprof/test.key +blake2s-224: 95dacd83d0421b2d69a52d92ee54143bb97c91a61450d917a88d4388 *testprof/test.key +blake2s-256: 92ac6dc88b9ce4a75b2a54783435a37919303f713396db0e9ccd976d8c55f1cf *testprof/test.key +chc_hash: d50da1ea9b53c0b891c8bcb0a4c6e5e0 *testprof/test.key +md2: 0b327a17a102580ccde8081c18f137c7 *testprof/test.key +md4: 6df7b3c1f7fbcbf6b8246dc0046e9d6b *testprof/test.key +md5: 48fd9ed11c633069c3cf721611696a73 *testprof/test.key +rmd128: a78170e11d56605eb0f5e05e6a218e61 *testprof/test.key +rmd160: 56236b14cd15958c58136a295fa2b07c5edee009 *testprof/test.key +rmd256: a0a658b25b8841f20be8151eb5e2c1229f085dd5cf7aa8bef4c8e07ea5738913 *testprof/test.key +rmd320: 2ec15ca947f29dd8cef4782aeaeb4541ac00dc29e1649c4f5f4578ef0287091e513f9da423ce7319 *testprof/test.key +sha1: c17a11eef02d7a2ad7250bc2ee22bdf37ed21f0f *testprof/test.key +sha224: b226daa069512c849d55866470c23543d87e1fb768171efdcc6ab59a *testprof/test.key +sha256: 76ec7faebdc42a4de35ca70024c2d273e9f7856ca61612e89f5f66350ba8cf5f *testprof/test.key +sha3-224: 09525d6410c462e00e72ccd4304290bc59ff2b1b8e5322dbc197e169 *testprof/test.key +sha3-256: b9016fc9976545ad0183775d88f20df5295d40b31db00d85f6916333260b8ae2 *testprof/test.key +sha3-384: 5452977763b602df4185bbe7cce193346b09ee20d4a45a780fd44237e335ceaa71b9da06242621e159d796db9043c9be *testprof/test.key +sha3-512: 1fadf63073c8613d38d5c944e2e3f7e086d94d93dceb2eec1e9693fd44158f3127c90cbaa8a13035cc9ff9b3572c9dce836bea15c92e8a78b036ec382caceb0f *testprof/test.key +sha384: 7cc080c662524617e56d5a49f1c185909e9b1858a86684161ddd97fc5426f693b53f59d779de16da25dcb1259df879e5 *testprof/test.key +sha512: f90afe4d254716a9770fd2c4f29ca544f2975f961cbd7fa207117383e4e48f7a2e1ade4aac333a2cb8c227dd6af2fff4d87c31c2a3916ae24d507c7c94c21818 *testprof/test.key +sha512-224: 64ec566b5c2de736eab1b4e8542dc110f736819ea7f8f48e3712fbad *testprof/test.key +sha512-256: db880bce4beb7246510febb961c7595aab57a15de6f90cd079f145e476b5d773 *testprof/test.key +tiger: 97d713850e7affac30a642572c1ee7b18793d5b9e0ef5932 *testprof/test.key +whirlpool: d7d41c755e0f28313f254cb198e0bfa42f56670595d97b80dceec754825d69938a9c11e5bf16e9a3809a62a09bddf021f3dbff4302ceec7ba46c88b41772b711 *testprof/test.key From 943c7a7cfc405fce7ac64fa705e3928b2ee4435a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 23 Apr 2017 22:37:32 +0200 Subject: [PATCH 0632/1192] use `hash_filehandle()` to read from stdin --- demos/hashsum.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 497d6bde5..5625329c0 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -15,10 +15,9 @@ void register_algs(void); int main(int argc, char **argv) { - int idx, x, z; - unsigned long w; + int idx, z; + unsigned long w, x; unsigned char hash_buffer[MAXBLOCKSIZE]; - hash_state md; /* You need to register algorithms before using them */ register_algs(); @@ -38,23 +37,22 @@ int main(int argc, char **argv) } if (argc == 2) { - hash_descriptor[idx].init(&md); - do { - x = fread(hash_buffer, 1, sizeof(hash_buffer), stdin); - hash_descriptor[idx].process(&md, hash_buffer, x); - } while (x == sizeof(hash_buffer)); - hash_descriptor[idx].done(&md, hash_buffer); - for (x = 0; x < (int)hash_descriptor[idx].hashsize; x++) { - printf("%02x",hash_buffer[x]); + w = sizeof(hash_buffer); + if ((errno = hash_filehandle(idx, stdin, hash_buffer, &w)) != CRYPT_OK) { + printf("File hash error: %s\n", error_to_string(errno)); + } else { + for (x = 0; x < w; x++) { + printf("%02x",hash_buffer[x]); + } + printf(" *-\n"); } - printf(" *-\n"); } else { for (z = 2; z < argc; z++) { w = sizeof(hash_buffer); if ((errno = hash_file(idx,argv[z],hash_buffer,&w)) != CRYPT_OK) { printf("File hash error: %s\n", error_to_string(errno)); } else { - for (x = 0; x < (int)hash_descriptor[idx].hashsize; x++) { + for (x = 0; x < w; x++) { printf("%02x",hash_buffer[x]); } printf(" *%s\n", argv[z]); From 0d585958c1d3028b258085024e7cd1723e81c854 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 21 Apr 2017 15:50:47 +0200 Subject: [PATCH 0633/1192] BLAKE2 based MACs --- src/headers/tomcrypt_custom.h | 10 +++ src/headers/tomcrypt_mac.h | 24 +++++++ src/mac/blake2/blake2bmac.c | 61 ++++++++++++++++++ src/mac/blake2/blake2bmac_file.c | 79 ++++++++++++++++++++++++ src/mac/blake2/blake2bmac_memory.c | 44 +++++++++++++ src/mac/blake2/blake2bmac_memory_multi.c | 58 +++++++++++++++++ src/mac/blake2/blake2bmac_test.c | 44 +++++++++++++ src/mac/blake2/blake2smac.c | 61 ++++++++++++++++++ src/mac/blake2/blake2smac_file.c | 79 ++++++++++++++++++++++++ src/mac/blake2/blake2smac_memory.c | 44 +++++++++++++ src/mac/blake2/blake2smac_memory_multi.c | 58 +++++++++++++++++ src/mac/blake2/blake2smac_test.c | 44 +++++++++++++ src/misc/crypt/crypt.c | 6 ++ testprof/mac_test.c | 6 ++ 14 files changed, 618 insertions(+) create mode 100644 src/mac/blake2/blake2bmac.c create mode 100644 src/mac/blake2/blake2bmac_file.c create mode 100644 src/mac/blake2/blake2bmac_memory.c create mode 100644 src/mac/blake2/blake2bmac_memory_multi.c create mode 100644 src/mac/blake2/blake2bmac_test.c create mode 100644 src/mac/blake2/blake2smac.c create mode 100644 src/mac/blake2/blake2smac_file.c create mode 100644 src/mac/blake2/blake2smac_memory.c create mode 100644 src/mac/blake2/blake2smac_memory_multi.c create mode 100644 src/mac/blake2/blake2smac_test.c diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index e7de39360..944b02b78 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -260,6 +260,8 @@ #define LTC_F9_MODE #define LTC_PELICAN #define LTC_POLY1305 +#define LTC_BLAKE2SMAC +#define LTC_BLAKE2BMAC /* ---> Encrypt + Authenticate Modes <--- */ @@ -521,6 +523,14 @@ #error LTC_CHACHA20_PRNG requires LTC_CHACHA #endif +#if defined(LTC_BLAKE2SMAC) && !defined(LTC_BLAKE2S) + #error LTC_BLAKE2SMAC requires LTC_BLAKE2S +#endif + +#if defined(LTC_BLAKE2BMAC) && !defined(LTC_BLAKE2B) + #error LTC_BLAKE2BMAC requires LTC_BLAKE2B +#endif + /* THREAD management */ #ifdef LTC_PTHREAD diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 2feefbabb..5e5f84c33 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -116,6 +116,30 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key int poly1305_test(void); #endif /* LTC_POLY1305 */ +#ifdef LTC_BLAKE2SMAC +typedef hash_state blake2smac_state; +int blake2smac_init(blake2smac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen); +int blake2smac_process(blake2smac_state *st, const unsigned char *in, unsigned long inlen); +int blake2smac_done(blake2smac_state *st, unsigned char *mac, unsigned long *maclen); +int blake2smac_test(void); +int blake2smac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); +int blake2smac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); +int blake2smac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); +int blake2smac_test(void); +#endif /* LTC_BLAKE2SMAC */ + +#ifdef LTC_BLAKE2BMAC +typedef hash_state blake2bmac_state; +int blake2bmac_init(blake2bmac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen); +int blake2bmac_process(blake2bmac_state *st, const unsigned char *in, unsigned long inlen); +int blake2bmac_done(blake2bmac_state *st, unsigned char *mac, unsigned long *maclen); +int blake2bmac_test(void); +int blake2bmac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); +int blake2bmac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); +int blake2bmac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); +int blake2bmac_test(void); +#endif /* LTC_BLAKE2BMAC */ + #ifdef LTC_EAX_MODE #if !(defined(LTC_OMAC) && defined(LTC_CTR_MODE)) diff --git a/src/mac/blake2/blake2bmac.c b/src/mac/blake2/blake2bmac.c new file mode 100644 index 000000000..63ebd4196 --- /dev/null +++ b/src/mac/blake2/blake2bmac.c @@ -0,0 +1,61 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2BMAC + +/** + Initialize an BLAKE2B MAC context. + @param st The BLAKE2B MAC state + @param key The secret key + @param keylen The length of the secret key (octets) + @return CRYPT_OK if successful +*/ +int blake2bmac_init(blake2bmac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen) +{ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(key != NULL); + return blake2b_init(st, outlen, key, keylen); +} + +/** + Process data through BLAKE2B MAC + @param st The BLAKE2B MAC state + @param in The data to send through HMAC + @param inlen The length of the data to HMAC (octets) + @return CRYPT_OK if successful +*/ +int blake2bmac_process(blake2bmac_state *st, const unsigned char *in, unsigned long inlen) +{ + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(in != NULL); + return blake2b_process(st, in, inlen); +} + +/** + Terminate a BLAKE2B MAC session + @param st The BLAKE2B MAC state + @param mac [out] The destination of the BLAKE2B MAC authentication tag + @param maclen [in/out] The max size and resulting size of the BLAKE2B MAC authentication tag + @return CRYPT_OK if successful +*/ +int blake2bmac_done(blake2bmac_state *st, unsigned char *mac, unsigned long *maclen) +{ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + LTC_ARGCHK(*maclen >= st->blake2b.outlen); + + *maclen = st->blake2b.outlen; + return blake2b_done(st, mac); +} + +#endif diff --git a/src/mac/blake2/blake2bmac_file.c b/src/mac/blake2/blake2bmac_file.c new file mode 100644 index 000000000..a63636908 --- /dev/null +++ b/src/mac/blake2/blake2bmac_file.c @@ -0,0 +1,79 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2BMAC + +/** + BLAKE2B MAC a file + @param fname The name of the file you wish to BLAKE2B MAC + @param key The secret key + @param keylen The length of the secret key + @param mac [out] The BLAKE2B MAC authentication tag + @param maclen [in/out] The max size and resulting size of the authentication tag + @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled +*/ +int blake2bmac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen) +{ + #ifdef LTC_NO_FILE + return CRYPT_NOP; +#else + blake2bmac_state st; + FILE *in; + unsigned char *buf; + size_t x; + int err; + + LTC_ARGCHK(fname != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; + } + + if ((err = blake2bmac_init(&st, *maclen, key, keylen)) != CRYPT_OK) { + goto LBL_ERR; + } + + in = fopen(fname, "rb"); + if (in == NULL) { + err = CRYPT_FILE_NOTFOUND; + goto LBL_ERR; + } + + do { + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); + if ((err = blake2bmac_process(&st, buf, (unsigned long)x)) != CRYPT_OK) { + fclose(in); + goto LBL_CLEANBUF; + } + } while (x == LTC_FILE_READ_BUFSIZE); + + if (fclose(in) != 0) { + err = CRYPT_ERROR; + goto LBL_CLEANBUF; + } + + err = blake2bmac_done(&st, mac, maclen); + +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(blake2bmac_state)); +#endif + XFREE(buf); + return err; +#endif +} + +#endif diff --git a/src/mac/blake2/blake2bmac_memory.c b/src/mac/blake2/blake2bmac_memory.c new file mode 100644 index 000000000..bdf556203 --- /dev/null +++ b/src/mac/blake2/blake2bmac_memory.c @@ -0,0 +1,44 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2BMAC + +/** + BLAKE2B MAC a block of memory to produce the authentication tag + @param key The secret key + @param keylen The length of the secret key (octets) + @param in The data to BLAKE2B MAC + @param inlen The length of the data to BLAKE2B MAC (octets) + @param mac [out] Destination of the authentication tag + @param maclen [in/out] Max size and resulting size of authentication tag + @return CRYPT_OK if successful +*/ +int blake2bmac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen) +{ + blake2bmac_state st; + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + if ((err = blake2bmac_init(&st, *maclen, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = blake2bmac_process(&st, in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + err = blake2bmac_done(&st, mac, maclen); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(blake2bmac_state)); +#endif + return err; +} + +#endif diff --git a/src/mac/blake2/blake2bmac_memory_multi.c b/src/mac/blake2/blake2bmac_memory_multi.c new file mode 100644 index 000000000..4e8f66ff4 --- /dev/null +++ b/src/mac/blake2/blake2bmac_memory_multi.c @@ -0,0 +1,58 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" +#include + +#ifdef LTC_BLAKE2BMAC + +/** + BLAKE2B MAC multiple blocks of memory to produce the authentication tag + @param key The secret key + @param keylen The length of the secret key (octets) + @param out [out] Destination of the authentication tag + @param outlen [in/out] Max size and resulting size of authentication tag + @param in The data to BLAKE2B MAC + @param inlen The length of the data to BLAKE2B MAC (octets) + @param ... tuples of (data,len) pairs to BLAKE2B MAC, terminated with a (NULL,x) (x=don't care) + @return CRYPT_OK if successful +*/ +int blake2bmac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...) +{ + blake2bmac_state st; + int err; + va_list args; + const unsigned char *curptr; + unsigned long curlen; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + va_start(args, inlen); + curptr = in; + curlen = inlen; + if ((err = blake2bmac_init(&st, *maclen, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + for (;;) { + if ((err = blake2bmac_process(&st, curptr, curlen)) != CRYPT_OK) { goto LBL_ERR; } + curptr = va_arg(args, const unsigned char*); + if (curptr == NULL) break; + curlen = va_arg(args, unsigned long); + } + err = blake2bmac_done(&st, mac, maclen); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(blake2bmac_state)); +#endif + va_end(args); + return err; +} + +#endif diff --git a/src/mac/blake2/blake2bmac_test.c b/src/mac/blake2/blake2bmac_test.c new file mode 100644 index 000000000..b95ed5f45 --- /dev/null +++ b/src/mac/blake2/blake2bmac_test.c @@ -0,0 +1,44 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2BMAC + +int blake2bmac_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned char k[] = { 0x85, 0xd6, 0xbe, 0x78, 0x57, 0x55, 0x6d, 0x33, 0x7f, 0x44, 0x52, 0xfe, 0x42, 0xd5, 0x06, 0xa8, 0x01, 0x03, 0x80, 0x8a, 0xfb, 0x0d, 0xb2, 0xfd, 0x4a, 0xbf, 0xf6, 0xaf, 0x41, 0x49, 0xf5, 0x1b }; + unsigned char tag[] = { 0x3d, 0xd6, 0x35, 0x81, 0x32, 0xb5, 0x3c, 0xc8, 0x0a, 0x8c, 0x33, 0x91, 0x93, 0x5d, 0x30, 0x1b }; + char m[] = "Cryptographic Forum Research Group"; + unsigned long len = 16, mlen = strlen(m); + unsigned char out[1000]; + blake2bmac_state st; + /* process piece by piece */ + blake2bmac_init(&st, 16, k, 32); + blake2bmac_process(&st, (unsigned char*)m, 5); + blake2bmac_process(&st, (unsigned char*)m + 5, 4); + blake2bmac_process(&st, (unsigned char*)m + 9, 3); + blake2bmac_process(&st, (unsigned char*)m + 12, 2); + blake2bmac_process(&st, (unsigned char*)m + 14, 1); + blake2bmac_process(&st, (unsigned char*)m + 15, mlen - 15); + blake2bmac_done(&st, out, &len); + if (compare_testvector(out, len, tag, sizeof(tag), "BLAKE2B MAC-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + /* process in one go */ + blake2bmac_init(&st, 16, k, 32); + blake2bmac_process(&st, (unsigned char*)m, mlen); + blake2bmac_done(&st, out, &len); + if (compare_testvector(out, len, tag, sizeof(tag), "BLAKE2B MAC-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + return CRYPT_OK; +#endif +} + +#endif diff --git a/src/mac/blake2/blake2smac.c b/src/mac/blake2/blake2smac.c new file mode 100644 index 000000000..741cf7241 --- /dev/null +++ b/src/mac/blake2/blake2smac.c @@ -0,0 +1,61 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2SMAC + +/** + Initialize an BLAKE2S MAC context. + @param st The BLAKE2S MAC state + @param key The secret key + @param keylen The length of the secret key (octets) + @return CRYPT_OK if successful +*/ +int blake2smac_init(blake2smac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen) +{ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(key != NULL); + return blake2s_init(st, outlen, key, keylen); +} + +/** + Process data through BLAKE2S MAC + @param st The BLAKE2S MAC state + @param in The data to send through HMAC + @param inlen The length of the data to HMAC (octets) + @return CRYPT_OK if successful +*/ +int blake2smac_process(blake2smac_state *st, const unsigned char *in, unsigned long inlen) +{ + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(in != NULL); + return blake2s_process(st, in, inlen); +} + +/** + Terminate a BLAKE2S MAC session + @param st The BLAKE2S MAC state + @param mac [out] The destination of the BLAKE2S MAC authentication tag + @param maclen [in/out] The max size and resulting size of the BLAKE2S MAC authentication tag + @return CRYPT_OK if successful +*/ +int blake2smac_done(blake2smac_state *st, unsigned char *mac, unsigned long *maclen) +{ + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + LTC_ARGCHK(*maclen >= st->blake2s.outlen); + + *maclen = st->blake2s.outlen; + return blake2s_done(st, mac); +} + +#endif diff --git a/src/mac/blake2/blake2smac_file.c b/src/mac/blake2/blake2smac_file.c new file mode 100644 index 000000000..c6da9ee01 --- /dev/null +++ b/src/mac/blake2/blake2smac_file.c @@ -0,0 +1,79 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2SMAC + +/** + BLAKE2S MAC a file + @param fname The name of the file you wish to BLAKE2S MAC + @param key The secret key + @param keylen The length of the secret key + @param mac [out] The BLAKE2S MAC authentication tag + @param maclen [in/out] The max size and resulting size of the authentication tag + @return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled +*/ +int blake2smac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen) +{ +#ifdef LTC_NO_FILE + return CRYPT_NOP; +#else + blake2smac_state st; + FILE *in; + unsigned char *buf; + size_t x; + int err; + + LTC_ARGCHK(fname != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { + return CRYPT_MEM; + } + + if ((err = blake2smac_init(&st, *maclen, key, keylen)) != CRYPT_OK) { + goto LBL_ERR; + } + + in = fopen(fname, "rb"); + if (in == NULL) { + err = CRYPT_FILE_NOTFOUND; + goto LBL_ERR; + } + + do { + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); + if ((err = blake2smac_process(&st, buf, (unsigned long)x)) != CRYPT_OK) { + fclose(in); + goto LBL_CLEANBUF; + } + } while (x == LTC_FILE_READ_BUFSIZE); + + if (fclose(in) != 0) { + err = CRYPT_ERROR; + goto LBL_CLEANBUF; + } + + err = blake2smac_done(&st, mac, maclen); + +LBL_CLEANBUF: + zeromem(buf, LTC_FILE_READ_BUFSIZE); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(blake2smac_state)); +#endif + XFREE(buf); + return err; +#endif +} + +#endif diff --git a/src/mac/blake2/blake2smac_memory.c b/src/mac/blake2/blake2smac_memory.c new file mode 100644 index 000000000..037655451 --- /dev/null +++ b/src/mac/blake2/blake2smac_memory.c @@ -0,0 +1,44 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2SMAC + +/** + BLAKE2S MAC a block of memory to produce the authentication tag + @param key The secret key + @param keylen The length of the secret key (octets) + @param in The data to BLAKE2S MAC + @param inlen The length of the data to BLAKE2S MAC (octets) + @param mac [out] Destination of the authentication tag + @param maclen [in/out] Max size and resulting size of authentication tag + @return CRYPT_OK if successful +*/ +int blake2smac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen) +{ + blake2smac_state st; + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + if ((err = blake2smac_init(&st, *maclen, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = blake2smac_process(&st, in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + err = blake2smac_done(&st, mac, maclen); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(blake2smac_state)); +#endif + return err; +} + +#endif diff --git a/src/mac/blake2/blake2smac_memory_multi.c b/src/mac/blake2/blake2smac_memory_multi.c new file mode 100644 index 000000000..27889c2e6 --- /dev/null +++ b/src/mac/blake2/blake2smac_memory_multi.c @@ -0,0 +1,58 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" +#include + +#ifdef LTC_BLAKE2SMAC + +/** + BLAKE2S MAC multiple blocks of memory to produce the authentication tag + @param key The secret key + @param keylen The length of the secret key (octets) + @param out [out] Destination of the authentication tag + @param outlen [in/out] Max size and resulting size of authentication tag + @param in The data to BLAKE2S MAC + @param inlen The length of the data to BLAKE2S MAC (octets) + @param ... tuples of (data,len) pairs to BLAKE2S MAC, terminated with a (NULL,x) (x=don't care) + @return CRYPT_OK if successful +*/ +int blake2smac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...) +{ + blake2smac_state st; + int err; + va_list args; + const unsigned char *curptr; + unsigned long curlen; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(mac != NULL); + LTC_ARGCHK(maclen != NULL); + + va_start(args, inlen); + curptr = in; + curlen = inlen; + if ((err = blake2smac_init(&st, *maclen, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } + for (;;) { + if ((err = blake2smac_process(&st, curptr, curlen)) != CRYPT_OK) { goto LBL_ERR; } + curptr = va_arg(args, const unsigned char*); + if (curptr == NULL) break; + curlen = va_arg(args, unsigned long); + } + err = blake2smac_done(&st, mac, maclen); +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(&st, sizeof(blake2smac_state)); +#endif + va_end(args); + return err; +} + +#endif diff --git a/src/mac/blake2/blake2smac_test.c b/src/mac/blake2/blake2smac_test.c new file mode 100644 index 000000000..39c11cf3e --- /dev/null +++ b/src/mac/blake2/blake2smac_test.c @@ -0,0 +1,44 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_BLAKE2SMAC + +int blake2smac_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned char k[] = { 0x85, 0xd6, 0xbe, 0x78, 0x57, 0x55, 0x6d, 0x33, 0x7f, 0x44, 0x52, 0xfe, 0x42, 0xd5, 0x06, 0xa8, 0x01, 0x03, 0x80, 0x8a, 0xfb, 0x0d, 0xb2, 0xfd, 0x4a, 0xbf, 0xf6, 0xaf, 0x41, 0x49, 0xf5, 0x1b }; + unsigned char tag[] = { 0x96, 0x32, 0xf9, 0x85, 0xf3, 0x30, 0xd6, 0x8c, 0x21, 0x78, 0x6e, 0xae, 0xb4, 0x99, 0xba, 0xbb }; + char m[] = "Cryptographic Forum Research Group"; + unsigned long len = 16, mlen = strlen(m); + unsigned char out[1000]; + blake2smac_state st; + /* process piece by piece */ + blake2smac_init(&st,16, k, 32); + blake2smac_process(&st, (unsigned char*)m, 5); + blake2smac_process(&st, (unsigned char*)m + 5, 4); + blake2smac_process(&st, (unsigned char*)m + 9, 3); + blake2smac_process(&st, (unsigned char*)m + 12, 2); + blake2smac_process(&st, (unsigned char*)m + 14, 1); + blake2smac_process(&st, (unsigned char*)m + 15, mlen - 15); + blake2smac_done(&st, out, &len); + if (compare_testvector(out, len, tag, sizeof(tag), "BLAKE2S MAC-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + /* process in one go */ + blake2smac_init(&st, 16, k, 32); + blake2smac_process(&st, (unsigned char*)m, mlen); + blake2smac_done(&st, out, &len); + if (compare_testvector(out, len, tag, sizeof(tag), "BLAKE2S MAC-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + return CRYPT_OK; +#endif +} + +#endif diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 50379b100..d1311f98c 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -242,6 +242,12 @@ const char *crypt_build_settings = #if defined(LTC_POLY1305) " POLY1305\n" #endif +#if defined(LTC_BLAKE2SMAC) + " BLAKE2S MAC\n" +#endif +#if defined(LTC_BLAKE2BMAC) + " BLAKE2B MAC\n" +#endif "\nENC + AUTH modes:\n" #if defined(LTC_EAX_MODE) diff --git a/testprof/mac_test.c b/testprof/mac_test.c index e8897cac1..17da4ac38 100644 --- a/testprof/mac_test.c +++ b/testprof/mac_test.c @@ -41,6 +41,12 @@ int mac_test(void) #endif #ifdef LTC_CHACHA20POLY1305_MODE DO(chacha20poly1305_test()); +#endif +#ifdef LTC_BLAKE2SMAC + DO(blake2smac_test()); +#endif +#ifdef LTC_BLAKE2BMAC + DO(blake2bmac_test()); #endif return 0; } From f767ea3dcda7fd95da56f64db2d143e149a29992 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 21 Apr 2017 15:51:48 +0200 Subject: [PATCH 0634/1192] update makefiles --- libtomcrypt_VS2008.vcproj | 44 +++++++++++++++++++++++++++ makefile | 62 +++++++++++++++++++++------------------ makefile.icc | 62 +++++++++++++++++++++------------------ makefile.mingw | 62 +++++++++++++++++++++------------------ makefile.msvc | 62 +++++++++++++++++++++------------------ makefile.shared | 62 +++++++++++++++++++++------------------ makefile.unix | 62 +++++++++++++++++++++------------------ 7 files changed, 242 insertions(+), 174 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 1946401ba..f79153fc2 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -1043,6 +1043,50 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/makefile b/makefile index dc53d68db..4ce3bf24b 100644 --- a/makefile +++ b/makefile @@ -77,35 +77,39 @@ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hash src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ -src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ -src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ -src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ -src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ -src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ -src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ -src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ +src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ +src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ +src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ +src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.icc b/makefile.icc index 214b602b7..6c04ba846 100644 --- a/makefile.icc +++ b/makefile.icc @@ -134,35 +134,39 @@ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hash src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ -src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ -src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ -src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ -src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ -src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ -src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ -src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ +src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ +src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ +src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ +src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.mingw b/makefile.mingw index d7fd2db8a..ece1491ed 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -70,35 +70,39 @@ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hash src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ -src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ -src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ -src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ -src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ -src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ -src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ -src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ +src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ +src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ +src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ +src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.msvc b/makefile.msvc index d01c4cbe7..8f6ebaecb 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -44,35 +44,39 @@ src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj sr src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \ src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj src/hashes/sha2/sha512.obj \ src/hashes/sha2/sha512_224.obj src/hashes/sha2/sha512_256.obj src/hashes/sha3.obj src/hashes/sha3_test.obj \ -src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/f9/f9_done.obj src/mac/f9/f9_file.obj \ -src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj src/mac/f9/f9_process.obj \ -src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj src/mac/hmac/hmac_init.obj \ -src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj src/mac/hmac/hmac_process.obj \ -src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj src/mac/omac/omac_init.obj \ -src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj src/mac/omac/omac_process.obj \ -src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj src/mac/pelican/pelican_memory.obj \ -src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj src/mac/pmac/pmac_file.obj \ -src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj src/mac/pmac/pmac_memory_multi.obj \ -src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj src/mac/pmac/pmac_shift_xor.obj \ -src/mac/pmac/pmac_test.obj src/mac/poly1305/poly1305.obj src/mac/poly1305/poly1305_file.obj \ -src/mac/poly1305/poly1305_memory.obj src/mac/poly1305/poly1305_memory_multi.obj \ -src/mac/poly1305/poly1305_test.obj src/mac/xcbc/xcbc_done.obj src/mac/xcbc/xcbc_file.obj \ -src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj src/mac/xcbc/xcbc_memory_multi.obj \ -src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj src/math/fp/ltc_ecc_fp_mulmod.obj \ -src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj src/math/rand_bn.obj src/math/rand_prime.obj \ -src/math/tfm_desc.obj src/misc/adler32.obj src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj \ -src/misc/burn_stack.obj src/misc/crc32.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj \ -src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \ -src/misc/crypt/crypt_constants.obj src/misc/crypt/crypt_find_cipher.obj \ -src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher_id.obj \ -src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_any.obj \ -src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ -src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ -src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_inits.obj \ -src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \ -src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_prng_rng_descriptor.obj \ -src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ -src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/blake2/blake2bmac.obj \ +src/mac/blake2/blake2bmac_file.obj src/mac/blake2/blake2bmac_memory.obj \ +src/mac/blake2/blake2bmac_memory_multi.obj src/mac/blake2/blake2bmac_test.obj src/mac/blake2/blake2smac.obj \ +src/mac/blake2/blake2smac_file.obj src/mac/blake2/blake2smac_memory.obj \ +src/mac/blake2/blake2smac_memory_multi.obj src/mac/blake2/blake2smac_test.obj src/mac/f9/f9_done.obj \ +src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj \ +src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj \ +src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj \ +src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj \ +src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj \ +src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj \ +src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj \ +src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \ +src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \ +src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/poly1305/poly1305.obj \ +src/mac/poly1305/poly1305_file.obj src/mac/poly1305/poly1305_memory.obj \ +src/mac/poly1305/poly1305_memory_multi.obj src/mac/poly1305/poly1305_test.obj src/mac/xcbc/xcbc_done.obj \ +src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \ +src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \ +src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ +src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/adler32.obj \ +src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crc32.obj \ +src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt_cipher_descriptor.obj \ +src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_constants.obj \ +src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_any.obj \ +src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash.obj \ +src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash_id.obj \ +src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ +src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ +src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ +src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ +src/misc/crypt/crypt_prng_rng_descriptor.obj src/misc/crypt/crypt_register_cipher.obj \ +src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pk_get_oid.obj src/misc/pkcs5/pkcs_5_1.obj \ diff --git a/makefile.shared b/makefile.shared index a2708ee2f..1cd622c49 100644 --- a/makefile.shared +++ b/makefile.shared @@ -67,35 +67,39 @@ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hash src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ -src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ -src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ -src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ -src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ -src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ -src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ -src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ +src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ +src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ +src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ +src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.unix b/makefile.unix index 5c58b4309..0f6b9a99a 100644 --- a/makefile.unix +++ b/makefile.unix @@ -75,35 +75,39 @@ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hash src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/f9/f9_done.o src/mac/f9/f9_file.o \ -src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o src/mac/f9/f9_process.o \ -src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o \ -src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o \ -src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o \ -src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o \ -src/mac/omac/omac_test.o src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o \ -src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o \ -src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o src/mac/pmac/pmac_memory_multi.o \ -src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o src/mac/pmac/pmac_shift_xor.o \ -src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o src/mac/poly1305/poly1305_file.o \ -src/mac/poly1305/poly1305_memory.o src/mac/poly1305/poly1305_memory_multi.o \ -src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o src/mac/xcbc/xcbc_file.o \ -src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.o \ -src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o \ -src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o \ -src/math/tfm_desc.o src/misc/adler32.o src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o \ -src/misc/burn_stack.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ -src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ -src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ -src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ -src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ -src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ +src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ +src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ +src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ +src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ From 1c68bf9a7449356671e85805d47bbc68c2aaa40d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 21 Apr 2017 17:32:12 +0200 Subject: [PATCH 0635/1192] update file_test --- testprof/file_test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/testprof/file_test.c b/testprof/file_test.c index 862683aa1..3252e533e 100644 --- a/testprof/file_test.c +++ b/testprof/file_test.c @@ -79,6 +79,22 @@ int file_test(void) if (compare_testvector(buf, len, exp_poly1305, 16, "poly1305_file", 1)) return 1; } #endif +#ifdef LTC_BLAKE2SMAC + { + unsigned char exp_blake2smac[16] = { 0x4f, 0x94, 0x45, 0x15, 0xcd, 0xd1, 0xca, 0x02, 0x1a, 0x0c, 0x7a, 0xe4, 0x6d, 0x2f, 0xe8, 0xb3 }; + len = 16; + if ((err = blake2smac_file(fname, key, 32, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_blake2smac, 16, "exp_blake2smac_file", 1)) return 1; + } +#endif +#ifdef LTC_BLAKE2BMAC + { + unsigned char exp_blake2bmac[16] = { 0xdf, 0x0e, 0x7a, 0xab, 0x96, 0x6b, 0x75, 0x4e, 0x52, 0x6a, 0x43, 0x96, 0xbd, 0xef, 0xab, 0x44 }; + len = 16; + if ((err = blake2bmac_file(fname, key, 32, buf, &len)) != CRYPT_OK) return err; + if (compare_testvector(buf, len, exp_blake2bmac, 16, "exp_blake2bmac_file", 1)) return 1; + } +#endif return CRYPT_OK; #endif From 61105b67f42bb1d1a79b02f61622436c4d405b58 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 21 Apr 2017 21:10:29 +0200 Subject: [PATCH 0636/1192] test vectors from https://github.com/BLAKE2 --- src/mac/blake2/blake2bmac_test.c | 306 +++++++++++++++++++++++++++++-- src/mac/blake2/blake2smac_test.c | 306 +++++++++++++++++++++++++++++-- 2 files changed, 572 insertions(+), 40 deletions(-) diff --git a/src/mac/blake2/blake2bmac_test.c b/src/mac/blake2/blake2bmac_test.c index b95ed5f45..aea94e52f 100644 --- a/src/mac/blake2/blake2bmac_test.c +++ b/src/mac/blake2/blake2bmac_test.c @@ -16,27 +16,293 @@ int blake2bmac_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - unsigned char k[] = { 0x85, 0xd6, 0xbe, 0x78, 0x57, 0x55, 0x6d, 0x33, 0x7f, 0x44, 0x52, 0xfe, 0x42, 0xd5, 0x06, 0xa8, 0x01, 0x03, 0x80, 0x8a, 0xfb, 0x0d, 0xb2, 0xfd, 0x4a, 0xbf, 0xf6, 0xaf, 0x41, 0x49, 0xf5, 0x1b }; - unsigned char tag[] = { 0x3d, 0xd6, 0x35, 0x81, 0x32, 0xb5, 0x3c, 0xc8, 0x0a, 0x8c, 0x33, 0x91, 0x93, 0x5d, 0x30, 0x1b }; - char m[] = "Cryptographic Forum Research Group"; - unsigned long len = 16, mlen = strlen(m); - unsigned char out[1000]; + static const unsigned char tests[256][64] = { + /* source: https://github.com/BLAKE2/BLAKE2/blob/master/testvectors/blake2b-kat.txt */ + { 0x10, 0xeb, 0xb6, 0x77, 0x00, 0xb1, 0x86, 0x8e, 0xfb, 0x44, 0x17, 0x98, 0x7a, 0xcf, 0x46, 0x90, 0xae, 0x9d, 0x97, 0x2f, 0xb7, 0xa5, 0x90, 0xc2, 0xf0, 0x28, 0x71, 0x79, 0x9a, 0xaa, 0x47, 0x86, 0xb5, 0xe9, 0x96, 0xe8, 0xf0, 0xf4, 0xeb, 0x98, 0x1f, 0xc2, 0x14, 0xb0, 0x05, 0xf4, 0x2d, 0x2f, 0xf4, 0x23, 0x34, 0x99, 0x39, 0x16, 0x53, 0xdf, 0x7a, 0xef, 0xcb, 0xc1, 0x3f, 0xc5, 0x15, 0x68 }, + { 0x96, 0x1f, 0x6d, 0xd1, 0xe4, 0xdd, 0x30, 0xf6, 0x39, 0x01, 0x69, 0x0c, 0x51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 0x62, 0xb9, 0x92, 0x8f, 0xfa, 0xb5, 0x8d, 0xe4, 0xaf, 0x2e, 0xdd, 0x4e, 0x15, 0xd8, 0xb3, 0x55, 0x70, 0x52, 0x32, 0x07, 0xff, 0x4e, 0x2a, 0x5a, 0xa7, 0x75, 0x4c, 0xaa }, + { 0x46, 0x2f, 0x17, 0xbf, 0x00, 0x5f, 0xb1, 0xc1, 0xb9, 0xe6, 0x71, 0x77, 0x9f, 0x66, 0x52, 0x09, 0xec, 0x28, 0x73, 0xe3, 0xe4, 0x11, 0xf9, 0x8d, 0xab, 0xf2, 0x40, 0xa1, 0xd5, 0xec, 0x3f, 0x95, 0xce, 0x67, 0x96, 0xb6, 0xfc, 0x23, 0xfe, 0x17, 0x19, 0x03, 0xb5, 0x02, 0x02, 0x34, 0x67, 0xde, 0xc7, 0x27, 0x3f, 0xf7, 0x48, 0x79, 0xb9, 0x29, 0x67, 0xa2, 0xa4, 0x3a, 0x5a, 0x18, 0x3d, 0x33 }, + { 0xd3, 0x33, 0x81, 0x93, 0xb6, 0x45, 0x53, 0xdb, 0xd3, 0x8d, 0x14, 0x4b, 0xea, 0x71, 0xc5, 0x91, 0x5b, 0xb1, 0x10, 0xe2, 0xd8, 0x81, 0x80, 0xdb, 0xc5, 0xdb, 0x36, 0x4f, 0xd6, 0x17, 0x1d, 0xf3, 0x17, 0xfc, 0x72, 0x68, 0x83, 0x1b, 0x5a, 0xef, 0x75, 0xe4, 0x34, 0x2b, 0x2f, 0xad, 0x87, 0x97, 0xba, 0x39, 0xed, 0xdc, 0xef, 0x80, 0xe6, 0xec, 0x08, 0x15, 0x93, 0x50, 0xb1, 0xad, 0x69, 0x6d }, + { 0xe1, 0x59, 0x0d, 0x58, 0x5a, 0x3d, 0x39, 0xf7, 0xcb, 0x59, 0x9a, 0xbd, 0x47, 0x90, 0x70, 0x96, 0x64, 0x09, 0xa6, 0x84, 0x6d, 0x43, 0x77, 0xac, 0xf4, 0x47, 0x1d, 0x06, 0x5d, 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0x9f, 0x6c, 0x12, 0x44, 0xeb, 0xf2, 0xff, 0x0d, 0xf8, 0x66 }, + { 0xda, 0x58, 0x2a, 0xd8, 0xc5, 0x37, 0x0b, 0x44, 0x69, 0xaf, 0x86, 0x2a, 0xa6, 0x46, 0x7a, 0x22, 0x93, 0xb2, 0xb2, 0x8b, 0xd8, 0x0a, 0xe0, 0xe9, 0x1f, 0x42, 0x5a, 0xd3, 0xd4, 0x72, 0x49, 0xfd, 0xf9, 0x88, 0x25, 0xcc, 0x86, 0xf1, 0x40, 0x28, 0xc3, 0x30, 0x8c, 0x98, 0x04, 0xc7, 0x8b, 0xfe, 0xee, 0xee, 0x46, 0x14, 0x44, 0xce, 0x24, 0x36, 0x87, 0xe1, 0xa5, 0x05, 0x22, 0x45, 0x6a, 0x1d }, + { 0xd5, 0x26, 0x6a, 0xa3, 0x33, 0x11, 0x94, 0xae, 0xf8, 0x52, 0xee, 0xd8, 0x6d, 0x7b, 0x5b, 0x26, 0x33, 0xa0, 0xaf, 0x1c, 0x73, 0x59, 0x06, 0xf2, 0xe1, 0x32, 0x79, 0xf1, 0x49, 0x31, 0xa9, 0xfc, 0x3b, 0x0e, 0xac, 0x5c, 0xe9, 0x24, 0x52, 0x73, 0xbd, 0x1a, 0xa9, 0x29, 0x05, 0xab, 0xe1, 0x62, 0x78, 0xef, 0x7e, 0xfd, 0x47, 0x69, 0x47, 0x89, 0xa7, 0x28, 0x3b, 0x77, 0xda, 0x3c, 0x70, 0xf8 }, + { 0x29, 0x62, 0x73, 0x4c, 0x28, 0x25, 0x21, 0x86, 0xa9, 0xa1, 0x11, 0x1c, 0x73, 0x2a, 0xd4, 0xde, 0x45, 0x06, 0xd4, 0xb4, 0x48, 0x09, 0x16, 0x30, 0x3e, 0xb7, 0x99, 0x1d, 0x65, 0x9c, 0xcd, 0xa0, 0x7a, 0x99, 0x11, 0x91, 0x4b, 0xc7, 0x5c, 0x41, 0x8a, 0xb7, 0xa4, 0x54, 0x17, 0x57, 0xad,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x21, 0xf9, 0x16, 0x1c, 0xb9, 0x2b, 0x69, 0xa9 }, + { 0x14, 0x27, 0x09, 0xd6, 0x2e, 0x28, 0xfc, 0xcc, 0xd0, 0xaf, 0x97, 0xfa, 0xd0, 0xf8, 0x46, 0x5b, 0x97, 0x1e, 0x82, 0x20, 0x1d, 0xc5, 0x10, 0x70, 0xfa, 0xa0, 0x37, 0x2a, 0xa4, 0x3e, 0x92, 0x48, 0x4b, 0xe1, 0xc1, 0xe7, 0x3b, 0xa1, 0x09, 0x06, 0xd5, 0xd1, 0x85, 0x3d, 0xb6, 0xa4, 0x10, 0x6e, 0x0a, 0x7b, 0xf9, 0x80, 0x0d, 0x37, 0x3d, 0x6d, 0xee, 0x2d, 0x46, 0xd6, 0x2e, 0xf2, 0xa4, 0x61 }, + }; + unsigned char inp[1000], out[1000]; + unsigned char key[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f }; + unsigned long ilen, klen = sizeof(key), mlen = 64; blake2bmac_state st; - /* process piece by piece */ - blake2bmac_init(&st, 16, k, 32); - blake2bmac_process(&st, (unsigned char*)m, 5); - blake2bmac_process(&st, (unsigned char*)m + 5, 4); - blake2bmac_process(&st, (unsigned char*)m + 9, 3); - blake2bmac_process(&st, (unsigned char*)m + 12, 2); - blake2bmac_process(&st, (unsigned char*)m + 14, 1); - blake2bmac_process(&st, (unsigned char*)m + 15, mlen - 15); - blake2bmac_done(&st, out, &len); - if (compare_testvector(out, len, tag, sizeof(tag), "BLAKE2B MAC-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; - /* process in one go */ - blake2bmac_init(&st, 16, k, 32); - blake2bmac_process(&st, (unsigned char*)m, mlen); - blake2bmac_done(&st, out, &len); - if (compare_testvector(out, len, tag, sizeof(tag), "BLAKE2B MAC-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + + for (ilen = 0; ilen < 256; ilen++) inp[ilen] = (unsigned char)ilen; + + for (ilen = 0; ilen < 256; ilen++) { + const unsigned char *mac = tests[ilen]; + unsigned long olen = mlen; + /* process piece by piece */ + if (ilen > 15) { + blake2bmac_init(&st, olen, key, klen); + blake2bmac_process(&st, (unsigned char*)inp, 5); + blake2bmac_process(&st, (unsigned char*)inp + 5, 4); + blake2bmac_process(&st, (unsigned char*)inp + 9, 3); + blake2bmac_process(&st, (unsigned char*)inp + 12, 2); + blake2bmac_process(&st, (unsigned char*)inp + 14, 1); + blake2bmac_process(&st, (unsigned char*)inp + 15, ilen - 15); + blake2bmac_done(&st, out, &olen); + if (compare_testvector(out, olen, mac, mlen, "BLAKE2B MAC multi", i) != 0) return CRYPT_FAIL_TESTVECTOR; + } + /* process in one go */ + blake2bmac_init(&st, olen, key, klen); + blake2bmac_process(&st, (unsigned char*)inp, ilen); + blake2bmac_done(&st, out, &olen); + if (compare_testvector(out, olen, mac, mlen, "BLAKE2B MAC single", i) != 0) return CRYPT_FAIL_TESTVECTOR; + } return CRYPT_OK; #endif } diff --git a/src/mac/blake2/blake2smac_test.c b/src/mac/blake2/blake2smac_test.c index 39c11cf3e..bacb0923f 100644 --- a/src/mac/blake2/blake2smac_test.c +++ b/src/mac/blake2/blake2smac_test.c @@ -16,27 +16,293 @@ int blake2smac_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - unsigned char k[] = { 0x85, 0xd6, 0xbe, 0x78, 0x57, 0x55, 0x6d, 0x33, 0x7f, 0x44, 0x52, 0xfe, 0x42, 0xd5, 0x06, 0xa8, 0x01, 0x03, 0x80, 0x8a, 0xfb, 0x0d, 0xb2, 0xfd, 0x4a, 0xbf, 0xf6, 0xaf, 0x41, 0x49, 0xf5, 0x1b }; - unsigned char tag[] = { 0x96, 0x32, 0xf9, 0x85, 0xf3, 0x30, 0xd6, 0x8c, 0x21, 0x78, 0x6e, 0xae, 0xb4, 0x99, 0xba, 0xbb }; - char m[] = "Cryptographic Forum Research Group"; - unsigned long len = 16, mlen = strlen(m); - unsigned char out[1000]; + static const unsigned char tests[256][32] = { + /* source: https://github.com/BLAKE2/BLAKE2/blob/master/testvectors/blake2s-kat.txt */ + { 0x48, 0xa8, 0x99, 0x7d, 0xa4, 0x07, 0x87, 0x6b, 0x3d, 0x79, 0xc0, 0xd9, 0x23, 0x25, 0xad, 0x3b, 0x89, 0xcb, 0xb7, 0x54, 0xd8, 0x6a, 0xb7, 0x1a, 0xee, 0x04, 0x7a, 0xd3, 0x45, 0xfd, 0x2c, 0x49 }, + { 0x40, 0xd1, 0x5f, 0xee, 0x7c, 0x32, 0x88, 0x30, 0x16, 0x6a, 0xc3, 0xf9, 0x18, 0x65, 0x0f, 0x80, 0x7e, 0x7e, 0x01, 0xe1, 0x77, 0x25, 0x8c, 0xdc, 0x0a, 0x39, 0xb1, 0x1f, 0x59, 0x80, 0x66, 0xf1 }, + { 0x6b, 0xb7, 0x13, 0x00, 0x64, 0x4c, 0xd3, 0x99, 0x1b, 0x26, 0xcc, 0xd4, 0xd2, 0x74, 0xac, 0xd1, 0xad, 0xea, 0xb8, 0xb1, 0xd7, 0x91, 0x45, 0x46, 0xc1, 0x19, 0x8b, 0xbe, 0x9f, 0xc9, 0xd8, 0x03 }, + { 0x1d, 0x22, 0x0d, 0xbe, 0x2e, 0xe1, 0x34, 0x66, 0x1f, 0xdf, 0x6d, 0x9e, 0x74, 0xb4, 0x17, 0x04, 0x71, 0x05, 0x56, 0xf2, 0xf6, 0xe5, 0xa0, 0x91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0x66, 0xa7, 0x01, 0xf3, 0x36, 0x7e, 0x6c, 0xc6, 0x65, 0xf3, 0x4b, 0x22, 0xe7, 0x3c, 0x3c, 0x04, 0x17, 0xeb, 0x1c, 0x22, 0x06, 0x08, 0x2f }, + { 0x26, 0xcd, 0x66, 0xfc, 0xa0, 0x23, 0x79, 0xc7, 0x6d, 0xf1, 0x23, 0x17, 0x05, 0x2b, 0xca, 0xfd, 0x6c, 0xd8, 0xc3, 0xa7, 0xb8, 0x90, 0xd8, 0x05, 0xf3, 0x6c, 0x49, 0x98, 0x97, 0x82, 0x43, 0x3a }, + { 0x21, 0x3f, 0x35, 0x96, 0xd6, 0xe3, 0xa5, 0xd0, 0xe9, 0x93, 0x2c, 0xd2, 0x15, 0x91, 0x46, 0x01, 0x5e, 0x2a, 0xbc, 0x94, 0x9f, 0x47, 0x29, 0xee, 0x26, 0x32, 0xfe, 0x1e, 0xdb, 0x78, 0xd3, 0x37 }, + { 0x10, 0x15, 0xd7, 0x01, 0x08, 0xe0, 0x3b, 0xe1, 0xc7, 0x02, 0xfe, 0x97, 0x25, 0x36, 0x07, 0xd1, 0x4a, 0xee, 0x59, 0x1f, 0x24, 0x13, 0xea, 0x67, 0x87, 0x42, 0x7b, 0x64, 0x59, 0xff, 0x21, 0x9a }, + { 0x3c, 0xa9, 0x89, 0xde, 0x10, 0xcf, 0xe6, 0x09, 0x90, 0x94, 0x72, 0xc8, 0xd3, 0x56, 0x10, 0x80, 0x5b, 0x2f, 0x97, 0x77, 0x34, 0xcf, 0x65, 0x2c, 0xc6, 0x4b, 0x3b, 0xfc, 0x88, 0x2d, 0x5d, 0x89 }, + { 0xb6, 0x15, 0x6f, 0x72, 0xd3, 0x80, 0xee, 0x9e, 0xa6, 0xac, 0xd1, 0x90, 0x46, 0x4f, 0x23, 0x07, 0xa5, 0xc1, 0x79, 0xef, 0x01, 0xfd, 0x71, 0xf9, 0x9f, 0x2d, 0x0f, 0x7a, 0x57, 0x36, 0x0a, 0xea }, + { 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 0xad, 0xcf, 0xf6, 0x8b, 0xf8, 0x74, 0x8e, 0xdf, 0x3c, 0xf8, 0x62, 0xcf, 0xb4, 0xd3, 0x94, 0x7a, 0x31, 0x06, 0x95, 0x80, 0x54, 0xe3 }, + { 0x88, 0x17, 0xe5, 0x71, 0x98, 0x79, 0xac, 0xf7, 0x02, 0x47, 0x87, 0xec, 0xcd, 0xb2, 0x71, 0x03, 0x55, 0x66, 0xcf, 0xa3, 0x33, 0xe0, 0x49, 0x40, 0x7c, 0x01, 0x78, 0xcc, 0xc5, 0x7a, 0x5b, 0x9f }, + { 0x89, 0x38, 0x24, 0x9e, 0x4b, 0x50, 0xca, 0xda, 0xcc, 0xdf, 0x5b, 0x18, 0x62, 0x13, 0x26, 0xcb, 0xb1, 0x52, 0x53, 0xe3, 0x3a, 0x20, 0xf5, 0x63, 0x6e, 0x99, 0x5d, 0x72, 0x47, 0x8d, 0xe4, 0x72 }, + { 0xf1, 0x64, 0xab, 0xba, 0x49, 0x63, 0xa4, 0x4d, 0x10, 0x72, 0x57, 0xe3, 0x23, 0x2d, 0x90, 0xac, 0xa5, 0xe6, 0x6a, 0x14, 0x08, 0x24, 0x8c, 0x51, 0x74, 0x1e, 0x99, 0x1d, 0xb5, 0x22, 0x77, 0x56 }, + { 0xd0, 0x55, 0x63, 0xe2, 0xb1, 0xcb, 0xa0, 0xc4, 0xa2, 0xa1, 0xe8, 0xbd, 0xe3, 0xa1, 0xa0, 0xd9, 0xf5, 0xb4, 0x0c, 0x85, 0xa0, 0x70, 0xd6, 0xf5, 0xfb, 0x21, 0x06, 0x6e, 0xad, 0x5d, 0x06, 0x01 }, + { 0x03, 0xfb, 0xb1, 0x63, 0x84, 0xf0, 0xa3, 0x86, 0x6f, 0x4c, 0x31, 0x17, 0x87, 0x76, 0x66, 0xef, 0xbf, 0x12, 0x45, 0x97, 0x56, 0x4b, 0x29, 0x3d, 0x4a, 0xab, 0x0d, 0x26, 0x9f, 0xab, 0xdd, 0xfa }, + { 0x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 0x45, 0x9c, 0xde, 0xcc, 0xc8, 0x98, 0xed, 0x59, 0xa9, 0x7f, 0x6e, 0xc9, 0x3b, 0x9d, 0xab }, + { 0x56, 0x6d, 0xc9, 0x20, 0x29, 0x3d, 0xa5, 0xcb, 0x4f, 0xe0, 0xaa, 0x8a, 0xbd, 0xa8, 0xbb, 0xf5, 0x6f, 0x55, 0x23, 0x13, 0xbf, 0xf1, 0x90, 0x46, 0x64, 0x1e, 0x36, 0x15, 0xc1, 0xe3, 0xed, 0x3f }, + { 0x41, 0x15, 0xbe, 0xa0, 0x2f, 0x73, 0xf9, 0x7f, 0x62, 0x9e, 0x5c, 0x55, 0x90, 0x72, 0x0c, 0x01, 0xe7, 0xe4, 0x49, 0xae, 0x2a, 0x66, 0x97, 0xd4, 0xd2, 0x78, 0x33, 0x21, 0x30, 0x36, 0x92, 0xf9 }, + { 0x4c, 0xe0, 0x8f, 0x47, 0x62, 0x46, 0x8a, 0x76, 0x70, 0x01, 0x21, 0x64, 0x87, 0x8d, 0x68, 0x34, 0x0c, 0x52, 0xa3, 0x5e, 0x66, 0xc1, 0x88, 0x4d, 0x5c, 0x86, 0x48, 0x89, 0xab, 0xc9, 0x66, 0x77 }, + { 0x81, 0xea, 0x0b, 0x78, 0x04, 0x12, 0x4e, 0x0c, 0x22, 0xea, 0x5f, 0xc7, 0x11, 0x04, 0xa2, 0xaf, 0xcb, 0x52, 0xa1, 0xfa, 0x81, 0x6f, 0x3e, 0xcb, 0x7d, 0xcb, 0x5d, 0x9d, 0xea, 0x17, 0x86, 0xd0 }, + { 0xfe, 0x36, 0x27, 0x33, 0xb0, 0x5f, 0x6b, 0xed, 0xaf, 0x93, 0x79, 0xd7, 0xf7, 0x93, 0x6e, 0xde, 0x20, 0x9b, 0x1f, 0x83, 0x23, 0xc3, 0x92, 0x25, 0x49, 0xd9, 0xe7, 0x36, 0x81, 0xb5, 0xdb, 0x7b }, + { 0xef, 0xf3, 0x7d, 0x30, 0xdf, 0xd2, 0x03,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 0x86, 0x61, 0x5a, 0x73, 0xa0, 0xda, 0x61, 0x3b, 0x5f, 0x1c, 0x98, 0xdb, 0xf8, 0x12, 0x83, 0xea }, + { 0xa6, 0x4e, 0xbe, 0x5d, 0xc1, 0x85, 0xde, 0x9f, 0xdd, 0xe7, 0x60, 0x7b, 0x69, 0x98, 0x70, 0x2e, 0xb2, 0x34, 0x56, 0x18, 0x49, 0x57, 0x30, 0x7d, 0x2f, 0xa7, 0x2e, 0x87, 0xa4, 0x77, 0x02, 0xd6 }, + { 0xce, 0x50, 0xea, 0xb7, 0xb5, 0xeb, 0x52, 0xbd, 0xc9, 0xad, 0x8e, 0x5a, 0x48, 0x0a, 0xb7, 0x80, 0xca, 0x93, 0x20, 0xe4, 0x43, 0x60, 0xb1, 0xfe, 0x37, 0xe0, 0x3f, 0x2f, 0x7a, 0xd7, 0xde, 0x01 }, + { 0xee, 0xdd, 0xb7, 0xc0, 0xdb, 0x6e, 0x30, 0xab, 0xe6, 0x6d, 0x79, 0xe3, 0x27, 0x51, 0x1e, 0x61, 0xfc, 0xeb, 0xbc, 0x29, 0xf1, 0x59, 0xb4, 0x0a, 0x86, 0xb0, 0x46, 0xec, 0xf0, 0x51, 0x38, 0x23 }, + { 0x78, 0x7f, 0xc9, 0x34, 0x40, 0xc1, 0xec, 0x96, 0xb5, 0xad, 0x01, 0xc1, 0x6c, 0xf7, 0x79, 0x16, 0xa1, 0x40, 0x5f, 0x94, 0x26, 0x35, 0x6e, 0xc9, 0x21, 0xd8, 0xdf, 0xf3, 0xea, 0x63, 0xb7, 0xe0 }, + { 0x7f, 0x0d, 0x5e, 0xab, 0x47, 0xee, 0xfd, 0xa6, 0x96, 0xc0, 0xbf, 0x0f, 0xbf, 0x86, 0xab, 0x21, 0x6f, 0xce, 0x46, 0x1e, 0x93, 0x03, 0xab, 0xa6, 0xac, 0x37, 0x41, 0x20, 0xe8, 0x90, 0xe8, 0xdf }, + { 0xb6, 0x80, 0x04, 0xb4, 0x2f, 0x14, 0xad, 0x02, 0x9f, 0x4c, 0x2e, 0x03, 0xb1, 0xd5, 0xeb, 0x76, 0xd5, 0x71, 0x60, 0xe2, 0x64, 0x76, 0xd2, 0x11, 0x31, 0xbe, 0xf2, 0x0a, 0xda, 0x7d, 0x27, 0xf4 }, + { 0xb0, 0xc4, 0xeb, 0x18, 0xae, 0x25, 0x0b, 0x51, 0xa4, 0x13, 0x82, 0xea, 0xd9, 0x2d, 0x0d, 0xc7, 0x45, 0x5f, 0x93, 0x79, 0xfc, 0x98, 0x84, 0x42, 0x8e, 0x47, 0x70, 0x60, 0x8d, 0xb0, 0xfa, 0xec }, + { 0xf9, 0x2b, 0x7a, 0x87, 0x0c, 0x05, 0x9f, 0x4d, 0x46, 0x46, 0x4c, 0x82, 0x4e, 0xc9, 0x63, 0x55, 0x14, 0x0b, 0xdc, 0xe6, 0x81, 0x32, 0x2c, 0xc3, 0xa9, 0x92, 0xff, 0x10, 0x3e, 0x3f, 0xea, 0x52 }, + { 0x53, 0x64, 0x31, 0x26, 0x14, 0x81, 0x33, 0x98, 0xcc, 0x52, 0x5d, 0x4c, 0x4e, 0x14, 0x6e, 0xde, 0xb3, 0x71, 0x26, 0x5f, 0xba, 0x19, 0x13, 0x3a, 0x2c, 0x3d, 0x21, 0x59, 0x29, 0x8a, 0x17, 0x42 }, + { 0xf6, 0x62, 0x0e, 0x68, 0xd3, 0x7f, 0xb2, 0xaf, 0x50, 0x00, 0xfc, 0x28, 0xe2, 0x3b, 0x83, 0x22, 0x97, 0xec, 0xd8, 0xbc, 0xe9, 0x9e, 0x8b, 0xe4, 0xd0, 0x4e, 0x85, 0x30, 0x9e, 0x3d, 0x33, 0x74 }, + { 0x53, 0x16, 0xa2, 0x79, 0x69, 0xd7, 0xfe, 0x04, 0xff, 0x27, 0xb2, 0x83, 0x96, 0x1b, 0xff, 0xc3, 0xbf, 0x5d, 0xfb, 0x32, 0xfb, 0x6a, 0x89, 0xd1, 0x01, 0xc6, 0xc3, 0xb1, 0x93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x2c, 0xc7, 0x7c, 0xa6, 0x75, 0xbc, 0xb3, 0x0d, 0xf3, 0x1d, 0x35, 0x8e, 0xf7, 0xb1, 0xeb }, + { 0xb1, 0x7e, 0xa8, 0xd7, 0x70, 0x63, 0xc7, 0x09, 0xd4, 0xdc, 0x6b, 0x87, 0x94, 0x13, 0xc3, 0x43, 0xe3, 0x79, 0x0e, 0x9e, 0x62, 0xca, 0x85, 0xb7, 0x90, 0x0b, 0x08, 0x6f, 0x6b, 0x75, 0xc6, 0x72 }, + { 0xe7, 0x1a, 0x3e, 0x2c, 0x27, 0x4d, 0xb8, 0x42, 0xd9, 0x21, 0x14, 0xf2, 0x17, 0xe2, 0xc0, 0xea, 0xc8, 0xb4, 0x50, 0x93, 0xfd, 0xfd, 0x9d, 0xf4, 0xca, 0x71, 0x62, 0x39, 0x48, 0x62, 0xd5, 0x01 }, + { 0xc0, 0x47, 0x67, 0x59, 0xab, 0x7a, 0xa3, 0x33, 0x23, 0x4f, 0x6b, 0x44, 0xf5, 0xfd, 0x85, 0x83, 0x90, 0xec, 0x23, 0x69, 0x4c, 0x62, 0x2c, 0xb9, 0x86, 0xe7, 0x69, 0xc7, 0x8e, 0xdd, 0x73, 0x3e }, + { 0x9a, 0xb8, 0xea, 0xbb, 0x14, 0x16, 0x43, 0x4d, 0x85, 0x39, 0x13, 0x41, 0xd5, 0x69, 0x93, 0xc5, 0x54, 0x58, 0x16, 0x7d, 0x44, 0x18, 0xb1, 0x9a, 0x0f, 0x2a, 0xd8, 0xb7, 0x9a, 0x83, 0xa7, 0x5b }, + { 0x79, 0x92, 0xd0, 0xbb, 0xb1, 0x5e, 0x23, 0x82, 0x6f, 0x44, 0x3e, 0x00, 0x50, 0x5d, 0x68, 0xd3, 0xed, 0x73, 0x72, 0x99, 0x5a, 0x5c, 0x3e, 0x49, 0x86, 0x54, 0x10, 0x2f, 0xbc, 0xd0, 0x96, 0x4e }, + { 0xc0, 0x21, 0xb3, 0x00, 0x85, 0x15, 0x14, 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, 0xab, 0x6f, 0xee, 0x88, 0xb8, 0x74, 0x20, 0xac, 0xef, 0x4a, 0x17, 0x89, 0xa2, 0x07, 0x3b, 0x7e, 0xc2, 0xf2, 0xa0, 0x9e }, + { 0x69, 0xcb, 0x19, 0x2b, 0x84, 0x44, 0x00, 0x5c, 0x8c, 0x0c, 0xeb, 0x12, 0xc8, 0x46, 0x86, 0x07, 0x68, 0x18, 0x8c, 0xda, 0x0a, 0xec, 0x27, 0xa9, 0xc8, 0xa5, 0x5c, 0xde, 0xe2, 0x12, 0x36, 0x32 }, + { 0xdb, 0x44, 0x4c, 0x15, 0x59, 0x7b, 0x5f, 0x1a, 0x03, 0xd1, 0xf9, 0xed, 0xd1, 0x6e, 0x4a, 0x9f, 0x43, 0xa6, 0x67, 0xcc, 0x27, 0x51, 0x75, 0xdf, 0xa2, 0xb7, 0x04, 0xe3, 0xbb, 0x1a, 0x9b, 0x83 }, + { 0x3f, 0xb7, 0x35, 0x06, 0x1a, 0xbc, 0x51, 0x9d, 0xfe, 0x97, 0x9e, 0x54, 0xc1, 0xee, 0x5b, 0xfa, 0xd0, 0xa9, 0xd8, 0x58, 0xb3, 0x31, 0x5b, 0xad, 0x34, 0xbd, 0xe9, 0x99, 0xef, 0xd7, 0x24, 0xdd }, + }; + unsigned char inp[1000], out[1000]; + unsigned char key[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }; + unsigned long ilen, klen = sizeof(key), mlen = 32; blake2smac_state st; - /* process piece by piece */ - blake2smac_init(&st,16, k, 32); - blake2smac_process(&st, (unsigned char*)m, 5); - blake2smac_process(&st, (unsigned char*)m + 5, 4); - blake2smac_process(&st, (unsigned char*)m + 9, 3); - blake2smac_process(&st, (unsigned char*)m + 12, 2); - blake2smac_process(&st, (unsigned char*)m + 14, 1); - blake2smac_process(&st, (unsigned char*)m + 15, mlen - 15); - blake2smac_done(&st, out, &len); - if (compare_testvector(out, len, tag, sizeof(tag), "BLAKE2S MAC-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; - /* process in one go */ - blake2smac_init(&st, 16, k, 32); - blake2smac_process(&st, (unsigned char*)m, mlen); - blake2smac_done(&st, out, &len); - if (compare_testvector(out, len, tag, sizeof(tag), "BLAKE2S MAC-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + + for (ilen = 0; ilen < 256; ilen++) inp[ilen] = (unsigned char)ilen; + + for (ilen = 0; ilen < 256; ilen++) { + const unsigned char *mac = tests[ilen]; + unsigned long olen = mlen; + /* process piece by piece */ + if (ilen > 15) { + blake2smac_init(&st, olen, key, klen); + blake2smac_process(&st, (unsigned char*)inp, 5); + blake2smac_process(&st, (unsigned char*)inp + 5, 4); + blake2smac_process(&st, (unsigned char*)inp + 9, 3); + blake2smac_process(&st, (unsigned char*)inp + 12, 2); + blake2smac_process(&st, (unsigned char*)inp + 14, 1); + blake2smac_process(&st, (unsigned char*)inp + 15, ilen - 15); + blake2smac_done(&st, out, &olen); + if (compare_testvector(out, olen, mac, mlen, "BLAKE2S MAC multi", i) != 0) return CRYPT_FAIL_TESTVECTOR; + } + /* process in one go */ + blake2smac_init(&st, olen, key, klen); + blake2smac_process(&st, (unsigned char*)inp, ilen); + blake2smac_done(&st, out, &olen); + if (compare_testvector(out, olen, mac, mlen, "BLAKE2S MAC single", i) != 0) return CRYPT_FAIL_TESTVECTOR; + } return CRYPT_OK; #endif } From d587b380e6759e5b6abfe58fc2386f88839a535a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 23 Apr 2017 18:50:37 +0200 Subject: [PATCH 0637/1192] updating demos/multi.c --- demos/multi.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 122 insertions(+), 5 deletions(-) diff --git a/demos/multi.c b/demos/multi.c index 84d413676..31d1799a5 100644 --- a/demos/multi.c +++ b/demos/multi.c @@ -3,10 +3,9 @@ int main(void) { - unsigned char key[16], buf[2][MAXBLOCKSIZE]; + unsigned char key[32], buf[2][MAXBLOCKSIZE]; unsigned long len, len2; - /* register algos */ register_hash(&sha256_desc); register_cipher(&aes_desc); @@ -33,7 +32,7 @@ int main(void) return EXIT_FAILURE; } -/* LTC_HMAC */ +#ifdef LTC_HMAC len = sizeof(buf[0]); hmac_memory(find_hash("sha256"), key, 16, (unsigned char*)"hello", 5, buf[0], &len); len2 = sizeof(buf[0]); @@ -54,8 +53,8 @@ int main(void) printf("Failed: %d %lu %lu\n", __LINE__, len, len2); return EXIT_FAILURE; } +#endif -/* LTC_OMAC */ #ifdef LTC_OMAC len = sizeof(buf[0]); omac_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len); @@ -79,7 +78,6 @@ int main(void) } #endif -/* PMAC */ #ifdef LTC_PMAC len = sizeof(buf[0]); pmac_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len); @@ -103,6 +101,125 @@ int main(void) } #endif +#ifdef LTC_XCBC + len = sizeof(buf[0]); + xcbc_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len); + len2 = sizeof(buf[0]); + xcbc_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = sizeof(buf[0]); + xcbc_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = sizeof(buf[0]); + xcbc_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } +#endif + +#ifdef LTC_F9 + len = sizeof(buf[0]); + f9_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len); + len2 = sizeof(buf[0]); + f9_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = sizeof(buf[0]); + f9_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = sizeof(buf[0]); + f9_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } +#endif + +#ifdef LTC_PELICAN + /* TODO: there is no pelican_memory_multi(..) */ +#endif + +#ifdef LTC_POLY1305 + len = sizeof(buf[0]); + poly1305_memory(key, 32, (unsigned char*)"hello", 5, buf[0], &len); + len2 = sizeof(buf[0]); + poly1305_memory_multi(key, 32, buf[1], &len2, (unsigned char*)"hello", 5, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = sizeof(buf[0]); + poly1305_memory_multi(key, 32, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = sizeof(buf[0]); + poly1305_memory_multi(key, 32, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } +#endif + +#ifdef LTC_BLAKE2SMAC + len = 32; + blake2smac_memory(key, 16, (unsigned char*)"hello", 5, buf[0], &len); + len2 = 32; + blake2smac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = 32; + blake2smac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = 32; + blake2smac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } +#endif + +#ifdef LTC_BLAKE2BMAC + len = 64; + blake2bmac_memory(key, 16, (unsigned char*)"hello", 5, buf[0], &len); + len2 = 64; + blake2bmac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = 64; + blake2bmac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } + len2 = 64; + blake2bmac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); + if (len != len2 || memcmp(buf[0], buf[1], len)) { + printf("Failed: %d %lu %lu\n", __LINE__, len, len2); + return EXIT_FAILURE; + } +#endif + printf("All passed\n"); return EXIT_SUCCESS; } From 08ea7fc0f45a6b0d1706a3dc93a5d0322e2a75e4 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 23 Apr 2017 22:04:08 +0200 Subject: [PATCH 0638/1192] demos/multi.c -> testprof/multi_test.c --- demos/multi.c => testprof/multi_test.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename demos/multi.c => testprof/multi_test.c (100%) diff --git a/demos/multi.c b/testprof/multi_test.c similarity index 100% rename from demos/multi.c rename to testprof/multi_test.c From 3ea8a00ecd5861c8bfa930b5142e1b36c35c3b95 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 23 Apr 2017 22:04:39 +0200 Subject: [PATCH 0639/1192] new multi_test --- coverage.sh | 2 +- demos/test.c | 1 + makefile | 2 +- makefile.icc | 1 - makefile.include | 3 +- makefile.mingw | 7 +---- makefile.unix | 7 +---- testprof/makefile | 2 +- testprof/makefile.icc | 2 +- testprof/makefile.mingw | 2 +- testprof/makefile.msvc | 2 +- testprof/multi_test.c | 66 ++++++++++++++++++---------------------- testprof/tomcrypt_test.h | 1 + 13 files changed, 41 insertions(+), 57 deletions(-) diff --git a/coverage.sh b/coverage.sh index 14dcd5a49..d089ff6d6 100755 --- a/coverage.sh +++ b/coverage.sh @@ -31,7 +31,7 @@ fi ./sizes ./constants -./multi + for i in $(./hashsum | tail -n +3 | awk '{print $1}' | sort); do echo -n "$i: " && ./hashsum $i testprof/test.key ; done > hashsum_tv.txt difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true if [ -n "$difftroubles" ]; then diff --git a/demos/test.c b/demos/test.c index ac812c224..4c7a332c8 100644 --- a/demos/test.c +++ b/demos/test.c @@ -25,6 +25,7 @@ static const struct { LTC_TEST_FN(dsa_test), LTC_TEST_FN(katja_test), LTC_TEST_FN(file_test), + LTC_TEST_FN(multi_test), }; int main(int argc, char **argv) diff --git a/makefile b/makefile index 4ce3bf24b..9fb01132a 100644 --- a/makefile +++ b/makefile @@ -351,7 +351,7 @@ clean: rm -f `find . -type f -name "*.dpi" | xargs` rm -rf `find . -type d -name "*.libs" | xargs` rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc - rm -f $(TV) $(SMALL) $(CRYPT) $(HASH) $(MULTI) $(TIMING) $(TEST) + rm -f $(TV) $(SMALL) $(CRYPT) $(HASH) $(TIMING) $(TEST) rm -f $(SIZES) $(CONSTANTS) rm -rf doc/doxygen rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` diff --git a/makefile.icc b/makefile.icc index 6c04ba846..c68a52e4b 100644 --- a/makefile.icc +++ b/makefile.icc @@ -77,7 +77,6 @@ CRYPT=encrypt SMALL=small PROF=x86_prof TV=tv_gen -MULTI=multi TIMING=timing TEST=test diff --git a/makefile.include b/makefile.include index 4d710004e..a2256c6c3 100644 --- a/makefile.include +++ b/makefile.include @@ -75,13 +75,12 @@ HASH=hashsum CRYPT=encrypt SMALL=small TV=tv_gen -MULTI=multi TIMING=timing TEST=test SIZES=sizes CONSTANTS=constants -DEMOS=hashsum crypt small tv_gen multi sizes constants +DEMOS=hashsum crypt small tv_gen sizes constants TIMINGS=demos/timing.o TESTS=demos/test.o diff --git a/makefile.mingw b/makefile.mingw index ece1491ed..71a450b3d 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -23,7 +23,6 @@ CRYPT=encrypt SMALL=small PROF=x86_prof TV=tv_gen -MULTI=multi TIMING=timing TEST=test @@ -197,7 +196,6 @@ HASHOBJECTS=demos/hashsum.o CRYPTOBJECTS=demos/encrypt.o SMALLOBJECTS=demos/small.o TVS=demos/tv_gen.o -MULTIS=demos/multi.o TIMINGS=demos/timing.o TESTS=demos/test.o @@ -246,9 +244,6 @@ small: library $(SMALLOBJECTS) tv_gen: library $(TVS) $(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) -multi: library $(MULTIS) - $(CC) $(MULTIS) $(LIBNAME) $(EXTRALIBS) -o $(MULTI) - timing: library testprof/$(LIBTEST) $(TIMINGS) $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) @@ -256,7 +251,7 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) -all_test: test tv_gen hashsum crypt small multi timing +all_test: test tv_gen hashsum crypt small timing install: library cmd /c if not exist "$(DESTDIR)$(LIBPATH)" mkdir "$(DESTDIR)$(LIBPATH)" diff --git a/makefile.unix b/makefile.unix index 0f6b9a99a..f23efb3fb 100644 --- a/makefile.unix +++ b/makefile.unix @@ -22,7 +22,6 @@ CRYPT=encrypt SMALL=small PROF=x86_prof TV=tv_gen -MULTI=multi TIMING=timing TEST=test @@ -202,7 +201,6 @@ HASHOBJECTS=demos/hashsum.o CRYPTOBJECTS=demos/encrypt.o SMALLOBJECTS=demos/small.o TVS=demos/tv_gen.o -MULTIS=demos/multi.o TIMINGS=demos/timing.o TESTS=demos/test.o @@ -254,9 +252,6 @@ small: library $(SMALLOBJECTS) tv_gen: library $(TVS) $(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) -multi: library $(MULTIS) - $(CC) $(MULTIS) $(LIBNAME) $(EXTRALIBS) -o $(MULTI) - timing: library testprof/$(LIBTEST) $(TIMINGS) $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) @@ -264,7 +259,7 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) -all_test: test tv_gen hashsum crypt small multi timing +all_test: test tv_gen hashsum crypt small timing #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct diff --git a/testprof/makefile b/testprof/makefile index 78d54c842..db7bbd941 100644 --- a/testprof/makefile +++ b/testprof/makefile @@ -20,7 +20,7 @@ endif OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o multi_test.o ifndef LIBTEST_S LIBTEST_S=libtomcrypt_prof.a diff --git a/testprof/makefile.icc b/testprof/makefile.icc index acd90c7a8..6ce7b086e 100644 --- a/testprof/makefile.icc +++ b/testprof/makefile.icc @@ -4,7 +4,7 @@ CC?=icc OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o multi_test.o ifndef LIBTEST_S LIBTEST_S = libtomcrypt_prof.a diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw index b454d12dc..5d17df2a3 100644 --- a/testprof/makefile.mingw +++ b/testprof/makefile.mingw @@ -7,7 +7,7 @@ CFLAGS = $(CFLAGS_OPTS) -I../src/headers -I../../libtommath -I. -Wall -Wextra -D OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o \ -pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o +pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o multi_test.o default: $(LIBTEST_S) diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc index 1b361a646..72d32db8b 100644 --- a/testprof/makefile.msvc +++ b/testprof/makefile.msvc @@ -4,7 +4,7 @@ OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj file_test dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ rsa_test.obj store_test.obj rotate_test.obj test_driver.obj x86_prof.obj katja_test.obj \ dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj \ -pkcs_1_emsa_test.obj pkcs_1_eme_test.obj +pkcs_1_emsa_test.obj pkcs_1_eme_test.obj multi_test.obj .c.obj: $(CC) $(CFLAGS) /c $< /Fo$@ diff --git a/testprof/multi_test.c b/testprof/multi_test.c index 31d1799a5..dc899c0a9 100644 --- a/testprof/multi_test.c +++ b/testprof/multi_test.c @@ -1,7 +1,7 @@ /* test the multi helpers... */ -#include +#include -int main(void) +int multi_test(void) { unsigned char key[32], buf[2][MAXBLOCKSIZE]; unsigned long len, len2; @@ -17,19 +17,19 @@ int main(void) hash_memory_multi(find_hash("sha256"), buf[1], &len2, (unsigned char*)"hello", 5, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); hash_memory_multi(find_hash("sha256"), buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL, 0); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); hash_memory_multi(find_hash("sha256"), buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #ifdef LTC_HMAC @@ -39,19 +39,19 @@ int main(void) hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #endif @@ -62,19 +62,19 @@ int main(void) omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #endif @@ -85,19 +85,19 @@ int main(void) pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #endif @@ -108,19 +108,19 @@ int main(void) xcbc_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); xcbc_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); xcbc_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #endif @@ -131,19 +131,19 @@ int main(void) f9_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); f9_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); f9_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #endif @@ -158,19 +158,19 @@ int main(void) poly1305_memory_multi(key, 32, buf[1], &len2, (unsigned char*)"hello", 5, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); poly1305_memory_multi(key, 32, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = sizeof(buf[0]); poly1305_memory_multi(key, 32, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #endif @@ -181,19 +181,19 @@ int main(void) blake2smac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = 32; blake2smac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = 32; blake2smac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #endif @@ -204,27 +204,21 @@ int main(void) blake2bmac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = 64; blake2bmac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } len2 = 64; blake2bmac_memory_multi(key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL); if (len != len2 || memcmp(buf[0], buf[1], len)) { printf("Failed: %d %lu %lu\n", __LINE__, len, len2); - return EXIT_FAILURE; + return CRYPT_FAIL_TESTVECTOR; } #endif - printf("All passed\n"); - return EXIT_SUCCESS; + return CRYPT_OK; } - - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 9e4dce4c7..64f2c23ff 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -66,6 +66,7 @@ int der_tests(void); int misc_test(void); int base64_test(void); int file_test(void); +int multi_test(void); /* timing */ #define KTIMES 25 From 0f0f1e40be2027ec08056fcf7cfabf88fb8e876b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 24 Apr 2017 21:59:21 +0200 Subject: [PATCH 0640/1192] indentation --- src/mac/blake2/blake2bmac_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mac/blake2/blake2bmac_file.c b/src/mac/blake2/blake2bmac_file.c index a63636908..372213884 100644 --- a/src/mac/blake2/blake2bmac_file.c +++ b/src/mac/blake2/blake2bmac_file.c @@ -22,7 +22,7 @@ */ int blake2bmac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen) { - #ifdef LTC_NO_FILE +#ifdef LTC_NO_FILE return CRYPT_NOP; #else blake2bmac_state st; From 0d998fd4c8cea0c01a02b48b8cca83244e5b9a06 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 25 Apr 2017 01:10:15 +0200 Subject: [PATCH 0641/1192] stream/chacha ivlen cosmetics --- src/stream/chacha/chacha_ivctr32.c | 1 + src/stream/chacha/chacha_ivctr64.c | 1 + src/stream/chacha/chacha_setup.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stream/chacha/chacha_ivctr32.c b/src/stream/chacha/chacha_ivctr32.c index 14780f87b..9884a1ee9 100644 --- a/src/stream/chacha/chacha_ivctr32.c +++ b/src/stream/chacha/chacha_ivctr32.c @@ -36,6 +36,7 @@ int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivle LOAD32L(st->input[14], iv + 4); LOAD32L(st->input[15], iv + 8); st->ksleft = 0; + st->ivlen = ivlen; return CRYPT_OK; } diff --git a/src/stream/chacha/chacha_ivctr64.c b/src/stream/chacha/chacha_ivctr64.c index 6a6c43df7..82d39fb47 100644 --- a/src/stream/chacha/chacha_ivctr64.c +++ b/src/stream/chacha/chacha_ivctr64.c @@ -36,6 +36,7 @@ int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivle LOAD32L(st->input[14], iv + 0); LOAD32L(st->input[15], iv + 4); st->ksleft = 0; + st->ivlen = ivlen; return CRYPT_OK; } diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c index 04c43b85d..69a148335 100644 --- a/src/stream/chacha/chacha_setup.c +++ b/src/stream/chacha/chacha_setup.c @@ -53,7 +53,8 @@ int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keyle LOAD32L(st->input[1], constants + 4); LOAD32L(st->input[2], constants + 8); LOAD32L(st->input[3], constants + 12); - st->rounds = rounds; /* e.g. 20 for chacha20 */ + st->rounds = rounds; /* e.g. 20 for chacha20 */ + st->ivlen = 0; /* will be set later by chacha_ivctr(32|64) */ return CRYPT_OK; } From 94f1b407d1fbffb891162ad70cb22a8c8fcbd4cc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 29 Apr 2014 15:15:54 +0200 Subject: [PATCH 0642/1192] start updating documentation --- crypt.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crypt.tex b/crypt.tex index 8ac054cdd..6f2ff0a61 100644 --- a/crypt.tex +++ b/crypt.tex @@ -2141,7 +2141,7 @@ \subsection{Hash Registration} These hashes are provided for completeness and they still can be used for the purposes of password hashing or one-way accumulators (e.g. Yarrow). -The other hashes such as the SHA-1, SHA-2 (that includes SHA-512, SHA-384 and SHA-256) and TIGER-192 are still considered secure +The other hashes such as the SHA-1, SHA-2 (that includes SHA-512, SHA-384, SHA-256 and SHA-224) and TIGER-192 are still considered secure for all purposes you would normally use a hash for. \chapter{Message Authentication Codes} @@ -5594,14 +5594,14 @@ \subsubsection{ARGTYPE} to 4, it will return CRYPT\_INVALID\_ARG to the caller. \subsubsection{Endianness} -There are five macros related to endianess issues. For little endian platforms define, \textbf{ENDIAN\_LITTLE}. For big endian +There are five macros related to endianness issues. For little endian platforms define, \textbf{ENDIAN\_LITTLE}. For big endian platforms define \textbf{ENDIAN\_BIG}. Similarly when the default word size of an \textit{unsigned long} is 32-bits define \textbf{ENDIAN\_32BITWORD} or define \textbf{ENDIAN\_64BITWORD} when its 64-bits. If you do not define any of them the library will automatically use \textbf{ENDIAN\_NEUTRAL} which will work on all platforms. Currently LibTomCrypt will detect x86-32, x86-64, MIPS R5900, SPARC and SPARC64 running GCC as well as x86-32 running MSVC. -\mysection{The Configure Script} +\mysection{Customisation} There are also options you can specify from the \textit{tomcrypt\_custom.h} header file. \subsection{X memory routines} @@ -5636,7 +5636,7 @@ \subsection{LTC\_NO\_FAST} which can be auto-detected. This macro ensures that they are never enabled. \subsection{LTC\_FAST} -This mode (auto-detected with x86\_32,x86\_64 platforms with GCC or MSVC) configures various routines such as ctr\_encrypt() or +This mode (auto-detected with x86\_32, x86\_64 platforms with GCC or CLANG) configures various routines such as ctr\_encrypt() or cbc\_encrypt() that it can safely XOR multiple octets in one step by using a larger data type. This has the benefit of cutting down the overhead of the respective functions. @@ -5656,8 +5656,8 @@ \subsection{LTC\_FAST} CTR'ing a long stream process it in blocks of (say) four kilobytes and handle any remaining incomplete blocks at the end of the stream. \index{LTC\_FAST\_TYPE} -If you do plan on using the \textit{LTC\_FAST} mode you have to also define a \textit{LTC\_FAST\_TYPE} macro which resolves to an optimal sized -data type you can perform integer operations with. Ideally it should be four or eight bytes since it must properly divide the size +If you do plan on using the \textit{LTC\_FAST} mode, a \textit{LTC\_FAST\_TYPE} type which resolves to an optimal sized +data type you can perform integer operations with is required. For the auto-detected platforms this type will be defined automatically. Ideally it should be four or eight bytes since it must properly divide the size of your block cipher (e.g. 16 bytes for AES). This means sadly if you're on a platform with 57--bit words (or something) you can't use this mode. So sad. From 4d35336e38ec856c2566e5dcdf70d924c70aa12f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 17 Jul 2014 11:30:44 +0200 Subject: [PATCH 0643/1192] more documentation --- crypt.tex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crypt.tex b/crypt.tex index 6f2ff0a61..64444707c 100644 --- a/crypt.tex +++ b/crypt.tex @@ -601,7 +601,7 @@ \subsection{Simple Encryption Demonstration} \vfil \index{Cipher descriptor table} \index{blowfish\_desc} \index{xtea\_desc} \index{rc2\_desc} \index{rc5\_desc} \index{rc6\_desc} \index{saferp\_desc} \index{aes\_desc} \index{twofish\_desc} -\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{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} \begin{figure}[hpbt] \begin{small} \begin{center} @@ -625,6 +625,7 @@ \subsection{Simple Encryption Demonstration} \hline Khazad & khazad\_desc & 8 & 16 & 8 \\ \hline SEED & kseed\_desc & 16 & 16 & 16 \\ \hline KASUMI & kasumi\_desc & 8 & 16 & 8 \\ + \hline Camellia & camellia\_desc & 16 & 16, 24, 32 & 18, 24 \\ \hline \end{tabular} \end{center} @@ -653,6 +654,8 @@ \subsection{Notes} fact used for the purposes of encryption. My suggestion is just to use random 8/24 byte keys instead of trying to make a 8/24 byte string from the real 7/21 byte key. +For \textit{3DES} exists a two-key mode, that can be initialized by calling the setup function with a \textit{keylen} of 16. This results in the re-usage of key \textit{K1} as key \textit{K3}. This mode has been specified as \textit{Keying Option 2} in FIPS 46-3. + \item Note that \textit{Twofish} has additional configuration options (Figure \ref{fig:twofishopts}) that take place at build time. These options are found in the file \textit{tomcrypt\_cfg.h}. The first option is \textit{TWOFISH\_SMALL} which when defined will force the Twofish code From f44c972b10405db13c82e956a81b6de9e77b122a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 17 Jul 2014 11:38:47 +0200 Subject: [PATCH 0644/1192] update changes document [skip ci] --- changes | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/changes b/changes index 85a9c69ca..055c918cf 100644 --- a/changes +++ b/changes @@ -1,3 +1,25 @@ +June 25th, 2014 +v1.18 -- Added Camellia block cipher + -- Thanks to Karel Miko for cotributing a bunchload of patches and additions, namely + OCBv3, DSA and ECC key generation FIPS-186-4 compliance, BASE64-URL encoding, + a bugfix in Camellia, + -- Larry Bugbee contributed the necessary stuff to easier include libtomcrypt + in a foreign language like python, as shown in his pyTomCrypt + -- Nikos Mavrogiannopoulos contributed RSA blinding and export of RSA and DSA keys + in OpenSSL/GnuTLS compatible format + -- Patrick Pelletier contributed a smart volley of patches + -- RyanC contributed HKDF including documentation (yippie) + -- Added 2-key Triple-DES mode, thanks to Paul Howarth + -- Brought back Diffie-Hellman + -- Enabled timing resistant calculations of ECC and RSA operations per default + -- Fixed several build issues on FreeBSD, NetBSD, Linux x32 ABI, x86_64 Windows ... + -- Documentation (crypt.pdf) is now built deterministically, thanks to Michael Stapelberg + -- Removed all compiler warnings + -- Improved/extended several tests + -- Bugfix multi2 + -- Bugfix Noekeon + -- Bugfix XTEA + May 12th, 2007 v1.17 -- Cryptography Research Inc. contributed another small volley of patches, one to fix __WCHAR_DEFINED__ for BSD platforms, another to silence MSVC warnings. From f73a342b17aec947bc69fa3dbbffcdf4845c2f97 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 17 Jul 2014 19:00:03 +0200 Subject: [PATCH 0645/1192] oops, it's not yet released [skip ci] --- changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes b/changes index 055c918cf..ddbfd93e6 100644 --- a/changes +++ b/changes @@ -1,4 +1,4 @@ -June 25th, 2014 +XXX, 2014 v1.18 -- Added Camellia block cipher -- Thanks to Karel Miko for cotributing a bunchload of patches and additions, namely OCBv3, DSA and ECC key generation FIPS-186-4 compliance, BASE64-URL encoding, From 82ea2ee3daa9c555d28a5faea3d2601cdbc04439 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 25 Aug 2014 19:53:01 +0200 Subject: [PATCH 0646/1192] update changes document --- changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changes b/changes index ddbfd93e6..4c8ef58a4 100644 --- a/changes +++ b/changes @@ -10,6 +10,11 @@ v1.18 -- Added Camellia block cipher -- Patrick Pelletier contributed a smart volley of patches -- RyanC contributed HKDF including documentation (yippie) -- Added 2-key Triple-DES mode, thanks to Paul Howarth + -- Christopher Braun contributed some patches and additions to ASN.1/DER + -- Applied some patches from the OLPC project regarding PKCS#1 and preventing the + the hash algorithms from overflowing + -- Fixed the Bleichbacher Signature attack in PKCS#1 v1.5 EMSA, thanks to Alex Dent + -- Add PKCS#1 testvectors from RSA -- Brought back Diffie-Hellman -- Enabled timing resistant calculations of ECC and RSA operations per default -- Fixed several build issues on FreeBSD, NetBSD, Linux x32 ABI, x86_64 Windows ... From e212f04f0fccff0bcdb8b404ad97eab638014ded Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Aug 2014 14:42:19 +0200 Subject: [PATCH 0647/1192] trim trailing spaces --- crypt.tex | 2262 ++++++++++++++++++++++++++--------------------------- 1 file changed, 1131 insertions(+), 1131 deletions(-) diff --git a/crypt.tex b/crypt.tex index 64444707c..6f62f5cb0 100644 --- a/crypt.tex +++ b/crypt.tex @@ -116,21 +116,21 @@ \mainmatter \chapter{Introduction} \mysection{What is the LibTomCrypt?} -LibTomCrypt is a portable ISO C cryptographic library meant to be a tool set for cryptographers who are -designing cryptosystems. It supports symmetric ciphers, one-way hashes, pseudo-random number generators, -public key cryptography (via PKCS \#1 RSA, DH or ECCDH), and a plethora of support routines. +LibTomCrypt is a portable ISO C cryptographic library meant to be a tool set for cryptographers who are +designing cryptosystems. It supports symmetric ciphers, one-way hashes, pseudo-random number generators, +public key cryptography (via PKCS \#1 RSA, DH or ECCDH), and a plethora of support routines. -The library was designed such that new ciphers/hashes/PRNGs can be added at run-time and the existing API -(and helper API functions) are able to use the new designs automatically. There exists self-check functions for each -block cipher and hash function to ensure that they compile and execute to the published design specifications. The library +The library was designed such that new ciphers/hashes/PRNGs can be added at run-time and the existing API +(and helper API functions) are able to use the new designs automatically. There exists self-check functions for each +block cipher and hash function to ensure that they compile and execute to the published design specifications. The library also performs extensive parameter error checking to prevent any number of run-time exploits or errors. \subsection{What the library IS for?} The library serves as a toolkit for developers who have to solve cryptographic problems. Out of the box LibTomCrypt does not process SSL or OpenPGP messages, it doesn't read X.509 certificates, or write PEM encoded data. It does, however, -provide all of the tools required to build such functionality. LibTomCrypt was designed to be a flexible library that -was not tied to any particular cryptographic problem. +provide all of the tools required to build such functionality. LibTomCrypt was designed to be a flexible library that +was not tied to any particular cryptographic problem. \mysection{Why did I write it?} You may be wondering, \textit{Tom, why did you write a crypto library. I already have one.} Well the reason falls into @@ -140,14 +140,14 @@ \subsection{What the library IS for?} \item It was (still is) good coding practice. \end{enumerate} -The idea is that I am not striving to replace OpenSSL or Crypto++ or Cryptlib or etc. I'm trying to write my +The idea is that I am not striving to replace OpenSSL or Crypto++ or Cryptlib or etc. I'm trying to write my {\bf own} crypto library and hopefully along the way others will appreciate the work. With this library all core functions (ciphers, hashes, prngs, and bignum) have the same prototype definition. They all load and store data in a format independent of the platform. This means if you encrypt with Blowfish on a PPC it should decrypt -on an x86 with zero problems. The consistent API also means that if you learn how to use Blowfish with the library you -know how to use Safer+, RC6, or Serpent as well. With all of the core functions there are central descriptor tables -that can be used to make a program automatically pick between ciphers, hashes and PRNGs at run-time. That means your +on an x86 with zero problems. The consistent API also means that if you learn how to use Blowfish with the library you +know how to use Safer+, RC6, or Serpent as well. With all of the core functions there are central descriptor tables +that can be used to make a program automatically pick between ciphers, hashes and PRNGs at run-time. That means your application can support all ciphers/hashes/prngs/bignum without changing the source code. Not only did I strive to make a consistent and simple API to work with but I also attempted to make the library @@ -163,23 +163,23 @@ \subsection{What the library IS for?} \subsection{Modular} The LibTomCrypt package has also been written to be very modular. The block ciphers, one--way hashes, -pseudo--random number generators (PRNG), and bignum math routines are all used within the API through \textit{descriptor} tables which +pseudo--random number generators (PRNG), and bignum math routines are all used within the API through \textit{descriptor} tables which are essentially structures with pointers to functions. While you can still call particular functions directly (\textit{e.g. sha256\_process()}) this descriptor interface allows the developer to customize their usage of the library. For example, consider a hardware platform with a specialized RNG device. Obviously one would like to tap that for the PRNG needs within the library (\textit{e.g. making a RSA key}). All the developer has to do -is write a descriptor and the few support routines required for the device. After that the rest of the -API can make use of it without change. Similarly imagine a few years down the road when AES2 -(\textit{or whatever they call it}) has been invented. It can be added to the library and used within applications +is write a descriptor and the few support routines required for the device. After that the rest of the +API can make use of it without change. Similarly imagine a few years down the road when AES2 +(\textit{or whatever they call it}) has been invented. It can be added to the library and used within applications with zero modifications to the end applications provided they are written properly. -This flexibility within the library means it can be used with any combination of primitive algorithms and +This flexibility within the library means it can be used with any combination of primitive algorithms and unlike libraries like OpenSSL is not tied to direct routines. For instance, in OpenSSL there are CBC block mode routines for every single cipher. That means every time you add or remove a cipher from the library you have to update the associated support code as well. In LibTomCrypt the associated code (\textit{chaining modes in this case}) -are not directly tied to the ciphers. That is a new cipher can be added to the library by simply providing +are not directly tied to the ciphers. That is a new cipher can be added to the library by simply providing the key setup, ECB decrypt and encrypt and test vector routines. After that all five chaining mode routines can make use of the cipher right away. @@ -190,12 +190,12 @@ \subsection{Modular} \mysection{Patent Disclosure} The author (Tom St Denis) is not a patent lawyer so this section is not to be treated as legal advice. To the best -of the author's knowledge the only patent related issues within the library are the RC5 and RC6 symmetric block ciphers. +of the author's knowledge the only patent related issues within the library are the RC5 and RC6 symmetric block ciphers. They can be removed from a build by simply commenting out the two appropriate lines in \textit{tomcrypt\_custom.h}. The rest of the ciphers and hashes are patent free or under patents that have since expired. -The RC2 and RC4 symmetric ciphers are not under patents but are under trademark regulations. This means you can use -the ciphers you just can't advertise that you are doing so. +The RC2 and RC4 symmetric ciphers are not under patents but are under trademark regulations. This means you can use +the ciphers you just can't advertise that you are doing so. \mysection{Thanks} I would like to give thanks to the following people (in no particular order) for helping me develop this project from @@ -224,7 +224,7 @@ \chapter{The Application Programming Interface (API)} \index{CRYPT\_ERROR} \index{CRYPT\_OK} In general the API is very simple to memorize and use. Most of the functions return either {\bf void} or {\bf int}. Functions -that return {\bf int} will return {\bf CRYPT\_OK} if the function was successful, or one of the many error codes +that return {\bf int} will return {\bf CRYPT\_OK} if the function was successful, or one of the many error codes if it failed. Certain functions that return int will return $-1$ to indicate an error. These functions will be explicitly commented upon. When a function does return a CRYPT error code it can be translated into a string with @@ -239,7 +239,7 @@ \chapter{The Application Programming Interface (API)} void somefunc(void) { int err; - + /* call a cryptographic function */ if ((err = some_crypto_function(...)) != CRYPT_OK) { printf("A crypto error occurred, %s\n", error_to_string(err)); @@ -294,7 +294,7 @@ \chapter{The Application Programming Interface (API)} \end{figure} There are 32 and 64-bit cyclic rotations as well: -\index{ROL} \index{ROR} \index{ROL64} \index{ROR64} \index{ROLc} \index{RORc} \index{ROL64c} \index{ROR64c} +\index{ROL} \index{ROR} \index{ROL64} \index{ROR64} \index{ROLc} \index{RORc} \index{ROL64c} \index{ROR64c} \begin{figure}[hpbt] \begin{small} \begin{center} @@ -330,15 +330,15 @@ \chapter{The Application Programming Interface (API)} /* ... Make up the RSA key somehow ... */ - /* lets export the key, set x to the size of the + /* lets export the key, set x to the size of the * output buffer */ x = sizeof(buffer); if ((err = rsa_export(buffer, &x, PK_PUBLIC, &key)) != CRYPT_OK) { printf("Export error: %s\n", error_to_string(err)); return -1; } - - /* if rsa_export() was successful then x will have + + /* if rsa_export() was successful then x will have * the size of the output */ printf("RSA exported key takes %d bytes\n", x); @@ -349,7 +349,7 @@ \chapter{The Application Programming Interface (API)} \end{verbatim} \end{small} In the above example if the size of the RSA public key was more than 1024 bytes this function would return an error code -indicating a buffer overflow would have occurred. If the function succeeds, it stores the length of the output back into +indicating a buffer overflow would have occurred. If the function succeeds, it stores the length of the output back into \textit{x} so that the calling application will know how many bytes were used. As of v1.13, most functions will update your length on failure to indicate the size required by the function. Not all functions @@ -357,7 +357,7 @@ \chapter{The Application Programming Interface (API)} \mysection{Functions that need a PRNG} \index{Pseudo Random Number Generator} \index{PRNG} -Certain functions such as \textit{rsa\_make\_key()} require a Pseudo Random Number Generator (PRNG). These functions do not setup +Certain functions such as \textit{rsa\_make\_key()} require a Pseudo Random Number Generator (PRNG). These functions do not setup the PRNG themselves so it is the responsibility of the calling function to initialize the PRNG before calling them. Certain PRNG algorithms do not require a \textit{prng\_state} argument (sprng for example). The \textit{prng\_state} argument @@ -372,10 +372,10 @@ \chapter{The Application Programming Interface (API)} int err; /* register the system RNG */ - register_prng(&sprng_desc) + register_prng(&sprng_desc) /* make a 1024-bit RSA key with the system RNG */ - if ((err = rsa_make_key(NULL, find_prng("sprng"), 1024/8, 65537, &key)) + if ((err = rsa_make_key(NULL, find_prng("sprng"), 1024/8, 65537, &key)) != CRYPT_OK) { printf("make_key error: %s\n", error_to_string(err)); return -1; @@ -391,8 +391,8 @@ \chapter{The Application Programming Interface (API)} \mysection{Functions that use Arrays of Octets} Most functions require inputs that are arrays of the data type \textit{unsigned char}. Whether it is a symmetric key, IV for a chaining mode or public key packet it is assumed that regardless of the actual size of \textit{unsigned char} only the -lower eight bits contain data. For example, if you want to pass a 256 bit key to a symmetric ciphers setup routine, you -must pass in (a pointer to) an array of 32 \textit{unsigned char} variables. Certain routines (such as SAFER+) take +lower eight bits contain data. For example, if you want to pass a 256 bit key to a symmetric ciphers setup routine, you +must pass in (a pointer to) an array of 32 \textit{unsigned char} variables. Certain routines (such as SAFER+) take special care to work properly on platforms where an \textit{unsigned char} is not eight bits. For the purposes of this library, the term \textit{byte} will refer to an octet or eight bit word. Typically an array of @@ -400,20 +400,20 @@ \chapter{The Application Programming Interface (API)} \chapter{Symmetric Block Ciphers} \mysection{Core Functions} -LibTomCrypt provides several block ciphers with an ECB block mode interface. It is important to first note that you +LibTomCrypt provides several block ciphers with an ECB block mode interface. It is important to first note that you should never use the ECB modes directly to encrypt data. Instead you should use the ECB functions to make a chaining mode, or use one of the provided chaining modes. All of the ciphers are written as ECB interfaces since it allows the rest of the API to grow in a modular fashion. \subsection{Key Scheduling} -All ciphers store their scheduled keys in a single data type called \textit{symmetric\_key}. This allows all ciphers to +All ciphers store their scheduled keys in a single data type called \textit{symmetric\_key}. This allows all ciphers to have the same prototype and store their keys as naturally as possible. This also removes the need for dynamic memory -allocation, and allows you to allocate a fixed sized buffer for storing scheduled keys. All ciphers must provide six visible +allocation, and allows you to allocate a fixed sized buffer for storing scheduled keys. All ciphers must provide six visible functions which are (given that XXX is the name of the cipher) the following: \index{Cipher Setup} \begin{verbatim} -int XXX_setup(const unsigned char *key, - int keylen, +int XXX_setup(const unsigned char *key, + int keylen, int rounds, symmetric_key *skey); \end{verbatim} @@ -422,8 +422,8 @@ \subsection{Key Scheduling} The number of rounds can be set to zero to use the default, which is generally a good idea. If the function returns successfully the variable \textit{skey} will have a scheduled key stored in it. It's important to note -that you should only used this scheduled key with the intended cipher. For example, if you call \textit{blowfish\_setup()} do not -pass the scheduled key onto \textit{rc5\_ecb\_encrypt()}. All built--in setup functions do not allocate memory off the heap so +that you should only used this scheduled key with the intended cipher. For example, if you call \textit{blowfish\_setup()} do not +pass the scheduled key onto \textit{rc5\_ecb\_encrypt()}. All built--in setup functions do not allocate memory off the heap so when you are done with a key you can simply discard it (e.g. they can be on the stack). However, to maintain proper coding practices you should always call the respective XXX\_done() function. This allows for quicker porting to applications with externally supplied plugins. @@ -432,28 +432,28 @@ \subsection{ECB Encryption and Decryption} To encrypt or decrypt a block in ECB mode there are these two functions per cipher: \index{Cipher Encrypt} \index{Cipher Decrypt} \begin{verbatim} -int XXX_ecb_encrypt(const unsigned char *pt, +int XXX_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); -int XXX_ecb_decrypt(const unsigned char *ct, +int XXX_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); \end{verbatim} These two functions will encrypt or decrypt (respectively) a single block of text\footnote{The size of which depends on -which cipher you are using.}, storing the result in the \textit{ct} buffer (\textit{pt} resp.). It is possible that the input and output buffer are -the same buffer. For the encrypt function \textit{pt}\footnote{pt stands for plaintext.} is the input and +which cipher you are using.}, storing the result in the \textit{ct} buffer (\textit{pt} resp.). It is possible that the input and output buffer are +the same buffer. For the encrypt function \textit{pt}\footnote{pt stands for plaintext.} is the input and \textit{ct}\footnote{ct stands for ciphertext.} is the output. For the decryption function it's the opposite. They both -return \textbf{CRYPT\_OK} on success. To test a particular cipher against test vectors\footnote{As published in their design papers.} +return \textbf{CRYPT\_OK} on success. To test a particular cipher against test vectors\footnote{As published in their design papers.} call the following self-test function. - + \subsection{Self--Testing} \index{Cipher Testing} \begin{verbatim} int XXX_test(void); \end{verbatim} -This function will return {\bf CRYPT\_OK} if the cipher matches the test vectors from the design publication it is -based upon. +This function will return {\bf CRYPT\_OK} if the cipher matches the test vectors from the design publication it is +based upon. \subsection{Key Sizing} For each cipher there is a function which will help find a desired key size. It is specified as follows: @@ -500,7 +500,7 @@ \subsection{Simple Encryption Demonstration} \begin{verbatim} #include int main(void) -{ +{ unsigned char pt[8], ct[8], key[8]; symmetric_key skey; int err; @@ -520,17 +520,17 @@ \subsection{Simple Encryption Demonstration} /* encrypt the block */ blowfish_ecb_encrypt(pt, /* encrypt this 8-byte array */ - ct, /* store encrypted data here */ + ct, /* store encrypted data here */ &skey); /* our previously scheduled key */ - - /* now ct holds the encrypted version of pt */ + + /* now ct holds the encrypted version of pt */ /* decrypt the block */ blowfish_ecb_decrypt(ct, /* decrypt this 8-byte array */ pt, /* store decrypted data here */ &skey); /* our previously scheduled key */ - /* now we have decrypted ct to the original plaintext in pt */ + /* now we have decrypted ct to the original plaintext in pt */ /* Terminate the cipher context */ blowfish_done(&skey); @@ -552,7 +552,7 @@ \subsection{Simple Encryption Demonstration} The number of rounds of most ciphers is not an option you can change. Only RC5 allows you to change the number of rounds. By passing zero as the number of rounds all ciphers will use their default number of rounds. Generally the -ciphers are configured such that the default number of rounds provide adequate security for the given block and key +ciphers are configured such that the default number of rounds provide adequate security for the given block and key size. \mysection{The Cipher Descriptors} @@ -570,13 +570,13 @@ \subsection{Simple Encryption Demonstration} unsigned char ID; /** min keysize (octets) */ - int min_key_length, + int min_key_length, /** max keysize (octets) */ - max_key_length, + max_key_length, /** block size (octets) */ - block_length, + block_length, /** default number of rounds */ default_rounds; @@ -585,7 +585,7 @@ \subsection{Simple Encryption Demonstration} \end{verbatim} \end{small} -Where \textit{name} is the lower case ASCII version of the name. The fields \textit{min\_key\_length} and \textit{max\_key\_length} +Where \textit{name} is the lower case ASCII version of the name. The fields \textit{min\_key\_length} and \textit{max\_key\_length} are the minimum and maximum key sizes in bytes. The \textit{block\_length} member is the block size of the cipher in bytes. As a good rule of thumb it is assumed that the cipher supports the min and max key lengths but not always everything in between. The \textit{default\_rounds} field is the default number @@ -637,12 +637,12 @@ \subsection{Notes} \begin{small} \begin{enumerate} \item -For AES, (also known as Rijndael) there are four descriptors which complicate issues a little. The descriptors -rijndael\_desc and rijndael\_enc\_desc provide the cipher named \textit{rijndael}. The descriptors aes\_desc and +For AES, (also known as Rijndael) there are four descriptors which complicate issues a little. The descriptors +rijndael\_desc and rijndael\_enc\_desc provide the cipher named \textit{rijndael}. The descriptors aes\_desc and aes\_enc\_desc provide the cipher name \textit{aes}. Functionally both \textit{rijndael} and \textit{aes} are the same cipher. The -only difference is when you call find\_cipher() you have to pass the correct name. The cipher descriptors with \textit{enc} +only difference is when you call find\_cipher() you have to pass the correct name. The cipher descriptors with \textit{enc} in the middle (e.g. rijndael\_enc\_desc) are related to an implementation of Rijndael with only the encryption routine -and tables. The decryption and self--test function pointers of both \textit{encrypt only} descriptors are set to \textbf{NULL} and +and tables. The decryption and self--test function pointers of both \textit{encrypt only} descriptors are set to \textbf{NULL} and should not be called. The \textit{encrypt only} descriptors are useful for applications that only use the encryption function of the cipher. Algorithms such @@ -709,9 +709,9 @@ \subsection{Notes} return -1; } - /* generic call to function (assuming the key + /* generic call to function (assuming the key * in key[] was already setup) */ - if ((err = + if ((err = cipher_descriptor[find_cipher("blowfish")]. setup(key, 8, 0, &skey)) != CRYPT_OK) { printf("Error setting up Blowfish: %s\n", error_to_string(err)); @@ -736,14 +736,14 @@ \subsection{Notes} \begin{verbatim} int unregister_cipher(const struct _cipher_descriptor *cipher); \end{verbatim} -Which returns {\bf CRYPT\_OK} if it removes the cipher, otherwise it returns {\bf CRYPT\_ERROR}. +Which returns {\bf CRYPT\_OK} if it removes the cipher, otherwise it returns {\bf CRYPT\_ERROR}. \begin{small} \begin{verbatim} #include int main(void) { int err; - + /* register the cipher */ if (register_cipher(&rijndael_desc) == -1) { printf("Error registering Rijndael\n"); @@ -762,7 +762,7 @@ \subsection{Notes} } \end{verbatim} \end{small} -This snippet is a small program that registers Rijndael. +This snippet is a small program that registers Rijndael. \mysection{Symmetric Modes of Operations} \subsection{Background} @@ -830,8 +830,8 @@ \subsection{Choice of Mode} \item Allows random access to the plaintext. \item Allows the encryption of block sizes that are not equal to the size of the block cipher. \end{enumerate} -The CTR, CFB and OFB routines provided allow you to encrypt block sizes that differ from the ciphers block size. They -accomplish this by buffering the data required to complete a block. This allows you to encrypt or decrypt any size +The CTR, CFB and OFB routines provided allow you to encrypt block sizes that differ from the ciphers block size. They +accomplish this by buffering the data required to complete a block. This allows you to encrypt or decrypt any size block of memory with either of the three modes. The ECB and CBC modes process blocks of the same size as the cipher at a time. Therefore, they are less flexible than the @@ -841,52 +841,52 @@ \subsection{Ciphertext Stealing} \index{Ciphertext stealing} Ciphertext stealing is a method of dealing with messages in CBC mode which are not a multiple of the block length. This is accomplished by encrypting the last ciphertext block in ECB mode, and XOR'ing the output against the last partial block of plaintext. LibTomCrypt does not -support this mode directly but it is fairly easy to emulate with a call to the cipher's ecb\_encrypt() callback function. +support this mode directly but it is fairly easy to emulate with a call to the cipher's ecb\_encrypt() callback function. -The more sane way to deal with partial blocks is to pad them with zeroes, and then use CBC normally. +The more sane way to deal with partial blocks is to pad them with zeroes, and then use CBC normally. \subsection{Initialization} \index{CBC Mode} \index{CTR Mode} \index{OFB Mode} \index{CFB Mode} -The library provides simple support routines for handling CBC, CTR, CFB, OFB and ECB encoded messages. Assuming the mode +The library provides simple support routines for handling CBC, CTR, CFB, OFB and ECB encoded messages. Assuming the mode you want is XXX there is a structure called \textit{symmetric\_XXX} that will contain the information required to use that mode. They have identical setup routines (except CTR and ECB mode): \index{ecb\_start()} \index{cfb\_start()} \index{cbc\_start()} \index{ofb\_start()} \index{ctr\_start()} \begin{verbatim} -int XXX_start( int cipher, - const unsigned char *IV, - const unsigned char *key, - int keylen, - int num_rounds, +int XXX_start( int cipher, + const unsigned char *IV, + const unsigned char *key, + int keylen, + int num_rounds, symmetric_XXX *XXX); int ctr_start( int cipher, const unsigned char *IV, - const unsigned char *key, + const unsigned char *key, int keylen, - int num_rounds, + int num_rounds, int ctr_mode, symmetric_CTR *ctr); -int ecb_start( int cipher, - const unsigned char *key, - int keylen, - int num_rounds, +int ecb_start( int cipher, + const unsigned char *key, + int keylen, + int num_rounds, symmetric_ECB *ecb); \end{verbatim} -In each case, \textit{cipher} is the index into the cipher\_descriptor array of the cipher you want to use. The \textit{IV} value is -the initialization vector to be used with the cipher. You must fill the IV yourself and it is assumed they are the same -length as the block size\footnote{In other words the size of a block of plaintext for the cipher, e.g. 8 for DES, 16 for AES, etc.} -of the cipher you choose. It is important that the IV be random for each unique message you want to encrypt. The -parameters \textit{key}, \textit{keylen} and \textit{num\_rounds} are the same as in the XXX\_setup() function call. The final parameter +In each case, \textit{cipher} is the index into the cipher\_descriptor array of the cipher you want to use. The \textit{IV} value is +the initialization vector to be used with the cipher. You must fill the IV yourself and it is assumed they are the same +length as the block size\footnote{In other words the size of a block of plaintext for the cipher, e.g. 8 for DES, 16 for AES, etc.} +of the cipher you choose. It is important that the IV be random for each unique message you want to encrypt. The +parameters \textit{key}, \textit{keylen} and \textit{num\_rounds} are the same as in the XXX\_setup() function call. The final parameter is a pointer to the structure you want to hold the information for the mode of operation. -The routines return {\bf CRYPT\_OK} if the cipher initialized correctly, otherwise, they return an error code. +The routines return {\bf CRYPT\_OK} if the cipher initialized correctly, otherwise, they return an error code. \subsubsection{CTR Mode} In the case of CTR mode there is an additional parameter \textit{ctr\_mode} which specifies the mode that the counter is to be used in. -If \textbf{CTR\_COUNTER\_ LITTLE\_ENDIAN} was specified then the counter will be treated as a little endian value. Otherwise, if +If \textbf{CTR\_COUNTER\_ LITTLE\_ENDIAN} was specified then the counter will be treated as a little endian value. Otherwise, if \textbf{CTR\_COUNTER\_BIG\_ENDIAN} was specified the counter will be treated as a big endian value. As of v1.15 the RFC 3686 style of increment then encrypt is also supported. By OR'ing \textbf{LTC\_CTR\_RFC3686} with the CTR \textit{mode} value, ctr\_start() will increment the counter before encrypting it for the first time. @@ -904,7 +904,7 @@ \subsubsection{CTR Mode} /* use a 32-bit little endian counter */ if ((err = ctr_start(find_cipher("aes"), IV, key, 16, 0, - CTR_COUNTER_LITTLE_ENDIAN | 4, + CTR_COUNTER_LITTLE_ENDIAN | 4, &ctr)) != CRYPT_OK) { handle_error(err); } @@ -916,20 +916,20 @@ \subsubsection{CTR Mode} \subsection{Encryption and Decryption} To actually encrypt or decrypt the following routines are provided: -\index{ecb\_encrypt()} \index{ecb\_decrypt()} \index{cfb\_encrypt()} \index{cfb\_decrypt()} +\index{ecb\_encrypt()} \index{ecb\_decrypt()} \index{cfb\_encrypt()} \index{cfb\_decrypt()} \index{cbc\_encrypt()} \index{cbc\_decrypt()} \index{ofb\_encrypt()} \index{ofb\_decrypt()} \index{ctr\_encrypt()} \index{ctr\_decrypt()} \begin{verbatim} -int XXX_encrypt(const unsigned char *pt, - unsigned char *ct, - unsigned long len, +int XXX_encrypt(const unsigned char *pt, + unsigned char *ct, + unsigned long len, symmetric_YYY *YYY); -int XXX_decrypt(const unsigned char *ct, - unsigned char *pt, - unsigned long len, +int XXX_decrypt(const unsigned char *ct, + unsigned char *pt, + unsigned long len, symmetric_YYY *YYY); \end{verbatim} -Where \textit{XXX} is one of $\lbrace ecb, cbc, ctr, cfb, ofb \rbrace$. +Where \textit{XXX} is one of $\lbrace ecb, cbc, ctr, cfb, ofb \rbrace$. In all cases, \textit{len} is the size of the buffer (as number of octets) to encrypt or decrypt. The CTR, OFB and CFB modes are order sensitive but not chunk sensitive. That is you can encrypt \textit{ABCDEF} in three calls like \textit{AB}, \textit{CD}, \textit{EF} or two like \textit{ABCDE} and \textit{F} @@ -946,22 +946,22 @@ \subsection{IV Manipulation} \index{cbc\_setiv()} \index{cbc\_getiv()} \index{ofb\_setiv()} \index{ofb\_getiv()} \index{cfb\_setiv()} \index{cfb\_getiv()} \index{ctr\_setiv()} \index{ctr\_getiv()} \begin{verbatim} -int XXX_getiv(unsigned char *IV, - unsigned long *len, +int XXX_getiv(unsigned char *IV, + unsigned long *len, symmetric_XXX *XXX); -int XXX_setiv(const unsigned char *IV, - unsigned long len, +int XXX_setiv(const unsigned char *IV, + unsigned long len, symmetric_XXX *XXX); \end{verbatim} -The XXX\_getiv() functions will read the IV out of the chaining mode and store it into \textit{IV} along with the length of the IV +The XXX\_getiv() functions will read the IV out of the chaining mode and store it into \textit{IV} along with the length of the IV stored in \textit{len}. The XXX\_setiv will initialize the chaining mode state as if the original IV were the new IV specified. The length of the IV passed in must be the size of the ciphers block size. -The XXX\_setiv() functions are handy if you wish to change the IV without re--keying the cipher. +The XXX\_setiv() functions are handy if you wish to change the IV without re--keying the cipher. -What the \textit{setiv} function will do depends on the mode being changed. In CBC mode, the new IV replaces the existing IV as if it +What the \textit{setiv} function will do depends on the mode being changed. In CBC mode, the new IV replaces the existing IV as if it were the last ciphertext block. In CFB mode, the IV is encrypted as if it were the prior encrypted pad. In CTR mode, the IV is encrypted without first incrementing it (regardless of the LTC\_RFC\_3686 flag presence). In F8 mode, the IV is encrypted and becomes the new pad. It does not change the salted IV, and is only meant to allow seeking within a session. In LRW, it changes the tweak, forcing a computation of the tweak pad, allowing for @@ -1056,11 +1056,11 @@ \subsection{Examples} \end{small} \subsection{LRW Mode} -LRW mode is a cipher mode which is meant for indexed encryption like used to handle storage media. It is meant to have efficient seeking and overcome the +LRW mode is a cipher mode which is meant for indexed encryption like used to handle storage media. It is meant to have efficient seeking and overcome the security problems of ECB mode while not increasing the storage requirements. It is used much like any other chaining mode except with two key differences. -The key is specified as two strings the first key $K_1$ is the (normally AES) key and can be any length (typically 16, 24 or 32 octets long). The second key -$K_2$ is the \textit{tweak} key and is always 16 octets long. The tweak value is \textbf{NOT} a nonce or IV value it must be random and secret. +The key is specified as two strings the first key $K_1$ is the (normally AES) key and can be any length (typically 16, 24 or 32 octets long). The second key +$K_2$ is the \textit{tweak} key and is always 16 octets long. The tweak value is \textbf{NOT} a nonce or IV value it must be random and secret. To initialize LRW mode use: @@ -1068,14 +1068,14 @@ \subsection{LRW Mode} \begin{verbatim} int lrw_start( int cipher, const unsigned char *IV, - const unsigned char *key, + const unsigned char *key, int keylen, const unsigned char *tweak, - int num_rounds, + int num_rounds, symmetric_LRW *lrw); \end{verbatim} -This will initialize the LRW context with the given (16 octet) \textit{IV}, cipher $K_1$ \textit{key} of length \textit{keylen} octets and the (16 octet) $K_2$ \textit{tweak}. +This will initialize the LRW context with the given (16 octet) \textit{IV}, cipher $K_1$ \textit{key} of length \textit{keylen} octets and the (16 octet) $K_2$ \textit{tweak}. While LRW was specified to be used only with AES, LibTomCrypt will allow any 128--bit block cipher to be specified as indexed by \textit{cipher}. The number of rounds for the block cipher \textit{num\_rounds} can be 0 to use the default number of rounds for the given cipher. @@ -1083,30 +1083,30 @@ \subsection{LRW Mode} \index{lrw\_encrypt()} \index{lrw\_decrypt()} \begin{verbatim} -int lrw_encrypt(const unsigned char *pt, - unsigned char *ct, - unsigned long len, +int lrw_encrypt(const unsigned char *pt, + unsigned char *ct, + unsigned long len, symmetric_LRW *lrw); -int lrw_decrypt(const unsigned char *ct, - unsigned char *pt, - unsigned long len, +int lrw_decrypt(const unsigned char *ct, + unsigned char *pt, + unsigned long len, symmetric_LRW *lrw); \end{verbatim} These will encrypt (or decrypt) the plaintext to the ciphertext buffer (or vice versa). The length is specified by \textit{len} in octets but must be a multiple -of 16. The LRW code uses a fast tweak update such that consecutive blocks are encrypted faster than if random seeking where used. +of 16. The LRW code uses a fast tweak update such that consecutive blocks are encrypted faster than if random seeking where used. To manipulate the IV use the following functions: -\index{lrw\_getiv()} \index{lrw\_setiv()} +\index{lrw\_getiv()} \index{lrw\_setiv()} \begin{verbatim} -int lrw_getiv(unsigned char *IV, - unsigned long *len, +int lrw_getiv(unsigned char *IV, + unsigned long *len, symmetric_LRW *lrw); -int lrw_setiv(const unsigned char *IV, - unsigned long len, +int lrw_setiv(const unsigned char *IV, + unsigned long len, symmetric_LRW *lrw); \end{verbatim} These will get or set the 16--octet IV. Note that setting the IV is the same as \textit{seeking} and unlike other modes is not a free operation. It requires @@ -1120,23 +1120,23 @@ \subsection{LRW Mode} \end{verbatim} \subsection{XTS Mode} -As of v1.17, LibTomCrypt supports XTS mode with code donated by Elliptic Semiconductor Inc.\footnote{www.ellipticsemi.com}. -XTS is a chaining mode for 128--bit block ciphers, recommended by IEEE (P1619) -for disk encryption. It is meant to be an encryption mode with random access to the message data without compromising privacy. It requires two private keys (of equal -length) to perform the encryption process. Each encryption invocation includes a sector number or unique identifier specified as a 128--bit string. +As of v1.17, LibTomCrypt supports XTS mode with code donated by Elliptic Semiconductor Inc.\footnote{www.ellipticsemi.com}. +XTS is a chaining mode for 128--bit block ciphers, recommended by IEEE (P1619) +for disk encryption. It is meant to be an encryption mode with random access to the message data without compromising privacy. It requires two private keys (of equal +length) to perform the encryption process. Each encryption invocation includes a sector number or unique identifier specified as a 128--bit string. To initialize XTS mode use the following function call: \index{xts\_start()} \begin{verbatim} int xts_start( int cipher, - const unsigned char *key1, - const unsigned char *key2, + const unsigned char *key1, + const unsigned char *key2, unsigned long keylen, - int num_rounds, + int num_rounds, symmetric_xts *xts) \end{verbatim} -This will start the XTS mode with the two keys pointed to by \textit{key1} and \textit{key2} of length \textit{keylen} octets each. +This will start the XTS mode with the two keys pointed to by \textit{key1} and \textit{key2} of length \textit{keylen} octets each. To encrypt or decrypt a sector use the following calls: @@ -1154,11 +1154,11 @@ \subsection{XTS Mode} const unsigned char *tweak, symmetric_xts *xts); \end{verbatim} -The first will encrypt the plaintext pointed to by \textit{pt} of length \textit{ptlen} octets, and store the ciphertext in the array pointed to by -\textit{ct}. It uses the 128--bit tweak pointed to by \textit{tweak} to encrypt the block. The decrypt function performs the opposite operation. Both -functions support ciphertext stealing (blocks that are not multiples of 16 bytes). +The first will encrypt the plaintext pointed to by \textit{pt} of length \textit{ptlen} octets, and store the ciphertext in the array pointed to by +\textit{ct}. It uses the 128--bit tweak pointed to by \textit{tweak} to encrypt the block. The decrypt function performs the opposite operation. Both +functions support ciphertext stealing (blocks that are not multiples of 16 bytes). -The P1619 specification states the tweak for sector number shall be represented as a 128--bit little endian string. +The P1619 specification states the tweak for sector number shall be represented as a 128--bit little endian string. To terminate the XTS state call the following function: @@ -1176,44 +1176,44 @@ \subsection{F8 Mode} \index{f8\_start()} \begin{verbatim} -int f8_start( int cipher, - const unsigned char *IV, - const unsigned char *key, - int keylen, - const unsigned char *salt_key, +int f8_start( int cipher, + const unsigned char *IV, + const unsigned char *key, + int keylen, + const unsigned char *salt_key, int skeylen, - int num_rounds, + int num_rounds, symmetric_F8 *f8); \end{verbatim} -This will start the F8 mode state using \textit{key} as the secret key, \textit{IV} as the counter. It uses the \textit{salt\_key} as IV encryption key -(\textit{m} in the RFC 3711). The salt\_key can be shorter than the secret key but it should not be longer. +This will start the F8 mode state using \textit{key} as the secret key, \textit{IV} as the counter. It uses the \textit{salt\_key} as IV encryption key +(\textit{m} in the RFC 3711). The salt\_key can be shorter than the secret key but it should not be longer. To encrypt or decrypt data we use the following two functions: \index{f8\_encrypt()} \index{f8\_decrypt()} \begin{verbatim} -int f8_encrypt(const unsigned char *pt, - unsigned char *ct, - unsigned long len, +int f8_encrypt(const unsigned char *pt, + unsigned char *ct, + unsigned long len, symmetric_F8 *f8); -int f8_decrypt(const unsigned char *ct, - unsigned char *pt, - unsigned long len, +int f8_decrypt(const unsigned char *ct, + unsigned char *pt, + unsigned long len, symmetric_F8 *f8); \end{verbatim} -These will encrypt or decrypt a variable length array of bytes using the F8 mode state specified. The length is specified in bytes and does not have to be a multiple +These will encrypt or decrypt a variable length array of bytes using the F8 mode state specified. The length is specified in bytes and does not have to be a multiple of the ciphers block size. To change or retrieve the current counter IV value use the following functions: \index{f8\_getiv()} \index{f8\_setiv()} \begin{verbatim} -int f8_getiv(unsigned char *IV, - unsigned long *len, +int f8_getiv(unsigned char *IV, + unsigned long *len, symmetric_F8 *f8); -int f8_setiv(const unsigned char *IV, - unsigned long len, +int f8_setiv(const unsigned char *IV, + unsigned long len, symmetric_F8 *f8); \end{verbatim} These work with the current IV value only and not the encrypted IV value specified during the call to f8\_start(). The purpose of these two functions is to be @@ -1231,11 +1231,11 @@ \subsection{F8 Mode} \mysection{Encrypt and Authenticate Modes} \subsection{EAX Mode} -LibTomCrypt provides support for a mode called EAX\footnote{See -M. Bellare, P. Rogaway, D. Wagner, A Conventional Authenticated-Encryption Mode.} in a manner similar to the way it was intended to be used -by the designers. First, a short description of what EAX mode is before we explain how to use it. EAX is a mode that requires a cipher, -CTR and OMAC support and provides encryption and -authentication\footnote{Note that since EAX only requires OMAC and CTR you may use \textit{encrypt only} cipher descriptors with this mode.}. +LibTomCrypt provides support for a mode called EAX\footnote{See +M. Bellare, P. Rogaway, D. Wagner, A Conventional Authenticated-Encryption Mode.} in a manner similar to the way it was intended to be used +by the designers. First, a short description of what EAX mode is before we explain how to use it. EAX is a mode that requires a cipher, +CTR and OMAC support and provides encryption and +authentication\footnote{Note that since EAX only requires OMAC and CTR you may use \textit{encrypt only} cipher descriptors with this mode.}. It is initialized with a random \textit{nonce} that can be shared publicly, a \textit{header} which can be fixed and public, and a random secret symmetric key. The \textit{header} data is meant to be meta--data associated with a stream that isn't private (e.g., protocol messages). It can @@ -1249,44 +1249,44 @@ \subsection{EAX Mode} The mode is initialized with the following function. \index{eax\_init()} \begin{verbatim} -int eax_init( eax_state *eax, - int cipher, - const unsigned char *key, +int eax_init( eax_state *eax, + int cipher, + const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, + const unsigned char *nonce, unsigned long noncelen, - const unsigned char *header, + const unsigned char *header, unsigned long headerlen); \end{verbatim} -Where \textit{eax} is the EAX state. The \textit{cipher} parameter is the index of the desired cipher in the descriptor table. -The \textit{key} parameter is the shared secret symmetric key of length \textit{keylen} octets. The \textit{nonce} parameter is the -random public string of length \textit{noncelen} octets. The \textit{header} parameter is the random (or fixed or \textbf{NULL}) header for the +Where \textit{eax} is the EAX state. The \textit{cipher} parameter is the index of the desired cipher in the descriptor table. +The \textit{key} parameter is the shared secret symmetric key of length \textit{keylen} octets. The \textit{nonce} parameter is the +random public string of length \textit{noncelen} octets. The \textit{header} parameter is the random (or fixed or \textbf{NULL}) header for the message of length \textit{headerlen} octets. -When this function completes, the \textit{eax} state will be initialized such that you can now either have data decrypted or +When this function completes, the \textit{eax} state will be initialized such that you can now either have data decrypted or encrypted in EAX mode. Note: if \textit{headerlen} is zero you may pass \textit{header} as \textbf{NULL} to indicate there is no initial header data. To encrypt or decrypt data in a streaming mode use the following. \index{eax\_encrypt()} \index{eax\_decrypt()} \begin{verbatim} -int eax_encrypt( eax_state *eax, - const unsigned char *pt, - unsigned char *ct, +int eax_encrypt( eax_state *eax, + const unsigned char *pt, + unsigned char *ct, unsigned long length); -int eax_decrypt( eax_state *eax, - const unsigned char *ct, - unsigned char *pt, +int eax_decrypt( eax_state *eax, + const unsigned char *ct, + unsigned char *pt, unsigned long length); \end{verbatim} The function \textit{eax\_encrypt} will encrypt the bytes in \textit{pt} of \textit{length} octets, and store the ciphertext in \textit{ct}. Note: \textit{ct} and \textit{pt} may be the same region in memory. This function will also send the ciphertext -through the OMAC function. The function \textit{eax\_decrypt} decrypts \textit{ct}, and stores it in \textit{pt}. This also allows -\textit{pt} and \textit{ct} to be the same region in memory. +through the OMAC function. The function \textit{eax\_decrypt} decrypts \textit{ct}, and stores it in \textit{pt}. This also allows +\textit{pt} and \textit{ct} to be the same region in memory. -You cannot both encrypt or decrypt with the same \textit{eax} context. For bi--directional communication you will need to initialize -two EAX contexts (preferably with different headers and nonces). +You cannot both encrypt or decrypt with the same \textit{eax} context. For bi--directional communication you will need to initialize +two EAX contexts (preferably with different headers and nonces). Note: both of these functions allow you to send the data in any granularity but the order is important. While the eax\_init() function allows you to add initial header data to the stream you can also add header data during the @@ -1294,17 +1294,17 @@ \subsection{EAX Mode} \index{eax\_addheader()} \begin{verbatim} -int eax_addheader( eax_state *eax, - const unsigned char *header, +int eax_addheader( eax_state *eax, + const unsigned char *header, unsigned long length); \end{verbatim} -This will add the \textit{length} octet from \textit{header} to the given \textit{eax} header. Once the message is finished, the +This will add the \textit{length} octet from \textit{header} to the given \textit{eax} header. Once the message is finished, the \textit{tag} (checksum) may be computed with the following function: \index{eax\_done()} \begin{verbatim} -int eax_done( eax_state *eax, - unsigned char *tag, +int eax_done( eax_state *eax, + unsigned char *tag, unsigned long *taglen); \end{verbatim} This will terminate the EAX state \textit{eax}, and store up to \textit{taglen} bytes of the message tag in \textit{tag}. The function @@ -1365,12 +1365,12 @@ \subsection{EAX Mode} return EXIT_FAILURE; } - /* now we have the authentication tag in "tag" and + /* now we have the authentication tag in "tag" and * it's taglen bytes long */ } \end{verbatim} - -You can also perform an entire EAX state on a block of memory in a single function call with the + +You can also perform an entire EAX state on a block of memory in a single function call with the following functions. @@ -1397,23 +1397,23 @@ \subsection{EAX Mode} \end{verbatim} Both essentially just call eax\_init() followed by eax\_encrypt() (or eax\_decrypt() respectively) and eax\_done(). The parameters -have the same meaning as with those respective functions. +have the same meaning as with those respective functions. The only difference is eax\_decrypt\_verify\_memory() does not emit a tag. Instead you pass it a tag as input and it compares it against the tag it computed while decrypting the message. If the tags match then it stores a $1$ in \textit{res}, otherwise it stores a $0$. \subsection{OCB Mode} -LibTomCrypt provides support for a mode called OCB\footnote{See +LibTomCrypt provides support for a mode called OCB\footnote{See P. Rogaway, M. Bellare, J. Black, T. Krovetz, \textit{OCB: A Block Cipher Mode of Operation for Efficient Authenticated Encryption}.} . OCB is an encryption protocol that simultaneously provides authentication. It is slightly faster to use than EAX mode but is less flexible. Let's review how to initialize an OCB context. \index{ocb\_init()} \begin{verbatim} -int ocb_init( ocb_state *ocb, - int cipher, - const unsigned char *key, - unsigned long keylen, +int ocb_init( ocb_state *ocb, + int cipher, + const unsigned char *key, + unsigned long keylen, const unsigned char *nonce); \end{verbatim} @@ -1426,17 +1426,17 @@ \subsection{OCB Mode} \index{ocb\_encrypt()} \index{ocb\_decrypt()} \begin{verbatim} -int ocb_encrypt( ocb_state *ocb, - const unsigned char *pt, +int ocb_encrypt( ocb_state *ocb, + const unsigned char *pt, unsigned char *ct); -int ocb_decrypt( ocb_state *ocb, - const unsigned char *ct, +int ocb_decrypt( ocb_state *ocb, + const unsigned char *ct, unsigned char *pt); \end{verbatim} -This will encrypt (or decrypt for the latter) a fixed length of data from \textit{pt} to \textit{ct} (vice versa for the latter). -They assume that \textit{pt} and \textit{ct} are the same size as the block cipher's block size. Note that you cannot call +This will encrypt (or decrypt for the latter) a fixed length of data from \textit{pt} to \textit{ct} (vice versa for the latter). +They assume that \textit{pt} and \textit{ct} are the same size as the block cipher's block size. Note that you cannot call both functions given a single \textit{ocb} state. For bi-directional communication you will have to initialize two \textit{ocb} states (with different nonces). Also \textit{pt} and \textit{ct} may point to the same location in memory. @@ -1446,34 +1446,34 @@ \subsubsection{State Termination} \index{ocb\_done\_encrypt()} \begin{verbatim} -int ocb_done_encrypt( ocb_state *ocb, - const unsigned char *pt, +int ocb_done_encrypt( ocb_state *ocb, + const unsigned char *pt, unsigned long ptlen, - unsigned char *ct, - unsigned char *tag, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen); \end{verbatim} -This will terminate an encrypt stream \textit{ocb}. If you have trailing bytes of plaintext that will not complete a block +This will terminate an encrypt stream \textit{ocb}. If you have trailing bytes of plaintext that will not complete a block you can pass them here. This will also encrypt the \textit{ptlen} bytes in \textit{pt} and store them in \textit{ct}. It will also store up to \textit{taglen} bytes of the tag into \textit{tag}. -Note that \textit{ptlen} must be less than or equal to the block size of block cipher chosen. Also note that if you have -an input message equal to the length of the block size then you pass the data here (not to ocb\_encrypt()) only. +Note that \textit{ptlen} must be less than or equal to the block size of block cipher chosen. Also note that if you have +an input message equal to the length of the block size then you pass the data here (not to ocb\_encrypt()) only. To terminate a decrypt stream and compared the tag you call the following. \index{ocb\_done\_decrypt()} \begin{verbatim} -int ocb_done_decrypt( ocb_state *ocb, - const unsigned char *ct, +int ocb_done_decrypt( ocb_state *ocb, + const unsigned char *ct, unsigned long ctlen, - unsigned char *pt, - const unsigned char *tag, - unsigned long taglen, + unsigned char *pt, + const unsigned char *tag, + unsigned long taglen, int *res); \end{verbatim} -Similarly to the previous function you can pass trailing message bytes into this function. This will compute the +Similarly to the previous function you can pass trailing message bytes into this function. This will compute the tag of the message (internally) and then compare it against the \textit{taglen} bytes of \textit{tag} provided. By default \textit{res} is set to zero. If all \textit{taglen} bytes of \textit{tag} can be verified then \textit{res} is set to one (authenticated message). @@ -1486,33 +1486,33 @@ \subsubsection{Packet Functions} int ocb_encrypt_authenticate_memory( int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, + const unsigned char *nonce, const unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tag, unsigned long *taglen); \end{verbatim} This will OCB encrypt the message \textit{pt} of length \textit{ptlen}, and store the ciphertext in \textit{ct}. The length \textit{ptlen} -can be any arbitrary length. +can be any arbitrary length. \index{ocb\_decrypt\_verify\_memory()} \begin{verbatim} int ocb_decrypt_verify_memory( int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, + const unsigned char *nonce, const unsigned char *ct, unsigned long ctlen, unsigned char *pt, const unsigned char *tag, unsigned long taglen, int *res); \end{verbatim} -Similarly, this will OCB decrypt, and compare the internally computed tag against the tag provided. \textit{res} is set +Similarly, this will OCB decrypt, and compare the internally computed tag against the tag provided. \textit{res} is set appropriately. \subsection{CCM Mode} CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. Unlike EAX and OCB mode, -it is only meant for \textit{packet} mode where the length of the input is known in advance. Since it is a packet mode function, CCM only has one +it is only meant for \textit{packet} mode where the length of the input is known in advance. Since it is a packet mode function, CCM only has one function that performs the protocol. \index{ccm\_memory()} @@ -1529,22 +1529,22 @@ \subsection{CCM Mode} int direction); \end{verbatim} -This performs the \textit{CCM} operation on the data. The \textit{cipher} variable indicates which cipher in the descriptor table to use. It must have a -16--byte block size for CCM. +This performs the \textit{CCM} operation on the data. The \textit{cipher} variable indicates which cipher in the descriptor table to use. It must have a +16--byte block size for CCM. The key can be specified in one of two fashions. First, it can be passed as an array of octets in \textit{key} of length \textit{keylen}. Alternatively, it can be passed in as a previously scheduled key in \textit{uskey}. The latter fashion saves time when the same key is used for multiple packets. If -\textit{uskey} is not \textbf{NULL}, then \textit{key} may be \textbf{NULL} (and vice-versa). +\textit{uskey} is not \textbf{NULL}, then \textit{key} may be \textbf{NULL} (and vice-versa). -The nonce or salt is \textit{nonce} of length \textit{noncelen} octets. The header is meta--data you want to send with the message but not have -encrypted, it is stored in \textit{header} of length \textit{headerlen} octets. The header can be zero octets long (if $headerlen = 0$ then -you can pass \textit{header} as \textbf{NULL}). +The nonce or salt is \textit{nonce} of length \textit{noncelen} octets. The header is meta--data you want to send with the message but not have +encrypted, it is stored in \textit{header} of length \textit{headerlen} octets. The header can be zero octets long (if $headerlen = 0$ then +you can pass \textit{header} as \textbf{NULL}). The plaintext is stored in \textit{pt}, and the ciphertext in \textit{ct}. The length of both are expected to be equal and is passed in as \textit{ptlen}. It is -allowable that $pt = ct$. The \textit{direction} variable indicates whether encryption (direction $=$ \textbf{CCM\_ENCRYPT}) or +allowable that $pt = ct$. The \textit{direction} variable indicates whether encryption (direction $=$ \textbf{CCM\_ENCRYPT}) or decryption (direction $=$ \textbf{CCM\_DECRYPT}) is to be performed. -As implemented, this version of CCM cannot handle header or plaintext data longer than $2^{32} - 1$ octets long. +As implemented, this version of CCM cannot handle header or plaintext data longer than $2^{32} - 1$ octets long. You can test the implementation of CCM with the following function. @@ -1564,7 +1564,7 @@ \subsubsection{CCM Example} #include int main(void) { - unsigned char key[16], nonce[12], pt[32], ct[32], + unsigned char key[16], nonce[12], pt[32], ct[32], tag[16], tagcp[16]; unsigned long taglen; int err; @@ -1573,10 +1573,10 @@ \subsubsection{CCM Example} register_cipher(&aes_desc); /* somehow fill key, nonce, pt */ - + /* encrypt it */ taglen = sizeof(tag); - if ((err = + if ((err = ccm_memory(find_cipher("aes"), key, 16, /* 128-bit key */ NULL, /* not prescheduled */ @@ -1593,7 +1593,7 @@ \subsubsection{CCM Example} /* decrypt it */ taglen = sizeof(tagcp); - if ((err = + if ((err = ccm_memory(find_cipher("aes"), key, 16, /* 128-bit key */ NULL, /* not prescheduled */ @@ -1614,37 +1614,37 @@ \subsubsection{CCM Example} \end{small} \subsection{GCM Mode} -Galois counter mode is an IEEE proposal for authenticated encryption (also it is a planned NIST standard). Like EAX and OCB mode, it can be used in a streaming capacity -however, unlike EAX it cannot accept \textit{additional authentication data} (meta--data) after plaintext has been processed. This mode also only works with +Galois counter mode is an IEEE proposal for authenticated encryption (also it is a planned NIST standard). Like EAX and OCB mode, it can be used in a streaming capacity +however, unlike EAX it cannot accept \textit{additional authentication data} (meta--data) after plaintext has been processed. This mode also only works with block ciphers with a 16--byte block. -A GCM stream is meant to be processed in three modes, one after another. First, the initial vector (per session) data is processed. This should be -unique to every session. Next, the the optional additional authentication data is processed, and finally the plaintext (or ciphertext depending on the direction). +A GCM stream is meant to be processed in three modes, one after another. First, the initial vector (per session) data is processed. This should be +unique to every session. Next, the the optional additional authentication data is processed, and finally the plaintext (or ciphertext depending on the direction). \subsubsection{Initialization} To initialize the GCM context with a secret key call the following function. \index{gcm\_init()} \begin{verbatim} -int gcm_init( gcm_state *gcm, +int gcm_init( gcm_state *gcm, int cipher, - const unsigned char *key, + const unsigned char *key, int keylen); \end{verbatim} -This initializes the GCM state \textit{gcm} for the given cipher indexed by \textit{cipher}, with a secret key \textit{key} of length \textit{keylen} octets. The cipher -chosen must have a 16--byte block size (e.g., AES). +This initializes the GCM state \textit{gcm} for the given cipher indexed by \textit{cipher}, with a secret key \textit{key} of length \textit{keylen} octets. The cipher +chosen must have a 16--byte block size (e.g., AES). \subsubsection{Initial Vector} After the state has been initialized (or reset) the next step is to add the session (or packet) initial vector. It should be unique per packet encrypted. \index{gcm\_add\_iv()} \begin{verbatim} -int gcm_add_iv( gcm_state *gcm, - const unsigned char *IV, +int gcm_add_iv( gcm_state *gcm, + const unsigned char *IV, unsigned long IVlen); \end{verbatim} This adds the initial vector octets from \textit{IV} of length \textit{IVlen} to the GCM state \textit{gcm}. You can call this function as many times as required -to process the entire IV. +to process the entire IV. Note: the GCM protocols provides a \textit{shortcut} for 12--byte IVs where no pre-processing is to be done. If you want to minimize per packet latency it is ideal to only use 12--byte IVs. You can just increment it like a counter for each packet. @@ -1656,25 +1656,25 @@ \subsubsection{Additional Authentication Data} \index{gcm\_add\_aad()} \begin{verbatim} -int gcm_add_aad( gcm_state *gcm, - const unsigned char *adata, +int gcm_add_aad( gcm_state *gcm, + const unsigned char *adata, unsigned long adatalen); \end{verbatim} This adds the additional authentication data \textit{adata} of length \textit{adatalen} to the GCM state \textit{gcm}. \subsubsection{Plaintext Processing} -After the AAD has been processed, the plaintext (or ciphertext depending on the direction) can be processed. +After the AAD has been processed, the plaintext (or ciphertext depending on the direction) can be processed. \index{gcm\_process()} \begin{verbatim} int gcm_process( gcm_state *gcm, - unsigned char *pt, + unsigned char *pt, unsigned long ptlen, unsigned char *ct, int direction); \end{verbatim} -This processes message data where \textit{pt} is the plaintext and \textit{ct} is the ciphertext. The length of both are equal and stored in \textit{ptlen}. Depending on -the mode \textit{pt} is the input and \textit{ct} is the output (or vice versa). When \textit{direction} equals \textbf{GCM\_ENCRYPT} the plaintext is read, +This processes message data where \textit{pt} is the plaintext and \textit{ct} is the ciphertext. The length of both are equal and stored in \textit{ptlen}. Depending on +the mode \textit{pt} is the input and \textit{ct} is the output (or vice versa). When \textit{direction} equals \textbf{GCM\_ENCRYPT} the plaintext is read, encrypted and stored in the ciphertext buffer. When \textit{direction} equals \textbf{GCM\_DECRYPT} the opposite occurs. \subsubsection{State Termination} @@ -1682,8 +1682,8 @@ \subsubsection{State Termination} \index{gcm\_done()} \begin{verbatim} -int gcm_done( gcm_state *gcm, - unsigned char *tag, +int gcm_done( gcm_state *gcm, + unsigned char *tag, unsigned long *taglen); \end{verbatim} This terminates the GCM state \textit{gcm} and stores the tag in \textit{tag} of length \textit{taglen} octets. @@ -1704,14 +1704,14 @@ \subsubsection{One--Shot Packet} \index{gcm\_memory()} \begin{verbatim} -int gcm_memory( +int gcm_memory( int cipher, - const unsigned char *key, + const unsigned char *key, unsigned long keylen, const unsigned char *IV, unsigned long IVlen, const unsigned char *adata, unsigned long adatalen, unsigned char *pt, unsigned long ptlen, - unsigned char *ct, + unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction); \end{verbatim} @@ -1741,7 +1741,7 @@ \subsubsection{Example Usage} if ((err = gcm_reset(gcm)) != CRYPT_OK) { return err; } - + /* Add the IV */ if ((err = gcm_add_iv(gcm, iv, ivlen)) != CRYPT_OK) { return err; @@ -1753,7 +1753,7 @@ \subsubsection{Example Usage} } /* process the plaintext */ - if ((err = + if ((err = gcm_process(gcm, pt, ptlen, pt, GCM_ENCRYPT)) != CRYPT_OK) { return err; } @@ -1766,7 +1766,7 @@ \subsubsection{Example Usage} /* ... send a header describing the lengths ... */ - /* depending on the protocol and how IV is + /* depending on the protocol and how IV is * generated you may have to send it too... */ send(socket, iv, ivlen, 0); @@ -1787,15 +1787,15 @@ \subsubsection{Example Usage} gcm_state gcm; unsigned char key[16], IV[12], pt[PACKET_SIZE]; int err, x; - unsigned long ptlen; - + unsigned long ptlen; + /* somehow fill key/IV with random values */ - + /* register AES */ register_cipher(&aes_desc); /* init the GCM state */ - if ((err = + if ((err = gcm_init(&gcm, find_cipher("aes"), key, 16)) != CRYPT_OK) { whine_and_pout(err); } @@ -1811,7 +1811,7 @@ \subsubsection{Example Usage} } } - if ((err = send_packet(pt, ptlen, iv, 12, NULL, 0, &gcm)) + if ((err = send_packet(pt, ptlen, iv, 12, NULL, 0, &gcm)) != CRYPT_OK) { whine_and_pout(err); } @@ -1823,7 +1823,7 @@ \subsubsection{Example Usage} \chapter{One-Way Cryptographic Hash Functions} \mysection{Core Functions} -Like the ciphers, there are hash core functions and a universal data type to hold the hash state called \textit{hash\_state}. To initialize hash +Like the ciphers, there are hash core functions and a universal data type to hold the hash state called \textit{hash\_state}. To initialize hash XXX (where XXX is the name) call: \index{Hash Functions} \begin{verbatim} @@ -1832,12 +1832,12 @@ \chapter{One-Way Cryptographic Hash Functions} This simply sets up the hash to the default state governed by the specifications of the hash. To add data to the message being hashed call: \begin{verbatim} -int XXX_process( hash_state *md, - const unsigned char *in, +int XXX_process( hash_state *md, + const unsigned char *in, unsigned long inlen); \end{verbatim} -Essentially all hash messages are virtually infinitely\footnote{Most hashes are limited to $2^{64}$ bits or 2,305,843,009,213,693,952 bytes.} long message which -are buffered. The data can be passed in any sized chunks as long as the order of the bytes are the same the message digest (hash output) will be the same. For example, +Essentially all hash messages are virtually infinitely\footnote{Most hashes are limited to $2^{64}$ bits or 2,305,843,009,213,693,952 bytes.} long message which +are buffered. The data can be passed in any sized chunks as long as the order of the bytes are the same the message digest (hash output) will be the same. For example, this means that: \begin{verbatim} md5_process(&md, "hello ", 6); @@ -1851,7 +1851,7 @@ \chapter{One-Way Cryptographic Hash Functions} To finally get the message digest (the hash) call: \begin{verbatim} -int XXX_done( hash_state *md, +int XXX_done( hash_state *md, unsigned char *out); \end{verbatim} @@ -1900,8 +1900,8 @@ \chapter{One-Way Cryptographic Hash Functions} void (*init) (hash_state *hash); - int (*process)( hash_state *hash, - const unsigned char *in, + int (*process)( hash_state *hash, + const unsigned char *in, unsigned long inlen); int (*done) (hash_state *hash, unsigned char *out); @@ -1913,9 +1913,9 @@ \chapter{One-Way Cryptographic Hash Functions} \index{find\_hash()} The \textit{name} member is the name of the hash function (all lowercase). The \textit{hashsize} member is the size of the digest output in bytes, while \textit{blocksize} is the size of blocks the hash expects to the compression function. Technically, this detail is not important -for high level developers but is useful to know for performance reasons. +for high level developers but is useful to know for performance reasons. -The \textit{init} member initializes the hash, \textit{process} passes data through the hash, \textit{done} terminates the hash and retrieves the +The \textit{init} member initializes the hash, \textit{process} passes data through the hash, \textit{done} terminates the hash and retrieves the digest. The \textit{test} member tests the hash against the specified test vectors. There is a function to search the array as well called \textit{int find\_hash(char *name)}. It returns -1 if the hash is not found, otherwise, the @@ -1978,42 +1978,42 @@ \chapter{One-Way Cryptographic Hash Functions} There are three helper functions to make working with hashes easier. The first is a function to hash a buffer, and produce the digest in a single function call. -\index{hash\_memory()} +\index{hash\_memory()} \begin{verbatim} -int hash_memory( int hash, - const unsigned char *in, - unsigned long inlen, - unsigned char *out, +int hash_memory( int hash, + const unsigned char *in, + unsigned long inlen, + unsigned char *out, unsigned long *outlen); \end{verbatim} This will hash the data pointed to by \textit{in} of length \textit{inlen}. The hash used is indexed by the \textit{hash} parameter. The message -digest is stored in \textit{out}, and the \textit{outlen} parameter is updated to hold the message digest size. +digest is stored in \textit{out}, and the \textit{outlen} parameter is updated to hold the message digest size. -The next helper function allows for the hashing of a file based on a file name. +The next helper function allows for the hashing of a file based on a file name. \index{hash\_file()} \begin{verbatim} -int hash_file( int hash, - const char *fname, - unsigned char *out, +int hash_file( int hash, + const char *fname, + unsigned char *out, unsigned long *outlen); \end{verbatim} -This will hash the file named by \textit{fname} using the hash indexed by \textit{hash}. The file named in this function call must be readable by the +This will hash the file named by \textit{fname} using the hash indexed by \textit{hash}. The file named in this function call must be readable by the user owning the process performing the request. This function can be omitted by the \textbf{LTC\_NO\_FILE} define, which forces it to return \textbf{CRYPT\_NOP} -when it is called. The message digest is stored in \textit{out}, and the \textit{outlen} parameter is updated to hold the message digest size. +when it is called. The message digest is stored in \textit{out}, and the \textit{outlen} parameter is updated to hold the message digest size. \index{hash\_filehandle()} \begin{verbatim} -int hash_filehandle( int hash, - FILE *in, - unsigned char *out, +int hash_filehandle( int hash, + FILE *in, + unsigned char *out, unsigned long *outlen); \end{verbatim} This will hash the file identified by the handle \textit{in} using the hash indexed by \textit{hash}. This will begin hashing from the current file pointer position, and will not rewind the file pointer when finished. This function can be omitted by the \textbf{LTC\_NO\_FILE} define, which forces it to return \textbf{CRYPT\_NOP} -when it is called. The message digest is stored in \textit{out}, and the \textit{outlen} parameter is updated to hold the message digest size. +when it is called. The message digest is stored in \textit{out}, and the \textit{outlen} parameter is updated to hold the message digest size. To perform the above hash with md5 the following code could be used: \begin{small} @@ -2036,7 +2036,7 @@ \chapter{One-Way Cryptographic Hash Functions} /* call the hash */ len = sizeof(out); - if ((err = + if ((err = hash_memory(idx, "hello world", 11, out, &len)) != CRYPT_OK) { printf("Error hashing data: %s\n", error_to_string(err)); return -1; @@ -2087,7 +2087,7 @@ \subsection{Hash Registration} \mysection{Cipher Hash Construction} \index{Cipher Hash Construction} An addition to the suite of hash functions is the \textit{Cipher Hash Construction} or \textit{CHC} mode. In this mode -applicable block ciphers (such as AES) can be turned into hash functions that other LTC functions can use. In +applicable block ciphers (such as AES) can be turned into hash functions that other LTC functions can use. In particular this allows a cryptosystem to be designed using very few moving parts. In order to use the CHC system the developer will have to take a few extra steps. First the \textit{chc\_desc} hash @@ -2100,12 +2100,12 @@ \subsection{Hash Registration} int chc_register(int cipher); \end{verbatim} -A cipher has to be registered with CHC (and also in the cipher descriptor tables with -register\_cipher()). The chc\_register() function will bind a cipher to the CHC system. Only one cipher can +A cipher has to be registered with CHC (and also in the cipher descriptor tables with +register\_cipher()). The chc\_register() function will bind a cipher to the CHC system. Only one cipher can be bound to the CHC hash at a time. There are additional requirements for the system to work. \begin{enumerate} - \item The cipher must have a block size greater than 64--bits. + \item The cipher must have a block size greater than 64--bits. \item The cipher must allow an input key the size of the block size. \end{enumerate} @@ -2115,7 +2115,7 @@ \subsection{Hash Registration} #include int main(void) { - int err; + int err; /* register cipher and hash */ if (register_cipher(&aes_enc_desc) == -1) { @@ -2129,18 +2129,18 @@ \subsection{Hash Registration} /* start chc with AES */ if ((err = chc_register(find_cipher("aes"))) != CRYPT_OK) { - printf("Error binding AES to CHC: %s\n", + printf("Error binding AES to CHC: %s\n", error_to_string(err)); } - /* now you can use chc_hash in any LTC function + /* now you can use chc_hash in any LTC function * [aside from pkcs...] */ } \end{verbatim} \mysection{Notice} -It is highly recommended that you \textbf{not} use the MD4 or MD5 hashes for the purposes of digital signatures or authentication codes. +It is highly recommended that you \textbf{not} use the MD4 or MD5 hashes for the purposes of digital signatures or authentication codes. These hashes are provided for completeness and they still can be used for the purposes of password hashing or one-way accumulators (e.g. Yarrow). @@ -2152,16 +2152,16 @@ \chapter{Message Authentication Codes} Thanks to Dobes Vandermeer, the library now includes support for hash based message authentication codes, or HMAC for short. An HMAC of a message is a keyed authentication code that only the owner of a private symmetric key will be able to verify. The purpose is to allow an owner of a private symmetric key to produce an HMAC on a message then later verify if it is correct. Any impostor or -eavesdropper will not be able to verify the authenticity of a message. +eavesdropper will not be able to verify the authenticity of a message. -The HMAC support works much like the normal hash functions except that the initialization routine requires you to pass a key +The HMAC support works much like the normal hash functions except that the initialization routine requires you to pass a key and its length. The key is much like a key you would pass to a cipher. That is, it is simply an array of octets stored in unsigned characters. The initialization routine is: \index{hmac\_init()} \begin{verbatim} -int hmac_init( hmac_state *hmac, - int hash, - const unsigned char *key, +int hmac_init( hmac_state *hmac, + int hash, + const unsigned char *key, unsigned long keylen); \end{verbatim} The \textit{hmac} parameter is the state for the HMAC code. The \textit{hash} parameter is the index into the descriptor table of the hash you want @@ -2169,20 +2169,20 @@ \chapter{Message Authentication Codes} length (in octets) of the key you want to use to authenticate the message. To send octets of a message through the HMAC system you must use the following function: \index{hmac\_process()} \begin{verbatim} -int hmac_process( hmac_state *hmac, - const unsigned char *in, +int hmac_process( hmac_state *hmac, + const unsigned char *in, unsigned long inlen); \end{verbatim} \textit{hmac} is the HMAC state you are working with. \textit{in} is the array of octets to send into the HMAC process. \textit{inlen} is the -number of octets to process. Like the hash process routines, you can send the data in arbitrarily sized chunks. When you +number of octets to process. Like the hash process routines, you can send the data in arbitrarily sized chunks. When you are finished with the HMAC process you must call the following function to get the HMAC code: \index{hmac\_done()} \begin{verbatim} -int hmac_done( hmac_state *hmac, - unsigned char *out, +int hmac_done( hmac_state *hmac, + unsigned char *out, unsigned long *outlen); \end{verbatim} -The \textit{hmac} parameter is the HMAC state you are working with. The \textit{out} parameter is the array of octets where the HMAC code should be stored. +The \textit{hmac} parameter is the HMAC state you are working with. The \textit{out} parameter is the array of octets where the HMAC code should be stored. You must set \textit{outlen} to the size of the destination buffer before calling this function. It is updated with the length of the HMAC code produced (depending on which hash was picked). If \textit{outlen} is less than the size of the message digest (and ultimately the HMAC code) then the HMAC code is truncated as per FIPS-198 specifications (e.g. take the first \textit{outlen} bytes). @@ -2194,25 +2194,25 @@ \chapter{Message Authentication Codes} \index{hmac\_memory()} \begin{verbatim} int hmac_memory( - int hash, + int hash, const unsigned char *key, unsigned long keylen, - const unsigned char *in, unsigned long inlen, + const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); \end{verbatim} -This will produce an HMAC code for the array of octets in \textit{in} of length \textit{inlen}. The index into the hash descriptor -table must be provided in \textit{hash}. It uses the key from \textit{key} with a key length of \textit{keylen}. +This will produce an HMAC code for the array of octets in \textit{in} of length \textit{inlen}. The index into the hash descriptor +table must be provided in \textit{hash}. It uses the key from \textit{key} with a key length of \textit{keylen}. The result is stored in the array of octets \textit{out} and the length in \textit{outlen}. The value of \textit{outlen} must be set to the size of the destination buffer before calling this function. Similarly for files there is the following function: \index{hmac\_file()} \begin{verbatim} int hmac_file( - int hash, - const char *fname, - const unsigned char *key, unsigned long keylen, + int hash, + const char *fname, + const unsigned char *key, unsigned long keylen, unsigned char *out, unsigned long *outlen); \end{verbatim} -\textit{hash} is the index into the hash descriptor table of the hash you want to use. \textit{fname} is the filename to process. -\textit{key} is the array of octets to use as the key of length \textit{keylen}. \textit{out} is the array of octets where the +\textit{hash} is the index into the hash descriptor table of the hash you want to use. \textit{fname} is the filename to process. +\textit{key} is the array of octets to use as the key of length \textit{keylen}. \textit{out} is the array of octets where the result should be stored. To test if the HMAC code is working there is the following function: @@ -2220,7 +2220,7 @@ \chapter{Message Authentication Codes} \begin{verbatim} int hmac_test(void); \end{verbatim} -Which returns {\bf CRYPT\_OK} if the code passes otherwise it returns an error code. Some example code for using the +Which returns {\bf CRYPT\_OK} if the code passes otherwise it returns an error code. Some example code for using the HMAC system is given below. \begin{small} @@ -2263,7 +2263,7 @@ \chapter{Message Authentication Codes} return -1; } printf("The hmac is %lu bytes long\n", dstlen); - + /* return */ return 0; } @@ -2272,17 +2272,17 @@ \chapter{Message Authentication Codes} \mysection{OMAC Support} \index{OMAC} \index{CMAC} -OMAC\footnote{\url{http://crypt.cis.ibaraki.ac.jp/omac/omac.html}}, which stands for \textit{One-Key CBC MAC} is an +OMAC\footnote{\url{http://crypt.cis.ibaraki.ac.jp/omac/omac.html}}, which stands for \textit{One-Key CBC MAC} is an algorithm which produces a Message Authentication Code (MAC) using only a block cipher such as AES. Note: OMAC has been standardized as -CMAC within NIST, for the purposes of this library OMAC and CMAC are synonymous. From an API standpoint, the OMAC routines work much like the -HMAC routines. Instead, in this case a cipher is used instead of a hash. +CMAC within NIST, for the purposes of this library OMAC and CMAC are synonymous. From an API standpoint, the OMAC routines work much like the +HMAC routines. Instead, in this case a cipher is used instead of a hash. To start an OMAC state you call \index{omac\_init()} \begin{verbatim} -int omac_init( omac_state *omac, - int cipher, - const unsigned char *key, +int omac_init( omac_state *omac, + int cipher, + const unsigned char *key, unsigned long keylen); \end{verbatim} The \textit{omac} parameter is the state for the OMAC algorithm. The \textit{cipher} parameter is the index into the cipher\_descriptor table @@ -2292,11 +2292,11 @@ \chapter{Message Authentication Codes} To send data through the algorithm call \index{omac\_process()} \begin{verbatim} -int omac_process( omac_state *state, - const unsigned char *in, +int omac_process( omac_state *state, + const unsigned char *in, unsigned long inlen); \end{verbatim} -This will send \textit{inlen} bytes from \textit{in} through the active OMAC state \textit{state}. Returns \textbf{CRYPT\_OK} if the +This will send \textit{inlen} bytes from \textit{in} through the active OMAC state \textit{state}. Returns \textbf{CRYPT\_OK} if the function succeeds. The function is not sensitive to the granularity of the data. For example, \begin{verbatim} @@ -2314,23 +2314,23 @@ \chapter{Message Authentication Codes} \index{omac\_done()} \begin{verbatim} -int omac_done( omac_state *state, - unsigned char *out, +int omac_done( omac_state *state, + unsigned char *out, unsigned long *outlen); \end{verbatim} -Which will terminate the OMAC and output the \textit{tag} (MAC) to \textit{out}. Note that unlike the HMAC and other code -\textit{outlen} can be smaller than the default MAC size (for instance AES would make a 16-byte tag). Part of the OMAC +Which will terminate the OMAC and output the \textit{tag} (MAC) to \textit{out}. Note that unlike the HMAC and other code +\textit{outlen} can be smaller than the default MAC size (for instance AES would make a 16-byte tag). Part of the OMAC specification states that the output may be truncated. So if you pass in $outlen = 5$ and use AES as your cipher than the output MAC code will only be five bytes long. If \textit{outlen} is larger than the default size it is set to the default size to show how many bytes were actually used. -Similar to the HMAC code the file and memory functions are also provided. To OMAC a buffer of memory in one shot use the +Similar to the HMAC code the file and memory functions are also provided. To OMAC a buffer of memory in one shot use the following function. \index{omac\_memory()} \begin{verbatim} -int omac_memory( - int cipher, +int omac_memory( + int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); @@ -2343,14 +2343,14 @@ \chapter{Message Authentication Codes} \index{omac\_file()} \begin{verbatim} int omac_file( - int cipher, + int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen); \end{verbatim} Which will OMAC the entire contents of the file specified by \textit{filename} using the key \textit{key} of length \textit{keylen} bytes -and the cipher specified by the \textit{cipher}'th entry in the cipher\_descriptor table. It will store the MAC in \textit{out} with +and the cipher specified by the \textit{cipher}'th entry in the cipher\_descriptor table. It will store the MAC in \textit{out} with the same rules as omac\_done. To test if the OMAC code is working there is the following function: @@ -2358,7 +2358,7 @@ \chapter{Message Authentication Codes} \begin{verbatim} int omac_test(void); \end{verbatim} -Which returns {\bf CRYPT\_OK} if the code passes otherwise it returns an error code. Some example code for using the +Which returns {\bf CRYPT\_OK} if the code passes otherwise it returns an error code. Some example code for using the OMAC system is given below. \begin{small} @@ -2401,7 +2401,7 @@ \chapter{Message Authentication Codes} return -1; } printf("The omac is %lu bytes long\n", dstlen); - + /* return */ return 0; } @@ -2409,17 +2409,17 @@ \chapter{Message Authentication Codes} \end{small} \mysection{PMAC Support} -The PMAC\footnote{J.Black, P.Rogaway, \textit{A Block--Cipher Mode of Operation for Parallelizable Message Authentication}} +The PMAC\footnote{J.Black, P.Rogaway, \textit{A Block--Cipher Mode of Operation for Parallelizable Message Authentication}} protocol is another MAC algorithm that relies solely on a symmetric-key block cipher. It uses essentially the same -API as the provided OMAC code. +API as the provided OMAC code. A PMAC state is initialized with the following. \index{pmac\_init()} \begin{verbatim} -int pmac_init( pmac_state *pmac, - int cipher, - const unsigned char *key, +int pmac_init( pmac_state *pmac, + int cipher, + const unsigned char *key, unsigned long keylen); \end{verbatim} Which initializes the \textit{pmac} state with the given \textit{cipher} and \textit{key} of length \textit{keylen} bytes. The chosen cipher @@ -2429,8 +2429,8 @@ \chapter{Message Authentication Codes} \index{pmac\_process()} \begin{verbatim} -int pmac_process( pmac_state *state, - const unsigned char *in, +int pmac_process( pmac_state *state, + const unsigned char *in, unsigned long inlen); \end{verbatim} This will process \textit{inlen} bytes of \textit{in} in the given \textit{state}. The function is not sensitive to the granularity of the @@ -2451,20 +2451,20 @@ \chapter{Message Authentication Codes} \index{pmac\_done()} \begin{verbatim} -int pmac_done( pmac_state *state, - unsigned char *out, +int pmac_done( pmac_state *state, + unsigned char *out, unsigned long *outlen); \end{verbatim} This will store up to \textit{outlen} bytes of the tag for the given \textit{state} into \textit{out}. Note that if \textit{outlen} is larger than the size of the tag it is set to the amount of bytes stored in \textit{out}. -Similar to the OMAC code the file and memory functions are also provided. To PMAC a buffer of memory in one shot use the +Similar to the OMAC code the file and memory functions are also provided. To PMAC a buffer of memory in one shot use the following function. \index{pmac\_memory()} \begin{verbatim} int pmac_memory( - int cipher, + int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); @@ -2477,14 +2477,14 @@ \chapter{Message Authentication Codes} \index{pmac\_file()} \begin{verbatim} int pmac_file( - int cipher, + int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen); \end{verbatim} -Which will PMAC the entire contents of the file specified by \textit{filename} using the key \textit{key} of length \textit{keylen} bytes, -and the cipher specified by the \textit{cipher}'th entry in the cipher\_descriptor table. It will store the MAC in \textit{out} with +Which will PMAC the entire contents of the file specified by \textit{filename} using the key \textit{key} of length \textit{keylen} bytes, +and the cipher specified by the \textit{cipher}'th entry in the cipher\_descriptor table. It will store the MAC in \textit{out} with the same rules as pmac\_done(). To test if the PMAC code is working there is the following function: @@ -2495,22 +2495,22 @@ \chapter{Message Authentication Codes} Which returns {\bf CRYPT\_OK} if the code passes otherwise it returns an error code. \mysection{Pelican MAC} -Pelican MAC is a new (experimental) MAC by the AES team that uses four rounds of AES as a \textit{mixing function}. It achieves a very high +Pelican MAC is a new (experimental) MAC by the AES team that uses four rounds of AES as a \textit{mixing function}. It achieves a very high rate of processing and is potentially very secure. It requires AES to be enabled to function. You do not have to register\_cipher() AES first though as it calls AES directly. \index{pelican\_init()} \begin{verbatim} -int pelican_init( pelican_state *pelmac, - const unsigned char *key, +int pelican_init( pelican_state *pelmac, + const unsigned char *key, unsigned long keylen); \end{verbatim} This will initialize the Pelican state with the given AES key. Once this has been done you can begin processing data. \index{pelican\_process()} \begin{verbatim} -int pelican_process( pelican_state *pelmac, - const unsigned char *in, +int pelican_process( pelican_state *pelmac, + const unsigned char *in, unsigned long inlen); \end{verbatim} This will process \textit{inlen} bytes of \textit{in} through the Pelican MAC. It's best that you pass in multiples of 16 bytes as it makes the @@ -2540,17 +2540,17 @@ \subsection{Example} key, /* user key */ 32 /* key length in octets */ )) != CRYPT_OK) { - printf("Error initializing Pelican: %s", + printf("Error initializing Pelican: %s", error_to_string(err)); return EXIT_FAILURE; } /* MAC some data */ if ((err = pelican_process(&pelstate, /* the state */ - "hello world", /* data to mac */ + "hello world", /* data to mac */ 11 /* length of data */ )) != CRYPT_OK) { - printf("Error processing Pelican: %s", + printf("Error processing Pelican: %s", error_to_string(err)); return EXIT_FAILURE; } @@ -2559,7 +2559,7 @@ \subsection{Example} if ((err = pelican_done(&pelstate,/* the state */ tag /* where to store the tag */ )) != CRYPT_OK) { - printf("Error terminating Pelican: %s", + printf("Error terminating Pelican: %s", error_to_string(err)); return EXIT_FAILURE; } @@ -2577,9 +2577,9 @@ \subsection{Example} \index{xcbc\_init()} \begin{verbatim} -int xcbc_init( xcbc_state *xcbc, - int cipher, - const unsigned char *key, +int xcbc_init( xcbc_state *xcbc, + int cipher, + const unsigned char *key, unsigned long keylen); \end{verbatim} @@ -2588,7 +2588,7 @@ \subsection{Example} \index{LTC\_XCBC\_PURE} It is possible to use XCBC in a three key mode by OR'ing the value \textbf{LTC\_XCBC\_PURE} against the \textit{keylen} parameter. In this mode, the key is -interpretted as three keys. If the cipher has a block size of $n$ octets, the first key is then $keylen - 2n$ octets and is the encryption key. The next +interpretted as three keys. If the cipher has a block size of $n$ octets, the first key is then $keylen - 2n$ octets and is the encryption key. The next $2n$ octets are the $K_1$ and $K_2$ padding keys (used on the last block). For example, to use AES--192 \textit{keylen} should be $24 + 2 \cdot 16 = 56$ octets. The three keys are interpretted as if they were concatenated in the \textit{key} buffer. @@ -2597,8 +2597,8 @@ \subsection{Example} \index{xcbc\_process()} \begin{verbatim} -int xcbc_process( xcbc_state *state, - const unsigned char *in, +int xcbc_process( xcbc_state *state, + const unsigned char *in, unsigned long inlen); \end{verbatim} @@ -2609,8 +2609,8 @@ \subsection{Example} \index{xcbc\_done()} \begin{verbatim} -int xcbc_done( xcbc_state *state, - unsigned char *out, +int xcbc_done( xcbc_state *state, + unsigned char *out, unsigned long *outlen); \end{verbatim} @@ -2622,7 +2622,7 @@ \subsection{Example} \index{xcbc\_memory()} \begin{verbatim} int xcbc_memory( - int cipher, + int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); @@ -2634,13 +2634,13 @@ \subsection{Example} \index{xcbc\_file()} \begin{verbatim} int xcbc_file( - int cipher, + int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen); \end{verbatim} -Which will XCBC--MAC the entire contents of the file specified by \textit{filename} using the key \textit{key} of length \textit{keylen} bytes, and the cipher +Which will XCBC--MAC the entire contents of the file specified by \textit{filename} using the key \textit{key} of length \textit{keylen} bytes, and the cipher specified by the \textit{cipher}'th entry in the cipher\_descriptor table. It will store the MAC in \textit{out} with the same rules as xcbc\_done(). @@ -2651,17 +2651,17 @@ \subsection{Example} int xcbc_test(void); \end{verbatim} -This will return \textbf{CRYPT\_OK} on success. This requires the AES or Rijndael descriptor be previously registered, otherwise, it will return -\textbf{CRYPT\_NOP}. +This will return \textbf{CRYPT\_OK} on success. This requires the AES or Rijndael descriptor be previously registered, otherwise, it will return +\textbf{CRYPT\_NOP}. \mysection{F9--MAC} The F9--MAC is yet another CBC--MAC variant proposed for the 3GPP standard. Originally specified to be used with the KASUMI block cipher, it can also be used -with other ciphers. For LibTomCrypt, the F9--MAC code can use any cipher. +with other ciphers. For LibTomCrypt, the F9--MAC code can use any cipher. \subsection{Usage Notice} F9--MAC differs slightly from the other MAC functions in that it requires the caller to perform the final message padding. The padding quite simply is a direction -bit followed by a 1 bit and enough zeros to make the message a multiple of the cipher block size. If the message is byte aligned, the padding takes on the form of -a single 0x40 or 0xC0 byte followed by enough 0x00 bytes to make the message proper multiple. +bit followed by a 1 bit and enough zeros to make the message a multiple of the cipher block size. If the message is byte aligned, the padding takes on the form of +a single 0x40 or 0xC0 byte followed by enough 0x00 bytes to make the message proper multiple. If the user simply wants a MAC function (hint: use OMAC) padding with a single 0x40 byte should be sufficient for security purposes and still be reasonably compatible with F9--MAC. @@ -2670,9 +2670,9 @@ \subsection{F9--MAC Functions} A F9--MAC state is initialized with the following function: \index{f9\_init()} \begin{verbatim} -int f9_init( f9_state *f9, - int cipher, - const unsigned char *key, +int f9_init( f9_state *f9, + int cipher, + const unsigned char *key, unsigned long keylen); \end{verbatim} @@ -2682,8 +2682,8 @@ \subsection{F9--MAC Functions} To process data through F9--MAC use the following function: \index{f9\_process()} \begin{verbatim} -int f9_process( f9_state *state, - const unsigned char *in, +int f9_process( f9_state *state, + const unsigned char *in, unsigned long inlen); \end{verbatim} @@ -2694,13 +2694,13 @@ \subsection{F9--MAC Functions} \index{f9\_done()} \begin{verbatim} -int f9_done( f9_state *state, - unsigned char *out, +int f9_done( f9_state *state, + unsigned char *out, unsigned long *outlen); \end{verbatim} This will retrieve the F9--MAC tag from the state pointed to by \textit{state}, and store it in the array pointed to by \textit{out}. The \textit{outlen} parameter -specifies the maximum size of the destination buffer, and is updated to hold the final size of the tag when the function returns. This will return +specifies the maximum size of the destination buffer, and is updated to hold the final size of the tag when the function returns. This will return \textbf{CRYPT\_OK} on success. Helper functions are provided to make parsing memory buffers and files easier. The following functions are provided: @@ -2708,7 +2708,7 @@ \subsection{F9--MAC Functions} \index{f9\_memory()} \begin{verbatim} int f9_memory( - int cipher, + int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); @@ -2720,13 +2720,13 @@ \subsection{F9--MAC Functions} \index{f9\_file()} \begin{verbatim} int f9_file( - int cipher, + int cipher, const unsigned char *key, unsigned long keylen, - const char *filename, + const char *filename, unsigned char *out, unsigned long *outlen); \end{verbatim} -Which will F9--MAC the entire contents of the file specified by \textit{filename} using the key \textit{key} of length \textit{keylen} bytes, and the cipher +Which will F9--MAC the entire contents of the file specified by \textit{filename} using the key \textit{key} of length \textit{keylen} bytes, and the cipher specified by the \textit{cipher}'th entry in the cipher\_descriptor table. It will store the MAC in \textit{out} with the same rules as f9\_done(). @@ -2737,8 +2737,8 @@ \subsection{F9--MAC Functions} int f9_test(void); \end{verbatim} -This will return \textbf{CRYPT\_OK} on success. This requires the AES or Rijndael descriptor be previously registered, otherwise, it will return -\textbf{CRYPT\_NOP}. +This will return \textbf{CRYPT\_OK} on success. This requires the AES or Rijndael descriptor be previously registered, otherwise, it will return +\textbf{CRYPT\_NOP}. \chapter{Pseudo-Random Number Generators} \mysection{Core Functions} @@ -2750,12 +2750,12 @@ \chapter{Pseudo-Random Number Generators} int XXX_start(prng_state *prng); \end{verbatim} -This will setup the PRNG for future use and not seed it. In order for the PRNG to be cryptographically useful you must give it +This will setup the PRNG for future use and not seed it. In order for the PRNG to be cryptographically useful you must give it entropy. Ideally you'd have some OS level source to tap like in UNIX. To add entropy to the PRNG call: \index{PRNG add\_entropy} \begin{verbatim} -int XXX_add_entropy(const unsigned char *in, - unsigned long inlen, +int XXX_add_entropy(const unsigned char *in, + unsigned long inlen, prng_state *prng); \end{verbatim} Which returns {\bf CRYPT\_OK} if the entropy was accepted. Once you think you have enough entropy you call another @@ -2768,7 +2768,7 @@ \chapter{Pseudo-Random Number Generators} Which returns {\bf CRYPT\_OK} if it is ready. Finally to actually read bytes call: \index{PRNG read} \begin{verbatim} -unsigned long XXX_read(unsigned char *out, +unsigned long XXX_read(unsigned char *out, unsigned long outlen, prng_state *prng); \end{verbatim} @@ -2786,19 +2786,19 @@ \chapter{Pseudo-Random Number Generators} \index{PRNG export} \begin{verbatim} -int XXX_export(unsigned char *out, - unsigned long *outlen, +int XXX_export(unsigned char *out, + unsigned long *outlen, prng_state *prng); \end{verbatim} -This will write a \textit{PRNG state} to the buffer \textit{out} of length \textit{outlen} bytes. The idea of +This will write a \textit{PRNG state} to the buffer \textit{out} of length \textit{outlen} bytes. The idea of the export is meant to be used as a \textit{seed file}. That is, when the program starts up there will not likely be that much entropy available. To import a state to seed a PRNG call the following function. \index{PRNG import} \begin{verbatim} -int XXX_import(const unsigned char *in, - unsigned long inlen, +int XXX_import(const unsigned char *in, + unsigned long inlen, prng_state *prng); \end{verbatim} @@ -2807,7 +2807,7 @@ \chapter{Pseudo-Random Number Generators} by the corresponding export function. Note that importing a state will not \textit{resume} the PRNG from where it left off. That is, if you export -a state, emit (say) 8 bytes and then import the previously exported state the next 8 bytes will not +a state, emit (say) 8 bytes and then import the previously exported state the next 8 bytes will not specifically equal the 8 bytes you generated previously. When a program is first executed the normal course of operation is: @@ -2818,13 +2818,13 @@ \chapter{Pseudo-Random Number Generators} \end{enumerate} When your program is finished you simply call the export function and save the state to a medium (disk, -flash memory, etc). The next time your application starts up you can detect the state, feed it to the +flash memory, etc). The next time your application starts up you can detect the state, feed it to the import function and go on your way. It is ideal that (as soon as possible) after start up you export a fresh state. This helps in the case that the program aborts or the machine is powered down without -being given a chance to exit properly. +being given a chance to exit properly. Note that even if you have a state to import it is important to add new entropy to the state. However, -there is less pressure to do so. +there is less pressure to do so. To test a PRNG for operational conformity call the following functions. @@ -2839,11 +2839,11 @@ \subsection{Remarks} It is possible to be adding entropy and reading from a PRNG at the same time. For example, if you first seed the PRNG and call ready() you can now read from it. You can also keep adding new entropy to it. The new entropy will not be used -in the PRNG until ready() is called again. This allows the PRNG to be used and re-seeded at the same time. No real error +in the PRNG until ready() is called again. This allows the PRNG to be used and re-seeded at the same time. No real error checking is guaranteed to see if the entropy is sufficient, or if the PRNG is even in a ready state before reading. \subsection{Example} -Below is a simple snippet to read 10 bytes from Yarrow. It is important to note that this snippet is {\bf NOT} secure since +Below is a simple snippet to read 10 bytes from Yarrow. It is important to note that this snippet is {\bf NOT} secure since the entropy added is not random. \begin{verbatim} @@ -2853,13 +2853,13 @@ \subsection{Example} prng_state prng; unsigned char buf[10]; int err; - + /* start it */ if ((err = yarrow_start(&prng)) != CRYPT_OK) { printf("Start error: %s\n", error_to_string(err)); } /* add entropy */ - if ((err = yarrow_add_entropy("hello world", 11, &prng)) + if ((err = yarrow_add_entropy("hello world", 11, &prng)) != CRYPT_OK) { printf("Add_entropy error: %s\n", error_to_string(err)); } @@ -2867,7 +2867,7 @@ \subsection{Example} if ((err = yarrow_ready(&prng)) != CRYPT_OK) { printf("Ready error: %s\n", error_to_string(err)); } - printf("Read %lu bytes from yarrow\n", + printf("Read %lu bytes from yarrow\n", yarrow_read(buf, sizeof(buf), &prng)); return 0; } @@ -2875,7 +2875,7 @@ \subsection{Example} \mysection{PRNG Descriptors} \index{PRNG Descriptor} -PRNGs have descriptors that allow plugin driven functions to be created using PRNGs. The plugin descriptors are stored in the structure \textit{prng\_descriptor}. The +PRNGs have descriptors that allow plugin driven functions to be created using PRNGs. The plugin descriptors are stored in the structure \textit{prng\_descriptor}. The format of an element is: \begin{verbatim} struct _prng_descriptor { @@ -2884,12 +2884,12 @@ \subsection{Example} int (*start) (prng_state *); - int (*add_entropy)(const unsigned char *, unsigned long, + int (*add_entropy)(const unsigned char *, unsigned long, prng_state *); int (*ready) (prng_state *); - unsigned long (*read)(unsigned char *, unsigned long len, + unsigned long (*read)(unsigned char *, unsigned long len, prng_state *); void (*done)(prng_state *); @@ -2910,7 +2910,7 @@ \subsection{Example} This will search the PRNG descriptor table for the PRNG named \textit{name}. It will return -1 if the PRNG is not found, otherwise, it returns the index into the descriptor table. -Just like the ciphers and hashes, you must register your prng before you can use it. The two functions provided work exactly as those for the cipher registry functions. +Just like the ciphers and hashes, you must register your prng before you can use it. The two functions provided work exactly as those for the cipher registry functions. They are the following: \index{register\_prng()} \index{unregister\_prng()} \begin{verbatim} @@ -2940,8 +2940,8 @@ \subsection{PRNGs Provided} \end{figure} \subsubsection{Yarrow} -Yarrow is fast PRNG meant to collect an unspecified amount of entropy from sources -(keyboard, mouse, interrupts, etc), and produce an unbounded string of random bytes. +Yarrow is fast PRNG meant to collect an unspecified amount of entropy from sources +(keyboard, mouse, interrupts, etc), and produce an unbounded string of random bytes. \textit{Note:} This PRNG is still secure for most tasks but is no longer recommended. Users should use Fortuna instead. @@ -2951,38 +2951,38 @@ \subsubsection{Fortuna} Fortuna is a fast attack tolerant and more thoroughly designed PRNG suitable for long term usage. It is faster than the default implementation of Yarrow\footnote{Yarrow has been implemented to work with most cipher and hash combos based on which you have chosen to build into the library.} while -providing more security. +providing more security. -Fortuna is slightly less flexible than Yarrow in the sense that it only works with the AES block cipher +Fortuna is slightly less flexible than Yarrow in the sense that it only works with the AES block cipher and SHA--256 hash function. Technically, Fortuna will work with any block cipher that accepts a 256--bit key, and any hash that produces at least a 256--bit output. However, to make the implementation simpler it has been fixed to those choices. -Fortuna is more secure than Yarrow in the sense that attackers who learn parts of the entropy being +Fortuna is more secure than Yarrow in the sense that attackers who learn parts of the entropy being added to the PRNG learn far less about the state than that of Yarrow. Without getting into to many details Fortuna has the ability to recover from state determination attacks where the attacker starts -to learn information from the PRNGs output about the internal state. Yarrow on the other hand, cannot +to learn information from the PRNGs output about the internal state. Yarrow on the other hand, cannot recover from that problem until new entropy is added to the pool and put to use through the ready() function. \subsubsection{RC4} RC4 is an old stream cipher that can also double duty as a PRNG in a pinch. You key RC4 by calling add\_entropy(), and setup the key by calling ready(). You can only add up to 256 bytes via -add\_entropy(). +add\_entropy(). -When you read from RC4, the output is XOR'ed against your buffer you provide. In this manner, you can use rc4\_read() -as an encrypt (and decrypt) function. +When you read from RC4, the output is XOR'ed against your buffer you provide. In this manner, you can use rc4\_read() +as an encrypt (and decrypt) function. -You really should not use RC4. This is not because RC4 is weak, (though biases are known to exist) but simply due to +You really should not use RC4. This is not because RC4 is weak, (though biases are known to exist) but simply due to the fact that faster alternatives exist. \subsubsection{SOBER-128} -SOBER--128 is a stream cipher designed by the QUALCOMM Australia team. Like RC4, you key it by -calling add\_entropy(). There is no need to call ready() for this PRNG as it does not do anything. +SOBER--128 is a stream cipher designed by the QUALCOMM Australia team. Like RC4, you key it by +calling add\_entropy(). There is no need to call ready() for this PRNG as it does not do anything. -Note: this cipher has several oddities about how it operates. The first call to add\_entropy() sets the cipher's key. -Every other time call to the add\_entropy() function sets the cipher's IV variable. The IV mechanism allows you to +Note: this cipher has several oddities about how it operates. The first call to add\_entropy() sets the cipher's key. +Every other time call to the add\_entropy() function sets the cipher's IV variable. The IV mechanism allows you to encrypt several messages with the same key, and not re--use the same key material. Unlike Yarrow and Fortuna, all of the entropy (and hence security) of this algorithm rests in the data @@ -2992,9 +2992,9 @@ \subsubsection{SOBER-128} Like RC4, the output of SOBER--128 is XOR'ed against the buffer you provide it. In this manner, you can use sober128\_read() as an encrypt (and decrypt) function. -Since SOBER-128 has a fixed keying scheme, and is very fast (faster than RC4) the ideal usage of SOBER-128 is to +Since SOBER-128 has a fixed keying scheme, and is very fast (faster than RC4) the ideal usage of SOBER-128 is to key it from the output of Fortuna (or Yarrow), and use it to encrypt messages. It is also ideal for -simulations which need a high quality (and fast) stream of bytes. +simulations which need a high quality (and fast) stream of bytes. \subsubsection{Example Usage} \begin{small} @@ -3030,39 +3030,39 @@ \subsubsection{Example Usage} exit(-1); } return 0; -} +} \end{verbatim} \end{small} -To decrypt you have to do the exact same steps. +To decrypt you have to do the exact same steps. \mysection{The Secure RNG} \index{Secure RNG} An RNG is related to a PRNG in many ways, except that it does not expand a smaller seed to get the data. They generate their random bits -by performing some computation on fresh input bits. Possibly the hardest thing to get correctly in a cryptosystem is the -PRNG. Computers are deterministic that try hard not to stray from pre--determined paths. This makes gathering entropy needed to seed a PRNG -a hard task. +by performing some computation on fresh input bits. Possibly the hardest thing to get correctly in a cryptosystem is the +PRNG. Computers are deterministic that try hard not to stray from pre--determined paths. This makes gathering entropy needed to seed a PRNG +a hard task. There is one small function that may help on certain platforms: \index{rng\_get\_bytes()} \begin{verbatim} unsigned long rng_get_bytes( - unsigned char *buf, - unsigned long len, + unsigned char *buf, + unsigned long len, void (*callback)(void)); \end{verbatim} -Which will try one of three methods of getting random data. The first is to open the popular \textit{/dev/random} device which -on most *NIX platforms provides cryptographic random bits\footnote{This device is available in Windows through the Cygwin compiler suite. It emulates \textit{/dev/random} via the Microsoft CSP.}. -The second method is to try the Microsoft Cryptographic Service Provider, and read the RNG. The third method is an ANSI C -clock drift method that is also somewhat popular but gives bits of lower entropy. The \textit{callback} parameter is a pointer to a function that returns void. It is -used when the slower ANSI C RNG must be used so the calling application can still work. This is useful since the ANSI C RNG has a throughput of roughly three -bytes a second. The callback pointer may be set to {\bf NULL} to avoid using it if you do not want to. The function returns the number of bytes actually read from +Which will try one of three methods of getting random data. The first is to open the popular \textit{/dev/random} device which +on most *NIX platforms provides cryptographic random bits\footnote{This device is available in Windows through the Cygwin compiler suite. It emulates \textit{/dev/random} via the Microsoft CSP.}. +The second method is to try the Microsoft Cryptographic Service Provider, and read the RNG. The third method is an ANSI C +clock drift method that is also somewhat popular but gives bits of lower entropy. The \textit{callback} parameter is a pointer to a function that returns void. It is +used when the slower ANSI C RNG must be used so the calling application can still work. This is useful since the ANSI C RNG has a throughput of roughly three +bytes a second. The callback pointer may be set to {\bf NULL} to avoid using it if you do not want to. The function returns the number of bytes actually read from any RNG source. There is a function to help setup a PRNG as well: \index{rng\_make\_prng()} \begin{verbatim} -int rng_make_prng( int bits, - int wprng, - prng_state *prng, +int rng_make_prng( int bits, + int wprng, + prng_state *prng, void (*callback)(void)); \end{verbatim} This will try to initialize the prng with a state of at least \textit{bits} of entropy. The \textit{callback} parameter works much like @@ -3085,14 +3085,14 @@ \subsubsection{Example Usage} } /* setup the PRNG */ - if ((err = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) + if ((err = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) != CRYPT_OK) { printf("Error setting up PRNG, %s\n", error_to_string(err)); return -1; } /* make a 192-bit ECC key */ - if ((err = ecc_make_key(&prng, find_prng("yarrow"), 24, &mykey)) + if ((err = ecc_make_key(&prng, find_prng("yarrow"), 24, &mykey)) != CRYPT_OK) { printf("Error making key: %s\n", error_to_string(err)); return -1; @@ -3104,7 +3104,7 @@ \subsubsection{Example Usage} \subsection{The Secure PRNG Interface} It is possible to access the secure RNG through the PRNG interface, and in turn use it within dependent functions such -as the PK API. This simplifies the cryptosystem on platforms where the secure RNG is fast. The secure PRNG never +as the PK API. This simplifies the cryptosystem on platforms where the secure RNG is fast. The secure PRNG never requires to be started, that is you need not call the start, add\_entropy, or ready functions. For example, consider the previous example using this PRNG. @@ -3123,7 +3123,7 @@ \subsection{The Secure PRNG Interface} } /* make a 192-bit ECC key */ - if ((err = ecc_make_key(NULL, find_prng("sprng"), 24, &mykey)) + if ((err = ecc_make_key(NULL, find_prng("sprng"), 24, &mykey)) != CRYPT_OK) { printf("Error making key: %s\n", error_to_string(err)); return -1; @@ -3138,31 +3138,31 @@ \chapter{RSA Public Key Cryptography} \mysection{Introduction} RSA wrote the PKCS \#1 specifications which detail RSA Public Key Cryptography. In the specifications are padding algorithms for encryption and signatures. The standard includes the \textit{v1.5} and \textit{v2.1} algorithms. -To simplify matters a little the v2.1 encryption and signature padding algorithms are called OAEP and PSS respectively. +To simplify matters a little the v2.1 encryption and signature padding algorithms are called OAEP and PSS respectively. \mysection{PKCS \#1 Padding} PKCS \#1 v1.5 padding is so simple that both signature and encryption padding are performed by the same function. Note: the signature padding does \textbf{not} include the ASN.1 padding required. That is performed by the rsa\_sign\_hash\_ex() function -documented later on in this chapter. +documented later on in this chapter. \subsection{PKCS \#1 v1.5 Encoding} The following function performs PKCS \#1 v1.5 padding: \index{pkcs\_1\_v1\_5\_encode()} \begin{verbatim} int pkcs_1_v1_5_encode( - const unsigned char *msg, + const unsigned char *msg, unsigned long msglen, int block_type, unsigned long modulus_bitlen, - prng_state *prng, + prng_state *prng, int prng_idx, - unsigned char *out, + unsigned char *out, unsigned long *outlen); \end{verbatim} This will encode the message pointed to by \textit{msg} of length \textit{msglen} octets. The \textit{block\_type} parameter must be set to -\textbf{LTC\_PKCS\_1\_EME} to perform encryption padding. It must be set to \textbf{LTC\_PKCS\_1\_EMSA} to perform signature padding. The \textit{modulus\_bitlen} -parameter indicates the length of the modulus in bits. The padded data is stored in \textit{out} with a length of \textit{outlen} octets. The output will not be +\textbf{LTC\_PKCS\_1\_EME} to perform encryption padding. It must be set to \textbf{LTC\_PKCS\_1\_EMSA} to perform signature padding. The \textit{modulus\_bitlen} +parameter indicates the length of the modulus in bits. The padded data is stored in \textit{out} with a length of \textit{outlen} octets. The output will not be longer than the modulus which helps allocate the correct output buffer size. Only encryption padding requires a PRNG. When performing signature padding the \textit{prng\_idx} parameter may be left to zero as it is not checked for validity. @@ -3172,11 +3172,11 @@ \subsection{PKCS \#1 v1.5 Decoding} \index{pkcs\_1\_v1\_5\_decode()} \begin{verbatim} int pkcs_1_v1_5_decode( - const unsigned char *msg, + const unsigned char *msg, unsigned long msglen, int block_type, unsigned long modulus_bitlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, int *is_valid); \end{verbatim} @@ -3196,86 +3196,86 @@ \subsection{OAEP Encoding} \index{pkcs\_1\_oaep\_encode()} \begin{alltt} int pkcs_1_oaep_encode( - const unsigned char *msg, + const unsigned char *msg, unsigned long msglen, - const unsigned char *lparam, + const unsigned char *lparam, unsigned long lparamlen, - unsigned long modulus_bitlen, + unsigned long modulus_bitlen, prng_state *prng, int prng_idx, int hash_idx, - unsigned char *out, + unsigned char *out, unsigned long *outlen); \end{alltt} This accepts \textit{msg} as input of length \textit{msglen} which will be OAEP padded. The \textit{lparam} variable is an additional system specific tag that can be applied to the encoding. This is useful to identify which system encoded the message. If no variance is desired then -\textit{lparam} can be set to \textbf{NULL}. +\textit{lparam} can be set to \textbf{NULL}. OAEP encoding requires the length of the modulus in bits in order to calculate the size of the output. This is passed as the parameter -\textit{modulus\_bitlen}. \textit{hash\_idx} is the index into the hash descriptor table of the hash desired. PKCS \#1 allows any hash to be +\textit{modulus\_bitlen}. \textit{hash\_idx} is the index into the hash descriptor table of the hash desired. PKCS \#1 allows any hash to be used but both the encoder and decoder must use the same hash in order for this to succeed. The size of hash output affects the maximum - sized input message. \textit{prng\_idx} and \textit{prng} are the random number generator arguments required to randomize the padding process. + sized input message. \textit{prng\_idx} and \textit{prng} are the random number generator arguments required to randomize the padding process. The padded message is stored in \textit{out} along with the length in \textit{outlen}. -If $h$ is the length of the hash and $m$ the length of the modulus (both in octets) then the maximum payload for \textit{msg} is -$m - 2h - 2$. For example, with a $1024$--bit RSA key and SHA--1 as the hash the maximum payload is $86$ bytes. +If $h$ is the length of the hash and $m$ the length of the modulus (both in octets) then the maximum payload for \textit{msg} is +$m - 2h - 2$. For example, with a $1024$--bit RSA key and SHA--1 as the hash the maximum payload is $86$ bytes. -Note that when the message is padded it still has not been RSA encrypted. You must pass the output of this function to -rsa\_exptmod() to encrypt it. +Note that when the message is padded it still has not been RSA encrypted. You must pass the output of this function to +rsa\_exptmod() to encrypt it. \subsection{OAEP Decoding} \index{pkcs\_1\_oaep\_decode()} \begin{alltt} int pkcs_1_oaep_decode( - const unsigned char *msg, + const unsigned char *msg, unsigned long msglen, - const unsigned char *lparam, + const unsigned char *lparam, unsigned long lparamlen, - unsigned long modulus_bitlen, + unsigned long modulus_bitlen, int hash_idx, - unsigned char *out, + unsigned char *out, unsigned long *outlen, int *res); \end{alltt} -This function decodes an OAEP encoded message and outputs the original message that was passed to the OAEP encoder. \textit{msg} is the +This function decodes an OAEP encoded message and outputs the original message that was passed to the OAEP encoder. \textit{msg} is the output of pkcs\_1\_oaep\_encode() of length \textit{msglen}. \textit{lparam} is the same system variable passed to the OAEP encoder. If it does not match what was used during encoding this function will not decode the packet. \textit{modulus\_bitlen} is the size of the RSA modulus in bits and must match what was used during encoding. Similarly the \textit{hash\_idx} index into the hash descriptor table must match what was used during encoding. -If the function succeeds it decodes the OAEP encoded message into \textit{out} of length \textit{outlen} and stores a +If the function succeeds it decodes the OAEP encoded message into \textit{out} of length \textit{outlen} and stores a $1$ in \textit{res}. If the packet is invalid it stores $0$ in \textit{res} and if the function fails for another reason -it returns an error code. +it returns an error code. \mysection{PKCS \#1 Digital Signatures} \subsection{PSS Encoding} -PSS encoding is the second half of the PKCS \#1 standard which is padding to be applied to messages that are signed. +PSS encoding is the second half of the PKCS \#1 standard which is padding to be applied to messages that are signed. \index{pkcs\_1\_pss\_encode()} \begin{alltt} int pkcs_1_pss_encode( - const unsigned char *msghash, + const unsigned char *msghash, unsigned long msghashlen, - unsigned long saltlen, - prng_state *prng, - int prng_idx, + unsigned long saltlen, + prng_state *prng, + int prng_idx, int hash_idx, unsigned long modulus_bitlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); \end{alltt} -This function assumes the message to be PSS encoded has previously been hashed. The input hash \textit{msghash} is of length -\textit{msghashlen}. PSS allows a variable length random salt (it can be zero length) to be introduced in the signature process. +This function assumes the message to be PSS encoded has previously been hashed. The input hash \textit{msghash} is of length +\textit{msghashlen}. PSS allows a variable length random salt (it can be zero length) to be introduced in the signature process. \textit{hash\_idx} is the index into the hash descriptor table of the hash to use. \textit{prng\_idx} and \textit{prng} are the random number generator information required for the salt. Similar to OAEP encoding \textit{modulus\_bitlen} is the size of the RSA modulus (in bits). It limits the size of the salt. If $m$ is the length -of the modulus $h$ the length of the hash output (in octets) then there can be $m - h - 2$ bytes of salt. +of the modulus $h$ the length of the hash output (in octets) then there can be $m - h - 2$ bytes of salt. This function does not actually sign the data it merely pads the hash of a message so that it can be processed by rsa\_exptmod(). @@ -3286,17 +3286,17 @@ \subsection{PSS Decoding} \index{pkcs\_1\_pss\_decode()} \begin{alltt} int pkcs_1_pss_decode( - const unsigned char *msghash, + const unsigned char *msghash, unsigned long msghashlen, - const unsigned char *sig, + const unsigned char *sig, unsigned long siglen, unsigned long saltlen, int hash_idx, - unsigned long modulus_bitlen, + unsigned long modulus_bitlen, int *res); \end{alltt} This will decode the PSS encoded message in \textit{sig} of length \textit{siglen} and compare it to values in \textit{msghash} of length -\textit{msghashlen}. If the block is a valid PSS block and the decoded hash equals the hash supplied \textit{res} is set to non--zero. Otherwise, +\textit{msghashlen}. If the block is a valid PSS block and the decoded hash equals the hash supplied \textit{res} is set to non--zero. Otherwise, it is set to zero. The rest of the parameters are as in the PSS encode call. It's important to use the same \textit{saltlen} and hash for both encoding and decoding as otherwise the procedure will not work. @@ -3304,75 +3304,75 @@ \subsection{PSS Decoding} \mysection{RSA Key Operations} \subsection{Background} -RSA is a public key algorithm that is based on the inability to find the \textit{e-th} root modulo a composite of unknown +RSA is a public key algorithm that is based on the inability to find the \textit{e-th} root modulo a composite of unknown factorization. Normally the difficulty of breaking RSA is associated with the integer factoring problem but they are not strictly equivalent. The system begins with with two primes $p$ and $q$ and their product $N = pq$. The order or \textit{Euler totient} of the -multiplicative sub-group formed modulo $N$ is given as $\phi(N) = (p - 1)(q - 1)$ which can be reduced to -$\mbox{lcm}(p - 1, q - 1)$. The public key consists of the composite $N$ and some integer $e$ such that -$\mbox{gcd}(e, \phi(N)) = 1$. The private key consists of the composite $N$ and the inverse of $e$ modulo $\phi(N)$ +multiplicative sub-group formed modulo $N$ is given as $\phi(N) = (p - 1)(q - 1)$ which can be reduced to +$\mbox{lcm}(p - 1, q - 1)$. The public key consists of the composite $N$ and some integer $e$ such that +$\mbox{gcd}(e, \phi(N)) = 1$. The private key consists of the composite $N$ and the inverse of $e$ modulo $\phi(N)$ often simply denoted as $de \equiv 1\mbox{ }(\mbox{mod }\phi(N))$. -A person who wants to encrypt with your public key simply forms an integer (the plaintext) $M$ such that +A person who wants to encrypt with your public key simply forms an integer (the plaintext) $M$ such that $1 < M < N-2$ and computes the ciphertext $C = M^e\mbox{ }(\mbox{mod }N)$. Since finding the inverse exponent $d$ given only $N$ and $e$ appears to be intractable only the owner of the private key can decrypt the ciphertext and compute -$C^d \equiv \left (M^e \right)^d \equiv M^1 \equiv M\mbox{ }(\mbox{mod }N)$. Similarly the owner of the private key -can sign a message by \textit{decrypting} it. Others can verify it by \textit{encrypting} it. +$C^d \equiv \left (M^e \right)^d \equiv M^1 \equiv M\mbox{ }(\mbox{mod }N)$. Similarly the owner of the private key +can sign a message by \textit{decrypting} it. Others can verify it by \textit{encrypting} it. -Currently RSA is a difficult system to cryptanalyze provided that both primes are large and not close to each other. +Currently RSA is a difficult system to cryptanalyze provided that both primes are large and not close to each other. Ideally $e$ should be larger than $100$ to prevent direct analysis. For example, if $e$ is three and you do not pad -the plaintext to be encrypted than it is possible that $M^3 < N$ in which case finding the cube-root would be trivial. -The most often suggested value for $e$ is $65537$ since it is large enough to make such attacks impossible and also well +the plaintext to be encrypted than it is possible that $M^3 < N$ in which case finding the cube-root would be trivial. +The most often suggested value for $e$ is $65537$ since it is large enough to make such attacks impossible and also well designed for fast exponentiation (requires 16 squarings and one multiplication). -It is important to pad the input to RSA since it has particular mathematical structure. For instance +It is important to pad the input to RSA since it has particular mathematical structure. For instance $M_1^dM_2^d = (M_1M_2)^d$ which can be used to forge a signature. Suppose $M_3 = M_1M_2$ is a message you want to have a forged signature for. Simply get the signatures for $M_1$ and $M_2$ on their own and multiply the result -together. Similar tricks can be used to deduce plaintexts from ciphertexts. It is important not only to sign -the hash of documents only but also to pad the inputs with data to remove such structure. +together. Similar tricks can be used to deduce plaintexts from ciphertexts. It is important not only to sign +the hash of documents only but also to pad the inputs with data to remove such structure. \subsection{RSA Key Generation} For RSA routines a single \textit{rsa\_key} structure is used. To make a new RSA key call: \index{rsa\_make\_key()} \begin{verbatim} -int rsa_make_key(prng_state *prng, - int wprng, - int size, - long e, +int rsa_make_key(prng_state *prng, + int wprng, + int size, + long e, rsa_key *key); \end{verbatim} Where \textit{wprng} is the index into the PRNG descriptor array. The \textit{size} parameter is the size in bytes of the RSA modulus desired. -The \textit{e} parameter is the encryption exponent desired, typical values are 3, 17, 257 and 65537. Stick with 65537 since it is big enough to prevent -trivial math attacks, and not super slow. The \textit{key} parameter is where the constructed key is placed. All keys must be at +The \textit{e} parameter is the encryption exponent desired, typical values are 3, 17, 257 and 65537. Stick with 65537 since it is big enough to prevent +trivial math attacks, and not super slow. The \textit{key} parameter is where the constructed key is placed. All keys must be at least 128 bytes, and no more than 512 bytes in size (\textit{that is from 1024 to 4096 bits}). \index{rsa\_free()} -Note: the \textit{rsa\_make\_key()} function allocates memory at run--time when you make the key. Make sure to call -\textit{rsa\_free()} (see below) when you are finished with the key. If \textit{rsa\_make\_key()} fails it will automatically +Note: the \textit{rsa\_make\_key()} function allocates memory at run--time when you make the key. Make sure to call +\textit{rsa\_free()} (see below) when you are finished with the key. If \textit{rsa\_make\_key()} fails it will automatically free the memory allocated. \index{PK\_PRIVATE} \index{PK\_PUBLIC} -There are two types of RSA keys. The types are {\bf PK\_PRIVATE} and {\bf PK\_PUBLIC}. The first type is a private -RSA key which includes the CRT parameters\footnote{As of v0.99 the PK\_PRIVATE\_OPTIMIZED type has been deprecated, and has been replaced by the -PK\_PRIVATE type.} in the form of a RSAPrivateKey (PKCS \#1 compliant). The second type, is a public RSA key which only includes the modulus and public exponent. +There are two types of RSA keys. The types are {\bf PK\_PRIVATE} and {\bf PK\_PUBLIC}. The first type is a private +RSA key which includes the CRT parameters\footnote{As of v0.99 the PK\_PRIVATE\_OPTIMIZED type has been deprecated, and has been replaced by the +PK\_PRIVATE type.} in the form of a RSAPrivateKey (PKCS \#1 compliant). The second type, is a public RSA key which only includes the modulus and public exponent. It takes the form of a RSAPublicKey (PKCS \#1 compliant). \subsection{RSA Exponentiation} To do raw work with the RSA function, that is without padding, use the following function: \index{rsa\_exptmod()} \begin{verbatim} -int rsa_exptmod(const unsigned char *in, +int rsa_exptmod(const unsigned char *in, unsigned long inlen, - unsigned char *out, - unsigned long *outlen, - int which, + unsigned char *out, + unsigned long *outlen, + int which, rsa_key *key); \end{verbatim} This will load the bignum from \textit{in} as a big endian integer in the format PKCS \#1 specifies, raises it to either \textit{e} or \textit{d} and stores the result -in \textit{out} and the size of the result in \textit{outlen}. \textit{which} is set to {\bf PK\_PUBLIC} to use \textit{e} +in \textit{out} and the size of the result in \textit{outlen}. \textit{which} is set to {\bf PK\_PUBLIC} to use \textit{e} (i.e. for encryption/verifying) and set to {\bf PK\_PRIVATE} to use \textit{d} as the exponent (i.e. for decrypting/signing). Note: the output of this function is zero--padded as per PKCS \#1 specification. This allows this routine to work with PKCS \#1 padding functions properly. @@ -3384,15 +3384,15 @@ \subsection{RSA Exponentiation} \index{rsa\_encrypt\_key()} \begin{verbatim} int rsa_encrypt_key( - const unsigned char *in, + const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, - const unsigned char *lparam, + const unsigned char *lparam, unsigned long lparamlen, - prng_state *prng, - int prng_idx, - int hash_idx, + prng_state *prng, + int prng_idx, + int hash_idx, rsa_key *key); \end{verbatim} This function will OAEP pad \textit{in} of length \textit{inlen} bytes, RSA encrypt it, and store the ciphertext @@ -3406,16 +3406,16 @@ \subsection{Extended Encryption} \index{rsa\_encrypt\_key\_ex()} \begin{verbatim} int rsa_encrypt_key_ex( - const unsigned char *in, + const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, - const unsigned char *lparam, + const unsigned char *lparam, unsigned long lparamlen, - prng_state *prng, - int prng_idx, - int hash_idx, - int padding, + prng_state *prng, + int prng_idx, + int hash_idx, + int padding, rsa_key *key); \end{verbatim} @@ -3429,13 +3429,13 @@ \subsection{Extended Encryption} \index{rsa\_decrypt\_key()} \begin{verbatim} int rsa_decrypt_key( - const unsigned char *in, + const unsigned char *in, unsigned long inlen, - unsigned char *out, - unsigned long *outlen, - const unsigned char *lparam, + unsigned char *out, + unsigned long *outlen, + const unsigned char *lparam, unsigned long lparamlen, - int hash_idx, + int hash_idx, int *stat, rsa_key *key); \end{verbatim} @@ -3452,19 +3452,19 @@ \subsection{Extended Decryption} \index{rsa\_decrypt\_key\_ex()} \begin{verbatim} int rsa_decrypt_key_ex( - const unsigned char *in, + const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, - const unsigned char *lparam, + const unsigned char *lparam, unsigned long lparamlen, - int hash_idx, + int hash_idx, int padding, int *stat, rsa_key *key); \end{verbatim} -Similar to the extended encryption, the new parameter \textit{padding} indicates which version of the PKCS \#1 standard to use. +Similar to the extended encryption, the new parameter \textit{padding} indicates which version of the PKCS \#1 standard to use. It must be set to \textbf{LTC\_PKCS\_1\_V1\_5} to perform v1.5 decryption, or set to \textbf{LTC\_PKCS\_1\_OAEP} to perform v2.1 decryption. When performing v1.5 decryption, the hash and lparam parameters are totally ignored and can be set to \textbf{NULL} or zero (respectively). @@ -3476,24 +3476,24 @@ \subsection{Extended Decryption} \index{rsa\_sign\_hash()} \begin{verbatim} -int rsa_sign_hash(const unsigned char *in, - unsigned long inlen, - unsigned char *out, - unsigned long *outlen, - prng_state *prng, +int rsa_sign_hash(const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned long *outlen, + prng_state *prng, int prng_idx, - int hash_idx, + int hash_idx, unsigned long saltlen, rsa_key *key); \end{verbatim} -This will PSS encode the message digest pointed to by \textit{in} of length \textit{inlen} octets. Next, the PSS encoded hash will be RSA -\textit{signed} and the output stored in the buffer pointed to by \textit{out} of length \textit{outlen} octets. +This will PSS encode the message digest pointed to by \textit{in} of length \textit{inlen} octets. Next, the PSS encoded hash will be RSA +\textit{signed} and the output stored in the buffer pointed to by \textit{out} of length \textit{outlen} octets. The \textit{hash\_idx} parameter indicates which hash will be used to create the PSS encoding. It should be the same as the hash used to hash the message being signed. The \textit{saltlen} parameter indicates the length of the desired salt, and should typically be small. A good default value is between 8 and 16 octets. Strictly, it must be small than $modulus\_len - hLen - 2$ where \textit{modulus\_len} is the size of -the RSA modulus (in octets), and \textit{hLen} is the length of the message digest produced by the chosen hash. +the RSA modulus (in octets), and \textit{hLen} is the length of the message digest produced by the chosen hash. \subsection{Extended Signatures} @@ -3502,21 +3502,21 @@ \subsection{Extended Signatures} \index{rsa\_sign\_hash\_ex()} \begin{verbatim} int rsa_sign_hash_ex( - const unsigned char *in, + const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, int padding, - prng_state *prng, + prng_state *prng, int prng_idx, - int hash_idx, + int hash_idx, unsigned long saltlen, rsa_key *key); \end{verbatim} -This will PKCS encode the message digest pointed to by \textit{in} of length \textit{inlen} octets. Next, the PKCS encoded hash will be RSA +This will PKCS encode the message digest pointed to by \textit{in} of length \textit{inlen} octets. Next, the PKCS encoded hash will be RSA \textit{signed} and the output stored in the buffer pointed to by \textit{out} of length \textit{outlen} octets. The \textit{padding} parameter -must be set to \textbf{LTC\_PKCS\_1\_V1\_5} to produce a v1.5 signature, otherwise, it must be set to \textbf{LTC\_PKCS\_1\_PSS} to produce a +must be set to \textbf{LTC\_PKCS\_1\_V1\_5} to produce a v1.5 signature, otherwise, it must be set to \textbf{LTC\_PKCS\_1\_PSS} to produce a v2.1 signature. When performing a v1.5 signature the \textit{prng}, \textit{prng\_idx}, and \textit{hash\_idx} parameters are not checked and can be left to any @@ -3525,11 +3525,11 @@ \subsection{Extended Signatures} \mysection{RSA Signature Verification} \index{rsa\_verify\_hash()} \begin{verbatim} -int rsa_verify_hash(const unsigned char *sig, +int rsa_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *msghash, + const unsigned char *msghash, unsigned long msghashlen, - int hash_idx, + int hash_idx, unsigned long saltlen, int *stat, rsa_key *key); @@ -3538,7 +3538,7 @@ \subsection{Extended Signatures} This will RSA \textit{verify} the signature pointed to by \textit{sig} of length \textit{siglen} octets. Next, the RSA decoded data is PSS decoded and the extracted hash is compared against the message digest pointed to by \textit{msghash} of length \textit{msghashlen} octets. -If the RSA decoded data is not a valid PSS message, or if the PSS decoded hash does not match the \textit{msghash} +If the RSA decoded data is not a valid PSS message, or if the PSS decoded hash does not match the \textit{msghash} value, \textit{res} is set to $0$. Otherwise, if the function succeeds, and signature is valid \textit{res} is set to $1$. \subsection{Extended Verification} @@ -3548,24 +3548,24 @@ \subsection{Extended Verification} \index{rsa\_verify\_hash\_ex()} \begin{verbatim} int rsa_verify_hash_ex( - const unsigned char *sig, + const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, + const unsigned char *hash, unsigned long hashlen, int padding, - int hash_idx, + int hash_idx, unsigned long saltlen, - int *stat, + int *stat, rsa_key *key); \end{verbatim} This will RSA \textit{verify} the signature pointed to by \textit{sig} of length \textit{siglen} octets. Next, the RSA decoded data is PKCS decoded and the extracted hash is compared against the message digest pointed to by \textit{msghash} of length \textit{msghashlen} octets. -If the RSA decoded data is not a valid PSS message, or if the PKCS decoded hash does not match the \textit{msghash} +If the RSA decoded data is not a valid PSS message, or if the PKCS decoded hash does not match the \textit{msghash} value, \textit{res} is set to $0$. Otherwise, if the function succeeds, and signature is valid \textit{res} is set to $1$. -The \textit{padding} parameter must be set to \textbf{LTC\_PKCS\_1\_V1\_5} to perform a v1.5 verification. Otherwise, it must be set to +The \textit{padding} parameter must be set to \textbf{LTC\_PKCS\_1\_V1\_5} to perform a v1.5 verification. Otherwise, it must be set to \textbf{LTC\_PKCS\_1\_PSS} to perform a v2.1 verification. When performing a v1.5 verification the \textit{hash\_idx} parameter is ignored. \mysection{RSA Encryption Example} @@ -3633,7 +3633,7 @@ \subsection{Extended Verification} 7, /* lparam is 7 bytes long */ hash_idx, /* hash idx */ &res, /* validity of data */ - &key) /* our RSA key */ + &key) /* our RSA key */ ) != CRYPT_OK) { printf("rsa_decrypt_key %s", error_to_string(err)); return EXIT_FAILURE; @@ -3645,7 +3645,7 @@ \subsection{Extended Verification} \mysection{RSA Key Format} -The RSA key format adopted for exporting and importing keys is the PKCS \#1 format defined by the ASN.1 constructs known as +The RSA key format adopted for exporting and importing keys is the PKCS \#1 format defined by the ASN.1 constructs known as RSAPublicKey and RSAPrivateKey. Additionally, the OpenSSL key format is supported by the import function only. \subsection{RSA Key Export} @@ -3653,12 +3653,12 @@ \subsection{RSA Key Export} \index{rsa\_export()} \begin{verbatim} -int rsa_export(unsigned char *out, - unsigned long *outlen, - int type, +int rsa_export(unsigned char *out, + unsigned long *outlen, + int type, rsa_key *key); \end{verbatim} -This will export the RSA key in either a RSAPublicKey or RSAPrivateKey (PKCS \#1 types) depending on the value of \textit{type}. When it is +This will export the RSA key in either a RSAPublicKey or RSAPrivateKey (PKCS \#1 types) depending on the value of \textit{type}. When it is set to \textbf{PK\_PRIVATE} the export format will be RSAPrivateKey and otherwise it will be RSAPublicKey. \subsection{RSA Key Import} @@ -3666,8 +3666,8 @@ \subsection{RSA Key Import} \index{rsa\_import()} \begin{verbatim} -int rsa_import(const unsigned char *in, - unsigned long inlen, +int rsa_import(const unsigned char *in, + unsigned long inlen, rsa_key *key); \end{verbatim} @@ -3676,7 +3676,7 @@ \subsection{RSA Key Import} As of v1.06 this function can also import OpenSSL DER formatted public RSA keys. They are essentially encapsulated RSAPublicKeys. LibTomCrypt will import the key, strip off the additional data (it's the preferred hash) and fill in the rsa\_key structure as if it were a native RSAPublicKey. Note that -there is no function provided to export in this format. +there is no function provided to export in this format. \chapter{Diffie-Hellman Key Exchange} @@ -3684,73 +3684,73 @@ \chapter{Diffie-Hellman Key Exchange} \section{Background} Diffie-Hellman was the original public key system proposed. The system is based upon the group structure -of finite fields. For Diffie-Hellman a prime $p$ is chosen and a ``base'' $b$ such that $b^x\mbox{ }(\mbox{mod }p)$ +of finite fields. For Diffie-Hellman a prime $p$ is chosen and a ``base'' $b$ such that $b^x\mbox{ }(\mbox{mod }p)$ generates a large sub-group of prime order (for unique values of $x$). A secret key is an exponent $x$ and a public key is the value of $y \equiv g^x\mbox{ }(\mbox{mod }p)$. The term ``discrete logarithm'' denotes the action of finding $x$ given only $y$, $g$ and $p$. The key exchange part of -Diffie-Hellman arises from the fact that two users A and B with keys $(A_x, A_y)$ and $(B_x, B_y)$ can exchange +Diffie-Hellman arises from the fact that two users A and B with keys $(A_x, A_y)$ and $(B_x, B_y)$ can exchange a shared key $K \equiv B_y^{A_x} \equiv A_y^{B_x} \equiv g^{A_xB_x}\mbox{ }(\mbox{mod }p)$. -From this public encryption and signatures can be developed. The trivial way to encrypt (for example) using a public key -$y$ is to perform the key exchange offline. The sender invents a key $k$ and its public copy +From this public encryption and signatures can be developed. The trivial way to encrypt (for example) using a public key +$y$ is to perform the key exchange offline. The sender invents a key $k$ and its public copy $k' \equiv g^k\mbox{ }(\mbox{mod }p)$ and uses $K \equiv k'^{A_x}\mbox{ }(\mbox{mod }p)$ as a key to encrypt -the message with. Typically $K$ would be sent to a one-way hash and the message digested used as a key in a +the message with. Typically $K$ would be sent to a one-way hash and the message digested used as a key in a symmetric cipher. It is important that the order of the sub-group that $g$ generates not only be large but also prime. There are discrete logarithm algorithms that take $\sqrt r$ time given the order $r$. The discrete logarithm can be computed -modulo each prime factor of $r$ and the results combined using the Chinese Remainder Theorem. In the cases where +modulo each prime factor of $r$ and the results combined using the Chinese Remainder Theorem. In the cases where $r$ is ``B-Smooth'' (e.g. all small factors or powers of small prime factors) the solution is trivial to find. To thwart such attacks the primes and bases in the library have been designed and fixed. Given a prime $p$ the order of - the sub-group generated is a large prime namely ${p - 1} \over 2$. Such primes are known as ``strong primes'' and the + the sub-group generated is a large prime namely ${p - 1} \over 2$. Such primes are known as ``strong primes'' and the smaller prime (e.g. the order of the base) are known as Sophie-Germaine primes. \section{Core Functions} -This library also provides core Diffie-Hellman functions so you can negotiate keys over insecure mediums. The routines +This library also provides core Diffie-Hellman functions so you can negotiate keys over insecure mediums. The routines provided are relatively easy to use and only take two function calls to negotiate a shared key. There is a structure called ``dh\_key'' which stores the Diffie-Hellman key in a format these routines can use. The first routine is to make a Diffie-Hellman private key pair: \index{dh\_make\_key()} \begin{verbatim} -int dh_make_key(prng_state *prng, int wprng, +int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key); \end{verbatim} -The ``keysize'' is the size of the modulus you want in bytes. Currently support sizes are 96 to 512 bytes which correspond -to key sizes of 768 to 4096 bits. The smaller the key the faster it is to use however it will be less secure. When -specifying a size not explicitly supported by the library it will round {\em up} to the next key size. If the size is -above 512 it will return an error. So if you pass ``keysize == 32'' it will use a 768 bit key but if you pass -``keysize == 20000'' it will return an error. The primes and generators used are built-into the library and were designed +The ``keysize'' is the size of the modulus you want in bytes. Currently support sizes are 96 to 512 bytes which correspond +to key sizes of 768 to 4096 bits. The smaller the key the faster it is to use however it will be less secure. When +specifying a size not explicitly supported by the library it will round {\em up} to the next key size. If the size is +above 512 it will return an error. So if you pass ``keysize == 32'' it will use a 768 bit key but if you pass +``keysize == 20000'' it will return an error. The primes and generators used are built-into the library and were designed to meet very specific goals. The primes are strong primes which means that if $p$ is the prime then $p-1$ is equal to $2r$ where $r$ is a large prime. The bases are chosen to generate a group of order $r$ to prevent leaking a bit of the key. This means the bases generate a very large prime order group which is good to make cryptanalysis hard. The next two routines are for exporting/importing Diffie-Hellman keys in a binary format. This is useful for transport -over communication mediums. +over communication mediums. \index{dh\_export()} \index{dh\_import()} \begin{verbatim} -int dh_export(unsigned char *out, unsigned long *outlen, +int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key); int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); \end{verbatim} -These two functions work just like the ``rsa\_export()'' and ``rsa\_import()'' functions except these work with -Diffie-Hellman keys. Its important to note you do not have to free the ram for a ``dh\_key'' if an import fails. You can free a +These two functions work just like the ``rsa\_export()'' and ``rsa\_import()'' functions except these work with +Diffie-Hellman keys. Its important to note you do not have to free the ram for a ``dh\_key'' if an import fails. You can free a ``dh\_key'' using: \begin{verbatim} void dh_free(dh_key *key); \end{verbatim} -After you have exported a copy of your public key (using {\bf PK\_PUBLIC} as ``type'') you can now create a shared secret +After you have exported a copy of your public key (using {\bf PK\_PUBLIC} as ``type'') you can now create a shared secret with the other user using: \index{dh\_shared\_secret()} \begin{verbatim} -int dh_shared_secret(dh_key *private_key, - dh_key *public_key, +int dh_shared_secret(dh_key *private_key, + dh_key *public_key, unsigned char *out, unsigned long *outlen); \end{verbatim} @@ -3765,12 +3765,12 @@ \section{Core Functions} This returns the size in bytes of the modulus chosen for that key. \subsection{Remarks on Usage} -Its important that you hash the shared key before trying to use it as a key for a symmetric cipher or something. An +Its important that you hash the shared key before trying to use it as a key for a symmetric cipher or something. An example program that communicates over sockets, using MD5 and 1024-bit DH keys is\footnote{This function is a small example. It is suggested that proper packaging be used. For example, if the public key sent is truncated these routines will not detect that.}: \newpage \begin{small} \begin{verbatim} -int establish_secure_socket(int sock, int mode, unsigned char *key, +int establish_secure_socket(int sock, int mode, unsigned char *key, prng_state *prng, int wprng) { unsigned char buf[4096], buf2[4096]; @@ -3783,7 +3783,7 @@ \subsection{Remarks on Usage} return err; } - /* export our key as public */ + /* export our key as public */ x = sizeof(buf); if ((err = dh_export(buf, &x, PK_PUBLIC, &mykey)) != CRYPT_OK) { res = err; @@ -3795,7 +3795,7 @@ \subsection{Remarks on Usage} if (send(sock, buf, x, 0) != x) { res = CRYPT_ERROR; goto done2; - } + } /* get their key */ if ((inlen = recv(sock, buf2, sizeof(buf2), 0)) <= 0) { @@ -3815,7 +3815,7 @@ \subsection{Remarks on Usage} } } - if ((err = dh_import(buf2, inlen, &theirkey)) != CRYPT_OK) { + if ((err = dh_import(buf2, inlen, &theirkey)) != CRYPT_OK) { res = err; goto done2; } @@ -3826,7 +3826,7 @@ \subsection{Remarks on Usage} res = err; goto done; } - + /* hash it */ len = 16; /* default is MD5 so "key" must be at least 16 bytes long */ if ((err = hash_memory(find_hash("md5"), buf, x, key, &len)) != CRYPT_OK) { @@ -3859,7 +3859,7 @@ \section{Other Diffie-Hellman Functions} int dh_test(void); \end{verbatim} -This function returns {\bf CRYPT\_OK} if the bases and primes in the library are correct. There is one last helper +This function returns {\bf CRYPT\_OK} if the bases and primes in the library are correct. There is one last helper function: \index{dh\_sizes()} \begin{verbatim} @@ -3869,20 +3869,20 @@ \section{Other Diffie-Hellman Functions} \section{DH Packet} Similar to the RSA related functions there are functions to encrypt or decrypt symmetric keys using the DH public key -algorithms. +algorithms. \index{dh\_encrypt\_key()} \index{dh\_decrypt\_key()} \begin{verbatim} int dh_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *len, - prng_state *prng, int wprng, int hash, + unsigned char *out, unsigned long *len, + prng_state *prng, int wprng, int hash, dh_key *key); int dh_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, + unsigned char *out, unsigned long *outlen, dh_key *key); \end{verbatim} Where ``in'' is an input symmetric key of no more than 32 bytes. Essentially these routines created a random public key -and find the hash of the shared secret. The message digest is than XOR'ed against the symmetric key. All of the +and find the hash of the shared secret. The message digest is than XOR'ed against the symmetric key. All of the required data is placed in ``out'' by ``dh\_encrypt\_key()''. The hash must produce a message digest at least as large as the symmetric key you are trying to share. @@ -3894,18 +3894,18 @@ \section{DH Packet} prng_state *prng, int wprng, dh_key *key); int dh_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, + const unsigned char *hash, unsigned long hashlen, int *stat, dh_key *key); \end{verbatim} -The ``dh\_sign\_hash'' function signs the message hash in ``in'' of length ``inlen'' and forms a DH packet in ``out''. +The ``dh\_sign\_hash'' function signs the message hash in ``in'' of length ``inlen'' and forms a DH packet in ``out''. The ``dh\_verify\_hash'' function verifies the DH signature in ``sig'' against the hash in ``hash''. It sets ``stat'' to non-zero if the signature passes or zero if it fails. \chapter{Elliptic Curve Cryptography} \mysection{Background} -The library provides a set of core ECC functions as well that are designed to be the Elliptic Curve analogy of all of the +The library provides a set of core ECC functions as well that are designed to be the Elliptic Curve analogy of all of the Diffie-Hellman routines in the previous chapter. Elliptic curves (of certain forms) have the benefit that they are harder to attack (no sub-exponential attacks exist unlike normal DH crypto) in fact the fastest attack requires the square root of the order of the base point in time. That means if you use a base point of order $2^{192}$ (which would represent a @@ -3916,7 +3916,7 @@ \chapter{Elliptic Curve Cryptography} http://csrc.nist.gov/cryptval/dss.htm \end{verbatim} -As of v1.15 three new curves from the SECG standards are also included they are the secp112r1, secp128r1, and secp160r1 curves. These curves were added to +As of v1.15 three new curves from the SECG standards are also included they are the secp112r1, secp128r1, and secp160r1 curves. These curves were added to support smaller devices which do not need as large keys for security. They are all curves over the integers modulo a prime. The curves have the basic equation that is: @@ -3924,19 +3924,19 @@ \chapter{Elliptic Curve Cryptography} y^2 = x^3 - 3x + b\mbox{ }(\mbox{mod }p) \end{equation} -The variable $b$ is chosen such that the number of points is nearly maximal. In fact the order of the base points $\beta$ +The variable $b$ is chosen such that the number of points is nearly maximal. In fact the order of the base points $\beta$ provided are very close to $p$ that is $\vert \vert \phi(\beta) \vert \vert \approx \vert \vert p \vert \vert$. The curves range in order from $\approx 2^{112}$ points to $\approx 2^{521}$. According to the source document any key size greater -than or equal to 256-bits is sufficient for long term security. +than or equal to 256-bits is sufficient for long term security. \mysection{Fixed Point Optimizations} \index{Fixed Point ECC} \index{MECC\_FP} As of v1.12 of LibTomCrypt, support for Fixed Point ECC point multiplication has been added. It is a generic optimization that is -supported by any conforming math plugin. It is enabled by defining \textbf{MECC\_FP} during the build, such as +supported by any conforming math plugin. It is enabled by defining \textbf{MECC\_FP} during the build, such as \begin{verbatim} -CFLAGS="-DTFM_DESC -DMECC_FP" make +CFLAGS="-DTFM_DESC -DMECC_FP" make \end{verbatim} which will build LTC using the TFM math library and enabling this new feature. The feature is not enabled by default as it is \textbf{NOT} thread @@ -3945,11 +3945,11 @@ \chapter{Elliptic Curve Cryptography} \index{FP\_ENTRIES} The optimization works by using a Fixed Point multiplier on any base point you use twice or more in a short period of time. It has a limited size cache (of FP\_ENTRIES entries) which it uses to hold recent bases passed to ltc\_ecc\_mulmod(). Any base detected to be used twice is sent through the -pre--computation phase, and then the fixed point algorithm can be used. For example, if you use a NIST base point twice in a row, the 2$^{nd}$ and +pre--computation phase, and then the fixed point algorithm can be used. For example, if you use a NIST base point twice in a row, the 2$^{nd}$ and all subsequent point multiplications with that point will use the faster algorithm. \index{FP\_LUT} -The optimization uses a window on the multiplicand of FP\_LUT bits (default: 8, min: 2, max: 12), and this controls the memory/time trade-off. The larger the +The optimization uses a window on the multiplicand of FP\_LUT bits (default: 8, min: 2, max: 12), and this controls the memory/time trade-off. The larger the value the faster the algorithm will be but the more memory it will take. The memory usage is $3 \cdot 2^{FP\_LUT}$ integers which by default with TFM amounts to about 400kB of memory. Tuning TFM (by changing FP\_SIZE) can decrease the usage by a fair amount. Memory is only used by a cache entry if it is active. Both FP\_ENTRIES and FP\_LUT are definable on the command line if you wish to override them. For instance, @@ -3958,7 +3958,7 @@ \chapter{Elliptic Curve Cryptography} CFLAGS="-DTFM_DESC -DMECC_FP -DFP_ENTRIES=8 -DFP_LUT=6" make \end{verbatim} -\begin{flushleft} +\begin{flushleft} \index{FP\_SIZE} \index{TFM} \index{tfm.h} would define a window of 6 bits and limit the cache to 8 entries. Generally, it is better to first tune TFM by adjusting FP\_SIZE (from tfm.h). It defaults to 4096 bits (512 bytes) which is way more than what is required by ECC. At most, you need 1152 bits to accommodate ECC--521. If you're only using (say) @@ -3973,16 +3973,16 @@ \chapter{Elliptic Curve Cryptography} \begin{small} \begin{verbatim} ECCPublicKey ::= SEQUENCE { - flags BIT STRING(0), -- public/private flag (always zero), - keySize INTEGER, -- Curve size (in bits) divided by eight + flags BIT STRING(0), -- public/private flag (always zero), + keySize INTEGER, -- Curve size (in bits) divided by eight -- and rounded down, e.g. 521 => 65 pubkey.x INTEGER, -- The X co-ordinate of the public key point pubkey.y INTEGER, -- The Y co-ordinate of the public key point } ECCPrivateKey ::= SEQUENCE { - flags BIT STRING(1), -- public/private flag (always one), - keySize INTEGER, -- Curve size (in bits) divided by eight + flags BIT STRING(1), -- public/private flag (always one), + keySize INTEGER, -- Curve size (in bits) divided by eight -- and rounded down, e.g. 521 => 65 pubkey.x INTEGER, -- The X co-ordinate of the public key point pubkey.y INTEGER, -- The Y co-ordinate of the public key point @@ -3991,13 +3991,13 @@ \chapter{Elliptic Curve Cryptography} \end{verbatim} \end{small} -The first flags bit denotes whether the key is public (zero) or private (one). +The first flags bit denotes whether the key is public (zero) or private (one). \vfil \mysection{ECC Curve Parameters} The library uses the following structure to describe an elliptic curve. This is used internally, as well as by the new -extended ECC functions which allow the user to specify their own curves. +extended ECC functions which allow the user to specify their own curves. \index{ltc\_ecc\_set\_type} \begin{verbatim} @@ -4007,7 +4007,7 @@ \chapter{Elliptic Curve Cryptography} int size; /** name of curve */ - char *name; + char *name; /** The prime that defines the field (encoded in hex) */ char *prime; @@ -4017,10 +4017,10 @@ \chapter{Elliptic Curve Cryptography} /** The order of the curve (hex) */ char *order; - + /** The x co-ordinate of the base point on the curve (hex) */ char *Gx; - + /** The y co-ordinate of the base point on the curve (hex) */ char *Gy; } ltc_ecc_set_type; @@ -4033,14 +4033,14 @@ \subsection{ECC Key Generation} There is a key structure called \textit{ecc\_key} used by the ECC functions. There is a function to make a key: \index{ecc\_make\_key()} \begin{verbatim} -int ecc_make_key(prng_state *prng, - int wprng, - int keysize, +int ecc_make_key(prng_state *prng, + int wprng, + int keysize, ecc_key *key); \end{verbatim} The \textit{keysize} is the size of the modulus in bytes desired. Currently directly supported values are 12, 16, 20, 24, 28, 32, 48, and 65 bytes which -correspond to key sizes of 112, 128, 160, 192, 224, 256, 384, and 521 bits respectively. If you pass a key size that is between any key size it will round +correspond to key sizes of 112, 128, 160, 192, 224, 256, 384, and 521 bits respectively. If you pass a key size that is between any key size it will round the keysize up to the next available one. The function will free any internally allocated resources if there is an error. @@ -4051,9 +4051,9 @@ \subsection{Extended Key Generation} \index{ecc\_make\_key\_ex()} \begin{verbatim} int ecc_make_key_ex( - prng_state *prng, - int wprng, - ecc_key *key, + prng_state *prng, + int wprng, + ecc_key *key, const ltc_ecc_set_type *dp); \end{verbatim} @@ -4071,19 +4071,19 @@ \subsection{ECC Key Export} To export an ECC key using the LibTomCrypt format call the following function: \index{ecc\_export()} \begin{verbatim} -int ecc_export(unsigned char *out, - unsigned long *outlen, - int type, +int ecc_export(unsigned char *out, + unsigned long *outlen, + int type, ecc_key *key); \end{verbatim} -This will export the key with the given \textit{type} (\textbf{PK\_PUBLIC} or \textbf{PK\_PRIVATE}), and store it to \textit{out}. +This will export the key with the given \textit{type} (\textbf{PK\_PUBLIC} or \textbf{PK\_PRIVATE}), and store it to \textit{out}. \subsection{ECC Key Import} The following function imports a LibTomCrypt format ECC key: \index{ecc\_import()} \begin{verbatim} -int ecc_import(const unsigned char *in, - unsigned long inlen, +int ecc_import(const unsigned char *in, + unsigned long inlen, ecc_key *key); \end{verbatim} This will import the ECC key from \textit{in}, and store it in the ecc\_key structure pointed to by \textit{key}. If the operation fails it will free @@ -4094,9 +4094,9 @@ \subsection{Extended Key Import} The following function imports a LibTomCrypt format ECC key using a specified set of curve parameters: \index{ecc\_import\_ex()} \begin{verbatim} -int ecc_import_ex(const unsigned char *in, - unsigned long inlen, - ecc_key *key, +int ecc_import_ex(const unsigned char *in, + unsigned long inlen, + ecc_key *key, const ltc_ecc_set_type *dp); \end{verbatim} This will import the key from the array pointed to by \textit{in} of length \textit{inlen} octets. The key is stored in @@ -4108,8 +4108,8 @@ \subsection{ANSI X9.63 Export} \index{ecc\_ansi\_x963\_export()} \begin{verbatim} -int ecc_ansi_x963_export( ecc_key *key, - unsigned char *out, +int ecc_ansi_x963_export( ecc_key *key, + unsigned char *out, unsigned long *outlen); \end{verbatim} The ECC key pointed to by \textit{key} is exported in public fashion to the array pointed to by \textit{out}. The ANSI X9.63 format used is from @@ -4120,11 +4120,11 @@ \subsection{ANSI X9.63 Import} \index{ecc\_ansi\_x963\_import()} \begin{verbatim} -int ecc_ansi_x963_import(const unsigned char *in, - unsigned long inlen, +int ecc_ansi_x963_import(const unsigned char *in, + unsigned long inlen, ecc_key *key); \end{verbatim} -This will import the key stored in the array pointed to by \textit{in} of length \textit{inlen} octets. The imported key is stored in the ECC key pointed to by +This will import the key stored in the array pointed to by \textit{in} of length \textit{inlen} octets. The imported key is stored in the ECC key pointed to by \textit{key}. The function will free any allocated memory upon error. \subsection{Extended ANSI X9.63 Import} @@ -4132,25 +4132,25 @@ \subsection{Extended ANSI X9.63 Import} \index{ecc\_ansi\_x963\_import\_ex()} \begin{verbatim} -int ecc_ansi_x963_import_ex(const unsigned char *in, - unsigned long inlen, - ecc_key *key, +int ecc_ansi_x963_import_ex(const unsigned char *in, + unsigned long inlen, + ecc_key *key, ltc_ecc_set_type *dp); \end{verbatim} -This will import the key stored in the array pointed to by \textit{in} of length \textit{inlen} octets using the domain parameters pointed to by \textit{dp}. +This will import the key stored in the array pointed to by \textit{in} of length \textit{inlen} octets using the domain parameters pointed to by \textit{dp}. The imported key is stored in the ECC key pointed to by \textit{key}. The function will free any allocated memory upon error. \subsection{ECC Shared Secret} To construct a Diffie-Hellman shared secret with a private and public ECC key, use the following function: \index{ecc\_shared\_secret()} \begin{verbatim} -int ecc_shared_secret( ecc_key *private_key, - ecc_key *public_key, - unsigned char *out, +int ecc_shared_secret( ecc_key *private_key, + ecc_key *public_key, + unsigned char *out, unsigned long *outlen); \end{verbatim} -The \textit{private\_key} is typically the local private key, and \textit{public\_key} is the key the remote party has shared. -Note: this function stores only the $x$ co-ordinate of the shared elliptic point as described in ANSI X9.63 ECC--DH. +The \textit{private\_key} is typically the local private key, and \textit{public\_key} is the key the remote party has shared. +Note: this function stores only the $x$ co-ordinate of the shared elliptic point as described in ANSI X9.63 ECC--DH. \mysection{ECC Diffie-Hellman Encryption} ECC--DH Encryption is performed by producing a random key, hashing it, and XOR'ing the digest against the plaintext. It is not strictly ANSI X9.63 compliant @@ -4162,29 +4162,29 @@ \subsection{ECC-DH Encryption} \begin{verbatim} int ecc_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, - unsigned long *outlen, - prng_state *prng, - int wprng, - int hash, + unsigned char *out, + unsigned long *outlen, + prng_state *prng, + int wprng, + int hash, ecc_key *key); \end{verbatim} -As the name implies this function encrypts a (symmetric) key, and is not intended for encrypting long messages directly. It will encrypt the +As the name implies this function encrypts a (symmetric) key, and is not intended for encrypting long messages directly. It will encrypt the plaintext in the array pointed to by \textit{in} of length \textit{inlen} octets. It uses the public ECC key pointed to by \textit{key}, and hash algorithm indexed by \textit{hash} to construct a shared secret which may be XOR'ed against the plaintext. The ciphertext is stored in the output buffer pointed to by \textit{out} of length \textit{outlen} octets. -The data is encrypted to the public ECC \textit{key} such that only the holder of the private key can decrypt the payload. To have multiple +The data is encrypted to the public ECC \textit{key} such that only the holder of the private key can decrypt the payload. To have multiple recipients multiple call to this function for each public ECC key is required. \subsection{ECC-DH Decryption} \index{ecc\_decrypt\_key()} \begin{verbatim} -int ecc_decrypt_key(const unsigned char *in, +int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, - unsigned long *outlen, + unsigned char *out, + unsigned long *outlen, ecc_key *key); \end{verbatim} @@ -4199,7 +4199,7 @@ \subsection{ECC Encryption Format} ECCEncrypt ::= SEQUENCE { hashID OBJECT IDENTIFIER, -- OID of hash used pubkey OCTET STRING , -- Encapsulated ECCPublicKey - skey OCTET STRING -- xor of plaintext and + skey OCTET STRING -- xor of plaintext and --"hash of shared secret" } \end{verbatim} @@ -4207,58 +4207,58 @@ \subsection{ECC Encryption Format} \mysection{EC DSA Signatures} There are also functions to sign and verify messages. They use the ANSI X9.62 EC-DSA algorithm to generate and verify signatures in the -ANSI X9.62 format. +ANSI X9.62 format. \subsection{EC-DSA Signature Generation} To sign a message digest (hash) use the following function: \index{ecc\_sign\_hash()} \begin{verbatim} -int ecc_sign_hash(const unsigned char *in, +int ecc_sign_hash(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, - prng_state *prng, - int wprng, + prng_state *prng, + int wprng, ecc_key *key); \end{verbatim} This function will EC--DSA sign the message digest stored in the array pointed to by \textit{in} of length \textit{inlen} octets. The signature -will be stored in the array pointed to by \textit{out} of length \textit{outlen} octets. The function requires a properly seeded PRNG, and +will be stored in the array pointed to by \textit{out} of length \textit{outlen} octets. The function requires a properly seeded PRNG, and the ECC \textit{key} provided must be a private key. \subsection{EC-DSA Signature Verification} \index{ecc\_verify\_hash()} \begin{verbatim} -int ecc_verify_hash(const unsigned char *sig, +int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, - unsigned long hashlen, - int *stat, + const unsigned char *hash, + unsigned long hashlen, + int *stat, ecc_key *key); \end{verbatim} -This function will verify the EC-DSA signature in the array pointed to by \textit{sig} of length \textit{siglen} octets, against the message digest -pointed to by the array \textit{hash} of length \textit{hashlen}. It will store a non--zero value in \textit{stat} if the signature is valid. Note: -the function will not return an error if the signature is invalid. It will return an error, if the actual signature payload is an invalid format. +This function will verify the EC-DSA signature in the array pointed to by \textit{sig} of length \textit{siglen} octets, against the message digest +pointed to by the array \textit{hash} of length \textit{hashlen}. It will store a non--zero value in \textit{stat} if the signature is valid. Note: +the function will not return an error if the signature is invalid. It will return an error, if the actual signature payload is an invalid format. The ECC \textit{key} must be the public (or private) ECC key corresponding to the key that performed the signature. \subsection{Signature Format} The signature code is an implementation of X9.62 EC--DSA, and the output is compliant for GF(p) curves. \mysection{ECC Keysizes} -With ECC if you try to sign a hash that is bigger than your ECC key you can run into problems. The math will still work, and in effect the signature will still -work. With ECC keys the strength of the signature is limited by the size of the hash, or the size of they key, whichever is smaller. For example, if you sign with -SHA256 and an ECC-192 key, you in effect have 96--bits of security. +With ECC if you try to sign a hash that is bigger than your ECC key you can run into problems. The math will still work, and in effect the signature will still +work. With ECC keys the strength of the signature is limited by the size of the hash, or the size of they key, whichever is smaller. For example, if you sign with +SHA256 and an ECC-192 key, you in effect have 96--bits of security. The library will not warn you if you make this mistake, so it is important to check yourself before using the signatures. \chapter{Digital Signature Algorithm} \mysection{Introduction} -The Digital Signature Algorithm (or DSA) is a variant of the ElGamal Signature scheme which has been modified to -reduce the bandwidth of the signatures. For example, to have \textit{80-bits of security} with ElGamal, you need a group with an order of at least 1024--bits. -With DSA, you need a group of order at least 160--bits. By comparison, the ElGamal signature would require at least 256 bytes of storage, whereas the DSA signature -would require only at least 40 bytes. +The Digital Signature Algorithm (or DSA) is a variant of the ElGamal Signature scheme which has been modified to +reduce the bandwidth of the signatures. For example, to have \textit{80-bits of security} with ElGamal, you need a group with an order of at least 1024--bits. +With DSA, you need a group of order at least 160--bits. By comparison, the ElGamal signature would require at least 256 bytes of storage, whereas the DSA signature +would require only at least 40 bytes. \mysection{Key Format} Since no useful public standard for DSA key storage was presented to me during the course of this development I made my own ASN.1 SEQUENCE which I document @@ -4270,11 +4270,11 @@ \chapter{Digital Signature Algorithm} g INTEGER , -- base generator -- check that g^q mod p == 1 -- and that 1 < g < p - 1 - p INTEGER , -- prime modulus - q INTEGER , -- order of sub-group + p INTEGER , -- prime modulus + q INTEGER , -- order of sub-group -- (must be prime) - y INTEGER , -- public key, specifically, - -- g^x mod p, + y INTEGER , -- public key, specifically, + -- g^x mod p, -- check that y^q mod p == 1 -- and that 1 < y < p - 1 } @@ -4284,32 +4284,32 @@ \chapter{Digital Signature Algorithm} g INTEGER , -- base generator -- check that g^q mod p == 1 -- and that 1 < g < p - 1 - p INTEGER , -- prime modulus - q INTEGER , -- order of sub-group + p INTEGER , -- prime modulus + q INTEGER , -- order of sub-group -- (must be prime) - y INTEGER , -- public key, specifically, - -- g^x mod p, + y INTEGER , -- public key, specifically, + -- g^x mod p, -- check that y^q mod p == 1 -- and that 1 < y < p - 1 x INTEGER -- private key } \end{verbatim} -The leading BIT STRING has a single bit in it which is zero for public keys and one for private keys. This makes the structure uniquely decodable, +The leading BIT STRING has a single bit in it which is zero for public keys and one for private keys. This makes the structure uniquely decodable, and easy to work with. \mysection{Key Generation} To make a DSA key you must call the following function \begin{verbatim} -int dsa_make_key(prng_state *prng, - int wprng, - int group_size, - int modulus_size, +int dsa_make_key(prng_state *prng, + int wprng, + int group_size, + int modulus_size, dsa_key *key); \end{verbatim} -The variable \textit{prng} is an active PRNG state and \textit{wprng} the index to the descriptor. \textit{group\_size} and +The variable \textit{prng} is an active PRNG state and \textit{wprng} the index to the descriptor. \textit{group\_size} and \textit{modulus\_size} control the difficulty of forging a signature. Both parameters are in bytes. The larger the -\textit{group\_size} the more difficult a forgery becomes upto a limit. The value of $group\_size$ is limited by +\textit{group\_size} the more difficult a forgery becomes upto a limit. The value of $group\_size$ is limited by $15 < group\_size < 1024$ and $modulus\_size - group\_size < 512$. Suggested values for the pairs are as follows. \begin{figure}[here] @@ -4336,11 +4336,11 @@ \chapter{Digital Signature Algorithm} Each DSA key is composed of the following variables. \begin{enumerate} - \item $q$ a small prime of magnitude $256^{group\_size}$. + \item $q$ a small prime of magnitude $256^{group\_size}$. \item $p = qr + 1$ a large prime of magnitude $256^{modulus\_size}$ where $r$ is a random even integer. - \item $g = h^r \mbox{ (mod }p\mbox{)}$ a generator of order $q$ modulo $p$. $h$ can be any non-trivial random + \item $g = h^r \mbox{ (mod }p\mbox{)}$ a generator of order $q$ modulo $p$. $h$ can be any non-trivial random value. For this library they start at $h = 2$ and step until $g$ is not $1$. - \item $x$ a random secret (the secret key) in the range $1 < x < q$ + \item $x$ a random secret (the secret key) in the range $1 < x < q$ \item $y = g^x \mbox{ (mod }p\mbox{)}$ the public key. \end{enumerate} @@ -4357,12 +4357,12 @@ \chapter{Digital Signature Algorithm} \item $y^q \equiv 1 \mbox{ (mod }p\mbox{)}$. \end{enumerate} -Tests one and two ensure that the values will at least form a field which is required for the signatures to +Tests one and two ensure that the values will at least form a field which is required for the signatures to function. Tests three and four ensure that the generator $g$ is not set to a trivial value which would make signature forgery easier. Test five ensures that $q$ divides the order of multiplicative sub-group of $\Z/p\Z$. Test six ensures that the generator actually generates a prime order group. Tests seven and eight ensure that the public key is within range and belongs to a group of prime order. Note that test eight does not prove that $g$ generated $y$ only -that $y$ belongs to a multiplicative sub-group of order $q$. +that $y$ belongs to a multiplicative sub-group of order $q$. The following function will perform these tests. @@ -4380,12 +4380,12 @@ \subsection{Signature Generation} \index{dsa\_sign\_hash()} \begin{verbatim} -int dsa_sign_hash(const unsigned char *in, +int dsa_sign_hash(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen, - prng_state *prng, - int wprng, + prng_state *prng, + int wprng, dsa_key *key); \end{verbatim} @@ -4396,17 +4396,17 @@ \subsection{Signature Generation} \subsection{Signature Verification} To verify a hash created with that function use the following function: -\index{dsa\_verify\_hash()} +\index{dsa\_verify\_hash()} \begin{verbatim} -int dsa_verify_hash(const unsigned char *sig, +int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, - unsigned long inlen, - int *stat, + const unsigned char *hash, + unsigned long inlen, + int *stat, dsa_key *key); \end{verbatim} -Which will verify the data in \textit{hash} of length \textit{inlen} against the signature stored in \textit{sig} of length \textit{siglen}. -It will set \textit{stat} to $1$ if the signature is valid, otherwise it sets \textit{stat} to $0$. +Which will verify the data in \textit{hash} of length \textit{inlen} against the signature stored in \textit{sig} of length \textit{siglen}. +It will set \textit{stat} to $1$ if the signature is valid, otherwise it sets \textit{stat} to $0$. \mysection{DSA Encrypt and Decrypt} As of version 1.07, the DSA keys can be used to encrypt and decrypt small payloads. It works similar to the ECC encryption where @@ -4418,31 +4418,31 @@ \subsection{DSA Encryption} \index{dsa\_encrypt\_key()} \begin{verbatim} -int dsa_encrypt_key(const unsigned char *in, +int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, - unsigned long *outlen, - prng_state *prng, - int wprng, - int hash, + unsigned char *out, + unsigned long *outlen, + prng_state *prng, + int wprng, + int hash, dsa_key *key); \end{verbatim} This will encrypt the payload in \textit{in} of length \textit{inlen} and store the ciphertext in the output buffer \textit{out}. The -length of the ciphertext \textit{outlen} must be originally set to the length of the output buffer. The DSA \textit{key} can be +length of the ciphertext \textit{outlen} must be originally set to the length of the output buffer. The DSA \textit{key} can be a public key. \subsection{DSA Decryption} \index{dsa\_decrypt\_key()} -\begin{verbatim} -int dsa_decrypt_key(const unsigned char *in, +\begin{verbatim} +int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, - unsigned long *outlen, + unsigned char *out, + unsigned long *outlen, dsa_key *key); \end{verbatim} -This will decrypt the ciphertext \textit{in} of length \textit{inlen}, and store the original payload in \textit{out} of length \textit{outlen}. +This will decrypt the ciphertext \textit{in} of length \textit{inlen}, and store the original payload in \textit{out} of length \textit{outlen}. The DSA \textit{key} must be a private key. \mysection{DSA Key Import and Export} @@ -4451,9 +4451,9 @@ \subsection{DSA Key Export} To export a DSA key so that it can be transported use the following function: \index{dsa\_export()} \begin{verbatim} -int dsa_export(unsigned char *out, - unsigned long *outlen, - int type, +int dsa_export(unsigned char *out, + unsigned long *outlen, + int type, dsa_key *key); \end{verbatim} This will export the DSA \textit{key} to the buffer \textit{out} and set the length in \textit{outlen} (which must have been previously @@ -4465,21 +4465,21 @@ \subsection{DSA Key Import} : \index{dsa\_import()} \begin{verbatim} -int dsa_import(const unsigned char *in, - unsigned long inlen, +int dsa_import(const unsigned char *in, + unsigned long inlen, dsa_key *key); \end{verbatim} This will import the DSA key from the buffer \textit{in} of length \textit{inlen} to the \textit{key}. If the process fails the function -will automatically free all of the heap allocated in the process (you don't have to call dsa\_free()). +will automatically free all of the heap allocated in the process (you don't have to call dsa\_free()). \chapter{Standards Support} \mysection{ASN.1 Formats} LibTomCrypt supports a variety of ASN.1 data types encoded with the Distinguished Encoding Rules (DER) suitable for various cryptographic protocols. The data types are all provided with three basic functions with \textit{similar} prototypes. One function has been dedicated to calculate the length in octets of a given -format, and two functions have been dedicated to encoding and decoding the format. +format, and two functions have been dedicated to encoding and decoding the format. -On top of the basic data types are the SEQUENCE and SET data types which are collections of other ASN.1 types. They are provided +On top of the basic data types are the SEQUENCE and SET data types which are collections of other ASN.1 types. They are provided in the same manner as the other data types except they use list of objects known as the \textbf{ltc\_asn1\_list} structure. It is defined as the following: \index{ltc\_asn1\_list structure} @@ -4489,13 +4489,13 @@ \chapter{Standards Support} void *data; unsigned long size; int used; - struct ltc_asn1_list_ *prev, *next, + struct ltc_asn1_list_ *prev, *next, *child, *parent; } ltc_asn1_list; \end{verbatim} \index{LTC\_SET\_ASN1 macro} -The \textit{type} field is one of the following ASN.1 field definitions. The \textit{data} pointer is a void pointer to the data to be encoded (or the destination) and the +The \textit{type} field is one of the following ASN.1 field definitions. The \textit{data} pointer is a void pointer to the data to be encoded (or the destination) and the \textit{size} field is specific to what you are encoding (e.g. number of bits in the BIT STRING data type). The \textit{used} field is primarily for the CHOICE decoder and reflects if the particular member of a list was the decoded data type. To help build the lists in an orderly fashion the macro \textit{LTC\_SET\_ASN1(list, index, Type, Data, Size)} has been provided. @@ -4565,9 +4565,9 @@ \subsubsection{SEQUENCE Encoding} \index{der\_encode\_sequence()} \begin{verbatim} -int der_encode_sequence(ltc_asn1_list *list, +int der_encode_sequence(ltc_asn1_list *list, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); \end{verbatim} This encodes a sequence of items pointed to by \textit{list} where the list has \textit{inlen} items in it. The SEQUENCE will be encoded to \textit{out} and of length \textit{outlen}. The @@ -4581,14 +4581,14 @@ \subsubsection{SEQUENCE Decoding} \index{der\_decode\_sequence()} -Decoding a SEQUENCE is similar to encoding. You set up an array of \textbf{ltc\_asn1\_list} where in this case the \textit{size} member is the maximum size +Decoding a SEQUENCE is similar to encoding. You set up an array of \textbf{ltc\_asn1\_list} where in this case the \textit{size} member is the maximum size (in certain cases). For types such as IA5 STRING, BIT STRING, OCTET STRING (etc) the \textit{size} field is updated after successful decoding to reflect how many -units of the respective type has been loaded. +units of the respective type has been loaded. \begin{verbatim} int der_decode_sequence(const unsigned char *in, unsigned long inlen, - ltc_asn1_list *list, + ltc_asn1_list *list, unsigned long outlen); \end{verbatim} @@ -4610,12 +4610,12 @@ \subsubsection{SEQUENCE Length} \index{der\_length\_sequence()} \begin{verbatim} -int der_length_sequence(ltc_asn1_list *list, +int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, unsigned long *outlen); \end{verbatim} -This will get the encoding size for the given \textit{list} of length \textit{inlen} and store it in \textit{outlen}. +This will get the encoding size for the given \textit{list} of length \textit{inlen} and store it in \textit{outlen}. \subsubsection{SEQUENCE Multiple Argument Lists} @@ -4625,10 +4625,10 @@ \subsubsection{SEQUENCE Multiple Argument Lists} \index{der\_decode\_sequence\_multi()} \begin{verbatim} -int der_encode_sequence_multi(unsigned char *out, +int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...); -int der_decode_sequence_multi(const unsigned char *in, +int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...); \end{verbatim} @@ -4647,7 +4647,7 @@ \subsubsection{SEQUENCE Multiple Argument Lists} int err; buflen = sizeof(buf); - if ((err = + if ((err = der_encode_sequence_multi(buf, &buflen, LTC_ASN1_IA5_STRING, 5UL, "Hello", LTC_ASN1_IA5_STRING, 7UL, " World!", @@ -4664,7 +4664,7 @@ \subsection{SET and SET OF} \index{SET} \index{SET OF} SET and SET OF are related to the SEQUENCE type in that they can be pretty much be decoded with the same code. However, they are different, and they should -be carefully noted. The SET type is an unordered array of ASN.1 types sorted by the TAG (type identifier), whereas the SET OF type is an ordered array of +be carefully noted. The SET type is an unordered array of ASN.1 types sorted by the TAG (type identifier), whereas the SET OF type is an ordered array of a \textbf{single} ASN.1 object sorted in ascending order by the DER their respective encodings. \subsubsection{SET Encoding} @@ -4673,14 +4673,14 @@ \subsubsection{SET Encoding} \index{der\_encode\_set()} \begin{verbatim} -int der_encode_set(ltc_asn1_list *list, +int der_encode_set(ltc_asn1_list *list, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -\end{verbatim} +\end{verbatim} -This will encode the list of ASN.1 objects in \textit{list} of length \textit{inlen} objects, and store the output in \textit{out} of length \textit{outlen} bytes. -The function will make a copy of the list provided, and sort it by the TAG. Objects with identical TAGs are additionally sorted on their original placement in the +This will encode the list of ASN.1 objects in \textit{list} of length \textit{inlen} objects, and store the output in \textit{out} of length \textit{outlen} bytes. +The function will make a copy of the list provided, and sort it by the TAG. Objects with identical TAGs are additionally sorted on their original placement in the array (to make the process deterministic). This function will \textbf{NOT} recognize \textit{DEFAULT} objects, and it is the responsibility of the caller to remove them as required. @@ -4691,39 +4691,39 @@ \subsubsection{SET Decoding} \index{der\_decode\_set()} \begin{verbatim} -int der_decode_set(const unsigned char *in, +int der_decode_set(const unsigned char *in, unsigned long inlen, - ltc_asn1_list *list, + ltc_asn1_list *list, unsigned long outlen); \end{verbatim} This will decode the SET specified by \textit{list} of length \textit{outlen} objects from the input buffer \textit{in} of length \textit{inlen} octets. -It handles the fact that SETs are not strictly ordered and will make multiple passes (as required) through the list to decode all the objects. +It handles the fact that SETs are not strictly ordered and will make multiple passes (as required) through the list to decode all the objects. \subsubsection{SET Length} The length of a SET can be determined by calling der\_length\_sequence() since they have the same encoding length. \subsubsection{SET OF Encoding} -A \textit{SET OF} object is an array of identical objects (e.g. OCTET STRING) sorted in ascending order by the DER encoding of the object. They are +A \textit{SET OF} object is an array of identical objects (e.g. OCTET STRING) sorted in ascending order by the DER encoding of the object. They are used to store objects deterministically based solely on their encoding. It uses the same array structure of ltc\_asn1\_list that the SEQUENCE functions use. They are encoded with the following function. \index{der\_encode\_setof()} \begin{verbatim} -int der_encode_setof(ltc_asn1_list *list, +int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); \end{verbatim} This will encode a \textit{SET OF} containing the \textit{list} of \textit{inlen} ASN.1 objects and store the encoding in the output buffer \textit{out} of length \textit{outlen}. The routine will first encode the SET OF in an unordered fashion (in a temporary buffer) then sort using the XQSORT macro and copy back to the output buffer. This -means you need at least enough memory to keep an additional copy of the output on the heap. +means you need at least enough memory to keep an additional copy of the output on the heap. \subsubsection{SET OF Decoding} -Since the decoding of a \textit{SET OF} object is unambiguous it can be decoded with der\_decode\_sequence(). +Since the decoding of a \textit{SET OF} object is unambiguous it can be decoded with der\_decode\_sequence(). \subsubsection{SET OF Length} Like the SET type the der\_length\_sequence() function can be used to determine the length of a \textit{SET OF} object. @@ -4734,15 +4734,15 @@ \subsection{ASN.1 INTEGER} \index{der\_encode\_integer()}\index{der\_decode\_integer()}\index{der\_length\_integer()} \begin{verbatim} -int der_encode_integer( void *num, - unsigned char *out, +int der_encode_integer( void *num, + unsigned char *out, unsigned long *outlen); -int der_decode_integer(const unsigned char *in, - unsigned long inlen, +int der_decode_integer(const unsigned char *in, + unsigned long inlen, void *num); -int der_length_integer( void *num, +int der_length_integer( void *num, unsigned long *len); \end{verbatim} @@ -4751,36 +4751,36 @@ \subsection{ASN.1 INTEGER} \index{der\_encode\_short\_integer()}\index{der\_decode\_short\_integer()}\index{der\_length\_short\_integer()} \begin{verbatim} -int der_encode_short_integer(unsigned long num, - unsigned char *out, +int der_encode_short_integer(unsigned long num, + unsigned char *out, unsigned long *outlen); -int der_decode_short_integer(const unsigned char *in, - unsigned long inlen, +int der_decode_short_integer(const unsigned char *in, + unsigned long inlen, unsigned long *num); -int der_length_short_integer(unsigned long num, +int der_length_short_integer(unsigned long num, unsigned long *outlen); \end{verbatim} -These will encode or decode an unsigned \textbf{unsigned long} type (only reads upto 32--bits). For values in the range $0 \dots 2^{32} - 1$ the integer -and short integer functions can encode and decode each others outputs. +These will encode or decode an unsigned \textbf{unsigned long} type (only reads upto 32--bits). For values in the range $0 \dots 2^{32} - 1$ the integer +and short integer functions can encode and decode each others outputs. \subsection{ASN.1 BIT STRING} \index{der\_encode\_bit\_string()}\index{der\_decode\_bit\_string()}\index{der\_length\_bit\_string()} \begin{verbatim} -int der_encode_bit_string(const unsigned char *in, +int der_encode_bit_string(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_decode_bit_string(const unsigned char *in, +int der_decode_bit_string(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_length_bit_string(unsigned long nbits, +int der_length_bit_string(unsigned long nbits, unsigned long *outlen); \end{verbatim} @@ -4791,65 +4791,65 @@ \subsection{ASN.1 OCTET STRING} \index{der\_encode\_octet\_string()}\index{der\_decode\_octet\_string()}\index{der\_length\_octet\_string()} \begin{verbatim} -int der_encode_octet_string(const unsigned char *in, +int der_encode_octet_string(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_decode_octet_string(const unsigned char *in, +int der_decode_octet_string(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_length_octet_string(unsigned long noctets, +int der_length_octet_string(unsigned long noctets, unsigned long *outlen); \end{verbatim} -These will encode or decode an OCTET STRING data type. The octets are stored using one \textbf{unsigned char} each. +These will encode or decode an OCTET STRING data type. The octets are stored using one \textbf{unsigned char} each. \subsection{ASN.1 OBJECT IDENTIFIER} \index{der\_encode\_object\_identifier()}\index{der\_decode\_object\_identifier()}\index{der\_length\_object\_identifier()} \begin{verbatim} -int der_encode_object_identifier(unsigned long *words, +int der_encode_object_identifier(unsigned long *words, unsigned long nwords, - unsigned char *out, + unsigned char *out, unsigned long *outlen); int der_decode_object_identifier(const unsigned char *in, unsigned long inlen, - unsigned long *words, + unsigned long *words, unsigned long *outlen); -int der_length_object_identifier(unsigned long *words, - unsigned long nwords, +int der_length_object_identifier(unsigned long *words, + unsigned long nwords, unsigned long *outlen); \end{verbatim} These will encode or decode an OBJECT IDENTIFIER object. The words of the OID are stored in individual \textbf{unsigned long} elements, and must be in the range -$0 \ldots 2^{32} - 1$. +$0 \ldots 2^{32} - 1$. \subsection{ASN.1 IA5 STRING} \index{der\_encode\_ia5\_string()}\index{der\_decode\_ia5\_string()}\index{der\_length\_ia5\_string()} \begin{verbatim} -int der_encode_ia5_string(const unsigned char *in, +int der_encode_ia5_string(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_decode_ia5_string(const unsigned char *in, +int der_decode_ia5_string(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_length_ia5_string(const unsigned char *octets, - unsigned long noctets, +int der_length_ia5_string(const unsigned char *octets, + unsigned long noctets, unsigned long *outlen); \end{verbatim} These will encode or decode an IA5 STRING. The characters are read or stored in individual \textbf{char} elements. These functions performs internal character -to numerical conversions based on the conventions of the compiler being used. For instance, on an x86\_32 machine 'A' == 65 but the same may not be true on +to numerical conversions based on the conventions of the compiler being used. For instance, on an x86\_32 machine 'A' == 65 but the same may not be true on say a SPARC machine. Internally, these functions have a table of literal characters and their numerical ASCII values. This provides a stable conversion provided that the build platform honours the run--time platforms character conventions. @@ -4857,23 +4857,23 @@ \subsection{ASN.1 PRINTABLE STRING} \index{der\_encode\_printable\_string()}\index{der\_decode\_printable\_string()}\index{der\_length\_printable\_string()} \begin{verbatim} -int der_encode_printable_string(const unsigned char *in, +int der_encode_printable_string(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_decode_printable_string(const unsigned char *in, +int der_decode_printable_string(const unsigned char *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_length_printable_string(const unsigned char *octets, - unsigned long noctets, +int der_length_printable_string(const unsigned char *octets, + unsigned long noctets, unsigned long *outlen); \end{verbatim} These will encode or decode an PRINTABLE STRING. The characters are read or stored in individual \textbf{char} elements. These functions performs internal character -to numerical conversions based on the conventions of the compiler being used. For instance, on an x86\_32 machine 'A' == 65 but the same may not be true on +to numerical conversions based on the conventions of the compiler being used. For instance, on an x86\_32 machine 'A' == 65 but the same may not be true on say a SPARC machine. Internally, these functions have a table of literal characters and their numerical ASCII values. This provides a stable conversion provided that the build platform honours the run-time platforms character conventions. @@ -4881,25 +4881,25 @@ \subsection{ASN.1 UTF8 STRING} \index{der\_encode\_utf8\_string()}\index{der\_decode\_utf8\_string()}\index{der\_length\_utf8\_string()} \begin{verbatim} -int der_encode_utf8_string(const wchar_t *in, +int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, - unsigned char *out, + unsigned char *out, unsigned long *outlen); -int der_decode_utf8_string(const unsigned char *in, +int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, - wchar_t *out, + wchar_t *out, unsigned long *outlen); -int der_length_utf8_string(const wchar_t *octets, - unsigned long noctets, +int der_length_utf8_string(const wchar_t *octets, + unsigned long noctets, unsigned long *outlen); \end{verbatim} These will encode or decode an UTF8 STRING. The characters are read or stored in individual \textbf{wchar\_t} elements. These function performs no internal -mapping and treat the characters as literals. +mapping and treat the characters as literals. -These functions use the \textbf{wchar\_t} type which is not universally available. In those cases, the library will typedef it to \textbf{unsigned long}. If you +These functions use the \textbf{wchar\_t} type which is not universally available. In those cases, the library will typedef it to \textbf{unsigned long}. If you intend to use the ISO C functions for working with wide--char arrays, you should make sure that wchar\_t has been defined previously. \subsection{ASN.1 UTCTIME} @@ -4921,47 +4921,47 @@ \subsection{ASN.1 UTCTIME} } ltc_utctime; \end{verbatim} -The time can be offset plus or minus a set amount of hours (off\_hh) and minutes (off\_mm). When \textit{off\_dir} is zero, the time will be added otherwise it -will be subtracted. For instance, the array $\lbrace 5, 6, 20, 22, 4, 00, 0, 5, 0 \rbrace$ represents the current time of -\textit{2005, June 20th, 22:04:00} with a time offset of +05h00. +The time can be offset plus or minus a set amount of hours (off\_hh) and minutes (off\_mm). When \textit{off\_dir} is zero, the time will be added otherwise it +will be subtracted. For instance, the array $\lbrace 5, 6, 20, 22, 4, 00, 0, 5, 0 \rbrace$ represents the current time of +\textit{2005, June 20th, 22:04:00} with a time offset of +05h00. \index{der\_encode\_utctime()}\index{der\_decode\_utctime()}\index{der\_length\_utctime()} \begin{verbatim} -int der_encode_utctime( ltc_utctime *utctime, - unsigned char *out, +int der_encode_utctime( ltc_utctime *utctime, + unsigned char *out, unsigned long *outlen); -int der_decode_utctime(const unsigned char *in, +int der_decode_utctime(const unsigned char *in, unsigned long *inlen, ltc_utctime *out); -int der_length_utctime( ltc_utctime *utctime, +int der_length_utctime( ltc_utctime *utctime, unsigned long *outlen); \end{verbatim} -The encoder will store time in one of the two ASN.1 formats, either \textit{YYMMDDhhmmssZ} or \textit{YYMMDDhhmmss$\pm$hhmm}, and perform minimal error checking on the +The encoder will store time in one of the two ASN.1 formats, either \textit{YYMMDDhhmmssZ} or \textit{YYMMDDhhmmss$\pm$hhmm}, and perform minimal error checking on the input. The decoder will read all valid ASN.1 formats and perform range checking on the values (not complete but rational) useful for catching packet errors. It is suggested that decoded data be further scrutinized (e.g. days of month in particular). \subsection{ASN.1 CHOICE} -The CHOICE ASN.1 type represents a union of ASN.1 types all of which are stored in a \textit{ltc\_asn1\_list}. There is no encoder for the CHOICE type, only a +The CHOICE ASN.1 type represents a union of ASN.1 types all of which are stored in a \textit{ltc\_asn1\_list}. There is no encoder for the CHOICE type, only a decoder. The decoder will scan through the provided list attempting to use the appropriate decoder on the input packet. The list can contain any ASN.1 data -type\footnote{Except it cannot have LTC\_ASN1\_INTEGER and LTC\_ASN1\_SHORT\_INTEGER simultaneously.} except for other CHOICE types. +type\footnote{Except it cannot have LTC\_ASN1\_INTEGER and LTC\_ASN1\_SHORT\_INTEGER simultaneously.} except for other CHOICE types. -There is no encoder for the CHOICE type as the actual DER encoding is the encoding of the chosen type. +There is no encoder for the CHOICE type as the actual DER encoding is the encoding of the chosen type. \index{der\_decode\_choice()} \begin{verbatim} -int der_decode_choice(const unsigned char *in, +int der_decode_choice(const unsigned char *in, unsigned long *inlen, - ltc_asn1_list *list, + ltc_asn1_list *list, unsigned long outlen); \end{verbatim} -This will decode the input in the \textit{in} field of length \textit{inlen}. It uses the provided ASN.1 list specified in the \textit{list} field which has -\textit{outlen} elements. The \textit{inlen} field will be updated with the length of the decoded data type, as well as the respective entry in the \textit{list} field +This will decode the input in the \textit{in} field of length \textit{inlen}. It uses the provided ASN.1 list specified in the \textit{list} field which has +\textit{outlen} elements. The \textit{inlen} field will be updated with the length of the decoded data type, as well as the respective entry in the \textit{list} field will have the \textit{used} flag set to non--zero to reflect it was the data type decoded. \subsection{ASN.1 Flexi Decoder} @@ -4969,17 +4969,17 @@ \subsection{ASN.1 Flexi Decoder} the structure of the data. Where der\_decode \_sequence() requires the developer to specify the data types to decode in advance the flexi decoder is entirely free form. -The flexi decoder uses the same \textit{ltc\_asn1\_list} but instead of being stored in an array it uses the linked list pointers \textit{prev}, \textit{next}, \textit{parent} +The flexi decoder uses the same \textit{ltc\_asn1\_list} but instead of being stored in an array it uses the linked list pointers \textit{prev}, \textit{next}, \textit{parent} and \textit{child}. The list works as a \textit{doubly-linked list} structure where decoded items at the same level are siblings (using next and prev) and items encoded in a SEQUENCE are stored as a child element. -When a SEQUENCE or SET has been encountered a SEQUENCE (or SET resp.) item will be added as a sibling (e.g. list.type == LTC\_ASN1\_SEQUENCE) and the child +When a SEQUENCE or SET has been encountered a SEQUENCE (or SET resp.) item will be added as a sibling (e.g. list.type == LTC\_ASN1\_SEQUENCE) and the child pointer points to a new list of items contained within the object. \index{der\_decode\_sequence\_flexi()} \begin{verbatim} -int der_decode_sequence_flexi(const unsigned char *in, - unsigned long *inlen, +int der_decode_sequence_flexi(const unsigned char *in, + unsigned long *inlen, ltc_asn1_list **out); \end{verbatim} @@ -4987,12 +4987,12 @@ \subsection{ASN.1 Flexi Decoder} all required memory for the decoding. It stores the number of octets read back into \textit{inlen}. The function will terminate when either it hits an invalid ASN.1 tag, or it reads \textit{inlen} octets. An early termination is a soft error, and returns -normally. The decoded list \textit{out} will point to the very first element of the list (e.g. both parent and prev pointers will be \textbf{NULL}). +normally. The decoded list \textit{out} will point to the very first element of the list (e.g. both parent and prev pointers will be \textbf{NULL}). -An invalid decoding will terminate the process, and free the allocated memory automatically. +An invalid decoding will terminate the process, and free the allocated memory automatically. \textbf{Note:} the list decoded by this function is \textbf{NOT} in the correct form for der\_encode\_sequence() to use directly. You will first -have to convert the list by first storing all of the siblings in an array then storing all the children as sub-lists of a sequence using the \textit{.data} +have to convert the list by first storing all of the siblings in an array then storing all the children as sub-lists of a sequence using the \textit{.data} pointer. Currently no function in LibTomCrypt provides this ability. \subsubsection{Sample Decoding} @@ -5049,7 +5049,7 @@ \subsubsection{Sample Decoding} list = list->parent->next; \end{verbatim} \end{small} -At this point, we are pointing to the last node of the list. Lists are terminated in all directions by a \textbf{NULL} pointer. All nodes are doubly linked so that you +At this point, we are pointing to the last node of the list. Lists are terminated in all directions by a \textbf{NULL} pointer. All nodes are doubly linked so that you can walk up and down the nodes without keeping pointers lying around. @@ -5077,22 +5077,22 @@ \subsection{PKCS \#5} \subsection{Algorithm One} Algorithm One accepts as input a password, an 8--byte salt, and an iteration counter. The iteration counter is meant to act as delay for -people trying to brute force guess the password. The higher the iteration counter the longer the delay. This algorithm also requires a hash -algorithm and produces an output no longer than the output of the hash. +people trying to brute force guess the password. The higher the iteration counter the longer the delay. This algorithm also requires a hash +algorithm and produces an output no longer than the output of the hash. \index{pkcs\_5\_alg1()} \begin{alltt} -int pkcs_5_alg1(const unsigned char *password, - unsigned long password_len, - const unsigned char *salt, - int iteration_count, +int pkcs_5_alg1(const unsigned char *password, + unsigned long password_len, + const unsigned char *salt, + int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen) \end{alltt} -Where \textit{password} is the user's password. Since the algorithm allows binary passwords you must also specify the length in \textit{password\_len}. +Where \textit{password} is the user's password. Since the algorithm allows binary passwords you must also specify the length in \textit{password\_len}. The \textit{salt} is a fixed size 8--byte array which should be random for each user and session. The \textit{iteration\_count} is the delay desired -on the password. The \textit{hash\_idx} is the index of the hash you wish to use in the descriptor table. +on the password. The \textit{hash\_idx} is the index of the hash you wish to use in the descriptor table. The output of length up to \textit{outlen} is stored in \textit{out}. If \textit{outlen} is initially larger than the size of the hash functions output it is set to the number of bytes stored. If it is smaller than not all of the hash output is stored in \textit{out}. @@ -5110,28 +5110,28 @@ \subsection{Algorithm One} As above, but we generate as many bytes as requested in outlen per the OpenSSL extension to Algorithm One. If you are trying to be compatible with OpenSSL's EVP\_BytesToKey() or the "openssl enc" command line (or variants such as perl's Crypt::CBC), then use this function with MD5 as your hash (ick!) and iteration\_count=1 (double-ick!!). \subsection{Algorithm Two} -Algorithm Two is the recommended algorithm for this task. It allows variable length salts, and can produce outputs larger than the +Algorithm Two is the recommended algorithm for this task. It allows variable length salts, and can produce outputs larger than the hash functions output. As such, it can easily be used to derive session keys for ciphers and MACs as well initial vectors as required from a single password and invocation of this algorithm. \index{pkcs\_5\_alg2()} \begin{alltt} int pkcs_5_alg2(const unsigned char *password, - unsigned long password_len, + unsigned long password_len, const unsigned char *salt, unsigned long salt_len, - int iteration_count, + int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen) \end{alltt} -Where \textit{password} is the users password. Since the algorithm allows binary passwords you must also specify the length in \textit{password\_len}. +Where \textit{password} is the users password. Since the algorithm allows binary passwords you must also specify the length in \textit{password\_len}. The \textit{salt} is an array of size \textit{salt\_len}. It should be random for each user and session. The \textit{iteration\_count} is the delay desired -on the password. The \textit{hash\_idx} is the index of the hash you wish to use in the descriptor table. The output of length up to +on the password. The \textit{hash\_idx} is the index of the hash you wish to use in the descriptor table. The output of length up to \textit{outlen} is stored in \textit{out}. \begin{verbatim} -/* demo to show how to make session state material +/* demo to show how to make session state material * from a password */ #include int main(void) @@ -5148,9 +5148,9 @@ \subsection{Algorithm Two} /* create the material (100 iterations in algorithm) */ outlen = sizeof(outbuf); - if ((err = pkcs_5_alg2(password, password_len, salt, - salt_len, 100, hash_idx, outbuf, - &outlen)) + if ((err = pkcs_5_alg2(password, password_len, salt, + salt_len, 100, hash_idx, outbuf, + &outlen)) != CRYPT_OK) { /* error handle */ } @@ -5248,7 +5248,7 @@ \chapter{Miscellaneous} \end{verbatim} Those characters are supported in the 7-bit ASCII map, which means they can be used for transport over common e-mail, usenet and HTTP mediums. The format of an encoded stream is just a literal sequence of ASCII characters -where a group of four represent 24-bits of input. The first four chars of the encoders output is the length of the +where a group of four represent 24-bits of input. The first four chars of the encoders output is the length of the original input. After the first four characters is the rest of the message. Often, it is desirable to line wrap the output to fit nicely in an e-mail or usenet posting. The decoder allows you to @@ -5256,30 +5256,30 @@ \chapter{Miscellaneous} break up the first four characters. To encode a binary string in base64 call: -\index{base64\_encode()} \index{base64\_decode()} +\index{base64\_encode()} \index{base64\_decode()} \begin{verbatim} -int base64_encode(const unsigned char *in, - unsigned long len, - unsigned char *out, +int base64_encode(const unsigned char *in, + unsigned long len, + unsigned char *out, unsigned long *outlen); \end{verbatim} Where \textit{in} is the binary string and \textit{out} is where the ASCII output is placed. You must set the value of \textit{outlen} prior -to calling this function and it sets the length of the base64 output in \textit{outlen} when it is done. To decode a base64 +to calling this function and it sets the length of the base64 output in \textit{outlen} when it is done. To decode a base64 string call: \begin{verbatim} -int base64_decode(const unsigned char *in, - unsigned long len, - unsigned char *out, +int base64_decode(const unsigned char *in, + unsigned long len, + unsigned char *out, unsigned long *outlen); \end{verbatim} \mysection{Primality Testing} \index{Primality Testing} The library includes primality testing and random prime functions as well. The primality tester will perform the test in -two phases. First it will perform trial division by the first few primes. Second it will perform eight rounds of the +two phases. First it will perform trial division by the first few primes. Second it will perform eight rounds of the Rabin-Miller primality testing algorithm. If the candidate passes both phases it is declared prime otherwise it is declared composite. No prime number will fail the two phases but composites can. Each round of the Rabin-Miller algorithm reduces -the probability of a pseudo-prime by $1 \over 4$ therefore after sixteen rounds the probability is no more than +the probability of a pseudo-prime by $1 \over 4$ therefore after sixteen rounds the probability is no more than $\left ( { 1 \over 4 } \right )^{8} = 2^{-16}$. In practice the probability of error is in fact much lower than that. When making random primes the trial division step is in fact an optimized implementation of \textit{Implementation of Fast RSA Key Generation on Smart Cards}\footnote{Chenghuai Lu, Andre L. M. dos Santos and Francisco R. Pimentel}. @@ -5288,29 +5288,29 @@ \chapter{Miscellaneous} math operations. As a result the routine can scan ahead to the next number required for testing with very little work involved. -In the event that a composite did make it through it would most likely cause the the algorithm trying to use it to fail. For -instance, in RSA two primes $p$ and $q$ are required. The order of the multiplicative sub-group (modulo $pq$) is given +In the event that a composite did make it through it would most likely cause the the algorithm trying to use it to fail. For +instance, in RSA two primes $p$ and $q$ are required. The order of the multiplicative sub-group (modulo $pq$) is given as $\phi(pq)$ or $(p - 1)(q - 1)$. The decryption exponent $d$ is found as $de \equiv 1\mbox{ }(\mbox{mod } \phi(pq))$. If either $p$ or $q$ is composite the value of $d$ will be incorrect and the user -will not be able to sign or decrypt messages at all. Suppose $p$ was prime and $q$ was composite this is just a variation of -the multi-prime RSA. Suppose $q = rs$ for two primes $r$ and $s$ then $\phi(pq) = (p - 1)(r - 1)(s - 1)$ which clearly is +will not be able to sign or decrypt messages at all. Suppose $p$ was prime and $q$ was composite this is just a variation of +the multi-prime RSA. Suppose $q = rs$ for two primes $r$ and $s$ then $\phi(pq) = (p - 1)(r - 1)(s - 1)$ which clearly is not equal to $(p - 1)(rs - 1)$. -These are not technically part of the LibTomMath library but this is the best place to document them. +These are not technically part of the LibTomMath library but this is the best place to document them. To test if a \textit{mp\_int} is prime call: \begin{verbatim} int is_prime(mp_int *N, int *result); \end{verbatim} -This puts a one in \textit{result} if the number is probably prime, otherwise it places a zero in it. It is assumed that if -it returns an error that the value in \textit{result} is undefined. To make +This puts a one in \textit{result} if the number is probably prime, otherwise it places a zero in it. It is assumed that if +it returns an error that the value in \textit{result} is undefined. To make a random prime call: \begin{verbatim} -int rand_prime( mp_int *N, - unsigned long len, - prng_state *prng, +int rand_prime( mp_int *N, + unsigned long len, + prng_state *prng, int wprng); \end{verbatim} Where \textit{len} is the size of the prime in bytes ($2 \le len \le 256$). You can set \textit{len} to the negative size you want -to get a prime of the form $p \equiv 3\mbox{ }(\mbox{mod } 4)$. So if you want a 1024-bit prime of this sort pass +to get a prime of the form $p \equiv 3\mbox{ }(\mbox{mod } 4)$. So if you want a 1024-bit prime of this sort pass \textit{len = -128} to the function. Upon success it will return {\bf CRYPT\_OK} and \textit{N} will contain an integer which is very likely prime. @@ -5319,28 +5319,28 @@ \chapter{Programming Guidelines} \mysection{Secure Pseudo Random Number Generators} Probably the single most vulnerable point of any cryptosystem is the PRNG. Without one, generating and protecting secrets would be impossible. The requirement that one be setup correctly is vitally important, and to address this point the library -does provide two RNG sources that will address the largest amount of end users as possible. The \textit{sprng} PRNG provides an easy to -access source of entropy for any application on a UNIX (and the like) or Windows computer. +does provide two RNG sources that will address the largest amount of end users as possible. The \textit{sprng} PRNG provides an easy to +access source of entropy for any application on a UNIX (and the like) or Windows computer. However, when the end user is not on one of these platforms, the application developer must address the issue of finding entropy. This manual is not designed to be a text on cryptography. I would just like to highlight that when you design -a cryptosystem make sure the first problem you solve is getting a fresh source of entropy. +a cryptosystem make sure the first problem you solve is getting a fresh source of entropy. \mysection{Preventing Trivial Errors} Two simple ways to prevent trivial errors is to prevent overflows, and to check the return values. All of the functions which output variable length strings will require you to pass the length of the destination. If the size of your output buffer is smaller than the output it will report an error. Therefore, make sure the size you pass is correct! -Also, virtually all of the functions return an error code or {\bf CRYPT\_OK}. You should detect all errors, as simple +Also, virtually all of the functions return an error code or {\bf CRYPT\_OK}. You should detect all errors, as simple typos can cause algorithms to fail to work as desired. \mysection{Registering Your Algorithms} -To avoid linking and other run--time errors it is important to register the ciphers, hashes and PRNGs you intend to use +To avoid linking and other run--time errors it is important to register the ciphers, hashes and PRNGs you intend to use before you try to use them. This includes any function which would use an algorithm indirectly through a descriptor table. -A neat bonus to the registry system is that you can add external algorithms that are not part of the library without -having to hack the library. For example, suppose you have a hardware specific PRNG on your system. You could easily -write the few functions required plus a descriptor. After registering your PRNG, all of the library functions that +A neat bonus to the registry system is that you can add external algorithms that are not part of the library without +having to hack the library. For example, suppose you have a hardware specific PRNG on your system. You could easily +write the few functions required plus a descriptor. After registering your PRNG, all of the library functions that need a PRNG can instantly take advantage of it. The same applies for ciphers, hashes, and bignum math routines. \mysection{Key Sizes} @@ -5353,10 +5353,10 @@ \subsection{Asymmetric Ciphers} The following chart gives the work factor for solving a DH/RSA public key using the NFS. The work factor for a key of order $n$ is estimated to be \begin{equation} -e^{1.923 \cdot ln(n)^{1 \over 3} \cdot ln(ln(n))^{2 \over 3}} +e^{1.923 \cdot ln(n)^{1 \over 3} \cdot ln(ln(n))^{2 \over 3}} \end{equation} -Note that $n$ is not the bit-length but the magnitude. For example, for a 1024-bit key $n = 2^{1024}$. The work required +Note that $n$ is not the bit-length but the magnitude. For example, for a 1024-bit key $n = 2^{1024}$. The work required is: \begin{figure}[here] \begin{center} @@ -5370,7 +5370,7 @@ \subsection{Asymmetric Ciphers} \hline 2560 & 128.47 \\ \hline 3072 & 138.73 \\ \hline 4096 & 156.49 \\ - \hline + \hline \end{tabular} \end{center} \caption{RSA/DH Key Strength} @@ -5403,7 +5403,7 @@ \subsection{Asymmetric Ciphers} \hline Near term & 1024 & 160 \\ \hline Short term & 1536 & 192 \\ \hline Long Term & 2560 & 384 \\ - \hline + \hline \end{tabular} \end{center} @@ -5414,7 +5414,7 @@ \subsection{Asymmetric Ciphers} The rest of the code uses state variables you must pass it such as hash\_state, hmac\_state, etc. This means that if each thread has its own state variables then they will not affect each other, and are fully thread safe. This is fairly simple with symmetric ciphers -and hashes. +and hashes. \index{LTC\_PTHREAD} The only sticky issue is a shared PRNG which can be alleviated with the careful use of mutex devices. Defining LTC\_PTHREAD for instance, enables @@ -5431,17 +5431,17 @@ \chapter{Configuring and Building the Library} The build process now consists of installing a math library first, and then building and installing LibTomCrypt with a math library configured. Note that LibTomCrypt can be built with no internal math descriptors. This means that one must be provided at either -build, or run time for the application. LibTomCrypt comes with three math descriptors that provide a standard interface to math +build, or run time for the application. LibTomCrypt comes with three math descriptors that provide a standard interface to math libraries. \mysection{Makefile variables} -All GNU driven makefiles (including the makefile for ICC) use a set of common variables to control the build and install process. Most of the +All GNU driven makefiles (including the makefile for ICC) use a set of common variables to control the build and install process. Most of the settings can be overwritten from the command line which makes custom installation a breeze. \index{MAKE}\index{CC}\index{AR} \subsection{MAKE, CC and AR} -The MAKE, CC and AR flags can all be overwritten. They default to \textit{make}, \textit{\$CC} and \textit{\$AR} respectively. +The MAKE, CC and AR flags can all be overwritten. They default to \textit{make}, \textit{\$CC} and \textit{\$AR} respectively. Changing MAKE allows you to change what program will be invoked to handle sub--directories. For example, this \begin{verbatim} @@ -5451,7 +5451,7 @@ \subsection{MAKE, CC and AR} \begin{flushleft} will build and install the libraries with the \textit{gmake} tool. Similarly, \end{flushleft} \begin{verbatim} -CC=arm-gcc AR=arm-ar make +CC=arm-gcc AR=arm-ar make \end{verbatim} \begin{flushleft} will build the library using \textit{arm--gcc} as the compiler and \textit{arm--ar} as the archiver. \end{flushleft} @@ -5465,7 +5465,7 @@ \subsection{IGNORE\_SPEED} CFLAGS="-g3" make IGNORE_SPEED=1 \end{verbatim} -This will turn off optimizations and add \textit{-g3} to the CFLAGS which enables debugging. +This will turn off optimizations and add \textit{-g3} to the CFLAGS which enables debugging. \subsection{LIBNAME and LIBNAME\_S} \index{LIBNAME} \index{LIBNAME\_S} @@ -5473,13 +5473,13 @@ \subsection{LIBNAME and LIBNAME\_S} shared. The \textbf{LIBNAME\_S} variable is the static name while doing shared builds. Ideally they should have the same prefix but don't have to. \index{LIBTEST} \index{LIBTEST\_S} -Similarly \textbf{LIBTEST} and \textbf{LIBTEST\_S} are the names for the profiling and testing library. The default is \textit{libtomcrypt\_prof.a} for +Similarly \textbf{LIBTEST} and \textbf{LIBTEST\_S} are the names for the profiling and testing library. The default is \textit{libtomcrypt\_prof.a} for static and \textit{libtomcrypt\_prof.la} for shared. \subsection{Installation Directories} \index{DESTDIR} \index{LIBPATH} \index{INCPATH} \index{DATADIR} \textbf{DESTDIR} is the prefix for the installation directories. It defaults to an empty string. \textbf{LIBPATH} is the prefix for the library -directory which defaults to \textit{/usr/lib}. \textbf{INCPATH} is the prefix for the header file directory which defaults to \textit{/usr/include}. +directory which defaults to \textit{/usr/lib}. \textbf{INCPATH} is the prefix for the header file directory which defaults to \textit{/usr/include}. \textbf{DATADIR} is the prefix for the data (documentation) directory which defaults to \textit{/usr/share/doc/libtomcrypt/pdf}. All four can be used to create custom install locations depending on the nature of the OS and file system in use. @@ -5537,50 +5537,50 @@ \subsection{Installation Directories} \end{verbatim} This will install the library using the TomsFastMath library and link the \textit{libtfm.a} library out of the default library search path. The two -defines are explained below. You can specify multiple archives (say if you want to support two math libraries, or add on additional code) to +defines are explained below. You can specify multiple archives (say if you want to support two math libraries, or add on additional code) to the \textbf{EXTRALIBS} variable by separating them by a space. -Note that \textbf{EXTRALIBS} is not required if you are only making and installing the static library but none of the test programs. +Note that \textbf{EXTRALIBS} is not required if you are only making and installing the static library but none of the test programs. \mysection{Building a Static Library} -Building a static library is fairly trivial as it only requires one invocation of the GNU make command. +Building a static library is fairly trivial as it only requires one invocation of the GNU make command. \begin{verbatim} CFLAGS="-DTFM_DESC" make install \end{verbatim} -That will build LibTomCrypt (including the TomsFastMath descriptor), and install it in the default locations indicated previously. You can enable -the built--in LibTomMath descriptor as well (or in place of the TomsFastMath descriptor). Similarly, you can build the library with no built--in -math descriptors. +That will build LibTomCrypt (including the TomsFastMath descriptor), and install it in the default locations indicated previously. You can enable +the built--in LibTomMath descriptor as well (or in place of the TomsFastMath descriptor). Similarly, you can build the library with no built--in +math descriptors. \begin{verbatim} make install \end{verbatim} -In this case, no math descriptors are present in the library and they will have to be made available at build or run time before you can use any of the -public key functions. +In this case, no math descriptors are present in the library and they will have to be made available at build or run time before you can use any of the +public key functions. -Note that even if you include the built--in descriptors you must link against the source library as well. +Note that even if you include the built--in descriptors you must link against the source library as well. \begin{verbatim} gcc -DTFM_DESC myprogram.c -ltomcrypt -ltfm -o myprogram \end{verbatim} -This will compile \textit{myprogram} and link it against the LibTomCrypt library as well as TomsFastMath (which must have been previously installed). Note that -we define \textbf{TFM\_DESC} for compilation. This is so that the TFM descriptor symbol will be defined for the client application to make use of without +This will compile \textit{myprogram} and link it against the LibTomCrypt library as well as TomsFastMath (which must have been previously installed). Note that +we define \textbf{TFM\_DESC} for compilation. This is so that the TFM descriptor symbol will be defined for the client application to make use of without giving warnings. \mysection{Building a Shared Library} LibTomCrypt can also be built as a shared library through the \textit{makefile.shared} make script. It is similar to use as the static script except -that you \textbf{must} specify the \textbf{EXTRALIBS} variable at install time. +that you \textbf{must} specify the \textbf{EXTRALIBS} variable at install time. \begin{verbatim} CFLAGS="-DTFM_DESC" EXTRALIBS=-ltfm make -f makefile.shared install \end{verbatim} -This will build and install the library and link the shared object against the TomsFastMath library (which must be installed as a shared object as well). The +This will build and install the library and link the shared object against the TomsFastMath library (which must be installed as a shared object as well). The shared build process requires libtool to be installed. \mysection{Header Configuration} @@ -5589,12 +5589,12 @@ \subsection{Installation Directories} \subsubsection{ARGTYPE} This lets you control how the LTC\_ARGCHK macro will behave. The macro is used to check pointers inside the functions against -NULL. There are four settings for ARGTYPE. When set to 0, it will have the default behaviour of printing a message to +NULL. There are four settings for ARGTYPE. When set to 0, it will have the default behaviour of printing a message to stderr and raising a SIGABRT signal. This is provided so all platforms that use LibTomCrypt can have an error that functions similarly. When set to 1, it will simply pass on to the assert() macro. When set to 2, the macro will display the error to stderr then return execution to the caller. This could lead to a segmentation fault (e.g. when a pointer is \textbf{NULL}) but is useful if you handle signals on your own. When set to 3, it will resolve to a empty macro and no error checking will be performed. Finally, when set -to 4, it will return CRYPT\_INVALID\_ARG to the caller. +to 4, it will return CRYPT\_INVALID\_ARG to the caller. \subsubsection{Endianness} There are five macros related to endianness issues. For little endian platforms define, \textbf{ENDIAN\_LITTLE}. For big endian @@ -5602,16 +5602,16 @@ \subsubsection{Endianness} or define \textbf{ENDIAN\_64BITWORD} when its 64-bits. If you do not define any of them the library will automatically use \textbf{ENDIAN\_NEUTRAL} which will work on all platforms. -Currently LibTomCrypt will detect x86-32, x86-64, MIPS R5900, SPARC and SPARC64 running GCC as well as x86-32 running MSVC. +Currently LibTomCrypt will detect x86-32, x86-64, MIPS R5900, SPARC and SPARC64 running GCC as well as x86-32 running MSVC. \mysection{Customisation} There are also options you can specify from the \textit{tomcrypt\_custom.h} header file. \subsection{X memory routines} \index{XMALLOC}\index{XCALLOC}\index{XREALLOC}\index{XFREE} -At the top of tomcrypt\_custom.h are a series of macros denoted as XMALLOC, XCALLOC, XREALLOC, XFREE, and so on. They resolve to -the name of the respective functions from the standard C library by default. This lets you substitute in your own memory routines. -If you substitute in your own functions they must behave like the standard C library functions in terms of what they expect as input and +At the top of tomcrypt\_custom.h are a series of macros denoted as XMALLOC, XCALLOC, XREALLOC, XFREE, and so on. They resolve to +the name of the respective functions from the standard C library by default. This lets you substitute in your own memory routines. +If you substitute in your own functions they must behave like the standard C library functions in terms of what they expect as input and output. These macros are handy for working with platforms which do not have a standard C library. For instance, the OLPC\footnote{See http://dev.laptop.org/git?p=bios-crypto;a=summary} @@ -5622,12 +5622,12 @@ \subsection{X clock routines} the default clock() used with a replacement. By default the standard C library clock() function is used. \subsection{LTC\_NO\_FILE} -During the build if LTC\_NO\_FILE is defined then any function in the library that uses file I/O will not call the file I/O +During the build if LTC\_NO\_FILE is defined then any function in the library that uses file I/O will not call the file I/O functions and instead simply return CRYPT\_NOP. This should help resolve any linker errors stemming from a lack of file I/O on embedded platforms. \subsection{LTC\_CLEAN\_STACK} -When this functions is defined the functions that store key material on the stack will clean up afterwards. +When this functions is defined the functions that store key material on the stack will clean up afterwards. Assumes that you have no memory paging with the stack. \subsection{LTC\_TEST} @@ -5639,9 +5639,9 @@ \subsection{LTC\_NO\_FAST} which can be auto-detected. This macro ensures that they are never enabled. \subsection{LTC\_FAST} -This mode (auto-detected with x86\_32, x86\_64 platforms with GCC or CLANG) configures various routines such as ctr\_encrypt() or -cbc\_encrypt() that it can safely XOR multiple octets in one step by using a larger data type. This has the benefit of -cutting down the overhead of the respective functions. +This mode (auto-detected with x86\_32, x86\_64 platforms with GCC or CLANG) configures various routines such as ctr\_encrypt() or +cbc\_encrypt() that it can safely XOR multiple octets in one step by using a larger data type. This has the benefit of +cutting down the overhead of the respective functions. This mode does have one downside. It can cause unaligned reads from memory if you are not careful with the functions. This is why it has been enabled by default only for the x86 class of processors where unaligned accesses are allowed. Technically LTC\_FAST @@ -5650,43 +5650,43 @@ \subsection{LTC\_FAST} In practice however, you can use it on pretty much any platform (even MIPS) with care. By design the \textit{fast} mode functions won't get unaligned on their own. For instance, if you call ctr\_encrypt() right after calling -ctr\_start() and all the inputs you gave are aligned than ctr\_encrypt() will perform aligned memory operations only. However, if you +ctr\_start() and all the inputs you gave are aligned than ctr\_encrypt() will perform aligned memory operations only. However, if you call ctr\_encrypt() with an odd amount of plaintext then call it again the CTR pad (the IV) will be partially used. This will -cause the ctr routine to first use up the remaining pad bytes. Then if there are enough plaintext bytes left it will use +cause the ctr routine to first use up the remaining pad bytes. Then if there are enough plaintext bytes left it will use whole word XOR operations. These operations will be unaligned. -The simplest precaution is to make sure you process all data in power of two blocks and handle \textit{remainder} at the end. e.g. If you are -CTR'ing a long stream process it in blocks of (say) four kilobytes and handle any remaining incomplete blocks at the end of the stream. +The simplest precaution is to make sure you process all data in power of two blocks and handle \textit{remainder} at the end. e.g. If you are +CTR'ing a long stream process it in blocks of (say) four kilobytes and handle any remaining incomplete blocks at the end of the stream. \index{LTC\_FAST\_TYPE} If you do plan on using the \textit{LTC\_FAST} mode, a \textit{LTC\_FAST\_TYPE} type which resolves to an optimal sized -data type you can perform integer operations with is required. For the auto-detected platforms this type will be defined automatically. Ideally it should be four or eight bytes since it must properly divide the size -of your block cipher (e.g. 16 bytes for AES). This means sadly if you're on a platform with 57--bit words (or something) you can't +data type you can perform integer operations with is required. For the auto-detected platforms this type will be defined automatically. Ideally it should be four or eight bytes since it must properly divide the size +of your block cipher (e.g. 16 bytes for AES). This means sadly if you're on a platform with 57--bit words (or something) you can't use this mode. So sad. \subsection{LTC\_NO\_ASM} When this has been defined the library will not use any inline assembler. Only a few platforms support assembler inlines but various versions of ICC and GCC -cannot handle all of the assembler functions. +cannot handle all of the assembler functions. \subsection{Symmetric Ciphers, One-way Hashes, PRNGS and Public Key Functions} -There are a plethora of macros for the ciphers, hashes, PRNGs and public key functions which are fairly -self-explanatory. When they are defined the functionality is included otherwise it is not. There are some -dependency issues which are noted in the file. For instance, Yarrow requires CTR chaining mode, a block +There are a plethora of macros for the ciphers, hashes, PRNGs and public key functions which are fairly +self-explanatory. When they are defined the functionality is included otherwise it is not. There are some +dependency issues which are noted in the file. For instance, Yarrow requires CTR chaining mode, a block cipher and a hash function. Also see technical note number five for more details. \subsection{LTC\_EASY} -When defined the library is configured to build fewer algorithms and modes. Mostly it sticks to NIST and ANSI approved algorithms. See -the header file \textit{tomcrypt\_custom.h} for more details. It is meant to provide literally an easy method of trimming the library +When defined the library is configured to build fewer algorithms and modes. Mostly it sticks to NIST and ANSI approved algorithms. See +the header file \textit{tomcrypt\_custom.h} for more details. It is meant to provide literally an easy method of trimming the library build to the most minimum of useful functionality. \subsection{TWOFISH\_SMALL and TWOFISH\_TABLES} Twofish is a 128-bit symmetric block cipher that is provided within the library. The cipher itself is flexible enough -to allow some trade-offs in the implementation. When TWOFISH\_SMALL is defined the scheduled symmetric key for Twofish -requires only 200 bytes of memory. This is achieved by not pre-computing the substitution boxes. Having this -defined will also greatly slow down the cipher. When this macro is not defined Twofish will pre-compute the -tables at a cost of 4KB of memory. The cipher will be much faster as a result. +to allow some trade-offs in the implementation. When TWOFISH\_SMALL is defined the scheduled symmetric key for Twofish +requires only 200 bytes of memory. This is achieved by not pre-computing the substitution boxes. Having this +defined will also greatly slow down the cipher. When this macro is not defined Twofish will pre-compute the +tables at a cost of 4KB of memory. The cipher will be much faster as a result. When TWOFISH\_TABLES is defined the cipher will use pre-computed (and fixed in code) tables required to work. This is useful when TWOFISH\_SMALL is defined as the table values are computed on the fly. When this is defined the code size @@ -5694,8 +5694,8 @@ \subsection{TWOFISH\_SMALL and TWOFISH\_TABLES} it will not speed up the encryption or decryption functions. \subsection{GCM\_TABLES} -When defined GCM will use a 64KB table (per GCM state) which will greatly speed up the per--packet latency. -It also increases the initialization time and is not suitable when you are going to use a key a few times only. +When defined GCM will use a 64KB table (per GCM state) which will greatly speed up the per--packet latency. +It also increases the initialization time and is not suitable when you are going to use a key a few times only. \subsection{GCM\_TABLES\_SSE2} \index{SSE2} @@ -5707,7 +5707,7 @@ \subsection{LTC\_SMALL\_CODE} These variants are slower but can save quite a bit of code space. \subsection{LTC\_PTHREAD} -When this is activated all of the descriptor table functions will use pthread locking to ensure thread safe updates to the tables. Note that +When this is activated all of the descriptor table functions will use pthread locking to ensure thread safe updates to the tables. Note that it doesn't prevent a thread that is passively using a table from being messed up by another thread that updates the table. Generally the rule of thumb is to setup the tables once at startup and then leave them be. This added build flag simply makes updating @@ -5734,11 +5734,11 @@ \subsection{Math Descriptors} \end{verbatim} \end{small} -That will build and install the library with all descriptors (and link against all), but only use TomsFastMath in the timing demo. +That will build and install the library with all descriptors (and link against all), but only use TomsFastMath in the timing demo. \chapter{Optimizations} \mysection{Introduction} -The entire API was designed with plug and play in mind at the low level. That is you can swap out any cipher, hash, PRNG or bignum library and the dependent API will not +The entire API was designed with plug and play in mind at the low level. That is you can swap out any cipher, hash, PRNG or bignum library and the dependent API will not require updating. This has the nice benefit that one can add ciphers (etc.) not have to re--write portions of the API. For the most part, LibTomCrypt has also been written to be highly portable and easy to build out of the box on pretty much any platform. As such there are no assembler inlines throughout the code, I make no assumptions about the platform, etc... @@ -5748,7 +5748,7 @@ \chapter{Optimizations} the optimized code without re--writing. This also paves the way for hardware drivers that can access hardware accelerated cryptographic devices. At the heart of this flexibility is the \textit{descriptor} system. A descriptor is essentially just a C \textit{struct} which describes the algorithm and provides pointers -to functions that do the required work. For a given class of operation (e.g. cipher, hash, prng, bignum) the functions of a descriptor have identical prototypes which makes +to functions that do the required work. For a given class of operation (e.g. cipher, hash, prng, bignum) the functions of a descriptor have identical prototypes which makes development simple. In most dependent routines all an end developer has to do is register\_XXX() the descriptor and they are set. \mysection{Ciphers} @@ -5765,27 +5765,27 @@ \chapter{Optimizations} unsigned char ID; /** min keysize (octets) */ - int min_key_length, + int min_key_length, /** max keysize (octets) */ - max_key_length, + max_key_length, /** block size (octets) */ - block_length, + block_length, /** default number of rounds */ default_rounds; - /** Setup the cipher + /** Setup the cipher @param key The input symmetric key @param keylen The length of the input key (octets) @param num_rounds The requested number of rounds (0==default) @param skey [out] The destination of the scheduled key @return CRYPT_OK if successful */ - int (*setup)(const unsigned char *key, - int keylen, - int num_rounds, + int (*setup)(const unsigned char *key, + int keylen, + int num_rounds, symmetric_key *skey); /** Encrypt a block @@ -5794,8 +5794,8 @@ \chapter{Optimizations} @param skey The scheduled key @return CRYPT_OK if successful */ - int (*ecb_encrypt)(const unsigned char *pt, - unsigned char *ct, + int (*ecb_encrypt)(const unsigned char *pt, + unsigned char *ct, symmetric_key *skey); /** Decrypt a block @@ -5804,54 +5804,54 @@ \chapter{Optimizations} @param skey The scheduled key @return CRYPT_OK if successful */ - int (*ecb_decrypt)(const unsigned char *ct, - unsigned char *pt, + int (*ecb_decrypt)(const unsigned char *ct, + unsigned char *pt, symmetric_key *skey); /** Test the block cipher - @return CRYPT_OK if successful, + @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled */ int (*test)(void); - /** Terminate the context + /** Terminate the context @param skey The scheduled key */ - void (*done)(symmetric_key *skey); + void (*done)(symmetric_key *skey); /** Determine a key size - @param keysize [in/out] The size of the key desired + @param keysize [in/out] The size of the key desired The suggested size @return CRYPT_OK if successful */ int (*keysize)(int *keysize); /** Accelerators **/ - /** Accelerated ECB encryption + /** Accelerated ECB encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param skey The scheduled key context @return CRYPT_OK if successful */ - int (*accel_ecb_encrypt)(const unsigned char *pt, - unsigned char *ct, - unsigned long blocks, + int (*accel_ecb_encrypt)(const unsigned char *pt, + unsigned char *ct, + unsigned long blocks, symmetric_key *skey); - /** Accelerated ECB decryption + /** Accelerated ECB decryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @param skey The scheduled key context @return CRYPT_OK if successful */ - int (*accel_ecb_decrypt)(const unsigned char *ct, - unsigned char *pt, - unsigned long blocks, + int (*accel_ecb_decrypt)(const unsigned char *ct, + unsigned char *pt, + unsigned long blocks, symmetric_key *skey); - /** Accelerated CBC encryption + /** Accelerated CBC encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -5859,13 +5859,13 @@ \chapter{Optimizations} @param skey The scheduled key context @return CRYPT_OK if successful */ - int (*accel_cbc_encrypt)(const unsigned char *pt, - unsigned char *ct, - unsigned long blocks, - unsigned char *IV, + int (*accel_cbc_encrypt)(const unsigned char *pt, + unsigned char *ct, + unsigned long blocks, + unsigned char *IV, symmetric_key *skey); - /** Accelerated CBC decryption + /** Accelerated CBC decryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -5873,13 +5873,13 @@ \chapter{Optimizations} @param skey The scheduled key context @return CRYPT_OK if successful */ - int (*accel_cbc_decrypt)(const unsigned char *ct, - unsigned char *pt, - unsigned long blocks, - unsigned char *IV, + int (*accel_cbc_decrypt)(const unsigned char *ct, + unsigned char *pt, + unsigned long blocks, + unsigned char *IV, symmetric_key *skey); - /** Accelerated CTR encryption + /** Accelerated CTR encryption @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -5888,14 +5888,14 @@ \chapter{Optimizations} @param skey The scheduled key context @return CRYPT_OK if successful */ - int (*accel_ctr_encrypt)(const unsigned char *pt, - unsigned char *ct, - unsigned long blocks, - unsigned char *IV, - int mode, + int (*accel_ctr_encrypt)(const unsigned char *pt, + unsigned char *ct, + unsigned long blocks, + unsigned char *IV, + int mode, symmetric_key *skey); - /** Accelerated LRW + /** Accelerated LRW @param pt Plaintext @param ct Ciphertext @param blocks The number of complete blocks to process @@ -5904,14 +5904,14 @@ \chapter{Optimizations} @param skey The scheduled key context @return CRYPT_OK if successful */ - int (*accel_lrw_encrypt)(const unsigned char *pt, - unsigned char *ct, - unsigned long blocks, - unsigned char *IV, - const unsigned char *tweak, + int (*accel_lrw_encrypt)(const unsigned char *pt, + unsigned char *ct, + unsigned long blocks, + unsigned char *IV, + const unsigned char *tweak, symmetric_key *skey); - /** Accelerated LRW + /** Accelerated LRW @param ct Ciphertext @param pt Plaintext @param blocks The number of complete blocks to process @@ -5920,11 +5920,11 @@ \chapter{Optimizations} @param skey The scheduled key context @return CRYPT_OK if successful */ - int (*accel_lrw_decrypt)(const unsigned char *ct, - unsigned char *pt, - unsigned long blocks, - unsigned char *IV, - const unsigned char *tweak, + int (*accel_lrw_decrypt)(const unsigned char *ct, + unsigned char *pt, + unsigned long blocks, + unsigned char *IV, + const unsigned char *tweak, symmetric_key *skey); /** Accelerated CCM packet (one-shot) @@ -5939,7 +5939,7 @@ \chapter{Optimizations} @param ptlen The length of the plaintext (octets) @param ct [out] The ciphertext @param tag [out] The destination tag - @param taglen [in/out] The max size and resulting size + @param taglen [in/out] The max size and resulting size of the authentication tag @param direction Encrypt or Decrypt direction (0 or 1) @return CRYPT_OK if successful @@ -5957,7 +5957,7 @@ \chapter{Optimizations} /** Accelerated GCM packet (one shot) @param key The secret key @param keylen The length of the secret key - @param IV The initial vector + @param IV The initial vector @param IVlen The length of the initial vector @param adata The additional authentication data (header) @param adatalen The length of the adata @@ -5974,14 +5974,14 @@ \chapter{Optimizations} const unsigned char *IV, unsigned long IVlen, const unsigned char *adata, unsigned long adatalen, unsigned char *pt, unsigned long ptlen, - unsigned char *ct, + unsigned char *ct, unsigned char *tag, unsigned long *taglen, int direction); - /** Accelerated one shot OMAC + /** Accelerated one shot OMAC @param key The secret key - @param keylen The key length (octets) - @param in The message + @param keylen The key length (octets) + @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @@ -5992,10 +5992,10 @@ \chapter{Optimizations} const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); - /** Accelerated one shot XCBC + /** Accelerated one shot XCBC @param key The secret key - @param keylen The key length (octets) - @param in The message + @param keylen The key length (octets) + @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @@ -6006,10 +6006,10 @@ \chapter{Optimizations} const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); - /** Accelerated one shot F9 + /** Accelerated one shot F9 @param key The secret key - @param keylen The key length (octets) - @param in The message + @param keylen The key length (octets) + @param in The message @param inlen Length of message (octets) @param out [out] Destination for tag @param outlen [in/out] Initial and final size of out @@ -6051,7 +6051,7 @@ \subsection{Setup} ones provided. Just make sure in your \textit{done()} function that you free the allocated memory. \subsection{Single block ECB} -To process a single block in ECB mode the ecb\_encrypt() and ecb\_decrypt() functions were provided. The plaintext and ciphertext buffers are allowed to overlap so you +To process a single block in ECB mode the ecb\_encrypt() and ecb\_decrypt() functions were provided. The plaintext and ciphertext buffers are allowed to overlap so you must make sure you do not overwrite the output before you are finished with the input. \subsection{Testing} @@ -6059,7 +6059,7 @@ \subsection{Testing} \textbf{CRYPT\_NOP} to indicate that no testing was performed. \subsection{Key Sizing} -Occasionally, a function will want to find a suitable key size to use since the input is oddly sized. The keysize() function is for this case. It accepts a +Occasionally, a function will want to find a suitable key size to use since the input is oddly sized. The keysize() function is for this case. It accepts a pointer to an integer which represents the desired size. The function then has to match it to the exact or a lower key size that is valid for the cipher. For example, if the input is $25$ and $24$ is valid then it stores $24$ back in the pointed to integer. It must not round up and must return an error if the keysize cannot be mapped to a valid key size for the cipher. @@ -6072,15 +6072,15 @@ \subsubsection{Accelerated ECB} These two functions are meant for cases where a user wants to encrypt (in ECB mode no less) an array of blocks. These functions are accessed through the accel\_ecb\_encrypt and accel\_ecb\_decrypt pointers. The \textit{blocks} count is the number of complete blocks to process. -\subsubsection{Accelerated CBC} +\subsubsection{Accelerated CBC} These two functions are meant for accelerated CBC encryption. These functions are accessed through the accel\_cbc\_encrypt and accel\_cbc\_decrypt pointers. The \textit{blocks} value is the number of complete blocks to process. The \textit{IV} is the CBC initial vector. It is an input upon calling this function and must be -updated by the function before returning. +updated by the function before returning. \subsubsection{Accelerated CTR} This function is meant for accelerated CTR encryption. It is accessible through the accel\_ctr\_encrypt pointer. The \textit{blocks} value is the number of complete blocks to process. The \textit{IV} is the CTR counter vector. It is an input upon calling this function and must be -updated by the function before returning. The \textit{mode} value indicates whether the counter is big (mode = CTR\_COUNTER\_BIG\_ENDIAN) or +updated by the function before returning. The \textit{mode} value indicates whether the counter is big (mode = CTR\_COUNTER\_BIG\_ENDIAN) or little (mode = CTR\_COUNTER\_LITTLE\_ENDIAN) endian. This function (and the way it's called) differs from the other two since ctr\_encrypt() allows any size input plaintext. The accelerator will only be @@ -6092,9 +6092,9 @@ \subsubsection{Accelerated CTR} \item The remaining length of the input to process is greater than or equal to the block size. \end{enumerate} -The \textit{CTR pad} is empty when a multiple (including zero) blocks of text have been processed. That is, if you pass in seven bytes to AES--CTR mode you would have to -pass in a minimum of nine extra bytes before the accelerator could be called. The CTR accelerator must increment the counter (and store it back into the -buffer provided) before encrypting it to create the pad. +The \textit{CTR pad} is empty when a multiple (including zero) blocks of text have been processed. That is, if you pass in seven bytes to AES--CTR mode you would have to +pass in a minimum of nine extra bytes before the accelerator could be called. The CTR accelerator must increment the counter (and store it back into the +buffer provided) before encrypting it to create the pad. The accelerator will only be used to encrypt whole blocks. Partial blocks are always handled in software. @@ -6105,14 +6105,14 @@ \subsubsection{Accelerated LRW} While both encrypt and decrypt accelerators are not required it is suggested as it makes lrw\_setiv() more efficient. -Note that calling lrw\_done() will only invoke the cipher\_descriptor[].done() function on the \textit{symmetric\_key} parameter of the LRW state. That means +Note that calling lrw\_done() will only invoke the cipher\_descriptor[].done() function on the \textit{symmetric\_key} parameter of the LRW state. That means if your device requires any (LRW specific) resources you should free them in your ciphers() done function. The simplest way to think of it is to write the plugin solely to do LRW with the cipher. That way cipher\_descriptor[].setup() means to init LRW resources and cipher\_descriptor[].done() means to free them. \subsubsection{Accelerated CCM} This function is meant for accelerated CCM encryption or decryption. It processes the entire packet in one call. You can optimize the work flow somewhat -by allowing the caller to call the setup() function first to schedule the key if your accelerator cannot do the key schedule on the fly (for instance). This +by allowing the caller to call the setup() function first to schedule the key if your accelerator cannot do the key schedule on the fly (for instance). This function MUST support both key passing methods. \begin{center} @@ -6137,11 +6137,11 @@ \subsubsection{Accelerated GCM} \subsubsection{Accelerated OMAC} \index{omac\_memory()} -This function is meant to perform an optimized OMAC1 (CMAC) message authentication code computation when the user calls omac\_memory(). +This function is meant to perform an optimized OMAC1 (CMAC) message authentication code computation when the user calls omac\_memory(). \subsubsection{Accelerated XCBC-MAC} \index{xcbc\_memory()} -This function is meant to perform an optimized XCBC-MAC message authentication code computation when the user calls xcbc\_memory(). +This function is meant to perform an optimized XCBC-MAC message authentication code computation when the user calls xcbc\_memory(). \subsubsection{Accelerated F9} \index{f9\_memory()} @@ -6179,14 +6179,14 @@ \subsubsection{Accelerated F9} */ int (*init)(hash_state *hash); - /** Process a block of data + /** Process a block of data @param hash The hash state @param in The data to hash @param inlen The length of the data (octets) @return CRYPT_OK if successful */ - int (*process)( hash_state *hash, - const unsigned char *in, + int (*process)( hash_state *hash, + const unsigned char *in, unsigned long inlen); /** Produce the digest and store it @@ -6194,24 +6194,24 @@ \subsubsection{Accelerated F9} @param out [out] The destination of the digest @return CRYPT_OK if successful */ - int (*done)( hash_state *hash, + int (*done)( hash_state *hash, unsigned char *out); /** Self-test - @return CRYPT_OK if successful, + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled */ int (*test)(void); - /* accelerated hmac callback: if you need to-do - multiple packets just use the generic hmac_memory - and provide a hash callback + /* accelerated hmac callback: if you need to-do + multiple packets just use the generic hmac_memory + and provide a hash callback */ - int (*hmac_block)(const unsigned char *key, + int (*hmac_block)(const unsigned char *key, unsigned long keylen, - const unsigned char *in, - unsigned long inlen, - unsigned char *out, + const unsigned char *in, + unsigned long inlen, + unsigned char *out, unsigned long *outlen); }; \end{verbatim} @@ -6274,8 +6274,8 @@ \subsection{HMAC Acceleration} @param prng The PRNG state @return CRYPT_OK if successful */ - int (*add_entropy)(const unsigned char *in, - unsigned long inlen, + int (*add_entropy)(const unsigned char *in, + unsigned long inlen, prng_state *prng); /** Ready a PRNG state to read from @@ -6290,8 +6290,8 @@ \subsection{HMAC Acceleration} @param prng The PRNG state to read from @return Number of octets read */ - unsigned long (*read)(unsigned char *out, - unsigned long outlen, + unsigned long (*read)(unsigned char *out, + unsigned long outlen, prng_state *prng); /** Terminate a PRNG state @@ -6300,14 +6300,14 @@ \subsection{HMAC Acceleration} */ int (*done)(prng_state *prng); - /** Export a PRNG state + /** Export a PRNG state @param out [out] The destination for the state @param outlen [in/out] The max size and resulting size @param prng The PRNG to export @return CRYPT_OK if successful */ - int (*pexport)(unsigned char *out, - unsigned long *outlen, + int (*pexport)(unsigned char *out, + unsigned long *outlen, prng_state *prng); /** Import a PRNG state @@ -6316,12 +6316,12 @@ \subsection{HMAC Acceleration} @param prng The PRNG to initialize/import @return CRYPT_OK if successful */ - int (*pimport)(const unsigned char *in, - unsigned long inlen, + int (*pimport)(const unsigned char *in, + unsigned long inlen, prng_state *prng); /** Self-test the PRNG - @return CRYPT_OK if successful, + @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled */ int (*test)(void); @@ -6346,7 +6346,7 @@ \subsection{Ready} on the specific PRNG used. \subsection{Read} -Read from the PRNG and return the number of bytes read. This function does not have to fill the buffer but it is best +Read from the PRNG and return the number of bytes read. This function does not have to fill the buffer but it is best if it does as many protocols do not retry reads and will fail on the first try. \subsection{Done} @@ -6377,15 +6377,15 @@ \subsection{Exporting and Importing} @return CRYPT_OK on success */ int (*init)(void **a); - - /** init copy + + /** init copy @param dst The number to initialize and write to @param src The number to copy from @return CRYPT_OK on success */ int (*init_copy)(void **dst, void *src); - /** deinit + /** deinit @param a The number to free @return CRYPT_OK on success */ @@ -6393,29 +6393,29 @@ \subsection{Exporting and Importing} /* ---- data movement ---- */ - /** copy + /** copy @param src The number to copy from - @param dst The number to write to + @param dst The number to write to @return CRYPT_OK on success */ int (*copy)(void *src, void *dst); /* ---- trivial low level functions ---- */ - /** set small constant + /** set small constant @param a Number to write to - @param n Source upto bits_per_digit (meant for small constants) + @param n Source upto bits_per_digit (meant for small constants) @return CRYPT_OK on success */ int (*set_int)(void *a, unsigned long n); - /** get small constant + /** get small constant @param a Small number to read @return The lower bits_per_digit of the integer (unsigned) */ unsigned long (*get_int)(void *a); - /** get digit n + /** get digit n @param a The number to read from @param n The number of the digit to fetch @return The bits_per_digit sized n'th digit of a @@ -6431,17 +6431,17 @@ \subsection{Exporting and Importing} /** compare two integers @param a The left side integer @param b The right side integer - @return LTC_MP_LT if a < b, - LTC_MP_GT if a > b and + @return LTC_MP_LT if a < b, + LTC_MP_GT if a > b and LTC_MP_EQ otherwise. (signed comparison) */ int (*compare)(void *a, void *b); - /** compare against int + /** compare against int @param a The left side integer @param b The right side integer (upto bits_per_digit) - @return LTC_MP_LT if a < b, - LTC_MP_GT if a > b and + @return LTC_MP_LT if a < b, + LTC_MP_GT if a > b and LTC_MP_EQ otherwise. (signed comparison) */ int (*compare_d)(void *a, unsigned long n); @@ -6452,7 +6452,7 @@ \subsection{Exporting and Importing} */ int (*count_bits)(void * a); - /** Count the number of LSB bits which are zero + /** Count the number of LSB bits which are zero @param a The integer to count @return The number of contiguous zero LSB bits */ @@ -6466,8 +6466,8 @@ \subsection{Exporting and Importing} int (*twoexpt)(void *a , int n); /* ---- radix conversions ---- */ - - /** read ascii string + + /** read ascii string @param a The integer to store into @param str The string to read @param radix The radix the integer has been represented in (2-64) @@ -6483,13 +6483,13 @@ \subsection{Exporting and Importing} */ int (*write_radix)(void *a, char *str, int radix); - /** get size as unsigned char string + /** get size as unsigned char string @param a The integer to get the size @return The length of the integer in octets */ unsigned long (*unsigned_size)(void *a); - /** store an integer as an array of octets + /** store an integer as an array of octets @param src The integer to store @param dst The buffer to store the integer in @return CRYPT_OK on success @@ -6498,17 +6498,17 @@ \subsection{Exporting and Importing} /** read an array of octets and store as integer @param dst The integer to load - @param src The array of octets - @param len The number of octets + @param src The array of octets + @param len The number of octets @return CRYPT_OK on success */ - int (*unsigned_read)( void *dst, - unsigned char *src, + int (*unsigned_read)( void *dst, + unsigned char *src, unsigned long len); /* ---- basic math ---- */ - /** add two integers + /** add two integers @param a The first source integer @param b The second source integer @param c The destination of "a + b" @@ -6516,16 +6516,16 @@ \subsection{Exporting and Importing} */ int (*add)(void *a, void *b, void *c); - /** add two integers + /** add two integers @param a The first source integer - @param b The second source integer + @param b The second source integer (single digit of upto bits_per_digit in length) @param c The destination of "a + b" @return CRYPT_OK on success */ int (*addi)(void *a, unsigned long b, void *c); - /** subtract two integers + /** subtract two integers @param a The first source integer @param b The second source integer @param c The destination of "a - b" @@ -6533,27 +6533,27 @@ \subsection{Exporting and Importing} */ int (*sub)(void *a, void *b, void *c); - /** subtract two integers + /** subtract two integers @param a The first source integer - @param b The second source integer + @param b The second source integer (single digit of upto bits_per_digit in length) @param c The destination of "a - b" @return CRYPT_OK on success */ int (*subi)(void *a, unsigned long b, void *c); - /** multiply two integers + /** multiply two integers @param a The first source integer - @param b The second source integer + @param b The second source integer (single digit of upto bits_per_digit in length) @param c The destination of "a * b" @return CRYPT_OK on success */ int (*mul)(void *a, void *b, void *c); - /** multiply two integers + /** multiply two integers @param a The first source integer - @param b The second source integer + @param b The second source integer (single digit of upto bits_per_digit in length) @param c The destination of "a * b" @return CRYPT_OK on success @@ -6576,9 +6576,9 @@ \subsection{Exporting and Importing} */ int (*div)(void *a, void *b, void *c, void *d); - /** divide by two + /** divide by two @param a The integer to divide (shift right) - @param b The destination + @param b The destination @return CRYPT_OK on success */ int (*div_2)(void *a, void *b); @@ -6591,7 +6591,7 @@ \subsection{Exporting and Importing} */ int (*modi)(void *a, unsigned long b, unsigned long *c); - /** gcd + /** gcd @param a The first integer @param b The second integer @param c The destination for (a, b) @@ -6599,7 +6599,7 @@ \subsection{Exporting and Importing} */ int (*gcd)(void *a, void *b, void *c); - /** lcm + /** lcm @param a The first integer @param b The second integer @param c The destination for [a, b] @@ -6609,7 +6609,7 @@ \subsection{Exporting and Importing} /** Modular multiplication @param a The first source - @param b The second source + @param b The second source @param c The modulus @param d The destination (a*b mod c) @return CRYPT_OK on success @@ -6626,7 +6626,7 @@ \subsection{Exporting and Importing} /** Modular inversion @param a The value to invert - @param b The modulus + @param b The modulus @param c The destination (1/a mod b) @return CRYPT_OK on success */ @@ -6635,13 +6635,13 @@ \subsection{Exporting and Importing} /* ---- reduction ---- */ /** setup Montgomery - @param a The modulus - @param b The destination for the reduction digit + @param a The modulus + @param b The destination for the reduction digit @return CRYPT_OK on success */ int (*montgomery_setup)(void *a, void **b); - /** get normalization value + /** get normalization value @param a The destination for the normalization value @param b The modulus @return CRYPT_OK on success @@ -6659,7 +6659,7 @@ \subsection{Exporting and Importing} /** clean up (frees memory) @param a The value "b" from montgomery_setup() @return CRYPT_OK on success - */ + */ void (*montgomery_deinit)(void *a); /* ---- exponentiation ---- */ @@ -6685,19 +6685,19 @@ \subsection{Exporting and Importing} /** ECC GF(p) point multiplication (from the NIST curves) @param k The integer to multiply the point by @param G The point to multiply - @param R The destination for kG + @param R The destination for kG @param modulus The modulus for the field - @param map Boolean indicated whether to map back to affine or not + @param map Boolean indicated whether to map back to affine or not (can be ignored if you work in affine only) @return CRYPT_OK on success */ - int (*ecc_ptmul)( void *k, - ecc_point *G, - ecc_point *R, - void *modulus, + int (*ecc_ptmul)( void *k, + ecc_point *G, + ecc_point *R, + void *modulus, int map); - /** ECC GF(p) point addition + /** ECC GF(p) point addition @param P The first point @param Q The second point @param R The destination of P + Q @@ -6705,32 +6705,32 @@ \subsection{Exporting and Importing} @param mp The "b" value from montgomery_setup() @return CRYPT_OK on success */ - int (*ecc_ptadd)(ecc_point *P, - ecc_point *Q, - ecc_point *R, - void *modulus, + int (*ecc_ptadd)(ecc_point *P, + ecc_point *Q, + ecc_point *R, + void *modulus, void *mp); - /** ECC GF(p) point double + /** ECC GF(p) point double @param P The first point @param R The destination of 2P @param modulus The modulus @param mp The "b" value from montgomery_setup() @return CRYPT_OK on success */ - int (*ecc_ptdbl)(ecc_point *P, - ecc_point *R, - void *modulus, + int (*ecc_ptdbl)(ecc_point *P, + ecc_point *R, + void *modulus, void *mp); - /** ECC mapping from projective to affine, + /** ECC mapping from projective to affine, currently uses (x,y,z) => (x/z^2, y/z^3, 1) @param P The point to map @param modulus The modulus @param mp The "b" value from montgomery_setup() @return CRYPT_OK on success - @remark The mapping can be different but keep in mind a - ecc_point only has three integers (x,y,z) so if + @remark The mapping can be different but keep in mind a + ecc_point only has three integers (x,y,z) so if you use a different mapping you have to make it fit. */ int (*ecc_map)(ecc_point *P, void *modulus, void *mp); @@ -6741,9 +6741,9 @@ \subsection{Exporting and Importing} @param B Second point to multiply @param kB What to multiple B by @param C [out] Destination point (can overlap with A or B) - @param modulus Modulus for curve + @param modulus Modulus for curve @return CRYPT_OK on success - */ + */ int (*ecc_mul2add)(ecc_point *A, void *kA, ecc_point *B, void *kB, ecc_point *C, @@ -6752,29 +6752,29 @@ \subsection{Exporting and Importing} /* ---- (optional) rsa optimized math (for internal CRT) ---- */ - /** RSA Key Generation + /** RSA Key Generation @param prng An active PRNG state @param wprng The index of the PRNG desired @param size The size of the key in octets - @param e The "e" value (public key). + @param e The "e" value (public key). e==65537 is a good choice @param key [out] Destination of a newly created private key pair @return CRYPT_OK if successful, upon error all allocated ram is freed */ - int (*rsa_keygen)(prng_state *prng, - int wprng, - int size, - long e, + int (*rsa_keygen)(prng_state *prng, + int wprng, + int size, + long e, rsa_key *key); /** RSA exponentiation @param in The octet array representing the base @param inlen The length of the input @param out The destination (to be stored in an octet array format) - @param outlen The length of the output buffer and the resulting size + @param outlen The length of the output buffer and the resulting size (zero padded to the size of the modulus) @param which PK_PUBLIC for public RSA and PK_PRIVATE for private RSA - @param key The RSA key to use + @param key The RSA key to use @return CRYPT_OK on success */ int (*rsa_me)(const unsigned char *in, unsigned long inlen, @@ -6789,23 +6789,23 @@ \subsection{Exporting and Importing} \subsection{Conventions} All \textit{bignums} are accessed through an opaque \textit{void *} data type. You must internally cast the pointer if you need to access members of your bignum structure. During -the init calls a \textit{void **} will be passed where you allocate your structure and set the pointer then initialize the number to zero. During the deinit calls you must +the init calls a \textit{void **} will be passed where you allocate your structure and set the pointer then initialize the number to zero. During the deinit calls you must free the bignum as well as the structure you allocated to place it in. -All functions except the Montgomery reductions work from left to right with the arguments. For example, mul(a, b, c) computes $c \leftarrow ab$. +All functions except the Montgomery reductions work from left to right with the arguments. For example, mul(a, b, c) computes $c \leftarrow ab$. All functions (except where noted otherwise) return \textbf{CRYPT\_OK} to signify a successful operation. All error codes must be valid LibTomCrypt error codes. The digit routines (including functions with the \textit{i} suffix) use a \textit{unsigned long} to represent the digit. If your internal digit is larger than this you must then partition your digits. Normally this does not matter as \textit{unsigned long} will be the same size as your register size. Note that if your digit is smaller -than an \textit{unsigned long} that is also acceptable as the \textit{bits\_per\_digit} parameter will specify this. +than an \textit{unsigned long} that is also acceptable as the \textit{bits\_per\_digit} parameter will specify this. \subsection{ECC Functions} -The ECC system in LibTomCrypt is based off of the NIST recommended curves over $GF(p)$ and is used to implement EC-DSA and EC-DH. The ECC functions work with +The ECC system in LibTomCrypt is based off of the NIST recommended curves over $GF(p)$ and is used to implement EC-DSA and EC-DH. The ECC functions work with the \textbf{ecc\_point} structure and assume the points are stored in Jacobian projective format. \begin{verbatim} -/** A point on a ECC curve, stored in Jacobian format such +/** A point on a ECC curve, stored in Jacobian format such that (x,y,z) => (x/z^2, y/z^3, 1) when interpreted as affine */ typedef struct { /** The x co-ordinate */ @@ -6822,21 +6822,21 @@ \subsection{ECC Functions} could point to anything you want. The only further exception is the export functions which expects the values to be in affine format. \subsubsection{Point Multiply} -This will multiply the point $G$ by the scalar $k$ and store the result in the point $R$. The value should be mapped to affine only if $map$ is set to one. +This will multiply the point $G$ by the scalar $k$ and store the result in the point $R$. The value should be mapped to affine only if $map$ is set to one. \subsubsection{Point Addition} This will add the point $P$ to the point $Q$ and store it in the point $R$. The $mp$ parameter is the \textit{b} value from the montgomery\_setup() call. The input points -may be in either affine (with $z = 1$) or projective format and the output point is always projective. +may be in either affine (with $z = 1$) or projective format and the output point is always projective. \subsubsection{Point Mapping} -This will map the point $P$ back from projective to affine. The output point $P$ must be of the form $(x, y, 1)$. +This will map the point $P$ back from projective to affine. The output point $P$ must be of the form $(x, y, 1)$. \subsubsection{Shamir's Trick} \index{Shamir's Trick} \index{ltc\_ecc\_mul2add()} To accelerate EC--DSA verification the library provides a built--in function called ltc\_ecc\_mul2add(). This performs two point multiplications and an addition in roughly the time of one point multiplication. It is called from ecc\_verify\_hash() if an accelerator is not present. The acclerator function must allow the points to -overlap (e.g., $A \leftarrow k_1A + k_2B$) and must return the final point in affine format. +overlap (e.g., $A \leftarrow k_1A + k_2B$) and must return the final point in affine format. \subsection{RSA Functions} @@ -6849,19 +6849,19 @@ \subsection{RSA Functions} /** Type of key, PK_PRIVATE or PK_PUBLIC */ int type; /** The public exponent */ - void *e; + void *e; /** The private exponent */ - void *d; + void *d; /** The modulus */ - void *N; + void *N; /** The p factor of N */ - void *p; + void *p; /** The q factor of N */ - void *q; + void *q; /** The 1/q mod p CRT param */ - void *qP; + void *qP; /** The d mod (p - 1) CRT param */ - void *dP; + void *dP; /** The d mod (q - 1) CRT param */ void *dQ; } rsa_key; From df8814dfefd7cd053eccc30b272a6b8446e2869d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Aug 2014 15:21:40 +0200 Subject: [PATCH 0648/1192] some minor corrections/improvements --- crypt.tex | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crypt.tex b/crypt.tex index 6f62f5cb0..04547c3ee 100644 --- a/crypt.tex +++ b/crypt.tex @@ -3566,7 +3566,8 @@ \subsection{Extended Verification} value, \textit{res} is set to $0$. Otherwise, if the function succeeds, and signature is valid \textit{res} is set to $1$. The \textit{padding} parameter must be set to \textbf{LTC\_PKCS\_1\_V1\_5} to perform a v1.5 verification. Otherwise, it must be set to -\textbf{LTC\_PKCS\_1\_PSS} to perform a v2.1 verification. When performing a v1.5 verification the \textit{hash\_idx} parameter is ignored. +\textbf{LTC\_PKCS\_1\_PSS} to perform a v2.1 verification. When performing a v1.5 verification the \textit{hash\_idx} and \textit{saltlen} parameters are ignored. + \mysection{RSA Encryption Example} \begin{small} @@ -4563,7 +4564,7 @@ \subsubsection{SEQUENCE Encoding} To encode a sequence a \textbf{ltc\_asn1\_list} array must be initialized with the members of the sequence and their respective pointers. The encoding is performed with the following function. -\index{der\_encode\_sequence()} +\index{der\_encode\_sequence()}\index{LTC\_ASN1\_EOL} \begin{verbatim} int der_encode_sequence(ltc_asn1_list *list, unsigned long inlen, @@ -4617,7 +4618,7 @@ \subsubsection{SEQUENCE Length} This will get the encoding size for the given \textit{list} of length \textit{inlen} and store it in \textit{outlen}. -\subsubsection{SEQUENCE Multiple Argument Lists} +\subsubsection{SEQUENCE Multiple Argument Lists}\index{LTC\_ASN1\_EOL} For small or simple sequences an encoding or decoding can be performed with one of the following two functions. @@ -4966,7 +4967,7 @@ \subsection{ASN.1 CHOICE} \subsection{ASN.1 Flexi Decoder} The ASN.1 \textit{flexi} decoder allows the developer to decode arbitrary ASN.1 DER packets (provided they use data types LibTomCrypt supports) without first knowing -the structure of the data. Where der\_decode \_sequence() requires the developer to specify the data types to decode in advance the flexi decoder is entirely +the structure of the data. Where der\_decode\_sequence() requires the developer to specify the data types to decode in advance the flexi decoder is entirely free form. The flexi decoder uses the same \textit{ltc\_asn1\_list} but instead of being stored in an array it uses the linked list pointers \textit{prev}, \textit{next}, \textit{parent} From 331f76c0ec007f8566cc7299b865d4ea4667609c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Aug 2014 17:18:58 +0200 Subject: [PATCH 0649/1192] add documentation of the newly added ASN.1 types --- crypt.tex | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/crypt.tex b/crypt.tex index 04547c3ee..04abf6e0f 100644 --- a/crypt.tex +++ b/crypt.tex @@ -4550,6 +4550,9 @@ \chapter{Standards Support} \hline LTC\_ASN1\_SET & SET \\ \hline LTC\_ASN1\_SETOF & SET OF \\ \hline LTC\_ASN1\_CHOICE & CHOICE \\ +\hline LTC\_ASN1\_RAW\_BIT\_STRING & BIT STRING (one octet per char) \\ +\hline LTC\_ASN1\_TELETEX\_STRING & TELETEX STRING (one octet per char) \\ +\hline LTC\_ASN1\_CONSTRUCTED & A constructed type that is not SEQUENCE or SET \\ \hline \end{tabular} \caption{List of ASN.1 Supported Types} @@ -4788,6 +4791,30 @@ \subsection{ASN.1 BIT STRING} These will encode or decode a BIT STRING data type. The bits are passed in (or read out) using one \textbf{char} per bit. A non--zero value will be interpreted as a one bit, and a zero value a zero bit. +\subsection{ASN.1 RAW BIT STRING} + +\index{der\_encode\_raw\_bit\_string()}\index{der\_decode\_raw\_bit\_string()} +\begin{verbatim} +int der_encode_raw_bit_string(const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned long *outlen); + +int der_decode_raw_bit_string(const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned long *outlen); +\end{verbatim} + +These will encode or decode a BIT STRING data type. +The bits are passed in (or read out) using one \textbf{unsigned char} per 8 bit. + +This function differs from the normal BIT STRING, as it can be used to directly +process raw binary data and store it to resp. read it from an ASN.1 BIT STRING +data type. + +The length function is the same as for the normal BIT STRING \textit{der\_length\_bit\_string()}. + \subsection{ASN.1 OCTET STRING} \index{der\_encode\_octet\_string()}\index{der\_decode\_octet\_string()}\index{der\_length\_octet\_string()} @@ -4854,6 +4881,26 @@ \subsection{ASN.1 IA5 STRING} say a SPARC machine. Internally, these functions have a table of literal characters and their numerical ASCII values. This provides a stable conversion provided that the build platform honours the run--time platforms character conventions. +\subsection{ASN.1 TELETEX STRING} + +\index{der\_decode\_teletex\_string()}\index{der\_length\_teletex\_string()} +\begin{verbatim} +int der_decode_teletex_string(const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned long *outlen); + +int der_length_teletex_string(const unsigned char *octets, + unsigned long noctets, + unsigned long *outlen); +\end{verbatim} + +These will decode a TELETEX STRING. +The characters are read in individual \textbf{char} elements. +The internal structure is similar to that of the IA5 STRING implementation, to +be able to provide a stable conversion independent of the build-- and run--time +platform. + \subsection{ASN.1 PRINTABLE STRING} \index{der\_encode\_printable\_string()}\index{der\_decode\_printable\_string()}\index{der\_length\_printable\_string()} @@ -4977,7 +5024,7 @@ \subsection{ASN.1 Flexi Decoder} When a SEQUENCE or SET has been encountered a SEQUENCE (or SET resp.) item will be added as a sibling (e.g. list.type == LTC\_ASN1\_SEQUENCE) and the child pointer points to a new list of items contained within the object. -\index{der\_decode\_sequence\_flexi()} +\index{der\_decode\_sequence\_flexi()}\index{LTC\_ASN1\_CONSTRUCTED} \begin{verbatim} int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, @@ -4996,6 +5043,12 @@ \subsection{ASN.1 Flexi Decoder} have to convert the list by first storing all of the siblings in an array then storing all the children as sub-lists of a sequence using the \textit{.data} pointer. Currently no function in LibTomCrypt provides this ability. +\textbf{Note 2:} the flexi decoder will also decode arbitrary constructed types +other than SEQUENCE and SET. The \textit{type} field will be set to +\textbf{LTC\_ASN1\_CONSTRUCTED} and the plain type that was indicated in the ASN.1 +encoding is stored in the \textit{used} field. Further decoding is done in the +same way as if it were a SEQUENCE or SET. + \subsubsection{Sample Decoding} Suppose we decode the following structure: \begin{small} From d010f195878793bd5cfc7c60409adb399d6dfa24 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Aug 2014 17:19:20 +0200 Subject: [PATCH 0650/1192] add documentation of the new RSA API functions --- crypt.tex | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crypt.tex b/crypt.tex index 04abf6e0f..4b1d9e6d9 100644 --- a/crypt.tex +++ b/crypt.tex @@ -3377,6 +3377,14 @@ \subsection{RSA Exponentiation} Note: the output of this function is zero--padded as per PKCS \#1 specification. This allows this routine to work with PKCS \#1 padding functions properly. +\subsection{RSA Key Size} +To fetch the key size of an RSA key, use the following function: +\index{rsa\_get\_size()} +\begin{verbatim} +int rsa_get_size(rsa_key *key); +\end{verbatim} +This can be used to determine the modulus size of an RSA key. + \mysection{RSA Key Encryption} Normally RSA is used to encrypt short symmetric keys which are then used in block ciphers to encrypt a message. To facilitate encrypting short keys the following functions have been provided. @@ -3541,6 +3549,22 @@ \subsection{Extended Signatures} If the RSA decoded data is not a valid PSS message, or if the PSS decoded hash does not match the \textit{msghash} value, \textit{res} is set to $0$. Otherwise, if the function succeeds, and signature is valid \textit{res} is set to $1$. +\subsection{RSA Signature Salt Length} + +The v2.1 signature algorithm requires a salt length to be able to properly +encode resp. decode. To fetch the maximum possible salt length this function +is provided: + +\index{rsa\_sign\_saltlen\_get\_max()} +\begin{verbatim} +int rsa_sign_saltlen_get_max(int hash_idx, rsa_key *key); +\end{verbatim} + +As stated in the PKCS#1 RFC3447 "Typical salt lengths in octets are hLen +(the length of the output of the hash function Hash) and 0". +This function is provided to be able to use other lengths as well and to make +sure at runtime that the RSA key can handle the desired salt length. + \subsection{Extended Verification} As of v1.15, the library supports both v1.5 and v2.1 signature verification. The extended signature verification function has the following prototype: From 1367c1d685c6bb853a4f9e7e4476bd4c42af3b61 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 31 Aug 2014 17:02:07 +0200 Subject: [PATCH 0651/1192] fix build error --- crypt.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypt.tex b/crypt.tex index 4b1d9e6d9..a805ac79c 100644 --- a/crypt.tex +++ b/crypt.tex @@ -3560,7 +3560,7 @@ \subsection{RSA Signature Salt Length} int rsa_sign_saltlen_get_max(int hash_idx, rsa_key *key); \end{verbatim} -As stated in the PKCS#1 RFC3447 "Typical salt lengths in octets are hLen +As stated in the PKCS\#1 RFC3447 "Typical salt lengths in octets are hLen (the length of the output of the hash function Hash) and 0". This function is provided to be able to use other lengths as well and to make sure at runtime that the RSA key can handle the desired salt length. From a5d95448e1c3196fe2c402d2cee41b611d71c54d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 31 Aug 2014 17:57:59 +0200 Subject: [PATCH 0652/1192] use ulong32 resp. ulong64 in the tables of the Macros section This closes #16 --- crypt.tex | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/crypt.tex b/crypt.tex index a805ac79c..c38f40428 100644 --- a/crypt.tex +++ b/crypt.tex @@ -277,15 +277,15 @@ \chapter{The Application Programming Interface (API)} \begin{small} \begin{center} \begin{tabular}{|c|c|c|} - \hline STORE32L(x, y) & {\bf unsigned long} x, {\bf unsigned char} *y & $x \to y[0 \ldots 3]$ \\ - \hline STORE64L(x, y) & {\bf unsigned long long} x, {\bf unsigned char} *y & $x \to y[0 \ldots 7]$ \\ - \hline LOAD32L(x, y) & {\bf unsigned long} x, {\bf unsigned char} *y & $y[0 \ldots 3] \to x$ \\ - \hline LOAD64L(x, y) & {\bf unsigned long long} x, {\bf unsigned char} *y & $y[0 \ldots 7] \to x$ \\ - \hline STORE32H(x, y) & {\bf unsigned long} x, {\bf unsigned char} *y & $x \to y[3 \ldots 0]$ \\ - \hline STORE64H(x, y) & {\bf unsigned long long} x, {\bf unsigned char} *y & $x \to y[7 \ldots 0]$ \\ - \hline LOAD32H(x, y) & {\bf unsigned long} x, {\bf unsigned char} *y & $y[3 \ldots 0] \to x$ \\ - \hline LOAD64H(x, y) & {\bf unsigned long long} x, {\bf unsigned char} *y & $y[7 \ldots 0] \to x$ \\ - \hline BSWAP(x) & {\bf unsigned long} x & Swap bytes \\ + \hline STORE32L(x, y) & {\bf ulong32} x, {\bf unsigned char} *y & $x \to y[0 \ldots 3]$ \\ + \hline STORE64L(x, y) & {\bf ulong64} x, {\bf unsigned char} *y & $x \to y[0 \ldots 7]$ \\ + \hline LOAD32L(x, y) & {\bf ulong32} x, {\bf unsigned char} *y & $y[0 \ldots 3] \to x$ \\ + \hline LOAD64L(x, y) & {\bf ulong64} x, {\bf unsigned char} *y & $y[0 \ldots 7] \to x$ \\ + \hline STORE32H(x, y) & {\bf ulong32} x, {\bf unsigned char} *y & $x \to y[3 \ldots 0]$ \\ + \hline STORE64H(x, y) & {\bf ulong64} x, {\bf unsigned char} *y & $x \to y[7 \ldots 0]$ \\ + \hline LOAD32H(x, y) & {\bf ulong32} x, {\bf unsigned char} *y & $y[3 \ldots 0] \to x$ \\ + \hline LOAD64H(x, y) & {\bf ulong64} x, {\bf unsigned char} *y & $y[7 \ldots 0] \to x$ \\ + \hline BSWAP(x) & {\bf ulong32} x & Swap bytes \\ \hline \end{tabular} \caption{Load And Store Macros} @@ -299,15 +299,15 @@ \chapter{The Application Programming Interface (API)} \begin{small} \begin{center} \begin{tabular}{|c|c|c|} - \hline ROL(x, y) & {\bf unsigned long} x, {\bf unsigned long} y & $x << y, 0 \le y \le 31$ \\ - \hline ROLc(x, y) & {\bf unsigned long} x, {\bf const unsigned long} y & $x << y, 0 \le y \le 31$ \\ - \hline ROR(x, y) & {\bf unsigned long} x, {\bf unsigned long} y & $x >> y, 0 \le y \le 31$ \\ - \hline RORc(x, y) & {\bf unsigned long} x, {\bf const unsigned long} y & $x >> y, 0 \le y \le 31$ \\ + \hline ROL(x, y) & {\bf ulong32} x, {\bf ulong32} y & $x << y, 0 \le y \le 31$ \\ + \hline ROLc(x, y) & {\bf ulong32} x, {\bf const ulong32} y & $x << y, 0 \le y \le 31$ \\ + \hline ROR(x, y) & {\bf ulong32} x, {\bf ulong32} y & $x >> y, 0 \le y \le 31$ \\ + \hline RORc(x, y) & {\bf ulong32} x, {\bf const ulong32} y & $x >> y, 0 \le y \le 31$ \\ \hline && \\ - \hline ROL64(x, y) & {\bf unsigned long} x, {\bf unsigned long} y & $x << y, 0 \le y \le 63$ \\ - \hline ROL64c(x, y) & {\bf unsigned long} x, {\bf const unsigned long} y & $x << y, 0 \le y \le 63$ \\ - \hline ROR64(x, y) & {\bf unsigned long} x, {\bf unsigned long} y & $x >> y, 0 \le y \le 63$ \\ - \hline ROR64c(x, y) & {\bf unsigned long} x, {\bf const unsigned long} y & $x >> y, 0 \le y \le 63$ \\ + \hline ROL64(x, y) & {\bf ulong64} x, {\bf ulong64} y & $x << y, 0 \le y \le 63$ \\ + \hline ROL64c(x, y) & {\bf ulong64} x, {\bf const ulong64} y & $x << y, 0 \le y \le 63$ \\ + \hline ROR64(x, y) & {\bf ulong64} x, {\bf ulong64} y & $x >> y, 0 \le y \le 63$ \\ + \hline ROR64c(x, y) & {\bf ulong64} x, {\bf const ulong64} y & $x >> y, 0 \le y \le 63$ \\ \hline \end{tabular} \caption{Rotate Macros} From 3c8743e1025e4a937bed4e51af4dad2de6d31f1d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 27 Aug 2014 14:39:03 +0200 Subject: [PATCH 0653/1192] add SHA512/t documentation --- crypt.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypt.tex b/crypt.tex index c38f40428..85e5743c7 100644 --- a/crypt.tex +++ b/crypt.tex @@ -2067,8 +2067,10 @@ \subsection{Hash Registration} \hline SHA-512 & sha512\_desc & 64 \\ \hline SHA-384 & sha384\_desc & 48 \\ \hline RIPEMD-320 & rmd160\_desc & 40 \\ + \hline SHA-512/256 & sha512\_256\_desc & 32 \\ \hline SHA-256 & sha256\_desc & 32 \\ \hline RIPEMD-256 & rmd160\_desc & 32 \\ + \hline SHA-512/224 & sha512\_224\_desc & 28 \\ \hline SHA-224 & sha224\_desc & 28 \\ \hline TIGER-192 & tiger\_desc & 24 \\ \hline SHA-1 & sha1\_desc & 20 \\ @@ -2144,7 +2146,7 @@ \subsection{Hash Registration} These hashes are provided for completeness and they still can be used for the purposes of password hashing or one-way accumulators (e.g. Yarrow). -The other hashes such as the SHA-1, SHA-2 (that includes SHA-512, SHA-384, SHA-256 and SHA-224) and TIGER-192 are still considered secure +The other hashes such as the SHA-1, SHA-2 (that includes SHA-512, SHA-512/384, SHA-384, SHA-512/256, SHA-256 and SHA-224) and TIGER-192 are still considered secure for all purposes you would normally use a hash for. \chapter{Message Authentication Codes} From d2047f4b61cc143807b3e1c5394be305f64b8dae Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Sat, 30 Aug 2014 23:50:42 -0700 Subject: [PATCH 0654/1192] added sec 11.3, dynamic lang support --- crypt.tex | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/crypt.tex b/crypt.tex index 85e5743c7..c80921ee6 100644 --- a/crypt.tex +++ b/crypt.tex @@ -5394,6 +5394,131 @@ \chapter{Miscellaneous} \textit{len = -128} to the function. Upon success it will return {\bf CRYPT\_OK} and \textit{N} will contain an integer which is very likely prime. +\mysection{Dynamic Language Support} +\index{Dynamic Language Support} +Various LibTomCrypt functions require that their callers define a struct +(or a union) and provide a pointer to it, or allocate sufficient memory and +provide its pointer. Programs written in C or C++ can obtain the necessary +information by simply including the appropriate header files, but dynamic +languages like Python don't understand C header files, and without assistance, +have no way to know how much memory to allocate. A similar story can be told +for certain LTC constant values. + +LTC's Dynamic Language Support provides functions that return the size of +a named struct or union, the value of a named constant, a list of all sizes +supported, and a list of all named constants supported. Two additional +functions can initialize LTM and TFM. + +To get the size of a named struct or union: +\begin{verbatim} +int crypt_get_size(const char *namein, + int *sizeout); +\end{verbatim} +$namein$ is spelled exactly as found in the C header files with "_struct" +or "_union" appended to the name. This function will return -1 if $namein$ +is not found. + +To get the value of a named constant: +\begin{verbatim} +int crypt_get_constant(const char *namein, + int *valueout); +\end{verbatim} +$namein$ is spelled exactly as found in the C header files. Again, -1 is +returned if $namein$ is not found. + +To get the names of all the supported structs, unions and constants: +\begin{verbatim} +int crypt_list_all_sizes(char *names_list, + int *names_list_size); + +int crypt_list_all_constants(char *names_list, + int *names_list_size); +\end{verbatim} +You may want to call these functions twice, first to get the amount +of memory to be allocated for the $names_list$, and a final time to +actually populate $names_list$. If $names_list$ is NULL, +$names_list_size$ will be the minimum size needed to receive the +complete $names_list$. If $names_list$ is NOT NULL, $names_list$ must +be a pointer to sufficient memory into which the $names_list$ will be +written. Also, the value in $names_list_size$ sets the upper bound of +the number of characters to be written. A -1 return value signifies +insufficient space. + +The format of the $names_list$ string is a series of $name,value$ pairs +where each name and value is separated by a comma, the pairs are separated +by newlines, and the list is null terminated. + +Calling either of these functions will initialize the respective +math library. +\begin{verbatim} +void init_LTM(void); +void init_TFM(void); +\end{verbatim} + +Here is a Python program demonstrating how to call various LTC dynamic +language support functions. +\begin{verbatim} +from ctypes import * + +# load the OSX shared/dynamic library +LIB = CDLL('libtomcrypt.dylib') + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# print info about this library + +little = c_int() # assume False is big +word32 = c_int() # assume False is 64-bit + +LIB.crypt_get_constant('ENDIAN_LITTLE', byref(little)) +LIB.crypt_get_constant('ENDIAN_32BITWORD', byref(word32)) + +print('this lib was compiled for a %s endian %d-bit processor' + % ('little' if little else 'big', 32 if word32 else 64)) + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# print the size of the struct named "sha256_state" + +struct_size = c_int() + +# don't forget to add the '_struct' or '_union' suffix +LIB.crypt_get_size('sha256_state_struct', byref(struct_size)) + +print('allocate %d bytes for sha256_state' % struct_size.value) + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# print a list of all supported named constants + +list_size = c_int() + +# call with NULL to calc the min size needed for the list +LIB.crypt_list_all_constants(None, byref(list_size)) + +# allocate required space +names_list = c_buffer(list_size.value) + +# call again providing a pointer to where to write the list +LIB.crypt_list_all_constants(names_list, byref(list_size)) + +print(names_list.value) + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# print a list of all supported named structs and unions + +list_size = c_int() + +# call with NULL to calc the min size needed for the list +LIB.crypt_list_all_sizes(None, byref(list_size)) + +# allocate required space +names_list = c_buffer(list_size.value) + +# call again providing a pointer to where to write the list +LIB.crypt_list_all_sizes(names_list, byref(list_size)) + +print(names_list.value) +\end{verbatim} + + \chapter{Programming Guidelines} \mysection{Secure Pseudo Random Number Generators} From 2a98d0a11fa528332cad669ae041c30878b7d8e3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 29 Sep 2014 23:42:40 +0200 Subject: [PATCH 0655/1192] adapt dynamic language documentation to modified API and functionality --- crypt.tex | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/crypt.tex b/crypt.tex index c80921ee6..781b06c86 100644 --- a/crypt.tex +++ b/crypt.tex @@ -5411,12 +5411,11 @@ \chapter{Miscellaneous} To get the size of a named struct or union: \begin{verbatim} -int crypt_get_size(const char *namein, - int *sizeout); +int crypt_get_size( const char *namein, + unsigned int *sizeout); \end{verbatim} -$namein$ is spelled exactly as found in the C header files with "_struct" -or "_union" appended to the name. This function will return -1 if $namein$ -is not found. +$namein$ is spelled exactly as found in the C header files. This function will +return -1 if $namein$ is not found. To get the value of a named constant: \begin{verbatim} @@ -5428,11 +5427,11 @@ \chapter{Miscellaneous} To get the names of all the supported structs, unions and constants: \begin{verbatim} -int crypt_list_all_sizes(char *names_list, - int *names_list_size); +int crypt_list_all_sizes( char *names_list, + unsigned int *names_list_size); -int crypt_list_all_constants(char *names_list, - int *names_list_size); +int crypt_list_all_constants( char *names_list, + unsigned int *names_list_size); \end{verbatim} You may want to call these functions twice, first to get the amount of memory to be allocated for the $names_list$, and a final time to From 3233e51a230d93299e29fb6f79c9d7b76048d1b5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 9 Oct 2014 21:39:22 +0200 Subject: [PATCH 0656/1192] update documentation regarding RSA key import/export --- crypt.tex | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/crypt.tex b/crypt.tex index 781b06c86..94a20382b 100644 --- a/crypt.tex +++ b/crypt.tex @@ -3673,7 +3673,7 @@ \subsection{Extended Verification} \mysection{RSA Key Format} The RSA key format adopted for exporting and importing keys is the PKCS \#1 format defined by the ASN.1 constructs known as -RSAPublicKey and RSAPrivateKey. Additionally, the OpenSSL key format is supported by the import function only. +RSAPublicKey and RSAPrivateKey. Additionally, the OpenSSL key format is supported as well. \subsection{RSA Key Export} To export a RSA key use the following function. @@ -3685,8 +3685,17 @@ \subsection{RSA Key Export} int type, rsa_key *key); \end{verbatim} -This will export the RSA key in either a RSAPublicKey or RSAPrivateKey (PKCS \#1 types) depending on the value of \textit{type}. When it is -set to \textbf{PK\_PRIVATE} the export format will be RSAPrivateKey and otherwise it will be RSAPublicKey. + +This will export the RSA key depending on the value of \textit{type}. + +The RSAPublicKey (PKCS \#1 type) format will be used for the public key, +indicated by \textbf{PK\_PUBLIC}. +The RSAPrivateKey (PKCS \#1 type) format will be used for the private key, +indicated by \textbf{PK\_PRIVATE}. + +As of v1.18 this function can also export OpenSSL-compatible formatted public RSA keys. +By OR'ing \textbf{PK\_STD} and \textbf{PK\_PUBLIC} the public key will be exported +in the SubjectPublicKeyInfo (X.509 type) format. \subsection{RSA Key Import} To import a RSA key use the following function. @@ -3702,8 +3711,7 @@ \subsection{RSA Key Import} function can import both RSAPublicKey and RSAPrivateKey formats. As of v1.06 this function can also import OpenSSL DER formatted public RSA keys. They are essentially encapsulated RSAPublicKeys. LibTomCrypt will -import the key, strip off the additional data (it's the preferred hash) and fill in the rsa\_key structure as if it were a native RSAPublicKey. Note that -there is no function provided to export in this format. +import the key, strip off the additional data and fill in the rsa\_key structure. \chapter{Diffie-Hellman Key Exchange} From 627aef962c2d1f9c4defd16f06c173591db41761 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 9 Oct 2014 22:39:39 +0200 Subject: [PATCH 0657/1192] add documentation of ASN.1 context-specific decoding --- crypt.tex | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/crypt.tex b/crypt.tex index 94a20382b..99d6f07d5 100644 --- a/crypt.tex +++ b/crypt.tex @@ -5058,7 +5058,9 @@ \subsection{ASN.1 Flexi Decoder} When a SEQUENCE or SET has been encountered a SEQUENCE (or SET resp.) item will be added as a sibling (e.g. list.type == LTC\_ASN1\_SEQUENCE) and the child pointer points to a new list of items contained within the object. -\index{der\_decode\_sequence\_flexi()}\index{LTC\_ASN1\_CONSTRUCTED} +\index{der\_decode\_sequence\_flexi()} +\index{LTC\_ASN1\_CONSTRUCTED} +\index{LTC\_ASN1\_CONTEXT\_SPECIFIC} \begin{verbatim} int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, @@ -5073,16 +5075,23 @@ \subsection{ASN.1 Flexi Decoder} An invalid decoding will terminate the process, and free the allocated memory automatically. -\textbf{Note:} the list decoded by this function is \textbf{NOT} in the correct form for der\_encode\_sequence() to use directly. You will first -have to convert the list by first storing all of the siblings in an array then storing all the children as sub-lists of a sequence using the \textit{.data} -pointer. Currently no function in LibTomCrypt provides this ability. - -\textbf{Note 2:} the flexi decoder will also decode arbitrary constructed types +As of v1.18 the flexi decoder will also decode arbitrary constructed types other than SEQUENCE and SET. The \textit{type} field will be set to -\textbf{LTC\_ASN1\_CONSTRUCTED} and the plain type that was indicated in the ASN.1 +\textbf{LTC\_ASN1\_CONSTRUCTED} and the plain identifier that was indicated in the ASN.1 encoding is stored in the \textit{used} field. Further decoding is done in the same way as if it were a SEQUENCE or SET. +Also as of v1.18 the flexi decoder is capable to handle +\textit{context-specific} encodings. The \textit{type} field will be set to +\textbf{LTC\_ASN1\_CONTEXT\_SPECIFIC} and the plain identifier that was indicated +in the ASN.1 encoding is stored in the \textit{used} field. Encapsulated data +in the \textit{context-specific} encoding is copied to newly allocated memory +and is accessible through the \textit{data} field. + +\textbf{Note:} the list decoded by this function is \textbf{NOT} in the correct form for der\_encode\_sequence() to use directly. You will first +have to convert the list by first storing all of the siblings in an array then storing all the children as sub-lists of a sequence using the \textit{.data} +pointer. Currently no function in LibTomCrypt provides this ability. + \subsubsection{Sample Decoding} Suppose we decode the following structure: \begin{small} From 6a47cb5931c407293bad4746cb166263ba92e34c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 9 Oct 2014 22:43:30 +0200 Subject: [PATCH 0658/1192] describe behavior of the flexi decoder on unknown identifiers --- crypt.tex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypt.tex b/crypt.tex index 99d6f07d5..958f52a67 100644 --- a/crypt.tex +++ b/crypt.tex @@ -5075,6 +5075,13 @@ \subsection{ASN.1 Flexi Decoder} An invalid decoding will terminate the process, and free the allocated memory automatically. +The flexi decoder calls itself when decoding a constructed type. This leads to +a 'child process' that will terminate when it decodes an unkown/invalid +identifier and leaves an allocated but uninitialized child element. +However the parent processing will continue with a "soft-error". +This can be detected by checking for \textit{child} elements with +type \textbf{LTC\_ASN1\_EOL} after decoding. + As of v1.18 the flexi decoder will also decode arbitrary constructed types other than SEQUENCE and SET. The \textit{type} field will be set to \textbf{LTC\_ASN1\_CONSTRUCTED} and the plain identifier that was indicated in the ASN.1 From 17b961e554dd8a588bf70e585c341dae908e42b2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 9 Oct 2014 23:09:10 +0200 Subject: [PATCH 0659/1192] update changes document include changes proposed by @buggywhip fix typos [skip ci] --- changes | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/changes b/changes index 4c8ef58a4..85e0d8c6a 100644 --- a/changes +++ b/changes @@ -1,17 +1,20 @@ XXX, 2014 -v1.18 -- Added Camellia block cipher +v1.18.0 + -- Added Camellia block cipher -- Thanks to Karel Miko for cotributing a bunchload of patches and additions, namely OCBv3, DSA and ECC key generation FIPS-186-4 compliance, BASE64-URL encoding, a bugfix in Camellia, - -- Larry Bugbee contributed the necessary stuff to easier include libtomcrypt - in a foreign language like python, as shown in his pyTomCrypt + -- Larry Bugbee contributed the necessary stuff to more easily call libtomcrypt + from a dynamic language like Python, as shown in his pyTomCrypt -- Nikos Mavrogiannopoulos contributed RSA blinding and export of RSA and DSA keys in OpenSSL/GnuTLS compatible format -- Patrick Pelletier contributed a smart volley of patches -- RyanC contributed HKDF including documentation (yippie) -- Added 2-key Triple-DES mode, thanks to Paul Howarth - -- Christopher Braun contributed some patches and additions to ASN.1/DER - -- Applied some patches from the OLPC project regarding PKCS#1 and preventing the + -- Christopher Brown contributed some patches and additions to ASN.1/DER + -- Pascal Brand of STMicroelectronics contributed patches regarding the + XTS mode and RSA private key operations with keys without CRT parameters + -- Applied some patches from the OLPC project regarding PKCS#1 and preventing the hash algorithms from overflowing -- Fixed the Bleichbacher Signature attack in PKCS#1 v1.5 EMSA, thanks to Alex Dent -- Add PKCS#1 testvectors from RSA @@ -21,6 +24,7 @@ v1.18 -- Added Camellia block cipher -- Documentation (crypt.pdf) is now built deterministically, thanks to Michael Stapelberg -- Removed all compiler warnings -- Improved/extended several tests + -- Add SHA512/256 and SHA512/224 -- Bugfix multi2 -- Bugfix Noekeon -- Bugfix XTEA From 699f52418ef47137fc9ea5da608fbddc6bbc73a3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 10 Oct 2014 16:43:53 +0200 Subject: [PATCH 0660/1192] don't use SHA1 @buggywhip is right [skip ci] --- crypt.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypt.tex b/crypt.tex index 958f52a67..ce740a1d1 100644 --- a/crypt.tex +++ b/crypt.tex @@ -2146,7 +2146,7 @@ \subsection{Hash Registration} These hashes are provided for completeness and they still can be used for the purposes of password hashing or one-way accumulators (e.g. Yarrow). -The other hashes such as the SHA-1, SHA-2 (that includes SHA-512, SHA-512/384, SHA-384, SHA-512/256, SHA-256 and SHA-224) and TIGER-192 are still considered secure +The other hashes such as the SHA-2 (that includes SHA-512, SHA-512/384, SHA-384, SHA-512/256, SHA-256 and SHA-224) and TIGER-192 are still considered secure for all purposes you would normally use a hash for. \chapter{Message Authentication Codes} From 1cf965cfccfb72eff78c1846557bb8c8aaedfb99 Mon Sep 17 00:00:00 2001 From: Pascal Brand Date: Mon, 3 Nov 2014 10:25:40 +0100 Subject: [PATCH 0661/1192] Add doc for CCM Authentication full set of functions Change-Id: I2830ea3c04fd0410cc12137be41e6c511c4a47fe --- crypt.tex | 233 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 168 insertions(+), 65 deletions(-) diff --git a/crypt.tex b/crypt.tex index ce740a1d1..88d087497 100644 --- a/crypt.tex +++ b/crypt.tex @@ -1511,9 +1511,91 @@ \subsubsection{Packet Functions} appropriately. \subsection{CCM Mode} -CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. Unlike EAX and OCB mode, -it is only meant for \textit{packet} mode where the length of the input is known in advance. Since it is a packet mode function, CCM only has one -function that performs the protocol. +CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. + +\subsubsection{Initialization} +To initialize the CCM context with a secret key call the following function. + +\index{ccm\_init()} +\begin{verbatim} +int ccm_init( ccm_state *ccm, + int cipher, + const unsigned char *key, + int keylen, + int ptlen, + int taglen, + int aadlen); +\end{verbatim} +This initializes the CCM state \textit{ccm} for the given cipher indexed by \textit{cipher}, with a secret key \textit{key} of length \textit{keylen} octets. The cipher +chosen must have a 16--byte block size (e.g., AES). +Unlike EAX and OCB mode, CCM is only meant for \textit{packet} mode where the length of the input is known in advance. This is why the length of the stream +to authenticate is given as \textit{ptlen}. +With CCM, a header is meta--data you want to send with the message but not have encrypted. The header len is given in the init +as \textit{aadlen}. + +\subsubsection{Nonce Vector} +After the state has been initialized (or reset) the next step is to add the session (or packet) initial vector. It should be unique per packet encrypted. + +\index{ccm\_add\_nonce()} +\begin{verbatim} +int ccm_add_nonce( ccm_state *ccm, + const unsigned char *nonce, + unsigned long noncelen); +\end{verbatim} + +This adds the nonce or salt is \textit{nonce} of length \textit{noncelen} octets to the CCM state \textit{ccm}. Note that this function must be called +once and only once. + +\subsubsection{Additional Authentication Data} +The header is meta--data you want to send with the message but not have encrypted, it is stored in \textit{adata} of length \textit{adatalen} octets. + +\index{ccm\_add\_aad()} +\begin{verbatim} +int ccm_add_aad( ccm_state *ccm, + const unsigned char *adata, + unsigned long adatalen); +\end{verbatim} +This adds the additional authentication data \textit{adata} of length \textit{adatalen} to the CCM state \textit{ccm}. + +\subsubsection{Plaintext Processing} +After the AAD has been processed, the plaintext (or ciphertext depending on the direction) can be processed. + +\index{ccm\_process()} +\begin{verbatim} +int ccm_process(ccm_state *ccm, + unsigned char *pt, + unsigned long ptlen, + unsigned char *ct, + int direction); +\end{verbatim} +This processes message data where \textit{pt} is the plaintext and \textit{ct} is the ciphertext. The length of both are equal and stored in \textit{ptlen}. Depending on +the mode \textit{pt} is the input and \textit{ct} is the output (or vice versa). When \textit{direction} equals \textbf{CCM\_ENCRYPT} the plaintext is read, +encrypted and stored in the ciphertext buffer. When \textit{direction} equals \textbf{CCM\_DECRYPT} the opposite occurs. + +\subsubsection{State Termination} +To terminate a CCM state and retrieve the message authentication tag call the following function. + +\index{ccm\_done()} +\begin{verbatim} +int ccm_done( ccm_state *ccm, + unsigned char *tag, + unsigned long *taglen); +\end{verbatim} +This terminates the CCM state \textit{ccm} and stores the tag in \textit{tag} of length \textit{taglen} octets. + +\subsubsection{State Reset} +The call to ccm\_init() will perform considerable pre--computation and if you're going to be dealing with a lot of packets +it is very costly to have to call it repeatedly. To aid in this endeavour, the reset function has been provided. + +\index{ccm\_reset()} +\begin{verbatim} +int ccm_reset(ccm_state *ccm); +\end{verbatim} + +This will reset the CCM state \textit{ccm} to the state that ccm\_init() left it. The user would then call ccm\_add\_nonce(), ccm\_add\_aad(), etc. + +\subsubsection{One--Shot Packet} +To process a single packet under any given key the following helper function can be used. \index{ccm\_memory()} \begin{verbatim} @@ -1529,86 +1611,107 @@ \subsection{CCM Mode} int direction); \end{verbatim} -This performs the \textit{CCM} operation on the data. The \textit{cipher} variable indicates which cipher in the descriptor table to use. It must have a -16--byte block size for CCM. +This will initialize the CCM state with the given key, nonce and AAD value then proceed to encrypt or decrypt the message text and store the final +message tag. The definition of the variables is the same as it is for all the manual functions. -The key can be specified in one of two fashions. First, it can be passed as an array of octets in \textit{key} of length \textit{keylen}. Alternatively, -it can be passed in as a previously scheduled key in \textit{uskey}. The latter fashion saves time when the same key is used for multiple packets. If -\textit{uskey} is not \textbf{NULL}, then \textit{key} may be \textbf{NULL} (and vice-versa). +If you are processing many packets under the same key you shouldn't use this function as it invokes the pre--computation with each call. -The nonce or salt is \textit{nonce} of length \textit{noncelen} octets. The header is meta--data you want to send with the message but not have -encrypted, it is stored in \textit{header} of length \textit{headerlen} octets. The header can be zero octets long (if $headerlen = 0$ then -you can pass \textit{header} as \textbf{NULL}). +\subsubsection{Example Usage} +The following is an example usage of how to use CCM over multiple packets with a shared secret key. -The plaintext is stored in \textit{pt}, and the ciphertext in \textit{ct}. The length of both are expected to be equal and is passed in as \textit{ptlen}. It is -allowable that $pt = ct$. The \textit{direction} variable indicates whether encryption (direction $=$ \textbf{CCM\_ENCRYPT}) or -decryption (direction $=$ \textbf{CCM\_DECRYPT}) is to be performed. +\begin{small} +\begin{verbatim} +#include -As implemented, this version of CCM cannot handle header or plaintext data longer than $2^{32} - 1$ octets long. +int send_packet(const unsigned char *pt, unsigned long ptlen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *aad, unsigned long aadlen, + ccm_state *ccm) +{ + int err; + unsigned long taglen; + unsigned char tag[16]; -You can test the implementation of CCM with the following function. + /* reset the state */ + if ((err = ccm_reset(ccm)) != CRYPT_OK) { + return err; + } -\index{ccm\_test()} -\begin{verbatim} -int ccm_test(void); -\end{verbatim} + /* Add the nonce */ + if ((err = ccm_add_nonce(ccm, nonce, noncelen)) != CRYPT_OK) { + return err; + } -This will return \textbf{CRYPT\_OK} if the CCM routine passes known test vectors. It requires AES or Rijndael to be registered previously, otherwise it will -return \textbf{CRYPT\_NOP}. + /* Add the AAD (note: aad can be NULL if aadlen == 0) */ + if ((err = ccm_add_aad(ccm, aad, aadlen)) != CRYPT_OK) { + return err; + } -\subsubsection{CCM Example} -The following is a sample of how to call CCM. + /* process the plaintext */ + if ((err = + ccm_process(ccm, pt, ptlen, pt, CCM_ENCRYPT)) != CRYPT_OK) { + return err; + } + + /* Finish up and get the MAC tag */ + taglen = sizeof(tag); + if ((err = ccm_done(ccm, tag, &taglen)) != CRYPT_OK) { + return err; + } + + /* ... send a header describing the lengths ... */ + + /* depending on the protocol and how nonce is + * generated you may have to send it too... */ + send(socket, nonce, noncelen, 0); + + /* send the aad */ + send(socket, aad, aadlen, 0); + + /* send the ciphertext */ + send(socket, pt, ptlen, 0); + + /* send the tag */ + send(socket, tag, taglen, 0); + + return CRYPT_OK; +} -\begin{small} -\begin{verbatim} -#include int main(void) { - unsigned char key[16], nonce[12], pt[32], ct[32], - tag[16], tagcp[16]; - unsigned long taglen; - int err; + ccm_state ccm; + unsigned char key[16], NONCE[12], pt[PACKET_SIZE]; + int err, x; + unsigned long ptlen; - /* register cipher */ - register_cipher(&aes_desc); + /* somehow fill key/NONCE with random values */ - /* somehow fill key, nonce, pt */ + /* register AES */ + register_cipher(&aes_desc); - /* encrypt it */ - taglen = sizeof(tag); + /* init the CCM state */ if ((err = - ccm_memory(find_cipher("aes"), - key, 16, /* 128-bit key */ - NULL, /* not prescheduled */ - nonce, 12, /* 96-bit nonce */ - NULL, 0, /* no header */ - pt, 32, /* [in] 32-byte plaintext */ - ct, /* [out] ciphertext */ - tag, &taglen, - CCM_ENCRYPT)) != CRYPT_OK) { - printf("ccm_memory error %s\n", error_to_string(err)); - return -1; + ccm_init(&ccm, find_cipher("aes"), key, 16, PACKET_SIZE, 16, size(NONCE))) != CRYPT_OK) { + whine_and_pout(err); } - /* ct[0..31] and tag[0..15] now hold the output */ - /* decrypt it */ - taglen = sizeof(tagcp); - if ((err = - ccm_memory(find_cipher("aes"), - key, 16, /* 128-bit key */ - NULL, /* not prescheduled */ - nonce, 12, /* 96-bit nonce */ - NULL, 0, /* no header */ - pt, 32, /* [out] 32-byte plaintext */ - ct, /* [in] ciphertext */ - tagcp, &taglen, - CCM_DECRYPT)) != CRYPT_OK) { - printf("ccm_memory error %s\n", error_to_string(err)); - return -1; - } + /* handle us some packets */ + for (;;) { + ptlen = make_packet_we_want_to_send(pt); - /* now pt[0..31] should hold the original plaintext, - tagcp[0..15] and tag[0..15] should have the same contents */ + /* use NONCE as counter (12 byte counter) */ + for (x = 11; x >= 0; x--) { + if (++NONCE[x]) { + break; + } + } + + if ((err = send_packet(pt, ptlen, NONCE, 12, NULL, 0, &ccm)) + != CRYPT_OK) { + whine_and_pout(err); + } + } + return EXIT_SUCCESS; } \end{verbatim} \end{small} From 84606ab8de526be869eb0bf69fa0599117d60120 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 3 Nov 2014 23:13:07 +0100 Subject: [PATCH 0662/1192] minor spelling corrections --- crypt.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypt.tex b/crypt.tex index 88d087497..daf63b0b3 100644 --- a/crypt.tex +++ b/crypt.tex @@ -1543,11 +1543,11 @@ \subsubsection{Nonce Vector} unsigned long noncelen); \end{verbatim} -This adds the nonce or salt is \textit{nonce} of length \textit{noncelen} octets to the CCM state \textit{ccm}. Note that this function must be called +This adds the nonce (a.k.a. salt) \textit{nonce} of length \textit{noncelen} octets to the CCM state \textit{ccm}. Note that this function must be called once and only once. \subsubsection{Additional Authentication Data} -The header is meta--data you want to send with the message but not have encrypted, it is stored in \textit{adata} of length \textit{adatalen} octets. +The header is meta--data you want to send with the message but not have encrypted, it must be stored in \textit{adata} of length \textit{adatalen} octets. \index{ccm\_add\_aad()} \begin{verbatim} @@ -1585,7 +1585,7 @@ \subsubsection{State Termination} \subsubsection{State Reset} The call to ccm\_init() will perform considerable pre--computation and if you're going to be dealing with a lot of packets -it is very costly to have to call it repeatedly. To aid in this endeavour, the reset function has been provided. +it is very costly to have to call it repeatedly. To aid in this endeavour, the reset function is provided. \index{ccm\_reset()} \begin{verbatim} From deeea5a1ec3fb7f74715a88b0f6f33915870489c Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 28 Jun 2015 20:35:13 +0200 Subject: [PATCH 0663/1192] fix crypt.tex with newer LaTeX: s/here/h/g See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790321 for context --- crypt.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crypt.tex b/crypt.tex index daf63b0b3..c90857999 100644 --- a/crypt.tex +++ b/crypt.tex @@ -2162,7 +2162,7 @@ \subsection{Hash Registration} The following hashes are provided as of this release within the LibTomCrypt library: \index{Hash descriptor table} -\begin{figure}[here] +\begin{figure}[h] \begin{center} \begin{tabular}{|c|c|c|} \hline \textbf{Name} & \textbf{Descriptor Name} & \textbf{Size of Message Digest (bytes)} \\ @@ -3028,7 +3028,7 @@ \subsection{Example} will return \textbf{CRYPT\_OK} if the PRNG was found and removed. Otherwise, it returns \textbf{CRYPT\_ERROR}. \subsection{PRNGs Provided} -\begin{figure}[here] +\begin{figure}[h] \begin{center} \begin{small} \begin{tabular}{|c|c|l|} @@ -4450,7 +4450,7 @@ \chapter{Digital Signature Algorithm} \textit{group\_size} the more difficult a forgery becomes upto a limit. The value of $group\_size$ is limited by $15 < group\_size < 1024$ and $modulus\_size - group\_size < 512$. Suggested values for the pairs are as follows. -\begin{figure}[here] +\begin{figure}[h] \begin{center} \begin{tabular}{|c|c|c|} \hline \textbf{Bits of Security} & \textbf{group\_size} & \textbf{modulus\_size} \\ @@ -4666,7 +4666,7 @@ \chapter{Standards Support} \end{verbatim} \end{small} -\begin{figure}[here] +\begin{figure}[h] \begin{center} \begin{small} \begin{tabular}{|l|l|} @@ -5689,7 +5689,7 @@ \subsection{Asymmetric Ciphers} Note that $n$ is not the bit-length but the magnitude. For example, for a 1024-bit key $n = 2^{1024}$. The work required is: -\begin{figure}[here] +\begin{figure}[h] \begin{center} \begin{tabular}{|c|c|} \hline RSA/DH Key Size (bits) & Work Factor ($log_2$) \\ @@ -5709,7 +5709,7 @@ \subsection{Asymmetric Ciphers} The work factor for ECC keys is much higher since the best attack is still fully exponential. Given a key of magnitude $n$ it requires $\sqrt n$ work. The following table summarizes the work required: -\begin{figure}[here] +\begin{figure}[h] \begin{center} \begin{tabular}{|c|c|} \hline ECC Key Size (bits) & Work Factor ($log_2$) \\ From 434280587a9bd56b30f0ca15583fa0a59aeeaec4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 13:26:12 +0100 Subject: [PATCH 0664/1192] also apply the verbosity settings to the doc generation --- makefile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/makefile b/makefile index 9fb01132a..702b02e67 100644 --- a/makefile +++ b/makefile @@ -12,8 +12,10 @@ PLATFORM := $(shell uname | sed -e 's/_.*//') ifeq ($V,1) silent= +silent_stdout= else silent=@ +silent_stdout= > /dev/null endif %.o: %.c @@ -360,7 +362,7 @@ clean: #build the doxy files (requires Doxygen, tetex and patience) doxy: - doxygen + doxygen $(silent_stdout) cd doc/doxygen/latex ; ${MAKE} ; mv -f refman.pdf ../../. echo The huge doxygen PDF should be available as doc/refman.pdf @@ -380,11 +382,11 @@ docs: crypt.tex mv crypt-deterministic.tex crypt.tex touch --reference=crypt.bak crypt.tex echo "hello" > crypt.ind - latex crypt > /dev/null - latex crypt > /dev/null - makeindex crypt.idx > /dev/null + latex crypt $(silent_stdout) + latex crypt $(silent_stdout) + makeindex crypt.idx $(silent_stdout) perl fixupind.pl - pdflatex crypt > /dev/null + pdflatex crypt $(silent_stdout) sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf mv -ivf crypt.pdf doc/crypt.pdf mv crypt.bak crypt.tex @@ -392,12 +394,12 @@ docs: crypt.tex docdvi: crypt.tex echo hello > crypt.ind - latex crypt > /dev/null - latex crypt > /dev/null + latex crypt $(silent_stdout) + latex crypt $(silent_stdout) makeindex crypt.idx perl fixupind.pl - latex crypt > /dev/null - latex crypt > /dev/null + latex crypt $(silent_stdout) + latex crypt $(silent_stdout) #zipup the project (take that!) no_oops: clean From 6c1d614a92c5e1ddb451cb9be3f8901ec5f52266 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 28 Feb 2017 13:27:02 +0100 Subject: [PATCH 0665/1192] update Doxyfile to a more recent version of doxygen --- Doxyfile | 2497 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 1827 insertions(+), 670 deletions(-) diff --git a/Doxyfile b/Doxyfile index f07c339bf..5a33f5c79 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,1155 +1,2312 @@ -# Doxyfile 1.3.9.1 +# Doxyfile 1.8.7 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project +# doxygen (www.doxygen.org) for a project. # -# All text after a hash (#) is considered a comment and will be ignored +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. # The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. PROJECT_NAME = LibTomCrypt -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. PROJECT_NUMBER = 1.17 -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. OUTPUT_DIRECTORY = doc/doxygen -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of source -# files, where putting all generated files in the same directory would otherwise -# cause performance problems for the file system. +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. CREATE_SUBDIRS = NO -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. OUTPUT_LANGUAGE = English -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. +# The default value is: YES. REPEAT_BRIEF = YES -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is used -# as the annotated text. Otherwise, the brief description is used as-is. If left -# blank, the following values are used ("$name" is automatically replaced with the -# name of the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief # description. +# The default value is: NO. ALWAYS_DETAILED_SEC = NO -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. FULL_PATH_NAMES = YES -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = src -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. STRIP_FROM_INC_PATH = src/headers -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. SHORT_NAMES = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. JAVADOC_AUTOBRIEF = YES -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. -MULTILINE_CPP_IS_BRIEF = NO +QT_AUTOBRIEF = NO -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. -DETAILS_AT_TOP = YES +MULTILINE_CPP_IS_BRIEF = NO -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. INHERIT_DOCS = YES -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. -DISTRIBUTE_GROUP_DOC = NO +SEPARATE_MEMBER_PAGES = NO -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = -ALIASES = +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = YES -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. SUBGROUPING = YES +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. EXTRACT_PRIVATE = YES -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. EXTRACT_LOCAL_METHODS = YES -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. HIDE_UNDOC_MEMBERS = NO -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. HIDE_UNDOC_CLASSES = NO -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. HIDE_IN_BODY_DOCS = NO -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. +# The default value is: system dependent. CASE_SENSE_NAMES = YES -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. HIDE_SCOPE_NAMES = NO -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. SHOW_INCLUDE_FILES = YES -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. SORT_MEMBER_DOCS = YES -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. SORT_BRIEF_DOCS = NO -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. SORT_BY_SCOPE_NAME = YES -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. SHOW_USED_FILES = YES +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = + #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. QUIET = NO -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. WARN_IF_UNDOCUMENTED = YES -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. WARN_IF_DOC_ERROR = YES -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. INPUT = src -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 -FILE_PATTERNS = +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. RECURSIVE = YES -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. -EXCLUDE = +EXCLUDE = -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. EXCLUDE_SYMLINKS = NO -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). -EXAMPLE_PATH = +EXAMPLE_PATH = -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. EXAMPLE_RECURSIVE = NO -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). -IMAGE_PATH = +IMAGE_PATH = -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. -INPUT_FILTER = +INPUT_FILTER = -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. -FILTER_PATTERNS = +FILTER_PATTERNS = -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. FILTER_SOURCE_FILES = NO +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. SOURCE_BROWSER = YES -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. INLINE_SOURCES = YES -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. STRIP_CODE_COMMENTS = NO -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. REFERENCES_RELATION = YES -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. ALPHABETICAL_INDEX = YES -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. GENERATE_HTML = YES -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a # standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = doc/header.html -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = doc/footer.html -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be # written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. -ENUM_VALUES_PER_LINE = 1 +GENERATE_TREEVIEW = YES -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = YES +ENUM_VALUES_PER_LINE = 1 -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , / zef6lux7}o%`T?vzLdND0&8sy0ooxZty$#OuUtWU=oM017o!?*PUV|kZ2#Yn8M^U3_ zQUiQVQ`7{K^NY?=20%M>@-gJfMpdJR8=~J0Lm|!;!;6rU+U65(CNlZKw8r7Vq~ErR zA~7S27eZjv$LwVl#io`JmOB)kXN%Pvgh?;d6S6OVtq-OfAsQdtKrRW@QrJ8L%O=WP z#ycLQ;9q7>IlT!x2=Y z^y0(oa8Jm^ir%ck!z_(7lcGiKP_qD*(IgorB-a?+`pm6OKP1VsCKK36+OmmAv6B24 zo>Y9CKnBfPCQ#Xbt{x-Tne9l?+*jH@`xG-!c$xi-D@Rs82Y1zo5VQm zv85=|G3KV6Vam@#EIl=O(@odH!>2cF*${ER%wWn`njGK?!Xtwdi_VN4P)EcehZWx; zG4u#~7-tP<&LD@v7`mJ!q_vGUzMFz>bOh})`R$p(un>AL$dtFWE<>NozAPG}&BUuD z)cB%UXM}?yWNU6EQ{wRuf3DKc1C1-y;Uju|`DI(~UkJz6%Sp~(*9h8Oa*%!dMp7iUh8thxm1J zir=?bs7DWTpDT=B6)gU?^(N6O5egpUmkJe(;XuQI>P)?f(1V0-Wvn*y;|`_74ou6u zWaL^I`wj=%1WY%8XiHHql?^ttVC`JP8alkx)9LAhKS95G;RUBJt`0op1+_}S(Wdp& zi=ZDIHIUlYk8dsVyP5-`Rsh#vW}e);vX&IU?5(ZJsQC3CIPZxC!s>&V79!CjMyk=p z70q{jED>gX3C?*KZY^t-ZL$?|mrAQ3>DMX^?jS{PwP~G^kJJ}8P39zve3_N-WE^dP zV`xP_y7K$Xy&8c@n4C7Aas^Wp89eY;qs6A0q@aLsiq{I)EqX+rmSAg)S?_eb?qLhg z_q93RK_(rqT&P$7igPtq)%JaEo)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;(Cahe*gZ22TXk@i6vntO^NhSvNd?9~BsheSz2fC2P@_ zj4gAFdw8ZZsd7SWp-bj?u`dq4o}+Tc@%G`FrnHMQ?o;os1)=9brM{k94YT7*?WpFC^f4 zMpx(Z`HxHN5~>eud-EZ!?Z(TiA4&jPa-2PAWIlf1@N#Y&gApA?pv!o4_8E`TOPc47 zdk_+Ay#3Z3jE(iP4Z>Pv7^a2oM6&z+KB`qLpE>c!p{-emt|Zm>W9^~I33K8-a|Cqw z0Hez^B_o{p5H6?B953aD?}tJ+o#E!hZWsq(yM1_(2b*W9y9!+>@77te=3Eh@Xc%Ip z=dQ$%O#^t%v45fhu^mxv%oac5!OiJECnTMCCyAJg&zz8NauaYa)AY2*MjVO%aB!G# ztLKPpn$8Pb*e+g6uQhCce2l(6}Qq*d=0;l$pf8?(pAN}7i#lc9j)cy8Rm*!Pg{koWuk z?bDaPK7YG={rYtO+n0YoKTps;-GBW0_4|qIcKUd_|M2&pUr#`vKHlAbczgQ&_1lNb zyZ1jlT_2vFu8$Az9)H2rdrz3?=ciY1=N`WK|0n*qd-LY*pYNZ(eSaR@y&;S*uXitA Jy!-Y2-G81SSD63+ diff --git a/makefile b/makefile index e34d86214..694361ceb 100644 --- a/makefile +++ b/makefile @@ -365,7 +365,7 @@ doxygen: doxygen $(silent_stdout) doxy: doxygen - cd doc/doxygen/latex ; ${MAKE} ; mv -f refman.pdf ../../. + cd doc/doxygen/latex ; ${MAKE} $(silent_stdout) ; mv -f refman.pdf ../../. @echo The huge doxygen PDF should be available as doc/refman.pdf #This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed From 0094552828d4813e034adf879317e0143e7337dd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 24 Apr 2017 23:53:13 +0200 Subject: [PATCH 0669/1192] add doc for ASN.1 GeneralizedTime --- crypt.tex | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/crypt.tex b/crypt.tex index 8730bef2e..d5461abcb 100644 --- a/crypt.tex +++ b/crypt.tex @@ -4692,16 +4692,18 @@ \chapter{Standards Support} \hline LTC\_ASN1\_NULL & NULL \\ \hline LTC\_ASN1\_OBJECT\_IDENTIFIER & OBJECT IDENTIFIER \\ \hline LTC\_ASN1\_IA5\_STRING & IA5 STRING (one octet per char) \\ -\hline LTC\_ASN1\_UTF8\_STRING & UTF8 STRING (one wchar\_t per char) \\ \hline LTC\_ASN1\_PRINTABLE\_STRING & PRINTABLE STRING (one octet per char) \\ +\hline LTC\_ASN1\_UTF8\_STRING & UTF8 STRING (one wchar\_t per char) \\ \hline LTC\_ASN1\_UTCTIME & UTCTIME (see ltc\_utctime structure) \\ +\hline LTC\_ASN1\_CHOICE & CHOICE \\ \hline LTC\_ASN1\_SEQUENCE & SEQUENCE (and SEQUENCE OF) \\ \hline LTC\_ASN1\_SET & SET \\ \hline LTC\_ASN1\_SETOF & SET OF \\ -\hline LTC\_ASN1\_CHOICE & CHOICE \\ \hline LTC\_ASN1\_RAW\_BIT\_STRING & BIT STRING (one octet per char) \\ \hline LTC\_ASN1\_TELETEX\_STRING & TELETEX STRING (one octet per char) \\ \hline LTC\_ASN1\_CONSTRUCTED & A constructed type that is not SEQUENCE or SET \\ +\hline LTC\_ASN1\_CONTEXT\_SPECIFIC & A context-specific type \\ +\hline LTC\_ASN1\_GENERALIZEDTIME & GeneralizedTime (see ltc\_generalizedtime structure) \\ \hline \end{tabular} \caption{List of ASN.1 Supported Types} @@ -5141,6 +5143,57 @@ \subsection{ASN.1 UTCTIME} It is suggested that decoded data be further scrutinized (e.g. days of month in particular). +\subsection{ASN.1 GeneralizedTime} + +The GeneralizedTime type is to store a date and time in ASN.1 format. It uses the following structure to organize the time. + +\index{ltc\_utctime structure} +\begin{verbatim} +typedef struct { + unsigned YYYY, /* year 0--9999 */ + MM, /* month 1--12 */ + DD, /* day 1--31 */ + hh, /* hour 0--23 */ + mm, /* minute 0--59 */ + ss, /* second 0--59 */ + fs, /* fractional seconds 1--UINT_MAX */ + off_dir, /* timezone offset direction 0 == +, 1 == - */ + off_hh, /* timezone offset hours */ + off_mm; /* timezone offset minutes */ +} ltc_generalizedtime; +\end{verbatim} + +The time can be offset plus or minus a set amount of hours (off\_hh) and minutes (off\_mm). When \textit{off\_dir} is zero, the time will be added otherwise it +will be subtracted. For instance, the array $\lbrace 2005, 6, 20, 22, 4, 0, 122, 0, 5, 0 \rbrace$ represents the current time of +\textit{2005, June 20th, 22:04:00.122} with a time offset of +05h00. + +\index{der\_encode\_utctime()}\index{der\_decode\_utctime()}\index{der\_length\_utctime()} +\begin{verbatim} +int der_encode_generalizedtime(ltc_generalizedtime *gtime, + unsigned char *out, + unsigned long *outlen); + +int der_decode_generalizedtime(const unsigned char *in, + unsigned long *inlen, + ltc_generalizedtime *out); + +int der_length_generalizedtime(ltc_generalizedtime *gtime, + unsigned long *outlen); +\end{verbatim} + +The encoder will store time in one of the following ASN.1 formats, either \textit{YYYYMMDDhhmmssZ} or +\textit{YYYYMMDDhhmmss$\pm$hhmm} or\textit{YYYYMMDDhhmmss.fsZ} or \textit{YYYYMMDDhhmmss.fs$\pm$hhmm}, +and perform minimal error checking on the input. +The decoder will read all valid ASN.1 formats and perform range checking on the values (not complete but +rational) useful for catching packet errors. + +The fractional seconds are always added in case they are not $0$. +The implementation of fractional seconds is currently unreliable and you can't detect decoded +resp. encode leading $0$'s (e.g. \textit{20170424232717.005Z} would be decoded as +\textit{22. April 2017, 23:27:17.5}). + +It is suggested that decoded data be further scrutinized (e.g. days of month in particular). + \subsection{ASN.1 CHOICE} The CHOICE ASN.1 type represents a union of ASN.1 types all of which are stored in a \textit{ltc\_asn1\_list}. There is no encoder for the CHOICE type, only a From fe14c8bfaf9b8179b893ca3c98652fdb30417f8d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 24 Apr 2017 21:36:25 +0200 Subject: [PATCH 0670/1192] Move RC4 + SOBER128 to src/stream/ --- src/headers/tomcrypt_cipher.h | 38 +- src/headers/tomcrypt_custom.h | 29 +- src/headers/tomcrypt_prng.h | 36 +- src/misc/crypt/crypt.c | 9 +- src/prngs/chacha20.c | 135 ++--- src/prngs/fortuna.c | 91 ++-- src/prngs/rc4.c | 267 +++++----- src/prngs/rng_get_bytes.c | 2 - src/prngs/rng_make_prng.c | 2 - src/prngs/sober128.c | 498 +++++-------------- src/prngs/sprng.c | 2 - src/prngs/yarrow.c | 95 ++-- src/stream/chacha/chacha_crypt.c | 2 +- src/stream/chacha/chacha_done.c | 2 +- src/stream/chacha/chacha_ivctr32.c | 2 +- src/stream/chacha/chacha_ivctr64.c | 2 +- src/stream/chacha/chacha_keystream.c | 2 +- src/stream/chacha/chacha_setup.c | 2 +- src/stream/chacha/chacha_test.c | 35 +- src/stream/rc4/rc4.c | 107 ++++ src/stream/rc4/rc4_test.c | 35 ++ src/stream/sober128/sober128.c | 344 +++++++++++++ src/stream/sober128/sober128_test.c | 49 ++ src/{prngs => stream/sober128}/sober128tab.c | 0 testprof/cipher_hash_test.c | 10 +- testprof/x86_prof.c | 4 +- 26 files changed, 1065 insertions(+), 735 deletions(-) create mode 100644 src/stream/rc4/rc4.c create mode 100644 src/stream/rc4/rc4_test.c create mode 100644 src/stream/sober128/sober128.c create mode 100644 src/stream/sober128/sober128_test.c rename src/{prngs => stream/sober128}/sober128tab.c (100%) diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index 03cf80d4b..acb620027 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -939,7 +939,7 @@ LTC_MUTEX_PROTO(ltc_cipher_mutex) /* ---- stream ciphers ---- */ -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_STREAM typedef struct { ulong32 input[16]; @@ -957,7 +957,41 @@ int chacha_keystream(chacha_state *st, unsigned char *out, unsigned long outlen) int chacha_done(chacha_state *st); int chacha_test(void); -#endif /* LTC_CHACHA */ +#endif /* LTC_CHACHA_STREAM */ + +#ifdef LTC_RC4_STREAM + +typedef struct { + int x, y; + unsigned char buf[256]; +} rc4_state; + +int rc4_setup(rc4_state *st, const unsigned char *key, unsigned long keylen); +int rc4_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int rc4_keystream(rc4_state *st, unsigned char *out, unsigned long outlen); +int rc4_stream_done(rc4_state *st); +int rc4_test(void); + +#endif /* LTC_RC4_STREAM */ + +#ifdef LTC_SOBER128_STREAM + +typedef struct { + ulong32 R[17], /* Working storage for the shift register */ + initR[17], /* saved register contents */ + konst, /* key dependent constant */ + sbuf; /* partial word encryption buffer */ + int nbuf; /* number of part-word stream bits buffered */ +} sober128_state; + +int sober128_setup(sober128_state *st, const unsigned char *key, unsigned long keylen); +int sober128_setiv(sober128_state *st, const unsigned char *iv, unsigned long ivlen); +int sober128_crypt(sober128_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int sober128_keystream(sober128_state *st, unsigned char *out, unsigned long outlen); +int sober128_stream_done(sober128_state *st); +int sober128_test(void); + +#endif /* LTC_SOBER128_STREAM */ /* $Source$ */ /* $Revision$ */ diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 944b02b78..831c541c9 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -189,8 +189,11 @@ #define LTC_KASUMI #define LTC_MULTI2 #define LTC_CAMELLIA -/* ChaCha is special (a stream cipher) */ -#define LTC_CHACHA + +/* stream ciphers */ +#define LTC_CHACHA_STREAM +#define LTC_RC4_STREAM +#define LTC_SOBER128_STREAM #endif /* LTC_NO_CIPHERS */ @@ -295,7 +298,7 @@ /* a PRNG that simply reads from an available system source */ #define LTC_SPRNG -/* The LTC_RC4 stream cipher */ +/* The RC4 stream cipher based PRNG */ #define LTC_RC4 /* The ChaCha20 stream cipher based PRNG */ @@ -304,7 +307,7 @@ /* Fortuna PRNG */ #define LTC_FORTUNA -/* Greg's LTC_SOBER128 PRNG ;-0 */ +/* Greg's SOBER128 stream cipher based PRNG */ #define LTC_SOBER128 /* the *nix style /dev/random device */ @@ -515,12 +518,20 @@ #error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled #endif -#if defined(LTC_CHACHA20POLY1305_MODE) && (!defined(LTC_CHACHA) || !defined(LTC_POLY1305)) - #error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA + LTC_POLY1305 +#if defined(LTC_CHACHA20POLY1305_MODE) && (!defined(LTC_CHACHA_STREAM) || !defined(LTC_POLY1305)) + #error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA_STREAM + LTC_POLY1305 +#endif + +#if defined(LTC_CHACHA20_PRNG) && !defined(LTC_CHACHA_STREAM) + #error LTC_CHACHA20_PRNG requires LTC_CHACHA_STREAM +#endif + +#if defined(LTC_RC4) && !defined(LTC_RC4_STREAM) + #error LTC_RC4 requires LTC_RC4_STREAM #endif -#if defined(LTC_CHACHA20_PRNG) && !defined(LTC_CHACHA) - #error LTC_CHACHA20_PRNG requires LTC_CHACHA +#if defined(LTC_SOBER128) && !defined(LTC_SOBER128_STREAM) + #error LTC_SOBER128 requires LTC_SOBER128_STREAM #endif #if defined(LTC_BLAKE2SMAC) && !defined(LTC_BLAKE2S) @@ -557,7 +568,7 @@ /* Debuggers */ -/* define this if you use Valgrind, note: it CHANGES the way SOBER-128 and LTC_RC4 work (see the code) */ +/* define this if you use Valgrind, note: it CHANGES the way SOBER-128 and RC4 work (see the code) */ /* #define LTC_VALGRIND */ #endif diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 1b91ec6e1..b90d36b55 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -4,14 +4,12 @@ struct yarrow_prng { int cipher, hash; unsigned char pool[MAXBLOCKSIZE]; symmetric_CTR ctr; - LTC_MUTEX_TYPE(prng_lock) }; #endif #ifdef LTC_RC4 struct rc4_prng { - int x, y; - unsigned char buf[256]; + rc4_state s; }; #endif @@ -20,7 +18,6 @@ struct chacha20_prng { chacha_state s; /* chacha state */ unsigned char ent[40]; /* entropy buffer */ unsigned long idx; /* entropy counter */ - short ready; /* ready flag 0-1 */ }; #endif @@ -38,41 +35,38 @@ struct fortuna_prng { wd; ulong64 reset_cnt; /* number of times we have reset */ - LTC_MUTEX_TYPE(prng_lock) }; #endif #ifdef LTC_SOBER128 struct sober128_prng { - ulong32 R[17], /* Working storage for the shift register */ - initR[17], /* saved register contents */ - konst, /* key dependent constant */ - sbuf; /* partial word encryption buffer */ - - int nbuf, /* number of part-word stream bits buffered */ - flag, /* first add_entropy call or not? */ - set; /* did we call add_entropy to set key? */ - + sober128_state s; /* sober128 state */ + unsigned char ent[40]; /* entropy buffer */ + unsigned long idx; /* entropy counter */ }; #endif -typedef union Prng_state { - char dummy[1]; +typedef struct { + union { + char dummy[1]; #ifdef LTC_YARROW - struct yarrow_prng yarrow; + struct yarrow_prng yarrow; #endif #ifdef LTC_RC4 - struct rc4_prng rc4; + struct rc4_prng rc4; #endif #ifdef LTC_CHACHA20_PRNG - struct chacha20_prng chacha; + struct chacha20_prng chacha; #endif #ifdef LTC_FORTUNA - struct fortuna_prng fortuna; + struct fortuna_prng fortuna; #endif #ifdef LTC_SOBER128 - struct sober128_prng sober128; + struct sober128_prng sober128; #endif + }; + short ready; /* ready flag 0-1 */ + LTC_MUTEX_TYPE(lock); /* lock */ } prng_state; /** PRNG descriptor */ diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index d1311f98c..9787c13a7 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -124,9 +124,16 @@ const char *crypt_build_settings = #if defined(LTC_CAMELLIA) " Camellia\n" #endif -#if defined(LTC_CHACHA) + "Stream ciphers built-in:\n" +#if defined(LTC_CHACHA_STREAM) " ChaCha\n" #endif +#if defined(LTC_RC4_STREAM) + " RC4\n" +#endif +#if defined(LTC_SOBER128_STREAM) + " SOBER128\n" +#endif "\nHashes built-in:\n" #if defined(LTC_SHA3) diff --git a/src/prngs/chacha20.c b/src/prngs/chacha20.c index 45d554b28..faaf629ef 100644 --- a/src/prngs/chacha20.c +++ b/src/prngs/chacha20.c @@ -17,8 +17,8 @@ const struct ltc_prng_descriptor chacha20_prng_desc = { - "chacha", - sizeof(chacha_state), + "chacha20", + 40, &chacha20_prng_start, &chacha20_prng_add_entropy, &chacha20_prng_ready, @@ -37,9 +37,10 @@ const struct ltc_prng_descriptor chacha20_prng_desc = int chacha20_prng_start(prng_state *prng) { LTC_ARGCHK(prng != NULL); - prng->chacha.ready = 0; - XMEMSET(&prng->chacha.ent, 0, 40); + prng->ready = 0; + XMEMSET(&prng->chacha.ent, 0, sizeof(prng->chacha.ent)); prng->chacha.idx = 0; + LTC_MUTEX_INIT(&prng->lock) return CRYPT_OK; } @@ -60,23 +61,26 @@ int chacha20_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng LTC_ARGCHK(in != NULL); LTC_ARGCHK(inlen > 0); - if (prng->chacha.ready) { + LTC_MUTEX_LOCK(&prng->lock); + if (prng->ready) { /* chacha20_prng_ready() was already called, do "rekey" operation */ - if ((err = chacha_keystream(&prng->chacha.s, buf, 40)) != CRYPT_OK) return err; - for(i = 0; i < inlen; i++) buf[i % 40] ^= in[i]; + if ((err = chacha_keystream(&prng->chacha.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; + for(i = 0; i < inlen; i++) buf[i % sizeof(buf)] ^= in[i]; /* key 32 bytes, 20 rounds */ - if ((err = chacha_setup(&prng->chacha.s, buf, 32, 20)) != CRYPT_OK) return err; + if ((err = chacha_setup(&prng->chacha.s, buf, 32, 20)) != CRYPT_OK) goto LBL_UNLOCK; /* iv 8 bytes */ - if ((err = chacha_ivctr64(&prng->chacha.s, buf + 32, 8, 0)) != CRYPT_OK) return err; + if ((err = chacha_ivctr64(&prng->chacha.s, buf + 32, 8, 0)) != CRYPT_OK) goto LBL_UNLOCK; /* clear KEY + IV */ - XMEMSET(buf, 0, 40); + XMEMSET(buf, 0, sizeof(buf)); } else { /* chacha20_prng_ready() was not called yet, add entropy to ent buffer */ - while (inlen--) prng->chacha.ent[prng->chacha.idx++ % 40] ^= *in++; + while (inlen--) prng->chacha.ent[prng->chacha.idx++ % sizeof(prng->chacha.ent)] ^= *in++; } - - return CRYPT_OK; + err = CRYPT_OK; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -90,14 +94,18 @@ int chacha20_prng_ready(prng_state *prng) LTC_ARGCHK(prng != NULL); + LTC_MUTEX_LOCK(&prng->lock); + if (prng->ready) { err = CRYPT_OK; goto LBL_UNLOCK; } /* key 32 bytes, 20 rounds */ - if ((err = chacha_setup(&prng->chacha.s, prng->chacha.ent, 32, 20)) != CRYPT_OK) return err; + if ((err = chacha_setup(&prng->chacha.s, prng->chacha.ent, 32, 20)) != CRYPT_OK) goto LBL_UNLOCK; /* iv 8 bytes */ - if ((err = chacha_ivctr64(&prng->chacha.s, prng->chacha.ent + 32, 8, 0)) != CRYPT_OK) return err; - XMEMSET(&prng->chacha.ent, 0, 40); - prng->chacha.ready = 1; + if ((err = chacha_ivctr64(&prng->chacha.s, prng->chacha.ent + 32, 8, 0)) != CRYPT_OK) goto LBL_UNLOCK; + XMEMSET(&prng->chacha.ent, 0, sizeof(prng->chacha.ent)); prng->chacha.idx = 0; - return CRYPT_OK; + prng->ready = 1; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -109,8 +117,12 @@ int chacha20_prng_ready(prng_state *prng) */ unsigned long chacha20_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) { - LTC_ARGCHK(prng != NULL); - if (chacha_keystream(&prng->chacha.s, out, outlen) != CRYPT_OK) return 0; + if (outlen == 0 || prng == NULL || out == NULL) return 0; + LTC_MUTEX_LOCK(&prng->lock); + if (!prng->ready) { outlen = 0; goto LBL_UNLOCK; } + if (chacha_keystream(&prng->chacha.s, out, outlen) != CRYPT_OK) outlen = 0; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); return outlen; } @@ -121,8 +133,13 @@ unsigned long chacha20_prng_read(unsigned char *out, unsigned long outlen, prng_ */ int chacha20_prng_done(prng_state *prng) { + int err; LTC_ARGCHK(prng != NULL); - return chacha_done(&prng->chacha.s); + LTC_MUTEX_LOCK(&prng->lock); + prng->ready = 0; + err = chacha_done(&prng->chacha.s); + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -134,19 +151,21 @@ int chacha20_prng_done(prng_state *prng) */ int chacha20_prng_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { - unsigned long len = sizeof(chacha_state); - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(out != NULL); + unsigned long len = chacha20_prng_desc.export_size; + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); - if (!prng->chacha.ready) { - return CRYPT_ERROR; - } if (*outlen < len) { *outlen = len; return CRYPT_BUFFER_OVERFLOW; } - XMEMCPY(out, &prng->chacha.s, len); + + if (chacha20_prng_read(out, len, prng) != len) { + return CRYPT_ERROR_READPRNG; + } + *outlen = len; return CRYPT_OK; } @@ -160,13 +179,14 @@ int chacha20_prng_export(unsigned char *out, unsigned long *outlen, prng_state * */ int chacha20_prng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { - unsigned long len = sizeof(chacha_state); - LTC_ARGCHK(in != NULL); + int err; + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(in != NULL); + if (inlen < (unsigned long)chacha20_prng_desc.export_size) return CRYPT_INVALID_ARG; - if (inlen != len) return CRYPT_INVALID_ARG; - XMEMCPY(&prng->chacha.s, in, inlen); - prng->chacha.ready = 1; + if ((err = chacha20_prng_start(prng)) != CRYPT_OK) return err; + if ((err = chacha20_prng_add_entropy(in, inlen, prng)) != CRYPT_OK) return err; return CRYPT_OK; } @@ -188,29 +208,32 @@ int chacha20_prng_test(void) unsigned char dmp[300]; unsigned long dmplen = sizeof(dmp); unsigned char out[500]; - unsigned char t1[] = { 0x59, 0xb2, 0x26, 0x95, 0x2b, 0x01, 0x8f, 0x05, 0xbe, 0xd8 }; - unsigned char t2[] = { 0x30, 0x34, 0x5c, 0x6e, 0x56, 0x18, 0x8c, 0x46, 0xbe, 0x8a }; - - chacha20_prng_start(&st); - chacha20_prng_add_entropy(en, sizeof(en), &st); /* add entropy to uninitialized prng */ - chacha20_prng_ready(&st); - chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ - if (compare_testvector(out, 10, t1, sizeof(t1), "CHACHA-PRNG", 1)) return CRYPT_FAIL_TESTVECTOR; - chacha20_prng_read(out, 500, &st); - chacha20_prng_add_entropy(en, sizeof(en), &st); /* add entropy to already initialized prng */ - chacha20_prng_read(out, 500, &st); - chacha20_prng_export(dmp, &dmplen, &st); - chacha20_prng_read(out, 500, &st); /* skip 500 bytes */ - chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ - if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 2)) return CRYPT_FAIL_TESTVECTOR; - chacha20_prng_done(&st); - - XMEMSET(&st, 0xFF, sizeof(st)); /* just to be sure */ - chacha20_prng_import(dmp, dmplen, &st); - chacha20_prng_read(out, 500, &st); /* skip 500 bytes */ - chacha20_prng_read(out, 10, &st); /* 10 bytes for testing */ - if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 3)) return CRYPT_FAIL_TESTVECTOR; - chacha20_prng_done(&st); + unsigned char t1[] = { 0x59, 0xB2, 0x26, 0x95, 0x2B, 0x01, 0x8F, 0x05, 0xBE, 0xD8 }; + unsigned char t2[] = { 0x47, 0xC9, 0x0D, 0x03, 0xE4, 0x75, 0x34, 0x27, 0xBD, 0xDE }; + unsigned char t3[] = { 0xBC, 0xFA, 0xEF, 0x59, 0x37, 0x7F, 0x1A, 0x91, 0x1A, 0xA6 }; + int err; + + if ((err = chacha20_prng_start(&st)) != CRYPT_OK) return err; + /* add entropy to uninitialized prng */ + if ((err = chacha20_prng_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; + if ((err = chacha20_prng_ready(&st)) != CRYPT_OK) return err; + if (chacha20_prng_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t1, sizeof(t1), "CHACHA-PRNG", 1)) return CRYPT_FAIL_TESTVECTOR; + if (chacha20_prng_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + /* add entropy to already initialized prng */ + if ((err = chacha20_prng_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; + if (chacha20_prng_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if ((err = chacha20_prng_export(dmp, &dmplen, &st)) != CRYPT_OK) return err; + if (chacha20_prng_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if (chacha20_prng_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t2, sizeof(t2), "CHACHA-PRNG", 2)) return CRYPT_FAIL_TESTVECTOR; + if ((err = chacha20_prng_done(&st)) != CRYPT_OK) return err; + if ((err = chacha20_prng_import(dmp, dmplen, &st)) != CRYPT_OK) return err; + if ((err = chacha20_prng_ready(&st)) != CRYPT_OK) return err; + if (chacha20_prng_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if (chacha20_prng_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t3, sizeof(t3), "CHACHA-PRNG", 3)) return CRYPT_FAIL_TESTVECTOR; + if ((err = chacha20_prng_done(&st)) != CRYPT_OK) return err; return CRYPT_OK; #endif diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index 173deea5c..88ba28e39 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" @@ -133,6 +131,7 @@ int fortuna_start(prng_state *prng) unsigned char tmp[MAXBLOCKSIZE]; LTC_ARGCHK(prng != NULL); + prng->ready = 0; /* initialize the pools */ for (x = 0; x < LTC_FORTUNA_POOLS; x++) { @@ -156,7 +155,7 @@ int fortuna_start(prng_state *prng) } zeromem(prng->fortuna.IV, 16); - LTC_MUTEX_INIT(&prng->fortuna.prng_lock) + LTC_MUTEX_INIT(&prng->lock) return CRYPT_OK; } @@ -173,27 +172,25 @@ int fortuna_add_entropy(const unsigned char *in, unsigned long inlen, prng_state unsigned char tmp[2]; int err; - LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); - - LTC_MUTEX_LOCK(&prng->fortuna.prng_lock); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen > 0); /* ensure inlen <= 32 */ if (inlen > 32) { - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return CRYPT_INVALID_ARG; + inlen = 32; } /* add s || length(in) || in to pool[pool_idx] */ tmp[0] = 0; tmp[1] = (unsigned char)inlen; + + LTC_MUTEX_LOCK(&prng->lock); if ((err = sha256_process(&prng->fortuna.pool[prng->fortuna.pool_idx], tmp, 2)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return err; + goto LBL_UNLOCK; } if ((err = sha256_process(&prng->fortuna.pool[prng->fortuna.pool_idx], in, inlen)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return err; + goto LBL_UNLOCK; } if (prng->fortuna.pool_idx == 0) { prng->fortuna.pool0_len += inlen; @@ -201,9 +198,11 @@ int fortuna_add_entropy(const unsigned char *in, unsigned long inlen, prng_state if (++(prng->fortuna.pool_idx) == LTC_FORTUNA_POOLS) { prng->fortuna.pool_idx = 0; } + err = CRYPT_OK; /* success */ - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return CRYPT_OK; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -213,7 +212,15 @@ int fortuna_add_entropy(const unsigned char *in, unsigned long inlen, prng_state */ int fortuna_ready(prng_state *prng) { - return fortuna_reseed(prng); + int err; + LTC_ARGCHK(prng != NULL); + + LTC_MUTEX_LOCK(&prng->lock); + err = fortuna_reseed(prng); + prng->ready = (err == CRYPT_OK) ? 1 : 0; + + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -226,18 +233,20 @@ int fortuna_ready(prng_state *prng) unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state *prng) { unsigned char tmp[16]; - unsigned long tlen; + unsigned long tlen = 0; - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(prng != NULL); + if (outlen == 0 || prng == NULL || out == NULL) return 0; + + LTC_MUTEX_LOCK(&prng->lock); - LTC_MUTEX_LOCK(&prng->fortuna.prng_lock); + if (!prng->ready) { + goto LBL_UNLOCK; + } /* do we have to reseed? */ if (++prng->fortuna.wd == LTC_FORTUNA_WD || prng->fortuna.pool0_len >= 64) { if (fortuna_reseed(prng) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return 0; + goto LBL_UNLOCK; } } @@ -268,14 +277,14 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state fortuna_update_iv(prng); if (rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return 0; + tlen = 0; } #ifdef LTC_CLEAN_STACK zeromem(tmp, sizeof(tmp)); #endif - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); return tlen; } @@ -290,23 +299,25 @@ int fortuna_done(prng_state *prng) unsigned char tmp[32]; LTC_ARGCHK(prng != NULL); - LTC_MUTEX_LOCK(&prng->fortuna.prng_lock); + + LTC_MUTEX_LOCK(&prng->lock); + prng->ready = 0; /* terminate all the hashes */ for (x = 0; x < LTC_FORTUNA_POOLS; x++) { if ((err = sha256_done(&(prng->fortuna.pool[x]), tmp)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return err; + goto LBL_UNLOCK; } } /* call cipher done when we invent one ;-) */ + err = CRYPT_OK; /* success */ #ifdef LTC_CLEAN_STACK zeromem(tmp, sizeof(tmp)); #endif - - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return CRYPT_OK; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -325,19 +336,24 @@ int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng) LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(prng != NULL); - LTC_MUTEX_LOCK(&prng->fortuna.prng_lock); + LTC_MUTEX_LOCK(&prng->lock); + + if (!prng->ready) { + err = CRYPT_ERROR; + goto LBL_UNLOCK; + } /* we'll write bytes for s&g's */ if (*outlen < 32*LTC_FORTUNA_POOLS) { - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); *outlen = 32*LTC_FORTUNA_POOLS; - return CRYPT_BUFFER_OVERFLOW; + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_UNLOCK; } md = XMALLOC(sizeof(hash_state)); if (md == NULL) { - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); - return CRYPT_MEM; + err = CRYPT_MEM; + goto LBL_UNLOCK; } /* to emit the state we copy each pool, terminate it then hash it again so @@ -371,7 +387,8 @@ int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng) zeromem(md, sizeof(*md)); #endif XFREE(md); - LTC_MUTEX_UNLOCK(&prng->fortuna.prng_lock); +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); return err; } @@ -401,7 +418,7 @@ int fortuna_import(const unsigned char *in, unsigned long inlen, prng_state *prn return err; } } - return err; + return CRYPT_OK; } /** diff --git a/src/prngs/rc4.c b/src/prngs/rc4.c index 2583451f9..321279174 100644 --- a/src/prngs/rc4.c +++ b/src/prngs/rc4.c @@ -5,29 +5,28 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" /** @file rc4.c - LTC_RC4 PRNG, Tom St Denis + RC4 PRNG, Tom St Denis */ #ifdef LTC_RC4 const struct ltc_prng_descriptor rc4_desc = { - "rc4", 32, - &rc4_start, - &rc4_add_entropy, - &rc4_ready, - &rc4_read, - &rc4_done, - &rc4_export, - &rc4_import, - &rc4_test + "rc4", + 32, + &rc4_start, + &rc4_add_entropy, + &rc4_ready, + &rc4_read, + &rc4_done, + &rc4_export, + &rc4_import, + &rc4_test }; /** @@ -37,12 +36,14 @@ const struct ltc_prng_descriptor rc4_desc = */ int rc4_start(prng_state *prng) { - LTC_ARGCHK(prng != NULL); - - /* set keysize to zero */ - prng->rc4.x = 0; - - return CRYPT_OK; + LTC_ARGCHK(prng != NULL); + prng->ready = 0; + /* set entropy (key) size to zero */ + prng->rc4.s.x = 0; + /* clear entropy (key) buffer */ + XMEMSET(&prng->rc4.s.buf, 0, sizeof(prng->rc4.s.buf)); + LTC_MUTEX_INIT(&prng->lock) + return CRYPT_OK; } /** @@ -54,26 +55,32 @@ int rc4_start(prng_state *prng) */ int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(prng != NULL); - - /* trim as required */ - if (prng->rc4.x + inlen > 256) { - if (prng->rc4.x == 256) { - /* I can't possibly accept another byte, ok maybe a mint wafer... */ - return CRYPT_OK; - } else { - /* only accept part of it */ - inlen = 256 - prng->rc4.x; - } - } - - while (inlen--) { - prng->rc4.buf[prng->rc4.x++] = *in++; - } - - return CRYPT_OK; + unsigned char buf[256]; + unsigned long i; + int err; + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen > 0); + + LTC_MUTEX_LOCK(&prng->lock); + if (prng->ready) { + /* rc4_ready() was already called, do "rekey" operation */ + if ((err = rc4_keystream(&prng->rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; + for(i = 0; i < inlen; i++) buf[i % sizeof(buf)] ^= in[i]; + /* initialize RC4 */ + if ((err = rc4_setup(&prng->rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; + /* drop first 3072 bytes - https://en.wikipedia.org/wiki/RC4#Fluhrer.2C_Mantin_and_Shamir_attack */ + for (i = 0; i < 12; i++) rc4_keystream(&prng->rc4.s, buf, sizeof(buf)); + } + else { + /* rc4_ready() was not called yet, add entropy to the buffer */ + while (inlen--) prng->rc4.s.buf[prng->rc4.s.x++ % sizeof(prng->rc4.s.buf)] ^= *in++; + } + err = CRYPT_OK; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -83,36 +90,24 @@ int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *pr */ int rc4_ready(prng_state *prng) { - unsigned char key[256], tmp, *s; - int keylen, x, y, j; + unsigned char buf[256] = { 0 }; + unsigned long len; + int err, i; - LTC_ARGCHK(prng != NULL); - - /* extract the key */ - s = prng->rc4.buf; - XMEMCPY(key, s, 256); - keylen = prng->rc4.x; - - /* make LTC_RC4 perm and shuffle */ - for (x = 0; x < 256; x++) { - s[x] = x; - } - - for (j = x = y = 0; x < 256; x++) { - y = (y + prng->rc4.buf[x] + key[j++]) & 255; - if (j == keylen) { - j = 0; - } - tmp = s[x]; s[x] = s[y]; s[y] = tmp; - } - prng->rc4.x = 0; - prng->rc4.y = 0; - -#ifdef LTC_CLEAN_STACK - zeromem(key, sizeof(key)); -#endif + LTC_ARGCHK(prng != NULL); - return CRYPT_OK; + LTC_MUTEX_LOCK(&prng->lock); + if (prng->ready) { err = CRYPT_OK; goto LBL_UNLOCK; } + XMEMCPY(buf, prng->rc4.s.buf, sizeof(buf)); + /* initialize RC4 */ + len = MIN(prng->rc4.s.x, 256); /* TODO: we can perhaps always use all 256 bytes */ + if ((err = rc4_setup(&prng->rc4.s, buf, len)) != CRYPT_OK) goto LBL_UNLOCK; + /* drop first 3072 bytes - https://en.wikipedia.org/wiki/RC4#Fluhrer.2C_Mantin_and_Shamir_attack */ + for (i = 0; i < 12; i++) rc4_keystream(&prng->rc4.s, buf, sizeof(buf)); + prng->ready = 1; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -124,30 +119,13 @@ int rc4_ready(prng_state *prng) */ unsigned long rc4_read(unsigned char *out, unsigned long outlen, prng_state *prng) { - unsigned char x, y, *s, tmp; - unsigned long n; - - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(prng != NULL); - -#ifdef LTC_VALGRIND - zeromem(out, outlen); -#endif - - n = outlen; - x = prng->rc4.x; - y = prng->rc4.y; - s = prng->rc4.buf; - while (outlen--) { - x = (x + 1) & 255; - y = (y + s[x]) & 255; - tmp = s[x]; s[x] = s[y]; s[y] = tmp; - tmp = (s[x] + s[y]) & 255; - *out++ ^= s[tmp]; - } - prng->rc4.x = x; - prng->rc4.y = y; - return n; + if (outlen == 0 || prng == NULL || out == NULL) return 0; + LTC_MUTEX_LOCK(&prng->lock); + if (!prng->ready) { outlen = 0; goto LBL_UNLOCK; } + if (rc4_keystream(&prng->rc4.s, out, outlen) != CRYPT_OK) outlen = 0; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return outlen; } /** @@ -157,8 +135,13 @@ unsigned long rc4_read(unsigned char *out, unsigned long outlen, prng_state *prn */ int rc4_done(prng_state *prng) { + int err; LTC_ARGCHK(prng != NULL); - return CRYPT_OK; + LTC_MUTEX_LOCK(&prng->lock); + prng->ready = 0; + err = rc4_stream_done(&prng->rc4.s); + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -170,20 +153,22 @@ int rc4_done(prng_state *prng) */ int rc4_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(out != NULL); + unsigned long len = rc4_desc.export_size; + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); - if (*outlen < 32) { - *outlen = 32; + if (*outlen < len) { + *outlen = len; return CRYPT_BUFFER_OVERFLOW; } - if (rc4_read(out, 32, prng) != 32) { + if (rc4_read(out, len, prng) != len) { return CRYPT_ERROR_READPRNG; } - *outlen = 32; + *outlen = len; return CRYPT_OK; } @@ -197,17 +182,14 @@ int rc4_export(unsigned char *out, unsigned long *outlen, prng_state *prng) int rc4_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { int err; - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(prng != NULL); - if (inlen != 32) { - return CRYPT_INVALID_ARG; - } + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(in != NULL); + if (inlen < (unsigned long)rc4_desc.export_size) return CRYPT_INVALID_ARG; - if ((err = rc4_start(prng)) != CRYPT_OK) { - return err; - } - return rc4_add_entropy(in, 32, prng); + if ((err = rc4_start(prng)) != CRYPT_OK) return err; + if ((err = rc4_add_entropy(in, inlen, prng)) != CRYPT_OK) return err; + return CRYPT_OK; } /** @@ -216,54 +198,43 @@ int rc4_import(const unsigned char *in, unsigned long inlen, prng_state *prng) */ int rc4_test(void) { -#if !defined(LTC_TEST) || defined(LTC_VALGRIND) +#ifndef LTC_TEST return CRYPT_NOP; #else - static const struct { - unsigned char key[8], pt[8], ct[8]; - } tests[] = { -{ - { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, - { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, - { 0x75, 0xb7, 0x87, 0x80, 0x99, 0xe0, 0xc5, 0x96 } -} -}; - prng_state prng; - unsigned char dst[8]; - int err, x; + prng_state st; + unsigned char en[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, + 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32 }; + unsigned char dmp[500]; + unsigned long dmplen = sizeof(dmp); + unsigned char out[1000]; + unsigned char t1[] = { 0xE0, 0x4D, 0x9A, 0xF6, 0xA8, 0x9D, 0x77, 0x53, 0xAE, 0x09 }; + unsigned char t2[] = { 0x9D, 0x3C, 0xC6, 0x64, 0x36, 0xB6, 0x76, 0xD5, 0xEB, 0x93 }; + unsigned char t3[] = { 0x6B, 0x6D, 0xF5, 0xCB, 0x84, 0x37, 0x8F, 0x02, 0xA2, 0x90 }; + int err; + + if ((err = rc4_start(&st)) != CRYPT_OK) return err; + if ((err = rc4_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; + if ((err = rc4_ready(&st)) != CRYPT_OK) return err; + if (rc4_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t1, sizeof(t1), "RC4-PRNG", 1)) return CRYPT_FAIL_TESTVECTOR; + if (rc4_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; + if ((err = rc4_export(dmp, &dmplen, &st)) != CRYPT_OK) return err; + if (rc4_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if (rc4_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t2, sizeof(t2), "RC4-PRNG", 2)) return CRYPT_FAIL_TESTVECTOR; + if ((err = rc4_done(&st)) != CRYPT_OK) return err; + if ((err = rc4_import(dmp, dmplen, &st)) != CRYPT_OK) return err; + if ((err = rc4_ready(&st)) != CRYPT_OK) return err; + if (rc4_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if (rc4_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t3, sizeof(t3), "RC4-PRNG", 3)) return CRYPT_FAIL_TESTVECTOR; + if ((err = rc4_done(&st)) != CRYPT_OK) return err; - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { - if ((err = rc4_start(&prng)) != CRYPT_OK) { - return err; - } - if ((err = rc4_add_entropy(tests[x].key, 8, &prng)) != CRYPT_OK) { - return err; - } - if ((err = rc4_ready(&prng)) != CRYPT_OK) { - return err; - } - XMEMCPY(dst, tests[x].pt, 8); - if (rc4_read(dst, 8, &prng) != 8) { - return CRYPT_ERROR_READPRNG; - } - rc4_done(&prng); - if (XMEMCMP(dst, tests[x].ct, 8)) { -#if 0 - int y; - printf("\n\nLTC_RC4 failed, I got:\n"); - for (y = 0; y < 8; y++) printf("%02x ", dst[y]); - printf("\n"); -#endif - return CRYPT_FAIL_TESTVECTOR; - } - } return CRYPT_OK; #endif } #endif - - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 28e8585ee..2c05d0dd4 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/prngs/rng_make_prng.c b/src/prngs/rng_make_prng.c index 05af40598..fff92c788 100644 --- a/src/prngs/rng_make_prng.c +++ b/src/prngs/rng_make_prng.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index 33d7f008d..c1069d1a2 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -5,9 +5,8 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ + #include "tomcrypt.h" /** @@ -18,90 +17,20 @@ #ifdef LTC_SOBER128 -#define __LTC_SOBER128TAB_C__ -#include "sober128tab.c" - const struct ltc_prng_descriptor sober128_desc = { - "sober128", 64, - &sober128_start, - &sober128_add_entropy, - &sober128_ready, - &sober128_read, - &sober128_done, - &sober128_export, - &sober128_import, - &sober128_test + "sober128", + 40, + &sober128_start, + &sober128_add_entropy, + &sober128_ready, + &sober128_read, + &sober128_done, + &sober128_export, + &sober128_import, + &sober128_test }; -/* don't change these... */ -#define N 17 -#define FOLD N /* how many iterations of folding to do */ -#define INITKONST 0x6996c53a /* value of KONST to use during key loading */ -#define KEYP 15 /* where to insert key words */ -#define FOLDP 4 /* where to insert non-linear feedback */ - -#define B(x,i) ((unsigned char)(((x) >> (8*i)) & 0xFF)) - -static ulong32 BYTE2WORD(unsigned char *b) -{ - ulong32 t; - LOAD32L(t, b); - return t; -} - -#define WORD2BYTE(w, b) STORE32L(b, w) - -static void XORWORD(ulong32 w, unsigned char *b) -{ - ulong32 t; - LOAD32L(t, b); - t ^= w; - STORE32L(t, b); -} - -/* give correct offset for the current position of the register, - * where logically R[0] is at position "zero". - */ -#define OFF(zero, i) (((zero)+(i)) % N) - -/* step the LFSR */ -/* After stepping, "zero" moves right one place */ -#define STEP(R,z) \ - R[OFF(z,0)] = R[OFF(z,15)] ^ R[OFF(z,4)] ^ (R[OFF(z,0)] << 8) ^ Multab[(R[OFF(z,0)] >> 24) & 0xFF]; - -static void cycle(ulong32 *R) -{ - ulong32 t; - int i; - - STEP(R,0); - t = R[0]; - for (i = 1; i < N; ++i) { - R[i-1] = R[i]; - } - R[N-1] = t; -} - -/* Return a non-linear function of some parts of the register. - */ -#define NLFUNC(c,z) \ -{ \ - t = c->R[OFF(z,0)] + c->R[OFF(z,16)]; \ - t ^= Sbox[(t >> 24) & 0xFF]; \ - t = RORc(t, 8); \ - t = ((t + c->R[OFF(z,1)]) ^ c->konst) + c->R[OFF(z,6)]; \ - t ^= Sbox[(t >> 24) & 0xFF]; \ - t = t + c->R[OFF(z,13)]; \ -} - -static ulong32 nltap(struct sober128_prng *c) -{ - ulong32 t; - NLFUNC(c, 0); - return t; -} - /** Start the PRNG @param prng [out] The PRNG state to initialize @@ -109,93 +38,12 @@ static ulong32 nltap(struct sober128_prng *c) */ int sober128_start(prng_state *prng) { - int i; - struct sober128_prng *c; - - LTC_ARGCHK(prng != NULL); - - c = &(prng->sober128); - - /* Register initialised to Fibonacci numbers */ - c->R[0] = 1; - c->R[1] = 1; - for (i = 2; i < N; ++i) { - c->R[i] = c->R[i-1] + c->R[i-2]; - } - c->konst = INITKONST; - - /* next add_entropy will be the key */ - c->flag = 1; - c->set = 0; - - return CRYPT_OK; -} - -/* Save the current register state - */ -static void s128_savestate(struct sober128_prng *c) -{ - int i; - for (i = 0; i < N; ++i) { - c->initR[i] = c->R[i]; - } -} - -/* initialise to previously saved register state - */ -static void s128_reloadstate(struct sober128_prng *c) -{ - int i; - - for (i = 0; i < N; ++i) { - c->R[i] = c->initR[i]; - } -} - -/* Initialise "konst" - */ -static void s128_genkonst(struct sober128_prng *c) -{ - ulong32 newkonst; - - do { - cycle(c->R); - newkonst = nltap(c); - } while ((newkonst & 0xFF000000) == 0); - c->konst = newkonst; -} - -/* Load key material into the register - */ -#define ADDKEY(k) \ - c->R[KEYP] += (k); - -#define XORNL(nl) \ - c->R[FOLDP] ^= (nl); - -/* nonlinear diffusion of register for key */ -#define DROUND(z) STEP(c->R,z); NLFUNC(c,(z+1)); c->R[OFF((z+1),FOLDP)] ^= t; -static void s128_diffuse(struct sober128_prng *c) -{ - ulong32 t; - /* relies on FOLD == N == 17! */ - DROUND(0); - DROUND(1); - DROUND(2); - DROUND(3); - DROUND(4); - DROUND(5); - DROUND(6); - DROUND(7); - DROUND(8); - DROUND(9); - DROUND(10); - DROUND(11); - DROUND(12); - DROUND(13); - DROUND(14); - DROUND(15); - DROUND(16); + LTC_ARGCHK(prng != NULL); + prng->ready = 0; + XMEMSET(&prng->sober128.ent, 0, sizeof(prng->sober128.ent)); + prng->sober128.idx = 0; + LTC_MUTEX_INIT(&prng->lock) + return CRYPT_OK; } /** @@ -207,63 +55,34 @@ static void s128_diffuse(struct sober128_prng *c) */ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { - struct sober128_prng *c; - ulong32 i, k; - - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(prng != NULL); - c = &(prng->sober128); - - if (c->flag == 1) { - /* this is the first call to the add_entropy so this input is the key */ - /* inlen must be multiple of 4 bytes */ - if ((inlen & 3) != 0) { - return CRYPT_INVALID_KEYSIZE; - } - - for (i = 0; i < inlen; i += 4) { - k = BYTE2WORD((unsigned char *)&in[i]); - ADDKEY(k); - cycle(c->R); - XORNL(nltap(c)); - } - - /* also fold in the length of the key */ - ADDKEY(inlen); - - /* now diffuse */ - s128_diffuse(c); - - s128_genkonst(c); - s128_savestate(c); - c->nbuf = 0; - c->flag = 0; - c->set = 1; - } else { - /* ok we are adding an IV then... */ - s128_reloadstate(c); - - /* inlen must be multiple of 4 bytes */ - if ((inlen & 3) != 0) { - return CRYPT_INVALID_KEYSIZE; - } - - for (i = 0; i < inlen; i += 4) { - k = BYTE2WORD((unsigned char *)&in[i]); - ADDKEY(k); - cycle(c->R); - XORNL(nltap(c)); - } - - /* also fold in the length of the key */ - ADDKEY(inlen); - - /* now diffuse */ - s128_diffuse(c); - c->nbuf = 0; - } + unsigned char buf[40]; + unsigned long i; + int err; - return CRYPT_OK; + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen > 0); + + LTC_MUTEX_LOCK(&prng->lock); + if (prng->ready) { + /* sober128_ready() was already called, do "rekey" operation */ + if ((err = sober128_keystream(&prng->sober128.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; + for(i = 0; i < inlen; i++) buf[i % sizeof(buf)] ^= in[i]; + /* key 32 bytes, 20 rounds */ + if ((err = sober128_setup(&prng->sober128.s, buf, 32)) != CRYPT_OK) goto LBL_UNLOCK; + /* iv 8 bytes */ + if ((err = sober128_setiv(&prng->sober128.s, buf + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; + /* clear KEY + IV */ + XMEMSET(buf, 0, sizeof(buf)); + } + else { + /* sober128_ready() was not called yet, add entropy to ent buffer */ + while (inlen--) prng->sober128.ent[prng->sober128.idx++ % sizeof(prng->sober128.ent)] ^= *in++; + } + err = CRYPT_OK; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -273,12 +92,23 @@ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_stat */ int sober128_ready(prng_state *prng) { - return prng->sober128.set == 1 ? CRYPT_OK : CRYPT_ERROR; -} + int err; -/* XOR pseudo-random bytes into buffer - */ -#define SROUND(z) STEP(c->R,z); NLFUNC(c,(z+1)); XORWORD(t, out+(z*4)); + LTC_ARGCHK(prng != NULL); + + LTC_MUTEX_LOCK(&prng->lock); + if (prng->ready) { err = CRYPT_OK; goto LBL_UNLOCK; } + /* key 32 bytes, 20 rounds */ + if ((err = sober128_setup(&prng->sober128.s, prng->sober128.ent, 32)) != CRYPT_OK) goto LBL_UNLOCK; + /* iv 8 bytes */ + if ((err = sober128_setiv(&prng->sober128.s, prng->sober128.ent + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; + XMEMSET(&prng->sober128.ent, 0, sizeof(prng->sober128.ent)); + prng->sober128.idx = 0; + prng->ready = 1; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; +} /** Read from the PRNG @@ -289,75 +119,13 @@ int sober128_ready(prng_state *prng) */ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state *prng) { - struct sober128_prng *c; - ulong32 t, tlen; - - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(prng != NULL); - -#ifdef LTC_VALGRIND - zeromem(out, outlen); -#endif - - c = &(prng->sober128); - tlen = outlen; - - /* handle any previously buffered bytes */ - while (c->nbuf != 0 && outlen != 0) { - *out++ ^= c->sbuf & 0xFF; - c->sbuf >>= 8; - c->nbuf -= 8; - --outlen; - } - -#ifndef LTC_SMALL_CODE - /* do lots at a time, if there's enough to do */ - while (outlen >= N*4) { - SROUND(0); - SROUND(1); - SROUND(2); - SROUND(3); - SROUND(4); - SROUND(5); - SROUND(6); - SROUND(7); - SROUND(8); - SROUND(9); - SROUND(10); - SROUND(11); - SROUND(12); - SROUND(13); - SROUND(14); - SROUND(15); - SROUND(16); - out += 4*N; - outlen -= 4*N; - } -#endif - - /* do small or odd size buffers the slow way */ - while (4 <= outlen) { - cycle(c->R); - t = nltap(c); - XORWORD(t, out); - out += 4; - outlen -= 4; - } - - /* handle any trailing bytes */ - if (outlen != 0) { - cycle(c->R); - c->sbuf = nltap(c); - c->nbuf = 32; - while (c->nbuf != 0 && outlen != 0) { - *out++ ^= c->sbuf & 0xFF; - c->sbuf >>= 8; - c->nbuf -= 8; - --outlen; - } - } - - return tlen; + if (outlen == 0 || prng == NULL || out == NULL) return 0; + LTC_MUTEX_LOCK(&prng->lock); + if (!prng->ready) { outlen = 0; goto LBL_UNLOCK; } + if (sober128_keystream(&prng->sober128.s, out, outlen) != CRYPT_OK) outlen = 0; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return outlen; } /** @@ -367,8 +135,13 @@ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state */ int sober128_done(prng_state *prng) { + int err; LTC_ARGCHK(prng != NULL); - return CRYPT_OK; + LTC_MUTEX_LOCK(&prng->lock); + prng->ready = 0; + err = sober128_stream_done(&prng->sober128.s); + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -380,20 +153,22 @@ int sober128_done(prng_state *prng) */ int sober128_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(out != NULL); + unsigned long len = sober128_desc.export_size; + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); - if (*outlen < 64) { - *outlen = 64; + if (*outlen < len) { + *outlen = len; return CRYPT_BUFFER_OVERFLOW; } - if (sober128_read(out, 64, prng) != 64) { + if (sober128_read(out, len, prng) != len) { return CRYPT_ERROR_READPRNG; } - *outlen = 64; + *outlen = len; return CRYPT_OK; } @@ -407,20 +182,14 @@ int sober128_export(unsigned char *out, unsigned long *outlen, prng_state *prng) int sober128_import(const unsigned char *in, unsigned long inlen, prng_state *prng) { int err; - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(prng != NULL); - if (inlen != 64) { - return CRYPT_INVALID_ARG; - } + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(in != NULL); + if (inlen < (unsigned long)sober128_desc.export_size) return CRYPT_INVALID_ARG; - if ((err = sober128_start(prng)) != CRYPT_OK) { - return err; - } - if ((err = sober128_add_entropy(in, 64, prng)) != CRYPT_OK) { - return err; - } - return sober128_ready(prng); + if ((err = sober128_start(prng)) != CRYPT_OK) return err; + if ((err = sober128_add_entropy(in, inlen, prng)) != CRYPT_OK) return err; + return CRYPT_OK; } /** @@ -432,69 +201,44 @@ int sober128_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - static const struct { - int keylen, ivlen, len; - unsigned char key[16], iv[4], out[20]; - } tests[] = { - -{ - 16, 4, 20, - - /* key */ - { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6b, 0x65, 0x79, - 0x20, 0x31, 0x32, 0x38, 0x62, 0x69, 0x74, 0x73 }, - - /* IV */ - { 0x00, 0x00, 0x00, 0x00 }, - - /* expected output */ - { 0x43, 0x50, 0x0c, 0xcf, 0x89, 0x91, 0x9f, 0x1d, - 0xaa, 0x37, 0x74, 0x95, 0xf4, 0xb4, 0x58, 0xc2, - 0x40, 0x37, 0x8b, 0xbb } -} - -}; - prng_state prng; - unsigned char dst[20]; - int err, x; + prng_state st; + unsigned char en[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, + 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32 }; + unsigned char dmp[300]; + unsigned long dmplen = sizeof(dmp); + unsigned char out[500]; + unsigned char t1[] = { 0x31, 0x82, 0xA7, 0xA5, 0x8B, 0xD7, 0xCB, 0x39, 0x86, 0x1A }; + unsigned char t2[] = { 0x6B, 0x43, 0x9E, 0xBC, 0xE7, 0x62, 0x9B, 0xE6, 0x9B, 0x83 }; + unsigned char t3[] = { 0x4A, 0x0E, 0x6C, 0xC1, 0xCF, 0xB4, 0x73, 0x49, 0x99, 0x05 }; + int err; - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { - if ((err = sober128_start(&prng)) != CRYPT_OK) { - return err; - } - if ((err = sober128_add_entropy(tests[x].key, tests[x].keylen, &prng)) != CRYPT_OK) { - return err; - } - /* add IV */ - if ((err = sober128_add_entropy(tests[x].iv, tests[x].ivlen, &prng)) != CRYPT_OK) { - return err; - } + if ((err = sober128_start(&st)) != CRYPT_OK) return err; + /* add entropy to uninitialized prng */ + if ((err = sober128_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; + if ((err = sober128_ready(&st)) != CRYPT_OK) return err; + if (sober128_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t1, sizeof(t1), "SOBER128-PRNG", 1)) return CRYPT_FAIL_TESTVECTOR; + if (sober128_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + /* add entropy to already initialized prng */ + if ((err = sober128_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; + if (sober128_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if ((err = sober128_export(dmp, &dmplen, &st)) != CRYPT_OK) return err; + if (sober128_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if (sober128_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t2, sizeof(t2), "SOBER128-PRNG", 2)) return CRYPT_FAIL_TESTVECTOR; + if ((err = sober128_done(&st)) != CRYPT_OK) return err; + if ((err = sober128_import(dmp, dmplen, &st)) != CRYPT_OK) return err; + if ((err = sober128_ready(&st)) != CRYPT_OK) return err; + if (sober128_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if (sober128_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ + if (compare_testvector(out, 10, t3, sizeof(t3), "SOBER128-PRNG", 3)) return CRYPT_FAIL_TESTVECTOR; + if ((err = sober128_done(&st)) != CRYPT_OK) return err; - /* ready up */ - if ((err = sober128_ready(&prng)) != CRYPT_OK) { - return err; - } - XMEMSET(dst, 0, tests[x].len); - if (sober128_read(dst, tests[x].len, &prng) != (unsigned long)tests[x].len) { - return CRYPT_ERROR_READPRNG; - } - sober128_done(&prng); - if (XMEMCMP(dst, tests[x].out, tests[x].len)) { -#if 0 - printf("\n\nLTC_SOBER128 failed, I got:\n"); - for (y = 0; y < tests[x].len; y++) printf("%02x ", dst[y]); - printf("\n"); -#endif - return CRYPT_FAIL_TESTVECTOR; - } - } return CRYPT_OK; #endif } #endif - - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/src/prngs/sprng.c b/src/prngs/sprng.c index 7b538dd41..0d4457158 100644 --- a/src/prngs/sprng.c +++ b/src/prngs/sprng.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/prngs/yarrow.c b/src/prngs/yarrow.c index d6566e6e5..c0d211e9a 100644 --- a/src/prngs/yarrow.c +++ b/src/prngs/yarrow.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" @@ -40,6 +38,7 @@ int yarrow_start(prng_state *prng) int err; LTC_ARGCHK(prng != NULL); + prng->ready = 0; /* these are the default hash/cipher combo used */ #ifdef LTC_RIJNDAEL @@ -120,7 +119,7 @@ int yarrow_start(prng_state *prng) /* zero the memory used */ zeromem(prng->yarrow.pool, sizeof(prng->yarrow.pool)); - LTC_MUTEX_INIT(&prng->yarrow.prng_lock) + LTC_MUTEX_INIT(&prng->lock) return CRYPT_OK; } @@ -137,43 +136,38 @@ int yarrow_add_entropy(const unsigned char *in, unsigned long inlen, prng_state hash_state md; int err; - LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen > 0); - LTC_MUTEX_LOCK(&prng->yarrow.prng_lock); + LTC_MUTEX_LOCK(&prng->lock); if ((err = hash_is_valid(prng->yarrow.hash)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + goto LBL_UNLOCK; } /* start the hash */ if ((err = hash_descriptor[prng->yarrow.hash].init(&md)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + goto LBL_UNLOCK; } /* hash the current pool */ if ((err = hash_descriptor[prng->yarrow.hash].process(&md, prng->yarrow.pool, hash_descriptor[prng->yarrow.hash].hashsize)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + goto LBL_UNLOCK; } /* add the new entropy */ if ((err = hash_descriptor[prng->yarrow.hash].process(&md, in, inlen)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + goto LBL_UNLOCK; } /* store result */ - if ((err = hash_descriptor[prng->yarrow.hash].done(&md, prng->yarrow.pool)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; - } + err = hash_descriptor[prng->yarrow.hash].done(&md, prng->yarrow.pool); - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return CRYPT_OK; +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -186,23 +180,21 @@ int yarrow_ready(prng_state *prng) int ks, err; LTC_ARGCHK(prng != NULL); - LTC_MUTEX_LOCK(&prng->yarrow.prng_lock); + + LTC_MUTEX_LOCK(&prng->lock); if ((err = hash_is_valid(prng->yarrow.hash)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + goto LBL_UNLOCK; } if ((err = cipher_is_valid(prng->yarrow.cipher)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + goto LBL_UNLOCK; } /* setup CTR mode using the "pool" as the key */ ks = (int)hash_descriptor[prng->yarrow.hash].hashsize; if ((err = cipher_descriptor[prng->yarrow.cipher].keysize(&ks)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + goto LBL_UNLOCK; } if ((err = ctr_start(prng->yarrow.cipher, /* what cipher to use */ @@ -211,11 +203,13 @@ int yarrow_ready(prng_state *prng) 0, /* number of rounds */ CTR_COUNTER_LITTLE_ENDIAN, /* little endian counter */ &prng->yarrow.ctr)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + goto LBL_UNLOCK; } - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return CRYPT_OK; + prng->ready = 1; + +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); + return err; } /** @@ -227,20 +221,25 @@ int yarrow_ready(prng_state *prng) */ unsigned long yarrow_read(unsigned char *out, unsigned long outlen, prng_state *prng) { - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(prng != NULL); + if (outlen == 0 || prng == NULL || out == NULL) return 0; + + LTC_MUTEX_LOCK(&prng->lock); - LTC_MUTEX_LOCK(&prng->yarrow.prng_lock); + if (!prng->ready) { + outlen = 0; + goto LBL_UNLOCK; + } /* put out in predictable state first */ zeromem(out, outlen); /* now randomize it */ if (ctr_encrypt(out, out, outlen, &prng->yarrow.ctr) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return 0; + outlen = 0; } - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); + +LBL_UNLOCK: + LTC_MUTEX_UNLOCK(&prng->lock); return outlen; } @@ -254,14 +253,15 @@ int yarrow_done(prng_state *prng) int err; LTC_ARGCHK(prng != NULL); - LTC_MUTEX_LOCK(&prng->yarrow.prng_lock); + LTC_MUTEX_LOCK(&prng->lock); + prng->ready = 0; /* call cipher done when we invent one ;-) */ /* we invented one */ err = ctr_done(&prng->yarrow.ctr); - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); + LTC_MUTEX_UNLOCK(&prng->lock); return err; } @@ -277,22 +277,19 @@ int yarrow_export(unsigned char *out, unsigned long *outlen, prng_state *prng) LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(prng != NULL); - - LTC_MUTEX_LOCK(&prng->yarrow.prng_lock); + if (!prng->ready) return CRYPT_ERROR; /* we'll write 64 bytes for s&g's */ if (*outlen < 64) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); *outlen = 64; return CRYPT_BUFFER_OVERFLOW; } if (yarrow_read(out, 64, prng) != 64) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); return CRYPT_ERROR_READPRNG; } - *outlen = 64; + *outlen = 64; return CRYPT_OK; } @@ -310,20 +307,16 @@ int yarrow_import(const unsigned char *in, unsigned long inlen, prng_state *prng LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); - LTC_MUTEX_LOCK(&prng->yarrow.prng_lock); - if (inlen != 64) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); return CRYPT_INVALID_ARG; } - if ((err = yarrow_start(prng)) != CRYPT_OK) { - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); return err; } - err = yarrow_add_entropy(in, 64, prng); - LTC_MUTEX_UNLOCK(&prng->yarrow.prng_lock); - return err; + if ((err = yarrow_add_entropy(in, 64, prng)) != CRYPT_OK) { + return err; + } + return CRYPT_OK; } /** diff --git a/src/stream/chacha/chacha_crypt.c b/src/stream/chacha/chacha_crypt.c index de42a1069..d1c691c63 100644 --- a/src/stream/chacha/chacha_crypt.c +++ b/src/stream/chacha/chacha_crypt.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_STREAM #define QUARTERROUND(a,b,c,d) \ x[a] += x[b]; x[d] = ROL(x[d] ^ x[a], 16); \ diff --git a/src/stream/chacha/chacha_done.c b/src/stream/chacha/chacha_done.c index 4d6e278b0..06afbd249 100644 --- a/src/stream/chacha/chacha_done.c +++ b/src/stream/chacha/chacha_done.c @@ -9,7 +9,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_STREAM /** Terminate and clear ChaCha state diff --git a/src/stream/chacha/chacha_ivctr32.c b/src/stream/chacha/chacha_ivctr32.c index 9884a1ee9..5602f6d7f 100644 --- a/src/stream/chacha/chacha_ivctr32.c +++ b/src/stream/chacha/chacha_ivctr32.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_STREAM /** Set IV + counter data to the ChaCha state diff --git a/src/stream/chacha/chacha_ivctr64.c b/src/stream/chacha/chacha_ivctr64.c index 82d39fb47..9780e09c0 100644 --- a/src/stream/chacha/chacha_ivctr64.c +++ b/src/stream/chacha/chacha_ivctr64.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_STREAM /** Set IV + counter data to the ChaCha state diff --git a/src/stream/chacha/chacha_keystream.c b/src/stream/chacha/chacha_keystream.c index b45323f2f..5ea3b579e 100644 --- a/src/stream/chacha/chacha_keystream.c +++ b/src/stream/chacha/chacha_keystream.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_STREAM /** Generate a stream of random bytes via ChaCha diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c index 69a148335..5dc5d7268 100644 --- a/src/stream/chacha/chacha_setup.c +++ b/src/stream/chacha/chacha_setup.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_STREAM static const char * const sigma = "expand 32-byte k"; static const char * const tau = "expand 16-byte k"; diff --git a/src/stream/chacha/chacha_test.c b/src/stream/chacha/chacha_test.c index d48cd4799..c22e09be7 100644 --- a/src/stream/chacha/chacha_test.c +++ b/src/stream/chacha/chacha_test.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_STREAM int chacha_test(void) { @@ -37,27 +37,28 @@ int chacha_test(void) 0x87, 0x4D }; char pt[] = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."; chacha_state st; + int err; len = strlen(pt); /* crypt piece by piece */ - chacha_setup(&st, k, sizeof(k), 20); - chacha_ivctr32(&st, n, sizeof(n), 1); - chacha_crypt(&st, (unsigned char*)pt, 35, out); - chacha_crypt(&st, (unsigned char*)pt + 35, 35, out + 35); - chacha_crypt(&st, (unsigned char*)pt + 70, 5, out + 70); - chacha_crypt(&st, (unsigned char*)pt + 75, 5, out + 75); - chacha_crypt(&st, (unsigned char*)pt + 80, len - 80, out + 80); - if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV1", 1)) return CRYPT_FAIL_TESTVECTOR; + if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; + if ((err = chacha_ivctr32(&st, n, sizeof(n), 1)) != CRYPT_OK) return err; + if ((err = chacha_crypt(&st, (unsigned char*)pt, 35, out)) != CRYPT_OK) return err; + if ((err = chacha_crypt(&st, (unsigned char*)pt + 35, 35, out + 35)) != CRYPT_OK) return err; + if ((err = chacha_crypt(&st, (unsigned char*)pt + 70, 5, out + 70)) != CRYPT_OK) return err; + if ((err = chacha_crypt(&st, (unsigned char*)pt + 75, 5, out + 75)) != CRYPT_OK) return err; + if ((err = chacha_crypt(&st, (unsigned char*)pt + 80, len - 80, out + 80)) != CRYPT_OK) return err; + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV1", 1)) return CRYPT_FAIL_TESTVECTOR; /* crypt in one go */ - chacha_setup(&st, k, sizeof(k), 20); - chacha_ivctr32(&st, n, sizeof(n), 1); - chacha_crypt(&st, (unsigned char*)pt, len, out); - if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV2", 1)) return CRYPT_FAIL_TESTVECTOR; + if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; + if ((err = chacha_ivctr32(&st, n, sizeof(n), 1)) != CRYPT_OK) return err; + if ((err = chacha_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV2", 1)) return CRYPT_FAIL_TESTVECTOR; /* crypt in one go - using chacha_ivctr64() */ - chacha_setup(&st, k, sizeof(k), 20); - chacha_ivctr64(&st, n + 4, sizeof(n) - 4, 1); - chacha_crypt(&st, (unsigned char*)pt, len, out); - if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV3", 1)) return CRYPT_FAIL_TESTVECTOR; + if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; + if ((err = chacha_ivctr64(&st, n + 4, sizeof(n) - 4, 1)) != CRYPT_OK) return err; + if ((err = chacha_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; + if (compare_testvector(out, len, ct, sizeof(ct), "CHACHA-TV3", 1)) return CRYPT_FAIL_TESTVECTOR; return CRYPT_OK; #endif diff --git a/src/stream/rc4/rc4.c b/src/stream/rc4/rc4.c new file mode 100644 index 000000000..90227f2e4 --- /dev/null +++ b/src/stream/rc4/rc4.c @@ -0,0 +1,107 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_RC4_STREAM + +/** + Initialize an RC4 context (only the key) + @param st [out] The destination of the RC4 state + @param key The secret key + @param keylen The length of the secret key (8 - 256 bytes) + @return CRYPT_OK if successful +*/ +int rc4_setup(rc4_state *st, const unsigned char *key, unsigned long keylen) +{ + unsigned char tmp, *s; + int x, y; + unsigned long j; + + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(keylen >= 5); /* 40-2048 bits */ + + s = st->buf; + for (x = 0; x < 256; x++) { + s[x] = x; + } + + for (j = x = y = 0; x < 256; x++) { + y = (y + s[x] + key[j++]) & 255; + if (j == keylen) { + j = 0; + } + tmp = s[x]; s[x] = s[y]; s[y] = tmp; + } + st->x = 0; + st->y = 0; + + return CRYPT_OK; +} + +/** + Encrypt (or decrypt) bytes of ciphertext (or plaintext) with RC4 + @param st The RC4 state + @param in The plaintext (or ciphertext) + @param inlen The length of the input (octets) + @param out [out] The ciphertext (or plaintext), length inlen + @return CRYPT_OK if successful +*/ +int rc4_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) +{ + unsigned char x, y, *s, tmp; + + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + + x = st->x; + y = st->y; + s = st->buf; + while (inlen--) { + x = (x + 1) & 255; + y = (y + s[x]) & 255; + tmp = s[x]; s[x] = s[y]; s[y] = tmp; + tmp = (s[x] + s[y]) & 255; + *out++ = *in++ ^ s[tmp]; + } + st->x = x; + st->y = y; + return CRYPT_OK; +} + +/** + Generate a stream of random bytes via RC4 + @param st The RC420 state + @param out [out] The output buffer + @param outlen The output length + @return CRYPT_OK on success + */ +int rc4_keystream(rc4_state *st, unsigned char *out, unsigned long outlen) +{ + if (outlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(out != NULL); + XMEMSET(out, 0, outlen); + return rc4_crypt(st, out, outlen, out); +} + +/** + Terminate and clear RC4 state + @param st The RC4 state + @return CRYPT_OK on success +*/ +int rc4_stream_done(rc4_state *st) +{ + LTC_ARGCHK(st != NULL); + XMEMSET(st, 0, sizeof(rc4_state)); + return CRYPT_OK; +} + +#endif diff --git a/src/stream/rc4/rc4_test.c b/src/stream/rc4/rc4_test.c new file mode 100644 index 000000000..36ace3def --- /dev/null +++ b/src/stream/rc4/rc4_test.c @@ -0,0 +1,35 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_RC4_STREAM + +int rc4_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + rc4_state st; + int err; + const unsigned char key[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + const unsigned char pt[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + const unsigned char ct[] = { 0x75, 0xb7, 0x87, 0x80, 0x99, 0xe0, 0xc5, 0x96 }; + unsigned char buf[10]; + + if ((err = rc4_setup(&st, key, sizeof(key))) != CRYPT_OK) return err; + if ((err = rc4_crypt(&st, pt, sizeof(pt), buf)) != CRYPT_OK) return err; + if (XMEMCMP(buf, ct, sizeof(ct))) return CRYPT_FAIL_TESTVECTOR; + if ((err = rc4_stream_done(&st)) != CRYPT_OK) return err; + + return CRYPT_OK; +#endif +} + +#endif diff --git a/src/stream/sober128/sober128.c b/src/stream/sober128/sober128.c new file mode 100644 index 000000000..c9da8db65 --- /dev/null +++ b/src/stream/sober128/sober128.c @@ -0,0 +1,344 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file sober128.c + Implementation of SOBER-128 by Tom St Denis. + Based on s128fast.c reference code supplied by Greg Rose of QUALCOMM. +*/ + +#ifdef LTC_SOBER128 + +#define __LTC_SOBER128TAB_C__ +#include "sober128tab.c" + +/* don't change these... */ +#define N 17 +#define FOLD N /* how many iterations of folding to do */ +#define INITKONST 0x6996c53a /* value of KONST to use during key loading */ +#define KEYP 15 /* where to insert key words */ +#define FOLDP 4 /* where to insert non-linear feedback */ + +#define B(x,i) ((unsigned char)(((x) >> (8*i)) & 0xFF)) + +static ulong32 BYTE2WORD(unsigned char *b) +{ + ulong32 t; + LOAD32L(t, b); + return t; +} + +static void XORWORD(ulong32 w, const unsigned char *in, unsigned char *out) +{ + ulong32 t; + LOAD32L(t, in); + t ^= w; + STORE32L(t, out); +} + +/* give correct offset for the current position of the register, + * where logically R[0] is at position "zero". + */ +#define OFF(zero, i) (((zero)+(i)) % N) + +/* step the LFSR */ +/* After stepping, "zero" moves right one place */ +#define STEP(R,z) \ + R[OFF(z,0)] = R[OFF(z,15)] ^ R[OFF(z,4)] ^ (R[OFF(z,0)] << 8) ^ Multab[(R[OFF(z,0)] >> 24) & 0xFF]; + +static void cycle(ulong32 *R) +{ + ulong32 t; + int i; + + STEP(R,0); + t = R[0]; + for (i = 1; i < N; ++i) { + R[i-1] = R[i]; + } + R[N-1] = t; +} + +/* Return a non-linear function of some parts of the register. + */ +#define NLFUNC(c,z) \ +{ \ + t = c->R[OFF(z,0)] + c->R[OFF(z,16)]; \ + t ^= Sbox[(t >> 24) & 0xFF]; \ + t = RORc(t, 8); \ + t = ((t + c->R[OFF(z,1)]) ^ c->konst) + c->R[OFF(z,6)]; \ + t ^= Sbox[(t >> 24) & 0xFF]; \ + t = t + c->R[OFF(z,13)]; \ +} + +static ulong32 nltap(sober128_state *c) +{ + ulong32 t; + NLFUNC(c, 0); + return t; +} + +/* Save the current register state + */ +static void s128_savestate(sober128_state *c) +{ + int i; + for (i = 0; i < N; ++i) { + c->initR[i] = c->R[i]; + } +} + +/* initialise to previously saved register state + */ +static void s128_reloadstate(sober128_state *c) +{ + int i; + + for (i = 0; i < N; ++i) { + c->R[i] = c->initR[i]; + } +} + +/* Initialise "konst" + */ +static void s128_genkonst(sober128_state *c) +{ + ulong32 newkonst; + + do { + cycle(c->R); + newkonst = nltap(c); + } while ((newkonst & 0xFF000000) == 0); + c->konst = newkonst; +} + +/* Load key material into the register + */ +#define ADDKEY(k) \ + c->R[KEYP] += (k); + +#define XORNL(nl) \ + c->R[FOLDP] ^= (nl); + +/* nonlinear diffusion of register for key */ +#define DROUND(z) STEP(c->R,z); NLFUNC(c,(z+1)); c->R[OFF((z+1),FOLDP)] ^= t; +static void s128_diffuse(sober128_state *c) +{ + ulong32 t; + /* relies on FOLD == N == 17! */ + DROUND(0); + DROUND(1); + DROUND(2); + DROUND(3); + DROUND(4); + DROUND(5); + DROUND(6); + DROUND(7); + DROUND(8); + DROUND(9); + DROUND(10); + DROUND(11); + DROUND(12); + DROUND(13); + DROUND(14); + DROUND(15); + DROUND(16); +} + +/** + Initialize an Sober128 context (only the key) + @param c [out] The destination of the Sober128 state + @param key The secret key + @param keylen The length of the secret key (octets) + @return CRYPT_OK if successful +*/ +int sober128_setup(sober128_state *c, const unsigned char *key, unsigned long keylen) +{ + ulong32 i, k; + + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(keylen > 0); + + /* keylen must be multiple of 4 bytes */ + if ((keylen & 3) != 0) { + return CRYPT_INVALID_KEYSIZE; + } + + /* Register initialised to Fibonacci numbers */ + c->R[0] = 1; + c->R[1] = 1; + for (i = 2; i < N; ++i) { + c->R[i] = c->R[i-1] + c->R[i-2]; + } + c->konst = INITKONST; + + for (i = 0; i < keylen; i += 4) { + k = BYTE2WORD((unsigned char *)&key[i]); + ADDKEY(k); + cycle(c->R); + XORNL(nltap(c)); + } + + /* also fold in the length of the key */ + ADDKEY(keylen); + + /* now diffuse */ + s128_diffuse(c); + s128_genkonst(c); + s128_savestate(c); + c->nbuf = 0; + + return CRYPT_OK; +} + +/** + Set IV to the Sober128 state + @param c The Sober12820 state + @param iv The IV data to add + @param inlen The length of the IV (must be 12) + @return CRYPT_OK on success + */ +int sober128_setiv(sober128_state *c, const unsigned char *iv, unsigned long ivlen) +{ + ulong32 i, k; + + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(iv != NULL); + LTC_ARGCHK(ivlen > 0); + + /* ok we are adding an IV then... */ + s128_reloadstate(c); + + /* ivlen must be multiple of 4 bytes */ + if ((ivlen & 3) != 0) { + return CRYPT_INVALID_KEYSIZE; + } + + for (i = 0; i < ivlen; i += 4) { + k = BYTE2WORD((unsigned char *)&iv[i]); + ADDKEY(k); + cycle(c->R); + XORNL(nltap(c)); + } + + /* also fold in the length of the key */ + ADDKEY(ivlen); + + /* now diffuse */ + s128_diffuse(c); + c->nbuf = 0; + + return CRYPT_OK; +} + +/* XOR pseudo-random bytes into buffer + */ +#define SROUND(z) STEP(c->R,z); NLFUNC(c,(z+1)); XORWORD(t, in+(z*4), out+(z*4)); + +/** + Encrypt (or decrypt) bytes of ciphertext (or plaintext) with Sober128 + @param c The Sober128 state + @param in The plaintext (or ciphertext) + @param inlen The length of the input (octets) + @param out [out] The ciphertext (or plaintext), length inlen + @return CRYPT_OK if successful +*/ +int sober128_crypt(sober128_state *c, const unsigned char *in, unsigned long inlen, unsigned char *out) +{ + ulong32 t; + + if (inlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(c != NULL); + + /* handle any previously buffered bytes */ + while (c->nbuf != 0 && inlen != 0) { + *out++ = *in++ ^ (c->sbuf & 0xFF); + c->sbuf >>= 8; + c->nbuf -= 8; + --inlen; + } + +#ifndef LTC_SMALL_CODE + /* do lots at a time, if there's enough to do */ + while (inlen >= N*4) { + SROUND(0); + SROUND(1); + SROUND(2); + SROUND(3); + SROUND(4); + SROUND(5); + SROUND(6); + SROUND(7); + SROUND(8); + SROUND(9); + SROUND(10); + SROUND(11); + SROUND(12); + SROUND(13); + SROUND(14); + SROUND(15); + SROUND(16); + out += 4*N; + in += 4*N; + inlen -= 4*N; + } +#endif + + /* do small or odd size buffers the slow way */ + while (4 <= inlen) { + cycle(c->R); + t = nltap(c); + XORWORD(t, in, out); + out += 4; + in += 4; + inlen -= 4; + } + + /* handle any trailing bytes */ + if (inlen != 0) { + cycle(c->R); + c->sbuf = nltap(c); + c->nbuf = 32; + while (c->nbuf != 0 && inlen != 0) { + *out++ = *in++ ^ (c->sbuf & 0xFF); + c->sbuf >>= 8; + c->nbuf -= 8; + --inlen; + } + } + + return CRYPT_OK; +} + +int sober128_keystream(sober128_state *c, unsigned char *out, unsigned long outlen) +{ + if (outlen == 0) return CRYPT_OK; /* nothing to do */ + LTC_ARGCHK(out != NULL); + XMEMSET(out, 0, outlen); + return sober128_crypt(c, out, outlen, out); +} + +/** + Terminate and clear Sober128 state + @param c The Sober128 state + @return CRYPT_OK on success +*/ +int sober128_stream_done(sober128_state *c) +{ + LTC_ARGCHK(c != NULL); + XMEMSET(c, 0, sizeof(sober128_state)); + return CRYPT_OK; +} + +#endif diff --git a/src/stream/sober128/sober128_test.c b/src/stream/sober128/sober128_test.c new file mode 100644 index 000000000..99d1abd00 --- /dev/null +++ b/src/stream/sober128/sober128_test.c @@ -0,0 +1,49 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_SOBER128 + +int sober128_test(void) +{ +#ifndef LTC_TEST + return CRYPT_NOP; +#else + unsigned char key[16] = { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6b, 0x65, 0x79, + 0x20, 0x31, 0x32, 0x38, 0x62, 0x69, 0x74, 0x73 }; + unsigned char iv[4] = { 0x00, 0x00, 0x00, 0x00 }; + unsigned char out[20] = { 0x43, 0x50, 0x0c, 0xcf, 0x89, 0x91, 0x9f, 0x1d, + 0xaa, 0x37, 0x74, 0x95, 0xf4, 0xb4, 0x58, 0xc2, + 0x40, 0x37, 0x8b, 0xbb }; + int err, len = 20; + unsigned char src[20], dst[20]; + sober128_state st; + + XMEMSET(src, 0, len); /* input */ + if ((err = sober128_setup(&st, key, sizeof(key))) != CRYPT_OK) return err; + if ((err = sober128_setiv(&st, iv, sizeof(iv))) != CRYPT_OK) return err; + if ((err = sober128_crypt(&st, src, len, dst)) != CRYPT_OK) return err; + if ((err = sober128_stream_done(&st)) != CRYPT_OK) return err; + if (XMEMCMP(dst, out, len)) { +#if 0 + int y; + printf("\nLTC_SOBER128 failed, I got:\n"); + for (y = 0; y < len; y++) printf("%02x ", dst[y]); + printf("\nLTC_SOBER128 failed, expected:\n"); + for (y = 0; y < len; y++) printf("%02x ", out[y]); + printf("\n"); +#endif + return CRYPT_FAIL_TESTVECTOR; + } + return CRYPT_OK; +#endif +} + +#endif diff --git a/src/prngs/sober128tab.c b/src/stream/sober128/sober128tab.c similarity index 100% rename from src/prngs/sober128tab.c rename to src/stream/sober128/sober128tab.c diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index d7f582abc..b9e55df15 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -14,10 +14,16 @@ int cipher_hash_test(void) DOX(cipher_descriptor[x].test(), cipher_descriptor[x].name); } -#ifdef LTC_CHACHA - /* ChaCha is a special case (stream cipher) */ + /* stream ciphers */ +#ifdef LTC_CHACHA_STREAM DO(chacha_test()); #endif +#ifdef LTC_RC4_STREAM + DO(rc4_test()); +#endif +#ifdef LTC_SOBER128_STREAM + DO(sober128_test()); +#endif /* test hashes */ for (x = 0; hash_descriptor[x].name != NULL; x++) { diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index b3ec43a81..b640681f6 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -342,7 +342,7 @@ static void _unregister_all(void) #ifdef LTC_RC4 unregister_prng(&rc4_desc); #endif -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_PRNG unregister_prng(&chacha20_prng_desc); #endif #ifdef LTC_SOBER128 @@ -524,7 +524,7 @@ register_prng(&fortuna_desc); #ifdef LTC_RC4 register_prng(&rc4_desc); #endif -#ifdef LTC_CHACHA +#ifdef LTC_CHACHA_PRNG register_prng(&chacha20_prng_desc); #endif #ifdef LTC_SOBER128 From 28835a513f2158f9d7e5c06f3cce43f58c4d819a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 24 Apr 2017 21:36:41 +0200 Subject: [PATCH 0671/1192] update makefiles --- libtomcrypt_VS2008.vcproj | 112 +++++++++++++++++++++++--------------- makefile | 4 +- makefile.icc | 4 +- makefile.mingw | 4 +- makefile.msvc | 4 +- makefile.shared | 4 +- makefile.unix | 4 +- 7 files changed, 86 insertions(+), 50 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index f79153fc2..b256dd727 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2347,50 +2347,6 @@ RelativePath="src\prngs\sober128.c" > - - - - - - - - - - - - - - @@ -2435,6 +2391,74 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/makefile b/makefile index 694361ceb..64ec249e5 100644 --- a/makefile +++ b/makefile @@ -191,7 +191,9 @@ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ -src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ +src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ +src/stream/sober128/sober128_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.icc b/makefile.icc index c68a52e4b..590c07552 100644 --- a/makefile.icc +++ b/makefile.icc @@ -245,7 +245,9 @@ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ -src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ +src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ +src/stream/sober128/sober128_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.mingw b/makefile.mingw index 71a450b3d..b1eaa2fc4 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -181,7 +181,9 @@ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ -src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ +src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ +src/stream/sober128/sober128_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.msvc b/makefile.msvc index 8f6ebaecb..e4894c70e 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -156,7 +156,9 @@ src/pk/rsa/rsa_verify_hash.obj src/prngs/chacha20.obj src/prngs/fortuna.obj src/ src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ src/prngs/yarrow.obj src/stream/chacha/chacha_crypt.obj src/stream/chacha/chacha_done.obj \ src/stream/chacha/chacha_ivctr32.obj src/stream/chacha/chacha_ivctr64.obj \ -src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/stream/chacha/chacha_test.obj +src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/stream/chacha/chacha_test.obj \ +src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128.obj \ +src/stream/sober128/sober128_test.obj HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.shared b/makefile.shared index 1cd622c49..2932ddab1 100644 --- a/makefile.shared +++ b/makefile.shared @@ -179,7 +179,9 @@ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ -src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ +src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ +src/stream/sober128/sober128_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ diff --git a/makefile.unix b/makefile.unix index f23efb3fb..ddced572d 100644 --- a/makefile.unix +++ b/makefile.unix @@ -186,7 +186,9 @@ src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/ src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ -src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ +src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ +src/stream/sober128/sober128_test.o HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ From dd35e86c60047592461296c18a86d8434571f672 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 24 Apr 2017 21:53:03 +0200 Subject: [PATCH 0672/1192] renaming rc4+sober128 stream API to *_stream_* --- src/headers/tomcrypt_cipher.h | 18 +++++++++--------- src/prngs/rc4.c | 12 ++++++------ src/prngs/sober128.c | 14 +++++++------- src/stream/rc4/rc4.c | 8 ++++---- src/stream/rc4/rc4_test.c | 10 +++++----- src/stream/sober128/sober128.c | 10 +++++----- src/stream/sober128/sober128_test.c | 10 +++++----- testprof/cipher_hash_test.c | 4 ++-- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index acb620027..cff4e7cab 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -966,11 +966,11 @@ typedef struct { unsigned char buf[256]; } rc4_state; -int rc4_setup(rc4_state *st, const unsigned char *key, unsigned long keylen); -int rc4_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int rc4_keystream(rc4_state *st, unsigned char *out, unsigned long outlen); +int rc4_stream_setup(rc4_state *st, const unsigned char *key, unsigned long keylen); +int rc4_stream_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int rc4_stream_keystream(rc4_state *st, unsigned char *out, unsigned long outlen); int rc4_stream_done(rc4_state *st); -int rc4_test(void); +int rc4_stream_test(void); #endif /* LTC_RC4_STREAM */ @@ -984,12 +984,12 @@ typedef struct { int nbuf; /* number of part-word stream bits buffered */ } sober128_state; -int sober128_setup(sober128_state *st, const unsigned char *key, unsigned long keylen); -int sober128_setiv(sober128_state *st, const unsigned char *iv, unsigned long ivlen); -int sober128_crypt(sober128_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int sober128_keystream(sober128_state *st, unsigned char *out, unsigned long outlen); +int sober128_stream_setup(sober128_state *st, const unsigned char *key, unsigned long keylen); +int sober128_stream_setiv(sober128_state *st, const unsigned char *iv, unsigned long ivlen); +int sober128_stream_crypt(sober128_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int sober128_stream_keystream(sober128_state *st, unsigned char *out, unsigned long outlen); int sober128_stream_done(sober128_state *st); -int sober128_test(void); +int sober128_stream_test(void); #endif /* LTC_SOBER128_STREAM */ diff --git a/src/prngs/rc4.c b/src/prngs/rc4.c index 321279174..cae3c4250 100644 --- a/src/prngs/rc4.c +++ b/src/prngs/rc4.c @@ -66,12 +66,12 @@ int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *pr LTC_MUTEX_LOCK(&prng->lock); if (prng->ready) { /* rc4_ready() was already called, do "rekey" operation */ - if ((err = rc4_keystream(&prng->rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; + if ((err = rc4_stream_keystream(&prng->rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; for(i = 0; i < inlen; i++) buf[i % sizeof(buf)] ^= in[i]; /* initialize RC4 */ - if ((err = rc4_setup(&prng->rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; + if ((err = rc4_stream_setup(&prng->rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; /* drop first 3072 bytes - https://en.wikipedia.org/wiki/RC4#Fluhrer.2C_Mantin_and_Shamir_attack */ - for (i = 0; i < 12; i++) rc4_keystream(&prng->rc4.s, buf, sizeof(buf)); + for (i = 0; i < 12; i++) rc4_stream_keystream(&prng->rc4.s, buf, sizeof(buf)); } else { /* rc4_ready() was not called yet, add entropy to the buffer */ @@ -101,9 +101,9 @@ int rc4_ready(prng_state *prng) XMEMCPY(buf, prng->rc4.s.buf, sizeof(buf)); /* initialize RC4 */ len = MIN(prng->rc4.s.x, 256); /* TODO: we can perhaps always use all 256 bytes */ - if ((err = rc4_setup(&prng->rc4.s, buf, len)) != CRYPT_OK) goto LBL_UNLOCK; + if ((err = rc4_stream_setup(&prng->rc4.s, buf, len)) != CRYPT_OK) goto LBL_UNLOCK; /* drop first 3072 bytes - https://en.wikipedia.org/wiki/RC4#Fluhrer.2C_Mantin_and_Shamir_attack */ - for (i = 0; i < 12; i++) rc4_keystream(&prng->rc4.s, buf, sizeof(buf)); + for (i = 0; i < 12; i++) rc4_stream_keystream(&prng->rc4.s, buf, sizeof(buf)); prng->ready = 1; LBL_UNLOCK: LTC_MUTEX_UNLOCK(&prng->lock); @@ -122,7 +122,7 @@ unsigned long rc4_read(unsigned char *out, unsigned long outlen, prng_state *prn if (outlen == 0 || prng == NULL || out == NULL) return 0; LTC_MUTEX_LOCK(&prng->lock); if (!prng->ready) { outlen = 0; goto LBL_UNLOCK; } - if (rc4_keystream(&prng->rc4.s, out, outlen) != CRYPT_OK) outlen = 0; + if (rc4_stream_keystream(&prng->rc4.s, out, outlen) != CRYPT_OK) outlen = 0; LBL_UNLOCK: LTC_MUTEX_UNLOCK(&prng->lock); return outlen; diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index c1069d1a2..d5bf804a5 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -66,12 +66,12 @@ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_stat LTC_MUTEX_LOCK(&prng->lock); if (prng->ready) { /* sober128_ready() was already called, do "rekey" operation */ - if ((err = sober128_keystream(&prng->sober128.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; + if ((err = sober128_stream_keystream(&prng->sober128.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; for(i = 0; i < inlen; i++) buf[i % sizeof(buf)] ^= in[i]; /* key 32 bytes, 20 rounds */ - if ((err = sober128_setup(&prng->sober128.s, buf, 32)) != CRYPT_OK) goto LBL_UNLOCK; + if ((err = sober128_stream_setup(&prng->sober128.s, buf, 32)) != CRYPT_OK) goto LBL_UNLOCK; /* iv 8 bytes */ - if ((err = sober128_setiv(&prng->sober128.s, buf + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; + if ((err = sober128_stream_setiv(&prng->sober128.s, buf + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; /* clear KEY + IV */ XMEMSET(buf, 0, sizeof(buf)); } @@ -97,11 +97,11 @@ int sober128_ready(prng_state *prng) LTC_ARGCHK(prng != NULL); LTC_MUTEX_LOCK(&prng->lock); - if (prng->ready) { err = CRYPT_OK; goto LBL_UNLOCK; } + if (prng->ready) { err = CRYPT_OK; goto LBL_UNLOCK; } /* key 32 bytes, 20 rounds */ - if ((err = sober128_setup(&prng->sober128.s, prng->sober128.ent, 32)) != CRYPT_OK) goto LBL_UNLOCK; + if ((err = sober128_stream_setup(&prng->sober128.s, prng->sober128.ent, 32)) != CRYPT_OK) goto LBL_UNLOCK; /* iv 8 bytes */ - if ((err = sober128_setiv(&prng->sober128.s, prng->sober128.ent + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; + if ((err = sober128_stream_setiv(&prng->sober128.s, prng->sober128.ent + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; XMEMSET(&prng->sober128.ent, 0, sizeof(prng->sober128.ent)); prng->sober128.idx = 0; prng->ready = 1; @@ -122,7 +122,7 @@ unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state if (outlen == 0 || prng == NULL || out == NULL) return 0; LTC_MUTEX_LOCK(&prng->lock); if (!prng->ready) { outlen = 0; goto LBL_UNLOCK; } - if (sober128_keystream(&prng->sober128.s, out, outlen) != CRYPT_OK) outlen = 0; + if (sober128_stream_keystream(&prng->sober128.s, out, outlen) != CRYPT_OK) outlen = 0; LBL_UNLOCK: LTC_MUTEX_UNLOCK(&prng->lock); return outlen; diff --git a/src/stream/rc4/rc4.c b/src/stream/rc4/rc4.c index 90227f2e4..ec174a0c2 100644 --- a/src/stream/rc4/rc4.c +++ b/src/stream/rc4/rc4.c @@ -18,7 +18,7 @@ @param keylen The length of the secret key (8 - 256 bytes) @return CRYPT_OK if successful */ -int rc4_setup(rc4_state *st, const unsigned char *key, unsigned long keylen) +int rc4_stream_setup(rc4_state *st, const unsigned char *key, unsigned long keylen) { unsigned char tmp, *s; int x, y; @@ -54,7 +54,7 @@ int rc4_setup(rc4_state *st, const unsigned char *key, unsigned long keylen) @param out [out] The ciphertext (or plaintext), length inlen @return CRYPT_OK if successful */ -int rc4_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) +int rc4_stream_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out) { unsigned char x, y, *s, tmp; @@ -84,12 +84,12 @@ int rc4_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsig @param outlen The output length @return CRYPT_OK on success */ -int rc4_keystream(rc4_state *st, unsigned char *out, unsigned long outlen) +int rc4_stream_keystream(rc4_state *st, unsigned char *out, unsigned long outlen) { if (outlen == 0) return CRYPT_OK; /* nothing to do */ LTC_ARGCHK(out != NULL); XMEMSET(out, 0, outlen); - return rc4_crypt(st, out, outlen, out); + return rc4_stream_crypt(st, out, outlen, out); } /** diff --git a/src/stream/rc4/rc4_test.c b/src/stream/rc4/rc4_test.c index 36ace3def..f1b31ac04 100644 --- a/src/stream/rc4/rc4_test.c +++ b/src/stream/rc4/rc4_test.c @@ -11,7 +11,7 @@ #ifdef LTC_RC4_STREAM -int rc4_test(void) +int rc4_stream_test(void) { #ifndef LTC_TEST return CRYPT_NOP; @@ -23,10 +23,10 @@ int rc4_test(void) const unsigned char ct[] = { 0x75, 0xb7, 0x87, 0x80, 0x99, 0xe0, 0xc5, 0x96 }; unsigned char buf[10]; - if ((err = rc4_setup(&st, key, sizeof(key))) != CRYPT_OK) return err; - if ((err = rc4_crypt(&st, pt, sizeof(pt), buf)) != CRYPT_OK) return err; - if (XMEMCMP(buf, ct, sizeof(ct))) return CRYPT_FAIL_TESTVECTOR; - if ((err = rc4_stream_done(&st)) != CRYPT_OK) return err; + if ((err = rc4_stream_setup(&st, key, sizeof(key))) != CRYPT_OK) return err; + if ((err = rc4_stream_crypt(&st, pt, sizeof(pt), buf)) != CRYPT_OK) return err; + if (XMEMCMP(buf, ct, sizeof(ct))) return CRYPT_FAIL_TESTVECTOR; + if ((err = rc4_stream_done(&st)) != CRYPT_OK) return err; return CRYPT_OK; #endif diff --git a/src/stream/sober128/sober128.c b/src/stream/sober128/sober128.c index c9da8db65..b192d9a70 100644 --- a/src/stream/sober128/sober128.c +++ b/src/stream/sober128/sober128.c @@ -161,7 +161,7 @@ static void s128_diffuse(sober128_state *c) @param keylen The length of the secret key (octets) @return CRYPT_OK if successful */ -int sober128_setup(sober128_state *c, const unsigned char *key, unsigned long keylen) +int sober128_stream_setup(sober128_state *c, const unsigned char *key, unsigned long keylen) { ulong32 i, k; @@ -208,7 +208,7 @@ int sober128_setup(sober128_state *c, const unsigned char *key, unsigned long ke @param inlen The length of the IV (must be 12) @return CRYPT_OK on success */ -int sober128_setiv(sober128_state *c, const unsigned char *iv, unsigned long ivlen) +int sober128_stream_setiv(sober128_state *c, const unsigned char *iv, unsigned long ivlen) { ulong32 i, k; @@ -253,7 +253,7 @@ int sober128_setiv(sober128_state *c, const unsigned char *iv, unsigned long ivl @param out [out] The ciphertext (or plaintext), length inlen @return CRYPT_OK if successful */ -int sober128_crypt(sober128_state *c, const unsigned char *in, unsigned long inlen, unsigned char *out) +int sober128_stream_crypt(sober128_state *c, const unsigned char *in, unsigned long inlen, unsigned char *out) { ulong32 t; @@ -321,12 +321,12 @@ int sober128_crypt(sober128_state *c, const unsigned char *in, unsigned long inl return CRYPT_OK; } -int sober128_keystream(sober128_state *c, unsigned char *out, unsigned long outlen) +int sober128_stream_keystream(sober128_state *c, unsigned char *out, unsigned long outlen) { if (outlen == 0) return CRYPT_OK; /* nothing to do */ LTC_ARGCHK(out != NULL); XMEMSET(out, 0, outlen); - return sober128_crypt(c, out, outlen, out); + return sober128_stream_crypt(c, out, outlen, out); } /** diff --git a/src/stream/sober128/sober128_test.c b/src/stream/sober128/sober128_test.c index 99d1abd00..a299bbe1f 100644 --- a/src/stream/sober128/sober128_test.c +++ b/src/stream/sober128/sober128_test.c @@ -11,7 +11,7 @@ #ifdef LTC_SOBER128 -int sober128_test(void) +int sober128_stream_test(void) { #ifndef LTC_TEST return CRYPT_NOP; @@ -27,10 +27,10 @@ int sober128_test(void) sober128_state st; XMEMSET(src, 0, len); /* input */ - if ((err = sober128_setup(&st, key, sizeof(key))) != CRYPT_OK) return err; - if ((err = sober128_setiv(&st, iv, sizeof(iv))) != CRYPT_OK) return err; - if ((err = sober128_crypt(&st, src, len, dst)) != CRYPT_OK) return err; - if ((err = sober128_stream_done(&st)) != CRYPT_OK) return err; + if ((err = sober128_stream_setup(&st, key, sizeof(key))) != CRYPT_OK) return err; + if ((err = sober128_stream_setiv(&st, iv, sizeof(iv))) != CRYPT_OK) return err; + if ((err = sober128_stream_crypt(&st, src, len, dst)) != CRYPT_OK) return err; + if ((err = sober128_stream_done(&st)) != CRYPT_OK) return err; if (XMEMCMP(dst, out, len)) { #if 0 int y; diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index b9e55df15..9f36c8d47 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -19,10 +19,10 @@ int cipher_hash_test(void) DO(chacha_test()); #endif #ifdef LTC_RC4_STREAM - DO(rc4_test()); + DO(rc4_stream_test()); #endif #ifdef LTC_SOBER128_STREAM - DO(sober128_test()); + DO(sober128_stream_test()); #endif /* test hashes */ From 0df0c9b12cbe2404ec352e02564cf9b9a76f32d7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 24 Apr 2017 21:55:55 +0200 Subject: [PATCH 0673/1192] LTC_CHACHA_STREAM >> LTC_CHACHA --- src/headers/tomcrypt_cipher.h | 4 ++-- src/headers/tomcrypt_custom.h | 10 +++++----- src/misc/crypt/crypt.c | 2 +- src/stream/chacha/chacha_crypt.c | 2 +- src/stream/chacha/chacha_done.c | 2 +- src/stream/chacha/chacha_ivctr32.c | 2 +- src/stream/chacha/chacha_ivctr64.c | 2 +- src/stream/chacha/chacha_keystream.c | 2 +- src/stream/chacha/chacha_setup.c | 2 +- src/stream/chacha/chacha_test.c | 2 +- testprof/cipher_hash_test.c | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index cff4e7cab..fc5b65223 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -939,7 +939,7 @@ LTC_MUTEX_PROTO(ltc_cipher_mutex) /* ---- stream ciphers ---- */ -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA typedef struct { ulong32 input[16]; @@ -957,7 +957,7 @@ int chacha_keystream(chacha_state *st, unsigned char *out, unsigned long outlen) int chacha_done(chacha_state *st); int chacha_test(void); -#endif /* LTC_CHACHA_STREAM */ +#endif /* LTC_CHACHA */ #ifdef LTC_RC4_STREAM diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 831c541c9..83c76d252 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -191,7 +191,7 @@ #define LTC_CAMELLIA /* stream ciphers */ -#define LTC_CHACHA_STREAM +#define LTC_CHACHA #define LTC_RC4_STREAM #define LTC_SOBER128_STREAM @@ -518,12 +518,12 @@ #error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled #endif -#if defined(LTC_CHACHA20POLY1305_MODE) && (!defined(LTC_CHACHA_STREAM) || !defined(LTC_POLY1305)) - #error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA_STREAM + LTC_POLY1305 +#if defined(LTC_CHACHA20POLY1305_MODE) && (!defined(LTC_CHACHA) || !defined(LTC_POLY1305)) + #error LTC_CHACHA20POLY1305_MODE requires LTC_CHACHA + LTC_POLY1305 #endif -#if defined(LTC_CHACHA20_PRNG) && !defined(LTC_CHACHA_STREAM) - #error LTC_CHACHA20_PRNG requires LTC_CHACHA_STREAM +#if defined(LTC_CHACHA20_PRNG) && !defined(LTC_CHACHA) + #error LTC_CHACHA20_PRNG requires LTC_CHACHA #endif #if defined(LTC_RC4) && !defined(LTC_RC4_STREAM) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 9787c13a7..cfe260639 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -125,7 +125,7 @@ const char *crypt_build_settings = " Camellia\n" #endif "Stream ciphers built-in:\n" -#if defined(LTC_CHACHA_STREAM) +#if defined(LTC_CHACHA) " ChaCha\n" #endif #if defined(LTC_RC4_STREAM) diff --git a/src/stream/chacha/chacha_crypt.c b/src/stream/chacha/chacha_crypt.c index d1c691c63..de42a1069 100644 --- a/src/stream/chacha/chacha_crypt.c +++ b/src/stream/chacha/chacha_crypt.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA #define QUARTERROUND(a,b,c,d) \ x[a] += x[b]; x[d] = ROL(x[d] ^ x[a], 16); \ diff --git a/src/stream/chacha/chacha_done.c b/src/stream/chacha/chacha_done.c index 06afbd249..4d6e278b0 100644 --- a/src/stream/chacha/chacha_done.c +++ b/src/stream/chacha/chacha_done.c @@ -9,7 +9,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA /** Terminate and clear ChaCha state diff --git a/src/stream/chacha/chacha_ivctr32.c b/src/stream/chacha/chacha_ivctr32.c index 5602f6d7f..9884a1ee9 100644 --- a/src/stream/chacha/chacha_ivctr32.c +++ b/src/stream/chacha/chacha_ivctr32.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA /** Set IV + counter data to the ChaCha state diff --git a/src/stream/chacha/chacha_ivctr64.c b/src/stream/chacha/chacha_ivctr64.c index 9780e09c0..82d39fb47 100644 --- a/src/stream/chacha/chacha_ivctr64.c +++ b/src/stream/chacha/chacha_ivctr64.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA /** Set IV + counter data to the ChaCha state diff --git a/src/stream/chacha/chacha_keystream.c b/src/stream/chacha/chacha_keystream.c index 5ea3b579e..b45323f2f 100644 --- a/src/stream/chacha/chacha_keystream.c +++ b/src/stream/chacha/chacha_keystream.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA /** Generate a stream of random bytes via ChaCha diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c index 5dc5d7268..69a148335 100644 --- a/src/stream/chacha/chacha_setup.c +++ b/src/stream/chacha/chacha_setup.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA static const char * const sigma = "expand 32-byte k"; static const char * const tau = "expand 16-byte k"; diff --git a/src/stream/chacha/chacha_test.c b/src/stream/chacha/chacha_test.c index c22e09be7..914a48cf3 100644 --- a/src/stream/chacha/chacha_test.c +++ b/src/stream/chacha/chacha_test.c @@ -14,7 +14,7 @@ #include "tomcrypt.h" -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA int chacha_test(void) { diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index 9f36c8d47..d5a1793df 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -15,7 +15,7 @@ int cipher_hash_test(void) } /* stream ciphers */ -#ifdef LTC_CHACHA_STREAM +#ifdef LTC_CHACHA DO(chacha_test()); #endif #ifdef LTC_RC4_STREAM From 28927be1dd8272aa49c0c3ad1a71d9212cb1d96b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 24 Apr 2017 22:39:56 +0200 Subject: [PATCH 0674/1192] typo LTC_CHACHA_PRNG / LTC_CHACHA20_PRNG --- testprof/x86_prof.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index b640681f6..0d200614a 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -342,7 +342,7 @@ static void _unregister_all(void) #ifdef LTC_RC4 unregister_prng(&rc4_desc); #endif -#ifdef LTC_CHACHA_PRNG +#ifdef LTC_CHACHA20_PRNG unregister_prng(&chacha20_prng_desc); #endif #ifdef LTC_SOBER128 @@ -524,7 +524,7 @@ register_prng(&fortuna_desc); #ifdef LTC_RC4 register_prng(&rc4_desc); #endif -#ifdef LTC_CHACHA_PRNG +#ifdef LTC_CHACHA20_PRNG register_prng(&chacha20_prng_desc); #endif #ifdef LTC_SOBER128 From da25a237128f6f6a02b27f36c9ec4abba358fe2b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 24 Apr 2017 22:45:56 +0200 Subject: [PATCH 0675/1192] increasing prngs/rc4 coverage --- src/prngs/rc4.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/prngs/rc4.c b/src/prngs/rc4.c index cae3c4250..e7d3afcc7 100644 --- a/src/prngs/rc4.c +++ b/src/prngs/rc4.c @@ -211,16 +211,20 @@ int rc4_test(void) unsigned long dmplen = sizeof(dmp); unsigned char out[1000]; unsigned char t1[] = { 0xE0, 0x4D, 0x9A, 0xF6, 0xA8, 0x9D, 0x77, 0x53, 0xAE, 0x09 }; - unsigned char t2[] = { 0x9D, 0x3C, 0xC6, 0x64, 0x36, 0xB6, 0x76, 0xD5, 0xEB, 0x93 }; - unsigned char t3[] = { 0x6B, 0x6D, 0xF5, 0xCB, 0x84, 0x37, 0x8F, 0x02, 0xA2, 0x90 }; + unsigned char t2[] = { 0xEF, 0x80, 0xA2, 0xE6, 0x50, 0x91, 0xF3, 0x17, 0x4A, 0x8A }; + unsigned char t3[] = { 0x4B, 0xD6, 0x5C, 0x67, 0x99, 0x03, 0x56, 0x12, 0x80, 0x48 }; int err; if ((err = rc4_start(&st)) != CRYPT_OK) return err; + /* add entropy to uninitialized prng */ if ((err = rc4_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; if ((err = rc4_ready(&st)) != CRYPT_OK) return err; if (rc4_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ if (compare_testvector(out, 10, t1, sizeof(t1), "RC4-PRNG", 1)) return CRYPT_FAIL_TESTVECTOR; - if (rc4_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; + if (rc4_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + /* add entropy to already initialized prng */ + if ((err = rc4_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; + if (rc4_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ if ((err = rc4_export(dmp, &dmplen, &st)) != CRYPT_OK) return err; if (rc4_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ if (rc4_read(out, 10, &st) != 10) return CRYPT_ERROR_READPRNG; /* 10 bytes for testing */ From 784a009efe42eddad877a6432e32a3a10982c3e8 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 24 Apr 2017 23:46:30 +0200 Subject: [PATCH 0676/1192] increase coverage --- src/prngs/sprng.c | 15 +++++++++++++++ testprof/cipher_hash_test.c | 13 ++++++++++--- testprof/x86_prof.c | 3 +++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/prngs/sprng.c b/src/prngs/sprng.c index 0d4457158..7e1865f48 100644 --- a/src/prngs/sprng.c +++ b/src/prngs/sprng.c @@ -133,7 +133,22 @@ int sprng_import(const unsigned char *in, unsigned long inlen, prng_state *prng) */ int sprng_test(void) { +#ifndef LTC_TEST + return CRYPT_NOP; +#else + prng_state st; + unsigned char en[] = { 0x01, 0x02, 0x03, 0x04 }; + unsigned char out[1000]; + int err; + + if ((err = sprng_start(&st)) != CRYPT_OK) return err; + if ((err = sprng_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; + if ((err = sprng_ready(&st)) != CRYPT_OK) return err; + if (sprng_read(out, 500, &st) != 500) return CRYPT_ERROR_READPRNG; /* skip 500 bytes */ + if ((err = sprng_done(&st)) != CRYPT_OK) return err; + return CRYPT_OK; +#endif } #endif diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index d5a1793df..7f9f96883 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -6,7 +6,7 @@ int cipher_hash_test(void) { int x; unsigned char buf[4096]; - unsigned long n; + unsigned long n, one; prng_state nprng; /* test ciphers */ @@ -40,13 +40,20 @@ int cipher_hash_test(void) DOX(prng_descriptor[x].add_entropy((unsigned char *)"helloworld12", 12, &nprng), prng_descriptor[x].name); DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); n = sizeof(buf); + if (strcmp(prng_descriptor[x].name, "sprng")) { + one = 1; + if (prng_descriptor[x].pexport(buf, &one, &nprng) != CRYPT_BUFFER_OVERFLOW) { + fprintf(stderr, "Error testing pexport with a short buffer (%s)\n", prng_descriptor[x].name); + return CRYPT_ERROR; + } + } DOX(prng_descriptor[x].pexport(buf, &n, &nprng), prng_descriptor[x].name); prng_descriptor[x].done(&nprng); DOX(prng_descriptor[x].pimport(buf, n, &nprng), prng_descriptor[x].name); DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); if (prng_descriptor[x].read(buf, 100, &nprng) != 100) { - fprintf(stderr, "Error reading from imported PRNG!\n"); - exit(EXIT_FAILURE); + fprintf(stderr, "Error reading from imported PRNG (%s)!\n", prng_descriptor[x].name); + return CRYPT_ERROR; } prng_descriptor[x].done(&nprng); } diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 0d200614a..52c81a64b 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -530,6 +530,9 @@ register_prng(&chacha20_prng_desc); #ifdef LTC_SOBER128 register_prng(&sober128_desc); #endif +#ifdef LTC_SPRNG +register_prng(&sprng_desc); +#endif #ifdef LTC_PRNG_ENABLE_LTC_RNG ltc_rng = my_test_rng; From 1732ed8ce8becf9921fdd65ab276b265a777108b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 25 Apr 2017 00:08:13 +0200 Subject: [PATCH 0677/1192] increase coverage --- .../chachapoly/chacha20poly1305_test.c | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/encauth/chachapoly/chacha20poly1305_test.c b/src/encauth/chachapoly/chacha20poly1305_test.c index 36d512927..e117e4854 100644 --- a/src/encauth/chachapoly/chacha20poly1305_test.c +++ b/src/encauth/chachapoly/chacha20poly1305_test.c @@ -18,7 +18,8 @@ int chacha20poly1305_test(void) #else chacha20poly1305_state st1, st2; unsigned char k[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f }; - unsigned char iv[] = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47 }; + unsigned char i12[] = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47 }; + unsigned char i8[] = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43 }; unsigned char aad[] = { 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 }; unsigned char enc[] = { 0xD3, 0x1A, 0x8D, 0x34, 0x64, 0x8E, 0x60, 0xDB, 0x7B, 0x86, 0xAF, 0xBC, 0x53, 0xEF, 0x7E, 0xC2, 0xA4, 0xAD, 0xED, 0x51, 0x29, 0x6E, 0x08, 0xFE, 0xA9, 0xE2, 0xB5, 0xA7, 0x36, 0xEE, 0x62, 0xD6, @@ -37,9 +38,9 @@ int chacha20poly1305_test(void) unsigned char rfc7905_tag[] = { 0x16, 0x2C, 0x92, 0x48, 0x2A, 0xDB, 0xD3, 0x5D, 0x48, 0xBE, 0xC6, 0xFF, 0x10, 0x9C, 0xBA, 0xE4 }; unsigned char ct[1000], pt[1000], emac[16], dmac[16]; - /* encrypt */ + /* encrypt IV 96bit */ chacha20poly1305_init(&st1, k, sizeof(k)); - chacha20poly1305_setiv(&st1, iv, sizeof(iv)); + chacha20poly1305_setiv(&st1, i12, sizeof(i12)); chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); /* encrypt piece by piece */ chacha20poly1305_encrypt(&st1, (unsigned char *)m, 25, ct); @@ -54,9 +55,9 @@ int chacha20poly1305_test(void) if (compare_testvector(ct, mlen, enc, sizeof(enc), "ENC-CT", 1) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(emac, len, tag, sizeof(tag), "ENC-TAG", 2) != 0) return CRYPT_FAIL_TESTVECTOR; - /* decrypt */ + /* decrypt IV 96bit */ chacha20poly1305_init(&st2, k, len = sizeof(k)); - chacha20poly1305_setiv(&st2, iv, len = sizeof(iv)); + chacha20poly1305_setiv(&st2, i12, len = sizeof(i12)); chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad)); chacha20poly1305_decrypt(&st2, ct, 21, pt); chacha20poly1305_decrypt(&st2, ct + 21, mlen - 21, pt + 21); @@ -68,21 +69,21 @@ int chacha20poly1305_test(void) /* chacha20poly1305_memory - encrypt */ len = sizeof(emac); - chacha20poly1305_memory(k, sizeof(k), iv, sizeof(iv), aad, sizeof(aad), + chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), (unsigned char *)m, mlen, ct, emac, &len, CHCHA20POLY1305_ENCRYPT); if (compare_testvector(ct, mlen, enc, sizeof(enc), "ENC-CT2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(emac, len, tag, sizeof(tag), "ENC-TAG2", 2) != 0) return CRYPT_FAIL_TESTVECTOR; /* chacha20poly1305_memory - decrypt */ len = sizeof(dmac); - chacha20poly1305_memory(k, sizeof(k), iv, sizeof(iv), aad, sizeof(aad), + chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), ct, mlen, pt, dmac, &len, CHCHA20POLY1305_DECRYPT); if (compare_testvector(pt, mlen, m, mlen, "DEC-PT2", 3) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(dmac, len, tag, sizeof(tag), "DEC-TAG2", 4) != 0) return CRYPT_FAIL_TESTVECTOR; /* encrypt - rfc7905 */ chacha20poly1305_init(&st1, k, sizeof(k)); - chacha20poly1305_setiv_rfc7905(&st1, iv, sizeof(iv), CONST64(0x1122334455667788)); + chacha20poly1305_setiv_rfc7905(&st1, i12, sizeof(i12), CONST64(0x1122334455667788)); chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); chacha20poly1305_encrypt(&st1, rfc7905_pt, 16, ct); len = sizeof(emac); @@ -93,7 +94,7 @@ int chacha20poly1305_test(void) /* decrypt - rfc7905 */ chacha20poly1305_init(&st1, k, sizeof(k)); - chacha20poly1305_setiv_rfc7905(&st1, iv, sizeof(iv), CONST64(0x1122334455667788)); + chacha20poly1305_setiv_rfc7905(&st1, i12, sizeof(i12), CONST64(0x1122334455667788)); chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); chacha20poly1305_decrypt(&st1, ct, 16, pt); len = sizeof(dmac); @@ -102,6 +103,25 @@ int chacha20poly1305_test(void) if (compare_testvector(pt, 16, rfc7905_pt, 16, "DEC-CT3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(dmac, len, rfc7905_tag, 16, "DEC-TAG3", 2) != 0) return CRYPT_FAIL_TESTVECTOR; + /* encrypt IV 64bit */ + chacha20poly1305_init(&st1, k, sizeof(k)); + chacha20poly1305_setiv(&st1, i8, sizeof(i8)); + chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); + chacha20poly1305_encrypt(&st1, (unsigned char *)m, mlen, ct); + len = sizeof(emac); + chacha20poly1305_done(&st1, emac, &len); + + /* decrypt IV 96bit */ + chacha20poly1305_init(&st2, k, len = sizeof(k)); + chacha20poly1305_setiv(&st2, i8, len = sizeof(i8)); + chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad)); + chacha20poly1305_decrypt(&st2, ct, mlen, pt); + len = sizeof(dmac); + chacha20poly1305_done(&st2, dmac, &len); + + if (compare_testvector(pt, mlen, m, mlen, "DEC-PT4", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(dmac, len, emac, len, "DEC-TAG4", 2) != 0) return CRYPT_FAIL_TESTVECTOR; + return CRYPT_OK; #endif } From 9232f2e970d3bd96ea59ae2d671df4f063d53bb1 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 25 Apr 2017 16:57:33 +0200 Subject: [PATCH 0678/1192] fortuna/yarrow & export_size --- src/prngs/fortuna.c | 12 +++++++----- src/prngs/yarrow.c | 24 +++++++++--------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index 88ba28e39..ec910af9c 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -36,7 +36,8 @@ we reseed automatically when len(pool0) >= 64 or every LTC_FORTUNA_WD calls to t #endif const struct ltc_prng_descriptor fortuna_desc = { - "fortuna", 1024, + "fortuna", + (32 * LTC_FORTUNA_POOLS), /* default: 1024 */ &fortuna_start, &fortuna_add_entropy, &fortuna_ready, @@ -331,6 +332,7 @@ int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { int x, err; hash_state *md; + unsigned long len = fortuna_desc.export_size; LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); @@ -344,8 +346,8 @@ int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng) } /* we'll write bytes for s&g's */ - if (*outlen < 32*LTC_FORTUNA_POOLS) { - *outlen = 32*LTC_FORTUNA_POOLS; + if (*outlen < len) { + *outlen = len; err = CRYPT_BUFFER_OVERFLOW; goto LBL_UNLOCK; } @@ -379,7 +381,7 @@ int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng) goto LBL_ERR; } } - *outlen = 32*LTC_FORTUNA_POOLS; + *outlen = len; err = CRYPT_OK; LBL_ERR: @@ -406,7 +408,7 @@ int fortuna_import(const unsigned char *in, unsigned long inlen, prng_state *prn LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); - if (inlen != 32*LTC_FORTUNA_POOLS) { + if (inlen != (unsigned long)fortuna_desc.export_size) { return CRYPT_INVALID_ARG; } diff --git a/src/prngs/yarrow.c b/src/prngs/yarrow.c index c0d211e9a..7275ac89f 100644 --- a/src/prngs/yarrow.c +++ b/src/prngs/yarrow.c @@ -274,22 +274,22 @@ int yarrow_done(prng_state *prng) */ int yarrow_export(unsigned char *out, unsigned long *outlen, prng_state *prng) { + unsigned long len = yarrow_desc.export_size; + LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(prng != NULL); - if (!prng->ready) return CRYPT_ERROR; - /* we'll write 64 bytes for s&g's */ - if (*outlen < 64) { - *outlen = 64; + if (*outlen < len) { + *outlen = len; return CRYPT_BUFFER_OVERFLOW; } - if (yarrow_read(out, 64, prng) != 64) { + if (yarrow_read(out, len, prng) != len) { return CRYPT_ERROR_READPRNG; } - *outlen = 64; + *outlen = len; return CRYPT_OK; } @@ -306,16 +306,10 @@ int yarrow_import(const unsigned char *in, unsigned long inlen, prng_state *prng LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); + if (inlen < (unsigned long)yarrow_desc.export_size) return CRYPT_INVALID_ARG; - if (inlen != 64) { - return CRYPT_INVALID_ARG; - } - if ((err = yarrow_start(prng)) != CRYPT_OK) { - return err; - } - if ((err = yarrow_add_entropy(in, 64, prng)) != CRYPT_OK) { - return err; - } + if ((err = yarrow_start(prng)) != CRYPT_OK) return err; + if ((err = yarrow_add_entropy(in, inlen, prng)) != CRYPT_OK) return err; return CRYPT_OK; } From 90b482aa1eef35d4f4b0189bd37b4a1486042ae6 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 25 Apr 2017 17:21:35 +0200 Subject: [PATCH 0679/1192] stream/chacha - improved counter increment --- src/stream/chacha/chacha_crypt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/stream/chacha/chacha_crypt.c b/src/stream/chacha/chacha_crypt.c index de42a1069..30b5da7ae 100644 --- a/src/stream/chacha/chacha_crypt.c +++ b/src/stream/chacha/chacha_crypt.c @@ -71,8 +71,14 @@ int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, } for (;;) { _chacha_block(buf, st->input, st->rounds); - /* increment the counter */ - if (!++st->input[12] && !++st->input[13] && !++st->input[14]) { ++st->input[15]; } + if (st->ivlen == 8) { + /* IV-64bit, increment 64bit counter */ + if (0 == ++st->input[12] && 0 == ++st->input[13]) return CRYPT_OVERFLOW; + } + else { + /* IV-96bit, increment 32bit counter */ + if (0 == ++st->input[12]) return CRYPT_OVERFLOW; + } if (inlen <= 64) { for (i = 0; i < inlen; ++i) out[i] = in[i] ^ buf[i]; st->ksleft = 64 - inlen; From eb209aa2f9afb5b4dfd88c4762a2210b286836d1 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 25 Apr 2017 19:46:05 +0200 Subject: [PATCH 0680/1192] more error checking in *_test --- .../chachapoly/chacha20poly1305_test.c | 81 ++++++++++--------- src/mac/poly1305/poly1305_test.c | 28 ++++--- 2 files changed, 56 insertions(+), 53 deletions(-) diff --git a/src/encauth/chachapoly/chacha20poly1305_test.c b/src/encauth/chachapoly/chacha20poly1305_test.c index e117e4854..553025c2b 100644 --- a/src/encauth/chachapoly/chacha20poly1305_test.c +++ b/src/encauth/chachapoly/chacha20poly1305_test.c @@ -37,87 +37,88 @@ int chacha20poly1305_test(void) unsigned char rfc7905_enc[] = { 0xE4, 0x62, 0x85, 0xB4, 0x29, 0x95, 0x34, 0x96, 0xAB, 0xFB, 0x67, 0xCD, 0xAE, 0xAC, 0x94, 0x1E }; unsigned char rfc7905_tag[] = { 0x16, 0x2C, 0x92, 0x48, 0x2A, 0xDB, 0xD3, 0x5D, 0x48, 0xBE, 0xC6, 0xFF, 0x10, 0x9C, 0xBA, 0xE4 }; unsigned char ct[1000], pt[1000], emac[16], dmac[16]; + int err; /* encrypt IV 96bit */ - chacha20poly1305_init(&st1, k, sizeof(k)); - chacha20poly1305_setiv(&st1, i12, sizeof(i12)); - chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); + if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_setiv(&st1, i12, sizeof(i12))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_add_aad(&st1, aad, sizeof(aad))) != CRYPT_OK) return err; /* encrypt piece by piece */ - chacha20poly1305_encrypt(&st1, (unsigned char *)m, 25, ct); - chacha20poly1305_encrypt(&st1, (unsigned char *)m + 25, 10, ct + 25); - chacha20poly1305_encrypt(&st1, (unsigned char *)m + 35, 35, ct + 35); - chacha20poly1305_encrypt(&st1, (unsigned char *)m + 70, 5, ct + 70); - chacha20poly1305_encrypt(&st1, (unsigned char *)m + 75, 5, ct + 75); - chacha20poly1305_encrypt(&st1, (unsigned char *)m + 80, mlen - 80, ct + 80); + if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m, 25, ct)) != CRYPT_OK) return err; + if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 25, 10, ct + 25)) != CRYPT_OK) return err; + if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 35, 35, ct + 35)) != CRYPT_OK) return err; + if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 70, 5, ct + 70)) != CRYPT_OK) return err; + if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 75, 5, ct + 75)) != CRYPT_OK) return err; + if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 80, mlen - 80, ct + 80)) != CRYPT_OK) return err; len = sizeof(emac); - chacha20poly1305_done(&st1, emac, &len); + if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; if (compare_testvector(ct, mlen, enc, sizeof(enc), "ENC-CT", 1) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(emac, len, tag, sizeof(tag), "ENC-TAG", 2) != 0) return CRYPT_FAIL_TESTVECTOR; /* decrypt IV 96bit */ - chacha20poly1305_init(&st2, k, len = sizeof(k)); - chacha20poly1305_setiv(&st2, i12, len = sizeof(i12)); - chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad)); - chacha20poly1305_decrypt(&st2, ct, 21, pt); - chacha20poly1305_decrypt(&st2, ct + 21, mlen - 21, pt + 21); + if ((err = chacha20poly1305_init(&st2, k, len = sizeof(k))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_setiv(&st2, i12, len = sizeof(i12))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_decrypt(&st2, ct, 21, pt)) != CRYPT_OK) return err; + if ((err = chacha20poly1305_decrypt(&st2, ct + 21, mlen - 21, pt + 21)) != CRYPT_OK) return err; len = sizeof(dmac); - chacha20poly1305_done(&st2, dmac, &len); + if ((err = chacha20poly1305_done(&st2, dmac, &len)) != CRYPT_OK) return err; if (compare_testvector(pt, mlen, m, mlen, "DEC-PT", 3) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(dmac, len, tag, sizeof(tag), "DEC-TAG", 4) != 0) return CRYPT_FAIL_TESTVECTOR; /* chacha20poly1305_memory - encrypt */ len = sizeof(emac); - chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), - (unsigned char *)m, mlen, ct, emac, &len, CHCHA20POLY1305_ENCRYPT); + if ((err = chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), (unsigned char *)m, + mlen, ct, emac, &len, CHCHA20POLY1305_ENCRYPT)) != CRYPT_OK) return err; if (compare_testvector(ct, mlen, enc, sizeof(enc), "ENC-CT2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(emac, len, tag, sizeof(tag), "ENC-TAG2", 2) != 0) return CRYPT_FAIL_TESTVECTOR; /* chacha20poly1305_memory - decrypt */ len = sizeof(dmac); - chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), - ct, mlen, pt, dmac, &len, CHCHA20POLY1305_DECRYPT); + if ((err = chacha20poly1305_memory(k, sizeof(k), i12, sizeof(i12), aad, sizeof(aad), + ct, mlen, pt, dmac, &len, CHCHA20POLY1305_DECRYPT)) != CRYPT_OK) return err; if (compare_testvector(pt, mlen, m, mlen, "DEC-PT2", 3) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(dmac, len, tag, sizeof(tag), "DEC-TAG2", 4) != 0) return CRYPT_FAIL_TESTVECTOR; /* encrypt - rfc7905 */ - chacha20poly1305_init(&st1, k, sizeof(k)); - chacha20poly1305_setiv_rfc7905(&st1, i12, sizeof(i12), CONST64(0x1122334455667788)); - chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); - chacha20poly1305_encrypt(&st1, rfc7905_pt, 16, ct); + if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_setiv_rfc7905(&st1, i12, sizeof(i12), CONST64(0x1122334455667788))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_add_aad(&st1, aad, sizeof(aad))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_encrypt(&st1, rfc7905_pt, 16, ct)) != CRYPT_OK) return err; len = sizeof(emac); - chacha20poly1305_done(&st1, emac, &len); + if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; if (compare_testvector(ct, 16, rfc7905_enc, 16, "ENC-CT3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(emac, len, rfc7905_tag, 16, "ENC-TAG3", 2) != 0) return CRYPT_FAIL_TESTVECTOR; /* decrypt - rfc7905 */ - chacha20poly1305_init(&st1, k, sizeof(k)); - chacha20poly1305_setiv_rfc7905(&st1, i12, sizeof(i12), CONST64(0x1122334455667788)); - chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); - chacha20poly1305_decrypt(&st1, ct, 16, pt); + if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_setiv_rfc7905(&st1, i12, sizeof(i12), CONST64(0x1122334455667788))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_add_aad(&st1, aad, sizeof(aad))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_decrypt(&st1, ct, 16, pt)) != CRYPT_OK) return err; len = sizeof(dmac); - chacha20poly1305_done(&st1, dmac, &len); + if ((err = chacha20poly1305_done(&st1, dmac, &len)) != CRYPT_OK) return err; if (compare_testvector(pt, 16, rfc7905_pt, 16, "DEC-CT3", 1) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(dmac, len, rfc7905_tag, 16, "DEC-TAG3", 2) != 0) return CRYPT_FAIL_TESTVECTOR; /* encrypt IV 64bit */ - chacha20poly1305_init(&st1, k, sizeof(k)); - chacha20poly1305_setiv(&st1, i8, sizeof(i8)); - chacha20poly1305_add_aad(&st1, aad, sizeof(aad)); - chacha20poly1305_encrypt(&st1, (unsigned char *)m, mlen, ct); + if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_setiv(&st1, i8, sizeof(i8))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_add_aad(&st1, aad, sizeof(aad))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m, mlen, ct)) != CRYPT_OK) return err; len = sizeof(emac); - chacha20poly1305_done(&st1, emac, &len); + if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; /* decrypt IV 96bit */ - chacha20poly1305_init(&st2, k, len = sizeof(k)); - chacha20poly1305_setiv(&st2, i8, len = sizeof(i8)); - chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad)); - chacha20poly1305_decrypt(&st2, ct, mlen, pt); + if ((err = chacha20poly1305_init(&st2, k, len = sizeof(k))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_setiv(&st2, i8, len = sizeof(i8))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_decrypt(&st2, ct, mlen, pt)) != CRYPT_OK) return err; len = sizeof(dmac); - chacha20poly1305_done(&st2, dmac, &len); + if ((err = chacha20poly1305_done(&st2, dmac, &len)) != CRYPT_OK) return err; if (compare_testvector(pt, mlen, m, mlen, "DEC-PT4", 1) != 0) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(dmac, len, emac, len, "DEC-TAG4", 2) != 0) return CRYPT_FAIL_TESTVECTOR; diff --git a/src/mac/poly1305/poly1305_test.c b/src/mac/poly1305/poly1305_test.c index 57501a5e2..a73a15b1b 100644 --- a/src/mac/poly1305/poly1305_test.c +++ b/src/mac/poly1305/poly1305_test.c @@ -28,21 +28,23 @@ int poly1305_test(void) unsigned long len = 16, mlen = strlen(m); unsigned char out[1000]; poly1305_state st; + int err; + /* process piece by piece */ - poly1305_init(&st, k, 32); - poly1305_process(&st, (unsigned char*)m, 5); - poly1305_process(&st, (unsigned char*)m + 5, 4); - poly1305_process(&st, (unsigned char*)m + 9, 3); - poly1305_process(&st, (unsigned char*)m + 12, 2); - poly1305_process(&st, (unsigned char*)m + 14, 1); - poly1305_process(&st, (unsigned char*)m + 15, mlen - 15); - poly1305_done(&st, out, &len); - if (compare_testvector(out, len, tag, sizeof(tag), "POLY1305-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if ((err = poly1305_init(&st, k, 32)) != CRYPT_OK) return err; + if ((err = poly1305_process(&st, (unsigned char*)m, 5)) != CRYPT_OK) return err; + if ((err = poly1305_process(&st, (unsigned char*)m + 5, 4)) != CRYPT_OK) return err; + if ((err = poly1305_process(&st, (unsigned char*)m + 9, 3)) != CRYPT_OK) return err; + if ((err = poly1305_process(&st, (unsigned char*)m + 12, 2)) != CRYPT_OK) return err; + if ((err = poly1305_process(&st, (unsigned char*)m + 14, 1)) != CRYPT_OK) return err; + if ((err = poly1305_process(&st, (unsigned char*)m + 15, mlen - 15)) != CRYPT_OK) return err; + if ((err = poly1305_done(&st, out, &len)) != CRYPT_OK) return err; + if (compare_testvector(out, len, tag, sizeof(tag), "POLY1305-TV1", 1) != 0) return CRYPT_FAIL_TESTVECTOR; /* process in one go */ - poly1305_init(&st, k, 32); - poly1305_process(&st, (unsigned char*)m, mlen); - poly1305_done(&st, out, &len); - if (compare_testvector(out, len, tag, sizeof(tag), "POLY1305-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; + if ((err = poly1305_init(&st, k, 32)) != CRYPT_OK) return err; + if ((err = poly1305_process(&st, (unsigned char*)m, mlen)) != CRYPT_OK) return err; + if ((err = poly1305_done(&st, out, &len)) != CRYPT_OK) return err; + if (compare_testvector(out, len, tag, sizeof(tag), "POLY1305-TV2", 1) != 0) return CRYPT_FAIL_TESTVECTOR; return CRYPT_OK; #endif } From 9c972c833de5ae5acdf3629c6ca1818ef3a217b1 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 29 Apr 2017 13:30:19 +0200 Subject: [PATCH 0681/1192] fix chacha20poly1305_test --- src/encauth/chachapoly/chacha20poly1305_test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/encauth/chachapoly/chacha20poly1305_test.c b/src/encauth/chachapoly/chacha20poly1305_test.c index 553025c2b..e78cff57e 100644 --- a/src/encauth/chachapoly/chacha20poly1305_test.c +++ b/src/encauth/chachapoly/chacha20poly1305_test.c @@ -57,9 +57,9 @@ int chacha20poly1305_test(void) if (compare_testvector(emac, len, tag, sizeof(tag), "ENC-TAG", 2) != 0) return CRYPT_FAIL_TESTVECTOR; /* decrypt IV 96bit */ - if ((err = chacha20poly1305_init(&st2, k, len = sizeof(k))) != CRYPT_OK) return err; - if ((err = chacha20poly1305_setiv(&st2, i12, len = sizeof(i12))) != CRYPT_OK) return err; - if ((err = chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_init(&st2, k, sizeof(k))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_setiv(&st2, i12, sizeof(i12))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_add_aad(&st2, aad, sizeof(aad))) != CRYPT_OK) return err; if ((err = chacha20poly1305_decrypt(&st2, ct, 21, pt)) != CRYPT_OK) return err; if ((err = chacha20poly1305_decrypt(&st2, ct + 21, mlen - 21, pt + 21)) != CRYPT_OK) return err; len = sizeof(dmac); @@ -112,10 +112,10 @@ int chacha20poly1305_test(void) len = sizeof(emac); if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; - /* decrypt IV 96bit */ - if ((err = chacha20poly1305_init(&st2, k, len = sizeof(k))) != CRYPT_OK) return err; - if ((err = chacha20poly1305_setiv(&st2, i8, len = sizeof(i8))) != CRYPT_OK) return err; - if ((err = chacha20poly1305_add_aad(&st2, aad, len = sizeof(aad))) != CRYPT_OK) return err; + /* decrypt IV 64bit */ + if ((err = chacha20poly1305_init(&st2, k, sizeof(k))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_setiv(&st2, i8, sizeof(i8))) != CRYPT_OK) return err; + if ((err = chacha20poly1305_add_aad(&st2, aad, sizeof(aad))) != CRYPT_OK) return err; if ((err = chacha20poly1305_decrypt(&st2, ct, mlen, pt)) != CRYPT_OK) return err; len = sizeof(dmac); if ((err = chacha20poly1305_done(&st2, dmac, &len)) != CRYPT_OK) return err; From c6cee7bef00c4b32a9deed3c962f0042391f7058 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 29 Apr 2017 13:36:45 +0200 Subject: [PATCH 0682/1192] prngs/sober128 - import fix --- src/prngs/sober128.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index d5bf804a5..56f873cf4 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -187,8 +187,8 @@ int sober128_import(const unsigned char *in, unsigned long inlen, prng_state *pr LTC_ARGCHK(in != NULL); if (inlen < (unsigned long)sober128_desc.export_size) return CRYPT_INVALID_ARG; - if ((err = sober128_start(prng)) != CRYPT_OK) return err; - if ((err = sober128_add_entropy(in, inlen, prng)) != CRYPT_OK) return err; + if ((err = sober128_start(prng)) != CRYPT_OK) return err; + if ((err = sober128_add_entropy(in, sober128_desc.export_size, prng)) != CRYPT_OK) return err; return CRYPT_OK; } From d7f2b2dd6e8518df6e2eb651401eeb2a7c90a1fc Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 29 Apr 2017 13:39:48 +0200 Subject: [PATCH 0683/1192] fortuna - move LBL_UNLOCK before zeromem --- src/prngs/fortuna.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index ec910af9c..72e8c933d 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -281,10 +281,10 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state tlen = 0; } +LBL_UNLOCK: #ifdef LTC_CLEAN_STACK zeromem(tmp, sizeof(tmp)); #endif -LBL_UNLOCK: LTC_MUTEX_UNLOCK(&prng->lock); return tlen; } @@ -313,10 +313,10 @@ int fortuna_done(prng_state *prng) /* call cipher done when we invent one ;-) */ err = CRYPT_OK; /* success */ +LBL_UNLOCK: #ifdef LTC_CLEAN_STACK zeromem(tmp, sizeof(tmp)); #endif -LBL_UNLOCK: LTC_MUTEX_UNLOCK(&prng->lock); return err; } From 6417f96ea9de2c8ab62e321ed651a7ccbd62ba0a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 29 Apr 2017 14:12:36 +0200 Subject: [PATCH 0684/1192] fortuna - import does not fail when input data are larger than export_size --- src/prngs/fortuna.c | 2 +- testprof/cipher_hash_test.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index 72e8c933d..15f3c4c5a 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -408,7 +408,7 @@ int fortuna_import(const unsigned char *in, unsigned long inlen, prng_state *prn LTC_ARGCHK(in != NULL); LTC_ARGCHK(prng != NULL); - if (inlen != (unsigned long)fortuna_desc.export_size) { + if (inlen < (unsigned long)fortuna_desc.export_size) { return CRYPT_INVALID_ARG; } diff --git a/testprof/cipher_hash_test.c b/testprof/cipher_hash_test.c index 7f9f96883..abb2648fa 100644 --- a/testprof/cipher_hash_test.c +++ b/testprof/cipher_hash_test.c @@ -50,6 +50,7 @@ int cipher_hash_test(void) DOX(prng_descriptor[x].pexport(buf, &n, &nprng), prng_descriptor[x].name); prng_descriptor[x].done(&nprng); DOX(prng_descriptor[x].pimport(buf, n, &nprng), prng_descriptor[x].name); + DOX(prng_descriptor[x].pimport(buf, 4096, &nprng), prng_descriptor[x].name); /* try to import larger data */ DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); if (prng_descriptor[x].read(buf, 100, &nprng) != 100) { fprintf(stderr, "Error reading from imported PRNG (%s)!\n", prng_descriptor[x].name); From 7e72dafe5fbdea8175d86904e75a02bc279fff1a Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sat, 29 Apr 2017 17:52:27 +0200 Subject: [PATCH 0685/1192] remove useless semicolon the macro LTC_MUTEX_TYPE already contains a semicolon see https://github.com/libtom/libtomcrypt/blob/develop/src/headers/tomcrypt_custom.h#L552 --- src/headers/tomcrypt_prng.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index b90d36b55..e06c68b8d 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -66,7 +66,7 @@ typedef struct { #endif }; short ready; /* ready flag 0-1 */ - LTC_MUTEX_TYPE(lock); /* lock */ + LTC_MUTEX_TYPE(lock) /* lock */ } prng_state; /** PRNG descriptor */ From 87142382dacbdb8f846c51b8f4b6d1deec33f648 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 29 Apr 2017 19:58:24 +0200 Subject: [PATCH 0686/1192] lint fixes discussed in #199 --- src/encauth/gcm/gcm_memory.c | 3 +-- src/encauth/ocb3/ocb3_add_aad.c | 2 +- src/headers/tomcrypt_cipher.h | 2 +- src/pk/dsa/dsa_decrypt_key.c | 3 ++- src/pk/dsa/dsa_verify_hash.c | 2 +- src/pk/pkcs1/pkcs_1_oaep_decode.c | 1 - src/pk/rsa/rsa_import_x509.c | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/encauth/gcm/gcm_memory.c b/src/encauth/gcm/gcm_memory.c index f85899282..05d471bac 100644 --- a/src/encauth/gcm/gcm_memory.c +++ b/src/encauth/gcm/gcm_memory.c @@ -52,8 +52,7 @@ int gcm_memory( int cipher, } if (cipher_descriptor[cipher].accel_gcm_memory != NULL) { - return - cipher_descriptor[cipher].accel_gcm_memory + return cipher_descriptor[cipher].accel_gcm_memory (key, keylen, IV, IVlen, adata, adatalen, diff --git a/src/encauth/ocb3/ocb3_add_aad.c b/src/encauth/ocb3/ocb3_add_aad.c index 460867051..88f4d08e9 100644 --- a/src/encauth/ocb3/ocb3_add_aad.c +++ b/src/encauth/ocb3/ocb3_add_aad.c @@ -54,7 +54,7 @@ int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen datalen = aadlen; } - if (datalen <= 0) return CRYPT_OK; + if (datalen == 0) return CRYPT_OK; full_blocks = datalen/ocb->block_len; full_blocks_len = full_blocks * ocb->block_len; diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index fc5b65223..58f02db4d 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -962,7 +962,7 @@ int chacha_test(void); #ifdef LTC_RC4_STREAM typedef struct { - int x, y; + unsigned int x, y; unsigned char buf[256]; } rc4_state; diff --git a/src/pk/dsa/dsa_decrypt_key.c b/src/pk/dsa/dsa_decrypt_key.c index f971e6e0e..25a9db01b 100644 --- a/src/pk/dsa/dsa_decrypt_key.c +++ b/src/pk/dsa/dsa_decrypt_key.c @@ -92,7 +92,8 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, goto LBL_ERR; } - y = MIN(mp_unsigned_bin_size(key->p) + 1, MAXBLOCKSIZE); + y = mp_unsigned_bin_size(key->p) + 1; + y = MIN(y, MAXBLOCKSIZE); if ((err = hash_memory(hash, expt, x, expt, &y)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index d2473915c..7df472c04 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -102,7 +102,7 @@ int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, void *r, *s; if ((err = mp_init_multi(&r, &s, NULL)) != CRYPT_OK) { - return CRYPT_MEM; + return err; } /* decode the sequence */ diff --git a/src/pk/pkcs1/pkcs_1_oaep_decode.c b/src/pk/pkcs1/pkcs_1_oaep_decode.c index 587749849..469e3e114 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -160,7 +160,6 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, /* copy message */ *outlen = modulus_len - hLen - 1 - x; XMEMCPY(out, DB + x, modulus_len - hLen - 1 - x); - x += modulus_len - hLen - 1; /* valid packet */ *res = 1; diff --git a/src/pk/rsa/rsa_import_x509.c b/src/pk/rsa/rsa_import_x509.c index cf4a19ffc..45da7c75c 100644 --- a/src/pk/rsa/rsa_import_x509.c +++ b/src/pk/rsa/rsa_import_x509.c @@ -27,7 +27,7 @@ int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key) { int err; - unsigned char *tmpbuf=NULL; + unsigned char *tmpbuf; unsigned long tmpbuf_len, tmp_inlen; ltc_asn1_list *decoded_list = NULL, *l; From 2858373e2e096be235840db42293a4d397a49f4b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 1 May 2017 12:25:18 +0200 Subject: [PATCH 0687/1192] clean stack properly --- src/hashes/chc/chc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index 31e63e619..bff4d80af 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -147,11 +147,11 @@ static int chc_compress(hash_state *md, unsigned char *buf) for (x = 0; x < cipher_blocksize; x++) { md->chc.state[x] ^= T[0][x] ^ T[1][x]; } - XFREE(key); #ifdef LTC_CLEAN_STACK zeromem(T, sizeof(T)); - zeromem(&key, sizeof(key)); + zeromem(key, sizeof(*key)); #endif + XFREE(key); return CRYPT_OK; } From a52b586ed2be0cdd9e359fbd4797d00af81c1ae4 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 30 Apr 2017 10:32:35 +0200 Subject: [PATCH 0688/1192] Unusual use of a Boolean expression --- src/hashes/blake2b.c | 2 +- src/hashes/blake2s.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index e41906a93..b01f63eb8 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -169,7 +169,7 @@ static void blake2b_set_lastblock(hash_state *md) static void blake2b_increment_counter(hash_state *md, ulong64 inc) { md->blake2b.t[0] += inc; - md->blake2b.t[1] += (md->blake2b.t[0] < inc); + if (md->blake2b.t[0] < inc) md->blake2b.t[1]++; } static void blake2b_init0(hash_state *md) diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index eb2ac2806..daa45a51c 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -161,7 +161,7 @@ static void blake2s_set_lastblock(hash_state *md) static void blake2s_increment_counter(hash_state *md, const ulong32 inc) { md->blake2s.t[0] += inc; - md->blake2s.t[1] += (md->blake2s.t[0] < inc); + if (md->blake2s.t[0] < inc) md->blake2s.t[1]++; } static int blake2s_init0(hash_state *md) From aa4bae5ae9a278776b27fe817a988702ab0e9e3f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 1 Mar 2017 17:51:04 +0100 Subject: [PATCH 0689/1192] add option to do PKCS#1 v1.5 EMSA without ASN.1 around hash Somehow someone forgot to add the OID in the signature field of a SERVER_KEY_EXCHANGE message in early versions of the SSL protocol. Therefore provide an option to be able to sign/verify a message in that format. --- src/headers/tomcrypt_pkcs.h | 3 +- src/pk/rsa/rsa_sign_hash.c | 76 +++++++++++++++++++------------- src/pk/rsa/rsa_verify_hash.c | 85 ++++++++++++++++++++---------------- 3 files changed, 95 insertions(+), 69 deletions(-) diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index dae34902f..afa3c3830 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -13,7 +13,8 @@ enum ltc_pkcs_1_paddings { LTC_PKCS_1_V1_5 = 1, /* PKCS #1 v1.5 padding (\sa ltc_pkcs_1_v1_5_blocks) */ LTC_PKCS_1_OAEP = 2, /* PKCS #1 v2.0 encryption padding */ - LTC_PKCS_1_PSS = 3 /* PKCS #1 v2.1 signature padding */ + LTC_PKCS_1_PSS = 3, /* PKCS #1 v2.1 signature padding */ + LTC_PKCS_1_V1_5_NA1 = 4 /* PKCS #1 v1.5 padding - No ASN.1 (\sa ltc_pkcs_1_v1_5_blocks) */ }; int pkcs_1_mgf1( int hash_idx, diff --git a/src/pk/rsa/rsa_sign_hash.c b/src/pk/rsa/rsa_sign_hash.c index 46d5c9f36..b7baaf92e 100644 --- a/src/pk/rsa/rsa_sign_hash.c +++ b/src/pk/rsa/rsa_sign_hash.c @@ -23,7 +23,7 @@ @param inlen The length of the hash to sign (octets) @param out [out] The signature @param outlen [in/out] The max size and resulting size of the signature - @param padding Type of padding (LTC_PKCS_1_PSS or LTC_PKCS_1_V1_5) + @param padding Type of padding (LTC_PKCS_1_PSS, LTC_PKCS_1_V1_5 or LTC_PKCS_1_V1_5_NA1) @param prng An active PRNG state @param prng_idx The index of the PRNG desired @param hash_idx The index of the hash desired @@ -47,15 +47,21 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, LTC_ARGCHK(key != NULL); /* valid padding? */ - if ((padding != LTC_PKCS_1_V1_5) && (padding != LTC_PKCS_1_PSS)) { + if ((padding != LTC_PKCS_1_V1_5) && + (padding != LTC_PKCS_1_PSS) && + (padding != LTC_PKCS_1_V1_5_NA1)) { return CRYPT_PK_INVALID_PADDING; } if (padding == LTC_PKCS_1_PSS) { - /* valid prng and hash ? */ + /* valid prng ? */ if ((err = prng_is_valid(prng_idx)) != CRYPT_OK) { return err; } + } + + if (padding != LTC_PKCS_1_V1_5_NA1) { + /* valid hash ? */ if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; } @@ -81,46 +87,54 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, } else { /* PKCS #1 v1.5 pad the hash */ unsigned char *tmpin; - ltc_asn1_list digestinfo[2], siginfo[2]; - /* not all hashes have OIDs... so sad */ - if (hash_descriptor[hash_idx].OIDlen == 0) { - return CRYPT_INVALID_ARG; - } + if (padding == LTC_PKCS_1_V1_5) { + ltc_asn1_list digestinfo[2], siginfo[2]; + /* not all hashes have OIDs... so sad */ + if (hash_descriptor[hash_idx].OIDlen == 0) { + return CRYPT_INVALID_ARG; + } /* construct the SEQUENCE - SEQUENCE { - SEQUENCE {hashoid OID - blah NULL - } + SEQUENCE { + SEQUENCE {hashoid OID + blah NULL + } hash OCTET STRING + } + */ + LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, hash_descriptor[hash_idx].OID, hash_descriptor[hash_idx].OIDlen); + LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); + LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); + LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, in, inlen); + + /* allocate memory for the encoding */ + y = mp_unsigned_bin_size(key->N); + tmpin = XMALLOC(y); + if (tmpin == NULL) { + return CRYPT_MEM; } - */ - LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, hash_descriptor[hash_idx].OID, hash_descriptor[hash_idx].OIDlen); - LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); - LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); - LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, in, inlen); - - /* allocate memory for the encoding */ - y = mp_unsigned_bin_size(key->N); - tmpin = XMALLOC(y); - if (tmpin == NULL) { - return CRYPT_MEM; - } - if ((err = der_encode_sequence(siginfo, 2, tmpin, &y)) != CRYPT_OK) { - XFREE(tmpin); - return err; + if ((err = der_encode_sequence(siginfo, 2, tmpin, &y)) != CRYPT_OK) { + XFREE(tmpin); + return err; + } + } else { + /* set the pointer and data-length to the input values */ + tmpin = (unsigned char *)in; + y = inlen; } x = *outlen; - if ((err = pkcs_1_v1_5_encode(tmpin, y, LTC_PKCS_1_EMSA, - modulus_bitlen, NULL, 0, - out, &x)) != CRYPT_OK) { + err = pkcs_1_v1_5_encode(tmpin, y, LTC_PKCS_1_EMSA, modulus_bitlen, NULL, 0, out, &x); + + if (padding == LTC_PKCS_1_V1_5) { XFREE(tmpin); + } + + if (err != CRYPT_OK) { return err; } - XFREE(tmpin); } /* RSA encode it */ diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 9a425cdbd..c6529f9b0 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -23,7 +23,7 @@ @param siglen The length of the signature data (octets) @param hash The hash of the message that was signed @param hashlen The length of the hash of the message that was signed (octets) - @param padding Type of padding (LTC_PKCS_1_PSS or LTC_PKCS_1_V1_5) + @param padding Type of padding (LTC_PKCS_1_PSS, LTC_PKCS_1_V1_5 or LTC_PKCS_1_V1_5_NA1) @param hash_idx The index of the desired hash @param saltlen The length of the salt used during signature @param stat [out] The result of the signature comparison, 1==valid, 0==invalid @@ -51,11 +51,12 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, /* valid padding? */ if ((padding != LTC_PKCS_1_V1_5) && - (padding != LTC_PKCS_1_PSS)) { + (padding != LTC_PKCS_1_PSS) && + (padding != LTC_PKCS_1_V1_5_NA1)) { return CRYPT_PK_INVALID_PADDING; } - if (padding == LTC_PKCS_1_PSS) { + if (padding != LTC_PKCS_1_V1_5_NA1) { /* valid hash ? */ if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { return err; @@ -103,15 +104,8 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, } else { /* PKCS #1 v1.5 decode it */ unsigned char *out; - unsigned long outlen, loid[16], reallen; + unsigned long outlen; int decoded; - ltc_asn1_list digestinfo[2], siginfo[2]; - - /* not all hashes have OIDs... so sad */ - if (hash_descriptor[hash_idx].OIDlen == 0) { - err = CRYPT_INVALID_ARG; - goto bail_2; - } /* allocate temp buffer for decoded hash */ outlen = ((modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0)) - 3; @@ -126,37 +120,54 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, goto bail_2; } - /* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */ - /* construct the SEQUENCE - SEQUENCE { - SEQUENCE {hashoid OID - blah NULL - } - hash OCTET STRING + if (padding == LTC_PKCS_1_V1_5) { + unsigned long loid[16], reallen; + ltc_asn1_list digestinfo[2], siginfo[2]; + + /* not all hashes have OIDs... so sad */ + if (hash_descriptor[hash_idx].OIDlen == 0) { + err = CRYPT_INVALID_ARG; + goto bail_2; } - */ - LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, loid, sizeof(loid)/sizeof(loid[0])); - LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); - LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); - LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); - - if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { - XFREE(out); - goto bail_2; - } - if ((err = der_length_sequence(siginfo, 2, &reallen)) != CRYPT_OK) { - XFREE(out); - goto bail_2; - } + /* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */ + /* construct the SEQUENCE + SEQUENCE { + SEQUENCE {hashoid OID + blah NULL + } + hash OCTET STRING + } + */ + LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, loid, sizeof(loid)/sizeof(loid[0])); + LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); + LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); + LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); + + if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { + XFREE(out); + goto bail_2; + } + + if ((err = der_length_sequence(siginfo, 2, &reallen)) != CRYPT_OK) { + XFREE(out); + goto bail_2; + } - /* test OID */ - if ((reallen == outlen) && - (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && + /* test OID */ + if ((reallen == outlen) && + (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && (XMEM_NEQ(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && - (siginfo[1].size == hashlen) && + (siginfo[1].size == hashlen) && (XMEM_NEQ(siginfo[1].data, hash, hashlen) == 0)) { - *stat = 1; + *stat = 1; + } + } else { + /* only check if the hash is equal */ + if ((hashlen == outlen) && + (XMEMCMP(out, hash, hashlen) == 0)) { + *stat = 1; + } } #ifdef LTC_CLEAN_STACK From f00f8572244ae0bbc40e4db552ad73e1afa819c3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 14 Mar 2017 16:33:24 +0100 Subject: [PATCH 0690/1192] tests for rsa_sign|verify with LTC_PKCS_1_V1_5_NA1 --- testprof/rsa_test.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 55db8423e..94bce206b 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -109,17 +109,48 @@ static const unsigned char openssl_public_rsa_stripped[] = { 0x60, 0x3f, 0x8b, 0x54, 0x3a, 0xc3, 0x4d, 0x31, 0xe7, 0x94, 0xa4, 0x44, 0xfd, 0x02, 0x03, 0x01, 0x00, 0x01, }; + +/* generated with the private key above as: + echo -n 'test' | openssl rsautl -sign -inkey rsa_private.pem -pkcs -hexdump + */ +static const unsigned char openssl_rsautl_pkcs[] = { + 0x24, 0xef, 0x54, 0xea, 0x1a, 0x12, 0x0c, 0xf4, 0x04, 0x0c, 0x48, 0xc8, 0xe8, 0x17, 0xd2, 0x6f, + 0xc3, 0x41, 0xb3, 0x97, 0x5c, 0xbc, 0xa3, 0x2d, 0x21, 0x00, 0x10, 0x0e, 0xbb, 0xf7, 0x30, 0x21, + 0x7e, 0x12, 0xd2, 0xdf, 0x26, 0x28, 0xd8, 0x0f, 0x6d, 0x4d, 0xc8, 0x4d, 0xa8, 0x78, 0xe7, 0x03, + 0xee, 0xbc, 0x68, 0xba, 0x98, 0xea, 0xe9, 0xb6, 0x06, 0x8d, 0x85, 0x5b, 0xdb, 0xa6, 0x49, 0x86, + 0x6f, 0xc7, 0x3d, 0xe0, 0x53, 0x83, 0xe0, 0xea, 0xb1, 0x08, 0x6a, 0x7b, 0xbd, 0xeb, 0xb5, 0x4a, + 0xdd, 0xbc, 0x64, 0x97, 0x8c, 0x17, 0x20, 0xa3, 0x5c, 0xd4, 0xb8, 0x87, 0x43, 0xc5, 0x13, 0xad, + 0x41, 0x6e, 0x45, 0x41, 0x32, 0xd4, 0x09, 0x12, 0x7f, 0xdc, 0x59, 0x1f, 0x28, 0x3f, 0x1e, 0xbc, + 0xef, 0x57, 0x23, 0x4b, 0x3a, 0xa3, 0x24, 0x91, 0x4d, 0xfb, 0xb2, 0xd4, 0xe7, 0x5e, 0x41, 0x7e, +}; + extern const unsigned char _der_tests_cacert_root_cert[]; extern const unsigned long _der_tests_cacert_root_cert_size; static int rsa_compat_test(void) { - rsa_key key; + rsa_key key, pubkey; + int stat; unsigned char buf[1024]; unsigned long len; /* try reading the key */ DO(rsa_import(openssl_private_rsa, sizeof(openssl_private_rsa), &key)); + DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &pubkey)); + + /* sign-verify a message with PKCS #1 v1.5 no ASN.1 */ + len = sizeof(buf); + DO(rsa_sign_hash_ex((unsigned char*)"test", 4, buf, &len, LTC_PKCS_1_V1_5_NA1, NULL, 0, 0, 0, &key)); + if (len != sizeof(openssl_rsautl_pkcs) || memcmp(buf, openssl_rsautl_pkcs, len)) { + fprintf(stderr, "RSA rsa_sign_hash_ex + LTC_PKCS_1_V1_5_NA1 failed\n"); + return 1; + } + stat = 0; + DO(rsa_verify_hash_ex(openssl_rsautl_pkcs, sizeof(openssl_rsautl_pkcs), (unsigned char*)"test", 4, LTC_PKCS_1_V1_5_NA1, 0, 0, &stat, &pubkey)); + if (stat != 1) { + fprintf(stderr, "RSA rsa_verify_hash_ex + LTC_PKCS_1_V1_5_NA1 failed\n"); + return 1; + } /* now try to export private/public and compare */ len = sizeof(buf); From 67ca1c0b9a6376c4728c19b975ac7169038400db Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 3 May 2017 12:37:24 +0200 Subject: [PATCH 0691/1192] fix for compilation with LTC_DEBUG --- src/mac/blake2/blake2bmac_test.c | 4 ++-- src/mac/blake2/blake2smac_test.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mac/blake2/blake2bmac_test.c b/src/mac/blake2/blake2bmac_test.c index aea94e52f..37f2ca7d8 100644 --- a/src/mac/blake2/blake2bmac_test.c +++ b/src/mac/blake2/blake2bmac_test.c @@ -295,13 +295,13 @@ int blake2bmac_test(void) blake2bmac_process(&st, (unsigned char*)inp + 14, 1); blake2bmac_process(&st, (unsigned char*)inp + 15, ilen - 15); blake2bmac_done(&st, out, &olen); - if (compare_testvector(out, olen, mac, mlen, "BLAKE2B MAC multi", i) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, olen, mac, mlen, "BLAKE2B MAC multi", ilen) != 0) return CRYPT_FAIL_TESTVECTOR; } /* process in one go */ blake2bmac_init(&st, olen, key, klen); blake2bmac_process(&st, (unsigned char*)inp, ilen); blake2bmac_done(&st, out, &olen); - if (compare_testvector(out, olen, mac, mlen, "BLAKE2B MAC single", i) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, olen, mac, mlen, "BLAKE2B MAC single", ilen) != 0) return CRYPT_FAIL_TESTVECTOR; } return CRYPT_OK; #endif diff --git a/src/mac/blake2/blake2smac_test.c b/src/mac/blake2/blake2smac_test.c index bacb0923f..fe8b267a9 100644 --- a/src/mac/blake2/blake2smac_test.c +++ b/src/mac/blake2/blake2smac_test.c @@ -295,13 +295,13 @@ int blake2smac_test(void) blake2smac_process(&st, (unsigned char*)inp + 14, 1); blake2smac_process(&st, (unsigned char*)inp + 15, ilen - 15); blake2smac_done(&st, out, &olen); - if (compare_testvector(out, olen, mac, mlen, "BLAKE2S MAC multi", i) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, olen, mac, mlen, "BLAKE2S MAC multi", ilen) != 0) return CRYPT_FAIL_TESTVECTOR; } /* process in one go */ blake2smac_init(&st, olen, key, klen); blake2smac_process(&st, (unsigned char*)inp, ilen); blake2smac_done(&st, out, &olen); - if (compare_testvector(out, olen, mac, mlen, "BLAKE2S MAC single", i) != 0) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(out, olen, mac, mlen, "BLAKE2S MAC single", ilen) != 0) return CRYPT_FAIL_TESTVECTOR; } return CRYPT_OK; #endif From e5c0e7ffd314ac70669e795281c2e0ed5064a3b6 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 1 May 2017 21:54:32 +0200 Subject: [PATCH 0692/1192] SHAKE (SHA3 related) big endian fix --- src/hashes/sha3.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index a52971606..7c0dfb7c7 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -268,6 +268,17 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) md->sha3.s[md->sha3.word_index] ^= (md->sha3.saved ^ (CONST64(0x1F) << (md->sha3.byte_index * 8))); md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); keccakf(md->sha3.s); +#ifndef ENDIAN_LITTLE + { + unsigned i; + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); + const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); + STORE32L(t1, md->sha3.sb + i * 8); + STORE32L(t2, md->sha3.sb + i * 8 + 4); + } + } +#endif md->sha3.byte_index = 0; md->sha3.xof_flag = 1; } From df4e47978ed3d996f336cbe79d2440dbe9958769 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 07:05:23 +0200 Subject: [PATCH 0693/1192] =?UTF-8?q?declaration=20of=20=E2=80=98i?= =?UTF-8?q?=E2=80=99=20shadows=20a=20previous=20local?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hashes/sha3.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index 7c0dfb7c7..27e7afb70 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -269,14 +269,11 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); keccakf(md->sha3.s); #ifndef ENDIAN_LITTLE - { - unsigned i; - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { - const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); - const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); - STORE32L(t1, md->sha3.sb + i * 8); - STORE32L(t2, md->sha3.sb + i * 8 + 4); - } + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); + const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); + STORE32L(t1, md->sha3.sb + i * 8); + STORE32L(t2, md->sha3.sb + i * 8 + 4); } #endif md->sha3.byte_index = 0; From c3f2e4530a63387816094e3587c4c6c0073c14b4 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 07:10:52 +0200 Subject: [PATCH 0694/1192] =?UTF-8?q?declaration=20of=20=E2=80=98i?= =?UTF-8?q?=E2=80=99=20shadows=20a=20previous=20local=20(better)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hashes/sha3.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index 27e7afb70..646ac16e2 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -256,7 +256,7 @@ int sha3_done(hash_state *md, unsigned char *hash) int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) { - unsigned long i = 0; + unsigned long idx = 0; /* sha3_shake_done can be called many times */ if (outlen == 0) return CRYPT_OK; /* nothing to do */ @@ -269,23 +269,26 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); keccakf(md->sha3.s); #ifndef ENDIAN_LITTLE - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { - const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); - const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); - STORE32L(t1, md->sha3.sb + i * 8); - STORE32L(t2, md->sha3.sb + i * 8 + 4); + { + unsigned i; + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); + const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); + STORE32L(t1, md->sha3.sb + i * 8); + STORE32L(t2, md->sha3.sb + i * 8 + 4); + } } #endif md->sha3.byte_index = 0; md->sha3.xof_flag = 1; } - while (i < outlen) { + while (idx < outlen) { if(md->sha3.byte_index >= (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words) * 8) { keccakf(md->sha3.s); md->sha3.byte_index = 0; } - out[i++] = md->sha3.sb[md->sha3.byte_index++]; + out[idx++] = md->sha3.sb[md->sha3.byte_index++]; } return CRYPT_OK; } From da8501f55a18e5a71a653481b4f79794147e78e3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 09:33:35 +0200 Subject: [PATCH 0695/1192] sha3_shake_done another be fix --- src/hashes/sha3.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index 646ac16e2..5e706919f 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -256,8 +256,11 @@ int sha3_done(hash_state *md, unsigned char *hash) int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) { - unsigned long idx = 0; - /* sha3_shake_done can be called many times */ + /* IMPORTANT NOTE: sha3_shake_done can be called many times */ + unsigned long idx; +#ifndef ENDIAN_LITTLE + unsigned i; +#endif if (outlen == 0) return CRYPT_OK; /* nothing to do */ LTC_ARGCHK(md != NULL); @@ -270,7 +273,6 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) keccakf(md->sha3.s); #ifndef ENDIAN_LITTLE { - unsigned i; for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); @@ -283,12 +285,22 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) md->sha3.xof_flag = 1; } - while (idx < outlen) { + for (idx = 0; idx < outlen; idx++) { if(md->sha3.byte_index >= (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words) * 8) { keccakf(md->sha3.s); +#ifndef ENDIAN_LITTLE + { + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); + const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); + STORE32L(t1, md->sha3.sb + i * 8); + STORE32L(t2, md->sha3.sb + i * 8 + 4); + } + } +#endif md->sha3.byte_index = 0; } - out[idx++] = md->sha3.sb[md->sha3.byte_index++]; + out[idx] = md->sha3.sb[md->sha3.byte_index++]; } return CRYPT_OK; } From 961b6109d5aab7333f0d745f2fdfed4ba8d795f4 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 09:35:28 +0200 Subject: [PATCH 0696/1192] cosmetics --- src/hashes/sha3.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index 5e706919f..210717601 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -272,13 +272,11 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); keccakf(md->sha3.s); #ifndef ENDIAN_LITTLE - { - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { - const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); - const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); - STORE32L(t1, md->sha3.sb + i * 8); - STORE32L(t2, md->sha3.sb + i * 8 + 4); - } + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); + const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); + STORE32L(t1, md->sha3.sb + i * 8); + STORE32L(t2, md->sha3.sb + i * 8 + 4); } #endif md->sha3.byte_index = 0; @@ -289,13 +287,11 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) if(md->sha3.byte_index >= (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words) * 8) { keccakf(md->sha3.s); #ifndef ENDIAN_LITTLE - { - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { - const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); - const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); - STORE32L(t1, md->sha3.sb + i * 8); - STORE32L(t2, md->sha3.sb + i * 8 + 4); - } + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); + const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); + STORE32L(t1, md->sha3.sb + i * 8); + STORE32L(t2, md->sha3.sb + i * 8 + 4); } #endif md->sha3.byte_index = 0; From a1615daa3cc78f43cf72b7c397115f258ba32efd Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 17:33:29 +0200 Subject: [PATCH 0697/1192] shake be fix (hopefully final) --- src/hashes/sha3.c | 37 ++++++++----------------------------- src/headers/tomcrypt_hash.h | 3 ++- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index 210717601..68dea0b24 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -231,6 +231,8 @@ int sha3_process(hash_state *md, const unsigned char *in, unsigned long inlen) int sha3_done(hash_state *md, unsigned char *hash) { + unsigned i; + LTC_ARGCHK(md != NULL); LTC_ARGCHK(hash != NULL); @@ -238,17 +240,8 @@ int sha3_done(hash_state *md, unsigned char *hash) md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); keccakf(md->sha3.s); -#ifndef ENDIAN_LITTLE - { - unsigned i; - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { - const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); - const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); - STORE32L(t1, md->sha3.sb + i * 8); - STORE32L(t2, md->sha3.sb + i * 8 + 4); - } - } -#endif + /* store sha3.s[] as little-endian bytes into sha3.sb */ + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); XMEMCPY(hash, md->sha3.sb, md->sha3.capacity_words * 4); return CRYPT_OK; @@ -258,9 +251,7 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) { /* IMPORTANT NOTE: sha3_shake_done can be called many times */ unsigned long idx; -#ifndef ENDIAN_LITTLE unsigned i; -#endif if (outlen == 0) return CRYPT_OK; /* nothing to do */ LTC_ARGCHK(md != NULL); @@ -271,14 +262,8 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) md->sha3.s[md->sha3.word_index] ^= (md->sha3.saved ^ (CONST64(0x1F) << (md->sha3.byte_index * 8))); md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); keccakf(md->sha3.s); -#ifndef ENDIAN_LITTLE - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { - const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); - const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); - STORE32L(t1, md->sha3.sb + i * 8); - STORE32L(t2, md->sha3.sb + i * 8 + 4); - } -#endif + /* store sha3.s[] as little-endian bytes into sha3.sb */ + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); md->sha3.byte_index = 0; md->sha3.xof_flag = 1; } @@ -286,14 +271,8 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) for (idx = 0; idx < outlen; idx++) { if(md->sha3.byte_index >= (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words) * 8) { keccakf(md->sha3.s); -#ifndef ENDIAN_LITTLE - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { - const ulong32 t1 = (ulong32)(md->sha3.s[i] & CONST64(0xFFFFFFFF)); - const ulong32 t2 = (ulong32)(md->sha3.s[i] >> 32); - STORE32L(t1, md->sha3.sb + i * 8); - STORE32L(t2, md->sha3.sb + i * 8 + 4); - } -#endif + /* store sha3.s[] as little-endian bytes into sha3.sb */ + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); md->sha3.byte_index = 0; } out[idx] = md->sha3.sb[md->sha3.byte_index++]; diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index a07cbc80c..c73d387a9 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -2,7 +2,8 @@ #ifdef LTC_SHA3 struct sha3_state { ulong64 saved; /* the portion of the input message that we didn't consume yet */ - union { ulong64 s[25]; unsigned char sb[25 * 8]; }; + ulong64 s[25]; + unsigned char sb[25 * 8]; /* used for storing `ulong64 s[25]` as little-endian bytes */ unsigned short byte_index; /* 0..7--the next byte after the set one (starts from 0; 0--none are buffered) */ unsigned short word_index; /* 0..24--the next word to integrate input (starts from 0) */ unsigned short capacity_words; /* the double size of the hash output in words (e.g. 16 for Keccak 512) */ From f831e27702459e2d6949b178b12f9e5f780ce3e8 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 3 May 2017 12:51:33 +0200 Subject: [PATCH 0698/1192] more readable for loops --- src/hashes/sha3.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index 68dea0b24..d5b682f94 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -263,7 +263,9 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) md->sha3.s[SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words - 1] ^= CONST64(0x8000000000000000); keccakf(md->sha3.s); /* store sha3.s[] as little-endian bytes into sha3.sb */ - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); + } md->sha3.byte_index = 0; md->sha3.xof_flag = 1; } @@ -272,7 +274,9 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen) if(md->sha3.byte_index >= (SHA3_KECCAK_SPONGE_WORDS - md->sha3.capacity_words) * 8) { keccakf(md->sha3.s); /* store sha3.s[] as little-endian bytes into sha3.sb */ - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); + } md->sha3.byte_index = 0; } out[idx] = md->sha3.sb[md->sha3.byte_index++]; From 4e66160ac21b351e31c46acf3ac90b20fe40a134 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 3 May 2017 17:01:18 +0200 Subject: [PATCH 0699/1192] one more readable for loop --- src/hashes/sha3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index d5b682f94..35c492592 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -241,7 +241,9 @@ int sha3_done(hash_state *md, unsigned char *hash) keccakf(md->sha3.s); /* store sha3.s[] as little-endian bytes into sha3.sb */ - for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); + for(i = 0; i < SHA3_KECCAK_SPONGE_WORDS; i++) { + STORE64L(md->sha3.s[i], md->sha3.sb + i * 8); + } XMEMCPY(hash, md->sha3.sb, md->sha3.capacity_words * 4); return CRYPT_OK; From d02531d4d299060f4eb3cd71aa45bdf6a5c2f604 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 1 May 2017 14:10:24 +0200 Subject: [PATCH 0700/1192] improve hashsum a bit --- demos/hashsum.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 5625329c0..ec901a036 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -9,6 +9,12 @@ #include +#if _POSIX_C_SOURCE >= 200112L +#include +#else +#define basename(x) x +#endif + int errno; void register_algs(void); @@ -22,24 +28,31 @@ int main(int argc, char **argv) /* You need to register algorithms before using them */ register_algs(); if (argc < 2) { - printf("usage: ./hash algorithm file [file ...]\n"); + printf("usage: %s algorithm file [file ...]\n", basename(argv[0])); printf("Algorithms:\n"); + w = 0; for (x = 0; hash_descriptor[x].name != NULL; x++) { - printf(" %s (%d)\n", hash_descriptor[x].name, hash_descriptor[x].ID); + w += printf("%-14s", hash_descriptor[x].name); + if (w >= 70) { + printf("\n"); + w = 0; + } } + printf("\n"); exit(EXIT_SUCCESS); } idx = find_hash(argv[1]); if (idx == -1) { fprintf(stderr, "\nInvalid hash specified on command line.\n"); - return -1; + return EXIT_FAILURE; } if (argc == 2) { w = sizeof(hash_buffer); if ((errno = hash_filehandle(idx, stdin, hash_buffer, &w)) != CRYPT_OK) { - printf("File hash error: %s\n", error_to_string(errno)); + fprintf(stderr, "File hash error: %s\n", error_to_string(errno)); + return EXIT_FAILURE; } else { for (x = 0; x < w; x++) { printf("%02x",hash_buffer[x]); @@ -50,7 +63,8 @@ int main(int argc, char **argv) for (z = 2; z < argc; z++) { w = sizeof(hash_buffer); if ((errno = hash_file(idx,argv[z],hash_buffer,&w)) != CRYPT_OK) { - printf("File hash error: %s\n", error_to_string(errno)); + fprintf(stderr, "File hash error: %s\n", error_to_string(errno)); + return EXIT_FAILURE; } else { for (x = 0; x < w; x++) { printf("%02x",hash_buffer[x]); From 31dcb9ff2a94a245ae96878c5de3512962ffa91c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 1 May 2017 21:42:12 +0200 Subject: [PATCH 0701/1192] only set outlen on success --- src/hashes/helper/hash_filehandle.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hashes/helper/hash_filehandle.c b/src/hashes/helper/hash_filehandle.c index e1d037e82..f1f29c086 100644 --- a/src/hashes/helper/hash_filehandle.c +++ b/src/hashes/helper/hash_filehandle.c @@ -52,14 +52,15 @@ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outle goto LBL_ERR; } - *outlen = hash_descriptor[hash].hashsize; do { x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = hash_descriptor[hash].process(&md, buf, (unsigned long)x)) != CRYPT_OK) { goto LBL_CLEANBUF; } } while (x == LTC_FILE_READ_BUFSIZE); - err = hash_descriptor[hash].done(&md, out); + if ((err = hash_descriptor[hash].done(&md, out)) == CRYPT_OK) { + *outlen = hash_descriptor[hash].hashsize; + } LBL_CLEANBUF: zeromem(buf, LTC_FILE_READ_BUFSIZE); From ea7115dc6588b6a3e6d0f2237fe3b9a0e03bd6ee Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 1 May 2017 21:51:38 +0200 Subject: [PATCH 0702/1192] implement file checking --- demos/hashsum.c | 200 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 172 insertions(+), 28 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index ec901a036..713c68303 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -15,43 +15,189 @@ #define basename(x) x #endif -int errno; +/* thanks http://stackoverflow.com/a/8198009 */ +#define _base(x) ((x >= '0' && x <= '9') ? '0' : \ + (x >= 'a' && x <= 'f') ? 'a' - 10 : \ + (x >= 'A' && x <= 'F') ? 'A' - 10 : \ + '\255') +#define HEXOF(x) (x - _base(x)) -void register_algs(void); +static void register_algs(void); + +static char* hashsum; + +static void die(int status) +{ + unsigned long w, x; + FILE* o = status == EXIT_SUCCESS ? stdout : stderr; + fprintf(o, "usage: %s -a algorithm [-c] [file...]\n", hashsum); + fprintf(o, "Algorithms:\n"); + w = 0; + for (x = 0; hash_descriptor[x].name != NULL; x++) { + w += fprintf(o, "%-14s", hash_descriptor[x].name); + if (w >= 70) { + fprintf(o, "\n"); + w = 0; + } + } + if (w != 0) fprintf(o, "\n"); + free(hashsum); + exit(status); +} + +static void printf_hex(unsigned char* hash_buffer, unsigned long w) +{ + unsigned long x; + for (x = 0; x < w; x++) { + printf("%02x",hash_buffer[x]); + } +} + +static void check_file(int argn, int argc, char **argv) +{ + int err, failed, invalid; + unsigned char is_buffer[MAXBLOCKSIZE], should_buffer[MAXBLOCKSIZE]; + char buf[PATH_MAX + (MAXBLOCKSIZE * 3)]; + /* iterate through all files */ + while(argn < argc) { + char* s; + FILE* f = fopen(argv[argn], "rb"); + if(f == NULL) { + int n = snprintf(buf, sizeof(buf), "%s: %s", hashsum, argv[argn]); + if (n > 0 && n < (int)sizeof(buf)) + perror(buf); + else + perror(argv[argn]); + exit(EXIT_FAILURE); + } + failed = 0; + invalid = 0; + /* read the file line by line */ + while((s = fgets(buf, sizeof(buf), f)) != NULL) + { + int tries, n; + unsigned long hash_len, w, x; + char* space = strstr(s, " "); + if (space == NULL) { + fprintf(stderr, "%s: no properly formatted checksum lines found\n", hashsum); + goto ERR; + } + + hash_len = space - s; + hash_len /= 2; + + /* convert the hex-string back to binary */ + for (x = 0; x < hash_len; ++x) { + should_buffer[x] = HEXOF(s[x*2]) << 4 | HEXOF(s[x*2 + 1]); + } + + space++; + if (*space != '*') { + fprintf(stderr, "%s: unsupported input mode '%c'\n", hashsum, *space); + goto ERR; + } + space++; + + for (n = 0; n < (buf + sizeof(buf)) - space; ++n) { + if(iscntrl(space[n])) { + space[n] = '\0'; + break; + } + } + + /* try all hash algorithms that have the appropriate hash size */ + tries = 0; + for (x = 0; hash_descriptor[x].name != NULL; ++x) { + if (hash_descriptor[x].hashsize == hash_len) { + tries++; + w = sizeof(is_buffer); + if ((err = hash_file(x, space, is_buffer, &w)) != CRYPT_OK) { + fprintf(stderr, "File hash error: %s: %s\n", space, error_to_string(err)); +ERR: + fclose(f); + exit(EXIT_FAILURE); + } + if(XMEMCMP(should_buffer, is_buffer, w) == 0) { + printf("%s: OK\n", space); + break; + } + } + } /* for */ + if (hash_descriptor[x].name == NULL) { + if(tries > 0) { + printf("%s: FAILED\n", space); + failed++; + } + else { + invalid++; + } + } + } /* while */ + fclose(f); + if(invalid) { + fprintf(stderr, "%s: WARNING: %d %s is improperly formatted\n", hashsum, invalid, invalid > 1?"lines":"line"); + } + if(failed) { + fprintf(stderr, "%s: WARNING: %d computed %s did NOT match\n", hashsum, failed, failed > 1?"checksums":"checksum"); + } + argn++; + } + exit(EXIT_SUCCESS); +} int main(int argc, char **argv) { - int idx, z; + int idx, check, z, err, argn; unsigned long w, x; unsigned char hash_buffer[MAXBLOCKSIZE]; + hashsum = strdup(basename(argv[0])); + /* You need to register algorithms before using them */ register_algs(); - if (argc < 2) { - printf("usage: %s algorithm file [file ...]\n", basename(argv[0])); - printf("Algorithms:\n"); - w = 0; - for (x = 0; hash_descriptor[x].name != NULL; x++) { - w += printf("%-14s", hash_descriptor[x].name); - if (w >= 70) { - printf("\n"); - w = 0; + if (argc > 1 && (strcmp("-h", argv[1]) == 0 || strcmp("--help", argv[1]) == 0)) { + die(EXIT_SUCCESS); + } + if (argc < 3) { + die(EXIT_FAILURE); + } + + argn = 1; + check = 0; + idx = -2; + + while(argn < argc){ + if(strcmp("-a", argv[argn]) == 0) { + argn++; + if(argn < argc) { + idx = find_hash(argv[argn]); + if (idx == -1) { + fprintf(stderr, "\nInvalid hash (%s) specified on command line.\n", argv[2]); + die(EXIT_FAILURE); + } + argn++; + continue; } + else { + die(EXIT_FAILURE); + } + } + if(strcmp("-c", argv[argn]) == 0) { + check = 1; + argn++; + continue; } - printf("\n"); - exit(EXIT_SUCCESS); + break; } - idx = find_hash(argv[1]); - if (idx == -1) { - fprintf(stderr, "\nInvalid hash specified on command line.\n"); - return EXIT_FAILURE; + if (check == 1) { + check_file(argn, argc, argv); } - if (argc == 2) { + if (argc == argn) { w = sizeof(hash_buffer); - if ((errno = hash_filehandle(idx, stdin, hash_buffer, &w)) != CRYPT_OK) { - fprintf(stderr, "File hash error: %s\n", error_to_string(errno)); + if ((err = hash_filehandle(idx, stdin, hash_buffer, &w)) != CRYPT_OK) { + fprintf(stderr, "File hash error: %s\n", error_to_string(err)); return EXIT_FAILURE; } else { for (x = 0; x < w; x++) { @@ -60,15 +206,13 @@ int main(int argc, char **argv) printf(" *-\n"); } } else { - for (z = 2; z < argc; z++) { + for (z = 3; z < argc; z++) { w = sizeof(hash_buffer); - if ((errno = hash_file(idx,argv[z],hash_buffer,&w)) != CRYPT_OK) { - fprintf(stderr, "File hash error: %s\n", error_to_string(errno)); + if ((err = hash_file(idx,argv[z],hash_buffer,&w)) != CRYPT_OK) { + fprintf(stderr, "File hash error: %s\n", error_to_string(err)); return EXIT_FAILURE; } else { - for (x = 0; x < w; x++) { - printf("%02x",hash_buffer[x]); - } + printf_hex(hash_buffer, w); printf(" *%s\n", argv[z]); } } @@ -76,7 +220,7 @@ int main(int argc, char **argv) return EXIT_SUCCESS; } -void register_algs(void) +static void register_algs(void) { int err; LTC_UNUSED_PARAM(err); From 9893566ae9788289dc13165f25cbf60d4a8a163a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 1 May 2017 21:58:21 +0200 Subject: [PATCH 0703/1192] add `shasum` compatibility for '-a' option --- demos/hashsum.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/demos/hashsum.c b/demos/hashsum.c index 713c68303..8d15476ce 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -171,6 +171,27 @@ int main(int argc, char **argv) argn++; if(argn < argc) { idx = find_hash(argv[argn]); + if (idx == -1) { + struct { + const char* is; + const char* should; + } shasum_compat[] = + { + { "1", sha1_desc.name }, + { "224", sha224_desc.name }, + { "256", sha256_desc.name }, + { "384", sha384_desc.name }, + { "512", sha512_desc.name }, + { "512224", sha512_224_desc.name }, + { "512256", sha512_256_desc.name }, + }; + for (x = 0; x < sizeof(shasum_compat)/sizeof(shasum_compat[0]); ++x) { + if(XSTRCMP(shasum_compat[x].is, argv[argn]) == 0) { + idx = find_hash(shasum_compat[x].should); + break; + } + } + } if (idx == -1) { fprintf(stderr, "\nInvalid hash (%s) specified on command line.\n", argv[2]); die(EXIT_FAILURE); From 28f8a85246bc646899d0555dd7b99c3f854a5300 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 May 2017 00:01:30 +0200 Subject: [PATCH 0704/1192] update coverage.sh * hashsum requires now a '-a' option flag for the algorithm * '-h' is required to output the list of algorithms to stdout * the algorithms are printed in columns, so we have to sort differently --- coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coverage.sh b/coverage.sh index d089ff6d6..a17c97d39 100755 --- a/coverage.sh +++ b/coverage.sh @@ -32,7 +32,7 @@ fi ./sizes ./constants -for i in $(./hashsum | tail -n +3 | awk '{print $1}' | sort); do echo -n "$i: " && ./hashsum $i testprof/test.key ; done > hashsum_tv.txt +for i in $(for j in $(echo $(./hashsum -h | tail -n +3)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i testprof/test.key ; done > hashsum_tv.txt difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true if [ -n "$difftroubles" ]; then echo "FAILURE: hashsum_tv.tx" From b472ef31a20d76004f1ecbd6812446e67f9ca867 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 May 2017 00:02:48 +0200 Subject: [PATCH 0705/1192] looks like the previous output was not really `shaXsum` compatible... --- notes/hashsum_tv.txt | 58 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/notes/hashsum_tv.txt b/notes/hashsum_tv.txt index c2a58b491..228d9f0a2 100644 --- a/notes/hashsum_tv.txt +++ b/notes/hashsum_tv.txt @@ -1,29 +1,29 @@ -blake2b-160: 684b540eb245ebba2cd66b7814fe6d787868a5bb *testprof/test.key -blake2b-256: 3aaa08120aa0174c105fd1f3412e3da30c3bbb9073569b0b8ae458b34de7780e *testprof/test.key -blake2b-384: c33f39ab19099d5dea6789479e23447857803a3f45361ea58dd69c7b8037c8697544b6a741e236215adcb8b38fa0cfc4 *testprof/test.key -blake2b-512: a2daabae6996e3bbfb76c5d277fb881107037c756173f510d83a78f669cf0b70a5088b971e30ca2168381568ea3d30b80a7b500944a5e2e3294f25aed4c3a5f1 *testprof/test.key -blake2s-128: 7e1f9b6de11a3c597308f9d8aacd7321 *testprof/test.key -blake2s-160: 3d1c9ae1a0afe8a6ef8b61d5380de7b061cd353c *testprof/test.key -blake2s-224: 95dacd83d0421b2d69a52d92ee54143bb97c91a61450d917a88d4388 *testprof/test.key -blake2s-256: 92ac6dc88b9ce4a75b2a54783435a37919303f713396db0e9ccd976d8c55f1cf *testprof/test.key -chc_hash: d50da1ea9b53c0b891c8bcb0a4c6e5e0 *testprof/test.key -md2: 0b327a17a102580ccde8081c18f137c7 *testprof/test.key -md4: 6df7b3c1f7fbcbf6b8246dc0046e9d6b *testprof/test.key -md5: 48fd9ed11c633069c3cf721611696a73 *testprof/test.key -rmd128: a78170e11d56605eb0f5e05e6a218e61 *testprof/test.key -rmd160: 56236b14cd15958c58136a295fa2b07c5edee009 *testprof/test.key -rmd256: a0a658b25b8841f20be8151eb5e2c1229f085dd5cf7aa8bef4c8e07ea5738913 *testprof/test.key -rmd320: 2ec15ca947f29dd8cef4782aeaeb4541ac00dc29e1649c4f5f4578ef0287091e513f9da423ce7319 *testprof/test.key -sha1: c17a11eef02d7a2ad7250bc2ee22bdf37ed21f0f *testprof/test.key -sha224: b226daa069512c849d55866470c23543d87e1fb768171efdcc6ab59a *testprof/test.key -sha256: 76ec7faebdc42a4de35ca70024c2d273e9f7856ca61612e89f5f66350ba8cf5f *testprof/test.key -sha3-224: 09525d6410c462e00e72ccd4304290bc59ff2b1b8e5322dbc197e169 *testprof/test.key -sha3-256: b9016fc9976545ad0183775d88f20df5295d40b31db00d85f6916333260b8ae2 *testprof/test.key -sha3-384: 5452977763b602df4185bbe7cce193346b09ee20d4a45a780fd44237e335ceaa71b9da06242621e159d796db9043c9be *testprof/test.key -sha3-512: 1fadf63073c8613d38d5c944e2e3f7e086d94d93dceb2eec1e9693fd44158f3127c90cbaa8a13035cc9ff9b3572c9dce836bea15c92e8a78b036ec382caceb0f *testprof/test.key -sha384: 7cc080c662524617e56d5a49f1c185909e9b1858a86684161ddd97fc5426f693b53f59d779de16da25dcb1259df879e5 *testprof/test.key -sha512: f90afe4d254716a9770fd2c4f29ca544f2975f961cbd7fa207117383e4e48f7a2e1ade4aac333a2cb8c227dd6af2fff4d87c31c2a3916ae24d507c7c94c21818 *testprof/test.key -sha512-224: 64ec566b5c2de736eab1b4e8542dc110f736819ea7f8f48e3712fbad *testprof/test.key -sha512-256: db880bce4beb7246510febb961c7595aab57a15de6f90cd079f145e476b5d773 *testprof/test.key -tiger: 97d713850e7affac30a642572c1ee7b18793d5b9e0ef5932 *testprof/test.key -whirlpool: d7d41c755e0f28313f254cb198e0bfa42f56670595d97b80dceec754825d69938a9c11e5bf16e9a3809a62a09bddf021f3dbff4302ceec7ba46c88b41772b711 *testprof/test.key +blake2b-160: 684b540eb245ebba2cd66b7814fe6d787868a5bb *testprof/test.key +blake2b-256: 3aaa08120aa0174c105fd1f3412e3da30c3bbb9073569b0b8ae458b34de7780e *testprof/test.key +blake2b-384: c33f39ab19099d5dea6789479e23447857803a3f45361ea58dd69c7b8037c8697544b6a741e236215adcb8b38fa0cfc4 *testprof/test.key +blake2b-512: a2daabae6996e3bbfb76c5d277fb881107037c756173f510d83a78f669cf0b70a5088b971e30ca2168381568ea3d30b80a7b500944a5e2e3294f25aed4c3a5f1 *testprof/test.key +blake2s-128: 7e1f9b6de11a3c597308f9d8aacd7321 *testprof/test.key +blake2s-160: 3d1c9ae1a0afe8a6ef8b61d5380de7b061cd353c *testprof/test.key +blake2s-224: 95dacd83d0421b2d69a52d92ee54143bb97c91a61450d917a88d4388 *testprof/test.key +blake2s-256: 92ac6dc88b9ce4a75b2a54783435a37919303f713396db0e9ccd976d8c55f1cf *testprof/test.key +chc_hash: d50da1ea9b53c0b891c8bcb0a4c6e5e0 *testprof/test.key +md2: 0b327a17a102580ccde8081c18f137c7 *testprof/test.key +md4: 6df7b3c1f7fbcbf6b8246dc0046e9d6b *testprof/test.key +md5: 48fd9ed11c633069c3cf721611696a73 *testprof/test.key +rmd128: a78170e11d56605eb0f5e05e6a218e61 *testprof/test.key +rmd160: 56236b14cd15958c58136a295fa2b07c5edee009 *testprof/test.key +rmd256: a0a658b25b8841f20be8151eb5e2c1229f085dd5cf7aa8bef4c8e07ea5738913 *testprof/test.key +rmd320: 2ec15ca947f29dd8cef4782aeaeb4541ac00dc29e1649c4f5f4578ef0287091e513f9da423ce7319 *testprof/test.key +sha1: c17a11eef02d7a2ad7250bc2ee22bdf37ed21f0f *testprof/test.key +sha224: b226daa069512c849d55866470c23543d87e1fb768171efdcc6ab59a *testprof/test.key +sha256: 76ec7faebdc42a4de35ca70024c2d273e9f7856ca61612e89f5f66350ba8cf5f *testprof/test.key +sha3-224: 09525d6410c462e00e72ccd4304290bc59ff2b1b8e5322dbc197e169 *testprof/test.key +sha3-256: b9016fc9976545ad0183775d88f20df5295d40b31db00d85f6916333260b8ae2 *testprof/test.key +sha3-384: 5452977763b602df4185bbe7cce193346b09ee20d4a45a780fd44237e335ceaa71b9da06242621e159d796db9043c9be *testprof/test.key +sha3-512: 1fadf63073c8613d38d5c944e2e3f7e086d94d93dceb2eec1e9693fd44158f3127c90cbaa8a13035cc9ff9b3572c9dce836bea15c92e8a78b036ec382caceb0f *testprof/test.key +sha384: 7cc080c662524617e56d5a49f1c185909e9b1858a86684161ddd97fc5426f693b53f59d779de16da25dcb1259df879e5 *testprof/test.key +sha512: f90afe4d254716a9770fd2c4f29ca544f2975f961cbd7fa207117383e4e48f7a2e1ade4aac333a2cb8c227dd6af2fff4d87c31c2a3916ae24d507c7c94c21818 *testprof/test.key +sha512-224: 64ec566b5c2de736eab1b4e8542dc110f736819ea7f8f48e3712fbad *testprof/test.key +sha512-256: db880bce4beb7246510febb961c7595aab57a15de6f90cd079f145e476b5d773 *testprof/test.key +tiger: 97d713850e7affac30a642572c1ee7b18793d5b9e0ef5932 *testprof/test.key +whirlpool: d7d41c755e0f28313f254cb198e0bfa42f56670595d97b80dceec754825d69938a9c11e5bf16e9a3809a62a09bddf021f3dbff4302ceec7ba46c88b41772b711 *testprof/test.key From e9923129c86b2f66738cb3155e58816946867147 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 May 2017 01:09:01 +0200 Subject: [PATCH 0706/1192] fix LTC_EASY compilation --- demos/hashsum.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 8d15476ce..cdb8af8de 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -177,15 +177,30 @@ int main(int argc, char **argv) const char* should; } shasum_compat[] = { +#ifdef LTC_SHA1 { "1", sha1_desc.name }, +#endif +#ifdef LTC_SHA224 { "224", sha224_desc.name }, +#endif +#ifdef LTC_SHA256 { "256", sha256_desc.name }, +#endif +#ifdef LTC_SHA384 { "384", sha384_desc.name }, +#endif +#ifdef LTC_SHA512 { "512", sha512_desc.name }, +#endif +#ifdef LTC_SHA512_224 { "512224", sha512_224_desc.name }, +#endif +#ifdef LTC_SHA512_256 { "512256", sha512_256_desc.name }, +#endif + { NULL, NULL } }; - for (x = 0; x < sizeof(shasum_compat)/sizeof(shasum_compat[0]); ++x) { + for (x = 0; shasum_compat[x].is != NULL; ++x) { if(XSTRCMP(shasum_compat[x].is, argv[argn]) == 0) { idx = find_hash(shasum_compat[x].should); break; @@ -193,7 +208,7 @@ int main(int argc, char **argv) } } if (idx == -1) { - fprintf(stderr, "\nInvalid hash (%s) specified on command line.\n", argv[2]); + fprintf(stderr, "Invalid hash (%s) specified on command line.\n", argv[2]); die(EXIT_FAILURE); } argn++; From 85c2186ae64c4fbfe5506da5251c3c95f003682b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 May 2017 01:13:35 +0200 Subject: [PATCH 0707/1192] better output on stderr --- demos/hashsum.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index cdb8af8de..c3824d5ef 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -112,7 +112,7 @@ static void check_file(int argn, int argc, char **argv) tries++; w = sizeof(is_buffer); if ((err = hash_file(x, space, is_buffer, &w)) != CRYPT_OK) { - fprintf(stderr, "File hash error: %s: %s\n", space, error_to_string(err)); + fprintf(stderr, "%s: File hash error: %s: %s\n", hashsum, space, error_to_string(err)); ERR: fclose(f); exit(EXIT_FAILURE); @@ -208,7 +208,7 @@ int main(int argc, char **argv) } } if (idx == -1) { - fprintf(stderr, "Invalid hash (%s) specified on command line.\n", argv[2]); + fprintf(stderr, "%s: Unrecognized algorithm\n", hashsum); die(EXIT_FAILURE); } argn++; @@ -233,7 +233,7 @@ int main(int argc, char **argv) if (argc == argn) { w = sizeof(hash_buffer); if ((err = hash_filehandle(idx, stdin, hash_buffer, &w)) != CRYPT_OK) { - fprintf(stderr, "File hash error: %s\n", error_to_string(err)); + fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err)); return EXIT_FAILURE; } else { for (x = 0; x < w; x++) { @@ -245,7 +245,7 @@ int main(int argc, char **argv) for (z = 3; z < argc; z++) { w = sizeof(hash_buffer); if ((err = hash_file(idx,argv[z],hash_buffer,&w)) != CRYPT_OK) { - fprintf(stderr, "File hash error: %s\n", error_to_string(err)); + fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err)); return EXIT_FAILURE; } else { printf_hex(hash_buffer, w); From adf0ad95c9b785448278162cfcc9d922e09b30eb Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 21:36:14 +0200 Subject: [PATCH 0708/1192] IBM xlc compiler does not like "static inline" (related to #209) --- src/headers/tomcrypt_cfg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index ccfb78bec..40d83e529 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -41,8 +41,8 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #endif -/* some compilers do not like "inline" */ -#if defined(__HP_cc) +/* some compilers do not like "inline" (or maybe "static inline"), namely: HP cc, IBM xlc */ +#if defined(__HP_cc) || defined(__xlc__) #define LTC_INLINE #elif defined(_MSC_VER) #define LTC_INLINE __inline From 421266cf5f7ed322c45751312ff0f1a5491a4d59 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 09:41:27 +0200 Subject: [PATCH 0709/1192] fix void *orig --- src/modes/xts/xts_test.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index 0b887adcf..7826d2240 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -17,7 +17,9 @@ static int _xts_test_accel_xts_encrypt(const unsigned char *pt, unsigned char *c { int ret; symmetric_xts xts; - void *orig; + int (*orig)(const unsigned char *, unsigned char *, + unsigned long , unsigned char *, symmetric_key *, + symmetric_key *); /* AES can be under rijndael or aes... try to find it */ if ((xts.cipher = find_cipher("aes")) == -1) { @@ -42,7 +44,9 @@ static int _xts_test_accel_xts_decrypt(const unsigned char *ct, unsigned char *p { int ret; symmetric_xts xts; - void *orig; + int (*orig)(const unsigned char *, unsigned char *, + unsigned long , unsigned char *, symmetric_key *, + symmetric_key *); /* AES can be under rijndael or aes... try to find it */ if ((xts.cipher = find_cipher("aes")) == -1) { From f6ea738feec7bed7c976e0871c65d36c21ad5f18 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 21:29:39 +0200 Subject: [PATCH 0710/1192] fix: Loss of sign (initialization) (int to unsigned long long) --- src/encauth/ccm/ccm_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index eb41f99b3..059bf357e 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -54,7 +54,7 @@ int ccm_memory(int cipher, int err; unsigned long len, L, x, y, z, CTRlen; #ifdef LTC_FAST - LTC_FAST_TYPE fastMask = -1; /* initialize fastMask at all zeroes */ + LTC_FAST_TYPE fastMask = ~0; /* initialize fastMask at all zeroes */ #endif unsigned char mask = 0xff; /* initialize mask at all zeroes */ From 04262d3aec7bd15254369562cfcb68e909a6b936 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 21:31:05 +0200 Subject: [PATCH 0711/1192] fix: local struct member 'poly_div' not referenced --- src/encauth/ocb3/ocb3_init.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index c73cb9630..400c0a7e1 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -19,17 +19,13 @@ static const struct { int len; - unsigned char poly_div[MAXBLOCKSIZE], - poly_mul[MAXBLOCKSIZE]; + unsigned char poly_mul[MAXBLOCKSIZE]; } polys[] = { { 8, - { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B } }, { 16, - { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87 } } From 91b61630be67fcf5f3dde956249dcc40ee35a1dd Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 21:43:28 +0200 Subject: [PATCH 0712/1192] improved #ifdefs - related to: 'num' not referenced --- src/misc/hkdf/hkdf_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index c740b58a9..d4dcc784c 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -265,7 +265,7 @@ int hkdf_test(void) cases[i].info, cases[i].info_l, cases[i].IKM, cases[i].IKM_l, OKM, cases[i].OKM_l)) != CRYPT_OK) { -#if 0 +#ifdef LTC_TEST_DBG printf("LTC_HKDF-%s test #%d, %s\n", cases[i].Hash, i, error_to_string(err)); #endif return err; @@ -273,7 +273,7 @@ int hkdf_test(void) if(XMEMCMP(OKM, cases[i].OKM, (size_t)cases[i].OKM_l) != 0) { failed++; -#if 0 +#ifdef LTC_TEST_DBG { unsigned int j; printf("\nLTC_HKDF-%s test #%d:\n", cases[i].Hash, cases[i].num); @@ -288,10 +288,10 @@ int hkdf_test(void) printf("\n"); return CRYPT_ERROR; } -#endif -#if 0 +#if LTC_TEST_DBG > 1 } else { printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, cases[i].num); +#endif #endif } } From 6d70827d1f1397fc784bbd681f22a70293c4acf8 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 11:52:34 +0200 Subject: [PATCH 0713/1192] Windows: fix warning: 'rng_nix' defined but not used --- src/prngs/rng_get_bytes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 2c05d0dd4..701c09869 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -14,7 +14,7 @@ portable way to get secure random bits to feed a PRNG (Tom St Denis) */ -#ifdef LTC_DEVRANDOM +#if defined(LTC_DEVRANDOM) && !defined(_WIN32) /* on *NIX read /dev/random */ static unsigned long rng_nix(unsigned char *buf, unsigned long len, void (*callback)(void)) From e2cf11da25bb62e6aa02e89dc4c3bd52a8577403 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 18:31:14 +0200 Subject: [PATCH 0714/1192] fix windows warnings - #212 and #213 --- demos/crypt.c | 27 ++-- demos/hashsum.c | 5 + demos/test.c | 11 +- demos/tv_gen.c | 2 +- libtomcrypt_VS2008.vcproj | 8 +- .../chachapoly/chacha20poly1305_decrypt.c | 2 +- .../chachapoly/chacha20poly1305_done.c | 2 +- .../chachapoly/chacha20poly1305_encrypt.c | 2 +- src/stream/sober128/sober128.c | 4 +- testprof/base64_test.c | 6 +- testprof/der_tests.c | 138 +++++++++--------- testprof/dh_test.c | 4 +- testprof/dsa_test.c | 2 +- testprof/ecc_test.c | 4 +- testprof/x86_prof.c | 27 ++-- 15 files changed, 126 insertions(+), 118 deletions(-) diff --git a/demos/crypt.c b/demos/crypt.c index 6bd14ac03..75aee7028 100644 --- a/demos/crypt.c +++ b/demos/crypt.c @@ -9,8 +9,6 @@ #include -int errno; - int usage(char *name) { int x; @@ -103,6 +101,7 @@ int main(int argc, char *argv[]) char *infile, *outfile, *cipher; prng_state prng; FILE *fdin, *fdout; + int err; /* register algs, so they can be printed */ register_algs(); @@ -180,8 +179,8 @@ int main(int argc, char *argv[]) if(fgets((char *)tmpkey,sizeof(tmpkey), stdin) == NULL) exit(-1); outlen = sizeof(key); - if ((errno = hash_memory(hash_idx,tmpkey,strlen((char *)tmpkey),key,&outlen)) != CRYPT_OK) { - printf("Error hashing key: %s\n", error_to_string(errno)); + if ((err = hash_memory(hash_idx,tmpkey,strlen((char *)tmpkey),key,&outlen)) != CRYPT_OK) { + printf("Error hashing key: %s\n", error_to_string(err)); exit(-1); } @@ -192,8 +191,8 @@ int main(int argc, char *argv[]) exit(-1); } - if ((errno = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) { - printf("ctr_start error: %s\n",error_to_string(errno)); + if ((err = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) { + printf("ctr_start error: %s\n",error_to_string(err)); exit(-1); } @@ -201,8 +200,8 @@ int main(int argc, char *argv[]) do { y = fread(inbuf,1,sizeof(inbuf),fdin); - if ((errno = ctr_decrypt(inbuf,plaintext,y,&ctr)) != CRYPT_OK) { - printf("ctr_decrypt error: %s\n", error_to_string(errno)); + if ((err = ctr_decrypt(inbuf,plaintext,y,&ctr)) != CRYPT_OK) { + printf("ctr_decrypt error: %s\n", error_to_string(err)); exit(-1); } @@ -217,8 +216,8 @@ int main(int argc, char *argv[]) } else { /* encrypt */ /* Setup yarrow for random bytes for IV */ - if ((errno = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) != CRYPT_OK) { - printf("Error setting up PRNG, %s\n", error_to_string(errno)); + if ((err = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) != CRYPT_OK) { + printf("Error setting up PRNG, %s\n", error_to_string(err)); } /* You can use rng_get_bytes on platforms that support it */ @@ -234,16 +233,16 @@ int main(int argc, char *argv[]) exit(-1); } - if ((errno = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) { - printf("ctr_start error: %s\n",error_to_string(errno)); + if ((err = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) { + printf("ctr_start error: %s\n",error_to_string(err)); exit(-1); } do { y = fread(inbuf,1,sizeof(inbuf),fdin); - if ((errno = ctr_encrypt(inbuf,ciphertext,y,&ctr)) != CRYPT_OK) { - printf("ctr_encrypt error: %s\n", error_to_string(errno)); + if ((err = ctr_encrypt(inbuf,ciphertext,y,&ctr)) != CRYPT_OK) { + printf("ctr_encrypt error: %s\n", error_to_string(err)); exit(-1); } diff --git a/demos/hashsum.c b/demos/hashsum.c index c3824d5ef..9bdac6653 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -15,6 +15,11 @@ #define basename(x) x #endif +#if !defined(PATH_MAX) && defined(_MSC_VER) +#include +#define PATH_MAX MAX_PATH +#endif + /* thanks http://stackoverflow.com/a/8198009 */ #define _base(x) ((x >= '0' && x <= '9') ? '0' : \ (x >= 'a' && x <= 'f') ? 'a' - 10 : \ diff --git a/demos/test.c b/demos/test.c index 4c7a332c8..689b97654 100644 --- a/demos/test.c +++ b/demos/test.c @@ -33,7 +33,8 @@ int main(int argc, char **argv) int x, pass = 0, fail = 0, nop = 0; size_t fn_len, i, dots; char *single_test = NULL; - ulong64 ts, dur = 0; + ulong64 ts; + long delta, dur = 0; reg_algs(); printf("build == \n%s\n", crypt_build_settings); @@ -77,11 +78,11 @@ int main(int argc, char **argv) ts = epoch_usec(); x = test_functions[i].fn(); - ts = epoch_usec() - ts; - dur += ts; + delta = (long)(epoch_usec() - ts); + dur += delta; if (x == CRYPT_OK) { - printf("passed %10.3fms", (double)(ts)/1000); + printf("passed %10.3fms", (double)(delta)/1000); pass++; } else if (x == CRYPT_NOP) { @@ -89,7 +90,7 @@ int main(int argc, char **argv) nop++; } else { - printf("failed %10.3fms", (double)(ts)/1000); + printf("failed %10.3fms", (double)(delta)/1000); fail++; } } diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 1541367f6..7108feab5 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -754,7 +754,7 @@ void base64_gen(void) fprintf(out, "Base64 vectors. These are the base64 encodings of the strings 00,01,02...NN-1\n\n"); for (x = 0; x <= 32; x++) { for (y = 0; y < x; y++) { - src[y] = y; + src[y] = (unsigned char)y; } len = sizeof(dst); base64_encode(src, x, dst, &len); diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index b256dd727..f5f14636f 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -46,7 +46,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="src\headers,..\libtommath" - PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;LTM_DESC;LTC_SOURCE;LTC_NO_TEST;LTC_NO_PROTOTYPES" + PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;LTM_DESC;LTC_SOURCE;LTC_NO_TEST;LTC_NO_PROTOTYPES" MinimalRebuild="true" ExceptionHandling="0" BasicRuntimeChecks="3" @@ -123,7 +123,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="src\headers,..\libtommath" - PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;LTM_DESC;LTC_SOURCE;LTC_NO_TEST;LTC_NO_PROTOTYPES" + PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;LTM_DESC;LTC_SOURCE;LTC_NO_TEST;LTC_NO_PROTOTYPES" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="0" @@ -199,7 +199,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="src\headers,..\libtommath" - PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;LTM_DESC;LTC_SOURCE;LTC_NO_TEST;LTC_NO_PROTOTYPES" + PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;LTM_DESC;LTC_SOURCE;LTC_NO_TEST;LTC_NO_PROTOTYPES" MinimalRebuild="true" ExceptionHandling="0" BasicRuntimeChecks="3" @@ -277,7 +277,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="src\headers,..\libtommath" - PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;LTM_DESC;LTC_SOURCE;LTC_NO_TEST;LTC_NO_PROTOTYPES" + PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;LTM_DESC;LTC_SOURCE;LTC_NO_TEST;LTC_NO_PROTOTYPES" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="0" diff --git a/src/encauth/chachapoly/chacha20poly1305_decrypt.c b/src/encauth/chachapoly/chacha20poly1305_decrypt.c index 2677affd2..6ade7d552 100644 --- a/src/encauth/chachapoly/chacha20poly1305_decrypt.c +++ b/src/encauth/chachapoly/chacha20poly1305_decrypt.c @@ -29,7 +29,7 @@ int chacha20poly1305_decrypt(chacha20poly1305_state *st, const unsigned char *in LTC_ARGCHK(st != NULL); if (st->aadflg) { - padlen = 16 - (st->aadlen % 16); + padlen = 16 - (unsigned long)(st->aadlen % 16); if (padlen < 16) { if ((err = poly1305_process(&st->poly, padzero, padlen)) != CRYPT_OK) return err; } diff --git a/src/encauth/chachapoly/chacha20poly1305_done.c b/src/encauth/chachapoly/chacha20poly1305_done.c index 1b4158963..259513e5a 100644 --- a/src/encauth/chachapoly/chacha20poly1305_done.c +++ b/src/encauth/chachapoly/chacha20poly1305_done.c @@ -27,7 +27,7 @@ int chacha20poly1305_done(chacha20poly1305_state *st, unsigned char *tag, unsign LTC_ARGCHK(st != NULL); - padlen = 16 - (st->ctlen % 16); + padlen = 16 - (unsigned long)(st->ctlen % 16); if (padlen < 16) { if ((err = poly1305_process(&st->poly, padzero, padlen)) != CRYPT_OK) return err; } diff --git a/src/encauth/chachapoly/chacha20poly1305_encrypt.c b/src/encauth/chachapoly/chacha20poly1305_encrypt.c index 511f24b32..3705d0d73 100644 --- a/src/encauth/chachapoly/chacha20poly1305_encrypt.c +++ b/src/encauth/chachapoly/chacha20poly1305_encrypt.c @@ -30,7 +30,7 @@ int chacha20poly1305_encrypt(chacha20poly1305_state *st, const unsigned char *in if ((err = chacha_crypt(&st->chacha, in, inlen, out)) != CRYPT_OK) return err; if (st->aadflg) { - padlen = 16 - (st->aadlen % 16); + padlen = 16 - (unsigned long)(st->aadlen % 16); if (padlen < 16) { if ((err = poly1305_process(&st->poly, padzero, padlen)) != CRYPT_OK) return err; } diff --git a/src/stream/sober128/sober128.c b/src/stream/sober128/sober128.c index b192d9a70..e4b30c354 100644 --- a/src/stream/sober128/sober128.c +++ b/src/stream/sober128/sober128.c @@ -263,7 +263,7 @@ int sober128_stream_crypt(sober128_state *c, const unsigned char *in, unsigned l /* handle any previously buffered bytes */ while (c->nbuf != 0 && inlen != 0) { - *out++ = *in++ ^ (c->sbuf & 0xFF); + *out++ = *in++ ^ (unsigned char)(c->sbuf & 0xFF); c->sbuf >>= 8; c->nbuf -= 8; --inlen; @@ -311,7 +311,7 @@ int sober128_stream_crypt(sober128_state *c, const unsigned char *in, unsigned l c->sbuf = nltap(c); c->nbuf = 32; while (c->nbuf != 0 && inlen != 0) { - *out++ = *in++ ^ (c->sbuf & 0xFF); + *out++ = *in++ ^ (unsigned char)(c->sbuf & 0xFF); c->sbuf >>= 8; c->nbuf -= 8; --inlen; diff --git a/testprof/base64_test.c b/testprof/base64_test.c index 251822bac..fd344da59 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -7,7 +7,7 @@ int base64_test(void) unsigned long x, l1, l2, slen1; #if defined(LTC_BASE64) - const char special_case[] = { + const unsigned char special_case[] = { 0xbe, 0xe8, 0x92, 0x3c, 0xa2, 0x25, 0xf0, 0xf8, 0x91, 0xe4, 0xef, 0xab, 0x0b, 0x8c, 0xfd, 0xff, 0x14, 0xd0, 0x29, 0x9d, 0x00 }; @@ -31,7 +31,7 @@ int base64_test(void) {"foob", "Zm9vYg==" }, {"fooba", "Zm9vYmE=" }, {"foobar", "Zm9vYmFy"}, - {special_case,"vuiSPKIl8PiR5O+rC4z9/xTQKZ0="} + {(char*)special_case,"vuiSPKIl8PiR5O+rC4z9/xTQKZ0="} }; #endif @@ -59,7 +59,7 @@ int base64_test(void) DO(base64url_strict_decode((unsigned char*)url_cases[x].s, slen1, out, &l1)); else DO(base64url_decode((unsigned char*)url_cases[x].s, slen1, out, &l1)); - if (compare_testvector(out, l1, special_case, strlen(special_case), "base64url decode", x)) { + if (compare_testvector(out, l1, special_case, sizeof(special_case) - 1, "base64url decode", x)) { return 1; } if(x < 2) { diff --git a/testprof/der_tests.c b/testprof/der_tests.c index faa3b3bce..89f8aa4e6 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -14,74 +14,74 @@ int der_tests(void) #else static const unsigned char _der_tests_stinky_root_cert[] = - "MIIFETCCA/mgAwIBAgIQbv53JNmv518t5lkCHE272jANBgkqhkiG9w0BAQUFADCB\ - lTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug\ - Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho\ - dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAbBgNVBAMTFFVUTi1VU0VSRmlyc3Qt\ - T2JqZWN0MB4XDTA4MDQyOTAwMDAwMFoXDTEwMDQyOTIzNTk1OVowgbUxCzAJBgNV\ - BAYTAlVTMQ4wDAYDVQQRDAU0NDE0MzELMAkGA1UECAwCT0gxGTAXBgNVBAcMEE1h\ - eWZpZWxkIFZpbGxhZ2UxEDAOBgNVBAkMB1N1aXRlIEExFDASBgNVBAkMCzc2NyBC\ - ZXRhIERyMSIwIAYDVQQKDBlQcmVlbXB0aXZlIFNvbHV0aW9ucywgTExDMSIwIAYD\ - VQQDDBlQcmVlbXB0aXZlIFNvbHV0aW9ucywgTExDMIIBIjANBgkqhkiG9w0BAQEF\ - AAOCAQ8AMIIBCgKCAQEAzH7ZBkMcBuHx8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IpDKW105uM0nlXe2XF9c+ot2MdWvV4TwIDAQABo4IBOTCCATUwHwYD" + "VR0jBBgwFoAU2u1kdBScFDyr3ZmpvVsoTYs8ydgwHQYDVR0OBBYEFK+1HzZE4i28" + "oLIzuqlFR9SspiCIMA4GA1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMBMGA1Ud" + "JQQMMAoGCCsGAQUFBwMDMBEGCWCGSAGG+EIBAQQEAwIEEDBGBgNVHSAEPzA9MDsG" + "DCsGAQQBsjEBAgEDAjArMCkGCCsGAQUFBwIBFh1odHRwczovL3NlY3VyZS5jb21v" + "ZG8ubmV0L0NQUzBCBgNVHR8EOzA5MDegNaAzhjFodHRwOi8vY3JsLnVzZXJ0cnVz" + "dC5jb20vVVROLVVTRVJGaXJzdC1PYmplY3QuY3JsMCEGA1UdEQQaMBiBFnN1cHBv" + "cnRAcHJlZW1wdGl2ZS5jb20wDQYJKoZIhvcNAQEFBQADggEBAC+JM26Dokvonudl" + "JXe/Yun7IBhimkagZUjbk9l/GQWN6i+v1o95UJ1wGJtBdm2+MxbSaPoNTDZR4B+2" + "lYL9MW57UVmePrnfUPXQKZZG+8gTRDz8+7ol/CEAKmS3MLKCRcH5oe+J5345sGxi" + "FC/KWNKedTNraW95xlg8NTlL2yRP7TMsjvBxgLmkbaFUoXzPTbQWmtovIagIT8GC" + "JeXwdFaRjbamiz3Irl+u7x/mhxdza6RvgBYylXRFMudANpeGsV7gDXlnfzpFDKHQ" + "niVwB7P5sbPFIlmIc+4/xRItkLIRjCVXaepgN9KYu3VOgiSDI6wXiTwP44/LUXQM" + "hetwa7s="; const unsigned char _der_tests_cacert_root_cert[] = - "MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290\ - IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB\ - IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w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oZIhvcNAQEEBQADggIB" + "ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc" + "nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg" + "18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c" + "gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl" + "Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY" + "sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T" + "SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF" + "CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum" + "GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk" + "zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW" + "omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD"; const unsigned long _der_tests_cacert_root_cert_size = sizeof(_der_tests_cacert_root_cert); /* @@ -1034,8 +1034,8 @@ static int der_choice_test(void) ltc_generalizedtime gtime = { 2038, 01, 19, 3, 14, 8, 0, 0, 0, 0 }; /* setup variables */ - for (x = 0; x < sizeof(bitbuf); x++) { bitbuf[x] = x & 1; } - for (x = 0; x < sizeof(octetbuf); x++) { octetbuf[x] = x; } + for (x = 0; x < sizeof(bitbuf); x++) { bitbuf[x] = (unsigned char)(x & 1); } + for (x = 0; x < sizeof(octetbuf); x++) { octetbuf[x] = (unsigned char)x; } for (x = 0; x < sizeof(ia5buf); x++) { ia5buf[x] = 'a'; } for (x = 0; x < sizeof(printbuf); x++) { printbuf[x] = 'a'; } integer = 1; diff --git a/testprof/dh_test.c b/testprof/dh_test.c index ee3736fd3..f2cc0bb9a 100644 --- a/testprof/dh_test.c +++ b/testprof/dh_test.c @@ -75,7 +75,7 @@ int dh_test (void) /* test encrypt_key */ dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &usera); for (x = 0; x < 16; x++) { - buf[0][x] = x; + buf[0][x] = (unsigned char)x; } y = sizeof (buf[1]); DO(dh_encrypt_key (buf[0], 16, buf[1], &y, &yarrow_prng, find_prng ("yarrow"), find_hash ("md5"), &usera)); @@ -96,7 +96,7 @@ int dh_test (void) /* test sign_hash */ for (x = 0; x < 16; x++) { - buf[0][x] = x; + buf[0][x] = (unsigned char)x; } x = sizeof (buf[1]); DO(dh_sign_hash (buf[0], 16, buf[1], &x, &yarrow_prng, find_prng ("yarrow"), &usera)); diff --git a/testprof/dsa_test.c b/testprof/dsa_test.c index 93b5b310a..5db4edfbb 100644 --- a/testprof/dsa_test.c +++ b/testprof/dsa_test.c @@ -186,7 +186,7 @@ int dsa_test(void) if (stat1 == 0) { fprintf(stderr, "dsa_verify_key "); return 1; } /* encrypt a message */ - for (x = 0; x < 16; x++) { msg[x] = x; } + for (x = 0; x < 16; x++) { msg[x] = (unsigned char)x; } x = sizeof(out); DO(dsa_encrypt_key(msg, 16, out, &x, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), &key)); diff --git a/testprof/ecc_test.c b/testprof/ecc_test.c index b95fa930f..069e27b0d 100644 --- a/testprof/ecc_test.c +++ b/testprof/ecc_test.c @@ -192,7 +192,7 @@ int ecc_tests (void) DO(ecc_import(buf[0], x, &privKey)); for (x = 0; x < 32; x++) { - buf[0][x] = x; + buf[0][x] = (unsigned char)x; } y = sizeof (buf[1]); DO(ecc_encrypt_key (buf[0], 32, buf[1], &y, &yarrow_prng, find_prng ("yarrow"), find_hash ("sha256"), &pubKey)); @@ -211,7 +211,7 @@ int ecc_tests (void) } /* test sign_hash */ for (x = 0; x < 16; x++) { - buf[0][x] = x; + buf[0][x] = (unsigned char)x; } x = sizeof (buf[1]); DO(ecc_sign_hash (buf[0], 16, buf[1], &x, &yarrow_prng, find_prng ("yarrow"), &privKey)); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 52c81a64b..43d8591d2 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -14,9 +14,12 @@ ulong64 epoch_usec(void) #elif defined(_WIN32) FILETIME CurrentTime; ulong64 cur_time; + ULARGE_INTEGER ul; GetSystemTimeAsFileTime(&CurrentTime); - cur_time = ((ulong64)CurrentTime.dwHighDateTime << 32) + (ulong64)CurrentTime.dwLowDateTime; - cur_time -= 116444736000000000LL; /* subtract epoch in microseconds */ + ul.LowPart = CurrentTime.dwLowDateTime; + ul.HighPart = CurrentTime.dwHighDateTime; + cur_time = ul.QuadPart; + cur_time -= CONST64(116444736000000000); /* subtract epoch in microseconds */ cur_time /= 10; /* nanoseconds > microseconds */ return cur_time; #else @@ -587,7 +590,7 @@ int time_keysched(void) c1 = (t1 > c1) ? c1 : t1; } t1 = c1 - skew; - results[no_results].spd1 = results[no_results].avg = t1; + results[no_results].spd1 = results[no_results].avg = (unsigned long)t1; results[no_results++].id = x; fprintf(stderr, "."); fflush(stdout); @@ -656,8 +659,8 @@ int time_cipher(void) ecb_done(&ecb); results[no_results].id = x; - results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd1 = (unsigned long)(a1/(sizeof(pt)/cipher_descriptor[x].block_length)); + results[no_results].spd2 = (unsigned long)(a2/(sizeof(pt)/cipher_descriptor[x].block_length)); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); @@ -731,8 +734,8 @@ int time_cipher2(void) cbc_done(&cbc); results[no_results].id = x; - results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd1 = (unsigned long)(a1/(sizeof(pt)/cipher_descriptor[x].block_length)); + results[no_results].spd2 = (unsigned long)(a2/(sizeof(pt)/cipher_descriptor[x].block_length)); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); @@ -806,8 +809,8 @@ int time_cipher3(void) ctr_done(&ctr); results[no_results].id = x; - results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd1 = (unsigned long)(a1/(sizeof(pt)/cipher_descriptor[x].block_length)); + results[no_results].spd2 = (unsigned long)(a2/(sizeof(pt)/cipher_descriptor[x].block_length)); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); @@ -883,8 +886,8 @@ int time_cipher4(void) lrw_done(&lrw); results[no_results].id = x; - results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd1 = (unsigned long)(a1/(sizeof(pt)/cipher_descriptor[x].block_length)); + results[no_results].spd2 = (unsigned long)(a2/(sizeof(pt)/cipher_descriptor[x].block_length)); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); @@ -941,7 +944,7 @@ int time_hash(void) t1 = c2 - c1 - skew; t1 = ((t1 * CONST64(1000))) / ((ulong64)hash_descriptor[x].blocksize); results[no_results].id = x; - results[no_results].spd1 = results[no_results].avg = t1; + results[no_results].spd1 = results[no_results].avg = (unsigned long)t1; ++no_results; fprintf(stderr, "."); fflush(stdout); #undef DO2 From a69e55ba54df8d9e939d5033732fc60148b463dd Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 22:05:30 +0200 Subject: [PATCH 0715/1192] tuning win warnings fixes --- demos/tv_gen.c | 8 ++++---- testprof/dh_test.c | 14 +++++++------- testprof/dsa_test.c | 4 ++-- testprof/ecc_test.c | 14 +++++++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 7108feab5..e754a7dfb 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -747,14 +747,14 @@ void gcm_gen(void) void base64_gen(void) { FILE *out; - unsigned char dst[256], src[32]; - unsigned long x, y, len; + unsigned char dst[256], src[32], ch; + unsigned long x, len; out = fopen("base64_tv.txt", "w"); fprintf(out, "Base64 vectors. These are the base64 encodings of the strings 00,01,02...NN-1\n\n"); for (x = 0; x <= 32; x++) { - for (y = 0; y < x; y++) { - src[y] = (unsigned char)y; + for (ch = 0; ch < x; ch++) { + src[ch] = ch; } len = sizeof(dst); base64_encode(src, x, dst, &len); diff --git a/testprof/dh_test.c b/testprof/dh_test.c index f2cc0bb9a..e2bd9809f 100644 --- a/testprof/dh_test.c +++ b/testprof/dh_test.c @@ -10,7 +10,7 @@ int dh_test (void) { - unsigned char buf[3][4096]; + unsigned char buf[3][4096], ch; unsigned long x, y, z; int stat, stat2; dh_key usera, userb; @@ -74,8 +74,8 @@ int dh_test (void) /* test encrypt_key */ dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &usera); - for (x = 0; x < 16; x++) { - buf[0][x] = (unsigned char)x; + for (ch = 0; ch < 16; ch++) { + buf[0][ch] = ch; } y = sizeof (buf[1]); DO(dh_encrypt_key (buf[0], 16, buf[1], &y, &yarrow_prng, find_prng ("yarrow"), find_hash ("md5"), &usera)); @@ -87,16 +87,16 @@ int dh_test (void) dh_free (&usera); return 1; } - for (x = 0; x < 16; x++) - if (buf[0][x] != x) { + for (ch = 0; ch < 16; ch++) + if (buf[0][ch] != ch) { fprintf(stderr, "Failed (contents)\n"); dh_free (&usera); return 1; } /* test sign_hash */ - for (x = 0; x < 16; x++) { - buf[0][x] = (unsigned char)x; + for (ch = 0; ch < 16; ch++) { + buf[0][ch] = ch; } x = sizeof (buf[1]); DO(dh_sign_hash (buf[0], 16, buf[1], &x, &yarrow_prng, find_prng ("yarrow"), &usera)); diff --git a/testprof/dsa_test.c b/testprof/dsa_test.c index 5db4edfbb..37f06d7ad 100644 --- a/testprof/dsa_test.c +++ b/testprof/dsa_test.c @@ -171,7 +171,7 @@ static int dsa_compat_test(void) int dsa_test(void) { - unsigned char msg[16], out[1024], out2[1024]; + unsigned char msg[16], out[1024], out2[1024], ch; unsigned long x, y; int stat1, stat2; dsa_key key, key2; @@ -186,7 +186,7 @@ int dsa_test(void) if (stat1 == 0) { fprintf(stderr, "dsa_verify_key "); return 1; } /* encrypt a message */ - for (x = 0; x < 16; x++) { msg[x] = (unsigned char)x; } + for (ch = 0; ch < 16; ch++) { msg[ch] = ch; } x = sizeof(out); DO(dsa_encrypt_key(msg, 16, out, &x, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), &key)); diff --git a/testprof/ecc_test.c b/testprof/ecc_test.c index 069e27b0d..b4668d04e 100644 --- a/testprof/ecc_test.c +++ b/testprof/ecc_test.c @@ -107,7 +107,7 @@ int ecc_test_shamir(void) int ecc_tests (void) { - unsigned char buf[4][4096]; + unsigned char buf[4][4096], ch; unsigned long x, y, z, s; int stat, stat2; ecc_key usera, userb, pubKey, privKey; @@ -191,8 +191,8 @@ int ecc_tests (void) DO(ecc_export(buf[0], &x, PK_PRIVATE, &usera)); DO(ecc_import(buf[0], x, &privKey)); - for (x = 0; x < 32; x++) { - buf[0][x] = (unsigned char)x; + for (ch = 0; ch < 32; ch++) { + buf[0][ch] = ch; } y = sizeof (buf[1]); DO(ecc_encrypt_key (buf[0], 32, buf[1], &y, &yarrow_prng, find_prng ("yarrow"), find_hash ("sha256"), &pubKey)); @@ -203,15 +203,15 @@ int ecc_tests (void) fprintf(stderr, "Failed (length)"); return 1; } - for (x = 0; x < 32; x++) { - if (buf[0][x] != x) { + for (ch = 0; ch < 32; ch++) { + if (buf[0][ch] != ch) { fprintf(stderr, "Failed (contents)"); return 1; } } /* test sign_hash */ - for (x = 0; x < 16; x++) { - buf[0][x] = (unsigned char)x; + for (ch = 0; ch < 16; ch++) { + buf[0][ch] = ch; } x = sizeof (buf[1]); DO(ecc_sign_hash (buf[0], 16, buf[1], &x, &yarrow_prng, find_prng ("yarrow"), &privKey)); From 9ba9677d94409d428076221374ccb1c0ce9186b9 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 22:10:42 +0200 Subject: [PATCH 0716/1192] x86_prof - spd1, spd2, avg are now ulong64 --- testprof/tomcrypt_test.h | 2 +- testprof/x86_prof.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 64f2c23ff..48c6c07cc 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -74,7 +74,7 @@ int multi_test(void); extern struct list { int id; - unsigned long spd1, spd2, avg; + ulong64 spd1, spd2, avg; } results[]; extern int no_results; diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 43d8591d2..671ecb2d4 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -590,7 +590,7 @@ int time_keysched(void) c1 = (t1 > c1) ? c1 : t1; } t1 = c1 - skew; - results[no_results].spd1 = results[no_results].avg = (unsigned long)t1; + results[no_results].spd1 = results[no_results].avg = t1; results[no_results++].id = x; fprintf(stderr, "."); fflush(stdout); @@ -659,8 +659,8 @@ int time_cipher(void) ecb_done(&ecb); results[no_results].id = x; - results[no_results].spd1 = (unsigned long)(a1/(sizeof(pt)/cipher_descriptor[x].block_length)); - results[no_results].spd2 = (unsigned long)(a2/(sizeof(pt)/cipher_descriptor[x].block_length)); + results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); @@ -734,8 +734,8 @@ int time_cipher2(void) cbc_done(&cbc); results[no_results].id = x; - results[no_results].spd1 = (unsigned long)(a1/(sizeof(pt)/cipher_descriptor[x].block_length)); - results[no_results].spd2 = (unsigned long)(a2/(sizeof(pt)/cipher_descriptor[x].block_length)); + results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); @@ -809,8 +809,8 @@ int time_cipher3(void) ctr_done(&ctr); results[no_results].id = x; - results[no_results].spd1 = (unsigned long)(a1/(sizeof(pt)/cipher_descriptor[x].block_length)); - results[no_results].spd2 = (unsigned long)(a2/(sizeof(pt)/cipher_descriptor[x].block_length)); + results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); @@ -886,8 +886,8 @@ int time_cipher4(void) lrw_done(&lrw); results[no_results].id = x; - results[no_results].spd1 = (unsigned long)(a1/(sizeof(pt)/cipher_descriptor[x].block_length)); - results[no_results].spd2 = (unsigned long)(a2/(sizeof(pt)/cipher_descriptor[x].block_length)); + results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; ++no_results; fprintf(stderr, "."); fflush(stdout); @@ -944,7 +944,7 @@ int time_hash(void) t1 = c2 - c1 - skew; t1 = ((t1 * CONST64(1000))) / ((ulong64)hash_descriptor[x].blocksize); results[no_results].id = x; - results[no_results].spd1 = results[no_results].avg = (unsigned long)t1; + results[no_results].spd1 = results[no_results].avg = t1; ++no_results; fprintf(stderr, "."); fflush(stdout); #undef DO2 From af4f6b374db642d57d4390570dfa1c83d306cbd0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 22:15:31 +0200 Subject: [PATCH 0717/1192] better warning fix in der_tests --- testprof/der_tests.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 89f8aa4e6..0d2b9b87b 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -1027,15 +1027,15 @@ static void der_flexi_test(void) static int der_choice_test(void) { ltc_asn1_list types[7], host[1]; - unsigned char bitbuf[10], octetbuf[10], ia5buf[10], printbuf[10], outbuf[256]; - unsigned long integer, oidbuf[10], outlen, inlen, x, y; + unsigned char bitbuf[10], octetbuf[10], ia5buf[10], printbuf[10], outbuf[256], x, y; + unsigned long integer, oidbuf[10], outlen, inlen; void *mpinteger; ltc_utctime utctime = { 91, 5, 6, 16, 45, 40, 1, 7, 0 }; ltc_generalizedtime gtime = { 2038, 01, 19, 3, 14, 8, 0, 0, 0, 0 }; /* setup variables */ - for (x = 0; x < sizeof(bitbuf); x++) { bitbuf[x] = (unsigned char)(x & 1); } - for (x = 0; x < sizeof(octetbuf); x++) { octetbuf[x] = (unsigned char)x; } + for (x = 0; x < sizeof(bitbuf); x++) { bitbuf[x] = x & 1; } + for (x = 0; x < sizeof(octetbuf); x++) { octetbuf[x] = x; } for (x = 0; x < sizeof(ia5buf); x++) { ia5buf[x] = 'a'; } for (x = 0; x < sizeof(printbuf); x++) { printbuf[x] = 'a'; } integer = 1; From 9d2b352867822c6b0639abc89a9694bd66a0aa05 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 23:23:31 +0200 Subject: [PATCH 0718/1192] fix ulong64 related format errors --- testprof/der_tests.c | 4 ++-- testprof/x86_prof.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index 0d2b9b87b..f3713f567 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -1073,11 +1073,11 @@ static int der_choice_test(void) for (y = 0; y < 7; y++) { if (types[y].used && y != (x>6?x-7:x)) { - fprintf(stderr, "CHOICE, flag %lu in trial %lu was incorrectly set to one\n", y, x); + fprintf(stderr, "CHOICE, flag %u in trial %u was incorrectly set to one\n", y, x); return 1; } if (!types[y].used && y == (x>6?x-7:x)) { - fprintf(stderr, "CHOICE, flag %lu in trial %lu was incorrectly set to zero\n", y, x); + fprintf(stderr, "CHOICE, flag %u in trial %u was incorrectly set to zero\n", y, x); return 1; } } diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 671ecb2d4..09f8f4aea 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -111,12 +111,12 @@ void tally_results(int type) } else if (type == 1) { for (x = 0; x < no_results; x++) { printf - ("%-20s[%3d]: Encrypt at %5lu, Decrypt at %5lu\n", cipher_descriptor[results[x].id].name, cipher_descriptor[results[x].id].ID, results[x].spd1, results[x].spd2); + ("%-20s[%3d]: Encrypt at %5"PRI64"u, Decrypt at %5"PRI64"u\n", cipher_descriptor[results[x].id].name, cipher_descriptor[results[x].id].ID, results[x].spd1, results[x].spd2); } } else { for (x = 0; x < no_results; x++) { printf - ("%-20s: Process at %5lu\n", hash_descriptor[results[x].id].name, results[x].spd1 / 1000); + ("%-20s: Process at %5"PRI64"u\n", hash_descriptor[results[x].id].name, results[x].spd1 / 1000); } } } From ef6223f01359b762b3116b39e13e9122bc202c25 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 10 May 2017 19:32:57 +0200 Subject: [PATCH 0719/1192] fix `misleading-indentation` warnings (mingw + gcc 7.1 + `-Wall -Wextra`) --- testprof/der_tests.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index f3713f567..c2141e681 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -1166,9 +1166,12 @@ int der_tests(void) DO(der_encode_short_integer(mp_get_int(a), buf[1], &y)); if (x != y || memcmp(buf[0], buf[1], x)) { fprintf(stderr, "DER INTEGER short encoding failed, %lu, %lu, 0x%lX\n", x, y, mp_get_int(a)); - for (zz = 0; zz < z; zz++) fprintf(stderr, "%02x ", buf[2][zz]); fprintf(stderr, "\n"); - for (z = 0; z < x; z++) fprintf(stderr, "%02x ", buf[0][z]); fprintf(stderr, "\n"); - for (z = 0; z < y; z++) fprintf(stderr, "%02x ", buf[1][z]); fprintf(stderr, "\n"); + for (zz = 0; zz < z; zz++) fprintf(stderr, "%02x ", buf[2][zz]); + fprintf(stderr, "\n"); + for (z = 0; z < x; z++) fprintf(stderr, "%02x ", buf[0][z]); + fprintf(stderr, "\n"); + for (z = 0; z < y; z++) fprintf(stderr, "%02x ", buf[1][z]); + fprintf(stderr, "\n"); mp_clear_multi(a, b, c, d, e, f, g, NULL); return 1; } @@ -1280,7 +1283,8 @@ int der_tests(void) } if (memcmp(oid[0], oid[1], sizeof(oid[0][0]) * z)) { fprintf(stderr, "Random OID %lu test failed, decoded values wrong\n", z); - for (x = 0; x < z; x++) fprintf(stderr, "%lu\n", oid[0][x]); fprintf(stderr, "\n\n Got \n\n"); + for (x = 0; x < z; x++) fprintf(stderr, "%lu\n", oid[0][x]); + fprintf(stderr, "\n\n Got \n\n"); for (x = 0; x < z; x++) fprintf(stderr, "%lu\n", oid[1][x]); return 1; } @@ -1329,9 +1333,9 @@ int der_tests(void) DO(der_encode_utctime((ltc_utctime*)&rsa_time1, buf[0], &x)); if (x != sizeof(rsa_time1_der) || memcmp(buf[0], rsa_time1_der, x)) { fprintf(stderr, "UTCTIME encode of rsa_time1 failed: %lu, %lu\n", x, (unsigned long)sizeof(rsa_time1_der)); -fprintf(stderr, "\n\n"); -for (y = 0; y < x; y++) fprintf(stderr, "%02x ", buf[0][y]); printf("\n"); - + fprintf(stderr, "\n\n"); + for (y = 0; y < x; y++) fprintf(stderr, "%02x ", buf[0][y]); + fprintf(stderr, "\n"); return 1; } DO(der_length_utctime((ltc_utctime*)&rsa_time1, &y)); @@ -1359,9 +1363,9 @@ tmp_time.off_hh); DO(der_encode_utctime((ltc_utctime*)&rsa_time2, buf[0], &x)); if (x != sizeof(rsa_time2_der) || memcmp(buf[0], rsa_time2_der, x)) { fprintf(stderr, "UTCTIME encode of rsa_time2 failed: %lu, %lu\n", x, (unsigned long)sizeof(rsa_time1_der)); -fprintf(stderr, "\n\n"); -for (y = 0; y < x; y++) fprintf(stderr, "%02x ", buf[0][y]); printf("\n"); - + fprintf(stderr, "\n\n"); + for (y = 0; y < x; y++) fprintf(stderr, "%02x ", buf[0][y]); + fprintf(stderr, "\n"); return 1; } DO(der_length_utctime((ltc_utctime*)&rsa_time2, &y)); @@ -1394,7 +1398,8 @@ tmp_time.off_hh); DO(der_length_utf8_string(utf8_1, sizeof(utf8_1) / sizeof(utf8_1[0]), &y)); if (x != sizeof(utf8_1_der) || memcmp(utf8_buf, utf8_1_der, x) || x != y) { fprintf(stderr, "DER UTF8_1 encoded to %lu bytes\n", x); - for (y = 0; y < x; y++) fprintf(stderr, "%02x ", (unsigned)utf8_buf[y]); fprintf(stderr, "\n"); + for (y = 0; y < x; y++) fprintf(stderr, "%02x ", (unsigned)utf8_buf[y]); + fprintf(stderr, "\n"); return 1; } /* decode it */ @@ -1402,7 +1407,8 @@ tmp_time.off_hh); DO(der_decode_utf8_string(utf8_buf, x, utf8_out, &y)); if (y != (sizeof(utf8_1) / sizeof(utf8_1[0])) || memcmp(utf8_1, utf8_out, y * sizeof(wchar_t))) { fprintf(stderr, "DER UTF8_1 decoded to %lu wchar_t\n", y); - for (x = 0; x < y; x++) fprintf(stderr, "%04lx ", (unsigned long)utf8_out[x]); fprintf(stderr, "\n"); + for (x = 0; x < y; x++) fprintf(stderr, "%04lx ", (unsigned long)utf8_out[x]); + fprintf(stderr, "\n"); return 1; } @@ -1411,7 +1417,8 @@ tmp_time.off_hh); DO(der_encode_utf8_string(utf8_2, sizeof(utf8_2) / sizeof(utf8_2[0]), utf8_buf, &x)); if (x != sizeof(utf8_2_der) || memcmp(utf8_buf, utf8_2_der, x)) { fprintf(stderr, "DER UTF8_2 encoded to %lu bytes\n", x); - for (y = 0; y < x; y++) fprintf(stderr, "%02x ", (unsigned)utf8_buf[y]); fprintf(stderr, "\n"); + for (y = 0; y < x; y++) fprintf(stderr, "%02x ", (unsigned)utf8_buf[y]); + fprintf(stderr, "\n"); return 1; } /* decode it */ @@ -1419,7 +1426,8 @@ tmp_time.off_hh); DO(der_decode_utf8_string(utf8_buf, x, utf8_out, &y)); if (y != (sizeof(utf8_2) / sizeof(utf8_2[0])) || memcmp(utf8_2, utf8_out, y * sizeof(wchar_t))) { fprintf(stderr, "DER UTF8_2 decoded to %lu wchar_t\n", y); - for (x = 0; x < y; x++) fprintf(stderr, "%04lx ", (unsigned long)utf8_out[x]); fprintf(stderr, "\n"); + for (x = 0; x < y; x++) fprintf(stderr, "%04lx ", (unsigned long)utf8_out[x]); + fprintf(stderr, "\n"); return 1; } From 786853cb5c288a13e9e5db86ebf103f0e02dd43b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 11 May 2017 17:42:33 +0200 Subject: [PATCH 0720/1192] move #if defined(LTC_BASE64) --- testprof/base64_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testprof/base64_test.c b/testprof/base64_test.c index fd344da59..a54a5ac17 100644 --- a/testprof/base64_test.c +++ b/testprof/base64_test.c @@ -6,12 +6,12 @@ int base64_test(void) unsigned char in[64], out[256], tmp[64]; unsigned long x, l1, l2, slen1; -#if defined(LTC_BASE64) const unsigned char special_case[] = { 0xbe, 0xe8, 0x92, 0x3c, 0xa2, 0x25, 0xf0, 0xf8, 0x91, 0xe4, 0xef, 0xab, 0x0b, 0x8c, 0xfd, 0xff, 0x14, 0xd0, 0x29, 0x9d, 0x00 }; +#if defined(LTC_BASE64) /* TEST CASES SOURCE: From 43e46a2efc7a6cc09b0a19c3e5845717a7e307c0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 11 May 2017 20:37:06 +0200 Subject: [PATCH 0721/1192] fix clang static analyzer warnings/errors - see #217 --- demos/hashsum.c | 2 +- demos/tv_gen.c | 4 ++++ src/ciphers/anubis.c | 2 +- src/encauth/ccm/ccm_memory.c | 2 +- src/pk/asn1/der/utctime/der_decode_utctime.c | 2 +- testprof/rsa_test.c | 6 +++--- testprof/x86_prof.c | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 9bdac6653..8a864fb75 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -104,7 +104,7 @@ static void check_file(int argn, int argc, char **argv) space++; for (n = 0; n < (buf + sizeof(buf)) - space; ++n) { - if(iscntrl(space[n])) { + if(iscntrl((int)space[n])) { space[n] = '\0'; break; } diff --git a/demos/tv_gen.c b/demos/tv_gen.c index e754a7dfb..5acb28b05 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -723,6 +723,10 @@ void gcm_gen(void) printf("Error GCM'ing: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } + if (len == 0) { + printf("Error GCM'ing: zero length\n"); + exit(EXIT_FAILURE); + } fprintf(out, "%3d: ", y1); for (z = 0; z < y1; z++) { fprintf(out, "%02X", plaintext[z]); diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index f81942125..08948cce8 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -899,7 +899,7 @@ int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetri { int N, R, i, pos, r; ulong32 kappa[MAX_N]; - ulong32 inter[MAX_N]; + ulong32 inter[MAX_N] = { 0 }; /* initialize as all zeroes */ ulong32 v, K0, K1, K2, K3; LTC_ARGCHK(key != NULL); diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index 059bf357e..3e1920a8a 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -144,7 +144,7 @@ int ccm_memory(int cipher, } /* initialize buffer for pt */ - if (direction == CCM_DECRYPT) { + if (direction == CCM_DECRYPT && ptlen > 0) { pt_work = XMALLOC(ptlen); if (pt_work == NULL) { goto error; diff --git a/src/pk/asn1/der/utctime/der_decode_utctime.c b/src/pk/asn1/der/utctime/der_decode_utctime.c index ca1279978..d4dc817b1 100644 --- a/src/pk/asn1/der/utctime/der_decode_utctime.c +++ b/src/pk/asn1/der/utctime/der_decode_utctime.c @@ -49,7 +49,7 @@ static int char_to_int(unsigned char x) int der_decode_utctime(const unsigned char *in, unsigned long *inlen, ltc_utctime *out) { - unsigned char buf[32]; + unsigned char buf[32] = { 0 }; /* initialize as all zeroes */ unsigned long x; int y; diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index 94bce206b..c9b9923df 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -530,7 +530,6 @@ for (cnt = 0; cnt < len; ) { for (i = 0; i < 9; ++i) { len = sizeof(in); len2 = sizeof(out); - cnt = rsa_get_size(&key); /* (1) */ DO(rsa_sign_hash_ex(p, 20, p2, &len2, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); /* (2) */ @@ -540,7 +539,8 @@ for (cnt = 0; cnt < len; ) { /* (3) */ DO(ltc_mp.rsa_me(p2, len2, p3, &len3, PK_PUBLIC, &key)); /* (4) */ -#if 0 +#ifdef LTC_TEST_DBG + cnt = rsa_get_size(&key); printf("\nBefore:"); for (cnt = 0; cnt < len3; ++cnt) { if (cnt%32 == 0) @@ -563,7 +563,7 @@ for (cnt = 0; cnt < len; ) { for (cnt = cnt + len3-cnt2+i; cnt < len; ++cnt) { p3[cnt] = 0; } -#if 0 +#ifdef LTC_TEST_DBG printf("\nAfter:"); for (cnt = 0; cnt < len3; ++cnt) { if (cnt%32 == 0) diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 09f8f4aea..4ada14f39 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -1487,7 +1487,7 @@ void time_macs_(unsigned long MAC_SIZE) if (cipher_idx == -1 || hash_idx == -1) { fprintf(stderr, "Warning the MAC tests requires AES and SHA1 to operate... so sorry\n"); - return; + exit(EXIT_FAILURE); } yarrow_read(buf, MAC_SIZE*1024, &yarrow_prng); From d21d01bcb58d6588707b8c49c480e9d2658ace19 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 May 2017 10:33:39 +0200 Subject: [PATCH 0722/1192] consolidate makefiles a bit --- makefile | 5 ----- makefile.include | 7 +++++++ makefile.shared | 9 +++------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index 64ec249e5..ea18e6721 100644 --- a/makefile +++ b/makefile @@ -5,11 +5,6 @@ include makefile.include -# The version -VERSION=1.17 - -PLATFORM := $(shell uname | sed -e 's/_.*//') - ifeq ($V,1) silent= silent_stdout= diff --git a/makefile.include b/makefile.include index a2256c6c3..1d1cfdeb2 100644 --- a/makefile.include +++ b/makefile.include @@ -2,6 +2,13 @@ # Include makefile for libtomcrypt # +# The version +VERSION=1.17 +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +VERSION_LT=0:117 + +PLATFORM := $(shell uname | sed -e 's/_.*//') + # Compiler and Linker Names ifndef PREFIX PREFIX:= diff --git a/makefile.shared b/makefile.shared index 2932ddab1..4101e5d4c 100644 --- a/makefile.shared +++ b/makefile.shared @@ -7,9 +7,6 @@ include makefile.include -# The version -# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html -VERSION=0:117 LT ?= libtool @@ -212,13 +209,13 @@ library: $(LIBNAME) .PHONY: testprof/$(LIBTEST) testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC="$(CC)" make -f makefile.shared + cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION_LT) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC="$(CC)" make -f makefile.shared .c.o: $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< $(LIBNAME): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_LT) install: $(LIBNAME) install -d $(DESTDIR)$(LIBPATH) @@ -232,7 +229,7 @@ install: $(LIBNAME) install_test: testprof/$(LIBTEST) install -d $(DESTDIR)$(LIBPATH) install -d $(DESTDIR)$(INCPATH) - cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) LT=$(LT) CC=$(CC) make -f makefile.shared install + cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION_LT) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) LT=$(LT) CC=$(CC) make -f makefile.shared install .PHONY: test From 7898864b2408627e9a640fdd90351934b25803d3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 May 2017 10:34:16 +0200 Subject: [PATCH 0723/1192] use glibtool on Macs --- makefile.shared | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/makefile.shared b/makefile.shared index 4101e5d4c..e96a05102 100644 --- a/makefile.shared +++ b/makefile.shared @@ -8,8 +8,13 @@ include makefile.include - -LT ?= libtool +ifndef LT + ifeq ($(PLATFORM), Darwin) + LT:=glibtool + else + LT:=libtool + endif +endif LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) From 7ac857686d62ed01c25583ac6dfb001de13c2e6a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 May 2017 10:35:00 +0200 Subject: [PATCH 0724/1192] add git version as compile flag --- demos/test.c | 6 +++++- makefile.include | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/demos/test.c b/demos/test.c index 689b97654..3474f7e07 100644 --- a/demos/test.c +++ b/demos/test.c @@ -1,5 +1,9 @@ #include +#ifndef GIT_VERSION +#define GIT_VERSION "Undefined version" +#endif + #define LTC_TEST_FN(f) { f, #f } static const struct { @@ -37,7 +41,7 @@ int main(int argc, char **argv) long delta, dur = 0; reg_algs(); - printf("build == \n%s\n", crypt_build_settings); + printf("build == %s\n%s\n", GIT_VERSION, crypt_build_settings); #ifdef USE_LTM ltc_mp = ltm_desc; diff --git a/makefile.include b/makefile.include index 1d1cfdeb2..0e090c00a 100644 --- a/makefile.include +++ b/makefile.include @@ -78,6 +78,12 @@ CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare endif +GIT_VERSION := $(shell [ -e .git ] && { echo -n git- ; git describe --tags --always --dirty ; } || echo $(VERSION)) +ifneq ($(GIT_VERSION),) +CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif + + HASH=hashsum CRYPT=encrypt SMALL=small From 93067e189a146f5667f020c46392aa3054ec6cd8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 2 May 2017 10:43:56 +0200 Subject: [PATCH 0725/1192] fix testprof/makefile.shared --- testprof/makefile.shared | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testprof/makefile.shared b/testprof/makefile.shared index e0302365f..fc22f5989 100644 --- a/testprof/makefile.shared +++ b/testprof/makefile.shared @@ -7,9 +7,9 @@ LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ -dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o +dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ +store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ +pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o multi_test.o ifndef LIBTEST LIBTEST=libtomcrypt_prof.la From 2c97498554a22a673c419365bca1c3896276bb3c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 20:45:41 +0200 Subject: [PATCH 0726/1192] wipe out testprof/makefile* --- testprof/makefile | 43 ---------------------------------------- testprof/makefile.icc | 21 -------------------- testprof/makefile.mingw | 22 -------------------- testprof/makefile.msvc | 15 -------------- testprof/makefile.shared | 27 ------------------------- 5 files changed, 128 deletions(-) delete mode 100644 testprof/makefile delete mode 100644 testprof/makefile.icc delete mode 100644 testprof/makefile.mingw delete mode 100644 testprof/makefile.msvc delete mode 100644 testprof/makefile.shared diff --git a/testprof/makefile b/testprof/makefile deleted file mode 100644 index db7bbd941..000000000 --- a/testprof/makefile +++ /dev/null @@ -1,43 +0,0 @@ -CFLAGS += -I../src/headers -I./ -Wall -W - -# ranlib tools -ifndef RANLIB - RANLIB=ranlib -endif - -ifeq ($V,1) -silent= -else -silent=@ -endif - -%.o: %.c -ifneq ($V,1) - @echo " * ${CC} $@" -endif - ${silent} ${CC} ${CFLAGS} -c $< -o $@ - -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ -dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o multi_test.o - -ifndef LIBTEST_S - LIBTEST_S=libtomcrypt_prof.a -endif - -default: $(LIBTEST_S) - -$(LIBTEST_S): $(OBJECTS) -ifneq ($V,1) - @echo " * ${AR} $@" -endif - ${silent} $(AR) $(ARFLAGS) $@ $(OBJECTS) -ifneq ($V,1) - @echo " * ${RANLIB} $@" -endif - ${silent} $(RANLIB) $@ - -clean: - rm -f *.o *.a *.gcov *.gcda *.gcno - diff --git a/testprof/makefile.icc b/testprof/makefile.icc deleted file mode 100644 index 6ce7b086e..000000000 --- a/testprof/makefile.icc +++ /dev/null @@ -1,21 +0,0 @@ -CFLAGS += -I../src/headers -I./ -CC?=icc - -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ -dsa_test.o ecc_test.o mac_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o misc_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o multi_test.o - -ifndef LIBTEST_S - LIBTEST_S = libtomcrypt_prof.a -endif - -default: $(LIBTEST_S) - -$(LIBTEST_S): $(OBJECTS) - $(AR) $(ARFLAGS) $@ $(OBJECTS) - ranlib $@ - -clean: - rm -f *.o *.a - diff --git a/testprof/makefile.mingw b/testprof/makefile.mingw deleted file mode 100644 index 5d17df2a3..000000000 --- a/testprof/makefile.mingw +++ /dev/null @@ -1,22 +0,0 @@ -# MAKEFILE for use with MS Windows gcc compiler + GNU make (aka mingw32-make) - -# BEWARE: do not run make from testprof directory, run 'gmake ... test' from libtomcrypt root dir - -CFLAGS = $(CFLAGS_OPTS) -I../src/headers -I../../libtommath -I. -Wall -Wextra -DUSE_LTM -DLTM_DESC - -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ -dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o pkcs_1_pss_test.o \ -pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o multi_test.o - -default: $(LIBTEST_S) - -%.o: %.c - ${CC} ${CFLAGS} -c $< -o $@ - -$(LIBTEST_S): $(OBJECTS) - $(AR) $(ARFLAGS) $@ $(OBJECTS) - $(RANLIB) $@ - -clean: - cmd /c del /Q *.o *.a diff --git a/testprof/makefile.msvc b/testprof/makefile.msvc deleted file mode 100644 index 72d32db8b..000000000 --- a/testprof/makefile.msvc +++ /dev/null @@ -1,15 +0,0 @@ -CFLAGS = /I../src/headers/ /I./ /Ox /DWIN32 /DLTC_SOURCE /DUSE_LTM /W3 - -OBJECTS=base64_test.obj cipher_hash_test.obj der_tests.obj no_prng.obj file_test.obj \ -dsa_test.obj ecc_test.obj mac_test.obj modes_test.obj pkcs_1_test.obj \ -rsa_test.obj store_test.obj rotate_test.obj test_driver.obj x86_prof.obj katja_test.obj \ -dh_test.obj misc_test.obj pkcs_1_pss_test.obj pkcs_1_oaep_test.obj \ -pkcs_1_emsa_test.obj pkcs_1_eme_test.obj multi_test.obj - -.c.obj: - $(CC) $(CFLAGS) /c $< /Fo$@ - -tomcrypt_prof.lib: $(OBJECTS) - lib /out:tomcrypt_prof.lib $(OBJECTS) - - diff --git a/testprof/makefile.shared b/testprof/makefile.shared deleted file mode 100644 index fc22f5989..000000000 --- a/testprof/makefile.shared +++ /dev/null @@ -1,27 +0,0 @@ -ifeq ($(CC),cc) - CC = gcc -endif -LT ?= libtool -LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) - -CFLAGS += -I../src/headers -I./ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter - -OBJECTS = base64_test.o cipher_hash_test.o der_tests.o no_prng.o file_test.o \ -dsa_test.o ecc_test.o mac_test.o misc_test.o modes_test.o pkcs_1_test.o rsa_test.o \ -store_test.o rotate_test.o test_driver.o x86_prof.o katja_test.o dh_test.o \ -pkcs_1_pss_test.o pkcs_1_oaep_test.o pkcs_1_emsa_test.o pkcs_1_eme_test.o multi_test.o - -ifndef LIBTEST - LIBTEST=libtomcrypt_prof.la -endif - -default: $(LIBTEST) - -.c.o: - $(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $< - -$(LIBTEST): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) `find . -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION) - -install: $(LIBTEST) - $(LT) --mode=install install -c $(LIBTEST) $(DESTDIR)$(LIBPATH)/$(LIBTEST) From bf45ea66e5b95b993c616bb00f741c6c27771084 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 20:47:00 +0200 Subject: [PATCH 0727/1192] drop the need for testprof/makefile* --- helper.pl | 75 ++++++++++++++++++++++++++--------------------- libtomcrypt.pc.in | 6 ++-- makefile | 63 ++++++++++++++++++++++++--------------- makefile.icc | 46 +++++++++++++++++------------ makefile.include | 23 +++++---------- makefile.mingw | 48 ++++++++++++++++++------------ makefile.msvc | 26 +++++++++------- makefile.shared | 47 +++++++++++++++++------------ 8 files changed, 189 insertions(+), 145 deletions(-) diff --git a/helper.pl b/helper.pl index 95b59a642..b871e67ec 100755 --- a/helper.pl +++ b/helper.pl @@ -201,24 +201,27 @@ sub prepare_msvc_files_xml { } sub patch_makefile { - my ($in_ref, $out_ref, $data) = @_; - open(my $src, '<', $in_ref); - open(my $dst, '>', $out_ref); - my $l = 0; - while (<$src>) { - if ($_ =~ /START_INS/) { - print {$dst} $_; - $l = 1; - print {$dst} $data; - } elsif ($_ =~ /END_INS/) { - print {$dst} $_; - $l = 0; - } elsif ($l == 0) { - print {$dst} $_; + my ($content, @variables) = @_; + for my $v (@variables) { + if ($v =~ /^([A-Z0-9_]+)\s*=.*$/si) { + my $name = $1; + $content =~ s/\n\Q$name\E\b.*?[^\\]\n/\n$v\n/s; } + else { + die "patch_makefile failed: " . substr($v, 0, 30) . ".."; + } + } + return $content; +} + +sub version_form_tomcrypt_h { + my $h = read_file(shift); + if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)"/s) { + return "VERSION_MAJ=$1", "VERSION_MIN=$2", "VERSION=$1.$2", "VERSION_LT=0:$1$2"; + } + else { + die "#define SCRYPT not found in tomcrypt.h"; } - close $dst; - close $src; } sub process_makefiles { @@ -230,12 +233,20 @@ sub process_makefiles { find({ no_chdir => 1, wanted => sub { push @h, $_ if -f $_ && $_ =~ /\.h$/ && $_ !~ /dh_static.h$/ } }, 'src'); my @all = (); find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src'); + my @t = qw(); + find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(no_prng|test_driver|x86_prof|_tests?).c$/ } }, 'testprof'); my @o = sort ('src/ciphers/aes/aes_enc.o', map { $_ =~ s/\.c$/.o/; $_ } @c); - my $var_o = prepare_variable("OBJECTS", @o); + my $var_o = prepare_variable("OBJECTS", @o); + my $var_h = prepare_variable("HEADERS", (sort @h)); (my $var_obj = $var_o) =~ s/\.o\b/.obj/sg; - my $var_h = prepare_variable("HEADERS", (sort @h, 'testprof/tomcrypt_test.h')); + my $var_to = prepare_variable("TOBJECTS", sort map { $_ =~ s/\.c$/.o/; $_ } @t); + (my $var_tobj = $var_to) =~ s/\.o\b/.obj/sg; + + my @ver_version = version_form_tomcrypt_h("src/headers/tomcrypt.h"); + + # update MSVC project files my $msvc_files = prepare_msvc_files_xml(\@all, qr/tab\.c$/, ['Debug|Win32', 'Release|Win32', 'Debug|x64', 'Release|x64']); for my $m (qw/libtomcrypt_VS2008.vcproj/) { my $old = read_file($m); @@ -248,22 +259,18 @@ sub process_makefiles { } } - my @makefiles = qw( makefile makefile.icc makefile.shared makefile.unix makefile.mingw makefile.msvc ); - for my $m (@makefiles) { + # update OBJECTS + HEADERS in makefile* + for my $m (qw/ makefile makefile.icc makefile.shared makefile.unix makefile.mingw makefile.msvc makefile.include /) { my $old = read_file($m); - my $new; - if ($m eq 'makefile.msvc') { - patch_makefile(\$old, \$new, "$var_obj\n\n$var_h\n\n"); - } - else { - patch_makefile(\$old, \$new, "$var_o\n\n$var_h\n\n"); - } + my $new = $m eq 'makefile.msvc' ? patch_makefile($old, $var_obj, $var_h, $var_to, @ver_version) + : patch_makefile($old, $var_o, $var_h, $var_to, @ver_version); if ($old ne $new) { write_file($m, $new) if $write; warn "changed: $m\n"; $changed_count++; } } + if ($write) { return 0; # no failures } @@ -283,13 +290,13 @@ sub die_usage { MARKER } -GetOptions( "check-source" => \my $check_source, - "check-defines" => \my $check_defines, - "check-hashes" => \my $check_hashes, - "check-makefiles" => \my $check_makefiles, - "check-all" => \my $check_all, - "update-makefiles" => \my $update_makefiles, - "help" => \my $help +GetOptions( "s|check-source" => \my $check_source, + "d|check-defines" => \my $check_defines, + "h|check-hashes" => \my $check_hashes, + "m|check-makefiles" => \my $check_makefiles, + "a|check-all" => \my $check_all, + "u|update-makefiles" => \my $update_makefiles, + "h|help" => \my $help ) or die_usage; my $failure; diff --git a/libtomcrypt.pc.in b/libtomcrypt.pc.in index a0e889f7a..714f06048 100644 --- a/libtomcrypt.pc.in +++ b/libtomcrypt.pc.in @@ -1,10 +1,10 @@ -prefix=/usr +prefix=@to-be-replaced@ exec_prefix=${prefix} -libdir=@LIBDIR@ +libdir=${exec_prefix}/lib includedir=${prefix}/include Name: LibTomCrypt Description: public domain open source cryptographic toolkit -Version: 1.17 +Version: @to-be-replaced@ Libs: -L${libdir} -ltomcrypt Cflags: -I${includedir} diff --git a/makefile b/makefile index ea18e6721..2206e0057 100644 --- a/makefile +++ b/makefile @@ -35,10 +35,8 @@ endif ifndef LIBTEST LIBTEST=libtomcrypt_prof.a endif -LIBTEST_S=$(LIBTEST) -#List of objects to compile. -#START_INS +# List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ @@ -190,13 +188,20 @@ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o +# List of test objects to compile (all goes to libtomcrypt_prof.a) +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ +testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ +testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ +testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ +testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o + +# The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h - -#END_INS +src/headers/tomcrypt_prng.h #Files left over from making the crypt.pdf. LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof @@ -223,7 +228,9 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) +#Dependencies on *.h $(OBJECTS): $(HEADERS) +$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h $(LIBNAME): $(OBJECTS) ifneq ($V,1) @@ -235,22 +242,27 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -.PHONY: testprof/$(LIBTEST) -testprof/$(LIBTEST): - ${silent} CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" RANLIB="$(RANLIB)" V="$(V)" $(MAKE) -C testprof +$(LIBTEST): $(TOBJECTS) +ifneq ($V,1) + @echo " * ${AR} $@" +endif + ${silent} $(AR) $(ARFLAGS) $@ $(TOBJECTS) +ifneq ($V,1) + @echo " * ${RANLIB} $@" +endif + ${silent} $(RANLIB) $@ -timing: library testprof/$(LIBTEST) $(TIMINGS) +timing: library $(LIBTEST) $(TIMINGS) ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) + ${silent} $(CC) $(LDFLAGS) $(TIMINGS) $(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) -.PHONY: test -test: library testprof/$(LIBTEST) $(TESTS) +test: library $(LIBTEST) $(TESTS) ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TEST) + ${silent} $(CC) $(LDFLAGS) $(TESTS) $(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TEST) # build the demos from a template define DEMO_template @@ -277,19 +289,20 @@ install: library docs else install: library endif - install -d $(DESTDIR)$(LIBPATH) - install -d $(DESTDIR)$(INCPATH) - install -d $(DESTDIR)$(DATAPATH) - install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH) - install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) + install -d $(LIBPATH) + install -d $(INCPATH) + install -d $(DATAPATH) + install -m 644 $(LIBNAME) $(LIBPATH) + install -m 644 $(HEADERS) $(INCPATH) ifndef NODOCS - install -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH) + install -m 644 doc/crypt.pdf $(DATAPATH) endif -install_test: testprof/$(LIBTEST) - install -d $(DESTDIR)$(LIBPATH) - install -d $(DESTDIR)$(INCPATH) - install -m 644 testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) +install_test: $(LIBTEST) + install -d $(LIBPATH) + install -d $(INCPATH) + install -m 644 $(LIBTEST) $(LIBPATH) + install -m 644 testprof/tomcrypt_test.h $(INCPATH) install_hooks: for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done @@ -342,6 +355,8 @@ clean: rm -f `find . -type f -name "*.obj" | xargs` rm -f `find . -type f -name "*.lib" | xargs` rm -f `find . -type f -name "*.exe" | xargs` + rm -f `find . -type f -name "*.dll" | xargs` + rm -f `find . -type f -name "*.so" | xargs` rm -f `find . -type f -name "*.gcov" | xargs` rm -f `find . -type f -name "*.gcda" | xargs` rm -f `find . -type f -name "*.gcno" | xargs` diff --git a/makefile.icc b/makefile.icc index 590c07552..445069eeb 100644 --- a/makefile.icc +++ b/makefile.icc @@ -70,7 +70,6 @@ ifndef LIBNAME endif ifndef LIBTEST LIBTEST=libtomcrypt_prof.a - LIBTEST_S=$(LIBTEST) endif HASH=hashsum CRYPT=encrypt @@ -96,8 +95,7 @@ ifndef DATAPATH DATAPATH=/usr/share/doc/libtomcrypt/pdf endif -#List of objects to compile. -#START_INS +# List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ @@ -249,13 +247,20 @@ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o +# List of test objects to compile (all goes to libtomcrypt_prof.a) +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ +testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ +testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ +testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ +testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o + +# The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h - -#END_INS +src/headers/tomcrypt_prng.h #Who do we install as? ifdef INSTALL_USER @@ -297,9 +302,13 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) -.PHONY: testprof/$(LIBTEST) -testprof/$(LIBTEST): - cd testprof ; LIBTEST_S=$(LIBTEST) CFLAGS="$(CFLAGS)" CC="$(CC)" AR="$(AR)" $(MAKE) -f makefile.icc +#Dependencies on *.h +$(OBJECTS): $(HEADERS) +$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h + +$(LIBTEST): $(TOBJECTS) + $(AR) $(ARFLAGS) $@ $(TOBJECTS) + $(RANLIB) $@ $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) @@ -320,12 +329,11 @@ small: library $(SMALLOBJECTS) tv_gen: library $(TVS) $(CC) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) -timing: library $(TIMINGS) testprof/$(LIBTEST) - $(CC) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) +timing: library $(TIMINGS) $(LIBTEST) + $(CC) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) -.PHONY: test -test: library $(TESTS) testprof/$(LIBTEST) - $(CC) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +test: library $(TESTS) $(LIBTEST) + $(CC) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) all_test: test tv_gen hashsum crypt small timing @@ -333,11 +341,11 @@ all_test: test tv_gen hashsum crypt small timing #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. install: library - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) - install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH) - install -g $(GROUP) -o $(USER) $(LIBTEST) $(DESTDIR)$(LIBPATH) - install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) + install -d -g $(GROUP) -o $(USER) $(LIBPATH) + install -d -g $(GROUP) -o $(USER) $(INCPATH) + install -g $(GROUP) -o $(USER) $(LIBNAME) $(LIBPATH) + install -g $(GROUP) -o $(USER) $(LIBTEST) $(LIBPATH) + install -g $(GROUP) -o $(USER) $(HEADERS) $(INCPATH) # $Source$ # $Revision$ diff --git a/makefile.include b/makefile.include index 0e090c00a..d1103acba 100644 --- a/makefile.include +++ b/makefile.include @@ -98,22 +98,13 @@ DEMOS=hashsum crypt small tv_gen sizes constants TIMINGS=demos/timing.o TESTS=demos/test.o -#LIBPATH-The directory for libtomcrypt to be installed to. -#INCPATH-The directory to install the header files for libtomcrypt. -#DATAPATH-The directory to install the pdf docs. -ifndef DESTDIR - DESTDIR= -endif - -ifndef LIBPATH - LIBPATH=/usr/lib -endif -ifndef INCPATH - INCPATH=/usr/include -endif -ifndef DATAPATH - DATAPATH=/usr/share/doc/libtomcrypt/pdf -endif +#LIBPATH The directory for libtomcrypt to be installed to. +#INCPATH The directory to install the header files for libtomcrypt. +#DATAPATH The directory to install the pdf docs. +DESTDIR ?= /usr/local +LIBPATH ?= $(DESTDIR)/lib +INCPATH ?= $(DESTDIR)/include +DATAPATH ?= $(DESTDIR)/share/doc/libtomcrypt/pdf #Who do we install as? ifdef INSTALL_USER diff --git a/makefile.mingw b/makefile.mingw index b1eaa2fc4..67a4ffcd6 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -32,8 +32,7 @@ INSTPREFIX=c:\devel-libtom LIBPATH=$(INSTPREFIX)\lib INCPATH=$(INSTPREFIX)\include -#List of objects to compile. -#START_INS +# List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ @@ -185,13 +184,20 @@ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o +# List of test objects to compile (all goes to libtomcrypt_prof.a) +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ +testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ +testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ +testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ +testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o + +# The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h - -#END_INS +src/headers/tomcrypt_prng.h TESTOBJECTS=demos/test.o HASHOBJECTS=demos/hashsum.o @@ -220,9 +226,13 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) -.PHONY: testprof/$(LIBTEST) -testprof/$(LIBTEST): - $(MAKE) -C testprof -f makefile.mingw LIBTEST_S=$(LIBTEST) CC=$(CC) LD=$(LD) AR=$(AR) ARFLAGS=$(ARFLAGS) RANLIB=$(RANLIB) +#Dependencies on *.h +$(OBJECTS): $(HEADERS) +$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h + +$(LIBTEST): $(TOBJECTS) + $(AR) $(ARFLAGS) $@ $(TOBJECTS) + $(RANLIB) $@ %.o: %.c ${CC} ${CFLAGS} -c $< -o $@ @@ -246,24 +256,24 @@ small: library $(SMALLOBJECTS) tv_gen: library $(TVS) $(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) -timing: library testprof/$(LIBTEST) $(TIMINGS) - $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) +timing: library $(LIBTEST) $(TIMINGS) + $(CC) $(LDFLAGS) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) .PHONY: test -test: library testprof/$(LIBTEST) $(TESTS) - $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +test: library $(LIBTEST) $(TESTS) + $(CC) $(LDFLAGS) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) all_test: test tv_gen hashsum crypt small timing install: library - cmd /c if not exist "$(DESTDIR)$(LIBPATH)" mkdir "$(DESTDIR)$(LIBPATH)" - cmd /c if not exist "$(DESTDIR)$(INCPATH)" mkdir "$(DESTDIR)$(INCPATH)" - copy /Y $(LIBNAME) "$(DESTDIR)$(LIBPATH)" - copy /Y src\headers\tomcrypt*.h "$(DESTDIR)$(INCPATH)" + cmd /c if not exist "$(LIBPATH)" mkdir "$(LIBPATH)" + cmd /c if not exist "$(INCPATH)" mkdir "$(INCPATH)" + copy /Y $(LIBNAME) "$(LIBPATH)" + copy /Y src\headers\tomcrypt*.h "$(INCPATH)" -install_test: testprof/$(LIBTEST) - cmd /c if not exist "$(DESTDIR)$(LIBPATH)" mkdir "$(DESTDIR)$(LIBPATH)" - copy /Y testprof\$(LIBTEST) "$(DESTDIR)$(LIBPATH)" +install_test: $(LIBTEST) + cmd /c if not exist "$(LIBPATH)" mkdir "$(LIBPATH)" + copy /Y testprof\$(LIBTEST) "$(LIBPATH)" clean: cmd /c del /Q /S *.o *.a *.exe diff --git a/makefile.msvc b/makefile.msvc index e4894c70e..eae515f03 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -8,7 +8,7 @@ EXTRAINCLUDE=../libtommath CFLAGS = /nologo /Isrc/headers/ /I$(EXTRAINCLUDE) /Itestprof/ /Ox /D_CRT_SECURE_NO_WARNINGS /DUSE_LTM /DLTM_DESC /DLTC_SOURCE /DLTC_NO_PROTOTYPES /W3 $(CF) -#START_INS +# List of objects to compile (all goes to libtomcrypt.lib) OBJECTS=src/ciphers/aes/aes.obj src/ciphers/aes/aes_enc.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \ src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \ src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \ @@ -160,13 +160,20 @@ src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/st src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128.obj \ src/stream/sober128/sober128_test.obj +# List of test objects to compile (all goes to libtomcrypt_prof.lib) +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ +testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ +testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ +testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ +testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o + +# The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h - -#END_INS +src/headers/tomcrypt_prng.h default: library @@ -177,11 +184,9 @@ default: library src/ciphers/aes/aes_enc.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(CC) $(CFLAGS) /DENCRYPT_ONLY /c src/ciphers/aes/aes.c /Fosrc/ciphers/aes/aes_enc.obj -library: $(OBJECTS) +library: $(OBJECTS) $(TOBJECTS) lib /out:tomcrypt.lib $(OBJECTS) - cd testprof - nmake -f makefile.msvc - cd .. + lib /out:tomcrypt_prof.lib $(TOBJECTS) tv_gen: demos/tv_gen.c library cl $(CFLAGS) demos/tv_gen.c tomcrypt.lib advapi32.lib $(EXTRALIBS) @@ -189,12 +194,11 @@ tv_gen: demos/tv_gen.c library hashsum: demos/hashsum.c library cl $(CFLAGS) demos/hashsum.c tomcrypt.lib advapi32.lib $(EXTRALIBS) -.PHONY: test test: demos/test.c library - cl $(CFLAGS) demos/test.c testprof/tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) + cl $(CFLAGS) demos/test.c tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) timing: demos/timing.c library - cl $(CFLAGS) demos/timing.c testprof/tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) + cl $(CFLAGS) demos/timing.c tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) all_test: test tv_gen hashsum timing diff --git a/makefile.shared b/makefile.shared index e96a05102..3e888c58a 100644 --- a/makefile.shared +++ b/makefile.shared @@ -185,11 +185,20 @@ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o +# List of test objects to compile (all goes to libtomcrypt_prof.a) +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ +testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ +testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ +testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ +testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o + +# The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h +src/headers/tomcrypt_prng.h #END_INS @@ -198,7 +207,7 @@ default:library #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - $(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o + $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o #These are the rules to make certain object files. src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c @@ -212,39 +221,39 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #This rule makes the libtomcrypt library. library: $(LIBNAME) -.PHONY: testprof/$(LIBTEST) -testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION_LT) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC="$(CC)" make -f makefile.shared +#Dependencies on *.h +$(OBJECTS): $(HEADERS) +$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h .c.o: $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< $(LIBNAME): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_LT) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) + +$(LIBTEST): $(TOBJECTS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) install: $(LIBNAME) - install -d $(DESTDIR)$(LIBPATH) - $(LT) --mode=install install -c libtomcrypt.la $(DESTDIR)$(LIBPATH)/libtomcrypt.la - install -d $(DESTDIR)$(INCPATH) - install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) - install -d $(DESTDIR)$(LIBPATH)/pkgconfig - sed 's,@LIBDIR@,$(LIBPATH),g' libtomcrypt.pc.in > libtomcrypt.pc - install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc + install -d $(LIBPATH)/pkgconfig + install -d $(INCPATH) + $(LT) --mode=install install -c $(LIBNAME) $(LIBPATH)/$(LIBNAME) + install -m 644 $(HEADERS) $(INCPATH) + sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(LIBPATH)/pkgconfig/libtomcrypt.pc + install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/libtomcrypt.pc install_test: testprof/$(LIBTEST) - install -d $(DESTDIR)$(LIBPATH) - install -d $(DESTDIR)$(INCPATH) - cd testprof ; CFLAGS="$(CFLAGS)" VERSION=$(VERSION_LT) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) DESTDIR=$(DESTDIR) LT=$(LT) CC=$(CC) make -f makefile.shared install + install -d $(LIBPATH) + install -d $(INCPATH) + install -m 644 testprof/tomcrypt_test.h $(INCPATH) + $(LT) --mode=install install -c $(LIBTEST) $(LIBPATH)/$(LIBTEST) - -.PHONY: test test: library testprof/$(LIBTEST) $(TESTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) timing: library testprof/$(LIBTEST) $(TIMINGS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) - # build the demos from a template define DEMO_template $(1): demos/$(1).o library From bb4a051e400c5f070006db8c78f3c88b9934e03d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 20:54:41 +0200 Subject: [PATCH 0728/1192] makefile.unix facelift --- makefile.unix | 201 ++++++++++++++++++++++++++------------------------ 1 file changed, 105 insertions(+), 96 deletions(-) diff --git a/makefile.unix b/makefile.unix index ddced572d..cda26ea0a 100644 --- a/makefile.unix +++ b/makefile.unix @@ -1,44 +1,46 @@ -# MAKEFILE for bsd make +# MAKEFILE that is intended to be compatible with any kind of make (GNU make, BDS make , ...) # -# Tom St Denis +# Please do not use here neither any special make syntax nor any unusual tools/utilities! -# Compiler and Linker Names -CC=cc -LD=ld - -# Archiver [makes .a files] -AR=ar -ARFLAGS=r - -# Compilation flags. Note the += does not write over the user's CFLAGS! -CFLAGS = -c -I./testprof/ -I./src/headers/ -DLTC_SOURCE -O2 ${CFLAGS_OPTS} -o $@ - -LIBNAME=libtomcrypt.a -LIBTEST=libtomcrypt_prof.a -LIBTEST_S=$(LIBTEST) - -HASH=hashsum -CRYPT=encrypt -SMALL=small -PROF=x86_prof -TV=tv_gen -TIMING=timing -TEST=test +### USAGE: +# +# make -f makefile.unix all +# ./test +# make -f makefile.unix install +# +#OR: +# +# make -f makefile.unix CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all +# ./test +# make -f makefile.unix DESTDIR=/opt/libtom install +# -#LIBPATH-The directory for libtomcrypt to be installed to. -#INCPATH-The directory to install the header files for libtomcrypt. -#DATAPATH-The directory to install the pdf docs. -LIBPATH=/usr/local/lib -INCPATH=/usr/local/include -DATAPATH=/usr/local/share/doc/libtomcrypt/pdf +#The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs" +CC ?= cc +LD ?= ld +AR ?= ar +ARFLAGS ?= r +RANLIB ?= ranlib +CFLAGS ?= -O2 -DUSE_LTM -DLTM_DESC -I../libtommath +EXTRALIBS ?= ../libtommath/libtommath.a +DESTDIR ?= /usr/local -#Who do we install as? -USER=root +#Compilation flags +LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE +LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) +VERSION=1.17 +VERSION_MAJ=1 +VERSION_MIN=17 -GROUP=wheel +#Libraries to be created +LIBMAIN_S =libtomcrypt.a +LIBTEST_S =libtomcrypt_prof.a +LIBMAIN_D =libtomcrypt.so.0.0.$(VERSION_MAJ)$(VERSION_MIN) +#The following will be symlinks to $(LIBMAIN_D) +LIBMAIN_L1=libtomcrypt.so.0 +LIBMAIN_L2=libtomcrypt.so -#List of objects to compile. -#START_INS +# List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ @@ -190,36 +192,35 @@ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o +# List of test objects to compile (all goes to libtomcrypt_prof.a) +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ +testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ +testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ +testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ +testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o + +# The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h - -#END_INS +src/headers/tomcrypt_prng.h -TESTOBJECTS=demos/test.o -HASHOBJECTS=demos/hashsum.o -CRYPTOBJECTS=demos/encrypt.o -SMALLOBJECTS=demos/small.o -TVS=demos/tv_gen.o -TIMINGS=demos/timing.o -TESTS=demos/test.o +#this is necessary for compatibility with BSD make (namely on OpenBSD) +.SUFFIXES: .o .c -#Files left over from making the crypt.pdf. -LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out +.c.o: + $(CC) $(LTC_CFLAGS) -c $< -o $@ -#Compressed filenames -COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip +#The default rule for make builds the libtomcrypt.a library (static) +default: $(LIBMAIN_S) -#The default rule for make builds the libtomcrypt library. -default:library - -#ciphers come in two flavours... enc+dec and enc +#SPECIAL: AES come in two flavours... enc+dec and enc-only src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o + $(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o -#These are the rules to make certain object files. +#SPECIAL: these are the rules to make certain object files src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c @@ -228,56 +229,64 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c -#This rule makes the libtomcrypt library. -library: $(LIBNAME) +#Dependencies on *.h +$(OBJECTS): $(HEADERS) +$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h -.PHONY: testprof/$(LIBTEST) -testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE) +#Create libtomcrypt_prof.a +$(LIBTEST_S): $(TOBJECTS) + $(AR) $(ARFLAGS) $@ $(TOBJECTS) + $(RANLIB) $@ -$(LIBNAME): $(OBJECTS) +#Create libtomcrypt.a +$(LIBMAIN_S): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) $(RANLIB) $@ -#This rule makes the hash program included with libtomcrypt -hashsum: library $(HASHOBJECTS) - $(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) $(WARN) - -#makes the crypt program -crypt: library $(CRYPTOBJECTS) - $(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) $(WARN) +#Create libtomcrypt.so +$(LIBMAIN_D): $(OBJECTS) + $(CC) -shared -Wl,-soname=$(LIBMAIN_L1) $(OBJECTS) $(LTC_LDFLAGS) -o $@ -#makes the small program -small: library $(SMALLOBJECTS) - $(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) $(WARN) - -tv_gen: library $(TVS) - $(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) +#Demo tools/utilities +hashsum: demos/hashsum.o $(LIBMAIN_S) + $(CC) $< $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +crypt: demos/crypt.o $(LIBMAIN_S) + $(CC) $< $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +small: demos/small.o $(LIBMAIN_S) + $(CC) $< $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +tv_gen: demos/tv_gen.o $(LIBMAIN_S) + $(CC) $< $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -timing: library testprof/$(LIBTEST) $(TIMINGS) - $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) +#Tests + timing tests +timing: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) + $(CC) $< $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + @echo "NOTICE: start the timing tests by: ./timing" +test: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) + $(CC) $< $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + @echo "NOTICE: start the tests by: ./test" -.PHONY: test -test: library testprof/$(LIBTEST) $(TESTS) - $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +all: $(LIBMAIN_S) $(LIBMAIN_D) $(LIBTEST_S) hashsum crypt small tv_gen timing test -all_test: test tv_gen hashsum crypt small timing +#NOTE: as this makefile works also on cygwin, thus we need to delete *.exe +clean: + -@rm -f $(OBJECTS) + -@rm -f $(LIBMAIN_S) $(LIBMAIN_D) $(LIBTEST_S) + -@rm -f testprof/*.o demos/*.o lib*.so lib*.so.* + -@rm -f test tv_gen hashsum crypt small timing + -@rm -f test.exe tv_gen.exe hashsum.exe crypt.exe small.exe timing.exe -#This rule installs the library and the header files. This must be run -#as root in order to have a high enough permission to write to the correct -#directories and to set the owner and group to root. -install: library - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(DATAPATH) - install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH) - install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) +install_static: $(LIBMAIN_S) $(HEADERS) + @mkdir -p $(DESTDIR)/include $(DESTDIR)/lib/pkgconfig + @cp $(LIBMAIN_S) $(DESTDIR)/lib/ + @cp $(HEADERS) $(DESTDIR)/include/ + @sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)/lib/pkgconfig/libtomcrypt.pc -install_test: testprof/$(LIBTEST) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) - install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) - install -g $(GROUP) -o $(USER) testprof/$(LIBTEST) $(DESTDIR)$(LIBPATH) +install_dynamic: $(LIBMAIN_D) $(HEADERS) + @mkdir -p $(DESTDIR)/include $(DESTDIR)/lib/pkgconfig + @cp $(LIBMAIN_D) $(DESTDIR)/lib/ + @cp $(HEADERS) $(DESTDIR)/include/ + @ln -sf $(LIBMAIN_D) $(DESTDIR)/lib/$(LIBMAIN_L1) + @ln -sf $(LIBMAIN_D) $(DESTDIR)/lib/$(LIBMAIN_L2) + @sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)/lib/pkgconfig/libtomcrypt.pc -# $Source$ -# $Revision$ -# $Date$ +install: install_static install_dynamic From 3540eedb4a3808a688f63d5011279dadc1d9341b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 21:07:21 +0200 Subject: [PATCH 0729/1192] HP-UX make does not like ?= and $< --- makefile.unix | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/makefile.unix b/makefile.unix index cda26ea0a..600685866 100644 --- a/makefile.unix +++ b/makefile.unix @@ -16,14 +16,14 @@ # #The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs" -CC ?= cc -LD ?= ld -AR ?= ar -ARFLAGS ?= r -RANLIB ?= ranlib -CFLAGS ?= -O2 -DUSE_LTM -DLTM_DESC -I../libtommath -EXTRALIBS ?= ../libtommath/libtommath.a -DESTDIR ?= /usr/local +CC = cc +LD = ld +AR = ar +ARFLAGS = r +RANLIB = ranlib +CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath +EXTRALIBS = ../libtommath/libtommath.a +DESTDIR = /usr/local #Compilation flags LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE @@ -249,20 +249,20 @@ $(LIBMAIN_D): $(OBJECTS) #Demo tools/utilities hashsum: demos/hashsum.o $(LIBMAIN_S) - $(CC) $< $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ crypt: demos/crypt.o $(LIBMAIN_S) - $(CC) $< $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) demos/crypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ small: demos/small.o $(LIBMAIN_S) - $(CC) $< $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ tv_gen: demos/tv_gen.o $(LIBMAIN_S) - $(CC) $< $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ #Tests + timing tests timing: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) - $(CC) $< $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the timing tests by: ./timing" test: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) - $(CC) $< $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) demos/test.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the tests by: ./test" all: $(LIBMAIN_S) $(LIBMAIN_D) $(LIBTEST_S) hashsum crypt small tv_gen timing test From ceb7332631eb07390b67a591e0d698c6b4a1ceee Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 2 May 2017 21:42:07 +0200 Subject: [PATCH 0730/1192] typo --- makefile.unix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile.unix b/makefile.unix index 600685866..b70deefd2 100644 --- a/makefile.unix +++ b/makefile.unix @@ -1,4 +1,4 @@ -# MAKEFILE that is intended to be compatible with any kind of make (GNU make, BDS make , ...) +# MAKEFILE that is intended to be compatible with any kind of make (GNU make, BSD make, ...) # # Please do not use here neither any special make syntax nor any unusual tools/utilities! From c225f22a2360808383883de4423111338d2c9926 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 3 May 2017 07:35:43 +0200 Subject: [PATCH 0731/1192] remove building dynamic libs from makefile.unix --- makefile.unix | 48 +++++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/makefile.unix b/makefile.unix index b70deefd2..26c43e680 100644 --- a/makefile.unix +++ b/makefile.unix @@ -1,6 +1,9 @@ # MAKEFILE that is intended to be compatible with any kind of make (GNU make, BSD make, ...) +# works on: Linux, *BSD, Cygwin, AIX, HP-UX and hopefully other UNIX systems # # Please do not use here neither any special make syntax nor any unusual tools/utilities! +# +# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh ### USAGE: # @@ -16,31 +19,24 @@ # #The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs" +DESTDIR = /usr/local CC = cc -LD = ld AR = ar ARFLAGS = r RANLIB = ranlib CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = ../libtommath/libtommath.a -DESTDIR = /usr/local #Compilation flags LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) VERSION=1.17 -VERSION_MAJ=1 -VERSION_MIN=17 -#Libraries to be created +#Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a LIBTEST_S =libtomcrypt_prof.a -LIBMAIN_D =libtomcrypt.so.0.0.$(VERSION_MAJ)$(VERSION_MIN) -#The following will be symlinks to $(LIBMAIN_D) -LIBMAIN_L1=libtomcrypt.so.0 -LIBMAIN_L2=libtomcrypt.so -# List of objects to compile (all goes to libtomcrypt.a) +#List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ @@ -192,7 +188,7 @@ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o -# List of test objects to compile (all goes to libtomcrypt_prof.a) +#List of test objects to compile (all goes to libtomcrypt_prof.a) TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ @@ -200,14 +196,14 @@ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o -# The following headers will be installed by "make install" +#The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -#this is necessary for compatibility with BSD make (namely on OpenBSD) +#This is necessary for compatibility with BSD make (namely on OpenBSD) .SUFFIXES: .o .c .c.o: @@ -216,7 +212,7 @@ src/headers/tomcrypt_prng.h #The default rule for make builds the libtomcrypt.a library (static) default: $(LIBMAIN_S) -#SPECIAL: AES come in two flavours... enc+dec and enc-only +#SPECIAL: AES comes in two flavours - enc+dec and enc-only src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o @@ -243,10 +239,6 @@ $(LIBMAIN_S): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) $(RANLIB) $@ -#Create libtomcrypt.so -$(LIBMAIN_D): $(OBJECTS) - $(CC) -shared -Wl,-soname=$(LIBMAIN_L1) $(OBJECTS) $(LTC_LDFLAGS) -o $@ - #Demo tools/utilities hashsum: demos/hashsum.o $(LIBMAIN_S) $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @@ -265,28 +257,18 @@ test: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) $(CC) demos/test.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the tests by: ./test" -all: $(LIBMAIN_S) $(LIBMAIN_D) $(LIBTEST_S) hashsum crypt small tv_gen timing test +all: $(LIBMAIN_S) $(LIBTEST_S) hashsum crypt small tv_gen timing test -#NOTE: as this makefile works also on cygwin, thus we need to delete *.exe +#NOTE: this makefile works also on cygwin, thus we need to delete *.exe clean: -@rm -f $(OBJECTS) - -@rm -f $(LIBMAIN_S) $(LIBMAIN_D) $(LIBTEST_S) - -@rm -f testprof/*.o demos/*.o lib*.so lib*.so.* + -@rm -f $(LIBMAIN_S) $(LIBTEST_S) + -@rm -f testprof/*.o demos/*.o -@rm -f test tv_gen hashsum crypt small timing -@rm -f test.exe tv_gen.exe hashsum.exe crypt.exe small.exe timing.exe -install_static: $(LIBMAIN_S) $(HEADERS) +install: $(LIBMAIN_S) $(HEADERS) @mkdir -p $(DESTDIR)/include $(DESTDIR)/lib/pkgconfig @cp $(LIBMAIN_S) $(DESTDIR)/lib/ @cp $(HEADERS) $(DESTDIR)/include/ @sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)/lib/pkgconfig/libtomcrypt.pc - -install_dynamic: $(LIBMAIN_D) $(HEADERS) - @mkdir -p $(DESTDIR)/include $(DESTDIR)/lib/pkgconfig - @cp $(LIBMAIN_D) $(DESTDIR)/lib/ - @cp $(HEADERS) $(DESTDIR)/include/ - @ln -sf $(LIBMAIN_D) $(DESTDIR)/lib/$(LIBMAIN_L1) - @ln -sf $(LIBMAIN_D) $(DESTDIR)/lib/$(LIBMAIN_L2) - @sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)/lib/pkgconfig/libtomcrypt.pc - -install: install_static install_dynamic From f544418d56cc4cc0d87995c9037dd03206ccb6c9 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 3 May 2017 07:36:05 +0200 Subject: [PATCH 0732/1192] re-work makefile.mingw in the same style as makefile.unix --- makefile.mingw | 160 ++++++++++++++++++++++++------------------------- 1 file changed, 77 insertions(+), 83 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 67a4ffcd6..75215c8d6 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -1,38 +1,42 @@ +# MAKEFILE for MS Windows (mingw + gcc + gmake) # -# open a command prompt with gcc + gmake in PATH -# and start: gmake -f makefile.mingw -# - -EXTRALIBS=../libtommath/libtommath.a -EXTRAINCLUDE=../libtommath +# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh -CFLAGS = -Wall -Wextra -c -I./src/headers -I$(EXTRAINCLUDE) -I./testprof -DUSE_LTM -DLTM_DESC -DLTC_SOURCE -DLTC_NO_PROTOTYPES -O2 ${CFLAGS_OPTS} - -# Compiler and Linker Names -CC=gcc -LD=ld -AR=ar -ARFLAGS=rc -RANLIB=ranlib +### USAGE: +# Open a command prompt with gcc + gmake in PATH and start: +# +# gmake -f makefile.mingw all +# test.exe +# gmake -f makefile.mingw install +# +#OR: +# +# gmake -f makefile.mingw CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -Ic:/path/to/libtommath" EXTRALIBS="-Lc:/path/to/libtommath -ltommath" all +# test.exe +# gmake -f makefile.mingw DESTDIR=c:\devel\libtom install +# -LIBNAME=libtomcrypt.a -LIBTEST=libtomcrypt_prof.a +#The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs +DESTDIR = c:\mingw +CC = gcc +AR = ar +ARFLAGS = r +RANLIB = ranlib +STRIP = strip +CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath +EXTRALIBS = -L../libtommath -ltommath -HASH=hashsum -CRYPT=encrypt -SMALL=small -PROF=x86_prof -TV=tv_gen -TIMING=timing -TEST=test +#Compilation flags +LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE +LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -#LIBPATH-The directory for libtomcrypt to be installed to. -#INCPATH-The directory to install the header files for libtomcrypt. -INSTPREFIX=c:\devel-libtom -LIBPATH=$(INSTPREFIX)\lib -INCPATH=$(INSTPREFIX)\include +#Libraries to be created +LIBMAIN_S =libtomcrypt.a +LIBMAIN_I =libtomcrypt.dll.a +LIBMAIN_D =libtomcrypt.dll +LIBTEST_S =libtomcrypt_prof.a -# List of objects to compile (all goes to libtomcrypt.a) +#List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ @@ -184,7 +188,7 @@ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o -# List of test objects to compile (all goes to libtomcrypt_prof.a) +#List of test objects to compile (all goes to libtomcrypt_prof.a) TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ @@ -192,29 +196,24 @@ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o -# The following headers will be installed by "make install" +#The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -TESTOBJECTS=demos/test.o -HASHOBJECTS=demos/hashsum.o -CRYPTOBJECTS=demos/encrypt.o -SMALLOBJECTS=demos/small.o -TVS=demos/tv_gen.o -TIMINGS=demos/timing.o -TESTS=demos/test.o +.c.o: + $(CC) $(LTC_CFLAGS) -c $< -o $@ -#The default rule for make builds the libtomcrypt library. -default:library +#The default rule for make builds the libtomcrypt.a library (static) +default: $(LIBMAIN_S) -#ciphers come in two flavours... enc+dec and enc +#SPECIAL: AES comes in two flavours - enc+dec and enc-only src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o + $(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o -#These are the rules to make certain object files. +#SPECIAL: these are the rules to make certain object files src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c @@ -223,58 +222,53 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c -#This rule makes the libtomcrypt library. -library: $(LIBNAME) - #Dependencies on *.h $(OBJECTS): $(HEADERS) $(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h -$(LIBTEST): $(TOBJECTS) +#Create libtomcrypt_prof.a +$(LIBTEST_S): $(TOBJECTS) $(AR) $(ARFLAGS) $@ $(TOBJECTS) $(RANLIB) $@ -%.o: %.c - ${CC} ${CFLAGS} -c $< -o $@ - -$(LIBNAME): $(OBJECTS) +#Create libtomcrypt.a +$(LIBMAIN_S): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) $(RANLIB) $@ -#This rule makes the hash program included with libtomcrypt -hashsum: library $(HASHOBJECTS) - $(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) $(WARN) - -#makes the crypt program -crypt: library $(CRYPTOBJECTS) - $(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) $(WARN) - -#makes the small program -small: library $(SMALLOBJECTS) - $(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) $(WARN) - -tv_gen: library $(TVS) - $(CC) $(LDFLAGS) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) +#Create DLL + import library libtomcrypt.dll.a +$(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) + $(CC) -s -shared -o $(LIBMAIN_D) $^ -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBMAIN_I) $(LTC_LDFLAGS) + $(STRIP) -S $(LIBMAIN_D) -timing: library $(LIBTEST) $(TIMINGS) - $(CC) $(LDFLAGS) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) +#Demo tools/utilities +hashsum: demos/hashsum.o $(LIBMAIN_S) + $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +crypt: demos/crypt.o $(LIBMAIN_S) + $(CC) demos/crypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +small: demos/small.o $(LIBMAIN_S) + $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +tv_gen: demos/tv_gen.o $(LIBMAIN_S) + $(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -.PHONY: test -test: library $(LIBTEST) $(TESTS) - $(CC) $(LDFLAGS) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +#Tests + timing tests +timing: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) + $(CC) demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + @echo NOTICE: start the tests by: timing.exe +test: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) + $(CC) demos/test.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + @echo NOTICE: start the tests by: test.exe -all_test: test tv_gen hashsum crypt small timing - -install: library - cmd /c if not exist "$(LIBPATH)" mkdir "$(LIBPATH)" - cmd /c if not exist "$(INCPATH)" mkdir "$(INCPATH)" - copy /Y $(LIBNAME) "$(LIBPATH)" - copy /Y src\headers\tomcrypt*.h "$(INCPATH)" - -install_test: $(LIBTEST) - cmd /c if not exist "$(LIBPATH)" mkdir "$(LIBPATH)" - copy /Y testprof\$(LIBTEST) "$(LIBPATH)" +all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) hashsum crypt small tv_gen timing test clean: - cmd /c del /Q /S *.o *.a *.exe - $(MAKE) -C testprof -f makefile.mingw clean + @cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul + +install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) + cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" + cmd /c if not exist "$(DESTDIR)\lib" mkdir "$(DESTDIR)\lib" + cmd /c if not exist "$(DESTDIR)\include" mkdir "$(DESTDIR)\include" + copy /Y $(LIBMAIN_S) "$(DESTDIR)\lib" + copy /Y $(LIBMAIN_I) "$(DESTDIR)\lib" + copy /Y $(LIBMAIN_D) "$(DESTDIR)\bin" + copy /Y src\headers\tomcrypt*.h "$(DESTDIR)\include" From 85dc39483f27ccfb96508099fcf0a6d5ed369c84 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 26 Apr 2017 01:00:50 +0200 Subject: [PATCH 0733/1192] rename crypt to ltcrypt a binary called crypt already exists and creates a name-clash as we won't implement the entire CLI even if this tool implements similar functionality --- .gitignore | 4 ++-- demos/{crypt.c => ltcrypt.c} | 0 makefile | 3 +-- makefile.include | 8 +------- 4 files changed, 4 insertions(+), 11 deletions(-) rename demos/{crypt.c => ltcrypt.c} (100%) diff --git a/.gitignore b/.gitignore index 353266c1e..acba15278 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,8 @@ doc/refman.pdf # *nix/windows test executables constants constants.exe -crypt -crypt.exe +ltcrypt +ltcrypt.exe hashsum hashsum.exe multi diff --git a/demos/crypt.c b/demos/ltcrypt.c similarity index 100% rename from demos/crypt.c rename to demos/ltcrypt.c diff --git a/makefile b/makefile index 2206e0057..aa5e933f4 100644 --- a/makefile +++ b/makefile @@ -365,8 +365,7 @@ clean: rm -f `find . -type f -name "*.dpi" | xargs` rm -rf `find . -type d -name "*.libs" | xargs` rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc - rm -f $(TV) $(SMALL) $(CRYPT) $(HASH) $(TIMING) $(TEST) - rm -f $(SIZES) $(CONSTANTS) + rm -f $(TIMING) $(TEST) $(DEMOS) rm -rf doc/doxygen rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` rm -f *.txt diff --git a/makefile.include b/makefile.include index d1103acba..e426156d5 100644 --- a/makefile.include +++ b/makefile.include @@ -84,16 +84,10 @@ CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" endif -HASH=hashsum -CRYPT=encrypt -SMALL=small -TV=tv_gen TIMING=timing TEST=test -SIZES=sizes -CONSTANTS=constants -DEMOS=hashsum crypt small tv_gen sizes constants +DEMOS=hashsum ltcrypt small tv_gen sizes constants TIMINGS=demos/timing.o TESTS=demos/test.o From 90daad0764f839195422a3b2fb4e7a57cae6b7a8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 1 May 2017 11:17:23 +0200 Subject: [PATCH 0734/1192] add new make-target 'bins' so you can easily build the useful demos --- makefile | 2 ++ makefile.include | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index aa5e933f4..7cff82123 100644 --- a/makefile +++ b/makefile @@ -275,6 +275,8 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) +bins: $(USEFUL_DEMOS) + all_test: test tv_gen $(DEMOS) ifeq ($(COVERAGE),1) all_test: LIB_PRE = -Wl,--whole-archive diff --git a/makefile.include b/makefile.include index e426156d5..5dadabaf1 100644 --- a/makefile.include +++ b/makefile.include @@ -87,7 +87,8 @@ endif TIMING=timing TEST=test -DEMOS=hashsum ltcrypt small tv_gen sizes constants +USEFUL_DEMOS=hashsum +DEMOS=$(USEFUL_DEMOS) ltcrypt small tv_gen sizes constants TIMINGS=demos/timing.o TESTS=demos/test.o From 3fd1771d3542f9206d5a59e2373e4c8d16338e6f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 3 May 2017 18:36:35 +0200 Subject: [PATCH 0735/1192] also install useful demos --- makefile | 6 ++++-- makefile.include | 2 ++ makefile.shared | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 7cff82123..792383e8a 100644 --- a/makefile +++ b/makefile @@ -289,14 +289,16 @@ endif ifndef NODOCS install: library docs else -install: library +install: library $(USEFUL_DEMOS) endif install -d $(LIBPATH) install -d $(INCPATH) - install -d $(DATAPATH) + install -d $(BINPATH) install -m 644 $(LIBNAME) $(LIBPATH) install -m 644 $(HEADERS) $(INCPATH) + install -m 644 $(USEFUL_DEMOS) $(BINPATH) ifndef NODOCS + install -d $(DATAPATH) install -m 644 doc/crypt.pdf $(DATAPATH) endif diff --git a/makefile.include b/makefile.include index 5dadabaf1..c1cd7d56f 100644 --- a/makefile.include +++ b/makefile.include @@ -96,10 +96,12 @@ TESTS=demos/test.o #LIBPATH The directory for libtomcrypt to be installed to. #INCPATH The directory to install the header files for libtomcrypt. #DATAPATH The directory to install the pdf docs. +#BINPATH The directory to install the binaries provided. DESTDIR ?= /usr/local LIBPATH ?= $(DESTDIR)/lib INCPATH ?= $(DESTDIR)/include DATAPATH ?= $(DESTDIR)/share/doc/libtomcrypt/pdf +BINPATH ?= $(DESTDIR)/bin #Who do we install as? ifdef INSTALL_USER diff --git a/makefile.shared b/makefile.shared index 3e888c58a..1506ba728 100644 --- a/makefile.shared +++ b/makefile.shared @@ -234,11 +234,13 @@ $(LIBNAME): $(OBJECTS) $(LIBTEST): $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) -install: $(LIBNAME) +install: $(LIBNAME) $(USEFUL_DEMOS) install -d $(LIBPATH)/pkgconfig install -d $(INCPATH) + install -d $(BINPATH) $(LT) --mode=install install -c $(LIBNAME) $(LIBPATH)/$(LIBNAME) install -m 644 $(HEADERS) $(INCPATH) + install -m 775 $(USEFUL_DEMOS) $(BINPATH) sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(LIBPATH)/pkgconfig/libtomcrypt.pc install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/libtomcrypt.pc From 5c2bea093a64d23c083c087bc8a7a449e574f858 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 4 May 2017 16:01:56 +0200 Subject: [PATCH 0736/1192] zipup target facelift --- .gitattributes | 6 ++++++ .gitignore | 4 ++++ makefile | 34 ++++++++++++++++------------------ mess.sh | 4 ---- 4 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 .gitattributes delete mode 100755 mess.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..c76e0d25e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +/.* export-ignore +/hooks export-ignore +doc/*.html export-ignore +coverity.sh export-ignore + +/** export-subst diff --git a/.gitignore b/.gitignore index acba15278..f74c42871 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,10 @@ /MSVC_* .libs/ +# release files +/libtomcrypt-* +/crypt-* + # suppress output of build process gcc_[12].txt testok.txt diff --git a/makefile b/makefile index 792383e8a..1a76fd061 100644 --- a/makefile +++ b/makefile @@ -387,7 +387,8 @@ doxy: doxygen #from the clean command! This is because most people would like to keep the #nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to #delete it if we are rebuilding it. -docs: crypt.tex +docs: doc/crypt.pdf +doc/crypt.pdf: crypt.tex rm -f doc/crypt.pdf $(LEFTOVERS) cp crypt.tex crypt.bak touch --reference=crypt.tex crypt.bak @@ -418,24 +419,21 @@ docdvi: crypt.tex latex crypt $(silent_stdout) latex crypt $(silent_stdout) -#zipup the project (take that!) -no_oops: clean - cd .. ; cvs commit - echo Scanning for scratch/dirty files - find . -type f | grep -v CVS | xargs -n 1 bash mess.sh - -zipup: no_oops docs - cd .. ; rm -rf crypt* libtomcrypt-$(VERSION) ; mkdir libtomcrypt-$(VERSION) ; \ - cp -R ./libtomcrypt/* ./libtomcrypt-$(VERSION)/ ; \ - cd libtomcrypt-$(VERSION) ; rm -rf `find . -type d | grep CVS | xargs` ; cd .. ; \ - tar -cjvf crypt-$(VERSION).tar.bz2 libtomcrypt-$(VERSION) ; \ - zip -9r crypt-$(VERSION).zip libtomcrypt-$(VERSION) ; \ - gpg -b -a crypt-$(VERSION).tar.bz2 ; gpg -b -a crypt-$(VERSION).zip ; \ - mv -fv crypt* ~ ; rm -rf libtomcrypt-$(VERSION) +zipup: doc/crypt.pdf + @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) + @perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 ) + rm -rf libtomcrypt-$(VERSION) libtomcrypt-$(VERSION).* + # files/dirs excluded from "git archive" are defined in .gitattributes + git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x + mkdir -p libtomcrypt-$(VERSION)/doc + cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf + tar -cjf libtomcrypt-$(VERSION).tar.bz2 libtomcrypt-$(VERSION) + zip -9rq libtomcrypt-$(VERSION).zip libtomcrypt-$(VERSION) + rm -rf libtomcrypt-$(VERSION) + gpg -b -a libtomcrypt-$(VERSION).tar.bz2 + gpg -b -a libtomcrypt-$(VERSION).zip perlcritic: perlcritic *.pl -# $Source$ -# $Revision$ -# $Date$ +# git commit: $Format:%h$ $Format:%ai$ $Format:%ci$ diff --git a/mess.sh b/mess.sh deleted file mode 100755 index bd8dc19ca..000000000 --- a/mess.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -if cvs log $1 >/dev/null 2>/dev/null; then exit 0; else echo "$1 shouldn't be here, removed"; rm -f $1 ; fi - - From 9a3db508bb320bdb059fad5fb0f47c88ac93373c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 09:28:05 +0200 Subject: [PATCH 0737/1192] typo in "git commit: .." --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 1a76fd061..217f85edf 100644 --- a/makefile +++ b/makefile @@ -436,4 +436,4 @@ zipup: doc/crypt.pdf perlcritic: perlcritic *.pl -# git commit: $Format:%h$ $Format:%ai$ $Format:%ci$ +# git commit: $Format:%h$ $Format:%ai$ From 31cf7960118631cdcf2ec2c607592deb26a65889 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 10:18:15 +0200 Subject: [PATCH 0738/1192] updated makefile.unix should work fine with Intel C compiler, so no need to keep an extra clone - makefile.icc --- makefile.icc | 352 -------------------------------------------------- makefile.unix | 6 +- 2 files changed, 5 insertions(+), 353 deletions(-) delete mode 100644 makefile.icc diff --git a/makefile.icc b/makefile.icc deleted file mode 100644 index 445069eeb..000000000 --- a/makefile.icc +++ /dev/null @@ -1,352 +0,0 @@ -# MAKEFILE for linux ICC (Intel C compiler) -# -# Tested with ICC v8.... -# -# Be aware that ICC isn't quite as stable as GCC and several optimization switches -# seem to break the code (that GCC and MSVC compile just fine). In particular -# "-ip" and "-x*" seem to break the code (ROL/ROR macro problems). As the makefile -# is shipped the code will build and execute properly. -# -# Also note that ICC often makes code that is slower than GCC. This is probably due to -# a mix of not being able to use "-ip" and just having fewer optimization algos than GCC. -# -# Tom St Denis - -# Compiler and Linker Names -CC=icc - -#LD=ld - -# Archiver [makes .a files] -# With compile option "-ipo" it can be necessary to archive with 'xiar' -#AR=ar -#ARFLAGS=r - -ifndef MAKE - MAKE=make -endif - -# Compilation flags. Note the += does not write over the user's CFLAGS! -CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE - -#The default rule for make builds the libtomcrypt library. -default:library - -# optimize for SPEED -# -# -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4 -# -a? specifies make code specifically for ? but compatible with IA-32 -# -? specifies compile solely for ? [not specifically IA-32 compatible] -# -# where ? is -# mia - PIII; has only option "-mia32", no "-amia32" -# msse2 - first P4 [Willamette]; has only option "-msse2", no "-amsse2" -# xSSE2 - P4 Northwood -# xSSE3 - P4 Prescott -# -# The easiest way - when compiling on one architecture, only for -# this architecture - is to enable the compiler option "-fast", which enables -# "all possible" optimizations for this architecture. -# ICC 14.0.3 20140422 says "-fast" resolves to -# "-xHOST -O3 -ipo -no-prec-div -static" -# -# Default to just generic max opts -ifdef LTC_SMALL -CFLAGS += -O1 -endif - -ifndef IGNORE_SPEED -CFLAGS += -O3 -endif - -# want to see stuff? -#CFLAGS += -opt_report - -#These flags control how the library gets built. - -#Output filenames for various targets. -ifndef LIBNAME - LIBNAME=libtomcrypt.a -endif -ifndef LIBTEST - LIBTEST=libtomcrypt_prof.a -endif -HASH=hashsum -CRYPT=encrypt -SMALL=small -PROF=x86_prof -TV=tv_gen -TIMING=timing -TEST=test - -#LIBPATH-The directory for libtomcrypt to be installed to. -#INCPATH-The directory to install the header files for libtomcrypt. -#DATAPATH-The directory to install the pdf docs. -ifndef DESTDIR - DESTDIR= -endif -ifndef LIBPATH - LIBPATH=/usr/lib -endif -ifndef INCPATH - INCPATH=/usr/include -endif -ifndef DATAPATH - DATAPATH=/usr/share/doc/libtomcrypt/pdf -endif - -# List of objects to compile (all goes to libtomcrypt.a) -OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ -src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ -src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ -src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ -src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ -src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ -src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ -src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ -src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ -src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ -src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ -src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ -src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ -src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ -src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ -src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ -src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ -src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ -src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ -src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ -src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ -src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ -src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ -src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ -src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ -src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ -src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ -src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ -src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ -src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ -src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ -src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ -src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ -src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ -src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ -src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ -src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ -src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ -src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ -src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ -src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ -src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ -src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ -src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ -src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ -src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ -src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ -src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ -src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ -src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ -src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ -src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ -src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ -src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ -src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ -src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ -src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ -src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ -src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ -src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ -src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ -src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ -src/pk/asn1/der/octet/der_length_octet_string.o \ -src/pk/asn1/der/printable_string/der_decode_printable_string.o \ -src/pk/asn1/der/printable_string/der_encode_printable_string.o \ -src/pk/asn1/der/printable_string/der_length_printable_string.o \ -src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ -src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ -src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ -src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ -src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ -src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ -src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ -src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ -src/pk/asn1/der/short_integer/der_encode_short_integer.o \ -src/pk/asn1/der/short_integer/der_length_short_integer.o \ -src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ -src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ -src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ -src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ -src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ -src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ -src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ -src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ -src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ -src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ -src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ -src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ -src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ -src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ -src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ -src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ -src/stream/sober128/sober128_test.o - -# List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ -testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ -testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ -testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ -testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o - -# The following headers will be installed by "make install" -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h - -#Who do we install as? -ifdef INSTALL_USER -USER=$(INSTALL_USER) -else -USER=root -endif - -ifdef INSTALL_GROUP -GROUP=$(INSTALL_GROUP) -else -GROUP=wheel -endif - -#ciphers come in two flavours... enc+dec and enc -aes_enc.o: aes.c aes_tab.c - $(CC) $(CFLAGS) -DENCRYPT_ONLY -c aes.c -o aes_enc.o - -HASHOBJECTS=demos/hashsum.o -CRYPTOBJECTS=demos/encrypt.o -SMALLOBJECTS=demos/small.o -TVS=demos/tv_gen.o -TIMINGS=demos/timing.o -TESTS=demos/test.o - -#ciphers come in two flavours... enc+dec and enc -src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o - -#These are the rules to make certain object files. -src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c -src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c -src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c -src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c -src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c -src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c -src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c - -#This rule makes the libtomcrypt library. -library: $(LIBNAME) - -#Dependencies on *.h -$(OBJECTS): $(HEADERS) -$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h - -$(LIBTEST): $(TOBJECTS) - $(AR) $(ARFLAGS) $@ $(TOBJECTS) - $(RANLIB) $@ - -$(LIBNAME): $(OBJECTS) - $(AR) $(ARFLAGS) $@ $(OBJECTS) - ranlib $@ - -#This rule makes the hash program included with libtomcrypt -hashsum: library $(HASHOBJECTS) - $(CC) $(HASHOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(HASH) $(WARN) - -#makes the crypt program -crypt: library $(CRYPTOBJECTS) - $(CC) $(CRYPTOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(CRYPT) $(WARN) - -#makes the small program -small: library $(SMALLOBJECTS) - $(CC) $(SMALLOBJECTS) $(LIBNAME) $(EXTRALIBS) -o $(SMALL) $(WARN) - -tv_gen: library $(TVS) - $(CC) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) - -timing: library $(TIMINGS) $(LIBTEST) - $(CC) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING) - -test: library $(TESTS) $(LIBTEST) - $(CC) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) - -all_test: test tv_gen hashsum crypt small timing - -#This rule installs the library and the header files. This must be run -#as root in order to have a high enough permission to write to the correct -#directories and to set the owner and group to root. -install: library - install -d -g $(GROUP) -o $(USER) $(LIBPATH) - install -d -g $(GROUP) -o $(USER) $(INCPATH) - install -g $(GROUP) -o $(USER) $(LIBNAME) $(LIBPATH) - install -g $(GROUP) -o $(USER) $(LIBTEST) $(LIBPATH) - install -g $(GROUP) -o $(USER) $(HEADERS) $(INCPATH) - -# $Source$ -# $Revision$ -# $Date$ diff --git a/makefile.unix b/makefile.unix index 26c43e680..1acae9d3f 100644 --- a/makefile.unix +++ b/makefile.unix @@ -11,12 +11,16 @@ # ./test # make -f makefile.unix install # -#OR: +#Or: # # make -f makefile.unix CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all # ./test # make -f makefile.unix DESTDIR=/opt/libtom install # +#Or if you are using Intel C compiler you might need something like: +# +# make -f makefile.unix CC=icc AR=xiar CFLAGS="-fast -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all +# #The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs" DESTDIR = /usr/local From 3176103c156cdb4672c8d84f28c444822852f16c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 10:35:36 +0200 Subject: [PATCH 0739/1192] fix makefile.icc in makefile update scripts --- helper.pl | 2 +- updatemakes.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helper.pl b/helper.pl index b871e67ec..bc52302b7 100755 --- a/helper.pl +++ b/helper.pl @@ -260,7 +260,7 @@ sub process_makefiles { } # update OBJECTS + HEADERS in makefile* - for my $m (qw/ makefile makefile.icc makefile.shared makefile.unix makefile.mingw makefile.msvc makefile.include /) { + for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile.include /) { my $old = read_file($m); my $new = $m eq 'makefile.msvc' ? patch_makefile($old, $var_obj, $var_h, $var_to, @ver_version) : patch_makefile($old, $var_o, $var_h, $var_to, @ver_version); diff --git a/updatemakes.sh b/updatemakes.sh index 070bab358..8975c4be3 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -2,7 +2,7 @@ ./helper.pl --update-makefiles || exit 1 -makefiles=(makefile makefile.icc makefile.shared makefile.unix makefile.mingw makefile.msvc) +makefiles=(makefile makefile.shared makefile.unix makefile.mingw makefile.msvc) vcproj=(libtomcrypt_VS2008.vcproj libtomcrypt_VS2005.vcproj) if [ $# -eq 1 ] && [ "$1" == "-c" ]; then From 1300c5ade53a44c65543e013f5d76fb12b0ca4fe Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 10:36:23 +0200 Subject: [PATCH 0740/1192] make fixupind.pl part of helper.pl --- fixupind.pl | 16 ---------------- helper.pl | 9 +++++++++ makefile | 4 ++-- 3 files changed, 11 insertions(+), 18 deletions(-) delete mode 100755 fixupind.pl diff --git a/fixupind.pl b/fixupind.pl deleted file mode 100755 index ddefbd76a..000000000 --- a/fixupind.pl +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -open(my $in, '<', 'crypt.ind'); -open(my $out, '>', 'crypt.ind.tmp'); -my $a = <$in>; -print {$out} "$a\n\\addcontentsline{toc}{chapter}{Index}\n"; -while (<$in>) { - print {$out} $_; -} -close $out; -close $in; -system("mv -f crypt.ind.tmp crypt.ind"); - diff --git a/helper.pl b/helper.pl index bc52302b7..b71569fbe 100755 --- a/helper.pl +++ b/helper.pl @@ -287,6 +287,7 @@ sub die_usage { $0 --check-makefiles $0 --check-all $0 --update-makefiles + $0 --fixupind crypt.ind MARKER } @@ -296,9 +297,17 @@ sub die_usage { "m|check-makefiles" => \my $check_makefiles, "a|check-all" => \my $check_all, "u|update-makefiles" => \my $update_makefiles, + "f|fixupind=s" => \my $fixupind, "h|help" => \my $help ) or die_usage; +if ($fixupind) { + my $txt = read_file($fixupind); + $txt =~ s/^([^\n]*\n)/$1\n\\addcontentsline{toc}{chapter}{Index}\n/s; + write_file($fixupind, $txt); + exit 0; +} + my $failure; $failure ||= check_source() if $check_all || $check_source; $failure ||= check_defines() if $check_all || $check_defines; diff --git a/makefile b/makefile index 217f85edf..33d552c6a 100644 --- a/makefile +++ b/makefile @@ -403,7 +403,7 @@ doc/crypt.pdf: crypt.tex latex crypt $(silent_stdout) latex crypt $(silent_stdout) makeindex crypt.idx $(silent_stdout) - perl fixupind.pl + perl helper.pl --fixupind crypt.ind pdflatex crypt $(silent_stdout) sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf mv -ivf crypt.pdf doc/crypt.pdf @@ -415,7 +415,7 @@ docdvi: crypt.tex latex crypt $(silent_stdout) latex crypt $(silent_stdout) makeindex crypt.idx - perl fixupind.pl + perl helper.pl --fixupind crypt.ind latex crypt $(silent_stdout) latex crypt $(silent_stdout) From ee17cc2e67882fc43f770b28a46ca835c58f2d9d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 14:34:01 +0200 Subject: [PATCH 0741/1192] compress archive to xz --- makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 33d552c6a..97100db4b 100644 --- a/makefile +++ b/makefile @@ -427,10 +427,10 @@ zipup: doc/crypt.pdf git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x mkdir -p libtomcrypt-$(VERSION)/doc cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf - tar -cjf libtomcrypt-$(VERSION).tar.bz2 libtomcrypt-$(VERSION) + tar -cJf libtomcrypt-$(VERSION).tar.xz libtomcrypt-$(VERSION) zip -9rq libtomcrypt-$(VERSION).zip libtomcrypt-$(VERSION) rm -rf libtomcrypt-$(VERSION) - gpg -b -a libtomcrypt-$(VERSION).tar.bz2 + gpg -b -a libtomcrypt-$(VERSION).tar.xz gpg -b -a libtomcrypt-$(VERSION).zip perlcritic: From 544f7cc6ced25cdb281bcf47e49d92516abe0085 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 15:03:17 +0200 Subject: [PATCH 0742/1192] ignore eclipse special files --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index f74c42871..02a1ffd81 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,11 @@ timing.exe *.idb *.pdb +# Eclipse special files +.project +.cproject +.settings/ + # oops ;) but we don't want them to appear in the repository... *.stackdump *.core From 1b71e23e424b01db384197bff2362e94bb19023c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 15:07:18 +0200 Subject: [PATCH 0743/1192] fix some testprof related errors --- makefile | 1 - makefile.shared | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 97100db4b..6caaf223a 100644 --- a/makefile +++ b/makefile @@ -373,7 +373,6 @@ clean: rm -rf doc/doxygen rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` rm -f *.txt - cd testprof ; $(MAKE) clean #build the doxy files (requires Doxygen, tetex and patience) doxygen: diff --git a/makefile.shared b/makefile.shared index 1506ba728..8d9e96460 100644 --- a/makefile.shared +++ b/makefile.shared @@ -244,17 +244,17 @@ install: $(LIBNAME) $(USEFUL_DEMOS) sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(LIBPATH)/pkgconfig/libtomcrypt.pc install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/libtomcrypt.pc -install_test: testprof/$(LIBTEST) +install_test: $(LIBTEST) install -d $(LIBPATH) install -d $(INCPATH) install -m 644 testprof/tomcrypt_test.h $(INCPATH) $(LT) --mode=install install -c $(LIBTEST) $(LIBPATH)/$(LIBTEST) -test: library testprof/$(LIBTEST) $(TESTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) +test: library $(LIBTEST) $(TESTS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -timing: library testprof/$(LIBTEST) $(TIMINGS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) +timing: library $(LIBTEST) $(TIMINGS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) # build the demos from a template define DEMO_template From 8ee458b625944574328f40c387ff972fb5c3be7b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 15:24:50 +0200 Subject: [PATCH 0744/1192] don't include testprof for library build ...well msvc still does it as I can't test it... --- makefile | 6 +++++- makefile.include | 9 ++++++++- makefile.mingw | 16 ++++++++++++++-- makefile.msvc | 2 +- makefile.shared | 9 +++++++-- makefile.unix | 29 +++++++++++++++++++++-------- 6 files changed, 56 insertions(+), 15 deletions(-) diff --git a/makefile b/makefile index 6caaf223a..dc8fe3947 100644 --- a/makefile +++ b/makefile @@ -225,12 +225,16 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c +$(DOBJECTS): CFLAGS += -Itestprof +$(TOBJECTS): CFLAGS += -Itestprof + #This rule makes the libtomcrypt library. library: $(LIBNAME) #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h +$(DOBJECTS): $(HEADERS) $(THEADERS) +$(TOBJECTS): $(HEADERS) $(THEADERS) $(LIBNAME): $(OBJECTS) ifneq ($V,1) diff --git a/makefile.include b/makefile.include index c1cd7d56f..081254aba 100644 --- a/makefile.include +++ b/makefile.include @@ -30,7 +30,7 @@ endif # Compilation flags. Note the += does not write over the user's CFLAGS! -CFLAGS += -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE +CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE ifdef OLD_GCC CFLAGS += -W @@ -84,6 +84,13 @@ CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" endif +#List of demo objects +DSOURCES != ls demos/*.c +DOBJECTS = ${DSOURCES:.c=.o} + +#List of testprof headers +THEADERS != ls testprof/*.h + TIMING=timing TEST=test diff --git a/makefile.mingw b/makefile.mingw index 75215c8d6..bcf033a34 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -27,7 +27,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = -L../libtommath -ltommath #Compilation flags -LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE +LTC_CFLAGS = $(CFLAGS) -Isrc/headers -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) #Libraries to be created @@ -203,6 +203,16 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h +THEADERS != ls testprof/*.h + +#List of demo objects (only used to create a special rule to extend LTC_CFLAGS) +DSOURCES != ls demos/*.c +DOBJECTS = ${DSOURCES:.c=.o} + +#SPECIAL: demo- and test-objects required include-path "testprof" +$(DOBJECTS): LTC_CFLAGS += -Itestprof +$(TOBJECTS): LTC_CFLAGS += -Itestprof + .c.o: $(CC) $(LTC_CFLAGS) -c $< -o $@ @@ -222,9 +232,11 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c + #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h +$(DOBJECTS): $(HEADERS) $(THEADERS) +$(TOBJECTS): $(HEADERS) $(THEADERS) #Create libtomcrypt_prof.a $(LIBTEST_S): $(TOBJECTS) diff --git a/makefile.msvc b/makefile.msvc index eae515f03..303633636 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -186,7 +186,7 @@ src/ciphers/aes/aes_enc.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c library: $(OBJECTS) $(TOBJECTS) lib /out:tomcrypt.lib $(OBJECTS) - lib /out:tomcrypt_prof.lib $(TOBJECTS) + lib /out:tomcrypt_prof.lib $(TOBJECTS) tv_gen: demos/tv_gen.c library cl $(CFLAGS) demos/tv_gen.c tomcrypt.lib advapi32.lib $(EXTRALIBS) diff --git a/makefile.shared b/makefile.shared index 8d9e96460..748bf0531 100644 --- a/makefile.shared +++ b/makefile.shared @@ -203,7 +203,7 @@ src/headers/tomcrypt_prng.h #END_INS #The default rule for make builds the libtomcrypt library. -default:library +default: library #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c @@ -223,7 +223,12 @@ library: $(LIBNAME) #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h +$(DOBJECTS): $(HEADERS) $(THEADERS) +$(TOBJECTS): $(HEADERS) $(THEADERS) + +#SPECIAL: demo- and test-objects required include-path "testprof" +$(DOBJECTS): CFLAGS += -Itestprof +$(TOBJECTS): CFLAGS += -Itestprof .c.o: $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< diff --git a/makefile.unix b/makefile.unix index 1acae9d3f..17f3abba3 100644 --- a/makefile.unix +++ b/makefile.unix @@ -32,7 +32,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = ../libtommath/libtommath.a #Compilation flags -LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE +LTC_CFLAGS = $(CFLAGS) -Isrc/headers -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) VERSION=1.17 @@ -207,14 +207,10 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -#This is necessary for compatibility with BSD make (namely on OpenBSD) -.SUFFIXES: .o .c - -.c.o: - $(CC) $(LTC_CFLAGS) -c $< -o $@ +THEADERS != ls testprof/*.h #The default rule for make builds the libtomcrypt.a library (static) -default: $(LIBMAIN_S) +default: library #SPECIAL: AES comes in two flavours - enc+dec and enc-only src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c @@ -229,9 +225,26 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c +#List of demo objects (only used to create a special rule to extend LTC_CFLAGS) +DSOURCES != ls demos/*.c +DOBJECTS = ${DSOURCES:.c=.o} + +#This rule makes the libtomcrypt library. +library: $(LIBMAIN_S) + #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h +$(DOBJECTS): $(HEADERS) $(THEADERS) +$(TOBJECTS): $(HEADERS) $(THEADERS) + +#SPECIAL: demo- and test-objects required include-path "testprof" +$(DOBJECTS): LTC_CFLAGS += -Itestprof +$(TOBJECTS): LTC_CFLAGS += -Itestprof + +#This is necessary for compatibility with BSD make (namely on OpenBSD) +.SUFFIXES: .o .c +.c.o: + $(CC) $(LTC_CFLAGS) -c $< -o $@ #Create libtomcrypt_prof.a $(LIBTEST_S): $(TOBJECTS) From c0abe2a5dc0cb830659c0f245e1f2279bc01efcc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 15:28:02 +0200 Subject: [PATCH 0745/1192] crypt doesn't exist anymore --- makefile.unix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefile.unix b/makefile.unix index 17f3abba3..57e1e3a4c 100644 --- a/makefile.unix +++ b/makefile.unix @@ -259,8 +259,8 @@ $(LIBMAIN_S): $(OBJECTS) #Demo tools/utilities hashsum: demos/hashsum.o $(LIBMAIN_S) $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -crypt: demos/crypt.o $(LIBMAIN_S) - $(CC) demos/crypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +ltcrypt: demos/ltcrypt.o $(LIBMAIN_S) + $(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ small: demos/small.o $(LIBMAIN_S) $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ tv_gen: demos/tv_gen.o $(LIBMAIN_S) @@ -274,7 +274,7 @@ test: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) $(CC) demos/test.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the tests by: ./test" -all: $(LIBMAIN_S) $(LIBTEST_S) hashsum crypt small tv_gen timing test +all: $(LIBMAIN_S) $(LIBTEST_S) hashsum ltcrypt small tv_gen timing test #NOTE: this makefile works also on cygwin, thus we need to delete *.exe clean: From 6e484cd4204e32316d5c0a25a60ee6e92677d19b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 15:35:06 +0200 Subject: [PATCH 0746/1192] use make internal macros --- makefile.mingw | 12 ++++++------ makefile.shared | 4 ++-- makefile.unix | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index bcf033a34..1270dea6f 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -255,20 +255,20 @@ $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) #Demo tools/utilities hashsum: demos/hashsum.o $(LIBMAIN_S) - $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ crypt: demos/crypt.o $(LIBMAIN_S) - $(CC) demos/crypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ small: demos/small.o $(LIBMAIN_S) - $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ tv_gen: demos/tv_gen.o $(LIBMAIN_S) - $(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ #Tests + timing tests timing: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) - $(CC) demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: timing.exe test: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) - $(CC) demos/test.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: test.exe all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) hashsum crypt small tv_gen timing test diff --git a/makefile.shared b/makefile.shared index 748bf0531..c14647f5f 100644 --- a/makefile.shared +++ b/makefile.shared @@ -263,11 +263,11 @@ timing: library $(LIBTEST) $(TIMINGS) # build the demos from a template define DEMO_template -$(1): demos/$(1).o library +$(1): demos/$(1).o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif - $$(LT) --mode=link --tag=CC $$(CC) $$(CFLAGS) $$(CPPFLAGS) $$(LDFLAGS) -o $(1) $$< $$(LIBNAME) $$(EXTRALIBS) + $$(LT) --mode=link --tag=CC $$(CC) $$(CFLAGS) $$(CPPFLAGS) $$(LDFLAGS) $$^ $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) diff --git a/makefile.unix b/makefile.unix index 57e1e3a4c..7d0d3a04f 100644 --- a/makefile.unix +++ b/makefile.unix @@ -258,20 +258,20 @@ $(LIBMAIN_S): $(OBJECTS) #Demo tools/utilities hashsum: demos/hashsum.o $(LIBMAIN_S) - $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ ltcrypt: demos/ltcrypt.o $(LIBMAIN_S) - $(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ small: demos/small.o $(LIBMAIN_S) - $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ tv_gen: demos/tv_gen.o $(LIBMAIN_S) - $(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ #Tests + timing tests timing: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) - $(CC) demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ + $(CC) $? $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the timing tests by: ./timing" -test: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) - $(CC) demos/test.o $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +test: demos/test.o $(LIBTEST_S) $(LIBMAIN_S) + $(CC) $? $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the tests by: ./test" all: $(LIBMAIN_S) $(LIBTEST_S) hashsum ltcrypt small tv_gen timing test From b35ce0467b6f0ddbe3c52d6d1d1207c2d53bed81 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 16:10:33 +0200 Subject: [PATCH 0747/1192] move documentation-related files to doc folder --- Doxyfile => doc/Doxyfile | 12 ++++----- crypt.tex => doc/crypt.tex | 0 doc/makefile | 54 ++++++++++++++++++++++++++++++++++++++ makefile | 51 +++++------------------------------ 4 files changed, 67 insertions(+), 50 deletions(-) rename Doxyfile => doc/Doxyfile (99%) rename crypt.tex => doc/crypt.tex (100%) create mode 100644 doc/makefile diff --git a/Doxyfile b/doc/Doxyfile similarity index 99% rename from Doxyfile rename to doc/Doxyfile index 3f927c8a4..a740dd814 100644 --- a/Doxyfile +++ b/doc/Doxyfile @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = doc/doxygen +OUTPUT_DIRECTORY = doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -161,7 +161,7 @@ STRIP_FROM_PATH = src # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = src/headers +STRIP_FROM_INC_PATH = ../src/headers # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -754,7 +754,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = src +INPUT = ../src/ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1046,7 +1046,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = doc/header.html +HTML_HEADER = header.html # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1056,7 +1056,7 @@ HTML_HEADER = doc/header.html # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = doc/footer.html +HTML_FOOTER = footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1924,7 +1924,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = src/headers +INCLUDE_PATH = ../src//headers # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the diff --git a/crypt.tex b/doc/crypt.tex similarity index 100% rename from crypt.tex rename to doc/crypt.tex diff --git a/doc/makefile b/doc/makefile new file mode 100644 index 000000000..8a8085432 --- /dev/null +++ b/doc/makefile @@ -0,0 +1,54 @@ +ifeq ($V,1) +silent= +silent_stdout= +else +silent=@ +silent_stdout= > /dev/null +endif + +#Files left over from making the crypt.pdf. +LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof + +#build the doxy files (requires Doxygen, tetex and patience) +.PHONY: doxygen +doxygen: + doxygen $(silent_stdout) + +doxy: doxygen + ${MAKE} -C doxygen/latex $(silent_stdout) && mv -f doxygen/latex/refman.pdf . + @echo The huge doxygen PDF should be available as doc/refman.pdf + +#This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed +#from the clean command! This is because most people would like to keep the +#nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to +#delete it if we are rebuilding it. +.PHONY: crypt.pdf +crypt.pdf: crypt.tex + rm -f crypt.pdf $(LEFTOVERS) + cp crypt.tex crypt.bak + touch --reference=crypt.tex crypt.bak + (printf "%s" "\def\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex + printf "%s\n" "\pdfinfo{" >> crypt-deterministic.tex + printf "%s\n" " /CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex + printf "%s\n}\n" " /ModDate (\fixedpdfdate)" >> crypt-deterministic.tex + cat crypt.tex >> crypt-deterministic.tex + mv crypt-deterministic.tex crypt.tex + touch --reference=crypt.bak crypt.tex + echo "hello" > crypt.ind + latex crypt $(silent_stdout) + latex crypt $(silent_stdout) + makeindex crypt.idx $(silent_stdout) + perl ../helper.pl --fixupind crypt.ind + pdflatex crypt $(silent_stdout) + sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf + mv crypt.bak crypt.tex + rm -f $(LEFTOVERS) + +docdvi: crypt.tex + echo hello > crypt.ind + latex crypt $(silent_stdout) + latex crypt $(silent_stdout) + makeindex crypt.idx + perl ../helper.pl --fixupind crypt.ind + latex crypt $(silent_stdout) + latex crypt $(silent_stdout) diff --git a/makefile b/makefile index dc8fe3947..e5a0fa226 100644 --- a/makefile +++ b/makefile @@ -203,9 +203,6 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -#Files left over from making the crypt.pdf. -LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof - #Compressed filenames COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip @@ -380,47 +377,13 @@ clean: #build the doxy files (requires Doxygen, tetex and patience) doxygen: - doxygen $(silent_stdout) - -doxy: doxygen - cd doc/doxygen/latex ; ${MAKE} $(silent_stdout) ; mv -f refman.pdf ../../. - @echo The huge doxygen PDF should be available as doc/refman.pdf - -#This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed -#from the clean command! This is because most people would like to keep the -#nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to -#delete it if we are rebuilding it. -docs: doc/crypt.pdf -doc/crypt.pdf: crypt.tex - rm -f doc/crypt.pdf $(LEFTOVERS) - cp crypt.tex crypt.bak - touch --reference=crypt.tex crypt.bak - (printf "%s" "\def\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex - printf "%s\n" "\pdfinfo{" >> crypt-deterministic.tex - printf "%s\n" " /CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex - printf "%s\n}\n" " /ModDate (\fixedpdfdate)" >> crypt-deterministic.tex - cat crypt.tex >> crypt-deterministic.tex - mv crypt-deterministic.tex crypt.tex - touch --reference=crypt.bak crypt.tex - echo "hello" > crypt.ind - latex crypt $(silent_stdout) - latex crypt $(silent_stdout) - makeindex crypt.idx $(silent_stdout) - perl helper.pl --fixupind crypt.ind - pdflatex crypt $(silent_stdout) - sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf - mv -ivf crypt.pdf doc/crypt.pdf - mv crypt.bak crypt.tex - rm -f $(LEFTOVERS) - -docdvi: crypt.tex - echo hello > crypt.ind - latex crypt $(silent_stdout) - latex crypt $(silent_stdout) - makeindex crypt.idx - perl helper.pl --fixupind crypt.ind - latex crypt $(silent_stdout) - latex crypt $(silent_stdout) + $(MAKE) -C doc/ doxygen V=$(V) + +doxy: + $(MAKE) -C doc/ doxy V=$(V) + +docs: + $(MAKE) -C doc/ crypt.pdf V=$(V) zipup: doc/crypt.pdf @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) From c93bee957592fad5c9705b4605f7e3295fc75fbc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 16:14:10 +0200 Subject: [PATCH 0748/1192] rename perlcritic make target & also run `helper.pl -a` --- makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index e5a0fa226..0ead01d14 100644 --- a/makefile +++ b/makefile @@ -399,7 +399,8 @@ zipup: doc/crypt.pdf gpg -b -a libtomcrypt-$(VERSION).tar.xz gpg -b -a libtomcrypt-$(VERSION).zip -perlcritic: +codecheck: + perl helper.pl -a perlcritic *.pl # git commit: $Format:%h$ $Format:%ai$ From 5e4415427a58e3ea4fd6abd1899307b9df9ab155 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 16:25:20 +0200 Subject: [PATCH 0749/1192] OSX `touch` has no "--reference" long-option, only "-r" --- doc/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/makefile b/doc/makefile index 8a8085432..8becfef6d 100644 --- a/doc/makefile +++ b/doc/makefile @@ -26,14 +26,14 @@ doxy: doxygen crypt.pdf: crypt.tex rm -f crypt.pdf $(LEFTOVERS) cp crypt.tex crypt.bak - touch --reference=crypt.tex crypt.bak + touch -r crypt.tex crypt.bak (printf "%s" "\def\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex printf "%s\n" "\pdfinfo{" >> crypt-deterministic.tex printf "%s\n" " /CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex printf "%s\n}\n" " /ModDate (\fixedpdfdate)" >> crypt-deterministic.tex cat crypt.tex >> crypt-deterministic.tex mv crypt-deterministic.tex crypt.tex - touch --reference=crypt.bak crypt.tex + touch -r crypt.bak crypt.tex echo "hello" > crypt.ind latex crypt $(silent_stdout) latex crypt $(silent_stdout) From add3495bfc47c1bc76d0c820176cd34a0526cde5 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 17:14:18 +0200 Subject: [PATCH 0750/1192] fix perlcritics warnings in helper.pl --- helper.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helper.pl b/helper.pl index b71569fbe..30b1b38d4 100755 --- a/helper.pl +++ b/helper.pl @@ -72,7 +72,7 @@ sub check_defines { my $cryp_c = read_file("src/misc/crypt/crypt.c"); $cust_h =~ s|/\*.*?\*/||sg; # remove comments $cryp_c =~ s|/\*.*?\*/||sg; # remove comments - my %def = map { $_ => 1 } map { $_ =~ s/^\s*#define\s+(LTC_\S+).*$/$1/; $_ } grep { /^\s*#define\s+LTC_\S+/ } split /\n/, $cust_h; + my %def = map { $_ => 1 } map { my $x = $_; $x =~ s/^\s*#define\s+(LTC_\S+).*$/$1/; $x } grep { /^\s*#define\s+LTC_\S+/ } split /\n/, $cust_h; for my $d (sort keys %def) { next if $d =~ /^LTC_(DH\d+|ECC\d+|ECC_\S+|MPI|MUTEX_\S+\(x\)|NO_\S+)$/; warn "$d missing in src/misc/crypt/crypt.c\n" and $fails++ if $cryp_c !~ /\Q$d\E/; @@ -86,7 +86,7 @@ sub check_hashes { my @descriptors; find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, './src/hashes/'); for my $f (@src) { - my @n = map { $_ =~ s/^.*?ltc_hash_descriptor\s+(\S+).*$/$1/; $_ } grep { $_ =~ /ltc_hash_descriptor/ } split /\n/, read_file($f); + my @n = map { my $x = $_; $x =~ s/^.*?ltc_hash_descriptor\s+(\S+).*$/$1/; $x } grep { $_ =~ /ltc_hash_descriptor/ } split /\n/, read_file($f); push @descriptors, @n if @n; } my $fails = 0; @@ -236,12 +236,12 @@ sub process_makefiles { my @t = qw(); find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(no_prng|test_driver|x86_prof|_tests?).c$/ } }, 'testprof'); - my @o = sort ('src/ciphers/aes/aes_enc.o', map { $_ =~ s/\.c$/.o/; $_ } @c); + my @o = sort ('src/ciphers/aes/aes_enc.o', map { my $x = $_; $x =~ s/\.c$/.o/; $x } @c); my $var_o = prepare_variable("OBJECTS", @o); my $var_h = prepare_variable("HEADERS", (sort @h)); (my $var_obj = $var_o) =~ s/\.o\b/.obj/sg; - my $var_to = prepare_variable("TOBJECTS", sort map { $_ =~ s/\.c$/.o/; $_ } @t); + my $var_to = prepare_variable("TOBJECTS", sort map { my $x = $_; $x =~ s/\.c$/.o/; $x } @t); (my $var_tobj = $var_to) =~ s/\.o\b/.obj/sg; my @ver_version = version_form_tomcrypt_h("src/headers/tomcrypt.h"); From 85197a485a5eb35a80dddf56931fccb215bc0824 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 17:15:56 +0200 Subject: [PATCH 0751/1192] do not exclude anything during make zipup --- .gitattributes | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitattributes b/.gitattributes index c76e0d25e..523895348 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,3 @@ -/.* export-ignore -/hooks export-ignore -doc/*.html export-ignore -coverity.sh export-ignore +#/.* export-ignore /** export-subst From ab34b0bd93188f2f6b9b0778bcf3bbdd6f9720ad Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 17:17:05 +0200 Subject: [PATCH 0752/1192] or perhaps exclude .git* --- .gitattributes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 523895348..2861792c0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ -#/.* export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore /** export-subst From 39f12dafc4a5421cec5f1a4777e901fd5a90afa2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 18:58:30 +0200 Subject: [PATCH 0753/1192] make travis build a bit more verbose --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c62c21a30..11170671e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: c compiler: - gcc - clang -script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" +script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" env: - | BUILDSCRIPT="check_source.sh" @@ -95,6 +95,7 @@ after_failure: - cat test_std.txt - cat test_err.txt after_script: + - cat gcc_1.txt - cat gcc_2.txt notifications: irc: "chat.freenode.net#libtom-notifications" From 12cf50d4e220028e9692f5c8754d927ce66f5411 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 19:11:16 +0200 Subject: [PATCH 0754/1192] move translation rule after modifications of CFLAGS --- makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 0ead01d14..70f2c66c1 100644 --- a/makefile +++ b/makefile @@ -13,12 +13,6 @@ silent=@ silent_stdout= > /dev/null endif -%.o: %.c -ifneq ($V,1) - @echo " * ${CC} $@" -endif - ${silent} ${CC} ${CFLAGS} -c $< -o $@ - # ranlib tools ifndef RANLIB ifeq ($(PLATFORM), Darwin) @@ -233,6 +227,12 @@ $(OBJECTS): $(HEADERS) $(DOBJECTS): $(HEADERS) $(THEADERS) $(TOBJECTS): $(HEADERS) $(THEADERS) +.c.o: +ifneq ($V,1) + @echo " * ${CC} $@" +endif + ${silent} ${CC} ${CFLAGS} -c $< -o $@ + $(LIBNAME): $(OBJECTS) ifneq ($V,1) @echo " * ${AR} $@" From 37fa03829c4afc78dfecf3c9ca8ae645d59abf92 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 19:39:55 +0200 Subject: [PATCH 0755/1192] use gnu-make `wildcard` to get source files --- makefile.include | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile.include b/makefile.include index 081254aba..6af569f8a 100644 --- a/makefile.include +++ b/makefile.include @@ -85,8 +85,8 @@ endif #List of demo objects -DSOURCES != ls demos/*.c -DOBJECTS = ${DSOURCES:.c=.o} +DSOURCES = $(wildcard demos/*.c) +DOBJECTS = $(DSOURCES:.c=.o) #List of testprof headers THEADERS != ls testprof/*.h From 7ed5a832b02daf9fa54f061c4445d9e8e69b72fb Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 5 May 2017 21:10:28 +0200 Subject: [PATCH 0756/1192] tuning makefile.msvc+mingw --- helper.pl | 2 +- makefile.mingw | 20 +++++----- makefile.msvc | 104 ++++++++++++++++++++++++++++++++----------------- 3 files changed, 80 insertions(+), 46 deletions(-) diff --git a/helper.pl b/helper.pl index 30b1b38d4..8f729fbfc 100755 --- a/helper.pl +++ b/helper.pl @@ -262,7 +262,7 @@ sub process_makefiles { # update OBJECTS + HEADERS in makefile* for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile.include /) { my $old = read_file($m); - my $new = $m eq 'makefile.msvc' ? patch_makefile($old, $var_obj, $var_h, $var_to, @ver_version) + my $new = $m eq 'makefile.msvc' ? patch_makefile($old, $var_obj, $var_h, $var_tobj, @ver_version) : patch_makefile($old, $var_o, $var_h, $var_to, @ver_version); if ($old ne $new) { write_file($m, $new) if $write; diff --git a/makefile.mingw b/makefile.mingw index 1270dea6f..52b0c24a4 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -7,13 +7,11 @@ # # gmake -f makefile.mingw all # test.exe -# gmake -f makefile.mingw install +# gmake -f makefile.mingw DESTDIR=c:\devel\libtom install # #OR: # # gmake -f makefile.mingw CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -Ic:/path/to/libtommath" EXTRALIBS="-Lc:/path/to/libtommath -ltommath" all -# test.exe -# gmake -f makefile.mingw DESTDIR=c:\devel\libtom install # #The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs @@ -254,24 +252,26 @@ $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) $(STRIP) -S $(LIBMAIN_D) #Demo tools/utilities -hashsum: demos/hashsum.o $(LIBMAIN_S) +hashsum.exe: demos/hashsum.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -crypt: demos/crypt.o $(LIBMAIN_S) +ltcrypt.exe: demos/ltcrypt.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -small: demos/small.o $(LIBMAIN_S) +small.exe: demos/small.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -tv_gen: demos/tv_gen.o $(LIBMAIN_S) +tv_gen.exe: demos/tv_gen.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ #Tests + timing tests -timing: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) +timing.exe: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: timing.exe -test: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) +test.exe: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) $(CC) $? $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: test.exe -all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) hashsum crypt small tv_gen timing test +all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe + +test: test.exe clean: @cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul diff --git a/makefile.msvc b/makefile.msvc index 303633636..8a6478357 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -1,14 +1,33 @@ +# MAKEFILE for MS Windows (nmake + Windows SDK) # -# open a command prompt with WinSDK variables set -# and start: nmake -f makefile.msvc +# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh + +### USAGE: +# Open a command prompt with WinSDK variables set and start: +# +# nmake -f makefile.msvc all +# test.exe +# nmake -f makefile.msvc DESTDIR=c:\devel\libtom install +# +#OR: # +# nmake -f makefile.msvc CFLAGS="/DUSE_LTM /DLTM_DESC /Ic:\path\to\libtommath" EXTRALIBS="c:\path\to\libtommath\tommath.lib" all +# + +#The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs +DESTDIR = c:\devel +CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath +EXTRALIBS = ../libtommath/tommath.lib -EXTRALIBS=../libtommath/tommath.lib -EXTRAINCLUDE=../libtommath +#Compilation flags +LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itestprof/ /D_CRT_SECURE_NO_WARNINGS /DLTC_SOURCE /W3 +LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) -CFLAGS = /nologo /Isrc/headers/ /I$(EXTRAINCLUDE) /Itestprof/ /Ox /D_CRT_SECURE_NO_WARNINGS /DUSE_LTM /DLTM_DESC /DLTC_SOURCE /DLTC_NO_PROTOTYPES /W3 $(CF) +#Libraries to be created +LIBMAIN_S =tomcrypt.lib +LIBTEST_S =tomcrypt_prof.lib -# List of objects to compile (all goes to libtomcrypt.lib) +#List of objects to compile (all goes to tomcrypt.lib) OBJECTS=src/ciphers/aes/aes.obj src/ciphers/aes/aes_enc.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \ src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \ src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \ @@ -160,51 +179,66 @@ src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/st src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128.obj \ src/stream/sober128/sober128_test.obj -# List of test objects to compile (all goes to libtomcrypt_prof.lib) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ -testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ -testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ -testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ -testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o +#List of test objects to compile (all goes to tomcrypt_prof.lib) +TOBJECTS=testprof/base64_test.obj testprof/cipher_hash_test.obj testprof/der_tests.obj testprof/dh_test.obj \ +testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_test.obj testprof/katja_test.obj testprof/mac_test.obj \ +testprof/misc_test.obj testprof/modes_test.obj testprof/multi_test.obj testprof/no_prng.obj \ +testprof/pkcs_1_eme_test.obj testprof/pkcs_1_emsa_test.obj testprof/pkcs_1_oaep_test.obj \ +testprof/pkcs_1_pss_test.obj testprof/pkcs_1_test.obj testprof/rotate_test.obj testprof/rsa_test.obj \ +testprof/store_test.obj testprof/test_driver.obj testprof/x86_prof.obj -# The following headers will be installed by "make install" +#The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -default: library - .c.obj: - $(CC) $(CFLAGS) /c $< /Fo$@ + $(CC) $(LTC_CFLAGS) /c $< /Fo$@ + +#The default rule for make builds the tomcrypt.lib library (static) +default: $(LIBMAIN_S) #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - $(CC) $(CFLAGS) /DENCRYPT_ONLY /c src/ciphers/aes/aes.c /Fosrc/ciphers/aes/aes_enc.obj + $(CC) $(LTC_CFLAGS) /DENCRYPT_ONLY /c src/ciphers/aes/aes.c /Fosrc/ciphers/aes/aes_enc.obj -library: $(OBJECTS) $(TOBJECTS) - lib /out:tomcrypt.lib $(OBJECTS) - lib /out:tomcrypt_prof.lib $(TOBJECTS) +$(LIBMAIN_S): $(OBJECTS) + lib /out:$(LIBMAIN_S) $(OBJECTS) -tv_gen: demos/tv_gen.c library - cl $(CFLAGS) demos/tv_gen.c tomcrypt.lib advapi32.lib $(EXTRALIBS) +$(LIBTEST_S): $(TOBJECTS) + lib /out:$(LIBTEST_S) $(TOBJECTS) -hashsum: demos/hashsum.c library - cl $(CFLAGS) demos/hashsum.c tomcrypt.lib advapi32.lib $(EXTRALIBS) +tv_gen.exe: demos/tv_gen.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/tv_gen.c $(LIBMAIN_S) $(LTC_LDFLAGS) -test: demos/test.c library - cl $(CFLAGS) demos/test.c tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) +hashsum.exe: demos/hashsum.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/hashsum.c $(LIBMAIN_S) $(LTC_LDFLAGS) -timing: demos/timing.c library - cl $(CFLAGS) demos/timing.c tomcrypt_prof.lib tomcrypt.lib advapi32.lib $(EXTRALIBS) +ltcrypt.exe: demos/ltcrypt.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/ltcrypt.c $(LIBMAIN_S) $(LTC_LDFLAGS) -all_test: test tv_gen hashsum timing +small.exe: demos/small.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/small.c $(LIBMAIN_S) $(LTC_LDFLAGS) -clean: - cmd /c del /Q /S *.OBJ *.LIB *.EXE +test.exe: demos/test.c $(LIBMAIN_S) $(LIBTEST_S) + cl $(LTC_CFLAGS) demos/test.c $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) + +timing.exe: demos/timing.c $(LIBMAIN_S) $(LIBTEST_S) + cl $(LTC_CFLAGS) demos/timing.c $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -# $Source$ -# $Revision$ -# $Date$ +all: $(LIBMAIN_S) $(LIBTEST_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe + +test: test.exe + +clean: + @cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul + +install: $(LIBMAIN_S) $(LIBTEST_S) + cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" + cmd /c if not exist "$(DESTDIR)\lib" mkdir "$(DESTDIR)\lib" + cmd /c if not exist "$(DESTDIR)\include" mkdir "$(DESTDIR)\include" + copy /Y hashsum.exe "$(DESTDIR)\bin" + copy /Y $(LIBMAIN_S) "$(DESTDIR)\lib" + copy /Y src\headers\tomcrypt*.h "$(DESTDIR)\include" \ No newline at end of file From 3c5ec6b6996d03cf032b68d904b6ce9cfacabd0e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 7 May 2017 22:30:59 +0200 Subject: [PATCH 0757/1192] split-out binary installation in separate install target --- makefile | 8 +++++--- makefile.shared | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 70f2c66c1..283e0ce5c 100644 --- a/makefile +++ b/makefile @@ -290,19 +290,21 @@ endif ifndef NODOCS install: library docs else -install: library $(USEFUL_DEMOS) +install: library endif install -d $(LIBPATH) install -d $(INCPATH) - install -d $(BINPATH) install -m 644 $(LIBNAME) $(LIBPATH) install -m 644 $(HEADERS) $(INCPATH) - install -m 644 $(USEFUL_DEMOS) $(BINPATH) ifndef NODOCS install -d $(DATAPATH) install -m 644 doc/crypt.pdf $(DATAPATH) endif +install_bins: $(USEFUL_DEMOS) + install -d $(BINPATH) + install -m 775 $(USEFUL_DEMOS) $(BINPATH) + install_test: $(LIBTEST) install -d $(LIBPATH) install -d $(INCPATH) diff --git a/makefile.shared b/makefile.shared index c14647f5f..d890b1b88 100644 --- a/makefile.shared +++ b/makefile.shared @@ -239,16 +239,18 @@ $(LIBNAME): $(OBJECTS) $(LIBTEST): $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) -install: $(LIBNAME) $(USEFUL_DEMOS) +install: $(LIBNAME) install -d $(LIBPATH)/pkgconfig install -d $(INCPATH) - install -d $(BINPATH) $(LT) --mode=install install -c $(LIBNAME) $(LIBPATH)/$(LIBNAME) install -m 644 $(HEADERS) $(INCPATH) - install -m 775 $(USEFUL_DEMOS) $(BINPATH) sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(LIBPATH)/pkgconfig/libtomcrypt.pc install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/libtomcrypt.pc +install_bins: $(USEFUL_DEMOS) + install -d $(BINPATH) + $(LT) --mode=install install -c $(USEFUL_DEMOS) $(BINPATH) + install_test: $(LIBTEST) install -d $(LIBPATH) install -d $(INCPATH) From ee0874b50b97d1916bcf4977f66dc5441d410420 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 7 May 2017 23:01:27 +0200 Subject: [PATCH 0758/1192] minor improvements --- makefile | 9 +++------ makefile.include | 2 +- makefile.shared | 8 +++++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/makefile b/makefile index 283e0ce5c..599633f94 100644 --- a/makefile +++ b/makefile @@ -197,9 +197,6 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -#Compressed filenames -COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip - #The default rule for make builds the libtomcrypt library. default:library @@ -253,13 +250,13 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -timing: library $(LIBTEST) $(TIMINGS) +timing: $(LIBNAME) $(LIBTEST) $(TIMINGS) ifneq ($V,1) @echo " * ${CC} $@" endif ${silent} $(CC) $(LDFLAGS) $(TIMINGS) $(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) -test: library $(LIBTEST) $(TESTS) +test: $(LIBNAME) $(LIBTEST) $(TESTS) ifneq ($V,1) @echo " * ${CC} $@" endif @@ -267,7 +264,7 @@ endif # build the demos from a template define DEMO_template -$(1): demos/$(1).o library +$(1): demos/$(1).o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif diff --git a/makefile.include b/makefile.include index 6af569f8a..7fe26a77f 100644 --- a/makefile.include +++ b/makefile.include @@ -89,7 +89,7 @@ DSOURCES = $(wildcard demos/*.c) DOBJECTS = $(DSOURCES:.c=.o) #List of testprof headers -THEADERS != ls testprof/*.h +THEADERS = $(wildcard testprof/*.h) TIMING=timing TEST=test diff --git a/makefile.shared b/makefile.shared index d890b1b88..637927dd8 100644 --- a/makefile.shared +++ b/makefile.shared @@ -203,7 +203,7 @@ src/headers/tomcrypt_prng.h #END_INS #The default rule for make builds the libtomcrypt library. -default: library +default: $(LIBNAME) #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c @@ -257,10 +257,10 @@ install_test: $(LIBTEST) install -m 644 testprof/tomcrypt_test.h $(INCPATH) $(LT) --mode=install install -c $(LIBTEST) $(LIBPATH)/$(LIBTEST) -test: library $(LIBTEST) $(TESTS) +test: $(LIBNAME) $(LIBTEST) $(TESTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -timing: library $(LIBTEST) $(TIMINGS) +timing: $(LIBNAME) $(LIBTEST) $(TIMINGS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) # build the demos from a template @@ -274,6 +274,8 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) +bins: $(USEFUL_DEMOS) + all_test: test tv_gen $(DEMOS) # $Source$ From abe9116de57dbd58b7d86db541814c47a22504b3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 7 May 2017 23:07:57 +0200 Subject: [PATCH 0759/1192] introduce makefile.common --- makefile | 60 +---------------------------------------------- makefile.common | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ makefile.shared | 4 +--- 3 files changed, 64 insertions(+), 62 deletions(-) create mode 100644 makefile.common diff --git a/makefile b/makefile index 599633f94..a91793120 100644 --- a/makefile +++ b/makefile @@ -273,9 +273,6 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) -bins: $(USEFUL_DEMOS) - -all_test: test tv_gen $(DEMOS) ifeq ($(COVERAGE),1) all_test: LIB_PRE = -Wl,--whole-archive all_test: LIB_POST = -Wl,--no-whole-archive @@ -308,9 +305,6 @@ install_test: $(LIBTEST) install -m 644 $(LIBTEST) $(LIBPATH) install -m 644 testprof/tomcrypt_test.h $(INCPATH) -install_hooks: - for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done - profile: CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" ./timing @@ -345,61 +339,9 @@ coverage: LIB_POST = -Wl,--no-whole-archive coverage: test ./test - # cleans everything - coverage output and standard 'clean' cleancov: cleancov-clean clean -#This rule cleans the source tree of all compiled code, not including the pdf -#documentation. -clean: - rm -f `find . -type f -name "*.o" | xargs` - rm -f `find . -type f -name "*.lo" | xargs` - rm -f `find . -type f -name "*.a" | xargs` - rm -f `find . -type f -name "*.la" | xargs` - rm -f `find . -type f -name "*.obj" | xargs` - rm -f `find . -type f -name "*.lib" | xargs` - rm -f `find . -type f -name "*.exe" | xargs` - rm -f `find . -type f -name "*.dll" | xargs` - rm -f `find . -type f -name "*.so" | xargs` - rm -f `find . -type f -name "*.gcov" | xargs` - rm -f `find . -type f -name "*.gcda" | xargs` - rm -f `find . -type f -name "*.gcno" | xargs` - rm -f `find . -type f -name "*.il" | xargs` - rm -f `find . -type f -name "*.dyn" | xargs` - rm -f `find . -type f -name "*.dpi" | xargs` - rm -rf `find . -type d -name "*.libs" | xargs` - rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc - rm -f $(TIMING) $(TEST) $(DEMOS) - rm -rf doc/doxygen - rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` - rm -f *.txt - -#build the doxy files (requires Doxygen, tetex and patience) -doxygen: - $(MAKE) -C doc/ doxygen V=$(V) - -doxy: - $(MAKE) -C doc/ doxy V=$(V) - -docs: - $(MAKE) -C doc/ crypt.pdf V=$(V) - -zipup: doc/crypt.pdf - @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) - @perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 ) - rm -rf libtomcrypt-$(VERSION) libtomcrypt-$(VERSION).* - # files/dirs excluded from "git archive" are defined in .gitattributes - git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x - mkdir -p libtomcrypt-$(VERSION)/doc - cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf - tar -cJf libtomcrypt-$(VERSION).tar.xz libtomcrypt-$(VERSION) - zip -9rq libtomcrypt-$(VERSION).zip libtomcrypt-$(VERSION) - rm -rf libtomcrypt-$(VERSION) - gpg -b -a libtomcrypt-$(VERSION).tar.xz - gpg -b -a libtomcrypt-$(VERSION).zip - -codecheck: - perl helper.pl -a - perlcritic *.pl +include makefile.common # git commit: $Format:%h$ $Format:%ai$ diff --git a/makefile.common b/makefile.common new file mode 100644 index 000000000..95a4d197d --- /dev/null +++ b/makefile.common @@ -0,0 +1,62 @@ +#common make targets shared over multiple makefiles + +bins: $(USEFUL_DEMOS) + +all_test: test tv_gen $(DEMOS) + +#build the doxy files (requires Doxygen, tetex and patience) +doxygen: + $(MAKE) -C doc/ doxygen V=$(V) + +doxy: + $(MAKE) -C doc/ doxy V=$(V) + +docs: + $(MAKE) -C doc/ crypt.pdf V=$(V) + +install_hooks: + for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done + +#This rule cleans the source tree of all compiled code, not including the pdf +#documentation. +clean: + rm -f `find . -type f -name "*.o" | xargs` + rm -f `find . -type f -name "*.lo" | xargs` + rm -f `find . -type f -name "*.a" | xargs` + rm -f `find . -type f -name "*.la" | xargs` + rm -f `find . -type f -name "*.obj" | xargs` + rm -f `find . -type f -name "*.lib" | xargs` + rm -f `find . -type f -name "*.exe" | xargs` + rm -f `find . -type f -name "*.dll" | xargs` + rm -f `find . -type f -name "*.so" | xargs` + rm -f `find . -type f -name "*.gcov" | xargs` + rm -f `find . -type f -name "*.gcda" | xargs` + rm -f `find . -type f -name "*.gcno" | xargs` + rm -f `find . -type f -name "*.il" | xargs` + rm -f `find . -type f -name "*.dyn" | xargs` + rm -f `find . -type f -name "*.dpi" | xargs` + rm -rf `find . -type d -name "*.libs" | xargs` + rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc + rm -f $(TIMING) $(TEST) $(DEMOS) + rm -rf doc/doxygen + rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` + rm -f *.txt + rm -f *.pc + +zipup: docs + @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) + @perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 ) + rm -rf libtomcrypt-$(VERSION) libtomcrypt-$(VERSION).* + # files/dirs excluded from "git archive" are defined in .gitattributes + git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x + mkdir -p libtomcrypt-$(VERSION)/doc + cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf + tar -cJf libtomcrypt-$(VERSION).tar.xz libtomcrypt-$(VERSION) + zip -9rq libtomcrypt-$(VERSION).zip libtomcrypt-$(VERSION) + rm -rf libtomcrypt-$(VERSION) + gpg -b -a libtomcrypt-$(VERSION).tar.xz + gpg -b -a libtomcrypt-$(VERSION).zip + +codecheck: + perl helper.pl -a + perlcritic *.pl diff --git a/makefile.shared b/makefile.shared index 637927dd8..2bcd9f1d4 100644 --- a/makefile.shared +++ b/makefile.shared @@ -274,9 +274,7 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) -bins: $(USEFUL_DEMOS) - -all_test: test tv_gen $(DEMOS) +include makefile.common # $Source$ # $Revision$ From 794a416715f0c58336f3864b51c61d3cb5dff358 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 8 May 2017 17:36:55 +0200 Subject: [PATCH 0760/1192] fix libtomcrypt.pc installation --- .gitignore | 1 + makefile.shared | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 02a1ffd81..b845ffc9d 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ timing.exe *.gcda *.gcno *.gcov +libtomcrypt.pc coverage/ coverage*.info diff --git a/makefile.shared b/makefile.shared index 2bcd9f1d4..43b2efa50 100644 --- a/makefile.shared +++ b/makefile.shared @@ -244,7 +244,7 @@ install: $(LIBNAME) install -d $(INCPATH) $(LT) --mode=install install -c $(LIBNAME) $(LIBPATH)/$(LIBNAME) install -m 644 $(HEADERS) $(INCPATH) - sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(LIBPATH)/pkgconfig/libtomcrypt.pc + sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/libtomcrypt.pc install_bins: $(USEFUL_DEMOS) From 0cd9e94736d7a408641b99de09a2c3b806dcfb23 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 8 May 2017 18:09:45 +0200 Subject: [PATCH 0761/1192] Partially revert "don't include testprof for library build" This partially reverts commit 3a1cbcfee2a16d15167876423b6ca720458e801a. --- makefile.mingw | 16 ++-------------- makefile.unix | 15 ++------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 52b0c24a4..12d75b42e 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -25,7 +25,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = -L../libtommath -ltommath #Compilation flags -LTC_CFLAGS = $(CFLAGS) -Isrc/headers -DLTC_SOURCE +LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) #Libraries to be created @@ -201,16 +201,6 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -THEADERS != ls testprof/*.h - -#List of demo objects (only used to create a special rule to extend LTC_CFLAGS) -DSOURCES != ls demos/*.c -DOBJECTS = ${DSOURCES:.c=.o} - -#SPECIAL: demo- and test-objects required include-path "testprof" -$(DOBJECTS): LTC_CFLAGS += -Itestprof -$(TOBJECTS): LTC_CFLAGS += -Itestprof - .c.o: $(CC) $(LTC_CFLAGS) -c $< -o $@ @@ -230,11 +220,9 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c - #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(DOBJECTS): $(HEADERS) $(THEADERS) -$(TOBJECTS): $(HEADERS) $(THEADERS) +$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h #Create libtomcrypt_prof.a $(LIBTEST_S): $(TOBJECTS) diff --git a/makefile.unix b/makefile.unix index 7d0d3a04f..708d9117e 100644 --- a/makefile.unix +++ b/makefile.unix @@ -32,7 +32,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = ../libtommath/libtommath.a #Compilation flags -LTC_CFLAGS = $(CFLAGS) -Isrc/headers -DLTC_SOURCE +LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) VERSION=1.17 @@ -207,8 +207,6 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -THEADERS != ls testprof/*.h - #The default rule for make builds the libtomcrypt.a library (static) default: library @@ -225,21 +223,12 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c -#List of demo objects (only used to create a special rule to extend LTC_CFLAGS) -DSOURCES != ls demos/*.c -DOBJECTS = ${DSOURCES:.c=.o} - #This rule makes the libtomcrypt library. library: $(LIBMAIN_S) #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(DOBJECTS): $(HEADERS) $(THEADERS) -$(TOBJECTS): $(HEADERS) $(THEADERS) - -#SPECIAL: demo- and test-objects required include-path "testprof" -$(DOBJECTS): LTC_CFLAGS += -Itestprof -$(TOBJECTS): LTC_CFLAGS += -Itestprof +$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h #This is necessary for compatibility with BSD make (namely on OpenBSD) .SUFFIXES: .o .c From 2b9dbb4ff7feff2d4fbc5f822881ab2d9362a9fa Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 9 May 2017 18:27:47 +0200 Subject: [PATCH 0762/1192] cosmetics in makefile.unix|mingw|msvc --- makefile.mingw | 23 ++++++++++++++---- makefile.msvc | 63 +++++++++++++++++++++++++++++++++++--------------- makefile.unix | 20 +++++++++++----- 3 files changed, 76 insertions(+), 30 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 12d75b42e..5b1cbc274 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -9,7 +9,7 @@ # test.exe # gmake -f makefile.mingw DESTDIR=c:\devel\libtom install # -#OR: +#Or: # # gmake -f makefile.mingw CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -Ic:/path/to/libtommath" EXTRALIBS="-Lc:/path/to/libtommath -ltommath" all # @@ -27,6 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath #Compilation flags LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) +VERSION=1.17 #Libraries to be created LIBMAIN_S =libtomcrypt.a @@ -201,9 +202,6 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -.c.o: - $(CC) $(LTC_CFLAGS) -c $< -o $@ - #The default rule for make builds the libtomcrypt.a library (static) default: $(LIBMAIN_S) @@ -224,6 +222,9 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c $(OBJECTS): $(HEADERS) $(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h +.c.o: + $(CC) $(LTC_CFLAGS) -c $< -o $@ + #Create libtomcrypt_prof.a $(LIBTEST_S): $(TOBJECTS) $(AR) $(ARFLAGS) $@ $(TOBJECTS) @@ -253,7 +254,7 @@ tv_gen.exe: demos/tv_gen.o $(LIBMAIN_S) timing.exe: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: timing.exe -test.exe: demos/test.o $(LIBMAIN_S) $(LIBTEST_S) +test.exe: demos/test.o $(LIBTEST_S) $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: test.exe @@ -262,8 +263,10 @@ all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) hashsum.exe ltcrypt.exe test: test.exe clean: + @cmd /c del /Q *_tv.txt 2>nul @cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul +#Install the library + headers install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" cmd /c if not exist "$(DESTDIR)\lib" mkdir "$(DESTDIR)\lib" @@ -272,3 +275,13 @@ install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) copy /Y $(LIBMAIN_I) "$(DESTDIR)\lib" copy /Y $(LIBMAIN_D) "$(DESTDIR)\bin" copy /Y src\headers\tomcrypt*.h "$(DESTDIR)\include" + +#Install useful tools +install_bins: hashsum + cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" + copy /Y hashsum.exe "$(DESTDIR)\bin" + +#Install documentation +install_docs: doc/crypt.pdf + cmd /c if not exist "$(DESTDIR)\doc" mkdir "$(DESTDIR)\doc" + copy /Y doc\crypt.pdf "$(DESTDIR)\doc" diff --git a/makefile.msvc b/makefile.msvc index 8a6478357..2c434afb9 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -9,9 +9,9 @@ # test.exe # nmake -f makefile.msvc DESTDIR=c:\devel\libtom install # -#OR: +#Or: # -# nmake -f makefile.msvc CFLAGS="/DUSE_LTM /DLTM_DESC /Ic:\path\to\libtommath" EXTRALIBS="c:\path\to\libtommath\tommath.lib" all +# nmake -f makefile.msvc CFLAGS="/DUSE_LTM /DLTM_DESC /Ic:\path\to\libtommath" EXTRALIBS=c:\path\to\libtommath\tommath.lib all # #The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs @@ -20,10 +20,11 @@ CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath EXTRALIBS = ../libtommath/tommath.lib #Compilation flags -LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itestprof/ /D_CRT_SECURE_NO_WARNINGS /DLTC_SOURCE /W3 +LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itestprof/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) +VERSION=1.17 -#Libraries to be created +#Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib LIBTEST_S =tomcrypt_prof.lib @@ -194,51 +195,75 @@ src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_ma src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ src/headers/tomcrypt_prng.h -.c.obj: - $(CC) $(LTC_CFLAGS) /c $< /Fo$@ - #The default rule for make builds the tomcrypt.lib library (static) default: $(LIBMAIN_S) -#ciphers come in two flavours... enc+dec and enc +#SPECIAL: AES comes in two flavours - enc+dec and enc-only src/ciphers/aes/aes_enc.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(CC) $(LTC_CFLAGS) /DENCRYPT_ONLY /c src/ciphers/aes/aes.c /Fosrc/ciphers/aes/aes_enc.obj -$(LIBMAIN_S): $(OBJECTS) - lib /out:$(LIBMAIN_S) $(OBJECTS) +#SPECIAL: these are the rules to make certain object files +src/ciphers/aes/aes.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c +src/ciphers/twofish/twofish.obj: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c +src/hashes/whirl/whirl.obj: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c +src/hashes/sha2/sha512.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c +src/hashes/sha2/sha512_224.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c +src/hashes/sha2/sha512_256.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c +src/hashes/sha2/sha256.obj: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c + +#Dependencies on *.h +$(OBJECTS): $(HEADERS) +$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h + +.c.obj: + $(CC) $(LTC_CFLAGS) /c $< /Fo$@ +#Create tomcrypt_prof.lib $(LIBTEST_S): $(TOBJECTS) lib /out:$(LIBTEST_S) $(TOBJECTS) -tv_gen.exe: demos/tv_gen.c $(LIBMAIN_S) - cl $(LTC_CFLAGS) demos/tv_gen.c $(LIBMAIN_S) $(LTC_LDFLAGS) +#Create tomcrypt.lib +$(LIBMAIN_S): $(OBJECTS) + lib /out:$(LIBMAIN_S) $(OBJECTS) +#Demo tools/utilities hashsum.exe: demos/hashsum.c $(LIBMAIN_S) cl $(LTC_CFLAGS) demos/hashsum.c $(LIBMAIN_S) $(LTC_LDFLAGS) - ltcrypt.exe: demos/ltcrypt.c $(LIBMAIN_S) cl $(LTC_CFLAGS) demos/ltcrypt.c $(LIBMAIN_S) $(LTC_LDFLAGS) - small.exe: demos/small.c $(LIBMAIN_S) cl $(LTC_CFLAGS) demos/small.c $(LIBMAIN_S) $(LTC_LDFLAGS) +tv_gen.exe: demos/tv_gen.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/tv_gen.c $(LIBMAIN_S) $(LTC_LDFLAGS) -test.exe: demos/test.c $(LIBMAIN_S) $(LIBTEST_S) - cl $(LTC_CFLAGS) demos/test.c $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) - +#Tests + timing tests timing.exe: demos/timing.c $(LIBMAIN_S) $(LIBTEST_S) cl $(LTC_CFLAGS) demos/timing.c $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) +test.exe: demos/test.c $(LIBMAIN_S) $(LIBTEST_S) + cl $(LTC_CFLAGS) demos/test.c $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) all: $(LIBMAIN_S) $(LIBTEST_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe test: test.exe clean: + @cmd /c del /Q *_tv.txt 2>nul @cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul +#Install the library + headers install: $(LIBMAIN_S) $(LIBTEST_S) cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" cmd /c if not exist "$(DESTDIR)\lib" mkdir "$(DESTDIR)\lib" cmd /c if not exist "$(DESTDIR)\include" mkdir "$(DESTDIR)\include" - copy /Y hashsum.exe "$(DESTDIR)\bin" copy /Y $(LIBMAIN_S) "$(DESTDIR)\lib" - copy /Y src\headers\tomcrypt*.h "$(DESTDIR)\include" \ No newline at end of file + copy /Y src\headers\tomcrypt*.h "$(DESTDIR)\include" + +#Install useful tools +install_bins: hashsum + cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" + copy /Y hashsum.exe "$(DESTDIR)\bin" + +#Install documentation +install_docs: doc/crypt.pdf + cmd /c if not exist "$(DESTDIR)\doc" mkdir "$(DESTDIR)\doc" + copy /Y doc\crypt.pdf "$(DESTDIR)\doc" diff --git a/makefile.unix b/makefile.unix index 708d9117e..b93315cd7 100644 --- a/makefile.unix +++ b/makefile.unix @@ -208,7 +208,7 @@ src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs. src/headers/tomcrypt_prng.h #The default rule for make builds the libtomcrypt.a library (static) -default: library +default: $(LIBMAIN_S) #SPECIAL: AES comes in two flavours - enc+dec and enc-only src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c @@ -223,9 +223,6 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c -#This rule makes the libtomcrypt library. -library: $(LIBMAIN_S) - #Dependencies on *.h $(OBJECTS): $(HEADERS) $(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h @@ -267,14 +264,25 @@ all: $(LIBMAIN_S) $(LIBTEST_S) hashsum ltcrypt small tv_gen timing test #NOTE: this makefile works also on cygwin, thus we need to delete *.exe clean: - -@rm -f $(OBJECTS) + -@rm -f $(OBJECTS) $(TOBJECTS) -@rm -f $(LIBMAIN_S) $(LIBTEST_S) - -@rm -f testprof/*.o demos/*.o + -@rm -f demos/*.o *_tv.txt -@rm -f test tv_gen hashsum crypt small timing -@rm -f test.exe tv_gen.exe hashsum.exe crypt.exe small.exe timing.exe +#Install the library + headers install: $(LIBMAIN_S) $(HEADERS) @mkdir -p $(DESTDIR)/include $(DESTDIR)/lib/pkgconfig @cp $(LIBMAIN_S) $(DESTDIR)/lib/ @cp $(HEADERS) $(DESTDIR)/include/ @sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)/lib/pkgconfig/libtomcrypt.pc + +#Install useful tools +install_bins: hashsum + @mkdir -p $(DESTDIR)/bin + @cp hashsum $(DESTDIR)/bin/ + +#Install documentation +install_docs: doc/crypt.pdf + @mkdir -p $(DESTDIR)/share/doc/libtomcrypt/pdf + @cp doc/crypt.pdf $(DESTDIR)/share/doc/libtomcrypt/pdf/ From d99695813386cc15e5fb6e8be90fe0f5b303527b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 9 May 2017 00:07:22 +0200 Subject: [PATCH 0763/1192] move biggest part of install rules to makefile.common --- makefile | 26 +++++--------------------- makefile.common | 28 ++++++++++++++++++++++++++++ makefile.shared | 21 ++++++--------------- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/makefile b/makefile index a91793120..e46d5edbe 100644 --- a/makefile +++ b/makefile @@ -21,6 +21,8 @@ else RANLIB:=$(PREFIX)ranlib endif endif +INSTALL_CMD = install + #Output filenames for various targets. ifndef LIBNAME @@ -281,29 +283,11 @@ endif #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. -ifndef NODOCS -install: library docs -else -install: library -endif - install -d $(LIBPATH) - install -d $(INCPATH) - install -m 644 $(LIBNAME) $(LIBPATH) - install -m 644 $(HEADERS) $(INCPATH) -ifndef NODOCS - install -d $(DATAPATH) - install -m 644 doc/crypt.pdf $(DATAPATH) -endif +install: .common_install -install_bins: $(USEFUL_DEMOS) - install -d $(BINPATH) - install -m 775 $(USEFUL_DEMOS) $(BINPATH) +install_bins: .common_install_bins -install_test: $(LIBTEST) - install -d $(LIBPATH) - install -d $(INCPATH) - install -m 644 $(LIBTEST) $(LIBPATH) - install -m 644 testprof/tomcrypt_test.h $(INCPATH) +install_test: .common_install_test profile: CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" diff --git a/makefile.common b/makefile.common index 95a4d197d..c550cc285 100644 --- a/makefile.common +++ b/makefile.common @@ -1,5 +1,9 @@ #common make targets shared over multiple makefiles +ifndef INSTALL_CMD +$(error your makefile must define INSTALL_CMD) +endif + bins: $(USEFUL_DEMOS) all_test: test tv_gen $(DEMOS) @@ -14,6 +18,30 @@ doxy: docs: $(MAKE) -C doc/ crypt.pdf V=$(V) + +install_all: install install_bins install_docs install_test + + +.common_install: $(LIBNAME) + install -d $(INCPATH) + install -d $(LIBPATH) + $(INSTALL_CMD) -m 644 $(LIBNAME) $(LIBPATH)/$(LIBNAME) + install -m 644 $(HEADERS) $(INCPATH) + +.common_install_bins: $(USEFUL_DEMOS) + install -d $(BINPATH) + $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(BINPATH) + +.common_install_test: $(LIBTEST) + install -d $(LIBPATH) + install -d $(INCPATH) + install -m 644 testprof/tomcrypt_test.h $(INCPATH) + $(INSTALL_CMD) -m 644 $(LIBTEST) $(LIBPATH) + +install_docs: docs + install -d $(DATAPATH) + install -m 644 doc/crypt.pdf $(DATAPATH) + install_hooks: for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done diff --git a/makefile.shared b/makefile.shared index 43b2efa50..ccc5a3184 100644 --- a/makefile.shared +++ b/makefile.shared @@ -16,7 +16,7 @@ ifndef LT endif endif LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) - +INSTALL_CMD = $(LT) --mode=install install #Output filenames for various targets. ifndef LIBTEST_S @@ -239,23 +239,14 @@ $(LIBNAME): $(OBJECTS) $(LIBTEST): $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) -install: $(LIBNAME) - install -d $(LIBPATH)/pkgconfig - install -d $(INCPATH) - $(LT) --mode=install install -c $(LIBNAME) $(LIBPATH)/$(LIBNAME) - install -m 644 $(HEADERS) $(INCPATH) +install: .common_install sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc - install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/libtomcrypt.pc + install -d $(LIBPATH)/pkgconfig + install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/ -install_bins: $(USEFUL_DEMOS) - install -d $(BINPATH) - $(LT) --mode=install install -c $(USEFUL_DEMOS) $(BINPATH) +install_bins: .common_install_bins -install_test: $(LIBTEST) - install -d $(LIBPATH) - install -d $(INCPATH) - install -m 644 testprof/tomcrypt_test.h $(INCPATH) - $(LT) --mode=install install -c $(LIBTEST) $(LIBPATH)/$(LIBTEST) +install_test: .common_install_test test: $(LIBNAME) $(LIBTEST) $(TESTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) From 6cd8f2504b75cabbe81d84157bd3e4e21d996d13 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 9 May 2017 11:59:35 +0200 Subject: [PATCH 0764/1192] clean-up some makefiles move shared variables between makefile and makefile.shared to makefile.include --- makefile | 190 ---------------------------------------------- makefile.include | 191 ++++++++++++++++++++++++++++++++++++++++++++++ makefile.shared | 194 ----------------------------------------------- updatemakes.sh | 2 +- 4 files changed, 192 insertions(+), 385 deletions(-) diff --git a/makefile b/makefile index e46d5edbe..bfc5a4ba8 100644 --- a/makefile +++ b/makefile @@ -32,200 +32,10 @@ ifndef LIBTEST LIBTEST=libtomcrypt_prof.a endif -# List of objects to compile (all goes to libtomcrypt.a) -OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ -src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ -src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ -src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ -src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ -src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ -src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ -src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ -src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ -src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ -src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ -src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ -src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ -src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ -src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ -src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ -src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ -src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ -src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ -src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ -src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ -src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ -src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ -src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ -src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ -src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ -src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ -src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ -src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ -src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ -src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ -src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ -src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ -src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ -src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ -src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ -src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ -src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ -src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ -src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ -src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ -src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ -src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ -src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ -src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ -src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ -src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ -src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ -src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ -src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ -src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ -src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ -src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ -src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ -src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ -src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ -src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ -src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ -src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ -src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ -src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ -src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ -src/pk/asn1/der/octet/der_length_octet_string.o \ -src/pk/asn1/der/printable_string/der_decode_printable_string.o \ -src/pk/asn1/der/printable_string/der_encode_printable_string.o \ -src/pk/asn1/der/printable_string/der_length_printable_string.o \ -src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ -src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ -src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ -src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ -src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ -src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ -src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ -src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ -src/pk/asn1/der/short_integer/der_encode_short_integer.o \ -src/pk/asn1/der/short_integer/der_length_short_integer.o \ -src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ -src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ -src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ -src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ -src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ -src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ -src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ -src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ -src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ -src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ -src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ -src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ -src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ -src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ -src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ -src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ -src/stream/sober128/sober128_test.o - -# List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ -testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ -testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ -testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ -testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o - -# The following headers will be installed by "make install" -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h - -#The default rule for make builds the libtomcrypt library. -default:library - #AES comes in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c ${silent} ${CC} ${CFLAGS} -DENCRYPT_ONLY -c $< -o $@ -#These are the rules to make certain object files. -src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c -src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c -src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c -src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c -src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c -src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c -src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c - -$(DOBJECTS): CFLAGS += -Itestprof -$(TOBJECTS): CFLAGS += -Itestprof - -#This rule makes the libtomcrypt library. -library: $(LIBNAME) - -#Dependencies on *.h -$(OBJECTS): $(HEADERS) -$(DOBJECTS): $(HEADERS) $(THEADERS) -$(TOBJECTS): $(HEADERS) $(THEADERS) - .c.o: ifneq ($V,1) @echo " * ${CC} $@" diff --git a/makefile.include b/makefile.include index 7fe26a77f..9da142900 100644 --- a/makefile.include +++ b/makefile.include @@ -122,3 +122,194 @@ GROUP=$(INSTALL_GROUP) else GROUP=wheel endif + +# List of objects to compile (all goes to libtomcrypt.a) +OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ +src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ +src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ +src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ +src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ +src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ +src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ +src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ +src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ +src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ +src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ +src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ +src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ +src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ +src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ +src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ +src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ +src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ +src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ +src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ +src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ +src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ +src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ +src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ +src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ +src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ +src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ +src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ +src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ +src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ +src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ +src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ +src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ +src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ +src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ +src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ +src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ +src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ +src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ +src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ +src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ +src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ +src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ +src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ +src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ +src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ +src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ +src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ +src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ +src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ +src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ +src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ +src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ +src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ +src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ +src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ +src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ +src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ +src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ +src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ +src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ +src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ +src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ +src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ +src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ +src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ +src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ +src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ +src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ +src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ +src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ +src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ +src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ +src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ +src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ +src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ +src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ +src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ +src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ +src/pk/asn1/der/octet/der_length_octet_string.o \ +src/pk/asn1/der/printable_string/der_decode_printable_string.o \ +src/pk/asn1/der/printable_string/der_encode_printable_string.o \ +src/pk/asn1/der/printable_string/der_length_printable_string.o \ +src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ +src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ +src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ +src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ +src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ +src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ +src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ +src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ +src/pk/asn1/der/short_integer/der_encode_short_integer.o \ +src/pk/asn1/der/short_integer/der_length_short_integer.o \ +src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ +src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ +src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ +src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ +src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ +src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ +src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ +src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ +src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ +src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ +src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ +src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ +src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ +src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ +src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ +src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ +src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ +src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ +src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ +src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/rc4.o \ +src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ +src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ +src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ +src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ +src/stream/sober128/sober128_test.o + +# List of test objects to compile (all goes to libtomcrypt_prof.a) +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ +testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ +testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ +testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ +testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o + +# The following headers will be installed by "make install" +HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ +src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ +src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ +src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ +src/headers/tomcrypt_prng.h + +#These are the rules to make certain object files. +src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c +src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c +src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c +src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c +src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c +src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c +src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c + + +#The default rule for make builds the libtomcrypt library. +default:library + +$(DOBJECTS): CFLAGS += -Itestprof +$(TOBJECTS): CFLAGS += -Itestprof + +#This rule makes the libtomcrypt library. +library: $(LIBNAME) + +#Dependencies on *.h +$(OBJECTS): $(HEADERS) +$(DOBJECTS): $(HEADERS) $(THEADERS) +$(TOBJECTS): $(HEADERS) $(THEADERS) diff --git a/makefile.shared b/makefile.shared index ccc5a3184..9f72ed546 100644 --- a/makefile.shared +++ b/makefile.shared @@ -32,204 +32,10 @@ ifndef LIBNAME_S LIBNAME_S=libtomcrypt.a endif -#List of objects to compile. -#START_INS -OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ -src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ -src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \ -src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \ -src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \ -src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \ -src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \ -src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \ -src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \ -src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \ -src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \ -src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ -src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \ -src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \ -src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \ -src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \ -src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \ -src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \ -src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \ -src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \ -src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \ -src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \ -src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \ -src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ -src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ -src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ -src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ -src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ -src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ -src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ -src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ -src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ -src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \ -src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \ -src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \ -src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \ -src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \ -src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \ -src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \ -src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \ -src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \ -src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \ -src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \ -src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \ -src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \ -src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \ -src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \ -src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \ -src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \ -src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \ -src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \ -src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ -src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ -src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ -src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ -src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ -src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ -src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ -src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ -src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ -src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ -src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ -src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ -src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ -src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ -src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ -src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ -src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \ -src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \ -src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \ -src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \ -src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \ -src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \ -src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \ -src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \ -src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \ -src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \ -src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \ -src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ -src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ -src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ -src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \ -src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \ -src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \ -src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \ -src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \ -src/pk/asn1/der/object_identifier/der_length_object_identifier.o \ -src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \ -src/pk/asn1/der/octet/der_length_octet_string.o \ -src/pk/asn1/der/printable_string/der_decode_printable_string.o \ -src/pk/asn1/der/printable_string/der_encode_printable_string.o \ -src/pk/asn1/der/printable_string/der_length_printable_string.o \ -src/pk/asn1/der/sequence/der_decode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \ -src/pk/asn1/der/sequence/der_decode_sequence_multi.o \ -src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ -src/pk/asn1/der/sequence/der_encode_sequence_ex.o \ -src/pk/asn1/der/sequence/der_encode_sequence_multi.o \ -src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ -src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \ -src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \ -src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \ -src/pk/asn1/der/short_integer/der_encode_short_integer.o \ -src/pk/asn1/der/short_integer/der_length_short_integer.o \ -src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \ -src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ -src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ -src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ -src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ -src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ -src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ -src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ -src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \ -src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \ -src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ -src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ -src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ -src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ -src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ -src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ -src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ -src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ -src/stream/sober128/sober128_test.o - -# List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ -testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ -testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ -testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ -testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o - -# The following headers will be installed by "make install" -HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ -src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \ -src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \ -src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \ -src/headers/tomcrypt_prng.h - -#END_INS - -#The default rule for make builds the libtomcrypt library. -default: $(LIBNAME) - #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o -#These are the rules to make certain object files. -src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c -src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c -src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c -src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c -src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c -src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c -src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c - -#This rule makes the libtomcrypt library. -library: $(LIBNAME) - -#Dependencies on *.h -$(OBJECTS): $(HEADERS) -$(DOBJECTS): $(HEADERS) $(THEADERS) -$(TOBJECTS): $(HEADERS) $(THEADERS) - -#SPECIAL: demo- and test-objects required include-path "testprof" -$(DOBJECTS): CFLAGS += -Itestprof -$(TOBJECTS): CFLAGS += -Itestprof - .c.o: $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< diff --git a/updatemakes.sh b/updatemakes.sh index 8975c4be3..d50b605e5 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -2,7 +2,7 @@ ./helper.pl --update-makefiles || exit 1 -makefiles=(makefile makefile.shared makefile.unix makefile.mingw makefile.msvc) +makefiles=(makefile makefile.include makefile.shared makefile.unix makefile.mingw makefile.msvc) vcproj=(libtomcrypt_VS2008.vcproj libtomcrypt_VS2005.vcproj) if [ $# -eq 1 ] && [ "$1" == "-c" ]; then From ea67579298f04d09c5eb548ffe5d8e7be9efbe8e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 8 May 2017 23:30:39 +0200 Subject: [PATCH 0765/1192] further clean-up - improve doc generation - update version handling no need for VERSION_{MAJ,MIN} --- doc/makefile | 7 +++++-- helper.pl | 2 +- makefile.common | 49 ++++++++++++++++++++++-------------------------- makefile.include | 2 +- makefile.shared | 7 +------ printinfo.sh | 2 +- 6 files changed, 31 insertions(+), 38 deletions(-) diff --git a/doc/makefile b/doc/makefile index 8becfef6d..1222eb95a 100644 --- a/doc/makefile +++ b/doc/makefile @@ -22,8 +22,7 @@ doxy: doxygen #from the clean command! This is because most people would like to keep the #nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to #delete it if we are rebuilding it. -.PHONY: crypt.pdf -crypt.pdf: crypt.tex +docs crypt.pdf: crypt.tex rm -f crypt.pdf $(LEFTOVERS) cp crypt.tex crypt.bak touch -r crypt.tex crypt.bak @@ -52,3 +51,7 @@ docdvi: crypt.tex perl ../helper.pl --fixupind crypt.ind latex crypt $(silent_stdout) latex crypt $(silent_stdout) + +clean: + rm -f $(LEFTOVERS) + rm -rf doxygen/ diff --git a/helper.pl b/helper.pl index 8f729fbfc..2db9ad8fa 100755 --- a/helper.pl +++ b/helper.pl @@ -217,7 +217,7 @@ sub patch_makefile { sub version_form_tomcrypt_h { my $h = read_file(shift); if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)"/s) { - return "VERSION_MAJ=$1", "VERSION_MIN=$2", "VERSION=$1.$2", "VERSION_LT=0:$1$2"; + return "VERSION=$1.$2", "VERSION_LT=0:$1$2"; } else { die "#define SCRYPT not found in tomcrypt.h"; diff --git a/makefile.common b/makefile.common index c550cc285..4da06bc3a 100644 --- a/makefile.common +++ b/makefile.common @@ -9,13 +9,10 @@ bins: $(USEFUL_DEMOS) all_test: test tv_gen $(DEMOS) #build the doxy files (requires Doxygen, tetex and patience) -doxygen: - $(MAKE) -C doc/ doxygen V=$(V) +doxygen doxy docs: + $(MAKE) -C doc/ $@ V=$(V) -doxy: - $(MAKE) -C doc/ doxy V=$(V) - -docs: +doc/crypt.pdf: $(MAKE) -C doc/ crypt.pdf V=$(V) @@ -38,7 +35,7 @@ install_all: install install_bins install_docs install_test install -m 644 testprof/tomcrypt_test.h $(INCPATH) $(INSTALL_CMD) -m 644 $(LIBTEST) $(LIBPATH) -install_docs: docs +install_docs: doc/crypt.pdf install -d $(DATAPATH) install -m 644 doc/crypt.pdf $(DATAPATH) @@ -48,28 +45,26 @@ install_hooks: #This rule cleans the source tree of all compiled code, not including the pdf #documentation. clean: - rm -f `find . -type f -name "*.o" | xargs` - rm -f `find . -type f -name "*.lo" | xargs` - rm -f `find . -type f -name "*.a" | xargs` - rm -f `find . -type f -name "*.la" | xargs` - rm -f `find . -type f -name "*.obj" | xargs` - rm -f `find . -type f -name "*.lib" | xargs` - rm -f `find . -type f -name "*.exe" | xargs` - rm -f `find . -type f -name "*.dll" | xargs` - rm -f `find . -type f -name "*.so" | xargs` - rm -f `find . -type f -name "*.gcov" | xargs` - rm -f `find . -type f -name "*.gcda" | xargs` - rm -f `find . -type f -name "*.gcno" | xargs` - rm -f `find . -type f -name "*.il" | xargs` - rm -f `find . -type f -name "*.dyn" | xargs` - rm -f `find . -type f -name "*.dpi" | xargs` - rm -rf `find . -type d -name "*.libs" | xargs` - rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc + find . -type f -name "*.o" \ + -o -name "*.lo" \ + -o -name "*.a" \ + -o -name "*.la" \ + -o -name "*.obj" \ + -o -name "*.lib" \ + -o -name "*.exe" \ + -o -name "*.dll" \ + -o -name "*.so" \ + -o -name "*.gcov"\ + -o -name "*.gcda"\ + -o -name "*.gcno"\ + -o -name "*.il" \ + -o -name "*.dyn" \ + -o -name "*.dpi" | xargs rm -f rm -f $(TIMING) $(TEST) $(DEMOS) - rm -rf doc/doxygen - rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` - rm -f *.txt + rm -f *_tv.txt rm -f *.pc + rm -rf `find . -type d -name "*.libs" | xargs` + $(MAKE) -C doc/ clean zipup: docs @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) diff --git a/makefile.include b/makefile.include index 9da142900..ad156726b 100644 --- a/makefile.include +++ b/makefile.include @@ -2,7 +2,7 @@ # Include makefile for libtomcrypt # -# The version +# The version - BEWARE: VERSION and VERSION_LT are updated via ./updatemakes.sh VERSION=1.17 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION_LT=0:117 diff --git a/makefile.shared b/makefile.shared index 9f72ed546..7e2f998d4 100644 --- a/makefile.shared +++ b/makefile.shared @@ -18,19 +18,14 @@ endif LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) INSTALL_CMD = $(LT) --mode=install install + #Output filenames for various targets. -ifndef LIBTEST_S - LIBTEST_S=libtomcrypt_prof.a -endif ifndef LIBTEST LIBTEST=libtomcrypt_prof.la endif ifndef LIBNAME LIBNAME=libtomcrypt.la endif -ifndef LIBNAME_S - LIBNAME_S=libtomcrypt.a -endif #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c diff --git a/printinfo.sh b/printinfo.sh index e6b7312c3..0af3beab1 100644 --- a/printinfo.sh +++ b/printinfo.sh @@ -3,7 +3,7 @@ version=$(git describe --tags --always --dirty 2>/dev/null) if [ ! -e ".git" ] || [ -z $version ] then - version=$(grep "^VERSION=" makefile | sed "s/.*=//") + version=$(grep "^VERSION=" makefile.include | sed "s/.*=//") fi echo "Testing version:" $version #grep "VERSION=" makefile | perl -e "@a = split('=', <>); print @a[1];"` From 2c27aee5d40ef2849267fbd195f7638e573a6921 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 9 May 2017 16:15:30 +0200 Subject: [PATCH 0766/1192] fixup df733f79fa806f1a305b044c3108e2b7cabf9805 --- updatemakes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatemakes.sh b/updatemakes.sh index d50b605e5..da513f28f 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -3,7 +3,7 @@ ./helper.pl --update-makefiles || exit 1 makefiles=(makefile makefile.include makefile.shared makefile.unix makefile.mingw makefile.msvc) -vcproj=(libtomcrypt_VS2008.vcproj libtomcrypt_VS2005.vcproj) +vcproj=(libtomcrypt_VS2008.vcproj) if [ $# -eq 1 ] && [ "$1" == "-c" ]; then git add ${makefiles[@]} ${vcproj[@]} && git commit -m 'Update makefiles' From 7379c94f0aafab5eb388c7977950036e3579118c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 10 May 2017 11:56:52 +0200 Subject: [PATCH 0767/1192] merge .include and .common makefiles --- helper.pl | 2 +- makefile | 11 +-- makefile.common | 85 ----------------------- makefile.shared | 12 ++-- makefile.include => makefile_include.mk | 92 ++++++++++++++++++++++++- 5 files changed, 103 insertions(+), 99 deletions(-) delete mode 100644 makefile.common rename makefile.include => makefile_include.mk (86%) diff --git a/helper.pl b/helper.pl index 2db9ad8fa..812695433 100755 --- a/helper.pl +++ b/helper.pl @@ -260,7 +260,7 @@ sub process_makefiles { } # update OBJECTS + HEADERS in makefile* - for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile.include /) { + for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile_include.mk /) { my $old = read_file($m); my $new = $m eq 'makefile.msvc' ? patch_makefile($old, $var_obj, $var_h, $var_tobj, @ver_version) : patch_makefile($old, $var_o, $var_h, $var_to, @ver_version); diff --git a/makefile b/makefile index bfc5a4ba8..d4b086e21 100644 --- a/makefile +++ b/makefile @@ -2,8 +2,8 @@ # # Tom St Denis # Modified by Clay Culver - -include makefile.include +# +# (GNU make only) ifeq ($V,1) silent= @@ -23,7 +23,6 @@ endif endif INSTALL_CMD = install - #Output filenames for various targets. ifndef LIBNAME LIBNAME=libtomcrypt.a @@ -32,6 +31,10 @@ ifndef LIBTEST LIBTEST=libtomcrypt_prof.a endif + +include makefile_include.mk + + #AES comes in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c ${silent} ${CC} ${CFLAGS} -DENCRYPT_ONLY -c $< -o $@ @@ -136,6 +139,4 @@ coverage: test # cleans everything - coverage output and standard 'clean' cleancov: cleancov-clean clean -include makefile.common - # git commit: $Format:%h$ $Format:%ai$ diff --git a/makefile.common b/makefile.common deleted file mode 100644 index 4da06bc3a..000000000 --- a/makefile.common +++ /dev/null @@ -1,85 +0,0 @@ -#common make targets shared over multiple makefiles - -ifndef INSTALL_CMD -$(error your makefile must define INSTALL_CMD) -endif - -bins: $(USEFUL_DEMOS) - -all_test: test tv_gen $(DEMOS) - -#build the doxy files (requires Doxygen, tetex and patience) -doxygen doxy docs: - $(MAKE) -C doc/ $@ V=$(V) - -doc/crypt.pdf: - $(MAKE) -C doc/ crypt.pdf V=$(V) - - -install_all: install install_bins install_docs install_test - - -.common_install: $(LIBNAME) - install -d $(INCPATH) - install -d $(LIBPATH) - $(INSTALL_CMD) -m 644 $(LIBNAME) $(LIBPATH)/$(LIBNAME) - install -m 644 $(HEADERS) $(INCPATH) - -.common_install_bins: $(USEFUL_DEMOS) - install -d $(BINPATH) - $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(BINPATH) - -.common_install_test: $(LIBTEST) - install -d $(LIBPATH) - install -d $(INCPATH) - install -m 644 testprof/tomcrypt_test.h $(INCPATH) - $(INSTALL_CMD) -m 644 $(LIBTEST) $(LIBPATH) - -install_docs: doc/crypt.pdf - install -d $(DATAPATH) - install -m 644 doc/crypt.pdf $(DATAPATH) - -install_hooks: - for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done - -#This rule cleans the source tree of all compiled code, not including the pdf -#documentation. -clean: - find . -type f -name "*.o" \ - -o -name "*.lo" \ - -o -name "*.a" \ - -o -name "*.la" \ - -o -name "*.obj" \ - -o -name "*.lib" \ - -o -name "*.exe" \ - -o -name "*.dll" \ - -o -name "*.so" \ - -o -name "*.gcov"\ - -o -name "*.gcda"\ - -o -name "*.gcno"\ - -o -name "*.il" \ - -o -name "*.dyn" \ - -o -name "*.dpi" | xargs rm -f - rm -f $(TIMING) $(TEST) $(DEMOS) - rm -f *_tv.txt - rm -f *.pc - rm -rf `find . -type d -name "*.libs" | xargs` - $(MAKE) -C doc/ clean - -zipup: docs - @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) - @perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 ) - rm -rf libtomcrypt-$(VERSION) libtomcrypt-$(VERSION).* - # files/dirs excluded from "git archive" are defined in .gitattributes - git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x - mkdir -p libtomcrypt-$(VERSION)/doc - cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf - tar -cJf libtomcrypt-$(VERSION).tar.xz libtomcrypt-$(VERSION) - zip -9rq libtomcrypt-$(VERSION).zip libtomcrypt-$(VERSION) - rm -rf libtomcrypt-$(VERSION) - gpg -b -a libtomcrypt-$(VERSION).tar.xz - gpg -b -a libtomcrypt-$(VERSION).zip - -codecheck: - perl helper.pl -a - perlcritic *.pl diff --git a/makefile.shared b/makefile.shared index 7e2f998d4..04e08e748 100644 --- a/makefile.shared +++ b/makefile.shared @@ -4,9 +4,8 @@ # # Thanks to Zed Shaw for helping debug this on BSD/OSX. # Tom St Denis - -include makefile.include - +# +# (GNU make only) ifndef LT ifeq ($(PLATFORM), Darwin) @@ -18,7 +17,6 @@ endif LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) INSTALL_CMD = $(LT) --mode=install install - #Output filenames for various targets. ifndef LIBTEST LIBTEST=libtomcrypt_prof.la @@ -27,6 +25,10 @@ ifndef LIBNAME LIBNAME=libtomcrypt.la endif + +include makefile_include.mk + + #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o @@ -66,8 +68,6 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) -include makefile.common - # $Source$ # $Revision$ # $Date$ diff --git a/makefile.include b/makefile_include.mk similarity index 86% rename from makefile.include rename to makefile_include.mk index ad156726b..e4f1787ca 100644 --- a/makefile.include +++ b/makefile_include.mk @@ -1,6 +1,6 @@ # -# Include makefile for libtomcrypt -# +# Include makefile used by makefile + makefile.shared +# (GNU make only) # The version - BEWARE: VERSION and VERSION_LT are updated via ./updatemakes.sh VERSION=1.17 @@ -313,3 +313,91 @@ library: $(LIBNAME) $(OBJECTS): $(HEADERS) $(DOBJECTS): $(HEADERS) $(THEADERS) $(TOBJECTS): $(HEADERS) $(THEADERS) + +ifndef INSTALL_CMD +$(error your makefile must define INSTALL_CMD) +endif + +ifndef EXTRALIBS +EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config libtommath --libs) +endif + +bins: $(USEFUL_DEMOS) + +all_test: test tv_gen $(DEMOS) + +#build the doxy files (requires Doxygen, tetex and patience) +doxygen doxy docs: + $(MAKE) -C doc/ $@ V=$(V) + +doc/crypt.pdf: + $(MAKE) -C doc/ crypt.pdf V=$(V) + + +install_all: install install_bins install_docs install_test + + +.common_install: $(LIBNAME) + install -d $(INCPATH) + install -d $(LIBPATH) + $(INSTALL_CMD) -m 644 $(LIBNAME) $(LIBPATH)/$(LIBNAME) + install -m 644 $(HEADERS) $(INCPATH) + +.common_install_bins: $(USEFUL_DEMOS) + install -d $(BINPATH) + $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(BINPATH) + +.common_install_test: $(LIBTEST) + install -d $(LIBPATH) + install -d $(INCPATH) + install -m 644 testprof/tomcrypt_test.h $(INCPATH) + $(INSTALL_CMD) -m 644 $(LIBTEST) $(LIBPATH) + +install_docs: doc/crypt.pdf + install -d $(DATAPATH) + install -m 644 doc/crypt.pdf $(DATAPATH) + +install_hooks: + for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done + +#This rule cleans the source tree of all compiled code, not including the pdf +#documentation. +clean: + find . -type f -name "*.o" \ + -o -name "*.lo" \ + -o -name "*.a" \ + -o -name "*.la" \ + -o -name "*.obj" \ + -o -name "*.lib" \ + -o -name "*.exe" \ + -o -name "*.dll" \ + -o -name "*.so" \ + -o -name "*.gcov"\ + -o -name "*.gcda"\ + -o -name "*.gcno"\ + -o -name "*.il" \ + -o -name "*.dyn" \ + -o -name "*.dpi" | xargs rm -f + rm -f $(TIMING) $(TEST) $(DEMOS) + rm -f *_tv.txt + rm -f *.pc + rm -rf `find . -type d -name "*.libs" | xargs` + $(MAKE) -C doc/ clean + +zipup: docs + @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) + @perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 ) + rm -rf libtomcrypt-$(VERSION) libtomcrypt-$(VERSION).* + # files/dirs excluded from "git archive" are defined in .gitattributes + git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x + mkdir -p libtomcrypt-$(VERSION)/doc + cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf + tar -cJf libtomcrypt-$(VERSION).tar.xz libtomcrypt-$(VERSION) + zip -9rq libtomcrypt-$(VERSION).zip libtomcrypt-$(VERSION) + rm -rf libtomcrypt-$(VERSION) + gpg -b -a libtomcrypt-$(VERSION).tar.xz + gpg -b -a libtomcrypt-$(VERSION).zip + +codecheck: + perl helper.pl -a + perlcritic *.pl From 81f02972856d44f93a64b0bdf22ee8586c8ffbfd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 10 May 2017 13:54:05 +0200 Subject: [PATCH 0768/1192] small fix-ups --- .gitignore | 13 +++++++++++++ makefile | 4 +++- makefile_include.mk | 18 +++++++++++------- printinfo.sh | 2 +- updatemakes.sh | 2 +- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index b845ffc9d..ee4902f6b 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,19 @@ timing.exe *.gcov libtomcrypt.pc +# output from doc generation +doxygen/ +*.dvi +*.log +*.aux +*.toc +*.idx +*.ilg +*.ind +*.out +*.lof +*.bak + coverage/ coverage*.info diff --git a/makefile b/makefile index d4b086e21..fd0ea19b8 100644 --- a/makefile +++ b/makefile @@ -139,4 +139,6 @@ coverage: test # cleans everything - coverage output and standard 'clean' cleancov: cleancov-clean clean -# git commit: $Format:%h$ $Format:%ai$ +# ref: $Format:%D$ +# git commit: $Format:%H$ +# commit time: $Format:%ai$ diff --git a/makefile_include.mk b/makefile_include.mk index e4f1787ca..9984fad60 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -384,19 +384,23 @@ clean: rm -rf `find . -type d -name "*.libs" | xargs` $(MAKE) -C doc/ clean -zipup: docs +zipup: doc/crypt.pdf + @# Update the index, so diff-index won't fail in case the pdf has been created. + @# As the pdf creation modifies crypt.tex, git sometimes detects the + @# modified file, but misses that it's put back to its original version. + @git update-index --refresh @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) @perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 ) - rm -rf libtomcrypt-$(VERSION) libtomcrypt-$(VERSION).* - # files/dirs excluded from "git archive" are defined in .gitattributes + rm -rf libtomcrypt-$(VERSION) crypt-$(VERSION).* + @# files/dirs excluded from "git archive" are defined in .gitattributes git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x mkdir -p libtomcrypt-$(VERSION)/doc cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf - tar -cJf libtomcrypt-$(VERSION).tar.xz libtomcrypt-$(VERSION) - zip -9rq libtomcrypt-$(VERSION).zip libtomcrypt-$(VERSION) + tar -c libtomcrypt-$(VERSION)/ | xz -6e -c - > crypt-$(VERSION).tar.xz + zip -9rq crypt-$(VERSION).zip libtomcrypt-$(VERSION) rm -rf libtomcrypt-$(VERSION) - gpg -b -a libtomcrypt-$(VERSION).tar.xz - gpg -b -a libtomcrypt-$(VERSION).zip + gpg -b -a crypt-$(VERSION).tar.xz + gpg -b -a crypt-$(VERSION).zip codecheck: perl helper.pl -a diff --git a/printinfo.sh b/printinfo.sh index 0af3beab1..213af5b16 100644 --- a/printinfo.sh +++ b/printinfo.sh @@ -3,7 +3,7 @@ version=$(git describe --tags --always --dirty 2>/dev/null) if [ ! -e ".git" ] || [ -z $version ] then - version=$(grep "^VERSION=" makefile.include | sed "s/.*=//") + version=$(grep "^VERSION=" makefile_include.mk | sed "s/.*=//") fi echo "Testing version:" $version #grep "VERSION=" makefile | perl -e "@a = split('=', <>); print @a[1];"` diff --git a/updatemakes.sh b/updatemakes.sh index da513f28f..3b747f2bd 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -2,7 +2,7 @@ ./helper.pl --update-makefiles || exit 1 -makefiles=(makefile makefile.include makefile.shared makefile.unix makefile.mingw makefile.msvc) +makefiles=(makefile makefile_include.mk makefile.shared makefile.unix makefile.mingw makefile.msvc) vcproj=(libtomcrypt_VS2008.vcproj) if [ $# -eq 1 ] && [ "$1" == "-c" ]; then From 6a4978ef5ed2208a4e1f63d4fb12ef6bdb9ed7f3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 11 May 2017 15:40:50 +0200 Subject: [PATCH 0769/1192] better EXTRALIBS --- makefile_include.mk | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/makefile_include.mk b/makefile_include.mk index 9984fad60..ff89df7e0 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -28,6 +28,20 @@ ifndef MAKE MAKE:=make endif +ifndef INSTALL_CMD +$(error your makefile must define INSTALL_CMD) +endif + +ifndef EXTRALIBS +ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),) +EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config libtommath --libs) +else +ifneq ($(shell echo $(CFLAGS) | grep USE_TFM),) +EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config tomsfastmath --libs) +endif +endif +endif + # Compilation flags. Note the += does not write over the user's CFLAGS! CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE @@ -314,14 +328,6 @@ $(OBJECTS): $(HEADERS) $(DOBJECTS): $(HEADERS) $(THEADERS) $(TOBJECTS): $(HEADERS) $(THEADERS) -ifndef INSTALL_CMD -$(error your makefile must define INSTALL_CMD) -endif - -ifndef EXTRALIBS -EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config libtommath --libs) -endif - bins: $(USEFUL_DEMOS) all_test: test tv_gen $(DEMOS) From 56283c947acd56f18c1068405da9b1ed7802db5a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 11 May 2017 15:53:22 +0200 Subject: [PATCH 0770/1192] improve coverage creation --- .travis.yml | 2 +- build.sh | 9 ++++++--- coverage.sh | 20 +++++--------------- coverage_more.sh | 24 ++++++++++++++++++++++++ makefile | 22 +++++++++++++++------- testme.sh | 39 ++++++++++++++++++++++----------------- 6 files changed, 73 insertions(+), 43 deletions(-) create mode 100755 coverage_more.sh diff --git a/.travis.yml b/.travis.yml index 11170671e..6c79e171a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,7 +90,7 @@ addons: - libtommath-dev before_script: - sudo apt-get update -qq - - sudo pip install cpp-coveralls + - sudo gem install coveralls-lcov after_failure: - cat test_std.txt - cat test_err.txt diff --git a/build.sh b/build.sh index 94f27bf8b..590fc4431 100755 --- a/build.sh +++ b/build.sh @@ -42,11 +42,14 @@ if [ -a test ] && [ -f test ] && [ -x test ]; then fi fi -lcov_opts="--capture --no-external --directory src -q" -lcov_out=$(echo coverage_$1_$2_$3 | tr ' -=+' '_')".info" if [ -a testok.txt ] && [ -f testok.txt ]; then - [ "$LTC_COVERAGE" != "" ] && lcov $lcov_opts --output-file $lcov_out + if [ "$LTC_COVERAGE" != "" ]; then + ./coverage_more.sh > test_coverage_more.txt || exit 1 + lcov_opts="--capture --no-external --directory src -q" + lcov_out=$(echo coverage_$1_$2_$3 | tr ' -=+' '_')".info" + lcov $lcov_opts --output-file $lcov_out + fi exit 0 fi exit 1 diff --git a/coverage.sh b/coverage.sh index a17c97d39..6686b443f 100755 --- a/coverage.sh +++ b/coverage.sh @@ -20,7 +20,7 @@ fi # output version bash printinfo.sh -bash build.sh " $1" " $2" " $3 COVERAGE=1" "$4 -fprofile-arcs -ftest-coverage " "$5 -lgcov" +bash build.sh " $1" " $2" " $3 COVERAGE=1" "$4" "$5" if [ -a testok.txt ] && [ -f testok.txt ]; then echo else @@ -29,24 +29,14 @@ else exit 1 fi -./sizes -./constants - -for i in $(for j in $(echo $(./hashsum -h | tail -n +3)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i testprof/test.key ; done > hashsum_tv.txt -difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true -if [ -n "$difftroubles" ]; then - echo "FAILURE: hashsum_tv.tx" - diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt - echo "hashsum failed" && rm -f testok.txt && exit 1 -else - echo "hashsum okay" -fi +./coverage_more.sh > test_coverage_more.txt || { rm -f testok.txt && exit 1 ; } +make lcov-single # if this was executed as './coverage.sh ...' create coverage locally if [[ "${0%% *}" == "./${0##*/}" ]]; then - make lcov-single + make lcov-html else - cpp-coveralls -e 'demos/' -e 'testprof/' -e 'notes/' -e 'src/headers/' + coveralls-lcov coverage.info fi exit 0 diff --git a/coverage_more.sh b/coverage_more.sh new file mode 100755 index 000000000..c7eababad --- /dev/null +++ b/coverage_more.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +./sizes +./constants + +for i in $(for j in $(echo $(./hashsum -h | tail -n +3)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i testprof/test.key ; done > hashsum_tv.txt +difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true +if [ -n "$difftroubles" ]; then + echo "FAILURE: hashsum_tv.tx" + diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt + echo "hashsum failed" + exit 1 +else + echo "hashsum okay" +fi + + +exit 0 + +# $Source$ +# $Revision$ +# $Date$ diff --git a/makefile b/makefile index fd0ea19b8..aa569a423 100644 --- a/makefile +++ b/makefile @@ -34,6 +34,12 @@ endif include makefile_include.mk +ifeq ($(COVERAGE),1) +all_test: LIB_PRE = -Wl,--whole-archive +all_test: LIB_POST = -Wl,--no-whole-archive +CFLAGS += -fprofile-arcs -ftest-coverage +EXTRALIBS += -lgcov +endif #AES comes in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c @@ -88,10 +94,6 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) -ifeq ($(COVERAGE),1) -all_test: LIB_PRE = -Wl,--whole-archive -all_test: LIB_POST = -Wl,--no-whole-archive -endif #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct @@ -117,14 +119,20 @@ cleancov-clean: rm -f `find . -type f -name "*.info" | xargs` rm -rf coverage/ +# merges all coverage_*.info files into coverage.info +coverage.info: + lcov `find -name 'coverage_*.info' -exec echo -n " -a {}" \;` -o coverage.info + # generates html output from all coverage_*.info files -lcov: - lcov `find -name 'coverage_*.info' -exec echo -n " -a {}" \;` -o coverage.info -q 2>/dev/null +lcov-html: coverage.info genhtml coverage.info --output-directory coverage -q # combines all necessary steps to create the coverage from a single testrun with e.g. # CFLAGS="-DUSE_LTM -DLTM_DESC -I../libtommath" EXTRALIBS="../libtommath/libtommath.a" make coverage -j9 -lcov-single: | cleancov-clean lcov-single-create lcov +lcov-single: + $(MAKE) cleancov-clean + $(MAKE) lcov-single-create + $(MAKE) coverage.info #make the code coverage of the library diff --git a/testme.sh b/testme.sh index c1b3c238d..3f1605bfc 100755 --- a/testme.sh +++ b/testme.sh @@ -3,7 +3,8 @@ if [ $# -lt 3 ] then echo "usage is: ${0##*/} " - echo "e.g. \"${0##*/} \"makefile -j3\" \"-DUSE_LTM -DLTM_DESC -I/path/to/libtommath\" /path/to/libtommath/libtommath.a\"" + echo "e.g. \"${0##*/} \"makefile -j9\" \"-DUSE_LTM -DLTM_DESC -I../libtommath\" ../libtommath/libtommath.a\"" + echo "to create aggregate coverage: pre-pend with LTC_COVERAGE=1" exit -1 fi @@ -13,53 +14,57 @@ echo "date="`date` # check sources bash check_source.sh "CHECK_SOURCES" " " "$1" "$2" "$3" || exit 1 +mk="$1" + +[ "$LTC_COVERAGE" != "" ] && mk="$mk COVERAGE=1" + # stock build -bash run.sh "STOCK" " " "$1" "$2" "$3" || exit 1 +bash run.sh "STOCK" " " "$mk" "$2" "$3" || exit 1 # EASY build -bash run.sh "EASY" "-DLTC_EASY" "$1" "$2" "$3" || exit 1 +bash run.sh "EASY" "-DLTC_EASY" "$mk" "$2" "$3" || exit 1 # SMALL code -bash run.sh "SMALL" "-DLTC_SMALL_CODE" "$1" "$2" "$3" || exit 1 +bash run.sh "SMALL" "-DLTC_SMALL_CODE" "$mk" "$2" "$3" || exit 1 # NOTABLES -bash run.sh "NOTABLES" "-DLTC_NO_TABLES" "$1" "$2" "$3" || exit 1 +bash run.sh "NOTABLES" "-DLTC_NO_TABLES" "$mk" "$2" "$3" || exit 1 # SMALL+NOTABLES -bash run.sh "SMALL+NOTABLES" "-DLTC_SMALL_CODE -DLTC_NO_TABLES" "$1" "$2" "$3" || exit 1 +bash run.sh "SMALL+NOTABLES" "-DLTC_SMALL_CODE -DLTC_NO_TABLES" "$mk" "$2" "$3" || exit 1 # CLEANSTACK -bash run.sh "CLEANSTACK" "-DLTC_CLEAN_STACK" "$1" "$2" "$3" || exit 1 +bash run.sh "CLEANSTACK" "-DLTC_CLEAN_STACK" "$mk" "$2" "$3" || exit 1 # CLEANSTACK + SMALL -bash run.sh "CLEANSTACK+SMALL" "-DLTC_SMALL_CODE -DLTC_CLEAN_STACK" "$1" "$2" "$3" || exit 1 +bash run.sh "CLEANSTACK+SMALL" "-DLTC_SMALL_CODE -DLTC_CLEAN_STACK" "$mk" "$2" "$3" || exit 1 # CLEANSTACK + NOTABLES -bash run.sh "CLEANSTACK+NOTABLES" "-DLTC_NO_TABLES -DLTC_CLEAN_STACK" "$1" "$2" "$3" || exit 1 +bash run.sh "CLEANSTACK+NOTABLES" "-DLTC_NO_TABLES -DLTC_CLEAN_STACK" "$mk" "$2" "$3" || exit 1 # CLEANSTACK + NOTABLES + SMALL -bash run.sh "CLEANSTACK+NOTABLES+SMALL" "-DLTC_NO_TABLES -DLTC_CLEAN_STACK -DLTC_SMALL_CODE" "$1" "$2" "$3" || exit 1 +bash run.sh "CLEANSTACK+NOTABLES+SMALL" "-DLTC_NO_TABLES -DLTC_CLEAN_STACK -DLTC_SMALL_CODE" "$mk" "$2" "$3" || exit 1 # NO_FAST -bash run.sh "NO_FAST" "-DLTC_NO_FAST" "$1" "$2" "$3" || exit 1 +bash run.sh "NO_FAST" "-DLTC_NO_FAST" "$mk" "$2" "$3" || exit 1 # NO_FAST + NOTABLES -bash run.sh "NO_FAST+NOTABLES" "-DLTC_NO_FAST -DLTC_NO_TABLES" "$1" "$2" "$3" || exit 1 +bash run.sh "NO_FAST+NOTABLES" "-DLTC_NO_FAST -DLTC_NO_TABLES" "$mk" "$2" "$3" || exit 1 # NO_ASM -bash run.sh "NO_ASM" "-DLTC_NO_ASM" "$1" "$2" "$3" || exit 1 +bash run.sh "NO_ASM" "-DLTC_NO_ASM" "$mk" "$2" "$3" || exit 1 # NO_TIMING_RESISTANCE -bash run.sh "NO_TIMING_RESISTANCE" "-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" "$1" "$2" "$3" || exit 1 +bash run.sh "NO_TIMING_RESISTANCE" "-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" "$mk" "$2" "$3" || exit 1 # CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE -bash run.sh "CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE" "-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" "$1" "$2" "$3" || exit 1 +bash run.sh "CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE" "-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" "$mk" "$2" "$3" || exit 1 # test build with no testing -bash testbuild.sh "NOTEST" "-DLTC_NO_TEST" "$1" "$2" "$3" || exit 1 +bash testbuild.sh "NOTEST" "-DLTC_NO_TEST" "$mk" "$2" "$3" || exit 1 # test build with no file routines -bash testbuild.sh "NOFILE" "-DLTC_NO_FILE" "$1" "$2" "$3" || exit 1 +bash testbuild.sh "NOFILE" "-DLTC_NO_FILE" "$mk" "$2" "$3" || exit 1 # $Source$ # $Revision$ From 90d5fe5bdb00299413c0de0cfd74ce7b45d5de65 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 11 May 2017 16:32:03 +0200 Subject: [PATCH 0771/1192] re-format .travis.yml no sudo required to gem install --- .travis.yml | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c79e171a..cc7269981 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,28 @@ language: c + +addons: + apt: + sources: + - debian-sid + packages: + - binutils + - libtommath-dev + +before_script: + - gem install coveralls-lcov + +matrix: + fast_finish: true +branches: + only: + - develop + compiler: - gcc - clang + script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" + env: - | BUILDSCRIPT="check_source.sh" @@ -76,26 +96,14 @@ env: BUILDSCRIPT="testbuild.sh" BUILDNAME="NOFILE" BUILDOPTIONS="-DLTC_NO_FILE" -matrix: - fast_finish: true -branches: - only: - - develop -addons: - apt: - sources: - - debian-sid - packages: - - binutils - - libtommath-dev -before_script: - - sudo apt-get update -qq - - sudo gem install coveralls-lcov + after_failure: - cat test_std.txt - cat test_err.txt + after_script: - cat gcc_1.txt - cat gcc_2.txt + notifications: irc: "chat.freenode.net#libtom-notifications" From a12b97f84e5356a02a60fdd4098f7db44b8df085 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 11 May 2017 16:37:14 +0200 Subject: [PATCH 0772/1192] travis doesn't seem to provide lcov... --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index cc7269981..fd354ef80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ addons: before_script: - gem install coveralls-lcov + - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz + - export PATH=$PATH:`pwd`/lcov-1.11/bin matrix: fast_finish: true From 30f8aaad8c33be5730d3df2c5ebfca71dc7b3ca7 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 14 May 2017 21:56:58 -0400 Subject: [PATCH 0773/1192] replace XMEMCMP with compare_testvector, other consistency cleanup in testing code. --- src/hashes/blake2b.c | 12 +++-- src/hashes/blake2s.c | 12 +++-- src/hashes/chc/chc.c | 14 +++--- src/hashes/md2.c | 9 ++-- src/hashes/md4.c | 15 ++++--- src/hashes/md5.c | 2 +- src/hashes/rmd128.c | 18 ++++---- src/hashes/rmd160.c | 18 ++++---- src/hashes/rmd256.c | 18 ++++---- src/hashes/rmd320.c | 18 ++++---- src/hashes/sha1.c | 2 +- src/hashes/sha2/sha224.c | 2 +- src/hashes/sha2/sha256.c | 2 +- src/hashes/sha2/sha384.c | 2 +- src/hashes/sha2/sha512.c | 2 +- src/hashes/sha2/sha512_224.c | 2 +- src/hashes/sha2/sha512_256.c | 2 +- src/hashes/sha3_test.c | 87 +++++++++++++----------------------- src/hashes/tiger.c | 2 +- src/hashes/whirl/whirl.c | 9 +--- 20 files changed, 110 insertions(+), 138 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index b01f63eb8..51c1ee452 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -432,8 +432,9 @@ int blake2b_512_test(void) blake2b_512_init(&md); blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2b_done(&md, tmp); - if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_512", i)) + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_512", i)) { return CRYPT_FAIL_TESTVECTOR; + } } return CRYPT_OK; #endif @@ -478,8 +479,9 @@ int blake2b_384_test(void) blake2b_384_init(&md); blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2b_done(&md, tmp); - if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_384", i)) + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_384", i)) { return CRYPT_FAIL_TESTVECTOR; + } } return CRYPT_OK; #endif @@ -530,8 +532,9 @@ int blake2b_256_test(void) blake2b_256_init(&md); blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2b_done(&md, tmp); - if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_256", i)) + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_256", i)) { return CRYPT_FAIL_TESTVECTOR; + } } return CRYPT_OK; #endif @@ -570,8 +573,9 @@ int blake2b_160_test(void) blake2b_160_init(&md); blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2b_done(&md, tmp); - if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_160", i)) + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_160", i)) { return CRYPT_FAIL_TESTVECTOR; + } } return CRYPT_OK; #endif diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index daa45a51c..6a7b24f0f 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -422,8 +422,9 @@ int blake2s_256_test(void) blake2s_256_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); - if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_256", i)) + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_256", i)) { return CRYPT_FAIL_TESTVECTOR; + } } return CRYPT_OK; @@ -465,8 +466,9 @@ int blake2s_224_test(void) blake2s_224_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); - if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_224", i)) + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_224", i)) { return CRYPT_FAIL_TESTVECTOR; + } } return CRYPT_OK; @@ -506,8 +508,9 @@ int blake2s_160_test(void) blake2s_160_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); - if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_160", i)) + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_160", i)) { return CRYPT_FAIL_TESTVECTOR; + } } return CRYPT_OK; @@ -545,8 +548,9 @@ int blake2s_128_test(void) blake2s_128_init(&md); blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); blake2s_done(&md, tmp); - if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_128", i)) + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_128", i)) { return CRYPT_FAIL_TESTVECTOR; + } } return CRYPT_OK; #endif diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index bff4d80af..889291e80 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -256,7 +256,7 @@ int chc_test(void) #else static const struct { unsigned char *msg, - md[MAXBLOCKSIZE]; + hash[MAXBLOCKSIZE]; int len; } tests[] = { { @@ -266,8 +266,8 @@ int chc_test(void) 16 } }; - int x, oldhashidx, idx; - unsigned char out[MAXBLOCKSIZE]; + int i, oldhashidx, idx; + unsigned char tmp[MAXBLOCKSIZE]; hash_state md; /* AES can be under rijndael or aes... try to find it */ @@ -279,11 +279,11 @@ int chc_test(void) oldhashidx = cipher_idx; chc_register(idx); - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { chc_init(&md); - chc_process(&md, tests[x].msg, strlen((char *)tests[x].msg)); - chc_done(&md, out); - if (XMEMCMP(out, tests[x].md, tests[x].len)) { + chc_process(&md, tests[i].msg, strlen((char *)tests[i].msg)); + chc_done(&md, tmp); + if (compare_testvector(tmp, tests[i].len, tests[i].hash, tests[i].len, "CHC", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/md2.c b/src/hashes/md2.c index 0410923bd..e5ce4bb41 100644 --- a/src/hashes/md2.c +++ b/src/hashes/md2.c @@ -194,7 +194,7 @@ int md2_test(void) #else static const struct { char *msg; - unsigned char md[16]; + unsigned char hash[16]; } tests[] = { { "", {0x83,0x50,0xe5,0xa3,0xe2,0x4c,0x15,0x3d, @@ -227,15 +227,16 @@ int md2_test(void) } } }; + int i; + unsigned char tmp[16]; hash_state md; - unsigned char buf[16]; for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { md2_init(&md); md2_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); - md2_done(&md, buf); - if (XMEMCMP(buf, tests[i].md, 16) != 0) { + md2_done(&md, tmp); + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "MD2", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/md4.c b/src/hashes/md4.c index b2527b585..be4b129e2 100644 --- a/src/hashes/md4.c +++ b/src/hashes/md4.c @@ -257,8 +257,8 @@ int md4_test(void) #else static const struct md4_test_case { char *input; - unsigned char digest[16]; - } cases[] = { + unsigned char hash[16]; + } tests[] = { { "", {0x31, 0xd6, 0xcf, 0xe0, 0xd1, 0x6a, 0xe9, 0x31, 0xb7, 0x3c, 0x59, 0xd7, 0xe0, 0xc0, 0x89, 0xc0} }, @@ -281,15 +281,16 @@ int md4_test(void) {0xe3, 0x3b, 0x4d, 0xdc, 0x9c, 0x38, 0xf2, 0x19, 0x9c, 0x3e, 0x7b, 0x16, 0x4f, 0xcc, 0x05, 0x36} }, }; + int i; + unsigned char tmp[16]; hash_state md; - unsigned char digest[16]; - for(i = 0; i < (int)(sizeof(cases) / sizeof(cases[0])); i++) { + for(i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { md4_init(&md); - md4_process(&md, (unsigned char *)cases[i].input, (unsigned long)strlen(cases[i].input)); - md4_done(&md, digest); - if (XMEMCMP(digest, cases[i].digest, 16) != 0) { + md4_process(&md, (unsigned char *)tests[i].input, (unsigned long)strlen(tests[i].input)); + md4_done(&md, tmp); + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "MD4", i)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/hashes/md5.c b/src/hashes/md5.c index 1d0ec9285..c76e76be0 100644 --- a/src/hashes/md5.c +++ b/src/hashes/md5.c @@ -351,7 +351,7 @@ int md5_test(void) md5_init(&md); md5_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); md5_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 16) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "MD5", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/rmd128.c b/src/hashes/rmd128.c index af16f1fae..135d83e1d 100644 --- a/src/hashes/rmd128.c +++ b/src/hashes/rmd128.c @@ -356,7 +356,7 @@ int rmd128_test(void) #else static const struct { char *msg; - unsigned char md[16]; + unsigned char hash[16]; } tests[] = { { "", { 0xcd, 0xf2, 0x62, 0x13, 0xa1, 0x50, 0xdc, 0x3e, @@ -383,18 +383,16 @@ int rmd128_test(void) 0xae, 0xa4, 0x62, 0x4c, 0x60, 0xc5, 0xc7, 0x02 } } }; - int x; - unsigned char buf[16]; + + int i; + unsigned char tmp[16]; hash_state md; - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { rmd128_init(&md); - rmd128_process(&md, (unsigned char *)tests[x].msg, strlen(tests[x].msg)); - rmd128_done(&md, buf); - if (XMEMCMP(buf, tests[x].md, 16) != 0) { - #if 0 - printf("Failed test %d\n", x); - #endif + rmd128_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg)); + rmd128_done(&md, tmp); + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD128", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/rmd160.c b/src/hashes/rmd160.c index ac41e5b95..133c75c57 100644 --- a/src/hashes/rmd160.c +++ b/src/hashes/rmd160.c @@ -415,7 +415,7 @@ int rmd160_test(void) #else static const struct { char *msg; - unsigned char md[20]; + unsigned char hash[20]; } tests[] = { { "", { 0x9c, 0x11, 0x85, 0xa5, 0xc5, 0xe9, 0xfc, 0x54, 0x61, 0x28, @@ -442,18 +442,16 @@ int rmd160_test(void) 0xa0, 0x6c, 0x27, 0xdc, 0xf4, 0x9a, 0xda, 0x62, 0xeb, 0x2b } } }; - int x; - unsigned char buf[20]; + + int i; + unsigned char tmp[20]; hash_state md; - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { rmd160_init(&md); - rmd160_process(&md, (unsigned char *)tests[x].msg, strlen(tests[x].msg)); - rmd160_done(&md, buf); - if (XMEMCMP(buf, tests[x].md, 20) != 0) { -#if 0 - printf("Failed test %d\n", x); -#endif + rmd160_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg)); + rmd160_done(&md, tmp); + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD160", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/rmd256.c b/src/hashes/rmd256.c index cbfadcc28..fa90c094a 100644 --- a/src/hashes/rmd256.c +++ b/src/hashes/rmd256.c @@ -369,7 +369,7 @@ int rmd256_test(void) #else static const struct { char *msg; - unsigned char md[32]; + unsigned char hash[32]; } tests[] = { { "", { 0x02, 0xba, 0x4c, 0x4e, 0x5f, 0x8e, 0xcd, 0x18, @@ -408,18 +408,16 @@ int rmd256_test(void) 0xa8, 0x9f, 0x7e, 0xa6, 0xde, 0x77, 0xa0, 0xb8 } } }; - int x; - unsigned char buf[32]; + + int i; + unsigned char tmp[32]; hash_state md; - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { rmd256_init(&md); - rmd256_process(&md, (unsigned char *)tests[x].msg, strlen(tests[x].msg)); - rmd256_done(&md, buf); - if (XMEMCMP(buf, tests[x].md, 32) != 0) { - #if 0 - printf("Failed test %d\n", x); - #endif + rmd256_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg)); + rmd256_done(&md, tmp); + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD256", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/rmd320.c b/src/hashes/rmd320.c index 26119f98c..05b2decef 100644 --- a/src/hashes/rmd320.c +++ b/src/hashes/rmd320.c @@ -434,7 +434,7 @@ int rmd320_test(void) #else static const struct { char *msg; - unsigned char md[40]; + unsigned char hash[40]; } tests[] = { { "", { 0x22, 0xd6, 0x5d, 0x56, 0x61, 0x53, 0x6c, 0xdc, 0x75, 0xc1, @@ -473,18 +473,16 @@ int rmd320_test(void) 0xbc, 0x74, 0x70, 0xa9, 0x69, 0xc9, 0xd0, 0x72, 0xa1, 0xac } } }; - int x; - unsigned char buf[40]; + + int i; + unsigned char tmp[40]; hash_state md; - for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { + for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { rmd320_init(&md); - rmd320_process(&md, (unsigned char *)tests[x].msg, strlen(tests[x].msg)); - rmd320_done(&md, buf); - if (XMEMCMP(buf, tests[x].md, 40) != 0) { -#if 0 - printf("Failed test %d\n", x); -#endif + rmd320_process(&md, (unsigned char *)tests[i].msg, strlen(tests[i].msg)); + rmd320_done(&md, tmp); + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "RIPEMD320", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/sha1.c b/src/hashes/sha1.c index 96c3b93a9..b4324b18c 100644 --- a/src/hashes/sha1.c +++ b/src/hashes/sha1.c @@ -271,7 +271,7 @@ int sha1_test(void) sha1_init(&md); sha1_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); sha1_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 20) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA1", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/sha2/sha224.c b/src/hashes/sha2/sha224.c index 2240aaf73..d19eb1f69 100644 --- a/src/hashes/sha2/sha224.c +++ b/src/hashes/sha2/sha224.c @@ -115,7 +115,7 @@ int sha224_test(void) sha224_init(&md); sha224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); sha224_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 28) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA224", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index 13ec9e67f..02fae8322 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -319,7 +319,7 @@ int sha256_test(void) sha256_init(&md); sha256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); sha256_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA256", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/sha2/sha384.c b/src/hashes/sha2/sha384.c index 483784b02..c7fb02ab8 100644 --- a/src/hashes/sha2/sha384.c +++ b/src/hashes/sha2/sha384.c @@ -121,7 +121,7 @@ int sha384_test(void) sha384_init(&md); sha384_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); sha384_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 48) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA384", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index fbf14de3c..951865ee5 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -297,7 +297,7 @@ int sha512_test(void) sha512_init(&md); sha512_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); sha512_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 64) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/sha2/sha512_224.c b/src/hashes/sha2/sha512_224.c index 98fba3ae1..b485cf589 100644 --- a/src/hashes/sha2/sha512_224.c +++ b/src/hashes/sha2/sha512_224.c @@ -117,7 +117,7 @@ int sha512_224_test(void) sha512_224_init(&md); sha512_224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); sha512_224_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 28) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512-224", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/sha2/sha512_256.c b/src/hashes/sha2/sha512_256.c index 86e4bac47..8bfbdcc3b 100644 --- a/src/hashes/sha2/sha512_256.c +++ b/src/hashes/sha2/sha512_256.c @@ -117,7 +117,7 @@ int sha512_256_test(void) sha512_256_init(&md); sha512_256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); sha512_256_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512-265", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/sha3_test.c b/src/hashes/sha3_test.c index b4b3d8d4a..8804a6a27 100644 --- a/src/hashes/sha3_test.c +++ b/src/hashes/sha3_test.c @@ -18,7 +18,7 @@ int sha3_224_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - unsigned char buf[200], hash[200]; + unsigned char buf[200], hash[224 / 8]; int i; hash_state c; const unsigned char c1 = 0xa3; @@ -42,8 +42,7 @@ int sha3_224_test(void) /* SHA3-224 on an empty buffer */ sha3_224_init(&c); sha3_done(&c, hash); - if(XMEMCMP(sha3_224_empty, hash, sizeof(sha3_224_empty)) != 0) { - printf("SHA3-224() failed\n"); + if (compare_testvector(hash, sizeof(hash), sha3_224_empty, sizeof(sha3_224_empty), "SHA3-224", 1)) { return CRYPT_FAIL_TESTVECTOR; } @@ -52,8 +51,7 @@ int sha3_224_test(void) sha3_process(&c, buf, sizeof(buf) / 2); sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); sha3_done(&c, hash); - if(XMEMCMP(sha3_224_0xa3_200_times, hash, sizeof(sha3_224_0xa3_200_times)) != 0) { - printf("SHA3-224( 0xa3 ... [200 times] ) failed (2 steps)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_224_0xa3_200_times, sizeof(sha3_224_0xa3_200_times), "SHA3-224", 1)) { return CRYPT_FAIL_TESTVECTOR; } @@ -64,8 +62,7 @@ int sha3_224_test(void) sha3_process(&c, &c1, 1); } sha3_done(&c, hash); - if(XMEMCMP(sha3_224_0xa3_200_times, hash, sizeof(sha3_224_0xa3_200_times)) != 0) { - printf("SHA3-224( 0xa3 ... [200 times] ) failed (200 steps)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_224_0xa3_200_times, sizeof(sha3_224_0xa3_200_times), "SHA3-224", 2)) { return CRYPT_FAIL_TESTVECTOR; } @@ -78,7 +75,7 @@ int sha3_256_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - unsigned char buf[200], hash[200]; + unsigned char buf[200], hash[256 / 8]; int i; hash_state c; const unsigned char c1 = 0xa3; @@ -101,8 +98,7 @@ int sha3_256_test(void) /* SHA3-256 on an empty buffer */ sha3_256_init(&c); sha3_done(&c, hash); - if(XMEMCMP(sha3_256_empty, hash, sizeof(sha3_256_empty)) != 0) { - printf("SHA3-256() failed\n"); + if (compare_testvector(hash, sizeof(hash), sha3_256_empty, sizeof(sha3_256_empty), "SHA3-256", 1)) { return CRYPT_FAIL_TESTVECTOR; } @@ -110,8 +106,7 @@ int sha3_256_test(void) sha3_256_init(&c); sha3_process(&c, buf, sizeof(buf)); sha3_done(&c, hash); - if(XMEMCMP(sha3_256_0xa3_200_times, hash, sizeof(sha3_256_0xa3_200_times)) != 0) { - printf("SHA3-256( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-256", 2)) { return CRYPT_FAIL_TESTVECTOR; } @@ -120,8 +115,7 @@ int sha3_256_test(void) sha3_process(&c, buf, sizeof(buf) / 2); sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); sha3_done(&c, hash); - if(XMEMCMP(sha3_256_0xa3_200_times, hash, sizeof(sha3_256_0xa3_200_times)) != 0) { - printf("SHA3-256( 0xa3 ... [200 times] ) failed (2 steps)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-224", 3)) { return CRYPT_FAIL_TESTVECTOR; } @@ -132,8 +126,7 @@ int sha3_256_test(void) sha3_process(&c, &c1, 1); } sha3_done(&c, hash); - if(XMEMCMP(sha3_256_0xa3_200_times, hash, sizeof(sha3_256_0xa3_200_times)) != 0) { - printf("SHA3-256( 0xa3 ... [200 times] ) failed (200 steps)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-224", 4)) { return CRYPT_FAIL_TESTVECTOR; } @@ -159,11 +152,11 @@ int sha3_256_test(void) "\x76\x3d\x52\xdb\x98\xd9\x49\xd3" "\xb0\xfe\xd6\xa8\x05\x2f\xbb", 1080 / 8); sha3_done(&c, hash); - if(XMEMCMP(hash, "\xa1\x9e\xee\x92\xbb\x20\x97\xb6" - "\x4e\x82\x3d\x59\x77\x98\xaa\x18" - "\xbe\x9b\x7c\x73\x6b\x80\x59\xab" - "\xfd\x67\x79\xac\x35\xac\x81\xb5", 256 / 8) != 0) { - printf("SHA3-256( b771 ... ) doesn't match the known answer\n"); + if(compare_testvector(hash, sizeof(hash), + "\xa1\x9e\xee\x92\xbb\x20\x97\xb6" + "\x4e\x82\x3d\x59\x77\x98\xaa\x18" + "\xbe\x9b\x7c\x73\x6b\x80\x59\xab" + "\xfd\x67\x79\xac\x35\xac\x81\xb5", 256 / 8, "SHA2-256", 5)) { return CRYPT_FAIL_TESTVECTOR; } @@ -176,7 +169,7 @@ int sha3_384_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - unsigned char buf[200], hash[200]; + unsigned char buf[200], hash[384 / 8]; int i; hash_state c; const unsigned char c1 = 0xa3; @@ -196,8 +189,7 @@ int sha3_384_test(void) sha3_384_init(&c); sha3_process(&c, buf, sizeof(buf)); sha3_done(&c, hash); - if(XMEMCMP(sha3_384_0xa3_200_times, hash, sizeof(sha3_384_0xa3_200_times)) != 0) { - printf("SHA3-384( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_384_0xa3_200_times, sizeof(sha3_384_0xa3_200_times), "SHA3-384", 0)) { return CRYPT_FAIL_TESTVECTOR; } @@ -206,8 +198,7 @@ int sha3_384_test(void) sha3_process(&c, buf, sizeof(buf) / 2); sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); sha3_done(&c, hash); - if(XMEMCMP(sha3_384_0xa3_200_times, hash, sizeof(sha3_384_0xa3_200_times)) != 0) { - printf("SHA3-384( 0xa3 ... [200 times] ) failed (2 steps)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_384_0xa3_200_times, sizeof(sha3_384_0xa3_200_times), "SHA3-384", 1)) { return CRYPT_FAIL_TESTVECTOR; } @@ -218,8 +209,7 @@ int sha3_384_test(void) sha3_process(&c, &c1, 1); } sha3_done(&c, hash); - if(XMEMCMP(sha3_384_0xa3_200_times, hash, sizeof(sha3_384_0xa3_200_times)) != 0) { - printf("SHA3-384( 0xa3 ... [200 times] ) failed (200 steps)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_384_0xa3_200_times, sizeof(sha3_384_0xa3_200_times), "SHA3-384", 2)) { return CRYPT_FAIL_TESTVECTOR; } @@ -232,7 +222,7 @@ int sha3_512_test(void) #ifndef LTC_TEST return CRYPT_NOP; #else - unsigned char buf[200], hash[200]; + unsigned char buf[200], hash[512 / 8]; int i; hash_state c; const unsigned char c1 = 0xa3; @@ -254,8 +244,7 @@ int sha3_512_test(void) sha3_512_init(&c); sha3_process(&c, buf, sizeof(buf)); sha3_done(&c, hash); - if(XMEMCMP(sha3_512_0xa3_200_times, hash, sizeof(sha3_512_0xa3_200_times)) != 0) { - printf("SHA3-512( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_512_0xa3_200_times, sizeof(sha3_512_0xa3_200_times), "SHA3-512", 0)) { return CRYPT_FAIL_TESTVECTOR; } @@ -264,8 +253,7 @@ int sha3_512_test(void) sha3_process(&c, buf, sizeof(buf) / 2); sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); sha3_done(&c, hash); - if(XMEMCMP(sha3_512_0xa3_200_times, hash, sizeof(sha3_512_0xa3_200_times)) != 0) { - printf("SHA3-512( 0xa3 ... [200 times] ) failed (2 steps)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_512_0xa3_200_times, sizeof(sha3_512_0xa3_200_times), "SHA3-512", 1)) { return CRYPT_FAIL_TESTVECTOR; } @@ -276,8 +264,7 @@ int sha3_512_test(void) sha3_process(&c, &c1, 1); } sha3_done(&c, hash); - if(XMEMCMP(sha3_512_0xa3_200_times, hash, sizeof(sha3_512_0xa3_200_times)) != 0) { - printf("SHA3-512( 0xa3 ... [200 times] ) failed (200 steps)\n"); + if (compare_testvector(hash, sizeof(hash), sha3_512_0xa3_200_times, sizeof(sha3_512_0xa3_200_times), "SHA3-512", 2)) { return CRYPT_FAIL_TESTVECTOR; } @@ -326,16 +313,14 @@ int sha3_shake_test(void) /* SHAKE256 on an empty buffer */ sha3_shake_init(&c, 256); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if(XMEMCMP(shake256_empty, hash, sizeof(shake256_empty)) != 0) { - printf("SHAKE256('') failed\n"); + if (compare_testvector(hash, sizeof(shake256_empty), shake256_empty, sizeof(shake256_empty), "SHAKE256", 0)) { return CRYPT_FAIL_TESTVECTOR; } /* SHAKE256 via sha3_shake_memory [FIPS 202] */ len = 512; sha3_shake_memory(256, buf, sizeof(buf), hash, &len); - if(XMEMCMP(shake256_0xa3_200_times, hash + 480, sizeof(shake256_0xa3_200_times)) != 0) { - printf("SHAKE256( 0xa3 ... [200 times] ) failed (sha3_shake_memory)\n"); + if (compare_testvector(hash + 480, sizeof(shake256_0xa3_200_times), shake256_0xa3_200_times, sizeof(shake256_0xa3_200_times), "SHAKE256", 1)) { return CRYPT_FAIL_TESTVECTOR; } @@ -343,8 +328,7 @@ int sha3_shake_test(void) sha3_shake_init(&c, 256); sha3_shake_process(&c, buf, sizeof(buf)); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if(XMEMCMP(shake256_0xa3_200_times, hash, sizeof(shake256_0xa3_200_times)) != 0) { - printf("SHAKE256( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + if (compare_testvector(hash, sizeof(shake256_0xa3_200_times), shake256_0xa3_200_times, sizeof(shake256_0xa3_200_times), "SHAKE256", 2)) { return CRYPT_FAIL_TESTVECTOR; } @@ -353,8 +337,7 @@ int sha3_shake_test(void) sha3_shake_process(&c, buf, sizeof(buf) / 2); sha3_shake_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if(XMEMCMP(shake256_0xa3_200_times, hash, sizeof(shake256_0xa3_200_times)) != 0) { - printf("SHAKE256( 0xa3 ... [200 times] ) failed (2 steps)\n"); + if (compare_testvector(hash, sizeof(shake256_0xa3_200_times), shake256_0xa3_200_times, sizeof(shake256_0xa3_200_times), "SHAKE256", 3)) { return CRYPT_FAIL_TESTVECTOR; } @@ -363,24 +346,21 @@ int sha3_shake_test(void) sha3_shake_init(&c, 256); while (i--) sha3_shake_process(&c, &c1, 1); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if(XMEMCMP(shake256_0xa3_200_times, hash, sizeof(shake256_0xa3_200_times)) != 0) { - printf("SHAKE256( 0xa3 ... [200 times] ) failed (200 steps)\n"); + if (compare_testvector(hash, sizeof(shake256_0xa3_200_times), shake256_0xa3_200_times, sizeof(shake256_0xa3_200_times), "SHAKE256", 3)) { return CRYPT_FAIL_TESTVECTOR; } /* SHAKE128 on an empty buffer */ sha3_shake_init(&c, 128); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if(XMEMCMP(shake128_empty, hash, sizeof(shake128_empty)) != 0) { - printf("SHAKE128() failed\n"); + if (compare_testvector(hash, sizeof(shake128_empty), shake128_empty, sizeof(shake128_empty), "SHAKE128", 0)) { return CRYPT_FAIL_TESTVECTOR; } /* SHAKE128 via sha3_shake_memory [FIPS 202] */ len = 512; sha3_shake_memory(128, buf, sizeof(buf), hash, &len); - if(XMEMCMP(shake128_0xa3_200_times, hash + 480, sizeof(shake128_0xa3_200_times)) != 0) { - printf("SHAKE128( 0xa3 ... [200 times] ) failed (sha3_shake_memory)\n"); + if (compare_testvector(hash + 480, sizeof(shake128_0xa3_200_times), shake128_0xa3_200_times, sizeof(shake128_0xa3_200_times), "SHAKE128", 1)) { return CRYPT_FAIL_TESTVECTOR; } @@ -388,8 +368,7 @@ int sha3_shake_test(void) sha3_shake_init(&c, 128); sha3_shake_process(&c, buf, sizeof(buf)); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if(XMEMCMP(shake128_0xa3_200_times, hash, sizeof(shake128_0xa3_200_times)) != 0) { - printf("SHAKE128( 0xa3 ... [200 times] ) failed (1 buffer)\n"); + if (compare_testvector(hash, sizeof(shake128_0xa3_200_times), shake128_0xa3_200_times, sizeof(shake128_0xa3_200_times), "SHAKE128", 2)) { return CRYPT_FAIL_TESTVECTOR; } @@ -398,8 +377,7 @@ int sha3_shake_test(void) sha3_shake_process(&c, buf, sizeof(buf) / 2); sha3_shake_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if(XMEMCMP(shake128_0xa3_200_times, hash, sizeof(shake128_0xa3_200_times)) != 0) { - printf("SHAKE128( 0xa3 ... [200 times] ) failed (2 steps)\n"); + if (compare_testvector(hash, sizeof(shake128_0xa3_200_times), shake128_0xa3_200_times, sizeof(shake128_0xa3_200_times), "SHAKE128", 3)) { return CRYPT_FAIL_TESTVECTOR; } @@ -408,8 +386,7 @@ int sha3_shake_test(void) sha3_shake_init(&c, 128); while (i--) sha3_shake_process(&c, &c1, 1); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if(XMEMCMP(shake128_0xa3_200_times, hash, sizeof(shake128_0xa3_200_times)) != 0) { - printf("SHAKE128( 0xa3 ... [200 times] ) failed (200 steps)\n"); + if (compare_testvector(hash, sizeof(shake128_0xa3_200_times), shake128_0xa3_200_times, sizeof(shake128_0xa3_200_times), "SHAKE128", 4)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/hashes/tiger.c b/src/hashes/tiger.c index dcacb6441..e117e77a2 100644 --- a/src/hashes/tiger.c +++ b/src/hashes/tiger.c @@ -775,7 +775,7 @@ int tiger_test(void) tiger_init(&md); tiger_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); tiger_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 24) != 0) { + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "TIGER", i)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/hashes/whirl/whirl.c b/src/hashes/whirl/whirl.c index 525d75bed..5e0b23163 100644 --- a/src/hashes/whirl/whirl.c +++ b/src/hashes/whirl/whirl.c @@ -291,14 +291,7 @@ int whirlpool_test(void) whirlpool_init(&md); whirlpool_process(&md, (unsigned char *)tests[i].msg, tests[i].len); whirlpool_done(&md, tmp); - if (XMEMCMP(tmp, tests[i].hash, 64) != 0) { -#if 0 - printf("\nFailed test %d\n", i); - for (i = 0; i < 64; ) { - printf("%02x ", tmp[i]); - if (!(++i & 15)) printf("\n"); - } -#endif + if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "WHIRLPOOL", i)) { return CRYPT_FAIL_TESTVECTOR; } } From a8d81a7214905fe43ccacfcf873bb4cb85af7265 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 21 May 2017 15:32:16 -0400 Subject: [PATCH 0774/1192] fix sha3 test numbers --- src/hashes/sha3_test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hashes/sha3_test.c b/src/hashes/sha3_test.c index 8804a6a27..36e4b033c 100644 --- a/src/hashes/sha3_test.c +++ b/src/hashes/sha3_test.c @@ -42,7 +42,7 @@ int sha3_224_test(void) /* SHA3-224 on an empty buffer */ sha3_224_init(&c); sha3_done(&c, hash); - if (compare_testvector(hash, sizeof(hash), sha3_224_empty, sizeof(sha3_224_empty), "SHA3-224", 1)) { + if (compare_testvector(hash, sizeof(hash), sha3_224_empty, sizeof(sha3_224_empty), "SHA3-224", 0)) { return CRYPT_FAIL_TESTVECTOR; } @@ -98,7 +98,7 @@ int sha3_256_test(void) /* SHA3-256 on an empty buffer */ sha3_256_init(&c); sha3_done(&c, hash); - if (compare_testvector(hash, sizeof(hash), sha3_256_empty, sizeof(sha3_256_empty), "SHA3-256", 1)) { + if (compare_testvector(hash, sizeof(hash), sha3_256_empty, sizeof(sha3_256_empty), "SHA3-256", 0)) { return CRYPT_FAIL_TESTVECTOR; } @@ -106,7 +106,7 @@ int sha3_256_test(void) sha3_256_init(&c); sha3_process(&c, buf, sizeof(buf)); sha3_done(&c, hash); - if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-256", 2)) { + if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-256", 1)) { return CRYPT_FAIL_TESTVECTOR; } @@ -115,7 +115,7 @@ int sha3_256_test(void) sha3_process(&c, buf, sizeof(buf) / 2); sha3_process(&c, buf + sizeof(buf) / 2, sizeof(buf) / 2); sha3_done(&c, hash); - if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-224", 3)) { + if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-256", 2)) { return CRYPT_FAIL_TESTVECTOR; } @@ -126,7 +126,7 @@ int sha3_256_test(void) sha3_process(&c, &c1, 1); } sha3_done(&c, hash); - if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-224", 4)) { + if (compare_testvector(hash, sizeof(hash), sha3_256_0xa3_200_times, sizeof(sha3_256_0xa3_200_times), "SHA3-256", 3)) { return CRYPT_FAIL_TESTVECTOR; } @@ -156,7 +156,7 @@ int sha3_256_test(void) "\xa1\x9e\xee\x92\xbb\x20\x97\xb6" "\x4e\x82\x3d\x59\x77\x98\xaa\x18" "\xbe\x9b\x7c\x73\x6b\x80\x59\xab" - "\xfd\x67\x79\xac\x35\xac\x81\xb5", 256 / 8, "SHA2-256", 5)) { + "\xfd\x67\x79\xac\x35\xac\x81\xb5", 256 / 8, "SHA3-256", 4)) { return CRYPT_FAIL_TESTVECTOR; } @@ -346,7 +346,7 @@ int sha3_shake_test(void) sha3_shake_init(&c, 256); while (i--) sha3_shake_process(&c, &c1, 1); for (i = 0; i < 16; i++) sha3_shake_done(&c, hash, 32); /* get 512 bytes, keep in hash the last 32 */ - if (compare_testvector(hash, sizeof(shake256_0xa3_200_times), shake256_0xa3_200_times, sizeof(shake256_0xa3_200_times), "SHAKE256", 3)) { + if (compare_testvector(hash, sizeof(shake256_0xa3_200_times), shake256_0xa3_200_times, sizeof(shake256_0xa3_200_times), "SHAKE256", 4)) { return CRYPT_FAIL_TESTVECTOR; } From 9913c1dcb8ab051cba1f36a3bc76435a76cb3fc0 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 22 May 2017 13:44:53 -0400 Subject: [PATCH 0775/1192] =?UTF-8?q?AIX=20and=20OS=20X=20(and=20maybe=20B?= =?UTF-8?q?SD)=20sh=20has=20a=20built-in=20echo=20which=20doesn=E2=80=99t?= =?UTF-8?q?=20support=20the=20-n=20flag=20(OS=20X=20sh=20is=20actually=20b?= =?UTF-8?q?ash=20but=20it=20doesn=E2=80=99t=20support=20-n=20based=20on=20?= =?UTF-8?q?compile-time=20flags=20and=20the=20POSIXLY=5FCORRECT=20environm?= =?UTF-8?q?ent=20variable).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AIX /bin/echo doesn’t support -n. AIX echo and OS X /bin/echo support \c to prevent a trailing newline but linux echo (bash builtin and /bin/echo) don’t support it unless you also use the -e flag (which is not support by AIX /bin/echo or OS X sh or /bin/echo). The BSD echo man page suggests using printf to avoid trailing newline, which is available on linux, OS X, and AIX. --- makefile_include.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index ff89df7e0..e294d3180 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -92,7 +92,7 @@ CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare endif -GIT_VERSION := $(shell [ -e .git ] && { echo -n git- ; git describe --tags --always --dirty ; } || echo $(VERSION)) +GIT_VERSION := $(shell [ -e .git ] && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION)) ifneq ($(GIT_VERSION),) CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" endif From 704055810fb6d8b11cb25583d7d69c23eff628c4 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Mon, 29 May 2017 14:58:07 +0200 Subject: [PATCH 0776/1192] sort input files when building packages (e.g. for openSUSE Linux) (random) filesystem order of input files influences ordering of functions in the output, thus without the patch, builds (in disposable VMs) would differ. See https://reproducible-builds.org/ for why this matters. --- makefile.shared | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile.shared b/makefile.shared index 04e08e748..c6086985c 100644 --- a/makefile.shared +++ b/makefile.shared @@ -37,10 +37,10 @@ src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< $(LIBNAME): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo"` $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo" | LC_ALL=C sort` $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) $(LIBTEST): $(TOBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo"` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo" | LC_ALL=C sort` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) install: .common_install sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc From 1de3f2a1f61833428f27ff606f8e9b6dc91ad803 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 11 May 2017 14:53:51 +0200 Subject: [PATCH 0777/1192] correctly NOP there's still mac_test() which doesn't NOP correctly but who cares anyway? --- testprof/der_tests.c | 3 +-- testprof/dh_test.c | 3 +-- testprof/dsa_test.c | 3 +-- testprof/ecc_test.c | 3 +-- testprof/modes_test.c | 3 --- testprof/pkcs_1_eme_test.c | 3 +-- testprof/pkcs_1_emsa_test.c | 3 +-- testprof/pkcs_1_oaep_test.c | 3 +-- testprof/pkcs_1_pss_test.c | 3 +-- testprof/pkcs_1_test.c | 3 +-- testprof/rsa_test.c | 3 +-- 11 files changed, 10 insertions(+), 23 deletions(-) diff --git a/testprof/der_tests.c b/testprof/der_tests.c index c2141e681..d165646cd 100644 --- a/testprof/der_tests.c +++ b/testprof/der_tests.c @@ -7,8 +7,7 @@ int der_tests(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #else diff --git a/testprof/dh_test.c b/testprof/dh_test.c index e2bd9809f..86af8c603 100644 --- a/testprof/dh_test.c +++ b/testprof/dh_test.c @@ -114,8 +114,7 @@ int dh_test (void) int dh_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/dsa_test.c b/testprof/dsa_test.c index 37f06d7ad..de8b6e69e 100644 --- a/testprof/dsa_test.c +++ b/testprof/dsa_test.c @@ -240,8 +240,7 @@ int dsa_test(void) int dsa_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/ecc_test.c b/testprof/ecc_test.c index b4668d04e..23d259a0e 100644 --- a/testprof/ecc_test.c +++ b/testprof/ecc_test.c @@ -237,8 +237,7 @@ int ecc_tests (void) int ecc_tests(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/modes_test.c b/testprof/modes_test.c index 58a9fae6d..1ec882ee2 100644 --- a/testprof/modes_test.c +++ b/testprof/modes_test.c @@ -114,9 +114,6 @@ int modes_test(void) DO(ret = xts_test()); #endif - if (ret == CRYPT_NOP) - fprintf(stderr, "NOP"); - return 0; } diff --git a/testprof/pkcs_1_eme_test.c b/testprof/pkcs_1_eme_test.c index 2950b2803..e70915698 100644 --- a/testprof/pkcs_1_eme_test.c +++ b/testprof/pkcs_1_eme_test.c @@ -57,8 +57,7 @@ int pkcs_1_eme_test(void) int pkcs_1_eme_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/pkcs_1_emsa_test.c b/testprof/pkcs_1_emsa_test.c index e6d2cc2b4..cf1c0f87d 100644 --- a/testprof/pkcs_1_emsa_test.c +++ b/testprof/pkcs_1_emsa_test.c @@ -53,8 +53,7 @@ int pkcs_1_emsa_test(void) int pkcs_1_emsa_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/pkcs_1_oaep_test.c b/testprof/pkcs_1_oaep_test.c index 42a4dbd64..ae1aee3ed 100644 --- a/testprof/pkcs_1_oaep_test.c +++ b/testprof/pkcs_1_oaep_test.c @@ -57,8 +57,7 @@ int pkcs_1_oaep_test(void) int pkcs_1_oaep_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/pkcs_1_pss_test.c b/testprof/pkcs_1_pss_test.c index d3363d8d0..76822c9c1 100644 --- a/testprof/pkcs_1_pss_test.c +++ b/testprof/pkcs_1_pss_test.c @@ -58,8 +58,7 @@ int pkcs_1_pss_test(void) int pkcs_1_pss_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/pkcs_1_test.c b/testprof/pkcs_1_test.c index 792d024fd..0ec8cdf8e 100644 --- a/testprof/pkcs_1_test.c +++ b/testprof/pkcs_1_test.c @@ -87,8 +87,7 @@ int pkcs_1_test(void) int pkcs_1_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif diff --git a/testprof/rsa_test.c b/testprof/rsa_test.c index c9b9923df..3540fd305 100644 --- a/testprof/rsa_test.c +++ b/testprof/rsa_test.c @@ -616,8 +616,7 @@ for (cnt = 0; cnt < len; ) { int rsa_test(void) { - fprintf(stderr, "NOP"); - return 0; + return CRYPT_NOP; } #endif From 4929860641f8088de7f3f67c7863133935791d4c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 31 May 2017 01:57:40 +0200 Subject: [PATCH 0778/1192] fix file modes --- src/misc/crypt/crypt_constants.c | 0 src/misc/crypt/crypt_inits.c | 0 src/misc/crypt/crypt_sizes.c | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/misc/crypt/crypt_constants.c mode change 100755 => 100644 src/misc/crypt/crypt_inits.c mode change 100755 => 100644 src/misc/crypt/crypt_sizes.c diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c old mode 100755 new mode 100644 diff --git a/src/misc/crypt/crypt_inits.c b/src/misc/crypt/crypt_inits.c old mode 100755 new mode 100644 diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c old mode 100755 new mode 100644 From 08a461b39c8d2af8643514cc7f0ed06491c82212 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 21:32:10 +0200 Subject: [PATCH 0779/1192] also build openssl-enc --- .gitignore | 2 ++ demos/openssl-enc.c | 10 +++++----- makefile_include.mk | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index ee4902f6b..be6d759a4 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,8 @@ hashsum hashsum.exe multi multi.exe +openssl-enc +openssl-enc.exe sizes sizes.exe small diff --git a/demos/openssl-enc.c b/demos/openssl-enc.c index a974c5543..daf529bd4 100644 --- a/demos/openssl-enc.c +++ b/demos/openssl-enc.c @@ -157,8 +157,8 @@ void dump_bytes(unsigned char *in, unsigned long len) * Set is_padding to 1 to pad, 0 to unpad. * * Input: paddable buffer, size read, block length of cipher, mode - * Output: none - * Side Effects: bytes printed as a hex blob, no lf at the end + * Output: number of bytes after padding resp. after unpadding + * Side Effects: none */ size_t pkcs7_pad(union paddable *buf, size_t nb, int block_length, int is_padding) @@ -190,14 +190,14 @@ size_t pkcs7_pad(union paddable *buf, size_t nb, int block_length, /* padval must be nonzero and <= block length */ if(padval <= 0 || padval > block_length) - return -1; + return 0; /* First byte's accounted for; do the rest */ idx--; while(idx >= (off_t)(nb-padval)) if(buf->pad[idx] != padval) - return -1; + return 0; else idx--; @@ -264,7 +264,7 @@ int do_crypt(FILE *infd, FILE *outfd, unsigned char *key, unsigned char *iv, if( feof(infd) ) nb = pkcs7_pad(&outbuf, nb, aes_desc.block_length, 0); - if(nb == -1) + if(nb == 0) /* The file didn't decrypt correctly */ return CRYPT_ERROR; diff --git a/makefile_include.mk b/makefile_include.mk index e294d3180..5c34a8e27 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -108,7 +108,7 @@ THEADERS = $(wildcard testprof/*.h) TIMING=timing TEST=test -USEFUL_DEMOS=hashsum +USEFUL_DEMOS=hashsum openssl-enc DEMOS=$(USEFUL_DEMOS) ltcrypt small tv_gen sizes constants TIMINGS=demos/timing.o From db5438ca5577d7509a73db9cf3312342d3c9ab1d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 22:19:48 +0200 Subject: [PATCH 0780/1192] don't build openssl-enc for tests --- demos/openssl-enc.c | 3 +++ makefile_include.mk | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/demos/openssl-enc.c b/demos/openssl-enc.c index daf529bd4..b94c402a8 100644 --- a/demos/openssl-enc.c +++ b/demos/openssl-enc.c @@ -48,6 +48,9 @@ #ifndef LTC_RNG_GET_BYTES #error Cannot compile this demo; random generator required #endif +#ifndef LTC_MD5 +#error Cannot compile this demo; MD5 required +#endif /* OpenSSL by default only runs one hash round */ #define OPENSSL_ITERATIONS 1 diff --git a/makefile_include.mk b/makefile_include.mk index 5c34a8e27..d493d0ef6 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -108,8 +108,9 @@ THEADERS = $(wildcard testprof/*.h) TIMING=timing TEST=test -USEFUL_DEMOS=hashsum openssl-enc -DEMOS=$(USEFUL_DEMOS) ltcrypt small tv_gen sizes constants +USEFUL_DEMOS=hashsum +UNBROKEN_DEMOS=$(USEFUL_DEMOS) ltcrypt small tv_gen sizes constants +DEMOS=$(UNBROKEN_DEMOS) openssl-enc TIMINGS=demos/timing.o TESTS=demos/test.o @@ -330,7 +331,7 @@ $(TOBJECTS): $(HEADERS) $(THEADERS) bins: $(USEFUL_DEMOS) -all_test: test tv_gen $(DEMOS) +all_test: test $(UNBROKEN_DEMOS) #build the doxy files (requires Doxygen, tetex and patience) doxygen doxy docs: From 9b8fff62602136640787d39cf42cdf24ecf47ef3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 13:52:39 +0200 Subject: [PATCH 0781/1192] add testprof/common.c so we can remove all the duplicate registration implementations ...and we can put some other shared stuff in there as well --- demos/hashsum.c | 85 +------- demos/ltcrypt.c | 70 +------ demos/test.c | 2 +- demos/timing.c | 2 +- demos/tv_gen.c | 148 +------------ helper.pl | 4 +- testprof/common.c | 435 +++++++++++++++++++++++++++++++++++++++ testprof/common.h | 15 ++ testprof/tomcrypt_test.h | 15 +- testprof/x86_prof.c | 418 ------------------------------------- 10 files changed, 462 insertions(+), 732 deletions(-) create mode 100644 testprof/common.c create mode 100644 testprof/common.h diff --git a/demos/hashsum.c b/demos/hashsum.c index 8a864fb75..b6e932e3b 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -15,6 +15,8 @@ #define basename(x) x #endif +#include "common.h" + #if !defined(PATH_MAX) && defined(_MSC_VER) #include #define PATH_MAX MAX_PATH @@ -27,8 +29,6 @@ '\255') #define HEXOF(x) (x - _base(x)) -static void register_algs(void); - static char* hashsum; static void die(int status) @@ -261,87 +261,6 @@ int main(int argc, char **argv) return EXIT_SUCCESS; } -static void register_algs(void) -{ - int err; - LTC_UNUSED_PARAM(err); - -#ifdef LTC_TIGER - register_hash (&tiger_desc); -#endif -#ifdef LTC_MD2 - register_hash (&md2_desc); -#endif -#ifdef LTC_MD4 - register_hash (&md4_desc); -#endif -#ifdef LTC_MD5 - register_hash (&md5_desc); -#endif -#ifdef LTC_SHA1 - register_hash (&sha1_desc); -#endif -#ifdef LTC_SHA224 - register_hash (&sha224_desc); -#endif -#ifdef LTC_SHA256 - register_hash (&sha256_desc); -#endif -#ifdef LTC_SHA384 - register_hash (&sha384_desc); -#endif -#ifdef LTC_SHA512 - register_hash (&sha512_desc); -#endif -#ifdef LTC_SHA512_224 - register_hash (&sha512_224_desc); -#endif -#ifdef LTC_SHA512_256 - register_hash (&sha512_256_desc); -#endif -#ifdef LTC_SHA3 - register_hash (&sha3_224_desc); - register_hash (&sha3_256_desc); - register_hash (&sha3_384_desc); - register_hash (&sha3_512_desc); -#endif -#ifdef LTC_RIPEMD128 - register_hash (&rmd128_desc); -#endif -#ifdef LTC_RIPEMD160 - register_hash (&rmd160_desc); -#endif -#ifdef LTC_RIPEMD256 - register_hash (&rmd256_desc); -#endif -#ifdef LTC_RIPEMD320 - register_hash (&rmd320_desc); -#endif -#ifdef LTC_WHIRLPOOL - register_hash (&whirlpool_desc); -#endif -#ifdef LTC_BLAKE2S - register_hash (&blake2s_128_desc); - register_hash (&blake2s_160_desc); - register_hash (&blake2s_224_desc); - register_hash (&blake2s_256_desc); -#endif -#ifdef LTC_BLAKE2B - register_hash (&blake2b_160_desc); - register_hash (&blake2b_256_desc); - register_hash (&blake2b_384_desc); - register_hash (&blake2b_512_desc); -#endif -#ifdef LTC_CHC_HASH - register_hash(&chc_desc); - if ((err = chc_register(register_cipher(&aes_enc_desc))) != CRYPT_OK) { - printf("chc_register error: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } -#endif - -} - /* $Source$ */ /* $Revision$ */ /* $Date$ */ diff --git a/demos/ltcrypt.c b/demos/ltcrypt.c index 75aee7028..91c1e96c9 100644 --- a/demos/ltcrypt.c +++ b/demos/ltcrypt.c @@ -9,6 +9,8 @@ #include +#include "common.h" + int usage(char *name) { int x; @@ -22,74 +24,6 @@ int usage(char *name) exit(1); } -void register_algs(void) -{ -#ifdef LTC_RIJNDAEL - register_cipher (&aes_desc); -#endif -#ifdef LTC_BLOWFISH - register_cipher (&blowfish_desc); -#endif -#ifdef LTC_XTEA - register_cipher (&xtea_desc); -#endif -#ifdef LTC_RC5 - register_cipher (&rc5_desc); -#endif -#ifdef LTC_RC6 - register_cipher (&rc6_desc); -#endif -#ifdef LTC_SAFERP - register_cipher (&saferp_desc); -#endif -#ifdef LTC_TWOFISH - register_cipher (&twofish_desc); -#endif -#ifdef LTC_SAFER - register_cipher (&safer_k64_desc); - register_cipher (&safer_sk64_desc); - register_cipher (&safer_k128_desc); - register_cipher (&safer_sk128_desc); -#endif -#ifdef LTC_RC2 - register_cipher (&rc2_desc); -#endif -#ifdef LTC_DES - register_cipher (&des_desc); - register_cipher (&des3_desc); -#endif -#ifdef LTC_CAST5 - register_cipher (&cast5_desc); -#endif -#ifdef LTC_NOEKEON - register_cipher (&noekeon_desc); -#endif -#ifdef LTC_SKIPJACK - register_cipher (&skipjack_desc); -#endif -#ifdef LTC_KHAZAD - register_cipher (&khazad_desc); -#endif -#ifdef LTC_ANUBIS - register_cipher (&anubis_desc); -#endif - - if (register_hash(&sha256_desc) == -1) { - printf("Error registering LTC_SHA256\n"); - exit(-1); - } - - if (register_prng(&yarrow_desc) == -1) { - printf("Error registering yarrow PRNG\n"); - exit(-1); - } - - if (register_prng(&sprng_desc) == -1) { - printf("Error registering sprng PRNG\n"); - exit(-1); - } -} - int main(int argc, char *argv[]) { unsigned char plaintext[512],ciphertext[512]; diff --git a/demos/test.c b/demos/test.c index 3474f7e07..bdb649628 100644 --- a/demos/test.c +++ b/demos/test.c @@ -39,7 +39,7 @@ int main(int argc, char **argv) char *single_test = NULL; ulong64 ts; long delta, dur = 0; - reg_algs(); + register_algs(); printf("build == %s\n%s\n", GIT_VERSION, crypt_build_settings); diff --git a/demos/timing.c b/demos/timing.c index 76fd8cd11..5cc23fcd1 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -4,7 +4,7 @@ int main(void) { init_timer(); -reg_algs(); +register_algs(); #ifdef USE_LTM ltc_mp = ltm_desc; diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 5acb28b05..f2543d4c2 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -1,150 +1,6 @@ #include -void reg_algs(void) -{ - int err; - LTC_UNUSED_PARAM(err); - -#ifdef LTC_RIJNDAEL - register_cipher (&aes_desc); -#endif -#ifdef LTC_BLOWFISH - register_cipher (&blowfish_desc); -#endif -#ifdef LTC_XTEA - register_cipher (&xtea_desc); -#endif -#ifdef LTC_RC5 - register_cipher (&rc5_desc); -#endif -#ifdef LTC_RC6 - register_cipher (&rc6_desc); -#endif -#ifdef LTC_SAFERP - register_cipher (&saferp_desc); -#endif -#ifdef LTC_TWOFISH - register_cipher (&twofish_desc); -#endif -#ifdef LTC_SAFER - register_cipher (&safer_k64_desc); - register_cipher (&safer_sk64_desc); - register_cipher (&safer_k128_desc); - register_cipher (&safer_sk128_desc); -#endif -#ifdef LTC_RC2 - register_cipher (&rc2_desc); -#endif -#ifdef LTC_DES - register_cipher (&des_desc); - register_cipher (&des3_desc); -#endif -#ifdef LTC_CAST5 - register_cipher (&cast5_desc); -#endif -#ifdef LTC_NOEKEON - register_cipher (&noekeon_desc); -#endif -#ifdef LTC_SKIPJACK - register_cipher (&skipjack_desc); -#endif -#ifdef LTC_ANUBIS - register_cipher (&anubis_desc); -#endif -#ifdef LTC_KHAZAD - register_cipher (&khazad_desc); -#endif -#ifdef LTC_CAMELLIA - register_cipher (&camellia_desc); -#endif - -#ifdef LTC_TIGER - register_hash (&tiger_desc); -#endif -#ifdef LTC_MD2 - register_hash (&md2_desc); -#endif -#ifdef LTC_MD4 - register_hash (&md4_desc); -#endif -#ifdef LTC_MD5 - register_hash (&md5_desc); -#endif -#ifdef LTC_SHA1 - register_hash (&sha1_desc); -#endif -#ifdef LTC_SHA224 - register_hash (&sha224_desc); -#endif -#ifdef LTC_SHA256 - register_hash (&sha256_desc); -#endif -#ifdef LTC_SHA384 - register_hash (&sha384_desc); -#endif -#ifdef LTC_SHA512 - register_hash (&sha512_desc); -#endif -#ifdef LTC_SHA512_224 - register_hash (&sha512_224_desc); -#endif -#ifdef LTC_SHA512_256 - register_hash (&sha512_256_desc); -#endif -#ifdef LTC_SHA3 - register_hash (&sha3_224_desc); - register_hash (&sha3_256_desc); - register_hash (&sha3_384_desc); - register_hash (&sha3_512_desc); -#endif -#ifdef LTC_RIPEMD128 - register_hash (&rmd128_desc); -#endif -#ifdef LTC_RIPEMD160 - register_hash (&rmd160_desc); -#endif -#ifdef LTC_RIPEMD256 - register_hash (&rmd256_desc); -#endif -#ifdef LTC_RIPEMD320 - register_hash (&rmd320_desc); -#endif -#ifdef LTC_WHIRLPOOL - register_hash (&whirlpool_desc); -#endif -#ifdef LTC_BLAKE2S - register_hash (&blake2s_128_desc); - register_hash (&blake2s_160_desc); - register_hash (&blake2s_224_desc); - register_hash (&blake2s_256_desc); -#endif -#ifdef LTC_BLAKE2B - register_hash (&blake2b_160_desc); - register_hash (&blake2b_256_desc); - register_hash (&blake2b_384_desc); - register_hash (&blake2b_512_desc); -#endif -#ifdef LTC_CHC_HASH - register_hash(&chc_desc); - if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) { - printf("chc_register error: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } -#endif - -#ifdef USE_LTM - ltc_mp = ltm_desc; -#elif defined(USE_TFM) - ltc_mp = tfm_desc; -#elif defined(USE_GMP) - ltc_mp = gmp_desc; -#else - extern ltc_math_descriptor EXT_MATH_LIB; - ltc_mp = EXT_MATH_LIB; -#endif - - -} +#include "common.h" void hash_gen(void) { @@ -880,7 +736,7 @@ void lrw_gen(void) int main(void) { - reg_algs(); + register_algs(); printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n"); printf("Generating cipher vectors..."); fflush(stdout); cipher_gen(); printf("done\n"); printf("Generating HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n"); diff --git a/helper.pl b/helper.pl index 812695433..9ef0f9a2b 100755 --- a/helper.pl +++ b/helper.pl @@ -91,7 +91,7 @@ sub check_hashes { } my $fails = 0; for my $d (@descriptors) { - for my $f (qw{ demos/tv_gen.c demos/hashsum.c testprof/x86_prof.c }) { + for my $f (qw{ testprof/common.c }) { my $txt = read_file($f); warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/; } @@ -234,7 +234,7 @@ sub process_makefiles { my @all = (); find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src'); my @t = qw(); - find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(no_prng|test_driver|x86_prof|_tests?).c$/ } }, 'testprof'); + find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|test_driver|x86_prof|_tests?).c$/ } }, 'testprof'); my @o = sort ('src/ciphers/aes/aes_enc.o', map { my $x = $_; $x =~ s/\.c$/.o/; $x } @c); my $var_o = prepare_variable("OBJECTS", @o); diff --git a/testprof/common.c b/testprof/common.c new file mode 100644 index 000000000..b455d8d1f --- /dev/null +++ b/testprof/common.c @@ -0,0 +1,435 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "common.h" + +/** + @file common.c + + Steffen Jaeckel +*/ + + +void print_hex(const char* what, const void* v, const unsigned long l) +{ + const unsigned char* p = v; + unsigned long x, y = 0, z; + fprintf(stderr, "%s contents: \n", what); + for (x = 0; x < l; ) { + fprintf(stderr, "%02X ", p[x]); + if (!(++x % 16) || x == l) { + if((x % 16) != 0) { + z = 16 - (x % 16); + if(z >= 8) + fprintf(stderr, " "); + for (; z != 0; --z) { + fprintf(stderr, " "); + } + } + fprintf(stderr, " | "); + for(; y < x; y++) { + if((y % 8) == 0) + fprintf(stderr, " "); + if(isgraph(p[y])) + fprintf(stderr, "%c", p[y]); + else + fprintf(stderr, "."); + } + fprintf(stderr, "\n"); + } + else if((x % 8) == 0) { + fprintf(stderr, " "); + } + } +} + +#ifndef compare_testvector +int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) +{ + int res = 0; + if(is_len != should_len) + res = is_len > should_len ? -1 : 1; + else + res = XMEMCMP(is, should, MAX(is_len, should_len)); + + if (res != 0) { + fprintf(stderr, "Testvector #%i of %s failed:\n", which, what); + print_hex("SHOULD", should, should_len); + print_hex("IS ", is, is_len); + } + + return res; +} +#endif + +prng_state yarrow_prng; + +/* + * unregister ciphers, hashes & prngs + */ +static void _unregister_all(void) +{ +#ifdef LTC_RIJNDAEL + unregister_cipher(&aes_desc); +#endif +#ifdef LTC_BLOWFISH + unregister_cipher(&blowfish_desc); +#endif +#ifdef LTC_XTEA + unregister_cipher(&xtea_desc); +#endif +#ifdef LTC_RC5 + unregister_cipher(&rc5_desc); +#endif +#ifdef LTC_RC6 + unregister_cipher(&rc6_desc); +#endif +#ifdef LTC_SAFERP + unregister_cipher(&saferp_desc); +#endif +#ifdef LTC_TWOFISH + unregister_cipher(&twofish_desc); +#endif +#ifdef LTC_SAFER + unregister_cipher(&safer_k64_desc); + unregister_cipher(&safer_sk64_desc); + unregister_cipher(&safer_k128_desc); + unregister_cipher(&safer_sk128_desc); +#endif +#ifdef LTC_RC2 + unregister_cipher(&rc2_desc); +#endif +#ifdef LTC_DES + unregister_cipher(&des_desc); + unregister_cipher(&des3_desc); +#endif +#ifdef LTC_CAST5 + unregister_cipher(&cast5_desc); +#endif +#ifdef LTC_NOEKEON + unregister_cipher(&noekeon_desc); +#endif +#ifdef LTC_SKIPJACK + unregister_cipher(&skipjack_desc); +#endif +#ifdef LTC_KHAZAD + unregister_cipher(&khazad_desc); +#endif +#ifdef LTC_ANUBIS + unregister_cipher(&anubis_desc); +#endif +#ifdef LTC_KSEED + unregister_cipher(&kseed_desc); +#endif +#ifdef LTC_KASUMI + unregister_cipher(&kasumi_desc); +#endif +#ifdef LTC_MULTI2 + unregister_cipher(&multi2_desc); +#endif +#ifdef LTC_CAMELLIA + unregister_cipher(&camellia_desc); +#endif + +#ifdef LTC_TIGER + unregister_hash(&tiger_desc); +#endif +#ifdef LTC_MD2 + unregister_hash(&md2_desc); +#endif +#ifdef LTC_MD4 + unregister_hash(&md4_desc); +#endif +#ifdef LTC_MD5 + unregister_hash(&md5_desc); +#endif +#ifdef LTC_SHA1 + unregister_hash(&sha1_desc); +#endif +#ifdef LTC_SHA224 + unregister_hash(&sha224_desc); +#endif +#ifdef LTC_SHA256 + unregister_hash(&sha256_desc); +#endif +#ifdef LTC_SHA384 + unregister_hash(&sha384_desc); +#endif +#ifdef LTC_SHA512 + unregister_hash(&sha512_desc); +#endif +#ifdef LTC_SHA512_224 + unregister_hash(&sha512_224_desc); +#endif +#ifdef LTC_SHA512_256 + unregister_hash(&sha512_256_desc); +#endif +#ifdef LTC_SHA3 + unregister_hash(&sha3_224_desc); + unregister_hash(&sha3_256_desc); + unregister_hash(&sha3_384_desc); + unregister_hash(&sha3_512_desc); +#endif +#ifdef LTC_RIPEMD128 + unregister_hash(&rmd128_desc); +#endif +#ifdef LTC_RIPEMD160 + unregister_hash(&rmd160_desc); +#endif +#ifdef LTC_RIPEMD256 + unregister_hash(&rmd256_desc); +#endif +#ifdef LTC_RIPEMD320 + unregister_hash(&rmd320_desc); +#endif +#ifdef LTC_WHIRLPOOL + unregister_hash(&whirlpool_desc); +#endif +#ifdef LTC_BLAKE2S + unregister_hash(&blake2s_128_desc); + unregister_hash(&blake2s_160_desc); + unregister_hash(&blake2s_224_desc); + unregister_hash(&blake2s_256_desc); +#endif +#ifdef LTC_BLAKE2B + unregister_hash(&blake2b_160_desc); + unregister_hash(&blake2b_256_desc); + unregister_hash(&blake2b_384_desc); + unregister_hash(&blake2b_512_desc); +#endif +#ifdef LTC_CHC_HASH + unregister_hash(&chc_desc); +#endif + + unregister_prng(&yarrow_desc); +#ifdef LTC_FORTUNA + unregister_prng(&fortuna_desc); +#endif +#ifdef LTC_RC4 + unregister_prng(&rc4_desc); +#endif +#ifdef LTC_CHACHA20_PRNG + unregister_prng(&chacha20_prng_desc); +#endif +#ifdef LTC_SOBER128 + unregister_prng(&sober128_desc); +#endif +} /* _cleanup() */ + +#ifdef LTC_PRNG_ENABLE_LTC_RNG + +static unsigned long my_test_rng_read; + +static unsigned long my_test_rng(unsigned char *buf, unsigned long len, + void (*callback)(void)) +{ + unsigned long n; + LTC_UNUSED_PARAM(callback); + for (n = 0; n < len; ++n) { + buf[n] = 4; + } + my_test_rng_read += n; + return n; +} + +#endif + +void register_algs(void) +{ +#ifdef LTC_PRNG_ENABLE_LTC_RNG + unsigned long before; +#endif + int err; + + atexit(_unregister_all); + +#ifdef LTC_RIJNDAEL + register_cipher (&aes_desc); +#endif +#ifdef LTC_BLOWFISH + register_cipher (&blowfish_desc); +#endif +#ifdef LTC_XTEA + register_cipher (&xtea_desc); +#endif +#ifdef LTC_RC5 + register_cipher (&rc5_desc); +#endif +#ifdef LTC_RC6 + register_cipher (&rc6_desc); +#endif +#ifdef LTC_SAFERP + register_cipher (&saferp_desc); +#endif +#ifdef LTC_TWOFISH + register_cipher (&twofish_desc); +#endif +#ifdef LTC_SAFER + register_cipher (&safer_k64_desc); + register_cipher (&safer_sk64_desc); + register_cipher (&safer_k128_desc); + register_cipher (&safer_sk128_desc); +#endif +#ifdef LTC_RC2 + register_cipher (&rc2_desc); +#endif +#ifdef LTC_DES + register_cipher (&des_desc); + register_cipher (&des3_desc); +#endif +#ifdef LTC_CAST5 + register_cipher (&cast5_desc); +#endif +#ifdef LTC_NOEKEON + register_cipher (&noekeon_desc); +#endif +#ifdef LTC_SKIPJACK + register_cipher (&skipjack_desc); +#endif +#ifdef LTC_KHAZAD + register_cipher (&khazad_desc); +#endif +#ifdef LTC_ANUBIS + register_cipher (&anubis_desc); +#endif +#ifdef LTC_KSEED + register_cipher (&kseed_desc); +#endif +#ifdef LTC_KASUMI + register_cipher (&kasumi_desc); +#endif +#ifdef LTC_MULTI2 + register_cipher (&multi2_desc); +#endif +#ifdef LTC_CAMELLIA + register_cipher (&camellia_desc); +#endif + +#ifdef LTC_TIGER + register_hash (&tiger_desc); +#endif +#ifdef LTC_MD2 + register_hash (&md2_desc); +#endif +#ifdef LTC_MD4 + register_hash (&md4_desc); +#endif +#ifdef LTC_MD5 + register_hash (&md5_desc); +#endif +#ifdef LTC_SHA1 + register_hash (&sha1_desc); +#endif +#ifdef LTC_SHA224 + register_hash (&sha224_desc); +#endif +#ifdef LTC_SHA256 + register_hash (&sha256_desc); +#endif +#ifdef LTC_SHA384 + register_hash (&sha384_desc); +#endif +#ifdef LTC_SHA512 + register_hash (&sha512_desc); +#endif +#ifdef LTC_SHA512_224 + register_hash (&sha512_224_desc); +#endif +#ifdef LTC_SHA512_256 + register_hash (&sha512_256_desc); +#endif +#ifdef LTC_SHA3 + register_hash (&sha3_224_desc); + register_hash (&sha3_256_desc); + register_hash (&sha3_384_desc); + register_hash (&sha3_512_desc); +#endif +#ifdef LTC_RIPEMD128 + register_hash (&rmd128_desc); +#endif +#ifdef LTC_RIPEMD160 + register_hash (&rmd160_desc); +#endif +#ifdef LTC_RIPEMD256 + register_hash (&rmd256_desc); +#endif +#ifdef LTC_RIPEMD320 + register_hash (&rmd320_desc); +#endif +#ifdef LTC_WHIRLPOOL + register_hash (&whirlpool_desc); +#endif +#ifdef LTC_BLAKE2S + register_hash(&blake2s_128_desc); + register_hash(&blake2s_160_desc); + register_hash(&blake2s_224_desc); + register_hash(&blake2s_256_desc); +#endif +#ifdef LTC_BLAKE2S + register_hash(&blake2b_160_desc); + register_hash(&blake2b_256_desc); + register_hash(&blake2b_384_desc); + register_hash(&blake2b_512_desc); +#endif +#ifdef LTC_CHC_HASH + register_hash(&chc_desc); + if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) { + fprintf(stderr, "chc_register error: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } +#endif + + +#ifndef LTC_YARROW + #error This demo requires Yarrow. +#endif +register_prng(&yarrow_desc); +#ifdef LTC_FORTUNA +register_prng(&fortuna_desc); +#endif +#ifdef LTC_RC4 +register_prng(&rc4_desc); +#endif +#ifdef LTC_CHACHA20_PRNG +register_prng(&chacha20_prng_desc); +#endif +#ifdef LTC_SOBER128 +register_prng(&sober128_desc); +#endif +#ifdef LTC_SPRNG +register_prng(&sprng_desc); +#endif + +#ifdef LTC_PRNG_ENABLE_LTC_RNG + ltc_rng = my_test_rng; + + before = my_test_rng_read; + if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { + fprintf(stderr, "rng_make_prng with 'my_test_rng' failed: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + + if (before == my_test_rng_read) { + fprintf(stderr, "somehow there was no read from the ltc_rng! %lu == %lu\n", before, my_test_rng_read); + exit(EXIT_FAILURE); + } + + ltc_rng = NULL; +#endif + + if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { + fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + + if (strcmp("CRYPT_OK", error_to_string(err))) { + exit(EXIT_FAILURE); + } + +} diff --git a/testprof/common.h b/testprof/common.h new file mode 100644 index 000000000..6aef48210 --- /dev/null +++ b/testprof/common.h @@ -0,0 +1,15 @@ +#ifndef DEMOS_COMMON_H_ +#define DEMOS_COMMON_H_ + +#include + +extern prng_state yarrow_prng; + +void print_hex(const char* what, const void* v, const unsigned long l); +#ifndef compare_testvector +int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); +#endif + +void register_algs(void); + +#endif /* DEMOS_COMMON_H_ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 48c6c07cc..04fad826a 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -4,6 +4,8 @@ #include +#include "common.h" + #ifdef USE_LTM /* Use libtommath as MPI provider */ #elif defined(USE_TFM) @@ -23,19 +25,11 @@ #endif #endif -/* enable stack testing */ -/* #define STACK_TEST */ - -/* stack testing, define this if stack usage goes downwards [e.g. x86] */ -#define STACK_DOWN - typedef struct { char *name, *prov, *req; int (*entry)(void); } test_entry; -extern prng_state yarrow_prng; - void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); #ifdef LTC_VERBOSE @@ -83,10 +77,6 @@ extern int no_results; extern const struct ltc_prng_descriptor no_prng_desc; #endif -void print_hex(const char* what, const void* v, const unsigned long l); -#ifndef compare_testvector -int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); -#endif int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); @@ -97,7 +87,6 @@ ulong64 t_read(void); void init_timer(void); /* register default algs */ -void reg_algs(void); int time_keysched(void); int time_cipher(void); int time_cipher2(void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 4ada14f39..240fb917c 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -30,60 +30,6 @@ ulong64 epoch_usec(void) #endif } -prng_state yarrow_prng; - -void print_hex(const char* what, const void* v, const unsigned long l) -{ - const unsigned char* p = v; - unsigned long x, y = 0, z; - fprintf(stderr, "%s contents: \n", what); - for (x = 0; x < l; ) { - fprintf(stderr, "%02X ", p[x]); - if (!(++x % 16) || x == l) { - if((x % 16) != 0) { - z = 16 - (x % 16); - if(z >= 8) - fprintf(stderr, " "); - for (; z != 0; --z) { - fprintf(stderr, " "); - } - } - fprintf(stderr, " | "); - for(; y < x; y++) { - if((y % 8) == 0) - fprintf(stderr, " "); - if(isgraph(p[y])) - fprintf(stderr, "%c", p[y]); - else - fprintf(stderr, "."); - } - fprintf(stderr, "\n"); - } - else if((x % 8) == 0) { - fprintf(stderr, " "); - } - } -} - -#ifndef compare_testvector -int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) -{ - int res = 0; - if(is_len != should_len) - res = is_len > should_len ? -1 : 1; - else - res = XMEMCMP(is, should, MAX(is_len, should_len)); - - if (res != 0) { - fprintf(stderr, "Testvector #%i of %s failed:\n", which, what); - print_hex("SHOULD", should, should_len); - print_hex("IS ", is, is_len); - } - - return res; -} -#endif - struct list results[100]; int no_results; int sorter(const void *a, const void *b) @@ -201,370 +147,6 @@ void init_timer(void) fprintf(stderr, "Clock Skew: %lu\n", (unsigned long)skew); } -/* - * unregister ciphers, hashes & prngs - */ -static void _unregister_all(void) -{ -#ifdef LTC_RIJNDAEL - unregister_cipher(&aes_desc); -#endif -#ifdef LTC_BLOWFISH - unregister_cipher(&blowfish_desc); -#endif -#ifdef LTC_XTEA - unregister_cipher(&xtea_desc); -#endif -#ifdef LTC_RC5 - unregister_cipher(&rc5_desc); -#endif -#ifdef LTC_RC6 - unregister_cipher(&rc6_desc); -#endif -#ifdef LTC_SAFERP - unregister_cipher(&saferp_desc); -#endif -#ifdef LTC_TWOFISH - unregister_cipher(&twofish_desc); -#endif -#ifdef LTC_SAFER - unregister_cipher(&safer_k64_desc); - unregister_cipher(&safer_sk64_desc); - unregister_cipher(&safer_k128_desc); - unregister_cipher(&safer_sk128_desc); -#endif -#ifdef LTC_RC2 - unregister_cipher(&rc2_desc); -#endif -#ifdef LTC_DES - unregister_cipher(&des_desc); - unregister_cipher(&des3_desc); -#endif -#ifdef LTC_CAST5 - unregister_cipher(&cast5_desc); -#endif -#ifdef LTC_NOEKEON - unregister_cipher(&noekeon_desc); -#endif -#ifdef LTC_SKIPJACK - unregister_cipher(&skipjack_desc); -#endif -#ifdef LTC_KHAZAD - unregister_cipher(&khazad_desc); -#endif -#ifdef LTC_ANUBIS - unregister_cipher(&anubis_desc); -#endif -#ifdef LTC_KSEED - unregister_cipher(&kseed_desc); -#endif -#ifdef LTC_KASUMI - unregister_cipher(&kasumi_desc); -#endif -#ifdef LTC_MULTI2 - unregister_cipher(&multi2_desc); -#endif -#ifdef LTC_CAMELLIA - unregister_cipher(&camellia_desc); -#endif - -#ifdef LTC_TIGER - unregister_hash(&tiger_desc); -#endif -#ifdef LTC_MD2 - unregister_hash(&md2_desc); -#endif -#ifdef LTC_MD4 - unregister_hash(&md4_desc); -#endif -#ifdef LTC_MD5 - unregister_hash(&md5_desc); -#endif -#ifdef LTC_SHA1 - unregister_hash(&sha1_desc); -#endif -#ifdef LTC_SHA224 - unregister_hash(&sha224_desc); -#endif -#ifdef LTC_SHA256 - unregister_hash(&sha256_desc); -#endif -#ifdef LTC_SHA384 - unregister_hash(&sha384_desc); -#endif -#ifdef LTC_SHA512 - unregister_hash(&sha512_desc); -#endif -#ifdef LTC_SHA512_224 - unregister_hash(&sha512_224_desc); -#endif -#ifdef LTC_SHA512_256 - unregister_hash(&sha512_256_desc); -#endif -#ifdef LTC_SHA3 - unregister_hash(&sha3_224_desc); - unregister_hash(&sha3_256_desc); - unregister_hash(&sha3_384_desc); - unregister_hash(&sha3_512_desc); -#endif -#ifdef LTC_RIPEMD128 - unregister_hash(&rmd128_desc); -#endif -#ifdef LTC_RIPEMD160 - unregister_hash(&rmd160_desc); -#endif -#ifdef LTC_RIPEMD256 - unregister_hash(&rmd256_desc); -#endif -#ifdef LTC_RIPEMD320 - unregister_hash(&rmd320_desc); -#endif -#ifdef LTC_WHIRLPOOL - unregister_hash(&whirlpool_desc); -#endif -#ifdef LTC_BLAKE2S - unregister_hash(&blake2s_128_desc); - unregister_hash(&blake2s_160_desc); - unregister_hash(&blake2s_224_desc); - unregister_hash(&blake2s_256_desc); -#endif -#ifdef LTC_BLAKE2B - unregister_hash(&blake2b_160_desc); - unregister_hash(&blake2b_256_desc); - unregister_hash(&blake2b_384_desc); - unregister_hash(&blake2b_512_desc); -#endif -#ifdef LTC_CHC_HASH - unregister_hash(&chc_desc); -#endif - - unregister_prng(&yarrow_desc); -#ifdef LTC_FORTUNA - unregister_prng(&fortuna_desc); -#endif -#ifdef LTC_RC4 - unregister_prng(&rc4_desc); -#endif -#ifdef LTC_CHACHA20_PRNG - unregister_prng(&chacha20_prng_desc); -#endif -#ifdef LTC_SOBER128 - unregister_prng(&sober128_desc); -#endif -} /* _cleanup() */ - -#ifdef LTC_PRNG_ENABLE_LTC_RNG - -static unsigned long my_test_rng_read; - -static unsigned long my_test_rng(unsigned char *buf, unsigned long len, - void (*callback)(void)) -{ - unsigned long n; - LTC_UNUSED_PARAM(callback); - for (n = 0; n < len; ++n) { - buf[n] = 4; - } - my_test_rng_read += n; - return n; -} - -#endif - -void reg_algs(void) -{ -#ifdef LTC_PRNG_ENABLE_LTC_RNG - unsigned long before; -#endif - int err; - - atexit(_unregister_all); - -#ifdef LTC_RIJNDAEL - register_cipher (&aes_desc); -#endif -#ifdef LTC_BLOWFISH - register_cipher (&blowfish_desc); -#endif -#ifdef LTC_XTEA - register_cipher (&xtea_desc); -#endif -#ifdef LTC_RC5 - register_cipher (&rc5_desc); -#endif -#ifdef LTC_RC6 - register_cipher (&rc6_desc); -#endif -#ifdef LTC_SAFERP - register_cipher (&saferp_desc); -#endif -#ifdef LTC_TWOFISH - register_cipher (&twofish_desc); -#endif -#ifdef LTC_SAFER - register_cipher (&safer_k64_desc); - register_cipher (&safer_sk64_desc); - register_cipher (&safer_k128_desc); - register_cipher (&safer_sk128_desc); -#endif -#ifdef LTC_RC2 - register_cipher (&rc2_desc); -#endif -#ifdef LTC_DES - register_cipher (&des_desc); - register_cipher (&des3_desc); -#endif -#ifdef LTC_CAST5 - register_cipher (&cast5_desc); -#endif -#ifdef LTC_NOEKEON - register_cipher (&noekeon_desc); -#endif -#ifdef LTC_SKIPJACK - register_cipher (&skipjack_desc); -#endif -#ifdef LTC_KHAZAD - register_cipher (&khazad_desc); -#endif -#ifdef LTC_ANUBIS - register_cipher (&anubis_desc); -#endif -#ifdef LTC_KSEED - register_cipher (&kseed_desc); -#endif -#ifdef LTC_KASUMI - register_cipher (&kasumi_desc); -#endif -#ifdef LTC_MULTI2 - register_cipher (&multi2_desc); -#endif -#ifdef LTC_CAMELLIA - register_cipher (&camellia_desc); -#endif - -#ifdef LTC_TIGER - register_hash (&tiger_desc); -#endif -#ifdef LTC_MD2 - register_hash (&md2_desc); -#endif -#ifdef LTC_MD4 - register_hash (&md4_desc); -#endif -#ifdef LTC_MD5 - register_hash (&md5_desc); -#endif -#ifdef LTC_SHA1 - register_hash (&sha1_desc); -#endif -#ifdef LTC_SHA224 - register_hash (&sha224_desc); -#endif -#ifdef LTC_SHA256 - register_hash (&sha256_desc); -#endif -#ifdef LTC_SHA384 - register_hash (&sha384_desc); -#endif -#ifdef LTC_SHA512 - register_hash (&sha512_desc); -#endif -#ifdef LTC_SHA512_224 - register_hash (&sha512_224_desc); -#endif -#ifdef LTC_SHA512_256 - register_hash (&sha512_256_desc); -#endif -#ifdef LTC_SHA3 - register_hash (&sha3_224_desc); - register_hash (&sha3_256_desc); - register_hash (&sha3_384_desc); - register_hash (&sha3_512_desc); -#endif -#ifdef LTC_RIPEMD128 - register_hash (&rmd128_desc); -#endif -#ifdef LTC_RIPEMD160 - register_hash (&rmd160_desc); -#endif -#ifdef LTC_RIPEMD256 - register_hash (&rmd256_desc); -#endif -#ifdef LTC_RIPEMD320 - register_hash (&rmd320_desc); -#endif -#ifdef LTC_WHIRLPOOL - register_hash (&whirlpool_desc); -#endif -#ifdef LTC_BLAKE2S - register_hash(&blake2s_128_desc); - register_hash(&blake2s_160_desc); - register_hash(&blake2s_224_desc); - register_hash(&blake2s_256_desc); -#endif -#ifdef LTC_BLAKE2S - register_hash(&blake2b_160_desc); - register_hash(&blake2b_256_desc); - register_hash(&blake2b_384_desc); - register_hash(&blake2b_512_desc); -#endif -#ifdef LTC_CHC_HASH - register_hash(&chc_desc); - if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) { - fprintf(stderr, "chc_register error: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } -#endif - - -#ifndef LTC_YARROW - #error This demo requires Yarrow. -#endif -register_prng(&yarrow_desc); -#ifdef LTC_FORTUNA -register_prng(&fortuna_desc); -#endif -#ifdef LTC_RC4 -register_prng(&rc4_desc); -#endif -#ifdef LTC_CHACHA20_PRNG -register_prng(&chacha20_prng_desc); -#endif -#ifdef LTC_SOBER128 -register_prng(&sober128_desc); -#endif -#ifdef LTC_SPRNG -register_prng(&sprng_desc); -#endif - -#ifdef LTC_PRNG_ENABLE_LTC_RNG - ltc_rng = my_test_rng; - - before = my_test_rng_read; - if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { - fprintf(stderr, "rng_make_prng with 'my_test_rng' failed: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - - if (before == my_test_rng_read) { - fprintf(stderr, "somehow there was no read from the ltc_rng! %lu == %lu\n", before, my_test_rng_read); - exit(EXIT_FAILURE); - } - - ltc_rng = NULL; -#endif - - if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { - fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - - if (strcmp("CRYPT_OK", error_to_string(err))) { - exit(EXIT_FAILURE); - } - -} - int time_keysched(void) { unsigned long x, y1; From eaf20dda5b3c4b98748dc5fe90514f10340fd0ac Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 5 May 2017 15:39:39 +0200 Subject: [PATCH 0782/1192] demos must now link against testprof/common.o --- makefile | 4 ++-- makefile.mingw | 8 ++++---- makefile.shared | 2 +- makefile.unix | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index aa569a423..6bb734260 100644 --- a/makefile +++ b/makefile @@ -85,11 +85,11 @@ endif # build the demos from a template define DEMO_template -$(1): demos/$(1).o $$(LIBNAME) +$(1): demos/$(1).o $$(LIBNAME) testprof/common.o ifneq ($V,1) @echo " * $${CC} $$@" endif - $${silent} $$(CC) $$(CFLAGS) $$< $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) + $${silent} $$(CC) $$(CFLAGS) $$< testprof/common.o $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) diff --git a/makefile.mingw b/makefile.mingw index 5b1cbc274..644815eb7 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -241,13 +241,13 @@ $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) $(STRIP) -S $(LIBMAIN_D) #Demo tools/utilities -hashsum.exe: demos/hashsum.o $(LIBMAIN_S) +hashsum: demos/hashsum.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -ltcrypt.exe: demos/ltcrypt.o $(LIBMAIN_S) +crypt: demos/crypt.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -small.exe: demos/small.o $(LIBMAIN_S) +small: demos/small.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -tv_gen.exe: demos/tv_gen.o $(LIBMAIN_S) +tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ #Tests + timing tests diff --git a/makefile.shared b/makefile.shared index c6086985c..e0eb1139a 100644 --- a/makefile.shared +++ b/makefile.shared @@ -59,7 +59,7 @@ timing: $(LIBNAME) $(LIBTEST) $(TIMINGS) # build the demos from a template define DEMO_template -$(1): demos/$(1).o $$(LIBNAME) +$(1): demos/$(1).o testprof/common.o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif diff --git a/makefile.unix b/makefile.unix index b93315cd7..0074be1d1 100644 --- a/makefile.unix +++ b/makefile.unix @@ -243,13 +243,13 @@ $(LIBMAIN_S): $(OBJECTS) $(RANLIB) $@ #Demo tools/utilities -hashsum: demos/hashsum.o $(LIBMAIN_S) +hashsum: demos/hashsum.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -ltcrypt: demos/ltcrypt.o $(LIBMAIN_S) +ltcrypt: demos/ltcrypt.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -small: demos/small.o $(LIBMAIN_S) +small: demos/small.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -tv_gen: demos/tv_gen.o $(LIBMAIN_S) +tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ #Tests + timing tests From 3f66f7df83459f849df0bae861792b82dd0afbf1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 9 May 2017 16:27:41 +0200 Subject: [PATCH 0783/1192] Update makefiles --- makefile.mingw | 6 +++--- makefile.msvc | 6 +++--- makefile.unix | 6 +++--- makefile_include.mk | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 644815eb7..a98876432 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -188,9 +188,9 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o #List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ -testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ -testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \ +testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \ +testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o diff --git a/makefile.msvc b/makefile.msvc index 2c434afb9..2d169f203 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -181,9 +181,9 @@ src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128. src/stream/sober128/sober128_test.obj #List of test objects to compile (all goes to tomcrypt_prof.lib) -TOBJECTS=testprof/base64_test.obj testprof/cipher_hash_test.obj testprof/der_tests.obj testprof/dh_test.obj \ -testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_test.obj testprof/katja_test.obj testprof/mac_test.obj \ -testprof/misc_test.obj testprof/modes_test.obj testprof/multi_test.obj testprof/no_prng.obj \ +TOBJECTS=testprof/base64_test.obj testprof/cipher_hash_test.obj testprof/common.obj testprof/der_tests.obj \ +testprof/dh_test.obj testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_test.obj testprof/katja_test.obj \ +testprof/mac_test.obj testprof/misc_test.obj testprof/modes_test.obj testprof/multi_test.obj testprof/no_prng.obj \ testprof/pkcs_1_eme_test.obj testprof/pkcs_1_emsa_test.obj testprof/pkcs_1_oaep_test.obj \ testprof/pkcs_1_pss_test.obj testprof/pkcs_1_test.obj testprof/rotate_test.obj testprof/rsa_test.obj \ testprof/store_test.obj testprof/test_driver.obj testprof/x86_prof.obj diff --git a/makefile.unix b/makefile.unix index 0074be1d1..5d5345b79 100644 --- a/makefile.unix +++ b/makefile.unix @@ -193,9 +193,9 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o #List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ -testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ -testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \ +testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \ +testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o diff --git a/makefile_include.mk b/makefile_include.mk index d493d0ef6..9cd5bbd19 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -291,9 +291,9 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o # List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/der_tests.o testprof/dh_test.o \ -testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o testprof/mac_test.o \ -testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ +TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \ +testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \ +testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o From 1c4c84e7f9c33b7170b804c325a5bc0d74effd43 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 12 May 2017 16:17:27 +0200 Subject: [PATCH 0784/1192] fix tv_gen --- demos/tv_gen.c | 2 + notes/ccm_tv.txt | 35 ++++++++++ notes/cipher_tv.txt | 162 ++++++++++++++++++++++++++++++++++++++++++++ notes/eax_tv.txt | 73 ++++++++++++++++++++ notes/gcm_tv.txt | 35 ++++++++++ notes/ocb3_tv.txt | 73 ++++++++++++++++++++ notes/ocb_tv.txt | 73 ++++++++++++++++++++ notes/omac_tv.txt | 73 ++++++++++++++++++++ notes/pmac_tv.txt | 73 ++++++++++++++++++++ testprof/common.c | 23 ++++++- testprof/common.h | 1 + 11 files changed, 620 insertions(+), 3 deletions(-) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index f2543d4c2..5cb61f18a 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -737,6 +737,8 @@ void lrw_gen(void) int main(void) { register_algs(); + setup_math(); + printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n"); printf("Generating cipher vectors..."); fflush(stdout); cipher_gen(); printf("done\n"); printf("Generating HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n"); diff --git a/notes/ccm_tv.txt b/notes/ccm_tv.txt index aa8f9e6de..40cb2f19e 100644 --- a/notes/ccm_tv.txt +++ b/notes/ccm_tv.txt @@ -212,6 +212,41 @@ CCM-anubis (16 byte key) 31: B8176469E6A0D5797ED6421A871FEECDE48ACF011E394981C43AC917E8FFD5, E9B01383DB1A32E6126BD802A6C6F47E 32: AB6A0AA29B687D05735167D78DB697BA2478BD14ECD059AE9D1239E7F2AB48FD, A560A30FD87CF28BA66F5B2638567E4B +CCM-seed (16 byte key) + 0: , 960414F81DF9F363AE6234067B946EA6 + 1: 15, 17746EC09B06AF1DE24710D2506629CD + 2: 892C, 828705A8CF1E51688EC4F1FFAC4C151A + 3: E411A7, 1AF2DD611D05DAF48118D1E7D810C173 + 4: B9DC8276, 4D335DF8B860AF121904310F5C004212 + 5: 8182C84A25, B713177663D498218908178B3EA3C65E + 6: 5933E7872324, 52413BB22BABEC9E43F1A98B78B4496E + 7: A243E381075DEA, 8FF3D2D465748AAF2373D1D8F8EDCFC3 + 8: 57A4E46B9B5C1795, B26653992639D54D5CEBAC7473CD3285 + 9: 4D05D6669D9A0C3079, 6B26FA6D5271D74D444985466D2CF0AA + 10: 1D35BB653A9F48C3314B, 494E108B0780280DF7CB4BE24CACB5CB + 11: 9A227951B4565021D29DD4, 3E21A07540744E26424996B0670CB07A + 12: 3E893574DD3D82CCD83E87E0, 017D51F744FE95E375D0456FA8BB0EC9 + 13: 5DF04297D842B3CEFCF93F5B95, 49CCE7A12C85648BD2A07944623C81AC + 14: 27F7D25EDE3471AAE1B91BBAEAD0, A6F1DD19DF08160D982184A414247B8B + 15: 6F8583E5B88B15F89070FB7A49383F, 4C98CC3884A2BD20AC6FA5184FB72670 + 16: 5D8D511AE705860B1A55E2FDAE9581D9, 96EF02C285AFD27D2B26BCAC02EC56A0 + 17: C4508E9E03DFE7C3B89192589CFD171A16, A2A4DC81E900BC5C404389BBD0B4710D + 18: 3163AE0E74B3DE3779745A82B783D882F092, A89574F7D1C2B90241A702A2C6A2AD86 + 19: 2D9C64EF9D8C2E195AF05BAE747A7BF8EC6C30, 07EEB7667A539164862E472366FFAD68 + 20: 03D145C9133E9108BB7A61D17880B155A56A58E6, 4F8EBC9A3F3C74EEA02099BB5AE6D456 + 21: 41C20EF2D199B6C0FAD9DA02DA0296D37B23059C3A, 062AE92091F7A8CF74A8E9DAFC58BEDE + 22: 402912121F84EDB82F101195A68EF214F0A8F4DA6DC0, B35C944A4E5BA8AB60A4415B5BDF6E30 + 23: 4D3F14438904F8F4F911CE729B26415F4EF819F80D2254, 2304E0373E136010B9BC6E061660D881 + 24: A855C170C1E2D326D74996939C48A85EDEED2E06F97BE61A, E66F188735CDBD27F6354C260A4796BA + 25: F882B023A3B25B878073DF739A234256E4174238A30A5B5062, 3C8BEBFA98ABF880891AF2539D3A0FCF + 26: C66F850279CD23D5243CF15E6084A17C124DDDE840DFD9532954, 003202A7E393626BFF93D48207E7DE39 + 27: BAC89C099A8AF633EFAFA496198DC9398DB3AAB47A8D24E2FE7D62, 32583F94ADE55278F2533ABE934CD535 + 28: B9EB02F63EFB72455CFFA2799A5BFA9E0BFDE240379AA98B4D0532C8, 5D01FD2F100C003EA284A2AF55EE5934 + 29: BAD5BB6B8DF316401B12B2BF36329F1D977E1FD943F594A6F4ED696194, 3D91CE3618998F3E060038D4DCAAD084 + 30: 8964B7FAC865310E56DB3238E03803F3B79D095523D278D609AD34BA8B67, C57D3AA1FF71636CC7497DF3CB4F7B71 + 31: F83C35D61E5C48CC7C402C9C78758D0DC696D2708FBC5294879DBF700BAF75, C69997844AB43312C90E995AD8C91E58 + 32: 03CA8E42B89C0AEEF0B7A364E94E326C537AFC4392AED3E6DA71EE65032A5CDB, E8DCD9120DE61900A194E8B94AEF6B2B + CCM-camellia (16 byte key) 0: , 3B53D5CC8B26A5FFC78D2E974E45A661 1: 5B, ED7741D8C258D56A29392A7A65CF147D diff --git a/notes/cipher_tv.txt b/notes/cipher_tv.txt index d8ddb2981..604f01c21 100644 --- a/notes/cipher_tv.txt +++ b/notes/cipher_tv.txt @@ -1965,6 +1965,168 @@ Key Size: 16 bytes 49: 0133E1745856C44C +Cipher: seed +Key Size: 16 bytes + 0: A6E8D7325BBE0998CF235C1B57E64360 + 1: 83A2EB0094D1CF95E683DE8BA93DE478 + 2: 3DF178E121DA1CDB77ACFB37F9499A3B + 3: 785A1D88210885D6D2D84C2CB4461D57 + 4: 4F177E4C76F6CA9C989E724A0EC275F4 + 5: 3AC502689139EC1AFA7EDCDB622A6061 + 6: E1B9675AEFFE45A249644E7E0863110D + 7: C8A4294FF821E88EC5D181E54BBD3919 + 8: 7598C35780522C63B531758F53B7CCCE + 9: 3E59799FC5A5F99100A3791F6AA284EA +10: A8572971F5FC281E7617BCB8D616FAD3 +11: 3C5DCA82BA53DAC088D34E6C4D069E22 +12: 0886C2F45E358409230F6FA0F4ADB7BF +13: F4BF0388027AFBADEB6AD1AD0AC9339E +14: 587F60852DA55F76C486D9A6BA884F8A +15: A6F2518AD3B9A68C3FB8847E28B15212 +16: 6B6DB6C7085FEF6FD2BF32CAA2FEC2E2 +17: 40FF5FC134BC3911614A4E021254EFDF +18: 9B1016CD948F70B8A04D2604D4FF08AD +19: FBB86D1B49204838C7D544C8BAAE61F9 +20: 02EDFBE9A9A4CA2206CF9047FF146949 +21: 6B9FF89C1E607E494204B28D4391ED35 +22: BB85B8BAA9A4B74ED66C7485415834A0 +23: A6F72520E6F0248D88AFDBDA7CBDD6FE +24: 4BC1D4E990FC80E9ABF9E0FBC745E2D4 +25: 0358D44D7A59743AAF6D25CA179FB6FE +26: 320924C80B53E406DE45D31AB0E265F3 +27: B727A4AB9E8455EF11B18F300E22ADED +28: DCB6BEF8F35FFA2F2CDADAE161E56D48 +29: 847A39F0670E930BF7899656908C2B92 +30: B5223282B9328ACC4C6BF06F15C920EB +31: C265081FC225CA4ED28FABBF0BBB0298 +32: 35F6113CEA7C15DB21223D5AB0E9E558 +33: 3437EECD2984AADC9F07286CC23FB940 +34: D0C878AC8C01BB9868B499691373988A +35: 684381B5D98E9D1290AF5D633A903F68 +36: 69652249BD52F49ED11219881059ED38 +37: 08DD215881D98B1D8234FA1806E634FF +38: BFA836EB71C35B3E3CC9BFE9168D1B5F +39: 238BDB3340961C47A13F011AAB45FC5A +40: F55C630CE6008E7F15EA1686D887DEA4 +41: B78DED6C49E3167CD7ACF2CCB4E365DC +42: 79990527F22373B043039F18E343A8B7 +43: ACD08505E2759003C016F6E820DDC562 +44: 8DB7189177EF39A7A969F28B882CFF05 +45: EC0BEA22AE28469B91AAD4654858367E +46: 19A7F32CBCB4CE89163EC6F98FACFF36 +47: 3747F9C67FA044D52C3893D170DEC4A9 +48: DE799E6986BB77CA5C24F9A956BC28E4 +49: AD4CEBB75177F1CBD6FCEBF8457F85D2 + + +Cipher: kasumi +Key Size: 16 bytes + 0: BB6B2E0C88AD7C37 + 1: 5AFA50CBEF3FD5A4 + 2: 1914DFD8DD86C361 + 3: 0976E7F6AEBFFEDF + 4: DE0EF590AEC61F17 + 5: 089FA192859E6124 + 6: 72E283C82D366B51 + 7: 61DA033662AF0B74 + 8: C4CFA2C3ECA84CEA + 9: 15757205BAAC8639 +10: 4349914688A6A850 +11: 4B1F5E0D5B7ABBDF +12: 5482444DC8815041 +13: A8C198FB1D865A93 +14: C2641B2501AB6525 +15: FE492BE02E717496 +16: 03B3034E3A26006D +17: 0CB4B7FBA4582D1B +18: A61C750E5DFF1791 +19: AD5374F2B0860365 +20: CBC588879F98A820 +21: 04CA5EABB466C1C1 +22: F4DF5CEDAE6C0E17 +23: 6133AAD21D875DBB +24: D386BCFA19FAA860 +25: 68C9ED9206F07F47 +26: 00A49444A0C176CC +27: 4BEA00D55452196A +28: A9A3FAC7A2D553A3 +29: BE61DDF4CFA8EC8E +30: B1547D01A23C2632 +31: 400604E71F3F85AC +32: 8F431BCB447A132D +33: 0ED503EBD61D4286 +34: DF7B087B7D315E2C +35: 247A7872587F0507 +36: 7814D6B13A08CA60 +37: ADE44D69362B8199 +38: 49FF8C275D50A175 +39: 5DAC0F53391421C5 +40: B1C316E682E4F314 +41: 72FFFEA2DFD85E08 +42: 0418F02B7A89FC43 +43: 12826A96C5633C97 +44: A4726DA149DBFED1 +45: 5B276374E1EFC6CF +46: A91C4E4804D9A103 +47: 7A2894030C9FE01E +48: 0C59C6FA87DF2DCD +49: A86C6D3C7EAE644D + + +Cipher: multi2 +Key Size: 40 bytes + 0: A69A64BE9EAF56FC + 1: A8AB26A19D7804C6 + 2: D5468EF0C9CDF530 + 3: 2D08D23459949175 + 4: EE66EB212BEC593C + 5: A2D088F95C855F60 + 6: C206004787FEECEE + 7: E4875B7BE2C819B2 + 8: FBC692536393F8C5 + 9: 886DB391EE3BA443 +10: F45359B08EFC56FF +11: 1113E4F4A177E1DC +12: 8A02560CAD0CCF87 +13: CF57FF05E6BB7A67 +14: 21F4EDCF8E8A3D9D +15: 26A26EEFDF51B7F6 +16: E9AF9D2EF2A9EE4A +17: 6866182BC49D09D7 +18: 657E0D732BD7B5CF +19: EFCC33778BC265AE +20: 3556CD607D59C32B +21: A7477466892D114F +22: E210A7B32E9A2E08 +23: 9EBC0B60EB1FEA70 +24: C1E8C3A38E0063B9 +25: 3C9FC4089F87B0D6 +26: 100EA58D00F38495 +27: 3BB3D47D52A81774 +28: F1FA3DE89274A681 +29: 18DF1E38CC0C5230 +30: C3FDCDD9159B0258 +31: EA6ADFAF7D8D3C87 +32: FC4C369E7835461A +33: 791D1D34EBEF801B +34: 3B5A5B64C72B2F77 +35: 55ECED8C5D0F69FC +36: A6DE960F4B81C114 +37: 3C4EDB0671BFFC57 +38: C493186F4BF52F5D +39: 01B2C607B2329E87 +40: 109035510A1AEB20 +41: 0EA4699CA4A161FC +42: 182665FBB15EBD34 +43: 04458216DCB8F55F +44: 850BD374C892FC07 +45: 4C428488381D6FD0 +46: 56FF4CE0AA4132D9 +47: 9F95F0A47D70A317 +48: E12CC913356EFF86 +49: 7E614927A295C45B + + Cipher: camellia Key Size: 16 bytes 0: ED18D83F3153160C5A6D01AC3717515C diff --git a/notes/eax_tv.txt b/notes/eax_tv.txt index 3bedbc126..3d11a1780 100644 --- a/notes/eax_tv.txt +++ b/notes/eax_tv.txt @@ -459,6 +459,79 @@ EAX-khazad (16 byte key) 15: 14DA751E5AF7E01F35B3CE74EE1ACF, 3C76AB64E1724DCE 16: A13BBC7E408D2C550634CBC64690B8FE, 3D4BBC0C76536730 +EAX-seed (16 byte key) + 0: , 3D0715108CEA3BE144350082B1BC4F25 + 1: EF, E56898AEDB0F461980587FFBDB83EE59 + 2: 9552, 9647B7FCEDBB9EF4EDEBCD98831E5BDE + 3: 25DCD8, 3647D80EF3529C72F16D223D04D7ACAA + 4: 3D169011, 7A741FA2536E5905FD4ABAB104062D3B + 5: A92411F6BC, 18A306E5DBF4DBDCE21505F16DA85482 + 6: 9D4661D2859F, 7B2FC34AB3DE45DB4AE8C97BF3B32BA9 + 7: 0E8C26E24B0961, DFF098B44E7D57A71F68FD0D2D2416C7 + 8: 485EE54D5D2684DF, C8FCF501065D23F936A4A530BB028EA0 + 9: 768888B50865A635A2, 8121463B762AC12D19EE21C58A8A1B7B + 10: 647FF44F0B350385BF27, 883241565540347D491C0E397FF5D663 + 11: FD868A569E2E597EB3B5AC, 4DE96B6810A1FC5F19A085B4F4C8B687 + 12: 342D72063420F3FCFC1EF71F, 88B94C3FFD74F052CC44722B87E1A45D + 13: C768F88646D47D5201FDF47A1E, A01EB1FBB3AB135F258B87C30A8E1A13 + 14: 44BF87EC9A5F5E20E5D972ECAE4C, 6F1C44EDB3533EFF973B53EAAF84D601 + 15: FDE60E4F25C4B9388BD3D348912B7F, 863871D706A32F92DAD13803CF2008E1 + 16: 69881E58AF690C5EEBC00DABDAAFBCA9, BD3911C5E41B327A10DC7D03435FB8AC + 17: 41AC0D70E8ECB01CFFFC9352E3800F568E, CCD63A0D20D0FD385EB720B2D60D20EF + 18: 88301B40FA8B84ECEE7238F17B08EC2A2DA3, AD10D120ABCCB67FD3F12C8D8BD216F7 + 19: CCD0F8187B7455274D80A2387599617582B7C5, 3DAA6952A9AA160863E4F489AF04C6A5 + 20: CB955D3B6044F1712DEDC65451E46B8D9FBE5067, D46FEEFA0A0069115F262877050265E9 + 21: 373B8AD20672BEADE5B742C72306455549B26DB631, 16DC5FE5C7C0D5478FF67AD00463AEF1 + 22: CAB49183077EB4DF3BFBF7FE026BCA8311A6BC067EDB, 8F4497F253167AB81A70A05218734C1F + 23: C2F860DA7EC7801FE30FF8C362EFA11E9392E029E24407, 1612D514BF9F365EB0E5CA13E974670D + 24: F0084F22D7AE598FF5DFEF76CCC0728325BB5D3DF5467B2F, 1DE5CD767D2B731DE4C9B4E303A7E771 + 25: F5E907AC398B2C7BE124ACCAD1FEB001BC3EC7C77C21E94110, D8C7D50EFB0CCE2926DA9E796EA46E17 + 26: D65A41B86D24C573D21EE416F2F853E8FF7A0788120102E8BABB, 3EEDB65BCF0E32C24B797D972913F943 + 27: 3B39B9994248DD1FB3EFD68820D19E8436F66FF0E6D82F40E50AFF, 7892720F9AA0ABC34E05FD982396C13A + 28: 9B924A2F620E5160B8F6C8DD313F39D6DC22B7E0596C8D0BFCA14907, E417D1FE5569975E8698C4D80684A613 + 29: 01068AA5F6FBFFDE1A8290CB315426F8CFD2438C09FD5982BE45EB21CC, A7DB568F037E8A4DB2D73CB2DF2BABA4 + 30: D39210874C4B7BEB63966BDC89AC7279B67C118618E9C44C1C563A10F74B, FB64939029B8E5DC1318EBE3FDAFC9F6 + 31: 8338B7BCA36C104C4B7EEBFF582FEAF879894FD6F00434859AD94E644BEC60, 93DECCE7AD61E69A2BD6621FEE2953D9 + 32: 21DC38BE252ECCA74963965660C98B5D9B5C2411945D8AAF9EF93732748A6162, 2BBE555F1D3C94BC6F1665A6DEDB536C + +EAX-kasumi (16 byte key) + 0: , 9E0C41B26B960E81 + 1: 03, 26B904336B9E0BDA + 2: 9EB8, 18E90B52DB587A8B + 3: F8E4F4, 9842D0A42ACC7717 + 4: B5688382, 2134820AF25CFFF5 + 5: 582E9402B2, 9C0F60D5B2D4BEA8 + 6: 836A3CEA4965, 6EB7565E0FF7FFCA + 7: 00DD66F0AB54AE, 0CAFA81DFB52F835 + 8: F5824156469E77DA, 44AEED7DA55C7C2F + 9: FCED54C15FAE6EB601, 95D7A3592D5F3B0E + 10: 0630750CAF71D334562C, D8F7432F9AAEC624 + 11: 25E3C5FAFE86F59D30BEDE, 42E3F6C3B8F73F64 + 12: B98480D54E604E4CFB988EFB, 2BCA65A62CE3E363 + 13: F07F1F98A2411749EA11FD87F2, EC7C07D37B7CC07C + 14: 19A6D648AD698ADED0AF37001479, F88417372E600717 + 15: 17CE88FC64ED98233BBAB20AA4DA45, 4959410987AE317B + 16: 61EE83703D8CA5D652F8E1E83C86D58F, 57EC73A828C20B68 + +EAX-multi2 (40 byte key) + 0: , E3EB492A2A560816 + 1: C6, E0A176A66E269255 + 2: 1D00, 472E25EF8B4ED450 + 3: 1DFE5A, BEDB3404162C7122 + 4: 915B77D4, BABBB74A3EE61755 + 5: 3C966136E8, 603664C04EF42178 + 6: E4A4925C9F75, 41B77B32F28613DB + 7: 365BC4FEF0B1B0, BB09E42F396F3832 + 8: FFCE6DA57D7FE9D1, C11BA7A7B580032C + 9: 0413506EE42819574C, 9B5C6A8111BE7B29 + 10: 531319C06A4B68AE226C, 77BC1DF09414D212 + 11: 85C0454EB3B9CDEDD32EF9, 39576F2268A59EF6 + 12: 8FB1732015FD006D2FFA8D9C, F8F51511ECA4E0A7 + 13: 1654F11C940FCBA529D2384A0D, 871B4541612C7CCE + 14: F119DC9F998D92B4C45185CFA2D1, B50D3A61F3CE76B0 + 15: 05B051F7DA81609FAC41BF0A19C45A, DF1265F3F69625F5 + 16: A313136E4E7F1314E7ED504B48324047, A9D1C5527D6EF7D7 + EAX-camellia (16 byte key) 0: , 9E8CDB7237166EF9FD0605A0AD3E4070 1: 8A, 23F462AC7E22EB9078DAC34CB1CFFB08 diff --git a/notes/gcm_tv.txt b/notes/gcm_tv.txt index b5191f8fb..1e9984581 100644 --- a/notes/gcm_tv.txt +++ b/notes/gcm_tv.txt @@ -212,6 +212,41 @@ GCM-anubis (16 byte key) 31: 72DFB9E91A78EAFE758B4542206A4A957B4523A58428398C11BCF2AEAE1938, 307D0B876130E82804C1167E03B69B2F 32: 7275C6EBDC2680DFCB73326A987D2FBCE83E40A9AEFE6351CFDA7251A6FE10A6, 895E6EEAA9BD88594903325A063CA45F +GCM-seed (16 byte key) + 0: , C11F22F20140505084483597E4370F43 + 1: E1, D39B9E55EF1C94F1E15397E083346491 + 2: D46C, 1303648548ECD8B3992C803A648E3BEF + 3: CBBF1C, C965567985BCF2BCD4C9CF66B2168BD6 + 4: 30544838, 88D10DE290E82F2EFDBF50AD062A13FB + 5: 544DCAFBCB, 52AE6D0576B4D65D82088179EE8E5121 + 6: 26F91824D36D, 7EFF9AED81561EFD2FD4CCAA8CA3E49C + 7: ABAF75A310B8B2, C3E0E6FE9EF8B91325E7952205C3B215 + 8: 460EB25BAF346FEC, 78293B6E454C7A820B0D6ED86399CC70 + 9: CCE2D164E8BA0B80E2, 0DB9D3A14CDC8F8CBAE68D092D769697 + 10: 1C700418306E0FB9A09B, 5ACFC32C1CC06D63DA8F8139909FBB10 + 11: 8A306163BC711A92C1ED0C, 0518DED52A4D698C43709B17F8E6409F + 12: 7FAC8AE98C5D035703D3257D, EBD479B656C24E4E256CC207D26DCB2F + 13: 26DDDDAEAF072E292D9D3A8917, D1AE629015A78A35580B96B524C35A5C + 14: DA8D19951BC8EC2657142DB6239F, 56753850A747FCA0445BF881EFB466D3 + 15: EB82C127979C395018BC346B46C4C8, EFEBDA26F5A1F53BE6A2DECD5DAC0D88 + 16: AE6050FAB41D6EDCE402ED3FA5F56AE9, 2A8922AF8AC424433B13C96EF64721FE + 17: 47D7E682FF60C6F8B4DC1D43CCA75B7CDE, F7CEC551D1855914534CBF4B0F90AB36 + 18: 7DCD5194A227EC2AD352F14C4BC2958067D0, DA444BF98069E6BC209C9AE8C669E892 + 19: 3F9E6101EFFF05D547C881F463FFB43B0CC131, 0FCD327A4C3D9FB679E192C887CD0642 + 20: 70BE93EA6FB611EA7656A70B42AA444403DCD945, 75FA8421BF145219B6973657F9FAB726 + 21: 39A97F1B32D664E53734F506515BEFB3674E2F265C, FC47392114426ABEB42E9B7BD15ED237 + 22: 4D54574772CC127C2E87186E30D6BBD050231601B80E, 48E3BFD70F52434C8D92D412018345DE + 23: 6C757A980FAC2BA8257750293EB63E52A9F7EE10C96005, 4057EB8AF43227A23A85651C002BB795 + 24: 817FDC2FB49084CB3E0F306154ED9252C3FE1C39DF481DF7, 9F510141E2E1716F4738D9979C440C04 + 25: A55CECDEE410C0ED7140BDCEDDF57652D5400793996CB376AA, 0897B814408133BCD6F6392489BDDE4C + 26: BD5E9C3A051AC1FA975649EF4B8E2B6E8C317586643597548E8B, 316C16B9643C1704503CBAB5D01215DE + 27: 4AE2A8FBDA0E92A7C32F95FE5DC63AAD97CE8D07133F0787E1C2E0, B518CE779929E704846376C043D481EC + 28: 3AB6AB78B1C3978951A17A5DC6FEE1F2DA096770246DC040F72FD070, E459B8B8CC525428FB851D9B7616084A + 29: ECD99B0E203AD3E722ADD6A38159C4A2C9C4A4B1A4448EE55091D382E8, 49C80A40C5BC637BB27B69BC2AD0B9A3 + 30: 4EEFF7BF368A278B1C8524F0C805C37F84F6D54785D79BA378A6B9B2999D, 491F2F02B7CDC02A627BD052A007EE56 + 31: 3490DA4EA01B23E86382D3F7BFF3239190F4E19BC4A9BAEA8AEF893F382062, 8431CE0772CBF6867F4F40E45031D9F7 + 32: 590E5508063DC675310C74227B886E68E2C61825C5E9A08231810D11EA695481, B96C6391C22F3961B307578D47120C52 + GCM-camellia (16 byte key) 0: , 477650012AA6284033E1B85321EEF770 1: E1, 2E95EDCCAF3264B5178CD6ED0F2EDEEA diff --git a/notes/ocb3_tv.txt b/notes/ocb3_tv.txt index c923fa324..5e9e8bf69 100644 --- a/notes/ocb3_tv.txt +++ b/notes/ocb3_tv.txt @@ -459,6 +459,79 @@ OCB-khazad (16 byte key) 15: B5F13633767C37E2A5BE44B95AC80D, C66A029513179FAF 16: BBAB31F93B165465FE5E2133810E46C2, 146A3AA6A6A68E2A +OCB-seed (16 byte key) + 0: , 31FC3BE15BE66DE898D8E64F043EF5F2 + 1: 13, 71D7F7D74329C74E68209EBCEC6ED76B + 2: 65DE, 63484B2DB036CE460F25E5F42FB996D9 + 3: A6F3A8, 779A84F1B325BC7746DD61C982C0C84A + 4: CD93DE8A, 78B2B22BF20F341225D239AD89BC0400 + 5: 39D1DC6410, 6BD9D8849627A1C866C8882686F59F8E + 6: 1A90FE8478E0, D99148D2185D130069D1007F759F1952 + 7: 7B021158285E6F, D64304C2FCB0C4207E1172D9F5EDFA54 + 8: 3938321C337EB440, 7535C124E443A1AAC16FF84A8A2D4E73 + 9: 69D89353ACD77C251A, 8BE9575D98A8F6BBA1BCF49F0D133A57 + 10: 4FA9D0AA53C795D8B4A6, D424622976F53C3F862D9C09780D134B + 11: 10E2F16190079B783912FC, 3354E1E8AC4D661B82C1BE44A094E9C0 + 12: 87769AA867DF8624E1C6CC9C, 537FCA01A65D7783E7DF1D337D6F71E9 + 13: 0547E2F6A8017FF31D24EC9F20, 2ECC8DD05C36CCCB1262FFBE6A810E79 + 14: 6B234F55551F86F2478D6A7E910C, 91863300122086508F0259054125736E + 15: AAF361AFF276F996740A110F1868F8, 9DCF980FB47D0533D168490887E1718F + 16: 114A274873A4E60CD175DCC60823DE3F, 9C5F32D0D32F82FFE776025BACFFBF20 + 17: B13F7DC743D559613F563315D68EE30AF2, 9FDA482FEFFFE96F8F748A7B0DA24D71 + 18: 79A2D1D9667777680DB25BB68105378B7981, CC45BA5C13450BCDEACEDD602729A337 + 19: 683E53C85E7000019CD5B8C78FB66E3D4EE0C9, AA4533EBB37F197D1402143CCB0887F0 + 20: 546D9B5CF8FB4BC20CE200C67ACBEB79530AEEA8, 5E9C1CF09C360A0F0C386BD93A9C91F5 + 21: 8CB773A96DA7E4A83FA214BC94117CE042CC2620DD, 058229EBA77FF300E0448C29D37C839A + 22: B13348E2E498E2A02B08CD94B5A66786334B0A415C4B, C9E19F610CC82B0242E8546272D20E3D + 23: 53BD3612B86412C39B98C322AA0E6352A1A3A66A992EC2, 3880B204A156302679F07932103DD531 + 24: 30E2B86833BE1A5187E65F4EFC24D1F753EA2B5D89C87F06, 99FCBA36AB397837A7F9F53C0EF7DBC6 + 25: 03D03F968292C26A26CA833F5F186ACE9BC5D2B6678C4DC220, 3F34D2FBDFBD688A03C29E49B02DDF04 + 26: D443389FE849AF4A74DBDFA2936C8D7DC0C69721C2B3375DFA24, 10198F7477ECF631207AACEC364638A2 + 27: BAF661D4BA70F9E310CD930F36DE90CCDD9DB3473B8A5747A0B5A8, B080FEBEC0497EB16D978E3B8DFFDB77 + 28: 5FE274B3A042BC903879B600C0DF31EB66A260D8ECAE09E45DFA4650, EB35B008EBB5098CFA03B010E1B4AD4F + 29: B124A2D8B0187DD409C7CAA44764C587052FB9B4750CA0DB0174D120CB, 2C48CC7B2D61D68B311F294AE6D6292B + 30: 8488F0C46151994F7798F70F55C7DA1D242B58CFF49BBFF458D5E574EAD0, 94C2D7BB27BBE184AC75213C1147DA71 + 31: 84050C6EBBD37CFCB7DAAC665A15FE459E420FC32CB7677089B236E6EC06F4, 5AC1CDFB43DC955D727FDED9847D9CCE + 32: 3EF03B96631A35B492DD1DC49D7862AA4D0DBDC9161D46711FA5360C1B4E76C7, 567869D045CF62531A10C6B9C3E4CE29 + +OCB-kasumi (16 byte key) + 0: , 8A6AB01A47834615 + 1: 23, 5184BF3E82D10C7F + 2: FDDB, EA45B282D973729D + 3: 8E3693, 432EFEDC2F238A6C + 4: 2409AE69, 7899D1928D55C08B + 5: CA037E6EF1, CA831CE963C9AD95 + 6: BC530A4140A2, EA77571BFFF105A1 + 7: 98B672C2D201EF, 607822313DBC9796 + 8: 26F9AB69E145B531, 7951CE4DC8C47F98 + 9: 30BFC33675F27F7EEB, D17DC60BF79939D2 + 10: F5F816B636D91279AC1C, E2C7B48991DEEF2F + 11: 705C47FABE7905757C0ED2, AADB2A403B861D55 + 12: 50DEB9C57870B744152ADF08, CB6126DAB93504D1 + 13: 767CB16AA8380C8F25A28A2039, F2C271CC48E067E6 + 14: 3A67656FD8B6ABA8BE7F3BE6C123, 462B6736DF6DC3B1 + 15: 21FB98C62DF932E70D05EB915BA8CF, AEFB635A4E0B6C60 + 16: EA8305ADB368267AB86F3ADDE5EE1719, 97E72E1B174A04F7 + +OCB-multi2 (40 byte key) + 0: , AF7F5567D2CFBAA8 + 1: 15, 66BDF680986FAD17 + 2: C94C, D35B49ADC2B24181 + 3: A0516B, DBA6331562F87FE7 + 4: 49C24A69, 6B88C358FF40AD0F + 5: E1839EFAB4, 08B6C2F97518E402 + 6: 71CF3D6DC458, 7CA89CC9D23CF4CE + 7: 02AC7B36DCD0CC, 00331F043D5FB756 + 8: 216F3088BE2553AA, 8A58C76BF8EBC046 + 9: DA0CC0753327707AE3, 8716B1FB7196CB14 + 10: 12B88569BDAAACA144AE, 71A031364BF44ECD + 11: 35B7F2ECD911F86DA2040C, 7649CD32D29AA258 + 12: BF20840BA08B0C85BEAC80B6, C8BD34015F1E3578 + 13: 2A3F508352AA5673BD5A880093, 9987F70EF92CE4E6 + 14: 5DC44D52A234D9A1ABA4C9BF8301, 728D3D9BC56140E7 + 15: 5FCB0AF77D9BA605056BA9178B15FC, A59675797C1307E2 + 16: 09BB95F7F998572CC38719BC4047BA3A, 5F4DA28D281C7FE9 + OCB-camellia (16 byte key) 0: , 3F877FAB2796D87C990AE311F952ABD1 1: 00, DD1FC339F770744F39B1A41A3A82CAEA diff --git a/notes/ocb_tv.txt b/notes/ocb_tv.txt index b93d7e297..076885dba 100644 --- a/notes/ocb_tv.txt +++ b/notes/ocb_tv.txt @@ -459,6 +459,79 @@ OCB-khazad (16 byte key) 15: D870479780CC5B3B13A7A39029A56F, 003D3FCD31D497B5 16: A47BF1218AC86A60F6002CE004AF5E50, B4EC27091D5DCD58 +OCB-seed (16 byte key) + 0: , D80D16D2D0FB2BD9EBA4912468B893D7 + 1: 12, 8776140CB818C1CBFD2CFCD8BDFC9FFA + 2: F8A1, 597381977898AC43194C302216113CEB + 3: B35B5E, BC327275E7A552C4E0AC0FCB8403A6C4 + 4: 19F57542, 4E49DE569547B619E4187239D9B755C2 + 5: EAD2D99E86, 53DCC5FAB4DE25541A22AF0309C9FE78 + 6: 4902A8FF9AF9, 950D9A28DFBDAECE5F14D47E6B7A8B8B + 7: 45FE502602EA4E, 69CD243A3CF17FE51ABBFA2CDE510BCC + 8: D54F2EDE48207CFB, 775EE6140AACF9D56787071F08F36F67 + 9: FEDBBFD9FAABC80186, B37B2C643D62A205BD009BB55D50B918 + 10: 3541A86C889AFEB783B7, FE41A36AC076F417B6A3870DB712CC1F + 11: 62EB71A2EAFDDE1A050AFC, A953ECF1F0B53438E869F0CFB84CB142 + 12: 77AFE377460D6A51208194DB, 5CC2A9D8499F1B25D78937DAFB1DED10 + 13: A34FCDD7CA45DFAA2178CDC7E8, A14A119115143EE2B4719282C9E2356C + 14: A61FA4E9550280C8AAC87EF7A204, A87DDD9631C87ED0792C067E8D7F1D9B + 15: EE82AF5C51896AED298B0C12E00ECF, 9051873090B013508F93677D3A080E96 + 16: 5D532646FAD510E984959C4E14F853D7, 275D8DF932818030F1269804DE06A73B + 17: 1D77F8916DF479DDCE3F49A1D9DEFA40FB, 99611A067F45F140AFDB6FB7E9C23DF2 + 18: 5857267B77E7B8D7732509AEAC0AA80BDB2C, 3159BF09910493977A33268C7F7DBC01 + 19: 1CF64E54D48811F02DAAE472846E65235DC8B7, 78F88A35E2D93A0746058D1B37762A27 + 20: 8CC20A5FEFE9AAE81742DE70453F62A961188DB7, EDA9E9208EC38152E53AFD62ABC77F0B + 21: 1D6CCEEEC72CC7369C33F5CD83ED0DCD6F5613D562, 9FEFD274F3F906B11DD87CC2C0F9D0A2 + 22: 20A9C1EAD88F005DB8F69C8BE005D8A010B261FF2EAD, A341F754932DCBC6DAFE4231918A9CF1 + 23: DCEC1BB28E8D77D69B5148FB02E02C281B68BA6E9768B0, 6AAB2EEB1D25D2DF7CEEFA6054E295DA + 24: 7C4F7165943DB1EFA5731F5C75931F4391F0C40D5731BC54, 3FBFF88733ACE5289D9FB9CD24C44C3F + 25: F5E2C8A9B3A02E0BB86F9E969B0EDA5F554B0C8902BB6F4643, DFB22569019686B2EE92ABA9EE6610B0 + 26: 42B7D0E9613AFAD6E8093E4F638BC96E22413F15A84202188C31, 002F0F602F596236A8F239E81CE47FC0 + 27: 88B89B7756BD3BE09467998FABD12BCE87E5FE994ADE9B30844AE6, 05E0E8AFA55C3B571A849CE4C9F1F477 + 28: 10452565D15D1D829FC54F61960C6A749AFB91086E388269CF6B588A, DD88B0C63E040DF8878B3C919AA95218 + 29: E68619409B86082C744496FC3F645CE1134E84192D2CBCE1CFEEB12612, 83258C337EF21302724CE051A03195D6 + 30: 840277319319EF1DDF6A57682B6695550157F5B76756BF81BFFB3394AFC0, 183FA85F8E91F8972DA23108FA066F20 + 31: C74A4B01328B809397C07F4FC16131FBEE6396293181C327ADB50EF39CC936, D6C5CF79D47995D7CDB5745F601D859F + 32: FF3FEE866339B01DD2C1EC0C0E569A458A77DD014AF0CC9C0A8DC52A52133940, BF1AF01F2CB34CBAF1EAB96FBCCB5404 + +OCB-kasumi (16 byte key) + 0: , 7B4CE3A5B7284F8B + 1: F8, 80584D787B7AE753 + 2: D37A, 7BD7B52BE65B995C + 3: 2D07BF, 6E6E16FDFE808D21 + 4: 9F1A8E7F, 810CDE98B80F2CF2 + 5: C6A7842512, CB6E9709AD7E8545 + 6: 056553F25EE5, 24A74A113D68E373 + 7: C3E0215DEABD43, 80B9F0ABDC207E04 + 8: 38DA7B24B04DDF91, AEEB273DCAE4F743 + 9: 34169FBF64966E0EB8, 1D10D18FC0DF5372 + 10: 5B3A510F1AE97BFCE1EA, 5B1342A77724DBF7 + 11: 39D1B5067E584E59BB6603, 38EDA20D46B2563D + 12: AC2DD02E2406D7D8175EB308, AE7DCB1AE6188975 + 13: B0623EDBC20FEBEDF9B4AB70E6, E218732D221A04A4 + 14: 82F57A435A92E28B56F4EF5E7EA8, CC5842752D089C26 + 15: F2D54E3B9022AB32F668AD5A20D050, D811DF3DE76089FF + 16: 1CAC13A538AFC64D9747226AC23F072C, 2DF49C64213B35B9 + +OCB-multi2 (40 byte key) + 0: , 70A2AD75028C8B3E + 1: 3E, 76BE76B249142049 + 2: 5C21, E31CDBD0ED6B864D + 3: 62BC9F, F1124FC4C9C82617 + 4: BB5AC85A, 97035E20D4FFEC81 + 5: 500D9D05E3, 86D5EC5AD1D55434 + 6: 5179B8442E46, 432EAB80B938A00E + 7: 361000D13C364B, 5ADB3F9FD65EC776 + 8: 5C5BD790B927CBE4, F6ED8E9D330FD37E + 9: 2020DD735C5D7B4739, F98DEFD6A8368E1F + 10: 008A8548790A3582C2AC, 041C4E2FA196390C + 11: E6409403D3E2E4385EE54E, 25AE9113A0E7A3EF + 12: E23E598908C755FCF9D51E39, 21BF8C9F319FB44F + 13: C1F13F46FF04717C7E54FFBDC7, E7D8CDF40A1D78A5 + 14: 27721EB66D4F6362308B96DD9895, A374C96FCA94C809 + 15: 1A393F94CB9ACD3BB93D8766C63569, 45A090303B71D35D + 16: BCC0498FB13CEE8A615FF6409EDF1707, 9589A4CBC481A455 + OCB-camellia (16 byte key) 0: , 6972CC27A9711EAE6654851AB8E0C53F 1: A2, 208D783961FD532E14376B4EE904FE52 diff --git a/notes/omac_tv.txt b/notes/omac_tv.txt index c98baca22..bffaaf68a 100644 --- a/notes/omac_tv.txt +++ b/notes/omac_tv.txt @@ -459,6 +459,79 @@ OMAC-khazad (16 byte key) 15: BCAB623CAB7AAA23 16: 9BCEAB857596E478 +OMAC-seed (16 byte key) + 0: F184C3569AE39C95609E878E8E69D276 + 1: 6B94C6CEB7347C7E478D33FD1892032B + 2: 9FA405B299D5887181C5F09A27AF9F76 + 3: 7457B824FA672F0D939B3CD161A3D229 + 4: EF164E3F30058EA7BA10B1D7ABD945F8 + 5: 22FAD3E42EB96A6E6A66FA73FC96A9E4 + 6: 9BE414C3CD92860A67AFB7C45D0E0EEE + 7: 40DA2A768F6593E45214CB7F054A9BAA + 8: 9AFBBEEC8EFAFA7A22752F3BEE055811 + 9: 45EBA2A3EE9276A90FE7FC705086F59B + 10: 9FE7E1DE176065440B45B1F8F012B8E7 + 11: 5D45CE9EFB14AE973C6567E804492D4A + 12: BB37B25C98998B0CBDF7AA2BF86FBF3B + 13: D68EA4AD5B7C3E243872F5BCF7F24EE2 + 14: E880AEA09E328C58ED99928C7BB97DEE + 15: 4A9EBD30EAB684544D79A066545B100A + 16: CEFD858C3179B39BADA7EA0F6D3AB150 + 17: BD3336CB8C5AC6D327B310C2093FD087 + 18: ACB4B352003B45FE5E872647ACD2C945 + 19: 74FF04F0ED7ACBDFC2B8EDB0193312BF + 20: 950B9587B448A73F0566B6E5D30BD85E + 21: A1CEB1E515BEE6C0C2253415CEDB7F54 + 22: 5E3B9B8F983B882D48853403152BBD09 + 23: E7BB12680BFDC81851D08870862F5F70 + 24: C89D50E7BC1692A3EE29585F4C2861DB + 25: 1ACBB14354F3A1E002BBD065930F56B8 + 26: AECF4E3972E26A862DC9A0D0F78F4A75 + 27: 4E8663B1FD460CC7B6CA7D6D880209C8 + 28: 0350DFE2A107BB68BAD09A9461EE5E64 + 29: 89B70BBAF6E7F4E7E37F40D122588B0A + 30: EB0B22BCD7D61272372502B7EADA68A7 + 31: CC4FB973D094008F4B90D687CD91B4C9 + 32: C7162431A53216C22D47FA511B0A619E + +OMAC-kasumi (16 byte key) + 0: AF4289889D9AD5A1 + 1: C58E7863B4E8CE54 + 2: 2927047C455329BD + 3: 62905068423B826C + 4: 0BC0C92B5162FA20 + 5: 03E6D71DE770BB3A + 6: 6D48AB1CE5EC49FB + 7: 338597E9545657E8 + 8: 418BAF4EFB83DD50 + 9: A47BA8181D187753 + 10: 76FAA6B0FF3B9D4D + 11: C540C8A06345FAAE + 12: 67E454776D871265 + 13: D4E0ABD317993766 + 14: BD328F89D3C1FEA5 + 15: 580E74CB054A9F7D + 16: 121002BF94F18D90 + +OMAC-multi2 (40 byte key) + 0: 3A06523F10C9F2C5 + 1: 310F665F3A12E82A + 2: 459FB6A9AC69FE27 + 3: DEB259E248440826 + 4: 6598F16BC1BFB8C8 + 5: B37DFDF8DD61D479 + 6: 0CE3BD7843FC83C4 + 7: 3BB7880A7E8D6C9E + 8: 74BAA5B4EEFCFDB5 + 9: B71CC55A72D4BB4F + 10: BEF0C7D0781B368B + 11: 0CA0D02961398164 + 12: CF3848FA94C45657 + 13: 57EA86B185A210D3 + 14: 05887EB7679F4B62 + 15: F6A007FF4A175F82 + 16: 57E61B59AC9F3240 + OMAC-camellia (16 byte key) 0: B5664C5148FFB45297703BCC46C19E4E 1: 126EC31A554E8B3B635DE4617092ECE8 diff --git a/notes/pmac_tv.txt b/notes/pmac_tv.txt index 2f9d17533..81df41a07 100644 --- a/notes/pmac_tv.txt +++ b/notes/pmac_tv.txt @@ -459,6 +459,79 @@ PMAC-khazad (16 byte key) 15: 93098DA8A180AA35 16: BACE2F4DA8A89E32 +PMAC-seed (16 byte key) + 0: 58844BC0C53AACF808587A7C35C37DE2 + 1: 481E3E0831DF5AED135C71BBBD075F4A + 2: 11355F9D42E7BAD967DF90E9088D45A7 + 3: 5E3F82EF0B3CA70DCB614C1016DDB052 + 4: 35E283B0E6C538ED5F2DF4E004324865 + 5: 56467B8BA87BDE89DF4A64DC9B9409CF + 6: 9315AAAE6CA0868FDCBC397B7DC2DF84 + 7: A265D861DCE6C9B80CCFF92463DB27D3 + 8: 196A0813E4EB49F47A1C3713950B194E + 9: 261372868D259E609BE5080F282B361A + 10: DFDC55CDF60A0CB6A33BC6F4B5E5A481 + 11: 0BD99E075BC93386CDB40C2AAF8E8918 + 12: CA1B80D0088D7267C9AFB037DCD8FA56 + 13: 8EDBC9F77D4DAB3DFABEAB0891622F1C + 14: D1A8F869C961739ABFE7F401FA41D6F6 + 15: 653041670E0BAD5D1FE77A19D9439CEE + 16: 440EF361908A528B2A3ED7C50C1A47AB + 17: DCE2613438A5DC42AC8F5CE753DDF01D + 18: F9E313156CA5345CECB1A5F963E9B201 + 19: 34D72FB89BA3C41E1D0597531849C6C9 + 20: 7ED20B28067BA27E37606387D641B75F + 21: 933A2E06DA91C208297305FFF4F7795B + 22: CC455E1FB196CF5B233921AA6A048B81 + 23: 613AC1EE5B8D0C3123A18BED9A352980 + 24: 00A2BBEEB98DB190A694B67EF85A65A4 + 25: 1A7D50E6051D85CA81D9DD7DE81BF02E + 26: A7F948B36D7AF08FB405A1B8C8C6AC6D + 27: 967DC3981E7C718B562A93E5292B872F + 28: 2674544D8D3E3F750590992C0AFB36AF + 29: 193A2CC794CB285B4CB87197EE3550ED + 30: 312AAC97C92279428FB1AA0882DB7088 + 31: 3B9CBA2FF7FF4113BB2DC0DF6BCADDD0 + 32: 45C5C71122C70F4337F5EC74BA6B446D + +PMAC-kasumi (16 byte key) + 0: 52DF2D9A9EB4816A + 1: 201C1024E6D2AF23 + 2: 04E7B341BFC96D1A + 3: CC11D07594C50F31 + 4: EE27EAEED00E2F97 + 5: 51DB73EC42ADB789 + 6: 097A5F01A90BFE7F + 7: 7FD121FD6B504A9D + 8: 8A09BC5C1E7FA48C + 9: B7A88328D7D84C9E + 10: 1D34173FA9F1DFCD + 11: 129AC84C0429E80E + 12: 81D236AC427123E4 + 13: 72D4EFEDD56F6253 + 14: ACFC8D6AF30F8B64 + 15: C7F75094394C1765 + 16: D95208BCB48FAA38 + +PMAC-multi2 (40 byte key) + 0: 4799ECD07D95FF68 + 1: 5B94DBFD53C531D7 + 2: DF09EDE792536619 + 3: 01FB72E4EE79DFEF + 4: 4159642D6ED0D4D8 + 5: B6909A449A0A85BB + 6: 20B167D3AA349DEA + 7: E550AAB246D99D92 + 8: 5E1042397C86B08C + 9: 3789D96B64C85AC0 + 10: 72C0921EF5B5DEDE + 11: 5923493300FA910E + 12: B589609B09B4D12F + 13: 5EA42FE501CD696D + 14: 4413763D2689108B + 15: 07207040BAFC8E6D + 16: 4E80F408AA6F1DD9 + PMAC-camellia (16 byte key) 0: 33C03F6AA205F3816A17DA92BEE0BAD2 1: AD1EC293DD032511579235B2F29CC909 diff --git a/testprof/common.c b/testprof/common.c index b455d8d1f..3cfe47855 100644 --- a/testprof/common.c +++ b/testprof/common.c @@ -292,12 +292,12 @@ void register_algs(void) #ifdef LTC_SKIPJACK register_cipher (&skipjack_desc); #endif -#ifdef LTC_KHAZAD - register_cipher (&khazad_desc); -#endif #ifdef LTC_ANUBIS register_cipher (&anubis_desc); #endif +#ifdef LTC_KHAZAD + register_cipher (&khazad_desc); +#endif #ifdef LTC_KSEED register_cipher (&kseed_desc); #endif @@ -433,3 +433,20 @@ register_prng(&sprng_desc); } } + +void setup_math(void) +{ +#ifdef USE_LTM + ltc_mp = ltm_desc; +#elif defined(USE_TFM) + ltc_mp = tfm_desc; +#elif defined(USE_GMP) + ltc_mp = gmp_desc; +#elif defined(EXT_MATH_LIB) + extern ltc_math_descriptor EXT_MATH_LIB; + ltc_mp = EXT_MATH_LIB; +#else + fprintf(stderr, "No MPI provider available\n"); + exit(EXIT_FAILURE); +#endif +} diff --git a/testprof/common.h b/testprof/common.h index 6aef48210..d4f21d6fc 100644 --- a/testprof/common.h +++ b/testprof/common.h @@ -11,5 +11,6 @@ int compare_testvector(const void* is, const unsigned long is_len, const void* s #endif void register_algs(void); +void setup_math(void); #endif /* DEMOS_COMMON_H_ */ From 0a23c6d32ef3239233a2a1f6bbc18c3e421f96dd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 12 May 2017 16:48:44 +0200 Subject: [PATCH 0785/1192] also check for cipher descriptors --- helper.pl | 25 +++++++++++++++---------- src/ciphers/safer/safer.c | 3 +-- testprof/common.c | 10 ++++++++++ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/helper.pl b/helper.pl index 9ef0f9a2b..6bba34487 100755 --- a/helper.pl +++ b/helper.pl @@ -81,7 +81,7 @@ sub check_defines { return $fails; } -sub check_hashes { +sub check_descriptors { my @src; my @descriptors; find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, './src/hashes/'); @@ -89,6 +89,11 @@ sub check_hashes { my @n = map { my $x = $_; $x =~ s/^.*?ltc_hash_descriptor\s+(\S+).*$/$1/; $x } grep { $_ =~ /ltc_hash_descriptor/ } split /\n/, read_file($f); push @descriptors, @n if @n; } + find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, './src/ciphers/'); + for my $f (@src) { + my @n = map { my $x = $_; $x =~ s/^.*?ltc_cipher_descriptor\s+(\S+).*$/$1/; $x } grep { $_ =~ /ltc_cipher_descriptor/ } split /\n/, read_file($f); + push @descriptors, @n if @n; + } my $fails = 0; for my $d (@descriptors) { for my $f (qw{ testprof/common.c }) { @@ -291,14 +296,14 @@ sub die_usage { MARKER } -GetOptions( "s|check-source" => \my $check_source, - "d|check-defines" => \my $check_defines, - "h|check-hashes" => \my $check_hashes, - "m|check-makefiles" => \my $check_makefiles, - "a|check-all" => \my $check_all, - "u|update-makefiles" => \my $update_makefiles, - "f|fixupind=s" => \my $fixupind, - "h|help" => \my $help +GetOptions( "s|check-source" => \my $check_source, + "c|check-descriptors" => \my $check_descriptors, + "d|check-defines" => \my $check_defines, + "m|check-makefiles" => \my $check_makefiles, + "a|check-all" => \my $check_all, + "u|update-makefiles" => \my $update_makefiles, + "f|fixupind=s" => \my $fixupind, + "h|help" => \my $help ) or die_usage; if ($fixupind) { @@ -311,7 +316,7 @@ sub die_usage { my $failure; $failure ||= check_source() if $check_all || $check_source; $failure ||= check_defines() if $check_all || $check_defines; -$failure ||= check_hashes() if $check_all || $check_hashes; +$failure ||= check_descriptors() if $check_all || $check_descriptors; $failure ||= process_makefiles(0) if $check_all || $check_makefiles; $failure ||= process_makefiles(1) if $update_makefiles; diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index 85af1f209..11f4b1b1d 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -35,8 +35,7 @@ #define __LTC_SAFER_TAB_C__ #include "safer_tab.c" -const struct ltc_cipher_descriptor - safer_k64_desc = { +const struct ltc_cipher_descriptor safer_k64_desc = { "safer-k64", 8, 8, 8, 8, LTC_SAFER_K64_DEFAULT_NOF_ROUNDS, &safer_k64_setup, diff --git a/testprof/common.c b/testprof/common.c index 3cfe47855..791294187 100644 --- a/testprof/common.c +++ b/testprof/common.c @@ -250,8 +250,18 @@ void register_algs(void) atexit(_unregister_all); #ifdef LTC_RIJNDAEL +#ifdef ENCRYPT_ONLY + /* alternative would be + * register_cipher (&rijndael_enc_desc); + */ + register_cipher (&aes_enc_desc); +#else + /* alternative would be + * register_cipher (&rijndael_desc); + */ register_cipher (&aes_desc); #endif +#endif #ifdef LTC_BLOWFISH register_cipher (&blowfish_desc); #endif From f7d3c2bfa1a1123a7216c341080713df9bc67597 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 24 May 2017 21:06:40 +0200 Subject: [PATCH 0786/1192] merge testprof/test_driver.c to testprof/common.c --- testprof/common.c | 12 ++++++++++++ testprof/common.h | 10 ++++++++++ testprof/test_driver.c | 18 ------------------ testprof/tomcrypt_test.h | 10 ---------- 4 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 testprof/test_driver.c diff --git a/testprof/common.c b/testprof/common.c index 791294187..028768fb8 100644 --- a/testprof/common.c +++ b/testprof/common.c @@ -15,6 +15,18 @@ Steffen Jaeckel */ +void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm) +{ + if (res != CRYPT_OK) { + fprintf(stderr, "%s (%d)%s%s\n%s:%d:%s\n", + error_to_string(res), res, + (algorithm ? " - " : ""), (algorithm ? algorithm : ""), + file, line, cmd); + if (res != CRYPT_NOP) { + exit(EXIT_FAILURE); + } + } +} void print_hex(const char* what, const void* v, const unsigned long l) { diff --git a/testprof/common.h b/testprof/common.h index d4f21d6fc..7e67ee304 100644 --- a/testprof/common.h +++ b/testprof/common.h @@ -5,6 +5,16 @@ extern prng_state yarrow_prng; +#ifdef LTC_VERBOSE +#define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) +#define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) +#else +#define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) +#define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) +#endif + +void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); + void print_hex(const char* what, const void* v, const unsigned long l); #ifndef compare_testvector int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); diff --git a/testprof/test_driver.c b/testprof/test_driver.c deleted file mode 100644 index b728f911f..000000000 --- a/testprof/test_driver.c +++ /dev/null @@ -1,18 +0,0 @@ -#include - -void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm) -{ - if (res != CRYPT_OK) { - fprintf(stderr, "%s (%d)%s%s\n%s:%d:%s\n", - error_to_string(res), res, - (algorithm ? " - " : ""), (algorithm ? algorithm : ""), - file, line, cmd); - if (res != CRYPT_NOP) { - exit(EXIT_FAILURE); - } - } -} - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 04fad826a..6ad140871 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -30,16 +30,6 @@ typedef struct { int (*entry)(void); } test_entry; -void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); - -#ifdef LTC_VERBOSE -#define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) -#define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) -#else -#define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0) -#define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) -#endif - /* TESTS */ int cipher_hash_test(void); int modes_test(void); From abe8d262465409e7e421f87fdd31488782c49f04 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 24 May 2017 21:16:43 +0200 Subject: [PATCH 0787/1192] move epoch_usec() to test.c --- demos/test.c | 30 ++++++++++++++++++++++++++++++ testprof/tomcrypt_test.h | 1 - testprof/x86_prof.c | 30 ------------------------------ 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/demos/test.c b/demos/test.c index bdb649628..85165d82c 100644 --- a/demos/test.c +++ b/demos/test.c @@ -32,6 +32,36 @@ static const struct { LTC_TEST_FN(multi_test), }; +#if defined(_WIN32) + #include /* GetSystemTimeAsFileTime */ +#else + #include +#endif + +/* microseconds since 1970 (UNIX epoch) */ +static ulong64 epoch_usec(void) +{ +#if defined(LTC_NO_TEST_TIMING) + return 0; +#elif defined(_WIN32) + FILETIME CurrentTime; + ulong64 cur_time; + ULARGE_INTEGER ul; + GetSystemTimeAsFileTime(&CurrentTime); + ul.LowPart = CurrentTime.dwLowDateTime; + ul.HighPart = CurrentTime.dwHighDateTime; + cur_time = ul.QuadPart; + cur_time -= CONST64(116444736000000000); /* subtract epoch in microseconds */ + cur_time /= 10; /* nanoseconds > microseconds */ + return cur_time; +#else + struct timeval tv; + struct timezone tz; + gettimeofday(&tv, &tz); + return (ulong64)(tv.tv_sec) * 1000000 + (ulong64)(tv.tv_usec); /* get microseconds */ +#endif +} + int main(int argc, char **argv) { int x, pass = 0, fail = 0, nop = 0; diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 6ad140871..59745b92a 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -70,7 +70,6 @@ extern const struct ltc_prng_descriptor no_prng_desc; int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); -ulong64 epoch_usec(void); void t_start(void); ulong64 t_read(void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index 240fb917c..03f400321 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -1,35 +1,5 @@ #include -#if defined(_WIN32) - #include /* GetSystemTimeAsFileTime */ -#else - #include -#endif - -/* microseconds since 1970 (UNIX epoch) */ -ulong64 epoch_usec(void) -{ -#if defined(LTC_NO_TEST_TIMING) - return 0; -#elif defined(_WIN32) - FILETIME CurrentTime; - ulong64 cur_time; - ULARGE_INTEGER ul; - GetSystemTimeAsFileTime(&CurrentTime); - ul.LowPart = CurrentTime.dwLowDateTime; - ul.HighPart = CurrentTime.dwHighDateTime; - cur_time = ul.QuadPart; - cur_time -= CONST64(116444736000000000); /* subtract epoch in microseconds */ - cur_time /= 10; /* nanoseconds > microseconds */ - return cur_time; -#else - struct timeval tv; - struct timezone tz; - gettimeofday(&tv, &tz); - return (ulong64)(tv.tv_sec) * 1000000 + (ulong64)(tv.tv_usec); /* get microseconds */ -#endif -} - struct list results[100]; int no_results; int sorter(const void *a, const void *b) From 9d4094b8e9fa7e525372e416af53dcb7c135cebe Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 24 May 2017 21:17:28 +0200 Subject: [PATCH 0788/1192] rename x86_prof.c to timing_test.c --- testprof/{x86_prof.c => timing_test.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename testprof/{x86_prof.c => timing_test.c} (100%) diff --git a/testprof/x86_prof.c b/testprof/timing_test.c similarity index 100% rename from testprof/x86_prof.c rename to testprof/timing_test.c From 8ef805817cb3c8ff80526702d2bcfb3cb642dcb2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 24 May 2017 21:36:15 +0200 Subject: [PATCH 0789/1192] rename time_cipher[2-4]? appropriately --- demos/timing.c | 8 ++++---- testprof/timing_test.c | 18 +++++++++--------- testprof/tomcrypt_test.h | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/demos/timing.c b/demos/timing.c index 5cc23fcd1..8d525eaa5 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -18,10 +18,10 @@ register_algs(); #endif time_keysched(); -time_cipher(); -time_cipher2(); -time_cipher3(); -time_cipher4(); +time_cipher_ecb(); +time_cipher_cbc(); +time_cipher_ctr(); +time_cipher_lrw(); time_hash(); time_macs(); time_encmacs(); diff --git a/testprof/timing_test.c b/testprof/timing_test.c index 03f400321..ec61e9240 100644 --- a/testprof/timing_test.c +++ b/testprof/timing_test.c @@ -154,7 +154,7 @@ int time_keysched(void) } #ifdef LTC_ECB_MODE -int time_cipher(void) +int time_cipher_ecb(void) { unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; @@ -225,11 +225,11 @@ int time_cipher(void) return 0; } #else -int time_cipher(void) { fprintf(stderr, "NO ECB\n"); return 0; } +int time_cipher_ecb(void) { fprintf(stderr, "NO ECB\n"); return 0; } #endif #ifdef LTC_CBC_MODE -int time_cipher2(void) +int time_cipher_cbc(void) { unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; @@ -300,11 +300,11 @@ int time_cipher2(void) return 0; } #else -int time_cipher2(void) { fprintf(stderr, "NO CBC\n"); return 0; } +int time_cipher_cbc(void) { fprintf(stderr, "NO CBC\n"); return 0; } #endif #ifdef LTC_CTR_MODE -int time_cipher3(void) +int time_cipher_ctr(void) { unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; @@ -375,11 +375,11 @@ int time_cipher3(void) return 0; } #else -int time_cipher3(void) { fprintf(stderr, "NO CTR\n"); return 0; } +int time_cipher_ctr(void) { fprintf(stderr, "NO CTR\n"); return 0; } #endif #ifdef LTC_LRW_MODE -int time_cipher4(void) +int time_cipher_lrw(void) { unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; @@ -452,7 +452,7 @@ int time_cipher4(void) return 0; } #else -int time_cipher4(void) { fprintf(stderr, "NO LRW\n"); return 0; } +int time_cipher_lrw(void) { fprintf(stderr, "NO LRW\n"); return 0; } #endif @@ -1155,7 +1155,7 @@ void time_macs(void) time_macs_(32); } -void time_encmacs_(unsigned long MAC_SIZE) +static void time_encmacs_(unsigned long MAC_SIZE) { #if defined(LTC_EAX_MODE) || defined(LTC_OCB_MODE) || defined(LTC_OCB3_MODE) || defined(LTC_CCM_MODE) || defined(LTC_GCM_MODE) unsigned char *buf, IV[16], key[16], tag[16]; diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 59745b92a..1c4b3095c 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -77,10 +77,10 @@ void init_timer(void); /* register default algs */ int time_keysched(void); -int time_cipher(void); -int time_cipher2(void); -int time_cipher3(void); -int time_cipher4(void); +int time_cipher_ecb(void); +int time_cipher_cbc(void); +int time_cipher_ctr(void); +int time_cipher_lrw(void); int time_hash(void); void time_mult(void); void time_sqr(void); From 70a27a852e37ca959754d5153e6c3816c065e60e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 24 May 2017 21:07:07 +0200 Subject: [PATCH 0790/1192] Update makefiles --- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index a98876432..af578251b 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -193,7 +193,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o +testprof/store_test.o testprof/timing_test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile.msvc b/makefile.msvc index 2d169f203..8a406cff8 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -186,7 +186,7 @@ testprof/dh_test.obj testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_t testprof/mac_test.obj testprof/misc_test.obj testprof/modes_test.obj testprof/multi_test.obj testprof/no_prng.obj \ testprof/pkcs_1_eme_test.obj testprof/pkcs_1_emsa_test.obj testprof/pkcs_1_oaep_test.obj \ testprof/pkcs_1_pss_test.obj testprof/pkcs_1_test.obj testprof/rotate_test.obj testprof/rsa_test.obj \ -testprof/store_test.obj testprof/test_driver.obj testprof/x86_prof.obj +testprof/store_test.obj testprof/timing_test.obj #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile.unix b/makefile.unix index 5d5345b79..1e1badb05 100644 --- a/makefile.unix +++ b/makefile.unix @@ -198,7 +198,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o +testprof/store_test.o testprof/timing_test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile_include.mk b/makefile_include.mk index 9cd5bbd19..096460f3d 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -296,7 +296,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test_driver.o testprof/x86_prof.o +testprof/store_test.o testprof/timing_test.o # The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ From 201681ee3bcd3b14095cec450a35f287569d9b70 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 30 May 2017 18:29:34 +0200 Subject: [PATCH 0791/1192] merge testprof/timing_test.c into demos/timing.c --- demos/timing.c | 1344 +++++++++++++++++++++++++++++++++++++- helper.pl | 2 +- makefile | 4 +- makefile.mingw | 4 +- makefile.msvc | 2 +- makefile.shared | 4 +- makefile.unix | 4 +- makefile_include.mk | 2 +- testprof/common.h | 6 + testprof/timing_test.c | 1333 ------------------------------------- testprof/tomcrypt_test.h | 45 -- 11 files changed, 1358 insertions(+), 1392 deletions(-) delete mode 100644 testprof/timing_test.c diff --git a/demos/timing.c b/demos/timing.c index 8d525eaa5..91890ae90 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -1,4 +1,1343 @@ -#include +#include + +/* timing */ +#define KTIMES 25 +#define TIMES 100000 + +static struct list { + int id; + ulong64 spd1, spd2, avg; +} results[100]; +static int no_results; + +static int sorter(const void *a, const void *b) +{ + const struct list *A, *B; + A = a; + B = b; + if (A->avg < B->avg) return -1; + if (A->avg > B->avg) return 1; + return 0; +} + +static void tally_results(int type) +{ + int x; + + /* qsort the results */ + qsort(results, no_results, sizeof(struct list), &sorter); + + fprintf(stderr, "\n"); + if (type == 0) { + for (x = 0; x < no_results; x++) { + fprintf(stderr, "%-20s: Schedule at %6lu\n", cipher_descriptor[results[x].id].name, (unsigned long)results[x].spd1); + } + } else if (type == 1) { + for (x = 0; x < no_results; x++) { + printf + ("%-20s[%3d]: Encrypt at %5"PRI64"u, Decrypt at %5"PRI64"u\n", cipher_descriptor[results[x].id].name, cipher_descriptor[results[x].id].ID, results[x].spd1, results[x].spd2); + } + } else { + for (x = 0; x < no_results; x++) { + printf + ("%-20s: Process at %5"PRI64"u\n", hash_descriptor[results[x].id].name, results[x].spd1 / 1000); + } + } +} + +/* RDTSC from Scott Duplichan */ +static ulong64 rdtsc (void) + { + #if defined __GNUC__ && !defined(LTC_NO_ASM) + #if defined(__i386__) || defined(__x86_64__) + /* version from http://www.mcs.anl.gov/~kazutomo/rdtsc.html + * the old code always got a warning issued by gcc, clang did not complain... + */ + unsigned hi, lo; + __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); + return ((ulong64)lo)|( ((ulong64)hi)<<32); + #elif defined(LTC_PPC32) || defined(TFM_PPC32) + unsigned long a, b; + __asm__ __volatile__ ("mftbu %1 \nmftb %0\n":"=r"(a), "=r"(b)); + return (((ulong64)b) << 32ULL) | ((ulong64)a); + #elif defined(__ia64__) /* gcc-IA64 version */ + unsigned long result; + __asm__ __volatile__("mov %0=ar.itc" : "=r"(result) :: "memory"); + while (__builtin_expect ((int) result == -1, 0)) + __asm__ __volatile__("mov %0=ar.itc" : "=r"(result) :: "memory"); + return result; + #elif defined(__sparc__) + #if defined(__arch64__) + ulong64 a; + asm volatile("rd %%tick,%0" : "=r" (a)); + return a; + #else + register unsigned long x, y; + __asm__ __volatile__ ("rd %%tick, %0; clruw %0, %1; srlx %0, 32, %0" : "=r" (x), "=r" (y) : "0" (x), "1" (y)); + return ((unsigned long long) x << 32) | y; + #endif + #else + return XCLOCK(); + #endif + + /* Microsoft and Intel Windows compilers */ + #elif defined _M_IX86 && !defined(LTC_NO_ASM) + __asm rdtsc + #elif defined _M_AMD64 && !defined(LTC_NO_ASM) + return __rdtsc (); + #elif defined _M_IA64 && !defined(LTC_NO_ASM) + #if defined __INTEL_COMPILER + #include + #endif + return __getReg (3116); + #else + return XCLOCK(); + #endif + } + +static ulong64 timer, skew = 0; + +static void t_start(void) +{ + timer = rdtsc(); +} + +static ulong64 t_read(void) +{ + return rdtsc() - timer; +} + +static void init_timer(void) +{ + ulong64 c1, c2, t1, t2; + unsigned long y1; + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < TIMES*100; y1++) { + t_start(); + t1 = t_read(); + t2 = (t_read() - t1)>>1; + + c1 = (t1 > c1) ? t1 : c1; + c2 = (t2 > c2) ? t2 : c2; + } + skew = c2 - c1; + fprintf(stderr, "Clock Skew: %lu\n", (unsigned long)skew); +} + +static int time_keysched(void) +{ + unsigned long x, y1; + ulong64 t1, c1; + symmetric_key skey; + int kl; + int (*func) (const unsigned char *, int , int , symmetric_key *); + unsigned char key[MAXBLOCKSIZE]; + + fprintf(stderr, "\n\nKey Schedule Time Trials for the Symmetric Ciphers:\n(Times are cycles per key)\n"); + no_results = 0; + for (x = 0; cipher_descriptor[x].name != NULL; x++) { +#define DO1(k) func(k, kl, 0, &skey); + + func = cipher_descriptor[x].setup; + kl = cipher_descriptor[x].min_key_length; + c1 = (ulong64)-1; + for (y1 = 0; y1 < KTIMES; y1++) { + yarrow_read(key, kl, &yarrow_prng); + t_start(); + DO1(key); + t1 = t_read(); + c1 = (t1 > c1) ? c1 : t1; + } + t1 = c1 - skew; + results[no_results].spd1 = results[no_results].avg = t1; + results[no_results++].id = x; + fprintf(stderr, "."); fflush(stdout); + +#undef DO1 + } + tally_results(0); + + return 0; +} + +#ifdef LTC_ECB_MODE +static int time_cipher_ecb(void) +{ + unsigned long x, y1; + ulong64 t1, t2, c1, c2, a1, a2; + symmetric_ECB ecb; + unsigned char key[MAXBLOCKSIZE], pt[4096]; + int err; + + fprintf(stderr, "\n\nECB Time Trials for the Symmetric Ciphers:\n"); + no_results = 0; + for (x = 0; cipher_descriptor[x].name != NULL; x++) { + ecb_start(x, key, cipher_descriptor[x].min_key_length, 0, &ecb); + + /* sanity check on cipher */ + if ((err = cipher_descriptor[x].test()) != CRYPT_OK) { + fprintf(stderr, "\n\nERROR: Cipher %s failed self-test %s\n", cipher_descriptor[x].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + +#define DO1 ecb_encrypt(pt, pt, sizeof(pt), &ecb); +#define DO2 DO1 DO1 + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < 100; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read(); + t2 -= t1; + + c1 = (t1 > c1 ? c1 : t1); + c2 = (t2 > c2 ? c2 : t2); + } + a1 = c2 - c1 - skew; + +#undef DO1 +#undef DO2 +#define DO1 ecb_decrypt(pt, pt, sizeof(pt), &ecb); +#define DO2 DO1 DO1 + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < 100; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read(); + t2 -= t1; + + c1 = (t1 > c1 ? c1 : t1); + c2 = (t2 > c2 ? c2 : t2); + } + a2 = c2 - c1 - skew; + ecb_done(&ecb); + + results[no_results].id = x; + results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; + ++no_results; + fprintf(stderr, "."); fflush(stdout); + +#undef DO2 +#undef DO1 + } + tally_results(1); + + return 0; +} +#else +static int time_cipher_ecb(void) { fprintf(stderr, "NO ECB\n"); return 0; } +#endif + +#ifdef LTC_CBC_MODE +static int time_cipher_cbc(void) +{ + unsigned long x, y1; + ulong64 t1, t2, c1, c2, a1, a2; + symmetric_CBC cbc; + unsigned char key[MAXBLOCKSIZE], pt[4096]; + int err; + + fprintf(stderr, "\n\nCBC Time Trials for the Symmetric Ciphers:\n"); + no_results = 0; + for (x = 0; cipher_descriptor[x].name != NULL; x++) { + cbc_start(x, pt, key, cipher_descriptor[x].min_key_length, 0, &cbc); + + /* sanity check on cipher */ + if ((err = cipher_descriptor[x].test()) != CRYPT_OK) { + fprintf(stderr, "\n\nERROR: Cipher %s failed self-test %s\n", cipher_descriptor[x].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + +#define DO1 cbc_encrypt(pt, pt, sizeof(pt), &cbc); +#define DO2 DO1 DO1 + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < 100; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read(); + t2 -= t1; + + c1 = (t1 > c1 ? c1 : t1); + c2 = (t2 > c2 ? c2 : t2); + } + a1 = c2 - c1 - skew; + +#undef DO1 +#undef DO2 +#define DO1 cbc_decrypt(pt, pt, sizeof(pt), &cbc); +#define DO2 DO1 DO1 + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < 100; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read(); + t2 -= t1; + + c1 = (t1 > c1 ? c1 : t1); + c2 = (t2 > c2 ? c2 : t2); + } + a2 = c2 - c1 - skew; + cbc_done(&cbc); + + results[no_results].id = x; + results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; + ++no_results; + fprintf(stderr, "."); fflush(stdout); + +#undef DO2 +#undef DO1 + } + tally_results(1); + + return 0; +} +#else +static int time_cipher_cbc(void) { fprintf(stderr, "NO CBC\n"); return 0; } +#endif + +#ifdef LTC_CTR_MODE +static int time_cipher_ctr(void) +{ + unsigned long x, y1; + ulong64 t1, t2, c1, c2, a1, a2; + symmetric_CTR ctr; + unsigned char key[MAXBLOCKSIZE], pt[4096]; + int err; + + fprintf(stderr, "\n\nCTR Time Trials for the Symmetric Ciphers:\n"); + no_results = 0; + for (x = 0; cipher_descriptor[x].name != NULL; x++) { + ctr_start(x, pt, key, cipher_descriptor[x].min_key_length, 0, CTR_COUNTER_LITTLE_ENDIAN, &ctr); + + /* sanity check on cipher */ + if ((err = cipher_descriptor[x].test()) != CRYPT_OK) { + fprintf(stderr, "\n\nERROR: Cipher %s failed self-test %s\n", cipher_descriptor[x].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + +#define DO1 ctr_encrypt(pt, pt, sizeof(pt), &ctr); +#define DO2 DO1 DO1 + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < 100; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read(); + t2 -= t1; + + c1 = (t1 > c1 ? c1 : t1); + c2 = (t2 > c2 ? c2 : t2); + } + a1 = c2 - c1 - skew; + +#undef DO1 +#undef DO2 +#define DO1 ctr_decrypt(pt, pt, sizeof(pt), &ctr); +#define DO2 DO1 DO1 + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < 100; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read(); + t2 -= t1; + + c1 = (t1 > c1 ? c1 : t1); + c2 = (t2 > c2 ? c2 : t2); + } + a2 = c2 - c1 - skew; + ctr_done(&ctr); + + results[no_results].id = x; + results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; + ++no_results; + fprintf(stderr, "."); fflush(stdout); + +#undef DO2 +#undef DO1 + } + tally_results(1); + + return 0; +} +#else +static int time_cipher_ctr(void) { fprintf(stderr, "NO CTR\n"); return 0; } +#endif + +#ifdef LTC_LRW_MODE +static int time_cipher_lrw(void) +{ + unsigned long x, y1; + ulong64 t1, t2, c1, c2, a1, a2; + symmetric_LRW lrw; + unsigned char key[MAXBLOCKSIZE], pt[4096]; + int err; + + fprintf(stderr, "\n\nLRW Time Trials for the Symmetric Ciphers:\n"); + no_results = 0; + for (x = 0; cipher_descriptor[x].name != NULL; x++) { + if (cipher_descriptor[x].block_length != 16) continue; + lrw_start(x, pt, key, cipher_descriptor[x].min_key_length, key, 0, &lrw); + + /* sanity check on cipher */ + if ((err = cipher_descriptor[x].test()) != CRYPT_OK) { + fprintf(stderr, "\n\nERROR: Cipher %s failed self-test %s\n", cipher_descriptor[x].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + +#define DO1 lrw_encrypt(pt, pt, sizeof(pt), &lrw); +#define DO2 DO1 DO1 + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < 100; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read(); + t2 -= t1; + + c1 = (t1 > c1 ? c1 : t1); + c2 = (t2 > c2 ? c2 : t2); + } + a1 = c2 - c1 - skew; + +#undef DO1 +#undef DO2 +#define DO1 lrw_decrypt(pt, pt, sizeof(pt), &lrw); +#define DO2 DO1 DO1 + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < 100; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read(); + t2 -= t1; + + c1 = (t1 > c1 ? c1 : t1); + c2 = (t2 > c2 ? c2 : t2); + } + a2 = c2 - c1 - skew; + + lrw_done(&lrw); + + results[no_results].id = x; + results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); + results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; + ++no_results; + fprintf(stderr, "."); fflush(stdout); + +#undef DO2 +#undef DO1 + } + tally_results(1); + + return 0; +} +#else +static int time_cipher_lrw(void) { fprintf(stderr, "NO LRW\n"); return 0; } +#endif + + +static int time_hash(void) +{ + unsigned long x, y1, len; + ulong64 t1, t2, c1, c2; + hash_state md; + int (*func)(hash_state *, const unsigned char *, unsigned long), err; + unsigned char pt[MAXBLOCKSIZE]; + + + fprintf(stderr, "\n\nHASH Time Trials for:\n"); + no_results = 0; + for (x = 0; hash_descriptor[x].name != NULL; x++) { + + /* sanity check on hash */ + if ((err = hash_descriptor[x].test()) != CRYPT_OK) { + fprintf(stderr, "\n\nERROR: Hash %s failed self-test %s\n", hash_descriptor[x].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + + hash_descriptor[x].init(&md); + +#define DO1 func(&md,pt,len); +#define DO2 DO1 DO1 + + func = hash_descriptor[x].process; + len = hash_descriptor[x].blocksize; + + c1 = c2 = (ulong64)-1; + for (y1 = 0; y1 < TIMES; y1++) { + t_start(); + DO1; + t1 = t_read(); + DO2; + t2 = t_read() - t1; + c1 = (t1 > c1) ? c1 : t1; + c2 = (t2 > c2) ? c2 : t2; + } + t1 = c2 - c1 - skew; + t1 = ((t1 * CONST64(1000))) / ((ulong64)hash_descriptor[x].blocksize); + results[no_results].id = x; + results[no_results].spd1 = results[no_results].avg = t1; + ++no_results; + fprintf(stderr, "."); fflush(stdout); +#undef DO2 +#undef DO1 + } + tally_results(2); + + return 0; +} + +/*#warning you need an mp_rand!!!*/ +#ifndef USE_LTM + #undef LTC_MPI +#endif + +#ifdef LTC_MPI +static void time_mult(void) +{ + ulong64 t1, t2; + unsigned long x, y; + void *a, *b, *c; + + fprintf(stderr, "Timing Multiplying:\n"); + mp_init_multi(&a,&b,&c,NULL); + for (x = 128/MP_DIGIT_BIT; x <= (unsigned long)1536/MP_DIGIT_BIT; x += 128/MP_DIGIT_BIT) { + mp_rand(a, x); + mp_rand(b, x); + +#define DO1 mp_mul(a, b, c); +#define DO2 DO1; DO1; + + t2 = -1; + for (y = 0; y < TIMES; y++) { + t_start(); + t1 = t_read(); + DO2; + t1 = (t_read() - t1)>>1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "%4lu bits: %9"PRI64"u cycles\n", x*MP_DIGIT_BIT, t2); + } + mp_clear_multi(a,b,c,NULL); + +#undef DO1 +#undef DO2 +} + +static void time_sqr(void) +{ + ulong64 t1, t2; + unsigned long x, y; + void *a, *b; + + fprintf(stderr, "Timing Squaring:\n"); + mp_init_multi(&a,&b,NULL); + for (x = 128/MP_DIGIT_BIT; x <= (unsigned long)1536/MP_DIGIT_BIT; x += 128/MP_DIGIT_BIT) { + mp_rand(a, x); + +#define DO1 mp_sqr(a, b); +#define DO2 DO1; DO1; + + t2 = -1; + for (y = 0; y < TIMES; y++) { + t_start(); + t1 = t_read(); + DO2; + t1 = (t_read() - t1)>>1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "%4lu bits: %9"PRI64"u cycles\n", x*MP_DIGIT_BIT, t2); + } + mp_clear_multi(a,b,NULL); + +#undef DO1 +#undef DO2 +} +#else +static void time_mult(void) { fprintf(stderr, "NO MULT\n"); } +static void time_sqr(void) { fprintf(stderr, "NO SQR\n"); } +#endif + +static void time_prng(void) +{ + ulong64 t1, t2; + unsigned char buf[4096]; + prng_state tprng; + unsigned long x, y; + int err; + + fprintf(stderr, "Timing PRNGs (cycles/byte output, cycles add_entropy (32 bytes) :\n"); + for (x = 0; prng_descriptor[x].name != NULL; x++) { + + /* sanity check on prng */ + if ((err = prng_descriptor[x].test()) != CRYPT_OK) { + fprintf(stderr, "\n\nERROR: PRNG %s failed self-test %s\n", prng_descriptor[x].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + + prng_descriptor[x].start(&tprng); + zeromem(buf, 256); + prng_descriptor[x].add_entropy(buf, 256, &tprng); + prng_descriptor[x].ready(&tprng); + t2 = -1; + +#define DO1 if (prng_descriptor[x].read(buf, 4096, &tprng) != 4096) { fprintf(stderr, "\n\nERROR READ != 4096\n\n"); exit(EXIT_FAILURE); } +#define DO2 DO1 DO1 + for (y = 0; y < 10000; y++) { + t_start(); + t1 = t_read(); + DO2; + t1 = (t_read() - t1)>>1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "%20s: %5"PRI64"u ", prng_descriptor[x].name, t2>>12); +#undef DO2 +#undef DO1 + +#define DO1 prng_descriptor[x].start(&tprng); prng_descriptor[x].add_entropy(buf, 32, &tprng); prng_descriptor[x].ready(&tprng); prng_descriptor[x].done(&tprng); +#define DO2 DO1 DO1 + for (y = 0; y < 10000; y++) { + t_start(); + t1 = t_read(); + DO2; + t1 = (t_read() - t1)>>1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "%5"PRI64"u\n", t2); +#undef DO2 +#undef DO1 + + } +} + +#ifdef LTC_MDSA +/* time various DSA operations */ +static void time_dsa(void) +{ + dsa_key key; + ulong64 t1, t2; + unsigned long x, y; + int err; +static const struct { + int group, modulus; +} groups[] = { +{ 20, 96 }, +{ 20, 128 }, +{ 24, 192 }, +{ 28, 256 }, +{ 32, 512 } +}; + + for (x = 0; x < (sizeof(groups)/sizeof(groups[0])); x++) { + t2 = 0; + for (y = 0; y < 4; y++) { + t_start(); + t1 = t_read(); + if ((err = dsa_make_key(&yarrow_prng, find_prng("yarrow"), groups[x].group, groups[x].modulus, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\ndsa_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; + +#ifdef LTC_PROFILE + t2 <<= 2; + break; +#endif + if (y < 3) { + dsa_free(&key); + } + } + t2 >>= 2; + fprintf(stderr, "DSA-(%lu, %lu) make_key took %15"PRI64"u cycles\n", (unsigned long)groups[x].group*8, (unsigned long)groups[x].modulus*8, t2); + } + fprintf(stderr, "\n\n"); +} +#else +static void time_dsa(void) { fprintf(stderr, "NO DSA\n"); } +#endif + + +#ifdef LTC_MRSA +/* time various RSA operations */ +static void time_rsa(void) +{ + rsa_key key; + ulong64 t1, t2; + unsigned char buf[2][2048]; + unsigned long x, y, z, zzz; + int err, zz, stat; + + for (x = 1024; x <= 2048; x += 256) { + t2 = 0; + for (y = 0; y < 4; y++) { + t_start(); + t1 = t_read(); + if ((err = rsa_make_key(&yarrow_prng, find_prng("yarrow"), x/8, 65537, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\nrsa_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; + +#ifdef LTC_PROFILE + t2 <<= 2; + break; +#endif + + if (y < 3) { + rsa_free(&key); + } + } + t2 >>= 2; + fprintf(stderr, "RSA-%lu make_key took %15"PRI64"u cycles\n", x, t2); + + t2 = 0; + for (y = 0; y < 16; y++) { + t_start(); + t1 = t_read(); + z = sizeof(buf[1]); + if ((err = rsa_encrypt_key(buf[0], 32, buf[1], &z, (const unsigned char *)"testprog", 8, &yarrow_prng, + find_prng("yarrow"), find_hash("sha1"), + &key)) != CRYPT_OK) { + fprintf(stderr, "\n\nrsa_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; +#ifdef LTC_PROFILE + t2 <<= 4; + break; +#endif + } + t2 >>= 4; + fprintf(stderr, "RSA-%lu encrypt_key took %15"PRI64"u cycles\n", x, t2); + + t2 = 0; + for (y = 0; y < 2048; y++) { + t_start(); + t1 = t_read(); + zzz = sizeof(buf[0]); + if ((err = rsa_decrypt_key(buf[1], z, buf[0], &zzz, (const unsigned char *)"testprog", 8, find_hash("sha1"), + &zz, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\nrsa_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; +#ifdef LTC_PROFILE + t2 <<= 11; + break; +#endif + } + t2 >>= 11; + fprintf(stderr, "RSA-%lu decrypt_key took %15"PRI64"u cycles\n", x, t2); + + t2 = 0; + for (y = 0; y < 256; y++) { + t_start(); + t1 = t_read(); + z = sizeof(buf[1]); + if ((err = rsa_sign_hash(buf[0], 20, buf[1], &z, &yarrow_prng, + find_prng("yarrow"), find_hash("sha1"), 8, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\nrsa_sign_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; +#ifdef LTC_PROFILE + t2 <<= 8; + break; +#endif + } + t2 >>= 8; + fprintf(stderr, "RSA-%lu sign_hash took %15"PRI64"u cycles\n", x, t2); + + t2 = 0; + for (y = 0; y < 2048; y++) { + t_start(); + t1 = t_read(); + if ((err = rsa_verify_hash(buf[1], z, buf[0], 20, find_hash("sha1"), 8, &stat, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\nrsa_verify_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + if (stat == 0) { + fprintf(stderr, "\n\nrsa_verify_hash for RSA-%lu failed to verify signature(%lu)\n", x, y); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; +#ifdef LTC_PROFILE + t2 <<= 11; + break; +#endif + } + t2 >>= 11; + fprintf(stderr, "RSA-%lu verify_hash took %15"PRI64"u cycles\n", x, t2); + fprintf(stderr, "\n\n"); + rsa_free(&key); + } +} +#else +static void time_rsa(void) { fprintf(stderr, "NO RSA\n"); } +#endif + +#ifdef LTC_MKAT +/* time various KAT operations */ +static void time_katja(void) +{ + katja_key key; + ulong64 t1, t2; + unsigned char buf[2][4096]; + unsigned long x, y, z, zzz; + int err, zz; + + for (x = 1024; x <= 2048; x += 256) { + t2 = 0; + for (y = 0; y < 4; y++) { + t_start(); + t1 = t_read(); + if ((err = katja_make_key(&yarrow_prng, find_prng("yarrow"), x/8, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\nkatja_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; + + if (y < 3) { + katja_free(&key); + } + } + t2 >>= 2; + fprintf(stderr, "Katja-%lu make_key took %15"PRI64"u cycles\n", x, t2); + + t2 = 0; + for (y = 0; y < 16; y++) { + t_start(); + t1 = t_read(); + z = sizeof(buf[1]); + if ((err = katja_encrypt_key(buf[0], 32, buf[1], &z, "testprog", 8, &yarrow_prng, + find_prng("yarrow"), find_hash("sha1"), + &key)) != CRYPT_OK) { + fprintf(stderr, "\n\nkatja_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; + } + t2 >>= 4; + fprintf(stderr, "Katja-%lu encrypt_key took %15"PRI64"u cycles\n", x, t2); + + t2 = 0; + for (y = 0; y < 2048; y++) { + t_start(); + t1 = t_read(); + zzz = sizeof(buf[0]); + if ((err = katja_decrypt_key(buf[1], z, buf[0], &zzz, "testprog", 8, find_hash("sha1"), + &zz, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\nkatja_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; + } + t2 >>= 11; + fprintf(stderr, "Katja-%lu decrypt_key took %15"PRI64"u cycles\n", x, t2); + + + katja_free(&key); + } +} +#else +static void time_katja(void) { fprintf(stderr, "NO Katja\n"); } +#endif + +#ifdef LTC_MECC +/* time various ECC operations */ +static void time_ecc(void) +{ + ecc_key key; + ulong64 t1, t2; + unsigned char buf[2][256]; + unsigned long i, w, x, y, z; + int err, stat; + static unsigned long sizes[] = { +#ifdef LTC_ECC112 +112/8, +#endif +#ifdef LTC_ECC128 +128/8, +#endif +#ifdef LTC_ECC160 +160/8, +#endif +#ifdef LTC_ECC192 +192/8, +#endif +#ifdef LTC_ECC224 +224/8, +#endif +#ifdef LTC_ECC256 +256/8, +#endif +#ifdef LTC_ECC384 +384/8, +#endif +#ifdef LTC_ECC521 +521/8, +#endif +100000}; + + for (x = sizes[i=0]; x < 100000; x = sizes[++i]) { + t2 = 0; + for (y = 0; y < 256; y++) { + t_start(); + t1 = t_read(); + if ((err = ecc_make_key(&yarrow_prng, find_prng("yarrow"), x, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\necc_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; + +#ifdef LTC_PROFILE + t2 <<= 8; + break; +#endif + + if (y < 255) { + ecc_free(&key); + } + } + t2 >>= 8; + fprintf(stderr, "ECC-%lu make_key took %15"PRI64"u cycles\n", x*8, t2); + + t2 = 0; + for (y = 0; y < 256; y++) { + t_start(); + t1 = t_read(); + z = sizeof(buf[1]); + if ((err = ecc_encrypt_key(buf[0], 20, buf[1], &z, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), + &key)) != CRYPT_OK) { + fprintf(stderr, "\n\necc_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; +#ifdef LTC_PROFILE + t2 <<= 8; + break; +#endif + } + t2 >>= 8; + fprintf(stderr, "ECC-%lu encrypt_key took %15"PRI64"u cycles\n", x*8, t2); + + t2 = 0; + for (y = 0; y < 256; y++) { + t_start(); + t1 = t_read(); + w = 20; + if ((err = ecc_decrypt_key(buf[1], z, buf[0], &w, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\necc_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; +#ifdef LTC_PROFILE + t2 <<= 8; + break; +#endif + } + t2 >>= 8; + fprintf(stderr, "ECC-%lu decrypt_key took %15"PRI64"u cycles\n", x*8, t2); + + t2 = 0; + for (y = 0; y < 256; y++) { + t_start(); + t1 = t_read(); + z = sizeof(buf[1]); + if ((err = ecc_sign_hash(buf[0], 20, buf[1], &z, &yarrow_prng, + find_prng("yarrow"), &key)) != CRYPT_OK) { + fprintf(stderr, "\n\necc_sign_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; +#ifdef LTC_PROFILE + t2 <<= 8; + break; +#endif + } + t2 >>= 8; + fprintf(stderr, "ECC-%lu sign_hash took %15"PRI64"u cycles\n", x*8, t2); + + t2 = 0; + for (y = 0; y < 256; y++) { + t_start(); + t1 = t_read(); + if ((err = ecc_verify_hash(buf[1], z, buf[0], 20, &stat, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\necc_verify_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + if (stat == 0) { + fprintf(stderr, "\n\necc_verify_hash for ECC-%lu failed to verify signature(%lu)\n", x*8, y); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; +#ifdef LTC_PROFILE + t2 <<= 8; + break; +#endif + } + t2 >>= 8; + fprintf(stderr, "ECC-%lu verify_hash took %15"PRI64"u cycles\n", x*8, t2); + + fprintf(stderr, "\n\n"); + ecc_free(&key); + } +} +#else +static void time_ecc(void) { fprintf(stderr, "NO ECC\n"); } +#endif + +static void time_macs_(unsigned long MAC_SIZE) +{ +#if defined(LTC_OMAC) || defined(LTC_XCBC) || defined(LTC_F9_MODE) || defined(LTC_PMAC) || defined(LTC_PELICAN) || defined(LTC_HMAC) + unsigned char *buf, key[16], tag[16]; + ulong64 t1, t2; + unsigned long x, z; + int err, cipher_idx, hash_idx; + + fprintf(stderr, "\nMAC Timings (cycles/byte on %luKB blocks):\n", MAC_SIZE); + + buf = XMALLOC(MAC_SIZE*1024); + if (buf == NULL) { + fprintf(stderr, "\n\nout of heap yo\n\n"); + exit(EXIT_FAILURE); + } + + cipher_idx = find_cipher("aes"); + hash_idx = find_hash("sha1"); + + if (cipher_idx == -1 || hash_idx == -1) { + fprintf(stderr, "Warning the MAC tests requires AES and SHA1 to operate... so sorry\n"); + exit(EXIT_FAILURE); + } + + yarrow_read(buf, MAC_SIZE*1024, &yarrow_prng); + yarrow_read(key, 16, &yarrow_prng); + +#ifdef LTC_OMAC + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = omac_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\n\nomac-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "OMAC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); +#endif + +#ifdef LTC_XCBC + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = xcbc_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\n\nxcbc-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "XCBC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); +#endif + +#ifdef LTC_F9_MODE + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = f9_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\n\nF9-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "F9-%s\t\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); +#endif + +#ifdef LTC_PMAC + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = pmac_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\n\npmac-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "PMAC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); +#endif + +#ifdef LTC_PELICAN + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = pelican_memory(key, 16, buf, MAC_SIZE*1024, tag)) != CRYPT_OK) { + fprintf(stderr, "\n\npelican error... %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "PELICAN \t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); +#endif + +#ifdef LTC_HMAC + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = hmac_memory(hash_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\n\nhmac-%s error... %s\n", hash_descriptor[hash_idx].name, error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "HMAC-%s\t\t%9"PRI64"u\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024)); +#endif + + XFREE(buf); +#else + LTC_UNUSED_PARAM(MAC_SIZE); + fprintf(stderr, "NO MACs\n"); +#endif +} + +static void time_macs(void) +{ + time_macs_(1); + time_macs_(4); + time_macs_(32); +} + +static void time_encmacs_(unsigned long MAC_SIZE) +{ +#if defined(LTC_EAX_MODE) || defined(LTC_OCB_MODE) || defined(LTC_OCB3_MODE) || defined(LTC_CCM_MODE) || defined(LTC_GCM_MODE) + unsigned char *buf, IV[16], key[16], tag[16]; + ulong64 t1, t2; + unsigned long x, z; + int err, cipher_idx; + symmetric_key skey; + + fprintf(stderr, "\nENC+MAC Timings (zero byte AAD, 16 byte IV, cycles/byte on %luKB blocks):\n", MAC_SIZE); + + buf = XMALLOC(MAC_SIZE*1024); + if (buf == NULL) { + fprintf(stderr, "\n\nout of heap yo\n\n"); + exit(EXIT_FAILURE); + } + + cipher_idx = find_cipher("aes"); + + yarrow_read(buf, MAC_SIZE*1024, &yarrow_prng); + yarrow_read(key, 16, &yarrow_prng); + yarrow_read(IV, 16, &yarrow_prng); + +#ifdef LTC_EAX_MODE + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = eax_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 16, NULL, 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\nEAX error... %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "EAX \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); +#endif + +#ifdef LTC_OCB_MODE + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = ocb_encrypt_authenticate_memory(cipher_idx, key, 16, IV, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\nOCB error... %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "OCB \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); +#endif + +#ifdef LTC_OCB3_MODE + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = ocb3_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 16, (unsigned char*)"", 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\nOCB3 error... %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "OCB3 \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); +#endif + +#ifdef LTC_CCM_MODE + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = ccm_memory(cipher_idx, key, 16, NULL, IV, 16, NULL, 0, buf, MAC_SIZE*1024, buf, tag, &z, CCM_ENCRYPT)) != CRYPT_OK) { + fprintf(stderr, "\nCCM error... %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "CCM (no-precomp) \t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); + + cipher_descriptor[cipher_idx].setup(key, 16, 0, &skey); + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = ccm_memory(cipher_idx, key, 16, &skey, IV, 16, NULL, 0, buf, MAC_SIZE*1024, buf, tag, &z, CCM_ENCRYPT)) != CRYPT_OK) { + fprintf(stderr, "\nCCM error... %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "CCM (precomp) \t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); + cipher_descriptor[cipher_idx].done(&skey); +#endif + +#ifdef LTC_GCM_MODE + t2 = -1; + for (x = 0; x < 100; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = gcm_memory(cipher_idx, key, 16, IV, 16, NULL, 0, buf, MAC_SIZE*1024, buf, tag, &z, GCM_ENCRYPT)) != CRYPT_OK) { + fprintf(stderr, "\nGCM error... %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "GCM (no-precomp)\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); + + { + gcm_state gcm +#ifdef LTC_GCM_TABLES_SSE2 +__attribute__ ((aligned (16))) +#endif +; + + if ((err = gcm_init(&gcm, cipher_idx, key, 16)) != CRYPT_OK) { fprintf(stderr, "gcm_init: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } + t2 = -1; + for (x = 0; x < 10000; x++) { + t_start(); + t1 = t_read(); + z = 16; + if ((err = gcm_reset(&gcm)) != CRYPT_OK) { + fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); + exit(EXIT_FAILURE); + } + if ((err = gcm_add_iv(&gcm, IV, 16)) != CRYPT_OK) { + fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); + exit(EXIT_FAILURE); + } + if ((err = gcm_add_aad(&gcm, NULL, 0)) != CRYPT_OK) { + fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); + exit(EXIT_FAILURE); + } + if ((err = gcm_process(&gcm, buf, MAC_SIZE*1024, buf, GCM_ENCRYPT)) != CRYPT_OK) { + fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); + exit(EXIT_FAILURE); + } + + if ((err = gcm_done(&gcm, tag, &z)) != CRYPT_OK) { + fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + if (t1 < t2) t2 = t1; + } + fprintf(stderr, "GCM (precomp)\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); + } + +#endif +#else + LTC_UNUSED_PARAM(MAC_SIZE); + fprintf(stderr, "NO ENCMACs\n"); +#endif + +} + +static void time_encmacs(void) +{ + time_encmacs_(1); + time_encmacs_(4); + time_encmacs_(32); +} int main(void) { @@ -29,10 +1368,9 @@ time_prng(); time_mult(); time_sqr(); time_rsa(); +time_dsa(); time_ecc(); -#ifdef USE_LTM time_katja(); -#endif return EXIT_SUCCESS; } diff --git a/helper.pl b/helper.pl index 6bba34487..e468b2fb6 100755 --- a/helper.pl +++ b/helper.pl @@ -239,7 +239,7 @@ sub process_makefiles { my @all = (); find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src'); my @t = qw(); - find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|test_driver|x86_prof|_tests?).c$/ } }, 'testprof'); + find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?).c$/ } }, 'testprof'); my @o = sort ('src/ciphers/aes/aes_enc.o', map { my $x = $_; $x =~ s/\.c$/.o/; $x } @c); my $var_o = prepare_variable("OBJECTS", @o); diff --git a/makefile b/makefile index 6bb734260..5454e1fe0 100644 --- a/makefile +++ b/makefile @@ -71,11 +71,11 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -timing: $(LIBNAME) $(LIBTEST) $(TIMINGS) +timing: $(LIBNAME) $(TIMINGS) testprof/common.o ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TIMINGS) $(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) + ${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/common.o $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) test: $(LIBNAME) $(LIBTEST) $(TESTS) ifneq ($V,1) diff --git a/makefile.mingw b/makefile.mingw index af578251b..60e84b2d0 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -193,7 +193,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/timing_test.o +testprof/store_test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -251,7 +251,7 @@ tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ #Tests + timing tests -timing.exe: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) +timing.exe: demos/timing.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: timing.exe test.exe: demos/test.o $(LIBTEST_S) $(LIBMAIN_S) diff --git a/makefile.msvc b/makefile.msvc index 8a406cff8..acd1a62f9 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -186,7 +186,7 @@ testprof/dh_test.obj testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_t testprof/mac_test.obj testprof/misc_test.obj testprof/modes_test.obj testprof/multi_test.obj testprof/no_prng.obj \ testprof/pkcs_1_eme_test.obj testprof/pkcs_1_emsa_test.obj testprof/pkcs_1_oaep_test.obj \ testprof/pkcs_1_pss_test.obj testprof/pkcs_1_test.obj testprof/rotate_test.obj testprof/rsa_test.obj \ -testprof/store_test.obj testprof/timing_test.obj +testprof/store_test.obj #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile.shared b/makefile.shared index e0eb1139a..78d925456 100644 --- a/makefile.shared +++ b/makefile.shared @@ -54,8 +54,8 @@ install_test: .common_install_test test: $(LIBNAME) $(LIBTEST) $(TESTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -timing: $(LIBNAME) $(LIBTEST) $(TIMINGS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) +timing: $(TIMINGS) testprof/common.o $(LIBNAME) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $? $(EXTRALIBS) # build the demos from a template define DEMO_template diff --git a/makefile.unix b/makefile.unix index 1e1badb05..84733a9e9 100644 --- a/makefile.unix +++ b/makefile.unix @@ -198,7 +198,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/timing_test.o +testprof/store_test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -253,7 +253,7 @@ tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ #Tests + timing tests -timing: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) +timing: demos/timing.o testprof/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the timing tests by: ./timing" test: demos/test.o $(LIBTEST_S) $(LIBMAIN_S) diff --git a/makefile_include.mk b/makefile_include.mk index 096460f3d..828e1cbf5 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -296,7 +296,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/timing_test.o +testprof/store_test.o # The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/testprof/common.h b/testprof/common.h index 7e67ee304..05a3977d9 100644 --- a/testprof/common.h +++ b/testprof/common.h @@ -3,6 +3,12 @@ #include +#if defined(_WIN32) + #define PRI64 "I64d" +#else + #define PRI64 "ll" +#endif + extern prng_state yarrow_prng; #ifdef LTC_VERBOSE diff --git a/testprof/timing_test.c b/testprof/timing_test.c deleted file mode 100644 index ec61e9240..000000000 --- a/testprof/timing_test.c +++ /dev/null @@ -1,1333 +0,0 @@ -#include - -struct list results[100]; -int no_results; -int sorter(const void *a, const void *b) -{ - const struct list *A, *B; - A = a; - B = b; - if (A->avg < B->avg) return -1; - if (A->avg > B->avg) return 1; - return 0; -} - -void tally_results(int type) -{ - int x; - - /* qsort the results */ - qsort(results, no_results, sizeof(struct list), &sorter); - - fprintf(stderr, "\n"); - if (type == 0) { - for (x = 0; x < no_results; x++) { - fprintf(stderr, "%-20s: Schedule at %6lu\n", cipher_descriptor[results[x].id].name, (unsigned long)results[x].spd1); - } - } else if (type == 1) { - for (x = 0; x < no_results; x++) { - printf - ("%-20s[%3d]: Encrypt at %5"PRI64"u, Decrypt at %5"PRI64"u\n", cipher_descriptor[results[x].id].name, cipher_descriptor[results[x].id].ID, results[x].spd1, results[x].spd2); - } - } else { - for (x = 0; x < no_results; x++) { - printf - ("%-20s: Process at %5"PRI64"u\n", hash_descriptor[results[x].id].name, results[x].spd1 / 1000); - } - } -} - -/* RDTSC from Scott Duplichan */ -ulong64 rdtsc (void) - { - #if defined __GNUC__ && !defined(LTC_NO_ASM) - #if defined(__i386__) || defined(__x86_64__) - /* version from http://www.mcs.anl.gov/~kazutomo/rdtsc.html - * the old code always got a warning issued by gcc, clang did not complain... - */ - unsigned hi, lo; - __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); - return ((ulong64)lo)|( ((ulong64)hi)<<32); - #elif defined(LTC_PPC32) || defined(TFM_PPC32) - unsigned long a, b; - __asm__ __volatile__ ("mftbu %1 \nmftb %0\n":"=r"(a), "=r"(b)); - return (((ulong64)b) << 32ULL) | ((ulong64)a); - #elif defined(__ia64__) /* gcc-IA64 version */ - unsigned long result; - __asm__ __volatile__("mov %0=ar.itc" : "=r"(result) :: "memory"); - while (__builtin_expect ((int) result == -1, 0)) - __asm__ __volatile__("mov %0=ar.itc" : "=r"(result) :: "memory"); - return result; - #elif defined(__sparc__) - #if defined(__arch64__) - ulong64 a; - asm volatile("rd %%tick,%0" : "=r" (a)); - return a; - #else - register unsigned long x, y; - __asm__ __volatile__ ("rd %%tick, %0; clruw %0, %1; srlx %0, 32, %0" : "=r" (x), "=r" (y) : "0" (x), "1" (y)); - return ((unsigned long long) x << 32) | y; - #endif - #else - return XCLOCK(); - #endif - - /* Microsoft and Intel Windows compilers */ - #elif defined _M_IX86 && !defined(LTC_NO_ASM) - __asm rdtsc - #elif defined _M_AMD64 && !defined(LTC_NO_ASM) - return __rdtsc (); - #elif defined _M_IA64 && !defined(LTC_NO_ASM) - #if defined __INTEL_COMPILER - #include - #endif - return __getReg (3116); - #else - return XCLOCK(); - #endif - } - -static ulong64 timer, skew = 0; - -void t_start(void) -{ - timer = rdtsc(); -} - -ulong64 t_read(void) -{ - return rdtsc() - timer; -} - -void init_timer(void) -{ - ulong64 c1, c2, t1, t2; - unsigned long y1; - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < TIMES*100; y1++) { - t_start(); - t1 = t_read(); - t2 = (t_read() - t1)>>1; - - c1 = (t1 > c1) ? t1 : c1; - c2 = (t2 > c2) ? t2 : c2; - } - skew = c2 - c1; - fprintf(stderr, "Clock Skew: %lu\n", (unsigned long)skew); -} - -int time_keysched(void) -{ - unsigned long x, y1; - ulong64 t1, c1; - symmetric_key skey; - int kl; - int (*func) (const unsigned char *, int , int , symmetric_key *); - unsigned char key[MAXBLOCKSIZE]; - - fprintf(stderr, "\n\nKey Schedule Time Trials for the Symmetric Ciphers:\n(Times are cycles per key)\n"); - no_results = 0; - for (x = 0; cipher_descriptor[x].name != NULL; x++) { -#define DO1(k) func(k, kl, 0, &skey); - - func = cipher_descriptor[x].setup; - kl = cipher_descriptor[x].min_key_length; - c1 = (ulong64)-1; - for (y1 = 0; y1 < KTIMES; y1++) { - yarrow_read(key, kl, &yarrow_prng); - t_start(); - DO1(key); - t1 = t_read(); - c1 = (t1 > c1) ? c1 : t1; - } - t1 = c1 - skew; - results[no_results].spd1 = results[no_results].avg = t1; - results[no_results++].id = x; - fprintf(stderr, "."); fflush(stdout); - -#undef DO1 - } - tally_results(0); - - return 0; -} - -#ifdef LTC_ECB_MODE -int time_cipher_ecb(void) -{ - unsigned long x, y1; - ulong64 t1, t2, c1, c2, a1, a2; - symmetric_ECB ecb; - unsigned char key[MAXBLOCKSIZE], pt[4096]; - int err; - - fprintf(stderr, "\n\nECB Time Trials for the Symmetric Ciphers:\n"); - no_results = 0; - for (x = 0; cipher_descriptor[x].name != NULL; x++) { - ecb_start(x, key, cipher_descriptor[x].min_key_length, 0, &ecb); - - /* sanity check on cipher */ - if ((err = cipher_descriptor[x].test()) != CRYPT_OK) { - fprintf(stderr, "\n\nERROR: Cipher %s failed self-test %s\n", cipher_descriptor[x].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - -#define DO1 ecb_encrypt(pt, pt, sizeof(pt), &ecb); -#define DO2 DO1 DO1 - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < 100; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read(); - t2 -= t1; - - c1 = (t1 > c1 ? c1 : t1); - c2 = (t2 > c2 ? c2 : t2); - } - a1 = c2 - c1 - skew; - -#undef DO1 -#undef DO2 -#define DO1 ecb_decrypt(pt, pt, sizeof(pt), &ecb); -#define DO2 DO1 DO1 - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < 100; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read(); - t2 -= t1; - - c1 = (t1 > c1 ? c1 : t1); - c2 = (t2 > c2 ? c2 : t2); - } - a2 = c2 - c1 - skew; - ecb_done(&ecb); - - results[no_results].id = x; - results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; - ++no_results; - fprintf(stderr, "."); fflush(stdout); - -#undef DO2 -#undef DO1 - } - tally_results(1); - - return 0; -} -#else -int time_cipher_ecb(void) { fprintf(stderr, "NO ECB\n"); return 0; } -#endif - -#ifdef LTC_CBC_MODE -int time_cipher_cbc(void) -{ - unsigned long x, y1; - ulong64 t1, t2, c1, c2, a1, a2; - symmetric_CBC cbc; - unsigned char key[MAXBLOCKSIZE], pt[4096]; - int err; - - fprintf(stderr, "\n\nCBC Time Trials for the Symmetric Ciphers:\n"); - no_results = 0; - for (x = 0; cipher_descriptor[x].name != NULL; x++) { - cbc_start(x, pt, key, cipher_descriptor[x].min_key_length, 0, &cbc); - - /* sanity check on cipher */ - if ((err = cipher_descriptor[x].test()) != CRYPT_OK) { - fprintf(stderr, "\n\nERROR: Cipher %s failed self-test %s\n", cipher_descriptor[x].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - -#define DO1 cbc_encrypt(pt, pt, sizeof(pt), &cbc); -#define DO2 DO1 DO1 - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < 100; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read(); - t2 -= t1; - - c1 = (t1 > c1 ? c1 : t1); - c2 = (t2 > c2 ? c2 : t2); - } - a1 = c2 - c1 - skew; - -#undef DO1 -#undef DO2 -#define DO1 cbc_decrypt(pt, pt, sizeof(pt), &cbc); -#define DO2 DO1 DO1 - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < 100; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read(); - t2 -= t1; - - c1 = (t1 > c1 ? c1 : t1); - c2 = (t2 > c2 ? c2 : t2); - } - a2 = c2 - c1 - skew; - cbc_done(&cbc); - - results[no_results].id = x; - results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; - ++no_results; - fprintf(stderr, "."); fflush(stdout); - -#undef DO2 -#undef DO1 - } - tally_results(1); - - return 0; -} -#else -int time_cipher_cbc(void) { fprintf(stderr, "NO CBC\n"); return 0; } -#endif - -#ifdef LTC_CTR_MODE -int time_cipher_ctr(void) -{ - unsigned long x, y1; - ulong64 t1, t2, c1, c2, a1, a2; - symmetric_CTR ctr; - unsigned char key[MAXBLOCKSIZE], pt[4096]; - int err; - - fprintf(stderr, "\n\nCTR Time Trials for the Symmetric Ciphers:\n"); - no_results = 0; - for (x = 0; cipher_descriptor[x].name != NULL; x++) { - ctr_start(x, pt, key, cipher_descriptor[x].min_key_length, 0, CTR_COUNTER_LITTLE_ENDIAN, &ctr); - - /* sanity check on cipher */ - if ((err = cipher_descriptor[x].test()) != CRYPT_OK) { - fprintf(stderr, "\n\nERROR: Cipher %s failed self-test %s\n", cipher_descriptor[x].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - -#define DO1 ctr_encrypt(pt, pt, sizeof(pt), &ctr); -#define DO2 DO1 DO1 - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < 100; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read(); - t2 -= t1; - - c1 = (t1 > c1 ? c1 : t1); - c2 = (t2 > c2 ? c2 : t2); - } - a1 = c2 - c1 - skew; - -#undef DO1 -#undef DO2 -#define DO1 ctr_decrypt(pt, pt, sizeof(pt), &ctr); -#define DO2 DO1 DO1 - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < 100; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read(); - t2 -= t1; - - c1 = (t1 > c1 ? c1 : t1); - c2 = (t2 > c2 ? c2 : t2); - } - a2 = c2 - c1 - skew; - ctr_done(&ctr); - - results[no_results].id = x; - results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; - ++no_results; - fprintf(stderr, "."); fflush(stdout); - -#undef DO2 -#undef DO1 - } - tally_results(1); - - return 0; -} -#else -int time_cipher_ctr(void) { fprintf(stderr, "NO CTR\n"); return 0; } -#endif - -#ifdef LTC_LRW_MODE -int time_cipher_lrw(void) -{ - unsigned long x, y1; - ulong64 t1, t2, c1, c2, a1, a2; - symmetric_LRW lrw; - unsigned char key[MAXBLOCKSIZE], pt[4096]; - int err; - - fprintf(stderr, "\n\nLRW Time Trials for the Symmetric Ciphers:\n"); - no_results = 0; - for (x = 0; cipher_descriptor[x].name != NULL; x++) { - if (cipher_descriptor[x].block_length != 16) continue; - lrw_start(x, pt, key, cipher_descriptor[x].min_key_length, key, 0, &lrw); - - /* sanity check on cipher */ - if ((err = cipher_descriptor[x].test()) != CRYPT_OK) { - fprintf(stderr, "\n\nERROR: Cipher %s failed self-test %s\n", cipher_descriptor[x].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - -#define DO1 lrw_encrypt(pt, pt, sizeof(pt), &lrw); -#define DO2 DO1 DO1 - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < 100; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read(); - t2 -= t1; - - c1 = (t1 > c1 ? c1 : t1); - c2 = (t2 > c2 ? c2 : t2); - } - a1 = c2 - c1 - skew; - -#undef DO1 -#undef DO2 -#define DO1 lrw_decrypt(pt, pt, sizeof(pt), &lrw); -#define DO2 DO1 DO1 - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < 100; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read(); - t2 -= t1; - - c1 = (t1 > c1 ? c1 : t1); - c2 = (t2 > c2 ? c2 : t2); - } - a2 = c2 - c1 - skew; - - lrw_done(&lrw); - - results[no_results].id = x; - results[no_results].spd1 = a1/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].spd2 = a2/(sizeof(pt)/cipher_descriptor[x].block_length); - results[no_results].avg = (results[no_results].spd1 + results[no_results].spd2+1)/2; - ++no_results; - fprintf(stderr, "."); fflush(stdout); - -#undef DO2 -#undef DO1 - } - tally_results(1); - - return 0; -} -#else -int time_cipher_lrw(void) { fprintf(stderr, "NO LRW\n"); return 0; } -#endif - - -int time_hash(void) -{ - unsigned long x, y1, len; - ulong64 t1, t2, c1, c2; - hash_state md; - int (*func)(hash_state *, const unsigned char *, unsigned long), err; - unsigned char pt[MAXBLOCKSIZE]; - - - fprintf(stderr, "\n\nHASH Time Trials for:\n"); - no_results = 0; - for (x = 0; hash_descriptor[x].name != NULL; x++) { - - /* sanity check on hash */ - if ((err = hash_descriptor[x].test()) != CRYPT_OK) { - fprintf(stderr, "\n\nERROR: Hash %s failed self-test %s\n", hash_descriptor[x].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - - hash_descriptor[x].init(&md); - -#define DO1 func(&md,pt,len); -#define DO2 DO1 DO1 - - func = hash_descriptor[x].process; - len = hash_descriptor[x].blocksize; - - c1 = c2 = (ulong64)-1; - for (y1 = 0; y1 < TIMES; y1++) { - t_start(); - DO1; - t1 = t_read(); - DO2; - t2 = t_read() - t1; - c1 = (t1 > c1) ? c1 : t1; - c2 = (t2 > c2) ? c2 : t2; - } - t1 = c2 - c1 - skew; - t1 = ((t1 * CONST64(1000))) / ((ulong64)hash_descriptor[x].blocksize); - results[no_results].id = x; - results[no_results].spd1 = results[no_results].avg = t1; - ++no_results; - fprintf(stderr, "."); fflush(stdout); -#undef DO2 -#undef DO1 - } - tally_results(2); - - return 0; -} - -/*#warning you need an mp_rand!!!*/ -#ifndef USE_LTM - #undef LTC_MPI -#endif - -#ifdef LTC_MPI -void time_mult(void) -{ - ulong64 t1, t2; - unsigned long x, y; - void *a, *b, *c; - - fprintf(stderr, "Timing Multiplying:\n"); - mp_init_multi(&a,&b,&c,NULL); - for (x = 128/MP_DIGIT_BIT; x <= (unsigned long)1536/MP_DIGIT_BIT; x += 128/MP_DIGIT_BIT) { - mp_rand(a, x); - mp_rand(b, x); - -#define DO1 mp_mul(a, b, c); -#define DO2 DO1; DO1; - - t2 = -1; - for (y = 0; y < TIMES; y++) { - t_start(); - t1 = t_read(); - DO2; - t1 = (t_read() - t1)>>1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "%4lu bits: %9"PRI64"u cycles\n", x*MP_DIGIT_BIT, t2); - } - mp_clear_multi(a,b,c,NULL); - -#undef DO1 -#undef DO2 -} - -void time_sqr(void) -{ - ulong64 t1, t2; - unsigned long x, y; - void *a, *b; - - fprintf(stderr, "Timing Squaring:\n"); - mp_init_multi(&a,&b,NULL); - for (x = 128/MP_DIGIT_BIT; x <= (unsigned long)1536/MP_DIGIT_BIT; x += 128/MP_DIGIT_BIT) { - mp_rand(a, x); - -#define DO1 mp_sqr(a, b); -#define DO2 DO1; DO1; - - t2 = -1; - for (y = 0; y < TIMES; y++) { - t_start(); - t1 = t_read(); - DO2; - t1 = (t_read() - t1)>>1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "%4lu bits: %9"PRI64"u cycles\n", x*MP_DIGIT_BIT, t2); - } - mp_clear_multi(a,b,NULL); - -#undef DO1 -#undef DO2 -} -#else -void time_mult(void) { fprintf(stderr, "NO MULT\n"); } -void time_sqr(void) { fprintf(stderr, "NO SQR\n"); } -#endif - -void time_prng(void) -{ - ulong64 t1, t2; - unsigned char buf[4096]; - prng_state tprng; - unsigned long x, y; - int err; - - fprintf(stderr, "Timing PRNGs (cycles/byte output, cycles add_entropy (32 bytes) :\n"); - for (x = 0; prng_descriptor[x].name != NULL; x++) { - - /* sanity check on prng */ - if ((err = prng_descriptor[x].test()) != CRYPT_OK) { - fprintf(stderr, "\n\nERROR: PRNG %s failed self-test %s\n", prng_descriptor[x].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - - prng_descriptor[x].start(&tprng); - zeromem(buf, 256); - prng_descriptor[x].add_entropy(buf, 256, &tprng); - prng_descriptor[x].ready(&tprng); - t2 = -1; - -#define DO1 if (prng_descriptor[x].read(buf, 4096, &tprng) != 4096) { fprintf(stderr, "\n\nERROR READ != 4096\n\n"); exit(EXIT_FAILURE); } -#define DO2 DO1 DO1 - for (y = 0; y < 10000; y++) { - t_start(); - t1 = t_read(); - DO2; - t1 = (t_read() - t1)>>1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "%20s: %5"PRI64"u ", prng_descriptor[x].name, t2>>12); -#undef DO2 -#undef DO1 - -#define DO1 prng_descriptor[x].start(&tprng); prng_descriptor[x].add_entropy(buf, 32, &tprng); prng_descriptor[x].ready(&tprng); prng_descriptor[x].done(&tprng); -#define DO2 DO1 DO1 - for (y = 0; y < 10000; y++) { - t_start(); - t1 = t_read(); - DO2; - t1 = (t_read() - t1)>>1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "%5"PRI64"u\n", t2); -#undef DO2 -#undef DO1 - - } -} - -#ifdef LTC_MDSA -/* time various DSA operations */ -void time_dsa(void) -{ - dsa_key key; - ulong64 t1, t2; - unsigned long x, y; - int err; -static const struct { - int group, modulus; -} groups[] = { -{ 20, 96 }, -{ 20, 128 }, -{ 24, 192 }, -{ 28, 256 }, -{ 32, 512 } -}; - - for (x = 0; x < (sizeof(groups)/sizeof(groups[0])); x++) { - t2 = 0; - for (y = 0; y < 4; y++) { - t_start(); - t1 = t_read(); - if ((err = dsa_make_key(&yarrow_prng, find_prng("yarrow"), groups[x].group, groups[x].modulus, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\ndsa_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; - -#ifdef LTC_PROFILE - t2 <<= 2; - break; -#endif - if (y < 3) { - dsa_free(&key); - } - } - t2 >>= 2; - fprintf(stderr, "DSA-(%lu, %lu) make_key took %15"PRI64"u cycles\n", (unsigned long)groups[x].group*8, (unsigned long)groups[x].modulus*8, t2); - } -} -#endif - - -#ifdef LTC_MRSA -/* time various RSA operations */ -void time_rsa(void) -{ - rsa_key key; - ulong64 t1, t2; - unsigned char buf[2][2048]; - unsigned long x, y, z, zzz; - int err, zz, stat; - - for (x = 1024; x <= 2048; x += 256) { - t2 = 0; - for (y = 0; y < 4; y++) { - t_start(); - t1 = t_read(); - if ((err = rsa_make_key(&yarrow_prng, find_prng("yarrow"), x/8, 65537, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\nrsa_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; - -#ifdef LTC_PROFILE - t2 <<= 2; - break; -#endif - - if (y < 3) { - rsa_free(&key); - } - } - t2 >>= 2; - fprintf(stderr, "RSA-%lu make_key took %15"PRI64"u cycles\n", x, t2); - - t2 = 0; - for (y = 0; y < 16; y++) { - t_start(); - t1 = t_read(); - z = sizeof(buf[1]); - if ((err = rsa_encrypt_key(buf[0], 32, buf[1], &z, (const unsigned char *)"testprog", 8, &yarrow_prng, - find_prng("yarrow"), find_hash("sha1"), - &key)) != CRYPT_OK) { - fprintf(stderr, "\n\nrsa_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; -#ifdef LTC_PROFILE - t2 <<= 4; - break; -#endif - } - t2 >>= 4; - fprintf(stderr, "RSA-%lu encrypt_key took %15"PRI64"u cycles\n", x, t2); - - t2 = 0; - for (y = 0; y < 2048; y++) { - t_start(); - t1 = t_read(); - zzz = sizeof(buf[0]); - if ((err = rsa_decrypt_key(buf[1], z, buf[0], &zzz, (const unsigned char *)"testprog", 8, find_hash("sha1"), - &zz, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\nrsa_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; -#ifdef LTC_PROFILE - t2 <<= 11; - break; -#endif - } - t2 >>= 11; - fprintf(stderr, "RSA-%lu decrypt_key took %15"PRI64"u cycles\n", x, t2); - - t2 = 0; - for (y = 0; y < 256; y++) { - t_start(); - t1 = t_read(); - z = sizeof(buf[1]); - if ((err = rsa_sign_hash(buf[0], 20, buf[1], &z, &yarrow_prng, - find_prng("yarrow"), find_hash("sha1"), 8, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\nrsa_sign_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; -#ifdef LTC_PROFILE - t2 <<= 8; - break; -#endif - } - t2 >>= 8; - fprintf(stderr, "RSA-%lu sign_hash took %15"PRI64"u cycles\n", x, t2); - - t2 = 0; - for (y = 0; y < 2048; y++) { - t_start(); - t1 = t_read(); - if ((err = rsa_verify_hash(buf[1], z, buf[0], 20, find_hash("sha1"), 8, &stat, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\nrsa_verify_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - if (stat == 0) { - fprintf(stderr, "\n\nrsa_verify_hash for RSA-%lu failed to verify signature(%lu)\n", x, y); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; -#ifdef LTC_PROFILE - t2 <<= 11; - break; -#endif - } - t2 >>= 11; - fprintf(stderr, "RSA-%lu verify_hash took %15"PRI64"u cycles\n", x, t2); - fprintf(stderr, "\n\n"); - rsa_free(&key); - } -} -#else -void time_rsa(void) { fprintf(stderr, "NO RSA\n"); } -#endif - -#ifdef LTC_MKAT -/* time various KAT operations */ -void time_katja(void) -{ - katja_key key; - ulong64 t1, t2; - unsigned char buf[2][4096]; - unsigned long x, y, z, zzz; - int err, zz; - - for (x = 1024; x <= 2048; x += 256) { - t2 = 0; - for (y = 0; y < 4; y++) { - t_start(); - t1 = t_read(); - if ((err = katja_make_key(&yarrow_prng, find_prng("yarrow"), x/8, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\nkatja_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; - - if (y < 3) { - katja_free(&key); - } - } - t2 >>= 2; - fprintf(stderr, "Katja-%lu make_key took %15"PRI64"u cycles\n", x, t2); - - t2 = 0; - for (y = 0; y < 16; y++) { - t_start(); - t1 = t_read(); - z = sizeof(buf[1]); - if ((err = katja_encrypt_key(buf[0], 32, buf[1], &z, "testprog", 8, &yarrow_prng, - find_prng("yarrow"), find_hash("sha1"), - &key)) != CRYPT_OK) { - fprintf(stderr, "\n\nkatja_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; - } - t2 >>= 4; - fprintf(stderr, "Katja-%lu encrypt_key took %15"PRI64"u cycles\n", x, t2); - - t2 = 0; - for (y = 0; y < 2048; y++) { - t_start(); - t1 = t_read(); - zzz = sizeof(buf[0]); - if ((err = katja_decrypt_key(buf[1], z, buf[0], &zzz, "testprog", 8, find_hash("sha1"), - &zz, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\nkatja_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; - } - t2 >>= 11; - fprintf(stderr, "Katja-%lu decrypt_key took %15"PRI64"u cycles\n", x, t2); - - - katja_free(&key); - } -} -#else -void time_katja(void) { fprintf(stderr, "NO Katja\n"); } -#endif - -#ifdef LTC_MECC -/* time various ECC operations */ -void time_ecc(void) -{ - ecc_key key; - ulong64 t1, t2; - unsigned char buf[2][256]; - unsigned long i, w, x, y, z; - int err, stat; - static unsigned long sizes[] = { -#ifdef LTC_ECC112 -112/8, -#endif -#ifdef LTC_ECC128 -128/8, -#endif -#ifdef LTC_ECC160 -160/8, -#endif -#ifdef LTC_ECC192 -192/8, -#endif -#ifdef LTC_ECC224 -224/8, -#endif -#ifdef LTC_ECC256 -256/8, -#endif -#ifdef LTC_ECC384 -384/8, -#endif -#ifdef LTC_ECC521 -521/8, -#endif -100000}; - - for (x = sizes[i=0]; x < 100000; x = sizes[++i]) { - t2 = 0; - for (y = 0; y < 256; y++) { - t_start(); - t1 = t_read(); - if ((err = ecc_make_key(&yarrow_prng, find_prng("yarrow"), x, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\necc_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; - -#ifdef LTC_PROFILE - t2 <<= 8; - break; -#endif - - if (y < 255) { - ecc_free(&key); - } - } - t2 >>= 8; - fprintf(stderr, "ECC-%lu make_key took %15"PRI64"u cycles\n", x*8, t2); - - t2 = 0; - for (y = 0; y < 256; y++) { - t_start(); - t1 = t_read(); - z = sizeof(buf[1]); - if ((err = ecc_encrypt_key(buf[0], 20, buf[1], &z, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), - &key)) != CRYPT_OK) { - fprintf(stderr, "\n\necc_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; -#ifdef LTC_PROFILE - t2 <<= 8; - break; -#endif - } - t2 >>= 8; - fprintf(stderr, "ECC-%lu encrypt_key took %15"PRI64"u cycles\n", x*8, t2); - - t2 = 0; - for (y = 0; y < 256; y++) { - t_start(); - t1 = t_read(); - w = 20; - if ((err = ecc_decrypt_key(buf[1], z, buf[0], &w, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\necc_decrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; -#ifdef LTC_PROFILE - t2 <<= 8; - break; -#endif - } - t2 >>= 8; - fprintf(stderr, "ECC-%lu decrypt_key took %15"PRI64"u cycles\n", x*8, t2); - - t2 = 0; - for (y = 0; y < 256; y++) { - t_start(); - t1 = t_read(); - z = sizeof(buf[1]); - if ((err = ecc_sign_hash(buf[0], 20, buf[1], &z, &yarrow_prng, - find_prng("yarrow"), &key)) != CRYPT_OK) { - fprintf(stderr, "\n\necc_sign_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; -#ifdef LTC_PROFILE - t2 <<= 8; - break; -#endif - } - t2 >>= 8; - fprintf(stderr, "ECC-%lu sign_hash took %15"PRI64"u cycles\n", x*8, t2); - - t2 = 0; - for (y = 0; y < 256; y++) { - t_start(); - t1 = t_read(); - if ((err = ecc_verify_hash(buf[1], z, buf[0], 20, &stat, &key)) != CRYPT_OK) { - fprintf(stderr, "\n\necc_verify_hash says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - if (stat == 0) { - fprintf(stderr, "\n\necc_verify_hash for ECC-%lu failed to verify signature(%lu)\n", x*8, y); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; -#ifdef LTC_PROFILE - t2 <<= 8; - break; -#endif - } - t2 >>= 8; - fprintf(stderr, "ECC-%lu verify_hash took %15"PRI64"u cycles\n", x*8, t2); - - fprintf(stderr, "\n\n"); - ecc_free(&key); - } -} -#else -void time_ecc(void) { fprintf(stderr, "NO ECC\n"); } -#endif - -void time_macs_(unsigned long MAC_SIZE) -{ -#if defined(LTC_OMAC) || defined(LTC_XCBC) || defined(LTC_F9_MODE) || defined(LTC_PMAC) || defined(LTC_PELICAN) || defined(LTC_HMAC) - unsigned char *buf, key[16], tag[16]; - ulong64 t1, t2; - unsigned long x, z; - int err, cipher_idx, hash_idx; - - fprintf(stderr, "\nMAC Timings (cycles/byte on %luKB blocks):\n", MAC_SIZE); - - buf = XMALLOC(MAC_SIZE*1024); - if (buf == NULL) { - fprintf(stderr, "\n\nout of heap yo\n\n"); - exit(EXIT_FAILURE); - } - - cipher_idx = find_cipher("aes"); - hash_idx = find_hash("sha1"); - - if (cipher_idx == -1 || hash_idx == -1) { - fprintf(stderr, "Warning the MAC tests requires AES and SHA1 to operate... so sorry\n"); - exit(EXIT_FAILURE); - } - - yarrow_read(buf, MAC_SIZE*1024, &yarrow_prng); - yarrow_read(key, 16, &yarrow_prng); - -#ifdef LTC_OMAC - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = omac_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\nomac-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "OMAC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); -#endif - -#ifdef LTC_XCBC - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = xcbc_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\nxcbc-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "XCBC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); -#endif - -#ifdef LTC_F9_MODE - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = f9_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\nF9-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "F9-%s\t\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); -#endif - -#ifdef LTC_PMAC - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = pmac_memory(cipher_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\npmac-%s error... %s\n", cipher_descriptor[cipher_idx].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "PMAC-%s\t\t%9"PRI64"u\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); -#endif - -#ifdef LTC_PELICAN - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = pelican_memory(key, 16, buf, MAC_SIZE*1024, tag)) != CRYPT_OK) { - fprintf(stderr, "\n\npelican error... %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "PELICAN \t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); -#endif - -#ifdef LTC_HMAC - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = hmac_memory(hash_idx, key, 16, buf, MAC_SIZE*1024, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\n\nhmac-%s error... %s\n", hash_descriptor[hash_idx].name, error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "HMAC-%s\t\t%9"PRI64"u\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024)); -#endif - - XFREE(buf); -#else - LTC_UNUSED_PARAM(MAC_SIZE); - fprintf(stderr, "NO MACs\n"); -#endif -} - -void time_macs(void) -{ - time_macs_(1); - time_macs_(4); - time_macs_(32); -} - -static void time_encmacs_(unsigned long MAC_SIZE) -{ -#if defined(LTC_EAX_MODE) || defined(LTC_OCB_MODE) || defined(LTC_OCB3_MODE) || defined(LTC_CCM_MODE) || defined(LTC_GCM_MODE) - unsigned char *buf, IV[16], key[16], tag[16]; - ulong64 t1, t2; - unsigned long x, z; - int err, cipher_idx; - symmetric_key skey; - - fprintf(stderr, "\nENC+MAC Timings (zero byte AAD, 16 byte IV, cycles/byte on %luKB blocks):\n", MAC_SIZE); - - buf = XMALLOC(MAC_SIZE*1024); - if (buf == NULL) { - fprintf(stderr, "\n\nout of heap yo\n\n"); - exit(EXIT_FAILURE); - } - - cipher_idx = find_cipher("aes"); - - yarrow_read(buf, MAC_SIZE*1024, &yarrow_prng); - yarrow_read(key, 16, &yarrow_prng); - yarrow_read(IV, 16, &yarrow_prng); - -#ifdef LTC_EAX_MODE - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = eax_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 16, NULL, 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\nEAX error... %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "EAX \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); -#endif - -#ifdef LTC_OCB_MODE - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = ocb_encrypt_authenticate_memory(cipher_idx, key, 16, IV, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\nOCB error... %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "OCB \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); -#endif - -#ifdef LTC_OCB3_MODE - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = ocb3_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 16, (unsigned char*)"", 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\nOCB3 error... %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "OCB3 \t\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); -#endif - -#ifdef LTC_CCM_MODE - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = ccm_memory(cipher_idx, key, 16, NULL, IV, 16, NULL, 0, buf, MAC_SIZE*1024, buf, tag, &z, CCM_ENCRYPT)) != CRYPT_OK) { - fprintf(stderr, "\nCCM error... %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "CCM (no-precomp) \t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); - - cipher_descriptor[cipher_idx].setup(key, 16, 0, &skey); - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = ccm_memory(cipher_idx, key, 16, &skey, IV, 16, NULL, 0, buf, MAC_SIZE*1024, buf, tag, &z, CCM_ENCRYPT)) != CRYPT_OK) { - fprintf(stderr, "\nCCM error... %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "CCM (precomp) \t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); - cipher_descriptor[cipher_idx].done(&skey); -#endif - -#ifdef LTC_GCM_MODE - t2 = -1; - for (x = 0; x < 100; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = gcm_memory(cipher_idx, key, 16, IV, 16, NULL, 0, buf, MAC_SIZE*1024, buf, tag, &z, GCM_ENCRYPT)) != CRYPT_OK) { - fprintf(stderr, "\nGCM error... %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "GCM (no-precomp)\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); - - { - gcm_state gcm -#ifdef LTC_GCM_TABLES_SSE2 -__attribute__ ((aligned (16))) -#endif -; - - if ((err = gcm_init(&gcm, cipher_idx, key, 16)) != CRYPT_OK) { fprintf(stderr, "gcm_init: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } - t2 = -1; - for (x = 0; x < 10000; x++) { - t_start(); - t1 = t_read(); - z = 16; - if ((err = gcm_reset(&gcm)) != CRYPT_OK) { - fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); - exit(EXIT_FAILURE); - } - if ((err = gcm_add_iv(&gcm, IV, 16)) != CRYPT_OK) { - fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); - exit(EXIT_FAILURE); - } - if ((err = gcm_add_aad(&gcm, NULL, 0)) != CRYPT_OK) { - fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); - exit(EXIT_FAILURE); - } - if ((err = gcm_process(&gcm, buf, MAC_SIZE*1024, buf, GCM_ENCRYPT)) != CRYPT_OK) { - fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); - exit(EXIT_FAILURE); - } - - if ((err = gcm_done(&gcm, tag, &z)) != CRYPT_OK) { - fprintf(stderr, "\nGCM error[%d]... %s\n", __LINE__, error_to_string(err)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - if (t1 < t2) t2 = t1; - } - fprintf(stderr, "GCM (precomp)\t\t%9"PRI64"u\n", t2/(ulong64)(MAC_SIZE*1024)); - } - -#endif -#else - LTC_UNUSED_PARAM(MAC_SIZE); - fprintf(stderr, "NO ENCMACs\n"); -#endif - -} - -void time_encmacs(void) -{ - time_encmacs_(1); - time_encmacs_(4); - time_encmacs_(32); -} - -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index 1c4b3095c..e830b14a3 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -52,55 +52,10 @@ int base64_test(void); int file_test(void); int multi_test(void); -/* timing */ -#define KTIMES 25 -#define TIMES 100000 - -extern struct list { - int id; - ulong64 spd1, spd2, avg; -} results[]; - -extern int no_results; - #ifdef LTC_PKCS_1 extern const struct ltc_prng_descriptor no_prng_desc; #endif -int sorter(const void *a, const void *b); -void tally_results(int type); -ulong64 rdtsc (void); - -void t_start(void); -ulong64 t_read(void); -void init_timer(void); - -/* register default algs */ -int time_keysched(void); -int time_cipher_ecb(void); -int time_cipher_cbc(void); -int time_cipher_ctr(void); -int time_cipher_lrw(void); -int time_hash(void); -void time_mult(void); -void time_sqr(void); -void time_prng(void); -void time_rsa(void); -void time_dsa(void); -void time_katja(void); -void time_ecc(void); -void time_macs_(unsigned long MAC_SIZE); -void time_macs(void); -void time_encmacs(void); - - - -#if defined(_WIN32) - #define PRI64 "I64d" -#else - #define PRI64 "ll" -#endif - #endif /* $Source$ */ From 07ffa0f1a2ffdeab850cd14ffe1c6c351cf4a3af Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 5 Jun 2017 15:51:29 +0200 Subject: [PATCH 0792/1192] remove tomcrypt_prof test-only library --- build.sh | 6 +++--- helper.pl | 2 +- makefile | 19 ++----------------- makefile.mingw | 18 ++++++------------ makefile.msvc | 19 +++++++------------ makefile.shared | 14 +++----------- makefile.unix | 28 +++++++++++----------------- makefile_include.mk | 9 +-------- {demos => testprof}/test.c | 0 9 files changed, 34 insertions(+), 81 deletions(-) rename {demos => testprof}/test.c (100%) diff --git a/build.sh b/build.sh index 590fc4431..b1e6de364 100755 --- a/build.sh +++ b/build.sh @@ -15,9 +15,9 @@ fi CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j$MAKE_JOBS -f $3 all_test 1>gcc_1.txt 2>gcc_2.txt mret=$? cnt=$(wc -l < gcc_2.txt) -# ignore 2 lines since ar prints to stderr instead of stdout and ar is called for -# $(LIBNAME) and testprof/$(LIBTEST_S) -if [[ $mret -ne 0 ]] || [[ $cnt -gt 2 ]]; then +# ignore 1 line since ar prints to stderr instead of stdout and ar is called for +# $(LIBNAME) +if [[ $mret -ne 0 ]] || [[ $cnt -gt 1 ]]; then echo "build $1 failed! printing gcc_2.txt now for convenience" cat gcc_2.txt exit 1 diff --git a/helper.pl b/helper.pl index e468b2fb6..eb4664d2f 100755 --- a/helper.pl +++ b/helper.pl @@ -239,7 +239,7 @@ sub process_makefiles { my @all = (); find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src'); my @t = qw(); - find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?).c$/ } }, 'testprof'); + find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?|test).c$/ } }, 'testprof'); my @o = sort ('src/ciphers/aes/aes_enc.o', map { my $x = $_; $x =~ s/\.c$/.o/; $x } @c); my $var_o = prepare_variable("OBJECTS", @o); diff --git a/makefile b/makefile index 5454e1fe0..5e8c5a781 100644 --- a/makefile +++ b/makefile @@ -27,9 +27,6 @@ INSTALL_CMD = install ifndef LIBNAME LIBNAME=libtomcrypt.a endif -ifndef LIBTEST - LIBTEST=libtomcrypt_prof.a -endif include makefile_include.mk @@ -61,27 +58,17 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -$(LIBTEST): $(TOBJECTS) -ifneq ($V,1) - @echo " * ${AR} $@" -endif - ${silent} $(AR) $(ARFLAGS) $@ $(TOBJECTS) -ifneq ($V,1) - @echo " * ${RANLIB} $@" -endif - ${silent} $(RANLIB) $@ - timing: $(LIBNAME) $(TIMINGS) testprof/common.o ifneq ($V,1) @echo " * ${CC} $@" endif ${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/common.o $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) -test: $(LIBNAME) $(LIBTEST) $(TESTS) +test: $(LIBNAME) $(TOBJECTS) ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TESTS) $(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TEST) + ${silent} $(CC) $(LDFLAGS) $(TOBJECTS) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TEST) # build the demos from a template define DEMO_template @@ -102,8 +89,6 @@ install: .common_install install_bins: .common_install_bins -install_test: .common_install_test - profile: CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" ./timing diff --git a/makefile.mingw b/makefile.mingw index 60e84b2d0..ee3d11e06 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -33,7 +33,6 @@ VERSION=1.17 LIBMAIN_S =libtomcrypt.a LIBMAIN_I =libtomcrypt.dll.a LIBMAIN_D =libtomcrypt.dll -LIBTEST_S =libtomcrypt_prof.a #List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ @@ -193,7 +192,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o +testprof/store_test.o testprof/test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -225,11 +224,6 @@ $(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h .c.o: $(CC) $(LTC_CFLAGS) -c $< -o $@ -#Create libtomcrypt_prof.a -$(LIBTEST_S): $(TOBJECTS) - $(AR) $(ARFLAGS) $@ $(TOBJECTS) - $(RANLIB) $@ - #Create libtomcrypt.a $(LIBMAIN_S): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) @@ -252,13 +246,13 @@ tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) #Tests + timing tests timing.exe: demos/timing.o testprof/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ + $(CC) demos/timing.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: timing.exe -test.exe: demos/test.o $(LIBTEST_S) $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ +test.exe: $(TOBJECTS) $(LIBMAIN_S) + $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: test.exe -all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe +all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe test: test.exe @@ -267,7 +261,7 @@ clean: @cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul #Install the library + headers -install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) $(LIBTEST_S) +install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" cmd /c if not exist "$(DESTDIR)\lib" mkdir "$(DESTDIR)\lib" cmd /c if not exist "$(DESTDIR)\include" mkdir "$(DESTDIR)\include" diff --git a/makefile.msvc b/makefile.msvc index acd1a62f9..3bafbe7f6 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -26,7 +26,6 @@ VERSION=1.17 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib -LIBTEST_S =tomcrypt_prof.lib #List of objects to compile (all goes to tomcrypt.lib) OBJECTS=src/ciphers/aes/aes.obj src/ciphers/aes/aes_enc.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \ @@ -186,7 +185,7 @@ testprof/dh_test.obj testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_t testprof/mac_test.obj testprof/misc_test.obj testprof/modes_test.obj testprof/multi_test.obj testprof/no_prng.obj \ testprof/pkcs_1_eme_test.obj testprof/pkcs_1_emsa_test.obj testprof/pkcs_1_oaep_test.obj \ testprof/pkcs_1_pss_test.obj testprof/pkcs_1_test.obj testprof/rotate_test.obj testprof/rsa_test.obj \ -testprof/store_test.obj +testprof/store_test.obj testprof/test.obj #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -218,10 +217,6 @@ $(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h .c.obj: $(CC) $(LTC_CFLAGS) /c $< /Fo$@ -#Create tomcrypt_prof.lib -$(LIBTEST_S): $(TOBJECTS) - lib /out:$(LIBTEST_S) $(TOBJECTS) - #Create tomcrypt.lib $(LIBMAIN_S): $(OBJECTS) lib /out:$(LIBMAIN_S) $(OBJECTS) @@ -237,12 +232,12 @@ tv_gen.exe: demos/tv_gen.c $(LIBMAIN_S) cl $(LTC_CFLAGS) demos/tv_gen.c $(LIBMAIN_S) $(LTC_LDFLAGS) #Tests + timing tests -timing.exe: demos/timing.c $(LIBMAIN_S) $(LIBTEST_S) - cl $(LTC_CFLAGS) demos/timing.c $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) -test.exe: demos/test.c $(LIBMAIN_S) $(LIBTEST_S) - cl $(LTC_CFLAGS) demos/test.c $(LIBTEST_S) $(LIBMAIN_S) $(LTC_LDFLAGS) +timing.exe: demos/timing.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/timing.c $(LIBMAIN_S) $(LTC_LDFLAGS) +test.exe: $(LIBMAIN_S) $(TOBJECTS) + cl $(LTC_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -all: $(LIBMAIN_S) $(LIBTEST_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe +all: $(LIBMAIN_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe test: test.exe @@ -251,7 +246,7 @@ clean: @cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul #Install the library + headers -install: $(LIBMAIN_S) $(LIBTEST_S) +install: $(LIBMAIN_S) cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" cmd /c if not exist "$(DESTDIR)\lib" mkdir "$(DESTDIR)\lib" cmd /c if not exist "$(DESTDIR)\include" mkdir "$(DESTDIR)\include" diff --git a/makefile.shared b/makefile.shared index 78d925456..55d24321d 100644 --- a/makefile.shared +++ b/makefile.shared @@ -18,9 +18,6 @@ LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) INSTALL_CMD = $(LT) --mode=install install #Output filenames for various targets. -ifndef LIBTEST - LIBTEST=libtomcrypt_prof.la -endif ifndef LIBNAME LIBNAME=libtomcrypt.la endif @@ -39,9 +36,6 @@ src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c $(LIBNAME): $(OBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo" | LC_ALL=C sort` $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) -$(LIBTEST): $(TOBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./testprof -type f -name "*.lo" | LC_ALL=C sort` -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) - install: .common_install sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc install -d $(LIBPATH)/pkgconfig @@ -49,13 +43,11 @@ install: .common_install install_bins: .common_install_bins -install_test: .common_install_test - -test: $(LIBNAME) $(LIBTEST) $(TESTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) +test: $(LIBNAME) $(TOBJECTS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) timing: $(TIMINGS) testprof/common.o $(LIBNAME) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $? $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $^ $(EXTRALIBS) # build the demos from a template define DEMO_template diff --git a/makefile.unix b/makefile.unix index 84733a9e9..51d93e599 100644 --- a/makefile.unix +++ b/makefile.unix @@ -38,7 +38,6 @@ VERSION=1.17 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a -LIBTEST_S =libtomcrypt_prof.a #List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ @@ -198,7 +197,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o +testprof/store_test.o testprof/test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -232,11 +231,6 @@ $(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h .c.o: $(CC) $(LTC_CFLAGS) -c $< -o $@ -#Create libtomcrypt_prof.a -$(LIBTEST_S): $(TOBJECTS) - $(AR) $(ARFLAGS) $@ $(TOBJECTS) - $(RANLIB) $@ - #Create libtomcrypt.a $(LIBMAIN_S): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) @@ -244,28 +238,28 @@ $(LIBMAIN_S): $(OBJECTS) #Demo tools/utilities hashsum: demos/hashsum.o testprof/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ + $(CC) demos/hashsum.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ ltcrypt: demos/ltcrypt.o testprof/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ + $(CC) demos/ltcrypt.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ small: demos/small.o testprof/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ + $(CC) demos/small.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ + $(CC) demos/tv_gen.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ #Tests + timing tests -timing: demos/timing.o testprof/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ +timing: demos/timing.o $(LIBMAIN_S) testprof/common.o + $(CC) demos/timing.o $(LIBMAIN_S) testprof/common.o $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the timing tests by: ./timing" -test: demos/test.o $(LIBTEST_S) $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ +test: $(TOBJECTS) $(LIBMAIN_S) + $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the tests by: ./test" -all: $(LIBMAIN_S) $(LIBTEST_S) hashsum ltcrypt small tv_gen timing test +all: $(LIBMAIN_S) hashsum ltcrypt small tv_gen timing test #NOTE: this makefile works also on cygwin, thus we need to delete *.exe clean: -@rm -f $(OBJECTS) $(TOBJECTS) - -@rm -f $(LIBMAIN_S) $(LIBTEST_S) + -@rm -f $(LIBMAIN_S) -@rm -f demos/*.o *_tv.txt -@rm -f test tv_gen hashsum crypt small timing -@rm -f test.exe tv_gen.exe hashsum.exe crypt.exe small.exe timing.exe diff --git a/makefile_include.mk b/makefile_include.mk index 828e1cbf5..c0feaf5e6 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -113,7 +113,6 @@ UNBROKEN_DEMOS=$(USEFUL_DEMOS) ltcrypt small tv_gen sizes constants DEMOS=$(UNBROKEN_DEMOS) openssl-enc TIMINGS=demos/timing.o -TESTS=demos/test.o #LIBPATH The directory for libtomcrypt to be installed to. #INCPATH The directory to install the header files for libtomcrypt. @@ -296,7 +295,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o +testprof/store_test.o testprof/test.o # The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -354,12 +353,6 @@ install_all: install install_bins install_docs install_test install -d $(BINPATH) $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(BINPATH) -.common_install_test: $(LIBTEST) - install -d $(LIBPATH) - install -d $(INCPATH) - install -m 644 testprof/tomcrypt_test.h $(INCPATH) - $(INSTALL_CMD) -m 644 $(LIBTEST) $(LIBPATH) - install_docs: doc/crypt.pdf install -d $(DATAPATH) install -m 644 doc/crypt.pdf $(DATAPATH) diff --git a/demos/test.c b/testprof/test.c similarity index 100% rename from demos/test.c rename to testprof/test.c From e1a11458023a3cd54ae466c0b4469d77b83654fe Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 5 Jun 2017 15:58:10 +0200 Subject: [PATCH 0793/1192] rename 'testprof/' to 'tests/' --- coverage_more.sh | 2 +- helper.pl | 6 ++--- makefile | 8 +++--- makefile.mingw | 27 +++++++++---------- makefile.msvc | 15 +++++------ makefile.shared | 4 +-- makefile.unix | 35 ++++++++++++------------- makefile_include.mk | 19 +++++++------- {testprof => tests}/base64_test.c | 0 {testprof => tests}/cipher_hash_test.c | 0 {testprof => tests}/common.c | 0 {testprof => tests}/common.h | 0 {testprof => tests}/der_tests.c | 0 {testprof => tests}/dh_test.c | 0 {testprof => tests}/dsa_test.c | 0 {testprof => tests}/ecc_test.c | 0 {testprof => tests}/file_test.c | 2 +- {testprof => tests}/katja_test.c | 0 {testprof => tests}/mac_test.c | 0 {testprof => tests}/misc_test.c | 0 {testprof => tests}/modes_test.c | 0 {testprof => tests}/multi_test.c | 0 {testprof => tests}/no_prng.c | 0 {testprof => tests}/pkcs_1_eme_test.c | 0 {testprof => tests}/pkcs_1_emsa_test.c | 0 {testprof => tests}/pkcs_1_oaep_test.c | 0 {testprof => tests}/pkcs_1_pss_test.c | 0 {testprof => tests}/pkcs_1_test.c | 0 {testprof => tests}/rotate_test.c | 0 {testprof => tests}/rsa_test.c | 0 {testprof => tests}/store_test.c | 0 {testprof => tests}/test.c | 0 {testprof => tests}/test.der | Bin {testprof => tests}/test.key | 0 {testprof => tests}/test_dsa.key | 0 {testprof => tests}/tomcrypt_test.h | 0 36 files changed, 57 insertions(+), 61 deletions(-) rename {testprof => tests}/base64_test.c (100%) rename {testprof => tests}/cipher_hash_test.c (100%) rename {testprof => tests}/common.c (100%) rename {testprof => tests}/common.h (100%) rename {testprof => tests}/der_tests.c (100%) rename {testprof => tests}/dh_test.c (100%) rename {testprof => tests}/dsa_test.c (100%) rename {testprof => tests}/ecc_test.c (100%) rename {testprof => tests}/file_test.c (99%) rename {testprof => tests}/katja_test.c (100%) rename {testprof => tests}/mac_test.c (100%) rename {testprof => tests}/misc_test.c (100%) rename {testprof => tests}/modes_test.c (100%) rename {testprof => tests}/multi_test.c (100%) rename {testprof => tests}/no_prng.c (100%) rename {testprof => tests}/pkcs_1_eme_test.c (100%) rename {testprof => tests}/pkcs_1_emsa_test.c (100%) rename {testprof => tests}/pkcs_1_oaep_test.c (100%) rename {testprof => tests}/pkcs_1_pss_test.c (100%) rename {testprof => tests}/pkcs_1_test.c (100%) rename {testprof => tests}/rotate_test.c (100%) rename {testprof => tests}/rsa_test.c (100%) rename {testprof => tests}/store_test.c (100%) rename {testprof => tests}/test.c (100%) rename {testprof => tests}/test.der (100%) rename {testprof => tests}/test.key (100%) rename {testprof => tests}/test_dsa.key (100%) rename {testprof => tests}/tomcrypt_test.h (100%) diff --git a/coverage_more.sh b/coverage_more.sh index c7eababad..2b8009c7b 100755 --- a/coverage_more.sh +++ b/coverage_more.sh @@ -5,7 +5,7 @@ set -e ./sizes ./constants -for i in $(for j in $(echo $(./hashsum -h | tail -n +3)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i testprof/test.key ; done > hashsum_tv.txt +for i in $(for j in $(echo $(./hashsum -h | tail -n +3)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i tests/test.key ; done > hashsum_tv.txt difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true if [ -n "$difftroubles" ]; then echo "FAILURE: hashsum_tv.tx" diff --git a/helper.pl b/helper.pl index eb4664d2f..f8a7eee94 100755 --- a/helper.pl +++ b/helper.pl @@ -27,7 +27,7 @@ sub write_file { sub check_source { my @all_files = (bsd_glob("makefile*"), bsd_glob("*.sh"), bsd_glob("*.pl")); - find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src testprof demos/); + find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src tests demos/); my $fails = 0; for my $file (sort @all_files) { @@ -96,7 +96,7 @@ sub check_descriptors { } my $fails = 0; for my $d (@descriptors) { - for my $f (qw{ testprof/common.c }) { + for my $f (qw{ tests/common.c }) { my $txt = read_file($f); warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/; } @@ -239,7 +239,7 @@ sub process_makefiles { my @all = (); find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src'); my @t = qw(); - find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?|test).c$/ } }, 'testprof'); + find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?|test).c$/ } }, 'tests'); my @o = sort ('src/ciphers/aes/aes_enc.o', map { my $x = $_; $x =~ s/\.c$/.o/; $x } @c); my $var_o = prepare_variable("OBJECTS", @o); diff --git a/makefile b/makefile index 5e8c5a781..b670239e1 100644 --- a/makefile +++ b/makefile @@ -58,11 +58,11 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -timing: $(LIBNAME) $(TIMINGS) testprof/common.o +timing: $(LIBNAME) $(TIMINGS) tests/common.o ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/common.o $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) + ${silent} $(CC) $(LDFLAGS) $(TIMINGS) tests/common.o $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) test: $(LIBNAME) $(TOBJECTS) ifneq ($V,1) @@ -72,11 +72,11 @@ endif # build the demos from a template define DEMO_template -$(1): demos/$(1).o $$(LIBNAME) testprof/common.o +$(1): demos/$(1).o $$(LIBNAME) tests/common.o ifneq ($V,1) @echo " * $${CC} $$@" endif - $${silent} $$(CC) $$(CFLAGS) $$< testprof/common.o $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) + $${silent} $$(CC) $$(CFLAGS) $$< tests/common.o $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) diff --git a/makefile.mingw b/makefile.mingw index ee3d11e06..feecb732b 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -25,7 +25,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = -L../libtommath -ltommath #Compilation flags -LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE +LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) VERSION=1.17 @@ -187,12 +187,11 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o #List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \ -testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \ -testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ -testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ -testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test.o +TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ +tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ +tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ +tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \ +tests/rsa_test.o tests/store_test.o tests/test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -219,7 +218,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h +$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h .c.o: $(CC) $(LTC_CFLAGS) -c $< -o $@ @@ -235,18 +234,18 @@ $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) $(STRIP) -S $(LIBMAIN_D) #Demo tools/utilities -hashsum: demos/hashsum.o testprof/common.o $(LIBMAIN_S) +hashsum: demos/hashsum.o tests/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -crypt: demos/crypt.o testprof/common.o $(LIBMAIN_S) +crypt: demos/crypt.o tests/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -small: demos/small.o testprof/common.o $(LIBMAIN_S) +small: demos/small.o tests/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) +tv_gen: demos/tv_gen.o tests/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ #Tests + timing tests -timing.exe: demos/timing.o testprof/common.o $(LIBMAIN_S) - $(CC) demos/timing.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +timing.exe: demos/timing.o tests/common.o $(LIBMAIN_S) + $(CC) demos/timing.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: timing.exe test.exe: $(TOBJECTS) $(LIBMAIN_S) $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ diff --git a/makefile.msvc b/makefile.msvc index 3bafbe7f6..e2c6ecd47 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -20,7 +20,7 @@ CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath EXTRALIBS = ../libtommath/tommath.lib #Compilation flags -LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itestprof/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 +LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) VERSION=1.17 @@ -180,12 +180,11 @@ src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128. src/stream/sober128/sober128_test.obj #List of test objects to compile (all goes to tomcrypt_prof.lib) -TOBJECTS=testprof/base64_test.obj testprof/cipher_hash_test.obj testprof/common.obj testprof/der_tests.obj \ -testprof/dh_test.obj testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_test.obj testprof/katja_test.obj \ -testprof/mac_test.obj testprof/misc_test.obj testprof/modes_test.obj testprof/multi_test.obj testprof/no_prng.obj \ -testprof/pkcs_1_eme_test.obj testprof/pkcs_1_emsa_test.obj testprof/pkcs_1_oaep_test.obj \ -testprof/pkcs_1_pss_test.obj testprof/pkcs_1_test.obj testprof/rotate_test.obj testprof/rsa_test.obj \ -testprof/store_test.obj testprof/test.obj +TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_tests.obj tests/dh_test.obj \ +tests/dsa_test.obj tests/ecc_test.obj tests/file_test.obj tests/katja_test.obj tests/mac_test.obj tests/misc_test.obj \ +tests/modes_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj tests/pkcs_1_emsa_test.obj \ +tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj tests/rotate_test.obj \ +tests/rsa_test.obj tests/store_test.obj tests/test.obj #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -212,7 +211,7 @@ src/hashes/sha2/sha256.obj: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h +$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h .c.obj: $(CC) $(LTC_CFLAGS) /c $< /Fo$@ diff --git a/makefile.shared b/makefile.shared index 55d24321d..68083cd24 100644 --- a/makefile.shared +++ b/makefile.shared @@ -46,12 +46,12 @@ install_bins: .common_install_bins test: $(LIBNAME) $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) -timing: $(TIMINGS) testprof/common.o $(LIBNAME) +timing: $(TIMINGS) tests/common.o $(LIBNAME) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $^ $(EXTRALIBS) # build the demos from a template define DEMO_template -$(1): demos/$(1).o testprof/common.o $$(LIBNAME) +$(1): demos/$(1).o tests/common.o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif diff --git a/makefile.unix b/makefile.unix index 51d93e599..407339795 100644 --- a/makefile.unix +++ b/makefile.unix @@ -32,7 +32,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = ../libtommath/libtommath.a #Compilation flags -LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE +LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) VERSION=1.17 @@ -192,12 +192,11 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o #List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \ -testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \ -testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ -testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ -testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test.o +TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ +tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ +tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ +tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \ +tests/rsa_test.o tests/store_test.o tests/test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -224,7 +223,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #Dependencies on *.h $(OBJECTS): $(HEADERS) -$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h +$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h #This is necessary for compatibility with BSD make (namely on OpenBSD) .SUFFIXES: .o .c @@ -237,18 +236,18 @@ $(LIBMAIN_S): $(OBJECTS) $(RANLIB) $@ #Demo tools/utilities -hashsum: demos/hashsum.o testprof/common.o $(LIBMAIN_S) - $(CC) demos/hashsum.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -ltcrypt: demos/ltcrypt.o testprof/common.o $(LIBMAIN_S) - $(CC) demos/ltcrypt.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -small: demos/small.o testprof/common.o $(LIBMAIN_S) - $(CC) demos/small.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) - $(CC) demos/tv_gen.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +hashsum: demos/hashsum.o tests/common.o $(LIBMAIN_S) + $(CC) demos/hashsum.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +ltcrypt: demos/ltcrypt.o tests/common.o $(LIBMAIN_S) + $(CC) demos/ltcrypt.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +small: demos/small.o tests/common.o $(LIBMAIN_S) + $(CC) demos/small.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +tv_gen: demos/tv_gen.o tests/common.o $(LIBMAIN_S) + $(CC) demos/tv_gen.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ #Tests + timing tests -timing: demos/timing.o $(LIBMAIN_S) testprof/common.o - $(CC) demos/timing.o $(LIBMAIN_S) testprof/common.o $(LTC_LDFLAGS) -o $@ +timing: demos/timing.o $(LIBMAIN_S) tests/common.o + $(CC) demos/timing.o $(LIBMAIN_S) tests/common.o $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the timing tests by: ./timing" test: $(TOBJECTS) $(LIBMAIN_S) $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ diff --git a/makefile_include.mk b/makefile_include.mk index c0feaf5e6..fa4d8c6da 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -102,8 +102,8 @@ endif DSOURCES = $(wildcard demos/*.c) DOBJECTS = $(DSOURCES:.c=.o) -#List of testprof headers -THEADERS = $(wildcard testprof/*.h) +#List of tests headers +THEADERS = $(wildcard tests/*.h) TIMING=timing TEST=test @@ -290,12 +290,11 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o # List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \ -testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \ -testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \ -testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \ -testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \ -testprof/store_test.o testprof/test.o +TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ +tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ +tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ +tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \ +tests/rsa_test.o tests/store_test.o tests/test.o # The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ @@ -317,8 +316,8 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c #The default rule for make builds the libtomcrypt library. default:library -$(DOBJECTS): CFLAGS += -Itestprof -$(TOBJECTS): CFLAGS += -Itestprof +$(DOBJECTS): CFLAGS += -Itests +$(TOBJECTS): CFLAGS += -Itests #This rule makes the libtomcrypt library. library: $(LIBNAME) diff --git a/testprof/base64_test.c b/tests/base64_test.c similarity index 100% rename from testprof/base64_test.c rename to tests/base64_test.c diff --git a/testprof/cipher_hash_test.c b/tests/cipher_hash_test.c similarity index 100% rename from testprof/cipher_hash_test.c rename to tests/cipher_hash_test.c diff --git a/testprof/common.c b/tests/common.c similarity index 100% rename from testprof/common.c rename to tests/common.c diff --git a/testprof/common.h b/tests/common.h similarity index 100% rename from testprof/common.h rename to tests/common.h diff --git a/testprof/der_tests.c b/tests/der_tests.c similarity index 100% rename from testprof/der_tests.c rename to tests/der_tests.c diff --git a/testprof/dh_test.c b/tests/dh_test.c similarity index 100% rename from testprof/dh_test.c rename to tests/dh_test.c diff --git a/testprof/dsa_test.c b/tests/dsa_test.c similarity index 100% rename from testprof/dsa_test.c rename to tests/dsa_test.c diff --git a/testprof/ecc_test.c b/tests/ecc_test.c similarity index 100% rename from testprof/ecc_test.c rename to tests/ecc_test.c diff --git a/testprof/file_test.c b/tests/file_test.c similarity index 99% rename from testprof/file_test.c rename to tests/file_test.c index 3252e533e..c2e4a381f 100644 --- a/testprof/file_test.c +++ b/tests/file_test.c @@ -11,7 +11,7 @@ int file_test(void) 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; unsigned char buf[200]; unsigned long len; - char *fname = "testprof/test.key"; + char *fname = "tests/test.key"; FILE *in; int err, isha256, iaes; diff --git a/testprof/katja_test.c b/tests/katja_test.c similarity index 100% rename from testprof/katja_test.c rename to tests/katja_test.c diff --git a/testprof/mac_test.c b/tests/mac_test.c similarity index 100% rename from testprof/mac_test.c rename to tests/mac_test.c diff --git a/testprof/misc_test.c b/tests/misc_test.c similarity index 100% rename from testprof/misc_test.c rename to tests/misc_test.c diff --git a/testprof/modes_test.c b/tests/modes_test.c similarity index 100% rename from testprof/modes_test.c rename to tests/modes_test.c diff --git a/testprof/multi_test.c b/tests/multi_test.c similarity index 100% rename from testprof/multi_test.c rename to tests/multi_test.c diff --git a/testprof/no_prng.c b/tests/no_prng.c similarity index 100% rename from testprof/no_prng.c rename to tests/no_prng.c diff --git a/testprof/pkcs_1_eme_test.c b/tests/pkcs_1_eme_test.c similarity index 100% rename from testprof/pkcs_1_eme_test.c rename to tests/pkcs_1_eme_test.c diff --git a/testprof/pkcs_1_emsa_test.c b/tests/pkcs_1_emsa_test.c similarity index 100% rename from testprof/pkcs_1_emsa_test.c rename to tests/pkcs_1_emsa_test.c diff --git a/testprof/pkcs_1_oaep_test.c b/tests/pkcs_1_oaep_test.c similarity index 100% rename from testprof/pkcs_1_oaep_test.c rename to tests/pkcs_1_oaep_test.c diff --git a/testprof/pkcs_1_pss_test.c b/tests/pkcs_1_pss_test.c similarity index 100% rename from testprof/pkcs_1_pss_test.c rename to tests/pkcs_1_pss_test.c diff --git a/testprof/pkcs_1_test.c b/tests/pkcs_1_test.c similarity index 100% rename from testprof/pkcs_1_test.c rename to tests/pkcs_1_test.c diff --git a/testprof/rotate_test.c b/tests/rotate_test.c similarity index 100% rename from testprof/rotate_test.c rename to tests/rotate_test.c diff --git a/testprof/rsa_test.c b/tests/rsa_test.c similarity index 100% rename from testprof/rsa_test.c rename to tests/rsa_test.c diff --git a/testprof/store_test.c b/tests/store_test.c similarity index 100% rename from testprof/store_test.c rename to tests/store_test.c diff --git a/testprof/test.c b/tests/test.c similarity index 100% rename from testprof/test.c rename to tests/test.c diff --git a/testprof/test.der b/tests/test.der similarity index 100% rename from testprof/test.der rename to tests/test.der diff --git a/testprof/test.key b/tests/test.key similarity index 100% rename from testprof/test.key rename to tests/test.key diff --git a/testprof/test_dsa.key b/tests/test_dsa.key similarity index 100% rename from testprof/test_dsa.key rename to tests/test_dsa.key diff --git a/testprof/tomcrypt_test.h b/tests/tomcrypt_test.h similarity index 100% rename from testprof/tomcrypt_test.h rename to tests/tomcrypt_test.h From b78c5551f72819c1619d4b80d8011a4f490a84a3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 6 Jun 2017 18:07:33 +0200 Subject: [PATCH 0794/1192] move `compare_testvector()` implementation to the library --- src/headers/tomcrypt_misc.h | 1 - src/misc/compare_testvector.c | 74 +++++++++++++++++++++++++++++++++++ tests/common.c | 19 --------- tests/common.h | 3 -- 4 files changed, 74 insertions(+), 23 deletions(-) create mode 100644 src/misc/compare_testvector.c diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 76f4f6bc9..8bacea8f6 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -99,7 +99,6 @@ void crc32_finish(crc32_state *ctx, void *hash, unsigned long size); int crc32_test(void); #endif -/* yeah it's not exactly in misc in the library, but in testprof/x86_prof.c */ #if defined(LTC_TEST) && defined(LTC_TEST_DBG) void print_hex(const char* what, const void* v, const unsigned long l); int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); diff --git a/src/misc/compare_testvector.c b/src/misc/compare_testvector.c new file mode 100644 index 000000000..2bf02ee73 --- /dev/null +++ b/src/misc/compare_testvector.c @@ -0,0 +1,74 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + */ + +#include "tomcrypt.h" + +/** + @file compare_testvecotr.c + Function to compare two testvectors and print a (detailed) error-message if required, Steffen Jaeckel +*/ + +#ifndef compare_testvector + +static void _print_hex(const char* what, const void* v, const unsigned long l) +{ + const unsigned char* p = v; + unsigned long x, y = 0, z; + fprintf(stderr, "%s contents: \n", what); + for (x = 0; x < l; ) { + fprintf(stderr, "%02X ", p[x]); + if (!(++x % 16) || x == l) { + if((x % 16) != 0) { + z = 16 - (x % 16); + if(z >= 8) + fprintf(stderr, " "); + for (; z != 0; --z) { + fprintf(stderr, " "); + } + } + fprintf(stderr, " | "); + for(; y < x; y++) { + if((y % 8) == 0) + fprintf(stderr, " "); + if(isgraph(p[y])) + fprintf(stderr, "%c", p[y]); + else + fprintf(stderr, "."); + } + fprintf(stderr, "\n"); + } + else if((x % 8) == 0) { + fprintf(stderr, " "); + } + } +} + +int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) +{ + int res = 0; + if(is_len != should_len) + res = is_len > should_len ? -1 : 1; + else + res = XMEMCMP(is, should, MAX(is_len, should_len)); + + if (res != 0) { + fprintf(stderr, "Testvector #%i of %s failed:\n", which, what); + _print_hex("SHOULD", should, should_len); + _print_hex("IS ", is, is_len); + } + + return res; +} +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/tests/common.c b/tests/common.c index 028768fb8..24865868a 100644 --- a/tests/common.c +++ b/tests/common.c @@ -61,25 +61,6 @@ void print_hex(const char* what, const void* v, const unsigned long l) } } -#ifndef compare_testvector -int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) -{ - int res = 0; - if(is_len != should_len) - res = is_len > should_len ? -1 : 1; - else - res = XMEMCMP(is, should, MAX(is_len, should_len)); - - if (res != 0) { - fprintf(stderr, "Testvector #%i of %s failed:\n", which, what); - print_hex("SHOULD", should, should_len); - print_hex("IS ", is, is_len); - } - - return res; -} -#endif - prng_state yarrow_prng; /* diff --git a/tests/common.h b/tests/common.h index 05a3977d9..4650d0ccb 100644 --- a/tests/common.h +++ b/tests/common.h @@ -22,9 +22,6 @@ extern prng_state yarrow_prng; void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); void print_hex(const char* what, const void* v, const unsigned long l); -#ifndef compare_testvector -int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); -#endif void register_algs(void); void setup_math(void); From b83f9472c0af0ed133d144d744cef832b0bba2a5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 6 Jun 2017 18:07:38 +0200 Subject: [PATCH 0795/1192] Update makefiles --- libtomcrypt_VS2008.vcproj | 4 ++++ makefile.mingw | 25 +++++++++++++------------ makefile.msvc | 25 +++++++++++++------------ makefile.unix | 25 +++++++++++++------------ makefile_include.mk | 25 +++++++++++++------------ 5 files changed, 56 insertions(+), 48 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index f5f14636f..2c761c852 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -1343,6 +1343,10 @@ RelativePath="src\misc\burn_stack.c" > + + diff --git a/makefile.mingw b/makefile.mingw index feecb732b..e70028fc4 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -91,18 +91,19 @@ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ +src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile.msvc b/makefile.msvc index e2c6ecd47..2d21254be 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -84,18 +84,19 @@ src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.o src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \ src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \ src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/adler32.obj \ -src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj src/misc/crc32.obj \ -src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt_cipher_descriptor.obj \ -src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_constants.obj \ -src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_any.obj \ -src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash.obj \ -src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash_id.obj \ -src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ -src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ -src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ -src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ -src/misc/crypt/crypt_prng_rng_descriptor.obj src/misc/crypt/crypt_register_cipher.obj \ -src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj \ +src/misc/compare_testvector.obj src/misc/crc32.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj \ +src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \ +src/misc/crypt/crypt_constants.obj src/misc/crypt/crypt_find_cipher.obj \ +src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher_id.obj \ +src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_any.obj \ +src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ +src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ +src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_inits.obj \ +src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \ +src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_prng_rng_descriptor.obj \ +src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ +src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pk_get_oid.obj src/misc/pkcs5/pkcs_5_1.obj \ diff --git a/makefile.unix b/makefile.unix index 407339795..4ec30a2fa 100644 --- a/makefile.unix +++ b/makefile.unix @@ -96,18 +96,19 @@ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ +src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ diff --git a/makefile_include.mk b/makefile_include.mk index fa4d8c6da..a39d3452a 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -194,18 +194,19 @@ src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \ src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \ src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \ src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \ -src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crc32.o \ -src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash_id.o \ -src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ -src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ -src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ -src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ -src/misc/crypt/crypt_prng_rng_descriptor.o src/misc/crypt/crypt_register_cipher.o \ -src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ +src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \ +src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \ +src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ +src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ +src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ +src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ +src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ +src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ From 40747cfcfd20649acc8df2d7be1d82382ccb87f9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 6 Jun 2017 18:18:21 +0200 Subject: [PATCH 0796/1192] add a build-run with debugging-options --- makefile_include.mk | 5 +++-- run.sh | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/makefile_include.mk b/makefile_include.mk index a39d3452a..77e5e5de0 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -63,10 +63,11 @@ CFLAGS += -Wno-type-limits ifdef LTC_DEBUG # compile for DEBUGGING (required for ccmalloc checking!!!) +CFLAGS += -g3 -DLTC_NO_ASM ifneq (,$(strip $(LTC_DEBUG))) -CFLAGS += -g3 -DLTC_NO_ASM -DLTC_TEST_DBG=$(LTC_DEBUG) +CFLAGS += -DLTC_TEST_DBG=$(LTC_DEBUG) else -CFLAGS += -g3 -DLTC_NO_ASM -DLTC_TEST_DBG +CFLAGS += -DLTC_TEST_DBG endif else diff --git a/run.sh b/run.sh index 5c5b3922b..a0f6af35f 100755 --- a/run.sh +++ b/run.sh @@ -22,6 +22,16 @@ else exit 1 fi +rm -f testok.txt +bash build.sh " $1" "$2" "$3 LTC_DEBUG=1" "$4" "$5" +if [ -a testok.txt ] && [ -f testok.txt ]; then + echo +else + echo + echo "Test failed" + exit 1 +fi + rm -f testok.txt bash build.sh " $1" "$2" "$3" "$4" "$5" if [ -a testok.txt ] && [ -f testok.txt ]; then From 8c1d55f4c05cd9561ce866e73432b33a9864e48a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 6 Jun 2017 18:33:28 +0200 Subject: [PATCH 0797/1192] fix error when compiling w/ LTC_CLEAN_STACK but w/o LTC_FAST --- src/encauth/ccm/ccm_memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index 3e1920a8a..de842816d 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -378,7 +378,9 @@ int ccm_memory(int cipher, } #ifdef LTC_CLEAN_STACK +#ifdef LTC_FAST fastMask = 0; +#endif mask = 0; zeromem(skey, sizeof(*skey)); zeromem(PAD, sizeof(PAD)); From b51a3f6dab022853930bbec772d05825645e2bb1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 6 Jun 2017 18:47:28 +0200 Subject: [PATCH 0798/1192] update notes/hashsum_tv.txt --- notes/hashsum_tv.txt | 58 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/notes/hashsum_tv.txt b/notes/hashsum_tv.txt index 228d9f0a2..c7ee41a1e 100644 --- a/notes/hashsum_tv.txt +++ b/notes/hashsum_tv.txt @@ -1,29 +1,29 @@ -blake2b-160: 684b540eb245ebba2cd66b7814fe6d787868a5bb *testprof/test.key -blake2b-256: 3aaa08120aa0174c105fd1f3412e3da30c3bbb9073569b0b8ae458b34de7780e *testprof/test.key -blake2b-384: c33f39ab19099d5dea6789479e23447857803a3f45361ea58dd69c7b8037c8697544b6a741e236215adcb8b38fa0cfc4 *testprof/test.key -blake2b-512: a2daabae6996e3bbfb76c5d277fb881107037c756173f510d83a78f669cf0b70a5088b971e30ca2168381568ea3d30b80a7b500944a5e2e3294f25aed4c3a5f1 *testprof/test.key -blake2s-128: 7e1f9b6de11a3c597308f9d8aacd7321 *testprof/test.key -blake2s-160: 3d1c9ae1a0afe8a6ef8b61d5380de7b061cd353c *testprof/test.key -blake2s-224: 95dacd83d0421b2d69a52d92ee54143bb97c91a61450d917a88d4388 *testprof/test.key -blake2s-256: 92ac6dc88b9ce4a75b2a54783435a37919303f713396db0e9ccd976d8c55f1cf *testprof/test.key -chc_hash: d50da1ea9b53c0b891c8bcb0a4c6e5e0 *testprof/test.key -md2: 0b327a17a102580ccde8081c18f137c7 *testprof/test.key -md4: 6df7b3c1f7fbcbf6b8246dc0046e9d6b *testprof/test.key -md5: 48fd9ed11c633069c3cf721611696a73 *testprof/test.key -rmd128: a78170e11d56605eb0f5e05e6a218e61 *testprof/test.key -rmd160: 56236b14cd15958c58136a295fa2b07c5edee009 *testprof/test.key -rmd256: a0a658b25b8841f20be8151eb5e2c1229f085dd5cf7aa8bef4c8e07ea5738913 *testprof/test.key -rmd320: 2ec15ca947f29dd8cef4782aeaeb4541ac00dc29e1649c4f5f4578ef0287091e513f9da423ce7319 *testprof/test.key -sha1: c17a11eef02d7a2ad7250bc2ee22bdf37ed21f0f *testprof/test.key -sha224: b226daa069512c849d55866470c23543d87e1fb768171efdcc6ab59a *testprof/test.key -sha256: 76ec7faebdc42a4de35ca70024c2d273e9f7856ca61612e89f5f66350ba8cf5f *testprof/test.key -sha3-224: 09525d6410c462e00e72ccd4304290bc59ff2b1b8e5322dbc197e169 *testprof/test.key -sha3-256: b9016fc9976545ad0183775d88f20df5295d40b31db00d85f6916333260b8ae2 *testprof/test.key -sha3-384: 5452977763b602df4185bbe7cce193346b09ee20d4a45a780fd44237e335ceaa71b9da06242621e159d796db9043c9be *testprof/test.key -sha3-512: 1fadf63073c8613d38d5c944e2e3f7e086d94d93dceb2eec1e9693fd44158f3127c90cbaa8a13035cc9ff9b3572c9dce836bea15c92e8a78b036ec382caceb0f *testprof/test.key -sha384: 7cc080c662524617e56d5a49f1c185909e9b1858a86684161ddd97fc5426f693b53f59d779de16da25dcb1259df879e5 *testprof/test.key -sha512: f90afe4d254716a9770fd2c4f29ca544f2975f961cbd7fa207117383e4e48f7a2e1ade4aac333a2cb8c227dd6af2fff4d87c31c2a3916ae24d507c7c94c21818 *testprof/test.key -sha512-224: 64ec566b5c2de736eab1b4e8542dc110f736819ea7f8f48e3712fbad *testprof/test.key -sha512-256: db880bce4beb7246510febb961c7595aab57a15de6f90cd079f145e476b5d773 *testprof/test.key -tiger: 97d713850e7affac30a642572c1ee7b18793d5b9e0ef5932 *testprof/test.key -whirlpool: d7d41c755e0f28313f254cb198e0bfa42f56670595d97b80dceec754825d69938a9c11e5bf16e9a3809a62a09bddf021f3dbff4302ceec7ba46c88b41772b711 *testprof/test.key +blake2b-160: 684b540eb245ebba2cd66b7814fe6d787868a5bb *tests/test.key +blake2b-256: 3aaa08120aa0174c105fd1f3412e3da30c3bbb9073569b0b8ae458b34de7780e *tests/test.key +blake2b-384: c33f39ab19099d5dea6789479e23447857803a3f45361ea58dd69c7b8037c8697544b6a741e236215adcb8b38fa0cfc4 *tests/test.key +blake2b-512: a2daabae6996e3bbfb76c5d277fb881107037c756173f510d83a78f669cf0b70a5088b971e30ca2168381568ea3d30b80a7b500944a5e2e3294f25aed4c3a5f1 *tests/test.key +blake2s-128: 7e1f9b6de11a3c597308f9d8aacd7321 *tests/test.key +blake2s-160: 3d1c9ae1a0afe8a6ef8b61d5380de7b061cd353c *tests/test.key +blake2s-224: 95dacd83d0421b2d69a52d92ee54143bb97c91a61450d917a88d4388 *tests/test.key +blake2s-256: 92ac6dc88b9ce4a75b2a54783435a37919303f713396db0e9ccd976d8c55f1cf *tests/test.key +chc_hash: d50da1ea9b53c0b891c8bcb0a4c6e5e0 *tests/test.key +md2: 0b327a17a102580ccde8081c18f137c7 *tests/test.key +md4: 6df7b3c1f7fbcbf6b8246dc0046e9d6b *tests/test.key +md5: 48fd9ed11c633069c3cf721611696a73 *tests/test.key +rmd128: a78170e11d56605eb0f5e05e6a218e61 *tests/test.key +rmd160: 56236b14cd15958c58136a295fa2b07c5edee009 *tests/test.key +rmd256: a0a658b25b8841f20be8151eb5e2c1229f085dd5cf7aa8bef4c8e07ea5738913 *tests/test.key +rmd320: 2ec15ca947f29dd8cef4782aeaeb4541ac00dc29e1649c4f5f4578ef0287091e513f9da423ce7319 *tests/test.key +sha1: c17a11eef02d7a2ad7250bc2ee22bdf37ed21f0f *tests/test.key +sha224: b226daa069512c849d55866470c23543d87e1fb768171efdcc6ab59a *tests/test.key +sha256: 76ec7faebdc42a4de35ca70024c2d273e9f7856ca61612e89f5f66350ba8cf5f *tests/test.key +sha3-224: 09525d6410c462e00e72ccd4304290bc59ff2b1b8e5322dbc197e169 *tests/test.key +sha3-256: b9016fc9976545ad0183775d88f20df5295d40b31db00d85f6916333260b8ae2 *tests/test.key +sha3-384: 5452977763b602df4185bbe7cce193346b09ee20d4a45a780fd44237e335ceaa71b9da06242621e159d796db9043c9be *tests/test.key +sha3-512: 1fadf63073c8613d38d5c944e2e3f7e086d94d93dceb2eec1e9693fd44158f3127c90cbaa8a13035cc9ff9b3572c9dce836bea15c92e8a78b036ec382caceb0f *tests/test.key +sha384: 7cc080c662524617e56d5a49f1c185909e9b1858a86684161ddd97fc5426f693b53f59d779de16da25dcb1259df879e5 *tests/test.key +sha512: f90afe4d254716a9770fd2c4f29ca544f2975f961cbd7fa207117383e4e48f7a2e1ade4aac333a2cb8c227dd6af2fff4d87c31c2a3916ae24d507c7c94c21818 *tests/test.key +sha512-224: 64ec566b5c2de736eab1b4e8542dc110f736819ea7f8f48e3712fbad *tests/test.key +sha512-256: db880bce4beb7246510febb961c7595aab57a15de6f90cd079f145e476b5d773 *tests/test.key +tiger: 97d713850e7affac30a642572c1ee7b18793d5b9e0ef5932 *tests/test.key +whirlpool: d7d41c755e0f28313f254cb198e0bfa42f56670595d97b80dceec754825d69938a9c11e5bf16e9a3809a62a09bddf021f3dbff4302ceec7ba46c88b41772b711 *tests/test.key From 7aaa4230041145c7b66cb4b15f6bab2dd46a1915 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 7 Jun 2017 20:14:27 +0200 Subject: [PATCH 0799/1192] tuning makefiles - mingw, msvc, cygwin --- makefile.mingw | 21 ++++++++++----------- makefile.msvc | 24 ++++++++++++------------ makefile.unix | 7 +++---- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index e70028fc4..d3ce92a91 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -187,7 +187,7 @@ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o -#List of test objects to compile (all goes to libtomcrypt_prof.a) +#List of test objects to compile TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ @@ -235,19 +235,18 @@ $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) $(STRIP) -S $(LIBMAIN_D) #Demo tools/utilities -hashsum: demos/hashsum.o tests/common.o $(LIBMAIN_S) +hashsum.exe: demos/hashsum.o tests/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -crypt: demos/crypt.o tests/common.o $(LIBMAIN_S) +ltcrypt.exe: demos/ltcrypt.o tests/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -small: demos/small.o tests/common.o $(LIBMAIN_S) +small.exe: demos/small.o tests/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ -tv_gen: demos/tv_gen.o tests/common.o $(LIBMAIN_S) +tv_gen.exe: demos/tv_gen.o tests/common.o $(LIBMAIN_S) $(CC) $? $(LTC_LDFLAGS) -o $@ - -#Tests + timing tests timing.exe: demos/timing.o tests/common.o $(LIBMAIN_S) - $(CC) demos/timing.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ - @echo NOTICE: start the tests by: timing.exe + $(CC) $? $(LTC_LDFLAGS) -o $@ + +#Tests test.exe: $(TOBJECTS) $(LIBMAIN_S) $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by: test.exe @@ -257,8 +256,8 @@ all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) hashsum.exe ltcrypt.exe small.exe tv test: test.exe clean: - @cmd /c del /Q *_tv.txt 2>nul - @cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul + @-cmd /c del /Q *_tv.txt 2>nul + @-cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul #Install the library + headers install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) diff --git a/makefile.msvc b/makefile.msvc index 2d21254be..97cb6c105 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -180,7 +180,7 @@ src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/st src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128.obj \ src/stream/sober128/sober128_test.obj -#List of test objects to compile (all goes to tomcrypt_prof.lib) +#List of test objects to compile TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_tests.obj tests/dh_test.obj \ tests/dsa_test.obj tests/ecc_test.obj tests/file_test.obj tests/katja_test.obj tests/mac_test.obj tests/misc_test.obj \ tests/modes_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj tests/pkcs_1_emsa_test.obj \ @@ -222,28 +222,28 @@ $(LIBMAIN_S): $(OBJECTS) lib /out:$(LIBMAIN_S) $(OBJECTS) #Demo tools/utilities -hashsum.exe: demos/hashsum.c $(LIBMAIN_S) - cl $(LTC_CFLAGS) demos/hashsum.c $(LIBMAIN_S) $(LTC_LDFLAGS) +hashsum.exe: demos/hashsum.c tests/common.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/hashsum.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ ltcrypt.exe: demos/ltcrypt.c $(LIBMAIN_S) - cl $(LTC_CFLAGS) demos/ltcrypt.c $(LIBMAIN_S) $(LTC_LDFLAGS) + cl $(LTC_CFLAGS) demos/ltcrypt.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ small.exe: demos/small.c $(LIBMAIN_S) - cl $(LTC_CFLAGS) demos/small.c $(LIBMAIN_S) $(LTC_LDFLAGS) + cl $(LTC_CFLAGS) demos/small.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ tv_gen.exe: demos/tv_gen.c $(LIBMAIN_S) - cl $(LTC_CFLAGS) demos/tv_gen.c $(LIBMAIN_S) $(LTC_LDFLAGS) - -#Tests + timing tests + cl $(LTC_CFLAGS) demos/tv_gen.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ timing.exe: demos/timing.c $(LIBMAIN_S) - cl $(LTC_CFLAGS) demos/timing.c $(LIBMAIN_S) $(LTC_LDFLAGS) + cl $(LTC_CFLAGS) demos/timing.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ + +#Tests test.exe: $(LIBMAIN_S) $(TOBJECTS) - cl $(LTC_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) + cl $(LTC_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ all: $(LIBMAIN_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe test: test.exe clean: - @cmd /c del /Q *_tv.txt 2>nul - @cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul + @-cmd /c del /Q *_tv.txt 2>nul + @-cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul #Install the library + headers install: $(LIBMAIN_S) diff --git a/makefile.unix b/makefile.unix index 4ec30a2fa..f1507a4fa 100644 --- a/makefile.unix +++ b/makefile.unix @@ -245,11 +245,10 @@ small: demos/small.o tests/common.o $(LIBMAIN_S) $(CC) demos/small.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ tv_gen: demos/tv_gen.o tests/common.o $(LIBMAIN_S) $(CC) demos/tv_gen.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +timing: demos/timing.o tests/common.o $(LIBMAIN_S) + $(CC) demos/timing.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -#Tests + timing tests -timing: demos/timing.o $(LIBMAIN_S) tests/common.o - $(CC) demos/timing.o $(LIBMAIN_S) tests/common.o $(LTC_LDFLAGS) -o $@ - @echo "NOTICE: start the timing tests by: ./timing" +#Tests test: $(TOBJECTS) $(LIBMAIN_S) $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the tests by: ./test" From 7f91e5ae65a252dcc9e0f6df7d747a8a87af1764 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 7 Jun 2017 23:42:33 +0200 Subject: [PATCH 0800/1192] requiring 'name != NULL' in find_cipher_any() doesn't make sense --- src/misc/crypt/crypt_find_cipher_any.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/misc/crypt/crypt_find_cipher_any.c b/src/misc/crypt/crypt_find_cipher_any.c index 34cd8f008..a25a5b54d 100644 --- a/src/misc/crypt/crypt_find_cipher_any.c +++ b/src/misc/crypt/crypt_find_cipher_any.c @@ -26,10 +26,10 @@ int find_cipher_any(const char *name, int blocklen, int keylen) { int x; - LTC_ARGCHK(name != NULL); - - x = find_cipher(name); - if (x != -1) return x; + if(name != NULL) { + x = find_cipher(name); + if (x != -1) return x; + } LTC_MUTEX_LOCK(<c_cipher_mutex); for (x = 0; x < TAB_SIZE; x++) { From 4ceb82bf542d97766e0c4ea3c4cb4ef1f61c686a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 11:49:13 +0200 Subject: [PATCH 0801/1192] add register_all_{ciphers,hashes,prngs}() --- helper.pl | 26 +++--- src/headers/tomcrypt_cipher.h | 1 + src/headers/tomcrypt_hash.h | 1 + src/headers/tomcrypt_prng.h | 1 + src/misc/crypt/crypt_register_all_ciphers.c | 98 +++++++++++++++++++++ src/misc/crypt/crypt_register_all_hashes.c | 96 ++++++++++++++++++++ src/misc/crypt/crypt_register_all_prngs.c | 45 ++++++++++ 7 files changed, 258 insertions(+), 10 deletions(-) create mode 100644 src/misc/crypt/crypt_register_all_ciphers.c create mode 100644 src/misc/crypt/crypt_register_all_hashes.c create mode 100644 src/misc/crypt/crypt_register_all_prngs.c diff --git a/helper.pl b/helper.pl index f8a7eee94..6a90cfead 100755 --- a/helper.pl +++ b/helper.pl @@ -81,27 +81,33 @@ sub check_defines { return $fails; } -sub check_descriptors { +sub check_descriptor { + my $which = shift; + my $what = shift; my @src; my @descriptors; - find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, './src/hashes/'); + find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, "./src/${which}/"); for my $f (@src) { - my @n = map { my $x = $_; $x =~ s/^.*?ltc_hash_descriptor\s+(\S+).*$/$1/; $x } grep { $_ =~ /ltc_hash_descriptor/ } split /\n/, read_file($f); - push @descriptors, @n if @n; - } - find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, './src/ciphers/'); - for my $f (@src) { - my @n = map { my $x = $_; $x =~ s/^.*?ltc_cipher_descriptor\s+(\S+).*$/$1/; $x } grep { $_ =~ /ltc_cipher_descriptor/ } split /\n/, read_file($f); + my @n = map { my $x = $_; $x =~ s/^.*?ltc_${what}_descriptor\s+(\S+).*$/$1/; $x } grep { $_ =~ /ltc_${what}_descriptor/ } split /\n/, read_file($f); push @descriptors, @n if @n; } my $fails = 0; for my $d (@descriptors) { - for my $f (qw{ tests/common.c }) { + for my $f ("./src/misc/crypt/crypt_register_all_${which}.c") { my $txt = read_file($f); warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/; } } - warn( $fails > 0 ? "check-hashes: FAIL $fails\n" : "check-hashes: PASS\n" ); + my $name = sprintf("%-17s", "check-${which}:"); + warn( $fails > 0 ? "${name}FAIL $fails\n" : "${name}PASS\n" ); + return $fails; +} + +sub check_descriptors { + my $fails = 0; + $fails = $fails + check_descriptor("ciphers", "cipher"); + $fails = $fails + check_descriptor("hashes", "hash"); + $fails = $fails + check_descriptor("prngs", "prng"); return $fails; } diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index 58f02db4d..b49a799da 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -933,6 +933,7 @@ int find_cipher_any(const char *name, int blocklen, int keylen); int find_cipher_id(unsigned char ID); int register_cipher(const struct ltc_cipher_descriptor *cipher); int unregister_cipher(const struct ltc_cipher_descriptor *cipher); +int register_all_ciphers(void); int cipher_is_valid(int idx); LTC_MUTEX_PROTO(ltc_cipher_mutex) diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index c73d387a9..1c272e2df 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -461,6 +461,7 @@ int find_hash_oid(const unsigned long *ID, unsigned long IDlen); int find_hash_any(const char *name, int digestlen); int register_hash(const struct ltc_hash_descriptor *hash); int unregister_hash(const struct ltc_hash_descriptor *hash); +int register_all_hashes(void); int hash_is_valid(int idx); LTC_MUTEX_PROTO(ltc_hash_mutex) diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index e06c68b8d..1849e55a4 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -199,6 +199,7 @@ extern const struct ltc_prng_descriptor sober128_desc; int find_prng(const char *name); int register_prng(const struct ltc_prng_descriptor *prng); int unregister_prng(const struct ltc_prng_descriptor *prng); +int register_all_prngs(void); int prng_is_valid(int idx); LTC_MUTEX_PROTO(ltc_prng_mutex) diff --git a/src/misc/crypt/crypt_register_all_ciphers.c b/src/misc/crypt/crypt_register_all_ciphers.c new file mode 100644 index 000000000..7d83acb24 --- /dev/null +++ b/src/misc/crypt/crypt_register_all_ciphers.c @@ -0,0 +1,98 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +/** + @file crypt_register_all_ciphers.c + + Steffen Jaeckel +*/ + +#define REGISTER_CIPHER(h) do {\ + LTC_ARGCHK((err = register_cipher(h) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ +} while(0) + +int register_all_ciphers(void) +{ + int err = CRYPT_NOP; + +#ifdef LTC_RIJNDAEL +#ifdef ENCRYPT_ONLY + /* alternative would be + * register_cipher(&rijndael_enc_desc); + */ + REGISTER_CIPHER(&aes_enc_desc); +#else + /* alternative would be + * register_cipher(&rijndael_desc); + */ + REGISTER_CIPHER(&aes_desc); +#endif +#endif +#ifdef LTC_BLOWFISH + REGISTER_CIPHER(&blowfish_desc); +#endif +#ifdef LTC_XTEA + REGISTER_CIPHER(&xtea_desc); +#endif +#ifdef LTC_RC5 + REGISTER_CIPHER(&rc5_desc); +#endif +#ifdef LTC_RC6 + REGISTER_CIPHER(&rc6_desc); +#endif +#ifdef LTC_SAFERP + REGISTER_CIPHER(&saferp_desc); +#endif +#ifdef LTC_TWOFISH + REGISTER_CIPHER(&twofish_desc); +#endif +#ifdef LTC_SAFER + REGISTER_CIPHER(&safer_k64_desc); + REGISTER_CIPHER(&safer_sk64_desc); + REGISTER_CIPHER(&safer_k128_desc); + REGISTER_CIPHER(&safer_sk128_desc); +#endif +#ifdef LTC_RC2 + REGISTER_CIPHER(&rc2_desc); +#endif +#ifdef LTC_DES + REGISTER_CIPHER(&des_desc); + REGISTER_CIPHER(&des3_desc); +#endif +#ifdef LTC_CAST5 + REGISTER_CIPHER(&cast5_desc); +#endif +#ifdef LTC_NOEKEON + REGISTER_CIPHER(&noekeon_desc); +#endif +#ifdef LTC_SKIPJACK + REGISTER_CIPHER(&skipjack_desc); +#endif +#ifdef LTC_ANUBIS + REGISTER_CIPHER(&anubis_desc); +#endif +#ifdef LTC_KHAZAD + REGISTER_CIPHER(&khazad_desc); +#endif +#ifdef LTC_KSEED + REGISTER_CIPHER(&kseed_desc); +#endif +#ifdef LTC_KASUMI + REGISTER_CIPHER(&kasumi_desc); +#endif +#ifdef LTC_MULTI2 + REGISTER_CIPHER(&multi2_desc); +#endif +#ifdef LTC_CAMELLIA + REGISTER_CIPHER(&camellia_desc); +#endif + return err; +} diff --git a/src/misc/crypt/crypt_register_all_hashes.c b/src/misc/crypt/crypt_register_all_hashes.c new file mode 100644 index 000000000..64ec0ccf2 --- /dev/null +++ b/src/misc/crypt/crypt_register_all_hashes.c @@ -0,0 +1,96 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +/** + @file crypt_register_all_hashes.c + + Steffen Jaeckel +*/ + +#define REGISTER_HASH(h) do {\ + LTC_ARGCHK((err = register_hash(h) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ +} while(0) + +int register_all_hashes(void) +{ + int err = CRYPT_NOP; +#ifdef LTC_TIGER + REGISTER_HASH(&tiger_desc); +#endif +#ifdef LTC_MD2 + REGISTER_HASH(&md2_desc); +#endif +#ifdef LTC_MD4 + REGISTER_HASH(&md4_desc); +#endif +#ifdef LTC_MD5 + REGISTER_HASH(&md5_desc); +#endif +#ifdef LTC_SHA1 + REGISTER_HASH(&sha1_desc); +#endif +#ifdef LTC_SHA224 + REGISTER_HASH(&sha224_desc); +#endif +#ifdef LTC_SHA256 + REGISTER_HASH(&sha256_desc); +#endif +#ifdef LTC_SHA384 + REGISTER_HASH(&sha384_desc); +#endif +#ifdef LTC_SHA512 + REGISTER_HASH(&sha512_desc); +#endif +#ifdef LTC_SHA512_224 + REGISTER_HASH(&sha512_224_desc); +#endif +#ifdef LTC_SHA512_256 + REGISTER_HASH(&sha512_256_desc); +#endif +#ifdef LTC_SHA3 + REGISTER_HASH(&sha3_224_desc); + REGISTER_HASH(&sha3_256_desc); + REGISTER_HASH(&sha3_384_desc); + REGISTER_HASH(&sha3_512_desc); +#endif +#ifdef LTC_RIPEMD128 + REGISTER_HASH(&rmd128_desc); +#endif +#ifdef LTC_RIPEMD160 + REGISTER_HASH(&rmd160_desc); +#endif +#ifdef LTC_RIPEMD256 + REGISTER_HASH(&rmd256_desc); +#endif +#ifdef LTC_RIPEMD320 + REGISTER_HASH(&rmd320_desc); +#endif +#ifdef LTC_WHIRLPOOL + REGISTER_HASH(&whirlpool_desc); +#endif +#ifdef LTC_BLAKE2S + REGISTER_HASH(&blake2s_128_desc); + REGISTER_HASH(&blake2s_160_desc); + REGISTER_HASH(&blake2s_224_desc); + REGISTER_HASH(&blake2s_256_desc); +#endif +#ifdef LTC_BLAKE2S + REGISTER_HASH(&blake2b_160_desc); + REGISTER_HASH(&blake2b_256_desc); + REGISTER_HASH(&blake2b_384_desc); + REGISTER_HASH(&blake2b_512_desc); +#endif +#ifdef LTC_CHC_HASH + REGISTER_HASH(&chc_desc); + LTC_ARGCHK((err = chc_register(find_cipher_any("aes", 8, 16))) == CRYPT_OK); +#endif + return err; +} diff --git a/src/misc/crypt/crypt_register_all_prngs.c b/src/misc/crypt/crypt_register_all_prngs.c new file mode 100644 index 000000000..ccd8a8c7d --- /dev/null +++ b/src/misc/crypt/crypt_register_all_prngs.c @@ -0,0 +1,45 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +/** + @file crypt_register_all_prngs.c + + Steffen Jaeckel +*/ + +#define REGISTER_PRNG(h) do {\ + LTC_ARGCHK((err = register_prng(h) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ +} while(0) + +int register_all_prngs(void) +{ + int err = CRYPT_NOP; +#ifdef LTC_YARROW + REGISTER_PRNG(&yarrow_desc); +#endif +#ifdef LTC_FORTUNA + REGISTER_PRNG(&fortuna_desc); +#endif +#ifdef LTC_RC4 + REGISTER_PRNG(&rc4_desc); +#endif +#ifdef LTC_CHACHA20_PRNG + REGISTER_PRNG(&chacha20_prng_desc); +#endif +#ifdef LTC_SOBER128 + REGISTER_PRNG(&sober128_desc); +#endif +#ifdef LTC_SPRNG + REGISTER_PRNG(&sprng_desc); +#endif + + return err; +} From da3b61c7b60fb70d76944584b29da5647663d1f9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 11:51:36 +0200 Subject: [PATCH 0802/1192] re-structure tests/common.c --- tests/common.c | 391 ------------------------------------------ tests/common.h | 3 - tests/prng_test.c | 45 +++++ tests/test.c | 177 +++++++++++++++++++ tests/tomcrypt_test.h | 1 + 5 files changed, 223 insertions(+), 394 deletions(-) create mode 100644 tests/prng_test.c diff --git a/tests/common.c b/tests/common.c index 24865868a..6fbab1fb8 100644 --- a/tests/common.c +++ b/tests/common.c @@ -62,394 +62,3 @@ void print_hex(const char* what, const void* v, const unsigned long l) } prng_state yarrow_prng; - -/* - * unregister ciphers, hashes & prngs - */ -static void _unregister_all(void) -{ -#ifdef LTC_RIJNDAEL - unregister_cipher(&aes_desc); -#endif -#ifdef LTC_BLOWFISH - unregister_cipher(&blowfish_desc); -#endif -#ifdef LTC_XTEA - unregister_cipher(&xtea_desc); -#endif -#ifdef LTC_RC5 - unregister_cipher(&rc5_desc); -#endif -#ifdef LTC_RC6 - unregister_cipher(&rc6_desc); -#endif -#ifdef LTC_SAFERP - unregister_cipher(&saferp_desc); -#endif -#ifdef LTC_TWOFISH - unregister_cipher(&twofish_desc); -#endif -#ifdef LTC_SAFER - unregister_cipher(&safer_k64_desc); - unregister_cipher(&safer_sk64_desc); - unregister_cipher(&safer_k128_desc); - unregister_cipher(&safer_sk128_desc); -#endif -#ifdef LTC_RC2 - unregister_cipher(&rc2_desc); -#endif -#ifdef LTC_DES - unregister_cipher(&des_desc); - unregister_cipher(&des3_desc); -#endif -#ifdef LTC_CAST5 - unregister_cipher(&cast5_desc); -#endif -#ifdef LTC_NOEKEON - unregister_cipher(&noekeon_desc); -#endif -#ifdef LTC_SKIPJACK - unregister_cipher(&skipjack_desc); -#endif -#ifdef LTC_KHAZAD - unregister_cipher(&khazad_desc); -#endif -#ifdef LTC_ANUBIS - unregister_cipher(&anubis_desc); -#endif -#ifdef LTC_KSEED - unregister_cipher(&kseed_desc); -#endif -#ifdef LTC_KASUMI - unregister_cipher(&kasumi_desc); -#endif -#ifdef LTC_MULTI2 - unregister_cipher(&multi2_desc); -#endif -#ifdef LTC_CAMELLIA - unregister_cipher(&camellia_desc); -#endif - -#ifdef LTC_TIGER - unregister_hash(&tiger_desc); -#endif -#ifdef LTC_MD2 - unregister_hash(&md2_desc); -#endif -#ifdef LTC_MD4 - unregister_hash(&md4_desc); -#endif -#ifdef LTC_MD5 - unregister_hash(&md5_desc); -#endif -#ifdef LTC_SHA1 - unregister_hash(&sha1_desc); -#endif -#ifdef LTC_SHA224 - unregister_hash(&sha224_desc); -#endif -#ifdef LTC_SHA256 - unregister_hash(&sha256_desc); -#endif -#ifdef LTC_SHA384 - unregister_hash(&sha384_desc); -#endif -#ifdef LTC_SHA512 - unregister_hash(&sha512_desc); -#endif -#ifdef LTC_SHA512_224 - unregister_hash(&sha512_224_desc); -#endif -#ifdef LTC_SHA512_256 - unregister_hash(&sha512_256_desc); -#endif -#ifdef LTC_SHA3 - unregister_hash(&sha3_224_desc); - unregister_hash(&sha3_256_desc); - unregister_hash(&sha3_384_desc); - unregister_hash(&sha3_512_desc); -#endif -#ifdef LTC_RIPEMD128 - unregister_hash(&rmd128_desc); -#endif -#ifdef LTC_RIPEMD160 - unregister_hash(&rmd160_desc); -#endif -#ifdef LTC_RIPEMD256 - unregister_hash(&rmd256_desc); -#endif -#ifdef LTC_RIPEMD320 - unregister_hash(&rmd320_desc); -#endif -#ifdef LTC_WHIRLPOOL - unregister_hash(&whirlpool_desc); -#endif -#ifdef LTC_BLAKE2S - unregister_hash(&blake2s_128_desc); - unregister_hash(&blake2s_160_desc); - unregister_hash(&blake2s_224_desc); - unregister_hash(&blake2s_256_desc); -#endif -#ifdef LTC_BLAKE2B - unregister_hash(&blake2b_160_desc); - unregister_hash(&blake2b_256_desc); - unregister_hash(&blake2b_384_desc); - unregister_hash(&blake2b_512_desc); -#endif -#ifdef LTC_CHC_HASH - unregister_hash(&chc_desc); -#endif - - unregister_prng(&yarrow_desc); -#ifdef LTC_FORTUNA - unregister_prng(&fortuna_desc); -#endif -#ifdef LTC_RC4 - unregister_prng(&rc4_desc); -#endif -#ifdef LTC_CHACHA20_PRNG - unregister_prng(&chacha20_prng_desc); -#endif -#ifdef LTC_SOBER128 - unregister_prng(&sober128_desc); -#endif -} /* _cleanup() */ - -#ifdef LTC_PRNG_ENABLE_LTC_RNG - -static unsigned long my_test_rng_read; - -static unsigned long my_test_rng(unsigned char *buf, unsigned long len, - void (*callback)(void)) -{ - unsigned long n; - LTC_UNUSED_PARAM(callback); - for (n = 0; n < len; ++n) { - buf[n] = 4; - } - my_test_rng_read += n; - return n; -} - -#endif - -void register_algs(void) -{ -#ifdef LTC_PRNG_ENABLE_LTC_RNG - unsigned long before; -#endif - int err; - - atexit(_unregister_all); - -#ifdef LTC_RIJNDAEL -#ifdef ENCRYPT_ONLY - /* alternative would be - * register_cipher (&rijndael_enc_desc); - */ - register_cipher (&aes_enc_desc); -#else - /* alternative would be - * register_cipher (&rijndael_desc); - */ - register_cipher (&aes_desc); -#endif -#endif -#ifdef LTC_BLOWFISH - register_cipher (&blowfish_desc); -#endif -#ifdef LTC_XTEA - register_cipher (&xtea_desc); -#endif -#ifdef LTC_RC5 - register_cipher (&rc5_desc); -#endif -#ifdef LTC_RC6 - register_cipher (&rc6_desc); -#endif -#ifdef LTC_SAFERP - register_cipher (&saferp_desc); -#endif -#ifdef LTC_TWOFISH - register_cipher (&twofish_desc); -#endif -#ifdef LTC_SAFER - register_cipher (&safer_k64_desc); - register_cipher (&safer_sk64_desc); - register_cipher (&safer_k128_desc); - register_cipher (&safer_sk128_desc); -#endif -#ifdef LTC_RC2 - register_cipher (&rc2_desc); -#endif -#ifdef LTC_DES - register_cipher (&des_desc); - register_cipher (&des3_desc); -#endif -#ifdef LTC_CAST5 - register_cipher (&cast5_desc); -#endif -#ifdef LTC_NOEKEON - register_cipher (&noekeon_desc); -#endif -#ifdef LTC_SKIPJACK - register_cipher (&skipjack_desc); -#endif -#ifdef LTC_ANUBIS - register_cipher (&anubis_desc); -#endif -#ifdef LTC_KHAZAD - register_cipher (&khazad_desc); -#endif -#ifdef LTC_KSEED - register_cipher (&kseed_desc); -#endif -#ifdef LTC_KASUMI - register_cipher (&kasumi_desc); -#endif -#ifdef LTC_MULTI2 - register_cipher (&multi2_desc); -#endif -#ifdef LTC_CAMELLIA - register_cipher (&camellia_desc); -#endif - -#ifdef LTC_TIGER - register_hash (&tiger_desc); -#endif -#ifdef LTC_MD2 - register_hash (&md2_desc); -#endif -#ifdef LTC_MD4 - register_hash (&md4_desc); -#endif -#ifdef LTC_MD5 - register_hash (&md5_desc); -#endif -#ifdef LTC_SHA1 - register_hash (&sha1_desc); -#endif -#ifdef LTC_SHA224 - register_hash (&sha224_desc); -#endif -#ifdef LTC_SHA256 - register_hash (&sha256_desc); -#endif -#ifdef LTC_SHA384 - register_hash (&sha384_desc); -#endif -#ifdef LTC_SHA512 - register_hash (&sha512_desc); -#endif -#ifdef LTC_SHA512_224 - register_hash (&sha512_224_desc); -#endif -#ifdef LTC_SHA512_256 - register_hash (&sha512_256_desc); -#endif -#ifdef LTC_SHA3 - register_hash (&sha3_224_desc); - register_hash (&sha3_256_desc); - register_hash (&sha3_384_desc); - register_hash (&sha3_512_desc); -#endif -#ifdef LTC_RIPEMD128 - register_hash (&rmd128_desc); -#endif -#ifdef LTC_RIPEMD160 - register_hash (&rmd160_desc); -#endif -#ifdef LTC_RIPEMD256 - register_hash (&rmd256_desc); -#endif -#ifdef LTC_RIPEMD320 - register_hash (&rmd320_desc); -#endif -#ifdef LTC_WHIRLPOOL - register_hash (&whirlpool_desc); -#endif -#ifdef LTC_BLAKE2S - register_hash(&blake2s_128_desc); - register_hash(&blake2s_160_desc); - register_hash(&blake2s_224_desc); - register_hash(&blake2s_256_desc); -#endif -#ifdef LTC_BLAKE2S - register_hash(&blake2b_160_desc); - register_hash(&blake2b_256_desc); - register_hash(&blake2b_384_desc); - register_hash(&blake2b_512_desc); -#endif -#ifdef LTC_CHC_HASH - register_hash(&chc_desc); - if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) { - fprintf(stderr, "chc_register error: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } -#endif - - -#ifndef LTC_YARROW - #error This demo requires Yarrow. -#endif -register_prng(&yarrow_desc); -#ifdef LTC_FORTUNA -register_prng(&fortuna_desc); -#endif -#ifdef LTC_RC4 -register_prng(&rc4_desc); -#endif -#ifdef LTC_CHACHA20_PRNG -register_prng(&chacha20_prng_desc); -#endif -#ifdef LTC_SOBER128 -register_prng(&sober128_desc); -#endif -#ifdef LTC_SPRNG -register_prng(&sprng_desc); -#endif - -#ifdef LTC_PRNG_ENABLE_LTC_RNG - ltc_rng = my_test_rng; - - before = my_test_rng_read; - if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { - fprintf(stderr, "rng_make_prng with 'my_test_rng' failed: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - - if (before == my_test_rng_read) { - fprintf(stderr, "somehow there was no read from the ltc_rng! %lu == %lu\n", before, my_test_rng_read); - exit(EXIT_FAILURE); - } - - ltc_rng = NULL; -#endif - - if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { - fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err)); - exit(EXIT_FAILURE); - } - - if (strcmp("CRYPT_OK", error_to_string(err))) { - exit(EXIT_FAILURE); - } - -} - -void setup_math(void) -{ -#ifdef USE_LTM - ltc_mp = ltm_desc; -#elif defined(USE_TFM) - ltc_mp = tfm_desc; -#elif defined(USE_GMP) - ltc_mp = gmp_desc; -#elif defined(EXT_MATH_LIB) - extern ltc_math_descriptor EXT_MATH_LIB; - ltc_mp = EXT_MATH_LIB; -#else - fprintf(stderr, "No MPI provider available\n"); - exit(EXIT_FAILURE); -#endif -} diff --git a/tests/common.h b/tests/common.h index 4650d0ccb..483060fe6 100644 --- a/tests/common.h +++ b/tests/common.h @@ -23,7 +23,4 @@ void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); void print_hex(const char* what, const void* v, const unsigned long l); -void register_algs(void); -void setup_math(void); - #endif /* DEMOS_COMMON_H_ */ diff --git a/tests/prng_test.c b/tests/prng_test.c new file mode 100644 index 000000000..15d953d42 --- /dev/null +++ b/tests/prng_test.c @@ -0,0 +1,45 @@ +#include + +#ifdef LTC_PRNG_ENABLE_LTC_RNG + +static unsigned long my_test_rng_read; + +static unsigned long my_test_rng(unsigned char *buf, unsigned long len, + void (*callback)(void)) +{ + unsigned long n; + LTC_UNUSED_PARAM(callback); + for (n = 0; n < len; ++n) { + buf[n] = 4; + } + my_test_rng_read += n; + return n; +} + +#endif + +int prng_test(void) +{ + int err = CRYPT_NOP; +#ifdef LTC_PRNG_ENABLE_LTC_RNG + unsigned long before; + + unsigned long (*previous)(unsigned char *, unsigned long , void (*)(void)) = ltc_rng; + ltc_rng = my_test_rng; + + before = my_test_rng_read; + + if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { + fprintf(stderr, "rng_make_prng with 'my_test_rng' failed: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + + if (before == my_test_rng_read) { + fprintf(stderr, "somehow there was no read from the ltc_rng! %lu == %lu\n", before, my_test_rng_read); + exit(EXIT_FAILURE); + } + + ltc_rng = previous; +#endif + return err; +} diff --git a/tests/test.c b/tests/test.c index 85165d82c..69d7c1aea 100644 --- a/tests/test.c +++ b/tests/test.c @@ -30,6 +30,7 @@ static const struct { LTC_TEST_FN(katja_test), LTC_TEST_FN(file_test), LTC_TEST_FN(multi_test), + LTC_TEST_FN(prng_test), }; #if defined(_WIN32) @@ -62,6 +63,182 @@ static ulong64 epoch_usec(void) #endif } + +/* + * unregister ciphers, hashes & prngs + */ +static void _unregister_all(void) +{ +#ifdef LTC_RIJNDAEL + unregister_cipher(&aes_desc); +#endif +#ifdef LTC_BLOWFISH + unregister_cipher(&blowfish_desc); +#endif +#ifdef LTC_XTEA + unregister_cipher(&xtea_desc); +#endif +#ifdef LTC_RC5 + unregister_cipher(&rc5_desc); +#endif +#ifdef LTC_RC6 + unregister_cipher(&rc6_desc); +#endif +#ifdef LTC_SAFERP + unregister_cipher(&saferp_desc); +#endif +#ifdef LTC_TWOFISH + unregister_cipher(&twofish_desc); +#endif +#ifdef LTC_SAFER + unregister_cipher(&safer_k64_desc); + unregister_cipher(&safer_sk64_desc); + unregister_cipher(&safer_k128_desc); + unregister_cipher(&safer_sk128_desc); +#endif +#ifdef LTC_RC2 + unregister_cipher(&rc2_desc); +#endif +#ifdef LTC_DES + unregister_cipher(&des_desc); + unregister_cipher(&des3_desc); +#endif +#ifdef LTC_CAST5 + unregister_cipher(&cast5_desc); +#endif +#ifdef LTC_NOEKEON + unregister_cipher(&noekeon_desc); +#endif +#ifdef LTC_SKIPJACK + unregister_cipher(&skipjack_desc); +#endif +#ifdef LTC_KHAZAD + unregister_cipher(&khazad_desc); +#endif +#ifdef LTC_ANUBIS + unregister_cipher(&anubis_desc); +#endif +#ifdef LTC_KSEED + unregister_cipher(&kseed_desc); +#endif +#ifdef LTC_KASUMI + unregister_cipher(&kasumi_desc); +#endif +#ifdef LTC_MULTI2 + unregister_cipher(&multi2_desc); +#endif +#ifdef LTC_CAMELLIA + unregister_cipher(&camellia_desc); +#endif + +#ifdef LTC_TIGER + unregister_hash(&tiger_desc); +#endif +#ifdef LTC_MD2 + unregister_hash(&md2_desc); +#endif +#ifdef LTC_MD4 + unregister_hash(&md4_desc); +#endif +#ifdef LTC_MD5 + unregister_hash(&md5_desc); +#endif +#ifdef LTC_SHA1 + unregister_hash(&sha1_desc); +#endif +#ifdef LTC_SHA224 + unregister_hash(&sha224_desc); +#endif +#ifdef LTC_SHA256 + unregister_hash(&sha256_desc); +#endif +#ifdef LTC_SHA384 + unregister_hash(&sha384_desc); +#endif +#ifdef LTC_SHA512 + unregister_hash(&sha512_desc); +#endif +#ifdef LTC_SHA512_224 + unregister_hash(&sha512_224_desc); +#endif +#ifdef LTC_SHA512_256 + unregister_hash(&sha512_256_desc); +#endif +#ifdef LTC_SHA3 + unregister_hash(&sha3_224_desc); + unregister_hash(&sha3_256_desc); + unregister_hash(&sha3_384_desc); + unregister_hash(&sha3_512_desc); +#endif +#ifdef LTC_RIPEMD128 + unregister_hash(&rmd128_desc); +#endif +#ifdef LTC_RIPEMD160 + unregister_hash(&rmd160_desc); +#endif +#ifdef LTC_RIPEMD256 + unregister_hash(&rmd256_desc); +#endif +#ifdef LTC_RIPEMD320 + unregister_hash(&rmd320_desc); +#endif +#ifdef LTC_WHIRLPOOL + unregister_hash(&whirlpool_desc); +#endif +#ifdef LTC_BLAKE2S + unregister_hash(&blake2s_128_desc); + unregister_hash(&blake2s_160_desc); + unregister_hash(&blake2s_224_desc); + unregister_hash(&blake2s_256_desc); +#endif +#ifdef LTC_BLAKE2B + unregister_hash(&blake2b_160_desc); + unregister_hash(&blake2b_256_desc); + unregister_hash(&blake2b_384_desc); + unregister_hash(&blake2b_512_desc); +#endif +#ifdef LTC_CHC_HASH + unregister_hash(&chc_desc); +#endif + + unregister_prng(&yarrow_desc); +#ifdef LTC_FORTUNA + unregister_prng(&fortuna_desc); +#endif +#ifdef LTC_RC4 + unregister_prng(&rc4_desc); +#endif +#ifdef LTC_CHACHA20_PRNG + unregister_prng(&chacha20_prng_desc); +#endif +#ifdef LTC_SOBER128 + unregister_prng(&sober128_desc); +#endif +} /* _cleanup() */ + +static void register_algs(void) +{ + int err; + + atexit(_unregister_all); + +#ifndef LTC_YARROW + #error This demo requires Yarrow. +#endif + register_all_ciphers(); + register_all_hashes(); + register_all_prngs(); + + if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { + fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } + + if (strcmp("CRYPT_OK", error_to_string(err))) { + exit(EXIT_FAILURE); + } +} + int main(int argc, char **argv) { int x, pass = 0, fail = 0, nop = 0; diff --git a/tests/tomcrypt_test.h b/tests/tomcrypt_test.h index e830b14a3..63364e41a 100644 --- a/tests/tomcrypt_test.h +++ b/tests/tomcrypt_test.h @@ -51,6 +51,7 @@ int misc_test(void); int base64_test(void); int file_test(void); int multi_test(void); +int prng_test(void); #ifdef LTC_PKCS_1 extern const struct ltc_prng_descriptor no_prng_desc; From fe0b72ef515e4b673a26a16fc0d49190188a10f6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 11:54:38 +0200 Subject: [PATCH 0803/1192] remove dependency of demos to tests/common --- demos/hashsum.c | 5 ++--- demos/ltcrypt.c | 5 ++--- demos/timing.c | 21 ++++++++++++++++++--- demos/tv_gen.c | 20 ++++++++++++++++---- makefile | 8 ++++---- makefile.mingw | 20 ++++++++++---------- makefile.shared | 4 ++-- makefile.unix | 20 ++++++++++---------- tests/common.h | 6 ------ 9 files changed, 64 insertions(+), 45 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index b6e932e3b..24373f45e 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -15,8 +15,6 @@ #define basename(x) x #endif -#include "common.h" - #if !defined(PATH_MAX) && defined(_MSC_VER) #include #define PATH_MAX MAX_PATH @@ -159,7 +157,8 @@ int main(int argc, char **argv) hashsum = strdup(basename(argv[0])); /* You need to register algorithms before using them */ - register_algs(); + register_all_ciphers(); + register_all_hashes(); if (argc > 1 && (strcmp("-h", argv[1]) == 0 || strcmp("--help", argv[1]) == 0)) { die(EXIT_SUCCESS); } diff --git a/demos/ltcrypt.c b/demos/ltcrypt.c index 91c1e96c9..d4f16d814 100644 --- a/demos/ltcrypt.c +++ b/demos/ltcrypt.c @@ -9,8 +9,6 @@ #include -#include "common.h" - int usage(char *name) { int x; @@ -38,7 +36,8 @@ int main(int argc, char *argv[]) int err; /* register algs, so they can be printed */ - register_algs(); + register_all_ciphers(); + register_all_hashes(); if (argc < 4) { if ((argc > 2) && (!strcmp(argv[1], "-t"))) { diff --git a/demos/timing.c b/demos/timing.c index 91890ae90..f03d74f45 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -1,4 +1,12 @@ -#include +#include + +#if defined(_WIN32) + #define PRI64 "I64d" +#else + #define PRI64 "ll" +#endif + +static prng_state yarrow_prng; /* timing */ #define KTIMES 25 @@ -1341,9 +1349,11 @@ static void time_encmacs(void) int main(void) { - +int err; init_timer(); -register_algs(); +register_all_ciphers(); +register_all_hashes(); +register_all_prngs(); #ifdef USE_LTM ltc_mp = ltm_desc; @@ -1356,6 +1366,11 @@ register_algs(); ltc_mp = EXT_MATH_LIB; #endif +if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { + fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); +} + time_keysched(); time_cipher_ecb(); time_cipher_cbc(); diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 5cb61f18a..93de2db8c 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -1,7 +1,5 @@ #include -#include "common.h" - void hash_gen(void) { unsigned char md[MAXBLOCKSIZE], *buf; @@ -736,8 +734,22 @@ void lrw_gen(void) int main(void) { - register_algs(); - setup_math(); + register_all_ciphers(); + register_all_hashes(); + register_all_prngs(); +#ifdef USE_LTM + ltc_mp = ltm_desc; +#elif defined(USE_TFM) + ltc_mp = tfm_desc; +#elif defined(USE_GMP) + ltc_mp = gmp_desc; +#elif defined(EXT_MATH_LIB) + extern ltc_math_descriptor EXT_MATH_LIB; + ltc_mp = EXT_MATH_LIB; +#else + fprintf(stderr, "No MPI provider available\n"); + exit(EXIT_FAILURE); +#endif printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n"); printf("Generating cipher vectors..."); fflush(stdout); cipher_gen(); printf("done\n"); diff --git a/makefile b/makefile index b670239e1..4620b86a8 100644 --- a/makefile +++ b/makefile @@ -58,11 +58,11 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -timing: $(LIBNAME) $(TIMINGS) tests/common.o +timing: $(LIBNAME) $(TIMINGS) ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TIMINGS) tests/common.o $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) + ${silent} $(CC) $(LDFLAGS) $(TIMINGS) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) test: $(LIBNAME) $(TOBJECTS) ifneq ($V,1) @@ -72,11 +72,11 @@ endif # build the demos from a template define DEMO_template -$(1): demos/$(1).o $$(LIBNAME) tests/common.o +$(1): demos/$(1).o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif - $${silent} $$(CC) $$(CFLAGS) $$< tests/common.o $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) + $${silent} $$(CC) $$(CFLAGS) $$< $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) diff --git a/makefile.mingw b/makefile.mingw index d3ce92a91..6ca85bc8b 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -235,16 +235,16 @@ $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) $(STRIP) -S $(LIBMAIN_D) #Demo tools/utilities -hashsum.exe: demos/hashsum.o tests/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ -ltcrypt.exe: demos/ltcrypt.o tests/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ -small.exe: demos/small.o tests/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ -tv_gen.exe: demos/tv_gen.o tests/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ -timing.exe: demos/timing.o tests/common.o $(LIBMAIN_S) - $(CC) $? $(LTC_LDFLAGS) -o $@ +hashsum.exe: demos/hashsum.o $(LIBMAIN_S) + $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +crypt.exe: demos/crypt.o $(LIBMAIN_S) + $(CC) demos/crypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +small.exe: demos/small.o $(LIBMAIN_S) + $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +tv_gen.exe: demos/tv_gen.o $(LIBMAIN_S) + $(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +timing.exe: demos/timing.o $(LIBMAIN_S) + $(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ #Tests test.exe: $(TOBJECTS) $(LIBMAIN_S) diff --git a/makefile.shared b/makefile.shared index 68083cd24..e6be085d4 100644 --- a/makefile.shared +++ b/makefile.shared @@ -46,12 +46,12 @@ install_bins: .common_install_bins test: $(LIBNAME) $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) -timing: $(TIMINGS) tests/common.o $(LIBNAME) +timing: $(TIMINGS) $(LIBNAME) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $^ $(EXTRALIBS) # build the demos from a template define DEMO_template -$(1): demos/$(1).o tests/common.o $$(LIBNAME) +$(1): demos/$(1).o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif diff --git a/makefile.unix b/makefile.unix index f1507a4fa..cd86330a8 100644 --- a/makefile.unix +++ b/makefile.unix @@ -237,16 +237,16 @@ $(LIBMAIN_S): $(OBJECTS) $(RANLIB) $@ #Demo tools/utilities -hashsum: demos/hashsum.o tests/common.o $(LIBMAIN_S) - $(CC) demos/hashsum.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -ltcrypt: demos/ltcrypt.o tests/common.o $(LIBMAIN_S) - $(CC) demos/ltcrypt.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -small: demos/small.o tests/common.o $(LIBMAIN_S) - $(CC) demos/small.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -tv_gen: demos/tv_gen.o tests/common.o $(LIBMAIN_S) - $(CC) demos/tv_gen.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -timing: demos/timing.o tests/common.o $(LIBMAIN_S) - $(CC) demos/timing.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +hashsum: demos/hashsum.o $(LIBMAIN_S) + $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +ltcrypt: demos/ltcrypt.o $(LIBMAIN_S) + $(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +small: demos/small.o $(LIBMAIN_S) + $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +tv_gen: demos/tv_gen.o $(LIBMAIN_S) + $(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +timing: demos/timing.o $(LIBMAIN_S) + $(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ #Tests test: $(TOBJECTS) $(LIBMAIN_S) diff --git a/tests/common.h b/tests/common.h index 483060fe6..81672339c 100644 --- a/tests/common.h +++ b/tests/common.h @@ -3,12 +3,6 @@ #include -#if defined(_WIN32) - #define PRI64 "I64d" -#else - #define PRI64 "ll" -#endif - extern prng_state yarrow_prng; #ifdef LTC_VERBOSE From 4e971a8518919487ea0e64a3dbef30797de24746 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 11:55:07 +0200 Subject: [PATCH 0804/1192] don't use print_hex() from library --- src/encauth/ccm/ccm_test.c | 52 ++++++----------------------------- src/mac/hmac/hmac_test.c | 14 +--------- src/misc/crypt/crypt_inits.c | 11 ++++---- src/misc/pkcs5/pkcs_5_test.c | 53 ++++++++---------------------------- src/modes/xts/xts_test.c | 17 ++---------- 5 files changed, 29 insertions(+), 118 deletions(-) diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 51bc4afb5..1177a0f84 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -165,27 +165,10 @@ int ccm_test(void) } } - if (XMEMCMP(buf, tests[x].ct, tests[x].ptlen)) { -#if defined(LTC_TEST_DBG) - printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("ct is ", buf, tests[x].ptlen); - print_hex("ct should", tests[x].ct, tests[x].ptlen); -#endif - return CRYPT_FAIL_TESTVECTOR; - } - if (tests[x].taglen != taglen) { -#if defined(LTC_TEST_DBG) - printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - printf("taglen %lu (is) %lu (should)\n", taglen, tests[x].taglen); -#endif + if (compare_testvector(buf, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "CCM encrypt data", x)) { return CRYPT_FAIL_TESTVECTOR; } - if (XMEMCMP(tag, tests[x].tag, tests[x].taglen)) { -#if defined(LTC_TEST_DBG) - printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("tag is ", tag, tests[x].taglen); - print_hex("tag should", tests[x].tag, tests[x].taglen); -#endif + if (compare_testvector(tag, taglen, tests[x].tag, tests[x].taglen, "CCM encrypt tag", x)) { return CRYPT_FAIL_TESTVECTOR; } @@ -220,12 +203,8 @@ int ccm_test(void) } } - if (XMEMCMP(buf2, tests[x].pt, tests[x].ptlen)) { -#if defined(LTC_TEST_DBG) - printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("pt is ", buf2, tests[x].ptlen); - print_hex("pt should", tests[x].pt, tests[x].ptlen); -#endif + + if (compare_testvector(buf2, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "CCM decrypt data", x)) { return CRYPT_FAIL_TESTVECTOR; } if (y == 0) { @@ -243,27 +222,12 @@ int ccm_test(void) tag3, &taglen, 1 )) != CRYPT_ERROR) { return CRYPT_FAIL_TESTVECTOR; } - if (XMEMCMP(buf2, zero, tests[x].ptlen)) { -#if defined(LTC_CCM_TEST_DBG) - printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("pt is ", buf2, tests[x].ptlen); - print_hex("pt should", zero, tests[x].ptlen); -#endif - return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(buf2, tests[x].ptlen, zero, tests[x].ptlen, "CCM decrypt wrong tag", x)) { + return CRYPT_FAIL_TESTVECTOR; } } else { - /* FIXME: Only check the tag if ccm_memory was not called: ccm_memory already - validates the tag. ccm_process and ccm_done should somehow do the same, - although with current setup it is impossible to keep the plaintext hidden - if the tag is incorrect. - */ - if (XMEMCMP(tag2, tests[x].tag, tests[x].taglen)) { -#if defined(LTC_TEST_DBG) - printf("\n%d: x=%lu y=%lu\n", __LINE__, x, y); - print_hex("tag is ", tag2, tests[x].taglen); - print_hex("tag should", tests[x].tag, tests[x].taglen); -#endif - return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(tag2, taglen, tests[x].tag, tests[x].taglen, "CCM decrypt tag", x)) { + return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index 0c311c6b1..f0b5e20bb 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -609,20 +609,8 @@ int hmac_test(void) return err; } - if(XMEMCMP(digest, cases[i].digest, (size_t)hash_descriptor[hash].hashsize) != 0) { + if(compare_testvector(digest, outlen, cases[i].digest, (size_t)hash_descriptor[hash].hashsize, cases[i].num, i)) { failed++; -#ifdef LTC_TEST_DBG - { - printf("\nHMAC-%s test %s: Failed\n", cases[i].algo, cases[i].num); - print_hex("is", digest, hash_descriptor[hash].hashsize); - print_hex("should", cases[i].digest, hash_descriptor[hash].hashsize); - return CRYPT_FAIL_TESTVECTOR; - } -#if LTC_TEST_DBG > 1 - } else { - printf("HMAC-%s test %s: Passed\n", cases[i].algo, cases[i].num); -#endif -#endif } } diff --git a/src/misc/crypt/crypt_inits.c b/src/misc/crypt/crypt_inits.c index cc92f52fb..4df6051d3 100644 --- a/src/misc/crypt/crypt_inits.c +++ b/src/misc/crypt/crypt_inits.c @@ -19,24 +19,25 @@ #ifdef LTM_DESC -void init_LTM(void) { +void init_LTM(void) +{ ltc_mp = ltm_desc; } #endif #ifdef TFM_DESC -void init_TFM(void) { +void init_TFM(void) +{ ltc_mp = tfm_desc; } #endif -/* *** use of GMP is untested *** #ifdef GMP_DESC -void init_GMP(void) { +void init_GMP(void) +{ ltc_mp = gmp_desc; } #endif -*/ /* $Source$ */ diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index 46a8931e9..c247fe8fd 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -161,7 +161,9 @@ int pkcs_5_test (void) int hash = find_hash("sha1"); if (hash == -1) { +#ifdef LTC_TEST_DBG printf("PKCS#5 test failed: 'sha1' hash not found\n"); +#endif return CRYPT_ERROR; } @@ -173,27 +175,14 @@ int pkcs_5_test (void) (unsigned char*)cases_5_2[i].S, cases_5_2[i].S_len, cases_5_2[i].c, hash, DK, &dkLen)) != CRYPT_OK) { +#ifdef LTC_TEST_DBG printf("\nPKCS#5_2 test #%d: Failed/1\n", i); printf("err=%d\n", err); +#endif ++failed; } - else if (dkLen != cases_5_2[i].dkLen) { - printf("\nPKCS#5_2 test #%d: Failed/2\n", i); - printf("len is %d\n", (int)dkLen); - printf("len should %d\n", (int)cases_5_2[i].dkLen); - ++failed; - } - else if(XMEMCMP(DK, cases_5_2[i].DK, (size_t)cases_5_2[i].dkLen) != 0) { - printf("\nPKCS#5_2 test #%d: Failed/3\n", i); -#ifdef LTC_TEST_DBG - print_hex("is", DK, cases_5_2[i].dkLen); - print_hex("should", cases_5_2[i].DK, cases_5_2[i].dkLen); -#endif + else if (compare_testvector(DK, dkLen, cases_5_2[i].DK, cases_5_2[i].dkLen, "PKCS#5_2", i)) { ++failed; -#ifdef LTC_TEST_DBG - } else { - printf("PKCS#5_2 test #%d: Passed\n", i); -#endif } } @@ -204,24 +193,15 @@ int pkcs_5_test (void) (unsigned char*)cases_5_1[i].S, cases_5_1[i].c, hash, DK, &dkLen)) != CRYPT_OK) { +#ifdef LTC_TEST_DBG printf("\nPKCS#5_1 test #%d: Failed/1\n", i); printf("err=%d\n", err); - ++failed; - } - else if (dkLen != cases_5_1[i].dkLen) { - printf("\nPKCS#5_1 test #%d: Failed/2\n", i); - printf("len is %d\n", (int)dkLen); - printf("len should %d\n", (int)cases_5_1[i].dkLen); - ++failed; - } - else if (XMEMCMP(DK, cases_5_1[i].DK, (size_t)cases_5_1[i].dkLen) != 0) { - printf("\nPKCS#5_1 test #%d: Failed/3\n", i); -#ifdef LTC_TEST_DBG - print_hex("is", DK, cases_5_1[i].dkLen); - print_hex("should", cases_5_1[i].DK, cases_5_1[i].dkLen); #endif ++failed; } + else if (compare_testvector(DK, dkLen, cases_5_1[i].DK, cases_5_1[i].dkLen, "PKCS#5_1", i)) { + ++failed; + } } /* testing alg 1_openssl */ @@ -231,22 +211,13 @@ int pkcs_5_test (void) (unsigned char*)cases_5_1o[i].S, cases_5_1o[i].c, hash, DK, &dkLen)) != CRYPT_OK) { +#ifdef LTC_TEST_DBG printf("\nPKCS#5_1o test #%d: Failed/1\n", i); printf("err=%d\n", err); +#endif ++failed; } - else if (dkLen != cases_5_1o[i].dkLen) { - printf("\nPKCS#5_1o test #%d: Failed/2\n", i); - printf("len is %d\n", (int)dkLen); - printf("len should %d\n", (int)cases_5_1o[i].dkLen); - ++failed; - } - else if (XMEMCMP(DK, cases_5_1o[i].DK, (size_t)cases_5_1o[i].dkLen) != 0) { - printf("\nPKCS#5_1o test #%d: Failed/3\n", i); -#ifdef LTC_TEST_DBG - print_hex("is", DK, cases_5_1o[i].dkLen); - print_hex("should", cases_5_1o[i].DK, cases_5_1o[i].dkLen); -#endif + else if (compare_testvector(DK, dkLen, cases_5_1o[i].DK, cases_5_1o[i].dkLen, "PKCS#5_1o", i)) { ++failed; } } diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index 7826d2240..87c82b5b3 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -262,15 +262,7 @@ int xts_test(void) } } - if (XMEMCMP(OUT, tests[i].CTX, tests[i].PTLEN)) { -#ifdef LTC_TEST_DBG - printf("\nTestcase #%d with original length %lu and half of it " - "%lu\n", - i, tests[i].PTLEN, len); - printf("\nencrypt\n"); - print_hex("should", tests[i].CTX, tests[i].PTLEN); - print_hex("is", OUT, tests[i].PTLEN); -#endif + if (compare_testvector(OUT, tests[i].PTLEN, tests[i].CTX, tests[i].PTLEN, "XTS encrypt", i)) { xts_done(&xts); return CRYPT_FAIL_TESTVECTOR; } @@ -295,12 +287,7 @@ int xts_test(void) } } - if (XMEMCMP(OUT, tests[i].PTX, tests[i].PTLEN)) { -#ifdef LTC_TEST_DBG - printf("\ndecrypt\n"); - print_hex("should", tests[i].PTX, tests[i].PTLEN); - print_hex("is", OUT, tests[i].PTLEN); -#endif + if (compare_testvector(OUT, tests[i].PTLEN, tests[i].PTX, tests[i].PTLEN, "XTS decrypt", i)) { xts_done(&xts); return CRYPT_FAIL_TESTVECTOR; } From e45e02d6355e53b759d40038f638d00dfca880c2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 11:55:11 +0200 Subject: [PATCH 0805/1192] Update makefiles --- libtomcrypt_VS2008.vcproj | 12 ++++++++++++ makefile.mingw | 9 +++++---- makefile.msvc | 9 +++++---- makefile.unix | 9 +++++---- makefile_include.mk | 9 +++++---- 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 2c761c852..9aa9c512f 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -1466,6 +1466,18 @@ RelativePath="src\misc\crypt\crypt_prng_rng_descriptor.c" > + + + + + + diff --git a/makefile.mingw b/makefile.mingw index 6ca85bc8b..62ad4b9da 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -102,8 +102,9 @@ src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \ +src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ @@ -191,8 +192,8 @@ src/stream/sober128/sober128_test.o TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ -tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \ -tests/rsa_test.o tests/store_test.o tests/test.o +tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ +tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile.msvc b/makefile.msvc index 97cb6c105..61f5af1f0 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -95,8 +95,9 @@ src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/c src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_inits.obj \ src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \ src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_prng_rng_descriptor.obj \ -src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ -src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/misc/crypt/crypt_register_all_ciphers.obj src/misc/crypt/crypt_register_all_hashes.obj \ +src/misc/crypt/crypt_register_all_prngs.obj src/misc/crypt/crypt_register_cipher.obj \ +src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pk_get_oid.obj src/misc/pkcs5/pkcs_5_1.obj \ @@ -184,8 +185,8 @@ src/stream/sober128/sober128_test.obj TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_tests.obj tests/dh_test.obj \ tests/dsa_test.obj tests/ecc_test.obj tests/file_test.obj tests/katja_test.obj tests/mac_test.obj tests/misc_test.obj \ tests/modes_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj tests/pkcs_1_emsa_test.obj \ -tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj tests/rotate_test.obj \ -tests/rsa_test.obj tests/store_test.obj tests/test.obj +tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj tests/prng_test.obj \ +tests/rotate_test.obj tests/rsa_test.obj tests/store_test.obj tests/test.obj #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile.unix b/makefile.unix index cd86330a8..33fe2233c 100644 --- a/makefile.unix +++ b/makefile.unix @@ -107,8 +107,9 @@ src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \ +src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ @@ -196,8 +197,8 @@ src/stream/sober128/sober128_test.o TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ -tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \ -tests/rsa_test.o tests/store_test.o tests/test.o +tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ +tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile_include.mk b/makefile_include.mk index 77e5e5de0..6a9828343 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -206,8 +206,9 @@ src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \ src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \ src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \ -src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \ +src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \ +src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \ @@ -295,8 +296,8 @@ src/stream/sober128/sober128_test.o TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ -tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \ -tests/rsa_test.o tests/store_test.o tests/test.o +tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ +tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o # The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ From ad45277745584a0f6a48a17b7063563eabef1534 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 12:32:15 +0200 Subject: [PATCH 0806/1192] use print_hex() in rsa_test() --- tests/rsa_test.c | 40 +++++++--------------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 3540fd305..7154cf966 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -274,29 +274,15 @@ int rsa_test(void) len = mp_unsigned_bin_size(key.N); mp_to_unsigned_bin(key.N, tmp); - fprintf(stderr, "N == \n"); -for (cnt = 0; cnt < len; ) { - fprintf(stderr, "%02x ", tmp[cnt]); - if (!(++cnt & 15)) fprintf(stderr, "\n"); -} +print_hex("N", tmp, len); len = mp_unsigned_bin_size(key.p); mp_to_unsigned_bin(key.p, tmp); - fprintf(stderr, "p == \n"); -for (cnt = 0; cnt < len; ) { - fprintf(stderr, "%02x ", tmp[cnt]); - if (!(++cnt & 15)) fprintf(stderr, "\n"); -} +print_hex("p", tmp, len); len = mp_unsigned_bin_size(key.q); mp_to_unsigned_bin(key.q, tmp); - fprintf(stderr, "\nq == \n"); -for (cnt = 0; cnt < len; ) { - fprintf(stderr, "%02x ", tmp[cnt]); - if (!(++cnt & 15)) fprintf(stderr, "\n"); -} - fprintf(stderr, "\n"); - +print_hex("q", tmp, len); return 1; } @@ -539,14 +525,8 @@ for (cnt = 0; cnt < len; ) { /* (3) */ DO(ltc_mp.rsa_me(p2, len2, p3, &len3, PK_PUBLIC, &key)); /* (4) */ -#ifdef LTC_TEST_DBG - cnt = rsa_get_size(&key); - printf("\nBefore:"); - for (cnt = 0; cnt < len3; ++cnt) { - if (cnt%32 == 0) - printf("\n%3lu:", cnt); - printf(" %02x", p3[cnt]); - } +#if defined(LTC_TEST_DBG) && LTC_TEST_DBG > 1 + print_hex("Original signature", p3, len3); #endif /* (4.1) */ for (cnt = 0; cnt < len3; ++cnt) { @@ -563,14 +543,8 @@ for (cnt = 0; cnt < len; ) { for (cnt = cnt + len3-cnt2+i; cnt < len; ++cnt) { p3[cnt] = 0; } -#ifdef LTC_TEST_DBG - printf("\nAfter:"); - for (cnt = 0; cnt < len3; ++cnt) { - if (cnt%32 == 0) - printf("\n%3lu:", cnt); - printf(" %02x", p3[cnt]); - } - printf("\n"); +#if defined(LTC_TEST_DBG) && LTC_TEST_DBG > 1 + print_hex("Forged signature", p3, len3); #endif len2 = sizeof(out); From 4bbce780c4bd18264bb7d84e36f5eddc36dc4d7e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 12:40:03 +0200 Subject: [PATCH 0807/1192] always provide `compare_testvector()` as a function --- src/headers/tomcrypt_misc.h | 6 ------ src/misc/compare_testvector.c | 11 +++++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 8bacea8f6..fa0b79564 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -99,13 +99,7 @@ void crc32_finish(crc32_state *ctx, void *hash, unsigned long size); int crc32_test(void); #endif -#if defined(LTC_TEST) && defined(LTC_TEST_DBG) -void print_hex(const char* what, const void* v, const unsigned long l); int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); -#else -#define compare_testvector(is, is_len, should, should_len, what, which) \ - ((((is_len) != (should_len)) || (XMEMCMP((is), (should), (is_len)) != 0)) ? 1 : 0) -#endif /* $Source$ */ /* $Revision$ */ diff --git a/src/misc/compare_testvector.c b/src/misc/compare_testvector.c index 2bf02ee73..64e4e63f7 100644 --- a/src/misc/compare_testvector.c +++ b/src/misc/compare_testvector.c @@ -15,8 +15,7 @@ Function to compare two testvectors and print a (detailed) error-message if required, Steffen Jaeckel */ -#ifndef compare_testvector - +#if defined(LTC_TEST) && defined(LTC_TEST_DBG) static void _print_hex(const char* what, const void* v, const unsigned long l) { const unsigned char* p = v; @@ -49,6 +48,7 @@ static void _print_hex(const char* what, const void* v, const unsigned long l) } } } +#endif int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) { @@ -58,16 +58,19 @@ int compare_testvector(const void* is, const unsigned long is_len, const void* s else res = XMEMCMP(is, should, MAX(is_len, should_len)); +#if defined(LTC_TEST) && defined(LTC_TEST_DBG) if (res != 0) { fprintf(stderr, "Testvector #%i of %s failed:\n", which, what); _print_hex("SHOULD", should, should_len); _print_hex("IS ", is, is_len); } +#else + LTC_UNUSED_PARAM(which); + LTC_UNUSED_PARAM(what); +#endif return res; } -#endif - /* $Source$ */ /* $Revision$ */ From 5a3a27bbd6951a26e26a27025747f3766076b42b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 13:25:40 +0200 Subject: [PATCH 0808/1192] rename der_tests to der_test --- tests/{der_tests.c => der_test.c} | 4 ++-- tests/test.c | 2 +- tests/tomcrypt_test.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename tests/{der_tests.c => der_test.c} (99%) diff --git a/tests/der_tests.c b/tests/der_test.c similarity index 99% rename from tests/der_tests.c rename to tests/der_test.c index d165646cd..63b45a8de 100644 --- a/tests/der_tests.c +++ b/tests/der_test.c @@ -5,7 +5,7 @@ #ifndef LTC_DER -int der_tests(void) +int der_test(void) { return CRYPT_NOP; } @@ -1086,7 +1086,7 @@ static int der_choice_test(void) } -int der_tests(void) +int der_test(void) { unsigned long x, y, z, zz, oid[2][32]; unsigned char buf[3][2048]; diff --git a/tests/test.c b/tests/test.c index 69d7c1aea..7ed1e185a 100644 --- a/tests/test.c +++ b/tests/test.c @@ -17,7 +17,7 @@ static const struct { LTC_TEST_FN(cipher_hash_test), LTC_TEST_FN(mac_test), LTC_TEST_FN(modes_test), - LTC_TEST_FN(der_tests), + LTC_TEST_FN(der_test), LTC_TEST_FN(pkcs_1_test), LTC_TEST_FN(pkcs_1_pss_test), LTC_TEST_FN(pkcs_1_oaep_test), diff --git a/tests/tomcrypt_test.h b/tests/tomcrypt_test.h index 63364e41a..77f33b359 100644 --- a/tests/tomcrypt_test.h +++ b/tests/tomcrypt_test.h @@ -46,7 +46,7 @@ int dh_test(void); int katja_test(void); int ecc_tests(void); int dsa_test(void); -int der_tests(void); +int der_test(void); int misc_test(void); int base64_test(void); int file_test(void); From f47a71bc6c8746844e3e006aca1c6b91466eefe9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 8 Jun 2017 13:25:42 +0200 Subject: [PATCH 0809/1192] Update makefiles --- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 62ad4b9da..ba1ee9471 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -189,7 +189,7 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o #List of test objects to compile -TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ +TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ diff --git a/makefile.msvc b/makefile.msvc index 61f5af1f0..94ab639af 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -182,7 +182,7 @@ src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128. src/stream/sober128/sober128_test.obj #List of test objects to compile -TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_tests.obj tests/dh_test.obj \ +TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_test.obj tests/dh_test.obj \ tests/dsa_test.obj tests/ecc_test.obj tests/file_test.obj tests/katja_test.obj tests/mac_test.obj tests/misc_test.obj \ tests/modes_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj tests/pkcs_1_emsa_test.obj \ tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj tests/prng_test.obj \ diff --git a/makefile.unix b/makefile.unix index 33fe2233c..e0ea2d9b8 100644 --- a/makefile.unix +++ b/makefile.unix @@ -194,7 +194,7 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o #List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ +TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ diff --git a/makefile_include.mk b/makefile_include.mk index 6a9828343..2c3f24f7c 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -293,7 +293,7 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ src/stream/sober128/sober128_test.o # List of test objects to compile (all goes to libtomcrypt_prof.a) -TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \ +TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ From d72d7d1d32529422471b481027860568a7a10671 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 8 Jun 2017 20:07:08 +0200 Subject: [PATCH 0810/1192] tuning makefile.mingw+msvc --- makefile.mingw | 6 +++--- makefile.msvc | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index ba1ee9471..add777f37 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -238,8 +238,8 @@ $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) #Demo tools/utilities hashsum.exe: demos/hashsum.o $(LIBMAIN_S) $(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ -crypt.exe: demos/crypt.o $(LIBMAIN_S) - $(CC) demos/crypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +ltcrypt.exe: demos/ltcrypt.o $(LIBMAIN_S) + $(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ small.exe: demos/small.o $(LIBMAIN_S) $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ tv_gen.exe: demos/tv_gen.o $(LIBMAIN_S) @@ -250,7 +250,7 @@ timing.exe: demos/timing.o $(LIBMAIN_S) #Tests test.exe: $(TOBJECTS) $(LIBMAIN_S) $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ - @echo NOTICE: start the tests by: test.exe + @echo NOTICE: start the tests by launching test.exe all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe diff --git a/makefile.msvc b/makefile.msvc index 94ab639af..7c748d232 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -237,6 +237,7 @@ timing.exe: demos/timing.c $(LIBMAIN_S) #Tests test.exe: $(LIBMAIN_S) $(TOBJECTS) cl $(LTC_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ + @echo NOTICE: start the tests by launching test.exe all: $(LIBMAIN_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe From d96f4bdcff5b5c27a71b287068e69f08d16716e3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 4 Apr 2017 09:08:10 +0200 Subject: [PATCH 0811/1192] rsa_import_pkcs8 --- src/headers/tomcrypt_pk.h | 2 + src/pk/rsa/rsa_import_pkcs8.c | 149 ++++++++++++++++++++++++++++++++++ tests/rsa_test.c | 52 ++++++++++++ 3 files changed, 203 insertions(+) create mode 100755 src/pk/rsa/rsa_import_pkcs8.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 60a11a9f5..967b7bf96 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -108,6 +108,8 @@ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key); +int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, + const unsigned char *passwd, unsigned long passwdlen, rsa_key *key); int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key); #endif diff --git a/src/pk/rsa/rsa_import_pkcs8.c b/src/pk/rsa/rsa_import_pkcs8.c new file mode 100755 index 000000000..22214977e --- /dev/null +++ b/src/pk/rsa/rsa_import_pkcs8.c @@ -0,0 +1,149 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "tomcrypt.h" + +/** + @file rsa_import_pkcs8.c + Import a PKCS RSA key +*/ + +#ifdef LTC_MRSA + +/* Public-Key Cryptography Standards (PKCS) #8: + * Private-Key Information Syntax Specification Version 1.2 + * https://tools.ietf.org/html/rfc5208 + * + * PrivateKeyInfo ::= SEQUENCE { + * version Version, + * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, + * privateKey PrivateKey, + * attributes [0] IMPLICIT Attributes OPTIONAL } + * where: + * - Version ::= INTEGER + * - PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier + * - PrivateKey ::= OCTET STRING + * - Attributes ::= SET OF Attribute + * + * EncryptedPrivateKeyInfo ::= SEQUENCE { + * encryptionAlgorithm EncryptionAlgorithmIdentifier, + * encryptedData EncryptedData } + * where: + * - EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier + * - EncryptedData ::= OCTET STRING + */ + +/** + Import an RSAPublicKey or RSAPrivateKey in PKCS#8 format + @param in The packet to import from + @param inlen It's length (octets) + @param key [out] Destination for newly imported key + @return CRYPT_OK if successful, upon error allocated memory is freed +*/ +int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, + const unsigned char *passwd, unsigned long passwdlen, + rsa_key *key) +{ + int err; + void *zero, *iter; + unsigned char *buf1 = NULL, *buf2 = NULL; + unsigned long buf1len, buf2len; + unsigned long oid[16]; + oid_st rsaoid; + ltc_asn1_list alg_seq[2], top_seq[3]; + ltc_asn1_list alg_seq_e[2], key_seq_e[2], top_seq_e[2]; + unsigned char *decrypted = NULL; + unsigned long decryptedlen; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* get RSA alg oid */ + err = pk_get_oid(PKA_RSA, &rsaoid); + if (err != CRYPT_OK) { goto LBL_NOFREE; } + + /* alloc buffers */ + buf1len = inlen; /* approx. */ + buf1 = XMALLOC(buf1len); + if (buf1 == NULL) { err = CRYPT_MEM; goto LBL_NOCLEAR; } + buf2len = inlen; /* approx. */ + buf2 = XMALLOC(buf2len); + if (buf2 == NULL) { err = CRYPT_MEM; goto LBL_FREE; } + + /* init key */ + err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, &zero, &iter, NULL); + if (err != CRYPT_OK) { goto LBL_NOCLEAR; } + + /* try to decode encrypted priv key */ + LTC_SET_ASN1(key_seq_e, 0, LTC_ASN1_OCTET_STRING, buf1, buf1len); + LTC_SET_ASN1(key_seq_e, 1, LTC_ASN1_INTEGER, iter, 1UL); + LTC_SET_ASN1(alg_seq_e, 0, LTC_ASN1_OBJECT_IDENTIFIER, oid, 16UL); + LTC_SET_ASN1(alg_seq_e, 1, LTC_ASN1_SEQUENCE, key_seq_e, 2UL); + LTC_SET_ASN1(top_seq_e, 0, LTC_ASN1_SEQUENCE, alg_seq_e, 2UL); + LTC_SET_ASN1(top_seq_e, 1, LTC_ASN1_OCTET_STRING, buf2, buf2len); + err=der_decode_sequence(in, inlen, top_seq_e, 2UL); + if (err == CRYPT_OK) { + LTC_UNUSED_PARAM(passwd); + LTC_UNUSED_PARAM(passwdlen); + /* XXX: TODO encrypted pkcs8 not implemented yet */ + /* fprintf(stderr, "decrypt: iter=%ld salt.len=%ld encdata.len=%ld\n", mp_get_int(iter), key_seq_e[0].size, top_seq_e[1].size); */ + err = CRYPT_PK_INVALID_TYPE; + goto LBL_ERR; + } + else { + decrypted = (unsigned char *)in; + decryptedlen = inlen; + } + + /* try to decode unencrypted priv key */ + LTC_SET_ASN1(alg_seq, 0, LTC_ASN1_OBJECT_IDENTIFIER, oid, 16UL); + LTC_SET_ASN1(alg_seq, 1, LTC_ASN1_NULL, NULL, 0UL); + LTC_SET_ASN1(top_seq, 0, LTC_ASN1_INTEGER, zero, 1UL); + LTC_SET_ASN1(top_seq, 1, LTC_ASN1_SEQUENCE, alg_seq, 2UL); + LTC_SET_ASN1(top_seq, 2, LTC_ASN1_OCTET_STRING, buf1, buf1len); + err=der_decode_sequence(decrypted, decryptedlen, top_seq, 3UL); + if (err != CRYPT_OK) { goto LBL_ERR; } + + /* check alg oid */ + if ((alg_seq[0].size != rsaoid.OIDlen) || + XMEMCMP(rsaoid.OID, alg_seq[0].data, rsaoid.OIDlen * sizeof(rsaoid.OID[0]))) { + err = CRYPT_PK_INVALID_TYPE; + goto LBL_ERR; + } + + err = der_decode_sequence_multi(buf1, top_seq[2].size, + LTC_ASN1_INTEGER, 1UL, zero, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->e, + LTC_ASN1_INTEGER, 1UL, key->d, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->dP, + LTC_ASN1_INTEGER, 1UL, key->dQ, + LTC_ASN1_INTEGER, 1UL, key->qP, + LTC_ASN1_EOL, 0UL, NULL); + if (err != CRYPT_OK) { goto LBL_ERR; } + mp_clear_multi(zero, iter, NULL); + key->type = PK_PRIVATE; + err = CRYPT_OK; + goto LBL_FREE; + +LBL_ERR: + mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, zero, iter, NULL); +LBL_NOCLEAR: + XFREE(buf2); +LBL_FREE: + XFREE(buf1); +LBL_NOFREE: + return err; +} + +#endif /* LTC_MRSA */ diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 7154cf966..5352be8aa 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -62,6 +62,48 @@ static const unsigned char x509_public_rsa[] = bv5Aw3hiKsIG3jigKHwmMScgkl3yn+8hLkx6thNbqQoa6Yyo20RqaEFBwlZ5G8lF\ rZsdeO84SeCH"; +static const unsigned char pkcs8_private_rsa[] = { + 0x30, 0x82, 0x02, 0x78, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82, 0x02, 0x62, 0x30, 0x82, 0x02, 0x5e, 0x02, 0x01, + 0x00, 0x02, 0x81, 0x81, 0x00, 0xcf, 0x9a, 0xde, 0x64, 0x8a, 0xda, 0xc8, 0x33, 0x20, 0xa9, 0xd7, + 0x83, 0x31, 0x19, 0x54, 0xb2, 0x9a, 0x85, 0xa7, 0xa1, 0xb7, 0x75, 0x33, 0xb6, 0xa9, 0xac, 0x84, + 0x24, 0xb3, 0xde, 0xdb, 0x7d, 0x85, 0x2d, 0x96, 0x65, 0xe5, 0x3f, 0x72, 0x95, 0x24, 0x9f, 0x28, + 0x68, 0xca, 0x4f, 0xdb, 0x44, 0x1c, 0x3e, 0x60, 0x12, 0x8a, 0xdd, 0x26, 0xa5, 0xeb, 0xff, 0x0b, + 0x5e, 0xd4, 0x88, 0x38, 0x49, 0x2a, 0x6e, 0x5b, 0xbf, 0x12, 0x37, 0x47, 0xbd, 0x05, 0x6b, 0xbc, + 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x99, 0x63, + 0xa9, 0x5d, 0x80, 0xae, 0x53, 0xca, 0x94, 0x3f, 0x05, 0x23, 0x1e, 0xf8, 0x05, 0x04, 0xe1, 0xb8, + 0x35, 0xf2, 0x17, 0xb3, 0xa0, 0x89, 0x02, 0x41, 0x00, 0xab, 0x90, 0x88, 0xfa, 0x60, 0x08, 0x29, + 0x50, 0x9a, 0x43, 0x8b, 0xa0, 0x50, 0xcc, 0xd8, 0x5a, 0xfe, 0x97, 0x64, 0x63, 0x71, 0x74, 0x22, + 0xa3, 0x20, 0x02, 0x5a, 0xcf, 0xeb, 0xc6, 0x16, 0x95, 0x54, 0xd1, 0xcb, 0xab, 0x8d, 0x1a, 0xc6, + 0x00, 0xfa, 0x08, 0x92, 0x9c, 0x71, 0xd5, 0x52, 0x52, 0x35, 0x96, 0x71, 0x4b, 0x8b, 0x92, 0x0c, + 0xd0, 0xe9, 0xbf, 0xad, 0x63, 0x0b, 0xa5, 0xe9, 0xb1, 0x02, 0x41, 0x00, 0xdc, 0xcc, 0x27, 0xc8, + 0xe4, 0xdc, 0x62, 0x48, 0xd5, 0x9b, 0xaf, 0xf5, 0xab, 0x60, 0xf6, 0x21, 0xfd, 0x53, 0xe2, 0xb7, + 0x5d, 0x09, 0xc9, 0x1a, 0xa1, 0x04, 0xa9, 0xfc, 0x61, 0x2c, 0x5d, 0x04, 0x58, 0x3a, 0x5a, 0x39, + 0xf1, 0x4a, 0x21, 0x56, 0x67, 0xfd, 0xcc, 0x20, 0xa3, 0x8f, 0x78, 0x18, 0x5a, 0x79, 0x3d, 0x2e, + 0x8e, 0x7e, 0x86, 0x0a, 0xe6, 0xa8, 0x33, 0xc1, 0x04, 0x17, 0x4a, 0x9f }; + /* private keay - hexadecimal */ static char *hex_d = "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881"; static char *hex_dP = "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089"; @@ -188,6 +230,16 @@ static int rsa_compat_test(void) } rsa_free(&key); + /* try import private key in pkcs8 format */ + DO(rsa_import_pkcs8(pkcs8_private_rsa, sizeof(pkcs8_private_rsa), NULL, 0, &key)); + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PRIVATE, &key)); + if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { + fprintf(stderr, "RSA private export failed to match rsa_import_pkcs8\n"); + return 1; + } + rsa_free(&key); + /* try import private key from raw hexadecimal numbers */ DO(rsa_import_radix(16, hex_N, hex_e, hex_d, hex_p, hex_q, hex_dP, hex_dQ, hex_qP, &key)); len = sizeof(buf); From 52a496e9e1ceea7ad0f246a640acfd25911e37e9 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 4 Apr 2017 09:14:57 +0200 Subject: [PATCH 0812/1192] rsa_import_pkcs8 - passwd is now "const void *" --- src/headers/tomcrypt_pk.h | 2 +- src/pk/rsa/rsa_import_pkcs8.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 967b7bf96..2c9f75959 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -109,7 +109,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, - const unsigned char *passwd, unsigned long passwdlen, rsa_key *key); + const void *passwd, unsigned long passwdlen, rsa_key *key); int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key); #endif diff --git a/src/pk/rsa/rsa_import_pkcs8.c b/src/pk/rsa/rsa_import_pkcs8.c index 22214977e..2f2aa365a 100755 --- a/src/pk/rsa/rsa_import_pkcs8.c +++ b/src/pk/rsa/rsa_import_pkcs8.c @@ -42,13 +42,15 @@ /** Import an RSAPublicKey or RSAPrivateKey in PKCS#8 format - @param in The packet to import from - @param inlen It's length (octets) - @param key [out] Destination for newly imported key + @param in The packet to import from + @param inlen It's length (octets) + @param passwd The password for decrypting privkey (NOT SUPPORTED YET) + @param passwdlen Password's length (octets) + @param key [out] Destination for newly imported key @return CRYPT_OK if successful, upon error allocated memory is freed */ int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, - const unsigned char *passwd, unsigned long passwdlen, + const void *passwd, unsigned long passwdlen, rsa_key *key) { int err; From 2d8816607bfd3bb17e325c05a60f461d9974c5d7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 4 Apr 2017 09:15:22 +0200 Subject: [PATCH 0813/1192] update makefiles --- libtomcrypt_VS2008.vcproj | 4 ++++ makefile.mingw | 10 +++++----- makefile.msvc | 10 +++++----- makefile.unix | 10 +++++----- makefile_include.mk | 10 +++++----- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 9aa9c512f..6f92d2847 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2310,6 +2310,10 @@ RelativePath="src\pk\rsa\rsa_import.c" > + + diff --git a/makefile.mingw b/makefile.mingw index add777f37..afb745708 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -178,11 +178,11 @@ src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_radix.o \ +src/pk/rsa/rsa_import_x509.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \ +src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ +src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ diff --git a/makefile.msvc b/makefile.msvc index 7c748d232..404a5e82d 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -171,11 +171,11 @@ src/pk/pkcs1/pkcs_1_oaep_decode.obj src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/p src/pk/pkcs1/pkcs_1_pss_decode.obj src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj \ src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj \ src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj \ -src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_radix.obj src/pk/rsa/rsa_import_x509.obj \ -src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj src/pk/rsa/rsa_sign_saltlen_get.obj \ -src/pk/rsa/rsa_verify_hash.obj src/prngs/chacha20.obj src/prngs/fortuna.obj src/prngs/rc4.obj \ -src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj src/prngs/sprng.obj \ -src/prngs/yarrow.obj src/stream/chacha/chacha_crypt.obj src/stream/chacha/chacha_done.obj \ +src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_pkcs8.obj src/pk/rsa/rsa_import_radix.obj \ +src/pk/rsa/rsa_import_x509.obj src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_sign_hash.obj \ +src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/chacha20.obj src/prngs/fortuna.obj \ +src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj \ +src/prngs/sprng.obj src/prngs/yarrow.obj src/stream/chacha/chacha_crypt.obj src/stream/chacha/chacha_done.obj \ src/stream/chacha/chacha_ivctr32.obj src/stream/chacha/chacha_ivctr64.obj \ src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/stream/chacha/chacha_test.obj \ src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128.obj \ diff --git a/makefile.unix b/makefile.unix index e0ea2d9b8..9676ecb79 100644 --- a/makefile.unix +++ b/makefile.unix @@ -183,11 +183,11 @@ src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_radix.o \ +src/pk/rsa/rsa_import_x509.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \ +src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ +src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ diff --git a/makefile_include.mk b/makefile_include.mk index 2c3f24f7c..0dd17da75 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -282,11 +282,11 @@ src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \ src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \ -src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_radix.o src/pk/rsa/rsa_import_x509.o \ -src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_sign_saltlen_get.o \ -src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o src/prngs/rc4.o \ -src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o \ -src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ +src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_radix.o \ +src/pk/rsa/rsa_import_x509.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \ +src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \ +src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \ +src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \ src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \ src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \ From ef450fe14abcaabd576ce4027317ac2e6a52071a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 31 May 2017 17:35:37 +0200 Subject: [PATCH 0814/1192] fix error handling --- src/pk/rsa/rsa_import_pkcs8.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pk/rsa/rsa_import_pkcs8.c b/src/pk/rsa/rsa_import_pkcs8.c index 2f2aa365a..78d34586a 100755 --- a/src/pk/rsa/rsa_import_pkcs8.c +++ b/src/pk/rsa/rsa_import_pkcs8.c @@ -75,14 +75,14 @@ int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, /* alloc buffers */ buf1len = inlen; /* approx. */ buf1 = XMALLOC(buf1len); - if (buf1 == NULL) { err = CRYPT_MEM; goto LBL_NOCLEAR; } + if (buf1 == NULL) { err = CRYPT_MEM; goto LBL_NOFREE; } buf2len = inlen; /* approx. */ buf2 = XMALLOC(buf2len); - if (buf2 == NULL) { err = CRYPT_MEM; goto LBL_FREE; } + if (buf2 == NULL) { err = CRYPT_MEM; goto LBL_FREE1; } /* init key */ err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, &zero, &iter, NULL); - if (err != CRYPT_OK) { goto LBL_NOCLEAR; } + if (err != CRYPT_OK) { goto LBL_FREE2; } /* try to decode encrypted priv key */ LTC_SET_ASN1(key_seq_e, 0, LTC_ASN1_OCTET_STRING, buf1, buf1len); @@ -136,13 +136,13 @@ int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, mp_clear_multi(zero, iter, NULL); key->type = PK_PRIVATE; err = CRYPT_OK; - goto LBL_FREE; + goto LBL_FREE2; LBL_ERR: mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, zero, iter, NULL); -LBL_NOCLEAR: +LBL_FREE2: XFREE(buf2); -LBL_FREE: +LBL_FREE1: XFREE(buf1); LBL_NOFREE: return err; From 2a883b44c70cd2e27c1757c5a18526bc7bd65622 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 8 Jun 2017 22:25:24 +0200 Subject: [PATCH 0815/1192] do not expose dsa_make_params as a public API --- src/headers/tomcrypt_pk.h | 2 -- src/pk/dsa/dsa_make_key.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 2c9f75959..a538acc0d 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -410,8 +410,6 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, int dsa_make_key_ex(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key, char* p_hex, char* q_hex, char* g_hex); -int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g); - void dsa_free(dsa_key *key); int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 0cca7a8b6..52b0affbe 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -18,7 +18,7 @@ #ifdef LTC_MDSA /** - Create DSA parameters + Create DSA parameters (INTERNAL ONLY, not part of public API) @param prng An active PRNG state @param wprng The index of the PRNG desired @param group_size Size of the multiplicative group (octets) @@ -28,7 +28,7 @@ @param g [out] bignum where generated 'g' is stored (must be initialized by caller) @return CRYPT_OK if successful, upon error this function will free all allocated memory */ -int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g) +static int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g) { unsigned long L, N, n, outbytes, seedbytes, counter, j, i; int err, res, mr_tests_q, mr_tests_p, found_p, found_q, hash; From f46b32ba2ee2e6d15afbfe3f8b92387edd4c4506 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 8 Jun 2017 23:08:51 +0200 Subject: [PATCH 0816/1192] better DH primes --- src/headers/tomcrypt_custom.h | 5 +- src/pk/dh/dh.c | 10 +- src/pk/dh/dh_static.c | 256 ++++++++++++++++++++++------------ src/pk/dh/dh_sys.c | 8 +- 4 files changed, 179 insertions(+), 100 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 83c76d252..155b6638d 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -364,16 +364,15 @@ /* Supported Key Sizes */ #define LTC_DH768 #define LTC_DH1024 -#define LTC_DH1280 #define LTC_DH1536 -#define LTC_DH1792 #define LTC_DH2048 #ifndef TFM_DESC /* tfm has a problem in fp_isprime for larger key sizes */ -#define LTC_DH2560 #define LTC_DH3072 #define LTC_DH4096 +#define LTC_DH6144 +#define LTC_DH8192 #endif /* Include Katja (a Rabin variant like RSA) */ diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index 7cafc1872..14ac3357b 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -35,8 +35,8 @@ int dh_compat_test(void) #if 0 printf("dh_test():testing size %d-bits\n", sets[x].size * 8); #endif - if ((err = mp_read_radix(g,(char *)sets[x].base, 64)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p,(char *)sets[x].prime, 64)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(g,(char *)sets[x].base, 16)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p,(char *)sets[x].prime, 16)) != CRYPT_OK) { goto error; } /* ensure p is prime */ if ((err = mp_prime_is_prime(p, 8, &primality)) != CRYPT_OK) { goto done; } @@ -158,8 +158,8 @@ int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) goto error; } - if ((err = mp_read_radix(g, sets[key->idx].base, 64)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p, sets[key->idx].prime, 64)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(g, sets[key->idx].base, 16)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, sets[key->idx].prime, 16)) != CRYPT_OK) { goto error; } /* load the x value */ if ((err = mp_read_unsigned_bin(key->x, buf, keysize)) != CRYPT_OK) { goto error; } @@ -359,7 +359,7 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, return err; } - if ((err = mp_read_radix(p, (char *)sets[private_key->idx].prime, 64)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, (char *)sets[private_key->idx].prime, 16)) != CRYPT_OK) { goto error; } if ((err = mp_exptmod(public_key->y, private_key->x, p, tmp)) != CRYPT_OK) { goto error; } /* enough space for output? */ diff --git a/src/pk/dh/dh_static.c b/src/pk/dh/dh_static.c index d15401789..d5be03cfb 100644 --- a/src/pk/dh/dh_static.c +++ b/src/pk/dh/dh_static.c @@ -23,121 +23,201 @@ /* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ const dh_set sets[] = { #ifdef LTC_DH768 -{ +{ /* 768-bit MODP Group 1 - https://tools.ietf.org/html/rfc7296#appendix-B.1 */ 96, "DH-768", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "//////m3wvV" + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A63A3620FFFFFFFFFFFFFFFF" }, #endif #ifdef LTC_DH1024 -{ +{ /* 1024-bit MODP Group 2 - https://tools.ietf.org/html/rfc7296#appendix-B.2 */ 128, "DH-1024", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////m3C47" -}, -#endif -#ifdef LTC_DH1280 -{ - 160, - "DH-1280", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "//////////////////////////////m4kSN" + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" + "FFFFFFFFFFFFFFFF" }, #endif #ifdef LTC_DH1536 -{ +{ /* 1536-bit MODP Group 5 - https://tools.ietf.org/html/rfc3526#section-2 */ 192, "DH-1536", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////m5uqd" -}, -#endif -#ifdef LTC_DH1792 -{ - 224, - "DH-1792", - "4", - "F///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "//////////////////////////////////////////////////////mT/sd" + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF" }, #endif #ifdef LTC_DH2048 -{ +{ /* 2048-bit MODP Group 14 - https://tools.ietf.org/html/rfc3526#section-3 */ 256, "DH-2048", - "4", - "3///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "/////////////////////////////////////////m8MPh" -}, -#endif -#ifdef LTC_DH2560 -{ - 320, - "DH-2560", - "4", - "3///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "/////mKFpF" + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AACAA68FFFFFFFFFFFFFFFF" }, #endif #ifdef LTC_DH3072 -{ +{ /* 3072-bit MODP Group 15 - https://tools.ietf.org/html/rfc3526#section-4 */ 384, "DH-3072", - "4", - "3///////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "/////////////////////////////m32nN" + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF" }, #endif #ifdef LTC_DH4096 -{ +{ /* 4096-bit MODP Group 16 - https://tools.ietf.org/html/rfc3526#section-5 */ 512, "DH-4096", - "4", - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "////////////////////////////////////////////////////////////" - "/////////////////////m8pOF" + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" + "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" + "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" + "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" + "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" + "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199" + "FFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH6144 +{ /* 6144-bit MODP Group 17 - https://tools.ietf.org/html/rfc3526#section-6 */ + 786, + "DH-6144", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" + "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" + "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" + "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" + "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" + "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BD" + "F8FF9406AD9E530EE5DB382F413001AEB06A53ED9027D831" + "179727B0865A8918DA3EDBEBCF9B14ED44CE6CBACED4BB1B" + "DB7F1447E6CC254B332051512BD7AF426FB8F401378CD2BF" + "5983CA01C64B92ECF032EA15D1721D03F482D7CE6E74FEF6" + "D55E702F46980C82B5A84031900B1C9E59E7C97FBEC7E8F3" + "23A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE328" + "06A1D58BB7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55C" + "DA56C9EC2EF29632387FE8D76E3C0468043E8F663F4860EE" + "12BF2D5B0B7474D6E694F91E6DCC4024FFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH8192 +{ /* 8192-bit MODP Group 18 - https://tools.ietf.org/html/rfc3526#section-7 */ + 1024, + "DH-8192", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" + "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" + "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" + "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" + "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" + "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BD" + "F8FF9406AD9E530EE5DB382F413001AEB06A53ED9027D831" + "179727B0865A8918DA3EDBEBCF9B14ED44CE6CBACED4BB1B" + "DB7F1447E6CC254B332051512BD7AF426FB8F401378CD2BF" + "5983CA01C64B92ECF032EA15D1721D03F482D7CE6E74FEF6" + "D55E702F46980C82B5A84031900B1C9E59E7C97FBEC7E8F3" + "23A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE328" + "06A1D58BB7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55C" + "DA56C9EC2EF29632387FE8D76E3C0468043E8F663F4860EE" + "12BF2D5B0B7474D6E694F91E6DBE115974A3926F12FEE5E4" + "38777CB6A932DF8CD8BEC4D073B931BA3BC832B68D9DD300" + "741FA7BF8AFC47ED2576F6936BA424663AAB639C5AE4F568" + "3423B4742BF1C978238F16CBE39D652DE3FDB8BEFC848AD9" + "22222E04A4037C0713EB57A81A23F0C73473FC646CEA306B" + "4BCBC8862F8385DDFA9D4B7FA2C087E879683303ED5BDD3A" + "062B3CF5B3A278A66D2A13F83F44F82DDF310EE074AB6A36" + "4597E899A0255DC164F31CC50846851DF9AB48195DED7EA1" + "B1D510BD7EE74D73FAF36BC31ECFA268359046F4EB879F92" + "4009438B481C6CD7889A002ED5EE382BC9190DA6FC026E47" + "9558E4475677E9AA9E3050E2765694DFC81F56E880B96E71" + "60C980DD98EDD3DFFFFFFFFFFFFFFFFF" }, #endif { diff --git a/src/pk/dh/dh_sys.c b/src/pk/dh/dh_sys.c index 63cad6062..8a42c96c0 100644 --- a/src/pk/dh/dh_sys.c +++ b/src/pk/dh/dh_sys.c @@ -354,8 +354,8 @@ int dh_sign_hash(const unsigned char *in, unsigned long inlen, if ((err = mp_read_unsigned_bin(k, buf, sets[key->idx].size)) != CRYPT_OK) { goto LBL_ERR; } /* load g, p and p1 */ - if ((err = mp_read_radix(g, sets[key->idx].base, 64)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(p, sets[key->idx].prime, 64)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(g, sets[key->idx].base, 16)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(p, sets[key->idx].prime, 16)) != CRYPT_OK) { goto LBL_ERR; } if ((err = mp_sub_d(p, 1, p1)) != CRYPT_OK) { goto LBL_ERR; } if ((err = mp_div_2(p1, p1)) != CRYPT_OK) { goto LBL_ERR; } /* p1 = (p-1)/2 */ @@ -458,8 +458,8 @@ int dh_verify_hash(const unsigned char *sig, unsigned long siglen, INPUT_BIGNUM(b, sig, x, y, siglen); /* load p and g */ - if ((err = mp_read_radix(p, sets[key->idx].prime, 64)) != CRYPT_OK) { goto error1; } - if ((err = mp_read_radix(g, sets[key->idx].base, 64)) != CRYPT_OK) { goto error1; } + if ((err = mp_read_radix(p, sets[key->idx].prime, 16)) != CRYPT_OK) { goto error1; } + if ((err = mp_read_radix(g, sets[key->idx].base, 16)) != CRYPT_OK) { goto error1; } /* load m */ if ((err = mp_read_unsigned_bin(m, (unsigned char *)hash, hashlen)) != CRYPT_OK) { goto error1; } From f31d8ff8641487dc14c84cc3ef8ed72a9b750935 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 18:07:44 +0200 Subject: [PATCH 0817/1192] implement smaller private key sizes --- src/pk/dh/dh.c | 55 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index 14ac3357b..e1f824e43 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -116,6 +116,39 @@ int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) unsigned long x; void *p, *g; int err; + /* Table of the strength estimates from https://tools.ietf.org/html/rfc3526#section-8 + * We use them as a reference to estimate an appropriate private key size. + */ + const int private_key_sizes[][2] = + { +#ifdef LTC_DH768 + { 180, 240, }, +#endif +#ifdef LTC_DH1024 + { 180, 240, }, +#endif +#ifdef LTC_DH1536 + { 180, 240, }, +#endif +#ifdef LTC_DH2048 + /* here we use 224 instead of 220 as NIST requires + * at least 224bits for the 2048bit group */ + { 224, 320, }, +#endif +#ifdef LTC_DH3072 + { 260, 420, }, +#endif +#ifdef LTC_DH4096 + { 300, 480, }, +#endif +#ifdef LTC_DH6144 + { 340, 540, }, +#endif +#ifdef LTC_DH8192 + { 380, 620, }, +#endif + { INT_MAX, INT_MAX, } + }; LTC_ARGCHK(key != NULL); @@ -126,16 +159,28 @@ int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) /* find key size */ for (x = 0; (keysize > sets[x].size) && (sets[x].size != 0); x++); -#ifdef FAST_PK - keysize = MIN(sets[x].size, 32); -#else - keysize = sets[x].size; -#endif if (sets[x].size == 0) { return CRYPT_INVALID_KEYSIZE; } + if (x >= sizeof(private_key_sizes) / sizeof(private_key_sizes[0])) { + return CRYPT_INVALID_KEYSIZE; + } key->idx = x; + /* 1. Read a random digit + * 2. Shorten it to the range between both strengths' + * 3. Now we have a random digit between both strengths' + * 4. Make sure the division afterwards rounds up + * 5. Convert bit to byte + */ + if (prng_descriptor[wprng].read((void*)&keysize, sizeof(keysize), prng) != sizeof(keysize)) { + return CRYPT_ERROR_READPRNG; + } + keysize %= private_key_sizes[x][1] - private_key_sizes[x][0]; + keysize += private_key_sizes[x][0]; + keysize += 7; + keysize /= 8; + /* allocate buffer */ buf = XMALLOC(keysize); if (buf == NULL) { From e60d2076c5ec1768ead021a1daa3200f2d431724 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 18:29:18 +0200 Subject: [PATCH 0818/1192] resurrect DH in timing --- demos/timing.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/demos/timing.c b/demos/timing.c index f03d74f45..61f509efb 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -888,6 +888,58 @@ static void time_katja(void) static void time_katja(void) { fprintf(stderr, "NO Katja\n"); } #endif +#ifdef LTC_MDH +/* time various DH operations */ +static void time_dh(void) +{ + dh_key key; + ulong64 t1, t2; + unsigned char buf[2][4096]; + unsigned long i, x, y, z; + int err; + static unsigned long sizes[] = {768/8, 1024/8, 1536/8, 2048/8, 3072/8, 4096/8, 6144/8, 8192/8, 100000}; + + for (x = sizes[i=0]; x < 100000; x = sizes[++i]) { + t2 = 0; + for (y = 0; y < 16; y++) { + t_start(); + t1 = t_read(); + if ((err = dh_make_key(&yarrow_prng, find_prng("yarrow"), x, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\ndh_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; + + if (y < 15) { + dh_free(&key); + } + } + t2 >>= 4; + fprintf(stderr, "DH-%4lu make_key took %15llu cycles\n", x*8, t2); + + t2 = 0; + for (y = 0; y < 16; y++) { + t_start(); + t1 = t_read(); + z = sizeof(buf[1]); + if ((err = dh_encrypt_key(buf[0], 20, buf[1], &z, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), + &key)) != CRYPT_OK) { + fprintf(stderr, "\n\ndh_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t1 = t_read() - t1; + t2 += t1; + } + t2 >>= 4; + fprintf(stderr, "DH-%4lu encrypt_key took %15llu cycles\n", x*8, t2); + dh_free(&key); + } +} +#else +static void time_dh(void) { fprintf(stderr, "NO DH\n"); } +#endif + #ifdef LTC_MECC /* time various ECC operations */ static void time_ecc(void) @@ -1386,6 +1438,7 @@ time_rsa(); time_dsa(); time_ecc(); time_katja(); +time_dh(); return EXIT_SUCCESS; } From e3329bec26ae1150d3ca11af88a32f427086b2f0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 18:30:18 +0200 Subject: [PATCH 0819/1192] make it possible to pass a single timing test to run --- demos/timing.c | 87 ++++++++++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 39 deletions(-) diff --git a/demos/timing.c b/demos/timing.c index 61f509efb..fa5cdcd1c 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -133,7 +133,7 @@ static void init_timer(void) fprintf(stderr, "Clock Skew: %lu\n", (unsigned long)skew); } -static int time_keysched(void) +static void time_keysched(void) { unsigned long x, y1; ulong64 t1, c1; @@ -165,12 +165,10 @@ static int time_keysched(void) #undef DO1 } tally_results(0); - - return 0; } #ifdef LTC_ECB_MODE -static int time_cipher_ecb(void) +static void time_cipher_ecb(void) { unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; @@ -237,15 +235,13 @@ static int time_cipher_ecb(void) #undef DO1 } tally_results(1); - - return 0; } #else -static int time_cipher_ecb(void) { fprintf(stderr, "NO ECB\n"); return 0; } +static void time_cipher_ecb(void) { fprintf(stderr, "NO ECB\n"); return 0; } #endif #ifdef LTC_CBC_MODE -static int time_cipher_cbc(void) +static void time_cipher_cbc(void) { unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; @@ -312,15 +308,13 @@ static int time_cipher_cbc(void) #undef DO1 } tally_results(1); - - return 0; } #else -static int time_cipher_cbc(void) { fprintf(stderr, "NO CBC\n"); return 0; } +static void time_cipher_cbc(void) { fprintf(stderr, "NO CBC\n"); return 0; } #endif #ifdef LTC_CTR_MODE -static int time_cipher_ctr(void) +static void time_cipher_ctr(void) { unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; @@ -387,15 +381,13 @@ static int time_cipher_ctr(void) #undef DO1 } tally_results(1); - - return 0; } #else -static int time_cipher_ctr(void) { fprintf(stderr, "NO CTR\n"); return 0; } +static void time_cipher_ctr(void) { fprintf(stderr, "NO CTR\n"); return 0; } #endif #ifdef LTC_LRW_MODE -static int time_cipher_lrw(void) +static void time_cipher_lrw(void) { unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; @@ -464,15 +456,13 @@ static int time_cipher_lrw(void) #undef DO1 } tally_results(1); - - return 0; } #else -static int time_cipher_lrw(void) { fprintf(stderr, "NO LRW\n"); return 0; } +static void time_cipher_lrw(void) { fprintf(stderr, "NO LRW\n"); return 0; } #endif -static int time_hash(void) +static void time_hash(void) { unsigned long x, y1, len; ulong64 t1, t2, c1, c2; @@ -519,8 +509,6 @@ static int time_hash(void) #undef DO1 } tally_results(2); - - return 0; } /*#warning you need an mp_rand!!!*/ @@ -1399,9 +1387,36 @@ static void time_encmacs(void) time_encmacs_(32); } -int main(void) +#define LTC_TEST_FN(f) { f, #f } +int main(int argc, char **argv) { int err; + +const struct +{ + void (*fn)(void); + const char* name; +} test_functions[] = { + LTC_TEST_FN(time_keysched), + LTC_TEST_FN(time_cipher_ecb), + LTC_TEST_FN(time_cipher_cbc), + LTC_TEST_FN(time_cipher_ctr), + LTC_TEST_FN(time_cipher_lrw), + LTC_TEST_FN(time_hash), + LTC_TEST_FN(time_macs), + LTC_TEST_FN(time_encmacs), + LTC_TEST_FN(time_prng), + LTC_TEST_FN(time_mult), + LTC_TEST_FN(time_sqr), + LTC_TEST_FN(time_rsa), + LTC_TEST_FN(time_dsa), + LTC_TEST_FN(time_ecc), + LTC_TEST_FN(time_dh), + LTC_TEST_FN(time_katja) +}; +char *single_test = NULL; +unsigned int i; + init_timer(); register_all_ciphers(); register_all_hashes(); @@ -1423,22 +1438,16 @@ if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT exit(EXIT_FAILURE); } -time_keysched(); -time_cipher_ecb(); -time_cipher_cbc(); -time_cipher_ctr(); -time_cipher_lrw(); -time_hash(); -time_macs(); -time_encmacs(); -time_prng(); -time_mult(); -time_sqr(); -time_rsa(); -time_dsa(); -time_ecc(); -time_katja(); -time_dh(); +/* single test name from commandline */ +if (argc > 1) single_test = argv[1]; + +for (i = 0; i < sizeof(test_functions)/sizeof(test_functions[0]); ++i) { + if (single_test && strstr(test_functions[i].name, single_test) == NULL) { + continue; + } + test_functions[i].fn(); +} + return EXIT_SUCCESS; } From c9f462869306182272e8e4c02da53d6370391ab1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 13:38:21 +0200 Subject: [PATCH 0820/1192] don't call `rng_make_prng()` from `dh_make_key()` While testing with multiple threads I had spurious errors where some tests can't read from the PRNG. If I tracked it down correctly that's caused by `dh_make_key()` calling `rng_make_prng()` which re-initializes the selected PRNG. I like the idea of "refreshing" the PRNG with entropy from a hopefully secure RNG before generating a new key, but I don't think it's the duty of a key-generation function to ensure that, but merely the application that implements key-generation. --- src/pk/dh/dh.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index e1f824e43..73754c14f 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -188,11 +188,6 @@ int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) } /* make up random string */ - if ( rng_make_prng( keysize, wprng, prng, NULL) != CRYPT_OK) { - err = CRYPT_ERROR_READPRNG; - goto error2; - } - if (prng_descriptor[wprng].read(buf, keysize, prng) != (unsigned long)keysize) { err = CRYPT_ERROR_READPRNG; goto error2; From 532c511f5244e8167dfe35eb9503a0271fbebd5e Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 10 Jun 2017 23:02:30 +0200 Subject: [PATCH 0821/1192] improved dh_make_key --- src/pk/dh/dh.c | 121 ++++++++++++++++++------------------------------- 1 file changed, 45 insertions(+), 76 deletions(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index 73754c14f..a0c09133f 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -104,53 +104,36 @@ int dh_get_size(dh_key *key) /** Make a DH key [private key pair] - @param prng An active PRNG state - @param wprng The index for the PRNG you desire to use - @param keysize The key size (octets) desired - @param key [out] Where the newly created DH key will be stored + @param prng An active PRNG state + @param wprng The index for the PRNG you desire to use + @param groupsize The size (octets) of used DH group + @param key [out] Where the newly created DH key will be stored @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. */ -int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) +int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) { unsigned char *buf; - unsigned long x; - void *p, *g; + unsigned long x, keysize; + void *p, *g, *p_minus1; int err; - /* Table of the strength estimates from https://tools.ietf.org/html/rfc3526#section-8 - * We use them as a reference to estimate an appropriate private key size. - */ - const int private_key_sizes[][2] = - { -#ifdef LTC_DH768 - { 180, 240, }, -#endif -#ifdef LTC_DH1024 - { 180, 240, }, -#endif -#ifdef LTC_DH1536 - { 180, 240, }, -#endif -#ifdef LTC_DH2048 - /* here we use 224 instead of 220 as NIST requires - * at least 224bits for the 2048bit group */ - { 224, 320, }, -#endif -#ifdef LTC_DH3072 - { 260, 420, }, -#endif -#ifdef LTC_DH4096 - { 300, 480, }, -#endif -#ifdef LTC_DH6144 - { 340, 540, }, -#endif -#ifdef LTC_DH8192 - { 380, 620, }, -#endif - { INT_MAX, INT_MAX, } - }; LTC_ARGCHK(key != NULL); + LTC_ARGCHK(prng != NULL); + + /* Table of the strength estimates from https://tools.ietf.org/html/rfc3526#section-8 + * We use "Estimate 2" to get an appropriate private key (exponent) size. + */ + switch (groupsize) { + case 96: keysize = 30; break; /* 768-bit => key size 240-bit */ + case 128: keysize = 30; break; /* 1024-bit => key size 240-bit */ + case 192: keysize = 30; break; /* 1536-bit => key size 240-bit */ + case 256: keysize = 40; break; /* 2048-bit => key size 320-bit */ + case 384: keysize = 52; break; /* 3072-bit => key size 416-bit */ + case 512: keysize = 60; break; /* 4096-bit => key size 480-bit */ + case 768: keysize = 67; break; /* 6144-bit => key size 536-bit */ + case 1024: keysize = 77; break; /* 8192-bit => key size 616-bit */ + default: return CRYPT_INVALID_KEYSIZE; + } /* good prng? */ if ((err = prng_is_valid(wprng)) != CRYPT_OK) { @@ -162,61 +145,47 @@ int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key) if (sets[x].size == 0) { return CRYPT_INVALID_KEYSIZE; } - if (x >= sizeof(private_key_sizes) / sizeof(private_key_sizes[0])) { - return CRYPT_INVALID_KEYSIZE; - } key->idx = x; - /* 1. Read a random digit - * 2. Shorten it to the range between both strengths' - * 3. Now we have a random digit between both strengths' - * 4. Make sure the division afterwards rounds up - * 5. Convert bit to byte - */ - if (prng_descriptor[wprng].read((void*)&keysize, sizeof(keysize), prng) != sizeof(keysize)) { - return CRYPT_ERROR_READPRNG; - } - keysize %= private_key_sizes[x][1] - private_key_sizes[x][0]; - keysize += private_key_sizes[x][0]; - keysize += 7; - keysize /= 8; - /* allocate buffer */ buf = XMALLOC(keysize); if (buf == NULL) { return CRYPT_MEM; } - /* make up random string */ - if (prng_descriptor[wprng].read(buf, keysize, prng) != (unsigned long)keysize) { - err = CRYPT_ERROR_READPRNG; - goto error2; - } - - /* init parameters */ - if ((err = mp_init_multi(&g, &p, &key->x, &key->y, NULL)) != CRYPT_OK) { - goto error; + /* init big numbers */ + if ((err = mp_init_multi(&g, &p, &p_minus1, &key->x, &key->y, NULL)) != CRYPT_OK) { + goto freebuf; } if ((err = mp_read_radix(g, sets[key->idx].base, 16)) != CRYPT_OK) { goto error; } if ((err = mp_read_radix(p, sets[key->idx].prime, 16)) != CRYPT_OK) { goto error; } - - /* load the x value */ - if ((err = mp_read_unsigned_bin(key->x, buf, keysize)) != CRYPT_OK) { goto error; } - if ((err = mp_exptmod(g, key->x, p, key->y)) != CRYPT_OK) { goto error; } + if ((err = mp_sub_d(p, 1, p_minus1)) != CRYPT_OK) { goto error; } + + do { + /* make up random buf */ + if (prng_descriptor[wprng].read(buf, keysize, prng) != keysize) { + err = CRYPT_ERROR_READPRNG; + goto error; + } + /* load the x value - private key */ + if ((err = mp_read_unsigned_bin(key->x, buf, keysize)) != CRYPT_OK) { goto error; } + /* compute the y value - public key */ + if ((err = mp_exptmod(g, key->x, p, key->y)) != CRYPT_OK) { goto error; } + /* avoid: y == 1 OR y == p-1 */ + } while (mp_cmp(key->y, p_minus1) == LTC_MP_EQ || mp_cmp_d(key->y, 1) == LTC_MP_EQ); + + /* success */ key->type = PK_PRIVATE; - - /* free up ram */ err = CRYPT_OK; goto done; + error: mp_clear_multi(key->x, key->y, NULL); done: - mp_clear_multi(p, g, NULL); -error2: -#ifdef LTC_CLEAN_STACK + mp_clear_multi(g, p, p_minus1, NULL); +freebuf: zeromem(buf, keysize); -#endif XFREE(buf); return err; } From 71884788e38bb692255b5c0b9aa8e4b8df161b2c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 11 Jun 2017 10:12:18 +0200 Subject: [PATCH 0822/1192] fix warning: comparison between signed and unsigned integer --- src/pk/dh/dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index a0c09133f..b4dc8e5ae 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -141,7 +141,7 @@ int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) } /* find key size */ - for (x = 0; (keysize > sets[x].size) && (sets[x].size != 0); x++); + for (x = 0; ((int)keysize > sets[x].size) && (sets[x].size != 0); x++); if (sets[x].size == 0) { return CRYPT_INVALID_KEYSIZE; } From 361778d2ac9a8bd00a3e9379b713aeb408e218ed Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 11 Jun 2017 19:43:08 +0200 Subject: [PATCH 0823/1192] another dh_make_key redesign --- src/pk/dh/dh.c | 58 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index b4dc8e5ae..6239c7ab4 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -113,39 +113,50 @@ int dh_get_size(dh_key *key) int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) { unsigned char *buf; - unsigned long x, keysize; + unsigned long idx, keysize; void *p, *g, *p_minus1; int err; LTC_ARGCHK(key != NULL); LTC_ARGCHK(prng != NULL); - - /* Table of the strength estimates from https://tools.ietf.org/html/rfc3526#section-8 - * We use "Estimate 2" to get an appropriate private key (exponent) size. - */ - switch (groupsize) { - case 96: keysize = 30; break; /* 768-bit => key size 240-bit */ - case 128: keysize = 30; break; /* 1024-bit => key size 240-bit */ - case 192: keysize = 30; break; /* 1536-bit => key size 240-bit */ - case 256: keysize = 40; break; /* 2048-bit => key size 320-bit */ - case 384: keysize = 52; break; /* 3072-bit => key size 416-bit */ - case 512: keysize = 60; break; /* 4096-bit => key size 480-bit */ - case 768: keysize = 67; break; /* 6144-bit => key size 536-bit */ - case 1024: keysize = 77; break; /* 8192-bit => key size 616-bit */ - default: return CRYPT_INVALID_KEYSIZE; - } + LTC_ARGCHK(groupsize >= 32); /* good prng? */ if ((err = prng_is_valid(wprng)) != CRYPT_OK) { return err; } - /* find key size */ - for (x = 0; ((int)keysize > sets[x].size) && (sets[x].size != 0); x++); - if (sets[x].size == 0) { + /* find group size */ + for (idx = 0; (groupsize > sets[idx].size) && (sets[idx].size != 0); idx++); + if (sets[idx].size == 0) { + return CRYPT_INVALID_KEYSIZE; + } + groupsize = sets[idx].size; + + /* The strength estimates from https://tools.ietf.org/html/rfc3526#section-8 + * We use "Estimate 2" to get an appropriate private key (exponent) size. + */ + if (groupsize <= 192) { + keysize = 30; /* 1536-bit => key size 240-bit */ + } + else if (groupsize <= 256) { + keysize = 40; /* 2048-bit => key size 320-bit */ + } + else if (groupsize <= 384) { + keysize = 52; /* 3072-bit => key size 416-bit */ + } + else if (groupsize <= 512) { + keysize = 60; /* 4096-bit => key size 480-bit */ + } + else if (groupsize <= 768) { + keysize = 67; /* 6144-bit => key size 536-bit */ + } + else if (groupsize <= 1024) { + keysize = 77; /* 8192-bit => key size 616-bit */ + } + else { return CRYPT_INVALID_KEYSIZE; } - key->idx = x; /* allocate buffer */ buf = XMALLOC(keysize); @@ -158,8 +169,8 @@ int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) goto freebuf; } - if ((err = mp_read_radix(g, sets[key->idx].base, 16)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p, sets[key->idx].prime, 16)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(g, sets[idx].base, 16)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, sets[idx].prime, 16)) != CRYPT_OK) { goto error; } if ((err = mp_sub_d(p, 1, p_minus1)) != CRYPT_OK) { goto error; } do { @@ -173,9 +184,10 @@ int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) /* compute the y value - public key */ if ((err = mp_exptmod(g, key->x, p, key->y)) != CRYPT_OK) { goto error; } /* avoid: y == 1 OR y == p-1 */ - } while (mp_cmp(key->y, p_minus1) == LTC_MP_EQ || mp_cmp_d(key->y, 1) == LTC_MP_EQ); + } while (mp_cmp(key->y, p_minus1) != LTC_MP_LT || mp_cmp_d(key->y, 1) != LTC_MP_GT); /* success */ + key->idx = idx; key->type = PK_PRIVATE; err = CRYPT_OK; goto done; From bc4236d90ff670fbb132164f48ff55037d94ed50 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 11 Jun 2017 21:12:14 +0200 Subject: [PATCH 0824/1192] tuning dh_make_key --- src/pk/dh/dh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index 6239c7ab4..f832e0187 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -119,7 +119,6 @@ int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) LTC_ARGCHK(key != NULL); LTC_ARGCHK(prng != NULL); - LTC_ARGCHK(groupsize >= 32); /* good prng? */ if ((err = prng_is_valid(wprng)) != CRYPT_OK) { @@ -183,8 +182,8 @@ int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) if ((err = mp_read_unsigned_bin(key->x, buf, keysize)) != CRYPT_OK) { goto error; } /* compute the y value - public key */ if ((err = mp_exptmod(g, key->x, p, key->y)) != CRYPT_OK) { goto error; } - /* avoid: y == 1 OR y == p-1 */ - } while (mp_cmp(key->y, p_minus1) != LTC_MP_LT || mp_cmp_d(key->y, 1) != LTC_MP_GT); + /* avoid: y <= 1 OR y >= p-1 */ + } while (mp_cmp(key->y, p_minus1) != LTC_MP_LT || mp_cmp_d(key->y, 1) != LTC_MP_GT); /* success */ key->idx = idx; From 114b694735d4f562b60aa861082fae55c659650f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 11 Jun 2017 23:20:46 +0200 Subject: [PATCH 0825/1192] trying to fix dh_shared_secret - #119 --- src/pk/dh/dh.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index f832e0187..16601f24d 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -355,7 +355,7 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) int dh_shared_secret(dh_key *private_key, dh_key *public_key, unsigned char *out, unsigned long *outlen) { - void *tmp, *p; + void *tmp, *p, *p_minus1; unsigned long x; int err; @@ -375,26 +375,31 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, } /* compute y^x mod p */ - if ((err = mp_init_multi(&tmp, &p, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&tmp, &p, &p_minus1, NULL)) != CRYPT_OK) { return err; } - if ((err = mp_read_radix(p, (char *)sets[private_key->idx].prime, 16)) != CRYPT_OK) { goto error; } - if ((err = mp_exptmod(public_key->y, private_key->x, p, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, sets[private_key->idx].prime, 16)) != CRYPT_OK) { goto error; } + if ((err = mp_sub_d(p, 1, p_minus1)) != CRYPT_OK) { goto error; } + if (mp_cmp(public_key->y, p_minus1) != LTC_MP_LT || mp_cmp_d(public_key->y, 1) != LTC_MP_GT) { + /* reject public key with: y <= 1 OR y >= p-1 */ + err = CRYPT_INVALID_ARG; + goto error; + }; + if ((err = mp_exptmod(public_key->y, private_key->x, p, tmp)) != CRYPT_OK) { goto error; } /* enough space for output? */ x = (unsigned long)mp_unsigned_bin_size(tmp); if (*outlen < x) { err = CRYPT_BUFFER_OVERFLOW; - goto done; + goto error; } - if ((err = mp_to_unsigned_bin(tmp, out)) != CRYPT_OK) { goto error; } + if ((err = mp_to_unsigned_bin(tmp, out)) != CRYPT_OK) { goto error; } *outlen = x; err = CRYPT_OK; - goto done; + error: -done: - mp_clear_multi(p, tmp, NULL); + mp_clear_multi(p_minus1, p, tmp, NULL); return err; } From 4f12e41d29cc7a021599608e6bb85ea97cf73fbc Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 12 Jun 2017 16:35:27 +0200 Subject: [PATCH 0826/1192] fix trailing ; --- src/pk/dh/dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index 16601f24d..b90754047 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -385,7 +385,7 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, /* reject public key with: y <= 1 OR y >= p-1 */ err = CRYPT_INVALID_ARG; goto error; - }; + } if ((err = mp_exptmod(public_key->y, private_key->x, p, tmp)) != CRYPT_OK) { goto error; } /* enough space for output? */ From d6a77f5d6d78f62f345f5225e599695daffc208d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 11 May 2017 14:49:57 +0200 Subject: [PATCH 0827/1192] implement pthread support for tests --- tests/test.c | 82 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/tests/test.c b/tests/test.c index 7ed1e185a..3fac1af64 100644 --- a/tests/test.c +++ b/tests/test.c @@ -6,10 +6,12 @@ #define LTC_TEST_FN(f) { f, #f } -static const struct { +typedef struct { int (*fn)(void); const char* name; -} test_functions[] = +} test_function; + +static const test_function test_functions[] = { LTC_TEST_FN(store_test), LTC_TEST_FN(rotate_test), @@ -33,6 +35,7 @@ static const struct { LTC_TEST_FN(prng_test), }; + #if defined(_WIN32) #include /* GetSystemTimeAsFileTime */ #else @@ -63,6 +66,28 @@ static ulong64 epoch_usec(void) #endif } +#ifdef LTC_PTHREAD +typedef struct +{ + pthread_t thread_id; + const test_function* t; + int err; + ulong64 ts; +} thread_info; + +static void *run(void *arg) +{ + thread_info *tinfo = arg; + ulong64 ts; + + ts = epoch_usec(); + tinfo->err = tinfo->t->fn(); + tinfo->ts = epoch_usec() - ts; + + return arg; +} +#endif + /* * unregister ciphers, hashes & prngs @@ -241,11 +266,14 @@ static void register_algs(void) int main(int argc, char **argv) { +#ifdef LTC_PTHREAD + thread_info *tinfo, *res; +#endif int x, pass = 0, fail = 0, nop = 0; size_t fn_len, i, dots; char *single_test = NULL; ulong64 ts; - long delta, dur = 0; + long delta, dur, real = 0; register_algs(); printf("build == %s\n%s\n", GIT_VERSION, crypt_build_settings); @@ -266,10 +294,28 @@ int main(int argc, char **argv) #endif printf("MP_DIGIT_BIT = %d\n", MP_DIGIT_BIT); + +#ifdef LTC_PTHREAD + tinfo = XCALLOC(sizeof(test_functions)/sizeof(test_functions[0]), sizeof(thread_info)); + if (tinfo == NULL) { + printf("\n\nFAILURE: XCALLOC\n"); + return EXIT_FAILURE; + } +#endif + fn_len = 0; - for (i = 0; i < sizeof(test_functions)/sizeof(test_functions[0]); ++i) { + for (i = 0; i < sizeof(test_functions) / sizeof(test_functions[0]); ++i) { size_t len = strlen(test_functions[i].name); if (fn_len < len) fn_len = len; + +#ifdef LTC_PTHREAD + tinfo[i].t = &test_functions[i]; + x = pthread_create(&tinfo[i].thread_id, NULL, run, &tinfo[i]); + if (x != 0) { + printf("\n\nFAILURE: pthread_create\n"); + return EXIT_FAILURE; + } +#endif } fn_len = fn_len + (4 - (fn_len % 4)); @@ -277,6 +323,7 @@ int main(int argc, char **argv) /* single test name from commandline */ if (argc > 1) single_test = argv[1]; + dur = epoch_usec(); for (i = 0; i < sizeof(test_functions)/sizeof(test_functions[0]); ++i) { if (single_test && strcmp(test_functions[i].name, single_test)) { continue; @@ -287,10 +334,21 @@ int main(int argc, char **argv) while(dots--) printf("."); fflush(stdout); +#ifdef LTC_PTHREAD + x = pthread_join(tinfo[i].thread_id, (void**)&res); + if (x != 0){ + printf("\n\nFAILURE: pthread_join\n"); + return EXIT_FAILURE; + } + ts = res->ts; + x = res->err; +#else ts = epoch_usec(); x = test_functions[i].fn(); delta = (long)(epoch_usec() - ts); dur += delta; +#endif + real += dur; if (x == CRYPT_OK) { printf("passed %10.3fms", (double)(delta)/1000); @@ -305,15 +363,15 @@ int main(int argc, char **argv) fail++; } } + dur = epoch_usec() - dur; - if (fail > 0 || fail+pass+nop == 0) { - printf("\n\nFAILURE: passed=%d failed=%d nop=%d duration=%.1fsec\n", pass, fail, nop, (double)(dur)/(1000*1000)); - return EXIT_FAILURE; - } - else { - printf("\n\nSUCCESS: passed=%d failed=%d nop=%d duration=%.1fsec\n", pass, fail, nop, (double)(dur)/(1000*1000)); - return EXIT_SUCCESS; - } +#ifdef LTC_PTHREAD + XFREE(tinfo); +#endif + + x = (fail > 0 || fail+pass+nop == 0) ? EXIT_FAILURE : EXIT_SUCCESS; + printf("\n\n%s: passed=%d failed=%d nop=%d duration=%.1fsec real=%.1fsec\n", x ? "FAILURE" : "SUCCESS", pass, fail, nop, (double)(dur)/(1000*1000), (double)(real)/(1000*1000)); + return x; } /* $Source$ */ From e6cd8e8112174792a3847ebe41d1e136f5f89658 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 11 May 2017 14:51:27 +0200 Subject: [PATCH 0828/1192] fix failing tests with pthreads enabled --- tests/pkcs_1_eme_test.c | 2 ++ tests/pkcs_1_oaep_test.c | 2 ++ tests/pkcs_1_pss_test.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tests/pkcs_1_eme_test.c b/tests/pkcs_1_eme_test.c index e70915698..425c88387 100644 --- a/tests/pkcs_1_eme_test.c +++ b/tests/pkcs_1_eme_test.c @@ -48,7 +48,9 @@ int pkcs_1_eme_test(void) mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); } /* for */ +#ifndef LTC_PTHREAD unregister_prng(&no_prng_desc); +#endif return 0; } diff --git a/tests/pkcs_1_oaep_test.c b/tests/pkcs_1_oaep_test.c index ae1aee3ed..8be42d33a 100644 --- a/tests/pkcs_1_oaep_test.c +++ b/tests/pkcs_1_oaep_test.c @@ -48,7 +48,9 @@ int pkcs_1_oaep_test(void) mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); } /* for */ +#ifndef LTC_PTHREAD unregister_prng(&no_prng_desc); +#endif return 0; } diff --git a/tests/pkcs_1_pss_test.c b/tests/pkcs_1_pss_test.c index 76822c9c1..c7b352b4a 100644 --- a/tests/pkcs_1_pss_test.c +++ b/tests/pkcs_1_pss_test.c @@ -49,7 +49,9 @@ int pkcs_1_pss_test(void) mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); } /* for */ +#ifndef LTC_PTHREAD unregister_prng(&no_prng_desc); +#endif return 0; } From be9c598ee71dc49f8ac00c6832c5fb50c4baf1fc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 11 May 2017 15:00:32 +0200 Subject: [PATCH 0829/1192] add new travis tests with pthread support --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index fd354ef80..86fade7be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,6 +90,14 @@ env: BUILDSCRIPT="run.sh" BUILDNAME="CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE" BUILDOPTIONS="-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="PTHREAD" + BUILDOPTIONS="-DLTC_PTHREAD" + - | + BUILDSCRIPT="run.sh" + BUILDNAME="CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE+PTHREAD" + BUILDOPTIONS="-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING -DLTC_PTHREAD" - | BUILDSCRIPT="testbuild.sh" BUILDNAME="NOTEST" From 904366eb0f3dcbfe78b9f36dae0783e669e3478a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 12:46:41 +0200 Subject: [PATCH 0830/1192] check that all ciphers/hashes/prngs are unregistered --- helper.pl | 6 ++++++ tests/test.c | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/helper.pl b/helper.pl index 6a90cfead..0a6eb517d 100755 --- a/helper.pl +++ b/helper.pl @@ -98,6 +98,12 @@ sub check_descriptor { warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/; } } + for my $d (@descriptors) { + for my $f ("./tests/test.c") { + my $txt = read_file($f); + warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/; + } + } my $name = sprintf("%-17s", "check-${which}:"); warn( $fails > 0 ? "${name}FAIL $fails\n" : "${name}PASS\n" ); return $fails; diff --git a/tests/test.c b/tests/test.c index 3fac1af64..76aab188e 100644 --- a/tests/test.c +++ b/tests/test.c @@ -95,7 +95,17 @@ static void *run(void *arg) static void _unregister_all(void) { #ifdef LTC_RIJNDAEL - unregister_cipher(&aes_desc); +#ifdef ENCRYPT_ONLY + /* alternative would be + * unregister_cipher(&rijndael_enc_desc); + */ + unregister_cipher(&aes_enc_desc); +#else + /* alternative would be + * unregister_cipher(&rijndael_desc); + */ + unregister_cipher(&aes_desc); +#endif #endif #ifdef LTC_BLOWFISH unregister_cipher(&blowfish_desc); @@ -239,6 +249,9 @@ static void _unregister_all(void) #ifdef LTC_SOBER128 unregister_prng(&sober128_desc); #endif +#ifdef LTC_SPRNG + unregister_prng(&sprng_desc); +#endif } /* _cleanup() */ static void register_algs(void) From b38cf104f0d010fb46c0cc639c1465cc3106a3b6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 13:30:28 +0200 Subject: [PATCH 0831/1192] move prng-tests away from cipher_hash_test() --- tests/cipher_hash_test.c | 29 ----------------------------- tests/prng_test.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/tests/cipher_hash_test.c b/tests/cipher_hash_test.c index abb2648fa..20cd0d16b 100644 --- a/tests/cipher_hash_test.c +++ b/tests/cipher_hash_test.c @@ -5,9 +5,6 @@ int cipher_hash_test(void) { int x; - unsigned char buf[4096]; - unsigned long n, one; - prng_state nprng; /* test ciphers */ for (x = 0; cipher_descriptor[x].name != NULL; x++) { @@ -33,32 +30,6 @@ int cipher_hash_test(void) /* SHAKE128 + SHAKE256 tests are a bit special */ DOX(sha3_shake_test(), "sha3_shake"); - /* test prngs (test, import/export */ - for (x = 0; prng_descriptor[x].name != NULL; x++) { - DOX(prng_descriptor[x].test(), prng_descriptor[x].name); - DOX(prng_descriptor[x].start(&nprng), prng_descriptor[x].name); - DOX(prng_descriptor[x].add_entropy((unsigned char *)"helloworld12", 12, &nprng), prng_descriptor[x].name); - DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); - n = sizeof(buf); - if (strcmp(prng_descriptor[x].name, "sprng")) { - one = 1; - if (prng_descriptor[x].pexport(buf, &one, &nprng) != CRYPT_BUFFER_OVERFLOW) { - fprintf(stderr, "Error testing pexport with a short buffer (%s)\n", prng_descriptor[x].name); - return CRYPT_ERROR; - } - } - DOX(prng_descriptor[x].pexport(buf, &n, &nprng), prng_descriptor[x].name); - prng_descriptor[x].done(&nprng); - DOX(prng_descriptor[x].pimport(buf, n, &nprng), prng_descriptor[x].name); - DOX(prng_descriptor[x].pimport(buf, 4096, &nprng), prng_descriptor[x].name); /* try to import larger data */ - DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); - if (prng_descriptor[x].read(buf, 100, &nprng) != 100) { - fprintf(stderr, "Error reading from imported PRNG (%s)!\n", prng_descriptor[x].name); - return CRYPT_ERROR; - } - prng_descriptor[x].done(&nprng); - } - return 0; } diff --git a/tests/prng_test.c b/tests/prng_test.c index 15d953d42..a05fe81dc 100644 --- a/tests/prng_test.c +++ b/tests/prng_test.c @@ -20,7 +20,12 @@ static unsigned long my_test_rng(unsigned char *buf, unsigned long len, int prng_test(void) { - int err = CRYPT_NOP; + int err = CRYPT_NOP; + int x; + unsigned char buf[4096]; + unsigned long n, one; + prng_state nprng; + #ifdef LTC_PRNG_ENABLE_LTC_RNG unsigned long before; @@ -41,5 +46,33 @@ int prng_test(void) ltc_rng = previous; #endif + + /* test prngs (test, import/export) */ + for (x = 0; prng_descriptor[x].name != NULL; x++) { + if(strcmp(prng_descriptor[x].name, "no_prng") == 0) continue; + err = CRYPT_OK; + DOX(prng_descriptor[x].test(), prng_descriptor[x].name); + DOX(prng_descriptor[x].start(&nprng), prng_descriptor[x].name); + DOX(prng_descriptor[x].add_entropy((unsigned char *)"helloworld12", 12, &nprng), prng_descriptor[x].name); + DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); + n = sizeof(buf); + if (strcmp(prng_descriptor[x].name, "sprng")) { + one = 1; + if (prng_descriptor[x].pexport(buf, &one, &nprng) != CRYPT_BUFFER_OVERFLOW) { + fprintf(stderr, "Error testing pexport with a short buffer (%s)\n", prng_descriptor[x].name); + return CRYPT_ERROR; + } + } + DOX(prng_descriptor[x].pexport(buf, &n, &nprng), prng_descriptor[x].name); + prng_descriptor[x].done(&nprng); + DOX(prng_descriptor[x].pimport(buf, n, &nprng), prng_descriptor[x].name); + DOX(prng_descriptor[x].pimport(buf, 4096, &nprng), prng_descriptor[x].name); /* try to import larger data */ + DOX(prng_descriptor[x].ready(&nprng), prng_descriptor[x].name); + if (prng_descriptor[x].read(buf, 100, &nprng) != 100) { + fprintf(stderr, "Error reading from imported PRNG (%s)!\n", prng_descriptor[x].name); + return CRYPT_ERROR; + } + prng_descriptor[x].done(&nprng); + } return err; } From a06cba4cb557ad87f389a1b2a526f82ea5e2ae9d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 13:34:26 +0200 Subject: [PATCH 0832/1192] fix tests when compiled for pthread --- tests/test.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/tests/test.c b/tests/test.c index 76aab188e..c0c45633d 100644 --- a/tests/test.c +++ b/tests/test.c @@ -32,6 +32,10 @@ static const test_function test_functions[] = LTC_TEST_FN(katja_test), LTC_TEST_FN(file_test), LTC_TEST_FN(multi_test), + /* keep the prng_test always at the end as + * it has to be handled specially when + * testing with LTC_PTHREAD enabled + */ LTC_TEST_FN(prng_test), }; @@ -72,7 +76,7 @@ typedef struct pthread_t thread_id; const test_function* t; int err; - ulong64 ts; + ulong64 delta; } thread_info; static void *run(void *arg) @@ -82,7 +86,7 @@ static void *run(void *arg) ts = epoch_usec(); tinfo->err = tinfo->t->fn(); - tinfo->ts = epoch_usec() - ts; + tinfo->delta = epoch_usec() - ts; return arg; } @@ -322,6 +326,7 @@ int main(int argc, char **argv) if (fn_len < len) fn_len = len; #ifdef LTC_PTHREAD + if(test_functions[i].fn == prng_test) continue; tinfo[i].t = &test_functions[i]; x = pthread_create(&tinfo[i].thread_id, NULL, run, &tinfo[i]); if (x != 0) { @@ -348,20 +353,26 @@ int main(int argc, char **argv) fflush(stdout); #ifdef LTC_PTHREAD - x = pthread_join(tinfo[i].thread_id, (void**)&res); - if (x != 0){ - printf("\n\nFAILURE: pthread_join\n"); - return EXIT_FAILURE; + if(test_functions[i].fn != prng_test) { + x = pthread_join(tinfo[i].thread_id, (void**)&res); + if (x != 0){ + printf("\n\nFAILURE: pthread_join\n"); + return EXIT_FAILURE; + } + x = res->err; + delta = res->delta; + } + else { + ts = epoch_usec(); + x = test_functions[i].fn(); + delta = (long)(epoch_usec() - ts); } - ts = res->ts; - x = res->err; #else ts = epoch_usec(); x = test_functions[i].fn(); delta = (long)(epoch_usec() - ts); - dur += delta; #endif - real += dur; + real += delta; if (x == CRYPT_OK) { printf("passed %10.3fms", (double)(delta)/1000); From 42a82ce3edccab0efc34562feabe549ed1577646 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 14:43:03 +0200 Subject: [PATCH 0833/1192] fix valgrind errors Uninitialized key caused the following error: Conditional jump or move depends on uninitialised value(s) at ...: __memcmp_sse4_1 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ... --- tests/multi_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/multi_test.c b/tests/multi_test.c index dc899c0a9..519b78f45 100644 --- a/tests/multi_test.c +++ b/tests/multi_test.c @@ -3,7 +3,8 @@ int multi_test(void) { - unsigned char key[32], buf[2][MAXBLOCKSIZE]; + unsigned char key[32] = { 0 }; + unsigned char buf[2][MAXBLOCKSIZE]; unsigned long len, len2; /* register algos */ From 3b4e5df858ff413ca361f7c184dbffb9ca500acc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 15:04:46 +0200 Subject: [PATCH 0834/1192] create separate no_prng instances now they shouldn't collide anymore and can always be unregistered --- tests/no_prng.c | 69 ++++++++++++++++++++++++++++------------ tests/pkcs_1_eme_test.c | 12 +++---- tests/pkcs_1_oaep_test.c | 12 +++---- tests/pkcs_1_pss_test.c | 12 +++---- tests/prng_test.c | 2 +- tests/tomcrypt_test.h | 3 +- 6 files changed, 70 insertions(+), 40 deletions(-) diff --git a/tests/no_prng.c b/tests/no_prng.c index 69c025991..bbb7aa476 100644 --- a/tests/no_prng.c +++ b/tests/no_prng.c @@ -17,9 +17,14 @@ #ifdef LTC_PKCS_1 -static unsigned char no_prng_entropy[1024]; -static unsigned long no_prng_len = 0; -static unsigned long no_prng_offset = 0; +typedef struct +{ + struct ltc_prng_descriptor desc; + char name[64]; + unsigned char entropy[1024]; + unsigned long len; + unsigned long offset; +} no_prng_desc_t; /** Start the PRNG @@ -28,11 +33,13 @@ static unsigned long no_prng_offset = 0; */ int no_prng_start(prng_state *prng) { - LTC_UNUSED_PARAM(prng); - no_prng_len = 0; - no_prng_offset = 0; + no_prng_desc_t *no_prng = (no_prng_desc_t*) prng; + LTC_ARGCHK(no_prng != NULL); + LTC_ARGCHK(no_prng->name == (char*)no_prng + offsetof(no_prng_desc_t, name)); + no_prng->len = 0; + no_prng->offset = 0; - return CRYPT_OK; + return CRYPT_OK; } /** @@ -44,15 +51,17 @@ int no_prng_start(prng_state *prng) */ int no_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng) { - LTC_UNUSED_PARAM(prng); - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(inlen <= sizeof(no_prng_entropy)); + no_prng_desc_t *no_prng = (no_prng_desc_t*) prng; + LTC_ARGCHK(no_prng != NULL); + LTC_ARGCHK(no_prng->name == (char*)no_prng + offsetof(no_prng_desc_t, name)); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen <= sizeof(no_prng->entropy)); - no_prng_len = MIN(inlen, sizeof(no_prng_entropy)); - memcpy(no_prng_entropy, in, no_prng_len); - no_prng_offset = 0; + no_prng->len = MIN(inlen, sizeof(no_prng->entropy)); + memcpy(no_prng->entropy, in, no_prng->len); + no_prng->offset = 0; - return CRYPT_OK; + return CRYPT_OK; } @@ -77,12 +86,14 @@ int no_prng_ready(prng_state *prng) */ unsigned long no_prng_read(unsigned char *out, unsigned long outlen, prng_state *prng) { - LTC_UNUSED_PARAM(prng); + no_prng_desc_t *no_prng = (no_prng_desc_t*) prng; + LTC_ARGCHK(no_prng != NULL); + LTC_ARGCHK(no_prng->name == (char*)no_prng + offsetof(no_prng_desc_t, name)); LTC_ARGCHK(out != NULL); - outlen = MIN(outlen, no_prng_len - no_prng_offset); - memcpy(out, &no_prng_entropy[no_prng_offset], outlen); - no_prng_offset += outlen; + outlen = MIN(outlen, no_prng->len - no_prng->offset); + memcpy(out, &no_prng->entropy[no_prng->offset], outlen); + no_prng->offset += outlen; return outlen; } @@ -137,9 +148,9 @@ int no_prng_test(void) return CRYPT_OK; } -const struct ltc_prng_descriptor no_prng_desc = +static const struct ltc_prng_descriptor no_prng_desc = { - "no_prng", 0, + NULL, 0, &no_prng_start, &no_prng_add_entropy, &no_prng_ready, @@ -150,6 +161,24 @@ const struct ltc_prng_descriptor no_prng_desc = &no_prng_test }; +struct ltc_prng_descriptor* no_prng_desc_get(void) +{ + no_prng_desc_t* no_prng = XMALLOC(sizeof(*no_prng)); + LTC_ARGCHK(no_prng != NULL); + XMEMCPY(&no_prng->desc, &no_prng_desc, sizeof(no_prng_desc)); + LTC_ARGCHK(snprintf(no_prng->name, sizeof(no_prng->name), "no_prng@%p", no_prng) < (int)sizeof(no_prng->name)); + no_prng->desc.name = no_prng->name; + return &no_prng->desc; +} + +void no_prng_desc_free(struct ltc_prng_descriptor* prng) +{ + no_prng_desc_t *no_prng = (no_prng_desc_t*) prng; + LTC_ARGCHK(no_prng != NULL); + LTC_ARGCHK(no_prng->name == (char*)no_prng + offsetof(no_prng_desc_t, name)); + XFREE(no_prng); +} + #endif diff --git a/tests/pkcs_1_eme_test.c b/tests/pkcs_1_eme_test.c index 425c88387..7ff926cb3 100644 --- a/tests/pkcs_1_eme_test.c +++ b/tests/pkcs_1_eme_test.c @@ -8,7 +8,8 @@ int pkcs_1_eme_test(void) { - int prng_idx = register_prng(&no_prng_desc); + struct ltc_prng_descriptor* no_prng_desc = no_prng_desc_get(); + int prng_idx = register_prng(no_prng_desc); int hash_idx = find_hash("sha1"); unsigned int i; unsigned int j; @@ -37,8 +38,8 @@ int pkcs_1_eme_test(void) unsigned char buf[256], obuf[256]; unsigned long buflen = sizeof(buf), obuflen = sizeof(obuf); int stat; - prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, NULL); - DOX(rsa_encrypt_key_ex(s->o1, s->o1_l, obuf, &obuflen, NULL, 0, NULL, prng_idx, -1, LTC_PKCS_1_V1_5, key), s->name); + prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, (prng_state*)no_prng_desc); + DOX(rsa_encrypt_key_ex(s->o1, s->o1_l, obuf, &obuflen, NULL, 0, (prng_state*)no_prng_desc, prng_idx, -1, LTC_PKCS_1_V1_5, key), s->name); DOX(obuflen == (unsigned long)s->o3_l?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); DOX(memcmp(s->o3, obuf, s->o3_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); DOX(rsa_decrypt_key_ex(obuf, obuflen, buf, &buflen, NULL, 0, -1, LTC_PKCS_1_V1_5, &stat, key), s->name); @@ -48,9 +49,8 @@ int pkcs_1_eme_test(void) mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); } /* for */ -#ifndef LTC_PTHREAD - unregister_prng(&no_prng_desc); -#endif + unregister_prng(no_prng_desc); + no_prng_desc_free(no_prng_desc); return 0; } diff --git a/tests/pkcs_1_oaep_test.c b/tests/pkcs_1_oaep_test.c index 8be42d33a..ea22d3ba3 100644 --- a/tests/pkcs_1_oaep_test.c +++ b/tests/pkcs_1_oaep_test.c @@ -8,7 +8,8 @@ int pkcs_1_oaep_test(void) { - int prng_idx = register_prng(&no_prng_desc); + struct ltc_prng_descriptor* no_prng_desc = no_prng_desc_get(); + int prng_idx = register_prng(no_prng_desc); int hash_idx = find_hash("sha1"); unsigned int i; unsigned int j; @@ -37,8 +38,8 @@ int pkcs_1_oaep_test(void) unsigned char buf[256], obuf[256]; unsigned long buflen = sizeof(buf), obuflen = sizeof(obuf); int stat; - prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, NULL); - DOX(rsa_encrypt_key(s->o1, s->o1_l, obuf, &obuflen, NULL, 0, NULL, prng_idx, hash_idx, key), s->name); + prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, (prng_state*)no_prng_desc); + DOX(rsa_encrypt_key(s->o1, s->o1_l, obuf, &obuflen, NULL, 0, (prng_state*)no_prng_desc, prng_idx, hash_idx, key), s->name); DOX(obuflen == (unsigned long)s->o3_l?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); DOX(memcmp(s->o3, obuf, s->o3_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); DOX(rsa_decrypt_key(obuf, obuflen, buf, &buflen, NULL, 0, hash_idx, &stat, key), s->name); @@ -48,9 +49,8 @@ int pkcs_1_oaep_test(void) mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); } /* for */ -#ifndef LTC_PTHREAD - unregister_prng(&no_prng_desc); -#endif + unregister_prng(no_prng_desc); + no_prng_desc_free(no_prng_desc); return 0; } diff --git a/tests/pkcs_1_pss_test.c b/tests/pkcs_1_pss_test.c index c7b352b4a..37fa07734 100644 --- a/tests/pkcs_1_pss_test.c +++ b/tests/pkcs_1_pss_test.c @@ -8,7 +8,8 @@ int pkcs_1_pss_test(void) { - int prng_idx = register_prng(&no_prng_desc); + struct ltc_prng_descriptor* no_prng_desc = no_prng_desc_get(); + int prng_idx = register_prng(no_prng_desc); int hash_idx = find_hash("sha1"); unsigned int i; unsigned int j; @@ -37,9 +38,9 @@ int pkcs_1_pss_test(void) unsigned char buf[20], obuf[256]; unsigned long buflen = sizeof(buf), obuflen = sizeof(obuf); int stat; - prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, NULL); + prng_descriptor[prng_idx].add_entropy(s->o2, s->o2_l, (prng_state*)no_prng_desc); DOX(hash_memory(hash_idx, s->o1, s->o1_l, buf, &buflen), s->name); - DOX(rsa_sign_hash(buf, buflen, obuf, &obuflen, NULL, prng_idx, hash_idx, s->o2_l, key), s->name); + DOX(rsa_sign_hash(buf, buflen, obuf, &obuflen, (prng_state*)no_prng_desc, prng_idx, hash_idx, s->o2_l, key), s->name); DOX(obuflen == (unsigned long)s->o3_l?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); DOX(memcmp(s->o3, obuf, s->o3_l)==0?CRYPT_OK:CRYPT_FAIL_TESTVECTOR, s->name); DOX(rsa_verify_hash(obuf, obuflen, buf, buflen, hash_idx, s->o2_l, &stat, key), s->name); @@ -49,9 +50,8 @@ int pkcs_1_pss_test(void) mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); } /* for */ -#ifndef LTC_PTHREAD - unregister_prng(&no_prng_desc); -#endif + unregister_prng(no_prng_desc); + no_prng_desc_free(no_prng_desc); return 0; } diff --git a/tests/prng_test.c b/tests/prng_test.c index a05fe81dc..02b229ecf 100644 --- a/tests/prng_test.c +++ b/tests/prng_test.c @@ -49,7 +49,7 @@ int prng_test(void) /* test prngs (test, import/export) */ for (x = 0; prng_descriptor[x].name != NULL; x++) { - if(strcmp(prng_descriptor[x].name, "no_prng") == 0) continue; + if(strstr(prng_descriptor[x].name, "no_prng") == prng_descriptor[x].name) continue; err = CRYPT_OK; DOX(prng_descriptor[x].test(), prng_descriptor[x].name); DOX(prng_descriptor[x].start(&nprng), prng_descriptor[x].name); diff --git a/tests/tomcrypt_test.h b/tests/tomcrypt_test.h index 77f33b359..e6ec13491 100644 --- a/tests/tomcrypt_test.h +++ b/tests/tomcrypt_test.h @@ -54,7 +54,8 @@ int multi_test(void); int prng_test(void); #ifdef LTC_PKCS_1 -extern const struct ltc_prng_descriptor no_prng_desc; +struct ltc_prng_descriptor* no_prng_desc_get(void); +void no_prng_desc_free(struct ltc_prng_descriptor*); #endif #endif From 48e4ec07be9ba6d30e655e5da970490bb76d5c59 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 15:48:02 +0200 Subject: [PATCH 0835/1192] use `LTC_ARGCHK()` for all mutex operations --- src/headers/tomcrypt_custom.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 155b6638d..ce7201599 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -549,9 +549,9 @@ #define LTC_MUTEX_GLOBAL(x) pthread_mutex_t x = PTHREAD_MUTEX_INITIALIZER; #define LTC_MUTEX_PROTO(x) extern pthread_mutex_t x; #define LTC_MUTEX_TYPE(x) pthread_mutex_t x; -#define LTC_MUTEX_INIT(x) pthread_mutex_init(x, NULL); -#define LTC_MUTEX_LOCK(x) pthread_mutex_lock(x); -#define LTC_MUTEX_UNLOCK(x) pthread_mutex_unlock(x); +#define LTC_MUTEX_INIT(x) LTC_ARGCHK(pthread_mutex_init(x, NULL) == 0); +#define LTC_MUTEX_LOCK(x) LTC_ARGCHK(pthread_mutex_lock(x) == 0); +#define LTC_MUTEX_UNLOCK(x) LTC_ARGCHK(pthread_mutex_unlock(x) == 0); #else From 73934ad2fd05831046e48163f8d30c21c475bb9e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 15:49:03 +0200 Subject: [PATCH 0836/1192] add ld option `-pthread` when LTC_PTHREAD is enabled --- makefile_include.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index 0dd17da75..68b926404 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -42,8 +42,9 @@ endif endif endif - +# # Compilation flags. Note the += does not write over the user's CFLAGS! +# CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE ifdef OLD_GCC @@ -99,6 +100,10 @@ CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" endif +ifneq ($(findstring -DLTC_PTHREAD,$(CFLAGS)),) +LDFLAGS += -pthread +endif + #List of demo objects DSOURCES = $(wildcard demos/*.c) DOBJECTS = $(DSOURCES:.c=.o) From 5de7e58e84b7f5dbbaba2a59dccd6513f605f97d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 17:04:16 +0200 Subject: [PATCH 0837/1192] disable yet another clang warning --- makefile_include.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index 68b926404..c7bb70756 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -90,7 +90,7 @@ endif # COMPILE_DEBUG ifneq ($(findstring clang,$(CC)),) -CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare +CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header endif From fec05471aea0afed6ecf5ee1c8e10a64fe767260 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 22 Mar 2017 18:59:56 +0100 Subject: [PATCH 0838/1192] the latest tfm version has fp_rand() available, so we can test this now --- .travis.yml | 7 ++++--- src/headers/tomcrypt_custom.h | 5 ----- src/math/tfm_desc.c | 9 ++++++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 86fade7be..518ff1dca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ addons: packages: - binutils - libtommath-dev + - libtfm-dev before_script: - gem install coveralls-lcov @@ -22,9 +23,9 @@ branches: compiler: - gcc - clang - -script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" - +script: + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared" "-DUSE_TFM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtfm.so" env: - | BUILDSCRIPT="check_source.sh" diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index ce7201599..1c9ebe078 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -492,11 +492,6 @@ #define LTC_PKCS_1 #endif -#if defined(TFM_DESC) && defined(LTC_RSA_BLINDING) - #warning RSA blinding currently not supported in combination with TFM - #undef LTC_RSA_BLINDING -#endif - #if defined(LTC_PELICAN) && !defined(LTC_RIJNDAEL) #error Pelican-MAC requires LTC_RIJNDAEL #endif diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index df4c63cdf..d8e09af43 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -699,6 +699,13 @@ static int tfm_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R #endif +static int set_rand(void *a, int size) +{ + LTC_ARGCHK(a != NULL); + fp_rand(a, size); + return CRYPT_OK; +} + const ltc_math_descriptor tfm_desc = { "TomsFastMath", @@ -788,7 +795,7 @@ const ltc_math_descriptor tfm_desc = { &addmod, &submod, - NULL, + set_rand, }; From e2af986085aa3bb416a31d84572519f869925cfd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 10 May 2017 19:23:31 +0200 Subject: [PATCH 0839/1192] make output verbose again --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 518ff1dca..94b5ac249 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,8 @@ compiler: - gcc - clang script: - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared" "-DUSE_TFM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtfm.so" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtfm.so" env: - | BUILDSCRIPT="check_source.sh" From 104a451def1e64159cd7412f90bde59f4a6a5235 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 15:34:36 +0200 Subject: [PATCH 0840/1192] use packagecloud repo to install tfm --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 94b5ac249..b7a253676 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,13 @@ addons: packages: - binutils - libtommath-dev - - libtfm-dev before_script: - gem install coveralls-lcov - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz - export PATH=$PATH:`pwd`/lcov-1.11/bin + - curl -s https://packagecloud.io/install/repositories/libtom/tomsfastmath/script.deb.sh | sudo bash + - sudo apt-get install libtfm-dev=0.13-5 matrix: fast_finish: true From a9838f774578462de8e2c5dfe7f5dc90dfad72b7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 15:58:19 +0200 Subject: [PATCH 0841/1192] fix linking to tomsfastmath & clean-up --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7a253676..20bf726b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,8 @@ compiler: - gcc - clang script: - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtfm.so" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC" "/usr/lib/x86_64-linux-gnu/libtommath.a" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DTFM_DESC" "-ltfm" env: - | BUILDSCRIPT="check_source.sh" From f45f2f4faf803de6bb7ced5ceb402bd97d11ad36 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 17:40:14 +0200 Subject: [PATCH 0842/1192] only create coverage for ltm build --- coverage.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coverage.sh b/coverage.sh index 6686b443f..d582f92e3 100755 --- a/coverage.sh +++ b/coverage.sh @@ -17,6 +17,11 @@ if [ -z "$(echo $CC | grep "gcc")" ]; then exit 0 fi +if [ "$(echo $2 | grep -v 'makefile[.]')" == "" ]; then + echo "only run coverage for the regular makefile, early exit success" + exit 0 +fi + # output version bash printinfo.sh From f40bda7cb34dc85c42da1d17b2bff548c1a39ab9 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 9 Jun 2017 09:37:10 +0200 Subject: [PATCH 0843/1192] fix indentation --- src/misc/pkcs5/pkcs_5_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index c247fe8fd..1268154e5 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -201,7 +201,7 @@ int pkcs_5_test (void) } else if (compare_testvector(DK, dkLen, cases_5_1[i].DK, cases_5_1[i].dkLen, "PKCS#5_1", i)) { ++failed; - } + } } /* testing alg 1_openssl */ From ec51f880b5c62aba55d01e6992b6130660ef84d1 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 9 Jun 2017 09:50:24 +0200 Subject: [PATCH 0844/1192] Right hand side of assignment needs parenthesis --- src/misc/crypt/crypt_register_all_ciphers.c | 2 +- src/misc/crypt/crypt_register_all_hashes.c | 2 +- src/misc/crypt/crypt_register_all_prngs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/misc/crypt/crypt_register_all_ciphers.c b/src/misc/crypt/crypt_register_all_ciphers.c index 7d83acb24..80db5d222 100644 --- a/src/misc/crypt/crypt_register_all_ciphers.c +++ b/src/misc/crypt/crypt_register_all_ciphers.c @@ -16,7 +16,7 @@ */ #define REGISTER_CIPHER(h) do {\ - LTC_ARGCHK((err = register_cipher(h) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ + LTC_ARGCHK(((err = register_cipher(h)) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ } while(0) int register_all_ciphers(void) diff --git a/src/misc/crypt/crypt_register_all_hashes.c b/src/misc/crypt/crypt_register_all_hashes.c index 64ec0ccf2..4493d8f78 100644 --- a/src/misc/crypt/crypt_register_all_hashes.c +++ b/src/misc/crypt/crypt_register_all_hashes.c @@ -16,7 +16,7 @@ */ #define REGISTER_HASH(h) do {\ - LTC_ARGCHK((err = register_hash(h) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ + LTC_ARGCHK(((err = register_hash(h)) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ } while(0) int register_all_hashes(void) diff --git a/src/misc/crypt/crypt_register_all_prngs.c b/src/misc/crypt/crypt_register_all_prngs.c index ccd8a8c7d..3b9139da2 100644 --- a/src/misc/crypt/crypt_register_all_prngs.c +++ b/src/misc/crypt/crypt_register_all_prngs.c @@ -16,7 +16,7 @@ */ #define REGISTER_PRNG(h) do {\ - LTC_ARGCHK((err = register_prng(h) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ + LTC_ARGCHK(((err = register_prng(h)) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ } while(0) int register_all_prngs(void) From 0bc0d5524591d806b236e938a0c7411d539fcee4 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 9 Jun 2017 15:14:35 +0200 Subject: [PATCH 0845/1192] refactor REGISTER_* --- src/misc/crypt/crypt_register_all_ciphers.c | 2 +- src/misc/crypt/crypt_register_all_hashes.c | 2 +- src/misc/crypt/crypt_register_all_prngs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/misc/crypt/crypt_register_all_ciphers.c b/src/misc/crypt/crypt_register_all_ciphers.c index 80db5d222..c8ec528d4 100644 --- a/src/misc/crypt/crypt_register_all_ciphers.c +++ b/src/misc/crypt/crypt_register_all_ciphers.c @@ -16,7 +16,7 @@ */ #define REGISTER_CIPHER(h) do {\ - LTC_ARGCHK(((err = register_cipher(h)) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ + LTC_ARGCHK((err = register_cipher(h)) != -1); \ } while(0) int register_all_ciphers(void) diff --git a/src/misc/crypt/crypt_register_all_hashes.c b/src/misc/crypt/crypt_register_all_hashes.c index 4493d8f78..e95333282 100644 --- a/src/misc/crypt/crypt_register_all_hashes.c +++ b/src/misc/crypt/crypt_register_all_hashes.c @@ -16,7 +16,7 @@ */ #define REGISTER_HASH(h) do {\ - LTC_ARGCHK(((err = register_hash(h)) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ + LTC_ARGCHK((err = register_hash(h)) != -1); \ } while(0) int register_all_hashes(void) diff --git a/src/misc/crypt/crypt_register_all_prngs.c b/src/misc/crypt/crypt_register_all_prngs.c index 3b9139da2..08c698460 100644 --- a/src/misc/crypt/crypt_register_all_prngs.c +++ b/src/misc/crypt/crypt_register_all_prngs.c @@ -16,7 +16,7 @@ */ #define REGISTER_PRNG(h) do {\ - LTC_ARGCHK(((err = register_prng(h)) == -1 ? CRYPT_ERROR : CRYPT_OK) == CRYPT_OK); \ + LTC_ARGCHK((err = register_prng(h)) != -1); \ } while(0) int register_all_prngs(void) From 742b4cee78366204381d1c864d42ec744f543e0f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 22 May 2017 22:54:51 +0200 Subject: [PATCH 0846/1192] add clang scan-build --- .travis.yml | 4 ++++ scan_build.sh | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100755 scan_build.sh diff --git a/.travis.yml b/.travis.yml index 20bf726b1..80892b579 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,10 @@ env: BUILDSCRIPT="check_source.sh" BUILDNAME="CHECK_SOURCES" BUILDOPTIONS=" " + - | + BUILDSCRIPT="scan_build.sh" + BUILDNAME="SCAN_BUILD" + BUILDOPTIONS=" " - | BUILDSCRIPT="coverage.sh" BUILDNAME="COVERAGE" diff --git a/scan_build.sh b/scan_build.sh new file mode 100755 index 000000000..b1df43e0d --- /dev/null +++ b/scan_build.sh @@ -0,0 +1,9 @@ +#!/bin/bash +[ "$TRAVIS_CI" != "" ] && sudo apt-get install clang -y -qq || true + +# output version +bash printinfo.sh + +make clean > /dev/null + +scan-build make -f makefile.unix all From ff2de0b07a98709cb5774d4db378698a2b5357a8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 15:50:49 +0200 Subject: [PATCH 0847/1192] looks like precise doesn't have scan-build under that name ...but we should be able to find it somewhere in /usr/bin/ --- scan_build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scan_build.sh b/scan_build.sh index b1df43e0d..f05e8cc50 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -1,9 +1,12 @@ #!/bin/bash -[ "$TRAVIS_CI" != "" ] && sudo apt-get install clang -y -qq || true +[ "$TRAVIS_CI" != "" ] && { [ -z "$(which scan-build)" ] && { echo "installing clang"; sudo apt-get install clang -y -qq; }; } || true # output version bash printinfo.sh make clean > /dev/null -scan-build make -f makefile.unix all +scan_build=$(which scan-build) +[ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true +[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || true +$scan_build make -f makefile.unix all From 75e00e097c01c144e5f57b781d1ff428cb2f52a0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 16:14:48 +0200 Subject: [PATCH 0848/1192] well, then install a new clang version and see... --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 80892b579..e34ee5bd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,14 @@ addons: apt: sources: - debian-sid + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 packages: - binutils + - clang-3.7 + - cloud-utils - libtommath-dev + - util-linux before_script: - gem install coveralls-lcov From 3bb9193d6f5c3cf44e4e90c83cabcf3fea1bc65f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 16:28:37 +0200 Subject: [PATCH 0849/1192] alright, let's try if upgrading to trusty helps... --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e34ee5bd2..ec7e6c0d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,17 @@ +dist: trusty +sudo: required + language: c addons: apt: sources: - debian-sid - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.7 + - llvm-toolchain-trusty-4.0 packages: - binutils - - clang-3.7 - - cloud-utils + - clang-4.0 - libtommath-dev - - util-linux before_script: - gem install coveralls-lcov From ebfd164246000225f37ce94419314d01bc0f7d7e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 17:21:12 +0200 Subject: [PATCH 0850/1192] alright, let's also use ltm from packagecloud --- .travis.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec7e6c0d3..88e37d129 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,19 +6,16 @@ language: c addons: apt: sources: - - debian-sid - llvm-toolchain-trusty-4.0 packages: - - binutils - clang-4.0 - - libtommath-dev before_script: - gem install coveralls-lcov - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz - export PATH=$PATH:`pwd`/lcov-1.11/bin - - curl -s https://packagecloud.io/install/repositories/libtom/tomsfastmath/script.deb.sh | sudo bash - - sudo apt-get install libtfm-dev=0.13-5 + - curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash + - sudo apt-get install libtfm-dev=0.13-5 libtommath-dev=1.0-5 matrix: fast_finish: true From 9baba0a83aca7e430f2a7ccdd54dedf208b302ad Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 17:21:46 +0200 Subject: [PATCH 0851/1192] fix usage of makefile.unix --- scan_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scan_build.sh b/scan_build.sh index f05e8cc50..c7395ff46 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -9,4 +9,4 @@ make clean > /dev/null scan_build=$(which scan-build) [ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true [ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || true -$scan_build make -f makefile.unix all +$scan_build make -f makefile.unix all CFLAGS="" EXTRALIBS="" From 52672bc358d1d346743a033d45e205e6874ab660 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 17:48:08 +0200 Subject: [PATCH 0852/1192] m( --- coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coverage.sh b/coverage.sh index d582f92e3..48ef7f1a8 100755 --- a/coverage.sh +++ b/coverage.sh @@ -17,8 +17,8 @@ if [ -z "$(echo $CC | grep "gcc")" ]; then exit 0 fi -if [ "$(echo $2 | grep -v 'makefile[.]')" == "" ]; then - echo "only run coverage for the regular makefile, early exit success" +if [ "$(echo $3 | grep -v 'makefile[.]')" == "" ]; then + echo "only run $0 for the regular makefile, early exit success" exit 0 fi From 1ee2662ab52c2d03cc3b818713084959a110fb68 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 17:48:21 +0200 Subject: [PATCH 0853/1192] only run scan_build.sh once --- scan_build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scan_build.sh b/scan_build.sh index c7395ff46..05d4fde56 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -1,6 +1,11 @@ #!/bin/bash [ "$TRAVIS_CI" != "" ] && { [ -z "$(which scan-build)" ] && { echo "installing clang"; sudo apt-get install clang -y -qq; }; } || true +if [ "$#" = "5" -a "$(echo $3 | grep -v 'makefile[.]')" = "" ]; then + echo "only run $0 for the regular makefile, early exit success" + exit 0 +fi + # output version bash printinfo.sh @@ -9,4 +14,4 @@ make clean > /dev/null scan_build=$(which scan-build) [ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true [ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || true -$scan_build make -f makefile.unix all CFLAGS="" EXTRALIBS="" +CFLAGS="" EXTRALIBS="" $scan_build make -f makefile.unix all CFLAGS="" EXTRALIBS="" From ba94b536bec4bf267f9f88008324b514a792401a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 18:03:15 +0200 Subject: [PATCH 0854/1192] this is a horrible PR --- .travis.yml | 5 +++-- scan_build.sh | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88e37d129..89eadea2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,10 @@ language: c addons: apt: sources: - - llvm-toolchain-trusty-4.0 + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 packages: - - clang-4.0 + - clang-3.8 before_script: - gem install coveralls-lcov diff --git a/scan_build.sh b/scan_build.sh index 05d4fde56..571ec4da7 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -13,5 +13,7 @@ make clean > /dev/null scan_build=$(which scan-build) [ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true -[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || true -CFLAGS="" EXTRALIBS="" $scan_build make -f makefile.unix all CFLAGS="" EXTRALIBS="" +[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || echo "run $scan_build" +export CFLAGS="-DUSE_LTM -DLTM_DESC -I/usr/include" +export EXTRALIBS="-ltommath" +$scan_build make -f makefile.unix all CFLAGS="$CFLAGS" EXTRALIBS="$EXTRALIBS" From ea08fbb777f15a0e24938bdb299c4ff9f4f128d3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 18:13:00 +0200 Subject: [PATCH 0855/1192] use libtommath from debian sid --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 89eadea2b..8bd766161 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_script: - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz - export PATH=$PATH:`pwd`/lcov-1.11/bin - curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash - - sudo apt-get install libtfm-dev=0.13-5 libtommath-dev=1.0-5 + - sudo apt-get install libtfm-dev=0.13-5 libtommath-dev=1.0-4 matrix: fast_finish: true From ac41d07247f30d31acdc4927651870a7b7b471ba Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 18:21:06 +0200 Subject: [PATCH 0856/1192] try libtommath from ubuntu --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8bd766161..05638bd7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,12 +11,16 @@ addons: packages: - clang-3.8 +install: + - sudo apt-get update -qq + - sudo apt-get install libtommath-dev + before_script: - gem install coveralls-lcov - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz - export PATH=$PATH:`pwd`/lcov-1.11/bin - curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash - - sudo apt-get install libtfm-dev=0.13-5 libtommath-dev=1.0-4 + - sudo apt-get install libtfm-dev=0.13-5 matrix: fast_finish: true From 31ddf7c894a3fc5036ae52eec3e5a43108b39584 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 18:28:14 +0200 Subject: [PATCH 0857/1192] ... https://www.youtube.com/watch?v=6bbIBs0P2t0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 05638bd7d..77e525468 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ compiler: - gcc - clang script: - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC" "/usr/lib/x86_64-linux-gnu/libtommath.a" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC" "-ltommath" - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DTFM_DESC" "-ltfm" env: - | From 2cd69fb54109bc48b674d9edf1e326cd57821ab3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 14 Jun 2017 17:16:26 +0200 Subject: [PATCH 0858/1192] improved helper.pl (check mandatory comments - not included in "--check-all" yet) --- helper.pl | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/helper.pl b/helper.pl index 0a6eb517d..aba8d72b5 100755 --- a/helper.pl +++ b/helper.pl @@ -117,6 +117,40 @@ sub check_descriptors { return $fails; } +sub check_comments { + my $fails = 0; + my $first_comment = <<'MARKER'; +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +MARKER + my $last_comment = <<'MARKER'; +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ +MARKER + my @all_files; + find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'src'); + for my $f (@all_files) { + my $txt = read_file($f); + if ($txt !~ /^\Q$first_comment\E/s) { + warn "[first_comment] $f\n"; + $fails++; + } + if ($txt !~ /\Q$last_comment\E\s*$/s) { + warn "[last_comment] $f\n"; + $fails++; + } + } + warn( $fails > 0 ? "check-comments: FAIL $fails\n" : "check-comments: PASS\n" ); + return $fails; +} + sub prepare_variable { my ($varname, @list) = @_; my $output = "$varname="; @@ -299,18 +333,21 @@ sub process_makefiles { sub die_usage { die <<"MARKER"; - usage: $0 --check-source - $0 --check-defines - $0 --check-makefiles - $0 --check-all - $0 --update-makefiles - $0 --fixupind crypt.ind +usage: $0 -s OR $0 --check-source + $0 -c OR $0 --check-descriptors + $0 -d OR $0 --check-defines + $0 -o OR $0 --check-comments + $0 -m OR $0 --check-makefiles + $0 -a OR $0 --check-all + $0 -u OR $0 --update-makefiles + $0 --fixupind crypt.ind MARKER } GetOptions( "s|check-source" => \my $check_source, "c|check-descriptors" => \my $check_descriptors, "d|check-defines" => \my $check_defines, + "o|check-comments" => \my $check_comments, "m|check-makefiles" => \my $check_makefiles, "a|check-all" => \my $check_all, "u|update-makefiles" => \my $update_makefiles, @@ -329,6 +366,7 @@ sub die_usage { $failure ||= check_source() if $check_all || $check_source; $failure ||= check_defines() if $check_all || $check_defines; $failure ||= check_descriptors() if $check_all || $check_descriptors; +$failure ||= check_comments() if $check_comments; #XXX-FIXME not included in "--check-all" $failure ||= process_makefiles(0) if $check_all || $check_makefiles; $failure ||= process_makefiles(1) if $update_makefiles; From 048cbc55b0e67a82023378ed736e5b65a6507a63 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 18:47:28 +0200 Subject: [PATCH 0859/1192] disable yet another warning --- makefile_include.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makefile_include.mk b/makefile_include.mk index c7bb70756..ca1cf29da 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -92,6 +92,9 @@ endif # COMPILE_DEBUG ifneq ($(findstring clang,$(CC)),) CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header endif +ifeq ($(PLATFORM), Darwin) +CFLAGS += -Wno-nullability-completeness +endif GIT_VERSION := $(shell [ -e .git ] && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION)) From 3995f971d73f596064ccc1a33d0a85f54eba6667 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 12:25:25 +0200 Subject: [PATCH 0860/1192] make sure to use makefile.shared on Mac --- makefile | 12 ++++++++---- makefile.shared | 2 ++ makefile_include.mk | 2 -- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 4620b86a8..92e1384da 100644 --- a/makefile +++ b/makefile @@ -13,14 +13,18 @@ silent=@ silent_stdout= > /dev/null endif +PLATFORM := $(shell uname | sed -e 's/_.*//') + +ifneq ($(MAKECMDGOALS),clean) +ifeq ($(PLATFORM), Darwin) +$(error Can't build static library on Mac, please use makefile.shared) +endif +endif + # ranlib tools ifndef RANLIB -ifeq ($(PLATFORM), Darwin) -RANLIB:=$(PREFIX)ranlib -c -else RANLIB:=$(PREFIX)ranlib endif -endif INSTALL_CMD = install #Output filenames for various targets. diff --git a/makefile.shared b/makefile.shared index e6be085d4..0e9e6bc0c 100644 --- a/makefile.shared +++ b/makefile.shared @@ -7,6 +7,8 @@ # # (GNU make only) +PLATFORM := $(shell uname | sed -e 's/_.*//') + ifndef LT ifeq ($(PLATFORM), Darwin) LT:=glibtool diff --git a/makefile_include.mk b/makefile_include.mk index ca1cf29da..78b70bc42 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -7,8 +7,6 @@ VERSION=1.17 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION_LT=0:117 -PLATFORM := $(shell uname | sed -e 's/_.*//') - # Compiler and Linker Names ifndef PREFIX PREFIX:= From a0e5c2e4ff2e790800550f9e1d148bee5028bd7f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 13 Jun 2017 14:57:07 +0200 Subject: [PATCH 0861/1192] add some makefile docs --- makefile.shared | 7 +++++++ makefile_include.mk | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/makefile.shared b/makefile.shared index 0e9e6bc0c..a36e86e08 100644 --- a/makefile.shared +++ b/makefile.shared @@ -7,6 +7,13 @@ # # (GNU make only) +### USAGE: +# +# CFLAGS="-DUSE_LTM -DLTM_DESC -I/path/to/libtommath" make -f makefile.shared all EXTRALIBS=/path/to/libtommath/libtommath.a +# ./test +# make -f makefile.shared DESTDIR=/opt/libtom install +# + PLATFORM := $(shell uname | sed -e 's/_.*//') ifndef LT diff --git a/makefile_include.mk b/makefile_include.mk index 78b70bc42..08086f509 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -43,6 +43,11 @@ endif # # Compilation flags. Note the += does not write over the user's CFLAGS! # +# Also note that we're extending the environments' CFLAGS. +# If you think that our CFLAGS are not nice you can easily override them +# by giving them as a parameter to make: +# make CFLAGS="-I./src/headers/ -DLTC_SOURCE ..." ... +# CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE ifdef OLD_GCC @@ -338,6 +343,8 @@ $(TOBJECTS): $(HEADERS) $(THEADERS) bins: $(USEFUL_DEMOS) +all: all_test + all_test: test $(UNBROKEN_DEMOS) #build the doxy files (requires Doxygen, tetex and patience) From 0cf7c4904519f66042dfbcdb92f24b762dd8701c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 12:02:10 +0200 Subject: [PATCH 0862/1192] sync ltc_math_descriptor from doc --- src/headers/tomcrypt_math.h | 83 +++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 27 deletions(-) diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index c605283e7..833deac72 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -65,13 +65,14 @@ typedef struct { /** set small constant @param a Number to write to @param n Source upto bits_per_digit (actually meant for very small constants) - @return CRYPT_OK on succcess + @return CRYPT_OK on success */ int (*set_int)(void *a, unsigned long n); /** get small constant - @param a Number to read, only fetches upto bits_per_digit from the number - @return The lower bits_per_digit of the integer (unsigned) + @param a Small number to read, + only fetches up to bits_per_digit from the number + @return The lower bits_per_digit of the integer (unsigned) */ unsigned long (*get_int)(void *a); @@ -91,14 +92,18 @@ typedef struct { /** compare two integers @param a The left side integer @param b The right side integer - @return LTC_MP_LT if a < b, LTC_MP_GT if a > b and LTC_MP_EQ otherwise. (signed comparison) + @return LTC_MP_LT if a < b, + LTC_MP_GT if a > b and + LTC_MP_EQ otherwise. (signed comparison) */ int (*compare)(void *a, void *b); /** compare against int @param a The left side integer @param b The right side integer (upto bits_per_digit) - @return LTC_MP_LT if a < b, LTC_MP_GT if a > b and LTC_MP_EQ otherwise. (signed comparison) + @return LTC_MP_LT if a < b, + LTC_MP_GT if a > b and + LTC_MP_EQ otherwise. (signed comparison) */ int (*compare_d)(void *a, unsigned long n); @@ -140,8 +145,8 @@ typedef struct { int (*write_radix)(void *a, char *str, int radix); /** get size as unsigned char string - @param a The integer to get the size (when stored in array of octets) - @return The length of the integer + @param a The integer to get the size (when stored in array of octets) + @return The length of the integer in octets */ unsigned long (*unsigned_size)(void *a); @@ -158,7 +163,9 @@ typedef struct { @param len The number of octets @return CRYPT_OK on success */ - int (*unsigned_read)(void *dst, unsigned char *src, unsigned long len); + int (*unsigned_read)( void *dst, + unsigned char *src, + unsigned long len); /* ---- basic math ---- */ @@ -170,10 +177,10 @@ typedef struct { */ int (*add)(void *a, void *b, void *c); - /** add two integers @param a The first source integer - @param b The second source integer (single digit of upto bits_per_digit in length) + @param b The second source integer + (single digit of upto bits_per_digit in length) @param c The destination of "a + b" @return CRYPT_OK on success */ @@ -189,7 +196,8 @@ typedef struct { /** subtract two integers @param a The first source integer - @param b The second source integer (single digit of upto bits_per_digit in length) + @param b The second source integer + (single digit of upto bits_per_digit in length) @param c The destination of "a - b" @return CRYPT_OK on success */ @@ -197,7 +205,8 @@ typedef struct { /** multiply two integers @param a The first source integer - @param b The second source integer (single digit of upto bits_per_digit in length) + @param b The second source integer + (single digit of upto bits_per_digit in length) @param c The destination of "a * b" @return CRYPT_OK on success */ @@ -205,7 +214,8 @@ typedef struct { /** multiply two integers @param a The first source integer - @param b The second source integer (single digit of upto bits_per_digit in length) + @param b The second source integer + (single digit of upto bits_per_digit in length) @param c The destination of "a * b" @return CRYPT_OK on success */ @@ -285,7 +295,7 @@ typedef struct { /* ---- reduction ---- */ - /** setup montgomery + /** setup Montgomery @param a The modulus @param b The destination for the reduction digit @return CRYPT_OK on success @@ -339,10 +349,15 @@ typedef struct { @param G The point to multiply @param R The destination for kG @param modulus The modulus for the field - @param map Boolean indicated whether to map back to affine or not (can be ignored if you work in affine only) + @param map Boolean indicated whether to map back to affine or not + (can be ignored if you work in affine only) @return CRYPT_OK on success */ - int (*ecc_ptmul)(void *k, ecc_point *G, ecc_point *R, void *modulus, int map); + int (*ecc_ptmul)( void *k, + ecc_point *G, + ecc_point *R, + void *modulus, + int map); /** ECC GF(p) point addition @param P The first point @@ -352,7 +367,11 @@ typedef struct { @param mp The "b" value from montgomery_setup() @return CRYPT_OK on success */ - int (*ecc_ptadd)(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp); + int (*ecc_ptadd)(ecc_point *P, + ecc_point *Q, + ecc_point *R, + void *modulus, + void *mp); /** ECC GF(p) point double @param P The first point @@ -361,15 +380,20 @@ typedef struct { @param mp The "b" value from montgomery_setup() @return CRYPT_OK on success */ - int (*ecc_ptdbl)(ecc_point *P, ecc_point *R, void *modulus, void *mp); + int (*ecc_ptdbl)(ecc_point *P, + ecc_point *R, + void *modulus, + void *mp); - /** ECC mapping from projective to affine, currently uses (x,y,z) => (x/z^2, y/z^3, 1) + /** ECC mapping from projective to affine, + currently uses (x,y,z) => (x/z^2, y/z^3, 1) @param P The point to map @param modulus The modulus @param mp The "b" value from montgomery_setup() @return CRYPT_OK on success - @remark The mapping can be different but keep in mind a ecc_point only has three - integers (x,y,z) so if you use a different mapping you have to make it fit. + @remark The mapping can be different but keep in mind a + ecc_point only has three integers (x,y,z) so if + you use a different mapping you have to make it fit. */ int (*ecc_map)(ecc_point *P, void *modulus, void *mp); @@ -378,7 +402,7 @@ typedef struct { @param kA What to multiple A by @param B Second point to multiply @param kB What to multiple B by - @param C [out] Destination point (can overlap with A or B + @param C [out] Destination point (can overlap with A or B) @param modulus Modulus for curve @return CRYPT_OK on success */ @@ -392,19 +416,24 @@ typedef struct { /** RSA Key Generation @param prng An active PRNG state @param wprng The index of the PRNG desired - @param size The size of the modulus (key size) desired (octets) - @param e The "e" value (public key). e==65537 is a good choice + @param size The size of the key in octets + @param e The "e" value (public key). + e==65537 is a good choice @param key [out] Destination of a newly created private key pair @return CRYPT_OK if successful, upon error all allocated ram is freed */ - int (*rsa_keygen)(prng_state *prng, int wprng, int size, long e, rsa_key *key); - + int (*rsa_keygen)(prng_state *prng, + int wprng, + int size, + long e, + rsa_key *key); /** RSA exponentiation @param in The octet array representing the base @param inlen The length of the input @param out The destination (to be stored in an octet array format) - @param outlen The length of the output buffer and the resulting size (zero padded to the size of the modulus) + @param outlen The length of the output buffer and the resulting size + (zero padded to the size of the modulus) @param which PK_PUBLIC for public RSA and PK_PRIVATE for private RSA @param key The RSA key to use @return CRYPT_OK on success From 98b500e8736bf7c7d6a8ae37f7f11bdb042cb07c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 12:29:16 +0200 Subject: [PATCH 0863/1192] update crypt_build_settings et al. --- src/headers/tomcrypt_custom.h | 4 ++++ src/misc/crypt/crypt.c | 29 +++++++++++++++++------------ src/misc/crypt/crypt_constants.c | 7 +++++++ 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 1c9ebe078..908175fad 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -536,6 +536,10 @@ #error LTC_BLAKE2BMAC requires LTC_BLAKE2B #endif +#if defined(LTC_NO_MATH) && (defined(LTM_DESC) || defined(TFM_DESC) || defined(GMP_DESC)) + #error LTC_NO_MATH defined, but also a math descriptor +#endif + /* THREAD management */ #ifdef LTC_PTHREAD diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index cfe260639..b88e47479 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -332,6 +332,23 @@ const char *crypt_build_settings = " Katja\n" #endif + "\nMPI (Math):\n" +#if defined(LTC_MPI) + " LTC_MPI\n" +#endif +#if defined(LTM_DESC) + " LTM_DESC\n" +#endif +#if defined(TFM_DESC) + " TFM_DESC\n" +#endif +#if defined(GMP_DESC) + " GMP_DESC\n" +#endif +#if defined(LTC_MILLER_RABIN_REPS) + " "NAME_VALUE(LTC_MILLER_RABIN_REPS)"\n" +#endif + "\nCompiler:\n" #if defined(_WIN64) " WIN64 platform detected.\n" @@ -390,9 +407,6 @@ const char *crypt_build_settings = #if defined(LTC_HKDF) " HKDF " #endif -#if defined(MPI) - " MPI " -#endif #if defined(LTC_DEVRANDOM) " LTC_DEVRANDOM " #endif @@ -456,15 +470,6 @@ const char *crypt_build_settings = #if defined(LTC_PTHREAD) " LTC_PTHREAD " #endif -#if defined(LTM_DESC) - " LTM_DESC " -#endif -#if defined(TFM_DESC) - " TFM_DESC " -#endif -#if defined(GMP_DESC) - " GMP_DESC " -#endif #if defined(LTC_EASY) " LTC_EASY " #endif diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index f3b968d88..55612f4cd 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -80,6 +80,13 @@ static const crypt_constant _crypt_constants[] = { {"LTC_MDSA", 0}, #endif +#ifdef LTC_DER_MAX_PUBKEY_SIZE + _C_STRINGIFY(LTC_DER_MAX_PUBKEY_SIZE), +#endif +#ifdef LTC_MILLER_RABIN_REPS + _C_STRINGIFY(LTC_MILLER_RABIN_REPS), +#endif + #ifdef LTC_CTR_MODE {"LTC_CTR_MODE", 1}, _C_STRINGIFY(CTR_COUNTER_LITTLE_ENDIAN), From d6e2a585d0fcc1df6a0fb8987b65312d1304040a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 12:41:55 +0200 Subject: [PATCH 0864/1192] sync doc from ltc_math_descriptor --- doc/crypt.tex | 55 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index d5461abcb..9bb8a568d 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -6789,6 +6789,13 @@ \subsection{Exporting and Importing} /* ---- data movement ---- */ + /** negate + @param src The number to negate + @param dst The destination + @return CRYPT_OK on success + */ + int (*neg)(void *src, void *dst); + /** copy @param src The number to copy from @param dst The number to write to @@ -6800,13 +6807,14 @@ \subsection{Exporting and Importing} /** set small constant @param a Number to write to - @param n Source upto bits_per_digit (meant for small constants) + @param n Source upto bits_per_digit (actually meant for very small constants) @return CRYPT_OK on success */ int (*set_int)(void *a, unsigned long n); /** get small constant - @param a Small number to read + @param a Small number to read, + only fetches up to bits_per_digit from the number @return The lower bits_per_digit of the integer (unsigned) */ unsigned long (*get_int)(void *a); @@ -6816,7 +6824,7 @@ \subsection{Exporting and Importing} @param n The number of the digit to fetch @return The bits_per_digit sized n'th digit of a */ - unsigned long (*get_digit)(void *a, int n); + ltc_mp_digit (*get_digit)(void *a, int n); /** Get the number of digits that represent the number @param a The number to count @@ -6880,7 +6888,7 @@ \subsection{Exporting and Importing} int (*write_radix)(void *a, char *str, int radix); /** get size as unsigned char string - @param a The integer to get the size + @param a The integer to get the size (when stored in array of octets) @return The length of the integer in octets */ unsigned long (*unsigned_size)(void *a); @@ -6915,7 +6923,7 @@ \subsection{Exporting and Importing} /** add two integers @param a The first source integer @param b The second source integer - (single digit of upto bits_per_digit in length) + (single digit of upto bits_per_digit in length) @param c The destination of "a + b" @return CRYPT_OK on success */ @@ -6970,7 +6978,7 @@ \subsection{Exporting and Importing} @param d The remainder (can be NULL to signify don't care) @return CRYPT_OK on success */ - int (*div)(void *a, void *b, void *c, void *d); + int (*mpdiv)(void *a, void *b, void *c, void *d); /** divide by two @param a The integer to divide (shift right) @@ -7071,10 +7079,11 @@ \subsection{Exporting and Importing} /** Primality testing @param a The integer to test - @param b The destination of the result (FP_YES if prime) + @param b The number of Miller-Rabin tests that shall be executed + @param c The destination of the result (FP_YES if prime) @return CRYPT_OK on success */ - int (*isprime)(void *a, int *b); + int (*isprime)(void *a, int b, int *c); /* ---- (optional) ecc point math ---- */ @@ -7145,7 +7154,6 @@ \subsection{Exporting and Importing} ecc_point *C, void *modulus); - /* ---- (optional) rsa optimized math (for internal CRT) ---- */ /** RSA Key Generation @@ -7176,6 +7184,35 @@ \subsection{Exporting and Importing} int (*rsa_me)(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, int which, rsa_key *key); + +/* ---- basic math continued ---- */ + + /** Modular addition + @param a The first source + @param b The second source + @param c The modulus + @param d The destination (a + b mod c) + @return CRYPT_OK on success + */ + int (*addmod)(void *a, void *b, void *c, void *d); + + /** Modular substraction + @param a The first source + @param b The second source + @param c The modulus + @param d The destination (a - b mod c) + @return CRYPT_OK on success + */ + int (*submod)(void *a, void *b, void *c, void *d); + +/* ---- misc stuff ---- */ + + /** Make a pseudo-random mpi + @param a The mpi to make random + @param size The desired length + @return CRYPT_OK on success + */ + int (*rand)(void *a, int size); } ltc_math_descriptor; \end{verbatim} \end{small} From 258de3ceccbdf2d31e0e8e7c0dd158d3450df253 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 13:07:12 +0200 Subject: [PATCH 0865/1192] use ltc_mp_digit instead of unsigned long --- src/headers/tomcrypt_math.h | 12 ++++++------ src/math/gmp_desc.c | 12 ++++++------ src/math/ltm_desc.c | 12 ++++++------ src/math/tfm_desc.c | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 833deac72..6c1ceda85 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -67,7 +67,7 @@ typedef struct { @param n Source upto bits_per_digit (actually meant for very small constants) @return CRYPT_OK on success */ - int (*set_int)(void *a, unsigned long n); + int (*set_int)(void *a, ltc_mp_digit n); /** get small constant @param a Small number to read, @@ -105,7 +105,7 @@ typedef struct { LTC_MP_GT if a > b and LTC_MP_EQ otherwise. (signed comparison) */ - int (*compare_d)(void *a, unsigned long n); + int (*compare_d)(void *a, ltc_mp_digit n); /** Count the number of bits used to represent the integer @param a The integer to count @@ -184,7 +184,7 @@ typedef struct { @param c The destination of "a + b" @return CRYPT_OK on success */ - int (*addi)(void *a, unsigned long b, void *c); + int (*addi)(void *a, ltc_mp_digit b, void *c); /** subtract two integers @param a The first source integer @@ -201,7 +201,7 @@ typedef struct { @param c The destination of "a - b" @return CRYPT_OK on success */ - int (*subi)(void *a, unsigned long b, void *c); + int (*subi)(void *a, ltc_mp_digit b, void *c); /** multiply two integers @param a The first source integer @@ -219,7 +219,7 @@ typedef struct { @param c The destination of "a * b" @return CRYPT_OK on success */ - int (*muli)(void *a, unsigned long b, void *c); + int (*muli)(void *a, ltc_mp_digit b, void *c); /** Square an integer @param a The integer to square @@ -250,7 +250,7 @@ typedef struct { @param c The destination for the residue @return CRYPT_OK on success */ - int (*modi)(void *a, unsigned long b, unsigned long *c); + int (*modi)(void *a, ltc_mp_digit b, ltc_mp_digit *c); /** gcd @param a The first integer diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 0a23e996b..817f08c37 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -61,7 +61,7 @@ static int init_copy(void **a, void *b) } /* ---- trivial ---- */ -static int set_int(void *a, unsigned long b) +static int set_int(void *a, ltc_mp_digit b) { LTC_ARGCHK(a != NULL); mpz_set_ui(((__mpz_struct *)a), b); @@ -101,7 +101,7 @@ static int compare(void *a, void *b) } } -static int compare_d(void *a, unsigned long b) +static int compare_d(void *a, ltc_mp_digit b) { int ret; LTC_ARGCHK(a != NULL); @@ -235,7 +235,7 @@ static int add(void *a, void *b, void *c) return CRYPT_OK; } -static int addi(void *a, unsigned long b, void *c) +static int addi(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -253,7 +253,7 @@ static int sub(void *a, void *b, void *c) return CRYPT_OK; } -static int subi(void *a, unsigned long b, void *c) +static int subi(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -271,7 +271,7 @@ static int mul(void *a, void *b, void *c) return CRYPT_OK; } -static int muli(void *a, unsigned long b, void *c) +static int muli(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -317,7 +317,7 @@ static int div_2(void *a, void *b) } /* modi */ -static int modi(void *a, unsigned long b, unsigned long *c) +static int modi(void *a, ltc_mp_digit b, ltc_mp_digit *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index 22937e83c..ca87d6d1d 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -88,7 +88,7 @@ static int init_copy(void **a, void *b) } /* ---- trivial ---- */ -static int set_int(void *a, unsigned long b) +static int set_int(void *a, ltc_mp_digit b) { LTC_ARGCHK(a != NULL); return mpi_to_ltc_error(mp_set_int(a, b)); @@ -130,7 +130,7 @@ static int compare(void *a, void *b) } } -static int compare_d(void *a, unsigned long b) +static int compare_d(void *a, ltc_mp_digit b) { int ret; LTC_ARGCHK(a != NULL); @@ -212,7 +212,7 @@ static int add(void *a, void *b, void *c) return mpi_to_ltc_error(mp_add(a, b, c)); } -static int addi(void *a, unsigned long b, void *c) +static int addi(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -228,7 +228,7 @@ static int sub(void *a, void *b, void *c) return mpi_to_ltc_error(mp_sub(a, b, c)); } -static int subi(void *a, unsigned long b, void *c) +static int subi(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -244,7 +244,7 @@ static int mul(void *a, void *b, void *c) return mpi_to_ltc_error(mp_mul(a, b, c)); } -static int muli(void *a, unsigned long b, void *c) +static int muli(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -275,7 +275,7 @@ static int div_2(void *a, void *b) } /* modi */ -static int modi(void *a, unsigned long b, unsigned long *c) +static int modi(void *a, ltc_mp_digit b, ltc_mp_digit *c) { mp_digit tmp; int err; diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index d8e09af43..66b4f3ece 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -84,7 +84,7 @@ static int init_copy(void **a, void *b) } /* ---- trivial ---- */ -static int set_int(void *a, unsigned long b) +static int set_int(void *a, ltc_mp_digit b) { LTC_ARGCHK(a != NULL); fp_set(a, b); @@ -129,7 +129,7 @@ static int compare(void *a, void *b) return 0; } -static int compare_d(void *a, unsigned long b) +static int compare_d(void *a, ltc_mp_digit b) { int ret; LTC_ARGCHK(a != NULL); @@ -214,7 +214,7 @@ static int add(void *a, void *b, void *c) return CRYPT_OK; } -static int addi(void *a, unsigned long b, void *c) +static int addi(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -232,7 +232,7 @@ static int sub(void *a, void *b, void *c) return CRYPT_OK; } -static int subi(void *a, unsigned long b, void *c) +static int subi(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -250,7 +250,7 @@ static int mul(void *a, void *b, void *c) return CRYPT_OK; } -static int muli(void *a, unsigned long b, void *c) +static int muli(void *a, ltc_mp_digit b, void *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); @@ -284,7 +284,7 @@ static int div_2(void *a, void *b) } /* modi */ -static int modi(void *a, unsigned long b, unsigned long *c) +static int modi(void *a, ltc_mp_digit b, ltc_mp_digit *c) { fp_digit tmp; int err; From f2076f070069c94c7297619df4b4c653d094ef97 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 13:08:37 +0200 Subject: [PATCH 0866/1192] use zeromem() where appropriate --- src/prngs/chacha20.c | 2 +- src/prngs/rc4.c | 1 + src/prngs/sober128.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/prngs/chacha20.c b/src/prngs/chacha20.c index faaf629ef..b528dd2f6 100644 --- a/src/prngs/chacha20.c +++ b/src/prngs/chacha20.c @@ -71,7 +71,7 @@ int chacha20_prng_add_entropy(const unsigned char *in, unsigned long inlen, prng /* iv 8 bytes */ if ((err = chacha_ivctr64(&prng->chacha.s, buf + 32, 8, 0)) != CRYPT_OK) goto LBL_UNLOCK; /* clear KEY + IV */ - XMEMSET(buf, 0, sizeof(buf)); + zeromem(buf, sizeof(buf)); } else { /* chacha20_prng_ready() was not called yet, add entropy to ent buffer */ diff --git a/src/prngs/rc4.c b/src/prngs/rc4.c index e7d3afcc7..ac88fd558 100644 --- a/src/prngs/rc4.c +++ b/src/prngs/rc4.c @@ -72,6 +72,7 @@ int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *pr if ((err = rc4_stream_setup(&prng->rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; /* drop first 3072 bytes - https://en.wikipedia.org/wiki/RC4#Fluhrer.2C_Mantin_and_Shamir_attack */ for (i = 0; i < 12; i++) rc4_stream_keystream(&prng->rc4.s, buf, sizeof(buf)); + zeromem(buf, sizeof(buf)); } else { /* rc4_ready() was not called yet, add entropy to the buffer */ diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index 56f873cf4..64d083bc1 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -73,7 +73,7 @@ int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_stat /* iv 8 bytes */ if ((err = sober128_stream_setiv(&prng->sober128.s, buf + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; /* clear KEY + IV */ - XMEMSET(buf, 0, sizeof(buf)); + zeromem(buf, sizeof(buf)); } else { /* sober128_ready() was not called yet, add entropy to ent buffer */ From 8dec4d9ac4c5cb8f7de4cbb97366f285c66ddb6d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 19 Jun 2017 12:28:22 +0200 Subject: [PATCH 0867/1192] prng_test - silence valgrind warning --- tests/prng_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/prng_test.c b/tests/prng_test.c index 02b229ecf..5e347514e 100644 --- a/tests/prng_test.c +++ b/tests/prng_test.c @@ -22,7 +22,7 @@ int prng_test(void) { int err = CRYPT_NOP; int x; - unsigned char buf[4096]; + unsigned char buf[4096] = { 0 }; unsigned long n, one; prng_state nprng; From 03437a1bdd6286f6ba20581fd2db889f0d0900c2 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 19 Jun 2017 18:51:04 +0200 Subject: [PATCH 0868/1192] timing - silence valgrind warning --- demos/timing.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/demos/timing.c b/demos/timing.c index fa5cdcd1c..f91f6f4c5 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -173,7 +173,7 @@ static void time_cipher_ecb(void) unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; symmetric_ECB ecb; - unsigned char key[MAXBLOCKSIZE], pt[4096]; + unsigned char key[MAXBLOCKSIZE] = { 0 }, pt[4096] = { 0 }; int err; fprintf(stderr, "\n\nECB Time Trials for the Symmetric Ciphers:\n"); @@ -246,7 +246,7 @@ static void time_cipher_cbc(void) unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; symmetric_CBC cbc; - unsigned char key[MAXBLOCKSIZE], pt[4096]; + unsigned char key[MAXBLOCKSIZE] = { 0 }, pt[4096] = { 0 }; int err; fprintf(stderr, "\n\nCBC Time Trials for the Symmetric Ciphers:\n"); @@ -319,7 +319,7 @@ static void time_cipher_ctr(void) unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; symmetric_CTR ctr; - unsigned char key[MAXBLOCKSIZE], pt[4096]; + unsigned char key[MAXBLOCKSIZE] = { 0 }, pt[4096] = { 0 }; int err; fprintf(stderr, "\n\nCTR Time Trials for the Symmetric Ciphers:\n"); @@ -392,7 +392,7 @@ static void time_cipher_lrw(void) unsigned long x, y1; ulong64 t1, t2, c1, c2, a1, a2; symmetric_LRW lrw; - unsigned char key[MAXBLOCKSIZE], pt[4096]; + unsigned char key[MAXBLOCKSIZE] = { 0 }, pt[4096] = { 0 }; int err; fprintf(stderr, "\n\nLRW Time Trials for the Symmetric Ciphers:\n"); @@ -468,7 +468,7 @@ static void time_hash(void) ulong64 t1, t2, c1, c2; hash_state md; int (*func)(hash_state *, const unsigned char *, unsigned long), err; - unsigned char pt[MAXBLOCKSIZE]; + unsigned char pt[MAXBLOCKSIZE] = { 0 }; fprintf(stderr, "\n\nHASH Time Trials for:\n"); @@ -688,7 +688,7 @@ static void time_rsa(void) { rsa_key key; ulong64 t1, t2; - unsigned char buf[2][2048]; + unsigned char buf[2][2048] = { 0 }; unsigned long x, y, z, zzz; int err, zz, stat; @@ -934,7 +934,7 @@ static void time_ecc(void) { ecc_key key; ulong64 t1, t2; - unsigned char buf[2][256]; + unsigned char buf[2][256] = { 0 }; unsigned long i, w, x, y, z; int err, stat; static unsigned long sizes[] = { From e5f25b65532d5a446fed205ab18dcbcf8e584b9e Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 19 Jun 2017 20:09:20 +0200 Subject: [PATCH 0869/1192] tests+timing - silence valgrind warning (memleak) --- demos/timing.c | 1 + tests/file_test.c | 4 +++- tests/rsa_test.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/demos/timing.c b/demos/timing.c index f91f6f4c5..0c06a6cf9 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -674,6 +674,7 @@ static const struct { } t2 >>= 2; fprintf(stderr, "DSA-(%lu, %lu) make_key took %15"PRI64"u cycles\n", (unsigned long)groups[x].group*8, (unsigned long)groups[x].modulus*8, t2); + dsa_free(&key); } fprintf(stderr, "\n\n"); } diff --git a/tests/file_test.c b/tests/file_test.c index c2e4a381f..8cb4eaf64 100644 --- a/tests/file_test.c +++ b/tests/file_test.c @@ -23,7 +23,9 @@ int file_test(void) len = sizeof(buf); if ((in = fopen(fname, "rb")) == NULL) return CRYPT_FILE_NOTFOUND; - if ((err = hash_filehandle(isha256, in, buf, &len)) != CRYPT_OK) return err; + err = hash_filehandle(isha256, in, buf, &len); + fclose(in); + if (err != CRYPT_OK) return err; if (compare_testvector(buf, len, exp_sha256, 32, "hash_filehandle", 1)) return 1; len = sizeof(buf); diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 5352be8aa..754127c32 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -193,6 +193,7 @@ static int rsa_compat_test(void) fprintf(stderr, "RSA rsa_verify_hash_ex + LTC_PKCS_1_V1_5_NA1 failed\n"); return 1; } + rsa_free(&pubkey); /* now try to export private/public and compare */ len = sizeof(buf); From 2fd5808897217aab4b693c2ea9762adf4799c2cf Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 20 Jun 2017 01:33:23 +0200 Subject: [PATCH 0870/1192] timing - silence valgrind warning (memleak) --- demos/timing.c | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/timing.c b/demos/timing.c index 0c06a6cf9..f4dcdd296 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -1374,6 +1374,7 @@ __attribute__ ((aligned (16))) } #endif + XFREE(buf); #else LTC_UNUSED_PARAM(MAC_SIZE); fprintf(stderr, "NO ENCMACs\n"); From 4dc211e19d3392242cf9eab8ed78d352e1b6a1ea Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 17 Jun 2017 13:12:06 +0200 Subject: [PATCH 0871/1192] clean-up headers --- src/ciphers/aes/aes.c | 2 -- src/ciphers/aes/aes_tab.c | 2 -- src/ciphers/anubis.c | 2 -- src/ciphers/blowfish.c | 2 -- src/ciphers/camellia.c | 2 -- src/ciphers/cast5.c | 2 -- src/ciphers/des.c | 2 -- src/ciphers/kasumi.c | 2 -- src/ciphers/khazad.c | 2 -- src/ciphers/kseed.c | 2 -- src/ciphers/multi2.c | 2 -- src/ciphers/noekeon.c | 2 -- src/ciphers/rc2.c | 2 -- src/ciphers/rc5.c | 2 -- src/ciphers/rc6.c | 2 -- src/ciphers/safer/safer.c | 2 -- src/ciphers/safer/safer_tab.c | 2 -- src/ciphers/safer/saferp.c | 2 -- src/ciphers/skipjack.c | 2 -- src/ciphers/twofish/twofish.c | 2 -- src/ciphers/twofish/twofish_tab.c | 2 -- src/ciphers/xtea.c | 2 -- src/encauth/ccm/ccm_add_aad.c | 2 -- src/encauth/ccm/ccm_add_nonce.c | 2 -- src/encauth/ccm/ccm_done.c | 2 -- src/encauth/ccm/ccm_init.c | 2 -- src/encauth/ccm/ccm_memory.c | 2 -- src/encauth/ccm/ccm_process.c | 2 -- src/encauth/ccm/ccm_reset.c | 2 -- src/encauth/ccm/ccm_test.c | 2 -- src/encauth/eax/eax_addheader.c | 2 -- src/encauth/eax/eax_decrypt.c | 2 -- src/encauth/eax/eax_decrypt_verify_memory.c | 2 -- src/encauth/eax/eax_done.c | 2 -- src/encauth/eax/eax_encrypt.c | 2 -- src/encauth/eax/eax_encrypt_authenticate_memory.c | 2 -- src/encauth/eax/eax_init.c | 2 -- src/encauth/eax/eax_test.c | 2 -- src/encauth/gcm/gcm_add_aad.c | 2 -- src/encauth/gcm/gcm_add_iv.c | 2 -- src/encauth/gcm/gcm_done.c | 2 -- src/encauth/gcm/gcm_gf_mult.c | 2 -- src/encauth/gcm/gcm_init.c | 2 -- src/encauth/gcm/gcm_memory.c | 2 -- src/encauth/gcm/gcm_mult_h.c | 2 -- src/encauth/gcm/gcm_process.c | 2 -- src/encauth/gcm/gcm_reset.c | 2 -- src/encauth/gcm/gcm_test.c | 2 -- src/encauth/ocb/ocb_decrypt.c | 2 -- src/encauth/ocb/ocb_decrypt_verify_memory.c | 2 -- src/encauth/ocb/ocb_done_decrypt.c | 2 -- src/encauth/ocb/ocb_done_encrypt.c | 2 -- src/encauth/ocb/ocb_encrypt.c | 2 -- src/encauth/ocb/ocb_encrypt_authenticate_memory.c | 2 -- src/encauth/ocb/ocb_init.c | 2 -- src/encauth/ocb/ocb_ntz.c | 2 -- src/encauth/ocb/ocb_shift_xor.c | 2 -- src/encauth/ocb/ocb_test.c | 2 -- src/encauth/ocb/s_ocb_done.c | 2 -- src/encauth/ocb3/ocb3_decrypt.c | 2 -- src/encauth/ocb3/ocb3_decrypt_verify_memory.c | 2 -- src/encauth/ocb3/ocb3_done.c | 2 -- src/encauth/ocb3/ocb3_encrypt.c | 2 -- src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c | 2 -- src/encauth/ocb3/ocb3_init.c | 2 -- src/encauth/ocb3/ocb3_int_ntz.c | 2 -- src/encauth/ocb3/ocb3_test.c | 2 -- src/hashes/chc/chc.c | 2 -- src/hashes/helper/hash_file.c | 2 -- src/hashes/helper/hash_filehandle.c | 2 -- src/hashes/helper/hash_memory.c | 2 -- src/hashes/helper/hash_memory_multi.c | 2 -- src/hashes/md2.c | 2 -- src/hashes/md4.c | 2 -- src/hashes/md5.c | 2 -- src/hashes/rmd128.c | 2 -- src/hashes/rmd160.c | 2 -- src/hashes/rmd256.c | 2 -- src/hashes/rmd320.c | 2 -- src/hashes/sha1.c | 2 -- src/hashes/sha2/sha224.c | 2 -- src/hashes/sha2/sha256.c | 2 -- src/hashes/sha2/sha384.c | 2 -- src/hashes/sha2/sha512.c | 2 -- src/hashes/sha2/sha512_224.c | 2 -- src/hashes/sha2/sha512_256.c | 2 -- src/hashes/tiger.c | 2 -- src/hashes/whirl/whirl.c | 2 -- src/mac/f9/f9_done.c | 2 -- src/mac/f9/f9_file.c | 2 -- src/mac/f9/f9_init.c | 2 -- src/mac/f9/f9_memory.c | 2 -- src/mac/f9/f9_memory_multi.c | 2 -- src/mac/f9/f9_process.c | 2 -- src/mac/f9/f9_test.c | 2 -- src/mac/hmac/hmac_done.c | 2 -- src/mac/hmac/hmac_file.c | 2 -- src/mac/hmac/hmac_init.c | 2 -- src/mac/hmac/hmac_memory.c | 2 -- src/mac/hmac/hmac_memory_multi.c | 2 -- src/mac/hmac/hmac_process.c | 2 -- src/mac/hmac/hmac_test.c | 2 -- src/mac/omac/omac_done.c | 2 -- src/mac/omac/omac_file.c | 2 -- src/mac/omac/omac_init.c | 2 -- src/mac/omac/omac_memory.c | 2 -- src/mac/omac/omac_memory_multi.c | 2 -- src/mac/omac/omac_process.c | 2 -- src/mac/omac/omac_test.c | 2 -- src/mac/pelican/pelican.c | 2 -- src/mac/pelican/pelican_memory.c | 2 -- src/mac/pelican/pelican_test.c | 2 -- src/mac/pmac/pmac_done.c | 2 -- src/mac/pmac/pmac_file.c | 2 -- src/mac/pmac/pmac_init.c | 2 -- src/mac/pmac/pmac_memory.c | 2 -- src/mac/pmac/pmac_memory_multi.c | 2 -- src/mac/pmac/pmac_ntz.c | 2 -- src/mac/pmac/pmac_process.c | 2 -- src/mac/pmac/pmac_shift_xor.c | 2 -- src/mac/pmac/pmac_test.c | 2 -- src/mac/xcbc/xcbc_done.c | 2 -- src/mac/xcbc/xcbc_file.c | 2 -- src/mac/xcbc/xcbc_init.c | 2 -- src/mac/xcbc/xcbc_memory.c | 2 -- src/mac/xcbc/xcbc_memory_multi.c | 2 -- src/mac/xcbc/xcbc_process.c | 2 -- src/mac/xcbc/xcbc_test.c | 2 -- src/math/fp/ltc_ecc_fp_mulmod.c | 2 -- src/math/gmp_desc.c | 2 -- src/math/ltm_desc.c | 2 -- src/math/multi.c | 2 -- src/math/rand_prime.c | 2 -- src/math/tfm_desc.c | 2 -- src/misc/adler32.c | 2 -- src/misc/base64/base64_decode.c | 2 -- src/misc/base64/base64_encode.c | 2 -- src/misc/burn_stack.c | 2 -- src/misc/crc32.c | 2 -- src/misc/crypt/crypt.c | 2 -- src/misc/crypt/crypt_argchk.c | 2 -- src/misc/crypt/crypt_cipher_descriptor.c | 2 -- src/misc/crypt/crypt_cipher_is_valid.c | 2 -- src/misc/crypt/crypt_constants.c | 2 -- src/misc/crypt/crypt_find_cipher.c | 2 -- src/misc/crypt/crypt_find_cipher_any.c | 2 -- src/misc/crypt/crypt_find_cipher_id.c | 2 -- src/misc/crypt/crypt_find_hash.c | 2 -- src/misc/crypt/crypt_find_hash_any.c | 2 -- src/misc/crypt/crypt_find_hash_id.c | 2 -- src/misc/crypt/crypt_find_hash_oid.c | 2 -- src/misc/crypt/crypt_find_prng.c | 2 -- src/misc/crypt/crypt_fsa.c | 2 -- src/misc/crypt/crypt_hash_descriptor.c | 2 -- src/misc/crypt/crypt_hash_is_valid.c | 2 -- src/misc/crypt/crypt_inits.c | 2 -- src/misc/crypt/crypt_ltc_mp_descriptor.c | 2 -- src/misc/crypt/crypt_prng_descriptor.c | 2 -- src/misc/crypt/crypt_prng_is_valid.c | 2 -- src/misc/crypt/crypt_prng_rng_descriptor.c | 2 -- src/misc/crypt/crypt_register_cipher.c | 2 -- src/misc/crypt/crypt_register_hash.c | 2 -- src/misc/crypt/crypt_register_prng.c | 2 -- src/misc/crypt/crypt_sizes.c | 2 -- src/misc/crypt/crypt_unregister_cipher.c | 2 -- src/misc/crypt/crypt_unregister_hash.c | 2 -- src/misc/crypt/crypt_unregister_prng.c | 2 -- src/misc/error_to_string.c | 2 -- src/misc/mem_neq.c | 2 -- src/misc/pkcs5/pkcs_5_1.c | 2 -- src/misc/pkcs5/pkcs_5_2.c | 2 -- src/misc/zeromem.c | 2 -- src/modes/cbc/cbc_decrypt.c | 2 -- src/modes/cbc/cbc_done.c | 2 -- src/modes/cbc/cbc_encrypt.c | 2 -- src/modes/cbc/cbc_getiv.c | 2 -- src/modes/cbc/cbc_setiv.c | 2 -- src/modes/cbc/cbc_start.c | 2 -- src/modes/cfb/cfb_decrypt.c | 2 -- src/modes/cfb/cfb_done.c | 2 -- src/modes/cfb/cfb_encrypt.c | 2 -- src/modes/cfb/cfb_getiv.c | 2 -- src/modes/cfb/cfb_setiv.c | 2 -- src/modes/cfb/cfb_start.c | 2 -- src/modes/ctr/ctr_decrypt.c | 2 -- src/modes/ctr/ctr_done.c | 2 -- src/modes/ctr/ctr_encrypt.c | 2 -- src/modes/ctr/ctr_getiv.c | 2 -- src/modes/ctr/ctr_setiv.c | 2 -- src/modes/ctr/ctr_start.c | 2 -- src/modes/ctr/ctr_test.c | 2 -- src/modes/ecb/ecb_decrypt.c | 2 -- src/modes/ecb/ecb_done.c | 2 -- src/modes/ecb/ecb_encrypt.c | 2 -- src/modes/ecb/ecb_start.c | 2 -- src/modes/f8/f8_decrypt.c | 2 -- src/modes/f8/f8_done.c | 2 -- src/modes/f8/f8_encrypt.c | 2 -- src/modes/f8/f8_getiv.c | 2 -- src/modes/f8/f8_setiv.c | 2 -- src/modes/f8/f8_start.c | 2 -- src/modes/f8/f8_test_mode.c | 2 -- src/modes/lrw/lrw_decrypt.c | 2 -- src/modes/lrw/lrw_done.c | 2 -- src/modes/lrw/lrw_encrypt.c | 2 -- src/modes/lrw/lrw_getiv.c | 2 -- src/modes/lrw/lrw_process.c | 2 -- src/modes/lrw/lrw_setiv.c | 2 -- src/modes/lrw/lrw_start.c | 2 -- src/modes/lrw/lrw_test.c | 2 -- src/modes/ofb/ofb_decrypt.c | 2 -- src/modes/ofb/ofb_done.c | 2 -- src/modes/ofb/ofb_encrypt.c | 2 -- src/modes/ofb/ofb_getiv.c | 2 -- src/modes/ofb/ofb_setiv.c | 2 -- src/modes/ofb/ofb_start.c | 2 -- src/modes/xts/xts_decrypt.c | 2 -- src/modes/xts/xts_done.c | 2 -- src/modes/xts/xts_encrypt.c | 2 -- src/modes/xts/xts_init.c | 2 -- src/modes/xts/xts_mult_x.c | 2 -- src/modes/xts/xts_test.c | 2 -- src/pk/asn1/der/bit/der_decode_bit_string.c | 2 -- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 2 -- src/pk/asn1/der/bit/der_encode_bit_string.c | 2 -- src/pk/asn1/der/bit/der_encode_raw_bit_string.c | 2 -- src/pk/asn1/der/bit/der_length_bit_string.c | 2 -- src/pk/asn1/der/boolean/der_decode_boolean.c | 2 -- src/pk/asn1/der/boolean/der_encode_boolean.c | 2 -- src/pk/asn1/der/boolean/der_length_boolean.c | 2 -- src/pk/asn1/der/choice/der_decode_choice.c | 2 -- src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c | 2 -- src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c | 2 -- src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c | 2 -- src/pk/asn1/der/ia5/der_decode_ia5_string.c | 2 -- src/pk/asn1/der/ia5/der_encode_ia5_string.c | 2 -- src/pk/asn1/der/ia5/der_length_ia5_string.c | 2 -- src/pk/asn1/der/integer/der_decode_integer.c | 2 -- src/pk/asn1/der/integer/der_encode_integer.c | 2 -- src/pk/asn1/der/integer/der_length_integer.c | 2 -- .../asn1/der/object_identifier/der_decode_object_identifier.c | 2 -- .../asn1/der/object_identifier/der_encode_object_identifier.c | 2 -- .../asn1/der/object_identifier/der_length_object_identifier.c | 2 -- src/pk/asn1/der/octet/der_decode_octet_string.c | 2 -- src/pk/asn1/der/octet/der_encode_octet_string.c | 2 -- src/pk/asn1/der/octet/der_length_octet_string.c | 2 -- src/pk/asn1/der/printable_string/der_decode_printable_string.c | 2 -- src/pk/asn1/der/printable_string/der_encode_printable_string.c | 2 -- src/pk/asn1/der/printable_string/der_length_printable_string.c | 2 -- src/pk/asn1/der/sequence/der_decode_sequence_ex.c | 2 -- src/pk/asn1/der/sequence/der_decode_sequence_flexi.c | 2 -- src/pk/asn1/der/sequence/der_decode_sequence_multi.c | 2 -- src/pk/asn1/der/sequence/der_encode_sequence_ex.c | 2 -- src/pk/asn1/der/sequence/der_encode_sequence_multi.c | 2 -- src/pk/asn1/der/sequence/der_length_sequence.c | 2 -- src/pk/asn1/der/sequence/der_sequence_free.c | 2 -- src/pk/asn1/der/sequence/der_sequence_shrink.c | 2 -- src/pk/asn1/der/set/der_encode_setof.c | 2 -- src/pk/asn1/der/short_integer/der_decode_short_integer.c | 2 -- src/pk/asn1/der/short_integer/der_encode_short_integer.c | 2 -- src/pk/asn1/der/short_integer/der_length_short_integer.c | 2 -- src/pk/asn1/der/teletex_string/der_decode_teletex_string.c | 2 -- src/pk/asn1/der/teletex_string/der_length_teletex_string.c | 2 -- src/pk/asn1/der/utctime/der_decode_utctime.c | 2 -- src/pk/asn1/der/utctime/der_encode_utctime.c | 2 -- src/pk/asn1/der/utctime/der_length_utctime.c | 2 -- src/pk/asn1/der/utf8/der_decode_utf8_string.c | 2 -- src/pk/asn1/der/utf8/der_encode_utf8_string.c | 2 -- src/pk/asn1/der/utf8/der_length_utf8_string.c | 2 -- src/pk/dsa/dsa_decrypt_key.c | 2 -- src/pk/dsa/dsa_encrypt_key.c | 2 -- src/pk/dsa/dsa_export.c | 2 -- src/pk/dsa/dsa_free.c | 2 -- src/pk/dsa/dsa_import.c | 2 -- src/pk/dsa/dsa_import_radix.c | 2 -- src/pk/dsa/dsa_make_key.c | 2 -- src/pk/dsa/dsa_shared_secret.c | 2 -- src/pk/dsa/dsa_sign_hash.c | 2 -- src/pk/dsa/dsa_verify_hash.c | 2 -- src/pk/dsa/dsa_verify_key.c | 2 -- src/pk/ecc/ecc.c | 2 -- src/pk/ecc/ecc_ansi_x963_export.c | 2 -- src/pk/ecc/ecc_ansi_x963_import.c | 2 -- src/pk/ecc/ecc_decrypt_key.c | 2 -- src/pk/ecc/ecc_encrypt_key.c | 2 -- src/pk/ecc/ecc_export.c | 2 -- src/pk/ecc/ecc_free.c | 2 -- src/pk/ecc/ecc_get_size.c | 2 -- src/pk/ecc/ecc_import.c | 2 -- src/pk/ecc/ecc_make_key.c | 2 -- src/pk/ecc/ecc_shared_secret.c | 2 -- src/pk/ecc/ecc_sign_hash.c | 2 -- src/pk/ecc/ecc_sizes.c | 2 -- src/pk/ecc/ecc_test.c | 2 -- src/pk/ecc/ecc_verify_hash.c | 2 -- src/pk/ecc/ltc_ecc_is_valid_idx.c | 2 -- src/pk/ecc/ltc_ecc_map.c | 2 -- src/pk/ecc/ltc_ecc_mul2add.c | 2 -- src/pk/ecc/ltc_ecc_mulmod.c | 2 -- src/pk/ecc/ltc_ecc_mulmod_timing.c | 2 -- src/pk/ecc/ltc_ecc_points.c | 2 -- src/pk/ecc/ltc_ecc_projective_add_point.c | 2 -- src/pk/ecc/ltc_ecc_projective_dbl_point.c | 2 -- src/pk/katja/katja_decrypt_key.c | 2 -- src/pk/katja/katja_encrypt_key.c | 2 -- src/pk/katja/katja_export.c | 2 -- src/pk/katja/katja_exptmod.c | 2 -- src/pk/katja/katja_free.c | 2 -- src/pk/katja/katja_import.c | 2 -- src/pk/katja/katja_make_key.c | 2 -- src/pk/pkcs1/pkcs_1_i2osp.c | 2 -- src/pk/pkcs1/pkcs_1_mgf1.c | 2 -- src/pk/pkcs1/pkcs_1_oaep_decode.c | 2 -- src/pk/pkcs1/pkcs_1_oaep_encode.c | 2 -- src/pk/pkcs1/pkcs_1_os2ip.c | 2 -- src/pk/pkcs1/pkcs_1_pss_decode.c | 2 -- src/pk/pkcs1/pkcs_1_pss_encode.c | 2 -- src/pk/pkcs1/pkcs_1_v1_5_decode.c | 2 -- src/pk/pkcs1/pkcs_1_v1_5_encode.c | 2 -- src/pk/rsa/rsa_decrypt_key.c | 2 -- src/pk/rsa/rsa_encrypt_key.c | 2 -- src/pk/rsa/rsa_export.c | 2 -- src/pk/rsa/rsa_exptmod.c | 2 -- src/pk/rsa/rsa_free.c | 2 -- src/pk/rsa/rsa_import.c | 2 -- src/pk/rsa/rsa_import_pkcs8.c | 2 -- src/pk/rsa/rsa_import_radix.c | 2 -- src/pk/rsa/rsa_import_x509.c | 2 -- src/pk/rsa/rsa_make_key.c | 2 -- src/pk/rsa/rsa_sign_hash.c | 2 -- src/pk/rsa/rsa_verify_hash.c | 2 -- src/stream/sober128/sober128.c | 2 -- 332 files changed, 664 deletions(-) diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index 2bf7a005d..9a6857638 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* AES implementation by Tom St Denis diff --git a/src/ciphers/aes/aes_tab.c b/src/ciphers/aes/aes_tab.c index 9c902e88d..35d57f332 100644 --- a/src/ciphers/aes/aes_tab.c +++ b/src/ciphers/aes/aes_tab.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* The precomputed tables for AES */ /* diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index 08948cce8..dc1d0d46b 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/blowfish.c b/src/ciphers/blowfish.c index 9a78733ab..162263d24 100644 --- a/src/ciphers/blowfish.c +++ b/src/ciphers/blowfish.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** @file blowfish.c diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index ad8f501c7..39eb8d54b 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/cast5.c b/src/ciphers/cast5.c index f4f9154b6..658cf4b69 100644 --- a/src/ciphers/cast5.c +++ b/src/ciphers/cast5.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/des.c b/src/ciphers/des.c index 712c1ae89..a6d1e001b 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/ciphers/kasumi.c b/src/ciphers/kasumi.c index 61369e07f..6472fce99 100644 --- a/src/ciphers/kasumi.c +++ b/src/ciphers/kasumi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/khazad.c b/src/ciphers/khazad.c index 1cea03c55..12beca2f9 100644 --- a/src/ciphers/khazad.c +++ b/src/ciphers/khazad.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/ciphers/kseed.c b/src/ciphers/kseed.c index 85b4f8a7b..9ab1b1975 100644 --- a/src/ciphers/kseed.c +++ b/src/ciphers/kseed.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index d77c9a668..f0f943841 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index 5b8d1c850..e8f3e8c0d 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** @file noekeon.c diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index e0e05d179..d86ac735e 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /**********************************************************************\ * To commemorate the 1996 RSA Data Security Conference, the following * diff --git a/src/ciphers/rc5.c b/src/ciphers/rc5.c index bd964e2c9..12f7320c9 100644 --- a/src/ciphers/rc5.c +++ b/src/ciphers/rc5.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/rc6.c b/src/ciphers/rc6.c index 48d413dbe..11f046939 100644 --- a/src/ciphers/rc6.c +++ b/src/ciphers/rc6.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index 11f4b1b1d..f24457e4d 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /******************************************************************************* diff --git a/src/ciphers/safer/safer_tab.c b/src/ciphers/safer/safer_tab.c index 308fe55be..aa69cc5d6 100644 --- a/src/ciphers/safer/safer_tab.c +++ b/src/ciphers/safer/safer_tab.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/safer/saferp.c b/src/ciphers/safer/saferp.c index e5f8bf39e..b3095bb1c 100644 --- a/src/ciphers/safer/saferp.c +++ b/src/ciphers/safer/saferp.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/skipjack.c b/src/ciphers/skipjack.c index 4333a9f65..293690e22 100644 --- a/src/ciphers/skipjack.c +++ b/src/ciphers/skipjack.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index b2b41bb20..1c0d208eb 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/twofish/twofish_tab.c b/src/ciphers/twofish/twofish_tab.c index 7ea858661..d4f011e70 100644 --- a/src/ciphers/twofish/twofish_tab.c +++ b/src/ciphers/twofish/twofish_tab.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index 4b3b52bdf..030920374 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ccm/ccm_add_aad.c b/src/encauth/ccm/ccm_add_aad.c index 43a3d5374..a547c58be 100644 --- a/src/encauth/ccm/ccm_add_aad.c +++ b/src/encauth/ccm/ccm_add_aad.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/encauth/ccm/ccm_add_nonce.c b/src/encauth/ccm/ccm_add_nonce.c index 0f67fc241..5c11bbb9b 100644 --- a/src/encauth/ccm/ccm_add_nonce.c +++ b/src/encauth/ccm/ccm_add_nonce.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/encauth/ccm/ccm_done.c b/src/encauth/ccm/ccm_done.c index 64c9f9f45..bd7fea31c 100644 --- a/src/encauth/ccm/ccm_done.c +++ b/src/encauth/ccm/ccm_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/encauth/ccm/ccm_init.c b/src/encauth/ccm/ccm_init.c index 7e3bdf8af..4d4aaca32 100644 --- a/src/encauth/ccm/ccm_init.c +++ b/src/encauth/ccm/ccm_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index de842816d..48aecda10 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/encauth/ccm/ccm_process.c b/src/encauth/ccm/ccm_process.c index 1f650caae..af31e2c3a 100644 --- a/src/encauth/ccm/ccm_process.c +++ b/src/encauth/ccm/ccm_process.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/encauth/ccm/ccm_reset.c b/src/encauth/ccm/ccm_reset.c index 855789d6d..076abc518 100644 --- a/src/encauth/ccm/ccm_reset.c +++ b/src/encauth/ccm/ccm_reset.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index 1177a0f84..b42951d34 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/encauth/eax/eax_addheader.c b/src/encauth/eax/eax_addheader.c index 3c1d79b83..a9df36514 100644 --- a/src/encauth/eax/eax_addheader.c +++ b/src/encauth/eax/eax_addheader.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** @file eax_addheader.c diff --git a/src/encauth/eax/eax_decrypt.c b/src/encauth/eax/eax_decrypt.c index 512b5b708..c5c588376 100644 --- a/src/encauth/eax/eax_decrypt.c +++ b/src/encauth/eax/eax_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/eax/eax_decrypt_verify_memory.c b/src/encauth/eax/eax_decrypt_verify_memory.c index be07cf52d..9b5f58fd5 100644 --- a/src/encauth/eax/eax_decrypt_verify_memory.c +++ b/src/encauth/eax/eax_decrypt_verify_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/eax/eax_done.c b/src/encauth/eax/eax_done.c index cac609344..309303c20 100644 --- a/src/encauth/eax/eax_done.c +++ b/src/encauth/eax/eax_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/eax/eax_encrypt.c b/src/encauth/eax/eax_encrypt.c index 29eb6ee88..9c2a63c5f 100644 --- a/src/encauth/eax/eax_encrypt.c +++ b/src/encauth/eax/eax_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/eax/eax_encrypt_authenticate_memory.c b/src/encauth/eax/eax_encrypt_authenticate_memory.c index 4b4815f8a..47760b651 100644 --- a/src/encauth/eax/eax_encrypt_authenticate_memory.c +++ b/src/encauth/eax/eax_encrypt_authenticate_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/eax/eax_init.c b/src/encauth/eax/eax_init.c index 55d8df1b2..977bd0164 100644 --- a/src/encauth/eax/eax_init.c +++ b/src/encauth/eax/eax_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/eax/eax_test.c b/src/encauth/eax/eax_test.c index f5558ccd4..fc77422d7 100644 --- a/src/encauth/eax/eax_test.c +++ b/src/encauth/eax/eax_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_add_aad.c b/src/encauth/gcm/gcm_add_aad.c index b9eb2dfe2..ebf7fd57f 100644 --- a/src/encauth/gcm/gcm_add_aad.c +++ b/src/encauth/gcm/gcm_add_aad.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_add_iv.c b/src/encauth/gcm/gcm_add_iv.c index bf0871a01..dc324d228 100644 --- a/src/encauth/gcm/gcm_add_iv.c +++ b/src/encauth/gcm/gcm_add_iv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_done.c b/src/encauth/gcm/gcm_done.c index db950a566..2fb18396a 100644 --- a/src/encauth/gcm/gcm_done.c +++ b/src/encauth/gcm/gcm_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_gf_mult.c b/src/encauth/gcm/gcm_gf_mult.c index 1b3387f72..aacceabbe 100644 --- a/src/encauth/gcm/gcm_gf_mult.c +++ b/src/encauth/gcm/gcm_gf_mult.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_init.c b/src/encauth/gcm/gcm_init.c index 65282c181..f57cec8ae 100644 --- a/src/encauth/gcm/gcm_init.c +++ b/src/encauth/gcm/gcm_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_memory.c b/src/encauth/gcm/gcm_memory.c index 05d471bac..a769642f0 100644 --- a/src/encauth/gcm/gcm_memory.c +++ b/src/encauth/gcm/gcm_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_mult_h.c b/src/encauth/gcm/gcm_mult_h.c index 8eee28010..d7b4df0c5 100644 --- a/src/encauth/gcm/gcm_mult_h.c +++ b/src/encauth/gcm/gcm_mult_h.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_process.c b/src/encauth/gcm/gcm_process.c index 4116db8a7..3894a2930 100644 --- a/src/encauth/gcm/gcm_process.c +++ b/src/encauth/gcm/gcm_process.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_reset.c b/src/encauth/gcm/gcm_reset.c index f9596b43f..7269c9bcb 100644 --- a/src/encauth/gcm/gcm_reset.c +++ b/src/encauth/gcm/gcm_reset.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/gcm/gcm_test.c b/src/encauth/gcm/gcm_test.c index fb37796f8..84e57068d 100644 --- a/src/encauth/gcm/gcm_test.c +++ b/src/encauth/gcm/gcm_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_decrypt.c b/src/encauth/ocb/ocb_decrypt.c index 33c425a74..e06335456 100644 --- a/src/encauth/ocb/ocb_decrypt.c +++ b/src/encauth/ocb/ocb_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_decrypt_verify_memory.c b/src/encauth/ocb/ocb_decrypt_verify_memory.c index 70c579a16..17e87074c 100644 --- a/src/encauth/ocb/ocb_decrypt_verify_memory.c +++ b/src/encauth/ocb/ocb_decrypt_verify_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_done_decrypt.c b/src/encauth/ocb/ocb_done_decrypt.c index 8a119b632..7f8553419 100644 --- a/src/encauth/ocb/ocb_done_decrypt.c +++ b/src/encauth/ocb/ocb_done_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_done_encrypt.c b/src/encauth/ocb/ocb_done_encrypt.c index 3c3054f7d..7dcf837d8 100644 --- a/src/encauth/ocb/ocb_done_encrypt.c +++ b/src/encauth/ocb/ocb_done_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_encrypt.c b/src/encauth/ocb/ocb_encrypt.c index 24d22db02..37affaab1 100644 --- a/src/encauth/ocb/ocb_encrypt.c +++ b/src/encauth/ocb/ocb_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_encrypt_authenticate_memory.c b/src/encauth/ocb/ocb_encrypt_authenticate_memory.c index 3c2317132..1349820ec 100644 --- a/src/encauth/ocb/ocb_encrypt_authenticate_memory.c +++ b/src/encauth/ocb/ocb_encrypt_authenticate_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_init.c b/src/encauth/ocb/ocb_init.c index 2b2d09ed0..16c49f812 100644 --- a/src/encauth/ocb/ocb_init.c +++ b/src/encauth/ocb/ocb_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_ntz.c b/src/encauth/ocb/ocb_ntz.c index c3e42f17e..c0010a5be 100644 --- a/src/encauth/ocb/ocb_ntz.c +++ b/src/encauth/ocb/ocb_ntz.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_shift_xor.c b/src/encauth/ocb/ocb_shift_xor.c index 48b76b61b..39b4dec63 100644 --- a/src/encauth/ocb/ocb_shift_xor.c +++ b/src/encauth/ocb/ocb_shift_xor.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/ocb_test.c b/src/encauth/ocb/ocb_test.c index ca0653fa9..7cf4a367d 100644 --- a/src/encauth/ocb/ocb_test.c +++ b/src/encauth/ocb/ocb_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb/s_ocb_done.c b/src/encauth/ocb/s_ocb_done.c index 5cf9c73cd..07293e206 100644 --- a/src/encauth/ocb/s_ocb_done.c +++ b/src/encauth/ocb/s_ocb_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb3/ocb3_decrypt.c b/src/encauth/ocb3/ocb3_decrypt.c index 24d6ad159..b14465349 100644 --- a/src/encauth/ocb3/ocb3_decrypt.c +++ b/src/encauth/ocb3/ocb3_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c index ce8fe9ce9..1e0f91d5f 100644 --- a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c +++ b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb3/ocb3_done.c b/src/encauth/ocb3/ocb3_done.c index 4102d9c1a..649dfe7ff 100644 --- a/src/encauth/ocb3/ocb3_done.c +++ b/src/encauth/ocb3/ocb3_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb3/ocb3_encrypt.c b/src/encauth/ocb3/ocb3_encrypt.c index 145047824..a71caa59a 100644 --- a/src/encauth/ocb3/ocb3_encrypt.c +++ b/src/encauth/ocb3/ocb3_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c index 60264a2c8..cd39d839e 100644 --- a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c +++ b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index 400c0a7e1..df6cb61a2 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb3/ocb3_int_ntz.c b/src/encauth/ocb3/ocb3_int_ntz.c index 48239fe76..c7843cc2f 100644 --- a/src/encauth/ocb3/ocb3_int_ntz.c +++ b/src/encauth/ocb3/ocb3_int_ntz.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index 011ded74f..f1f579c27 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index 889291e80..52395e536 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/helper/hash_file.c b/src/hashes/helper/hash_file.c index bb899a18d..c221927ad 100644 --- a/src/hashes/helper/hash_file.c +++ b/src/hashes/helper/hash_file.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/helper/hash_filehandle.c b/src/hashes/helper/hash_filehandle.c index f1f29c086..07a565a9e 100644 --- a/src/hashes/helper/hash_filehandle.c +++ b/src/hashes/helper/hash_filehandle.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/helper/hash_memory.c b/src/hashes/helper/hash_memory.c index 53caa5d61..d00d47557 100644 --- a/src/hashes/helper/hash_memory.c +++ b/src/hashes/helper/hash_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/helper/hash_memory_multi.c b/src/hashes/helper/hash_memory_multi.c index 560d6f6f5..c50ac0ea0 100644 --- a/src/hashes/helper/hash_memory_multi.c +++ b/src/hashes/helper/hash_memory_multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/hashes/md2.c b/src/hashes/md2.c index e5ce4bb41..53a678f44 100644 --- a/src/hashes/md2.c +++ b/src/hashes/md2.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/md4.c b/src/hashes/md4.c index be4b129e2..9e59fa2d4 100644 --- a/src/hashes/md4.c +++ b/src/hashes/md4.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/md5.c b/src/hashes/md5.c index c76e76be0..8c2b41348 100644 --- a/src/hashes/md5.c +++ b/src/hashes/md5.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/rmd128.c b/src/hashes/rmd128.c index 135d83e1d..f3ea56f9a 100644 --- a/src/hashes/rmd128.c +++ b/src/hashes/rmd128.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/rmd160.c b/src/hashes/rmd160.c index 133c75c57..21bbee492 100644 --- a/src/hashes/rmd160.c +++ b/src/hashes/rmd160.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/rmd256.c b/src/hashes/rmd256.c index fa90c094a..324492308 100644 --- a/src/hashes/rmd256.c +++ b/src/hashes/rmd256.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/rmd320.c b/src/hashes/rmd320.c index 05b2decef..e3fdd0921 100644 --- a/src/hashes/rmd320.c +++ b/src/hashes/rmd320.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/sha1.c b/src/hashes/sha1.c index b4324b18c..243b61530 100644 --- a/src/hashes/sha1.c +++ b/src/hashes/sha1.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/sha2/sha224.c b/src/hashes/sha2/sha224.c index d19eb1f69..6b69d0857 100644 --- a/src/hashes/sha2/sha224.c +++ b/src/hashes/sha2/sha224.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** @param sha224.c diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index 02fae8322..cd909e021 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/sha2/sha384.c b/src/hashes/sha2/sha384.c index c7fb02ab8..5daa9d154 100644 --- a/src/hashes/sha2/sha384.c +++ b/src/hashes/sha2/sha384.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** @param sha384.c diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index 951865ee5..81848b4fa 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/sha2/sha512_224.c b/src/hashes/sha2/sha512_224.c index b485cf589..3e36d559e 100644 --- a/src/hashes/sha2/sha512_224.c +++ b/src/hashes/sha2/sha512_224.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** @param sha512_224.c diff --git a/src/hashes/sha2/sha512_256.c b/src/hashes/sha2/sha512_256.c index 8bfbdcc3b..f5c1ef0de 100644 --- a/src/hashes/sha2/sha512_256.c +++ b/src/hashes/sha2/sha512_256.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** @param sha512_256.c diff --git a/src/hashes/tiger.c b/src/hashes/tiger.c index e117e77a2..274288e52 100644 --- a/src/hashes/tiger.c +++ b/src/hashes/tiger.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/hashes/whirl/whirl.c b/src/hashes/whirl/whirl.c index 5e0b23163..c87519bcb 100644 --- a/src/hashes/whirl/whirl.c +++ b/src/hashes/whirl/whirl.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /** diff --git a/src/mac/f9/f9_done.c b/src/mac/f9/f9_done.c index 9bcf1b572..587216429 100644 --- a/src/mac/f9/f9_done.c +++ b/src/mac/f9/f9_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/f9/f9_file.c b/src/mac/f9/f9_file.c index c99d7a39a..28b4d69b5 100644 --- a/src/mac/f9/f9_file.c +++ b/src/mac/f9/f9_file.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/f9/f9_init.c b/src/mac/f9/f9_init.c index ec026b968..9dee38ef9 100644 --- a/src/mac/f9/f9_init.c +++ b/src/mac/f9/f9_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/f9/f9_memory.c b/src/mac/f9/f9_memory.c index e07a05cb2..ceea8ee0e 100644 --- a/src/mac/f9/f9_memory.c +++ b/src/mac/f9/f9_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/f9/f9_memory_multi.c b/src/mac/f9/f9_memory_multi.c index 6c8f2dcc9..3026c4f10 100644 --- a/src/mac/f9/f9_memory_multi.c +++ b/src/mac/f9/f9_memory_multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/mac/f9/f9_process.c b/src/mac/f9/f9_process.c index 42027fda6..d628086d9 100644 --- a/src/mac/f9/f9_process.c +++ b/src/mac/f9/f9_process.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/f9/f9_test.c b/src/mac/f9/f9_test.c index d08f6d24c..e26c6634e 100644 --- a/src/mac/f9/f9_test.c +++ b/src/mac/f9/f9_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/hmac/hmac_done.c b/src/mac/hmac/hmac_done.c index 15baa0c55..8e19b613b 100644 --- a/src/mac/hmac/hmac_done.c +++ b/src/mac/hmac/hmac_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/hmac/hmac_file.c b/src/mac/hmac/hmac_file.c index f74505c04..1435d764b 100644 --- a/src/mac/hmac/hmac_file.c +++ b/src/mac/hmac/hmac_file.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/hmac/hmac_init.c b/src/mac/hmac/hmac_init.c index 2c887db85..2b4433ee9 100644 --- a/src/mac/hmac/hmac_init.c +++ b/src/mac/hmac/hmac_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/hmac/hmac_memory.c b/src/mac/hmac/hmac_memory.c index c32f13aa5..f6dc9568c 100644 --- a/src/mac/hmac/hmac_memory.c +++ b/src/mac/hmac/hmac_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/hmac/hmac_memory_multi.c b/src/mac/hmac/hmac_memory_multi.c index f9d85878c..2accd4fd7 100644 --- a/src/mac/hmac/hmac_memory_multi.c +++ b/src/mac/hmac/hmac_memory_multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/mac/hmac/hmac_process.c b/src/mac/hmac/hmac_process.c index f1931c8de..4d5dc2db9 100644 --- a/src/mac/hmac/hmac_process.c +++ b/src/mac/hmac/hmac_process.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index f0b5e20bb..1e6119295 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/omac/omac_done.c b/src/mac/omac/omac_done.c index 18fa25cc0..51296bd94 100644 --- a/src/mac/omac/omac_done.c +++ b/src/mac/omac/omac_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/omac/omac_file.c b/src/mac/omac/omac_file.c index 51c67b784..4cf3d0776 100644 --- a/src/mac/omac/omac_file.c +++ b/src/mac/omac/omac_file.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/omac/omac_init.c b/src/mac/omac/omac_init.c index 3bee70fce..b74009f28 100644 --- a/src/mac/omac/omac_init.c +++ b/src/mac/omac/omac_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/omac/omac_memory.c b/src/mac/omac/omac_memory.c index dde7e7633..21d277e86 100644 --- a/src/mac/omac/omac_memory.c +++ b/src/mac/omac/omac_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/omac/omac_memory_multi.c b/src/mac/omac/omac_memory_multi.c index afaf8cb45..e7bbe6945 100644 --- a/src/mac/omac/omac_memory_multi.c +++ b/src/mac/omac/omac_memory_multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/mac/omac/omac_process.c b/src/mac/omac/omac_process.c index df9420877..2c2ba0f0a 100644 --- a/src/mac/omac/omac_process.c +++ b/src/mac/omac/omac_process.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/omac/omac_test.c b/src/mac/omac/omac_test.c index 502ad081e..147a2840b 100644 --- a/src/mac/omac/omac_test.c +++ b/src/mac/omac/omac_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pelican/pelican.c b/src/mac/pelican/pelican.c index 95af87e0d..08b47ea18 100644 --- a/src/mac/pelican/pelican.c +++ b/src/mac/pelican/pelican.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pelican/pelican_memory.c b/src/mac/pelican/pelican_memory.c index f5e7b4a90..e358341c0 100644 --- a/src/mac/pelican/pelican_memory.c +++ b/src/mac/pelican/pelican_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pelican/pelican_test.c b/src/mac/pelican/pelican_test.c index 230026b3b..cfa4c43d2 100644 --- a/src/mac/pelican/pelican_test.c +++ b/src/mac/pelican/pelican_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pmac/pmac_done.c b/src/mac/pmac/pmac_done.c index 6ad5646b5..3b5ecc50d 100644 --- a/src/mac/pmac/pmac_done.c +++ b/src/mac/pmac/pmac_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pmac/pmac_file.c b/src/mac/pmac/pmac_file.c index c7d9877df..46e68c13f 100644 --- a/src/mac/pmac/pmac_file.c +++ b/src/mac/pmac/pmac_file.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pmac/pmac_init.c b/src/mac/pmac/pmac_init.c index 9a7192c50..7cbd9486f 100644 --- a/src/mac/pmac/pmac_init.c +++ b/src/mac/pmac/pmac_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pmac/pmac_memory.c b/src/mac/pmac/pmac_memory.c index f73244a66..462f03218 100644 --- a/src/mac/pmac/pmac_memory.c +++ b/src/mac/pmac/pmac_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pmac/pmac_memory_multi.c b/src/mac/pmac/pmac_memory_multi.c index 913840a06..a28319a34 100644 --- a/src/mac/pmac/pmac_memory_multi.c +++ b/src/mac/pmac/pmac_memory_multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/mac/pmac/pmac_ntz.c b/src/mac/pmac/pmac_ntz.c index 2e649f908..a90c20720 100644 --- a/src/mac/pmac/pmac_ntz.c +++ b/src/mac/pmac/pmac_ntz.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pmac/pmac_process.c b/src/mac/pmac/pmac_process.c index 9c2678389..95e4bb441 100644 --- a/src/mac/pmac/pmac_process.c +++ b/src/mac/pmac/pmac_process.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pmac/pmac_shift_xor.c b/src/mac/pmac/pmac_shift_xor.c index ac3c12f1e..de51819a9 100644 --- a/src/mac/pmac/pmac_shift_xor.c +++ b/src/mac/pmac/pmac_shift_xor.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/pmac/pmac_test.c b/src/mac/pmac/pmac_test.c index 253cb5f72..4ffa92712 100644 --- a/src/mac/pmac/pmac_test.c +++ b/src/mac/pmac/pmac_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/xcbc/xcbc_done.c b/src/mac/xcbc/xcbc_done.c index 1573263e6..48e27606a 100644 --- a/src/mac/xcbc/xcbc_done.c +++ b/src/mac/xcbc/xcbc_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/xcbc/xcbc_file.c b/src/mac/xcbc/xcbc_file.c index c8119f9a1..fc4c5f14b 100644 --- a/src/mac/xcbc/xcbc_file.c +++ b/src/mac/xcbc/xcbc_file.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/xcbc/xcbc_init.c b/src/mac/xcbc/xcbc_init.c index b4ad2e918..35ba9055f 100644 --- a/src/mac/xcbc/xcbc_init.c +++ b/src/mac/xcbc/xcbc_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/xcbc/xcbc_memory.c b/src/mac/xcbc/xcbc_memory.c index aac9298d5..263acec13 100644 --- a/src/mac/xcbc/xcbc_memory.c +++ b/src/mac/xcbc/xcbc_memory.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/xcbc/xcbc_memory_multi.c b/src/mac/xcbc/xcbc_memory_multi.c index 994bdce1a..822dd9531 100644 --- a/src/mac/xcbc/xcbc_memory_multi.c +++ b/src/mac/xcbc/xcbc_memory_multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/mac/xcbc/xcbc_process.c b/src/mac/xcbc/xcbc_process.c index dca321a5b..c75ea8464 100644 --- a/src/mac/xcbc/xcbc_process.c +++ b/src/mac/xcbc/xcbc_process.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/mac/xcbc/xcbc_test.c b/src/mac/xcbc/xcbc_test.c index f7610b254..80b93d42a 100644 --- a/src/mac/xcbc/xcbc_test.c +++ b/src/mac/xcbc/xcbc_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/math/fp/ltc_ecc_fp_mulmod.c b/src/math/fp/ltc_ecc_fp_mulmod.c index 0e6237577..c5e8aa741 100644 --- a/src/math/fp/ltc_ecc_fp_mulmod.c +++ b/src/math/fp/ltc_ecc_fp_mulmod.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 817f08c37..d742fa143 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #define DESC_DEF_ONLY diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index ca87d6d1d..54885a4a5 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #define DESC_DEF_ONLY diff --git a/src/math/multi.c b/src/math/multi.c index f85e90030..fd18bebb9 100644 --- a/src/math/multi.c +++ b/src/math/multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/math/rand_prime.c b/src/math/rand_prime.c index 9dd737bf3..6cb7b4928 100644 --- a/src/math/rand_prime.c +++ b/src/math/rand_prime.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index 66b4f3ece..5d5de63b6 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #define DESC_DEF_ONLY diff --git a/src/misc/adler32.c b/src/misc/adler32.c index 987931bf3..71de8e9c2 100644 --- a/src/misc/adler32.c +++ b/src/misc/adler32.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index d3b89b12f..3aed5beae 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/base64/base64_encode.c b/src/misc/base64/base64_encode.c index ea3eaddd3..a1356302c 100644 --- a/src/misc/base64/base64_encode.c +++ b/src/misc/base64/base64_encode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/burn_stack.c b/src/misc/burn_stack.c index 2610c060d..0f87b7c8b 100644 --- a/src/misc/burn_stack.c +++ b/src/misc/burn_stack.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crc32.c b/src/misc/crc32.c index 8228c2929..60c8aa197 100644 --- a/src/misc/crc32.c +++ b/src/misc/crc32.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index b88e47479..aeb46cc5d 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_argchk.c b/src/misc/crypt/crypt_argchk.c index 85888967c..153bb3b18 100644 --- a/src/misc/crypt/crypt_argchk.c +++ b/src/misc/crypt/crypt_argchk.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_cipher_descriptor.c b/src/misc/crypt/crypt_cipher_descriptor.c index 2e35787af..6d5451f54 100644 --- a/src/misc/crypt/crypt_cipher_descriptor.c +++ b/src/misc/crypt/crypt_cipher_descriptor.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_cipher_is_valid.c b/src/misc/crypt/crypt_cipher_is_valid.c index 35f1ace83..f23bb034b 100644 --- a/src/misc/crypt/crypt_cipher_is_valid.c +++ b/src/misc/crypt/crypt_cipher_is_valid.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 55612f4cd..6e5bedd2c 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_find_cipher.c b/src/misc/crypt/crypt_find_cipher.c index 0c563b0d7..45de73605 100644 --- a/src/misc/crypt/crypt_find_cipher.c +++ b/src/misc/crypt/crypt_find_cipher.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_find_cipher_any.c b/src/misc/crypt/crypt_find_cipher_any.c index a25a5b54d..db85707d8 100644 --- a/src/misc/crypt/crypt_find_cipher_any.c +++ b/src/misc/crypt/crypt_find_cipher_any.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_find_cipher_id.c b/src/misc/crypt/crypt_find_cipher_id.c index be4e0fa9a..73841d0b7 100644 --- a/src/misc/crypt/crypt_find_cipher_id.c +++ b/src/misc/crypt/crypt_find_cipher_id.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_find_hash.c b/src/misc/crypt/crypt_find_hash.c index 12ef320ec..1ce723f54 100644 --- a/src/misc/crypt/crypt_find_hash.c +++ b/src/misc/crypt/crypt_find_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_find_hash_any.c b/src/misc/crypt/crypt_find_hash_any.c index 777ce0877..3d22486a6 100644 --- a/src/misc/crypt/crypt_find_hash_any.c +++ b/src/misc/crypt/crypt_find_hash_any.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_find_hash_id.c b/src/misc/crypt/crypt_find_hash_id.c index f8e75fcbf..d94510d2f 100644 --- a/src/misc/crypt/crypt_find_hash_id.c +++ b/src/misc/crypt/crypt_find_hash_id.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_find_hash_oid.c b/src/misc/crypt/crypt_find_hash_oid.c index 19aece78c..a97ff6bf6 100644 --- a/src/misc/crypt/crypt_find_hash_oid.c +++ b/src/misc/crypt/crypt_find_hash_oid.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_find_prng.c b/src/misc/crypt/crypt_find_prng.c index af3f7b699..9acc6b5d6 100644 --- a/src/misc/crypt/crypt_find_prng.c +++ b/src/misc/crypt/crypt_find_prng.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_fsa.c b/src/misc/crypt/crypt_fsa.c index e177f9aaa..60f2099e3 100644 --- a/src/misc/crypt/crypt_fsa.c +++ b/src/misc/crypt/crypt_fsa.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/misc/crypt/crypt_hash_descriptor.c b/src/misc/crypt/crypt_hash_descriptor.c index 4e8bce1f9..68abe6283 100644 --- a/src/misc/crypt/crypt_hash_descriptor.c +++ b/src/misc/crypt/crypt_hash_descriptor.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_hash_is_valid.c b/src/misc/crypt/crypt_hash_is_valid.c index dbab714e4..8453942db 100644 --- a/src/misc/crypt/crypt_hash_is_valid.c +++ b/src/misc/crypt/crypt_hash_is_valid.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_inits.c b/src/misc/crypt/crypt_inits.c index 4df6051d3..dd24f6551 100644 --- a/src/misc/crypt/crypt_inits.c +++ b/src/misc/crypt/crypt_inits.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_ltc_mp_descriptor.c b/src/misc/crypt/crypt_ltc_mp_descriptor.c index 0577d1dfb..d146755e0 100644 --- a/src/misc/crypt/crypt_ltc_mp_descriptor.c +++ b/src/misc/crypt/crypt_ltc_mp_descriptor.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_prng_descriptor.c b/src/misc/crypt/crypt_prng_descriptor.c index 926f3bb68..3870c28b2 100644 --- a/src/misc/crypt/crypt_prng_descriptor.c +++ b/src/misc/crypt/crypt_prng_descriptor.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_prng_is_valid.c b/src/misc/crypt/crypt_prng_is_valid.c index ccc6e0483..ac78094c7 100644 --- a/src/misc/crypt/crypt_prng_is_valid.c +++ b/src/misc/crypt/crypt_prng_is_valid.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_prng_rng_descriptor.c b/src/misc/crypt/crypt_prng_rng_descriptor.c index bf31781ac..ccb6852c7 100644 --- a/src/misc/crypt/crypt_prng_rng_descriptor.c +++ b/src/misc/crypt/crypt_prng_rng_descriptor.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_register_cipher.c b/src/misc/crypt/crypt_register_cipher.c index d7feedfe9..242075edc 100644 --- a/src/misc/crypt/crypt_register_cipher.c +++ b/src/misc/crypt/crypt_register_cipher.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_register_hash.c b/src/misc/crypt/crypt_register_hash.c index 10ccee433..10cf94427 100644 --- a/src/misc/crypt/crypt_register_hash.c +++ b/src/misc/crypt/crypt_register_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_register_prng.c b/src/misc/crypt/crypt_register_prng.c index faebb180b..4438bc46b 100644 --- a/src/misc/crypt/crypt_register_prng.c +++ b/src/misc/crypt/crypt_register_prng.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 0ca1e441f..309a43d6b 100644 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_unregister_cipher.c b/src/misc/crypt/crypt_unregister_cipher.c index b75785f3a..3932bddeb 100644 --- a/src/misc/crypt/crypt_unregister_cipher.c +++ b/src/misc/crypt/crypt_unregister_cipher.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_unregister_hash.c b/src/misc/crypt/crypt_unregister_hash.c index ac95d2dc5..56a8d2ea2 100644 --- a/src/misc/crypt/crypt_unregister_hash.c +++ b/src/misc/crypt/crypt_unregister_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/crypt/crypt_unregister_prng.c b/src/misc/crypt/crypt_unregister_prng.c index 424131a8b..b6fc7f5f3 100644 --- a/src/misc/crypt/crypt_unregister_prng.c +++ b/src/misc/crypt/crypt_unregister_prng.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/error_to_string.c b/src/misc/error_to_string.c index c3d08727f..02bfbe7c5 100644 --- a/src/misc/error_to_string.c +++ b/src/misc/error_to_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/mem_neq.c b/src/misc/mem_neq.c index 917b75831..677209653 100644 --- a/src/misc/mem_neq.c +++ b/src/misc/mem_neq.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/misc/pkcs5/pkcs_5_1.c b/src/misc/pkcs5/pkcs_5_1.c index 2ebdf2f7d..b49174041 100644 --- a/src/misc/pkcs5/pkcs_5_1.c +++ b/src/misc/pkcs5/pkcs_5_1.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include diff --git a/src/misc/pkcs5/pkcs_5_2.c b/src/misc/pkcs5/pkcs_5_2.c index 9b9b78a64..ab69b8393 100644 --- a/src/misc/pkcs5/pkcs_5_2.c +++ b/src/misc/pkcs5/pkcs_5_2.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include diff --git a/src/misc/zeromem.c b/src/misc/zeromem.c index 3564cc1c0..c1fded364 100644 --- a/src/misc/zeromem.c +++ b/src/misc/zeromem.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cbc/cbc_decrypt.c b/src/modes/cbc/cbc_decrypt.c index b4fa466bb..2748af4ff 100644 --- a/src/modes/cbc/cbc_decrypt.c +++ b/src/modes/cbc/cbc_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cbc/cbc_done.c b/src/modes/cbc/cbc_done.c index 48249404f..c4d96b728 100644 --- a/src/modes/cbc/cbc_done.c +++ b/src/modes/cbc/cbc_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cbc/cbc_encrypt.c b/src/modes/cbc/cbc_encrypt.c index f304d0e57..ecba6817c 100644 --- a/src/modes/cbc/cbc_encrypt.c +++ b/src/modes/cbc/cbc_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cbc/cbc_getiv.c b/src/modes/cbc/cbc_getiv.c index 65877434c..fc6a8c0a4 100644 --- a/src/modes/cbc/cbc_getiv.c +++ b/src/modes/cbc/cbc_getiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cbc/cbc_setiv.c b/src/modes/cbc/cbc_setiv.c index 3d0209369..b8c4ae1ca 100644 --- a/src/modes/cbc/cbc_setiv.c +++ b/src/modes/cbc/cbc_setiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cbc/cbc_start.c b/src/modes/cbc/cbc_start.c index 71b6fa834..477301b19 100644 --- a/src/modes/cbc/cbc_start.c +++ b/src/modes/cbc/cbc_start.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cfb/cfb_decrypt.c b/src/modes/cfb/cfb_decrypt.c index 0c08c7454..aa7783b4f 100644 --- a/src/modes/cfb/cfb_decrypt.c +++ b/src/modes/cfb/cfb_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cfb/cfb_done.c b/src/modes/cfb/cfb_done.c index bacfa2872..b799d4b14 100644 --- a/src/modes/cfb/cfb_done.c +++ b/src/modes/cfb/cfb_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cfb/cfb_encrypt.c b/src/modes/cfb/cfb_encrypt.c index e76214303..d6687a4c0 100644 --- a/src/modes/cfb/cfb_encrypt.c +++ b/src/modes/cfb/cfb_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cfb/cfb_getiv.c b/src/modes/cfb/cfb_getiv.c index b6786e15e..328529cfc 100644 --- a/src/modes/cfb/cfb_getiv.c +++ b/src/modes/cfb/cfb_getiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cfb/cfb_setiv.c b/src/modes/cfb/cfb_setiv.c index 4a221100a..d92dc1a22 100644 --- a/src/modes/cfb/cfb_setiv.c +++ b/src/modes/cfb/cfb_setiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/cfb/cfb_start.c b/src/modes/cfb/cfb_start.c index b42c97f84..03b595972 100644 --- a/src/modes/cfb/cfb_start.c +++ b/src/modes/cfb/cfb_start.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ctr/ctr_decrypt.c b/src/modes/ctr/ctr_decrypt.c index 953724904..4347569d7 100644 --- a/src/modes/ctr/ctr_decrypt.c +++ b/src/modes/ctr/ctr_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ctr/ctr_done.c b/src/modes/ctr/ctr_done.c index 77d888bdd..55bedaa51 100644 --- a/src/modes/ctr/ctr_done.c +++ b/src/modes/ctr/ctr_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ctr/ctr_encrypt.c b/src/modes/ctr/ctr_encrypt.c index 611778562..3668fb677 100644 --- a/src/modes/ctr/ctr_encrypt.c +++ b/src/modes/ctr/ctr_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ctr/ctr_getiv.c b/src/modes/ctr/ctr_getiv.c index 624232351..ea856d6bc 100644 --- a/src/modes/ctr/ctr_getiv.c +++ b/src/modes/ctr/ctr_getiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ctr/ctr_setiv.c b/src/modes/ctr/ctr_setiv.c index 50c653987..cd7cb2abb 100644 --- a/src/modes/ctr/ctr_setiv.c +++ b/src/modes/ctr/ctr_setiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ctr/ctr_start.c b/src/modes/ctr/ctr_start.c index 8544636a7..4a0ce9d72 100644 --- a/src/modes/ctr/ctr_start.c +++ b/src/modes/ctr/ctr_start.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ctr/ctr_test.c b/src/modes/ctr/ctr_test.c index 6c97174f2..79dac6111 100644 --- a/src/modes/ctr/ctr_test.c +++ b/src/modes/ctr/ctr_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ecb/ecb_decrypt.c b/src/modes/ecb/ecb_decrypt.c index 84842c20f..c28679deb 100644 --- a/src/modes/ecb/ecb_decrypt.c +++ b/src/modes/ecb/ecb_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ecb/ecb_done.c b/src/modes/ecb/ecb_done.c index 9199eaeea..d9652329b 100644 --- a/src/modes/ecb/ecb_done.c +++ b/src/modes/ecb/ecb_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ecb/ecb_encrypt.c b/src/modes/ecb/ecb_encrypt.c index 801e0fdb6..0cbeddd8c 100644 --- a/src/modes/ecb/ecb_encrypt.c +++ b/src/modes/ecb/ecb_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ecb/ecb_start.c b/src/modes/ecb/ecb_start.c index 67061cae1..509148062 100644 --- a/src/modes/ecb/ecb_start.c +++ b/src/modes/ecb/ecb_start.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/f8/f8_decrypt.c b/src/modes/f8/f8_decrypt.c index 6279eee05..49fadc4f1 100644 --- a/src/modes/f8/f8_decrypt.c +++ b/src/modes/f8/f8_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/f8/f8_done.c b/src/modes/f8/f8_done.c index 6173a0a8c..f2fdf2b2c 100644 --- a/src/modes/f8/f8_done.c +++ b/src/modes/f8/f8_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/f8/f8_encrypt.c b/src/modes/f8/f8_encrypt.c index 207063a98..cb229962e 100644 --- a/src/modes/f8/f8_encrypt.c +++ b/src/modes/f8/f8_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/f8/f8_getiv.c b/src/modes/f8/f8_getiv.c index ff7cb9105..68e562d9f 100644 --- a/src/modes/f8/f8_getiv.c +++ b/src/modes/f8/f8_getiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/f8/f8_setiv.c b/src/modes/f8/f8_setiv.c index 5d2cb88c7..278da03e5 100644 --- a/src/modes/f8/f8_setiv.c +++ b/src/modes/f8/f8_setiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/f8/f8_start.c b/src/modes/f8/f8_start.c index f4543673d..13809c4b7 100644 --- a/src/modes/f8/f8_start.c +++ b/src/modes/f8/f8_start.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/f8/f8_test_mode.c b/src/modes/f8/f8_test_mode.c index 39f549661..a1b225d14 100644 --- a/src/modes/f8/f8_test_mode.c +++ b/src/modes/f8/f8_test_mode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/lrw/lrw_decrypt.c b/src/modes/lrw/lrw_decrypt.c index e2858c04b..0c75fe320 100644 --- a/src/modes/lrw/lrw_decrypt.c +++ b/src/modes/lrw/lrw_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/lrw/lrw_done.c b/src/modes/lrw/lrw_done.c index ce51f636a..a8018ca28 100644 --- a/src/modes/lrw/lrw_done.c +++ b/src/modes/lrw/lrw_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/lrw/lrw_encrypt.c b/src/modes/lrw/lrw_encrypt.c index 16833309f..21df206d2 100644 --- a/src/modes/lrw/lrw_encrypt.c +++ b/src/modes/lrw/lrw_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/lrw/lrw_getiv.c b/src/modes/lrw/lrw_getiv.c index 575e3224f..2c54ad600 100644 --- a/src/modes/lrw/lrw_getiv.c +++ b/src/modes/lrw/lrw_getiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/lrw/lrw_process.c b/src/modes/lrw/lrw_process.c index 321f7c1d0..43f158ef1 100644 --- a/src/modes/lrw/lrw_process.c +++ b/src/modes/lrw/lrw_process.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/lrw/lrw_setiv.c b/src/modes/lrw/lrw_setiv.c index 121086a4a..66402a439 100644 --- a/src/modes/lrw/lrw_setiv.c +++ b/src/modes/lrw/lrw_setiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/lrw/lrw_start.c b/src/modes/lrw/lrw_start.c index fc052db71..29ffc7e9f 100644 --- a/src/modes/lrw/lrw_start.c +++ b/src/modes/lrw/lrw_start.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/lrw/lrw_test.c b/src/modes/lrw/lrw_test.c index 0abde9877..0652a9f86 100644 --- a/src/modes/lrw/lrw_test.c +++ b/src/modes/lrw/lrw_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ofb/ofb_decrypt.c b/src/modes/ofb/ofb_decrypt.c index b741887a3..b59d56e77 100644 --- a/src/modes/ofb/ofb_decrypt.c +++ b/src/modes/ofb/ofb_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ofb/ofb_done.c b/src/modes/ofb/ofb_done.c index 412b4d1f7..297525319 100644 --- a/src/modes/ofb/ofb_done.c +++ b/src/modes/ofb/ofb_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ofb/ofb_encrypt.c b/src/modes/ofb/ofb_encrypt.c index f32fd3941..7116a008a 100644 --- a/src/modes/ofb/ofb_encrypt.c +++ b/src/modes/ofb/ofb_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ofb/ofb_getiv.c b/src/modes/ofb/ofb_getiv.c index c009e330f..15fd11e7a 100644 --- a/src/modes/ofb/ofb_getiv.c +++ b/src/modes/ofb/ofb_getiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ofb/ofb_setiv.c b/src/modes/ofb/ofb_setiv.c index 77a96add9..d157e46d6 100644 --- a/src/modes/ofb/ofb_setiv.c +++ b/src/modes/ofb/ofb_setiv.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/ofb/ofb_start.c b/src/modes/ofb/ofb_start.c index f701d69af..f780ee8f6 100644 --- a/src/modes/ofb/ofb_start.c +++ b/src/modes/ofb/ofb_start.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index 47476d5fb..8da3895ad 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/xts/xts_done.c b/src/modes/xts/xts_done.c index fbb163a44..d7721f8cf 100644 --- a/src/modes/xts/xts_done.c +++ b/src/modes/xts/xts_done.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index 1b3899483..6ab6aa172 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/xts/xts_init.c b/src/modes/xts/xts_init.c index 687596e46..fe6707e20 100644 --- a/src/modes/xts/xts_init.c +++ b/src/modes/xts/xts_init.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/xts/xts_mult_x.c b/src/modes/xts/xts_mult_x.c index c1eecef2f..0113473a9 100644 --- a/src/modes/xts/xts_mult_x.c +++ b/src/modes/xts/xts_mult_x.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index 87c82b5b3..dd679e3c9 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/bit/der_decode_bit_string.c b/src/pk/asn1/der/bit/der_decode_bit_string.c index 05d19cb64..afa43910e 100644 --- a/src/pk/asn1/der/bit/der_decode_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_bit_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index a4a3cb306..cbfe741f4 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/bit/der_encode_bit_string.c b/src/pk/asn1/der/bit/der_encode_bit_string.c index e64bd1fec..03f01baa3 100644 --- a/src/pk/asn1/der/bit/der_encode_bit_string.c +++ b/src/pk/asn1/der/bit/der_encode_bit_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c index 014a037fe..66a3b8242 100644 --- a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/bit/der_length_bit_string.c b/src/pk/asn1/der/bit/der_length_bit_string.c index 45472e9e1..fd973b4ac 100644 --- a/src/pk/asn1/der/bit/der_length_bit_string.c +++ b/src/pk/asn1/der/bit/der_length_bit_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/boolean/der_decode_boolean.c b/src/pk/asn1/der/boolean/der_decode_boolean.c index 4e25012a6..b8e4f08e9 100644 --- a/src/pk/asn1/der/boolean/der_decode_boolean.c +++ b/src/pk/asn1/der/boolean/der_decode_boolean.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/boolean/der_encode_boolean.c b/src/pk/asn1/der/boolean/der_encode_boolean.c index 48e9090ec..d6dc6afc5 100644 --- a/src/pk/asn1/der/boolean/der_encode_boolean.c +++ b/src/pk/asn1/der/boolean/der_encode_boolean.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/boolean/der_length_boolean.c b/src/pk/asn1/der/boolean/der_length_boolean.c index fa1906449..2d434861f 100644 --- a/src/pk/asn1/der/boolean/der_length_boolean.c +++ b/src/pk/asn1/der/boolean/der_length_boolean.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/choice/der_decode_choice.c b/src/pk/asn1/der/choice/der_decode_choice.c index eb715130a..07c56e3e9 100644 --- a/src/pk/asn1/der/choice/der_decode_choice.c +++ b/src/pk/asn1/der/choice/der_decode_choice.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c index f8997ee91..507c72e39 100644 --- a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c index b2198d92e..58e6d2703 100644 --- a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c index e5abf9f4a..b7849be86 100644 --- a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/ia5/der_decode_ia5_string.c b/src/pk/asn1/der/ia5/der_decode_ia5_string.c index 4699e3110..23bd4ae77 100644 --- a/src/pk/asn1/der/ia5/der_decode_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_decode_ia5_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/ia5/der_encode_ia5_string.c b/src/pk/asn1/der/ia5/der_encode_ia5_string.c index 42b3f58e0..9fca2cf94 100644 --- a/src/pk/asn1/der/ia5/der_encode_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_encode_ia5_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/ia5/der_length_ia5_string.c b/src/pk/asn1/der/ia5/der_length_ia5_string.c index 04debaf07..959d27d0d 100644 --- a/src/pk/asn1/der/ia5/der_length_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_length_ia5_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/integer/der_decode_integer.c b/src/pk/asn1/der/integer/der_decode_integer.c index 768e28a4a..848dba24f 100644 --- a/src/pk/asn1/der/integer/der_decode_integer.c +++ b/src/pk/asn1/der/integer/der_decode_integer.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/integer/der_encode_integer.c b/src/pk/asn1/der/integer/der_encode_integer.c index 544bfb07d..4f471eb46 100644 --- a/src/pk/asn1/der/integer/der_encode_integer.c +++ b/src/pk/asn1/der/integer/der_encode_integer.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/integer/der_length_integer.c b/src/pk/asn1/der/integer/der_length_integer.c index 61584f7dc..446f5e84b 100644 --- a/src/pk/asn1/der/integer/der_length_integer.c +++ b/src/pk/asn1/der/integer/der_length_integer.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c b/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c index 47547f0fd..34f6ee31b 100644 --- a/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c b/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c index ccecd9859..ea982ae75 100644 --- a/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/object_identifier/der_length_object_identifier.c b/src/pk/asn1/der/object_identifier/der_length_object_identifier.c index 3b6826a20..2b7bbcb71 100644 --- a/src/pk/asn1/der/object_identifier/der_length_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_length_object_identifier.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/octet/der_decode_octet_string.c b/src/pk/asn1/der/octet/der_decode_octet_string.c index a656b256e..0220c5f79 100644 --- a/src/pk/asn1/der/octet/der_decode_octet_string.c +++ b/src/pk/asn1/der/octet/der_decode_octet_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/octet/der_encode_octet_string.c b/src/pk/asn1/der/octet/der_encode_octet_string.c index 23d337dc4..f10bb1bb9 100644 --- a/src/pk/asn1/der/octet/der_encode_octet_string.c +++ b/src/pk/asn1/der/octet/der_encode_octet_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/octet/der_length_octet_string.c b/src/pk/asn1/der/octet/der_length_octet_string.c index 6e37ca7ed..b2d283c24 100644 --- a/src/pk/asn1/der/octet/der_length_octet_string.c +++ b/src/pk/asn1/der/octet/der_length_octet_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/printable_string/der_decode_printable_string.c b/src/pk/asn1/der/printable_string/der_decode_printable_string.c index 726387d76..9e1876b90 100644 --- a/src/pk/asn1/der/printable_string/der_decode_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_decode_printable_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/printable_string/der_encode_printable_string.c b/src/pk/asn1/der/printable_string/der_encode_printable_string.c index 21fa511d8..f2897deb4 100644 --- a/src/pk/asn1/der/printable_string/der_encode_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_encode_printable_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/printable_string/der_length_printable_string.c b/src/pk/asn1/der/printable_string/der_length_printable_string.c index 64d960892..0d2f38564 100644 --- a/src/pk/asn1/der/printable_string/der_length_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_length_printable_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 26e0e7120..b41a16893 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index d76f4036e..0724e4bc7 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index ba2341277..29ab5536a 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index e7332073b..519837cfe 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index 3bd76bfc0..02c30d9b3 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" #include diff --git a/src/pk/asn1/der/sequence/der_length_sequence.c b/src/pk/asn1/der/sequence/der_length_sequence.c index 99e427a39..d8a7457d3 100644 --- a/src/pk/asn1/der/sequence/der_length_sequence.c +++ b/src/pk/asn1/der/sequence/der_length_sequence.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/sequence/der_sequence_free.c b/src/pk/asn1/der/sequence/der_sequence_free.c index 4600d5f04..ca0771173 100644 --- a/src/pk/asn1/der/sequence/der_sequence_free.c +++ b/src/pk/asn1/der/sequence/der_sequence_free.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/sequence/der_sequence_shrink.c b/src/pk/asn1/der/sequence/der_sequence_shrink.c index 227576dc5..b5db2fcaa 100644 --- a/src/pk/asn1/der/sequence/der_sequence_shrink.c +++ b/src/pk/asn1/der/sequence/der_sequence_shrink.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/set/der_encode_setof.c b/src/pk/asn1/der/set/der_encode_setof.c index d4001f913..182846dc5 100644 --- a/src/pk/asn1/der/set/der_encode_setof.c +++ b/src/pk/asn1/der/set/der_encode_setof.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/short_integer/der_decode_short_integer.c b/src/pk/asn1/der/short_integer/der_decode_short_integer.c index a1747400f..5a52fec58 100644 --- a/src/pk/asn1/der/short_integer/der_decode_short_integer.c +++ b/src/pk/asn1/der/short_integer/der_decode_short_integer.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/short_integer/der_encode_short_integer.c b/src/pk/asn1/der/short_integer/der_encode_short_integer.c index 7b4f527b1..1cb59e199 100644 --- a/src/pk/asn1/der/short_integer/der_encode_short_integer.c +++ b/src/pk/asn1/der/short_integer/der_encode_short_integer.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/short_integer/der_length_short_integer.c b/src/pk/asn1/der/short_integer/der_length_short_integer.c index f248e64c8..836e13e33 100644 --- a/src/pk/asn1/der/short_integer/der_length_short_integer.c +++ b/src/pk/asn1/der/short_integer/der_length_short_integer.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c b/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c index b935745b0..cb8467f9f 100644 --- a/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c +++ b/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/teletex_string/der_length_teletex_string.c b/src/pk/asn1/der/teletex_string/der_length_teletex_string.c index b5ae8b4e4..8cbae2dfe 100644 --- a/src/pk/asn1/der/teletex_string/der_length_teletex_string.c +++ b/src/pk/asn1/der/teletex_string/der_length_teletex_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/utctime/der_decode_utctime.c b/src/pk/asn1/der/utctime/der_decode_utctime.c index d4dc817b1..97d28affd 100644 --- a/src/pk/asn1/der/utctime/der_decode_utctime.c +++ b/src/pk/asn1/der/utctime/der_decode_utctime.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/utctime/der_encode_utctime.c b/src/pk/asn1/der/utctime/der_encode_utctime.c index 92fffe5ed..23b26eba1 100644 --- a/src/pk/asn1/der/utctime/der_encode_utctime.c +++ b/src/pk/asn1/der/utctime/der_encode_utctime.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/utctime/der_length_utctime.c b/src/pk/asn1/der/utctime/der_length_utctime.c index e33c4f33a..5a1e02723 100644 --- a/src/pk/asn1/der/utctime/der_length_utctime.c +++ b/src/pk/asn1/der/utctime/der_length_utctime.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/utf8/der_decode_utf8_string.c b/src/pk/asn1/der/utf8/der_decode_utf8_string.c index d67362ae2..037579a81 100644 --- a/src/pk/asn1/der/utf8/der_decode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_decode_utf8_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/utf8/der_encode_utf8_string.c b/src/pk/asn1/der/utf8/der_encode_utf8_string.c index ef0e6eba7..0fb19699c 100644 --- a/src/pk/asn1/der/utf8/der_encode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_encode_utf8_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index 2bab44559..e5413d02c 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_decrypt_key.c b/src/pk/dsa/dsa_decrypt_key.c index 25a9db01b..7d2a4a68e 100644 --- a/src/pk/dsa/dsa_decrypt_key.c +++ b/src/pk/dsa/dsa_decrypt_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_encrypt_key.c b/src/pk/dsa/dsa_encrypt_key.c index a7e9ed2bc..9d0af7e01 100644 --- a/src/pk/dsa/dsa_encrypt_key.c +++ b/src/pk/dsa/dsa_encrypt_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_export.c b/src/pk/dsa/dsa_export.c index 60e8b6f66..7b34b1e01 100644 --- a/src/pk/dsa/dsa_export.c +++ b/src/pk/dsa/dsa_export.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_free.c b/src/pk/dsa/dsa_free.c index 5f5ce7244..afc128dd7 100644 --- a/src/pk/dsa/dsa_free.c +++ b/src/pk/dsa/dsa_free.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index ca522c7bc..50b8ff1c2 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_import_radix.c b/src/pk/dsa/dsa_import_radix.c index 03e1ba789..3034e9b39 100755 --- a/src/pk/dsa/dsa_import_radix.c +++ b/src/pk/dsa/dsa_import_radix.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 52b0affbe..fbd522652 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_shared_secret.c b/src/pk/dsa/dsa_shared_secret.c index 8ae9d4de3..126c7866a 100644 --- a/src/pk/dsa/dsa_shared_secret.c +++ b/src/pk/dsa/dsa_shared_secret.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_sign_hash.c b/src/pk/dsa/dsa_sign_hash.c index c9da8cf72..cbff27af2 100644 --- a/src/pk/dsa/dsa_sign_hash.c +++ b/src/pk/dsa/dsa_sign_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index 7df472c04..5235bbbdd 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index 5afdb3b35..bb239cdcb 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/ecc/ecc.c b/src/pk/ecc/ecc.c index 3cef4d309..efa806017 100644 --- a/src/pk/ecc/ecc.c +++ b/src/pk/ecc/ecc.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_ansi_x963_export.c b/src/pk/ecc/ecc_ansi_x963_export.c index e834c950f..54b99afb5 100644 --- a/src/pk/ecc/ecc_ansi_x963_export.c +++ b/src/pk/ecc/ecc_ansi_x963_export.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_ansi_x963_import.c b/src/pk/ecc/ecc_ansi_x963_import.c index 3c70dc896..97af00f8f 100644 --- a/src/pk/ecc/ecc_ansi_x963_import.c +++ b/src/pk/ecc/ecc_ansi_x963_import.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_decrypt_key.c b/src/pk/ecc/ecc_decrypt_key.c index 1d292912b..8c2189032 100644 --- a/src/pk/ecc/ecc_decrypt_key.c +++ b/src/pk/ecc/ecc_decrypt_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_encrypt_key.c b/src/pk/ecc/ecc_encrypt_key.c index b46986b69..9649473b7 100644 --- a/src/pk/ecc/ecc_encrypt_key.c +++ b/src/pk/ecc/ecc_encrypt_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_export.c b/src/pk/ecc/ecc_export.c index 51c9bf20b..9089a3acd 100644 --- a/src/pk/ecc/ecc_export.c +++ b/src/pk/ecc/ecc_export.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_free.c b/src/pk/ecc/ecc_free.c index 8e8455bfa..588defb8b 100644 --- a/src/pk/ecc/ecc_free.c +++ b/src/pk/ecc/ecc_free.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_get_size.c b/src/pk/ecc/ecc_get_size.c index b01b81318..bf43fb536 100644 --- a/src/pk/ecc/ecc_get_size.c +++ b/src/pk/ecc/ecc_get_size.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index e40865aaf..3bd0d75df 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_make_key.c b/src/pk/ecc/ecc_make_key.c index 7dc44f91d..19b90a757 100644 --- a/src/pk/ecc/ecc_make_key.c +++ b/src/pk/ecc/ecc_make_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_shared_secret.c b/src/pk/ecc/ecc_shared_secret.c index 5215fc96a..38be8bf2b 100644 --- a/src/pk/ecc/ecc_shared_secret.c +++ b/src/pk/ecc/ecc_shared_secret.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index 4b8d4b2bc..b9e178ecb 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_sizes.c b/src/pk/ecc/ecc_sizes.c index eb3a3775e..bb9d6d90c 100644 --- a/src/pk/ecc/ecc_sizes.c +++ b/src/pk/ecc/ecc_sizes.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_test.c b/src/pk/ecc/ecc_test.c index e371da981..96f2a87f8 100644 --- a/src/pk/ecc/ecc_test.c +++ b/src/pk/ecc/ecc_test.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ecc_verify_hash.c b/src/pk/ecc/ecc_verify_hash.c index cd9f65aa0..ff1d66c71 100644 --- a/src/pk/ecc/ecc_verify_hash.c +++ b/src/pk/ecc/ecc_verify_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ltc_ecc_is_valid_idx.c b/src/pk/ecc/ltc_ecc_is_valid_idx.c index 2e9d8f2ee..65c3ae7b2 100644 --- a/src/pk/ecc/ltc_ecc_is_valid_idx.c +++ b/src/pk/ecc/ltc_ecc_is_valid_idx.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ltc_ecc_map.c b/src/pk/ecc/ltc_ecc_map.c index c6ec9b547..cdde5ecc2 100644 --- a/src/pk/ecc/ltc_ecc_map.c +++ b/src/pk/ecc/ltc_ecc_map.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ltc_ecc_mul2add.c b/src/pk/ecc/ltc_ecc_mul2add.c index 73e8217cc..3720ecbc9 100644 --- a/src/pk/ecc/ltc_ecc_mul2add.c +++ b/src/pk/ecc/ltc_ecc_mul2add.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ltc_ecc_mulmod.c b/src/pk/ecc/ltc_ecc_mulmod.c index a0ca6ceb7..e20e28579 100644 --- a/src/pk/ecc/ltc_ecc_mulmod.c +++ b/src/pk/ecc/ltc_ecc_mulmod.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ltc_ecc_mulmod_timing.c b/src/pk/ecc/ltc_ecc_mulmod_timing.c index 70182a3ca..6fa7030b0 100644 --- a/src/pk/ecc/ltc_ecc_mulmod_timing.c +++ b/src/pk/ecc/ltc_ecc_mulmod_timing.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ltc_ecc_points.c b/src/pk/ecc/ltc_ecc_points.c index df38c1909..2955e399f 100644 --- a/src/pk/ecc/ltc_ecc_points.c +++ b/src/pk/ecc/ltc_ecc_points.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ltc_ecc_projective_add_point.c b/src/pk/ecc/ltc_ecc_projective_add_point.c index aa257db83..9c8a63012 100644 --- a/src/pk/ecc/ltc_ecc_projective_add_point.c +++ b/src/pk/ecc/ltc_ecc_projective_add_point.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/ecc/ltc_ecc_projective_dbl_point.c b/src/pk/ecc/ltc_ecc_projective_dbl_point.c index c4920705a..058f9dd82 100644 --- a/src/pk/ecc/ltc_ecc_projective_dbl_point.c +++ b/src/pk/ecc/ltc_ecc_projective_dbl_point.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b diff --git a/src/pk/katja/katja_decrypt_key.c b/src/pk/katja/katja_decrypt_key.c index aae323d42..bd44b9951 100644 --- a/src/pk/katja/katja_decrypt_key.c +++ b/src/pk/katja/katja_decrypt_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/katja/katja_encrypt_key.c b/src/pk/katja/katja_encrypt_key.c index 12ca1e2e6..2b4dddcab 100644 --- a/src/pk/katja/katja_encrypt_key.c +++ b/src/pk/katja/katja_encrypt_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/katja/katja_export.c b/src/pk/katja/katja_export.c index 2e0e7d3ae..9e0fa3d41 100644 --- a/src/pk/katja/katja_export.c +++ b/src/pk/katja/katja_export.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/katja/katja_exptmod.c b/src/pk/katja/katja_exptmod.c index c70eec90f..284091c71 100644 --- a/src/pk/katja/katja_exptmod.c +++ b/src/pk/katja/katja_exptmod.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/katja/katja_free.c b/src/pk/katja/katja_free.c index 4f0b69822..1a356a1bc 100644 --- a/src/pk/katja/katja_free.c +++ b/src/pk/katja/katja_free.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/katja/katja_import.c b/src/pk/katja/katja_import.c index c30686781..8eba7e570 100644 --- a/src/pk/katja/katja_import.c +++ b/src/pk/katja/katja_import.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/katja/katja_make_key.c b/src/pk/katja/katja_make_key.c index d592eac98..724ff0bc5 100644 --- a/src/pk/katja/katja_make_key.c +++ b/src/pk/katja/katja_make_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_i2osp.c b/src/pk/pkcs1/pkcs_1_i2osp.c index b4cb4feff..97a90fd71 100644 --- a/src/pk/pkcs1/pkcs_1_i2osp.c +++ b/src/pk/pkcs1/pkcs_1_i2osp.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_mgf1.c b/src/pk/pkcs1/pkcs_1_mgf1.c index a063128e1..3b5cce4dd 100644 --- a/src/pk/pkcs1/pkcs_1_mgf1.c +++ b/src/pk/pkcs1/pkcs_1_mgf1.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_oaep_decode.c b/src/pk/pkcs1/pkcs_1_oaep_decode.c index 469e3e114..6a2422beb 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_oaep_encode.c b/src/pk/pkcs1/pkcs_1_oaep_encode.c index fb215a175..363116a57 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_encode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_encode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_os2ip.c b/src/pk/pkcs1/pkcs_1_os2ip.c index 5fe97eaea..3163eface 100644 --- a/src/pk/pkcs1/pkcs_1_os2ip.c +++ b/src/pk/pkcs1/pkcs_1_os2ip.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_pss_decode.c b/src/pk/pkcs1/pkcs_1_pss_decode.c index 0fdf9262d..cf6546007 100644 --- a/src/pk/pkcs1/pkcs_1_pss_decode.c +++ b/src/pk/pkcs1/pkcs_1_pss_decode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_pss_encode.c b/src/pk/pkcs1/pkcs_1_pss_encode.c index 7766c7794..94f834f73 100644 --- a/src/pk/pkcs1/pkcs_1_pss_encode.c +++ b/src/pk/pkcs1/pkcs_1_pss_encode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_v1_5_decode.c b/src/pk/pkcs1/pkcs_1_v1_5_decode.c index 34bb434a0..3f3ecf986 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_decode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_decode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/pkcs1/pkcs_1_v1_5_encode.c b/src/pk/pkcs1/pkcs_1_v1_5_encode.c index ec932c3ef..6212e52d8 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_encode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_encode.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_decrypt_key.c b/src/pk/rsa/rsa_decrypt_key.c index 1f322ca53..51117a892 100644 --- a/src/pk/rsa/rsa_decrypt_key.c +++ b/src/pk/rsa/rsa_decrypt_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_encrypt_key.c b/src/pk/rsa/rsa_encrypt_key.c index 4d6c24bdd..9ea2b7124 100644 --- a/src/pk/rsa/rsa_encrypt_key.c +++ b/src/pk/rsa/rsa_encrypt_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_export.c b/src/pk/rsa/rsa_export.c index f869ff63e..6609361a5 100644 --- a/src/pk/rsa/rsa_export.c +++ b/src/pk/rsa/rsa_export.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 714bc52bb..781c20698 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -6,8 +6,6 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org - * * Added RSA blinding --nmav */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_free.c b/src/pk/rsa/rsa_free.c index 57da74c1f..eb7a3aefc 100644 --- a/src/pk/rsa/rsa_free.c +++ b/src/pk/rsa/rsa_free.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index efd5afbfb..b915f2aec 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_import_pkcs8.c b/src/pk/rsa/rsa_import_pkcs8.c index 78d34586a..daae08df5 100755 --- a/src/pk/rsa/rsa_import_pkcs8.c +++ b/src/pk/rsa/rsa_import_pkcs8.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_import_radix.c b/src/pk/rsa/rsa_import_radix.c index d9d4ec7ae..4ec103880 100755 --- a/src/pk/rsa/rsa_import_radix.c +++ b/src/pk/rsa/rsa_import_radix.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_import_x509.c b/src/pk/rsa/rsa_import_x509.c index 45da7c75c..c3b35376f 100644 --- a/src/pk/rsa/rsa_import_x509.c +++ b/src/pk/rsa/rsa_import_x509.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_make_key.c b/src/pk/rsa/rsa_make_key.c index 454d20b8a..175a1151a 100644 --- a/src/pk/rsa/rsa_make_key.c +++ b/src/pk/rsa/rsa_make_key.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_sign_hash.c b/src/pk/rsa/rsa_sign_hash.c index b7baaf92e..6b99beb4c 100644 --- a/src/pk/rsa/rsa_sign_hash.c +++ b/src/pk/rsa/rsa_sign_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index c6529f9b0..6ddbc91eb 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/stream/sober128/sober128.c b/src/stream/sober128/sober128.c index e4b30c354..49de7d7cc 100644 --- a/src/stream/sober128/sober128.c +++ b/src/stream/sober128/sober128.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" From fb35d5be54858a0d906427ca05d8bc874881377c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 17 Jun 2017 13:18:47 +0200 Subject: [PATCH 0872/1192] more clean-up of headers --- src/hashes/whirl/whirltab.c | 9 +++++++++ src/math/rand_bn.c | 1 - src/misc/compare_testvector.c | 1 - src/misc/hkdf/hkdf.c | 9 +++++++++ src/misc/pk_get_oid.c | 3 +-- .../der/sequence/der_decode_subject_public_key_info.c | 1 - .../der/sequence/der_encode_subject_public_key_info.c | 1 - src/pk/asn1/der/set/der_encode_set.c | 2 -- src/pk/rsa/rsa_exptmod.c | 3 +-- src/pk/rsa/rsa_get_size.c | 2 -- src/pk/rsa/rsa_sign_saltlen_get.c | 2 -- src/stream/sober128/sober128tab.c | 9 +++++++++ 12 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/hashes/whirl/whirltab.c b/src/hashes/whirl/whirltab.c index bb4b77ab2..3e6f74742 100644 --- a/src/hashes/whirl/whirltab.c +++ b/src/hashes/whirl/whirltab.c @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /** @file whirltab.c LTC_WHIRLPOOL tables, Tom St Denis diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c index e7bddd9fb..5bc85eeee 100755 --- a/src/math/rand_bn.c +++ b/src/math/rand_bn.c @@ -5,7 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * */ #include "tomcrypt.h" diff --git a/src/misc/compare_testvector.c b/src/misc/compare_testvector.c index 64e4e63f7..24639a088 100644 --- a/src/misc/compare_testvector.c +++ b/src/misc/compare_testvector.c @@ -5,7 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * */ #include "tomcrypt.h" diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index c4d69d1dd..fd31c7d12 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + #include #include #include diff --git a/src/misc/pk_get_oid.c b/src/misc/pk_get_oid.c index 7d3a186c0..e25bccbd5 100644 --- a/src/misc/pk_get_oid.c +++ b/src/misc/pk_get_oid.c @@ -1,11 +1,10 @@ -/* LibTomCrypt, modular cryptographic library +/* LibTomCrypt, modular cryptographic library -- Tom St Denis * * LibTomCrypt is a library that provides various cryptographic * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express * guarantee it works. - * */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 61d6f1fee..561dba29f 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -5,7 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * */ #include "tomcrypt.h" /** diff --git a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c index 0578d5348..a129acd4d 100644 --- a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c @@ -5,7 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * */ #include "tomcrypt.h" diff --git a/src/pk/asn1/der/set/der_encode_set.c b/src/pk/asn1/der/set/der_encode_set.c index 75de23452..e0e802260 100644 --- a/src/pk/asn1/der/set/der_encode_set.c +++ b/src/pk/asn1/der/set/der_encode_set.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 781c20698..2b3b4a8d9 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -5,14 +5,13 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Added RSA blinding --nmav */ #include "tomcrypt.h" /** @file rsa_exptmod.c RSA PKCS exptmod, Tom St Denis + Added RSA blinding --nmav */ #ifdef LTC_MRSA diff --git a/src/pk/rsa/rsa_get_size.c b/src/pk/rsa/rsa_get_size.c index dfc82b079..1ed74a7bb 100644 --- a/src/pk/rsa/rsa_get_size.c +++ b/src/pk/rsa/rsa_get_size.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * http://libtom.org */ #include "tomcrypt.h" diff --git a/src/pk/rsa/rsa_sign_saltlen_get.c b/src/pk/rsa/rsa_sign_saltlen_get.c index 9f5cadb8c..0558775ef 100644 --- a/src/pk/rsa/rsa_sign_saltlen_get.c +++ b/src/pk/rsa/rsa_sign_saltlen_get.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * http://libtom.org */ #include "tomcrypt.h" diff --git a/src/stream/sober128/sober128tab.c b/src/stream/sober128/sober128tab.c index 74e4f8808..6d45049aa 100644 --- a/src/stream/sober128/sober128tab.c +++ b/src/stream/sober128/sober128tab.c @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /** @file sober128tab.c SOBER-128 Tables From 66527b3e5e201c7e907edc8fd71da4ba5ff575e0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 17 Jun 2017 13:23:56 +0200 Subject: [PATCH 0873/1192] include "tomcrypt.h", not we want to include the local version of the header, not the system-version --- src/ciphers/rc2.c | 2 +- src/ciphers/safer/safer.c | 2 +- src/misc/hkdf/hkdf.c | 2 +- src/misc/pkcs5/pkcs_5_1.c | 2 +- src/misc/pkcs5/pkcs_5_2.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index d86ac735e..711c596e1 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -16,7 +16,7 @@ * Thanks to CodeView, SoftIce, and D86 for helping bring this code to * * the public. * \**********************************************************************/ -#include +#include "tomcrypt.h" /** @file rc2.c diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index f24457e4d..7014fc312 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -26,7 +26,7 @@ * *******************************************************************************/ -#include +#include "tomcrypt.h" #ifdef LTC_SAFER diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index fd31c7d12..2d848560c 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -11,7 +11,7 @@ #include #include -#include +#include "tomcrypt.h" #ifdef LTC_HKDF diff --git a/src/misc/pkcs5/pkcs_5_1.c b/src/misc/pkcs5/pkcs_5_1.c index b49174041..4c294c709 100644 --- a/src/misc/pkcs5/pkcs_5_1.c +++ b/src/misc/pkcs5/pkcs_5_1.c @@ -6,7 +6,7 @@ * The library is free for all purposes without any express * guarantee it works. */ -#include +#include "tomcrypt.h" /** @file pkcs_5_1.c diff --git a/src/misc/pkcs5/pkcs_5_2.c b/src/misc/pkcs5/pkcs_5_2.c index ab69b8393..1a96c38ea 100644 --- a/src/misc/pkcs5/pkcs_5_2.c +++ b/src/misc/pkcs5/pkcs_5_2.c @@ -6,7 +6,7 @@ * The library is free for all purposes without any express * guarantee it works. */ -#include +#include "tomcrypt.h" /** @file pkcs_5_2.c From b16066cbfc233d248edf54e2d1426ceb4af711da Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 19 Jun 2017 10:34:02 +0200 Subject: [PATCH 0874/1192] Add possibility to change install options This closes #231 --- makefile_include.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index 08086f509..3d7a02102 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -357,11 +357,12 @@ doc/crypt.pdf: install_all: install install_bins install_docs install_test +INSTALL_OPTS ?= -m 644 .common_install: $(LIBNAME) install -d $(INCPATH) install -d $(LIBPATH) - $(INSTALL_CMD) -m 644 $(LIBNAME) $(LIBPATH)/$(LIBNAME) + $(INSTALL_CMD) $(INSTALL_OPTS) $(LIBNAME) $(LIBPATH)/$(LIBNAME) install -m 644 $(HEADERS) $(INCPATH) .common_install_bins: $(USEFUL_DEMOS) From 7597d20c7872f195c7523ec6483ba1b7a1877ee1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 19 Jun 2017 11:51:40 +0200 Subject: [PATCH 0875/1192] use CROSS_COMPILE instead of PREFIX to indicate toolchain prefix --- makefile | 2 +- makefile_include.mk | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 92e1384da..f0a5b688e 100644 --- a/makefile +++ b/makefile @@ -23,7 +23,7 @@ endif # ranlib tools ifndef RANLIB -RANLIB:=$(PREFIX)ranlib +RANLIB:=$(CROSS_COMPILE)ranlib endif INSTALL_CMD = install diff --git a/makefile_include.mk b/makefile_include.mk index 3d7a02102..23375d314 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -8,15 +8,15 @@ VERSION=1.17 VERSION_LT=0:117 # Compiler and Linker Names -ifndef PREFIX - PREFIX:= +ifndef CROSS_COMPILE + CROSS_COMPILE:= endif ifeq ($(CC),cc) - CC := $(PREFIX)gcc + CC := $(CROSS_COMPILE)gcc endif -LD:=$(PREFIX)ld -AR:=$(PREFIX)ar +LD:=$(CROSS_COMPILE)ld +AR:=$(CROSS_COMPILE)ar # Archiver [makes .a files] #AR=ar From 8c11490e2dd8c76064d92d7e498ee581b2957137 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 19 Jun 2017 12:20:37 +0200 Subject: [PATCH 0876/1192] fix usage of PREFIX vs. DESTDIR This closes #232 --- makefile.mingw | 26 +++++++++++++------------- makefile.msvc | 22 +++++++++++----------- makefile.shared | 4 ++-- makefile.unix | 21 +++++++++++---------- makefile_include.mk | 11 ++++++----- 5 files changed, 43 insertions(+), 41 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index afb745708..67b280284 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -7,7 +7,7 @@ # # gmake -f makefile.mingw all # test.exe -# gmake -f makefile.mingw DESTDIR=c:\devel\libtom install +# gmake -f makefile.mingw PREFIX=c:\devel\libtom install # #Or: # @@ -15,7 +15,7 @@ # #The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs -DESTDIR = c:\mingw +PREFIX = c:\mingw CC = gcc AR = ar ARFLAGS = r @@ -262,20 +262,20 @@ clean: #Install the library + headers install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) - cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" - cmd /c if not exist "$(DESTDIR)\lib" mkdir "$(DESTDIR)\lib" - cmd /c if not exist "$(DESTDIR)\include" mkdir "$(DESTDIR)\include" - copy /Y $(LIBMAIN_S) "$(DESTDIR)\lib" - copy /Y $(LIBMAIN_I) "$(DESTDIR)\lib" - copy /Y $(LIBMAIN_D) "$(DESTDIR)\bin" - copy /Y src\headers\tomcrypt*.h "$(DESTDIR)\include" + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" + cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" + copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" + copy /Y $(LIBMAIN_I) "$(PREFIX)\lib" + copy /Y $(LIBMAIN_D) "$(PREFIX)\bin" + copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include" #Install useful tools install_bins: hashsum - cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" - copy /Y hashsum.exe "$(DESTDIR)\bin" + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + copy /Y hashsum.exe "$(PREFIX)\bin" #Install documentation install_docs: doc/crypt.pdf - cmd /c if not exist "$(DESTDIR)\doc" mkdir "$(DESTDIR)\doc" - copy /Y doc\crypt.pdf "$(DESTDIR)\doc" + cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc" + copy /Y doc\crypt.pdf "$(PREFIX)\doc" diff --git a/makefile.msvc b/makefile.msvc index 404a5e82d..8395ed5f8 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -7,7 +7,7 @@ # # nmake -f makefile.msvc all # test.exe -# nmake -f makefile.msvc DESTDIR=c:\devel\libtom install +# nmake -f makefile.msvc PREFIX=c:\devel\libtom install # #Or: # @@ -15,7 +15,7 @@ # #The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs -DESTDIR = c:\devel +PREFIX = c:\devel CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath EXTRALIBS = ../libtommath/tommath.lib @@ -249,18 +249,18 @@ clean: #Install the library + headers install: $(LIBMAIN_S) - cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" - cmd /c if not exist "$(DESTDIR)\lib" mkdir "$(DESTDIR)\lib" - cmd /c if not exist "$(DESTDIR)\include" mkdir "$(DESTDIR)\include" - copy /Y $(LIBMAIN_S) "$(DESTDIR)\lib" - copy /Y src\headers\tomcrypt*.h "$(DESTDIR)\include" + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" + cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" + copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" + copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include" #Install useful tools install_bins: hashsum - cmd /c if not exist "$(DESTDIR)\bin" mkdir "$(DESTDIR)\bin" - copy /Y hashsum.exe "$(DESTDIR)\bin" + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + copy /Y hashsum.exe "$(PREFIX)\bin" #Install documentation install_docs: doc/crypt.pdf - cmd /c if not exist "$(DESTDIR)\doc" mkdir "$(DESTDIR)\doc" - copy /Y doc\crypt.pdf "$(DESTDIR)\doc" + cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc" + copy /Y doc\crypt.pdf "$(PREFIX)\doc" diff --git a/makefile.shared b/makefile.shared index a36e86e08..025ccde47 100644 --- a/makefile.shared +++ b/makefile.shared @@ -11,7 +11,7 @@ # # CFLAGS="-DUSE_LTM -DLTM_DESC -I/path/to/libtommath" make -f makefile.shared all EXTRALIBS=/path/to/libtommath/libtommath.a # ./test -# make -f makefile.shared DESTDIR=/opt/libtom install +# make -f makefile.shared PREFIX=/opt/libtom install # PLATFORM := $(shell uname | sed -e 's/_.*//') @@ -46,7 +46,7 @@ $(LIBNAME): $(OBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo" | LC_ALL=C sort` $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) install: .common_install - sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc + sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc install -d $(LIBPATH)/pkgconfig install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/ diff --git a/makefile.unix b/makefile.unix index 9676ecb79..452dcd7a9 100644 --- a/makefile.unix +++ b/makefile.unix @@ -15,7 +15,7 @@ # # make -f makefile.unix CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all # ./test -# make -f makefile.unix DESTDIR=/opt/libtom install +# make -f makefile.unix PREFIX=/opt/libtom install # #Or if you are using Intel C compiler you might need something like: # @@ -23,7 +23,8 @@ # #The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs" -DESTDIR = /usr/local +DESTDIR = +PREFIX = /usr/local CC = cc AR = ar ARFLAGS = r @@ -266,17 +267,17 @@ clean: #Install the library + headers install: $(LIBMAIN_S) $(HEADERS) - @mkdir -p $(DESTDIR)/include $(DESTDIR)/lib/pkgconfig - @cp $(LIBMAIN_S) $(DESTDIR)/lib/ - @cp $(HEADERS) $(DESTDIR)/include/ - @sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)/lib/pkgconfig/libtomcrypt.pc + @mkdir -p $(PREFIX)/include $(PREFIX)/lib/pkgconfig + @cp $(LIBMAIN_S) $(PREFIX)/lib/ + @cp $(HEADERS) $(PREFIX)/include/ + @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(PREFIX)/lib/pkgconfig/libtomcrypt.pc #Install useful tools install_bins: hashsum - @mkdir -p $(DESTDIR)/bin - @cp hashsum $(DESTDIR)/bin/ + @mkdir -p $(PREFIX)/bin + @cp hashsum $(PREFIX)/bin/ #Install documentation install_docs: doc/crypt.pdf - @mkdir -p $(DESTDIR)/share/doc/libtomcrypt/pdf - @cp doc/crypt.pdf $(DESTDIR)/share/doc/libtomcrypt/pdf/ + @mkdir -p $(PREFIX)/share/doc/libtomcrypt/pdf + @cp doc/crypt.pdf $(PREFIX)/share/doc/libtomcrypt/pdf/ diff --git a/makefile_include.mk b/makefile_include.mk index 23375d314..c82095cb7 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -130,11 +130,12 @@ TIMINGS=demos/timing.o #INCPATH The directory to install the header files for libtomcrypt. #DATAPATH The directory to install the pdf docs. #BINPATH The directory to install the binaries provided. -DESTDIR ?= /usr/local -LIBPATH ?= $(DESTDIR)/lib -INCPATH ?= $(DESTDIR)/include -DATAPATH ?= $(DESTDIR)/share/doc/libtomcrypt/pdf -BINPATH ?= $(DESTDIR)/bin +DESTDIR ?= +PREFIX ?= /usr/local +LIBPATH ?= $(DESTDIR)$(PREFIX)/lib +INCPATH ?= $(DESTDIR)$(PREFIX)/include +DATAPATH ?= $(DESTDIR)$(PREFIX)/share/doc/libtomcrypt/pdf +BINPATH ?= $(DESTDIR)$(PREFIX)/bin #Who do we install as? ifdef INSTALL_USER From fe19dad6233dcc6112ee37d8644cc86f7822a606 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 19 Jun 2017 13:43:49 +0200 Subject: [PATCH 0877/1192] replace SVN tags --- build.sh | 6 +++--- check_source.sh | 6 +++--- coverage.sh | 6 +++--- coverage_more.sh | 6 +++--- demos/constants.c | 6 +++--- demos/hashsum.c | 6 +++--- demos/ltcrypt.c | 6 +++--- demos/small.c | 6 +++--- demos/timing.c | 6 +++--- demos/tv_gen.c | 6 +++--- doc/crypt.tex | 6 +++--- doc/footer.html | 6 +++--- doc/header.html | 6 +++--- makefile.shared | 6 +++--- notes/etc/saferp_optimizer.c | 6 +++--- notes/etc/whirlgen.c | 6 +++--- notes/etc/whirltest.c | 6 +++--- run.sh | 6 +++--- src/ciphers/aes/aes.c | 6 +++--- src/ciphers/aes/aes_tab.c | 6 +++--- src/ciphers/anubis.c | 6 +++--- src/ciphers/blowfish.c | 6 +++--- src/ciphers/camellia.c | 6 +++--- src/ciphers/cast5.c | 6 +++--- src/ciphers/des.c | 6 +++--- src/ciphers/kasumi.c | 6 +++--- src/ciphers/khazad.c | 6 +++--- src/ciphers/kseed.c | 6 +++--- src/ciphers/multi2.c | 6 +++--- src/ciphers/noekeon.c | 6 +++--- src/ciphers/rc2.c | 6 +++--- src/ciphers/rc5.c | 6 +++--- src/ciphers/rc6.c | 6 +++--- src/ciphers/safer/safer.c | 6 +++--- src/ciphers/safer/safer_tab.c | 6 +++--- src/ciphers/safer/saferp.c | 6 +++--- src/ciphers/skipjack.c | 6 +++--- src/ciphers/twofish/twofish.c | 6 +++--- src/ciphers/twofish/twofish_tab.c | 6 +++--- src/ciphers/xtea.c | 6 +++--- src/encauth/ccm/ccm_memory.c | 6 +++--- src/encauth/ccm/ccm_test.c | 6 +++--- src/encauth/eax/eax_addheader.c | 6 +++--- src/encauth/eax/eax_decrypt.c | 6 +++--- src/encauth/eax/eax_decrypt_verify_memory.c | 6 +++--- src/encauth/eax/eax_done.c | 6 +++--- src/encauth/eax/eax_encrypt.c | 6 +++--- src/encauth/eax/eax_encrypt_authenticate_memory.c | 6 +++--- src/encauth/eax/eax_init.c | 6 +++--- src/encauth/eax/eax_test.c | 6 +++--- src/encauth/gcm/gcm_add_aad.c | 6 +++--- src/encauth/gcm/gcm_add_iv.c | 6 +++--- src/encauth/gcm/gcm_done.c | 6 +++--- src/encauth/gcm/gcm_gf_mult.c | 6 +++--- src/encauth/gcm/gcm_init.c | 6 +++--- src/encauth/gcm/gcm_memory.c | 6 +++--- src/encauth/gcm/gcm_mult_h.c | 6 +++--- src/encauth/gcm/gcm_process.c | 6 +++--- src/encauth/gcm/gcm_reset.c | 6 +++--- src/encauth/gcm/gcm_test.c | 6 +++--- src/encauth/ocb/ocb_decrypt.c | 6 +++--- src/encauth/ocb/ocb_decrypt_verify_memory.c | 6 +++--- src/encauth/ocb/ocb_done_decrypt.c | 6 +++--- src/encauth/ocb/ocb_done_encrypt.c | 6 +++--- src/encauth/ocb/ocb_encrypt.c | 6 +++--- src/encauth/ocb/ocb_encrypt_authenticate_memory.c | 6 +++--- src/encauth/ocb/ocb_init.c | 6 +++--- src/encauth/ocb/ocb_ntz.c | 6 +++--- src/encauth/ocb/ocb_shift_xor.c | 6 +++--- src/encauth/ocb/ocb_test.c | 6 +++--- src/encauth/ocb/s_ocb_done.c | 6 +++--- src/encauth/ocb3/ocb3_add_aad.c | 6 +++--- src/encauth/ocb3/ocb3_decrypt.c | 6 +++--- src/encauth/ocb3/ocb3_decrypt_last.c | 6 +++--- src/encauth/ocb3/ocb3_decrypt_verify_memory.c | 6 +++--- src/encauth/ocb3/ocb3_done.c | 6 +++--- src/encauth/ocb3/ocb3_encrypt.c | 6 +++--- src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c | 6 +++--- src/encauth/ocb3/ocb3_encrypt_last.c | 6 +++--- src/encauth/ocb3/ocb3_init.c | 6 +++--- src/encauth/ocb3/ocb3_int_aad_add_block.c | 6 +++--- src/encauth/ocb3/ocb3_int_calc_offset_zero.c | 6 +++--- src/encauth/ocb3/ocb3_int_ntz.c | 6 +++--- src/encauth/ocb3/ocb3_int_xor_blocks.c | 6 +++--- src/encauth/ocb3/ocb3_test.c | 6 +++--- src/hashes/chc/chc.c | 6 +++--- src/hashes/helper/hash_file.c | 6 +++--- src/hashes/helper/hash_filehandle.c | 6 +++--- src/hashes/helper/hash_memory.c | 6 +++--- src/hashes/helper/hash_memory_multi.c | 6 +++--- src/hashes/md2.c | 6 +++--- src/hashes/md4.c | 6 +++--- src/hashes/md5.c | 6 +++--- src/hashes/rmd128.c | 6 +++--- src/hashes/rmd160.c | 6 +++--- src/hashes/sha1.c | 6 +++--- src/hashes/sha2/sha224.c | 6 +++--- src/hashes/sha2/sha256.c | 6 +++--- src/hashes/sha2/sha384.c | 6 +++--- src/hashes/sha2/sha512.c | 6 +++--- src/hashes/sha2/sha512_224.c | 6 +++--- src/hashes/sha2/sha512_256.c | 6 +++--- src/hashes/tiger.c | 6 +++--- src/hashes/whirl/whirl.c | 6 +++--- src/hashes/whirl/whirltab.c | 6 +++--- src/headers/tomcrypt.h | 6 +++--- src/headers/tomcrypt_argchk.h | 6 +++--- src/headers/tomcrypt_cfg.h | 6 +++--- src/headers/tomcrypt_cipher.h | 6 +++--- src/headers/tomcrypt_custom.h | 6 +++--- src/headers/tomcrypt_hash.h | 6 +++--- src/headers/tomcrypt_mac.h | 6 +++--- src/headers/tomcrypt_macros.h | 6 +++--- src/headers/tomcrypt_math.h | 6 +++--- src/headers/tomcrypt_misc.h | 6 +++--- src/headers/tomcrypt_pk.h | 6 +++--- src/headers/tomcrypt_pkcs.h | 6 +++--- src/headers/tomcrypt_prng.h | 6 +++--- src/mac/f9/f9_done.c | 6 +++--- src/mac/f9/f9_file.c | 6 +++--- src/mac/f9/f9_init.c | 6 +++--- src/mac/f9/f9_memory.c | 6 +++--- src/mac/f9/f9_memory_multi.c | 6 +++--- src/mac/f9/f9_process.c | 6 +++--- src/mac/f9/f9_test.c | 6 +++--- src/mac/hmac/hmac_done.c | 6 +++--- src/mac/hmac/hmac_file.c | 6 +++--- src/mac/hmac/hmac_init.c | 6 +++--- src/mac/hmac/hmac_memory.c | 6 +++--- src/mac/hmac/hmac_memory_multi.c | 6 +++--- src/mac/hmac/hmac_process.c | 6 +++--- src/mac/hmac/hmac_test.c | 6 +++--- src/mac/omac/omac_done.c | 6 +++--- src/mac/omac/omac_file.c | 6 +++--- src/mac/omac/omac_init.c | 6 +++--- src/mac/omac/omac_memory.c | 6 +++--- src/mac/omac/omac_memory_multi.c | 6 +++--- src/mac/omac/omac_process.c | 6 +++--- src/mac/omac/omac_test.c | 6 +++--- src/mac/pelican/pelican.c | 6 +++--- src/mac/pelican/pelican_memory.c | 6 +++--- src/mac/pelican/pelican_test.c | 6 +++--- src/mac/pmac/pmac_done.c | 6 +++--- src/mac/pmac/pmac_file.c | 6 +++--- src/mac/pmac/pmac_init.c | 6 +++--- src/mac/pmac/pmac_memory.c | 6 +++--- src/mac/pmac/pmac_memory_multi.c | 6 +++--- src/mac/pmac/pmac_ntz.c | 6 +++--- src/mac/pmac/pmac_process.c | 6 +++--- src/mac/pmac/pmac_shift_xor.c | 6 +++--- src/mac/pmac/pmac_test.c | 6 +++--- src/mac/xcbc/xcbc_done.c | 6 +++--- src/mac/xcbc/xcbc_file.c | 6 +++--- src/mac/xcbc/xcbc_init.c | 6 +++--- src/mac/xcbc/xcbc_memory.c | 6 +++--- src/mac/xcbc/xcbc_memory_multi.c | 6 +++--- src/mac/xcbc/xcbc_process.c | 6 +++--- src/mac/xcbc/xcbc_test.c | 6 +++--- src/math/fp/ltc_ecc_fp_mulmod.c | 6 +++--- src/math/gmp_desc.c | 6 +++--- src/math/ltm_desc.c | 6 +++--- src/math/multi.c | 6 +++--- src/math/rand_prime.c | 6 +++--- src/math/tfm_desc.c | 6 +++--- src/misc/adler32.c | 6 +++--- src/misc/base64/base64_decode.c | 6 +++--- src/misc/base64/base64_encode.c | 6 +++--- src/misc/burn_stack.c | 6 +++--- src/misc/compare_testvector.c | 6 +++--- src/misc/crc32.c | 6 +++--- src/misc/crypt/crypt.c | 6 +++--- src/misc/crypt/crypt_argchk.c | 6 +++--- src/misc/crypt/crypt_cipher_descriptor.c | 6 +++--- src/misc/crypt/crypt_cipher_is_valid.c | 6 +++--- src/misc/crypt/crypt_constants.c | 6 +++--- src/misc/crypt/crypt_find_cipher.c | 6 +++--- src/misc/crypt/crypt_find_cipher_any.c | 6 +++--- src/misc/crypt/crypt_find_cipher_id.c | 6 +++--- src/misc/crypt/crypt_find_hash.c | 6 +++--- src/misc/crypt/crypt_find_hash_any.c | 6 +++--- src/misc/crypt/crypt_find_hash_id.c | 6 +++--- src/misc/crypt/crypt_find_hash_oid.c | 6 +++--- src/misc/crypt/crypt_find_prng.c | 6 +++--- src/misc/crypt/crypt_fsa.c | 6 +++--- src/misc/crypt/crypt_hash_descriptor.c | 6 +++--- src/misc/crypt/crypt_hash_is_valid.c | 6 +++--- src/misc/crypt/crypt_inits.c | 6 +++--- src/misc/crypt/crypt_prng_descriptor.c | 6 +++--- src/misc/crypt/crypt_prng_is_valid.c | 6 +++--- src/misc/crypt/crypt_register_cipher.c | 6 +++--- src/misc/crypt/crypt_register_hash.c | 6 +++--- src/misc/crypt/crypt_register_prng.c | 6 +++--- src/misc/crypt/crypt_sizes.c | 6 +++--- src/misc/crypt/crypt_unregister_cipher.c | 6 +++--- src/misc/crypt/crypt_unregister_hash.c | 6 +++--- src/misc/crypt/crypt_unregister_prng.c | 6 +++--- src/misc/error_to_string.c | 6 +++--- src/misc/hkdf/hkdf_test.c | 6 +++--- src/misc/mem_neq.c | 6 +++--- src/misc/pkcs5/pkcs_5_1.c | 6 +++--- src/misc/pkcs5/pkcs_5_2.c | 6 +++--- src/misc/pkcs5/pkcs_5_test.c | 6 +++--- src/misc/zeromem.c | 6 +++--- src/modes/cbc/cbc_decrypt.c | 6 +++--- src/modes/cbc/cbc_done.c | 6 +++--- src/modes/cbc/cbc_encrypt.c | 6 +++--- src/modes/cbc/cbc_getiv.c | 6 +++--- src/modes/cbc/cbc_setiv.c | 6 +++--- src/modes/cbc/cbc_start.c | 6 +++--- src/modes/cfb/cfb_decrypt.c | 6 +++--- src/modes/cfb/cfb_done.c | 6 +++--- src/modes/cfb/cfb_encrypt.c | 6 +++--- src/modes/cfb/cfb_getiv.c | 6 +++--- src/modes/cfb/cfb_setiv.c | 6 +++--- src/modes/cfb/cfb_start.c | 6 +++--- src/modes/ctr/ctr_decrypt.c | 6 +++--- src/modes/ctr/ctr_done.c | 6 +++--- src/modes/ctr/ctr_encrypt.c | 6 +++--- src/modes/ctr/ctr_getiv.c | 6 +++--- src/modes/ctr/ctr_setiv.c | 6 +++--- src/modes/ctr/ctr_start.c | 6 +++--- src/modes/ctr/ctr_test.c | 6 +++--- src/modes/ecb/ecb_decrypt.c | 6 +++--- src/modes/ecb/ecb_done.c | 6 +++--- src/modes/ecb/ecb_encrypt.c | 6 +++--- src/modes/ecb/ecb_start.c | 6 +++--- src/modes/f8/f8_decrypt.c | 6 +++--- src/modes/f8/f8_done.c | 6 +++--- src/modes/f8/f8_encrypt.c | 6 +++--- src/modes/f8/f8_getiv.c | 6 +++--- src/modes/f8/f8_setiv.c | 6 +++--- src/modes/f8/f8_start.c | 6 +++--- src/modes/f8/f8_test_mode.c | 6 +++--- src/modes/lrw/lrw_decrypt.c | 6 +++--- src/modes/lrw/lrw_done.c | 6 +++--- src/modes/lrw/lrw_encrypt.c | 6 +++--- src/modes/lrw/lrw_getiv.c | 6 +++--- src/modes/lrw/lrw_process.c | 6 +++--- src/modes/lrw/lrw_setiv.c | 6 +++--- src/modes/lrw/lrw_start.c | 6 +++--- src/modes/lrw/lrw_test.c | 6 +++--- src/modes/ofb/ofb_decrypt.c | 6 +++--- src/modes/ofb/ofb_done.c | 6 +++--- src/modes/ofb/ofb_encrypt.c | 6 +++--- src/modes/ofb/ofb_getiv.c | 6 +++--- src/modes/ofb/ofb_setiv.c | 6 +++--- src/modes/ofb/ofb_start.c | 6 +++--- src/modes/xts/xts_decrypt.c | 6 +++--- src/modes/xts/xts_done.c | 6 +++--- src/modes/xts/xts_encrypt.c | 6 +++--- src/modes/xts/xts_init.c | 6 +++--- src/modes/xts/xts_mult_x.c | 6 +++--- src/modes/xts/xts_test.c | 6 +++--- src/pk/asn1/der/bit/der_decode_bit_string.c | 6 +++--- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 6 +++--- src/pk/asn1/der/bit/der_encode_bit_string.c | 6 +++--- src/pk/asn1/der/bit/der_encode_raw_bit_string.c | 6 +++--- src/pk/asn1/der/bit/der_length_bit_string.c | 6 +++--- src/pk/asn1/der/boolean/der_decode_boolean.c | 6 +++--- src/pk/asn1/der/boolean/der_encode_boolean.c | 6 +++--- src/pk/asn1/der/boolean/der_length_boolean.c | 6 +++--- src/pk/asn1/der/choice/der_decode_choice.c | 6 +++--- .../asn1/der/generalizedtime/der_decode_generalizedtime.c | 6 +++--- .../asn1/der/generalizedtime/der_encode_generalizedtime.c | 6 +++--- .../asn1/der/generalizedtime/der_length_generalizedtime.c | 6 +++--- src/pk/asn1/der/ia5/der_decode_ia5_string.c | 6 +++--- src/pk/asn1/der/ia5/der_encode_ia5_string.c | 6 +++--- src/pk/asn1/der/ia5/der_length_ia5_string.c | 6 +++--- src/pk/asn1/der/integer/der_decode_integer.c | 6 +++--- src/pk/asn1/der/integer/der_encode_integer.c | 6 +++--- src/pk/asn1/der/integer/der_length_integer.c | 6 +++--- .../der/object_identifier/der_decode_object_identifier.c | 6 +++--- .../der/object_identifier/der_encode_object_identifier.c | 6 +++--- .../der/object_identifier/der_length_object_identifier.c | 6 +++--- src/pk/asn1/der/octet/der_decode_octet_string.c | 6 +++--- src/pk/asn1/der/octet/der_encode_octet_string.c | 6 +++--- src/pk/asn1/der/octet/der_length_octet_string.c | 6 +++--- .../asn1/der/printable_string/der_decode_printable_string.c | 6 +++--- .../asn1/der/printable_string/der_encode_printable_string.c | 6 +++--- .../asn1/der/printable_string/der_length_printable_string.c | 6 +++--- src/pk/asn1/der/sequence/der_decode_sequence_ex.c | 6 +++--- src/pk/asn1/der/sequence/der_decode_sequence_flexi.c | 6 +++--- src/pk/asn1/der/sequence/der_decode_sequence_multi.c | 6 +++--- src/pk/asn1/der/sequence/der_encode_sequence_multi.c | 6 +++--- src/pk/asn1/der/sequence/der_length_sequence.c | 6 +++--- src/pk/asn1/der/sequence/der_sequence_free.c | 6 +++--- src/pk/asn1/der/sequence/der_sequence_shrink.c | 6 +++--- src/pk/asn1/der/set/der_encode_set.c | 6 +++--- src/pk/asn1/der/set/der_encode_setof.c | 6 +++--- src/pk/asn1/der/short_integer/der_decode_short_integer.c | 6 +++--- src/pk/asn1/der/short_integer/der_encode_short_integer.c | 6 +++--- src/pk/asn1/der/short_integer/der_length_short_integer.c | 6 +++--- src/pk/asn1/der/teletex_string/der_decode_teletex_string.c | 6 +++--- src/pk/asn1/der/teletex_string/der_length_teletex_string.c | 6 +++--- src/pk/asn1/der/utctime/der_decode_utctime.c | 6 +++--- src/pk/asn1/der/utctime/der_encode_utctime.c | 6 +++--- src/pk/asn1/der/utctime/der_length_utctime.c | 6 +++--- src/pk/asn1/der/utf8/der_decode_utf8_string.c | 6 +++--- src/pk/asn1/der/utf8/der_encode_utf8_string.c | 6 +++--- src/pk/asn1/der/utf8/der_length_utf8_string.c | 6 +++--- src/pk/dsa/dsa_decrypt_key.c | 6 +++--- src/pk/dsa/dsa_encrypt_key.c | 6 +++--- src/pk/dsa/dsa_export.c | 6 +++--- src/pk/dsa/dsa_free.c | 6 +++--- src/pk/dsa/dsa_import.c | 6 +++--- src/pk/dsa/dsa_make_key.c | 6 +++--- src/pk/dsa/dsa_shared_secret.c | 6 +++--- src/pk/dsa/dsa_sign_hash.c | 6 +++--- src/pk/dsa/dsa_verify_hash.c | 6 +++--- src/pk/dsa/dsa_verify_key.c | 6 +++--- src/pk/ecc/ecc.c | 6 +++--- src/pk/ecc/ecc_ansi_x963_export.c | 6 +++--- src/pk/ecc/ecc_ansi_x963_import.c | 6 +++--- src/pk/ecc/ecc_decrypt_key.c | 6 +++--- src/pk/ecc/ecc_encrypt_key.c | 6 +++--- src/pk/ecc/ecc_export.c | 6 +++--- src/pk/ecc/ecc_free.c | 6 +++--- src/pk/ecc/ecc_get_size.c | 6 +++--- src/pk/ecc/ecc_import.c | 6 +++--- src/pk/ecc/ecc_make_key.c | 6 +++--- src/pk/ecc/ecc_shared_secret.c | 6 +++--- src/pk/ecc/ecc_sign_hash.c | 6 +++--- src/pk/ecc/ecc_sizes.c | 6 +++--- src/pk/ecc/ecc_test.c | 6 +++--- src/pk/ecc/ecc_verify_hash.c | 6 +++--- src/pk/ecc/ltc_ecc_is_valid_idx.c | 6 +++--- src/pk/ecc/ltc_ecc_map.c | 6 +++--- src/pk/ecc/ltc_ecc_mul2add.c | 6 +++--- src/pk/ecc/ltc_ecc_mulmod.c | 6 +++--- src/pk/ecc/ltc_ecc_mulmod_timing.c | 6 +++--- src/pk/ecc/ltc_ecc_points.c | 6 +++--- src/pk/ecc/ltc_ecc_projective_add_point.c | 6 +++--- src/pk/ecc/ltc_ecc_projective_dbl_point.c | 6 +++--- src/pk/katja/katja_decrypt_key.c | 6 +++--- src/pk/katja/katja_encrypt_key.c | 6 +++--- src/pk/katja/katja_export.c | 6 +++--- src/pk/katja/katja_exptmod.c | 6 +++--- src/pk/katja/katja_free.c | 6 +++--- src/pk/katja/katja_import.c | 6 +++--- src/pk/katja/katja_make_key.c | 6 +++--- src/pk/pkcs1/pkcs_1_i2osp.c | 6 +++--- src/pk/pkcs1/pkcs_1_mgf1.c | 6 +++--- src/pk/pkcs1/pkcs_1_oaep_decode.c | 6 +++--- src/pk/pkcs1/pkcs_1_oaep_encode.c | 6 +++--- src/pk/pkcs1/pkcs_1_os2ip.c | 6 +++--- src/pk/pkcs1/pkcs_1_pss_decode.c | 6 +++--- src/pk/pkcs1/pkcs_1_pss_encode.c | 6 +++--- src/pk/pkcs1/pkcs_1_v1_5_decode.c | 6 +++--- src/pk/pkcs1/pkcs_1_v1_5_encode.c | 6 +++--- src/pk/rsa/rsa_decrypt_key.c | 6 +++--- src/pk/rsa/rsa_encrypt_key.c | 6 +++--- src/pk/rsa/rsa_export.c | 6 +++--- src/pk/rsa/rsa_exptmod.c | 6 +++--- src/pk/rsa/rsa_free.c | 6 +++--- src/pk/rsa/rsa_get_size.c | 6 +++--- src/pk/rsa/rsa_import.c | 6 +++--- src/pk/rsa/rsa_import_x509.c | 6 +++--- src/pk/rsa/rsa_make_key.c | 6 +++--- src/pk/rsa/rsa_sign_hash.c | 6 +++--- src/pk/rsa/rsa_sign_saltlen_get.c | 6 +++--- src/pk/rsa/rsa_verify_hash.c | 6 +++--- src/prngs/fortuna.c | 6 +++--- src/prngs/rng_get_bytes.c | 6 +++--- src/prngs/rng_make_prng.c | 6 +++--- src/prngs/sprng.c | 6 +++--- src/prngs/yarrow.c | 6 +++--- src/stream/sober128/sober128tab.c | 6 +++--- testme.sh | 6 +++--- tests/base64_test.c | 6 +++--- tests/cipher_hash_test.c | 6 +++--- tests/der_test.c | 6 +++--- tests/dsa_test.c | 6 +++--- tests/ecc_test.c | 6 +++--- tests/mac_test.c | 6 +++--- tests/misc_test.c | 6 +++--- tests/modes_test.c | 6 +++--- tests/no_prng.c | 6 +++--- tests/pkcs_1_eme_test.c | 6 +++--- tests/pkcs_1_emsa_test.c | 6 +++--- tests/pkcs_1_oaep_test.c | 6 +++--- tests/pkcs_1_pss_test.c | 6 +++--- tests/pkcs_1_test.c | 6 +++--- tests/rsa_test.c | 6 +++--- tests/store_test.c | 6 +++--- tests/test.c | 6 +++--- tests/tomcrypt_test.h | 6 +++--- 386 files changed, 1158 insertions(+), 1158 deletions(-) diff --git a/build.sh b/build.sh index b1e6de364..a86b0c59e 100755 --- a/build.sh +++ b/build.sh @@ -54,6 +54,6 @@ if [ -a testok.txt ] && [ -f testok.txt ]; then fi exit 1 -# $Source$ -# $Revision$ -# $Date$ +# ref: $Format:%D$ +# git commit: $Format:%H$ +# commit time: $Format:%ai$ diff --git a/check_source.sh b/check_source.sh index cc5865732..731377bb4 100755 --- a/check_source.sh +++ b/check_source.sh @@ -10,6 +10,6 @@ echo "checking..." exit 0 -# $Source$ -# $Revision$ -# $Date$ +# ref: $Format:%D$ +# git commit: $Format:%H$ +# commit time: $Format:%ai$ diff --git a/coverage.sh b/coverage.sh index 48ef7f1a8..edf145c64 100755 --- a/coverage.sh +++ b/coverage.sh @@ -46,6 +46,6 @@ fi exit 0 -# $Source$ -# $Revision$ -# $Date$ +# ref: $Format:%D$ +# git commit: $Format:%H$ +# commit time: $Format:%ai$ diff --git a/coverage_more.sh b/coverage_more.sh index 2b8009c7b..fe79ebbd2 100755 --- a/coverage_more.sh +++ b/coverage_more.sh @@ -19,6 +19,6 @@ fi exit 0 -# $Source$ -# $Revision$ -# $Date$ +# ref: $Format:%D$ +# git commit: $Format:%H$ +# commit time: $Format:%ai$ diff --git a/demos/constants.c b/demos/constants.c index 841995724..47b7542be 100644 --- a/demos/constants.c +++ b/demos/constants.c @@ -49,6 +49,6 @@ int main(void) { } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/demos/hashsum.c b/demos/hashsum.c index 24373f45e..9a3bfe7d6 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -260,6 +260,6 @@ int main(int argc, char **argv) return EXIT_SUCCESS; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/demos/ltcrypt.c b/demos/ltcrypt.c index d4f16d814..05d113768 100644 --- a/demos/ltcrypt.c +++ b/demos/ltcrypt.c @@ -190,6 +190,6 @@ int main(int argc, char *argv[]) return 0; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/demos/small.c b/demos/small.c index 8d438210e..6cc6703a8 100644 --- a/demos/small.c +++ b/demos/small.c @@ -9,6 +9,6 @@ int main(void) return 0; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/demos/timing.c b/demos/timing.c index f4dcdd296..78e928e88 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -1454,6 +1454,6 @@ return EXIT_SUCCESS; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 93de2db8c..90a75c606 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -784,6 +784,6 @@ int main(void) return 0; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/doc/crypt.tex b/doc/crypt.tex index 9bb8a568d..b0798ecbb 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -7312,6 +7312,6 @@ \subsection{RSA Functions} \end{document} -% $Source$ -% $Revision$ -% $Date$ +% ref: $Format:%D$ +% git commit: $Format:%H$ +% commit time: $Format:%ai$ diff --git a/doc/footer.html b/doc/footer.html index cb7e8afa5..fe9ebb114 100644 --- a/doc/footer.html +++ b/doc/footer.html @@ -4,7 +4,7 @@ diff --git a/doc/header.html b/doc/header.html index 5d8657436..22dfddc1b 100644 --- a/doc/header.html +++ b/doc/header.html @@ -6,7 +6,7 @@ diff --git a/makefile.shared b/makefile.shared index 025ccde47..eea79e5bf 100644 --- a/makefile.shared +++ b/makefile.shared @@ -69,6 +69,6 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) -# $Source$ -# $Revision$ -# $Date$ +# ref: $Format:%D$ +# git commit: $Format:%H$ +# commit time: $Format:%ai$ diff --git a/notes/etc/saferp_optimizer.c b/notes/etc/saferp_optimizer.c index b2ae718ec..4a66d6340 100644 --- a/notes/etc/saferp_optimizer.c +++ b/notes/etc/saferp_optimizer.c @@ -172,6 +172,6 @@ printf(" }\n}\n\n"); } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/notes/etc/whirlgen.c b/notes/etc/whirlgen.c index f64650bad..d537cefe2 100644 --- a/notes/etc/whirlgen.c +++ b/notes/etc/whirlgen.c @@ -90,6 +90,6 @@ int main(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/notes/etc/whirltest.c b/notes/etc/whirltest.c index cf2e87cd2..d8c24e889 100644 --- a/notes/etc/whirltest.c +++ b/notes/etc/whirltest.c @@ -14,6 +14,6 @@ int main(void) } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/run.sh b/run.sh index a0f6af35f..94043c716 100755 --- a/run.sh +++ b/run.sh @@ -44,6 +44,6 @@ fi exit 0 -# $Source$ -# $Revision$ -# $Date$ +# ref: $Format:%D$ +# git commit: $Format:%H$ +# commit time: $Format:%ai$ diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index 9a6857638..dea13bb25 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -753,6 +753,6 @@ int ECB_KS(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/aes/aes_tab.c b/src/ciphers/aes/aes_tab.c index 35d57f332..463d05cc2 100644 --- a/src/ciphers/aes/aes_tab.c +++ b/src/ciphers/aes/aes_tab.c @@ -1025,6 +1025,6 @@ static const ulong32 rcon[] = { #endif /* __LTC_AES_TAB_C__ */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index dc1d0d46b..2a9b1c06d 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -1552,6 +1552,6 @@ int anubis_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/blowfish.c b/src/ciphers/blowfish.c index 162263d24..994ab3603 100644 --- a/src/ciphers/blowfish.c +++ b/src/ciphers/blowfish.c @@ -588,6 +588,6 @@ int blowfish_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index 39eb8d54b..e159104f7 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -735,6 +735,6 @@ int camellia_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/cast5.c b/src/ciphers/cast5.c index 658cf4b69..e0501d1c5 100644 --- a/src/ciphers/cast5.c +++ b/src/ciphers/cast5.c @@ -714,6 +714,6 @@ int cast5_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/des.c b/src/ciphers/des.c index a6d1e001b..0993d6ba4 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -2078,6 +2078,6 @@ int des3_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/kasumi.c b/src/ciphers/kasumi.c index 6472fce99..432313bc5 100644 --- a/src/ciphers/kasumi.c +++ b/src/ciphers/kasumi.c @@ -312,6 +312,6 @@ int kasumi_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/khazad.c b/src/ciphers/khazad.c index 12beca2f9..960b73456 100644 --- a/src/ciphers/khazad.c +++ b/src/ciphers/khazad.c @@ -849,6 +849,6 @@ int khazad_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/kseed.c b/src/ciphers/kseed.c index 9ab1b1975..f1c15dd9c 100644 --- a/src/ciphers/kseed.c +++ b/src/ciphers/kseed.c @@ -385,6 +385,6 @@ int kseed_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index f0f943841..2378e2dd0 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -314,6 +314,6 @@ int multi2_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index e8f3e8c0d..21e645c8e 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -338,6 +338,6 @@ int noekeon_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/rc2.c b/src/ciphers/rc2.c index 711c596e1..ebd8f882f 100644 --- a/src/ciphers/rc2.c +++ b/src/ciphers/rc2.c @@ -412,6 +412,6 @@ int rc2_keysize(int *keysize) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/rc5.c b/src/ciphers/rc5.c index 12f7320c9..e3e2ad6e8 100644 --- a/src/ciphers/rc5.c +++ b/src/ciphers/rc5.c @@ -316,6 +316,6 @@ int rc5_keysize(int *keysize) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/rc6.c b/src/ciphers/rc6.c index 11f046939..cd192d457 100644 --- a/src/ciphers/rc6.c +++ b/src/ciphers/rc6.c @@ -342,6 +342,6 @@ int rc6_keysize(int *keysize) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index 7014fc312..af1a8a279 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -487,6 +487,6 @@ int safer_sk128_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/safer/safer_tab.c b/src/ciphers/safer/safer_tab.c index aa69cc5d6..99962a029 100644 --- a/src/ciphers/safer/safer_tab.c +++ b/src/ciphers/safer/safer_tab.c @@ -59,6 +59,6 @@ static const unsigned char safer_lbox[256] = { -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/safer/saferp.c b/src/ciphers/safer/saferp.c index b3095bb1c..fab351807 100644 --- a/src/ciphers/safer/saferp.c +++ b/src/ciphers/safer/saferp.c @@ -562,6 +562,6 @@ int saferp_keysize(int *keysize) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/skipjack.c b/src/ciphers/skipjack.c index 293690e22..0d28ec14c 100644 --- a/src/ciphers/skipjack.c +++ b/src/ciphers/skipjack.c @@ -337,6 +337,6 @@ int skipjack_keysize(int *keysize) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index 1c0d208eb..a8a116718 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -708,6 +708,6 @@ int twofish_keysize(int *keysize) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/twofish/twofish_tab.c b/src/ciphers/twofish/twofish_tab.c index d4f011e70..b4135ab73 100644 --- a/src/ciphers/twofish/twofish_tab.c +++ b/src/ciphers/twofish/twofish_tab.c @@ -491,6 +491,6 @@ static const ulong32 rs_tab7[256] = { #endif /* __LTC_TWOFISH_TAB_C__ */ #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index 030920374..77a9346d1 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -271,6 +271,6 @@ int xtea_keysize(int *keysize) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ccm/ccm_memory.c b/src/encauth/ccm/ccm_memory.c index 48aecda10..45d6b6fb4 100644 --- a/src/encauth/ccm/ccm_memory.c +++ b/src/encauth/ccm/ccm_memory.c @@ -400,6 +400,6 @@ int ccm_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ccm/ccm_test.c b/src/encauth/ccm/ccm_test.c index b42951d34..d96cfac56 100644 --- a/src/encauth/ccm/ccm_test.c +++ b/src/encauth/ccm/ccm_test.c @@ -241,6 +241,6 @@ int ccm_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/eax/eax_addheader.c b/src/encauth/eax/eax_addheader.c index a9df36514..5545336f1 100644 --- a/src/encauth/eax/eax_addheader.c +++ b/src/encauth/eax/eax_addheader.c @@ -31,6 +31,6 @@ int eax_addheader(eax_state *eax, const unsigned char *header, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/eax/eax_decrypt.c b/src/encauth/eax/eax_decrypt.c index c5c588376..b1407163c 100644 --- a/src/encauth/eax/eax_decrypt.c +++ b/src/encauth/eax/eax_decrypt.c @@ -43,6 +43,6 @@ int eax_decrypt(eax_state *eax, const unsigned char *ct, unsigned char *pt, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/eax/eax_decrypt_verify_memory.c b/src/encauth/eax/eax_decrypt_verify_memory.c index 9b5f58fd5..b1a4d6e45 100644 --- a/src/encauth/eax/eax_decrypt_verify_memory.c +++ b/src/encauth/eax/eax_decrypt_verify_memory.c @@ -101,6 +101,6 @@ int eax_decrypt_verify_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/eax/eax_done.c b/src/encauth/eax/eax_done.c index 309303c20..b00bfe084 100644 --- a/src/encauth/eax/eax_done.c +++ b/src/encauth/eax/eax_done.c @@ -87,6 +87,6 @@ int eax_done(eax_state *eax, unsigned char *tag, unsigned long *taglen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/eax/eax_encrypt.c b/src/encauth/eax/eax_encrypt.c index 9c2a63c5f..174f263d8 100644 --- a/src/encauth/eax/eax_encrypt.c +++ b/src/encauth/eax/eax_encrypt.c @@ -44,6 +44,6 @@ int eax_encrypt(eax_state *eax, const unsigned char *pt, unsigned char *ct, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/eax/eax_encrypt_authenticate_memory.c b/src/encauth/eax/eax_encrypt_authenticate_memory.c index 47760b651..9980fc0b3 100644 --- a/src/encauth/eax/eax_encrypt_authenticate_memory.c +++ b/src/encauth/eax/eax_encrypt_authenticate_memory.c @@ -75,6 +75,6 @@ int eax_encrypt_authenticate_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/eax/eax_init.c b/src/encauth/eax/eax_init.c index 977bd0164..154d7a9ac 100644 --- a/src/encauth/eax/eax_init.c +++ b/src/encauth/eax/eax_init.c @@ -137,6 +137,6 @@ int eax_init(eax_state *eax, int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/eax/eax_test.c b/src/encauth/eax/eax_test.c index fc77422d7..8c57c97c9 100644 --- a/src/encauth/eax/eax_test.c +++ b/src/encauth/eax/eax_test.c @@ -275,6 +275,6 @@ int eax_test(void) #endif /* LTC_EAX_MODE */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_add_aad.c b/src/encauth/gcm/gcm_add_aad.c index ebf7fd57f..af19cff14 100644 --- a/src/encauth/gcm/gcm_add_aad.c +++ b/src/encauth/gcm/gcm_add_aad.c @@ -117,6 +117,6 @@ int gcm_add_aad(gcm_state *gcm, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_add_iv.c b/src/encauth/gcm/gcm_add_iv.c index dc324d228..3fd386147 100644 --- a/src/encauth/gcm/gcm_add_iv.c +++ b/src/encauth/gcm/gcm_add_iv.c @@ -87,6 +87,6 @@ int gcm_add_iv(gcm_state *gcm, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_done.c b/src/encauth/gcm/gcm_done.c index 2fb18396a..6b0b460fa 100644 --- a/src/encauth/gcm/gcm_done.c +++ b/src/encauth/gcm/gcm_done.c @@ -76,6 +76,6 @@ int gcm_done(gcm_state *gcm, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_gf_mult.c b/src/encauth/gcm/gcm_gf_mult.c index aacceabbe..1f0981542 100644 --- a/src/encauth/gcm/gcm_gf_mult.c +++ b/src/encauth/gcm/gcm_gf_mult.c @@ -213,7 +213,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_init.c b/src/encauth/gcm/gcm_init.c index f57cec8ae..072870d01 100644 --- a/src/encauth/gcm/gcm_init.c +++ b/src/encauth/gcm/gcm_init.c @@ -100,6 +100,6 @@ int gcm_init(gcm_state *gcm, int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_memory.c b/src/encauth/gcm/gcm_memory.c index a769642f0..0c8eed8df 100644 --- a/src/encauth/gcm/gcm_memory.c +++ b/src/encauth/gcm/gcm_memory.c @@ -101,6 +101,6 @@ int gcm_memory( int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_mult_h.c b/src/encauth/gcm/gcm_mult_h.c index d7b4df0c5..181d1d133 100644 --- a/src/encauth/gcm/gcm_mult_h.c +++ b/src/encauth/gcm/gcm_mult_h.c @@ -52,6 +52,6 @@ void gcm_mult_h(gcm_state *gcm, unsigned char *I) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_process.c b/src/encauth/gcm/gcm_process.c index 3894a2930..3089ea1f8 100644 --- a/src/encauth/gcm/gcm_process.c +++ b/src/encauth/gcm/gcm_process.c @@ -150,6 +150,6 @@ int gcm_process(gcm_state *gcm, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_reset.c b/src/encauth/gcm/gcm_reset.c index 7269c9bcb..3bd108853 100644 --- a/src/encauth/gcm/gcm_reset.c +++ b/src/encauth/gcm/gcm_reset.c @@ -37,6 +37,6 @@ int gcm_reset(gcm_state *gcm) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/gcm/gcm_test.c b/src/encauth/gcm/gcm_test.c index 84e57068d..d7fc00a69 100644 --- a/src/encauth/gcm/gcm_test.c +++ b/src/encauth/gcm/gcm_test.c @@ -406,6 +406,6 @@ int gcm_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_decrypt.c b/src/encauth/ocb/ocb_decrypt.c index e06335456..5dc8dade6 100644 --- a/src/encauth/ocb/ocb_decrypt.c +++ b/src/encauth/ocb/ocb_decrypt.c @@ -72,6 +72,6 @@ int ocb_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned char *pt) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_decrypt_verify_memory.c b/src/encauth/ocb/ocb_decrypt_verify_memory.c index 17e87074c..a7a47f06b 100644 --- a/src/encauth/ocb/ocb_decrypt_verify_memory.c +++ b/src/encauth/ocb/ocb_decrypt_verify_memory.c @@ -79,6 +79,6 @@ int ocb_decrypt_verify_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_done_decrypt.c b/src/encauth/ocb/ocb_done_decrypt.c index 7f8553419..18e3344dc 100644 --- a/src/encauth/ocb/ocb_done_decrypt.c +++ b/src/encauth/ocb/ocb_done_decrypt.c @@ -73,6 +73,6 @@ int ocb_done_decrypt(ocb_state *ocb, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_done_encrypt.c b/src/encauth/ocb/ocb_done_encrypt.c index 7dcf837d8..12ea68f4c 100644 --- a/src/encauth/ocb/ocb_done_encrypt.c +++ b/src/encauth/ocb/ocb_done_encrypt.c @@ -39,6 +39,6 @@ int ocb_done_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned long ptle #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_encrypt.c b/src/encauth/ocb/ocb_encrypt.c index 37affaab1..aad76a08b 100644 --- a/src/encauth/ocb/ocb_encrypt.c +++ b/src/encauth/ocb/ocb_encrypt.c @@ -65,6 +65,6 @@ int ocb_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned char *ct) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_encrypt_authenticate_memory.c b/src/encauth/ocb/ocb_encrypt_authenticate_memory.c index 1349820ec..1793a6489 100644 --- a/src/encauth/ocb/ocb_encrypt_authenticate_memory.c +++ b/src/encauth/ocb/ocb_encrypt_authenticate_memory.c @@ -77,6 +77,6 @@ int ocb_encrypt_authenticate_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_init.c b/src/encauth/ocb/ocb_init.c index 16c49f812..e008a44fb 100644 --- a/src/encauth/ocb/ocb_init.c +++ b/src/encauth/ocb/ocb_init.c @@ -134,6 +134,6 @@ int ocb_init(ocb_state *ocb, int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_ntz.c b/src/encauth/ocb/ocb_ntz.c index c0010a5be..cfdc66702 100644 --- a/src/encauth/ocb/ocb_ntz.c +++ b/src/encauth/ocb/ocb_ntz.c @@ -35,6 +35,6 @@ int ocb_ntz(unsigned long x) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_shift_xor.c b/src/encauth/ocb/ocb_shift_xor.c index 39b4dec63..8a8ad2ddd 100644 --- a/src/encauth/ocb/ocb_shift_xor.c +++ b/src/encauth/ocb/ocb_shift_xor.c @@ -32,6 +32,6 @@ void ocb_shift_xor(ocb_state *ocb, unsigned char *Z) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/ocb_test.c b/src/encauth/ocb/ocb_test.c index 7cf4a367d..aba4cf481 100644 --- a/src/encauth/ocb/ocb_test.c +++ b/src/encauth/ocb/ocb_test.c @@ -230,6 +230,6 @@ int ocb_test(void) -- The setup is somewhat complicated... */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb/s_ocb_done.c b/src/encauth/ocb/s_ocb_done.c index 07293e206..e0501ede2 100644 --- a/src/encauth/ocb/s_ocb_done.c +++ b/src/encauth/ocb/s_ocb_done.c @@ -141,6 +141,6 @@ int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_add_aad.c b/src/encauth/ocb3/ocb3_add_aad.c index 88f4d08e9..da5a1621e 100644 --- a/src/encauth/ocb3/ocb3_add_aad.c +++ b/src/encauth/ocb3/ocb3_add_aad.c @@ -76,6 +76,6 @@ int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_decrypt.c b/src/encauth/ocb3/ocb3_decrypt.c index b14465349..78ca5ca60 100644 --- a/src/encauth/ocb3/ocb3_decrypt.c +++ b/src/encauth/ocb3/ocb3_decrypt.c @@ -79,6 +79,6 @@ int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_decrypt_last.c b/src/encauth/ocb3/ocb3_decrypt_last.c index a932d537a..3477f2302 100644 --- a/src/encauth/ocb3/ocb3_decrypt_last.c +++ b/src/encauth/ocb3/ocb3_decrypt_last.c @@ -100,6 +100,6 @@ int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ct #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c index 1e0f91d5f..4ac2c4694 100644 --- a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c +++ b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c @@ -105,6 +105,6 @@ int ocb3_decrypt_verify_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_done.c b/src/encauth/ocb3/ocb3_done.c index 649dfe7ff..b6a63367b 100644 --- a/src/encauth/ocb3/ocb3_done.c +++ b/src/encauth/ocb3/ocb3_done.c @@ -85,6 +85,6 @@ int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_encrypt.c b/src/encauth/ocb3/ocb3_encrypt.c index a71caa59a..120dc1a1a 100644 --- a/src/encauth/ocb3/ocb3_encrypt.c +++ b/src/encauth/ocb3/ocb3_encrypt.c @@ -79,6 +79,6 @@ int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c index cd39d839e..28db89199 100644 --- a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c +++ b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c @@ -80,6 +80,6 @@ int ocb3_encrypt_authenticate_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_encrypt_last.c b/src/encauth/ocb3/ocb3_encrypt_last.c index b21cfae4c..53ff36d51 100644 --- a/src/encauth/ocb3/ocb3_encrypt_last.c +++ b/src/encauth/ocb3/ocb3_encrypt_last.c @@ -102,6 +102,6 @@ int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long pt #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index df6cb61a2..ab3c8a7c2 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -127,6 +127,6 @@ int ocb3_init(ocb3_state *ocb, int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_int_aad_add_block.c b/src/encauth/ocb3/ocb3_int_aad_add_block.c index 0b7d8f7a6..7f86ab026 100644 --- a/src/encauth/ocb3/ocb3_int_aad_add_block.c +++ b/src/encauth/ocb3/ocb3_int_aad_add_block.c @@ -44,6 +44,6 @@ int ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_int_calc_offset_zero.c b/src/encauth/ocb3/ocb3_int_calc_offset_zero.c index 93b171f45..2d5a976f3 100644 --- a/src/encauth/ocb3/ocb3_int_calc_offset_zero.c +++ b/src/encauth/ocb3/ocb3_int_calc_offset_zero.c @@ -67,6 +67,6 @@ void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsi #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_int_ntz.c b/src/encauth/ocb3/ocb3_int_ntz.c index c7843cc2f..3c5b18d0a 100644 --- a/src/encauth/ocb3/ocb3_int_ntz.c +++ b/src/encauth/ocb3/ocb3_int_ntz.c @@ -34,6 +34,6 @@ int ocb3_int_ntz(unsigned long x) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_int_xor_blocks.c b/src/encauth/ocb3/ocb3_int_xor_blocks.c index 92eb293f2..798bddcd6 100644 --- a/src/encauth/ocb3/ocb3_int_xor_blocks.c +++ b/src/encauth/ocb3/ocb3_int_xor_blocks.c @@ -35,6 +35,6 @@ void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index f1f579c27..4cd16e8c3 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -239,6 +239,6 @@ int ocb3_test(void) -- The setup is somewhat complicated... */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index 52395e536..d9f9e7798 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -295,6 +295,6 @@ int chc_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/helper/hash_file.c b/src/hashes/helper/hash_file.c index c221927ad..0b96eaee5 100644 --- a/src/hashes/helper/hash_file.c +++ b/src/hashes/helper/hash_file.c @@ -48,6 +48,6 @@ int hash_file(int hash, const char *fname, unsigned char *out, unsigned long *ou #endif /* #ifndef LTC_NO_FILE */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/helper/hash_filehandle.c b/src/hashes/helper/hash_filehandle.c index 07a565a9e..0e4d7a64c 100644 --- a/src/hashes/helper/hash_filehandle.c +++ b/src/hashes/helper/hash_filehandle.c @@ -69,6 +69,6 @@ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outle #endif /* #ifndef LTC_NO_FILE */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/helper/hash_memory.c b/src/hashes/helper/hash_memory.c index d00d47557..e8471acf0 100644 --- a/src/hashes/helper/hash_memory.c +++ b/src/hashes/helper/hash_memory.c @@ -64,6 +64,6 @@ int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned } #endif /* #ifdef LTC_HASH_HELPERS */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/helper/hash_memory_multi.c b/src/hashes/helper/hash_memory_multi.c index c50ac0ea0..d10b4582d 100644 --- a/src/hashes/helper/hash_memory_multi.c +++ b/src/hashes/helper/hash_memory_multi.c @@ -83,6 +83,6 @@ int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, } #endif /* #ifdef LTC_HASH_HELPERS */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/md2.c b/src/hashes/md2.c index 53a678f44..58f97376f 100644 --- a/src/hashes/md2.c +++ b/src/hashes/md2.c @@ -245,6 +245,6 @@ int md2_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/md4.c b/src/hashes/md4.c index 9e59fa2d4..cddc2b58a 100644 --- a/src/hashes/md4.c +++ b/src/hashes/md4.c @@ -301,6 +301,6 @@ int md4_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/md5.c b/src/hashes/md5.c index 8c2b41348..93fe2ec28 100644 --- a/src/hashes/md5.c +++ b/src/hashes/md5.c @@ -361,6 +361,6 @@ int md5_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/rmd128.c b/src/hashes/rmd128.c index f3ea56f9a..26e64b281 100644 --- a/src/hashes/rmd128.c +++ b/src/hashes/rmd128.c @@ -401,6 +401,6 @@ int rmd128_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/rmd160.c b/src/hashes/rmd160.c index 21bbee492..165afd26e 100644 --- a/src/hashes/rmd160.c +++ b/src/hashes/rmd160.c @@ -460,6 +460,6 @@ int rmd160_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha1.c b/src/hashes/sha1.c index 243b61530..8fbdabfd4 100644 --- a/src/hashes/sha1.c +++ b/src/hashes/sha1.c @@ -281,6 +281,6 @@ int sha1_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha2/sha224.c b/src/hashes/sha2/sha224.c index 6b69d0857..9233cba40 100644 --- a/src/hashes/sha2/sha224.c +++ b/src/hashes/sha2/sha224.c @@ -124,6 +124,6 @@ int sha224_test(void) #endif /* defined(LTC_SHA224) && defined(LTC_SHA256) */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index cd909e021..723e8aa65 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -329,6 +329,6 @@ int sha256_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha2/sha384.c b/src/hashes/sha2/sha384.c index 5daa9d154..c28ddd1c1 100644 --- a/src/hashes/sha2/sha384.c +++ b/src/hashes/sha2/sha384.c @@ -129,6 +129,6 @@ int sha384_test(void) #endif /* defined(LTC_SHA384) && defined(LTC_SHA512) */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index 81848b4fa..d169a9118 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -308,6 +308,6 @@ int sha512_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha2/sha512_224.c b/src/hashes/sha2/sha512_224.c index 3e36d559e..75d44fc93 100644 --- a/src/hashes/sha2/sha512_224.c +++ b/src/hashes/sha2/sha512_224.c @@ -125,6 +125,6 @@ int sha512_224_test(void) #endif /* defined(LTC_SHA384) && defined(LTC_SHA512) */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha2/sha512_256.c b/src/hashes/sha2/sha512_256.c index f5c1ef0de..0bbcaea33 100644 --- a/src/hashes/sha2/sha512_256.c +++ b/src/hashes/sha2/sha512_256.c @@ -125,6 +125,6 @@ int sha512_256_test(void) #endif /* defined(LTC_SHA384) && defined(LTC_SHA512) */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/tiger.c b/src/hashes/tiger.c index 274288e52..2438626d8 100644 --- a/src/hashes/tiger.c +++ b/src/hashes/tiger.c @@ -807,6 +807,6 @@ Hash of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-ABCDEFG -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/whirl/whirl.c b/src/hashes/whirl/whirl.c index c87519bcb..fe152cd22 100644 --- a/src/hashes/whirl/whirl.c +++ b/src/hashes/whirl/whirl.c @@ -301,6 +301,6 @@ int whirlpool_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/whirl/whirltab.c b/src/hashes/whirl/whirltab.c index 3e6f74742..4fde89b24 100644 --- a/src/hashes/whirl/whirltab.c +++ b/src/hashes/whirl/whirltab.c @@ -591,6 +591,6 @@ CONST64(0x6302aa71c81949d9), #endif /* __LTC_WHIRLTAB_C__ */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 40584e7aa..2241c4394 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -88,6 +88,6 @@ enum { #endif /* TOMCRYPT_H_ */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_argchk.h b/src/headers/tomcrypt_argchk.h index 5cefc2d63..d7032db72 100644 --- a/src/headers/tomcrypt_argchk.h +++ b/src/headers/tomcrypt_argchk.h @@ -39,6 +39,6 @@ void crypt_argchk(char *v, char *s, int d) NORETURN; #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 40d83e529..3167c89bf 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -263,6 +263,6 @@ typedef ulong32 ltc_mp_digit; #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index b49a799da..646038baa 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -994,6 +994,6 @@ int sober128_stream_test(void); #endif /* LTC_SOBER128_STREAM */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 908175fad..ac7ad0d46 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -578,6 +578,6 @@ #endif #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 1c272e2df..cad654ee2 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -517,6 +517,6 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen) return CRYPT_OK; \ } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 5e5f84c33..f59903e09 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -552,6 +552,6 @@ int chacha20poly1305_test(void); #endif /* LTC_CHACHA20POLY1305_MODE */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index 27d76d162..c9f3afb85 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -433,6 +433,6 @@ static inline ulong64 ROR64(ulong64 word, int i) #define snprintf _snprintf #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 6c1ceda85..2225235d1 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -558,6 +558,6 @@ extern const ltc_math_descriptor gmp_desc; #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index fa0b79564..1e0e981e9 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -101,6 +101,6 @@ int crc32_test(void); int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which); -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index a538acc0d..15e05faf0 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -689,6 +689,6 @@ int der_length_generalizedtime(ltc_generalizedtime *gtime, unsigned long *outlen #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index afa3c3830..e3a408014 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -94,6 +94,6 @@ int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, int pkcs_5_test (void); #endif /* LTC_PKCS_5 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 1849e55a4..07e376e25 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -218,6 +218,6 @@ extern unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/f9/f9_done.c b/src/mac/f9/f9_done.c index 587216429..8d2ccb056 100644 --- a/src/mac/f9/f9_done.c +++ b/src/mac/f9/f9_done.c @@ -69,7 +69,7 @@ int f9_done(f9_state *f9, unsigned char *out, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/f9/f9_file.c b/src/mac/f9/f9_file.c index 28b4d69b5..a6e6532c5 100644 --- a/src/mac/f9/f9_file.c +++ b/src/mac/f9/f9_file.c @@ -86,6 +86,6 @@ int f9_file(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/f9/f9_init.c b/src/mac/f9/f9_init.c index 9dee38ef9..ba59b20e9 100644 --- a/src/mac/f9/f9_init.c +++ b/src/mac/f9/f9_init.c @@ -62,7 +62,7 @@ int f9_init(f9_state *f9, int cipher, const unsigned char *key, unsigned long ke #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/f9/f9_memory.c b/src/mac/f9/f9_memory.c index ceea8ee0e..70c694b31 100644 --- a/src/mac/f9/f9_memory.c +++ b/src/mac/f9/f9_memory.c @@ -64,6 +64,6 @@ int f9_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/f9/f9_memory_multi.c b/src/mac/f9/f9_memory_multi.c index 3026c4f10..2c1d31a0d 100644 --- a/src/mac/f9/f9_memory_multi.c +++ b/src/mac/f9/f9_memory_multi.c @@ -83,6 +83,6 @@ int f9_memory_multi(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/f9/f9_process.c b/src/mac/f9/f9_process.c index d628086d9..ba4d39fff 100644 --- a/src/mac/f9/f9_process.c +++ b/src/mac/f9/f9_process.c @@ -70,7 +70,7 @@ int f9_process(f9_state *f9, const unsigned char *in, unsigned long inlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/f9/f9_test.c b/src/mac/f9/f9_test.c index e26c6634e..75f5ba7a7 100644 --- a/src/mac/f9/f9_test.c +++ b/src/mac/f9/f9_test.c @@ -70,7 +70,7 @@ int f9_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/hmac/hmac_done.c b/src/mac/hmac/hmac_done.c index 8e19b613b..8a9b69b12 100644 --- a/src/mac/hmac/hmac_done.c +++ b/src/mac/hmac/hmac_done.c @@ -102,6 +102,6 @@ int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/hmac/hmac_file.c b/src/mac/hmac/hmac_file.c index 1435d764b..2d10e21c4 100644 --- a/src/mac/hmac/hmac_file.c +++ b/src/mac/hmac/hmac_file.c @@ -89,6 +89,6 @@ int hmac_file(int hash, const char *fname, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/hmac/hmac_init.c b/src/mac/hmac/hmac_init.c index 2b4433ee9..79e1f247c 100644 --- a/src/mac/hmac/hmac_init.c +++ b/src/mac/hmac/hmac_init.c @@ -103,6 +103,6 @@ int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned lon #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/hmac/hmac_memory.c b/src/mac/hmac/hmac_memory.c index f6dc9568c..9a3a199b7 100644 --- a/src/mac/hmac/hmac_memory.c +++ b/src/mac/hmac/hmac_memory.c @@ -81,6 +81,6 @@ int hmac_memory(int hash, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/hmac/hmac_memory_multi.c b/src/mac/hmac/hmac_memory_multi.c index 2accd4fd7..6e3d0fefe 100644 --- a/src/mac/hmac/hmac_memory_multi.c +++ b/src/mac/hmac/hmac_memory_multi.c @@ -85,6 +85,6 @@ int hmac_memory_multi(int hash, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/hmac/hmac_process.c b/src/mac/hmac/hmac_process.c index 4d5dc2db9..8da62c130 100644 --- a/src/mac/hmac/hmac_process.c +++ b/src/mac/hmac/hmac_process.c @@ -36,6 +36,6 @@ int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index 1e6119295..e3d075405 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -625,6 +625,6 @@ int hmac_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/omac/omac_done.c b/src/mac/omac/omac_done.c index 51296bd94..bf22523f8 100644 --- a/src/mac/omac/omac_done.c +++ b/src/mac/omac/omac_done.c @@ -79,6 +79,6 @@ int omac_done(omac_state *omac, unsigned char *out, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/omac/omac_file.c b/src/mac/omac/omac_file.c index 4cf3d0776..a9104e8ee 100644 --- a/src/mac/omac/omac_file.c +++ b/src/mac/omac/omac_file.c @@ -86,6 +86,6 @@ int omac_file(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/omac/omac_init.c b/src/mac/omac/omac_init.c index b74009f28..55de2a619 100644 --- a/src/mac/omac/omac_init.c +++ b/src/mac/omac/omac_init.c @@ -94,6 +94,6 @@ int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned l #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/omac/omac_memory.c b/src/mac/omac/omac_memory.c index 21d277e86..1b57db854 100644 --- a/src/mac/omac/omac_memory.c +++ b/src/mac/omac/omac_memory.c @@ -78,6 +78,6 @@ int omac_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/omac/omac_memory_multi.c b/src/mac/omac/omac_memory_multi.c index e7bbe6945..50f26e6af 100644 --- a/src/mac/omac/omac_memory_multi.c +++ b/src/mac/omac/omac_memory_multi.c @@ -83,6 +83,6 @@ int omac_memory_multi(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/omac/omac_process.c b/src/mac/omac/omac_process.c index 2c2ba0f0a..4ae2bd11c 100644 --- a/src/mac/omac/omac_process.c +++ b/src/mac/omac/omac_process.c @@ -85,6 +85,6 @@ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/omac/omac_test.c b/src/mac/omac/omac_test.c index 147a2840b..10fb92ed9 100644 --- a/src/mac/omac/omac_test.c +++ b/src/mac/omac/omac_test.c @@ -103,6 +103,6 @@ int omac_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pelican/pelican.c b/src/mac/pelican/pelican.c index 08b47ea18..a81a3ed67 100644 --- a/src/mac/pelican/pelican.c +++ b/src/mac/pelican/pelican.c @@ -159,6 +159,6 @@ int pelican_done(pelican_state *pelmac, unsigned char *out) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pelican/pelican_memory.c b/src/mac/pelican/pelican_memory.c index e358341c0..08607a0d3 100644 --- a/src/mac/pelican/pelican_memory.c +++ b/src/mac/pelican/pelican_memory.c @@ -52,6 +52,6 @@ int pelican_memory(const unsigned char *key, unsigned long keylen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pelican/pelican_test.c b/src/mac/pelican/pelican_test.c index cfa4c43d2..5fe28f90b 100644 --- a/src/mac/pelican/pelican_test.c +++ b/src/mac/pelican/pelican_test.c @@ -113,6 +113,6 @@ int pelican_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_done.c b/src/mac/pmac/pmac_done.c index 3b5ecc50d..de7a5aa08 100644 --- a/src/mac/pmac/pmac_done.c +++ b/src/mac/pmac/pmac_done.c @@ -67,6 +67,6 @@ int pmac_done(pmac_state *state, unsigned char *out, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_file.c b/src/mac/pmac/pmac_file.c index 46e68c13f..abe04f1ef 100644 --- a/src/mac/pmac/pmac_file.c +++ b/src/mac/pmac/pmac_file.c @@ -87,6 +87,6 @@ int pmac_file(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_init.c b/src/mac/pmac/pmac_init.c index 7cbd9486f..b1bb400d1 100644 --- a/src/mac/pmac/pmac_init.c +++ b/src/mac/pmac/pmac_init.c @@ -143,6 +143,6 @@ int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned l #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_memory.c b/src/mac/pmac/pmac_memory.c index 462f03218..78427811f 100644 --- a/src/mac/pmac/pmac_memory.c +++ b/src/mac/pmac/pmac_memory.c @@ -67,6 +67,6 @@ int pmac_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_memory_multi.c b/src/mac/pmac/pmac_memory_multi.c index a28319a34..f3de4b591 100644 --- a/src/mac/pmac/pmac_memory_multi.c +++ b/src/mac/pmac/pmac_memory_multi.c @@ -82,6 +82,6 @@ int pmac_memory_multi(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_ntz.c b/src/mac/pmac/pmac_ntz.c index a90c20720..2c7dec567 100644 --- a/src/mac/pmac/pmac_ntz.c +++ b/src/mac/pmac/pmac_ntz.c @@ -32,6 +32,6 @@ int pmac_ntz(unsigned long x) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_process.c b/src/mac/pmac/pmac_process.c index 95e4bb441..018fa275c 100644 --- a/src/mac/pmac/pmac_process.c +++ b/src/mac/pmac/pmac_process.c @@ -93,6 +93,6 @@ int pmac_process(pmac_state *pmac, const unsigned char *in, unsigned long inlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_shift_xor.c b/src/mac/pmac/pmac_shift_xor.c index de51819a9..49d48f981 100644 --- a/src/mac/pmac/pmac_shift_xor.c +++ b/src/mac/pmac/pmac_shift_xor.c @@ -37,6 +37,6 @@ void pmac_shift_xor(pmac_state *pmac) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/pmac/pmac_test.c b/src/mac/pmac/pmac_test.c index 4ffa92712..a96f106f6 100644 --- a/src/mac/pmac/pmac_test.c +++ b/src/mac/pmac/pmac_test.c @@ -158,6 +158,6 @@ int pmac_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/xcbc/xcbc_done.c b/src/mac/xcbc/xcbc_done.c index 48e27606a..133d16fd1 100644 --- a/src/mac/xcbc/xcbc_done.c +++ b/src/mac/xcbc/xcbc_done.c @@ -69,7 +69,7 @@ int xcbc_done(xcbc_state *xcbc, unsigned char *out, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/xcbc/xcbc_file.c b/src/mac/xcbc/xcbc_file.c index fc4c5f14b..f121cd0e9 100644 --- a/src/mac/xcbc/xcbc_file.c +++ b/src/mac/xcbc/xcbc_file.c @@ -86,6 +86,6 @@ int xcbc_file(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/xcbc/xcbc_init.c b/src/mac/xcbc/xcbc_init.c index 35ba9055f..4eccd5e4e 100644 --- a/src/mac/xcbc/xcbc_init.c +++ b/src/mac/xcbc/xcbc_init.c @@ -100,7 +100,7 @@ int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned l #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/xcbc/xcbc_memory.c b/src/mac/xcbc/xcbc_memory.c index 263acec13..a1bc0455d 100644 --- a/src/mac/xcbc/xcbc_memory.c +++ b/src/mac/xcbc/xcbc_memory.c @@ -64,6 +64,6 @@ int xcbc_memory(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/xcbc/xcbc_memory_multi.c b/src/mac/xcbc/xcbc_memory_multi.c index 822dd9531..a5b9d9174 100644 --- a/src/mac/xcbc/xcbc_memory_multi.c +++ b/src/mac/xcbc/xcbc_memory_multi.c @@ -83,6 +83,6 @@ int xcbc_memory_multi(int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/xcbc/xcbc_process.c b/src/mac/xcbc/xcbc_process.c index c75ea8464..12e25c5f3 100644 --- a/src/mac/xcbc/xcbc_process.c +++ b/src/mac/xcbc/xcbc_process.c @@ -67,7 +67,7 @@ int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/xcbc/xcbc_test.c b/src/mac/xcbc/xcbc_test.c index 80b93d42a..e237a4534 100644 --- a/src/mac/xcbc/xcbc_test.c +++ b/src/mac/xcbc/xcbc_test.c @@ -120,7 +120,7 @@ int xcbc_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/math/fp/ltc_ecc_fp_mulmod.c b/src/math/fp/ltc_ecc_fp_mulmod.c index c5e8aa741..134aa47f2 100644 --- a/src/math/fp/ltc_ecc_fp_mulmod.c +++ b/src/math/fp/ltc_ecc_fp_mulmod.c @@ -1579,7 +1579,7 @@ int ltc_ecc_fp_restore_state(unsigned char *in, unsigned long inlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index d742fa143..699727945 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -549,6 +549,6 @@ const ltc_math_descriptor gmp_desc = { #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index 54885a4a5..aa5f88ade 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -508,6 +508,6 @@ const ltc_math_descriptor ltm_desc = { #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/math/multi.c b/src/math/multi.c index fd18bebb9..bfed3ce2f 100644 --- a/src/math/multi.c +++ b/src/math/multi.c @@ -55,6 +55,6 @@ void ltc_deinit_multi(void *a, ...) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/math/rand_prime.c b/src/math/rand_prime.c index 6cb7b4928..8213cdb34 100644 --- a/src/math/rand_prime.c +++ b/src/math/rand_prime.c @@ -83,6 +83,6 @@ int rand_prime(void *N, long len, prng_state *prng, int wprng) #endif /* LTC_NO_MATH */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index 5d5de63b6..855083c74 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -800,6 +800,6 @@ const ltc_math_descriptor tfm_desc = { #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/adler32.c b/src/misc/adler32.c index 71de8e9c2..7e312bbac 100644 --- a/src/misc/adler32.c +++ b/src/misc/adler32.c @@ -132,6 +132,6 @@ int adler32_test(void) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/base64/base64_decode.c b/src/misc/base64/base64_decode.c index 3aed5beae..4c58c68d5 100644 --- a/src/misc/base64/base64_decode.c +++ b/src/misc/base64/base64_decode.c @@ -191,6 +191,6 @@ int base64url_strict_decode(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/base64/base64_encode.c b/src/misc/base64/base64_encode.c index a1356302c..5c26e607b 100644 --- a/src/misc/base64/base64_encode.c +++ b/src/misc/base64/base64_encode.c @@ -119,6 +119,6 @@ int base64url_strict_encode(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/burn_stack.c b/src/misc/burn_stack.c index 0f87b7c8b..afbafee4b 100644 --- a/src/misc/burn_stack.c +++ b/src/misc/burn_stack.c @@ -27,6 +27,6 @@ void burn_stack(unsigned long len) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/compare_testvector.c b/src/misc/compare_testvector.c index 24639a088..cc1cb5fe6 100644 --- a/src/misc/compare_testvector.c +++ b/src/misc/compare_testvector.c @@ -71,6 +71,6 @@ int compare_testvector(const void* is, const unsigned long is_len, const void* s return res; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crc32.c b/src/misc/crc32.c index 60c8aa197..1f78abbda 100644 --- a/src/misc/crc32.c +++ b/src/misc/crc32.c @@ -203,6 +203,6 @@ int crc32_test(void) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index aeb46cc5d..4c3681dad 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -484,6 +484,6 @@ const char *crypt_build_settings = ; -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_argchk.c b/src/misc/crypt/crypt_argchk.c index 153bb3b18..3b6606751 100644 --- a/src/misc/crypt/crypt_argchk.c +++ b/src/misc/crypt/crypt_argchk.c @@ -22,6 +22,6 @@ void crypt_argchk(char *v, char *s, int d) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_cipher_descriptor.c b/src/misc/crypt/crypt_cipher_descriptor.c index 6d5451f54..ccc989041 100644 --- a/src/misc/crypt/crypt_cipher_descriptor.c +++ b/src/misc/crypt/crypt_cipher_descriptor.c @@ -20,6 +20,6 @@ struct ltc_cipher_descriptor cipher_descriptor[TAB_SIZE] = { LTC_MUTEX_GLOBAL(ltc_cipher_mutex) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_cipher_is_valid.c b/src/misc/crypt/crypt_cipher_is_valid.c index f23bb034b..aebc94cc5 100644 --- a/src/misc/crypt/crypt_cipher_is_valid.c +++ b/src/misc/crypt/crypt_cipher_is_valid.c @@ -29,6 +29,6 @@ int cipher_is_valid(int idx) return CRYPT_OK; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 6e5bedd2c..5fe0eccb8 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -231,6 +231,6 @@ int crypt_list_all_constants(char *names_list, unsigned int *names_list_size) { } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_find_cipher.c b/src/misc/crypt/crypt_find_cipher.c index 45de73605..ba908f4ec 100644 --- a/src/misc/crypt/crypt_find_cipher.c +++ b/src/misc/crypt/crypt_find_cipher.c @@ -34,6 +34,6 @@ int find_cipher(const char *name) } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_find_cipher_any.c b/src/misc/crypt/crypt_find_cipher_any.c index db85707d8..5cdcdf892 100644 --- a/src/misc/crypt/crypt_find_cipher_any.c +++ b/src/misc/crypt/crypt_find_cipher_any.c @@ -43,6 +43,6 @@ int find_cipher_any(const char *name, int blocklen, int keylen) return -1; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_find_cipher_id.c b/src/misc/crypt/crypt_find_cipher_id.c index 73841d0b7..34d004997 100644 --- a/src/misc/crypt/crypt_find_cipher_id.c +++ b/src/misc/crypt/crypt_find_cipher_id.c @@ -33,6 +33,6 @@ int find_cipher_id(unsigned char ID) return -1; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_find_hash.c b/src/misc/crypt/crypt_find_hash.c index 1ce723f54..19ee55cbe 100644 --- a/src/misc/crypt/crypt_find_hash.c +++ b/src/misc/crypt/crypt_find_hash.c @@ -33,6 +33,6 @@ int find_hash(const char *name) return -1; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_find_hash_any.c b/src/misc/crypt/crypt_find_hash_any.c index 3d22486a6..413809fb4 100644 --- a/src/misc/crypt/crypt_find_hash_any.c +++ b/src/misc/crypt/crypt_find_hash_any.c @@ -42,6 +42,6 @@ return z; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_find_hash_id.c b/src/misc/crypt/crypt_find_hash_id.c index d94510d2f..ea784e8ac 100644 --- a/src/misc/crypt/crypt_find_hash_id.c +++ b/src/misc/crypt/crypt_find_hash_id.c @@ -33,6 +33,6 @@ int find_hash_id(unsigned char ID) return -1; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_find_hash_oid.c b/src/misc/crypt/crypt_find_hash_oid.c index a97ff6bf6..026cc73da 100644 --- a/src/misc/crypt/crypt_find_hash_oid.c +++ b/src/misc/crypt/crypt_find_hash_oid.c @@ -28,6 +28,6 @@ int find_hash_oid(const unsigned long *ID, unsigned long IDlen) return -1; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_find_prng.c b/src/misc/crypt/crypt_find_prng.c index 9acc6b5d6..a0cad16f7 100644 --- a/src/misc/crypt/crypt_find_prng.c +++ b/src/misc/crypt/crypt_find_prng.c @@ -34,6 +34,6 @@ int find_prng(const char *name) } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_fsa.c b/src/misc/crypt/crypt_fsa.c index 60f2099e3..dc2a570cf 100644 --- a/src/misc/crypt/crypt_fsa.c +++ b/src/misc/crypt/crypt_fsa.c @@ -51,6 +51,6 @@ int crypt_fsa(void *mp, ...) } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_hash_descriptor.c b/src/misc/crypt/crypt_hash_descriptor.c index 68abe6283..6e1103f2c 100644 --- a/src/misc/crypt/crypt_hash_descriptor.c +++ b/src/misc/crypt/crypt_hash_descriptor.c @@ -20,6 +20,6 @@ struct ltc_hash_descriptor hash_descriptor[TAB_SIZE] = { LTC_MUTEX_GLOBAL(ltc_hash_mutex) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_hash_is_valid.c b/src/misc/crypt/crypt_hash_is_valid.c index 8453942db..ca75f0502 100644 --- a/src/misc/crypt/crypt_hash_is_valid.c +++ b/src/misc/crypt/crypt_hash_is_valid.c @@ -29,6 +29,6 @@ int hash_is_valid(int idx) return CRYPT_OK; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_inits.c b/src/misc/crypt/crypt_inits.c index dd24f6551..8042f38da 100644 --- a/src/misc/crypt/crypt_inits.c +++ b/src/misc/crypt/crypt_inits.c @@ -38,6 +38,6 @@ void init_GMP(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_prng_descriptor.c b/src/misc/crypt/crypt_prng_descriptor.c index 3870c28b2..276047c56 100644 --- a/src/misc/crypt/crypt_prng_descriptor.c +++ b/src/misc/crypt/crypt_prng_descriptor.c @@ -19,6 +19,6 @@ struct ltc_prng_descriptor prng_descriptor[TAB_SIZE] = { LTC_MUTEX_GLOBAL(ltc_prng_mutex) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_prng_is_valid.c b/src/misc/crypt/crypt_prng_is_valid.c index ac78094c7..9930a06c1 100644 --- a/src/misc/crypt/crypt_prng_is_valid.c +++ b/src/misc/crypt/crypt_prng_is_valid.c @@ -29,6 +29,6 @@ int prng_is_valid(int idx) return CRYPT_OK; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_register_cipher.c b/src/misc/crypt/crypt_register_cipher.c index 242075edc..85178d23b 100644 --- a/src/misc/crypt/crypt_register_cipher.c +++ b/src/misc/crypt/crypt_register_cipher.c @@ -47,6 +47,6 @@ int register_cipher(const struct ltc_cipher_descriptor *cipher) return -1; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_register_hash.c b/src/misc/crypt/crypt_register_hash.c index 10cf94427..fc7f4e02a 100644 --- a/src/misc/crypt/crypt_register_hash.c +++ b/src/misc/crypt/crypt_register_hash.c @@ -47,6 +47,6 @@ int register_hash(const struct ltc_hash_descriptor *hash) return -1; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_register_prng.c b/src/misc/crypt/crypt_register_prng.c index 4438bc46b..9cbd634d2 100644 --- a/src/misc/crypt/crypt_register_prng.c +++ b/src/misc/crypt/crypt_register_prng.c @@ -47,6 +47,6 @@ int register_prng(const struct ltc_prng_descriptor *prng) return -1; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 309a43d6b..4b3d07751 100644 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -323,6 +323,6 @@ int crypt_list_all_sizes(char *names_list, unsigned int *names_list_size) { } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_unregister_cipher.c b/src/misc/crypt/crypt_unregister_cipher.c index 3932bddeb..b57c73652 100644 --- a/src/misc/crypt/crypt_unregister_cipher.c +++ b/src/misc/crypt/crypt_unregister_cipher.c @@ -38,6 +38,6 @@ int unregister_cipher(const struct ltc_cipher_descriptor *cipher) return CRYPT_ERROR; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_unregister_hash.c b/src/misc/crypt/crypt_unregister_hash.c index 56a8d2ea2..dbbff330b 100644 --- a/src/misc/crypt/crypt_unregister_hash.c +++ b/src/misc/crypt/crypt_unregister_hash.c @@ -37,6 +37,6 @@ int unregister_hash(const struct ltc_hash_descriptor *hash) return CRYPT_ERROR; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_unregister_prng.c b/src/misc/crypt/crypt_unregister_prng.c index b6fc7f5f3..f7606effd 100644 --- a/src/misc/crypt/crypt_unregister_prng.c +++ b/src/misc/crypt/crypt_unregister_prng.c @@ -37,6 +37,6 @@ int unregister_prng(const struct ltc_prng_descriptor *prng) return CRYPT_ERROR; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/error_to_string.c b/src/misc/error_to_string.c index 02bfbe7c5..8a5baeffb 100644 --- a/src/misc/error_to_string.c +++ b/src/misc/error_to_string.c @@ -73,6 +73,6 @@ const char *error_to_string(int err) } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index d4dcc784c..ca04ebbeb 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -309,6 +309,6 @@ int hkdf_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/mem_neq.c b/src/misc/mem_neq.c index 677209653..e20fd33e1 100644 --- a/src/misc/mem_neq.c +++ b/src/misc/mem_neq.c @@ -53,6 +53,6 @@ int mem_neq(const void *a, const void *b, size_t len) return ret; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/pkcs5/pkcs_5_1.c b/src/misc/pkcs5/pkcs_5_1.c index 4c294c709..10325de22 100644 --- a/src/misc/pkcs5/pkcs_5_1.c +++ b/src/misc/pkcs5/pkcs_5_1.c @@ -182,6 +182,6 @@ int pkcs_5_alg1_openssl(const unsigned char *password, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/pkcs5/pkcs_5_2.c b/src/misc/pkcs5/pkcs_5_2.c index 1a96c38ea..2265bcb27 100644 --- a/src/misc/pkcs5/pkcs_5_2.c +++ b/src/misc/pkcs5/pkcs_5_2.c @@ -122,6 +122,6 @@ int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index 1268154e5..d46ab20e4 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -229,6 +229,6 @@ int pkcs_5_test (void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/zeromem.c b/src/misc/zeromem.c index c1fded364..1a3b8ed3a 100644 --- a/src/misc/zeromem.c +++ b/src/misc/zeromem.c @@ -27,6 +27,6 @@ void zeromem(volatile void *out, size_t outlen) } } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cbc/cbc_decrypt.c b/src/modes/cbc/cbc_decrypt.c index 2748af4ff..e9f2785ac 100644 --- a/src/modes/cbc/cbc_decrypt.c +++ b/src/modes/cbc/cbc_decrypt.c @@ -90,6 +90,6 @@ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cbc/cbc_done.c b/src/modes/cbc/cbc_done.c index c4d96b728..2f1293dff 100644 --- a/src/modes/cbc/cbc_done.c +++ b/src/modes/cbc/cbc_done.c @@ -35,6 +35,6 @@ int cbc_done(symmetric_CBC *cbc) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cbc/cbc_encrypt.c b/src/modes/cbc/cbc_encrypt.c index ecba6817c..00d85fcbc 100644 --- a/src/modes/cbc/cbc_encrypt.c +++ b/src/modes/cbc/cbc_encrypt.c @@ -91,6 +91,6 @@ int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cbc/cbc_getiv.c b/src/modes/cbc/cbc_getiv.c index fc6a8c0a4..ef2e65939 100644 --- a/src/modes/cbc/cbc_getiv.c +++ b/src/modes/cbc/cbc_getiv.c @@ -39,6 +39,6 @@ int cbc_getiv(unsigned char *IV, unsigned long *len, symmetric_CBC *cbc) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cbc/cbc_setiv.c b/src/modes/cbc/cbc_setiv.c index b8c4ae1ca..06352adc8 100644 --- a/src/modes/cbc/cbc_setiv.c +++ b/src/modes/cbc/cbc_setiv.c @@ -37,6 +37,6 @@ int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cbc/cbc_start.c b/src/modes/cbc/cbc_start.c index 477301b19..93dd79394 100644 --- a/src/modes/cbc/cbc_start.c +++ b/src/modes/cbc/cbc_start.c @@ -55,6 +55,6 @@ int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cfb/cfb_decrypt.c b/src/modes/cfb/cfb_decrypt.c index aa7783b4f..9749a0bee 100644 --- a/src/modes/cfb/cfb_decrypt.c +++ b/src/modes/cfb/cfb_decrypt.c @@ -60,6 +60,6 @@ int cfb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cfb/cfb_done.c b/src/modes/cfb/cfb_done.c index b799d4b14..24576c827 100644 --- a/src/modes/cfb/cfb_done.c +++ b/src/modes/cfb/cfb_done.c @@ -35,6 +35,6 @@ int cfb_done(symmetric_CFB *cfb) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cfb/cfb_encrypt.c b/src/modes/cfb/cfb_encrypt.c index d6687a4c0..4503e5b06 100644 --- a/src/modes/cfb/cfb_encrypt.c +++ b/src/modes/cfb/cfb_encrypt.c @@ -58,6 +58,6 @@ int cfb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cfb/cfb_getiv.c b/src/modes/cfb/cfb_getiv.c index 328529cfc..e25d33300 100644 --- a/src/modes/cfb/cfb_getiv.c +++ b/src/modes/cfb/cfb_getiv.c @@ -39,6 +39,6 @@ int cfb_getiv(unsigned char *IV, unsigned long *len, symmetric_CFB *cfb) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cfb/cfb_setiv.c b/src/modes/cfb/cfb_setiv.c index d92dc1a22..ff4acc985 100644 --- a/src/modes/cfb/cfb_setiv.c +++ b/src/modes/cfb/cfb_setiv.c @@ -45,6 +45,6 @@ int cfb_setiv(const unsigned char *IV, unsigned long len, symmetric_CFB *cfb) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/cfb/cfb_start.c b/src/modes/cfb/cfb_start.c index 03b595972..6a97287d0 100644 --- a/src/modes/cfb/cfb_start.c +++ b/src/modes/cfb/cfb_start.c @@ -58,6 +58,6 @@ int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ctr/ctr_decrypt.c b/src/modes/ctr/ctr_decrypt.c index 4347569d7..500808907 100644 --- a/src/modes/ctr/ctr_decrypt.c +++ b/src/modes/ctr/ctr_decrypt.c @@ -35,6 +35,6 @@ int ctr_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ctr/ctr_done.c b/src/modes/ctr/ctr_done.c index 55bedaa51..3de13c2b7 100644 --- a/src/modes/ctr/ctr_done.c +++ b/src/modes/ctr/ctr_done.c @@ -35,6 +35,6 @@ int ctr_done(symmetric_CTR *ctr) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ctr/ctr_encrypt.c b/src/modes/ctr/ctr_encrypt.c index 3668fb677..ecc7b01b2 100644 --- a/src/modes/ctr/ctr_encrypt.c +++ b/src/modes/ctr/ctr_encrypt.c @@ -105,6 +105,6 @@ int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ctr/ctr_getiv.c b/src/modes/ctr/ctr_getiv.c index ea856d6bc..36ee393a5 100644 --- a/src/modes/ctr/ctr_getiv.c +++ b/src/modes/ctr/ctr_getiv.c @@ -39,6 +39,6 @@ int ctr_getiv(unsigned char *IV, unsigned long *len, symmetric_CTR *ctr) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ctr/ctr_setiv.c b/src/modes/ctr/ctr_setiv.c index cd7cb2abb..dbbf6a845 100644 --- a/src/modes/ctr/ctr_setiv.c +++ b/src/modes/ctr/ctr_setiv.c @@ -49,6 +49,6 @@ int ctr_setiv(const unsigned char *IV, unsigned long len, symmetric_CTR *ctr) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ctr/ctr_start.c b/src/modes/ctr/ctr_start.c index 4a0ce9d72..e77af4179 100644 --- a/src/modes/ctr/ctr_start.c +++ b/src/modes/ctr/ctr_start.c @@ -94,6 +94,6 @@ int ctr_start( int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ctr/ctr_test.c b/src/modes/ctr/ctr_test.c index 79dac6111..6574ef261 100644 --- a/src/modes/ctr/ctr_test.c +++ b/src/modes/ctr/ctr_test.c @@ -75,9 +75,9 @@ int ctr_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ecb/ecb_decrypt.c b/src/modes/ecb/ecb_decrypt.c index c28679deb..213b253a8 100644 --- a/src/modes/ecb/ecb_decrypt.c +++ b/src/modes/ecb/ecb_decrypt.c @@ -54,6 +54,6 @@ int ecb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ecb/ecb_done.c b/src/modes/ecb/ecb_done.c index d9652329b..6df7eecf6 100644 --- a/src/modes/ecb/ecb_done.c +++ b/src/modes/ecb/ecb_done.c @@ -35,6 +35,6 @@ int ecb_done(symmetric_ECB *ecb) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ecb/ecb_encrypt.c b/src/modes/ecb/ecb_encrypt.c index 0cbeddd8c..5d4661f57 100644 --- a/src/modes/ecb/ecb_encrypt.c +++ b/src/modes/ecb/ecb_encrypt.c @@ -54,6 +54,6 @@ int ecb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ecb/ecb_start.c b/src/modes/ecb/ecb_start.c index 509148062..ecd301bd9 100644 --- a/src/modes/ecb/ecb_start.c +++ b/src/modes/ecb/ecb_start.c @@ -41,6 +41,6 @@ int ecb_start(int cipher, const unsigned char *key, int keylen, int num_rounds, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/f8/f8_decrypt.c b/src/modes/f8/f8_decrypt.c index 49fadc4f1..9c92952b7 100644 --- a/src/modes/f8/f8_decrypt.c +++ b/src/modes/f8/f8_decrypt.c @@ -36,6 +36,6 @@ int f8_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, sy -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/f8/f8_done.c b/src/modes/f8/f8_done.c index f2fdf2b2c..3f0af661b 100644 --- a/src/modes/f8/f8_done.c +++ b/src/modes/f8/f8_done.c @@ -35,6 +35,6 @@ int f8_done(symmetric_F8 *f8) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/f8/f8_encrypt.c b/src/modes/f8/f8_encrypt.c index cb229962e..058f25aa4 100644 --- a/src/modes/f8/f8_encrypt.c +++ b/src/modes/f8/f8_encrypt.c @@ -96,6 +96,6 @@ int f8_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, sy #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/f8/f8_getiv.c b/src/modes/f8/f8_getiv.c index 68e562d9f..7be74cfa8 100644 --- a/src/modes/f8/f8_getiv.c +++ b/src/modes/f8/f8_getiv.c @@ -39,6 +39,6 @@ int f8_getiv(unsigned char *IV, unsigned long *len, symmetric_F8 *f8) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/f8/f8_setiv.c b/src/modes/f8/f8_setiv.c index 278da03e5..b708e40a2 100644 --- a/src/modes/f8/f8_setiv.c +++ b/src/modes/f8/f8_setiv.c @@ -45,6 +45,6 @@ int f8_setiv(const unsigned char *IV, unsigned long len, symmetric_F8 *f8) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/f8/f8_start.c b/src/modes/f8/f8_start.c index 13809c4b7..6beb2de9d 100644 --- a/src/modes/f8/f8_start.c +++ b/src/modes/f8/f8_start.c @@ -91,6 +91,6 @@ int f8_start( int cipher, const unsigned char *IV, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/f8/f8_test_mode.c b/src/modes/f8/f8_test_mode.c index a1b225d14..d9d0ccd6e 100644 --- a/src/modes/f8/f8_test_mode.c +++ b/src/modes/f8/f8_test_mode.c @@ -69,6 +69,6 @@ int f8_test_mode(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/lrw/lrw_decrypt.c b/src/modes/lrw/lrw_decrypt.c index 0c75fe320..bfedb64da 100644 --- a/src/modes/lrw/lrw_decrypt.c +++ b/src/modes/lrw/lrw_decrypt.c @@ -44,6 +44,6 @@ int lrw_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/lrw/lrw_done.c b/src/modes/lrw/lrw_done.c index a8018ca28..0088f6287 100644 --- a/src/modes/lrw/lrw_done.c +++ b/src/modes/lrw/lrw_done.c @@ -35,6 +35,6 @@ int lrw_done(symmetric_LRW *lrw) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/lrw/lrw_encrypt.c b/src/modes/lrw/lrw_encrypt.c index 21df206d2..0738648e1 100644 --- a/src/modes/lrw/lrw_encrypt.c +++ b/src/modes/lrw/lrw_encrypt.c @@ -43,6 +43,6 @@ int lrw_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/lrw/lrw_getiv.c b/src/modes/lrw/lrw_getiv.c index 2c54ad600..6dcd96d20 100644 --- a/src/modes/lrw/lrw_getiv.c +++ b/src/modes/lrw/lrw_getiv.c @@ -38,6 +38,6 @@ int lrw_getiv(unsigned char *IV, unsigned long *len, symmetric_LRW *lrw) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/lrw/lrw_process.c b/src/modes/lrw/lrw_process.c index 43f158ef1..0896bc641 100644 --- a/src/modes/lrw/lrw_process.c +++ b/src/modes/lrw/lrw_process.c @@ -113,6 +113,6 @@ int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, i } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/lrw/lrw_setiv.c b/src/modes/lrw/lrw_setiv.c index 66402a439..5c04157a6 100644 --- a/src/modes/lrw/lrw_setiv.c +++ b/src/modes/lrw/lrw_setiv.c @@ -72,6 +72,6 @@ int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/lrw/lrw_start.c b/src/modes/lrw/lrw_start.c index 29ffc7e9f..e13d3bdd3 100644 --- a/src/modes/lrw/lrw_start.c +++ b/src/modes/lrw/lrw_start.c @@ -96,6 +96,6 @@ int lrw_start( int cipher, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/lrw/lrw_test.c b/src/modes/lrw/lrw_test.c index 0652a9f86..10ff919a8 100644 --- a/src/modes/lrw/lrw_test.c +++ b/src/modes/lrw/lrw_test.c @@ -129,6 +129,6 @@ int lrw_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ofb/ofb_decrypt.c b/src/modes/ofb/ofb_decrypt.c index b59d56e77..f40280263 100644 --- a/src/modes/ofb/ofb_decrypt.c +++ b/src/modes/ofb/ofb_decrypt.c @@ -36,6 +36,6 @@ int ofb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ofb/ofb_done.c b/src/modes/ofb/ofb_done.c index 297525319..9caddbeb5 100644 --- a/src/modes/ofb/ofb_done.c +++ b/src/modes/ofb/ofb_done.c @@ -35,6 +35,6 @@ int ofb_done(symmetric_OFB *ofb) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ofb/ofb_encrypt.c b/src/modes/ofb/ofb_encrypt.c index 7116a008a..415842d3e 100644 --- a/src/modes/ofb/ofb_encrypt.c +++ b/src/modes/ofb/ofb_encrypt.c @@ -53,6 +53,6 @@ int ofb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, s #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ofb/ofb_getiv.c b/src/modes/ofb/ofb_getiv.c index 15fd11e7a..37c40a64d 100644 --- a/src/modes/ofb/ofb_getiv.c +++ b/src/modes/ofb/ofb_getiv.c @@ -39,6 +39,6 @@ int ofb_getiv(unsigned char *IV, unsigned long *len, symmetric_OFB *ofb) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ofb/ofb_setiv.c b/src/modes/ofb/ofb_setiv.c index d157e46d6..692525b72 100644 --- a/src/modes/ofb/ofb_setiv.c +++ b/src/modes/ofb/ofb_setiv.c @@ -45,6 +45,6 @@ int ofb_setiv(const unsigned char *IV, unsigned long len, symmetric_OFB *ofb) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/ofb/ofb_start.c b/src/modes/ofb/ofb_start.c index f780ee8f6..d981d57ca 100644 --- a/src/modes/ofb/ofb_start.c +++ b/src/modes/ofb/ofb_start.c @@ -53,6 +53,6 @@ int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index 8da3895ad..af3fbf63f 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -151,6 +151,6 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/xts/xts_done.c b/src/modes/xts/xts_done.c index d7721f8cf..558c04327 100644 --- a/src/modes/xts/xts_done.c +++ b/src/modes/xts/xts_done.c @@ -26,6 +26,6 @@ void xts_done(symmetric_xts *xts) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index 6ab6aa172..235aaa8bc 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -152,6 +152,6 @@ int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/xts/xts_init.c b/src/modes/xts/xts_init.c index fe6707e20..be0ac6ad4 100644 --- a/src/modes/xts/xts_init.c +++ b/src/modes/xts/xts_init.c @@ -56,6 +56,6 @@ int xts_start(int cipher, const unsigned char *key1, const unsigned char *key2, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/xts/xts_mult_x.c b/src/modes/xts/xts_mult_x.c index 0113473a9..3fad22bd8 100644 --- a/src/modes/xts/xts_mult_x.c +++ b/src/modes/xts/xts_mult_x.c @@ -34,6 +34,6 @@ void xts_mult_x(unsigned char *I) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index dd679e3c9..6c721a442 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -299,6 +299,6 @@ int xts_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/bit/der_decode_bit_string.c b/src/pk/asn1/der/bit/der_decode_bit_string.c index afa43910e..5203fcfde 100644 --- a/src/pk/asn1/der/bit/der_decode_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_bit_string.c @@ -95,6 +95,6 @@ int der_decode_bit_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index cbfe741f4..9b8bbaccd 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -99,6 +99,6 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/bit/der_encode_bit_string.c b/src/pk/asn1/der/bit/der_encode_bit_string.c index 03f01baa3..c552184c7 100644 --- a/src/pk/asn1/der/bit/der_encode_bit_string.c +++ b/src/pk/asn1/der/bit/der_encode_bit_string.c @@ -82,6 +82,6 @@ int der_encode_bit_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c index 66a3b8242..7e29d8cef 100644 --- a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c @@ -85,6 +85,6 @@ int der_encode_raw_bit_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/bit/der_length_bit_string.c b/src/pk/asn1/der/bit/der_length_bit_string.c index fd973b4ac..b9c99fb17 100644 --- a/src/pk/asn1/der/bit/der_length_bit_string.c +++ b/src/pk/asn1/der/bit/der_length_bit_string.c @@ -47,6 +47,6 @@ int der_length_bit_string(unsigned long nbits, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/boolean/der_decode_boolean.c b/src/pk/asn1/der/boolean/der_decode_boolean.c index b8e4f08e9..da60ca902 100644 --- a/src/pk/asn1/der/boolean/der_decode_boolean.c +++ b/src/pk/asn1/der/boolean/der_decode_boolean.c @@ -40,6 +40,6 @@ int der_decode_boolean(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/boolean/der_encode_boolean.c b/src/pk/asn1/der/boolean/der_encode_boolean.c index d6dc6afc5..c5cacdd41 100644 --- a/src/pk/asn1/der/boolean/der_encode_boolean.c +++ b/src/pk/asn1/der/boolean/der_encode_boolean.c @@ -44,6 +44,6 @@ int der_encode_boolean(int in, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/boolean/der_length_boolean.c b/src/pk/asn1/der/boolean/der_length_boolean.c index 2d434861f..a1a3a7b92 100644 --- a/src/pk/asn1/der/boolean/der_length_boolean.c +++ b/src/pk/asn1/der/boolean/der_length_boolean.c @@ -28,6 +28,6 @@ int der_length_boolean(unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/choice/der_decode_choice.c b/src/pk/asn1/der/choice/der_decode_choice.c index 07c56e3e9..0bfd3bb65 100644 --- a/src/pk/asn1/der/choice/der_decode_choice.c +++ b/src/pk/asn1/der/choice/der_decode_choice.c @@ -218,6 +218,6 @@ int der_decode_choice(const unsigned char *in, unsigned long *inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c index 507c72e39..88f56ec58 100644 --- a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c @@ -139,6 +139,6 @@ YYYYMMDDhhmmss.fs-hh'mm' #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c index 58e6d2703..f32efe81a 100644 --- a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c @@ -103,6 +103,6 @@ int der_encode_generalizedtime(ltc_generalizedtime *gtime, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c index b7849be86..e6cb35f0f 100644 --- a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c @@ -53,6 +53,6 @@ int der_length_generalizedtime(ltc_generalizedtime *gtime, unsigned long *outlen #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/ia5/der_decode_ia5_string.c b/src/pk/asn1/der/ia5/der_decode_ia5_string.c index 23bd4ae77..c3472519e 100644 --- a/src/pk/asn1/der/ia5/der_decode_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_decode_ia5_string.c @@ -89,6 +89,6 @@ int der_decode_ia5_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/ia5/der_encode_ia5_string.c b/src/pk/asn1/der/ia5/der_encode_ia5_string.c index 9fca2cf94..18b926eac 100644 --- a/src/pk/asn1/der/ia5/der_encode_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_encode_ia5_string.c @@ -78,6 +78,6 @@ int der_encode_ia5_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/ia5/der_length_ia5_string.c b/src/pk/asn1/der/ia5/der_length_ia5_string.c index 959d27d0d..5f1a78d1e 100644 --- a/src/pk/asn1/der/ia5/der_length_ia5_string.c +++ b/src/pk/asn1/der/ia5/der_length_ia5_string.c @@ -187,6 +187,6 @@ int der_length_ia5_string(const unsigned char *octets, unsigned long noctets, un #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/integer/der_decode_integer.c b/src/pk/asn1/der/integer/der_decode_integer.c index 848dba24f..88cf93f32 100644 --- a/src/pk/asn1/der/integer/der_decode_integer.c +++ b/src/pk/asn1/der/integer/der_decode_integer.c @@ -103,6 +103,6 @@ int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/integer/der_encode_integer.c b/src/pk/asn1/der/integer/der_encode_integer.c index 4f471eb46..a8bada558 100644 --- a/src/pk/asn1/der/integer/der_encode_integer.c +++ b/src/pk/asn1/der/integer/der_encode_integer.c @@ -123,6 +123,6 @@ int der_encode_integer(void *num, unsigned char *out, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/integer/der_length_integer.c b/src/pk/asn1/der/integer/der_length_integer.c index 446f5e84b..753ef0e09 100644 --- a/src/pk/asn1/der/integer/der_length_integer.c +++ b/src/pk/asn1/der/integer/der_length_integer.c @@ -74,6 +74,6 @@ int der_length_integer(void *num, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c b/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c index 34f6ee31b..c957565d6 100644 --- a/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c @@ -92,6 +92,6 @@ int der_decode_object_identifier(const unsigned char *in, unsigned long inle #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c b/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c index ea982ae75..b1ce62c9a 100644 --- a/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c @@ -104,6 +104,6 @@ int der_encode_object_identifier(unsigned long *words, unsigned long nwords, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/object_identifier/der_length_object_identifier.c b/src/pk/asn1/der/object_identifier/der_length_object_identifier.c index 2b7bbcb71..ac0891547 100644 --- a/src/pk/asn1/der/object_identifier/der_length_object_identifier.c +++ b/src/pk/asn1/der/object_identifier/der_length_object_identifier.c @@ -82,6 +82,6 @@ int der_length_object_identifier(unsigned long *words, unsigned long nwords, uns #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/octet/der_decode_octet_string.c b/src/pk/asn1/der/octet/der_decode_octet_string.c index 0220c5f79..02859dca5 100644 --- a/src/pk/asn1/der/octet/der_decode_octet_string.c +++ b/src/pk/asn1/der/octet/der_decode_octet_string.c @@ -84,6 +84,6 @@ int der_decode_octet_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/octet/der_encode_octet_string.c b/src/pk/asn1/der/octet/der_encode_octet_string.c index f10bb1bb9..9c9d1a656 100644 --- a/src/pk/asn1/der/octet/der_encode_octet_string.c +++ b/src/pk/asn1/der/octet/der_encode_octet_string.c @@ -79,6 +79,6 @@ int der_encode_octet_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/octet/der_length_octet_string.c b/src/pk/asn1/der/octet/der_length_octet_string.c index b2d283c24..10c9e892a 100644 --- a/src/pk/asn1/der/octet/der_length_octet_string.c +++ b/src/pk/asn1/der/octet/der_length_octet_string.c @@ -46,6 +46,6 @@ int der_length_octet_string(unsigned long noctets, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/printable_string/der_decode_printable_string.c b/src/pk/asn1/der/printable_string/der_decode_printable_string.c index 9e1876b90..694742921 100644 --- a/src/pk/asn1/der/printable_string/der_decode_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_decode_printable_string.c @@ -89,6 +89,6 @@ int der_decode_printable_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/printable_string/der_encode_printable_string.c b/src/pk/asn1/der/printable_string/der_encode_printable_string.c index f2897deb4..ee54e48ff 100644 --- a/src/pk/asn1/der/printable_string/der_encode_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_encode_printable_string.c @@ -78,6 +78,6 @@ int der_encode_printable_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/printable_string/der_length_printable_string.c b/src/pk/asn1/der/printable_string/der_length_printable_string.c index 0d2f38564..40f0beb42 100644 --- a/src/pk/asn1/der/printable_string/der_length_printable_string.c +++ b/src/pk/asn1/der/printable_string/der_length_printable_string.c @@ -159,6 +159,6 @@ int der_length_printable_string(const unsigned char *octets, unsigned long nocte #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index b41a16893..6b56b2955 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -317,6 +317,6 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index 0724e4bc7..08c698936 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -468,6 +468,6 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index 29ab5536a..4c943a766 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -140,6 +140,6 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index 02c30d9b3..0f3506e10 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -144,6 +144,6 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_length_sequence.c b/src/pk/asn1/der/sequence/der_length_sequence.c index d8a7457d3..2e8c436fc 100644 --- a/src/pk/asn1/der/sequence/der_length_sequence.c +++ b/src/pk/asn1/der/sequence/der_length_sequence.c @@ -180,6 +180,6 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_sequence_free.c b/src/pk/asn1/der/sequence/der_sequence_free.c index ca0771173..3c2a66383 100644 --- a/src/pk/asn1/der/sequence/der_sequence_free.c +++ b/src/pk/asn1/der/sequence/der_sequence_free.c @@ -58,6 +58,6 @@ void der_sequence_free(ltc_asn1_list *in) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_sequence_shrink.c b/src/pk/asn1/der/sequence/der_sequence_shrink.c index b5db2fcaa..9b9e036aa 100644 --- a/src/pk/asn1/der/sequence/der_sequence_shrink.c +++ b/src/pk/asn1/der/sequence/der_sequence_shrink.c @@ -45,6 +45,6 @@ void der_sequence_shrink(ltc_asn1_list *in) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/set/der_encode_set.c b/src/pk/asn1/der/set/der_encode_set.c index e0e802260..a64bae917 100644 --- a/src/pk/asn1/der/set/der_encode_set.c +++ b/src/pk/asn1/der/set/der_encode_set.c @@ -103,6 +103,6 @@ int der_encode_set(ltc_asn1_list *list, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/set/der_encode_setof.c b/src/pk/asn1/der/set/der_encode_setof.c index 182846dc5..b3c932f59 100644 --- a/src/pk/asn1/der/set/der_encode_setof.c +++ b/src/pk/asn1/der/set/der_encode_setof.c @@ -156,6 +156,6 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/short_integer/der_decode_short_integer.c b/src/pk/asn1/der/short_integer/der_decode_short_integer.c index 5a52fec58..71debf310 100644 --- a/src/pk/asn1/der/short_integer/der_decode_short_integer.c +++ b/src/pk/asn1/der/short_integer/der_decode_short_integer.c @@ -61,6 +61,6 @@ int der_decode_short_integer(const unsigned char *in, unsigned long inlen, unsig #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/short_integer/der_encode_short_integer.c b/src/pk/asn1/der/short_integer/der_encode_short_integer.c index 1cb59e199..ea413ebc4 100644 --- a/src/pk/asn1/der/short_integer/der_encode_short_integer.c +++ b/src/pk/asn1/der/short_integer/der_encode_short_integer.c @@ -90,6 +90,6 @@ int der_encode_short_integer(unsigned long num, unsigned char *out, unsigned lon #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/short_integer/der_length_short_integer.c b/src/pk/asn1/der/short_integer/der_length_short_integer.c index 836e13e33..52d0e1aef 100644 --- a/src/pk/asn1/der/short_integer/der_length_short_integer.c +++ b/src/pk/asn1/der/short_integer/der_length_short_integer.c @@ -63,6 +63,6 @@ int der_length_short_integer(unsigned long num, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c b/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c index cb8467f9f..0c7c3c8f2 100644 --- a/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c +++ b/src/pk/asn1/der/teletex_string/der_decode_teletex_string.c @@ -88,6 +88,6 @@ int der_decode_teletex_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/teletex_string/der_length_teletex_string.c b/src/pk/asn1/der/teletex_string/der_length_teletex_string.c index 8cbae2dfe..29fe5b0b8 100644 --- a/src/pk/asn1/der/teletex_string/der_length_teletex_string.c +++ b/src/pk/asn1/der/teletex_string/der_length_teletex_string.c @@ -203,6 +203,6 @@ int der_length_teletex_string(const unsigned char *octets, unsigned long noctets #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/utctime/der_decode_utctime.c b/src/pk/asn1/der/utctime/der_decode_utctime.c index 97d28affd..1a009bceb 100644 --- a/src/pk/asn1/der/utctime/der_decode_utctime.c +++ b/src/pk/asn1/der/utctime/der_decode_utctime.c @@ -120,6 +120,6 @@ YYMMDDhhmmss-hh'mm' #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/utctime/der_encode_utctime.c b/src/pk/asn1/der/utctime/der_encode_utctime.c index 23b26eba1..c6c8464cf 100644 --- a/src/pk/asn1/der/utctime/der_encode_utctime.c +++ b/src/pk/asn1/der/utctime/der_encode_utctime.c @@ -76,6 +76,6 @@ int der_encode_utctime(ltc_utctime *utctime, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/utctime/der_length_utctime.c b/src/pk/asn1/der/utctime/der_length_utctime.c index 5a1e02723..420208324 100644 --- a/src/pk/asn1/der/utctime/der_length_utctime.c +++ b/src/pk/asn1/der/utctime/der_length_utctime.c @@ -39,6 +39,6 @@ int der_length_utctime(ltc_utctime *utctime, unsigned long *outlen) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/utf8/der_decode_utf8_string.c b/src/pk/asn1/der/utf8/der_decode_utf8_string.c index 037579a81..d857ce958 100644 --- a/src/pk/asn1/der/utf8/der_decode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_decode_utf8_string.c @@ -104,6 +104,6 @@ int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/utf8/der_encode_utf8_string.c b/src/pk/asn1/der/utf8/der_encode_utf8_string.c index 0fb19699c..63ad840f9 100644 --- a/src/pk/asn1/der/utf8/der_encode_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_encode_utf8_string.c @@ -99,6 +99,6 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/utf8/der_length_utf8_string.c b/src/pk/asn1/der/utf8/der_length_utf8_string.c index e5413d02c..88f4355e3 100644 --- a/src/pk/asn1/der/utf8/der_length_utf8_string.c +++ b/src/pk/asn1/der/utf8/der_length_utf8_string.c @@ -97,6 +97,6 @@ int der_length_utf8_string(const wchar_t *in, unsigned long noctets, unsigned lo #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_decrypt_key.c b/src/pk/dsa/dsa_decrypt_key.c index 7d2a4a68e..bee276a7c 100644 --- a/src/pk/dsa/dsa_decrypt_key.c +++ b/src/pk/dsa/dsa_decrypt_key.c @@ -132,7 +132,7 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_encrypt_key.c b/src/pk/dsa/dsa_encrypt_key.c index 9d0af7e01..896baa39c 100644 --- a/src/pk/dsa/dsa_encrypt_key.c +++ b/src/pk/dsa/dsa_encrypt_key.c @@ -124,7 +124,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_export.c b/src/pk/dsa/dsa_export.c index 7b34b1e01..1f6bb5a3d 100644 --- a/src/pk/dsa/dsa_export.c +++ b/src/pk/dsa/dsa_export.c @@ -111,6 +111,6 @@ int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_free.c b/src/pk/dsa/dsa_free.c index afc128dd7..89b5c663f 100644 --- a/src/pk/dsa/dsa_free.c +++ b/src/pk/dsa/dsa_free.c @@ -27,6 +27,6 @@ void dsa_free(dsa_key *key) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 50b8ff1c2..e1edaab5f 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -131,6 +131,6 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index fbd522652..aea5ea7e6 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -261,6 +261,6 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_shared_secret.c b/src/pk/dsa/dsa_shared_secret.c index 126c7866a..4c18261b4 100644 --- a/src/pk/dsa/dsa_shared_secret.c +++ b/src/pk/dsa/dsa_shared_secret.c @@ -64,7 +64,7 @@ int dsa_shared_secret(void *private_key, void *base, } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_sign_hash.c b/src/pk/dsa/dsa_sign_hash.c index cbff27af2..fda2ca125 100644 --- a/src/pk/dsa/dsa_sign_hash.c +++ b/src/pk/dsa/dsa_sign_hash.c @@ -147,6 +147,6 @@ int dsa_sign_hash(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index 5235bbbdd..f3c22354f 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -122,6 +122,6 @@ int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index bb239cdcb..d263d4e13 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -93,6 +93,6 @@ int dsa_verify_key(dsa_key *key, int *stat) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc.c b/src/pk/ecc/ecc.c index efa806017..18da0b3fd 100644 --- a/src/pk/ecc/ecc.c +++ b/src/pk/ecc/ecc.c @@ -119,7 +119,7 @@ const ltc_ecc_set_type ltc_ecc_sets[] = { #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_ansi_x963_export.c b/src/pk/ecc/ecc_ansi_x963_export.c index 54b99afb5..773b68334 100644 --- a/src/pk/ecc/ecc_ansi_x963_export.c +++ b/src/pk/ecc/ecc_ansi_x963_export.c @@ -72,6 +72,6 @@ int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_ansi_x963_import.c b/src/pk/ecc/ecc_ansi_x963_import.c index 97af00f8f..ee5a4c9a0 100644 --- a/src/pk/ecc/ecc_ansi_x963_import.c +++ b/src/pk/ecc/ecc_ansi_x963_import.c @@ -97,6 +97,6 @@ int ecc_ansi_x963_import_ex(const unsigned char *in, unsigned long inlen, ecc_ke #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_decrypt_key.c b/src/pk/ecc/ecc_decrypt_key.c index 8c2189032..e0d3fd33d 100644 --- a/src/pk/ecc/ecc_decrypt_key.c +++ b/src/pk/ecc/ecc_decrypt_key.c @@ -142,7 +142,7 @@ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_encrypt_key.c b/src/pk/ecc/ecc_encrypt_key.c index 9649473b7..e92738bc1 100644 --- a/src/pk/ecc/ecc_encrypt_key.c +++ b/src/pk/ecc/ecc_encrypt_key.c @@ -128,7 +128,7 @@ int ecc_encrypt_key(const unsigned char *in, unsigned long inlen, } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_export.c b/src/pk/ecc/ecc_export.c index 9089a3acd..6c2659e9d 100644 --- a/src/pk/ecc/ecc_export.c +++ b/src/pk/ecc/ecc_export.c @@ -74,7 +74,7 @@ int ecc_export(unsigned char *out, unsigned long *outlen, int type, ecc_key *key } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_free.c b/src/pk/ecc/ecc_free.c index 588defb8b..4a8ca455c 100644 --- a/src/pk/ecc/ecc_free.c +++ b/src/pk/ecc/ecc_free.c @@ -32,7 +32,7 @@ void ecc_free(ecc_key *key) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_get_size.c b/src/pk/ecc/ecc_get_size.c index bf43fb536..4dc5d2227 100644 --- a/src/pk/ecc/ecc_get_size.c +++ b/src/pk/ecc/ecc_get_size.c @@ -36,7 +36,7 @@ int ecc_get_size(ecc_key *key) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index 3bd0d75df..98ec70fa4 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -164,7 +164,7 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co return err; } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_make_key.c b/src/pk/ecc/ecc_make_key.c index 19b90a757..113a99442 100644 --- a/src/pk/ecc/ecc_make_key.c +++ b/src/pk/ecc/ecc_make_key.c @@ -122,7 +122,7 @@ int ecc_make_key_ex(prng_state *prng, int wprng, ecc_key *key, const ltc_ecc_set } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_shared_secret.c b/src/pk/ecc/ecc_shared_secret.c index 38be8bf2b..d18a20581 100644 --- a/src/pk/ecc/ecc_shared_secret.c +++ b/src/pk/ecc/ecc_shared_secret.c @@ -87,7 +87,7 @@ int ecc_shared_secret(ecc_key *private_key, ecc_key *public_key, } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index b9e178ecb..98967830c 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -145,7 +145,7 @@ int ecc_sign_hash(const unsigned char *in, unsigned long inlen, } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_sizes.c b/src/pk/ecc/ecc_sizes.c index bb9d6d90c..7c311fefd 100644 --- a/src/pk/ecc/ecc_sizes.c +++ b/src/pk/ecc/ecc_sizes.c @@ -40,7 +40,7 @@ void ecc_sizes(int *low, int *high) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_test.c b/src/pk/ecc/ecc_test.c index 96f2a87f8..b6d54d1e8 100644 --- a/src/pk/ecc/ecc_test.c +++ b/src/pk/ecc/ecc_test.c @@ -87,7 +87,7 @@ int ecc_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ecc_verify_hash.c b/src/pk/ecc/ecc_verify_hash.c index ff1d66c71..80a2a6203 100644 --- a/src/pk/ecc/ecc_verify_hash.c +++ b/src/pk/ecc/ecc_verify_hash.c @@ -194,7 +194,7 @@ int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ltc_ecc_is_valid_idx.c b/src/pk/ecc/ltc_ecc_is_valid_idx.c index 65c3ae7b2..057a89943 100644 --- a/src/pk/ecc/ltc_ecc_is_valid_idx.c +++ b/src/pk/ecc/ltc_ecc_is_valid_idx.c @@ -38,7 +38,7 @@ int ltc_ecc_is_valid_idx(int n) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ltc_ecc_map.c b/src/pk/ecc/ltc_ecc_map.c index cdde5ecc2..0cc699c94 100644 --- a/src/pk/ecc/ltc_ecc_map.c +++ b/src/pk/ecc/ltc_ecc_map.c @@ -68,7 +68,7 @@ int ltc_ecc_map(ecc_point *P, void *modulus, void *mp) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ltc_ecc_mul2add.c b/src/pk/ecc/ltc_ecc_mul2add.c index 3720ecbc9..cef184469 100644 --- a/src/pk/ecc/ltc_ecc_mul2add.c +++ b/src/pk/ecc/ltc_ecc_mul2add.c @@ -201,6 +201,6 @@ int ltc_ecc_mul2add(ecc_point *A, void *kA, #endif #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ltc_ecc_mulmod.c b/src/pk/ecc/ltc_ecc_mulmod.c index e20e28579..583486560 100644 --- a/src/pk/ecc/ltc_ecc_mulmod.c +++ b/src/pk/ecc/ltc_ecc_mulmod.c @@ -215,6 +215,6 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ltc_ecc_mulmod_timing.c b/src/pk/ecc/ltc_ecc_mulmod_timing.c index 6fa7030b0..ab26ede24 100644 --- a/src/pk/ecc/ltc_ecc_mulmod_timing.c +++ b/src/pk/ecc/ltc_ecc_mulmod_timing.c @@ -157,7 +157,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) #endif #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ltc_ecc_points.c b/src/pk/ecc/ltc_ecc_points.c index 2955e399f..a63bdb507 100644 --- a/src/pk/ecc/ltc_ecc_points.c +++ b/src/pk/ecc/ltc_ecc_points.c @@ -52,7 +52,7 @@ void ltc_ecc_del_point(ecc_point *p) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ltc_ecc_projective_add_point.c b/src/pk/ecc/ltc_ecc_projective_add_point.c index 9c8a63012..9e22e108e 100644 --- a/src/pk/ecc/ltc_ecc_projective_add_point.c +++ b/src/pk/ecc/ltc_ecc_projective_add_point.c @@ -188,7 +188,7 @@ int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/ecc/ltc_ecc_projective_dbl_point.c b/src/pk/ecc/ltc_ecc_projective_dbl_point.c index 058f9dd82..0c6b99605 100644 --- a/src/pk/ecc/ltc_ecc_projective_dbl_point.c +++ b/src/pk/ecc/ltc_ecc_projective_dbl_point.c @@ -139,7 +139,7 @@ int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void return err; } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/katja/katja_decrypt_key.c b/src/pk/katja/katja_decrypt_key.c index bd44b9951..72009b0fb 100644 --- a/src/pk/katja/katja_decrypt_key.c +++ b/src/pk/katja/katja_decrypt_key.c @@ -98,6 +98,6 @@ int katja_decrypt_key(const unsigned char *in, unsigned long inlen, -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/katja/katja_encrypt_key.c b/src/pk/katja/katja_encrypt_key.c index 2b4dddcab..9ed72fb0d 100644 --- a/src/pk/katja/katja_encrypt_key.c +++ b/src/pk/katja/katja_encrypt_key.c @@ -80,6 +80,6 @@ int katja_encrypt_key(const unsigned char *in, unsigned long inlen, #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/katja/katja_export.c b/src/pk/katja/katja_export.c index 9e0fa3d41..0412e655d 100644 --- a/src/pk/katja/katja_export.c +++ b/src/pk/katja/katja_export.c @@ -68,6 +68,6 @@ int katja_export(unsigned char *out, unsigned long *outlen, int type, katja_key #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/katja/katja_exptmod.c b/src/pk/katja/katja_exptmod.c index 284091c71..afc847f15 100644 --- a/src/pk/katja/katja_exptmod.c +++ b/src/pk/katja/katja_exptmod.c @@ -108,6 +108,6 @@ int katja_exptmod(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/katja/katja_free.c b/src/pk/katja/katja_free.c index 1a356a1bc..117bbf451 100644 --- a/src/pk/katja/katja_free.c +++ b/src/pk/katja/katja_free.c @@ -28,6 +28,6 @@ void katja_free(katja_key *key) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/katja/katja_import.c b/src/pk/katja/katja_import.c index 8eba7e570..98357c03d 100644 --- a/src/pk/katja/katja_import.c +++ b/src/pk/katja/katja_import.c @@ -74,6 +74,6 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key) #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/katja/katja_make_key.c b/src/pk/katja/katja_make_key.c index 724ff0bc5..6f83bcc3a 100644 --- a/src/pk/katja/katja_make_key.c +++ b/src/pk/katja/katja_make_key.c @@ -94,6 +94,6 @@ int katja_make_key(prng_state *prng, int wprng, int size, katja_key *key) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_i2osp.c b/src/pk/pkcs1/pkcs_1_i2osp.c index 97a90fd71..5324c1ea1 100644 --- a/src/pk/pkcs1/pkcs_1_i2osp.c +++ b/src/pk/pkcs1/pkcs_1_i2osp.c @@ -44,6 +44,6 @@ int pkcs_1_i2osp(void *n, unsigned long modulus_len, unsigned char *out) #endif /* LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_mgf1.c b/src/pk/pkcs1/pkcs_1_mgf1.c index 3b5cce4dd..c6283ca70 100644 --- a/src/pk/pkcs1/pkcs_1_mgf1.c +++ b/src/pk/pkcs1/pkcs_1_mgf1.c @@ -101,6 +101,6 @@ int pkcs_1_mgf1(int hash_idx, #endif /* LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_oaep_decode.c b/src/pk/pkcs1/pkcs_1_oaep_decode.c index 6a2422beb..27c92456c 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -180,6 +180,6 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, #endif /* LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_oaep_encode.c b/src/pk/pkcs1/pkcs_1_oaep_encode.c index 363116a57..50429467f 100644 --- a/src/pk/pkcs1/pkcs_1_oaep_encode.c +++ b/src/pk/pkcs1/pkcs_1_oaep_encode.c @@ -166,6 +166,6 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, #endif /* LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_os2ip.c b/src/pk/pkcs1/pkcs_1_os2ip.c index 3163eface..743c70b30 100644 --- a/src/pk/pkcs1/pkcs_1_os2ip.c +++ b/src/pk/pkcs1/pkcs_1_os2ip.c @@ -29,6 +29,6 @@ int pkcs_1_os2ip(void *n, unsigned char *in, unsigned long inlen) #endif /* LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_pss_decode.c b/src/pk/pkcs1/pkcs_1_pss_decode.c index cf6546007..8e112a14c 100644 --- a/src/pk/pkcs1/pkcs_1_pss_decode.c +++ b/src/pk/pkcs1/pkcs_1_pss_decode.c @@ -171,6 +171,6 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, #endif /* LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_pss_encode.c b/src/pk/pkcs1/pkcs_1_pss_encode.c index 94f834f73..c795114b9 100644 --- a/src/pk/pkcs1/pkcs_1_pss_encode.c +++ b/src/pk/pkcs1/pkcs_1_pss_encode.c @@ -169,6 +169,6 @@ int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, #endif /* LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_v1_5_decode.c b/src/pk/pkcs1/pkcs_1_v1_5_decode.c index 3f3ecf986..94e1b2a39 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_decode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_decode.c @@ -107,6 +107,6 @@ int pkcs_1_v1_5_decode(const unsigned char *msg, #endif /* #ifdef LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/pkcs1/pkcs_1_v1_5_encode.c b/src/pk/pkcs1/pkcs_1_v1_5_encode.c index 6212e52d8..dd92c64e9 100644 --- a/src/pk/pkcs1/pkcs_1_v1_5_encode.c +++ b/src/pk/pkcs1/pkcs_1_v1_5_encode.c @@ -104,6 +104,6 @@ int pkcs_1_v1_5_encode(const unsigned char *msg, #endif /* #ifdef LTC_PKCS_1 */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_decrypt_key.c b/src/pk/rsa/rsa_decrypt_key.c index 51117a892..9e1bceded 100644 --- a/src/pk/rsa/rsa_decrypt_key.c +++ b/src/pk/rsa/rsa_decrypt_key.c @@ -98,6 +98,6 @@ int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen, #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_encrypt_key.c b/src/pk/rsa/rsa_encrypt_key.c index 9ea2b7124..ef066d2d0 100644 --- a/src/pk/rsa/rsa_encrypt_key.c +++ b/src/pk/rsa/rsa_encrypt_key.c @@ -95,6 +95,6 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_export.c b/src/pk/rsa/rsa_export.c index 6609361a5..a9885de8f 100644 --- a/src/pk/rsa/rsa_export.c +++ b/src/pk/rsa/rsa_export.c @@ -92,6 +92,6 @@ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 2b3b4a8d9..e85be4435 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -175,6 +175,6 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_free.c b/src/pk/rsa/rsa_free.c index eb7a3aefc..48039e4a4 100644 --- a/src/pk/rsa/rsa_free.c +++ b/src/pk/rsa/rsa_free.c @@ -27,6 +27,6 @@ void rsa_free(rsa_key *key) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_get_size.c b/src/pk/rsa/rsa_get_size.c index 1ed74a7bb..8c9019475 100644 --- a/src/pk/rsa/rsa_get_size.c +++ b/src/pk/rsa/rsa_get_size.c @@ -35,6 +35,6 @@ int rsa_get_size(rsa_key *key) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index b915f2aec..a6be18d3f 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -123,6 +123,6 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_import_x509.c b/src/pk/rsa/rsa_import_x509.c index c3b35376f..c57d6ea8f 100644 --- a/src/pk/rsa/rsa_import_x509.c +++ b/src/pk/rsa/rsa_import_x509.c @@ -113,6 +113,6 @@ int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key) #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_make_key.c b/src/pk/rsa/rsa_make_key.c index 175a1151a..23b98e047 100644 --- a/src/pk/rsa/rsa_make_key.c +++ b/src/pk/rsa/rsa_make_key.c @@ -105,6 +105,6 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_sign_hash.c b/src/pk/rsa/rsa_sign_hash.c index 6b99beb4c..05c7155d5 100644 --- a/src/pk/rsa/rsa_sign_hash.c +++ b/src/pk/rsa/rsa_sign_hash.c @@ -141,6 +141,6 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_sign_saltlen_get.c b/src/pk/rsa/rsa_sign_saltlen_get.c index 0558775ef..b217f94e3 100644 --- a/src/pk/rsa/rsa_sign_saltlen_get.c +++ b/src/pk/rsa/rsa_sign_saltlen_get.c @@ -42,6 +42,6 @@ int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 6ddbc91eb..48aa8d413 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -184,6 +184,6 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, #endif /* LTC_MRSA */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index 15f3c4c5a..b521b540f 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -444,6 +444,6 @@ int fortuna_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/prngs/rng_get_bytes.c b/src/prngs/rng_get_bytes.c index 701c09869..8a9fbb239 100644 --- a/src/prngs/rng_get_bytes.c +++ b/src/prngs/rng_get_bytes.c @@ -154,6 +154,6 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen, } #endif /* #ifdef LTC_RNG_GET_BYTES */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/prngs/rng_make_prng.c b/src/prngs/rng_make_prng.c index fff92c788..b01c325c6 100644 --- a/src/prngs/rng_make_prng.c +++ b/src/prngs/rng_make_prng.c @@ -64,6 +64,6 @@ int rng_make_prng(int bits, int wprng, prng_state *prng, #endif /* #ifdef LTC_RNG_MAKE_PRNG */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/prngs/sprng.c b/src/prngs/sprng.c index 7e1865f48..b74d8da7c 100644 --- a/src/prngs/sprng.c +++ b/src/prngs/sprng.c @@ -156,6 +156,6 @@ int sprng_test(void) -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/prngs/yarrow.c b/src/prngs/yarrow.c index 7275ac89f..1a77e7f08 100644 --- a/src/prngs/yarrow.c +++ b/src/prngs/yarrow.c @@ -346,6 +346,6 @@ int yarrow_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/sober128/sober128tab.c b/src/stream/sober128/sober128tab.c index 6d45049aa..e02ff234a 100644 --- a/src/stream/sober128/sober128tab.c +++ b/src/stream/sober128/sober128tab.c @@ -171,6 +171,6 @@ static const ulong32 Sbox[256] = { #endif /* __LTC_SOBER128TAB_C__ */ -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/testme.sh b/testme.sh index 3f1605bfc..8f84971cd 100755 --- a/testme.sh +++ b/testme.sh @@ -66,6 +66,6 @@ bash testbuild.sh "NOTEST" "-DLTC_NO_TEST" "$mk" "$2" "$3" || exit 1 # test build with no file routines bash testbuild.sh "NOFILE" "-DLTC_NO_FILE" "$mk" "$2" "$3" || exit 1 -# $Source$ -# $Revision$ -# $Date$ +# ref: $Format:%D$ +# git commit: $Format:%H$ +# commit time: $Format:%ai$ diff --git a/tests/base64_test.c b/tests/base64_test.c index a54a5ac17..62c0cff5e 100644 --- a/tests/base64_test.c +++ b/tests/base64_test.c @@ -121,6 +121,6 @@ int base64_test(void) } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/cipher_hash_test.c b/tests/cipher_hash_test.c index 20cd0d16b..488e9d634 100644 --- a/tests/cipher_hash_test.c +++ b/tests/cipher_hash_test.c @@ -33,6 +33,6 @@ int cipher_hash_test(void) return 0; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/der_test.c b/tests/der_test.c index 63b45a8de..92a2747cd 100644 --- a/tests/der_test.c +++ b/tests/der_test.c @@ -1438,6 +1438,6 @@ tmp_time.off_hh); #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/dsa_test.c b/tests/dsa_test.c index de8b6e69e..4fca9a73f 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -245,6 +245,6 @@ int dsa_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/ecc_test.c b/tests/ecc_test.c index 23d259a0e..fb3436db0 100644 --- a/tests/ecc_test.c +++ b/tests/ecc_test.c @@ -242,6 +242,6 @@ int ecc_tests(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/mac_test.c b/tests/mac_test.c index 17da4ac38..0f7e7e88d 100644 --- a/tests/mac_test.c +++ b/tests/mac_test.c @@ -51,6 +51,6 @@ int mac_test(void) return 0; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/misc_test.c b/tests/misc_test.c index 007ad1112..d10cc2fbd 100644 --- a/tests/misc_test.c +++ b/tests/misc_test.c @@ -20,6 +20,6 @@ int misc_test(void) return 0; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/modes_test.c b/tests/modes_test.c index 1ec882ee2..82387eb98 100644 --- a/tests/modes_test.c +++ b/tests/modes_test.c @@ -117,6 +117,6 @@ int modes_test(void) return 0; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/no_prng.c b/tests/no_prng.c index bbb7aa476..1ac65b900 100644 --- a/tests/no_prng.c +++ b/tests/no_prng.c @@ -182,6 +182,6 @@ void no_prng_desc_free(struct ltc_prng_descriptor* prng) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/pkcs_1_eme_test.c b/tests/pkcs_1_eme_test.c index 7ff926cb3..ea56a017c 100644 --- a/tests/pkcs_1_eme_test.c +++ b/tests/pkcs_1_eme_test.c @@ -65,6 +65,6 @@ int pkcs_1_eme_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/pkcs_1_emsa_test.c b/tests/pkcs_1_emsa_test.c index cf1c0f87d..5be6a6858 100644 --- a/tests/pkcs_1_emsa_test.c +++ b/tests/pkcs_1_emsa_test.c @@ -59,6 +59,6 @@ int pkcs_1_emsa_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/pkcs_1_oaep_test.c b/tests/pkcs_1_oaep_test.c index ea22d3ba3..549401c9a 100644 --- a/tests/pkcs_1_oaep_test.c +++ b/tests/pkcs_1_oaep_test.c @@ -65,6 +65,6 @@ int pkcs_1_oaep_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/pkcs_1_pss_test.c b/tests/pkcs_1_pss_test.c index 37fa07734..62692f37a 100644 --- a/tests/pkcs_1_pss_test.c +++ b/tests/pkcs_1_pss_test.c @@ -66,6 +66,6 @@ int pkcs_1_pss_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/pkcs_1_test.c b/tests/pkcs_1_test.c index 0ec8cdf8e..87dddb5dc 100644 --- a/tests/pkcs_1_test.c +++ b/tests/pkcs_1_test.c @@ -93,6 +93,6 @@ int pkcs_1_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 754127c32..70c5590be 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -648,6 +648,6 @@ int rsa_test(void) #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/store_test.c b/tests/store_test.c index f8e047b4c..716ed6d73 100644 --- a/tests/store_test.c +++ b/tests/store_test.c @@ -73,6 +73,6 @@ int store_test(void) return 0; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/test.c b/tests/test.c index c0c45633d..156f9812f 100644 --- a/tests/test.c +++ b/tests/test.c @@ -398,6 +398,6 @@ int main(int argc, char **argv) return x; } -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/tomcrypt_test.h b/tests/tomcrypt_test.h index e6ec13491..36fb9f7a5 100644 --- a/tests/tomcrypt_test.h +++ b/tests/tomcrypt_test.h @@ -60,6 +60,6 @@ void no_prng_desc_free(struct ltc_prng_descriptor*); #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ From 4cd1355b8fe084710b3ec5db7b2a3d577a7fd3ea Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 19 Jun 2017 14:06:38 +0200 Subject: [PATCH 0878/1192] more clean-up of headers/footers --- src/encauth/ccm/ccm_add_aad.c | 4 ++++ src/encauth/ccm/ccm_add_nonce.c | 4 ++++ src/encauth/ccm/ccm_done.c | 4 ++++ src/encauth/ccm/ccm_init.c | 4 ++++ src/encauth/ccm/ccm_process.c | 4 ++++ src/encauth/ccm/ccm_reset.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_add_aad.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_decrypt.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_done.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_encrypt.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_init.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_memory.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_setiv.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c | 4 ++++ src/encauth/chachapoly/chacha20poly1305_test.c | 4 ++++ src/hashes/blake2b.c | 4 ++++ src/hashes/blake2s.c | 4 ++++ src/hashes/rmd256.c | 3 +++ src/hashes/rmd320.c | 3 +++ src/hashes/sha3.c | 4 ++++ src/hashes/sha3_test.c | 4 ++++ src/headers/tomcrypt.h | 9 +++++++++ src/headers/tomcrypt_argchk.h | 9 +++++++++ src/headers/tomcrypt_cfg.h | 9 +++++++++ src/headers/tomcrypt_cipher.h | 9 +++++++++ src/headers/tomcrypt_custom.h | 9 +++++++++ src/headers/tomcrypt_hash.h | 9 +++++++++ src/headers/tomcrypt_mac.h | 9 +++++++++ src/headers/tomcrypt_macros.h | 8 ++++++++ src/headers/tomcrypt_math.h | 9 +++++++++ src/headers/tomcrypt_misc.h | 9 +++++++++ src/headers/tomcrypt_pk.h | 9 +++++++++ src/headers/tomcrypt_pkcs.h | 9 +++++++++ src/headers/tomcrypt_prng.h | 9 +++++++++ src/mac/blake2/blake2bmac.c | 4 ++++ src/mac/blake2/blake2bmac_file.c | 4 ++++ src/mac/blake2/blake2bmac_memory.c | 4 ++++ src/mac/blake2/blake2bmac_memory_multi.c | 4 ++++ src/mac/blake2/blake2bmac_test.c | 4 ++++ src/mac/blake2/blake2smac.c | 4 ++++ src/mac/blake2/blake2smac_file.c | 4 ++++ src/mac/blake2/blake2smac_memory.c | 4 ++++ src/mac/blake2/blake2smac_memory_multi.c | 4 ++++ src/mac/blake2/blake2smac_test.c | 4 ++++ src/mac/poly1305/poly1305.c | 4 ++++ src/mac/poly1305/poly1305_file.c | 4 ++++ src/mac/poly1305/poly1305_memory.c | 4 ++++ src/mac/poly1305/poly1305_memory_multi.c | 4 ++++ src/mac/poly1305/poly1305_test.c | 4 ++++ src/math/rand_bn.c | 4 ++++ src/misc/crypt/crypt_ltc_mp_descriptor.c | 4 ++++ src/misc/crypt/crypt_prng_rng_descriptor.c | 4 ++++ src/misc/crypt/crypt_register_all_ciphers.c | 4 ++++ src/misc/crypt/crypt_register_all_hashes.c | 4 ++++ src/misc/crypt/crypt_register_all_prngs.c | 4 ++++ src/misc/hkdf/hkdf.c | 4 ++++ src/misc/pk_get_oid.c | 4 ++++ .../der/sequence/der_decode_subject_public_key_info.c | 4 ++++ src/pk/asn1/der/sequence/der_encode_sequence_ex.c | 4 ++++ .../der/sequence/der_encode_subject_public_key_info.c | 3 +++ src/pk/dsa/dsa_import_radix.c | 4 ++++ src/pk/rsa/rsa_import_pkcs8.c | 4 ++++ src/pk/rsa/rsa_import_radix.c | 4 ++++ src/prngs/chacha20.c | 4 ++++ src/prngs/rc4.c | 4 ++++ src/prngs/sober128.c | 4 ++++ src/stream/chacha/chacha_crypt.c | 4 ++++ src/stream/chacha/chacha_done.c | 4 ++++ src/stream/chacha/chacha_ivctr32.c | 4 ++++ src/stream/chacha/chacha_ivctr64.c | 4 ++++ src/stream/chacha/chacha_keystream.c | 4 ++++ src/stream/chacha/chacha_setup.c | 4 ++++ src/stream/chacha/chacha_test.c | 4 ++++ src/stream/rc4/rc4.c | 4 ++++ src/stream/rc4/rc4_test.c | 4 ++++ src/stream/sober128/sober128.c | 4 ++++ src/stream/sober128/sober128_test.c | 4 ++++ 77 files changed, 369 insertions(+) diff --git a/src/encauth/ccm/ccm_add_aad.c b/src/encauth/ccm/ccm_add_aad.c index a547c58be..9744c5702 100644 --- a/src/encauth/ccm/ccm_add_aad.c +++ b/src/encauth/ccm/ccm_add_aad.c @@ -57,3 +57,7 @@ int ccm_add_aad(ccm_state *ccm, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ccm/ccm_add_nonce.c b/src/encauth/ccm/ccm_add_nonce.c index 5c11bbb9b..ceffb8e45 100644 --- a/src/encauth/ccm/ccm_add_nonce.c +++ b/src/encauth/ccm/ccm_add_nonce.c @@ -107,3 +107,7 @@ int ccm_add_nonce(ccm_state *ccm, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ccm/ccm_done.c b/src/encauth/ccm/ccm_done.c index bd7fea31c..797b7d984 100644 --- a/src/encauth/ccm/ccm_done.c +++ b/src/encauth/ccm/ccm_done.c @@ -59,3 +59,7 @@ int ccm_done(ccm_state *ccm, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ccm/ccm_init.c b/src/encauth/ccm/ccm_init.c index 4d4aaca32..b24e33e41 100644 --- a/src/encauth/ccm/ccm_init.c +++ b/src/encauth/ccm/ccm_init.c @@ -75,3 +75,7 @@ int ccm_init(ccm_state *ccm, int cipher, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ccm/ccm_process.c b/src/encauth/ccm/ccm_process.c index af31e2c3a..2446f2810 100644 --- a/src/encauth/ccm/ccm_process.c +++ b/src/encauth/ccm/ccm_process.c @@ -82,3 +82,7 @@ int ccm_process(ccm_state *ccm, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ccm/ccm_reset.c b/src/encauth/ccm/ccm_reset.c index 076abc518..c2d0cae87 100644 --- a/src/encauth/ccm/ccm_reset.c +++ b/src/encauth/ccm/ccm_reset.c @@ -29,3 +29,7 @@ int ccm_reset(ccm_state *ccm) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_add_aad.c b/src/encauth/chachapoly/chacha20poly1305_add_aad.c index 8d530a113..0c0cf9d58 100644 --- a/src/encauth/chachapoly/chacha20poly1305_add_aad.c +++ b/src/encauth/chachapoly/chacha20poly1305_add_aad.c @@ -32,3 +32,7 @@ int chacha20poly1305_add_aad(chacha20poly1305_state *st, const unsigned char *in } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_decrypt.c b/src/encauth/chachapoly/chacha20poly1305_decrypt.c index 6ade7d552..179793227 100644 --- a/src/encauth/chachapoly/chacha20poly1305_decrypt.c +++ b/src/encauth/chachapoly/chacha20poly1305_decrypt.c @@ -43,3 +43,7 @@ int chacha20poly1305_decrypt(chacha20poly1305_state *st, const unsigned char *in } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_done.c b/src/encauth/chachapoly/chacha20poly1305_done.c index 259513e5a..127a7f046 100644 --- a/src/encauth/chachapoly/chacha20poly1305_done.c +++ b/src/encauth/chachapoly/chacha20poly1305_done.c @@ -40,3 +40,7 @@ int chacha20poly1305_done(chacha20poly1305_state *st, unsigned char *tag, unsign } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_encrypt.c b/src/encauth/chachapoly/chacha20poly1305_encrypt.c index 3705d0d73..c53c4a657 100644 --- a/src/encauth/chachapoly/chacha20poly1305_encrypt.c +++ b/src/encauth/chachapoly/chacha20poly1305_encrypt.c @@ -42,3 +42,7 @@ int chacha20poly1305_encrypt(chacha20poly1305_state *st, const unsigned char *in } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_init.c b/src/encauth/chachapoly/chacha20poly1305_init.c index 5195d12b0..2799e98a2 100644 --- a/src/encauth/chachapoly/chacha20poly1305_init.c +++ b/src/encauth/chachapoly/chacha20poly1305_init.c @@ -24,3 +24,7 @@ int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_memory.c b/src/encauth/chachapoly/chacha20poly1305_memory.c index 759e70489..b9e4d2ee7 100644 --- a/src/encauth/chachapoly/chacha20poly1305_memory.c +++ b/src/encauth/chachapoly/chacha20poly1305_memory.c @@ -68,3 +68,7 @@ int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_setiv.c b/src/encauth/chachapoly/chacha20poly1305_setiv.c index e5d41c9e6..2047143fb 100644 --- a/src/encauth/chachapoly/chacha20poly1305_setiv.c +++ b/src/encauth/chachapoly/chacha20poly1305_setiv.c @@ -62,3 +62,7 @@ int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c b/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c index 6bb4e5819..f207f014e 100644 --- a/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c +++ b/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c @@ -34,3 +34,7 @@ int chacha20poly1305_setiv_rfc7905(chacha20poly1305_state *st, const unsigned ch } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/encauth/chachapoly/chacha20poly1305_test.c b/src/encauth/chachapoly/chacha20poly1305_test.c index e78cff57e..ee44e68a6 100644 --- a/src/encauth/chachapoly/chacha20poly1305_test.c +++ b/src/encauth/chachapoly/chacha20poly1305_test.c @@ -128,3 +128,7 @@ int chacha20poly1305_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 51c1ee452..9138d3949 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -582,3 +582,7 @@ int blake2b_160_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 6a7b24f0f..9e263243b 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -557,3 +557,7 @@ int blake2s_128_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/rmd256.c b/src/hashes/rmd256.c index 324492308..c2149b675 100644 --- a/src/hashes/rmd256.c +++ b/src/hashes/rmd256.c @@ -425,3 +425,6 @@ int rmd256_test(void) #endif +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/rmd320.c b/src/hashes/rmd320.c index e3fdd0921..0098e0b7e 100644 --- a/src/hashes/rmd320.c +++ b/src/hashes/rmd320.c @@ -490,3 +490,6 @@ int rmd320_test(void) #endif +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha3.c b/src/hashes/sha3.c index 35c492592..fb34f2500 100644 --- a/src/hashes/sha3.c +++ b/src/hashes/sha3.c @@ -300,3 +300,7 @@ int sha3_shake_memory(int num, const unsigned char *in, unsigned long inlen, uns } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/hashes/sha3_test.c b/src/hashes/sha3_test.c index 36e4b033c..5ae86506a 100644 --- a/src/hashes/sha3_test.c +++ b/src/hashes/sha3_test.c @@ -395,3 +395,7 @@ int sha3_shake_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 2241c4394..803e643d1 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + #ifndef TOMCRYPT_H_ #define TOMCRYPT_H_ #include diff --git a/src/headers/tomcrypt_argchk.h b/src/headers/tomcrypt_argchk.h index d7032db72..17390e6a6 100644 --- a/src/headers/tomcrypt_argchk.h +++ b/src/headers/tomcrypt_argchk.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* Defines the LTC_ARGCHK macro used within the library */ /* ARGTYPE is defined in tomcrypt_cfg.h */ #if ARGTYPE == 0 diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 3167c89bf..192a053d5 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* This is the build config file. * * With this you can setup what to inlcude/exclude automatically during any build. Just comment diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index 646038baa..3834f4f48 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* ---- SYMMETRIC KEY STUFF ----- * * We put each of the ciphers scheduled keys in their own structs then we put all of diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index ac7ad0d46..344b0d2ed 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + #ifndef TOMCRYPT_CUSTOM_H_ #define TOMCRYPT_CUSTOM_H_ diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index cad654ee2..8286f4190 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* ---- HASH FUNCTIONS ---- */ #ifdef LTC_SHA3 struct sha3_state { diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index f59903e09..d2e5dfb88 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + #ifdef LTC_HMAC typedef struct Hmac_state { hash_state md; diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h index c9f3afb85..94e368f89 100644 --- a/src/headers/tomcrypt_macros.h +++ b/src/headers/tomcrypt_macros.h @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ /* ---- HELPER MACROS ---- */ #ifdef ENDIAN_NEUTRAL diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 2225235d1..0be2245e1 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /** math functions **/ #define LTC_MP_LT -1 diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 1e0e981e9..10223799c 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* ---- LTC_BASE64 Routines ---- */ #ifdef LTC_BASE64 int base64_encode(const unsigned char *in, unsigned long len, diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 15e05faf0..ed108cc8c 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* ---- NUMBER THEORY ---- */ enum { diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index e3a408014..5c4bda7e9 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* PKCS Header Info */ /* ===> PKCS #1 -- RSA Cryptography <=== */ diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 07e376e25..1163367c7 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* ---- PRNG Stuff ---- */ #ifdef LTC_YARROW struct yarrow_prng { diff --git a/src/mac/blake2/blake2bmac.c b/src/mac/blake2/blake2bmac.c index 63ebd4196..e3d53c5ab 100644 --- a/src/mac/blake2/blake2bmac.c +++ b/src/mac/blake2/blake2bmac.c @@ -59,3 +59,7 @@ int blake2bmac_done(blake2bmac_state *st, unsigned char *mac, unsigned long *mac } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2bmac_file.c b/src/mac/blake2/blake2bmac_file.c index 372213884..64c9e4d12 100644 --- a/src/mac/blake2/blake2bmac_file.c +++ b/src/mac/blake2/blake2bmac_file.c @@ -77,3 +77,7 @@ int blake2bmac_file(const char *fname, const unsigned char *key, unsigned long k } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2bmac_memory.c b/src/mac/blake2/blake2bmac_memory.c index bdf556203..45ddd6fb1 100644 --- a/src/mac/blake2/blake2bmac_memory.c +++ b/src/mac/blake2/blake2bmac_memory.c @@ -42,3 +42,7 @@ int blake2bmac_memory(const unsigned char *key, unsigned long keylen, const unsi } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2bmac_memory_multi.c b/src/mac/blake2/blake2bmac_memory_multi.c index 4e8f66ff4..2ce9e1cd7 100644 --- a/src/mac/blake2/blake2bmac_memory_multi.c +++ b/src/mac/blake2/blake2bmac_memory_multi.c @@ -56,3 +56,7 @@ int blake2bmac_memory_multi(const unsigned char *key, unsigned long keylen, unsi } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2bmac_test.c b/src/mac/blake2/blake2bmac_test.c index 37f2ca7d8..ae7005610 100644 --- a/src/mac/blake2/blake2bmac_test.c +++ b/src/mac/blake2/blake2bmac_test.c @@ -308,3 +308,7 @@ int blake2bmac_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2smac.c b/src/mac/blake2/blake2smac.c index 741cf7241..14022614b 100644 --- a/src/mac/blake2/blake2smac.c +++ b/src/mac/blake2/blake2smac.c @@ -59,3 +59,7 @@ int blake2smac_done(blake2smac_state *st, unsigned char *mac, unsigned long *mac } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2smac_file.c b/src/mac/blake2/blake2smac_file.c index c6da9ee01..c5248a291 100644 --- a/src/mac/blake2/blake2smac_file.c +++ b/src/mac/blake2/blake2smac_file.c @@ -77,3 +77,7 @@ int blake2smac_file(const char *fname, const unsigned char *key, unsigned long k } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2smac_memory.c b/src/mac/blake2/blake2smac_memory.c index 037655451..1661fb064 100644 --- a/src/mac/blake2/blake2smac_memory.c +++ b/src/mac/blake2/blake2smac_memory.c @@ -42,3 +42,7 @@ int blake2smac_memory(const unsigned char *key, unsigned long keylen, const unsi } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2smac_memory_multi.c b/src/mac/blake2/blake2smac_memory_multi.c index 27889c2e6..9947b7cb3 100644 --- a/src/mac/blake2/blake2smac_memory_multi.c +++ b/src/mac/blake2/blake2smac_memory_multi.c @@ -56,3 +56,7 @@ int blake2smac_memory_multi(const unsigned char *key, unsigned long keylen, unsi } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/blake2/blake2smac_test.c b/src/mac/blake2/blake2smac_test.c index fe8b267a9..a44ab8d26 100644 --- a/src/mac/blake2/blake2smac_test.c +++ b/src/mac/blake2/blake2smac_test.c @@ -308,3 +308,7 @@ int blake2smac_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/poly1305/poly1305.c b/src/mac/poly1305/poly1305.c index 369341b61..e505f58c1 100644 --- a/src/mac/poly1305/poly1305.c +++ b/src/mac/poly1305/poly1305.c @@ -262,3 +262,7 @@ int poly1305_done(poly1305_state *st, unsigned char *mac, unsigned long *maclen) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index 42afdc3e3..772630562 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -82,3 +82,7 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/poly1305/poly1305_memory.c b/src/mac/poly1305/poly1305_memory.c index b948efb35..a827f8d38 100644 --- a/src/mac/poly1305/poly1305_memory.c +++ b/src/mac/poly1305/poly1305_memory.c @@ -47,3 +47,7 @@ int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsign } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/poly1305/poly1305_memory_multi.c b/src/mac/poly1305/poly1305_memory_multi.c index 0ac122e58..d6e136bb2 100644 --- a/src/mac/poly1305/poly1305_memory_multi.c +++ b/src/mac/poly1305/poly1305_memory_multi.c @@ -61,3 +61,7 @@ int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsign } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/mac/poly1305/poly1305_test.c b/src/mac/poly1305/poly1305_test.c index a73a15b1b..5e4535b3e 100644 --- a/src/mac/poly1305/poly1305_test.c +++ b/src/mac/poly1305/poly1305_test.c @@ -50,3 +50,7 @@ int poly1305_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c index 5bc85eeee..5cdd1d9ed 100755 --- a/src/math/rand_bn.c +++ b/src/math/rand_bn.c @@ -68,3 +68,7 @@ int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng) return CRYPT_OK; } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_ltc_mp_descriptor.c b/src/misc/crypt/crypt_ltc_mp_descriptor.c index d146755e0..f06147d03 100644 --- a/src/misc/crypt/crypt_ltc_mp_descriptor.c +++ b/src/misc/crypt/crypt_ltc_mp_descriptor.c @@ -9,3 +9,7 @@ #include "tomcrypt.h" ltc_math_descriptor ltc_mp; + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_prng_rng_descriptor.c b/src/misc/crypt/crypt_prng_rng_descriptor.c index ccb6852c7..1a7933743 100644 --- a/src/misc/crypt/crypt_prng_rng_descriptor.c +++ b/src/misc/crypt/crypt_prng_rng_descriptor.c @@ -11,3 +11,7 @@ #ifdef LTC_PRNG_ENABLE_LTC_RNG unsigned long (*ltc_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void)); #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_register_all_ciphers.c b/src/misc/crypt/crypt_register_all_ciphers.c index c8ec528d4..d975193a3 100644 --- a/src/misc/crypt/crypt_register_all_ciphers.c +++ b/src/misc/crypt/crypt_register_all_ciphers.c @@ -96,3 +96,7 @@ int register_all_ciphers(void) #endif return err; } + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_register_all_hashes.c b/src/misc/crypt/crypt_register_all_hashes.c index e95333282..627b6a8a2 100644 --- a/src/misc/crypt/crypt_register_all_hashes.c +++ b/src/misc/crypt/crypt_register_all_hashes.c @@ -94,3 +94,7 @@ int register_all_hashes(void) #endif return err; } + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/crypt/crypt_register_all_prngs.c b/src/misc/crypt/crypt_register_all_prngs.c index 08c698460..939bf20af 100644 --- a/src/misc/crypt/crypt_register_all_prngs.c +++ b/src/misc/crypt/crypt_register_all_prngs.c @@ -43,3 +43,7 @@ int register_all_prngs(void) return err; } + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index 2d848560c..a4e26344d 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -149,3 +149,7 @@ int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, /* vim: set ts=2 sw=2 et ai si: */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/misc/pk_get_oid.c b/src/misc/pk_get_oid.c index e25bccbd5..4f75c5e42 100644 --- a/src/misc/pk_get_oid.c +++ b/src/misc/pk_get_oid.c @@ -38,3 +38,7 @@ int pk_get_oid(int pk, oid_st *st) return CRYPT_OK; } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 561dba29f..8923fce3e 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -106,3 +106,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index 519837cfe..dcc4382b1 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -365,3 +365,7 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c index a129acd4d..8b151ca67 100644 --- a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c @@ -65,4 +65,7 @@ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen #endif +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_import_radix.c b/src/pk/dsa/dsa_import_radix.c index 3034e9b39..141030d31 100755 --- a/src/pk/dsa/dsa_import_radix.c +++ b/src/pk/dsa/dsa_import_radix.c @@ -63,3 +63,7 @@ int dsa_import_radix(int radix, char *p, char *q, char *g, char *x, char *y, dsa } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_import_pkcs8.c b/src/pk/rsa/rsa_import_pkcs8.c index daae08df5..480d66361 100755 --- a/src/pk/rsa/rsa_import_pkcs8.c +++ b/src/pk/rsa/rsa_import_pkcs8.c @@ -147,3 +147,7 @@ int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, } #endif /* LTC_MRSA */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_import_radix.c b/src/pk/rsa/rsa_import_radix.c index 4ec103880..71ab3eac2 100755 --- a/src/pk/rsa/rsa_import_radix.c +++ b/src/pk/rsa/rsa_import_radix.c @@ -60,3 +60,7 @@ int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, cha } #endif /* LTC_MRSA */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/prngs/chacha20.c b/src/prngs/chacha20.c index b528dd2f6..372f6416a 100644 --- a/src/prngs/chacha20.c +++ b/src/prngs/chacha20.c @@ -240,3 +240,7 @@ int chacha20_prng_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/prngs/rc4.c b/src/prngs/rc4.c index ac88fd558..6fabe4166 100644 --- a/src/prngs/rc4.c +++ b/src/prngs/rc4.c @@ -243,3 +243,7 @@ int rc4_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index 64d083bc1..c05ce3b92 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -242,3 +242,7 @@ int sober128_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/chacha/chacha_crypt.c b/src/stream/chacha/chacha_crypt.c index 30b5da7ae..66081cec7 100644 --- a/src/stream/chacha/chacha_crypt.c +++ b/src/stream/chacha/chacha_crypt.c @@ -93,3 +93,7 @@ int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/chacha/chacha_done.c b/src/stream/chacha/chacha_done.c index 4d6e278b0..9f0196e2a 100644 --- a/src/stream/chacha/chacha_done.c +++ b/src/stream/chacha/chacha_done.c @@ -24,3 +24,7 @@ int chacha_done(chacha_state *st) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/chacha/chacha_ivctr32.c b/src/stream/chacha/chacha_ivctr32.c index 9884a1ee9..b8b915735 100644 --- a/src/stream/chacha/chacha_ivctr32.c +++ b/src/stream/chacha/chacha_ivctr32.c @@ -41,3 +41,7 @@ int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivle } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/chacha/chacha_ivctr64.c b/src/stream/chacha/chacha_ivctr64.c index 82d39fb47..870fd8443 100644 --- a/src/stream/chacha/chacha_ivctr64.c +++ b/src/stream/chacha/chacha_ivctr64.c @@ -41,3 +41,7 @@ int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivle } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/chacha/chacha_keystream.c b/src/stream/chacha/chacha_keystream.c index b45323f2f..25eb63ad8 100644 --- a/src/stream/chacha/chacha_keystream.c +++ b/src/stream/chacha/chacha_keystream.c @@ -32,3 +32,7 @@ int chacha_keystream(chacha_state *st, unsigned char *out, unsigned long outlen) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c index 69a148335..e3a7f40af 100644 --- a/src/stream/chacha/chacha_setup.c +++ b/src/stream/chacha/chacha_setup.c @@ -59,3 +59,7 @@ int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keyle } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/chacha/chacha_test.c b/src/stream/chacha/chacha_test.c index 914a48cf3..649ebf93a 100644 --- a/src/stream/chacha/chacha_test.c +++ b/src/stream/chacha/chacha_test.c @@ -65,3 +65,7 @@ int chacha_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/rc4/rc4.c b/src/stream/rc4/rc4.c index ec174a0c2..178489d72 100644 --- a/src/stream/rc4/rc4.c +++ b/src/stream/rc4/rc4.c @@ -105,3 +105,7 @@ int rc4_stream_done(rc4_state *st) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/rc4/rc4_test.c b/src/stream/rc4/rc4_test.c index f1b31ac04..4167a6c68 100644 --- a/src/stream/rc4/rc4_test.c +++ b/src/stream/rc4/rc4_test.c @@ -33,3 +33,7 @@ int rc4_stream_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/sober128/sober128.c b/src/stream/sober128/sober128.c index 49de7d7cc..5e1ca461e 100644 --- a/src/stream/sober128/sober128.c +++ b/src/stream/sober128/sober128.c @@ -340,3 +340,7 @@ int sober128_stream_done(sober128_state *c) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/stream/sober128/sober128_test.c b/src/stream/sober128/sober128_test.c index a299bbe1f..fa3f852be 100644 --- a/src/stream/sober128/sober128_test.c +++ b/src/stream/sober128/sober128_test.c @@ -47,3 +47,7 @@ int sober128_stream_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ From 6fc0a90a1ef06b286ff1b466c44751f95dc026f5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 19 Jun 2017 15:49:18 +0200 Subject: [PATCH 0879/1192] fix headers & footers in demos & tests --- demos/constants.c | 2 -- demos/hashsum.c | 9 +++++++++ demos/ltcrypt.c | 9 +++++++++ demos/openssl-enc.c | 13 +++++++++++++ demos/sizes.c | 9 +++------ demos/small.c | 8 ++++++++ demos/timing.c | 8 ++++++++ demos/tv_gen.c | 8 ++++++++ helper.pl | 2 ++ src/misc/crypt/crypt.c | 2 +- tests/base64_test.c | 8 ++++++++ tests/cipher_hash_test.c | 8 ++++++++ tests/common.c | 4 ++++ tests/common.h | 12 ++++++++++++ tests/der_test.c | 8 ++++++++ tests/dh_test.c | 12 ++++++++++++ tests/dsa_test.c | 8 ++++++++ tests/ecc_test.c | 8 ++++++++ tests/file_test.c | 12 ++++++++++++ tests/katja_test.c | 12 ++++++++++++ tests/mac_test.c | 8 ++++++++ tests/misc_test.c | 8 ++++++++ tests/modes_test.c | 8 ++++++++ tests/multi_test.c | 12 ++++++++++++ tests/no_prng.c | 4 +--- tests/pkcs_1_eme_test.c | 8 ++++++++ tests/pkcs_1_emsa_test.c | 8 ++++++++ tests/pkcs_1_oaep_test.c | 8 ++++++++ tests/pkcs_1_pss_test.c | 8 ++++++++ tests/pkcs_1_test.c | 8 ++++++++ tests/prng_test.c | 12 ++++++++++++ tests/rotate_test.c | 12 ++++++++++++ tests/rsa_test.c | 8 ++++++++ tests/store_test.c | 8 ++++++++ tests/test.c | 8 ++++++++ tests/tomcrypt_test.h | 8 ++++++++ 36 files changed, 286 insertions(+), 12 deletions(-) diff --git a/demos/constants.c b/demos/constants.c index 47b7542be..32af20b1b 100644 --- a/demos/constants.c +++ b/demos/constants.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" diff --git a/demos/hashsum.c b/demos/hashsum.c index 9a3bfe7d6..880a725d2 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* * Written by Daniel Richards 6/7/2002 * hash.c: This app uses libtomcrypt to hash either stdin or a file diff --git a/demos/ltcrypt.c b/demos/ltcrypt.c index 05d113768..542554616 100644 --- a/demos/ltcrypt.c +++ b/demos/ltcrypt.c @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* encrypt V1.1 Fri Oct 18 04:28:03 NZDT 2002 */ /* File de/encryption, using libtomcrypt */ /* Written by Daniel Richards */ diff --git a/demos/openssl-enc.c b/demos/openssl-enc.c index b94c402a8..a306e73bc 100644 --- a/demos/openssl-enc.c +++ b/demos/openssl-enc.c @@ -1,3 +1,12 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + /* * Demo to do the rough equivalent of: * @@ -382,3 +391,7 @@ int main(int argc, char *argv[]) { fclose(infd); fclose(outfd); return 0; } + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/demos/sizes.c b/demos/sizes.c index 88463646c..0825242b9 100644 --- a/demos/sizes.c +++ b/demos/sizes.c @@ -5,8 +5,6 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" @@ -42,7 +40,6 @@ int main(void) { return 0; } - -/* $Source: $ */ -/* $Revision: $ */ -/* $Date: $ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/demos/small.c b/demos/small.c index 6cc6703a8..de1f93d2c 100644 --- a/demos/small.c +++ b/demos/small.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ /* small demo app that just includes a cipher/hash/prng */ #include diff --git a/demos/timing.c b/demos/timing.c index 78e928e88..b36ba614a 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #if defined(_WIN32) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 90a75c606..f3dd7fa89 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include void hash_gen(void) diff --git a/helper.pl b/helper.pl index aba8d72b5..c9dad8310 100755 --- a/helper.pl +++ b/helper.pl @@ -136,6 +136,8 @@ sub check_comments { MARKER my @all_files; find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'src'); + find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'demos'); + find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'tests'); for my $f (@all_files) { my $txt = read_file($f); if ($txt !~ /^\Q$first_comment\E/s) { diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 4c3681dad..1599ada2a 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -16,7 +16,7 @@ #define NAME(s) #s const char *crypt_build_settings = - "LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n" + "LibTomCrypt " SCRYPT " (www.libtom.net)\n" "LibTomCrypt is public domain software.\n" #if defined(INCLUDE_BUILD_DATE) "Built on " __DATE__ " at " __TIME__ "\n" diff --git a/tests/base64_test.c b/tests/base64_test.c index 62c0cff5e..b5b5e9329 100644 --- a/tests/base64_test.c +++ b/tests/base64_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #if defined(LTC_BASE64) || defined(LTC_BASE64_URL) diff --git a/tests/cipher_hash_test.c b/tests/cipher_hash_test.c index 488e9d634..3d9aea4e0 100644 --- a/tests/cipher_hash_test.c +++ b/tests/cipher_hash_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ /* test the ciphers and hashes using their built-in self-tests */ #include diff --git a/tests/common.c b/tests/common.c index 6fbab1fb8..9527e9434 100644 --- a/tests/common.c +++ b/tests/common.c @@ -62,3 +62,7 @@ void print_hex(const char* what, const void* v, const unsigned long l) } prng_state yarrow_prng; + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/common.h b/tests/common.h index 81672339c..0a88f3175 100644 --- a/tests/common.h +++ b/tests/common.h @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #ifndef DEMOS_COMMON_H_ #define DEMOS_COMMON_H_ @@ -18,3 +26,7 @@ void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); void print_hex(const char* what, const void* v, const unsigned long l); #endif /* DEMOS_COMMON_H_ */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/der_test.c b/tests/der_test.c index 92a2747cd..9d53d6e82 100644 --- a/tests/der_test.c +++ b/tests/der_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #if defined(GMP_LTC_DESC) || defined(USE_GMP) #include diff --git a/tests/dh_test.c b/tests/dh_test.c index 86af8c603..efca705df 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_MDH @@ -118,3 +126,7 @@ int dh_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/dsa_test.c b/tests/dsa_test.c index 4fca9a73f..c62c3801f 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_MDSA diff --git a/tests/ecc_test.c b/tests/ecc_test.c index fb3436db0..7fb88d490 100644 --- a/tests/ecc_test.c +++ b/tests/ecc_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_MECC diff --git a/tests/file_test.c b/tests/file_test.c index 8cb4eaf64..24ea559cd 100644 --- a/tests/file_test.c +++ b/tests/file_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ /* test file related functions */ #include @@ -101,3 +109,7 @@ int file_test(void) return CRYPT_OK; #endif } + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/katja_test.c b/tests/katja_test.c index dd5be64ec..0e95bd87c 100644 --- a/tests/katja_test.c +++ b/tests/katja_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_MKAT @@ -228,3 +236,7 @@ int katja_test(void) } #endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/mac_test.c b/tests/mac_test.c index 0f7e7e88d..dec87d165 100644 --- a/tests/mac_test.c +++ b/tests/mac_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ /* test pmac/omac/hmac */ #include diff --git a/tests/misc_test.c b/tests/misc_test.c index d10cc2fbd..b0140cec1 100644 --- a/tests/misc_test.c +++ b/tests/misc_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include int misc_test(void) diff --git a/tests/modes_test.c b/tests/modes_test.c index 82387eb98..96b2332cf 100644 --- a/tests/modes_test.c +++ b/tests/modes_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ /* test CFB/OFB/CBC modes */ #include diff --git a/tests/multi_test.c b/tests/multi_test.c index 519b78f45..4b4da083b 100644 --- a/tests/multi_test.c +++ b/tests/multi_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ /* test the multi helpers... */ #include @@ -223,3 +231,7 @@ int multi_test(void) return CRYPT_OK; } + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/no_prng.c b/tests/no_prng.c index 1ac65b900..9f2bee313 100644 --- a/tests/no_prng.c +++ b/tests/no_prng.c @@ -1,12 +1,10 @@ -/* LibTomCrypt, modular cryptographic library +/* LibTomCrypt, modular cryptographic library -- Tom St Denis * * LibTomCrypt is a library that provides various cryptographic * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express * guarantee it works. - * - * http://libtom.org */ #include "tomcrypt.h" diff --git a/tests/pkcs_1_eme_test.c b/tests/pkcs_1_eme_test.c index ea56a017c..8926cf3c4 100644 --- a/tests/pkcs_1_eme_test.c +++ b/tests/pkcs_1_eme_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_PKCS_1 diff --git a/tests/pkcs_1_emsa_test.c b/tests/pkcs_1_emsa_test.c index 5be6a6858..953ac22ba 100644 --- a/tests/pkcs_1_emsa_test.c +++ b/tests/pkcs_1_emsa_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_PKCS_1 diff --git a/tests/pkcs_1_oaep_test.c b/tests/pkcs_1_oaep_test.c index 549401c9a..b6bd3023a 100644 --- a/tests/pkcs_1_oaep_test.c +++ b/tests/pkcs_1_oaep_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_PKCS_1 diff --git a/tests/pkcs_1_pss_test.c b/tests/pkcs_1_pss_test.c index 62692f37a..5c9ccc461 100644 --- a/tests/pkcs_1_pss_test.c +++ b/tests/pkcs_1_pss_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_PKCS_1 diff --git a/tests/pkcs_1_test.c b/tests/pkcs_1_test.c index 87dddb5dc..19bc97a70 100644 --- a/tests/pkcs_1_test.c +++ b/tests/pkcs_1_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_PKCS_1 diff --git a/tests/prng_test.c b/tests/prng_test.c index 5e347514e..e88ff922b 100644 --- a/tests/prng_test.c +++ b/tests/prng_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_PRNG_ENABLE_LTC_RNG @@ -76,3 +84,7 @@ int prng_test(void) } return err; } + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/rotate_test.c b/tests/rotate_test.c index 870e2db8a..f7c4610e4 100644 --- a/tests/rotate_test.c +++ b/tests/rotate_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include /* Test rotate macros */ @@ -402,3 +410,7 @@ int rotate_test(void) return err; } + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 70c5590be..c2081f4d5 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifdef LTC_MRSA diff --git a/tests/store_test.c b/tests/store_test.c index 716ed6d73..6974ba0e9 100644 --- a/tests/store_test.c +++ b/tests/store_test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include /* Test store/load macros with offsets */ diff --git a/tests/test.c b/tests/test.c index 156f9812f..f0d5c7c70 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #include #ifndef GIT_VERSION diff --git a/tests/tomcrypt_test.h b/tests/tomcrypt_test.h index 36fb9f7a5..440180c87 100644 --- a/tests/tomcrypt_test.h +++ b/tests/tomcrypt_test.h @@ -1,3 +1,11 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ #ifndef __TEST_H_ #define __TEST_H_ From 8e29a6061f3ad7bc7c5c2aeae73705e890ce1ea9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 19 Jun 2017 22:59:16 +0200 Subject: [PATCH 0880/1192] use {BIN,DATA,INC,LIB}PATH in makefile.unix --- makefile.unix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/makefile.unix b/makefile.unix index 452dcd7a9..73b4bf361 100644 --- a/makefile.unix +++ b/makefile.unix @@ -25,6 +25,10 @@ #The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs" DESTDIR = PREFIX = /usr/local +LIBPATH = $(DESTDIR)$(PREFIX)/lib +INCPATH = $(DESTDIR)$(PREFIX)/include +DATAPATH = $(DESTDIR)$(PREFIX)/share/doc/libtomcrypt/pdf +BINPATH = $(DESTDIR)$(PREFIX)/bin CC = cc AR = ar ARFLAGS = r @@ -267,17 +271,17 @@ clean: #Install the library + headers install: $(LIBMAIN_S) $(HEADERS) - @mkdir -p $(PREFIX)/include $(PREFIX)/lib/pkgconfig - @cp $(LIBMAIN_S) $(PREFIX)/lib/ - @cp $(HEADERS) $(PREFIX)/include/ - @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(PREFIX)/lib/pkgconfig/libtomcrypt.pc + @mkdir -p $(INCPATH) $(LIBPATH)/pkgconfig + @cp $(LIBMAIN_S) $(LIBPATH)/ + @cp $(HEADERS) $(INCPATH)/ + @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(LIBPATH)/pkgconfig/libtomcrypt.pc #Install useful tools install_bins: hashsum - @mkdir -p $(PREFIX)/bin - @cp hashsum $(PREFIX)/bin/ + @mkdir -p $(BINPATH) + @cp hashsum $(BINPATH)/ #Install documentation install_docs: doc/crypt.pdf - @mkdir -p $(PREFIX)/share/doc/libtomcrypt/pdf - @cp doc/crypt.pdf $(PREFIX)/share/doc/libtomcrypt/pdf/ + @mkdir -p $(DATAPATH) + @cp doc/crypt.pdf $(DATAPATH)/ From 5246c7de6478cbac2ff06ed7c9e63fc99bfee845 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 19 Jun 2017 23:38:33 +0200 Subject: [PATCH 0881/1192] fix links in pdf doc --- doc/crypt.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index b0798ecbb..24324768b 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -51,13 +51,13 @@ \newcommand{\mysection}[1] % Re-define the chaptering command to use { % THESE headers. \section{#1} - \markboth{\textsf{www.libtom.org}}{\thesection ~ {#1}} + \markboth{\textsf{www.libtom.net}}{\thesection ~ {#1}} } \newcommand{\mystarsection}[1] % Re-define the chaptering command to use { % THESE headers. \section*{#1} - \markboth{\textsf{www.libtom.org}}{{#1}} + \markboth{\textsf{www.libtom.net}}{{#1}} } \pagestyle{empty} \begin{document} From 18c00ddcd65a6b1d662eaac2fd1c7950a322f70b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 10:01:47 +0200 Subject: [PATCH 0882/1192] better usage of `find()` --- helper.pl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helper.pl b/helper.pl index c9dad8310..b66dbce5f 100755 --- a/helper.pl +++ b/helper.pl @@ -135,9 +135,7 @@ sub check_comments { /* commit time: $Format:%ai$ */ MARKER my @all_files; - find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'src'); - find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'demos'); - find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'tests'); + find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'demos', 'src', 'tests'); for my $f (@all_files) { my $txt = read_file($f); if ($txt !~ /^\Q$first_comment\E/s) { From 67200b641ded39dd02c6c21e4a703d185ef752fe Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 21 Jun 2017 12:11:35 +0200 Subject: [PATCH 0883/1192] ecc_sign+verify_hash_raw > ecc_sign+verify_hash_rfc7518 --- src/headers/tomcrypt_pk.h | 12 +-- src/pk/ecc/ecc_sign_hash.c | 151 +++++++++++++++++++---------------- src/pk/ecc/ecc_verify_hash.c | 135 +++++++++++++++---------------- 3 files changed, 154 insertions(+), 144 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index ed108cc8c..da3296eef 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -314,17 +314,17 @@ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, ecc_key *key); -int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, - void *r, void *s, - prng_state *prng, int wprng, ecc_key *key); +int ecc_sign_hash_rfc7518(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, ecc_key *key); int ecc_sign_hash(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, prng_state *prng, int wprng, ecc_key *key); -int ecc_verify_hash_raw( void *r, void *s, - const unsigned char *hash, unsigned long hashlen, - int *stat, ecc_key *key); +int ecc_verify_hash_rfc7518(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, ecc_key *key); int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, const unsigned char *hash, unsigned long hashlen, diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index 98967830c..c408aee52 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -7,43 +7,29 @@ * guarantee it works. */ -/* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b - * - * All curves taken from NIST recommendation paper of July 1999 - * Available at http://csrc.nist.gov/cryptval/dss.htm - */ #include "tomcrypt.h" +#ifdef LTC_MECC + /** @file ecc_sign_hash.c ECC Crypto, Tom St Denis */ -#ifdef LTC_MECC - -/** - Sign a hash with ECC - @param in The hash to sign - @param inlen The length of the hash to sign - @param r The "r" integer of the signature (caller must initialize with mp_init() first) - @param s The "s" integer of the signature (caller must initialize with mp_init() first) - @param prng An active PRNG state - @param wprng The index of the PRNG desired - @param key A private ECC key - @return CRYPT_OK if successful -*/ -int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, - void *r, void *s, - prng_state *prng, int wprng, ecc_key *key) +static int ecc_sign_hash_ex(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, ecc_key *key, int sigformat) { ecc_key pubkey; - void *e, *p; + void *r, *s, *e, *p; int err; + unsigned long pbits, pbytes, i, shift_right; + unsigned char ch, buf[MAXBLOCKSIZE]; - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(r != NULL); - LTC_ARGCHK(s != NULL); - LTC_ARGCHK(key != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); /* is this a private key? */ if (key->type != PK_PRIVATE) { @@ -59,13 +45,30 @@ int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, return err; } - /* get the hash and load it as a bignum into 'e' */ /* init the bignums */ - if ((err = mp_init_multi(&p, &e, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&r, &s, &p, &e, NULL)) != CRYPT_OK) { return err; } - if ((err = mp_read_radix(p, (char *)key->dp->order, 16)) != CRYPT_OK) { goto errnokey; } - if ((err = mp_read_unsigned_bin(e, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto errnokey; } + if ((err = mp_read_radix(p, (char *)key->dp->order, 16)) != CRYPT_OK) { goto errnokey; } + + /* get the hash and load it as a bignum into 'e' */ + pbits = mp_count_bits(p); + pbytes = (pbits+7) >> 3; + if (pbits > inlen*8) { + if ((err = mp_read_unsigned_bin(e, (unsigned char *)in, inlen)) != CRYPT_OK) { goto errnokey; } + } + else if (pbits % 8 == 0) { + if ((err = mp_read_unsigned_bin(e, (unsigned char *)in, pbytes)) != CRYPT_OK) { goto errnokey; } + } + else { + shift_right = 8 - pbits % 8; + for (i=0, ch=0; i> shift_right); + } + if ((err = mp_read_unsigned_bin(e, (unsigned char *)buf, pbytes)) != CRYPT_OK) { goto errnokey; } + } /* make up a key and export the public copy */ for (;;) { @@ -74,31 +77,47 @@ int ecc_sign_hash_raw(const unsigned char *in, unsigned long inlen, } /* find r = x1 mod n */ - if ((err = mp_mod(pubkey.pubkey.x, p, r)) != CRYPT_OK) { goto error; } + if ((err = mp_mod(pubkey.pubkey.x, p, r)) != CRYPT_OK) { goto error; } if (mp_iszero(r) == LTC_MP_YES) { ecc_free(&pubkey); } else { - /* find s = (e + xr)/k */ - if ((err = mp_invmod(pubkey.k, p, pubkey.k)) != CRYPT_OK) { goto error; } /* k = 1/k */ - if ((err = mp_mulmod(key->k, r, p, s)) != CRYPT_OK) { goto error; } /* s = xr */ - if ((err = mp_add(e, s, s)) != CRYPT_OK) { goto error; } /* s = e + xr */ - if ((err = mp_mod(s, p, s)) != CRYPT_OK) { goto error; } /* s = e + xr */ - if ((err = mp_mulmod(s, pubkey.k, p, s)) != CRYPT_OK) { goto error; } /* s = (e + xr)/k */ - ecc_free(&pubkey); - if (mp_iszero(s) == LTC_MP_NO) { - break; - } + /* find s = (e + xr)/k */ + if ((err = mp_invmod(pubkey.k, p, pubkey.k)) != CRYPT_OK) { goto error; } /* k = 1/k */ + if ((err = mp_mulmod(key->k, r, p, s)) != CRYPT_OK) { goto error; } /* s = xr */ + if ((err = mp_add(e, s, s)) != CRYPT_OK) { goto error; } /* s = e + xr */ + if ((err = mp_mod(s, p, s)) != CRYPT_OK) { goto error; } /* s = e + xr */ + if ((err = mp_mulmod(s, pubkey.k, p, s)) != CRYPT_OK) { goto error; } /* s = (e + xr)/k */ + ecc_free(&pubkey); + if (mp_iszero(s) == LTC_MP_NO) { + break; + } } } - err = CRYPT_OK; + if (sigformat == 1) { + /* RFC7518 format */ + if (*outlen < 2*pbytes) { err = CRYPT_MEM; goto errnokey; } + zeromem(out, 2*pbytes); + i = mp_unsigned_bin_size(r); + if ((err = mp_to_unsigned_bin(r, out + (pbytes - i))) != CRYPT_OK) { goto errnokey; } + i = mp_unsigned_bin_size(s); + if ((err = mp_to_unsigned_bin(s, out + (2*pbytes - i))) != CRYPT_OK) { goto errnokey; } + *outlen = 2*pbytes; + err = CRYPT_OK; + } + else { + /* store as ASN.1 SEQUENCE { r, s -- integer } */ + err = der_encode_sequence_multi(out, outlen, + LTC_ASN1_INTEGER, 1UL, r, + LTC_ASN1_INTEGER, 1UL, s, + LTC_ASN1_EOL, 0UL, NULL); + } goto errnokey; - error: ecc_free(&pubkey); errnokey: - mp_clear_multi(p, e, NULL); + mp_clear_multi(r, s, p, e, NULL); return err; } @@ -117,35 +136,29 @@ int ecc_sign_hash(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, prng_state *prng, int wprng, ecc_key *key) { - void *r, *s; - int err; - - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(key != NULL); - - if (mp_init_multi(&r, &s, NULL) != CRYPT_OK) { - return CRYPT_MEM; - } - - if ((err = ecc_sign_hash_raw(in, inlen, r, s, prng, wprng, key)) != CRYPT_OK) { - goto error; - } - - /* store as SEQUENCE { r, s -- integer } */ - err = der_encode_sequence_multi(out, outlen, - LTC_ASN1_INTEGER, 1UL, r, - LTC_ASN1_INTEGER, 1UL, s, - LTC_ASN1_EOL, 0UL, NULL); + return ecc_sign_hash_ex(in, inlen, out, outlen, prng, wprng, key, 0); +} -error: - mp_clear_multi(r, s, NULL); - return err; +/** + Sign a message digest in RFC7518 format + @param in The message digest to sign + @param inlen The length of the digest + @param out [out] The destination for the signature + @param outlen [in/out] The max size and resulting size of the signature + @param prng An active PRNG state + @param wprng The index of the PRNG you wish to use + @param key A private ECC key + @return CRYPT_OK if successful +*/ +int ecc_sign_hash_rfc7518(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, ecc_key *key) +{ + return ecc_sign_hash_ex(in, inlen, out, outlen, prng, wprng, key, 1); } #endif + /* ref: $Format:%D$ */ /* git commit: $Format:%H$ */ /* commit time: $Format:%ai$ */ - diff --git a/src/pk/ecc/ecc_verify_hash.c b/src/pk/ecc/ecc_verify_hash.c index 80a2a6203..d163f70ca 100644 --- a/src/pk/ecc/ecc_verify_hash.c +++ b/src/pk/ecc/ecc_verify_hash.c @@ -7,51 +7,27 @@ * guarantee it works. */ -/* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b - * - * All curves taken from NIST recommendation paper of July 1999 - * Available at http://csrc.nist.gov/cryptval/dss.htm - */ #include "tomcrypt.h" +#ifdef LTC_MECC + /** @file ecc_verify_hash.c ECC Crypto, Tom St Denis */ -#ifdef LTC_MECC - -/* verify - * - * w = s^-1 mod n - * u1 = xw - * u2 = rw - * X = u1*G + u2*Q - * v = X_x1 mod n - * accept if v == r - */ - -/** - Verify a ECC signature - @param r ECC "r" parameter - @param s ECC "s" parameter - @param hash The hash that was signed - @param hashlen The length of the hash that was signed - @param stat [out] The result of the signature verification, 1==valid, 0==invalid - @param key The corresponding public DH key - @return CRYPT_OK if successful (even if the signature is invalid) -*/ -int ecc_verify_hash_raw( void *r, void *s, - const unsigned char *hash, unsigned long hashlen, - int *stat, ecc_key *key) +static int ecc_verify_hash_ex(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, ecc_key *key, int sigformat) { ecc_point *mG, *mQ; - void *v, *w, *u1, *u2, *e, *p, *m; - void *mp = NULL; + void *r, *s, *v, *w, *u1, *u2, *e, *p, *m; + void *mp; int err; + unsigned long pbits, pbytes, i, shift_right; + unsigned char ch, buf[MAXBLOCKSIZE]; - LTC_ARGCHK(r != NULL); - LTC_ARGCHK(s != NULL); + LTC_ARGCHK(sig != NULL); LTC_ARGCHK(hash != NULL); LTC_ARGCHK(stat != NULL); LTC_ARGCHK(key != NULL); @@ -66,7 +42,7 @@ int ecc_verify_hash_raw( void *r, void *s, } /* allocate ints */ - if ((err = mp_init_multi(&v, &w, &u1, &u2, &p, &e, &m, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&r, &s, &v, &w, &u1, &u2, &p, &e, &m, NULL)) != CRYPT_OK) { return CRYPT_MEM; } @@ -78,6 +54,24 @@ int ecc_verify_hash_raw( void *r, void *s, goto error; } + if (sigformat == 1) { + /* RFC7518 format */ + if ((siglen % 2) == 1) { + err = CRYPT_INVALID_PACKET; + goto error; + } + i = siglen / 2; + if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, i)) != CRYPT_OK) { goto error; } + if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+i, i)) != CRYPT_OK) { goto error; } + } + else { + /* ASN.1 format */ + if ((err = der_decode_sequence_multi(sig, siglen, + LTC_ASN1_INTEGER, 1UL, r, + LTC_ASN1_INTEGER, 1UL, s, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto error; } + } + /* get the order */ if ((err = mp_read_radix(p, (char *)key->dp->order, 16)) != CRYPT_OK) { goto error; } @@ -90,8 +84,24 @@ int ecc_verify_hash_raw( void *r, void *s, goto error; } - /* read hash */ - if ((err = mp_read_unsigned_bin(e, (unsigned char *)hash, (int)hashlen)) != CRYPT_OK) { goto error; } + /* read hash - truncate if needed */ + pbits = mp_count_bits(p); + pbytes = (pbits+7) >> 3; + if (pbits > hashlen*8) { + if ((err = mp_read_unsigned_bin(e, (unsigned char *)hash, hashlen)) != CRYPT_OK) { goto error; } + } + else if (pbits % 8 == 0) { + if ((err = mp_read_unsigned_bin(e, (unsigned char *)hash, pbytes)) != CRYPT_OK) { goto error; } + } + else { + shift_right = 8 - pbits % 8; + for (i=0, ch=0; i> shift_right); + } + if ((err = mp_read_unsigned_bin(e, (unsigned char *)buf, pbytes)) != CRYPT_OK) { goto error; } + } /* w = s^-1 mod n */ if ((err = mp_invmod(s, p, w)) != CRYPT_OK) { goto error; } @@ -116,9 +126,6 @@ int ecc_verify_hash_raw( void *r, void *s, if ((err = ltc_mp.ecc_ptmul(u1, mG, mG, m, 0)) != CRYPT_OK) { goto error; } if ((err = ltc_mp.ecc_ptmul(u2, mQ, mQ, m, 0)) != CRYPT_OK) { goto error; } - /* find the montgomery mp */ - if ((err = mp_montgomery_setup(m, &mp)) != CRYPT_OK) { goto error; } - /* add them */ if ((err = ltc_mp.ecc_ptadd(mQ, mG, mG, m, mp)) != CRYPT_OK) { goto error; } @@ -142,7 +149,7 @@ int ecc_verify_hash_raw( void *r, void *s, error: ltc_ecc_del_point(mG); ltc_ecc_del_point(mQ); - mp_clear_multi(v, w, u1, u2, p, e, m, NULL); + mp_clear_multi(r, s, v, w, u1, u2, p, e, m, NULL); if (mp != NULL) { mp_montgomery_free(mp); } @@ -159,42 +166,32 @@ int ecc_verify_hash_raw( void *r, void *s, @param key The corresponding public ECC key @return CRYPT_OK if successful (even if the signature is not valid) */ - int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, const unsigned char *hash, unsigned long hashlen, int *stat, ecc_key *key) { - void *r, *s; - int err; - - LTC_ARGCHK(sig != NULL); - LTC_ARGCHK(hash != NULL); - LTC_ARGCHK(stat != NULL); - LTC_ARGCHK(key != NULL); - - /* allocate ints */ - if ((err = mp_init_multi(&r, &s, NULL)) != CRYPT_OK) { - return CRYPT_MEM; - } - - /* parse header */ - if ((err = der_decode_sequence_multi(sig, siglen, - LTC_ASN1_INTEGER, 1UL, r, - LTC_ASN1_INTEGER, 1UL, s, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto error; - } - - /* do the op */ - err = ecc_verify_hash_raw(r, s, hash, hashlen, stat, key); + return ecc_verify_hash_ex(sig, siglen, hash, hashlen, stat, key, 0); +} -error: - mp_clear_multi(r, s, NULL); - return err; +/** + Verify an ECC signature in RFC7518 format + @param sig The signature to verify + @param siglen The length of the signature (octets) + @param hash The hash (message digest) that was signed + @param hashlen The length of the hash (octets) + @param stat Result of signature, 1==valid, 0==invalid + @param key The corresponding public ECC key + @return CRYPT_OK if successful (even if the signature is not valid) +*/ +int ecc_verify_hash_rfc7518(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, ecc_key *key) +{ + return ecc_verify_hash_ex(sig, siglen, hash, hashlen, stat, key, 1); } #endif + /* ref: $Format:%D$ */ /* git commit: $Format:%H$ */ /* commit time: $Format:%ai$ */ - From a937f23821c2927bee9a90bfb454f88c4d009171 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 21 Jun 2017 12:43:12 +0200 Subject: [PATCH 0884/1192] static functions name fix --- src/pk/ecc/ecc_sign_hash.c | 10 +++++----- src/pk/ecc/ecc_verify_hash.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index c408aee52..c62c7744c 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -16,9 +16,9 @@ ECC Crypto, Tom St Denis */ -static int ecc_sign_hash_ex(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, ecc_key *key, int sigformat) +static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, ecc_key *key, int sigformat) { ecc_key pubkey; void *r, *s, *e, *p; @@ -136,7 +136,7 @@ int ecc_sign_hash(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, prng_state *prng, int wprng, ecc_key *key) { - return ecc_sign_hash_ex(in, inlen, out, outlen, prng, wprng, key, 0); + return _ecc_sign_hash(in, inlen, out, outlen, prng, wprng, key, 0); } /** @@ -154,7 +154,7 @@ int ecc_sign_hash_rfc7518(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, prng_state *prng, int wprng, ecc_key *key) { - return ecc_sign_hash_ex(in, inlen, out, outlen, prng, wprng, key, 1); + return _ecc_sign_hash(in, inlen, out, outlen, prng, wprng, key, 1); } #endif diff --git a/src/pk/ecc/ecc_verify_hash.c b/src/pk/ecc/ecc_verify_hash.c index d163f70ca..eff1d142e 100644 --- a/src/pk/ecc/ecc_verify_hash.c +++ b/src/pk/ecc/ecc_verify_hash.c @@ -16,9 +16,9 @@ ECC Crypto, Tom St Denis */ -static int ecc_verify_hash_ex(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, - int *stat, ecc_key *key, int sigformat) +static int _ecc_verify_hash(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, ecc_key *key, int sigformat) { ecc_point *mG, *mQ; void *r, *s, *v, *w, *u1, *u2, *e, *p, *m; @@ -170,7 +170,7 @@ int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, const unsigned char *hash, unsigned long hashlen, int *stat, ecc_key *key) { - return ecc_verify_hash_ex(sig, siglen, hash, hashlen, stat, key, 0); + return _ecc_verify_hash(sig, siglen, hash, hashlen, stat, key, 0); } /** @@ -187,7 +187,7 @@ int ecc_verify_hash_rfc7518(const unsigned char *sig, unsigned long siglen, const unsigned char *hash, unsigned long hashlen, int *stat, ecc_key *key) { - return ecc_verify_hash_ex(sig, siglen, hash, hashlen, stat, key, 1); + return _ecc_verify_hash(sig, siglen, hash, hashlen, stat, key, 1); } #endif From cdf04b6140d8ec229415814dcdd3ffdda40c73b0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 21 Jun 2017 13:01:22 +0200 Subject: [PATCH 0885/1192] fix mp_montgomery_setup --- src/pk/ecc/ecc_verify_hash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pk/ecc/ecc_verify_hash.c b/src/pk/ecc/ecc_verify_hash.c index eff1d142e..af1775878 100644 --- a/src/pk/ecc/ecc_verify_hash.c +++ b/src/pk/ecc/ecc_verify_hash.c @@ -126,6 +126,9 @@ static int _ecc_verify_hash(const unsigned char *sig, unsigned long siglen, if ((err = ltc_mp.ecc_ptmul(u1, mG, mG, m, 0)) != CRYPT_OK) { goto error; } if ((err = ltc_mp.ecc_ptmul(u2, mQ, mQ, m, 0)) != CRYPT_OK) { goto error; } + /* find the montgomery mp */ + if ((err = mp_montgomery_setup(m, &mp)) != CRYPT_OK) { goto error; } + /* add them */ if ((err = ltc_mp.ecc_ptadd(mQ, mG, mG, m, mp)) != CRYPT_OK) { goto error; } From fff832091f35ee481111e8bf1dca1ea7ffe1d0c0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 21 Jun 2017 13:25:06 +0200 Subject: [PATCH 0886/1192] ecc_sign_hash max_iterations --- src/pk/ecc/ecc_sign_hash.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index c62c7744c..65d2a8cab 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -22,7 +22,7 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen, { ecc_key pubkey; void *r, *s, *e, *p; - int err; + int err, max_iterations = 20; unsigned long pbits, pbytes, i, shift_right; unsigned char ch, buf[MAXBLOCKSIZE]; @@ -71,7 +71,7 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen, } /* make up a key and export the public copy */ - for (;;) { + do { if ((err = ecc_make_key_ex(prng, wprng, &pubkey, key->dp)) != CRYPT_OK) { goto errnokey; } @@ -93,6 +93,10 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen, break; } } + } while (--max_iterations > 0); + + if (max_iterations == 0) { + goto errnokey; } if (sigformat == 1) { From 0c115a162dd0ac0e12358f771634f52d6505639d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 21 Jun 2017 13:26:52 +0200 Subject: [PATCH 0887/1192] whitespace --- src/pk/ecc/ecc_sign_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index 65d2a8cab..18e3875ad 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -96,7 +96,7 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen, } while (--max_iterations > 0); if (max_iterations == 0) { - goto errnokey; + goto errnokey; } if (sigformat == 1) { From b8f22157b336eefc127998ec1368b86857f481f6 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 21 Jun 2017 13:38:39 +0200 Subject: [PATCH 0888/1192] PK_MAX_RETRIES --- src/headers/tomcrypt_pk.h | 3 +++ src/pk/ecc/ecc_sign_hash.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index da3296eef..aa00be13e 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -17,6 +17,9 @@ enum { /* Indicates standard output formats that can be read e.g. by OpenSSL or GnuTLS */ #define PK_STD 0x1000 +/* iterations limit for retry-loops */ +#define PK_MAX_RETRIES 20 + int rand_prime(void *N, long len, prng_state *prng, int wprng); int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng); int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng); diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index 18e3875ad..e97dcf4ae 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -22,7 +22,7 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen, { ecc_key pubkey; void *r, *s, *e, *p; - int err, max_iterations = 20; + int err, max_iterations = PK_MAX_RETRIES; unsigned long pbits, pbytes, i, shift_right; unsigned char ch, buf[MAXBLOCKSIZE]; From ac02f7422b8c39c7783a8120399a7dadd772dc5c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 21 Jun 2017 13:43:25 +0200 Subject: [PATCH 0889/1192] ecc_sign+verify_hash_rfc7518 tests --- tests/ecc_test.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/ecc_test.c b/tests/ecc_test.c index 7fb88d490..da981c34a 100644 --- a/tests/ecc_test.c +++ b/tests/ecc_test.c @@ -230,6 +230,19 @@ int ecc_tests (void) fprintf(stderr, "ecc_verify_hash failed %d, %d, ", stat, stat2); return 1; } + /* test sign_hash_rfc7518 */ + for (ch = 0; ch < 16; ch++) { + buf[0][ch] = ch; + } + x = sizeof (buf[1]); + DO(ecc_sign_hash_rfc7518(buf[0], 16, buf[1], &x, &yarrow_prng, find_prng ("yarrow"), &privKey)); + DO(ecc_verify_hash_rfc7518(buf[1], x, buf[0], 16, &stat, &pubKey)); + buf[0][0] ^= 1; + DO(ecc_verify_hash_rfc7518(buf[1], x, buf[0], 16, &stat2, &privKey)); + if (!(stat == 1 && stat2 == 0)) { + fprintf(stderr, "ecc_verify_hash_rfc7518 failed %d, %d, ", stat, stat2); + return 1; + } ecc_free (&usera); ecc_free (&pubKey); ecc_free (&privKey); From 7453eddae9ce742eb336cd63ed8d29a24949eef0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 13:45:07 +0200 Subject: [PATCH 0890/1192] improve ltc_math_descriptor a bit * introduce LTC_MILLER_RABIN_REPS which is used as default value in the isprime() implementations --- src/headers/tomcrypt_math.h | 10 ++++++++-- src/math/gmp_desc.c | 2 +- src/math/ltm_desc.c | 2 +- src/math/rand_prime.c | 2 +- src/math/tfm_desc.c | 6 ++++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 0be2245e1..4332e5bb5 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -24,6 +24,12 @@ typedef void rsa_key; #endif +#ifndef LTC_MILLER_RABIN_REPS + /* Number of rounds of the Miller-Rabin test + * "Reasonable values of reps are between 15 and 50." c.f. gmp doc of mpz_probab_prime_p() */ + #define LTC_MILLER_RABIN_REPS 35 +#endif + /** math descriptor */ typedef struct { /** Name of the math provider */ @@ -345,7 +351,7 @@ typedef struct { /** Primality testing @param a The integer to test - @param b The number of tests that shall be executed + @param b The number of Miller-Rabin tests that shall be executed @param c The destination of the result (FP_YES if prime) @return CRYPT_OK on success */ @@ -472,13 +478,13 @@ typedef struct { int (*submod)(void *a, void *b, void *c, void *d); /* ---- misc stuff ---- */ + /** Make a pseudo-random mpi @param a The mpi to make random @param size The desired length @return CRYPT_OK on success */ int (*rand)(void *a, int size); - } ltc_math_descriptor; extern ltc_math_descriptor ltc_mp; diff --git a/src/math/gmp_desc.c b/src/math/gmp_desc.c index 699727945..d80d87f4c 100644 --- a/src/math/gmp_desc.c +++ b/src/math/gmp_desc.c @@ -446,7 +446,7 @@ static int isprime(void *a, int b, int *c) LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); if (b == 0) { - b = 8; + b = LTC_MILLER_RABIN_REPS; } /* if */ *c = mpz_probab_prime_p(a, b) > 0 ? LTC_MP_YES : LTC_MP_NO; return CRYPT_OK; diff --git a/src/math/ltm_desc.c b/src/math/ltm_desc.c index aa5f88ade..3e2a0c996 100644 --- a/src/math/ltm_desc.c +++ b/src/math/ltm_desc.c @@ -404,7 +404,7 @@ static int isprime(void *a, int b, int *c) LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); if (b == 0) { - b = 8; + b = LTC_MILLER_RABIN_REPS; } /* if */ err = mpi_to_ltc_error(mp_prime_is_prime(a, b, c)); *c = (*c == MP_YES) ? LTC_MP_YES : LTC_MP_NO; diff --git a/src/math/rand_prime.c b/src/math/rand_prime.c index 8213cdb34..4dd5764dc 100644 --- a/src/math/rand_prime.c +++ b/src/math/rand_prime.c @@ -66,7 +66,7 @@ int rand_prime(void *N, long len, prng_state *prng, int wprng) } /* test */ - if ((err = mp_prime_is_prime(N, 8, &res)) != CRYPT_OK) { + if ((err = mp_prime_is_prime(N, LTC_MILLER_RABIN_REPS, &res)) != CRYPT_OK) { XFREE(buf); return err; } diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index 855083c74..66d0ddbeb 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -415,8 +415,10 @@ static int isprime(void *a, int b, int *c) { LTC_ARGCHK(a != NULL); LTC_ARGCHK(c != NULL); - (void)b; - *c = (fp_isprime(a) == FP_YES) ? LTC_MP_YES : LTC_MP_NO; + if (b == 0) { + b = LTC_MILLER_RABIN_REPS; + } /* if */ + *c = (fp_isprime_ex(a, b) == FP_YES) ? LTC_MP_YES : LTC_MP_NO; return CRYPT_OK; } From 26b57032e742b513cd34594b464652cc5f593be9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 14 Jun 2017 16:57:27 +0200 Subject: [PATCH 0891/1192] use correct amount of M-R tests in dsa_make_params() --- src/pk/dsa/dsa_make_key.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index aea5ea7e6..476b93bb0 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -75,11 +75,23 @@ static int dsa_make_params(prng_state *prng, int wprng, int group_size, int modu L = modulus_size * 8; N = group_size * 8; + /* XXX-TODO no Lucas test */ +#ifdef LTC_MPI_HAS_LUCAS_TEST /* M-R tests (when followed by one Lucas test) according FIPS-186-4 - Appendix C.3 - table C.1 */ mr_tests_p = (L <= 2048) ? 3 : 2; if (N <= 160) { mr_tests_q = 19; } else if (N <= 224) { mr_tests_q = 24; } else { mr_tests_q = 27; } +#else + /* M-R tests (without Lucas test) according FIPS-186-4 - Appendix C.3 - table C.1 */ + if (L <= 1024) { mr_tests_p = 40; } + else if (L <= 2048) { mr_tests_p = 56; } + else { mr_tests_p = 64; } + + if (N <= 160) { mr_tests_q = 40; } + else if (N <= 224) { mr_tests_q = 56; } + else { mr_tests_q = 64; } +#endif if (N <= 256) { hash = register_hash(&sha256_desc); @@ -122,7 +134,7 @@ static int dsa_make_params(prng_state *prng, int wprng, int group_size, int modu if ((err = mp_mod(U, t2N1, U)) != CRYPT_OK) { goto cleanup; } if ((err = mp_add(t2N1, U, q)) != CRYPT_OK) { goto cleanup; } if (!mp_isodd(q)) mp_add_d(q, 1, q); - if ((err = mp_prime_is_prime(q, mr_tests_q, &res)) != CRYPT_OK) { goto cleanup; } /* XXX-TODO rounds are ignored; no Lucas test */ + if ((err = mp_prime_is_prime(q, mr_tests_q, &res)) != CRYPT_OK) { goto cleanup; } if (res == LTC_MP_YES) found_q = 1; } @@ -149,7 +161,7 @@ static int dsa_make_params(prng_state *prng, int wprng, int group_size, int modu if ((err = mp_sub(X, p, p)) != CRYPT_OK) { goto cleanup; } if (mp_cmp(p, t2L1) != LTC_MP_LT) { /* p >= 2^(L-1) */ - if ((err = mp_prime_is_prime(p, mr_tests_p, &res)) != CRYPT_OK) { goto cleanup; } /* XXX-TODO rounds are ignored; no Lucas test */ + if ((err = mp_prime_is_prime(p, mr_tests_p, &res)) != CRYPT_OK) { goto cleanup; } if (res == LTC_MP_YES) { found_p = 1; } From 771d67e102e235a99488bdafdb28d9115f618329 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 09:48:10 +0200 Subject: [PATCH 0892/1192] DH facelift part1 --- demos/timing.c | 24 +- src/headers/tomcrypt_pk.h | 60 ++-- src/pk/dh/dh.c | 599 +++++++++++++---------------------- src/pk/dh/dh_check_pubkey.c | 68 ++++ src/pk/dh/dh_export.c | 62 ++++ src/pk/dh/dh_export_radix.c | 68 ++++ src/pk/dh/dh_free.c | 43 +++ src/pk/dh/dh_import.c | 97 ++++++ src/pk/dh/dh_import_radix.c | 90 ++++++ src/pk/dh/dh_make_key.c | 207 ++++++++++++ src/pk/dh/dh_shared_secret.c | 80 +++++ src/pk/dh/dh_static.c | 243 -------------- src/pk/dh/dh_static.h | 125 -------- src/pk/dh/dh_sys.c | 490 ---------------------------- tests/dh_test.c | 294 +++++++++++------ 15 files changed, 1171 insertions(+), 1379 deletions(-) create mode 100644 src/pk/dh/dh_check_pubkey.c create mode 100644 src/pk/dh/dh_export.c create mode 100644 src/pk/dh/dh_export_radix.c create mode 100644 src/pk/dh/dh_free.c create mode 100644 src/pk/dh/dh_import.c create mode 100644 src/pk/dh/dh_import_radix.c create mode 100644 src/pk/dh/dh_make_key.c create mode 100644 src/pk/dh/dh_shared_secret.c delete mode 100644 src/pk/dh/dh_static.c delete mode 100644 src/pk/dh/dh_static.h delete mode 100644 src/pk/dh/dh_sys.c diff --git a/demos/timing.c b/demos/timing.c index b36ba614a..aa7c9a52c 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -891,8 +891,7 @@ static void time_dh(void) { dh_key key; ulong64 t1, t2; - unsigned char buf[2][4096]; - unsigned long i, x, y, z; + unsigned long i, x, y; int err; static unsigned long sizes[] = {768/8, 1024/8, 1536/8, 2048/8, 3072/8, 4096/8, 6144/8, 8192/8, 100000}; @@ -908,29 +907,10 @@ static void time_dh(void) t1 = t_read() - t1; t2 += t1; - if (y < 15) { - dh_free(&key); - } + dh_free(&key); } t2 >>= 4; fprintf(stderr, "DH-%4lu make_key took %15llu cycles\n", x*8, t2); - - t2 = 0; - for (y = 0; y < 16; y++) { - t_start(); - t1 = t_read(); - z = sizeof(buf[1]); - if ((err = dh_encrypt_key(buf[0], 20, buf[1], &z, &yarrow_prng, find_prng("yarrow"), find_hash("sha1"), - &key)) != CRYPT_OK) { - fprintf(stderr, "\n\ndh_encrypt_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); - exit(EXIT_FAILURE); - } - t1 = t_read() - t1; - t2 += t1; - } - t2 >>= 4; - fprintf(stderr, "DH-%4lu encrypt_key took %15llu cycles\n", x*8, t2); - dh_free(&key); } } #else diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index aa00be13e..7dc30dcab 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -183,45 +183,57 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key); /* ---- DH Routines ---- */ #ifdef LTC_MDH -typedef struct Dh_key { - int idx, type; +#ifndef DH_BUF_SIZE +#define DH_BUF_SIZE 2100 +#endif + +typedef struct { + int size; + char *name, *base, *prime; +} ltc_dh_set_type; + +extern const ltc_dh_set_type ltc_dh_sets[]; + +typedef struct { + int type; void *x; void *y; + void *base; + void *prime; } dh_key; -int dh_compat_test(void); -void dh_sizes(int *low, int *high); -int dh_get_size(dh_key *key); +int dh_get_groupsize(dh_key *key); -int dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key); +int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key); +int dh_make_key_ex(prng_state *prng, int wprng, int radix, + void *prime, unsigned long primelen, + void *base, unsigned long baselen, + dh_key *key); +int dh_make_key_dhparam(prng_state *prng, int wprng, unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); void dh_free(dh_key *key); int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key); int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); +int dh_export_radix(int radix, + void *out, unsigned long *outlen, + int type, dh_key *key); +int dh_import_radix(int radix, + void *in, unsigned long inlen, + void *prime, unsigned long primelen, + void *base, unsigned long baselen, + int type, dh_key *key); + int dh_shared_secret(dh_key *private_key, dh_key *public_key, unsigned char *out, unsigned long *outlen); -int dh_encrypt_key(const unsigned char *in, unsigned long keylen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, int hash, - dh_key *key); - -int dh_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - dh_key *key); - -int dh_sign_hash(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, dh_key *key); - -int dh_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, - int *stat, dh_key *key); - - +#ifdef LTC_SOURCE +/* INTERNAL ONLY - it should be later moved to src/headers/tomcrypt_internal.h */ +int dh_check_pubkey(dh_key *key); #endif +#endif /* LTC_MDH */ + /* ---- ECC Routines ---- */ #ifdef LTC_MECC diff --git a/src/pk/dh/dh.c b/src/pk/dh/dh.c index b90754047..763b00767 100644 --- a/src/pk/dh/dh.c +++ b/src/pk/dh/dh.c @@ -5,402 +5,233 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org */ -#include "tomcrypt.h" -/** - @file dh.c - DH crypto, Tom St Denis -*/ +#include "tomcrypt.h" #ifdef LTC_MDH - -#include "dh_static.h" - -/** - Test the DH sub-system (can take a while) - @return CRYPT_OK if successful -*/ -int dh_compat_test(void) -{ - void *p, *g, *tmp; - int x, err, primality; - - if ((err = mp_init_multi(&p, &g, &tmp, NULL)) != CRYPT_OK) { goto error; } - - for (x = 0; sets[x].size != 0; x++) { -#if 0 - printf("dh_test():testing size %d-bits\n", sets[x].size * 8); +/* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ +const ltc_dh_set_type ltc_dh_sets[] = { +#ifdef LTC_DH768 +{ /* 768-bit MODP Group 1 - https://tools.ietf.org/html/rfc7296#appendix-B.1 */ + 96, + "DH-768", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A63A3620FFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH1024 +{ /* 1024-bit MODP Group 2 - https://tools.ietf.org/html/rfc7296#appendix-B.2 */ + 128, + "DH-1024", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" + "FFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH1536 +{ /* 1536-bit MODP Group 5 - https://tools.ietf.org/html/rfc3526#section-2 */ + 192, + "DH-1536", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH2048 +{ /* 2048-bit MODP Group 14 - https://tools.ietf.org/html/rfc3526#section-3 */ + 256, + "DH-2048", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AACAA68FFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH3072 +{ /* 3072-bit MODP Group 15 - https://tools.ietf.org/html/rfc3526#section-4 */ + 384, + "DH-3072", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH4096 +{ /* 4096-bit MODP Group 16 - https://tools.ietf.org/html/rfc3526#section-5 */ + 512, + "DH-4096", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" + "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" + "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" + "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" + "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" + "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199" + "FFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH6144 +{ /* 6144-bit MODP Group 17 - https://tools.ietf.org/html/rfc3526#section-6 */ + 768, + "DH-6144", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" + "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" + "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" + "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" + "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" + "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BD" + "F8FF9406AD9E530EE5DB382F413001AEB06A53ED9027D831" + "179727B0865A8918DA3EDBEBCF9B14ED44CE6CBACED4BB1B" + "DB7F1447E6CC254B332051512BD7AF426FB8F401378CD2BF" + "5983CA01C64B92ECF032EA15D1721D03F482D7CE6E74FEF6" + "D55E702F46980C82B5A84031900B1C9E59E7C97FBEC7E8F3" + "23A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE328" + "06A1D58BB7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55C" + "DA56C9EC2EF29632387FE8D76E3C0468043E8F663F4860EE" + "12BF2D5B0B7474D6E694F91E6DCC4024FFFFFFFFFFFFFFFF" +}, +#endif +#ifdef LTC_DH8192 +{ /* 8192-bit MODP Group 18 - https://tools.ietf.org/html/rfc3526#section-7 */ + 1024, + "DH-8192", + "2", + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" + "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" + "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" + "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" + "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" + "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BD" + "F8FF9406AD9E530EE5DB382F413001AEB06A53ED9027D831" + "179727B0865A8918DA3EDBEBCF9B14ED44CE6CBACED4BB1B" + "DB7F1447E6CC254B332051512BD7AF426FB8F401378CD2BF" + "5983CA01C64B92ECF032EA15D1721D03F482D7CE6E74FEF6" + "D55E702F46980C82B5A84031900B1C9E59E7C97FBEC7E8F3" + "23A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE328" + "06A1D58BB7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55C" + "DA56C9EC2EF29632387FE8D76E3C0468043E8F663F4860EE" + "12BF2D5B0B7474D6E694F91E6DBE115974A3926F12FEE5E4" + "38777CB6A932DF8CD8BEC4D073B931BA3BC832B68D9DD300" + "741FA7BF8AFC47ED2576F6936BA424663AAB639C5AE4F568" + "3423B4742BF1C978238F16CBE39D652DE3FDB8BEFC848AD9" + "22222E04A4037C0713EB57A81A23F0C73473FC646CEA306B" + "4BCBC8862F8385DDFA9D4B7FA2C087E879683303ED5BDD3A" + "062B3CF5B3A278A66D2A13F83F44F82DDF310EE074AB6A36" + "4597E899A0255DC164F31CC50846851DF9AB48195DED7EA1" + "B1D510BD7EE74D73FAF36BC31ECFA268359046F4EB879F92" + "4009438B481C6CD7889A002ED5EE382BC9190DA6FC026E47" + "9558E4475677E9AA9E3050E2765694DFC81F56E880B96E71" + "60C980DD98EDD3DFFFFFFFFFFFFFFFFF" +}, #endif - if ((err = mp_read_radix(g,(char *)sets[x].base, 16)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p,(char *)sets[x].prime, 16)) != CRYPT_OK) { goto error; } - - /* ensure p is prime */ - if ((err = mp_prime_is_prime(p, 8, &primality)) != CRYPT_OK) { goto done; } - if (primality != LTC_MP_YES ) { - err = CRYPT_FAIL_TESTVECTOR; - goto done; - } - - if ((err = mp_sub_d(p, 1, tmp)) != CRYPT_OK) { goto error; } - if ((err = mp_div_2(tmp, tmp)) != CRYPT_OK) { goto error; } - - /* ensure (p-1)/2 is prime */ - if ((err = mp_prime_is_prime(tmp, 8, &primality)) != CRYPT_OK) { goto done; } - if (primality == 0) { - err = CRYPT_FAIL_TESTVECTOR; - goto done; - } - - /* now see if g^((p-1)/2) mod p is in fact 1 */ - if ((err = mp_exptmod(g, tmp, p, tmp)) != CRYPT_OK) { goto error; } - if (mp_cmp_d(tmp, 1)) { - err = CRYPT_FAIL_TESTVECTOR; - goto done; - } - } - err = CRYPT_OK; -error: -done: - mp_clear_multi(tmp, g, p, NULL); - return err; -} - -/** - Get the min and max DH key sizes (octets) - @param low [out] The smallest key size supported - @param high [out] The largest key size supported -*/ -void dh_sizes(int *low, int *high) { - int x; - LTC_ARGCHKVD(low != NULL); - LTC_ARGCHKVD(high != NULL); - *low = INT_MAX; - *high = 0; - for (x = 0; sets[x].size != 0; x++) { - if (*low > sets[x].size) *low = sets[x].size; - if (*high < sets[x].size) *high = sets[x].size; - } + 0, + NULL, + NULL, + NULL } +}; /** - Returns the key size of a given DH key (octets) + Returns the DH group size (octets) for given key @param key The DH key to get the size of - @return The size if valid or INT_MAX if not -*/ -int dh_get_size(dh_key *key) -{ - LTC_ARGCHK(key != NULL); - if (dh_is_valid_idx(key->idx) == 1) { - return sets[key->idx].size; - } else { - return INT_MAX; /* large value that would cause dh_make_key() to fail */ - } -} - -/** - Make a DH key [private key pair] - @param prng An active PRNG state - @param wprng The index for the PRNG you desire to use - @param groupsize The size (octets) of used DH group - @param key [out] Where the newly created DH key will be stored - @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. -*/ -int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) -{ - unsigned char *buf; - unsigned long idx, keysize; - void *p, *g, *p_minus1; - int err; - - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(prng != NULL); - - /* good prng? */ - if ((err = prng_is_valid(wprng)) != CRYPT_OK) { - return err; - } - - /* find group size */ - for (idx = 0; (groupsize > sets[idx].size) && (sets[idx].size != 0); idx++); - if (sets[idx].size == 0) { - return CRYPT_INVALID_KEYSIZE; - } - groupsize = sets[idx].size; - - /* The strength estimates from https://tools.ietf.org/html/rfc3526#section-8 - * We use "Estimate 2" to get an appropriate private key (exponent) size. - */ - if (groupsize <= 192) { - keysize = 30; /* 1536-bit => key size 240-bit */ - } - else if (groupsize <= 256) { - keysize = 40; /* 2048-bit => key size 320-bit */ - } - else if (groupsize <= 384) { - keysize = 52; /* 3072-bit => key size 416-bit */ - } - else if (groupsize <= 512) { - keysize = 60; /* 4096-bit => key size 480-bit */ - } - else if (groupsize <= 768) { - keysize = 67; /* 6144-bit => key size 536-bit */ - } - else if (groupsize <= 1024) { - keysize = 77; /* 8192-bit => key size 616-bit */ - } - else { - return CRYPT_INVALID_KEYSIZE; - } - - /* allocate buffer */ - buf = XMALLOC(keysize); - if (buf == NULL) { - return CRYPT_MEM; - } - - /* init big numbers */ - if ((err = mp_init_multi(&g, &p, &p_minus1, &key->x, &key->y, NULL)) != CRYPT_OK) { - goto freebuf; - } - - if ((err = mp_read_radix(g, sets[idx].base, 16)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p, sets[idx].prime, 16)) != CRYPT_OK) { goto error; } - if ((err = mp_sub_d(p, 1, p_minus1)) != CRYPT_OK) { goto error; } - - do { - /* make up random buf */ - if (prng_descriptor[wprng].read(buf, keysize, prng) != keysize) { - err = CRYPT_ERROR_READPRNG; - goto error; - } - /* load the x value - private key */ - if ((err = mp_read_unsigned_bin(key->x, buf, keysize)) != CRYPT_OK) { goto error; } - /* compute the y value - public key */ - if ((err = mp_exptmod(g, key->x, p, key->y)) != CRYPT_OK) { goto error; } - /* avoid: y <= 1 OR y >= p-1 */ - } while (mp_cmp(key->y, p_minus1) != LTC_MP_LT || mp_cmp_d(key->y, 1) != LTC_MP_GT); - - /* success */ - key->idx = idx; - key->type = PK_PRIVATE; - err = CRYPT_OK; - goto done; - -error: - mp_clear_multi(key->x, key->y, NULL); -done: - mp_clear_multi(g, p, p_minus1, NULL); -freebuf: - zeromem(buf, keysize); - XFREE(buf); - return err; -} - -/** - Free the allocated ram for a DH key - @param key The key which you wish to free -*/ -void dh_free(dh_key *key) -{ - LTC_ARGCHKVD(key != NULL); - if ( key->x ) { - mp_clear( key->x ); - key->x = NULL; - } - if ( key->y ) { - mp_clear( key->y ); - key->y = NULL; - } -} - -/** - Export a DH key to a binary packet - @param out [out] The destination for the key - @param outlen [in/out] The max size and resulting size of the DH key - @param type Which type of key (PK_PRIVATE or PK_PUBLIC) - @param key The key you wish to export - @return CRYPT_OK if successful -*/ -int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key) -{ - unsigned long y, z; - int err; - - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(key != NULL); - - /* can we store the static header? */ - if (*outlen < (PACKET_SIZE + 2)) { - return CRYPT_BUFFER_OVERFLOW; - } - - if (type == PK_PRIVATE && key->type != PK_PRIVATE) { - return CRYPT_PK_NOT_PRIVATE; - } - - /* header */ - y = PACKET_SIZE; - - /* header */ - out[y++] = type; - out[y++] = (unsigned char)(sets[key->idx].size / 8); - - /* export y */ - OUTPUT_BIGNUM(key->y, out, y, z); - - if (type == PK_PRIVATE) { - /* export x */ - OUTPUT_BIGNUM(key->x, out, y, z); - } - - /* store header */ - packet_store_header(out, PACKET_SECT_DH, PACKET_SUB_KEY); - - /* store len */ - *outlen = y; - return CRYPT_OK; -} - -/** - Import a DH key from a binary packet - @param in The packet to read - @param inlen The length of the input packet - @param key [out] Where to import the key to - @return CRYPT_OK if successful, on error all allocated memory is freed automatically -*/ -int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) -{ - unsigned long x, y, s; - int err; - - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(key != NULL); - - /* make sure valid length */ - if ((2+PACKET_SIZE) > inlen) { - return CRYPT_INVALID_PACKET; - } - - /* check type byte */ - if ((err = packet_valid_header((unsigned char *)in, PACKET_SECT_DH, PACKET_SUB_KEY)) != CRYPT_OK) { - return err; - } - - /* init */ - if ((err = mp_init_multi(&key->x, &key->y, NULL)) != CRYPT_OK) { - return err; - } - - /* advance past packet header */ - y = PACKET_SIZE; - - /* key type, e.g. private, public */ - key->type = (int)in[y++]; - - /* key size in bytes */ - s = (unsigned long)in[y++] * 8; - - for (x = 0; (s > (unsigned long)sets[x].size) && (sets[x].size != 0); x++); - if (sets[x].size == 0) { - err = CRYPT_INVALID_KEYSIZE; - goto error; - } - key->idx = (int)x; - - /* type check both values */ - if ((key->type != PK_PUBLIC) && (key->type != PK_PRIVATE)) { - err = CRYPT_PK_TYPE_MISMATCH; - goto error; - } - - /* is the key idx valid? */ - if (dh_is_valid_idx(key->idx) != 1) { - err = CRYPT_PK_TYPE_MISMATCH; - goto error; - } - - /* load public value g^x mod p*/ - INPUT_BIGNUM(key->y, in, x, y, inlen); - - if (key->type == PK_PRIVATE) { - INPUT_BIGNUM(key->x, in, x, y, inlen); - } - - /* eliminate private key if public */ - if (key->type == PK_PUBLIC) { - mp_clear(key->x); - key->x = NULL; - } - - return CRYPT_OK; -error: - mp_clear_multi(key->y, key->x, NULL); - return err; -} - -/** - Create a DH shared secret. - @param private_key The private DH key in the pair - @param public_key The public DH key in the pair - @param out [out] The destination of the shared data - @param outlen [in/out] The max size and resulting size of the shared data. - @return CRYPT_OK if successful -*/ -int dh_shared_secret(dh_key *private_key, dh_key *public_key, - unsigned char *out, unsigned long *outlen) + @return The group size in octets (0 on error) + */ +int dh_get_groupsize(dh_key *key) { - void *tmp, *p, *p_minus1; - unsigned long x; - int err; - - LTC_ARGCHK(private_key != NULL); - LTC_ARGCHK(public_key != NULL); - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); - - /* types valid? */ - if (private_key->type != PK_PRIVATE) { - return CRYPT_PK_NOT_PRIVATE; - } - - /* same idx? */ - if (private_key->idx != public_key->idx) { - return CRYPT_PK_TYPE_MISMATCH; - } - - /* compute y^x mod p */ - if ((err = mp_init_multi(&tmp, &p, &p_minus1, NULL)) != CRYPT_OK) { - return err; - } - - if ((err = mp_read_radix(p, sets[private_key->idx].prime, 16)) != CRYPT_OK) { goto error; } - if ((err = mp_sub_d(p, 1, p_minus1)) != CRYPT_OK) { goto error; } - if (mp_cmp(public_key->y, p_minus1) != LTC_MP_LT || mp_cmp_d(public_key->y, 1) != LTC_MP_GT) { - /* reject public key with: y <= 1 OR y >= p-1 */ - err = CRYPT_INVALID_ARG; - goto error; - } - if ((err = mp_exptmod(public_key->y, private_key->x, p, tmp)) != CRYPT_OK) { goto error; } - - /* enough space for output? */ - x = (unsigned long)mp_unsigned_bin_size(tmp); - if (*outlen < x) { - err = CRYPT_BUFFER_OVERFLOW; - goto error; - } - if ((err = mp_to_unsigned_bin(tmp, out)) != CRYPT_OK) { goto error; } - *outlen = x; - err = CRYPT_OK; - -error: - mp_clear_multi(p_minus1, p, tmp, NULL); - return err; + if (key == NULL) return 0; + return mp_unsigned_bin_size(key->prime); } #endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_check_pubkey.c b/src/pk/dh/dh_check_pubkey.c new file mode 100644 index 000000000..c77e4bd23 --- /dev/null +++ b/src/pk/dh/dh_check_pubkey.c @@ -0,0 +1,68 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Check DH public key (INTERNAL ONLY, not part of public API) + @param key The key you wish to test + @return CRYPT_OK if successful +*/ +int dh_check_pubkey(dh_key *key) +{ + void *p_minus1; + ltc_mp_digit digit; + int i, digit_count, bits_set = 0, err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->y != NULL); + LTC_ARGCHK(key->base != NULL); + LTC_ARGCHK(key->prime != NULL); + + if ((err = mp_init(&p_minus1)) != CRYPT_OK) { + return err; + } + + /* avoid: y <= 1 OR y >= p-1 */ + if ((err = mp_sub_d(key->prime, 1, p_minus1)) != CRYPT_OK) { + goto error; + } + if (mp_cmp(key->y, p_minus1) != LTC_MP_LT || mp_cmp_d(key->y, 1) != LTC_MP_GT) { + err = CRYPT_INVALID_ARG; + goto error; + } + + /* public key must have more than one bit set */ + digit_count = mp_get_digit_count(key->y); + for (i = 0; i < digit_count && bits_set < 2; i++) { + digit = mp_get_digit(key->y, i); + while (digit > 0) { + if (digit & 1) bits_set++; + digit >>= 1; + } + } + if (bits_set > 1) { + err = CRYPT_OK; + } + else { + err = CRYPT_INVALID_ARG; + } + +error: + mp_clear(p_minus1); + return err; +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_export.c b/src/pk/dh/dh_export.c new file mode 100644 index 000000000..6a02a890e --- /dev/null +++ b/src/pk/dh/dh_export.c @@ -0,0 +1,62 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Export a DH key to a binary packet + @param out [out] The destination for the key + @param outlen [in/out] The max size and resulting size of the DH key + @param type Which type of key (PK_PRIVATE or PK_PUBLIC) + @param key The key you wish to export + @return CRYPT_OK if successful +*/ +int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key) +{ + unsigned char flags[1]; + int err; + unsigned long version = 0; + + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + + if (type == PK_PRIVATE) { + /* export x - private key */ + flags[0] = 1; + err = der_encode_sequence_multi(out, outlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &version, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_INTEGER, 1UL, key->prime, + LTC_ASN1_INTEGER, 1UL, key->base, + LTC_ASN1_INTEGER, 1UL, key->x, + LTC_ASN1_EOL, 0UL, NULL); + } + else { + /* export y - public key */ + flags[0] = 0; + err = der_encode_sequence_multi(out, outlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &version, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_INTEGER, 1UL, key->prime, + LTC_ASN1_INTEGER, 1UL, key->base, + LTC_ASN1_INTEGER, 1UL, key->y, + LTC_ASN1_EOL, 0UL, NULL); + } + + return err; +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_export_radix.c b/src/pk/dh/dh_export_radix.c new file mode 100644 index 000000000..301fd7f6e --- /dev/null +++ b/src/pk/dh/dh_export_radix.c @@ -0,0 +1,68 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +static unsigned long _count_digits(int radix, void *num) +{ + void *r, *t; + unsigned long digits = 0; + + if (mp_iszero(num) == LTC_MP_YES) return 1; + if (mp_init_multi(&t, &r, NULL) != CRYPT_OK) return 0; + mp_copy(num, t); + mp_set_int(r, radix); + while (mp_iszero(t) == LTC_MP_NO) { + if (mp_div(t, r, t, NULL) != CRYPT_OK) { + mp_clear_multi(t, r, NULL); + return 0; + } + digits++; + } + mp_clear_multi(t, r, NULL); + return digits; +} + +/** + Export a DH key to a binary packet + @param out [out] The destination for the key + @param outlen [in/out] The max size and resulting size of the DH key + @param type Which type of key (PK_PRIVATE or PK_PUBLIC) + @param key The key you wish to export + @return CRYPT_OK if successful +*/ +int dh_export_radix(int radix, void *out, unsigned long *outlen, int type, dh_key *key) +{ + unsigned long len; + void *k; + + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK((radix >= 2 && radix <= 64) || radix == 256); + + k = (type == PK_PRIVATE) ? key->x : key->y; + len = (radix == 256) ? mp_unsigned_bin_size(k) : _count_digits(radix, k) + 1; + + if (*outlen < len) { + *outlen = len; + return CRYPT_BUFFER_OVERFLOW; + } + *outlen = len; + + return (radix == 256) ? mp_to_unsigned_bin(k, out) : mp_toradix(k, out, radix); +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_free.c b/src/pk/dh/dh_free.c new file mode 100644 index 000000000..8ca1f65cd --- /dev/null +++ b/src/pk/dh/dh_free.c @@ -0,0 +1,43 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Free the allocated ram for a DH key + @param key The key which you wish to free +*/ +void dh_free(dh_key *key) +{ + LTC_ARGCHKVD(key != NULL); + if ( key->base ) { + mp_clear( key->base ); + key->base = NULL; + } + if ( key->prime ) { + mp_clear( key->prime ); + key->prime = NULL; + } + if ( key->x ) { + mp_clear( key->x ); + key->x = NULL; + } + if ( key->y ) { + mp_clear( key->y ); + key->y = NULL; + } +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_import.c b/src/pk/dh/dh_import.c new file mode 100644 index 000000000..aa1684285 --- /dev/null +++ b/src/pk/dh/dh_import.c @@ -0,0 +1,97 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Import a DH key from a binary packet + @param in The packet to read + @param inlen The length of the input packet + @param key [out] Where to import the key to + @return CRYPT_OK if successful, on error all allocated memory is freed automatically +*/ +int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) +{ + unsigned char flags[1]; + int err; + unsigned long version; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(key != NULL); + + /* init */ + if ((err = mp_init_multi(&key->prime, &key->base, &key->x, &key->y, NULL)) != CRYPT_OK) { + return err; + } + + /* find out what type of key it is */ + err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &version, + LTC_ASN1_BIT_STRING, 1UL, &flags, + LTC_ASN1_EOL, 0UL, NULL); + if (err != CRYPT_OK) { + goto error; + } + + if (version == 0) { + if (flags[0] == 1) { + key->type = PK_PRIVATE; + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &version, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_INTEGER, 1UL, key->prime, + LTC_ASN1_INTEGER, 1UL, key->base, + LTC_ASN1_INTEGER, 1UL, key->x, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto error; + } + /* compute public key: y = (base ^ x) mod prime */ + if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { + goto error; + } + } + else { + key->type = PK_PUBLIC; + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_SHORT_INTEGER, 1UL, &version, + LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_INTEGER, 1UL, key->prime, + LTC_ASN1_INTEGER, 1UL, key->base, + LTC_ASN1_INTEGER, 1UL, key->y, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto error; + } + mp_clear(key->x); + key->x = NULL; + } + } + else { + err = CRYPT_INVALID_PACKET; + goto error; + } + + /* check public key */ + if ((err = dh_check_pubkey(key)) != CRYPT_OK) { + goto error; + } + + return CRYPT_OK; + +error: + mp_clear_multi(key->prime, key->base, key->y, key->x, NULL); + return err; +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_import_radix.c b/src/pk/dh/dh_import_radix.c new file mode 100644 index 000000000..cbd6c418b --- /dev/null +++ b/src/pk/dh/dh_import_radix.c @@ -0,0 +1,90 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Import a DH key from a binary string + @param in The string to read + @param inlen The length of the input packet + @param type The type of key (PK_PRIVATE or PK_PUBLIC) + @param base The base (generator) in hex string + @param prime The prime in hex string + @param key [out] Where to import the key to + @return CRYPT_OK if successful, on error all allocated memory is freed automatically +*/ +int dh_import_radix(int radix, + void *in, unsigned long inlen, + void *prime, unsigned long primelen, + void *base, unsigned long baselen, + int type, dh_key *key) +{ + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(base != NULL); + LTC_ARGCHK(prime != NULL); + LTC_ARGCHK(key != NULL); + + if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { + goto error; + } + if (radix == 256) { + if ((err = mp_read_unsigned_bin(key->base, base, baselen)) != CRYPT_OK) { goto error; } + if ((err = mp_read_unsigned_bin(key->prime, prime, primelen)) != CRYPT_OK) { goto error; } + } + else { + if ((err = mp_read_radix(key->base, base, radix)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(key->prime, prime, radix)) != CRYPT_OK) { goto error; } + } + + if (type == PK_PRIVATE) { + /* load the x value */ + if (radix == 256) { + if ((err = mp_read_unsigned_bin(key->x, in, inlen)) != CRYPT_OK) { goto error; } + } + else { + if ((err = mp_read_radix(key->x, in, radix)) != CRYPT_OK) { goto error; } + } + /* compute y value */ + if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { goto error; } + key->type = PK_PRIVATE; + } + else { + /* load the y value */ + if (radix == 256) { + if ((err = mp_read_unsigned_bin(key->y, in, inlen)) != CRYPT_OK) { goto error; } + } + else { + if ((err = mp_read_radix(key->y, in, radix)) != CRYPT_OK) { goto error; } + } + key->type = PK_PUBLIC; + mp_clear(key->x); + key->x = NULL; + } + + /* check public key */ + if ((err = dh_check_pubkey(key)) != CRYPT_OK) { + goto error; + } + + return CRYPT_OK; + +error: + mp_clear_multi(key->prime, key->base, key->y, key->x, NULL); + return err; +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_make_key.c b/src/pk/dh/dh_make_key.c new file mode 100644 index 000000000..ddb34be7f --- /dev/null +++ b/src/pk/dh/dh_make_key.c @@ -0,0 +1,207 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +static int _dh_groupsize_to_keysize(int groupsize) +{ + /* The strength estimates from https://tools.ietf.org/html/rfc3526#section-8 + * We use "Estimate 2" to get an appropriate private key (exponent) size. + */ + if (groupsize <= 0) { + return 0; + } + else if (groupsize <= 192) { + return 30; /* 1536-bit => key size 240-bit */ + } + else if (groupsize <= 256) { + return 40; /* 2048-bit => key size 320-bit */ + } + else if (groupsize <= 384) { + return 52; /* 3072-bit => key size 416-bit */ + } + else if (groupsize <= 512) { + return 60; /* 4096-bit => key size 480-bit */ + } + else if (groupsize <= 768) { + return 67; /* 6144-bit => key size 536-bit */ + } + else if (groupsize <= 1024) { + return 77; /* 8192-bit => key size 616-bit */ + } + else { + return 0; + } +} + +static int _dh_make_key(prng_state *prng, int wprng, void *prime, void *base, dh_key *key) +{ + unsigned char *buf; + unsigned long keysize; + int err, max_iterations = PK_MAX_RETRIES; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(prng != NULL); + LTC_ARGCHK(prime != NULL); + LTC_ARGCHK(base != NULL); + + /* good prng? */ + if ((err = prng_is_valid(wprng)) != CRYPT_OK) { + return err; + } + + /* init big numbers */ + if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { + return err; + } + + /* load the prime and the base */ + if ((err = mp_copy(base, key->base)) != CRYPT_OK) { goto freemp; } + if ((err = mp_copy(prime, key->prime)) != CRYPT_OK) { goto freemp; } + + keysize = _dh_groupsize_to_keysize(mp_unsigned_bin_size(key->prime)); + if (keysize == 0) { + err = CRYPT_INVALID_KEYSIZE; + goto freemp; + } + + /* allocate buffer */ + buf = XMALLOC(keysize); + if (buf == NULL) { + err = CRYPT_MEM; + goto freemp; + } + + key->type = PK_PRIVATE; + do { + /* make up random buf */ + if (prng_descriptor[wprng].read(buf, keysize, prng) != keysize) { + err = CRYPT_ERROR_READPRNG; + goto freebuf; + } + /* load the x value - private key */ + if ((err = mp_read_unsigned_bin(key->x, buf, keysize)) != CRYPT_OK) { + goto freebuf; + } + /* compute the y value - public key */ + if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { + goto freebuf; + } + err = dh_check_pubkey(key); + } while (err != CRYPT_OK && max_iterations-- > 0); + +freebuf: + zeromem(buf, keysize); + XFREE(buf); +freemp: + if (err != CRYPT_OK) mp_clear_multi(key->x, key->y, key->base, key->prime, NULL); + return err; +} + +/** + Make a DH key (custom DH group) [private key pair] + @param prng An active PRNG state + @param wprng The index for the PRNG you desire to use + @param prime_hex The prime p (hexadecimal string) + @param base_hex The base g (hexadecimal string) + @param key [out] Where the newly created DH key will be stored + @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. +*/ +static int _dh_make_key_ex(prng_state *prng, int wprng, int radix, + void *prime, unsigned long primelen, + void *base, unsigned long baselen, + dh_key *key) +{ + void *p, *b; + int err; + + LTC_ARGCHK(prime != NULL); + LTC_ARGCHK(base != NULL); + LTC_ARGCHK((radix >= 2 && radix <= 64) || radix == 256); + + if ((err = mp_init_multi(&p, &b, NULL)) != CRYPT_OK) { return err; } + if (radix == 256) { + if ((err = mp_read_unsigned_bin(b, base, baselen)) != CRYPT_OK) { goto error; } + if ((err = mp_read_unsigned_bin(p, prime, primelen)) != CRYPT_OK) { goto error; } + } + else { + if ((err = mp_read_radix(b, base, radix)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, prime, radix)) != CRYPT_OK) { goto error; } + } + err = _dh_make_key(prng, wprng, p, b, key); + +error: + mp_clear_multi(p, b, NULL); + return err; +} + +/** + Make a DH key (use built-in DH groups) [private key pair] + @param prng An active PRNG state + @param wprng The index for the PRNG you desire to use + @param groupsize The size (octets) of used DH group + @param key [out] Where the newly created DH key will be stored + @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. +*/ +int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) +{ + int i; + + LTC_ARGCHK(groupsize > 0); + + for (i = 0; (groupsize > ltc_dh_sets[i].size) && (ltc_dh_sets[i].size != 0); i++); + if (ltc_dh_sets[i].size == 0) return CRYPT_INVALID_KEYSIZE; + + return _dh_make_key_ex(prng, wprng, 16, + ltc_dh_sets[i].prime, strlen(ltc_dh_sets[i].prime) + 1, + ltc_dh_sets[i].base, strlen(ltc_dh_sets[i].base) + 1, + key); +} + +/** + Make a DH key (dhparam data: openssl dhparam -outform DER -out dhparam.der 2048) + @param prng An active PRNG state + @param wprng The index for the PRNG you desire to use + @param dhparam The DH param DER encoded data + @param dhparamlen The length of dhparam data + @param key [out] Where the newly created DH key will be stored + @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. +*/ +int dh_make_key_dhparam(prng_state *prng, int wprng, unsigned char *dhparam, unsigned long dhparamlen, dh_key *key) +{ + void *prime, *base; + int err; + + LTC_ARGCHK(dhparam != NULL); + LTC_ARGCHK(dhparamlen > 0); + + if ((err = mp_init_multi(&prime, &base, NULL)) != CRYPT_OK) { + return err; + } + if ((err = der_decode_sequence_multi(dhparam, dhparamlen, + LTC_ASN1_INTEGER, 1UL, prime, + LTC_ASN1_INTEGER, 1UL, base, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto error; + } + err = _dh_make_key(prng, wprng, prime, base, key); + +error: + mp_clear_multi(prime, base, NULL); + return err; +} + + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_shared_secret.c b/src/pk/dh/dh_shared_secret.c new file mode 100644 index 000000000..1eb69fbfc --- /dev/null +++ b/src/pk/dh/dh_shared_secret.c @@ -0,0 +1,80 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Create a DH shared secret. + @param private_key The private DH key in the pair + @param public_key The public DH key in the pair + @param out [out] The destination of the shared data + @param outlen [in/out] The max size and resulting size of the shared data. + @return CRYPT_OK if successful +*/ +int dh_shared_secret(dh_key *private_key, dh_key *public_key, + unsigned char *out, unsigned long *outlen) +{ + void *tmp; + unsigned long x; + int err; + + LTC_ARGCHK(private_key != NULL); + LTC_ARGCHK(public_key != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* types valid? */ + if (private_key->type != PK_PRIVATE) { + return CRYPT_PK_NOT_PRIVATE; + } + + /* same DH group? */ + if (mp_cmp(private_key->prime, public_key->prime) != LTC_MP_EQ) { return CRYPT_PK_TYPE_MISMATCH; } + if (mp_cmp(private_key->base, public_key->base) != LTC_MP_EQ) { return CRYPT_PK_TYPE_MISMATCH; } + + /* init big numbers */ + if ((err = mp_init(&tmp)) != CRYPT_OK) { + return err; + } + + /* check public key */ + if ((err = dh_check_pubkey(public_key)) != CRYPT_OK) { + goto error; + } + + /* compute tmp = y^x mod p */ + if ((err = mp_exptmod(public_key->y, private_key->x, private_key->prime, tmp)) != CRYPT_OK) { + goto error; + } + + /* enough space for output? */ + x = (unsigned long)mp_unsigned_bin_size(tmp); + if (*outlen < x) { + *outlen = x; + err = CRYPT_BUFFER_OVERFLOW; + goto error; + } + if ((err = mp_to_unsigned_bin(tmp, out)) != CRYPT_OK) { + goto error; + } + *outlen = x; + err = CRYPT_OK; + +error: + mp_clear(tmp); + return err; +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_static.c b/src/pk/dh/dh_static.c deleted file mode 100644 index d5be03cfb..000000000 --- a/src/pk/dh/dh_static.c +++ /dev/null @@ -1,243 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org - */ -#include "tomcrypt.h" - -/** - @file dh_static.c - DH crypto, Tom St Denis -*/ - -#ifdef LTC_MDH - -#define __DECL_DH_STATIC_H__ -#include "dh_static.h" - -/* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ -const dh_set sets[] = { -#ifdef LTC_DH768 -{ /* 768-bit MODP Group 1 - https://tools.ietf.org/html/rfc7296#appendix-B.1 */ - 96, - "DH-768", - "2", - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A63A3620FFFFFFFFFFFFFFFF" -}, -#endif -#ifdef LTC_DH1024 -{ /* 1024-bit MODP Group 2 - https://tools.ietf.org/html/rfc7296#appendix-B.2 */ - 128, - "DH-1024", - "2", - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" - "FFFFFFFFFFFFFFFF" -}, -#endif -#ifdef LTC_DH1536 -{ /* 1536-bit MODP Group 5 - https://tools.ietf.org/html/rfc3526#section-2 */ - 192, - "DH-1536", - "2", - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" - "670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF" -}, -#endif -#ifdef LTC_DH2048 -{ /* 2048-bit MODP Group 14 - https://tools.ietf.org/html/rfc3526#section-3 */ - 256, - "DH-2048", - "2", - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" - "15728E5A8AACAA68FFFFFFFFFFFFFFFF" -}, -#endif -#ifdef LTC_DH3072 -{ /* 3072-bit MODP Group 15 - https://tools.ietf.org/html/rfc3526#section-4 */ - 384, - "DH-3072", - "2", - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" - "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" - "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" - "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" - "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" - "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" - "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF" -}, -#endif -#ifdef LTC_DH4096 -{ /* 4096-bit MODP Group 16 - https://tools.ietf.org/html/rfc3526#section-5 */ - 512, - "DH-4096", - "2", - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" - "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" - "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" - "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" - "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" - "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" - "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" - "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" - "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" - "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" - "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" - "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199" - "FFFFFFFFFFFFFFFF" -}, -#endif -#ifdef LTC_DH6144 -{ /* 6144-bit MODP Group 17 - https://tools.ietf.org/html/rfc3526#section-6 */ - 786, - "DH-6144", - "2", - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" - "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" - "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" - "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" - "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" - "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" - "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" - "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" - "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" - "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" - "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" - "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" - "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BD" - "F8FF9406AD9E530EE5DB382F413001AEB06A53ED9027D831" - "179727B0865A8918DA3EDBEBCF9B14ED44CE6CBACED4BB1B" - "DB7F1447E6CC254B332051512BD7AF426FB8F401378CD2BF" - "5983CA01C64B92ECF032EA15D1721D03F482D7CE6E74FEF6" - "D55E702F46980C82B5A84031900B1C9E59E7C97FBEC7E8F3" - "23A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" - "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE328" - "06A1D58BB7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55C" - "DA56C9EC2EF29632387FE8D76E3C0468043E8F663F4860EE" - "12BF2D5B0B7474D6E694F91E6DCC4024FFFFFFFFFFFFFFFF" -}, -#endif -#ifdef LTC_DH8192 -{ /* 8192-bit MODP Group 18 - https://tools.ietf.org/html/rfc3526#section-7 */ - 1024, - "DH-8192", - "2", - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" - "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" - "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" - "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" - "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" - "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" - "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" - "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" - "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" - "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" - "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" - "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" - "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BD" - "F8FF9406AD9E530EE5DB382F413001AEB06A53ED9027D831" - "179727B0865A8918DA3EDBEBCF9B14ED44CE6CBACED4BB1B" - "DB7F1447E6CC254B332051512BD7AF426FB8F401378CD2BF" - "5983CA01C64B92ECF032EA15D1721D03F482D7CE6E74FEF6" - "D55E702F46980C82B5A84031900B1C9E59E7C97FBEC7E8F3" - "23A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" - "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE328" - "06A1D58BB7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55C" - "DA56C9EC2EF29632387FE8D76E3C0468043E8F663F4860EE" - "12BF2D5B0B7474D6E694F91E6DBE115974A3926F12FEE5E4" - "38777CB6A932DF8CD8BEC4D073B931BA3BC832B68D9DD300" - "741FA7BF8AFC47ED2576F6936BA424663AAB639C5AE4F568" - "3423B4742BF1C978238F16CBE39D652DE3FDB8BEFC848AD9" - "22222E04A4037C0713EB57A81A23F0C73473FC646CEA306B" - "4BCBC8862F8385DDFA9D4B7FA2C087E879683303ED5BDD3A" - "062B3CF5B3A278A66D2A13F83F44F82DDF310EE074AB6A36" - "4597E899A0255DC164F31CC50846851DF9AB48195DED7EA1" - "B1D510BD7EE74D73FAF36BC31ECFA268359046F4EB879F92" - "4009438B481C6CD7889A002ED5EE382BC9190DA6FC026E47" - "9558E4475677E9AA9E3050E2765694DFC81F56E880B96E71" - "60C980DD98EDD3DFFFFFFFFFFFFFFFFF" -}, -#endif -{ - 0, - NULL, - NULL, - NULL -} -}; - -int dh_is_valid_idx(int n) -{ - int x; - - for (x = 0; sets[x].size; x++); - if ((n < 0) || (n >= x)) { - return 0; - } - return 1; -} - - -#endif /* LTC_MDH */ diff --git a/src/pk/dh/dh_static.h b/src/pk/dh/dh_static.h deleted file mode 100644 index 5a47ee0c3..000000000 --- a/src/pk/dh/dh_static.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef __DH_STATIC_H__ -#define __DH_STATIC_H__ -#ifndef __DECL_DH_STATIC_H__ -#define __DECL_DH_STATIC_H__ extern -#endif - -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org - */ -#include "tomcrypt.h" - -/** - @file dh_static.h - DH crypto, Tom St Denis -*/ - -#ifdef LTC_MDH - -/* size of a packet header in bytes */ -#define PACKET_SIZE 4 - -/* Section tags */ -#define PACKET_SECT_DH 1 - -/* Subsection Tags for the first three sections */ -#define PACKET_SUB_KEY 0 -#define PACKET_SUB_ENCRYPTED 1 -#define PACKET_SUB_SIGNED 2 -#define PACKET_SUB_ENC_KEY 3 - -#define OUTPUT_BIGNUM(num, out, y, z) \ -{ \ - if ((y + 4) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ - z = (unsigned long)mp_unsigned_bin_size(num); \ - STORE32L(z, out+y); \ - y += 4; \ - if ((y + z) > *outlen) { return CRYPT_BUFFER_OVERFLOW; } \ - if ((err = mp_to_unsigned_bin(num, out+y)) != CRYPT_OK) { return err; } \ - y += z; \ -} - -#define INPUT_BIGNUM(num, in, x, y, inlen) \ -{ \ - /* load value */ \ - if ((y + 4) > inlen) { \ - err = CRYPT_INVALID_PACKET; \ - goto error; \ - } \ - LOAD32L(x, in+y); \ - y += 4; \ - \ - /* sanity check... */ \ - if ((x+y) > inlen) { \ - err = CRYPT_INVALID_PACKET; \ - goto error; \ - } \ - \ - /* load it */ \ - if ((err = mp_read_unsigned_bin(num, (unsigned char *)in+y, (int)x)) != CRYPT_OK) {\ - goto error; \ - } \ - y += x; \ -} - -static LTC_INLINE void packet_store_header (unsigned char *dst, int section, int subsection) -{ - LTC_ARGCHKVD(dst != NULL); - - /* store version number */ - dst[0] = (unsigned char)(CRYPT&255); - dst[1] = (unsigned char)((CRYPT>>8)&255); - - /* store section and subsection */ - dst[2] = (unsigned char)(section & 255); - dst[3] = (unsigned char)(subsection & 255); - -} - -static LTC_INLINE int packet_valid_header (unsigned char *src, int section, int subsection) -{ - unsigned long ver; - - LTC_ARGCHK(src != NULL); - - /* check version */ - ver = ((unsigned long)src[0]) | ((unsigned long)src[1] << 8U); - if (CRYPT < ver) { - return CRYPT_INVALID_PACKET; - } - - /* check section and subsection */ - if (section != (int)src[2] || subsection != (int)src[3]) { - return CRYPT_INVALID_PACKET; - } - - return CRYPT_OK; -} - -#ifndef DH_BUF_SIZE -/* max export size we'll encounter (smaller than this but lets round up a bit) */ -#define DH_BUF_SIZE 1200 -#endif /* DH_BUF_SIZE */ - -typedef struct { - int size; - char *name, *base, *prime; -} dh_set; - -/* This holds the key settings. ***MUST*** be organized by size from smallest to largest. */ -__DECL_DH_STATIC_H__ const dh_set sets[]; - - -int dh_is_valid_idx(int n); - - -#endif /* __DH_STATIC_H__ */ - -#endif /* LTC_MDH */ diff --git a/src/pk/dh/dh_sys.c b/src/pk/dh/dh_sys.c deleted file mode 100644 index 8a42c96c0..000000000 --- a/src/pk/dh/dh_sys.c +++ /dev/null @@ -1,490 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - * - * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.org - */ - -#include "tomcrypt.h" - -#ifdef LTC_MDH -/** - @file dh_sys.c - DH Crypto, Tom St Denis -*/ - -#include "dh_static.h" - - -/** - Encrypt a short symmetric key with a public DH key - @param in The symmetric key to encrypt - @param inlen The length of the key (octets) - @param out [out] The ciphertext - @param outlen [in/out] The max size and resulting size of the ciphertext - @param prng An active PRNG state - @param wprng The index of the PRNG desired - @param hash The index of the hash desired (must produce a digest of size >= the size of the plaintext) - @param key The public key you wish to encrypt with. - @return CRYPT_OK if successful -*/ -int dh_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, int hash, - dh_key *key) -{ - unsigned char *pub_expt, *dh_shared, *skey; - dh_key pubkey; - unsigned long x, y, z, pubkeysize; - int err; - - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(key != NULL); - - /* check that wprng/hash are not invalid */ - if ((err = prng_is_valid(wprng)) != CRYPT_OK) { - return err; - } - - if ((err = hash_is_valid(hash)) != CRYPT_OK) { - return err; - } - - if (inlen > hash_descriptor[hash].hashsize) { - return CRYPT_INVALID_HASH; - } - - /* allocate memory */ - pub_expt = XMALLOC(DH_BUF_SIZE); - dh_shared = XMALLOC(DH_BUF_SIZE); - skey = XMALLOC(MAXBLOCKSIZE); - if (pub_expt == NULL || dh_shared == NULL || skey == NULL) { - if (pub_expt != NULL) { - XFREE(pub_expt); - } - if (dh_shared != NULL) { - XFREE(dh_shared); - } - if (skey != NULL) { - XFREE(skey); - } - return CRYPT_MEM; - } - - /* make a random key and export the public copy */ - if ((err = dh_make_key(prng, wprng, dh_get_size(key), &pubkey)) != CRYPT_OK) { - goto LBL_ERR; - } - - pubkeysize = DH_BUF_SIZE; - if ((err = dh_export(pub_expt, &pubkeysize, PK_PUBLIC, &pubkey)) != CRYPT_OK) { - dh_free(&pubkey); - goto LBL_ERR; - } - - /* now check if the out buffer is big enough */ - if (*outlen < (1 + 4 + 4 + PACKET_SIZE + pubkeysize + inlen)) { - dh_free(&pubkey); - err = CRYPT_BUFFER_OVERFLOW; - goto LBL_ERR; - } - - x = DH_BUF_SIZE; - if ((err = dh_shared_secret(&pubkey, key, dh_shared, &x)) != CRYPT_OK) { - dh_free(&pubkey); - goto LBL_ERR; - } - dh_free(&pubkey); - - z = MAXBLOCKSIZE; - if ((err = hash_memory(hash, dh_shared, x, skey, &z)) != CRYPT_OK) { - goto LBL_ERR; - } - - /* store header */ - packet_store_header(out, PACKET_SECT_DH, PACKET_SUB_ENC_KEY); - - /* output header */ - y = PACKET_SIZE; - - /* size of hash name and the name itself */ - out[y++] = hash_descriptor[hash].ID; - - /* length of DH pubkey and the key itself */ - STORE32L(pubkeysize, out+y); - y += 4; - for (x = 0; x < pubkeysize; x++, y++) { - out[y] = pub_expt[x]; - } - - /* Store the encrypted key */ - STORE32L(inlen, out+y); - y += 4; - - for (x = 0; x < inlen; x++, y++) { - out[y] = skey[x] ^ in[x]; - } - *outlen = y; - - err = CRYPT_OK; -LBL_ERR: -#ifdef LTC_CLEAN_STACK - /* clean up */ - zeromem(pub_expt, DH_BUF_SIZE); - zeromem(dh_shared, DH_BUF_SIZE); - zeromem(skey, MAXBLOCKSIZE); -#endif - XFREE(skey); - XFREE(dh_shared); - XFREE(pub_expt); - - return err; -} - -/** - Decrypt a DH encrypted symmetric key - @param in The DH encrypted packet - @param inlen The length of the DH encrypted packet - @param out The plaintext - @param outlen [in/out] The max size and resulting size of the plaintext - @param key The private DH key corresponding to the public key that encrypted the plaintext - @return CRYPT_OK if successful -*/ -int dh_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - dh_key *key) -{ - unsigned char *shared_secret, *skey; - unsigned long x, y, z, keysize; - int hash, err; - dh_key pubkey; - - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(key != NULL); - - /* right key type? */ - if (key->type != PK_PRIVATE) { - return CRYPT_PK_NOT_PRIVATE; - } - - /* allocate ram */ - shared_secret = XMALLOC(DH_BUF_SIZE); - skey = XMALLOC(MAXBLOCKSIZE); - if (shared_secret == NULL || skey == NULL) { - if (shared_secret != NULL) { - XFREE(shared_secret); - } - if (skey != NULL) { - XFREE(skey); - } - return CRYPT_MEM; - } - - /* check if initial header should fit */ - if (inlen < PACKET_SIZE+1+4+4) { - err = CRYPT_INVALID_PACKET; - goto LBL_ERR; - } else { - inlen -= PACKET_SIZE+1+4+4; - } - - /* is header correct? */ - if ((err = packet_valid_header((unsigned char *)in, PACKET_SECT_DH, PACKET_SUB_ENC_KEY)) != CRYPT_OK) { - goto LBL_ERR; - } - - /* now lets get the hash name */ - y = PACKET_SIZE; - hash = find_hash_id(in[y++]); - if (hash == -1) { - err = CRYPT_INVALID_HASH; - goto LBL_ERR; - } - - /* get public key */ - LOAD32L(x, in+y); - - /* now check if the imported key will fit */ - if (inlen < x) { - err = CRYPT_INVALID_PACKET; - goto LBL_ERR; - } else { - inlen -= x; - } - - y += 4; - if ((err = dh_import(in+y, x, &pubkey)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - - /* make shared key */ - x = DH_BUF_SIZE; - if ((err = dh_shared_secret(key, &pubkey, shared_secret, &x)) != CRYPT_OK) { - dh_free(&pubkey); - goto LBL_ERR; - } - dh_free(&pubkey); - - z = MAXBLOCKSIZE; - if ((err = hash_memory(hash, shared_secret, x, skey, &z)) != CRYPT_OK) { - goto LBL_ERR; - } - - /* load in the encrypted key */ - LOAD32L(keysize, in+y); - - /* will the out fit as part of the input */ - if (inlen < keysize) { - err = CRYPT_INVALID_PACKET; - goto LBL_ERR; - } - - if (keysize > *outlen) { - err = CRYPT_BUFFER_OVERFLOW; - goto LBL_ERR; - } - y += 4; - - *outlen = keysize; - - for (x = 0; x < keysize; x++, y++) { - out[x] = skey[x] ^ in[y]; - } - - err = CRYPT_OK; -LBL_ERR: -#ifdef LTC_CLEAN_STACK - zeromem(shared_secret, DH_BUF_SIZE); - zeromem(skey, MAXBLOCKSIZE); -#endif - - XFREE(skey); - XFREE(shared_secret); - - return err; -} - -/* perform an ElGamal Signature of a hash - * - * The math works as follows. x is the private key, M is the message to sign - - 1. pick a random k - 2. compute a = g^k mod p - 3. compute b = (M - xa)/k mod p - 4. Send (a,b) - - Now to verify with y=g^x mod p, a and b - - 1. compute y^a * a^b = g^(xa) * g^(k*(M-xa)/k) - = g^(xa + (M - xa)) - = g^M [all mod p] - - 2. Compare against g^M mod p [based on input hash]. - 3. If result of #2 == result of #1 then signature valid -*/ - -/** - Sign a message digest using a DH private key - @param in The data to sign - @param inlen The length of the input (octets) - @param out [out] The destination of the signature - @param outlen [in/out] The max size and resulting size of the output - @param prng An active PRNG state - @param wprng The index of the PRNG desired - @param key A private DH key - @return CRYPT_OK if successful -*/ -int dh_sign_hash(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, dh_key *key) -{ - void *a, *b, *k, *m, *g, *p, *p1, *tmp; - unsigned char *buf; - unsigned long x, y; - int err; - - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(key != NULL); - - /* check parameters */ - if (key->type != PK_PRIVATE) { - return CRYPT_PK_NOT_PRIVATE; - } - - if ((err = prng_is_valid(wprng)) != CRYPT_OK) { - return err; - } - - /* is the IDX valid ? */ - if (dh_is_valid_idx(key->idx) != 1) { - return CRYPT_PK_INVALID_TYPE; - } - - /* allocate ram for buf */ - buf = XMALLOC(520); - - /* make up a random value k, - * since the order of the group is prime - * we need not check if gcd(k, r) is 1 - */ - if (prng_descriptor[wprng].read(buf, sets[key->idx].size, prng) != - (unsigned long)(sets[key->idx].size)) { - err = CRYPT_ERROR_READPRNG; - goto LBL_ERR_1; - } - - /* init bignums */ - if ((err = mp_init_multi(&a, &b, &k, &m, &p, &g, &p1, &tmp, NULL)) != CRYPT_OK) { - goto LBL_ERR; - } - - /* load k and m */ - if ((err = mp_read_unsigned_bin(m, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_unsigned_bin(k, buf, sets[key->idx].size)) != CRYPT_OK) { goto LBL_ERR; } - - /* load g, p and p1 */ - if ((err = mp_read_radix(g, sets[key->idx].base, 16)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(p, sets[key->idx].prime, 16)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_sub_d(p, 1, p1)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_div_2(p1, p1)) != CRYPT_OK) { goto LBL_ERR; } /* p1 = (p-1)/2 */ - - /* now get a = g^k mod p */ - if ((err = mp_exptmod(g, k, p, a)) != CRYPT_OK) { goto LBL_ERR; } - - /* now find M = xa + kb mod p1 or just b = (M - xa)/k mod p1 */ - if ((err = mp_invmod(k, p1, k)) != CRYPT_OK) { goto LBL_ERR; } /* k = 1/k mod p1 */ - if ((err = mp_mulmod(a, key->x, p1, tmp)) != CRYPT_OK) { goto LBL_ERR; } /* tmp = xa */ - if ((err = mp_submod(m, tmp, p1, tmp)) != CRYPT_OK) { goto LBL_ERR; } /* tmp = M - xa */ - if ((err = mp_mulmod(k, tmp, p1, b)) != CRYPT_OK) { goto LBL_ERR; } /* b = (M - xa)/k */ - - /* check for overflow */ - if ((unsigned long)(PACKET_SIZE + 4 + 4 + mp_unsigned_bin_size(a) + mp_unsigned_bin_size(b)) > *outlen) { - err = CRYPT_BUFFER_OVERFLOW; - goto LBL_ERR; - } - - /* store header */ - y = PACKET_SIZE; - - /* now store them both (a,b) */ - x = (unsigned long)mp_unsigned_bin_size(a); - STORE32L(x, out+y); y += 4; - if ((err = mp_to_unsigned_bin(a, out+y)) != CRYPT_OK) { goto LBL_ERR; } - y += x; - - x = (unsigned long)mp_unsigned_bin_size(b); - STORE32L(x, out+y); y += 4; - if ((err = mp_to_unsigned_bin(b, out+y)) != CRYPT_OK) { goto LBL_ERR; } - y += x; - - /* check if size too big */ - if (*outlen < y) { - err = CRYPT_BUFFER_OVERFLOW; - goto LBL_ERR; - } - - /* store header */ - packet_store_header(out, PACKET_SECT_DH, PACKET_SUB_SIGNED); - *outlen = y; - - err = CRYPT_OK; -LBL_ERR: - mp_clear_multi(tmp, p1, g, p, m, k, b, a, NULL); -LBL_ERR_1: - - XFREE(buf); - - return err; -} - - -/** - Verify the signature given - @param sig The signature - @param siglen The length of the signature (octets) - @param hash The hash that was signed - @param hashlen The length of the hash (octets) - @param stat [out] Result of signature comparison, 1==valid, 0==invalid - @param key The public DH key that signed the hash - @return CRYPT_OK if succsessful (even if signature is invalid) -*/ -int dh_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, - int *stat, dh_key *key) -{ - void *a, *b, *p, *g, *m, *tmp; - unsigned long x, y; - int err; - - LTC_ARGCHK(sig != NULL); - LTC_ARGCHK(hash != NULL); - LTC_ARGCHK(stat != NULL); - LTC_ARGCHK(key != NULL); - - /* default to invalid */ - *stat = 0; - - /* check initial input length */ - if (siglen < PACKET_SIZE+4+4) { - return CRYPT_INVALID_PACKET; - } - - /* header ok? */ - if ((err = packet_valid_header((unsigned char *)sig, PACKET_SECT_DH, PACKET_SUB_SIGNED)) != CRYPT_OK) { - return err; - } - - /* get hash out of packet */ - y = PACKET_SIZE; - - /* init all bignums */ - if ((err = mp_init_multi(&a, &p, &b, &g, &m, &tmp, NULL)) != CRYPT_OK) { - return err; - } - - /* load a and b */ - INPUT_BIGNUM(a, sig, x, y, siglen); - INPUT_BIGNUM(b, sig, x, y, siglen); - - /* load p and g */ - if ((err = mp_read_radix(p, sets[key->idx].prime, 16)) != CRYPT_OK) { goto error1; } - if ((err = mp_read_radix(g, sets[key->idx].base, 16)) != CRYPT_OK) { goto error1; } - - /* load m */ - if ((err = mp_read_unsigned_bin(m, (unsigned char *)hash, hashlen)) != CRYPT_OK) { goto error1; } - - /* find g^m mod p */ - if ((err = mp_exptmod(g, m, p, m)) != CRYPT_OK) { goto error1; } /* m = g^m mod p */ - - /* find y^a * a^b */ - if ((err = mp_exptmod(key->y, a, p, tmp)) != CRYPT_OK) { goto error1; } /* tmp = y^a mod p */ - if ((err = mp_exptmod(a, b, p, a)) != CRYPT_OK) { goto error1; } /* a = a^b mod p */ - if ((err = mp_mulmod(a, tmp, p, a)) != CRYPT_OK) { goto error1; } /* a = y^a * a^b mod p */ - - /* y^a * a^b == g^m ??? */ - if (mp_cmp(a, m) == 0) { - *stat = 1; - } - - /* clean up */ - err = CRYPT_OK; - goto done; -error1: -error: -done: - mp_clear_multi(tmp, m, g, p, b, a, NULL); - return err; -} - -#endif /* LTC_MDH */ diff --git a/tests/dh_test.c b/tests/dh_test.c index efca705df..3374c80e9 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -16,108 +16,220 @@ #define KEYSIZE 2048 #endif -int dh_test (void) +static int _prime_test(void) { - unsigned char buf[3][4096], ch; - unsigned long x, y, z; - int stat, stat2; - dh_key usera, userb; + void *p, *g, *tmp; + int x, err, primality; + + if ((err = mp_init_multi(&p, &g, &tmp, NULL)) != CRYPT_OK) { goto error; } + + for (x = 0; ltc_dh_sets[x].size != 0; x++) { + if ((err = mp_read_radix(g, ltc_dh_sets[x].base, 16)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, ltc_dh_sets[x].prime, 16)) != CRYPT_OK) { goto error; } + + /* ensure p is prime */ + if ((err = mp_prime_is_prime(p, 8, &primality)) != CRYPT_OK) { goto done; } + if (primality != LTC_MP_YES ) { + err = CRYPT_FAIL_TESTVECTOR; + goto done; + } + + if ((err = mp_sub_d(p, 1, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_div_2(tmp, tmp)) != CRYPT_OK) { goto error; } + + /* ensure (p-1)/2 is prime */ + if ((err = mp_prime_is_prime(tmp, 8, &primality)) != CRYPT_OK) { goto done; } + if (primality == 0) { + err = CRYPT_FAIL_TESTVECTOR; + goto done; + } + + /* now see if g^((p-1)/2) mod p is in fact 1 */ + if ((err = mp_exptmod(g, tmp, p, tmp)) != CRYPT_OK) { goto error; } + if (mp_cmp_d(tmp, 1)) { + err = CRYPT_FAIL_TESTVECTOR; + goto done; + } + } + err = CRYPT_OK; +error: +done: + mp_clear_multi(tmp, g, p, NULL); + return err; +} + +static int _dhparam_test(void) +{ + dh_key k; + unsigned char buf[1024]; + /* generated by: openssl dhparam -outform der -out dhparam.der 2048 */ + unsigned char dhparam_der[] = { + 0x30, 0x82, 0x01, 0x08, 0x02, 0x82, 0x01, 0x01, 0x00, 0xae, 0xfe, 0x78, 0xce, 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x29, 0x1c, 0xe2, 0x8e, 0xbb, 0x7b, 0xcb, 0xcc, 0x70, 0x7e, 0x4f, 0x0e, 0xd3, + 0x5d, 0x64, 0x64, 0x1b, 0x27, 0xbb, 0xda, 0xa9, 0x08, 0x2b, 0x62, 0xd4, 0xca, 0xc3, 0x3a, 0x23, + 0x39, 0x58, 0x57, 0xaf, 0x7b, 0x8b, 0x0c, 0x5b, 0x2e, 0xfc, 0x42, 0x57, 0x59, 0x39, 0x2e, 0x6d, + 0x39, 0x97, 0xdb, 0x5b, 0x5c, 0xb9, 0x59, 0x71, 0x42, 0xf3, 0xcd, 0xea, 0xda, 0x86, 0x54, 0x86, + 0x61, 0x8d, 0x93, 0x66, 0xc7, 0x65, 0xd1, 0x98, 0xcb, 0x02, 0x01, 0x02 + }; + /* text dump: openssl dh -inform DER -in dhparam.der -text + DH Parameters: (2048 bit) + prime: + 00:ae:fe:78:ce:80:d5:d7:8e:cc:4f:0c:1b:b0:95: + 10:e1:41:15:53:4d:0e:68:b0:f8:5a:41:0e:65:2f: + 9f:ac:9c:30:b0:76:ec:02:e9:43:55:08:b4:20:60: + d9:52:da:2d:ab:9a:ba:e6:cf:11:a7:00:44:c2:5e: + d1:ba:9b:aa:fe:03:dd:dc:ef:41:89:9c:ac:64:13: + d9:6a:8a:55:a0:5b:ff:12:92:37:52:6a:91:a4:6e: + 9e:61:b7:fe:b0:17:8e:67:0f:88:46:a7:9e:b1:db: + 68:77:70:b5:77:f2:7e:33:b1:3e:10:c4:63:36:d0: + 13:27:d3:29:c3:b6:5d:f6:5d:a7:d8:25:5c:0b:65: + 99:fa:f9:5f:1d:ee:d1:86:64:7c:44:cb:a0:12:52: + 4c:d4:46:81:ae:07:db:c7:13:29:ce:9b:cf:1c:06: + d2:0f:2d:bb:12:33:b9:b1:0f:67:5d:3f:0c:e4:fa: + 67:26:e2:89:a2:d5:66:29:1c:e2:8e:bb:7b:cb:cc: + 70:7e:4f:0e:d3:5d:64:64:1b:27:bb:da:a9:08:2b: + 62:d4:ca:c3:3a:23:39:58:57:af:7b:8b:0c:5b:2e: + fc:42:57:59:39:2e:6d:39:97:db:5b:5c:b9:59:71: + 42:f3:cd:ea:da:86:54:86:61:8d:93:66:c7:65:d1: + 98:cb + generator: 2 (0x2) + */ + unsigned char prime[] = { + 0xae, 0xfe, 0x78, 0xce, 0x80, 0xd5, 0xd7, 0x8e, 0xcc, 0x4f, 0x0c, 0x1b, 0xb0, 0x95, + 0x10, 0xe1, 0x41, 0x15, 0x53, 0x4d, 0x0e, 0x68, 0xb0, 0xf8, 0x5a, 0x41, 0x0e, 0x65, 0x2f, + 0x9f, 0xac, 0x9c, 0x30, 0xb0, 0x76, 0xec, 0x02, 0xe9, 0x43, 0x55, 0x08, 0xb4, 0x20, 0x60, + 0xd9, 0x52, 0xda, 0x2d, 0xab, 0x9a, 0xba, 0xe6, 0xcf, 0x11, 0xa7, 0x00, 0x44, 0xc2, 0x5e, + 0xd1, 0xba, 0x9b, 0xaa, 0xfe, 0x03, 0xdd, 0xdc, 0xef, 0x41, 0x89, 0x9c, 0xac, 0x64, 0x13, + 0xd9, 0x6a, 0x8a, 0x55, 0xa0, 0x5b, 0xff, 0x12, 0x92, 0x37, 0x52, 0x6a, 0x91, 0xa4, 0x6e, + 0x9e, 0x61, 0xb7, 0xfe, 0xb0, 0x17, 0x8e, 0x67, 0x0f, 0x88, 0x46, 0xa7, 0x9e, 0xb1, 0xdb, + 0x68, 0x77, 0x70, 0xb5, 0x77, 0xf2, 0x7e, 0x33, 0xb1, 0x3e, 0x10, 0xc4, 0x63, 0x36, 0xd0, + 0x13, 0x27, 0xd3, 0x29, 0xc3, 0xb6, 0x5d, 0xf6, 0x5d, 0xa7, 0xd8, 0x25, 0x5c, 0x0b, 0x65, + 0x99, 0xfa, 0xf9, 0x5f, 0x1d, 0xee, 0xd1, 0x86, 0x64, 0x7c, 0x44, 0xcb, 0xa0, 0x12, 0x52, + 0x4c, 0xd4, 0x46, 0x81, 0xae, 0x07, 0xdb, 0xc7, 0x13, 0x29, 0xce, 0x9b, 0xcf, 0x1c, 0x06, + 0xd2, 0x0f, 0x2d, 0xbb, 0x12, 0x33, 0xb9, 0xb1, 0x0f, 0x67, 0x5d, 0x3f, 0x0c, 0xe4, 0xfa, + 0x67, 0x26, 0xe2, 0x89, 0xa2, 0xd5, 0x66, 0x29, 0x1c, 0xe2, 0x8e, 0xbb, 0x7b, 0xcb, 0xcc, + 0x70, 0x7e, 0x4f, 0x0e, 0xd3, 0x5d, 0x64, 0x64, 0x1b, 0x27, 0xbb, 0xda, 0xa9, 0x08, 0x2b, + 0x62, 0xd4, 0xca, 0xc3, 0x3a, 0x23, 0x39, 0x58, 0x57, 0xaf, 0x7b, 0x8b, 0x0c, 0x5b, 0x2e, + 0xfc, 0x42, 0x57, 0x59, 0x39, 0x2e, 0x6d, 0x39, 0x97, 0xdb, 0x5b, 0x5c, 0xb9, 0x59, 0x71, + 0x42, 0xf3, 0xcd, 0xea, 0xda, 0x86, 0x54, 0x86, 0x61, 0x8d, 0x93, 0x66, 0xc7, 0x65, 0xd1, + 0x98, 0xcb + }; + + DO(dh_make_key_dhparam(&yarrow_prng, find_prng ("yarrow"), dhparam_der, sizeof(dhparam_der), &k)); + if (mp_unsigned_bin_size(k.prime) > sizeof(buf)) { + printf("dhparam_test: short buf\n"); + dh_free(&k); + return CRYPT_ERROR; + } + DO(mp_to_unsigned_bin(k.prime, buf)); + if (compare_testvector(buf, sizeof(prime), prime, sizeof(prime), "dhparam_test", 1)) { + printf("dhparam_test: prime mismatch\n"); + dh_free(&k); + return CRYPT_ERROR; + } + if (mp_cmp_d(k.base, 2) != LTC_MP_EQ) { + printf("dhparam_test: base mismatch\n"); + dh_free(&k); + return CRYPT_ERROR; + } + dh_free(&k); + return CRYPT_OK; +} + +static int _basic_test(void) +{ + unsigned char buf[3][4096]; + unsigned long x, y, z; + int size; + dh_key usera, userb; if (register_prng(&yarrow_desc) == -1) { printf("Error registering yarrow PRNG\n"); - exit(-1); + return CRYPT_ERROR; } if (register_hash(&md5_desc) == -1) { printf("Error registering md5 hash\n"); - exit(-1); + return CRYPT_ERROR; } - DO(dh_compat_test()); - - - /* make up two keys */ - DO(dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &usera)); - DO(dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &userb)); - - /* make the shared secret */ - x = KEYSIZE; - DO(dh_shared_secret (&usera, &userb, buf[0], &x)); - - y = KEYSIZE; - DO(dh_shared_secret (&userb, &usera, buf[1], &y)); - if (y != x) { - fprintf(stderr, "DH Shared keys are not same size.\n"); - dh_free (&usera); - dh_free (&userb); - return 1; - } - if (memcmp (buf[0], buf[1], x)) { - fprintf(stderr, "DH Shared keys not same contents.\n"); - dh_free (&usera); - dh_free (&userb); - return 1; - } - - /* now export userb */ - y = KEYSIZE; - DO(dh_export (buf[1], &y, PK_PUBLIC, &userb)); - dh_free (&userb); - - /* import and make the shared secret again */ - DO(dh_import (buf[1], y, &userb)); - z = KEYSIZE; - DO(dh_shared_secret (&usera, &userb, buf[2], &z)); - - dh_free (&usera); - dh_free (&userb); - - if (z != x) { - fprintf(stderr, "failed. Size don't match?\n"); - return 1; - } - if (memcmp (buf[0], buf[2], x)) { - fprintf(stderr, "Failed. Content didn't match.\n"); - return 1; - } - -/* test encrypt_key */ - dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &usera); - for (ch = 0; ch < 16; ch++) { - buf[0][ch] = ch; - } - y = sizeof (buf[1]); - DO(dh_encrypt_key (buf[0], 16, buf[1], &y, &yarrow_prng, find_prng ("yarrow"), find_hash ("md5"), &usera)); - zeromem (buf[0], sizeof (buf[0])); - x = sizeof (buf[0]); - DO(dh_decrypt_key (buf[1], y, buf[0], &x, &usera)); - if (x != 16) { - fprintf(stderr, "Failed (length)\n"); - dh_free (&usera); - return 1; - } - for (ch = 0; ch < 16; ch++) - if (buf[0][ch] != ch) { - fprintf(stderr, "Failed (contents)\n"); + /* make up two keys */ + DO(dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &usera)); + DO(dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &userb)); + + /* make the shared secret */ + x = KEYSIZE; + DO(dh_shared_secret (&usera, &userb, buf[0], &x)); + + y = KEYSIZE; + DO(dh_shared_secret (&userb, &usera, buf[1], &y)); + if (y != x) { + fprintf(stderr, "DH Shared keys are not same size.\n"); dh_free (&usera); - return 1; - } - -/* test sign_hash */ - for (ch = 0; ch < 16; ch++) { - buf[0][ch] = ch; - } - x = sizeof (buf[1]); - DO(dh_sign_hash (buf[0], 16, buf[1], &x, &yarrow_prng, find_prng ("yarrow"), &usera)); - DO(dh_verify_hash (buf[1], x, buf[0], 16, &stat, &usera)); - buf[0][0] ^= 1; - DO(dh_verify_hash (buf[1], x, buf[0], 16, &stat2, &usera)); - dh_free (&usera); - if (!(stat == 1 && stat2 == 0)) { - fprintf(stderr, "dh_sign/verify_hash %d %d", stat, stat2); - return 1; - } - return 0; + dh_free (&userb); + return CRYPT_ERROR; + } + if (memcmp (buf[0], buf[1], x)) { + fprintf(stderr, "DH Shared keys not same contents.\n"); + dh_free (&usera); + dh_free (&userb); + return CRYPT_ERROR; + } + + /* now export userb */ + y = KEYSIZE; + DO(dh_export (buf[1], &y, PK_PUBLIC, &userb)); + dh_free (&userb); + + /* import and make the shared secret again */ + DO(dh_import (buf[1], y, &userb)); + z = KEYSIZE; + DO(dh_shared_secret (&usera, &userb, buf[2], &z)); + + dh_free (&usera); + dh_free (&userb); + + if (z != x) { + fprintf(stderr, "failed. Size don't match?\n"); + return CRYPT_ERROR; + } + if (memcmp (buf[0], buf[2], x)) { + fprintf(stderr, "Failed. Content didn't match.\n"); + return CRYPT_ERROR; + } + + for (x = 0; ltc_dh_sets[x].size != 0; x++) { + DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), ltc_dh_sets[x].size, &usera)); + size = dh_get_groupsize(&usera); + dh_free(&usera); + if (size != ltc_dh_sets[x].size) { + fprintf(stderr, "dh_groupsize mismatch %d %d\n", size, ltc_dh_sets[x].size); + return CRYPT_ERROR; + } + } + + return CRYPT_OK; } + +int dh_test(void) +{ + int fails = 0; + if (_prime_test() != CRYPT_OK) fails++; + if (_basic_test() != CRYPT_OK) fails++; + if (_dhparam_test() != CRYPT_OK) fails++; + return fails > 0 ? CRYPT_FAIL_TESTVECTOR : CRYPT_OK; +} + #else int dh_test(void) From f9802359c94f3cc6872ececef89ffa18f86fc9fe Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 09:48:17 +0200 Subject: [PATCH 0893/1192] update makefiles --- libtomcrypt_VS2008.vcproj | 26 +++++++++++++++++++++++--- makefile.mingw | 10 ++++++---- makefile.msvc | 10 ++++++---- makefile.unix | 10 ++++++---- makefile_include.mk | 10 ++++++---- 5 files changed, 47 insertions(+), 19 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 6f92d2847..a400ac22d 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2051,15 +2051,35 @@ > + + + + + + + + + + diff --git a/makefile.mingw b/makefile.mingw index 67b280284..445ce4aea 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -160,10 +160,12 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ +src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile.msvc b/makefile.msvc index 8395ed5f8..1adb79403 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -153,10 +153,12 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.obj \ src/pk/asn1/der/utctime/der_decode_utctime.obj src/pk/asn1/der/utctime/der_encode_utctime.obj \ src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_utf8_string.obj \ src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \ -src/pk/dh/dh.obj src/pk/dh/dh_static.obj src/pk/dh/dh_sys.obj src/pk/dsa/dsa_decrypt_key.obj \ -src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \ -src/pk/dsa/dsa_import_radix.obj src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj \ -src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ +src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_export_radix.obj \ +src/pk/dh/dh_free.obj src/pk/dh/dh_import.obj src/pk/dh/dh_import_radix.obj src/pk/dh/dh_make_key.obj \ +src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj src/pk/dsa/dsa_encrypt_key.obj \ +src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj src/pk/dsa/dsa_import_radix.obj \ +src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \ +src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ diff --git a/makefile.unix b/makefile.unix index 73b4bf361..710097462 100644 --- a/makefile.unix +++ b/makefile.unix @@ -170,10 +170,12 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ +src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile_include.mk b/makefile_include.mk index c82095cb7..af3f9604e 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -276,10 +276,12 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_static.o src/pk/dh/dh_sys.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ +src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ From f4ce5a21c83fbe96cc8b4e07955e4627c57b3d1f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 09:53:55 +0200 Subject: [PATCH 0894/1192] helper.pl - enable check_comments for --check-all --- helper.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper.pl b/helper.pl index b66dbce5f..ab41a51ce 100755 --- a/helper.pl +++ b/helper.pl @@ -366,7 +366,7 @@ sub die_usage { $failure ||= check_source() if $check_all || $check_source; $failure ||= check_defines() if $check_all || $check_defines; $failure ||= check_descriptors() if $check_all || $check_descriptors; -$failure ||= check_comments() if $check_comments; #XXX-FIXME not included in "--check-all" +$failure ||= check_comments() if $check_all || $check_comments; $failure ||= process_makefiles(0) if $check_all || $check_makefiles; $failure ||= process_makefiles(1) if $update_makefiles; From 5eaff56d906ee713dcd9f77547f3e9034b47a390 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 10:14:04 +0200 Subject: [PATCH 0895/1192] remove dh_export_radix.c dh_import_radix.c --- src/pk/dh/dh_export_radix.c | 68 ---------------------------- src/pk/dh/dh_import_radix.c | 90 ------------------------------------- 2 files changed, 158 deletions(-) delete mode 100644 src/pk/dh/dh_export_radix.c delete mode 100644 src/pk/dh/dh_import_radix.c diff --git a/src/pk/dh/dh_export_radix.c b/src/pk/dh/dh_export_radix.c deleted file mode 100644 index 301fd7f6e..000000000 --- a/src/pk/dh/dh_export_radix.c +++ /dev/null @@ -1,68 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ - -#include "tomcrypt.h" - -#ifdef LTC_MDH - -static unsigned long _count_digits(int radix, void *num) -{ - void *r, *t; - unsigned long digits = 0; - - if (mp_iszero(num) == LTC_MP_YES) return 1; - if (mp_init_multi(&t, &r, NULL) != CRYPT_OK) return 0; - mp_copy(num, t); - mp_set_int(r, radix); - while (mp_iszero(t) == LTC_MP_NO) { - if (mp_div(t, r, t, NULL) != CRYPT_OK) { - mp_clear_multi(t, r, NULL); - return 0; - } - digits++; - } - mp_clear_multi(t, r, NULL); - return digits; -} - -/** - Export a DH key to a binary packet - @param out [out] The destination for the key - @param outlen [in/out] The max size and resulting size of the DH key - @param type Which type of key (PK_PRIVATE or PK_PUBLIC) - @param key The key you wish to export - @return CRYPT_OK if successful -*/ -int dh_export_radix(int radix, void *out, unsigned long *outlen, int type, dh_key *key) -{ - unsigned long len; - void *k; - - LTC_ARGCHK(out != NULL); - LTC_ARGCHK(outlen != NULL); - LTC_ARGCHK(key != NULL); - LTC_ARGCHK((radix >= 2 && radix <= 64) || radix == 256); - - k = (type == PK_PRIVATE) ? key->x : key->y; - len = (radix == 256) ? mp_unsigned_bin_size(k) : _count_digits(radix, k) + 1; - - if (*outlen < len) { - *outlen = len; - return CRYPT_BUFFER_OVERFLOW; - } - *outlen = len; - - return (radix == 256) ? mp_to_unsigned_bin(k, out) : mp_toradix(k, out, radix); -} - -#endif /* LTC_MDH */ - -/* ref: $Format:%D$ */ -/* git commit: $Format:%H$ */ -/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_import_radix.c b/src/pk/dh/dh_import_radix.c deleted file mode 100644 index cbd6c418b..000000000 --- a/src/pk/dh/dh_import_radix.c +++ /dev/null @@ -1,90 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ - -#include "tomcrypt.h" - -#ifdef LTC_MDH - -/** - Import a DH key from a binary string - @param in The string to read - @param inlen The length of the input packet - @param type The type of key (PK_PRIVATE or PK_PUBLIC) - @param base The base (generator) in hex string - @param prime The prime in hex string - @param key [out] Where to import the key to - @return CRYPT_OK if successful, on error all allocated memory is freed automatically -*/ -int dh_import_radix(int radix, - void *in, unsigned long inlen, - void *prime, unsigned long primelen, - void *base, unsigned long baselen, - int type, dh_key *key) -{ - int err; - - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(base != NULL); - LTC_ARGCHK(prime != NULL); - LTC_ARGCHK(key != NULL); - - if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { - goto error; - } - if (radix == 256) { - if ((err = mp_read_unsigned_bin(key->base, base, baselen)) != CRYPT_OK) { goto error; } - if ((err = mp_read_unsigned_bin(key->prime, prime, primelen)) != CRYPT_OK) { goto error; } - } - else { - if ((err = mp_read_radix(key->base, base, radix)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(key->prime, prime, radix)) != CRYPT_OK) { goto error; } - } - - if (type == PK_PRIVATE) { - /* load the x value */ - if (radix == 256) { - if ((err = mp_read_unsigned_bin(key->x, in, inlen)) != CRYPT_OK) { goto error; } - } - else { - if ((err = mp_read_radix(key->x, in, radix)) != CRYPT_OK) { goto error; } - } - /* compute y value */ - if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { goto error; } - key->type = PK_PRIVATE; - } - else { - /* load the y value */ - if (radix == 256) { - if ((err = mp_read_unsigned_bin(key->y, in, inlen)) != CRYPT_OK) { goto error; } - } - else { - if ((err = mp_read_radix(key->y, in, radix)) != CRYPT_OK) { goto error; } - } - key->type = PK_PUBLIC; - mp_clear(key->x); - key->x = NULL; - } - - /* check public key */ - if ((err = dh_check_pubkey(key)) != CRYPT_OK) { - goto error; - } - - return CRYPT_OK; - -error: - mp_clear_multi(key->prime, key->base, key->y, key->x, NULL); - return err; -} - -#endif /* LTC_MDH */ - -/* ref: $Format:%D$ */ -/* git commit: $Format:%H$ */ -/* commit time: $Format:%ai$ */ From a0257df99991006e38fe34ae46024365cdf73b9a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 10:14:19 +0200 Subject: [PATCH 0896/1192] update makefiles --- libtomcrypt_VS2008.vcproj | 8 -------- makefile.mingw | 11 +++++------ makefile.msvc | 11 +++++------ makefile.unix | 11 +++++------ makefile_include.mk | 11 +++++------ 5 files changed, 20 insertions(+), 32 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index a400ac22d..25162404b 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2058,10 +2058,6 @@ RelativePath="src\pk\dh\dh_export.c" > - - @@ -2070,10 +2066,6 @@ RelativePath="src\pk\dh\dh_import.c" > - - diff --git a/makefile.mingw b/makefile.mingw index 445ce4aea..04ad30b9f 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -160,12 +160,11 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ -src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ -src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_free.o \ +src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile.msvc b/makefile.msvc index 1adb79403..804c85811 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -153,12 +153,11 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.obj \ src/pk/asn1/der/utctime/der_decode_utctime.obj src/pk/asn1/der/utctime/der_encode_utctime.obj \ src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_utf8_string.obj \ src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \ -src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_export_radix.obj \ -src/pk/dh/dh_free.obj src/pk/dh/dh_import.obj src/pk/dh/dh_import_radix.obj src/pk/dh/dh_make_key.obj \ -src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj src/pk/dsa/dsa_encrypt_key.obj \ -src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj src/pk/dsa/dsa_import_radix.obj \ -src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \ -src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ +src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_free.obj \ +src/pk/dh/dh_import.obj src/pk/dh/dh_make_key.obj src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj \ +src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \ +src/pk/dsa/dsa_import_radix.obj src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj \ +src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ diff --git a/makefile.unix b/makefile.unix index 710097462..88f88a002 100644 --- a/makefile.unix +++ b/makefile.unix @@ -170,12 +170,11 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ -src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ -src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_free.o \ +src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile_include.mk b/makefile_include.mk index af3f9604e..daf765714 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -276,12 +276,11 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ -src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ -src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_free.o \ +src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ From cba1569c8209aed2ba85841984b538e5ba599bba Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 10:18:48 +0200 Subject: [PATCH 0897/1192] fix tomcrypt_pk.h --- src/headers/tomcrypt_pk.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 7dc30dcab..1ff657d35 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -205,25 +205,12 @@ typedef struct { int dh_get_groupsize(dh_key *key); int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key); -int dh_make_key_ex(prng_state *prng, int wprng, int radix, - void *prime, unsigned long primelen, - void *base, unsigned long baselen, - dh_key *key); int dh_make_key_dhparam(prng_state *prng, int wprng, unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); void dh_free(dh_key *key); int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key); int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); -int dh_export_radix(int radix, - void *out, unsigned long *outlen, - int type, dh_key *key); -int dh_import_radix(int radix, - void *in, unsigned long inlen, - void *prime, unsigned long primelen, - void *base, unsigned long baselen, - int type, dh_key *key); - int dh_shared_secret(dh_key *private_key, dh_key *public_key, unsigned char *out, unsigned long *outlen); From 243a1dc33e8aa3eb5e9eccbaa70a8b14b59fc8d4 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 12:20:34 +0200 Subject: [PATCH 0898/1192] drop _dh_make_key_ex --- src/pk/dh/dh_make_key.c | 52 ++++++++--------------------------------- 1 file changed, 10 insertions(+), 42 deletions(-) diff --git a/src/pk/dh/dh_make_key.c b/src/pk/dh/dh_make_key.c index ddb34be7f..cbaea88bd 100644 --- a/src/pk/dh/dh_make_key.c +++ b/src/pk/dh/dh_make_key.c @@ -106,43 +106,6 @@ static int _dh_make_key(prng_state *prng, int wprng, void *prime, void *base, dh return err; } -/** - Make a DH key (custom DH group) [private key pair] - @param prng An active PRNG state - @param wprng The index for the PRNG you desire to use - @param prime_hex The prime p (hexadecimal string) - @param base_hex The base g (hexadecimal string) - @param key [out] Where the newly created DH key will be stored - @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. -*/ -static int _dh_make_key_ex(prng_state *prng, int wprng, int radix, - void *prime, unsigned long primelen, - void *base, unsigned long baselen, - dh_key *key) -{ - void *p, *b; - int err; - - LTC_ARGCHK(prime != NULL); - LTC_ARGCHK(base != NULL); - LTC_ARGCHK((radix >= 2 && radix <= 64) || radix == 256); - - if ((err = mp_init_multi(&p, &b, NULL)) != CRYPT_OK) { return err; } - if (radix == 256) { - if ((err = mp_read_unsigned_bin(b, base, baselen)) != CRYPT_OK) { goto error; } - if ((err = mp_read_unsigned_bin(p, prime, primelen)) != CRYPT_OK) { goto error; } - } - else { - if ((err = mp_read_radix(b, base, radix)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p, prime, radix)) != CRYPT_OK) { goto error; } - } - err = _dh_make_key(prng, wprng, p, b, key); - -error: - mp_clear_multi(p, b, NULL); - return err; -} - /** Make a DH key (use built-in DH groups) [private key pair] @param prng An active PRNG state @@ -153,17 +116,22 @@ static int _dh_make_key_ex(prng_state *prng, int wprng, int radix, */ int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) { - int i; + void *p, *b; + int i, err; LTC_ARGCHK(groupsize > 0); for (i = 0; (groupsize > ltc_dh_sets[i].size) && (ltc_dh_sets[i].size != 0); i++); if (ltc_dh_sets[i].size == 0) return CRYPT_INVALID_KEYSIZE; - return _dh_make_key_ex(prng, wprng, 16, - ltc_dh_sets[i].prime, strlen(ltc_dh_sets[i].prime) + 1, - ltc_dh_sets[i].base, strlen(ltc_dh_sets[i].base) + 1, - key); + if ((err = mp_init_multi(&p, &b, NULL)) != CRYPT_OK) { return err; } + if ((err = mp_read_radix(b, ltc_dh_sets[i].base, 16)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, ltc_dh_sets[i].prime, 16)) != CRYPT_OK) { goto error; } + err = _dh_make_key(prng, wprng, p, b, key); + +error: + mp_clear_multi(p, b, NULL); + return err; } /** From 36132b016fcd567714799badb18d6d164a8e5479 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 12:03:11 +0200 Subject: [PATCH 0899/1192] update title page of pdf doc --- doc/crypt.tex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 24324768b..a10042a2b 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -83,7 +83,6 @@ \begin{tabular}{c} -Tom St Denis \\ LibTom Projects \end{tabular} \end{center} @@ -98,6 +97,12 @@ ~ \begin{flushright} +LibTom Projects +~ + +\& originally +~ + Tom St Denis ~ From b03b93099d0a8c09acfd14b250d9138e70a97a2b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 12:11:16 +0200 Subject: [PATCH 0900/1192] allow to give only a part as parameter to `./test` --- tests/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.c b/tests/test.c index f0d5c7c70..785617b25 100644 --- a/tests/test.c +++ b/tests/test.c @@ -351,7 +351,7 @@ int main(int argc, char **argv) dur = epoch_usec(); for (i = 0; i < sizeof(test_functions)/sizeof(test_functions[0]); ++i) { - if (single_test && strcmp(test_functions[i].name, single_test)) { + if (single_test && strstr(test_functions[i].name, single_test) == NULL) { continue; } dots = fn_len - strlen(test_functions[i].name); From 05e28d6cfa473e5c6e312ef8bfe6137bc8caa0da Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 15:55:35 +0200 Subject: [PATCH 0901/1192] fix potential timing attacks in rsa, eax, ocb and ocb3 --- src/encauth/eax/eax_decrypt_verify_memory.c | 2 +- src/encauth/ocb/ocb_done_decrypt.c | 2 +- src/encauth/ocb3/ocb3_decrypt_verify_memory.c | 2 +- src/pk/rsa/rsa_verify_hash.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/encauth/eax/eax_decrypt_verify_memory.c b/src/encauth/eax/eax_decrypt_verify_memory.c index b1a4d6e45..4de1a7fd0 100644 --- a/src/encauth/eax/eax_decrypt_verify_memory.c +++ b/src/encauth/eax/eax_decrypt_verify_memory.c @@ -82,7 +82,7 @@ int eax_decrypt_verify_memory(int cipher, } /* compare tags */ - if (buflen >= taglen && XMEMCMP(buf, tag, taglen) == 0) { + if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { *stat = 1; } diff --git a/src/encauth/ocb/ocb_done_decrypt.c b/src/encauth/ocb/ocb_done_decrypt.c index 18e3344dc..357bd847a 100644 --- a/src/encauth/ocb/ocb_done_decrypt.c +++ b/src/encauth/ocb/ocb_done_decrypt.c @@ -55,7 +55,7 @@ int ocb_done_decrypt(ocb_state *ocb, goto LBL_ERR; } - if (taglen <= tagbuflen && XMEMCMP(tagbuf, tag, taglen) == 0) { + if (taglen <= tagbuflen && XMEM_NEQ(tagbuf, tag, taglen) == 0) { *stat = 1; } diff --git a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c index 4ac2c4694..89a77422e 100644 --- a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c +++ b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c @@ -87,7 +87,7 @@ int ocb3_decrypt_verify_memory(int cipher, } /* compare tags */ - if (buflen >= taglen && XMEMCMP(buf, tag, taglen) == 0) { + if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { *stat = 1; } diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 48aa8d413..50431ef95 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -163,7 +163,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, } else { /* only check if the hash is equal */ if ((hashlen == outlen) && - (XMEMCMP(out, hash, hashlen) == 0)) { + (XMEM_NEQ(out, hash, hashlen) == 0)) { *stat = 1; } } From 27b3ffc62736113c65732e2729ecf6e512461f2a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 19:06:26 +0200 Subject: [PATCH 0902/1192] use compare_testvector() instead of XMEMCMP() in tests --- src/ciphers/aes/aes.c | 19 ++------------- src/ciphers/anubis.c | 5 ++-- src/ciphers/blowfish.c | 3 ++- src/ciphers/camellia.c | 18 ++------------- src/ciphers/cast5.c | 3 ++- src/ciphers/des.c | 4 ++-- src/ciphers/kasumi.c | 3 ++- src/ciphers/khazad.c | 5 ++-- src/ciphers/kseed.c | 18 ++------------- src/ciphers/multi2.c | 6 ++--- src/ciphers/noekeon.c | 19 ++------------- src/ciphers/rc5.c | 3 ++- src/ciphers/rc6.c | 20 ++-------------- src/ciphers/safer/safer.c | 9 +++++--- src/ciphers/safer/saferp.c | 3 ++- src/ciphers/skipjack.c | 3 ++- src/ciphers/twofish/twofish.c | 6 ++--- src/ciphers/xtea.c | 19 ++------------- src/encauth/eax/eax_test.c | 32 +++++-------------------- src/encauth/gcm/gcm_test.c | 36 ++++------------------------- src/encauth/ocb/ocb_test.c | 31 +++++-------------------- src/encauth/ocb3/ocb3_test.c | 31 +++++-------------------- src/mac/f9/f9_test.c | 2 +- src/mac/omac/omac_test.c | 7 +----- src/mac/pelican/pelican_test.c | 7 +----- src/mac/pmac/pmac_test.c | 11 +-------- src/mac/xcbc/xcbc_test.c | 2 +- src/misc/adler32.c | 8 +------ src/misc/crc32.c | 8 +------ src/misc/hkdf/hkdf_test.c | 20 ++-------------- src/modes/ctr/ctr_test.c | 2 +- src/modes/f8/f8_test_mode.c | 2 +- src/modes/lrw/lrw_test.c | 6 ++--- src/stream/rc4/rc4_test.c | 2 +- src/stream/sober128/sober128_test.c | 10 +------- 35 files changed, 81 insertions(+), 302 deletions(-) diff --git a/src/ciphers/aes/aes.c b/src/ciphers/aes/aes.c index dea13bb25..5c1dcd1f0 100644 --- a/src/ciphers/aes/aes.c +++ b/src/ciphers/aes/aes.c @@ -685,23 +685,8 @@ int ECB_TEST(void) rijndael_ecb_encrypt(tests[i].pt, tmp[0], &key); rijndael_ecb_decrypt(tmp[0], tmp[1], &key); - if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { -#if 0 - printf("\n\nTest %d failed\n", i); - if (XMEMCMP(tmp[0], tests[i].ct, 16)) { - printf("CT: "); - for (i = 0; i < 16; i++) { - printf("%02x ", tmp[0][i]); - } - printf("\n"); - } else { - printf("PT: "); - for (i = 0; i < 16; i++) { - printf("%02x ", tmp[1][i]); - } - printf("\n"); - } -#endif + if (compare_testvector(tmp[0], 16, tests[i].ct, 16, "AES Encrypt", i) || + compare_testvector(tmp[1], 16, tests[i].pt, 16, "AES Decrypt", i)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index 2a9b1c06d..a28c7e1b3 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -1498,13 +1498,14 @@ int anubis_test(void) anubis_setup(tests[x].key, tests[x].keylen, 0, &skey); anubis_ecb_encrypt(tests[x].pt, buf[0], &skey); anubis_ecb_decrypt(buf[0], buf[1], &skey); - if (XMEMCMP(buf[0], tests[x].ct, 16) || XMEMCMP(buf[1], tests[x].pt, 16)) { + if (compare_testvector(buf[0], 16, tests[x].ct, 16, "Anubis Encrypt", x) || + compare_testvector(buf[1], 16, tests[x].pt, 16, "Anubis Decrypt", x)) { return CRYPT_FAIL_TESTVECTOR; } for (y = 0; y < 1000; y++) anubis_ecb_encrypt(buf[0], buf[0], &skey); for (y = 0; y < 1000; y++) anubis_ecb_decrypt(buf[0], buf[0], &skey); - if (XMEMCMP(buf[0], tests[x].ct, 16)) { + if (compare_testvector(buf[0], 16, tests[x].ct, 16, "Anubis 1000", 1000)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/blowfish.c b/src/ciphers/blowfish.c index 994ab3603..a1945ae96 100644 --- a/src/ciphers/blowfish.c +++ b/src/ciphers/blowfish.c @@ -546,7 +546,8 @@ int blowfish_test(void) blowfish_ecb_decrypt(tmp[0], tmp[1], &key); /* compare */ - if ((XMEMCMP(tmp[0], tests[x].ct, 8) != 0) || (XMEMCMP(tmp[1], tests[x].pt, 8) != 0)) { + if ((compare_testvector(tmp[0], 8, tests[x].ct, 8, "Blowfish Encrypt", x) != 0) || + (compare_testvector(tmp[1], 8, tests[x].pt, 8, "Blowfish Decrypt", x) != 0)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/camellia.c b/src/ciphers/camellia.c index e159104f7..0a75087b4 100644 --- a/src/ciphers/camellia.c +++ b/src/ciphers/camellia.c @@ -697,22 +697,8 @@ int camellia_test(void) return err; } camellia_done(&skey); - if (XMEMCMP(tests[x].ct, buf[0], 16) || XMEMCMP(tests[x].pt, buf[1], 16)) { -#if 0 - int i, j; - printf ("\n\nLTC_CAMELLIA failed for x=%d, I got:\n", x); - for (i = 0; i < 2; i++) { - const unsigned char *expected, *actual; - expected = (i ? tests[x].pt : tests[x].ct); - actual = buf[i]; - printf ("expected actual (%s)\n", (i ? "plaintext" : "ciphertext")); - for (j = 0; j < 16; j++) { - const char *eq = (expected[j] == actual[j] ? "==" : "!="); - printf (" %02x %s %02x\n", expected[j], eq, actual[j]); - } - printf ("\n"); - } -#endif + if (compare_testvector(tests[x].ct, 16, buf[0], 16, "Camellia Encrypt", x) || + compare_testvector(tests[x].pt, 16, buf[1], 16, "Camellia Decrypt", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/ciphers/cast5.c b/src/ciphers/cast5.c index e0501d1c5..43ca58080 100644 --- a/src/ciphers/cast5.c +++ b/src/ciphers/cast5.c @@ -674,7 +674,8 @@ int cast5_test(void) } cast5_ecb_encrypt(tests[i].pt, tmp[0], &key); cast5_ecb_decrypt(tmp[0], tmp[1], &key); - if ((XMEMCMP(tmp[0], tests[i].ct, 8) != 0) || (XMEMCMP(tmp[1], tests[i].pt, 8) != 0)) { + if ((compare_testvector(tmp[0], 8, tests[i].ct, 8, "CAST5 Encrypt", i) != 0) || + (compare_testvector(tmp[1], 8, tests[i].pt, 8, "CAST5 Decrypt", i) != 0)) { return CRYPT_FAIL_TESTVECTOR; } /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ diff --git a/src/ciphers/des.c b/src/ciphers/des.c index 0993d6ba4..cbb20e345 100644 --- a/src/ciphers/des.c +++ b/src/ciphers/des.c @@ -1977,7 +1977,7 @@ int des_test(void) des_ecb_decrypt(cases[i].txt, tmp, &des); } - if (XMEMCMP(cases[i].out, tmp, sizeof(tmp)) != 0) { + if (compare_testvector(cases[i].out, sizeof(tmp), tmp, sizeof(tmp), "DES", i) != 0) { return CRYPT_FAIL_TESTVECTOR; } @@ -2020,7 +2020,7 @@ int des3_test(void) des3_ecb_encrypt(pt, ct, &skey); des3_ecb_decrypt(ct, tmp, &skey); - if (XMEMCMP(pt, tmp, 8) != 0) { + if (compare_testvector(pt, 8, tmp, 8, "3DES", 0) != 0) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/kasumi.c b/src/ciphers/kasumi.c index 432313bc5..7c2add524 100644 --- a/src/ciphers/kasumi.c +++ b/src/ciphers/kasumi.c @@ -302,7 +302,8 @@ int kasumi_test(void) if ((err = kasumi_ecb_decrypt(tests[x].ct, buf[1], &key)) != CRYPT_OK) { return err; } - if (XMEMCMP(tests[x].pt, buf[1], 8) || XMEMCMP(tests[x].ct, buf[0], 8)) { + if (compare_testvector(buf[1], 8, tests[x].pt, 8, "Kasumi Decrypt", x) || + compare_testvector(buf[0], 8, tests[x].ct, 8, "Kasumi Encrypt", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/ciphers/khazad.c b/src/ciphers/khazad.c index 960b73456..4d1f2cec9 100644 --- a/src/ciphers/khazad.c +++ b/src/ciphers/khazad.c @@ -808,13 +808,14 @@ int khazad_test(void) khazad_setup(tests[x].key, 16, 0, &skey); khazad_ecb_encrypt(tests[x].pt, buf[0], &skey); khazad_ecb_decrypt(buf[0], buf[1], &skey); - if (XMEMCMP(buf[0], tests[x].ct, 8) || XMEMCMP(buf[1], tests[x].pt, 8)) { + if (compare_testvector(buf[0], 8, tests[x].ct, 8, "Khazad Encrypt", x) || + compare_testvector(buf[1], 8, tests[x].pt, 8, "Khazad Decrypt", x)) { return CRYPT_FAIL_TESTVECTOR; } for (y = 0; y < 1000; y++) khazad_ecb_encrypt(buf[0], buf[0], &skey); for (y = 0; y < 1000; y++) khazad_ecb_decrypt(buf[0], buf[0], &skey); - if (XMEMCMP(buf[0], tests[x].ct, 8)) { + if (compare_testvector(buf[0], 8, tests[x].ct, 8, "Khazad 1000", 1000)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/kseed.c b/src/ciphers/kseed.c index f1c15dd9c..e12fdc7f5 100644 --- a/src/ciphers/kseed.c +++ b/src/ciphers/kseed.c @@ -344,22 +344,8 @@ int kseed_test(void) kseed_setup(tests[x].key, 16, 0, &skey); kseed_ecb_encrypt(tests[x].pt, buf[0], &skey); kseed_ecb_decrypt(buf[0], buf[1], &skey); - if (XMEMCMP(buf[0], tests[x].ct, 16) || XMEMCMP(buf[1], tests[x].pt, 16)) { -#if 0 - int i, j; - printf ("\n\nLTC_KSEED failed for x=%d, I got:\n", x); - for (i = 0; i < 2; i++) { - const unsigned char *expected, *actual; - expected = (i ? tests[x].pt : tests[x].ct); - actual = buf[i]; - printf ("expected actual (%s)\n", (i ? "plaintext" : "ciphertext")); - for (j = 0; j < 16; j++) { - const char *eq = (expected[j] == actual[j] ? "==" : "!="); - printf (" %02x %s %02x\n", expected[j], eq, actual[j]); - } - printf ("\n"); - } -#endif + if (compare_testvector(buf[0], 16, tests[x].ct, 16, "KSEED Encrypt", x) || + compare_testvector(buf[1], 16, tests[x].pt, 16, "KSEED Decrypt", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/ciphers/multi2.c b/src/ciphers/multi2.c index 2378e2dd0..86c181204 100644 --- a/src/ciphers/multi2.c +++ b/src/ciphers/multi2.c @@ -256,14 +256,14 @@ int multi2_test(void) return err; } - if (XMEMCMP(buf, tests[x].ct, 8)) { + if (compare_testvector(buf, 8, tests[x].ct, 8, "Multi2 Encrypt", x)) { return CRYPT_FAIL_TESTVECTOR; } if ((err = multi2_ecb_decrypt(buf, buf, &skey)) != CRYPT_OK) { return err; } - if (XMEMCMP(buf, tests[x].pt, 8)) { + if (compare_testvector(buf, 8, tests[x].pt, 8, "Multi2 Decrypt", x)) { return CRYPT_FAIL_TESTVECTOR; } } @@ -280,7 +280,7 @@ int multi2_test(void) if ((err = multi2_ecb_decrypt(ct, buf, &skey)) != CRYPT_OK) { return err; } - if (XMEMCMP(buf, tests[0].pt, 8)) { + if (compare_testvector(buf, 8, tests[0].pt, 8, "Multi2 Rounds", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/ciphers/noekeon.c b/src/ciphers/noekeon.c index 21e645c8e..13720d118 100644 --- a/src/ciphers/noekeon.c +++ b/src/ciphers/noekeon.c @@ -281,23 +281,8 @@ int noekeon_test(void) noekeon_ecb_encrypt(tests[i].pt, tmp[0], &key); noekeon_ecb_decrypt(tmp[0], tmp[1], &key); - if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { -#if 0 - printf("\n\nTest %d failed\n", i); - if (XMEMCMP(tmp[0], tests[i].ct, 16)) { - printf("CT: "); - for (i = 0; i < 16; i++) { - printf("%02x ", tmp[0][i]); - } - printf("\n"); - } else { - printf("PT: "); - for (i = 0; i < 16; i++) { - printf("%02x ", tmp[1][i]); - } - printf("\n"); - } -#endif + if (compare_testvector(tmp[0], 16, tests[i].ct, 16, "Noekeon Encrypt", i) || + compare_testvector(tmp[1], 16, tests[i].pt, 16, "Noekeon Decrypt", i)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/rc5.c b/src/ciphers/rc5.c index e3e2ad6e8..bda537f15 100644 --- a/src/ciphers/rc5.c +++ b/src/ciphers/rc5.c @@ -273,7 +273,8 @@ int rc5_test(void) rc5_ecb_decrypt(tmp[0], tmp[1], &key); /* compare */ - if (XMEMCMP(tmp[0], tests[x].ct, 8) != 0 || XMEMCMP(tmp[1], tests[x].pt, 8) != 0) { + if (compare_testvector(tmp[0], 8, tests[x].ct, 8, "RC5 Encrypt", x) != 0 || + compare_testvector(tmp[1], 8, tests[x].pt, 8, "RC5 Decrypt", x) != 0) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/rc6.c b/src/ciphers/rc6.c index cd192d457..56ca705b6 100644 --- a/src/ciphers/rc6.c +++ b/src/ciphers/rc6.c @@ -283,24 +283,8 @@ int rc6_test(void) rc6_ecb_decrypt(tmp[0], tmp[1], &key); /* compare */ - if (XMEMCMP(tmp[0], tests[x].ct, 16) || XMEMCMP(tmp[1], tests[x].pt, 16)) { -#if 0 - printf("\n\nFailed test %d\n", x); - if (XMEMCMP(tmp[0], tests[x].ct, 16)) { - printf("Ciphertext: "); - for (y = 0; y < 16; y++) printf("%02x ", tmp[0][y]); - printf("\nExpected : "); - for (y = 0; y < 16; y++) printf("%02x ", tests[x].ct[y]); - printf("\n"); - } - if (XMEMCMP(tmp[1], tests[x].pt, 16)) { - printf("Plaintext: "); - for (y = 0; y < 16; y++) printf("%02x ", tmp[0][y]); - printf("\nExpected : "); - for (y = 0; y < 16; y++) printf("%02x ", tests[x].pt[y]); - printf("\n"); - } -#endif + if (compare_testvector(tmp[0], 16, tests[x].ct, 16, "RC6 Encrypt", x) || + compare_testvector(tmp[1], 16, tests[x].pt, 16, "RC6 Decrypt", x)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/safer/safer.c b/src/ciphers/safer/safer.c index af1a8a279..9eefcfb9e 100644 --- a/src/ciphers/safer/safer.c +++ b/src/ciphers/safer/safer.c @@ -395,7 +395,8 @@ int safer_k64_test(void) safer_ecb_encrypt(k64_pt, buf[0], &skey); safer_ecb_decrypt(buf[0], buf[1], &skey); - if (XMEMCMP(buf[0], k64_ct, 8) != 0 || XMEMCMP(buf[1], k64_pt, 8) != 0) { + if (compare_testvector(buf[0], 8, k64_ct, 8, "Safer K64 Encrypt", 0) != 0 || + compare_testvector(buf[1], 8, k64_pt, 8, "Safer K64 Decrypt", 0) != 0) { return CRYPT_FAIL_TESTVECTOR; } @@ -425,7 +426,8 @@ int safer_sk64_test(void) safer_ecb_encrypt(sk64_pt, buf[0], &skey); safer_ecb_decrypt(buf[0], buf[1], &skey); - if (XMEMCMP(buf[0], sk64_ct, 8) != 0 || XMEMCMP(buf[1], sk64_pt, 8) != 0) { + if (compare_testvector(buf[0], 8, sk64_ct, 8, "Safer SK64 Encrypt", 0) != 0 || + compare_testvector(buf[1], 8, sk64_pt, 8, "Safer SK64 Decrypt", 0) != 0) { return CRYPT_FAIL_TESTVECTOR; } @@ -468,7 +470,8 @@ int safer_sk128_test(void) safer_ecb_encrypt(sk128_pt, buf[0], &skey); safer_ecb_decrypt(buf[0], buf[1], &skey); - if (XMEMCMP(buf[0], sk128_ct, 8) != 0 || XMEMCMP(buf[1], sk128_pt, 8) != 0) { + if (compare_testvector(buf[0], 8, sk128_ct, 8, "Safer SK128 Encrypt", 0) != 0 || + compare_testvector(buf[1], 8, sk128_pt, 8, "Safer SK128 Decrypt", 0) != 0) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/safer/saferp.c b/src/ciphers/safer/saferp.c index fab351807..116590ff6 100644 --- a/src/ciphers/safer/saferp.c +++ b/src/ciphers/safer/saferp.c @@ -514,7 +514,8 @@ int saferp_test(void) saferp_ecb_decrypt(tmp[0], tmp[1], &skey); /* compare */ - if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { + if (compare_testvector(tmp[0], 16, tests[i].ct, 16, "Safer+ Encrypt", i) || + compare_testvector(tmp[1], 16, tests[i].pt, 16, "Safer+ Decrypt", i)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/skipjack.c b/src/ciphers/skipjack.c index 0d28ec14c..d47f2d304 100644 --- a/src/ciphers/skipjack.c +++ b/src/ciphers/skipjack.c @@ -296,7 +296,8 @@ int skipjack_test(void) skipjack_ecb_decrypt(buf[0], buf[1], &key); /* compare */ - if (XMEMCMP(buf[0], tests[x].ct, 8) != 0 || XMEMCMP(buf[1], tests[x].pt, 8) != 0) { + if (compare_testvector(buf[0], 8, tests[x].ct, 8, "Skipjack Encrypt", x) != 0 || + compare_testvector(buf[1], 8, tests[x].pt, 8, "Skipjack Decrypt", x) != 0) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index a8a116718..b1584d195 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -657,10 +657,8 @@ int twofish_test(void) } twofish_ecb_encrypt(tests[i].pt, tmp[0], &key); twofish_ecb_decrypt(tmp[0], tmp[1], &key); - if (XMEMCMP(tmp[0], tests[i].ct, 16) != 0 || XMEMCMP(tmp[1], tests[i].pt, 16) != 0) { -#if 0 - printf("Twofish failed test %d, %d, %d\n", i, XMEMCMP(tmp[0], tests[i].ct, 16), XMEMCMP(tmp[1], tests[i].pt, 16)); -#endif + if (compare_testvector(tmp[0], 16, tests[i].ct, 16, "Twofish Encrypt", i) != 0 || + compare_testvector(tmp[1], 16, tests[i].pt, 16, "Twofish Decrypt", i) != 0) { return CRYPT_FAIL_TESTVECTOR; } /* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */ diff --git a/src/ciphers/xtea.c b/src/ciphers/xtea.c index 77a9346d1..fe26f9803 100644 --- a/src/ciphers/xtea.c +++ b/src/ciphers/xtea.c @@ -211,23 +211,8 @@ int xtea_test(void) xtea_ecb_encrypt(tests[i].pt, tmp[0], &skey); xtea_ecb_decrypt(tmp[0], tmp[1], &skey); - if (XMEMCMP(tmp[0], tests[i].ct, 8) != 0 || XMEMCMP(tmp[1], tests[i].pt, 8) != 0) { -#if 0 - printf("\n\nTest %d failed\n", i); - if (XMEMCMP(tmp[0], tests[i].ct, 8)) { - printf("CT: "); - for (i = 0; i < 8; i++) { - printf("%02x ", tmp[0][i]); - } - printf("\n"); - } else { - printf("PT: "); - for (i = 0; i < 8; i++) { - printf("%02x ", tmp[1][i]); - } - printf("\n"); - } -#endif + if (compare_testvector(tmp[0], 8, tests[i].ct, 8, "XTEA Encrypt", i) != 0 || + compare_testvector(tmp[1], 8, tests[i].pt, 8, "XTEA Decrypt", i) != 0) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/encauth/eax/eax_test.c b/src/encauth/eax/eax_test.c index 8c57c97c9..d3f553361 100644 --- a/src/encauth/eax/eax_test.c +++ b/src/encauth/eax/eax_test.c @@ -229,22 +229,8 @@ int eax_test(void) tests[x].plaintext, tests[x].msglen, outct, outtag, &len)) != CRYPT_OK) { return err; } - if (XMEMCMP(outct, tests[x].ciphertext, tests[x].msglen) || XMEMCMP(outtag, tests[x].tag, len)) { -#if 0 - unsigned long y; - printf("\n\nFailure: \nCT:\n"); - for (y = 0; y < (unsigned long)tests[x].msglen; ) { - printf("0x%02x", outct[y]); - if (y < (unsigned long)(tests[x].msglen-1)) printf(", "); - if (!(++y % 8)) printf("\n"); - } - printf("\nTAG:\n"); - for (y = 0; y < len; ) { - printf("0x%02x", outtag[y]); - if (y < len-1) printf(", "); - if (!(++y % 8)) printf("\n"); - } -#endif + if (compare_testvector(outtag, len, tests[x].tag, len, "EAX Tag", x) || + compare_testvector(outct, tests[x].msglen, tests[x].ciphertext, tests[x].msglen, "EAX CT", x)) { return CRYPT_FAIL_TESTVECTOR; } @@ -254,16 +240,10 @@ int eax_test(void) outct, tests[x].msglen, outct, outtag, len, &res)) != CRYPT_OK) { return err; } - if ((res != 1) || XMEMCMP(outct, tests[x].plaintext, tests[x].msglen)) { -#if 0 - unsigned long y; - printf("\n\nFailure (res == %d): \nPT:\n", res); - for (y = 0; y < (unsigned long)tests[x].msglen; ) { - printf("0x%02x", outct[y]); - if (y < (unsigned long)(tests[x].msglen-1)) printf(", "); - if (!(++y % 8)) printf("\n"); - } - printf("\n\n"); + if ((res != 1) || compare_testvector(outct, tests[x].msglen, tests[x].plaintext, tests[x].msglen, "EAX", x)) { +#ifdef LTC_TEST_DBG + printf("\n\nEAX: Failure-decrypt\n"); + printf("\nres = %d\n\n", res); #endif return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/encauth/gcm/gcm_test.c b/src/encauth/gcm/gcm_test.c index d7fc00a69..e09e50c88 100644 --- a/src/encauth/gcm/gcm_test.c +++ b/src/encauth/gcm/gcm_test.c @@ -345,25 +345,11 @@ int gcm_test(void) return err; } - if (XMEMCMP(out[0], tests[x].C, tests[x].ptlen)) { -#if 0 - printf("\nCiphertext wrong %lu\n", x); - for (y = 0; y < tests[x].ptlen; y++) { - printf("%02x", out[0][y] & 255); - } - printf("\n"); -#endif + if (compare_testvector(out[0], tests[x].ptlen, tests[x].C, tests[x].ptlen, "GCM CT", x)) { return CRYPT_FAIL_TESTVECTOR; } - if (XMEMCMP(T[0], tests[x].T, 16)) { -#if 0 - printf("\nTag on plaintext wrong %lu\n", x); - for (y = 0; y < 16; y++) { - printf("%02x", T[0][y] & 255); - } - printf("\n"); -#endif + if (compare_testvector(T[0], y, tests[x].T, 16, "GCM Encrypt Tag", x)) { return CRYPT_FAIL_TESTVECTOR; } @@ -376,25 +362,11 @@ int gcm_test(void) return err; } - if (XMEMCMP(out[1], tests[x].P, tests[x].ptlen)) { -#if 0 - printf("\nplaintext wrong %lu\n", x); - for (y = 0; y < tests[x].ptlen; y++) { - printf("%02x", out[0][y] & 255); - } - printf("\n"); -#endif + if (compare_testvector(out[1], tests[x].ptlen, tests[x].P, tests[x].ptlen, "GCM PT", x)) { return CRYPT_FAIL_TESTVECTOR; } - if (XMEMCMP(T[1], tests[x].T, 16)) { -#if 0 - printf("\nTag on ciphertext wrong %lu\n", x); - for (y = 0; y < 16; y++) { - printf("%02x", T[1][y] & 255); - } - printf("\n"); -#endif + if (compare_testvector(T[1], y, tests[x].T, 16, "GCM Decrypt Tag", x)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/encauth/ocb/ocb_test.c b/src/encauth/ocb/ocb_test.c index aba4cf481..d39dbb973 100644 --- a/src/encauth/ocb/ocb_test.c +++ b/src/encauth/ocb/ocb_test.c @@ -180,22 +180,8 @@ int ocb_test(void) return err; } - if (XMEMCMP(outtag, tests[x].tag, len) || XMEMCMP(outct, tests[x].ct, tests[x].ptlen)) { -#if 0 - unsigned long y; - printf("\n\nFailure: \nCT:\n"); - for (y = 0; y < (unsigned long)tests[x].ptlen; ) { - printf("0x%02x", outct[y]); - if (y < (unsigned long)(tests[x].ptlen-1)) printf(", "); - if (!(++y % 8)) printf("\n"); - } - printf("\nTAG:\n"); - for (y = 0; y < len; ) { - printf("0x%02x", outtag[y]); - if (y < len-1) printf(", "); - if (!(++y % 8)) printf("\n"); - } -#endif + if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "OCB Tag", x) || + compare_testvector(outct, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "OCB CT", x)) { return CRYPT_FAIL_TESTVECTOR; } @@ -203,17 +189,12 @@ int ocb_test(void) outct, tests[x].tag, len, &res)) != CRYPT_OK) { return err; } - if ((res != 1) || XMEMCMP(tests[x].pt, outct, tests[x].ptlen)) { -#if 0 - unsigned long y; - printf("\n\nFailure-decrypt: \nPT:\n"); - for (y = 0; y < (unsigned long)tests[x].ptlen; ) { - printf("0x%02x", outct[y]); - if (y < (unsigned long)(tests[x].ptlen-1)) printf(", "); - if (!(++y % 8)) printf("\n"); - } + if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB", x)) { +#ifdef LTC_TEST_DBG + printf("\n\nOCB: Failure-decrypt\n"); printf("\nres = %d\n\n", res); #endif + return CRYPT_FAIL_TESTVECTOR; } } return CRYPT_OK; diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index 4cd16e8c3..d6b9d6feb 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -186,22 +186,8 @@ int ocb3_test(void) return err; } - if (XMEMCMP(outtag, tests[x].tag, len) || XMEMCMP(outct, tests[x].ct, tests[x].ptlen)) { -#if 0 - unsigned long y; - printf("\n\nFailure: \nCT:\n"); - for (y = 0; y < (unsigned long)tests[x].ptlen; ) { - printf("0x%02x", outct[y]); - if (y < (unsigned long)(tests[x].ptlen-1)) printf(", "); - if (!(++y % 8)) printf("\n"); - } - printf("\nTAG:\n"); - for (y = 0; y < len; ) { - printf("0x%02x", outtag[y]); - if (y < len-1) printf(", "); - if (!(++y % 8)) printf("\n"); - } -#endif + if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "OCB3 Tag", x) || + compare_testvector(outct, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "OCB3 CT", x)) { return CRYPT_FAIL_TESTVECTOR; } @@ -213,17 +199,12 @@ int ocb3_test(void) outct, tests[x].tag, len, &res)) != CRYPT_OK) { return err; } - if ((res != 1) || XMEMCMP(tests[x].pt, outct, tests[x].ptlen)) { -#if 0 - unsigned long y; - printf("\n\nFailure-decrypt: \nPT:\n"); - for (y = 0; y < (unsigned long)tests[x].ptlen; ) { - printf("0x%02x", outct[y]); - if (y < (unsigned long)(tests[x].ptlen-1)) printf(", "); - if (!(++y % 8)) printf("\n"); - } + if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB3", x)) { +#ifdef LTC_TEST_DBG + printf("\n\nOCB3: Failure-decrypt\n"); printf("\nres = %d\n\n", res); #endif + return CRYPT_FAIL_TESTVECTOR; } } return CRYPT_OK; diff --git a/src/mac/f9/f9_test.c b/src/mac/f9/f9_test.c index 75f5ba7a7..ca23acc58 100644 --- a/src/mac/f9/f9_test.c +++ b/src/mac/f9/f9_test.c @@ -59,7 +59,7 @@ int f9_test(void) if ((err = f9_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK) { return err; } - if (taglen != 4 || XMEMCMP(T, tests[x].T, 4)) { + if (compare_testvector(T, taglen, tests[x].T, 4, "F9", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/mac/omac/omac_test.c b/src/mac/omac/omac_test.c index 10fb92ed9..9bf392c79 100644 --- a/src/mac/omac/omac_test.c +++ b/src/mac/omac/omac_test.c @@ -88,12 +88,7 @@ int omac_test(void) return err; } - if (XMEMCMP(out, tests[x].tag, 16) != 0) { -#if 0 - int y; - printf("\n\nTag: "); - for (y = 0; y < 16; y++) printf("%02x", out[y]); printf("\n\n"); -#endif + if (compare_testvector(out, len, tests[x].tag, sizeof(tests[x].tag), "OMAC", x) != 0) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/mac/pelican/pelican_test.c b/src/mac/pelican/pelican_test.c index 5fe28f90b..32a7df3a7 100644 --- a/src/mac/pelican/pelican_test.c +++ b/src/mac/pelican/pelican_test.c @@ -97,12 +97,7 @@ int pelican_test(void) return err; } - if (XMEMCMP(out, tests[x].T, 16)) { -#if 0 - int y; - printf("\nFailed test %d\n", x); - printf("{ "); for (y = 0; y < 16; ) { printf("0x%02x, ", out[y]); if (!(++y & 7)) printf("\n"); } printf(" }\n"); -#endif + if (compare_testvector(out, 16, tests[x].T, 16, "PELICAN", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/mac/pmac/pmac_test.c b/src/mac/pmac/pmac_test.c index a96f106f6..19329c67c 100644 --- a/src/mac/pmac/pmac_test.c +++ b/src/mac/pmac/pmac_test.c @@ -136,16 +136,7 @@ int pmac_test(void) return err; } - if (XMEMCMP(outtag, tests[x].tag, len)) { -#if 0 - unsigned long y; - printf("\nTAG:\n"); - for (y = 0; y < len; ) { - printf("0x%02x", outtag[y]); - if (y < len-1) printf(", "); - if (!(++y % 8)) printf("\n"); - } -#endif + if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "PMAC", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/mac/xcbc/xcbc_test.c b/src/mac/xcbc/xcbc_test.c index e237a4534..6a0ecdf0d 100644 --- a/src/mac/xcbc/xcbc_test.c +++ b/src/mac/xcbc/xcbc_test.c @@ -109,7 +109,7 @@ int xcbc_test(void) if ((err = xcbc_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK) { return err; } - if (taglen != 16 || XMEMCMP(T, tests[x].T, 16)) { + if (compare_testvector(T, taglen, tests[x].T, 16, "XCBC", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/misc/adler32.c b/src/misc/adler32.c index 7e312bbac..8bbf2accd 100644 --- a/src/misc/adler32.c +++ b/src/misc/adler32.c @@ -118,13 +118,7 @@ int adler32_test(void) adler32_init(&ctx); adler32_update(&ctx, in, strlen(in)); adler32_finish(&ctx, out, 4); - if (XMEMCMP(adler32, out, 4)) { -#ifdef LTC_TEST_DBG - ulong32 _out, _adler32; - LOAD32H(_out, out); - LOAD32H(_adler32, adler32); - printf("adler32 fail! Is: 0x%x Should: 0x%x\n", _out, _adler32); -#endif + if (compare_testvector(adler32, 4, out, 4, "adler32", 0)) { return CRYPT_FAIL_TESTVECTOR; } return CRYPT_OK; diff --git a/src/misc/crc32.c b/src/misc/crc32.c index 1f78abbda..beb54fcbf 100644 --- a/src/misc/crc32.c +++ b/src/misc/crc32.c @@ -189,13 +189,7 @@ int crc32_test(void) crc32_init(&ctx); crc32_update(&ctx, in, strlen(in)); crc32_finish(&ctx, out, 4); - if (XMEMCMP(crc32, out, 4)) { -#ifdef LTC_TEST_DBG - ulong32 _out, _crc32; - LOAD32H(_out, out); - LOAD32H(_crc32, crc32); - printf("crc32 fail! Is: 0x%x Should: 0x%x\n", _out, _crc32); -#endif + if (compare_testvector(crc32, 4, out, 4, "CRC32", 0)) { return CRYPT_FAIL_TESTVECTOR; } return CRYPT_OK; diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index ca04ebbeb..587932387 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -265,33 +265,17 @@ int hkdf_test(void) cases[i].info, cases[i].info_l, cases[i].IKM, cases[i].IKM_l, OKM, cases[i].OKM_l)) != CRYPT_OK) { -#ifdef LTC_TEST_DBG +#if LTC_TEST_DBG > 1 printf("LTC_HKDF-%s test #%d, %s\n", cases[i].Hash, i, error_to_string(err)); #endif return err; } - if(XMEMCMP(OKM, cases[i].OKM, (size_t)cases[i].OKM_l) != 0) { + if(compare_testvector(OKM, cases[i].OKM_l, cases[i].OKM, (size_t)cases[i].OKM_l, "HKDF", cases[i].num)) { failed++; -#ifdef LTC_TEST_DBG - { - unsigned int j; - printf("\nLTC_HKDF-%s test #%d:\n", cases[i].Hash, cases[i].num); - printf( "Result: 0x"); - for(j=0; j < cases[i].OKM_l; j++) { - printf("%02x ", OKM[j]); - } - printf("\nCorrect: 0x"); - for(j=0; j < cases[i].OKM_l; j++) { - printf("%02x ", cases[i].OKM[j]); - } - printf("\n"); - return CRYPT_ERROR; - } #if LTC_TEST_DBG > 1 } else { printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, cases[i].num); -#endif #endif } } diff --git a/src/modes/ctr/ctr_test.c b/src/modes/ctr/ctr_test.c index 6574ef261..878d42556 100644 --- a/src/modes/ctr/ctr_test.c +++ b/src/modes/ctr/ctr_test.c @@ -65,7 +65,7 @@ int ctr_test(void) return err; } ctr_done(&ctr); - if (XMEMCMP(buf, tests[x].ct, tests[x].msglen)) { + if (compare_testvector(buf, tests[x].msglen, tests[x].ct, tests[x].msglen, "CTR", x)) { return CRYPT_FAIL_TESTVECTOR; } } diff --git a/src/modes/f8/f8_test_mode.c b/src/modes/f8/f8_test_mode.c index d9d0ccd6e..778cd354d 100644 --- a/src/modes/f8/f8_test_mode.c +++ b/src/modes/f8/f8_test_mode.c @@ -59,7 +59,7 @@ int f8_test_mode(void) f8_done(&f8); /* compare */ - if (XMEMCMP(buf, ct, sizeof(ct))) { + if (compare_testvector(buf, sizeof(ct), ct, sizeof(ct), "f8", 0)) { return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/modes/lrw/lrw_test.c b/src/modes/lrw/lrw_test.c index 10ff919a8..7762d47d8 100644 --- a/src/modes/lrw/lrw_test.c +++ b/src/modes/lrw/lrw_test.c @@ -86,7 +86,7 @@ int lrw_test(void) } /* check pad against expected tweak */ - if (XMEMCMP(tests[x].expected_tweak, lrw.pad, 16)) { + if (compare_testvector(tests[x].expected_tweak, 16, lrw.pad, 16, "LRW Tweak", x)) { lrw_done(&lrw); return CRYPT_FAIL_TESTVECTOR; } @@ -97,7 +97,7 @@ int lrw_test(void) return err; } - if (XMEMCMP(buf[0], tests[x].C, 16)) { + if (compare_testvector(buf[0], 16, tests[x].C, 16, "LRW Encrypt", x)) { lrw_done(&lrw); return CRYPT_FAIL_TESTVECTOR; } @@ -113,7 +113,7 @@ int lrw_test(void) return err; } - if (XMEMCMP(buf[1], tests[x].P, 16)) { + if (compare_testvector(buf[1], 16, tests[x].P, 16, "LRW Decrypt", x)) { lrw_done(&lrw); return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/stream/rc4/rc4_test.c b/src/stream/rc4/rc4_test.c index 4167a6c68..a7e48879c 100644 --- a/src/stream/rc4/rc4_test.c +++ b/src/stream/rc4/rc4_test.c @@ -25,7 +25,7 @@ int rc4_stream_test(void) if ((err = rc4_stream_setup(&st, key, sizeof(key))) != CRYPT_OK) return err; if ((err = rc4_stream_crypt(&st, pt, sizeof(pt), buf)) != CRYPT_OK) return err; - if (XMEMCMP(buf, ct, sizeof(ct))) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(buf, sizeof(ct), ct, sizeof(ct), "RC4", 0)) return CRYPT_FAIL_TESTVECTOR; if ((err = rc4_stream_done(&st)) != CRYPT_OK) return err; return CRYPT_OK; diff --git a/src/stream/sober128/sober128_test.c b/src/stream/sober128/sober128_test.c index fa3f852be..32ea461c4 100644 --- a/src/stream/sober128/sober128_test.c +++ b/src/stream/sober128/sober128_test.c @@ -31,15 +31,7 @@ int sober128_stream_test(void) if ((err = sober128_stream_setiv(&st, iv, sizeof(iv))) != CRYPT_OK) return err; if ((err = sober128_stream_crypt(&st, src, len, dst)) != CRYPT_OK) return err; if ((err = sober128_stream_done(&st)) != CRYPT_OK) return err; - if (XMEMCMP(dst, out, len)) { -#if 0 - int y; - printf("\nLTC_SOBER128 failed, I got:\n"); - for (y = 0; y < len; y++) printf("%02x ", dst[y]); - printf("\nLTC_SOBER128 failed, expected:\n"); - for (y = 0; y < len; y++) printf("%02x ", out[y]); - printf("\n"); -#endif + if (compare_testvector(dst, len, out, len, "SOBER-128", 0)) { return CRYPT_FAIL_TESTVECTOR; } return CRYPT_OK; From 8f433f1a364e8401eeb864e705853c7088fce695 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 20 Jun 2017 19:22:15 +0200 Subject: [PATCH 0903/1192] add check for static function names --- helper.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/helper.pl b/helper.pl index ab41a51ce..3f7202f87 100755 --- a/helper.pl +++ b/helper.pl @@ -54,6 +54,11 @@ sub check_source { push @{$troubles->{unwanted_strcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bstrcmp\s*\(/; push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bclock\s*\(/; push @{$troubles->{unwanted_qsort}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bqsort\s*\(/; + if ($file =~ m|src/.*\.c$| && + $file !~ m|src/math/.+_desc.c$| && + $l =~ /^static\s+\S+\s+([^_][a-zA-Z0-9_]+)\s*\(/) { + push @{$troubles->{staticfunc_name}}, "$lineno($1)"; + } $lineno++; } for my $k (sort keys %$troubles) { From 1bf42ea99a476118b419f2c58d25af314e4f8710 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 19:58:13 +0200 Subject: [PATCH 0904/1192] update some of the static functions --- src/encauth/gcm/gcm_gf_mult.c | 4 +- src/mac/pelican/pelican.c | 8 +-- src/math/fp/ltc_ecc_fp_mulmod.c | 56 +++++++++---------- src/modes/xts/xts_decrypt.c | 8 +-- src/modes/xts/xts_encrypt.c | 8 +-- .../der_decode_generalizedtime.c | 8 +-- .../der/sequence/der_decode_sequence_flexi.c | 10 ++-- src/pk/asn1/der/set/der_encode_set.c | 8 +-- src/pk/asn1/der/set/der_encode_setof.c | 4 +- src/pk/asn1/der/utctime/der_decode_utctime.c | 4 +- src/pk/dsa/dsa_make_key.c | 4 +- src/pk/ecc/ecc_import.c | 4 +- src/prngs/fortuna.c | 18 +++--- 13 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/encauth/gcm/gcm_gf_mult.c b/src/encauth/gcm/gcm_gf_mult.c index 1f0981542..2e7a9060f 100644 --- a/src/encauth/gcm/gcm_gf_mult.c +++ b/src/encauth/gcm/gcm_gf_mult.c @@ -58,7 +58,7 @@ const unsigned char gcm_shift_table[256*2] = { #ifndef LTC_FAST /* right shift */ -static void gcm_rightshift(unsigned char *a) +static void _gcm_rightshift(unsigned char *a) { int x; for (x = 15; x > 0; x--) { @@ -92,7 +92,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char * } } z = V[15] & 0x01; - gcm_rightshift(V); + _gcm_rightshift(V); V[0] ^= poly[z]; } XMEMCPY(c, Z, 16); diff --git a/src/mac/pelican/pelican.c b/src/mac/pelican/pelican.c index a81a3ed67..6a4dde649 100644 --- a/src/mac/pelican/pelican.c +++ b/src/mac/pelican/pelican.c @@ -51,7 +51,7 @@ int pelican_init(pelican_state *pelmac, const unsigned char *key, unsigned long return CRYPT_OK; } -static void four_rounds(pelican_state *pelmac) +static void _four_rounds(pelican_state *pelmac) { ulong32 s0, s1, s2, s3, t0, t1, t2, t3; int r; @@ -114,7 +114,7 @@ int pelican_process(pelican_state *pelmac, const unsigned char *in, unsigned lon for (x = 0; x < 16; x += sizeof(LTC_FAST_TYPE)) { *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)pelmac->state + x)) ^= *(LTC_FAST_TYPE_PTR_CAST((unsigned char *)in + x)); } - four_rounds(pelmac); + _four_rounds(pelmac); in += 16; inlen -= 16; } @@ -124,7 +124,7 @@ int pelican_process(pelican_state *pelmac, const unsigned char *in, unsigned lon while (inlen--) { pelmac->state[pelmac->buflen++] ^= *in++; if (pelmac->buflen == 16) { - four_rounds(pelmac); + _four_rounds(pelmac); pelmac->buflen = 0; } } @@ -148,7 +148,7 @@ int pelican_done(pelican_state *pelmac, unsigned char *out) } if (pelmac->buflen == 16) { - four_rounds(pelmac); + _four_rounds(pelmac); pelmac->buflen = 0; } pelmac->state[pelmac->buflen++] ^= 0x80; diff --git a/src/math/fp/ltc_ecc_fp_mulmod.c b/src/math/fp/ltc_ecc_fp_mulmod.c index 134aa47f2..24ed01964 100644 --- a/src/math/fp/ltc_ecc_fp_mulmod.c +++ b/src/math/fp/ltc_ecc_fp_mulmod.c @@ -572,7 +572,7 @@ static const struct { }; /* find a hole and free as required, return -1 if no hole found */ -static int find_hole(void) +static int _find_hole(void) { unsigned x; int y, z; @@ -608,7 +608,7 @@ static int find_hole(void) } /* determine if a base is already in the cache and if so, where */ -static int find_base(ecc_point *g) +static int _find_base(ecc_point *g) { int x; for (x = 0; x < FP_ENTRIES; x++) { @@ -626,7 +626,7 @@ static int find_base(ecc_point *g) } /* add a new base to the cache */ -static int add_entry(int idx, ecc_point *g) +static int _add_entry(int idx, ecc_point *g) { unsigned x, y; @@ -668,7 +668,7 @@ static int add_entry(int idx, ecc_point *g) * The algorithm builds patterns in increasing bit order by first making all * single bit input patterns, then all two bit input patterns and so on */ -static int build_lut(int idx, void *modulus, void *mp, void *mu) +static int _build_lut(int idx, void *modulus, void *mp, void *mu) { unsigned x, y, err, bitlen, lut_gap; void *tmp; @@ -775,7 +775,7 @@ static int build_lut(int idx, void *modulus, void *mp, void *mu) } /* perform a fixed point ECC mulmod */ -static int accel_fp_mul(int idx, void *k, ecc_point *R, void *modulus, void *mp, int map) +static int _accel_fp_mul(int idx, void *k, ecc_point *R, void *modulus, void *mp, int map) { unsigned char kb[128]; int x; @@ -898,7 +898,7 @@ static int accel_fp_mul(int idx, void *k, ecc_point *R, void *modulus, void *mp, #ifdef LTC_ECC_SHAMIR /* perform a fixed point ECC mulmod */ -static int accel_fp_mul2add(int idx1, int idx2, +static int _accel_fp_mul2add(int idx1, int idx2, void *kA, void *kB, ecc_point *R, void *modulus, void *mp) { @@ -1119,13 +1119,13 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, mu = NULL; LTC_MUTEX_LOCK(<c_ecc_fp_lock); /* find point */ - idx1 = find_base(A); + idx1 = _find_base(A); /* no entry? */ if (idx1 == -1) { /* find hole and add it */ - if ((idx1 = find_hole()) >= 0) { - if ((err = add_entry(idx1, A)) != CRYPT_OK) { + if ((idx1 = _find_hole()) >= 0) { + if ((err = _add_entry(idx1, A)) != CRYPT_OK) { goto LBL_ERR; } } @@ -1136,13 +1136,13 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, } /* find point */ - idx2 = find_base(B); + idx2 = _find_base(B); /* no entry? */ if (idx2 == -1) { /* find hole and add it */ - if ((idx2 = find_hole()) >= 0) { - if ((err = add_entry(idx2, B)) != CRYPT_OK) { + if ((idx2 = _find_hole()) >= 0) { + if ((err = _add_entry(idx2, B)) != CRYPT_OK) { goto LBL_ERR; } } @@ -1166,7 +1166,7 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, } /* build the LUT */ - if ((err = build_lut(idx1, modulus, mp, mu)) != CRYPT_OK) { + if ((err = _build_lut(idx1, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR;; } } @@ -1187,7 +1187,7 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, } /* build the LUT */ - if ((err = build_lut(idx2, modulus, mp, mu)) != CRYPT_OK) { + if ((err = _build_lut(idx2, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR;; } } @@ -1198,7 +1198,7 @@ int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, /* compute mp */ if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto LBL_ERR; } } - err = accel_fp_mul2add(idx1, idx2, kA, kB, C, modulus, mp); + err = _accel_fp_mul2add(idx1, idx2, kA, kB, C, modulus, mp); } else { err = ltc_ecc_mul2add(A, kA, B, kB, C, modulus); } @@ -1231,15 +1231,15 @@ int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int ma mu = NULL; LTC_MUTEX_LOCK(<c_ecc_fp_lock); /* find point */ - idx = find_base(G); + idx = _find_base(G); /* no entry? */ if (idx == -1) { /* find hole and add it */ - idx = find_hole(); + idx = _find_hole(); if (idx >= 0) { - if ((err = add_entry(idx, G)) != CRYPT_OK) { + if ((err = _add_entry(idx, G)) != CRYPT_OK) { goto LBL_ERR; } } @@ -1264,7 +1264,7 @@ int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int ma } /* build the LUT */ - if ((err = build_lut(idx, modulus, mp, mu)) != CRYPT_OK) { + if ((err = _build_lut(idx, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR;; } } @@ -1274,7 +1274,7 @@ int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int ma /* compute mp */ if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto LBL_ERR; } } - err = accel_fp_mul(idx, k, R, modulus, mp, map); + err = _accel_fp_mul(idx, k, R, modulus, mp, map); } else { err = ltc_ecc_mulmod(k, G, R, modulus, map); } @@ -1290,7 +1290,7 @@ int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int ma } /* helper function for freeing the cache ... must be called with the cache mutex locked */ -static void ltc_ecc_fp_free_cache(void) +static void _ltc_ecc_fp_free_cache(void) { unsigned x, y; for (x = 0; x < FP_ENTRIES; x++) { @@ -1315,7 +1315,7 @@ static void ltc_ecc_fp_free_cache(void) void ltc_ecc_fp_free(void) { LTC_MUTEX_LOCK(<c_ecc_fp_lock); - ltc_ecc_fp_free_cache(); + _ltc_ecc_fp_free_cache(); LTC_MUTEX_UNLOCK(<c_ecc_fp_lock); } @@ -1334,7 +1334,7 @@ ltc_ecc_fp_add_point(ecc_point *g, void *modulus, int lock) void *mu = NULL; LTC_MUTEX_LOCK(<c_ecc_fp_lock); - if ((idx = find_base(g)) >= 0) { + if ((idx = _find_base(g)) >= 0) { /* it is already in the cache ... just check that the LUT is initialized */ if(fp_cache[idx].lru_count >= 2) { LTC_MUTEX_UNLOCK(<c_ecc_fp_lock); @@ -1342,11 +1342,11 @@ ltc_ecc_fp_add_point(ecc_point *g, void *modulus, int lock) } } - if(idx == -1 && (idx = find_hole()) == -1) { + if(idx == -1 && (idx = _find_hole()) == -1) { err = CRYPT_BUFFER_OVERFLOW; goto LBL_ERR; } - if ((err = add_entry(idx, g)) != CRYPT_OK) { + if ((err = _add_entry(idx, g)) != CRYPT_OK) { goto LBL_ERR; } /* compute mp */ @@ -1363,7 +1363,7 @@ ltc_ecc_fp_add_point(ecc_point *g, void *modulus, int lock) } /* build the LUT */ - if ((err = build_lut(idx, modulus, mp, mu)) != CRYPT_OK) { + if ((err = _build_lut(idx, modulus, mp, mu)) != CRYPT_OK) { goto LBL_ERR; } fp_cache[idx].lru_count = 2; @@ -1501,7 +1501,7 @@ int ltc_ecc_fp_restore_state(unsigned char *in, unsigned long inlen) /* * start with an empty cache */ - ltc_ecc_fp_free_cache(); + _ltc_ecc_fp_free_cache(); /* * decode the input packet: It consists of a sequence with a few @@ -1571,7 +1571,7 @@ int ltc_ecc_fp_restore_state(unsigned char *in, unsigned long inlen) ERR_OUT: if(asn1_list) XFREE(asn1_list); - ltc_ecc_fp_free_cache(); + _ltc_ecc_fp_free_cache(); LTC_MUTEX_UNLOCK(<c_ecc_fp_lock); return err; } diff --git a/src/modes/xts/xts_decrypt.c b/src/modes/xts/xts_decrypt.c index af3fbf63f..458099150 100644 --- a/src/modes/xts/xts_decrypt.c +++ b/src/modes/xts/xts_decrypt.c @@ -14,7 +14,7 @@ #ifdef LTC_XTS_MODE -static int tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char *T, symmetric_xts *xts) +static int _tweak_uncrypt(const unsigned char *C, unsigned char *P, unsigned char *T, symmetric_xts *xts) { unsigned long x; int err; @@ -108,7 +108,7 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, } for (i = 0; i < lim; i++) { - if ((err = tweak_uncrypt(ct, pt, T, xts)) != CRYPT_OK) { + if ((err = _tweak_uncrypt(ct, pt, T, xts)) != CRYPT_OK) { return err; } ct += 16; @@ -122,7 +122,7 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, xts_mult_x(CC); /* PP = tweak decrypt block m-1 */ - if ((err = tweak_uncrypt(ct, PP, CC, xts)) != CRYPT_OK) { + if ((err = _tweak_uncrypt(ct, PP, CC, xts)) != CRYPT_OK) { return err; } @@ -136,7 +136,7 @@ int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, } /* Pm-1 = Tweak uncrypt CC */ - if ((err = tweak_uncrypt(CC, pt, T, xts)) != CRYPT_OK) { + if ((err = _tweak_uncrypt(CC, pt, T, xts)) != CRYPT_OK) { return err; } } diff --git a/src/modes/xts/xts_encrypt.c b/src/modes/xts/xts_encrypt.c index 235aaa8bc..787c30212 100644 --- a/src/modes/xts/xts_encrypt.c +++ b/src/modes/xts/xts_encrypt.c @@ -14,7 +14,7 @@ #ifdef LTC_XTS_MODE -static int tweak_crypt(const unsigned char *P, unsigned char *C, unsigned char *T, symmetric_xts *xts) +static int _tweak_crypt(const unsigned char *P, unsigned char *C, unsigned char *T, symmetric_xts *xts) { unsigned long x; int err; @@ -111,7 +111,7 @@ int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, } for (i = 0; i < lim; i++) { - if ((err = tweak_crypt(pt, ct, T, xts)) != CRYPT_OK) { + if ((err = _tweak_crypt(pt, ct, T, xts)) != CRYPT_OK) { return err; } ct += 16; @@ -122,7 +122,7 @@ int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, /* if ptlen not divide 16 then */ if (mo > 0) { /* CC = tweak encrypt block m-1 */ - if ((err = tweak_crypt(pt, CC, T, xts)) != CRYPT_OK) { + if ((err = _tweak_crypt(pt, CC, T, xts)) != CRYPT_OK) { return err; } @@ -137,7 +137,7 @@ int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, } /* Cm-1 = Tweak encrypt PP */ - if ((err = tweak_crypt(PP, ct, T, xts)) != CRYPT_OK) { + if ((err = _tweak_crypt(PP, ct, T, xts)) != CRYPT_OK) { return err; } } diff --git a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c index 88f56ec58..e7c7341d4 100644 --- a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c @@ -16,7 +16,7 @@ #ifdef LTC_DER -static int char_to_int(unsigned char x) +static int _char_to_int(unsigned char x) { switch (x) { case '0': return 0; @@ -34,13 +34,13 @@ static int char_to_int(unsigned char x) } #define DECODE_V(y, max) do {\ - y = char_to_int(buf[x])*10 + char_to_int(buf[x+1]); \ + y = _char_to_int(buf[x])*10 + _char_to_int(buf[x+1]); \ if (y >= max) return CRYPT_INVALID_PACKET; \ x += 2; \ } while(0) #define DECODE_V4(y, max) do {\ - y = char_to_int(buf[x])*1000 + char_to_int(buf[x+1])*100 + char_to_int(buf[x+2])*10 + char_to_int(buf[x+3]); \ + y = _char_to_int(buf[x])*1000 + _char_to_int(buf[x+1])*100 + _char_to_int(buf[x+2])*10 + _char_to_int(buf[x+3]); \ if (y >= max) return CRYPT_INVALID_PACKET; \ x += 4; \ } while(0) @@ -118,7 +118,7 @@ YYYYMMDDhhmmss.fs-hh'mm' unsigned fs = out->fs; if (x >= sizeof(buf)) return CRYPT_INVALID_PACKET; out->fs *= 10; - out->fs += char_to_int(buf[x]); + out->fs += _char_to_int(buf[x]); if (fs > out->fs) return CRYPT_OVERFLOW; x++; } diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c index 08c698936..142ef95ad 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c @@ -15,7 +15,7 @@ #ifdef LTC_DER -static unsigned long fetch_length(const unsigned char *in, unsigned long inlen, unsigned long *data_offset) +static unsigned long _fetch_length(const unsigned char *in, unsigned long inlen, unsigned long *data_offset) { unsigned long x, z; @@ -51,7 +51,7 @@ static unsigned long fetch_length(const unsigned char *in, unsigned long inlen, return z+*data_offset; } -static int new_element(ltc_asn1_list **l) +static int _new_element(ltc_asn1_list **l) { /* alloc new link */ if (*l == NULL) { @@ -92,7 +92,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc if (*inlen == 0) { /* alloc new link */ - if ((err = new_element(&l)) != CRYPT_OK) { + if ((err = _new_element(&l)) != CRYPT_OK) { goto error; } } @@ -103,14 +103,14 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc type = *in; /* fetch length */ - len = fetch_length(in, *inlen, &data_offset); + len = _fetch_length(in, *inlen, &data_offset); if (len > *inlen) { err = CRYPT_INVALID_PACKET; goto error; } /* alloc new link */ - if ((err = new_element(&l)) != CRYPT_OK) { + if ((err = _new_element(&l)) != CRYPT_OK) { goto error; } diff --git a/src/pk/asn1/der/set/der_encode_set.c b/src/pk/asn1/der/set/der_encode_set.c index a64bae917..fef3092b7 100644 --- a/src/pk/asn1/der/set/der_encode_set.c +++ b/src/pk/asn1/der/set/der_encode_set.c @@ -16,7 +16,7 @@ #ifdef LTC_DER /* LTC define to ASN.1 TAG */ -static int ltc_to_asn1(ltc_asn1_type v) +static int _ltc_to_asn1(ltc_asn1_type v) { switch (v) { case LTC_ASN1_BOOLEAN: return 0x01; @@ -45,12 +45,12 @@ static int ltc_to_asn1(ltc_asn1_type v) } -static int qsort_helper(const void *a, const void *b) +static int _qsort_helper(const void *a, const void *b) { ltc_asn1_list *A = (ltc_asn1_list *)a, *B = (ltc_asn1_list *)b; int r; - r = ltc_to_asn1(A->type) - ltc_to_asn1(B->type); + r = _ltc_to_asn1(A->type) - _ltc_to_asn1(B->type); /* for QSORT the order is UNDEFINED if they are "equal" which means it is NOT DETERMINISTIC. So we force it to be :-) */ if (r == 0) { @@ -89,7 +89,7 @@ int der_encode_set(ltc_asn1_list *list, unsigned long inlen, } /* sort it by the "type" field */ - XQSORT(copy, inlen, sizeof(*copy), &qsort_helper); + XQSORT(copy, inlen, sizeof(*copy), &_qsort_helper); /* call der_encode_sequence_ex() */ err = der_encode_sequence_ex(copy, inlen, out, outlen, LTC_ASN1_SET); diff --git a/src/pk/asn1/der/set/der_encode_setof.c b/src/pk/asn1/der/set/der_encode_setof.c index b3c932f59..b837cdda4 100644 --- a/src/pk/asn1/der/set/der_encode_setof.c +++ b/src/pk/asn1/der/set/der_encode_setof.c @@ -20,7 +20,7 @@ struct edge { unsigned long size; }; -static int qsort_helper(const void *a, const void *b) +static int _qsort_helper(const void *a, const void *b) { struct edge *A = (struct edge *)a, *B = (struct edge *)b; int r; @@ -132,7 +132,7 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, } /* sort based on contents (using edges) */ - XQSORT(edges, inlen, sizeof(*edges), &qsort_helper); + XQSORT(edges, inlen, sizeof(*edges), &_qsort_helper); /* copy static header */ XMEMCPY(out, buf, hdrlen); diff --git a/src/pk/asn1/der/utctime/der_decode_utctime.c b/src/pk/asn1/der/utctime/der_decode_utctime.c index 1a009bceb..9ab000f67 100644 --- a/src/pk/asn1/der/utctime/der_decode_utctime.c +++ b/src/pk/asn1/der/utctime/der_decode_utctime.c @@ -15,7 +15,7 @@ #ifdef LTC_DER -static int char_to_int(unsigned char x) +static int _char_to_int(unsigned char x) { switch (x) { case '0': return 0; @@ -33,7 +33,7 @@ static int char_to_int(unsigned char x) } #define DECODE_V(y, max) \ - y = char_to_int(buf[x])*10 + char_to_int(buf[x+1]); \ + y = _char_to_int(buf[x])*10 + _char_to_int(buf[x+1]); \ if (y >= max) return CRYPT_INVALID_PACKET; \ x += 2; diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 476b93bb0..bec09c983 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -26,7 +26,7 @@ @param g [out] bignum where generated 'g' is stored (must be initialized by caller) @return CRYPT_OK if successful, upon error this function will free all allocated memory */ -static int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g) +static int _dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g) { unsigned long L, N, n, outbytes, seedbytes, counter, j, i; int err, res, mr_tests_q, mr_tests_p, found_p, found_q, hash; @@ -227,7 +227,7 @@ int dsa_make_key_ex(prng_state *prng, int wprng, int group_size, int modulus_siz if (p_hex == NULL || q_hex == NULL || g_hex == NULL) { /* generate params */ - err = dsa_make_params(prng, wprng, group_size, modulus_size, key->p, key->q, key->g); + err = _dsa_make_params(prng, wprng, group_size, modulus_size, key->p, key->q, key->g); if (err != CRYPT_OK) { goto cleanup; } } else { diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index 98ec70fa4..7c0afed47 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -21,7 +21,7 @@ #ifdef LTC_MECC -static int is_point(ecc_key *key) +static int _is_point(ecc_key *key) { void *prime, *b, *t1, *t2; int err; @@ -153,7 +153,7 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co if ((err = mp_set(key->pubkey.z, 1)) != CRYPT_OK) { goto done; } /* is it a point on the curve? */ - if ((err = is_point(key)) != CRYPT_OK) { + if ((err = _is_point(key)) != CRYPT_OK) { goto done; } diff --git a/src/prngs/fortuna.c b/src/prngs/fortuna.c index b521b540f..4a520d4af 100644 --- a/src/prngs/fortuna.c +++ b/src/prngs/fortuna.c @@ -49,7 +49,7 @@ const struct ltc_prng_descriptor fortuna_desc = { }; /* update the IV */ -static void fortuna_update_iv(prng_state *prng) +static void _fortuna_update_iv(prng_state *prng) { int x; unsigned char *IV; @@ -62,7 +62,7 @@ static void fortuna_update_iv(prng_state *prng) } /* reseed the PRNG */ -static int fortuna_reseed(prng_state *prng) +static int _fortuna_reseed(prng_state *prng) { unsigned char tmp[MAXBLOCKSIZE]; hash_state md; @@ -106,7 +106,7 @@ static int fortuna_reseed(prng_state *prng) if ((err = rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey)) != CRYPT_OK) { return err; } - fortuna_update_iv(prng); + _fortuna_update_iv(prng); /* reset pool len */ prng->fortuna.pool0_len = 0; @@ -217,7 +217,7 @@ int fortuna_ready(prng_state *prng) LTC_ARGCHK(prng != NULL); LTC_MUTEX_LOCK(&prng->lock); - err = fortuna_reseed(prng); + err = _fortuna_reseed(prng); prng->ready = (err == CRYPT_OK) ? 1 : 0; LTC_MUTEX_UNLOCK(&prng->lock); @@ -246,7 +246,7 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state /* do we have to reseed? */ if (++prng->fortuna.wd == LTC_FORTUNA_WD || prng->fortuna.pool0_len >= 64) { - if (fortuna_reseed(prng) != CRYPT_OK) { + if (_fortuna_reseed(prng) != CRYPT_OK) { goto LBL_UNLOCK; } } @@ -260,22 +260,22 @@ unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state rijndael_ecb_encrypt(prng->fortuna.IV, out, &prng->fortuna.skey); out += 16; outlen -= 16; - fortuna_update_iv(prng); + _fortuna_update_iv(prng); } /* left over bytes? */ if (outlen > 0) { rijndael_ecb_encrypt(prng->fortuna.IV, tmp, &prng->fortuna.skey); XMEMCPY(out, tmp, outlen); - fortuna_update_iv(prng); + _fortuna_update_iv(prng); } /* generate new key */ rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K , &prng->fortuna.skey); - fortuna_update_iv(prng); + _fortuna_update_iv(prng); rijndael_ecb_encrypt(prng->fortuna.IV, prng->fortuna.K+16, &prng->fortuna.skey); - fortuna_update_iv(prng); + _fortuna_update_iv(prng); if (rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey) != CRYPT_OK) { tlen = 0; From af984dc33edbe355b4d9ba84c174d6c4b175f870 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 19:59:07 +0200 Subject: [PATCH 0905/1192] exclude more sources from "static function check" --- helper.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helper.pl b/helper.pl index 3f7202f87..b39bffc9b 100755 --- a/helper.pl +++ b/helper.pl @@ -55,7 +55,10 @@ sub check_source { push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bclock\s*\(/; push @{$troubles->{unwanted_qsort}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bqsort\s*\(/; if ($file =~ m|src/.*\.c$| && + $file !~ m|src/ciphers/.*\.c$| && + $file !~ m|src/hashes/.*\.c$| && $file !~ m|src/math/.+_desc.c$| && + $file !~ m|src/stream/sober128/sober128.c$| && $l =~ /^static\s+\S+\s+([^_][a-zA-Z0-9_]+)\s*\(/) { push @{$troubles->{staticfunc_name}}, "$lineno($1)"; } From 1655e63c49d023bb130741c00fb21694164b7980 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 21 Jun 2017 10:11:04 +0200 Subject: [PATCH 0906/1192] also use DESTDIR in makefile.m{ingw,svc} --- makefile.mingw | 23 ++++++++++++----------- makefile.msvc | 19 ++++++++++--------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 04ad30b9f..3bfa57176 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -15,6 +15,7 @@ # #The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs +DESTDIR = PREFIX = c:\mingw CC = gcc AR = ar @@ -263,20 +264,20 @@ clean: #Install the library + headers install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) - cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" - cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" - cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" - copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" - copy /Y $(LIBMAIN_I) "$(PREFIX)\lib" - copy /Y $(LIBMAIN_D) "$(PREFIX)\bin" - copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\bin" mkdir "$(DESTDIR)$(PREFIX)\bin" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\lib" mkdir "$(DESTDIR)$(PREFIX)\lib" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\include" mkdir "$(DESTDIR)$(PREFIX)\include" + copy /Y $(LIBMAIN_S) "$(DESTDIR)$(PREFIX)\lib" + copy /Y $(LIBMAIN_I) "$(DESTDIR)$(PREFIX)\lib" + copy /Y $(LIBMAIN_D) "$(DESTDIR)$(PREFIX)\bin" + copy /Y src\headers\tomcrypt*.h "$(DESTDIR)$(PREFIX)\include" #Install useful tools install_bins: hashsum - cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" - copy /Y hashsum.exe "$(PREFIX)\bin" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\bin" mkdir "$(DESTDIR)$(PREFIX)\bin" + copy /Y hashsum.exe "$(DESTDIR)$(PREFIX)\bin" #Install documentation install_docs: doc/crypt.pdf - cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc" - copy /Y doc\crypt.pdf "$(PREFIX)\doc" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\doc" mkdir "$(DESTDIR)$(PREFIX)\doc" + copy /Y doc\crypt.pdf "$(DESTDIR)$(PREFIX)\doc" diff --git a/makefile.msvc b/makefile.msvc index 804c85811..4bed361f2 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -15,6 +15,7 @@ # #The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs +DESTDIR = PREFIX = c:\devel CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath EXTRALIBS = ../libtommath/tommath.lib @@ -250,18 +251,18 @@ clean: #Install the library + headers install: $(LIBMAIN_S) - cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" - cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" - cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" - copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" - copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\bin" mkdir "$(DESTDIR)$(PREFIX)\bin" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\lib" mkdir "$(DESTDIR)$(PREFIX)\lib" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\include" mkdir "$(DESTDIR)$(PREFIX)\include" + copy /Y $(LIBMAIN_S) "$(DESTDIR)$(PREFIX)\lib" + copy /Y src\headers\tomcrypt*.h "$(DESTDIR)$(PREFIX)\include" #Install useful tools install_bins: hashsum - cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" - copy /Y hashsum.exe "$(PREFIX)\bin" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\bin" mkdir "$(DESTDIR)$(PREFIX)\bin" + copy /Y hashsum.exe "$(DESTDIR)$(PREFIX)\bin" #Install documentation install_docs: doc/crypt.pdf - cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc" - copy /Y doc\crypt.pdf "$(PREFIX)\doc" + cmd /c if not exist "$(DESTDIR)$(PREFIX)\doc" mkdir "$(DESTDIR)$(PREFIX)\doc" + copy /Y doc\crypt.pdf "$(DESTDIR)$(PREFIX)\doc" From ae698927ff34687b2328e32416138ccc1dcef9c4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 21 Jun 2017 14:39:08 +0200 Subject: [PATCH 0907/1192] improve `mem_neq()` documentation --- src/headers/tomcrypt_custom.h | 3 +++ src/misc/mem_neq.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 344b0d2ed..cc63b0803 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -33,6 +33,9 @@ #ifndef XMEMCMP #define XMEMCMP memcmp #endif +/* A memory compare function that has to run in constant time, + * c.f. mem_neq() API summary. + */ #ifndef XMEM_NEQ #define XMEM_NEQ mem_neq #endif diff --git a/src/misc/mem_neq.c b/src/misc/mem_neq.c index e20fd33e1..fbd0cce1c 100644 --- a/src/misc/mem_neq.c +++ b/src/misc/mem_neq.c @@ -10,22 +10,27 @@ /** @file mem_neq.c - Compare two blocks of memory for inequality. + Compare two blocks of memory for inequality in constant time. Steffen Jaeckel */ /** - Compare two blocks of memory for inequality. + Compare two blocks of memory for inequality in constant time. The usage is similar to that of standard memcmp, but you can only test if the memory is equal or not - you can not determine by how much the first different byte differs. + This function shall be used to compare results of cryptographic + operations where inequality means most likely usage of a wrong key. + The execution time has therefore to be constant as otherwise + timing attacks could be possible. + @param a The first memory region @param b The second memory region @param len The length of the area to compare (octets) - @return 0 when a and b are equal for len bytes, else they are not equal. + @return 0 when a and b are equal for len bytes, 1 they are not equal. */ int mem_neq(const void *a, const void *b, size_t len) { From e9c90e7f63eb25bb6751fd96cfdd074ff1710af8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 22 Jun 2017 08:38:23 +0200 Subject: [PATCH 0908/1192] no need to use `XMEM_NEQ()` in PK crypto --- src/pk/rsa/rsa_verify_hash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 50431ef95..89981222f 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -155,15 +155,15 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, /* test OID */ if ((reallen == outlen) && (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && - (XMEM_NEQ(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && + (XMEMCMP(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && (siginfo[1].size == hashlen) && - (XMEM_NEQ(siginfo[1].data, hash, hashlen) == 0)) { + (XMEMCMP(siginfo[1].data, hash, hashlen) == 0)) { *stat = 1; } } else { /* only check if the hash is equal */ if ((hashlen == outlen) && - (XMEM_NEQ(out, hash, hashlen) == 0)) { + (XMEMCMP(out, hash, hashlen) == 0)) { *stat = 1; } } From 11338d2496637478922fa9772324acca69fd1169 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 22 Jun 2017 08:41:25 +0200 Subject: [PATCH 0909/1192] introduce XMEMMOVE and check for its usage --- helper.pl | 1 + src/headers/tomcrypt_custom.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/helper.pl b/helper.pl index b39bffc9b..90308aea8 100755 --- a/helper.pl +++ b/helper.pl @@ -50,6 +50,7 @@ sub check_source { push @{$troubles->{unwanted_free}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bfree\s*\(/; push @{$troubles->{unwanted_memset}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemset\s*\(/; push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcpy\s*\(/; + push @{$troubles->{unwanted_memmove}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemmove\s*\(/; push @{$troubles->{unwanted_memcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcmp\s*\(/; push @{$troubles->{unwanted_strcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bstrcmp\s*\(/; push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bclock\s*\(/; diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index cc63b0803..3d8e63388 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -30,6 +30,9 @@ #ifndef XMEMCPY #define XMEMCPY memcpy #endif +#ifndef XMEMMOVE +#define XMEMMOVE memmove +#endif #ifndef XMEMCMP #define XMEMCMP memcmp #endif From e3937a2906cf7a1f3f8113481265284fe089d84f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 22 Jun 2017 09:46:08 +0200 Subject: [PATCH 0910/1192] fix compile warning when building w/o tests --- src/modes/xts/xts_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modes/xts/xts_test.c b/src/modes/xts/xts_test.c index 6c721a442..347fb4b76 100644 --- a/src/modes/xts/xts_test.c +++ b/src/modes/xts/xts_test.c @@ -10,6 +10,7 @@ #ifdef LTC_XTS_MODE +#ifndef LTC_NO_TEST static int _xts_test_accel_xts_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *tweak, symmetric_key *skey1, symmetric_key *skey2) { @@ -63,6 +64,7 @@ static int _xts_test_accel_xts_decrypt(const unsigned char *ct, unsigned char *p return ret; } +#endif /** Source donated by Elliptic Semiconductor Inc (www.ellipticsemi.com) to the LibTom Projects From 09c4d4c93b228fe96c4ae99e38ee810cdf35ff12 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 22 Jun 2017 11:29:40 +0200 Subject: [PATCH 0911/1192] proper use of `$(DESTDIR)` @rofl0r @ [1] "...still it's unusual/unexpected to embed DESTDIR in LIBPATH etc. where this could hickup is when for example hardcoded paths need to be embedded into the resulting binary. for example, in the netbsd-curses makefile i linked earlier, such a case would be reference to the terminfo DB location, which is derived from PREFIX. other possible cases might be stuff that dlopen()s its own libs using an absolute path, or uses other data files. for such a case a contributor would typically re-use DATAPATH oslt and put it into CPPFLAGS or write it into a header, to find the required files. when now these paths have DESTDIR in them too, this will not work. thus it is good practice to use $(DESTDIR) only in install targets, and keep it out of other vars." [1] https://github.com/libtom/libtomcrypt/commit/8e29a6061f3ad7bc7c5c2aeae73705e890ce1ea9#commitcomment-22678488 This closes #232 --- makefile.shared | 4 ++-- makefile.unix | 24 ++++++++++++------------ makefile_include.mk | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/makefile.shared b/makefile.shared index eea79e5bf..e4fc10315 100644 --- a/makefile.shared +++ b/makefile.shared @@ -47,8 +47,8 @@ $(LIBNAME): $(OBJECTS) install: .common_install sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc - install -d $(LIBPATH)/pkgconfig - install -m 644 libtomcrypt.pc $(LIBPATH)/pkgconfig/ + install -d $(DESTDIR)/$(LIBPATH)/pkgconfig + install -m 644 libtomcrypt.pc $(DESTDIR)/$(LIBPATH)/pkgconfig/ install_bins: .common_install_bins diff --git a/makefile.unix b/makefile.unix index 88f88a002..d3ccc7234 100644 --- a/makefile.unix +++ b/makefile.unix @@ -25,10 +25,10 @@ #The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs" DESTDIR = PREFIX = /usr/local -LIBPATH = $(DESTDIR)$(PREFIX)/lib -INCPATH = $(DESTDIR)$(PREFIX)/include -DATAPATH = $(DESTDIR)$(PREFIX)/share/doc/libtomcrypt/pdf -BINPATH = $(DESTDIR)$(PREFIX)/bin +LIBPATH = $(PREFIX)/lib +INCPATH = $(PREFIX)/include +DATAPATH = $(PREFIX)/share/doc/libtomcrypt/pdf +BINPATH = $(PREFIX)/bin CC = cc AR = ar ARFLAGS = r @@ -272,17 +272,17 @@ clean: #Install the library + headers install: $(LIBMAIN_S) $(HEADERS) - @mkdir -p $(INCPATH) $(LIBPATH)/pkgconfig - @cp $(LIBMAIN_S) $(LIBPATH)/ - @cp $(HEADERS) $(INCPATH)/ - @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(LIBPATH)/pkgconfig/libtomcrypt.pc + @mkdir -p $(DESTDIR)/$(INCPATH) $(DESTDIR)/$(LIBPATH)/pkgconfig + @cp $(LIBMAIN_S) $(DESTDIR)/$(LIBPATH)/ + @cp $(HEADERS) $(DESTDIR)/$(INCPATH)/ + @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)/$(LIBPATH)/pkgconfig/libtomcrypt.pc #Install useful tools install_bins: hashsum - @mkdir -p $(BINPATH) - @cp hashsum $(BINPATH)/ + @mkdir -p $(DESTDIR)/$(BINPATH) + @cp hashsum $(DESTDIR)/$(BINPATH)/ #Install documentation install_docs: doc/crypt.pdf - @mkdir -p $(DATAPATH) - @cp doc/crypt.pdf $(DATAPATH)/ + @mkdir -p $(DESTDIR)/$(DATAPATH) + @cp doc/crypt.pdf $(DESTDIR)/$(DATAPATH)/ diff --git a/makefile_include.mk b/makefile_include.mk index daf765714..6d1300947 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -132,10 +132,10 @@ TIMINGS=demos/timing.o #BINPATH The directory to install the binaries provided. DESTDIR ?= PREFIX ?= /usr/local -LIBPATH ?= $(DESTDIR)$(PREFIX)/lib -INCPATH ?= $(DESTDIR)$(PREFIX)/include -DATAPATH ?= $(DESTDIR)$(PREFIX)/share/doc/libtomcrypt/pdf -BINPATH ?= $(DESTDIR)$(PREFIX)/bin +LIBPATH ?= $(PREFIX)/lib +INCPATH ?= $(PREFIX)/include +DATAPATH ?= $(PREFIX)/share/doc/libtomcrypt/pdf +BINPATH ?= $(PREFIX)/bin #Who do we install as? ifdef INSTALL_USER @@ -362,18 +362,18 @@ install_all: install install_bins install_docs install_test INSTALL_OPTS ?= -m 644 .common_install: $(LIBNAME) - install -d $(INCPATH) - install -d $(LIBPATH) - $(INSTALL_CMD) $(INSTALL_OPTS) $(LIBNAME) $(LIBPATH)/$(LIBNAME) - install -m 644 $(HEADERS) $(INCPATH) + install -d $(DESTDIR)/$(INCPATH) + install -d $(DESTDIR)/$(LIBPATH) + $(INSTALL_CMD) $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)/$(LIBPATH)/$(LIBNAME) + install -m 644 $(HEADERS) $(DESTDIR)/$(INCPATH) .common_install_bins: $(USEFUL_DEMOS) install -d $(BINPATH) - $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(BINPATH) + $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(DESTDIR)/$(BINPATH) install_docs: doc/crypt.pdf install -d $(DATAPATH) - install -m 644 doc/crypt.pdf $(DATAPATH) + install -m 644 doc/crypt.pdf $(DESTDIR)/$(DATAPATH) install_hooks: for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done From 5ce602558f9478afcb24309016aaa910e45bb18d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 22 Jun 2017 14:41:37 +0200 Subject: [PATCH 0912/1192] Revert "also use DESTDIR in makefile.m{ingw,svc}" This reverts commit 1655e63c49d023bb130741c00fb21694164b7980. As of @karel-m [1] "I am not sure whether DESTDIR concept make sense for MS Windows paths. For example: `make -f makefile.mingw DESTDIR=c:\builddir\ PREFIX=c:\installdir` means that `"$(DESTDIR)$(PREFIX)\bin"` will expand to `"c:\builddir\c:\installdir\bin"` which is obviously invalid. I propose reverting `also use DESTDIR in makefile.m{ingw,svc}`." [1] https://github.com/libtom/libtomcrypt/pull/234#issuecomment-310366602 --- makefile.mingw | 23 +++++++++++------------ makefile.msvc | 19 +++++++++---------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 3bfa57176..04ad30b9f 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -15,7 +15,6 @@ # #The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs -DESTDIR = PREFIX = c:\mingw CC = gcc AR = ar @@ -264,20 +263,20 @@ clean: #Install the library + headers install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) - cmd /c if not exist "$(DESTDIR)$(PREFIX)\bin" mkdir "$(DESTDIR)$(PREFIX)\bin" - cmd /c if not exist "$(DESTDIR)$(PREFIX)\lib" mkdir "$(DESTDIR)$(PREFIX)\lib" - cmd /c if not exist "$(DESTDIR)$(PREFIX)\include" mkdir "$(DESTDIR)$(PREFIX)\include" - copy /Y $(LIBMAIN_S) "$(DESTDIR)$(PREFIX)\lib" - copy /Y $(LIBMAIN_I) "$(DESTDIR)$(PREFIX)\lib" - copy /Y $(LIBMAIN_D) "$(DESTDIR)$(PREFIX)\bin" - copy /Y src\headers\tomcrypt*.h "$(DESTDIR)$(PREFIX)\include" + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" + cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" + copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" + copy /Y $(LIBMAIN_I) "$(PREFIX)\lib" + copy /Y $(LIBMAIN_D) "$(PREFIX)\bin" + copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include" #Install useful tools install_bins: hashsum - cmd /c if not exist "$(DESTDIR)$(PREFIX)\bin" mkdir "$(DESTDIR)$(PREFIX)\bin" - copy /Y hashsum.exe "$(DESTDIR)$(PREFIX)\bin" + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + copy /Y hashsum.exe "$(PREFIX)\bin" #Install documentation install_docs: doc/crypt.pdf - cmd /c if not exist "$(DESTDIR)$(PREFIX)\doc" mkdir "$(DESTDIR)$(PREFIX)\doc" - copy /Y doc\crypt.pdf "$(DESTDIR)$(PREFIX)\doc" + cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc" + copy /Y doc\crypt.pdf "$(PREFIX)\doc" diff --git a/makefile.msvc b/makefile.msvc index 4bed361f2..804c85811 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -15,7 +15,6 @@ # #The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs -DESTDIR = PREFIX = c:\devel CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath EXTRALIBS = ../libtommath/tommath.lib @@ -251,18 +250,18 @@ clean: #Install the library + headers install: $(LIBMAIN_S) - cmd /c if not exist "$(DESTDIR)$(PREFIX)\bin" mkdir "$(DESTDIR)$(PREFIX)\bin" - cmd /c if not exist "$(DESTDIR)$(PREFIX)\lib" mkdir "$(DESTDIR)$(PREFIX)\lib" - cmd /c if not exist "$(DESTDIR)$(PREFIX)\include" mkdir "$(DESTDIR)$(PREFIX)\include" - copy /Y $(LIBMAIN_S) "$(DESTDIR)$(PREFIX)\lib" - copy /Y src\headers\tomcrypt*.h "$(DESTDIR)$(PREFIX)\include" + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" + cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" + copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" + copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include" #Install useful tools install_bins: hashsum - cmd /c if not exist "$(DESTDIR)$(PREFIX)\bin" mkdir "$(DESTDIR)$(PREFIX)\bin" - copy /Y hashsum.exe "$(DESTDIR)$(PREFIX)\bin" + cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" + copy /Y hashsum.exe "$(PREFIX)\bin" #Install documentation install_docs: doc/crypt.pdf - cmd /c if not exist "$(DESTDIR)$(PREFIX)\doc" mkdir "$(DESTDIR)$(PREFIX)\doc" - copy /Y doc\crypt.pdf "$(DESTDIR)$(PREFIX)\doc" + cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc" + copy /Y doc\crypt.pdf "$(PREFIX)\doc" From 446fec1bc4a247cd4d029d4ea3a32ea341b0a490 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Thu, 22 Jun 2017 17:13:05 +0200 Subject: [PATCH 0913/1192] refactor switch with default --- src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c | 2 +- src/pk/asn1/der/utctime/der_decode_utctime.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c index e7c7341d4..016a4c2c2 100644 --- a/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c @@ -29,8 +29,8 @@ static int _char_to_int(unsigned char x) case '7': return 7; case '8': return 8; case '9': return 9; + default: return 100; } - return 100; } #define DECODE_V(y, max) do {\ diff --git a/src/pk/asn1/der/utctime/der_decode_utctime.c b/src/pk/asn1/der/utctime/der_decode_utctime.c index 9ab000f67..07fcb8070 100644 --- a/src/pk/asn1/der/utctime/der_decode_utctime.c +++ b/src/pk/asn1/der/utctime/der_decode_utctime.c @@ -28,8 +28,8 @@ static int _char_to_int(unsigned char x) case '7': return 7; case '8': return 8; case '9': return 9; + default: return 100; } - return 100; } #define DECODE_V(y, max) \ From e68d846429c36e6e1b33dfae3034e97c32564695 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Jun 2017 07:57:47 +0200 Subject: [PATCH 0914/1192] hopefully finally fix usage of $(DESTDIR) This closes #232 --- makefile.shared | 4 ++-- makefile.unix | 16 ++++++++-------- makefile_include.mk | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/makefile.shared b/makefile.shared index e4fc10315..3efde7bae 100644 --- a/makefile.shared +++ b/makefile.shared @@ -47,8 +47,8 @@ $(LIBNAME): $(OBJECTS) install: .common_install sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc - install -d $(DESTDIR)/$(LIBPATH)/pkgconfig - install -m 644 libtomcrypt.pc $(DESTDIR)/$(LIBPATH)/pkgconfig/ + install -d $(DESTDIR)$(LIBPATH)/pkgconfig + install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ install_bins: .common_install_bins diff --git a/makefile.unix b/makefile.unix index d3ccc7234..b519cc69c 100644 --- a/makefile.unix +++ b/makefile.unix @@ -272,17 +272,17 @@ clean: #Install the library + headers install: $(LIBMAIN_S) $(HEADERS) - @mkdir -p $(DESTDIR)/$(INCPATH) $(DESTDIR)/$(LIBPATH)/pkgconfig - @cp $(LIBMAIN_S) $(DESTDIR)/$(LIBPATH)/ - @cp $(HEADERS) $(DESTDIR)/$(INCPATH)/ - @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)/$(LIBPATH)/pkgconfig/libtomcrypt.pc + @mkdir -p $(DESTDIR)$(INCPATH) $(DESTDIR)$(LIBPATH)/pkgconfig + @cp $(LIBMAIN_S) $(DESTDIR)$(LIBPATH)/ + @cp $(HEADERS) $(DESTDIR)$(INCPATH)/ + @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc #Install useful tools install_bins: hashsum - @mkdir -p $(DESTDIR)/$(BINPATH) - @cp hashsum $(DESTDIR)/$(BINPATH)/ + @mkdir -p $(DESTDIR)$(BINPATH) + @cp hashsum $(DESTDIR)$(BINPATH)/ #Install documentation install_docs: doc/crypt.pdf - @mkdir -p $(DESTDIR)/$(DATAPATH) - @cp doc/crypt.pdf $(DESTDIR)/$(DATAPATH)/ + @mkdir -p $(DESTDIR)$(DATAPATH) + @cp doc/crypt.pdf $(DESTDIR)$(DATAPATH)/ diff --git a/makefile_include.mk b/makefile_include.mk index 6d1300947..4fe3fd2b5 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -362,18 +362,18 @@ install_all: install install_bins install_docs install_test INSTALL_OPTS ?= -m 644 .common_install: $(LIBNAME) - install -d $(DESTDIR)/$(INCPATH) - install -d $(DESTDIR)/$(LIBPATH) - $(INSTALL_CMD) $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)/$(LIBPATH)/$(LIBNAME) - install -m 644 $(HEADERS) $(DESTDIR)/$(INCPATH) + install -d $(DESTDIR)$(INCPATH) + install -d $(DESTDIR)$(LIBPATH) + $(INSTALL_CMD) $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME) + install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) .common_install_bins: $(USEFUL_DEMOS) - install -d $(BINPATH) - $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(DESTDIR)/$(BINPATH) + install -d $(DESTDIR)$(BINPATH) + $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH) install_docs: doc/crypt.pdf - install -d $(DATAPATH) - install -m 644 doc/crypt.pdf $(DESTDIR)/$(DATAPATH) + install -d $(DESTDIR)$(DATAPATH) + install -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH) install_hooks: for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done From c15d656a232fc605d2b9f4475d774bae7addfd35 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Jun 2017 09:08:42 +0200 Subject: [PATCH 0915/1192] crypt{,.exe} is now ltcrypt{,.exe} --- makefile.unix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile.unix b/makefile.unix index b519cc69c..9aab93b2c 100644 --- a/makefile.unix +++ b/makefile.unix @@ -267,8 +267,8 @@ clean: -@rm -f $(OBJECTS) $(TOBJECTS) -@rm -f $(LIBMAIN_S) -@rm -f demos/*.o *_tv.txt - -@rm -f test tv_gen hashsum crypt small timing - -@rm -f test.exe tv_gen.exe hashsum.exe crypt.exe small.exe timing.exe + -@rm -f test tv_gen hashsum ltcrypt small timing + -@rm -f test.exe tv_gen.exe hashsum.exe ltcrypt.exe small.exe timing.exe #Install the library + headers install: $(LIBMAIN_S) $(HEADERS) From a80d3c00a882f59fe9e129e8966a84f139a411be Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 22 Jun 2017 17:05:40 +0200 Subject: [PATCH 0916/1192] no need for DH_BUF_SIZE --- src/headers/tomcrypt_pk.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 1ff657d35..557c99074 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -183,10 +183,6 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key); /* ---- DH Routines ---- */ #ifdef LTC_MDH -#ifndef DH_BUF_SIZE -#define DH_BUF_SIZE 2100 -#endif - typedef struct { int size; char *name, *base, *prime; From 3cfb2a5e2e1d6fe5e183d5ce3f9f2c3cc7593739 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Jun 2017 14:14:05 +0200 Subject: [PATCH 0917/1192] hide some of the 'new since 1.17' internal functions --- src/headers/tomcrypt_mac.h | 2 ++ src/headers/tomcrypt_pk.h | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index d2e5dfb88..94d4a14e1 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -299,11 +299,13 @@ int ocb3_decrypt_verify_memory(int cipher, int ocb3_test(void); +#ifdef LTC_SOURCE /* internal helper functions */ int ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block); void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen); int ocb3_int_ntz(unsigned long x); void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len); +#endif /* LTC_SOURCE */ #endif /* LTC_OCB3_MODE */ diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 557c99074..392268b61 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -21,6 +21,9 @@ enum { #define PK_MAX_RETRIES 20 int rand_prime(void *N, long len, prng_state *prng, int wprng); + +#ifdef LTC_SOURCE +/* internal helper functions */ int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng); int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng); @@ -36,6 +39,7 @@ typedef struct Oid { } oid_st; int pk_get_oid(int pk, oid_st *st); +#endif /* LTC_SOURCE */ /* ---- RSA ---- */ #ifdef LTC_MRSA @@ -211,7 +215,7 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, unsigned char *out, unsigned long *outlen); #ifdef LTC_SOURCE -/* INTERNAL ONLY - it should be later moved to src/headers/tomcrypt_internal.h */ +/* internal helper functions */ int dh_check_pubkey(dh_key *key); #endif @@ -524,6 +528,9 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, unsigned long *outlen); + +#ifdef LTC_SOURCE +/* internal helper functions */ /* SUBJECT PUBLIC KEY INFO */ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen, unsigned int algorithm, void* public_key, unsigned long public_key_len, @@ -532,6 +539,7 @@ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen int der_decode_subject_public_key_info(const unsigned char *in, unsigned long inlen, unsigned int algorithm, void* public_key, unsigned long* public_key_len, unsigned long parameters_type, ltc_asn1_list* parameters, unsigned long parameters_len); +#endif /* LTC_SOURCE */ /* SET */ #define der_decode_set(in, inlen, list, outlen) der_decode_sequence_ex(in, inlen, list, outlen, 0) @@ -609,8 +617,12 @@ int der_decode_teletex_string(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); int der_length_teletex_string(const unsigned char *octets, unsigned long noctets, unsigned long *outlen); +#ifdef LTC_SOURCE +/* internal helper functions */ int der_teletex_char_encode(int c); int der_teletex_value_decode(int v); +#endif /* LTC_SOURCE */ + /* PRINTABLE STRING */ int der_encode_printable_string(const unsigned char *in, unsigned long inlen, @@ -642,7 +654,10 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, wchar_t *out, unsigned long *outlen); unsigned long der_utf8_charsize(const wchar_t c); +#ifdef LTC_SOURCE +/* internal helper functions */ int der_utf8_valid_char(const wchar_t c); +#endif /* LTC_SOURCE */ int der_length_utf8_string(const wchar_t *in, unsigned long noctets, unsigned long *outlen); From 907d5301ee8200a79c39a3594521d1b81e046306 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 23 Jun 2017 16:46:31 +0200 Subject: [PATCH 0918/1192] update coverity build script to use makefile.unix it seems like the regular makefile is somehow broken... --- coverity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coverity.sh b/coverity.sh index 0c919388b..8f3059628 100755 --- a/coverity.sh +++ b/coverity.sh @@ -16,7 +16,7 @@ myCflags="" myCflags="$myCflags -O2 ${2}" myCflags="$myCflags -pipe -Werror -Wpointer-arith -Winit-self -Wextra -Wall -Wformat -Wformat-security" -CFLAGS="$myCflags" cov-build --dir cov-int make -f makefile -j3 IGNORE_SPEED=1 1>gcc_1.txt +CFLAGS="$myCflags" cov-build --dir cov-int make -f makefile.unix $MAKE_OPTS IGNORE_SPEED=1 1>gcc_1.txt if [ $? -ne 0 ] then From af38b1830eef6f56586c22e15800a2a3f1d37d47 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 26 Jun 2017 14:02:52 +0200 Subject: [PATCH 0919/1192] re-factor size checks in blake2 implementations --- src/hashes/blake2b.c | 4 ++-- src/hashes/blake2s.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 9138d3949..6c34319dd 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -333,14 +333,14 @@ int blake2b_process(hash_state *md, const unsigned char *in, unsigned long inlen LTC_ARGCHK(md != NULL); LTC_ARGCHK(in != NULL); - if (md->blake2b.curlen > sizeof(md->blake2b.buf)) { + if (md->blake2b.curlen >= sizeof(md->blake2b.buf)) { return CRYPT_INVALID_ARG; } if (inlen > 0) { unsigned long left = md->blake2b.curlen; unsigned long fill = BLAKE2B_BLOCKBYTES - left; - if (inlen > fill) { + if (inlen >= fill) { md->blake2b.curlen = 0; XMEMCPY(md->blake2b.buf + left, in, fill); /* Fill buffer */ blake2b_increment_counter(md, BLAKE2B_BLOCKBYTES); diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 9e263243b..a3fdc5637 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -321,14 +321,14 @@ int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen LTC_ARGCHK(md != NULL); LTC_ARGCHK(in != NULL); - if (md->blake2s.curlen > sizeof(md->blake2s.buf)) { + if (md->blake2s.curlen >= sizeof(md->blake2s.buf)) { return CRYPT_INVALID_ARG; } if (inlen > 0) { unsigned long left = md->blake2s.curlen; unsigned long fill = BLAKE2S_BLOCKBYTES - left; - if (inlen > fill) { + if (inlen >= fill) { md->blake2s.curlen = 0; XMEMCPY(md->blake2s.buf + left, in, fill); /* Fill buffer */ blake2s_increment_counter(md, BLAKE2S_BLOCKBYTES); From 1a3880fda538b99eb103efdb1bda2d74bb20c29b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 12:33:40 +0200 Subject: [PATCH 0920/1192] Revert "re-factor size checks in blake2 implementations" This reverts commit af38b1830eef6f56586c22e15800a2a3f1d37d47. --- src/hashes/blake2b.c | 4 ++-- src/hashes/blake2s.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 6c34319dd..9138d3949 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -333,14 +333,14 @@ int blake2b_process(hash_state *md, const unsigned char *in, unsigned long inlen LTC_ARGCHK(md != NULL); LTC_ARGCHK(in != NULL); - if (md->blake2b.curlen >= sizeof(md->blake2b.buf)) { + if (md->blake2b.curlen > sizeof(md->blake2b.buf)) { return CRYPT_INVALID_ARG; } if (inlen > 0) { unsigned long left = md->blake2b.curlen; unsigned long fill = BLAKE2B_BLOCKBYTES - left; - if (inlen >= fill) { + if (inlen > fill) { md->blake2b.curlen = 0; XMEMCPY(md->blake2b.buf + left, in, fill); /* Fill buffer */ blake2b_increment_counter(md, BLAKE2B_BLOCKBYTES); diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index a3fdc5637..9e263243b 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -321,14 +321,14 @@ int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen LTC_ARGCHK(md != NULL); LTC_ARGCHK(in != NULL); - if (md->blake2s.curlen >= sizeof(md->blake2s.buf)) { + if (md->blake2s.curlen > sizeof(md->blake2s.buf)) { return CRYPT_INVALID_ARG; } if (inlen > 0) { unsigned long left = md->blake2s.curlen; unsigned long fill = BLAKE2S_BLOCKBYTES - left; - if (inlen >= fill) { + if (inlen > fill) { md->blake2s.curlen = 0; XMEMCPY(md->blake2s.buf + left, in, fill); /* Fill buffer */ blake2s_increment_counter(md, BLAKE2S_BLOCKBYTES); From f5b8cc9dae1c48b39165226cb47f2ccd1876c625 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 12:35:39 +0200 Subject: [PATCH 0921/1192] this should really implement a patch for the illegal access --- src/hashes/blake2b.c | 2 +- src/hashes/blake2s.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 9138d3949..25242864d 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -342,7 +342,7 @@ int blake2b_process(hash_state *md, const unsigned char *in, unsigned long inlen unsigned long fill = BLAKE2B_BLOCKBYTES - left; if (inlen > fill) { md->blake2b.curlen = 0; - XMEMCPY(md->blake2b.buf + left, in, fill); /* Fill buffer */ + XMEMCPY(md->blake2b.buf + (left % sizeof(md->blake2b.buf)), in, fill); /* Fill buffer */ blake2b_increment_counter(md, BLAKE2B_BLOCKBYTES); blake2b_compress(md, md->blake2b.buf); /* Compress */ in += fill; diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 9e263243b..1cbf597b9 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -330,7 +330,7 @@ int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen unsigned long fill = BLAKE2S_BLOCKBYTES - left; if (inlen > fill) { md->blake2s.curlen = 0; - XMEMCPY(md->blake2s.buf + left, in, fill); /* Fill buffer */ + XMEMCPY(md->blake2s.buf + (left % sizeof(md->blake2s.buf)), in, fill); /* Fill buffer */ blake2s_increment_counter(md, BLAKE2S_BLOCKBYTES); blake2s_compress(md, md->blake2s.buf); /* Compress */ in += fill; From 0a6af8d333a0bc08791094381009ffbb50450bca Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 19:01:56 +0200 Subject: [PATCH 0922/1192] rsa_exptmod(): verify that p and q are valid before going the CRT path --- src/pk/rsa/rsa_exptmod.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index e85be4435..37f62d11b 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -97,9 +97,11 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, } #endif /* LTC_RSA_BLINDING */ - has_crt_parameters = (key->dP != NULL) && (mp_get_digit_count(key->dP) != 0) && - (key->dQ != NULL) && (mp_get_digit_count(key->dQ) != 0) && - (key->qP != NULL) && (mp_get_digit_count(key->qP) != 0); + has_crt_parameters = (key->p != NULL) && (mp_get_digit_count(key->p) != 0) && + (key->q != NULL) && (mp_get_digit_count(key->q) != 0) && + (key->dP != NULL) && (mp_get_digit_count(key->dP) != 0) && + (key->dQ != NULL) && (mp_get_digit_count(key->dQ) != 0) && + (key->qP != NULL) && (mp_get_digit_count(key->qP) != 0); if (!has_crt_parameters) { /* From 00a5212d99e244d21dfa8141f855b8f410df0900 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 12:28:40 +0200 Subject: [PATCH 0923/1192] use ltc_pk_part in rsa_import_radix() --- src/headers/tomcrypt_pk.h | 11 ++++++++++- src/pk/rsa/rsa_import_radix.c | 34 +++++++++++++++++++++++----------- tests/rsa_test.c | 12 ++++++------ 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 392268b61..9674ef08d 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -41,6 +41,15 @@ typedef struct Oid { int pk_get_oid(int pk, oid_st *st); #endif /* LTC_SOURCE */ +typedef struct { + void* p; + unsigned long len; + int radix; +} ltc_pk_part; + +#define PK_PART_HEX(s) &((ltc_pk_part){s, 0, 16}) +#define PK_PART_DEC(s) &((ltc_pk_part){s, 0, 10}) + /* ---- RSA ---- */ #ifdef LTC_MRSA @@ -126,7 +135,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, const void *passwd, unsigned long passwdlen, rsa_key *key); -int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key); +int rsa_import_radix(ltc_pk_part *N, ltc_pk_part *e, ltc_pk_part *d, ltc_pk_part *p, ltc_pk_part *q, ltc_pk_part *dP, ltc_pk_part *dQ, ltc_pk_part *qP, rsa_key *key); #endif /* ---- Katja ---- */ diff --git a/src/pk/rsa/rsa_import_radix.c b/src/pk/rsa/rsa_import_radix.c index 71ab3eac2..73eda644b 100755 --- a/src/pk/rsa/rsa_import_radix.c +++ b/src/pk/rsa/rsa_import_radix.c @@ -25,7 +25,19 @@ #ifdef LTC_MRSA -int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key) +static int _rsa_read_pk_part(void* mpi, ltc_pk_part *p) +{ + int err; + if(p->radix == 256) { + if (p->len != 0) err = mp_read_unsigned_bin(mpi, p->p, p->len); + else err = CRYPT_PK_INVALID_SIZE; + } else { + err = mp_read_radix(mpi, p->p , p->radix); + } + return err; +} + +int rsa_import_radix(ltc_pk_part *N, ltc_pk_part *e, ltc_pk_part *d, ltc_pk_part *p, ltc_pk_part *q, ltc_pk_part *dP, ltc_pk_part *dQ, ltc_pk_part *qP, rsa_key *key) { int err; @@ -37,16 +49,16 @@ int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, cha err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL); if (err != CRYPT_OK) return err; - if ((err = mp_read_radix(key->N , N , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->e , e , radix)) != CRYPT_OK) { goto LBL_ERR; } - if (d && p && q && dP && dQ && qP && strlen(d)>0 && strlen(p)>0 && - strlen(q)>0 && strlen(dP)>0 && strlen(dQ)>0 && strlen(qP)>0) { - if ((err = mp_read_radix(key->d , d , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->p , p , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->q , q , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->dP, dP, radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->dQ, dQ, radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->qP, qP, radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = _rsa_read_pk_part(key->N , N)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = _rsa_read_pk_part(key->e , e)) != CRYPT_OK) { goto LBL_ERR; } + if (d && p && q && dP && dQ && qP && strlen(d->p)>0 && strlen(p->p)>0 && + strlen(q->p)>0 && strlen(dP->p)>0 && strlen(dQ->p)>0 && strlen(qP->p)>0) { + if ((err = _rsa_read_pk_part(key->d , d)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = _rsa_read_pk_part(key->p , p)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = _rsa_read_pk_part(key->q , q)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = _rsa_read_pk_part(key->dP, dP)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = _rsa_read_pk_part(key->dQ, dQ)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = _rsa_read_pk_part(key->qP, qP)) != CRYPT_OK) { goto LBL_ERR; } key->type = PK_PRIVATE; } else { diff --git a/tests/rsa_test.c b/tests/rsa_test.c index c2081f4d5..efa5afcd3 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -112,7 +112,7 @@ static const unsigned char pkcs8_private_rsa[] = { 0xf1, 0x4a, 0x21, 0x56, 0x67, 0xfd, 0xcc, 0x20, 0xa3, 0x8f, 0x78, 0x18, 0x5a, 0x79, 0x3d, 0x2e, 0x8e, 0x7e, 0x86, 0x0a, 0xe6, 0xa8, 0x33, 0xc1, 0x04, 0x17, 0x4a, 0x9f }; -/* private keay - hexadecimal */ +/* private key - hexadecimal */ static char *hex_d = "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881"; static char *hex_dP = "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089"; static char *hex_dQ = "AB9088FA600829509A438BA050CCD85AFE976463717422A320025ACFEBC6169554D1CBAB8D1AC600FA08929C71D552523596714B8B920CD0E9BFAD630BA5E9B1"; @@ -122,7 +122,7 @@ static char *hex_p = "F7BE5E23C3323FBF8B8E3AEEFCFCCBE5F7F10BBC4282AED57A3ECAF7D static char *hex_q = "D6860E85420B0408842160F00E0D88FD1E3610654F1E53B40872805C3F596617E698F2E96C7A064CAC763DED8CA1CEAD1BBDB47D28BCE30E388D99D805B5A371"; static char *hex_qP = "DCCC27C8E4DC6248D59BAFF5AB60F621FD53E2B75D09C91AA104A9FC612C5D04583A5A39F14A215667FDCC20A38F78185A793D2E8E7E860AE6A833C104174A9F"; -/* private keay - decimal */ +/* private key - decimal */ static char *dec_d = "140715588362011445903700789698620706303856890313846506579552319155852306603445626455616876267358538338151320072087950597426668358843246116141391746806252390039505422193715556188330352166601762210959618868365359433828069868584168017348772565936127608284367789455480066115411950431014508224203325089671253575809"; static char *dec_dP = "5757027123463051531073361217943880203685183318942602176865989327630429772398553254013771630974725523559703665512845231173916766336576994271809362147385481"; static char *dec_dQ = "8985566687080619280443708121716583572314829758991088624433980393739288226842152842353421251125477168722728289150354056572727675764519591179919295246625201"; @@ -250,7 +250,7 @@ static int rsa_compat_test(void) rsa_free(&key); /* try import private key from raw hexadecimal numbers */ - DO(rsa_import_radix(16, hex_N, hex_e, hex_d, hex_p, hex_q, hex_dP, hex_dQ, hex_qP, &key)); + DO(rsa_import_radix(PK_PART_HEX(hex_N), PK_PART_HEX(hex_e), PK_PART_HEX(hex_d), PK_PART_HEX(hex_p), PK_PART_HEX(hex_q), PK_PART_HEX(hex_dP), PK_PART_HEX(hex_dQ), PK_PART_HEX(hex_qP), &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { @@ -260,7 +260,7 @@ static int rsa_compat_test(void) rsa_free(&key); /* try import private key from raw decimal numbers */ - DO(rsa_import_radix(10, dec_N, dec_e, dec_d, dec_p, dec_q, dec_dP, dec_dQ, dec_qP, &key)); + DO(rsa_import_radix(PK_PART_DEC(dec_N), PK_PART_DEC(dec_e), PK_PART_DEC(dec_d), PK_PART_DEC(dec_p), PK_PART_DEC(dec_q), PK_PART_DEC(dec_dP), PK_PART_DEC(dec_dQ), PK_PART_DEC(dec_qP), &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { @@ -270,7 +270,7 @@ static int rsa_compat_test(void) rsa_free(&key); /* try import public key from raw hexadecimal numbers */ - DO(rsa_import_radix(16, hex_N, hex_e, NULL, NULL, NULL, NULL, NULL, NULL, &key)); + DO(rsa_import_radix(PK_PART_HEX(hex_N), PK_PART_HEX(hex_e), NULL, NULL, NULL, NULL, NULL, NULL, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { @@ -280,7 +280,7 @@ static int rsa_compat_test(void) rsa_free(&key); /* try import public key from raw decimal numbers */ - DO(rsa_import_radix(10, dec_N, dec_e, NULL, NULL, NULL, NULL, NULL, NULL, &key)); + DO(rsa_import_radix(PK_PART_DEC(dec_N), PK_PART_DEC(dec_e), NULL, NULL, NULL, NULL, NULL, NULL, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { From bfae92e4abd72970a0d46c89c5e6ca1b9fb76dbf Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 12:52:10 +0200 Subject: [PATCH 0924/1192] use compare_testvector() in rsa_test() --- tests/rsa_test.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/tests/rsa_test.c b/tests/rsa_test.c index efa5afcd3..41a88df23 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -206,15 +206,13 @@ static int rsa_compat_test(void) /* now try to export private/public and compare */ len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); - if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { - fprintf(stderr, "RSA private export failed to match OpenSSL output, %lu, %lu\n", len, (unsigned long)sizeof(openssl_private_rsa)); + if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from OpenSSL)", 0)) { return 1; } len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { - fprintf(stderr, "RSA(private) public export failed to match OpenSSL output\n"); + if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from OpenSSL private key)", 0)) { return 1; } rsa_free(&key); @@ -223,8 +221,7 @@ static int rsa_compat_test(void) DO(rsa_import(openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { - fprintf(stderr, "RSA(public) stripped public import failed to match OpenSSL output\n"); + if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from stripped OpenSSL)", 0)) { return 1; } rsa_free(&key); @@ -233,8 +230,7 @@ static int rsa_compat_test(void) DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { - fprintf(stderr, "RSA(public) SSL public import failed to match OpenSSL output\n"); + if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from OpenSSL)", 0)) { return 1; } rsa_free(&key); @@ -243,8 +239,7 @@ static int rsa_compat_test(void) DO(rsa_import_pkcs8(pkcs8_private_rsa, sizeof(pkcs8_private_rsa), NULL, 0, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); - if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { - fprintf(stderr, "RSA private export failed to match rsa_import_pkcs8\n"); + if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from PKCS#8)", 0)) { return 1; } rsa_free(&key); @@ -253,8 +248,7 @@ static int rsa_compat_test(void) DO(rsa_import_radix(PK_PART_HEX(hex_N), PK_PART_HEX(hex_e), PK_PART_HEX(hex_d), PK_PART_HEX(hex_p), PK_PART_HEX(hex_q), PK_PART_HEX(hex_dP), PK_PART_HEX(hex_dQ), PK_PART_HEX(hex_qP), &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); - if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { - fprintf(stderr, "RSA private export failed to match rsa_import_radix(16, ..)\n"); + if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from hex)", 0)) { return 1; } rsa_free(&key); @@ -263,8 +257,7 @@ static int rsa_compat_test(void) DO(rsa_import_radix(PK_PART_DEC(dec_N), PK_PART_DEC(dec_e), PK_PART_DEC(dec_d), PK_PART_DEC(dec_p), PK_PART_DEC(dec_q), PK_PART_DEC(dec_dP), PK_PART_DEC(dec_dQ), PK_PART_DEC(dec_qP), &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); - if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) { - fprintf(stderr, "RSA private export failed to match rsa_import_radix(10, ..)\n"); + if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from dec)", 0)) { return 1; } rsa_free(&key); @@ -273,8 +266,7 @@ static int rsa_compat_test(void) DO(rsa_import_radix(PK_PART_HEX(hex_N), PK_PART_HEX(hex_e), NULL, NULL, NULL, NULL, NULL, NULL, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { - fprintf(stderr, "RSA public export failed to match rsa_import_radix(16, ..)\n"); + if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from hex)", 0)) { return 1; } rsa_free(&key); @@ -283,8 +275,7 @@ static int rsa_compat_test(void) DO(rsa_import_radix(PK_PART_DEC(dec_N), PK_PART_DEC(dec_e), NULL, NULL, NULL, NULL, NULL, NULL, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) { - fprintf(stderr, "RSA public export failed to match rsa_import_radix(10, ..)\n"); + if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from dec)", 0)) { return 1; } rsa_free(&key); From 4afc024f6a9366fc7fc34b026b8190eafaf65547 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 20 Jun 2017 12:52:31 +0200 Subject: [PATCH 0925/1192] also test binary import --- src/headers/tomcrypt_pk.h | 5 +++-- tests/rsa_test.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 9674ef08d..58bbefdbe 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -47,8 +47,9 @@ typedef struct { int radix; } ltc_pk_part; -#define PK_PART_HEX(s) &((ltc_pk_part){s, 0, 16}) -#define PK_PART_DEC(s) &((ltc_pk_part){s, 0, 10}) +#define PK_PART_HEX(s) &((ltc_pk_part){s, 0, 16}) +#define PK_PART_DEC(d) &((ltc_pk_part){d, 0, 10}) +#define PK_PART_BIN(b, l) &((ltc_pk_part){b, l, 256}) /* ---- RSA ---- */ #ifdef LTC_MRSA diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 41a88df23..25828d488 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -181,6 +181,7 @@ static int rsa_compat_test(void) { rsa_key key, pubkey; int stat; + void* mpi; unsigned char buf[1024]; unsigned long len; @@ -280,6 +281,20 @@ static int rsa_compat_test(void) } rsa_free(&key); + /* try import public key from mixed numbers */ + DO(mp_init(&mpi)); + DO(mp_read_radix(mpi, dec_N, 10)); + DO(mp_to_unsigned_bin(mpi, buf)); + len = mp_unsigned_bin_size(mpi); + DO(rsa_import_radix(PK_PART_BIN(buf, len), PK_PART_DEC(dec_e), NULL, NULL, NULL, NULL, NULL, NULL, &key)); + mp_clear(mpi); + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PUBLIC, &key)); + if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from mixed)", 0)) { + return 1; + } + rsa_free(&key); + /* try export in SubjectPublicKeyInfo format of the public key */ DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key)); len = sizeof(buf); From 083e8af78bbb6b05949825d6f0a46913966529ab Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 16:30:02 +0200 Subject: [PATCH 0926/1192] Revert "also test binary import" This reverts commit 8b6f8c8cce325fa1ce3b61805aa80cdabc1826b4. --- src/headers/tomcrypt_pk.h | 5 ++--- tests/rsa_test.c | 15 --------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 58bbefdbe..9674ef08d 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -47,9 +47,8 @@ typedef struct { int radix; } ltc_pk_part; -#define PK_PART_HEX(s) &((ltc_pk_part){s, 0, 16}) -#define PK_PART_DEC(d) &((ltc_pk_part){d, 0, 10}) -#define PK_PART_BIN(b, l) &((ltc_pk_part){b, l, 256}) +#define PK_PART_HEX(s) &((ltc_pk_part){s, 0, 16}) +#define PK_PART_DEC(s) &((ltc_pk_part){s, 0, 10}) /* ---- RSA ---- */ #ifdef LTC_MRSA diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 25828d488..41a88df23 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -181,7 +181,6 @@ static int rsa_compat_test(void) { rsa_key key, pubkey; int stat; - void* mpi; unsigned char buf[1024]; unsigned long len; @@ -281,20 +280,6 @@ static int rsa_compat_test(void) } rsa_free(&key); - /* try import public key from mixed numbers */ - DO(mp_init(&mpi)); - DO(mp_read_radix(mpi, dec_N, 10)); - DO(mp_to_unsigned_bin(mpi, buf)); - len = mp_unsigned_bin_size(mpi); - DO(rsa_import_radix(PK_PART_BIN(buf, len), PK_PART_DEC(dec_e), NULL, NULL, NULL, NULL, NULL, NULL, &key)); - mp_clear(mpi); - len = sizeof(buf); - DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from mixed)", 0)) { - return 1; - } - rsa_free(&key); - /* try export in SubjectPublicKeyInfo format of the public key */ DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key)); len = sizeof(buf); From 05e9f0ee798623e1cc79b835fe026066e10d5dff Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 16:30:05 +0200 Subject: [PATCH 0927/1192] Revert "use ltc_pk_part in rsa_import_radix()" This reverts commit 023e4a2c23641d852cf47000948fa29a53249457. --- src/headers/tomcrypt_pk.h | 11 +---------- src/pk/rsa/rsa_import_radix.c | 34 +++++++++++----------------------- tests/rsa_test.c | 12 ++++++------ 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 9674ef08d..392268b61 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -41,15 +41,6 @@ typedef struct Oid { int pk_get_oid(int pk, oid_st *st); #endif /* LTC_SOURCE */ -typedef struct { - void* p; - unsigned long len; - int radix; -} ltc_pk_part; - -#define PK_PART_HEX(s) &((ltc_pk_part){s, 0, 16}) -#define PK_PART_DEC(s) &((ltc_pk_part){s, 0, 10}) - /* ---- RSA ---- */ #ifdef LTC_MRSA @@ -135,7 +126,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, const void *passwd, unsigned long passwdlen, rsa_key *key); -int rsa_import_radix(ltc_pk_part *N, ltc_pk_part *e, ltc_pk_part *d, ltc_pk_part *p, ltc_pk_part *q, ltc_pk_part *dP, ltc_pk_part *dQ, ltc_pk_part *qP, rsa_key *key); +int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key); #endif /* ---- Katja ---- */ diff --git a/src/pk/rsa/rsa_import_radix.c b/src/pk/rsa/rsa_import_radix.c index 73eda644b..71ab3eac2 100755 --- a/src/pk/rsa/rsa_import_radix.c +++ b/src/pk/rsa/rsa_import_radix.c @@ -25,19 +25,7 @@ #ifdef LTC_MRSA -static int _rsa_read_pk_part(void* mpi, ltc_pk_part *p) -{ - int err; - if(p->radix == 256) { - if (p->len != 0) err = mp_read_unsigned_bin(mpi, p->p, p->len); - else err = CRYPT_PK_INVALID_SIZE; - } else { - err = mp_read_radix(mpi, p->p , p->radix); - } - return err; -} - -int rsa_import_radix(ltc_pk_part *N, ltc_pk_part *e, ltc_pk_part *d, ltc_pk_part *p, ltc_pk_part *q, ltc_pk_part *dP, ltc_pk_part *dQ, ltc_pk_part *qP, rsa_key *key) +int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key) { int err; @@ -49,16 +37,16 @@ int rsa_import_radix(ltc_pk_part *N, ltc_pk_part *e, ltc_pk_part *d, ltc_pk_part err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL); if (err != CRYPT_OK) return err; - if ((err = _rsa_read_pk_part(key->N , N)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = _rsa_read_pk_part(key->e , e)) != CRYPT_OK) { goto LBL_ERR; } - if (d && p && q && dP && dQ && qP && strlen(d->p)>0 && strlen(p->p)>0 && - strlen(q->p)>0 && strlen(dP->p)>0 && strlen(dQ->p)>0 && strlen(qP->p)>0) { - if ((err = _rsa_read_pk_part(key->d , d)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = _rsa_read_pk_part(key->p , p)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = _rsa_read_pk_part(key->q , q)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = _rsa_read_pk_part(key->dP, dP)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = _rsa_read_pk_part(key->dQ, dQ)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = _rsa_read_pk_part(key->qP, qP)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->N , N , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->e , e , radix)) != CRYPT_OK) { goto LBL_ERR; } + if (d && p && q && dP && dQ && qP && strlen(d)>0 && strlen(p)>0 && + strlen(q)>0 && strlen(dP)>0 && strlen(dQ)>0 && strlen(qP)>0) { + if ((err = mp_read_radix(key->d , d , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->p , p , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->q , q , radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->dP, dP, radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->dQ, dQ, radix)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->qP, qP, radix)) != CRYPT_OK) { goto LBL_ERR; } key->type = PK_PRIVATE; } else { diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 41a88df23..72d993520 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -112,7 +112,7 @@ static const unsigned char pkcs8_private_rsa[] = { 0xf1, 0x4a, 0x21, 0x56, 0x67, 0xfd, 0xcc, 0x20, 0xa3, 0x8f, 0x78, 0x18, 0x5a, 0x79, 0x3d, 0x2e, 0x8e, 0x7e, 0x86, 0x0a, 0xe6, 0xa8, 0x33, 0xc1, 0x04, 0x17, 0x4a, 0x9f }; -/* private key - hexadecimal */ +/* private keay - hexadecimal */ static char *hex_d = "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881"; static char *hex_dP = "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089"; static char *hex_dQ = "AB9088FA600829509A438BA050CCD85AFE976463717422A320025ACFEBC6169554D1CBAB8D1AC600FA08929C71D552523596714B8B920CD0E9BFAD630BA5E9B1"; @@ -122,7 +122,7 @@ static char *hex_p = "F7BE5E23C3323FBF8B8E3AEEFCFCCBE5F7F10BBC4282AED57A3ECAF7D static char *hex_q = "D6860E85420B0408842160F00E0D88FD1E3610654F1E53B40872805C3F596617E698F2E96C7A064CAC763DED8CA1CEAD1BBDB47D28BCE30E388D99D805B5A371"; static char *hex_qP = "DCCC27C8E4DC6248D59BAFF5AB60F621FD53E2B75D09C91AA104A9FC612C5D04583A5A39F14A215667FDCC20A38F78185A793D2E8E7E860AE6A833C104174A9F"; -/* private key - decimal */ +/* private keay - decimal */ static char *dec_d = "140715588362011445903700789698620706303856890313846506579552319155852306603445626455616876267358538338151320072087950597426668358843246116141391746806252390039505422193715556188330352166601762210959618868365359433828069868584168017348772565936127608284367789455480066115411950431014508224203325089671253575809"; static char *dec_dP = "5757027123463051531073361217943880203685183318942602176865989327630429772398553254013771630974725523559703665512845231173916766336576994271809362147385481"; static char *dec_dQ = "8985566687080619280443708121716583572314829758991088624433980393739288226842152842353421251125477168722728289150354056572727675764519591179919295246625201"; @@ -245,7 +245,7 @@ static int rsa_compat_test(void) rsa_free(&key); /* try import private key from raw hexadecimal numbers */ - DO(rsa_import_radix(PK_PART_HEX(hex_N), PK_PART_HEX(hex_e), PK_PART_HEX(hex_d), PK_PART_HEX(hex_p), PK_PART_HEX(hex_q), PK_PART_HEX(hex_dP), PK_PART_HEX(hex_dQ), PK_PART_HEX(hex_qP), &key)); + DO(rsa_import_radix(16, hex_N, hex_e, hex_d, hex_p, hex_q, hex_dP, hex_dQ, hex_qP, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from hex)", 0)) { @@ -254,7 +254,7 @@ static int rsa_compat_test(void) rsa_free(&key); /* try import private key from raw decimal numbers */ - DO(rsa_import_radix(PK_PART_DEC(dec_N), PK_PART_DEC(dec_e), PK_PART_DEC(dec_d), PK_PART_DEC(dec_p), PK_PART_DEC(dec_q), PK_PART_DEC(dec_dP), PK_PART_DEC(dec_dQ), PK_PART_DEC(dec_qP), &key)); + DO(rsa_import_radix(10, dec_N, dec_e, dec_d, dec_p, dec_q, dec_dP, dec_dQ, dec_qP, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from dec)", 0)) { @@ -263,7 +263,7 @@ static int rsa_compat_test(void) rsa_free(&key); /* try import public key from raw hexadecimal numbers */ - DO(rsa_import_radix(PK_PART_HEX(hex_N), PK_PART_HEX(hex_e), NULL, NULL, NULL, NULL, NULL, NULL, &key)); + DO(rsa_import_radix(16, hex_N, hex_e, NULL, NULL, NULL, NULL, NULL, NULL, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from hex)", 0)) { @@ -272,7 +272,7 @@ static int rsa_compat_test(void) rsa_free(&key); /* try import public key from raw decimal numbers */ - DO(rsa_import_radix(PK_PART_DEC(dec_N), PK_PART_DEC(dec_e), NULL, NULL, NULL, NULL, NULL, NULL, &key)); + DO(rsa_import_radix(10, dec_N, dec_e, NULL, NULL, NULL, NULL, NULL, NULL, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from dec)", 0)) { From 6b798ca6a6175773df08ccd54241d0e4d5c4719b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 17:44:19 +0200 Subject: [PATCH 0928/1192] replace rsa_import_radix() by rsa_set_{key,factors,crt_params}() --- src/headers/tomcrypt_pk.h | 13 +++- src/pk/rsa/rsa_import_radix.c | 66 ----------------- src/pk/rsa/rsa_set.c | 134 ++++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+), 67 deletions(-) delete mode 100755 src/pk/rsa/rsa_import_radix.c create mode 100755 src/pk/rsa/rsa_set.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 392268b61..9adb3895b 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -126,7 +126,18 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key); int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, const void *passwd, unsigned long passwdlen, rsa_key *key); -int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key); + +int rsa_set_key(const unsigned char *N, unsigned long Nlen, + const unsigned char *e, unsigned long elen, + const unsigned char *d, unsigned long dlen, /* is NULL for public keys */ + rsa_key *key); +int rsa_set_factors(const unsigned char *p, unsigned long plen, + const unsigned char *q, unsigned long qlen, + rsa_key *key); +int rsa_set_crt_params(const unsigned char *dP, unsigned long dPlen, + const unsigned char *dQ, unsigned long dQlen, + const unsigned char *qP, unsigned long qPlen, + rsa_key *key); #endif /* ---- Katja ---- */ diff --git a/src/pk/rsa/rsa_import_radix.c b/src/pk/rsa/rsa_import_radix.c deleted file mode 100755 index 71ab3eac2..000000000 --- a/src/pk/rsa/rsa_import_radix.c +++ /dev/null @@ -1,66 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ -#include "tomcrypt.h" - -/** - Import RSA public or private key from raw numbers - @param radix the radix the numbers are represented in (2-64, 16 = hexadecimal) - @param N RSA's N in radix representation - @param e RSA's e in radix representation - @param d RSA's d in radix representation (only private key, NULL for public key) - @param p RSA's p in radix representation (only private key, NULL for public key) - @param q RSA's q in radix representation (only private key, NULL for public key) - @param dP RSA's dP in radix representation (only private key, NULL for public key) - @param dQ RSA's dQ in radix representation (only private key, NULL for public key) - @param qP RSA's qP in radix representation (only private key, NULL for public key) - @param key [out] the destination for the imported key - @return CRYPT_OK if successful, upon error allocated memory is freed -*/ - -#ifdef LTC_MRSA - -int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key) -{ - int err; - - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(N != NULL); - LTC_ARGCHK(e != NULL); - LTC_ARGCHK(ltc_mp.name != NULL); - - err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL); - if (err != CRYPT_OK) return err; - - if ((err = mp_read_radix(key->N , N , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->e , e , radix)) != CRYPT_OK) { goto LBL_ERR; } - if (d && p && q && dP && dQ && qP && strlen(d)>0 && strlen(p)>0 && - strlen(q)>0 && strlen(dP)>0 && strlen(dQ)>0 && strlen(qP)>0) { - if ((err = mp_read_radix(key->d , d , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->p , p , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->q , q , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->dP, dP, radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->dQ, dQ, radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->qP, qP, radix)) != CRYPT_OK) { goto LBL_ERR; } - key->type = PK_PRIVATE; - } - else { - key->type = PK_PUBLIC; - } - return CRYPT_OK; - -LBL_ERR: - mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); - return err; -} - -#endif /* LTC_MRSA */ - -/* ref: $Format:%D$ */ -/* git commit: $Format:%H$ */ -/* commit time: $Format:%ai$ */ diff --git a/src/pk/rsa/rsa_set.c b/src/pk/rsa/rsa_set.c new file mode 100755 index 000000000..c45432063 --- /dev/null +++ b/src/pk/rsa/rsa_set.c @@ -0,0 +1,134 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include "tomcrypt.h" + + +#ifdef LTC_MRSA + +/** + Import RSA key from raw numbers + + @param N RSA's N + @param Nlen RSA's N's length + @param e RSA's e + @param elen RSA's e's length + @param d RSA's d (only private key, NULL for public key) + @param dlen RSA's d's length + @param key [out] the destination for the imported key + @return CRYPT_OK if successful +*/ +int rsa_set_key(const unsigned char *N, unsigned long Nlen, + const unsigned char *e, unsigned long elen, + const unsigned char *d, unsigned long dlen, /* is NULL for public keys */ + rsa_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(N != NULL); + LTC_ARGCHK(e != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL); + if (err != CRYPT_OK) return err; + + if ((err = mp_read_unsigned_bin(key->N , (unsigned char *)N , Nlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->e , (unsigned char *)e , elen)) != CRYPT_OK) { goto LBL_ERR; } + if (d && dlen) { + if ((err = mp_read_unsigned_bin(key->d , (unsigned char *)d , dlen)) != CRYPT_OK) { goto LBL_ERR; } + key->type = PK_PRIVATE; + } + else { + key->type = PK_PUBLIC; + } + return CRYPT_OK; + +LBL_ERR: + rsa_free(key); + return err; +} + +/** + Import factors of an RSA key from raw numbers + + Only for private keys. + + @param p RSA's p + @param plen RSA's p's length + @param q RSA's q + @param qlen RSA's q's length + @param key [out] the destination for the imported key + @return CRYPT_OK if successful +*/ +int rsa_set_factors(const unsigned char *p, unsigned long plen, + const unsigned char *q, unsigned long qlen, + rsa_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(p != NULL); + LTC_ARGCHK(q != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + if (key->type != PK_PRIVATE) return CRYPT_PK_TYPE_MISMATCH; + + if ((err = mp_read_unsigned_bin(key->p , (unsigned char *)p , plen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->q , (unsigned char *)q , qlen)) != CRYPT_OK) { goto LBL_ERR; } + return CRYPT_OK; + +LBL_ERR: + rsa_free(key); + return err; +} + +/** + Import CRT parameters of an RSA key from raw numbers + + Only for private keys. + + @param dP RSA's dP + @param dPlen RSA's dP's length + @param dQ RSA's dQ + @param dQlen RSA's dQ's length + @param qP RSA's qP + @param qPlen RSA's qP's length + @param key [out] the destination for the imported key + @return CRYPT_OK if successful +*/ +int rsa_set_crt_params(const unsigned char *dP, unsigned long dPlen, + const unsigned char *dQ, unsigned long dQlen, + const unsigned char *qP, unsigned long qPlen, + rsa_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(dP != NULL); + LTC_ARGCHK(dQ != NULL); + LTC_ARGCHK(qP != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + if (key->type != PK_PRIVATE) return CRYPT_PK_TYPE_MISMATCH; + + if ((err = mp_read_unsigned_bin(key->dP, (unsigned char *)dP, dPlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->dQ, (unsigned char *)dQ, dQlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->qP, (unsigned char *)qP, qPlen)) != CRYPT_OK) { goto LBL_ERR; } + return CRYPT_OK; + +LBL_ERR: + rsa_free(key); + return err; +} + +#endif /* LTC_MRSA */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ From 627f6696cb0cae453e89355aba96b03f94c240c7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 17:44:33 +0200 Subject: [PATCH 0929/1192] add radix_to_bin() --- src/headers/tomcrypt_math.h | 2 ++ src/math/radix_to_bin.c | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 src/math/radix_to_bin.c diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 4332e5bb5..3fa74f2de 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -30,6 +30,8 @@ #define LTC_MILLER_RABIN_REPS 35 #endif +int radix_to_bin(const void *in, int radix, void *out, size_t* len); + /** math descriptor */ typedef struct { /** Name of the math provider */ diff --git a/src/math/radix_to_bin.c b/src/math/radix_to_bin.c new file mode 100644 index 000000000..74869193e --- /dev/null +++ b/src/math/radix_to_bin.c @@ -0,0 +1,55 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include "tomcrypt.h" + +/** + @file radix_to_bin.c + Convert an MPI from a specific radix to binary data. + Steffen Jaeckel +*/ + +/** + Convert an MPI from a specific radix to binary data + + @param in The input + @param radix The radix of the input + @param out The output buffer + @param len [in/out] The length of the output buffer + + @return CRYPT_OK on success. +*/ +int radix_to_bin(const void *in, int radix, void *out, size_t* len) +{ + size_t l; + void* mpi; + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(len != NULL); + + if ((err = mp_init(&mpi)) != CRYPT_OK) return err; + if ((err = mp_read_radix(mpi, in, radix)) != CRYPT_OK) goto LBL_ERR; + + if ((l = mp_unsigned_bin_size(mpi)) > *len) { + *len = l; + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_ERR; + } + *len = l; + + if ((err = mp_to_unsigned_bin(mpi, out)) != CRYPT_OK) goto LBL_ERR; + +LBL_ERR: + mp_clear(mpi); + return err; +} + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ From ae7d4d294747ee17f24684cb87a4dae1206f179a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 17:52:30 +0200 Subject: [PATCH 0930/1192] re-factor rsa_test() to new rsa_set_X() API --- tests/rsa_test.c | 95 +++++++++++++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 34 deletions(-) diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 72d993520..57d94576d 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -112,25 +112,37 @@ static const unsigned char pkcs8_private_rsa[] = { 0xf1, 0x4a, 0x21, 0x56, 0x67, 0xfd, 0xcc, 0x20, 0xa3, 0x8f, 0x78, 0x18, 0x5a, 0x79, 0x3d, 0x2e, 0x8e, 0x7e, 0x86, 0x0a, 0xe6, 0xa8, 0x33, 0xc1, 0x04, 0x17, 0x4a, 0x9f }; -/* private keay - hexadecimal */ -static char *hex_d = "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881"; -static char *hex_dP = "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089"; -static char *hex_dQ = "AB9088FA600829509A438BA050CCD85AFE976463717422A320025ACFEBC6169554D1CBAB8D1AC600FA08929C71D552523596714B8B920CD0E9BFAD630BA5E9B1"; -static char *hex_e = "010001"; -static char *hex_N = "CF9ADE648ADAC83320A9D783311954B29A85A7A1B77533B6A9AC8424B3DEDB7D852D9665E53F7295249F2868CA4FDB441C3E60128ADD26A5EBFF0B5ED48838492A6E5BBF123747BD056BBCDBF3EEE4118E41687C6113D742C880BE368FDC088B4FACA4E2760CC9636C495893EDCCAADC253B0A603F8B543AC34D31E794A444FD"; -static char *hex_p = "F7BE5E23C3323FBF8B8E3AEEFCFCCBE5F7F10BBC4282AED57A3ECAF7D5693F6425A21FB77575059242EBB8F1F30A05E394D1557835A036A09B7C92846CDDDC4D"; -static char *hex_q = "D6860E85420B0408842160F00E0D88FD1E3610654F1E53B40872805C3F596617E698F2E96C7A064CAC763DED8CA1CEAD1BBDB47D28BCE30E388D99D805B5A371"; -static char *hex_qP = "DCCC27C8E4DC6248D59BAFF5AB60F621FD53E2B75D09C91AA104A9FC612C5D04583A5A39F14A215667FDCC20A38F78185A793D2E8E7E860AE6A833C104174A9F"; - -/* private keay - decimal */ -static char *dec_d = "140715588362011445903700789698620706303856890313846506579552319155852306603445626455616876267358538338151320072087950597426668358843246116141391746806252390039505422193715556188330352166601762210959618868365359433828069868584168017348772565936127608284367789455480066115411950431014508224203325089671253575809"; -static char *dec_dP = "5757027123463051531073361217943880203685183318942602176865989327630429772398553254013771630974725523559703665512845231173916766336576994271809362147385481"; -static char *dec_dQ = "8985566687080619280443708121716583572314829758991088624433980393739288226842152842353421251125477168722728289150354056572727675764519591179919295246625201"; -static char *dec_e = "65537"; -static char *dec_N = "145785157837445763858971808379627955816432214431353481009581718367907499729204464589803079767521523397316119124291441688063985017444589154155338311524887989148444674974298105211582428885045820631376256167593861203305479546421254276833052913791538765775697977909548553897629170045372476652935456198173974086909"; -static char *dec_p = "12975386429272921390465467849934248466500992474501042673679976015025637113752114471707151502138750486193421113099777767227628554763059580218432153760685133"; -static char *dec_q = "11235515692122231999359687466333538198133993435121038200055897831921312127192760781281669977582095991578071163376390471936482431583372835883432943212143473"; -static char *dec_qP = "11564102464723136702427739477324729528451027211272900753079601723449664482225846595388433622640284454614991112736446376964904474099700895632145077333609119"; +/* private key - hexadecimal */ +enum { + pk_d , + pk_dP, + pk_dQ, + pk_e , + pk_N , + pk_p , + pk_q , + pk_qP, +}; +static const char *hex_key[] = { + "C862B9EADE44531D5697D9979E1ACF301E0A8845862930A34D9F616573E0D6878FB6F306A382DC7CACFE9B289AAEFDFBFE2F0ED89704E3BB1FD1EC0DBAA3497F47AC8A44047E86B739423FAD1EB70EA551F440631EFDBDEA9F419FA8901D6F0A5A9513110D80AF5F64988A2C786865B02B8BA25387CAF16404ABF27BDB83C881", + "6DEBC32D2EF05EA488310529008AD195299B83CF75DB31E37A27DE3A74300C764CD4502A402D39D99963A95D80AE53CA943F05231EF80504E1B835F217B3A089", + "AB9088FA600829509A438BA050CCD85AFE976463717422A320025ACFEBC6169554D1CBAB8D1AC600FA08929C71D552523596714B8B920CD0E9BFAD630BA5E9B1", + "010001", + "CF9ADE648ADAC83320A9D783311954B29A85A7A1B77533B6A9AC8424B3DEDB7D852D9665E53F7295249F2868CA4FDB441C3E60128ADD26A5EBFF0B5ED48838492A6E5BBF123747BD056BBCDBF3EEE4118E41687C6113D742C880BE368FDC088B4FACA4E2760CC9636C495893EDCCAADC253B0A603F8B543AC34D31E794A444FD", + "F7BE5E23C3323FBF8B8E3AEEFCFCCBE5F7F10BBC4282AED57A3ECAF7D5693F6425A21FB77575059242EBB8F1F30A05E394D1557835A036A09B7C92846CDDDC4D", + "D6860E85420B0408842160F00E0D88FD1E3610654F1E53B40872805C3F596617E698F2E96C7A064CAC763DED8CA1CEAD1BBDB47D28BCE30E388D99D805B5A371", + "DCCC27C8E4DC6248D59BAFF5AB60F621FD53E2B75D09C91AA104A9FC612C5D04583A5A39F14A215667FDCC20A38F78185A793D2E8E7E860AE6A833C104174A9F" }; + +/* private key - decimal */ +static const char *dec_key[] = { + "140715588362011445903700789698620706303856890313846506579552319155852306603445626455616876267358538338151320072087950597426668358843246116141391746806252390039505422193715556188330352166601762210959618868365359433828069868584168017348772565936127608284367789455480066115411950431014508224203325089671253575809", + "5757027123463051531073361217943880203685183318942602176865989327630429772398553254013771630974725523559703665512845231173916766336576994271809362147385481", + "8985566687080619280443708121716583572314829758991088624433980393739288226842152842353421251125477168722728289150354056572727675764519591179919295246625201", + "65537", + "145785157837445763858971808379627955816432214431353481009581718367907499729204464589803079767521523397316119124291441688063985017444589154155338311524887989148444674974298105211582428885045820631376256167593861203305479546421254276833052913791538765775697977909548553897629170045372476652935456198173974086909", + "12975386429272921390465467849934248466500992474501042673679976015025637113752114471707151502138750486193421113099777767227628554763059580218432153760685133", + "11235515692122231999359687466333538198133993435121038200055897831921312127192760781281669977582095991578071163376390471936482431583372835883432943212143473", + "11564102464723136702427739477324729528451027211272900753079601723449664482225846595388433622640284454614991112736446376964904474099700895632145077333609119" }; /*** openssl public RSA key in DER format */ static const unsigned char openssl_public_rsa[] = { @@ -180,9 +192,9 @@ extern const unsigned long _der_tests_cacert_root_cert_size; static int rsa_compat_test(void) { rsa_key key, pubkey; - int stat; - unsigned char buf[1024]; - unsigned long len; + int stat, i; + unsigned char buf[1024], key_parts[8][128]; + unsigned long len, key_lens[8]; /* try reading the key */ DO(rsa_import(openssl_private_rsa, sizeof(openssl_private_rsa), &key)); @@ -244,8 +256,15 @@ static int rsa_compat_test(void) } rsa_free(&key); - /* try import private key from raw hexadecimal numbers */ - DO(rsa_import_radix(16, hex_N, hex_e, hex_d, hex_p, hex_q, hex_dP, hex_dQ, hex_qP, &key)); + /* convert raw hexadecimal numbers to binary */ + for (i = 0; i < 8; ++i) { + key_lens[i] = sizeof(key_parts[i]); + DO(radix_to_bin(hex_key[i], 16, key_parts[i], &key_lens[i])); + } + /* try import private key from converted raw hexadecimal numbers */ + DO(rsa_set_key(key_parts[pk_N], key_lens[pk_N], key_parts[pk_e], key_lens[pk_e], key_parts[pk_d], key_lens[pk_d], &key)); + DO(rsa_set_factors(key_parts[pk_p], key_lens[pk_p], key_parts[pk_q], key_lens[pk_q], &key)); + DO(rsa_set_crt_params(key_parts[pk_dP], key_lens[pk_dP], key_parts[pk_dQ], key_lens[pk_dQ], key_parts[pk_qP], key_lens[pk_qP], &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from hex)", 0)) { @@ -253,26 +272,34 @@ static int rsa_compat_test(void) } rsa_free(&key); - /* try import private key from raw decimal numbers */ - DO(rsa_import_radix(10, dec_N, dec_e, dec_d, dec_p, dec_q, dec_dP, dec_dQ, dec_qP, &key)); + /* try import public key from converted raw hexadecimal numbers */ + DO(rsa_set_key(key_parts[pk_N], key_lens[pk_N], key_parts[pk_e], key_lens[pk_e], NULL, 0, &key)); len = sizeof(buf); - DO(rsa_export(buf, &len, PK_PRIVATE, &key)); - if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from dec)", 0)) { + DO(rsa_export(buf, &len, PK_PUBLIC, &key)); + if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from hex)", 0)) { return 1; } rsa_free(&key); - /* try import public key from raw hexadecimal numbers */ - DO(rsa_import_radix(16, hex_N, hex_e, NULL, NULL, NULL, NULL, NULL, NULL, &key)); + + /* convert raw decimal numbers to binary */ + for (i = 0; i < 8; ++i) { + key_lens[i] = sizeof(key_parts[i]); + DO(radix_to_bin(dec_key[i], 10, key_parts[i], &key_lens[i])); + } + /* try import private key from converted raw decimal numbers */ + DO(rsa_set_key(key_parts[pk_N], key_lens[pk_N], key_parts[pk_e], key_lens[pk_e], key_parts[pk_d], key_lens[pk_d], &key)); + DO(rsa_set_factors(key_parts[pk_p], key_lens[pk_p], key_parts[pk_q], key_lens[pk_q], &key)); + DO(rsa_set_crt_params(key_parts[pk_dP], key_lens[pk_dP], key_parts[pk_dQ], key_lens[pk_dQ], key_parts[pk_qP], key_lens[pk_qP], &key)); len = sizeof(buf); - DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from hex)", 0)) { + DO(rsa_export(buf, &len, PK_PRIVATE, &key)); + if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from dec)", 0)) { return 1; } rsa_free(&key); - /* try import public key from raw decimal numbers */ - DO(rsa_import_radix(10, dec_N, dec_e, NULL, NULL, NULL, NULL, NULL, NULL, &key)); + /* try import public key from raw converted decimal numbers */ + DO(rsa_set_key(key_parts[pk_N], key_lens[pk_N], key_parts[pk_e], key_lens[pk_e], NULL, 0, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PUBLIC, &key)); if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from dec)", 0)) { From a42f467ff18693898ff8d7e2d9e5b97c338ca633 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 17:52:51 +0200 Subject: [PATCH 0931/1192] Update makefiles --- libtomcrypt_VS2008.vcproj | 10 +++++++--- makefile.mingw | 6 +++--- makefile.msvc | 6 +++--- makefile.unix | 6 +++--- makefile_include.mk | 6 +++--- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 25162404b..831cd068f 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -1311,6 +1311,10 @@ RelativePath="src\math\multi.c" > + + @@ -2327,15 +2331,15 @@ > Date: Thu, 22 Jun 2017 10:21:32 +0200 Subject: [PATCH 0932/1192] dh_make_key_ex dh_export_radix dh_import_radix --- src/headers/tomcrypt_pk.h | 13 ++ src/pk/dh/dh_export_radix.c | 68 ++++++++++ src/pk/dh/dh_import_radix.c | 90 +++++++++++++ src/pk/dh/dh_make_key.c | 52 +++++-- tests/dh_test.c | 261 ++++++++++++++++++++++++++++++++++++ 5 files changed, 474 insertions(+), 10 deletions(-) create mode 100644 src/pk/dh/dh_export_radix.c create mode 100644 src/pk/dh/dh_import_radix.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 9adb3895b..cfa9508dd 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -216,12 +216,25 @@ typedef struct { int dh_get_groupsize(dh_key *key); int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key); +int dh_make_key_ex(prng_state *prng, int wprng, int radix, + void *prime, unsigned long primelen, + void *base, unsigned long baselen, + dh_key *key); int dh_make_key_dhparam(prng_state *prng, int wprng, unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); void dh_free(dh_key *key); int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key); int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); +int dh_export_radix(int radix, + void *out, unsigned long *outlen, + int type, dh_key *key); +int dh_import_radix(int radix, + void *in, unsigned long inlen, + void *prime, unsigned long primelen, + void *base, unsigned long baselen, + int type, dh_key *key); + int dh_shared_secret(dh_key *private_key, dh_key *public_key, unsigned char *out, unsigned long *outlen); diff --git a/src/pk/dh/dh_export_radix.c b/src/pk/dh/dh_export_radix.c new file mode 100644 index 000000000..301fd7f6e --- /dev/null +++ b/src/pk/dh/dh_export_radix.c @@ -0,0 +1,68 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +static unsigned long _count_digits(int radix, void *num) +{ + void *r, *t; + unsigned long digits = 0; + + if (mp_iszero(num) == LTC_MP_YES) return 1; + if (mp_init_multi(&t, &r, NULL) != CRYPT_OK) return 0; + mp_copy(num, t); + mp_set_int(r, radix); + while (mp_iszero(t) == LTC_MP_NO) { + if (mp_div(t, r, t, NULL) != CRYPT_OK) { + mp_clear_multi(t, r, NULL); + return 0; + } + digits++; + } + mp_clear_multi(t, r, NULL); + return digits; +} + +/** + Export a DH key to a binary packet + @param out [out] The destination for the key + @param outlen [in/out] The max size and resulting size of the DH key + @param type Which type of key (PK_PRIVATE or PK_PUBLIC) + @param key The key you wish to export + @return CRYPT_OK if successful +*/ +int dh_export_radix(int radix, void *out, unsigned long *outlen, int type, dh_key *key) +{ + unsigned long len; + void *k; + + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK((radix >= 2 && radix <= 64) || radix == 256); + + k = (type == PK_PRIVATE) ? key->x : key->y; + len = (radix == 256) ? mp_unsigned_bin_size(k) : _count_digits(radix, k) + 1; + + if (*outlen < len) { + *outlen = len; + return CRYPT_BUFFER_OVERFLOW; + } + *outlen = len; + + return (radix == 256) ? mp_to_unsigned_bin(k, out) : mp_toradix(k, out, radix); +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_import_radix.c b/src/pk/dh/dh_import_radix.c new file mode 100644 index 000000000..cbd6c418b --- /dev/null +++ b/src/pk/dh/dh_import_radix.c @@ -0,0 +1,90 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Import a DH key from a binary string + @param in The string to read + @param inlen The length of the input packet + @param type The type of key (PK_PRIVATE or PK_PUBLIC) + @param base The base (generator) in hex string + @param prime The prime in hex string + @param key [out] Where to import the key to + @return CRYPT_OK if successful, on error all allocated memory is freed automatically +*/ +int dh_import_radix(int radix, + void *in, unsigned long inlen, + void *prime, unsigned long primelen, + void *base, unsigned long baselen, + int type, dh_key *key) +{ + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(base != NULL); + LTC_ARGCHK(prime != NULL); + LTC_ARGCHK(key != NULL); + + if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { + goto error; + } + if (radix == 256) { + if ((err = mp_read_unsigned_bin(key->base, base, baselen)) != CRYPT_OK) { goto error; } + if ((err = mp_read_unsigned_bin(key->prime, prime, primelen)) != CRYPT_OK) { goto error; } + } + else { + if ((err = mp_read_radix(key->base, base, radix)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(key->prime, prime, radix)) != CRYPT_OK) { goto error; } + } + + if (type == PK_PRIVATE) { + /* load the x value */ + if (radix == 256) { + if ((err = mp_read_unsigned_bin(key->x, in, inlen)) != CRYPT_OK) { goto error; } + } + else { + if ((err = mp_read_radix(key->x, in, radix)) != CRYPT_OK) { goto error; } + } + /* compute y value */ + if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { goto error; } + key->type = PK_PRIVATE; + } + else { + /* load the y value */ + if (radix == 256) { + if ((err = mp_read_unsigned_bin(key->y, in, inlen)) != CRYPT_OK) { goto error; } + } + else { + if ((err = mp_read_radix(key->y, in, radix)) != CRYPT_OK) { goto error; } + } + key->type = PK_PUBLIC; + mp_clear(key->x); + key->x = NULL; + } + + /* check public key */ + if ((err = dh_check_pubkey(key)) != CRYPT_OK) { + goto error; + } + + return CRYPT_OK; + +error: + mp_clear_multi(key->prime, key->base, key->y, key->x, NULL); + return err; +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_make_key.c b/src/pk/dh/dh_make_key.c index cbaea88bd..96bd3642f 100644 --- a/src/pk/dh/dh_make_key.c +++ b/src/pk/dh/dh_make_key.c @@ -106,6 +106,43 @@ static int _dh_make_key(prng_state *prng, int wprng, void *prime, void *base, dh return err; } +/** + Make a DH key (custom DH group) [private key pair] + @param prng An active PRNG state + @param wprng The index for the PRNG you desire to use + @param prime_hex The prime p (hexadecimal string) + @param base_hex The base g (hexadecimal string) + @param key [out] Where the newly created DH key will be stored + @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. +*/ +int dh_make_key_ex(prng_state *prng, int wprng, int radix, + void *prime, unsigned long primelen, + void *base, unsigned long baselen, + dh_key *key) +{ + void *p, *b; + int err; + + LTC_ARGCHK(prime != NULL); + LTC_ARGCHK(base != NULL); + LTC_ARGCHK((radix >= 2 && radix <= 64) || radix == 256); + + if ((err = mp_init_multi(&p, &b, NULL)) != CRYPT_OK) { return err; } + if (radix == 256) { + if ((err = mp_read_unsigned_bin(b, base, baselen)) != CRYPT_OK) { goto error; } + if ((err = mp_read_unsigned_bin(p, prime, primelen)) != CRYPT_OK) { goto error; } + } + else { + if ((err = mp_read_radix(b, base, radix)) != CRYPT_OK) { goto error; } + if ((err = mp_read_radix(p, prime, radix)) != CRYPT_OK) { goto error; } + } + err = _dh_make_key(prng, wprng, p, b, key); + +error: + mp_clear_multi(p, b, NULL); + return err; +} + /** Make a DH key (use built-in DH groups) [private key pair] @param prng An active PRNG state @@ -116,22 +153,17 @@ static int _dh_make_key(prng_state *prng, int wprng, void *prime, void *base, dh */ int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) { - void *p, *b; - int i, err; + int i; LTC_ARGCHK(groupsize > 0); for (i = 0; (groupsize > ltc_dh_sets[i].size) && (ltc_dh_sets[i].size != 0); i++); if (ltc_dh_sets[i].size == 0) return CRYPT_INVALID_KEYSIZE; - if ((err = mp_init_multi(&p, &b, NULL)) != CRYPT_OK) { return err; } - if ((err = mp_read_radix(b, ltc_dh_sets[i].base, 16)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p, ltc_dh_sets[i].prime, 16)) != CRYPT_OK) { goto error; } - err = _dh_make_key(prng, wprng, p, b, key); - -error: - mp_clear_multi(p, b, NULL); - return err; + return dh_make_key_ex(prng, wprng, 16, + ltc_dh_sets[i].prime, strlen(ltc_dh_sets[i].prime) + 1, + ltc_dh_sets[i].base, strlen(ltc_dh_sets[i].base) + 1, + key); } /** diff --git a/tests/dh_test.c b/tests/dh_test.c index 3374c80e9..5f48ca982 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -147,6 +147,261 @@ static int _dhparam_test(void) return CRYPT_OK; } +static int _radix_test(void) +{ + dh_key k1, k2, k3; + unsigned char buf[DH_BUF_SIZE]; + unsigned long len; + int i; + /* RADIX 16 */ + char *ghex = "2"; + char *phex = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22" + "514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6" + "F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB" + "9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E8603" + "9B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AACAA68FFFFFFFFFFFFFFFF"; + char *xhex = "A6681ADC386CE944C3DED9A7301DCC9C518250E3EDB62F959198F8DC0057DD6FB57ABAFD788198B1"; + char *yhex = "39046632C834418DFA07B3091538B614D1FB5DBB785C0FBEA3B98B295BC0CD076A88D9452141A269" + "E8BAEB1DD654EBA03A5705318D129754CDF4003A8C399240FBB8F162490F6F0DC70E414B6FEE8808" + "6AFAA48E9F3A248EDC093452663D34E0E809D4F6BADBB36F80B6813EBF7C3281B862209E5604BDEA" + "8B8F5F7BFDC3EEB7ADB73048289BCEA0F5A5CDEE7DF91CD1F0BA632F06DBE9BA7EF014B84B02D497" + "CA7D0C60F734752A649DA496946B4E531B30D9F82EDD855636C0B0F2AE232E4186454E8887BB423E" + "32A5A2495EACBA99620ACD03A38345EBB6735E62330A8EE9AA6C8370410F5CD45AF37EE90A0DA95B" + "E96FC939E88FE0BD2CD09FC8F524208C"; + /* RADIX 47 */ + char *gr47 = "2"; + char *pr47 = "F27Mg1SadOFIRbDOJ5dHgHiVF02Z1LHHQ6G5SLG2U8aTdfH1ETk4GARRE7WW99dBUBLb9e2OHFIaSM1A" + "ag2LNNjgYa9I9CjQGJihL3J7A2SGQe8j5Ch8EHMj5jVbAYDiQKhhPhM6Hc56fKS40GUfJkGO7KJ6EXZQ" + "VgbSa2AkPC65F91g0PaYie8AGNVaFKaV9HOQf3ia1iW4i6eCOB9CcBbH7TbQij8AEgjZ0VRBcLKc6UYO" + "1Zc3I2Jc0h1H2HBEH8ONI3OYBbaPV6XhAd8WCc60D0RDBU3H9U7cWL28a0c90XNO0dh5RXEFBbUCE2ZG" + "gh9XQSVIHkVbFIS5F5IGVOkiWAVc9i8BHB2V0UbGW6UdRTZVV"; + char *xr47 = "6bhO7O9NWFRgEMjdU0Y5POj3c1JP15MYEdIg3FO1PEjUY2aGYNSXcaF01R"; + char *yr47 = "3GNPNWEYfKML1cIbI7Cc1Z0O7aQLJgB734dO2i56LLYDdI4gHYk2GAbQH2WI97hNeC7dj3fPEH8I9gV9" + "U323AXj1AJXbFPFIHGOTdC29QUUeH2SSc6NWhfQDDXd5Q5iXCKEAUGX3SKcNFIfVOYJgZCLjfHYQdgOQ" + "GCjKNgbEV7Hj34MU3b79iANX2DbMYfb9iGi78BWH2HYAd7IAhk7U0OYGHKJX1bIUUj1KBLhAUg46GaER" + "G9W3ARMfBCj6kSdDF9TdkWAjWTDj722IeVJERC4bKU2VDFG20kDhCMF985efD1SS8DfXcdCHF1kDUkSA" + "884FHYiFEPkaagQOBQaN9BNaEHNbbd002DCIIX5eMP4HgPJPF"; + /* RADIX 64 */ + char *gr64 = "2"; + char *pr64 = "3//////////yaFsg8XQC8qnCPYYu3S7D4f0au8YcVCT08BlgOx4viYKKe8UOuq1DtlbHcppJf36p0h2c" + "toNnGtJ+4rRMrHmaNaXRLsObv+nlHCGkccD+rh2/zSjlG6j+tkE6lxMecVfQwV915yIn/cIIXcKUpaMp" + "t207oueME/1PZQI3OSLTEQQHO/gFqapr+3PLqZtAEjbXnYyrOWXLAxdjKf1t2Mbcrd33LEIhoO1F5qR0" + "ZA625yCf1UHYuspZlZddSi60w60vidWwBi1wAFjSLTy6zCKidUAylsbLWN63cLINpgbMhb5T8c69Zw1H" + "0LSevQYgogQF//////////"; + char *xr64 = "2cQ1hSE6pfHCFUsQSm7SoSKO9Gu+ssBvMHcFZS05VTRxLwklruWPYn"; + char *yr64 = "v16Ooo3H1ZVe7imaLEBOKqVjTktXS3xwZkOifMy3D1sg8sKKXGQ9fwBhh7TPKww0wLmKnZHANLCtq03g" + "CEP90+xZnOaaFRmt73a5BR+w826hwf8wVEYIEt0aqKcOzDE3e2TJskjkpRu2sWJw/V3A1k68WdbO4lUg" + "BZrzx/SFkjwstC4WecywWzQNDxdtv7D7mkcCl1jlfkdxm5BXB0jINodqCOFSqTIfadQIMb6jEKnimsVW" + "ktOLMDi2myguZBa66HKw8Xxj2FZAbeabUhBgPOWhD0wE3HUksSrvYCmgEwQfiWt113rpKMlD+wGeDgLl" + "fRyavw8/WlIpGdyZr922C"; + /* RADIX 256 */ + unsigned char gbin[] = { 0x02 }; + unsigned char pbin[] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, 0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0x77, 0x2C, 0x18, 0x0E, 0x86, 0x03, 0x9B, 0x27, 0x83, 0xA2, 0xEC, 0x07, 0xA2, 0x8F, + 0xB5, 0xC5, 0x5D, 0xF0, 0x6F, 0x4C, 0x52, 0xC9, 0xDE, 0x2B, 0xCB, 0xF6, 0x95, 0x58, 0x17, 0x18, + 0x39, 0x95, 0x49, 0x7C, 0xEA, 0x95, 0x6A, 0xE5, 0x15, 0xD2, 0x26, 0x18, 0x98, 0xFA, 0x05, 0x10, + 0x15, 0x72, 0x8E, 0x5A, 0x8A, 0xAC, 0xAA, 0x68, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }; + unsigned char xbin[] = { + 0xA6, 0x68, 0x1A, 0xDC, 0x38, 0x6C, 0xE9, 0x44, 0xC3, 0xDE, 0xD9, 0xA7, 0x30, 0x1D, 0xCC, 0x9C, + 0x51, 0x82, 0x50, 0xE3, 0xED, 0xB6, 0x2F, 0x95, 0x91, 0x98, 0xF8, 0xDC, 0x00, 0x57, 0xDD, 0x6F, + 0xB5, 0x7A, 0xBA, 0xFD, 0x78, 0x81, 0x98, 0xB1 + }; + unsigned char ybin[] = { + 0x39, 0x04, 0x66, 0x32, 0xC8, 0x34, 0x41, 0x8D, 0xFA, 0x07, 0xB3, 0x09, 0x15, 0x38, 0xB6, 0x14, + 0xD1, 0xFB, 0x5D, 0xBB, 0x78, 0x5C, 0x0F, 0xBE, 0xA3, 0xB9, 0x8B, 0x29, 0x5B, 0xC0, 0xCD, 0x07, + 0x6A, 0x88, 0xD9, 0x45, 0x21, 0x41, 0xA2, 0x69, 0xE8, 0xBA, 0xEB, 0x1D, 0xD6, 0x54, 0xEB, 0xA0, + 0x3A, 0x57, 0x05, 0x31, 0x8D, 0x12, 0x97, 0x54, 0xCD, 0xF4, 0x00, 0x3A, 0x8C, 0x39, 0x92, 0x40, + 0xFB, 0xB8, 0xF1, 0x62, 0x49, 0x0F, 0x6F, 0x0D, 0xC7, 0x0E,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F5, 0x24, 0x20, 0x8C + }; + + struct { + int radix; + void* g; int glen; + void* p; int plen; + void* x; int xlen; + void* y; int ylen; + } test[4] = { + { 16, ghex, strlen(ghex)+1, phex, strlen(phex)+1, xhex, strlen(xhex)+1, yhex, strlen(yhex)+1 }, + { 47, gr47, strlen(gr47)+1, pr47, strlen(pr47)+1, xr47, strlen(xr47)+1, yr47, strlen(yr47)+1 }, + { 64, gr64, strlen(gr64)+1, pr64, strlen(pr64)+1, xr64, strlen(xr64)+1, yr64, strlen(yr64)+1 }, + { 256, gbin, sizeof(gbin), pbin, sizeof(pbin), xbin, sizeof(xbin), ybin, sizeof(ybin) } + }; + + unsigned char export_private[] = { + 0x30, 0x82, 0x01, 0x3A, 0x02, 0x01, 0x00, 0x03, 0x02, 0x07, 0x80, 0x02, 0x82, 0x01, 0x01, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, + 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, + 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, + 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, + 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, + 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0x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 0x91, 0x98, + 0xF8, 0xDC, 0x00, 0x57, 0xDD, 0x6F, 0xB5, 0x7A, 0xBA, 0xFD, 0x78, 0x81, 0x98, 0xB1 + }; + unsigned char export_public[] = { + 0x30, 0x82, 0x02, 0x13, 0x02, 0x01, 0x00, 0x03, 0x02, 0x07, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, + 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, + 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, + 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, + 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, + 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, + 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, + 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, + 0x83, 0x65, 0x5D,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 0xE0, 0xBD, 0x2C, + 0xD0, 0x9F, 0xC8, 0xF5, 0x24, 0x20, 0x8C + }; + + if (register_prng(&yarrow_desc) == -1) { + printf("Error registering yarrow PRNG\n"); + return CRYPT_ERROR; + } + + for (i = 0; i < 4; i++) { + DO(dh_import_radix(test[i].radix, test[i].x, test[i].xlen, test[i].p, test[i].plen, test[i].g, test[i].glen, PK_PRIVATE, &k1)); + len = sizeof(buf); + DO(dh_export(buf, &len, PK_PRIVATE, &k1)); + if (compare_testvector(buf, len, export_private, sizeof(export_private), "radix_test", i*10 + 0)) { + printf("radix_test: dh_export+PK_PRIVATE mismatch\n"); + dh_free(&k1); + return CRYPT_ERROR; + } + len = sizeof(buf); + DO(dh_export(buf, &len, PK_PUBLIC, &k1)); + if (compare_testvector(buf, len, export_public, sizeof(export_public), "radix_test", i*10 + 1)) { + printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); + dh_free(&k1); + return CRYPT_ERROR; + } + len = sizeof(buf); + DO(dh_export_radix(256, buf, &len, PK_PRIVATE, &k1)); + if (compare_testvector(buf, len, xbin, sizeof(xbin), "radix_test", i*10 + 2)) { + printf("radix_test: dh_export+PK_PRIVATE mismatch\n"); + dh_free(&k1); + return CRYPT_ERROR; + } + len = sizeof(buf); + DO(dh_export_radix(256, buf, &len, PK_PUBLIC, &k1)); + if (compare_testvector(buf, len, ybin, sizeof(ybin), "radix_test", i*10 + 3)) { + printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); + dh_free(&k1); + return CRYPT_ERROR; + } + len = sizeof(buf); + DO(dh_export_radix(47, buf, &len, PK_PRIVATE, &k1)); + if (compare_testvector(buf, len, xr47, strlen(xr47)+1, "radix_test", i*10 + 4)) { + printf("radix_test: dh_export+PK_PRIVATE mismatch\n"); + dh_free(&k1); + return CRYPT_ERROR; + } + len = sizeof(buf); + DO(dh_export_radix(47, buf, &len, PK_PUBLIC, &k1)); + if (compare_testvector(buf, len, yr47, strlen(yr47)+1, "radix_test", i*10 + 5)) { + printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); + dh_free(&k1); + return CRYPT_ERROR; + } + dh_free(&k1); + + DO(dh_import_radix(test[i].radix, test[i].y, test[i].ylen, test[i].p, test[i].plen, test[i].g, test[i].glen, PK_PUBLIC, &k2)); + len = sizeof(buf); + DO(dh_export(buf, &len, PK_PUBLIC, &k2)); + if (compare_testvector(buf, len, export_public, sizeof(export_public), "radix_test", i*10 + 6)) { + printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); + dh_free(&k2); + return CRYPT_ERROR; + } + len = sizeof(buf); + DO(dh_export_radix(256, buf, &len, PK_PUBLIC, &k2)); + if (compare_testvector(buf, len, ybin, sizeof(ybin), "radix_test", i*10 + 7)) { + printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); + dh_free(&k2); + return CRYPT_ERROR; + } + dh_free(&k2); + + DO(dh_make_key_ex(&yarrow_prng, find_prng("yarrow"), test[i].radix, + test[i].p, test[i].plen, test[i].g, test[i].glen, &k3)); + len = mp_unsigned_bin_size(k3.prime); + DO(mp_to_unsigned_bin(k3.prime, buf)); + if (compare_testvector(buf, len, pbin, sizeof(pbin), "radix_test", i*10 + 8)) { + printf("radix_test: dh_make_key_ex prime mismatch\n"); + dh_free(&k3); + return CRYPT_ERROR; + } + len = mp_unsigned_bin_size(k3.base); + DO(mp_to_unsigned_bin(k3.base, buf)); + if (compare_testvector(buf, len, gbin, sizeof(gbin), "radix_test", i*10 + 9)) { + printf("radix_test: dh_make_key_ex base mismatch\n"); + dh_free(&k3); + return CRYPT_ERROR; + } + dh_free(&k3); + } + + return CRYPT_OK; +} + static int _basic_test(void) { unsigned char buf[3][4096]; @@ -216,6 +471,11 @@ static int _basic_test(void) fprintf(stderr, "dh_groupsize mismatch %d %d\n", size, ltc_dh_sets[x].size); return CRYPT_ERROR; } + DO(dh_make_key_ex(&yarrow_prng, find_prng ("yarrow"), 16, + ltc_dh_sets[x].prime, strlen(ltc_dh_sets[x].prime) + 1, + ltc_dh_sets[x].base, strlen(ltc_dh_sets[x].base) + 1, + &usera)); + dh_free(&usera); } return CRYPT_OK; @@ -227,6 +487,7 @@ int dh_test(void) if (_prime_test() != CRYPT_OK) fails++; if (_basic_test() != CRYPT_OK) fails++; if (_dhparam_test() != CRYPT_OK) fails++; + if (_radix_test() != CRYPT_OK) fails++; return fails > 0 ? CRYPT_FAIL_TESTVECTOR : CRYPT_OK; } From b3e535f933bd679a209adcd12d7a134fed5ed88c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 10:21:41 +0200 Subject: [PATCH 0933/1192] update makefiles --- libtomcrypt_VS2008.vcproj | 8 ++++++++ makefile.mingw | 11 ++++++----- makefile.msvc | 11 ++++++----- makefile.unix | 11 ++++++----- makefile_include.mk | 11 ++++++----- 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 831cd068f..8e1bc171f 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2062,6 +2062,10 @@ RelativePath="src\pk\dh\dh_export.c" > + + @@ -2070,6 +2074,10 @@ RelativePath="src\pk\dh\dh_import.c" > + + diff --git a/makefile.mingw b/makefile.mingw index bf6537c8b..1b06823ed 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -160,11 +160,12 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_free.o \ -src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ +src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile.msvc b/makefile.msvc index 673f10250..b70722591 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -153,11 +153,12 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.obj \ src/pk/asn1/der/utctime/der_decode_utctime.obj src/pk/asn1/der/utctime/der_encode_utctime.obj \ src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_utf8_string.obj \ src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \ -src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_free.obj \ -src/pk/dh/dh_import.obj src/pk/dh/dh_make_key.obj src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj \ -src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj \ -src/pk/dsa/dsa_import_radix.obj src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj \ -src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ +src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_export_radix.obj \ +src/pk/dh/dh_free.obj src/pk/dh/dh_import.obj src/pk/dh/dh_import_radix.obj src/pk/dh/dh_make_key.obj \ +src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj src/pk/dsa/dsa_encrypt_key.obj \ +src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj src/pk/dsa/dsa_import_radix.obj \ +src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \ +src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ diff --git a/makefile.unix b/makefile.unix index 617e181ed..394850730 100644 --- a/makefile.unix +++ b/makefile.unix @@ -170,11 +170,12 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_free.o \ -src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ +src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ diff --git a/makefile_include.mk b/makefile_include.mk index 35c974bb5..b194ba3b5 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -276,11 +276,12 @@ src/pk/asn1/der/teletex_string/der_length_teletex_string.o \ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ -src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_free.o \ -src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ -src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_import_radix.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_radix.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_import_radix.o src/pk/dh/dh_make_key.o \ +src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ +src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ From fbc54756c1f86c7b93074a324cc0d0b208e3e058 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 21:53:02 +0200 Subject: [PATCH 0934/1192] replace dh_import_radix() by dh_set_{pg,key} --- src/headers/tomcrypt_pk.h | 15 +++-- src/pk/dh/dh_import_radix.c | 90 ----------------------------- src/pk/dh/dh_set.c | 110 ++++++++++++++++++++++++++++++++++++ tests/dh_test.c | 38 +++++++++++-- 4 files changed, 153 insertions(+), 100 deletions(-) delete mode 100644 src/pk/dh/dh_import_radix.c create mode 100644 src/pk/dh/dh_set.c diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index cfa9508dd..1996cd6b7 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -213,6 +213,8 @@ typedef struct { void *prime; } dh_key; +#define LTC_DH_KEY_INITIALIZER { PK_PUBLIC, NULL, NULL, NULL, NULL } + int dh_get_groupsize(dh_key *key); int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key); @@ -226,14 +228,17 @@ void dh_free(dh_key *key); int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key); int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); +int dh_set_pg(const unsigned char *p, unsigned long plen, + const unsigned char *g, unsigned long glen, + dh_key *key); +/* here we can support either one or both */ +int dh_set_key(const unsigned char *pub, unsigned long publen, + const unsigned char *priv, unsigned long privlen, + dh_key *key); + int dh_export_radix(int radix, void *out, unsigned long *outlen, int type, dh_key *key); -int dh_import_radix(int radix, - void *in, unsigned long inlen, - void *prime, unsigned long primelen, - void *base, unsigned long baselen, - int type, dh_key *key); int dh_shared_secret(dh_key *private_key, dh_key *public_key, unsigned char *out, unsigned long *outlen); diff --git a/src/pk/dh/dh_import_radix.c b/src/pk/dh/dh_import_radix.c deleted file mode 100644 index cbd6c418b..000000000 --- a/src/pk/dh/dh_import_radix.c +++ /dev/null @@ -1,90 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ - -#include "tomcrypt.h" - -#ifdef LTC_MDH - -/** - Import a DH key from a binary string - @param in The string to read - @param inlen The length of the input packet - @param type The type of key (PK_PRIVATE or PK_PUBLIC) - @param base The base (generator) in hex string - @param prime The prime in hex string - @param key [out] Where to import the key to - @return CRYPT_OK if successful, on error all allocated memory is freed automatically -*/ -int dh_import_radix(int radix, - void *in, unsigned long inlen, - void *prime, unsigned long primelen, - void *base, unsigned long baselen, - int type, dh_key *key) -{ - int err; - - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(base != NULL); - LTC_ARGCHK(prime != NULL); - LTC_ARGCHK(key != NULL); - - if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { - goto error; - } - if (radix == 256) { - if ((err = mp_read_unsigned_bin(key->base, base, baselen)) != CRYPT_OK) { goto error; } - if ((err = mp_read_unsigned_bin(key->prime, prime, primelen)) != CRYPT_OK) { goto error; } - } - else { - if ((err = mp_read_radix(key->base, base, radix)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(key->prime, prime, radix)) != CRYPT_OK) { goto error; } - } - - if (type == PK_PRIVATE) { - /* load the x value */ - if (radix == 256) { - if ((err = mp_read_unsigned_bin(key->x, in, inlen)) != CRYPT_OK) { goto error; } - } - else { - if ((err = mp_read_radix(key->x, in, radix)) != CRYPT_OK) { goto error; } - } - /* compute y value */ - if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { goto error; } - key->type = PK_PRIVATE; - } - else { - /* load the y value */ - if (radix == 256) { - if ((err = mp_read_unsigned_bin(key->y, in, inlen)) != CRYPT_OK) { goto error; } - } - else { - if ((err = mp_read_radix(key->y, in, radix)) != CRYPT_OK) { goto error; } - } - key->type = PK_PUBLIC; - mp_clear(key->x); - key->x = NULL; - } - - /* check public key */ - if ((err = dh_check_pubkey(key)) != CRYPT_OK) { - goto error; - } - - return CRYPT_OK; - -error: - mp_clear_multi(key->prime, key->base, key->y, key->x, NULL); - return err; -} - -#endif /* LTC_MDH */ - -/* ref: $Format:%D$ */ -/* git commit: $Format:%H$ */ -/* commit time: $Format:%ai$ */ diff --git a/src/pk/dh/dh_set.c b/src/pk/dh/dh_set.c new file mode 100644 index 000000000..6ca61d0c0 --- /dev/null +++ b/src/pk/dh/dh_set.c @@ -0,0 +1,110 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Import DH key parts p and g from raw numbers + + @param p DH's p (prime) + @param plen DH's p's length + @param g DH's g (group) + @param glen DH's g's length + @param key [out] the destination for the imported key + @return CRYPT_OK if successful +*/ +int dh_set_pg(const unsigned char *p, unsigned long plen, + const unsigned char *g, unsigned long glen, + dh_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x == NULL); + LTC_ARGCHK(key->y == NULL); + LTC_ARGCHK(key->base == NULL); + LTC_ARGCHK(key->prime == NULL); + LTC_ARGCHK(p != NULL); + LTC_ARGCHK(g != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { + return err; + } + + if ((err = mp_read_unsigned_bin(key->base, (unsigned char*)g, glen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->prime, (unsigned char*)p, plen)) != CRYPT_OK) { goto LBL_ERR; } + + return CRYPT_OK; + +LBL_ERR: + dh_free(key); + return err; +} + +/** + Import DH key parts pub and priv from raw numbers + + @param pub DH's pub (public key) (can be NULL if priv is valid) + @param publen DH's pub's length + @param priv DH's priv (private key) (can be NULL if pub is valid) + @param privlen DH's priv's length + @param key [out] the destination for the imported key + @return CRYPT_OK if successful +*/ +int dh_set_key(const unsigned char *pub, unsigned long publen, + const unsigned char *priv, unsigned long privlen, + dh_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x != NULL); + LTC_ARGCHK(key->y != NULL); + LTC_ARGCHK(key->base != NULL); + LTC_ARGCHK(key->prime != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + if(priv == NULL) { + if ((err = mp_read_unsigned_bin(key->y, (unsigned char*)pub, publen)) != CRYPT_OK) { goto LBL_ERR; } + key->type = PK_PUBLIC; + mp_clear(key->x); + key->x = NULL; + } + else { + if ((err = mp_read_unsigned_bin(key->x, (unsigned char*)priv, privlen)) != CRYPT_OK) { goto LBL_ERR; } + if (pub != NULL) { + if ((err = mp_read_unsigned_bin(key->y, (unsigned char*)pub, publen)) != CRYPT_OK) { goto LBL_ERR; } + } + else { + /* compute y value */ + if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { goto LBL_ERR; } + } + key->type = PK_PRIVATE; + } + + /* check public key */ + if ((err = dh_check_pubkey(key)) != CRYPT_OK) { + goto LBL_ERR; + } + + return CRYPT_OK; + +LBL_ERR: + dh_free(key); + return err; +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/dh_test.c b/tests/dh_test.c index 5f48ca982..dae366d1f 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -149,10 +149,12 @@ static int _dhparam_test(void) static int _radix_test(void) { - dh_key k1, k2, k3; - unsigned char buf[DH_BUF_SIZE]; + dh_key k1 = LTC_DH_KEY_INITIALIZER; + dh_key k2 = LTC_DH_KEY_INITIALIZER; + dh_key k3 = LTC_DH_KEY_INITIALIZER; + unsigned char buf[4096]; unsigned long len; - int i; + int i, j; /* RADIX 16 */ char *ghex = "2"; char *phex = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22" @@ -311,6 +313,8 @@ static int _radix_test(void) 0xF3, 0x7E, 0xE9, 0x0A, 0x0D, 0xA9, 0x5B, 0xE9, 0x6F, 0xC9, 0x39, 0xE8, 0x8F, 0xE0, 0xBD, 0x2C, 0xD0, 0x9F, 0xC8, 0xF5, 0x24, 0x20, 0x8C }; + unsigned char key_parts[4][512]; + unsigned long key_lens[4]; if (register_prng(&yarrow_desc) == -1) { printf("Error registering yarrow PRNG\n"); @@ -318,7 +322,23 @@ static int _radix_test(void) } for (i = 0; i < 4; i++) { - DO(dh_import_radix(test[i].radix, test[i].x, test[i].xlen, test[i].p, test[i].plen, test[i].g, test[i].glen, PK_PRIVATE, &k1)); + for (j = 0; j < 4; ++j) { + key_lens[j] = sizeof(key_parts[j]); + } + if(test[i].radix != 256) { + DO(radix_to_bin(test[i].x, test[i].radix, key_parts[0], &key_lens[0])); + DO(radix_to_bin(test[i].y, test[i].radix, key_parts[1], &key_lens[1])); + DO(radix_to_bin(test[i].p, test[i].radix, key_parts[2], &key_lens[2])); + DO(radix_to_bin(test[i].g, test[i].radix, key_parts[3], &key_lens[3])); + + DO(dh_set_pg(key_parts[2], key_lens[2], key_parts[3], key_lens[3], &k1)); + DO(dh_set_key(NULL, 0, key_parts[0], key_lens[0], &k1)); + } + else { + DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k1)); + DO(dh_set_key(NULL, 0, test[i].x, test[i].xlen, &k1)); + } + len = sizeof(buf); DO(dh_export(buf, &len, PK_PRIVATE, &k1)); if (compare_testvector(buf, len, export_private, sizeof(export_private), "radix_test", i*10 + 0)) { @@ -363,7 +383,15 @@ static int _radix_test(void) } dh_free(&k1); - DO(dh_import_radix(test[i].radix, test[i].y, test[i].ylen, test[i].p, test[i].plen, test[i].g, test[i].glen, PK_PUBLIC, &k2)); + if(test[i].radix != 256) { + DO(dh_set_pg(key_parts[2], key_lens[2], key_parts[3], key_lens[3], &k2)); + DO(dh_set_key(key_parts[1], key_lens[1], NULL, 0, &k2)); + } + else { + DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k2)); + DO(dh_set_key(test[i].y, test[i].ylen, NULL, 0, &k2)); + } + len = sizeof(buf); DO(dh_export(buf, &len, PK_PUBLIC, &k2)); if (compare_testvector(buf, len, export_public, sizeof(export_public), "radix_test", i*10 + 6)) { From 9d6689fc086df22cd51fa3d98f9b6f56e77419d0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 21:54:16 +0200 Subject: [PATCH 0935/1192] re-factor dh_make_key() and variants --- demos/timing.c | 9 ++- src/headers/tomcrypt_pk.h | 21 +++---- src/pk/dh/dh_make_key.c | 116 +++----------------------------------- src/pk/dh/dh_set.c | 76 +++++++++++++++++++++++++ tests/dh_test.c | 45 +++++++-------- 5 files changed, 119 insertions(+), 148 deletions(-) diff --git a/demos/timing.c b/demos/timing.c index aa7c9a52c..cb249a52e 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -889,7 +889,7 @@ static void time_katja(void) { fprintf(stderr, "NO Katja\n"); } /* time various DH operations */ static void time_dh(void) { - dh_key key; + dh_key key = LTC_DH_KEY_INITIALIZER; ulong64 t1, t2; unsigned long i, x, y; int err; @@ -898,9 +898,14 @@ static void time_dh(void) for (x = sizes[i=0]; x < 100000; x = sizes[++i]) { t2 = 0; for (y = 0; y < 16; y++) { + if((err = dh_set_pg_groupsize(x, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\ndh_set_pg_groupsize says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + t_start(); t1 = t_read(); - if ((err = dh_make_key(&yarrow_prng, find_prng("yarrow"), x, &key)) != CRYPT_OK) { + if ((err = dh_make_key(&yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) { fprintf(stderr, "\n\ndh_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); } diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 1996cd6b7..fcb74da7e 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -217,32 +217,29 @@ typedef struct { int dh_get_groupsize(dh_key *key); -int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key); -int dh_make_key_ex(prng_state *prng, int wprng, int radix, - void *prime, unsigned long primelen, - void *base, unsigned long baselen, - dh_key *key); -int dh_make_key_dhparam(prng_state *prng, int wprng, unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); -void dh_free(dh_key *key); - int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key); int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); int dh_set_pg(const unsigned char *p, unsigned long plen, const unsigned char *g, unsigned long glen, dh_key *key); -/* here we can support either one or both */ +int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); +int dh_set_pg_groupsize(int groupsize, dh_key *key); + int dh_set_key(const unsigned char *pub, unsigned long publen, const unsigned char *priv, unsigned long privlen, dh_key *key); +int dh_make_key(prng_state *prng, int wprng, dh_key *key); + +int dh_shared_secret(dh_key *private_key, dh_key *public_key, + unsigned char *out, unsigned long *outlen); + +void dh_free(dh_key *key); int dh_export_radix(int radix, void *out, unsigned long *outlen, int type, dh_key *key); -int dh_shared_secret(dh_key *private_key, dh_key *public_key, - unsigned char *out, unsigned long *outlen); - #ifdef LTC_SOURCE /* internal helper functions */ int dh_check_pubkey(dh_key *key); diff --git a/src/pk/dh/dh_make_key.c b/src/pk/dh/dh_make_key.c index 96bd3642f..69eaf3ce2 100644 --- a/src/pk/dh/dh_make_key.c +++ b/src/pk/dh/dh_make_key.c @@ -42,31 +42,25 @@ static int _dh_groupsize_to_keysize(int groupsize) } } -static int _dh_make_key(prng_state *prng, int wprng, void *prime, void *base, dh_key *key) +int dh_make_key(prng_state *prng, int wprng, dh_key *key) { unsigned char *buf; unsigned long keysize; int err, max_iterations = PK_MAX_RETRIES; - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(prng != NULL); - LTC_ARGCHK(prime != NULL); - LTC_ARGCHK(base != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x != NULL); + LTC_ARGCHK(key->y != NULL); + LTC_ARGCHK(key->base != NULL); + LTC_ARGCHK(key->prime != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + LTC_ARGCHK(prng != NULL); /* good prng? */ if ((err = prng_is_valid(wprng)) != CRYPT_OK) { return err; } - /* init big numbers */ - if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { - return err; - } - - /* load the prime and the base */ - if ((err = mp_copy(base, key->base)) != CRYPT_OK) { goto freemp; } - if ((err = mp_copy(prime, key->prime)) != CRYPT_OK) { goto freemp; } - keysize = _dh_groupsize_to_keysize(mp_unsigned_bin_size(key->prime)); if (keysize == 0) { err = CRYPT_INVALID_KEYSIZE; @@ -106,100 +100,6 @@ static int _dh_make_key(prng_state *prng, int wprng, void *prime, void *base, dh return err; } -/** - Make a DH key (custom DH group) [private key pair] - @param prng An active PRNG state - @param wprng The index for the PRNG you desire to use - @param prime_hex The prime p (hexadecimal string) - @param base_hex The base g (hexadecimal string) - @param key [out] Where the newly created DH key will be stored - @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. -*/ -int dh_make_key_ex(prng_state *prng, int wprng, int radix, - void *prime, unsigned long primelen, - void *base, unsigned long baselen, - dh_key *key) -{ - void *p, *b; - int err; - - LTC_ARGCHK(prime != NULL); - LTC_ARGCHK(base != NULL); - LTC_ARGCHK((radix >= 2 && radix <= 64) || radix == 256); - - if ((err = mp_init_multi(&p, &b, NULL)) != CRYPT_OK) { return err; } - if (radix == 256) { - if ((err = mp_read_unsigned_bin(b, base, baselen)) != CRYPT_OK) { goto error; } - if ((err = mp_read_unsigned_bin(p, prime, primelen)) != CRYPT_OK) { goto error; } - } - else { - if ((err = mp_read_radix(b, base, radix)) != CRYPT_OK) { goto error; } - if ((err = mp_read_radix(p, prime, radix)) != CRYPT_OK) { goto error; } - } - err = _dh_make_key(prng, wprng, p, b, key); - -error: - mp_clear_multi(p, b, NULL); - return err; -} - -/** - Make a DH key (use built-in DH groups) [private key pair] - @param prng An active PRNG state - @param wprng The index for the PRNG you desire to use - @param groupsize The size (octets) of used DH group - @param key [out] Where the newly created DH key will be stored - @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. -*/ -int dh_make_key(prng_state *prng, int wprng, int groupsize, dh_key *key) -{ - int i; - - LTC_ARGCHK(groupsize > 0); - - for (i = 0; (groupsize > ltc_dh_sets[i].size) && (ltc_dh_sets[i].size != 0); i++); - if (ltc_dh_sets[i].size == 0) return CRYPT_INVALID_KEYSIZE; - - return dh_make_key_ex(prng, wprng, 16, - ltc_dh_sets[i].prime, strlen(ltc_dh_sets[i].prime) + 1, - ltc_dh_sets[i].base, strlen(ltc_dh_sets[i].base) + 1, - key); -} - -/** - Make a DH key (dhparam data: openssl dhparam -outform DER -out dhparam.der 2048) - @param prng An active PRNG state - @param wprng The index for the PRNG you desire to use - @param dhparam The DH param DER encoded data - @param dhparamlen The length of dhparam data - @param key [out] Where the newly created DH key will be stored - @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. -*/ -int dh_make_key_dhparam(prng_state *prng, int wprng, unsigned char *dhparam, unsigned long dhparamlen, dh_key *key) -{ - void *prime, *base; - int err; - - LTC_ARGCHK(dhparam != NULL); - LTC_ARGCHK(dhparamlen > 0); - - if ((err = mp_init_multi(&prime, &base, NULL)) != CRYPT_OK) { - return err; - } - if ((err = der_decode_sequence_multi(dhparam, dhparamlen, - LTC_ASN1_INTEGER, 1UL, prime, - LTC_ASN1_INTEGER, 1UL, base, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto error; - } - err = _dh_make_key(prng, wprng, prime, base, key); - -error: - mp_clear_multi(prime, base, NULL); - return err; -} - - #endif /* LTC_MDH */ /* ref: $Format:%D$ */ diff --git a/src/pk/dh/dh_set.c b/src/pk/dh/dh_set.c index 6ca61d0c0..820ca22cb 100644 --- a/src/pk/dh/dh_set.c +++ b/src/pk/dh/dh_set.c @@ -50,6 +50,82 @@ int dh_set_pg(const unsigned char *p, unsigned long plen, return err; } +/** + Import DH key parts p and g from dhparam + + dhparam data: openssl dhparam -outform DER -out dhparam.der 2048 + + @param dhparam The DH param DER encoded data + @param dhparamlen The length of dhparam data + @param key [out] Where the newly created DH key will be stored + @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. +*/ +int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x == NULL); + LTC_ARGCHK(key->y == NULL); + LTC_ARGCHK(key->base == NULL); + LTC_ARGCHK(key->prime == NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + LTC_ARGCHK(dhparam != NULL); + LTC_ARGCHK(dhparamlen > 0); + + if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { + return err; + } + if ((err = der_decode_sequence_multi(dhparam, dhparamlen, + LTC_ASN1_INTEGER, 1UL, key->prime, + LTC_ASN1_INTEGER, 1UL, key->base, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + + return CRYPT_OK; + +LBL_ERR: + dh_free(key); + return err; +} + +/** + Import DH key parts p and g from built-in DH groups + + @param dhparam The DH param DER encoded data + @param dhparamlen The length of dhparam data + @param key [out] Where the newly created DH key will be stored + @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. +*/ +int dh_set_pg_groupsize(int groupsize, dh_key *key) +{ + int err, i; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x == NULL); + LTC_ARGCHK(key->y == NULL); + LTC_ARGCHK(key->base == NULL); + LTC_ARGCHK(key->prime == NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + LTC_ARGCHK(groupsize > 0); + + for (i = 0; (groupsize > ltc_dh_sets[i].size) && (ltc_dh_sets[i].size != 0); i++); + if (ltc_dh_sets[i].size == 0) return CRYPT_INVALID_KEYSIZE; + + if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { + return err; + } + if ((err = mp_read_radix(key->base, ltc_dh_sets[i].base, 16)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_radix(key->prime, ltc_dh_sets[i].prime, 16)) != CRYPT_OK) { goto LBL_ERR; } + + return CRYPT_OK; + +LBL_ERR: + dh_free(key); + return err; +} + /** Import DH key parts pub and priv from raw numbers diff --git a/tests/dh_test.c b/tests/dh_test.c index dae366d1f..077157c3c 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -60,7 +60,7 @@ static int _prime_test(void) static int _dhparam_test(void) { - dh_key k; + dh_key k = LTC_DH_KEY_INITIALIZER; unsigned char buf[1024]; /* generated by: openssl dhparam -outform der -out dhparam.der 2048 */ unsigned char dhparam_der[] = { @@ -126,7 +126,8 @@ static int _dhparam_test(void) 0x98, 0xcb }; - DO(dh_make_key_dhparam(&yarrow_prng, find_prng ("yarrow"), dhparam_der, sizeof(dhparam_der), &k)); + DO(dh_set_pg_dhparam(dhparam_der, sizeof(dhparam_der), &k)); + DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &k)); if (mp_unsigned_bin_size(k.prime) > sizeof(buf)) { printf("dhparam_test: short buf\n"); dh_free(&k); @@ -316,11 +317,6 @@ static int _radix_test(void) unsigned char key_parts[4][512]; unsigned long key_lens[4]; - if (register_prng(&yarrow_desc) == -1) { - printf("Error registering yarrow PRNG\n"); - return CRYPT_ERROR; - } - for (i = 0; i < 4; i++) { for (j = 0; j < 4; ++j) { key_lens[j] = sizeof(key_parts[j]); @@ -408,8 +404,14 @@ static int _radix_test(void) } dh_free(&k2); - DO(dh_make_key_ex(&yarrow_prng, find_prng("yarrow"), test[i].radix, - test[i].p, test[i].plen, test[i].g, test[i].glen, &k3)); + if(test[i].radix != 256) { + DO(dh_set_pg(key_parts[2], key_lens[2], key_parts[3], key_lens[3], &k3)); + } + else { + DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k3)); + } + + DO(dh_make_key(&yarrow_prng, find_prng("yarrow"), &k3)); len = mp_unsigned_bin_size(k3.prime); DO(mp_to_unsigned_bin(k3.prime, buf)); if (compare_testvector(buf, len, pbin, sizeof(pbin), "radix_test", i*10 + 8)) { @@ -435,20 +437,14 @@ static int _basic_test(void) unsigned char buf[3][4096]; unsigned long x, y, z; int size; - dh_key usera, userb; - - if (register_prng(&yarrow_desc) == -1) { - printf("Error registering yarrow PRNG\n"); - return CRYPT_ERROR; - } - if (register_hash(&md5_desc) == -1) { - printf("Error registering md5 hash\n"); - return CRYPT_ERROR; - } + dh_key usera = LTC_DH_KEY_INITIALIZER; + dh_key userb = LTC_DH_KEY_INITIALIZER; /* make up two keys */ - DO(dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &usera)); - DO(dh_make_key (&yarrow_prng, find_prng ("yarrow"), KEYSIZE/8, &userb)); + DO(dh_set_pg_groupsize(KEYSIZE/8, &usera)); + DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &usera)); + DO(dh_set_pg_groupsize(KEYSIZE/8, &userb)); + DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &userb)); /* make the shared secret */ x = KEYSIZE; @@ -492,17 +488,14 @@ static int _basic_test(void) } for (x = 0; ltc_dh_sets[x].size != 0; x++) { - DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), ltc_dh_sets[x].size, &usera)); + DO(dh_set_pg_groupsize(ltc_dh_sets[x].size, &usera)); + DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &usera)); size = dh_get_groupsize(&usera); dh_free(&usera); if (size != ltc_dh_sets[x].size) { fprintf(stderr, "dh_groupsize mismatch %d %d\n", size, ltc_dh_sets[x].size); return CRYPT_ERROR; } - DO(dh_make_key_ex(&yarrow_prng, find_prng ("yarrow"), 16, - ltc_dh_sets[x].prime, strlen(ltc_dh_sets[x].prime) + 1, - ltc_dh_sets[x].base, strlen(ltc_dh_sets[x].base) + 1, - &usera)); dh_free(&usera); } From f226efc9a9a8ac71dc04f1adcfd4fc9c81f1598b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 21:54:21 +0200 Subject: [PATCH 0936/1192] Update makefiles --- libtomcrypt_VS2008.vcproj | 4 ++-- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 8e1bc171f..0ef401370 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2075,11 +2075,11 @@ > Date: Tue, 27 Jun 2017 22:09:21 +0200 Subject: [PATCH 0937/1192] re-factor dh_export_radix() to dh_export_key() --- src/headers/tomcrypt_pk.h | 5 ++--- src/pk/dh/dh_export_radix.c | 29 ++++------------------------- tests/dh_test.c | 20 +++----------------- 3 files changed, 9 insertions(+), 45 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index fcb74da7e..b73b8c0d5 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -236,9 +236,8 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, void dh_free(dh_key *key); -int dh_export_radix(int radix, - void *out, unsigned long *outlen, - int type, dh_key *key); +int dh_export_key(void *out, unsigned long *outlen, + int type, dh_key *key); #ifdef LTC_SOURCE /* internal helper functions */ diff --git a/src/pk/dh/dh_export_radix.c b/src/pk/dh/dh_export_radix.c index 301fd7f6e..d48c011ad 100644 --- a/src/pk/dh/dh_export_radix.c +++ b/src/pk/dh/dh_export_radix.c @@ -11,35 +11,15 @@ #ifdef LTC_MDH -static unsigned long _count_digits(int radix, void *num) -{ - void *r, *t; - unsigned long digits = 0; - - if (mp_iszero(num) == LTC_MP_YES) return 1; - if (mp_init_multi(&t, &r, NULL) != CRYPT_OK) return 0; - mp_copy(num, t); - mp_set_int(r, radix); - while (mp_iszero(t) == LTC_MP_NO) { - if (mp_div(t, r, t, NULL) != CRYPT_OK) { - mp_clear_multi(t, r, NULL); - return 0; - } - digits++; - } - mp_clear_multi(t, r, NULL); - return digits; -} - /** - Export a DH key to a binary packet + Binary export a DH key to a buffer @param out [out] The destination for the key @param outlen [in/out] The max size and resulting size of the DH key @param type Which type of key (PK_PRIVATE or PK_PUBLIC) @param key The key you wish to export @return CRYPT_OK if successful */ -int dh_export_radix(int radix, void *out, unsigned long *outlen, int type, dh_key *key) +int dh_export_key(void *out, unsigned long *outlen, int type, dh_key *key) { unsigned long len; void *k; @@ -47,10 +27,9 @@ int dh_export_radix(int radix, void *out, unsigned long *outlen, int type, dh_ke LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); LTC_ARGCHK(key != NULL); - LTC_ARGCHK((radix >= 2 && radix <= 64) || radix == 256); k = (type == PK_PRIVATE) ? key->x : key->y; - len = (radix == 256) ? mp_unsigned_bin_size(k) : _count_digits(radix, k) + 1; + len = mp_unsigned_bin_size(k); if (*outlen < len) { *outlen = len; @@ -58,7 +37,7 @@ int dh_export_radix(int radix, void *out, unsigned long *outlen, int type, dh_ke } *outlen = len; - return (radix == 256) ? mp_to_unsigned_bin(k, out) : mp_toradix(k, out, radix); + return mp_to_unsigned_bin(k, out); } #endif /* LTC_MDH */ diff --git a/tests/dh_test.c b/tests/dh_test.c index 077157c3c..1cf6c2286 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -350,33 +350,19 @@ static int _radix_test(void) return CRYPT_ERROR; } len = sizeof(buf); - DO(dh_export_radix(256, buf, &len, PK_PRIVATE, &k1)); + DO(dh_export_key(buf, &len, PK_PRIVATE, &k1)); if (compare_testvector(buf, len, xbin, sizeof(xbin), "radix_test", i*10 + 2)) { printf("radix_test: dh_export+PK_PRIVATE mismatch\n"); dh_free(&k1); return CRYPT_ERROR; } len = sizeof(buf); - DO(dh_export_radix(256, buf, &len, PK_PUBLIC, &k1)); + DO(dh_export_key(buf, &len, PK_PUBLIC, &k1)); if (compare_testvector(buf, len, ybin, sizeof(ybin), "radix_test", i*10 + 3)) { printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); dh_free(&k1); return CRYPT_ERROR; } - len = sizeof(buf); - DO(dh_export_radix(47, buf, &len, PK_PRIVATE, &k1)); - if (compare_testvector(buf, len, xr47, strlen(xr47)+1, "radix_test", i*10 + 4)) { - printf("radix_test: dh_export+PK_PRIVATE mismatch\n"); - dh_free(&k1); - return CRYPT_ERROR; - } - len = sizeof(buf); - DO(dh_export_radix(47, buf, &len, PK_PUBLIC, &k1)); - if (compare_testvector(buf, len, yr47, strlen(yr47)+1, "radix_test", i*10 + 5)) { - printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); - dh_free(&k1); - return CRYPT_ERROR; - } dh_free(&k1); if(test[i].radix != 256) { @@ -396,7 +382,7 @@ static int _radix_test(void) return CRYPT_ERROR; } len = sizeof(buf); - DO(dh_export_radix(256, buf, &len, PK_PUBLIC, &k2)); + DO(dh_export_key(buf, &len, PK_PUBLIC, &k2)); if (compare_testvector(buf, len, ybin, sizeof(ybin), "radix_test", i*10 + 7)) { printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); dh_free(&k2); From f2f113880bc66ac5d264a9c1c1862a04954e407e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 22:10:07 +0200 Subject: [PATCH 0938/1192] also rename file --- src/pk/dh/{dh_export_radix.c => dh_export_key.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/pk/dh/{dh_export_radix.c => dh_export_key.c} (100%) diff --git a/src/pk/dh/dh_export_radix.c b/src/pk/dh/dh_export_key.c similarity index 100% rename from src/pk/dh/dh_export_radix.c rename to src/pk/dh/dh_export_key.c From 37ce78fdc8bd95b6809c0142511f8c261655aa76 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 27 Jun 2017 22:10:10 +0200 Subject: [PATCH 0939/1192] Update makefiles --- libtomcrypt_VS2008.vcproj | 2 +- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 0ef401370..2efe0f5a9 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2063,7 +2063,7 @@ > Date: Wed, 28 Jun 2017 13:27:10 +0200 Subject: [PATCH 0940/1192] introduce mp_cleanup_multi() --- src/headers/tomcrypt_math.h | 2 ++ src/math/multi.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 3fa74f2de..a52fb9d24 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -493,6 +493,7 @@ extern ltc_math_descriptor ltc_mp; int ltc_init_multi(void **a, ...); void ltc_deinit_multi(void *a, ...); +void ltc_cleanup_multi(void **a, ...); #ifdef LTM_DESC extern const ltc_math_descriptor ltm_desc; @@ -515,6 +516,7 @@ extern const ltc_math_descriptor gmp_desc; #define mp_init_multi ltc_init_multi #define mp_clear(a) ltc_mp.deinit(a) #define mp_clear_multi ltc_deinit_multi +#define mp_cleanup_multi ltc_cleanup_multi #define mp_init_copy(a, b) ltc_mp.init_copy(a, b) #define mp_neg(a, b) ltc_mp.neg(a, b) diff --git a/src/math/multi.c b/src/math/multi.c index bfed3ce2f..da5bb60cf 100644 --- a/src/math/multi.c +++ b/src/math/multi.c @@ -53,6 +53,23 @@ void ltc_deinit_multi(void *a, ...) va_end(args); } +void ltc_cleanup_multi(void **a, ...) +{ + void **cur = a; + va_list args; + + va_start(args, a); + while (cur != NULL) { + if (*cur != NULL) { + mp_clear(*cur); + *cur = NULL; + } + cur = va_arg(args, void**); + } + va_end(args); + return; +} + #endif /* ref: $Format:%D$ */ From ed149c9396a9109db50085d85c8c6e435730d1ae Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 14:02:25 +0200 Subject: [PATCH 0941/1192] add tests for radix_to_bin() --- tests/mpi_test.c | 147 ++++++++++++++++++++++++++++++++++++++++++ tests/test.c | 1 + tests/tomcrypt_test.h | 1 + 3 files changed, 149 insertions(+) create mode 100644 tests/mpi_test.c diff --git a/tests/mpi_test.c b/tests/mpi_test.c new file mode 100644 index 000000000..a5e216128 --- /dev/null +++ b/tests/mpi_test.c @@ -0,0 +1,147 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include + +#ifdef LTC_MPI +static int _radix_to_bin_test(void) +{ + /* RADIX 16 */ + char *ghex = "2"; + char *phex = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22" + "514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6" + "F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB" + "9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E8603" + "9B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AACAA68FFFFFFFFFFFFFFFF"; + char *xhex = "A6681ADC386CE944C3DED9A7301DCC9C518250E3EDB62F959198F8DC0057DD6FB57ABAFD788198B1"; + char *yhex = "39046632C834418DFA07B3091538B614D1FB5DBB785C0FBEA3B98B295BC0CD076A88D9452141A269" + "E8BAEB1DD654EBA03A5705318D129754CDF4003A8C399240FBB8F162490F6F0DC70E414B6FEE8808" + "6AFAA48E9F3A248EDC093452663D34E0E809D4F6BADBB36F80B6813EBF7C3281B862209E5604BDEA" + "8B8F5F7BFDC3EEB7ADB73048289BCEA0F5A5CDEE7DF91CD1F0BA632F06DBE9BA7EF014B84B02D497" + "CA7D0C60F734752A649DA496946B4E531B30D9F82EDD855636C0B0F2AE232E4186454E8887BB423E" + "32A5A2495EACBA99620ACD03A38345EBB6735E62330A8EE9AA6C8370410F5CD45AF37EE90A0DA95B" + "E96FC939E88FE0BD2CD09FC8F524208C"; + /* RADIX 47 */ + char *gr47 = "2"; + char *pr47 = "F27Mg1SadOFIRbDOJ5dHgHiVF02Z1LHHQ6G5SLG2U8aTdfH1ETk4GARRE7WW99dBUBLb9e2OHFIaSM1A" + "ag2LNNjgYa9I9CjQGJihL3J7A2SGQe8j5Ch8EHMj5jVbAYDiQKhhPhM6Hc56fKS40GUfJkGO7KJ6EXZQ" + "VgbSa2AkPC65F91g0PaYie8AGNVaFKaV9HOQf3ia1iW4i6eCOB9CcBbH7TbQij8AEgjZ0VRBcLKc6UYO" + "1Zc3I2Jc0h1H2HBEH8ONI3OYBbaPV6XhAd8WCc60D0RDBU3H9U7cWL28a0c90XNO0dh5RXEFBbUCE2ZG" + "gh9XQSVIHkVbFIS5F5IGVOkiWAVc9i8BHB2V0UbGW6UdRTZVV"; + char *xr47 = "6bhO7O9NWFRgEMjdU0Y5POj3c1JP15MYEdIg3FO1PEjUY2aGYNSXcaF01R"; + char *yr47 = "3GNPNWEYfKML1cIbI7Cc1Z0O7aQLJgB734dO2i56LLYDdI4gHYk2GAbQH2WI97hNeC7dj3fPEH8I9gV9" + "U323AXj1AJXbFPFIHGOTdC29QUUeH2SSc6NWhfQDDXd5Q5iXCKEAUGX3SKcNFIfVOYJgZCLjfHYQdgOQ" + "GCjKNgbEV7Hj34MU3b79iANX2DbMYfb9iGi78BWH2HYAd7IAhk7U0OYGHKJX1bIUUj1KBLhAUg46GaER" + "G9W3ARMfBCj6kSdDF9TdkWAjWTDj722IeVJERC4bKU2VDFG20kDhCMF985efD1SS8DfXcdCHF1kDUkSA" + "884FHYiFEPkaagQOBQaN9BNaEHNbbd002DCIIX5eMP4HgPJPF"; + /* RADIX 64 */ + char *gr64 = "2"; + char *pr64 = "3//////////yaFsg8XQC8qnCPYYu3S7D4f0au8YcVCT08BlgOx4viYKKe8UOuq1DtlbHcppJf36p0h2c" + "toNnGtJ+4rRMrHmaNaXRLsObv+nlHCGkccD+rh2/zSjlG6j+tkE6lxMecVfQwV915yIn/cIIXcKUpaMp" + "t207oueME/1PZQI3OSLTEQQHO/gFqapr+3PLqZtAEjbXnYyrOWXLAxdjKf1t2Mbcrd33LEIhoO1F5qR0" + "ZA625yCf1UHYuspZlZddSi60w60vidWwBi1wAFjSLTy6zCKidUAylsbLWN63cLINpgbMhb5T8c69Zw1H" + "0LSevQYgogQF//////////"; + char *xr64 = "2cQ1hSE6pfHCFUsQSm7SoSKO9Gu+ssBvMHcFZS05VTRxLwklruWPYn"; + char *yr64 = "v16Ooo3H1ZVe7imaLEBOKqVjTktXS3xwZkOifMy3D1sg8sKKXGQ9fwBhh7TPKww0wLmKnZHANLCtq03g" + "CEP90+xZnOaaFRmt73a5BR+w826hwf8wVEYIEt0aqKcOzDE3e2TJskjkpRu2sWJw/V3A1k68WdbO4lUg" + "BZrzx/SFkjwstC4WecywWzQNDxdtv7D7mkcCl1jlfkdxm5BXB0jINodqCOFSqTIfadQIMb6jEKnimsVW" + "ktOLMDi2myguZBa66HKw8Xxj2FZAbeabUhBgPOWhD0wE3HUksSrvYCmgEwQfiWt113rpKMlD+wGeDgLl" + "fRyavw8/WlIpGdyZr922C"; + /* RADIX 256 */ + unsigned char gbin[] = { 0x02 }; + unsigned char pbin[] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, + 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, + 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, + 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, + 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, + 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, + 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, + 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, + 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, + 0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, 0x1C, 0x62, 0xF3, 0x56, 0x20, 0x85, 0x52, 0xBB, + 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, 0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, + 0xF1, 0x74, 0x6C, 0x08, 0xCA, 0x18, 0x21, 0x7C, 0x32, 0x90, 0x5E, 0x46, 0x2E, 0x36, 0xCE, 0x3B, + 0xE3, 0x9E, 0x77, 0x2C, 0x18, 0x0E, 0x86, 0x03, 0x9B, 0x27, 0x83, 0xA2, 0xEC, 0x07, 0xA2, 0x8F, + 0xB5, 0xC5, 0x5D, 0xF0, 0x6F, 0x4C, 0x52, 0xC9, 0xDE, 0x2B, 0xCB, 0xF6, 0x95, 0x58, 0x17, 0x18, + 0x39, 0x95, 0x49, 0x7C, 0xEA, 0x95, 0x6A, 0xE5, 0x15, 0xD2, 0x26, 0x18, 0x98, 0xFA, 0x05, 0x10, + 0x15, 0x72, 0x8E, 0x5A, 0x8A, 0xAC, 0xAA, 0x68, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }; + unsigned char xbin[] = { + 0xA6, 0x68, 0x1A, 0xDC, 0x38, 0x6C, 0xE9, 0x44, 0xC3, 0xDE, 0xD9, 0xA7, 0x30, 0x1D, 0xCC, 0x9C, + 0x51, 0x82, 0x50, 0xE3, 0xED, 0xB6, 0x2F, 0x95, 0x91, 0x98, 0xF8, 0xDC, 0x00, 0x57, 0xDD, 0x6F, + 0xB5, 0x7A, 0xBA, 0xFD, 0x78, 0x81, 0x98, 0xB1 + }; + unsigned char ybin[] = { + 0x39, 0x04, 0x66, 0x32, 0xC8, 0x34, 0x41, 0x8D, 0xFA, 0x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, 0x23, 0x2E, 0x41, + 0x86, 0x45, 0x4E, 0x88, 0x87, 0xBB, 0x42, 0x3E, 0x32, 0xA5, 0xA2, 0x49, 0x5E, 0xAC, 0xBA, 0x99, + 0x62, 0x0A, 0xCD, 0x03, 0xA3, 0x83, 0x45, 0xEB, 0xB6, 0x73, 0x5E, 0x62, 0x33, 0x0A, 0x8E, 0xE9, + 0xAA, 0x6C, 0x83, 0x70, 0x41, 0x0F, 0x5C, 0xD4, 0x5A, 0xF3, 0x7E, 0xE9, 0x0A, 0x0D, 0xA9, 0x5B, + 0xE9, 0x6F, 0xC9, 0x39, 0xE8, 0x8F, 0xE0, 0xBD, 0x2C, 0xD0, 0x9F, 0xC8, 0xF5, 0x24, 0x20, 0x8C + }; + + struct { + int radix; + void* g; int glen; + void* p; int plen; + void* x; int xlen; + void* y; int ylen; + } test[4] = { + { 256, gbin, sizeof(gbin), pbin, sizeof(pbin), xbin, sizeof(xbin), ybin, sizeof(ybin) }, + { 16, ghex, strlen(ghex)+1, phex, strlen(phex)+1, xhex, strlen(xhex)+1, yhex, strlen(yhex)+1 }, + { 47, gr47, strlen(gr47)+1, pr47, strlen(pr47)+1, xr47, strlen(xr47)+1, yr47, strlen(yr47)+1 }, + { 64, gr64, strlen(gr64)+1, pr64, strlen(pr64)+1, xr64, strlen(xr64)+1, yr64, strlen(yr64)+1 }, + }; + int i, j; + unsigned char key_parts[4][256]; + unsigned long key_lens[4]; + + for (i = 1; i < 4; i++) { + for (j = 0; j < 4; ++j) { + key_lens[j] = sizeof(key_parts[j]); + } + DO(radix_to_bin(test[i].x, test[i].radix, key_parts[0], &key_lens[0])); + DO(radix_to_bin(test[i].y, test[i].radix, key_parts[1], &key_lens[1])); + DO(radix_to_bin(test[i].p, test[i].radix, key_parts[2], &key_lens[2])); + DO(radix_to_bin(test[i].g, test[i].radix, key_parts[3], &key_lens[3])); + + if (compare_testvector(key_parts[0], key_lens[0], test[0].x, test[0].xlen, "radix_to_bin(x)", i)) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(key_parts[1], key_lens[1], test[0].y, test[0].ylen, "radix_to_bin(y)", i)) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(key_parts[2], key_lens[2], test[0].p, test[0].plen, "radix_to_bin(p)", i)) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(key_parts[3], key_lens[3], test[0].g, test[0].glen, "radix_to_bin(g)", i)) return CRYPT_FAIL_TESTVECTOR; + } + return CRYPT_OK; +} + +int mpi_test(void) +{ + return _radix_to_bin_test(); +} +#else +int mpi_test(void) +{ + return CRYPT_NOP; +} +#endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/test.c b/tests/test.c index 785617b25..990404c5e 100644 --- a/tests/test.c +++ b/tests/test.c @@ -24,6 +24,7 @@ static const test_function test_functions[] = LTC_TEST_FN(store_test), LTC_TEST_FN(rotate_test), LTC_TEST_FN(misc_test), + LTC_TEST_FN(mpi_test), LTC_TEST_FN(cipher_hash_test), LTC_TEST_FN(mac_test), LTC_TEST_FN(modes_test), diff --git a/tests/tomcrypt_test.h b/tests/tomcrypt_test.h index 440180c87..c2e4646a9 100644 --- a/tests/tomcrypt_test.h +++ b/tests/tomcrypt_test.h @@ -60,6 +60,7 @@ int base64_test(void); int file_test(void); int multi_test(void); int prng_test(void); +int mpi_test(void); #ifdef LTC_PKCS_1 struct ltc_prng_descriptor* no_prng_desc_get(void); From 24946d08b7496cf4dd126354ad0dbb768a8de446 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 14:19:12 +0200 Subject: [PATCH 0942/1192] use mp_cleanup_multi() --- src/pk/dh/dh_free.c | 17 +---------------- src/pk/dsa/dsa_free.c | 3 ++- src/pk/rsa/rsa_free.c | 2 +- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/pk/dh/dh_free.c b/src/pk/dh/dh_free.c index 8ca1f65cd..965ff24cf 100644 --- a/src/pk/dh/dh_free.c +++ b/src/pk/dh/dh_free.c @@ -18,22 +18,7 @@ void dh_free(dh_key *key) { LTC_ARGCHKVD(key != NULL); - if ( key->base ) { - mp_clear( key->base ); - key->base = NULL; - } - if ( key->prime ) { - mp_clear( key->prime ); - key->prime = NULL; - } - if ( key->x ) { - mp_clear( key->x ); - key->x = NULL; - } - if ( key->y ) { - mp_clear( key->y ); - key->y = NULL; - } + mp_cleanup_multi(&key->base, &key->prime, &key->x, &key->y, NULL); } #endif /* LTC_MDH */ diff --git a/src/pk/dsa/dsa_free.c b/src/pk/dsa/dsa_free.c index 89b5c663f..812464e57 100644 --- a/src/pk/dsa/dsa_free.c +++ b/src/pk/dsa/dsa_free.c @@ -22,7 +22,8 @@ void dsa_free(dsa_key *key) { LTC_ARGCHKVD(key != NULL); - mp_clear_multi(key->g, key->q, key->p, key->x, key->y, NULL); + mp_cleanup_multi(&key->g, &key->q, &key->p, &key->x, &key->y, NULL); + key->type = key->qord = 0; } #endif diff --git a/src/pk/rsa/rsa_free.c b/src/pk/rsa/rsa_free.c index 48039e4a4..1e62f097e 100644 --- a/src/pk/rsa/rsa_free.c +++ b/src/pk/rsa/rsa_free.c @@ -22,7 +22,7 @@ void rsa_free(rsa_key *key) { LTC_ARGCHKVD(key != NULL); - mp_clear_multi(key->q, key->p, key->qP, key->dP, key->dQ, key->N, key->d, key->e, NULL); + mp_cleanup_multi(&key->q, &key->p, &key->qP, &key->dP, &key->dQ, &key->N, &key->d, &key->e, NULL); } #endif From cfff656e258187d3d6bc934d6589463675369d7a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 14:35:57 +0200 Subject: [PATCH 0943/1192] re-factor dsa_make_key() etc. --- demos/timing.c | 8 +- src/headers/tomcrypt_pk.h | 14 +- src/pk/dsa/dsa_generate_pqg.c | 248 ++++++++++++++++++++++++++++++++++ src/pk/dsa/dsa_import_radix.c | 69 ---------- src/pk/dsa/dsa_make_key.c | 248 +++------------------------------- src/pk/dsa/dsa_set.c | 105 ++++++++++++++ tests/dsa_test.c | 66 +++++---- 7 files changed, 425 insertions(+), 333 deletions(-) create mode 100644 src/pk/dsa/dsa_generate_pqg.c delete mode 100755 src/pk/dsa/dsa_import_radix.c create mode 100755 src/pk/dsa/dsa_set.c diff --git a/demos/timing.c b/demos/timing.c index cb249a52e..d07595832 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -646,7 +646,7 @@ static void time_prng(void) /* time various DSA operations */ static void time_dsa(void) { - dsa_key key; + dsa_key key = LTC_DSA_KEY_INITIALIZER; ulong64 t1, t2; unsigned long x, y; int err; @@ -665,7 +665,11 @@ static const struct { for (y = 0; y < 4; y++) { t_start(); t1 = t_read(); - if ((err = dsa_make_key(&yarrow_prng, find_prng("yarrow"), groups[x].group, groups[x].modulus, &key)) != CRYPT_OK) { + if ((err = dsa_generate_pqg(&yarrow_prng, find_prng("yarrow"), groups[x].group, groups[x].modulus, &key)) != CRYPT_OK) { + fprintf(stderr, "\n\ndsa_generate_pqg says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); + exit(EXIT_FAILURE); + } + if ((err = dsa_make_key_ex(&yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) { fprintf(stderr, "\n\ndsa_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); } diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index b73b8c0d5..963d0d18d 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -442,9 +442,20 @@ typedef struct { void *y; } dsa_key; +#define LTC_DSA_KEY_INITIALIZER { PK_PUBLIC, 0, NULL, NULL, NULL, NULL, NULL } + int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); -int dsa_make_key_ex(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key, char* p_hex, char* q_hex, char* g_hex); +int dsa_set_pqg(const unsigned char *p, unsigned long plen, + const unsigned char *q, unsigned long qlen, + const unsigned char *g, unsigned long glen, + dsa_key *key); +int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); + +int dsa_set_key(const unsigned char *pub, unsigned long publen, + const unsigned char *priv, unsigned long privlen, + dsa_key *key); +int dsa_make_key_ex(prng_state *prng, int wprng, dsa_key *key); void dsa_free(dsa_key *key); @@ -473,7 +484,6 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, dsa_key *key); -int dsa_import_radix(int radix, char *p, char *q, char *g, char *x, char *y, dsa_key *key); int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_verify_key(dsa_key *key, int *stat); diff --git a/src/pk/dsa/dsa_generate_pqg.c b/src/pk/dsa/dsa_generate_pqg.c new file mode 100644 index 000000000..5d8c69119 --- /dev/null +++ b/src/pk/dsa/dsa_generate_pqg.c @@ -0,0 +1,248 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include "tomcrypt.h" + +/** + @file dsa_generate_pqg.c + DSA implementation - generate DSA parameters p, q & g +*/ + +#ifdef LTC_MDSA + +/** + Create DSA parameters (INTERNAL ONLY, not part of public API) + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param group_size Size of the multiplicative group (octets) + @param modulus_size Size of the modulus (octets) + @param p [out] bignum where generated 'p' is stored (must be initialized by caller) + @param q [out] bignum where generated 'q' is stored (must be initialized by caller) + @param g [out] bignum where generated 'g' is stored (must be initialized by caller) + @return CRYPT_OK if successful, upon error this function will free all allocated memory +*/ +static int _dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g) +{ + unsigned long L, N, n, outbytes, seedbytes, counter, j, i; + int err, res, mr_tests_q, mr_tests_p, found_p, found_q, hash; + unsigned char *wbuf, *sbuf, digest[MAXBLOCKSIZE]; + void *t2L1, *t2N1, *t2q, *t2seedlen, *U, *W, *X, *c, *h, *e, *seedinc; + + /* check size */ + if (group_size >= LTC_MDSA_MAX_GROUP || group_size < 1 || group_size >= modulus_size) { + return CRYPT_INVALID_ARG; + } + + /* FIPS-186-4 A.1.1.2 Generation of the Probable Primes p and q Using an Approved Hash Function + * + * L = The desired length of the prime p (in bits e.g. L = 1024) + * N = The desired length of the prime q (in bits e.g. N = 160) + * seedlen = The desired bit length of the domain parameter seed; seedlen shallbe equal to or greater than N + * outlen = The bit length of Hash function + * + * 1. Check that the (L, N) + * 2. If (seedlen = 2^(L-1)) { + * Test whether or not p is prime as specified in Appendix C.3. + * If p is determined to be prime, then return VALID and the values of p, qand (optionally) the values of domain_parameter_seed and counter + * } + * offset = offset + n + 1 Comment: Increment offset + * } + */ + + seedbytes = group_size; + L = modulus_size * 8; + N = group_size * 8; + + /* XXX-TODO no Lucas test */ +#ifdef LTC_MPI_HAS_LUCAS_TEST + /* M-R tests (when followed by one Lucas test) according FIPS-186-4 - Appendix C.3 - table C.1 */ + mr_tests_p = (L <= 2048) ? 3 : 2; + if (N <= 160) { mr_tests_q = 19; } + else if (N <= 224) { mr_tests_q = 24; } + else { mr_tests_q = 27; } +#else + /* M-R tests (without Lucas test) according FIPS-186-4 - Appendix C.3 - table C.1 */ + if (L <= 1024) { mr_tests_p = 40; } + else if (L <= 2048) { mr_tests_p = 56; } + else { mr_tests_p = 64; } + + if (N <= 160) { mr_tests_q = 40; } + else if (N <= 224) { mr_tests_q = 56; } + else { mr_tests_q = 64; } +#endif + + if (N <= 256) { + hash = register_hash(&sha256_desc); + } + else if (N <= 384) { + hash = register_hash(&sha384_desc); + } + else if (N <= 512) { + hash = register_hash(&sha512_desc); + } + else { + return CRYPT_INVALID_ARG; /* group_size too big */ + } + + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } + outbytes = hash_descriptor[hash].hashsize; + + n = ((L + outbytes*8 - 1) / (outbytes*8)) - 1; + + if ((wbuf = XMALLOC((n+1)*outbytes)) == NULL) { err = CRYPT_MEM; goto cleanup3; } + if ((sbuf = XMALLOC(seedbytes)) == NULL) { err = CRYPT_MEM; goto cleanup2; } + + err = mp_init_multi(&t2L1, &t2N1, &t2q, &t2seedlen, &U, &W, &X, &c, &h, &e, &seedinc, NULL); + if (err != CRYPT_OK) { goto cleanup1; } + + if ((err = mp_2expt(t2L1, L-1)) != CRYPT_OK) { goto cleanup; } + /* t2L1 = 2^(L-1) */ + if ((err = mp_2expt(t2N1, N-1)) != CRYPT_OK) { goto cleanup; } + /* t2N1 = 2^(N-1) */ + if ((err = mp_2expt(t2seedlen, seedbytes*8)) != CRYPT_OK) { goto cleanup; } + /* t2seedlen = 2^seedlen */ + + for(found_p=0; !found_p;) { + /* q */ + for(found_q=0; !found_q;) { + if (prng_descriptor[wprng].read(sbuf, seedbytes, prng) != seedbytes) { err = CRYPT_ERROR_READPRNG; goto cleanup; } + i = outbytes; + if ((err = hash_memory(hash, sbuf, seedbytes, digest, &i)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_read_unsigned_bin(U, digest, outbytes)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_mod(U, t2N1, U)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_add(t2N1, U, q)) != CRYPT_OK) { goto cleanup; } + if (!mp_isodd(q)) mp_add_d(q, 1, q); + if ((err = mp_prime_is_prime(q, mr_tests_q, &res)) != CRYPT_OK) { goto cleanup; } + if (res == LTC_MP_YES) found_q = 1; + } + + /* p */ + if ((err = mp_read_unsigned_bin(seedinc, sbuf, seedbytes)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_add(q, q, t2q)) != CRYPT_OK) { goto cleanup; } + for(counter=0; counter < 4*L && !found_p; counter++) { + for(j=0; j<=n; j++) { + if ((err = mp_add_d(seedinc, 1, seedinc)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_mod(seedinc, t2seedlen, seedinc)) != CRYPT_OK) { goto cleanup; } + /* seedinc = (seedinc+1) % 2^seed_bitlen */ + if ((i = mp_unsigned_bin_size(seedinc)) > seedbytes) { err = CRYPT_INVALID_ARG; goto cleanup; } + zeromem(sbuf, seedbytes); + if ((err = mp_to_unsigned_bin(seedinc, sbuf + seedbytes-i)) != CRYPT_OK) { goto cleanup; } + i = outbytes; + err = hash_memory(hash, sbuf, seedbytes, wbuf+(n-j)*outbytes, &i); + if (err != CRYPT_OK) { goto cleanup; } + } + if ((err = mp_read_unsigned_bin(W, wbuf, (n+1)*outbytes)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_mod(W, t2L1, W)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_add(W, t2L1, X)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_mod(X, t2q, c)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_sub_d(c, 1, p)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_sub(X, p, p)) != CRYPT_OK) { goto cleanup; } + if (mp_cmp(p, t2L1) != LTC_MP_LT) { + /* p >= 2^(L-1) */ + if ((err = mp_prime_is_prime(p, mr_tests_p, &res)) != CRYPT_OK) { goto cleanup; } + if (res == LTC_MP_YES) { + found_p = 1; + } + } + } + } + + /* FIPS-186-4 A.2.1 Unverifiable Generation of the Generator g + * 1. e = (p - 1)/q + * 2. h = any integer satisfying: 1 < h < (p - 1) + * h could be obtained from a random number generator or from a counter that changes after each use + * 3. g = h^e mod p + * 4. if (g == 1), then go to step 2. + * + */ + + if ((err = mp_sub_d(p, 1, e)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_div(e, q, e, c)) != CRYPT_OK) { goto cleanup; } + /* e = (p - 1)/q */ + i = mp_count_bits(p); + do { + do { + if ((err = rand_bn_bits(h, i, prng, wprng)) != CRYPT_OK) { goto cleanup; } + } while (mp_cmp(h, p) != LTC_MP_LT || mp_cmp_d(h, 2) != LTC_MP_GT); + if ((err = mp_sub_d(h, 1, h)) != CRYPT_OK) { goto cleanup; } + /* h is randon and 1 < h < (p-1) */ + if ((err = mp_exptmod(h, e, p, g)) != CRYPT_OK) { goto cleanup; } + } while (mp_cmp_d(g, 1) == LTC_MP_EQ); + + err = CRYPT_OK; +cleanup: + mp_clear_multi(t2L1, t2N1, t2q, t2seedlen, U, W, X, c, h, e, seedinc, NULL); +cleanup1: + XFREE(sbuf); +cleanup2: + XFREE(wbuf); +cleanup3: + return err; +} + +/** + Generate DSA parameters p, q & g + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param group_size Size of the multiplicative group (octets) + @param modulus_size Size of the modulus (octets) + @param key [out] Where to store the created key + @return CRYPT_OK if successful. +*/ +int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x == NULL); + LTC_ARGCHK(key->y == NULL); + LTC_ARGCHK(key->p == NULL); + LTC_ARGCHK(key->g == NULL); + LTC_ARGCHK(key->q == NULL); + LTC_ARGCHK(key->qord == 0); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* init mp_ints */ + if ((err = mp_init_multi(&key->g, &key->q, &key->p, &key->x, &key->y, NULL)) != CRYPT_OK) { + return err; + } + /* generate params */ + err = _dsa_make_params(prng, wprng, group_size, modulus_size, key->p, key->q, key->g); + if (err != CRYPT_OK) { goto cleanup; } + + key->qord = group_size; + + return CRYPT_OK; + +cleanup: + dsa_free(key); + return err; +} + +#endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_import_radix.c b/src/pk/dsa/dsa_import_radix.c deleted file mode 100755 index 141030d31..000000000 --- a/src/pk/dsa/dsa_import_radix.c +++ /dev/null @@ -1,69 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ -#include "tomcrypt.h" - -/** - Import DSA public or private key from raw numbers - @param radix the radix the numbers are represented in (2-64, 16 = hexadecimal) - @param p DSA's p in radix representation - @param q DSA's q in radix representation - @param g DSA's g in radix representation - @param x DSA's x in radix representation (only private key, NULL for public key) - @param y DSA's y in radix representation - @param key [out] the destination for the imported key - @return CRYPT_OK if successful, upon error allocated memory is freed -*/ - -#ifdef LTC_MDSA - -int dsa_import_radix(int radix, char *p, char *q, char *g, char *x, char *y, dsa_key *key) -{ - int err; - - LTC_ARGCHK(p != NULL); - LTC_ARGCHK(q != NULL); - LTC_ARGCHK(g != NULL); - LTC_ARGCHK(y != NULL); - LTC_ARGCHK(ltc_mp.name != NULL); - - /* init key */ - err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL); - if (err != CRYPT_OK) return err; - - if ((err = mp_read_radix(key->p , p , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->q , q , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->g , g , radix)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_radix(key->y , y , radix)) != CRYPT_OK) { goto LBL_ERR; } - if (x && strlen(x) > 0) { - key->type = PK_PRIVATE; - if ((err = mp_read_radix(key->x , x , radix)) != CRYPT_OK) { goto LBL_ERR; } - } - else { - key->type = PK_PUBLIC; - } - - key->qord = mp_unsigned_bin_size(key->q); - - if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || - (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { - err = CRYPT_INVALID_PACKET; - goto LBL_ERR; - } - return CRYPT_OK; - -LBL_ERR: - mp_clear_multi(key->p, key->g, key->q, key->x, key->y, NULL); - return err; -} - -#endif - -/* ref: $Format:%D$ */ -/* git commit: $Format:%H$ */ -/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index bec09c983..ff61ca718 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -10,265 +10,61 @@ /** @file dsa_make_key.c - DSA implementation, generate a DSA key, Tom St Denis + DSA implementation, generate a DSA key */ #ifdef LTC_MDSA /** - Create DSA parameters (INTERNAL ONLY, not part of public API) - @param prng An active PRNG state - @param wprng The index of the PRNG desired - @param group_size Size of the multiplicative group (octets) - @param modulus_size Size of the modulus (octets) - @param p [out] bignum where generated 'p' is stored (must be initialized by caller) - @param q [out] bignum where generated 'q' is stored (must be initialized by caller) - @param g [out] bignum where generated 'g' is stored (must be initialized by caller) - @return CRYPT_OK if successful, upon error this function will free all allocated memory -*/ -static int _dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g) -{ - unsigned long L, N, n, outbytes, seedbytes, counter, j, i; - int err, res, mr_tests_q, mr_tests_p, found_p, found_q, hash; - unsigned char *wbuf, *sbuf, digest[MAXBLOCKSIZE]; - void *t2L1, *t2N1, *t2q, *t2seedlen, *U, *W, *X, *c, *h, *e, *seedinc; - - /* check size */ - if (group_size >= LTC_MDSA_MAX_GROUP || group_size < 1 || group_size >= modulus_size) { - return CRYPT_INVALID_ARG; - } - - /* FIPS-186-4 A.1.1.2 Generation of the Probable Primes p and q Using an Approved Hash Function - * - * L = The desired length of the prime p (in bits e.g. L = 1024) - * N = The desired length of the prime q (in bits e.g. N = 160) - * seedlen = The desired bit length of the domain parameter seed; seedlen shallbe equal to or greater than N - * outlen = The bit length of Hash function - * - * 1. Check that the (L, N) - * 2. If (seedlen = 2^(L-1)) { - * Test whether or not p is prime as specified in Appendix C.3. - * If p is determined to be prime, then return VALID and the values of p, qand (optionally) the values of domain_parameter_seed and counter - * } - * offset = offset + n + 1 Comment: Increment offset - * } - */ - - seedbytes = group_size; - L = modulus_size * 8; - N = group_size * 8; - - /* XXX-TODO no Lucas test */ -#ifdef LTC_MPI_HAS_LUCAS_TEST - /* M-R tests (when followed by one Lucas test) according FIPS-186-4 - Appendix C.3 - table C.1 */ - mr_tests_p = (L <= 2048) ? 3 : 2; - if (N <= 160) { mr_tests_q = 19; } - else if (N <= 224) { mr_tests_q = 24; } - else { mr_tests_q = 27; } -#else - /* M-R tests (without Lucas test) according FIPS-186-4 - Appendix C.3 - table C.1 */ - if (L <= 1024) { mr_tests_p = 40; } - else if (L <= 2048) { mr_tests_p = 56; } - else { mr_tests_p = 64; } - - if (N <= 160) { mr_tests_q = 40; } - else if (N <= 224) { mr_tests_q = 56; } - else { mr_tests_q = 64; } -#endif - - if (N <= 256) { - hash = register_hash(&sha256_desc); - } - else if (N <= 384) { - hash = register_hash(&sha384_desc); - } - else if (N <= 512) { - hash = register_hash(&sha512_desc); - } - else { - return CRYPT_INVALID_ARG; /* group_size too big */ - } - - if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } - outbytes = hash_descriptor[hash].hashsize; - - n = ((L + outbytes*8 - 1) / (outbytes*8)) - 1; - - if ((wbuf = XMALLOC((n+1)*outbytes)) == NULL) { err = CRYPT_MEM; goto cleanup3; } - if ((sbuf = XMALLOC(seedbytes)) == NULL) { err = CRYPT_MEM; goto cleanup2; } - - err = mp_init_multi(&t2L1, &t2N1, &t2q, &t2seedlen, &U, &W, &X, &c, &h, &e, &seedinc, NULL); - if (err != CRYPT_OK) { goto cleanup1; } - - if ((err = mp_2expt(t2L1, L-1)) != CRYPT_OK) { goto cleanup; } - /* t2L1 = 2^(L-1) */ - if ((err = mp_2expt(t2N1, N-1)) != CRYPT_OK) { goto cleanup; } - /* t2N1 = 2^(N-1) */ - if ((err = mp_2expt(t2seedlen, seedbytes*8)) != CRYPT_OK) { goto cleanup; } - /* t2seedlen = 2^seedlen */ - - for(found_p=0; !found_p;) { - /* q */ - for(found_q=0; !found_q;) { - if (prng_descriptor[wprng].read(sbuf, seedbytes, prng) != seedbytes) { err = CRYPT_ERROR_READPRNG; goto cleanup; } - i = outbytes; - if ((err = hash_memory(hash, sbuf, seedbytes, digest, &i)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_read_unsigned_bin(U, digest, outbytes)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_mod(U, t2N1, U)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_add(t2N1, U, q)) != CRYPT_OK) { goto cleanup; } - if (!mp_isodd(q)) mp_add_d(q, 1, q); - if ((err = mp_prime_is_prime(q, mr_tests_q, &res)) != CRYPT_OK) { goto cleanup; } - if (res == LTC_MP_YES) found_q = 1; - } - - /* p */ - if ((err = mp_read_unsigned_bin(seedinc, sbuf, seedbytes)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_add(q, q, t2q)) != CRYPT_OK) { goto cleanup; } - for(counter=0; counter < 4*L && !found_p; counter++) { - for(j=0; j<=n; j++) { - if ((err = mp_add_d(seedinc, 1, seedinc)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_mod(seedinc, t2seedlen, seedinc)) != CRYPT_OK) { goto cleanup; } - /* seedinc = (seedinc+1) % 2^seed_bitlen */ - if ((i = mp_unsigned_bin_size(seedinc)) > seedbytes) { err = CRYPT_INVALID_ARG; goto cleanup; } - zeromem(sbuf, seedbytes); - if ((err = mp_to_unsigned_bin(seedinc, sbuf + seedbytes-i)) != CRYPT_OK) { goto cleanup; } - i = outbytes; - err = hash_memory(hash, sbuf, seedbytes, wbuf+(n-j)*outbytes, &i); - if (err != CRYPT_OK) { goto cleanup; } - } - if ((err = mp_read_unsigned_bin(W, wbuf, (n+1)*outbytes)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_mod(W, t2L1, W)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_add(W, t2L1, X)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_mod(X, t2q, c)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_sub_d(c, 1, p)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_sub(X, p, p)) != CRYPT_OK) { goto cleanup; } - if (mp_cmp(p, t2L1) != LTC_MP_LT) { - /* p >= 2^(L-1) */ - if ((err = mp_prime_is_prime(p, mr_tests_p, &res)) != CRYPT_OK) { goto cleanup; } - if (res == LTC_MP_YES) { - found_p = 1; - } - } - } - } - - /* FIPS-186-4 A.2.1 Unverifiable Generation of the Generator g - * 1. e = (p - 1)/q - * 2. h = any integer satisfying: 1 < h < (p - 1) - * h could be obtained from a random number generator or from a counter that changes after each use - * 3. g = h^e mod p - * 4. if (g == 1), then go to step 2. - * - */ - - if ((err = mp_sub_d(p, 1, e)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_div(e, q, e, c)) != CRYPT_OK) { goto cleanup; } - /* e = (p - 1)/q */ - i = mp_count_bits(p); - do { - do { - if ((err = rand_bn_bits(h, i, prng, wprng)) != CRYPT_OK) { goto cleanup; } - } while (mp_cmp(h, p) != LTC_MP_LT || mp_cmp_d(h, 2) != LTC_MP_GT); - if ((err = mp_sub_d(h, 1, h)) != CRYPT_OK) { goto cleanup; } - /* h is randon and 1 < h < (p-1) */ - if ((err = mp_exptmod(h, e, p, g)) != CRYPT_OK) { goto cleanup; } - } while (mp_cmp_d(g, 1) == LTC_MP_EQ); - - err = CRYPT_OK; -cleanup: - mp_clear_multi(t2L1, t2N1, t2q, t2seedlen, U, W, X, c, h, e, seedinc, NULL); -cleanup1: - XFREE(sbuf); -cleanup2: - XFREE(wbuf); -cleanup3: - return err; -} - -/** - Create a DSA key (with given params) + Create a DSA key @param prng An active PRNG state @param wprng The index of the PRNG desired - @param group_size Size of the multiplicative group (octets) - @param modulus_size Size of the modulus (octets) - @param key [out] Where to store the created key - @param p_hex Hexadecimal string 'p' - @param q_hex Hexadecimal string 'q' - @param g_hex Hexadecimal string 'g' - @return CRYPT_OK if successful, upon error this function will free all allocated memory + @param key [in/out] Where to store the created key + @return CRYPT_OK if successful. */ -int dsa_make_key_ex(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key, char* p_hex, char* q_hex, char* g_hex) +int dsa_make_key_ex(prng_state *prng, int wprng, dsa_key *key) { int err, qbits; - LTC_ARGCHK(key != NULL); - - /* init mp_ints */ - if ((err = mp_init_multi(&key->g, &key->q, &key->p, &key->x, &key->y, NULL)) != CRYPT_OK) { - return err; - } - - if (p_hex == NULL || q_hex == NULL || g_hex == NULL) { - /* generate params */ - err = _dsa_make_params(prng, wprng, group_size, modulus_size, key->p, key->q, key->g); - if (err != CRYPT_OK) { goto cleanup; } - } - else { - /* read params */ - if ((err = mp_read_radix(key->p, p_hex, 16)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_read_radix(key->q, q_hex, 16)) != CRYPT_OK) { goto cleanup; } - if ((err = mp_read_radix(key->g, g_hex, 16)) != CRYPT_OK) { goto cleanup; } - /* XXX-TODO maybe do some validity check for p, q, g */ - } + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x != NULL); + LTC_ARGCHK(key->y != NULL); + LTC_ARGCHK(key->p != NULL); + LTC_ARGCHK(key->g != NULL); + LTC_ARGCHK(key->q != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); /* so now we have our DH structure, generator g, order q, modulus p Now we need a random exponent [mod q] and it's power g^x mod p */ qbits = mp_count_bits(key->q); do { - if ((err = rand_bn_bits(key->x, qbits, prng, wprng)) != CRYPT_OK) { goto cleanup; } + if ((err = rand_bn_bits(key->x, qbits, prng, wprng)) != CRYPT_OK) { return err; } /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ } while (mp_cmp_d(key->x, 0) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT); - if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto cleanup; } + if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { return err; } key->type = PK_PRIVATE; - key->qord = group_size; return CRYPT_OK; - -cleanup: - mp_clear_multi(key->g, key->q, key->p, key->x, key->y, NULL); - return err; } /** - Create a DSA key + Old-style creation of a DSA key @param prng An active PRNG state @param wprng The index of the PRNG desired @param group_size Size of the multiplicative group (octets) @param modulus_size Size of the modulus (octets) @param key [out] Where to store the created key - @return CRYPT_OK if successful, upon error this function will free all allocated memory + @return CRYPT_OK if successful. */ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) { - return dsa_make_key_ex(prng, wprng, group_size, modulus_size, key, NULL, NULL, NULL); + int err; + + if ((err = dsa_generate_pqg(prng, wprng, group_size, modulus_size, key)) != CRYPT_OK) { return err; } + if ((err = dsa_make_key_ex(prng, wprng, key)) != CRYPT_OK) { return err; } + + return CRYPT_OK; } #endif diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c new file mode 100755 index 000000000..32e5d3bdb --- /dev/null +++ b/src/pk/dsa/dsa_set.c @@ -0,0 +1,105 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include "tomcrypt.h" + + +#ifdef LTC_MDSA + +/** + Import DSA public or private key from raw numbers + @param p DSA's p in binary representation + @param q DSA's q in binary representation + @param g DSA's g in binary representation + @param key [out] the destination for the imported key + @return CRYPT_OK if successful, upon error allocated memory is freed +*/ +int dsa_set_pqg(const unsigned char *p, unsigned long plen, + const unsigned char *q, unsigned long qlen, + const unsigned char *g, unsigned long glen, + dsa_key *key) +{ + int err; + + LTC_ARGCHK(p != NULL); + LTC_ARGCHK(q != NULL); + LTC_ARGCHK(g != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x == NULL); + LTC_ARGCHK(key->y == NULL); + LTC_ARGCHK(key->p == NULL); + LTC_ARGCHK(key->g == NULL); + LTC_ARGCHK(key->q == NULL); + LTC_ARGCHK(key->qord == 0); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* init key */ + err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL); + if (err != CRYPT_OK) return err; + + if ((err = mp_read_unsigned_bin(key->p , (unsigned char *)p , plen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->g , (unsigned char *)g , glen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->q , (unsigned char *)q , qlen)) != CRYPT_OK) { goto LBL_ERR; } + + key->qord = mp_unsigned_bin_size(key->q); + + if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || + (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + return CRYPT_OK; + +LBL_ERR: + dsa_free(key); + return err; +} + + +/** + Import DSA public or private key from raw numbers + @param x DSA's x in binary representation (only private key, NULL for public key) + @param y DSA's y in binary representation + @param key [out] the destination for the imported key + @return CRYPT_OK if successful, upon error allocated memory is freed +*/ +int dsa_set_key(const unsigned char *pub, unsigned long publen, + const unsigned char *priv, unsigned long privlen, + dsa_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x != NULL); + LTC_ARGCHK(key->y != NULL); + LTC_ARGCHK(key->p != NULL); + LTC_ARGCHK(key->g != NULL); + LTC_ARGCHK(key->q != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + if ((err = mp_read_unsigned_bin(key->y , (unsigned char *)pub , publen)) != CRYPT_OK) { goto LBL_ERR; } + if (priv != NULL) { + key->type = PK_PRIVATE; + if ((err = mp_read_unsigned_bin(key->x , (unsigned char *)priv , privlen)) != CRYPT_OK) { goto LBL_ERR; } + } + else { + key->type = PK_PUBLIC; + } + + return CRYPT_OK; + +LBL_ERR: + dsa_free(key); + return err; +} + +#endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/tests/dsa_test.c b/tests/dsa_test.c index c62c3801f..9cee7affb 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -59,13 +59,6 @@ static char *hex_q = "AA5BD7F4E5062413E58835CA00C7A635716194C5"; static char *hex_x = "9936E5E4E9FB28BE91F5065FE8C935B3F5D81FC5"; static char *hex_y = "5316B0FBBF598A5E5595C14FAC43B80853E6CF0D9223FAB184595239BFCBF22D383ADD935205497E2B12C46173E36F54BD96E5A7AAA95A58A4B767D2C0BDC81EB13A124F98C005EF395D6ABAB70B3BD8B795DD796EA2D28473470388B464D9B9B84FF1C934BBF97366F57C2E11FEC331E60838596781EB6D4127D70D74AFA035"; -/* private key - raw decimal numbers */ -static char *dec_g = "41834149751984197912953436480983170533071735026506895442815002322147255782590882063707309354781506433716654796985480894012184326029507913813728323760888731712844346877576824916725534905000120412305763983626878322597033839508975868744887842375259196379140567488975525420966465471602331600963525846901216912348"; -static char *dec_p = "138366127874251453574215823372867983172559870428080754538874699342292548213873551009389476481395012375639515165022292709776266658812209612126692196557051247870332681145778007636026326219557730049370214260237710845864302921876857532769906463917243319959886290876544710558897185626634470575981605420411381006287"; -static char *dec_q = "972576611327916959546542817054443329226761409733"; -static char *dec_x = "874699854785640347852049895863914110365034094533"; -static char *dec_y = "58346825863862115220306694056113472976936045407556113559931032566376300411053620606958863235131122432665794570437845128216268156672161823000705623178942581094085367656740608001229642983928728905397237964247962716781137229394844332774819193277135681825866994604976120931444766148118918668354923664000689348661"; - /* The public part of test_dsa.key in SubjectPublicKeyInfo format */ static const unsigned char openssl_pub_dsa[] = { 0x30, 0x82, 0x01, 0xb6, 0x30, 0x82, 0x01, 0x2b, 0x06, 0x07, 0x2a, 0x86, @@ -107,11 +100,13 @@ static const unsigned char openssl_pub_dsa[] = { 0xeb, 0x6d, 0x41, 0x27, 0xd7, 0x0d, 0x74, 0xaf, 0xa0, 0x35 }; -static int dsa_compat_test(void) +static int _dsa_compat_test(void) { - dsa_key key; + dsa_key key = LTC_DSA_KEY_INITIALIZER; unsigned char tmp[1024], buf[1024]; unsigned long x, len; + unsigned char key_parts[5][256]; + unsigned long key_lens[5]; DO(dsa_import(openssl_priv_dsa, sizeof(openssl_priv_dsa), &key)); @@ -135,27 +130,38 @@ static int dsa_compat_test(void) dsa_free(&key); /* try import private key from raw hexadecimal numbers */ - DO(dsa_import_radix(16, hex_p, hex_q, hex_g, hex_x, hex_y, &key)); - len = sizeof(buf); - DO(dsa_export(buf, &len, PK_PRIVATE | PK_STD, &key)); - if (len != sizeof(openssl_priv_dsa) || memcmp(buf, openssl_priv_dsa, len)) { - fprintf(stderr, "DSA private export failed to match dsa_import_radix(16, ..)\n"); - return 1; + for (x = 0; x < 5; ++x) { + key_lens[x] = sizeof(key_parts[x]); } - dsa_free(&key); - - /* try import private key from raw decimal numbers */ - DO(dsa_import_radix(10, dec_p, dec_q, dec_g, dec_x, dec_y, &key)); + DO(radix_to_bin(hex_p, 16, key_parts[0], &key_lens[0])); + DO(radix_to_bin(hex_q, 16, key_parts[1], &key_lens[1])); + DO(radix_to_bin(hex_g, 16, key_parts[2], &key_lens[2])); + DO(radix_to_bin(hex_y, 16, key_parts[3], &key_lens[3])); + DO(radix_to_bin(hex_x, 16, key_parts[4], &key_lens[4])); + + DO(dsa_set_pqg(key_parts[0], key_lens[0], + key_parts[1], key_lens[1], + key_parts[2], key_lens[2], + &key)); + DO(dsa_set_key(key_parts[3], key_lens[3], + key_parts[4], key_lens[4], + &key)); len = sizeof(buf); DO(dsa_export(buf, &len, PK_PRIVATE | PK_STD, &key)); if (len != sizeof(openssl_priv_dsa) || memcmp(buf, openssl_priv_dsa, len)) { - fprintf(stderr, "DSA private export failed to match dsa_import_radix(10, ..)\n"); + fprintf(stderr, "DSA private export failed to match dsa_import_radix(16, ..)\n"); return 1; } dsa_free(&key); /* try import public key from raw hexadecimal numbers */ - DO(dsa_import_radix(16, hex_p, hex_q, hex_g, NULL, hex_y, &key)); + DO(dsa_set_pqg(key_parts[0], key_lens[0], + key_parts[1], key_lens[1], + key_parts[2], key_lens[2], + &key)); + DO(dsa_set_key(key_parts[3], key_lens[3], + NULL, 0, + &key)); len = sizeof(buf); DO(dsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); if (len != sizeof(openssl_pub_dsa) || memcmp(buf, openssl_pub_dsa, len)) { @@ -164,16 +170,6 @@ static int dsa_compat_test(void) } dsa_free(&key); - /* try import public key from raw decimal numbers */ - DO(dsa_import_radix(10, dec_p, dec_q, dec_g, NULL, dec_y, &key)); - len = sizeof(buf); - DO(dsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); - if (len != sizeof(openssl_pub_dsa) || memcmp(buf, openssl_pub_dsa, len)) { - fprintf(stderr, "DSA public export failed to match dsa_import_radix(10, ..)\n"); - return 1; - } - dsa_free(&key); - return 0; } @@ -182,12 +178,14 @@ int dsa_test(void) unsigned char msg[16], out[1024], out2[1024], ch; unsigned long x, y; int stat1, stat2; - dsa_key key, key2; + dsa_key key = LTC_DSA_KEY_INITIALIZER; + dsa_key key2 = LTC_DSA_KEY_INITIALIZER; - dsa_compat_test(); + _dsa_compat_test(); /* make a random key */ - DO(dsa_make_key(&yarrow_prng, find_prng("yarrow"), 20, 128, &key)); + DO(dsa_generate_pqg(&yarrow_prng, find_prng("yarrow"), 20, 128, &key)); + DO(dsa_make_key_ex(&yarrow_prng, find_prng("yarrow"), &key)); /* verify it */ DO(dsa_verify_key(&key, &stat1)); From 0aad68c20de02adccc004d4db2d8dcb338838968 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 14:39:27 +0200 Subject: [PATCH 0944/1192] clean-up some PK tests no need to test the same functionality multiple times these tests were multiplied for the XX_import_radix() functions which are gone now. --- tests/dh_test.c | 113 ++++++++++++----------------------------------- tests/rsa_test.c | 37 ---------------- 2 files changed, 29 insertions(+), 121 deletions(-) diff --git a/tests/dh_test.c b/tests/dh_test.c index 1cf6c2286..d9ddfee55 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -10,7 +10,7 @@ #ifdef LTC_MDH -#ifdef DH4096 +#ifdef LTC_DH4096 #define KEYSIZE 4096 #else #define KEYSIZE 2048 @@ -148,58 +148,14 @@ static int _dhparam_test(void) return CRYPT_OK; } -static int _radix_test(void) +static int _set_test(void) { dh_key k1 = LTC_DH_KEY_INITIALIZER; dh_key k2 = LTC_DH_KEY_INITIALIZER; dh_key k3 = LTC_DH_KEY_INITIALIZER; unsigned char buf[4096]; unsigned long len; - int i, j; - /* RADIX 16 */ - char *ghex = "2"; - char *phex = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22" - "514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6" - "F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB" - "9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E8603" - "9B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA0510" - "15728E5A8AACAA68FFFFFFFFFFFFFFFF"; - char *xhex = "A6681ADC386CE944C3DED9A7301DCC9C518250E3EDB62F959198F8DC0057DD6FB57ABAFD788198B1"; - char *yhex = "39046632C834418DFA07B3091538B614D1FB5DBB785C0FBEA3B98B295BC0CD076A88D9452141A269" - "E8BAEB1DD654EBA03A5705318D129754CDF4003A8C399240FBB8F162490F6F0DC70E414B6FEE8808" - "6AFAA48E9F3A248EDC093452663D34E0E809D4F6BADBB36F80B6813EBF7C3281B862209E5604BDEA" - "8B8F5F7BFDC3EEB7ADB73048289BCEA0F5A5CDEE7DF91CD1F0BA632F06DBE9BA7EF014B84B02D497" - "CA7D0C60F734752A649DA496946B4E531B30D9F82EDD855636C0B0F2AE232E4186454E8887BB423E" - "32A5A2495EACBA99620ACD03A38345EBB6735E62330A8EE9AA6C8370410F5CD45AF37EE90A0DA95B" - "E96FC939E88FE0BD2CD09FC8F524208C"; - /* RADIX 47 */ - char *gr47 = "2"; - char *pr47 = "F27Mg1SadOFIRbDOJ5dHgHiVF02Z1LHHQ6G5SLG2U8aTdfH1ETk4GARRE7WW99dBUBLb9e2OHFIaSM1A" - "ag2LNNjgYa9I9CjQGJihL3J7A2SGQe8j5Ch8EHMj5jVbAYDiQKhhPhM6Hc56fKS40GUfJkGO7KJ6EXZQ" - "VgbSa2AkPC65F91g0PaYie8AGNVaFKaV9HOQf3ia1iW4i6eCOB9CcBbH7TbQij8AEgjZ0VRBcLKc6UYO" - "1Zc3I2Jc0h1H2HBEH8ONI3OYBbaPV6XhAd8WCc60D0RDBU3H9U7cWL28a0c90XNO0dh5RXEFBbUCE2ZG" - "gh9XQSVIHkVbFIS5F5IGVOkiWAVc9i8BHB2V0UbGW6UdRTZVV"; - char *xr47 = "6bhO7O9NWFRgEMjdU0Y5POj3c1JP15MYEdIg3FO1PEjUY2aGYNSXcaF01R"; - char *yr47 = "3GNPNWEYfKML1cIbI7Cc1Z0O7aQLJgB734dO2i56LLYDdI4gHYk2GAbQH2WI97hNeC7dj3fPEH8I9gV9" - "U323AXj1AJXbFPFIHGOTdC29QUUeH2SSc6NWhfQDDXd5Q5iXCKEAUGX3SKcNFIfVOYJgZCLjfHYQdgOQ" - "GCjKNgbEV7Hj34MU3b79iANX2DbMYfb9iGi78BWH2HYAd7IAhk7U0OYGHKJX1bIUUj1KBLhAUg46GaER" - "G9W3ARMfBCj6kSdDF9TdkWAjWTDj722IeVJERC4bKU2VDFG20kDhCMF985efD1SS8DfXcdCHF1kDUkSA" - "884FHYiFEPkaagQOBQaN9BNaEHNbbd002DCIIX5eMP4HgPJPF"; - /* RADIX 64 */ - char *gr64 = "2"; - char *pr64 = "3//////////yaFsg8XQC8qnCPYYu3S7D4f0au8YcVCT08BlgOx4viYKKe8UOuq1DtlbHcppJf36p0h2c" - "toNnGtJ+4rRMrHmaNaXRLsObv+nlHCGkccD+rh2/zSjlG6j+tkE6lxMecVfQwV915yIn/cIIXcKUpaMp" - "t207oueME/1PZQI3OSLTEQQHO/gFqapr+3PLqZtAEjbXnYyrOWXLAxdjKf1t2Mbcrd33LEIhoO1F5qR0" - "ZA625yCf1UHYuspZlZddSi60w60vidWwBi1wAFjSLTy6zCKidUAylsbLWN63cLINpgbMhb5T8c69Zw1H" - "0LSevQYgogQF//////////"; - char *xr64 = "2cQ1hSE6pfHCFUsQSm7SoSKO9Gu+ssBvMHcFZS05VTRxLwklruWPYn"; - char *yr64 = "v16Ooo3H1ZVe7imaLEBOKqVjTktXS3xwZkOifMy3D1sg8sKKXGQ9fwBhh7TPKww0wLmKnZHANLCtq03g" - "CEP90+xZnOaaFRmt73a5BR+w826hwf8wVEYIEt0aqKcOzDE3e2TJskjkpRu2sWJw/V3A1k68WdbO4lUg" - "BZrzx/SFkjwstC4WecywWzQNDxdtv7D7mkcCl1jlfkdxm5BXB0jINodqCOFSqTIfadQIMb6jEKnimsVW" - "ktOLMDi2myguZBa66HKw8Xxj2FZAbeabUhBgPOWhD0wE3HUksSrvYCmgEwQfiWt113rpKMlD+wGeDgLl" - "fRyavw8/WlIpGdyZr922C"; - /* RADIX 256 */ + int i; unsigned char gbin[] = { 0x02 }; unsigned char pbin[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, @@ -249,10 +205,7 @@ static int _radix_test(void) void* p; int plen; void* x; int xlen; void* y; int ylen; - } test[4] = { - { 16, ghex, strlen(ghex)+1, phex, strlen(phex)+1, xhex, strlen(xhex)+1, yhex, strlen(yhex)+1 }, - { 47, gr47, strlen(gr47)+1, pr47, strlen(pr47)+1, xr47, strlen(xr47)+1, yr47, strlen(yr47)+1 }, - { 64, gr64, strlen(gr64)+1, pr64, strlen(pr64)+1, xr64, strlen(xr64)+1, yr64, strlen(yr64)+1 }, + } test[1] = { { 256, gbin, sizeof(gbin), pbin, sizeof(pbin), xbin, sizeof(xbin), ybin, sizeof(ybin) } }; @@ -314,26 +267,10 @@ static int _radix_test(void) 0xF3, 0x7E, 0xE9, 0x0A, 0x0D, 0xA9, 0x5B, 0xE9, 0x6F, 0xC9, 0x39, 0xE8, 0x8F, 0xE0, 0xBD, 0x2C, 0xD0, 0x9F, 0xC8, 0xF5, 0x24, 0x20, 0x8C }; - unsigned char key_parts[4][512]; - unsigned long key_lens[4]; - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; ++j) { - key_lens[j] = sizeof(key_parts[j]); - } - if(test[i].radix != 256) { - DO(radix_to_bin(test[i].x, test[i].radix, key_parts[0], &key_lens[0])); - DO(radix_to_bin(test[i].y, test[i].radix, key_parts[1], &key_lens[1])); - DO(radix_to_bin(test[i].p, test[i].radix, key_parts[2], &key_lens[2])); - DO(radix_to_bin(test[i].g, test[i].radix, key_parts[3], &key_lens[3])); - - DO(dh_set_pg(key_parts[2], key_lens[2], key_parts[3], key_lens[3], &k1)); - DO(dh_set_key(NULL, 0, key_parts[0], key_lens[0], &k1)); - } - else { - DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k1)); - DO(dh_set_key(NULL, 0, test[i].x, test[i].xlen, &k1)); - } + for (i = 0; i < 1; i++) { + DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k1)); + DO(dh_set_key(NULL, 0, test[i].x, test[i].xlen, &k1)); len = sizeof(buf); DO(dh_export(buf, &len, PK_PRIVATE, &k1)); @@ -365,14 +302,27 @@ static int _radix_test(void) } dh_free(&k1); - if(test[i].radix != 256) { - DO(dh_set_pg(key_parts[2], key_lens[2], key_parts[3], key_lens[3], &k2)); - DO(dh_set_key(key_parts[1], key_lens[1], NULL, 0, &k2)); + DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k1)); + DO(dh_set_key(test[i].y, test[i].ylen, test[i].x, test[i].xlen, &k1)); + + len = sizeof(buf); + DO(dh_export(buf, &len, PK_PRIVATE, &k1)); + if (compare_testvector(buf, len, export_private, sizeof(export_private), "radix_test", i*10 + 4)) { + printf("radix_test: dh_export+PK_PRIVATE mismatch\n"); + dh_free(&k1); + return CRYPT_ERROR; } - else { - DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k2)); - DO(dh_set_key(test[i].y, test[i].ylen, NULL, 0, &k2)); + len = sizeof(buf); + DO(dh_export(buf, &len, PK_PUBLIC, &k1)); + if (compare_testvector(buf, len, export_public, sizeof(export_public), "radix_test", i*10 + 5)) { + printf("radix_test: dh_export+PK_PUBLIC mismatch\n"); + dh_free(&k1); + return CRYPT_ERROR; } + dh_free(&k1); + + DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k2)); + DO(dh_set_key(test[i].y, test[i].ylen, NULL, 0, &k2)); len = sizeof(buf); DO(dh_export(buf, &len, PK_PUBLIC, &k2)); @@ -390,14 +340,9 @@ static int _radix_test(void) } dh_free(&k2); - if(test[i].radix != 256) { - DO(dh_set_pg(key_parts[2], key_lens[2], key_parts[3], key_lens[3], &k3)); - } - else { - DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k3)); - } - + DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k3)); DO(dh_make_key(&yarrow_prng, find_prng("yarrow"), &k3)); + len = mp_unsigned_bin_size(k3.prime); DO(mp_to_unsigned_bin(k3.prime, buf)); if (compare_testvector(buf, len, pbin, sizeof(pbin), "radix_test", i*10 + 8)) { @@ -494,7 +439,7 @@ int dh_test(void) if (_prime_test() != CRYPT_OK) fails++; if (_basic_test() != CRYPT_OK) fails++; if (_dhparam_test() != CRYPT_OK) fails++; - if (_radix_test() != CRYPT_OK) fails++; + if (_set_test() != CRYPT_OK) fails++; return fails > 0 ? CRYPT_FAIL_TESTVECTOR : CRYPT_OK; } diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 57d94576d..998ec84e3 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -133,17 +133,6 @@ static const char *hex_key[] = { "D6860E85420B0408842160F00E0D88FD1E3610654F1E53B40872805C3F596617E698F2E96C7A064CAC763DED8CA1CEAD1BBDB47D28BCE30E388D99D805B5A371", "DCCC27C8E4DC6248D59BAFF5AB60F621FD53E2B75D09C91AA104A9FC612C5D04583A5A39F14A215667FDCC20A38F78185A793D2E8E7E860AE6A833C104174A9F" }; -/* private key - decimal */ -static const char *dec_key[] = { - "140715588362011445903700789698620706303856890313846506579552319155852306603445626455616876267358538338151320072087950597426668358843246116141391746806252390039505422193715556188330352166601762210959618868365359433828069868584168017348772565936127608284367789455480066115411950431014508224203325089671253575809", - "5757027123463051531073361217943880203685183318942602176865989327630429772398553254013771630974725523559703665512845231173916766336576994271809362147385481", - "8985566687080619280443708121716583572314829758991088624433980393739288226842152842353421251125477168722728289150354056572727675764519591179919295246625201", - "65537", - "145785157837445763858971808379627955816432214431353481009581718367907499729204464589803079767521523397316119124291441688063985017444589154155338311524887989148444674974298105211582428885045820631376256167593861203305479546421254276833052913791538765775697977909548553897629170045372476652935456198173974086909", - "12975386429272921390465467849934248466500992474501042673679976015025637113752114471707151502138750486193421113099777767227628554763059580218432153760685133", - "11235515692122231999359687466333538198133993435121038200055897831921312127192760781281669977582095991578071163376390471936482431583372835883432943212143473", - "11564102464723136702427739477324729528451027211272900753079601723449664482225846595388433622640284454614991112736446376964904474099700895632145077333609119" }; - /*** openssl public RSA key in DER format */ static const unsigned char openssl_public_rsa[] = { 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, @@ -281,32 +270,6 @@ static int rsa_compat_test(void) } rsa_free(&key); - - /* convert raw decimal numbers to binary */ - for (i = 0; i < 8; ++i) { - key_lens[i] = sizeof(key_parts[i]); - DO(radix_to_bin(dec_key[i], 10, key_parts[i], &key_lens[i])); - } - /* try import private key from converted raw decimal numbers */ - DO(rsa_set_key(key_parts[pk_N], key_lens[pk_N], key_parts[pk_e], key_lens[pk_e], key_parts[pk_d], key_lens[pk_d], &key)); - DO(rsa_set_factors(key_parts[pk_p], key_lens[pk_p], key_parts[pk_q], key_lens[pk_q], &key)); - DO(rsa_set_crt_params(key_parts[pk_dP], key_lens[pk_dP], key_parts[pk_dQ], key_lens[pk_dQ], key_parts[pk_qP], key_lens[pk_qP], &key)); - len = sizeof(buf); - DO(rsa_export(buf, &len, PK_PRIVATE, &key)); - if (compare_testvector(buf, len, openssl_private_rsa, sizeof(openssl_private_rsa), "RSA private export (from dec)", 0)) { - return 1; - } - rsa_free(&key); - - /* try import public key from raw converted decimal numbers */ - DO(rsa_set_key(key_parts[pk_N], key_lens[pk_N], key_parts[pk_e], key_lens[pk_e], NULL, 0, &key)); - len = sizeof(buf); - DO(rsa_export(buf, &len, PK_PUBLIC, &key)); - if (compare_testvector(buf, len, openssl_public_rsa_stripped, sizeof(openssl_public_rsa_stripped), "RSA public export (from dec)", 0)) { - return 1; - } - rsa_free(&key); - /* try export in SubjectPublicKeyInfo format of the public key */ DO(rsa_import(openssl_public_rsa, sizeof(openssl_public_rsa), &key)); len = sizeof(buf); From 1cce065676c476a291ef3aa50bd8d9c277cf984c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 14:40:45 +0200 Subject: [PATCH 0945/1192] Update makefiles --- libtomcrypt_VS2008.vcproj | 8 ++++++-- makefile.mingw | 12 ++++++------ makefile.msvc | 12 ++++++------ makefile.unix | 12 ++++++------ makefile_include.mk | 12 ++++++------ 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 2efe0f5a9..d7e434148 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2107,17 +2107,21 @@ > + + diff --git a/makefile.mingw b/makefile.mingw index 0b31ee98d..1ea27d6d1 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -163,9 +163,9 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \ src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_set.o \ src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ @@ -193,9 +193,9 @@ src/stream/sober128/sober128_test.o #List of test objects to compile TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ -tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ -tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ -tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o +tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \ +tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \ +tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile.msvc b/makefile.msvc index 11f643446..5c0c443d4 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -156,9 +156,9 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_ src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_export_key.obj \ src/pk/dh/dh_free.obj src/pk/dh/dh_import.obj src/pk/dh/dh_make_key.obj src/pk/dh/dh_set.obj \ src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj src/pk/dsa/dsa_encrypt_key.obj \ -src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_import.obj src/pk/dsa/dsa_import_radix.obj \ -src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj \ -src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ +src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_generate_pqg.obj src/pk/dsa/dsa_import.obj \ +src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_set.obj src/pk/dsa/dsa_shared_secret.obj \ +src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ @@ -186,9 +186,9 @@ src/stream/sober128/sober128_test.obj #List of test objects to compile TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_test.obj tests/dh_test.obj \ tests/dsa_test.obj tests/ecc_test.obj tests/file_test.obj tests/katja_test.obj tests/mac_test.obj tests/misc_test.obj \ -tests/modes_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj tests/pkcs_1_emsa_test.obj \ -tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj tests/prng_test.obj \ -tests/rotate_test.obj tests/rsa_test.obj tests/store_test.obj tests/test.obj +tests/modes_test.obj tests/mpi_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj \ +tests/pkcs_1_emsa_test.obj tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj \ +tests/prng_test.obj tests/rotate_test.obj tests/rsa_test.obj tests/store_test.obj tests/test.obj #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile.unix b/makefile.unix index cd566b5ef..c3d2d3b70 100644 --- a/makefile.unix +++ b/makefile.unix @@ -173,9 +173,9 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \ src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_set.o \ src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ @@ -203,9 +203,9 @@ src/stream/sober128/sober128_test.o #List of test objects to compile (all goes to libtomcrypt_prof.a) TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ -tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ -tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ -tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o +tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \ +tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \ +tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o #The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ diff --git a/makefile_include.mk b/makefile_include.mk index c037427e8..27fcc2b4b 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -279,9 +279,9 @@ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_ut src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \ src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_set.o \ src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_import_radix.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o \ -src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ +src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_shared_secret.o \ +src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ @@ -309,9 +309,9 @@ src/stream/sober128/sober128_test.o # List of test objects to compile (all goes to libtomcrypt_prof.a) TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \ tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \ -tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \ -tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/prng_test.o \ -tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o +tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \ +tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \ +tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o # The following headers will be installed by "make install" HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \ From 35e0c5fc71872ee59f511bd1a926b2664097f313 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 16:07:32 +0200 Subject: [PATCH 0946/1192] clean-up a bit around DSA * comments * dsa_test() * order of alloc/free of key parts --- src/headers/tomcrypt_pk.h | 2 +- src/math/radix_to_bin.c | 6 +++--- src/pk/dsa/dsa_free.c | 2 +- src/pk/dsa/dsa_generate_pqg.c | 2 +- src/pk/dsa/dsa_import.c | 2 +- src/pk/dsa/dsa_set.c | 12 ++++++------ src/pk/rsa/rsa_set.c | 2 +- tests/dsa_test.c | 34 ++++++++++++++++++++-------------- 8 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 963d0d18d..6e263a00e 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -129,7 +129,7 @@ int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, int rsa_set_key(const unsigned char *N, unsigned long Nlen, const unsigned char *e, unsigned long elen, - const unsigned char *d, unsigned long dlen, /* is NULL for public keys */ + const unsigned char *d, unsigned long dlen, rsa_key *key); int rsa_set_factors(const unsigned char *p, unsigned long plen, const unsigned char *q, unsigned long qlen, diff --git a/src/math/radix_to_bin.c b/src/math/radix_to_bin.c index 74869193e..72742b521 100644 --- a/src/math/radix_to_bin.c +++ b/src/math/radix_to_bin.c @@ -10,15 +10,15 @@ /** @file radix_to_bin.c - Convert an MPI from a specific radix to binary data. + Convert data from a specific radix to binary. Steffen Jaeckel */ /** - Convert an MPI from a specific radix to binary data + Convert data from a specific radix to binary @param in The input - @param radix The radix of the input + @param radix The radix of the input 2..64 @param out The output buffer @param len [in/out] The length of the output buffer diff --git a/src/pk/dsa/dsa_free.c b/src/pk/dsa/dsa_free.c index 812464e57..5cac656f6 100644 --- a/src/pk/dsa/dsa_free.c +++ b/src/pk/dsa/dsa_free.c @@ -22,7 +22,7 @@ void dsa_free(dsa_key *key) { LTC_ARGCHKVD(key != NULL); - mp_cleanup_multi(&key->g, &key->q, &key->p, &key->x, &key->y, NULL); + mp_cleanup_multi(&key->y, &key->x, &key->q, &key->g, &key->p, NULL); key->type = key->qord = 0; } diff --git a/src/pk/dsa/dsa_generate_pqg.c b/src/pk/dsa/dsa_generate_pqg.c index 5d8c69119..d6e3ac7e1 100644 --- a/src/pk/dsa/dsa_generate_pqg.c +++ b/src/pk/dsa/dsa_generate_pqg.c @@ -225,7 +225,7 @@ int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_si LTC_ARGCHK(ltc_mp.name != NULL); /* init mp_ints */ - if ((err = mp_init_multi(&key->g, &key->q, &key->p, &key->x, &key->y, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL)) != CRYPT_OK) { return err; } /* generate params */ diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index e1edaab5f..d71cdd5bf 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -125,7 +125,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) return CRYPT_OK; LBL_ERR: - mp_clear_multi(key->p, key->g, key->q, key->x, key->y, NULL); + dsa_free(key); return err; } diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index 32e5d3bdb..f7c6b5c2e 100755 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -12,7 +12,7 @@ #ifdef LTC_MDSA /** - Import DSA public or private key from raw numbers + Import DSA's p, q & g from raw numbers @param p DSA's p in binary representation @param q DSA's q in binary representation @param g DSA's g in binary representation @@ -42,9 +42,9 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL); if (err != CRYPT_OK) return err; - if ((err = mp_read_unsigned_bin(key->p , (unsigned char *)p , plen)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_unsigned_bin(key->g , (unsigned char *)g , glen)) != CRYPT_OK) { goto LBL_ERR; } - if ((err = mp_read_unsigned_bin(key->q , (unsigned char *)q , qlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->p, (unsigned char *)p , plen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->g, (unsigned char *)g , glen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->q, (unsigned char *)q , qlen)) != CRYPT_OK) { goto LBL_ERR; } key->qord = mp_unsigned_bin_size(key->q); @@ -82,10 +82,10 @@ int dsa_set_key(const unsigned char *pub, unsigned long publen, LTC_ARGCHK(key->q != NULL); LTC_ARGCHK(ltc_mp.name != NULL); - if ((err = mp_read_unsigned_bin(key->y , (unsigned char *)pub , publen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)pub , publen)) != CRYPT_OK) { goto LBL_ERR; } if (priv != NULL) { key->type = PK_PRIVATE; - if ((err = mp_read_unsigned_bin(key->x , (unsigned char *)priv , privlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->x, (unsigned char *)priv , privlen)) != CRYPT_OK) { goto LBL_ERR; } } else { key->type = PK_PUBLIC; diff --git a/src/pk/rsa/rsa_set.c b/src/pk/rsa/rsa_set.c index c45432063..0d540c4d4 100755 --- a/src/pk/rsa/rsa_set.c +++ b/src/pk/rsa/rsa_set.c @@ -25,7 +25,7 @@ */ int rsa_set_key(const unsigned char *N, unsigned long Nlen, const unsigned char *e, unsigned long elen, - const unsigned char *d, unsigned long dlen, /* is NULL for public keys */ + const unsigned char *d, unsigned long dlen, rsa_key *key) { int err; diff --git a/tests/dsa_test.c b/tests/dsa_test.c index 9cee7affb..9dd14d7bf 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -112,21 +112,27 @@ static int _dsa_compat_test(void) x = sizeof(tmp); DO(dsa_export(tmp, &x, PK_PRIVATE | PK_STD, &key)); - DO((x == sizeof(openssl_priv_dsa))?CRYPT_OK:CRYPT_ERROR); - DO((memcmp(tmp, openssl_priv_dsa, sizeof(openssl_priv_dsa)) == 0)?CRYPT_OK:CRYPT_ERROR); + if (compare_testvector(tmp, x, openssl_priv_dsa, sizeof(openssl_priv_dsa), + "DSA private export failed from dsa_import(priv_key)\n", 0)) { + return CRYPT_FAIL_TESTVECTOR; + } x = sizeof(tmp); DO(dsa_export(tmp, &x, PK_PUBLIC | PK_STD, &key)); - DO((x == sizeof(openssl_pub_dsa))?CRYPT_OK:CRYPT_ERROR); - DO((memcmp(tmp, openssl_pub_dsa, sizeof(openssl_pub_dsa)) == 0)?CRYPT_OK:CRYPT_ERROR); + if (compare_testvector(tmp, x, openssl_pub_dsa, sizeof(openssl_pub_dsa), + "DSA public export failed from dsa_import(priv_key)\n", 0)) { + return CRYPT_FAIL_TESTVECTOR; + } dsa_free(&key); DO(dsa_import(openssl_pub_dsa, sizeof(openssl_pub_dsa), &key)); x = sizeof(tmp); DO(dsa_export(tmp, &x, PK_PUBLIC | PK_STD, &key)); - DO((x == sizeof(openssl_pub_dsa))?CRYPT_OK:CRYPT_ERROR); - DO((memcmp(tmp, openssl_pub_dsa, sizeof(openssl_pub_dsa)) == 0)?CRYPT_OK:CRYPT_ERROR); + if (compare_testvector(tmp, x, openssl_pub_dsa, sizeof(openssl_pub_dsa), + "DSA public export failed from dsa_import(pub_key)\n", 0)) { + return CRYPT_FAIL_TESTVECTOR; + } dsa_free(&key); /* try import private key from raw hexadecimal numbers */ @@ -148,9 +154,9 @@ static int _dsa_compat_test(void) &key)); len = sizeof(buf); DO(dsa_export(buf, &len, PK_PRIVATE | PK_STD, &key)); - if (len != sizeof(openssl_priv_dsa) || memcmp(buf, openssl_priv_dsa, len)) { - fprintf(stderr, "DSA private export failed to match dsa_import_radix(16, ..)\n"); - return 1; + if (compare_testvector(buf, len, openssl_priv_dsa, sizeof(openssl_priv_dsa), + "DSA private export failed from dsa_set_pqg() & dsa_set_key()\n", 0)) { + return CRYPT_FAIL_TESTVECTOR; } dsa_free(&key); @@ -164,13 +170,13 @@ static int _dsa_compat_test(void) &key)); len = sizeof(buf); DO(dsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); - if (len != sizeof(openssl_pub_dsa) || memcmp(buf, openssl_pub_dsa, len)) { - fprintf(stderr, "DSA public export failed to match dsa_import_radix(16, ..)\n"); - return 1; + if (compare_testvector(buf, len, openssl_pub_dsa, sizeof(openssl_pub_dsa), + "DSA public export failed from dsa_set_pqg() & dsa_set_key()\n", 0)) { + return CRYPT_FAIL_TESTVECTOR; } dsa_free(&key); - return 0; + return CRYPT_OK; } int dsa_test(void) @@ -181,7 +187,7 @@ int dsa_test(void) dsa_key key = LTC_DSA_KEY_INITIALIZER; dsa_key key2 = LTC_DSA_KEY_INITIALIZER; - _dsa_compat_test(); + DO(_dsa_compat_test()); /* make a random key */ DO(dsa_generate_pqg(&yarrow_prng, find_prng("yarrow"), 20, 128, &key)); From d64880eeb1b2795e701161632cdfb605dee37c82 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 16:07:54 +0200 Subject: [PATCH 0947/1192] add dsa_set_pqg_dsaparam() --- src/headers/tomcrypt_pk.h | 1 + src/pk/dsa/dsa_set.c | 50 +++++++++++++++++++++++++++++ tests/dsa_test.c | 67 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 6e263a00e..49a5c6b31 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -450,6 +450,7 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, const unsigned char *q, unsigned long qlen, const unsigned char *g, unsigned long glen, dsa_key *key); +int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, dsa_key *key); int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); int dsa_set_key(const unsigned char *pub, unsigned long publen, diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index f7c6b5c2e..a1ca64f4b 100755 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -60,6 +60,56 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, return err; } +/** + Import DSA's p, q & g from dsaparam + + dsaparam data: openssl dsaparam -outform DER -out dsaparam.der 2048 + + @param dsaparam The DSA param DER encoded data + @param dsaparamlen The length of dhparam data + @param key [out] the destination for the imported key + @return CRYPT_OK if successful, upon error allocated memory is freed +*/ +int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, + dsa_key *key) +{ + int err; + + LTC_ARGCHK(dsaparam != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x == NULL); + LTC_ARGCHK(key->y == NULL); + LTC_ARGCHK(key->p == NULL); + LTC_ARGCHK(key->g == NULL); + LTC_ARGCHK(key->q == NULL); + LTC_ARGCHK(key->qord == 0); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* init key */ + err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL); + if (err != CRYPT_OK) return err; + + if ((err = der_decode_sequence_multi(dsaparam, dsaparamlen, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + + key->qord = mp_unsigned_bin_size(key->q); + + if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || + (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + return CRYPT_OK; + +LBL_ERR: + dsa_free(key); + return err; +} /** Import DSA public or private key from raw numbers diff --git a/tests/dsa_test.c b/tests/dsa_test.c index 9dd14d7bf..ef5f4ab0d 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -100,6 +100,35 @@ static const unsigned char openssl_pub_dsa[] = { 0xeb, 0x6d, 0x41, 0x27, 0xd7, 0x0d, 0x74, 0xaf, 0xa0, 0x35 }; +static unsigned char dsaparam_der[] = { + 0x30, 0x82, 0x01, 0x1e, 0x02, 0x81, 0x81, 0x00, 0xc5, 0x0a, 0x37, 0x51, + 0x5c, 0xab, 0xd6, 0x18, 0xd5, 0xa2, 0x70, 0xbd, 0x4a, 0x6f, 0x6b, 0x4a, + 0xf9, 0xe1, 0x39, 0x95, 0x0f, 0x2b, 0x99, 0x38, 0x7d, 0x9a, 0x64, 0xd6, + 0x4c, 0xb5, 0x96, 0x7a, 0xdc, 0xed, 0xac, 0xa8, 0xac, 0xc6, 0x1b, 0x65, + 0x5a, 0xde, 0xdb, 0x00, 0x61, 0x25, 0x1a, 0x18, 0x2c, 0xee, 0xa1, 0x07, + 0x90, 0x62, 0x5e, 0x4d, 0x12, 0x31, 0x90, 0xc7, 0x03, 0x21, 0xfa, 0x09, + 0xe7, 0xb1, 0x73, 0xd7, 0x8e, 0xaf, 0xdb, 0xfd, 0xbf, 0xb3, 0xef, 0xad, + 0xd1, 0xa1, 0x2a, 0x03, 0x6d, 0xe7, 0x06, 0x92, 0x4a, 0x85, 0x2a, 0xff, + 0x7a, 0x01, 0x66, 0x53, 0x1f, 0xea, 0xc6, 0x67, 0x41, 0x84, 0x5a, 0xc0, + 0x6c, 0xed, 0x62, 0xf9, 0xc2, 0x62, 0x62, 0x05, 0xa4, 0xfa, 0x48, 0xa0, + 0x66, 0xec, 0x35, 0xc9, 0xa8, 0x11, 0xfe, 0xb9, 0x81, 0xab, 0xee, 0xbe, + 0x31, 0xb6, 0xbf, 0xcf, 0x02, 0x15, 0x00, 0xaa, 0x5b, 0xd7, 0xf4, 0xe5, + 0x06, 0x24, 0x13, 0xe5, 0x88, 0x35, 0xca, 0x00, 0xc7, 0xa6, 0x35, 0x71, + 0x61, 0x94, 0xc5, 0x02, 0x81, 0x80, 0x3b, 0x92, 0xe4, 0xff, 0x59, 0x29, + 0x15, 0x0b, 0x08, 0x99, 0x5a, 0x7b, 0xf2, 0xad, 0x14, 0x40, 0x55, 0x6f, + 0xa0, 0x47, 0xff, 0x90, 0x99, 0xb3, 0x44, 0xb3, 0xd4, 0xfc, 0x45, 0x15, + 0x05, 0xae, 0x67, 0x22, 0x43, 0x9c, 0xba, 0x37, 0x10, 0xa5, 0x89, 0x47, + 0x37, 0xec, 0xcc, 0xf5, 0xae, 0xad, 0xa8, 0xb4, 0x7a, 0x35, 0xcb, 0x9d, + 0x93, 0x5c, 0xed, 0xe6, 0xb0, 0x7e, 0x96, 0x94, 0xc4, 0xa6, 0x0c, 0x7d, + 0xd6, 0x70, 0x8a, 0x09, 0x4f, 0x81, 0x4a, 0x0e, 0xc2, 0x13, 0xfb, 0xeb, + 0x16, 0xbf, 0xea, 0xa4, 0xf4, 0x56, 0xff, 0x72, 0x30, 0x05, 0xde, 0x8a, + 0x44, 0x3f, 0xbe, 0xc6, 0x85, 0x26, 0x55, 0xd6, 0x2d, 0x1d, 0x1e, 0xdb, + 0x15, 0xda, 0xa4, 0x45, 0x83, 0x3c, 0x17, 0x97, 0x98, 0x0b, 0x8d, 0x87, + 0xf3, 0x49, 0x0d, 0x90, 0xbd, 0xa9, 0xab, 0x67, 0x6e, 0x87, 0x68, 0x72, + 0x23, 0xdc + }; + + static int _dsa_compat_test(void) { dsa_key key = LTC_DSA_KEY_INITIALIZER; @@ -107,6 +136,7 @@ static int _dsa_compat_test(void) unsigned long x, len; unsigned char key_parts[5][256]; unsigned long key_lens[5]; + int stat; DO(dsa_import(openssl_priv_dsa, sizeof(openssl_priv_dsa), &key)); @@ -176,6 +206,43 @@ static int _dsa_compat_test(void) } dsa_free(&key); + /* try import dsaparam */ + DO(dsa_set_pqg_dsaparam(dsaparam_der, sizeof(dsaparam_der), &key)); + DO(dsa_make_key_ex(&yarrow_prng, find_prng("yarrow"), &key)); + /* verify it */ + DO(dsa_verify_key(&key, &stat)); + if (stat == 0) { + fprintf(stderr, "dsa_verify_key after dsa_set_pqg_dsaparam()"); + return CRYPT_FAIL_TESTVECTOR; + } + dsa_free(&key); + + /* try import dsaparam - our public key */ + DO(dsa_set_pqg_dsaparam(dsaparam_der, sizeof(dsaparam_der), &key)); + DO(dsa_set_key(key_parts[3], key_lens[3], + NULL, 0, + &key)); + len = sizeof(buf); + DO(dsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); + if (compare_testvector(buf, len, openssl_pub_dsa, sizeof(openssl_pub_dsa), + "DSA public export failed from dsa_set_pqg_dsaparam()\n", 0)) { + return CRYPT_FAIL_TESTVECTOR; + } + dsa_free(&key); + + /* try import dsaparam - our private key */ + DO(dsa_set_pqg_dsaparam(dsaparam_der, sizeof(dsaparam_der), &key)); + DO(dsa_set_key(key_parts[3], key_lens[3], + key_parts[4], key_lens[4], + &key)); + len = sizeof(buf); + DO(dsa_export(buf, &len, PK_PRIVATE | PK_STD, &key)); + if (compare_testvector(buf, len, openssl_priv_dsa, sizeof(openssl_priv_dsa), + "DSA private export failed from dsa_set_pqg_dsaparam()\n", 0)) { + return CRYPT_FAIL_TESTVECTOR; + } + dsa_free(&key); + return CRYPT_OK; } From bdfecc5f3c20df325c5dcfc6d781bde0597838aa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 16:45:29 +0200 Subject: [PATCH 0948/1192] more doc updates --- src/pk/dh/dh_set.c | 3 +-- src/pk/dsa/dsa_set.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/pk/dh/dh_set.c b/src/pk/dh/dh_set.c index 820ca22cb..aeac01e6d 100644 --- a/src/pk/dh/dh_set.c +++ b/src/pk/dh/dh_set.c @@ -93,8 +93,7 @@ int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh /** Import DH key parts p and g from built-in DH groups - @param dhparam The DH param DER encoded data - @param dhparamlen The length of dhparam data + @param groupsize The size of the DH group to use @param key [out] Where the newly created DH key will be stored @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. */ diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index a1ca64f4b..5203ed7b8 100755 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -14,10 +14,13 @@ /** Import DSA's p, q & g from raw numbers @param p DSA's p in binary representation + @param plen The length of p @param q DSA's q in binary representation + @param qlen The length of q @param g DSA's g in binary representation + @param glen The length of g @param key [out] the destination for the imported key - @return CRYPT_OK if successful, upon error allocated memory is freed + @return CRYPT_OK if successful. */ int dsa_set_pqg(const unsigned char *p, unsigned long plen, const unsigned char *q, unsigned long qlen, @@ -68,7 +71,7 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, @param dsaparam The DSA param DER encoded data @param dsaparamlen The length of dhparam data @param key [out] the destination for the imported key - @return CRYPT_OK if successful, upon error allocated memory is freed + @return CRYPT_OK if successful. */ int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, dsa_key *key) @@ -113,10 +116,12 @@ int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamle /** Import DSA public or private key from raw numbers - @param x DSA's x in binary representation (only private key, NULL for public key) - @param y DSA's y in binary representation + @param pub DSA's y (public key) in binary representation + @param publen The length of pub + @param priv DSA's x (private key) in binary representation (can be NULL when importing public key) + @param privlen The length of priv @param key [out] the destination for the imported key - @return CRYPT_OK if successful, upon error allocated memory is freed + @return CRYPT_OK if successful. */ int dsa_set_key(const unsigned char *pub, unsigned long publen, const unsigned char *priv, unsigned long privlen, From d1ecd82a42f706a1e00501d4b3d0f31a8155a6c4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 20:50:21 +0200 Subject: [PATCH 0949/1192] use rand_bn_range() where possible --- src/math/rand_bn.c | 4 ++-- src/pk/dsa/dsa_encrypt_key.c | 16 +++++++--------- src/pk/dsa/dsa_make_key.c | 11 ++++------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c index 5cdd1d9ed..a85a965b4 100755 --- a/src/math/rand_bn.c +++ b/src/math/rand_bn.c @@ -51,7 +51,7 @@ int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng) } /** - Generate a random number N in a range: 0 <= N < limit + Generate a random number N in a range: 1 <= N < limit */ int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng) { @@ -63,7 +63,7 @@ int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng) do { res = rand_bn_bits(N, mp_count_bits(limit), prng, wprng); if (res != CRYPT_OK) return res; - } while (mp_cmp(N, limit) != LTC_MP_LT); + } while (mp_cmp_d(N, 0) != LTC_MP_GT || mp_cmp(N, limit) != LTC_MP_LT); return CRYPT_OK; } diff --git a/src/pk/dsa/dsa_encrypt_key.c b/src/pk/dsa/dsa_encrypt_key.c index 896baa39c..fcfbf8925 100644 --- a/src/pk/dsa/dsa_encrypt_key.c +++ b/src/pk/dsa/dsa_encrypt_key.c @@ -35,7 +35,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, unsigned char *expt, *skey; void *g_pub, *g_priv; unsigned long x, y; - int err, qbits; + int err; LTC_ARGCHK(in != NULL); LTC_ARGCHK(out != NULL); @@ -73,14 +73,12 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, return CRYPT_MEM; } - /* make a random g_priv, g_pub = g^x pair */ - qbits = mp_count_bits(key->q); - do { - if ((err = rand_bn_bits(g_priv, qbits, prng, wprng)) != CRYPT_OK) { - goto LBL_ERR; - } - /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ - } while (mp_cmp_d(g_priv, 0) != LTC_MP_GT || mp_cmp(g_priv, key->q) != LTC_MP_LT); + /* make a random g_priv, g_pub = g^x pair + private key x should be in range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) + */ + if ((err = rand_bn_range(g_priv, key->q, prng, wprng)) != CRYPT_OK) { + goto LBL_ERR; + } /* compute y */ if ((err = mp_exptmod(key->g, g_priv, key->p, g_pub)) != CRYPT_OK) { diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index ff61ca718..b7ccdd5f7 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -24,7 +24,7 @@ */ int dsa_make_key_ex(prng_state *prng, int wprng, dsa_key *key) { - int err, qbits; + int err; LTC_ARGCHK(key != NULL); LTC_ARGCHK(key->x != NULL); @@ -37,12 +37,9 @@ int dsa_make_key_ex(prng_state *prng, int wprng, dsa_key *key) /* so now we have our DH structure, generator g, order q, modulus p Now we need a random exponent [mod q] and it's power g^x mod p */ - qbits = mp_count_bits(key->q); - do { - if ((err = rand_bn_bits(key->x, qbits, prng, wprng)) != CRYPT_OK) { return err; } - /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ - } while (mp_cmp_d(key->x, 0) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT); - if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { return err; } + /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ + if ((err = rand_bn_range(key->x, key->q, prng, wprng)) != CRYPT_OK) { return err; } + if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { return err; } key->type = PK_PRIVATE; return CRYPT_OK; From dbeaefd65b478505fb8c03d926a8e45a456194d2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:13:59 +0200 Subject: [PATCH 0950/1192] remove LTC_{DH,DSA}_KEY_INITIALIZER --- demos/timing.c | 4 ++-- src/headers/tomcrypt_pk.h | 4 ---- src/pk/dh/dh_check_pubkey.c | 3 --- src/pk/dh/dh_make_key.c | 4 ---- src/pk/dh/dh_set.c | 16 ---------------- src/pk/dsa/dsa_generate_pqg.c | 6 ------ src/pk/dsa/dsa_make_key.c | 5 ----- src/pk/dsa/dsa_set.c | 17 ----------------- tests/dh_test.c | 9 +++------ tests/dsa_test.c | 5 ++--- 10 files changed, 7 insertions(+), 66 deletions(-) diff --git a/demos/timing.c b/demos/timing.c index d07595832..81e8f9cd4 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -646,7 +646,7 @@ static void time_prng(void) /* time various DSA operations */ static void time_dsa(void) { - dsa_key key = LTC_DSA_KEY_INITIALIZER; + dsa_key key; ulong64 t1, t2; unsigned long x, y; int err; @@ -893,7 +893,7 @@ static void time_katja(void) { fprintf(stderr, "NO Katja\n"); } /* time various DH operations */ static void time_dh(void) { - dh_key key = LTC_DH_KEY_INITIALIZER; + dh_key key; ulong64 t1, t2; unsigned long i, x, y; int err; diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 49a5c6b31..88c2cab12 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -213,8 +213,6 @@ typedef struct { void *prime; } dh_key; -#define LTC_DH_KEY_INITIALIZER { PK_PUBLIC, NULL, NULL, NULL, NULL } - int dh_get_groupsize(dh_key *key); int dh_export(unsigned char *out, unsigned long *outlen, int type, dh_key *key); @@ -442,8 +440,6 @@ typedef struct { void *y; } dsa_key; -#define LTC_DSA_KEY_INITIALIZER { PK_PUBLIC, 0, NULL, NULL, NULL, NULL, NULL } - int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); int dsa_set_pqg(const unsigned char *p, unsigned long plen, diff --git a/src/pk/dh/dh_check_pubkey.c b/src/pk/dh/dh_check_pubkey.c index c77e4bd23..fb4f37bd2 100644 --- a/src/pk/dh/dh_check_pubkey.c +++ b/src/pk/dh/dh_check_pubkey.c @@ -23,9 +23,6 @@ int dh_check_pubkey(dh_key *key) int i, digit_count, bits_set = 0, err; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->y != NULL); - LTC_ARGCHK(key->base != NULL); - LTC_ARGCHK(key->prime != NULL); if ((err = mp_init(&p_minus1)) != CRYPT_OK) { return err; diff --git a/src/pk/dh/dh_make_key.c b/src/pk/dh/dh_make_key.c index 69eaf3ce2..549a24439 100644 --- a/src/pk/dh/dh_make_key.c +++ b/src/pk/dh/dh_make_key.c @@ -49,10 +49,6 @@ int dh_make_key(prng_state *prng, int wprng, dh_key *key) int err, max_iterations = PK_MAX_RETRIES; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x != NULL); - LTC_ARGCHK(key->y != NULL); - LTC_ARGCHK(key->base != NULL); - LTC_ARGCHK(key->prime != NULL); LTC_ARGCHK(ltc_mp.name != NULL); LTC_ARGCHK(prng != NULL); diff --git a/src/pk/dh/dh_set.c b/src/pk/dh/dh_set.c index aeac01e6d..4e0cf0bb3 100644 --- a/src/pk/dh/dh_set.c +++ b/src/pk/dh/dh_set.c @@ -28,10 +28,6 @@ int dh_set_pg(const unsigned char *p, unsigned long plen, int err; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x == NULL); - LTC_ARGCHK(key->y == NULL); - LTC_ARGCHK(key->base == NULL); - LTC_ARGCHK(key->prime == NULL); LTC_ARGCHK(p != NULL); LTC_ARGCHK(g != NULL); LTC_ARGCHK(ltc_mp.name != NULL); @@ -65,10 +61,6 @@ int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh int err; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x == NULL); - LTC_ARGCHK(key->y == NULL); - LTC_ARGCHK(key->base == NULL); - LTC_ARGCHK(key->prime == NULL); LTC_ARGCHK(ltc_mp.name != NULL); LTC_ARGCHK(dhparam != NULL); LTC_ARGCHK(dhparamlen > 0); @@ -102,10 +94,6 @@ int dh_set_pg_groupsize(int groupsize, dh_key *key) int err, i; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x == NULL); - LTC_ARGCHK(key->y == NULL); - LTC_ARGCHK(key->base == NULL); - LTC_ARGCHK(key->prime == NULL); LTC_ARGCHK(ltc_mp.name != NULL); LTC_ARGCHK(groupsize > 0); @@ -142,10 +130,6 @@ int dh_set_key(const unsigned char *pub, unsigned long publen, int err; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x != NULL); - LTC_ARGCHK(key->y != NULL); - LTC_ARGCHK(key->base != NULL); - LTC_ARGCHK(key->prime != NULL); LTC_ARGCHK(ltc_mp.name != NULL); if(priv == NULL) { diff --git a/src/pk/dsa/dsa_generate_pqg.c b/src/pk/dsa/dsa_generate_pqg.c index d6e3ac7e1..bcf9e3444 100644 --- a/src/pk/dsa/dsa_generate_pqg.c +++ b/src/pk/dsa/dsa_generate_pqg.c @@ -216,12 +216,6 @@ int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_si int err; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x == NULL); - LTC_ARGCHK(key->y == NULL); - LTC_ARGCHK(key->p == NULL); - LTC_ARGCHK(key->g == NULL); - LTC_ARGCHK(key->q == NULL); - LTC_ARGCHK(key->qord == 0); LTC_ARGCHK(ltc_mp.name != NULL); /* init mp_ints */ diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index b7ccdd5f7..708eb08c5 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -27,11 +27,6 @@ int dsa_make_key_ex(prng_state *prng, int wprng, dsa_key *key) int err; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x != NULL); - LTC_ARGCHK(key->y != NULL); - LTC_ARGCHK(key->p != NULL); - LTC_ARGCHK(key->g != NULL); - LTC_ARGCHK(key->q != NULL); LTC_ARGCHK(ltc_mp.name != NULL); /* so now we have our DH structure, generator g, order q, modulus p diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index 5203ed7b8..3f28b5609 100755 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -33,12 +33,6 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, LTC_ARGCHK(q != NULL); LTC_ARGCHK(g != NULL); LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x == NULL); - LTC_ARGCHK(key->y == NULL); - LTC_ARGCHK(key->p == NULL); - LTC_ARGCHK(key->g == NULL); - LTC_ARGCHK(key->q == NULL); - LTC_ARGCHK(key->qord == 0); LTC_ARGCHK(ltc_mp.name != NULL); /* init key */ @@ -80,12 +74,6 @@ int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamle LTC_ARGCHK(dsaparam != NULL); LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x == NULL); - LTC_ARGCHK(key->y == NULL); - LTC_ARGCHK(key->p == NULL); - LTC_ARGCHK(key->g == NULL); - LTC_ARGCHK(key->q == NULL); - LTC_ARGCHK(key->qord == 0); LTC_ARGCHK(ltc_mp.name != NULL); /* init key */ @@ -130,11 +118,6 @@ int dsa_set_key(const unsigned char *pub, unsigned long publen, int err; LTC_ARGCHK(key != NULL); - LTC_ARGCHK(key->x != NULL); - LTC_ARGCHK(key->y != NULL); - LTC_ARGCHK(key->p != NULL); - LTC_ARGCHK(key->g != NULL); - LTC_ARGCHK(key->q != NULL); LTC_ARGCHK(ltc_mp.name != NULL); if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)pub , publen)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/tests/dh_test.c b/tests/dh_test.c index d9ddfee55..2558fc0d6 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -60,7 +60,7 @@ static int _prime_test(void) static int _dhparam_test(void) { - dh_key k = LTC_DH_KEY_INITIALIZER; + dh_key k; unsigned char buf[1024]; /* generated by: openssl dhparam -outform der -out dhparam.der 2048 */ unsigned char dhparam_der[] = { @@ -150,9 +150,7 @@ static int _dhparam_test(void) static int _set_test(void) { - dh_key k1 = LTC_DH_KEY_INITIALIZER; - dh_key k2 = LTC_DH_KEY_INITIALIZER; - dh_key k3 = LTC_DH_KEY_INITIALIZER; + dh_key k1, k2, k3; unsigned char buf[4096]; unsigned long len; int i; @@ -368,8 +366,7 @@ static int _basic_test(void) unsigned char buf[3][4096]; unsigned long x, y, z; int size; - dh_key usera = LTC_DH_KEY_INITIALIZER; - dh_key userb = LTC_DH_KEY_INITIALIZER; + dh_key usera, userb; /* make up two keys */ DO(dh_set_pg_groupsize(KEYSIZE/8, &usera)); diff --git a/tests/dsa_test.c b/tests/dsa_test.c index ef5f4ab0d..7c01ee70e 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -131,7 +131,7 @@ static unsigned char dsaparam_der[] = { static int _dsa_compat_test(void) { - dsa_key key = LTC_DSA_KEY_INITIALIZER; + dsa_key key; unsigned char tmp[1024], buf[1024]; unsigned long x, len; unsigned char key_parts[5][256]; @@ -251,8 +251,7 @@ int dsa_test(void) unsigned char msg[16], out[1024], out2[1024], ch; unsigned long x, y; int stat1, stat2; - dsa_key key = LTC_DSA_KEY_INITIALIZER; - dsa_key key2 = LTC_DSA_KEY_INITIALIZER; + dsa_key key, key2; DO(_dsa_compat_test()); From 3c2e0d66868f81a5caa560c5b91097e0cce6ed36 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:16:01 +0200 Subject: [PATCH 0951/1192] dsa_make_key_ex() is now dsa_generate_key() --- demos/timing.c | 2 +- src/headers/tomcrypt_pk.h | 2 +- src/pk/dsa/dsa_generate_key.c | 47 +++++++++++++++++++++++++++++++++++ src/pk/dsa/dsa_make_key.c | 27 +------------------- src/pk/dsa/dsa_set.c | 5 ++++ tests/dsa_test.c | 4 +-- 6 files changed, 57 insertions(+), 30 deletions(-) create mode 100644 src/pk/dsa/dsa_generate_key.c diff --git a/demos/timing.c b/demos/timing.c index 81e8f9cd4..d1a17e4da 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -669,7 +669,7 @@ static const struct { fprintf(stderr, "\n\ndsa_generate_pqg says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); } - if ((err = dsa_make_key_ex(&yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) { + if ((err = dsa_generate_key(&yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) { fprintf(stderr, "\n\ndsa_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); } diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 88c2cab12..c24230aa6 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -452,7 +452,7 @@ int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_si int dsa_set_key(const unsigned char *pub, unsigned long publen, const unsigned char *priv, unsigned long privlen, dsa_key *key); -int dsa_make_key_ex(prng_state *prng, int wprng, dsa_key *key); +int dsa_generate_key(prng_state *prng, int wprng, dsa_key *key); void dsa_free(dsa_key *key); diff --git a/src/pk/dsa/dsa_generate_key.c b/src/pk/dsa/dsa_generate_key.c new file mode 100644 index 000000000..33f68c7eb --- /dev/null +++ b/src/pk/dsa/dsa_generate_key.c @@ -0,0 +1,47 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include "tomcrypt.h" + +/** + @file dsa_make_key.c + DSA implementation, generate a DSA key +*/ + +#ifdef LTC_MDSA + +/** + Create a DSA key + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param key [in/out] Where to store the created key + @return CRYPT_OK if successful. +*/ +int dsa_generate_key(prng_state *prng, int wprng, dsa_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* so now we have our DH structure, generator g, order q, modulus p + Now we need a random exponent [mod q] and it's power g^x mod p + */ + /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ + if ((err = rand_bn_range(key->x, key->q, prng, wprng)) != CRYPT_OK) { return err; } + if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { return err; } + key->type = PK_PRIVATE; + + return CRYPT_OK; +} + +#endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ diff --git a/src/pk/dsa/dsa_make_key.c b/src/pk/dsa/dsa_make_key.c index 708eb08c5..8ac08f845 100644 --- a/src/pk/dsa/dsa_make_key.c +++ b/src/pk/dsa/dsa_make_key.c @@ -15,31 +15,6 @@ #ifdef LTC_MDSA -/** - Create a DSA key - @param prng An active PRNG state - @param wprng The index of the PRNG desired - @param key [in/out] Where to store the created key - @return CRYPT_OK if successful. -*/ -int dsa_make_key_ex(prng_state *prng, int wprng, dsa_key *key) -{ - int err; - - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(ltc_mp.name != NULL); - - /* so now we have our DH structure, generator g, order q, modulus p - Now we need a random exponent [mod q] and it's power g^x mod p - */ - /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ - if ((err = rand_bn_range(key->x, key->q, prng, wprng)) != CRYPT_OK) { return err; } - if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { return err; } - key->type = PK_PRIVATE; - - return CRYPT_OK; -} - /** Old-style creation of a DSA key @param prng An active PRNG state @@ -54,7 +29,7 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, int err; if ((err = dsa_generate_pqg(prng, wprng, group_size, modulus_size, key)) != CRYPT_OK) { return err; } - if ((err = dsa_make_key_ex(prng, wprng, key)) != CRYPT_OK) { return err; } + if ((err = dsa_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; } return CRYPT_OK; } diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index 3f28b5609..5c1e02919 100755 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -118,6 +118,11 @@ int dsa_set_key(const unsigned char *pub, unsigned long publen, int err; LTC_ARGCHK(key != NULL); + LTC_ARGCHK(key->x != NULL); + LTC_ARGCHK(key->y != NULL); + LTC_ARGCHK(key->p != NULL); + LTC_ARGCHK(key->g != NULL); + LTC_ARGCHK(key->q != NULL); LTC_ARGCHK(ltc_mp.name != NULL); if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)pub , publen)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/tests/dsa_test.c b/tests/dsa_test.c index 7c01ee70e..d871a293a 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -208,7 +208,7 @@ static int _dsa_compat_test(void) /* try import dsaparam */ DO(dsa_set_pqg_dsaparam(dsaparam_der, sizeof(dsaparam_der), &key)); - DO(dsa_make_key_ex(&yarrow_prng, find_prng("yarrow"), &key)); + DO(dsa_generate_key(&yarrow_prng, find_prng("yarrow"), &key)); /* verify it */ DO(dsa_verify_key(&key, &stat)); if (stat == 0) { @@ -257,7 +257,7 @@ int dsa_test(void) /* make a random key */ DO(dsa_generate_pqg(&yarrow_prng, find_prng("yarrow"), 20, 128, &key)); - DO(dsa_make_key_ex(&yarrow_prng, find_prng("yarrow"), &key)); + DO(dsa_generate_key(&yarrow_prng, find_prng("yarrow"), &key)); /* verify it */ DO(dsa_verify_key(&key, &stat1)); From 5640f8afc7965964f3a4209a4eada5a4719fa702 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:17:47 +0200 Subject: [PATCH 0952/1192] put dsa_set_pqg_dsaparam() in own c file --- src/pk/dsa/dsa_set.c | 45 ---------------------- src/pk/dsa/dsa_set_pqg_dsaparam.c | 63 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 45 deletions(-) create mode 100755 src/pk/dsa/dsa_set_pqg_dsaparam.c diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index 5c1e02919..d25de01bd 100755 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -57,51 +57,6 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, return err; } -/** - Import DSA's p, q & g from dsaparam - - dsaparam data: openssl dsaparam -outform DER -out dsaparam.der 2048 - - @param dsaparam The DSA param DER encoded data - @param dsaparamlen The length of dhparam data - @param key [out] the destination for the imported key - @return CRYPT_OK if successful. -*/ -int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, - dsa_key *key) -{ - int err; - - LTC_ARGCHK(dsaparam != NULL); - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(ltc_mp.name != NULL); - - /* init key */ - err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL); - if (err != CRYPT_OK) return err; - - if ((err = der_decode_sequence_multi(dsaparam, dsaparamlen, - LTC_ASN1_INTEGER, 1UL, key->p, - LTC_ASN1_INTEGER, 1UL, key->q, - LTC_ASN1_INTEGER, 1UL, key->g, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto LBL_ERR; - } - - key->qord = mp_unsigned_bin_size(key->q); - - if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || - (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { - err = CRYPT_INVALID_PACKET; - goto LBL_ERR; - } - return CRYPT_OK; - -LBL_ERR: - dsa_free(key); - return err; -} - /** Import DSA public or private key from raw numbers @param pub DSA's y (public key) in binary representation diff --git a/src/pk/dsa/dsa_set_pqg_dsaparam.c b/src/pk/dsa/dsa_set_pqg_dsaparam.c new file mode 100755 index 000000000..454a941a8 --- /dev/null +++ b/src/pk/dsa/dsa_set_pqg_dsaparam.c @@ -0,0 +1,63 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ +#include "tomcrypt.h" + + +#ifdef LTC_MDSA + +/** + Import DSA's p, q & g from dsaparam + + dsaparam data: openssl dsaparam -outform DER -out dsaparam.der 2048 + + @param dsaparam The DSA param DER encoded data + @param dsaparamlen The length of dhparam data + @param key [out] the destination for the imported key + @return CRYPT_OK if successful. +*/ +int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, + dsa_key *key) +{ + int err; + + LTC_ARGCHK(dsaparam != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* init key */ + err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL); + if (err != CRYPT_OK) return err; + + if ((err = der_decode_sequence_multi(dsaparam, dsaparamlen, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->g, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + + key->qord = mp_unsigned_bin_size(key->q); + + if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || + (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + return CRYPT_OK; + +LBL_ERR: + dsa_free(key); + return err; +} + +#endif + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ From a80abb1222ea0ae750008a3fa44910bdc52677f6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:18:04 +0200 Subject: [PATCH 0953/1192] put dh_set_pg_dhparam() in own c file --- src/pk/dh/dh_set.c | 36 ----------------------- src/pk/dh/dh_set_pg_dhparam.c | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 36 deletions(-) create mode 100644 src/pk/dh/dh_set_pg_dhparam.c diff --git a/src/pk/dh/dh_set.c b/src/pk/dh/dh_set.c index 4e0cf0bb3..edd28bb88 100644 --- a/src/pk/dh/dh_set.c +++ b/src/pk/dh/dh_set.c @@ -46,42 +46,6 @@ int dh_set_pg(const unsigned char *p, unsigned long plen, return err; } -/** - Import DH key parts p and g from dhparam - - dhparam data: openssl dhparam -outform DER -out dhparam.der 2048 - - @param dhparam The DH param DER encoded data - @param dhparamlen The length of dhparam data - @param key [out] Where the newly created DH key will be stored - @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. -*/ -int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh_key *key) -{ - int err; - - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(ltc_mp.name != NULL); - LTC_ARGCHK(dhparam != NULL); - LTC_ARGCHK(dhparamlen > 0); - - if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { - return err; - } - if ((err = der_decode_sequence_multi(dhparam, dhparamlen, - LTC_ASN1_INTEGER, 1UL, key->prime, - LTC_ASN1_INTEGER, 1UL, key->base, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { - goto LBL_ERR; - } - - return CRYPT_OK; - -LBL_ERR: - dh_free(key); - return err; -} - /** Import DH key parts p and g from built-in DH groups diff --git a/src/pk/dh/dh_set_pg_dhparam.c b/src/pk/dh/dh_set_pg_dhparam.c new file mode 100644 index 000000000..7003011d1 --- /dev/null +++ b/src/pk/dh/dh_set_pg_dhparam.c @@ -0,0 +1,54 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + */ + +#include "tomcrypt.h" + +#ifdef LTC_MDH + +/** + Import DH key parts p and g from dhparam + + dhparam data: openssl dhparam -outform DER -out dhparam.der 2048 + + @param dhparam The DH param DER encoded data + @param dhparamlen The length of dhparam data + @param key [out] Where the newly created DH key will be stored + @return CRYPT_OK if successful, note: on error all allocated memory will be freed automatically. +*/ +int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh_key *key) +{ + int err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + LTC_ARGCHK(dhparam != NULL); + LTC_ARGCHK(dhparamlen > 0); + + if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { + return err; + } + if ((err = der_decode_sequence_multi(dhparam, dhparamlen, + LTC_ASN1_INTEGER, 1UL, key->prime, + LTC_ASN1_INTEGER, 1UL, key->base, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + + return CRYPT_OK; + +LBL_ERR: + dh_free(key); + return err; +} + +#endif /* LTC_MDH */ + +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ From a0f2abc5b5c462a85d05b28008c99e6875875b3d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:18:21 +0200 Subject: [PATCH 0954/1192] re-format --- src/pk/dsa/dsa_generate_pqg.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/pk/dsa/dsa_generate_pqg.c b/src/pk/dsa/dsa_generate_pqg.c index bcf9e3444..91c7ef700 100644 --- a/src/pk/dsa/dsa_generate_pqg.c +++ b/src/pk/dsa/dsa_generate_pqg.c @@ -213,26 +213,28 @@ static int _dsa_make_params(prng_state *prng, int wprng, int group_size, int mod */ int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) { - int err; + int err; - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(ltc_mp.name != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); - /* init mp_ints */ - if ((err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL)) != CRYPT_OK) { - return err; - } - /* generate params */ - err = _dsa_make_params(prng, wprng, group_size, modulus_size, key->p, key->q, key->g); - if (err != CRYPT_OK) { goto cleanup; } + /* init mp_ints */ + if ((err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL)) != CRYPT_OK) { + return err; + } + /* generate params */ + err = _dsa_make_params(prng, wprng, group_size, modulus_size, key->p, key->q, key->g); + if (err != CRYPT_OK) { + goto cleanup; + } - key->qord = group_size; + key->qord = group_size; - return CRYPT_OK; + return CRYPT_OK; cleanup: - dsa_free(key); - return err; + dsa_free(key); + return err; } #endif From e647f9a0e4242408b2dc3a02a65f1b6024cade9d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:20:56 +0200 Subject: [PATCH 0955/1192] not good to check that prng is non-NULL e.g. sprng() lives w/o context --- src/pk/dh/dh_make_key.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pk/dh/dh_make_key.c b/src/pk/dh/dh_make_key.c index 549a24439..f2f81ff86 100644 --- a/src/pk/dh/dh_make_key.c +++ b/src/pk/dh/dh_make_key.c @@ -50,7 +50,6 @@ int dh_make_key(prng_state *prng, int wprng, dh_key *key) LTC_ARGCHK(key != NULL); LTC_ARGCHK(ltc_mp.name != NULL); - LTC_ARGCHK(prng != NULL); /* good prng? */ if ((err = prng_is_valid(wprng)) != CRYPT_OK) { From a6aef23438e96a4f233d9797afc2f5f3e348fd42 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:30:01 +0200 Subject: [PATCH 0956/1192] dh_make_key() is now dh_generate_key() --- demos/timing.c | 2 +- src/headers/tomcrypt_pk.h | 2 +- src/pk/dh/{dh_make_key.c => dh_generate_key.c} | 2 +- tests/dh_test.c | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/pk/dh/{dh_make_key.c => dh_generate_key.c} (97%) diff --git a/demos/timing.c b/demos/timing.c index d1a17e4da..746055de5 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -909,7 +909,7 @@ static void time_dh(void) t_start(); t1 = t_read(); - if ((err = dh_make_key(&yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) { + if ((err = dh_generate_key(&yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) { fprintf(stderr, "\n\ndh_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK)); exit(EXIT_FAILURE); } diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index c24230aa6..c374048bd 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -227,7 +227,7 @@ int dh_set_pg_groupsize(int groupsize, dh_key *key); int dh_set_key(const unsigned char *pub, unsigned long publen, const unsigned char *priv, unsigned long privlen, dh_key *key); -int dh_make_key(prng_state *prng, int wprng, dh_key *key); +int dh_generate_key(prng_state *prng, int wprng, dh_key *key); int dh_shared_secret(dh_key *private_key, dh_key *public_key, unsigned char *out, unsigned long *outlen); diff --git a/src/pk/dh/dh_make_key.c b/src/pk/dh/dh_generate_key.c similarity index 97% rename from src/pk/dh/dh_make_key.c rename to src/pk/dh/dh_generate_key.c index f2f81ff86..04db294cc 100644 --- a/src/pk/dh/dh_make_key.c +++ b/src/pk/dh/dh_generate_key.c @@ -42,7 +42,7 @@ static int _dh_groupsize_to_keysize(int groupsize) } } -int dh_make_key(prng_state *prng, int wprng, dh_key *key) +int dh_generate_key(prng_state *prng, int wprng, dh_key *key) { unsigned char *buf; unsigned long keysize; diff --git a/tests/dh_test.c b/tests/dh_test.c index 2558fc0d6..e3111c679 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -127,7 +127,7 @@ static int _dhparam_test(void) }; DO(dh_set_pg_dhparam(dhparam_der, sizeof(dhparam_der), &k)); - DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &k)); + DO(dh_generate_key(&yarrow_prng, find_prng ("yarrow"), &k)); if (mp_unsigned_bin_size(k.prime) > sizeof(buf)) { printf("dhparam_test: short buf\n"); dh_free(&k); @@ -339,7 +339,7 @@ static int _set_test(void) dh_free(&k2); DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k3)); - DO(dh_make_key(&yarrow_prng, find_prng("yarrow"), &k3)); + DO(dh_generate_key(&yarrow_prng, find_prng("yarrow"), &k3)); len = mp_unsigned_bin_size(k3.prime); DO(mp_to_unsigned_bin(k3.prime, buf)); @@ -370,9 +370,9 @@ static int _basic_test(void) /* make up two keys */ DO(dh_set_pg_groupsize(KEYSIZE/8, &usera)); - DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &usera)); + DO(dh_generate_key(&yarrow_prng, find_prng ("yarrow"), &usera)); DO(dh_set_pg_groupsize(KEYSIZE/8, &userb)); - DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &userb)); + DO(dh_generate_key(&yarrow_prng, find_prng ("yarrow"), &userb)); /* make the shared secret */ x = KEYSIZE; @@ -417,7 +417,7 @@ static int _basic_test(void) for (x = 0; ltc_dh_sets[x].size != 0; x++) { DO(dh_set_pg_groupsize(ltc_dh_sets[x].size, &usera)); - DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &usera)); + DO(dh_generate_key(&yarrow_prng, find_prng ("yarrow"), &usera)); size = dh_get_groupsize(&usera); dh_free(&usera); if (size != ltc_dh_sets[x].size) { From 8167b4d1cceab960f11002229dd19b966262cdd1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:30:50 +0200 Subject: [PATCH 0957/1192] Update makefiles --- libtomcrypt_VS2008.vcproj | 16 ++++++++++++++-- makefile.mingw | 20 +++++++++++--------- makefile.msvc | 20 +++++++++++--------- makefile.unix | 20 +++++++++++--------- makefile_include.mk | 20 +++++++++++--------- 5 files changed, 58 insertions(+), 38 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index d7e434148..7cc0d3cb7 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2071,17 +2071,21 @@ > + + @@ -2106,6 +2110,10 @@ RelativePath="src\pk\dsa\dsa_free.c" > + + @@ -2122,6 +2130,10 @@ RelativePath="src\pk\dsa\dsa_set.c" > + + diff --git a/makefile.mingw b/makefile.mingw index 1ea27d6d1..9a42b573f 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -161,15 +161,17 @@ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \ -src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_set.o \ -src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \ +src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \ +src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \ +src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \ +src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \ +src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \ +src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \ +src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \ +src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ diff --git a/makefile.msvc b/makefile.msvc index 5c0c443d4..f847f7b79 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -154,15 +154,17 @@ src/pk/asn1/der/utctime/der_decode_utctime.obj src/pk/asn1/der/utctime/der_encod src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_utf8_string.obj \ src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \ src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_export_key.obj \ -src/pk/dh/dh_free.obj src/pk/dh/dh_import.obj src/pk/dh/dh_make_key.obj src/pk/dh/dh_set.obj \ -src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj src/pk/dsa/dsa_encrypt_key.obj \ -src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj src/pk/dsa/dsa_generate_pqg.obj src/pk/dsa/dsa_import.obj \ -src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_set.obj src/pk/dsa/dsa_shared_secret.obj \ -src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj \ -src/pk/ecc/ecc_ansi_x963_export.obj src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj \ -src/pk/ecc/ecc_encrypt_key.obj src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj \ -src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj \ -src/pk/ecc/ecc_sign_hash.obj src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \ +src/pk/dh/dh_free.obj src/pk/dh/dh_generate_key.obj src/pk/dh/dh_import.obj src/pk/dh/dh_set.obj \ +src/pk/dh/dh_set_pg_dhparam.obj src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj \ +src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj \ +src/pk/dsa/dsa_generate_key.obj src/pk/dsa/dsa_generate_pqg.obj src/pk/dsa/dsa_import.obj \ +src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_set.obj src/pk/dsa/dsa_set_pqg_dsaparam.obj \ +src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj \ +src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj src/pk/ecc/ecc_ansi_x963_export.obj \ +src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj src/pk/ecc/ecc_encrypt_key.obj \ +src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj src/pk/ecc/ecc_import.obj \ +src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj src/pk/ecc/ecc_sign_hash.obj \ +src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \ src/pk/ecc/ltc_ecc_is_valid_idx.obj src/pk/ecc/ltc_ecc_map.obj src/pk/ecc/ltc_ecc_mul2add.obj \ src/pk/ecc/ltc_ecc_mulmod.obj src/pk/ecc/ltc_ecc_mulmod_timing.obj src/pk/ecc/ltc_ecc_points.obj \ src/pk/ecc/ltc_ecc_projective_add_point.obj src/pk/ecc/ltc_ecc_projective_dbl_point.obj \ diff --git a/makefile.unix b/makefile.unix index c3d2d3b70..7b9b8ae9a 100644 --- a/makefile.unix +++ b/makefile.unix @@ -171,15 +171,17 @@ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \ -src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_set.o \ -src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \ +src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \ +src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \ +src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \ +src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \ +src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \ +src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \ +src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \ +src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ diff --git a/makefile_include.mk b/makefile_include.mk index 27fcc2b4b..78ec3c447 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -277,15 +277,17 @@ src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_ src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \ src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \ src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \ -src/pk/dh/dh_free.o src/pk/dh/dh_import.o src/pk/dh/dh_make_key.o src/pk/dh/dh_set.o \ -src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o src/pk/dsa/dsa_encrypt_key.o \ -src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ -src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_shared_secret.o \ -src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o \ -src/pk/ecc/ecc_ansi_x963_export.o src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o \ -src/pk/ecc/ecc_encrypt_key.o src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o \ -src/pk/ecc/ecc_import.o src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o \ -src/pk/ecc/ecc_sign_hash.o src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ +src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \ +src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \ +src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \ +src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \ +src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \ +src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \ +src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \ +src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \ +src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \ +src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \ +src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \ src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \ src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \ src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \ From 22919cd4f2d4aaa80ace75ae92b682f5ff426ec8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 4 Jul 2017 10:58:10 +0200 Subject: [PATCH 0958/1192] rand_bn_range(): count bits once --- src/math/rand_bn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c index a85a965b4..3d4f10c47 100755 --- a/src/math/rand_bn.c +++ b/src/math/rand_bn.c @@ -55,13 +55,14 @@ int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng) */ int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng) { - int res; + int res, bits; LTC_ARGCHK(N != NULL); LTC_ARGCHK(limit != NULL); + bits = mp_count_bits(limit); do { - res = rand_bn_bits(N, mp_count_bits(limit), prng, wprng); + res = rand_bn_bits(N, bits, prng, wprng); if (res != CRYPT_OK) return res; } while (mp_cmp_d(N, 0) != LTC_MP_GT || mp_cmp(N, limit) != LTC_MP_LT); From 4221c44fbc94328b883e6451506b98a5584eb109 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 10:03:56 +0200 Subject: [PATCH 0959/1192] rename rand_bn_range() to rand_bn_upto() --- src/headers/tomcrypt_pk.h | 2 +- src/math/rand_bn.c | 2 +- src/pk/dsa/dsa_encrypt_key.c | 2 +- src/pk/dsa/dsa_generate_key.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index c374048bd..44b857541 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -25,7 +25,7 @@ int rand_prime(void *N, long len, prng_state *prng, int wprng); #ifdef LTC_SOURCE /* internal helper functions */ int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng); -int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng); +int rand_bn_upto(void *N, void *limit, prng_state *prng, int wprng); enum public_key_algorithms { PKA_RSA, diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c index 3d4f10c47..a42ba6428 100755 --- a/src/math/rand_bn.c +++ b/src/math/rand_bn.c @@ -53,7 +53,7 @@ int rand_bn_bits(void *N, int bits, prng_state *prng, int wprng) /** Generate a random number N in a range: 1 <= N < limit */ -int rand_bn_range(void *N, void *limit, prng_state *prng, int wprng) +int rand_bn_upto(void *N, void *limit, prng_state *prng, int wprng) { int res, bits; diff --git a/src/pk/dsa/dsa_encrypt_key.c b/src/pk/dsa/dsa_encrypt_key.c index fcfbf8925..c854367b8 100644 --- a/src/pk/dsa/dsa_encrypt_key.c +++ b/src/pk/dsa/dsa_encrypt_key.c @@ -76,7 +76,7 @@ int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, /* make a random g_priv, g_pub = g^x pair private key x should be in range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ - if ((err = rand_bn_range(g_priv, key->q, prng, wprng)) != CRYPT_OK) { + if ((err = rand_bn_upto(g_priv, key->q, prng, wprng)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/pk/dsa/dsa_generate_key.c b/src/pk/dsa/dsa_generate_key.c index 33f68c7eb..18b2df631 100644 --- a/src/pk/dsa/dsa_generate_key.c +++ b/src/pk/dsa/dsa_generate_key.c @@ -33,7 +33,7 @@ int dsa_generate_key(prng_state *prng, int wprng, dsa_key *key) Now we need a random exponent [mod q] and it's power g^x mod p */ /* private key x should be from range: 1 <= x <= q-1 (see FIPS 186-4 B.1.2) */ - if ((err = rand_bn_range(key->x, key->q, prng, wprng)) != CRYPT_OK) { return err; } + if ((err = rand_bn_upto(key->x, key->q, prng, wprng)) != CRYPT_OK) { return err; } if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { return err; } key->type = PK_PRIVATE; From c2f50459e284ba777c6e6add55ad1e275a3472a2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 10:25:01 +0200 Subject: [PATCH 0960/1192] better doc of radix_to_bin() --- src/math/radix_to_bin.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/math/radix_to_bin.c b/src/math/radix_to_bin.c index 72742b521..fef58ae7b 100644 --- a/src/math/radix_to_bin.c +++ b/src/math/radix_to_bin.c @@ -17,8 +17,15 @@ /** Convert data from a specific radix to binary + The default MPI descriptors #ltm_desc, #tfm_desc and #gmp_desc + have the following restrictions on parameters: + + \p in - NUL-terminated char buffer + + \p radix - 2..64 + @param in The input - @param radix The radix of the input 2..64 + @param radix The radix of the input @param out The output buffer @param len [in/out] The length of the output buffer From 4bc1489584df8ee67eb40073a3ccbdc42d0d65ad Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 22 Jun 2017 12:42:08 +0200 Subject: [PATCH 0961/1192] small ASN.1 changes extracted from ECC stuff --- src/headers/tomcrypt_pk.h | 2 + .../der/sequence/der_decode_sequence_ex.c | 1 + .../der/sequence/der_encode_sequence_ex.c | 170 +----------------- .../asn1/der/sequence/der_length_sequence.c | 10 +- 4 files changed, 20 insertions(+), 163 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 44b857541..36d5ec6b8 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -559,6 +559,8 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, unsigned long *outlen); +int der_length_sequence_ex(ltc_asn1_list *list, unsigned long inlen, + unsigned long *outlen, unsigned long *payloadlen); #ifdef LTC_SOURCE diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 6b56b2955..9addfa55e 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -98,6 +98,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, case LTC_ASN1_BOOLEAN: z = inlen; if ((err = der_decode_boolean(in + x, z, ((int *)data))) != CRYPT_OK) { + if (!ordered) { continue; } goto LBL_ERR; } if ((err = der_length_boolean(&z)) != CRYPT_OK) { diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c index dcc4382b1..2b42ff482 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_ex.c @@ -38,135 +38,8 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, LTC_ARGCHK(outlen != NULL); /* get size of output that will be required */ - y = 0; - for (i = 0; i < inlen; i++) { - type = list[i].type; - size = list[i].size; - data = list[i].data; - - if (type == LTC_ASN1_EOL) { - break; - } - - switch (type) { - case LTC_ASN1_BOOLEAN: - if ((err = der_length_boolean(&x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_INTEGER: - if ((err = der_length_integer(data, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_SHORT_INTEGER: - if ((err = der_length_short_integer(*((unsigned long*)data), &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_BIT_STRING: - case LTC_ASN1_RAW_BIT_STRING: - if ((err = der_length_bit_string(size, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_OCTET_STRING: - if ((err = der_length_octet_string(size, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_NULL: - y += 2; - break; - - case LTC_ASN1_OBJECT_IDENTIFIER: - if ((err = der_length_object_identifier(data, size, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_IA5_STRING: - if ((err = der_length_ia5_string(data, size, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_PRINTABLE_STRING: - if ((err = der_length_printable_string(data, size, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_UTF8_STRING: - if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_UTCTIME: - if ((err = der_length_utctime(data, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_GENERALIZEDTIME: - if ((err = der_length_generalizedtime(data, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_SET: - case LTC_ASN1_SETOF: - case LTC_ASN1_SEQUENCE: - if ((err = der_length_sequence(data, size, &x)) != CRYPT_OK) { - goto LBL_ERR; - } - y += x; - break; - - case LTC_ASN1_CHOICE: - case LTC_ASN1_CONSTRUCTED: - case LTC_ASN1_CONTEXT_SPECIFIC: - case LTC_ASN1_EOL: - case LTC_ASN1_TELETEX_STRING: - err = CRYPT_INVALID_ARG; - goto LBL_ERR; - } - } - - /* calc header size */ - z = y; - if (y < 128) { - y += 2; - } else if (y < 256) { - /* 0x30 0x81 LL */ - y += 3; - } else if (y < 65536UL) { - /* 0x30 0x82 LL LL */ - y += 4; - } else if (y < 16777216UL) { - /* 0x30 0x83 LL LL LL */ - y += 5; - } else { - err = CRYPT_INVALID_ARG; - goto LBL_ERR; - } + y = 0; z = 0; + if ((err = der_length_sequence_ex(list, inlen, &y, &z)) != CRYPT_OK) return CRYPT_INVALID_ARG; /* too big ? */ if (*outlen < y) { @@ -212,8 +85,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_INTEGER: @@ -221,8 +92,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_SHORT_INTEGER: @@ -230,8 +99,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_short_integer(*((unsigned long*)data), out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_BIT_STRING: @@ -239,8 +106,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_bit_string(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_RAW_BIT_STRING: @@ -248,8 +113,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_raw_bit_string(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_OCTET_STRING: @@ -257,14 +120,12 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_octet_string(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_NULL: - out[x++] = 0x05; - out[x++] = 0x00; - *outlen -= 2; + out[x] = 0x05; + out[x+1] = 0x00; + z = 2; break; case LTC_ASN1_OBJECT_IDENTIFIER: @@ -272,8 +133,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_object_identifier(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_IA5_STRING: @@ -281,8 +140,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_ia5_string(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_PRINTABLE_STRING: @@ -290,8 +147,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_printable_string(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_UTF8_STRING: @@ -299,8 +154,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_utf8_string(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_UTCTIME: @@ -308,8 +161,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_utctime(data, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_GENERALIZEDTIME: @@ -317,8 +168,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_generalizedtime(data, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_SET: @@ -326,8 +175,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_SETOF: @@ -335,8 +182,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_setof(data, size, out + x, &z)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_SEQUENCE: @@ -344,8 +189,6 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, if ((err = der_encode_sequence_ex(data, size, out + x, &z, type)) != CRYPT_OK) { goto LBL_ERR; } - x += z; - *outlen -= z; break; case LTC_ASN1_CHOICE: @@ -356,6 +199,9 @@ int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, err = CRYPT_INVALID_ARG; goto LBL_ERR; } + + x += z; + *outlen -= z; } *outlen = x; err = CRYPT_OK; diff --git a/src/pk/asn1/der/sequence/der_length_sequence.c b/src/pk/asn1/der/sequence/der_length_sequence.c index 2e8c436fc..aed7cc2a3 100644 --- a/src/pk/asn1/der/sequence/der_length_sequence.c +++ b/src/pk/asn1/der/sequence/der_length_sequence.c @@ -24,10 +24,16 @@ */ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, unsigned long *outlen) +{ + return der_length_sequence_ex(list, inlen, outlen, NULL); +} + +int der_length_sequence_ex(ltc_asn1_list *list, unsigned long inlen, + unsigned long *outlen, unsigned long *payloadlen) { int err; ltc_asn1_type type; - unsigned long size, x, y, i; + unsigned long size, x, y, i, z; void *data; LTC_ARGCHK(list != NULL); @@ -154,6 +160,7 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, } /* calc header size */ + z = y; if (y < 128) { y += 2; } else if (y < 256) { @@ -171,6 +178,7 @@ int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, } /* store size */ + if (payloadlen) *payloadlen = z; *outlen = y; err = CRYPT_OK; From 7d60fd2bfee7b58e3d8faae92cff4bca7481fc5d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 11:52:46 +0200 Subject: [PATCH 0962/1192] don't expose der_length_sequence_ex() --- src/headers/tomcrypt_pk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 36d5ec6b8..89e961119 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -559,12 +559,12 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, unsigned long *outlen); -int der_length_sequence_ex(ltc_asn1_list *list, unsigned long inlen, - unsigned long *outlen, unsigned long *payloadlen); #ifdef LTC_SOURCE /* internal helper functions */ +int der_length_sequence_ex(ltc_asn1_list *list, unsigned long inlen, + unsigned long *outlen, unsigned long *payloadlen); /* SUBJECT PUBLIC KEY INFO */ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen, unsigned int algorithm, void* public_key, unsigned long public_key_len, From e1fcd3ab04868f60685e97f09ee329ce7e3bed1c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 14:26:53 +0200 Subject: [PATCH 0963/1192] add hashsum multi-hash option --- demos/hashsum.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 880a725d2..f9d53ae02 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -159,7 +159,7 @@ static void check_file(int argn, int argc, char **argv) int main(int argc, char **argv) { - int idx, check, z, err, argn; + int idxs[TAB_SIZE], idx, check, y, z, err, argn; unsigned long w, x; unsigned char hash_buffer[MAXBLOCKSIZE]; @@ -175,16 +175,19 @@ int main(int argc, char **argv) die(EXIT_FAILURE); } + for (x = 0; x < sizeof(idxs)/sizeof(idxs[0]); ++x) { + idxs[x] = -2; + } argn = 1; check = 0; - idx = -2; + idx = 0; while(argn < argc){ if(strcmp("-a", argv[argn]) == 0) { argn++; if(argn < argc) { - idx = find_hash(argv[argn]); - if (idx == -1) { + idxs[idx] = find_hash(argv[argn]); + if (idxs[idx] == -1) { struct { const char* is; const char* should; @@ -215,15 +218,20 @@ int main(int argc, char **argv) }; for (x = 0; shasum_compat[x].is != NULL; ++x) { if(XSTRCMP(shasum_compat[x].is, argv[argn]) == 0) { - idx = find_hash(shasum_compat[x].should); + idxs[idx] = find_hash(shasum_compat[x].should); break; } } } - if (idx == -1) { + if (idxs[idx] == -1) { fprintf(stderr, "%s: Unrecognized algorithm\n", hashsum); die(EXIT_FAILURE); } + idx++; + if ((size_t)idx >= sizeof(idxs)/sizeof(idxs[0])) { + fprintf(stderr, "%s: Too many '-a' options chosen\n", hashsum); + die(EXIT_FAILURE); + } argn++; continue; } @@ -245,7 +253,7 @@ int main(int argc, char **argv) if (argc == argn) { w = sizeof(hash_buffer); - if ((err = hash_filehandle(idx, stdin, hash_buffer, &w)) != CRYPT_OK) { + if ((err = hash_filehandle(idxs[0], stdin, hash_buffer, &w)) != CRYPT_OK) { fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err)); return EXIT_FAILURE; } else { @@ -255,14 +263,16 @@ int main(int argc, char **argv) printf(" *-\n"); } } else { - for (z = 3; z < argc; z++) { - w = sizeof(hash_buffer); - if ((err = hash_file(idx,argv[z],hash_buffer,&w)) != CRYPT_OK) { - fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err)); - return EXIT_FAILURE; - } else { - printf_hex(hash_buffer, w); - printf(" *%s\n", argv[z]); + for (z = argn; z < argc; z++) { + for (y = 0; y < idx; ++y) { + w = sizeof(hash_buffer); + if ((err = hash_file(idxs[y],argv[z],hash_buffer,&w)) != CRYPT_OK) { + fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err)); + return EXIT_FAILURE; + } else { + printf_hex(hash_buffer, w); + printf(" *%s\n", argv[z]); + } } } } From 6598dc0c3f6208f36782d200099cceba9d531a52 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 16:45:46 +0200 Subject: [PATCH 0964/1192] update Doxyfile --- doc/Doxyfile | 383 ++++++++++++++++++++++++++++++----------------- doc/footer.html | 10 -- doc/header.html | 12 -- doc/libtomsm.png | Bin 0 -> 17809 bytes 4 files changed, 249 insertions(+), 156 deletions(-) delete mode 100644 doc/footer.html delete mode 100644 doc/header.html create mode 100644 doc/libtomsm.png diff --git a/doc/Doxyfile b/doc/Doxyfile index a740dd814..23d84e242 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.7 +# Doxyfile 1.8.11 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -46,12 +46,12 @@ PROJECT_NUMBER = 1.17 PROJECT_BRIEF = -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = libtomsm.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -60,7 +60,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = doxygen -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where @@ -93,14 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -135,7 +135,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -205,9 +205,9 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -276,7 +276,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. @@ -295,8 +295,8 @@ MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -336,13 +336,20 @@ SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -401,7 +408,7 @@ LOOKUP_CACHE_SIZE = 0 # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -411,35 +418,35 @@ LOOKUP_CACHE_SIZE = 0 EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = YES -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -464,21 +471,21 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be +# (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -492,7 +499,7 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also +# names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. @@ -501,12 +508,19 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -534,14 +548,14 @@ INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -586,27 +600,25 @@ SORT_BY_SCOPE_NAME = YES STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -631,8 +643,8 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -680,8 +692,7 @@ LAYOUT_FILE = # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. +# search path. See also \cite for info how to create references. CITE_BIB_FILES = @@ -697,7 +708,7 @@ CITE_BIB_FILES = QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -705,7 +716,7 @@ QUIET = NO WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -722,12 +733,18 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -751,7 +768,7 @@ WARN_LOGFILE = # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = ../src/ @@ -767,12 +784,17 @@ INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, +# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. FILE_PATTERNS = @@ -858,6 +880,10 @@ IMAGE_PATH = # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -867,11 +893,15 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -931,7 +961,7 @@ REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -978,6 +1008,25 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1008,7 +1057,7 @@ IGNORE_PREFIX = # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1046,7 +1095,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = header.html +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1056,7 +1105,7 @@ HTML_HEADER = header.html # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = footer.html +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1070,13 +1119,15 @@ HTML_FOOTER = footer.html HTML_STYLESHEET = -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = @@ -1092,7 +1143,7 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 @@ -1123,8 +1174,9 @@ HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES @@ -1220,28 +1272,28 @@ GENERATE_HTMLHELP = NO CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1355,7 +1407,7 @@ DISABLE_INDEX = NO # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1383,7 +1435,7 @@ ENUM_VALUES_PER_LINE = 1 TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1412,7 +1464,7 @@ FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1478,7 +1530,7 @@ MATHJAX_CODEFILE = # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. -SEARCHENGINE = NO +SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a web server instead of a web client using Javascript. There @@ -1498,7 +1550,7 @@ SERVER_BASED_SEARCH = NO # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). # @@ -1511,7 +1563,7 @@ EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). See the section "External Indexing and # Searching" for details. @@ -1549,7 +1601,7 @@ EXTRA_SEARCH_MAPPINGS = # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = YES @@ -1580,7 +1632,7 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1598,9 +1650,12 @@ COMPACT_LATEX = NO PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1614,23 +1669,36 @@ EXTRA_PACKAGES = # # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will -# replace them by respectively the title of the page, the current date and time, -# only the current date, the version number of doxygen, the project name (see -# PROJECT_NAME), or the project number (see PROJECT_NUMBER). +# $datetime, $date, $doxygenversion, $projectname, $projectnumber, +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. +# chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. # # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1648,8 +1716,8 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a +# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate +# the PDF file directly from the LaTeX files. Set this option to YES, to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1690,11 +1758,19 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1709,7 +1785,7 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1746,11 +1822,21 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1794,7 +1880,7 @@ MAN_LINKS = NO # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1808,7 +1894,7 @@ GENERATE_XML = NO XML_OUTPUT = xml -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1821,7 +1907,7 @@ XML_PROGRAMLISTING = YES # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1835,14 +1921,23 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the +# program listings (including syntax highlighting and cross-referencing +# information) to the DOCBOOK output. Note that enabling this will significantly +# increase the size of the DOCBOOK output. +# The default value is: NO. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_PROGRAMLISTING = NO + #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sf.net) file that captures the +# structure of the code including all documentation. Note that this feature is +# still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1851,7 +1946,7 @@ GENERATE_AUTOGEN_DEF = NO # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1859,7 +1954,7 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1867,9 +1962,9 @@ GENERATE_PERLMOD = NO PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the +# understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1889,20 +1984,20 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -MACRO_EXPANSION = NO +MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then # the macro expansion is limited to the macros specified with the PREDEFINED and @@ -1912,7 +2007,7 @@ MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1924,7 +2019,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = ../src//headers +INCLUDE_PATH = ../src/headers # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -1942,10 +2037,10 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = LTM_DESC \ - LTC_SOURCE \ - LTC_MRSA \ - LTC_DER +PREDEFINED = LTC_SOURCE \ + LTM_DESC \ + GMP_DESC \ + TFM_DESC # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -1991,20 +2086,21 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. @@ -2021,7 +2117,7 @@ PERL_PATH = /usr/bin/perl # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -2046,7 +2142,7 @@ MSCGEN_PATH = DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2059,7 +2155,7 @@ HIDE_UNDOC_RELATIONS = NO # set to NO # The default value is: YES. -HAVE_DOT = NO +HAVE_DOT = YES # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed # to run in parallel. When set to 0 doxygen will base this on the number of @@ -2071,7 +2167,7 @@ HAVE_DOT = NO DOT_NUM_THREADS = 0 -# When you want a differently looking font n the dot files that doxygen +# When you want a differently looking font in the dot files that doxygen # generates you can specify the font name using DOT_FONTNAME. You need to make # sure dot is able to find the font, which can be done by putting it in a # standard location or by setting the DOTFONTPATH environment variable or by @@ -2119,7 +2215,7 @@ COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2171,7 +2267,8 @@ INCLUDED_BY_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2182,11 +2279,12 @@ CALL_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -CALLER_GRAPH = NO +CALLER_GRAPH = YES # If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical # hierarchy of all classes instead of a textual one. @@ -2205,13 +2303,17 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). # Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, # png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, -# gif:cairo:gd, gif:gd, gif:gd:gd and svg. +# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2254,6 +2356,19 @@ MSCFILE_DIRS = DIAFILE_DIRS = +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file. If left blank, it is assumed +# PlantUML is not used or called during a preprocessing step. Doxygen will +# generate a warning when it encounters a \startuml command in this case and +# will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -2290,7 +2405,7 @@ MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2307,7 +2422,7 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff --git a/doc/footer.html b/doc/footer.html deleted file mode 100644 index fe9ebb114..000000000 --- a/doc/footer.html +++ /dev/null @@ -1,10 +0,0 @@ -
-Code by
Tom
-Docs using doxygen - - - diff --git a/doc/header.html b/doc/header.html deleted file mode 100644 index 22dfddc1b..000000000 --- a/doc/header.html +++ /dev/null @@ -1,12 +0,0 @@ - - -LibTomCrypt: Main Page - - - - - diff --git a/doc/libtomsm.png b/doc/libtomsm.png new file mode 100644 index 0000000000000000000000000000000000000000..3c009a90cd0f87d1156dd68a888af3f760873dd5 GIT binary patch literal 17809 zcmaHSQ*uy&G(?KjTEeq-CVGjTHE#I|i`V%xUuOl;eBa`K&X_h0;Lb?>#S>aJIH z@2&@73UcBIusEM`#@;0?;U~=%*uBF- zyCS%V0ysv&3rr}bC`uePWhbR3si3__{?Mt@i^!7by z?oA~2_Uegr_N%YM1p^iw1P&g_ZMPhy-h)jNlt`5@{zv&D1k!@O4e=U%+-Juhzr|yl zg0h=?nv87EsV80oHjPpf;b9$KfEjIqK75jXbmICeh_CF-P`3*+yAGl9x$-BPwkL>q zEggxoEmEyuRuq|gLRVDw)njOyFClsKLBV0m(QQ#~Zy zeC_tvZf!j}(&(l%(Oab@#|4UPAoeD3V1ma7dO{Zeec_gi5X^Ls$|F)7dnn(`+-jpDC%qn!SG z<`ln~Zc*<4(pgRWV5!)W4$_KAPfzCrBJg7%6sb^8KpaYF7Ag^?oEH-&>-J>x8Ed4g zzM6)KP-l#%w{IGKRcv}^DpA!3j&~oi8W%<=M)DzCpe=TVO>ZVh-YtpO5S6Y(@#G&U zDTPYwvRXeED^almmbKCIO~uLyJmj+szwYnu?j9f2sH=DC=e4xCxTU2=3X|oTAsBZ5 zt*l^wMY(5GL&@<1>$2ekPWm~}7=vZ7AlW zs!68TY8gE-uC4Ql{)Jf2-si#Jvqy@>1W1bnG3Up0=hB%1h~Ngec=B^XSZx`5jh z=l64ZgA*$Htu)3?==-&n{Hsf=9zc}zVYy3f>jcSeITOwC8s?Vm?}Smip7OIS3aF zw#DA>X2WuUK;R%&+_^{7oC*h3IAlaj%&=|*Nu1&2T#t$L!*m4OdQbM}bYvvFH!T-c z#`UybmshFgo|YJVdnj)Hp&9e70Z-KaF_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ToF!5KgYN3ut3jTTK)|f#Z*cm(M z5{ELDCI=pr)JCW+ch;`0Y8elZ0kW_)y97i0(hN48%3Q~d`_%LD_n2a`Vw5%6hG`pz zC-9Y-ENA@=F>C$Hf?OBNFG*5hj$rAzIqZR$Pt6 zBTESK;Hhk8t-(7Icdj{$hr?FbuL@yD&L&MTEJ9k{NNyf1W7=WEnzuqhC0 zjYSREh3qag|LX8oh@zWj2-4TN@guG4m7uzmkMAzT`L5%$hBv^QiJ$1V-kR+D_805e!uWh2-VL-(Qhn@NpL8dWX^Q9OT5t#-^sG!t+2J zbBjn(QBhf0S%MSy_xCUM`b?y}yu7=2?>fG$f`fwv-3MMgMMg&E8q3%`v5}S}FEmRnbl`<82-{If^1?BS zlarHuzy~w3a7e@(7DW5=jXC YAAULDfvG86)Bpeg07*qoM6N<$f?L33r2qf` literal 0 HcmV?d00001 From ac6fb72ef1d230e9404b026dc6a2dd53c9b119de Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 17:06:14 +0200 Subject: [PATCH 0965/1192] fix some doxygen headers --- src/hashes/chc/chc.c | 10 ++++++++-- src/hashes/md4.c | 1 + src/hashes/md5.c | 1 + src/hashes/rmd128.c | 1 + src/hashes/rmd160.c | 1 + src/hashes/rmd256.c | 1 + src/hashes/rmd320.c | 1 + src/hashes/sha1.c | 1 + src/hashes/sha2/sha256.c | 1 + src/hashes/sha2/sha512.c | 1 + src/hashes/tiger.c | 1 + src/hashes/whirl/whirl.c | 1 + src/misc/compare_testvector.c | 15 +++++++++++++-- .../generalizedtime/der_encode_generalizedtime.c | 4 ++-- .../generalizedtime/der_length_generalizedtime.c | 2 +- 15 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index d9f9e7798..8a127508a 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -153,9 +153,15 @@ static int chc_compress(hash_state *md, unsigned char *buf) return CRYPT_OK; } -/* function for processing blocks */ +/** + Function for processing blocks + @param md The hash state + @param buf The data to hash + @param len The length of the data (octets) + @return CRYPT_OK if successful +*/ static int _chc_process(hash_state * md, const unsigned char *buf, unsigned long len); -static HASH_PROCESS(_chc_process, chc_compress, chc, (unsigned long)cipher_blocksize) +HASH_PROCESS(_chc_process, chc_compress, chc, (unsigned long)cipher_blocksize) /** Process a block of memory though the hash diff --git a/src/hashes/md4.c b/src/hashes/md4.c index cddc2b58a..6a1cee403 100644 --- a/src/hashes/md4.c +++ b/src/hashes/md4.c @@ -188,6 +188,7 @@ int md4_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int md4_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(md4_process, md4_compress, md4, 64) /** diff --git a/src/hashes/md5.c b/src/hashes/md5.c index 93fe2ec28..edf887731 100644 --- a/src/hashes/md5.c +++ b/src/hashes/md5.c @@ -247,6 +247,7 @@ int md5_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int md5_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(md5_process, md5_compress, md5, 64) /** diff --git a/src/hashes/rmd128.c b/src/hashes/rmd128.c index 26e64b281..62bfe4309 100644 --- a/src/hashes/rmd128.c +++ b/src/hashes/rmd128.c @@ -286,6 +286,7 @@ int rmd128_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int rmd128_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(rmd128_process, rmd128_compress, rmd128, 64) /** diff --git a/src/hashes/rmd160.c b/src/hashes/rmd160.c index 165afd26e..2e0562ba2 100644 --- a/src/hashes/rmd160.c +++ b/src/hashes/rmd160.c @@ -345,6 +345,7 @@ int rmd160_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int rmd160_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(rmd160_process, rmd160_compress, rmd160, 64) /** diff --git a/src/hashes/rmd256.c b/src/hashes/rmd256.c index c2149b675..0ac59f9d9 100644 --- a/src/hashes/rmd256.c +++ b/src/hashes/rmd256.c @@ -299,6 +299,7 @@ int rmd256_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int rmd256_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(rmd256_process, rmd256_compress, rmd256, 64) /** diff --git a/src/hashes/rmd320.c b/src/hashes/rmd320.c index 0098e0b7e..d2e1896bd 100644 --- a/src/hashes/rmd320.c +++ b/src/hashes/rmd320.c @@ -364,6 +364,7 @@ int rmd320_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int rmd320_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(rmd320_process, rmd320_compress, rmd320, 64) /** diff --git a/src/hashes/sha1.c b/src/hashes/sha1.c index 8fbdabfd4..f7a0c5d0d 100644 --- a/src/hashes/sha1.c +++ b/src/hashes/sha1.c @@ -180,6 +180,7 @@ int sha1_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int sha1_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(sha1_process, sha1_compress, sha1, 64) /** diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index 723e8aa65..1e886e57e 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -225,6 +225,7 @@ int sha256_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int sha256_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(sha256_process, sha256_compress, sha256, 64) /** diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index d169a9118..1ba719d4a 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -193,6 +193,7 @@ int sha512_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int sha512_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(sha512_process, sha512_compress, sha512, 128) /** diff --git a/src/hashes/tiger.c b/src/hashes/tiger.c index 2438626d8..5a8f248b3 100644 --- a/src/hashes/tiger.c +++ b/src/hashes/tiger.c @@ -671,6 +671,7 @@ int tiger_init(hash_state *md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int tiger_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(tiger_process, tiger_compress, tiger, 64) /** diff --git a/src/hashes/whirl/whirl.c b/src/hashes/whirl/whirl.c index fe152cd22..8a2d01015 100644 --- a/src/hashes/whirl/whirl.c +++ b/src/hashes/whirl/whirl.c @@ -138,6 +138,7 @@ int whirlpool_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ +int whirlpool_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(whirlpool_process, whirlpool_compress, whirlpool, 64) /** diff --git a/src/misc/compare_testvector.c b/src/misc/compare_testvector.c index cc1cb5fe6..82433c6f8 100644 --- a/src/misc/compare_testvector.c +++ b/src/misc/compare_testvector.c @@ -10,7 +10,7 @@ #include "tomcrypt.h" /** - @file compare_testvecotr.c + @file compare_testvector.c Function to compare two testvectors and print a (detailed) error-message if required, Steffen Jaeckel */ @@ -49,13 +49,24 @@ static void _print_hex(const char* what, const void* v, const unsigned long l) } #endif +/** + Compare two test-vectors + + @param is The data as it is + @param is_len The length of is + @param should The data as it should + @param should_len The length of should + @param what The type of the data + @param which The iteration count + @return 0 on equality, -1 or 1 on difference +*/ int compare_testvector(const void* is, const unsigned long is_len, const void* should, const unsigned long should_len, const char* what, int which) { int res = 0; if(is_len != should_len) res = is_len > should_len ? -1 : 1; else - res = XMEMCMP(is, should, MAX(is_len, should_len)); + res = XMEMCMP(is, should, is_len); #if defined(LTC_TEST) && defined(LTC_TEST_DBG) if (res != 0) { diff --git a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c index f32efe81a..ddc472acb 100644 --- a/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.c @@ -32,8 +32,8 @@ static const char * const baseten = "0123456789"; /** Encodes a Generalized time structure in DER format - @param utctime The UTC time structure to encode - @param out The destination of the DER encoding of the UTC time structure + @param gtime The GeneralizedTime structure to encode + @param out The destination of the DER encoding of the GeneralizedTime structure @param outlen [in/out] The length of the DER encoding @return CRYPT_OK if successful */ diff --git a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c index e6cb35f0f..def6270eb 100644 --- a/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c +++ b/src/pk/asn1/der/generalizedtime/der_length_generalizedtime.c @@ -18,7 +18,7 @@ /** Gets length of DER encoding of GeneralizedTime - @param utctime The UTC time structure to get the size of + @param gtime The GeneralizedTime structure to get the size of @param outlen [out] The length of the DER encoding @return CRYPT_OK if successful */ From b59f066de3556b63b1870bf6a4adbc44b94bf75f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 28 Jun 2017 19:10:45 +0200 Subject: [PATCH 0966/1192] update prng section in doc --- doc/crypt.tex | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index a10042a2b..51b36b61a 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -3016,9 +3016,9 @@ \subsection{Example} void (*done)(prng_state *); - int (*export)(unsigned char *, unsigned long *, prng_state *); + int (*pexport)(unsigned char *, unsigned long *, prng_state *); - int (*import)(const unsigned char *, unsigned long, prng_state *); + int (*pimport)(const unsigned char *, unsigned long, prng_state *); int (*test)(void); }; @@ -3050,10 +3050,12 @@ \subsection{PRNGs Provided} \begin{small} \begin{tabular}{|c|c|l|} \hline \textbf{Name} & \textbf{Descriptor} & \textbf{Usage} \\ +\hline ChaCha20 & chacha20\_prng\_desc & Stream Cipher PRNG (recommended, fast) \\ +\hline Fortuna & fortuna\_desc & Fast long-term PRNG (recommended, secure) \\ +\hline RC4 & rc4\_desc & Stream Cipher PRNG \\ +\hline SOBER-128 & sober128\_desc & Stream Cipher PRNG \\ +\hline sprng & sprng\_desc & Secure PRNG using the System RNG \\ \hline Yarrow & yarrow\_desc & Fast short-term PRNG \\ -\hline Fortuna & fortuna\_desc & Fast long-term PRNG (recommended) \\ -\hline RC4 & rc4\_desc & Stream Cipher \\ -\hline SOBER-128 & sober128\_desc & Stream Cipher (also very fast PRNG) \\ \hline \end{tabular} \end{small} @@ -3066,7 +3068,7 @@ \subsubsection{Yarrow} (keyboard, mouse, interrupts, etc), and produce an unbounded string of random bytes. \textit{Note:} This PRNG is still secure for most tasks but is no longer recommended. Users -should use Fortuna instead. +should use Fortuna or ChaCha20 instead. \subsubsection{Fortuna} @@ -3089,14 +3091,9 @@ \subsubsection{Fortuna} \subsubsection{RC4} RC4 is an old stream cipher that can also double duty as a PRNG in a pinch. You key RC4 by -calling add\_entropy(), and setup the key by calling ready(). You can only add up to 256 bytes via -add\_entropy(). +calling add\_entropy(), and setup the key by calling ready(). -When you read from RC4, the output is XOR'ed against your buffer you provide. In this manner, you can use rc4\_read() -as an encrypt (and decrypt) function. - -You really should not use RC4. This is not because RC4 is weak, (though biases are known to exist) but simply due to -the fact that faster alternatives exist. +You really should not use RC4 for cryptographical purposes, it's broken. \subsubsection{SOBER-128} @@ -3114,10 +3111,17 @@ \subsubsection{SOBER-128} Like RC4, the output of SOBER--128 is XOR'ed against the buffer you provide it. In this manner, you can use sober128\_read() as an encrypt (and decrypt) function. -Since SOBER-128 has a fixed keying scheme, and is very fast (faster than RC4) the ideal usage of SOBER-128 is to +Since SOBER--128 has a fixed keying scheme, and is very fast (faster than RC4) the ideal usage of SOBER-128 is to key it from the output of Fortuna (or Yarrow), and use it to encrypt messages. It is also ideal for simulations which need a high quality (and fast) stream of bytes. +\subsubsection{ChaCha20} + +ChaCha20 is a fast stream cipher built on a pseudorandom function designed by Daniel J. Bernstein. +It can also double duty as a PRNG. + +The implementation supports adding entropy via the add\_entropy() function while already being operational. + \subsubsection{Example Usage} \begin{small} \begin{verbatim} @@ -3225,6 +3229,7 @@ \subsubsection{Example Usage} \end{small} \subsection{The Secure PRNG Interface} +\index{sprng\_desc} It is possible to access the secure RNG through the PRNG interface, and in turn use it within dependent functions such as the PK API. This simplifies the cryptosystem on platforms where the secure RNG is fast. The secure PRNG never requires to be started, that is you need not call the start, add\_entropy, or ready functions. For example, consider From ac6f62badcf4067a5f8c0d8635c8cb06cd3393aa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 13:04:59 +0200 Subject: [PATCH 0967/1192] update changes --- changes | 59 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/changes b/changes index 85e0d8c6a..eed46fc27 100644 --- a/changes +++ b/changes @@ -1,33 +1,52 @@ -XXX, 2014 +XXX, 2017 v1.18.0 - -- Added Camellia block cipher - -- Thanks to Karel Miko for cotributing a bunchload of patches and additions, namely - OCBv3, DSA and ECC key generation FIPS-186-4 compliance, BASE64-URL encoding, - a bugfix in Camellia, + -- Bugfix multi2 + -- Bugfix Noekeon + -- Bugfix XTEA + -- Bugfix rng_get_bytes() on windows where we could read from c:\dev\random + -- Fixed the Bleichbacher Signature attack in PKCS#1 v1.5 EMSA, thanks to Alex Dent + -- Fixed a potential cache-based timing attack in CCM, thanks to Sebastian Verschoor + -- Fix GCM counter reuse and potential timing attacks in EAX, OCB and OCBv3, + thanks to Raphaël Jamet + -- Implement hardened RSA operations when CRT is used + -- Enabled timing resistant calculations of ECC and RSA operations per default + -- Applied some patches from the OLPC project regarding PKCS#1 and preventing + the hash algorithms from overflowing -- Larry Bugbee contributed the necessary stuff to more easily call libtomcrypt from a dynamic language like Python, as shown in his pyTomCrypt -- Nikos Mavrogiannopoulos contributed RSA blinding and export of RSA and DSA keys in OpenSSL/GnuTLS compatible format -- Patrick Pelletier contributed a smart volley of patches - -- RyanC contributed HKDF including documentation (yippie) - -- Added 2-key Triple-DES mode, thanks to Paul Howarth -- Christopher Brown contributed some patches and additions to ASN.1/DER - -- Pascal Brand of STMicroelectronics contributed patches regarding the + -- Pascal Brand of STMicroelectronics contributed patches regarding CCM, the XTS mode and RSA private key operations with keys without CRT parameters - -- Applied some patches from the OLPC project regarding PKCS#1 and preventing - the hash algorithms from overflowing - -- Fixed the Bleichbacher Signature attack in PKCS#1 v1.5 EMSA, thanks to Alex Dent - -- Add PKCS#1 testvectors from RSA - -- Brought back Diffie-Hellman - -- Enabled timing resistant calculations of ECC and RSA operations per default - -- Fixed several build issues on FreeBSD, NetBSD, Linux x32 ABI, x86_64 Windows ... + -- RC2 now also works with smaller key-sizes + -- Improved/extended several tests & demos + -- Fixed all compiler warnings + -- Fixed several build issues on FreeBSD, NetBSD, Linux x32 ABI, HP-UX/IA64, + Mac OS X, Windows (32&64bit, MingW&MSVC) ... + -- Re-worked all makefiles + -- Re-worked most PRNG's + -- The code is now verified by a linter, thanks to Francois Perrad -- Documentation (crypt.pdf) is now built deterministically, thanks to Michael Stapelberg - -- Removed all compiler warnings - -- Improved/extended several tests + -- Add Adler32 and CRC32 checksum algorithms + -- Add Base64-URL de-/encoding and some strict variants + -- Add Blake2b & Blake2s (hash & mac), thanks to Kelvin Sherlock + -- Add Camellia block cipher + -- Add ChaCha20 (stream cipher), Poly1305 (mac), ChaCha20Poly1305 (encauth) + -- Add constant-time mem-compare mem_neq() + -- Add DER GeneralizedTime de-/encoding + -- Add DSA and ECC key generation FIPS-186-4 compliance + -- Add HKDF, thanks to RyanC (especially for also providing documentation :-) ) + -- Add OCBv3 + -- Add PKCS#1 v1.5 mode of SSL3.0 + -- Add PKCS#1 testvectors from RSA + -- Add PKCS#8 import for RSA keys + -- Add stream cipher API + -- Add SHA3 & SHAKE -- Add SHA512/256 and SHA512/224 - -- Bugfix multi2 - -- Bugfix Noekeon - -- Bugfix XTEA + -- Add Triple-DES 2-key mode, thanks to Paul Howarth + -- Brought back Diffie-Hellman May 12th, 2007 v1.17 -- Cryptography Research Inc. contributed another small volley of patches, one to fix __WCHAR_DEFINED__ for BSD platforms, From d03635acab0bbbb7f0491fc1a9d3bef14e6eed4c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 13:20:50 +0200 Subject: [PATCH 0968/1192] support patch-releases in helper.pl --- helper.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helper.pl b/helper.pl index 90308aea8..34eca0dc7 100755 --- a/helper.pl +++ b/helper.pl @@ -276,8 +276,8 @@ sub patch_makefile { sub version_form_tomcrypt_h { my $h = read_file(shift); - if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)"/s) { - return "VERSION=$1.$2", "VERSION_LT=0:$1$2"; + if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+).*"/s) { + return "VERSION=$1.$2.$3", "VERSION_LT=0:$1$2"; } else { die "#define SCRYPT not found in tomcrypt.h"; From fa5acee8028c32cb864cc2d16f0b5a4e3478aaec Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 13:28:36 +0200 Subject: [PATCH 0969/1192] bump version --- doc/Doxyfile | 2 +- src/headers/tomcrypt.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index 23d84e242..fd45375eb 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = LibTomCrypt # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.17 +PROJECT_NUMBER = 1.18.0-rc1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 803e643d1..e902119ee 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -26,8 +26,8 @@ extern "C" { #endif /* version */ -#define CRYPT 0x0117 -#define SCRYPT "1.17" +#define CRYPT 0x0118 +#define SCRYPT "1.18.0-rc1" /* max size of either a cipher/hash block or symmetric key [largest of the two] */ #define MAXBLOCKSIZE 128 From a8965f048a31973a78e2dc9369ddccfb471577b5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 13:29:05 +0200 Subject: [PATCH 0970/1192] Update makefiles --- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 9a42b573f..67de35032 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -27,7 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath #Compilation flags LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.17 +VERSION=1.18.0 #Libraries to be created LIBMAIN_S =libtomcrypt.a diff --git a/makefile.msvc b/makefile.msvc index f847f7b79..1c8700585 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -22,7 +22,7 @@ EXTRALIBS = ../libtommath/tommath.lib #Compilation flags LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) -VERSION=1.17 +VERSION=1.18.0 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib diff --git a/makefile.unix b/makefile.unix index 7b9b8ae9a..870f75152 100644 --- a/makefile.unix +++ b/makefile.unix @@ -39,7 +39,7 @@ EXTRALIBS = ../libtommath/libtommath.a #Compilation flags LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.17 +VERSION=1.18.0 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a diff --git a/makefile_include.mk b/makefile_include.mk index 78ec3c447..afe51094c 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -3,9 +3,9 @@ # (GNU make only) # The version - BEWARE: VERSION and VERSION_LT are updated via ./updatemakes.sh -VERSION=1.17 +VERSION=1.18.0 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html -VERSION_LT=0:117 +VERSION_LT=0:118 # Compiler and Linker Names ifndef CROSS_COMPILE From e53858c7402de08b0480a84a44886077a23a6f64 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 13:57:13 +0200 Subject: [PATCH 0971/1192] update VERSION variables in makefiles VERSION is now VERSION_PC the new VERSION contains the entire string of SCRYPT --- helper.pl | 8 ++++---- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.shared | 2 +- makefile.unix | 2 +- makefile_include.mk | 5 +++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/helper.pl b/helper.pl index 34eca0dc7..e8e9fc7b6 100755 --- a/helper.pl +++ b/helper.pl @@ -274,10 +274,10 @@ sub patch_makefile { return $content; } -sub version_form_tomcrypt_h { +sub version_from_tomcrypt_h { my $h = read_file(shift); - if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+).*"/s) { - return "VERSION=$1.$2.$3", "VERSION_LT=0:$1$2"; + if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+)(.*)"/s) { + return "VERSION_PC=$1.$2.$3", "VERSION_LT=0:$1$2", "VERSION=$1.$2.$3$4"; } else { die "#define SCRYPT not found in tomcrypt.h"; @@ -304,7 +304,7 @@ sub process_makefiles { my $var_to = prepare_variable("TOBJECTS", sort map { my $x = $_; $x =~ s/\.c$/.o/; $x } @t); (my $var_tobj = $var_to) =~ s/\.o\b/.obj/sg; - my @ver_version = version_form_tomcrypt_h("src/headers/tomcrypt.h"); + my @ver_version = version_from_tomcrypt_h("src/headers/tomcrypt.h"); # update MSVC project files my $msvc_files = prepare_msvc_files_xml(\@all, qr/tab\.c$/, ['Debug|Win32', 'Release|Win32', 'Debug|x64', 'Release|x64']); diff --git a/makefile.mingw b/makefile.mingw index 67de35032..021335898 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -27,7 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath #Compilation flags LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0 +VERSION=1.18.0-rc1 #Libraries to be created LIBMAIN_S =libtomcrypt.a diff --git a/makefile.msvc b/makefile.msvc index 1c8700585..be1988aea 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -22,7 +22,7 @@ EXTRALIBS = ../libtommath/tommath.lib #Compilation flags LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) -VERSION=1.18.0 +VERSION=1.18.0-rc1 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib diff --git a/makefile.shared b/makefile.shared index 3efde7bae..0a69bf923 100644 --- a/makefile.shared +++ b/makefile.shared @@ -46,7 +46,7 @@ $(LIBNAME): $(OBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo" | LC_ALL=C sort` $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) install: .common_install - sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc + sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc install -d $(DESTDIR)$(LIBPATH)/pkgconfig install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ diff --git a/makefile.unix b/makefile.unix index 870f75152..39722e820 100644 --- a/makefile.unix +++ b/makefile.unix @@ -39,7 +39,7 @@ EXTRALIBS = ../libtommath/libtommath.a #Compilation flags LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0 +VERSION=1.18.0-rc1 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a diff --git a/makefile_include.mk b/makefile_include.mk index afe51094c..6fce58292 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -2,8 +2,9 @@ # Include makefile used by makefile + makefile.shared # (GNU make only) -# The version - BEWARE: VERSION and VERSION_LT are updated via ./updatemakes.sh -VERSION=1.18.0 +# The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh +VERSION=1.18.0-rc1 +VERSION_PC=1.18.0 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION_LT=0:118 From f15e0172ca6ae0818b11d1117cfd9f723463b36e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 14:43:21 +0200 Subject: [PATCH 0972/1192] Travis: also build master and 'release/*' branches --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 77e525468..6d35d6b2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,9 @@ matrix: fast_finish: true branches: only: + - master - develop + - /^release\/.*$/ compiler: - gcc From 749873c306e61a96286c5c41762912e8909185e4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 6 Jul 2017 10:19:38 +0200 Subject: [PATCH 0973/1192] fix docs generation with TeX Live 2017 [skip ci] --- doc/crypt.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 51b36b61a..dbe67e8d7 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -31,7 +31,6 @@ \def\And{{\rm\ and\ }} \def\iff{\hspace{1em}\Longleftrightarrow\hspace{1em}} \def\implies{\Rightarrow} -\def\undefined{{\rm \textit{undefined}}} \def\Proof{\vspace{1ex}\noindent {\bf Proof:}\hspace{1em}} \let\oldphi\phi \def\phi{\varphi} From 68bf547f9c46aa537564f6af896670687cfb46f5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 16:02:11 +0200 Subject: [PATCH 0974/1192] use rsa_free() on error in rsa_make_key() --- src/pk/rsa/rsa_make_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_make_key.c b/src/pk/rsa/rsa_make_key.c index 23b98e047..065f733f4 100644 --- a/src/pk/rsa/rsa_make_key.c +++ b/src/pk/rsa/rsa_make_key.c @@ -97,7 +97,7 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) err = CRYPT_OK; goto cleanup; errkey: - mp_clear_multi(key->q, key->p, key->qP, key->dP, key->dQ, key->N, key->d, key->e, NULL); + rsa_free(key); cleanup: mp_clear_multi(tmp3, tmp2, tmp1, q, p, NULL); return err; From 2aa42f002f0bed959fa4a1de909b843c9830e524 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 8 Jul 2017 18:20:00 +0200 Subject: [PATCH 0975/1192] fix: chmod -x --- src/math/rand_bn.c | 0 src/pk/dsa/dsa_set.c | 0 src/pk/dsa/dsa_set_pqg_dsaparam.c | 0 src/pk/rsa/rsa_import_pkcs8.c | 0 src/pk/rsa/rsa_set.c | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/math/rand_bn.c mode change 100755 => 100644 src/pk/dsa/dsa_set.c mode change 100755 => 100644 src/pk/dsa/dsa_set_pqg_dsaparam.c mode change 100755 => 100644 src/pk/rsa/rsa_import_pkcs8.c mode change 100755 => 100644 src/pk/rsa/rsa_set.c diff --git a/src/math/rand_bn.c b/src/math/rand_bn.c old mode 100755 new mode 100644 diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c old mode 100755 new mode 100644 diff --git a/src/pk/dsa/dsa_set_pqg_dsaparam.c b/src/pk/dsa/dsa_set_pqg_dsaparam.c old mode 100755 new mode 100644 diff --git a/src/pk/rsa/rsa_import_pkcs8.c b/src/pk/rsa/rsa_import_pkcs8.c old mode 100755 new mode 100644 diff --git a/src/pk/rsa/rsa_set.c b/src/pk/rsa/rsa_set.c old mode 100755 new mode 100644 From b89f3d8b5a21b67a7d713e324dbf759f21a92760 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 9 Jul 2017 10:37:31 +0200 Subject: [PATCH 0976/1192] fix: chmod -x notes/rsa-testvectors/*.txt --- notes/rsa-testvectors/oaep-int.txt | 0 notes/rsa-testvectors/oaep-vect.txt | 0 notes/rsa-testvectors/pkcs1v15crypt-vectors.txt | 0 notes/rsa-testvectors/pkcs1v15sign-vectors.txt | 0 notes/rsa-testvectors/pss-int.txt | 0 notes/rsa-testvectors/pss-vect.txt | 0 notes/rsa-testvectors/readme.txt | 0 7 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 notes/rsa-testvectors/oaep-int.txt mode change 100755 => 100644 notes/rsa-testvectors/oaep-vect.txt mode change 100755 => 100644 notes/rsa-testvectors/pkcs1v15crypt-vectors.txt mode change 100755 => 100644 notes/rsa-testvectors/pkcs1v15sign-vectors.txt mode change 100755 => 100644 notes/rsa-testvectors/pss-int.txt mode change 100755 => 100644 notes/rsa-testvectors/pss-vect.txt mode change 100755 => 100644 notes/rsa-testvectors/readme.txt diff --git a/notes/rsa-testvectors/oaep-int.txt b/notes/rsa-testvectors/oaep-int.txt old mode 100755 new mode 100644 diff --git a/notes/rsa-testvectors/oaep-vect.txt b/notes/rsa-testvectors/oaep-vect.txt old mode 100755 new mode 100644 diff --git a/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt b/notes/rsa-testvectors/pkcs1v15crypt-vectors.txt old mode 100755 new mode 100644 diff --git a/notes/rsa-testvectors/pkcs1v15sign-vectors.txt b/notes/rsa-testvectors/pkcs1v15sign-vectors.txt old mode 100755 new mode 100644 diff --git a/notes/rsa-testvectors/pss-int.txt b/notes/rsa-testvectors/pss-int.txt old mode 100755 new mode 100644 diff --git a/notes/rsa-testvectors/pss-vect.txt b/notes/rsa-testvectors/pss-vect.txt old mode 100755 new mode 100644 diff --git a/notes/rsa-testvectors/readme.txt b/notes/rsa-testvectors/readme.txt old mode 100755 new mode 100644 From 3806629e9e28abae3c2eff0c7513a24e20f8ba09 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 16:45:04 +0200 Subject: [PATCH 0977/1192] fix default make target --- makefile_include.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/makefile_include.mk b/makefile_include.mk index 6fce58292..0dacc3f72 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -151,6 +151,11 @@ else GROUP=wheel endif + +#The default rule for make builds the libtomcrypt library. +default: library + + # List of objects to compile (all goes to libtomcrypt.a) OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \ src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \ @@ -332,10 +337,6 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c - -#The default rule for make builds the libtomcrypt library. -default:library - $(DOBJECTS): CFLAGS += -Itests $(TOBJECTS): CFLAGS += -Itests From 221f7f223db5cf570c4d3c9faf8e6857d1b9ab53 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 10 Jul 2017 10:16:35 +0200 Subject: [PATCH 0978/1192] add 'uninstall' make target [skip ci] --- makefile | 3 +++ makefile.shared | 4 ++++ makefile_include.mk | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/makefile b/makefile index f0a5b688e..7bd345325 100644 --- a/makefile +++ b/makefile @@ -26,6 +26,7 @@ ifndef RANLIB RANLIB:=$(CROSS_COMPILE)ranlib endif INSTALL_CMD = install +UNINSTALL_CMD = rm #Output filenames for various targets. ifndef LIBNAME @@ -93,6 +94,8 @@ install: .common_install install_bins: .common_install_bins +uninstall: .common_uninstall + profile: CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" ./timing diff --git a/makefile.shared b/makefile.shared index 0a69bf923..bb83c9fd2 100644 --- a/makefile.shared +++ b/makefile.shared @@ -25,6 +25,7 @@ ifndef LT endif LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) INSTALL_CMD = $(LT) --mode=install install +UNINSTALL_CMD = $(LT) --mode=uninstall rm #Output filenames for various targets. ifndef LIBNAME @@ -52,6 +53,9 @@ install: .common_install install_bins: .common_install_bins +uninstall: .common_uninstall + rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc + test: $(LIBNAME) $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) diff --git a/makefile_include.mk b/makefile_include.mk index 0dacc3f72..a7ec04264 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -30,6 +30,9 @@ endif ifndef INSTALL_CMD $(error your makefile must define INSTALL_CMD) endif +ifndef UNINSTALL_CMD +$(error your makefile must define UNINSTALL_CMD) +endif ifndef EXTRALIBS ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),) @@ -383,6 +386,12 @@ install_docs: doc/crypt.pdf install_hooks: for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done + +HEADER_FILES=$(notdir $(HEADERS)) +.common_uninstall: + $(UNINSTALL_CMD) $(LIBPATH)/$(LIBNAME) + rm $(HEADER_FILES:%=$(INCPATH)/%) + #This rule cleans the source tree of all compiled code, not including the pdf #documentation. clean: From dd5996dd1f77e5782637b861842c74f01f0d252c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 10 Jul 2017 10:20:36 +0200 Subject: [PATCH 0979/1192] don't find the lo's to link, but use the list of objects --- makefile.shared | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/makefile.shared b/makefile.shared index bb83c9fd2..529ec6536 100644 --- a/makefile.shared +++ b/makefile.shared @@ -43,8 +43,10 @@ src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c .c.o: $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< +LOBJECTS = $(OBJECTS:.o=.lo) + $(LIBNAME): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo" | LC_ALL=C sort` $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) + $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) install: .common_install sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc From 0792e3701edb0edcfea2ea04facddd3f998ca6ed Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 9 Jul 2017 21:45:17 +0200 Subject: [PATCH 0980/1192] GCM allow skipping gcm_add_aad and gcm_process --- src/encauth/gcm/gcm_done.c | 9 +++++++++ src/encauth/gcm/gcm_process.c | 5 +++++ src/encauth/gcm/gcm_test.c | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/src/encauth/gcm/gcm_done.c b/src/encauth/gcm/gcm_done.c index 6b0b460fa..ffd551e83 100644 --- a/src/encauth/gcm/gcm_done.c +++ b/src/encauth/gcm/gcm_done.c @@ -40,6 +40,15 @@ int gcm_done(gcm_state *gcm, return err; } + if (gcm->mode == LTC_GCM_MODE_IV) { + /* let's process the IV */ + if ((err = gcm_add_aad(gcm, NULL, 0)) != CRYPT_OK) return err; + } + + if (gcm->mode == LTC_GCM_MODE_AAD) { + /* let's process the AAD */ + if ((err = gcm_process(gcm, NULL, 0, NULL, 0)) != CRYPT_OK) return err; + } if (gcm->mode != LTC_GCM_MODE_TEXT) { return CRYPT_INVALID_ARG; diff --git a/src/encauth/gcm/gcm_process.c b/src/encauth/gcm/gcm_process.c index 3089ea1f8..b1ec20cf2 100644 --- a/src/encauth/gcm/gcm_process.c +++ b/src/encauth/gcm/gcm_process.c @@ -52,6 +52,11 @@ int gcm_process(gcm_state *gcm, return CRYPT_INVALID_ARG; } + if (gcm->mode == LTC_GCM_MODE_IV) { + /* let's process the IV */ + if ((err = gcm_add_aad(gcm, NULL, 0)) != CRYPT_OK) return err; + } + /* in AAD mode? */ if (gcm->mode == LTC_GCM_MODE_AAD) { /* let's process the AAD */ diff --git a/src/encauth/gcm/gcm_test.c b/src/encauth/gcm/gcm_test.c index e09e50c88..013402d91 100644 --- a/src/encauth/gcm/gcm_test.c +++ b/src/encauth/gcm/gcm_test.c @@ -325,6 +325,7 @@ int gcm_test(void) int idx, err; unsigned long x, y; unsigned char out[2][128], T[2][16]; + gcm_state gcm; /* find aes */ idx = find_cipher("aes"); @@ -335,6 +336,15 @@ int gcm_test(void) } } + /* Special test case for empty AAD + empty PT */ + y = sizeof(T[0]); + if ((err = gcm_init(&gcm, idx, tests[0].K, tests[0].keylen)) != CRYPT_OK) return err; + if ((err = gcm_add_iv(&gcm, tests[0].IV, tests[0].IVlen)) != CRYPT_OK) return err; + /* intentionally skip gcm_add_aad + gcm_process */ + if ((err = gcm_done(&gcm, T[0], &y)) != CRYPT_OK) return err; + if (compare_testvector(out[0], 0, tests[0].C, tests[0].ptlen, "GCM CT-special", 0)) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(T[0], y, tests[0].T, 16, "GCM Encrypt Tag-special", 0)) return CRYPT_FAIL_TESTVECTOR; + for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { y = sizeof(T[0]); if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, From e20e204b8cb60459eb8d09113580abe7792d2132 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 11 Jul 2017 00:13:26 +0200 Subject: [PATCH 0981/1192] dh_set_key + dsa_set_key API change described in #248 --- src/headers/tomcrypt_pk.h | 8 ++------ src/pk/dh/dh_set.c | 24 +++++++----------------- src/pk/dsa/dsa_set.c | 11 +++++------ tests/dh_test.c | 6 +++--- tests/dsa_test.c | 12 ++++++------ 5 files changed, 23 insertions(+), 38 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 89e961119..49b9a9b13 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -224,9 +224,7 @@ int dh_set_pg(const unsigned char *p, unsigned long plen, int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); int dh_set_pg_groupsize(int groupsize, dh_key *key); -int dh_set_key(const unsigned char *pub, unsigned long publen, - const unsigned char *priv, unsigned long privlen, - dh_key *key); +int dh_set_key(const unsigned char *in, unsigned long inlen, int type, dh_key *key); int dh_generate_key(prng_state *prng, int wprng, dh_key *key); int dh_shared_secret(dh_key *private_key, dh_key *public_key, @@ -449,9 +447,7 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, dsa_key *key); int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); -int dsa_set_key(const unsigned char *pub, unsigned long publen, - const unsigned char *priv, unsigned long privlen, - dsa_key *key); +int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key *key); int dsa_generate_key(prng_state *prng, int wprng, dsa_key *key); void dsa_free(dsa_key *key); diff --git a/src/pk/dh/dh_set.c b/src/pk/dh/dh_set.c index edd28bb88..8dd3f0d46 100644 --- a/src/pk/dh/dh_set.c +++ b/src/pk/dh/dh_set.c @@ -87,31 +87,21 @@ int dh_set_pg_groupsize(int groupsize, dh_key *key) @param key [out] the destination for the imported key @return CRYPT_OK if successful */ -int dh_set_key(const unsigned char *pub, unsigned long publen, - const unsigned char *priv, unsigned long privlen, - dh_key *key) +int dh_set_key(const unsigned char *in, unsigned long inlen, int type, dh_key *key) { int err; LTC_ARGCHK(key != NULL); LTC_ARGCHK(ltc_mp.name != NULL); - if(priv == NULL) { - if ((err = mp_read_unsigned_bin(key->y, (unsigned char*)pub, publen)) != CRYPT_OK) { goto LBL_ERR; } - key->type = PK_PUBLIC; - mp_clear(key->x); - key->x = NULL; + if (type == PK_PRIVATE) { + key->type = PK_PRIVATE; + if ((err = mp_read_unsigned_bin(key->x, (unsigned char*)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { goto LBL_ERR; } } else { - if ((err = mp_read_unsigned_bin(key->x, (unsigned char*)priv, privlen)) != CRYPT_OK) { goto LBL_ERR; } - if (pub != NULL) { - if ((err = mp_read_unsigned_bin(key->y, (unsigned char*)pub, publen)) != CRYPT_OK) { goto LBL_ERR; } - } - else { - /* compute y value */ - if ((err = mp_exptmod(key->base, key->x, key->prime, key->y)) != CRYPT_OK) { goto LBL_ERR; } - } - key->type = PK_PRIVATE; + key->type = PK_PUBLIC; + if ((err = mp_read_unsigned_bin(key->y, (unsigned char*)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } } /* check public key */ diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index d25de01bd..fd183411a 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -66,9 +66,7 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, @param key [out] the destination for the imported key @return CRYPT_OK if successful. */ -int dsa_set_key(const unsigned char *pub, unsigned long publen, - const unsigned char *priv, unsigned long privlen, - dsa_key *key) +int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key *key) { int err; @@ -80,13 +78,14 @@ int dsa_set_key(const unsigned char *pub, unsigned long publen, LTC_ARGCHK(key->q != NULL); LTC_ARGCHK(ltc_mp.name != NULL); - if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)pub , publen)) != CRYPT_OK) { goto LBL_ERR; } - if (priv != NULL) { + if (type == PK_PRIVATE) { key->type = PK_PRIVATE; - if ((err = mp_read_unsigned_bin(key->x, (unsigned char *)priv , privlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_read_unsigned_bin(key->x, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto LBL_ERR; } } else { key->type = PK_PUBLIC; + if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } } return CRYPT_OK; diff --git a/tests/dh_test.c b/tests/dh_test.c index e3111c679..4ef15a9e6 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -268,7 +268,7 @@ static int _set_test(void) for (i = 0; i < 1; i++) { DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k1)); - DO(dh_set_key(NULL, 0, test[i].x, test[i].xlen, &k1)); + DO(dh_set_key(test[i].x, test[i].xlen, PK_PRIVATE, &k1)); len = sizeof(buf); DO(dh_export(buf, &len, PK_PRIVATE, &k1)); @@ -301,7 +301,7 @@ static int _set_test(void) dh_free(&k1); DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k1)); - DO(dh_set_key(test[i].y, test[i].ylen, test[i].x, test[i].xlen, &k1)); + DO(dh_set_key(test[i].x, test[i].xlen, PK_PRIVATE, &k1)); len = sizeof(buf); DO(dh_export(buf, &len, PK_PRIVATE, &k1)); @@ -320,7 +320,7 @@ static int _set_test(void) dh_free(&k1); DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k2)); - DO(dh_set_key(test[i].y, test[i].ylen, NULL, 0, &k2)); + DO(dh_set_key(test[i].y, test[i].ylen, PK_PUBLIC, &k2)); len = sizeof(buf); DO(dh_export(buf, &len, PK_PUBLIC, &k2)); diff --git a/tests/dsa_test.c b/tests/dsa_test.c index d871a293a..f1d8ecf20 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -179,8 +179,8 @@ static int _dsa_compat_test(void) key_parts[1], key_lens[1], key_parts[2], key_lens[2], &key)); - DO(dsa_set_key(key_parts[3], key_lens[3], - key_parts[4], key_lens[4], + DO(dsa_set_key(key_parts[4], key_lens[4], + PK_PRIVATE, &key)); len = sizeof(buf); DO(dsa_export(buf, &len, PK_PRIVATE | PK_STD, &key)); @@ -196,7 +196,7 @@ static int _dsa_compat_test(void) key_parts[2], key_lens[2], &key)); DO(dsa_set_key(key_parts[3], key_lens[3], - NULL, 0, + PK_PUBLIC, &key)); len = sizeof(buf); DO(dsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); @@ -220,7 +220,7 @@ static int _dsa_compat_test(void) /* try import dsaparam - our public key */ DO(dsa_set_pqg_dsaparam(dsaparam_der, sizeof(dsaparam_der), &key)); DO(dsa_set_key(key_parts[3], key_lens[3], - NULL, 0, + PK_PUBLIC, &key)); len = sizeof(buf); DO(dsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); @@ -232,8 +232,8 @@ static int _dsa_compat_test(void) /* try import dsaparam - our private key */ DO(dsa_set_pqg_dsaparam(dsaparam_der, sizeof(dsaparam_der), &key)); - DO(dsa_set_key(key_parts[3], key_lens[3], - key_parts[4], key_lens[4], + DO(dsa_set_key(key_parts[4], key_lens[4], + PK_PRIVATE, &key)); len = sizeof(buf); DO(dsa_export(buf, &len, PK_PRIVATE | PK_STD, &key)); From 1819a02d5a239b09225b08d8b8c1dec4224291ac Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 11 Jul 2017 10:32:53 +0200 Subject: [PATCH 0982/1192] update comments [skip ci] --- src/headers/tomcrypt_pk.h | 3 +-- src/pk/dh/dh_set.c | 11 ++++++----- src/pk/dsa/dsa_set.c | 12 +++++++----- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 49b9a9b13..00a6c1334 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -232,8 +232,7 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, void dh_free(dh_key *key); -int dh_export_key(void *out, unsigned long *outlen, - int type, dh_key *key); +int dh_export_key(void *out, unsigned long *outlen, int type, dh_key *key); #ifdef LTC_SOURCE /* internal helper functions */ diff --git a/src/pk/dh/dh_set.c b/src/pk/dh/dh_set.c index 8dd3f0d46..8d0af7d20 100644 --- a/src/pk/dh/dh_set.c +++ b/src/pk/dh/dh_set.c @@ -78,12 +78,13 @@ int dh_set_pg_groupsize(int groupsize, dh_key *key) } /** - Import DH key parts pub and priv from raw numbers + Import DH public or private key part from raw numbers - @param pub DH's pub (public key) (can be NULL if priv is valid) - @param publen DH's pub's length - @param priv DH's priv (private key) (can be NULL if pub is valid) - @param privlen DH's priv's length + NB: The p & g parts must be set beforehand + + @param in The key-part to import, either public or private. + @param inlen The key-part's length + @param type Which type of key (PK_PRIVATE or PK_PUBLIC) @param key [out] the destination for the imported key @return CRYPT_OK if successful */ diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index fd183411a..a63097499 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -58,11 +58,13 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, } /** - Import DSA public or private key from raw numbers - @param pub DSA's y (public key) in binary representation - @param publen The length of pub - @param priv DSA's x (private key) in binary representation (can be NULL when importing public key) - @param privlen The length of priv + Import DSA public or private key-part from raw numbers + + NB: The p, q & g parts must be set beforehand + + @param in The key-part to import, either public or private. + @param inlen The key-part's length + @param type Which type of key (PK_PRIVATE or PK_PUBLIC) @param key [out] the destination for the imported key @return CRYPT_OK if successful. */ From 53c62b36704d24f71e8981b4ba05a8c34da5ef58 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 9 Jul 2017 18:45:07 +0200 Subject: [PATCH 0983/1192] remove redundant prototypes already declared in src/headers/tomcrypt_hash.h --- src/hashes/md4.c | 1 - src/hashes/md5.c | 1 - src/hashes/rmd128.c | 1 - src/hashes/rmd160.c | 1 - src/hashes/rmd256.c | 1 - src/hashes/rmd320.c | 1 - src/hashes/sha1.c | 1 - src/hashes/sha2/sha256.c | 1 - src/hashes/sha2/sha512.c | 1 - src/hashes/tiger.c | 1 - src/hashes/whirl/whirl.c | 1 - 11 files changed, 11 deletions(-) diff --git a/src/hashes/md4.c b/src/hashes/md4.c index 6a1cee403..cddc2b58a 100644 --- a/src/hashes/md4.c +++ b/src/hashes/md4.c @@ -188,7 +188,6 @@ int md4_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int md4_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(md4_process, md4_compress, md4, 64) /** diff --git a/src/hashes/md5.c b/src/hashes/md5.c index edf887731..93fe2ec28 100644 --- a/src/hashes/md5.c +++ b/src/hashes/md5.c @@ -247,7 +247,6 @@ int md5_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int md5_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(md5_process, md5_compress, md5, 64) /** diff --git a/src/hashes/rmd128.c b/src/hashes/rmd128.c index 62bfe4309..26e64b281 100644 --- a/src/hashes/rmd128.c +++ b/src/hashes/rmd128.c @@ -286,7 +286,6 @@ int rmd128_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int rmd128_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(rmd128_process, rmd128_compress, rmd128, 64) /** diff --git a/src/hashes/rmd160.c b/src/hashes/rmd160.c index 2e0562ba2..165afd26e 100644 --- a/src/hashes/rmd160.c +++ b/src/hashes/rmd160.c @@ -345,7 +345,6 @@ int rmd160_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int rmd160_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(rmd160_process, rmd160_compress, rmd160, 64) /** diff --git a/src/hashes/rmd256.c b/src/hashes/rmd256.c index 0ac59f9d9..c2149b675 100644 --- a/src/hashes/rmd256.c +++ b/src/hashes/rmd256.c @@ -299,7 +299,6 @@ int rmd256_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int rmd256_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(rmd256_process, rmd256_compress, rmd256, 64) /** diff --git a/src/hashes/rmd320.c b/src/hashes/rmd320.c index d2e1896bd..0098e0b7e 100644 --- a/src/hashes/rmd320.c +++ b/src/hashes/rmd320.c @@ -364,7 +364,6 @@ int rmd320_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int rmd320_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(rmd320_process, rmd320_compress, rmd320, 64) /** diff --git a/src/hashes/sha1.c b/src/hashes/sha1.c index f7a0c5d0d..8fbdabfd4 100644 --- a/src/hashes/sha1.c +++ b/src/hashes/sha1.c @@ -180,7 +180,6 @@ int sha1_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int sha1_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(sha1_process, sha1_compress, sha1, 64) /** diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index 1e886e57e..723e8aa65 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -225,7 +225,6 @@ int sha256_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int sha256_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(sha256_process, sha256_compress, sha256, 64) /** diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index 1ba719d4a..d169a9118 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -193,7 +193,6 @@ int sha512_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int sha512_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(sha512_process, sha512_compress, sha512, 128) /** diff --git a/src/hashes/tiger.c b/src/hashes/tiger.c index 5a8f248b3..2438626d8 100644 --- a/src/hashes/tiger.c +++ b/src/hashes/tiger.c @@ -671,7 +671,6 @@ int tiger_init(hash_state *md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int tiger_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(tiger_process, tiger_compress, tiger, 64) /** diff --git a/src/hashes/whirl/whirl.c b/src/hashes/whirl/whirl.c index 8a2d01015..fe152cd22 100644 --- a/src/hashes/whirl/whirl.c +++ b/src/hashes/whirl/whirl.c @@ -138,7 +138,6 @@ int whirlpool_init(hash_state * md) @param inlen The length of the data (octets) @return CRYPT_OK if successful */ -int whirlpool_process(hash_state * md, const unsigned char *in, unsigned long inlen); HASH_PROCESS(whirlpool_process, whirlpool_compress, whirlpool, 64) /** From 37de73db01aa46031dfd05e2671b4e4932b5bd13 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 9 Jul 2017 18:56:15 +0200 Subject: [PATCH 0984/1192] add static _chc_process like in its prototype --- src/hashes/chc/chc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hashes/chc/chc.c b/src/hashes/chc/chc.c index 8a127508a..0861a88a3 100644 --- a/src/hashes/chc/chc.c +++ b/src/hashes/chc/chc.c @@ -161,7 +161,7 @@ static int chc_compress(hash_state *md, unsigned char *buf) @return CRYPT_OK if successful */ static int _chc_process(hash_state * md, const unsigned char *buf, unsigned long len); -HASH_PROCESS(_chc_process, chc_compress, chc, (unsigned long)cipher_blocksize) +static HASH_PROCESS(_chc_process, chc_compress, chc, (unsigned long)cipher_blocksize) /** Process a block of memory though the hash From 8b7edf54789d20d31a8d31c6415e1f02a92ed7f9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 10 Jul 2017 12:41:20 +0200 Subject: [PATCH 0985/1192] update DOT max values --- doc/Doxyfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index fd45375eb..0d10ae16a 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -2379,7 +2379,7 @@ PLANTUML_INCLUDE_PATH = # Minimum value: 0, maximum value: 10000, default value: 50. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_GRAPH_MAX_NODES = 50 +DOT_GRAPH_MAX_NODES = 500 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs # generated by dot. A depth value of 3 means that only nodes reachable from the @@ -2391,7 +2391,7 @@ DOT_GRAPH_MAX_NODES = 50 # Minimum value: 0, maximum value: 1000, default value: 0. # This tag requires that the tag HAVE_DOT is set to YES. -MAX_DOT_GRAPH_DEPTH = 0 +MAX_DOT_GRAPH_DEPTH = 5 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not seem From 24e69b2956248c982542c9238664d1e95be5b852 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 10 Jul 2017 12:56:26 +0200 Subject: [PATCH 0986/1192] more printf() clean-up * remove last occurences in non-test code * minimize in tests --- src/encauth/eax/eax_test.c | 3 +-- src/encauth/ocb/ocb_test.c | 3 +-- src/encauth/ocb3/ocb3_test.c | 3 +-- src/misc/hkdf/hkdf.c | 12 ------------ src/misc/hkdf/hkdf_test.c | 4 ---- src/misc/pkcs5/pkcs_5_test.c | 9 +++------ 6 files changed, 6 insertions(+), 28 deletions(-) diff --git a/src/encauth/eax/eax_test.c b/src/encauth/eax/eax_test.c index d3f553361..7d29ee76b 100644 --- a/src/encauth/eax/eax_test.c +++ b/src/encauth/eax/eax_test.c @@ -242,8 +242,7 @@ int eax_test(void) } if ((res != 1) || compare_testvector(outct, tests[x].msglen, tests[x].plaintext, tests[x].msglen, "EAX", x)) { #ifdef LTC_TEST_DBG - printf("\n\nEAX: Failure-decrypt\n"); - printf("\nres = %d\n\n", res); + printf("\n\nEAX: Failure-decrypt - res = %d\n", res); #endif return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/encauth/ocb/ocb_test.c b/src/encauth/ocb/ocb_test.c index d39dbb973..74431f7d7 100644 --- a/src/encauth/ocb/ocb_test.c +++ b/src/encauth/ocb/ocb_test.c @@ -191,8 +191,7 @@ int ocb_test(void) } if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB", x)) { #ifdef LTC_TEST_DBG - printf("\n\nOCB: Failure-decrypt\n"); - printf("\nres = %d\n\n", res); + printf("\n\nOCB: Failure-decrypt - res = %d\n", res); #endif return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index d6b9d6feb..bcb5d67c0 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -201,8 +201,7 @@ int ocb3_test(void) } if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB3", x)) { #ifdef LTC_TEST_DBG - printf("\n\nOCB3: Failure-decrypt\n"); - printf("\nres = %d\n\n", res); + printf("\n\nOCB3: Failure-decrypt - res = %d\n", res); #endif return CRYPT_FAIL_TESTVECTOR; } diff --git a/src/misc/hkdf/hkdf.c b/src/misc/hkdf/hkdf.c index a4e26344d..0db4ed980 100644 --- a/src/misc/hkdf/hkdf.c +++ b/src/misc/hkdf/hkdf.c @@ -128,18 +128,6 @@ int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen, XFREE(extracted); return err; } -#if 0 - { - int j; - printf("\nPRK: 0x"); - for(j=0; j < hashsize; j++) { - printf("%02x ", extracted[j]); - } - for(j=0; j < hashsize; j++) { - printf("%02x ", extracted[j]); - } - } -#endif err = hkdf_expand(hash_idx, info, infolen, extracted, hashsize, out, outlen); zeromem(extracted, hashsize); XFREE(extracted); diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index 587932387..632cea9ad 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -273,10 +273,6 @@ int hkdf_test(void) if(compare_testvector(OKM, cases[i].OKM_l, cases[i].OKM, (size_t)cases[i].OKM_l, "HKDF", cases[i].num)) { failed++; -#if LTC_TEST_DBG > 1 - } else { - printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, cases[i].num); -#endif } } diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index d46ab20e4..3788fa464 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -176,8 +176,7 @@ int pkcs_5_test (void) cases_5_2[i].c, hash, DK, &dkLen)) != CRYPT_OK) { #ifdef LTC_TEST_DBG - printf("\nPKCS#5_2 test #%d: Failed/1\n", i); - printf("err=%d\n", err); + printf("\npkcs_5_alg2() #%d: Failed/1 (%s)\n", i, error_to_string(err)); #endif ++failed; } @@ -194,8 +193,7 @@ int pkcs_5_test (void) cases_5_1[i].c, hash, DK, &dkLen)) != CRYPT_OK) { #ifdef LTC_TEST_DBG - printf("\nPKCS#5_1 test #%d: Failed/1\n", i); - printf("err=%d\n", err); + printf("\npkcs_5_alg1() #%d: Failed/1 (%s)\n", i, error_to_string(err)); #endif ++failed; } @@ -212,8 +210,7 @@ int pkcs_5_test (void) cases_5_1o[i].c, hash, DK, &dkLen)) != CRYPT_OK) { #ifdef LTC_TEST_DBG - printf("\nPKCS#5_1o test #%d: Failed/1\n", i); - printf("err=%d\n", err); + printf("\npkcs_5_alg1_openssl() #%d: Failed/1 (%s)\n", i, error_to_string(err)); #endif ++failed; } From b1c0227d5456aaf2a8b84834e076256ed14b816f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 10 Jul 2017 11:48:05 +0200 Subject: [PATCH 0987/1192] introduce LTC_CFLAGS and LTC_LDFLAGS --- makefile | 18 +++++++++--------- makefile.shared | 12 ++++++------ makefile_include.mk | 45 ++++++++++++++++++++++++--------------------- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/makefile b/makefile index 7bd345325..827722bae 100644 --- a/makefile +++ b/makefile @@ -39,19 +39,19 @@ include makefile_include.mk ifeq ($(COVERAGE),1) all_test: LIB_PRE = -Wl,--whole-archive all_test: LIB_POST = -Wl,--no-whole-archive -CFLAGS += -fprofile-arcs -ftest-coverage +LTC_CFLAGS += -fprofile-arcs -ftest-coverage EXTRALIBS += -lgcov endif #AES comes in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - ${silent} ${CC} ${CFLAGS} -DENCRYPT_ONLY -c $< -o $@ + ${silent} ${CC} ${LTC_CFLAGS} -DENCRYPT_ONLY -c $< -o $@ .c.o: ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} ${CC} ${CFLAGS} -c $< -o $@ + ${silent} ${CC} ${LTC_CFLAGS} -c $< -o $@ $(LIBNAME): $(OBJECTS) ifneq ($V,1) @@ -67,13 +67,13 @@ timing: $(LIBNAME) $(TIMINGS) ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TIMINGS) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) + ${silent} $(CC) $(LTC_LDFLAGS) $(TIMINGS) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) test: $(LIBNAME) $(TOBJECTS) ifneq ($V,1) @echo " * ${CC} $@" endif - ${silent} $(CC) $(LDFLAGS) $(TOBJECTS) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TEST) + ${silent} $(CC) $(LTC_LDFLAGS) $(TOBJECTS) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TEST) # build the demos from a template define DEMO_template @@ -81,7 +81,7 @@ $(1): demos/$(1).o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif - $${silent} $$(CC) $$(CFLAGS) $$< $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) + $${silent} $$(CC) $$(LTC_CFLAGS) $$< $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) @@ -97,10 +97,10 @@ install_bins: .common_install_bins uninstall: .common_uninstall profile: - CFLAGS="$(CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" + LTC_CFLAGS="$(LTC_CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" ./timing rm -f timing `find . -type f | grep [.][ao] | xargs` - CFLAGS="$(CFLAGS) -fprofile-use" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" + LTC_CFLAGS="$(LTC_CFLAGS) -fprofile-use" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" # target that pre-processes all coverage data lcov-single-create: @@ -128,7 +128,7 @@ lcov-single: #make the code coverage of the library -coverage: CFLAGS += -fprofile-arcs -ftest-coverage +coverage: LTC_CFLAGS += -fprofile-arcs -ftest-coverage coverage: EXTRALIBS += -lgcov coverage: LIB_PRE = -Wl,--whole-archive coverage: LIB_POST = -Wl,--no-whole-archive diff --git a/makefile.shared b/makefile.shared index 529ec6536..95829af50 100644 --- a/makefile.shared +++ b/makefile.shared @@ -38,15 +38,15 @@ include makefile_include.mk #ciphers come in two flavours... enc+dec and enc src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c - $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o + $(LTCOMPILE) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o .c.o: - $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< + $(LTCOMPILE) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $@ -c $< LOBJECTS = $(OBJECTS:.o=.lo) $(LIBNAME): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) + $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) install: .common_install sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc @@ -59,10 +59,10 @@ uninstall: .common_uninstall rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc test: $(LIBNAME) $(TOBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) timing: $(TIMINGS) $(LIBNAME) - $(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $^ $(EXTRALIBS) + $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $(TIMING) $^ $(EXTRALIBS) # build the demos from a template define DEMO_template @@ -70,7 +70,7 @@ $(1): demos/$(1).o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif - $$(LT) --mode=link --tag=CC $$(CC) $$(CFLAGS) $$(CPPFLAGS) $$(LDFLAGS) $$^ $$(EXTRALIBS) -o $(1) + $$(LT) --mode=link --tag=CC $$(CC) $$(LTC_CFLAGS) $$(CPPFLAGS) $$(LTC_LDFLAGS) $$^ $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) diff --git a/makefile_include.mk b/makefile_include.mk index a7ec04264..3cf906987 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -52,44 +52,44 @@ endif # by giving them as a parameter to make: # make CFLAGS="-I./src/headers/ -DLTC_SOURCE ..." ... # -CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE +LTC_CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE ifdef OLD_GCC -CFLAGS += -W +LTC_CFLAGS += -W # older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros # define this to help -CFLAGS += -DLTC_NO_ROLC +LTC_CFLAGS += -DLTC_NO_ROLC else -CFLAGS += -Wextra +LTC_CFLAGS += -Wextra # additional warnings -CFLAGS += -Wsystem-headers -Wbad-function-cast -Wcast-align -CFLAGS += -Wstrict-prototypes -Wpointer-arith -CFLAGS += -Wdeclaration-after-statement +LTC_CFLAGS += -Wsystem-headers -Wbad-function-cast -Wcast-align +LTC_CFLAGS += -Wstrict-prototypes -Wpointer-arith +LTC_CFLAGS += -Wdeclaration-after-statement endif -CFLAGS += -Wno-type-limits +LTC_CFLAGS += -Wno-type-limits ifdef LTC_DEBUG # compile for DEBUGGING (required for ccmalloc checking!!!) -CFLAGS += -g3 -DLTC_NO_ASM +LTC_CFLAGS += -g3 -DLTC_NO_ASM ifneq (,$(strip $(LTC_DEBUG))) -CFLAGS += -DLTC_TEST_DBG=$(LTC_DEBUG) +LTC_CFLAGS += -DLTC_TEST_DBG=$(LTC_DEBUG) else -CFLAGS += -DLTC_TEST_DBG +LTC_CFLAGS += -DLTC_TEST_DBG endif else ifdef LTC_SMALL # optimize for SIZE -CFLAGS += -Os -DLTC_SMALL_CODE +LTC_CFLAGS += -Os -DLTC_SMALL_CODE else ifndef IGNORE_SPEED # optimize for SPEED -CFLAGS += -O3 -funroll-loops +LTC_CFLAGS += -O3 -funroll-loops # add -fomit-frame-pointer. hinders debugging! -CFLAGS += -fomit-frame-pointer +LTC_CFLAGS += -fomit-frame-pointer endif endif # COMPILE_SMALL @@ -97,23 +97,26 @@ endif # COMPILE_DEBUG ifneq ($(findstring clang,$(CC)),) -CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header +LTC_CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header endif ifeq ($(PLATFORM), Darwin) -CFLAGS += -Wno-nullability-completeness +LTC_CFLAGS += -Wno-nullability-completeness endif GIT_VERSION := $(shell [ -e .git ] && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION)) ifneq ($(GIT_VERSION),) -CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +LTC_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" endif +LTC_CFLAGS := $(LTC_CFLAGS) $(CFLAGS) -ifneq ($(findstring -DLTC_PTHREAD,$(CFLAGS)),) -LDFLAGS += -pthread +ifneq ($(findstring -DLTC_PTHREAD,$(LTC_CFLAGS)),) +LTC_LDFLAGS += -pthread endif +LTC_LDFLAGS := $(LTC_LDFLAGS) $(LDFLAGS) + #List of demo objects DSOURCES = $(wildcard demos/*.c) DOBJECTS = $(DSOURCES:.c=.o) @@ -340,8 +343,8 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c -$(DOBJECTS): CFLAGS += -Itests -$(TOBJECTS): CFLAGS += -Itests +$(DOBJECTS): LTC_CFLAGS += -Itests +$(TOBJECTS): LTC_CFLAGS += -Itests #This rule makes the libtomcrypt library. library: $(LIBNAME) From a949ef5a894cd026df0c95e474496d97d30fb0d6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 11 Jul 2017 15:37:31 +0200 Subject: [PATCH 0988/1192] append instead of prepend CFLAGS for the other makefiles --- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 021335898..4e0d1ce14 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -25,7 +25,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = -L../libtommath -ltommath #Compilation flags -LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE +LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) VERSION=1.18.0-rc1 diff --git a/makefile.msvc b/makefile.msvc index be1988aea..de7e8998f 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -20,7 +20,7 @@ CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath EXTRALIBS = ../libtommath/tommath.lib #Compilation flags -LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 +LTC_CFLAGS = /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 $(CFLAGS) LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) VERSION=1.18.0-rc1 diff --git a/makefile.unix b/makefile.unix index 39722e820..8c437ad0d 100644 --- a/makefile.unix +++ b/makefile.unix @@ -37,7 +37,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath EXTRALIBS = ../libtommath/libtommath.a #Compilation flags -LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE +LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) VERSION=1.18.0-rc1 From a2f48578e9d070ea6b5f8788d1835a1800902c85 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 12 Jul 2017 22:48:46 +0200 Subject: [PATCH 0989/1192] also pre-pend -Itests --- makefile_include.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile_include.mk b/makefile_include.mk index 3cf906987..0f1baa764 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -343,8 +343,8 @@ src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_22 src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c -$(DOBJECTS): LTC_CFLAGS += -Itests -$(TOBJECTS): LTC_CFLAGS += -Itests +$(DOBJECTS): LTC_CFLAGS := -Itests $(LTC_CFLAGS) +$(TOBJECTS): LTC_CFLAGS := -Itests $(LTC_CFLAGS) #This rule makes the libtomcrypt library. library: $(LIBNAME) From 535358ec28d448bf0789d10854238b5fa48bc138 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 13 Jul 2017 14:57:45 +0200 Subject: [PATCH 0990/1192] bump version --- doc/Doxyfile | 2 +- src/headers/tomcrypt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index 0d10ae16a..24ce8b123 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = LibTomCrypt # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.18.0-rc1 +PROJECT_NUMBER = 1.18.0-rc2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index e902119ee..aecd674ed 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -27,7 +27,7 @@ extern "C" { /* version */ #define CRYPT 0x0118 -#define SCRYPT "1.18.0-rc1" +#define SCRYPT "1.18.0-rc2" /* max size of either a cipher/hash block or symmetric key [largest of the two] */ #define MAXBLOCKSIZE 128 From aa0f396c0c8828ce39456129507fc72ef0208bd0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 13 Jul 2017 14:58:01 +0200 Subject: [PATCH 0991/1192] Update makefiles --- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 4e0d1ce14..9e96129ba 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -27,7 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc1 +VERSION=1.18.0-rc2 #Libraries to be created LIBMAIN_S =libtomcrypt.a diff --git a/makefile.msvc b/makefile.msvc index de7e8998f..615e87b7d 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -22,7 +22,7 @@ EXTRALIBS = ../libtommath/tommath.lib #Compilation flags LTC_CFLAGS = /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 $(CFLAGS) LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) -VERSION=1.18.0-rc1 +VERSION=1.18.0-rc2 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib diff --git a/makefile.unix b/makefile.unix index 8c437ad0d..dd249b429 100644 --- a/makefile.unix +++ b/makefile.unix @@ -39,7 +39,7 @@ EXTRALIBS = ../libtommath/libtommath.a #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc1 +VERSION=1.18.0-rc2 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a diff --git a/makefile_include.mk b/makefile_include.mk index 0f1baa764..24076d621 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -3,7 +3,7 @@ # (GNU make only) # The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh -VERSION=1.18.0-rc1 +VERSION=1.18.0-rc2 VERSION_PC=1.18.0 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION_LT=0:118 From 909b4954a9e2045a3414a861c598ac7acd956ab5 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 14 Jul 2017 19:59:03 +0200 Subject: [PATCH 0992/1192] fix MS Windows/64bit related warnings --- demos/timing.c | 2 +- src/headers/tomcrypt_math.h | 2 +- src/math/radix_to_bin.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/timing.c b/demos/timing.c index 746055de5..1b74af947 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -919,7 +919,7 @@ static void time_dh(void) dh_free(&key); } t2 >>= 4; - fprintf(stderr, "DH-%4lu make_key took %15llu cycles\n", x*8, t2); + fprintf(stderr, "DH-%4lu make_key took %15"PRI64"u cycles\n", x*8, t2); } } #else diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index a52fb9d24..b655346d0 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -30,7 +30,7 @@ #define LTC_MILLER_RABIN_REPS 35 #endif -int radix_to_bin(const void *in, int radix, void *out, size_t* len); +int radix_to_bin(const void *in, int radix, void *out, unsigned long *len); /** math descriptor */ typedef struct { diff --git a/src/math/radix_to_bin.c b/src/math/radix_to_bin.c index fef58ae7b..409bd20d5 100644 --- a/src/math/radix_to_bin.c +++ b/src/math/radix_to_bin.c @@ -31,9 +31,9 @@ @return CRYPT_OK on success. */ -int radix_to_bin(const void *in, int radix, void *out, size_t* len) +int radix_to_bin(const void *in, int radix, void *out, unsigned long *len) { - size_t l; + unsigned long l; void* mpi; int err; From bfe6c4d35c898d4d4805dcf570dc1fc19a2568c9 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 12 Jul 2017 23:15:26 +0200 Subject: [PATCH 0993/1192] improved README - building instructions [skip ci] --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 1cf505bfa..2f30df240 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,21 @@ Please be aware, that all branches besides _master_ and _develop_ __can__ and __ If you want to rely on such an _unstable_ branch, create your own fork of this repository to make sure nothing breaks for you. +Building +-------- + +If you have `libtommath` installed on your system: + + make CFLAGS="-DUSE_LTM -DLTM_DESC" EXTRALIBS="-ltommath" all + +For building a shared library use: + + make -f makefile.shared CFLAGS="-DUSE_LTM -DLTM_DESC" EXTRALIBS="-ltommath" all + +If you have `libtommath` in a non-standard location: + + make CFLAGS="-DUSE_LTM -DLTM_DESC -I/opt/devel/ltm" EXTRALIBS="/opt/devel/ltm/libtommath.a" all + +On unusual UNIX platforms, or if you do not have GNU make, have a look at `makefile.unix`. + +On MS Windows try `libtomcrypt_VS2008.sln` (Visual Studio) or `makefile.mingw` or `makefile.msvc`. From 4cb8936a313df652b79457f62127b264cb87ee9f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 13 Jul 2017 14:30:16 +0200 Subject: [PATCH 0994/1192] update readme [skip ci] --- README.md | 111 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 92 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 2f30df240..0434f41f4 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,16 @@ -libtomcrypt -========== +# libtomcrypt See `doc/crypt.pdf` for a detailed documentation -Project Status --------------- +## Project Status -develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://travis-ci.org/libtom/libtomcrypt) [![Coverage Status](https://coveralls.io/repos/libtom/libtomcrypt/badge.png?branch=develop)](https://coveralls.io/r/libtom/libtomcrypt) [![Coverity Scan Build Status](https://scan.coverity.com/projects/487/badge.svg)](https://scan.coverity.com/projects/487) +master: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=master)](https://travis-ci.org/libtom/libtomcrypt) [![Coverage Status](https://coveralls.io/repos/libtom/libtomcrypt/badge.png?branch=master)](https://coveralls.io/r/libtom/libtomcrypt) -Submitting patches ------------------- +develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branch=develop)](https://travis-ci.org/libtom/libtomcrypt) [![Coverage Status](https://coveralls.io/repos/libtom/libtomcrypt/badge.png?branch=develop)](https://coveralls.io/r/libtom/libtomcrypt) + +[![Coverity Scan Build Status](https://scan.coverity.com/projects/487/badge.svg)](https://scan.coverity.com/projects/487) + +## Submitting patches Please branch off from develop if you want to submit a patch. @@ -17,28 +18,100 @@ Patch integration will be faster if tests and documentation are included. Please update the makefiles in a separate commit. To update them simply run the `updatemakes.sh` script. -Branches --------- +## Branches Please be aware, that all branches besides _master_ and _develop_ __can__ and __will be__ force-pushed, rebased and/or removed! If you want to rely on such an _unstable_ branch, create your own fork of this repository to make sure nothing breaks for you. -Building --------- +## Configuration options -If you have `libtommath` installed on your system: +By default the library builds its entire feature set (besides `katja`) in a (depending on your needs more or less) optimal way. - make CFLAGS="-DUSE_LTM -DLTM_DESC" EXTRALIBS="-ltommath" all +There are numerous configuration options available if you want to trim down the functionality of the library. -For building a shared library use: +Please have a look at `src/headers/tomcrypt_custom.h` for all available configuration options. - make -f makefile.shared CFLAGS="-DUSE_LTM -DLTM_DESC" EXTRALIBS="-ltommath" all +The following list is a small part of the available, but the most often required, configuration switches. -If you have `libtommath` in a non-standard location: +| Flag | Behavior | +| ---- | -------- | +| `LTC_NO_TEST` | Remove all algorithm self-tests from the library | +| `LTC_NO_FILE` | Remove all API functions requiring a pre-defined `FILE` data-type (mostly useful for embedded targets) | +| `MAX_RSA_SIZE` | Per default set to `4096`, if you need support for importing or generating bigger RSA keys, change this at compile-time. | +| `GMP_DESC` | enable [gmp](https://gmplib.org/) as MPI provider *\*1* | +| `LTM_DESC` | enable [libtommath](http://www.libtom.net/) as MPI provider *\*1* | +| `TFM_DESC` | enable [tomsfastmath](http://www.libtom.net/) as MPI provider *\*1* *\*2* | +| `USE_GMP` | use `gmp` as MPI provider when building the binaries *\*3* | +| `USE_LTM` | use `libtommath` as MPI provider when building the binaries *\*3* | +| `USE_TFM` | use `tomsfastmath` as MPI provider when building the binaries *\*3* | - make CFLAGS="-DUSE_LTM -DLTM_DESC -I/opt/devel/ltm" EXTRALIBS="/opt/devel/ltm/libtommath.a" all +*\*1* It is possible to build the library against all MPI providers in parallel and choose at startup-time which math library should be used. + +*\*2* Please be aware that `tomsfastmath` has the limitation of a fixed max size of MPI's. + +*\*3* Only one is supported at the time & this is only required when building the binaries, not when building the library itself. + +## Building the library + +There are several `makefile`s provided. Please choose the one that fits best for you. + +| makefile | use-case | +| -------- | -------- | +| `makefile` | builds a static library (GNU Make required) | +| `makefile.shared` | builds a shared (and static) library (GNU Make required) | +| `makefile.unix` | for unusual UNIX platforms, or if you do not have GNU Make | +| `makefile.mingw` | for usage with the mingw compiler on MS Windows | +| `makefile.msvc` | for usage with the MSVC compiler on MS Windows | +| `libtomcrypt_VS2008.sln` | A VisualStudio 2008 project for MS Windows | + +### Make targets + +The `makefile`s provide several targets to build (VS project excluded). +The following list does not claim to be complete resp. to be available across all `makefile` variants. + +| target | application | +| ------ | ----------- | +| *empty target*/none given | c.f. `library` +| `library` | builds only the library | +| `hashsum` | builds the `hashsum` binary, similar to [`shasum`](https://linux.die.net/man/1/shasum), but with support for all hash-algorithms included in the library *\*4* | +| `ltcrypt` | builds the `ltcrypt` binary, implementing something similar to [`crypt`](https://linux.die.net/man/3/crypt) *\*4* | +| `sizes` | builds the `sizes` binary, printing all internal data sizes on invocation *\*4* | +| `constants` | builds the `constants` binary, printing all internal constants on invocation *\*4* | +| `openssl-enc` | builds the `openssl-enc` binary, which is more or less compatible to [`openssl enc`](https://linux.die.net/man/1/enc) *\*4* *\*5* | +| `test` | builds the `test` binary, which runs all algorithm self-tests + some extended tests *\*4* *\*6* | +| `timing` | builds the `timing` binary, which can be used to measure timings for algorithms and modes *\*4* *\*6* | +| `bins` | builds `hashsum` *\*4* | +| `all_test` | builds `test`, `hashsum`, `ltcrypt`, `small`, `tv_gen`, `sizes` & `constants` *\*4* | + +*\*4* also builds `library` + +*\*5* broken build in some configurations, therefore not built by default -On unusual UNIX platforms, or if you do not have GNU make, have a look at `makefile.unix`. +*\*6* requires define of one of `USE_GMP`, `USE_LTM` or `USE_TFM` (+ the appropriate MPI provider) -On MS Windows try `libtomcrypt_VS2008.sln` (Visual Studio) or `makefile.mingw` or `makefile.msvc`. +### Examples + +You want to build the library as static library + + make + +You want to build the library as shared library + + make -f makefile.shared + +You have `libtommath` installed on your system and want to build a static library and the `test` binary to run the self-tests. + + make CFLAGS="-DUSE_LTM -DLTM_DESC" EXTRALIBS="-ltommath" test + +You have `tomsfastmath` installed on your system and want to build a shared library and all binaries + + make -f makefile.shared CFLAGS="-DUSE_TFM -DTFM_DESC" EXTRALIBS="-ltfm" all demos + +You have `gmp`, `libtommath` and `tomsfastmath` installed on your system and want to build a static library and the `timing` binary to measure timings against `gmp`. + + make CFLAGS="-DUSE_GMP -DGMP_DESC -DLTM_DESC -DTFM_DESC" EXTRALIBS="-lgmp" timing + +If you have `libtommath` in a non-standard location: + + make CFLAGS="-DUSE_LTM -DLTM_DESC -I/opt/devel/ltm" EXTRALIBS="/opt/devel/ltm/libtommath.a" all From 0e081d666ad6d43d3c62f24043462510413d752c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 14 Jul 2017 12:45:09 +0200 Subject: [PATCH 0995/1192] improve error message when using makefile on Mac OSX [skip ci] --- README.md | 2 +- makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0434f41f4..8814a10cc 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ There are several `makefile`s provided. Please choose the one that fits best for | makefile | use-case | | -------- | -------- | -| `makefile` | builds a static library (GNU Make required) | +| `makefile` | builds a static library (GNU Make required, broken on Mac OSX - use `makefile.unix` instead) | | `makefile.shared` | builds a shared (and static) library (GNU Make required) | | `makefile.unix` | for unusual UNIX platforms, or if you do not have GNU Make | | `makefile.mingw` | for usage with the mingw compiler on MS Windows | diff --git a/makefile b/makefile index 827722bae..e6ca27a0d 100644 --- a/makefile +++ b/makefile @@ -17,7 +17,7 @@ PLATFORM := $(shell uname | sed -e 's/_.*//') ifneq ($(MAKECMDGOALS),clean) ifeq ($(PLATFORM), Darwin) -$(error Can't build static library on Mac, please use makefile.shared) +$(error Known to not work on Mac, please use makefile.unix for static libraries or makefile.shared for shared libraries) endif endif From 22c13b49d8d6737ad32d6d2ab8cea807ce4a8d03 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 14 Jul 2017 12:13:10 +0200 Subject: [PATCH 0996/1192] oops, refman.pdf can't be built with DOT --- doc/makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/makefile b/doc/makefile index 1222eb95a..30a76c16c 100644 --- a/doc/makefile +++ b/doc/makefile @@ -14,7 +14,10 @@ LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof doxygen: doxygen $(silent_stdout) -doxy: doxygen +patched_doxygen: + (cat Doxyfile && echo "HAVE_DOT=no") | doxygen - $(silent_stdout) + +doxy: patched_doxygen ${MAKE} -C doxygen/latex $(silent_stdout) && mv -f doxygen/latex/refman.pdf . @echo The huge doxygen PDF should be available as doc/refman.pdf From bffaab4eed2a2ee1ef92176557e61ef57a0aa588 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 14 Jul 2017 12:18:18 +0200 Subject: [PATCH 0997/1192] re-group demos and really build everything in 'all' target --- makefile | 6 ------ makefile.shared | 3 --- makefile_include.mk | 22 ++++++++++++++++------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/makefile b/makefile index e6ca27a0d..0e29fa4e0 100644 --- a/makefile +++ b/makefile @@ -63,12 +63,6 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -timing: $(LIBNAME) $(TIMINGS) -ifneq ($V,1) - @echo " * ${CC} $@" -endif - ${silent} $(CC) $(LTC_LDFLAGS) $(TIMINGS) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) - test: $(LIBNAME) $(TOBJECTS) ifneq ($V,1) @echo " * ${CC} $@" diff --git a/makefile.shared b/makefile.shared index 95829af50..d8b92b2b4 100644 --- a/makefile.shared +++ b/makefile.shared @@ -61,9 +61,6 @@ uninstall: .common_uninstall test: $(LIBNAME) $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) -timing: $(TIMINGS) $(LIBNAME) - $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $(TIMING) $^ $(EXTRALIBS) - # build the demos from a template define DEMO_template $(1): demos/$(1).o $$(LIBNAME) diff --git a/makefile_include.mk b/makefile_include.mk index 24076d621..25beafeb1 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -124,14 +124,24 @@ DOBJECTS = $(DSOURCES:.c=.o) #List of tests headers THEADERS = $(wildcard tests/*.h) -TIMING=timing TEST=test -USEFUL_DEMOS=hashsum -UNBROKEN_DEMOS=$(USEFUL_DEMOS) ltcrypt small tv_gen sizes constants -DEMOS=$(UNBROKEN_DEMOS) openssl-enc +# Demos that are even somehow useful and could be installed as a system-tool +USEFUL_DEMOS = hashsum -TIMINGS=demos/timing.o +# Demos that are usable but only rarely make sense to be installed +USEABLE_DEMOS = ltcrypt sizes constants + +# Demos that are used for testing or measuring +TEST_DEMOS = small timing tv_gen + +# Demos that are in one config broken +# openssl-enc - can't be build with LTC_EASY +BROKEN_DEMOS = openssl-enc + +# Combine demos in groups +UNBROKEN_DEMOS = $(TEST_DEMOS) $(USEABLE_DEMOS) $(USEFUL_DEMOS) +DEMOS = $(UNBROKEN_DEMOS) $(BROKEN_DEMOS) #LIBPATH The directory for libtomcrypt to be installed to. #INCPATH The directory to install the header files for libtomcrypt. @@ -356,7 +366,7 @@ $(TOBJECTS): $(HEADERS) $(THEADERS) bins: $(USEFUL_DEMOS) -all: all_test +all: all_test $(BROKEN_DEMOS) all_test: test $(UNBROKEN_DEMOS) From 24c5b7419323ad0f9da9130d92520f5f5ae24898 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 14 Jul 2017 12:18:51 +0200 Subject: [PATCH 0998/1192] introduce 'make help' --- makefile | 12 ++++++------ makefile.shared | 27 ++++++++++++------------- makefile_include.mk | 48 ++++++++++++++++++++++++++++----------------- 3 files changed, 48 insertions(+), 39 deletions(-) diff --git a/makefile b/makefile index 0e29fa4e0..1f7b201dc 100644 --- a/makefile +++ b/makefile @@ -63,7 +63,7 @@ ifneq ($V,1) endif ${silent} $(RANLIB) $@ -test: $(LIBNAME) $(TOBJECTS) +test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS) ifneq ($V,1) @echo " * ${CC} $@" endif @@ -71,7 +71,7 @@ endif # build the demos from a template define DEMO_template -$(1): demos/$(1).o $$(LIBNAME) +$(1): $(call print-help,$(1),Builds the library and the '$(1)' demo) demos/$(1).o $$(LIBNAME) ifneq ($V,1) @echo " * $${CC} $$@" endif @@ -84,11 +84,11 @@ $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. -install: .common_install +install: $(call print-help,install,Installs the library and headers)) .common_install -install_bins: .common_install_bins +install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins -uninstall: .common_uninstall +uninstall: $(call print-help,uninstall,Uninstalls the library and headers)) .common_uninstall profile: LTC_CFLAGS="$(LTC_CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" @@ -127,7 +127,7 @@ coverage: EXTRALIBS += -lgcov coverage: LIB_PRE = -Wl,--whole-archive coverage: LIB_POST = -Wl,--no-whole-archive -coverage: test +coverage: $(call print-help,coverage,Create code-coverage of the library - but better use coverage.sh) test ./test # cleans everything - coverage output and standard 'clean' diff --git a/makefile.shared b/makefile.shared index d8b92b2b4..a0164c0fb 100644 --- a/makefile.shared +++ b/makefile.shared @@ -48,30 +48,27 @@ LOBJECTS = $(OBJECTS:.o=.lo) $(LIBNAME): $(OBJECTS) $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) -install: .common_install - sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc - install -d $(DESTDIR)$(LIBPATH)/pkgconfig - install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ - -install_bins: .common_install_bins - -uninstall: .common_uninstall - rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc - -test: $(LIBNAME) $(TOBJECTS) +test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) # build the demos from a template define DEMO_template -$(1): demos/$(1).o $$(LIBNAME) -ifneq ($V,1) - @echo " * $${CC} $$@" -endif +$(1): $(call print-help,$(1),Builds the library and the '$(1)' demo) demos/$(1).o $$(LIBNAME) $$(LT) --mode=link --tag=CC $$(CC) $$(LTC_CFLAGS) $$(CPPFLAGS) $$(LTC_LDFLAGS) $$^ $$(EXTRALIBS) -o $(1) endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) +install: $(call print-help,install,Installs the library, headers and pkd-config file)) .common_install + sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc + install -d $(DESTDIR)$(LIBPATH)/pkgconfig + install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ + +install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins + +uninstall: $(call print-help,uninstall,Uninstalls the library, headers and pkd-config file)) .common_uninstall + rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc + # ref: $Format:%D$ # git commit: $Format:%H$ # commit time: $Format:%ai$ diff --git a/makefile_include.mk b/makefile_include.mk index 25beafeb1..60076719f 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -44,6 +44,11 @@ endif endif endif +need-help := $(filter help,$(MAKECMDGOALS)) +define print-help +$(if $(need-help),$(info $1 -- $2)) +endef + # # Compilation flags. Note the += does not write over the user's CFLAGS! # @@ -168,8 +173,8 @@ GROUP=wheel endif -#The default rule for make builds the libtomcrypt library. -default: library +#The first rule is also the default rule and builds the libtomcrypt library. +library: $(call print-help,library,Builds the library) $(LIBNAME) # List of objects to compile (all goes to libtomcrypt.a) @@ -356,29 +361,30 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c $(DOBJECTS): LTC_CFLAGS := -Itests $(LTC_CFLAGS) $(TOBJECTS): LTC_CFLAGS := -Itests $(LTC_CFLAGS) -#This rule makes the libtomcrypt library. -library: $(LIBNAME) - #Dependencies on *.h $(OBJECTS): $(HEADERS) $(DOBJECTS): $(HEADERS) $(THEADERS) $(TOBJECTS): $(HEADERS) $(THEADERS) -bins: $(USEFUL_DEMOS) +all: $(call print-help,all,Builds the library and all demos and test utils (test $(UNBROKEN_DEMOS) $(BROKEN_DEMOS))) all_test $(BROKEN_DEMOS) -all: all_test $(BROKEN_DEMOS) +all_test: $(call print-help,all_test,Builds the library and all unbroken demos and test utils (test $(UNBROKEN_DEMOS))) test $(UNBROKEN_DEMOS) -all_test: test $(UNBROKEN_DEMOS) +bins: $(call print-help,bins,Builds the library and all useful demos) $(USEFUL_DEMOS) #build the doxy files (requires Doxygen, tetex and patience) -doxygen doxy docs: +doxygen: $(call print-help,doxygen,Builds the doxygen html documentation) + $(MAKE) -C doc/ $@ V=$(V) +doxy: $(call print-help,doxy,Builds the complete doxygen documentation including refman.pdf (takes long to generate)) + $(MAKE) -C doc/ $@ V=$(V) +docs: $(call print-help,docs,Builds the Developer Manual) $(MAKE) -C doc/ $@ V=$(V) -doc/crypt.pdf: +doc/crypt.pdf: $(call print-help,doc/crypt.pdf,Builds the Developer Manual) $(MAKE) -C doc/ crypt.pdf V=$(V) -install_all: install install_bins install_docs install_test +install_all: $(call print-help,install_all,Install everything - library bins docs tests) install install_bins install_docs install_test INSTALL_OPTS ?= -m 644 @@ -388,17 +394,21 @@ INSTALL_OPTS ?= -m 644 $(INSTALL_CMD) $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME) install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH) -.common_install_bins: $(USEFUL_DEMOS) +$(DESTDIR)$(BINPATH): install -d $(DESTDIR)$(BINPATH) + +.common_install_bins: $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH) $(INSTALL_CMD) -m 775 $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH) -install_docs: doc/crypt.pdf +install_docs: $(call print-help,install_docs,Installs the Developer Manual) doc/crypt.pdf install -d $(DESTDIR)$(DATAPATH) install -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH) -install_hooks: - for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done +install_test: $(call print-help,install_test,Installs the self-test binary) test $(DESTDIR)$(BINPATH) + $(INSTALL_CMD) -m 775 $< $(DESTDIR)$(BINPATH) +install_hooks: $(call print-help,install_hooks,Installs the git hooks) + for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done HEADER_FILES=$(notdir $(HEADERS)) .common_uninstall: @@ -407,7 +417,7 @@ HEADER_FILES=$(notdir $(HEADERS)) #This rule cleans the source tree of all compiled code, not including the pdf #documentation. -clean: +clean: $(call print-help,clean,Clean everything besides the pdf documentation) find . -type f -name "*.o" \ -o -name "*.lo" \ -o -name "*.a" \ @@ -429,7 +439,7 @@ clean: rm -rf `find . -type d -name "*.libs" | xargs` $(MAKE) -C doc/ clean -zipup: doc/crypt.pdf +zipup: $(call print-help,zipup,Prepare the archives for a release) doc/crypt.pdf @# Update the index, so diff-index won't fail in case the pdf has been created. @# As the pdf creation modifies crypt.tex, git sometimes detects the @# modified file, but misses that it's put back to its original version. @@ -447,6 +457,8 @@ zipup: doc/crypt.pdf gpg -b -a crypt-$(VERSION).tar.xz gpg -b -a crypt-$(VERSION).zip -codecheck: +codecheck: $(call print-help,codecheck,Check the code of the library) perl helper.pl -a perlcritic *.pl + +help: $(call print-help,help,That's what you're currently looking at) From 1e1170df29623cfeff0acfeedeaf20c34a60d873 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 14 Jul 2017 14:55:47 +0200 Subject: [PATCH 0999/1192] move timing to BROKEN_DEMOS --- makefile_include.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/makefile_include.mk b/makefile_include.mk index 60076719f..e2d2a3366 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -138,11 +138,12 @@ USEFUL_DEMOS = hashsum USEABLE_DEMOS = ltcrypt sizes constants # Demos that are used for testing or measuring -TEST_DEMOS = small timing tv_gen +TEST_DEMOS = small tv_gen # Demos that are in one config broken # openssl-enc - can't be build with LTC_EASY -BROKEN_DEMOS = openssl-enc +# timing - not really broken, but older gcc builds spit warnings +BROKEN_DEMOS = openssl-enc timing # Combine demos in groups UNBROKEN_DEMOS = $(TEST_DEMOS) $(USEABLE_DEMOS) $(USEFUL_DEMOS) From a46d6eb81946c2fc9d6d837633c585082a4d120f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 19 Jul 2017 16:41:21 +0200 Subject: [PATCH 1000/1192] remove define of LTC_NO_FILE when defining LTC_NOTHING it doesn't make sense to define this opt-out option especially since there's no way to undefine it again. --- src/headers/tomcrypt_custom.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 3d8e63388..1d1615e91 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -71,7 +71,6 @@ #define LTC_NO_PK #define LTC_NO_PKCS #define LTC_NO_MISC - #define LTC_NO_FILE #endif /* LTC_NOTHING */ /* Easy button? */ From 61eb98b76eab8507b9ca5b4fe30325aa123d111d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 20 Jul 2017 12:47:19 +0200 Subject: [PATCH 1001/1192] add compile-time check for sprng requirements --- src/headers/tomcrypt_custom.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 1d1615e91..c657553cc 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -550,6 +550,10 @@ #error LTC_BLAKE2BMAC requires LTC_BLAKE2B #endif +#if defined(LTC_SPRNG) && !defined(LTC_RNG_GET_BYTES) + #error LTC_SPRNG requires LTC_RNG_GET_BYTES +#endif + #if defined(LTC_NO_MATH) && (defined(LTM_DESC) || defined(TFM_DESC) || defined(GMP_DESC)) #error LTC_NO_MATH defined, but also a math descriptor #endif From ab8c5b8b4982f4eda81acd7af0f505b7b8029e28 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 20 Jul 2017 12:58:28 +0200 Subject: [PATCH 1002/1192] fix help of {un,}install targets --- makefile | 4 ++-- makefile.shared | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 1f7b201dc..3200d86cb 100644 --- a/makefile +++ b/makefile @@ -84,11 +84,11 @@ $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. -install: $(call print-help,install,Installs the library and headers)) .common_install +install: $(call print-help,install,Installs the library and headers) .common_install install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins -uninstall: $(call print-help,uninstall,Uninstalls the library and headers)) .common_uninstall +uninstall: $(call print-help,uninstall,Uninstalls the library and headers) .common_uninstall profile: LTC_CFLAGS="$(LTC_CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov" diff --git a/makefile.shared b/makefile.shared index a0164c0fb..74e76d3c0 100644 --- a/makefile.shared +++ b/makefile.shared @@ -59,14 +59,14 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) -install: $(call print-help,install,Installs the library, headers and pkd-config file)) .common_install +install: $(call print-help,install,Installs the library, headers and pkd-config file) .common_install sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc install -d $(DESTDIR)$(LIBPATH)/pkgconfig install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins -uninstall: $(call print-help,uninstall,Uninstalls the library, headers and pkd-config file)) .common_uninstall +uninstall: $(call print-help,uninstall,Uninstalls the library, headers and pkd-config file) .common_uninstall rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc # ref: $Format:%D$ From 6b925485a8fc264adc1d716a103b519e8abd8a2b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 20 Jul 2017 13:34:16 +0200 Subject: [PATCH 1003/1192] make sure to request an element which is always available --- demos/sizes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/sizes.c b/demos/sizes.c index 0825242b9..bc3f8a5f5 100644 --- a/demos/sizes.c +++ b/demos/sizes.c @@ -19,7 +19,7 @@ int main(void) { /* given a specific size name, get and print its size */ - char name[] = "ecc_key"; + char name[] = "ltc_hash_descriptor"; unsigned int size; char *sizes_list; unsigned int sizes_list_len; From 129bc7175fab9c2770edc6a89a8ef74138ec3483 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 21 Jul 2017 10:16:19 +0200 Subject: [PATCH 1004/1192] beautify dh & rsa --- src/pk/dh/dh_free.c | 2 +- src/pk/dh/dh_generate_key.c | 2 +- src/pk/dh/dh_import.c | 4 ++-- src/pk/rsa/rsa_import_pkcs8.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pk/dh/dh_free.c b/src/pk/dh/dh_free.c index 965ff24cf..b4f58cacf 100644 --- a/src/pk/dh/dh_free.c +++ b/src/pk/dh/dh_free.c @@ -18,7 +18,7 @@ void dh_free(dh_key *key) { LTC_ARGCHKVD(key != NULL); - mp_cleanup_multi(&key->base, &key->prime, &key->x, &key->y, NULL); + mp_cleanup_multi(&key->prime, &key->base, &key->y, &key->x, NULL); } #endif /* LTC_MDH */ diff --git a/src/pk/dh/dh_generate_key.c b/src/pk/dh/dh_generate_key.c index 04db294cc..f128fd82f 100644 --- a/src/pk/dh/dh_generate_key.c +++ b/src/pk/dh/dh_generate_key.c @@ -91,7 +91,7 @@ int dh_generate_key(prng_state *prng, int wprng, dh_key *key) zeromem(buf, keysize); XFREE(buf); freemp: - if (err != CRYPT_OK) mp_clear_multi(key->x, key->y, key->base, key->prime, NULL); + if (err != CRYPT_OK) dh_free(key); return err; } diff --git a/src/pk/dh/dh_import.c b/src/pk/dh/dh_import.c index aa1684285..66778ebeb 100644 --- a/src/pk/dh/dh_import.c +++ b/src/pk/dh/dh_import.c @@ -28,7 +28,7 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) LTC_ARGCHK(key != NULL); /* init */ - if ((err = mp_init_multi(&key->prime, &key->base, &key->x, &key->y, NULL)) != CRYPT_OK) { + if ((err = mp_init_multi(&key->x, &key->y, &key->base, &key->prime, NULL)) != CRYPT_OK) { return err; } @@ -86,7 +86,7 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) return CRYPT_OK; error: - mp_clear_multi(key->prime, key->base, key->y, key->x, NULL); + dh_free(key); return err; } diff --git a/src/pk/rsa/rsa_import_pkcs8.c b/src/pk/rsa/rsa_import_pkcs8.c index 480d66361..8e15e066f 100644 --- a/src/pk/rsa/rsa_import_pkcs8.c +++ b/src/pk/rsa/rsa_import_pkcs8.c @@ -131,14 +131,14 @@ int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen, LTC_ASN1_INTEGER, 1UL, key->qP, LTC_ASN1_EOL, 0UL, NULL); if (err != CRYPT_OK) { goto LBL_ERR; } - mp_clear_multi(zero, iter, NULL); key->type = PK_PRIVATE; err = CRYPT_OK; goto LBL_FREE2; LBL_ERR: - mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, zero, iter, NULL); + rsa_free(key); LBL_FREE2: + mp_clear_multi(iter, zero, NULL); XFREE(buf2); LBL_FREE1: XFREE(buf1); From 541ab1c16c64c4fd3f340bb80728a1bd2214e014 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 1 Aug 2017 10:18:34 +0200 Subject: [PATCH 1005/1192] Fix crypt.tex with newer TeXLive (thanks Norbert Preining) See https://lists.debian.org/debian-tex-maint/2017/08/msg00000.html for details --- doc/crypt.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index dbe67e8d7..cb88eb7c8 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -1,5 +1,5 @@ \documentclass[synpaper]{book} -\usepackage[dvips]{geometry} +\usepackage{geometry} \usepackage{hyperref} \usepackage{makeidx} \usepackage{amssymb} From 4805c89adb9118fc905aec5ff25a91aba35df6af Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 1 Aug 2017 14:21:11 +0200 Subject: [PATCH 1006/1192] add ARGTYPE to crypt_build_settings --- src/misc/crypt/crypt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 1599ada2a..9ba7108b2 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -378,6 +378,9 @@ const char *crypt_build_settings = #endif "\nVarious others: " +#if defined(ARGTYPE) + " " NAME_VALUE(ARGTYPE) " " +#endif #if defined(LTC_ADLER32) " ADLER32 " #endif From b2448c593a93524c26925d384def7edc6715c623 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 1 Aug 2017 14:44:37 +0200 Subject: [PATCH 1007/1192] ocb3: properly handle empty AAD * allow passing "no additional data" to ocb3_decrypt_verify_memory() and ocb3_encrypt_authenticate_memory() * ensure that the caller didn't want to add AAD --- src/encauth/ocb3/ocb3_add_aad.c | 5 +++-- src/encauth/ocb3/ocb3_decrypt_verify_memory.c | 6 ++++-- src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c | 6 ++++-- src/encauth/ocb3/ocb3_test.c | 13 +++---------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/encauth/ocb3/ocb3_add_aad.c b/src/encauth/ocb3/ocb3_add_aad.c index da5a1621e..755ec4c09 100644 --- a/src/encauth/ocb3/ocb3_add_aad.c +++ b/src/encauth/ocb3/ocb3_add_aad.c @@ -29,9 +29,10 @@ int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen unsigned long datalen, l; LTC_ARGCHK(ocb != NULL); - LTC_ARGCHK(aad != NULL); + if (aad == NULL) LTC_ARGCHK(aadlen == 0); + if (aadlen == 0) LTC_ARGCHK(aad == NULL); - if (aadlen == 0) return CRYPT_OK; + if (aad == NULL || aadlen == 0) return CRYPT_OK; if (ocb->adata_buffer_bytes > 0) { l = ocb->block_len - ocb->adata_buffer_bytes; diff --git a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c index 89a77422e..da54ffa46 100644 --- a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c +++ b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c @@ -73,8 +73,10 @@ int ocb3_decrypt_verify_memory(int cipher, goto LBL_ERR; } - if ((err = ocb3_add_aad(ocb, adata, adatalen)) != CRYPT_OK) { - goto LBL_ERR; + if (adata != NULL || adatalen != 0) { + if ((err = ocb3_add_aad(ocb, adata, adatalen)) != CRYPT_OK) { + goto LBL_ERR; + } } if ((err = ocb3_decrypt_last(ocb, ct, ctlen, pt)) != CRYPT_OK) { diff --git a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c index 28db89199..1f81a26dd 100644 --- a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c +++ b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c @@ -59,8 +59,10 @@ int ocb3_encrypt_authenticate_memory(int cipher, goto LBL_ERR; } - if ((err = ocb3_add_aad(ocb, adata, adatalen)) != CRYPT_OK) { - goto LBL_ERR; + if (adata != NULL || adatalen != 0) { + if ((err = ocb3_add_aad(ocb, adata, adatalen)) != CRYPT_OK) { + goto LBL_ERR; + } } if ((err = ocb3_encrypt_last(ocb, pt, ptlen, ct)) != CRYPT_OK) { diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index bcb5d67c0..a9bfb61c3 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -180,7 +180,7 @@ int ocb3_test(void) if ((err = ocb3_encrypt_authenticate_memory(idx, key, sizeof(key), nonce, sizeof(nonce), - tests[x].aad, tests[x].aadlen, + tests[x].aadlen != 0 ? tests[x].aad : NULL, tests[x].aadlen, tests[x].pt, tests[x].ptlen, outct, outtag, &len)) != CRYPT_OK) { return err; @@ -194,9 +194,9 @@ int ocb3_test(void) if ((err = ocb3_decrypt_verify_memory(idx, key, sizeof(key), nonce, sizeof(nonce), - tests[x].aad, tests[x].aadlen, + tests[x].aadlen != 0 ? tests[x].aad : NULL, tests[x].aadlen, outct, tests[x].ptlen, - outct, tests[x].tag, len, &res)) != CRYPT_OK) { + outct, tests[x].tag, len, &res)) != CRYPT_OK) { return err; } if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB3", x)) { @@ -212,13 +212,6 @@ int ocb3_test(void) #endif /* LTC_OCB3_MODE */ -/* some comments - - -- it's hard to seek - -- hard to stream [you can't emit ciphertext until full block] - -- The setup is somewhat complicated... -*/ - /* ref: $Format:%D$ */ /* git commit: $Format:%H$ */ /* commit time: $Format:%ai$ */ From 1aaa5abb33f44e3abcd4b0638f7591265975c25a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 2 Aug 2017 14:41:46 +0200 Subject: [PATCH 1008/1192] ocb3: check the length of the nonce --- src/encauth/ocb3/ocb3_init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index ab3c8a7c2..1d88736f1 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -56,6 +56,12 @@ int ocb3_init(ocb3_state *ocb, int cipher, } ocb->cipher = cipher; + /* Valid Nonce? + * As of RFC7253: "string of no more than 120 bits" */ + if (noncelen > (120/8)) { + return CRYPT_INVALID_ARG; + } + /* determine which polys to use */ ocb->block_len = cipher_descriptor[cipher].block_length; x = (int)(sizeof(polys)/sizeof(polys[0])); From d77cf0e24823e146c453e288bb17696ea5d2b6ef Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 2 Aug 2017 17:45:59 +0200 Subject: [PATCH 1009/1192] OCBv3: implement RFC7253 compliance This fixes #256 --- demos/tv_gen.c | 9 +- notes/ocb3_tv.txt | 1038 ++++++++--------- src/encauth/ocb3/ocb3_decrypt_verify_memory.c | 2 +- .../ocb3/ocb3_encrypt_authenticate_memory.c | 2 +- src/encauth/ocb3/ocb3_init.c | 10 +- src/encauth/ocb3/ocb3_int_calc_offset_zero.c | 3 +- src/encauth/ocb3/ocb3_test.c | 70 +- src/headers/tomcrypt_mac.h | 5 +- 8 files changed, 608 insertions(+), 531 deletions(-) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index f3dd7fa89..196c75664 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -420,7 +420,7 @@ void ocb_gen(void) void ocb3_gen(void) { #ifdef LTC_OCB3_MODE - int err, kl, x, y1, z; + int err, kl, x, y1, z, noncelen; FILE *out; unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE]; @@ -448,7 +448,8 @@ void ocb3_gen(void) } /* fixed nonce */ - for (z = 0; z < cipher_descriptor[x].block_length; z++) { + noncelen = MIN(15, cipher_descriptor[x].block_length); + for (z = 0; z < noncelen; z++) { nonce[z] = z; } @@ -456,8 +457,8 @@ void ocb3_gen(void) for (z = 0; z < y1; z++) { plaintext[z] = (unsigned char)(z & 255); } - len = sizeof(tag); - if ((err = ocb3_encrypt_authenticate_memory(x, key, kl, nonce, cipher_descriptor[x].block_length, (unsigned char*)"AAD", 3, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) { + len = 16; + if ((err = ocb3_encrypt_authenticate_memory(x, key, kl, nonce, noncelen, (unsigned char*)"AAD", 3, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) { printf("Error OCB'ing: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } diff --git a/notes/ocb3_tv.txt b/notes/ocb3_tv.txt index 5e9e8bf69..64df75fb4 100644 --- a/notes/ocb3_tv.txt +++ b/notes/ocb3_tv.txt @@ -3,567 +3,567 @@ are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag step repeated sufficiently. The nonce is fixed throughout. AAD is fixed to 3 bytes (ASCII) 'AAD'. OCB-aes (16 byte key) - 0: , CDE5AA0562BC4D474EFBB4120E4C5BFF - 1: 9E, B60840CA7005A169C1240E3BFB401AB8 - 2: 75DF, C606FAD65B2CD087774CD0EB341AD265 - 3: 78309B, 26179C93AB865167FC583166E6AFD275 - 4: 0DA474F6, A55358F6EBF78F63C45AEFA5C63FAF17 - 5: 2BE7DEDEA2, 95E6590B2A19D85F25E4A76861F7CDB3 - 6: BE808ABA55FC, 6C9E74B2BA0D628834A2C2FD8AF9CF39 - 7: 7B20C2D42F94E5, 5B293A423119EF044A5E5E5E70FC87DD - 8: B7CE5AFA00FC9843, D5AC1CF000137D8E0710DC63457E5F73 - 9: E8EF6A913D905BEAEC, A96A005A2A0F08BCEFA7169D69E347E2 - 10: A15B41ED2FE26F90C0B7, D8453A7F07D90AA3E48BBE792DEFBC84 - 11: 5CCED9699C5524623AEF4A, D7450C6465DF3AD2513B799521995821 - 12: AE70D6492673FC870675AAE2, 697EB5B96673EB7FE48A07A1F2C1E957 - 13: 23C3E43575A9D80938BE58D6F1, 2CAFDB3ADABFBE0EE48FB1DD31D67ABA - 14: 235E50ED798584EEB7CE7F31490F, C26DA5513F19D6C9345EEE2D9B24EE30 - 15: 99BECD55D0CA96718E5F9DDDD127BF, E1A4FAF9F68CD80C997EB59FA8B6A38A - 16: 8EDDAE4DE1D32CA64D741A8D0371745C, 603603E91FB7EBA3F9247420C3AB36FD - 17: 52F17D54375D514A518EFA8A1081990846, 7B5C4EBB3B1AA523288770151550B97D - 18: EFC039545414A9D26B58934BBAE30D587082, FA4CFB8B873933154A24C58A1F469146 - 19: E4756B6C55FE1973E4CD1ED5CD15AAC1FAEFD3, F32D28D2559EFF18B2F00F344DA975BA - 20: 8F47FC80A73ADDE004F69BCABFBAFAAC7EE38D50, D80913FBFAADF1C5C3FA8734C74DEBBD - 21: CBC47AE59B62F9A5AC8B1A0B27A54EA98DF1FEFE29, C34597A3E452216F9D8B53FB32E11B86 - 22: FFECFCE641E2F16F656A47157248D39C78A928378831, E8D7ED60F3BD44DCD676F06C43BF18CF - 23: 8B4C8A02A2D2CA06691A29AB7E856C058946A404DFB78E, A8F44E1BDF86BDC4CC80BE55B2A8906D - 24: 97D0A8D76D8CEA8E378B66E94B498127997C60A9EB0E1D03, AFB2B208164DBE1408694BFE8E87A5B9 - 25: 81BB7CC0A206760A631EF633BF5897B407BD27A20C28DE334A, ED82026689CD89BD4E777A74DAC791DB - 26: AB69BF543CB1E731CAEADA9C8F09AB81720D446BDA453AF87D1E, FC588E24304E8CB47ACDCF1AF111DA99 - 27: C5FC023E000F16C42CE63AB26C3FA4FFD8373E4EEC97AB8EC0A9CB, 99598DBDE114FCFED0B5EC710A61B99A - 28: AA200F54FDDFEEF3AFA3447149F5996643E4E63ADD57339129F83BCD, 1C6645CC83112B031F156E9D191BE806 - 29: 3E75A6B5DA18FE0F918094CDE11F0109BD206D68C570E4DCD7C0BA6E05, 669779DE7B8E1A657DE51C4FBD8FA8FA - 30: 79EA616591785C8EA654E90E819920E20A53CB420147527FA9D2F92B9835, CBC3557ECB9D850CA17ADB726EB020FF - 31: 35709AAA8B6C28254C1A75FE6CF13E7D90EDF1AEA677FB1057FB6C0ACCAB98, 491E0662C259D03C2E72A58736B6F709 - 32: 59459AD454CCECF40D4FF30E748CD1BA17314C9EF158D223AE2A736ADF7E2397, 2C3240DDD2FA281A567D38C4FA598ECE + 0: , B314B579B54365D9094A8A7544FECFA7 + 1: F9, 3E49FF310B88634BACA91D55DFBAA185 + 2: 04B6, E13FBD06086CAEF7AD042C93D7BB6FB0 + 3: 5E9389, 04216D3227A79ED90D60637AACA49318 + 4: AD4A090A, 71FF49510C87EE5FC004162F146D4C1E + 5: A3D8218932, 5AA9FE79861F6B5BC8F3E238D0221388 + 6: F8FADE0FFCCD, 04FB1C91F3B23E58F6B9614648B1A653 + 7: 92C4F8CC40044E, 232C049DA70A9AB4B6B3A03B286180C1 + 8: F93B1744D7C77AA0, 21FBF572E7FE551ECB5025BDE9ED5984 + 9: BA51E012FF90E40800, 117280C3D04F2376D4B2F020AA661146 + 10: 71CE4295BF396C6B2338, BE21F998166D7EB96285884217FA8086 + 11: E8BD27F4EE71D7C8B92B32, D6004359B714792C44B1EF5F9CA04F3D + 12: 44F561EA59DD0DC2A2FFF982, 6AAE8B19D5D6FE35A510E53C35C74AE8 + 13: 644B54237E20C68249B4FCE531, 806FA9F25EA420A8B4CAFA7620C7256A + 14: 2AC152EA88E036E58667960CAA99, 04351AF74BC428C37282EF2A85C85B08 + 15: DBB19579CA7E525544CA6893556BE0, 6847407644710A2DDDC128E4C7223FBF + 16: 457557479FDC7F70CCDFDDD53EC950CC, 8B9C8D93E60A881F625B82E200B021BD + 17: C07EAF5328D338CA4601560F513A2A4AC7, E882049660635CF0D13F6058773141DA + 18: BDEAE23389E05F719CCD723DC972F2C884D3, 0E40806F30CF1F788C3C6D10B89096A2 + 19: D5F334BC7A5196E460D52F89E129F33D2C9F91, 00C4EF195CB474CD880DF1B6915EA357 + 20: 74435B9ACFB72DF8D67DE0BBB2F18F34EF1C5962, B33A91F1AFEE65F56C781AD7047E55C4 + 21: 31618C38EEB4A77E0769131E91F4814C7DFB825409, 8307F47A53FD8CB7B82211E8121738DE + 22: 45ADEBF8F29313F13C3919A4246C96142485B58D074C, 268C4072B1FB58F0491EFF34756C1250 + 23: 2E11364612BE88875F506FD6603CBDCCA10188B3F6BD79, B782DB9E311FA0C3F1489DA839CF37CD + 24: 565DB17A001D87FF3B432D80CB6DCF84A389E306845D4BAB, FE514CA6EACFC08D6CA02D4F34CA223B + 25: 7819A4A63E4ECE3FB6DBC5208A5E0ECC5803E22F28C083C6B8, FA00969B7C91711E0E70027D13FF0407 + 26: 27186491315F2F00D125C1266C442FB3C7B6FC824DE4A30B3EAB, 084DA787A8AA2D108B95F3A5B69BFA52 + 27: 3545DE774BF9CFC3AF51602CCEAFDAD54302C8FC75C3FC1794C6CD, 68A18C2F767BDADD023D85B722BE8D6D + 28: 73AB104D83AE82A4D0AF53065D488EEA47C05E201A667581BB046E98, E65DAFCC4DD662232C895602DD8C7582 + 29: B7B26992F361B7D9CE2782304C6C62495E46216304075A787395948752, 38F99FA3C086CE6B2620302931DB0BC8 + 30: ADB1E4FC3217F82C2851122B8EEACCFB1C731565AFF856E201E8EEE702D1, 615A3A991F4BA240768FDCB4D9CF16DD + 31: F2CF0958F00F11E8564CFFD9AEC71451344E2A35DE7D82D1AAC14649BCD34C, 04E97E02B50CFCC86EC0B9A958057F66 + 32: 914755B90B12CF5720CC0176AED145ADEC862E51B237AFE862477CF91D729768, EEDA6BE8E7875AA7E1E3393DE81FBAF7 OCB-blowfish (8 byte key) - 0: , 33332FA5A79E3645 - 1: 38, 66779E3613C5540F - 2: 3443, 48D3E25F4007A1E3 - 3: D1ED65, 486767AAD7B4DCCF - 4: 6FC4D34A, 50706E35463CE200 - 5: 7F05718FCB, 4AFB55795A94172B - 6: 9AAA6E72BC1B, E060FA18168A31FC - 7: AE90EE07B41CBF, F47C611E9C02D095 - 8: D4D67E11C84600BF, 9DACA76000861745 - 9: C4DBBD53B65A321CC8, 9E5A12890282120C - 10: 74C14E2DE4BEC704CF1D, F1D432FBF8B17265 - 11: A57514B6A91B733A1467C2, 6E54A6A9F56D8459 - 12: 9CAB77627D8EFA9438451F3C, 4925FF74D2CDB33F - 13: 2E5BC3A020EC249DA94E8DB4E8, 30739AD56648C917 - 14: 807B29C5AF9AF93906CFE876B081, 97901FE44444A99F - 15: 6BD70492F763A704CD5351E691BF07, 2459A0B9332CF14A - 16: 1F4919EB6CAD8D19B755157FD1A2E89A, F7EAE8DB5F5FA9B1 + 0: , 6C3BBA12B543C3BE + 1: D6, D72F643440F08AC1 + 2: 8208, B7FD2E2D5FF4B273 + 3: BB2B8F, E6B6A023460F07B0 + 4: F2BC4A6C, 7B9D26784038A593 + 5: AAFDBD8EC2, 24E6F671E7A0D394 + 6: 929326B18E7F, 5C6CEAEF7B63DA71 + 7: 085C9A0013CB23, 2C0BA203FC706398 + 8: BA45E34414383ABD, E367DDFF2B9E7B51 + 9: 1287AE007E03F4B6B6, 6EDF52831D00F616 + 10: 2871B39ACFE7E8D7C326, 9ED4DB2D5ADBC902 + 11: 46DF7AAFBE096C26536BCC, 497B8F7930B03150 + 12: 7F794AD0A6673F9DD9BA09FB, 4B6817508EF74773 + 13: 138D1877D61021E526EFBB9F9C, 0E18238F3112C0F6 + 14: FFFF1DDC353F4C0F832C73D4C4F4, DCFCECFEE8B0BDE8 + 15: 5B8F209B6FBCCF323773CDE26B1ECD, BE11C1DA023F30F7 + 16: C3C1438B50A1124556164A38D12FEC6C, 532740AF7CB776B0 OCB-xtea (16 byte key) - 0: , 5F751041CDB0C2B5 - 1: A5, C48C22CADB797CF7 - 2: A3E9, CBB821F70FBAEA3A - 3: 7CA3C5, 686647FF8466C56A - 4: 318C2DA8, 65C58584A3E9118A - 5: A7C02B6438, F87A48C547971C30 - 6: 314FBFEE9BDE, E62DC6E65FD35E8B - 7: 87481270584EB8, C582AC684B8D02A0 - 8: 1E5E0DD030860CBC, A19FF0144005994E - 9: F0BDCCA3C2463850A5, 15420E4C10821445 - 10: B6D1C598C7046F921299, EE9C28659EE2927E - 11: B1376A4D9B3EF59B873917, 0DD3005E47CE72DB - 12: BC9D026F374A89B8A45E55D0, 09DA1DDFDC3A5463 - 13: CC8DF93BE2D71601CDC52124A7, 9623D92C2FD9D62C - 14: 90854B2161951CEA934AAB4E2B6C, E80632AB9F2CE421 - 15: 7ADE7A19FD0BAF71BE1C6DA601F6D3, 90612EEA15A64111 - 16: FA21FE68977D60D51ED897915945E5C4, 1A9344DD8E25D45C + 0: , D00F0AAB89FD2268 + 1: F4, 5EC48A975A5284D0 + 2: EA67, 4D7DDB44F00B1914 + 3: 19E6F3, 5DC77905DE7BCA27 + 4: 164F891A, E41BFD4F3D256B72 + 5: DD08DE502D, BB92537DED07B1D5 + 6: B176A93723F9, D6B5BBE9BD9DCC2F + 7: 9F0CBA46793F6B, 3936294EF1745B93 + 8: 04CC55A49B65D296, 4BAD576455149F19 + 9: 7D6FCB8FF28FFE7DF7, 40FEBD5048374447 + 10: E5B23D64643BE920B5DD, 7E980F9F6A1C1E24 + 11: 07D48D6A863286C485C169, 14FBE819A4E05066 + 12: 4DF565F388F75E453554CB98, BB63ABAE98B89A0D + 13: 3B839BF161A9A873C67D864412, FFBBE368571140CE + 14: 35D0E47C7B52F63D9CD52B5EF7C1, FBBE7080BE16A358 + 15: F657C137AD01E24A2E09EAE9669060, C61609D640AED997 + 16: 06BF9F739218FAF8469393E4A880401B, F1A833E2FF0F59D1 OCB-rc5 (8 byte key) - 0: , 4287F61BB46382B2 - 1: B9, 753F79A4BB0CC986 - 2: 4FC1, 77132F07D73B20C4 - 3: F1009F, D0113ABB5CD465FB - 4: D68B146D, 5CFA18D483741043 - 5: 3EE7237B8F, 0AAF3E6746AC93E4 - 6: D6C5D714B773, E1C3A97890A4B86B - 7: CF1ABC07E56F1A, 96215C8CC5471BBF - 8: 9783988AE164F9E1, 0680B375E3A0D562 - 9: 9ACCEC35CF126304F6, F74653152A177CE9 - 10: D94C215F59ED195DDB5D, A5AD88DFFAA297F7 - 11: 911BCE3E464282F3F67A3C, 561F90837B05F0EE - 12: 48F8A06D30CA2C53D2B7176C, 5BA9AEA8003B2DD7 - 13: B66F45A34FFA2CE7086D63E1EB, 0C8D09F2F4C46C79 - 14: 15EFFA2ED88EDBE91FBBAED12128, AFCD680C7DCDBE27 - 15: 5B54DEDCB7D14FD48373C1B93CF084, 226A5920A2E712D9 - 16: DDDACAEAE7BAB3029B1D841502F3F8F1, 98527F33CD759F1E + 0: , C8A6E737A8E6C157 + 1: D5, F9FC436713D8C578 + 2: A52B, 620A27B44F9DB42E + 3: AA4253, AC7574A061DBAC3E + 4: 3E9241AE, F5011F6F49F35AB7 + 5: FB39924246, C53004198FD2C046 + 6: 847A3249B1E8, 92B4300BE557D04F + 7: F8BC0AEC7A0DDC, 27CCDB48F5AC84AA + 8: 5A7A91DFBE572B10, 67D4775F5AA660F8 + 9: 475F7E67910AB33762, 2193ECC897A7E0A8 + 10: 8F7254CB03D427D123F3, 2814085372D28E3B + 11: 0669B3DF133675FDF0E6C4, BD2282F47C5AB17A + 12: D3041D4F0C79FBFE6155DAAD, 01228ED90A077F1E + 13: 2A46C3FEEDBF49B14520FB1786, AB61B06971BE04FE + 14: C3E5F4749B28E6C70263B9A49411, A0D06FCEC6F8C051 + 15: 5A307C6E510C7B7F0838B9FD3B3CC8, A7F7A41558848158 + 16: C2E2DD4DEF101AA2EF8696B9FDD24B03, 614D0606D5BC577E OCB-rc6 (16 byte key) - 0: , 3BB834902D39E5E91D89B0DC0DDF65EF - 1: 2E, 9B9135C04DA988AD3D2A71B8330EA0C7 - 2: D7CC, A4D984EC457906AC76D633086DDA5FBB - 3: 394491, 35413A2E1936F2C5347BC3F11DE5C5E6 - 4: CDB4E8BC, C92E3FB50FDA7292D8889CAF1239C669 - 5: E073807488, 293B4362693F5CB7F87B499B5DE802FB - 6: C423B1D2250B, 4C1C672BF015B68FFC5496C1E4845038 - 7: 0A9221803183AC, CB7E94F239CDAFAA2E85C8F6F84D291C - 8: B11DF4E8DFE0DDF5, 388330327A540AA342FCCE9DA8722974 - 9: 4F22BE632E97EAC40A, 52A80B5BABAD91063F005A90366F5D03 - 10: C078544308477C436C1A, B71ECF0393B5EDAC6A6885E589B8495F - 11: 70D055E1DD32D2968F27E9, CC203EB94EA969ADA6AC66E38114AC15 - 12: 444A3B67B3DFBEBF25CF1EB8, 0D46A4E88E25DE2B876B53D6221BC155 - 13: 82DFFC0FF3AA208EAEC9AFFC95, 90EB11D825B92AF732659F5E3A57AB3F - 14: AED1A39332ECFF633DB4DD4F53D4, BB14AB91B3CCE190F780BA05D94B4FF1 - 15: E98CDF3BAA07AF91F30D984D1B31D0, B74AA68488959CEB0434D0DF258E6206 - 16: C6EA56068EC393603313926A54E79808, 8D7EC011133F2E419AE27DB99265BB51 - 17: F28D6DC79AC812B4E14925AABC7A18800B, F125CFFDA992F6336D88E3D6CD5DC739 - 18: 419AB005309458BF84572AF5EED46DC0D90F, B0A5A2D13EC928BF3DD2434079A20528 - 19: 64D64C8F3ECDF0DD43B6BEFA045FAE72D79D0D, 9FB86FB186B57602E609F08E76FDD8D0 - 20: A8EFCDA63D38273404E91241C40992A82DB63F23, AF116B5369C3B6C5A8709252537DDDDA - 21: 39A5A5EF3CD91B27138BBB784CBE027B57A81603DE, ECDF09F22FB185D110F6997C891F8569 - 22: 464381184976612C15D1589DC1AAC2C922D69F3FFD31, C18416F51FA8502C06AAEABDBE5AB22E - 23: 21F0118E17188E09D5E5C6E53DB97BA2585A122FECD6E9, DD7B583A17B07967917D7603D453301C - 24: 109AE231C1810250AB181BB094099D4B21B08B948A9F7934, BA3BD871DCEC2A0D75C1B54F3C5AE870 - 25: 080BA8AAFB8056A102BFB37864FF0533278F2AB3A23D42F719, 4566DED8A3B4E9CA441B87EC18BD5E4A - 26: B7531B5B0E7401491248451B6833F738F4700B9F7FA13C262125, 9F6B4E956A338907E34BB91EFA5D2A26 - 27: 7473E5550DB57A75C1E63859580DBB7E0E4704E4360EF4AA0FB3DF, 0E1C543C18F93E853143C8B21CDF6327 - 28: 8D8CB57288A98D1A3CC315045DDAE1388C90F6C6EBD9704E91F9657A, 9FF33BCB85A5AE936244B7C24C2F7909 - 29: D4951C16BE95E67C9FA9579465AB44187C1777B0C4050D3878FA82B7A9, C9F3EF7588B041DF17E5333EB397D015 - 30: E28CAEB88F590D3D7D0FB6F7DD7EAA88C091D67B72E67B297E280F048C68, CB855FF11691C31A423A88525F7941EC - 31: A043763CAB64783E8637382E5DCA023356DC8FC02F7A9F314B448DC7C2A4AA, D35E089232C405B0928A99149555C406 - 32: DB2F18A11D7726DC6EFAFFDB160846968EDE06A251E03CB92ACE0F435E6DD698, 7FBF8E2F2047216C0062B6B070FC39C5 + 0: , E55863F7B850CEA28023BA8E2AB1F4FD + 1: E5, C1F5CEA421F84AECACF622BCE507BD21 + 2: 6443, FB3B7992E057AA4A0E31E8718093740B + 3: A1E36C, 0BE1B8CC538E60FDC36165AF5D273F41 + 4: 4891FC23, C6ADA69F1A613830CFF5E564F01FEA93 + 5: 6AAFA8549C, 6DDA8C3720633B9E83BBF2DB356EEBCA + 6: 254EBFFB3C60, F092EA5FE0DA6B90DD5F2FB75FF92960 + 7: 1DA9F258ACA84E, 762E38C6545C3ED4AF970B09C6747CFB + 8: 289067E54AF4FFC9, C04CFAAC0D919AD6027A7D923705443B + 9: 65E083C54F9CC7C228, D6A4A1AC4144217BC07329BCDDD6F27F + 10: F78CE1BEE4471E9830FE, A503FBBE2378505EFDD50AD4FEE587E4 + 11: 31874B00827B810588A635, 287CE2ECEF9247BCBF7537DA052E6A86 + 12: AC8CB1138A4BC5A19BA96DC3, F443C67A2CC51FE2DF38A8B6C0F08220 + 13: EFBFF1BCDF7B3F66A402A01459, 274A2DA9F33DB5203A1EBF90366E5064 + 14: 7A47F5FBA688594319CC14B33458, 9107C62E140339F3FAB445113331DE4C + 15: 69957805FC3C51C59F9149306CCED0, C887CB0B1D880BE0ACA16AC513019721 + 16: 6735D0D5D2ECFB68B718B8A95AFB8922, C97E9187ED00C6D9FAFC76511BE46AD5 + 17: 00F51550A1875A3517FDE2A3038E1CCDAB, CDA7AE39A8B8708E91A3EB7C94FA7BD6 + 18: 85184BEF9A31A8F4CBB5CAA56FF5C63845EE, 5BFA7FFF2072E7B4D9AFEA21D23755CE + 19: 025F6ACB1A85173A639D8FB24ED4B1E08339B8, BAB248C26F24FCAA94328C9BB0821E55 + 20: E18DA8E16897E888C73743E0BE165A6F8CC94A04, D759682D03ECE0888B07915D6E3F5FC6 + 21: 6B94BCF8DE2F326BC7D6BBE1FE7B744E25E717CDC3, A69D284CB8B279297A4FEA3B6561171A + 22: B9AEBFF5E08E82451A486BFFAAAAA2564F36BEB8B00D, B0F0B98B97DADF33B25AACE289D8BF9B + 23: 5F3C5797CC821B3A3B8559C5A5AF422F85B2803B7A4D9E, E01492AC89D7CB9F87FB8B23B6E55152 + 24: 2760B653AE34625A78ECC775BF4584DDE6B2D0A1063C7B8C, 2FDB63B68839C6250E0C5F16351C31BF + 25: A5CD59CCA78AA4A95B1C1CAFABF90230FBC9F6BE66E1AE7575, 0EE3390FF12980B9C3DBA27802FA7F01 + 26: 4E9D19900631CBBF3F2326C129C90AC6B5BC3889E1392A05E542, 3CE0EC540949EBF4D70E98B17BC37D58 + 27: 5448E01EF054DC8B4B6C148CB05D5A20F50EBDFA42E59FAE178058, BD64C93FDE56099E206AD57958A259C4 + 28: 9D62242B65C51F9BCF41177BE9E992AAB7721A6EB3584CCB25FE13C1, C93E44C0AF6559D8045D89B98CFF59D4 + 29: B72E80500D0ECA63727E82569B3BCE66F11DADBE374BD0672D0880645F, 8419544A26D030E30085ECF8F97896F1 + 30: 28F27958226709140EA0867D285376E1B14890F44A18A219E1CAB02FF62D, 77CA96AB5A1F36E7564B7010ED08E540 + 31: 80F7CA76B988519731D76C4D60DA0E5C77BEC17368C9B237AE60A910312334, 962C1F0C4E7C8137863A48E6E5BFA44B + 32: 1B43CDD2D0E13ECAE95F2DE4782760679CDCCE5E74A3C3E6614BAD86DFE073EE, B5A6A14CA26E60AAC3B5C9DB0723ACE5 OCB-safer+ (16 byte key) - 0: , 818F824701DF2D6F384E39A6B33C8C7B - 1: BD, D1BA735E4601B977CEE4C846DF801030 - 2: 97E3, 4ACAA433A1F4BE2459D8FB5A46C83D97 - 3: 54A32B, 837526FBF9334EEE32444898D72A6FAF - 4: 550BF0B6, 66993BCE9CEEBB0E42E734EE72F71F6A - 5: B9DBB41DDA, 5BF83E90030911DEC1F706A0CA3EAEF8 - 6: CFFF407F7559, C3F9471E5B38384FB1882D4B0FCD4164 - 7: 27AACCF405075B, 16E59258A2639EBB74A622FE58B10D50 - 8: 6E0E5FCE730A1E0F, 74F51050BAC882A782DD1D66A83367AA - 9: F4A70127DDD496C035, BD93EAFFD5A2C36A354950DC3548925F - 10: D6C82811BF1493C3065E, 9252733A1C829D9328E810D8E1A68AC2 - 11: 6AC43EB973A878E80ADF13, 9EE33A4F9F9FE039A7BC0B3395AABC24 - 12: E54F88B6A05961399FD4A842, 11354D65DB61A2F42683E3ABE65C1518 - 13: 2771576E1EC6533061395C206C, 1BC2281E33BB360A7EB488A87FD3422A - 14: 59FACB5C29A24EA7B2ACFF73C3D5, 1D1E65A92DCE815BFC61C067F919C9D5 - 15: CEB8B9CD33CBB8638BB3AA463DCAFC, 4B6307B67D62F0C9C2A17407E6A6D37C - 16: 1E9BF87DB8A50018945D20F1711939E8, D21689B5C7AA20421E1B0543C44CDBF8 - 17: CF466CFF02460FDFEDDD55D32E7B81F7DE, 34853E04F800B867FD81101337396B5C - 18: 7825EC997E35D69B7807EF09520FE262D9ED, 0C56E50B01DDB6F79C0796F644566365 - 19: 0DE8DC870E440E81E884FBD240F135C0C51904, BFA98A06FC10F61ACA04A3EB83F4E4C9 - 20: D7B6238F58DFA34AFB01F7E863A6239A643EF85D, 72D58FFFCB8EDD2B212E384499556655 - 21: 0C39A6472C20069C81B86D017C29996D332A7934B6, 00200B481BD27D3E7F3B5A93B01E8CD8 - 22: AFD445996544CADF9DB1095A8ABD1B85139C49ECE807, AFA537A91C7B5B461285C1916587C5BC - 23: F5971CA871AC2AD43E5FD3B7F135F8F114E1CB8475CE3F, D2AEEFCC904BCC19BF1746D4F4C12B2F - 24: 0E501E14E1D90A21882A39AD8BF30415A5A19F45F930C9B4, 994BEFD4A19281466D6DA15A136AE7B3 - 25: 91DE86170B63B8A3429DE5A9686CC7033A76ABAACD196E1AC6, 1D19585EB7F4215499C3E5E95E6D9B3B - 26: C32E3723685B361A29A931AEA09029A3ADF4DB5E6FE03ABA1374, B7E237316BE981CF1BB7EA2C0AAB4FE2 - 27: A7C3BEA3BB8590EA4533EE86CF6A98F555E4C75C31648F7539FBA2, 4FED5804515A9C83A1CD7E0FF18EA714 - 28: 4B801BE2237D8E46B2989A4CB914929B9DED959F14DB78006ED1BEC5, 6A8315F87E69535EA157E1F7C46772F6 - 29: 868A2EB898BD7AF43846C7792BD0C30BAF0B278796BD8CF74BC5BF0BC2, 600A8C9D4DAA2907DA94F0F6C5ECE1F2 - 30: 8F9C5C2BF2C5BFB33535E5A7793D18341B9B6D5A788765196068843B0E49, 6EDC9F4E8BD16E030E6F63ECBAC407B6 - 31: 626D32D56088410B8B0E106ABCFB6B80A3F51C68A6FA648C45B93B5FA79A1B, A1C9660396698CDE92C48E5C79C95FB4 - 32: 23735C7C0AE0FF5FCAC7D16377090DCA9FD0E679248E04EAC56752BD0AA790F3, 7C8EE978EEF3E9BC9F5E18902CADFA94 + 0: , 8F56A79150DEFC6B2CBB3FB6E359FBD2 + 1: C9, 8E316BB1D0C29B6D7A5A87099B85B72A + 2: 2060, BC6DEBA562045204F685BD4AD1095614 + 3: 0CB79E, FF5C3DD5E0D3C587F73B79871E18D92D + 4: EB055446, 68712BEFD76001DEBEB0D49FB45753C9 + 5: E936796698, DACC5325D10076E3454EA244FDE2C446 + 6: E64E038A3E72, C790A04E48892CD267FC323EC8606BE6 + 7: 3530F74D417ACC, F0383D56F2FF810F37DFEC884A7F0189 + 8: 2B616C4A95A3C681, C2D5793720F925F74693C7A8E117860C + 9: CE0C99100C05C3BB31, B1F94A461CD2F81E31AABB949E2B2866 + 10: 2F4556261D59FB7104EF, F061D0F70B0984C57651ADC2C500FB90 + 11: B0DC48C26496AF66330E6C, 68276FCFD1C9AC88C54429CA7714662E + 12: 5F2ABA85E68BE0FBCB8127A4, C1FF0E5E54CFCB1109E8707E6EFC5548 + 13: 52560F88ABD9EF2BE8F5693CC9, FDC0F5DEE4C0739869C8D310EDE6D8CB + 14: 3FB7DFB38F9CB53B932C09BB4953, 156BFBDE08F2665A3F7C79F711042B40 + 15: 09031E49212D7F8706DB42929EE5FE, 8A0F8A6634EFA7E56471178F6F906CED + 16: CED816F12E02E14B312C6DD520BDD936, 4FE5C914D17C426A3BCF5799A4BE0FA8 + 17: 30180417B91D913762B8066964F01F7050, F9FF5A968C3B5D6F6F8ABD5BF23461F5 + 18: 9135A4CE4F8DC27758B9F158F515F89C8B9C, 7B3E446236E33F999D7B586205B55D33 + 19: FE2BC52A5AD051401471D2487803E2F70679E9, 902CB619F522AC61EE70C5407E23441C + 20: 7FD71CB30B9836C6CABAC78AC336BD5775EF3027, 7E6419511E3886BD3736D1BE13FB8599 + 21: A946EBC8A4F779A6FF805B2B4F9D166479A25C71BB, 850E57C9BD78774FC4CF5BB1A956BD4D + 22: 1F3101AB8B7FA06DC3194D66F3997C990C79DD69669F, AC4962DAACEC80D993E52A2170ACF145 + 23: F8BA79427B329475C7374CD1F48518C5064D3796683978, 39D4EE512DA456B0E6EBE7680766756B + 24: 52CD976F3DE59CCAA8E352161BD7867C026D39142FDFADC4, 7BF77402B6CDC953487A1A4C87AE4ED7 + 25: 1A1D64F1B73C52B698FFED8DCED76292807AB3676004B63064, 6E16BCC6F312A92E80FCB10DB8BC659C + 26: 171AF49F6816848A355D92E7DBFD769587EA2B988076BA5D5918, 9F821AC305325BDB9B12B44F82882C63 + 27: 025152E05F44E7F05C2B4BA3B0023544CFBBEC8F9A98C13E931E2D, C8E3228E2B74FCC935BE1802E092C346 + 28: 96B96648528B740D15504E299E619A6D0B129407DEFD04C1BF405AA6, D0721CC578C44EF15FAC882A8F49617B + 29: 9136905B84ED8A403CA83DC0DE081CAAA0F8E4F775FE0EA1E3E20BF223, EB474F78BFB6BAC8E1B1867ED405DC38 + 30: D65A403FB587A6839C071167ED096B46FB480468F7C1F702F1B2479CDA5C, 8E82A3BA76E1AFCD82E324FEAC9E3084 + 31: 017E3A54463EDC279879A07FD7BFF1225CEE307BD8741B6013FE4C9A454EB8, 10449A44C1F90C64CCCA5D808AC705A5 + 32: DB9C895FF4A59D407344B8254FCD416F0D5EDB2ECB639CF226DEAA76370FB79D, CFE8C49CF0E323F694FAB1805A85DC93 OCB-twofish (16 byte key) - 0: , 594164A8DAEA1C847BCD04E06EB69AA1 - 1: 82, D86AD044B55DC09DC6302700B728C9F2 - 2: CAC8, 910C748DABA8A3CEE24C888295E15BF7 - 3: AA0A64, CDF692384CB4A1F2B9355F7DA2CF6D82 - 4: 8558D35A, 4F542602753901709C33D1B3FDFBDBFD - 5: E3AE8A5EDE, 8196572296F1D18D5AAAE6EB7B3DE383 - 6: E602A86B84F4, 2F6FE22A3A5506BA8FABA92CF153B53D - 7: D9FDAC7CFC1C7F, 735A47BA7F9F8242AF59B65555A89D8E - 8: D1ECDD40593FC01A, E98A3D894F217A645C5576EABBD0DEAE - 9: 0A085D49B094924621, B50611A43EEBA79B129A4A7CDE1D6933 - 10: D28C9B15530A73167396, AE4BDA212228FF92044359A8BD49FDCF - 11: 4ACC04003B2DB52BF6AC9E, 14436E44AEAD95DB04151409AE0554E9 - 12: DF4A0500653E45E0C9B0955B, 5D1F14392C117752D25C608B88D27FE4 - 13: 779E1F3875A3DD5957585119CE, 09CA0CE358A026F4A0587AACA17D6483 - 14: CFFC6F342044C9FE27A77DE2F08C, 86E1A306D08BF4DBF1E9C0B8109F542F - 15: F512032FCE7598AF164F8BDC979F4C, D9923D9B1434A1C7E8A705B28EFFFF44 - 16: 8F81FCF56B506E0848C49D252053F86B, 1DF7C9EE369191347758689A06E725F7 - 17: BFF875AE91FD5334B7BF7C0A589F86A27C, DF7FE649DFE3101D3EF0FA54D89D33FE - 18: 4659BEA017C75E61588021CF8937D7C2C6A5, CFCD5D0F8122361909138E92B6C03134 - 19: 9484B68F9F02BEF42A8E861435026112C5CFF0, 3FC907A83E8DA1AF5FFCB2691FADAEB1 - 20: E13ABD911540BABA4F7F86A40DACD095C0DA2A3B, 2553A726A8E320D4A42B670933304075 - 21: 2F412FC9B166B8F4069245324946E9D2C70BC893DD, 2E434FE6C1C71F390BA463263EB49EB3 - 22: 1B4FC8CFC047959880F22A36ABB1E825260EDFEBE84D, 455666419750CF6012659EB68EA93706 - 23: 86DE014441AE5E868C335AC480A227507304F416AA1DB0, 4861EB2C1860B5FE68FD844C93F957D7 - 24: 98DB0F92C96A6A4A76FD8388852E30EE9D4B397DD36DCA23, A6A5136EF28DD468B8C9BA27D0423E08 - 25: 012701CDF2BC3F72A6DDBFA8ABE102D44531AB30693F3C92D9, 7A0AF791A2AA53FFA3C17867B9B39FB9 - 26: 3B6A8D60F5A580EC5676D3F656E98BFDF4A3F1C38F63B51A0A0B, 74CF48B317AB5966856CD1F84C1C53A5 - 27: B5DA5A540BD8C1FE05DF994A780E8FC54D0C84F9979515E4EF60B6, C1CB0C8D114C218D4C7650BB9F2F9732 - 28: AFD1259572B60A5ED77B8CDF9E8C31CFDA25FFAD45A6CDD614F83500, BF4F4E01D34B69F7460361C0B653137A - 29: 1CDF78F6CF70428A19C87EFC9F2A861AB35CB03638003F701C57F5A108, B005D9CB01E35A08329ED34EEDB51C2B - 30: 97A60FD030DCFB8E8DA4FAC24682C8A7901168504E6D494431EDC44BD2EB, 9958A0B0908DD27D3377268EDDFF8196 - 31: AD36ED716E5C956BC6766EA376E18EC1456258DF590E3425235493ECBAE133, F31D35D8D6E24C90E47C12E35F300826 - 32: EFABA1D19F94A4C288E3EF8353A919F06EC1AFD2ED802C82BA6806F26B93B581, D599015BC0A240AB62E85D3284E111BC + 0: , 924B3293251DA82CC6843F4616DAA68D + 1: 01, 4B07AF17FF5D6C2477E90B7843F19D1B + 2: 5CFF, 75BF06BF38FA2BEC8A3A546B9E29741E + 3: B31197, 0923C75169AAFCA604EDEFB93E7C5D83 + 4: 8AF83046, 29C744B4A6A1DB80CF625B490FD25A60 + 5: 0D0AF40357, 477754E1995FC70B3D4D7E6D6DDDA77F + 6: 9E6765559AED, 389733D5DCAD65971EDB674B2479F13E + 7: 113AD2738DB565, 366AE5F327EE4BDF2CA04A3B82FA3A3F + 8: F2235181D51EB014, 3418DCFFEB24E4D94DC72F7F3876A978 + 9: 303087A4458E3063AE, F3E6B83CAA0A07261BA9D384087D6D5A + 10: 98FF08F0E42331B68492, E532298F60E06BB72C57596957400E16 + 11: CD40F0F4D8000E5096262D, 8AF824C0EC17FF0F88371BF3E05AF7BD + 12: A7EE8BD81168FBDC359375E9, E20FD7E1914136C94223F6DF67386099 + 13: 8BFD44C8A327E7835A9D43A52B, 7AF41E1B25A7BF4D1F5868F0E047E2DF + 14: 8DAF93847C1B3D8220B7748A9823, 9787A3B32FD7EE08835DD7A9277F5A4F + 15: C602FD9F13259C4D3E3700F89CDDBF, 5711A41B4666248FC3FAE3FE8FB9E861 + 16: 972734035B0C78BF774279BA3DB7CB0A, 23E96A558B3A64D95FE1669923E10CC5 + 17: 9D8B4DD8259B51DAC20C4C64693E20AEC0, 66E07F2BF239C0541DF19254F53820CC + 18: 4F76EDFD8C101BF1A20B9D337724BE0019A7, E046081F3CBD112CFAD56D9A32FDC6F1 + 19: 59B667CDFCCC1634C9891DD0D3809A682EDA2C, A0F8E38B41BD82E8010F917F4629184B + 20: 0DBF3DD74E0D165C095468824E431B8B5650EB5F, DB7B71633206184ECD6157060DB2E443 + 21: F5A457AA7ED8C131ABE99EC2C1008DA022D27908F0, 794C3E20F41E7D32B70BF043DBD0D86E + 22: ACABF3932E154342873B1EB770A3E5E31C629090EE8B, 4D998537CAFD3453A5D748EF09C81B69 + 23: 850CA96B3B1287A8726E2B11B7B17EE321CF7D65481F73, D78C52190C81FCCAD299DDBCA72D95BF + 24: 5060CD915C916D082579B571FCF340E82224A9704398E033, 30EE449934C54F531D2702F8F1B9F510 + 25: 0C47F5CAA3F2E8ED47F016918B634474B004B357A35337F14B, 9D749132486F07B06D25428B592CD767 + 26: F01B95D67392793ED557D2C7289CF899C053ECC5E8BD28BA662B, 3760662B33EAFF659DEDD2AD6E7B32A5 + 27: BF8B0FB0B069978F0EEE2120F61B6437969C0BDBA700AE279B3239, EF2A1D664F26DAB4F9E8142730C2942F + 28: 64E68C83E76FECF44BE02B2E44F182C1F6A08B8DAF396BFA3B395A18, 55AEE32957B9B15AD35F172849308919 + 29: B594643A43A91DD34A75D30B259EEAFB75145C91D8A862F2526CF47A35, 0E60E4118213E89C28BB71A8003A94FC + 30: 5D2E20D31A1F6C48EBF52B63FAE1CC09C85F2307E509CBDD4E8771B65787, 11D347399697D4955028F7B08EE32B93 + 31: 8726247FAEB21D7F8927DC3E90267ECD744A8452C64B9EBE08D1A590BFA1F9, 8D75DAEC7E4438E7C701A392346EBBF6 + 32: 0DC0EE528456FEC203AFB12A55A4D3A901B9408958E5387EB42E75730D98B6A6, D7D682F57C1E1671BE459EE33BEA6B26 OCB-safer-k64 (8 byte key) - 0: , ADC114C0D077300D - 1: A9, F24A07BC00CAAA0C - 2: 75A7, DAD101DA4CB6D700 - 3: 0EFFA0, 9A098D97F685CE48 - 4: 16438C72, 739EE029D575F395 - 5: 303FABFBF8, 00C4C2494022E52C - 6: B1209255BE6C, D068FBF0EA49BAEB - 7: F784608D57ED05, F3395D67FFDAD746 - 8: 7AF185590214412E, DC524433F8A75A16 - 9: 44FE566F96CF0B8A37, 71846BF7025901E7 - 10: 1618A09FAC353DDB5685, BBDA87FF67B5DF14 - 11: 7F1907238DFBD66679FC63, 48F1009DD129B0B7 - 12: 40B3AD0A9C2B65670C0FD968, BA95C8A250D6EC75 - 13: A64662338728218AE4A9D387D9, DF0079004B48083E - 14: CBDCDB3E912682AD5990ECCA0453, 102A70C169347128 - 15: 3A924FAFAAE941784360E30D0757AC, 16B8BED72BEC1950 - 16: FB1E63659F958EA320BD015599A3551F, 5AFE10D792095AFD + 0: , 60AE63AE99A88F09 + 1: 44, 0B3706AE0C2E2E1B + 2: FFC9, 2DE3EFEA9DA4E0B1 + 3: 9EDB9C, 3C6B708DDFAE78BD + 4: 4F411B9D, 7B5C8D7355207D99 + 5: 137EFBA977, 8F5A27A51F6360E4 + 6: 518F478CF00F, 5D9D0B18CF5A3441 + 7: 8ABF02E8C3B6E3, 2A9F38EC4EEE4B66 + 8: B46D658ED0580427, 154E306DA82C5B04 + 9: 97C857F1454868744F, 235006CFBF3746DC + 10: 75D9C1CED5E4A9D74B83, AD470CD821D5A3BB + 11: 8BD62F6A7984C86BBC5BC1, 44BFE38FC9B0E173 + 12: 3A7C8ECD7732D6546CCBC28F, 5ED6C3E7AFB1F896 + 13: 52C030D775D19B605CDFA5ADE4, 010FFFDAFF4868BF + 14: 6740280BFAD4A8844626BCCE6FB2, 80A60FD0D0A15DA7 + 15: F5B6DD3ED6612F59B8A073E3EC5033, 36F2EC985AB2C969 + 16: 02581A19286680A999FB9830DCB77BEC, 3015B26725FB9D53 OCB-safer-sk64 (8 byte key) - 0: , 52BD1FFF50351BCE - 1: F7, 4274F3D1A0CF5BA1 - 2: 28B3, 4BD97A9EBA18E5FA - 3: 1EA215, B6D28CD00E7B1098 - 4: 93129898, 7A9F3FF172C91AE5 - 5: 36BC2888B7, E6A37037F50199F7 - 6: 1A24F1C9D32D, 3A0472F6372EDDE9 - 7: 1A799D9CE0C2CD, E3BFF559234C265D - 8: 1C43DDAA18FC9A97, 851499FD6C0313C5 - 9: 08AD38225230BDE500, 5B9558370016257E - 10: 3E00DA672753F931226B, 47901E285CA2AD82 - 11: 892F0D4C2302EDEC2C3587, 1D4C71FB290104E9 - 12: 124E7EBE7D643EB6B2426644, 0DA9ECE397151EFB - 13: AB1BFEA636E3E4189677433CAF, FEF2E8389207857D - 14: 79A206C4B23DBBD7422432A32093, 04FE9BD236AAAEB2 - 15: D8997D69B89058F0AE974A241DB76F, F395D15E6F18E555 - 16: CE7B2A79A46AB5F0FC5B55A0F751245F, D6E1523F75489CC9 + 0: , 2B5F164039EC1FF2 + 1: BD, 3072BD9737BB4DEC + 2: 71F3, C358816473A2C3F0 + 3: F370EA, 83F377FF988F1B51 + 4: 98565D32, FCA53CD3A9DABBCD + 5: EAB324F774, 421AF23FCAD01DCE + 6: C5B0814A9FEB, 9313C6B3088C3924 + 7: B2BE28DB8A7CE4, 4D01C1E7AA97B299 + 8: E410D82D4064AED0, 9BE40E1610857C31 + 9: 020B907AF549B78C87, 041F712E41020281 + 10: 340281F8C266EA8C7A32, 6ABE5616D2FA74EC + 11: BDC98894B81C6D27E1B68A, 0C04AC90EA1A9CA5 + 12: 8499598100F79CCB99658CC9, 80BF184C2A145C77 + 13: 225E9058E1E04C0094A7930951, DFF29FC9970FBE6E + 14: 2921DB3AA293E8EBCD1624227B63, 66C946BB38353006 + 15: 666A373BB8D5E705B7C6FB57366FFA, 9107520B8B727240 + 16: 99A7DEA8DB637CD1C92C814D3C1A64A2, 88086A2AB997BBDD OCB-safer-k128 (16 byte key) - 0: , 233F1509E202E728 - 1: E5, 47D8BEBAF965745E - 2: 754D, 290AF209DF1FAACB - 3: 76EE38, 2B2077CD08A9F56A - 4: 54B277EF, 8498AE1104DB117F - 5: 549B360B06, 8B6B990840CFD666 - 6: 4687E79DAD45, A72CC518980419E2 - 7: 00A89236339443, 1BD4A6F472218B05 - 8: 2898F27243B4DC08, B0CF6DE09DF4F6EB - 9: C0FD319C9AD18A842F, AD6526380D323480 - 10: BC924B95E3CA0EF2EF51, 262F667D40D4EDE5 - 11: 0255999B9317DE741F3C73, C148B4E3C0D7D6E3 - 12: F4DAAE53F04D5E977CD98015, BB254770D37F80CB - 13: ADE0774EE8F303A96FA110DE09, 9547EEFE854DD99C - 14: 0824C8FF6D62C849A8EAEFD06B4C, 613B264BDCD0DF4D - 15: 6C69F69F3F4A28798E141003E7A9DD, 1BBB5B912118AE95 - 16: 4727E3139B38396F294CC2D532BE5FA5, CE8039B0BF3D7247 + 0: , 40A7E9B40AAC05E1 + 1: B1, C22564913F5A2BAD + 2: 95A1, FFA940A16367A92B + 3: 9B2C72, 13AA7AC4A229C17F + 4: 1F986AFF, 38FA204AD590363C + 5: 6D8575E1E4, 29C7A65AC4CB96E1 + 6: B66053304FBA, 90FDB74422EF97D2 + 7: 3AF64A001B7F6C, 00BE93CEA7F27105 + 8: 838E09F49FA3AC15, 74621705326B0B30 + 9: BAB2B85FAC5DC83489, 8AB828D9D6C23621 + 10: 3AEF47ED7CCDE4D085D6, 1DAE20BED85FC6EB + 11: 16B8926C2F2B591C16671E, 9059D39D4896E541 + 12: B7F7F74BC766AEC2C927E8D9, DD8CD0D361E458B1 + 13: DFC4F2CCCECE6C37BCDDDAB3E8, F43757F2561806A2 + 14: 981C89C0D2BC84D757733661FEBE, 2E6739D64A66F8A4 + 15: 71CAE38513289770E2144C85F86ECC, 7E6B772ACADBB5E5 + 16: C762E3C8CA8934312AD0FFA260AA21F3, 147F6D215719D80B OCB-safer-sk128 (16 byte key) - 0: , 6B06914D0E070584 - 1: 33, 6E16F49996CED793 - 2: 2C9D, 9001E62BEB613A8F - 3: BA9381, 791EE199D5BFD651 - 4: F7A81D0C, D128ACC4FAB2941E - 5: 66D1DC880E, 08D3EB7D405F26E0 - 6: 90F8FCEC0067, 23CD39807B169E1F - 7: 7D559F904AC0E3, A9C685E5657F4A34 - 8: F317A68CAE96032A, 9654658AF84528E0 - 9: 3FC34820F421D931B9, B480CAE6B6D61FFF - 10: 173ADC60BCCBCFB18966, 1392B2FBB86EA6EE - 11: E1EDC19C2E4AE5A20668EC, 17A2A7FB18440B50 - 12: 0F346BDD0C5F1685B281493C, 8169618CFBBC84A6 - 13: 74597EA4DB09F6A38565316AA0, 192F1B3F863B20BD - 14: E5470A157BB18E7456A79C5E40AC, F49954A039514F1E - 15: F055944B9C518AE9D44AB407C32F35, 0A45830C1175B3A0 - 16: DADA8AEBF57928C9D13EABC840B335A4, 67AE540EAC0129DA + 0: , DBC0A566E43D78EB + 1: 7B, 0A5B7E6504D09E0D + 2: 93C6, F0965D809512F60C + 3: 371A02, 26C1101DFBD5B5B5 + 4: 9289CC21, 1DD5B6E7B434D085 + 5: 462F4E430E, 359A72726D607F77 + 6: 754822D87238, D2C3C36B578EDD54 + 7: ECD5B066CA1099, 43501B21F2F3B81A + 8: 0B5E88DFE1EA77AE, 02AB5CE6F21ACD13 + 9: 37B1F29B385FBC7719, C5C3276464EE75F2 + 10: 3DFDF3F96F069D16D073, 1B3815F5E66D9B16 + 11: D71B6574B09AF3E2892702, F23983243BA05358 + 12: 3FDF716461B02B1A800FBDAC, 76DC47B577DB0428 + 13: 2A401964D55907EC06AA5A865F, 48D2A85A1394C9D7 + 14: B92B44D7D203675484CBA922C7A5, 03CEC9B3F03FF6F6 + 15: CBE7F6D81C4FF6E0E7DDCFE4DC9865, 7DFE226E27765F3D + 16: 54D4EC026089660D0A5DCBA3C6096F27, 07E13D50E610167E OCB-rc2 (8 byte key) - 0: , CB28E7BD706EFF65 - 1: C8, 7E3F5A176F71601E - 2: B632, C91680B7A52A3DFC - 3: 41435E, A97F1A5EDA202127 - 4: 81BC4015, CDE53BAE0F178F51 - 5: 97628A29F6, 5CFD18FF1112E76F - 6: 6218ED3F0875, 10F80C337AC529B0 - 7: 797E08DE799E97, A3E5BB262953E00F - 8: 5ECFED1D31A7207E, 559893E2748E3982 - 9: 91BB1BDF184D3733E7, 9EC128ADD1B550DD - 10: B31DC920C7EEE1F29E72, F37AE3B755C95181 - 11: 9061478D7846AE093557D6, 9515937DAD0C3859 - 12: 56918DD08F7D60502FDD9CB5, 24B6903992B8107A - 13: 3F1D1C1F745EAB05459B2DB86E, B4475B5A5ACB91E5 - 14: E00B385EC963602982A0BBDC3182, CA06E1DD1CB9637C - 15: 40BB2FBC9DD133E3958D5073DF9FF9, 2E5ECB03309630F4 - 16: 0AEE1927D6439C8BFCE6984DEEF2E6E9, 398561F898EE36E5 + 0: , 64AF97108168F222 + 1: 7A, 8D76828ABA00E9F2 + 2: 92B4, 46173CDD4000CF80 + 3: BDA76B, 418CBA55192C3C14 + 4: 39770C9B, ADDB0A3DE174E8BF + 5: 7DA3100250, 55CF46A530E296CC + 6: 1B685D542DAC, 414D5D3AA58B2D9F + 7: 6A1172A01FAE68, 707C8FFDC3A28162 + 8: 3643C5C11A14FA6C, 4340696B5CE9A559 + 9: DBABB16A1D908AB735, 7307611EC44A8CE2 + 10: DA209E874A3D0962826D, AA3119B1745C547A + 11: 2F4543B7EF467676601565, 3153CD137ECC8642 + 12: F7F776D30C833802C3B03EE9, B35BCE4DE7356F87 + 13: A19B3618727C8AD0071AA068BF, 137CAB9A02D34F23 + 14: B6B06B70CF74EE900BC8237D6C88, 8393EC248840E83E + 15: FF7316B644450C96A7FA19912282AE, 08231DF3DCAFB00A + 16: 018FBDF023323BBA7BECF9BCEC49C645, 3CBFF9B5F03F97F7 OCB-des (8 byte key) - 0: , E5E4D924A3DDA7CE - 1: BA, 2AEDAEF9CA1A9C7B - 2: 0F37, A8FF952EBCB5C27C - 3: 2AAC55, 9D7CD4AEEDAEFBC3 - 4: 9D1A16A0, 5064135780E6BFC9 - 5: E1B26204F1, 1F1D5449C214F528 - 6: 6A0D8B244E3E, 78DAD555E2977E74 - 7: 08CAA94D23DE55, A1A1B7972E3B5413 - 8: C1EAB716F806D038, 906CD254EAD1F9D2 - 9: F4E8F83B0B48250236, 12D96AD38BF22277 - 10: 4FACF4CA8F9D9C1CB61D, 6448284C9D8A6B38 - 11: 8AAD13A87B869AF1FD5CBB, 5C44F3C0642313B4 - 12: E50E78A36CF3AAD27A962F82, B796C10A692F72E4 - 13: CBB785CDA5263F8B45915942FA, D7D18C57408D00C8 - 14: 39EDAA0F16DF4BE3E1F4CC9B93F5, 5A78D4D529E658A2 - 15: 1D8B9D2A0779F31AF61A172E563E21, DD9D78D160903970 - 16: 4F5AFE126EA161ED8EDFA6AD9640B9DC, BE20EEFB088C1BC2 + 0: , ED4327DD4269EFF8 + 1: 9E, CF026B3E06459E45 + 2: 6695, EC7373BD53E08021 + 3: 2B162F, 2009ECBCCED951CC + 4: 6D2383BA, AB01479F7CA86837 + 5: EF7AF7B925, 6C499BB9C50F2867 + 6: 9A209AEEF740, ECD38B6E578E5BB6 + 7: 64A6847FBAB815, 04CCA3BD0B5A0E86 + 8: EF6E5AB10AFF4637, 6BA435083EB73B42 + 9: 9DF882164AC1093A6A, 6F675349AD4A5F0A + 10: 2A387714DF49F0B198CE, BF11D193B33332CF + 11: A22B9ACF695E509D7DACE0, 30AD5F8E9BEBAECD + 12: 6FE138F1AD18AD82566FA62D, DDE29234BADCB116 + 13: 5E999D45A65F1E7B8D6E23928A, B42126323E230103 + 14: 450ADBB95F5D30C4ED07EF5D61C6, C9AEF234D2A62D84 + 15: DA6EA48D2FD0CD148AF3C820B35D8F, 17EE5C13C4EF2230 + 16: 929440B304802E9963E645962D03311E, 3F70A65858B4CFFD OCB-3des (24 byte key) - 0: , 30D1F1D526BCDE16 - 1: CA, 737A0D73F465DEC6 - 2: CB98, 3F772C5AC706F24F - 3: 0C764C, BC80B99A6ED9FBF5 - 4: 01525168, 6DE48387E0F56E2F - 5: D7463F67FA, 90018E688367A3E7 - 6: BF3DD0750CFE, 6E1965C24DA3E913 - 7: 8EFCACB99A8D0A, 0727B907696F8FAD - 8: F8E92EF758BA48CB, F863DC4B8E73339C - 9: 5E9DA0FBDDCD0DD3EF, BE6482A44DC7E537 - 10: 5A5466EA4BB3CAE7B020, FBED57DA0D91AF2F - 11: 78F1B76EDAE923B875E1A0, B6C4FEB194193A65 - 12: 5CA677153C30E14C457807BA, 7F0FCE7505AF14D4 - 13: E748CE1E7F9FFAB9C9983D16E2, 01D3ABECE0DEA2A2 - 14: CAD89FC73FE93E17D2AB4D8B36E8, D682B9F5F39513C0 - 15: D3B5BDDE86E988628357B3EC622357, 12180A98DBEA8D4B - 16: C9962CDA2141ECF9F8E5178307E526F7, 105CF6D040987D93 + 0: , AADB051E60C3120E + 1: 01, 20A7FE8C75FB9E6B + 2: 1F2C, C1E73FE3B49807B3 + 3: 18BA50, DD5049D65C6E3E41 + 4: 831F26C5, 29A93FC7BB7028E4 + 5: 0F2687749A, 5A17CDD57275D990 + 6: E859252FE864, B546B6CE8058E9C4 + 7: 45664737F4B25F, 9114205390E66F64 + 8: D05C5A3578EFCAAC, 7633784CDB458899 + 9: E4C51E2E306B4304DD, B13F8620AFB606B4 + 10: 69A5B1ED52EE639927BE, 01DF9CA135E1F0F8 + 11: 470473A317D7F261425751, 201A0B1E678D47F9 + 12: 835834F8FC21B8CB27D2E0B1, A48CD87F705E1816 + 13: 8CC41824101B5F330CE1109AE5, E68F62A44E2E15C8 + 14: 9EDE893B691E3E5A0322B8DABC7E, FB5997E400EEABDC + 15: 7E71195F9CD039D025A8A4F90E718F, 2B68E17F3B544A09 + 16: 1D217BA1D0F2FA051258E65E4FC7D60B, 089A17777546EA21 OCB-cast5 (8 byte key) - 0: , 53EB91E57923FE43 - 1: 53, AC15D2C444C5E407 - 2: F3B4, 448E3405E97FF5F4 - 3: EA2BF7, 23A7798222027AFC - 4: 2EE3166D, 0BA3E584C8B6C7C7 - 5: 3A8EFA1923, 088B5F14925C1054 - 6: D4C03D32CCBA, 7A19BF98BBE14AF3 - 7: A2CD3D4233DAB8, C44AEB4C39572364 - 8: A0EB1F16AA4E2F82, FB7CC3CB4EC595C0 - 9: DD3A71458B8DAD91CE, 1565FF64BCC0094B - 10: 399948E91E4EE7D2E0CC, 03BA85E452E52DE8 - 11: 8B589B04321BC35F591499, 14E0DBB700E7BE85 - 12: D2C1A33EBE900EFB656797C8, 13498FF76B676EED - 13: 534C1BA008EC89D2AF43B21725, EEE64FC92802CCEF - 14: 5368EB18C2157B667D098B8580BE, AF8BCAAC5AFDB0B8 - 15: 6BD7F55DE1A4718A6B3B6EA4D43031, 1C6BEAC4FE0D480E - 16: FA1E5410E622051400CAD151211916A7, 3EC52677421255D2 + 0: , 77D9102CCB59F03F + 1: 65, DFB130E2B4B8CDCD + 2: 752F, 3C025A7E3B0C0677 + 3: A32F20, 9877D937F0078B1D + 4: 2721E6C8, 0F40ED1C23EFC71C + 5: 95C4269DCF, D2E25B933FE78F63 + 6: 8CB240723A3A, A6704E1218CA3CB6 + 7: CD2CA6456A5416, 99EA298978513F00 + 8: 95094FD229EB9EFB, 055771E04E1FE0B1 + 9: 052F37165BB7B31071, 00DA99C81DF5A15A + 10: 31B4551AD67991DAB505, B61C6F06889500A9 + 11: 1F9E4C34E96D8BCCD9AF55, 9D7A3D3C78D456A0 + 12: 856E2E4CD20DD9BE45E0CDED, 6FF332546BF351D8 + 13: 65C3B9E6ABEA205C75A43F2D18, B877EBC583A65589 + 14: E41F26A7F537A32B15DC6115E973, 4CF3710865E33BA6 + 15: 0AD880644E5BC87CB4D702F0074085, 60567AFD8C6D52BB + 16: 03C0CB1D2854BC9F286422E8BBFE4A36, EB10E5429866623E OCB-noekeon (16 byte key) - 0: , 7F0EEED1FD7FFECEE2CAC95477884E58 - 1: 74, 97B25EB4C8A4A01BD8F4F4CA2AC26B13 - 2: 20FF, B6D315A991297456529355CBAB74B231 - 3: 8FD23D, 6DEC092FBEA42213EE4B795E52A91484 - 4: 868F9D8B, 7A4E1EFD87F0A4D82571E025DC8976DA - 5: EF59D700F0, A7D7A4CA5AEAA4F193C4CC7A6A311C86 - 6: BCD16ED4DE78, 8C661423A4EBE84AA863BC62894D2FDE - 7: D1996ECF096D77, C99D7F79307F08986E151F44A9B3409E - 8: 88BADF7ED86D024C, A39E95FDE8C15D3F0B4D439A3E9512CA - 9: 2DB1F66EC64B3A3309, B85B0530B581FF599F04E285B0DBD562 - 10: 6627C3586AB1A43777AA, DCD0B6E4749D0D983B777947B2E7DF94 - 11: D47B10151EA15496D68D0A, 5462DBDB94D194DB01D03CB5719799C4 - 12: D997EF4B4782C959D7FEF298, 00E39632CE89CBF5892D8A55BABD66CD - 13: C3684D24C78AF4542E088949D3, 302FD96F20FA01F841DF8E3FF634EA65 - 14: C0FF61350FFC8FA4CEA857E69770, 1EA083FEEA89B019044A56176D47A209 - 15: 35896DB08FA2B837AE7F73F563F1A5, 5A1DCAA52F051A78552AE4BECDEB5EBD - 16: C44C28E2EF2B145B57030B5D403300AD, 615F4D3C2342397C323D91BFB6F35537 - 17: 925BFCFD598EE2167823204E531C09D744, 769A60612D34E0D76C65812E437B366B - 18: 56FF27AF89F9A438EDA0F00D83C864A58C90, 4122513495F866E7A154FFBB49ADE999 - 19: BB9C0633EB07E5053E3BD64B7ADC2D15C497B9, 42074FDF7C3D5919769C3168FC0DA9B7 - 20: E77E666D6B6C206274E8AA6BC21E615399B10B60, 15DE064D9EF7F61518FBC130AFD27633 - 21: 26835663DB363A54E5B5DF6C080579E007A3936979, F4D635FE378D957143EF215FEFF1964F - 22: 20F33C26AA97C924FAA320D147703A2E44A0CD2DE9D0, 8BF2C8D6A46F938146FD964C272315C4 - 23: ED3EB5440B984DD5DD81136AA7BFF25A51329EEF01FE59, 7A07644AFD20B4AEE7612A8B365CBBFF - 24: 51086917EFC1EAF5DF11811573ACB5977FCF090E2A287223, EAC6812D7218A315D6859BB7A71899B9 - 25: ABFB3BA3588D0B04ECFAC7A43B8801C5C309AEE607E5EDBE24, AFCC1659F0D6CA1B9FA37ADC5B13E6C3 - 26: 77381C4A7E18FF7FD5F3ED5710B924C7935A9CDC0B8EA761FD68, CBC15B38DCB4549514F49650EA47E4F4 - 27: 91AD26366BDC121CC316BCFF1C73B97D73F4D267F1501967C9724C, 9D4A729FB78ED0A38E741FC380D62323 - 28: E3B7762DEECAA467384D25304A8C20887C3424230D84DA976F6C3316, CC2C5112C9208CFE165DB913FCB8A331 - 29: 7AE2A23472737F9587065CC5254DD64074C6C8D64E7E6198927FA30788, 9F4542664F18DBD85286D59EE8E33D7F - 30: 67AFAD81B4283C81131D0C7E411872D937A6D657D780FA23D62624B62154, 6B2DBA7CDC032A51D9FBAE63EACA43B7 - 31: 1424442606ECB6ABCA1CDA3CF492357AB7EB828537A9B8E1057644663CBB03, 4B4A8B2C2BEEE927161080570B7E7A8E - 32: A26EA76C18D7145F8569335458BA0919A7E70BB9EBF328D2C22D07B2CFA6B38E, 0AA05190DA1D44EADC609CED2368737A + 0: , B23A40302652E204B694EA78AF5A8FCC + 1: B1, 5245C8680A6F4520168B173A39661249 + 2: CE8C, 05763A489DF8B88DF01862007B2D6655 + 3: CB7D55, E14463F2230FD60AC779B5608F708A13 + 4: B4E9D036, 78A9A918D7CC6E742F22BBAB7781CC7F + 5: 0CB35CAD63, 1A010E65263EDB85039E81B8BF88B978 + 6: 7094335707F5, 8EC8C49EFBB77AEF2B443855760CF5D2 + 7: 734E7D94C8BD6C, 5E701C5886A72499A79B3DB6A6F865A7 + 8: 5375C12BD7B724F8, 3C12E52B9E0DB5967AA09C84DC4D48BA + 9: AE56D9F446D45EF168, 297EED4ED9671F7D9E6433E189C754AB + 10: 203F357C80E760BB0D47, AEB8CCB8AA3D0752266E9BFF4B501832 + 11: 12A9F075BF911C0691338A, 317824AEDC90F284C3702A651BA50488 + 12: A4F167C8D051DC582892E5B0, CCB64B2CD8CB62212003A4E0A4065B23 + 13: 42B2F2B5E43D407E2E2E047957, B81F80502CEE49C84BCE21A942BD6206 + 14: BA5562041E71339AA676E1BFBE07, 7C0920E33B1AD9257FC6FF8732EE4BBA + 15: 1D1DE906DDBB4C3FB367DD7FB59622, 10D4E97FF5495A4250B60A1238D21B3D + 16: A06A25AFEC795738D0ED17542EF1E691, 1D31E82501E1779FC62E8A2847D89631 + 17: F7BAFF86763A1BE37F6ABCAEB2E8A64411, 4F3E5E7009B8A09CE47ED7E67D9B6B0C + 18: 15A97D2BEA9DA105282144776C710A047F1C, 79406BCFE7C9E8283AA851ACE9D40AB6 + 19: 80FD02BBAD283477394A3DF93FD6323AB2718C, 30FB621D3A41DD01BF8F4E7EFFE93C22 + 20: E091A9D6C14A60627FF6BDC59DFE85E9528AF3A6, E8D5A085BC63B7AA48761FE4431A7966 + 21: 76FC712E7BE90A93015045E96DC102FFC2DAF113AD, D563F913F2A90D653C0764F276F8D0D8 + 22: D4A6E1FD6DC7504CE40F4A1A7B9342ECCC03CD3788F6, E6C45E97B3B2E00C2DD0C639EC056485 + 23: 7DB75AADBA75F026F430C7B9A59E4E0F228770990512B1, 09BAFFCA7F69156C6ABD5FA7A8F1F39C + 24: 18AF0400D1FCC74AFFD5D2FE4F8224A29BD17DB2294F89DC, BAB2E20E100E6292658A7BBE67F96E13 + 25: DE47E5BD43101F0688D7149811511E549C8846AB71B35A12F8, AFD0DF5FAF7821759DE3AD928B239570 + 26: 1826EEBA81A57174214F9953BA88F4324456127D7F7ADDCA8036, A03FF1F7B71611D8E9B41DA61E191A90 + 27: 73D79CFEC44F7274720BC73B7F2422BDB79A9DE6245B08B006F654, 00F66AADBB4110E77A7A788A1B0CB4B2 + 28: BA5F0C34A1DF413378C6F49E09BEDE1ED757935934C1FDCD978C2B3D, AC286CAE6E7C3DC2CEE3B6019F5A1662 + 29: 231AB287C2156BD0E590632E057D7EE92B6DD7976AFB75540FB04FC84C, 12420BEED7F377C4792A0940EA91C34D + 30: 7B06F611F07763C65EA542EAF679DDBCADDA4B61238F489331184FAF764D, 56FCBC05F1E3B57286B1AE881FF04BF4 + 31: 17C5B1127E3D08737590EFB2FEB17562E7FDB4B21A768595ADDD9697CF9B46, 6F4BC0A033BE040350FF4958866BDEA0 + 32: 4667525E9B39821CF08E6C7A7E37A5020CE23F81DEF05932113E9A6B5B3F9BCF, 5C0350C6F7299192947EB22ED415B05C OCB-skipjack (10 byte key) - 0: , 509609FAF6B2A760 - 1: 1C, D19D4AD11B65B435 - 2: 328A, 252CB779130397D6 - 3: 6DA4D8, D67C555D873050DB - 4: 31D7BF8B, C92EF449E99E4689 - 5: AE263BC571, 4D840A59C00B4462 - 6: D3BFDC4AB208, A28415ACC9B0110A - 7: A5B72B226A5DDD, B414058C98FD853B - 8: CAA29B280DDD3C15, 4D26BF4D0C89E38E - 9: 5254ABED0835B8EB8D, 606061B9A2E80198 - 10: 2EF661B59DD3F2EF31EF, 9185BD6F1AB894B1 - 11: 65124843D1E57AF3F68BD8, 8B3D629B42A7083E - 12: EEB3427A492FEA461196E2FD, 5B02BB30264C4773 - 13: BDF601AE59455530E8CD5D4733, 42CCC4F51CDD9AD1 - 14: 8563FEEB2847AEA38D940953882C, E233C6110A0E77F8 - 15: 766A8BD4C655ECC0589BD0A3EE65A5, 1374E4A3F96D13F8 - 16: 85BB8A319C9FAC34E3FD694727747DE3, ED65F930AE6DE12A + 0: , 463C1E4DD1A03085 + 1: 44, 754EDDA8D5F6395F + 2: A91F, 19D6B04F49F65FF0 + 3: 8572D7, A97380A827EE921A + 4: 8B6A518C, 28F53D973490974E + 5: AE64F0C5AD, 3A01F1B733C27295 + 6: F9075088FDBC, 25B88A75E41E1181 + 7: 454FA7B9ADBD08, 27EAC47AECF83243 + 8: 658A1888D9405313, BDC5DA72A5B4A18E + 9: 5BBAC180FAA537AF97, 5BEE47690DB770C2 + 10: D5A1526B948F67F282ED, A5CC6F9F770B9B64 + 11: 6A51609E928064B6CC9B63, 9BFD9968FAD94974 + 12: B3C69893E260B791A9C3A843, 78685FFD8835AF00 + 13: CAA5800B6B5C50949F4EB8519B, 39AD309E4BFB47B0 + 14: 2B12D18B98AA3B3084837E2AF840, 920361326313A489 + 15: 0D2F21E3B3DB3D2B31B880459DDF22, 86307ADEB332A89C + 16: CD489F4272596715EC86B770D89BAA7D, 2006F5269A5D1C58 OCB-anubis (16 byte key) - 0: , E8D6A3FB8D3E664DA78571CA8BFCB95B - 1: EA, 03E38265C85DE60108B7098A51B5E341 - 2: 670D, EEC6A709FD9A74551467CE9F330D9032 - 3: 42A726, 1E45B0C7F9B143FE17904412B8F88DA0 - 4: 7AA61A9D, A89163D9B707F3B83082BDCA2CC00712 - 5: C3D7E3EB14, 0DE7F3A68788E854603CEF766A25B63C - 6: A160A9CCE0C9, 6DC1504CD1368E83BDBC113EB95DD895 - 7: 18415CDBFB78CF, EF372363366B5868AC287F1B43CCD739 - 8: E40D6DD638AA2C9C, CB3B89CAA74ADAD76CD6ACC7C2CEF3B1 - 9: 7AEA37ABB7582721D6, E01A28646610DEB22E7539CBB6696BF4 - 10: 03F16C187F6DEB996299, 74F6018D51DE37D77A30021583F07658 - 11: 9E080BBD30A520A3B47AC5, 0457907DA3AD8467B3F0CA41B82E584F - 12: E673042F50FD247F04734C59, C7917428BCC7D932DE373CB03954A7C7 - 13: 0A0F2CFB5D4F3F7EAD1B0E3C57, 2717CAA7A3AEE7873969971F884E70FB - 14: 8DD2128500F515F917862726FCB8, 3313A88FA208776F305F1BB344748E85 - 15: 625D855CFA0097B136B47E41AB21A8, 8B7FB512341B339AAA45F9345B16B66C - 16: 6DC9BF9F13D8ACED3C07DFE183C4C21D, 1E8B9686F5D564448AE06B5C6408D2BF - 17: 6193393E9CE9087EF765574FEFCBD599BA, A2C14ED8BDDFDC988AF9CF2C71CF6277 - 18: 3F06E79CEB0FF301A0C6D8076D4241F549E5, E1838748BF36D2D37D477B89E7327338 - 19: 15963F7AD2C5DA43D46523880E0329F70527ED, 6471F1CFAB79ED06BDCFEBDF0AD3C98B - 20: 3632F3B578836AFC8B9456DEBD853564602AEFD5, 4FE167E3AF7AC854D02758F68DBFFD08 - 21: 576EBD9F85575741C7FB50AB8DC1C9E8762FEAB590, ACB4386F6EA5F1C30C10C1D032A32CF7 - 22: 8DE26C7278A29F8721EBA3B66FC8900242EC213C047E, 46F25D10117CBCDDC5FB2CE2044342E9 - 23: EC5781849EF2B46A02F9624CD225A4FED1E6F876B10437, 014680D2681AA27B55EADF71E198B091 - 24: C7FE74EAC6C697C2878132D127541BC4CCFF6C6EE0AF9926, 9BB9C5AFC2321FE0B771C99B1A4CF273 - 25: 232091C00F1CF16D2A7D05A403412A13A0070491370E86DD53, 5F7AB245670B2D2FF8B70B520ABC4070 - 26: 6D3A0812C0EDF89E4A9EADE407C4E7CBCB068F0BD8463B67B0D9, 96E638BD35F910653098D36EE011A8E1 - 27: BCC775956A49BF8914E37A59D32DB49D334B40133ED0D72692D7D3, 4F9B0FBEEF6DDD17A7D30392E2B14C77 - 28: BFA70C11B18D1E9E74A2C91C967E5F0F9B5A43001ECF7C8F286DFFAE, 0D71543408255921DE67189D999D2A18 - 29: 4FDCE50EF26DCB4106A81554B2F97166C6D9A018E340FDE9E2B7FD350E, 6A73C694FA85CB83272C0EA856B83E0B - 30: D0C9F3D92BADF1A874DD47B1926B509191AF06D720D4C05F4BB6F314D6DC, 2F54556E01233BE6B309FBD11D2B9289 - 31: CB9F54B5936B90530B68A11A50CA4568AC2423A137066AAE38C2C5420DCBAB, 58277F655B1F71939B61E49200E8DC3B - 32: 08015545AC92A9F77C8B1ABB42CF3EF2C48C5A1E40C5F0980684A21D8E03F445, 54FA9E6195A3ECE7AF469FC179C36739 + 0: , BAF3C352341E4E8F5E1FE11C9CB3E151 + 1: 1E, 01BAEEA2431B9106129937F135D46215 + 2: B586, AC89B511AC5F80B2E6F9E6BC96DDCE15 + 3: F28FB1, EFF43DCF8C909D51ABD58CE44461C35F + 4: 2AE6B0DC, 36A21C9193BDB12FCACA73E756C6D75F + 5: 4A37080738, F90B5BBA5A103EAF4ED01FF845F7F6C3 + 6: 369B9FDCA431, 85C530F58C7DB80C6E8B1F3A9A593C69 + 7: DF0388D34583E9, 4EEF27EABC10A78488F82E8105C52C2C + 8: E63011F0E310F68A, 8AC5A7B20B6F4E160EEFA6D16DD868DA + 9: 93FBDAD02B07A03C8D, 2C968FA16435934EB40F27019AE00F87 + 10: 6D91E68224DEAD679298, 2AE270894D8618D4D92485B51B7B5658 + 11: 53B08EE1F8FFF2590B7CF5, FC9A33C9221C06ED7EBB1D3C33BB0FE9 + 12: AFE762CDB97A411E0F6D8422, A9A1028C6055FA627007E65CAFE5618C + 13: 781464F6A0739FB8EFD8C6130F, 1DBCCACDDC218B76FC27F444FC0CCDB8 + 14: 1F9AEFACB5D87693CCBB9D173529, EE13B9890D0E05EAF61E1BBE8B0ED0F9 + 15: 107248D8D565CDBD520E50A139531B, CD7220BB19B95C496FC901C831AB7CAE + 16: 1045F21485E1C4FB812D9428C4D29D7C, 08035EF80327E3D238D98A09E3B48542 + 17: 68E48C74D09B7D07F38BFD1722F6DAF18D, 9D94E4B7CC4F00F1716D830D953E1DC4 + 18: BF9D274E7DD49FA2ACEE1D65DEB0A5A74D2D, BB841A83356BED14D2A06B5D7F5F8556 + 19: 4586B730D46E9BEBE34EB52242DE954CD39B90, 40981229C0DC8D47C69AA261D2BC960A + 20: 11038CE2E4AB2D2F8258D4DEF25F102352468350, 1EC047D2BD87BDDF02068BFD5742688E + 21: 25E4D441758E4953D463D0BB63CAE2B8D5F78B7968, B548855DEC4C11C10F74983D6B426A41 + 22: 1711526E226559666D2439881650AEED6DA12EA01A72, EE6D4D29BDC8EC975ED90340910EF829 + 23: A70447A0317930D20C5EBB0841528802B948DA7E437EED, CCB551453425652D6535DAD0A5890431 + 24: 57D82A93F29B4B2C2CE4D2326D2E224836F0857EC8035972, 87E1F70A7D4140A58851A2C4F0E39F0F + 25: 5F065C6406B07A8CA35AE0F05D0D48C631C6FB3D7655D5F6BE, 2E3EE16DFA370D0F988615CA063DD62F + 26: 3DE835DAF81C17F45DE11431A6F8294FBDFC062F237A7DF30E1E, 401F8841A7D97F84438B905D2C03A416 + 27: ABDF9D5E996364C628D4DCF67ECC870117E8CC5A6C52E4663C26C4, 05996C80448BCB0C4B311E05AD0B4C5E + 28: 1C2401BB1DA2CEBA1BB56C69728FDAEE42FBFA374E57DE1C593494E6, 8491B62BBF372C671C311A97C173BBE3 + 29: E504321BA399FFB6E3187B645635273A92C63D014E337EC266334BEC7C, 026444BAAD6C4EF67C660180CCC6E7B4 + 30: A61D3FCC22988166F57F4585E936CB8CD714713355593780F54EED1681E7, 3507D5E0185318CC4577C5FECB3A348D + 31: 55AFBFA3A57B960AC0F8B3DAE6EA60165FF7D5A77731B05BCB7E8C647487AA, E25444D551A823650757DAAD8ED6B588 + 32: 5553F81F123EC0697C26B00BF20BE287C0A1E9C4035C8EB3036F6D58C8A3B83B, B7349CE03F264F816305A6D46C274980 OCB-khazad (16 byte key) - 0: , 2D528A56D24DA0B1 - 1: DD, 195FF8AA3642FCBF - 2: 8081, F96BF0542DBABB49 - 3: A3BDB4, 53B2301ADA9F2471 - 4: B65B1104, BC470E5528C50AA0 - 5: E3020368BE, 36911628972321F4 - 6: F6D17AFCA3E8, 2BBA5E3BEA80D17F - 7: CBF398ECFCA361, D79987D6D0751DC8 - 8: D625BD23AC106E16, 91CEEEE861A07568 - 9: E28B40E0D810AB8B28, EC2AB51CB46F101C - 10: A831B14C2E0F1C583F5E, 17AB8A4B822A4D9C - 11: 1CA32A525BA0A8A141E852, 7E2A30A9FE7BCA18 - 12: 9B7F20DBEE7E7735FE7BB8A0, E881254902FFB81A - 13: DEA8DB05EEBD550B9A36B5043C, F7DE10A41ED5450E - 14: B6681197883BCC1EF3F880D15CC8, 7CC43F7E2D10C161 - 15: B5F13633767C37E2A5BE44B95AC80D, C66A029513179FAF - 16: BBAB31F93B165465FE5E2133810E46C2, 146A3AA6A6A68E2A + 0: , 5C7E2DC1EDC4A2C3 + 1: A0, 261565EAA758EDE4 + 2: D9A3, DB69625E0A482236 + 3: 24FF77, EEDE8B25C54FD6FC + 4: E50379C7, 593CA74DED369316 + 5: B97E794387, C3B94E37EC8CC73D + 6: 97D5EA990145, 8A4E4D0EF6BD0D11 + 7: C99C82C3DE57A8, 05CFE7406F2CE99F + 8: 234CD0F6D7130A26, DDE441C5490AEB12 + 9: 92D4A7184BA6675978, E1581CE1444BE08E + 10: 8081C79F87CD727AD54F, 9A9A96082EC690FD + 11: E9D3A5084F343F1918B4A3, EFD4542587D3C5DC + 12: 03883C6376ECDF6920A13B10, F516CF01CD535DB6 + 13: 6F0561BDD4344CBD5FC4A97848, 20C8C8F2CFACB2FD + 14: 84471FFB6BBB222902E8AB2C352B, D119D45DBD7B7D22 + 15: AEBC54E4987FA01FA7EE237514D703, 7021FAEFC48DA692 + 16: E907A9DC08A3152106399AA178A2B445, E756B6BBE721A3CC OCB-seed (16 byte key) - 0: , 31FC3BE15BE66DE898D8E64F043EF5F2 - 1: 13, 71D7F7D74329C74E68209EBCEC6ED76B - 2: 65DE, 63484B2DB036CE460F25E5F42FB996D9 - 3: A6F3A8, 779A84F1B325BC7746DD61C982C0C84A - 4: CD93DE8A, 78B2B22BF20F341225D239AD89BC0400 - 5: 39D1DC6410, 6BD9D8849627A1C866C8882686F59F8E - 6: 1A90FE8478E0, D99148D2185D130069D1007F759F1952 - 7: 7B021158285E6F, D64304C2FCB0C4207E1172D9F5EDFA54 - 8: 3938321C337EB440, 7535C124E443A1AAC16FF84A8A2D4E73 - 9: 69D89353ACD77C251A, 8BE9575D98A8F6BBA1BCF49F0D133A57 - 10: 4FA9D0AA53C795D8B4A6, D424622976F53C3F862D9C09780D134B - 11: 10E2F16190079B783912FC, 3354E1E8AC4D661B82C1BE44A094E9C0 - 12: 87769AA867DF8624E1C6CC9C, 537FCA01A65D7783E7DF1D337D6F71E9 - 13: 0547E2F6A8017FF31D24EC9F20, 2ECC8DD05C36CCCB1262FFBE6A810E79 - 14: 6B234F55551F86F2478D6A7E910C, 91863300122086508F0259054125736E - 15: AAF361AFF276F996740A110F1868F8, 9DCF980FB47D0533D168490887E1718F - 16: 114A274873A4E60CD175DCC60823DE3F, 9C5F32D0D32F82FFE776025BACFFBF20 - 17: B13F7DC743D559613F563315D68EE30AF2, 9FDA482FEFFFE96F8F748A7B0DA24D71 - 18: 79A2D1D9667777680DB25BB68105378B7981, CC45BA5C13450BCDEACEDD602729A337 - 19: 683E53C85E7000019CD5B8C78FB66E3D4EE0C9, AA4533EBB37F197D1402143CCB0887F0 - 20: 546D9B5CF8FB4BC20CE200C67ACBEB79530AEEA8, 5E9C1CF09C360A0F0C386BD93A9C91F5 - 21: 8CB773A96DA7E4A83FA214BC94117CE042CC2620DD, 058229EBA77FF300E0448C29D37C839A - 22: B13348E2E498E2A02B08CD94B5A66786334B0A415C4B, C9E19F610CC82B0242E8546272D20E3D - 23: 53BD3612B86412C39B98C322AA0E6352A1A3A66A992EC2, 3880B204A156302679F07932103DD531 - 24: 30E2B86833BE1A5187E65F4EFC24D1F753EA2B5D89C87F06, 99FCBA36AB397837A7F9F53C0EF7DBC6 - 25: 03D03F968292C26A26CA833F5F186ACE9BC5D2B6678C4DC220, 3F34D2FBDFBD688A03C29E49B02DDF04 - 26: D443389FE849AF4A74DBDFA2936C8D7DC0C69721C2B3375DFA24, 10198F7477ECF631207AACEC364638A2 - 27: BAF661D4BA70F9E310CD930F36DE90CCDD9DB3473B8A5747A0B5A8, B080FEBEC0497EB16D978E3B8DFFDB77 - 28: 5FE274B3A042BC903879B600C0DF31EB66A260D8ECAE09E45DFA4650, EB35B008EBB5098CFA03B010E1B4AD4F - 29: B124A2D8B0187DD409C7CAA44764C587052FB9B4750CA0DB0174D120CB, 2C48CC7B2D61D68B311F294AE6D6292B - 30: 8488F0C46151994F7798F70F55C7DA1D242B58CFF49BBFF458D5E574EAD0, 94C2D7BB27BBE184AC75213C1147DA71 - 31: 84050C6EBBD37CFCB7DAAC665A15FE459E420FC32CB7677089B236E6EC06F4, 5AC1CDFB43DC955D727FDED9847D9CCE - 32: 3EF03B96631A35B492DD1DC49D7862AA4D0DBDC9161D46711FA5360C1B4E76C7, 567869D045CF62531A10C6B9C3E4CE29 + 0: , A7D37A371F0B3596ACF3856B5D18B45E + 1: 49, 3C671A1AFA5B253DD8FF67FFED9C33E4 + 2: B986, 2A069C4C6FF67FA6880D6EDA8490A3C6 + 3: F78307, AB6D00AB217E62E1C2863A63E7E805FF + 4: C43CDED4, 9332E6E78B574354B866EB49B951AD6E + 5: 47FBFDFF71, 14B3A25479FC36C71C837680871855C9 + 6: 4662362F3992, 28B8B162DDEAECC2AFD92C343C49D986 + 7: 64BE9B49D4E3F2, 6DD06663768ECDEBC64980E0FE11BA9C + 8: DC6F456F02349DDD, D4CBE9414C65BEA4F1340707410A8D6F + 9: E0C1166D7CA0A919B2, E7B742D40ACECC618A9012DA72C0DBB5 + 10: 1E9B38CA4B1D2E41173F, 6F87E9D8B7EA96249B533FFB626773BB + 11: 7598A106F4A42DC2EBCEAA, 8A1358443F492C6996ECA14D41FCD91A + 12: 79C43C511A13395E5F1D259B, 0955EC3B5D6999D1DACA88E4B4B0EE77 + 13: 39DD979B5CDC450D7E7D49136B, 78E5E86F6FE3EFC5827BF7F088EC8FF0 + 14: A1C18979318C625FA4FCB0D40FC0, 6F9508959B87F510F3E7B39FF3237B7E + 15: D3A55B637FAF068BC97C52265B7DFC, 8C940DFDC990CAD1A08179784E668012 + 16: DC120E50B38579CB4A45DC7D45C29AE6, 2E0939B538B26E0009B198D5C3E6DE17 + 17: 266CD82BBCA8FBC6D146CD10DB417685F9, 0AE1614717E23EEFD5F9BE7916494A71 + 18: 00741031BC893E10F6B86698B4B3787FA14A, C297ED582832F4B77C7AD820F5637EA7 + 19: FFCF3CF4B06AA83E05E5C049DA2A4F1AB4843A, F2FB3E63B88B56E9D680560F346C6144 + 20: 381DDB2637F17F8FFC619AF59A4DCAEA227E95A5, 82D692BD1F86AFD28EE140D021E69532 + 21: 6267EDEE16E3FD95356079CC4366BCAA0739C5831B, 9D4F17B8A5E85E5CDD18FE16D6BE29F7 + 22: 0B79A1E9B3EE98DD6EF57E4F23171D84D7250562B4C6, D76DB52F53F51553C604FF17E23253B4 + 23: 1DED7558063E2F8B18514B8F5A3446981D6CD648ED098B, 0B209EE39335BD6336309D1DE1EBC379 + 24: E3E3CF278C9FB18005A468674E1EC0CDB5DB5B42ED1CA4D3, 772C852C854303FED2DE41F8437E81C7 + 25: 8D0F93686527DD62C4101B213B88930E375167E48B04446B90, 11BA6E13F45B82FD916644F859689AE6 + 26: 1B45865FB91DB5E93D87569DDB8A1CC395381E875E5CA6EAC1F1, 8BCB49BD6D413542DC88156758EF8CBD + 27: 06C381B8028DAC54D785CABF55B47AD7BD2CFC6D66C4B538F287F4, DEBFCDB4E6C7A43B7D7E0983D4FC0C87 + 28: D71A0CE6A88F80CC922189EFCA5696FE5C8F6557AB744698E4A65222, 4DCB5B5B0F9794D776C4C63C3E00C78C + 29: 23099CF8578E878B58589D6FFCAC8E6A74B373074D90E0F38ACCFB6117, A5B2C145ECF768842A957E47A8511D2F + 30: EC19652D148810E8C714D184263FE7E961FECE4C9CFD30D6921C32D2D4A9, 74B900BA5F4AE547C19221081DDC1F91 + 31: 9DB58E1FEF922A4A1F99602710ABCA029E8A10383465C62967EB0A466F11AD, 08D4FF277C8DA53A2598201B255B7FD7 + 32: 1BD03BAB70BE842FDB12E49DEB04AE477335B0B3930E75A27C37EBB1594099E7, 3A6DEAE1C289763C4405DE86544DF401 OCB-kasumi (16 byte key) - 0: , 8A6AB01A47834615 - 1: 23, 5184BF3E82D10C7F - 2: FDDB, EA45B282D973729D - 3: 8E3693, 432EFEDC2F238A6C - 4: 2409AE69, 7899D1928D55C08B - 5: CA037E6EF1, CA831CE963C9AD95 - 6: BC530A4140A2, EA77571BFFF105A1 - 7: 98B672C2D201EF, 607822313DBC9796 - 8: 26F9AB69E145B531, 7951CE4DC8C47F98 - 9: 30BFC33675F27F7EEB, D17DC60BF79939D2 - 10: F5F816B636D91279AC1C, E2C7B48991DEEF2F - 11: 705C47FABE7905757C0ED2, AADB2A403B861D55 - 12: 50DEB9C57870B744152ADF08, CB6126DAB93504D1 - 13: 767CB16AA8380C8F25A28A2039, F2C271CC48E067E6 - 14: 3A67656FD8B6ABA8BE7F3BE6C123, 462B6736DF6DC3B1 - 15: 21FB98C62DF932E70D05EB915BA8CF, AEFB635A4E0B6C60 - 16: EA8305ADB368267AB86F3ADDE5EE1719, 97E72E1B174A04F7 + 0: , 85F676BFBCB7B036 + 1: 2D, BD6D4E9C82E5CA26 + 2: 724C, 2AA67DB029E78720 + 3: E762C3, 3217E72AF565E98F + 4: 5A14AF1F, 6DE5CCF42AE4372D + 5: 3FE0C9B5BC, 5E8CCCB96F1971A5 + 6: 647D9AE7286B, 1C53A14119C1A650 + 7: B1A5078D8E09BC, C2F46899E85A43EB + 8: 4AAEF1B9316A1D2A, 4ADBC39C6CD59480 + 9: 97C4036A9EDB69F305, 7AF592CAB645C899 + 10: 2F2EBFA927812C6F6FF9, AE0DEC9D2D8E5BB4 + 11: B98061CC8801BE7A640651, 2CC2F1BBF418C4BF + 12: 9EE7742DBA13B66994FC5C53, BE6A9A6EDD45914C + 13: D1DBCFEEE8F2F5E94F74774CCE, 6D9377693CD38F8A + 14: 7D8C7B966FDAB2C4027220C77CAD, 8AF85A125D36D09C + 15: B254AE0DFA35531477D50906C695DC, 4FE0519983397BB0 + 16: 223FB914E44BE1755D94F963BF701F90, 0C8D07BAA2D66E4E OCB-multi2 (40 byte key) - 0: , AF7F5567D2CFBAA8 - 1: 15, 66BDF680986FAD17 - 2: C94C, D35B49ADC2B24181 - 3: A0516B, DBA6331562F87FE7 - 4: 49C24A69, 6B88C358FF40AD0F - 5: E1839EFAB4, 08B6C2F97518E402 - 6: 71CF3D6DC458, 7CA89CC9D23CF4CE - 7: 02AC7B36DCD0CC, 00331F043D5FB756 - 8: 216F3088BE2553AA, 8A58C76BF8EBC046 - 9: DA0CC0753327707AE3, 8716B1FB7196CB14 - 10: 12B88569BDAAACA144AE, 71A031364BF44ECD - 11: 35B7F2ECD911F86DA2040C, 7649CD32D29AA258 - 12: BF20840BA08B0C85BEAC80B6, C8BD34015F1E3578 - 13: 2A3F508352AA5673BD5A880093, 9987F70EF92CE4E6 - 14: 5DC44D52A234D9A1ABA4C9BF8301, 728D3D9BC56140E7 - 15: 5FCB0AF77D9BA605056BA9178B15FC, A59675797C1307E2 - 16: 09BB95F7F998572CC38719BC4047BA3A, 5F4DA28D281C7FE9 + 0: , EA28ABA0D6F4E490 + 1: F7, 951E5C33632C1B2E + 2: FD2B, 1C5912FD3190C3B1 + 3: 6AD41D, 38D5D04491483BE4 + 4: 611E46CD, 2B4C4AA96B9D4DE8 + 5: E2E52662AE, 24BC447CFACF4EA5 + 6: D3BEA1AD5905, AE39AC799F3BFAE5 + 7: 67FF55F2B4C49D, 426ECF9B4FAEB310 + 8: D823598A47C17669, 662829935E1DC1B2 + 9: CC194A8DF3491A595B, 559D45F5E4029FCF + 10: B51207427B00FCEBCA20, 806928EDDDCAAF67 + 11: 95AD2F304AA91A0521BCF8, 0DD36DC4BFECE04B + 12: 13999C2A8C566FE58AFFC34E, 7D2943749BC160F3 + 13: FEF35288E697EC0B96ED7351EE, 5999E5EAD14F635D + 14: 02DFF262D43C7796030F68DBDDE4, D6EEC27981EA7FD2 + 15: D70DF509F5A6ED361C96F7B59C5F0A, 4B3F0ECE9E727DF4 + 16: 966600DC680F216DB2591654161C51F2, 2F9985210161A9FE OCB-camellia (16 byte key) - 0: , 3F877FAB2796D87C990AE311F952ABD1 - 1: 00, DD1FC339F770744F39B1A41A3A82CAEA - 2: 2676, D350A1789213678BDCF07F1C42856456 - 3: F2BF5D, 012AD9BAA22496920EAC7ED7747C261E - 4: 7C421EA6, 1187E883BE6BD6D6A67F175B187F276C - 5: E709524F55, 36B849B052B8C5BA55AD9526333C0FF2 - 6: F49A3BEDA44C, CBCDE03DD9C5EBC7591329C5023F4F7C - 7: 6BC6BA030C3E8A, 726E39A65F92ED22728ED4351DEECCFA - 8: EBFCF5FED85EEACC, 5E390FA62857DAC97225368029263E00 - 9: 3DD92B177D039DF76F, 224D361D1A7D660485A9B3FD11DE370A - 10: C90774C14A42828E7EDB, E6A48823F8F004EE5A178C37B87BA06A - 11: 39089E93DC6E76B827B701, C2AAC46E4D1DE7F319B1E2592F9A29B9 - 12: 0C0C8ED5B3DD2C0A67606172, 2EA84EE1736B4F6F0C0A133C345B328E - 13: AF6770413CDF0DCE68F447F76D, AB462C2F2524940FAB9A57A17FA2783B - 14: C210E4CBBB5FD339B3FF90A722BD, 05A92BEFBFFEDA7F5FEB9BBC6E7BC363 - 15: 90FC04748C52CAA59BF6C92FF11F1B, 991C959C9E3B58D783120FAFF45C29E6 - 16: AB86F4DC4EDD4556F168A98249235F02, 92585560E23DFCF81B8551AA94135BB2 - 17: A160C9534C3E2185013F6D5D76E0218E7D, 9A3CDDFB67DB71D8E5BC4BE4D8EFDC4B - 18: C08635F10D090C6A5DF4DC43DD9B58D50EC5, CC8A076D653B3FBC2AE34A8A0FF42609 - 19: 24C18B9EED5029BFAE91D440608BE46F9798AA, 9A56608D45081C2E5A8C9CC163A307DE - 20: 5946CFA51DD90646F09CE74F96D4603CFB20B7A2, 1CD0CE9985AC99F2600B5D762BF46EC0 - 21: 08D8BB0667DC8106E365D7D685392DB987EFA5D3DF, C969DB2859DB494DDD57E9F93CF2C279 - 22: 4AF8331829032CD8BCFEF44CFB2DBC8F0931E055B7A2, 623C86EC7059B580124530CA201740F0 - 23: 45A7C23FD71657BEDA626937C187038D9E1872FBE029D8, 32E954062276603C2F588852C6A17B6F - 24: 2EACBAD372A281A6AC79D6A13EF4D8F5FB0AA15224C7DBEF, 059A4622EB369FFD2A50565351202907 - 25: 405576484E48609F1BB950DEBE5F3915660A80E632E033DB4C, CAEAAB99D713B860F29E03AF719B5FC6 - 26: CC701CFF33D7CD69D6E9C20E15FC629B5375A3C9F8A9CCBB194A, B5F1CCD9E6C6DA25766CC11FFF313040 - 27: 1FD00A679D2F29518B5663A10CEBB83975C1D3183FD9F9617BBCB8, 03FCE87FFFEE68464DBCF9181280C0EB - 28: B92D0C160F1A13504B55D9969CF9A51A3F0DFCB4911F7A4712D0E8FC, 8B858E49BFEE49A17F2D7E9A83CF2143 - 29: 5EC88A34A42C155A1F59947BBFD90B3FC8699EC8294EDEBEA75D8416CE, 1B8A62889CDCFAAB60FE80D8E9B764CE - 30: 1A2D76510AA8AEC8ADCC71458E13592DDEC46CB2C92D551CDF4DA3C190F4, AD08510F3F1A2CBC608634D6431BECD5 - 31: 19ECDC6B7F8EC795F9E6D7E0E02F410228F9EBDA404BF3D998F99D938D3009, 58AF4CAFE7DDE4E99EC617D3A2AE600D - 32: 6FCB93EBC43D6EE05E3EF20109328DFABE6D9D814BFCB7180AE36BBA1B96ECC8, 36032D6860317FF56E7033DCD8161FDC + 0: , DFF7EA9ECD4E2AD37B9838E85F9D36EB + 1: 1B, D5D37222F530EA2C282A4D8BC55A08EA + 2: B73C, 5163F4BD7CBC03DA1B31C7C1105B5511 + 3: 42B8CB, 997087C18C191D560E3FCF70E77A3C15 + 4: F533FD5E, 15275FBDDED6459BFD8FBB8FA08DDD3F + 5: CA7A675DD6, 11604097A97E10A4724799DC6A349F34 + 6: 00F4D4CAC81D, 9165C7B49928D47A8F3C17C0B029F44E + 7: 8751CBEEC4D29C, F541920B2E92DE956B6468EF83DFECB0 + 8: B851DACF29824BF3, C16660EB40CF830FFD263C52C1FA8C97 + 9: 8646C3D808426E03E8, DB30D0CE9F7DA93162D69D42F0B4C644 + 10: 0715BC4E51EAF610956D, 2475EAB0B92533BD574550F316C86746 + 11: 12F6C6BE1A4AAD391BCDB4, F1F387AB03A4E36965CF41C6842950C4 + 12: 4F85DAC1AB5B6D48CFA75266, 57B3ACD0FB6D2F8B672BF097E7C559A9 + 13: FCD56B0CAF30F6A29324AA3067, 437461CFA9DE7562A572085439CE5B5D + 14: 612BD3BDAA826CCCC76722699D51, 90863205C506D85FEE095B32F3E1DF93 + 15: 5C85AFD2B6A6FC85B282B57D48642E, C59DBD94D744A6F3745EBD9D4EBAE0F4 + 16: 64173080FB3CB43EA8FD41F23DB88587, D80103E4C578DD4B79A23372E34ED967 + 17: DBA50DDBF3B3F064F8E40967EB53769FB3, 4751B6EEAA9B2E49BF8B23A3BA13807D + 18: 04B8D0D351F3FA3B3B3F641A244EF7036825, 6BB18750DCEBD39DC25E42233475BE7E + 19: A15A0C3E91CE8AC01C8A5291D24FA0514453A8, 5DDC4FB9D6C7AAF7660B763EADAAD969 + 20: 6E223B742F768FA57651AD90B6BDFAA772E6AC04, C987C8A3A27605B6CE04B25777286875 + 21: 1FBFEA7AB374D972FBF76456048F77745D8E7B64C1, C301981D5C17473953B00818967E9230 + 22: D642F5D05092443C776E53D6FCF2B65F6D25E8E98F89, 5E87E6BFA1EBD436909126197B2CCAA5 + 23: A8270C56D2A0084670A0C5D8DA2B495A849D1BFC571912, C4D32192AC893C87C900EE2F80443789 + 24: 431ED5C50F16D509C8229156E9BF0A7E1998F48F0032D91C, 960F4467E129A002CAC3F75EACCC7D73 + 25: DB57EDEBCAA10C4B8E0194CEE7E778FDEFA88424883DC476DC, 069F456F5AF43492AEDC7FC24A0ED875 + 26: DC8AF80FE840605041638184A00F683FB0AB86C4067550B4DB49, 862057189AC987639992EA9F49C7158E + 27: 6A67318A81F95E33F741C95BCBCD8623CBF26D2D8801D0E745DFB6, 22DA5E8C63CEBC5A6957FB1A01AC7571 + 28: 70587F34F31CF711F2558C7DB1B04334DD58D850930ACDD5825EE131, D2436CA4FC757B16509CECA1272A2955 + 29: 736DF200A877930DA3EC2FD0AF53F08285E02EFB519A443F50B9E2F1F1, 22607EA2C6F1AE1B73785554F9440F2B + 30: 62248D90EA60163F9CBDFAEC498802AA816915273093D375B02BBE22241B, BFADB3689B3863AB997D101380F7156A + 31: 41C092516DC494E4E165EABAF939858EDAE3D3DAE488D14EFDB0E850675565, F45307A495AFE24E29E2AB744311F07C + 32: EFFEAF5A73C2A825AFEE12A2BE80406937C75D4264FD937A310FA57C7D5D01CB, 3B430C0DA47DAA069FCC5C92C5427396 diff --git a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c index da54ffa46..9288d3361 100644 --- a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c +++ b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c @@ -69,7 +69,7 @@ int ocb3_decrypt_verify_memory(int cipher, return CRYPT_MEM; } - if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen)) != CRYPT_OK) { + if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen, taglen)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c index 1f81a26dd..10d1617df 100644 --- a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c +++ b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c @@ -55,7 +55,7 @@ int ocb3_encrypt_authenticate_memory(int cipher, return CRYPT_MEM; } - if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen)) != CRYPT_OK) { + if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen, *taglen)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index 1d88736f1..9cea63dd1 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -41,7 +41,8 @@ static const struct { */ int ocb3_init(ocb3_state *ocb, int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, unsigned long noncelen) + const unsigned char *nonce, unsigned long noncelen, + unsigned long taglen) { int poly, x, y, m, err; unsigned char *previous, *current; @@ -62,6 +63,11 @@ int ocb3_init(ocb3_state *ocb, int cipher, return CRYPT_INVALID_ARG; } + /* Make sure taglen isn't too long */ + if (taglen > (unsigned long)cipher_descriptor[cipher].block_length) { + taglen = cipher_descriptor[cipher].block_length; + } + /* determine which polys to use */ ocb->block_len = cipher_descriptor[cipher].block_length; x = (int)(sizeof(polys)/sizeof(polys[0])); @@ -114,7 +120,7 @@ int ocb3_init(ocb3_state *ocb, int cipher, } /* initialize ocb->Offset_current = Offset_0 */ - ocb3_int_calc_offset_zero(ocb, nonce, noncelen); + ocb3_int_calc_offset_zero(ocb, nonce, noncelen, taglen); /* initialize checksum to all zeros */ zeromem(ocb->checksum, ocb->block_len); diff --git a/src/encauth/ocb3/ocb3_int_calc_offset_zero.c b/src/encauth/ocb3/ocb3_int_calc_offset_zero.c index 2d5a976f3..a80c6b7d5 100644 --- a/src/encauth/ocb3/ocb3_int_calc_offset_zero.c +++ b/src/encauth/ocb3/ocb3_int_calc_offset_zero.c @@ -21,7 +21,7 @@ @param nonce The session nonce @param noncelen The length of the session nonce (octets) */ -void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen) +void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen, unsigned long taglen) { int x, y, bottom; int idx, shift; @@ -35,6 +35,7 @@ void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsi iNonce[x] = nonce[noncelen-y-1]; } iNonce[x] = 0x01; + iNonce[0] |= ((taglen*8) % 128) << 1; /* bottom = str2num(Nonce[123..128]) */ bottom = iNonce[ocb->block_len-1] & 0x3F; diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index a9bfb61c3..f12f8977f 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -27,7 +27,7 @@ int ocb3_test(void) /* test vectors from: http://tools.ietf.org/html/draft-krovetz-ocb-03 */ unsigned char key[16] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F }; unsigned char nonce[12] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B }; - static const struct { + const struct { int ptlen; int aadlen; unsigned char pt[64], aad[64], ct[64], tag[16]; @@ -163,6 +163,44 @@ int ocb3_test(void) }, }; + /* As of RFC 7253 - 'Appendix A. Sample Results' + * The next tuple shows a result with a tag length of 96 bits and a + different key. + + K: 0F0E0D0C0B0A09080706050403020100 + + N: BBAA9988776655443322110D + A: 000102030405060708090A0B0C0D0E0F1011121314151617 + 18191A1B1C1D1E1F2021222324252627 + P: 000102030405060708090A0B0C0D0E0F1011121314151617 + 18191A1B1C1D1E1F2021222324252627 + C: 1792A4E31E0755FB03E31B22116E6C2DDF9EFD6E33D536F1 + A0124B0A55BAE884ED93481529C76B6AD0C515F4D1CDD4FD + AC4F02AA + + The C has been split up in C and T (tag) + */ + const unsigned char K[] = { 0x0F,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,0x08, + 0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00 }; + const unsigned char N[] = { 0xBB,0xAA,0x99,0x88,0x77,0x66,0x55,0x44, + 0x33,0x22,0x11,0x0D }; + const unsigned char A[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, + 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, + 0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, + 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }; + const unsigned char P[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, + 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, + 0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, + 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27 }; + const unsigned char C[] = { 0x17,0x92,0xA4,0xE3,0x1E,0x07,0x55,0xFB, + 0x03,0xE3,0x1B,0x22,0x11,0x6E,0x6C,0x2D, + 0xDF,0x9E,0xFD,0x6E,0x33,0xD5,0x36,0xF1, + 0xA0,0x12,0x4B,0x0A,0x55,0xBA,0xE8,0x84, + 0xED,0x93,0x48,0x15,0x29,0xC7,0x6B,0x6A }; + const unsigned char T[] = { 0xD0,0xC5,0x15,0xF4,0xD1,0xCD,0xD4,0xFD, + 0xAC,0x4F,0x02,0xAA }; int err, x, idx, res; unsigned long len; @@ -206,6 +244,36 @@ int ocb3_test(void) return CRYPT_FAIL_TESTVECTOR; } } + x = 99; + len = 12; + if ((err = ocb3_encrypt_authenticate_memory(idx, + K, sizeof(K), + N, sizeof(N), + A, sizeof(A), + P, sizeof(P), + outct, outtag, &len)) != CRYPT_OK) { + return err; + } + + if (compare_testvector(outtag, len, T, sizeof(T), "OCB3 Tag", x) || + compare_testvector(outct, sizeof(P), C, sizeof(C), "OCB3 CT", x)) { + return CRYPT_FAIL_TESTVECTOR; + } + + if ((err = ocb3_decrypt_verify_memory(idx, + K, sizeof(K), + N, sizeof(N), + A, sizeof(A), + C, sizeof(C), + outct, T, sizeof(T), &res)) != CRYPT_OK) { + return err; + } + if ((res != 1) || compare_testvector(outct, sizeof(C), P, sizeof(P), "OCB3", x)) { +#ifdef LTC_TEST_DBG + printf("\n\nOCB3: Failure-decrypt - res = %d\n", res); +#endif + return CRYPT_FAIL_TESTVECTOR; + } return CRYPT_OK; #endif /* LTC_TEST */ } diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 94d4a14e1..b74761c76 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -271,7 +271,8 @@ typedef struct { int ocb3_init(ocb3_state *ocb, int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, unsigned long noncelen); + const unsigned char *nonce, unsigned long noncelen, + unsigned long taglen); int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct); int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt); @@ -302,7 +303,7 @@ int ocb3_test(void); #ifdef LTC_SOURCE /* internal helper functions */ int ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block); -void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen); +void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen, unsigned long taglen); int ocb3_int_ntz(unsigned long x); void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len); #endif /* LTC_SOURCE */ From 0c2ff4a1b0262fd6e8c773abf1437aa1e395db34 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 2 Aug 2017 18:55:34 +0200 Subject: [PATCH 1010/1192] OCBv3: small review * better LTC_ARGCHK() * move unnecessary functions from API to be static * limit malloc'ed data in ocb3_decrypt_verify_memory() --- src/encauth/ocb3/ocb3_add_aad.c | 30 +++++++- src/encauth/ocb3/ocb3_decrypt_last.c | 1 + src/encauth/ocb3/ocb3_decrypt_verify_memory.c | 7 +- .../ocb3/ocb3_encrypt_authenticate_memory.c | 5 -- src/encauth/ocb3/ocb3_init.c | 53 +++++++++++++- src/encauth/ocb3/ocb3_int_aad_add_block.c | 49 ------------- src/encauth/ocb3/ocb3_int_calc_offset_zero.c | 73 ------------------- src/headers/tomcrypt_mac.h | 2 - 8 files changed, 82 insertions(+), 138 deletions(-) delete mode 100644 src/encauth/ocb3/ocb3_int_aad_add_block.c delete mode 100644 src/encauth/ocb3/ocb3_int_calc_offset_zero.c diff --git a/src/encauth/ocb3/ocb3_add_aad.c b/src/encauth/ocb3/ocb3_add_aad.c index 755ec4c09..98a285de4 100644 --- a/src/encauth/ocb3/ocb3_add_aad.c +++ b/src/encauth/ocb3/ocb3_add_aad.c @@ -15,6 +15,32 @@ #ifdef LTC_OCB3_MODE +/** + Add one block of AAD data (internal function) + @param ocb The OCB state + @param aad_block [in] AAD data (block_len size) + @return CRYPT_OK if successful +*/ +static int _ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block) +{ + unsigned char tmp[MAXBLOCKSIZE]; + int err; + + /* Offset_i = Offset_{i-1} xor L_{ntz(i)} */ + ocb3_int_xor_blocks(ocb->aOffset_current, ocb->aOffset_current, ocb->L_[ocb3_int_ntz(ocb->ablock_index)], ocb->block_len); + + /* Sum_i = Sum_{i-1} xor ENCIPHER(K, A_i xor Offset_i) */ + ocb3_int_xor_blocks(tmp, aad_block, ocb->aOffset_current, ocb->block_len); + if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { + return err; + } + ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); + + ocb->ablock_index++; + + return CRYPT_OK; +} + /** Add AAD - additional associated data @param ocb The OCB state @@ -41,7 +67,7 @@ int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen ocb->adata_buffer_bytes += l; if (ocb->adata_buffer_bytes == ocb->block_len) { - if ((err = ocb3_int_aad_add_block(ocb, ocb->adata_buffer)) != CRYPT_OK) { + if ((err = _ocb3_int_aad_add_block(ocb, ocb->adata_buffer)) != CRYPT_OK) { return err; } ocb->adata_buffer_bytes = 0; @@ -62,7 +88,7 @@ int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen last_block_len = datalen - full_blocks_len; for (x=0; xblock_len)) != CRYPT_OK) { + if ((err = _ocb3_int_aad_add_block(ocb, data+x*ocb->block_len)) != CRYPT_OK) { return err; } } diff --git a/src/encauth/ocb3/ocb3_decrypt_last.c b/src/encauth/ocb3/ocb3_decrypt_last.c index 3477f2302..bc99094e1 100644 --- a/src/encauth/ocb3/ocb3_decrypt_last.c +++ b/src/encauth/ocb3/ocb3_decrypt_last.c @@ -31,6 +31,7 @@ int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ct LTC_ARGCHK(ocb != NULL); LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(pt != NULL); if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c index 9288d3361..486168da7 100644 --- a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c +++ b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c @@ -46,18 +46,13 @@ int ocb3_decrypt_verify_memory(int cipher, unsigned char *buf; unsigned long buflen; - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(nonce != NULL); - LTC_ARGCHK(pt != NULL); - LTC_ARGCHK(ct != NULL); - LTC_ARGCHK(tag != NULL); LTC_ARGCHK(stat != NULL); /* default to zero */ *stat = 0; /* allocate memory */ - buf = XMALLOC(taglen); + buf = XMALLOC(MIN(taglen, MAXBLOCKSIZE)); ocb = XMALLOC(sizeof(ocb3_state)); if (ocb == NULL || buf == NULL) { if (ocb != NULL) { diff --git a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c index 10d1617df..efc1a8fb2 100644 --- a/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c +++ b/src/encauth/ocb3/ocb3_encrypt_authenticate_memory.c @@ -42,11 +42,6 @@ int ocb3_encrypt_authenticate_memory(int cipher, int err; ocb3_state *ocb; - LTC_ARGCHK(key != NULL); - LTC_ARGCHK(nonce != NULL); - LTC_ARGCHK(pt != NULL); - LTC_ARGCHK(ct != NULL); - LTC_ARGCHK(tag != NULL); LTC_ARGCHK(taglen != NULL); /* allocate memory */ diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index 9cea63dd1..573fe152a 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -15,6 +15,57 @@ #ifdef LTC_OCB3_MODE +/** + Sets 'ocb->Offset_current' to 'Offset_0' value (internal function) + @param ocb The OCB state + @param nonce The session nonce + @param noncelen The length of the session nonce (octets) +*/ +static void _ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen, unsigned long taglen) +{ + int x, y, bottom; + int idx, shift; + unsigned char iNonce[MAXBLOCKSIZE]; + unsigned char iKtop[MAXBLOCKSIZE]; + unsigned char iStretch[MAXBLOCKSIZE+8]; + + /* Nonce = zeros(127-bitlen(N)) || 1 || N */ + zeromem(iNonce, sizeof(iNonce)); + for (x = ocb->block_len-1, y=0; y<(int)noncelen; x--, y++) { + iNonce[x] = nonce[noncelen-y-1]; + } + iNonce[x] = 0x01; + iNonce[0] |= ((taglen*8) % 128) << 1; + + /* bottom = str2num(Nonce[123..128]) */ + bottom = iNonce[ocb->block_len-1] & 0x3F; + + /* Ktop = ENCIPHER(K, Nonce[1..122] || zeros(6)) */ + iNonce[ocb->block_len-1] = iNonce[ocb->block_len-1] & 0xC0; + if ((cipher_descriptor[ocb->cipher].ecb_encrypt(iNonce, iKtop, &ocb->key)) != CRYPT_OK) { + zeromem(ocb->Offset_current, ocb->block_len); + return; + } + + /* Stretch = Ktop || (Ktop[1..64] xor Ktop[9..72]) */ + for (x = 0; x < ocb->block_len; x++) { + iStretch[x] = iKtop[x]; + } + for (y = 0; y < 8; y++) { + iStretch[x+y] = iKtop[y] ^ iKtop[y+1]; + } + + /* Offset_0 = Stretch[1+bottom..128+bottom] */ + idx = bottom / 8; + shift = (bottom % 8); + for (x = 0; x < ocb->block_len; x++) { + ocb->Offset_current[x] = iStretch[idx+x] << shift; + if (shift > 0) { + ocb->Offset_current[x] |= iStretch[idx+x+1] >> (8-shift); + } + } +} + static const struct { int len; unsigned char poly_mul[MAXBLOCKSIZE]; @@ -120,7 +171,7 @@ int ocb3_init(ocb3_state *ocb, int cipher, } /* initialize ocb->Offset_current = Offset_0 */ - ocb3_int_calc_offset_zero(ocb, nonce, noncelen, taglen); + _ocb3_int_calc_offset_zero(ocb, nonce, noncelen, taglen); /* initialize checksum to all zeros */ zeromem(ocb->checksum, ocb->block_len); diff --git a/src/encauth/ocb3/ocb3_int_aad_add_block.c b/src/encauth/ocb3/ocb3_int_aad_add_block.c deleted file mode 100644 index 7f86ab026..000000000 --- a/src/encauth/ocb3/ocb3_int_aad_add_block.c +++ /dev/null @@ -1,49 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ - -/** - @file ocb3_int_aad_add_block.c - OCB implementation, INTERNALL ONLY helper, by Karel Miko -*/ -#include "tomcrypt.h" - -#ifdef LTC_OCB3_MODE - -/** - Add one block of AAD data (internal function) - @param ocb The OCB state - @param aad_block [in] AAD data (block_len size) - @return CRYPT_OK if successful -*/ -int ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block) -{ - unsigned char tmp[MAXBLOCKSIZE]; - int err; - - /* Offset_i = Offset_{i-1} xor L_{ntz(i)} */ - ocb3_int_xor_blocks(ocb->aOffset_current, ocb->aOffset_current, ocb->L_[ocb3_int_ntz(ocb->ablock_index)], ocb->block_len); - - /* Sum_i = Sum_{i-1} xor ENCIPHER(K, A_i xor Offset_i) */ - ocb3_int_xor_blocks(tmp, aad_block, ocb->aOffset_current, ocb->block_len); - if ((err = cipher_descriptor[ocb->cipher].ecb_encrypt(tmp, tmp, &ocb->key)) != CRYPT_OK) { - return err; - } - ocb3_int_xor_blocks(ocb->aSum_current, ocb->aSum_current, tmp, ocb->block_len); - - ocb->ablock_index++; - - return CRYPT_OK; -} - -#endif - - -/* ref: $Format:%D$ */ -/* git commit: $Format:%H$ */ -/* commit time: $Format:%ai$ */ diff --git a/src/encauth/ocb3/ocb3_int_calc_offset_zero.c b/src/encauth/ocb3/ocb3_int_calc_offset_zero.c deleted file mode 100644 index a80c6b7d5..000000000 --- a/src/encauth/ocb3/ocb3_int_calc_offset_zero.c +++ /dev/null @@ -1,73 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ - -/** - @file ocb3_int_calc_offset_zero.c - OCB implementation, INTERNAL ONLY helper, by Karel Miko -*/ -#include "tomcrypt.h" - -#ifdef LTC_OCB3_MODE - -/** - Sets 'ocb->Offset_current' to 'Offset_0' value (internal function) - @param ocb The OCB state - @param nonce The session nonce - @param noncelen The length of the session nonce (octets) -*/ -void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen, unsigned long taglen) -{ - int x, y, bottom; - int idx, shift; - unsigned char iNonce[MAXBLOCKSIZE]; - unsigned char iKtop[MAXBLOCKSIZE]; - unsigned char iStretch[MAXBLOCKSIZE+8]; - - /* Nonce = zeros(127-bitlen(N)) || 1 || N */ - zeromem(iNonce, sizeof(iNonce)); - for (x = ocb->block_len-1, y=0; y<(int)noncelen; x--, y++) { - iNonce[x] = nonce[noncelen-y-1]; - } - iNonce[x] = 0x01; - iNonce[0] |= ((taglen*8) % 128) << 1; - - /* bottom = str2num(Nonce[123..128]) */ - bottom = iNonce[ocb->block_len-1] & 0x3F; - - /* Ktop = ENCIPHER(K, Nonce[1..122] || zeros(6)) */ - iNonce[ocb->block_len-1] = iNonce[ocb->block_len-1] & 0xC0; - if ((cipher_descriptor[ocb->cipher].ecb_encrypt(iNonce, iKtop, &ocb->key)) != CRYPT_OK) { - zeromem(ocb->Offset_current, ocb->block_len); - return; - } - - /* Stretch = Ktop || (Ktop[1..64] xor Ktop[9..72]) */ - for (x = 0; x < ocb->block_len; x++) { - iStretch[x] = iKtop[x]; - } - for (y = 0; y < 8; y++) { - iStretch[x+y] = iKtop[y] ^ iKtop[y+1]; - } - - /* Offset_0 = Stretch[1+bottom..128+bottom] */ - idx = bottom / 8; - shift = (bottom % 8); - for (x = 0; x < ocb->block_len; x++) { - ocb->Offset_current[x] = iStretch[idx+x] << shift; - if (shift > 0) { - ocb->Offset_current[x] |= iStretch[idx+x+1] >> (8-shift); - } - } -} - -#endif - -/* ref: $Format:%D$ */ -/* git commit: $Format:%H$ */ -/* commit time: $Format:%ai$ */ diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index b74761c76..2a2a011a4 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -302,8 +302,6 @@ int ocb3_test(void); #ifdef LTC_SOURCE /* internal helper functions */ -int ocb3_int_aad_add_block(ocb3_state *ocb, const unsigned char *aad_block); -void ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen, unsigned long taglen); int ocb3_int_ntz(unsigned long x); void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const unsigned char *block_b, unsigned long block_len); #endif /* LTC_SOURCE */ From bc0c18f347988d52a3e97c56b21901e939b87a00 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 2 Aug 2017 18:55:42 +0200 Subject: [PATCH 1011/1192] Update makefiles --- libtomcrypt_VS2008.vcproj | 8 -------- makefile.mingw | 7 +++---- makefile.msvc | 7 +++---- makefile.unix | 7 +++---- makefile_include.mk | 7 +++---- 5 files changed, 12 insertions(+), 24 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 7cc0d3cb7..8c37957c4 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -798,14 +798,6 @@ RelativePath="src\encauth\ocb3\ocb3_init.c" > - - - - diff --git a/makefile.mingw b/makefile.mingw index 9e96129ba..b6021afae 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -61,10 +61,9 @@ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ -src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ -src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ -src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \ +src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \ +src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ diff --git a/makefile.msvc b/makefile.msvc index 615e87b7d..0f7cae4f3 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -54,10 +54,9 @@ src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s src/encauth/ocb3/ocb3_add_aad.obj src/encauth/ocb3/ocb3_decrypt.obj src/encauth/ocb3/ocb3_decrypt_last.obj \ src/encauth/ocb3/ocb3_decrypt_verify_memory.obj src/encauth/ocb3/ocb3_done.obj \ src/encauth/ocb3/ocb3_encrypt.obj src/encauth/ocb3/ocb3_encrypt_authenticate_memory.obj \ -src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj \ -src/encauth/ocb3/ocb3_int_aad_add_block.obj src/encauth/ocb3/ocb3_int_calc_offset_zero.obj \ -src/encauth/ocb3/ocb3_int_ntz.obj src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj \ -src/hashes/blake2b.obj src/hashes/blake2s.obj src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj \ +src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj src/encauth/ocb3/ocb3_int_ntz.obj \ +src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj src/hashes/blake2b.obj \ +src/hashes/blake2s.obj src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj \ src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \ src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \ src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \ diff --git a/makefile.unix b/makefile.unix index dd249b429..1f5d033c8 100644 --- a/makefile.unix +++ b/makefile.unix @@ -71,10 +71,9 @@ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ -src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ -src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ -src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \ +src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \ +src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ diff --git a/makefile_include.mk b/makefile_include.mk index e2d2a3366..6f6211a4f 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -205,10 +205,9 @@ src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \ src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \ src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ -src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o \ -src/encauth/ocb3/ocb3_int_aad_add_block.o src/encauth/ocb3/ocb3_int_calc_offset_zero.o \ -src/encauth/ocb3/ocb3_int_ntz.o src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o \ -src/hashes/blake2b.o src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ +src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \ +src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \ +src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \ src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \ src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \ src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \ From 868c5a82c31c816dc39a1ea7abed7f979d7e0bd6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Aug 2017 13:19:12 +0200 Subject: [PATCH 1012/1192] OCBv3: fix handling of empty plaintext --- src/encauth/ocb3/ocb3_decrypt.c | 6 ++++-- src/encauth/ocb3/ocb3_decrypt_last.c | 6 ++++-- src/encauth/ocb3/ocb3_encrypt.c | 6 ++++-- src/encauth/ocb3/ocb3_encrypt_last.c | 5 ++++- src/encauth/ocb3/ocb3_test.c | 8 ++++---- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/encauth/ocb3/ocb3_decrypt.c b/src/encauth/ocb3/ocb3_decrypt.c index 78ca5ca60..da1a70d3e 100644 --- a/src/encauth/ocb3/ocb3_decrypt.c +++ b/src/encauth/ocb3/ocb3_decrypt.c @@ -30,8 +30,10 @@ int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt_b, *ct_b; LTC_ARGCHK(ocb != NULL); - LTC_ARGCHK(pt != NULL); - LTC_ARGCHK(ct != NULL); + if (ct == NULL) LTC_ARGCHK(ctlen == 0); + if (ctlen == 0) LTC_ARGCHK(ct == NULL); + else LTC_ARGCHK(pt != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { return err; } diff --git a/src/encauth/ocb3/ocb3_decrypt_last.c b/src/encauth/ocb3/ocb3_decrypt_last.c index bc99094e1..d92d0ed59 100644 --- a/src/encauth/ocb3/ocb3_decrypt_last.c +++ b/src/encauth/ocb3/ocb3_decrypt_last.c @@ -30,8 +30,10 @@ int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ct int err, x, full_blocks, full_blocks_len, last_block_len; LTC_ARGCHK(ocb != NULL); - LTC_ARGCHK(ct != NULL); - LTC_ARGCHK(pt != NULL); + if (ct == NULL) LTC_ARGCHK(ctlen == 0); + if (ctlen == 0) LTC_ARGCHK(ct == NULL); + else LTC_ARGCHK(pt != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/encauth/ocb3/ocb3_encrypt.c b/src/encauth/ocb3/ocb3_encrypt.c index 120dc1a1a..be7438dc2 100644 --- a/src/encauth/ocb3/ocb3_encrypt.c +++ b/src/encauth/ocb3/ocb3_encrypt.c @@ -30,8 +30,10 @@ int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *pt_b, *ct_b; LTC_ARGCHK(ocb != NULL); - LTC_ARGCHK(pt != NULL); - LTC_ARGCHK(ct != NULL); + if (pt == NULL) LTC_ARGCHK(ptlen == 0); + if (ptlen == 0) LTC_ARGCHK(pt == NULL); + else LTC_ARGCHK(ct != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { return err; } diff --git a/src/encauth/ocb3/ocb3_encrypt_last.c b/src/encauth/ocb3/ocb3_encrypt_last.c index 53ff36d51..fb5adb898 100644 --- a/src/encauth/ocb3/ocb3_encrypt_last.c +++ b/src/encauth/ocb3/ocb3_encrypt_last.c @@ -30,7 +30,10 @@ int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long pt int err, x, full_blocks, full_blocks_len, last_block_len; LTC_ARGCHK(ocb != NULL); - LTC_ARGCHK(pt != NULL); + if (pt == NULL) LTC_ARGCHK(ptlen == 0); + if (ptlen == 0) LTC_ARGCHK(pt == NULL); + else LTC_ARGCHK(ct != NULL); + if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { goto LBL_ERR; } diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index f12f8977f..10d541944 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -219,8 +219,8 @@ int ocb3_test(void) key, sizeof(key), nonce, sizeof(nonce), tests[x].aadlen != 0 ? tests[x].aad : NULL, tests[x].aadlen, - tests[x].pt, tests[x].ptlen, - outct, outtag, &len)) != CRYPT_OK) { + tests[x].ptlen != 0 ? tests[x].pt : NULL, tests[x].ptlen, + tests[x].ptlen != 0 ? outct : NULL, outtag, &len)) != CRYPT_OK) { return err; } @@ -233,8 +233,8 @@ int ocb3_test(void) key, sizeof(key), nonce, sizeof(nonce), tests[x].aadlen != 0 ? tests[x].aad : NULL, tests[x].aadlen, - outct, tests[x].ptlen, - outct, tests[x].tag, len, &res)) != CRYPT_OK) { + tests[x].ptlen != 0 ? outct : NULL, tests[x].ptlen, + tests[x].ptlen != 0 ? outct : NULL, tests[x].tag, len, &res)) != CRYPT_OK) { return err; } if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB3", x)) { From 3b4d39ea45ed780f4504af2ccfce43efabc3b854 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Aug 2017 13:40:26 +0200 Subject: [PATCH 1013/1192] OCBv3: improve a bit when ARGCHK'ing pointers * it didn't really make sense to check that the _in_ pointer is NULL * instead we should check that _in_ and _out_ are not NULL when there's something to process --- src/encauth/ocb3/ocb3_decrypt.c | 6 ++++-- src/encauth/ocb3/ocb3_decrypt_last.c | 6 ++++-- src/encauth/ocb3/ocb3_encrypt.c | 6 ++++-- src/encauth/ocb3/ocb3_encrypt_last.c | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/encauth/ocb3/ocb3_decrypt.c b/src/encauth/ocb3/ocb3_decrypt.c index da1a70d3e..1824bc3ab 100644 --- a/src/encauth/ocb3/ocb3_decrypt.c +++ b/src/encauth/ocb3/ocb3_decrypt.c @@ -31,8 +31,10 @@ int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, LTC_ARGCHK(ocb != NULL); if (ct == NULL) LTC_ARGCHK(ctlen == 0); - if (ctlen == 0) LTC_ARGCHK(ct == NULL); - else LTC_ARGCHK(pt != NULL); + if (ctlen != 0) { + LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(pt != NULL); + } if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { return err; diff --git a/src/encauth/ocb3/ocb3_decrypt_last.c b/src/encauth/ocb3/ocb3_decrypt_last.c index d92d0ed59..70608dc76 100644 --- a/src/encauth/ocb3/ocb3_decrypt_last.c +++ b/src/encauth/ocb3/ocb3_decrypt_last.c @@ -31,8 +31,10 @@ int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ct LTC_ARGCHK(ocb != NULL); if (ct == NULL) LTC_ARGCHK(ctlen == 0); - if (ctlen == 0) LTC_ARGCHK(ct == NULL); - else LTC_ARGCHK(pt != NULL); + if (ctlen != 0) { + LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(pt != NULL); + } if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { goto LBL_ERR; diff --git a/src/encauth/ocb3/ocb3_encrypt.c b/src/encauth/ocb3/ocb3_encrypt.c index be7438dc2..33495544e 100644 --- a/src/encauth/ocb3/ocb3_encrypt.c +++ b/src/encauth/ocb3/ocb3_encrypt.c @@ -31,8 +31,10 @@ int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, LTC_ARGCHK(ocb != NULL); if (pt == NULL) LTC_ARGCHK(ptlen == 0); - if (ptlen == 0) LTC_ARGCHK(pt == NULL); - else LTC_ARGCHK(ct != NULL); + if (ptlen != 0) { + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); + } if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { return err; diff --git a/src/encauth/ocb3/ocb3_encrypt_last.c b/src/encauth/ocb3/ocb3_encrypt_last.c index fb5adb898..8110a3c05 100644 --- a/src/encauth/ocb3/ocb3_encrypt_last.c +++ b/src/encauth/ocb3/ocb3_encrypt_last.c @@ -31,8 +31,10 @@ int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long pt LTC_ARGCHK(ocb != NULL); if (pt == NULL) LTC_ARGCHK(ptlen == 0); - if (ptlen == 0) LTC_ARGCHK(pt == NULL); - else LTC_ARGCHK(ct != NULL); + if (ptlen != 0) { + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); + } if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { goto LBL_ERR; From 3ecd18763b396988f793f18c8de6994233ad5ae1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Aug 2017 13:40:57 +0200 Subject: [PATCH 1014/1192] OCBv3: better taglen limitation --- src/encauth/ocb3/ocb3_decrypt_verify_memory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c index 486168da7..066b62cb6 100644 --- a/src/encauth/ocb3/ocb3_decrypt_verify_memory.c +++ b/src/encauth/ocb3/ocb3_decrypt_verify_memory.c @@ -51,8 +51,11 @@ int ocb3_decrypt_verify_memory(int cipher, /* default to zero */ *stat = 0; + /* limit taglen */ + taglen = MIN(taglen, MAXBLOCKSIZE); + /* allocate memory */ - buf = XMALLOC(MIN(taglen, MAXBLOCKSIZE)); + buf = XMALLOC(taglen); ocb = XMALLOC(sizeof(ocb3_state)); if (ocb == NULL || buf == NULL) { if (ocb != NULL) { From 6ac1c5fa34da03bde7e0f6e058f202343ff9666a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 7 Aug 2017 07:48:21 +0200 Subject: [PATCH 1015/1192] OCBv3: fix demos/timing failures --- demos/timing.c | 2 +- src/encauth/ocb3/ocb3_add_aad.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/demos/timing.c b/demos/timing.c index 1b74af947..670d2f71f 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -1273,7 +1273,7 @@ static void time_encmacs_(unsigned long MAC_SIZE) t_start(); t1 = t_read(); z = 16; - if ((err = ocb3_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 16, (unsigned char*)"", 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { + if ((err = ocb3_encrypt_authenticate_memory(cipher_idx, key, 16, IV, 15, (unsigned char*)"", 0, buf, MAC_SIZE*1024, buf, tag, &z)) != CRYPT_OK) { fprintf(stderr, "\nOCB3 error... %s\n", error_to_string(err)); exit(EXIT_FAILURE); } diff --git a/src/encauth/ocb3/ocb3_add_aad.c b/src/encauth/ocb3/ocb3_add_aad.c index 98a285de4..70e3211a9 100644 --- a/src/encauth/ocb3/ocb3_add_aad.c +++ b/src/encauth/ocb3/ocb3_add_aad.c @@ -54,11 +54,9 @@ int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen unsigned char *data; unsigned long datalen, l; - LTC_ARGCHK(ocb != NULL); - if (aad == NULL) LTC_ARGCHK(aadlen == 0); - if (aadlen == 0) LTC_ARGCHK(aad == NULL); - - if (aad == NULL || aadlen == 0) return CRYPT_OK; + LTC_ARGCHK(ocb != NULL); + if (aadlen == 0) return CRYPT_OK; + LTC_ARGCHK(aad != NULL); if (ocb->adata_buffer_bytes > 0) { l = ocb->block_len - ocb->adata_buffer_bytes; From 9f020b17df164cf1df31be7a43806917ccdf1296 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Aug 2017 15:00:37 +0200 Subject: [PATCH 1016/1192] limit malloc'ed data in eax_decrypt_verify_memory() --- src/encauth/eax/eax_decrypt_verify_memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/encauth/eax/eax_decrypt_verify_memory.c b/src/encauth/eax/eax_decrypt_verify_memory.c index 4de1a7fd0..8c6540fe3 100644 --- a/src/encauth/eax/eax_decrypt_verify_memory.c +++ b/src/encauth/eax/eax_decrypt_verify_memory.c @@ -55,6 +55,9 @@ int eax_decrypt_verify_memory(int cipher, /* default to zero */ *stat = 0; + /* limit taglen */ + taglen = MIN(taglen, MAXBLOCKSIZE); + /* allocate ram */ buf = XMALLOC(taglen); eax = XMALLOC(sizeof(*eax)); From 32355d04bbb8315165e87db10a41b8545d29ce61 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 1 Aug 2017 17:58:33 +0200 Subject: [PATCH 1017/1192] fix endianness detection for some versions of gcc This fixes #254 --- src/headers/tomcrypt_cfg.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 192a053d5..d4000d1e2 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -168,15 +168,17 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); /* endianness fallback */ #if !defined(ENDIAN_BIG) && !defined(ENDIAN_LITTLE) - #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \ + #if defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN || \ + defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \ defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || \ - defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN) || \ + defined(__BIG_ENDIAN__) || \ defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) #define ENDIAN_BIG - #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \ + #elif defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN || \ + defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \ defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || \ - defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN) || \ + defined(__LITTLE_ENDIAN__) || \ defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \ defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) #define ENDIAN_LITTLE From 7a59f71af83e8024a9b298cc5eb70ca016ef00e9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 1 Aug 2017 18:02:58 +0200 Subject: [PATCH 1018/1192] fix warning warning: 'ltc_asn1_type {aka enum ltc_asn1_type_}' is promoted to 'int' when passed through '...' type = va_arg(args, ltc_asn1_type); note: (so you should pass 'int' not 'ltc_asn1_type {aka enum ltc_asn1_type_}' to 'va_arg') note: if this code is reached, the program will abort --- src/pk/asn1/der/sequence/der_decode_sequence_multi.c | 4 ++-- src/pk/asn1/der/sequence/der_encode_sequence_multi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c index 4c943a766..1361b761b 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_multi.c @@ -39,7 +39,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) va_start(args, inlen); x = 0; for (;;) { - type = va_arg(args, ltc_asn1_type); + type = (ltc_asn1_type)va_arg(args, int); size = va_arg(args, unsigned long); data = va_arg(args, void*); LTC_UNUSED_PARAM(size); @@ -94,7 +94,7 @@ int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) va_start(args, inlen); x = 0; for (;;) { - type = va_arg(args, ltc_asn1_type); + type = (ltc_asn1_type)va_arg(args, int); size = va_arg(args, unsigned long); data = va_arg(args, void*); diff --git a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c index 0f3506e10..c1b40c775 100644 --- a/src/pk/asn1/der/sequence/der_encode_sequence_multi.c +++ b/src/pk/asn1/der/sequence/der_encode_sequence_multi.c @@ -40,7 +40,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) va_start(args, outlen); x = 0; for (;;) { - type = va_arg(args, ltc_asn1_type); + type = (ltc_asn1_type)va_arg(args, int); size = va_arg(args, unsigned long); data = va_arg(args, void*); LTC_UNUSED_PARAM(size); @@ -95,7 +95,7 @@ int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...) va_start(args, outlen); x = 0; for (;;) { - type = va_arg(args, ltc_asn1_type); + type = (ltc_asn1_type)va_arg(args, int); size = va_arg(args, unsigned long); data = va_arg(args, void*); From ac4687d88de01b8bb3fc8e07535dcaf1c2d1542d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 7 Aug 2017 16:18:15 +0200 Subject: [PATCH 1019/1192] also put LTC_TEST_DBG in crypt_build_settings --- src/misc/crypt/crypt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 9ba7108b2..ab378a5df 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -432,6 +432,9 @@ const char *crypt_build_settings = #if defined(LTC_TEST) " LTC_TEST " #endif +#if defined(LTC_TEST_DBG) + " " NAME_VALUE(LTC_TEST_DBG) " " +#endif #if defined(LTC_TEST_EXT) " LTC_TEST_EXT " #endif From 28ecdd5d12ac39fd21a9555e07b0b25c04996407 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 7 Aug 2017 16:33:38 +0200 Subject: [PATCH 1020/1192] minor improvements [skip ci] --- tests/test.c | 2 +- tests/tomcrypt_test.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test.c b/tests/test.c index 990404c5e..b8117584f 100644 --- a/tests/test.c +++ b/tests/test.c @@ -392,7 +392,7 @@ int main(int argc, char **argv) nop++; } else { - printf("failed %10.3fms", (double)(delta)/1000); + printf("failed (%s) %10.3fms", error_to_string(x), (double)(delta)/1000); fail++; } } diff --git a/tests/tomcrypt_test.h b/tests/tomcrypt_test.h index c2e4646a9..af5a0afe0 100644 --- a/tests/tomcrypt_test.h +++ b/tests/tomcrypt_test.h @@ -29,7 +29,7 @@ * this and so it's treated as an error and you have to comment out the * following statement :) */ -#error EXT_MATH_LIB is required to be defined +#error One of USE_LTM, USE_TFM, USE_GMP and EXT_MATH_LIB is required to be defined #endif #endif From 41130900d0917d875f329a1a445c6e1a0feb31c3 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 7 Aug 2017 17:28:49 +0200 Subject: [PATCH 1021/1192] fix 1. help-line of openssl-enc [skip ci] --- demos/openssl-enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/openssl-enc.c b/demos/openssl-enc.c index a306e73bc..211210170 100644 --- a/demos/openssl-enc.c +++ b/demos/openssl-enc.c @@ -91,7 +91,7 @@ union paddable { */ void barf(char *pname, char *err) { - printf("Usage: %s infile outfile [salt]\n", pname); + printf("Usage: %s infile outfile passphrase [salt]\n", pname); printf("\n"); printf(" # encrypts infile->outfile, random salt\n"); printf(" %s enc infile outfile \"passphrase\"\n", pname); From af63d0a55f90c5d4e9c31827cf8236567f65cfcd Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 7 Aug 2017 17:47:11 +0200 Subject: [PATCH 1022/1192] OCBv3: improved handling of taglen in ocb3_done --- src/encauth/ocb3/ocb3_done.c | 14 ++++++++------ src/encauth/ocb3/ocb3_init.c | 1 + src/encauth/ocb3/ocb3_test.c | 23 +++++++++++++++++++++++ src/headers/tomcrypt_mac.h | 1 + 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/encauth/ocb3/ocb3_done.c b/src/encauth/ocb3/ocb3_done.c index b6a63367b..b913d3a43 100644 --- a/src/encauth/ocb3/ocb3_done.c +++ b/src/encauth/ocb3/ocb3_done.c @@ -34,6 +34,12 @@ int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen) goto LBL_ERR; } + /* check taglen */ + if ((int)*taglen < ocb->tag_len) { + *taglen = (unsigned long)ocb->tag_len; + return CRYPT_BUFFER_OVERFLOW; + } + /* finalize AAD processing */ if (ocb->adata_buffer_bytes>0) { @@ -64,13 +70,9 @@ int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen) /* tag = tag ^ HASH(K, A) */ ocb3_int_xor_blocks(tmp, ocb->tag_part, ocb->aSum_current, ocb->block_len); - /* fix taglen if needed */ - if ((int)*taglen > ocb->block_len) { - *taglen = (unsigned long)ocb->block_len; - } - /* copy tag bytes */ - for(x=0; x<(int)*taglen; x++) tag[x] = tmp[x]; + for(x = 0; x < ocb->tag_len; x++) tag[x] = tmp[x]; + *taglen = (unsigned long)ocb->tag_len; err = CRYPT_OK; diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index 573fe152a..e89cd2493 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -118,6 +118,7 @@ int ocb3_init(ocb3_state *ocb, int cipher, if (taglen > (unsigned long)cipher_descriptor[cipher].block_length) { taglen = cipher_descriptor[cipher].block_length; } + ocb->tag_len = taglen; /* determine which polys to use */ ocb->block_len = cipher_descriptor[cipher].block_length; diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index 10d541944..a465b7fed 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -205,6 +205,7 @@ int ocb3_test(void) int err, x, idx, res; unsigned long len; unsigned char outct[MAXBLOCKSIZE], outtag[MAXBLOCKSIZE]; + ocb3_state ocb; /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { @@ -244,6 +245,8 @@ int ocb3_test(void) return CRYPT_FAIL_TESTVECTOR; } } + + /* RFC 7253 - test vector with a tag length of 96 bits - part 1 */ x = 99; len = 12; if ((err = ocb3_encrypt_authenticate_memory(idx, @@ -274,6 +277,26 @@ int ocb3_test(void) #endif return CRYPT_FAIL_TESTVECTOR; } + + /* RFC 7253 - test vector with a tag length of 96 bits - part 2 */ + x = 100; + if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; + if ((err = ocb3_add_aad(&ocb, A, sizeof(A))) != CRYPT_OK) return err; + if ((err = ocb3_encrypt(&ocb, P, 32, outct)) != CRYPT_OK) return err; + if ((err = ocb3_encrypt_last(&ocb, P+32, sizeof(P)-32, outct+32)) != CRYPT_OK) return err; + len = sizeof(outtag); /* intentionally more than 12 */ + if ((err = ocb3_done(&ocb, outtag, &len)) != CRYPT_OK) return err; + if (compare_testvector(outct, sizeof(P), C, sizeof(C), "OCB3 CT", x)) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(outtag, len, T, sizeof(T), "OCB3 Tag.enc", x)) return CRYPT_FAIL_TESTVECTOR; + if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; + if ((err = ocb3_add_aad(&ocb, A, sizeof(A))) != CRYPT_OK) return err; + if ((err = ocb3_decrypt(&ocb, C, 32, outct)) != CRYPT_OK) return err; + if ((err = ocb3_decrypt_last(&ocb, C+32, sizeof(C)-32, outct+32)) != CRYPT_OK) return err; + len = sizeof(outtag); /* intentionally more than 12 */ + if ((err = ocb3_done(&ocb, outtag, &len)) != CRYPT_OK) return err; + if (compare_testvector(outct, sizeof(C), P, sizeof(P), "OCB3 PT", x)) return CRYPT_FAIL_TESTVECTOR; + if (compare_testvector(outtag, len, T, sizeof(T), "OCB3 Tag.dec", x)) return CRYPT_FAIL_TESTVECTOR; + return CRYPT_OK; #endif /* LTC_TEST */ } diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 2a2a011a4..3fe431fae 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -266,6 +266,7 @@ typedef struct { symmetric_key key; /* scheduled key for cipher */ unsigned long block_index; /* index # for current data block */ int cipher, /* cipher idx */ + tag_len, /* length of tag */ block_len; /* length of block */ } ocb3_state; From f647baa77875f135fa965e305696dcac41f32ec3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 7 Aug 2017 18:14:19 +0200 Subject: [PATCH 1023/1192] OCBv3: ocb3_init taglen check --- src/encauth/ocb3/ocb3_init.c | 11 ++++++++--- src/encauth/ocb3/ocb3_test.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index e89cd2493..8e0e914db 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -114,9 +114,14 @@ int ocb3_init(ocb3_state *ocb, int cipher, return CRYPT_INVALID_ARG; } - /* Make sure taglen isn't too long */ - if (taglen > (unsigned long)cipher_descriptor[cipher].block_length) { - taglen = cipher_descriptor[cipher].block_length; + /* The blockcipher must have a 128-bit blocksize */ + if (cipher_descriptor[cipher].block_length != 16) { + return CRYPT_INVALID_ARG; + } + + /* The TAGLEN may be any value up to 128 (bits) */ + if (taglen > 16) { + return CRYPT_INVALID_ARG; } ocb->tag_len = taglen; diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index a465b7fed..bd3014400 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -215,7 +215,7 @@ int ocb3_test(void) } for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { - len = sizeof(outtag); + len = 16; /* must be the same as the required taglen */ if ((err = ocb3_encrypt_authenticate_memory(idx, key, sizeof(key), nonce, sizeof(nonce), From 9952fac68edd65c88b7bb6e6ebf545c83248dc4f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 7 Aug 2017 19:37:53 +0200 Subject: [PATCH 1024/1192] tv.txt contains errors from tv_gen --- .travis.yml | 1 + build.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6d35d6b2c..2334b6255 100644 --- a/.travis.yml +++ b/.travis.yml @@ -125,6 +125,7 @@ env: after_failure: - cat test_std.txt - cat test_err.txt + - cat tv.txt after_script: - cat gcc_1.txt diff --git a/build.sh b/build.sh index a86b0c59e..62d09c5d8 100755 --- a/build.sh +++ b/build.sh @@ -26,7 +26,7 @@ fi echo -n "testing..." if [ -a test ] && [ -f test ] && [ -x test ]; then - ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1) + ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt or tv.txt" && exit 1) if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then for f in *_tv.txt; do # check for lines starting with '<' ($f might be a subset of notes/$f) From 9139b59699e95c482ba79c6b0e696399ff85cba4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 7 Aug 2017 19:43:09 +0200 Subject: [PATCH 1025/1192] OCBv3: fix testvector generation --- demos/tv_gen.c | 6 +- notes/ocb3_tv.txt | 301 ++-------------------------------------------- 2 files changed, 11 insertions(+), 296 deletions(-) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 196c75664..9d07eba16 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -435,12 +435,12 @@ void ocb3_gen(void) kl = cipher_descriptor[x].block_length; /* skip ciphers which do not have 64 or 128 bit block sizes */ - if (kl != 8 && kl != 16) continue; + if (kl != 16) continue; if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) { kl = cipher_descriptor[x].max_key_length; } - fprintf(out, "OCB-%s (%d byte key)\n", cipher_descriptor[x].name, kl); + fprintf(out, "OCB3-%s (%d byte key)\n", cipher_descriptor[x].name, kl); /* the key */ for (z = 0; z < kl; z++) { @@ -459,7 +459,7 @@ void ocb3_gen(void) } len = 16; if ((err = ocb3_encrypt_authenticate_memory(x, key, kl, nonce, noncelen, (unsigned char*)"AAD", 3, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) { - printf("Error OCB'ing: %s\n", error_to_string(err)); + printf("Error OCB3'ing: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } fprintf(out, "%3d: ", y1); diff --git a/notes/ocb3_tv.txt b/notes/ocb3_tv.txt index 64df75fb4..8a867e2ce 100644 --- a/notes/ocb3_tv.txt +++ b/notes/ocb3_tv.txt @@ -2,7 +2,7 @@ OCB3 Test Vectors. Uses the 00010203...NN-1 pattern for nonce/plaintext/key. T are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous step repeated sufficiently. The nonce is fixed throughout. AAD is fixed to 3 bytes (ASCII) 'AAD'. -OCB-aes (16 byte key) +OCB3-aes (16 byte key) 0: , B314B579B54365D9094A8A7544FECFA7 1: F9, 3E49FF310B88634BACA91D55DFBAA185 2: 04B6, E13FBD06086CAEF7AD042C93D7BB6FB0 @@ -37,64 +37,7 @@ OCB-aes (16 byte key) 31: F2CF0958F00F11E8564CFFD9AEC71451344E2A35DE7D82D1AAC14649BCD34C, 04E97E02B50CFCC86EC0B9A958057F66 32: 914755B90B12CF5720CC0176AED145ADEC862E51B237AFE862477CF91D729768, EEDA6BE8E7875AA7E1E3393DE81FBAF7 -OCB-blowfish (8 byte key) - 0: , 6C3BBA12B543C3BE - 1: D6, D72F643440F08AC1 - 2: 8208, B7FD2E2D5FF4B273 - 3: BB2B8F, E6B6A023460F07B0 - 4: F2BC4A6C, 7B9D26784038A593 - 5: AAFDBD8EC2, 24E6F671E7A0D394 - 6: 929326B18E7F, 5C6CEAEF7B63DA71 - 7: 085C9A0013CB23, 2C0BA203FC706398 - 8: BA45E34414383ABD, E367DDFF2B9E7B51 - 9: 1287AE007E03F4B6B6, 6EDF52831D00F616 - 10: 2871B39ACFE7E8D7C326, 9ED4DB2D5ADBC902 - 11: 46DF7AAFBE096C26536BCC, 497B8F7930B03150 - 12: 7F794AD0A6673F9DD9BA09FB, 4B6817508EF74773 - 13: 138D1877D61021E526EFBB9F9C, 0E18238F3112C0F6 - 14: FFFF1DDC353F4C0F832C73D4C4F4, DCFCECFEE8B0BDE8 - 15: 5B8F209B6FBCCF323773CDE26B1ECD, BE11C1DA023F30F7 - 16: C3C1438B50A1124556164A38D12FEC6C, 532740AF7CB776B0 - -OCB-xtea (16 byte key) - 0: , D00F0AAB89FD2268 - 1: F4, 5EC48A975A5284D0 - 2: EA67, 4D7DDB44F00B1914 - 3: 19E6F3, 5DC77905DE7BCA27 - 4: 164F891A, E41BFD4F3D256B72 - 5: DD08DE502D, BB92537DED07B1D5 - 6: B176A93723F9, D6B5BBE9BD9DCC2F - 7: 9F0CBA46793F6B, 3936294EF1745B93 - 8: 04CC55A49B65D296, 4BAD576455149F19 - 9: 7D6FCB8FF28FFE7DF7, 40FEBD5048374447 - 10: E5B23D64643BE920B5DD, 7E980F9F6A1C1E24 - 11: 07D48D6A863286C485C169, 14FBE819A4E05066 - 12: 4DF565F388F75E453554CB98, BB63ABAE98B89A0D - 13: 3B839BF161A9A873C67D864412, FFBBE368571140CE - 14: 35D0E47C7B52F63D9CD52B5EF7C1, FBBE7080BE16A358 - 15: F657C137AD01E24A2E09EAE9669060, C61609D640AED997 - 16: 06BF9F739218FAF8469393E4A880401B, F1A833E2FF0F59D1 - -OCB-rc5 (8 byte key) - 0: , C8A6E737A8E6C157 - 1: D5, F9FC436713D8C578 - 2: A52B, 620A27B44F9DB42E - 3: AA4253, AC7574A061DBAC3E - 4: 3E9241AE, F5011F6F49F35AB7 - 5: FB39924246, C53004198FD2C046 - 6: 847A3249B1E8, 92B4300BE557D04F - 7: F8BC0AEC7A0DDC, 27CCDB48F5AC84AA - 8: 5A7A91DFBE572B10, 67D4775F5AA660F8 - 9: 475F7E67910AB33762, 2193ECC897A7E0A8 - 10: 8F7254CB03D427D123F3, 2814085372D28E3B - 11: 0669B3DF133675FDF0E6C4, BD2282F47C5AB17A - 12: D3041D4F0C79FBFE6155DAAD, 01228ED90A077F1E - 13: 2A46C3FEEDBF49B14520FB1786, AB61B06971BE04FE - 14: C3E5F4749B28E6C70263B9A49411, A0D06FCEC6F8C051 - 15: 5A307C6E510C7B7F0838B9FD3B3CC8, A7F7A41558848158 - 16: C2E2DD4DEF101AA2EF8696B9FDD24B03, 614D0606D5BC577E - -OCB-rc6 (16 byte key) +OCB3-rc6 (16 byte key) 0: , E55863F7B850CEA28023BA8E2AB1F4FD 1: E5, C1F5CEA421F84AECACF622BCE507BD21 2: 6443, FB3B7992E057AA4A0E31E8718093740B @@ -129,7 +72,7 @@ OCB-rc6 (16 byte key) 31: 80F7CA76B988519731D76C4D60DA0E5C77BEC17368C9B237AE60A910312334, 962C1F0C4E7C8137863A48E6E5BFA44B 32: 1B43CDD2D0E13ECAE95F2DE4782760679CDCCE5E74A3C3E6614BAD86DFE073EE, B5A6A14CA26E60AAC3B5C9DB0723ACE5 -OCB-safer+ (16 byte key) +OCB3-safer+ (16 byte key) 0: , 8F56A79150DEFC6B2CBB3FB6E359FBD2 1: C9, 8E316BB1D0C29B6D7A5A87099B85B72A 2: 2060, BC6DEBA562045204F685BD4AD1095614 @@ -164,7 +107,7 @@ OCB-safer+ (16 byte key) 31: 017E3A54463EDC279879A07FD7BFF1225CEE307BD8741B6013FE4C9A454EB8, 10449A44C1F90C64CCCA5D808AC705A5 32: DB9C895FF4A59D407344B8254FCD416F0D5EDB2ECB639CF226DEAA76370FB79D, CFE8C49CF0E323F694FAB1805A85DC93 -OCB-twofish (16 byte key) +OCB3-twofish (16 byte key) 0: , 924B3293251DA82CC6843F4616DAA68D 1: 01, 4B07AF17FF5D6C2477E90B7843F19D1B 2: 5CFF, 75BF06BF38FA2BEC8A3A546B9E29741E @@ -199,159 +142,7 @@ OCB-twofish (16 byte key) 31: 8726247FAEB21D7F8927DC3E90267ECD744A8452C64B9EBE08D1A590BFA1F9, 8D75DAEC7E4438E7C701A392346EBBF6 32: 0DC0EE528456FEC203AFB12A55A4D3A901B9408958E5387EB42E75730D98B6A6, D7D682F57C1E1671BE459EE33BEA6B26 -OCB-safer-k64 (8 byte key) - 0: , 60AE63AE99A88F09 - 1: 44, 0B3706AE0C2E2E1B - 2: FFC9, 2DE3EFEA9DA4E0B1 - 3: 9EDB9C, 3C6B708DDFAE78BD - 4: 4F411B9D, 7B5C8D7355207D99 - 5: 137EFBA977, 8F5A27A51F6360E4 - 6: 518F478CF00F, 5D9D0B18CF5A3441 - 7: 8ABF02E8C3B6E3, 2A9F38EC4EEE4B66 - 8: B46D658ED0580427, 154E306DA82C5B04 - 9: 97C857F1454868744F, 235006CFBF3746DC - 10: 75D9C1CED5E4A9D74B83, AD470CD821D5A3BB - 11: 8BD62F6A7984C86BBC5BC1, 44BFE38FC9B0E173 - 12: 3A7C8ECD7732D6546CCBC28F, 5ED6C3E7AFB1F896 - 13: 52C030D775D19B605CDFA5ADE4, 010FFFDAFF4868BF - 14: 6740280BFAD4A8844626BCCE6FB2, 80A60FD0D0A15DA7 - 15: F5B6DD3ED6612F59B8A073E3EC5033, 36F2EC985AB2C969 - 16: 02581A19286680A999FB9830DCB77BEC, 3015B26725FB9D53 - -OCB-safer-sk64 (8 byte key) - 0: , 2B5F164039EC1FF2 - 1: BD, 3072BD9737BB4DEC - 2: 71F3, C358816473A2C3F0 - 3: F370EA, 83F377FF988F1B51 - 4: 98565D32, FCA53CD3A9DABBCD - 5: EAB324F774, 421AF23FCAD01DCE - 6: C5B0814A9FEB, 9313C6B3088C3924 - 7: B2BE28DB8A7CE4, 4D01C1E7AA97B299 - 8: E410D82D4064AED0, 9BE40E1610857C31 - 9: 020B907AF549B78C87, 041F712E41020281 - 10: 340281F8C266EA8C7A32, 6ABE5616D2FA74EC - 11: BDC98894B81C6D27E1B68A, 0C04AC90EA1A9CA5 - 12: 8499598100F79CCB99658CC9, 80BF184C2A145C77 - 13: 225E9058E1E04C0094A7930951, DFF29FC9970FBE6E - 14: 2921DB3AA293E8EBCD1624227B63, 66C946BB38353006 - 15: 666A373BB8D5E705B7C6FB57366FFA, 9107520B8B727240 - 16: 99A7DEA8DB637CD1C92C814D3C1A64A2, 88086A2AB997BBDD - -OCB-safer-k128 (16 byte key) - 0: , 40A7E9B40AAC05E1 - 1: B1, C22564913F5A2BAD - 2: 95A1, FFA940A16367A92B - 3: 9B2C72, 13AA7AC4A229C17F - 4: 1F986AFF, 38FA204AD590363C - 5: 6D8575E1E4, 29C7A65AC4CB96E1 - 6: B66053304FBA, 90FDB74422EF97D2 - 7: 3AF64A001B7F6C, 00BE93CEA7F27105 - 8: 838E09F49FA3AC15, 74621705326B0B30 - 9: BAB2B85FAC5DC83489, 8AB828D9D6C23621 - 10: 3AEF47ED7CCDE4D085D6, 1DAE20BED85FC6EB - 11: 16B8926C2F2B591C16671E, 9059D39D4896E541 - 12: B7F7F74BC766AEC2C927E8D9, DD8CD0D361E458B1 - 13: DFC4F2CCCECE6C37BCDDDAB3E8, F43757F2561806A2 - 14: 981C89C0D2BC84D757733661FEBE, 2E6739D64A66F8A4 - 15: 71CAE38513289770E2144C85F86ECC, 7E6B772ACADBB5E5 - 16: C762E3C8CA8934312AD0FFA260AA21F3, 147F6D215719D80B - -OCB-safer-sk128 (16 byte key) - 0: , DBC0A566E43D78EB - 1: 7B, 0A5B7E6504D09E0D - 2: 93C6, F0965D809512F60C - 3: 371A02, 26C1101DFBD5B5B5 - 4: 9289CC21, 1DD5B6E7B434D085 - 5: 462F4E430E, 359A72726D607F77 - 6: 754822D87238, D2C3C36B578EDD54 - 7: ECD5B066CA1099, 43501B21F2F3B81A - 8: 0B5E88DFE1EA77AE, 02AB5CE6F21ACD13 - 9: 37B1F29B385FBC7719, C5C3276464EE75F2 - 10: 3DFDF3F96F069D16D073, 1B3815F5E66D9B16 - 11: D71B6574B09AF3E2892702, F23983243BA05358 - 12: 3FDF716461B02B1A800FBDAC, 76DC47B577DB0428 - 13: 2A401964D55907EC06AA5A865F, 48D2A85A1394C9D7 - 14: B92B44D7D203675484CBA922C7A5, 03CEC9B3F03FF6F6 - 15: CBE7F6D81C4FF6E0E7DDCFE4DC9865, 7DFE226E27765F3D - 16: 54D4EC026089660D0A5DCBA3C6096F27, 07E13D50E610167E - -OCB-rc2 (8 byte key) - 0: , 64AF97108168F222 - 1: 7A, 8D76828ABA00E9F2 - 2: 92B4, 46173CDD4000CF80 - 3: BDA76B, 418CBA55192C3C14 - 4: 39770C9B, ADDB0A3DE174E8BF - 5: 7DA3100250, 55CF46A530E296CC - 6: 1B685D542DAC, 414D5D3AA58B2D9F - 7: 6A1172A01FAE68, 707C8FFDC3A28162 - 8: 3643C5C11A14FA6C, 4340696B5CE9A559 - 9: DBABB16A1D908AB735, 7307611EC44A8CE2 - 10: DA209E874A3D0962826D, AA3119B1745C547A - 11: 2F4543B7EF467676601565, 3153CD137ECC8642 - 12: F7F776D30C833802C3B03EE9, B35BCE4DE7356F87 - 13: A19B3618727C8AD0071AA068BF, 137CAB9A02D34F23 - 14: B6B06B70CF74EE900BC8237D6C88, 8393EC248840E83E - 15: FF7316B644450C96A7FA19912282AE, 08231DF3DCAFB00A - 16: 018FBDF023323BBA7BECF9BCEC49C645, 3CBFF9B5F03F97F7 - -OCB-des (8 byte key) - 0: , ED4327DD4269EFF8 - 1: 9E, CF026B3E06459E45 - 2: 6695, EC7373BD53E08021 - 3: 2B162F, 2009ECBCCED951CC - 4: 6D2383BA, AB01479F7CA86837 - 5: EF7AF7B925, 6C499BB9C50F2867 - 6: 9A209AEEF740, ECD38B6E578E5BB6 - 7: 64A6847FBAB815, 04CCA3BD0B5A0E86 - 8: EF6E5AB10AFF4637, 6BA435083EB73B42 - 9: 9DF882164AC1093A6A, 6F675349AD4A5F0A - 10: 2A387714DF49F0B198CE, BF11D193B33332CF - 11: A22B9ACF695E509D7DACE0, 30AD5F8E9BEBAECD - 12: 6FE138F1AD18AD82566FA62D, DDE29234BADCB116 - 13: 5E999D45A65F1E7B8D6E23928A, B42126323E230103 - 14: 450ADBB95F5D30C4ED07EF5D61C6, C9AEF234D2A62D84 - 15: DA6EA48D2FD0CD148AF3C820B35D8F, 17EE5C13C4EF2230 - 16: 929440B304802E9963E645962D03311E, 3F70A65858B4CFFD - -OCB-3des (24 byte key) - 0: , AADB051E60C3120E - 1: 01, 20A7FE8C75FB9E6B - 2: 1F2C, C1E73FE3B49807B3 - 3: 18BA50, DD5049D65C6E3E41 - 4: 831F26C5, 29A93FC7BB7028E4 - 5: 0F2687749A, 5A17CDD57275D990 - 6: E859252FE864, B546B6CE8058E9C4 - 7: 45664737F4B25F, 9114205390E66F64 - 8: D05C5A3578EFCAAC, 7633784CDB458899 - 9: E4C51E2E306B4304DD, B13F8620AFB606B4 - 10: 69A5B1ED52EE639927BE, 01DF9CA135E1F0F8 - 11: 470473A317D7F261425751, 201A0B1E678D47F9 - 12: 835834F8FC21B8CB27D2E0B1, A48CD87F705E1816 - 13: 8CC41824101B5F330CE1109AE5, E68F62A44E2E15C8 - 14: 9EDE893B691E3E5A0322B8DABC7E, FB5997E400EEABDC - 15: 7E71195F9CD039D025A8A4F90E718F, 2B68E17F3B544A09 - 16: 1D217BA1D0F2FA051258E65E4FC7D60B, 089A17777546EA21 - -OCB-cast5 (8 byte key) - 0: , 77D9102CCB59F03F - 1: 65, DFB130E2B4B8CDCD - 2: 752F, 3C025A7E3B0C0677 - 3: A32F20, 9877D937F0078B1D - 4: 2721E6C8, 0F40ED1C23EFC71C - 5: 95C4269DCF, D2E25B933FE78F63 - 6: 8CB240723A3A, A6704E1218CA3CB6 - 7: CD2CA6456A5416, 99EA298978513F00 - 8: 95094FD229EB9EFB, 055771E04E1FE0B1 - 9: 052F37165BB7B31071, 00DA99C81DF5A15A - 10: 31B4551AD67991DAB505, B61C6F06889500A9 - 11: 1F9E4C34E96D8BCCD9AF55, 9D7A3D3C78D456A0 - 12: 856E2E4CD20DD9BE45E0CDED, 6FF332546BF351D8 - 13: 65C3B9E6ABEA205C75A43F2D18, B877EBC583A65589 - 14: E41F26A7F537A32B15DC6115E973, 4CF3710865E33BA6 - 15: 0AD880644E5BC87CB4D702F0074085, 60567AFD8C6D52BB - 16: 03C0CB1D2854BC9F286422E8BBFE4A36, EB10E5429866623E - -OCB-noekeon (16 byte key) +OCB3-noekeon (16 byte key) 0: , B23A40302652E204B694EA78AF5A8FCC 1: B1, 5245C8680A6F4520168B173A39661249 2: CE8C, 05763A489DF8B88DF01862007B2D6655 @@ -386,26 +177,7 @@ OCB-noekeon (16 byte key) 31: 17C5B1127E3D08737590EFB2FEB17562E7FDB4B21A768595ADDD9697CF9B46, 6F4BC0A033BE040350FF4958866BDEA0 32: 4667525E9B39821CF08E6C7A7E37A5020CE23F81DEF05932113E9A6B5B3F9BCF, 5C0350C6F7299192947EB22ED415B05C -OCB-skipjack (10 byte key) - 0: , 463C1E4DD1A03085 - 1: 44, 754EDDA8D5F6395F - 2: A91F, 19D6B04F49F65FF0 - 3: 8572D7, A97380A827EE921A - 4: 8B6A518C, 28F53D973490974E - 5: AE64F0C5AD, 3A01F1B733C27295 - 6: F9075088FDBC, 25B88A75E41E1181 - 7: 454FA7B9ADBD08, 27EAC47AECF83243 - 8: 658A1888D9405313, BDC5DA72A5B4A18E - 9: 5BBAC180FAA537AF97, 5BEE47690DB770C2 - 10: D5A1526B948F67F282ED, A5CC6F9F770B9B64 - 11: 6A51609E928064B6CC9B63, 9BFD9968FAD94974 - 12: B3C69893E260B791A9C3A843, 78685FFD8835AF00 - 13: CAA5800B6B5C50949F4EB8519B, 39AD309E4BFB47B0 - 14: 2B12D18B98AA3B3084837E2AF840, 920361326313A489 - 15: 0D2F21E3B3DB3D2B31B880459DDF22, 86307ADEB332A89C - 16: CD489F4272596715EC86B770D89BAA7D, 2006F5269A5D1C58 - -OCB-anubis (16 byte key) +OCB3-anubis (16 byte key) 0: , BAF3C352341E4E8F5E1FE11C9CB3E151 1: 1E, 01BAEEA2431B9106129937F135D46215 2: B586, AC89B511AC5F80B2E6F9E6BC96DDCE15 @@ -440,26 +212,7 @@ OCB-anubis (16 byte key) 31: 55AFBFA3A57B960AC0F8B3DAE6EA60165FF7D5A77731B05BCB7E8C647487AA, E25444D551A823650757DAAD8ED6B588 32: 5553F81F123EC0697C26B00BF20BE287C0A1E9C4035C8EB3036F6D58C8A3B83B, B7349CE03F264F816305A6D46C274980 -OCB-khazad (16 byte key) - 0: , 5C7E2DC1EDC4A2C3 - 1: A0, 261565EAA758EDE4 - 2: D9A3, DB69625E0A482236 - 3: 24FF77, EEDE8B25C54FD6FC - 4: E50379C7, 593CA74DED369316 - 5: B97E794387, C3B94E37EC8CC73D - 6: 97D5EA990145, 8A4E4D0EF6BD0D11 - 7: C99C82C3DE57A8, 05CFE7406F2CE99F - 8: 234CD0F6D7130A26, DDE441C5490AEB12 - 9: 92D4A7184BA6675978, E1581CE1444BE08E - 10: 8081C79F87CD727AD54F, 9A9A96082EC690FD - 11: E9D3A5084F343F1918B4A3, EFD4542587D3C5DC - 12: 03883C6376ECDF6920A13B10, F516CF01CD535DB6 - 13: 6F0561BDD4344CBD5FC4A97848, 20C8C8F2CFACB2FD - 14: 84471FFB6BBB222902E8AB2C352B, D119D45DBD7B7D22 - 15: AEBC54E4987FA01FA7EE237514D703, 7021FAEFC48DA692 - 16: E907A9DC08A3152106399AA178A2B445, E756B6BBE721A3CC - -OCB-seed (16 byte key) +OCB3-seed (16 byte key) 0: , A7D37A371F0B3596ACF3856B5D18B45E 1: 49, 3C671A1AFA5B253DD8FF67FFED9C33E4 2: B986, 2A069C4C6FF67FA6880D6EDA8490A3C6 @@ -494,45 +247,7 @@ OCB-seed (16 byte key) 31: 9DB58E1FEF922A4A1F99602710ABCA029E8A10383465C62967EB0A466F11AD, 08D4FF277C8DA53A2598201B255B7FD7 32: 1BD03BAB70BE842FDB12E49DEB04AE477335B0B3930E75A27C37EBB1594099E7, 3A6DEAE1C289763C4405DE86544DF401 -OCB-kasumi (16 byte key) - 0: , 85F676BFBCB7B036 - 1: 2D, BD6D4E9C82E5CA26 - 2: 724C, 2AA67DB029E78720 - 3: E762C3, 3217E72AF565E98F - 4: 5A14AF1F, 6DE5CCF42AE4372D - 5: 3FE0C9B5BC, 5E8CCCB96F1971A5 - 6: 647D9AE7286B, 1C53A14119C1A650 - 7: B1A5078D8E09BC, C2F46899E85A43EB - 8: 4AAEF1B9316A1D2A, 4ADBC39C6CD59480 - 9: 97C4036A9EDB69F305, 7AF592CAB645C899 - 10: 2F2EBFA927812C6F6FF9, AE0DEC9D2D8E5BB4 - 11: B98061CC8801BE7A640651, 2CC2F1BBF418C4BF - 12: 9EE7742DBA13B66994FC5C53, BE6A9A6EDD45914C - 13: D1DBCFEEE8F2F5E94F74774CCE, 6D9377693CD38F8A - 14: 7D8C7B966FDAB2C4027220C77CAD, 8AF85A125D36D09C - 15: B254AE0DFA35531477D50906C695DC, 4FE0519983397BB0 - 16: 223FB914E44BE1755D94F963BF701F90, 0C8D07BAA2D66E4E - -OCB-multi2 (40 byte key) - 0: , EA28ABA0D6F4E490 - 1: F7, 951E5C33632C1B2E - 2: FD2B, 1C5912FD3190C3B1 - 3: 6AD41D, 38D5D04491483BE4 - 4: 611E46CD, 2B4C4AA96B9D4DE8 - 5: E2E52662AE, 24BC447CFACF4EA5 - 6: D3BEA1AD5905, AE39AC799F3BFAE5 - 7: 67FF55F2B4C49D, 426ECF9B4FAEB310 - 8: D823598A47C17669, 662829935E1DC1B2 - 9: CC194A8DF3491A595B, 559D45F5E4029FCF - 10: B51207427B00FCEBCA20, 806928EDDDCAAF67 - 11: 95AD2F304AA91A0521BCF8, 0DD36DC4BFECE04B - 12: 13999C2A8C566FE58AFFC34E, 7D2943749BC160F3 - 13: FEF35288E697EC0B96ED7351EE, 5999E5EAD14F635D - 14: 02DFF262D43C7796030F68DBDDE4, D6EEC27981EA7FD2 - 15: D70DF509F5A6ED361C96F7B59C5F0A, 4B3F0ECE9E727DF4 - 16: 966600DC680F216DB2591654161C51F2, 2F9985210161A9FE - -OCB-camellia (16 byte key) +OCB3-camellia (16 byte key) 0: , DFF7EA9ECD4E2AD37B9838E85F9D36EB 1: 1B, D5D37222F530EA2C282A4D8BC55A08EA 2: B73C, 5163F4BD7CBC03DA1B31C7C1105B5511 From a65cfb8dbe4f186aeb2514b504892236c448bef5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 7 Aug 2017 21:11:42 +0200 Subject: [PATCH 1026/1192] make it possible to 'make all' w/o an MPI provider --- demos/timing.c | 23 ++++++++++++++--------- tests/der_test.c | 2 +- tests/dh_test.c | 2 +- tests/dsa_test.c | 2 +- tests/ecc_test.c | 2 +- tests/katja_test.c | 2 +- tests/mpi_test.c | 2 +- tests/pkcs_1_eme_test.c | 2 +- tests/pkcs_1_emsa_test.c | 2 +- tests/pkcs_1_oaep_test.c | 2 +- tests/pkcs_1_pss_test.c | 2 +- tests/rsa_test.c | 2 +- tests/test.c | 20 ++++++++++++++++---- tests/tomcrypt_test.h | 15 +++++---------- 14 files changed, 46 insertions(+), 34 deletions(-) diff --git a/demos/timing.c b/demos/timing.c index 670d2f71f..272b89689 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -520,8 +520,11 @@ static void time_hash(void) } /*#warning you need an mp_rand!!!*/ -#ifndef USE_LTM +#if !defined(USE_LTM) && !defined(USE_TFM) && !defined(USE_GMP) && !defined(EXT_MATH_LIB) #undef LTC_MPI + #undef LTC_TEST_MPI +#else + #define LTC_TEST_MPI #endif #ifdef LTC_MPI @@ -642,7 +645,7 @@ static void time_prng(void) } } -#ifdef LTC_MDSA +#if defined(LTC_MDSA) && defined(LTC_TEST_MPI) /* time various DSA operations */ static void time_dsa(void) { @@ -695,7 +698,7 @@ static void time_dsa(void) { fprintf(stderr, "NO DSA\n"); } #endif -#ifdef LTC_MRSA +#if defined(LTC_MRSA) && defined(LTC_TEST_MPI) /* time various RSA operations */ static void time_rsa(void) { @@ -819,7 +822,7 @@ static void time_rsa(void) static void time_rsa(void) { fprintf(stderr, "NO RSA\n"); } #endif -#ifdef LTC_MKAT +#if defined(LTC_MKAT) && defined(LTC_TEST_MPI) /* time various KAT operations */ static void time_katja(void) { @@ -889,7 +892,7 @@ static void time_katja(void) static void time_katja(void) { fprintf(stderr, "NO Katja\n"); } #endif -#ifdef LTC_MDH +#if defined(LTC_MDH) && defined(LTC_TEST_MPI) /* time various DH operations */ static void time_dh(void) { @@ -926,7 +929,7 @@ static void time_dh(void) static void time_dh(void) { fprintf(stderr, "NO DH\n"); } #endif -#ifdef LTC_MECC +#if defined(LTC_MECC) && defined(LTC_TEST_MPI) /* time various ECC operations */ static void time_ecc(void) { @@ -1427,9 +1430,11 @@ register_all_prngs(); ltc_mp = tfm_desc; #elif defined(USE_GMP) ltc_mp = gmp_desc; -#else - extern ltc_math_descriptor EXT_MATH_LIB; - ltc_mp = EXT_MATH_LIB; +#elif defined(EXT_MATH_LIB) + { + extern ltc_math_descriptor EXT_MATH_LIB; + ltc_mp = EXT_MATH_LIB; + } #endif if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) { diff --git a/tests/der_test.c b/tests/der_test.c index 9d53d6e82..9b21b2614 100644 --- a/tests/der_test.c +++ b/tests/der_test.c @@ -11,7 +11,7 @@ #include #endif -#ifndef LTC_DER +#if !defined(LTC_DER) || !defined(LTC_TEST_MPI) int der_test(void) { diff --git a/tests/dh_test.c b/tests/dh_test.c index 4ef15a9e6..5feca2186 100644 --- a/tests/dh_test.c +++ b/tests/dh_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_MDH +#if defined(LTC_MDH) && defined(LTC_TEST_MPI) #ifdef LTC_DH4096 #define KEYSIZE 4096 diff --git a/tests/dsa_test.c b/tests/dsa_test.c index f1d8ecf20..c21e38277 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_MDSA +#if defined(LTC_MDSA) && defined(LTC_TEST_MPI) /* This is the private key from test_dsa.key */ static const unsigned char openssl_priv_dsa[] = { diff --git a/tests/ecc_test.c b/tests/ecc_test.c index da981c34a..a68fc31e3 100644 --- a/tests/ecc_test.c +++ b/tests/ecc_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_MECC +#if defined(LTC_MECC) && defined(LTC_TEST_MPI) static unsigned int sizes[] = { #ifdef LTC_ECC112 diff --git a/tests/katja_test.c b/tests/katja_test.c index 0e95bd87c..ef9b27ff6 100644 --- a/tests/katja_test.c +++ b/tests/katja_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_MKAT +#if defined(LTC_MKAT) && defined(LTC_TEST_MPI) int katja_test(void) { diff --git a/tests/mpi_test.c b/tests/mpi_test.c index a5e216128..c635d1a06 100644 --- a/tests/mpi_test.c +++ b/tests/mpi_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_MPI +#if defined(LTC_MPI) && defined(LTC_TEST_MPI) static int _radix_to_bin_test(void) { /* RADIX 16 */ diff --git a/tests/pkcs_1_eme_test.c b/tests/pkcs_1_eme_test.c index 8926cf3c4..79ea4daf2 100644 --- a/tests/pkcs_1_eme_test.c +++ b/tests/pkcs_1_eme_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_PKCS_1 +#if defined(LTC_PKCS_1) && defined(LTC_TEST_MPI) #include "../notes/rsa-testvectors/pkcs1v15crypt-vectors.c" diff --git a/tests/pkcs_1_emsa_test.c b/tests/pkcs_1_emsa_test.c index 953ac22ba..1b22e43f1 100644 --- a/tests/pkcs_1_emsa_test.c +++ b/tests/pkcs_1_emsa_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_PKCS_1 +#if defined(LTC_PKCS_1) && defined(LTC_TEST_MPI) #include "../notes/rsa-testvectors/pkcs1v15sign-vectors.c" diff --git a/tests/pkcs_1_oaep_test.c b/tests/pkcs_1_oaep_test.c index b6bd3023a..84e55208f 100644 --- a/tests/pkcs_1_oaep_test.c +++ b/tests/pkcs_1_oaep_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_PKCS_1 +#if defined(LTC_PKCS_1) && defined(LTC_TEST_MPI) #include "../notes/rsa-testvectors/oaep-vect.c" diff --git a/tests/pkcs_1_pss_test.c b/tests/pkcs_1_pss_test.c index 5c9ccc461..2bf42b698 100644 --- a/tests/pkcs_1_pss_test.c +++ b/tests/pkcs_1_pss_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_PKCS_1 +#if defined(LTC_PKCS_1) && defined(LTC_TEST_MPI) #include "../notes/rsa-testvectors/pss-vect.c" diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 998ec84e3..241732970 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -8,7 +8,7 @@ */ #include -#ifdef LTC_MRSA +#if defined(LTC_MRSA) && defined(LTC_TEST_MPI) #define RSA_MSGSIZE 78 diff --git a/tests/test.c b/tests/test.c index b8117584f..3cac645c7 100644 --- a/tests/test.c +++ b/tests/test.c @@ -313,12 +313,24 @@ int main(int argc, char **argv) #elif defined(USE_GMP) ltc_mp = gmp_desc; printf("math provider = gnump\n"); -#else - extern ltc_math_descriptor EXT_MATH_LIB; - ltc_mp = EXT_MATH_LIB; - printf("math provider = EXT_MATH_LIB\n"); +#elif defined(EXT_MATH_LIB) + { + extern ltc_math_descriptor EXT_MATH_LIB; + ltc_mp = EXT_MATH_LIB; + } + +#define NAME_VALUE(s) #s"="NAME(s) +#define NAME(s) #s + printf("math provider = %s\n", NAME_VALUE(EXT_MATH_LIB)); +#undef NAME_VALUE +#undef NAME + #endif +#ifdef LTC_TEST_MPI printf("MP_DIGIT_BIT = %d\n", MP_DIGIT_BIT); +#else + printf("NO math provider selected, all tests requiring MPI were disabled and will 'nop'\n"); +#endif #ifdef LTC_PTHREAD diff --git a/tests/tomcrypt_test.h b/tests/tomcrypt_test.h index af5a0afe0..bc1e02b2e 100644 --- a/tests/tomcrypt_test.h +++ b/tests/tomcrypt_test.h @@ -16,21 +16,16 @@ #ifdef USE_LTM /* Use libtommath as MPI provider */ +#define LTC_TEST_MPI #elif defined(USE_TFM) /* Use tomsfastmath as MPI provider */ +#define LTC_TEST_MPI #elif defined(USE_GMP) /* Use GNU Multiple Precision Arithmetic Library as MPI provider */ -#else +#define LTC_TEST_MPI +#elif defined(EXT_MATH_LIB) /* The user must define his own MPI provider! */ -#ifndef EXT_MATH_LIB -/* - * Yes, you're right, you could also name your instance of the MPI provider - * "EXT_MATH_LIB" and you wouldn't need to define it, but most users won't do - * this and so it's treated as an error and you have to comment out the - * following statement :) - */ -#error One of USE_LTM, USE_TFM, USE_GMP and EXT_MATH_LIB is required to be defined -#endif +#define LTC_TEST_MPI #endif typedef struct { From c29c9f140daa9567d036d6638a4b780dca11d717 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Aug 2017 08:47:58 +0200 Subject: [PATCH 1027/1192] disable DSA4096 timing tests when building for TFM this fixes #260 --- demos/timing.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demos/timing.c b/demos/timing.c index 272b89689..2bb6e6c2c 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -660,7 +660,9 @@ static const struct { { 20, 128 }, { 24, 192 }, { 28, 256 }, -{ 32, 512 } +#ifndef TFM_DESC +{ 32, 512 }, +#endif }; for (x = 0; x < (sizeof(groups)/sizeof(groups[0])); x++) { From 65dc00e23a2c85cb204b59f9777032891ca2a4fa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Aug 2017 19:05:59 +0200 Subject: [PATCH 1028/1192] align HASH_PROCESS() macro --- src/headers/tomcrypt_hash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index 8286f4190..cbd9d7c88 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -497,7 +497,7 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen) if (md-> state_var .curlen > sizeof(md-> state_var .buf)) { \ return CRYPT_INVALID_ARG; \ } \ - if ((md-> state_var .length + inlen) < md-> state_var .length) { \ + if ((md-> state_var .length + inlen) < md-> state_var .length) { \ return CRYPT_HASH_OVERFLOW; \ } \ while (inlen > 0) { \ @@ -510,7 +510,7 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen) inlen -= block_size; \ } else { \ n = MIN(inlen, (block_size - md-> state_var .curlen)); \ - XMEMCPY(md-> state_var .buf + md-> state_var.curlen, in, (size_t)n); \ + XMEMCPY(md-> state_var .buf + md-> state_var.curlen, in, (size_t)n); \ md-> state_var .curlen += n; \ in += n; \ inlen -= n; \ From 0286b36ad61b66c1639fdb275db54017a89cf035 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 9 Aug 2017 09:44:12 +0200 Subject: [PATCH 1029/1192] fix doxygen warnings (as mentioned in #228) [skip ci] --- src/encauth/chachapoly/chacha20poly1305_setiv.c | 2 +- src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c | 2 +- src/encauth/ocb3/ocb3_init.c | 9 ++------- src/mac/blake2/blake2bmac.c | 1 + src/mac/blake2/blake2bmac_memory_multi.c | 4 ++-- src/mac/blake2/blake2smac.c | 1 + src/mac/blake2/blake2smac_memory_multi.c | 4 ++-- src/mac/poly1305/poly1305.c | 4 ++-- src/mac/poly1305/poly1305_memory_multi.c | 4 ++-- src/math/tfm_desc.c | 2 +- .../der/sequence/der_decode_subject_public_key_info.c | 2 +- .../der/sequence/der_encode_subject_public_key_info.c | 2 +- src/prngs/chacha20.c | 2 +- src/prngs/rc4.c | 2 +- src/prngs/sober128.c | 2 +- src/stream/chacha/chacha_ivctr32.c | 2 +- src/stream/chacha/chacha_ivctr64.c | 2 +- src/stream/sober128/sober128.c | 4 ++-- 18 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/encauth/chachapoly/chacha20poly1305_setiv.c b/src/encauth/chachapoly/chacha20poly1305_setiv.c index 2047143fb..b87666e24 100644 --- a/src/encauth/chachapoly/chacha20poly1305_setiv.c +++ b/src/encauth/chachapoly/chacha20poly1305_setiv.c @@ -15,7 +15,7 @@ Set IV + counter data to the ChaCha20Poly1305 state and reset the context @param st The ChaCha20Poly1305 state @param iv The IV data to add - @param inlen The length of the IV (must be 12 or 8) + @param ivlen The length of the IV (must be 12 or 8) @return CRYPT_OK on success */ int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen) diff --git a/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c b/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c index f207f014e..7136a1ee7 100644 --- a/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c +++ b/src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.c @@ -15,7 +15,7 @@ Set IV + counter data (with RFC7905-magic) to the ChaCha20Poly1305 state and reset the context @param st The ChaCha20Poly1305 state @param iv The IV data to add - @param inlen The length of the IV (must be 12 or 8) + @param ivlen The length of the IV (must be 12 or 8) @param sequence_number 64bit sequence number which is incorporated into IV as described in RFC7905 @return CRYPT_OK on success */ diff --git a/src/encauth/ocb3/ocb3_init.c b/src/encauth/ocb3/ocb3_init.c index 8e0e914db..a3cabae8b 100644 --- a/src/encauth/ocb3/ocb3_init.c +++ b/src/encauth/ocb3/ocb3_init.c @@ -15,12 +15,6 @@ #ifdef LTC_OCB3_MODE -/** - Sets 'ocb->Offset_current' to 'Offset_0' value (internal function) - @param ocb The OCB state - @param nonce The session nonce - @param noncelen The length of the session nonce (octets) -*/ static void _ocb3_int_calc_offset_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen, unsigned long taglen) { int x, y, bottom; @@ -87,7 +81,8 @@ static const struct { @param key The secret key @param keylen The length of the secret key (octets) @param nonce The session nonce - @param noncelen The length of the session nonce (octets) + @param noncelen The length of the session nonce (octets, up to 15) + @param taglen The length of the tag (octets, up to 16) @return CRYPT_OK if successful */ int ocb3_init(ocb3_state *ocb, int cipher, diff --git a/src/mac/blake2/blake2bmac.c b/src/mac/blake2/blake2bmac.c index e3d53c5ab..1c80b1c0a 100644 --- a/src/mac/blake2/blake2bmac.c +++ b/src/mac/blake2/blake2bmac.c @@ -14,6 +14,7 @@ /** Initialize an BLAKE2B MAC context. @param st The BLAKE2B MAC state + @param outlen The size of the MAC output (octets) @param key The secret key @param keylen The length of the secret key (octets) @return CRYPT_OK if successful diff --git a/src/mac/blake2/blake2bmac_memory_multi.c b/src/mac/blake2/blake2bmac_memory_multi.c index 2ce9e1cd7..2b875d7fa 100644 --- a/src/mac/blake2/blake2bmac_memory_multi.c +++ b/src/mac/blake2/blake2bmac_memory_multi.c @@ -16,8 +16,8 @@ BLAKE2B MAC multiple blocks of memory to produce the authentication tag @param key The secret key @param keylen The length of the secret key (octets) - @param out [out] Destination of the authentication tag - @param outlen [in/out] Max size and resulting size of authentication tag + @param mac [out] Destination of the authentication tag + @param maclen [in/out] Max size and resulting size of authentication tag @param in The data to BLAKE2B MAC @param inlen The length of the data to BLAKE2B MAC (octets) @param ... tuples of (data,len) pairs to BLAKE2B MAC, terminated with a (NULL,x) (x=don't care) diff --git a/src/mac/blake2/blake2smac.c b/src/mac/blake2/blake2smac.c index 14022614b..080241b75 100644 --- a/src/mac/blake2/blake2smac.c +++ b/src/mac/blake2/blake2smac.c @@ -14,6 +14,7 @@ /** Initialize an BLAKE2S MAC context. @param st The BLAKE2S MAC state + @param outlen The size of the MAC output (octets) @param key The secret key @param keylen The length of the secret key (octets) @return CRYPT_OK if successful diff --git a/src/mac/blake2/blake2smac_memory_multi.c b/src/mac/blake2/blake2smac_memory_multi.c index 9947b7cb3..0985c428f 100644 --- a/src/mac/blake2/blake2smac_memory_multi.c +++ b/src/mac/blake2/blake2smac_memory_multi.c @@ -16,8 +16,8 @@ BLAKE2S MAC multiple blocks of memory to produce the authentication tag @param key The secret key @param keylen The length of the secret key (octets) - @param out [out] Destination of the authentication tag - @param outlen [in/out] Max size and resulting size of authentication tag + @param mac [out] Destination of the authentication tag + @param maclen [in/out] Max size and resulting size of authentication tag @param in The data to BLAKE2S MAC @param inlen The length of the data to BLAKE2S MAC (octets) @param ... tuples of (data,len) pairs to BLAKE2S MAC, terminated with a (NULL,x) (x=don't care) diff --git a/src/mac/poly1305/poly1305.c b/src/mac/poly1305/poly1305.c index e505f58c1..f709f7205 100644 --- a/src/mac/poly1305/poly1305.c +++ b/src/mac/poly1305/poly1305.c @@ -164,8 +164,8 @@ int poly1305_process(poly1305_state *st, const unsigned char *in, unsigned long /** Terminate a POLY1305 session @param st The POLY1305 state - @param out [out] The destination of the POLY1305 authentication tag - @param outlen [in/out] The max size and resulting size of the POLY1305 authentication tag + @param mac [out] The destination of the POLY1305 authentication tag + @param maclen [in/out] The max size and resulting size of the POLY1305 authentication tag @return CRYPT_OK if successful */ int poly1305_done(poly1305_state *st, unsigned char *mac, unsigned long *maclen) diff --git a/src/mac/poly1305/poly1305_memory_multi.c b/src/mac/poly1305/poly1305_memory_multi.c index d6e136bb2..f22f25531 100644 --- a/src/mac/poly1305/poly1305_memory_multi.c +++ b/src/mac/poly1305/poly1305_memory_multi.c @@ -21,8 +21,8 @@ POLY1305 multiple blocks of memory to produce the authentication tag @param key The secret key @param keylen The length of the secret key (octets) - @param out [out] Destination of the authentication tag - @param outlen [in/out] Max size and resulting size of authentication tag + @param mac [out] Destination of the authentication tag + @param maclen [in/out] Max size and resulting size of authentication tag @param in The data to POLY1305 @param inlen The length of the data to POLY1305 (octets) @param ... tuples of (data,len) pairs to POLY1305, terminated with a (NULL,x) (x=don't care) diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index 66d0ddbeb..2a5a57d96 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -538,7 +538,7 @@ static int tfm_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulu @param Q The point to add @param R [out] The destination of the double @param modulus The modulus of the field the ECC curve is in - @param mp The "b" value from montgomery_setup() + @param Mp The "b" value from montgomery_setup() @return CRYPT_OK on success */ static int tfm_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *Mp) diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 8923fce3e..2d865a350 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -31,7 +31,7 @@ @param algorithm One out of the enum #public_key_algorithms @param public_key The buffer for the public key @param public_key_len [in/out] The length of the public key buffer and the written length - @param parameters_type The parameters' type out of the enum #ltc_asn1_type + @param parameters_type The parameters' type out of the enum ltc_asn1_type @param parameters The parameters to include @param parameters_len The number of parameters to include @return CRYPT_OK on success diff --git a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c index 8b151ca67..2ce8bd1e7 100644 --- a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c @@ -32,7 +32,7 @@ @param algorithm One out of the enum #public_key_algorithms @param public_key The buffer for the public key @param public_key_len The length of the public key buffer - @param parameters_type The parameters' type out of the enum #ltc_asn1_type + @param parameters_type The parameters' type out of the enum ltc_asn1_type @param parameters The parameters to include @param parameters_len The number of parameters to include @return CRYPT_OK on success diff --git a/src/prngs/chacha20.c b/src/prngs/chacha20.c index 372f6416a..ac1f8a240 100644 --- a/src/prngs/chacha20.c +++ b/src/prngs/chacha20.c @@ -31,7 +31,7 @@ const struct ltc_prng_descriptor chacha20_prng_desc = /** Start the PRNG - @param prng[out] The PRNG state to initialize + @param prng The PRNG state to initialize @return CRYPT_OK if successful */ int chacha20_prng_start(prng_state *prng) diff --git a/src/prngs/rc4.c b/src/prngs/rc4.c index 6fabe4166..5ae91c4fe 100644 --- a/src/prngs/rc4.c +++ b/src/prngs/rc4.c @@ -9,7 +9,7 @@ #include "tomcrypt.h" /** - @file rc4.c + @file prngs/rc4.c RC4 PRNG, Tom St Denis */ diff --git a/src/prngs/sober128.c b/src/prngs/sober128.c index c05ce3b92..00b1d617d 100644 --- a/src/prngs/sober128.c +++ b/src/prngs/sober128.c @@ -10,7 +10,7 @@ #include "tomcrypt.h" /** - @file sober128.c + @file prngs/sober128.c Implementation of SOBER-128 by Tom St Denis. Based on s128fast.c reference code supplied by Greg Rose of QUALCOMM. */ diff --git a/src/stream/chacha/chacha_ivctr32.c b/src/stream/chacha/chacha_ivctr32.c index b8b915735..c9a6dbb53 100644 --- a/src/stream/chacha/chacha_ivctr32.c +++ b/src/stream/chacha/chacha_ivctr32.c @@ -20,7 +20,7 @@ Set IV + counter data to the ChaCha state @param st The ChaCha20 state @param iv The IV data to add - @param inlen The length of the IV (must be 12) + @param ivlen The length of the IV (must be 12) @param counter 32bit (unsigned) initial counter value @return CRYPT_OK on success */ diff --git a/src/stream/chacha/chacha_ivctr64.c b/src/stream/chacha/chacha_ivctr64.c index 870fd8443..643d11fee 100644 --- a/src/stream/chacha/chacha_ivctr64.c +++ b/src/stream/chacha/chacha_ivctr64.c @@ -20,7 +20,7 @@ Set IV + counter data to the ChaCha state @param st The ChaCha20 state @param iv The IV data to add - @param inlen The length of the IV (must be 8) + @param ivlen The length of the IV (must be 8) @param counter 64bit (unsigned) initial counter value @return CRYPT_OK on success */ diff --git a/src/stream/sober128/sober128.c b/src/stream/sober128/sober128.c index 5e1ca461e..4d002d5e4 100644 --- a/src/stream/sober128/sober128.c +++ b/src/stream/sober128/sober128.c @@ -9,7 +9,7 @@ #include "tomcrypt.h" /** - @file sober128.c + @file stream/sober128/sober128.c Implementation of SOBER-128 by Tom St Denis. Based on s128fast.c reference code supplied by Greg Rose of QUALCOMM. */ @@ -203,7 +203,7 @@ int sober128_stream_setup(sober128_state *c, const unsigned char *key, unsigned Set IV to the Sober128 state @param c The Sober12820 state @param iv The IV data to add - @param inlen The length of the IV (must be 12) + @param ivlen The length of the IV (must be 12) @return CRYPT_OK on success */ int sober128_stream_setiv(sober128_state *c, const unsigned char *iv, unsigned long ivlen) From b5ab8ec811e305548c364d5047fe68eba4c0c6c2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 9 Aug 2017 14:20:32 +0200 Subject: [PATCH 1030/1192] update README.md a bit [skip ci] --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 8814a10cc..27a134d8d 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,16 @@ Patch integration will be faster if tests and documentation are included. Please update the makefiles in a separate commit. To update them simply run the `updatemakes.sh` script. +If you have something bigger to submit, feel free to contact us beforehand. +Then we can give you write access to this repo, so you can open your PR based on this repo +and we can easier follow the rebase-before-merge approach we're using (or even do the rebase ourself). + +### Reviews + +We're using Pull Request reviews to make sure that the code is in line with the existing code base. + +Please have a look [here](https://help.github.com/articles/approving-a-pull-request-with-required-reviews/) to get an idea of the approach. + ## Branches Please be aware, that all branches besides _master_ and _develop_ __can__ and __will be__ force-pushed, rebased and/or removed! From b79ae63408c4e9d3414e3ee8a78b3ecf137411b4 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 8 Aug 2017 00:12:55 +0200 Subject: [PATCH 1031/1192] add missing items to crypt_sizes --- src/misc/crypt/crypt_sizes.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 4b3d07751..45f029c2c 100644 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -180,6 +180,15 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_PMAC _SZ_STRINGIFY_T(pmac_state), #endif +#ifdef LTC_POLY1305 + _SZ_STRINGIFY_T(poly1305_state), +#endif +#ifdef LTC_BLAKE2SMAC + _SZ_STRINGIFY_T(blake2smac_state), +#endif +#ifdef LTC_BLAKE2BMAC + _SZ_STRINGIFY_T(blake2bmac_state), +#endif #ifdef LTC_XCBC _SZ_STRINGIFY_T(xcbc_state), #endif @@ -189,6 +198,9 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_OCB3_MODE _SZ_STRINGIFY_T(ocb3_state), #endif +#ifdef LTC_CHACHA20POLY1305_MODE + _SZ_STRINGIFY_T(chacha20poly1305_state), +#endif #ifdef LTC_GCM_MODE _SZ_STRINGIFY_T(gcm_state), #endif @@ -196,10 +208,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(eax_state), #endif #ifdef LTC_CCM_MODE -/* not defined */ -#endif -#ifdef LRW_MODE -/* not defined */ + _SZ_STRINGIFY_T(ccm_state), #endif /* asymmetric keys */ @@ -242,6 +251,16 @@ static const crypt_size _crypt_sizes[] = { /* sprng has no state as it uses other potentially available sources */ /* like /dev/random. See Developers Guide for more info. */ +#ifdef LTC_SOBER128_STREAM + _SZ_STRINGIFY_T(sober128_state), +#endif +#ifdef LTC_RC4_STREAM + _SZ_STRINGIFY_T(rc4_state), +#endif +#ifdef LTC_CHACHA + _SZ_STRINGIFY_T(chacha_state), +#endif + #ifdef LTC_ADLER32 _SZ_STRINGIFY_T(adler32_state), #endif From 9f02fde06eb2cbf21999e5632c46b083c7c7a717 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Aug 2017 10:27:21 +0200 Subject: [PATCH 1032/1192] improve sizes demo a bit --- demos/sizes.c | 78 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 22 deletions(-) diff --git a/demos/sizes.c b/demos/sizes.c index bc3f8a5f5..c2c07ef66 100644 --- a/demos/sizes.c +++ b/demos/sizes.c @@ -6,8 +6,14 @@ * The library is free for all purposes without any express * guarantee it works. */ + #include "tomcrypt.h" +#if _POSIX_C_SOURCE >= 200112L +#include +#else +#define basename(x) x +#endif /** @file demo_crypt_sizes.c @@ -15,29 +21,57 @@ like Python - Larry Bugbee, February 2013 */ +static void _print_line(const char* cmd, const char* desc) +{ + printf(" %-16s - %s\n", cmd, desc); +} + +int main(int argc, char **argv) +{ + if (argc == 1) { + /* given a specific size name, get and print its size */ + char name[] = "ltc_hash_descriptor"; + unsigned int size; + char *sizes_list; + unsigned int sizes_list_len; + if (crypt_get_size(name, &size) != 0) exit(EXIT_FAILURE); + printf("\n size of '%s' is %u \n\n", name, size); + + /* get and print the length of the names (and sizes) list */ + if (crypt_list_all_sizes(NULL, &sizes_list_len) != 0) exit(EXIT_FAILURE); + printf(" need to allocate %u bytes \n\n", sizes_list_len); -int main(void) { - - /* given a specific size name, get and print its size */ - char name[] = "ltc_hash_descriptor"; - unsigned int size; - char *sizes_list; - unsigned int sizes_list_len; - if(crypt_get_size(name, &size) != 0) - exit(EXIT_FAILURE); - printf("\n size of '%s' is %u \n\n", name, size); - - /* get and print the length of the names (and sizes) list */ - if(crypt_list_all_sizes(NULL, &sizes_list_len) != 0) - exit(EXIT_FAILURE); - printf(" need to allocate %u bytes \n\n", sizes_list_len); - - /* get and print the names (and sizes) list */ - sizes_list = malloc(sizes_list_len); - if(crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) - exit(EXIT_FAILURE); - printf(" supported sizes:\n\n%s\n\n", sizes_list); - return 0; + /* get and print the names (and sizes) list */ + sizes_list = malloc(sizes_list_len); + if (crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) exit(EXIT_FAILURE); + printf(" supported sizes:\n\n%s\n\n", sizes_list); + } else if (argc == 2) { + if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) { + char* base = strdup(basename(argv[0])); + printf("Usage: %s [-a] [-s name]\n\n", base); + _print_line("", "The old behavior of the demo"); + _print_line("-a", "Only lists all sizes"); + _print_line("-s name", "List a single size given as argument"); + _print_line("-h", "The help you're looking at"); + free(base); + } else if (strcmp(argv[1], "-a") == 0) { + char *sizes_list; + unsigned int sizes_list_len; + /* get and print the length of the names (and sizes) list */ + if (crypt_list_all_sizes(NULL, &sizes_list_len) != 0) exit(EXIT_FAILURE); + /* get and print the names (and sizes) list */ + sizes_list = malloc(sizes_list_len); + if (crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) exit(EXIT_FAILURE); + printf("%s\n", sizes_list); + } + } else if (argc == 3) { + if (strcmp(argv[1], "-s") == 0) { + unsigned int size; + if (crypt_get_size(argv[2], &size) != 0) exit(EXIT_FAILURE); + printf("%s,%u\n", argv[2], size); + } + } + return 0; } /* ref: $Format:%D$ */ From 7a2aabf47e4361b14254ccdf44ae3343b39786ac Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Tue, 8 Aug 2017 19:02:11 +0200 Subject: [PATCH 1033/1192] update crypt_constants.c --- src/misc/crypt/crypt_constants.c | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 5fe0eccb8..9c1b5ae44 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -26,9 +26,13 @@ typedef struct { #define _C_STRINGIFY(s) { #s, s } static const crypt_constant _crypt_constants[] = { + _C_STRINGIFY(PK_PUBLIC), _C_STRINGIFY(PK_PRIVATE), + {"LTC_ENCRYPT", 0}, /* good for all other xxx_ENCRYPT prefixes */ + {"LTC_DECRYPT", 1}, /* good for all other xxx_DECRYPT prefixes */ + _C_STRINGIFY(PKA_RSA), _C_STRINGIFY(PKA_DSA), @@ -42,6 +46,7 @@ static const crypt_constant _crypt_constants[] = { _C_STRINGIFY(LTC_PKCS_1_V1_5), _C_STRINGIFY(LTC_PKCS_1_OAEP), _C_STRINGIFY(LTC_PKCS_1_PSS), + _C_STRINGIFY(LTC_PKCS_1_V1_5_NA1), #else {"LTC_PKCS_1", 0}, #endif @@ -85,6 +90,31 @@ static const crypt_constant _crypt_constants[] = { _C_STRINGIFY(LTC_MILLER_RABIN_REPS), #endif +#ifdef LTC_DER +/* DER handling */ + _C_STRINGIFY(LTC_ASN1_EOL), + _C_STRINGIFY(LTC_ASN1_BOOLEAN), + _C_STRINGIFY(LTC_ASN1_INTEGER), + _C_STRINGIFY(LTC_ASN1_SHORT_INTEGER), + _C_STRINGIFY(LTC_ASN1_BIT_STRING), + _C_STRINGIFY(LTC_ASN1_OCTET_STRING), + _C_STRINGIFY(LTC_ASN1_NULL), + _C_STRINGIFY(LTC_ASN1_OBJECT_IDENTIFIER), + _C_STRINGIFY(LTC_ASN1_IA5_STRING), + _C_STRINGIFY(LTC_ASN1_PRINTABLE_STRING), + _C_STRINGIFY(LTC_ASN1_UTF8_STRING), + _C_STRINGIFY(LTC_ASN1_UTCTIME), + _C_STRINGIFY(LTC_ASN1_CHOICE), + _C_STRINGIFY(LTC_ASN1_SEQUENCE), + _C_STRINGIFY(LTC_ASN1_SET), + _C_STRINGIFY(LTC_ASN1_SETOF), + _C_STRINGIFY(LTC_ASN1_RAW_BIT_STRING), + _C_STRINGIFY(LTC_ASN1_TELETEX_STRING), + _C_STRINGIFY(LTC_ASN1_CONSTRUCTED), + _C_STRINGIFY(LTC_ASN1_CONTEXT_SPECIFIC), + _C_STRINGIFY(LTC_ASN1_GENERALIZEDTIME), +#endif + #ifdef LTC_CTR_MODE {"LTC_CTR_MODE", 1}, _C_STRINGIFY(CTR_COUNTER_LITTLE_ENDIAN), @@ -93,6 +123,14 @@ static const crypt_constant _crypt_constants[] = { #else {"LTC_CTR_MODE", 0}, #endif +#ifdef LTC_GCM_MODE + _C_STRINGIFY(LTC_GCM_MODE_IV), + _C_STRINGIFY(LTC_GCM_MODE_AAD), + _C_STRINGIFY(LTC_GCM_MODE_TEXT), +#endif + + _C_STRINGIFY(LTC_MP_NO), + _C_STRINGIFY(LTC_MP_YES), _C_STRINGIFY(MAXBLOCKSIZE), _C_STRINGIFY(TAB_SIZE), From a3a199e14bbc064187d7375f1183e51e0a073a22 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Tue, 8 Aug 2017 19:04:04 +0200 Subject: [PATCH 1034/1192] update crypt_sizes.c --- src/misc/crypt/crypt_sizes.c | 123 +++++++++++++++++++---------------- 1 file changed, 67 insertions(+), 56 deletions(-) diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 45f029c2c..fa3e68411 100644 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -30,8 +30,11 @@ static const crypt_size _crypt_sizes[] = { /* hash state sizes */ _SZ_STRINGIFY_S(ltc_hash_descriptor), _SZ_STRINGIFY_T(hash_state), -#ifdef LTC_SHA256 - _SZ_STRINGIFY_S(sha256_state), +#ifdef LTC_CHC_HASH + _SZ_STRINGIFY_S(chc_state), +#endif +#ifdef LTC_WHIRLPOOL + _SZ_STRINGIFY_S(whirlpool_state), #endif #ifdef LTC_SHA3 _SZ_STRINGIFY_S(sha3_state), @@ -39,17 +42,23 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_SHA512 _SZ_STRINGIFY_S(sha512_state), #endif -#ifdef LTC_WHIRLPOOL - _SZ_STRINGIFY_S(whirlpool_state), +#ifdef LTC_SHA256 + _SZ_STRINGIFY_S(sha256_state), #endif -#ifdef LTC_MD2 - _SZ_STRINGIFY_S(md2_state), +#ifdef LTC_SHA1 + _SZ_STRINGIFY_S(sha1_state), +#endif +#ifdef LTC_MD5 + _SZ_STRINGIFY_S(md5_state), #endif #ifdef LTC_MD4 _SZ_STRINGIFY_S(md4_state), #endif -#ifdef LTC_MD5 - _SZ_STRINGIFY_S(md5_state), +#ifdef LTC_MD2 + _SZ_STRINGIFY_S(md2_state), +#endif +#ifdef LTC_TIGER + _SZ_STRINGIFY_S(tiger_state), #endif #ifdef LTC_RIPEMD128 _SZ_STRINGIFY_S(rmd128_state), @@ -63,21 +72,12 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_RIPEMD320 _SZ_STRINGIFY_S(rmd320_state), #endif -#ifdef LTC_SHA1 - _SZ_STRINGIFY_S(sha1_state), -#endif -#ifdef LTC_TIGER - _SZ_STRINGIFY_S(tiger_state), -#endif #ifdef LTC_BLAKE2S _SZ_STRINGIFY_S(blake2s_state), #endif #ifdef LTC_BLAKE2B _SZ_STRINGIFY_S(blake2b_state), #endif -#ifdef LTC_CHC_HASH - _SZ_STRINGIFY_S(chc_state), -#endif /* block cipher key sizes */ _SZ_STRINGIFY_S(ltc_cipher_descriptor), @@ -142,55 +142,57 @@ static const crypt_size _crypt_sizes[] = { #endif /* mode sizes */ -#ifdef LTC_CBC_MODE - _SZ_STRINGIFY_T(symmetric_CBC), +#ifdef LTC_ECB_MODE + _SZ_STRINGIFY_T(symmetric_ECB), #endif #ifdef LTC_CFB_MODE _SZ_STRINGIFY_T(symmetric_CFB), #endif +#ifdef LTC_OFB_MODE + _SZ_STRINGIFY_T(symmetric_OFB), +#endif +#ifdef LTC_CBC_MODE + _SZ_STRINGIFY_T(symmetric_CBC), +#endif #ifdef LTC_CTR_MODE _SZ_STRINGIFY_T(symmetric_CTR), #endif -#ifdef LTC_ECB_MODE - _SZ_STRINGIFY_T(symmetric_ECB), +#ifdef LTC_LRW_MODE + _SZ_STRINGIFY_T(symmetric_LRW), #endif #ifdef LTC_F8_MODE _SZ_STRINGIFY_T(symmetric_F8), #endif -#ifdef LTC_LRW_MODE - _SZ_STRINGIFY_T(symmetric_LRW), +#ifdef LTC_XTS_MODE + _SZ_STRINGIFY_T(symmetric_xts), #endif -#ifdef LTC_OFB_MODE - _SZ_STRINGIFY_T(symmetric_OFB), + + /* stream cipher sizes */ +#ifdef LTC_CHACHA + _SZ_STRINGIFY_T(chacha_state), +#endif +#ifdef LTC_RC4_STREAM + _SZ_STRINGIFY_T(rc4_state), +#endif +#ifdef LTC_SOBER128_STREAM + _SZ_STRINGIFY_T(sober128_state), #endif /* MAC sizes -- no states for ccm, lrw */ -#ifdef LTC_F9_MODE - _SZ_STRINGIFY_T(f9_state), -#endif #ifdef LTC_HMAC _SZ_STRINGIFY_T(hmac_state), #endif #ifdef LTC_OMAC _SZ_STRINGIFY_T(omac_state), #endif -#ifdef LTC_PELICAN - _SZ_STRINGIFY_T(pelican_state), -#endif #ifdef LTC_PMAC _SZ_STRINGIFY_T(pmac_state), #endif #ifdef LTC_POLY1305 _SZ_STRINGIFY_T(poly1305_state), #endif -#ifdef LTC_BLAKE2SMAC - _SZ_STRINGIFY_T(blake2smac_state), -#endif -#ifdef LTC_BLAKE2BMAC - _SZ_STRINGIFY_T(blake2bmac_state), -#endif -#ifdef LTC_XCBC - _SZ_STRINGIFY_T(xcbc_state), +#ifdef LTC_EAX_MODE + _SZ_STRINGIFY_T(eax_state), #endif #ifdef LTC_OCB_MODE _SZ_STRINGIFY_T(ocb_state), @@ -198,17 +200,23 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_OCB3_MODE _SZ_STRINGIFY_T(ocb3_state), #endif -#ifdef LTC_CHACHA20POLY1305_MODE - _SZ_STRINGIFY_T(chacha20poly1305_state), +#ifdef LTC_CCM_MODE + _SZ_STRINGIFY_T(ccm_state), #endif #ifdef LTC_GCM_MODE _SZ_STRINGIFY_T(gcm_state), #endif -#ifdef LTC_EAX_MODE - _SZ_STRINGIFY_T(eax_state), +#ifdef LTC_PELICAN + _SZ_STRINGIFY_T(pelican_state), #endif -#ifdef LTC_CCM_MODE - _SZ_STRINGIFY_T(ccm_state), +#ifdef LTC_XCBC + _SZ_STRINGIFY_T(xcbc_state), +#endif +#ifdef LTC_F9_MODE + _SZ_STRINGIFY_T(f9_state), +#endif +#ifdef LTC_CHACHA20POLY1305_MODE + _SZ_STRINGIFY_T(chacha20poly1305_state), #endif /* asymmetric keys */ @@ -219,16 +227,27 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(dsa_key), #endif #ifdef LTC_MDH + _SZ_STRINGIFY_T(ltc_dh_set_type), _SZ_STRINGIFY_T(dh_key), #endif #ifdef LTC_MECC _SZ_STRINGIFY_T(ltc_ecc_set_type), - _SZ_STRINGIFY_T(ecc_key), _SZ_STRINGIFY_T(ecc_point), + _SZ_STRINGIFY_T(ecc_key), #endif #ifdef LTC_MKAT _SZ_STRINGIFY_T(katja_key), #endif +#ifdef LTC_SOURCE + _SZ_STRINGIFY_T(oid_st), +#endif + + /* DER handling */ +#ifdef LTC_DER + _SZ_STRINGIFY_T(ltc_asn1_list), /* a list entry */ + _SZ_STRINGIFY_T(ltc_utctime), + _SZ_STRINGIFY_T(ltc_generalizedtime), +#endif /* prng state sizes */ _SZ_STRINGIFY_S(ltc_prng_descriptor), @@ -251,22 +270,14 @@ static const crypt_size _crypt_sizes[] = { /* sprng has no state as it uses other potentially available sources */ /* like /dev/random. See Developers Guide for more info. */ -#ifdef LTC_SOBER128_STREAM - _SZ_STRINGIFY_T(sober128_state), -#endif -#ifdef LTC_RC4_STREAM - _SZ_STRINGIFY_T(rc4_state), -#endif -#ifdef LTC_CHACHA - _SZ_STRINGIFY_T(chacha_state), -#endif - #ifdef LTC_ADLER32 _SZ_STRINGIFY_T(adler32_state), #endif #ifdef LTC_CRC32 _SZ_STRINGIFY_T(crc32_state), #endif + + }; /* crypt_get_size() From 22822417c9499008e059427da0b4acf06c59b48a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Aug 2017 19:26:19 +0200 Subject: [PATCH 1035/1192] really define LTC_{DE,EN}CRYPT --- src/headers/tomcrypt_cfg.h | 5 +++++ src/headers/tomcrypt_cipher.h | 4 ++-- src/headers/tomcrypt_mac.h | 12 ++++++------ src/misc/crypt/crypt_constants.c | 4 ++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index d4000d1e2..8c0866bf1 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -64,6 +64,11 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define ARGTYPE 0 #endif +#undef LTC_ENCRYPT +#define LTC_ENCRYPT 0 +#undef LTC_DECRYPT +#define LTC_DECRYPT 1 + /* Controls endianess and size of registers. Leave uncommented to get platform neutral [slower] code * * Note: in order to use the optimized macros your platform must support unaligned 32 and 64 bit read/writes. diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index 3834f4f48..6839e2dfc 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -875,8 +875,8 @@ int ctr_test(void); #ifdef LTC_LRW_MODE -#define LRW_ENCRYPT 0 -#define LRW_DECRYPT 1 +#define LRW_ENCRYPT LTC_ENCRYPT +#define LRW_DECRYPT LTC_DECRYPT int lrw_start( int cipher, const unsigned char *IV, diff --git a/src/headers/tomcrypt_mac.h b/src/headers/tomcrypt_mac.h index 3fe431fae..4081cc731 100644 --- a/src/headers/tomcrypt_mac.h +++ b/src/headers/tomcrypt_mac.h @@ -311,8 +311,8 @@ void ocb3_int_xor_blocks(unsigned char *out, const unsigned char *block_a, const #ifdef LTC_CCM_MODE -#define CCM_ENCRYPT 0 -#define CCM_DECRYPT 1 +#define CCM_ENCRYPT LTC_ENCRYPT +#define CCM_DECRYPT LTC_DECRYPT typedef struct { symmetric_key K; @@ -378,8 +378,8 @@ extern const unsigned char gcm_shift_table[]; #ifdef LTC_GCM_MODE -#define GCM_ENCRYPT 0 -#define GCM_DECRYPT 1 +#define GCM_ENCRYPT LTC_ENCRYPT +#define GCM_DECRYPT LTC_DECRYPT #define LTC_GCM_MODE_IV 0 #define LTC_GCM_MODE_AAD 1 @@ -542,8 +542,8 @@ typedef struct { int aadflg; } chacha20poly1305_state; -#define CHCHA20POLY1305_ENCRYPT 0 -#define CHCHA20POLY1305_DECRYPT 1 +#define CHCHA20POLY1305_ENCRYPT LTC_ENCRYPT +#define CHCHA20POLY1305_DECRYPT LTC_DECRYPT int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, unsigned long keylen); int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen); diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 9c1b5ae44..18be43cca 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -30,8 +30,8 @@ static const crypt_constant _crypt_constants[] = { _C_STRINGIFY(PK_PUBLIC), _C_STRINGIFY(PK_PRIVATE), - {"LTC_ENCRYPT", 0}, /* good for all other xxx_ENCRYPT prefixes */ - {"LTC_DECRYPT", 1}, /* good for all other xxx_DECRYPT prefixes */ + _C_STRINGIFY(LTC_ENCRYPT), + _C_STRINGIFY(LTC_DECRYPT), _C_STRINGIFY(PKA_RSA), _C_STRINGIFY(PKA_DSA), From d22b20833e5fd64b4d6d420ca63d2375909a3d53 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Aug 2017 19:26:38 +0200 Subject: [PATCH 1036/1192] we don't expose internal structs --- src/misc/crypt/crypt_sizes.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index fa3e68411..609bb8d2c 100644 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -238,9 +238,6 @@ static const crypt_size _crypt_sizes[] = { #ifdef LTC_MKAT _SZ_STRINGIFY_T(katja_key), #endif -#ifdef LTC_SOURCE - _SZ_STRINGIFY_T(oid_st), -#endif /* DER handling */ #ifdef LTC_DER From 91e5e8350be8e39516a9f38705f88c7b85bc6b6e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Aug 2017 19:35:11 +0200 Subject: [PATCH 1037/1192] ltc_dh_set_type can be hidden as well --- src/headers/tomcrypt_pk.h | 14 +++++++------- src/misc/crypt/crypt_sizes.c | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 00a6c1334..3171efd4b 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -198,13 +198,6 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key); /* ---- DH Routines ---- */ #ifdef LTC_MDH -typedef struct { - int size; - char *name, *base, *prime; -} ltc_dh_set_type; - -extern const ltc_dh_set_type ltc_dh_sets[]; - typedef struct { int type; void *x; @@ -235,6 +228,13 @@ void dh_free(dh_key *key); int dh_export_key(void *out, unsigned long *outlen, int type, dh_key *key); #ifdef LTC_SOURCE +typedef struct { + int size; + char *name, *base, *prime; +} ltc_dh_set_type; + +extern const ltc_dh_set_type ltc_dh_sets[]; + /* internal helper functions */ int dh_check_pubkey(dh_key *key); #endif diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 609bb8d2c..20ca471d4 100644 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -227,7 +227,6 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(dsa_key), #endif #ifdef LTC_MDH - _SZ_STRINGIFY_T(ltc_dh_set_type), _SZ_STRINGIFY_T(dh_key), #endif #ifdef LTC_MECC From 9f548c9928a96eaa353d95c98d8164254c04d5a1 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Wed, 9 Aug 2017 11:13:13 +0200 Subject: [PATCH 1038/1192] update demo_dynamic.py --- demos/demo_dynamic.py | 132 +++++++++++++++++++++++++++++------------- 1 file changed, 93 insertions(+), 39 deletions(-) mode change 100755 => 100644 demos/demo_dynamic.py diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py old mode 100755 new mode 100644 index 97e4855aa..ffb3017b1 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -1,7 +1,7 @@ """ - demo_dynamic.py v1 + demo_dynamic.py v2 This program demonstrates Python's use of the dynamic language support additions to LTC, namely access to LTC @@ -19,26 +19,21 @@ load multiple .dylibs, but it does not support this level of tight coupling between otherwise independent libraries.) - My .dylib was created on OSX with the following steps: - - 1- compile LTC to a .a static lib: - CFLAGS="-DLTM_DESC -DUSE_LTM" make - - 2- link LTC and LTM into a single .dylib: - ar2dylib_with tomcrypt tommath - where ar2dylib_with is a shell script that combines - the LTC .a with the LTM .dylib + My .dylib was created on OSX/macOS with the following: + sudo make -j5 -f makefile.shared \ + CFLAGS="-DUSE_TFM -DTFM_DESC -I/usr/local/include" \ + EXTRALIBS=/usr/local/lib/libtfm.a install Reminder: you don't need to bind in a math library unless - you are going to use LTC functions that depend - on a mathlib. For example, public key crypto - needs a mathlib; hashing and symmetric encryption - do not. + you are going to use LTC functions that need a + mathlib. For example, public key crypto requires + a mathlib; hashing and symmetric encryption do not. This code was written for Python 2.7. Larry Bugbee - March 2014 + March 2014 v1 + August 2017 v2 """ @@ -46,15 +41,23 @@ from ctypes import * from ctypes.util import find_library +# switches to enable/disable selected output +SHOW_ALL_CONSTANTS = True +SHOW_ALL_SIZES = True +SHOW_SELECTED_CONSTANTS = True +SHOW_SELECTED_SIZES = True +SHOW_BUILD_OPTIONS_ALGS = True +SHOW_SHA256_EXAMPLE = True +SHOW_CHACHA_EXAMPLE = True + +print +print(' demo_dynamic.py') #--------------------------------------------------------------- # load the .dylib libname = 'tomcrypt' libpath = find_library(libname) - -print -print(' demo_dynamic.py') print print(' path to library %s: %s' % (libname, libpath)) @@ -69,7 +72,8 @@ # supported sizes. One alternative: these lists may be parsed # and used as needed. -if 1: +if SHOW_ALL_CONSTANTS: + print '-'*60 print ' all supported constants and their values:' # get size to allocate for constants output list @@ -85,7 +89,8 @@ print -if 1: +if SHOW_ALL_SIZES: + print '-'*60 print ' all supported sizes:' # get size to allocate for sizes output list @@ -105,7 +110,8 @@ # get individually named constants and sizes # print selected constants -if 1: +if SHOW_SELECTED_CONSTANTS: + print '-'*60 print '\n selected constants:' names = [ @@ -122,7 +128,8 @@ print ' %-25s %d' % (name, value) # print selected sizes -if 1: +if SHOW_SELECTED_SIZES: + print '-'*60 print '\n selected sizes:' names = [ @@ -143,14 +150,18 @@ #--------------------------------------------------------------- #--------------------------------------------------------------- -# ctypes getting a list of this build's supported algorithms -# and compiler switches +# LibTomCrypt exposes one interesting string that can be accessed +# via Python's ctypes module, "crypt_build_settings", which +# provides a list of this build's compiler switches and supported +# algorithms. If someday LTC exposes other interesting strings, +# they can be found with: +# nm /usr/local/lib/libtomcrypt.dylib | grep " D " def get_named_string(lib, name): return c_char_p.in_dll(lib, name).value -if 0: - print '\n%s' % ('-'*60) +if SHOW_BUILD_OPTIONS_ALGS: + print '-'*60 print 'This is a string compiled into LTC showing compile ' print 'options and algorithms supported by this build \n' print get_named_string(LTC, 'crypt_build_settings') @@ -160,23 +171,31 @@ def get_named_string(lib, name): #--------------------------------------------------------------- #--------------------------------------------------------------- -# here is an example of how a wrapper can make Python access -# more Pythonic +# here is an example of how Python code can be written to access +# LTC's implementation of SHA256 and ChaCha, # - - - - - - - - - - - - - -# a wrapper fragment... +# definitions def _get_size(name): size = c_int(0) rc = LTC.crypt_get_size(name, byref(size)) + if rc != 0: + raise Exception('LTC.crypt_get_size(%s) rc = %d' % (name, rc)) return size.value -sha256_state_struct_size = _get_size('sha256_state') -sha512_state_struct_size = _get_size('sha512_state') +def _get_constant(name): + constant = c_int(0) + rc = LTC.crypt_get_constant(name, byref(constant)) + if rc != 0: + raise Exception('LTC.crypt_get_constant(%s) rc = %d' % (name, rc)) + return constant.value + +CRYPT_OK = _get_constant('CRYPT_OK') class SHA256(object): def __init__(self): - self.state = c_buffer(sha256_state_struct_size) + self.state = c_buffer(_get_size('sha256_state')) LTC.sha256_init(byref(self.state)) def update(self, data): LTC.sha256_process(byref(self.state), data, len(data)) @@ -185,19 +204,54 @@ def digest(self): LTC.sha256_done(byref(self.state), byref(md)) return md.raw +class ChaCha(object): + def __init__(self, key, rounds): + self.state = c_buffer(_get_size('chacha_state')) + self.counter = c_int(1) + err = LTC.chacha_setup(byref(self.state), key, len(key), rounds) + def set_iv32(self, iv): + err = LTC.chacha_ivctr32(byref(self.state), iv, len(iv), byref(self.counter)) + if err != CRYPT_OK: + raise Exception('LTC.chacha_ivctr32() err = %d' % err) + def crypt(self, datain): + dataout = c_buffer(len(datain)) + err = LTC.chacha_crypt(byref(self.state), datain, len(datain), byref(dataout)) + if err != CRYPT_OK: + raise Exception('LTC.chacha_crypt() err = %d' % err) + return dataout.raw + # - - - - - - - - - - - - - -# an app fragment... +# a SHA256 app fragment... # from wrapper import * # uncomment in real life -data = 'hello world' +if SHOW_SHA256_EXAMPLE: + print '-'*60 + data = 'hello world' + + sha256 = SHA256() + sha256.update(data) + md = sha256.digest() + + template = '\n the SHA256 digest for "%s" is %s \n' + print template % (data, md.encode('hex')) + +# - - - - - - - - - - - - - +# a ChaCha app fragment... + +if SHOW_CHACHA_EXAMPLE: + print '-'*60 + key = 'hownowbrowncow\x00\x00' # exactly 16 or 32 bytes + rounds = 12 # common values: 8, 12, 20 + iv = '123456789012' # exactly 12 bytes + plain = 'Kilroy was here, there, and everywhere!' -sha256 = SHA256() -sha256.update(data) -md = sha256.digest() + cha = ChaCha(key, rounds) + cha.set_iv32(iv) + cipher = cha.crypt(plain) -template = '\n\n the SHA256 digest for "%s" is %s \n' -print template % (data, md.encode('hex')) + template = '\n ChaCha%d ciphertext for "%s" is "%s" \n' + print template % (rounds, plain, cipher.encode('hex')) From a247583e6362c78b70626cde3eb9ac5fc0e1703c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 9 Aug 2017 11:18:13 +0200 Subject: [PATCH 1039/1192] add error-codes to crypt_constants --- src/misc/crypt/crypt_constants.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 18be43cca..44f196ed9 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -27,6 +27,33 @@ typedef struct { static const crypt_constant _crypt_constants[] = { + _C_STRINGIFY(CRYPT_OK), + _C_STRINGIFY(CRYPT_ERROR), + _C_STRINGIFY(CRYPT_NOP), + _C_STRINGIFY(CRYPT_INVALID_KEYSIZE), + _C_STRINGIFY(CRYPT_INVALID_ROUNDS), + _C_STRINGIFY(CRYPT_FAIL_TESTVECTOR), + _C_STRINGIFY(CRYPT_BUFFER_OVERFLOW), + _C_STRINGIFY(CRYPT_INVALID_PACKET), + _C_STRINGIFY(CRYPT_INVALID_PRNGSIZE), + _C_STRINGIFY(CRYPT_ERROR_READPRNG), + _C_STRINGIFY(CRYPT_INVALID_CIPHER), + _C_STRINGIFY(CRYPT_INVALID_HASH), + _C_STRINGIFY(CRYPT_INVALID_PRNG), + _C_STRINGIFY(CRYPT_MEM), + _C_STRINGIFY(CRYPT_PK_TYPE_MISMATCH), + _C_STRINGIFY(CRYPT_PK_NOT_PRIVATE), + _C_STRINGIFY(CRYPT_INVALID_ARG), + _C_STRINGIFY(CRYPT_FILE_NOTFOUND), + _C_STRINGIFY(CRYPT_PK_INVALID_TYPE), + _C_STRINGIFY(CRYPT_OVERFLOW), + _C_STRINGIFY(CRYPT_UNUSED1), + _C_STRINGIFY(CRYPT_UNUSED2), + _C_STRINGIFY(CRYPT_PK_INVALID_SIZE), + _C_STRINGIFY(CRYPT_INVALID_PRIME_SIZE), + _C_STRINGIFY(CRYPT_PK_INVALID_PADDING), + _C_STRINGIFY(CRYPT_HASH_OVERFLOW), + _C_STRINGIFY(PK_PUBLIC), _C_STRINGIFY(PK_PRIVATE), From d5d4cadbde8ff39b0601840f26918fa7042c7282 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 9 Aug 2017 11:20:16 +0200 Subject: [PATCH 1040/1192] PKA_{D,R}SA shouldn't be public --- src/misc/crypt/crypt_constants.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 44f196ed9..a6c4b46ee 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -60,9 +60,6 @@ static const crypt_constant _crypt_constants[] = { _C_STRINGIFY(LTC_ENCRYPT), _C_STRINGIFY(LTC_DECRYPT), - _C_STRINGIFY(PKA_RSA), - _C_STRINGIFY(PKA_DSA), - #ifdef LTC_PKCS_1 {"LTC_PKCS_1", 1}, /* Block types */ From 35925eada534e5a3a1fcc1a158e42178fd88a11e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 9 Aug 2017 11:48:59 +0200 Subject: [PATCH 1041/1192] improve constants demo --- demos/constants.c | 76 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 21 deletions(-) diff --git a/demos/constants.c b/demos/constants.c index 32af20b1b..d5d3622ec 100644 --- a/demos/constants.c +++ b/demos/constants.c @@ -8,6 +8,12 @@ */ #include "tomcrypt.h" +#if _POSIX_C_SOURCE >= 200112L +#include +#else +#define basename(x) x +#endif + /** @file demo_crypt_constants.c @@ -17,33 +23,61 @@ Larry Bugbee, February 2013 */ +static void _print_line(const char* cmd, const char* desc) +{ + printf(" %-16s - %s\n", cmd, desc); +} -int main(void) { - /* given a specific constant name, get and print its value */ - char name[] = "CTR_COUNTER_BIG_ENDIAN"; - int value; - char *names_list; - unsigned int names_list_len; +int main(int argc, char **argv) +{ + if (argc == 1) { + /* given a specific constant name, get and print its value */ + char name[] = "CTR_COUNTER_BIG_ENDIAN"; + int value; + char *names_list; + unsigned int names_list_len; - if (crypt_get_constant(name, &value) != 0) - exit(EXIT_FAILURE); - printf("\n %s is %d \n\n", name, value); + if (crypt_get_constant(name, &value) != 0) exit(EXIT_FAILURE); + printf("\n %s is %d \n\n", name, value); - /* get and print the length of the names (and values) list */ + /* get and print the length of the names (and values) list */ - if (crypt_list_all_constants(NULL, &names_list_len) != 0) - exit(EXIT_FAILURE); - printf(" need to allocate %u bytes \n\n", names_list_len); + if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE); + printf(" need to allocate %u bytes \n\n", names_list_len); - /* get and print the names (and values) list */ - if ((names_list = malloc(names_list_len)) == NULL) - exit(EXIT_FAILURE); - if (crypt_list_all_constants(names_list, &names_list_len) != 0) - exit(EXIT_FAILURE); - printf(" supported constants:\n\n%s\n\n", names_list); - free(names_list); + /* get and print the names (and values) list */ + if ((names_list = malloc(names_list_len)) == NULL) exit(EXIT_FAILURE); + if (crypt_list_all_constants(names_list, &names_list_len) != 0) exit(EXIT_FAILURE); + printf(" supported constants:\n\n%s\n\n", names_list); + free(names_list); + } else if (argc == 2) { + if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) { + char* base = strdup(basename(argv[0])); + printf("Usage: %s [-a] [-s name]\n\n", base); + _print_line("", "The old behavior of the demo"); + _print_line("-a", "Only lists all constants"); + _print_line("-s name", "List a single constant given as argument"); + _print_line("-h", "The help you're looking at"); + free(base); + } else if (strcmp(argv[1], "-a") == 0) { + char *names_list; + unsigned int names_list_len; + /* get and print the length of the names (and values) list */ + if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE); + /* get and print the names (and values) list */ + names_list = malloc(names_list_len); + if (crypt_list_all_constants(names_list, &names_list_len) != 0) exit(EXIT_FAILURE); + printf("%s\n", names_list); + } + } else if (argc == 3) { + if (strcmp(argv[1], "-s") == 0) { + int value; + if (crypt_get_constant(argv[2], &value) != 0) exit(EXIT_FAILURE); + printf("%s,%u\n", argv[2], value); + } + } - return 0; + return 0; } From 87d876f6ac2e32e6f3aa34ee86a2efc5e5e89e24 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 9 Aug 2017 12:10:42 +0200 Subject: [PATCH 1042/1192] add comment about usage to demo_dynamic [skip ci] --- demos/demo_dynamic.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index ffb3017b1..69507d313 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -24,6 +24,10 @@ CFLAGS="-DUSE_TFM -DTFM_DESC -I/usr/local/include" \ EXTRALIBS=/usr/local/lib/libtfm.a install + For python 2.7.12 on Ubuntu Xenial the following worked for + me (without MPI support): + sudo make -f makefile.shared install PREFIX="/usr" + Reminder: you don't need to bind in a math library unless you are going to use LTC functions that need a mathlib. For example, public key crypto requires From 695c3b235d5fc193cf4216524dac730470e53e3c Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Thu, 10 Aug 2017 16:40:28 -0700 Subject: [PATCH 1043/1192] Update demo_dynamic.py added error strings (with function returning a string type) and a decryption to ChCha. --- demos/demo_dynamic.py | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index 69507d313..3989e7c5b 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -1,7 +1,7 @@ """ - demo_dynamic.py v2 + demo_dynamic.py v2b This program demonstrates Python's use of the dynamic language support additions to LTC, namely access to LTC @@ -33,11 +33,12 @@ mathlib. For example, public key crypto requires a mathlib; hashing and symmetric encryption do not. - This code was written for Python 2.7. + This code was written for Python 2.7 with the ctypes standard + library. Larry Bugbee March 2014 v1 - August 2017 v2 + August 2017 v2b """ @@ -195,6 +196,13 @@ def _get_constant(name): raise Exception('LTC.crypt_get_constant(%s) rc = %d' % (name, rc)) return constant.value +def _err2str(err): + # define return type + errstr = LTC.error_to_string + errstr.restype = c_char_p + # get and return err string + return errstr(err) + CRYPT_OK = _get_constant('CRYPT_OK') class SHA256(object): @@ -213,15 +221,17 @@ def __init__(self, key, rounds): self.state = c_buffer(_get_size('chacha_state')) self.counter = c_int(1) err = LTC.chacha_setup(byref(self.state), key, len(key), rounds) + if err != CRYPT_OK: + raise Exception('LTC.chacha_setup(), err = %d, "%s"' % (err, _err2str(err))) def set_iv32(self, iv): err = LTC.chacha_ivctr32(byref(self.state), iv, len(iv), byref(self.counter)) if err != CRYPT_OK: - raise Exception('LTC.chacha_ivctr32() err = %d' % err) + raise Exception('LTC.chacha_ivctr32(), err = %d, "%s"' % (err, _err2str(err))) def crypt(self, datain): dataout = c_buffer(len(datain)) err = LTC.chacha_crypt(byref(self.state), datain, len(datain), byref(dataout)) if err != CRYPT_OK: - raise Exception('LTC.chacha_crypt() err = %d' % err) + raise Exception('LTC.chacha_crypt(), err = %d, "%s"' % (err, _err2str(err))) return dataout.raw # - - - - - - - - - - - - - @@ -254,8 +264,15 @@ def crypt(self, datain): cha.set_iv32(iv) cipher = cha.crypt(plain) - template = '\n ChaCha%d ciphertext for "%s" is "%s" \n' + template = '\n ChaCha%d ciphertext for "%s" is "%s"' print template % (rounds, plain, cipher.encode('hex')) + + # reset to decrypt + cha.set_iv32(iv) + decrypted = cha.crypt(cipher) + + template = ' ChaCha%d decoded text for "%s" is "%s" \n' + print template % (rounds, plain, decrypted) From ee55c4e51c5fe01eab94f73a2841df8b501e0635 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Fri, 11 Aug 2017 01:21:59 -0700 Subject: [PATCH 1044/1192] minor cleanup and formatting changes --- demos/demo_dynamic.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index 3989e7c5b..7333beb19 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -58,7 +58,8 @@ print print(' demo_dynamic.py') -#--------------------------------------------------------------- + +#------------------------------------------------------------------------------- # load the .dylib libname = 'tomcrypt' @@ -71,8 +72,7 @@ print - -#--------------------------------------------------------------- +#------------------------------------------------------------------------------- # get list of all supported constants followed by a list of all # supported sizes. One alternative: these lists may be parsed # and used as needed. @@ -84,7 +84,7 @@ # get size to allocate for constants output list str_len = c_int(0) ret = LTC.crypt_list_all_constants(None, byref(str_len)) - print ' need to allocate %d bytes \n' % str_len.value + print ' need to allocate %d bytes to build list \n' % str_len.value # allocate that size and get (name, size) pairs, each pair # separated by a newline char. @@ -101,7 +101,7 @@ # get size to allocate for sizes output list str_len = c_int(0) ret = LTC.crypt_list_all_sizes(None, byref(str_len)) - print ' need to allocate %d bytes \n' % str_len.value + print ' need to allocate %d bytes to build list \n' % str_len.value # allocate that size and get (name, size) pairs, each pair # separated by a newline char. @@ -111,7 +111,7 @@ print -#--------------------------------------------------------------- +#------------------------------------------------------------------------------- # get individually named constants and sizes # print selected constants @@ -131,6 +131,7 @@ rc = LTC.crypt_get_constant(name, byref(const_value)) value = const_value.value print ' %-25s %d' % (name, value) + print # print selected sizes if SHOW_SELECTED_SIZES: @@ -151,10 +152,11 @@ rc = LTC.crypt_get_size(name, byref(size_value)) value = size_value.value print ' %-25s %d' % (name, value) + print -#--------------------------------------------------------------- -#--------------------------------------------------------------- +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- # LibTomCrypt exposes one interesting string that can be accessed # via Python's ctypes module, "crypt_build_settings", which # provides a list of this build's compiler switches and supported @@ -170,12 +172,10 @@ def get_named_string(lib, name): print 'This is a string compiled into LTC showing compile ' print 'options and algorithms supported by this build \n' print get_named_string(LTC, 'crypt_build_settings') - print - -#--------------------------------------------------------------- -#--------------------------------------------------------------- +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- # here is an example of how Python code can be written to access # LTC's implementation of SHA256 and ChaCha, @@ -235,7 +235,7 @@ def crypt(self, datain): return dataout.raw # - - - - - - - - - - - - - -# a SHA256 app fragment... +# a SHA256 app fragment # from wrapper import * # uncomment in real life @@ -251,7 +251,7 @@ def crypt(self, datain): print template % (data, md.encode('hex')) # - - - - - - - - - - - - - -# a ChaCha app fragment... +# a ChaCha app fragment if SHOW_CHACHA_EXAMPLE: print '-'*60 @@ -274,8 +274,10 @@ def crypt(self, datain): template = ' ChaCha%d decoded text for "%s" is "%s" \n' print template % (rounds, plain, decrypted) +# Footnote: Keys should be erased fm memory as soon as possible after use, +# and that includes Python. For a tip on how to do that in Python, see +# http://buggywhip.blogspot.com/2010/12/erase-keys-and-credit-card-numbers-in.html - -#--------------------------------------------------------------- -#--------------------------------------------------------------- -#--------------------------------------------------------------- +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- From bab115c631ee076d50123871cb779fe0a0c74836 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Fri, 11 Aug 2017 01:27:21 -0700 Subject: [PATCH 1045/1192] converted demo_dynamic.py to Python3 --- demos/demo_dynamic.py3 | 314 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 demos/demo_dynamic.py3 diff --git a/demos/demo_dynamic.py3 b/demos/demo_dynamic.py3 new file mode 100644 index 000000000..3dc318eb1 --- /dev/null +++ b/demos/demo_dynamic.py3 @@ -0,0 +1,314 @@ + + +""" + demo_dynamic.py3 v2b + + This program demonstrates Python's use of the dynamic + language support additions to LTC, namely access to LTC + constants, struct and union sizes, and the binding of a + math package to LTC. Also provided are simple code + fragments to illustrate how one might write a Python + wrapper for LTC and how an app might call the wrapper. + This or a similar model should work for Ruby and other + dynamic languages. + + This instance uses Python's ctypes and requires a single + .dylib linking together LTC and a math library. Building + a single .dylib is needed because LTC wants a fairly tight + relationship between itself and the mathlib. (ctypes can + load multiple .dylibs, but it does not support this level + of tight coupling between otherwise independent libraries.) + + My .dylib was created on OSX/macOS with the following: + sudo make -j5 -f makefile.shared \ + CFLAGS="-DUSE_TFM -DTFM_DESC -I/usr/local/include" \ + EXTRALIBS=/usr/local/lib/libtfm.a install + + For python 2.7.12 on Ubuntu Xenial the following worked for + me (without MPI support): + sudo make -f makefile.shared install PREFIX="/usr" + + Reminder: you don't need to bind in a math library unless + you are going to use LTC functions that need a + mathlib. For example, public key crypto requires + a mathlib; hashing and symmetric encryption do not. + + ------ + + This code was originally written for Python 2.7 with the + ctypes standard library. This version was modified so that + it would run under both Python 2.7 and 3.6. You might want + to run a diff on the .py and .py3 files to see the differences + between the two languages. + + Arguably the biggest change for Python3 has to do with + strings. Under Python2, native strings are ASCII bytes and + passing them to LTC is natural and requires no conversion. + Under Python3 all native strings are Unicode which requires + they be converted to bytes before use by LTC. + + Note the following for Python3. + - ASCII keys, IVs and other string arguments must be + 'bytes'. Define them with a 'b' prefix or convert + via the 'bytes()' function. + - "strings" returned from LTC are bytes and conversion + to Unicode might be necessary for proper printing. + If so, use .decode('utf-8'). + - The Python2 'print' statement becomes a function in + Python3 which requires parenthesis, eg. 'print()'. + + NB: Unicode is achieved under Python2 by either defining + a Unicode string with a 'u' prefix or passing ASCII + strings thru the 'unicode()' function. + + + Larry Bugbee + March 2014 v1 + August 2017 v2b + +""" + + +import sys +from ctypes import * +from ctypes.util import find_library + +# switches to enable/disable selected output +SHOW_ALL_CONSTANTS = True +SHOW_ALL_SIZES = True +SHOW_SELECTED_CONSTANTS = True +SHOW_SELECTED_SIZES = True +SHOW_BUILD_OPTIONS_ALGS = True +SHOW_SHA256_EXAMPLE = True +SHOW_CHACHA_EXAMPLE = True + +print(' ') +print(' demo_dynamic.py') + +def inprint(s, indent=0): + "prints strings indented, including multline strings" + for line in s.split('\n'): + print(' '*indent + line) + +#------------------------------------------------------------------------------- +# load the .dylib + +libname = 'tomcrypt' +libpath = find_library(libname) +print(' ') +print(' path to library %s: %s' % (libname, libpath)) + +LTC = cdll.LoadLibrary(libpath) +print(' loaded: %s' % LTC) +print(' ') + + +#------------------------------------------------------------------------------- +# get list of all supported constants followed by a list of all +# supported sizes. One alternative: these lists may be parsed +# and used as needed. + +if SHOW_ALL_CONSTANTS: + print('-'*60) + print(' all supported constants and their values:') + + # get size to allocate for constants output list + str_len = c_int(0) + ret = LTC.crypt_list_all_constants(None, byref(str_len)) + print(' need to allocate %d bytes to build list \n' % str_len.value) + + # allocate that size and get (name, size) pairs, each pair + # separated by a newline char. + names_sizes = c_buffer(str_len.value) + ret = LTC.crypt_list_all_constants(names_sizes, byref(str_len)) + print(names_sizes.value.decode("utf-8")) + print(' ') + + +if SHOW_ALL_SIZES: + print('-'*60) + print(' all supported sizes:') + + # get size to allocate for sizes output list + str_len = c_int(0) + ret = LTC.crypt_list_all_sizes(None, byref(str_len)) + print(' need to allocate %d bytes to build list \n' % str_len.value) + + # allocate that size and get (name, size) pairs, each pair + # separated by a newline char. + names_sizes = c_buffer(str_len.value) + ret = LTC.crypt_list_all_sizes(names_sizes, byref(str_len)) + print(names_sizes.value.decode("utf-8")) + print(' ') + + +#------------------------------------------------------------------------------- +# get individually named constants and sizes + +# print selected constants +if SHOW_SELECTED_CONSTANTS: + print('-'*60) + print('\n selected constants:') + + names = [ + b'ENDIAN_LITTLE', + b'ENDIAN_64BITWORD', + b'PK_PUBLIC', + b'MAX_RSA_SIZE', + b'CTR_COUNTER_BIG_ENDIAN', + ] + for name in names: + const_value = c_int(0) + rc = LTC.crypt_get_constant(name, byref(const_value)) + value = const_value.value + print(' %-25s %d' % (name.decode("utf-8"), value)) + print(' ') + +# print selected sizes +if SHOW_SELECTED_SIZES: + print('-'*60) + print('\n selected sizes:') + + names = [ + b'rijndael_key', + b'rsa_key', + b'symmetric_CTR', + b'twofish_key', + b'ecc_point', + b'gcm_state', + b'sha512_state', + ] + for name in names: + size_value = c_int(0) + rc = LTC.crypt_get_size(name, byref(size_value)) + value = size_value.value + print(' %-25s %d' % (name.decode("utf-8"), value)) + print(' ') + + +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# LibTomCrypt exposes one interesting string that can be accessed +# via Python's ctypes module, "crypt_build_settings", which +# provides a list of this build's compiler switches and supported +# algorithms. If someday LTC exposes other interesting strings, +# they can be found with: +# nm /usr/local/lib/libtomcrypt.dylib | grep " D " + +def get_named_string(lib, name): + return c_char_p.in_dll(lib, name).value.decode("utf-8") + +if SHOW_BUILD_OPTIONS_ALGS: + print('-'*60) + print('This is a string compiled into LTC showing compile') + print('options and algorithms supported by this build \n') +# print(get_named_string(LTC, 'crypt_build_settings')) + inprint(get_named_string(LTC, 'crypt_build_settings'), 4) + + +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# here is an example of how Python code can be written to access +# LTC's implementation of SHA256 and ChaCha, + +# - - - - - - - - - - - - - +# definitions + +from binascii import hexlify, unhexlify + +def _err2str(err): + # define return type + errstr = LTC.error_to_string + errstr.restype = c_char_p + # get and return err string + return errstr(err) + +def _get_size(name): + size = c_int(0) + rc = LTC.crypt_get_size(bytes(name), byref(size)) + if rc != 0: + raise Exception('LTC.crypt_get_size(%s) rc = %d' % (name, rc)) + return size.value + +def _get_constant(name): + constant = c_int(0) + rc = LTC.crypt_get_constant(bytes(name), byref(constant)) + if rc != 0: + raise Exception('LTC.crypt_get_constant(%s) rc = %d' % (name, rc)) + return constant.value + +CRYPT_OK = _get_constant(b'CRYPT_OK') + +class SHA256(object): + def __init__(self): + self.state = c_buffer(_get_size(b'sha256_state')) + LTC.sha256_init(byref(self.state)) + def update(self, data): + LTC.sha256_process(byref(self.state), data, len(data)) + def digest(self): + md = c_buffer(32) + LTC.sha256_done(byref(self.state), byref(md)) + return md.raw + +class ChaCha(object): + def __init__(self, key, rounds): + self.state = c_buffer(_get_size(b'chacha_state')) + self.counter = c_int(1) + err = LTC.chacha_setup(byref(self.state), key, len(key), rounds) + if err != CRYPT_OK: + raise Exception('LTC.chacha_setup(), err = %d, "%s"' % (err, _err2str(err))) + def set_iv32(self, iv): + err = LTC.chacha_ivctr32(byref(self.state), iv, len(iv), byref(self.counter)) + if err != CRYPT_OK: + raise Exception('LTC.chacha_ivctr32(), err = %d, "%s"' % (err, _err2str(err))) + def crypt(self, datain): + dataout = c_buffer(len(datain)) + err = LTC.chacha_crypt(byref(self.state), datain, len(datain), byref(dataout)) + if err != CRYPT_OK: + raise Exception('LTC.chacha_crypt(), err = %d, "%s"' % (err, _err2str(err))) + return dataout.raw + +# - - - - - - - - - - - - - +# a SHA256 app fragment + +if SHOW_SHA256_EXAMPLE: + print('-'*60) + data = b'hello world' # we want bytes, not Unicode + + sha256 = SHA256() + sha256.update(data) + md = sha256.digest() + + template = '\n the SHA256 digest for "%s" is %s \n' + print(template % (data, hexlify(md))) + +# - - - - - - - - - - - - - +# a ChaCha app fragment + +if SHOW_CHACHA_EXAMPLE: + print('-'*60) + key = b'hownowbrowncow\x00\x00' # exactly 16 or 32 bytes + rounds = 12 # common values: 8, 12, 20 + iv = b'123456789012' # exactly 12 bytes + plain = b'Kilroy was here, there, and everywhere!' + + cha = ChaCha(key, rounds) + cha.set_iv32(iv) + cipher = cha.crypt(plain) + + template = '\n ChaCha%d ciphertext for "%s" is "%s"' + print(template % (rounds, plain, hexlify(cipher))) + + cha.set_iv32(iv) # reset to decrypt + decrypted = cha.crypt(cipher) + + template = ' ChaCha%d decoded text for "%s" is "%s" \n' + print(template % (rounds, plain, decrypted.decode("utf-8"))) + +# Footnote: Keys should be erased fm memory as soon as possible after use, +# and that includes Python. For a tip on how to do that in Python, see +# http://buggywhip.blogspot.com/2010/12/erase-keys-and-credit-card-numbers-in.html + +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- From 8b703c15058e620c527488280dd63e9f1fb3d4ee Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Fri, 11 Aug 2017 02:16:26 -0700 Subject: [PATCH 1046/1192] remove traling space for Travis --- demos/demo_dynamic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index 7333beb19..ce404b66e 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -266,7 +266,7 @@ def crypt(self, datain): template = '\n ChaCha%d ciphertext for "%s" is "%s"' print template % (rounds, plain, cipher.encode('hex')) - + # reset to decrypt cha.set_iv32(iv) decrypted = cha.crypt(cipher) From 6bbb450d40a4eecbb578a9e906cc9f643e880021 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Fri, 11 Aug 2017 02:17:31 -0700 Subject: [PATCH 1047/1192] remove trailing space --- demos/demo_dynamic.py3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/demo_dynamic.py3 b/demos/demo_dynamic.py3 index 3dc318eb1..568790a95 100644 --- a/demos/demo_dynamic.py3 +++ b/demos/demo_dynamic.py3 @@ -298,7 +298,7 @@ if SHOW_CHACHA_EXAMPLE: template = '\n ChaCha%d ciphertext for "%s" is "%s"' print(template % (rounds, plain, hexlify(cipher))) - + cha.set_iv32(iv) # reset to decrypt decrypted = cha.crypt(cipher) From 2a52c68f2ea7cbf4a49812bea80546ec27ec1fa3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 13 Aug 2017 14:54:39 +0200 Subject: [PATCH 1048/1192] fix lint issues from #199 --- src/encauth/gcm/gcm_test.c | 1 - src/encauth/ocb3/ocb3_decrypt.c | 8 +++----- src/encauth/ocb3/ocb3_encrypt.c | 8 +++----- src/encauth/ocb3/ocb3_test.c | 2 +- src/pk/ecc/ltc_ecc_map.c | 2 +- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/encauth/gcm/gcm_test.c b/src/encauth/gcm/gcm_test.c index 013402d91..5f68b30e0 100644 --- a/src/encauth/gcm/gcm_test.c +++ b/src/encauth/gcm/gcm_test.c @@ -342,7 +342,6 @@ int gcm_test(void) if ((err = gcm_add_iv(&gcm, tests[0].IV, tests[0].IVlen)) != CRYPT_OK) return err; /* intentionally skip gcm_add_aad + gcm_process */ if ((err = gcm_done(&gcm, T[0], &y)) != CRYPT_OK) return err; - if (compare_testvector(out[0], 0, tests[0].C, tests[0].ptlen, "GCM CT-special", 0)) return CRYPT_FAIL_TESTVECTOR; if (compare_testvector(T[0], y, tests[0].T, 16, "GCM Encrypt Tag-special", 0)) return CRYPT_FAIL_TESTVECTOR; for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { diff --git a/src/encauth/ocb3/ocb3_decrypt.c b/src/encauth/ocb3/ocb3_decrypt.c index 1824bc3ab..4973bd2fa 100644 --- a/src/encauth/ocb3/ocb3_decrypt.c +++ b/src/encauth/ocb3/ocb3_decrypt.c @@ -30,11 +30,9 @@ int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt_b, *ct_b; LTC_ARGCHK(ocb != NULL); - if (ct == NULL) LTC_ARGCHK(ctlen == 0); - if (ctlen != 0) { - LTC_ARGCHK(ct != NULL); - LTC_ARGCHK(pt != NULL); - } + if (ctlen == 0) return CRYPT_OK; /* no data, nothing to do */ + LTC_ARGCHK(ct != NULL); + LTC_ARGCHK(pt != NULL); if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { return err; diff --git a/src/encauth/ocb3/ocb3_encrypt.c b/src/encauth/ocb3/ocb3_encrypt.c index 33495544e..337b02530 100644 --- a/src/encauth/ocb3/ocb3_encrypt.c +++ b/src/encauth/ocb3/ocb3_encrypt.c @@ -30,11 +30,9 @@ int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *pt_b, *ct_b; LTC_ARGCHK(ocb != NULL); - if (pt == NULL) LTC_ARGCHK(ptlen == 0); - if (ptlen != 0) { - LTC_ARGCHK(pt != NULL); - LTC_ARGCHK(ct != NULL); - } + if (ptlen == 0) return CRYPT_OK; /* no data, nothing to do */ + LTC_ARGCHK(pt != NULL); + LTC_ARGCHK(ct != NULL); if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { return err; diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index bd3014400..31d3f940a 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -204,7 +204,7 @@ int ocb3_test(void) int err, x, idx, res; unsigned long len; - unsigned char outct[MAXBLOCKSIZE], outtag[MAXBLOCKSIZE]; + unsigned char outct[MAXBLOCKSIZE] = { 0 }, outtag[MAXBLOCKSIZE] = { 0 }; ocb3_state ocb; /* AES can be under rijndael or aes... try to find it */ diff --git a/src/pk/ecc/ltc_ecc_map.c b/src/pk/ecc/ltc_ecc_map.c index 0cc699c94..c745f299c 100644 --- a/src/pk/ecc/ltc_ecc_map.c +++ b/src/pk/ecc/ltc_ecc_map.c @@ -38,7 +38,7 @@ int ltc_ecc_map(ecc_point *P, void *modulus, void *mp) LTC_ARGCHK(mp != NULL); if ((err = mp_init_multi(&t1, &t2, NULL)) != CRYPT_OK) { - return CRYPT_MEM; + return err; } /* first map z back to normal */ From de8a53a2e56be16ea806baa56203fcb197071ad2 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 13 Aug 2017 18:15:44 +0200 Subject: [PATCH 1049/1192] ocb3_test cosmetics [skip ci] --- src/encauth/ocb3/ocb3_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/encauth/ocb3/ocb3_test.c b/src/encauth/ocb3/ocb3_test.c index 31d3f940a..a3e5062bb 100644 --- a/src/encauth/ocb3/ocb3_test.c +++ b/src/encauth/ocb3/ocb3_test.c @@ -204,7 +204,8 @@ int ocb3_test(void) int err, x, idx, res; unsigned long len; - unsigned char outct[MAXBLOCKSIZE] = { 0 }, outtag[MAXBLOCKSIZE] = { 0 }; + unsigned char outct[MAXBLOCKSIZE] = { 0 }; + unsigned char outtag[MAXBLOCKSIZE] = { 0 }; ocb3_state ocb; /* AES can be under rijndael or aes... try to find it */ From bb9d39797578cfbb0d5ea2a708eee661480e3673 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 14 Aug 2017 16:55:01 +0200 Subject: [PATCH 1050/1192] default ChaCha to ChaCha20 --- src/stream/chacha/chacha_setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c index e3a7f40af..e34370b86 100644 --- a/src/stream/chacha/chacha_setup.c +++ b/src/stream/chacha/chacha_setup.c @@ -35,6 +35,8 @@ int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keyle LTC_ARGCHK(key != NULL); LTC_ARGCHK(keylen == 32 || keylen == 16); + if (rounds == 0) rounds = 20; + LOAD32L(st->input[4], key + 0); LOAD32L(st->input[5], key + 4); LOAD32L(st->input[6], key + 8); From 1fa8caff6c91797f4a4cb450a6d162f8e181c1c8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 16 Aug 2017 11:52:40 +0200 Subject: [PATCH 1051/1192] fix call to gettimeofday() as of `man gettimeofday` "The use of the timezone structure is obsolete; the tz argument should normally be specified as NULL." --- tests/test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test.c b/tests/test.c index 3cac645c7..212dc149a 100644 --- a/tests/test.c +++ b/tests/test.c @@ -73,8 +73,7 @@ static ulong64 epoch_usec(void) return cur_time; #else struct timeval tv; - struct timezone tz; - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); return (ulong64)(tv.tv_sec) * 1000000 + (ulong64)(tv.tv_usec); /* get microseconds */ #endif } From 5d3e2d1e906f413366ee3efa63bf2037d2bf2f0b Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Wed, 16 Aug 2017 23:49:39 -0700 Subject: [PATCH 1052/1192] Update demo_dynamic.py clean comments --- demos/demo_dynamic.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index ce404b66e..51aaf3335 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -114,7 +114,6 @@ #------------------------------------------------------------------------------- # get individually named constants and sizes -# print selected constants if SHOW_SELECTED_CONSTANTS: print '-'*60 print '\n selected constants:' @@ -133,7 +132,6 @@ print ' %-25s %d' % (name, value) print -# print selected sizes if SHOW_SELECTED_SIZES: print '-'*60 print '\n selected sizes:' From 147a40624391affc6eb7965dfea4e02e97afdf1c Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Wed, 16 Aug 2017 23:50:23 -0700 Subject: [PATCH 1053/1192] Update demo_dynamic.py3 clean comments --- demos/demo_dynamic.py3 | 2 -- 1 file changed, 2 deletions(-) diff --git a/demos/demo_dynamic.py3 b/demos/demo_dynamic.py3 index 568790a95..f73d617d6 100644 --- a/demos/demo_dynamic.py3 +++ b/demos/demo_dynamic.py3 @@ -145,7 +145,6 @@ if SHOW_ALL_SIZES: #------------------------------------------------------------------------------- # get individually named constants and sizes -# print selected constants if SHOW_SELECTED_CONSTANTS: print('-'*60) print('\n selected constants:') @@ -164,7 +163,6 @@ if SHOW_SELECTED_CONSTANTS: print(' %-25s %d' % (name.decode("utf-8"), value)) print(' ') -# print selected sizes if SHOW_SELECTED_SIZES: print('-'*60) print('\n selected sizes:') From ae162109397dc68bbc68fa0c22331427628f6942 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Thu, 17 Aug 2017 21:06:50 -0700 Subject: [PATCH 1054/1192] Delete demo_dynamic.py --- demos/demo_dynamic.py | 281 ------------------------------------------ 1 file changed, 281 deletions(-) delete mode 100644 demos/demo_dynamic.py diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py deleted file mode 100644 index 51aaf3335..000000000 --- a/demos/demo_dynamic.py +++ /dev/null @@ -1,281 +0,0 @@ - - -""" - demo_dynamic.py v2b - - This program demonstrates Python's use of the dynamic - language support additions to LTC, namely access to LTC - constants, struct and union sizes, and the binding of a - math package to LTC. Also provided are simple code - fragments to illustrate how one might write a Python - wrapper for LTC and how an app might call the wrapper. - This or a similar model should work for Ruby and other - dynamic languages. - - This instance uses Python's ctypes and requires a single - .dylib linking together LTC and a math library. Building - a single .dylib is needed because LTC wants a fairly tight - relationship between itself and the mathlib. (ctypes can - load multiple .dylibs, but it does not support this level - of tight coupling between otherwise independent libraries.) - - My .dylib was created on OSX/macOS with the following: - sudo make -j5 -f makefile.shared \ - CFLAGS="-DUSE_TFM -DTFM_DESC -I/usr/local/include" \ - EXTRALIBS=/usr/local/lib/libtfm.a install - - For python 2.7.12 on Ubuntu Xenial the following worked for - me (without MPI support): - sudo make -f makefile.shared install PREFIX="/usr" - - Reminder: you don't need to bind in a math library unless - you are going to use LTC functions that need a - mathlib. For example, public key crypto requires - a mathlib; hashing and symmetric encryption do not. - - This code was written for Python 2.7 with the ctypes standard - library. - - Larry Bugbee - March 2014 v1 - August 2017 v2b - -""" - - -from ctypes import * -from ctypes.util import find_library - -# switches to enable/disable selected output -SHOW_ALL_CONSTANTS = True -SHOW_ALL_SIZES = True -SHOW_SELECTED_CONSTANTS = True -SHOW_SELECTED_SIZES = True -SHOW_BUILD_OPTIONS_ALGS = True -SHOW_SHA256_EXAMPLE = True -SHOW_CHACHA_EXAMPLE = True - -print -print(' demo_dynamic.py') - - -#------------------------------------------------------------------------------- -# load the .dylib - -libname = 'tomcrypt' -libpath = find_library(libname) -print -print(' path to library %s: %s' % (libname, libpath)) - -LTC = cdll.LoadLibrary(libpath) -print(' loaded: %s' % LTC) -print - - -#------------------------------------------------------------------------------- -# get list of all supported constants followed by a list of all -# supported sizes. One alternative: these lists may be parsed -# and used as needed. - -if SHOW_ALL_CONSTANTS: - print '-'*60 - print ' all supported constants and their values:' - - # get size to allocate for constants output list - str_len = c_int(0) - ret = LTC.crypt_list_all_constants(None, byref(str_len)) - print ' need to allocate %d bytes to build list \n' % str_len.value - - # allocate that size and get (name, size) pairs, each pair - # separated by a newline char. - names_sizes = c_buffer(str_len.value) - ret = LTC.crypt_list_all_constants(names_sizes, byref(str_len)) - print names_sizes.value - print - - -if SHOW_ALL_SIZES: - print '-'*60 - print ' all supported sizes:' - - # get size to allocate for sizes output list - str_len = c_int(0) - ret = LTC.crypt_list_all_sizes(None, byref(str_len)) - print ' need to allocate %d bytes to build list \n' % str_len.value - - # allocate that size and get (name, size) pairs, each pair - # separated by a newline char. - names_sizes = c_buffer(str_len.value) - ret = LTC.crypt_list_all_sizes(names_sizes, byref(str_len)) - print names_sizes.value - print - - -#------------------------------------------------------------------------------- -# get individually named constants and sizes - -if SHOW_SELECTED_CONSTANTS: - print '-'*60 - print '\n selected constants:' - - names = [ - 'ENDIAN_LITTLE', - 'ENDIAN_64BITWORD', - 'PK_PUBLIC', - 'MAX_RSA_SIZE', - 'CTR_COUNTER_BIG_ENDIAN', - ] - for name in names: - const_value = c_int(0) - rc = LTC.crypt_get_constant(name, byref(const_value)) - value = const_value.value - print ' %-25s %d' % (name, value) - print - -if SHOW_SELECTED_SIZES: - print '-'*60 - print '\n selected sizes:' - - names = [ - 'rijndael_key', - 'rsa_key', - 'symmetric_CTR', - 'twofish_key', - 'ecc_point', - 'gcm_state', - 'sha512_state', - ] - for name in names: - size_value = c_int(0) - rc = LTC.crypt_get_size(name, byref(size_value)) - value = size_value.value - print ' %-25s %d' % (name, value) - print - - -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# LibTomCrypt exposes one interesting string that can be accessed -# via Python's ctypes module, "crypt_build_settings", which -# provides a list of this build's compiler switches and supported -# algorithms. If someday LTC exposes other interesting strings, -# they can be found with: -# nm /usr/local/lib/libtomcrypt.dylib | grep " D " - -def get_named_string(lib, name): - return c_char_p.in_dll(lib, name).value - -if SHOW_BUILD_OPTIONS_ALGS: - print '-'*60 - print 'This is a string compiled into LTC showing compile ' - print 'options and algorithms supported by this build \n' - print get_named_string(LTC, 'crypt_build_settings') - - -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# here is an example of how Python code can be written to access -# LTC's implementation of SHA256 and ChaCha, - -# - - - - - - - - - - - - - -# definitions - -def _get_size(name): - size = c_int(0) - rc = LTC.crypt_get_size(name, byref(size)) - if rc != 0: - raise Exception('LTC.crypt_get_size(%s) rc = %d' % (name, rc)) - return size.value - -def _get_constant(name): - constant = c_int(0) - rc = LTC.crypt_get_constant(name, byref(constant)) - if rc != 0: - raise Exception('LTC.crypt_get_constant(%s) rc = %d' % (name, rc)) - return constant.value - -def _err2str(err): - # define return type - errstr = LTC.error_to_string - errstr.restype = c_char_p - # get and return err string - return errstr(err) - -CRYPT_OK = _get_constant('CRYPT_OK') - -class SHA256(object): - def __init__(self): - self.state = c_buffer(_get_size('sha256_state')) - LTC.sha256_init(byref(self.state)) - def update(self, data): - LTC.sha256_process(byref(self.state), data, len(data)) - def digest(self): - md = c_buffer(32) - LTC.sha256_done(byref(self.state), byref(md)) - return md.raw - -class ChaCha(object): - def __init__(self, key, rounds): - self.state = c_buffer(_get_size('chacha_state')) - self.counter = c_int(1) - err = LTC.chacha_setup(byref(self.state), key, len(key), rounds) - if err != CRYPT_OK: - raise Exception('LTC.chacha_setup(), err = %d, "%s"' % (err, _err2str(err))) - def set_iv32(self, iv): - err = LTC.chacha_ivctr32(byref(self.state), iv, len(iv), byref(self.counter)) - if err != CRYPT_OK: - raise Exception('LTC.chacha_ivctr32(), err = %d, "%s"' % (err, _err2str(err))) - def crypt(self, datain): - dataout = c_buffer(len(datain)) - err = LTC.chacha_crypt(byref(self.state), datain, len(datain), byref(dataout)) - if err != CRYPT_OK: - raise Exception('LTC.chacha_crypt(), err = %d, "%s"' % (err, _err2str(err))) - return dataout.raw - -# - - - - - - - - - - - - - -# a SHA256 app fragment - -# from wrapper import * # uncomment in real life - -if SHOW_SHA256_EXAMPLE: - print '-'*60 - data = 'hello world' - - sha256 = SHA256() - sha256.update(data) - md = sha256.digest() - - template = '\n the SHA256 digest for "%s" is %s \n' - print template % (data, md.encode('hex')) - -# - - - - - - - - - - - - - -# a ChaCha app fragment - -if SHOW_CHACHA_EXAMPLE: - print '-'*60 - key = 'hownowbrowncow\x00\x00' # exactly 16 or 32 bytes - rounds = 12 # common values: 8, 12, 20 - iv = '123456789012' # exactly 12 bytes - plain = 'Kilroy was here, there, and everywhere!' - - cha = ChaCha(key, rounds) - cha.set_iv32(iv) - cipher = cha.crypt(plain) - - template = '\n ChaCha%d ciphertext for "%s" is "%s"' - print template % (rounds, plain, cipher.encode('hex')) - - # reset to decrypt - cha.set_iv32(iv) - decrypted = cha.crypt(cipher) - - template = ' ChaCha%d decoded text for "%s" is "%s" \n' - print template % (rounds, plain, decrypted) - -# Footnote: Keys should be erased fm memory as soon as possible after use, -# and that includes Python. For a tip on how to do that in Python, see -# http://buggywhip.blogspot.com/2010/12/erase-keys-and-credit-card-numbers-in.html - -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- From 631de35ee37e7e51b2bf5cd729798f9e6b58107c Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Thu, 17 Aug 2017 21:11:59 -0700 Subject: [PATCH 1055/1192] Update and rename demo_dynamic.py3 to demo_dynamic.py this version runs under python2 and python3 so only one version need be distributed --- demos/{demo_dynamic.py3 => demo_dynamic.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename demos/{demo_dynamic.py3 => demo_dynamic.py} (99%) diff --git a/demos/demo_dynamic.py3 b/demos/demo_dynamic.py similarity index 99% rename from demos/demo_dynamic.py3 rename to demos/demo_dynamic.py index f73d617d6..c29df4948 100644 --- a/demos/demo_dynamic.py3 +++ b/demos/demo_dynamic.py @@ -1,7 +1,7 @@ """ - demo_dynamic.py3 v2b + demo_dynamic.py v2b This program demonstrates Python's use of the dynamic language support additions to LTC, namely access to LTC From 3794ecaf942de766aaef944345e2f95fbe8ab779 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Fri, 18 Aug 2017 20:34:03 -0700 Subject: [PATCH 1056/1192] Update demo_dynamic.py removed trailing spaces --- demos/demo_dynamic.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index c29df4948..6c21f92cc 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -34,17 +34,17 @@ a mathlib; hashing and symmetric encryption do not. ------ - + This code was originally written for Python 2.7 with the ctypes standard library. This version was modified so that it would run under both Python 2.7 and 3.6. You might want to run a diff on the .py and .py3 files to see the differences - between the two languages. - + between the two languages. + Arguably the biggest change for Python3 has to do with strings. Under Python2, native strings are ASCII bytes and passing them to LTC is natural and requires no conversion. - Under Python3 all native strings are Unicode which requires + Under Python3 all native strings are Unicode which requires they be converted to bytes before use by LTC. Note the following for Python3. @@ -56,11 +56,10 @@ If so, use .decode('utf-8'). - The Python2 'print' statement becomes a function in Python3 which requires parenthesis, eg. 'print()'. - + NB: Unicode is achieved under Python2 by either defining a Unicode string with a 'u' prefix or passing ASCII strings thru the 'unicode()' function. - Larry Bugbee March 2014 v1 From de6ac748c77732ccae289a696fdc88852916be48 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Sat, 19 Aug 2017 16:29:48 -0700 Subject: [PATCH 1057/1192] refine comments --- demos/demo_dynamic.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index 6c21f92cc..dbfb10a13 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -36,10 +36,8 @@ ------ This code was originally written for Python 2.7 with the - ctypes standard library. This version was modified so that - it would run under both Python 2.7 and 3.6. You might want - to run a diff on the .py and .py3 files to see the differences - between the two languages. + ctypes standard library. This version is modified to run + under both Python 2.7 and 3.6. Arguably the biggest change for Python3 has to do with strings. Under Python2, native strings are ASCII bytes and From 0afbefc5495037d37e32b51535d5f70d0fdb2b91 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 23 Aug 2017 22:35:32 +0200 Subject: [PATCH 1058/1192] bump version --- doc/Doxyfile | 2 +- src/headers/tomcrypt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index 24ce8b123..d01b02e75 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = LibTomCrypt # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.18.0-rc2 +PROJECT_NUMBER = 1.18.0-rc3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index aecd674ed..8c9b36f7a 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -27,7 +27,7 @@ extern "C" { /* version */ #define CRYPT 0x0118 -#define SCRYPT "1.18.0-rc2" +#define SCRYPT "1.18.0-rc3" /* max size of either a cipher/hash block or symmetric key [largest of the two] */ #define MAXBLOCKSIZE 128 From 041b7aa5c0036ec0dabc7e6f47a3548387b365f1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 23 Aug 2017 22:35:35 +0200 Subject: [PATCH 1059/1192] Update makefiles --- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index b6021afae..3f457e486 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -27,7 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc2 +VERSION=1.18.0-rc3 #Libraries to be created LIBMAIN_S =libtomcrypt.a diff --git a/makefile.msvc b/makefile.msvc index 0f7cae4f3..a351a3c98 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -22,7 +22,7 @@ EXTRALIBS = ../libtommath/tommath.lib #Compilation flags LTC_CFLAGS = /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 $(CFLAGS) LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) -VERSION=1.18.0-rc2 +VERSION=1.18.0-rc3 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib diff --git a/makefile.unix b/makefile.unix index 1f5d033c8..f371ca899 100644 --- a/makefile.unix +++ b/makefile.unix @@ -39,7 +39,7 @@ EXTRALIBS = ../libtommath/libtommath.a #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc2 +VERSION=1.18.0-rc3 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a diff --git a/makefile_include.mk b/makefile_include.mk index 6f6211a4f..52392f995 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -3,7 +3,7 @@ # (GNU make only) # The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh -VERSION=1.18.0-rc2 +VERSION=1.18.0-rc3 VERSION_PC=1.18.0 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION_LT=0:118 From 33e70b427aa8d11e1430307876a11df6150edf0a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 26 Aug 2017 12:03:35 +0200 Subject: [PATCH 1060/1192] CRYPT_INVALID_KEYSIZE isn't only used for block ciphers --- src/misc/error_to_string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/error_to_string.c b/src/misc/error_to_string.c index 8a5baeffb..2a0d3f80c 100644 --- a/src/misc/error_to_string.c +++ b/src/misc/error_to_string.c @@ -20,7 +20,7 @@ static const char * const err_2_str[] = "CRYPT_ERROR", "Non-fatal 'no-operation' requested.", - "Invalid keysize for block cipher.", + "Invalid key size.", "Invalid number of rounds for block cipher.", "Algorithm failed test vectors.", From b49ce35b2cebc7ccae4ff4f746b7b7e8a87ffab4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 26 Aug 2017 12:05:53 +0200 Subject: [PATCH 1061/1192] fix DH timing when compiling with TFM support --- demos/timing.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/demos/timing.c b/demos/timing.c index 2bb6e6c2c..14a59df31 100644 --- a/demos/timing.c +++ b/demos/timing.c @@ -902,7 +902,12 @@ static void time_dh(void) ulong64 t1, t2; unsigned long i, x, y; int err; - static unsigned long sizes[] = {768/8, 1024/8, 1536/8, 2048/8, 3072/8, 4096/8, 6144/8, 8192/8, 100000}; + static unsigned long sizes[] = {768/8, 1024/8, 1536/8, 2048/8, +#ifndef TFM_DESC + 3072/8, 4096/8, 6144/8, 8192/8, +#endif + 100000 + }; for (x = sizes[i=0]; x < 100000; x = sizes[++i]) { t2 = 0; From bb42345234f994525367f890770efc2e7f694190 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 26 Aug 2017 12:07:24 +0200 Subject: [PATCH 1062/1192] fix missing registration of PRNG's in ltcrypt --- demos/ltcrypt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/ltcrypt.c b/demos/ltcrypt.c index 542554616..024c00548 100644 --- a/demos/ltcrypt.c +++ b/demos/ltcrypt.c @@ -47,6 +47,7 @@ int main(int argc, char *argv[]) /* register algs, so they can be printed */ register_all_ciphers(); register_all_hashes(); + register_all_prngs(); if (argc < 4) { if ((argc > 2) && (!strcmp(argv[1], "-t"))) { From 105abdd8cd052f5cfc5ffa5e6c8ad984b94f3e26 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 24 Aug 2017 22:36:13 +0200 Subject: [PATCH 1063/1192] GCM: 0 size IV is not valid #273 --- demos/tv_gen.c | 2 +- notes/gcm_tv.txt | 520 +++++++++++++++++----------------- src/encauth/gcm/gcm_add_aad.c | 2 + 3 files changed, 259 insertions(+), 265 deletions(-) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 9d07eba16..86abf770a 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -577,7 +577,7 @@ void gcm_gen(void) key[z] = (z & 255); } - for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){ + for (y1 = 1; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){ for (z = 0; z < y1; z++) { plaintext[z] = (unsigned char)(z & 255); } diff --git a/notes/gcm_tv.txt b/notes/gcm_tv.txt index 1e9984581..0e3962cfd 100644 --- a/notes/gcm_tv.txt +++ b/notes/gcm_tv.txt @@ -3,282 +3,274 @@ are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag step repeated sufficiently. The nonce is fixed throughout at 13 bytes 000102... GCM-aes (16 byte key) - 0: , C6A13B37878F5B826F4F8162A1C8D879 - 1: F1, 397F649A20F3F89A00F45BF230F26B61 - 2: D6B8, 1653F67C9C716D0FC59F3B14154DECBF - 3: 673456, E82EFC79B30CA5235E2DC8BE4C14265D - 4: 26DD7C26, B8D1F4DB845F7D7079DEB8920949C14D - 5: DA62AD1487, 828A42329320764E5FB74D44A6108F4B - 6: FB79F7D51742, 865415BD049E86F3DA2E0B6E25E1A50C - 7: 9D96D1034166BF, 50669247A5B338E183DE5139831CD6A4 - 8: B466050E1330B20A, CB264FA7853A1FFE86E1A07CFA7C7319 - 9: CF16F0B3D9FC6183DF, 647DD6E1F40F385E1DFE6676FB036242 - 10: 14D90928C7236050096F, 930CAAA5536406218885475CA823A973 - 11: 4F2322D66A7079BD7DF519, 3B3931D47413042FAF1313F1041509A3 - 12: F1497906F1D8F4F9E47E4BE9, 469FB0D62828427C2E9BA04041A1424F - 13: 2FAFA2A3EEA4C000702E58D1D4, C9A484FC4ED8644A06060DAE2C3D1568 - 14: 5D707F8ACF319413D220AA2FC2B2, 0EE9AAF5B1CF622ECF6C4F5E5FF4656A - 15: 2C19DBF966D24B2713F82B69934060, 8676246A2F7795ABD435B3C6B4EA6E7A - 16: B3FED6C2315CE6D98729DBE69270A11E, B8AC739AD154744A33E906C34D91BD4B - 17: B2BC44CE088BC3F654B9703D9C691F17B3, BAD8314A171BC0119942136C5876AACC - 18: C6E958E3E9AC836C9626BD66478974D26B0C, 4E6D61833E9DB839117B665A96DC686C - 19: D40FADD078B474EBCE130FB44DDB4824077988, F43E3CD978A6E328AF039CC70E291E1C - 20: E177B3DF83A117E55F255A6C2CD78AFDAFDA307F, EEF1ABAAB9CBE0EE317CC79E7E5E24B8 - 21: DBB4569B3E305E4525F1F7B3D2AFEF226F397E661D, 65ACFB70132EEE1D47319A550A506DB5 - 22: AC2CAF77718DE59131A6B745DE9F3A9897B17580EC71, D8DB9006A9597F640F2594340D69E551 - 23: 8F62022F72A0D769D2D095A55E28832950870B2B44B0BE, A7E196F869071B7BB713E8A2D15627E9 - 24: 37F5640F820384B35F13F8C8C7DC31BDE1E4F29DCFBDA321, D5765C39DBCA72AC89100CCB8864E1DB - 25: 25059BFC302D0F8DD41BB22CF2391D456630C06F1DAF4DFA86, DC2FFD153C788C28D251B78AB8B7388C - 26: 151F158CC4BA9393FDB153C4C72911C120BAB519FAF64719133D, C61915006038BF15DED603832FD179DE - 27: F5DCF4231482F72D02F8B9BE0A41113D35AEA1CD85021CEC978D9C, 9CBD02C557180FBD0868C87A0BEA25AE - 28: 5D88B5554A2ED73054226473676FAA7159CE12B5357D635DDED35B5A, 5AD11CD6B14C59E64B5B26DFBD00FB5C - 29: 5696C7066EA09A30FC8BCBAD96D48A5E5FBCC8756B770F0A89B8711911, B9EA5F3BEF0599D385A9ACEBE4064498 - 30: 1240FED47B305AC1883F8CF137D58E79052B4E686DCA1423A6A2BECBD5F5, 036A5EA5F4F2D0BF397E8896EB7AB03D - 31: AD9517BF392C1EB56D78EDE1C41F3C73B72304DA47F400C390C86B37A50C2A, EB3E026D518EED47F6C927525746AC54 - 32: 2AE1CEED83C6490A7E5752E91532406EAC6FF4B11AA770EFFF1B255FDB77C528, 74BFBC7F120B58FA2B5E988A41EAF7AC + 1: 3A, 03C32E0E9D7E07A410B9BEE40A8F0D26 + 2: 26AE, 3A635BBDC1A17CA40B58CEEA78105CDC + 3: 142FAC, 7E8922E8FA6F1E41E4339F0B52176DE4 + 4: 20C1863F, A1D12620C22EA7A0AA0E74667A20B8E1 + 5: B3B796AA54, 53F0F9F03791BBD76BC99D1B5639F3C0 + 6: FDCFF8EA82D8, B56076B42E3EEAC73DD42FC83B9220F9 + 7: 4695E719E67849, B4A1A2E29AAD713D5677CF425E65A400 + 8: EE5BA3309D417697, 146EA95CED151F8C40DF98C1CC54930B + 9: 13FF05ABB084FA608F, 55550AADC3461CC190CA22F29C6246CD + 10: 008B0102208A22D3A562, 7178534BC7145754BAE525CC06E14A6B + 11: 3536DBBB07B026E78E94C8, AB27183AEA2240B0166D702EEB2A7BFA + 12: 00739D5A27AE82AC7D6A40EC, 4354578C3D241074D3C1F6496420F239 + 13: DA41A5F458400C94B84026C052, DC6CB036FCAE9765A69F5B8C38B0B767 + 14: 4C99797C7EDCEA9D5425565522E2, 3FFEEC557F0D5FA73472D2A3F8E71389 + 15: D381E7AD2E5BE2C97FB4BD958BC2EB, 6BF713D4E7DA7C4290967A1D23F97EDD + 16: 5016C127F16A4787734AF3A3E6F6F0F7, 8CD8458531E94BC8160E2176F63F8D0B + 17: BDF3D0F24D9415AB5CF9B87BB45B4A8AE4, D81A3D56451313742ACE53D41223F6AF + 18: 68C1FCBE22FBDB296C246F2E34D871A6902E, 7AFD64D4EB0DE7E2A842B518AC6D483F + 19: 7D8D3C31E643611B0B557F29B437F635FE3FD0, 8501B61DBF4A4DD19B87E95055B95962 + 20: 4185EEB0B9B480F69B3EC7A162810073A36AD95A, B9BCA6D9CA0AC2B4B35D7BFF4DB27D25 + 21: F991F4A481E322FEEC6FE9302D010AC4C811B23B4A, 54FA4DDA92E57509F4D48D206A03624F + 22: B288424FF96596B2A30A1EB9480F5EADC2F6D8551B9A, 2C998C8DFDC7663C8DE677B2F1CBCB57 + 23: 1066FE3DCB9F8AE0DC0693F7179F111E0A7A1FFE944FF4, 65402D1F8AFBDC819D6D1ADB5375AFD0 + 24: 0A8772CCDE122EFF01D7C187C77F07BDA50997B4320CD0D8, F55823AFC3D9FE6E749E70E82C823925 + 25: E6E2FBB3E2238BC8CB396F463C2F488B4B4933087728D39815, F06DA35A9AEE65F9AD0DAD5B99AB4DF6 + 26: 569BD39CB1693CB89B88923ABE0D8CFA0B4F22A48A15E2EACD4A, 661AF51FF0E0E363406AB278BFC9176D + 27: 199EED81C2428170EB089060FF9676596EADD2270895A0C8650903, 90AA9C634469D45E7BDD9AB955B90130 + 28: B5200497A0654009B9F5B0D45FFDCF192F3042D6B05C6D6A8191A7EA, 71F6C4982AA50705D5FFC60512FC674C + 29: E39DA262C0E851B5CB5BD55A8B19D0AC0ABDC6FF3F32DF3B1896242D9E, B58AA05F594FC9779E185353CC52B8FB + 30: AF349B91BAD4BE2F2D5E4DDE28A1AA74115A9059A5EBBF9E38F341DC368B, 966B04FE43A2A9D94004E756F7DBFEFA + 31: 8C87861DFFDE72FA64E926BF741330F64E2B30837650F309A3F979AE43BA2E, A5C825AE1B844D6A8D531077C881BD36 + 32: 924E178A17FA1CA0E7486F0404123B91DBF797BB9DBDE9B1D48D5C7F53165912, 10F972B6F9E0A3C1CF9CCF56543DCA79 GCM-rc6 (16 byte key) - 0: , D595FEDAB06C62D8C5290E76ED84601D - 1: 4D, 47A6EDEF8286F9C144B7B51C9BCCCACF - 2: 0085, 9788DDF89843EC51120B132EB0D0F833 - 3: 463701, 673CB8D248E6BECD5A6A7B0B08465EF6 - 4: F5B3222C, 1C424282D7FB427E55285E20FC2ABFF9 - 5: 3A4A8361B2, BD40E631B054F280C7973E5AB3F06B42 - 6: A475866BF2C5, 2067F42FAAA6274270CF9E65D833FDED - 7: 689D0D407172C8, 3BCCFFC64E56D5B753352E1DDD5CCAA3 - 8: D9CE4B051202A1D3, 79B0CCDA3D0B9C9BCF640BC9E6D9CE0D - 9: 0317D68BE098D276B7, AF35043DB6213DC5D4F3DFB8E29EE537 - 10: 154CEF0C6F37AA0A73C4, 61E598A8C6D17B639F9E27AF55DD00F3 - 11: C3DB1B2B6CCC9170B9C05F, 966871DDD6E110711FB9DD733B6B2B3A - 12: E4F22383C75BC0FB0E59C5E8, 971536AF878F4EED68F59046C928EAC8 - 13: 2FBFB99AABC6209FB8664916DD, 68D0BF2144AD1ADECC4074DAE58540C2 - 14: 5FEEDFD09BF89719A34CDCCD2AAA, 64DEB7D5E6891103AA54C0EB366715D0 - 15: E063A076E0C770FB010D26C3AC3EB5, 0CA321B2A7448FEEF84D4E0AD5BA2DA4 - 16: AFB0DB9959F0906BD346C2D81DC5412C, 425627895E2C4C9546D3227975585459 - 17: 79179C0D4D6C5E0741DD4CA1E8CF28C75C, D0188A344A1CEE52272FE6368DB0FB75 - 18: 8A75521139B0DE3C08C9EAEB77D8018A39FE, 47FCC200D8A384320D2F1A5E803A9991 - 19: 0399381D0A975AE3980A9FB75B991C055AF367, 034915370AF94B96A8A4E50FF9B134CC - 20: 8C189094DB13FBE62EA5C4A53C29A428ED587BA2, 99C58F838423033298897841ED526347 - 21: D91F5144B525AF5D47EF4D5F0AF9915447A55927F9, F6750BF7E089515D35B47BC1C65E2E3A - 22: A4E26B554AA277057A5FE3FA08A6138CEEC6D69BB1D8, 7BBEBF52D8251108C7AA1025E213EC44 - 23: 5C1A8C3A46FCA90D73675706313CADFBB90A535A4B3D5A, E35244A2633478BBDAFCC81161F28B80 - 24: D69F7264FC594057B89181B83582D799AE54E9EE4FE8AD48, D4B29E5C25F9477D9345526DBDE9372A - 25: AFD322D0AC4AF38D5B9CBE0DFE85618C001A7A77CD8FFFCB3E, AD06BB9C59D23D258D6A2AEDD946AA20 - 26: 179CA8395CD8E75B4E5EA07D25C8036AF08B1A1C330492523D36, E3704C4341A834C087500E332B7DEAE9 - 27: B9178EF7774684F43F1FCE99A4319B5A4D167B0A848551F562CD7C, 5D5082FB02B9B494D5883DF49DB3B84B - 28: 830FCD15A09EC61245D7DA258E308E76D3B542F2345DBFC11AE983A3, F50C3332F8D91911BDACCFE228565E5C - 29: 179619B8C7EE9B3121405BBED2AC102A027E6C97EAEDB5ECFEB13792EF, 859EBA3BADCE6E5AB271A261B26DE28C - 30: 14264C7E0A154119BF24B7FCF434E81440D42D54738F0BAE55836849AB85, 0B6C9B9CADB1B6EC71CEA090C8C72834 - 31: 0D7A316F8B873F62CF26CFC569179AB11CBF09D3467936A85ADC265B2C9A8F, 866AE7C51EC2D9DEB32748A1C8B61143 - 32: F8FD1F967CD3632805AD7FA8ECB40F530927DD5C49D31FDBAE49738E2315905D, 9CB1CB84A727C9F42555EB566E0A1DEE + 1: 16, 2CA928694EA91AF92B3ADB402FBBCDEE + 2: CD9D, 4A9940BD7148F08AE75A4F238148C174 + 3: 6D1332, 5CD73043FD797D1375AA011D2E36896A + 4: ADC34199, FF5D2B40B02CB58BC63AA6D1CFBA811B + 5: 83158D52A1, CB8C45A56D7539CBACBB85DFB4C1F52E + 6: 66E32F053C17, 3EB9AC9A066DC66DB4973B5C78C6EC0B + 7: F23224FEB14897, 0ED4890D034F20A9A78ACA7492AE9341 + 8: 3FF9570F77486C86, B82C19DE2C5CA6CAAC223F337173F840 + 9: 44B4F4130619FD516C, 6689DC410118E0DC2D90ADCD6327049B + 10: 6E205B2537935E50A1E3, CE5739FDFC13D279075508786388C08D + 11: DB836471D91F2FFC6A199E, 1518E9A6CD2190D32A9EA1AC0849DF09 + 12: B9936A58667AABD9BB9B2ADA, 388894E75CEF512CD5E3986DFB2CA589 + 13: 1B5072C8FC0EA19A0486C0E04C, A804D99E2414A314440E5F4B8BDCFB45 + 14: 614903F301B1E7C092E9A32C195C, B4F7406533C58AC54869F09C4B0801CE + 15: F30ADEF328878D174B1AEAF5D7137D, 7C5BB92772540C1E2209B77C78AAB092 + 16: 776D20B980DDC7C48ACE4225F59E2736, 85DAEE9785EB1BA9C99FFAA5AE565159 + 17: 6BBA225325564369BB5F11EF5734604938, E41E0E3C31F4B1770AB93750A386286C + 18: 6EAAF9EF0C149A13BA535A2AFC398281017D, 10CBB6A874711DE179D8A4EEDC4DE085 + 19: 9D0B62274F7E5426F5AD9515DAAF4742C291D9, A35D18485F881CB0BBB00A9421C9694C + 20: E6A18F640923DBB22FCBCEB0ACD1A2BC94256212, CFCFC7E7E5C64090DF746F8C36F605D4 + 21: E37EB92C38B47C6E2621C2CC64D83CCCA9104C2095, D88C0FBF2402FBA40EB525118FC2CAC8 + 22: 0E690F9D73E7E689AF48FE5B99E58AC42F3702EA40FD, 33D698F9C44FEB68C1C442B30DD36B9E + 23: DA759D58629FA946FB635538C1AED318890C4D84EB6610, D7BC6A69DA658EE3DB842C01B9085A07 + 24: 581F86B5A844FD709B13E09A7CF64ADEA84EFC2D7AD9300A, 0296F58775CE4D4E92C4DD0CF65CF8D7 + 25: 78B346A03098BD6EBE0BF56F5C37C83B3C42288D0E031E0D4B, 2F89EDA70B8A31EE64B264C7C5165AF1 + 26: ED768B0F18A13ACF40738FD61642C0CFBCF746D60887A8C5FDD9, 56EE211AB10B37D61FD80692A76615B0 + 27: FCC298575C9F4E1DD2C8B0482F9FFF42EFFE565ED5FB178DC56947, 0EBA843B28F91798D79E2105995EF662 + 28: 4341133DA062A885DA6D7BF4387C6F28829E65EA7DB7E50B15F2D03F, DAEFA9D1230FE3084FDB91AC7ED35503 + 29: 777C13A7FC16345BF949508CBC1051540928CB5B9B36569488109FB60E, C8DEE566513233B8E74ACB1046FE87B4 + 30: 6342B6FEDC0B8868AAB5E870CE1B2E420269CB11DBA74F10C5E978F2B44D, B2B001639A2A0BA045023817947573E4 + 31: 99A123D836EF76A4250A960DF7DCFA231C3595EAB53024F53B961EF80901ED, 02E8820F6D31A23DC9F0DCE511A1F8FF + 32: BF57034D1EA94A6DB86642918EDBC9CC7D6C39025F9EC528EAA2A9EE7B22EAA1, 7801231ADBA83C137D760AA75FF2C9E6 GCM-safer+ (16 byte key) - 0: , F769B436C7FB7C0C822E24BB2B2555D3 - 1: CA, B156298625F5634FA012B23044437807 - 2: 4960, A64C73E890F3D77B2C3B3C76C2D913C6 - 3: DBBB8D, 686651A017F89A22F9FE96533C85C52C - 4: 150AD99A, 177F7DE9E897DACCAB7EACEE3CDE7601 - 5: 077055065F, 48B4309C76CAC37BDF11842311BA6CD3 - 6: B2F8CE062C06, ED04DF96C06959524956E8AC5C338457 - 7: DCE718211410D8, 3F8D8180BDEAC2F018EA81615177CC8F - 8: 0F71E2772402AC83, 2130481B2CA7B4B4C8F3EE73B3B3C28F - 9: B69030734E5ADF753C, 8CC4B62BFBC3EA56CCDBF0ED318C784D - 10: 6B8A91ABC1BF2F2D0176, 86EAAD80D148A48086987A40A5631DEF - 11: 44AD00799EC8E62E34D6A1, 016830D58F06F75E54531B45D9E785F9 - 12: 0C4B9381D78E0F0A78B3CEAA, 4A79C58DAB131A22F172F9177DC4158B - 13: 2C56D4625876524B4D8D5F079B, 7B407F704225B25F1F136C984E564147 - 14: 36424D69BACC56407D345B3D7B4D, EB126C255A2DCFD32F69DD5CB61876C7 - 15: FDD3E091C0420D1A4D4A848757FCC2, D319C5C07134D67BA42A4BF312CD874D - 16: EFAF6F117EA9A4B4B83052BBF5A07DB9, BB09D473FE82257146E7ABC2EFF6F631 - 17: 19B71383C414BAC3EF252FFF09F5ACD777, 526DC9AE6895ED33A34A9A4ADB07E1B6 - 18: 9AB6DFDB930D26E00B3D98DD5AD014E08756, D70B95B20C106A5A03F9B803D2CAC3A0 - 19: EEB3C236C3031DE4C3F94BD746677AE84B271D, 9483BBCBBFDBA1CC5F6392DABA2ACC19 - 20: 3A0EBC7536F8717E8FDAFEDAC39E8F1F43C0627A, 3DA7DC2475466CEDF01EB543870A74FA - 21: 79D28D2F149E1D97E910342DF383FCEECF5AFD4C6A, 2364F33BCF6F07E381F7E26DAF802D83 - 22: F1D7C319BAFB740332CA19AB0C9B71728D3AE69BFAC2, 3D4AEE9780A5C98CBC69606CDDDB31F8 - 23: 1A0D80381A186673FB7B52C40AB6C46A11AB0889333C20, AF5C17E3D0D9724EDC1FC438A16B4EBB - 24: 5E503440B22DD6AE6401BA4355C8791BACC598C9E0F1412E, 156D8221BD61F5C108FC18FB2F50D159 - 25: 7784EFDC6F0FC56FCADAFF17BB52DEB35B64FA19C3F391BDFD, A291E8238EF158A2379692077F70E8D0 - 26: 184B6E18032D1A70CE5027912E447C357C72EEF7B20EF0FB256C, 0FA0138FB9480E0C4C237BF5D6099777 - 27: 7AC8FCB64F35B71C5ED0CCD776B1FF76CE352EB57244085ED34FE8, D995B3C1350CC777878108640C1CADAE - 28: 86C7A01FB2262A8E37FF38CC99BF3EFAEB8B36166D24913BDD3B91DA, 25EC6D9F69168C5FA32C39631B606B55 - 29: 91F5D3E3FE0B1976E2915B8DA3E785F4D55768FD727AEF19FA1552F506, AF902DED55E386F0FC4210C97DB9446E - 30: 7ABF5BD9CB2EFF8382C6D2B28C1B0B25540E434123AC252046BDDA74DA32, 713259EDDA9B1B63EB68E0283D0259DB - 31: 5634B23ACEF2874BE0591BE3268C4538698FF2D93D59B39BC86D0137DACBAD, C4054796AFD335B43C60E7E634122BAF - 32: F26C68C36B1E56449595EA4E162391E0C6A306592949F69797B6C2327E533ADB, 7B392AF776A94983078814B6B8428BFE + 1: 0F, 62E723CCA67DFC49C1915AD3C69FDFF7 + 2: 87A7, A73B3D416AD68235C662E9684430FAA0 + 3: 40FF80, 8EC11FFA3B777664FC6D2AD37AED3765 + 4: ED5B1716, 1A4FD3FDC9D197866FA8AA1403E3219F + 5: 033CF349B9, CA1E6111A5BF539931490D2EFDA7575C + 6: 23E30716B131, 79FB546DE6C534A18BBA604E8E2BE8D0 + 7: DE67DCF5635B0D, 463989CCB9A972468B870C403AB840D8 + 8: AFB5BCFD6E36E41F, FD3A63618F1D31A8A71D94FE91F41501 + 9: DBA0EB7B664D303BE5, 2860B5516CF0CE20E35BF766A4375EAF + 10: 2826E6EDCFD7E9FB938C, 685E8B032254DFF65DAC8A44C3819E08 + 11: B70FC9EE54123F45A4E67D, 8661E54524A0F12612E000876E8E6F15 + 12: 5FC3C79807594E403B82B9DB, 9D88DACCB8654708B241A505AB12FD47 + 13: 2C7AC463E62BBC014E1A48E15C, B4FB110193F147E4A59EC38983528047 + 14: 046D692C6B2827453F7BA3EFB609, C4E46E0D5F71D2D477D7CD12B7447713 + 15: CD693A49640E00134FE33C9E324122, F43001B425E37C094BCCBAC49A6471C8 + 16: 9FC2042EF22E0F8A767DB0C52109E4F5, F60730D914AA02A3BCED7F737640B9FC + 17: F09ECC9AA4FE3596C00D0AF4E052E60755, 199B8C9CEED9B4E70526BFE603FD5E45 + 18: 0C8BD929E87A21A9F043E47CE79950EA0E75, EC9D38AB193FEC16EC470A15E27FB367 + 19: F621E43B7FB21D98544817FB229C2F308361D4, B6BDD4053C4DFBD3970A5055E4A7719A + 20: 63F1D36ACEDADC63627CD438B379C48D648126A8, B1A7217302F84CF5F6A259F2881484B6 + 21: 60BAE96D5E0F248A257CB3A7788D6107CFB525D20C, FE60C3B3E2029869EA063BA3B981AB96 + 22: 01213496633A4525B2C7CAABDCFEB84193A8AE2D8059, 738E7956DA8464FF655CE4F5B0A005C9 + 23: F6822F3C87B238F6F7E44307C416B6366C18B26B2357C1, A27A98EA0AAFD1D3010DAF4070F52E7A + 24: 32B49BE196CC3825B7B6E0DEBD90680B996C3AA161BB52ED, 8505573CC5191577BD992A004F255953 + 25: 38361B85808140127A44B364046A5E1FB0B86885D5030110D3, 17DF461782D45807A7709EB2BCFAABE1 + 26: DBEF6C2067BAFF378A285EBF685F559A896B76A517292B4301F0, B6061185764BA316CC0163925F27A1A7 + 27: 15E2A0634520C0CF4C189436D35DE01CF5C83F0684CBC261A59AC5, DCD96E1687F24676838B60E873D47087 + 28: F837ACBF63898720B0527477B59A8EA74751DABCF2CC48C768AB421E, 72DD76EADF13C65E6F322E110F9944FD + 29: FDA50738B60251E5FF1C38AF0A8E3F619D247C24A20D63B372571AD6D7, F1F1B212BD7E973BA17BDABDF27F5AC3 + 30: 0CDDC7A10CA3F3616E923A751EB638CF1E67CC2D17A03538C6A2BEB8555F, 7DB533FD15E48FFB217B18E91B7B2928 + 31: BE0C9A148FC3344025C8BD35AC883B584AC706F540BE1100A92DB67EF900B9, FD172B0942DDC1EA076D46BA46B9F7AC + 32: F8256E9A41BC6E09084274A91229DC877257C433E3E43F05FDDBC3584B6093D4, 5CD834DDE7406085CADD5BEE122AF052 GCM-twofish (16 byte key) - 0: , 6275E8CA35B36C108AD6D5F84F0CC5A3 - 1: 38, A714210792F9ED12A28F25CAE3B3BC5E - 2: 8E2F, 6357C1F125723F2244DAF344CDFCD47B - 3: 900A4C, ED4E0B318346D5B9B646441E946204E9 - 4: 087EAFF8, B871ED95C873F1EFA24EF8B6915F447D - 5: 63FC9EFBD4, 650D0ED98CBECA07040AB97B97129360 - 6: B6081E94AA19, 6A3BDA8030C5A79B6B9087555A1DA67B - 7: E10A7B9CBB20C2, 59EB55DFD0A37C55A869834E597373AF - 8: 94E947FEE05780EE, 354918527F855264E37DB6892E868050 - 9: 9A80C567AA50220862, 814EE57CC9D51D7D900AB4840C4B072F - 10: A8741BE1E42BE207C416, 2B28AFD8ABE20664D8BAD7535F82F11A - 11: 6AB7E3C68B6682023E8190, 5E48B67541FE83969952394F84D29E93 - 12: 4F66FB634EB258CEE2955D84, F2632C2135B6E1144673B0EF73499818 - 13: B29042F3877C2F5E694953C5F6, 03268A30499D57A06AA873EF00160C3C - 14: DCC7B5D9F58C88F54A9611389B8D, 5515426FF7CF2EEA91BE2B3752371CE0 - 15: B665488BCD75FC02A0DF7994B7CF98, B721531E2A317C254FA2ED306ADCF96C - 16: 9535DC8A72645E34F948B71A5159AA9B, 5CEED93DE128044F0471C65AA8F21D29 - 17: 5CBFC61A23D28562FCA929375E5B585327, 3AA842B21631968D1B58B72FEE090EE1 - 18: 2AC3F780B956A933C0B8565EE527173B8CC8, 16EC4B6D8E2CF3CD0D16E7A5F401C78E - 19: 5067FD65870A4EBF6C7FA811A15270E7F8F17D, 9A7563BEDADFA6B6E48F5C13FCEAED6E - 20: E3A65A188077E5DC171CFF30BE8B27F10F015166, BD5B3D84D0C1DD51A3909F849141B57F - 21: 88D0A65C105823E68BE3987CB205AE0C1A27588FCD, B280221AD0BD83E1D6B37F331F326AB5 - 22: 7C56D987FEF6807EEFAFD4C7EB9D72AA0E037979D91E, 686E1268A8DC9CD0192A383EA6C2D975 - 23: B23CCD0A076CB122750B634B9E6551E0585EDEA18C3245, 6DF30A7F0728E2D549AA411AE375E569 - 24: 767BC3AF206E67C9E27A4D7E814F3B3A65D27BB70BA9DD4D, AB2B16C031FB2C8E85B3B2B38A5CBA4E - 25: 9ABF34ABD43705D62F377449461C5DC239A2A86E5A98AFB159, 3DEDEDA85E6BFB53C6F18726CD561604 - 26: FE756344C05CB12AA0673F1C2069A86556E583FF4B7313A0D395, 21CB0E0BABC3C7E547F5CB207295C0EE - 27: B70F16AD19A6B0AF6D8DBF4E98D7D5ADB944D91BD889D9390C3E21, 2AE67812A22C1C785D3BFC184A1C74EA - 28: A6389032AA9D08BDBAAA5E230E5130665FB4F0CB868F3F20C4C5438B, ECA054EFA3F39400A587839C4F0605C7 - 29: A55A41315EAF3A67A0FD0E14C6E04D03A5E38D0F756719F4A0800B290A, 7A5277809D4B65E663603099B4DFFBD8 - 30: E739633579AA6201A024B9873F28412BB08B08B8616D611BC9D07979BD3A, 390038A93AFD326C5CC1525A24CA91AD - 31: ED3266F8B0DAA7C3DB7814427E8139831CFC0EDE668F0DA83FF7090154410D, DE440EC2C6080048BFF3C5455E1BB33F - 32: 4D0F751B55DA3A2E0B28DE59E9680669FCB5984E9C0DB942DBAACDDEF0879731, 62F96CFE31D3D6AAA0B9F5130ED1B21B + 1: E9, D82A22BF49B52DECE1A3DAA163956EA1 + 2: 3DE3, 837CB2018053A6FA9A51A18362C0A6E5 + 3: 1123B2, 280150FC247D06FF79ABE3C6C5ACFDBF + 4: 6BE74C72, 52FA635AA14154D3FFD7A4866AC989E7 + 5: 7610B2DE22, 3E77AF501CA8EF386E2843A2C9F30425 + 6: 31BBF5CC9F77, DA25899A5B84C4CE3CB031D24BE39EEC + 7: 49FE2D43D16BEF, 491CAFC0F9A749AF0F87CB5276FF7BD0 + 8: 28191B8F4FBE3C03, B8318CE8B7EEE3BD42A35F7EF7B4FE91 + 9: F6BCC7AD009DF4B71F, 01BDA4572E1B95D0152A8675BBA9F6B4 + 10: 89B6B6B611CBBD4AB667, 5AD5C05B2FFC3AF07ACA04EC488BC4BF + 11: 985A04A3BE0A43A3489870, 57AB64D52976293C09882943B8622A0C + 12: 15DDAC26F9C07856F5C11CCA, 183A4FD20C0D7AD1744B77992D4A16C1 + 13: FE45E506C3C26745D6B5B53A36, 67B3768535D1A50D2756AB4ED83C73F1 + 14: 8EBA337B5E13FC16BBB18B8F0B10, FA90CD334FA6565E517097C37B7281C7 + 15: C9F914A669C4C58ACA86884FFF469C, 876599BB8BC1AD6E7B1DBB00ED53276E + 16: 8416EEB95A4B3DA645035CBDC76C8532, 405B3A936CE697DCBA9385CAEAFE2B55 + 17: 312BBF82B6619E5F7EE56AE873CAC9C415, D5FB2028CF3F6C57295BA6F7E5F410A9 + 18: 1B51044539639A7093D996E3B4174D6A253C, E934D7A7EF90586A56C6C2DB53CD6C40 + 19: 178762C071950E8E0198E6573BD585EEEE4E69, DD661E463BF3BB45225F7E7A6E0DE3EA + 20: FFD6BA51FEDDB7E20593AD2BF0EEE061D3B5C014, 0DCCDAEBE6135EDF787FEEDABFF3A4F3 + 21: 04BE622B5CBE1058A4C8356F65B8158295F39E1AB1, FCA9B0BCA348B319D0B19DD28EE9DE79 + 22: 8B49016BFA45DCE019BA9E4606E987A159ED0DA07D2D, 6B93BD424871D5231EB359E40666CC5E + 23: FF8D016642B2C3190094423F5A61F7CBD358522A5E5799, 2088A4088AF6F786DFE08AED79A19B3B + 24: 07F446A2E3597041B9AFFEDF5DD474CA5FA5C872844A4F8C, 870223F7404BA37C8DB940623F0DDBE2 + 25: 32C2EF41ED54C8B63AB8151E690C1770CED90D2827EB2C302B, 5BC4EABF30986EE33FE483B8FABCE7D3 + 26: 3310D94B00007C10D4B3BC3F57DE877D0E2B822B96DA9CFEFEDD, E0E114CEC34558A180675B0438128F30 + 27: A4C95A5B316AE03A569B7862290DC6340FDEA1299C5B27591333B6, 63288F9CDEB93BF029C194B2C62B4AB6 + 28: CB63472F93E0325123558620DB9FBA058455D8AF1D23A94BEBB60A79, EC0968F60DCAFEB17411C4A2D7793FCD + 29: 74241261257C5610211A3B9D45D62AA0876B63EA289FE938FB03CC8D1C, 4A18EAA2039B29F0CEF7745EB8AA7DDD + 30: 6172080F96B60E3BA450BA195EB4D6732A25AF30A109031560915C4C0344, 3B690B088522D3EBD6B647070AECF97F + 31: AF52E18DE8608C39FA886377899C66AAF8612513C21C7B815E248D9F75D775, 39F0F712265F44A442A7581D8F314D1B + 32: 64F9AE4A9E6735D348343EA7ADD617F0687C2883637468BBFA3664F9194F1683, 947A02C9994DA490BFC9E036305B26EA GCM-noekeon (16 byte key) - 0: , 24FBBB850691F47A085EB57AE00304CC - 1: B3, 8BCF7A69E538ABB7E8FEECBED90C34CF - 2: 6E74, 393546FF18FE3921BE4755E993FE669F - 3: 523837, 2B89AACC9117430488FCBD3E05C15F65 - 4: A0805168, 2430C64F2683BBB56F5092D4796473E2 - 5: 947FD3FC56, 9976BB989B3054991ED2741CB68A8F83 - 6: 8209DCFD76D0, 2A57678E78AA81509F5F88F448225F5E - 7: E08CB4FC1169B8, 694904F451A25A52022B5DF85BE76AB9 - 8: E1F64D7205D070B8, 42E272E75AF762BDD98243A3083DC250 - 9: D209B87AB1D069C946, AA6E2B0265C342968631D7D0DD7FB722 - 10: EB294F813FAF31A56731, 1946AFF788D597D545CE01339F1344CA - 11: C3623DFC818CFB5DAA7F11, A141D7654E5C5FF853365DF19626E295 - 12: 6C6ECFF070BACB61B625BB46, 176A894AD6F9C4ABBFE33704B4D0A5BF - 13: D9984A7F164345EF6D9E920944, DDABDA0CA76A3D98059DF8288D607C56 - 14: 9D271AB343D8FD4B7B9CAE828FEE, 3AA2FF2B08283ADDBD8DA9D825DD5DDE - 15: 1BEAD524FFA2812526C66E6AA262C5, AB586F0DA87D813A4E5DF5589D0EDD77 - 16: FF2CCDC2F7DCAD46B0557E265B849CED, 61D2163972EB0521F1AEFF5B157CE226 - 17: 8B39921ACBE0603970F5AED3430D8C7733, 2C4D0DA0E3A87B20255B849DED865C03 - 18: 6716B5F4169F0E609DE1BDC62E34967030C5, 3115A1F7E06D2585115CA39BE13D8F02 - 19: 0E59D5EE86573648C06A47D11DBFE1D504BB51, B080AC131829D9B9F004E672506D17D2 - 20: 74BCEDA70D4B870C2F3C1FA07BB4314D32D5814A, 1AAEF188554ED4B5FD0508474DC06046 - 21: 92575752FD1A2EE03615F71F09A776770EF817975D, 766061C717348F33E1398C8BCDC014B3 - 22: 5D6C261BFF784690911177CA62DA928D35742663C484, 227A7468C3F133FD26056F781AA0DABC - 23: D9901B1E1A1F077C93B9BB5929B76A0FD00540056032EE, 343997846C6FB089E833B15AAB16F28D - 24: 18C64411F459E87F96ADFD94ED8C6CC787C37AB9D02FC709, 7D4F5CBC141C31D44DA558D8AFD6F9B2 - 25: 2B5617D866AD278CBB3B3601E3F924C209857DBABF487C36E6, 481FF0E5F97F65FBEF74C4FE84895B08 - 26: AF03196009787A666CF901DB67CF45AAB6E870D530930964A7CE, C314771BB93E0A3ACC03EE18AC7A2739 - 27: EC721BB4A2822D39869A1981DB66C303116676E5CB3FEDACB1F970, BBA561C9B5912E84365E8258A34BA9EA - 28: 12898BDA4009B40ADDF41B495A3A1A1B0064B9F69FD7BC13F8A14BA0, B2869D73F73E32F912E73AD6C02A0768 - 29: 329B540E422F21AD3B09CF8CFE482B606149230196E429F5666DF206B2, 72CBD361E003F7A9A87E089373C768FD - 30: 497F13387271C869AE9A54A6F78116958951773A85CA804E149B27F68F4F, 68703910888C9304D7B1170258F6B841 - 31: ED63106B3E692A69C0C03BFD303BF4EB2FDB0D9562B9FE39612352DED01DBF, 451E328ACAF0A8196736D88A1D46CBD5 - 32: 1A46B990A8BDFCAEBF9C81D21C5A70A1D865F621AC9470E379F783D0A5150A13, 9571772CE2E0B947F9FE7B148163DD71 + 1: 05, E18F8A201F281A4F3F4FE6F43A001107 + 2: 55DF, BE4D95A0BC5966CC2E80FB544AD43B8B + 3: 0C5A1D, DDAE782864D5EAC894C863D4D2E3CA54 + 4: 767CCE5C, 106D7DBE5D9D56D38E6A679528C72688 + 5: 9F099BF360, D4D50BE3B13DE7B18BE415B21BD9AD4B + 6: AE4B0C056B1B, 8E0EA5A5F612835B1A498C671413CA19 + 7: A8EF51FA62B5F9, 44A65E1A85C9C102467A50297F8256B0 + 8: C58D955A860EE8E0, 45622020FC40884B61BE3C35B940A870 + 9: FC5F5562143A7F9AA9, 7FBED30D1594D1DB57BA10EEF0C4AABA + 10: C2B2D5B922504BD29C23, F14AF5025799EAF249745F1B91AB554A + 11: 62C250C8548BAF088DD01F, 6D49DB3F4D3D8D30DB0B26DCF6CF6A80 + 12: 3FD64FC5BE13ED2AA041B8C5, EDC192E68D5A7B37F395B794C3D8245F + 13: A84B4EA6C8CF088B0C6D40B5E0, 01EE07A0D3F4A1957579C1EE36C5D5A3 + 14: 39A4C10E5C542FABA9C6138E02D6, 8B31EDD92A71F53ECEF716E08CD0A3C3 + 15: E4DF855B9065B51C47454CBC3209A1, 4714B347E11804D0AB3241B1D72F4FCB + 16: FB6D42C9C44997D4C854BA321C8631CB, 7F0BD8708CC6358899B7C62A7ACEE739 + 17: 81A2C031F0D5593DBD283A9650A4160185, 3267D10C3BE6044B0D2E0BB59A919AFC + 18: 33776FB240A45E1A84B86B49FB04A350B9F8, 3743BA55B523F4BFC25E8B2474347C70 + 19: 4E19A791B6EA4B776C5449CC3AC486EE9EAAE7, 9D4FD554D57E73B6789D20E262E706FD + 20: 10B946D1B1C005516B7DE7F51CD41C8DCC581DA5, 3F41B2B8FFCFDE5298473D2E6FF76227 + 21: 184C4DD415AFE6FE74B3BE662AC04E6229F517F4A2, 158749C83A13B178F0FB7C48E7A4A19E + 22: 6DBD3F3888A2028841B61167C3EDAAE71FC23774C923, E0E87641B9C55DCC041D343960C9417C + 23: 6D995776DB3B90B038A4CE44EF2D4EFEA16DFE0A5BB054, E14F63E6C6657CB904B16EC4F2B82972 + 24: A955576527F9A240B13F9DA2FD67997D5E606D34548C1444, B8FD23A3EFA33E7F4367C61E071F8BEE + 25: F7D9EE67BD019E97A5EB7A33B7A307B2268ED7BECA95553D92, 6B31B756C9B3EE98613BB29B357FADAE + 26: ED68485EF62E89965CC8B085CAFE89BD9661ACF66939FB014E1F, C57A80259C493520E50902597EA3EFCA + 27: 53365AF657B186724902E8011368D6E49DDD2158F51EE0FFFA9658, 8EB890A78716344E79E4AD48C52D423D + 28: B49CCFC3FEAEF5C8DE4E41EF538A537552B4957E8965E454FFA3B5F7, 7CA3442BAF416B50431BBBE5CACD44DD + 29: F02E7CA72035455ED723EB802E66118D5FA642295416F12AB298567AF8, AB211AB9624F17975279690C6D95EB51 + 30: CA4C2EC503773BBF34FA411340CBAD6A9115E81B073932444ACEC5537614, D877D5B78FFB31CC54142562BED1890F + 31: 9B9BBF2D46D301F3ECDE92A13C1EEE8F9F1533AA4AADFE2E22D36D51F5F469, F03F634BCCAC070F210142F737542491 + 32: 92AD34E95350275A4CF208CC1A07776E7A6635EB8F2A7D4D9B6B6C96D6812616, 52E49767709D7CE349AAFC0C405A68ED GCM-anubis (16 byte key) - 0: , A0061C2F3B2295BFA33BC74C037EA8DA - 1: ED, 9E5648DCE40DE37B56C557D26CB18D83 - 2: 6719, A6605253C59A101FF85C5102CE92BE45 - 3: B8873D, 13F3E3ED3646BB296EE4ED5D6379A21B - 4: 5AA6E2CB, 1812E8385D15B5BAE043E4E860BEF490 - 5: 4F6F4CD8E9, 8A80BC5E08929C42A5A74C5D9ACC0C6D - 6: 2F0D8B483CE4, 316F588F78FC6A9196C97CE59B9B63B6 - 7: 82D885FDE1F948, 7160BF556614511F53738A92B5277056 - 8: E4931462AD41B6DC, 7CE24C4D6B499975FCB72B5E2275ED56 - 9: 503AA70BE698BC5B41, 10EA0C61FDBA8FF7B4E9927BCCEFD911 - 10: 6B2D213D14B5D25EBE36, DC3222AED12EE26D3D14E2E733EDB2A7 - 11: 7D8B0BC1B7443E7267371E, FCACFC73E391865BE86E041F51C45E81 - 12: 9EF3BF8609E133BEB10565AF, D84326D4CAC9D5B74FCFD8CBAFE79E77 - 13: 59AE7B1FDE1178CEE7F63C4894, E1BCFCDCA86CAB9C684F7D21962D580D - 14: 564E7B8BAC5582A3BF1178916569, 54804D8DF4D7577EF65C15487695F840 - 15: 758A6DC437C8821274B0F16F911BAA, 19DD27500915F425F34F67CC2374DC36 - 16: 0468C94A88A27AEEE2B3A973065E53CC, C743996C6F49363B2F4613F24703EF7E - 17: 3B0CABA5EEE44B7BFF0D726ECED54763FF, 14D9D09815BCD91DCCE2F5AE1A9929CF - 18: 5B945D83B98C43B0248F9BC0479E332869AB, 67A275F0313D4245B1965411CFCC8F17 - 19: 97332441CA96DE8553A3C6D898FC6D90C86DBF, 73150EC3D6327E3FC8015A6192652D3B - 20: B9A1778FAF9767160D0D87816ECE1B99AA727087, 0C173D3C4078392CE377313C48D2BAE8 - 21: 5882B73911C7D26EFDCCA3AED2EDC8A8BFFE75B1F8, 8F8C535639A0B59537E590C7FC9D2E53 - 22: 70AEBED8CCFFF6E5CF06F3E841D12387EF8D6C7B4BDE, 4B00C27FCA9BEB82331CC8EB13DCC580 - 23: 345CCB52BC20DC5F1BF5EEDF5D72A6C48F402557FFD342, 1A790A39573B853DBB8E2E73B7331014 - 24: 0637C78A817E91D63CE18CEAF8D65C6107283A90C5A97842, 52786CB81724E12C76A0D23D4680E36B - 25: 59526D1E86A473DFB720FF25E97D6571077845F73C5E8322F1, 369FBA7823FC83D727FFD25D10130987 - 26: 2933BB4E7603C313B62332827601F8189E14C1F08EA547E15AB5, 204520E365DAFF6551B01562A4CEFDFB - 27: A4098CF2A48A1DC2BCCE65CCE8DF825AF51E7E5F94B6186FF85D77, 9833EBB9A1D5CD0356E023E2C3761C2B - 28: 26557B942FD6913D806672EB01526DBD5D6F532F78AB6759DE3415C5, EDAACDD101BC40EE6530D8B5DC031F31 - 29: DB92C3D77DF0C8F4C98845AA9AD43FB800192E57A53E083862B7E3FAF0, 628DEB1E345303A40700289052080FF8 - 30: FC57BFAC2C77781723C2B721886D44ED67A52D9AD827874BC4EEC0A97281, 9A222DBC47B4AB4E520D3CC5850D4DEF - 31: 72DFB9E91A78EAFE758B4542206A4A957B4523A58428398C11BCF2AEAE1938, 307D0B876130E82804C1167E03B69B2F - 32: 7275C6EBDC2680DFCB73326A987D2FBCE83E40A9AEFE6351CFDA7251A6FE10A6, 895E6EEAA9BD88594903325A063CA45F + 1: 99, DD35EDAD537F6FCA5BCDEB053BEE36B8 + 2: 12A6, 24CB6ECAECF376400F7BFF52C4312D08 + 3: 791DDD, 7C35A987766AC11A4625C92BA4AA419E + 4: 601FF830, 69A6E3718404D3A20019D9E7F875C2FA + 5: 45A67C8B23, 92EFC3CA67CA0934E5E22A0EBA4E5613 + 6: 5F2C7A733D42, EB5BF55241D049343457F05BE8B53CB5 + 7: C356F4D8AC59BB, 12598DA524E6F01EDDB512E3B988B860 + 8: F24201E87407B8BC, 58FBE9D3E242E16BA16420C354BCF0D0 + 9: 509A017E05D0075264, 357822F3CAF350972D86F2423FE49040 + 10: 0BCBA97FD277C65D4BB2, 068F57C866AD35379F108237B39C78C0 + 11: BFE30A88F0B1FE651D0EC3, EE2F073E23DACD211B1C22074CB32A70 + 12: 11AA35923D9CCC49AF83DA5D, 9A7E9EED9774C06D1D127D1ADE221893 + 13: E3FE3E1C2CA4E1C61D530AA46F, 0D26F48272F7DAE98C797F0AE5BD5B3E + 14: 6407C7F6DD9E188DB09F584AD32E, A673DD2BB4ACC85983DCD4B5EAC2FB68 + 15: AEFBD570198C05D5B430A275AA82D5, 3A1CB79A7DDB7601C7F72A5B0DA8531D + 16: 40C1B9150E8E09C9483C1CA0CCBDF363, 241FBB631ACEDF77D51594D660BB4981 + 17: AD3F3FA6D431E12D6B41476D7B5DA77C2C, 4C22BF4240AE4235FEAA2D3ED7AAB8B4 + 18: 5EB8D86E7B26064D75E56C42B090A17544E0, 44EBE42984F206FA78D19DFC88AA1EAA + 19: 75D7E5AD5C2D19E21A1931F88229C1456EBFD4, 1F1CF1F832658DB0804D577BB2FCD2AB + 20: F73F1D3F38E8B99898E30FACECEFA40FA933F63B, EFF893CE73B6B30AD144735A5BC759A3 + 21: 452A09F297A013652273C124085FFE03D5034EC331, 9E71970BCD0EC639049F906589B7FFD1 + 22: D7BB98AD11A884CC8BF3F2F52CE9F8C17F8B188C190E, 31496C89519DE6F66113C9BEEB151275 + 23: 97B8305B1D1E02D4D1D8194BC54E4AB394FA8F5C8B2526, 1A153F52C3C67E0DA81B626C159D31A9 + 24: 1542789709D1FD889E7C5820F920126434D5969C4EC3F6AB, 685A03CA342688A70753953AB27CF0BE + 25: BB08A7F815AFA96B96C028EA48D79FF3BA7FFFFFA1902E7822, 98E4377462566EFEE39F65659DEB13CE + 26: DC8EC0B08BCADA829B3663980D66B80A2D51500AFD80EA0F18CC, 58D9C85F9561F59BF264393DA954399B + 27: 477A3B8344DBCC79577C15524F35B45A7FEA72B0561A0CDCB3CD66, 57343CF1432D30FAF8724C5AB3120539 + 28: 3CE2DD2869EDF99ABBB3DABC981B5BF294D6AA29A785F1ED6363D6A5, A939560243DC164D46028133C12B16BD + 29: 72504872BE65F3DE8F0B63BD24AFEED17B195D270AB20ACBEA7E6B0B8A, 4D5D642AEAFE6A2CE8881577FCD7F2B7 + 30: 5B71030C43F551C27183A17D08FC1B9C8AC1829D404B8DA8803FBB09343A, A602A88365B46F19DB240F2C077A0334 + 31: 89C0C85BA495D5F92D91EAC281362F374A0F41C507FD20DF6E05147C8E7208, 7F8994E46CE0548DE8F290303E8F3613 + 32: 5AC62A000B9A80B6B849F3A36E1B512097922F8475D3C6F237C3DAE23A6B8C6A, 346203E5D4775D002A1022D7F42504C1 GCM-seed (16 byte key) - 0: , C11F22F20140505084483597E4370F43 - 1: E1, D39B9E55EF1C94F1E15397E083346491 - 2: D46C, 1303648548ECD8B3992C803A648E3BEF - 3: CBBF1C, C965567985BCF2BCD4C9CF66B2168BD6 - 4: 30544838, 88D10DE290E82F2EFDBF50AD062A13FB - 5: 544DCAFBCB, 52AE6D0576B4D65D82088179EE8E5121 - 6: 26F91824D36D, 7EFF9AED81561EFD2FD4CCAA8CA3E49C - 7: ABAF75A310B8B2, C3E0E6FE9EF8B91325E7952205C3B215 - 8: 460EB25BAF346FEC, 78293B6E454C7A820B0D6ED86399CC70 - 9: CCE2D164E8BA0B80E2, 0DB9D3A14CDC8F8CBAE68D092D769697 - 10: 1C700418306E0FB9A09B, 5ACFC32C1CC06D63DA8F8139909FBB10 - 11: 8A306163BC711A92C1ED0C, 0518DED52A4D698C43709B17F8E6409F - 12: 7FAC8AE98C5D035703D3257D, EBD479B656C24E4E256CC207D26DCB2F - 13: 26DDDDAEAF072E292D9D3A8917, D1AE629015A78A35580B96B524C35A5C - 14: DA8D19951BC8EC2657142DB6239F, 56753850A747FCA0445BF881EFB466D3 - 15: EB82C127979C395018BC346B46C4C8, EFEBDA26F5A1F53BE6A2DECD5DAC0D88 - 16: AE6050FAB41D6EDCE402ED3FA5F56AE9, 2A8922AF8AC424433B13C96EF64721FE - 17: 47D7E682FF60C6F8B4DC1D43CCA75B7CDE, F7CEC551D1855914534CBF4B0F90AB36 - 18: 7DCD5194A227EC2AD352F14C4BC2958067D0, DA444BF98069E6BC209C9AE8C669E892 - 19: 3F9E6101EFFF05D547C881F463FFB43B0CC131, 0FCD327A4C3D9FB679E192C887CD0642 - 20: 70BE93EA6FB611EA7656A70B42AA444403DCD945, 75FA8421BF145219B6973657F9FAB726 - 21: 39A97F1B32D664E53734F506515BEFB3674E2F265C, FC47392114426ABEB42E9B7BD15ED237 - 22: 4D54574772CC127C2E87186E30D6BBD050231601B80E, 48E3BFD70F52434C8D92D412018345DE - 23: 6C757A980FAC2BA8257750293EB63E52A9F7EE10C96005, 4057EB8AF43227A23A85651C002BB795 - 24: 817FDC2FB49084CB3E0F306154ED9252C3FE1C39DF481DF7, 9F510141E2E1716F4738D9979C440C04 - 25: A55CECDEE410C0ED7140BDCEDDF57652D5400793996CB376AA, 0897B814408133BCD6F6392489BDDE4C - 26: BD5E9C3A051AC1FA975649EF4B8E2B6E8C317586643597548E8B, 316C16B9643C1704503CBAB5D01215DE - 27: 4AE2A8FBDA0E92A7C32F95FE5DC63AAD97CE8D07133F0787E1C2E0, B518CE779929E704846376C043D481EC - 28: 3AB6AB78B1C3978951A17A5DC6FEE1F2DA096770246DC040F72FD070, E459B8B8CC525428FB851D9B7616084A - 29: ECD99B0E203AD3E722ADD6A38159C4A2C9C4A4B1A4448EE55091D382E8, 49C80A40C5BC637BB27B69BC2AD0B9A3 - 30: 4EEFF7BF368A278B1C8524F0C805C37F84F6D54785D79BA378A6B9B2999D, 491F2F02B7CDC02A627BD052A007EE56 - 31: 3490DA4EA01B23E86382D3F7BFF3239190F4E19BC4A9BAEA8AEF893F382062, 8431CE0772CBF6867F4F40E45031D9F7 - 32: 590E5508063DC675310C74227B886E68E2C61825C5E9A08231810D11EA695481, B96C6391C22F3961B307578D47120C52 + 1: 26, 87B72BF4F343FA59CFA40D1091F50FD1 + 2: E80F, BF6A3B3F649E3AD1D07D24326C44365A + 3: 16C93E, 740A57E99296F82515190712B4B56F00 + 4: C403D1FF, B210C95ED48A15A8E78DBECA2831CBC8 + 5: DAF5735AE4, D74ABA53295DAEB4A04842D0F587C0FD + 6: B80ECF00DBBA, 91DD19615D6F71F696C4AE9D388D7266 + 7: 45F170B0D2ADD6, B9FC969B51976A3CE3D8CDD227722A53 + 8: E3EC82041FE3EEDE, 3B82743C9A974E594D53DCF17204CE55 + 9: 15B8E18A9D105E2F2A, F1452F649ADEB08006092347A722497D + 10: BE3E6D03650BC96975E1, BFA2A6EDEF412FAB922E861514475C21 + 11: 0361D6CEEAFBA30C30EE5D, AC97D081314CB9CD24113CF38E9E41FB + 12: 50E4627778596D55D7A508F4, 99A3E41EC4F3B20DE8D217C06C828F23 + 13: E3362B153E59770912C7B12FB2, 9A96E56341834743DDF33156AF411B5E + 14: 3408B88EEB308F20964DAA903AC7, A4D487202ED5EEC5EA4C45792982A821 + 15: A6AAA4ACBFF8AE329618B023C1EB99, 5B67A194B6358D44FA5801B588289DF0 + 16: 4DCF2115BE730CEFA52053E9398EDCA2, 5DE56AA2FFC6FFEAF87225316C74C87B + 17: CFFA74C036CD62DCE15843160B39FD18F2, B0CA9A45CCFDD7A61B1D06E0075610B2 + 18: A68AA4DB35238DCE0D537670D76073ECE5FE, 283B33B1D7B57917B8658B3E957B52A0 + 19: F99FCDF3990405A203BC6F9F7D56DB5B8A3E5C, 0887CB21263AE7178AB02E287D47E2C2 + 20: 363664B0944200D152A48C8C27183D7AEE177A1A, 3043B2927916652091951B9E2104E91B + 21: C1D9BF607F76D69761A9BDBA7D13D9CE4C8E430F7B, D6E7509B620B7E83B3FF7F931020F56C + 22: BB2DC71C8FB4A7A201AF36C4A174AD542D3A34EB2BD6, 2158A10FFA890769882FBB6636F95D1A + 23: 6B478DD22EF941F726D89C1B5654260845DC9140317630, 359297946889A740671BBB0BD2857883 + 24: 3211DA2201F029B1ED2E11187E62D434442D5302E78A3242, 0C1D43B63A4DD329EA11ABE5404E83F4 + 25: E0398E55D8E5146A715FE9E9A74316BBBD69DE747B5F7C3C68, 74FE8E2F10A96CAB8102EE6F0847380B + 26: C404BB08D0BEE8FF032D3EFDE7A15CEE27BA29B43161F0B5E952, 0F21B0E2D83584B65BD7A2F912BF9CEB + 27: C61D97BC584FA3CB0E6CA3E966747D75BE90CE32E4E1DFA2F34CAC, 45D4D5B01D578ADE8EB7B58CDEFB7950 + 28: 2EEC4B1DEF647FAB996C7A5FA5061E5B572E8B1B0BAA0C8B7D01D122, 36E014FF6D8729B2EADF2E0406840B9E + 29: 9753865FB716D470C634974C2056D637F11EB2467274D0024A72E5FDCC, 1E2DEAEBBBA78E0E6000275B7CAEC89C + 30: E9FE40F4C8F4AF2607E41C6BDCAA28EC7241FBC6C8DEF6F36961EFE9B46B, EC5EDD19299A09A39D2F9006093E4CEB + 31: 995FEA1FA6A0B0B141375B12BC9BA18E29229E3D3BA3FF2F67438268B06EAE, 0413AF0B5AAB28C4EE92495ACEAF17B1 + 32: 746961D162BECF915397F718478F5C1DF7A3FB8BD2413A4BF7C0C43314F6E2B1, FED8ACB5288B6ED8E0556D169CAD99B0 GCM-camellia (16 byte key) - 0: , 477650012AA6284033E1B85321EEF770 - 1: E1, 2E95EDCCAF3264B5178CD6ED0F2EDEEA - 2: 314B, B11392D89769FCEEE4B8170F8ED1F98A - 3: C7CF73, D79DF351C70A7DDA124355490EAF71D2 - 4: 3C369E92, B9345C0A6E509B10A1245F42BAC2070C - 5: 6F5634E263, D781B8F61B104158D822CD04A9FE7998 - 6: 299A167791D4, F1707A7EF00815631F79AEF3F3CF2599 - 7: 61C5184DE525F1, 615524D1CB7DDA84EE5B91647449AC8E - 8: C724705EF011DCC7, 5F78479065F8EE14C07C909F12AB9289 - 9: E1466E81002EF30043, 143651985FB01E9882D923615DA0587F - 10: E252A74713C90B153C30, 6166F77FBF04809553936EFF256593C1 - 11: FAB8BC72140D01EAF5F015, 1756C4D44B412F078B0476DAD3711DA5 - 12: 774DA96F528D758DC098157F, D169FD2BDE61020499B482786BF14046 - 13: C15708A21A56963D342CCEE9D0, 9C3416DE3CCBB7BFDEB4CCB0A0B767D2 - 14: 52EDEAE7AFC4D3C77E7ACB31B1AE, FA98CD47050F12F7A95AF55EA29BB57E - 15: 48ACDD91D755D9F8602DB17F41C1F9, 5A0CC2D372501E38ED3EC44BDE185E0B - 16: 9385B12D8EB0F0507BA643958F4EF377, 8FE23300220D1D2A8DEFF7BA69CC28E9 - 17: C31A9198E85864D8BC020B5F61FE1ED596, 9865C80843631D26B02A0369B5FCDF8D - 18: 4D159E1705839309E31C95E12A5BEA81277C, 0A8907002FEC82725530B4FC2BBC2B82 - 19: AB6B471DD358000FA8C489B06F448508AA7051, C87EEA614DEC03B4EE2724F6E1CB70A8 - 20: BFB0EA4F27CEC231815F07ED50E3AE8156172BAC, 09244CB698982CDE8C9030FC309409A9 - 21: 259FF16BCC807B01FE4870161CD0F06A92DBE886FE, 86A9D502C6BA9804D26EC4B8CA419090 - 22: 01FCE8F5DBCC4B2351A3319EC1737A84E8D3C959CE42, F337E99A62357057BB508398443E1960 - 23: 114602337E1655C3965EDB3E7BC4428F7DAD1485D5FF05, 67287E94DEB5D255D512E89508E85B47 - 24: B0B95F745C9433B741F8EB6EE36117C979CA65E6B9D8E595, BB75BABB42D9C73C4CCF8F9E1F9CCE1D - 25: 4DE486D47096B3EB1AD2C6A6F9248DA1FA2623B339E787DCAA, 7BED5402F5B5AC690488C6830D484FD8 - 26: 40C5770A6B0A5C14AD168C262BBB3BD512E12654F6F57B13280E, 3E123FB667B2187D2DEA581C1E1EAF3E - 27: CF20B534737142322FD08B2AC9602F4C447BDD91BD00FD820ADE78, EA8D30E6CA004F31CFCCCB47F0BF7A62 - 28: A61AAC29A28EAF0192E3B4646E0421D254B12C3D11F491909D18712B, 92B39BFF07D93AEDBA3AECB974859A17 - 29: 6782FAA7F0D18AC1989FAD68C5C2258742EC691ABE47F744E6E795FF74, C63AA120F2889C6996636DDFB15450A0 - 30: 79CB100D91BC41C73473723F5069B5D38C7208848B885E729A9604BB053C, 195D327AECF7F6D2BB1CFE019A0C2C0C - 31: 7753C753224B63EB00E2773D5CBA726F2B2AE54097E13A2CAAFBAFE7F53791, D344D335666E06DC87E8E30E6C141DCF - 32: F8BDD6BD3B27237424BB4E7871F9D893D204D8A4843E8AAE155B844716E2BDD7, 40806139E1038B68346931AFAAEEF1F4 + 1: 13, 0679D1B662AFDDF3ACFCE419B6DA94AC + 2: 26D6, 162A86F8E59F9E6EA5DF0748B890862A + 3: 58767A, EE0B79D3ED4B852EEFA323F8EF9839DE + 4: 0CA5F75E, A8063610439C0AD6631F6CFBE10C2AEE + 5: 5B821141C2, 0568AE410E4EF4C9FD4EC55926FB0300 + 6: ADCDD0B1C7AC, 84B1E359DF762B7E51084FCE1619D632 + 7: 75882A4FF78AF6, A13923C17E9006E06FC10710C3F1FAD0 + 8: C4F2E79246F1CE2C, 27FE18DF274233BF632F91F5C6004C3F + 9: B5F5462F5AFD8333EF, 56EE2A3CCF86F4F5CC6FCFF2638283B7 + 10: FF40C4163E604B0679D7, F813C36C222C5EC2DF7EF51DD12BDA97 + 11: 93FAF62FB742529F2F1034, 2A67CA1A0CD5ECD3EC62E9A303D11B27 + 12: 4C7F377995D7FA5D94E740A9, 0F8B822AA9775F742D5436029263520A + 13: 357A0DE9ED3E1070808B2AFBA4, FFB8426038E07FD7D23E92876B3CF4CA + 14: 281F9A4C95ED6C363A1F00564206, 93D5470EEA15AF8E85019C47728B217F + 15: CBBB9CCCBC78A78CF1F571BF667059, 15C7BFE9E2D25DE73BACE501D9BB5346 + 16: 8A3392119B0B01A9C38C556C6F31AE45, 87886BF5B99CB77FE3B681826286E87B + 17: EC52B385BC9CE88DABC560DA23B3684378, F6B71A19E39723BD4D9DCFF7ADE97796 + 18: DA81EDEBBAD7F6A49D3BC377E5F16272765A, A0D06F71CD2D9947562832E1A83E577C + 19: 2146F272EDB8F46958C01887D92BD3AC9B8A47, B5CC3F66E09AD98AB6BCEAFCDED10CB3 + 20: 3E281F975765DE1DB519696DDEA6F94B462B4717, 515B758DC732EC6CAEEAA4B94C943CF0 + 21: B3A735243E2D508E2EF3066705D0FA37442C8406BA, A8C1CC8EE8D5935FBEEC31B7132977FE + 22: C1272F2CFEE63BA750A7689385ABBCD4D431A99BD2E6, 46511DE41E6ABDBDA73AD854149B03F5 + 23: 3C66C359BA5DC0AB52EB152DBE89AB28767B7E4A6A05E6, DE4BB656C5B0DDE993ED461A0D9C185A + 24: D0248AC2923887E76BAB9FD48D8FB73D93B23E4FA8704C10, 7C120335F1DDBB429431F15E24F64455 + 25: ACFFD738047C794E9C88BB76C2BD8E300CC5F89C2E5505815F, 7D090676F5CD61FE8BB3E20BB1BC8235 + 26: 8B2F83612C9B5870782FDC506FD9E7CF08024C6D126AA0E715AC, 5A72E736892087A91E77FE785200ED68 + 27: DDB64F5869813B94E80975E55BB8B62A23CC8B0DD56357C51A0B2F, FE9B74933C7D6FF5272A0DD90D1F5D71 + 28: 00A21C6C047DB3551368ACA67B45222386A2DD63297CABC780493A73, BEDAED8C4799594FDB40F992CC82B4A2 + 29: 35FE5CD3F9ABC78C3B6E96EF11FB601741710FDA8572CF741EF9E5A522, FE34A91C83C93FE08F7D4EEA3F927415 + 30: 4CEE166BB1E1325C69BFAE06C9422BA735FD5B21EE2D7581E27FC027CDB2, 31D3086C3A0639D79FE08F5DEEB3E81A + 31: 6F575BCEF0FC079F8FA300040AA50AD6CF6F4C92A27E24A210AD32FB1FB0E7, 057E5239A6277E1D96BC277D4EEF5FFA + 32: 5090FF37EF4F163F5B54AEA54DAF1CDAC1125C46A8617CE3D251576BF52143E2, 182FD3ED463E1A6A615F4E25B34CA748 diff --git a/src/encauth/gcm/gcm_add_aad.c b/src/encauth/gcm/gcm_add_aad.c index af19cff14..cacc15ba2 100644 --- a/src/encauth/gcm/gcm_add_aad.c +++ b/src/encauth/gcm/gcm_add_aad.c @@ -46,6 +46,8 @@ int gcm_add_aad(gcm_state *gcm, /* in IV mode? */ if (gcm->mode == LTC_GCM_MODE_IV) { + /* IV length must be > 0 */ + if (gcm->buflen == 0 && gcm->totlen == 0) return CRYPT_ERROR; /* let's process the IV */ if (gcm->ivmode || gcm->buflen != 12) { for (x = 0; x < (unsigned long)gcm->buflen; x++) { From a22140f94cd49f503bed2859e90f1c7c3abe48e8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 28 Aug 2017 17:31:44 +0200 Subject: [PATCH 1064/1192] oops, fix .common_uninstall make-target [skip-ci] --- makefile_include.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile_include.mk b/makefile_include.mk index 52392f995..792f63ecb 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -412,8 +412,8 @@ install_hooks: $(call print-help,install_hooks,Installs the git hooks) HEADER_FILES=$(notdir $(HEADERS)) .common_uninstall: - $(UNINSTALL_CMD) $(LIBPATH)/$(LIBNAME) - rm $(HEADER_FILES:%=$(INCPATH)/%) + $(UNINSTALL_CMD) $(DESTDIR)$(LIBPATH)/$(LIBNAME) + rm $(HEADER_FILES:%=$(DESTDIR)$(INCPATH)/%) #This rule cleans the source tree of all compiled code, not including the pdf #documentation. From fe9af6cfbd4d513f8f6546f1ff2c5b71f5e0609a Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 24 Aug 2017 23:22:28 +0200 Subject: [PATCH 1065/1192] RSA: handle wycheproof test vectors - Legacy:missing NULL --- src/pk/rsa/rsa_verify_hash.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pk/rsa/rsa_verify_hash.c b/src/pk/rsa/rsa_verify_hash.c index 89981222f..b5846965f 100644 --- a/src/pk/rsa/rsa_verify_hash.c +++ b/src/pk/rsa/rsa_verify_hash.c @@ -143,8 +143,12 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { - XFREE(out); - goto bail_2; + /* fallback to Legacy:missing NULL */ + LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 1); + if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { + XFREE(out); + goto bail_2; + } } if ((err = der_length_sequence(siginfo, 2, &reallen)) != CRYPT_OK) { From 43e68609259cb8e031a5885603f1042a992ef81d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 29 Aug 2017 17:21:22 +0200 Subject: [PATCH 1066/1192] fix RSA - wycheproof "wrong length" --- src/pk/asn1/der/sequence/der_decode_sequence_ex.c | 7 ++++++- src/pk/dh/dh_import.c | 2 +- src/pk/dsa/dsa_decrypt_key.c | 4 ++-- src/pk/dsa/dsa_import.c | 7 ++++--- src/pk/ecc/ecc_decrypt_key.c | 4 ++-- src/pk/ecc/ecc_import.c | 6 +++--- src/pk/rsa/rsa_import.c | 7 ++++--- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 9addfa55e..8a6755e62 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -310,7 +310,12 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, goto LBL_ERR; } } - err = CRYPT_OK; + + if (inlen == 0) { + err = CRYPT_OK; + } else { + err = CRYPT_PK_INVALID_SIZE; + } LBL_ERR: return err; diff --git a/src/pk/dh/dh_import.c b/src/pk/dh/dh_import.c index 66778ebeb..c86f2b5da 100644 --- a/src/pk/dh/dh_import.c +++ b/src/pk/dh/dh_import.c @@ -37,7 +37,7 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) LTC_ASN1_SHORT_INTEGER, 1UL, &version, LTC_ASN1_BIT_STRING, 1UL, &flags, LTC_ASN1_EOL, 0UL, NULL); - if (err != CRYPT_OK) { + if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { goto error; } diff --git a/src/pk/dsa/dsa_decrypt_key.c b/src/pk/dsa/dsa_decrypt_key.c index bee276a7c..806ef3e59 100644 --- a/src/pk/dsa/dsa_decrypt_key.c +++ b/src/pk/dsa/dsa_decrypt_key.c @@ -46,8 +46,8 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, /* decode to find out hash */ LTC_SET_ASN1(decode, 0, LTC_ASN1_OBJECT_IDENTIFIER, hashOID, sizeof(hashOID)/sizeof(hashOID[0])); - - if ((err = der_decode_sequence(in, inlen, decode, 1)) != CRYPT_OK) { + err = der_decode_sequence(in, inlen, decode, 1); + if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { return err; } diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index d71cdd5bf..5db69639f 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -39,9 +39,10 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) } /* try to match the old libtomcrypt format */ - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_BIT_STRING, 1UL, flags, - LTC_ASN1_EOL, 0UL, NULL)) == CRYPT_OK) { + err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_EOL, 0UL, NULL); + + if (err == CRYPT_OK || err == CRYPT_PK_INVALID_SIZE) { /* private key */ if (flags[0]) { if ((err = der_decode_sequence_multi(in, inlen, diff --git a/src/pk/ecc/ecc_decrypt_key.c b/src/pk/ecc/ecc_decrypt_key.c index e0d3fd33d..4a16de9d4 100644 --- a/src/pk/ecc/ecc_decrypt_key.c +++ b/src/pk/ecc/ecc_decrypt_key.c @@ -52,8 +52,8 @@ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, /* decode to find out hash */ LTC_SET_ASN1(decode, 0, LTC_ASN1_OBJECT_IDENTIFIER, hashOID, sizeof(hashOID)/sizeof(hashOID[0])); - - if ((err = der_decode_sequence(in, inlen, decode, 1)) != CRYPT_OK) { + err = der_decode_sequence(in, inlen, decode, 1); + if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { return err; } diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index 7c0afed47..034c9bd83 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -105,9 +105,9 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co } /* find out what type of key it is */ - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_BIT_STRING, 1UL, flags, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, + LTC_ASN1_EOL, 0UL, NULL); + if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { goto done; } diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index a6be18d3f..fbae39bdd 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -66,9 +66,10 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) } /* not SSL public key, try to match against PKCS #1 standards */ - if ((err = der_decode_sequence_multi(in, inlen, - LTC_ASN1_INTEGER, 1UL, key->N, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + err = der_decode_sequence_multi(in, inlen, LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_EOL, 0UL, NULL); + + if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { goto LBL_ERR; } From 9003e87e5aaee40e5e95277172e3c8079663a082 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 30 Aug 2017 00:01:00 +0200 Subject: [PATCH 1067/1192] add basic validity tests to dsa_set --- src/pk/dsa/dsa_set.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index a63097499..2ad6579bf 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -45,6 +45,11 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, key->qord = mp_unsigned_bin_size(key->q); + /* just a quick, basic test - use dsa_verify_key if you want more */ + if (mp_cmp_d(key->p, 1) != LTC_MP_GT || mp_cmp_d(key->g, 1) != LTC_MP_GT || mp_cmp_d(key->q, 1) != LTC_MP_GT) { + goto LBL_ERR; + } + if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { err = CRYPT_INVALID_PACKET; @@ -83,11 +88,15 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if (type == PK_PRIVATE) { key->type = PK_PRIVATE; if ((err = mp_read_unsigned_bin(key->x, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + if (mp_cmp_d(key->x, 1) != LTC_MP_GT) { goto LBL_ERR; } if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto LBL_ERR; } + if (mp_cmp_d(key->y, 1) != LTC_MP_GT) { goto LBL_ERR; } } else { key->type = PK_PUBLIC; if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + if (mp_cmp_d(key->y, 1) != LTC_MP_GT) { goto LBL_ERR; } + if (mp_cmp(key->y, key->p) != LTC_MP_LT) { goto LBL_ERR; } } return CRYPT_OK; From 9ea6247da19a5f19dd6dfd8c4ef89e499bb0caa7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 30 Aug 2017 00:03:04 +0200 Subject: [PATCH 1068/1192] Revert "add basic validity tests to dsa_set" This reverts commit 9003e87e5aaee40e5e95277172e3c8079663a082. --- src/pk/dsa/dsa_set.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index 2ad6579bf..a63097499 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -45,11 +45,6 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, key->qord = mp_unsigned_bin_size(key->q); - /* just a quick, basic test - use dsa_verify_key if you want more */ - if (mp_cmp_d(key->p, 1) != LTC_MP_GT || mp_cmp_d(key->g, 1) != LTC_MP_GT || mp_cmp_d(key->q, 1) != LTC_MP_GT) { - goto LBL_ERR; - } - if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { err = CRYPT_INVALID_PACKET; @@ -88,15 +83,11 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if (type == PK_PRIVATE) { key->type = PK_PRIVATE; if ((err = mp_read_unsigned_bin(key->x, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } - if (mp_cmp_d(key->x, 1) != LTC_MP_GT) { goto LBL_ERR; } if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto LBL_ERR; } - if (mp_cmp_d(key->y, 1) != LTC_MP_GT) { goto LBL_ERR; } } else { key->type = PK_PUBLIC; if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } - if (mp_cmp_d(key->y, 1) != LTC_MP_GT) { goto LBL_ERR; } - if (mp_cmp(key->y, key->p) != LTC_MP_LT) { goto LBL_ERR; } } return CRYPT_OK; From 39c721c8da6bff7b171918eeb58624b6b075b7ed Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Thu, 31 Aug 2017 05:15:49 -0400 Subject: [PATCH 1069/1192] makefile.shared: protect commas in function calls through variable substitution --- makefile.shared | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile.shared b/makefile.shared index 74e76d3c0..75effcb82 100644 --- a/makefile.shared +++ b/makefile.shared @@ -59,14 +59,14 @@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) -install: $(call print-help,install,Installs the library, headers and pkd-config file) .common_install +install: $(call print-help,install,Installs the library + headers + pkg-config file) .common_install sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc install -d $(DESTDIR)$(LIBPATH)/pkgconfig install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins -uninstall: $(call print-help,uninstall,Uninstalls the library, headers and pkd-config file) .common_uninstall +uninstall: $(call print-help,uninstall,Uninstalls the library + headers + pkg-config file) .common_uninstall rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc # ref: $Format:%D$ From 509086253e821d8d79ad013f656947e1b557ea55 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Wed, 30 Aug 2017 22:59:29 -0400 Subject: [PATCH 1070/1192] makefile.unix: add targets for sizes and constants demos --- makefile.unix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/makefile.unix b/makefile.unix index f371ca899..1dd42ff86 100644 --- a/makefile.unix +++ b/makefile.unix @@ -254,6 +254,10 @@ small: demos/small.o $(LIBMAIN_S) $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ tv_gen: demos/tv_gen.o $(LIBMAIN_S) $(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +sizes: demos/sizes.o $(LIBMAIN_S) + $(CC) demos/sizes.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +constants: demos/constants.o $(LIBMAIN_S) + $(CC) demos/constants.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ timing: demos/timing.o $(LIBMAIN_S) $(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @@ -262,15 +266,15 @@ test: $(TOBJECTS) $(LIBMAIN_S) $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo "NOTICE: start the tests by: ./test" -all: $(LIBMAIN_S) hashsum ltcrypt small tv_gen timing test +all: $(LIBMAIN_S) hashsum ltcrypt small tv_gen sizes constants timing test #NOTE: this makefile works also on cygwin, thus we need to delete *.exe clean: -@rm -f $(OBJECTS) $(TOBJECTS) -@rm -f $(LIBMAIN_S) -@rm -f demos/*.o *_tv.txt - -@rm -f test tv_gen hashsum ltcrypt small timing - -@rm -f test.exe tv_gen.exe hashsum.exe ltcrypt.exe small.exe timing.exe + -@rm -f test constants sizes tv_gen hashsum ltcrypt small timing + -@rm -f test.exe constants.exe sizes.exe tv_gen.exe hashsum.exe ltcrypt.exe small.exe timing.exe #Install the library + headers install: $(LIBMAIN_S) $(HEADERS) From d7461a91bc874a6898912166684a51ccb4167215 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Thu, 31 Aug 2017 04:53:26 -0400 Subject: [PATCH 1071/1192] makefile.mingw: add targets for sizes and constants demos --- makefile.mingw | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/makefile.mingw b/makefile.mingw index 3f457e486..eb7f580ae 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -247,6 +247,10 @@ small.exe: demos/small.o $(LIBMAIN_S) $(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ tv_gen.exe: demos/tv_gen.o $(LIBMAIN_S) $(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +sizes.exe: demos/sizes.o $(LIBMAIN_S) + $(CC) demos/sizes.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ +constants.exe: demos/constants.o $(LIBMAIN_S) + $(CC) demos/constants.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ timing.exe: demos/timing.o $(LIBMAIN_S) $(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @@ -255,7 +259,7 @@ test.exe: $(TOBJECTS) $(LIBMAIN_S) $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@ @echo NOTICE: start the tests by launching test.exe -all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe +all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) hashsum.exe ltcrypt.exe small.exe tv_gen.exe sizes.exe constants.exe timing.exe test.exe test: test.exe From f5353a613d2b7bf87619bfaee273f417a0c22701 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Thu, 31 Aug 2017 04:55:47 -0400 Subject: [PATCH 1072/1192] makefile.msvc: add targets for sizes and constants demos --- makefile.msvc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/makefile.msvc b/makefile.msvc index a351a3c98..bf0128937 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -234,6 +234,10 @@ small.exe: demos/small.c $(LIBMAIN_S) cl $(LTC_CFLAGS) demos/small.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ tv_gen.exe: demos/tv_gen.c $(LIBMAIN_S) cl $(LTC_CFLAGS) demos/tv_gen.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ +sizes.exe: demos/sizes.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/sizes.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ +constants.exe: demos/constants.c $(LIBMAIN_S) + cl $(LTC_CFLAGS) demos/constants.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ timing.exe: demos/timing.c $(LIBMAIN_S) cl $(LTC_CFLAGS) demos/timing.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ @@ -242,7 +246,7 @@ test.exe: $(LIBMAIN_S) $(TOBJECTS) cl $(LTC_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@ @echo NOTICE: start the tests by launching test.exe -all: $(LIBMAIN_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe timing.exe test.exe +all: $(LIBMAIN_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe sizes.exe constants.exe timing.exe test.exe test: test.exe From 59857ba5e08d28f5e58301c72373d120be5c9ef3 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 1 Sep 2017 18:24:15 +0200 Subject: [PATCH 1073/1192] fix DSA dependency on RSA #285 --- src/pk/dsa/dsa_import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 5db69639f..3934765e9 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -86,7 +86,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) key->type = PK_PRIVATE; } else { /* public */ ltc_asn1_list params[3]; - unsigned long tmpbuf_len = MAX_RSA_SIZE*8; + unsigned long tmpbuf_len = LTC_DER_MAX_PUBKEY_SIZE*8; LTC_SET_ASN1(params, 0, LTC_ASN1_INTEGER, key->p, 1UL); LTC_SET_ASN1(params, 1, LTC_ASN1_INTEGER, key->q, 1UL); From 7e4bd971dee88021d64b148d62992ecd8ee90fda Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 25 Aug 2017 00:39:07 +0200 Subject: [PATCH 1074/1192] dsa_verify_hash: properly handle (=reject) negative r, s --- src/pk/dsa/dsa_verify_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index f3c22354f..b13caf91f 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -47,7 +47,7 @@ int dsa_verify_hash_raw( void *r, void *s, } /* neither r or s can be null or >q*/ - if (mp_iszero(r) == LTC_MP_YES || mp_iszero(s) == LTC_MP_YES || mp_cmp(r, key->q) != LTC_MP_LT || mp_cmp(s, key->q) != LTC_MP_LT) { + if (mp_cmp_d(r, 0) != LTC_MP_GT || mp_cmp_d(s, 0) != LTC_MP_GT || mp_cmp(r, key->q) != LTC_MP_LT || mp_cmp(s, key->q) != LTC_MP_LT) { err = CRYPT_INVALID_PACKET; goto error; } From c927e4315a328d3c0402fb7f5d06d8548a38897c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 29 Aug 2017 23:25:05 +0200 Subject: [PATCH 1075/1192] dsa_verify_hash: fix wycheproof - appending unused 0's --- src/pk/dsa/dsa_verify_hash.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index b13caf91f..baac9ee0a 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -98,16 +98,23 @@ int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, { int err; void *r, *s; + ltc_asn1_list sig_seq[2]; + unsigned long reallen = 0; if ((err = mp_init_multi(&r, &s, NULL)) != CRYPT_OK) { return err; } - /* decode the sequence */ - if ((err = der_decode_sequence_multi(sig, siglen, - LTC_ASN1_INTEGER, 1UL, r, - LTC_ASN1_INTEGER, 1UL, s, - LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + LTC_SET_ASN1(sig_seq, 0, LTC_ASN1_INTEGER, r, 1UL); + LTC_SET_ASN1(sig_seq, 1, LTC_ASN1_INTEGER, s, 1UL); + + err = der_decode_sequence(sig, siglen, sig_seq, 2); + if (err != CRYPT_OK) { + goto LBL_ERR; + } + + err = der_length_sequence(sig_seq, 2, &reallen); + if (err != CRYPT_OK || reallen != siglen) { goto LBL_ERR; } From cfce691a50a6fff590585f0b03e64267ed832b1b Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Thu, 31 Aug 2017 04:22:13 -0400 Subject: [PATCH 1076/1192] initialize ltc_mp to force allocation under all compilers, including clang on macOS --- README.md | 2 +- makefile | 6 ------ src/misc/crypt/crypt_ltc_mp_descriptor.c | 3 ++- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 27a134d8d..b9bed9480 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ There are several `makefile`s provided. Please choose the one that fits best for | makefile | use-case | | -------- | -------- | -| `makefile` | builds a static library (GNU Make required, broken on Mac OSX - use `makefile.unix` instead) | +| `makefile` | builds a static library (GNU Make required) | | `makefile.shared` | builds a shared (and static) library (GNU Make required) | | `makefile.unix` | for unusual UNIX platforms, or if you do not have GNU Make | | `makefile.mingw` | for usage with the mingw compiler on MS Windows | diff --git a/makefile b/makefile index 3200d86cb..a7ff18faa 100644 --- a/makefile +++ b/makefile @@ -15,12 +15,6 @@ endif PLATFORM := $(shell uname | sed -e 's/_.*//') -ifneq ($(MAKECMDGOALS),clean) -ifeq ($(PLATFORM), Darwin) -$(error Known to not work on Mac, please use makefile.unix for static libraries or makefile.shared for shared libraries) -endif -endif - # ranlib tools ifndef RANLIB RANLIB:=$(CROSS_COMPILE)ranlib diff --git a/src/misc/crypt/crypt_ltc_mp_descriptor.c b/src/misc/crypt/crypt_ltc_mp_descriptor.c index f06147d03..0f1407c5e 100644 --- a/src/misc/crypt/crypt_ltc_mp_descriptor.c +++ b/src/misc/crypt/crypt_ltc_mp_descriptor.c @@ -8,7 +8,8 @@ */ #include "tomcrypt.h" -ltc_math_descriptor ltc_mp; +/* Initialize ltc_mp to nulls, to force allocation on all platforms, including macOS. */ +ltc_math_descriptor ltc_mp = { 0 }; /* ref: $Format:%D$ */ /* git commit: $Format:%H$ */ From 2dd446dbdb8d3da54e50228f55750eaeae6e196e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 14 Sep 2017 17:11:06 +0200 Subject: [PATCH 1077/1192] clang and -Wno-missing-field-initializers --- makefile_include.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index 792f63ecb..f422135ad 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -102,7 +102,7 @@ endif # COMPILE_DEBUG ifneq ($(findstring clang,$(CC)),) -LTC_CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header +LTC_CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header -Wno-missing-field-initializers endif ifeq ($(PLATFORM), Darwin) LTC_CFLAGS += -Wno-nullability-completeness From 2505e3b6098d490536dfdda2e8fff0a7809f89f5 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 30 Aug 2017 00:04:07 +0200 Subject: [PATCH 1078/1192] add basic validity tests to dsa_set --- src/pk/dsa/dsa_set.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index a63097499..d85ae8cd2 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -45,6 +45,12 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, key->qord = mp_unsigned_bin_size(key->q); + /* just a quick, basic test - use dsa_verify_key if you want more */ + if (mp_cmp_d(key->p, 1) != LTC_MP_GT || mp_cmp_d(key->g, 1) != LTC_MP_GT || mp_cmp_d(key->q, 1) != LTC_MP_GT) { + err= CRYPT_INVALID_ARG; + goto LBL_ERR; + } + if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { err = CRYPT_INVALID_PACKET; @@ -83,11 +89,19 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if (type == PK_PRIVATE) { key->type = PK_PRIVATE; if ((err = mp_read_unsigned_bin(key->x, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + if (mp_cmp_d(key->x, 1) != LTC_MP_GT) { + err= CRYPT_INVALID_ARG; + goto LBL_ERR; + } if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto LBL_ERR; } } else { key->type = PK_PUBLIC; if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } + if (mp_cmp_d(key->y, 1) != LTC_MP_GT || mp_cmp(key->y, key->p) != LTC_MP_LT) { + err= CRYPT_INVALID_ARG; + goto LBL_ERR; + } } return CRYPT_OK; From 053ba6d6009b63a548ca08a6d5cf9dcace0aea42 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 11 Sep 2017 23:36:03 +0200 Subject: [PATCH 1079/1192] introducing dsa_verify_key_ex --- src/headers/tomcrypt_pk.h | 4 +++- src/pk/dsa/dsa_set.c | 22 +++++++--------------- src/pk/dsa/dsa_verify_key.c | 31 +++++++++++++++++++------------ 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 3171efd4b..8e0b1913c 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -479,7 +479,9 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_verify_key(dsa_key *key, int *stat); - +#ifdef LTC_SOURCE +int dsa_verify_key_ex(dsa_key *key, int *stat, int mode); +#endif int dsa_shared_secret(void *private_key, void *base, dsa_key *public_key, unsigned char *out, unsigned long *outlen); diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index d85ae8cd2..11ad65010 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -45,12 +45,6 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, key->qord = mp_unsigned_bin_size(key->q); - /* just a quick, basic test - use dsa_verify_key if you want more */ - if (mp_cmp_d(key->p, 1) != LTC_MP_GT || mp_cmp_d(key->g, 1) != LTC_MP_GT || mp_cmp_d(key->q, 1) != LTC_MP_GT) { - err= CRYPT_INVALID_ARG; - goto LBL_ERR; - } - if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { err = CRYPT_INVALID_PACKET; @@ -76,7 +70,7 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, */ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key *key) { - int err; + int err, stat = 0; LTC_ARGCHK(key != NULL); LTC_ARGCHK(key->x != NULL); @@ -89,19 +83,17 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if (type == PK_PRIVATE) { key->type = PK_PRIVATE; if ((err = mp_read_unsigned_bin(key->x, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } - if (mp_cmp_d(key->x, 1) != LTC_MP_GT) { - err= CRYPT_INVALID_ARG; - goto LBL_ERR; - } if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto LBL_ERR; } } else { key->type = PK_PUBLIC; if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } - if (mp_cmp_d(key->y, 1) != LTC_MP_GT || mp_cmp(key->y, key->p) != LTC_MP_LT) { - err= CRYPT_INVALID_ARG; - goto LBL_ERR; - } + } + + if ((err = dsa_verify_key_ex(key, &stat, 0)) != CRYPT_OK) { goto LBL_ERR; } + if (stat == 0) { + err = CRYPT_INVALID_ARG; + goto LBL_ERR; } return CRYPT_OK; diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index d263d4e13..c5cdff7f7 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -22,6 +22,11 @@ @return CRYPT_OK if successful */ int dsa_verify_key(dsa_key *key, int *stat) +{ + return dsa_verify_key_ex(key, stat, 1); /* 1 = full check */ +} + +int dsa_verify_key_ex(dsa_key *key, int *stat, int mode) { void *tmp, *tmp2; int res, err; @@ -32,19 +37,21 @@ int dsa_verify_key(dsa_key *key, int *stat) /* default to an invalid key */ *stat = 0; - /* first make sure key->q and key->p are prime */ - if ((err = mp_prime_is_prime(key->q, 8, &res)) != CRYPT_OK) { - return err; - } - if (res == 0) { - return CRYPT_OK; - } + if (mode == 1) { + /* first make sure key->q and key->p are prime */ + if ((err = mp_prime_is_prime(key->q, 8, &res)) != CRYPT_OK) { + return err; + } + if (res == 0) { + return CRYPT_OK; + } - if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { - return err; - } - if (res == 0) { - return CRYPT_OK; + if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { + return err; + } + if (res == 0) { + return CRYPT_OK; + } } /* now make sure that g is not -1, 0 or 1 and

Date: Tue, 12 Sep 2017 00:25:21 +0200 Subject: [PATCH 1080/1192] re-factor & re-name internal dsa key validation --- src/headers/tomcrypt_pk.h | 2 +- src/pk/dsa/dsa_set.c | 2 +- src/pk/dsa/dsa_verify_key.c | 63 ++++++++++++++++++++++++------------- 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 8e0b1913c..74fc54862 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -480,7 +480,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_verify_key(dsa_key *key, int *stat); #ifdef LTC_SOURCE -int dsa_verify_key_ex(dsa_key *key, int *stat, int mode); +int dsa_int_validate_key(dsa_key *key, int *stat, int mode); #endif int dsa_shared_secret(void *private_key, void *base, dsa_key *public_key, diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index 11ad65010..d6e1ee993 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -90,7 +90,7 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } } - if ((err = dsa_verify_key_ex(key, &stat, 0)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = dsa_int_validate_key(key, &stat, 0)) != CRYPT_OK) { goto LBL_ERR; } if (stat == 0) { err = CRYPT_INVALID_ARG; goto LBL_ERR; diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index c5cdff7f7..ebdcd7990 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -16,17 +16,55 @@ #ifdef LTC_MDSA /** - Verify a DSA key for validity - @param key The key to verify + Validate a DSA key + + Yeah, this function should've been called dsa_validate_key() + in the first place and for compat-reasons we keep it + as it was (for now). + + @param key The key to validate @param stat [out] Result of test, 1==valid, 0==invalid @return CRYPT_OK if successful */ int dsa_verify_key(dsa_key *key, int *stat) { - return dsa_verify_key_ex(key, stat, 1); /* 1 = full check */ + int res, err; + + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(stat != NULL); + + /* default to an invalid key */ + *stat = 0; + + /* first make sure key->q and key->p are prime */ + if ((err = mp_prime_is_prime(key->q, 8, &res)) != CRYPT_OK) { + return err; + } + if (res == LTC_MP_NO) { + return CRYPT_OK; + } + + if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { + return err; + } + if (res == LTC_MP_NO) { + return CRYPT_OK; + } + + return dsa_int_validate_key(key, stat); /* 1 = full check */ } -int dsa_verify_key_ex(dsa_key *key, int *stat, int mode) +/** + Non-complex part of the validation of a DSA key + + This is the computation-wise 'non-complex' part of the + DSA key validation + + @param key The key to validate + @param stat [out] Result of test, 1==valid, 0==invalid + @return CRYPT_OK if successful +*/ +int dsa_int_validate_key(dsa_key *key, int *stat) { void *tmp, *tmp2; int res, err; @@ -37,23 +75,6 @@ int dsa_verify_key_ex(dsa_key *key, int *stat, int mode) /* default to an invalid key */ *stat = 0; - if (mode == 1) { - /* first make sure key->q and key->p are prime */ - if ((err = mp_prime_is_prime(key->q, 8, &res)) != CRYPT_OK) { - return err; - } - if (res == 0) { - return CRYPT_OK; - } - - if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { - return err; - } - if (res == 0) { - return CRYPT_OK; - } - } - /* now make sure that g is not -1, 0 or 1 and

g, 0) == LTC_MP_EQ || mp_cmp_d(key->g, 1) == LTC_MP_EQ) { return CRYPT_OK; From aa5b9dafc46f9c1f032e1633d96a7ac141365d47 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 12 Sep 2017 07:03:21 +0200 Subject: [PATCH 1081/1192] fix dsa_int_validate_key related compiler warnings --- src/headers/tomcrypt_pk.h | 2 +- src/pk/dsa/dsa_set.c | 3 ++- src/pk/dsa/dsa_verify_key.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 74fc54862..3a9e2de49 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -480,7 +480,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_verify_key(dsa_key *key, int *stat); #ifdef LTC_SOURCE -int dsa_int_validate_key(dsa_key *key, int *stat, int mode); +int dsa_int_validate_key(dsa_key *key, int *stat); #endif int dsa_shared_secret(void *private_key, void *base, dsa_key *public_key, diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index d6e1ee993..5cf4f6d5f 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -90,7 +90,8 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } } - if ((err = dsa_int_validate_key(key, &stat, 0)) != CRYPT_OK) { goto LBL_ERR; } + /* do only a quick validation, without primality testing */ + if ((err = dsa_int_validate_key(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } if (stat == 0) { err = CRYPT_INVALID_ARG; goto LBL_ERR; diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index ebdcd7990..3d507fab5 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -51,7 +51,7 @@ int dsa_verify_key(dsa_key *key, int *stat) return CRYPT_OK; } - return dsa_int_validate_key(key, stat); /* 1 = full check */ + return dsa_int_validate_key(key, stat); } /** @@ -67,7 +67,7 @@ int dsa_verify_key(dsa_key *key, int *stat) int dsa_int_validate_key(dsa_key *key, int *stat) { void *tmp, *tmp2; - int res, err; + int err; LTC_ARGCHK(key != NULL); LTC_ARGCHK(stat != NULL); From 5fb4c9f89b25ed143f135e117d1eb78c22ca0e87 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 10:39:51 +0200 Subject: [PATCH 1082/1192] another approach for dsa_int_validate_* --- src/headers/tomcrypt_pk.h | 4 +- src/pk/dsa/dsa_set.c | 13 +++- src/pk/dsa/dsa_verify_key.c | 127 ++++++++++++++++++++++++++---------- 3 files changed, 104 insertions(+), 40 deletions(-) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 3a9e2de49..a33638ae8 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -480,7 +480,9 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_verify_key(dsa_key *key, int *stat); #ifdef LTC_SOURCE -int dsa_int_validate_key(dsa_key *key, int *stat); +int dsa_int_validate_xy(dsa_key *key, int *stat); +int dsa_int_validate_pqg(dsa_key *key, int *stat); +int dsa_int_validate_primes(dsa_key *key, int *stat); #endif int dsa_shared_secret(void *private_key, void *base, dsa_key *public_key, diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index 5cf4f6d5f..ff5e006a3 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -27,7 +27,7 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, const unsigned char *g, unsigned long glen, dsa_key *key) { - int err; + int err, stat; LTC_ARGCHK(p != NULL); LTC_ARGCHK(q != NULL); @@ -50,6 +50,14 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, err = CRYPT_INVALID_PACKET; goto LBL_ERR; } + + /* do only a quick validation, without primality testing */ + if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } + if (stat == 0) { + err = CRYPT_INVALID_ARG; + goto LBL_ERR; + } + return CRYPT_OK; LBL_ERR: @@ -90,8 +98,7 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } } - /* do only a quick validation, without primality testing */ - if ((err = dsa_int_validate_key(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } + if ((err = dsa_int_validate_xy(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } if (stat == 0) { err = CRYPT_INVALID_ARG; goto LBL_ERR; diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index 3d507fab5..c429ce06e 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -28,15 +28,81 @@ */ int dsa_verify_key(dsa_key *key, int *stat) { - int res, err; + int err; + err = dsa_int_validate_primes(key, stat); + if (err != CRYPT_OK || *stat == 0) return err; + + err = dsa_int_validate_pqg(key, stat); + if (err != CRYPT_OK || *stat == 0) return err; + + return dsa_int_validate_xy(key, stat); +} + +/** + Non-complex part (no primality testing) of the validation + of DSA params (p, q, g) + + @param key The key to validate + @param stat [out] Result of test, 1==valid, 0==invalid + @return CRYPT_OK if successful +*/ +int dsa_int_validate_pqg(dsa_key *key, int *stat) +{ + void *tmp, *tmp2; + int err; + + *stat = 0; LTC_ARGCHK(key != NULL); LTC_ARGCHK(stat != NULL); - /* default to an invalid key */ + /* now make sure that g is not -1, 0 or 1 and

g, 0) == LTC_MP_EQ || mp_cmp_d(key->g, 1) == LTC_MP_EQ) { + return CRYPT_OK; + } + if ((err = mp_init_multi(&tmp, &tmp2, NULL)) != CRYPT_OK) { return err; } + if ((err = mp_sub_d(key->p, 1, tmp)) != CRYPT_OK) { goto error; } + if (mp_cmp(tmp, key->g) == LTC_MP_EQ || mp_cmp(key->g, key->p) != LTC_MP_LT) { + err = CRYPT_OK; + goto error; + } + + /* now we have to make sure that g^q = 1, and that p-1/q gives 0 remainder */ + if ((err = mp_div(tmp, key->q, tmp, tmp2)) != CRYPT_OK) { goto error; } + if (mp_iszero(tmp2) != LTC_MP_YES) { + err = CRYPT_OK; + goto error; + } + + if ((err = mp_exptmod(key->g, key->q, key->p, tmp)) != CRYPT_OK) { goto error; } + if (mp_cmp_d(tmp, 1) != LTC_MP_EQ) { + err = CRYPT_OK; + goto error; + } + + err = CRYPT_OK; + *stat = 1; +error: + mp_clear_multi(tmp, tmp2, NULL); + return err; +} + +/** + Primality testing of DSA params p and q + + @param key The key to validate + @param stat [out] Result of test, 1==valid, 0==invalid + @return CRYPT_OK if successful +*/ +int dsa_int_validate_primes(dsa_key *key, int *stat) +{ + int err, res; + *stat = 0; + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(stat != NULL); - /* first make sure key->q and key->p are prime */ + /* key->q prime? */ if ((err = mp_prime_is_prime(key->q, 8, &res)) != CRYPT_OK) { return err; } @@ -44,6 +110,7 @@ int dsa_verify_key(dsa_key *key, int *stat) return CRYPT_OK; } + /* key->p prime? */ if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { return err; } @@ -51,74 +118,62 @@ int dsa_verify_key(dsa_key *key, int *stat) return CRYPT_OK; } - return dsa_int_validate_key(key, stat); + *stat = 1; + return CRYPT_OK; } /** - Non-complex part of the validation of a DSA key - - This is the computation-wise 'non-complex' part of the - DSA key validation + Validation of a DSA key (x and y values) @param key The key to validate @param stat [out] Result of test, 1==valid, 0==invalid @return CRYPT_OK if successful */ -int dsa_int_validate_key(dsa_key *key, int *stat) +int dsa_int_validate_xy(dsa_key *key, int *stat) { - void *tmp, *tmp2; - int err; + void *tmp; + int err; + *stat = 0; LTC_ARGCHK(key != NULL); LTC_ARGCHK(stat != NULL); - /* default to an invalid key */ - *stat = 0; - - /* now make sure that g is not -1, 0 or 1 and

g, 0) == LTC_MP_EQ || mp_cmp_d(key->g, 1) == LTC_MP_EQ) { - return CRYPT_OK; + /* 1 < y < p-1 */ + if ((err = mp_init(&tmp)) != CRYPT_OK) { + return err; } - if ((err = mp_init_multi(&tmp, &tmp2, NULL)) != CRYPT_OK) { return err; } - if ((err = mp_sub_d(key->p, 1, tmp)) != CRYPT_OK) { goto error; } - if (mp_cmp(tmp, key->g) == LTC_MP_EQ || mp_cmp(key->g, key->p) != LTC_MP_LT) { - err = CRYPT_OK; + if ((err = mp_sub_d(key->p, 1, tmp)) != CRYPT_OK) { goto error; } - - /* 1 < y < p-1 */ if (!(mp_cmp_d(key->y, 1) == LTC_MP_GT && mp_cmp(key->y, tmp) == LTC_MP_LT)) { err = CRYPT_OK; goto error; } - /* now we have to make sure that g^q = 1, and that p-1/q gives 0 remainder */ - if ((err = mp_div(tmp, key->q, tmp, tmp2)) != CRYPT_OK) { goto error; } - if (mp_iszero(tmp2) != LTC_MP_YES) { - err = CRYPT_OK; + /* now we have to make sure that y^q = 1, this makes sure y \in g^x mod p */ + if ((err = mp_exptmod(key->y, key->q, key->p, tmp)) != CRYPT_OK) { goto error; } - - if ((err = mp_exptmod(key->g, key->q, key->p, tmp)) != CRYPT_OK) { goto error; } if (mp_cmp_d(tmp, 1) != LTC_MP_EQ) { err = CRYPT_OK; goto error; } - /* now we have to make sure that y^q = 1, this makes sure y \in g^x mod p */ - if ((err = mp_exptmod(key->y, key->q, key->p, tmp)) != CRYPT_OK) { goto error; } - if (mp_cmp_d(tmp, 1) != LTC_MP_EQ) { - err = CRYPT_OK; - goto error; + if (key->type == PK_PRIVATE) { + /* x > 1 */ + if (!(mp_cmp_d(key->x, 1) == LTC_MP_GT)) { + err = CRYPT_OK; + goto error; + } } - /* at this point we are out of tests ;-( */ err = CRYPT_OK; *stat = 1; error: - mp_clear_multi(tmp, tmp2, NULL); + mp_clear(tmp); return err; } + #endif /* ref: $Format:%D$ */ From 1ea4fecc818f707b1de21e4f45c4ffa07677b527 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 11:43:59 +0200 Subject: [PATCH 1083/1192] FIPS 186-4 DSA validity tests --- src/pk/dsa/dsa_verify_key.c | 61 ++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index c429ce06e..0f84ea097 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -49,33 +49,33 @@ int dsa_verify_key(dsa_key *key, int *stat) */ int dsa_int_validate_pqg(dsa_key *key, int *stat) { - void *tmp, *tmp2; + void *tmp1, *tmp2; int err; *stat = 0; LTC_ARGCHK(key != NULL); LTC_ARGCHK(stat != NULL); - /* now make sure that g is not -1, 0 or 1 and

g, 0) == LTC_MP_EQ || mp_cmp_d(key->g, 1) == LTC_MP_EQ) { + /* FIPS 186-4 chapter 4.1: 1 < g < p */ + if (mp_cmp_d(key->g, 1) != LTC_MP_GT || mp_cmp(key->g, key->p) != LTC_MP_LT) { return CRYPT_OK; } - if ((err = mp_init_multi(&tmp, &tmp2, NULL)) != CRYPT_OK) { return err; } - if ((err = mp_sub_d(key->p, 1, tmp)) != CRYPT_OK) { goto error; } - if (mp_cmp(tmp, key->g) == LTC_MP_EQ || mp_cmp(key->g, key->p) != LTC_MP_LT) { - err = CRYPT_OK; - goto error; - } - /* now we have to make sure that g^q = 1, and that p-1/q gives 0 remainder */ - if ((err = mp_div(tmp, key->q, tmp, tmp2)) != CRYPT_OK) { goto error; } + if ((err = mp_init_multi(&tmp1, &tmp2, NULL)) != CRYPT_OK) { return err; } + + /* FIPS 186-4 chapter 4.1: q is a divisor of (p - 1) */ + if ((err = mp_sub_d(key->p, 1, tmp1)) != CRYPT_OK) { goto error; } + if ((err = mp_div(tmp1, key->q, tmp1, tmp2)) != CRYPT_OK) { goto error; } if (mp_iszero(tmp2) != LTC_MP_YES) { err = CRYPT_OK; goto error; } - if ((err = mp_exptmod(key->g, key->q, key->p, tmp)) != CRYPT_OK) { goto error; } - if (mp_cmp_d(tmp, 1) != LTC_MP_EQ) { + /* FIPS 186-4 chapter 4.1: g is a generator of a subgroup of order q in + * the multiplicative group of GF(p) - so we make sure that g^q mod p = 1 + */ + if ((err = mp_exptmod(key->g, key->q, key->p, tmp1)) != CRYPT_OK) { goto error; } + if (mp_cmp_d(tmp1, 1) != LTC_MP_EQ) { err = CRYPT_OK; goto error; } @@ -83,7 +83,7 @@ int dsa_int_validate_pqg(dsa_key *key, int *stat) err = CRYPT_OK; *stat = 1; error: - mp_clear_multi(tmp, tmp2, NULL); + mp_clear_multi(tmp1, tmp2, NULL); return err; } @@ -150,18 +150,29 @@ int dsa_int_validate_xy(dsa_key *key, int *stat) goto error; } - /* now we have to make sure that y^q = 1, this makes sure y \in g^x mod p */ - if ((err = mp_exptmod(key->y, key->q, key->p, tmp)) != CRYPT_OK) { - goto error; - } - if (mp_cmp_d(tmp, 1) != LTC_MP_EQ) { - err = CRYPT_OK; - goto error; - } - if (key->type == PK_PRIVATE) { - /* x > 1 */ - if (!(mp_cmp_d(key->x, 1) == LTC_MP_GT)) { + /* FIPS 186-4 chapter 4.1: 0 < x < q */ + if (mp_cmp_d(key->x, 0) != LTC_MP_GT || mp_cmp(key->x, key->q) != LTC_MP_LT) { + err = CRYPT_OK; + goto error; + } + /* FIPS 186-4 chapter 4.1: y = g^x mod p */ + if ((err = mp_exptmod(key->g, key->x, key->p, tmp)) != CRYPT_OK) { + goto error; + } + if (mp_cmp(tmp, key->y) != LTC_MP_EQ) { + err = CRYPT_OK; + goto error; + } + } + else { + /* with just a public key we cannot test y = g^x mod p therefore we + * only test that y^q mod p = 1, which makes sure y is in g^x mod p + */ + if ((err = mp_exptmod(key->y, key->q, key->p, tmp)) != CRYPT_OK) { + goto error; + } + if (mp_cmp_d(tmp, 1) != LTC_MP_EQ) { err = CRYPT_OK; goto error; } From c806ea17f9704182be0effe8a5777ec415640441 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 12:45:45 +0200 Subject: [PATCH 1084/1192] fix dsa_int_validate_xy --- src/pk/dsa/dsa_verify_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index 0f84ea097..7cfd1170a 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -145,7 +145,7 @@ int dsa_int_validate_xy(dsa_key *key, int *stat) if ((err = mp_sub_d(key->p, 1, tmp)) != CRYPT_OK) { goto error; } - if (!(mp_cmp_d(key->y, 1) == LTC_MP_GT && mp_cmp(key->y, tmp) == LTC_MP_LT)) { + if (mp_cmp_d(key->y, 1) != LTC_MP_GT || mp_cmp(key->y, tmp) != LTC_MP_LT) { err = CRYPT_OK; goto error; } From 45b6b947da3dd76df9fde69cf8e751ee3282d3c7 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 17:21:39 +0200 Subject: [PATCH 1085/1192] dsa_int_validate_primes & LTC_MILLER_RABIN_REPS --- src/pk/dsa/dsa_verify_key.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index 7cfd1170a..08d0a701f 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -103,7 +103,7 @@ int dsa_int_validate_primes(dsa_key *key, int *stat) LTC_ARGCHK(stat != NULL); /* key->q prime? */ - if ((err = mp_prime_is_prime(key->q, 8, &res)) != CRYPT_OK) { + if ((err = mp_prime_is_prime(key->q, LTC_MILLER_RABIN_REPS, &res)) != CRYPT_OK) { return err; } if (res == LTC_MP_NO) { @@ -111,7 +111,7 @@ int dsa_int_validate_primes(dsa_key *key, int *stat) } /* key->p prime? */ - if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { + if ((err = mp_prime_is_prime(key->p, LTC_MILLER_RABIN_REPS, &res)) != CRYPT_OK) { return err; } if (res == LTC_MP_NO) { From 9765befd6b6901f4a062b19f9fae9ffcc47f915b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 17:25:28 +0200 Subject: [PATCH 1086/1192] do dsa_int_validate_pqg in dsa_set_pqg_dsaparam --- src/pk/dsa/dsa_set_pqg_dsaparam.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_set_pqg_dsaparam.c b/src/pk/dsa/dsa_set_pqg_dsaparam.c index 454a941a8..d4dc397c7 100644 --- a/src/pk/dsa/dsa_set_pqg_dsaparam.c +++ b/src/pk/dsa/dsa_set_pqg_dsaparam.c @@ -24,7 +24,7 @@ int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, dsa_key *key) { - int err; + int err, stat; LTC_ARGCHK(dsaparam != NULL); LTC_ARGCHK(key != NULL); @@ -49,6 +49,16 @@ int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamle err = CRYPT_INVALID_PACKET; goto LBL_ERR; } + + /* quick p, q, g validation, without primality testing */ + if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { + goto LBL_ERR; + } + if (stat == 0) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + return CRYPT_OK; LBL_ERR: From fd94e9540f9d694608b750f010c88b795670ee1f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 17:37:39 +0200 Subject: [PATCH 1087/1192] move qord trest to dsa_int_validate_pqg --- src/pk/dsa/dsa_set.c | 6 ------ src/pk/dsa/dsa_set_pqg_dsaparam.c | 6 ------ src/pk/dsa/dsa_verify_key.c | 8 ++++++++ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index ff5e006a3..cc53fc849 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -45,12 +45,6 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, key->qord = mp_unsigned_bin_size(key->q); - if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || - (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { - err = CRYPT_INVALID_PACKET; - goto LBL_ERR; - } - /* do only a quick validation, without primality testing */ if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } if (stat == 0) { diff --git a/src/pk/dsa/dsa_set_pqg_dsaparam.c b/src/pk/dsa/dsa_set_pqg_dsaparam.c index d4dc397c7..edbed1c4e 100644 --- a/src/pk/dsa/dsa_set_pqg_dsaparam.c +++ b/src/pk/dsa/dsa_set_pqg_dsaparam.c @@ -44,12 +44,6 @@ int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamle key->qord = mp_unsigned_bin_size(key->q); - if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || - (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { - err = CRYPT_INVALID_PACKET; - goto LBL_ERR; - } - /* quick p, q, g validation, without primality testing */ if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { goto LBL_ERR; diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index 08d0a701f..2737cdd79 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -56,6 +56,14 @@ int dsa_int_validate_pqg(dsa_key *key, int *stat) LTC_ARGCHK(key != NULL); LTC_ARGCHK(stat != NULL); + /* check q-order */ + if ( key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || + (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || + (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA ) { + err = CRYPT_OK; + goto error; + } + /* FIPS 186-4 chapter 4.1: 1 < g < p */ if (mp_cmp_d(key->g, 1) != LTC_MP_GT || mp_cmp(key->g, key->p) != LTC_MP_LT) { return CRYPT_OK; From 444d9f3fb744e4b977b93bca523d64eb2b9e05b8 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 17:38:12 +0200 Subject: [PATCH 1088/1192] do dsa_int_validate_* in dsa_import --- src/pk/dsa/dsa_import.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 3934765e9..08d64b760 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -24,7 +24,7 @@ */ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) { - int err; + int err, stat; unsigned long zero = 0; unsigned char* tmpbuf = NULL; unsigned char flags[1]; @@ -116,10 +116,21 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) } LBL_OK: - key->qord = mp_unsigned_bin_size(key->q); + key->qord = mp_unsigned_bin_size(key->q); - if (key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || - (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA) { + /* quick p, q, g validation, without primality testing */ + if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { + goto LBL_ERR; + } + if (stat == 0) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + /* validate x, y */ + if ((err = dsa_int_validate_xy(key, &stat)) != CRYPT_OK) { + goto LBL_ERR; + } + if (stat == 0) { err = CRYPT_INVALID_PACKET; goto LBL_ERR; } From d91d59421f10ec53c3301895d8fb5e8fca19809c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 18:48:04 +0200 Subject: [PATCH 1089/1192] fix de-referencing stat before checking for NULL --- src/pk/dsa/dsa_verify_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index 2737cdd79..a70da9f6a 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -52,9 +52,9 @@ int dsa_int_validate_pqg(dsa_key *key, int *stat) void *tmp1, *tmp2; int err; - *stat = 0; LTC_ARGCHK(key != NULL); LTC_ARGCHK(stat != NULL); + *stat = 0; /* check q-order */ if ( key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || From 6200f301a5ea826be33a8446bf112672569557c1 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 18:49:42 +0200 Subject: [PATCH 1090/1192] add comment #ifdef LTC_SOURCE + internal helper functions --- src/headers/tomcrypt_pk.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index a33638ae8..837baa7d3 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -480,6 +480,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_verify_key(dsa_key *key, int *stat); #ifdef LTC_SOURCE +/* internal helper functions */ int dsa_int_validate_xy(dsa_key *key, int *stat); int dsa_int_validate_pqg(dsa_key *key, int *stat); int dsa_int_validate_primes(dsa_key *key, int *stat); From a990a8252e70aa289573059e65b4fd94ee32a6ed Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 18:51:02 +0200 Subject: [PATCH 1091/1192] mp_clear_multi - reverse the order --- src/pk/dsa/dsa_verify_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index a70da9f6a..e32777de1 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -91,7 +91,7 @@ int dsa_int_validate_pqg(dsa_key *key, int *stat) err = CRYPT_OK; *stat = 1; error: - mp_clear_multi(tmp1, tmp2, NULL); + mp_clear_multi(tmp2, tmp1, NULL); return err; } From bb6a7e1c6c07e323e180797b782f238807e06311 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 18:53:09 +0200 Subject: [PATCH 1092/1192] if dsa_int_validate_* fails return consistently CRYPT_INVALID_PACKET --- src/pk/dsa/dsa_set.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index cc53fc849..a4d4042fe 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -48,7 +48,7 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, /* do only a quick validation, without primality testing */ if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } if (stat == 0) { - err = CRYPT_INVALID_ARG; + err = CRYPT_INVALID_PACKET; goto LBL_ERR; } @@ -94,7 +94,7 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if ((err = dsa_int_validate_xy(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } if (stat == 0) { - err = CRYPT_INVALID_ARG; + err = CRYPT_INVALID_PACKET; goto LBL_ERR; } From 5e718499420fdc87147bb00ab6d9c8420b83e9bd Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 20:07:32 +0200 Subject: [PATCH 1093/1192] properly exit dsa_int_validate_pqg --- src/pk/dsa/dsa_verify_key.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pk/dsa/dsa_verify_key.c b/src/pk/dsa/dsa_verify_key.c index e32777de1..258e6cbe4 100644 --- a/src/pk/dsa/dsa_verify_key.c +++ b/src/pk/dsa/dsa_verify_key.c @@ -60,8 +60,7 @@ int dsa_int_validate_pqg(dsa_key *key, int *stat) if ( key->qord >= LTC_MDSA_MAX_GROUP || key->qord <= 15 || (unsigned long)key->qord >= mp_unsigned_bin_size(key->p) || (mp_unsigned_bin_size(key->p) - key->qord) >= LTC_MDSA_DELTA ) { - err = CRYPT_OK; - goto error; + return CRYPT_OK; } /* FIPS 186-4 chapter 4.1: 1 < g < p */ From 3ddb45a6b7a64e66d13a5cf0c437428041e81439 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 20:32:47 +0200 Subject: [PATCH 1094/1192] fix scan-build bug/warning in tv_gen --- demos/tv_gen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demos/tv_gen.c b/demos/tv_gen.c index 86abf770a..127c114ee 100644 --- a/demos/tv_gen.c +++ b/demos/tv_gen.c @@ -527,6 +527,10 @@ void ccm_gen(void) printf("Error CCM'ing: %s\n", error_to_string(err)); exit(EXIT_FAILURE); } + if (len == 0) { + printf("Error CCM'ing: zero length\n"); + exit(EXIT_FAILURE); + } fprintf(out, "%3d: ", y1); for (z = 0; z < y1; z++) { fprintf(out, "%02X", plaintext[z]); From 84fcd4aec7f2cbf912ed8ebbcb4a7f00e801e514 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 21:42:33 +0200 Subject: [PATCH 1095/1192] scan_build --status-bugs - related to #287 --- scan_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scan_build.sh b/scan_build.sh index 571ec4da7..91fcc562f 100755 --- a/scan_build.sh +++ b/scan_build.sh @@ -16,4 +16,4 @@ scan_build=$(which scan-build) [ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || echo "run $scan_build" export CFLAGS="-DUSE_LTM -DLTM_DESC -I/usr/include" export EXTRALIBS="-ltommath" -$scan_build make -f makefile.unix all CFLAGS="$CFLAGS" EXTRALIBS="$EXTRALIBS" +$scan_build --status-bugs make -f makefile.unix all CFLAGS="$CFLAGS" EXTRALIBS="$EXTRALIBS" From 3b663a199f8a3d2f6149ddebb8d98130b158c704 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 18 Sep 2017 09:24:19 +0200 Subject: [PATCH 1096/1192] fix char* vs. const char* (tests related part) --- src/hashes/blake2b.c | 8 ++-- src/hashes/blake2s.c | 8 ++-- src/hashes/md2.c | 2 +- src/hashes/md4.c | 2 +- src/hashes/md5.c | 2 +- src/hashes/rmd128.c | 2 +- src/hashes/rmd160.c | 2 +- src/hashes/rmd256.c | 2 +- src/hashes/rmd320.c | 2 +- src/hashes/sha1.c | 2 +- src/hashes/sha2/sha224.c | 2 +- src/hashes/sha2/sha256.c | 2 +- src/hashes/sha2/sha384.c | 2 +- src/hashes/sha2/sha512.c | 2 +- src/hashes/sha2/sha512_224.c | 2 +- src/hashes/sha2/sha512_256.c | 2 +- src/hashes/tiger.c | 2 +- src/mac/hmac/hmac_test.c | 4 +- src/misc/hkdf/hkdf_test.c | 2 +- src/misc/pkcs5/pkcs_5_test.c | 4 +- tests/common.c | 2 +- tests/common.h | 2 +- tests/dsa_test.c | 10 ++-- tests/file_test.c | 2 +- tests/mpi_test.c | 88 ++++++++++++++++++------------------ 25 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/hashes/blake2b.c b/src/hashes/blake2b.c index 25242864d..cd5115ca9 100644 --- a/src/hashes/blake2b.c +++ b/src/hashes/blake2b.c @@ -399,7 +399,7 @@ int blake2b_512_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[64]; } tests[] = { { "", @@ -450,7 +450,7 @@ int blake2b_384_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[48]; } tests[] = { { "", @@ -497,7 +497,7 @@ int blake2b_256_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[32]; } tests[] = { { "", @@ -550,7 +550,7 @@ int blake2b_160_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[20]; } tests[] = { { "", diff --git a/src/hashes/blake2s.c b/src/hashes/blake2s.c index 1cbf597b9..e3e90f86b 100644 --- a/src/hashes/blake2s.c +++ b/src/hashes/blake2s.c @@ -387,7 +387,7 @@ int blake2s_256_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[32]; } tests[] = { { "", @@ -441,7 +441,7 @@ int blake2s_224_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[28]; } tests[] = { { "", @@ -485,7 +485,7 @@ int blake2s_160_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[20]; } tests[] = { { "", @@ -527,7 +527,7 @@ int blake2s_128_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[16]; } tests[] = { { "", diff --git a/src/hashes/md2.c b/src/hashes/md2.c index 58f97376f..36cc8aeca 100644 --- a/src/hashes/md2.c +++ b/src/hashes/md2.c @@ -191,7 +191,7 @@ int md2_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[16]; } tests[] = { { "", diff --git a/src/hashes/md4.c b/src/hashes/md4.c index cddc2b58a..09b6e31fc 100644 --- a/src/hashes/md4.c +++ b/src/hashes/md4.c @@ -254,7 +254,7 @@ int md4_test(void) return CRYPT_NOP; #else static const struct md4_test_case { - char *input; + const char *input; unsigned char hash[16]; } tests[] = { { "", diff --git a/src/hashes/md5.c b/src/hashes/md5.c index 93fe2ec28..511329a9a 100644 --- a/src/hashes/md5.c +++ b/src/hashes/md5.c @@ -314,7 +314,7 @@ int md5_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[16]; } tests[] = { { "", diff --git a/src/hashes/rmd128.c b/src/hashes/rmd128.c index 26e64b281..df1af1ad5 100644 --- a/src/hashes/rmd128.c +++ b/src/hashes/rmd128.c @@ -353,7 +353,7 @@ int rmd128_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[16]; } tests[] = { { "", diff --git a/src/hashes/rmd160.c b/src/hashes/rmd160.c index 165afd26e..8add41e3c 100644 --- a/src/hashes/rmd160.c +++ b/src/hashes/rmd160.c @@ -412,7 +412,7 @@ int rmd160_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[20]; } tests[] = { { "", diff --git a/src/hashes/rmd256.c b/src/hashes/rmd256.c index c2149b675..5fade8213 100644 --- a/src/hashes/rmd256.c +++ b/src/hashes/rmd256.c @@ -366,7 +366,7 @@ int rmd256_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[32]; } tests[] = { { "", diff --git a/src/hashes/rmd320.c b/src/hashes/rmd320.c index 0098e0b7e..a4356c4c3 100644 --- a/src/hashes/rmd320.c +++ b/src/hashes/rmd320.c @@ -431,7 +431,7 @@ int rmd320_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[40]; } tests[] = { { "", diff --git a/src/hashes/sha1.c b/src/hashes/sha1.c index 8fbdabfd4..40f0175a6 100644 --- a/src/hashes/sha1.c +++ b/src/hashes/sha1.c @@ -246,7 +246,7 @@ int sha1_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[20]; } tests[] = { { "abc", diff --git a/src/hashes/sha2/sha224.c b/src/hashes/sha2/sha224.c index 9233cba40..773a2c521 100644 --- a/src/hashes/sha2/sha224.c +++ b/src/hashes/sha2/sha224.c @@ -88,7 +88,7 @@ int sha224_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[28]; } tests[] = { { "abc", diff --git a/src/hashes/sha2/sha256.c b/src/hashes/sha2/sha256.c index 723e8aa65..f1dc4232e 100644 --- a/src/hashes/sha2/sha256.c +++ b/src/hashes/sha2/sha256.c @@ -292,7 +292,7 @@ int sha256_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[32]; } tests[] = { { "abc", diff --git a/src/hashes/sha2/sha384.c b/src/hashes/sha2/sha384.c index c28ddd1c1..16238127b 100644 --- a/src/hashes/sha2/sha384.c +++ b/src/hashes/sha2/sha384.c @@ -90,7 +90,7 @@ int sha384_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[48]; } tests[] = { { "abc", diff --git a/src/hashes/sha2/sha512.c b/src/hashes/sha2/sha512.c index d169a9118..110203a6f 100644 --- a/src/hashes/sha2/sha512.c +++ b/src/hashes/sha2/sha512.c @@ -262,7 +262,7 @@ int sha512_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[64]; } tests[] = { { "abc", diff --git a/src/hashes/sha2/sha512_224.c b/src/hashes/sha2/sha512_224.c index 75d44fc93..48bb93845 100644 --- a/src/hashes/sha2/sha512_224.c +++ b/src/hashes/sha2/sha512_224.c @@ -90,7 +90,7 @@ int sha512_224_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[28]; } tests[] = { { "abc", diff --git a/src/hashes/sha2/sha512_256.c b/src/hashes/sha2/sha512_256.c index 0bbcaea33..943adaa6f 100644 --- a/src/hashes/sha2/sha512_256.c +++ b/src/hashes/sha2/sha512_256.c @@ -90,7 +90,7 @@ int sha512_256_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[32]; } tests[] = { { "abc", diff --git a/src/hashes/tiger.c b/src/hashes/tiger.c index 2438626d8..863f7fa24 100644 --- a/src/hashes/tiger.c +++ b/src/hashes/tiger.c @@ -735,7 +735,7 @@ int tiger_test(void) return CRYPT_NOP; #else static const struct { - char *msg; + const char *msg; unsigned char hash[24]; } tests[] = { { "", diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index e3d075405..1570a76ef 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -142,8 +142,8 @@ int hmac_test(void) }; static const struct hmac_test_case { - char *num; - char *algo; + const char *num; + const char *algo; const unsigned char *key; unsigned long keylen; const unsigned char *data; diff --git a/src/misc/hkdf/hkdf_test.c b/src/misc/hkdf/hkdf_test.c index 632cea9ad..f3d5811b8 100644 --- a/src/misc/hkdf/hkdf_test.c +++ b/src/misc/hkdf/hkdf_test.c @@ -40,7 +40,7 @@ int hkdf_test(void) static const struct hkdf_test_case { int num; - char* Hash; + const char* Hash; unsigned char IKM[80]; unsigned long IKM_l; unsigned char salt[80]; diff --git a/src/misc/pkcs5/pkcs_5_test.c b/src/misc/pkcs5/pkcs_5_test.c index 3788fa464..f6e413b28 100644 --- a/src/misc/pkcs5/pkcs_5_test.c +++ b/src/misc/pkcs5/pkcs_5_test.c @@ -35,9 +35,9 @@ int pkcs_5_test (void) #else typedef struct { - char* P; + const char* P; unsigned long P_len; - char* S; + const char* S; unsigned long S_len; int c; unsigned long dkLen; diff --git a/tests/common.c b/tests/common.c index 9527e9434..18a561481 100644 --- a/tests/common.c +++ b/tests/common.c @@ -15,7 +15,7 @@ Steffen Jaeckel */ -void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm) +void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm) { if (res != CRYPT_OK) { fprintf(stderr, "%s (%d)%s%s\n%s:%d:%s\n", diff --git a/tests/common.h b/tests/common.h index 0a88f3175..410db1e8e 100644 --- a/tests/common.h +++ b/tests/common.h @@ -21,7 +21,7 @@ extern prng_state yarrow_prng; #define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0) #endif -void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm); +void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm); void print_hex(const char* what, const void* v, const unsigned long l); diff --git a/tests/dsa_test.c b/tests/dsa_test.c index c21e38277..d011db85a 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -53,11 +53,11 @@ static const unsigned char openssl_priv_dsa[] = { }; /* private key - raw hexadecimal numbers */ -static char *hex_g = "3B92E4FF5929150B08995A7BF2AD1440556FA047FF9099B344B3D4FC451505AE6722439CBA3710A5894737ECCCF5AEADA8B47A35CB9D935CEDE6B07E9694C4A60C7DD6708A094F814A0EC213FBEB16BFEAA4F456FF723005DE8A443FBEC6852655D62D1D1EDB15DAA445833C1797980B8D87F3490D90BDA9AB676E87687223DC"; -static char *hex_p = "C50A37515CABD618D5A270BD4A6F6B4AF9E139950F2B99387D9A64D64CB5967ADCEDACA8ACC61B655ADEDB0061251A182CEEA10790625E4D123190C70321FA09E7B173D78EAFDBFDBFB3EFADD1A12A036DE706924A852AFF7A0166531FEAC66741845AC06CED62F9C2626205A4FA48A066EC35C9A811FEB981ABEEBE31B6BFCF"; -static char *hex_q = "AA5BD7F4E5062413E58835CA00C7A635716194C5"; -static char *hex_x = "9936E5E4E9FB28BE91F5065FE8C935B3F5D81FC5"; -static char *hex_y = "5316B0FBBF598A5E5595C14FAC43B80853E6CF0D9223FAB184595239BFCBF22D383ADD935205497E2B12C46173E36F54BD96E5A7AAA95A58A4B767D2C0BDC81EB13A124F98C005EF395D6ABAB70B3BD8B795DD796EA2D28473470388B464D9B9B84FF1C934BBF97366F57C2E11FEC331E60838596781EB6D4127D70D74AFA035"; +static const char *hex_g = "3B92E4FF5929150B08995A7BF2AD1440556FA047FF9099B344B3D4FC451505AE6722439CBA3710A5894737ECCCF5AEADA8B47A35CB9D935CEDE6B07E9694C4A60C7DD6708A094F814A0EC213FBEB16BFEAA4F456FF723005DE8A443FBEC6852655D62D1D1EDB15DAA445833C1797980B8D87F3490D90BDA9AB676E87687223DC"; +static const char *hex_p = "C50A37515CABD618D5A270BD4A6F6B4AF9E139950F2B99387D9A64D64CB5967ADCEDACA8ACC61B655ADEDB0061251A182CEEA10790625E4D123190C70321FA09E7B173D78EAFDBFDBFB3EFADD1A12A036DE706924A852AFF7A0166531FEAC66741845AC06CED62F9C2626205A4FA48A066EC35C9A811FEB981ABEEBE31B6BFCF"; +static const char *hex_q = "AA5BD7F4E5062413E58835CA00C7A635716194C5"; +static const char *hex_x = "9936E5E4E9FB28BE91F5065FE8C935B3F5D81FC5"; +static const char *hex_y = "5316B0FBBF598A5E5595C14FAC43B80853E6CF0D9223FAB184595239BFCBF22D383ADD935205497E2B12C46173E36F54BD96E5A7AAA95A58A4B767D2C0BDC81EB13A124F98C005EF395D6ABAB70B3BD8B795DD796EA2D28473470388B464D9B9B84FF1C934BBF97366F57C2E11FEC331E60838596781EB6D4127D70D74AFA035"; /* The public part of test_dsa.key in SubjectPublicKeyInfo format */ static const unsigned char openssl_pub_dsa[] = { diff --git a/tests/file_test.c b/tests/file_test.c index 24ea559cd..9ba607ea3 100644 --- a/tests/file_test.c +++ b/tests/file_test.c @@ -19,7 +19,7 @@ int file_test(void) 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; unsigned char buf[200]; unsigned long len; - char *fname = "tests/test.key"; + const char *fname = "tests/test.key"; FILE *in; int err, isha256, iaes; diff --git a/tests/mpi_test.c b/tests/mpi_test.c index c635d1a06..9bb73ae47 100644 --- a/tests/mpi_test.c +++ b/tests/mpi_test.c @@ -12,48 +12,48 @@ static int _radix_to_bin_test(void) { /* RADIX 16 */ - char *ghex = "2"; - char *phex = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22" - "514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6" - "F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB" - "9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E8603" - "9B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA0510" - "15728E5A8AACAA68FFFFFFFFFFFFFFFF"; - char *xhex = "A6681ADC386CE944C3DED9A7301DCC9C518250E3EDB62F959198F8DC0057DD6FB57ABAFD788198B1"; - char *yhex = "39046632C834418DFA07B3091538B614D1FB5DBB785C0FBEA3B98B295BC0CD076A88D9452141A269" - "E8BAEB1DD654EBA03A5705318D129754CDF4003A8C399240FBB8F162490F6F0DC70E414B6FEE8808" - "6AFAA48E9F3A248EDC093452663D34E0E809D4F6BADBB36F80B6813EBF7C3281B862209E5604BDEA" - "8B8F5F7BFDC3EEB7ADB73048289BCEA0F5A5CDEE7DF91CD1F0BA632F06DBE9BA7EF014B84B02D497" - "CA7D0C60F734752A649DA496946B4E531B30D9F82EDD855636C0B0F2AE232E4186454E8887BB423E" - "32A5A2495EACBA99620ACD03A38345EBB6735E62330A8EE9AA6C8370410F5CD45AF37EE90A0DA95B" - "E96FC939E88FE0BD2CD09FC8F524208C"; + const char *ghex = "2"; + const char *phex = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22" + "514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6" + "F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB" + "9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E8603" + "9B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AACAA68FFFFFFFFFFFFFFFF"; + const char *xhex = "A6681ADC386CE944C3DED9A7301DCC9C518250E3EDB62F959198F8DC0057DD6FB57ABAFD788198B1"; + const char *yhex = "39046632C834418DFA07B3091538B614D1FB5DBB785C0FBEA3B98B295BC0CD076A88D9452141A269" + "E8BAEB1DD654EBA03A5705318D129754CDF4003A8C399240FBB8F162490F6F0DC70E414B6FEE8808" + "6AFAA48E9F3A248EDC093452663D34E0E809D4F6BADBB36F80B6813EBF7C3281B862209E5604BDEA" + "8B8F5F7BFDC3EEB7ADB73048289BCEA0F5A5CDEE7DF91CD1F0BA632F06DBE9BA7EF014B84B02D497" + "CA7D0C60F734752A649DA496946B4E531B30D9F82EDD855636C0B0F2AE232E4186454E8887BB423E" + "32A5A2495EACBA99620ACD03A38345EBB6735E62330A8EE9AA6C8370410F5CD45AF37EE90A0DA95B" + "E96FC939E88FE0BD2CD09FC8F524208C"; /* RADIX 47 */ - char *gr47 = "2"; - char *pr47 = "F27Mg1SadOFIRbDOJ5dHgHiVF02Z1LHHQ6G5SLG2U8aTdfH1ETk4GARRE7WW99dBUBLb9e2OHFIaSM1A" - "ag2LNNjgYa9I9CjQGJihL3J7A2SGQe8j5Ch8EHMj5jVbAYDiQKhhPhM6Hc56fKS40GUfJkGO7KJ6EXZQ" - "VgbSa2AkPC65F91g0PaYie8AGNVaFKaV9HOQf3ia1iW4i6eCOB9CcBbH7TbQij8AEgjZ0VRBcLKc6UYO" - "1Zc3I2Jc0h1H2HBEH8ONI3OYBbaPV6XhAd8WCc60D0RDBU3H9U7cWL28a0c90XNO0dh5RXEFBbUCE2ZG" - "gh9XQSVIHkVbFIS5F5IGVOkiWAVc9i8BHB2V0UbGW6UdRTZVV"; - char *xr47 = "6bhO7O9NWFRgEMjdU0Y5POj3c1JP15MYEdIg3FO1PEjUY2aGYNSXcaF01R"; - char *yr47 = "3GNPNWEYfKML1cIbI7Cc1Z0O7aQLJgB734dO2i56LLYDdI4gHYk2GAbQH2WI97hNeC7dj3fPEH8I9gV9" - "U323AXj1AJXbFPFIHGOTdC29QUUeH2SSc6NWhfQDDXd5Q5iXCKEAUGX3SKcNFIfVOYJgZCLjfHYQdgOQ" - "GCjKNgbEV7Hj34MU3b79iANX2DbMYfb9iGi78BWH2HYAd7IAhk7U0OYGHKJX1bIUUj1KBLhAUg46GaER" - "G9W3ARMfBCj6kSdDF9TdkWAjWTDj722IeVJERC4bKU2VDFG20kDhCMF985efD1SS8DfXcdCHF1kDUkSA" - "884FHYiFEPkaagQOBQaN9BNaEHNbbd002DCIIX5eMP4HgPJPF"; + const char *gr47 = "2"; + const char *pr47 = "F27Mg1SadOFIRbDOJ5dHgHiVF02Z1LHHQ6G5SLG2U8aTdfH1ETk4GARRE7WW99dBUBLb9e2OHFIaSM1A" + "ag2LNNjgYa9I9CjQGJihL3J7A2SGQe8j5Ch8EHMj5jVbAYDiQKhhPhM6Hc56fKS40GUfJkGO7KJ6EXZQ" + "VgbSa2AkPC65F91g0PaYie8AGNVaFKaV9HOQf3ia1iW4i6eCOB9CcBbH7TbQij8AEgjZ0VRBcLKc6UYO" + "1Zc3I2Jc0h1H2HBEH8ONI3OYBbaPV6XhAd8WCc60D0RDBU3H9U7cWL28a0c90XNO0dh5RXEFBbUCE2ZG" + "gh9XQSVIHkVbFIS5F5IGVOkiWAVc9i8BHB2V0UbGW6UdRTZVV"; + const char *xr47 = "6bhO7O9NWFRgEMjdU0Y5POj3c1JP15MYEdIg3FO1PEjUY2aGYNSXcaF01R"; + const char *yr47 = "3GNPNWEYfKML1cIbI7Cc1Z0O7aQLJgB734dO2i56LLYDdI4gHYk2GAbQH2WI97hNeC7dj3fPEH8I9gV9" + "U323AXj1AJXbFPFIHGOTdC29QUUeH2SSc6NWhfQDDXd5Q5iXCKEAUGX3SKcNFIfVOYJgZCLjfHYQdgOQ" + "GCjKNgbEV7Hj34MU3b79iANX2DbMYfb9iGi78BWH2HYAd7IAhk7U0OYGHKJX1bIUUj1KBLhAUg46GaER" + "G9W3ARMfBCj6kSdDF9TdkWAjWTDj722IeVJERC4bKU2VDFG20kDhCMF985efD1SS8DfXcdCHF1kDUkSA" + "884FHYiFEPkaagQOBQaN9BNaEHNbbd002DCIIX5eMP4HgPJPF"; /* RADIX 64 */ - char *gr64 = "2"; - char *pr64 = "3//////////yaFsg8XQC8qnCPYYu3S7D4f0au8YcVCT08BlgOx4viYKKe8UOuq1DtlbHcppJf36p0h2c" - "toNnGtJ+4rRMrHmaNaXRLsObv+nlHCGkccD+rh2/zSjlG6j+tkE6lxMecVfQwV915yIn/cIIXcKUpaMp" - "t207oueME/1PZQI3OSLTEQQHO/gFqapr+3PLqZtAEjbXnYyrOWXLAxdjKf1t2Mbcrd33LEIhoO1F5qR0" - "ZA625yCf1UHYuspZlZddSi60w60vidWwBi1wAFjSLTy6zCKidUAylsbLWN63cLINpgbMhb5T8c69Zw1H" - "0LSevQYgogQF//////////"; - char *xr64 = "2cQ1hSE6pfHCFUsQSm7SoSKO9Gu+ssBvMHcFZS05VTRxLwklruWPYn"; - char *yr64 = "v16Ooo3H1ZVe7imaLEBOKqVjTktXS3xwZkOifMy3D1sg8sKKXGQ9fwBhh7TPKww0wLmKnZHANLCtq03g" - "CEP90+xZnOaaFRmt73a5BR+w826hwf8wVEYIEt0aqKcOzDE3e2TJskjkpRu2sWJw/V3A1k68WdbO4lUg" - "BZrzx/SFkjwstC4WecywWzQNDxdtv7D7mkcCl1jlfkdxm5BXB0jINodqCOFSqTIfadQIMb6jEKnimsVW" - "ktOLMDi2myguZBa66HKw8Xxj2FZAbeabUhBgPOWhD0wE3HUksSrvYCmgEwQfiWt113rpKMlD+wGeDgLl" - "fRyavw8/WlIpGdyZr922C"; + const char *gr64 = "2"; + const char *pr64 = "3//////////yaFsg8XQC8qnCPYYu3S7D4f0au8YcVCT08BlgOx4viYKKe8UOuq1DtlbHcppJf36p0h2c" + "toNnGtJ+4rRMrHmaNaXRLsObv+nlHCGkccD+rh2/zSjlG6j+tkE6lxMecVfQwV915yIn/cIIXcKUpaMp" + "t207oueME/1PZQI3OSLTEQQHO/gFqapr+3PLqZtAEjbXnYyrOWXLAxdjKf1t2Mbcrd33LEIhoO1F5qR0" + "ZA625yCf1UHYuspZlZddSi60w60vidWwBi1wAFjSLTy6zCKidUAylsbLWN63cLINpgbMhb5T8c69Zw1H" + "0LSevQYgogQF//////////"; + const char *xr64 = "2cQ1hSE6pfHCFUsQSm7SoSKO9Gu+ssBvMHcFZS05VTRxLwklruWPYn"; + const char *yr64 = "v16Ooo3H1ZVe7imaLEBOKqVjTktXS3xwZkOifMy3D1sg8sKKXGQ9fwBhh7TPKww0wLmKnZHANLCtq03g" + "CEP90+xZnOaaFRmt73a5BR+w826hwf8wVEYIEt0aqKcOzDE3e2TJskjkpRu2sWJw/V3A1k68WdbO4lUg" + "BZrzx/SFkjwstC4WecywWzQNDxdtv7D7mkcCl1jlfkdxm5BXB0jINodqCOFSqTIfadQIMb6jEKnimsVW" + "ktOLMDi2myguZBa66HKw8Xxj2FZAbeabUhBgPOWhD0wE3HUksSrvYCmgEwQfiWt113rpKMlD+wGeDgLl" + "fRyavw8/WlIpGdyZr922C"; /* RADIX 256 */ unsigned char gbin[] = { 0x02 }; unsigned char pbin[] = { @@ -100,10 +100,10 @@ static int _radix_to_bin_test(void) struct { int radix; - void* g; int glen; - void* p; int plen; - void* x; int xlen; - void* y; int ylen; + const void* g; int glen; + const void* p; int plen; + const void* x; int xlen; + const void* y; int ylen; } test[4] = { { 256, gbin, sizeof(gbin), pbin, sizeof(pbin), xbin, sizeof(xbin), ybin, sizeof(ybin) }, { 16, ghex, strlen(ghex)+1, phex, strlen(phex)+1, xhex, strlen(xhex)+1, yhex, strlen(yhex)+1 }, From 5057af3ef141e88d6c6ecf35b56a602d4737851e Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 15 Sep 2017 09:47:29 +0200 Subject: [PATCH 1097/1192] fix char* vs. const char* --- src/headers/tomcrypt_argchk.h | 2 +- src/headers/tomcrypt_cipher.h | 2 +- src/headers/tomcrypt_hash.h | 2 +- src/headers/tomcrypt_math.h | 2 +- src/headers/tomcrypt_pk.h | 14 +++++++------- src/headers/tomcrypt_prng.h | 2 +- src/misc/crypt/crypt_argchk.c | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/headers/tomcrypt_argchk.h b/src/headers/tomcrypt_argchk.h index 17390e6a6..be9ef0f52 100644 --- a/src/headers/tomcrypt_argchk.h +++ b/src/headers/tomcrypt_argchk.h @@ -20,7 +20,7 @@ #define NORETURN #endif -void crypt_argchk(char *v, char *s, int d) NORETURN; +void crypt_argchk(const char *v, const char *s, int d) NORETURN; #define LTC_ARGCHK(x) do { if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } }while(0) #define LTC_ARGCHKVD(x) do { if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } }while(0) diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index 6839e2dfc..c4361cdb5 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -349,7 +349,7 @@ typedef struct { /** cipher descriptor table, last entry has "name == NULL" to mark the end of table */ extern struct ltc_cipher_descriptor { /** name of cipher */ - char *name; + const char *name; /** internal ID */ unsigned char ID; /** min keysize (octets) */ diff --git a/src/headers/tomcrypt_hash.h b/src/headers/tomcrypt_hash.h index cbd9d7c88..ef494f721 100644 --- a/src/headers/tomcrypt_hash.h +++ b/src/headers/tomcrypt_hash.h @@ -204,7 +204,7 @@ typedef union Hash_state { /** hash descriptor */ extern struct ltc_hash_descriptor { /** name of hash */ - char *name; + const char *name; /** internal ID */ unsigned char ID; /** Size of digest in octets */ diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index b655346d0..45c3a13d8 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -35,7 +35,7 @@ int radix_to_bin(const void *in, int radix, void *out, unsigned long *len); /** math descriptor */ typedef struct { /** Name of the math provider */ - char *name; + const char *name; /** Bits per digit, amount of bits must fit in an unsigned long */ int bits_per_digit; diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 837baa7d3..802c24478 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -230,7 +230,7 @@ int dh_export_key(void *out, unsigned long *outlen, int type, dh_key *key); #ifdef LTC_SOURCE typedef struct { int size; - char *name, *base, *prime; + const char *name, *base, *prime; } ltc_dh_set_type; extern const ltc_dh_set_type ltc_dh_sets[]; @@ -257,22 +257,22 @@ typedef struct { int size; /** name of curve */ - char *name; + const char *name; /** The prime that defines the field the curve is in (encoded in hex) */ - char *prime; + const char *prime; /** The fields B param (hex) */ - char *B; + const char *B; /** The order of the curve (hex) */ - char *order; + const char *order; /** The x co-ordinate of the base point on the curve (hex) */ - char *Gx; + const char *Gx; /** The y co-ordinate of the base point on the curve (hex) */ - char *Gy; + const char *Gy; } ltc_ecc_set_type; /** A point on a ECC curve, stored in Jacbobian format such that (x,y,z) => (x/z^2, y/z^3, 1) when interpretted as affine */ diff --git a/src/headers/tomcrypt_prng.h b/src/headers/tomcrypt_prng.h index 1163367c7..c516b8cda 100644 --- a/src/headers/tomcrypt_prng.h +++ b/src/headers/tomcrypt_prng.h @@ -81,7 +81,7 @@ typedef struct { /** PRNG descriptor */ extern struct ltc_prng_descriptor { /** Name of the PRNG */ - char *name; + const char *name; /** size in bytes of exported state */ int export_size; /** Start a PRNG state diff --git a/src/misc/crypt/crypt_argchk.c b/src/misc/crypt/crypt_argchk.c index 3b6606751..da7306b17 100644 --- a/src/misc/crypt/crypt_argchk.c +++ b/src/misc/crypt/crypt_argchk.c @@ -14,7 +14,7 @@ */ #if (ARGTYPE == 0) -void crypt_argchk(char *v, char *s, int d) +void crypt_argchk(const char *v, const char *s, int d) { fprintf(stderr, "LTC_ARGCHK '%s' failure on line %d of file %s\n", v, d, s); From b2813480bf879dd03dbe26bc3273733842a2639b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Fri, 15 Sep 2017 10:01:03 +0200 Subject: [PATCH 1098/1192] LTC_CFLAGS += -Wwrite-strings --- makefile_include.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/makefile_include.mk b/makefile_include.mk index f422135ad..975b49ec9 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -70,6 +70,7 @@ LTC_CFLAGS += -Wextra LTC_CFLAGS += -Wsystem-headers -Wbad-function-cast -Wcast-align LTC_CFLAGS += -Wstrict-prototypes -Wpointer-arith LTC_CFLAGS += -Wdeclaration-after-statement +LTC_CFLAGS += -Wwrite-strings endif LTC_CFLAGS += -Wno-type-limits From 4b36f0654f506680c72d4cfbda4bb6fd546180a4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 19 Sep 2017 14:19:43 +0200 Subject: [PATCH 1099/1192] Add 'Installation' section This closes #293 [skip-ci] --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index b9bed9480..14353eea8 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,13 @@ The following list does not claim to be complete resp. to be available across al | `timing` | builds the `timing` binary, which can be used to measure timings for algorithms and modes *\*4* *\*6* | | `bins` | builds `hashsum` *\*4* | | `all_test` | builds `test`, `hashsum`, `ltcrypt`, `small`, `tv_gen`, `sizes` & `constants` *\*4* | +| `docs` | builds the developer documentation `doc/crypt.pdf` | +| `install` | installs the `library` and header files *\*7* *\*8* | +| `install_bins` | installs the binaries created by the `bins` target *\*7* *\*8* | +| `install_docs` | installs the documentation created by the `docs` target *\*7* *\*8* | +| `install_test` | installs the test-app created by the `test` target *\*7* *\*8* | +| `install_all` | installs everything (i.e. `library`, `bins`, `docs` and `test`) *\*8* | +| `uninstall` | uninstalls the `library` and header files | *\*4* also builds `library` @@ -100,6 +107,10 @@ The following list does not claim to be complete resp. to be available across al *\*6* requires define of one of `USE_GMP`, `USE_LTM` or `USE_TFM` (+ the appropriate MPI provider) +*\*7* also builds the necessary artifact(s) before installing it + +*\*8* also have a look at the 'Installation' section of this file + ### Examples You want to build the library as static library @@ -125,3 +136,37 @@ You have `gmp`, `libtommath` and `tomsfastmath` installed on your system and wan If you have `libtommath` in a non-standard location: make CFLAGS="-DUSE_LTM -DLTM_DESC -I/opt/devel/ltm" EXTRALIBS="/opt/devel/ltm/libtommath.a" all + +## Installation + +There exist several _install_ make-targets which are described in the table above. + +These targets support the standard ways (c.f. [[GNU]], [[FreeBSD]]) +to modify the installation path via the following set of variables: + + DESTDIR + PREFIX + LIBPATH + INCPATH + DATAPATH + BINPATH + +The entire set of the variables is only supported in `makefile`, `makefile.shared` and `makefile.unix`. + +In case you have to use one of the other makefiles, check in the file which variables are supported. + +### Examples + +You want to install the static library to the default paths + + make install + +You want to install the shared library to a special path and use it from this path + + make -f makefile.shared PREFIX=/opt/special/path + +Have a look at the developer documentation, [[GNU]] or [[FreeBSD]] to get a detailed explanation of all the variables. + +[GNU]: https://www.gnu.org/prep/standards/html_node/DESTDIR.html + +[FreeBSD]: https://www.freebsd.org/doc/en/books/porters-handbook/porting-prefix.html From 155e29dd681fd6d55ebda7f7f004849481aebdbc Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 20 Sep 2017 11:58:32 +0200 Subject: [PATCH 1100/1192] dsa_verify_hash must set stat=0 on any error --- src/pk/dsa/dsa_verify_hash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index baac9ee0a..5c6d19c9b 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -101,6 +101,9 @@ int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, ltc_asn1_list sig_seq[2]; unsigned long reallen = 0; + LTC_ARGCHK(stat != NULL); + *stat = 0; /* must be set before the first return */ + if ((err = mp_init_multi(&r, &s, NULL)) != CRYPT_OK) { return err; } From 66abefc54b1d202e795e34bb5fe800c0ee6580f8 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 20 Sep 2017 11:59:03 +0200 Subject: [PATCH 1101/1192] add dsa_wycheproof_test + fix old dsa tests --- tests/dsa_test.c | 83 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 6 deletions(-) diff --git a/tests/dsa_test.c b/tests/dsa_test.c index d011db85a..e77e7de11 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -246,6 +246,76 @@ static int _dsa_compat_test(void) return CRYPT_OK; } +static int _dsa_wycheproof_test(void) +{ + /* test case from https://github.com/google/wycheproof/blob/master/testvectors/dsa_test.json + * + * "comment" : "appending unused 0's", + * "message" : "48656c6c6f", + * "result" : "invalid", + * "sig" : "303d021c1e41b479ad576905b960fe14eadb91b0ccf34843dab916173bb8c9cd021d00ade65988d237d30f9ef41dd424a4e1c8f16967cf3365813fe87862360000", + * "tcId" : 55 + */ + unsigned char msg[] = { 0x48, 0x65, 0x6c, 0x6c, 0x6f }; + unsigned char sig[] = { 0x30, 0x3d, 0x02, 0x1c, 0x1e, 0x41, 0xb4, 0x79, 0xad, 0x57, 0x69, 0x05, 0xb9, 0x60, 0xfe, + 0x14, 0xea, 0xdb, 0x91, 0xb0, 0xcc, 0xf3, 0x48, 0x43, 0xda, 0xb9, 0x16, 0x17, 0x3b, 0xb8, + 0xc9, 0xcd, 0x02, 0x1d, 0x00, 0xad, 0xe6, 0x59, 0x88, 0xd2, 0x37, 0xd3, 0x0f, 0x9e, 0xf4, + 0x1d, 0xd4, 0x24, 0xa4, 0xe1, 0xc8, 0xf1, 0x69, 0x67, 0xcf, 0x33, 0x65, 0x81, 0x3f, 0xe8, + 0x78, 0x62, 0x36, 0x00, 0x00 }; + const char* b64key = + "MIIDQjCCAjUG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rszWVA" + "pWfDJyJUQOoVMZveBlEEeaGGF5niW1fezHPANtdaBwK9NzyiMTSZMQ=="; + unsigned char derkey[838]; + unsigned long derlen = sizeof(derkey); + unsigned char hash[32]; + unsigned long hashlen = sizeof(hash); + dsa_key key; + int stat; + + DO(base64_decode((unsigned char*)b64key, strlen(b64key), derkey, &derlen)); + if (derlen != 838) { + fprintf(stderr, "base64_decode failed, derlen=%lu (expected 838)\n", derlen); + return CRYPT_FAIL_TESTVECTOR; + } + DO(dsa_import(derkey, derlen, &key)); + DO(hash_memory(find_hash("sha224"), msg, sizeof(msg), hash, &hashlen)); + if (hashlen != 28) { + fprintf(stderr, "hash_memory failed, hashlen=%lu (expected 32)\n", hashlen); + return CRYPT_FAIL_TESTVECTOR; + } + + stat = 666; /* intentionally not one, not zero */ + DO(dsa_verify_hash(sig, sizeof(sig)-2, hash, hashlen, &stat, &key)); + /* without the last two 0x00 bytes it is a valid signature */ + if (stat != 1) { + fprintf(stderr, "dsa_verify_hash rejected valid signature\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + stat = 666; /* intentionally not one, not zero */ + DO(dsa_verify_hash(sig, sizeof(sig), hash, hashlen, &stat, &key)); + /* this should be invalid */ + if (stat != 0) { + fprintf(stderr, "dsa_verify_hash did not reject invalid signature\n"); + return CRYPT_FAIL_TESTVECTOR; + } + + return CRYPT_OK; +} + int dsa_test(void) { unsigned char msg[16], out[1024], out2[1024], ch; @@ -254,6 +324,7 @@ int dsa_test(void) dsa_key key, key2; DO(_dsa_compat_test()); + DO(_dsa_wycheproof_test()); /* make a random key */ DO(dsa_generate_pqg(&yarrow_prng, find_prng("yarrow"), 20, 128, &key)); @@ -291,9 +362,9 @@ int dsa_test(void) if (!(stat1 == 1 && stat2 == 0)) { fprintf(stderr, "dsa_verify %d %d", stat1, stat2); return 1; } /* test exporting it */ - x = sizeof(out2); - DO(dsa_export(out2, &x, PK_PRIVATE, &key)); - DO(dsa_import(out2, x, &key2)); + y = sizeof(out2); + DO(dsa_export(out2, &y, PK_PRIVATE, &key)); + DO(dsa_import(out2, y, &key2)); /* verify a signature with it */ DO(dsa_verify_hash(out, x, msg, sizeof(msg), &stat1, &key2)); @@ -301,10 +372,10 @@ int dsa_test(void) dsa_free(&key2); /* export as public now */ - x = sizeof(out2); - DO(dsa_export(out2, &x, PK_PUBLIC, &key)); + y = sizeof(out2); + DO(dsa_export(out2, &y, PK_PUBLIC, &key)); - DO(dsa_import(out2, x, &key2)); + DO(dsa_import(out2, y, &key2)); /* verify a signature with it */ DO(dsa_verify_hash(out, x, msg, sizeof(msg), &stat1, &key2)); if (stat1 == 0) { fprintf(stderr, "dsa_verify (import public) %d ", stat1); return 1; } From a9d9466694ceba1c396c40601a6b20b445ac3117 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 19 Sep 2017 18:51:47 +0200 Subject: [PATCH 1102/1192] beautify some strings [skip-ci] --- src/misc/crypt/crypt.c | 2 +- tests/test.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index ab378a5df..dd41df812 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -43,7 +43,7 @@ const char *crypt_build_settings = #else "disabled\n" #endif - "Ciphers built-in:\n" + "\nCiphers built-in:\n" #if defined(LTC_BLOWFISH) " Blowfish\n" #endif diff --git a/tests/test.c b/tests/test.c index 212dc149a..441fdb7d7 100644 --- a/tests/test.c +++ b/tests/test.c @@ -301,17 +301,17 @@ int main(int argc, char **argv) long delta, dur, real = 0; register_algs(); - printf("build == %s\n%s\n", GIT_VERSION, crypt_build_settings); + printf("LTC_VERSION = %s\n%s\n\n", GIT_VERSION, crypt_build_settings); #ifdef USE_LTM ltc_mp = ltm_desc; - printf("math provider = libtommath\n"); + printf("MP_PROVIDER = LibTomMath\n"); #elif defined(USE_TFM) ltc_mp = tfm_desc; - printf("math provider = tomsfastmath\n"); + printf("MP_PROVIDER = TomsFastMath\n"); #elif defined(USE_GMP) ltc_mp = gmp_desc; - printf("math provider = gnump\n"); + printf("MP_PROVIDER = GnuMP\n"); #elif defined(EXT_MATH_LIB) { extern ltc_math_descriptor EXT_MATH_LIB; @@ -320,7 +320,7 @@ int main(int argc, char **argv) #define NAME_VALUE(s) #s"="NAME(s) #define NAME(s) #s - printf("math provider = %s\n", NAME_VALUE(EXT_MATH_LIB)); + printf("MP_PROVIDER = %s\n", NAME_VALUE(EXT_MATH_LIB)); #undef NAME_VALUE #undef NAME From 01cb819c485d8aa0d00cce6a7acde4cf241a9cb0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 12:45:52 +0200 Subject: [PATCH 1103/1192] trim trailing spaces --- doc/crypt.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index cb88eb7c8..ef594b140 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -1515,7 +1515,7 @@ \subsubsection{Packet Functions} appropriately. \subsection{CCM Mode} -CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. +CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. \subsubsection{Initialization} To initialize the CCM context with a secret key call the following function. From a0a7daea6fb1596abe3d3da56bdcbff56113095b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 17:36:59 +0200 Subject: [PATCH 1104/1192] add termdoc option to view documentation on the terminal --- doc/makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/makefile b/doc/makefile index 30a76c16c..f9b75e5f3 100644 --- a/doc/makefile +++ b/doc/makefile @@ -55,6 +55,9 @@ docdvi: crypt.tex latex crypt $(silent_stdout) latex crypt $(silent_stdout) +termdoc: docdvi + dvi2tty crypt.dvi -w120 + clean: rm -f $(LEFTOVERS) rm -rf doxygen/ From ce68fa34ee4af79d5f0324302b17d57cfc6df828 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 12:46:15 +0200 Subject: [PATCH 1105/1192] add rand_bn_X() doc --- doc/crypt.tex | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/doc/crypt.tex b/doc/crypt.tex index ef594b140..12856ac05 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -5595,6 +5595,32 @@ \chapter{Miscellaneous} \textit{len = -128} to the function. Upon success it will return {\bf CRYPT\_OK} and \textit{N} will contain an integer which is very likely prime. +\mysection{Random MPI Generation} +\index{Random MPI Generation} + +Several Public Key Cryptography algorithms require random MPI's for operations like signature generation. +The library provides two API functions to generate random MPI's which allow the utilisation of a user-defined PRNG to aquire the random data. + +\index{rand\_bn\_bits()} +\begin{verbatim} +int rand_bn_bits( void *N, + int bits, + prng_state *prng, + int wprng); +\end{verbatim} + +This sets \textit{N} to a \textit{bits}-long random MPI. + +\index{rand\_bn\_upto()} +\begin{verbatim} +int rand_bn_upto( void *N, + void *limit, + prng_state *prng, + int wprng); +\end{verbatim} + +This ensures that \textit{N} is set to a random MPI in the range $1 \le N < limit$. + \mysection{Dynamic Language Support} \index{Dynamic Language Support} Various LibTomCrypt functions require that their callers define a struct From 728bc4a6a4cbe530c6087a7cc355c18e665b7086 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 13:12:01 +0200 Subject: [PATCH 1106/1192] update "Primality Testing" --- doc/crypt.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 12856ac05..05d8e1032 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -5557,7 +5557,7 @@ \chapter{Miscellaneous} \mysection{Primality Testing} \index{Primality Testing} The library includes primality testing and random prime functions as well. The primality tester will perform the test in -two phases. First it will perform trial division by the first few primes. Second it will perform eight rounds of the +two phases. First it will perform trial division by the first few primes. Second it will perform \textit{LTC\_MILLER\_RABIN\_REPS} (pre-defined to $35$) rounds of the Rabin-Miller primality testing algorithm. If the candidate passes both phases it is declared prime otherwise it is declared composite. No prime number will fail the two phases but composites can. Each round of the Rabin-Miller algorithm reduces the probability of a pseudo-prime by $1 \over 4$ therefore after sixteen rounds the probability is no more than From 9a0e208f5e568aceea8bd95151fadc203b6ddf40 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 13:12:21 +0200 Subject: [PATCH 1107/1192] add 'ltc_mp_digit' docs --- doc/crypt.tex | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 05d8e1032..1ccfa46a5 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -7264,9 +7264,13 @@ \subsection{Conventions} All functions (except where noted otherwise) return \textbf{CRYPT\_OK} to signify a successful operation. All error codes must be valid LibTomCrypt error codes. -The digit routines (including functions with the \textit{i} suffix) use a \textit{unsigned long} to represent the digit. If your internal digit is larger than this you must -then partition your digits. Normally this does not matter as \textit{unsigned long} will be the same size as your register size. Note that if your digit is smaller -than an \textit{unsigned long} that is also acceptable as the \textit{bits\_per\_digit} parameter will specify this. +The digit routines (including functions with the \textit{i} suffix) use a \textit{ltc\_mp\_digit} to represent the digit. If your internal digit is larger than this you must +then partition your digits. Note that if your digit is smaller than an \textit{ltc\_mp\_digit} that is also acceptable as the \textit{bits\_per\_digit} parameter will specify this. + +\subsubsection{ltc\_mp\_digit} +\index{ltc\_mp\_digit} + +Depending on the archtitecture \textit{ltc\_mp\_digit} is either a $32$- or $64$-bit long \textit{unsigned} data type. \subsection{ECC Functions} The ECC system in LibTomCrypt is based off of the NIST recommended curves over $GF(p)$ and is used to implement EC-DSA and EC-DH. The ECC functions work with From 09c319693089b76297184a1f595cc01a66733548 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 13:42:52 +0200 Subject: [PATCH 1108/1192] use v1.18.0 instead of v1.18 --- doc/crypt.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 1ccfa46a5..7e6458546 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -3817,7 +3817,7 @@ \subsection{RSA Key Export} The RSAPrivateKey (PKCS \#1 type) format will be used for the private key, indicated by \textbf{PK\_PRIVATE}. -As of v1.18 this function can also export OpenSSL-compatible formatted public RSA keys. +As of v1.18.0 this function can also export OpenSSL-compatible formatted public RSA keys. By OR'ing \textbf{PK\_STD} and \textbf{PK\_PUBLIC} the public key will be exported in the SubjectPublicKeyInfo (X.509 type) format. @@ -5259,13 +5259,13 @@ \subsection{ASN.1 Flexi Decoder} This can be detected by checking for \textit{child} elements with type \textbf{LTC\_ASN1\_EOL} after decoding. -As of v1.18 the flexi decoder will also decode arbitrary constructed types +As of v1.18.0 the flexi decoder will also decode arbitrary constructed types other than SEQUENCE and SET. The \textit{type} field will be set to \textbf{LTC\_ASN1\_CONSTRUCTED} and the plain identifier that was indicated in the ASN.1 encoding is stored in the \textit{used} field. Further decoding is done in the same way as if it were a SEQUENCE or SET. -Also as of v1.18 the flexi decoder is capable to handle +Also as of v1.18.0 the flexi decoder is capable to handle \textit{context-specific} encodings. The \textit{type} field will be set to \textbf{LTC\_ASN1\_CONTEXT\_SPECIFIC} and the plain identifier that was indicated in the ASN.1 encoding is stored in the \textit{used} field. Encapsulated data From 583b2b39386053550d56c76382d849d3bbb7b2b2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 13:44:33 +0200 Subject: [PATCH 1109/1192] document PKCS#1 v1.5 signatures w/o ASN.1 --- doc/crypt.tex | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 7e6458546..b3d3d4f69 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -3653,8 +3653,14 @@ \subsection{Extended Signatures} must be set to \textbf{LTC\_PKCS\_1\_V1\_5} to produce a v1.5 signature, otherwise, it must be set to \textbf{LTC\_PKCS\_1\_PSS} to produce a v2.1 signature. -When performing a v1.5 signature the \textit{prng}, \textit{prng\_idx}, and \textit{hash\_idx} parameters are not checked and can be left to any -values such as $\lbrace$\textbf{NULL}, 0, 0$\rbrace$. +\index{LTC\_PKCS\_1\_V1\_5\_NA1} +As of v1.18.0, the library also supports v1.5 signature generation without ASN.1 encoding the signature which can be indicated by passing +\textbf{LTC\_PKCS\_1\_V1\_5\_NA1} as \textit{padding} parameter. This option has been introduced to provide compatibilty to SSL3.0 implementations +which implemented this. + +When generating a standard v1.5 signature the \textit{prng}, and \textit{prng\_idx} parameters are not checked and can be left to any +values such as $\lbrace$\textbf{NULL}, 0$\rbrace$. When generating a v1.5 signature without ASN.1 additionally the parameter \textit{hash\_idx} is not +checked and can be set to $0$. \mysection{RSA Signature Verification} \index{rsa\_verify\_hash()} @@ -3716,7 +3722,13 @@ \subsection{Extended Verification} value, \textit{res} is set to $0$. Otherwise, if the function succeeds, and signature is valid \textit{res} is set to $1$. The \textit{padding} parameter must be set to \textbf{LTC\_PKCS\_1\_V1\_5} to perform a v1.5 verification. Otherwise, it must be set to -\textbf{LTC\_PKCS\_1\_PSS} to perform a v2.1 verification. When performing a v1.5 verification the \textit{hash\_idx} and \textit{saltlen} parameters are ignored. +\textbf{LTC\_PKCS\_1\_PSS} to perform a v2.1 verification. + +As of v1.18.0, the library also supports v1.5 signature verification without ASN.1 decoding the signature which can be indicated by passing +\textbf{LTC\_PKCS\_1\_V1\_5\_NA1} as \textit{padding} parameter. + +When performing a standard v1.5 verification the \textit{saltlen} parameter is ignored. +When performing a v1.5 verification without ASN.1 decoding additionally the \textit{hash\_idx} parameter is ignored. \mysection{RSA Encryption Example} From 39650b4a086e3647c8c0fff709f82486879e75f4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 17 Jul 2017 13:33:37 +0200 Subject: [PATCH 1110/1192] add doc of new RSA API functions --- doc/crypt.tex | 79 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index b3d3d4f69..76b1737a8 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -3834,7 +3834,15 @@ \subsection{RSA Key Export} in the SubjectPublicKeyInfo (X.509 type) format. \subsection{RSA Key Import} -To import a RSA key use the following function. +To import a RSA key use one of the following function. + +\subsubsection{Import from standard formats} + +This will import the key stored in \textit{in} of length inlen and import it to \textit{key}. + +These formats are normally distributed in the PEM format, consisting of a label defining the content and base64 encoded DER-serialized data. + +All the import functions expect binary DER data. \index{rsa\_import()} \begin{verbatim} @@ -3843,12 +3851,75 @@ \subsection{RSA Key Import} rsa_key *key); \end{verbatim} -This will import the key stored in \textit{inlen} and import it to \textit{key}. If the function fails it will automatically free any allocated memory. This -function can import both RSAPublicKey and RSAPrivateKey formats. +This function can import both RSAPublicKey and RSAPrivateKey formats. As of v1.06 this function can also import OpenSSL DER formatted public RSA keys. They are essentially encapsulated RSAPublicKeys. LibTomCrypt will -import the key, strip off the additional data and fill in the rsa\_key structure. +import the key, strip off the additional data and fill in the \textit{rsa\_key} structure. + +\index{rsa\_import\_pkcs8()} +\begin{verbatim} +int rsa_import_pkcs8(const unsigned char *in, + unsigned long inlen, + const void *passwd, + unsigned long passwdlen, + rsa_key *key); +\end{verbatim} + +This function can import RSA private keys serialized in PKCS#8 format. + +It provides a \textit{password} parameter for the encrypted PKCS#8 format, but this functionality is currently NOT implemented. + +\index{rsa\_import\_x509()} +\begin{verbatim} +int rsa_import_x509(const unsigned char *in, + unsigned long inlen, + rsa_key *key); +\end{verbatim} + +This function can import the RSA public key from a X.509 certificate. + +\subsubsection{Import from plain big numbers} + +\index{rsa\_set\_key()} +\begin{verbatim} +int rsa_set_key(const unsigned char *N, + unsigned long Nlen, + const unsigned char *e, + unsigned long elen, + const unsigned char *d, + unsigned long dlen, + rsa_key *key); +\end{verbatim} + +This function can import the plain RSA key parameters \texit{N}, \texit{e} and \texit{d}. +The parameter \texit{d} is optional and only required when importing a private key. + +\index{rsa\_set\_factors()} +\begin{verbatim} +int rsa_set_factors(const unsigned char *p, + unsigned long plen, + const unsigned char *q, + unsigned long qlen, + rsa_key *key); +\end{verbatim} + +This function can import the plain RSA key factors \texit{p} and \texit{q}. + +\index{rsa\_set\_crt\_params()} +\begin{verbatim} +int rsa_set_crt_params(const unsigned char *dP, + unsigned long dPlen, + const unsigned char *dQ, + unsigned long dQlen, + const unsigned char *qP, + unsigned long qPlen, + rsa_key *key); +\end{verbatim} + +This function can import the plain RSA CRT (chinese remainder theorem) parameters \texit{dP}, \texit{dQ} and \texit{qP}. +After importing \texit{p}, \texit{q}, \texit{dP}, \texit{dQ} and \texit{qP} +the library can perfrom the optimized CRT calculations on private key operations. \chapter{Diffie-Hellman Key Exchange} From 7edc41162da4eb8028ce3c0ce512c9614e3ecfb0 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 17 Jul 2017 22:11:43 +0200 Subject: [PATCH 1111/1192] fix crypt.pdf building --- doc/crypt.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 76b1737a8..8fec8ff75 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -3865,9 +3865,9 @@ \subsubsection{Import from standard formats} rsa_key *key); \end{verbatim} -This function can import RSA private keys serialized in PKCS#8 format. +This function can import RSA private keys serialized in PKCS\#8 format. -It provides a \textit{password} parameter for the encrypted PKCS#8 format, but this functionality is currently NOT implemented. +It provides a \textit{password} parameter for the encrypted PKCS\#8 format, but this functionality is currently NOT implemented. \index{rsa\_import\_x509()} \begin{verbatim} @@ -3891,8 +3891,8 @@ \subsubsection{Import from plain big numbers} rsa_key *key); \end{verbatim} -This function can import the plain RSA key parameters \texit{N}, \texit{e} and \texit{d}. -The parameter \texit{d} is optional and only required when importing a private key. +This function can import the plain RSA key parameters \textit{N}, \textit{e} and \textit{d}. +The parameter \textit{d} is optional and only required when importing a private key. \index{rsa\_set\_factors()} \begin{verbatim} @@ -3903,7 +3903,7 @@ \subsubsection{Import from plain big numbers} rsa_key *key); \end{verbatim} -This function can import the plain RSA key factors \texit{p} and \texit{q}. +This function can import the plain RSA key factors \textit{p} and \textit{q}. \index{rsa\_set\_crt\_params()} \begin{verbatim} @@ -3916,9 +3916,9 @@ \subsubsection{Import from plain big numbers} rsa_key *key); \end{verbatim} -This function can import the plain RSA CRT (chinese remainder theorem) parameters \texit{dP}, \texit{dQ} and \texit{qP}. +This function can import the plain RSA CRT (chinese remainder theorem) parameters \textit{dP}, \textit{dQ} and \textit{qP}. -After importing \texit{p}, \texit{q}, \texit{dP}, \texit{dQ} and \texit{qP} +After importing \textit{p}, \textit{q}, \textit{dP}, \textit{dQ} and \textit{qP} the library can perfrom the optimized CRT calculations on private key operations. \chapter{Diffie-Hellman Key Exchange} From 9584975a6d1a07354eb1acf63536e5ccebff2b9e Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 18 Jul 2017 00:07:47 +0200 Subject: [PATCH 1112/1192] some crypt.tex hacking --- doc/crypt.tex | 215 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 187 insertions(+), 28 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 8fec8ff75..2d0834408 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -1231,10 +1231,65 @@ \subsection{F8 Mode} int f8_done(symmetric_F8 *f8); \end{verbatim} -\vfil -\mysection{Encrypt and Authenticate Modes} +\chapter{Stream Ciphers} + +\mysection{RC4} + +XXX-TODO + +\begin{small} +\begin{verbatim} +int rc4_stream_setup(rc4_state *st, const unsigned char *key, unsigned long keylen); +int rc4_stream_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int rc4_stream_done(rc4_state *st); +int rc4_stream_keystream(rc4_state *st, unsigned char *out, unsigned long outlen); +\end{verbatim} +\end{small} + +\url{https://en.wikipedia.org/wiki/RC4} + +\mysection{Sober128} + +XXX-TODO + +\begin{small} +\begin{verbatim} +int sober128_stream_setup(sober128_state *st, const unsigned char *key, unsigned long keylen); +int sober128_stream_setiv(sober128_state *st, const unsigned char *iv, unsigned long ivlen); +int sober128_stream_crypt(sober128_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int sober128_stream_done(sober128_state *st); +int sober128_stream_keystream(sober128_state *st, unsigned char *out, unsigned long outlen); +\end{verbatim} +\end{small} + +\url{https://en.wikipedia.org/wiki/SOBER-128} + +\mysection{ChaCha} -\subsection{EAX Mode} +XXX-TODO + +\begin{small} +\begin{verbatim} +int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keylen, int rounds); +int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong32 counter); +int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 counter); +int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int chacha_done(chacha_state *st); +int chacha_keystream(chacha_state *st, unsigned char *out, unsigned long outlen); +\end{verbatim} +\end{small} + +\url{https://en.wikipedia.org/wiki/ChaCha_(cipher)} + +\chapter{Authenticated Encryption} + +Authenticated Encryption - sometimes also called Authenticated Encryption with Associated Data (AEAD) - is a variant of encryption +that provides not only confidentiality (as other symmetric or stream ciphers) but also integrity. + +The inputs of Authenticated Encryption are: \textit{key}, \textit{nonce} (sometimes called initialization vector), \textit{plaintext}, +optional \textit{header} (sometimes called additional authenticated data - AAD). The outputs are: \textit{ciphertext} and \textit{tag}. + +\mysection{EAX Mode} LibTomCrypt provides support for a mode called EAX\footnote{See M. Bellare, P. Rogaway, D. Wagner, A Conventional Authenticated-Encryption Mode.} in a manner similar to the way it was intended to be used by the designers. First, a short description of what EAX mode is before we explain how to use it. EAX is a mode that requires a cipher, @@ -1406,7 +1461,7 @@ \subsection{EAX Mode} The only difference is eax\_decrypt\_verify\_memory() does not emit a tag. Instead you pass it a tag as input and it compares it against the tag it computed while decrypting the message. If the tags match then it stores a $1$ in \textit{res}, otherwise it stores a $0$. -\subsection{OCB Mode} +\mysection{OCB Mode} LibTomCrypt provides support for a mode called OCB\footnote{See P. Rogaway, M. Bellare, J. Black, T. Krovetz, \textit{OCB: A Block Cipher Mode of Operation for Efficient Authenticated Encryption}.} . OCB is an encryption protocol that simultaneously provides authentication. It is slightly faster to use than EAX mode @@ -1444,7 +1499,7 @@ \subsection{OCB Mode} both functions given a single \textit{ocb} state. For bi-directional communication you will have to initialize two \textit{ocb} states (with different nonces). Also \textit{pt} and \textit{ct} may point to the same location in memory. -\subsubsection{State Termination} +\subsection{State Termination} When you are finished encrypting the message you call the following function to compute the tag. @@ -1482,7 +1537,7 @@ \subsubsection{State Termination} \textit{res} is set to zero. If all \textit{taglen} bytes of \textit{tag} can be verified then \textit{res} is set to one (authenticated message). -\subsubsection{Packet Functions} +\subsection{Packet Functions} To make life simpler the following two functions are provided for memory bound OCB. %\index{ocb\_encrypt\_authenticate\_memory()} @@ -1514,10 +1569,10 @@ \subsubsection{Packet Functions} Similarly, this will OCB decrypt, and compare the internally computed tag against the tag provided. \textit{res} is set appropriately. -\subsection{CCM Mode} +\mysection{CCM Mode} CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. -\subsubsection{Initialization} +\subsection{Initialization} To initialize the CCM context with a secret key call the following function. \index{ccm\_init()} @@ -1537,7 +1592,7 @@ \subsubsection{Initialization} With CCM, a header is meta--data you want to send with the message but not have encrypted. The header len is given in the init as \textit{aadlen}. -\subsubsection{Nonce Vector} +\subsection{Nonce Vector} After the state has been initialized (or reset) the next step is to add the session (or packet) initial vector. It should be unique per packet encrypted. \index{ccm\_add\_nonce()} @@ -1550,7 +1605,7 @@ \subsubsection{Nonce Vector} This adds the nonce (a.k.a. salt) \textit{nonce} of length \textit{noncelen} octets to the CCM state \textit{ccm}. Note that this function must be called once and only once. -\subsubsection{Additional Authentication Data} +\subsection{Additional Authentication Data} The header is meta--data you want to send with the message but not have encrypted, it must be stored in \textit{adata} of length \textit{adatalen} octets. \index{ccm\_add\_aad()} @@ -1561,7 +1616,7 @@ \subsubsection{Additional Authentication Data} \end{verbatim} This adds the additional authentication data \textit{adata} of length \textit{adatalen} to the CCM state \textit{ccm}. -\subsubsection{Plaintext Processing} +\subsection{Plaintext Processing} After the AAD has been processed, the plaintext (or ciphertext depending on the direction) can be processed. \index{ccm\_process()} @@ -1576,7 +1631,7 @@ \subsubsection{Plaintext Processing} the mode \textit{pt} is the input and \textit{ct} is the output (or vice versa). When \textit{direction} equals \textbf{CCM\_ENCRYPT} the plaintext is read, encrypted and stored in the ciphertext buffer. When \textit{direction} equals \textbf{CCM\_DECRYPT} the opposite occurs. -\subsubsection{State Termination} +\subsection{State Termination} To terminate a CCM state and retrieve the message authentication tag call the following function. \index{ccm\_done()} @@ -1587,7 +1642,7 @@ \subsubsection{State Termination} \end{verbatim} This terminates the CCM state \textit{ccm} and stores the tag in \textit{tag} of length \textit{taglen} octets. -\subsubsection{State Reset} +\subsection{State Reset} The call to ccm\_init() will perform considerable pre--computation and if you're going to be dealing with a lot of packets it is very costly to have to call it repeatedly. To aid in this endeavour, the reset function is provided. @@ -1598,7 +1653,7 @@ \subsubsection{State Reset} This will reset the CCM state \textit{ccm} to the state that ccm\_init() left it. The user would then call ccm\_add\_nonce(), ccm\_add\_aad(), etc. -\subsubsection{One--Shot Packet} +\subsection{One--Shot Packet} To process a single packet under any given key the following helper function can be used. \index{ccm\_memory()} @@ -1620,7 +1675,7 @@ \subsubsection{One--Shot Packet} If you are processing many packets under the same key you shouldn't use this function as it invokes the pre--computation with each call. -\subsubsection{Example Usage} +\subsection{Example Usage} The following is an example usage of how to use CCM over multiple packets with a shared secret key. \begin{small} @@ -1720,7 +1775,7 @@ \subsubsection{Example Usage} \end{verbatim} \end{small} -\subsection{GCM Mode} +\mysection{GCM Mode} Galois counter mode is an IEEE proposal for authenticated encryption (also it is a planned NIST standard). Like EAX and OCB mode, it can be used in a streaming capacity however, unlike EAX it cannot accept \textit{additional authentication data} (meta--data) after plaintext has been processed. This mode also only works with block ciphers with a 16--byte block. @@ -1728,7 +1783,7 @@ \subsection{GCM Mode} A GCM stream is meant to be processed in three modes, one after another. First, the initial vector (per session) data is processed. This should be unique to every session. Next, the the optional additional authentication data is processed, and finally the plaintext (or ciphertext depending on the direction). -\subsubsection{Initialization} +\subsection{Initialization} To initialize the GCM context with a secret key call the following function. \index{gcm\_init()} @@ -1741,7 +1796,7 @@ \subsubsection{Initialization} This initializes the GCM state \textit{gcm} for the given cipher indexed by \textit{cipher}, with a secret key \textit{key} of length \textit{keylen} octets. The cipher chosen must have a 16--byte block size (e.g., AES). -\subsubsection{Initial Vector} +\subsection{Initial Vector} After the state has been initialized (or reset) the next step is to add the session (or packet) initial vector. It should be unique per packet encrypted. \index{gcm\_add\_iv()} @@ -1756,7 +1811,7 @@ \subsubsection{Initial Vector} Note: the GCM protocols provides a \textit{shortcut} for 12--byte IVs where no pre-processing is to be done. If you want to minimize per packet latency it is ideal to only use 12--byte IVs. You can just increment it like a counter for each packet. -\subsubsection{Additional Authentication Data} +\subsection{Additional Authentication Data} After the entire IV has been processed, the additional authentication data can be processed. Unlike the IV, a packet/session does not require additional authentication data (AAD) for security. The AAD is meant to be used as side--channel data you want to be authenticated with the packet. Note: once you begin adding AAD to the GCM state you cannot return to adding IV data until the state has been reset. @@ -1769,7 +1824,7 @@ \subsubsection{Additional Authentication Data} \end{verbatim} This adds the additional authentication data \textit{adata} of length \textit{adatalen} to the GCM state \textit{gcm}. -\subsubsection{Plaintext Processing} +\subsection{Plaintext Processing} After the AAD has been processed, the plaintext (or ciphertext depending on the direction) can be processed. \index{gcm\_process()} @@ -1784,7 +1839,7 @@ \subsubsection{Plaintext Processing} the mode \textit{pt} is the input and \textit{ct} is the output (or vice versa). When \textit{direction} equals \textbf{GCM\_ENCRYPT} the plaintext is read, encrypted and stored in the ciphertext buffer. When \textit{direction} equals \textbf{GCM\_DECRYPT} the opposite occurs. -\subsubsection{State Termination} +\subsection{State Termination} To terminate a GCM state and retrieve the message authentication tag call the following function. \index{gcm\_done()} @@ -1795,7 +1850,7 @@ \subsubsection{State Termination} \end{verbatim} This terminates the GCM state \textit{gcm} and stores the tag in \textit{tag} of length \textit{taglen} octets. -\subsubsection{State Reset} +\subsection{State Reset} The call to gcm\_init() will perform considerable pre--computation (when \textbf{GCM\_TABLES} is defined) and if you're going to be dealing with a lot of packets it is very costly to have to call it repeatedly. To aid in this endeavour, the reset function has been provided. @@ -1806,7 +1861,7 @@ \subsubsection{State Reset} This will reset the GCM state \textit{gcm} to the state that gcm\_init() left it. The user would then call gcm\_add\_iv(), gcm\_add\_aad(), etc. -\subsubsection{One--Shot Packet} +\subsection{One--Shot Packet} To process a single packet under any given key the following helper function can be used. \index{gcm\_memory()} @@ -1828,7 +1883,7 @@ \subsubsection{One--Shot Packet} If you are processing many packets under the same key you shouldn't use this function as it invokes the pre--computation with each call. -\subsubsection{Example Usage} +\subsection{Example Usage} The following is an example usage of how to use GCM over multiple packets with a shared secret key. \begin{small} @@ -1928,6 +1983,33 @@ \subsubsection{Example Usage} \end{verbatim} \end{small} +\mysection{ChaCha20--Poly1305} + +This authenticated encryption is based on ChaCha20 stream cipher and Poly1305 authenticator. + +XXX-TODO + +\begin{small} +\begin{verbatim} +int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, unsigned long keylen); +int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen); +int chacha20poly1305_setiv_rfc7905(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 sequence_number); +int chacha20poly1305_add_aad(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen); +int chacha20poly1305_encrypt(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int chacha20poly1305_decrypt(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); +int chacha20poly1305_done(chacha20poly1305_state *st, unsigned char *tag, unsigned long *taglen); +int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen, + const unsigned char *iv, unsigned long ivlen, + const unsigned char *aad, unsigned long aadlen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, + unsigned char *tag, unsigned long *taglen, + int direction); +\end{verbatim} +\end{small} + +\url{https://tools.ietf.org/html/rfc7539} + \chapter{One-Way Cryptographic Hash Functions} \mysection{Core Functions} Like the ciphers, there are hash core functions and a universal data type to hold the hash state called \textit{hash\_state}. To initialize hash @@ -2861,6 +2943,24 @@ \subsection{F9--MAC Functions} This will return \textbf{CRYPT\_OK} on success. This requires the AES or Rijndael descriptor be previously registered, otherwise, it will return \textbf{CRYPT\_NOP}. +\mysection{Poly1305} + +XXX-TODO + +\begin{small} +\begin{verbatim} +int poly1305_init(poly1305_state *st, const unsigned char *key, unsigned long keylen); +int poly1305_process(poly1305_state *st, const unsigned char *in, unsigned long inlen); +int poly1305_done(poly1305_state *st, unsigned char *mac, unsigned long *maclen); +int poly1305_test(void); +int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); +int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); +int poly1305_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); +\end{verbatim} +\end{small} + +\url{https://en.wikipedia.org/wiki/Poly1305} + \chapter{Pseudo-Random Number Generators} \mysection{Core Functions} The library provides an array of core functions for Pseudo-Random Number Generators (PRNGs) as well. A cryptographic PRNG is @@ -4469,6 +4569,20 @@ \subsection{EC-DSA Signature Generation} will be stored in the array pointed to by \textit{out} of length \textit{outlen} octets. The function requires a properly seeded PRNG, and the ECC \textit{key} provided must be a private key. +\index{ecc\_sign\_hash\_rfc7518()} +\begin{verbatim} +int ecc_sign_hash_rfc7518(const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned long *outlen, + prng_state *prng, + int wprng, + ecc_key *key); +\end{verbatim} + +This function creates the same EC--DSA signature as \textit{ecc\_sign\_hash} only the output format is different. +The format follows \url{https://tools.ietf.org/html/rfc7518#section-3.4}, sometimes it is also called plain signature. + \subsection{EC-DSA Signature Verification} \index{ecc\_verify\_hash()} \begin{verbatim} @@ -4484,9 +4598,20 @@ \subsection{EC-DSA Signature Verification} pointed to by the array \textit{hash} of length \textit{hashlen}. It will store a non--zero value in \textit{stat} if the signature is valid. Note: the function will not return an error if the signature is invalid. It will return an error, if the actual signature payload is an invalid format. The ECC \textit{key} must be the public (or private) ECC key corresponding to the key that performed the signature. +The function \textit{ecc\_verify\_hash} implements signature format according to X9.62 EC--DSA, and the output is compliant for GF(p) curves. -\subsection{Signature Format} -The signature code is an implementation of X9.62 EC--DSA, and the output is compliant for GF(p) curves. +\index{ecc\_verify\_hash\_rfc7518()} +\begin{verbatim} +int ecc_verify_hash_rfc7518(const unsigned char *sig, + unsigned long siglen, + const unsigned char *hash, + unsigned long hashlen, + int *stat, + ecc_key *key); +\end{verbatim} + +This function validate the EC--DSA signature as \textit{ecc\_verify\_hash} only the signature input format +follows \url{https://tools.ietf.org/html/rfc7518#section-3.4}. \mysection{ECC Keysizes} With ECC if you try to sign a hash that is bigger than your ECC key you can run into problems. The math will still work, and in effect the signature will still @@ -5606,7 +5731,10 @@ \subsection{HKDF Extract-and-Expand} \chapter{Miscellaneous} \mysection{Base64 Encoding and Decoding} -The library provides functions to encode and decode a RFC 1521 base--64 coding scheme. The characters used in the mappings are: +The library provides functions to encode and decode a RFC 4648 Base64 coding scheme. + +\subsection{Standard 'base64' encoding} +The characters used in the mappings are: \begin{verbatim} ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ \end{verbatim} @@ -5620,7 +5748,7 @@ \chapter{Miscellaneous} break up the first four characters. To encode a binary string in base64 call: -\index{base64\_encode()} \index{base64\_decode()} +\index{base64\_encode()} \begin{verbatim} int base64_encode(const unsigned char *in, unsigned long len, @@ -5630,6 +5758,7 @@ \chapter{Miscellaneous} Where \textit{in} is the binary string and \textit{out} is where the ASCII output is placed. You must set the value of \textit{outlen} prior to calling this function and it sets the length of the base64 output in \textit{outlen} when it is done. To decode a base64 string call: +\index{base64\_decode()} \begin{verbatim} int base64_decode(const unsigned char *in, unsigned long len, @@ -5637,6 +5766,36 @@ \chapter{Miscellaneous} unsigned long *outlen); \end{verbatim} +The function \textit{base64\_decode} works in a relaxed way which allows decoding some inputs that do not strictly follow the standard. +If you want to be strict during decoding you can use: +\index{base64\_strict\_decode()} +\begin{verbatim} +int base64_strict_decode(const unsigned char *in, + unsigned long len, + unsigned char *out, + unsigned long *outlen); +\end{verbatim} + +\subsection{URL--safe 'base64url' encoding} +The characters used in the mappings are: +\begin{verbatim} +ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_ +\end{verbatim} +Those characters are sometimes also called URL and filename safe alphabet. + +XXX-TODO + +\begin{verbatim} +int base64url_encode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); +int base64url_strict_encode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int base64url_decode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); +int base64url_strict_decode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); +\end{verbatim} + \mysection{Primality Testing} \index{Primality Testing} The library includes primality testing and random prime functions as well. The primality tester will perform the test in From 468245ce5621e1a93a1d48404ef17f505f9e4df2 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 20 Jul 2017 23:09:28 +0200 Subject: [PATCH 1113/1192] doc: stream ciphers --- doc/crypt.tex | 119 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 90 insertions(+), 29 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 2d0834408..c4cd7fdd2 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -1233,53 +1233,114 @@ \subsection{F8 Mode} \chapter{Stream Ciphers} +Stream ciphers are symmetric key ciphers which operate on a stream of bytes (in theory on a stream of bits +however LibTomCrypt's implementation works with bytes). + +The API for all stream ciphers operates in mode: \textit{setup} -- \textit{crypt} -- \textit{crypt} -- ... -- \textit{done}. +Please note that both encryption and decryption is implemented via \textit{crypt}. + +Another useful feature of stream ciphers API is generation of random stream of bytes which works like: +\textit{setup} -- \textit{keystream} -- \textit{keystream} -- ... -- \textit{done}. The random stream generation is +implemented like encryption of a stream o zero bytes. + +\mysection{ChaCha} + +The \textit{ChaCha} is currently the most modern stream cipher included in LibTomCrypt, so use this one unless you +have a reason for using some of the older algorithms. + +For more information about ChaCha see \url{https://en.wikipedia.org/wiki/ChaCha_(cipher)}. + +Supported key size: 16 or 32 bytes (128 or 256 bits). + +You can initialize ChaCha with 96bit \textit{nonce} + 32bit \textit{counter}: +\begin{verbatim} +chacha_state st; +err = chacha_setup(&st, key, key_len, rounds); +err = chacha_ivctr32(&st, nonce, 12, initial_32bit_ctr); +\end{verbatim} + +Or with 64bit \textit{nonce} + 64bit \textit{counter}: +\begin{verbatim} +chacha_state st; +err = chacha_setup(&st, key, key_len, rounds); +err = chacha_ivctr64(&st, nonce, 8, initial_64bit_ctr); +\end{verbatim} + +The \textit{chacha\_setup} takes as a parameter the number of rounds -- choose 20 if you are not sure. +As always never ever used the same key + nonce pair more than once. + +For the actual encryption or decryption you to call: +\begin{verbatim} +err = chacha_crypt(&st, in_buffer, in_len, out_buffer); +\end{verbatim} + +If you just want a random stream of bytes initialize the cipher with truly random \textit{key} (32 bytes), +truly random \textit{nonce} (8 bytes) and zero initial counter. After that you can get a stream of pseudo--random +bytes via: +\begin{verbatim} +err = chacha_keystream(&st, out_buffer, out_len); +\end{verbatim} + +At the end you have to terminate the state: +\begin{verbatim} +err = chacha_done(&st); +\end{verbatim} + \mysection{RC4} -XXX-TODO +For more information about RC4 see \url{https://en.wikipedia.org/wiki/RC4}. -\begin{small} +Supported key size: 5--256 bytes + +You need to initialize RC with a \textit{key} (no \textit{nonce}, no \textit{IV}, no \textit{counter}). \begin{verbatim} -int rc4_stream_setup(rc4_state *st, const unsigned char *key, unsigned long keylen); -int rc4_stream_crypt(rc4_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int rc4_stream_done(rc4_state *st); -int rc4_stream_keystream(rc4_state *st, unsigned char *out, unsigned long outlen); +rc4_state st; +err = rc4_stream_setup(&st, key, key_len); \end{verbatim} -\end{small} -\url{https://en.wikipedia.org/wiki/RC4} +For the actual encryption or decryption you to call: +\begin{verbatim} +err = rc4_stream_crypt(&st, in_buffer, in_len, out_buffer); +\end{verbatim} -\mysection{Sober128} -XXX-TODO +If you just want a random stream of bytes initialize the cipher with truly random \textit{key}. +After that you can get a stream of pseudo--random bytes via: +\begin{verbatim} +err = rc4_stream_keystream(&st, out_buffer, out_len); +\end{verbatim} -\begin{small} +At the end you have to terminate the state: \begin{verbatim} -int sober128_stream_setup(sober128_state *st, const unsigned char *key, unsigned long keylen); -int sober128_stream_setiv(sober128_state *st, const unsigned char *iv, unsigned long ivlen); -int sober128_stream_crypt(sober128_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int sober128_stream_done(sober128_state *st); -int sober128_stream_keystream(sober128_state *st, unsigned char *out, unsigned long outlen); +err = rc4_stream_done(&st); \end{verbatim} -\end{small} -\url{https://en.wikipedia.org/wiki/SOBER-128} +\mysection{Sober128} -\mysection{ChaCha} +Supported key size: must be multiple of 4 bytes -XXX-TODO +You need to initialize Sober128 with a \textit{key} and a \textit{nonce} (must be multiple of 4 bytes). +\begin{verbatim} +sober128_state st; +err = sober128_stream_setup(&st, key, 16); +err = sober128_stream_setiv(&st, nonce, 12); +\end{verbatim} -\begin{small} +For the actual encryption or decryption you to call: \begin{verbatim} -int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keylen, int rounds); -int chacha_ivctr32(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong32 counter); -int chacha_ivctr64(chacha_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 counter); -int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int chacha_done(chacha_state *st); -int chacha_keystream(chacha_state *st, unsigned char *out, unsigned long outlen); +err = sober128_stream_crypt(&st, in_buffer, in_len, out_buffer); +\end{verbatim} + +If you just want a random stream of bytes initialize the cipher with a truly random \textit{key} +and a truly random \textit{nonce}. After that you can get a stream of pseudo--random bytes via: +\begin{verbatim} +err = sober128_stream_keystream(&st, out_buffer, out_len); \end{verbatim} -\end{small} -\url{https://en.wikipedia.org/wiki/ChaCha_(cipher)} +At the end you have to terminate the state: +\begin{verbatim} +err = sober128_stream_done(&st); +\end{verbatim} \chapter{Authenticated Encryption} From 5d74fee9dc9e96e59addd4d0c2500776a97afc19 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 20 Jul 2017 23:44:30 +0200 Subject: [PATCH 1114/1192] doc tuning --- doc/crypt.tex | 190 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 124 insertions(+), 66 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index c4cd7fdd2..fa324276e 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -129,13 +129,6 @@ \chapter{Introduction} block cipher and hash function to ensure that they compile and execute to the published design specifications. The library also performs extensive parameter error checking to prevent any number of run-time exploits or errors. -\subsection{What the library IS for?} - -The library serves as a toolkit for developers who have to solve cryptographic problems. Out of the box LibTomCrypt -does not process SSL or OpenPGP messages, it doesn't read X.509 certificates, or write PEM encoded data. It does, however, -provide all of the tools required to build such functionality. LibTomCrypt was designed to be a flexible library that -was not tied to any particular cryptographic problem. - \mysection{Why did I write it?} You may be wondering, \textit{Tom, why did you write a crypto library. I already have one.} Well the reason falls into two categories: @@ -1630,6 +1623,44 @@ \subsection{Packet Functions} Similarly, this will OCB decrypt, and compare the internally computed tag against the tag provided. \textit{res} is set appropriately. +\mysection{OCB3 Mode} + +OCB3 is a successor of OCB as defined in RFC7253 -- see \url{https://tools.ietf.org/html/rfc7253}. + +XXX-TODO + +\begin{small} +\begin{verbatim} +int ocb3_init(ocb3_state *ocb, int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen); + +int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct); +int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt); +int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct); +int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt); +int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen); +int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen); + +int ocb3_encrypt_authenticate_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *adata, unsigned long adatalen, + const unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen); + +int ocb3_decrypt_verify_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *adata, unsigned long adatalen, + const unsigned char *ct, unsigned long ctlen, + unsigned char *pt, + const unsigned char *tag, unsigned long taglen, + int *stat); +\end{verbatim} +\end{small} + \mysection{CCM Mode} CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. @@ -2411,6 +2442,28 @@ \subsection{Hash Registration} The other hashes such as the SHA-2 (that includes SHA-512, SHA-512/384, SHA-384, SHA-512/256, SHA-256 and SHA-224) and TIGER-192 are still considered secure for all purposes you would normally use a hash for. +\chapter{Checksum Functions} + +\mysection{CRC32 -- Cyclic redundancy check} + +XXX-TODO see \url{https://en.wikipedia.org/wiki/Cyclic_redundancy_check} + +\begin{verbatim} +void crc32_init(crc32_state *ctx); +void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long length); +void crc32_finish(crc32_state *ctx, void *hash, unsigned long size); +\end{verbatim} + +\mysection{Adler32} + +XXX-TODO see \url{https://en.wikipedia.org/wiki/Adler-32} + +\begin{verbatim} +void adler32_init(adler32_state *ctx); +void adler32_update(adler32_state *ctx, const unsigned char *input, unsigned long length); +void adler32_finish(adler32_state *ctx, void *hash, unsigned long size); +\end{verbatim} + \chapter{Message Authentication Codes} \mysection{HMAC Protocol} Thanks to Dobes Vandermeer, the library now includes support for hash based message authentication codes, or HMAC for short. An HMAC @@ -3004,9 +3057,9 @@ \subsection{F9--MAC Functions} This will return \textbf{CRYPT\_OK} on success. This requires the AES or Rijndael descriptor be previously registered, otherwise, it will return \textbf{CRYPT\_NOP}. -\mysection{Poly1305} +\mysection{Poly1305 MAC} -XXX-TODO +XXX-TODO see \url{https://en.wikipedia.org/wiki/Poly1305} \begin{small} \begin{verbatim} @@ -3020,7 +3073,29 @@ \subsection{F9--MAC Functions} \end{verbatim} \end{small} -\url{https://en.wikipedia.org/wiki/Poly1305} +\mysection{BLAKE2s + BLAKE2b MAC} + +XXX-TODO see \url{https://tools.ietf.org/html/rfc7693} + +\begin{small} +\begin{verbatim} +int blake2smac_init(blake2smac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen); +int blake2smac_process(blake2smac_state *st, const unsigned char *in, unsigned long inlen); +int blake2smac_done(blake2smac_state *st, unsigned char *mac, unsigned long *maclen); +int blake2smac_test(void); +int blake2smac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); +int blake2smac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); +int blake2smac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); + +int blake2bmac_init(blake2bmac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen); +int blake2bmac_process(blake2bmac_state *st, const unsigned char *in, unsigned long inlen); +int blake2bmac_done(blake2bmac_state *st, unsigned char *mac, unsigned long *maclen); +int blake2bmac_test(void); +int blake2bmac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); +int blake2bmac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); +int blake2bmac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); +\end{verbatim} +\end{small} \chapter{Pseudo-Random Number Generators} \mysection{Core Functions} @@ -3280,6 +3355,8 @@ \subsubsection{ChaCha20} ChaCha20 is a fast stream cipher built on a pseudorandom function designed by Daniel J. Bernstein. It can also double duty as a PRNG. +It is recommended to use 40 bytes of truly random bytes for initialization. + The implementation supports adding entropy via the add\_entropy() function while already being operational. \subsubsection{Example Usage} @@ -4114,18 +4191,18 @@ \section{Core Functions} This library also provides core Diffie-Hellman functions so you can negotiate keys over insecure mediums. The routines provided are relatively easy to use and only take two function calls to negotiate a shared key. There is a structure -called ``dh\_key'' which stores the Diffie-Hellman key in a format these routines can use. The first routine is to -make a Diffie-Hellman private key pair: +called ``dh\_key'' which stores the Diffie-Hellman key in a format these routines can use. The first set of routines +are to make a Diffie-Hellman private key pair: \index{dh\_make\_key()} \begin{verbatim} -int dh_make_key(prng_state *prng, int wprng, - int keysize, dh_key *key); +int dh_set_pg_groupsize(int groupsize, dh_key *key); +int dh_generate_key(prng_state *prng, int wprng, dh_key *key); \end{verbatim} -The ``keysize'' is the size of the modulus you want in bytes. Currently support sizes are 96 to 512 bytes which correspond -to key sizes of 768 to 4096 bits. The smaller the key the faster it is to use however it will be less secure. When +The ``groupsize'' is the size of the modulus you want in bytes. Currently support sizes are 96 to 1024 bytes which correspond +to key sizes of 768 to 8192 bits. The smaller the key the faster it is to use however it will be less secure. When specifying a size not explicitly supported by the library it will round {\em up} to the next key size. If the size is -above 512 it will return an error. So if you pass ``keysize == 32'' it will use a 768 bit key but if you pass -``keysize == 20000'' it will return an error. The primes and generators used are built-into the library and were designed +above 512 it will return an error. So if you pass ``groupsize == 32'' it will use a 768 bit key but if you pass +``groupsize == 20000'' it will return an error. The primes and generators used are built-into the library and were designed to meet very specific goals. The primes are strong primes which means that if $p$ is the prime then $p-1$ is equal to $2r$ where $r$ is a large prime. The bases are chosen to generate a group of order $r$ to prevent leaking a bit of the key. This means the bases generate a very large prime order group which is good to make cryptanalysis @@ -4161,9 +4238,9 @@ \section{Core Functions} into ``out'' and the length into ``outlen''. If all went correctly the data in ``out'' should be identical for both parties. It is important to note that the two keys have to be the same size in order for this to work. There is a function to get the size of a key: -\index{dh\_get\_size()} +\index{dh\_get\_groupsize()} \begin{verbatim} -int dh_get_size(dh_key *key); +int dh_get_groupsize(dh_key *key); \end{verbatim} This returns the size in bytes of the modulus chosen for that key. @@ -4182,7 +4259,10 @@ \subsection{Remarks on Usage} dh_key mykey, theirkey; /* make up our private key */ - if ((err = dh_make_key(prng, wprng, 128, &mykey)) != CRYPT_OK) { + if ((err = dh_set_pg_groupsize(128, &mykey)) != CRYPT_OK) { + return err; + } + if ((err = dh_generate_key(prng, wprng, &mykey)) != CRYPT_OK) { return err; } @@ -4255,56 +4335,17 @@ \subsection{Remarks on The Snippet} passed to ``establish\_secure\_socket()''. \section{Other Diffie-Hellman Functions} -In order to test the Diffie-Hellman function internal workings (e.g. the primes and bases) their is a test function made -available: -\index{dh\_test()} -\begin{verbatim} -int dh_test(void); -\end{verbatim} - -This function returns {\bf CRYPT\_OK} if the bases and primes in the library are correct. There is one last helper -function: -\index{dh\_sizes()} -\begin{verbatim} -void dh_sizes(int *low, int *high); -\end{verbatim} -Which stores the smallest and largest key sizes support into the two variables. - -\section{DH Packet} -Similar to the RSA related functions there are functions to encrypt or decrypt symmetric keys using the DH public key -algorithms. -\index{dh\_encrypt\_key()} \index{dh\_decrypt\_key()} -\begin{verbatim} -int dh_encrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *len, - prng_state *prng, int wprng, int hash, - dh_key *key); -int dh_decrypt_key(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - dh_key *key); -\end{verbatim} -Where ``in'' is an input symmetric key of no more than 32 bytes. Essentially these routines created a random public key -and find the hash of the shared secret. The message digest is than XOR'ed against the symmetric key. All of the -required data is placed in ``out'' by ``dh\_encrypt\_key()''. The hash must produce a message digest at least as large -as the symmetric key you are trying to share. +XXX-TODO -Similar to the RSA system you can sign and verify a hash of a message. -\index{dh\_sign\_hash()} \index{dh\_verify\_hash()} \begin{verbatim} -int dh_sign_hash(const unsigned char *in, unsigned long inlen, - unsigned char *out, unsigned long *outlen, - prng_state *prng, int wprng, dh_key *key); - -int dh_verify_hash(const unsigned char *sig, unsigned long siglen, - const unsigned char *hash, unsigned long hashlen, - int *stat, dh_key *key); +int dh_set_pg(const unsigned char *p, unsigned long plen, + const unsigned char *g, unsigned long glen, + dh_key *key); +int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); +int dh_set_key(const unsigned char *in, unsigned long inlen, int type, dh_key *key); \end{verbatim} -The ``dh\_sign\_hash'' function signs the message hash in ``in'' of length ``inlen'' and forms a DH packet in ``out''. -The ``dh\_verify\_hash'' function verifies the DH signature in ``sig'' against the hash in ``hash''. It sets ``stat'' -to non-zero if the signature passes or zero if it fails. - \chapter{Elliptic Curve Cryptography} \mysection{Background} @@ -4901,6 +4942,23 @@ \subsection{DSA Key Import} This will import the DSA key from the buffer \textit{in} of length \textit{inlen} to the \textit{key}. If the process fails the function will automatically free all of the heap allocated in the process (you don't have to call dsa\_free()). +\subsection{Other DSA Functions} + +XXX-TODO + +\begin{small} +\begin{verbatim} +int dsa_set_pqg(const unsigned char *p, unsigned long plen, + const unsigned char *q, unsigned long qlen, + const unsigned char *g, unsigned long glen, + dsa_key *key); +int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, dsa_key *key); +int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); +int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key *key); +int dsa_generate_key(prng_state *prng, int wprng, dsa_key *key); +\end{verbatim} +\end{small} + \chapter{Standards Support} \mysection{ASN.1 Formats} LibTomCrypt supports a variety of ASN.1 data types encoded with the Distinguished Encoding Rules (DER) suitable for various cryptographic protocols. The data types From 56d17c8e55c570858048be3d6bd6c54ac96a8e99 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 7 Aug 2017 12:06:58 +0200 Subject: [PATCH 1115/1192] some more doc updates --- doc/crypt.tex | 135 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 109 insertions(+), 26 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index fa324276e..465284e66 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -680,9 +680,25 @@ \subsection{Notes} \caption{Twofish Build Options} \label{fig:twofishopts} \end{figure} + +\item +As of v1.18.0 of the library RC2 got an extended setup function (which didn't fit in the regular API): + +\index{rc2\_setup\_ex()} +\begin{verbatim} +int rc2_setup_ex(const unsigned char *key, + int keylen, + int bits, + int num_rounds, + symmetric_key *skey); +\end{verbatim} + +This setup function also allows to configure the effective key length in bits of the RC2 cipher as in its original specification. + \end{enumerate} \end{small} + To work with the cipher\_descriptor array there is a function: \index{find\_cipher()} \begin{verbatim} @@ -1229,7 +1245,7 @@ \chapter{Stream Ciphers} Stream ciphers are symmetric key ciphers which operate on a stream of bytes (in theory on a stream of bits however LibTomCrypt's implementation works with bytes). -The API for all stream ciphers operates in mode: \textit{setup} -- \textit{crypt} -- \textit{crypt} -- ... -- \textit{done}. +The API for all stream ciphers operates in mode: \textit{setup} -- \textit{crypt} -- \textit{crypt} -- ... -- \textit{done}. Please note that both encryption and decryption is implemented via \textit{crypt}. Another useful feature of stream ciphers API is generation of random stream of bytes which works like: @@ -1238,7 +1254,7 @@ \chapter{Stream Ciphers} \mysection{ChaCha} -The \textit{ChaCha} is currently the most modern stream cipher included in LibTomCrypt, so use this one unless you +The \textit{ChaCha} is currently the most modern stream cipher included in LibTomCrypt, so use this one unless you have a reason for using some of the older algorithms. For more information about ChaCha see \url{https://en.wikipedia.org/wiki/ChaCha_(cipher)}. @@ -1259,7 +1275,7 @@ \chapter{Stream Ciphers} err = chacha_ivctr64(&st, nonce, 8, initial_64bit_ctr); \end{verbatim} -The \textit{chacha\_setup} takes as a parameter the number of rounds -- choose 20 if you are not sure. +The \textit{chacha\_setup} takes as a parameter the number of rounds -- choose 20 if you are not sure. As always never ever used the same key + nonce pair more than once. For the actual encryption or decryption you to call: @@ -1340,7 +1356,7 @@ \chapter{Authenticated Encryption} Authenticated Encryption - sometimes also called Authenticated Encryption with Associated Data (AEAD) - is a variant of encryption that provides not only confidentiality (as other symmetric or stream ciphers) but also integrity. -The inputs of Authenticated Encryption are: \textit{key}, \textit{nonce} (sometimes called initialization vector), \textit{plaintext}, +The inputs of Authenticated Encryption are: \textit{key}, \textit{nonce} (sometimes called initialization vector), \textit{plaintext}, optional \textit{header} (sometimes called additional authenticated data - AAD). The outputs are: \textit{ciphertext} and \textit{tag}. \mysection{EAX Mode} @@ -1515,11 +1531,22 @@ \chapter{Authenticated Encryption} The only difference is eax\_decrypt\_verify\_memory() does not emit a tag. Instead you pass it a tag as input and it compares it against the tag it computed while decrypting the message. If the tags match then it stores a $1$ in \textit{res}, otherwise it stores a $0$. -\mysection{OCB Mode} -LibTomCrypt provides support for a mode called OCB\footnote{See +\mysection{OCB Modes} +\subsection{Preface} + +LibTomCrypt provides support for a mode called OCB in version 1 ''OCB''\footnote{See P. Rogaway, M. Bellare, J. Black, T. Krovetz, \textit{OCB: A Block Cipher Mode of Operation for Efficient Authenticated Encryption}.} -. OCB is an encryption protocol that simultaneously provides authentication. It is slightly faster to use than EAX mode -but is less flexible. Let's review how to initialize an OCB context. +and version 3 ''OCB3''\footnote{See RFC7253, T. Krovetz, P. Rogaway, \textit{The OCB Authenticated-Encryption Algorithm}.}. +OCB is an encryption protocol that simultaneously provides authentication. It is slightly faster to use than EAX mode +but is less flexible. + +Please be aware that all versions of OCB are patented and there are several licensing models provided by P. Rogaway, the patent holder +-- see \url{http://web.cs.ucdavis.edu/~rogaway/ocb/license.htm}. + +\subsection{OCB} +\subsubsection{Initialization and processing} + +Let's review how to initialize an OCB context. \index{ocb\_init()} \begin{verbatim} @@ -1553,7 +1580,7 @@ \chapter{Authenticated Encryption} both functions given a single \textit{ocb} state. For bi-directional communication you will have to initialize two \textit{ocb} states (with different nonces). Also \textit{pt} and \textit{ct} may point to the same location in memory. -\subsection{State Termination} +\subsubsection{State Termination} When you are finished encrypting the message you call the following function to compute the tag. @@ -1591,7 +1618,7 @@ \subsection{State Termination} \textit{res} is set to zero. If all \textit{taglen} bytes of \textit{tag} can be verified then \textit{res} is set to one (authenticated message). -\subsection{Packet Functions} +\subsubsection{Packet Functions} To make life simpler the following two functions are provided for memory bound OCB. %\index{ocb\_encrypt\_authenticate\_memory()} @@ -1621,27 +1648,78 @@ \subsection{Packet Functions} \end{verbatim} Similarly, this will OCB decrypt, and compare the internally computed tag against the tag provided. \textit{res} is set -appropriately. +appropriately to \textit{1} if the tag matches or to \textit{0} if it doesn't match. -\mysection{OCB3 Mode} +\subsection{OCB3} +\subsubsection{Initialization and processing} -OCB3 is a successor of OCB as defined in RFC7253 -- see \url{https://tools.ietf.org/html/rfc7253}. - -XXX-TODO - -\begin{small} +\index{ocb3\_init()} \begin{verbatim} int ocb3_init(ocb3_state *ocb, int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *nonce, unsigned long noncelen); +\end{verbatim} + +This will initialize the \textit{ocb} context using cipher descriptor \textit{cipher}. It will use a \textit{key} of length \textit{keylen} +and the random \textit{nonce} of length \textit{noncelen}. Note that \textit{nonce} must be a random (public) string of an arbitrary length +between 1 and 15 octets. + +\subsubsection{Additional Authenticated Data} + +OCB3 has, in contrary to OCB, the possibility to add "Additional Authenticated Data" (AAD) when performing cryptographic operations. + +\index{ocb3\_add\_aad()} +\begin{verbatim} +int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen); +\end{verbatim} + +This will add the AAD at \textit{aad} of the arbitrary length \textit{aadlen} to be authenticated within the context \textit{ocb}. -int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct); -int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt); +\index{ocb3\_encrypt()} \index{ocb3\_decrypt()} +\begin{verbatim} +int ocb3_encrypt( ocb3_state *ocb, + const unsigned char *pt, + unsigned long ptlen, + unsigned char *ct); + +int ocb3_decrypt( ocb3_state *ocb, + const unsigned char *ct, + unsigned long ctlen, + unsigned char *pt); +\end{verbatim} + +This will encrypt (or decrypt for the latter) a fixed length of data from \textit{pt} to \textit{ct} (vice versa for the latter). +They assume that \textit{pt} and \textit{ct} are the same size as the block cipher's block size. Note that you cannot call +both functions given a single \textit{ocb} state. For bi-directional communication you will have to initialize two \textit{ocb} +states (with different nonces). Also \textit{pt} and \textit{ct} may point to the same location in memory. + +\subsubsection{State Termination} + +\index{ocb3\_encrypt\_last()} \index{ocb3\_decrypt\_last()} +\begin{verbatim} int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct); + int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt); -int ocb3_add_aad(ocb3_state *ocb, const unsigned char *aad, unsigned long aadlen); +\end{verbatim} + +XXX-TODO + +When you are finished encrypting the message you call the following function to compute the tag. + +\index{ocb3\_done()} +\begin{verbatim} int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen); +\end{verbatim} +This stores the tag of the \textit{ocb} state in \textit{tag}. +The \textit{taglen} parameter defines on input the length of the tag to output and will be set to the actual length written, which +is at most the block length of the cipher in use. + +\subsubsection{Packet Functions} +To make life simpler the following two functions are provided for memory bound OCB3. + +\index{ocb3\_encrypt\_authenticate\_memory()} +\begin{verbatim} int ocb3_encrypt_authenticate_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *nonce, unsigned long noncelen, @@ -1649,7 +1727,10 @@ \subsection{Packet Functions} const unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *tag, unsigned long *taglen); +\end{verbatim} +\index{ocb3\_decrypt\_verify\_memory()} +\begin{verbatim} int ocb3_decrypt_verify_memory(int cipher, const unsigned char *key, unsigned long keylen, const unsigned char *nonce, unsigned long noncelen, @@ -1659,7 +1740,6 @@ \subsection{Packet Functions} const unsigned char *tag, unsigned long taglen, int *stat); \end{verbatim} -\end{small} \mysection{CCM Mode} CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. @@ -4673,12 +4753,12 @@ \subsection{EC-DSA Signature Generation} \index{ecc\_sign\_hash\_rfc7518()} \begin{verbatim} -int ecc_sign_hash_rfc7518(const unsigned char *in, +int ecc_sign_hash_rfc7518(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, - prng_state *prng, - int wprng, + prng_state *prng, + int wprng, ecc_key *key); \end{verbatim} @@ -4712,7 +4792,7 @@ \subsection{EC-DSA Signature Verification} ecc_key *key); \end{verbatim} -This function validate the EC--DSA signature as \textit{ecc\_verify\_hash} only the signature input format +This function validate the EC--DSA signature as \textit{ecc\_verify\_hash} only the signature input format follows \url{https://tools.ietf.org/html/rfc7518#section-3.4}. \mysection{ECC Keysizes} @@ -5850,7 +5930,7 @@ \subsection{HKDF Extract-and-Expand} \chapter{Miscellaneous} \mysection{Base64 Encoding and Decoding} -The library provides functions to encode and decode a RFC 4648 Base64 coding scheme. +The library provides functions to encode and decode a RFC 4648 Base64 coding scheme. \subsection{Standard 'base64' encoding} The characters used in the mappings are: @@ -6040,6 +6120,7 @@ \subsection{URL--safe 'base64url' encoding} \begin{verbatim} void init_LTM(void); void init_TFM(void); +void init_GMP(void); \end{verbatim} Here is a Python program demonstrating how to call various LTC dynamic @@ -6228,6 +6309,8 @@ \chapter{Configuring and Building the Library} \mysection{Makefile variables} +XXX-TODO review + All GNU driven makefiles (including the makefile for ICC) use a set of common variables to control the build and install process. Most of the settings can be overwritten from the command line which makes custom installation a breeze. From 2ccb3fb53d7790f8e480d6cc6ed89e510777a092 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Aug 2017 20:14:42 +0200 Subject: [PATCH 1116/1192] update OCB3 doc [skip ci] --- doc/crypt.tex | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 465284e66..4b676d471 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -1657,12 +1657,16 @@ \subsubsection{Initialization and processing} \begin{verbatim} int ocb3_init(ocb3_state *ocb, int cipher, const unsigned char *key, unsigned long keylen, - const unsigned char *nonce, unsigned long noncelen); + const unsigned char *nonce, unsigned long noncelen, + unsigned long taglen); \end{verbatim} This will initialize the \textit{ocb} context using cipher descriptor \textit{cipher}. It will use a \textit{key} of length \textit{keylen} -and the random \textit{nonce} of length \textit{noncelen}. Note that \textit{nonce} must be a random (public) string of an arbitrary length -between 1 and 15 octets. +and the random \textit{nonce} of length \textit{noncelen}. The \textit{nonce} must be a random (public) string of an arbitrary length +between 1 and 15 octets. The desired length of the TAG that should be created when terminating the state has to be passed in \textit{taglen} +and has to be between 0 and 16 octets. + +Note that you can only use ciphers with a block length of 16. \subsubsection{Additional Authenticated Data} @@ -1697,12 +1701,19 @@ \subsubsection{State Termination} \index{ocb3\_encrypt\_last()} \index{ocb3\_decrypt\_last()} \begin{verbatim} -int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct); +int ocb3_encrypt_last( ocb3_state *ocb, + const unsigned char *pt, + unsigned long ptlen, + unsigned char *ct); -int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen, unsigned char *pt); +int ocb3_decrypt_last( ocb3_state *ocb, + const unsigned char *ct, + unsigned long ctlen, + unsigned char *pt); \end{verbatim} -XXX-TODO +This has to be called for the last encrypt (or decrypt) operation. Note that if you have to invoke only a single operation you can +directly use these functions instead of \textit{ocb3\_encrypt()} or \textit{ocb3\_decrypt()}. When you are finished encrypting the message you call the following function to compute the tag. @@ -1713,7 +1724,7 @@ \subsubsection{State Termination} This stores the tag of the \textit{ocb} state in \textit{tag}. The \textit{taglen} parameter defines on input the length of the tag to output and will be set to the actual length written, which -is at most the block length of the cipher in use. +is at most 16 octets. \subsubsection{Packet Functions} To make life simpler the following two functions are provided for memory bound OCB3. @@ -1729,6 +1740,11 @@ \subsubsection{Packet Functions} unsigned char *tag, unsigned long *taglen); \end{verbatim} +This will OCB3 encrypt the message \textit{pt} of length \textit{ptlen}, and store the ciphertext in \textit{ct}. The length \textit{ptlen} +can be any arbitrary length. The additional authenticated data \textit{adata} of length \textit{adatalen} is optional and can be left out +by passing \textit{NULL} as \textit{adata}. The length of the authentication TAG will be stored in \textit{tag}, which is also optional. +The length of the TAG passed in \textit{taglen} has to be between 0 and 16. + \index{ocb3\_decrypt\_verify\_memory()} \begin{verbatim} int ocb3_decrypt_verify_memory(int cipher, @@ -1741,6 +1757,9 @@ \subsubsection{Packet Functions} int *stat); \end{verbatim} +Similarly, this will OCB3 decrypt, and compare the internally computed tag against the tag provided. \textit{res} is set +appropriately to \textit{1} if the tag matches or to \textit{0} if it doesn't match. + \mysection{CCM Mode} CCM is a NIST proposal for encrypt + authenticate that is centered around using AES (or any 16--byte cipher) as a primitive. From dd01232bcb2e623ca544f8ccb741e4430bd9315b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 8 Aug 2017 21:38:23 +0200 Subject: [PATCH 1117/1192] review stream ciphers [skip ci] --- doc/crypt.tex | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 4b676d471..3debfe2d7 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -1246,15 +1246,15 @@ \chapter{Stream Ciphers} however LibTomCrypt's implementation works with bytes). The API for all stream ciphers operates in mode: \textit{setup} -- \textit{crypt} -- \textit{crypt} -- ... -- \textit{done}. -Please note that both encryption and decryption is implemented via \textit{crypt}. +Please note that both encryption and decryption are implemented via \textit{crypt}. -Another useful feature of stream ciphers API is generation of random stream of bytes which works like: +Another useful feature of the stream ciphers API is generation of a random stream of bytes which works like: \textit{setup} -- \textit{keystream} -- \textit{keystream} -- ... -- \textit{done}. The random stream generation is -implemented like encryption of a stream o zero bytes. +implemented like encryption of a stream of \textit{0x00} bytes. \mysection{ChaCha} -The \textit{ChaCha} is currently the most modern stream cipher included in LibTomCrypt, so use this one unless you +\textit{ChaCha} is currently the most modern stream cipher included in LibTomCrypt, so use this one unless you have a reason for using some of the older algorithms. For more information about ChaCha see \url{https://en.wikipedia.org/wiki/ChaCha_(cipher)}. @@ -1275,20 +1275,21 @@ \chapter{Stream Ciphers} err = chacha_ivctr64(&st, nonce, 8, initial_64bit_ctr); \end{verbatim} -The \textit{chacha\_setup} takes as a parameter the number of rounds -- choose 20 if you are not sure. -As always never ever used the same key + nonce pair more than once. +The \textit{chacha\_setup} takes the number of rounds as a parameter -- choose 20 if you are not sure. +As always never ever use the same key + nonce pair more than once. -For the actual encryption or decryption you to call: +For the actual encryption or decryption you have to call: \begin{verbatim} err = chacha_crypt(&st, in_buffer, in_len, out_buffer); \end{verbatim} -If you just want a random stream of bytes initialize the cipher with truly random \textit{key} (32 bytes), -truly random \textit{nonce} (8 bytes) and zero initial counter. After that you can get a stream of pseudo--random +If you just want a random stream of bytes initialize the cipher with a truly random \textit{key} (32 bytes), +a truly random \textit{nonce} (8 bytes) and zero initial counter. After that you can get a stream of pseudo--random bytes via: \begin{verbatim} err = chacha_keystream(&st, out_buffer, out_len); \end{verbatim} +Note that it's probably a better idea to use the PRNG interface for this purpose as that one allows re-seeding. At the end you have to terminate the state: \begin{verbatim} @@ -1301,13 +1302,13 @@ \chapter{Stream Ciphers} Supported key size: 5--256 bytes -You need to initialize RC with a \textit{key} (no \textit{nonce}, no \textit{IV}, no \textit{counter}). +You need to initialize RC4 only with a \textit{key}. \begin{verbatim} rc4_state st; err = rc4_stream_setup(&st, key, key_len); \end{verbatim} -For the actual encryption or decryption you to call: +For the actual encryption or decryption you have to call: \begin{verbatim} err = rc4_stream_crypt(&st, in_buffer, in_len, out_buffer); \end{verbatim} @@ -1318,6 +1319,7 @@ \chapter{Stream Ciphers} \begin{verbatim} err = rc4_stream_keystream(&st, out_buffer, out_len); \end{verbatim} +Note that it's probably a better idea to use the PRNG interface for this purpose as that one allows re-seeding. At the end you have to terminate the state: \begin{verbatim} @@ -1345,6 +1347,7 @@ \chapter{Stream Ciphers} \begin{verbatim} err = sober128_stream_keystream(&st, out_buffer, out_len); \end{verbatim} +Note that it's probably a better idea to use the PRNG interface for this purpose as that one allows re-seeding. At the end you have to terminate the state: \begin{verbatim} From fc65352261d00f164db8c6f85bafcd5b27e0632e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 9 Aug 2017 15:56:13 +0200 Subject: [PATCH 1118/1192] moar doc [skip ci] --- doc/crypt.tex | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 3debfe2d7..59b47b3a2 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -2546,9 +2546,17 @@ \subsection{Hash Registration} \chapter{Checksum Functions} -\mysection{CRC32 -- Cyclic redundancy check} +\mysection{Preface} -XXX-TODO see \url{https://en.wikipedia.org/wiki/Cyclic_redundancy_check} +The API for all checksum functions operate in mode: \textit{init} -- \textit{update} -- \textit{update} -- ... -- \textit{finish}. + +The \textit{finish} functions allow to output a partial result if necessary. + +\mysection{CRC-32 -- Cyclic redundancy check} + +A Cyclic Redundancy Check is an error-detecting code, where LibTomCrypt implements CRC-32 with the polynomial \textit{0x04C11DB7}. + +For further information see \url{https://en.wikipedia.org/wiki/Cyclic_redundancy_check} \begin{verbatim} void crc32_init(crc32_state *ctx); @@ -2556,9 +2564,11 @@ \chapter{Checksum Functions} void crc32_finish(crc32_state *ctx, void *hash, unsigned long size); \end{verbatim} -\mysection{Adler32} +\mysection{Adler-32} + +Adler-32 is a checksum algorithm. -XXX-TODO see \url{https://en.wikipedia.org/wiki/Adler-32} +For further information see \url{https://en.wikipedia.org/wiki/Adler-32}. \begin{verbatim} void adler32_init(adler32_state *ctx); @@ -5763,8 +5773,17 @@ \subsubsection{Sample Decoding} can walk up and down the nodes without keeping pointers lying around. +\subsubsection{Shrink'ing a Flexi List} +While decoding the flexi decoder will recursively decode an ASN.1 \textit{constructed} type it will store the decoded list +as well as the plain data that was decoded. +To free up this additional data a shrink function is provided. +\index{der\_sequence\_shrink()} +\begin{verbatim} +void der_sequence_shrink(ltc_asn1_list *in); +\end{verbatim} +This will free all the plain constructed data, but keep the decoded list intact. \subsubsection{Free'ing a Flexi List} To free the list use the following function. @@ -6084,6 +6103,28 @@ \subsection{URL--safe 'base64url' encoding} This ensures that \textit{N} is set to a random MPI in the range $1 \le N < limit$. + +\mysection{Helper functions} + +\subsection{Zero'ing data} + +XXX-TODO + +\index{zeromem()} +\begin{verbatim} +void zeromem(volatile void *out, size_t outlen); +\end{verbatim} + +\subsection{Constant-time memory compare} + +XXX-TODO + +\index{mem\_neq()} +\begin{verbatim} +int mem_neq(const void *a, const void *b, size_t len); +\end{verbatim} + + \mysection{Dynamic Language Support} \index{Dynamic Language Support} Various LibTomCrypt functions require that their callers define a struct From 0742a99fb5bf880e73a4b75bfe066e08cd6fea5f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 9 Aug 2017 15:59:56 +0200 Subject: [PATCH 1119/1192] update README [skip ci] --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 14353eea8..4b254c084 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,8 @@ The following list does not claim to be complete resp. to be available across al | `sizes` | builds the `sizes` binary, printing all internal data sizes on invocation *\*4* | | `constants` | builds the `constants` binary, printing all internal constants on invocation *\*4* | | `openssl-enc` | builds the `openssl-enc` binary, which is more or less compatible to [`openssl enc`](https://linux.die.net/man/1/enc) *\*4* *\*5* | -| `test` | builds the `test` binary, which runs all algorithm self-tests + some extended tests *\*4* *\*6* | -| `timing` | builds the `timing` binary, which can be used to measure timings for algorithms and modes *\*4* *\*6* | +| `test` | builds the `test` binary, which runs all algorithm self-tests + some extended tests *\*4* | +| `timing` | builds the `timing` binary, which can be used to measure timings for algorithms and modes *\*4* | | `bins` | builds `hashsum` *\*4* | | `all_test` | builds `test`, `hashsum`, `ltcrypt`, `small`, `tv_gen`, `sizes` & `constants` *\*4* | | `docs` | builds the developer documentation `doc/crypt.pdf` | @@ -105,8 +105,6 @@ The following list does not claim to be complete resp. to be available across al *\*5* broken build in some configurations, therefore not built by default -*\*6* requires define of one of `USE_GMP`, `USE_LTM` or `USE_TFM` (+ the appropriate MPI provider) - *\*7* also builds the necessary artifact(s) before installing it *\*8* also have a look at the 'Installation' section of this file From 13b484f8a5cafed50cff5cf5e48506baff620a8e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 14 Aug 2017 11:48:05 +0200 Subject: [PATCH 1120/1192] moar doc [skip ci] --- doc/crypt.tex | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 59b47b3a2..882ed5fe1 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -2220,8 +2220,9 @@ \chapter{One-Way Cryptographic Hash Functions} unsigned long inlen); \end{verbatim} Essentially all hash messages are virtually infinitely\footnote{Most hashes are limited to $2^{64}$ bits or 2,305,843,009,213,693,952 bytes.} long message which -are buffered. The data can be passed in any sized chunks as long as the order of the bytes are the same the message digest (hash output) will be the same. For example, -this means that: +are buffered. In the case where this limit is reached the \textit{XXX\_process()} function returns \textit{CRYPT\_HASH\_OVERFLOW}. +\index{CRYPT\_HASH\_OVERFLOW} +The data can be passed in any sized chunks as long as the order of the bytes are the same, the message digest (hash output) will be the same. For example, this means that: \begin{verbatim} md5_process(&md, "hello ", 6); md5_process(&md, "world", 5); @@ -2535,6 +2536,38 @@ \subsection{Hash Registration} } \end{verbatim} +\mysection{SHA3 SHAKE} +The SHA3 class of algorithms provides a special XOF (Extendable Output Functions) mode, called SHAKE. +SHAKE operates in 2 security configurations, 128bit or 256bit, and allows to generate message digests of an arbitrary length. + +For further information see \url{https://en.wikipedia.org/wiki/SHA-3} + +Example of using SHAKE256 with an arbitrary length output. + +\begin{verbatim} +#include +int main(void) +{ + int err; + hash_state state; + const void* msg = "The quick brown fox jumps over the lazy dog"; + unsigned char output[345]; + + if ((err = sha3_shake_init(&state, 256)) != CRYPT_OK) { + printf("Could not init SHAKE256 (%s)\n", error_to_string(err)); + return EXIT_FAILURE; + } + if ((err = sha3_shake_process(&state, msg, strlen(msg))) != CRYPT_OK) { + printf("Could not process SHAKE256 (%s)\n", error_to_string(err)); + return EXIT_FAILURE; + } + if ((err = sha3_shake_done(&state, output, sizeof(output))) != CRYPT_OK) { + printf("Could not finish SHAKE256 (%s)\n", error_to_string(err)); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} +\end{verbatim} \mysection{Notice} It is highly recommended that you \textbf{not} use the MD2, MD4, MD5, or SHA-1 hashes for the purposes of digital signatures or authentication codes. @@ -6108,22 +6141,28 @@ \subsection{URL--safe 'base64url' encoding} \subsection{Zero'ing data} -XXX-TODO +As widely know optimizing-compilers are sometimes allowed to remove an invocation of \textit{memset(out, 0, outlen)}, which could result +in sensitive data beeing not zero'ed out. Therefore LibTomCrypt implements a variant of this routine which won't be optimized-away. \index{zeromem()} \begin{verbatim} void zeromem(volatile void *out, size_t outlen); \end{verbatim} +This zero's the buffer \textit{out} of size \textit{outlen}. + \subsection{Constant-time memory compare} -XXX-TODO +Some symmetric-key cryptographic operation-modes are vulnerable to timing attacks in case non-contant-time memory comparison functions +are used to compare results. Therefore LibTomCrypt implements a constant-time memory compare function. \index{mem\_neq()} \begin{verbatim} int mem_neq(const void *a, const void *b, size_t len); \end{verbatim} +This will compare the buffer \textit{a} against the buffer \textit{b} for \textit{len} bytes. +The return value is either \textit{0} when the content of \textit{a} and \textit{b} is equal or \textit{1} when it differs. \mysection{Dynamic Language Support} \index{Dynamic Language Support} From 78e9601eb6e0e2c1302bf561c191da77d6c4f3a1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 14 Aug 2017 12:58:03 +0200 Subject: [PATCH 1121/1192] review "Configuring and Building the Library" [skip ci] --- doc/crypt.tex | 91 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 31 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 882ed5fe1..37db095a2 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -6411,59 +6411,73 @@ \chapter{Configuring and Building the Library} \mysection{Makefile variables} -XXX-TODO review - All GNU driven makefiles (including the makefile for ICC) use a set of common variables to control the build and install process. Most of the settings can be overwritten from the command line which makes custom installation a breeze. -\index{MAKE}\index{CC}\index{AR} -\subsection{MAKE, CC and AR} +\subsection{MAKE, CC, AR and CROSS\_COMPILE} +\index{MAKE} \index{CC} \index{AR} \index{CROSS\_COMPILE} The MAKE, CC and AR flags can all be overwritten. They default to \textit{make}, \textit{\$CC} and \textit{\$AR} respectively. Changing MAKE allows you to change what program will be invoked to handle sub--directories. For example, this \begin{verbatim} -MAKE=gmake gmake install +gmake install MAKE=gmake \end{verbatim} \begin{flushleft} will build and install the libraries with the \textit{gmake} tool. Similarly, \end{flushleft} \begin{verbatim} -CC=arm-gcc AR=arm-ar make +make CC=arm-gcc AR=arm-ar \end{verbatim} \begin{flushleft} will build the library using \textit{arm--gcc} as the compiler and \textit{arm--ar} as the archiver. \end{flushleft} -\subsection{IGNORE\_SPEED} -\index{IGNORE\_SPEED} +\begin{verbatim} +make CROSS_COMPILE=arm-none-eabi- +\end{verbatim} + +\begin{flushleft} will build the library using the \textit{arm--none--eabi--} prefix'ed toolchain. \end{flushleft} + +\subsection{IGNORE\_SPEED and LTC\_DEBUG} +\index{IGNORE\_SPEED} \index{LTC\_DEBUG} When \textbf{IGNORE\_SPEED} has been defined the default optimization flags for CFLAGS will be disabled which allows the developer to specify new CFLAGS on the command line. E.g. to add debugging \begin{verbatim} -CFLAGS="-g3" make IGNORE_SPEED=1 +make IGNORE_SPEED=1 CFLAGS="-g3" \end{verbatim} This will turn off optimizations and add \textit{-g3} to the CFLAGS which enables debugging. -\subsection{LIBNAME and LIBNAME\_S} -\index{LIBNAME} \index{LIBNAME\_S} -\textbf{LIBNAME} is the name of the output library (archive) to create. It defaults to \textit{libtomcrypt.a} for static builds and \textit{libtomcrypt.la} for -shared. The \textbf{LIBNAME\_S} variable is the static name while doing shared builds. Ideally they should have the same prefix but don't have to. +Alternatively one can define \textbf{LTC\_DEBUG} instead, which additionally defines \textit{LTC\_NO\_ASM} and enables debug output on test failures. + +Defining \textit{LTC\_DEBUG=2} has the effect to enable verbose output in some of the tests. + +\begin{verbatim} +make LTC_DEBUG=2 +\end{verbatim} + +\begin{flushleft} will build the library without compiler-optimisation or architecture specific code and will enable debugging +and verbose debug output. \end{flushleft} -\index{LIBTEST} \index{LIBTEST\_S} -Similarly \textbf{LIBTEST} and \textbf{LIBTEST\_S} are the names for the profiling and testing library. The default is \textit{libtomcrypt\_prof.a} for -static and \textit{libtomcrypt\_prof.la} for shared. +\subsection{LIBNAME} +\index{LIBNAME} +\textbf{LIBNAME} is the name of the output library (archive) to create. It defaults to \textit{libtomcrypt.a} for static builds and \textit{libtomcrypt.la} for +shared. +On installation of the shared library the appropriately versioned \textit{libtomcrypt.so}, \textit{libtomcrypt.so.0} etc. will be created by \textit{libtool}. \subsection{Installation Directories} -\index{DESTDIR} \index{LIBPATH} \index{INCPATH} \index{DATADIR} -\textbf{DESTDIR} is the prefix for the installation directories. It defaults to an empty string. \textbf{LIBPATH} is the prefix for the library -directory which defaults to \textit{/usr/lib}. \textbf{INCPATH} is the prefix for the header file directory which defaults to \textit{/usr/include}. -\textbf{DATADIR} is the prefix for the data (documentation) directory which defaults to \textit{/usr/share/doc/libtomcrypt/pdf}. +\index{DESTDIR} \index{PREFIX} \index{LIBPATH} \index{INCPATH} \index{DATAPATH} \index{BINPATH} +\textbf{DESTDIR} is the location where the output will be stored. It default to an empty string. +\textbf{PREFIX} is the prefix for the installation directories. It defaults to \textit{/usr/local}. +\textbf{LIBPATH} is the location of the library directory which defaults to \textit{\$PREFIX/lib}. +\textbf{INCPATH} is the location of the header file directory which defaults to \textit{\$PREFIX/include}. +\textbf{DATAPATH} is the location of the data (documentation) directory which defaults to \textit{\$PREFIX/share/doc/libtomcrypt/pdf}. +\textbf{BINPATH} is the location of the binary file directory which defaults to \textit{\$PREFIX/bin}. -All four can be used to create custom install locations depending on the nature of the OS and file system in use. +They allow to configure the installation locations of the libary. \begin{verbatim} -make LIBPATH=/home/tom/project/lib INCPATH=/home/tom/project/include \ - DATAPATH=/home/tom/project/docs install +make PREFIX=/home/tom/project DATAPATH=/home/tom/project/docs install \end{verbatim} This will build the library and install it to the directories under \textit{/home/tom/project/}. e.g. @@ -6503,14 +6517,16 @@ \subsection{Installation Directories} \end{verbatim} \end{small} +For further information see: \url{https://www.gnu.org/prep/standards/html_node/DESTDIR.html} +and \url{https://www.freebsd.org/doc/en/books/porters-handbook/porting-prefix.html}. + \mysection{Extra libraries} \index{EXTRALIBS} \textbf{EXTRALIBS} specifies any extra libraries required to link the test programs and shared libraries. They are specified in the notation that GCC expects for global archives. \begin{verbatim} -CFLAGS="-DTFM_DESC -DUSE_TFM" EXTRALIBS=-ltfm make install \ - test timing +make install test timing CFLAGS="-DTFM_DESC -DUSE_TFM" EXTRALIBS=-ltfm \end{verbatim} This will install the library using the TomsFastMath library and link the \textit{libtfm.a} library out of the default library search path. The two @@ -6524,7 +6540,7 @@ \subsection{Installation Directories} Building a static library is fairly trivial as it only requires one invocation of the GNU make command. \begin{verbatim} -CFLAGS="-DTFM_DESC" make install +make install CFLAGS="-DTFM_DESC" \end{verbatim} That will build LibTomCrypt (including the TomsFastMath descriptor), and install it in the default locations indicated previously. You can enable @@ -6554,7 +6570,7 @@ \subsection{Installation Directories} that you \textbf{must} specify the \textbf{EXTRALIBS} variable at install time. \begin{verbatim} -CFLAGS="-DTFM_DESC" EXTRALIBS=-ltfm make -f makefile.shared install +make -f makefile.shared install CFLAGS="-DTFM_DESC" EXTRALIBS=-ltfm \end{verbatim} This will build and install the library and link the shared object against the TomsFastMath library (which must be installed as a shared object as well). The @@ -6585,13 +6601,14 @@ \subsubsection{Endianness} There are also options you can specify from the \textit{tomcrypt\_custom.h} header file. \subsection{X memory routines} -\index{XMALLOC}\index{XCALLOC}\index{XREALLOC}\index{XFREE} +\index{XMALLOC}\index{XREALLOC}\index{XCALLOC}\index{XFREE}\index{XMEMSET}\index{XMEMCPY}\index{XMEMMOVE}\index{XMEMCMP}\index{XSTRCMP} At the top of tomcrypt\_custom.h are a series of macros denoted as XMALLOC, XCALLOC, XREALLOC, XFREE, and so on. They resolve to the name of the respective functions from the standard C library by default. This lets you substitute in your own memory routines. If you substitute in your own functions they must behave like the standard C library functions in terms of what they expect as input and output. -These macros are handy for working with platforms which do not have a standard C library. For instance, the OLPC\footnote{See http://dev.laptop.org/git?p=bios-crypto;a=summary} +These macros are handy for working with platforms which do not have a standard C library. +For instance, the OLPC\footnote{See \url{http://dev.laptop.org/git?p=bios-crypto;a=summary}} bios code uses these macros to redirect to very compact heap and string operations. \subsection{X clock routines} @@ -6695,6 +6712,18 @@ \subsection{LTC\_ECC\_TIMING\_RESISTANT} algorithm which prevents leaking key bits of the private key (scalar). It is a slower algorithm but useful for situations where timing side channels pose a significant threat. +This is enabled by default and can be disabled by defining \textbf{LTC\_NO\_ECC\_TIMING\_RESISTANT}. + +\subsection{LTC\_RSA\_BLINDING} +When this has been defined the RSA modular exponentiation will use a blinding algorithm to improve timing resistance. + +This is enabled by default and can be disabled by defining \textbf{LTC\_NO\_RSA\_BLINDING}. + +\subsection{LTC\_RSA\_CRT\_HARDENING} +When this has been defined the RSA modular exponentiation will do some sanity checks regarding the CRT parameters and the operations' results. + +This is enabled by default and can be disabled by defining \textbf{LTC\_NO\_RSA\_CRT\_HARDENING}. + \subsection{Math Descriptors} The library comes with three math descriptors that allow you to interface the public key cryptography API to freely available math libraries. When \textbf{GMP\_DESC}, \textbf{LTM\_DESC}, or \textbf{TFM\_DESC} are defined @@ -6706,8 +6735,8 @@ \subsection{Math Descriptors} \index{GMP\_DESC} \index{USE\_GMP} \index{LTM\_DESC} \index{TFM\_DESC} \index{USE\_LTM} \index{USE\_TFM} \begin{small} \begin{verbatim} -CFLAGS="-DGMP_DESC -DLTM_DESC -DTFM_DESC -DUSE_TFM" \ -EXTRALIBS="-lgmp -ltommath -ltfm" make -f makefile.shared install timing +make -f makefile.shared install timing CFLAGS="-DGMP_DESC -DLTM_DESC -DTFM_DESC -DUSE_TFM" \ +EXTRALIBS="-lgmp -ltommath -ltfm" \end{verbatim} \end{small} From 8b3af12d709b9b4af607c6b3935151c3e8810804 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 14 Aug 2017 13:27:55 +0200 Subject: [PATCH 1122/1192] add radix_to_bin() docs [skip ci] --- doc/crypt.tex | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/crypt.tex b/doc/crypt.tex index 37db095a2..2afaa061f 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -6164,6 +6164,46 @@ \subsection{Constant-time memory compare} This will compare the buffer \textit{a} against the buffer \textit{b} for \textit{len} bytes. The return value is either \textit{0} when the content of \textit{a} and \textit{b} is equal or \textit{1} when it differs. +\subsection{Radix to binary conversion} + +All public-key cryptographic algorithms provide a way to import and/or export their key parameters in binary format. +In order to be able to import keys stored in different formats, e.g. hexadecimal strings, the \textit{radix\_to\_bin()} function is provided. + +\index{radix\_to\_bin()} +\begin{verbatim} +int radix_to_bin(const void *in, int radix, void *out, unsigned long *len); +\end{verbatim} + +This will convert the MPI \textit{in} of radix \textit{radix} to the buffer pointed to by \textit{out}. +The field \textit{len} is a pointer to the length of the buffer on input and the length stored on output. + +In case you don't know the length of the buffer you can use \textit{radix\_to\_bin()} to determine the length for you. + +\begin{verbatim} +#include + +int main(void) +{ + const char *mpi = "AABBCCDD"; + unsigned long l = 0; + void* buf; + int ret; + ltc_mp = ltm_desc; + + if (radix_to_bin(mpi, 16, NULL, &l) != CRYPT_BUFFER_OVERFLOW) + return EXIT_FAILURE; + buf = malloc(l); + + ret = EXIT_SUCCESS; + if (radix_to_bin(mpi, 16, buf, &l) != CRYPT_OK) + ret = EXIT_FAILURE; + + free(buf); + return ret; +} +\end{verbatim} + + \mysection{Dynamic Language Support} \index{Dynamic Language Support} Various LibTomCrypt functions require that their callers define a struct From 35d920a688346757ac42257caab6768457b7f1ac Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Aug 2017 00:07:53 +0200 Subject: [PATCH 1123/1192] moar doc [skip ci] --- doc/crypt.tex | 82 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 23 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 2afaa061f..912c92aaa 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -1252,6 +1252,8 @@ \chapter{Stream Ciphers} \textit{setup} -- \textit{keystream} -- \textit{keystream} -- ... -- \textit{done}. The random stream generation is implemented like encryption of a stream of \textit{0x00} bytes. +Note: You shouldn't use the keystream interface as a PRNG, as it doesn't allow to re-seed the internal state. + \mysection{ChaCha} \textit{ChaCha} is currently the most modern stream cipher included in LibTomCrypt, so use this one unless you @@ -1289,7 +1291,6 @@ \chapter{Stream Ciphers} \begin{verbatim} err = chacha_keystream(&st, out_buffer, out_len); \end{verbatim} -Note that it's probably a better idea to use the PRNG interface for this purpose as that one allows re-seeding. At the end you have to terminate the state: \begin{verbatim} @@ -1319,7 +1320,6 @@ \chapter{Stream Ciphers} \begin{verbatim} err = rc4_stream_keystream(&st, out_buffer, out_len); \end{verbatim} -Note that it's probably a better idea to use the PRNG interface for this purpose as that one allows re-seeding. At the end you have to terminate the state: \begin{verbatim} @@ -1347,7 +1347,6 @@ \chapter{Stream Ciphers} \begin{verbatim} err = sober128_stream_keystream(&st, out_buffer, out_len); \end{verbatim} -Note that it's probably a better idea to use the PRNG interface for this purpose as that one allows re-seeding. At the end you have to terminate the state: \begin{verbatim} @@ -4306,7 +4305,7 @@ \subsubsection{Import from plain big numbers} \chapter{Diffie-Hellman Key Exchange} -\section{Background} +\mysection{Background} Diffie-Hellman was the original public key system proposed. The system is based upon the group structure of finite fields. For Diffie-Hellman a prime $p$ is chosen and a ``base'' $b$ such that $b^x\mbox{ }(\mbox{mod }p)$ @@ -4332,7 +4331,7 @@ \section{Background} the sub-group generated is a large prime namely ${p - 1} \over 2$. Such primes are known as ``strong primes'' and the smaller prime (e.g. the order of the base) are known as Sophie-Germaine primes. -\section{Core Functions} +\mysection{Core Functions} This library also provides core Diffie-Hellman functions so you can negotiate keys over insecure mediums. The routines provided are relatively easy to use and only take two function calls to negotiate a shared key. There is a structure @@ -4353,7 +4352,7 @@ \section{Core Functions} leaking a bit of the key. This means the bases generate a very large prime order group which is good to make cryptanalysis hard. -The next two routines are for exporting/importing Diffie-Hellman keys in a binary format. This is useful for transport +The next two routines are for exporting/importing Diffie-Hellman keys in/from DER encoded ASN.1. This is useful for transport over communication mediums. \index{dh\_export()} \index{dh\_import()} @@ -4364,9 +4363,27 @@ \section{Core Functions} int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key); \end{verbatim} +The ASN.1 sequence used to represent a DH key is as following: + +\begin{verbatim} +DiffieHellmanKey ::= SEQUENCE { + version Version, + flags Flags, + p INTEGER, -- prime + g INTEGER, -- base/group + n INTEGER -- either x when private key or y when public key } + +Version ::= INTEGER { v1(0) } + +Flags ::= BIT STRING { + privateKey (0) -- this BIT is '1' if it's a private key or '0' if it's a public key +} +\end{verbatim} + These two functions work just like the ``rsa\_export()'' and ``rsa\_import()'' functions except these work with -Diffie-Hellman keys. Its important to note you do not have to free the ram for a ``dh\_key'' if an import fails. You can free a -``dh\_key'' using: +Diffie-Hellman keys. Its important to note you do not have to free the ram for a ``dh\_key'' if an import fails. + +You can free a ``dh\_key'' using: \begin{verbatim} void dh_free(dh_key *key); \end{verbatim} @@ -4389,7 +4406,39 @@ \section{Core Functions} \end{verbatim} This returns the size in bytes of the modulus chosen for that key. -\subsection{Remarks on Usage} +\mysection{Other Diffie-Hellman Functions} + +To be able to import Diffie-Hellman keys LibTomCrypt provides several API functions. +\\ + +To import the prime and group from binary format: +\index{dh\_set\_pg()} +\begin{verbatim} +int dh_set_pg(const unsigned char *p, unsigned long plen, + const unsigned char *g, unsigned long glen, + dh_key *key); +\end{verbatim} +This sets the prime \textit{p} of length \textit{plen} and the generator/base \textit{g} of length \textit{glen} in the DH key \textit{key}. +\\ + +To import the prime and group from an ASN.1 encoded DHparam Sequence: +\index{dh\_set\_pg\_dhparam()} +\begin{verbatim} +int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); +\end{verbatim} +This sets the parameters in \textit{dhparam} of \textit{dhparamlen} in the DH key \textit{key}. +\\ + +To import a private or public key from binary data: +\index{dh\_set\_key()} +\begin{verbatim} +int dh_set_key(const unsigned char *in, unsigned long inlen, int type, dh_key *key); +\end{verbatim} +This will import, depending on \textit{type} which can be either \textit{PK\_PRIVATE} or \textit{PK\_PUBLIC}, +the according part of the DH key \textit{key} from \textit{in} of length \textit{inlen}. +After import the key will be verified and in case of an error it will be free'd. + +\mysection{Remarks on Usage} Its important that you hash the shared key before trying to use it as a key for a symmetric cipher or something. An example program that communicates over sockets, using MD5 and 1024-bit DH keys is\footnote{This function is a small example. It is suggested that proper packaging be used. For example, if the public key sent is truncated these routines will not detect that.}: \newpage @@ -4474,23 +4523,10 @@ \subsection{Remarks on Usage} } \end{verbatim} \end{small} -\newpage \subsection{Remarks on The Snippet} -When the above code snippet is done (assuming all went well) their will be a shared 128-bit key in the ``key'' array +When the above code snippet is done (assuming all went well) there will be a shared 128-bit key in the ``key'' array passed to ``establish\_secure\_socket()''. -\section{Other Diffie-Hellman Functions} - -XXX-TODO - -\begin{verbatim} -int dh_set_pg(const unsigned char *p, unsigned long plen, - const unsigned char *g, unsigned long glen, - dh_key *key); -int dh_set_pg_dhparam(const unsigned char *dhparam, unsigned long dhparamlen, dh_key *key); -int dh_set_key(const unsigned char *in, unsigned long inlen, int type, dh_key *key); -\end{verbatim} - \chapter{Elliptic Curve Cryptography} \mysection{Background} From 11827feef37cddf982ca34d04407a09a69fd199b Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 19 Sep 2017 22:23:21 +0200 Subject: [PATCH 1124/1192] ChaCha20-Poly1305 doc --- doc/crypt.tex | 117 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 99 insertions(+), 18 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 912c92aaa..41391bd98 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -2179,29 +2179,110 @@ \subsection{Example Usage} \mysection{ChaCha20--Poly1305} This authenticated encryption is based on ChaCha20 stream cipher and Poly1305 authenticator. +It is defined by \url{https://tools.ietf.org/html/rfc7539}. -XXX-TODO +\subsection{Initialization} +To initialize the ChaCha20--Poly1305 context with a secret key call the following function. -\begin{small} +\index{chacha20poly1305\_init()} \begin{verbatim} -int chacha20poly1305_init(chacha20poly1305_state *st, const unsigned char *key, unsigned long keylen); -int chacha20poly1305_setiv(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen); -int chacha20poly1305_setiv_rfc7905(chacha20poly1305_state *st, const unsigned char *iv, unsigned long ivlen, ulong64 sequence_number); -int chacha20poly1305_add_aad(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen); -int chacha20poly1305_encrypt(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int chacha20poly1305_decrypt(chacha20poly1305_state *st, const unsigned char *in, unsigned long inlen, unsigned char *out); -int chacha20poly1305_done(chacha20poly1305_state *st, unsigned char *tag, unsigned long *taglen); -int chacha20poly1305_memory(const unsigned char *key, unsigned long keylen, - const unsigned char *iv, unsigned long ivlen, - const unsigned char *aad, unsigned long aadlen, - const unsigned char *in, unsigned long inlen, - unsigned char *out, - unsigned char *tag, unsigned long *taglen, - int direction); +int chacha20poly1305_init(chacha20poly1305_state *st, + const unsigned char *key, + unsigned long keylen); \end{verbatim} -\end{small} +This initializes the ChaCha20--Poly1305 state \textit{st} with a secret key \textit{key} of length \textit{keylen} +octets (valid lengths: 32 or 16). -\url{https://tools.ietf.org/html/rfc7539} +\subsection{Initial Vector} +After the state has been initialized the next step is to add the initial vector. + +\index{chacha20poly1305\_setiv()} +\begin{verbatim} +int chacha20poly1305_setiv(chacha20poly1305_state *st, + const unsigned char *iv, + unsigned long ivlen); +\end{verbatim} +This adds the initial vector from \textit{iv} of length \textit{ivlen} octects (valid lengths: 8 or 12) to +the ChaCha20--Poly1305 state \textit{st}. + +\index{chacha20poly1305\_setiv\_rfc7905()} +\begin{verbatim} +int chacha20poly1305_setiv_rfc7905(chacha20poly1305_state *st, + const unsigned char *iv, + unsigned long ivlen, + ulong64 sequence_number); +\end{verbatim} +This also adds the initial vector from \textit{iv} of length \textit{ivlen} octects (valid lengths: 8 or 12) to +the state \textit{st} but it also incorporates 64bit \textit{sequence\_number} into IV as described in RFC7905. + +You can call only one of \textit{chacha20poly1305\_setiv} or \textit{chacha20poly1305\_setiv\_rfc7905}. + +\subsection{Additional Authentication Data} +After the IV has been set, the additional authentication data can be processed. + +\index{chacha20poly1305\_add\_aad()} +\begin{verbatim} +int chacha20poly1305_add_aad(chacha20poly1305_state *st, + const unsigned char *adata, + unsigned long adatalen); + +\end{verbatim} +This adds the additional authentication data \textit{adata} of length \textit{adatalen} to the ChaCha20--Poly1305 state \textit{st}. + +\subsection{Encryption / Decryption} +After the AAD has been processed, the plaintext (or ciphertext depending on the direction) can be processed. + +\index{chacha20poly1305\_encrypt()} +\begin{verbatim} +int chacha20poly1305_encrypt(chacha20poly1305_state *st, + const unsigned char *in, + unsigned long inlen, + unsigned char *out); +\end{verbatim} +This encrypts the data where \textit{in} is the plaintext and \textit{out} is the ciphertext. The length of both are equal and stored in \textit{inlen}. + +\index{chacha20poly1305\_decrypt()} +\begin{verbatim} +int chacha20poly1305_decrypt(chacha20poly1305_state *st, + const unsigned char *in, + unsigned long inlen, + unsigned char *out); +\end{verbatim} +This decrypts the data where \textit{in} is the ciphertext and \textit{out} is the plaintext. The length of both are equal and stored in \textit{inlen}. + +\subsection{State Termination} +To terminate a ChaCha20--Poly1305 state and retrieve the message authentication tag call the following function. + +\index{chacha20poly1305\_done()} +\begin{verbatim} +int chacha20poly1305_done(chacha20poly1305_state *st, + unsigned char *tag, + unsigned long *taglen); +\end{verbatim} +This terminates the ChaCha20--Poly1305 state \textit{st} and stores the tag in \textit{tag} of length \textit{taglen} octets (always 16). + +\subsection{One--Shot Packet} +To process a single packet under any given key the following helper function can be used. + +\index{chacha20poly1305\_memory()} +\begin{verbatim} +int chacha20poly1305_memory(const unsigned char *key, + unsigned long keylen, + const unsigned char *iv, + unsigned long ivlen, + const unsigned char *aad, + unsigned long aadlen, + const unsigned char *in, + unsigned long inlen, + unsigned char *out, + unsigned char *tag, + unsigned long *taglen, + int direction); +\end{verbatim} +This will initialize the ChaCha20--Poly1305 state with the given key, IV and AAD value then proceed to +encrypt (\textit{direction} equals \textbf{CHCHA20POLY1305\_ENCRYPT}) or decrypt (\textit{direction} equals +\textbf{CHCHA20POLY1305\_DECRYPT}) the message text and store the final message tag. The definition of the +variables is the same as it is for all the manual functions. \chapter{One-Way Cryptographic Hash Functions} \mysection{Core Functions} From 50e52d0b4cf320f1ab6d6b2b2d2a0cf4ec230709 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 19 Sep 2017 22:38:29 +0200 Subject: [PATCH 1125/1192] poly1305 doc --- doc/crypt.tex | 70 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 41391bd98..917aed9f4 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -3282,21 +3282,69 @@ \subsection{F9--MAC Functions} This will return \textbf{CRYPT\_OK} on success. This requires the AES or Rijndael descriptor be previously registered, otherwise, it will return \textbf{CRYPT\_NOP}. -\mysection{Poly1305 MAC} +\mysection{Poly1305--MAC} -XXX-TODO see \url{https://en.wikipedia.org/wiki/Poly1305} +The Poly1305--MAC is a cryptographic message authentication code created by Daniel J. Bernstein. +More info at \url{https://en.wikipedia.org/wiki/Poly1305}. -\begin{small} +\subsection{Poly1305--MAC Functions} + +A Poly1305--MAC state is initialized with the following function: +\index{poly1305\_init()} \begin{verbatim} -int poly1305_init(poly1305_state *st, const unsigned char *key, unsigned long keylen); -int poly1305_process(poly1305_state *st, const unsigned char *in, unsigned long inlen); -int poly1305_done(poly1305_state *st, unsigned char *mac, unsigned long *maclen); -int poly1305_test(void); -int poly1305_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); -int poly1305_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); -int poly1305_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); +int poly1305_init( poly1305_state *st, + const unsigned char *key, + unsigned long keylen); \end{verbatim} -\end{small} +This will initialize the Poly1305--MAC state \textit{st}, with the key specified in \textit{key} of length \textit{keylen} octets (always 32). + +To process data through Poly1305--MAC use the following function: +\index{poly1305\_process()} +\begin{verbatim} +int poly1305_process( poly1305_state *st, + const unsigned char *in, + unsigned long inlen); +\end{verbatim} + +This will add the message octets pointed to by \textit{in} of length \textit{inlen} to the Poly1305--MAC state pointed to by \textit{st}. + +To compute the MAC tag value use the following function: +\index{poly1305\_done()} +\begin{verbatim} +int poly1305_done(poly1305_state *st, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} + +This will retrieve the Poly1305--MAC tag from the state pointed to by \textit{st}, and store it in the array pointed to by \textit{mac}. +The \textit{maclen} parameter specifies the maximum size of the destination buffer, and is updated to hold the final size of the tag when +the function returns. + +Helper functions are provided to make parsing memory buffers and files easier. The following functions are provided: +\index{poly1305\_memory()} +\begin{verbatim} +int poly1305_memory(const unsigned char *key, + unsigned long keylen, + const unsigned char *in, + unsigned long inlen, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} +This will compute the Poly1305--MAC of \textit{inlen} bytes of \textit{in}, using the key \textit{key} of length \textit{keylen} bytes. +It will store the MAC in \textit{mac} with the same rules as poly1305\_done(). + +To Poly1305--MAC a file use +\index{poly1305\_file()} +\begin{verbatim} +int poly1305_file( const char *fname, + const unsigned char *key, + unsigned long keylen, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} + +Which will Poly1305--MAC the entire contents of the file specified by \textit{fname} using the key \textit{key} of +length \textit{keylen} bytes. It will store the MAC in \textit{mac} with the same rules as poly1305\_done(). \mysection{BLAKE2s + BLAKE2b MAC} From f3f839ec6c483050cb3381f971ebfc18591f1887 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 19 Sep 2017 22:53:47 +0200 Subject: [PATCH 1126/1192] BLAKE2s + BLAKE2b MAC doc --- doc/crypt.tex | 114 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 94 insertions(+), 20 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 917aed9f4..4913bfcb1 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -3287,8 +3287,6 @@ \subsection{F9--MAC Functions} The Poly1305--MAC is a cryptographic message authentication code created by Daniel J. Bernstein. More info at \url{https://en.wikipedia.org/wiki/Poly1305}. -\subsection{Poly1305--MAC Functions} - A Poly1305--MAC state is initialized with the following function: \index{poly1305\_init()} \begin{verbatim} @@ -3348,27 +3346,103 @@ \subsection{Poly1305--MAC Functions} \mysection{BLAKE2s + BLAKE2b MAC} -XXX-TODO see \url{https://tools.ietf.org/html/rfc7693} +The BLAKE2s and BLAKE2b are cryptographic message authentication code designed by Jean--Philippe Aumasson, +Samuel Neves, Zooko Wilcox-O'Hearn, and Christian Winnerlein. More info at \url{https://tools.ietf.org/html/rfc7693}. -\begin{small} +A BLAKE2s/b--MAC state is initialized with the following function: +\index{blake2smac\_init()} \begin{verbatim} -int blake2smac_init(blake2smac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen); -int blake2smac_process(blake2smac_state *st, const unsigned char *in, unsigned long inlen); -int blake2smac_done(blake2smac_state *st, unsigned char *mac, unsigned long *maclen); -int blake2smac_test(void); -int blake2smac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); -int blake2smac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); -int blake2smac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); - -int blake2bmac_init(blake2bmac_state *st, unsigned long outlen, const unsigned char *key, unsigned long keylen); -int blake2bmac_process(blake2bmac_state *st, const unsigned char *in, unsigned long inlen); -int blake2bmac_done(blake2bmac_state *st, unsigned char *mac, unsigned long *maclen); -int blake2bmac_test(void); -int blake2bmac_memory(const unsigned char *key, unsigned long keylen, const unsigned char *in, unsigned long inlen, unsigned char *mac, unsigned long *maclen); -int blake2bmac_memory_multi(const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen, const unsigned char *in, unsigned long inlen, ...); -int blake2bmac_file(const char *fname, const unsigned char *key, unsigned long keylen, unsigned char *mac, unsigned long *maclen); +int blake2smac_init(blake2smac_state *st, + unsigned long outlen, + const unsigned char *key, + unsigned long keylen); \end{verbatim} -\end{small} +\index{blake2bmac\_init()} +\begin{verbatim} +int blake2bmac_init(blake2smac_state *st, + unsigned long outlen, + const unsigned char *key, + unsigned long keylen); +\end{verbatim} +This will initialize the BLAKE2s/b--MAC state \textit{st}, with the key specified in \textit{key} of length \textit{keylen} octets (up to 64). +The \textit{outlen} specifies the size of the final tag (up to 64 octets). + +To process data through BLAKE2s/b--MAC use the following function: +\index{blake2smac\_process()} +\begin{verbatim} +int blake2smac_process( blake2smac_state *st, + const unsigned char *in, + unsigned long inlen); +\end{verbatim} +\index{blake2bmac\_process()} +\begin{verbatim} +int blake2bmac_process( blake2bmac_state *st, + const unsigned char *in, + unsigned long inlen); +\end{verbatim} + +This will add the message octets pointed to by \textit{in} of length \textit{inlen} to the BLAKE2s/b--MAC state pointed to by \textit{st}. + +To compute the MAC tag value use the following function: +\index{blake2smac\_done()} +\begin{verbatim} +int blake2smac_done(blake2smac_state *st, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} +\index{blake2bmac\_done()} +\begin{verbatim} +int blake2bmac_done(blake2bmac_state *st, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} + +This will retrieve the BLAKE2s/b--MAC tag from the state pointed to by \textit{st}, and store it in the array pointed to by \textit{mac}. +The \textit{maclen} parameter specifies the maximum size of the destination buffer, and is updated to hold the final size of the tag when +the function returns. + +Helper functions are provided to make parsing memory buffers and files easier. The following functions are provided: +\index{blake2smac\_memory()} +\begin{verbatim} +int blake2smac_memory(const unsigned char *key, + unsigned long keylen, + const unsigned char *in, + unsigned long inlen, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} +\index{blake2bmac\_memory()} +\begin{verbatim} +int blake2bmac_memory(const unsigned char *key, + unsigned long keylen, + const unsigned char *in, + unsigned long inlen, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} +This will compute the BLAKE2s/b--MAC of \textit{inlen} bytes of \textit{in}, using the key \textit{key} of length \textit{keylen} bytes. +It will store the MAC in \textit{mac} with the same rules as blake2smac\_done(). + +To BLAKE2s/b--MAC a file use +\index{blake2smac\_file()} +\begin{verbatim} +int blake2smac_file( const char *fname, + const unsigned char *key, + unsigned long keylen, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} +\index{blake2bmac\_file()} +\begin{verbatim} +int blake2bmac_file( const char *fname, + const unsigned char *key, + unsigned long keylen, + unsigned char *mac, + unsigned long *maclen); +\end{verbatim} + +Which will BLAKE2s/b--MAC the entire contents of the file specified by \textit{fname} using the key \textit{key} of +length \textit{keylen} bytes. It will store the MAC in \textit{mac} with the same rules as blake2smac\_done(). \chapter{Pseudo-Random Number Generators} \mysection{Core Functions} From fff9fee1293905977e601a4dad6cbd7305ab251d Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Wed, 20 Sep 2017 14:15:28 +0200 Subject: [PATCH 1127/1192] DSA new functions - doc --- doc/crypt.tex | 73 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 4913bfcb1..13a0f88ac 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -5326,22 +5326,73 @@ \subsection{DSA Key Import} This will import the DSA key from the buffer \textit{in} of length \textit{inlen} to the \textit{key}. If the process fails the function will automatically free all of the heap allocated in the process (you don't have to call dsa\_free()). -\subsection{Other DSA Functions} +\mysection{Other DSA Functions} -XXX-TODO +The following functions allow to create a DSA key in 2 steps: -\begin{small} +\begin{enumerate} + \item Load or generate \textit{p}, \textit{q}, \textit{g} part of the key via \textit{dsa\_set\_pqg()}, \textit{dsa\_set\_pqg\_dsaparam()} or \textit{dsa\_generate\_pqg()}. + \item Load or generate the actual DSA key -- private (\textit{x} and \textit{y} values) or public (\textit{y} value). +\end{enumerate} + +\index{dsa\_set\_pqg()} \begin{verbatim} int dsa_set_pqg(const unsigned char *p, unsigned long plen, const unsigned char *q, unsigned long qlen, const unsigned char *g, unsigned long glen, dsa_key *key); -int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, unsigned long dsaparamlen, dsa_key *key); -int dsa_generate_pqg(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); -int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key *key); -int dsa_generate_key(prng_state *prng, int wprng, dsa_key *key); \end{verbatim} -\end{small} + +This will initialise the \textit{p}, \textit{q} and \textit{g} part of \textit{key} structure by directly loading binary +representation of \textit{p} (with length of \textit{plen}), \textit{q} (with length of \textit{qlen}) and \textit{g} (with length of \textit{glen}). +A simple DSA key validity check (without primality testing) is performed at the end of this function. + +\index{dsa\_set\_pqg\_dsaparam()} +\begin{verbatim} +int dsa_set_pqg_dsaparam(const unsigned char *dsaparam, + unsigned long dsaparamlen, + dsa_key *key); +\end{verbatim} + +This will initialise the \textit{p}, \textit{q} and \textit{g} part of \textit{key} structure by directly loading binary representation +of DSA parameters stored as a binary data in a buffer \textit{dsaparam} (with length of \textit{dsaparamlen}). A simple DSA key validity +check (without primality testing) is performed at the end of this function. The \textit{dsaparam} can be generated via: +\begin{verbatim} + openssl dsaparam 2048 -outform DER -out dsaparam.der +\end{verbatim} + +\index{dsa\_generate\_pqg()} +\begin{verbatim} +int dsa_generate_pqg(prng_state *prng, + int wprng, + int group_size, + int modulus_size, + dsa_key *key); +\end{verbatim} + +This will initialise the \textit{p}, \textit{q} and \textit{g} part of \textit{key} structure with newly generated random values. +As for the parameters they are the same as by \textit{dsa\_make\_key}. + +\index{dsa\_set\_key()} +\begin{verbatim} +int dsa_set_key(const unsigned char *in, + unsigned long inlen, + int type, + dsa_key *key); +\end{verbatim} + +This function can be used for setting the actual DSA key. If \textit{type} is \textit{PK\_PRIVATE} then the buffer \textit{in} +(with length of \textit{inlen}) contains a binary representation of \textit{x} part of the key (the public part \textit{y} is computed). +If \textit{type} is \textit{PK\_PUBLIC} then the buffer \textit{in} contains a binary representation of \textit{y} part of the key. + +\index{dsa\_generate\_key()} +\begin{verbatim} +int dsa_generate_key(prng_state *prng, + int wprng, + dsa_key *key); +\end{verbatim} + +This function generates a private DSA key containing both \textit{x} and \textit{y} parts. \chapter{Standards Support} \mysection{ASN.1 Formats} @@ -6294,16 +6345,18 @@ \subsection{URL--safe 'base64url' encoding} ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_ \end{verbatim} Those characters are sometimes also called URL and filename safe alphabet. - -XXX-TODO +The interface is analogous to \textit{base64\_xxxx} functions in previous chapter. \begin{verbatim} int base64url_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); + int base64url_strict_encode(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); + int base64url_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); + int base64url_strict_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); \end{verbatim} From c210f24853fddfdf89fd98369ff7b58d336ab800 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 13:54:42 +0200 Subject: [PATCH 1128/1192] IV is short for 'initialization vector' --- doc/crypt.tex | 40 +++++++++---------- .../chachapoly/chacha20poly1305_memory.c | 4 +- src/encauth/gcm/gcm_memory.c | 4 +- src/headers/tomcrypt_cipher.h | 4 +- src/mac/hmac/hmac_init.c | 2 +- src/modes/cbc/cbc_getiv.c | 6 +-- src/modes/cbc/cbc_setiv.c | 4 +- src/modes/cbc/cbc_start.c | 2 +- src/modes/cfb/cfb_getiv.c | 6 +-- src/modes/cfb/cfb_setiv.c | 4 +- src/modes/cfb/cfb_start.c | 2 +- src/modes/ctr/ctr_getiv.c | 6 +-- src/modes/ctr/ctr_setiv.c | 4 +- src/modes/ctr/ctr_start.c | 2 +- src/modes/f8/f8_getiv.c | 6 +-- src/modes/f8/f8_setiv.c | 4 +- src/modes/f8/f8_start.c | 2 +- src/modes/ofb/ofb_getiv.c | 6 +-- src/modes/ofb/ofb_setiv.c | 4 +- src/modes/ofb/ofb_start.c | 2 +- 20 files changed, 57 insertions(+), 57 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 13a0f88ac..5f62fcec5 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -781,7 +781,7 @@ \subsection{Notes} \subsection{Background} A typical symmetric block cipher can be used in chaining modes to effectively encrypt messages larger than the block size of the cipher. Given a key $k$, a plaintext $P$ and a cipher $E$ we shall denote the encryption of the block -$P$ under the key $k$ as $E_k(P)$. In some modes there exists an initial vector denoted as $C_{-1}$. +$P$ under the key $k$ as $E_k(P)$. In some modes there exists an initialization vector denoted as $C_{-1}$. \subsubsection{ECB Mode} \index{ECB mode} @@ -799,19 +799,19 @@ \subsubsection{CBC Mode} \begin{equation} C_i = E_k(P_i \oplus C_{i - 1}) \end{equation} -It is important that the initial vector be unique and preferably random for each message encrypted under the same key. +It is important that the initialization vector be unique and preferably random for each message encrypted under the same key. \subsubsection{CTR Mode} \index{CTR mode} -CTR or Counter Mode is a mode which only uses the encryption function of the cipher. Given a initial vector which is +CTR or Counter Mode is a mode which only uses the encryption function of the cipher. Given a initialization vector which is treated as a large binary counter the CTR mode is given as: \begin{eqnarray} C_{-1} = C_{-1} + 1\mbox{ }(\mbox{mod }2^W) \nonumber \\ C_i = P_i \oplus E_k(C_{-1}) \end{eqnarray} -Where $W$ is the size of a block in bits (e.g. 64 for Blowfish). As long as the initial vector is random for each message +Where $W$ is the size of a block in bits (e.g. 64 for Blowfish). As long as the initialization vector is random for each message encrypted under the same key replay and swap attacks are infeasible. CTR mode may look simple but it is as secure -as the block cipher is under a chosen plaintext attack (provided the initial vector is unique). +as the block cipher is under a chosen plaintext attack (provided the initialization vector is unique). \subsubsection{CFB Mode} \index{CFB mode} @@ -822,7 +822,7 @@ \subsubsection{CFB Mode} \end{eqnarray} Note that in this library the output feedback width is equal to the size of the block cipher. That is this mode is used to encrypt whole blocks at a time. However, the library will buffer data allowing the user to encrypt or decrypt partial -blocks without a delay. When this mode is first setup it will initially encrypt the initial vector as required. +blocks without a delay. When this mode is first setup it will initially encrypt the initialization vector as required. \subsubsection{OFB Mode} \index{OFB mode} @@ -1012,7 +1012,7 @@ \subsection{Examples} /* start up CTR mode */ if ((err = ctr_start( find_cipher("twofish"), /* index of desired cipher */ - IV, /* the initial vector */ + IV, /* the initialization vector */ key, /* the secret key */ 16, /* length of secret key (16 bytes) */ 0, /* 0 == default # of rounds */ @@ -1786,7 +1786,7 @@ \subsection{Initialization} as \textit{aadlen}. \subsection{Nonce Vector} -After the state has been initialized (or reset) the next step is to add the session (or packet) initial vector. It should be unique per packet encrypted. +After the state has been initialized (or reset) the next step is to add the session (or packet) initialization vector. It should be unique per packet encrypted. \index{ccm\_add\_nonce()} \begin{verbatim} @@ -1973,7 +1973,7 @@ \subsection{Example Usage} however, unlike EAX it cannot accept \textit{additional authentication data} (meta--data) after plaintext has been processed. This mode also only works with block ciphers with a 16--byte block. -A GCM stream is meant to be processed in three modes, one after another. First, the initial vector (per session) data is processed. This should be +A GCM stream is meant to be processed in three modes, one after another. First, the initialization vector (per session) data is processed. This should be unique to every session. Next, the the optional additional authentication data is processed, and finally the plaintext (or ciphertext depending on the direction). \subsection{Initialization} @@ -1989,8 +1989,8 @@ \subsection{Initialization} This initializes the GCM state \textit{gcm} for the given cipher indexed by \textit{cipher}, with a secret key \textit{key} of length \textit{keylen} octets. The cipher chosen must have a 16--byte block size (e.g., AES). -\subsection{Initial Vector} -After the state has been initialized (or reset) the next step is to add the session (or packet) initial vector. It should be unique per packet encrypted. +\subsection{Initialization Vector} +After the state has been initialized (or reset) the next step is to add the session (or packet) initialization vector. It should be unique per packet encrypted. \index{gcm\_add\_iv()} \begin{verbatim} @@ -1998,7 +1998,7 @@ \subsection{Initial Vector} const unsigned char *IV, unsigned long IVlen); \end{verbatim} -This adds the initial vector octets from \textit{IV} of length \textit{IVlen} to the GCM state \textit{gcm}. You can call this function as many times as required +This adds the initialization vector octets from \textit{IV} of length \textit{IVlen} to the GCM state \textit{gcm}. You can call this function as many times as required to process the entire IV. Note: the GCM protocols provides a \textit{shortcut} for 12--byte IVs where no pre-processing is to be done. If you want to minimize per packet latency it is ideal @@ -2193,8 +2193,8 @@ \subsection{Initialization} This initializes the ChaCha20--Poly1305 state \textit{st} with a secret key \textit{key} of length \textit{keylen} octets (valid lengths: 32 or 16). -\subsection{Initial Vector} -After the state has been initialized the next step is to add the initial vector. +\subsection{Initialization Vector} +After the state has been initialized the next step is to add the initialization vector. \index{chacha20poly1305\_setiv()} \begin{verbatim} @@ -2202,7 +2202,7 @@ \subsection{Initial Vector} const unsigned char *iv, unsigned long ivlen); \end{verbatim} -This adds the initial vector from \textit{iv} of length \textit{ivlen} octects (valid lengths: 8 or 12) to +This adds the initialization vector from \textit{iv} of length \textit{ivlen} octects (valid lengths: 8 or 12) to the ChaCha20--Poly1305 state \textit{st}. \index{chacha20poly1305\_setiv\_rfc7905()} @@ -2212,7 +2212,7 @@ \subsection{Initial Vector} unsigned long ivlen, ulong64 sequence_number); \end{verbatim} -This also adds the initial vector from \textit{iv} of length \textit{ivlen} octects (valid lengths: 8 or 12) to +This also adds the initialization vector from \textit{iv} of length \textit{ivlen} octects (valid lengths: 8 or 12) to the state \textit{st} but it also incorporates 64bit \textit{sequence\_number} into IV as described in RFC7905. You can call only one of \textit{chacha20poly1305\_setiv} or \textit{chacha20poly1305\_setiv\_rfc7905}. @@ -6163,7 +6163,7 @@ \subsection{Algorithm One} \subsection{Algorithm Two} Algorithm Two is the recommended algorithm for this task. It allows variable length salts, and can produce outputs larger than the -hash functions output. As such, it can easily be used to derive session keys for ciphers and MACs as well initial vectors as required +hash functions output. As such, it can easily be used to derive session keys for ciphers and MACs as well initialization vectors as required from a single password and invocation of this algorithm. \index{pkcs\_5\_alg2()} @@ -7295,8 +7295,8 @@ \chapter{Optimizations} /** Accelerated GCM packet (one shot) @param key The secret key @param keylen The length of the secret key - @param IV The initial vector - @param IVlen The length of the initial vector + @param IV The initialization vector + @param IVlen The length of the initialization vector @param adata The additional authentication data (header) @param adatalen The length of the adata @param pt The plaintext @@ -7412,7 +7412,7 @@ \subsubsection{Accelerated ECB} \subsubsection{Accelerated CBC} These two functions are meant for accelerated CBC encryption. These functions are accessed through the accel\_cbc\_encrypt and accel\_cbc\_decrypt pointers. -The \textit{blocks} value is the number of complete blocks to process. The \textit{IV} is the CBC initial vector. It is an input upon calling this function and must be +The \textit{blocks} value is the number of complete blocks to process. The \textit{IV} is the CBC initialization vector. It is an input upon calling this function and must be updated by the function before returning. \subsubsection{Accelerated CTR} diff --git a/src/encauth/chachapoly/chacha20poly1305_memory.c b/src/encauth/chachapoly/chacha20poly1305_memory.c index b9e4d2ee7..e1999cb97 100644 --- a/src/encauth/chachapoly/chacha20poly1305_memory.c +++ b/src/encauth/chachapoly/chacha20poly1305_memory.c @@ -15,8 +15,8 @@ Process an entire GCM packet in one call. @param key The secret key @param keylen The length of the secret key - @param iv The initial vector - @param ivlen The length of the initial vector + @param iv The initialization vector + @param ivlen The length of the initialization vector @param aad The additional authentication data (header) @param aadlen The length of the aad @param in The plaintext diff --git a/src/encauth/gcm/gcm_memory.c b/src/encauth/gcm/gcm_memory.c index 0c8eed8df..7b59960f8 100644 --- a/src/encauth/gcm/gcm_memory.c +++ b/src/encauth/gcm/gcm_memory.c @@ -20,8 +20,8 @@ @param cipher Index of cipher to use @param key The secret key @param keylen The length of the secret key - @param IV The initial vector - @param IVlen The length of the initial vector + @param IV The initialization vector + @param IVlen The length of the initialization vector @param adata The additional authentication data (header) @param adatalen The length of the adata @param pt The plaintext diff --git a/src/headers/tomcrypt_cipher.h b/src/headers/tomcrypt_cipher.h index c4361cdb5..2ed201df4 100644 --- a/src/headers/tomcrypt_cipher.h +++ b/src/headers/tomcrypt_cipher.h @@ -499,8 +499,8 @@ extern struct ltc_cipher_descriptor { /** Accelerated GCM packet (one shot) @param key The secret key @param keylen The length of the secret key - @param IV The initial vector - @param IVlen The length of the initial vector + @param IV The initialization vector + @param IVlen The length of the initialization vector @param adata The additional authentication data (header) @param adatalen The length of the adata @param pt The plaintext diff --git a/src/mac/hmac/hmac_init.c b/src/mac/hmac/hmac_init.c index 79e1f247c..6b6505e57 100644 --- a/src/mac/hmac/hmac_init.c +++ b/src/mac/hmac/hmac_init.c @@ -75,7 +75,7 @@ int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned lon zeromem((hmac->key) + keylen, (size_t)(LTC_HMAC_BLOCKSIZE - keylen)); } - /* Create the initial vector for step (3) */ + /* Create the initialization vector for step (3) */ for(i=0; i < LTC_HMAC_BLOCKSIZE; i++) { buf[i] = hmac->key[i] ^ 0x36; } diff --git a/src/modes/cbc/cbc_getiv.c b/src/modes/cbc/cbc_getiv.c index ef2e65939..fbf68349c 100644 --- a/src/modes/cbc/cbc_getiv.c +++ b/src/modes/cbc/cbc_getiv.c @@ -16,9 +16,9 @@ #ifdef LTC_CBC_MODE /** - Get the current initial vector - @param IV [out] The destination of the initial vector - @param len [in/out] The max size and resulting size of the initial vector + Get the current initialization vector + @param IV [out] The destination of the initialization vector + @param len [in/out] The max size and resulting size of the initialization vector @param cbc The CBC state @return CRYPT_OK if successful */ diff --git a/src/modes/cbc/cbc_setiv.c b/src/modes/cbc/cbc_setiv.c index 06352adc8..255d6419c 100644 --- a/src/modes/cbc/cbc_setiv.c +++ b/src/modes/cbc/cbc_setiv.c @@ -17,8 +17,8 @@ #ifdef LTC_CBC_MODE /** - Set an initial vector - @param IV The initial vector + Set an initialization vector + @param IV The initialization vector @param len The length of the vector (in octets) @param cbc The CBC state @return CRYPT_OK if successful diff --git a/src/modes/cbc/cbc_start.c b/src/modes/cbc/cbc_start.c index 93dd79394..6c5c52c80 100644 --- a/src/modes/cbc/cbc_start.c +++ b/src/modes/cbc/cbc_start.c @@ -18,7 +18,7 @@ /** Initialize a CBC context @param cipher The index of the cipher desired - @param IV The initial vector + @param IV The initialization vector @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) diff --git a/src/modes/cfb/cfb_getiv.c b/src/modes/cfb/cfb_getiv.c index e25d33300..b972c72bd 100644 --- a/src/modes/cfb/cfb_getiv.c +++ b/src/modes/cfb/cfb_getiv.c @@ -16,9 +16,9 @@ #ifdef LTC_CFB_MODE /** - Get the current initial vector - @param IV [out] The destination of the initial vector - @param len [in/out] The max size and resulting size of the initial vector + Get the current initialization vector + @param IV [out] The destination of the initialization vector + @param len [in/out] The max size and resulting size of the initialization vector @param cfb The CFB state @return CRYPT_OK if successful */ diff --git a/src/modes/cfb/cfb_setiv.c b/src/modes/cfb/cfb_setiv.c index ff4acc985..4495bf5fc 100644 --- a/src/modes/cfb/cfb_setiv.c +++ b/src/modes/cfb/cfb_setiv.c @@ -16,8 +16,8 @@ #ifdef LTC_CFB_MODE /** - Set an initial vector - @param IV The initial vector + Set an initialization vector + @param IV The initialization vector @param len The length of the vector (in octets) @param cfb The CFB state @return CRYPT_OK if successful diff --git a/src/modes/cfb/cfb_start.c b/src/modes/cfb/cfb_start.c index 6a97287d0..e49b119b6 100644 --- a/src/modes/cfb/cfb_start.c +++ b/src/modes/cfb/cfb_start.c @@ -19,7 +19,7 @@ /** Initialize a CFB context @param cipher The index of the cipher desired - @param IV The initial vector + @param IV The initialization vector @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) diff --git a/src/modes/ctr/ctr_getiv.c b/src/modes/ctr/ctr_getiv.c index 36ee393a5..cbf92db88 100644 --- a/src/modes/ctr/ctr_getiv.c +++ b/src/modes/ctr/ctr_getiv.c @@ -16,9 +16,9 @@ #ifdef LTC_CTR_MODE /** - Get the current initial vector - @param IV [out] The destination of the initial vector - @param len [in/out] The max size and resulting size of the initial vector + Get the current initialization vector + @param IV [out] The destination of the initialization vector + @param len [in/out] The max size and resulting size of the initialization vector @param ctr The CTR state @return CRYPT_OK if successful */ diff --git a/src/modes/ctr/ctr_setiv.c b/src/modes/ctr/ctr_setiv.c index dbbf6a845..64d73a1f4 100644 --- a/src/modes/ctr/ctr_setiv.c +++ b/src/modes/ctr/ctr_setiv.c @@ -16,8 +16,8 @@ #ifdef LTC_CTR_MODE /** - Set an initial vector - @param IV The initial vector + Set an initialization vector + @param IV The initialization vector @param len The length of the vector (in octets) @param ctr The CTR state @return CRYPT_OK if successful diff --git a/src/modes/ctr/ctr_start.c b/src/modes/ctr/ctr_start.c index e77af4179..039fdd6f5 100644 --- a/src/modes/ctr/ctr_start.c +++ b/src/modes/ctr/ctr_start.c @@ -19,7 +19,7 @@ /** Initialize a CTR context @param cipher The index of the cipher desired - @param IV The initial vector + @param IV The initialization vector @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) diff --git a/src/modes/f8/f8_getiv.c b/src/modes/f8/f8_getiv.c index 7be74cfa8..a5885c95e 100644 --- a/src/modes/f8/f8_getiv.c +++ b/src/modes/f8/f8_getiv.c @@ -16,9 +16,9 @@ #ifdef LTC_F8_MODE /** - Get the current initial vector - @param IV [out] The destination of the initial vector - @param len [in/out] The max size and resulting size of the initial vector + Get the current initialization vector + @param IV [out] The destination of the initialization vector + @param len [in/out] The max size and resulting size of the initialization vector @param f8 The F8 state @return CRYPT_OK if successful */ diff --git a/src/modes/f8/f8_setiv.c b/src/modes/f8/f8_setiv.c index b708e40a2..8f45a3f44 100644 --- a/src/modes/f8/f8_setiv.c +++ b/src/modes/f8/f8_setiv.c @@ -16,8 +16,8 @@ #ifdef LTC_F8_MODE /** - Set an initial vector - @param IV The initial vector + Set an initialization vector + @param IV The initialization vector @param len The length of the vector (in octets) @param f8 The F8 state @return CRYPT_OK if successful diff --git a/src/modes/f8/f8_start.c b/src/modes/f8/f8_start.c index 6beb2de9d..680170294 100644 --- a/src/modes/f8/f8_start.c +++ b/src/modes/f8/f8_start.c @@ -19,7 +19,7 @@ /** Initialize an F8 context @param cipher The index of the cipher desired - @param IV The initial vector + @param IV The initialization vector @param key The secret key @param keylen The length of the secret key (octets) @param salt_key The salting key for the IV diff --git a/src/modes/ofb/ofb_getiv.c b/src/modes/ofb/ofb_getiv.c index 37c40a64d..e6bc0ede0 100644 --- a/src/modes/ofb/ofb_getiv.c +++ b/src/modes/ofb/ofb_getiv.c @@ -16,9 +16,9 @@ #ifdef LTC_OFB_MODE /** - Get the current initial vector - @param IV [out] The destination of the initial vector - @param len [in/out] The max size and resulting size of the initial vector + Get the current initialization vector + @param IV [out] The destination of the initialization vector + @param len [in/out] The max size and resulting size of the initialization vector @param ofb The OFB state @return CRYPT_OK if successful */ diff --git a/src/modes/ofb/ofb_setiv.c b/src/modes/ofb/ofb_setiv.c index 692525b72..005dbc7ad 100644 --- a/src/modes/ofb/ofb_setiv.c +++ b/src/modes/ofb/ofb_setiv.c @@ -16,8 +16,8 @@ #ifdef LTC_OFB_MODE /** - Set an initial vector - @param IV The initial vector + Set an initialization vector + @param IV The initialization vector @param len The length of the vector (in octets) @param ofb The OFB state @return CRYPT_OK if successful diff --git a/src/modes/ofb/ofb_start.c b/src/modes/ofb/ofb_start.c index d981d57ca..fe7a764fd 100644 --- a/src/modes/ofb/ofb_start.c +++ b/src/modes/ofb/ofb_start.c @@ -19,7 +19,7 @@ /** Initialize a OFB context @param cipher The index of the cipher desired - @param IV The initial vector + @param IV The initialization vector @param key The secret key @param keylen The length of the secret key (octets) @param num_rounds Number of rounds in the cipher desired (0 for default) From 4f7747eaec40a727d39c665d1c5fc65986d98f3b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 14:17:22 +0200 Subject: [PATCH 1129/1192] DSA not DH --- src/pk/dsa/dsa_verify_hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/dsa/dsa_verify_hash.c b/src/pk/dsa/dsa_verify_hash.c index 5c6d19c9b..3d3fab5fd 100644 --- a/src/pk/dsa/dsa_verify_hash.c +++ b/src/pk/dsa/dsa_verify_hash.c @@ -23,7 +23,7 @@ @param hash The hash that was signed @param hashlen The length of the hash that was signed @param stat [out] The result of the signature verification, 1==valid, 0==invalid - @param key The corresponding public DH key + @param key The corresponding public DSA key @return CRYPT_OK if successful (even if the signature is invalid) */ int dsa_verify_hash_raw( void *r, void *s, @@ -89,7 +89,7 @@ int dsa_verify_hash_raw( void *r, void *s, @param hash The hash that was signed @param hashlen The length of the hash that was signed @param stat [out] The result of the signature verification, 1==valid, 0==invalid - @param key The corresponding public DH key + @param key The corresponding public DSA key @return CRYPT_OK if successful (even if the signature is invalid) */ int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, From 2d3a921de494d9285b14401feb1b5cbd5636ff32 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 14:18:57 +0200 Subject: [PATCH 1130/1192] align code [skip-ci] --- doc/crypt.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 5f62fcec5..1baf7eead 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -4578,8 +4578,9 @@ \chapter{Diffie-Hellman Key Exchange} Version ::= INTEGER { v1(0) } -Flags ::= BIT STRING { - privateKey (0) -- this BIT is '1' if it's a private key or '0' if it's a public key +Flags ::= BIT STRING { + privateKey (0) -- this BIT is '1' if it's a private key + -- or '0' if it's a public key } \end{verbatim} From 9fb08af23d1ace0df53c4d20392f2020043500aa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 14:33:04 +0200 Subject: [PATCH 1131/1192] fix location of some of the tables this fixes the last open issue of #54 --- doc/crypt.tex | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 1baf7eead..7b3d60a3a 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -8,6 +8,7 @@ \usepackage{graphicx} \usepackage{layout} \usepackage{fancyhdr} +\usepackage{float} \def\union{\cup} \def\intersect{\cap} \def\getsrandom{\stackrel{\rm R}{\gets}} @@ -2523,7 +2524,7 @@ \subsection{Hash Registration} The following hashes are provided as of this release within the LibTomCrypt library: \index{Hash descriptor table} -\begin{figure}[h] +\begin{figure}[H] \begin{center} \begin{tabular}{|c|c|c|} \hline \textbf{Name} & \textbf{Descriptor Name} & \textbf{Size of Message Digest (bytes)} \\ @@ -3627,7 +3628,7 @@ \subsection{Example} will return \textbf{CRYPT\_OK} if the PRNG was found and removed. Otherwise, it returns \textbf{CRYPT\_ERROR}. \subsection{PRNGs Provided} -\begin{figure}[h] +\begin{figure}[H] \begin{center} \begin{small} \begin{tabular}{|c|c|l|} @@ -5166,7 +5167,7 @@ \chapter{Digital Signature Algorithm} \textit{group\_size} the more difficult a forgery becomes upto a limit. The value of $group\_size$ is limited by $15 < group\_size < 1024$ and $modulus\_size - group\_size < 512$. Suggested values for the pairs are as follows. -\begin{figure}[h] +\begin{figure}[H] \begin{center} \begin{tabular}{|c|c|c|} \hline \textbf{Bits of Security} & \textbf{group\_size} & \textbf{modulus\_size} \\ @@ -6666,7 +6667,7 @@ \subsection{Asymmetric Ciphers} Note that $n$ is not the bit-length but the magnitude. For example, for a 1024-bit key $n = 2^{1024}$. The work required is: -\begin{figure}[h] +\begin{figure}[H] \begin{center} \begin{tabular}{|c|c|} \hline RSA/DH Key Size (bits) & Work Factor ($log_2$) \\ @@ -6686,7 +6687,7 @@ \subsection{Asymmetric Ciphers} The work factor for ECC keys is much higher since the best attack is still fully exponential. Given a key of magnitude $n$ it requires $\sqrt n$ work. The following table summarizes the work required: -\begin{figure}[h] +\begin{figure}[H] \begin{center} \begin{tabular}{|c|c|} \hline ECC Key Size (bits) & Work Factor ($log_2$) \\ From 7cc9aad5cc40415c86bb087c359e72ac3c68a77b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 14:33:30 +0200 Subject: [PATCH 1132/1192] remove TODO --- TODO | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 TODO diff --git a/TODO b/TODO deleted file mode 100644 index 30c6e4f8a..000000000 --- a/TODO +++ /dev/null @@ -1,3 +0,0 @@ -for 1.18 -- document new ECC functions -- add test for new functions From f8d132ea039692b7cdb1a984600e81e01a100529 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 15:14:10 +0200 Subject: [PATCH 1133/1192] update changes [skip ci] --- changes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changes b/changes index eed46fc27..91e1542c9 100644 --- a/changes +++ b/changes @@ -22,6 +22,8 @@ v1.18.0 XTS mode and RSA private key operations with keys without CRT parameters -- RC2 now also works with smaller key-sizes -- Improved/extended several tests & demos + -- Hardened DSA and RSA by testing (through Karel's perl-CryptX) + against Google's "Wycheproof" and Kudelski Security's "CDF" -- Fixed all compiler warnings -- Fixed several build issues on FreeBSD, NetBSD, Linux x32 ABI, HP-UX/IA64, Mac OS X, Windows (32&64bit, MingW&MSVC) ... @@ -33,7 +35,7 @@ v1.18.0 -- Add Base64-URL de-/encoding and some strict variants -- Add Blake2b & Blake2s (hash & mac), thanks to Kelvin Sherlock -- Add Camellia block cipher - -- Add ChaCha20 (stream cipher), Poly1305 (mac), ChaCha20Poly1305 (encauth) + -- Add ChaCha (stream cipher), Poly1305 (mac), ChaCha20Poly1305 (encauth) -- Add constant-time mem-compare mem_neq() -- Add DER GeneralizedTime de-/encoding -- Add DSA and ECC key generation FIPS-186-4 compliance From 9a8339737696434daa7ecf13febcdb5dc6d93769 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 17:29:05 +0200 Subject: [PATCH 1134/1192] catch case where we could BOF should_buffer[] [skip ci] --- demos/hashsum.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/demos/hashsum.c b/demos/hashsum.c index f9d53ae02..9f25d0f2d 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -98,6 +98,11 @@ static void check_file(int argn, int argc, char **argv) hash_len = space - s; hash_len /= 2; + if (hash_len > sizeof(should_buffer)) { + fprintf(stderr, "%s: hash too long\n", hashsum); + goto ERR; + } + /* convert the hex-string back to binary */ for (x = 0; x < hash_len; ++x) { should_buffer[x] = HEXOF(s[x*2]) << 4 | HEXOF(s[x*2 + 1]); From a278f72659de0950102d58890cefd81cc502e6eb Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 20 Sep 2017 17:43:07 +0200 Subject: [PATCH 1135/1192] skip comment lines when checking hashes [skip ci] --- demos/hashsum.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demos/hashsum.c b/demos/hashsum.c index 9f25d0f2d..83ab8c6fb 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -90,6 +90,10 @@ static void check_file(int argn, int argc, char **argv) int tries, n; unsigned long hash_len, w, x; char* space = strstr(s, " "); + + /* skip lines with comments */ + if (buf[0] == '#') continue; + if (space == NULL) { fprintf(stderr, "%s: no properly formatted checksum lines found\n", hashsum); goto ERR; From 342a10cc14c9689929f39ab89cbad3385178923e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 21 Sep 2017 13:52:17 +0200 Subject: [PATCH 1136/1192] make PK_MAX_RETRIES a config option --- src/headers/tomcrypt_custom.h | 5 +++++ src/headers/tomcrypt_pk.h | 3 --- src/misc/crypt/crypt.c | 5 ++++- src/pk/dh/dh_generate_key.c | 2 +- src/pk/ecc/ecc_sign_hash.c | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index c657553cc..e1de24880 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -500,6 +500,11 @@ #if defined(LTC_MECC) || defined(LTC_MRSA) || defined(LTC_MDSA) || defined(LTC_MKAT) /* Include the MPI functionality? (required by the PK algorithms) */ #define LTC_MPI + + #ifndef LTC_PK_MAX_RETRIES + /* iterations limit for retry-loops */ + #define LTC_PK_MAX_RETRIES 20 + #endif #endif #ifdef LTC_MRSA diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 802c24478..9f04f38e3 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -17,9 +17,6 @@ enum { /* Indicates standard output formats that can be read e.g. by OpenSSL or GnuTLS */ #define PK_STD 0x1000 -/* iterations limit for retry-loops */ -#define PK_MAX_RETRIES 20 - int rand_prime(void *N, long len, prng_state *prng, int wprng); #ifdef LTC_SOURCE diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index dd41df812..4ab62756e 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -301,7 +301,7 @@ const char *crypt_build_settings = " SOBER128\n" #endif - "\nPK Algs:\n" + "\nPK Crypto:\n" #if defined(LTC_MRSA) " RSA" #if defined(LTC_RSA_BLINDING) && defined(LTC_RSA_CRT_HARDENING) @@ -329,6 +329,9 @@ const char *crypt_build_settings = #if defined(LTC_MKAT) " Katja\n" #endif +#if defined(LTC_PK_MAX_RETRIES) + " "NAME_VALUE(LTC_PK_MAX_RETRIES)"\n" +#endif "\nMPI (Math):\n" #if defined(LTC_MPI) diff --git a/src/pk/dh/dh_generate_key.c b/src/pk/dh/dh_generate_key.c index f128fd82f..69fb6f9d9 100644 --- a/src/pk/dh/dh_generate_key.c +++ b/src/pk/dh/dh_generate_key.c @@ -46,7 +46,7 @@ int dh_generate_key(prng_state *prng, int wprng, dh_key *key) { unsigned char *buf; unsigned long keysize; - int err, max_iterations = PK_MAX_RETRIES; + int err, max_iterations = LTC_PK_MAX_RETRIES; LTC_ARGCHK(key != NULL); LTC_ARGCHK(ltc_mp.name != NULL); diff --git a/src/pk/ecc/ecc_sign_hash.c b/src/pk/ecc/ecc_sign_hash.c index e97dcf4ae..46cdfa36a 100644 --- a/src/pk/ecc/ecc_sign_hash.c +++ b/src/pk/ecc/ecc_sign_hash.c @@ -22,7 +22,7 @@ static int _ecc_sign_hash(const unsigned char *in, unsigned long inlen, { ecc_key pubkey; void *r, *s, *e, *p; - int err, max_iterations = PK_MAX_RETRIES; + int err, max_iterations = LTC_PK_MAX_RETRIES; unsigned long pbits, pbytes, i, shift_right; unsigned char ch, buf[MAXBLOCKSIZE]; From da4f8543295f487cce079d89e1b21c991c4c506f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 21 Sep 2017 16:03:03 +0200 Subject: [PATCH 1137/1192] make sure chacha_crypt() can only be called after setting the IV --- src/stream/chacha/chacha_crypt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/stream/chacha/chacha_crypt.c b/src/stream/chacha/chacha_crypt.c index 66081cec7..6814058fe 100644 --- a/src/stream/chacha/chacha_crypt.c +++ b/src/stream/chacha/chacha_crypt.c @@ -57,9 +57,11 @@ int chacha_crypt(chacha_state *st, const unsigned char *in, unsigned long inlen, unsigned long i, j; if (inlen == 0) return CRYPT_OK; /* nothing to do */ - LTC_ARGCHK(st != NULL); - LTC_ARGCHK(in != NULL); - LTC_ARGCHK(out != NULL); + + LTC_ARGCHK(st != NULL); + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(st->ivlen != 0); if (st->ksleft > 0) { j = MIN(st->ksleft, inlen); From 312247fa0bf7af10242527ea0befdf4be22dad50 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 21 Sep 2017 16:04:01 +0200 Subject: [PATCH 1138/1192] better comments for PKCS#5 --- src/headers/tomcrypt_pkcs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_pkcs.h b/src/headers/tomcrypt_pkcs.h index 5c4bda7e9..247e5387d 100644 --- a/src/headers/tomcrypt_pkcs.h +++ b/src/headers/tomcrypt_pkcs.h @@ -80,13 +80,13 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, /* ===> PKCS #5 -- Password Based Cryptography <=== */ #ifdef LTC_PKCS_5 -/* Algorithm #1 (old) */ +/* Algorithm #1 (PBKDF1) */ int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, const unsigned char *salt, int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen); -/* Algorithm #1 - OpenSSL-compatible variant for arbitrarily-long keys. +/* Algorithm #1 (PBKDF1) - OpenSSL-compatible variant for arbitrarily-long keys. Compatible with EVP_BytesToKey() */ int pkcs_5_alg1_openssl(const unsigned char *password, unsigned long password_len, @@ -94,7 +94,7 @@ int pkcs_5_alg1_openssl(const unsigned char *password, int iteration_count, int hash_idx, unsigned char *out, unsigned long *outlen); -/* Algorithm #2 (new) */ +/* Algorithm #2 (PBKDF2) */ int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, const unsigned char *salt, unsigned long salt_len, int iteration_count, int hash_idx, From eb75c894db2e35087a864db7773428b442e3d911 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 21 Sep 2017 16:13:22 +0200 Subject: [PATCH 1139/1192] hashsum: cleanup at exit --- demos/hashsum.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 83ab8c6fb..69dd2f22f 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -38,6 +38,11 @@ static char* hashsum; +static void cleanup(void) +{ + free(hashsum); +} + static void die(int status) { unsigned long w, x; @@ -53,7 +58,6 @@ static void die(int status) } } if (w != 0) fprintf(o, "\n"); - free(hashsum); exit(status); } @@ -173,6 +177,7 @@ int main(int argc, char **argv) unsigned char hash_buffer[MAXBLOCKSIZE]; hashsum = strdup(basename(argv[0])); + atexit(cleanup); /* You need to register algorithms before using them */ register_all_ciphers(); From 5bb63f1bca12557fab6f2f709a64298f7da7c8e7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 21 Sep 2017 16:15:32 +0200 Subject: [PATCH 1140/1192] hashsum: improve help --- demos/hashsum.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/demos/hashsum.c b/demos/hashsum.c index 69dd2f22f..164bd6838 100644 --- a/demos/hashsum.c +++ b/demos/hashsum.c @@ -47,13 +47,15 @@ static void die(int status) { unsigned long w, x; FILE* o = status == EXIT_SUCCESS ? stdout : stderr; - fprintf(o, "usage: %s -a algorithm [-c] [file...]\n", hashsum); - fprintf(o, "Algorithms:\n"); + fprintf(o, "usage: %s -a algorithm [-c] [file...]\n\n", hashsum); + fprintf(o, "\t-c\tCheck the hash(es) of the file(s) written in [file].\n"); + fprintf(o, "\t\t(-a not required)\n"); + fprintf(o, "\nAlgorithms:\n\t"); w = 0; for (x = 0; hash_descriptor[x].name != NULL; x++) { w += fprintf(o, "%-14s", hash_descriptor[x].name); if (w >= 70) { - fprintf(o, "\n"); + fprintf(o, "\n\t"); w = 0; } } From 8f7986bbb2fd646b4d61b8f297c8c2828fc5e88e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 21 Sep 2017 17:44:33 +0200 Subject: [PATCH 1141/1192] fix coverage_more.sh after updating hashsum --- coverage_more.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coverage_more.sh b/coverage_more.sh index fe79ebbd2..562afcfc3 100755 --- a/coverage_more.sh +++ b/coverage_more.sh @@ -5,7 +5,7 @@ set -e ./sizes ./constants -for i in $(for j in $(echo $(./hashsum -h | tail -n +3)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i tests/test.key ; done > hashsum_tv.txt +for i in $(for j in $(echo $(./hashsum -h | awk '/Algorithms/,EOF' | tail -n +2)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i tests/test.key ; done > hashsum_tv.txt difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true if [ -n "$difftroubles" ]; then echo "FAILURE: hashsum_tv.tx" From ea43d9a1d252a8030c160a784a8461c3afa1a546 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 21 Sep 2017 17:48:50 +0200 Subject: [PATCH 1142/1192] Fix openssl-enc compilation --- demos/openssl-enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/openssl-enc.c b/demos/openssl-enc.c index 211210170..3aca04f47 100644 --- a/demos/openssl-enc.c +++ b/demos/openssl-enc.c @@ -89,7 +89,7 @@ union paddable { * Output: * Side Effects: print messages and barf (does exit(3)) */ -void barf(char *pname, char *err) +void barf(const char *pname, const char *err) { printf("Usage: %s infile outfile passphrase [salt]\n", pname); printf("\n"); From f7c0b251462a89d9602f3994823fcde820492220 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 23 Sep 2017 11:42:05 +0200 Subject: [PATCH 1143/1192] add missing math constants --- src/misc/crypt/crypt_constants.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index a6c4b46ee..f866f3e91 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -153,6 +153,10 @@ static const crypt_constant _crypt_constants[] = { _C_STRINGIFY(LTC_GCM_MODE_TEXT), #endif + _C_STRINGIFY(LTC_MP_LT), + _C_STRINGIFY(LTC_MP_EQ), + _C_STRINGIFY(LTC_MP_GT), + _C_STRINGIFY(LTC_MP_NO), _C_STRINGIFY(LTC_MP_YES), From 83e7f4a1c7d76f8175d59a87daba7d38f2e2c21c Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 25 Sep 2017 15:35:10 +0200 Subject: [PATCH 1144/1192] keep dh_key.x instead of free'ing it the approach before probably saves some bytes on the heap, but it's inconsistent in regards to what we normally do --- src/pk/dh/dh_import.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pk/dh/dh_import.c b/src/pk/dh/dh_import.c index c86f2b5da..579a6aa43 100644 --- a/src/pk/dh/dh_import.c +++ b/src/pk/dh/dh_import.c @@ -69,8 +69,6 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto error; } - mp_clear(key->x); - key->x = NULL; } } else { From 20c6bf812b77b3cf076d0fbccfd8701a038ad0c1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 25 Sep 2017 16:56:57 +0200 Subject: [PATCH 1145/1192] bump version --- doc/Doxyfile | 2 +- src/headers/tomcrypt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index d01b02e75..40e04dd72 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = LibTomCrypt # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.18.0-rc3 +PROJECT_NUMBER = 1.18.0-rc4 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 8c9b36f7a..96b0e3ab8 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -27,7 +27,7 @@ extern "C" { /* version */ #define CRYPT 0x0118 -#define SCRYPT "1.18.0-rc3" +#define SCRYPT "1.18.0-rc4" /* max size of either a cipher/hash block or symmetric key [largest of the two] */ #define MAXBLOCKSIZE 128 From f868a16a44b744d752bb095e50925503516c82ab Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 25 Sep 2017 16:56:59 +0200 Subject: [PATCH 1146/1192] Update makefiles --- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index eb7f580ae..609ad5853 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -27,7 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc3 +VERSION=1.18.0-rc4 #Libraries to be created LIBMAIN_S =libtomcrypt.a diff --git a/makefile.msvc b/makefile.msvc index bf0128937..4ff10eb14 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -22,7 +22,7 @@ EXTRALIBS = ../libtommath/tommath.lib #Compilation flags LTC_CFLAGS = /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 $(CFLAGS) LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) -VERSION=1.18.0-rc3 +VERSION=1.18.0-rc4 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib diff --git a/makefile.unix b/makefile.unix index 1dd42ff86..65276675b 100644 --- a/makefile.unix +++ b/makefile.unix @@ -39,7 +39,7 @@ EXTRALIBS = ../libtommath/libtommath.a #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc3 +VERSION=1.18.0-rc4 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a diff --git a/makefile_include.mk b/makefile_include.mk index 975b49ec9..91aa74eb5 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -3,7 +3,7 @@ # (GNU make only) # The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh -VERSION=1.18.0-rc3 +VERSION=1.18.0-rc4 VERSION_PC=1.18.0 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION_LT=0:118 From 50494637744b734b8d4120936401b06a4327900d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 27 Sep 2017 21:19:33 +0200 Subject: [PATCH 1147/1192] bump the libtool version yeah, helper.pl doesn't update it anymore automagically... we'll probably find a new way to do that in the future... or we keep on updating it manually... This fixes #300 --- helper.pl | 2 +- makefile_include.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helper.pl b/helper.pl index e8e9fc7b6..b18affab8 100755 --- a/helper.pl +++ b/helper.pl @@ -277,7 +277,7 @@ sub patch_makefile { sub version_from_tomcrypt_h { my $h = read_file(shift); if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+)(.*)"/s) { - return "VERSION_PC=$1.$2.$3", "VERSION_LT=0:$1$2", "VERSION=$1.$2.$3$4"; + return "VERSION_PC=$1.$2.$3", "VERSION_LT=1:0", "VERSION=$1.$2.$3$4"; } else { die "#define SCRYPT not found in tomcrypt.h"; diff --git a/makefile_include.mk b/makefile_include.mk index 91aa74eb5..5d3ca0496 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -6,7 +6,7 @@ VERSION=1.18.0-rc4 VERSION_PC=1.18.0 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html -VERSION_LT=0:118 +VERSION_LT=1:0 # Compiler and Linker Names ifndef CROSS_COMPILE From 9c2c9f8af4c1e0073284baceb34a5c88f0e33b49 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 26 Sep 2017 20:06:32 +0200 Subject: [PATCH 1148/1192] libtool on cygwin needs -no-undefined --- makefile.shared | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makefile.shared b/makefile.shared index 75effcb82..4bc6015e1 100644 --- a/makefile.shared +++ b/makefile.shared @@ -23,6 +23,9 @@ ifndef LT LT:=libtool endif endif +ifeq ($(PLATFORM), CYGWIN) + NO_UNDEFINED:=-no-undefined +endif LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC) INSTALL_CMD = $(LT) --mode=install install UNINSTALL_CMD = $(LT) --mode=uninstall rm @@ -46,7 +49,7 @@ src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c LOBJECTS = $(OBJECTS:.o=.lo) $(LIBNAME): $(OBJECTS) - $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) + $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) $(NO_UNDEFINED) test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS) $(LT) --mode=link --tag=CC $(CC) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS) From 13cb43ad4c9be48914f17ea434f858aba0f8a06e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 24 Sep 2017 13:11:35 +0200 Subject: [PATCH 1149/1192] initialize 'flags' etc. to invalid values before trying to decode --- src/pk/dh/dh_import.c | 8 +++++++- src/pk/dsa/dsa_decrypt_key.c | 3 ++- src/pk/dsa/dsa_import.c | 9 +++++++-- src/pk/ecc/ecc_decrypt_key.c | 3 ++- src/pk/ecc/ecc_import.c | 7 ++++++- src/pk/rsa/rsa_import.c | 1 + 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/pk/dh/dh_import.c b/src/pk/dh/dh_import.c index 579a6aa43..b600b5c28 100644 --- a/src/pk/dh/dh_import.c +++ b/src/pk/dh/dh_import.c @@ -32,6 +32,8 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) return err; } + version = 666; + flags[0] = 0xff; /* find out what type of key it is */ err = der_decode_sequence_multi(in, inlen, LTC_ASN1_SHORT_INTEGER, 1UL, &version, @@ -58,7 +60,7 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) goto error; } } - else { + else if (flags[0] == 0) { key->type = PK_PUBLIC; if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_SHORT_INTEGER, 1UL, &version, @@ -70,6 +72,10 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) goto error; } } + else { + err = CRYPT_INVALID_PACKET; + goto error; + } } else { err = CRYPT_INVALID_PACKET; diff --git a/src/pk/dsa/dsa_decrypt_key.c b/src/pk/dsa/dsa_decrypt_key.c index 806ef3e59..67426b8fc 100644 --- a/src/pk/dsa/dsa_decrypt_key.c +++ b/src/pk/dsa/dsa_decrypt_key.c @@ -30,7 +30,8 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, { unsigned char *skey, *expt; void *g_pub; - unsigned long x, y, hashOID[32]; + unsigned long x, y; + unsigned long hashOID[32] = { 0 }; int hash, err; ltc_asn1_list decode[3]; diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 08d64b760..8d949ebbf 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -38,13 +38,14 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) return CRYPT_MEM; } + flags[0] = 0xff; /* try to match the old libtomcrypt format */ err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_EOL, 0UL, NULL); if (err == CRYPT_OK || err == CRYPT_PK_INVALID_SIZE) { /* private key */ - if (flags[0]) { + if (flags[0] == 1) { if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_INTEGER, 1UL, key->g, @@ -59,7 +60,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) goto LBL_OK; } /* public key */ - else { + else if (flags[0] == 0) { if ((err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_INTEGER, 1UL, key->g, @@ -72,6 +73,10 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) key->type = PK_PUBLIC; goto LBL_OK; } + else { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } } /* get key type */ if ((err = der_decode_sequence_multi(in, inlen, diff --git a/src/pk/ecc/ecc_decrypt_key.c b/src/pk/ecc/ecc_decrypt_key.c index 4a16de9d4..94924017b 100644 --- a/src/pk/ecc/ecc_decrypt_key.c +++ b/src/pk/ecc/ecc_decrypt_key.c @@ -35,7 +35,8 @@ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, ecc_key *key) { unsigned char *ecc_shared, *skey, *pub_expt; - unsigned long x, y, hashOID[32]; + unsigned long x, y; + unsigned long hashOID[32] = { 0 }; int hash, err; ecc_key pubkey; ltc_asn1_list decode[3]; diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index 034c9bd83..fce70e233 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -104,6 +104,7 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co return CRYPT_MEM; } + flags[0] = 0xff; /* find out what type of key it is */ err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_EOL, 0UL, NULL); @@ -124,7 +125,7 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto done; } - } else { + } else if (flags[0] == 0) { /* public key */ key->type = PK_PUBLIC; if ((err = der_decode_sequence_multi(in, inlen, @@ -136,6 +137,10 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co goto done; } } + else { + err = CRYPT_INVALID_PACKET; + goto done; + } if (dp == NULL) { /* find the idx */ diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index fbae39bdd..db432b512 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -65,6 +65,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) goto LBL_FREE; } + mp_set_int(key->N, 666); /* not SSL public key, try to match against PKCS #1 standards */ err = der_decode_sequence_multi(in, inlen, LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_EOL, 0UL, NULL); From 4a8bfc0a21da06d445e0c89c9014a6157ecb0645 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 25 Sep 2017 21:58:50 +0200 Subject: [PATCH 1150/1192] introduce CRYPT_INPUT_TOO_LONG --- src/headers/tomcrypt.h | 3 ++- src/misc/crypt/crypt_constants.c | 2 +- src/misc/error_to_string.c | 3 ++- src/pk/asn1/der/sequence/der_decode_sequence_ex.c | 2 +- src/pk/dh/dh_import.c | 4 +--- src/pk/dsa/dsa_decrypt_key.c | 2 +- src/pk/dsa/dsa_import.c | 3 +-- src/pk/ecc/ecc_decrypt_key.c | 2 +- src/pk/ecc/ecc_import.c | 3 +-- src/pk/rsa/rsa_import.c | 3 +-- 10 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 96b0e3ab8..e736a54cd 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -68,7 +68,8 @@ enum { CRYPT_OVERFLOW, /* An overflow of a value was detected/prevented */ CRYPT_UNUSED1, /* UNUSED1 */ - CRYPT_UNUSED2, /* UNUSED2 */ + + CRYPT_INPUT_TOO_LONG, /* The input was longer than expected. */ CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */ diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index f866f3e91..c63d3f84b 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -48,7 +48,7 @@ static const crypt_constant _crypt_constants[] = { _C_STRINGIFY(CRYPT_PK_INVALID_TYPE), _C_STRINGIFY(CRYPT_OVERFLOW), _C_STRINGIFY(CRYPT_UNUSED1), - _C_STRINGIFY(CRYPT_UNUSED2), + _C_STRINGIFY(CRYPT_INPUT_TOO_LONG), _C_STRINGIFY(CRYPT_PK_INVALID_SIZE), _C_STRINGIFY(CRYPT_INVALID_PRIME_SIZE), _C_STRINGIFY(CRYPT_PK_INVALID_PADDING), diff --git a/src/misc/error_to_string.c b/src/misc/error_to_string.c index 2a0d3f80c..707f83594 100644 --- a/src/misc/error_to_string.c +++ b/src/misc/error_to_string.c @@ -47,7 +47,8 @@ static const char * const err_2_str[] = "An overflow of a value was detected/prevented.", "UNUSED1.", - "UNUSED2.", + + "The input was longer than expected.", "Invalid sized parameter.", diff --git a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c index 8a6755e62..b820c68ab 100644 --- a/src/pk/asn1/der/sequence/der_decode_sequence_ex.c +++ b/src/pk/asn1/der/sequence/der_decode_sequence_ex.c @@ -314,7 +314,7 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, if (inlen == 0) { err = CRYPT_OK; } else { - err = CRYPT_PK_INVALID_SIZE; + err = CRYPT_INPUT_TOO_LONG; } LBL_ERR: diff --git a/src/pk/dh/dh_import.c b/src/pk/dh/dh_import.c index b600b5c28..601e5e747 100644 --- a/src/pk/dh/dh_import.c +++ b/src/pk/dh/dh_import.c @@ -32,14 +32,12 @@ int dh_import(const unsigned char *in, unsigned long inlen, dh_key *key) return err; } - version = 666; - flags[0] = 0xff; /* find out what type of key it is */ err = der_decode_sequence_multi(in, inlen, LTC_ASN1_SHORT_INTEGER, 1UL, &version, LTC_ASN1_BIT_STRING, 1UL, &flags, LTC_ASN1_EOL, 0UL, NULL); - if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { + if (err != CRYPT_OK && err != CRYPT_INPUT_TOO_LONG) { goto error; } diff --git a/src/pk/dsa/dsa_decrypt_key.c b/src/pk/dsa/dsa_decrypt_key.c index 67426b8fc..ef4e1dd17 100644 --- a/src/pk/dsa/dsa_decrypt_key.c +++ b/src/pk/dsa/dsa_decrypt_key.c @@ -48,7 +48,7 @@ int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, /* decode to find out hash */ LTC_SET_ASN1(decode, 0, LTC_ASN1_OBJECT_IDENTIFIER, hashOID, sizeof(hashOID)/sizeof(hashOID[0])); err = der_decode_sequence(in, inlen, decode, 1); - if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { + if (err != CRYPT_OK && err != CRYPT_INPUT_TOO_LONG) { return err; } diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index 8d949ebbf..f1f063368 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -38,12 +38,11 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) return CRYPT_MEM; } - flags[0] = 0xff; /* try to match the old libtomcrypt format */ err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_EOL, 0UL, NULL); - if (err == CRYPT_OK || err == CRYPT_PK_INVALID_SIZE) { + if (err == CRYPT_OK || err == CRYPT_INPUT_TOO_LONG) { /* private key */ if (flags[0] == 1) { if ((err = der_decode_sequence_multi(in, inlen, diff --git a/src/pk/ecc/ecc_decrypt_key.c b/src/pk/ecc/ecc_decrypt_key.c index 94924017b..51b894b72 100644 --- a/src/pk/ecc/ecc_decrypt_key.c +++ b/src/pk/ecc/ecc_decrypt_key.c @@ -54,7 +54,7 @@ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, /* decode to find out hash */ LTC_SET_ASN1(decode, 0, LTC_ASN1_OBJECT_IDENTIFIER, hashOID, sizeof(hashOID)/sizeof(hashOID[0])); err = der_decode_sequence(in, inlen, decode, 1); - if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { + if (err != CRYPT_OK && err != CRYPT_INPUT_TOO_LONG) { return err; } diff --git a/src/pk/ecc/ecc_import.c b/src/pk/ecc/ecc_import.c index fce70e233..c6d474fbc 100644 --- a/src/pk/ecc/ecc_import.c +++ b/src/pk/ecc/ecc_import.c @@ -104,11 +104,10 @@ int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, co return CRYPT_MEM; } - flags[0] = 0xff; /* find out what type of key it is */ err = der_decode_sequence_multi(in, inlen, LTC_ASN1_BIT_STRING, 1UL, flags, LTC_ASN1_EOL, 0UL, NULL); - if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { + if (err != CRYPT_OK && err != CRYPT_INPUT_TOO_LONG) { goto done; } diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index db432b512..7140a7383 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -65,12 +65,11 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) goto LBL_FREE; } - mp_set_int(key->N, 666); /* not SSL public key, try to match against PKCS #1 standards */ err = der_decode_sequence_multi(in, inlen, LTC_ASN1_INTEGER, 1UL, key->N, LTC_ASN1_EOL, 0UL, NULL); - if (err != CRYPT_OK && err != CRYPT_PK_INVALID_SIZE) { + if (err != CRYPT_OK && err != CRYPT_INPUT_TOO_LONG) { goto LBL_ERR; } From 07c5e6b0a4b4c7a58a7c7951814ffcb4557b08bf Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 27 Sep 2017 21:37:21 +0200 Subject: [PATCH 1151/1192] bump version --- doc/Doxyfile | 2 +- src/headers/tomcrypt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index 40e04dd72..489e08376 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = LibTomCrypt # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.18.0-rc4 +PROJECT_NUMBER = 1.18.0-rc5 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index e736a54cd..3554335cf 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -27,7 +27,7 @@ extern "C" { /* version */ #define CRYPT 0x0118 -#define SCRYPT "1.18.0-rc4" +#define SCRYPT "1.18.0-rc5" /* max size of either a cipher/hash block or symmetric key [largest of the two] */ #define MAXBLOCKSIZE 128 From 9ff889b330ac80accb9ced8064026535933cc912 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 27 Sep 2017 21:37:23 +0200 Subject: [PATCH 1152/1192] Update makefiles --- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile.mingw b/makefile.mingw index 609ad5853..4c8e237d9 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -27,7 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc4 +VERSION=1.18.0-rc5 #Libraries to be created LIBMAIN_S =libtomcrypt.a diff --git a/makefile.msvc b/makefile.msvc index 4ff10eb14..b06c00ccb 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -22,7 +22,7 @@ EXTRALIBS = ../libtommath/tommath.lib #Compilation flags LTC_CFLAGS = /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 $(CFLAGS) LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) -VERSION=1.18.0-rc4 +VERSION=1.18.0-rc5 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib diff --git a/makefile.unix b/makefile.unix index 65276675b..10ad278c3 100644 --- a/makefile.unix +++ b/makefile.unix @@ -39,7 +39,7 @@ EXTRALIBS = ../libtommath/libtommath.a #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc4 +VERSION=1.18.0-rc5 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a diff --git a/makefile_include.mk b/makefile_include.mk index 5d3ca0496..762c69500 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -3,7 +3,7 @@ # (GNU make only) # The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh -VERSION=1.18.0-rc4 +VERSION=1.18.0-rc5 VERSION_PC=1.18.0 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION_LT=1:0 From f4802ef40ad1d2829995ae745b304f6354ad6c63 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Sep 2017 13:01:08 +0200 Subject: [PATCH 1153/1192] add ltc_math_descriptor to crypt_sizes --- src/misc/crypt/crypt_sizes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 20ca471d4..53381c8c4 100644 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -273,6 +273,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(crc32_state), #endif + _SZ_STRINGIFY_T(ltc_math_descriptor) }; From 98536fa5bf4a39e8c8761b5b288cb11d91a22c36 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 1 Oct 2017 15:40:19 +0200 Subject: [PATCH 1154/1192] add missing dsa_free to _dsa_wycheproof_test - fixes #303 --- tests/dsa_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/dsa_test.c b/tests/dsa_test.c index e77e7de11..e620dde06 100644 --- a/tests/dsa_test.c +++ b/tests/dsa_test.c @@ -313,6 +313,7 @@ static int _dsa_wycheproof_test(void) return CRYPT_FAIL_TESTVECTOR; } + dsa_free(&key); return CRYPT_OK; } From 6da2211ee94ed7619fcfef30fcc52c2046bb0601 Mon Sep 17 00:00:00 2001 From: Rob Swindell Date: Wed, 27 Sep 2017 17:12:19 -0700 Subject: [PATCH 1155/1192] Update rsa_import.c Bug-fix: MAX_RSA_SIZE is the maximum RSA key size in *bits* (as commented in tomcrypt_custom.h), so the proper conversion to bytes (as the argument value to XCALLOC) would be to divide by 8 (bits per byte), not multiply by 8. This excessive allocation (32 Kbytes instead of 512 bytes) is readily apparent in memory-constrained environments. --- src/pk/rsa/rsa_import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index 7140a7383..4602904f2 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -40,7 +40,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) } /* see if the OpenSSL DER format RSA public key will work */ - tmpbuf_len = MAX_RSA_SIZE * 8; + tmpbuf_len = MAX_RSA_SIZE / 8; tmpbuf = XCALLOC(1, tmpbuf_len); if (tmpbuf == NULL) { err = CRYPT_MEM; From 062fc3ffe381b74428c4024fdeb1eb7b1a6df08b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 29 Sep 2017 10:02:23 +0200 Subject: [PATCH 1156/1192] print info when doing a debug build --- makefile_include.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/makefile_include.mk b/makefile_include.mk index 762c69500..03a8ccf2e 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -76,6 +76,7 @@ endif LTC_CFLAGS += -Wno-type-limits ifdef LTC_DEBUG +$(info Debug build) # compile for DEBUGGING (required for ccmalloc checking!!!) LTC_CFLAGS += -g3 -DLTC_NO_ASM ifneq (,$(strip $(LTC_DEBUG))) From 0b0427989025e146258265a37c78b92493ded5ea Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 29 Sep 2017 10:12:52 +0200 Subject: [PATCH 1157/1192] fix bit-length check in der_decode_raw_bit_string() --- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index 9b8bbaccd..e6a59a088 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -77,7 +77,7 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, blen = ((dlen - 1) << 3) - (in[x++] & 7); /* too many bits? */ - if (blen > *outlen) { + if (blen/8 > *outlen) { *outlen = blen; return CRYPT_BUFFER_OVERFLOW; } From 15eab9702b275391593214e9ca58b06e776b4d29 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 29 Sep 2017 10:16:42 +0200 Subject: [PATCH 1158/1192] don't over-allocate that much in der_decode_subject_public_key_info() --- src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 2d865a350..1948e160b 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -58,7 +58,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in } /* see if the OpenSSL DER format RSA public key will work */ - tmpbuf = XCALLOC(1, LTC_DER_MAX_PUBKEY_SIZE*8); + tmpbuf = XCALLOC(1, inlen); if (tmpbuf == NULL) { err = CRYPT_MEM; goto LBL_ERR; @@ -72,7 +72,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in * in a **BIT** string ... so we have to extract it then proceed to convert bit to octet */ LTC_SET_ASN1(subject_pubkey, 0, LTC_ASN1_SEQUENCE, alg_id, 2); - LTC_SET_ASN1(subject_pubkey, 1, LTC_ASN1_RAW_BIT_STRING, tmpbuf, LTC_DER_MAX_PUBKEY_SIZE*8); + LTC_SET_ASN1(subject_pubkey, 1, LTC_ASN1_RAW_BIT_STRING, tmpbuf, inlen); err=der_decode_sequence(in, inlen, subject_pubkey, 2UL); if (err != CRYPT_OK) { From efa089e211013ee3b2dadc75e8b88d618729aeef Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 29 Sep 2017 17:56:37 +0200 Subject: [PATCH 1159/1192] fixup #290 --- tests/der_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/der_test.c b/tests/der_test.c index 9b21b2614..9fa942e2c 100644 --- a/tests/der_test.c +++ b/tests/der_test.c @@ -239,8 +239,8 @@ SEQUENCE(3 elem) static void _der_tests_print_flexi(ltc_asn1_list* l, unsigned int level) { char buf[1024]; - char* name = NULL; - char* text = NULL; + const char* name = NULL; + const char* text = NULL; ltc_asn1_list* ostring = NULL; unsigned int n; From 0500aaec4553c78ce7457e6b4310198f24e4ae3c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 29 Sep 2017 17:58:42 +0200 Subject: [PATCH 1160/1192] add tests for MAX_RSA_SIZE sized openssl-standard RSA keys --- tests/rsa_test.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 241732970..79f49ca58 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -285,6 +285,63 @@ static int rsa_compat_test(void) return 0; } +static int _rsa_key_cmp(const int should_type, const rsa_key *should, const rsa_key *is) +{ + if(should_type != is->type) + return CRYPT_ERROR; + if(should_type == PK_PRIVATE) { + if(mp_cmp(should->q, is->q) != LTC_MP_EQ) + return CRYPT_ERROR; + if(mp_cmp(should->p, is->p) != LTC_MP_EQ) + return CRYPT_ERROR; + if(mp_cmp(should->qP, is->qP) != LTC_MP_EQ) + return CRYPT_ERROR; + if(mp_cmp(should->dP, is->dP) != LTC_MP_EQ) + return CRYPT_ERROR; + if(mp_cmp(should->dQ, is->dQ) != LTC_MP_EQ) + return CRYPT_ERROR; + if(mp_cmp(should->d, is->d) != LTC_MP_EQ) + return CRYPT_ERROR; + } + if(mp_cmp(should->N, is->N) != LTC_MP_EQ) + return CRYPT_ERROR; + if(mp_cmp(should->e, is->e) != LTC_MP_EQ) + return CRYPT_ERROR; + return CRYPT_OK; +} + +static int _rsa_issue_301(int prng_idx) +{ + rsa_key key, key_in; + unsigned char buf[MAX_RSA_SIZE]; + unsigned long len; + + DO(rsa_make_key(&yarrow_prng, prng_idx, MAX_RSA_SIZE/8, 65537, &key)); + + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PRIVATE, &key)); + DO(rsa_import(buf, len, &key_in)); + + DO(_rsa_key_cmp(PK_PRIVATE, &key, &key_in)); + rsa_free(&key_in); + + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PUBLIC, &key)); + DO(rsa_import(buf, len, &key_in)); + + DO(_rsa_key_cmp(PK_PUBLIC, &key, &key_in)); + rsa_free(&key_in); + + len = sizeof(buf); + DO(rsa_export(buf, &len, PK_PUBLIC | PK_STD, &key)); + DO(rsa_import(buf, len, &key_in)); + + DO(_rsa_key_cmp(PK_PUBLIC, &key, &key_in)); + rsa_free(&key_in); + + return 0; +} + int rsa_test(void) { unsigned char in[1024], out[1024], tmp[3072]; @@ -308,6 +365,10 @@ int rsa_test(void) return 1; } + if (_rsa_issue_301(prng_idx) != 0) { + return 1; + } + /* make 10 random key */ for (cnt = 0; cnt < 10; cnt++) { DO(rsa_make_key(&yarrow_prng, prng_idx, 1024/8, 65537, &key)); From ab02d2e450451ed6178f65e4e9a90bc3c8a415fe Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 29 Sep 2017 18:18:35 +0200 Subject: [PATCH 1161/1192] fix rsa_import() of MAX_RSA_SIZE'ed keys The ASN1 encoded RSA key contains two MPI's therefore MAX_RSA_SIZE / 8 isn't enough. --- src/pk/rsa/rsa_import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_import.c b/src/pk/rsa/rsa_import.c index 4602904f2..84cd6f650 100644 --- a/src/pk/rsa/rsa_import.c +++ b/src/pk/rsa/rsa_import.c @@ -40,7 +40,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) } /* see if the OpenSSL DER format RSA public key will work */ - tmpbuf_len = MAX_RSA_SIZE / 8; + tmpbuf_len = inlen; tmpbuf = XCALLOC(1, tmpbuf_len); if (tmpbuf == NULL) { err = CRYPT_MEM; From 9cfbaa83a36268763601c7bb737448f0df3684b8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 29 Sep 2017 18:21:17 +0200 Subject: [PATCH 1162/1192] mostly remove MAX_RSA_SIZE --- src/headers/tomcrypt_custom.h | 11 ----------- src/misc/crypt/crypt.c | 3 --- src/misc/crypt/crypt_constants.c | 3 --- src/pk/dsa/dsa_import.c | 2 +- src/pk/rsa/rsa_import_x509.c | 2 +- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index e1de24880..66c6afc50 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -438,17 +438,6 @@ #endif #endif -/* in cases where you want ASN.1/DER functionality, but no - * RSA, you can define this externally if 1024 is not enough - */ -#if defined(LTC_MRSA) -#define LTC_DER_MAX_PUBKEY_SIZE MAX_RSA_SIZE -#elif !defined(LTC_DER_MAX_PUBKEY_SIZE) -/* this includes DSA */ -#define LTC_DER_MAX_PUBKEY_SIZE 1024 -#endif - - /* PKCS #1 (RSA) and #5 (Password Handling) stuff */ #ifndef LTC_NO_PKCS diff --git a/src/misc/crypt/crypt.c b/src/misc/crypt/crypt.c index 4ab62756e..8cecb32e2 100644 --- a/src/misc/crypt/crypt.c +++ b/src/misc/crypt/crypt.c @@ -399,9 +399,6 @@ const char *crypt_build_settings = #if defined(LTC_DER) " DER " #endif -#if defined(LTC_DER_MAX_PUBKEY_SIZE) - " " NAME_VALUE(LTC_DER_MAX_PUBKEY_SIZE) " " -#endif #if defined(LTC_PKCS_1) " PKCS#1 " #endif diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index c63d3f84b..496d25779 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -107,9 +107,6 @@ static const crypt_constant _crypt_constants[] = { {"LTC_MDSA", 0}, #endif -#ifdef LTC_DER_MAX_PUBKEY_SIZE - _C_STRINGIFY(LTC_DER_MAX_PUBKEY_SIZE), -#endif #ifdef LTC_MILLER_RABIN_REPS _C_STRINGIFY(LTC_MILLER_RABIN_REPS), #endif diff --git a/src/pk/dsa/dsa_import.c b/src/pk/dsa/dsa_import.c index f1f063368..e6a756027 100644 --- a/src/pk/dsa/dsa_import.c +++ b/src/pk/dsa/dsa_import.c @@ -90,7 +90,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key) key->type = PK_PRIVATE; } else { /* public */ ltc_asn1_list params[3]; - unsigned long tmpbuf_len = LTC_DER_MAX_PUBKEY_SIZE*8; + unsigned long tmpbuf_len = inlen; LTC_SET_ASN1(params, 0, LTC_ASN1_INTEGER, key->p, 1UL); LTC_SET_ASN1(params, 1, LTC_ASN1_INTEGER, key->q, 1UL); diff --git a/src/pk/rsa/rsa_import_x509.c b/src/pk/rsa/rsa_import_x509.c index c57d6ea8f..0f2d5f1ce 100644 --- a/src/pk/rsa/rsa_import_x509.c +++ b/src/pk/rsa/rsa_import_x509.c @@ -39,7 +39,7 @@ int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key) return err; } - tmpbuf_len = MAX_RSA_SIZE * 8; + tmpbuf_len = inlen; tmpbuf = XCALLOC(1, tmpbuf_len); if (tmpbuf == NULL) { err = CRYPT_MEM; From 1d20c32a45eb10972d2459a264323ac6dca59576 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 29 Sep 2017 18:33:00 +0200 Subject: [PATCH 1163/1192] update README [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b254c084..e6902b5e0 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ The following list is a small part of the available, but the most often required | ---- | -------- | | `LTC_NO_TEST` | Remove all algorithm self-tests from the library | | `LTC_NO_FILE` | Remove all API functions requiring a pre-defined `FILE` data-type (mostly useful for embedded targets) | -| `MAX_RSA_SIZE` | Per default set to `4096`, if you need support for importing or generating bigger RSA keys, change this at compile-time. | +| `MAX_RSA_SIZE` | Per default set to `4096`, if you need support for generating bigger RSA keys, change this at compile-time. | | `GMP_DESC` | enable [gmp](https://gmplib.org/) as MPI provider *\*1* | | `LTM_DESC` | enable [libtommath](http://www.libtom.net/) as MPI provider *\*1* | | `TFM_DESC` | enable [tomsfastmath](http://www.libtom.net/) as MPI provider *\*1* *\*2* | From 3fef07c03e58ab19cf06b15ee43a68e99c7b07ae Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Sep 2017 01:18:30 +0200 Subject: [PATCH 1164/1192] also clear bits in der_decode_raw_bit_string() --- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index e6a59a088..41e4849f8 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -17,6 +17,7 @@ #ifdef LTC_DER #define SETBIT(v, n) (v=((unsigned char)(v) | (1U << (unsigned char)(n)))) +#define CLRBIT(v, n) (v=((unsigned char)(v) & ~(1U << (unsigned char)(n)))) /** Store a BIT STRING @@ -86,6 +87,8 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, for (y = 0; y < blen; y++) { if (in[x] & (1 << (7 - (y & 7)))) { SETBIT(out[y/8], 7-(y%8)); + } else { + CLRBIT(out[y/8], 7-(y%8)); } if ((y & 7) == 7) { ++x; From 40e4a666935fb46f381eb1c46b843f333b286da6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Sep 2017 01:27:20 +0200 Subject: [PATCH 1165/1192] catch case where blen%8 != 0 --- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index 41e4849f8..f40d6e190 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -78,7 +78,7 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, blen = ((dlen - 1) << 3) - (in[x++] & 7); /* too many bits? */ - if (blen/8 > *outlen) { + if ((blen + 7)/8 > *outlen) { *outlen = blen; return CRYPT_BUFFER_OVERFLOW; } From 30b3a9a986ff99c57f0004bc8cd4fa5977a5b688 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Sep 2017 13:29:11 +0200 Subject: [PATCH 1166/1192] remove {MIN,MAX}_RSA_SIZE --- README.md | 1 - demos/demo_dynamic.py | 2 +- src/headers/tomcrypt_custom.h | 13 ------------- src/misc/crypt/crypt_constants.c | 2 -- src/pk/rsa/rsa_make_key.c | 4 ---- tests/rsa_test.c | 4 ++-- 6 files changed, 3 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index e6902b5e0..c1fca7df5 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ The following list is a small part of the available, but the most often required | ---- | -------- | | `LTC_NO_TEST` | Remove all algorithm self-tests from the library | | `LTC_NO_FILE` | Remove all API functions requiring a pre-defined `FILE` data-type (mostly useful for embedded targets) | -| `MAX_RSA_SIZE` | Per default set to `4096`, if you need support for generating bigger RSA keys, change this at compile-time. | | `GMP_DESC` | enable [gmp](https://gmplib.org/) as MPI provider *\*1* | | `LTM_DESC` | enable [libtommath](http://www.libtom.net/) as MPI provider *\*1* | | `TFM_DESC` | enable [tomsfastmath](http://www.libtom.net/) as MPI provider *\*1* *\*2* | diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index dbfb10a13..a0699e46c 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -150,7 +150,7 @@ def inprint(s, indent=0): b'ENDIAN_LITTLE', b'ENDIAN_64BITWORD', b'PK_PUBLIC', - b'MAX_RSA_SIZE', + b'LTC_MILLER_RABIN_REPS', b'CTR_COUNTER_BIG_ENDIAN', ] for name in names: diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 66c6afc50..923400aa6 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -425,19 +425,6 @@ #define LTC_ECC_TIMING_RESISTANT #endif -/* define these PK sizes out of LTC_NO_PK - * to have them always defined - */ -#if defined(LTC_MRSA) -/* Min and Max RSA key sizes (in bits) */ -#ifndef MIN_RSA_SIZE -#define MIN_RSA_SIZE 1024 -#endif -#ifndef MAX_RSA_SIZE -#define MAX_RSA_SIZE 4096 -#endif -#endif - /* PKCS #1 (RSA) and #5 (Password Handling) stuff */ #ifndef LTC_NO_PKCS diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 496d25779..a7418d5ec 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -77,8 +77,6 @@ static const crypt_constant _crypt_constants[] = { #ifdef LTC_MRSA {"LTC_MRSA", 1}, - _C_STRINGIFY(MIN_RSA_SIZE), - _C_STRINGIFY(MAX_RSA_SIZE), #else {"LTC_MRSA", 0}, #endif diff --git a/src/pk/rsa/rsa_make_key.c b/src/pk/rsa/rsa_make_key.c index 065f733f4..8ba6ab168 100644 --- a/src/pk/rsa/rsa_make_key.c +++ b/src/pk/rsa/rsa_make_key.c @@ -32,10 +32,6 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) LTC_ARGCHK(ltc_mp.name != NULL); LTC_ARGCHK(key != NULL); - if ((size < (MIN_RSA_SIZE/8)) || (size > (MAX_RSA_SIZE/8))) { - return CRYPT_INVALID_KEYSIZE; - } - if ((e < 3) || ((e & 1) == 0)) { return CRYPT_INVALID_ARG; } diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 79f49ca58..998bdda88 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -313,10 +313,10 @@ static int _rsa_key_cmp(const int should_type, const rsa_key *should, const rsa_ static int _rsa_issue_301(int prng_idx) { rsa_key key, key_in; - unsigned char buf[MAX_RSA_SIZE]; + unsigned char buf[4096]; unsigned long len; - DO(rsa_make_key(&yarrow_prng, prng_idx, MAX_RSA_SIZE/8, 65537, &key)); + DO(rsa_make_key(&yarrow_prng, prng_idx, sizeof(buf)/8, 65537, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key)); From d1d95662505d9d76ecf2aa269c330a7536ee875a Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Sep 2017 13:36:27 +0200 Subject: [PATCH 1167/1192] format code --- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 16 ++++++++-------- src/pk/asn1/der/bit/der_encode_raw_bit_string.c | 12 ++++++------ .../der_encode_subject_public_key_info.c | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index f40d6e190..400f2405d 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -85,14 +85,14 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, /* decode/store the bits */ for (y = 0; y < blen; y++) { - if (in[x] & (1 << (7 - (y & 7)))) { - SETBIT(out[y/8], 7-(y%8)); - } else { - CLRBIT(out[y/8], 7-(y%8)); - } - if ((y & 7) == 7) { - ++x; - } + if (in[x] & (1 << (7 - (y & 7)))) { + SETBIT(out[y/8], 7-(y%8)); + } else { + CLRBIT(out[y/8], 7-(y%8)); + } + if ((y & 7) == 7) { + ++x; + } } /* we done */ diff --git a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c index 7e29d8cef..298c4e369 100644 --- a/src/pk/asn1/der/bit/der_encode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_encode_raw_bit_string.c @@ -21,7 +21,7 @@ /** Store a BIT STRING @param in The array of bits to store (8 per char) - @param inlen The number of bits tostore + @param inlen The number of bits to store @param out [out] The destination for the DER encoded BIT STRING @param outlen [in/out] The max size and resulting size of the DER BIT STRING @return CRYPT_OK if successful @@ -68,11 +68,11 @@ int der_encode_raw_bit_string(const unsigned char *in, unsigned long inlen, /* store the bits in big endian format */ for (y = buf = 0; y < inlen; y++) { - buf |= (getbit(in[y/8],7-y%8)?1:0) << (7 - (y & 7)); - if ((y & 7) == 7) { - out[x++] = buf; - buf = 0; - } + buf |= (getbit(in[y/8],7-y%8)?1:0) << (7 - (y & 7)); + if ((y & 7) == 7) { + out[x++] = buf; + buf = 0; + } } /* store last byte */ if (inlen & 7) { diff --git a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c index 2ce8bd1e7..dcb869a9e 100644 --- a/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_encode_subject_public_key_info.c @@ -58,7 +58,7 @@ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen return der_encode_sequence_multi(out, outlen, LTC_ASN1_SEQUENCE, (unsigned long)sizeof(alg_id)/sizeof(alg_id[0]), alg_id, - LTC_ASN1_RAW_BIT_STRING, (unsigned long)(public_key_len*8), public_key, + LTC_ASN1_RAW_BIT_STRING, public_key_len*8U, public_key, LTC_ASN1_EOL, 0UL, NULL); } From e5de0a0004b3eb76f636c071a7aeeff970d0b4b5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Sep 2017 13:36:55 +0200 Subject: [PATCH 1168/1192] Revert "catch case where blen%8 != 0" This reverts commit 548ee347c0d3366a41e5fa28ac3c0b44b362fdb5. --- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index 400f2405d..18fb82923 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -78,7 +78,7 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, blen = ((dlen - 1) << 3) - (in[x++] & 7); /* too many bits? */ - if ((blen + 7)/8 > *outlen) { + if (blen/8 > *outlen) { *outlen = blen; return CRYPT_BUFFER_OVERFLOW; } From db7d7a866e96cf0d068e131df9a2127e9794a513 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Sep 2017 13:37:06 +0200 Subject: [PATCH 1169/1192] Revert "fix bit-length check in der_decode_raw_bit_string()" This reverts commit 2b8d83ff93da0764f19f494de0a8211515428cef. --- src/pk/asn1/der/bit/der_decode_raw_bit_string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c index 18fb82923..223899b33 100644 --- a/src/pk/asn1/der/bit/der_decode_raw_bit_string.c +++ b/src/pk/asn1/der/bit/der_decode_raw_bit_string.c @@ -78,7 +78,7 @@ int der_decode_raw_bit_string(const unsigned char *in, unsigned long inlen, blen = ((dlen - 1) << 3) - (in[x++] & 7); /* too many bits? */ - if (blen/8 > *outlen) { + if (blen > *outlen) { *outlen = blen; return CRYPT_BUFFER_OVERFLOW; } From ce7ae84d0d7c975db6f3ca946f4b36e067c7bddc Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 30 Sep 2017 13:38:25 +0200 Subject: [PATCH 1170/1192] correctly fix decoding of SubjectPublicKeyInfo --- src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c index 1948e160b..682618179 100644 --- a/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c +++ b/src/pk/asn1/der/sequence/der_decode_subject_public_key_info.c @@ -72,7 +72,7 @@ int der_decode_subject_public_key_info(const unsigned char *in, unsigned long in * in a **BIT** string ... so we have to extract it then proceed to convert bit to octet */ LTC_SET_ASN1(subject_pubkey, 0, LTC_ASN1_SEQUENCE, alg_id, 2); - LTC_SET_ASN1(subject_pubkey, 1, LTC_ASN1_RAW_BIT_STRING, tmpbuf, inlen); + LTC_SET_ASN1(subject_pubkey, 1, LTC_ASN1_RAW_BIT_STRING, tmpbuf, inlen*8U); err=der_decode_sequence(in, inlen, subject_pubkey, 2UL); if (err != CRYPT_OK) { From 67f9064b712ee4213927badef69af9d9b6004496 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sun, 1 Oct 2017 14:40:04 +0200 Subject: [PATCH 1171/1192] missing rsa_free in _rsa_issue_301 test --- tests/rsa_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 998bdda88..51252040c 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -339,6 +339,7 @@ static int _rsa_issue_301(int prng_idx) DO(_rsa_key_cmp(PK_PUBLIC, &key, &key_in)); rsa_free(&key_in); + rsa_free(&key); return 0; } From c702ac6f1c7a17e0e14ea36d09ac9f3d9dbcf041 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 2 Oct 2017 01:18:19 +0200 Subject: [PATCH 1172/1192] improve rsa_test a bit --- tests/rsa_test.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 51252040c..44fa1d0b0 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -340,7 +340,7 @@ static int _rsa_issue_301(int prng_idx) rsa_free(&key_in); rsa_free(&key); - return 0; + return CRYPT_OK; } int rsa_test(void) @@ -366,9 +366,7 @@ int rsa_test(void) return 1; } - if (_rsa_issue_301(prng_idx) != 0) { - return 1; - } + DO(_rsa_issue_301(prng_idx)); /* make 10 random key */ for (cnt = 0; cnt < 10; cnt++) { From 7f302dab540f00759f1304ac52615e7d3d53a1c9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 2 Oct 2017 01:18:36 +0200 Subject: [PATCH 1173/1192] make sure size is valid --- src/pk/rsa/rsa_make_key.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pk/rsa/rsa_make_key.c b/src/pk/rsa/rsa_make_key.c index 8ba6ab168..c5c4c2884 100644 --- a/src/pk/rsa/rsa_make_key.c +++ b/src/pk/rsa/rsa_make_key.c @@ -31,6 +31,7 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) LTC_ARGCHK(ltc_mp.name != NULL); LTC_ARGCHK(key != NULL); + LTC_ARGCHK(size > 0); if ((e < 3) || ((e & 1) == 0)) { return CRYPT_INVALID_ARG; From bb291cbbeb7e05dd883f70da1496c2fb09d88c0b Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 22 Sep 2017 15:26:33 +0200 Subject: [PATCH 1174/1192] init_GMP() works perfectly fine --- src/headers/tomcrypt_misc.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 10223799c..f21f30b34 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -78,11 +78,9 @@ void init_LTM(void); #ifdef TFM_DESC void init_TFM(void); #endif -/* *** use of GMP is untested *** #ifdef GMP_DESC void init_GMP(void); #endif -*/ #ifdef LTC_ADLER32 typedef struct adler32_state_s From cb34ef86263fae6506887be701cccbd456cd7f35 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Oct 2017 13:32:17 +0200 Subject: [PATCH 1175/1192] fix-up LTC_FAST related defines/typedefs --- src/headers/tomcrypt_cfg.h | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 8c0866bf1..7990b805b 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -219,20 +219,6 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #endif #endif -/* No LTC_FAST if: explicitly disabled OR non-gcc/non-clang compiler OR old gcc OR using -ansi -std=c99 */ -#if defined(LTC_NO_FAST) || (__GNUC__ < 4) || defined(__STRICT_ANSI__) - #undef LTC_FAST -#endif - -#ifdef LTC_FAST - #define LTC_FAST_TYPE_PTR_CAST(x) ((LTC_FAST_TYPE*)(void*)(x)) - #ifdef ENDIAN_64BITWORD - typedef ulong64 __attribute__((__may_alias__)) LTC_FAST_TYPE; - #else - typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; - #endif -#endif - #ifdef ENDIAN_64BITWORD typedef ulong64 ltc_mp_digit; #else @@ -245,13 +231,26 @@ typedef ulong32 ltc_mp_digit; #undef ENDIAN_32BITWORD #undef ENDIAN_64BITWORD #undef LTC_FAST - #undef LTC_FAST_TYPE #define LTC_NO_ROLC #define LTC_NO_BSWAP #endif +/* No LTC_FAST if: explicitly disabled OR non-gcc/non-clang compiler OR old gcc OR using -ansi -std=c99 */ +#if defined(LTC_NO_FAST) || (__GNUC__ < 4) || defined(__STRICT_ANSI__) + #undef LTC_FAST +#endif + +#ifdef LTC_FAST + #define LTC_FAST_TYPE_PTR_CAST(x) ((LTC_FAST_TYPE*)(void*)(x)) + #ifdef ENDIAN_64BITWORD + typedef ulong64 __attribute__((__may_alias__)) LTC_FAST_TYPE; + #else + typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; + #endif +#endif + #if !defined(ENDIAN_NEUTRAL) && (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD)) - #error You must specify a word size as well as endianess in tomcrypt_cfg.h + #error You must specify a word size as well as endianess in tomcrypt_cfg.h #endif #if !(defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) @@ -259,7 +258,7 @@ typedef ulong32 ltc_mp_digit; #endif #if (defined(ENDIAN_32BITWORD) && defined(ENDIAN_64BITWORD)) - #error Cannot be 32 and 64 bit words... + #error Cannot be 32 and 64 bit words... #endif /* gcc 4.3 and up has a bswap builtin; detect it by gcc version. From caed025f8ac31c093e12832d4bde10d637c24e93 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Oct 2017 18:42:26 +0200 Subject: [PATCH 1176/1192] define ltc_mp_digit as 'unsigned long' resp 'unsigned long long' for x32 This fixes #306 --- src/headers/tomcrypt_cfg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 7990b805b..789476073 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -219,10 +219,10 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #endif #endif -#ifdef ENDIAN_64BITWORD -typedef ulong64 ltc_mp_digit; +#if defined(ENDIAN_64BITWORD) && (defined(__ILP32__) || defined(_ILP32)) +typedef unsigned long long ltc_mp_digit; #else -typedef ulong32 ltc_mp_digit; +typedef unsigned long ltc_mp_digit; #endif /* No asm is a quick way to disable anything "not portable" */ From e438dbc3bfd709639eb621ff166bc326ae9c0c19 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Oct 2017 18:43:32 +0200 Subject: [PATCH 1177/1192] add ltc_mp_digit to sizes and tests --- src/misc/crypt/crypt_sizes.c | 1 + tests/test.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 53381c8c4..79b3bd4f3 100644 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -273,6 +273,7 @@ static const crypt_size _crypt_sizes[] = { _SZ_STRINGIFY_T(crc32_state), #endif + _SZ_STRINGIFY_T(ltc_mp_digit), _SZ_STRINGIFY_T(ltc_math_descriptor) }; diff --git a/tests/test.c b/tests/test.c index 441fdb7d7..7d94f9873 100644 --- a/tests/test.c +++ b/tests/test.c @@ -331,6 +331,7 @@ int main(int argc, char **argv) printf("NO math provider selected, all tests requiring MPI were disabled and will 'nop'\n"); #endif + printf("sizeof(ltc_mp_digit) = %d\n", (int)sizeof(ltc_mp_digit)); #ifdef LTC_PTHREAD tinfo = XCALLOC(sizeof(test_functions)/sizeof(test_functions[0]), sizeof(thread_info)); From 58b71292c325a94191af2108a633892da2e84bf0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Oct 2017 19:20:33 +0200 Subject: [PATCH 1178/1192] fixup caed025f8ac31c093e12832d4bde10d637c24e93 Simply always use an unsigned long long for ltc_mp_digit on 64-bit besides when using MSVC. --- src/headers/tomcrypt_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 789476073..af2a0957e 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -219,7 +219,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #endif #endif -#if defined(ENDIAN_64BITWORD) && (defined(__ILP32__) || defined(_ILP32)) +#if defined(ENDIAN_64BITWORD) && !defined(_MSC_VER) typedef unsigned long long ltc_mp_digit; #else typedef unsigned long ltc_mp_digit; From adcd6ee9fdd2f4957ae04c78fcc65a67117ec9d4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 3 Oct 2017 19:54:27 +0200 Subject: [PATCH 1179/1192] only try to print the version from git if there's git installed --- makefile_include.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index 03a8ccf2e..cbef31c78 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -111,7 +111,7 @@ LTC_CFLAGS += -Wno-nullability-completeness endif -GIT_VERSION := $(shell [ -e .git ] && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION)) +GIT_VERSION := $(shell { [ -e .git ] && which git 2>/dev/null 1>&2 ; } && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION)) ifneq ($(GIT_VERSION),) LTC_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" endif From 959121253d5365fd718014083b649100be6dea68 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 7 Oct 2017 11:35:10 +0200 Subject: [PATCH 1180/1192] rename duplicit rc4.c sober128.c --- src/stream/rc4/{rc4.c => rc4_stream.c} | 0 src/stream/sober128/{sober128.c => sober128_stream.c} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/stream/rc4/{rc4.c => rc4_stream.c} (100%) rename src/stream/sober128/{sober128.c => sober128_stream.c} (100%) diff --git a/src/stream/rc4/rc4.c b/src/stream/rc4/rc4_stream.c similarity index 100% rename from src/stream/rc4/rc4.c rename to src/stream/rc4/rc4_stream.c diff --git a/src/stream/sober128/sober128.c b/src/stream/sober128/sober128_stream.c similarity index 100% rename from src/stream/sober128/sober128.c rename to src/stream/sober128/sober128_stream.c From 2041f9528e3fb279f7a7a786ae9dbcf791e505de Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Sat, 7 Oct 2017 11:35:27 +0200 Subject: [PATCH 1181/1192] update makefiles --- libtomcrypt_VS2008.vcproj | 4 ++-- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libtomcrypt_VS2008.vcproj b/libtomcrypt_VS2008.vcproj index 8c37957c4..cca67e3e4 100644 --- a/libtomcrypt_VS2008.vcproj +++ b/libtomcrypt_VS2008.vcproj @@ -2447,7 +2447,7 @@ Name="rc4" > Date: Sat, 7 Oct 2017 18:09:13 +0200 Subject: [PATCH 1182/1192] fix check_source() --- helper.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper.pl b/helper.pl index b18affab8..916f88147 100755 --- a/helper.pl +++ b/helper.pl @@ -59,7 +59,7 @@ sub check_source { $file !~ m|src/ciphers/.*\.c$| && $file !~ m|src/hashes/.*\.c$| && $file !~ m|src/math/.+_desc.c$| && - $file !~ m|src/stream/sober128/sober128.c$| && + $file !~ m|src/stream/sober128/sober128_stream.c$| && $l =~ /^static\s+\S+\s+([^_][a-zA-Z0-9_]+)\s*\(/) { push @{$troubles->{staticfunc_name}}, "$lineno($1)"; } From 4503ddcfb0d80d9d6f384258f04c4beea4c96ff4 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 8 Oct 2017 01:04:42 +0200 Subject: [PATCH 1183/1192] improve wording [skip ci] --- doc/crypt.tex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/crypt.tex b/doc/crypt.tex index 7b3d60a3a..58534e673 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -4244,9 +4244,8 @@ \subsection{Extended Signatures} \textbf{LTC\_PKCS\_1\_V1\_5\_NA1} as \textit{padding} parameter. This option has been introduced to provide compatibilty to SSL3.0 implementations which implemented this. -When generating a standard v1.5 signature the \textit{prng}, and \textit{prng\_idx} parameters are not checked and can be left to any -values such as $\lbrace$\textbf{NULL}, 0$\rbrace$. When generating a v1.5 signature without ASN.1 additionally the parameter \textit{hash\_idx} is not -checked and can be set to $0$. +When generating a standard v1.5 signature the \textit{prng}, and \textit{prng\_idx} parameters are ignored. +When generating a v1.5 signature without ASN.1 decoding additionally the textit{hash\_idx} parameter is ignored. \mysection{RSA Signature Verification} \index{rsa\_verify\_hash()} From dd0bbdeac04a18398af1cbc3be276e241c878636 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 9 Oct 2017 17:58:47 +0200 Subject: [PATCH 1184/1192] increase default value of Miller-Rabin rounds to 40 --- src/headers/tomcrypt_math.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_math.h b/src/headers/tomcrypt_math.h index 45c3a13d8..d8e7e36bb 100644 --- a/src/headers/tomcrypt_math.h +++ b/src/headers/tomcrypt_math.h @@ -26,8 +26,9 @@ #ifndef LTC_MILLER_RABIN_REPS /* Number of rounds of the Miller-Rabin test - * "Reasonable values of reps are between 15 and 50." c.f. gmp doc of mpz_probab_prime_p() */ - #define LTC_MILLER_RABIN_REPS 35 + * "Reasonable values of reps are between 15 and 50." c.f. gmp doc of mpz_probab_prime_p() + * As of https://security.stackexchange.com/a/4546 we should use 40 rounds */ + #define LTC_MILLER_RABIN_REPS 40 #endif int radix_to_bin(const void *in, int radix, void *out, unsigned long *len); From e40482f82a8e7da9fc609b3c96890cb463548220 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 9 Oct 2017 18:26:38 +0200 Subject: [PATCH 1185/1192] review README.md and changes --- README.md | 2 ++ changes | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c1fca7df5..797a3d869 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ develop: [![Build Status](https://api.travis-ci.org/libtom/libtomcrypt.png?branc [![Coverity Scan Build Status](https://scan.coverity.com/projects/487/badge.svg)](https://scan.coverity.com/projects/487) +API/ABI changes: [check here](https://abi-laboratory.pro/tracker/timeline/libtomcrypt/) + ## Submitting patches Please branch off from develop if you want to submit a patch. diff --git a/changes b/changes index 91e1542c9..eaef07726 100644 --- a/changes +++ b/changes @@ -26,7 +26,7 @@ v1.18.0 against Google's "Wycheproof" and Kudelski Security's "CDF" -- Fixed all compiler warnings -- Fixed several build issues on FreeBSD, NetBSD, Linux x32 ABI, HP-UX/IA64, - Mac OS X, Windows (32&64bit, MingW&MSVC) ... + Mac OS X, Windows (32&64bit, Cygwin, MingW & MSVC) ... -- Re-worked all makefiles -- Re-worked most PRNG's -- The code is now verified by a linter, thanks to Francois Perrad @@ -43,7 +43,7 @@ v1.18.0 -- Add OCBv3 -- Add PKCS#1 v1.5 mode of SSL3.0 -- Add PKCS#1 testvectors from RSA - -- Add PKCS#8 import for RSA keys + -- Add PKCS#8 & X.509 import for RSA keys -- Add stream cipher API -- Add SHA3 & SHAKE -- Add SHA512/256 and SHA512/224 From 233ef8353014b0e8a5309013bb0ae30f3d3e0a1e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 10 Oct 2017 14:29:34 +0200 Subject: [PATCH 1186/1192] suppress some warnings when compiling with mingw-gcc [skip ci] --- makefile_include.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makefile_include.mk b/makefile_include.mk index 4ae1e2514..d501d7b0f 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -106,6 +106,9 @@ endif # COMPILE_DEBUG ifneq ($(findstring clang,$(CC)),) LTC_CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header -Wno-missing-field-initializers endif +ifneq ($(findstring mingw,$(CC)),) +LTC_CFLAGS += -Wno-shadow -Wno-attributes +endif ifeq ($(PLATFORM), Darwin) LTC_CFLAGS += -Wno-nullability-completeness endif From ea5cb8bff699fd1edf65703bc1407e9998cf5a40 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 10 Oct 2017 15:19:01 +0200 Subject: [PATCH 1187/1192] make it possible to use LTC_NOTHING with a math provider --- src/headers/tomcrypt_custom.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 923400aa6..e9ee7ece5 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -62,7 +62,6 @@ /* shortcut to disable automatic inclusion */ #if defined LTC_NOTHING && !defined LTC_EASY - #define LTC_NO_MATH #define LTC_NO_CIPHERS #define LTC_NO_MODES #define LTC_NO_HASHES From 58b5e5c7cab83e1aa708581d79e471c03d3518c9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 10 Oct 2017 15:19:23 +0200 Subject: [PATCH 1188/1192] improve README [skip ci] --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 797a3d869..d8bf01314 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # libtomcrypt -See `doc/crypt.pdf` for a detailed documentation +Previously the git repository contained `doc/crypt.pdf` for detailed documentation. +This was changed and the file is now only available from the tarball of the appropriate version +or from the page https://github.com/libtom/libtomcrypt/releases . ## Project Status From 62143d96bdaabeb7161aad5cfa66ed0abd1b6810 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 10 Oct 2017 15:43:26 +0200 Subject: [PATCH 1189/1192] fix doxygen warning --- src/stream/sober128/sober128_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream/sober128/sober128_stream.c b/src/stream/sober128/sober128_stream.c index 4d002d5e4..5c35edac5 100644 --- a/src/stream/sober128/sober128_stream.c +++ b/src/stream/sober128/sober128_stream.c @@ -9,7 +9,7 @@ #include "tomcrypt.h" /** - @file stream/sober128/sober128.c + @file sober128_stream.c Implementation of SOBER-128 by Tom St Denis. Based on s128fast.c reference code supplied by Greg Rose of QUALCOMM. */ From b3c9f586dcd589942b12ccac23898c1a809c95be Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 10 Oct 2017 15:46:38 +0200 Subject: [PATCH 1190/1192] also patch doc/Doxyfile automatically --- helper.pl | 12 ++++++------ updatemakes.sh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helper.pl b/helper.pl index 916f88147..4e437fa3a 100755 --- a/helper.pl +++ b/helper.pl @@ -260,7 +260,7 @@ sub prepare_msvc_files_xml { return $files; } -sub patch_makefile { +sub patch_file { my ($content, @variables) = @_; for my $v (@variables) { if ($v =~ /^([A-Z0-9_]+)\s*=.*$/si) { @@ -268,7 +268,7 @@ sub patch_makefile { $content =~ s/\n\Q$name\E\b.*?[^\\]\n/\n$v\n/s; } else { - die "patch_makefile failed: " . substr($v, 0, 30) . ".."; + die "patch_file failed: " . substr($v, 0, 30) . ".."; } } return $content; @@ -277,7 +277,7 @@ sub patch_makefile { sub version_from_tomcrypt_h { my $h = read_file(shift); if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+)(.*)"/s) { - return "VERSION_PC=$1.$2.$3", "VERSION_LT=1:0", "VERSION=$1.$2.$3$4"; + return "VERSION_PC=$1.$2.$3", "VERSION_LT=1:0", "VERSION=$1.$2.$3$4", "PROJECT_NUMBER=$1.$2.$3$4"; } else { die "#define SCRYPT not found in tomcrypt.h"; @@ -320,10 +320,10 @@ sub process_makefiles { } # update OBJECTS + HEADERS in makefile* - for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile_include.mk /) { + for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile_include.mk doc\/Doxyfile /) { my $old = read_file($m); - my $new = $m eq 'makefile.msvc' ? patch_makefile($old, $var_obj, $var_h, $var_tobj, @ver_version) - : patch_makefile($old, $var_o, $var_h, $var_to, @ver_version); + my $new = $m eq 'makefile.msvc' ? patch_file($old, $var_obj, $var_h, $var_tobj, @ver_version) + : patch_file($old, $var_o, $var_h, $var_to, @ver_version); if ($old ne $new) { write_file($m, $new) if $write; warn "changed: $m\n"; diff --git a/updatemakes.sh b/updatemakes.sh index 3b747f2bd..14210c05d 100755 --- a/updatemakes.sh +++ b/updatemakes.sh @@ -6,7 +6,7 @@ makefiles=(makefile makefile_include.mk makefile.shared makefile.unix makefile.m vcproj=(libtomcrypt_VS2008.vcproj) if [ $# -eq 1 ] && [ "$1" == "-c" ]; then - git add ${makefiles[@]} ${vcproj[@]} && git commit -m 'Update makefiles' + git add ${makefiles[@]} ${vcproj[@]} doc/Doxyfile && git commit -m 'Update makefiles' fi exit 0 From a7d0008f526728688c97f581d5f72861cf462116 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 10 Oct 2017 15:46:54 +0200 Subject: [PATCH 1191/1192] bump version --- src/headers/tomcrypt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/tomcrypt.h b/src/headers/tomcrypt.h index 3554335cf..efd00e810 100644 --- a/src/headers/tomcrypt.h +++ b/src/headers/tomcrypt.h @@ -27,7 +27,7 @@ extern "C" { /* version */ #define CRYPT 0x0118 -#define SCRYPT "1.18.0-rc5" +#define SCRYPT "1.18.0" /* max size of either a cipher/hash block or symmetric key [largest of the two] */ #define MAXBLOCKSIZE 128 From c165f3a23a602fedec2fcb16b86a77ec788216b8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 10 Oct 2017 15:47:54 +0200 Subject: [PATCH 1192/1192] Update makefiles --- doc/Doxyfile | 2 +- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.unix | 2 +- makefile_include.mk | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index 489e08376..425a98a60 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = LibTomCrypt # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.18.0-rc5 +PROJECT_NUMBER=1.18.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/makefile.mingw b/makefile.mingw index 8ae9c0279..437255db5 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -27,7 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc5 +VERSION=1.18.0 #Libraries to be created LIBMAIN_S =libtomcrypt.a diff --git a/makefile.msvc b/makefile.msvc index ab6213203..a02d1eb4c 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -22,7 +22,7 @@ EXTRALIBS = ../libtommath/tommath.lib #Compilation flags LTC_CFLAGS = /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 $(CFLAGS) LTC_LDFLAGS = advapi32.lib $(EXTRALIBS) -VERSION=1.18.0-rc5 +VERSION=1.18.0 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tomcrypt.lib diff --git a/makefile.unix b/makefile.unix index 4bdf3a1d3..c65a22a02 100644 --- a/makefile.unix +++ b/makefile.unix @@ -39,7 +39,7 @@ EXTRALIBS = ../libtommath/libtommath.a #Compilation flags LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS) LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS) -VERSION=1.18.0-rc5 +VERSION=1.18.0 #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =libtomcrypt.a diff --git a/makefile_include.mk b/makefile_include.mk index d501d7b0f..f5c0c7b1a 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -3,7 +3,7 @@ # (GNU make only) # The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh -VERSION=1.18.0-rc5 +VERSION=1.18.0 VERSION_PC=1.18.0 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html VERSION_LT=1:0